From e22f5fd1f4ea0046910af326540c89a43b3715a0 Mon Sep 17 00:00:00 2001 From: Cris Di Sclafani Date: Wed, 28 Oct 2020 09:45:08 +0100 Subject: [PATCH] Built motion from commit (unavailable).|2.5.4 --- 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 +- 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/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 +- .../api/cloudProvider/cloudProvider.attributes.js | 2 +- .../api/cloudProvider/cloudProvider.controller.js | 2 +- server/api/cloudProvider/cloudProvider.model.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 +- .../cmContactHasPhone.attributes.js | 2 +- .../cmContactHasPhone.controller.js | 2 +- .../cmContactHasPhone/cmContactHasPhone.model.js | 2 +- .../api/cmContactHasPhone/cmContactHasPhone.rpc.js | 2 +- server/api/cmContactHasPhone/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.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/notification/index.js | 2 +- server/api/notification/notification.attributes.js | 2 +- server/api/notification/notification.controller.js | 2 +- server/api/notification/notification.events.js | 2 +- server/api/notification/notification.model.js | 2 +- server/api/notification/notification.rpc.js | 2 +- server/api/notification/notification.socket.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/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 +- 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/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/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 +- server/api/userVoiceQueue/index.js | 2 +- .../userVoiceQueue/userVoiceQueue.attributes.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.model.js | 2 +- server/api/userVoiceQueue/userVoiceQueue.rpc.js | 2 +- server/api/userVoiceQueueRt/index.js | 2 +- .../userVoiceQueueRt.attributes.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.events.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.model.js | 2 +- .../api/userVoiceQueueRt/userVoiceQueueRt.rpc.js | 2 +- .../userVoiceQueueRt/userVoiceQueueRt.socket.js | 2 +- server/api/userWhatsappQueue/index.js | 2 +- .../userWhatsappQueue.attributes.js | 2 +- .../userWhatsappQueue/userWhatsappQueue.model.js | 2 +- .../api/userWhatsappQueue/userWhatsappQueue.rpc.js | 2 +- server/api/variable/index.js | 2 +- server/api/variable/variable.attributes.js | 2 +- server/api/variable/variable.controller.js | 2 +- server/api/variable/variable.model.js | 2 +- server/api/variable/variable.rpc.js | 2 +- server/api/version/index.js | 2 +- server/api/version/version.controller.js | 2 +- server/api/voiceAgentReport/index.js | 2 +- .../voiceAgentReport.attributes.js | 2 +- .../voiceAgentReport.controller.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.model.js | 2 +- .../api/voiceAgentReport/voiceAgentReport.rpc.js | 2 +- server/api/voiceCallReport/index.js | 2 +- .../voiceCallReport/voiceCallReport.attributes.js | 2 +- .../voiceCallReport/voiceCallReport.controller.js | 2 +- .../api/voiceCallReport/voiceCallReport.model.js | 2 +- server/api/voiceCallReport/voiceCallReport.rpc.js | 2 +- server/api/voiceChanSpy/index.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.attributes.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.controller.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.model.js | 2 +- server/api/voiceChanSpy/voiceChanSpy.rpc.js | 2 +- server/api/voiceContext/index.js | 2 +- server/api/voiceContext/voiceContext.attributes.js | 2 +- server/api/voiceContext/voiceContext.controller.js | 2 +- server/api/voiceContext/voiceContext.model.js | 2 +- server/api/voiceContext/voiceContext.rpc.js | 2 +- server/api/voiceDialReport/index.js | 2 +- .../voiceDialReport/voiceDialReport.attributes.js | 2 +- .../voiceDialReport/voiceDialReport.controller.js | 2 +- .../api/voiceDialReport/voiceDialReport.model.js | 2 +- server/api/voiceDialReport/voiceDialReport.rpc.js | 2 +- server/api/voiceExtension/index.js | 2 +- .../voiceExtension/voiceExtension.attributes.js | 2 +- .../voiceExtension/voiceExtension.controller.js | 2 +- server/api/voiceExtension/voiceExtension.events.js | 2 +- server/api/voiceExtension/voiceExtension.model.js | 2 +- server/api/voiceExtension/voiceExtension.rpc.js | 2 +- server/api/voiceExtension/voiceExtension.socket.js | 2 +- server/api/voiceMail/index.js | 2 +- server/api/voiceMail/voiceMail.attributes.js | 2 +- server/api/voiceMail/voiceMail.controller.js | 2 +- server/api/voiceMail/voiceMail.model.js | 2 +- server/api/voiceMail/voiceMail.rpc.js | 2 +- server/api/voiceMailMessage/index.js | 2 +- .../voiceMailMessage.attributes.js | 2 +- .../voiceMailMessage.controller.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.model.js | 2 +- .../api/voiceMailMessage/voiceMailMessage.rpc.js | 2 +- server/api/voiceMusicOnHold/index.js | 2 +- .../voiceMusicOnHold.attributes.js | 2 +- .../voiceMusicOnHold.controller.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.model.js | 2 +- .../api/voiceMusicOnHold/voiceMusicOnHold.rpc.js | 2 +- server/api/voicePrefix/index.js | 2 +- server/api/voicePrefix/voicePrefix.attributes.js | 2 +- server/api/voicePrefix/voicePrefix.controller.js | 2 +- server/api/voicePrefix/voicePrefix.events.js | 2 +- server/api/voicePrefix/voicePrefix.model.js | 2 +- server/api/voicePrefix/voicePrefix.rpc.js | 2 +- server/api/voicePrefix/voicePrefix.socket.js | 2 +- server/api/voiceQueue/index.js | 2 +- server/api/voiceQueue/voiceQueue.attributes.js | 2 +- server/api/voiceQueue/voiceQueue.controller.js | 2 +- server/api/voiceQueue/voiceQueue.events.js | 2 +- server/api/voiceQueue/voiceQueue.model.js | 2 +- server/api/voiceQueue/voiceQueue.rpc.js | 2 +- server/api/voiceQueue/voiceQueue.socket.js | 2 +- server/api/voiceQueueReport/index.js | 2 +- .../voiceQueueReport.attributes.js | 2 +- .../voiceQueueReport.controller.js | 2 +- .../voiceQueueReport/voiceQueueReport.events.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.model.js | 2 +- .../api/voiceQueueReport/voiceQueueReport.rpc.js | 2 +- .../voiceQueueReport/voiceQueueReport.socket.js | 2 +- server/api/voiceQueuesLog/index.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.attributes.js | 2 +- .../voiceQueuesLog/voiceQueuesLog.controller.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.model.js | 2 +- server/api/voiceQueuesLog/voiceQueuesLog.rpc.js | 2 +- server/api/voiceRecording/index.js | 2 +- .../voiceRecording/voiceRecording.attributes.js | 2 +- .../voiceRecording/voiceRecording.controller.js | 2 +- server/api/voiceRecording/voiceRecording.model.js | 2 +- server/api/voiceRecording/voiceRecording.rpc.js | 2 +- server/api/voiceTransferReport/index.js | 2 +- .../voiceTransferReport.attributes.js | 2 +- .../voiceTransferReport.controller.js | 2 +- .../voiceTransferReport.model.js | 2 +- .../voiceTransferReport/voiceTransferReport.rpc.js | 2 +- server/api/webbar/index.js | 2 +- server/api/webbar/webbar.controller.js | 2 +- server/api/whatsappAccount/index.js | 2 +- .../whatsappAccount/whatsappAccount.attributes.js | 2 +- .../whatsappAccount/whatsappAccount.controller.js | 2 +- .../api/whatsappAccount/whatsappAccount.events.js | 2 +- .../api/whatsappAccount/whatsappAccount.model.js | 2 +- server/api/whatsappAccount/whatsappAccount.rpc.js | 2 +- .../api/whatsappAccount/whatsappAccount.socket.js | 2 +- server/api/whatsappApplication/index.js | 2 +- .../whatsappApplication.attributes.js | 2 +- .../whatsappApplication.controller.js | 2 +- .../whatsappApplication.model.js | 2 +- .../whatsappApplication/whatsappApplication.rpc.js | 2 +- server/api/whatsappInteraction/index.js | 2 +- .../whatsappInteraction.attributes.js | 2 +- .../whatsappInteraction.controller.js | 2 +- .../whatsappInteraction.events.js | 2 +- .../whatsappInteraction.model.js | 2 +- .../whatsappInteraction/whatsappInteraction.rpc.js | 2 +- .../whatsappInteraction.socket.js | 2 +- server/api/whatsappMessage/index.js | 2 +- .../whatsappMessage/whatsappMessage.attributes.js | 2 +- .../whatsappMessage/whatsappMessage.controller.js | 2 +- .../api/whatsappMessage/whatsappMessage.events.js | 2 +- .../api/whatsappMessage/whatsappMessage.model.js | 2 +- server/api/whatsappMessage/whatsappMessage.rpc.js | 2 +- .../api/whatsappMessage/whatsappMessage.socket.js | 2 +- server/api/whatsappQueue/index.js | 2 +- .../api/whatsappQueue/whatsappQueue.attributes.js | 2 +- .../api/whatsappQueue/whatsappQueue.controller.js | 2 +- server/api/whatsappQueue/whatsappQueue.events.js | 2 +- server/api/whatsappQueue/whatsappQueue.model.js | 2 +- server/api/whatsappQueue/whatsappQueue.rpc.js | 2 +- server/api/whatsappQueue/whatsappQueue.socket.js | 2 +- server/api/whatsappQueueReport/index.js | 2 +- .../whatsappQueueReport.attributes.js | 2 +- .../whatsappQueueReport.controller.js | 2 +- .../whatsappQueueReport.model.js | 2 +- .../whatsappQueueReport/whatsappQueueReport.rpc.js | 2 +- server/api/whatsappTransferReport/index.js | 2 +- .../whatsappTransferReport.attributes.js | 2 +- .../whatsappTransferReport.controller.js | 2 +- .../whatsappTransferReport.model.js | 2 +- .../whatsappTransferReport.rpc.js | 2 +- server/app.js | 2 +- server/components/auth/service.js | 2 +- server/components/encryptor/index.js | 2 +- server/components/export/csv.js | 2 +- server/components/export/pdf.js | 2 +- server/components/export/xlsx.js | 2 +- server/components/extensions/rewrite.js | 2 +- server/components/import/cm/csv.js | 2 +- server/components/import/cm/csv2.js | 2 +- server/components/import/cm/csvUpdates.js | 2 +- server/components/integrations/configuration.js | 2 +- server/components/interaction/service.js | 2 +- server/components/license/service.js | 2 +- server/components/parsers/advancedSearch.js | 2 +- server/components/parsers/qs.js | 2 +- server/config/express.js | 2 +- server/config/license/hardware.js | 2 +- server/config/license/index.js | 2 +- server/config/license/util.js | 2 +- server/config/local.env.js | 2 +- server/config/logger.js | 2 +- server/config/pm2/config.js | 2 +- server/config/pm2/index.js | 2 +- server/config/schedule/chat.js | 2 +- server/config/schedule/index.js | 2 +- server/config/schedule/transcribe.js | 2 +- server/config/seedContact.js | 2 +- server/config/seedUsers.js | 2 +- server/config/socketio.js | 2 +- server/config/triggers/index.js | 2 +- server/config/utils.js | 2 +- server/errors/index.js | 2 +- server/mysqldb/index.js | 2 +- server/routes.js | 2 +- server/rpc/index.js | 2 +- server/services/agi/channel.js | 2 +- server/services/agi/error.js | 2 +- server/services/agi/graph/index.js | 2 +- server/services/agi/index.js | 2 +- server/services/agi/mailRpc/index.js | 2 +- server/services/agi/reply.js | 2 +- server/services/agi/rpc/index.js | 2 +- server/services/agi/scripts/aws/index.js | 2 +- server/services/agi/scripts/aws/lex/index.js | 2 +- server/services/agi/scripts/aws/lex/lib/api.js | 2 +- server/services/agi/scripts/aws/polly/index.js | 2 +- server/services/agi/scripts/aws/polly/lib/api.js | 2 +- server/services/agi/scripts/google/asr/index.js | 2 +- server/services/agi/scripts/google/asr/lib/api.js | 2 +- server/services/agi/scripts/google/index.js | 2 +- server/services/agi/scripts/index.js | 2 +- server/services/agi/scripts/sestek/index.js | 2 +- server/services/agi/scripts/sestek/nda/index.js | 2 +- server/services/agi/scripts/tilde/asr/index.js | 2 +- server/services/agi/scripts/tilde/asr/lib/api.js | 2 +- server/services/agi/scripts/tilde/index.js | 2 +- server/services/agi/server.js | 2 +- server/services/agi/vertices.js | 2 +- server/services/ami/acw/index.js | 2 +- server/services/ami/ami.js | 2 +- server/services/ami/client.js | 2 +- server/services/ami/dialer/action.js | 2 +- server/services/ami/dialer/additionalPhone.js | 2 +- server/services/ami/dialer/agentComplete.js | 2 +- server/services/ami/dialer/final.js | 2 +- server/services/ami/dialer/hangup.js | 2 +- server/services/ami/dialer/history.js | 2 +- server/services/ami/dialer/index.js | 2 +- server/services/ami/dialer/queueCallerAbandon.js | 2 +- server/services/ami/fax/action.js | 2 +- server/services/ami/fax/index.js | 2 +- server/services/ami/fax/rpcDb.js | 2 +- server/services/ami/fax/util/gs.js | 2 +- server/services/ami/fax/util/util.js | 2 +- server/services/ami/index.js | 2 +- server/services/ami/model/agent.js | 2 +- server/services/ami/model/campaign.js | 2 +- server/services/ami/model/channel.js | 2 +- server/services/ami/model/deskAccount.js | 2 +- server/services/ami/model/dynamics365Account.js | 2 +- server/services/ami/model/faxAccount.js | 2 +- server/services/ami/model/freshdeskAccount.js | 2 +- server/services/ami/model/freshsalesAccount.js | 2 +- server/services/ami/model/queueReport.js | 2 +- server/services/ami/model/salesforceAccount.js | 2 +- server/services/ami/model/servicenowAccount.js | 2 +- server/services/ami/model/sugarcrmAccount.js | 2 +- server/services/ami/model/telephone.js | 2 +- server/services/ami/model/template.js | 2 +- server/services/ami/model/trigger.js | 2 +- server/services/ami/model/trunk.js | 2 +- server/services/ami/model/voiceExtension.js | 2 +- server/services/ami/model/voiceQueue.js | 2 +- server/services/ami/model/vtigerAccount.js | 2 +- server/services/ami/model/zendeskAccount.js | 2 +- server/services/ami/model/zohoAccount.js | 2 +- server/services/ami/preview/action.js | 2 +- server/services/ami/preview/index.js | 2 +- server/services/ami/preview/rpcDb.js | 2 +- server/services/ami/preview/util/util.js | 2 +- server/services/ami/properties.js | 2 +- server/services/ami/realtime/index.js | 2 +- server/services/ami/report/index.js | 2 +- server/services/ami/report/userReport.js | 2 +- server/services/ami/report/voiceAgentReport.js | 2 +- server/services/ami/report/voiceCallReport.js | 2 +- server/services/ami/report/voiceDialReport.js | 2 +- server/services/ami/report/voiceQueueReport.js | 2 +- server/services/ami/rpc/agentReportPreview.js | 2 +- server/services/ami/rpc/attachment.js | 2 +- server/services/ami/rpc/campaign.js | 2 +- server/services/ami/rpc/cmContact.js | 2 +- server/services/ami/rpc/cmHopper.js | 2 +- server/services/ami/rpc/cmHopperAdditionalPhone.js | 2 +- server/services/ami/rpc/cmHopperBlack.js | 2 +- server/services/ami/rpc/cmHopperFinal.js | 2 +- server/services/ami/rpc/cmHopperHistory.js | 2 +- server/services/ami/rpc/faxAccount.js | 2 +- server/services/ami/rpc/faxMessage.js | 2 +- server/services/ami/rpc/integrations/desk.js | 2 +- .../services/ami/rpc/integrations/dynamics365.js | 2 +- server/services/ami/rpc/integrations/freshdesk.js | 2 +- server/services/ami/rpc/integrations/freshsales.js | 2 +- server/services/ami/rpc/integrations/salesforce.js | 2 +- server/services/ami/rpc/integrations/servicenow.js | 2 +- server/services/ami/rpc/integrations/sugarcrm.js | 2 +- server/services/ami/rpc/integrations/vtiger.js | 2 +- server/services/ami/rpc/integrations/zendesk.js | 2 +- server/services/ami/rpc/integrations/zoho.js | 2 +- server/services/ami/rpc/memberReport.js | 2 +- server/services/ami/rpc/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/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 +- .../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/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 +- 1160 files changed, 1160 insertions(+), 1160 deletions(-) diff --git a/apidoc/api_project.js b/apidoc/api_project.js index b6032e8..d2db6c5 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.5.4", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-10-28T08:10:29.644Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); +define({ "name": "xCALLY Motion API", "version": "2.5.4", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-10-28T08:37:47.414Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index ff26622..f1f4212 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.5.4", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-10-28T08:10:29.644Z", "url": "http://apidocjs.com", "version": "0.19.0" } } +{ "name": "xCALLY Motion API", "version": "2.5.4", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

We make changes to the APIs from time to time. For more information, see Changelog.

\n

The xCALLY MOTION API consists of several different APIs. Use the left sidebar menu to select one.

\n

The API is a JSON API. XML is not supported. To learn more, see [Working with JSON].

\n

Endpoints are documented with the HTTP method for the request and a partial resource identifier.\nExample:

\n
GET /api/users\n
\n

Prepend your xCALLY URL to the resource identifier to get the full endpoint URL:

\n
https://motion.xcally.com/api/users\n
\n

Curly braces, {}, indicate values you have to supply. Example:

\n
GET  /api/users/{id}\n
\n

The examples in the docs are cURL statements. You can run the statements on a command line to try out different API requests. To learn more, see [Installing and using cURL]. In Windows, you'll need to modify some of the examples in the docs to make them work. See [Using cURL in Windows].

\n

The examples use basic authentication requiring a xCALLY username and password.

\n

Security and Authentication

\n

This is an SSL-only API, regardless of how your account is configured. You can authorize against the API using either basic authentication with your username and password or with an OAuth access token or API Key.

\n

Client-side CORS requests are supported if the request is authenticated with an OAuth access token. The requests are not supported if the request uses basic authentication or API Key.

\n

Basic authentication

\n

Use the following authentication format with your username and password:\n{username}:{password}

\n

Example:

\n
curl -u admin:password https://motion.xcally.com/api/users\n
\n

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

In your requests, specify the access token in an Authorization header as follows:\nAuthorization: Bearer {token}

\n

Example:

\n
curl -H \"Authorization: Bearer gErypPlm4dOVgGRvA1ZzMH5MQ3nLo8bo\" https://motion.xcally.com/api/users\n
\n

API Key

\n

In your request, specify the API Key in apikey query parameter

\n

Example:

\n
curl https://motion.xcally.com/api/users?apikey=eyJhbGciOiJIUzUxMiIsInR5cC...\n
\n

Request Format

\n

The xCALLY API is a JSON API. You must supply a Content-Type: application/json header in PUT and POST requests. You must set an Accept: application/json header on all requests. You may get a text/plain response in case of an error like a bad request. You should treat this as an error you need to fix.

\n

Response Format

\n

The xCALLY API responds to successful requests with HTTP status codes in the 200 or 300 range. When you create or update a resource, the API renders the resulting JSON representation in the response body.

\n

Responses may have the status codes described in the following sections.

\n

200 range

\n

The request was successful. The status is 200 for successful GET and PUT requests, 201 for most POST requests, and 204 for DELETE requests.

\n

400 range

\n

The request was not successful. The content type of the response may be text/plain for API-level error messages, such as when trying to call the API without SSL. The content type is application/json for business-level error messages because the response includes a JSON object with information about the error.

\n

If you see a response from a known endpoint that looks like plain text, you probably made a syntax error in your request. This type of response commonly occurs when making a request to a nonexistent xCALLY Support instance.

\n

500 range

\n

When building an API client, we recommend treating any 500 status codes as a warning or temporary state. However, if the status persists and we don't have a publicly announced maintenance or service disruption, contact us at support@xcally.com.

\n

If submitting a ticket to Support, provide the complete HTTP response. This helps the Support team track down the request in the logs more quickly.

\n

Data Types

\n

The API returns and accepts JSON values, which can be strings in double quotes, numbers, objects, arrays, true or false, or null. Most programming languages have tools to parse this data.

\n

ID integers

\n

Most xCALLY Support resources such as queues and users are identified by the integer specified by the id attribute of API responses.

\n

The default numeric type in JavaScript, Ruby, Python, and PHP is sufficient to represent xCALLY Support ID integers.

\n

Time stamps

\n

Time stamps use UTC time and are formatted as ISO 8601 strings. Example: 2017-04-16T09:14:57Z

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-10-28T08:37:47.414Z", "url": "http://apidocjs.com", "version": "0.19.0" } } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 7bc9e3a..33cd8b2 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 _0x7d5f=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','TEXT','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','bot'];(function(_0x57b885,_0x3791d0){var _0x29d992=function(_0x48411a){while(--_0x48411a){_0x57b885['push'](_0x57b885['shift']());}};_0x29d992(++_0x3791d0);}(_0x7d5f,0x18b));var _0xf7d5=function(_0x188488,_0x1cdc78){_0x188488=_0x188488-0x0;var _0x2a3792=_0x7d5f[_0x188488];return _0x2a3792;};'use strict';var Sequelize=require('sequelize');module[_0xf7d5('0x0')]={'name':{'type':Sequelize[_0xf7d5('0x1')],'get':function(_0x3e1860){return this[_0xf7d5('0x2')](_0xf7d5('0x3'));}},'action':{'type':Sequelize[_0xf7d5('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xf7d5('0x5'),_0xf7d5('0x6'),_0xf7d5('0x7'),_0xf7d5('0x8'),_0xf7d5('0x9'),'browser',_0xf7d5('0xa'),_0xf7d5('0xb')]],'msg':_0xf7d5('0xc')}},'comment':_0xf7d5('0xc')},'data1':{'type':Sequelize[_0xf7d5('0x4')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize[_0xf7d5('0x4')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0xf7d5('0x4')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize[_0xf7d5('0x4')]},'data7':{'type':Sequelize[_0xf7d5('0xd')]}}; \ No newline at end of file +var _0x9ec4=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports','VIRTUAL','getDataValue','action','STRING','integration','jscripty','browser','script'];(function(_0x1bbbc0,_0x336224){var _0xf8d8e7=function(_0x17e3e0){while(--_0x17e3e0){_0x1bbbc0['push'](_0x1bbbc0['shift']());}};_0xf8d8e7(++_0x336224);}(_0x9ec4,0x139));var _0x49ec=function(_0x8bdffd,_0x3b4220){_0x8bdffd=_0x8bdffd-0x0;var _0x380dfa=_0x9ec4[_0x8bdffd];return _0x380dfa;};'use strict';var Sequelize=require('sequelize');module[_0x49ec('0x0')]={'name':{'type':Sequelize[_0x49ec('0x1')],'get':function(_0xd8d8e6){return this[_0x49ec('0x2')](_0x49ec('0x3'));}},'action':{'type':Sequelize[_0x49ec('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x49ec('0x5'),'motionbar',_0x49ec('0x6'),'urlForward',_0x49ec('0x7'),'bot',_0x49ec('0x8')]],'msg':_0x49ec('0x9')}},'comment':_0x49ec('0x9')},'data1':{'type':Sequelize[_0x49ec('0x4')](0x1000),'comment':_0x49ec('0xa')},'data2':{'type':Sequelize[_0x49ec('0x4')](0x1000),'comment':_0x49ec('0xb')},'data3':{'type':Sequelize[_0x49ec('0x4')](0x1000),'comment':_0x49ec('0xc')},'data4':{'type':Sequelize[_0x49ec('0x4')](0x1000)},'data5':{'type':Sequelize[_0x49ec('0x4')](0x1000)},'data6':{'type':Sequelize[_0x49ec('0x4')]},'data7':{'type':Sequelize[_0x49ec('0xd')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 6343fe9..f0903f9 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 _0x95d7=['util','path','ejs','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','end','sendStatus','stack','name','body','Action','params','catch','destroy','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x2134fa,_0x42a1dd){var _0x4a7d4f=function(_0x22e1bb){while(--_0x22e1bb){_0x2134fa['push'](_0x2134fa['shift']());}};_0x4a7d4f(++_0x42a1dd);}(_0x95d7,0xf0));var _0x795d=function(_0x2b9c52,_0x3d9430){_0x2b9c52=_0x2b9c52-0x0;var _0x3cb057=_0x95d7[_0x2b9c52];return _0x3cb057;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x795d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x795d('0x1'));var jsonpatch=require(_0x795d('0x2'));var rp=require(_0x795d('0x3'));var moment=require('moment');var BPromise=require(_0x795d('0x4'));var Mustache=require(_0x795d('0x5'));var util=require(_0x795d('0x6'));var path=require(_0x795d('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x795d('0x8'));var fs=require('fs');var _=require(_0x795d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x795d('0xa'));var toCsv=require(_0x795d('0xb'));var querystring=require(_0x795d('0xc'));var Papa=require(_0x795d('0xd'));var Redis=require(_0x795d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x795d('0xf'));var as=require(_0x795d('0x10'));var hardwareService=require(_0x795d('0x11'));var logger=require(_0x795d('0x12'))(_0x795d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb39620,_0x2bf0df){_0x2bf0df=_0x2bf0df||0xcc;return function(_0x560179){if(_0x560179){return _0xb39620['sendStatus'](_0x2bf0df);}return _0xb39620[_0x795d('0x14')](_0x2bf0df)['end']();};}function respondWithResult(_0x59cc92,_0x499b70){_0x499b70=_0x499b70||0xc8;return function(_0x19456e){if(_0x19456e){return _0x59cc92['status'](_0x499b70)['json'](_0x19456e);}};}function respondWithFilteredResult(_0x14a81f,_0x29b694){return function(_0x28aa41){if(_0x28aa41){var _0x246b8d=_0x28aa41[_0x795d('0x15')],_0xbc541e=_0x29b694[_0x795d('0x16')],_0x7d5c25=_0x29b694[_0x795d('0x16')]+_0x29b694[_0x795d('0x17')],_0x550ee5;if(_0x7d5c25>=_0x246b8d){_0x7d5c25=_0x246b8d;_0x550ee5=0xc8;}else{_0x550ee5=0xce;}_0x14a81f['status'](_0x550ee5);return _0x14a81f[_0x795d('0x18')](_0x795d('0x19'),_0xbc541e+'-'+_0x7d5c25+'/'+_0x246b8d)[_0x795d('0x1a')](_0x28aa41);}return null;};}function patchUpdates(_0x4b3c2f){return function(_0x572b11){try{jsonpatch[_0x795d('0x1b')](_0x572b11,_0x4b3c2f,!![]);}catch(_0x4b5926){return BPromise[_0x795d('0x1c')](_0x4b5926);}return _0x572b11[_0x795d('0x1d')]();};}function saveUpdates(_0x56fd3a,_0x19f6a4){return function(_0x35ad9a){if(_0x35ad9a){return _0x35ad9a[_0x795d('0x1e')](_0x56fd3a)['then'](function(_0x18faaf){return _0x18faaf;});}return null;};}function removeEntity(_0x33c597,_0x14e1ff){return function(_0x91ca22){if(_0x91ca22){return _0x91ca22['destroy']()[_0x795d('0x1f')](function(){_0x33c597['status'](0xcc)[_0x795d('0x20')]();});}};}function handleEntityNotFound(_0x1f6306,_0x61306b){return function(_0x5bb0f3){if(!_0x5bb0f3){_0x1f6306[_0x795d('0x21')](0x194);}return _0x5bb0f3;};}function handleError(_0x33f514,_0x4f6e04){_0x4f6e04=_0x4f6e04||0x1f4;return function(_0x2f5fde){logger['error'](_0x2f5fde[_0x795d('0x22')]);if(_0x2f5fde['name']){delete _0x2f5fde[_0x795d('0x23')];}_0x33f514['status'](_0x4f6e04)['send'](_0x2f5fde);};}exports['update']=function(_0x493e84,_0x5aa3c6){if(_0x493e84[_0x795d('0x24')]['id']){delete _0x493e84[_0x795d('0x24')]['id'];}return db[_0x795d('0x25')]['find']({'where':{'id':_0x493e84[_0x795d('0x26')]['id']}})[_0x795d('0x1f')](handleEntityNotFound(_0x5aa3c6,null))[_0x795d('0x1f')](saveUpdates(_0x493e84[_0x795d('0x24')],null))[_0x795d('0x1f')](respondWithResult(_0x5aa3c6,null))[_0x795d('0x27')](handleError(_0x5aa3c6,null));};exports[_0x795d('0x28')]=function(_0xe0667,_0x88e3e){return db['Action']['find']({'where':{'id':_0xe0667[_0x795d('0x26')]['id']}})[_0x795d('0x1f')](handleEntityNotFound(_0x88e3e,null))['then'](removeEntity(_0x88e3e,null))['catch'](handleError(_0x88e3e,null));}; \ No newline at end of file +var _0x39a2=['sendStatus','error','stack','send','body','Action','params','catch','find','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x39a2,0x171));var _0x239a=function(_0x2ec2bf,_0x64e983){_0x2ec2bf=_0x2ec2bf-0x0;var _0x2c279c=_0x39a2[_0x2ec2bf];return _0x2c279c;};'use strict';var pdf=require(_0x239a('0x0'));var emlformat=require(_0x239a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x239a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x239a('0x3'));var moment=require(_0x239a('0x4'));var BPromise=require(_0x239a('0x5'));var Mustache=require(_0x239a('0x6'));var util=require(_0x239a('0x7'));var path=require(_0x239a('0x8'));var sox=require(_0x239a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x239a('0xa'));var jsforce=require(_0x239a('0xb'));var deskjs=require(_0x239a('0xc'));var toCsv=require(_0x239a('0xd'));var querystring=require(_0x239a('0xe'));var Papa=require(_0x239a('0xf'));var Redis=require(_0x239a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x239a('0x11'));var as=require(_0x239a('0x12'));var hardwareService=require(_0x239a('0x13'));var logger=require('../../config/logger')(_0x239a('0x14'));var utils=require('../../config/utils');var config=require(_0x239a('0x15'));var db=require(_0x239a('0x16'))['db'];function respondWithStatusCode(_0x68dc85,_0x1fd048){_0x1fd048=_0x1fd048||0xcc;return function(_0x1cf142){if(_0x1cf142){return _0x68dc85['sendStatus'](_0x1fd048);}return _0x68dc85['status'](_0x1fd048)['end']();};}function respondWithResult(_0x46650e,_0x552ed8){_0x552ed8=_0x552ed8||0xc8;return function(_0x455aa9){if(_0x455aa9){return _0x46650e[_0x239a('0x17')](_0x552ed8)[_0x239a('0x18')](_0x455aa9);}};}function respondWithFilteredResult(_0x5e386a,_0x10f417){return function(_0x561f67){if(_0x561f67){var _0x3e8af7=_0x561f67[_0x239a('0x19')],_0x573c4a=_0x10f417['offset'],_0x2bdfd4=_0x10f417['offset']+_0x10f417[_0x239a('0x1a')],_0x2652f3;if(_0x2bdfd4>=_0x3e8af7){_0x2bdfd4=_0x3e8af7;_0x2652f3=0xc8;}else{_0x2652f3=0xce;}_0x5e386a[_0x239a('0x17')](_0x2652f3);return _0x5e386a[_0x239a('0x1b')](_0x239a('0x1c'),_0x573c4a+'-'+_0x2bdfd4+'/'+_0x3e8af7)['json'](_0x561f67);}return null;};}function patchUpdates(_0x2e6fe4){return function(_0x24fddc){try{jsonpatch[_0x239a('0x1d')](_0x24fddc,_0x2e6fe4,!![]);}catch(_0x13be87){return BPromise[_0x239a('0x1e')](_0x13be87);}return _0x24fddc[_0x239a('0x1f')]();};}function saveUpdates(_0x12eba4,_0x10acd8){return function(_0x4bc0ea){if(_0x4bc0ea){return _0x4bc0ea[_0x239a('0x20')](_0x12eba4)[_0x239a('0x21')](function(_0x2b3c67){return _0x2b3c67;});}return null;};}function removeEntity(_0x49a912,_0xe87bec){return function(_0x4def10){if(_0x4def10){return _0x4def10[_0x239a('0x22')]()['then'](function(){_0x49a912[_0x239a('0x17')](0xcc)[_0x239a('0x23')]();});}};}function handleEntityNotFound(_0x4eae08,_0x2501ea){return function(_0x340833){if(!_0x340833){_0x4eae08[_0x239a('0x24')](0x194);}return _0x340833;};}function handleError(_0x2b7f90,_0x40b7ed){_0x40b7ed=_0x40b7ed||0x1f4;return function(_0x5108ca){logger[_0x239a('0x25')](_0x5108ca[_0x239a('0x26')]);if(_0x5108ca['name']){delete _0x5108ca['name'];}_0x2b7f90['status'](_0x40b7ed)[_0x239a('0x27')](_0x5108ca);};}exports[_0x239a('0x20')]=function(_0x5c647e,_0x6d99c4){if(_0x5c647e[_0x239a('0x28')]['id']){delete _0x5c647e[_0x239a('0x28')]['id'];}return db[_0x239a('0x29')]['find']({'where':{'id':_0x5c647e[_0x239a('0x2a')]['id']}})[_0x239a('0x21')](handleEntityNotFound(_0x6d99c4,null))['then'](saveUpdates(_0x5c647e[_0x239a('0x28')],null))['then'](respondWithResult(_0x6d99c4,null))[_0x239a('0x2b')](handleError(_0x6d99c4,null));};exports['destroy']=function(_0x1cb859,_0x62ba79){return db[_0x239a('0x29')][_0x239a('0x2c')]({'where':{'id':_0x1cb859[_0x239a('0x2a')]['id']}})['then'](handleEntityNotFound(_0x62ba79,null))[_0x239a('0x21')](removeEntity(_0x62ba79,null))[_0x239a('0x2b')](handleError(_0x62ba79,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index f0b7563..a497cc9 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 _0x7108=['./action.attributes','Action','lodash','util','api','bluebird','path'];(function(_0x5900d0,_0x3a902e){var _0x1e7f23=function(_0x5336dc){while(--_0x5336dc){_0x5900d0['push'](_0x5900d0['shift']());}};_0x1e7f23(++_0x3a902e);}(_0x7108,0x1ec));var _0x8710=function(_0x178ea7,_0x358c28){_0x178ea7=_0x178ea7-0x0;var _0x4f4859=_0x7108[_0x178ea7];return _0x4f4859;};'use strict';var _=require(_0x8710('0x0'));var util=require(_0x8710('0x1'));var logger=require('../../config/logger')(_0x8710('0x2'));var moment=require('moment');var BPromise=require(_0x8710('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8710('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8710('0x5'));module['exports']=function(_0x14276b,_0x11879b){return _0x14276b['define'](_0x8710('0x6'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c78=['./action.attributes','exports','define','tools_actions','lodash','util','moment','bluebird','request-promise','../../config/environment'];(function(_0x5a4018,_0x58ad84){var _0x473306=function(_0xee24bb){while(--_0xee24bb){_0x5a4018['push'](_0x5a4018['shift']());}};_0x473306(++_0x58ad84);}(_0x2c78,0x112));var _0x82c7=function(_0x4f229e,_0x1b1e6c){_0x4f229e=_0x4f229e-0x0;var _0x407c5e=_0x2c78[_0x4f229e];return _0x407c5e;};'use strict';var _=require(_0x82c7('0x0'));var util=require(_0x82c7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x82c7('0x2'));var BPromise=require(_0x82c7('0x3'));var rp=require(_0x82c7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x82c7('0x5'));var attributes=require(_0x82c7('0x6'));module[_0x82c7('0x7')]=function(_0x221361,_0x538291){return _0x221361[_0x82c7('0x8')]('Action',attributes,{'tableName':_0x82c7('0x9'),'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 f1856c5..37e8d08 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 _0xa9e0=['http','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0x4b8366,_0x584b8b){var _0x2d2372=function(_0x234a70){while(--_0x234a70){_0x4b8366['push'](_0x4b8366['shift']());}};_0x2d2372(++_0x584b8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 _0xe706=['http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0x272448,_0x723491){var _0x2f075b=function(_0x3c89d5){while(--_0x3c89d5){_0x272448['push'](_0x272448['shift']());}};_0x2f075b(++_0x723491);}(_0xe706,0xa3));var _0x6e70=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0xe706[_0x3a8db5];return _0x2c03cd;};'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']('Action,\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']('Action,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 4b4528e..0f327d0 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 _0x7bf8=['/:id','isAuthenticated','update','delete','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0xa3ecb9,_0x124d68){var _0x200136=function(_0xec6765){while(--_0xec6765){_0xa3ecb9['push'](_0xa3ecb9['shift']());}};_0x200136(++_0x124d68);}(_0x7bf8,0x117));var _0x87bf=function(_0x2e3757,_0x351fba){_0x2e3757=_0x2e3757-0x0;var _0x5b979d=_0x7bf8[_0x2e3757];return _0x5b979d;};'use strict';var multer=require('multer');var util=require(_0x87bf('0x0'));var path=require(_0x87bf('0x1'));var timeout=require('connect-timeout');var express=require(_0x87bf('0x2'));var router=express[_0x87bf('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x87bf('0x4'));var config=require(_0x87bf('0x5'));var controller=require(_0x87bf('0x6'));router['put'](_0x87bf('0x7'),auth[_0x87bf('0x8')](),controller[_0x87bf('0x9')]);router[_0x87bf('0xa')](_0x87bf('0x7'),auth[_0x87bf('0x8')](),controller[_0x87bf('0xb')]);module[_0x87bf('0xc')]=router; \ No newline at end of file +var _0xcc54=['delete','isAuthenticated','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./action.controller','/:id'];(function(_0x76c834,_0x2764ef){var _0x1eda3b=function(_0x58218){while(--_0x58218){_0x76c834['push'](_0x76c834['shift']());}};_0x1eda3b(++_0x2764ef);}(_0xcc54,0x94));var _0x4cc5=function(_0x2a24c3,_0x519025){_0x2a24c3=_0x2a24c3-0x0;var _0x4bf0ed=_0xcc54[_0x2a24c3];return _0x4bf0ed;};'use strict';var multer=require('multer');var util=require(_0x4cc5('0x0'));var path=require('path');var timeout=require(_0x4cc5('0x1'));var express=require(_0x4cc5('0x2'));var router=express[_0x4cc5('0x3')]();var auth=require(_0x4cc5('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4cc5('0x5'));var controller=require(_0x4cc5('0x6'));router['put'](_0x4cc5('0x7'),auth['isAuthenticated'](),controller['update']);router[_0x4cc5('0x8')]('/:id',auth[_0x4cc5('0x9')](),controller[_0x4cc5('0xa')]);module[_0x4cc5('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 01c045b..e78696d 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 _0x03fa=['STRING','TEXT','sequelize','exports'];(function(_0x1dde95,_0x3731ba){var _0x2370d0=function(_0x4824af){while(--_0x4824af){_0x1dde95['push'](_0x1dde95['shift']());}};_0x2370d0(++_0x3731ba);}(_0x03fa,0x1a6));var _0xa03f=function(_0x2fd810,_0x1764be){_0x2fd810=_0x2fd810-0x0;var _0xde21de=_0x03fa[_0x2fd810];return _0xde21de;};'use strict';var Sequelize=require(_0xa03f('0x0'));module[_0xa03f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xa03f('0x2')]},'parent':{'type':Sequelize[_0xa03f('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa03f('0x3')]},'joins':{'type':Sequelize[_0xa03f('0x3')]}}; \ No newline at end of file +var _0x78fb=['STRING','TEXT','sequelize','exports'];(function(_0x421194,_0x3e92d6){var _0xf645e8=function(_0xe8e951){while(--_0xe8e951){_0x421194['push'](_0x421194['shift']());}};_0xf645e8(++_0x3e92d6);}(_0x78fb,0x8e));var _0xb78f=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x78fb[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0xb78f('0x0'));module[_0xb78f('0x1')]={'name':{'type':Sequelize[_0xb78f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb78f('0x2')]},'parent':{'type':Sequelize[_0xb78f('0x2')]},'table':{'type':Sequelize[_0xb78f('0x2')]},'conditions':{'type':Sequelize[_0xb78f('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index c89823c..da1439e 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 _0x616c=['reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','AnalyticCustomReport','fieldName','key','model','keys','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','findAll','rows','catch','show','params','rawAttributes','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','CustomReports','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','field','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','SUM(%s)','GROUP_CONCAT(%s)','DATE(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','from','DESC','debug','Limited\x20Query:','SELECT','No\x20available\x20data','output','fullPath','generate','csv','custom','AnalyticExtractedReport','cdr','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','runReport','COUNT(DISTINCT\x20%s)','SEC_TO_TIME(%s)','HOUR(%s)','%s.%s\x20=\x20%s.%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','dbH','status','json','offset','limit','set','Content-Range'];(function(_0x4366e1,_0x312378){var _0x265f9b=function(_0x42fc90){while(--_0x42fc90){_0x4366e1['push'](_0x4366e1['shift']());}};_0x265f9b(++_0x312378);}(_0x616c,0x1b6));var _0xc616=function(_0x38dba2,_0xc98fb9){_0x38dba2=_0x38dba2-0x0;var _0x1bb2cb=_0x616c[_0x38dba2];return _0x1bb2cb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc616('0x0'));var rimraf=require(_0xc616('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc616('0x2'));var rp=require(_0xc616('0x3'));var moment=require(_0xc616('0x4'));var BPromise=require(_0xc616('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc616('0x6'));var sox=require(_0xc616('0x7'));var csv=require(_0xc616('0x8'));var ejs=require(_0xc616('0x9'));var fs=require('fs');var _=require(_0xc616('0xa'));var squel=require(_0xc616('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc616('0xc'));var toCsv=require(_0xc616('0x8'));var querystring=require('querystring');var Papa=require(_0xc616('0xd'));var Redis=require('ioredis');var authService=require(_0xc616('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc616('0xf'));var logger=require(_0xc616('0x10'))(_0xc616('0x11'));var utils=require('../../config/utils');var config=require(_0xc616('0x12'));var db=require('../../mysqldb')['db'];var dbH=require(_0xc616('0x13'))[_0xc616('0x14')];function respondWithStatusCode(_0x1fb7a1,_0x633d6a){_0x633d6a=_0x633d6a||0xcc;return function(_0x376cca){if(_0x376cca){return _0x1fb7a1['sendStatus'](_0x633d6a);}return _0x1fb7a1[_0xc616('0x15')](_0x633d6a)['end']();};}function respondWithResult(_0x17e829,_0x3958e9){_0x3958e9=_0x3958e9||0xc8;return function(_0x32854f){if(_0x32854f){return _0x17e829[_0xc616('0x15')](_0x3958e9)[_0xc616('0x16')](_0x32854f);}};}function respondWithFilteredResult(_0x5a5393,_0xa07335){return function(_0x1738ff){if(_0x1738ff){var _0x3ace46=_0x1738ff['count'],_0x739a74=_0xa07335[_0xc616('0x17')],_0x180482=_0xa07335['offset']+_0xa07335[_0xc616('0x18')],_0x186b34;if(_0x180482>=_0x3ace46){_0x180482=_0x3ace46;_0x186b34=0xc8;}else{_0x186b34=0xce;}_0x5a5393[_0xc616('0x15')](_0x186b34);return _0x5a5393[_0xc616('0x19')](_0xc616('0x1a'),_0x739a74+'-'+_0x180482+'/'+_0x3ace46)['json'](_0x1738ff);}return null;};}function patchUpdates(_0xadc71a){return function(_0x5809ca){try{jsonpatch['apply'](_0x5809ca,_0xadc71a,!![]);}catch(_0x414740){return BPromise[_0xc616('0x1b')](_0x414740);}return _0x5809ca[_0xc616('0x1c')]();};}function saveUpdates(_0xf51b1c,_0x3e6053){return function(_0xf06b09){if(_0xf06b09){return _0xf06b09[_0xc616('0x1d')](_0xf51b1c)[_0xc616('0x1e')](function(_0x1ae9da){return _0x1ae9da;});}return null;};}function removeEntity(_0x461e40,_0x47ccd6){return function(_0x297993){if(_0x297993){return _0x297993['destroy']()[_0xc616('0x1e')](function(){var _0x1696b5=_0x297993[_0xc616('0x1f')]({'plain':!![]});var _0x229cbd='CustomReports';return db[_0xc616('0x20')][_0xc616('0x21')]({'where':{'type':_0x229cbd,'resourceId':_0x1696b5['id']}})[_0xc616('0x1e')](function(){return _0x297993;});})[_0xc616('0x1e')](function(){_0x461e40[_0xc616('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28f9b1,_0x4e5979){return function(_0x32ff65){if(!_0x32ff65){_0x28f9b1['sendStatus'](0x194);}return _0x32ff65;};}function handleError(_0x246a98,_0x44c71a){_0x44c71a=_0x44c71a||0x1f4;return function(_0x4e18d1){logger[_0xc616('0x22')](_0x4e18d1[_0xc616('0x23')]);if(_0x4e18d1[_0xc616('0x24')]){delete _0x4e18d1['name'];}_0x246a98[_0xc616('0x15')](_0x44c71a)['send'](_0x4e18d1);};}exports[_0xc616('0x25')]=function(_0x2935e6,_0x25cecd){var _0x2bc0a0={},_0x43786e={},_0xa47ae4={'count':0x0,'rows':[]};var _0x1ad3d8=_[_0xc616('0x26')](db[_0xc616('0x27')]['rawAttributes'],function(_0x3758e0){return{'name':_0x3758e0[_0xc616('0x28')],'type':_0x3758e0['type'][_0xc616('0x29')]};});_0x43786e[_0xc616('0x2a')]=_[_0xc616('0x26')](_0x1ad3d8,_0xc616('0x24'));_0x43786e['query']=_[_0xc616('0x2b')](_0x2935e6['query']);_0x43786e['filters']=_['intersection'](_0x43786e['model'],_0x43786e[_0xc616('0x2c')]);_0x2bc0a0[_0xc616('0x2d')]=_[_0xc616('0x2e')](_0x43786e[_0xc616('0x2a')],qs[_0xc616('0x2f')](_0x2935e6[_0xc616('0x2c')][_0xc616('0x2f')]));_0x2bc0a0[_0xc616('0x2d')]=_0x2bc0a0[_0xc616('0x2d')][_0xc616('0x30')]?_0x2bc0a0[_0xc616('0x2d')]:_0x43786e[_0xc616('0x2a')];if(!_0x2935e6[_0xc616('0x2c')]['hasOwnProperty']('nolimit')){_0x2bc0a0[_0xc616('0x18')]=qs[_0xc616('0x18')](_0x2935e6['query']['limit']);_0x2bc0a0[_0xc616('0x17')]=qs['offset'](_0x2935e6['query']['offset']);}_0x2bc0a0[_0xc616('0x31')]=qs[_0xc616('0x32')](_0x2935e6['query']['sort']);_0x2bc0a0[_0xc616('0x33')]=qs[_0xc616('0x34')](_[_0xc616('0x35')](_0x2935e6[_0xc616('0x2c')],_0x43786e['filters']),_0x1ad3d8);if(_0x2935e6[_0xc616('0x2c')][_0xc616('0x36')]){_0x2bc0a0['where']=_[_0xc616('0x37')](_0x2bc0a0[_0xc616('0x33')],{'$or':_[_0xc616('0x26')](_0x1ad3d8,function(_0x553c02){if(_0x553c02[_0xc616('0x38')]!==_0xc616('0x39')){var _0x29c063={};_0x29c063[_0x553c02[_0xc616('0x24')]]={'$like':'%'+_0x2935e6[_0xc616('0x2c')][_0xc616('0x36')]+'%'};return _0x29c063;}})});}_0x2bc0a0=_[_0xc616('0x37')]({},_0x2bc0a0,_0x2935e6[_0xc616('0x3a')]);var _0x4f5c5f={'where':_0x2bc0a0[_0xc616('0x33')]};return db[_0xc616('0x27')][_0xc616('0x3b')](_0x4f5c5f)[_0xc616('0x1e')](function(_0x34f413){_0xa47ae4[_0xc616('0x3b')]=_0x34f413;if(_0x2935e6[_0xc616('0x2c')]['includeAll']){_0x2bc0a0['include']=[{'all':!![]}];}return db[_0xc616('0x27')][_0xc616('0x3c')](_0x2bc0a0);})[_0xc616('0x1e')](function(_0x3f284d){_0xa47ae4[_0xc616('0x3d')]=_0x3f284d;return _0xa47ae4;})[_0xc616('0x1e')](respondWithFilteredResult(_0x25cecd,_0x2bc0a0))[_0xc616('0x3e')](handleError(_0x25cecd,null));};exports[_0xc616('0x3f')]=function(_0x39c59f,_0xd132a9){var _0xa034a9={'raw':![],'where':{'id':_0x39c59f[_0xc616('0x40')]['id']}},_0x4a8f37={};_0x4a8f37[_0xc616('0x2a')]=_['keys'](db[_0xc616('0x27')][_0xc616('0x41')]);_0x4a8f37[_0xc616('0x2c')]=_[_0xc616('0x2b')](_0x39c59f[_0xc616('0x2c')]);_0x4a8f37[_0xc616('0x34')]=_['intersection'](_0x4a8f37['model'],_0x4a8f37[_0xc616('0x2c')]);_0xa034a9[_0xc616('0x2d')]=_[_0xc616('0x2e')](_0x4a8f37['model'],qs[_0xc616('0x2f')](_0x39c59f[_0xc616('0x2c')]['fields']));_0xa034a9['attributes']=_0xa034a9[_0xc616('0x2d')][_0xc616('0x30')]?_0xa034a9[_0xc616('0x2d')]:_0x4a8f37['model'];if(_0x39c59f[_0xc616('0x2c')][_0xc616('0x42')]){_0xa034a9[_0xc616('0x43')]=[{'all':!![]}];}_0xa034a9=_['merge']({},_0xa034a9,_0x39c59f['options']);return db['AnalyticCustomReport']['find'](_0xa034a9)[_0xc616('0x1e')](handleEntityNotFound(_0xd132a9,null))[_0xc616('0x1e')](respondWithResult(_0xd132a9,null))[_0xc616('0x3e')](handleError(_0xd132a9,null));};exports['create']=function(_0x2479a5,_0x5b2f95){return db['AnalyticCustomReport'][_0xc616('0x44')](_0x2479a5[_0xc616('0x45')],{})['then'](function(_0x7bd030){var _0x192da7=_0x2479a5[_0xc616('0x46')][_0xc616('0x1f')]({'plain':!![]});if(!_0x192da7)throw new Error(_0xc616('0x47'));if(_0x192da7['role']===_0xc616('0x46')){var _0xe20bb1=_0x7bd030[_0xc616('0x1f')]({'plain':!![]});var _0x1f48a6='Reports';return db[_0xc616('0x48')][_0xc616('0x49')]({'where':{'name':_0x1f48a6,'userProfileId':_0x192da7[_0xc616('0x4a')]},'raw':!![]})[_0xc616('0x1e')](function(_0x521321){if(_0x521321&&_0x521321[_0xc616('0x4b')]===0x0){return db[_0xc616('0x20')][_0xc616('0x44')]({'name':_0xe20bb1[_0xc616('0x24')],'resourceId':_0xe20bb1['id'],'type':_0xc616('0x4c'),'sectionId':_0x521321['id']},{})[_0xc616('0x1e')](function(){return _0x7bd030;});}else{return _0x7bd030;}})[_0xc616('0x3e')](function(_0x371a21){logger[_0xc616('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x371a21);throw _0x371a21;});}return _0x7bd030;})['then'](respondWithResult(_0x5b2f95,0xc9))[_0xc616('0x3e')](handleError(_0x5b2f95,null));};exports['update']=function(_0x927554,_0x164dbf){if(_0x927554[_0xc616('0x45')]['id']){delete _0x927554[_0xc616('0x45')]['id'];}return db[_0xc616('0x27')]['find']({'where':{'id':_0x927554[_0xc616('0x40')]['id']}})['then'](handleEntityNotFound(_0x164dbf,null))[_0xc616('0x1e')](saveUpdates(_0x927554[_0xc616('0x45')],null))[_0xc616('0x1e')](respondWithResult(_0x164dbf,null))[_0xc616('0x3e')](handleError(_0x164dbf,null));};exports[_0xc616('0x21')]=function(_0x299121,_0x2f537a){return db['AnalyticCustomReport'][_0xc616('0x49')]({'where':{'id':_0x299121[_0xc616('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f537a,null))[_0xc616('0x1e')](removeEntity(_0x2f537a,null))[_0xc616('0x3e')](handleError(_0x2f537a,null));};exports['preview']=function(_0x51ccb2,_0x4cda49){var _0x42fa5c=0xa;var _0x2f63dd=[_0xc616('0x4d'),_0xc616('0x4e'),_0xc616('0x4f'),_0xc616('0x50')];var _0x4eb208={'SUM':'SUM(%s)','COUNT':_0xc616('0x51'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc616('0x52'),'MIN':_0xc616('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc616('0x54'),'GROUP_CONCAT DESC':_0xc616('0x55')};var _0x154369={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xc616('0x56'),'UNIX_TIMESTAMP':_0xc616('0x57')};var _0x3d97c0=function(_0x32c9b4){return!_['includes']([_0xc616('0x58'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xc616('0x59')],_0x32c9b4);};var _0x28abdf=function(_0x3a31df){if(!_0x3a31df||!_0x3a31df[_0xc616('0x5a')][_0xc616('0x30')]){return'';}for(var _0x1672f8='(',_0x91e106=0x0;_0x91e106<_0x3a31df['rules'][_0xc616('0x30')];_0x91e106+=0x1){_0x91e106>0x0&&(_0x1672f8+='\x20'+_0x3a31df[_0xc616('0x5b')]+'\x20');_0x1672f8+=_0x3a31df[_0xc616('0x5a')][_0x91e106][_0xc616('0x5c')]?_0x28abdf(_0x3a31df['rules'][_0x91e106][_0xc616('0x5c')]):_0x3a31df[_0xc616('0x5a')][_0x91e106]['field']+'\x20'+_0x3a31df[_0xc616('0x5a')][_0x91e106][_0xc616('0x5d')]+(_0x3d97c0(_0x3a31df[_0xc616('0x5a')][_0x91e106][_0xc616('0x5d')])?'\x20'+_0x3a31df[_0xc616('0x5a')][_0x91e106][_0xc616('0x5e')]:'');}return _0x1672f8+')';};var _0x4e942c={'where':{'id':_0x51ccb2[_0xc616('0x40')]['id']}},_0x3a5a7f,_0x599694,_0x2f3838,_0x2eb273,_0x427a16;_0x4e942c=_[_0xc616('0x37')]({},_0x4e942c,_0x51ccb2[_0xc616('0x3a')]);return db['AnalyticCustomReport']['find'](_0x4e942c)[_0xc616('0x1e')](function(_0x228012){if(_0x228012){_0x3a5a7f=_0x228012;return _0x228012[_0xc616('0x5f')]();}return null;})['then'](function(_0x278b63){if(_0x278b63){if(!_0x278b63[_0xc616('0x30')]){throw new db[(_0xc616('0x60'))][(_0xc616('0x61'))](_0xc616('0x62'),0x193);}_0x599694=_0x278b63;return db[_0xc616('0x63')][_0xc616('0x3c')]({'raw':!![]});}return null;})['then'](function(_0x164125){if(_0x164125){_0x2f3838=_[_0xc616('0x64')](_0x164125,'id');var _0xa4d40d;var _0xfb5576=squel[_0xc616('0x65')]();_0xfb5576['from'](_0x3a5a7f[_0xc616('0x66')]);for(var _0xb38d27=0x0;_0xb38d27<_0x599694[_0xc616('0x30')];_0xb38d27+=0x1){_0xa4d40d=_0x599694[_0xb38d27][_0xc616('0x67')]?_0x2f3838[_0x599694[_0xb38d27][_0xc616('0x67')]][_0xc616('0x68')]:_0x599694[_0xb38d27]['field'];_0xa4d40d=_0x599694[_0xb38d27][_0xc616('0x69')]?_[_0xc616('0x6a')](_0x4eb208[_0x599694[_0xb38d27][_0xc616('0x69')]],'%s',_0xa4d40d):_0xa4d40d;_0xa4d40d=_0x599694[_0xb38d27][_0xc616('0x6b')]?_['replace'](_0x154369[_0x599694[_0xb38d27]['format']],'%s',_0xa4d40d):_0xa4d40d;if(_0x599694[_0xb38d27][_0xc616('0x6c')]){_0xfb5576[_0xc616('0x5c')](_0xa4d40d);}_0x599694[_0xb38d27]['orderBy']&&_0xfb5576[_0xc616('0x31')](_0xa4d40d,_0x599694[_0xb38d27][_0xc616('0x6d')]==='DESC'?![]:!![]);_0xfb5576[_0xc616('0x6e')](_0xa4d40d,_0x599694[_0xb38d27][_0xc616('0x6f')]||_0xa4d40d);}if(_0x3a5a7f['joins']){_0x3a5a7f[_0xc616('0x70')]=JSON[_0xc616('0x71')](_0x3a5a7f[_0xc616('0x70')]);for(var _0x2c0725=0x0;_0x2c0725<_0x3a5a7f[_0xc616('0x70')][_0xc616('0x30')];_0x2c0725+=0x1){if(_0x3a5a7f['joins'][_0x2c0725][_0xc616('0x38')]&&_[_0xc616('0x72')](_0x2f63dd,_0x3a5a7f[_0xc616('0x70')][_0x2c0725][_0xc616('0x38')])&&_0x3a5a7f[_0xc616('0x70')][_0x2c0725][_0xc616('0x73')]&&_0x3a5a7f['joins'][_0x2c0725][_0xc616('0x74')]&&_0x3a5a7f['joins'][_0x2c0725][_0xc616('0x75')]){_0xfb5576[_0x3a5a7f[_0xc616('0x70')][_0x2c0725][_0xc616('0x38')]](_0x3a5a7f['joins'][_0x2c0725]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3a5a7f[_0xc616('0x66')],_0x3a5a7f['joins'][_0x2c0725][_0xc616('0x73')],_0x3a5a7f[_0xc616('0x70')][_0x2c0725][_0xc616('0x74')],_0x3a5a7f[_0xc616('0x70')][_0x2c0725][_0xc616('0x75')]));}}}if(_0x3a5a7f[_0xc616('0x76')]){_0x3a5a7f[_0xc616('0x76')]=JSON['parse'](_0x3a5a7f['conditions']);_0xfb5576[_0xc616('0x33')](_0x28abdf(_0x3a5a7f[_0xc616('0x76')]['group']));}_0x427a16=_0xfb5576[_0xc616('0x77')]();_0xfb5576['limit'](_0x42fa5c);_0xfb5576[_0xc616('0x17')](0x0);logger['debug']('Limited\x20Query:',_0xfb5576[_0xc616('0x78')]());return db[_0xc616('0x79')]['query'](_0xfb5576['toString'](),{'type':db[_0xc616('0x79')][_0xc616('0x7a')]['SELECT']});}})[_0xc616('0x1e')](respondWithResult(_0x4cda49,null))['catch'](handleError(_0x4cda49,null));};function runReport(_0x1a283c,_0x3798c6,_0x1c4074){var _0x14bb51=_0x3798c6[_0xc616('0x24')];var _0x22a3d8=0xa;var _0x1bcdae=[_0xc616('0x4d'),_0xc616('0x4e'),_0xc616('0x4f'),_0xc616('0x50')];var _0x515241={'SUM':_0xc616('0x7b'),'COUNT':_0xc616('0x51'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc616('0x52'),'MIN':_0xc616('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc616('0x7c'),'GROUP_CONCAT ASC':_0xc616('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x37cf9e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc616('0x7d'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc616('0x57')};var _0x57266a=function(_0x57d79e){return!_[_0xc616('0x72')]([_0xc616('0x58'),_0xc616('0x7e'),_0xc616('0x7f'),'IS\x20NOT\x20EMPTY'],_0x57d79e);};var _0x50ed1f=function(_0x3527f2){if(!_0x3527f2||!_0x3527f2['rules'][_0xc616('0x30')]){return'';}for(var _0x397d24='(',_0x4a7e3a=0x0;_0x4a7e3a<_0x3527f2[_0xc616('0x5a')][_0xc616('0x30')];_0x4a7e3a+=0x1){_0x4a7e3a>0x0&&(_0x397d24+='\x20'+_0x3527f2[_0xc616('0x5b')]+'\x20');_0x397d24+=_0x3527f2[_0xc616('0x5a')][_0x4a7e3a][_0xc616('0x5c')]?_0x50ed1f(_0x3527f2[_0xc616('0x5a')][_0x4a7e3a][_0xc616('0x5c')]):_0x3527f2[_0xc616('0x5a')][_0x4a7e3a]['field']+'\x20'+_0x3527f2[_0xc616('0x5a')][_0x4a7e3a][_0xc616('0x5d')]+(_0x57266a(_0x3527f2[_0xc616('0x5a')][_0x4a7e3a][_0xc616('0x5d')])?'\x20'+_0x3527f2['rules'][_0x4a7e3a][_0xc616('0x5e')]:'');}return _0x397d24+')';};var _0x3a6dbe={'where':{'id':_0x1a283c['id']}},_0x2b2df6,_0x1953ab,_0x2dd05a,_0x5bbc1e,_0x3199c1;_0x3a6dbe=_[_0xc616('0x37')]({},_0x3a6dbe,_0x1c4074);return db[_0xc616('0x27')][_0xc616('0x49')](_0x3a6dbe)[_0xc616('0x1e')](function(_0x4e90fb){if(_0x4e90fb){_0x2b2df6=_0x4e90fb;return _0x4e90fb[_0xc616('0x5f')]();}return null;})[_0xc616('0x1e')](function(_0x3c1494){if(_0x3c1494){if(!_0x3c1494[_0xc616('0x30')]){throw new db[(_0xc616('0x60'))][(_0xc616('0x61'))](_0xc616('0x62'),0x193);}_0x1953ab=_0x3c1494;return db[_0xc616('0x63')]['findAll']({'raw':!![]});}return null;})[_0xc616('0x1e')](function(_0x122916){if(_0x122916){_0x2dd05a=_['keyBy'](_0x122916,'id');var _0x2b6a42;var _0xd03069=squel[_0xc616('0x65')]();_0xd03069[_0xc616('0x80')](_0x2b2df6[_0xc616('0x66')]);for(var _0x3dd351=0x0;_0x3dd351<_0x1953ab[_0xc616('0x30')];_0x3dd351+=0x1){_0x2b6a42=_0x1953ab[_0x3dd351][_0xc616('0x67')]?_0x2dd05a[_0x1953ab[_0x3dd351][_0xc616('0x67')]][_0xc616('0x68')]:_0x1953ab[_0x3dd351][_0xc616('0x6e')];_0x2b6a42=_0x1953ab[_0x3dd351]['function']?_['replace'](_0x515241[_0x1953ab[_0x3dd351][_0xc616('0x69')]],'%s',_0x2b6a42):_0x2b6a42;_0x2b6a42=_0x1953ab[_0x3dd351][_0xc616('0x6b')]?_[_0xc616('0x6a')](_0x37cf9e[_0x1953ab[_0x3dd351][_0xc616('0x6b')]],'%s',_0x2b6a42):_0x2b6a42;if(_0x1953ab[_0x3dd351][_0xc616('0x6c')]){_0xd03069['group'](_0x2b6a42);}_0x1953ab[_0x3dd351]['orderBy']&&_0xd03069[_0xc616('0x31')](_0x2b6a42,_0x1953ab[_0x3dd351][_0xc616('0x6d')]===_0xc616('0x81')?![]:!![]);_0xd03069[_0xc616('0x6e')](_0x2b6a42,_0x1953ab[_0x3dd351]['alias']||_0x2b6a42);}if(_0x2b2df6[_0xc616('0x70')]){_0x2b2df6[_0xc616('0x70')]=JSON[_0xc616('0x71')](_0x2b2df6[_0xc616('0x70')]);for(var _0x34a087=0x0;_0x34a087<_0x2b2df6[_0xc616('0x70')]['length'];_0x34a087+=0x1){if(_0x2b2df6[_0xc616('0x70')][_0x34a087]['type']&&_[_0xc616('0x72')](_0x1bcdae,_0x2b2df6[_0xc616('0x70')][_0x34a087]['type'])&&_0x2b2df6[_0xc616('0x70')][_0x34a087][_0xc616('0x73')]&&_0x2b2df6[_0xc616('0x70')][_0x34a087][_0xc616('0x74')]&&_0x2b2df6['joins'][_0x34a087][_0xc616('0x75')]){_0xd03069[_0x2b2df6[_0xc616('0x70')][_0x34a087]['type']](_0x2b2df6[_0xc616('0x70')][_0x34a087]['foreignTable'],null,util[_0xc616('0x6b')]('%s.%s\x20=\x20%s.%s',_0x2b2df6[_0xc616('0x66')],_0x2b2df6[_0xc616('0x70')][_0x34a087][_0xc616('0x73')],_0x2b2df6[_0xc616('0x70')][_0x34a087][_0xc616('0x74')],_0x2b2df6['joins'][_0x34a087][_0xc616('0x75')]));}}}if(_0x2b2df6['conditions']){_0x2b2df6[_0xc616('0x76')]=JSON[_0xc616('0x71')](_0x2b2df6[_0xc616('0x76')]);_0xd03069[_0xc616('0x33')](_0x50ed1f(_0x2b2df6[_0xc616('0x76')][_0xc616('0x5c')]));}_0x3199c1=_0xd03069['clone']();_0xd03069['limit'](_0x22a3d8);_0xd03069[_0xc616('0x17')](0x0);logger[_0xc616('0x82')](_0xc616('0x83'),_0xd03069[_0xc616('0x78')]());return db[_0xc616('0x79')][_0xc616('0x2c')](_0xd03069['toString'](),{'type':db[_0xc616('0x79')][_0xc616('0x7a')][_0xc616('0x84')]});}})['then'](function(_0x3d5dc5){if(!_0x3d5dc5['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xc616('0x85'),0xcc);}if(_0x3798c6[_0xc616('0x86')]==='web'){return null;}var _0x5960e2=_[_0xc616('0x37')](_0x3798c6,{'name':_0x3798c6[_0xc616('0x87')]||_0x3798c6[_0xc616('0x24')]||_0x2b2df6['name'],'basename':_0x14bb51,'savename':util[_0xc616('0x6b')]('%s-%s.%s',_0x3798c6[_0xc616('0x24')]||_0x2b2df6[_0xc616('0x24')],require('randomstring')[_0xc616('0x88')](0x4),_0x3798c6[_0xc616('0x86')]||_0xc616('0x89')),'reportId':_0x2b2df6['id'],'reportType':_0xc616('0x8a')});return db[_0xc616('0x8b')][_0xc616('0x44')](_0x5960e2,{'raw':!![]});})[_0xc616('0x1e')](function(_0x14ad56){if(_0x2b2df6[_0xc616('0x66')]===_0xc616('0x8c')){_0x3199c1[_0xc616('0x33')](_0x2b2df6['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3798c6[_0xc616('0x8d')],_0x3798c6['endDate']);}else{_0x3199c1[_0xc616('0x33')](_0x2b2df6[_0xc616('0x66')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3798c6[_0xc616('0x8d')],_0x3798c6[_0xc616('0x8e')]);}if(_0x14ad56){logger[_0xc616('0x8f')]('Run\x20Query:',_0x3199c1[_0xc616('0x78')]());require(_0xc616('0x90'))[_0xc616('0x91')](path[_0xc616('0x4d')](__dirname,_0xc616('0x92'),_0x14ad56['output']),[_0x14ad56['id'],_0x3199c1[_0xc616('0x78')](),path[_0xc616('0x4d')](__dirname,_0xc616('0x93'),_0x14ad56[_0xc616('0x94')]),_0x14bb51]);return _0x14ad56;}else{var _0x191164=squel['select']();_0x191164[_0xc616('0x80')]('('+_0x3199c1[_0xc616('0x78')]()+')','countTable');_0x191164[_0xc616('0x6e')](_0xc616('0x95'),_0xc616('0x3b'));_0x3199c1['limit'](_0x3798c6[_0xc616('0x18')]||_0x22a3d8);_0x3199c1[_0xc616('0x17')](_0x3798c6[_0xc616('0x17')]||0x0);return dbH[_0xc616('0x79')][_0xc616('0x2c')](_0x191164[_0xc616('0x78')](),{'type':dbH[_0xc616('0x79')]['QueryTypes']['SELECT']})[_0xc616('0x1e')](function(_0x104a1f){if(!_0x104a1f[_0xc616('0x30')]){_0x5bbc1e=0x0;}else{_0x5bbc1e=_0x104a1f[0x0]['count']||0x0;}return dbH[_0xc616('0x79')][_0xc616('0x2c')](_0x3199c1[_0xc616('0x78')](),{'type':dbH['sequelize']['QueryTypes'][_0xc616('0x84')]});})[_0xc616('0x1e')](function(_0x225e9a){return{'rows':_0x225e9a||[],'count':_0x5bbc1e};});}});}exports['run']=function(_0x2cecec,_0xb0fe69){return runReport(_0x2cecec[_0xc616('0x40')],_0x2cecec[_0xc616('0x2c')],_0x2cecec[_0xc616('0x3a')])[_0xc616('0x1e')](respondWithResult(_0xb0fe69,null))['catch'](handleError(_0xb0fe69,null));};exports[_0xc616('0x96')]=runReport;exports[_0xc616('0x2c')]=function(_0x355c7a,_0x1b54cc){var _0x4aa1ad=0xa;var _0x15ff2c=['join','left_join',_0xc616('0x4f'),'cross_join'];var _0x354707={'SUM':_0xc616('0x7b'),'COUNT':_0xc616('0x51'),'COUNT DISTINCT':_0xc616('0x97'),'MAX':_0xc616('0x52'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xc616('0x7c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc616('0x55')};var _0x172a11={'SEC_TO_TIME':_0xc616('0x98'),'DATE':_0xc616('0x7d'),'HOUR':_0xc616('0x99'),'ROUND':_0xc616('0x56'),'UNIX_TIMESTAMP':_0xc616('0x57')};var _0x267556=function(_0x4073ee){return!_['includes'](['IS\x20NULL',_0xc616('0x7e'),_0xc616('0x7f'),_0xc616('0x59')],_0x4073ee);};var _0x774e10=function(_0x3a251e){if(!_0x3a251e||!_0x3a251e[_0xc616('0x5a')][_0xc616('0x30')]){return'';}for(var _0x10e5d0='(',_0x59c93e=0x0;_0x59c93e<_0x3a251e[_0xc616('0x5a')]['length'];_0x59c93e+=0x1){_0x59c93e>0x0&&(_0x10e5d0+='\x20'+_0x3a251e[_0xc616('0x5b')]+'\x20');_0x10e5d0+=_0x3a251e[_0xc616('0x5a')][_0x59c93e]['group']?_0x774e10(_0x3a251e['rules'][_0x59c93e]['group']):_0x3a251e[_0xc616('0x5a')][_0x59c93e][_0xc616('0x6e')]+'\x20'+_0x3a251e[_0xc616('0x5a')][_0x59c93e]['condition']+(_0x267556(_0x3a251e[_0xc616('0x5a')][_0x59c93e]['condition'])?'\x20'+_0x3a251e[_0xc616('0x5a')][_0x59c93e][_0xc616('0x5e')]:'');}return _0x10e5d0+')';};var _0x1252ff={'where':{'id':_0x355c7a[_0xc616('0x40')]['id']}},_0x4273d2,_0x3dc8c1,_0x32aa91,_0x2b74f5,_0x41228d;_0x1252ff=_[_0xc616('0x37')]({},_0x1252ff,_0x355c7a[_0xc616('0x3a')]);return db[_0xc616('0x27')][_0xc616('0x49')](_0x1252ff)[_0xc616('0x1e')](function(_0x3598d6){if(_0x3598d6){_0x4273d2=_0x3598d6;return _0x3598d6[_0xc616('0x5f')]();}return null;})[_0xc616('0x1e')](function(_0x2fe314){if(_0x2fe314){if(!_0x2fe314['length']){throw new db[(_0xc616('0x60'))][(_0xc616('0x61'))](_0xc616('0x62'),0x193);}_0x3dc8c1=_0x2fe314;return db[_0xc616('0x63')][_0xc616('0x3c')]({'raw':!![]});}return null;})['then'](function(_0x935660){if(_0x935660){_0x32aa91=_[_0xc616('0x64')](_0x935660,'id');var _0x4e35c8;var _0x1320d8=squel[_0xc616('0x65')]();_0x1320d8['from'](_0x4273d2[_0xc616('0x66')]);for(var _0x5f4271=0x0;_0x5f4271<_0x3dc8c1['length'];_0x5f4271+=0x1){_0x4e35c8=_0x3dc8c1[_0x5f4271][_0xc616('0x67')]?_0x32aa91[_0x3dc8c1[_0x5f4271][_0xc616('0x67')]]['metric']:_0x3dc8c1[_0x5f4271][_0xc616('0x6e')];_0x4e35c8=_0x3dc8c1[_0x5f4271]['function']?_[_0xc616('0x6a')](_0x354707[_0x3dc8c1[_0x5f4271][_0xc616('0x69')]],'%s',_0x4e35c8):_0x4e35c8;_0x4e35c8=_0x3dc8c1[_0x5f4271][_0xc616('0x6b')]?_['replace'](_0x172a11[_0x3dc8c1[_0x5f4271][_0xc616('0x6b')]],'%s',_0x4e35c8):_0x4e35c8;if(_0x3dc8c1[_0x5f4271][_0xc616('0x6c')]){_0x1320d8[_0xc616('0x5c')](_0x4e35c8);}_0x3dc8c1[_0x5f4271][_0xc616('0x6d')]&&_0x1320d8[_0xc616('0x31')](_0x4e35c8,_0x3dc8c1[_0x5f4271][_0xc616('0x6d')]==='DESC'?![]:!![]);_0x1320d8[_0xc616('0x6e')](_0x4e35c8,_0x3dc8c1[_0x5f4271][_0xc616('0x6f')]||_0x4e35c8);}if(_0x4273d2[_0xc616('0x70')]){_0x4273d2['joins']=JSON['parse'](_0x4273d2['joins']);for(var _0x3d3356=0x0;_0x3d3356<_0x4273d2[_0xc616('0x70')]['length'];_0x3d3356+=0x1){if(_0x4273d2[_0xc616('0x70')][_0x3d3356][_0xc616('0x38')]&&_[_0xc616('0x72')](_0x15ff2c,_0x4273d2[_0xc616('0x70')][_0x3d3356][_0xc616('0x38')])&&_0x4273d2[_0xc616('0x70')][_0x3d3356][_0xc616('0x73')]&&_0x4273d2[_0xc616('0x70')][_0x3d3356][_0xc616('0x74')]&&_0x4273d2[_0xc616('0x70')][_0x3d3356][_0xc616('0x75')]){_0x1320d8[_0x4273d2[_0xc616('0x70')][_0x3d3356][_0xc616('0x38')]](_0x4273d2['joins'][_0x3d3356][_0xc616('0x74')],null,util[_0xc616('0x6b')](_0xc616('0x9a'),_0x4273d2['table'],_0x4273d2['joins'][_0x3d3356]['parentKey'],_0x4273d2[_0xc616('0x70')][_0x3d3356]['foreignTable'],_0x4273d2[_0xc616('0x70')][_0x3d3356]['foreignKey']));}}}if(_0x4273d2['conditions']){_0x4273d2[_0xc616('0x76')]=JSON['parse'](_0x4273d2[_0xc616('0x76')]);_0x1320d8['where'](_0x774e10(_0x4273d2['conditions'][_0xc616('0x5c')]));}_0x41228d=_0x1320d8['clone']();_0x1320d8[_0xc616('0x18')](_0x4aa1ad);_0x1320d8[_0xc616('0x17')](0x0);logger[_0xc616('0x82')](_0xc616('0x83'),_0x1320d8[_0xc616('0x78')]());return db[_0xc616('0x79')][_0xc616('0x2c')](_0x1320d8[_0xc616('0x78')](),{'type':db[_0xc616('0x79')][_0xc616('0x7a')][_0xc616('0x84')]});}})[_0xc616('0x1e')](function(){return{'sql':_0x41228d[_0xc616('0x78')]()};})[_0xc616('0x1e')](respondWithResult(_0x1b54cc,null))[_0xc616('0x3e')](handleError(_0x1b54cc,null));}; \ No newline at end of file +var _0x8128=['where','pick','filter','options','include','findAll','rows','catch','params','includeAll','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','right_join','cross_join','COUNT(%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','length','operator','field','condition','value','merge','getFields','ValidationErrorItem','AnalyticMetric','select','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','table','parentKey','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','join','left_join','SUM(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','IS\x20EMPTY','Sequelize','keyBy','from','Limited\x20Query:','SELECT','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','metric','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','dbH','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','CustomReports','destroy','sendStatus','error','stack','name','map','AnalyticCustomReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x3dcc2b,_0x3f5fbf){var _0xc59d7c=function(_0x46d872){while(--_0x46d872){_0x3dcc2b['push'](_0x3dcc2b['shift']());}};_0xc59d7c(++_0x3f5fbf);}(_0x8128,0x1b1));var _0x8812=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x8128[_0x2064e5];return _0x21a233;};'use strict';var pdf=require(_0x8812('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8812('0x1'));var jsonpatch=require(_0x8812('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8812('0x3'));var Mustache=require(_0x8812('0x4'));var util=require(_0x8812('0x5'));var path=require('path');var sox=require(_0x8812('0x6'));var csv=require(_0x8812('0x7'));var ejs=require(_0x8812('0x8'));var fs=require('fs');var _=require(_0x8812('0x9'));var squel=require('squel');var crypto=require(_0x8812('0xa'));var jsforce=require(_0x8812('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8812('0xc'));var Redis=require(_0x8812('0xd'));var authService=require(_0x8812('0xe'));var qs=require(_0x8812('0xf'));var as=require(_0x8812('0x10'));var hardwareService=require(_0x8812('0x11'));var logger=require(_0x8812('0x12'))(_0x8812('0x13'));var utils=require(_0x8812('0x14'));var config=require('../../config/environment');var db=require(_0x8812('0x15'))['db'];var dbH=require(_0x8812('0x15'))[_0x8812('0x16')];function respondWithStatusCode(_0xc68540,_0x30ab14){_0x30ab14=_0x30ab14||0xcc;return function(_0x8386f1){if(_0x8386f1){return _0xc68540['sendStatus'](_0x30ab14);}return _0xc68540[_0x8812('0x17')](_0x30ab14)[_0x8812('0x18')]();};}function respondWithResult(_0x589fd9,_0x557c5c){_0x557c5c=_0x557c5c||0xc8;return function(_0x4b37fa){if(_0x4b37fa){return _0x589fd9[_0x8812('0x17')](_0x557c5c)[_0x8812('0x19')](_0x4b37fa);}};}function respondWithFilteredResult(_0x554ddb,_0x50f04c){return function(_0x554cfa){if(_0x554cfa){var _0x4f8128=_0x554cfa[_0x8812('0x1a')],_0x556c44=_0x50f04c['offset'],_0xa2a8cc=_0x50f04c[_0x8812('0x1b')]+_0x50f04c[_0x8812('0x1c')],_0x5412bc;if(_0xa2a8cc>=_0x4f8128){_0xa2a8cc=_0x4f8128;_0x5412bc=0xc8;}else{_0x5412bc=0xce;}_0x554ddb['status'](_0x5412bc);return _0x554ddb[_0x8812('0x1d')](_0x8812('0x1e'),_0x556c44+'-'+_0xa2a8cc+'/'+_0x4f8128)[_0x8812('0x19')](_0x554cfa);}return null;};}function patchUpdates(_0x5096fc){return function(_0x59c4cd){try{jsonpatch[_0x8812('0x1f')](_0x59c4cd,_0x5096fc,!![]);}catch(_0x363f73){return BPromise[_0x8812('0x20')](_0x363f73);}return _0x59c4cd[_0x8812('0x21')]();};}function saveUpdates(_0x423ba1,_0x1e029e){return function(_0x4be5e9){if(_0x4be5e9){return _0x4be5e9[_0x8812('0x22')](_0x423ba1)[_0x8812('0x23')](function(_0xa20398){return _0xa20398;});}return null;};}function removeEntity(_0x5e2280,_0x22e8bc){return function(_0x3fbf5a){if(_0x3fbf5a){return _0x3fbf5a['destroy']()[_0x8812('0x23')](function(){var _0x545ec7=_0x3fbf5a[_0x8812('0x24')]({'plain':!![]});var _0x16e486=_0x8812('0x25');return db['UserProfileResource'][_0x8812('0x26')]({'where':{'type':_0x16e486,'resourceId':_0x545ec7['id']}})[_0x8812('0x23')](function(){return _0x3fbf5a;});})[_0x8812('0x23')](function(){_0x5e2280[_0x8812('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x477a40,_0x108a0f){return function(_0x2c2420){if(!_0x2c2420){_0x477a40[_0x8812('0x27')](0x194);}return _0x2c2420;};}function handleError(_0x31b575,_0xd33f4b){_0xd33f4b=_0xd33f4b||0x1f4;return function(_0x46f113){logger[_0x8812('0x28')](_0x46f113[_0x8812('0x29')]);if(_0x46f113[_0x8812('0x2a')]){delete _0x46f113['name'];}_0x31b575['status'](_0xd33f4b)['send'](_0x46f113);};}exports['index']=function(_0x409738,_0x35463d){var _0x3f7d17={},_0x1cbc0e={},_0x182706={'count':0x0,'rows':[]};var _0x54bec0=_[_0x8812('0x2b')](db[_0x8812('0x2c')][_0x8812('0x2d')],function(_0x288092){return{'name':_0x288092['fieldName'],'type':_0x288092[_0x8812('0x2e')][_0x8812('0x2f')]};});_0x1cbc0e[_0x8812('0x30')]=_[_0x8812('0x2b')](_0x54bec0,_0x8812('0x2a'));_0x1cbc0e[_0x8812('0x31')]=_[_0x8812('0x32')](_0x409738['query']);_0x1cbc0e[_0x8812('0x33')]=_[_0x8812('0x34')](_0x1cbc0e[_0x8812('0x30')],_0x1cbc0e[_0x8812('0x31')]);_0x3f7d17['attributes']=_['intersection'](_0x1cbc0e['model'],qs[_0x8812('0x35')](_0x409738[_0x8812('0x31')][_0x8812('0x35')]));_0x3f7d17['attributes']=_0x3f7d17['attributes']['length']?_0x3f7d17[_0x8812('0x36')]:_0x1cbc0e[_0x8812('0x30')];if(!_0x409738['query'][_0x8812('0x37')](_0x8812('0x38'))){_0x3f7d17[_0x8812('0x1c')]=qs[_0x8812('0x1c')](_0x409738['query'][_0x8812('0x1c')]);_0x3f7d17[_0x8812('0x1b')]=qs['offset'](_0x409738['query'][_0x8812('0x1b')]);}_0x3f7d17[_0x8812('0x39')]=qs['sort'](_0x409738['query'][_0x8812('0x3a')]);_0x3f7d17[_0x8812('0x3b')]=qs['filters'](_[_0x8812('0x3c')](_0x409738['query'],_0x1cbc0e['filters']),_0x54bec0);if(_0x409738[_0x8812('0x31')][_0x8812('0x3d')]){_0x3f7d17[_0x8812('0x3b')]=_['merge'](_0x3f7d17[_0x8812('0x3b')],{'$or':_[_0x8812('0x2b')](_0x54bec0,function(_0x22881e){if(_0x22881e['type']!=='VIRTUAL'){var _0x1289e1={};_0x1289e1[_0x22881e[_0x8812('0x2a')]]={'$like':'%'+_0x409738[_0x8812('0x31')][_0x8812('0x3d')]+'%'};return _0x1289e1;}})});}_0x3f7d17=_['merge']({},_0x3f7d17,_0x409738[_0x8812('0x3e')]);var _0xde5d67={'where':_0x3f7d17[_0x8812('0x3b')]};return db[_0x8812('0x2c')][_0x8812('0x1a')](_0xde5d67)[_0x8812('0x23')](function(_0x19eb04){_0x182706[_0x8812('0x1a')]=_0x19eb04;if(_0x409738['query']['includeAll']){_0x3f7d17[_0x8812('0x3f')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x8812('0x40')](_0x3f7d17);})[_0x8812('0x23')](function(_0x2dfbe5){_0x182706[_0x8812('0x41')]=_0x2dfbe5;return _0x182706;})[_0x8812('0x23')](respondWithFilteredResult(_0x35463d,_0x3f7d17))[_0x8812('0x42')](handleError(_0x35463d,null));};exports['show']=function(_0x3e7bc0,_0x5e9af9){var _0x2f3637={'raw':![],'where':{'id':_0x3e7bc0[_0x8812('0x43')]['id']}},_0xfff9cb={};_0xfff9cb[_0x8812('0x30')]=_[_0x8812('0x32')](db[_0x8812('0x2c')][_0x8812('0x2d')]);_0xfff9cb[_0x8812('0x31')]=_[_0x8812('0x32')](_0x3e7bc0[_0x8812('0x31')]);_0xfff9cb[_0x8812('0x33')]=_[_0x8812('0x34')](_0xfff9cb[_0x8812('0x30')],_0xfff9cb['query']);_0x2f3637[_0x8812('0x36')]=_['intersection'](_0xfff9cb['model'],qs[_0x8812('0x35')](_0x3e7bc0[_0x8812('0x31')][_0x8812('0x35')]));_0x2f3637[_0x8812('0x36')]=_0x2f3637['attributes']['length']?_0x2f3637[_0x8812('0x36')]:_0xfff9cb[_0x8812('0x30')];if(_0x3e7bc0['query'][_0x8812('0x44')]){_0x2f3637['include']=[{'all':!![]}];}_0x2f3637=_['merge']({},_0x2f3637,_0x3e7bc0['options']);return db[_0x8812('0x2c')][_0x8812('0x45')](_0x2f3637)[_0x8812('0x23')](handleEntityNotFound(_0x5e9af9,null))['then'](respondWithResult(_0x5e9af9,null))[_0x8812('0x42')](handleError(_0x5e9af9,null));};exports['create']=function(_0x2eccec,_0x5d9c38){return db['AnalyticCustomReport'][_0x8812('0x46')](_0x2eccec[_0x8812('0x47')],{})[_0x8812('0x23')](function(_0x572304){var _0x377852=_0x2eccec[_0x8812('0x48')][_0x8812('0x24')]({'plain':!![]});if(!_0x377852)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x377852[_0x8812('0x49')]==='user'){var _0x1c26b7=_0x572304[_0x8812('0x24')]({'plain':!![]});var _0x43d054=_0x8812('0x4a');return db[_0x8812('0x4b')]['find']({'where':{'name':_0x43d054,'userProfileId':_0x377852[_0x8812('0x4c')]},'raw':!![]})[_0x8812('0x23')](function(_0x156e33){if(_0x156e33&&_0x156e33[_0x8812('0x4d')]===0x0){return db['UserProfileResource'][_0x8812('0x46')]({'name':_0x1c26b7[_0x8812('0x2a')],'resourceId':_0x1c26b7['id'],'type':_0x8812('0x25'),'sectionId':_0x156e33['id']},{})[_0x8812('0x23')](function(){return _0x572304;});}else{return _0x572304;}})[_0x8812('0x42')](function(_0x4b8418){logger[_0x8812('0x28')](_0x8812('0x4e'),_0x4b8418);throw _0x4b8418;});}return _0x572304;})[_0x8812('0x23')](respondWithResult(_0x5d9c38,0xc9))[_0x8812('0x42')](handleError(_0x5d9c38,null));};exports[_0x8812('0x22')]=function(_0x48ad2f,_0x1bb959){if(_0x48ad2f[_0x8812('0x47')]['id']){delete _0x48ad2f[_0x8812('0x47')]['id'];}return db[_0x8812('0x2c')]['find']({'where':{'id':_0x48ad2f['params']['id']}})[_0x8812('0x23')](handleEntityNotFound(_0x1bb959,null))[_0x8812('0x23')](saveUpdates(_0x48ad2f['body'],null))[_0x8812('0x23')](respondWithResult(_0x1bb959,null))[_0x8812('0x42')](handleError(_0x1bb959,null));};exports[_0x8812('0x26')]=function(_0x25c90a,_0x878882){return db[_0x8812('0x2c')][_0x8812('0x45')]({'where':{'id':_0x25c90a[_0x8812('0x43')]['id']}})[_0x8812('0x23')](handleEntityNotFound(_0x878882,null))['then'](removeEntity(_0x878882,null))[_0x8812('0x42')](handleError(_0x878882,null));};exports[_0x8812('0x4f')]=function(_0x4bc6a7,_0x170e05){var _0x1d26cf=0xa;var _0x4b7dfe=['join','left_join',_0x8812('0x50'),_0x8812('0x51')];var _0x58c95f={'SUM':'SUM(%s)','COUNT':_0x8812('0x52'),'COUNT DISTINCT':_0x8812('0x53'),'MAX':_0x8812('0x54'),'MIN':_0x8812('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x8812('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8812('0x57')};var _0x26b55b={'SEC_TO_TIME':_0x8812('0x58'),'DATE':_0x8812('0x59'),'HOUR':_0x8812('0x5a'),'ROUND':_0x8812('0x5b'),'UNIX_TIMESTAMP':_0x8812('0x5c')};var _0xef1e79=function(_0x5581ba){return!_[_0x8812('0x5d')]([_0x8812('0x5e'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x8812('0x5f')],_0x5581ba);};var _0x203967=function(_0x2a83dc){if(!_0x2a83dc||!_0x2a83dc[_0x8812('0x60')][_0x8812('0x61')]){return'';}for(var _0x2e4a34='(',_0x21155d=0x0;_0x21155d<_0x2a83dc[_0x8812('0x60')][_0x8812('0x61')];_0x21155d+=0x1){_0x21155d>0x0&&(_0x2e4a34+='\x20'+_0x2a83dc[_0x8812('0x62')]+'\x20');_0x2e4a34+=_0x2a83dc[_0x8812('0x60')][_0x21155d]['group']?_0x203967(_0x2a83dc[_0x8812('0x60')][_0x21155d]['group']):_0x2a83dc[_0x8812('0x60')][_0x21155d][_0x8812('0x63')]+'\x20'+_0x2a83dc[_0x8812('0x60')][_0x21155d][_0x8812('0x64')]+(_0xef1e79(_0x2a83dc[_0x8812('0x60')][_0x21155d][_0x8812('0x64')])?'\x20'+_0x2a83dc[_0x8812('0x60')][_0x21155d][_0x8812('0x65')]:'');}return _0x2e4a34+')';};var _0x179fa6={'where':{'id':_0x4bc6a7[_0x8812('0x43')]['id']}},_0x385e4d,_0x13b945,_0x41834b,_0x5a25f6,_0x37103a;_0x179fa6=_[_0x8812('0x66')]({},_0x179fa6,_0x4bc6a7['options']);return db[_0x8812('0x2c')][_0x8812('0x45')](_0x179fa6)[_0x8812('0x23')](function(_0x282b5d){if(_0x282b5d){_0x385e4d=_0x282b5d;return _0x282b5d[_0x8812('0x67')]();}return null;})['then'](function(_0x2194b6){if(_0x2194b6){if(!_0x2194b6[_0x8812('0x61')]){throw new db['Sequelize'][(_0x8812('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x13b945=_0x2194b6;return db[_0x8812('0x69')][_0x8812('0x40')]({'raw':!![]});}return null;})[_0x8812('0x23')](function(_0x4367a0){if(_0x4367a0){_0x41834b=_['keyBy'](_0x4367a0,'id');var _0x5b1cbb;var _0x33a5b9=squel[_0x8812('0x6a')]();_0x33a5b9['from'](_0x385e4d['table']);for(var _0x4ff6b0=0x0;_0x4ff6b0<_0x13b945[_0x8812('0x61')];_0x4ff6b0+=0x1){_0x5b1cbb=_0x13b945[_0x4ff6b0][_0x8812('0x6b')]?_0x41834b[_0x13b945[_0x4ff6b0][_0x8812('0x6b')]]['metric']:_0x13b945[_0x4ff6b0]['field'];_0x5b1cbb=_0x13b945[_0x4ff6b0][_0x8812('0x6c')]?_[_0x8812('0x6d')](_0x58c95f[_0x13b945[_0x4ff6b0]['function']],'%s',_0x5b1cbb):_0x5b1cbb;_0x5b1cbb=_0x13b945[_0x4ff6b0][_0x8812('0x6e')]?_[_0x8812('0x6d')](_0x26b55b[_0x13b945[_0x4ff6b0]['format']],'%s',_0x5b1cbb):_0x5b1cbb;if(_0x13b945[_0x4ff6b0][_0x8812('0x6f')]){_0x33a5b9[_0x8812('0x70')](_0x5b1cbb);}_0x13b945[_0x4ff6b0][_0x8812('0x71')]&&_0x33a5b9[_0x8812('0x39')](_0x5b1cbb,_0x13b945[_0x4ff6b0][_0x8812('0x71')]===_0x8812('0x72')?![]:!![]);_0x33a5b9[_0x8812('0x63')](_0x5b1cbb,_0x13b945[_0x4ff6b0][_0x8812('0x73')]||_0x5b1cbb);}if(_0x385e4d[_0x8812('0x74')]){_0x385e4d[_0x8812('0x74')]=JSON[_0x8812('0x75')](_0x385e4d[_0x8812('0x74')]);for(var _0x5b3760=0x0;_0x5b3760<_0x385e4d[_0x8812('0x74')][_0x8812('0x61')];_0x5b3760+=0x1){if(_0x385e4d[_0x8812('0x74')][_0x5b3760][_0x8812('0x2e')]&&_[_0x8812('0x5d')](_0x4b7dfe,_0x385e4d[_0x8812('0x74')][_0x5b3760][_0x8812('0x2e')])&&_0x385e4d[_0x8812('0x74')][_0x5b3760]['parentKey']&&_0x385e4d['joins'][_0x5b3760]['foreignTable']&&_0x385e4d[_0x8812('0x74')][_0x5b3760]['foreignKey']){_0x33a5b9[_0x385e4d['joins'][_0x5b3760][_0x8812('0x2e')]](_0x385e4d[_0x8812('0x74')][_0x5b3760][_0x8812('0x76')],null,util[_0x8812('0x6e')](_0x8812('0x77'),_0x385e4d[_0x8812('0x78')],_0x385e4d[_0x8812('0x74')][_0x5b3760][_0x8812('0x79')],_0x385e4d[_0x8812('0x74')][_0x5b3760]['foreignTable'],_0x385e4d[_0x8812('0x74')][_0x5b3760][_0x8812('0x7a')]));}}}if(_0x385e4d[_0x8812('0x7b')]){_0x385e4d['conditions']=JSON[_0x8812('0x75')](_0x385e4d[_0x8812('0x7b')]);_0x33a5b9[_0x8812('0x3b')](_0x203967(_0x385e4d['conditions'][_0x8812('0x70')]));}_0x37103a=_0x33a5b9[_0x8812('0x7c')]();_0x33a5b9['limit'](_0x1d26cf);_0x33a5b9[_0x8812('0x1b')](0x0);logger[_0x8812('0x7d')]('Limited\x20Query:',_0x33a5b9[_0x8812('0x7e')]());return db[_0x8812('0x7f')][_0x8812('0x31')](_0x33a5b9[_0x8812('0x7e')](),{'type':db[_0x8812('0x7f')][_0x8812('0x80')]['SELECT']});}})[_0x8812('0x23')](respondWithResult(_0x170e05,null))[_0x8812('0x42')](handleError(_0x170e05,null));};function runReport(_0x3f95b4,_0xf46b03,_0x30f1ba){var _0x4534c0=_0xf46b03[_0x8812('0x2a')];var _0xe89fb3=0xa;var _0xbef92=[_0x8812('0x81'),_0x8812('0x82'),'right_join',_0x8812('0x51')];var _0x4683ae={'SUM':_0x8812('0x83'),'COUNT':_0x8812('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8812('0x54'),'MIN':'MIN(%s)','AVG':_0x8812('0x84'),'GROUP_CONCAT':_0x8812('0x56'),'GROUP_CONCAT ASC':_0x8812('0x85'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x47c077={'SEC_TO_TIME':_0x8812('0x58'),'DATE':_0x8812('0x59'),'HOUR':_0x8812('0x5a'),'ROUND':_0x8812('0x5b'),'UNIX_TIMESTAMP':_0x8812('0x5c')};var _0x3b06a1=function(_0x2914b5){return!_[_0x8812('0x5d')]([_0x8812('0x5e'),_0x8812('0x86'),_0x8812('0x87'),_0x8812('0x5f')],_0x2914b5);};var _0x9d01e4=function(_0x3bf823){if(!_0x3bf823||!_0x3bf823[_0x8812('0x60')][_0x8812('0x61')]){return'';}for(var _0x221ed0='(',_0x19d3f5=0x0;_0x19d3f5<_0x3bf823[_0x8812('0x60')]['length'];_0x19d3f5+=0x1){_0x19d3f5>0x0&&(_0x221ed0+='\x20'+_0x3bf823[_0x8812('0x62')]+'\x20');_0x221ed0+=_0x3bf823[_0x8812('0x60')][_0x19d3f5][_0x8812('0x70')]?_0x9d01e4(_0x3bf823[_0x8812('0x60')][_0x19d3f5][_0x8812('0x70')]):_0x3bf823[_0x8812('0x60')][_0x19d3f5][_0x8812('0x63')]+'\x20'+_0x3bf823['rules'][_0x19d3f5][_0x8812('0x64')]+(_0x3b06a1(_0x3bf823[_0x8812('0x60')][_0x19d3f5][_0x8812('0x64')])?'\x20'+_0x3bf823[_0x8812('0x60')][_0x19d3f5][_0x8812('0x65')]:'');}return _0x221ed0+')';};var _0x178a17={'where':{'id':_0x3f95b4['id']}},_0x4cddc6,_0x3dea41,_0x13ab1d,_0x4f4be8,_0x15e7d7;_0x178a17=_[_0x8812('0x66')]({},_0x178a17,_0x30f1ba);return db[_0x8812('0x2c')]['find'](_0x178a17)[_0x8812('0x23')](function(_0x44e904){if(_0x44e904){_0x4cddc6=_0x44e904;return _0x44e904[_0x8812('0x67')]();}return null;})[_0x8812('0x23')](function(_0x1c3ad0){if(_0x1c3ad0){if(!_0x1c3ad0['length']){throw new db[(_0x8812('0x88'))][(_0x8812('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3dea41=_0x1c3ad0;return db[_0x8812('0x69')][_0x8812('0x40')]({'raw':!![]});}return null;})[_0x8812('0x23')](function(_0x550ae6){if(_0x550ae6){_0x13ab1d=_[_0x8812('0x89')](_0x550ae6,'id');var _0x10a5cc;var _0x4914a3=squel['select']();_0x4914a3[_0x8812('0x8a')](_0x4cddc6['table']);for(var _0x564f80=0x0;_0x564f80<_0x3dea41[_0x8812('0x61')];_0x564f80+=0x1){_0x10a5cc=_0x3dea41[_0x564f80][_0x8812('0x6b')]?_0x13ab1d[_0x3dea41[_0x564f80]['MetricId']]['metric']:_0x3dea41[_0x564f80][_0x8812('0x63')];_0x10a5cc=_0x3dea41[_0x564f80][_0x8812('0x6c')]?_[_0x8812('0x6d')](_0x4683ae[_0x3dea41[_0x564f80][_0x8812('0x6c')]],'%s',_0x10a5cc):_0x10a5cc;_0x10a5cc=_0x3dea41[_0x564f80][_0x8812('0x6e')]?_[_0x8812('0x6d')](_0x47c077[_0x3dea41[_0x564f80]['format']],'%s',_0x10a5cc):_0x10a5cc;if(_0x3dea41[_0x564f80]['groupBy']){_0x4914a3[_0x8812('0x70')](_0x10a5cc);}_0x3dea41[_0x564f80][_0x8812('0x71')]&&_0x4914a3['order'](_0x10a5cc,_0x3dea41[_0x564f80]['orderBy']===_0x8812('0x72')?![]:!![]);_0x4914a3['field'](_0x10a5cc,_0x3dea41[_0x564f80][_0x8812('0x73')]||_0x10a5cc);}if(_0x4cddc6[_0x8812('0x74')]){_0x4cddc6[_0x8812('0x74')]=JSON[_0x8812('0x75')](_0x4cddc6[_0x8812('0x74')]);for(var _0x373a62=0x0;_0x373a62<_0x4cddc6[_0x8812('0x74')]['length'];_0x373a62+=0x1){if(_0x4cddc6['joins'][_0x373a62][_0x8812('0x2e')]&&_[_0x8812('0x5d')](_0xbef92,_0x4cddc6[_0x8812('0x74')][_0x373a62]['type'])&&_0x4cddc6[_0x8812('0x74')][_0x373a62][_0x8812('0x79')]&&_0x4cddc6[_0x8812('0x74')][_0x373a62][_0x8812('0x76')]&&_0x4cddc6['joins'][_0x373a62]['foreignKey']){_0x4914a3[_0x4cddc6[_0x8812('0x74')][_0x373a62][_0x8812('0x2e')]](_0x4cddc6[_0x8812('0x74')][_0x373a62][_0x8812('0x76')],null,util['format'](_0x8812('0x77'),_0x4cddc6[_0x8812('0x78')],_0x4cddc6[_0x8812('0x74')][_0x373a62][_0x8812('0x79')],_0x4cddc6[_0x8812('0x74')][_0x373a62][_0x8812('0x76')],_0x4cddc6[_0x8812('0x74')][_0x373a62][_0x8812('0x7a')]));}}}if(_0x4cddc6[_0x8812('0x7b')]){_0x4cddc6[_0x8812('0x7b')]=JSON['parse'](_0x4cddc6[_0x8812('0x7b')]);_0x4914a3[_0x8812('0x3b')](_0x9d01e4(_0x4cddc6[_0x8812('0x7b')]['group']));}_0x15e7d7=_0x4914a3[_0x8812('0x7c')]();_0x4914a3[_0x8812('0x1c')](_0xe89fb3);_0x4914a3[_0x8812('0x1b')](0x0);logger[_0x8812('0x7d')](_0x8812('0x8b'),_0x4914a3[_0x8812('0x7e')]());return db[_0x8812('0x7f')][_0x8812('0x31')](_0x4914a3[_0x8812('0x7e')](),{'type':db[_0x8812('0x7f')][_0x8812('0x80')][_0x8812('0x8c')]});}})[_0x8812('0x23')](function(_0x15981b){if(!_0x15981b[_0x8812('0x61')]){throw new db['Sequelize'][(_0x8812('0x68'))](_0x8812('0x8d'),0xcc);}if(_0xf46b03[_0x8812('0x8e')]===_0x8812('0x8f')){return null;}var _0x8b024a=_[_0x8812('0x66')](_0xf46b03,{'name':_0xf46b03[_0x8812('0x90')]||_0xf46b03['name']||_0x4cddc6['name'],'basename':_0x4534c0,'savename':util[_0x8812('0x6e')](_0x8812('0x91'),_0xf46b03[_0x8812('0x2a')]||_0x4cddc6[_0x8812('0x2a')],require(_0x8812('0x92'))[_0x8812('0x93')](0x4),_0xf46b03['output']||_0x8812('0x94')),'reportId':_0x4cddc6['id'],'reportType':_0x8812('0x95')});return db[_0x8812('0x96')]['create'](_0x8b024a,{'raw':!![]});})[_0x8812('0x23')](function(_0x1ba6ca){if(_0x4cddc6[_0x8812('0x78')]==='cdr'){_0x15e7d7[_0x8812('0x3b')](_0x4cddc6['table']+_0x8812('0x97'),_0xf46b03[_0x8812('0x98')],_0xf46b03['endDate']);}else{_0x15e7d7['where'](_0x4cddc6[_0x8812('0x78')]+_0x8812('0x99'),_0xf46b03[_0x8812('0x98')],_0xf46b03[_0x8812('0x9a')]);}if(_0x1ba6ca){logger['info']('Run\x20Query:',_0x15e7d7[_0x8812('0x7e')]());require(_0x8812('0x9b'))[_0x8812('0x9c')](path[_0x8812('0x81')](__dirname,_0x8812('0x9d'),_0x1ba6ca[_0x8812('0x8e')]),[_0x1ba6ca['id'],_0x15e7d7[_0x8812('0x7e')](),path[_0x8812('0x81')](__dirname,_0x8812('0x9e'),_0x1ba6ca['savename']),_0x4534c0]);return _0x1ba6ca;}else{var _0xd92404=squel[_0x8812('0x6a')]();_0xd92404['from']('('+_0x15e7d7[_0x8812('0x7e')]()+')',_0x8812('0x9f'));_0xd92404[_0x8812('0x63')](_0x8812('0xa0'),_0x8812('0x1a'));_0x15e7d7[_0x8812('0x1c')](_0xf46b03['limit']||_0xe89fb3);_0x15e7d7[_0x8812('0x1b')](_0xf46b03[_0x8812('0x1b')]||0x0);return dbH[_0x8812('0x7f')][_0x8812('0x31')](_0xd92404[_0x8812('0x7e')](),{'type':dbH[_0x8812('0x7f')]['QueryTypes']['SELECT']})[_0x8812('0x23')](function(_0x370919){if(!_0x370919['length']){_0x4f4be8=0x0;}else{_0x4f4be8=_0x370919[0x0]['count']||0x0;}return dbH[_0x8812('0x7f')][_0x8812('0x31')](_0x15e7d7[_0x8812('0x7e')](),{'type':dbH[_0x8812('0x7f')][_0x8812('0x80')][_0x8812('0x8c')]});})['then'](function(_0x113b57){return{'rows':_0x113b57||[],'count':_0x4f4be8};});}});}exports[_0x8812('0xa1')]=function(_0x4e743f,_0x122453){return runReport(_0x4e743f[_0x8812('0x43')],_0x4e743f[_0x8812('0x31')],_0x4e743f[_0x8812('0x3e')])[_0x8812('0x23')](respondWithResult(_0x122453,null))[_0x8812('0x42')](handleError(_0x122453,null));};exports[_0x8812('0xa2')]=runReport;exports[_0x8812('0x31')]=function(_0x1d9242,_0x158e58){var _0x18fb17=0xa;var _0x33ca99=[_0x8812('0x81'),_0x8812('0x82'),_0x8812('0x50'),_0x8812('0x51')];var _0x4f8f64={'SUM':'SUM(%s)','COUNT':_0x8812('0x52'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8812('0x54'),'MIN':_0x8812('0x55'),'AVG':_0x8812('0x84'),'GROUP_CONCAT':_0x8812('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x8a31eb={'SEC_TO_TIME':_0x8812('0x58'),'DATE':_0x8812('0x59'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x8812('0x5c')};var _0x541fca=function(_0x31b13a){return!_['includes']([_0x8812('0x5e'),_0x8812('0x86'),'IS\x20EMPTY',_0x8812('0x5f')],_0x31b13a);};var _0x2c57f3=function(_0x26d129){if(!_0x26d129||!_0x26d129['rules']['length']){return'';}for(var _0x24a77b='(',_0x5e72d3=0x0;_0x5e72d3<_0x26d129[_0x8812('0x60')][_0x8812('0x61')];_0x5e72d3+=0x1){_0x5e72d3>0x0&&(_0x24a77b+='\x20'+_0x26d129[_0x8812('0x62')]+'\x20');_0x24a77b+=_0x26d129[_0x8812('0x60')][_0x5e72d3]['group']?_0x2c57f3(_0x26d129[_0x8812('0x60')][_0x5e72d3][_0x8812('0x70')]):_0x26d129[_0x8812('0x60')][_0x5e72d3][_0x8812('0x63')]+'\x20'+_0x26d129[_0x8812('0x60')][_0x5e72d3][_0x8812('0x64')]+(_0x541fca(_0x26d129[_0x8812('0x60')][_0x5e72d3]['condition'])?'\x20'+_0x26d129[_0x8812('0x60')][_0x5e72d3]['value']:'');}return _0x24a77b+')';};var _0x4057f6={'where':{'id':_0x1d9242[_0x8812('0x43')]['id']}},_0x4dc3fb,_0x34b6d8,_0x2b1330,_0x4fe563,_0x2c67a7;_0x4057f6=_[_0x8812('0x66')]({},_0x4057f6,_0x1d9242[_0x8812('0x3e')]);return db['AnalyticCustomReport'][_0x8812('0x45')](_0x4057f6)['then'](function(_0x4d1e1f){if(_0x4d1e1f){_0x4dc3fb=_0x4d1e1f;return _0x4d1e1f[_0x8812('0x67')]();}return null;})[_0x8812('0x23')](function(_0x117ffc){if(_0x117ffc){if(!_0x117ffc[_0x8812('0x61')]){throw new db[(_0x8812('0x88'))][(_0x8812('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x34b6d8=_0x117ffc;return db[_0x8812('0x69')][_0x8812('0x40')]({'raw':!![]});}return null;})[_0x8812('0x23')](function(_0x1d4eb8){if(_0x1d4eb8){_0x2b1330=_[_0x8812('0x89')](_0x1d4eb8,'id');var _0x2b8bb0;var _0x2cbfd2=squel[_0x8812('0x6a')]();_0x2cbfd2[_0x8812('0x8a')](_0x4dc3fb['table']);for(var _0x128f1a=0x0;_0x128f1a<_0x34b6d8[_0x8812('0x61')];_0x128f1a+=0x1){_0x2b8bb0=_0x34b6d8[_0x128f1a]['MetricId']?_0x2b1330[_0x34b6d8[_0x128f1a][_0x8812('0x6b')]][_0x8812('0xa3')]:_0x34b6d8[_0x128f1a][_0x8812('0x63')];_0x2b8bb0=_0x34b6d8[_0x128f1a]['function']?_[_0x8812('0x6d')](_0x4f8f64[_0x34b6d8[_0x128f1a][_0x8812('0x6c')]],'%s',_0x2b8bb0):_0x2b8bb0;_0x2b8bb0=_0x34b6d8[_0x128f1a][_0x8812('0x6e')]?_[_0x8812('0x6d')](_0x8a31eb[_0x34b6d8[_0x128f1a][_0x8812('0x6e')]],'%s',_0x2b8bb0):_0x2b8bb0;if(_0x34b6d8[_0x128f1a][_0x8812('0x6f')]){_0x2cbfd2[_0x8812('0x70')](_0x2b8bb0);}_0x34b6d8[_0x128f1a][_0x8812('0x71')]&&_0x2cbfd2['order'](_0x2b8bb0,_0x34b6d8[_0x128f1a][_0x8812('0x71')]===_0x8812('0x72')?![]:!![]);_0x2cbfd2[_0x8812('0x63')](_0x2b8bb0,_0x34b6d8[_0x128f1a][_0x8812('0x73')]||_0x2b8bb0);}if(_0x4dc3fb['joins']){_0x4dc3fb['joins']=JSON[_0x8812('0x75')](_0x4dc3fb[_0x8812('0x74')]);for(var _0x2f6d83=0x0;_0x2f6d83<_0x4dc3fb[_0x8812('0x74')][_0x8812('0x61')];_0x2f6d83+=0x1){if(_0x4dc3fb[_0x8812('0x74')][_0x2f6d83][_0x8812('0x2e')]&&_[_0x8812('0x5d')](_0x33ca99,_0x4dc3fb['joins'][_0x2f6d83]['type'])&&_0x4dc3fb[_0x8812('0x74')][_0x2f6d83][_0x8812('0x79')]&&_0x4dc3fb['joins'][_0x2f6d83]['foreignTable']&&_0x4dc3fb[_0x8812('0x74')][_0x2f6d83][_0x8812('0x7a')]){_0x2cbfd2[_0x4dc3fb[_0x8812('0x74')][_0x2f6d83][_0x8812('0x2e')]](_0x4dc3fb[_0x8812('0x74')][_0x2f6d83][_0x8812('0x76')],null,util[_0x8812('0x6e')](_0x8812('0x77'),_0x4dc3fb[_0x8812('0x78')],_0x4dc3fb[_0x8812('0x74')][_0x2f6d83][_0x8812('0x79')],_0x4dc3fb[_0x8812('0x74')][_0x2f6d83][_0x8812('0x76')],_0x4dc3fb['joins'][_0x2f6d83][_0x8812('0x7a')]));}}}if(_0x4dc3fb['conditions']){_0x4dc3fb[_0x8812('0x7b')]=JSON['parse'](_0x4dc3fb[_0x8812('0x7b')]);_0x2cbfd2['where'](_0x2c57f3(_0x4dc3fb[_0x8812('0x7b')][_0x8812('0x70')]));}_0x2c67a7=_0x2cbfd2['clone']();_0x2cbfd2[_0x8812('0x1c')](_0x18fb17);_0x2cbfd2[_0x8812('0x1b')](0x0);logger[_0x8812('0x7d')](_0x8812('0x8b'),_0x2cbfd2[_0x8812('0x7e')]());return db['sequelize'][_0x8812('0x31')](_0x2cbfd2[_0x8812('0x7e')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0x8812('0x23')](function(){return{'sql':_0x2c67a7[_0x8812('0x7e')]()};})['then'](respondWithResult(_0x158e58,null))[_0x8812('0x42')](handleError(_0x158e58,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index ec130f0..122ddf9 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 _0xa5b5=['../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa5b5,0xd1));var _0x5a5b=function(_0x4d6d5d,_0x66d751){_0x4d6d5d=_0x4d6d5d-0x0;var _0x46f669=_0xa5b5[_0x4d6d5d];return _0x46f669;};'use strict';var _=require(_0x5a5b('0x0'));var util=require(_0x5a5b('0x1'));var logger=require(_0x5a5b('0x2'))(_0x5a5b('0x3'));var moment=require(_0x5a5b('0x4'));var BPromise=require('bluebird');var rp=require(_0x5a5b('0x5'));var fs=require('fs');var path=require(_0x5a5b('0x6'));var rimraf=require('rimraf');var config=require(_0x5a5b('0x7'));var attributes=require(_0x5a5b('0x8'));module[_0x5a5b('0x9')]=function(_0x3307ee,_0x3b156d){return _0x3307ee[_0x5a5b('0xa')](_0x5a5b('0xb'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1339=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x4927fb,_0x3636d1){var _0x2224d9=function(_0x17ccc5){while(--_0x17ccc5){_0x4927fb['push'](_0x4927fb['shift']());}};_0x2224d9(++_0x3636d1);}(_0x1339,0x122));var _0x9133=function(_0x1551b4,_0x881f50){_0x1551b4=_0x1551b4-0x0;var _0x39ed4b=_0x1339[_0x1551b4];return _0x39ed4b;};'use strict';var _=require(_0x9133('0x0'));var util=require(_0x9133('0x1'));var logger=require('../../config/logger')(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var rp=require(_0x9133('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require(_0x9133('0x8'));module[_0x9133('0x9')]=function(_0x785b9c,_0x2fe331){return _0x785b9c[_0x9133('0xa')](_0x9133('0xb'),attributes,{'tableName':_0x9133('0xc'),'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 fe6e3ee..24fb2e0 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 _0xcae1=['request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0xe4b5a2,_0x13b39e){var _0x4b36bb=function(_0x1f437d){while(--_0x1f437d){_0xe4b5a2['push'](_0xe4b5a2['shift']());}};_0x4b36bb(++_0x13b39e);}(_0xcae1,0xaf));var _0x1cae=function(_0x22c2da,_0x569b31){_0x22c2da=_0x22c2da-0x0;var _0x65a816=_0xcae1[_0x22c2da];return _0x65a816;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cae('0x0'));var BPromise=require(_0x1cae('0x1'));var rs=require(_0x1cae('0x2'));var fs=require('fs');var Redis=require(_0x1cae('0x3'));var db=require(_0x1cae('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1cae('0x5'));var jayson=require(_0x1cae('0x6'));var client=jayson[_0x1cae('0x7')][_0x1cae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bbb70,_0x277178,_0x6e4f5a){return new BPromise(function(_0x55b66e,_0x12e9ef){return client[_0x1cae('0x9')](_0x1bbb70,_0x6e4f5a)[_0x1cae('0xa')](function(_0x47de83){logger[_0x1cae('0xb')](_0x1cae('0xc'),_0x277178,'request\x20sent');logger['debug'](_0x1cae('0xd'),_0x277178,_0x1cae('0xe'),JSON[_0x1cae('0xf')](_0x47de83));if(_0x47de83[_0x1cae('0x10')]){if(_0x47de83['error'][_0x1cae('0x11')]===0x1f4){logger[_0x1cae('0x10')](_0x1cae('0xc'),_0x277178,_0x47de83[_0x1cae('0x10')][_0x1cae('0x12')]);return _0x12e9ef(_0x47de83['error'][_0x1cae('0x12')]);}logger[_0x1cae('0x10')](_0x1cae('0xc'),_0x277178,_0x47de83[_0x1cae('0x10')][_0x1cae('0x12')]);return _0x55b66e(_0x47de83['error'][_0x1cae('0x12')]);}else{logger[_0x1cae('0xb')](_0x1cae('0xc'),_0x277178,_0x1cae('0xe'));_0x55b66e(_0x47de83[_0x1cae('0x13')][_0x1cae('0x12')]);}})[_0x1cae('0x14')](function(_0x52a5a9){logger[_0x1cae('0x10')](_0x1cae('0xc'),_0x277178,_0x52a5a9);_0x12e9ef(_0x52a5a9);});});} \ No newline at end of file +var _0x0095=['stringify','code','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2ea8c0,_0x211329){var _0x541f8d=function(_0x3818dd){while(--_0x3818dd){_0x2ea8c0['push'](_0x2ea8c0['shift']());}};_0x541f8d(++_0x211329);}(_0x0095,0xa7));var _0x5009=function(_0x39748a,_0x9f13fe){_0x39748a=_0x39748a-0x0;var _0xd9a7f2=_0x0095[_0x39748a];return _0xd9a7f2;};'use strict';var _=require(_0x5009('0x0'));var util=require('util');var moment=require(_0x5009('0x1'));var BPromise=require(_0x5009('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5009('0x3'));var db=require(_0x5009('0x4'))['db'];var utils=require(_0x5009('0x5'));var logger=require(_0x5009('0x6'))('rpc');var config=require(_0x5009('0x7'));var jayson=require(_0x5009('0x8'));var client=jayson[_0x5009('0x9')][_0x5009('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e980e,_0xd2389,_0x8ab485){return new BPromise(function(_0x418948,_0x1c5793){return client[_0x5009('0xb')](_0x3e980e,_0x8ab485)[_0x5009('0xc')](function(_0x317f64){logger[_0x5009('0xd')](_0x5009('0xe'),_0xd2389,_0x5009('0xf'));logger[_0x5009('0x10')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xd2389,_0x5009('0xf'),JSON[_0x5009('0x11')](_0x317f64));if(_0x317f64['error']){if(_0x317f64['error'][_0x5009('0x12')]===0x1f4){logger['error'](_0x5009('0xe'),_0xd2389,_0x317f64[_0x5009('0x13')]['message']);return _0x1c5793(_0x317f64['error'][_0x5009('0x14')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xd2389,_0x317f64[_0x5009('0x13')][_0x5009('0x14')]);return _0x418948(_0x317f64['error'][_0x5009('0x14')]);}else{logger[_0x5009('0xd')](_0x5009('0xe'),_0xd2389,_0x5009('0xf'));_0x418948(_0x317f64[_0x5009('0x15')][_0x5009('0x14')]);}})[_0x5009('0x16')](function(_0x613482){logger[_0x5009('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0xd2389,_0x613482);_0x1c5793(_0x613482);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 3975858..7c17764 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 _0xa8d5=['util','connect-timeout','express','Router','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','multer'];(function(_0x57d0dd,_0x5b1baa){var _0x5cf590=function(_0x5df925){while(--_0x5df925){_0x57d0dd['push'](_0x57d0dd['shift']());}};_0x5cf590(++_0x5b1baa);}(_0xa8d5,0x92));var _0x5a8d=function(_0x27e8fd,_0x4b08b1){_0x27e8fd=_0x27e8fd-0x0;var _0x509d53=_0xa8d5[_0x27e8fd];return _0x509d53;};'use strict';var multer=require(_0x5a8d('0x0'));var util=require(_0x5a8d('0x1'));var path=require('path');var timeout=require(_0x5a8d('0x2'));var express=require(_0x5a8d('0x3'));var router=express[_0x5a8d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5a8d('0x5'));var config=require('../../config/environment');var controller=require(_0x5a8d('0x6'));router[_0x5a8d('0x7')]('/',auth[_0x5a8d('0x8')](),controller['index']);router[_0x5a8d('0x7')](_0x5a8d('0x9'),auth[_0x5a8d('0x8')](),controller[_0x5a8d('0xa')]);router['get'](_0x5a8d('0xb'),auth['isAuthenticated'](),controller['preview']);router[_0x5a8d('0x7')](_0x5a8d('0xc'),auth[_0x5a8d('0x8')](),controller[_0x5a8d('0xd')]);router[_0x5a8d('0x7')](_0x5a8d('0xe'),auth[_0x5a8d('0x8')](),controller[_0x5a8d('0xf')]);router['post']('/',auth[_0x5a8d('0x8')](),controller[_0x5a8d('0x10')]);router[_0x5a8d('0x11')](_0x5a8d('0x9'),auth[_0x5a8d('0x8')](),controller[_0x5a8d('0x12')]);router[_0x5a8d('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x5a8d('0x14')]);module['exports']=router; \ No newline at end of file +var _0x7df2=['run','/:id/query','query','put','delete','exports','path','connect-timeout','express','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview'];(function(_0x794785,_0x4fce91){var _0x7891a9=function(_0x6d012f){while(--_0x6d012f){_0x794785['push'](_0x794785['shift']());}};_0x7891a9(++_0x4fce91);}(_0x7df2,0xba));var _0x27df=function(_0x144301,_0x1fca9e){_0x144301=_0x144301-0x0;var _0x2930d6=_0x7df2[_0x144301];return _0x2930d6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x27df('0x0'));var timeout=require(_0x27df('0x1'));var express=require(_0x27df('0x2'));var router=express['Router']();var auth=require(_0x27df('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x27df('0x4'));var controller=require(_0x27df('0x5'));router[_0x27df('0x6')]('/',auth[_0x27df('0x7')](),controller[_0x27df('0x8')]);router['get'](_0x27df('0x9'),auth[_0x27df('0x7')](),controller[_0x27df('0xa')]);router[_0x27df('0x6')]('/:id/preview',auth['isAuthenticated'](),controller[_0x27df('0xb')]);router[_0x27df('0x6')]('/:id/run',auth[_0x27df('0x7')](),controller[_0x27df('0xc')]);router[_0x27df('0x6')](_0x27df('0xd'),auth[_0x27df('0x7')](),controller[_0x27df('0xe')]);router['post']('/',auth[_0x27df('0x7')](),controller['create']);router[_0x27df('0xf')](_0x27df('0x9'),auth[_0x27df('0x7')](),controller['update']);router[_0x27df('0x10')](_0x27df('0x9'),auth[_0x27df('0x7')](),controller['destroy']);module[_0x27df('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 0e2dba9..6d04c68 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 _0x6060=['sequelize','exports','STRING','TEXT'];(function(_0x3a61d6,_0xe93a58){var _0x370544=function(_0xa3301f){while(--_0xa3301f){_0x3a61d6['push'](_0x3a61d6['shift']());}};_0x370544(++_0xe93a58);}(_0x6060,0xe4));var _0x0606=function(_0x5ba353,_0x11fd8b){_0x5ba353=_0x5ba353-0x0;var _0x149f6b=_0x6060[_0x5ba353];return _0x149f6b;};'use strict';var Sequelize=require(_0x0606('0x0'));module[_0x0606('0x1')]={'name':{'type':Sequelize[_0x0606('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x0606('0x2')]},'table':{'type':Sequelize[_0x0606('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x0606('0x3')]}}; \ No newline at end of file +var _0xccad=['TEXT','sequelize','STRING'];(function(_0x4af406,_0x253f07){var _0x9af29c=function(_0x2d173f){while(--_0x2d173f){_0x4af406['push'](_0x4af406['shift']());}};_0x9af29c(++_0x253f07);}(_0xccad,0xc1));var _0xdcca=function(_0x127a60,_0x37f33a){_0x127a60=_0x127a60-0x0;var _0xc1f6a3=_0xccad[_0x127a60];return _0xc1f6a3;};'use strict';var Sequelize=require(_0xdcca('0x0'));module['exports']={'name':{'type':Sequelize[_0xdcca('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xdcca('0x1')]},'parent':{'type':Sequelize[_0xdcca('0x1')]},'table':{'type':Sequelize[_0xdcca('0x1')]},'conditions':{'type':Sequelize[_0xdcca('0x2')]},'joins':{'type':Sequelize[_0xdcca('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index d9ee057..e4c4af9 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 _0xbe1c=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','dbH','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','index','AnalyticDefaultReport','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','from','table','MetricId','metric','field','function','replace','format','orderBy','DESC','alias','joins','parentKey','foreignTable','conditions','parse','debug','Limited\x20Query:','toString','sequelize','SELECT','right_join','SUM(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20NULL','IS\x20NOT\x20EMPTY','operator','keyBy','select','groupBy','foreignKey','clone','QueryTypes','output','web','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','runReport','COUNT(%s)','Please\x20insert\x20at\x20least\x20one\x20field','eml-format','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x32b6cc,_0x1707ef){var _0x4e3b56=function(_0x158beb){while(--_0x158beb){_0x32b6cc['push'](_0x32b6cc['shift']());}};_0x4e3b56(++_0x1707ef);}(_0xbe1c,0x96));var _0xcbe1=function(_0xcc7a6d,_0x1fe408){_0xcc7a6d=_0xcc7a6d-0x0;var _0x19f821=_0xbe1c[_0xcc7a6d];return _0x19f821;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcbe1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcbe1('0x1'));var rp=require(_0xcbe1('0x2'));var moment=require('moment');var BPromise=require(_0xcbe1('0x3'));var Mustache=require(_0xcbe1('0x4'));var util=require('util');var path=require('path');var sox=require(_0xcbe1('0x5'));var csv=require(_0xcbe1('0x6'));var ejs=require(_0xcbe1('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcbe1('0x8'));var crypto=require(_0xcbe1('0x9'));var jsforce=require(_0xcbe1('0xa'));var deskjs=require(_0xcbe1('0xb'));var toCsv=require(_0xcbe1('0x6'));var querystring=require(_0xcbe1('0xc'));var Papa=require(_0xcbe1('0xd'));var Redis=require(_0xcbe1('0xe'));var authService=require(_0xcbe1('0xf'));var qs=require(_0xcbe1('0x10'));var as=require(_0xcbe1('0x11'));var hardwareService=require(_0xcbe1('0x12'));var logger=require(_0xcbe1('0x13'))(_0xcbe1('0x14'));var utils=require(_0xcbe1('0x15'));var config=require(_0xcbe1('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcbe1('0x17')];function respondWithStatusCode(_0x3f43c,_0x57dbb3){_0x57dbb3=_0x57dbb3||0xcc;return function(_0x141a16){if(_0x141a16){return _0x3f43c[_0xcbe1('0x18')](_0x57dbb3);}return _0x3f43c[_0xcbe1('0x19')](_0x57dbb3)[_0xcbe1('0x1a')]();};}function respondWithResult(_0x5d9527,_0x3a1850){_0x3a1850=_0x3a1850||0xc8;return function(_0x1904f4){if(_0x1904f4){return _0x5d9527[_0xcbe1('0x19')](_0x3a1850)[_0xcbe1('0x1b')](_0x1904f4);}};}function respondWithFilteredResult(_0xb635e2,_0x196c20){return function(_0x248bb3){if(_0x248bb3){var _0x30a635=_0x248bb3[_0xcbe1('0x1c')],_0x23865f=_0x196c20[_0xcbe1('0x1d')],_0x43507d=_0x196c20[_0xcbe1('0x1d')]+_0x196c20[_0xcbe1('0x1e')],_0x209fbf;if(_0x43507d>=_0x30a635){_0x43507d=_0x30a635;_0x209fbf=0xc8;}else{_0x209fbf=0xce;}_0xb635e2[_0xcbe1('0x19')](_0x209fbf);return _0xb635e2[_0xcbe1('0x1f')]('Content-Range',_0x23865f+'-'+_0x43507d+'/'+_0x30a635)[_0xcbe1('0x1b')](_0x248bb3);}return null;};}function patchUpdates(_0x5e80b7){return function(_0x239c52){try{jsonpatch[_0xcbe1('0x20')](_0x239c52,_0x5e80b7,!![]);}catch(_0x14215c){return BPromise[_0xcbe1('0x21')](_0x14215c);}return _0x239c52[_0xcbe1('0x22')]();};}function saveUpdates(_0x4ec9c2,_0x2164b3){return function(_0x4dd459){if(_0x4dd459){return _0x4dd459[_0xcbe1('0x23')](_0x4ec9c2)[_0xcbe1('0x24')](function(_0x1def65){return _0x1def65;});}return null;};}function removeEntity(_0x536cd5,_0x156ad9){return function(_0x55c360){if(_0x55c360){return _0x55c360['destroy']()[_0xcbe1('0x24')](function(){var _0x1e86a3=_0x55c360[_0xcbe1('0x25')]({'plain':!![]});var _0x1a2f76=_0xcbe1('0x26');return db[_0xcbe1('0x27')][_0xcbe1('0x28')]({'where':{'type':_0x1a2f76,'resourceId':_0x1e86a3['id']}})['then'](function(){return _0x55c360;});})[_0xcbe1('0x24')](function(){_0x536cd5[_0xcbe1('0x19')](0xcc)[_0xcbe1('0x1a')]();});}};}function handleEntityNotFound(_0x174041,_0x59e2c2){return function(_0x5e8e25){if(!_0x5e8e25){_0x174041[_0xcbe1('0x18')](0x194);}return _0x5e8e25;};}function handleError(_0x3566b1,_0x32ff40){_0x32ff40=_0x32ff40||0x1f4;return function(_0xead163){logger[_0xcbe1('0x29')](_0xead163[_0xcbe1('0x2a')]);if(_0xead163[_0xcbe1('0x2b')]){delete _0xead163['name'];}_0x3566b1[_0xcbe1('0x19')](_0x32ff40)[_0xcbe1('0x2c')](_0xead163);};}exports[_0xcbe1('0x2d')]=function(_0xf6eb2d,_0x5f14f8){var _0x47ae2e={},_0x941cd7={},_0xe5b8e1={'count':0x0,'rows':[]};var _0x174a01=_['map'](db[_0xcbe1('0x2e')]['rawAttributes'],function(_0x59c7db){return{'name':_0x59c7db[_0xcbe1('0x2f')],'type':_0x59c7db[_0xcbe1('0x30')]['key']};});_0x941cd7[_0xcbe1('0x31')]=_[_0xcbe1('0x32')](_0x174a01,'name');_0x941cd7[_0xcbe1('0x33')]=_[_0xcbe1('0x34')](_0xf6eb2d[_0xcbe1('0x33')]);_0x941cd7[_0xcbe1('0x35')]=_[_0xcbe1('0x36')](_0x941cd7[_0xcbe1('0x31')],_0x941cd7[_0xcbe1('0x33')]);_0x47ae2e[_0xcbe1('0x37')]=_[_0xcbe1('0x36')](_0x941cd7[_0xcbe1('0x31')],qs[_0xcbe1('0x38')](_0xf6eb2d[_0xcbe1('0x33')][_0xcbe1('0x38')]));_0x47ae2e[_0xcbe1('0x37')]=_0x47ae2e[_0xcbe1('0x37')][_0xcbe1('0x39')]?_0x47ae2e[_0xcbe1('0x37')]:_0x941cd7[_0xcbe1('0x31')];if(!_0xf6eb2d[_0xcbe1('0x33')][_0xcbe1('0x3a')](_0xcbe1('0x3b'))){_0x47ae2e[_0xcbe1('0x1e')]=qs[_0xcbe1('0x1e')](_0xf6eb2d['query'][_0xcbe1('0x1e')]);_0x47ae2e[_0xcbe1('0x1d')]=qs['offset'](_0xf6eb2d[_0xcbe1('0x33')][_0xcbe1('0x1d')]);}_0x47ae2e[_0xcbe1('0x3c')]=qs[_0xcbe1('0x3d')](_0xf6eb2d['query'][_0xcbe1('0x3d')]);_0x47ae2e[_0xcbe1('0x3e')]=qs[_0xcbe1('0x35')](_[_0xcbe1('0x3f')](_0xf6eb2d[_0xcbe1('0x33')],_0x941cd7['filters']),_0x174a01);if(_0xf6eb2d[_0xcbe1('0x33')][_0xcbe1('0x40')]){_0x47ae2e[_0xcbe1('0x3e')]=_[_0xcbe1('0x41')](_0x47ae2e[_0xcbe1('0x3e')],{'$or':_['map'](_0x174a01,function(_0xb01e44){if(_0xb01e44[_0xcbe1('0x30')]!=='VIRTUAL'){var _0x5e7e2a={};_0x5e7e2a[_0xb01e44[_0xcbe1('0x2b')]]={'$like':'%'+_0xf6eb2d[_0xcbe1('0x33')][_0xcbe1('0x40')]+'%'};return _0x5e7e2a;}})});}_0x47ae2e=_['merge']({},_0x47ae2e,_0xf6eb2d[_0xcbe1('0x42')]);var _0x318338={'where':_0x47ae2e[_0xcbe1('0x3e')]};return db[_0xcbe1('0x2e')]['count'](_0x318338)[_0xcbe1('0x24')](function(_0x41fd55){_0xe5b8e1[_0xcbe1('0x1c')]=_0x41fd55;if(_0xf6eb2d[_0xcbe1('0x33')][_0xcbe1('0x43')]){_0x47ae2e[_0xcbe1('0x44')]=[{'all':!![]}];}return db[_0xcbe1('0x2e')][_0xcbe1('0x45')](_0x47ae2e);})['then'](function(_0x340d03){_0xe5b8e1[_0xcbe1('0x46')]=_0x340d03;return _0xe5b8e1;})[_0xcbe1('0x24')](respondWithFilteredResult(_0x5f14f8,_0x47ae2e))[_0xcbe1('0x47')](handleError(_0x5f14f8,null));};exports[_0xcbe1('0x48')]=function(_0x1f3182,_0x5783c9){var _0x40d2ec={'raw':!![],'where':{'id':_0x1f3182[_0xcbe1('0x49')]['id']}},_0x719169={};_0x719169[_0xcbe1('0x31')]=_[_0xcbe1('0x34')](db['AnalyticDefaultReport'][_0xcbe1('0x4a')]);_0x719169[_0xcbe1('0x33')]=_[_0xcbe1('0x34')](_0x1f3182[_0xcbe1('0x33')]);_0x719169[_0xcbe1('0x35')]=_[_0xcbe1('0x36')](_0x719169['model'],_0x719169[_0xcbe1('0x33')]);_0x40d2ec[_0xcbe1('0x37')]=_['intersection'](_0x719169[_0xcbe1('0x31')],qs['fields'](_0x1f3182[_0xcbe1('0x33')][_0xcbe1('0x38')]));_0x40d2ec[_0xcbe1('0x37')]=_0x40d2ec[_0xcbe1('0x37')][_0xcbe1('0x39')]?_0x40d2ec[_0xcbe1('0x37')]:_0x719169[_0xcbe1('0x31')];if(_0x1f3182[_0xcbe1('0x33')][_0xcbe1('0x43')]){_0x40d2ec['include']=[{'all':!![]}];}_0x40d2ec=_[_0xcbe1('0x41')]({},_0x40d2ec,_0x1f3182[_0xcbe1('0x42')]);return db['AnalyticDefaultReport'][_0xcbe1('0x4b')](_0x40d2ec)[_0xcbe1('0x24')](handleEntityNotFound(_0x5783c9,null))[_0xcbe1('0x24')](respondWithResult(_0x5783c9,null))[_0xcbe1('0x47')](handleError(_0x5783c9,null));};exports['create']=function(_0x4a629a,_0x3b1f25){return db[_0xcbe1('0x2e')][_0xcbe1('0x4c')](_0x4a629a[_0xcbe1('0x4d')],{})['then'](function(_0x286123){var _0x4add37=_0x4a629a[_0xcbe1('0x4e')][_0xcbe1('0x25')]({'plain':!![]});if(!_0x4add37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4add37[_0xcbe1('0x4f')]===_0xcbe1('0x4e')){var _0x2378bb=_0x286123[_0xcbe1('0x25')]({'plain':!![]});var _0x256514=_0xcbe1('0x50');return db[_0xcbe1('0x51')][_0xcbe1('0x4b')]({'where':{'name':_0x256514,'userProfileId':_0x4add37['userProfileId']},'raw':!![]})[_0xcbe1('0x24')](function(_0x4956fc){if(_0x4956fc&&_0x4956fc[_0xcbe1('0x52')]===0x0){return db[_0xcbe1('0x27')][_0xcbe1('0x4c')]({'name':_0x2378bb['name'],'resourceId':_0x2378bb['id'],'type':_0xcbe1('0x26'),'sectionId':_0x4956fc['id']},{})[_0xcbe1('0x24')](function(){return _0x286123;});}else{return _0x286123;}})['catch'](function(_0x487c43){logger['error'](_0xcbe1('0x53'),_0x487c43);throw _0x487c43;});}return _0x286123;})['then'](respondWithResult(_0x3b1f25,0xc9))[_0xcbe1('0x47')](handleError(_0x3b1f25,null));};exports[_0xcbe1('0x23')]=function(_0x5624c9,_0x3eaca1){if(_0x5624c9['body']['id']){delete _0x5624c9['body']['id'];}return db['AnalyticDefaultReport'][_0xcbe1('0x4b')]({'where':{'id':_0x5624c9[_0xcbe1('0x49')]['id']}})['then'](handleEntityNotFound(_0x3eaca1,null))[_0xcbe1('0x24')](saveUpdates(_0x5624c9[_0xcbe1('0x4d')],null))['then'](respondWithResult(_0x3eaca1,null))[_0xcbe1('0x47')](handleError(_0x3eaca1,null));};exports[_0xcbe1('0x28')]=function(_0x40f29c,_0x4728be){return db['AnalyticDefaultReport'][_0xcbe1('0x4b')]({'where':{'id':_0x40f29c[_0xcbe1('0x49')]['id']}})[_0xcbe1('0x24')](handleEntityNotFound(_0x4728be,null))[_0xcbe1('0x24')](removeEntity(_0x4728be,null))[_0xcbe1('0x47')](handleError(_0x4728be,null));};exports['preview']=function(_0x58f82a,_0x1ca589){var _0x1ffe0b=0xa;var _0x546332=[_0xcbe1('0x54'),_0xcbe1('0x55'),'right_join',_0xcbe1('0x56')];var _0x434357={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcbe1('0x57'),'MAX':_0xcbe1('0x58'),'MIN':_0xcbe1('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcbe1('0x5a')};var _0x18d348={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xcbe1('0x5b'),'ROUND':_0xcbe1('0x5c'),'UNIX_TIMESTAMP':_0xcbe1('0x5d')};var _0x4ee305=function(_0x3bfca2){return!_[_0xcbe1('0x5e')](['IS\x20NULL',_0xcbe1('0x5f'),_0xcbe1('0x60'),'IS\x20NOT\x20EMPTY'],_0x3bfca2);};var _0x407c00=function(_0x4ff41b){if(!_0x4ff41b||!_0x4ff41b[_0xcbe1('0x61')][_0xcbe1('0x39')]){return'';}for(var _0x38c20b='(',_0x1ab79a=0x0;_0x1ab79a<_0x4ff41b[_0xcbe1('0x61')][_0xcbe1('0x39')];_0x1ab79a+=0x1){_0x1ab79a>0x0&&(_0x38c20b+='\x20'+_0x4ff41b['operator']+'\x20');_0x38c20b+=_0x4ff41b[_0xcbe1('0x61')][_0x1ab79a][_0xcbe1('0x62')]?_0x407c00(_0x4ff41b[_0xcbe1('0x61')][_0x1ab79a]['group']):_0x4ff41b[_0xcbe1('0x61')][_0x1ab79a]['field']+'\x20'+_0x4ff41b[_0xcbe1('0x61')][_0x1ab79a][_0xcbe1('0x63')]+(_0x4ee305(_0x4ff41b[_0xcbe1('0x61')][_0x1ab79a][_0xcbe1('0x63')])?'\x20'+_0x4ff41b['rules'][_0x1ab79a][_0xcbe1('0x64')]:'');}return _0x38c20b+')';};var _0x17dabb={'where':{'id':_0x58f82a[_0xcbe1('0x49')]['id']}},_0x54fe4f,_0x2a0ef1,_0x1460ab,_0x20b28e,_0x2392d6;_0x17dabb=_['merge']({},_0x17dabb,_0x58f82a['options']);return db[_0xcbe1('0x2e')]['find'](_0x17dabb)[_0xcbe1('0x24')](function(_0x5042dd){if(_0x5042dd){_0x54fe4f=_0x5042dd;return _0x5042dd[_0xcbe1('0x65')]();}return null;})[_0xcbe1('0x24')](function(_0x343859){if(_0x343859){if(!_0x343859['length']){throw new db[(_0xcbe1('0x66'))][(_0xcbe1('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2a0ef1=_0x343859;return db[_0xcbe1('0x68')][_0xcbe1('0x45')]({'raw':!![]});}return null;})['then'](function(_0x3d07b9){if(_0x3d07b9){_0x1460ab=_['keyBy'](_0x3d07b9,'id');var _0x35193d;var _0x5ed63b=squel['select']();_0x5ed63b[_0xcbe1('0x69')](_0x54fe4f[_0xcbe1('0x6a')]);for(var _0x3f5166=0x0;_0x3f5166<_0x2a0ef1[_0xcbe1('0x39')];_0x3f5166+=0x1){_0x35193d=_0x2a0ef1[_0x3f5166]['MetricId']?_0x1460ab[_0x2a0ef1[_0x3f5166][_0xcbe1('0x6b')]][_0xcbe1('0x6c')]:_0x2a0ef1[_0x3f5166][_0xcbe1('0x6d')];_0x35193d=_0x2a0ef1[_0x3f5166][_0xcbe1('0x6e')]?_[_0xcbe1('0x6f')](_0x434357[_0x2a0ef1[_0x3f5166]['function']],'%s',_0x35193d):_0x35193d;_0x35193d=_0x2a0ef1[_0x3f5166]['format']?_[_0xcbe1('0x6f')](_0x18d348[_0x2a0ef1[_0x3f5166][_0xcbe1('0x70')]],'%s',_0x35193d):_0x35193d;if(_0x2a0ef1[_0x3f5166]['groupBy']){_0x5ed63b[_0xcbe1('0x62')](_0x35193d);}_0x2a0ef1[_0x3f5166][_0xcbe1('0x71')]&&_0x5ed63b[_0xcbe1('0x3c')](_0x35193d,_0x2a0ef1[_0x3f5166][_0xcbe1('0x71')]===_0xcbe1('0x72')?![]:!![]);_0x5ed63b[_0xcbe1('0x6d')](_0x35193d,_0x2a0ef1[_0x3f5166][_0xcbe1('0x73')]||_0x35193d);}if(_0x54fe4f[_0xcbe1('0x74')]){_0x54fe4f[_0xcbe1('0x74')]=JSON['parse'](_0x54fe4f['joins']);for(var _0x4bcbb5=0x0;_0x4bcbb5<_0x54fe4f['joins'][_0xcbe1('0x39')];_0x4bcbb5+=0x1){if(_0x54fe4f['joins'][_0x4bcbb5][_0xcbe1('0x30')]&&_['includes'](_0x546332,_0x54fe4f[_0xcbe1('0x74')][_0x4bcbb5]['type'])&&_0x54fe4f[_0xcbe1('0x74')][_0x4bcbb5][_0xcbe1('0x75')]&&_0x54fe4f[_0xcbe1('0x74')][_0x4bcbb5][_0xcbe1('0x76')]&&_0x54fe4f[_0xcbe1('0x74')][_0x4bcbb5]['foreignKey']){_0x5ed63b[_0x54fe4f[_0xcbe1('0x74')][_0x4bcbb5]['type']](_0x54fe4f[_0xcbe1('0x74')][_0x4bcbb5]['foreignTable'],null,util[_0xcbe1('0x70')]('%s.%s\x20=\x20%s.%s',_0x54fe4f[_0xcbe1('0x6a')],_0x54fe4f[_0xcbe1('0x74')][_0x4bcbb5]['parentKey'],_0x54fe4f[_0xcbe1('0x74')][_0x4bcbb5][_0xcbe1('0x76')],_0x54fe4f['joins'][_0x4bcbb5]['foreignKey']));}}}if(_0x54fe4f[_0xcbe1('0x77')]){_0x54fe4f[_0xcbe1('0x77')]=JSON[_0xcbe1('0x78')](_0x54fe4f[_0xcbe1('0x77')]);_0x5ed63b['where'](_0x407c00(_0x54fe4f[_0xcbe1('0x77')][_0xcbe1('0x62')]));}_0x2392d6=_0x5ed63b['clone']();_0x5ed63b[_0xcbe1('0x1e')](_0x1ffe0b);_0x5ed63b[_0xcbe1('0x1d')](0x0);logger[_0xcbe1('0x79')](_0xcbe1('0x7a'),_0x5ed63b[_0xcbe1('0x7b')]());return db[_0xcbe1('0x7c')][_0xcbe1('0x33')](_0x5ed63b[_0xcbe1('0x7b')](),{'type':db[_0xcbe1('0x7c')]['QueryTypes'][_0xcbe1('0x7d')]});}})[_0xcbe1('0x24')](respondWithResult(_0x1ca589,null))[_0xcbe1('0x47')](handleError(_0x1ca589,null));};function runReport(_0x47d9ea,_0x320191,_0x3499ae){var _0x118738=_0x320191[_0xcbe1('0x2b')];var _0x55d644=0xa;var _0xb2963=['join',_0xcbe1('0x55'),_0xcbe1('0x7e'),_0xcbe1('0x56')];var _0x3132b2={'SUM':_0xcbe1('0x7f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcbe1('0x57'),'MAX':_0xcbe1('0x58'),'MIN':'MIN(%s)','AVG':_0xcbe1('0x80'),'GROUP_CONCAT':_0xcbe1('0x81'),'GROUP_CONCAT ASC':_0xcbe1('0x82'),'GROUP_CONCAT DESC':_0xcbe1('0x5a')};var _0x574965={'SEC_TO_TIME':_0xcbe1('0x83'),'DATE':_0xcbe1('0x84'),'HOUR':'HOUR(%s)','ROUND':_0xcbe1('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2e6133=function(_0x421776){return!_[_0xcbe1('0x5e')]([_0xcbe1('0x85'),_0xcbe1('0x5f'),'IS\x20EMPTY',_0xcbe1('0x86')],_0x421776);};var _0x18bd3a=function(_0x30f863){if(!_0x30f863||!_0x30f863[_0xcbe1('0x61')][_0xcbe1('0x39')]){return'';}for(var _0x240ea2='(',_0x251a32=0x0;_0x251a32<_0x30f863[_0xcbe1('0x61')]['length'];_0x251a32+=0x1){_0x251a32>0x0&&(_0x240ea2+='\x20'+_0x30f863[_0xcbe1('0x87')]+'\x20');_0x240ea2+=_0x30f863[_0xcbe1('0x61')][_0x251a32]['group']?_0x18bd3a(_0x30f863['rules'][_0x251a32]['group']):_0x30f863[_0xcbe1('0x61')][_0x251a32]['field']+'\x20'+_0x30f863[_0xcbe1('0x61')][_0x251a32][_0xcbe1('0x63')]+(_0x2e6133(_0x30f863['rules'][_0x251a32][_0xcbe1('0x63')])?'\x20'+_0x30f863[_0xcbe1('0x61')][_0x251a32][_0xcbe1('0x64')]:'');}return _0x240ea2+')';};var _0x1b5166={'where':{'id':_0x47d9ea['id']}},_0x6ff086,_0x10cfe3,_0x57dc9f,_0xfd38ff,_0x163dce;_0x1b5166=_[_0xcbe1('0x41')]({},_0x1b5166,_0x3499ae);return db['AnalyticDefaultReport'][_0xcbe1('0x4b')](_0x1b5166)['then'](function(_0xed0178){if(_0xed0178){_0x6ff086=_0xed0178;return _0xed0178[_0xcbe1('0x65')]();}return null;})[_0xcbe1('0x24')](function(_0x36171a){if(_0x36171a){if(!_0x36171a[_0xcbe1('0x39')]){throw new db[(_0xcbe1('0x66'))][(_0xcbe1('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10cfe3=_0x36171a;return db[_0xcbe1('0x68')]['findAll']({'raw':!![]});}return null;})[_0xcbe1('0x24')](function(_0x381748){if(_0x381748){_0x57dc9f=_[_0xcbe1('0x88')](_0x381748,'id');var _0x42caf4;var _0x23b7c3=squel[_0xcbe1('0x89')]();_0x23b7c3[_0xcbe1('0x69')](_0x6ff086[_0xcbe1('0x6a')]);for(var _0x444a0a=0x0;_0x444a0a<_0x10cfe3['length'];_0x444a0a+=0x1){_0x42caf4=_0x10cfe3[_0x444a0a][_0xcbe1('0x6b')]?_0x57dc9f[_0x10cfe3[_0x444a0a]['MetricId']][_0xcbe1('0x6c')]:_0x10cfe3[_0x444a0a][_0xcbe1('0x6d')];_0x42caf4=_0x10cfe3[_0x444a0a][_0xcbe1('0x6e')]?_[_0xcbe1('0x6f')](_0x3132b2[_0x10cfe3[_0x444a0a]['function']],'%s',_0x42caf4):_0x42caf4;_0x42caf4=_0x10cfe3[_0x444a0a][_0xcbe1('0x70')]?_['replace'](_0x574965[_0x10cfe3[_0x444a0a]['format']],'%s',_0x42caf4):_0x42caf4;if(_0x10cfe3[_0x444a0a][_0xcbe1('0x8a')]){_0x23b7c3[_0xcbe1('0x62')](_0x42caf4);}_0x10cfe3[_0x444a0a][_0xcbe1('0x71')]&&_0x23b7c3[_0xcbe1('0x3c')](_0x42caf4,_0x10cfe3[_0x444a0a][_0xcbe1('0x71')]==='DESC'?![]:!![]);_0x23b7c3[_0xcbe1('0x6d')](_0x42caf4,_0x10cfe3[_0x444a0a]['alias']||_0x42caf4);}if(_0x6ff086[_0xcbe1('0x74')]){_0x6ff086[_0xcbe1('0x74')]=JSON[_0xcbe1('0x78')](_0x6ff086[_0xcbe1('0x74')]);for(var _0x4c518e=0x0;_0x4c518e<_0x6ff086[_0xcbe1('0x74')][_0xcbe1('0x39')];_0x4c518e+=0x1){if(_0x6ff086[_0xcbe1('0x74')][_0x4c518e][_0xcbe1('0x30')]&&_[_0xcbe1('0x5e')](_0xb2963,_0x6ff086[_0xcbe1('0x74')][_0x4c518e]['type'])&&_0x6ff086[_0xcbe1('0x74')][_0x4c518e][_0xcbe1('0x75')]&&_0x6ff086['joins'][_0x4c518e][_0xcbe1('0x76')]&&_0x6ff086[_0xcbe1('0x74')][_0x4c518e][_0xcbe1('0x8b')]){_0x23b7c3[_0x6ff086[_0xcbe1('0x74')][_0x4c518e][_0xcbe1('0x30')]](_0x6ff086['joins'][_0x4c518e]['foreignTable'],null,util[_0xcbe1('0x70')]('%s.%s\x20=\x20%s.%s',_0x6ff086[_0xcbe1('0x6a')],_0x6ff086['joins'][_0x4c518e][_0xcbe1('0x75')],_0x6ff086[_0xcbe1('0x74')][_0x4c518e][_0xcbe1('0x76')],_0x6ff086[_0xcbe1('0x74')][_0x4c518e][_0xcbe1('0x8b')]));}}}if(_0x6ff086['conditions']){_0x6ff086[_0xcbe1('0x77')]=JSON[_0xcbe1('0x78')](_0x6ff086[_0xcbe1('0x77')]);_0x23b7c3[_0xcbe1('0x3e')](_0x18bd3a(_0x6ff086[_0xcbe1('0x77')][_0xcbe1('0x62')]));}_0x163dce=_0x23b7c3[_0xcbe1('0x8c')]();_0x23b7c3[_0xcbe1('0x1e')](_0x55d644);_0x23b7c3['offset'](0x0);logger[_0xcbe1('0x79')](_0xcbe1('0x7a'),_0x23b7c3[_0xcbe1('0x7b')]());return db[_0xcbe1('0x7c')][_0xcbe1('0x33')](_0x23b7c3[_0xcbe1('0x7b')](),{'type':db['sequelize'][_0xcbe1('0x8d')][_0xcbe1('0x7d')]});}})['then'](function(_0x2b31f6){if(!_0x2b31f6[_0xcbe1('0x39')]){throw new db[(_0xcbe1('0x66'))]['ValidationErrorItem']('No\x20available\x20data',0xcc);}if(_0x320191[_0xcbe1('0x8e')]===_0xcbe1('0x8f')){return null;}var _0x48cb16=_[_0xcbe1('0x41')](_0x320191,{'name':_0x320191['fullPath']||_0x320191[_0xcbe1('0x2b')]||_0x6ff086[_0xcbe1('0x2b')],'basename':_0x118738,'savename':util[_0xcbe1('0x70')]('%s-%s.%s',_0x320191[_0xcbe1('0x2b')]||_0x6ff086['name'],require(_0xcbe1('0x90'))[_0xcbe1('0x91')](0x4),_0x320191[_0xcbe1('0x8e')]||_0xcbe1('0x92')),'reportId':_0x6ff086['id'],'reportType':_0xcbe1('0x93')});return db[_0xcbe1('0x94')][_0xcbe1('0x4c')](_0x48cb16,{'raw':!![]});})['then'](function(_0x1088d2){if(_0x6ff086[_0xcbe1('0x6a')]===_0xcbe1('0x95')){_0x163dce[_0xcbe1('0x3e')](_0x6ff086[_0xcbe1('0x6a')]+_0xcbe1('0x96'),_0x320191[_0xcbe1('0x97')],_0x320191[_0xcbe1('0x98')]);}else{_0x163dce[_0xcbe1('0x3e')](_0x6ff086[_0xcbe1('0x6a')]+_0xcbe1('0x99'),_0x320191['startDate'],_0x320191[_0xcbe1('0x98')]);}if(_0x1088d2){logger[_0xcbe1('0x9a')](_0xcbe1('0x9b'),_0x163dce[_0xcbe1('0x7b')]());require(_0xcbe1('0x9c'))[_0xcbe1('0x9d')](path['join'](__dirname,'../../components/export/',_0x1088d2['output']),[_0x1088d2['id'],_0x163dce[_0xcbe1('0x7b')](),path[_0xcbe1('0x54')](__dirname,_0xcbe1('0x9e'),_0x1088d2[_0xcbe1('0x9f')]),_0x118738]);return _0x1088d2;}else{var _0x526ce9=squel[_0xcbe1('0x89')]();_0x526ce9[_0xcbe1('0x69')]('('+_0x163dce[_0xcbe1('0x7b')]()+')',_0xcbe1('0xa0'));_0x526ce9[_0xcbe1('0x6d')](_0xcbe1('0xa1'),_0xcbe1('0x1c'));_0x163dce[_0xcbe1('0x1e')](_0x320191[_0xcbe1('0x1e')]||_0x55d644);_0x163dce['offset'](_0x320191['offset']||0x0);return dbH[_0xcbe1('0x7c')][_0xcbe1('0x33')](_0x526ce9[_0xcbe1('0x7b')](),{'type':dbH[_0xcbe1('0x7c')]['QueryTypes'][_0xcbe1('0x7d')]})[_0xcbe1('0x24')](function(_0x46b778){if(!_0x46b778[_0xcbe1('0x39')]){_0xfd38ff=0x0;}else{_0xfd38ff=_0x46b778[0x0]['count']||0x0;}return dbH['sequelize'][_0xcbe1('0x33')](_0x163dce[_0xcbe1('0x7b')](),{'type':dbH[_0xcbe1('0x7c')][_0xcbe1('0x8d')][_0xcbe1('0x7d')]});})[_0xcbe1('0x24')](function(_0x3ff35b){return{'rows':_0x3ff35b||[],'count':_0xfd38ff};});}});}exports['run']=function(_0x5e2620,_0x96febb){return runReport(_0x5e2620[_0xcbe1('0x49')],_0x5e2620[_0xcbe1('0x33')],_0x5e2620[_0xcbe1('0x42')])[_0xcbe1('0x24')](respondWithResult(_0x96febb,null))['catch'](handleError(_0x96febb,null));};exports[_0xcbe1('0xa2')]=runReport;exports['query']=function(_0x2c6eea,_0x33c94f){var _0x259571=0xa;var _0x99c95c=[_0xcbe1('0x54'),_0xcbe1('0x55'),_0xcbe1('0x7e'),_0xcbe1('0x56')];var _0x2bebce={'SUM':_0xcbe1('0x7f'),'COUNT':_0xcbe1('0xa3'),'COUNT DISTINCT':_0xcbe1('0x57'),'MAX':_0xcbe1('0x58'),'MIN':_0xcbe1('0x59'),'AVG':_0xcbe1('0x80'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xcbe1('0x82'),'GROUP_CONCAT DESC':_0xcbe1('0x5a')};var _0x5e4592={'SEC_TO_TIME':_0xcbe1('0x83'),'DATE':'DATE(%s)','HOUR':_0xcbe1('0x5b'),'ROUND':_0xcbe1('0x5c'),'UNIX_TIMESTAMP':_0xcbe1('0x5d')};var _0x384e9f=function(_0x2071f2){return!_['includes']([_0xcbe1('0x85'),_0xcbe1('0x5f'),_0xcbe1('0x60'),_0xcbe1('0x86')],_0x2071f2);};var _0x141516=function(_0x3453d7){if(!_0x3453d7||!_0x3453d7[_0xcbe1('0x61')][_0xcbe1('0x39')]){return'';}for(var _0x2e2704='(',_0x1ddf32=0x0;_0x1ddf32<_0x3453d7['rules'][_0xcbe1('0x39')];_0x1ddf32+=0x1){_0x1ddf32>0x0&&(_0x2e2704+='\x20'+_0x3453d7['operator']+'\x20');_0x2e2704+=_0x3453d7[_0xcbe1('0x61')][_0x1ddf32][_0xcbe1('0x62')]?_0x141516(_0x3453d7['rules'][_0x1ddf32][_0xcbe1('0x62')]):_0x3453d7[_0xcbe1('0x61')][_0x1ddf32]['field']+'\x20'+_0x3453d7['rules'][_0x1ddf32]['condition']+(_0x384e9f(_0x3453d7['rules'][_0x1ddf32]['condition'])?'\x20'+_0x3453d7[_0xcbe1('0x61')][_0x1ddf32]['value']:'');}return _0x2e2704+')';};var _0x4d914a={'where':{'id':_0x2c6eea[_0xcbe1('0x49')]['id']}},_0x58b555,_0x1b79b6,_0x543cc7,_0x436a2e,_0x4c7682;_0x4d914a=_['merge']({},_0x4d914a,_0x2c6eea[_0xcbe1('0x42')]);return db['AnalyticDefaultReport']['find'](_0x4d914a)[_0xcbe1('0x24')](function(_0x4aaba9){if(_0x4aaba9){_0x58b555=_0x4aaba9;return _0x4aaba9[_0xcbe1('0x65')]();}return null;})[_0xcbe1('0x24')](function(_0x21aad0){if(_0x21aad0){if(!_0x21aad0[_0xcbe1('0x39')]){throw new db[(_0xcbe1('0x66'))][(_0xcbe1('0x67'))](_0xcbe1('0xa4'),0x193);}_0x1b79b6=_0x21aad0;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xcbe1('0x24')](function(_0x1932f2){if(_0x1932f2){_0x543cc7=_[_0xcbe1('0x88')](_0x1932f2,'id');var _0x3ceabe;var _0x465b2b=squel[_0xcbe1('0x89')]();_0x465b2b[_0xcbe1('0x69')](_0x58b555[_0xcbe1('0x6a')]);for(var _0x32df23=0x0;_0x32df23<_0x1b79b6[_0xcbe1('0x39')];_0x32df23+=0x1){_0x3ceabe=_0x1b79b6[_0x32df23][_0xcbe1('0x6b')]?_0x543cc7[_0x1b79b6[_0x32df23][_0xcbe1('0x6b')]]['metric']:_0x1b79b6[_0x32df23][_0xcbe1('0x6d')];_0x3ceabe=_0x1b79b6[_0x32df23][_0xcbe1('0x6e')]?_[_0xcbe1('0x6f')](_0x2bebce[_0x1b79b6[_0x32df23]['function']],'%s',_0x3ceabe):_0x3ceabe;_0x3ceabe=_0x1b79b6[_0x32df23][_0xcbe1('0x70')]?_[_0xcbe1('0x6f')](_0x5e4592[_0x1b79b6[_0x32df23][_0xcbe1('0x70')]],'%s',_0x3ceabe):_0x3ceabe;if(_0x1b79b6[_0x32df23][_0xcbe1('0x8a')]){_0x465b2b[_0xcbe1('0x62')](_0x3ceabe);}_0x1b79b6[_0x32df23][_0xcbe1('0x71')]&&_0x465b2b[_0xcbe1('0x3c')](_0x3ceabe,_0x1b79b6[_0x32df23][_0xcbe1('0x71')]==='DESC'?![]:!![]);_0x465b2b[_0xcbe1('0x6d')](_0x3ceabe,_0x1b79b6[_0x32df23]['alias']||_0x3ceabe);}if(_0x58b555[_0xcbe1('0x74')]){_0x58b555[_0xcbe1('0x74')]=JSON[_0xcbe1('0x78')](_0x58b555['joins']);for(var _0xf124a9=0x0;_0xf124a9<_0x58b555[_0xcbe1('0x74')][_0xcbe1('0x39')];_0xf124a9+=0x1){if(_0x58b555[_0xcbe1('0x74')][_0xf124a9][_0xcbe1('0x30')]&&_[_0xcbe1('0x5e')](_0x99c95c,_0x58b555['joins'][_0xf124a9][_0xcbe1('0x30')])&&_0x58b555[_0xcbe1('0x74')][_0xf124a9][_0xcbe1('0x75')]&&_0x58b555[_0xcbe1('0x74')][_0xf124a9]['foreignTable']&&_0x58b555[_0xcbe1('0x74')][_0xf124a9][_0xcbe1('0x8b')]){_0x465b2b[_0x58b555['joins'][_0xf124a9][_0xcbe1('0x30')]](_0x58b555[_0xcbe1('0x74')][_0xf124a9][_0xcbe1('0x76')],null,util[_0xcbe1('0x70')]('%s.%s\x20=\x20%s.%s',_0x58b555[_0xcbe1('0x6a')],_0x58b555[_0xcbe1('0x74')][_0xf124a9][_0xcbe1('0x75')],_0x58b555[_0xcbe1('0x74')][_0xf124a9][_0xcbe1('0x76')],_0x58b555[_0xcbe1('0x74')][_0xf124a9][_0xcbe1('0x8b')]));}}}if(_0x58b555[_0xcbe1('0x77')]){_0x58b555[_0xcbe1('0x77')]=JSON['parse'](_0x58b555[_0xcbe1('0x77')]);_0x465b2b[_0xcbe1('0x3e')](_0x141516(_0x58b555[_0xcbe1('0x77')][_0xcbe1('0x62')]));}_0x4c7682=_0x465b2b['clone']();_0x465b2b[_0xcbe1('0x1e')](_0x259571);_0x465b2b[_0xcbe1('0x1d')](0x0);logger[_0xcbe1('0x79')](_0xcbe1('0x7a'),_0x465b2b[_0xcbe1('0x7b')]());return db[_0xcbe1('0x7c')][_0xcbe1('0x33')](_0x465b2b[_0xcbe1('0x7b')](),{'type':db[_0xcbe1('0x7c')][_0xcbe1('0x8d')][_0xcbe1('0x7d')]});}})['then'](function(){return{'sql':_0x4c7682[_0xcbe1('0x7b')]()};})[_0xcbe1('0x24')](respondWithResult(_0x33c94f,null))[_0xcbe1('0x47')](handleError(_0x33c94f,null));}; \ No newline at end of file +var _0x29b4=['alias','parse','joins','foreignTable','foreignKey','parentKey','conditions','clone','toString','sequelize','QueryTypes','SELECT','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','includes','Please\x20insert\x20at\x20least\x20one\x20field','from','metric','%s.%s\x20=\x20%s.%s','debug','Limited\x20Query:','Sequelize','No\x20available\x20data','web','fullPath','randomstring','output','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','COUNT(%s)','html-pdf','eml-format','rimraf','zip-dir','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','api','../../config/utils','../../mysqldb','dbH','sendStatus','status','end','json','offset','limit','set','reject','save','then','destroy','get','DefaultReports','UserProfileResource','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','role','Reports','userProfileId','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','length','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','select','table','MetricId','function','replace','format','groupBy','orderBy','DESC'];(function(_0x22a114,_0x41ce80){var _0x2420bd=function(_0x53512e){while(--_0x53512e){_0x22a114['push'](_0x22a114['shift']());}};_0x2420bd(++_0x41ce80);}(_0x29b4,0x183));var _0x429b=function(_0x3d9991,_0x5602ac){_0x3d9991=_0x3d9991-0x0;var _0x324374=_0x29b4[_0x3d9991];return _0x324374;};'use strict';var pdf=require(_0x429b('0x0'));var emlformat=require(_0x429b('0x1'));var rimraf=require(_0x429b('0x2'));var zipdir=require(_0x429b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x429b('0x4'));var moment=require(_0x429b('0x5'));var BPromise=require(_0x429b('0x6'));var Mustache=require(_0x429b('0x7'));var util=require(_0x429b('0x8'));var path=require(_0x429b('0x9'));var sox=require('sox');var csv=require(_0x429b('0xa'));var ejs=require(_0x429b('0xb'));var fs=require('fs');var _=require(_0x429b('0xc'));var squel=require(_0x429b('0xd'));var crypto=require(_0x429b('0xe'));var jsforce=require(_0x429b('0xf'));var deskjs=require(_0x429b('0x10'));var toCsv=require(_0x429b('0xa'));var querystring=require(_0x429b('0x11'));var Papa=require(_0x429b('0x12'));var Redis=require(_0x429b('0x13'));var authService=require(_0x429b('0x14'));var qs=require(_0x429b('0x15'));var as=require(_0x429b('0x16'));var hardwareService=require(_0x429b('0x17'));var logger=require(_0x429b('0x18'))(_0x429b('0x19'));var utils=require(_0x429b('0x1a'));var config=require('../../config/environment');var db=require(_0x429b('0x1b'))['db'];var dbH=require(_0x429b('0x1b'))[_0x429b('0x1c')];function respondWithStatusCode(_0x495de1,_0x694cb0){_0x694cb0=_0x694cb0||0xcc;return function(_0x14726f){if(_0x14726f){return _0x495de1[_0x429b('0x1d')](_0x694cb0);}return _0x495de1[_0x429b('0x1e')](_0x694cb0)[_0x429b('0x1f')]();};}function respondWithResult(_0x38d949,_0x1bf6af){_0x1bf6af=_0x1bf6af||0xc8;return function(_0xfc0d6f){if(_0xfc0d6f){return _0x38d949[_0x429b('0x1e')](_0x1bf6af)[_0x429b('0x20')](_0xfc0d6f);}};}function respondWithFilteredResult(_0x3c5b6e,_0x1dc827){return function(_0x28ab36){if(_0x28ab36){var _0x4bb88a=_0x28ab36['count'],_0x397cf7=_0x1dc827[_0x429b('0x21')],_0x1ff96a=_0x1dc827[_0x429b('0x21')]+_0x1dc827[_0x429b('0x22')],_0x354ff7;if(_0x1ff96a>=_0x4bb88a){_0x1ff96a=_0x4bb88a;_0x354ff7=0xc8;}else{_0x354ff7=0xce;}_0x3c5b6e['status'](_0x354ff7);return _0x3c5b6e[_0x429b('0x23')]('Content-Range',_0x397cf7+'-'+_0x1ff96a+'/'+_0x4bb88a)[_0x429b('0x20')](_0x28ab36);}return null;};}function patchUpdates(_0xdf2d5d){return function(_0x2ae0d2){try{jsonpatch['apply'](_0x2ae0d2,_0xdf2d5d,!![]);}catch(_0x449eab){return BPromise[_0x429b('0x24')](_0x449eab);}return _0x2ae0d2[_0x429b('0x25')]();};}function saveUpdates(_0x223289,_0x5d34f8){return function(_0x4890d0){if(_0x4890d0){return _0x4890d0['update'](_0x223289)[_0x429b('0x26')](function(_0x5ec7b1){return _0x5ec7b1;});}return null;};}function removeEntity(_0x51f9f4,_0x5b600a){return function(_0x4e6242){if(_0x4e6242){return _0x4e6242[_0x429b('0x27')]()[_0x429b('0x26')](function(){var _0xc1c5a2=_0x4e6242[_0x429b('0x28')]({'plain':!![]});var _0x54f4a6=_0x429b('0x29');return db[_0x429b('0x2a')][_0x429b('0x27')]({'where':{'type':_0x54f4a6,'resourceId':_0xc1c5a2['id']}})[_0x429b('0x26')](function(){return _0x4e6242;});})['then'](function(){_0x51f9f4[_0x429b('0x1e')](0xcc)[_0x429b('0x1f')]();});}};}function handleEntityNotFound(_0x2059d0,_0x582dff){return function(_0x57b7fa){if(!_0x57b7fa){_0x2059d0['sendStatus'](0x194);}return _0x57b7fa;};}function handleError(_0x4ccfed,_0x2e0230){_0x2e0230=_0x2e0230||0x1f4;return function(_0x289308){logger['error'](_0x289308[_0x429b('0x2b')]);if(_0x289308['name']){delete _0x289308[_0x429b('0x2c')];}_0x4ccfed[_0x429b('0x1e')](_0x2e0230)[_0x429b('0x2d')](_0x289308);};}exports[_0x429b('0x2e')]=function(_0x4837fa,_0x5338f4){var _0x75575c={},_0x4001b1={},_0x2c731a={'count':0x0,'rows':[]};var _0x550b5b=_[_0x429b('0x2f')](db[_0x429b('0x30')][_0x429b('0x31')],function(_0x159425){return{'name':_0x159425['fieldName'],'type':_0x159425[_0x429b('0x32')][_0x429b('0x33')]};});_0x4001b1[_0x429b('0x34')]=_[_0x429b('0x2f')](_0x550b5b,_0x429b('0x2c'));_0x4001b1[_0x429b('0x35')]=_[_0x429b('0x36')](_0x4837fa[_0x429b('0x35')]);_0x4001b1[_0x429b('0x37')]=_['intersection'](_0x4001b1[_0x429b('0x34')],_0x4001b1[_0x429b('0x35')]);_0x75575c[_0x429b('0x38')]=_[_0x429b('0x39')](_0x4001b1['model'],qs[_0x429b('0x3a')](_0x4837fa[_0x429b('0x35')][_0x429b('0x3a')]));_0x75575c[_0x429b('0x38')]=_0x75575c[_0x429b('0x38')]['length']?_0x75575c[_0x429b('0x38')]:_0x4001b1['model'];if(!_0x4837fa[_0x429b('0x35')][_0x429b('0x3b')](_0x429b('0x3c'))){_0x75575c['limit']=qs[_0x429b('0x22')](_0x4837fa[_0x429b('0x35')][_0x429b('0x22')]);_0x75575c['offset']=qs[_0x429b('0x21')](_0x4837fa[_0x429b('0x35')][_0x429b('0x21')]);}_0x75575c[_0x429b('0x3d')]=qs['sort'](_0x4837fa[_0x429b('0x35')]['sort']);_0x75575c[_0x429b('0x3e')]=qs[_0x429b('0x37')](_[_0x429b('0x3f')](_0x4837fa[_0x429b('0x35')],_0x4001b1[_0x429b('0x37')]),_0x550b5b);if(_0x4837fa['query'][_0x429b('0x40')]){_0x75575c['where']=_[_0x429b('0x41')](_0x75575c[_0x429b('0x3e')],{'$or':_[_0x429b('0x2f')](_0x550b5b,function(_0x4c9f29){if(_0x4c9f29[_0x429b('0x32')]!==_0x429b('0x42')){var _0x267cce={};_0x267cce[_0x4c9f29['name']]={'$like':'%'+_0x4837fa[_0x429b('0x35')][_0x429b('0x40')]+'%'};return _0x267cce;}})});}_0x75575c=_[_0x429b('0x41')]({},_0x75575c,_0x4837fa['options']);var _0x2ee234={'where':_0x75575c[_0x429b('0x3e')]};return db[_0x429b('0x30')]['count'](_0x2ee234)[_0x429b('0x26')](function(_0x2033b1){_0x2c731a[_0x429b('0x43')]=_0x2033b1;if(_0x4837fa['query'][_0x429b('0x44')]){_0x75575c[_0x429b('0x45')]=[{'all':!![]}];}return db[_0x429b('0x30')][_0x429b('0x46')](_0x75575c);})[_0x429b('0x26')](function(_0x4ba445){_0x2c731a[_0x429b('0x47')]=_0x4ba445;return _0x2c731a;})[_0x429b('0x26')](respondWithFilteredResult(_0x5338f4,_0x75575c))[_0x429b('0x48')](handleError(_0x5338f4,null));};exports[_0x429b('0x49')]=function(_0x48cc2e,_0x402485){var _0x155911={'raw':!![],'where':{'id':_0x48cc2e[_0x429b('0x4a')]['id']}},_0x5bec75={};_0x5bec75[_0x429b('0x34')]=_[_0x429b('0x36')](db[_0x429b('0x30')]['rawAttributes']);_0x5bec75[_0x429b('0x35')]=_['keys'](_0x48cc2e['query']);_0x5bec75[_0x429b('0x37')]=_[_0x429b('0x39')](_0x5bec75[_0x429b('0x34')],_0x5bec75[_0x429b('0x35')]);_0x155911[_0x429b('0x38')]=_[_0x429b('0x39')](_0x5bec75[_0x429b('0x34')],qs[_0x429b('0x3a')](_0x48cc2e['query'][_0x429b('0x3a')]));_0x155911[_0x429b('0x38')]=_0x155911[_0x429b('0x38')]['length']?_0x155911[_0x429b('0x38')]:_0x5bec75['model'];if(_0x48cc2e['query'][_0x429b('0x44')]){_0x155911['include']=[{'all':!![]}];}_0x155911=_[_0x429b('0x41')]({},_0x155911,_0x48cc2e[_0x429b('0x4b')]);return db[_0x429b('0x30')][_0x429b('0x4c')](_0x155911)[_0x429b('0x26')](handleEntityNotFound(_0x402485,null))['then'](respondWithResult(_0x402485,null))[_0x429b('0x48')](handleError(_0x402485,null));};exports['create']=function(_0x5676c1,_0xc9cc28){return db[_0x429b('0x30')]['create'](_0x5676c1[_0x429b('0x4d')],{})[_0x429b('0x26')](function(_0x4733f8){var _0x11355a=_0x5676c1[_0x429b('0x4e')]['get']({'plain':!![]});if(!_0x11355a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11355a[_0x429b('0x4f')]==='user'){var _0x57ce38=_0x4733f8[_0x429b('0x28')]({'plain':!![]});var _0x4e3c59=_0x429b('0x50');return db['UserProfileSection'][_0x429b('0x4c')]({'where':{'name':_0x4e3c59,'userProfileId':_0x11355a[_0x429b('0x51')]},'raw':!![]})[_0x429b('0x26')](function(_0xb09aae){if(_0xb09aae&&_0xb09aae[_0x429b('0x52')]===0x0){return db[_0x429b('0x2a')][_0x429b('0x53')]({'name':_0x57ce38[_0x429b('0x2c')],'resourceId':_0x57ce38['id'],'type':_0x429b('0x29'),'sectionId':_0xb09aae['id']},{})[_0x429b('0x26')](function(){return _0x4733f8;});}else{return _0x4733f8;}})[_0x429b('0x48')](function(_0x5e4314){logger[_0x429b('0x54')](_0x429b('0x55'),_0x5e4314);throw _0x5e4314;});}return _0x4733f8;})[_0x429b('0x26')](respondWithResult(_0xc9cc28,0xc9))[_0x429b('0x48')](handleError(_0xc9cc28,null));};exports['update']=function(_0x4f1221,_0x5d341e){if(_0x4f1221['body']['id']){delete _0x4f1221['body']['id'];}return db[_0x429b('0x30')][_0x429b('0x4c')]({'where':{'id':_0x4f1221[_0x429b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5d341e,null))[_0x429b('0x26')](saveUpdates(_0x4f1221[_0x429b('0x4d')],null))[_0x429b('0x26')](respondWithResult(_0x5d341e,null))[_0x429b('0x48')](handleError(_0x5d341e,null));};exports[_0x429b('0x27')]=function(_0x3685aa,_0x1178c5){return db[_0x429b('0x30')][_0x429b('0x4c')]({'where':{'id':_0x3685aa['params']['id']}})[_0x429b('0x26')](handleEntityNotFound(_0x1178c5,null))[_0x429b('0x26')](removeEntity(_0x1178c5,null))[_0x429b('0x48')](handleError(_0x1178c5,null));};exports[_0x429b('0x56')]=function(_0x298131,_0xe4e9ac){var _0x4d6682=0xa;var _0x1a2a9a=[_0x429b('0x57'),_0x429b('0x58'),_0x429b('0x59'),_0x429b('0x5a')];var _0x3427d5={'SUM':_0x429b('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x429b('0x5c'),'MAX':'MAX(%s)','MIN':_0x429b('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x429b('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x48c69e={'SEC_TO_TIME':_0x429b('0x5f'),'DATE':_0x429b('0x60'),'HOUR':_0x429b('0x61'),'ROUND':_0x429b('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x10cabc=function(_0x399bf0){return!_['includes']([_0x429b('0x63'),_0x429b('0x64'),_0x429b('0x65'),_0x429b('0x66')],_0x399bf0);};var _0x30ac57=function(_0x1fb5bd){if(!_0x1fb5bd||!_0x1fb5bd['rules'][_0x429b('0x67')]){return'';}for(var _0x370129='(',_0x422729=0x0;_0x422729<_0x1fb5bd[_0x429b('0x68')][_0x429b('0x67')];_0x422729+=0x1){_0x422729>0x0&&(_0x370129+='\x20'+_0x1fb5bd[_0x429b('0x69')]+'\x20');_0x370129+=_0x1fb5bd[_0x429b('0x68')][_0x422729][_0x429b('0x6a')]?_0x30ac57(_0x1fb5bd[_0x429b('0x68')][_0x422729][_0x429b('0x6a')]):_0x1fb5bd['rules'][_0x422729][_0x429b('0x6b')]+'\x20'+_0x1fb5bd[_0x429b('0x68')][_0x422729]['condition']+(_0x10cabc(_0x1fb5bd[_0x429b('0x68')][_0x422729][_0x429b('0x6c')])?'\x20'+_0x1fb5bd[_0x429b('0x68')][_0x422729][_0x429b('0x6d')]:'');}return _0x370129+')';};var _0x833eec={'where':{'id':_0x298131[_0x429b('0x4a')]['id']}},_0x14ca68,_0x453994,_0x5ec364,_0x36112f,_0xc1363a;_0x833eec=_['merge']({},_0x833eec,_0x298131['options']);return db[_0x429b('0x30')][_0x429b('0x4c')](_0x833eec)['then'](function(_0xefa0c6){if(_0xefa0c6){_0x14ca68=_0xefa0c6;return _0xefa0c6[_0x429b('0x6e')]();}return null;})['then'](function(_0x36d63a){if(_0x36d63a){if(!_0x36d63a[_0x429b('0x67')]){throw new db['Sequelize'][(_0x429b('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x453994=_0x36d63a;return db[_0x429b('0x70')][_0x429b('0x46')]({'raw':!![]});}return null;})[_0x429b('0x26')](function(_0x55ff2a){if(_0x55ff2a){_0x5ec364=_[_0x429b('0x71')](_0x55ff2a,'id');var _0x20a1e0;var _0x2628d2=squel[_0x429b('0x72')]();_0x2628d2['from'](_0x14ca68[_0x429b('0x73')]);for(var _0x52262e=0x0;_0x52262e<_0x453994[_0x429b('0x67')];_0x52262e+=0x1){_0x20a1e0=_0x453994[_0x52262e][_0x429b('0x74')]?_0x5ec364[_0x453994[_0x52262e][_0x429b('0x74')]]['metric']:_0x453994[_0x52262e]['field'];_0x20a1e0=_0x453994[_0x52262e][_0x429b('0x75')]?_[_0x429b('0x76')](_0x3427d5[_0x453994[_0x52262e][_0x429b('0x75')]],'%s',_0x20a1e0):_0x20a1e0;_0x20a1e0=_0x453994[_0x52262e][_0x429b('0x77')]?_[_0x429b('0x76')](_0x48c69e[_0x453994[_0x52262e][_0x429b('0x77')]],'%s',_0x20a1e0):_0x20a1e0;if(_0x453994[_0x52262e][_0x429b('0x78')]){_0x2628d2[_0x429b('0x6a')](_0x20a1e0);}_0x453994[_0x52262e][_0x429b('0x79')]&&_0x2628d2[_0x429b('0x3d')](_0x20a1e0,_0x453994[_0x52262e][_0x429b('0x79')]===_0x429b('0x7a')?![]:!![]);_0x2628d2[_0x429b('0x6b')](_0x20a1e0,_0x453994[_0x52262e][_0x429b('0x7b')]||_0x20a1e0);}if(_0x14ca68['joins']){_0x14ca68['joins']=JSON[_0x429b('0x7c')](_0x14ca68[_0x429b('0x7d')]);for(var _0x500bd7=0x0;_0x500bd7<_0x14ca68[_0x429b('0x7d')]['length'];_0x500bd7+=0x1){if(_0x14ca68[_0x429b('0x7d')][_0x500bd7][_0x429b('0x32')]&&_['includes'](_0x1a2a9a,_0x14ca68[_0x429b('0x7d')][_0x500bd7][_0x429b('0x32')])&&_0x14ca68[_0x429b('0x7d')][_0x500bd7]['parentKey']&&_0x14ca68[_0x429b('0x7d')][_0x500bd7][_0x429b('0x7e')]&&_0x14ca68[_0x429b('0x7d')][_0x500bd7][_0x429b('0x7f')]){_0x2628d2[_0x14ca68[_0x429b('0x7d')][_0x500bd7][_0x429b('0x32')]](_0x14ca68[_0x429b('0x7d')][_0x500bd7][_0x429b('0x7e')],null,util[_0x429b('0x77')]('%s.%s\x20=\x20%s.%s',_0x14ca68[_0x429b('0x73')],_0x14ca68[_0x429b('0x7d')][_0x500bd7][_0x429b('0x80')],_0x14ca68[_0x429b('0x7d')][_0x500bd7][_0x429b('0x7e')],_0x14ca68[_0x429b('0x7d')][_0x500bd7][_0x429b('0x7f')]));}}}if(_0x14ca68[_0x429b('0x81')]){_0x14ca68['conditions']=JSON[_0x429b('0x7c')](_0x14ca68['conditions']);_0x2628d2['where'](_0x30ac57(_0x14ca68[_0x429b('0x81')][_0x429b('0x6a')]));}_0xc1363a=_0x2628d2[_0x429b('0x82')]();_0x2628d2[_0x429b('0x22')](_0x4d6682);_0x2628d2[_0x429b('0x21')](0x0);logger['debug']('Limited\x20Query:',_0x2628d2[_0x429b('0x83')]());return db[_0x429b('0x84')][_0x429b('0x35')](_0x2628d2[_0x429b('0x83')](),{'type':db[_0x429b('0x84')][_0x429b('0x85')][_0x429b('0x86')]});}})[_0x429b('0x26')](respondWithResult(_0xe4e9ac,null))[_0x429b('0x48')](handleError(_0xe4e9ac,null));};function runReport(_0xa9edc0,_0x22a735,_0x484139){var _0x52d6ae=_0x22a735[_0x429b('0x2c')];var _0x48dc4e=0xa;var _0x1ab01a=[_0x429b('0x57'),_0x429b('0x58'),_0x429b('0x59'),'cross_join'];var _0x3ad066={'SUM':_0x429b('0x5b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x429b('0x5c'),'MAX':_0x429b('0x87'),'MIN':_0x429b('0x5d'),'AVG':_0x429b('0x88'),'GROUP_CONCAT':_0x429b('0x5e'),'GROUP_CONCAT ASC':_0x429b('0x89'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x54fcb6={'SEC_TO_TIME':_0x429b('0x5f'),'DATE':_0x429b('0x60'),'HOUR':_0x429b('0x61'),'ROUND':_0x429b('0x62'),'UNIX_TIMESTAMP':_0x429b('0x8a')};var _0x421f3c=function(_0x510fbf){return!_[_0x429b('0x8b')](['IS\x20NULL',_0x429b('0x64'),_0x429b('0x65'),_0x429b('0x66')],_0x510fbf);};var _0x30dc1a=function(_0x40d4a2){if(!_0x40d4a2||!_0x40d4a2[_0x429b('0x68')][_0x429b('0x67')]){return'';}for(var _0xd4227e='(',_0x4be542=0x0;_0x4be542<_0x40d4a2[_0x429b('0x68')][_0x429b('0x67')];_0x4be542+=0x1){_0x4be542>0x0&&(_0xd4227e+='\x20'+_0x40d4a2[_0x429b('0x69')]+'\x20');_0xd4227e+=_0x40d4a2[_0x429b('0x68')][_0x4be542][_0x429b('0x6a')]?_0x30dc1a(_0x40d4a2['rules'][_0x4be542]['group']):_0x40d4a2['rules'][_0x4be542]['field']+'\x20'+_0x40d4a2[_0x429b('0x68')][_0x4be542]['condition']+(_0x421f3c(_0x40d4a2[_0x429b('0x68')][_0x4be542][_0x429b('0x6c')])?'\x20'+_0x40d4a2[_0x429b('0x68')][_0x4be542]['value']:'');}return _0xd4227e+')';};var _0x27e050={'where':{'id':_0xa9edc0['id']}},_0x2c32de,_0x532506,_0x3971a8,_0x5bd05e,_0x57f0be;_0x27e050=_[_0x429b('0x41')]({},_0x27e050,_0x484139);return db[_0x429b('0x30')][_0x429b('0x4c')](_0x27e050)[_0x429b('0x26')](function(_0x133bf6){if(_0x133bf6){_0x2c32de=_0x133bf6;return _0x133bf6[_0x429b('0x6e')]();}return null;})[_0x429b('0x26')](function(_0x242c08){if(_0x242c08){if(!_0x242c08[_0x429b('0x67')]){throw new db['Sequelize'][(_0x429b('0x6f'))](_0x429b('0x8c'),0x193);}_0x532506=_0x242c08;return db[_0x429b('0x70')][_0x429b('0x46')]({'raw':!![]});}return null;})[_0x429b('0x26')](function(_0x56129e){if(_0x56129e){_0x3971a8=_[_0x429b('0x71')](_0x56129e,'id');var _0x172547;var _0x14df0e=squel[_0x429b('0x72')]();_0x14df0e[_0x429b('0x8d')](_0x2c32de[_0x429b('0x73')]);for(var _0x122253=0x0;_0x122253<_0x532506[_0x429b('0x67')];_0x122253+=0x1){_0x172547=_0x532506[_0x122253][_0x429b('0x74')]?_0x3971a8[_0x532506[_0x122253]['MetricId']][_0x429b('0x8e')]:_0x532506[_0x122253][_0x429b('0x6b')];_0x172547=_0x532506[_0x122253][_0x429b('0x75')]?_[_0x429b('0x76')](_0x3ad066[_0x532506[_0x122253][_0x429b('0x75')]],'%s',_0x172547):_0x172547;_0x172547=_0x532506[_0x122253]['format']?_[_0x429b('0x76')](_0x54fcb6[_0x532506[_0x122253][_0x429b('0x77')]],'%s',_0x172547):_0x172547;if(_0x532506[_0x122253][_0x429b('0x78')]){_0x14df0e[_0x429b('0x6a')](_0x172547);}_0x532506[_0x122253][_0x429b('0x79')]&&_0x14df0e[_0x429b('0x3d')](_0x172547,_0x532506[_0x122253]['orderBy']===_0x429b('0x7a')?![]:!![]);_0x14df0e[_0x429b('0x6b')](_0x172547,_0x532506[_0x122253]['alias']||_0x172547);}if(_0x2c32de[_0x429b('0x7d')]){_0x2c32de[_0x429b('0x7d')]=JSON[_0x429b('0x7c')](_0x2c32de[_0x429b('0x7d')]);for(var _0x1d76c9=0x0;_0x1d76c9<_0x2c32de['joins']['length'];_0x1d76c9+=0x1){if(_0x2c32de['joins'][_0x1d76c9][_0x429b('0x32')]&&_[_0x429b('0x8b')](_0x1ab01a,_0x2c32de[_0x429b('0x7d')][_0x1d76c9][_0x429b('0x32')])&&_0x2c32de[_0x429b('0x7d')][_0x1d76c9][_0x429b('0x80')]&&_0x2c32de[_0x429b('0x7d')][_0x1d76c9][_0x429b('0x7e')]&&_0x2c32de[_0x429b('0x7d')][_0x1d76c9][_0x429b('0x7f')]){_0x14df0e[_0x2c32de['joins'][_0x1d76c9][_0x429b('0x32')]](_0x2c32de[_0x429b('0x7d')][_0x1d76c9][_0x429b('0x7e')],null,util['format'](_0x429b('0x8f'),_0x2c32de['table'],_0x2c32de[_0x429b('0x7d')][_0x1d76c9][_0x429b('0x80')],_0x2c32de[_0x429b('0x7d')][_0x1d76c9][_0x429b('0x7e')],_0x2c32de[_0x429b('0x7d')][_0x1d76c9][_0x429b('0x7f')]));}}}if(_0x2c32de['conditions']){_0x2c32de['conditions']=JSON[_0x429b('0x7c')](_0x2c32de[_0x429b('0x81')]);_0x14df0e[_0x429b('0x3e')](_0x30dc1a(_0x2c32de[_0x429b('0x81')][_0x429b('0x6a')]));}_0x57f0be=_0x14df0e[_0x429b('0x82')]();_0x14df0e[_0x429b('0x22')](_0x48dc4e);_0x14df0e[_0x429b('0x21')](0x0);logger[_0x429b('0x90')](_0x429b('0x91'),_0x14df0e['toString']());return db['sequelize'][_0x429b('0x35')](_0x14df0e[_0x429b('0x83')](),{'type':db[_0x429b('0x84')][_0x429b('0x85')][_0x429b('0x86')]});}})['then'](function(_0x54a2ec){if(!_0x54a2ec[_0x429b('0x67')]){throw new db[(_0x429b('0x92'))][(_0x429b('0x6f'))](_0x429b('0x93'),0xcc);}if(_0x22a735['output']===_0x429b('0x94')){return null;}var _0x58aff5=_['merge'](_0x22a735,{'name':_0x22a735[_0x429b('0x95')]||_0x22a735[_0x429b('0x2c')]||_0x2c32de['name'],'basename':_0x52d6ae,'savename':util[_0x429b('0x77')]('%s-%s.%s',_0x22a735['name']||_0x2c32de[_0x429b('0x2c')],require(_0x429b('0x96'))['generate'](0x4),_0x22a735[_0x429b('0x97')]||_0x429b('0x98')),'reportId':_0x2c32de['id'],'reportType':_0x429b('0x99')});return db[_0x429b('0x9a')]['create'](_0x58aff5,{'raw':!![]});})[_0x429b('0x26')](function(_0x48e218){if(_0x2c32de[_0x429b('0x73')]===_0x429b('0x9b')){_0x57f0be[_0x429b('0x3e')](_0x2c32de[_0x429b('0x73')]+_0x429b('0x9c'),_0x22a735[_0x429b('0x9d')],_0x22a735[_0x429b('0x9e')]);}else{_0x57f0be['where'](_0x2c32de['table']+_0x429b('0x9f'),_0x22a735[_0x429b('0x9d')],_0x22a735[_0x429b('0x9e')]);}if(_0x48e218){logger[_0x429b('0xa0')](_0x429b('0xa1'),_0x57f0be[_0x429b('0x83')]());require(_0x429b('0xa2'))['fork'](path['join'](__dirname,_0x429b('0xa3'),_0x48e218[_0x429b('0x97')]),[_0x48e218['id'],_0x57f0be[_0x429b('0x83')](),path[_0x429b('0x57')](__dirname,_0x429b('0xa4'),_0x48e218[_0x429b('0xa5')]),_0x52d6ae]);return _0x48e218;}else{var _0x3cd60d=squel['select']();_0x3cd60d[_0x429b('0x8d')]('('+_0x57f0be[_0x429b('0x83')]()+')',_0x429b('0xa6'));_0x3cd60d[_0x429b('0x6b')](_0x429b('0xa7'),'count');_0x57f0be[_0x429b('0x22')](_0x22a735[_0x429b('0x22')]||_0x48dc4e);_0x57f0be[_0x429b('0x21')](_0x22a735[_0x429b('0x21')]||0x0);return dbH['sequelize'][_0x429b('0x35')](_0x3cd60d[_0x429b('0x83')](),{'type':dbH['sequelize']['QueryTypes'][_0x429b('0x86')]})['then'](function(_0x4ce88a){if(!_0x4ce88a['length']){_0x5bd05e=0x0;}else{_0x5bd05e=_0x4ce88a[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x57f0be[_0x429b('0x83')](),{'type':dbH[_0x429b('0x84')][_0x429b('0x85')][_0x429b('0x86')]});})[_0x429b('0x26')](function(_0x1da397){return{'rows':_0x1da397||[],'count':_0x5bd05e};});}});}exports[_0x429b('0xa8')]=function(_0x82f127,_0x540b15){return runReport(_0x82f127[_0x429b('0x4a')],_0x82f127[_0x429b('0x35')],_0x82f127[_0x429b('0x4b')])[_0x429b('0x26')](respondWithResult(_0x540b15,null))['catch'](handleError(_0x540b15,null));};exports['runReport']=runReport;exports[_0x429b('0x35')]=function(_0x28526b,_0x567738){var _0x16a5a3=0xa;var _0x41fd38=[_0x429b('0x57'),_0x429b('0x58'),_0x429b('0x59'),_0x429b('0x5a')];var _0x2af384={'SUM':'SUM(%s)','COUNT':_0x429b('0xa9'),'COUNT DISTINCT':_0x429b('0x5c'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x429b('0x88'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x429b('0x89'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x270eee={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x429b('0x60'),'HOUR':_0x429b('0x61'),'ROUND':_0x429b('0x62'),'UNIX_TIMESTAMP':_0x429b('0x8a')};var _0x33dc25=function(_0x50a6fc){return!_[_0x429b('0x8b')]([_0x429b('0x63'),_0x429b('0x64'),_0x429b('0x65'),_0x429b('0x66')],_0x50a6fc);};var _0x53588e=function(_0x4f2efa){if(!_0x4f2efa||!_0x4f2efa['rules'][_0x429b('0x67')]){return'';}for(var _0x113a72='(',_0xbe1007=0x0;_0xbe1007<_0x4f2efa[_0x429b('0x68')][_0x429b('0x67')];_0xbe1007+=0x1){_0xbe1007>0x0&&(_0x113a72+='\x20'+_0x4f2efa[_0x429b('0x69')]+'\x20');_0x113a72+=_0x4f2efa[_0x429b('0x68')][_0xbe1007][_0x429b('0x6a')]?_0x53588e(_0x4f2efa[_0x429b('0x68')][_0xbe1007][_0x429b('0x6a')]):_0x4f2efa[_0x429b('0x68')][_0xbe1007][_0x429b('0x6b')]+'\x20'+_0x4f2efa['rules'][_0xbe1007][_0x429b('0x6c')]+(_0x33dc25(_0x4f2efa[_0x429b('0x68')][_0xbe1007][_0x429b('0x6c')])?'\x20'+_0x4f2efa[_0x429b('0x68')][_0xbe1007][_0x429b('0x6d')]:'');}return _0x113a72+')';};var _0x4b2ed9={'where':{'id':_0x28526b[_0x429b('0x4a')]['id']}},_0xea5f81,_0x68c068,_0x3673ff,_0x32f1cc,_0x5df98e;_0x4b2ed9=_['merge']({},_0x4b2ed9,_0x28526b[_0x429b('0x4b')]);return db['AnalyticDefaultReport']['find'](_0x4b2ed9)[_0x429b('0x26')](function(_0x30e61f){if(_0x30e61f){_0xea5f81=_0x30e61f;return _0x30e61f[_0x429b('0x6e')]();}return null;})[_0x429b('0x26')](function(_0x58d7e0){if(_0x58d7e0){if(!_0x58d7e0['length']){throw new db[(_0x429b('0x92'))][(_0x429b('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x68c068=_0x58d7e0;return db[_0x429b('0x70')][_0x429b('0x46')]({'raw':!![]});}return null;})[_0x429b('0x26')](function(_0x2c18f9){if(_0x2c18f9){_0x3673ff=_[_0x429b('0x71')](_0x2c18f9,'id');var _0xdb7979;var _0x40f5a3=squel['select']();_0x40f5a3['from'](_0xea5f81[_0x429b('0x73')]);for(var _0x199977=0x0;_0x199977<_0x68c068['length'];_0x199977+=0x1){_0xdb7979=_0x68c068[_0x199977][_0x429b('0x74')]?_0x3673ff[_0x68c068[_0x199977][_0x429b('0x74')]][_0x429b('0x8e')]:_0x68c068[_0x199977][_0x429b('0x6b')];_0xdb7979=_0x68c068[_0x199977][_0x429b('0x75')]?_['replace'](_0x2af384[_0x68c068[_0x199977]['function']],'%s',_0xdb7979):_0xdb7979;_0xdb7979=_0x68c068[_0x199977][_0x429b('0x77')]?_[_0x429b('0x76')](_0x270eee[_0x68c068[_0x199977][_0x429b('0x77')]],'%s',_0xdb7979):_0xdb7979;if(_0x68c068[_0x199977][_0x429b('0x78')]){_0x40f5a3[_0x429b('0x6a')](_0xdb7979);}_0x68c068[_0x199977][_0x429b('0x79')]&&_0x40f5a3[_0x429b('0x3d')](_0xdb7979,_0x68c068[_0x199977][_0x429b('0x79')]==='DESC'?![]:!![]);_0x40f5a3['field'](_0xdb7979,_0x68c068[_0x199977][_0x429b('0x7b')]||_0xdb7979);}if(_0xea5f81['joins']){_0xea5f81[_0x429b('0x7d')]=JSON['parse'](_0xea5f81[_0x429b('0x7d')]);for(var _0x38d91a=0x0;_0x38d91a<_0xea5f81[_0x429b('0x7d')]['length'];_0x38d91a+=0x1){if(_0xea5f81['joins'][_0x38d91a][_0x429b('0x32')]&&_[_0x429b('0x8b')](_0x41fd38,_0xea5f81['joins'][_0x38d91a][_0x429b('0x32')])&&_0xea5f81[_0x429b('0x7d')][_0x38d91a]['parentKey']&&_0xea5f81[_0x429b('0x7d')][_0x38d91a][_0x429b('0x7e')]&&_0xea5f81[_0x429b('0x7d')][_0x38d91a][_0x429b('0x7f')]){_0x40f5a3[_0xea5f81[_0x429b('0x7d')][_0x38d91a]['type']](_0xea5f81[_0x429b('0x7d')][_0x38d91a][_0x429b('0x7e')],null,util[_0x429b('0x77')](_0x429b('0x8f'),_0xea5f81['table'],_0xea5f81['joins'][_0x38d91a][_0x429b('0x80')],_0xea5f81['joins'][_0x38d91a][_0x429b('0x7e')],_0xea5f81[_0x429b('0x7d')][_0x38d91a]['foreignKey']));}}}if(_0xea5f81[_0x429b('0x81')]){_0xea5f81[_0x429b('0x81')]=JSON[_0x429b('0x7c')](_0xea5f81[_0x429b('0x81')]);_0x40f5a3[_0x429b('0x3e')](_0x53588e(_0xea5f81[_0x429b('0x81')][_0x429b('0x6a')]));}_0x5df98e=_0x40f5a3['clone']();_0x40f5a3['limit'](_0x16a5a3);_0x40f5a3['offset'](0x0);logger['debug']('Limited\x20Query:',_0x40f5a3['toString']());return db[_0x429b('0x84')][_0x429b('0x35')](_0x40f5a3[_0x429b('0x83')](),{'type':db['sequelize']['QueryTypes'][_0x429b('0x86')]});}})[_0x429b('0x26')](function(){return{'sql':_0x5df98e['toString']()};})[_0x429b('0x26')](respondWithResult(_0x567738,null))[_0x429b('0x48')](handleError(_0x567738,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 200a9f0..09ec2e7 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 _0x4975=['./analyticDefaultReport.attributes','exports','AnalyticDefaultReport','analytics_default_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ae3a5,_0xd0b38d){var _0x45b3f1=function(_0x72e56b){while(--_0x72e56b){_0x3ae3a5['push'](_0x3ae3a5['shift']());}};_0x45b3f1(++_0xd0b38d);}(_0x4975,0x86));var _0x5497=function(_0x724a96,_0x5a6410){_0x724a96=_0x724a96-0x0;var _0x2b2ea5=_0x4975[_0x724a96];return _0x2b2ea5;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1967=['path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4ead23,_0x537fec){var _0x36bcae=function(_0xe423ee){while(--_0xe423ee){_0x4ead23['push'](_0x4ead23['shift']());}};_0x36bcae(++_0x537fec);}(_0x1967,0x173));var _0x7196=function(_0x4aea05,_0x42df8f){_0x4aea05=_0x4aea05-0x0;var _0x20fe54=_0x1967[_0x4aea05];return _0x20fe54;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'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 db6ea2b..a8b9067 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 _0xfbe2=['jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1c6b1d,_0x3f69e0){var _0x515b6d=function(_0x571e1e){while(--_0x571e1e){_0x1c6b1d['push'](_0x1c6b1d['shift']());}};_0x515b6d(++_0x3f69e0);}(_0xfbe2,0x1da));var _0x2fbe=function(_0x576297,_0xf0286a){_0x576297=_0x576297-0x0;var _0x4e8e98=_0xfbe2[_0x576297];return _0x4e8e98;};'use strict';var _=require(_0x2fbe('0x0'));var util=require(_0x2fbe('0x1'));var moment=require(_0x2fbe('0x2'));var BPromise=require(_0x2fbe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fbe('0x4'));var db=require(_0x2fbe('0x5'))['db'];var utils=require(_0x2fbe('0x6'));var logger=require('../../config/logger')(_0x2fbe('0x7'));var config=require(_0x2fbe('0x8'));var jayson=require(_0x2fbe('0x9'));var client=jayson[_0x2fbe('0xa')][_0x2fbe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x221c08,_0x1f3340,_0x31f5da){return new BPromise(function(_0x1cd992,_0x1c32e9){return client[_0x2fbe('0xc')](_0x221c08,_0x31f5da)['then'](function(_0x4cf8b8){logger[_0x2fbe('0xd')](_0x2fbe('0xe'),_0x1f3340,_0x2fbe('0xf'));logger[_0x2fbe('0x10')](_0x2fbe('0x11'),_0x1f3340,_0x2fbe('0xf'),JSON[_0x2fbe('0x12')](_0x4cf8b8));if(_0x4cf8b8[_0x2fbe('0x13')]){if(_0x4cf8b8[_0x2fbe('0x13')][_0x2fbe('0x14')]===0x1f4){logger[_0x2fbe('0x13')](_0x2fbe('0xe'),_0x1f3340,_0x4cf8b8[_0x2fbe('0x13')][_0x2fbe('0x15')]);return _0x1c32e9(_0x4cf8b8['error'][_0x2fbe('0x15')]);}logger[_0x2fbe('0x13')](_0x2fbe('0xe'),_0x1f3340,_0x4cf8b8[_0x2fbe('0x13')][_0x2fbe('0x15')]);return _0x1cd992(_0x4cf8b8[_0x2fbe('0x13')]['message']);}else{logger[_0x2fbe('0xd')](_0x2fbe('0xe'),_0x1f3340,'request\x20sent');_0x1cd992(_0x4cf8b8[_0x2fbe('0x16')]['message']);}})['catch'](function(_0x33466c){logger[_0x2fbe('0x13')](_0x2fbe('0xe'),_0x1f3340,_0x33466c);_0x1c32e9(_0x33466c);});});} \ No newline at end of file +var _0x9f3e=['request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0x9f3e,0x1c4));var _0xe9f3=function(_0x4915ef,_0x340cf0){_0x4915ef=_0x4915ef-0x0;var _0x1883e2=_0x9f3e[_0x4915ef];return _0x1883e2;};'use strict';var _=require(_0xe9f3('0x0'));var util=require(_0xe9f3('0x1'));var moment=require(_0xe9f3('0x2'));var BPromise=require(_0xe9f3('0x3'));var rs=require(_0xe9f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe9f3('0x5'))('rpc');var config=require(_0xe9f3('0x6'));var jayson=require(_0xe9f3('0x7'));var client=jayson[_0xe9f3('0x8')][_0xe9f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46e25d,_0x1611eb,_0x407123){return new BPromise(function(_0x4014b1,_0x1fe4af){return client[_0xe9f3('0xa')](_0x46e25d,_0x407123)[_0xe9f3('0xb')](function(_0x30e00e){logger[_0xe9f3('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1611eb,_0xe9f3('0xd'));logger[_0xe9f3('0xe')](_0xe9f3('0xf'),_0x1611eb,_0xe9f3('0xd'),JSON[_0xe9f3('0x10')](_0x30e00e));if(_0x30e00e['error']){if(_0x30e00e[_0xe9f3('0x11')][_0xe9f3('0x12')]===0x1f4){logger['error'](_0xe9f3('0x13'),_0x1611eb,_0x30e00e['error'][_0xe9f3('0x14')]);return _0x1fe4af(_0x30e00e[_0xe9f3('0x11')][_0xe9f3('0x14')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1611eb,_0x30e00e[_0xe9f3('0x11')][_0xe9f3('0x14')]);return _0x4014b1(_0x30e00e['error'][_0xe9f3('0x14')]);}else{logger[_0xe9f3('0xc')](_0xe9f3('0x13'),_0x1611eb,_0xe9f3('0xd'));_0x4014b1(_0x30e00e[_0xe9f3('0x15')]['message']);}})['catch'](function(_0x32e9ae){logger[_0xe9f3('0x11')](_0xe9f3('0x13'),_0x1611eb,_0x32e9ae);_0x1fe4af(_0x32e9ae);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 3cef7ad..a1f6958 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 _0xc1d4=['get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','delete','/:id','destroy','path','express','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x18d3e5,_0x58eb9e){var _0x160fd7=function(_0x4aafd3){while(--_0x4aafd3){_0x18d3e5['push'](_0x18d3e5['shift']());}};_0x160fd7(++_0x58eb9e);}(_0xc1d4,0x13e));var _0x4c1d=function(_0x3d1f54,_0x341e63){_0x3d1f54=_0x3d1f54-0x0;var _0x1c5e55=_0xc1d4[_0x3d1f54];return _0x1c5e55;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4c1d('0x0'));var timeout=require('connect-timeout');var express=require(_0x4c1d('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4c1d('0x2'));var config=require(_0x4c1d('0x3'));var controller=require(_0x4c1d('0x4'));router[_0x4c1d('0x5')]('/',auth[_0x4c1d('0x6')](),controller['index']);router[_0x4c1d('0x5')]('/:id',auth[_0x4c1d('0x6')](),controller[_0x4c1d('0x7')]);router['get'](_0x4c1d('0x8'),auth[_0x4c1d('0x6')](),controller[_0x4c1d('0x9')]);router['get'](_0x4c1d('0xa'),auth[_0x4c1d('0x6')](),controller[_0x4c1d('0xb')]);router[_0x4c1d('0x5')](_0x4c1d('0xc'),auth[_0x4c1d('0x6')](),controller[_0x4c1d('0xd')]);router['post']('/',auth[_0x4c1d('0x6')](),controller[_0x4c1d('0xe')]);router[_0x4c1d('0xf')]('/:id',auth[_0x4c1d('0x6')](),controller['update']);router[_0x4c1d('0x10')](_0x4c1d('0x11'),auth[_0x4c1d('0x6')](),controller[_0x4c1d('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd52d=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','/:id/run','run','/:id/query','post','put','update','destroy','exports'];(function(_0x58c944,_0x2ed73c){var _0x275d3a=function(_0xcfc2f0){while(--_0xcfc2f0){_0x58c944['push'](_0x58c944['shift']());}};_0x275d3a(++_0x2ed73c);}(_0xd52d,0xbd));var _0xdd52=function(_0x54da18,_0x29177b){_0x54da18=_0x54da18-0x0;var _0xf25bfa=_0xd52d[_0x54da18];return _0xf25bfa;};'use strict';var multer=require(_0xdd52('0x0'));var util=require(_0xdd52('0x1'));var path=require(_0xdd52('0x2'));var timeout=require(_0xdd52('0x3'));var express=require('express');var router=express[_0xdd52('0x4')]();var auth=require(_0xdd52('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdd52('0x6'));var controller=require(_0xdd52('0x7'));router[_0xdd52('0x8')]('/',auth[_0xdd52('0x9')](),controller['index']);router[_0xdd52('0x8')](_0xdd52('0xa'),auth[_0xdd52('0x9')](),controller[_0xdd52('0xb')]);router[_0xdd52('0x8')](_0xdd52('0xc'),auth[_0xdd52('0x9')](),controller['preview']);router[_0xdd52('0x8')](_0xdd52('0xd'),auth[_0xdd52('0x9')](),controller[_0xdd52('0xe')]);router[_0xdd52('0x8')](_0xdd52('0xf'),auth[_0xdd52('0x9')](),controller['query']);router[_0xdd52('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdd52('0x11')](_0xdd52('0xa'),auth[_0xdd52('0x9')](),controller[_0xdd52('0x12')]);router['delete']('/:id',auth[_0xdd52('0x9')](),controller[_0xdd52('0x13')]);module[_0xdd52('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 8cfed61..d1b1768 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 _0x4c72=['moment','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x4c72,0x81));var _0x24c7=function(_0x4ee62f,_0x333c66){_0x4ee62f=_0x4ee62f-0x0;var _0x1616de=_0x4c72[_0x4ee62f];return _0x1616de;};'use strict';var Sequelize=require(_0x24c7('0x0'));var moment=require(_0x24c7('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x24c7('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x24c7('0x3')](_0x24c7('0x4'),_0x24c7('0x5'),_0x24c7('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x24c7('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x24c7('0x7')]},'endDate':{'type':Sequelize[_0x24c7('0x7')]},'status':{'type':Sequelize[_0x24c7('0x2')],'defaultValue':_0x24c7('0x8')},'type':{'type':Sequelize['ENUM'](_0x24c7('0x9'),_0x24c7('0xa')),'allowNull':![],'defaultValue':_0x24c7('0x9')},'reportId':{'type':Sequelize[_0x24c7('0xb')](0xb)[_0x24c7('0xc')]},'reportType':{'type':Sequelize[_0x24c7('0x2')]}}; \ No newline at end of file +var _0xff42=['manual','INTEGER','UNSIGNED','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','scheduled'];(function(_0x225915,_0x2eaa2f){var _0x3b8d10=function(_0x4c9dd5){while(--_0x4c9dd5){_0x225915['push'](_0x225915['shift']());}};_0x3b8d10(++_0x2eaa2f);}(_0xff42,0x78));var _0x2ff4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xff42[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x2ff4('0x0'));module[_0x2ff4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x2ff4('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x2ff4('0x3')](_0x2ff4('0x4'),_0x2ff4('0x5'),_0x2ff4('0x6')),'allowNull':![],'defaultValue':_0x2ff4('0x4')},'savename':{'type':Sequelize[_0x2ff4('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2ff4('0x7')]},'endDate':{'type':Sequelize[_0x2ff4('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x2ff4('0x8')},'type':{'type':Sequelize['ENUM']('manual',_0x2ff4('0x9')),'allowNull':![],'defaultValue':_0x2ff4('0xa')},'reportId':{'type':Sequelize[_0x2ff4('0xb')](0xb)[_0x2ff4('0xc')]},'reportType':{'type':Sequelize[_0x2ff4('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 38f9628..396eaaf 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 _0xc774=['model','attributes','fields','length','nolimit','order','sort','where','filter','merge','options','count','includeAll','include','AnalyticExtractedReport','findAll','rows','catch','show','params','rawAttributes','intersection','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','destroy','output','existsSync','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','join','root','format','basename','toLowerCase','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','update','then','get','ExtractedReports','error','stack','name','send','index','map','fieldName','type','key','query','keys','filters'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xc774,0x147));var _0x4c77=function(_0x3489d1,_0x45335f){_0x3489d1=_0x3489d1-0x0;var _0x1a5db6=_0xc774[_0x3489d1];return _0x1a5db6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4c77('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c77('0x1'));var rp=require(_0x4c77('0x2'));var moment=require('moment');var BPromise=require(_0x4c77('0x3'));var Mustache=require(_0x4c77('0x4'));var util=require(_0x4c77('0x5'));var path=require(_0x4c77('0x6'));var sox=require('sox');var csv=require(_0x4c77('0x7'));var ejs=require(_0x4c77('0x8'));var fs=require('fs');var _=require(_0x4c77('0x9'));var squel=require(_0x4c77('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4c77('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4c77('0xc'));var Redis=require(_0x4c77('0xd'));var authService=require(_0x4c77('0xe'));var qs=require(_0x4c77('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c77('0x10'));var logger=require('../../config/logger')(_0x4c77('0x11'));var utils=require('../../config/utils');var config=require(_0x4c77('0x12'));var db=require(_0x4c77('0x13'))['db'];function respondWithStatusCode(_0x3b48ad,_0x477c4b){_0x477c4b=_0x477c4b||0xcc;return function(_0x3c03eb){if(_0x3c03eb){return _0x3b48ad[_0x4c77('0x14')](_0x477c4b);}return _0x3b48ad['status'](_0x477c4b)[_0x4c77('0x15')]();};}function respondWithResult(_0x5419f4,_0x15490c){_0x15490c=_0x15490c||0xc8;return function(_0x2aaf0c){if(_0x2aaf0c){return _0x5419f4[_0x4c77('0x16')](_0x15490c)[_0x4c77('0x17')](_0x2aaf0c);}};}function respondWithFilteredResult(_0x51d696,_0x1f29fd){return function(_0x4dc8d7){if(_0x4dc8d7){var _0x351ef2=_0x4dc8d7['count'],_0x2d7764=_0x1f29fd[_0x4c77('0x18')],_0x4a1831=_0x1f29fd[_0x4c77('0x18')]+_0x1f29fd[_0x4c77('0x19')],_0x28bad5;if(_0x4a1831>=_0x351ef2){_0x4a1831=_0x351ef2;_0x28bad5=0xc8;}else{_0x28bad5=0xce;}_0x51d696[_0x4c77('0x16')](_0x28bad5);return _0x51d696[_0x4c77('0x1a')](_0x4c77('0x1b'),_0x2d7764+'-'+_0x4a1831+'/'+_0x351ef2)[_0x4c77('0x17')](_0x4dc8d7);}return null;};}function patchUpdates(_0x258934){return function(_0x4464ee){try{jsonpatch[_0x4c77('0x1c')](_0x4464ee,_0x258934,!![]);}catch(_0x150782){return BPromise['reject'](_0x150782);}return _0x4464ee['save']();};}function saveUpdates(_0x49d614,_0x1d717a){return function(_0x50a642){if(_0x50a642){return _0x50a642[_0x4c77('0x1d')](_0x49d614)[_0x4c77('0x1e')](function(_0x53d60a){return _0x53d60a;});}return null;};}function removeEntity(_0x31ed6d,_0x46972){return function(_0x2b3378){if(_0x2b3378){return _0x2b3378['destroy']()[_0x4c77('0x1e')](function(){var _0x1c0761=_0x2b3378[_0x4c77('0x1f')]({'plain':!![]});var _0xeb74d4=_0x4c77('0x20');return db['UserProfileResource']['destroy']({'where':{'type':_0xeb74d4,'resourceId':_0x1c0761['id']}})[_0x4c77('0x1e')](function(){return _0x2b3378;});})[_0x4c77('0x1e')](function(){_0x31ed6d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x186400,_0x5de100){return function(_0x10af90){if(!_0x10af90){_0x186400[_0x4c77('0x14')](0x194);}return _0x10af90;};}function handleError(_0x3a475a,_0x4f1f51){_0x4f1f51=_0x4f1f51||0x1f4;return function(_0x3859e0){logger[_0x4c77('0x21')](_0x3859e0[_0x4c77('0x22')]);if(_0x3859e0[_0x4c77('0x23')]){delete _0x3859e0['name'];}_0x3a475a[_0x4c77('0x16')](_0x4f1f51)[_0x4c77('0x24')](_0x3859e0);};}exports[_0x4c77('0x25')]=function(_0x128135,_0x525726){var _0x2f4004={},_0xdff94={},_0x343737={'count':0x0,'rows':[]};var _0x1c7518=_[_0x4c77('0x26')](db['AnalyticExtractedReport']['rawAttributes'],function(_0x47ef11){return{'name':_0x47ef11[_0x4c77('0x27')],'type':_0x47ef11[_0x4c77('0x28')][_0x4c77('0x29')]};});_0xdff94['model']=_[_0x4c77('0x26')](_0x1c7518,_0x4c77('0x23'));_0xdff94[_0x4c77('0x2a')]=_[_0x4c77('0x2b')](_0x128135[_0x4c77('0x2a')]);_0xdff94[_0x4c77('0x2c')]=_['intersection'](_0xdff94[_0x4c77('0x2d')],_0xdff94[_0x4c77('0x2a')]);_0x2f4004[_0x4c77('0x2e')]=_['intersection'](_0xdff94[_0x4c77('0x2d')],qs[_0x4c77('0x2f')](_0x128135[_0x4c77('0x2a')][_0x4c77('0x2f')]));_0x2f4004['attributes']=_0x2f4004[_0x4c77('0x2e')][_0x4c77('0x30')]?_0x2f4004[_0x4c77('0x2e')]:_0xdff94[_0x4c77('0x2d')];if(!_0x128135[_0x4c77('0x2a')]['hasOwnProperty'](_0x4c77('0x31'))){_0x2f4004[_0x4c77('0x19')]=qs[_0x4c77('0x19')](_0x128135[_0x4c77('0x2a')][_0x4c77('0x19')]);_0x2f4004['offset']=qs['offset'](_0x128135[_0x4c77('0x2a')][_0x4c77('0x18')]);}_0x2f4004[_0x4c77('0x32')]=qs[_0x4c77('0x33')](_0x128135[_0x4c77('0x2a')][_0x4c77('0x33')]);_0x2f4004[_0x4c77('0x34')]=qs['filters'](_['pick'](_0x128135['query'],_0xdff94[_0x4c77('0x2c')]),_0x1c7518);if(_0x128135['query'][_0x4c77('0x35')]){_0x2f4004[_0x4c77('0x34')]=_[_0x4c77('0x36')](_0x2f4004[_0x4c77('0x34')],{'$or':_[_0x4c77('0x26')](_0x1c7518,function(_0x195050){if(_0x195050[_0x4c77('0x28')]!=='VIRTUAL'){var _0x3ddf6b={};_0x3ddf6b[_0x195050[_0x4c77('0x23')]]={'$like':'%'+_0x128135['query'][_0x4c77('0x35')]+'%'};return _0x3ddf6b;}})});}_0x2f4004=_['merge']({},_0x2f4004,_0x128135[_0x4c77('0x37')]);var _0x57d39f={'where':_0x2f4004[_0x4c77('0x34')]};return db['AnalyticExtractedReport']['count'](_0x57d39f)[_0x4c77('0x1e')](function(_0x4ba31d){_0x343737[_0x4c77('0x38')]=_0x4ba31d;if(_0x128135[_0x4c77('0x2a')][_0x4c77('0x39')]){_0x2f4004[_0x4c77('0x3a')]=[{'all':!![]}];}return db[_0x4c77('0x3b')][_0x4c77('0x3c')](_0x2f4004);})[_0x4c77('0x1e')](function(_0x10ae1e){_0x343737[_0x4c77('0x3d')]=_0x10ae1e;return _0x343737;})['then'](respondWithFilteredResult(_0x525726,_0x2f4004))[_0x4c77('0x3e')](handleError(_0x525726,null));};exports[_0x4c77('0x3f')]=function(_0x26b179,_0x27bfe3){var _0x5bce4d={'raw':!![],'where':{'id':_0x26b179[_0x4c77('0x40')]['id']}},_0x2e2c62={};_0x2e2c62[_0x4c77('0x2d')]=_['keys'](db[_0x4c77('0x3b')][_0x4c77('0x41')]);_0x2e2c62[_0x4c77('0x2a')]=_[_0x4c77('0x2b')](_0x26b179['query']);_0x2e2c62[_0x4c77('0x2c')]=_[_0x4c77('0x42')](_0x2e2c62['model'],_0x2e2c62[_0x4c77('0x2a')]);_0x5bce4d[_0x4c77('0x2e')]=_[_0x4c77('0x42')](_0x2e2c62[_0x4c77('0x2d')],qs[_0x4c77('0x2f')](_0x26b179['query'][_0x4c77('0x2f')]));_0x5bce4d[_0x4c77('0x2e')]=_0x5bce4d[_0x4c77('0x2e')][_0x4c77('0x30')]?_0x5bce4d[_0x4c77('0x2e')]:_0x2e2c62[_0x4c77('0x2d')];if(_0x26b179['query'][_0x4c77('0x39')]){_0x5bce4d[_0x4c77('0x3a')]=[{'all':!![]}];}_0x5bce4d=_[_0x4c77('0x36')]({},_0x5bce4d,_0x26b179[_0x4c77('0x37')]);return db['AnalyticExtractedReport'][_0x4c77('0x43')](_0x5bce4d)[_0x4c77('0x1e')](handleEntityNotFound(_0x27bfe3,null))[_0x4c77('0x1e')](respondWithResult(_0x27bfe3,null))['catch'](handleError(_0x27bfe3,null));};exports[_0x4c77('0x44')]=function(_0x44249a,_0xef9a56){return db['AnalyticExtractedReport']['create'](_0x44249a[_0x4c77('0x45')],{})[_0x4c77('0x1e')](function(_0x284bc0){var _0x679ec6=_0x44249a[_0x4c77('0x46')][_0x4c77('0x1f')]({'plain':!![]});if(!_0x679ec6)throw new Error(_0x4c77('0x47'));if(_0x679ec6[_0x4c77('0x48')]===_0x4c77('0x46')){var _0x1cf9d5=_0x284bc0[_0x4c77('0x1f')]({'plain':!![]});var _0x2f6572=_0x4c77('0x20');return db[_0x4c77('0x49')][_0x4c77('0x43')]({'where':{'name':_0x2f6572,'userProfileId':_0x679ec6[_0x4c77('0x4a')]},'raw':!![]})[_0x4c77('0x1e')](function(_0x13f7fb){if(_0x13f7fb&&_0x13f7fb[_0x4c77('0x4b')]===0x0){return db[_0x4c77('0x4c')][_0x4c77('0x44')]({'name':_0x1cf9d5[_0x4c77('0x23')],'resourceId':_0x1cf9d5['id'],'type':_0x13f7fb[_0x4c77('0x23')],'sectionId':_0x13f7fb['id']},{})[_0x4c77('0x1e')](function(){return _0x284bc0;});}else{return _0x284bc0;}})[_0x4c77('0x3e')](function(_0x35a8dc){logger[_0x4c77('0x21')](_0x4c77('0x4d'),_0x35a8dc);throw _0x35a8dc;});}return _0x284bc0;})[_0x4c77('0x1e')](respondWithResult(_0xef9a56,0xc9))[_0x4c77('0x3e')](handleError(_0xef9a56,null));};exports[_0x4c77('0x1d')]=function(_0x53d910,_0x28c7f0){if(_0x53d910[_0x4c77('0x45')]['id']){delete _0x53d910['body']['id'];}return db[_0x4c77('0x3b')][_0x4c77('0x43')]({'where':{'id':_0x53d910[_0x4c77('0x40')]['id']}})[_0x4c77('0x1e')](handleEntityNotFound(_0x28c7f0,null))['then'](saveUpdates(_0x53d910[_0x4c77('0x45')],null))[_0x4c77('0x1e')](respondWithResult(_0x28c7f0,null))['catch'](handleError(_0x28c7f0,null));};exports[_0x4c77('0x4e')]=function(_0x5a865c,_0x20f0e){return db[_0x4c77('0x3b')]['find']({'where':{'id':_0x5a865c[_0x4c77('0x40')]['id']}})[_0x4c77('0x1e')](handleEntityNotFound(_0x20f0e,null))['then'](removeEntity(_0x20f0e,null))['catch'](handleError(_0x20f0e,null));};exports['download']=function(_0x25b257,_0x5ad7dd,_0x298ef8){return db[_0x4c77('0x3b')][_0x4c77('0x43')]({'where':{'id':_0x25b257['params']['id']},'attributes':[_0x4c77('0x23'),'basename','savename',_0x4c77('0x4f')],'raw':!![]})[_0x4c77('0x1e')](handleEntityNotFound(_0x5ad7dd,null))[_0x4c77('0x1e')](function(_0xb74797){if(_0xb74797){if(!fs[_0x4c77('0x50')](path['join'](config['root'],_0x4c77('0x51'),_0xb74797[_0x4c77('0x52')]))){throw new db[(_0x4c77('0x53'))][(_0x4c77('0x54'))](_0x4c77('0x55'));}if(_0x25b257[_0x4c77('0x2a')][_0x4c77('0x56')]){return _0x5ad7dd[_0x4c77('0x14')](0xc8);}return _0x5ad7dd[_0x4c77('0x57')](path[_0x4c77('0x58')](config[_0x4c77('0x59')],_0x4c77('0x51'),_0xb74797[_0x4c77('0x52')]),util[_0x4c77('0x5a')]('%s.%s',_0xb74797[_0x4c77('0x5b')]||_0xb74797['name'],_0xb74797[_0x4c77('0x4f')][_0x4c77('0x5c')]()));}})[_0x4c77('0x3e')](handleError(_0x5ad7dd,null));}; \ No newline at end of file +var _0xfadd=['basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','download','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','AnalyticExtractedReport','rawAttributes','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xfadd,0x12a));var _0xdfad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfadd[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xdfad('0x0'));var emlformat=require(_0xdfad('0x1'));var rimraf=require(_0xdfad('0x2'));var zipdir=require(_0xdfad('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdfad('0x4'));var moment=require(_0xdfad('0x5'));var BPromise=require(_0xdfad('0x6'));var Mustache=require(_0xdfad('0x7'));var util=require(_0xdfad('0x8'));var path=require(_0xdfad('0x9'));var sox=require('sox');var csv=require(_0xdfad('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdfad('0xb'));var squel=require(_0xdfad('0xc'));var crypto=require(_0xdfad('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdfad('0xe'));var toCsv=require(_0xdfad('0xa'));var querystring=require(_0xdfad('0xf'));var Papa=require(_0xdfad('0x10'));var Redis=require(_0xdfad('0x11'));var authService=require(_0xdfad('0x12'));var qs=require(_0xdfad('0x13'));var as=require(_0xdfad('0x14'));var hardwareService=require(_0xdfad('0x15'));var logger=require(_0xdfad('0x16'))('api');var utils=require(_0xdfad('0x17'));var config=require(_0xdfad('0x18'));var db=require(_0xdfad('0x19'))['db'];function respondWithStatusCode(_0x20fa90,_0x4a1c26){_0x4a1c26=_0x4a1c26||0xcc;return function(_0x444b6e){if(_0x444b6e){return _0x20fa90['sendStatus'](_0x4a1c26);}return _0x20fa90[_0xdfad('0x1a')](_0x4a1c26)[_0xdfad('0x1b')]();};}function respondWithResult(_0x20af2f,_0x374870){_0x374870=_0x374870||0xc8;return function(_0xcb007b){if(_0xcb007b){return _0x20af2f['status'](_0x374870)[_0xdfad('0x1c')](_0xcb007b);}};}function respondWithFilteredResult(_0x488b69,_0x2c18cb){return function(_0x19cf64){if(_0x19cf64){var _0x2bce27=_0x19cf64[_0xdfad('0x1d')],_0x62ae8f=_0x2c18cb['offset'],_0xd7a7ab=_0x2c18cb[_0xdfad('0x1e')]+_0x2c18cb[_0xdfad('0x1f')],_0xd2bc6a;if(_0xd7a7ab>=_0x2bce27){_0xd7a7ab=_0x2bce27;_0xd2bc6a=0xc8;}else{_0xd2bc6a=0xce;}_0x488b69[_0xdfad('0x1a')](_0xd2bc6a);return _0x488b69[_0xdfad('0x20')](_0xdfad('0x21'),_0x62ae8f+'-'+_0xd7a7ab+'/'+_0x2bce27)[_0xdfad('0x1c')](_0x19cf64);}return null;};}function patchUpdates(_0x26298f){return function(_0xc2cbb4){try{jsonpatch[_0xdfad('0x22')](_0xc2cbb4,_0x26298f,!![]);}catch(_0x395624){return BPromise[_0xdfad('0x23')](_0x395624);}return _0xc2cbb4[_0xdfad('0x24')]();};}function saveUpdates(_0x27a96b,_0x5e8138){return function(_0x75b648){if(_0x75b648){return _0x75b648[_0xdfad('0x25')](_0x27a96b)[_0xdfad('0x26')](function(_0x3fa3df){return _0x3fa3df;});}return null;};}function removeEntity(_0x36b11f,_0x45188f){return function(_0x565b41){if(_0x565b41){return _0x565b41[_0xdfad('0x27')]()['then'](function(){var _0x3e2c8b=_0x565b41[_0xdfad('0x28')]({'plain':!![]});var _0x38f407=_0xdfad('0x29');return db[_0xdfad('0x2a')]['destroy']({'where':{'type':_0x38f407,'resourceId':_0x3e2c8b['id']}})[_0xdfad('0x26')](function(){return _0x565b41;});})['then'](function(){_0x36b11f[_0xdfad('0x1a')](0xcc)[_0xdfad('0x1b')]();});}};}function handleEntityNotFound(_0x2fa5cb,_0x3bea45){return function(_0x2a798c){if(!_0x2a798c){_0x2fa5cb['sendStatus'](0x194);}return _0x2a798c;};}function handleError(_0x369813,_0x476e0d){_0x476e0d=_0x476e0d||0x1f4;return function(_0x55a286){logger[_0xdfad('0x2b')](_0x55a286['stack']);if(_0x55a286[_0xdfad('0x2c')]){delete _0x55a286[_0xdfad('0x2c')];}_0x369813[_0xdfad('0x1a')](_0x476e0d)['send'](_0x55a286);};}exports['index']=function(_0x1e6381,_0x5b7c9d){var _0x2d3b1b={},_0x9b7c={},_0x52e4eb={'count':0x0,'rows':[]};var _0x50fc83=_['map'](db[_0xdfad('0x2d')][_0xdfad('0x2e')],function(_0x3515fa){return{'name':_0x3515fa['fieldName'],'type':_0x3515fa[_0xdfad('0x2f')][_0xdfad('0x30')]};});_0x9b7c['model']=_[_0xdfad('0x31')](_0x50fc83,_0xdfad('0x2c'));_0x9b7c[_0xdfad('0x32')]=_[_0xdfad('0x33')](_0x1e6381['query']);_0x9b7c[_0xdfad('0x34')]=_[_0xdfad('0x35')](_0x9b7c['model'],_0x9b7c[_0xdfad('0x32')]);_0x2d3b1b['attributes']=_['intersection'](_0x9b7c[_0xdfad('0x36')],qs[_0xdfad('0x37')](_0x1e6381[_0xdfad('0x32')]['fields']));_0x2d3b1b[_0xdfad('0x38')]=_0x2d3b1b[_0xdfad('0x38')][_0xdfad('0x39')]?_0x2d3b1b[_0xdfad('0x38')]:_0x9b7c[_0xdfad('0x36')];if(!_0x1e6381[_0xdfad('0x32')]['hasOwnProperty'](_0xdfad('0x3a'))){_0x2d3b1b[_0xdfad('0x1f')]=qs[_0xdfad('0x1f')](_0x1e6381['query'][_0xdfad('0x1f')]);_0x2d3b1b['offset']=qs[_0xdfad('0x1e')](_0x1e6381[_0xdfad('0x32')][_0xdfad('0x1e')]);}_0x2d3b1b[_0xdfad('0x3b')]=qs[_0xdfad('0x3c')](_0x1e6381[_0xdfad('0x32')][_0xdfad('0x3c')]);_0x2d3b1b[_0xdfad('0x3d')]=qs[_0xdfad('0x34')](_[_0xdfad('0x3e')](_0x1e6381[_0xdfad('0x32')],_0x9b7c[_0xdfad('0x34')]),_0x50fc83);if(_0x1e6381[_0xdfad('0x32')][_0xdfad('0x3f')]){_0x2d3b1b[_0xdfad('0x3d')]=_[_0xdfad('0x40')](_0x2d3b1b[_0xdfad('0x3d')],{'$or':_['map'](_0x50fc83,function(_0x2951aa){if(_0x2951aa['type']!==_0xdfad('0x41')){var _0x439d0e={};_0x439d0e[_0x2951aa[_0xdfad('0x2c')]]={'$like':'%'+_0x1e6381[_0xdfad('0x32')][_0xdfad('0x3f')]+'%'};return _0x439d0e;}})});}_0x2d3b1b=_['merge']({},_0x2d3b1b,_0x1e6381[_0xdfad('0x42')]);var _0x4b7aa6={'where':_0x2d3b1b[_0xdfad('0x3d')]};return db[_0xdfad('0x2d')][_0xdfad('0x1d')](_0x4b7aa6)[_0xdfad('0x26')](function(_0xbf621){_0x52e4eb['count']=_0xbf621;if(_0x1e6381['query']['includeAll']){_0x2d3b1b[_0xdfad('0x43')]=[{'all':!![]}];}return db[_0xdfad('0x2d')][_0xdfad('0x44')](_0x2d3b1b);})[_0xdfad('0x26')](function(_0x1b8fd3){_0x52e4eb[_0xdfad('0x45')]=_0x1b8fd3;return _0x52e4eb;})[_0xdfad('0x26')](respondWithFilteredResult(_0x5b7c9d,_0x2d3b1b))[_0xdfad('0x46')](handleError(_0x5b7c9d,null));};exports[_0xdfad('0x47')]=function(_0x19dc36,_0x4d43ea){var _0x4b9bb1={'raw':!![],'where':{'id':_0x19dc36[_0xdfad('0x48')]['id']}},_0x53ef84={};_0x53ef84[_0xdfad('0x36')]=_[_0xdfad('0x33')](db[_0xdfad('0x2d')][_0xdfad('0x2e')]);_0x53ef84[_0xdfad('0x32')]=_['keys'](_0x19dc36[_0xdfad('0x32')]);_0x53ef84[_0xdfad('0x34')]=_[_0xdfad('0x35')](_0x53ef84[_0xdfad('0x36')],_0x53ef84[_0xdfad('0x32')]);_0x4b9bb1['attributes']=_[_0xdfad('0x35')](_0x53ef84['model'],qs[_0xdfad('0x37')](_0x19dc36['query'][_0xdfad('0x37')]));_0x4b9bb1[_0xdfad('0x38')]=_0x4b9bb1[_0xdfad('0x38')]['length']?_0x4b9bb1[_0xdfad('0x38')]:_0x53ef84['model'];if(_0x19dc36[_0xdfad('0x32')]['includeAll']){_0x4b9bb1['include']=[{'all':!![]}];}_0x4b9bb1=_[_0xdfad('0x40')]({},_0x4b9bb1,_0x19dc36[_0xdfad('0x42')]);return db[_0xdfad('0x2d')][_0xdfad('0x49')](_0x4b9bb1)[_0xdfad('0x26')](handleEntityNotFound(_0x4d43ea,null))[_0xdfad('0x26')](respondWithResult(_0x4d43ea,null))[_0xdfad('0x46')](handleError(_0x4d43ea,null));};exports[_0xdfad('0x4a')]=function(_0x1074fc,_0x186dcb){return db[_0xdfad('0x2d')][_0xdfad('0x4a')](_0x1074fc[_0xdfad('0x4b')],{})[_0xdfad('0x26')](function(_0x5a3882){var _0x730fc2=_0x1074fc[_0xdfad('0x4c')][_0xdfad('0x28')]({'plain':!![]});if(!_0x730fc2)throw new Error(_0xdfad('0x4d'));if(_0x730fc2[_0xdfad('0x4e')]===_0xdfad('0x4c')){var _0x331400=_0x5a3882['get']({'plain':!![]});var _0x489509=_0xdfad('0x29');return db[_0xdfad('0x4f')][_0xdfad('0x49')]({'where':{'name':_0x489509,'userProfileId':_0x730fc2[_0xdfad('0x50')]},'raw':!![]})[_0xdfad('0x26')](function(_0x1ae7a5){if(_0x1ae7a5&&_0x1ae7a5['autoAssociation']===0x0){return db['UserProfileResource'][_0xdfad('0x4a')]({'name':_0x331400[_0xdfad('0x2c')],'resourceId':_0x331400['id'],'type':_0x1ae7a5[_0xdfad('0x2c')],'sectionId':_0x1ae7a5['id']},{})[_0xdfad('0x26')](function(){return _0x5a3882;});}else{return _0x5a3882;}})['catch'](function(_0x59ffac){logger[_0xdfad('0x2b')](_0xdfad('0x51'),_0x59ffac);throw _0x59ffac;});}return _0x5a3882;})[_0xdfad('0x26')](respondWithResult(_0x186dcb,0xc9))['catch'](handleError(_0x186dcb,null));};exports[_0xdfad('0x25')]=function(_0x21c55c,_0x2f1065){if(_0x21c55c[_0xdfad('0x4b')]['id']){delete _0x21c55c[_0xdfad('0x4b')]['id'];}return db[_0xdfad('0x2d')][_0xdfad('0x49')]({'where':{'id':_0x21c55c[_0xdfad('0x48')]['id']}})[_0xdfad('0x26')](handleEntityNotFound(_0x2f1065,null))['then'](saveUpdates(_0x21c55c[_0xdfad('0x4b')],null))[_0xdfad('0x26')](respondWithResult(_0x2f1065,null))[_0xdfad('0x46')](handleError(_0x2f1065,null));};exports[_0xdfad('0x27')]=function(_0x56b5a0,_0xc040b2){return db[_0xdfad('0x2d')]['find']({'where':{'id':_0x56b5a0['params']['id']}})['then'](handleEntityNotFound(_0xc040b2,null))['then'](removeEntity(_0xc040b2,null))[_0xdfad('0x46')](handleError(_0xc040b2,null));};exports['download']=function(_0x577c4e,_0xcdb5b,_0x1fc78f){return db['AnalyticExtractedReport'][_0xdfad('0x49')]({'where':{'id':_0x577c4e[_0xdfad('0x48')]['id']},'attributes':[_0xdfad('0x2c'),_0xdfad('0x52'),_0xdfad('0x53'),_0xdfad('0x54')],'raw':!![]})[_0xdfad('0x26')](handleEntityNotFound(_0xcdb5b,null))[_0xdfad('0x26')](function(_0x5f59f2){if(_0x5f59f2){if(!fs[_0xdfad('0x55')](path[_0xdfad('0x56')](config[_0xdfad('0x57')],_0xdfad('0x58'),_0x5f59f2[_0xdfad('0x53')]))){throw new db[(_0xdfad('0x59'))][(_0xdfad('0x5a'))](_0xdfad('0x5b'));}if(_0x577c4e['query'][_0xdfad('0x5c')]){return _0xcdb5b[_0xdfad('0x5d')](0xc8);}return _0xcdb5b[_0xdfad('0x5e')](path[_0xdfad('0x56')](config[_0xdfad('0x57')],_0xdfad('0x58'),_0x5f59f2['savename']),util['format']('%s.%s',_0x5f59f2['basename']||_0x5f59f2[_0xdfad('0x2c')],_0x5f59f2[_0xdfad('0x54')]['toLowerCase']()));}})[_0xdfad('0x46')](handleError(_0xcdb5b,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index c5f75d7..e715a80 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 _0x79a8=['define','AnalyticExtractedReport','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x295f0e,_0x5d92b5){var _0x3c5894=function(_0x1639a9){while(--_0x1639a9){_0x295f0e['push'](_0x295f0e['shift']());}};_0x3c5894(++_0x5d92b5);}(_0x79a8,0x1d0));var _0x879a=function(_0x2f3be2,_0x224419){_0x2f3be2=_0x2f3be2-0x0;var _0x4cf7b0=_0x79a8[_0x2f3be2];return _0x4cf7b0;};'use strict';var _=require(_0x879a('0x0'));var util=require('util');var logger=require(_0x879a('0x1'))(_0x879a('0x2'));var moment=require(_0x879a('0x3'));var BPromise=require('bluebird');var rp=require(_0x879a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x879a('0x5'));var config=require(_0x879a('0x6'));var attributes=require(_0x879a('0x7'));module[_0x879a('0x8')]=function(_0x1808f1,_0x3cb89c){return _0x1808f1[_0x879a('0x9')](_0x879a('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad80=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x232d45,_0x283a23){var _0x145f68=function(_0x550aa6){while(--_0x550aa6){_0x232d45['push'](_0x232d45['shift']());}};_0x145f68(++_0x283a23);}(_0xad80,0x106));var _0x0ad8=function(_0x242875,_0x44524a){_0x242875=_0x242875-0x0;var _0x25b3ee=_0xad80[_0x242875];return _0x25b3ee;};'use strict';var _=require(_0x0ad8('0x0'));var util=require(_0x0ad8('0x1'));var logger=require(_0x0ad8('0x2'))(_0x0ad8('0x3'));var moment=require(_0x0ad8('0x4'));var BPromise=require('bluebird');var rp=require(_0x0ad8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ad8('0x6'));var config=require(_0x0ad8('0x7'));var attributes=require('./analyticExtractedReport.attributes');module[_0x0ad8('0x8')]=function(_0x41e1f6,_0x29ffb9){return _0x41e1f6[_0x0ad8('0x9')](_0x0ad8('0xa'),attributes,{'tableName':_0x0ad8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 950f6c7..791a7ce 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 _0xafc2=['../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xafc2,0x1d9));var _0x2afc=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xafc2[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x2afc('0x0'));var util=require(_0x2afc('0x1'));var moment=require('moment');var BPromise=require(_0x2afc('0x2'));var rs=require(_0x2afc('0x3'));var fs=require('fs');var Redis=require(_0x2afc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2afc('0x5'));var logger=require(_0x2afc('0x6'))('rpc');var config=require(_0x2afc('0x7'));var jayson=require(_0x2afc('0x8'));var client=jayson[_0x2afc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ed165,_0x3698cc,_0x1cb860){return new BPromise(function(_0x5320c7,_0x436e3f){return client[_0x2afc('0xa')](_0x5ed165,_0x1cb860)[_0x2afc('0xb')](function(_0xcc0692){logger[_0x2afc('0xc')](_0x2afc('0xd'),_0x3698cc,_0x2afc('0xe'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x3698cc,_0x2afc('0xe'),JSON[_0x2afc('0xf')](_0xcc0692));if(_0xcc0692[_0x2afc('0x10')]){if(_0xcc0692[_0x2afc('0x10')][_0x2afc('0x11')]===0x1f4){logger[_0x2afc('0x10')](_0x2afc('0xd'),_0x3698cc,_0xcc0692[_0x2afc('0x10')]['message']);return _0x436e3f(_0xcc0692[_0x2afc('0x10')][_0x2afc('0x12')]);}logger['error'](_0x2afc('0xd'),_0x3698cc,_0xcc0692['error']['message']);return _0x5320c7(_0xcc0692[_0x2afc('0x10')][_0x2afc('0x12')]);}else{logger['info'](_0x2afc('0xd'),_0x3698cc,'request\x20sent');_0x5320c7(_0xcc0692[_0x2afc('0x13')][_0x2afc('0x12')]);}})['catch'](function(_0x21a089){logger[_0x2afc('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3698cc,_0x21a089);_0x436e3f(_0x21a089);});});} \ No newline at end of file +var _0x5372=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird'];(function(_0x518d43,_0x1e2758){var _0x1ca38a=function(_0x37e337){while(--_0x37e337){_0x518d43['push'](_0x518d43['shift']());}};_0x1ca38a(++_0x1e2758);}(_0x5372,0x189));var _0x2537=function(_0x393817,_0x197482){_0x393817=_0x393817-0x0;var _0x105a21=_0x5372[_0x393817];return _0x105a21;};'use strict';var _=require(_0x2537('0x0'));var util=require(_0x2537('0x1'));var moment=require('moment');var BPromise=require(_0x2537('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2537('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2537('0x4'));var logger=require(_0x2537('0x5'))(_0x2537('0x6'));var config=require(_0x2537('0x7'));var jayson=require(_0x2537('0x8'));var client=jayson[_0x2537('0x9')][_0x2537('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2095c7,_0x51c93f,_0x65d4ae){return new BPromise(function(_0x290deb,_0x23bbd2){return client[_0x2537('0xb')](_0x2095c7,_0x65d4ae)[_0x2537('0xc')](function(_0x2aa805){logger['info'](_0x2537('0xd'),_0x51c93f,_0x2537('0xe'));logger['debug'](_0x2537('0xf'),_0x51c93f,_0x2537('0xe'),JSON[_0x2537('0x10')](_0x2aa805));if(_0x2aa805[_0x2537('0x11')]){if(_0x2aa805['error'][_0x2537('0x12')]===0x1f4){logger[_0x2537('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x51c93f,_0x2aa805[_0x2537('0x11')]['message']);return _0x23bbd2(_0x2aa805['error'][_0x2537('0x13')]);}logger[_0x2537('0x11')](_0x2537('0xd'),_0x51c93f,_0x2aa805[_0x2537('0x11')][_0x2537('0x13')]);return _0x290deb(_0x2aa805[_0x2537('0x11')]['message']);}else{logger[_0x2537('0x14')](_0x2537('0xd'),_0x51c93f,_0x2537('0xe'));_0x290deb(_0x2aa805['result'][_0x2537('0x13')]);}})[_0x2537('0x15')](function(_0x34f8ab){logger['error'](_0x2537('0xd'),_0x51c93f,_0x34f8ab);_0x23bbd2(_0x34f8ab);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 0676aa1..f19fffb 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 _0x162a=['download','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download'];(function(_0x242e88,_0x3d72e9){var _0x25ca69=function(_0x2ae3f6){while(--_0x2ae3f6){_0x242e88['push'](_0x242e88['shift']());}};_0x25ca69(++_0x3d72e9);}(_0x162a,0x180));var _0xa162=function(_0x38cda5,_0x47fa4f){_0x38cda5=_0x38cda5-0x0;var _0x3b0d06=_0x162a[_0x38cda5];return _0x3b0d06;};'use strict';var multer=require(_0xa162('0x0'));var util=require(_0xa162('0x1'));var path=require(_0xa162('0x2'));var timeout=require(_0xa162('0x3'));var express=require(_0xa162('0x4'));var router=express['Router']();var auth=require(_0xa162('0x5'));var interaction=require(_0xa162('0x6'));var config=require(_0xa162('0x7'));var controller=require(_0xa162('0x8'));router[_0xa162('0x9')]('/',auth[_0xa162('0xa')](),controller[_0xa162('0xb')]);router[_0xa162('0x9')](_0xa162('0xc'),auth[_0xa162('0xa')](),controller[_0xa162('0xd')]);router[_0xa162('0x9')](_0xa162('0xe'),auth['isAuthenticated'](),controller[_0xa162('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa162('0x10')](_0xa162('0xc'),auth['isAuthenticated'](),controller[_0xa162('0x11')]);router['delete'](_0xa162('0xc'),auth[_0xa162('0xa')](),controller[_0xa162('0x12')]);module['exports']=router; \ No newline at end of file +var _0xbc78=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','/:id','isAuthenticated','show','/:id/download','post','put','update','delete','destroy'];(function(_0x39f56d,_0x1fdfc1){var _0x3f6f62=function(_0x3ec689){while(--_0x3ec689){_0x39f56d['push'](_0x39f56d['shift']());}};_0x3f6f62(++_0x1fdfc1);}(_0xbc78,0x191));var _0x8bc7=function(_0x17d6b1,_0x1a9dc0){_0x17d6b1=_0x17d6b1-0x0;var _0x23dcc1=_0xbc78[_0x17d6b1];return _0x23dcc1;};'use strict';var multer=require(_0x8bc7('0x0'));var util=require(_0x8bc7('0x1'));var path=require(_0x8bc7('0x2'));var timeout=require(_0x8bc7('0x3'));var express=require(_0x8bc7('0x4'));var router=express[_0x8bc7('0x5')]();var auth=require(_0x8bc7('0x6'));var interaction=require(_0x8bc7('0x7'));var config=require('../../config/environment');var controller=require(_0x8bc7('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8bc7('0x9')](_0x8bc7('0xa'),auth[_0x8bc7('0xb')](),controller[_0x8bc7('0xc')]);router[_0x8bc7('0x9')](_0x8bc7('0xd'),auth[_0x8bc7('0xb')](),controller['download']);router[_0x8bc7('0xe')]('/',auth[_0x8bc7('0xb')](),controller['create']);router[_0x8bc7('0xf')](_0x8bc7('0xa'),auth[_0x8bc7('0xb')](),controller[_0x8bc7('0x10')]);router[_0x8bc7('0x11')](_0x8bc7('0xa'),auth[_0x8bc7('0xb')](),controller[_0x8bc7('0x12')]);module[_0x8bc7('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index dde010b..ac6b4cc 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 _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x3d9e94,_0x48136c){var _0x45f76e=function(_0x3fb608){while(--_0x3fb608){_0x3d9e94['push'](_0x3d9e94['shift']());}};_0x45f76e(++_0x48136c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc4aa[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x7a54=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x126e34,_0xa28934){var _0x3cc84b=function(_0x13eccc){while(--_0x13eccc){_0x126e34['push'](_0x126e34['shift']());}};_0x3cc84b(++_0xa28934);}(_0x7a54,0x106));var _0x47a5=function(_0x294671,_0x9318){_0x294671=_0x294671-0x0;var _0x2b0c84=_0x7a54[_0x294671];return _0x2b0c84;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'field':{'type':Sequelize[_0x47a5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x47a5('0x3')]},'format':{'type':Sequelize[_0x47a5('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x47a5('0x3')]},'custom':{'type':Sequelize[_0x47a5('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 baf7bd4..b8ca37a 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 _0xb205=['transaction','destroy','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','reject','then','error','name','send','index','map','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','bulkCreate','body','update','bulkDestroy','ids','findOne'];(function(_0x85d9b6,_0x15a4d1){var _0x394327=function(_0x56d0a3){while(--_0x56d0a3){_0x85d9b6['push'](_0x85d9b6['shift']());}};_0x394327(++_0x15a4d1);}(_0xb205,0xf0));var _0x5b20=function(_0x262edd,_0x5a5804){_0x262edd=_0x262edd-0x0;var _0x5c4cfc=_0xb205[_0x262edd];return _0x5c4cfc;};'use strict';var pdf=require(_0x5b20('0x0'));var emlformat=require(_0x5b20('0x1'));var rimraf=require(_0x5b20('0x2'));var zipdir=require(_0x5b20('0x3'));var jsonpatch=require(_0x5b20('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5b20('0x5'));var Mustache=require('mustache');var util=require(_0x5b20('0x6'));var path=require(_0x5b20('0x7'));var sox=require('sox');var csv=require(_0x5b20('0x8'));var ejs=require(_0x5b20('0x9'));var fs=require('fs');var _=require(_0x5b20('0xa'));var squel=require('squel');var crypto=require(_0x5b20('0xb'));var jsforce=require(_0x5b20('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5b20('0xd'));var Papa=require(_0x5b20('0xe'));var Redis=require(_0x5b20('0xf'));var authService=require(_0x5b20('0x10'));var qs=require(_0x5b20('0x11'));var as=require(_0x5b20('0x12'));var hardwareService=require(_0x5b20('0x13'));var logger=require('../../config/logger')(_0x5b20('0x14'));var utils=require(_0x5b20('0x15'));var config=require(_0x5b20('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d5385,_0x2a13ac){_0x2a13ac=_0x2a13ac||0xcc;return function(_0x374632){if(_0x374632){return _0x4d5385[_0x5b20('0x17')](_0x2a13ac);}return _0x4d5385[_0x5b20('0x18')](_0x2a13ac)[_0x5b20('0x19')]();};}function respondWithResult(_0x4c76d8,_0x42fbb0){_0x42fbb0=_0x42fbb0||0xc8;return function(_0x32c2df){if(_0x32c2df){return _0x4c76d8[_0x5b20('0x18')](_0x42fbb0)[_0x5b20('0x1a')](_0x32c2df);}};}function respondWithFilteredResult(_0x519f9f,_0x5247f9){return function(_0x25b9ab){if(_0x25b9ab){var _0x47e80f=_0x25b9ab[_0x5b20('0x1b')],_0x5ac9db=_0x5247f9[_0x5b20('0x1c')],_0x31b9dd=_0x5247f9[_0x5b20('0x1c')]+_0x5247f9['limit'],_0x52042b;if(_0x31b9dd>=_0x47e80f){_0x31b9dd=_0x47e80f;_0x52042b=0xc8;}else{_0x52042b=0xce;}_0x519f9f[_0x5b20('0x18')](_0x52042b);return _0x519f9f[_0x5b20('0x1d')](_0x5b20('0x1e'),_0x5ac9db+'-'+_0x31b9dd+'/'+_0x47e80f)[_0x5b20('0x1a')](_0x25b9ab);}return null;};}function patchUpdates(_0x4aca0f){return function(_0x1754c1){try{jsonpatch['apply'](_0x1754c1,_0x4aca0f,!![]);}catch(_0x1a75d7){return BPromise[_0x5b20('0x1f')](_0x1a75d7);}return _0x1754c1['save']();};}function saveUpdates(_0x916912,_0x54cdf3){return function(_0x3b7aea){if(_0x3b7aea){return _0x3b7aea['update'](_0x916912)[_0x5b20('0x20')](function(_0x28fe6e){return _0x28fe6e;});}return null;};}function removeEntity(_0x59f614,_0x2d404f){return function(_0x52e27f){if(_0x52e27f){return _0x52e27f['destroy']()[_0x5b20('0x20')](function(){_0x59f614['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37ab76,_0x18f555){return function(_0x9301c7){if(!_0x9301c7){_0x37ab76[_0x5b20('0x17')](0x194);}return _0x9301c7;};}function handleError(_0x3c3c47,_0xb0f07e){_0xb0f07e=_0xb0f07e||0x1f4;return function(_0x3ce775){logger[_0x5b20('0x21')](_0x3ce775['stack']);if(_0x3ce775[_0x5b20('0x22')]){delete _0x3ce775[_0x5b20('0x22')];}_0x3c3c47[_0x5b20('0x18')](_0xb0f07e)[_0x5b20('0x23')](_0x3ce775);};}exports[_0x5b20('0x24')]=function(_0x296ae4,_0x50d335){var _0x16ff2d={},_0x49a15d={},_0x444195={'count':0x0,'rows':[]};var _0x1b8965=_[_0x5b20('0x25')](db['AnalyticFieldReport']['rawAttributes'],function(_0x15981f){return{'name':_0x15981f[_0x5b20('0x26')],'type':_0x15981f['type']['key']};});_0x49a15d[_0x5b20('0x27')]=_['map'](_0x1b8965,_0x5b20('0x22'));_0x49a15d[_0x5b20('0x28')]=_[_0x5b20('0x29')](_0x296ae4[_0x5b20('0x28')]);_0x49a15d['filters']=_[_0x5b20('0x2a')](_0x49a15d[_0x5b20('0x27')],_0x49a15d[_0x5b20('0x28')]);_0x16ff2d[_0x5b20('0x2b')]=_['intersection'](_0x49a15d[_0x5b20('0x27')],qs[_0x5b20('0x2c')](_0x296ae4[_0x5b20('0x28')][_0x5b20('0x2c')]));_0x16ff2d[_0x5b20('0x2b')]=_0x16ff2d[_0x5b20('0x2b')][_0x5b20('0x2d')]?_0x16ff2d[_0x5b20('0x2b')]:_0x49a15d[_0x5b20('0x27')];if(!_0x296ae4[_0x5b20('0x28')][_0x5b20('0x2e')](_0x5b20('0x2f'))){_0x16ff2d[_0x5b20('0x30')]=qs[_0x5b20('0x30')](_0x296ae4[_0x5b20('0x28')]['limit']);_0x16ff2d['offset']=qs['offset'](_0x296ae4[_0x5b20('0x28')][_0x5b20('0x1c')]);}_0x16ff2d[_0x5b20('0x31')]=qs[_0x5b20('0x32')](_0x296ae4[_0x5b20('0x28')]['sort']);_0x16ff2d[_0x5b20('0x33')]=qs[_0x5b20('0x34')](_[_0x5b20('0x35')](_0x296ae4[_0x5b20('0x28')],_0x49a15d[_0x5b20('0x34')]),_0x1b8965);if(_0x296ae4[_0x5b20('0x28')][_0x5b20('0x36')]){_0x16ff2d['where']=_['merge'](_0x16ff2d['where'],{'$or':_[_0x5b20('0x25')](_0x1b8965,function(_0x3ecb37){if(_0x3ecb37[_0x5b20('0x37')]!==_0x5b20('0x38')){var _0x44f0d6={};_0x44f0d6[_0x3ecb37[_0x5b20('0x22')]]={'$like':'%'+_0x296ae4['query']['filter']+'%'};return _0x44f0d6;}})});}_0x16ff2d=_[_0x5b20('0x39')]({},_0x16ff2d,_0x296ae4[_0x5b20('0x3a')]);var _0x53abbf={'where':_0x16ff2d[_0x5b20('0x33')]};return db[_0x5b20('0x3b')][_0x5b20('0x1b')](_0x53abbf)[_0x5b20('0x20')](function(_0x368990){_0x444195[_0x5b20('0x1b')]=_0x368990;if(_0x296ae4[_0x5b20('0x28')][_0x5b20('0x3c')]){_0x16ff2d[_0x5b20('0x3d')]=[{'all':!![]}];}return db[_0x5b20('0x3b')][_0x5b20('0x3e')](_0x16ff2d);})[_0x5b20('0x20')](function(_0x5a41e5){_0x444195[_0x5b20('0x3f')]=_0x5a41e5;return _0x444195;})[_0x5b20('0x20')](respondWithFilteredResult(_0x50d335,_0x16ff2d))[_0x5b20('0x40')](handleError(_0x50d335,null));};exports[_0x5b20('0x41')]=function(_0x3658f0,_0x1f5285){var _0x452560={'raw':![],'where':{'id':_0x3658f0[_0x5b20('0x42')]['id']}},_0x107e7a={};_0x107e7a[_0x5b20('0x27')]=_[_0x5b20('0x29')](db[_0x5b20('0x3b')][_0x5b20('0x43')]);_0x107e7a[_0x5b20('0x28')]=_[_0x5b20('0x29')](_0x3658f0[_0x5b20('0x28')]);_0x107e7a[_0x5b20('0x34')]=_[_0x5b20('0x2a')](_0x107e7a[_0x5b20('0x27')],_0x107e7a[_0x5b20('0x28')]);_0x452560[_0x5b20('0x2b')]=_[_0x5b20('0x2a')](_0x107e7a[_0x5b20('0x27')],qs[_0x5b20('0x2c')](_0x3658f0[_0x5b20('0x28')][_0x5b20('0x2c')]));_0x452560[_0x5b20('0x2b')]=_0x452560['attributes'][_0x5b20('0x2d')]?_0x452560[_0x5b20('0x2b')]:_0x107e7a[_0x5b20('0x27')];if(_0x3658f0[_0x5b20('0x28')][_0x5b20('0x3c')]){_0x452560[_0x5b20('0x3d')]=[{'all':!![]}];}_0x452560=_[_0x5b20('0x39')]({},_0x452560,_0x3658f0['options']);return db[_0x5b20('0x3b')][_0x5b20('0x44')](_0x452560)[_0x5b20('0x20')](handleEntityNotFound(_0x1f5285,null))[_0x5b20('0x20')](respondWithResult(_0x1f5285,null))[_0x5b20('0x40')](handleError(_0x1f5285,null));};exports[_0x5b20('0x45')]=function(_0x34c18f,_0x56de2f){return db[_0x5b20('0x3b')][_0x5b20('0x45')](_0x34c18f['body'],{})[_0x5b20('0x20')](respondWithResult(_0x56de2f,0xc9))[_0x5b20('0x40')](handleError(_0x56de2f,null));};exports['bulkCreate']=function(_0x2b726c,_0x365af7){return db[_0x5b20('0x3b')][_0x5b20('0x46')](_0x2b726c[_0x5b20('0x47')],{'raw':![],'individualHooks':!![]})[_0x5b20('0x20')](respondWithResult(_0x365af7,0xc9))[_0x5b20('0x40')](handleError(_0x365af7,null));};exports[_0x5b20('0x48')]=function(_0x58bd13,_0xbb6a0b){if(_0x58bd13[_0x5b20('0x47')]['id']){delete _0x58bd13[_0x5b20('0x47')]['id'];}return db[_0x5b20('0x3b')][_0x5b20('0x44')]({'where':{'id':_0x58bd13[_0x5b20('0x42')]['id']}})['then'](handleEntityNotFound(_0xbb6a0b,null))[_0x5b20('0x20')](saveUpdates(_0x58bd13[_0x5b20('0x47')],null))['then'](respondWithResult(_0xbb6a0b,null))[_0x5b20('0x40')](handleError(_0xbb6a0b,null));};exports['destroy']=function(_0x110480,_0x3c224d){return db[_0x5b20('0x3b')][_0x5b20('0x44')]({'where':{'id':_0x110480['params']['id']}})[_0x5b20('0x20')](handleEntityNotFound(_0x3c224d,null))[_0x5b20('0x20')](removeEntity(_0x3c224d,null))[_0x5b20('0x40')](handleError(_0x3c224d,null));};exports[_0x5b20('0x49')]=function(_0x2cd012,_0x23eea9){return db[_0x5b20('0x3b')]['destroy']({'where':{'id':_0x2cd012['query'][_0x5b20('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x5b20('0x20')](respondWithResult(_0x23eea9,0xcc))[_0x5b20('0x40')](handleError(_0x23eea9,null));};exports['addFields']=function(_0x3a9280,_0x4063ff,_0x3ee8e7){return db['AnalyticCustomReport'][_0x5b20('0x4b')]({'where':{'id':_0x3a9280[_0x5b20('0x42')]['id']}})[_0x5b20('0x20')](handleEntityNotFound(_0x4063ff,null))['then'](function(_0x2d3a15){if(_0x2d3a15){return db['sequelize'][_0x5b20('0x4c')](function(_0x455e67){return db[_0x5b20('0x3b')][_0x5b20('0x4d')]({'where':{'CustomReportId':_0x3a9280['params']['id']},'transaction':_0x455e67})[_0x5b20('0x20')](function(_0x5416ab){var _0x15e8a1=_['map'](_0x3a9280['body'],function(_0x1afc20){delete _0x1afc20['id'];_0x1afc20[_0x5b20('0x4e')]=_0x3a9280[_0x5b20('0x42')]['id'];return _0x1afc20;});return db[_0x5b20('0x3b')]['bulkCreate'](_0x15e8a1,{'transaction':_0x455e67});});})['then'](function(){return db[_0x5b20('0x3b')][_0x5b20('0x3e')]({'where':{'CustomReportId':_0x3a9280[_0x5b20('0x42')]['id']}});});}})[_0x5b20('0x20')](respondWithResult(_0x4063ff,null))[_0x5b20('0x40')](handleError(_0x4063ff,null));}; \ No newline at end of file +var _0xa59b=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','bulkCreate','update','bulkDestroy','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','reject','destroy','then','end','sendStatus','error','stack','name','send','index','AnalyticFieldReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x3aeec2,_0x167576){var _0xbf0ef1=function(_0x18101d){while(--_0x18101d){_0x3aeec2['push'](_0x3aeec2['shift']());}};_0xbf0ef1(++_0x167576);}(_0xa59b,0x1aa));var _0xba59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa59b[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xba59('0x0'));var rimraf=require(_0xba59('0x1'));var zipdir=require(_0xba59('0x2'));var jsonpatch=require(_0xba59('0x3'));var rp=require(_0xba59('0x4'));var moment=require('moment');var BPromise=require(_0xba59('0x5'));var Mustache=require(_0xba59('0x6'));var util=require(_0xba59('0x7'));var path=require('path');var sox=require(_0xba59('0x8'));var csv=require('to-csv');var ejs=require(_0xba59('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xba59('0xa'));var deskjs=require(_0xba59('0xb'));var toCsv=require('to-csv');var querystring=require(_0xba59('0xc'));var Papa=require(_0xba59('0xd'));var Redis=require(_0xba59('0xe'));var authService=require(_0xba59('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xba59('0x10'));var hardwareService=require(_0xba59('0x11'));var logger=require(_0xba59('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xba59('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x521575,_0x5041f7){_0x5041f7=_0x5041f7||0xcc;return function(_0x43044d){if(_0x43044d){return _0x521575['sendStatus'](_0x5041f7);}return _0x521575[_0xba59('0x14')](_0x5041f7)['end']();};}function respondWithResult(_0x43483e,_0x48534a){_0x48534a=_0x48534a||0xc8;return function(_0x446b98){if(_0x446b98){return _0x43483e[_0xba59('0x14')](_0x48534a)[_0xba59('0x15')](_0x446b98);}};}function respondWithFilteredResult(_0x59a7bf,_0x2d76b0){return function(_0x42f1ff){if(_0x42f1ff){var _0x4f2b25=_0x42f1ff[_0xba59('0x16')],_0x251caf=_0x2d76b0['offset'],_0x57cae0=_0x2d76b0[_0xba59('0x17')]+_0x2d76b0[_0xba59('0x18')],_0x55b492;if(_0x57cae0>=_0x4f2b25){_0x57cae0=_0x4f2b25;_0x55b492=0xc8;}else{_0x55b492=0xce;}_0x59a7bf[_0xba59('0x14')](_0x55b492);return _0x59a7bf[_0xba59('0x19')](_0xba59('0x1a'),_0x251caf+'-'+_0x57cae0+'/'+_0x4f2b25)[_0xba59('0x15')](_0x42f1ff);}return null;};}function patchUpdates(_0x3ebdf4){return function(_0x2668e2){try{jsonpatch[_0xba59('0x1b')](_0x2668e2,_0x3ebdf4,!![]);}catch(_0x16a5ed){return BPromise[_0xba59('0x1c')](_0x16a5ed);}return _0x2668e2['save']();};}function saveUpdates(_0x56e3b6,_0x2db7bd){return function(_0x9b63a5){if(_0x9b63a5){return _0x9b63a5['update'](_0x56e3b6)['then'](function(_0x4b6948){return _0x4b6948;});}return null;};}function removeEntity(_0x4a173a,_0x324078){return function(_0x2e7d51){if(_0x2e7d51){return _0x2e7d51[_0xba59('0x1d')]()[_0xba59('0x1e')](function(){_0x4a173a['status'](0xcc)[_0xba59('0x1f')]();});}};}function handleEntityNotFound(_0x189ec4,_0x373f1d){return function(_0x1d510b){if(!_0x1d510b){_0x189ec4[_0xba59('0x20')](0x194);}return _0x1d510b;};}function handleError(_0x3778a4,_0x5ab51f){_0x5ab51f=_0x5ab51f||0x1f4;return function(_0x1f6aa7){logger[_0xba59('0x21')](_0x1f6aa7[_0xba59('0x22')]);if(_0x1f6aa7[_0xba59('0x23')]){delete _0x1f6aa7[_0xba59('0x23')];}_0x3778a4[_0xba59('0x14')](_0x5ab51f)[_0xba59('0x24')](_0x1f6aa7);};}exports[_0xba59('0x25')]=function(_0x5df506,_0x26a862){var _0x4343e3={},_0x22338b={},_0x8b2c9c={'count':0x0,'rows':[]};var _0x131b51=_['map'](db[_0xba59('0x26')]['rawAttributes'],function(_0x2e15f8){return{'name':_0x2e15f8[_0xba59('0x27')],'type':_0x2e15f8[_0xba59('0x28')][_0xba59('0x29')]};});_0x22338b[_0xba59('0x2a')]=_[_0xba59('0x2b')](_0x131b51,_0xba59('0x23'));_0x22338b[_0xba59('0x2c')]=_[_0xba59('0x2d')](_0x5df506['query']);_0x22338b[_0xba59('0x2e')]=_[_0xba59('0x2f')](_0x22338b[_0xba59('0x2a')],_0x22338b['query']);_0x4343e3[_0xba59('0x30')]=_[_0xba59('0x2f')](_0x22338b[_0xba59('0x2a')],qs[_0xba59('0x31')](_0x5df506['query'][_0xba59('0x31')]));_0x4343e3[_0xba59('0x30')]=_0x4343e3['attributes'][_0xba59('0x32')]?_0x4343e3[_0xba59('0x30')]:_0x22338b[_0xba59('0x2a')];if(!_0x5df506['query'][_0xba59('0x33')](_0xba59('0x34'))){_0x4343e3[_0xba59('0x18')]=qs[_0xba59('0x18')](_0x5df506[_0xba59('0x2c')]['limit']);_0x4343e3[_0xba59('0x17')]=qs[_0xba59('0x17')](_0x5df506[_0xba59('0x2c')][_0xba59('0x17')]);}_0x4343e3[_0xba59('0x35')]=qs['sort'](_0x5df506[_0xba59('0x2c')][_0xba59('0x36')]);_0x4343e3[_0xba59('0x37')]=qs[_0xba59('0x2e')](_[_0xba59('0x38')](_0x5df506[_0xba59('0x2c')],_0x22338b['filters']),_0x131b51);if(_0x5df506[_0xba59('0x2c')][_0xba59('0x39')]){_0x4343e3[_0xba59('0x37')]=_[_0xba59('0x3a')](_0x4343e3[_0xba59('0x37')],{'$or':_[_0xba59('0x2b')](_0x131b51,function(_0x74fa35){if(_0x74fa35[_0xba59('0x28')]!==_0xba59('0x3b')){var _0x4cbfde={};_0x4cbfde[_0x74fa35[_0xba59('0x23')]]={'$like':'%'+_0x5df506[_0xba59('0x2c')][_0xba59('0x39')]+'%'};return _0x4cbfde;}})});}_0x4343e3=_['merge']({},_0x4343e3,_0x5df506[_0xba59('0x3c')]);var _0x30f945={'where':_0x4343e3[_0xba59('0x37')]};return db[_0xba59('0x26')]['count'](_0x30f945)[_0xba59('0x1e')](function(_0xbb586){_0x8b2c9c[_0xba59('0x16')]=_0xbb586;if(_0x5df506[_0xba59('0x2c')][_0xba59('0x3d')]){_0x4343e3[_0xba59('0x3e')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xba59('0x3f')](_0x4343e3);})['then'](function(_0x1f7f59){_0x8b2c9c[_0xba59('0x40')]=_0x1f7f59;return _0x8b2c9c;})[_0xba59('0x1e')](respondWithFilteredResult(_0x26a862,_0x4343e3))[_0xba59('0x41')](handleError(_0x26a862,null));};exports[_0xba59('0x42')]=function(_0x1dd49f,_0x26537e){var _0x17171e={'raw':![],'where':{'id':_0x1dd49f[_0xba59('0x43')]['id']}},_0x4816eb={};_0x4816eb[_0xba59('0x2a')]=_[_0xba59('0x2d')](db[_0xba59('0x26')][_0xba59('0x44')]);_0x4816eb['query']=_[_0xba59('0x2d')](_0x1dd49f[_0xba59('0x2c')]);_0x4816eb['filters']=_[_0xba59('0x2f')](_0x4816eb['model'],_0x4816eb['query']);_0x17171e[_0xba59('0x30')]=_[_0xba59('0x2f')](_0x4816eb[_0xba59('0x2a')],qs['fields'](_0x1dd49f[_0xba59('0x2c')]['fields']));_0x17171e[_0xba59('0x30')]=_0x17171e[_0xba59('0x30')][_0xba59('0x32')]?_0x17171e['attributes']:_0x4816eb[_0xba59('0x2a')];if(_0x1dd49f[_0xba59('0x2c')]['includeAll']){_0x17171e[_0xba59('0x3e')]=[{'all':!![]}];}_0x17171e=_['merge']({},_0x17171e,_0x1dd49f['options']);return db['AnalyticFieldReport'][_0xba59('0x45')](_0x17171e)[_0xba59('0x1e')](handleEntityNotFound(_0x26537e,null))[_0xba59('0x1e')](respondWithResult(_0x26537e,null))[_0xba59('0x41')](handleError(_0x26537e,null));};exports[_0xba59('0x46')]=function(_0x447138,_0x4c2481){return db['AnalyticFieldReport'][_0xba59('0x46')](_0x447138[_0xba59('0x47')],{})[_0xba59('0x1e')](respondWithResult(_0x4c2481,0xc9))[_0xba59('0x41')](handleError(_0x4c2481,null));};exports[_0xba59('0x48')]=function(_0x398cf8,_0x16ac2d){return db[_0xba59('0x26')][_0xba59('0x48')](_0x398cf8[_0xba59('0x47')],{'raw':![],'individualHooks':!![]})[_0xba59('0x1e')](respondWithResult(_0x16ac2d,0xc9))['catch'](handleError(_0x16ac2d,null));};exports[_0xba59('0x49')]=function(_0x310da1,_0x2c377b){if(_0x310da1['body']['id']){delete _0x310da1[_0xba59('0x47')]['id'];}return db[_0xba59('0x26')][_0xba59('0x45')]({'where':{'id':_0x310da1['params']['id']}})[_0xba59('0x1e')](handleEntityNotFound(_0x2c377b,null))[_0xba59('0x1e')](saveUpdates(_0x310da1[_0xba59('0x47')],null))[_0xba59('0x1e')](respondWithResult(_0x2c377b,null))[_0xba59('0x41')](handleError(_0x2c377b,null));};exports[_0xba59('0x1d')]=function(_0x44aeaf,_0x5bbbb3){return db[_0xba59('0x26')][_0xba59('0x45')]({'where':{'id':_0x44aeaf[_0xba59('0x43')]['id']}})[_0xba59('0x1e')](handleEntityNotFound(_0x5bbbb3,null))[_0xba59('0x1e')](removeEntity(_0x5bbbb3,null))[_0xba59('0x41')](handleError(_0x5bbbb3,null));};exports[_0xba59('0x4a')]=function(_0x303870,_0x262af0){return db[_0xba59('0x26')][_0xba59('0x1d')]({'where':{'id':_0x303870['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0xba59('0x1e')](respondWithResult(_0x262af0,0xcc))[_0xba59('0x41')](handleError(_0x262af0,null));};exports[_0xba59('0x4b')]=function(_0x24f1ee,_0x52f03a,_0x3c4190){return db[_0xba59('0x4c')][_0xba59('0x4d')]({'where':{'id':_0x24f1ee[_0xba59('0x43')]['id']}})[_0xba59('0x1e')](handleEntityNotFound(_0x52f03a,null))[_0xba59('0x1e')](function(_0x197e68){if(_0x197e68){return db[_0xba59('0x4e')]['transaction'](function(_0x30bcfa){return db[_0xba59('0x26')]['destroy']({'where':{'CustomReportId':_0x24f1ee[_0xba59('0x43')]['id']},'transaction':_0x30bcfa})[_0xba59('0x1e')](function(_0x487338){var _0x35793b=_[_0xba59('0x2b')](_0x24f1ee[_0xba59('0x47')],function(_0x5e1dd5){delete _0x5e1dd5['id'];_0x5e1dd5[_0xba59('0x4f')]=_0x24f1ee['params']['id'];return _0x5e1dd5;});return db['AnalyticFieldReport']['bulkCreate'](_0x35793b,{'transaction':_0x30bcfa});});})[_0xba59('0x1e')](function(){return db[_0xba59('0x26')][_0xba59('0x3f')]({'where':{'CustomReportId':_0x24f1ee[_0xba59('0x43')]['id']}});});}})['then'](respondWithResult(_0x52f03a,null))['catch'](handleError(_0x52f03a,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 9fb3834..fd2113e 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 _0x6826=['AnalyticFieldReport','analytics_report_fields','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x6826,0x9e));var _0x6682=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x6826[_0x2ed8f3];return _0x525a55;};'use strict';var _=require('lodash');var util=require(_0x6682('0x0'));var logger=require(_0x6682('0x1'))(_0x6682('0x2'));var moment=require(_0x6682('0x3'));var BPromise=require('bluebird');var rp=require(_0x6682('0x4'));var fs=require('fs');var path=require(_0x6682('0x5'));var rimraf=require(_0x6682('0x6'));var config=require(_0x6682('0x7'));var attributes=require(_0x6682('0x8'));module[_0x6682('0x9')]=function(_0x327bd7,_0x1ca9fc){return _0x327bd7[_0x6682('0xa')](_0x6682('0xb'),attributes,{'tableName':_0x6682('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d0d=['exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x0d0d,0x107));var _0xd0d0=function(_0x10cdf8,_0x2e502f){_0x10cdf8=_0x10cdf8-0x0;var _0x18ac09=_0x0d0d[_0x10cdf8];return _0x18ac09;};'use strict';var _=require(_0xd0d0('0x0'));var util=require(_0xd0d0('0x1'));var logger=require(_0xd0d0('0x2'))(_0xd0d0('0x3'));var moment=require('moment');var BPromise=require(_0xd0d0('0x4'));var rp=require(_0xd0d0('0x5'));var fs=require('fs');var path=require(_0xd0d0('0x6'));var rimraf=require(_0xd0d0('0x7'));var config=require(_0xd0d0('0x8'));var attributes=require(_0xd0d0('0x9'));module[_0xd0d0('0xa')]=function(_0x435d49,_0x143c59){return _0x435d49['define'](_0xd0d0('0xb'),attributes,{'tableName':_0xd0d0('0xc'),'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 111fd17..e015271 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 _0xeab0=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x1a62d4,_0xc4f8b2){var _0x198d64=function(_0x20f080){while(--_0x20f080){_0x1a62d4['push'](_0x1a62d4['shift']());}};_0x198d64(++_0xc4f8b2);}(_0xeab0,0x193));var _0x0eab=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xeab0[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x0eab('0x0'));var util=require(_0x0eab('0x1'));var moment=require(_0x0eab('0x2'));var BPromise=require(_0x0eab('0x3'));var rs=require(_0x0eab('0x4'));var fs=require('fs');var Redis=require(_0x0eab('0x5'));var db=require(_0x0eab('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0eab('0x7'))(_0x0eab('0x8'));var config=require(_0x0eab('0x9'));var jayson=require(_0x0eab('0xa'));var client=jayson[_0x0eab('0xb')][_0x0eab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x461180,_0x51508e,_0xa66086){return new BPromise(function(_0x54e995,_0x137c8c){return client[_0x0eab('0xd')](_0x461180,_0xa66086)['then'](function(_0x5bc0f3){logger[_0x0eab('0xe')](_0x0eab('0xf'),_0x51508e,_0x0eab('0x10'));logger[_0x0eab('0x11')](_0x0eab('0x12'),_0x51508e,'request\x20sent',JSON[_0x0eab('0x13')](_0x5bc0f3));if(_0x5bc0f3[_0x0eab('0x14')]){if(_0x5bc0f3[_0x0eab('0x14')][_0x0eab('0x15')]===0x1f4){logger['error'](_0x0eab('0xf'),_0x51508e,_0x5bc0f3[_0x0eab('0x14')]['message']);return _0x137c8c(_0x5bc0f3[_0x0eab('0x14')][_0x0eab('0x16')]);}logger[_0x0eab('0x14')](_0x0eab('0xf'),_0x51508e,_0x5bc0f3[_0x0eab('0x14')][_0x0eab('0x16')]);return _0x54e995(_0x5bc0f3[_0x0eab('0x14')]['message']);}else{logger[_0x0eab('0xe')](_0x0eab('0xf'),_0x51508e,_0x0eab('0x10'));_0x54e995(_0x5bc0f3['result']['message']);}})[_0x0eab('0x17')](function(_0x41347e){logger[_0x0eab('0x14')]('AnalyticFieldReport,\x20%s,\x20%s',_0x51508e,_0x41347e);_0x137c8c(_0x41347e);});});} \ No newline at end of file +var _0x18e7=['../../config/logger','rpc','../../config/environment','client','http','request','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3ed957,_0x2c35ff){var _0x700f10=function(_0x2bb1b4){while(--_0x2bb1b4){_0x3ed957['push'](_0x3ed957['shift']());}};_0x700f10(++_0x2c35ff);}(_0x18e7,0x18a));var _0x718e=function(_0x916cd5,_0x5d1bda){_0x916cd5=_0x916cd5-0x0;var _0x16752f=_0x18e7[_0x916cd5];return _0x16752f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x718e('0x0'));var rs=require(_0x718e('0x1'));var fs=require('fs');var Redis=require(_0x718e('0x2'));var db=require(_0x718e('0x3'))['db'];var utils=require(_0x718e('0x4'));var logger=require(_0x718e('0x5'))(_0x718e('0x6'));var config=require(_0x718e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x718e('0x8')][_0x718e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x166d21,_0x4bda60,_0x54e7a9){return new BPromise(function(_0x16be34,_0x199ccd){return client[_0x718e('0xa')](_0x166d21,_0x54e7a9)['then'](function(_0x34bccf){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4bda60,'request\x20sent');logger[_0x718e('0xb')](_0x718e('0xc'),_0x4bda60,_0x718e('0xd'),JSON[_0x718e('0xe')](_0x34bccf));if(_0x34bccf[_0x718e('0xf')]){if(_0x34bccf[_0x718e('0xf')][_0x718e('0x10')]===0x1f4){logger['error'](_0x718e('0x11'),_0x4bda60,_0x34bccf[_0x718e('0xf')]['message']);return _0x199ccd(_0x34bccf[_0x718e('0xf')][_0x718e('0x12')]);}logger[_0x718e('0xf')](_0x718e('0x11'),_0x4bda60,_0x34bccf['error'][_0x718e('0x12')]);return _0x16be34(_0x34bccf[_0x718e('0xf')]['message']);}else{logger[_0x718e('0x13')](_0x718e('0x11'),_0x4bda60,_0x718e('0xd'));_0x16be34(_0x34bccf[_0x718e('0x14')][_0x718e('0x12')]);}})['catch'](function(_0xa8cfd6){logger[_0x718e('0xf')](_0x718e('0x11'),_0x4bda60,_0xa8cfd6);_0x199ccd(_0xa8cfd6);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index d3e20b7..3381efe 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 _0x3e74=['./analyticFieldReport.controller','get','isAuthenticated','index','show','post','create','/create_many','/:id/create_many','addFields','/:id','delete','/destroy_many','bulkDestroy','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service'];(function(_0x117821,_0xaa1933){var _0x4ae9ff=function(_0x253662){while(--_0x253662){_0x117821['push'](_0x117821['shift']());}};_0x4ae9ff(++_0xaa1933);}(_0x3e74,0x175));var _0x43e7=function(_0x21f991,_0x1111eb){_0x21f991=_0x21f991-0x0;var _0x3d3b86=_0x3e74[_0x21f991];return _0x3d3b86;};'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 auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['post'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x43e7('0xa')](_0x43e7('0xd'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router['put'](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller['update']);router[_0x43e7('0x10')](_0x43e7('0x11'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x12')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x13')]);module[_0x43e7('0x14')]=router; \ No newline at end of file +var _0x9957=['../../config/environment','get','isAuthenticated','index','/:id','post','/create_many','bulkCreate','/:id/create_many','put','update','delete','/destroy_many','bulkDestroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./analyticFieldReport.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0xc')]('/',auth[_0x7995('0x9')](),controller['create']);router[_0x7995('0xc')](_0x7995('0xd'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xc')](_0x7995('0xf'),auth[_0x7995('0x9')](),controller['addFields']);router[_0x7995('0x10')](_0x7995('0xb'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0x13'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x12')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('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 e8b50d2..2d28e04 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 _0x6c9f=['STRING','TEXT','sequelize'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x6c9f,0x16a));var _0xf6c9=function(_0xff6e9d,_0x730325){_0xff6e9d=_0xff6e9d-0x0;var _0x173ca6=_0x6c9f[_0xff6e9d];return _0x173ca6;};'use strict';var Sequelize=require(_0xf6c9('0x0'));module['exports']={'name':{'type':Sequelize[_0xf6c9('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xf6c9('0x1')]},'metric':{'type':Sequelize[_0xf6c9('0x2')]},'description':{'type':Sequelize[_0xf6c9('0x1')]}}; \ No newline at end of file +var _0x094c=['STRING','TEXT','exports'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x094c,0x131));var _0xc094=function(_0x2197c3,_0x310b38){_0x2197c3=_0x2197c3-0x0;var _0x120c87=_0x094c[_0x2197c3];return _0x120c87;};'use strict';var Sequelize=require('sequelize');module[_0xc094('0x0')]={'name':{'type':Sequelize[_0xc094('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xc094('0x1')]},'metric':{'type':Sequelize[_0xc094('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 5629766..46897b5 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 _0xef0f=['includeAll','include','AnalyticMetric','findAll','rows','show','params','keys','length','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','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','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','get','Metrics','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','type','key','query','filters','intersection','fields','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x8426a0,_0x183ad8){var _0x4f71e3=function(_0x3df1bb){while(--_0x3df1bb){_0x8426a0['push'](_0x8426a0['shift']());}};_0x4f71e3(++_0x183ad8);}(_0xef0f,0x168));var _0xfef0=function(_0x3b7ac6,_0x501f60){_0x3b7ac6=_0x3b7ac6-0x0;var _0x45a3f0=_0xef0f[_0x3b7ac6];return _0x45a3f0;};'use strict';var pdf=require(_0xfef0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfef0('0x1'));var zipdir=require(_0xfef0('0x2'));var jsonpatch=require(_0xfef0('0x3'));var rp=require('request-promise');var moment=require(_0xfef0('0x4'));var BPromise=require(_0xfef0('0x5'));var Mustache=require(_0xfef0('0x6'));var util=require('util');var path=require(_0xfef0('0x7'));var sox=require(_0xfef0('0x8'));var csv=require(_0xfef0('0x9'));var ejs=require(_0xfef0('0xa'));var fs=require('fs');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('0x9'));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 db=require(_0xfef0('0x19'))['db'];function respondWithStatusCode(_0x1bdb7b,_0x546c7a){_0x546c7a=_0x546c7a||0xcc;return function(_0x3135ab){if(_0x3135ab){return _0x1bdb7b[_0xfef0('0x1a')](_0x546c7a);}return _0x1bdb7b[_0xfef0('0x1b')](_0x546c7a)[_0xfef0('0x1c')]();};}function respondWithResult(_0xe9f78d,_0x45599a){_0x45599a=_0x45599a||0xc8;return function(_0xa9f040){if(_0xa9f040){return _0xe9f78d['status'](_0x45599a)[_0xfef0('0x1d')](_0xa9f040);}};}function respondWithFilteredResult(_0x554aaa,_0x4b5bcf){return function(_0x5acdd0){if(_0x5acdd0){var _0x118b8d=_0x5acdd0[_0xfef0('0x1e')],_0x284b6d=_0x4b5bcf[_0xfef0('0x1f')],_0x3510a7=_0x4b5bcf[_0xfef0('0x1f')]+_0x4b5bcf[_0xfef0('0x20')],_0x1bce2f;if(_0x3510a7>=_0x118b8d){_0x3510a7=_0x118b8d;_0x1bce2f=0xc8;}else{_0x1bce2f=0xce;}_0x554aaa['status'](_0x1bce2f);return _0x554aaa[_0xfef0('0x21')](_0xfef0('0x22'),_0x284b6d+'-'+_0x3510a7+'/'+_0x118b8d)[_0xfef0('0x1d')](_0x5acdd0);}return null;};}function patchUpdates(_0x39f9d3){return function(_0x1ad020){try{jsonpatch['apply'](_0x1ad020,_0x39f9d3,!![]);}catch(_0x5283e1){return BPromise['reject'](_0x5283e1);}return _0x1ad020[_0xfef0('0x23')]();};}function saveUpdates(_0x1a0aa0,_0x28dee1){return function(_0x48408a){if(_0x48408a){return _0x48408a[_0xfef0('0x24')](_0x1a0aa0)['then'](function(_0x4074b7){return _0x4074b7;});}return null;};}function removeEntity(_0x394fbc,_0x52b93b){return function(_0x4897af){if(_0x4897af){return _0x4897af['destroy']()[_0xfef0('0x25')](function(){var _0x4faea8=_0x4897af[_0xfef0('0x26')]({'plain':!![]});var _0x46b34a=_0xfef0('0x27');return db[_0xfef0('0x28')][_0xfef0('0x29')]({'where':{'type':_0x46b34a,'resourceId':_0x4faea8['id']}})[_0xfef0('0x25')](function(){return _0x4897af;});})['then'](function(){_0x394fbc['status'](0xcc)[_0xfef0('0x1c')]();});}};}function handleEntityNotFound(_0x1ffaa4,_0x924f6e){return function(_0x34ca65){if(!_0x34ca65){_0x1ffaa4[_0xfef0('0x1a')](0x194);}return _0x34ca65;};}function handleError(_0xf60f2,_0x5df04f){_0x5df04f=_0x5df04f||0x1f4;return function(_0x168b98){logger[_0xfef0('0x2a')](_0x168b98['stack']);if(_0x168b98[_0xfef0('0x2b')]){delete _0x168b98[_0xfef0('0x2b')];}_0xf60f2[_0xfef0('0x1b')](_0x5df04f)[_0xfef0('0x2c')](_0x168b98);};}exports[_0xfef0('0x2d')]=function(_0x1ac4a3,_0x3e3c4c){var _0x3e026a={},_0x26cb9a={},_0x213a91={'count':0x0,'rows':[]};var _0x3ee42f=_[_0xfef0('0x2e')](db['AnalyticMetric'][_0xfef0('0x2f')],function(_0x5806bd){return{'name':_0x5806bd['fieldName'],'type':_0x5806bd[_0xfef0('0x30')][_0xfef0('0x31')]};});_0x26cb9a['model']=_['map'](_0x3ee42f,'name');_0x26cb9a['query']=_['keys'](_0x1ac4a3[_0xfef0('0x32')]);_0x26cb9a[_0xfef0('0x33')]=_[_0xfef0('0x34')](_0x26cb9a['model'],_0x26cb9a['query']);_0x3e026a['attributes']=_[_0xfef0('0x34')](_0x26cb9a['model'],qs[_0xfef0('0x35')](_0x1ac4a3[_0xfef0('0x32')][_0xfef0('0x35')]));_0x3e026a['attributes']=_0x3e026a[_0xfef0('0x36')]['length']?_0x3e026a[_0xfef0('0x36')]:_0x26cb9a[_0xfef0('0x37')];if(!_0x1ac4a3[_0xfef0('0x32')][_0xfef0('0x38')](_0xfef0('0x39'))){_0x3e026a[_0xfef0('0x20')]=qs[_0xfef0('0x20')](_0x1ac4a3[_0xfef0('0x32')]['limit']);_0x3e026a[_0xfef0('0x1f')]=qs[_0xfef0('0x1f')](_0x1ac4a3[_0xfef0('0x32')][_0xfef0('0x1f')]);}_0x3e026a[_0xfef0('0x3a')]=qs[_0xfef0('0x3b')](_0x1ac4a3[_0xfef0('0x32')][_0xfef0('0x3b')]);_0x3e026a[_0xfef0('0x3c')]=qs[_0xfef0('0x33')](_[_0xfef0('0x3d')](_0x1ac4a3[_0xfef0('0x32')],_0x26cb9a[_0xfef0('0x33')]),_0x3ee42f);if(_0x1ac4a3['query'][_0xfef0('0x3e')]){_0x3e026a['where']=_[_0xfef0('0x3f')](_0x3e026a[_0xfef0('0x3c')],{'$or':_[_0xfef0('0x2e')](_0x3ee42f,function(_0x4ab401){if(_0x4ab401[_0xfef0('0x30')]!==_0xfef0('0x40')){var _0x3f2753={};_0x3f2753[_0x4ab401['name']]={'$like':'%'+_0x1ac4a3[_0xfef0('0x32')][_0xfef0('0x3e')]+'%'};return _0x3f2753;}})});}_0x3e026a=_[_0xfef0('0x3f')]({},_0x3e026a,_0x1ac4a3['options']);var _0x3a6667={'where':_0x3e026a['where']};return db['AnalyticMetric'][_0xfef0('0x1e')](_0x3a6667)['then'](function(_0x5c3305){_0x213a91[_0xfef0('0x1e')]=_0x5c3305;if(_0x1ac4a3[_0xfef0('0x32')][_0xfef0('0x41')]){_0x3e026a[_0xfef0('0x42')]=[{'all':!![]}];}return db[_0xfef0('0x43')][_0xfef0('0x44')](_0x3e026a);})['then'](function(_0x417f13){_0x213a91[_0xfef0('0x45')]=_0x417f13;return _0x213a91;})['then'](respondWithFilteredResult(_0x3e3c4c,_0x3e026a))['catch'](handleError(_0x3e3c4c,null));};exports[_0xfef0('0x46')]=function(_0x5dc824,_0x1fc518){var _0x22c940={'raw':!![],'where':{'id':_0x5dc824[_0xfef0('0x47')]['id']}},_0x3c100c={};_0x3c100c[_0xfef0('0x37')]=_[_0xfef0('0x48')](db[_0xfef0('0x43')][_0xfef0('0x2f')]);_0x3c100c['query']=_[_0xfef0('0x48')](_0x5dc824['query']);_0x3c100c['filters']=_[_0xfef0('0x34')](_0x3c100c[_0xfef0('0x37')],_0x3c100c['query']);_0x22c940[_0xfef0('0x36')]=_['intersection'](_0x3c100c[_0xfef0('0x37')],qs[_0xfef0('0x35')](_0x5dc824[_0xfef0('0x32')][_0xfef0('0x35')]));_0x22c940['attributes']=_0x22c940[_0xfef0('0x36')][_0xfef0('0x49')]?_0x22c940['attributes']:_0x3c100c['model'];if(_0x5dc824[_0xfef0('0x32')]['includeAll']){_0x22c940[_0xfef0('0x42')]=[{'all':!![]}];}_0x22c940=_[_0xfef0('0x3f')]({},_0x22c940,_0x5dc824[_0xfef0('0x4a')]);return db[_0xfef0('0x43')][_0xfef0('0x4b')](_0x22c940)[_0xfef0('0x25')](handleEntityNotFound(_0x1fc518,null))['then'](respondWithResult(_0x1fc518,null))[_0xfef0('0x4c')](handleError(_0x1fc518,null));};exports['create']=function(_0x5a417e,_0x2f11cb){return db[_0xfef0('0x43')][_0xfef0('0x4d')](_0x5a417e['body'],{})[_0xfef0('0x25')](function(_0x4e1271){var _0x5dd26b=_0x5a417e['user'][_0xfef0('0x26')]({'plain':!![]});if(!_0x5dd26b)throw new Error(_0xfef0('0x4e'));if(_0x5dd26b[_0xfef0('0x4f')]===_0xfef0('0x50')){var _0x2712e9=_0x4e1271[_0xfef0('0x26')]({'plain':!![]});var _0x1b78af=_0xfef0('0x27');return db[_0xfef0('0x51')]['find']({'where':{'name':_0x1b78af,'userProfileId':_0x5dd26b['userProfileId']},'raw':!![]})[_0xfef0('0x25')](function(_0x18e5ba){if(_0x18e5ba&&_0x18e5ba[_0xfef0('0x52')]===0x0){return db[_0xfef0('0x28')][_0xfef0('0x4d')]({'name':_0x2712e9[_0xfef0('0x2b')],'resourceId':_0x2712e9['id'],'type':_0x18e5ba[_0xfef0('0x2b')],'sectionId':_0x18e5ba['id']},{})[_0xfef0('0x25')](function(){return _0x4e1271;});}else{return _0x4e1271;}})['catch'](function(_0x2466e7){logger[_0xfef0('0x2a')](_0xfef0('0x53'),_0x2466e7);throw _0x2466e7;});}return _0x4e1271;})[_0xfef0('0x25')](respondWithResult(_0x2f11cb,0xc9))[_0xfef0('0x4c')](handleError(_0x2f11cb,null));};exports['update']=function(_0x5b3592,_0x523763){if(_0x5b3592[_0xfef0('0x54')]['id']){delete _0x5b3592[_0xfef0('0x54')]['id'];}return db[_0xfef0('0x43')][_0xfef0('0x4b')]({'where':{'id':_0x5b3592['params']['id']}})[_0xfef0('0x25')](handleEntityNotFound(_0x523763,null))[_0xfef0('0x25')](saveUpdates(_0x5b3592[_0xfef0('0x54')],null))[_0xfef0('0x25')](respondWithResult(_0x523763,null))[_0xfef0('0x4c')](handleError(_0x523763,null));};exports[_0xfef0('0x29')]=function(_0x282a18,_0x4cd0fd){return db[_0xfef0('0x43')][_0xfef0('0x4b')]({'where':{'id':_0x282a18['params']['id']}})[_0xfef0('0x25')](handleEntityNotFound(_0x4cd0fd,null))['then'](removeEntity(_0x4cd0fd,null))[_0xfef0('0x4c')](handleError(_0x4cd0fd,null));}; \ No newline at end of file +var _0x9ccd=['user','userProfileId','autoAssociation','body','html-pdf','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','count','include','findAll','rows','params','intersection','includeAll','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x2fefdc,_0x8160c9){var _0xf3823a=function(_0x118d21){while(--_0x118d21){_0x2fefdc['push'](_0x2fefdc['shift']());}};_0xf3823a(++_0x8160c9);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xd9cc('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd9cc('0x1'));var zipdir=require(_0xd9cc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd9cc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd9cc('0x4'));var util=require(_0xd9cc('0x5'));var path=require(_0xd9cc('0x6'));var sox=require(_0xd9cc('0x7'));var csv=require(_0xd9cc('0x8'));var ejs=require(_0xd9cc('0x9'));var fs=require('fs');var _=require(_0xd9cc('0xa'));var squel=require(_0xd9cc('0xb'));var crypto=require(_0xd9cc('0xc'));var jsforce=require(_0xd9cc('0xd'));var deskjs=require(_0xd9cc('0xe'));var toCsv=require(_0xd9cc('0x8'));var querystring=require(_0xd9cc('0xf'));var Papa=require(_0xd9cc('0x10'));var Redis=require(_0xd9cc('0x11'));var authService=require(_0xd9cc('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd9cc('0x13'));var hardwareService=require(_0xd9cc('0x14'));var logger=require(_0xd9cc('0x15'))(_0xd9cc('0x16'));var utils=require(_0xd9cc('0x17'));var config=require(_0xd9cc('0x18'));var db=require(_0xd9cc('0x19'))['db'];function respondWithStatusCode(_0x2afe71,_0x5432d3){_0x5432d3=_0x5432d3||0xcc;return function(_0x11c8bb){if(_0x11c8bb){return _0x2afe71['sendStatus'](_0x5432d3);}return _0x2afe71['status'](_0x5432d3)['end']();};}function respondWithResult(_0x58791d,_0x4f7e55){_0x4f7e55=_0x4f7e55||0xc8;return function(_0x44350f){if(_0x44350f){return _0x58791d[_0xd9cc('0x1a')](_0x4f7e55)[_0xd9cc('0x1b')](_0x44350f);}};}function respondWithFilteredResult(_0x1e0634,_0x863d0b){return function(_0x425cd1){if(_0x425cd1){var _0x14de50=_0x425cd1['count'],_0x5a39ac=_0x863d0b[_0xd9cc('0x1c')],_0x91b969=_0x863d0b[_0xd9cc('0x1c')]+_0x863d0b[_0xd9cc('0x1d')],_0x321a6a;if(_0x91b969>=_0x14de50){_0x91b969=_0x14de50;_0x321a6a=0xc8;}else{_0x321a6a=0xce;}_0x1e0634[_0xd9cc('0x1a')](_0x321a6a);return _0x1e0634['set'](_0xd9cc('0x1e'),_0x5a39ac+'-'+_0x91b969+'/'+_0x14de50)[_0xd9cc('0x1b')](_0x425cd1);}return null;};}function patchUpdates(_0x4fa645){return function(_0x7d8977){try{jsonpatch[_0xd9cc('0x1f')](_0x7d8977,_0x4fa645,!![]);}catch(_0x1d420f){return BPromise[_0xd9cc('0x20')](_0x1d420f);}return _0x7d8977[_0xd9cc('0x21')]();};}function saveUpdates(_0xd69057,_0x59f00d){return function(_0x57266f){if(_0x57266f){return _0x57266f[_0xd9cc('0x22')](_0xd69057)[_0xd9cc('0x23')](function(_0x3ccccd){return _0x3ccccd;});}return null;};}function removeEntity(_0x238652,_0x1fa267){return function(_0x426a5c){if(_0x426a5c){return _0x426a5c[_0xd9cc('0x24')]()[_0xd9cc('0x23')](function(){var _0x14c36a=_0x426a5c[_0xd9cc('0x25')]({'plain':!![]});var _0x43f91c=_0xd9cc('0x26');return db[_0xd9cc('0x27')][_0xd9cc('0x24')]({'where':{'type':_0x43f91c,'resourceId':_0x14c36a['id']}})['then'](function(){return _0x426a5c;});})[_0xd9cc('0x23')](function(){_0x238652[_0xd9cc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3128b1,_0x1f2727){return function(_0xe78722){if(!_0xe78722){_0x3128b1[_0xd9cc('0x28')](0x194);}return _0xe78722;};}function handleError(_0x3dff40,_0x26040f){_0x26040f=_0x26040f||0x1f4;return function(_0x13a163){logger[_0xd9cc('0x29')](_0x13a163[_0xd9cc('0x2a')]);if(_0x13a163['name']){delete _0x13a163[_0xd9cc('0x2b')];}_0x3dff40[_0xd9cc('0x1a')](_0x26040f)[_0xd9cc('0x2c')](_0x13a163);};}exports[_0xd9cc('0x2d')]=function(_0xfcd78c,_0xef1497){var _0xa01bf4={},_0x10a7b1={},_0x51da89={'count':0x0,'rows':[]};var _0x4284a7=_[_0xd9cc('0x2e')](db[_0xd9cc('0x2f')][_0xd9cc('0x30')],function(_0x17bcf8){return{'name':_0x17bcf8[_0xd9cc('0x31')],'type':_0x17bcf8['type'][_0xd9cc('0x32')]};});_0x10a7b1['model']=_['map'](_0x4284a7,_0xd9cc('0x2b'));_0x10a7b1[_0xd9cc('0x33')]=_[_0xd9cc('0x34')](_0xfcd78c['query']);_0x10a7b1[_0xd9cc('0x35')]=_['intersection'](_0x10a7b1[_0xd9cc('0x36')],_0x10a7b1[_0xd9cc('0x33')]);_0xa01bf4[_0xd9cc('0x37')]=_['intersection'](_0x10a7b1[_0xd9cc('0x36')],qs[_0xd9cc('0x38')](_0xfcd78c[_0xd9cc('0x33')]['fields']));_0xa01bf4[_0xd9cc('0x37')]=_0xa01bf4[_0xd9cc('0x37')][_0xd9cc('0x39')]?_0xa01bf4[_0xd9cc('0x37')]:_0x10a7b1[_0xd9cc('0x36')];if(!_0xfcd78c[_0xd9cc('0x33')][_0xd9cc('0x3a')]('nolimit')){_0xa01bf4[_0xd9cc('0x1d')]=qs[_0xd9cc('0x1d')](_0xfcd78c[_0xd9cc('0x33')]['limit']);_0xa01bf4[_0xd9cc('0x1c')]=qs[_0xd9cc('0x1c')](_0xfcd78c[_0xd9cc('0x33')][_0xd9cc('0x1c')]);}_0xa01bf4['order']=qs[_0xd9cc('0x3b')](_0xfcd78c[_0xd9cc('0x33')][_0xd9cc('0x3b')]);_0xa01bf4[_0xd9cc('0x3c')]=qs[_0xd9cc('0x35')](_[_0xd9cc('0x3d')](_0xfcd78c[_0xd9cc('0x33')],_0x10a7b1[_0xd9cc('0x35')]),_0x4284a7);if(_0xfcd78c[_0xd9cc('0x33')][_0xd9cc('0x3e')]){_0xa01bf4[_0xd9cc('0x3c')]=_['merge'](_0xa01bf4[_0xd9cc('0x3c')],{'$or':_[_0xd9cc('0x2e')](_0x4284a7,function(_0x2443f0){if(_0x2443f0[_0xd9cc('0x3f')]!==_0xd9cc('0x40')){var _0x2e5e71={};_0x2e5e71[_0x2443f0['name']]={'$like':'%'+_0xfcd78c[_0xd9cc('0x33')][_0xd9cc('0x3e')]+'%'};return _0x2e5e71;}})});}_0xa01bf4=_[_0xd9cc('0x41')]({},_0xa01bf4,_0xfcd78c[_0xd9cc('0x42')]);var _0x4af656={'where':_0xa01bf4[_0xd9cc('0x3c')]};return db[_0xd9cc('0x2f')]['count'](_0x4af656)[_0xd9cc('0x23')](function(_0x1ff420){_0x51da89[_0xd9cc('0x43')]=_0x1ff420;if(_0xfcd78c[_0xd9cc('0x33')]['includeAll']){_0xa01bf4[_0xd9cc('0x44')]=[{'all':!![]}];}return db[_0xd9cc('0x2f')][_0xd9cc('0x45')](_0xa01bf4);})[_0xd9cc('0x23')](function(_0x3e7090){_0x51da89[_0xd9cc('0x46')]=_0x3e7090;return _0x51da89;})['then'](respondWithFilteredResult(_0xef1497,_0xa01bf4))['catch'](handleError(_0xef1497,null));};exports['show']=function(_0x2d063c,_0x484d2c){var _0x5ebb93={'raw':!![],'where':{'id':_0x2d063c[_0xd9cc('0x47')]['id']}},_0x54b282={};_0x54b282['model']=_['keys'](db['AnalyticMetric'][_0xd9cc('0x30')]);_0x54b282[_0xd9cc('0x33')]=_[_0xd9cc('0x34')](_0x2d063c['query']);_0x54b282['filters']=_[_0xd9cc('0x48')](_0x54b282[_0xd9cc('0x36')],_0x54b282[_0xd9cc('0x33')]);_0x5ebb93[_0xd9cc('0x37')]=_[_0xd9cc('0x48')](_0x54b282[_0xd9cc('0x36')],qs[_0xd9cc('0x38')](_0x2d063c[_0xd9cc('0x33')][_0xd9cc('0x38')]));_0x5ebb93[_0xd9cc('0x37')]=_0x5ebb93[_0xd9cc('0x37')][_0xd9cc('0x39')]?_0x5ebb93[_0xd9cc('0x37')]:_0x54b282[_0xd9cc('0x36')];if(_0x2d063c['query'][_0xd9cc('0x49')]){_0x5ebb93[_0xd9cc('0x44')]=[{'all':!![]}];}_0x5ebb93=_[_0xd9cc('0x41')]({},_0x5ebb93,_0x2d063c[_0xd9cc('0x42')]);return db['AnalyticMetric'][_0xd9cc('0x4a')](_0x5ebb93)[_0xd9cc('0x23')](handleEntityNotFound(_0x484d2c,null))['then'](respondWithResult(_0x484d2c,null))[_0xd9cc('0x4b')](handleError(_0x484d2c,null));};exports[_0xd9cc('0x4c')]=function(_0x3654c4,_0x521346){return db[_0xd9cc('0x2f')][_0xd9cc('0x4c')](_0x3654c4['body'],{})[_0xd9cc('0x23')](function(_0x57046b){var _0x1eb61b=_0x3654c4['user'][_0xd9cc('0x25')]({'plain':!![]});if(!_0x1eb61b)throw new Error(_0xd9cc('0x4d'));if(_0x1eb61b[_0xd9cc('0x4e')]===_0xd9cc('0x4f')){var _0x26d90b=_0x57046b[_0xd9cc('0x25')]({'plain':!![]});var _0x334057=_0xd9cc('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x334057,'userProfileId':_0x1eb61b[_0xd9cc('0x50')]},'raw':!![]})[_0xd9cc('0x23')](function(_0x1ebb4c){if(_0x1ebb4c&&_0x1ebb4c[_0xd9cc('0x51')]===0x0){return db[_0xd9cc('0x27')][_0xd9cc('0x4c')]({'name':_0x26d90b[_0xd9cc('0x2b')],'resourceId':_0x26d90b['id'],'type':_0x1ebb4c[_0xd9cc('0x2b')],'sectionId':_0x1ebb4c['id']},{})[_0xd9cc('0x23')](function(){return _0x57046b;});}else{return _0x57046b;}})[_0xd9cc('0x4b')](function(_0x312714){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x312714);throw _0x312714;});}return _0x57046b;})[_0xd9cc('0x23')](respondWithResult(_0x521346,0xc9))['catch'](handleError(_0x521346,null));};exports[_0xd9cc('0x22')]=function(_0x5a0133,_0x548763){if(_0x5a0133[_0xd9cc('0x52')]['id']){delete _0x5a0133[_0xd9cc('0x52')]['id'];}return db[_0xd9cc('0x2f')][_0xd9cc('0x4a')]({'where':{'id':_0x5a0133[_0xd9cc('0x47')]['id']}})[_0xd9cc('0x23')](handleEntityNotFound(_0x548763,null))[_0xd9cc('0x23')](saveUpdates(_0x5a0133[_0xd9cc('0x52')],null))['then'](respondWithResult(_0x548763,null))[_0xd9cc('0x4b')](handleError(_0x548763,null));};exports[_0xd9cc('0x24')]=function(_0x51565f,_0x2defa4){return db[_0xd9cc('0x2f')][_0xd9cc('0x4a')]({'where':{'id':_0x51565f[_0xd9cc('0x47')]['id']}})[_0xd9cc('0x23')](handleEntityNotFound(_0x2defa4,null))['then'](removeEntity(_0x2defa4,null))[_0xd9cc('0x4b')](handleError(_0x2defa4,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 4ffbc10..726bb52 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 _0xc52b=['./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2e7b72,_0x5955a8){var _0xcc4d8d=function(_0x26d3c8){while(--_0x26d3c8){_0x2e7b72['push'](_0x2e7b72['shift']());}};_0xcc4d8d(++_0x5955a8);}(_0xc52b,0x1d6));var _0xbc52=function(_0x15b0fd,_0x174b0e){_0x15b0fd=_0x15b0fd-0x0;var _0x2bef46=_0xc52b[_0x15b0fd];return _0x2bef46;};'use strict';var _=require(_0xbc52('0x0'));var util=require(_0xbc52('0x1'));var logger=require(_0xbc52('0x2'))(_0xbc52('0x3'));var moment=require(_0xbc52('0x4'));var BPromise=require(_0xbc52('0x5'));var rp=require(_0xbc52('0x6'));var fs=require('fs');var path=require(_0xbc52('0x7'));var rimraf=require(_0xbc52('0x8'));var config=require(_0xbc52('0x9'));var attributes=require(_0xbc52('0xa'));module[_0xbc52('0xb')]=function(_0x3ce315,_0xb09d12){return _0x3ce315[_0xbc52('0xc')](_0xbc52('0xd'),attributes,{'tableName':_0xbc52('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x136a=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment'];(function(_0x180bc5,_0x17fd8d){var _0x310566=function(_0x5cf9fd){while(--_0x5cf9fd){_0x180bc5['push'](_0x180bc5['shift']());}};_0x310566(++_0x17fd8d);}(_0x136a,0xe9));var _0xa136=function(_0x3a8212,_0x3eafc0){_0x3a8212=_0x3a8212-0x0;var _0x423dd4=_0x136a[_0x3a8212];return _0x423dd4;};'use strict';var _=require(_0xa136('0x0'));var util=require(_0xa136('0x1'));var logger=require(_0xa136('0x2'))(_0xa136('0x3'));var moment=require(_0xa136('0x4'));var BPromise=require('bluebird');var rp=require(_0xa136('0x5'));var fs=require('fs');var path=require(_0xa136('0x6'));var rimraf=require(_0xa136('0x7'));var config=require(_0xa136('0x8'));var attributes=require(_0xa136('0x9'));module[_0xa136('0xa')]=function(_0x29e918,_0x14f725){return _0x29e918[_0xa136('0xb')](_0xa136('0xc'),attributes,{'tableName':_0xa136('0xd'),'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 c4d9b49..e8b0b7d 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 _0x8264=['rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticMetric,\x20%s,\x20%s','info','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xd158dc,_0x128608){var _0x12d25f=function(_0x2e9d2b){while(--_0x2e9d2b){_0xd158dc['push'](_0xd158dc['shift']());}};_0x12d25f(++_0x128608);}(_0x8264,0x1c1));var _0x4826=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0x8264[_0x2bddf9];return _0x3f3ae9;};'use strict';var _=require(_0x4826('0x0'));var util=require(_0x4826('0x1'));var moment=require(_0x4826('0x2'));var BPromise=require('bluebird');var rs=require(_0x4826('0x3'));var fs=require('fs');var Redis=require(_0x4826('0x4'));var db=require(_0x4826('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4826('0x6'))(_0x4826('0x7'));var config=require(_0x4826('0x8'));var jayson=require(_0x4826('0x9'));var client=jayson[_0x4826('0xa')][_0x4826('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a4a3d,_0x54daf7,_0x2480e1){return new BPromise(function(_0x8864ec,_0x4c0dbe){return client[_0x4826('0xc')](_0x4a4a3d,_0x2480e1)[_0x4826('0xd')](function(_0x49575f){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x54daf7,_0x4826('0xe'));logger[_0x4826('0xf')](_0x4826('0x10'),_0x54daf7,'request\x20sent',JSON[_0x4826('0x11')](_0x49575f));if(_0x49575f[_0x4826('0x12')]){if(_0x49575f['error'][_0x4826('0x13')]===0x1f4){logger[_0x4826('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x54daf7,_0x49575f[_0x4826('0x12')][_0x4826('0x14')]);return _0x4c0dbe(_0x49575f['error'][_0x4826('0x14')]);}logger[_0x4826('0x12')](_0x4826('0x15'),_0x54daf7,_0x49575f[_0x4826('0x12')]['message']);return _0x8864ec(_0x49575f[_0x4826('0x12')][_0x4826('0x14')]);}else{logger[_0x4826('0x16')](_0x4826('0x15'),_0x54daf7,_0x4826('0xe'));_0x8864ec(_0x49575f[_0x4826('0x17')][_0x4826('0x14')]);}})['catch'](function(_0x3d5bbd){logger[_0x4826('0x12')](_0x4826('0x15'),_0x54daf7,_0x3d5bbd);_0x4c0dbe(_0x3d5bbd);});});} \ No newline at end of file +var _0x739c=['../../config/environment','jayson/promise','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x8631a7,_0x57f6e3){var _0x18fc1a=function(_0x5dfe9c){while(--_0x5dfe9c){_0x8631a7['push'](_0x8631a7['shift']());}};_0x18fc1a(++_0x57f6e3);}(_0x739c,0x160));var _0xc739=function(_0x507fad,_0x4c7d31){_0x507fad=_0x507fad-0x0;var _0x520db6=_0x739c[_0x507fad];return _0x520db6;};'use strict';var _=require(_0xc739('0x0'));var util=require(_0xc739('0x1'));var moment=require(_0xc739('0x2'));var BPromise=require(_0xc739('0x3'));var rs=require(_0xc739('0x4'));var fs=require('fs');var Redis=require(_0xc739('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc739('0x6'));var logger=require(_0xc739('0x7'))('rpc');var config=require(_0xc739('0x8'));var jayson=require(_0xc739('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ce04c,_0x7c9866,_0x5a7acd){return new BPromise(function(_0x11f5b9,_0x5f7e07){return client[_0xc739('0xa')](_0x3ce04c,_0x5a7acd)['then'](function(_0x5c21ae){logger[_0xc739('0xb')](_0xc739('0xc'),_0x7c9866,'request\x20sent');logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x7c9866,_0xc739('0xd'),JSON[_0xc739('0xe')](_0x5c21ae));if(_0x5c21ae[_0xc739('0xf')]){if(_0x5c21ae[_0xc739('0xf')][_0xc739('0x10')]===0x1f4){logger[_0xc739('0xf')](_0xc739('0xc'),_0x7c9866,_0x5c21ae[_0xc739('0xf')][_0xc739('0x11')]);return _0x5f7e07(_0x5c21ae['error']['message']);}logger[_0xc739('0xf')](_0xc739('0xc'),_0x7c9866,_0x5c21ae[_0xc739('0xf')][_0xc739('0x11')]);return _0x11f5b9(_0x5c21ae[_0xc739('0xf')]['message']);}else{logger[_0xc739('0xb')](_0xc739('0xc'),_0x7c9866,_0xc739('0xd'));_0x11f5b9(_0x5c21ae[_0xc739('0x12')][_0xc739('0x11')]);}})[_0xc739('0x13')](function(_0x27de66){logger[_0xc739('0xf')](_0xc739('0xc'),_0x7c9866,_0x27de66);_0x5f7e07(_0x27de66);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 2f3fa89..7273d42 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 _0x326f=['show','post','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0x326f,0xd1));var _0xf326=function(_0x233f99,_0x5f1347){_0x233f99=_0x233f99-0x0;var _0x662b3a=_0x326f[_0x233f99];return _0x662b3a;};'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 auth=require(_0xf326('0x4'));var interaction=require(_0xf326('0x5'));var config=require(_0xf326('0x6'));var controller=require(_0xf326('0x7'));router[_0xf326('0x8')]('/',auth[_0xf326('0x9')](),controller[_0xf326('0xa')]);router['get'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xc')]);router[_0xf326('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xf326('0xb'),auth[_0xf326('0x9')](),controller[_0xf326('0xe')]);router[_0xf326('0xf')](_0xf326('0xb'),auth['isAuthenticated'](),controller[_0xf326('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4819=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','isAuthenticated','show','post','create','/:id','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x3f891b,_0x2d2106){var _0x1935c1=function(_0x381c44){while(--_0x381c44){_0x3f891b['push'](_0x3f891b['shift']());}};_0x1935c1(++_0x2d2106);}(_0x4819,0xcd));var _0x9481=function(_0x23a042,_0x169361){_0x23a042=_0x23a042-0x0;var _0x57543a=_0x4819[_0x23a042];return _0x57543a;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var auth=require(_0x9481('0x5'));var interaction=require(_0x9481('0x6'));var config=require(_0x9481('0x7'));var controller=require(_0x9481('0x8'));router[_0x9481('0x9')]('/',auth['isAuthenticated'](),controller[_0x9481('0xa')]);router['get']('/:id',auth[_0x9481('0xb')](),controller[_0x9481('0xc')]);router[_0x9481('0xd')]('/',auth[_0x9481('0xb')](),controller[_0x9481('0xe')]);router['put'](_0x9481('0xf'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);router['delete'](_0x9481('0xf'),auth[_0x9481('0xb')](),controller[_0x9481('0x11')]);module[_0x9481('0x12')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index f17941d..23cc8ff 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 _0xcf70=['exports','sequelize'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0xcf70,0x113));var _0x0cf7=function(_0x42658f,_0x16c9af){_0x42658f=_0x42658f-0x0;var _0x2ba697=_0xcf70[_0x42658f];return _0x2ba697;};'use strict';var Sequelize=require(_0x0cf7('0x0'));module[_0x0cf7('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x6e26=['TEXT','sequelize','exports'];(function(_0x2ccd08,_0x1a9c30){var _0x3f3014=function(_0x321868){while(--_0x321868){_0x2ccd08['push'](_0x2ccd08['shift']());}};_0x3f3014(++_0x1a9c30);}(_0x6e26,0x15a));var _0x66e2=function(_0x3b0a49,_0x392eda){_0x3b0a49=_0x3b0a49-0x0;var _0x1450d1=_0x6e26[_0x3b0a49];return _0x1450d1;};'use strict';var Sequelize=require(_0x66e2('0x0'));module[_0x66e2('0x1')]={'tree':{'type':Sequelize[_0x66e2('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 9ae5ada..1235a21 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 _0x39bf=['bluebird','util','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','where','merge','type','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','rimraf','zip-dir','moment'];(function(_0x340bd0,_0x2c3d15){var _0x1d1cdc=function(_0x9cb8e4){while(--_0x9cb8e4){_0x340bd0['push'](_0x340bd0['shift']());}};_0x1d1cdc(++_0x2c3d15);}(_0x39bf,0x1a0));var _0xf39b=function(_0x2de0ef,_0x3014c7){_0x2de0ef=_0x2de0ef-0x0;var _0x3292d7=_0x39bf[_0x2de0ef];return _0x3292d7;};'use strict';var pdf=require(_0xf39b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf39b('0x1'));var zipdir=require(_0xf39b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf39b('0x3'));var BPromise=require(_0xf39b('0x4'));var Mustache=require('mustache');var util=require(_0xf39b('0x5'));var path=require('path');var sox=require(_0xf39b('0x6'));var csv=require(_0xf39b('0x7'));var ejs=require(_0xf39b('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf39b('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xf39b('0xa'));var toCsv=require(_0xf39b('0x7'));var querystring=require(_0xf39b('0xb'));var Papa=require(_0xf39b('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf39b('0xd'));var as=require(_0xf39b('0xe'));var hardwareService=require(_0xf39b('0xf'));var logger=require(_0xf39b('0x10'))(_0xf39b('0x11'));var utils=require(_0xf39b('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c64c6,_0xcf3103){_0xcf3103=_0xcf3103||0xcc;return function(_0x33144c){if(_0x33144c){return _0x4c64c6[_0xf39b('0x13')](_0xcf3103);}return _0x4c64c6['status'](_0xcf3103)[_0xf39b('0x14')]();};}function respondWithResult(_0x2a02b0,_0x381144){_0x381144=_0x381144||0xc8;return function(_0x594d25){if(_0x594d25){return _0x2a02b0[_0xf39b('0x15')](_0x381144)[_0xf39b('0x16')](_0x594d25);}};}function respondWithFilteredResult(_0x221fca,_0xbb2c8e){return function(_0x2aa557){if(_0x2aa557){var _0x4e0d7c=_0x2aa557[_0xf39b('0x17')],_0x496a59=_0xbb2c8e['offset'],_0x199c30=_0xbb2c8e[_0xf39b('0x18')]+_0xbb2c8e['limit'],_0xa2c8ae;if(_0x199c30>=_0x4e0d7c){_0x199c30=_0x4e0d7c;_0xa2c8ae=0xc8;}else{_0xa2c8ae=0xce;}_0x221fca[_0xf39b('0x15')](_0xa2c8ae);return _0x221fca[_0xf39b('0x19')](_0xf39b('0x1a'),_0x496a59+'-'+_0x199c30+'/'+_0x4e0d7c)['json'](_0x2aa557);}return null;};}function patchUpdates(_0x12ef9a){return function(_0x1704f6){try{jsonpatch[_0xf39b('0x1b')](_0x1704f6,_0x12ef9a,!![]);}catch(_0x29608a){return BPromise[_0xf39b('0x1c')](_0x29608a);}return _0x1704f6[_0xf39b('0x1d')]();};}function saveUpdates(_0x3dd862,_0x379ffd){return function(_0x3f8f9c){if(_0x3f8f9c){return _0x3f8f9c[_0xf39b('0x1e')](_0x3dd862)[_0xf39b('0x1f')](function(_0x24e439){return _0x24e439;});}return null;};}function removeEntity(_0x44c26d,_0x2928b3){return function(_0x4bb5cc){if(_0x4bb5cc){return _0x4bb5cc[_0xf39b('0x20')]()['then'](function(){_0x44c26d[_0xf39b('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f67e5,_0x3f2a99){return function(_0x4a32ad){if(!_0x4a32ad){_0x3f67e5[_0xf39b('0x13')](0x194);}return _0x4a32ad;};}function handleError(_0x286d5e,_0x4a1211){_0x4a1211=_0x4a1211||0x1f4;return function(_0x365bd9){logger[_0xf39b('0x21')](_0x365bd9[_0xf39b('0x22')]);if(_0x365bd9[_0xf39b('0x23')]){delete _0x365bd9['name'];}_0x286d5e['status'](_0x4a1211)[_0xf39b('0x24')](_0x365bd9);};}exports[_0xf39b('0x25')]=function(_0xc1d373,_0x4a9e59){var _0x258969={},_0x41e9ed={},_0x187be9={'count':0x0,'rows':[]};var _0x407d5f=_[_0xf39b('0x26')](db['AnalyticTreeReport'][_0xf39b('0x27')],function(_0x32b4e1){return{'name':_0x32b4e1['fieldName'],'type':_0x32b4e1['type'][_0xf39b('0x28')]};});_0x41e9ed[_0xf39b('0x29')]=_[_0xf39b('0x26')](_0x407d5f,_0xf39b('0x23'));_0x41e9ed[_0xf39b('0x2a')]=_[_0xf39b('0x2b')](_0xc1d373[_0xf39b('0x2a')]);_0x41e9ed[_0xf39b('0x2c')]=_[_0xf39b('0x2d')](_0x41e9ed[_0xf39b('0x29')],_0x41e9ed[_0xf39b('0x2a')]);_0x258969[_0xf39b('0x2e')]=_[_0xf39b('0x2d')](_0x41e9ed[_0xf39b('0x29')],qs[_0xf39b('0x2f')](_0xc1d373[_0xf39b('0x2a')][_0xf39b('0x2f')]));_0x258969[_0xf39b('0x2e')]=_0x258969[_0xf39b('0x2e')][_0xf39b('0x30')]?_0x258969[_0xf39b('0x2e')]:_0x41e9ed[_0xf39b('0x29')];if(!_0xc1d373['query'][_0xf39b('0x31')]('nolimit')){_0x258969[_0xf39b('0x32')]=qs[_0xf39b('0x32')](_0xc1d373[_0xf39b('0x2a')][_0xf39b('0x32')]);_0x258969[_0xf39b('0x18')]=qs[_0xf39b('0x18')](_0xc1d373[_0xf39b('0x2a')]['offset']);}_0x258969[_0xf39b('0x33')]=qs[_0xf39b('0x34')](_0xc1d373['query'][_0xf39b('0x34')]);_0x258969['where']=qs['filters'](_['pick'](_0xc1d373[_0xf39b('0x2a')],_0x41e9ed[_0xf39b('0x2c')]),_0x407d5f);if(_0xc1d373['query'][_0xf39b('0x35')]){_0x258969[_0xf39b('0x36')]=_[_0xf39b('0x37')](_0x258969[_0xf39b('0x36')],{'$or':_[_0xf39b('0x26')](_0x407d5f,function(_0x242a2c){if(_0x242a2c[_0xf39b('0x38')]!==_0xf39b('0x39')){var _0x458103={};_0x458103[_0x242a2c[_0xf39b('0x23')]]={'$like':'%'+_0xc1d373[_0xf39b('0x2a')]['filter']+'%'};return _0x458103;}})});}_0x258969=_[_0xf39b('0x37')]({},_0x258969,_0xc1d373[_0xf39b('0x3a')]);var _0x1e45e9={'where':_0x258969['where']};return db[_0xf39b('0x3b')][_0xf39b('0x17')](_0x1e45e9)[_0xf39b('0x1f')](function(_0x49304e){_0x187be9[_0xf39b('0x17')]=_0x49304e;if(_0xc1d373['query'][_0xf39b('0x3c')]){_0x258969[_0xf39b('0x3d')]=[{'all':!![]}];}return db[_0xf39b('0x3b')][_0xf39b('0x3e')](_0x258969);})[_0xf39b('0x1f')](function(_0x43bfaf){_0x187be9[_0xf39b('0x3f')]=_0x43bfaf;return _0x187be9;})[_0xf39b('0x1f')](respondWithFilteredResult(_0x4a9e59,_0x258969))[_0xf39b('0x40')](handleError(_0x4a9e59,null));};exports[_0xf39b('0x41')]=function(_0x1b8c48,_0x5de2b7){var _0x200f64={'raw':!![],'where':{'id':_0x1b8c48[_0xf39b('0x42')]['id']}},_0x23dfc9={};_0x23dfc9['model']=_[_0xf39b('0x2b')](db[_0xf39b('0x3b')]['rawAttributes']);_0x23dfc9[_0xf39b('0x2a')]=_['keys'](_0x1b8c48[_0xf39b('0x2a')]);_0x23dfc9[_0xf39b('0x2c')]=_['intersection'](_0x23dfc9['model'],_0x23dfc9[_0xf39b('0x2a')]);_0x200f64[_0xf39b('0x2e')]=_[_0xf39b('0x2d')](_0x23dfc9[_0xf39b('0x29')],qs[_0xf39b('0x2f')](_0x1b8c48['query'][_0xf39b('0x2f')]));_0x200f64['attributes']=_0x200f64[_0xf39b('0x2e')][_0xf39b('0x30')]?_0x200f64[_0xf39b('0x2e')]:_0x23dfc9[_0xf39b('0x29')];if(_0x1b8c48[_0xf39b('0x2a')][_0xf39b('0x3c')]){_0x200f64[_0xf39b('0x3d')]=[{'all':!![]}];}_0x200f64=_[_0xf39b('0x37')]({},_0x200f64,_0x1b8c48['options']);return db[_0xf39b('0x3b')][_0xf39b('0x43')](_0x200f64)[_0xf39b('0x1f')](handleEntityNotFound(_0x5de2b7,null))['then'](respondWithResult(_0x5de2b7,null))[_0xf39b('0x40')](handleError(_0x5de2b7,null));};exports['create']=function(_0x43c230,_0x262a09){return db[_0xf39b('0x3b')][_0xf39b('0x44')](_0x43c230['body'],{})[_0xf39b('0x1f')](respondWithResult(_0x262a09,0xc9))['catch'](handleError(_0x262a09,null));};exports[_0xf39b('0x1e')]=function(_0x4ea284,_0x5f5a7c){if(_0x4ea284['body']['id']){delete _0x4ea284[_0xf39b('0x45')]['id'];}return db['AnalyticTreeReport'][_0xf39b('0x43')]({'where':{'id':_0x4ea284[_0xf39b('0x42')]['id']}})[_0xf39b('0x1f')](handleEntityNotFound(_0x5f5a7c,null))[_0xf39b('0x1f')](saveUpdates(_0x4ea284[_0xf39b('0x45')],null))[_0xf39b('0x1f')](respondWithResult(_0x5f5a7c,null))[_0xf39b('0x40')](handleError(_0x5f5a7c,null));};exports[_0xf39b('0x20')]=function(_0x219b54,_0x45e25b){return db[_0xf39b('0x3b')]['find']({'where':{'id':_0x219b54[_0xf39b('0x42')]['id']}})[_0xf39b('0x1f')](handleEntityNotFound(_0x45e25b,null))['then'](removeEntity(_0x45e25b,null))[_0xf39b('0x40')](handleError(_0x45e25b,null));}; \ No newline at end of file +var _0xb959=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','AnalyticTreeReport','rawAttributes','fieldName','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','destroy','find','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x3563a3,_0xe053af){var _0x357410=function(_0x3fd2ac){while(--_0x3fd2ac){_0x3563a3['push'](_0x3563a3['shift']());}};_0x357410(++_0xe053af);}(_0xb959,0xce));var _0x9b95=function(_0x310da2,_0x524bf1){_0x310da2=_0x310da2-0x0;var _0x277dc0=_0xb959[_0x310da2];return _0x277dc0;};'use strict';var pdf=require(_0x9b95('0x0'));var emlformat=require(_0x9b95('0x1'));var rimraf=require(_0x9b95('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9b95('0x3'));var rp=require(_0x9b95('0x4'));var moment=require(_0x9b95('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9b95('0x6'));var util=require(_0x9b95('0x7'));var path=require(_0x9b95('0x8'));var sox=require('sox');var csv=require(_0x9b95('0x9'));var ejs=require(_0x9b95('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9b95('0xb'));var crypto=require('crypto');var jsforce=require(_0x9b95('0xc'));var deskjs=require(_0x9b95('0xd'));var toCsv=require(_0x9b95('0x9'));var querystring=require(_0x9b95('0xe'));var Papa=require(_0x9b95('0xf'));var Redis=require(_0x9b95('0x10'));var authService=require(_0x9b95('0x11'));var qs=require(_0x9b95('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9b95('0x13'));var logger=require(_0x9b95('0x14'))(_0x9b95('0x15'));var utils=require(_0x9b95('0x16'));var config=require(_0x9b95('0x17'));var db=require(_0x9b95('0x18'))['db'];function respondWithStatusCode(_0x61cef6,_0x153b2d){_0x153b2d=_0x153b2d||0xcc;return function(_0x306657){if(_0x306657){return _0x61cef6[_0x9b95('0x19')](_0x153b2d);}return _0x61cef6[_0x9b95('0x1a')](_0x153b2d)[_0x9b95('0x1b')]();};}function respondWithResult(_0x5eca49,_0x4cfc1d){_0x4cfc1d=_0x4cfc1d||0xc8;return function(_0x2dc530){if(_0x2dc530){return _0x5eca49[_0x9b95('0x1a')](_0x4cfc1d)[_0x9b95('0x1c')](_0x2dc530);}};}function respondWithFilteredResult(_0x5d02eb,_0x395c57){return function(_0x33df1d){if(_0x33df1d){var _0x18cdad=_0x33df1d[_0x9b95('0x1d')],_0x3fbfc0=_0x395c57['offset'],_0x12cff3=_0x395c57[_0x9b95('0x1e')]+_0x395c57[_0x9b95('0x1f')],_0x528afc;if(_0x12cff3>=_0x18cdad){_0x12cff3=_0x18cdad;_0x528afc=0xc8;}else{_0x528afc=0xce;}_0x5d02eb[_0x9b95('0x1a')](_0x528afc);return _0x5d02eb['set'](_0x9b95('0x20'),_0x3fbfc0+'-'+_0x12cff3+'/'+_0x18cdad)[_0x9b95('0x1c')](_0x33df1d);}return null;};}function patchUpdates(_0xf75d1e){return function(_0x5d6fc7){try{jsonpatch[_0x9b95('0x21')](_0x5d6fc7,_0xf75d1e,!![]);}catch(_0x69f3fb){return BPromise[_0x9b95('0x22')](_0x69f3fb);}return _0x5d6fc7[_0x9b95('0x23')]();};}function saveUpdates(_0x39d334,_0xfb43f0){return function(_0x1f7b40){if(_0x1f7b40){return _0x1f7b40[_0x9b95('0x24')](_0x39d334)[_0x9b95('0x25')](function(_0x44242d){return _0x44242d;});}return null;};}function removeEntity(_0x3be9d8,_0x349fc2){return function(_0x33abb6){if(_0x33abb6){return _0x33abb6['destroy']()[_0x9b95('0x25')](function(){_0x3be9d8['status'](0xcc)[_0x9b95('0x1b')]();});}};}function handleEntityNotFound(_0x1ba1c6,_0x516df3){return function(_0x4870ac){if(!_0x4870ac){_0x1ba1c6[_0x9b95('0x19')](0x194);}return _0x4870ac;};}function handleError(_0x12be23,_0x11171e){_0x11171e=_0x11171e||0x1f4;return function(_0x5711d6){logger[_0x9b95('0x26')](_0x5711d6[_0x9b95('0x27')]);if(_0x5711d6['name']){delete _0x5711d6[_0x9b95('0x28')];}_0x12be23[_0x9b95('0x1a')](_0x11171e)[_0x9b95('0x29')](_0x5711d6);};}exports['index']=function(_0x2df919,_0x5808e1){var _0x4b1347={},_0x1ace39={},_0x37aa2c={'count':0x0,'rows':[]};var _0x475906=_[_0x9b95('0x2a')](db[_0x9b95('0x2b')][_0x9b95('0x2c')],function(_0x1f22c2){return{'name':_0x1f22c2[_0x9b95('0x2d')],'type':_0x1f22c2['type']['key']};});_0x1ace39[_0x9b95('0x2e')]=_['map'](_0x475906,'name');_0x1ace39['query']=_['keys'](_0x2df919['query']);_0x1ace39[_0x9b95('0x2f')]=_[_0x9b95('0x30')](_0x1ace39[_0x9b95('0x2e')],_0x1ace39[_0x9b95('0x31')]);_0x4b1347['attributes']=_[_0x9b95('0x30')](_0x1ace39[_0x9b95('0x2e')],qs[_0x9b95('0x32')](_0x2df919[_0x9b95('0x31')][_0x9b95('0x32')]));_0x4b1347[_0x9b95('0x33')]=_0x4b1347[_0x9b95('0x33')][_0x9b95('0x34')]?_0x4b1347[_0x9b95('0x33')]:_0x1ace39[_0x9b95('0x2e')];if(!_0x2df919[_0x9b95('0x31')][_0x9b95('0x35')](_0x9b95('0x36'))){_0x4b1347[_0x9b95('0x1f')]=qs[_0x9b95('0x1f')](_0x2df919['query'][_0x9b95('0x1f')]);_0x4b1347[_0x9b95('0x1e')]=qs[_0x9b95('0x1e')](_0x2df919['query']['offset']);}_0x4b1347[_0x9b95('0x37')]=qs[_0x9b95('0x38')](_0x2df919[_0x9b95('0x31')][_0x9b95('0x38')]);_0x4b1347[_0x9b95('0x39')]=qs['filters'](_[_0x9b95('0x3a')](_0x2df919[_0x9b95('0x31')],_0x1ace39[_0x9b95('0x2f')]),_0x475906);if(_0x2df919['query'][_0x9b95('0x3b')]){_0x4b1347[_0x9b95('0x39')]=_[_0x9b95('0x3c')](_0x4b1347[_0x9b95('0x39')],{'$or':_[_0x9b95('0x2a')](_0x475906,function(_0x421c94){if(_0x421c94[_0x9b95('0x3d')]!==_0x9b95('0x3e')){var _0x5cabe4={};_0x5cabe4[_0x421c94[_0x9b95('0x28')]]={'$like':'%'+_0x2df919[_0x9b95('0x31')][_0x9b95('0x3b')]+'%'};return _0x5cabe4;}})});}_0x4b1347=_['merge']({},_0x4b1347,_0x2df919[_0x9b95('0x3f')]);var _0x2d4d02={'where':_0x4b1347[_0x9b95('0x39')]};return db['AnalyticTreeReport'][_0x9b95('0x1d')](_0x2d4d02)[_0x9b95('0x25')](function(_0x46dd26){_0x37aa2c[_0x9b95('0x1d')]=_0x46dd26;if(_0x2df919[_0x9b95('0x31')][_0x9b95('0x40')]){_0x4b1347[_0x9b95('0x41')]=[{'all':!![]}];}return db[_0x9b95('0x2b')][_0x9b95('0x42')](_0x4b1347);})[_0x9b95('0x25')](function(_0x1d975f){_0x37aa2c[_0x9b95('0x43')]=_0x1d975f;return _0x37aa2c;})[_0x9b95('0x25')](respondWithFilteredResult(_0x5808e1,_0x4b1347))[_0x9b95('0x44')](handleError(_0x5808e1,null));};exports[_0x9b95('0x45')]=function(_0x243638,_0x38de20){var _0x17e9a9={'raw':!![],'where':{'id':_0x243638[_0x9b95('0x46')]['id']}},_0x4daa17={};_0x4daa17[_0x9b95('0x2e')]=_['keys'](db[_0x9b95('0x2b')][_0x9b95('0x2c')]);_0x4daa17[_0x9b95('0x31')]=_[_0x9b95('0x47')](_0x243638[_0x9b95('0x31')]);_0x4daa17['filters']=_['intersection'](_0x4daa17['model'],_0x4daa17[_0x9b95('0x31')]);_0x17e9a9[_0x9b95('0x33')]=_[_0x9b95('0x30')](_0x4daa17[_0x9b95('0x2e')],qs[_0x9b95('0x32')](_0x243638['query'][_0x9b95('0x32')]));_0x17e9a9['attributes']=_0x17e9a9[_0x9b95('0x33')][_0x9b95('0x34')]?_0x17e9a9[_0x9b95('0x33')]:_0x4daa17[_0x9b95('0x2e')];if(_0x243638[_0x9b95('0x31')][_0x9b95('0x40')]){_0x17e9a9[_0x9b95('0x41')]=[{'all':!![]}];}_0x17e9a9=_['merge']({},_0x17e9a9,_0x243638[_0x9b95('0x3f')]);return db[_0x9b95('0x2b')]['find'](_0x17e9a9)[_0x9b95('0x25')](handleEntityNotFound(_0x38de20,null))[_0x9b95('0x25')](respondWithResult(_0x38de20,null))[_0x9b95('0x44')](handleError(_0x38de20,null));};exports['create']=function(_0x4c050f,_0x37c4f1){return db[_0x9b95('0x2b')][_0x9b95('0x48')](_0x4c050f['body'],{})[_0x9b95('0x25')](respondWithResult(_0x37c4f1,0xc9))[_0x9b95('0x44')](handleError(_0x37c4f1,null));};exports['update']=function(_0x3e1c66,_0x48fb73){if(_0x3e1c66[_0x9b95('0x49')]['id']){delete _0x3e1c66['body']['id'];}return db[_0x9b95('0x2b')]['find']({'where':{'id':_0x3e1c66[_0x9b95('0x46')]['id']}})[_0x9b95('0x25')](handleEntityNotFound(_0x48fb73,null))[_0x9b95('0x25')](saveUpdates(_0x3e1c66[_0x9b95('0x49')],null))[_0x9b95('0x25')](respondWithResult(_0x48fb73,null))[_0x9b95('0x44')](handleError(_0x48fb73,null));};exports[_0x9b95('0x4a')]=function(_0x5b5d8a,_0x5cf720){return db[_0x9b95('0x2b')][_0x9b95('0x4b')]({'where':{'id':_0x5b5d8a[_0x9b95('0x46')]['id']}})[_0x9b95('0x25')](handleEntityNotFound(_0x5cf720,null))['then'](removeEntity(_0x5cf720,null))['catch'](handleError(_0x5cf720,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 14313e2..06aefff 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 _0xd99c=['lodash','util','bluebird','path','../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees'];(function(_0x7b7f5f,_0x2d472b){var _0x35e97f=function(_0x1b7300){while(--_0x1b7300){_0x7b7f5f['push'](_0x7b7f5f['shift']());}};_0x35e97f(++_0x2d472b);}(_0xd99c,0x90));var _0xcd99=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd99c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcd99('0x0'));var util=require(_0xcd99('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcd99('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcd99('0x3'));var rimraf=require('rimraf');var config=require(_0xcd99('0x4'));var attributes=require(_0xcd99('0x5'));module[_0xcd99('0x6')]=function(_0x18c868,_0x1351e9){return _0x18c868['define']('AnalyticTreeReport',attributes,{'tableName':_0xcd99('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d42=['../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x3cfc59,_0x5f3e5d){var _0x9b51e7=function(_0x54df82){while(--_0x54df82){_0x3cfc59['push'](_0x3cfc59['shift']());}};_0x9b51e7(++_0x5f3e5d);}(_0x9d42,0x12d));var _0x29d4=function(_0x396308,_0x197a90){_0x396308=_0x396308-0x0;var _0x40a50b=_0x9d42[_0x396308];return _0x40a50b;};'use strict';var _=require(_0x29d4('0x0'));var util=require(_0x29d4('0x1'));var logger=require('../../config/logger')(_0x29d4('0x2'));var moment=require(_0x29d4('0x3'));var BPromise=require(_0x29d4('0x4'));var rp=require(_0x29d4('0x5'));var fs=require('fs');var path=require(_0x29d4('0x6'));var rimraf=require('rimraf');var config=require(_0x29d4('0x7'));var attributes=require(_0x29d4('0x8'));module[_0x29d4('0x9')]=function(_0x418b83,_0x4aee18){return _0x418b83['define']('AnalyticTreeReport',attributes,{'tableName':_0x29d4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 6ce23fe..720c88f 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 _0x3fad=['error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x9c0c53,_0x40db5d){var _0x58d15d=function(_0x1dd090){while(--_0x1dd090){_0x9c0c53['push'](_0x9c0c53['shift']());}};_0x58d15d(++_0x40db5d);}(_0x3fad,0x150));var _0xd3fa=function(_0x388a83,_0x28a1b1){_0x388a83=_0x388a83-0x0;var _0x25334f=_0x3fad[_0x388a83];return _0x25334f;};'use strict';var _=require(_0xd3fa('0x0'));var util=require(_0xd3fa('0x1'));var moment=require(_0xd3fa('0x2'));var BPromise=require(_0xd3fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3fa('0x4'));var db=require(_0xd3fa('0x5'))['db'];var utils=require(_0xd3fa('0x6'));var logger=require(_0xd3fa('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd3fa('0x8'));var client=jayson['client'][_0xd3fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x207629,_0x2c4588,_0x2626eb){return new BPromise(function(_0x2ee092,_0x1b320c){return client[_0xd3fa('0xa')](_0x207629,_0x2626eb)[_0xd3fa('0xb')](function(_0x197689){logger['info'](_0xd3fa('0xc'),_0x2c4588,_0xd3fa('0xd'));logger['debug'](_0xd3fa('0xe'),_0x2c4588,_0xd3fa('0xd'),JSON[_0xd3fa('0xf')](_0x197689));if(_0x197689[_0xd3fa('0x10')]){if(_0x197689[_0xd3fa('0x10')][_0xd3fa('0x11')]===0x1f4){logger[_0xd3fa('0x10')](_0xd3fa('0xc'),_0x2c4588,_0x197689[_0xd3fa('0x10')][_0xd3fa('0x12')]);return _0x1b320c(_0x197689['error'][_0xd3fa('0x12')]);}logger[_0xd3fa('0x10')]('AnalyticTreeReport,\x20%s,\x20%s',_0x2c4588,_0x197689[_0xd3fa('0x10')][_0xd3fa('0x12')]);return _0x2ee092(_0x197689[_0xd3fa('0x10')]['message']);}else{logger[_0xd3fa('0x13')](_0xd3fa('0xc'),_0x2c4588,'request\x20sent');_0x2ee092(_0x197689[_0xd3fa('0x14')][_0xd3fa('0x12')]);}})[_0xd3fa('0x15')](function(_0x247064){logger['error'](_0xd3fa('0xc'),_0x2c4588,_0x247064);_0x1b320c(_0x247064);});});} \ No newline at end of file +var _0xccfa=['util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash'];(function(_0x29cf13,_0x108e24){var _0x13d121=function(_0x5ec7d0){while(--_0x5ec7d0){_0x29cf13['push'](_0x29cf13['shift']());}};_0x13d121(++_0x108e24);}(_0xccfa,0x1a3));var _0xaccf=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xccfa[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require(_0xaccf('0x0'));var util=require(_0xaccf('0x1'));var moment=require(_0xaccf('0x2'));var BPromise=require(_0xaccf('0x3'));var rs=require(_0xaccf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaccf('0x5'));var logger=require('../../config/logger')(_0xaccf('0x6'));var config=require(_0xaccf('0x7'));var jayson=require(_0xaccf('0x8'));var client=jayson[_0xaccf('0x9')][_0xaccf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e763a,_0x19b8b2,_0x5a0944){return new BPromise(function(_0x45d9f4,_0x46de69){return client[_0xaccf('0xb')](_0x4e763a,_0x5a0944)[_0xaccf('0xc')](function(_0xfecb3){logger[_0xaccf('0xd')](_0xaccf('0xe'),_0x19b8b2,_0xaccf('0xf'));logger[_0xaccf('0x10')](_0xaccf('0x11'),_0x19b8b2,_0xaccf('0xf'),JSON['stringify'](_0xfecb3));if(_0xfecb3['error']){if(_0xfecb3[_0xaccf('0x12')]['code']===0x1f4){logger[_0xaccf('0x12')](_0xaccf('0xe'),_0x19b8b2,_0xfecb3['error'][_0xaccf('0x13')]);return _0x46de69(_0xfecb3[_0xaccf('0x12')][_0xaccf('0x13')]);}logger[_0xaccf('0x12')]('AnalyticTreeReport,\x20%s,\x20%s',_0x19b8b2,_0xfecb3['error'][_0xaccf('0x13')]);return _0x45d9f4(_0xfecb3['error'][_0xaccf('0x13')]);}else{logger[_0xaccf('0xd')](_0xaccf('0xe'),_0x19b8b2,_0xaccf('0xf'));_0x45d9f4(_0xfecb3['result'][_0xaccf('0x13')]);}})[_0xaccf('0x14')](function(_0x3da036){logger['error'](_0xaccf('0xe'),_0x19b8b2,_0x3da036);_0x46de69(_0x3da036);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index ad7bac9..84bb1fe 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 _0x73fa=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x162e8b,_0x37a704){var _0x365084=function(_0x46ce12){while(--_0x46ce12){_0x162e8b['push'](_0x162e8b['shift']());}};_0x365084(++_0x37a704);}(_0x73fa,0xa7));var _0xa73f=function(_0x582b0f,_0x35a9de){_0x582b0f=_0x582b0f-0x0;var _0x4658f0=_0x73fa[_0x582b0f];return _0x4658f0;};'use strict';var multer=require(_0xa73f('0x0'));var util=require(_0xa73f('0x1'));var path=require(_0xa73f('0x2'));var timeout=require('connect-timeout');var express=require(_0xa73f('0x3'));var router=express[_0xa73f('0x4')]();var auth=require(_0xa73f('0x5'));var interaction=require(_0xa73f('0x6'));var config=require(_0xa73f('0x7'));var controller=require('./analyticTreeReport.controller');router[_0xa73f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa73f('0x8')](_0xa73f('0x9'),auth[_0xa73f('0xa')](),controller[_0xa73f('0xb')]);router[_0xa73f('0xc')]('/',auth[_0xa73f('0xa')](),controller[_0xa73f('0xd')]);router[_0xa73f('0xe')](_0xa73f('0x9'),auth[_0xa73f('0xa')](),controller[_0xa73f('0xf')]);router[_0xa73f('0x10')](_0xa73f('0x9'),auth['isAuthenticated'](),controller[_0xa73f('0x11')]);module[_0xa73f('0x12')]=router; \ No newline at end of file +var _0xd5df=['delete','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','create','put','update'];(function(_0x449512,_0x57155b){var _0x1dffa7=function(_0x572f5c){while(--_0x572f5c){_0x449512['push'](_0x449512['shift']());}};_0x1dffa7(++_0x57155b);}(_0xd5df,0x68));var _0xfd5d=function(_0x30c5ac,_0x1678ac){_0x30c5ac=_0x30c5ac-0x0;var _0x4490f=_0xd5df[_0x30c5ac];return _0x4490f;};'use strict';var multer=require('multer');var util=require(_0xfd5d('0x0'));var path=require('path');var timeout=require(_0xfd5d('0x1'));var express=require(_0xfd5d('0x2'));var router=express['Router']();var auth=require(_0xfd5d('0x3'));var interaction=require(_0xfd5d('0x4'));var config=require(_0xfd5d('0x5'));var controller=require(_0xfd5d('0x6'));router[_0xfd5d('0x7')]('/',auth[_0xfd5d('0x8')](),controller[_0xfd5d('0x9')]);router['get'](_0xfd5d('0xa'),auth[_0xfd5d('0x8')](),controller[_0xfd5d('0xb')]);router['post']('/',auth[_0xfd5d('0x8')](),controller[_0xfd5d('0xc')]);router[_0xfd5d('0xd')](_0xfd5d('0xa'),auth['isAuthenticated'](),controller[_0xfd5d('0xe')]);router[_0xfd5d('0xf')](_0xfd5d('0xa'),auth[_0xfd5d('0x8')](),controller['destroy']);module[_0xfd5d('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 57103b4..4f37553 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 _0x1105=['sequelize','exports','STRING'];(function(_0x311a92,_0x3375f6){var _0x2768a8=function(_0x3f0980){while(--_0x3f0980){_0x311a92['push'](_0x311a92['shift']());}};_0x2768a8(++_0x3375f6);}(_0x1105,0xe1));var _0x5110=function(_0x5e8a2e,_0x3deead){_0x5e8a2e=_0x5e8a2e-0x0;var _0x20a417=_0x1105[_0x5e8a2e];return _0x20a417;};'use strict';var Sequelize=require(_0x5110('0x0'));module[_0x5110('0x1')]={'name':{'type':Sequelize[_0x5110('0x2')]},'basename':{'type':Sequelize[_0x5110('0x2')]},'type':{'type':Sequelize[_0x5110('0x2')]}}; \ No newline at end of file +var _0xcff5=['STRING','sequelize','exports'];(function(_0xb41123,_0x503175){var _0x110766=function(_0x34043d){while(--_0x34043d){_0xb41123['push'](_0xb41123['shift']());}};_0x110766(++_0x503175);}(_0xcff5,0x163));var _0x5cff=function(_0x109f6b,_0x2a164c){_0x109f6b=_0x109f6b-0x0;var _0x22c967=_0xcff5[_0x109f6b];return _0x22c967;};'use strict';var Sequelize=require(_0x5cff('0x0'));module[_0x5cff('0x1')]={'name':{'type':Sequelize[_0x5cff('0x2')]},'basename':{'type':Sequelize[_0x5cff('0x2')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 2b96aed..419f73d 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 _0x7acc=['rawAttributes','get','omit','createdAt','updatedAt','body','create','file','originalname','basename','filename','mimetype','download','findOne','join','root','server/files/attachments/','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','end','json','count','offset','limit','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','Attachment','findAll','rows','catch','show','params','find'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7acc,0x11c));var _0xc7ac=function(_0x432c53,_0x47457d){_0x432c53=_0x432c53-0x0;var _0x1030f5=_0x7acc[_0x432c53];return _0x1030f5;};'use strict';var pdf=require(_0xc7ac('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc7ac('0x1'));var zipdir=require(_0xc7ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc7ac('0x3'));var moment=require(_0xc7ac('0x4'));var BPromise=require(_0xc7ac('0x5'));var Mustache=require(_0xc7ac('0x6'));var util=require(_0xc7ac('0x7'));var path=require('path');var sox=require(_0xc7ac('0x8'));var csv=require(_0xc7ac('0x9'));var ejs=require(_0xc7ac('0xa'));var fs=require('fs');var _=require(_0xc7ac('0xb'));var squel=require(_0xc7ac('0xc'));var crypto=require('crypto');var jsforce=require(_0xc7ac('0xd'));var deskjs=require(_0xc7ac('0xe'));var toCsv=require(_0xc7ac('0x9'));var querystring=require(_0xc7ac('0xf'));var Papa=require(_0xc7ac('0x10'));var Redis=require(_0xc7ac('0x11'));var authService=require(_0xc7ac('0x12'));var qs=require(_0xc7ac('0x13'));var as=require(_0xc7ac('0x14'));var hardwareService=require(_0xc7ac('0x15'));var logger=require('../../config/logger')(_0xc7ac('0x16'));var utils=require('../../config/utils');var config=require(_0xc7ac('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x580c88,_0x1fbbb0){_0x1fbbb0=_0x1fbbb0||0xcc;return function(_0x4d0afc){if(_0x4d0afc){return _0x580c88[_0xc7ac('0x18')](_0x1fbbb0);}return _0x580c88['status'](_0x1fbbb0)[_0xc7ac('0x19')]();};}function respondWithResult(_0x19ddda,_0x4ba889){_0x4ba889=_0x4ba889||0xc8;return function(_0x3eae7c){if(_0x3eae7c){return _0x19ddda['status'](_0x4ba889)[_0xc7ac('0x1a')](_0x3eae7c);}};}function respondWithFilteredResult(_0x21fe2f,_0xf59b68){return function(_0x12b8b7){if(_0x12b8b7){var _0xcfd8c8=_0x12b8b7[_0xc7ac('0x1b')],_0x5553c6=_0xf59b68[_0xc7ac('0x1c')],_0x34e9a1=_0xf59b68['offset']+_0xf59b68[_0xc7ac('0x1d')],_0x47df01;if(_0x34e9a1>=_0xcfd8c8){_0x34e9a1=_0xcfd8c8;_0x47df01=0xc8;}else{_0x47df01=0xce;}_0x21fe2f[_0xc7ac('0x1e')](_0x47df01);return _0x21fe2f[_0xc7ac('0x1f')](_0xc7ac('0x20'),_0x5553c6+'-'+_0x34e9a1+'/'+_0xcfd8c8)['json'](_0x12b8b7);}return null;};}function patchUpdates(_0x3ac2fa){return function(_0x36d99a){try{jsonpatch['apply'](_0x36d99a,_0x3ac2fa,!![]);}catch(_0x5c39a8){return BPromise[_0xc7ac('0x21')](_0x5c39a8);}return _0x36d99a[_0xc7ac('0x22')]();};}function saveUpdates(_0x40de89,_0x36440e){return function(_0x4acd48){if(_0x4acd48){return _0x4acd48[_0xc7ac('0x23')](_0x40de89)[_0xc7ac('0x24')](function(_0x17d165){return _0x17d165;});}return null;};}function removeEntity(_0x3af419,_0x26baa6){return function(_0x3df18c){if(_0x3df18c){return _0x3df18c[_0xc7ac('0x25')]()['then'](function(){_0x3af419['status'](0xcc)[_0xc7ac('0x19')]();});}};}function handleEntityNotFound(_0x3f2112,_0x331480){return function(_0x32074d){if(!_0x32074d){_0x3f2112[_0xc7ac('0x18')](0x194);}return _0x32074d;};}function handleError(_0x38d3f4,_0x227bf9){_0x227bf9=_0x227bf9||0x1f4;return function(_0x3dc07c){logger[_0xc7ac('0x26')](_0x3dc07c[_0xc7ac('0x27')]);if(_0x3dc07c[_0xc7ac('0x28')]){delete _0x3dc07c['name'];}_0x38d3f4[_0xc7ac('0x1e')](_0x227bf9)[_0xc7ac('0x29')](_0x3dc07c);};}exports[_0xc7ac('0x2a')]=function(_0x45ecaf,_0x54d20d){var _0x208095={},_0xec4464={},_0x161b8d={'count':0x0,'rows':[]};var _0x5a4cee=_[_0xc7ac('0x2b')](db['Attachment']['rawAttributes'],function(_0x3a1d6d){return{'name':_0x3a1d6d['fieldName'],'type':_0x3a1d6d[_0xc7ac('0x2c')][_0xc7ac('0x2d')]};});_0xec4464[_0xc7ac('0x2e')]=_[_0xc7ac('0x2b')](_0x5a4cee,'name');_0xec4464[_0xc7ac('0x2f')]=_[_0xc7ac('0x30')](_0x45ecaf['query']);_0xec4464['filters']=_[_0xc7ac('0x31')](_0xec4464[_0xc7ac('0x2e')],_0xec4464['query']);_0x208095[_0xc7ac('0x32')]=_[_0xc7ac('0x31')](_0xec4464['model'],qs[_0xc7ac('0x33')](_0x45ecaf[_0xc7ac('0x2f')][_0xc7ac('0x33')]));_0x208095['attributes']=_0x208095[_0xc7ac('0x32')][_0xc7ac('0x34')]?_0x208095['attributes']:_0xec4464['model'];if(!_0x45ecaf['query'][_0xc7ac('0x35')](_0xc7ac('0x36'))){_0x208095[_0xc7ac('0x1d')]=qs[_0xc7ac('0x1d')](_0x45ecaf['query'][_0xc7ac('0x1d')]);_0x208095[_0xc7ac('0x1c')]=qs[_0xc7ac('0x1c')](_0x45ecaf[_0xc7ac('0x2f')]['offset']);}_0x208095['order']=qs[_0xc7ac('0x37')](_0x45ecaf['query'][_0xc7ac('0x37')]);_0x208095[_0xc7ac('0x38')]=qs['filters'](_[_0xc7ac('0x39')](_0x45ecaf[_0xc7ac('0x2f')],_0xec4464[_0xc7ac('0x3a')]),_0x5a4cee);if(_0x45ecaf[_0xc7ac('0x2f')]['filter']){_0x208095[_0xc7ac('0x38')]=_[_0xc7ac('0x3b')](_0x208095[_0xc7ac('0x38')],{'$or':_['map'](_0x5a4cee,function(_0x7ef9e0){if(_0x7ef9e0['type']!==_0xc7ac('0x3c')){var _0x397f1a={};_0x397f1a[_0x7ef9e0[_0xc7ac('0x28')]]={'$like':'%'+_0x45ecaf[_0xc7ac('0x2f')][_0xc7ac('0x3d')]+'%'};return _0x397f1a;}})});}_0x208095=_[_0xc7ac('0x3b')]({},_0x208095,_0x45ecaf[_0xc7ac('0x3e')]);var _0x2bbc27={'where':_0x208095[_0xc7ac('0x38')]};return db['Attachment']['count'](_0x2bbc27)[_0xc7ac('0x24')](function(_0x59e37e){_0x161b8d['count']=_0x59e37e;if(_0x45ecaf[_0xc7ac('0x2f')][_0xc7ac('0x3f')]){_0x208095[_0xc7ac('0x40')]=[{'all':!![]}];}return db[_0xc7ac('0x41')][_0xc7ac('0x42')](_0x208095);})[_0xc7ac('0x24')](function(_0x366b99){_0x161b8d[_0xc7ac('0x43')]=_0x366b99;return _0x161b8d;})['then'](respondWithFilteredResult(_0x54d20d,_0x208095))[_0xc7ac('0x44')](handleError(_0x54d20d,null));};exports[_0xc7ac('0x45')]=function(_0x5e28b9,_0x3c768a){var _0x457d52={'raw':!![],'where':{'id':_0x5e28b9[_0xc7ac('0x46')]['id']}},_0x528885={};_0x528885[_0xc7ac('0x2e')]=_[_0xc7ac('0x30')](db[_0xc7ac('0x41')]['rawAttributes']);_0x528885[_0xc7ac('0x2f')]=_['keys'](_0x5e28b9[_0xc7ac('0x2f')]);_0x528885[_0xc7ac('0x3a')]=_['intersection'](_0x528885['model'],_0x528885[_0xc7ac('0x2f')]);_0x457d52[_0xc7ac('0x32')]=_[_0xc7ac('0x31')](_0x528885[_0xc7ac('0x2e')],qs[_0xc7ac('0x33')](_0x5e28b9[_0xc7ac('0x2f')][_0xc7ac('0x33')]));_0x457d52[_0xc7ac('0x32')]=_0x457d52['attributes'][_0xc7ac('0x34')]?_0x457d52[_0xc7ac('0x32')]:_0x528885[_0xc7ac('0x2e')];if(_0x5e28b9[_0xc7ac('0x2f')][_0xc7ac('0x3f')]){_0x457d52['include']=[{'all':!![]}];}_0x457d52=_[_0xc7ac('0x3b')]({},_0x457d52,_0x5e28b9[_0xc7ac('0x3e')]);return db[_0xc7ac('0x41')][_0xc7ac('0x47')](_0x457d52)['then'](handleEntityNotFound(_0x3c768a,null))[_0xc7ac('0x24')](respondWithResult(_0x3c768a,null))[_0xc7ac('0x44')](handleError(_0x3c768a,null));};exports['clone']=function(_0x55a083,_0x394710){var _0x52ae07={'where':{'id':_0x55a083[_0xc7ac('0x46')]['id']}},_0x5e57ff={};_0x5e57ff[_0xc7ac('0x2e')]=_[_0xc7ac('0x30')](db['Attachment'][_0xc7ac('0x48')]);_0x52ae07['attributes']=_['intersection'](_0x5e57ff['model'],qs['fields'](_0x55a083[_0xc7ac('0x2f')]['fields']));_0x52ae07[_0xc7ac('0x32')]=_0x52ae07[_0xc7ac('0x32')]['length']?_0x52ae07[_0xc7ac('0x32')]:_0x5e57ff[_0xc7ac('0x2e')];if(_0x55a083[_0xc7ac('0x2f')][_0xc7ac('0x3f')]){_0x52ae07['include']=[{'all':!![]}];}_0x52ae07=_[_0xc7ac('0x3b')]({},_0x52ae07,_0x55a083[_0xc7ac('0x3e')]);return db[_0xc7ac('0x41')][_0xc7ac('0x47')](_0x52ae07)[_0xc7ac('0x24')](handleEntityNotFound(_0x394710,null))['then'](function(_0x33a8c9){if(_0x33a8c9){var _0x271e56=_0x33a8c9[_0xc7ac('0x49')]({'plain':!![]});_0x271e56=qs[_0xc7ac('0x4a')](_0x271e56,['id',_0xc7ac('0x4b'),_0xc7ac('0x4c')]);_0x55a083[_0xc7ac('0x4d')]=_[_0xc7ac('0x4a')](_0x55a083['body'],['id',_0xc7ac('0x4b'),_0xc7ac('0x4c')]);return db[_0xc7ac('0x41')]['create'](_[_0xc7ac('0x3b')](_0x271e56,_0x55a083[_0xc7ac('0x4d')]),{'include':_0x55a083['query'][_0xc7ac('0x3f')]?[{'all':!![]}]:undefined});}})[_0xc7ac('0x24')](respondWithResult(_0x394710,0xc9))[_0xc7ac('0x44')](handleError(_0x394710,null));};exports[_0xc7ac('0x23')]=function(_0x45d131,_0x36fff9){if(_0x45d131['body']['id']){delete _0x45d131[_0xc7ac('0x4d')]['id'];}return db[_0xc7ac('0x41')]['find']({'where':{'id':_0x45d131[_0xc7ac('0x46')]['id']}})['then'](handleEntityNotFound(_0x36fff9,null))[_0xc7ac('0x24')](saveUpdates(_0x45d131[_0xc7ac('0x4d')],null))['then'](respondWithResult(_0x36fff9,null))['catch'](handleError(_0x36fff9,null));};exports['destroy']=function(_0x26d588,_0xd49af){return db[_0xc7ac('0x41')][_0xc7ac('0x47')]({'where':{'id':_0x26d588[_0xc7ac('0x46')]['id']}})['then'](handleEntityNotFound(_0xd49af,null))[_0xc7ac('0x24')](removeEntity(_0xd49af,null))[_0xc7ac('0x44')](handleError(_0xd49af,null));};exports[_0xc7ac('0x4e')]=function(_0x9e263f,_0x1bdb53,_0x5764e7){_0x9e263f['body'][_0xc7ac('0x28')]=_0x9e263f[_0xc7ac('0x4f')][_0xc7ac('0x50')];_0x9e263f[_0xc7ac('0x4d')][_0xc7ac('0x51')]=_0x9e263f['file'][_0xc7ac('0x52')];_0x9e263f[_0xc7ac('0x4d')][_0xc7ac('0x2c')]=_0x9e263f[_0xc7ac('0x4f')][_0xc7ac('0x53')];return db[_0xc7ac('0x41')][_0xc7ac('0x4e')](_0x9e263f[_0xc7ac('0x4d')])[_0xc7ac('0x24')](respondWithResult(_0x1bdb53,0xc9))[_0xc7ac('0x44')](handleError(_0x1bdb53,null));};exports[_0xc7ac('0x54')]=function(_0xb00ab6,_0x20fcd0,_0x25a41a){return db[_0xc7ac('0x41')][_0xc7ac('0x55')]({'where':{'id':_0xb00ab6['params']['id']},'raw':!![]})[_0xc7ac('0x24')](handleEntityNotFound(_0x20fcd0,null))[_0xc7ac('0x24')](function(_0x2156cb){if(_0x2156cb){return _0x20fcd0[_0xc7ac('0x54')](path[_0xc7ac('0x56')](config[_0xc7ac('0x57')],_0xc7ac('0x58'),_0x2156cb['basename']));}})[_0xc7ac('0x44')](handleError(_0x20fcd0,null));}; \ No newline at end of file +var _0x7f4d=['fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','Content-Range','reject','save','then','destroy','stack','name','send','index','map','Attachment','rawAttributes','type','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','params','intersection','length','catch','clone','omit','createdAt','body','updatedAt','create','update','find','file','basename','filename','mimetype','findOne','download','join','root','server/files/attachments/','html-pdf','eml-format','rimraf'];(function(_0x44f05d,_0x6437c2){var _0x84fda0=function(_0x3dd483){while(--_0x3dd483){_0x44f05d['push'](_0x44f05d['shift']());}};_0x84fda0(++_0x6437c2);}(_0x7f4d,0xa9));var _0xd7f4=function(_0x377caf,_0xb5cf19){_0x377caf=_0x377caf-0x0;var _0x7db00a=_0x7f4d[_0x377caf];return _0x7db00a;};'use strict';var pdf=require(_0xd7f4('0x0'));var emlformat=require(_0xd7f4('0x1'));var rimraf=require(_0xd7f4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd7f4('0x3'));var rp=require(_0xd7f4('0x4'));var moment=require(_0xd7f4('0x5'));var BPromise=require(_0xd7f4('0x6'));var Mustache=require(_0xd7f4('0x7'));var util=require('util');var path=require('path');var sox=require(_0xd7f4('0x8'));var csv=require(_0xd7f4('0x9'));var ejs=require(_0xd7f4('0xa'));var fs=require('fs');var _=require(_0xd7f4('0xb'));var squel=require(_0xd7f4('0xc'));var crypto=require(_0xd7f4('0xd'));var jsforce=require(_0xd7f4('0xe'));var deskjs=require(_0xd7f4('0xf'));var toCsv=require(_0xd7f4('0x9'));var querystring=require('querystring');var Papa=require(_0xd7f4('0x10'));var Redis=require('ioredis');var authService=require(_0xd7f4('0x11'));var qs=require(_0xd7f4('0x12'));var as=require(_0xd7f4('0x13'));var hardwareService=require(_0xd7f4('0x14'));var logger=require(_0xd7f4('0x15'))(_0xd7f4('0x16'));var utils=require(_0xd7f4('0x17'));var config=require('../../config/environment');var db=require(_0xd7f4('0x18'))['db'];function respondWithStatusCode(_0x4498b6,_0x374353){_0x374353=_0x374353||0xcc;return function(_0x395481){if(_0x395481){return _0x4498b6[_0xd7f4('0x19')](_0x374353);}return _0x4498b6[_0xd7f4('0x1a')](_0x374353)[_0xd7f4('0x1b')]();};}function respondWithResult(_0x4c23ec,_0x30a688){_0x30a688=_0x30a688||0xc8;return function(_0x2a4494){if(_0x2a4494){return _0x4c23ec['status'](_0x30a688)[_0xd7f4('0x1c')](_0x2a4494);}};}function respondWithFilteredResult(_0x175536,_0x453f67){return function(_0x3d54f5){if(_0x3d54f5){var _0x1bc4fb=_0x3d54f5['count'],_0x149b38=_0x453f67[_0xd7f4('0x1d')],_0x2adc74=_0x453f67[_0xd7f4('0x1d')]+_0x453f67['limit'],_0x26efc0;if(_0x2adc74>=_0x1bc4fb){_0x2adc74=_0x1bc4fb;_0x26efc0=0xc8;}else{_0x26efc0=0xce;}_0x175536[_0xd7f4('0x1a')](_0x26efc0);return _0x175536['set'](_0xd7f4('0x1e'),_0x149b38+'-'+_0x2adc74+'/'+_0x1bc4fb)[_0xd7f4('0x1c')](_0x3d54f5);}return null;};}function patchUpdates(_0x11436){return function(_0x3a84e9){try{jsonpatch['apply'](_0x3a84e9,_0x11436,!![]);}catch(_0x3fa115){return BPromise[_0xd7f4('0x1f')](_0x3fa115);}return _0x3a84e9[_0xd7f4('0x20')]();};}function saveUpdates(_0x55e962,_0x5988d4){return function(_0x4c50d2){if(_0x4c50d2){return _0x4c50d2['update'](_0x55e962)[_0xd7f4('0x21')](function(_0x5d47b3){return _0x5d47b3;});}return null;};}function removeEntity(_0x337551,_0x367744){return function(_0x59a977){if(_0x59a977){return _0x59a977[_0xd7f4('0x22')]()[_0xd7f4('0x21')](function(){_0x337551['status'](0xcc)[_0xd7f4('0x1b')]();});}};}function handleEntityNotFound(_0x21b0a4,_0x2087db){return function(_0x5f4aaf){if(!_0x5f4aaf){_0x21b0a4[_0xd7f4('0x19')](0x194);}return _0x5f4aaf;};}function handleError(_0x45d6ef,_0x8399a8){_0x8399a8=_0x8399a8||0x1f4;return function(_0x1ab91e){logger['error'](_0x1ab91e[_0xd7f4('0x23')]);if(_0x1ab91e[_0xd7f4('0x24')]){delete _0x1ab91e['name'];}_0x45d6ef[_0xd7f4('0x1a')](_0x8399a8)[_0xd7f4('0x25')](_0x1ab91e);};}exports[_0xd7f4('0x26')]=function(_0x2235a8,_0x4552be){var _0xed30a5={},_0x3378c1={},_0x2e1e94={'count':0x0,'rows':[]};var _0x55959e=_[_0xd7f4('0x27')](db[_0xd7f4('0x28')][_0xd7f4('0x29')],function(_0x495913){return{'name':_0x495913['fieldName'],'type':_0x495913[_0xd7f4('0x2a')]['key']};});_0x3378c1[_0xd7f4('0x2b')]=_[_0xd7f4('0x27')](_0x55959e,'name');_0x3378c1[_0xd7f4('0x2c')]=_[_0xd7f4('0x2d')](_0x2235a8['query']);_0x3378c1[_0xd7f4('0x2e')]=_['intersection'](_0x3378c1[_0xd7f4('0x2b')],_0x3378c1[_0xd7f4('0x2c')]);_0xed30a5['attributes']=_['intersection'](_0x3378c1[_0xd7f4('0x2b')],qs[_0xd7f4('0x2f')](_0x2235a8[_0xd7f4('0x2c')][_0xd7f4('0x2f')]));_0xed30a5[_0xd7f4('0x30')]=_0xed30a5[_0xd7f4('0x30')]['length']?_0xed30a5['attributes']:_0x3378c1['model'];if(!_0x2235a8['query'][_0xd7f4('0x31')](_0xd7f4('0x32'))){_0xed30a5['limit']=qs['limit'](_0x2235a8[_0xd7f4('0x2c')][_0xd7f4('0x33')]);_0xed30a5[_0xd7f4('0x1d')]=qs['offset'](_0x2235a8[_0xd7f4('0x2c')]['offset']);}_0xed30a5[_0xd7f4('0x34')]=qs['sort'](_0x2235a8[_0xd7f4('0x2c')][_0xd7f4('0x35')]);_0xed30a5[_0xd7f4('0x36')]=qs[_0xd7f4('0x2e')](_[_0xd7f4('0x37')](_0x2235a8[_0xd7f4('0x2c')],_0x3378c1[_0xd7f4('0x2e')]),_0x55959e);if(_0x2235a8[_0xd7f4('0x2c')]['filter']){_0xed30a5['where']=_[_0xd7f4('0x38')](_0xed30a5[_0xd7f4('0x36')],{'$or':_[_0xd7f4('0x27')](_0x55959e,function(_0x1dc34b){if(_0x1dc34b['type']!==_0xd7f4('0x39')){var _0x34844a={};_0x34844a[_0x1dc34b[_0xd7f4('0x24')]]={'$like':'%'+_0x2235a8['query'][_0xd7f4('0x3a')]+'%'};return _0x34844a;}})});}_0xed30a5=_[_0xd7f4('0x38')]({},_0xed30a5,_0x2235a8[_0xd7f4('0x3b')]);var _0x58e5ec={'where':_0xed30a5[_0xd7f4('0x36')]};return db[_0xd7f4('0x28')][_0xd7f4('0x3c')](_0x58e5ec)[_0xd7f4('0x21')](function(_0x43f490){_0x2e1e94[_0xd7f4('0x3c')]=_0x43f490;if(_0x2235a8[_0xd7f4('0x2c')][_0xd7f4('0x3d')]){_0xed30a5[_0xd7f4('0x3e')]=[{'all':!![]}];}return db[_0xd7f4('0x28')][_0xd7f4('0x3f')](_0xed30a5);})[_0xd7f4('0x21')](function(_0x1010da){_0x2e1e94[_0xd7f4('0x40')]=_0x1010da;return _0x2e1e94;})[_0xd7f4('0x21')](respondWithFilteredResult(_0x4552be,_0xed30a5))['catch'](handleError(_0x4552be,null));};exports['show']=function(_0x2534c9,_0x29fcec){var _0x4ab355={'raw':!![],'where':{'id':_0x2534c9[_0xd7f4('0x41')]['id']}},_0xd1e8ff={};_0xd1e8ff[_0xd7f4('0x2b')]=_[_0xd7f4('0x2d')](db['Attachment'][_0xd7f4('0x29')]);_0xd1e8ff[_0xd7f4('0x2c')]=_[_0xd7f4('0x2d')](_0x2534c9[_0xd7f4('0x2c')]);_0xd1e8ff[_0xd7f4('0x2e')]=_[_0xd7f4('0x42')](_0xd1e8ff[_0xd7f4('0x2b')],_0xd1e8ff[_0xd7f4('0x2c')]);_0x4ab355['attributes']=_[_0xd7f4('0x42')](_0xd1e8ff['model'],qs[_0xd7f4('0x2f')](_0x2534c9['query'][_0xd7f4('0x2f')]));_0x4ab355[_0xd7f4('0x30')]=_0x4ab355[_0xd7f4('0x30')][_0xd7f4('0x43')]?_0x4ab355[_0xd7f4('0x30')]:_0xd1e8ff['model'];if(_0x2534c9[_0xd7f4('0x2c')][_0xd7f4('0x3d')]){_0x4ab355[_0xd7f4('0x3e')]=[{'all':!![]}];}_0x4ab355=_[_0xd7f4('0x38')]({},_0x4ab355,_0x2534c9['options']);return db[_0xd7f4('0x28')]['find'](_0x4ab355)['then'](handleEntityNotFound(_0x29fcec,null))['then'](respondWithResult(_0x29fcec,null))[_0xd7f4('0x44')](handleError(_0x29fcec,null));};exports[_0xd7f4('0x45')]=function(_0x164b51,_0x361f94){var _0x2d81c2={'where':{'id':_0x164b51['params']['id']}},_0x5a6d36={};_0x5a6d36[_0xd7f4('0x2b')]=_[_0xd7f4('0x2d')](db[_0xd7f4('0x28')]['rawAttributes']);_0x2d81c2['attributes']=_[_0xd7f4('0x42')](_0x5a6d36[_0xd7f4('0x2b')],qs[_0xd7f4('0x2f')](_0x164b51[_0xd7f4('0x2c')][_0xd7f4('0x2f')]));_0x2d81c2[_0xd7f4('0x30')]=_0x2d81c2['attributes'][_0xd7f4('0x43')]?_0x2d81c2['attributes']:_0x5a6d36[_0xd7f4('0x2b')];if(_0x164b51[_0xd7f4('0x2c')][_0xd7f4('0x3d')]){_0x2d81c2['include']=[{'all':!![]}];}_0x2d81c2=_['merge']({},_0x2d81c2,_0x164b51[_0xd7f4('0x3b')]);return db[_0xd7f4('0x28')]['find'](_0x2d81c2)['then'](handleEntityNotFound(_0x361f94,null))[_0xd7f4('0x21')](function(_0x330990){if(_0x330990){var _0x2e5353=_0x330990['get']({'plain':!![]});_0x2e5353=qs[_0xd7f4('0x46')](_0x2e5353,['id',_0xd7f4('0x47'),'updatedAt']);_0x164b51[_0xd7f4('0x48')]=_[_0xd7f4('0x46')](_0x164b51[_0xd7f4('0x48')],['id','createdAt',_0xd7f4('0x49')]);return db['Attachment'][_0xd7f4('0x4a')](_[_0xd7f4('0x38')](_0x2e5353,_0x164b51[_0xd7f4('0x48')]),{'include':_0x164b51[_0xd7f4('0x2c')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xd7f4('0x21')](respondWithResult(_0x361f94,0xc9))[_0xd7f4('0x44')](handleError(_0x361f94,null));};exports[_0xd7f4('0x4b')]=function(_0x5055e8,_0x1baad3){if(_0x5055e8[_0xd7f4('0x48')]['id']){delete _0x5055e8['body']['id'];}return db[_0xd7f4('0x28')]['find']({'where':{'id':_0x5055e8['params']['id']}})[_0xd7f4('0x21')](handleEntityNotFound(_0x1baad3,null))[_0xd7f4('0x21')](saveUpdates(_0x5055e8[_0xd7f4('0x48')],null))[_0xd7f4('0x21')](respondWithResult(_0x1baad3,null))[_0xd7f4('0x44')](handleError(_0x1baad3,null));};exports[_0xd7f4('0x22')]=function(_0x5646f8,_0x5c1ad0){return db['Attachment'][_0xd7f4('0x4c')]({'where':{'id':_0x5646f8[_0xd7f4('0x41')]['id']}})[_0xd7f4('0x21')](handleEntityNotFound(_0x5c1ad0,null))[_0xd7f4('0x21')](removeEntity(_0x5c1ad0,null))['catch'](handleError(_0x5c1ad0,null));};exports[_0xd7f4('0x4a')]=function(_0x1c8c5a,_0x567083,_0x49650d){_0x1c8c5a[_0xd7f4('0x48')][_0xd7f4('0x24')]=_0x1c8c5a[_0xd7f4('0x4d')]['originalname'];_0x1c8c5a[_0xd7f4('0x48')][_0xd7f4('0x4e')]=_0x1c8c5a[_0xd7f4('0x4d')][_0xd7f4('0x4f')];_0x1c8c5a[_0xd7f4('0x48')][_0xd7f4('0x2a')]=_0x1c8c5a[_0xd7f4('0x4d')][_0xd7f4('0x50')];return db[_0xd7f4('0x28')][_0xd7f4('0x4a')](_0x1c8c5a[_0xd7f4('0x48')])['then'](respondWithResult(_0x567083,0xc9))[_0xd7f4('0x44')](handleError(_0x567083,null));};exports['download']=function(_0x3eaa71,_0x455b3f,_0x166ab1){return db[_0xd7f4('0x28')][_0xd7f4('0x51')]({'where':{'id':_0x3eaa71[_0xd7f4('0x41')]['id']},'raw':!![]})[_0xd7f4('0x21')](handleEntityNotFound(_0x455b3f,null))[_0xd7f4('0x21')](function(_0x2cff3d){if(_0x2cff3d){return _0x455b3f[_0xd7f4('0x52')](path[_0xd7f4('0x53')](config[_0xd7f4('0x54')],_0xd7f4('0x55'),_0x2cff3d['basename']));}})[_0xd7f4('0x44')](handleError(_0x455b3f,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 7ee05b4..807dc9a 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 _0xc788=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Attachment','lodash','util'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xc788,0xc4));var _0x8c78=function(_0x482393,_0x355061){_0x482393=_0x482393-0x0;var _0x4c07ae=_0xc788[_0x482393];return _0x4c07ae;};'use strict';var _=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var logger=require(_0x8c78('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8c78('0x3'));var rp=require(_0x8c78('0x4'));var fs=require('fs');var path=require(_0x8c78('0x5'));var rimraf=require(_0x8c78('0x6'));var config=require(_0x8c78('0x7'));var attributes=require('./attachment.attributes');module[_0x8c78('0x8')]=function(_0x4555da,_0x329152){return _0x4555da[_0x8c78('0x9')](_0x8c78('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ff3=['attachments','util','api','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','define'];(function(_0x229558,_0x4ea40e){var _0xa7fa81=function(_0x162a16){while(--_0x162a16){_0x229558['push'](_0x229558['shift']());}};_0xa7fa81(++_0x4ea40e);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2b531a,_0x57f712){_0x2b531a=_0x2b531a-0x0;var _0x5b4c28=_0x5ff3[_0x2b531a];return _0x5b4c28;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('Attachment',attributes,{'tableName':_0x35ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index dce5342..33581a7 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 _0xb617=['client','http','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','Attachment','create','body','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x567b96,_0x48a951){var _0x1c9e34=function(_0x41143c){while(--_0x41143c){_0x567b96['push'](_0x567b96['shift']());}};_0x1c9e34(++_0x48a951);}(_0xb617,0x1a7));var _0x7b61=function(_0x2caae1,_0x2d6ea1){_0x2caae1=_0x2caae1-0x0;var _0x155c22=_0xb617[_0x2caae1];return _0x155c22;};'use strict';var _=require(_0x7b61('0x0'));var util=require(_0x7b61('0x1'));var moment=require(_0x7b61('0x2'));var BPromise=require(_0x7b61('0x3'));var rs=require(_0x7b61('0x4'));var fs=require('fs');var Redis=require(_0x7b61('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b61('0x6'));var logger=require(_0x7b61('0x7'))(_0x7b61('0x8'));var config=require(_0x7b61('0x9'));var jayson=require(_0x7b61('0xa'));var client=jayson[_0x7b61('0xb')][_0x7b61('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x102c26,_0x24952f,_0x2cf994){return new BPromise(function(_0x19e664,_0x24804b){return client['request'](_0x102c26,_0x2cf994)[_0x7b61('0xd')](function(_0x21fb8b){logger['info'](_0x7b61('0xe'),_0x24952f,_0x7b61('0xf'));logger[_0x7b61('0x10')](_0x7b61('0x11'),_0x24952f,_0x7b61('0xf'),JSON[_0x7b61('0x12')](_0x21fb8b));if(_0x21fb8b[_0x7b61('0x13')]){if(_0x21fb8b[_0x7b61('0x13')][_0x7b61('0x14')]===0x1f4){logger[_0x7b61('0x13')](_0x7b61('0xe'),_0x24952f,_0x21fb8b[_0x7b61('0x13')][_0x7b61('0x15')]);return _0x24804b(_0x21fb8b[_0x7b61('0x13')][_0x7b61('0x15')]);}logger[_0x7b61('0x13')]('Attachment,\x20%s,\x20%s',_0x24952f,_0x21fb8b[_0x7b61('0x13')]['message']);return _0x19e664(_0x21fb8b[_0x7b61('0x13')][_0x7b61('0x15')]);}else{logger[_0x7b61('0x16')](_0x7b61('0xe'),_0x24952f,_0x7b61('0xf'));_0x19e664(_0x21fb8b[_0x7b61('0x17')][_0x7b61('0x15')]);}})[_0x7b61('0x18')](function(_0x6494d2){logger[_0x7b61('0x13')](_0x7b61('0xe'),_0x24952f,_0x6494d2);_0x24804b(_0x6494d2);});});}exports['CreateAttachment']=function(_0x500a49){var _0x4a1114=this;return new Promise(function(_0x2ba77b,_0x8305e4){return db[_0x7b61('0x19')][_0x7b61('0x1a')](_0x500a49[_0x7b61('0x1b')],{'raw':_0x500a49[_0x7b61('0x1c')]?_0x500a49[_0x7b61('0x1c')][_0x7b61('0x1d')]===undefined?!![]:![]:!![]})[_0x7b61('0xd')](function(_0xc9dab8){logger[_0x7b61('0x16')](_0x7b61('0x1e'),_0x500a49);logger[_0x7b61('0x10')](_0x7b61('0x1e'),_0x500a49,JSON['stringify'](_0xc9dab8));_0x2ba77b(_0xc9dab8);})[_0x7b61('0x18')](function(_0x106d28){logger['error'](_0x7b61('0x1e'),_0x106d28[_0x7b61('0x15')],_0x500a49);_0x8305e4(_0x4a1114['error'](0x1f4,_0x106d28['message']));});});}; \ No newline at end of file +var _0x56ca=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','Attachment','create','body','options','CreateAttachment','stringify','lodash','moment','randomstring'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0x56ca,0xdd));var _0xa56c=function(_0x18922a,_0x38a196){_0x18922a=_0x18922a-0x0;var _0x12e61f=_0x56ca[_0x18922a];return _0x12e61f;};'use strict';var _=require(_0xa56c('0x0'));var util=require('util');var moment=require(_0xa56c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa56c('0x2'));var fs=require('fs');var Redis=require(_0xa56c('0x3'));var db=require(_0xa56c('0x4'))['db'];var utils=require(_0xa56c('0x5'));var logger=require(_0xa56c('0x6'))('rpc');var config=require(_0xa56c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa56c('0x8')][_0xa56c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15e711,_0x38dd75,_0x11d734){return new BPromise(function(_0x2be4cf,_0x50c5b4){return client[_0xa56c('0xa')](_0x15e711,_0x11d734)[_0xa56c('0xb')](function(_0x5f2425){logger[_0xa56c('0xc')](_0xa56c('0xd'),_0x38dd75,'request\x20sent');logger[_0xa56c('0xe')](_0xa56c('0xf'),_0x38dd75,_0xa56c('0x10'),JSON['stringify'](_0x5f2425));if(_0x5f2425[_0xa56c('0x11')]){if(_0x5f2425[_0xa56c('0x11')][_0xa56c('0x12')]===0x1f4){logger['error'](_0xa56c('0xd'),_0x38dd75,_0x5f2425['error']['message']);return _0x50c5b4(_0x5f2425[_0xa56c('0x11')][_0xa56c('0x13')]);}logger[_0xa56c('0x11')](_0xa56c('0xd'),_0x38dd75,_0x5f2425[_0xa56c('0x11')][_0xa56c('0x13')]);return _0x2be4cf(_0x5f2425[_0xa56c('0x11')]['message']);}else{logger['info']('Attachment,\x20%s,\x20%s',_0x38dd75,_0xa56c('0x10'));_0x2be4cf(_0x5f2425[_0xa56c('0x14')][_0xa56c('0x13')]);}})[_0xa56c('0x15')](function(_0x27775c){logger['error']('Attachment,\x20%s,\x20%s',_0x38dd75,_0x27775c);_0x50c5b4(_0x27775c);});});}exports['CreateAttachment']=function(_0x3a0033){var _0x13819b=this;return new Promise(function(_0x221aa1,_0x288c8f){return db[_0xa56c('0x16')][_0xa56c('0x17')](_0x3a0033[_0xa56c('0x18')],{'raw':_0x3a0033[_0xa56c('0x19')]?_0x3a0033['options']['raw']===undefined?!![]:![]:!![]})[_0xa56c('0xb')](function(_0x1d3479){logger[_0xa56c('0xc')](_0xa56c('0x1a'),_0x3a0033);logger[_0xa56c('0xe')]('CreateAttachment',_0x3a0033,JSON[_0xa56c('0x1b')](_0x1d3479));_0x221aa1(_0x1d3479);})[_0xa56c('0x15')](function(_0x103237){logger[_0xa56c('0x11')]('CreateAttachment',_0x103237[_0xa56c('0x13')],_0x3a0033);_0x288c8f(_0x13819b[_0xa56c('0x11')](0x1f4,_0x103237[_0xa56c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index b1226d6..0d09855 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 _0x5c96=['replace','single','file','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','show','/:id/download','download','post','/:id/clone','clone','diskStorage','root','server/files/attachments/','%s-%s','now','originalname'];(function(_0x388a4e,_0x3a5740){var _0x539d57=function(_0x1f12a1){while(--_0x1f12a1){_0x388a4e['push'](_0x388a4e['shift']());}};_0x539d57(++_0x3a5740);}(_0x5c96,0x133));var _0x65c9=function(_0x48123d,_0x37e9d9){_0x48123d=_0x48123d-0x0;var _0x4078b4=_0x5c96[_0x48123d];return _0x4078b4;};'use strict';var multer=require(_0x65c9('0x0'));var util=require(_0x65c9('0x1'));var path=require(_0x65c9('0x2'));var timeout=require(_0x65c9('0x3'));var express=require('express');var router=express[_0x65c9('0x4')]();var auth=require(_0x65c9('0x5'));var interaction=require(_0x65c9('0x6'));var config=require(_0x65c9('0x7'));var controller=require(_0x65c9('0x8'));router[_0x65c9('0x9')]('/',auth[_0x65c9('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x65c9('0xb')]);router[_0x65c9('0x9')](_0x65c9('0xc'),auth['isAuthenticated'](),controller[_0x65c9('0xd')]);router[_0x65c9('0xe')](_0x65c9('0xf'),auth[_0x65c9('0xa')](),controller[_0x65c9('0x10')]);var upload=multer({'storage':multer[_0x65c9('0x11')]({'destination':function(_0x292827,_0x4f7e7a,_0x5e92a6){_0x5e92a6(null,path['join'](config[_0x65c9('0x12')],_0x65c9('0x13')));},'filename':function(_0x361194,_0x2774ca,_0x429dd4){_0x429dd4(null,util['format'](_0x65c9('0x14'),Date[_0x65c9('0x15')](),_0x2774ca[_0x65c9('0x16')][_0x65c9('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/',upload[_0x65c9('0x18')](_0x65c9('0x19')),controller[_0x65c9('0x1a')]);router[_0x65c9('0x1b')](_0x65c9('0x1c'),auth[_0x65c9('0xa')](),controller[_0x65c9('0x1d')]);router[_0x65c9('0x1e')](_0x65c9('0x1c'),auth[_0x65c9('0xa')](),controller[_0x65c9('0x1f')]);module[_0x65c9('0x20')]=router; \ No newline at end of file +var _0x143a=['get','isAuthenticated','index','/:id','show','/:id/download','download','post','clone','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','single','file','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0x4d4a06,_0x30289a){var _0x1dbcd8=function(_0x30ed6e){while(--_0x30ed6e){_0x4d4a06['push'](_0x4d4a06['shift']());}};_0x1dbcd8(++_0x30289a);}(_0x143a,0x1b9));var _0xa143=function(_0x5c1c49,_0xd7027){_0x5c1c49=_0x5c1c49-0x0;var _0x399334=_0x143a[_0x5c1c49];return _0x399334;};'use strict';var multer=require(_0xa143('0x0'));var util=require(_0xa143('0x1'));var path=require(_0xa143('0x2'));var timeout=require(_0xa143('0x3'));var express=require(_0xa143('0x4'));var router=express['Router']();var auth=require(_0xa143('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa143('0x6'));var controller=require('./attachment.controller');router[_0xa143('0x7')]('/',auth[_0xa143('0x8')](),controller[_0xa143('0x9')]);router[_0xa143('0x7')](_0xa143('0xa'),auth[_0xa143('0x8')](),controller[_0xa143('0xb')]);router[_0xa143('0x7')](_0xa143('0xc'),auth[_0xa143('0x8')](),controller[_0xa143('0xd')]);router[_0xa143('0xe')]('/:id/clone',auth[_0xa143('0x8')](),controller[_0xa143('0xf')]);var upload=multer({'storage':multer[_0xa143('0x10')]({'destination':function(_0x2c1e38,_0x5b7b77,_0x599884){_0x599884(null,path[_0xa143('0x11')](config[_0xa143('0x12')],_0xa143('0x13')));},'filename':function(_0x110aaf,_0xc3cc21,_0x3a5c00){_0x3a5c00(null,util[_0xa143('0x14')](_0xa143('0x15'),Date[_0xa143('0x16')](),_0xc3cc21[_0xa143('0x17')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa143('0xe')]('/',upload[_0xa143('0x18')](_0xa143('0x19')),controller[_0xa143('0x1a')]);router[_0xa143('0x1b')]('/:id',auth[_0xa143('0x8')](),controller[_0xa143('0x1c')]);router[_0xa143('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0xa143('0x1e')]);module[_0xa143('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 5909389..d5c926b 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 _0x40fa=['authenticate','/login','email','callback','google','use','clientSecret','secret','Setting','findOne','allowedLoginAttempts','blockDuration','find','map','agent','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','clearBlockUser','getLicense','lodash','moment','../../mysqldb','../../config/environment','../../config/utils','login'];(function(_0xa28d3a,_0x3789c3){var _0x5d1594=function(_0x495a02){while(--_0x495a02){_0xa28d3a['push'](_0xa28d3a['shift']());}};_0x5d1594(++_0x3789c3);}(_0x40fa,0xbe));var _0xa40f=function(_0x1ebb63,_0x50b589){_0x1ebb63=_0x1ebb63-0x0;var _0x5df442=_0x40fa[_0x1ebb63];return _0x5df442;};'use strict';var _=require(_0xa40f('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0xa40f('0x1'));var db=require(_0xa40f('0x2'))['db'];var config=require(_0xa40f('0x3'));var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0xa40f('0x4'));exports[_0xa40f('0x5')]=passport[_0xa40f('0x6')]('google',{'failureRedirect':_0xa40f('0x7'),'scope':['profile',_0xa40f('0x8')],'session':![]});exports[_0xa40f('0x9')]=passport[_0xa40f('0x6')](_0xa40f('0xa'),{'failureRedirect':_0xa40f('0x7'),'session':![]});passport[_0xa40f('0xb')](new GoogleStrategy({'clientID':config[_0xa40f('0xa')]?config[_0xa40f('0xa')]['clientID']:'id','clientSecret':config[_0xa40f('0xa')]?config[_0xa40f('0xa')][_0xa40f('0xc')]:_0xa40f('0xd'),'callbackURL':config[_0xa40f('0xa')]?config['google']['callbackURL']:''},function(_0x3a4e1c,_0x533c2b,_0x432e47,_0x1ddd89){var _0x40b98e,_0x148df5;return db[_0xa40f('0xe')][_0xa40f('0xf')]({'where':{'id':0x1},'attributes':[_0xa40f('0x10'),_0xa40f('0x11')],'raw':!![]})['then'](function(_0x47119c){_0x40b98e=_0x47119c;return db['User'][_0xa40f('0x12')]({'where':{'email':_[_0xa40f('0x13')](_0x432e47['emails'],'value'),'role':{'$or':['admin','user',_0xa40f('0x14')]}}});})[_0xa40f('0x15')](function(_0x5255cd){_0x148df5=_0x5255cd;if(_0x148df5){if(_0x148df5[_0xa40f('0x16')]){return _0x1ddd89(_0xa40f('0x17'));}else if(_0x40b98e[_0xa40f('0x11')]>0x0){if(_0x148df5['blocked']){if(moment(_0x148df5[_0xa40f('0x18')])[_0xa40f('0x19')](_0x40b98e[_0xa40f('0x11')],'minutes')>moment()){return _0x1ddd89(_0xa40f('0x17'));}else{return utils[_0xa40f('0x1a')](_0x148df5,0x0,![],null)['then'](function(){return utils['getLicense'](_0x148df5);})[_0xa40f('0x15')](function(){return _0x1ddd89(null,_0x148df5);});}}else{return utils[_0xa40f('0x1b')](_0x148df5)[_0xa40f('0x15')](function(){return _0x1ddd89(null,_0x148df5);});}}else{return utils[_0xa40f('0x1b')](_0x148df5)[_0xa40f('0x15')](function(){return _0x1ddd89(null,_0x148df5);});}}return _0x1ddd89(_0xa40f('0x17'));})['catch'](function(_0xa40473){_0x1ddd89(_0xa40473);});})); \ No newline at end of file +var _0x5f30=['moment','../../mysqldb','../../config/environment','../../components/auth/service','../../config/utils','login','authenticate','google','/login','profile','email','callback','clientID','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','blockedAt','minutes','clearBlockUser','getLicense','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','catch','lodash','passport','passport-google-oauth20','Strategy'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x5f30,0x6b));var _0x05f3=function(_0x127d38,_0x2d5833){_0x127d38=_0x127d38-0x0;var _0x42753e=_0x5f30[_0x127d38];return _0x42753e;};'use strict';var _=require(_0x05f3('0x0'));var passport=require(_0x05f3('0x1'));var GoogleStrategy=require(_0x05f3('0x2'))[_0x05f3('0x3')];var moment=require(_0x05f3('0x4'));var db=require(_0x05f3('0x5'))['db'];var config=require(_0x05f3('0x6'));var signToken=require(_0x05f3('0x7'))['signToken'];var utils=require(_0x05f3('0x8'));exports[_0x05f3('0x9')]=passport[_0x05f3('0xa')](_0x05f3('0xb'),{'failureRedirect':_0x05f3('0xc'),'scope':[_0x05f3('0xd'),_0x05f3('0xe')],'session':![]});exports[_0x05f3('0xf')]=passport[_0x05f3('0xa')]('google',{'failureRedirect':_0x05f3('0xc'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x05f3('0xb')]?config['google'][_0x05f3('0x10')]:'id','clientSecret':config[_0x05f3('0xb')]?config['google'][_0x05f3('0x11')]:_0x05f3('0x12'),'callbackURL':config[_0x05f3('0xb')]?config['google'][_0x05f3('0x13')]:''},function(_0xd1b3f,_0x1fc1bf,_0x4d6e88,_0x378b14){var _0x41b985,_0x3119f4;return db[_0x05f3('0x14')]['findOne']({'where':{'id':0x1},'attributes':[_0x05f3('0x15'),_0x05f3('0x16')],'raw':!![]})[_0x05f3('0x17')](function(_0x110a2b){_0x41b985=_0x110a2b;return db[_0x05f3('0x18')][_0x05f3('0x19')]({'where':{'email':_[_0x05f3('0x1a')](_0x4d6e88['emails'],_0x05f3('0x1b')),'role':{'$or':[_0x05f3('0x1c'),_0x05f3('0x1d'),_0x05f3('0x1e')]}}});})[_0x05f3('0x17')](function(_0x1a394c){_0x3119f4=_0x1a394c;if(_0x3119f4){if(_0x3119f4['disabled']){return _0x378b14('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x41b985[_0x05f3('0x16')]>0x0){if(_0x3119f4['blocked']){if(moment(_0x3119f4[_0x05f3('0x1f')])['add'](_0x41b985[_0x05f3('0x16')],_0x05f3('0x20'))>moment()){return _0x378b14('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x05f3('0x21')](_0x3119f4,0x0,![],null)[_0x05f3('0x17')](function(){return utils[_0x05f3('0x22')](_0x3119f4);})[_0x05f3('0x17')](function(){return _0x378b14(null,_0x3119f4);});}}else{return utils[_0x05f3('0x22')](_0x3119f4)[_0x05f3('0x17')](function(){return _0x378b14(null,_0x3119f4);});}}else{return utils[_0x05f3('0x22')](_0x3119f4)[_0x05f3('0x17')](function(){return _0x378b14(null,_0x3119f4);});}}return _0x378b14(_0x05f3('0x23'));})[_0x05f3('0x24')](function(_0x5cdebb){_0x378b14(_0x5cdebb);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 3ba7b83..89d0762 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 _0x8482=['login','/callback','callback','setTokenCookie','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get'];(function(_0x2e02ae,_0x4a4623){var _0x375a6b=function(_0x45c5b2){while(--_0x45c5b2){_0x2e02ae['push'](_0x2e02ae['shift']());}};_0x375a6b(++_0x4a4623);}(_0x8482,0x14e));var _0x2848=function(_0x38e98d,_0x435c81){_0x38e98d=_0x38e98d-0x0;var _0x549efd=_0x8482[_0x38e98d];return _0x549efd;};'use strict';var express=require('express');var passport=require(_0x2848('0x0'));var router=express[_0x2848('0x1')]();var controller=require(_0x2848('0x2'));var userController=require(_0x2848('0x3'));var authService=require(_0x2848('0x4'));router[_0x2848('0x5')]('/',controller[_0x2848('0x6')]);router[_0x2848('0x5')](_0x2848('0x7'),controller[_0x2848('0x8')],authService['isMiddleware'],userController[_0x2848('0x6')],authService[_0x2848('0x9')]);module['exports']=router; \ No newline at end of file +var _0x22a4=['callback','isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x255171,_0x5766cd){var _0x3ffefb=function(_0x5d44e9){while(--_0x5d44e9){_0x255171['push'](_0x255171['shift']());}};_0x3ffefb(++_0x5766cd);}(_0x22a4,0x1cb));var _0x422a=function(_0x1bd7c0,_0x107df4){_0x1bd7c0=_0x1bd7c0-0x0;var _0x437c0d=_0x22a4[_0x1bd7c0];return _0x437c0d;};'use strict';var express=require(_0x422a('0x0'));var passport=require(_0x422a('0x1'));var router=express[_0x422a('0x2')]();var controller=require(_0x422a('0x3'));var userController=require(_0x422a('0x4'));var authService=require(_0x422a('0x5'));router[_0x422a('0x6')]('/',controller[_0x422a('0x7')]);router['get'](_0x422a('0x8'),controller[_0x422a('0x9')],authService[_0x422a('0xa')],userController[_0x422a('0x7')],authService[_0x422a('0xb')]);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 f783923..d0738d3 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 _0xc283=['passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','Setting','findOne','allowedLoginAttempts','then','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','minutes','clearBlockUser','add','getLicense','catch','find','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','name','email','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','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~!@#$%^&-_=+[{]}.','login','local','signToken','body','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','/reset/','status','send','Reset\x20Email\x20sent!','params','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','resetPasswordToken','Password\x20reset!','use','util','passport'];(function(_0x6af960,_0x4dc151){var _0x558974=function(_0x56cb16){while(--_0x56cb16){_0x6af960['push'](_0x6af960['shift']());}};_0x558974(++_0x4dc151);}(_0xc283,0x189));var _0x3c28=function(_0x1b3be2,_0x8a1781){_0x1b3be2=_0x1b3be2-0x0;var _0x335090=_0xc283[_0x1b3be2];return _0x335090;};'use strict';var util=require(_0x3c28('0x0'));var passport=require(_0x3c28('0x1'));var LocalStrategy=require(_0x3c28('0x2'))[_0x3c28('0x3')];var jayson=require(_0x3c28('0x4'));var _=require(_0x3c28('0x5'));var rs=require(_0x3c28('0x6'));var moment=require(_0x3c28('0x7'));var db=require('../../mysqldb')['db'];var authService=require(_0x3c28('0x8'));var utils=require(_0x3c28('0x9'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x51cf5a,_0x26aeaf,_0x5577bc,_0x5b663b){var _0x1d56b1,_0x5c8f48;return db[_0x3c28('0xa')][_0x3c28('0xb')]({'where':{'id':0x1},'attributes':[_0x3c28('0xc'),'blockDuration'],'raw':!![]})[_0x3c28('0xd')](function(_0x3d4506){_0x1d56b1=_0x3d4506;return _0x51cf5a['findOne']({'attributes':['id','name','password',_0x3c28('0xe'),_0x3c28('0xf'),_0x3c28('0x10'),_0x3c28('0x11'),_0x3c28('0x12'),_0x3c28('0x13')],'where':{'name':_0x26aeaf,'role':{'$or':[_0x3c28('0x14'),_0x3c28('0x15'),_0x3c28('0x16')]}}});})[_0x3c28('0xd')](function(_0x16a6e9){if(!_0x16a6e9||_0x16a6e9&&_0x16a6e9['name']!==_0x26aeaf){throw new Error(_0x3c28('0x17'));}else{_0x5c8f48=_0x16a6e9;return _0x5c8f48;}})[_0x3c28('0xd')](function(){_0x5c8f48[_0x3c28('0x18')](_0x5577bc,function(_0x319d88,_0x1e6e89){var _0x12a3c2=_0x5c8f48['loginAttempts']+0x1;if(_0x319d88){return _0x5b663b(_0x319d88);}else if(!_0x1e6e89){if(_0x5c8f48['disabled']){return _0x5b663b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1d56b1[_0x3c28('0xc')]>0x0){if(_0x5c8f48[_0x3c28('0x11')]){if(_0x1d56b1[_0x3c28('0x19')]>0x0){if(moment(_0x5c8f48[_0x3c28('0x12')])['add'](_0x1d56b1[_0x3c28('0x19')],_0x3c28('0x1a'))>moment()){return _0x5b663b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3c28('0x1b')](_0x5c8f48,_0x12a3c2,![],null)[_0x3c28('0xd')](function(){return _0x5b663b(null,![],{'message':_0x3c28('0x17')});});}}else{return _0x5b663b(null,![],{'message':_0x3c28('0x17')});}}else{if(_0x12a3c2>=_0x1d56b1['allowedLoginAttempts']){return utils[_0x3c28('0x1b')](_0x5c8f48,0x0,!![],moment())[_0x3c28('0xd')](function(){return _0x5b663b(null,![],{'message':_0x3c28('0x17')});});}else{return utils['clearBlockUser'](_0x5c8f48,_0x12a3c2,![],null)[_0x3c28('0xd')](function(){return _0x5b663b(null,![],{'message':_0x3c28('0x17')});});}}}else{return _0x5b663b(null,![],{'message':_0x3c28('0x17')});}}else{if(_0x5c8f48[_0x3c28('0x10')]){return _0x5b663b(null,![],{'message':_0x3c28('0x17')});}else if(_0x1d56b1[_0x3c28('0xc')]>0x0){if(_0x5c8f48['blocked']){if(_0x1d56b1[_0x3c28('0x19')]>0x0){if(moment(_0x5c8f48[_0x3c28('0x12')])[_0x3c28('0x1c')](_0x1d56b1[_0x3c28('0x19')],'minutes')>moment()){return _0x5b663b(null,![],{'message':_0x3c28('0x17')});}else{return utils[_0x3c28('0x1b')](_0x5c8f48,0x0,![],null)['then'](function(){return utils[_0x3c28('0x1d')](_0x5c8f48);})[_0x3c28('0xd')](function(){return _0x5b663b(null,_0x5c8f48);});}}else{return _0x5b663b(null,![],{'message':_0x3c28('0x17')});}}else{return utils[_0x3c28('0x1b')](_0x5c8f48,0x0,![],null)[_0x3c28('0xd')](function(){return utils[_0x3c28('0x1d')](_0x5c8f48);})[_0x3c28('0xd')](function(){return _0x5b663b(null,_0x5c8f48);})[_0x3c28('0x1e')](function(_0x22d5ec){return _0x5b663b(null,![],_0x22d5ec);});}}else{if(_0x5c8f48[_0x3c28('0x11')]){return _0x5b663b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3c28('0x1d')](_0x5c8f48)[_0x3c28('0xd')](function(){return _0x5b663b(null,_0x5c8f48);});}}}});})[_0x3c28('0x1e')](function(_0x2a5d78){return _0x5b663b(null,![],_0x2a5d78);});}function sendServiceMail(_0x1e3d13){return db['MailAccount'][_0x3c28('0x1f')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0x3c28('0x20')}]})[_0x3c28('0xd')](function(_0x448e78){if(!_0x448e78){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x3e4bc5={'tls':{'rejectUnauthorized':![]}};if(_0x448e78['Smtp'][_0x3c28('0x21')]){_0x3e4bc5[_0x3c28('0x21')]=_0x448e78['Smtp'][_0x3c28('0x21')];}else{_0x3e4bc5['host']=_0x448e78[_0x3c28('0x20')][_0x3c28('0x22')];_0x3e4bc5[_0x3c28('0x23')]=_0x448e78[_0x3c28('0x20')][_0x3c28('0x23')];_0x3e4bc5['secure']=_0x448e78[_0x3c28('0x20')][_0x3c28('0x24')];}if(_0x448e78[_0x3c28('0x20')][_0x3c28('0x25')]){_0x3e4bc5[_0x3c28('0x26')]={'user':_0x448e78['Smtp'][_0x3c28('0x15')],'pass':_0x448e78[_0x3c28('0x20')][_0x3c28('0x27')]};}var _0x10facd={'account':_0x3e4bc5,'message':_['merge']({'from':util[_0x3c28('0x28')](_0x3c28('0x29'),_0x448e78[_0x3c28('0x2a')],_0x448e78[_0x3c28('0x2b')]||_0x448e78[_0x3c28('0x20')][_0x3c28('0x15')])},_0x1e3d13)};return client['request'](_0x3c28('0x2c'),_0x10facd);})[_0x3c28('0xd')](function(_0x3a69ac){if(_0x3a69ac[_0x3c28('0x2d')]){throw new Error(util[_0x3c28('0x28')](_0x3c28('0x2e'),_0x3a69ac[_0x3c28('0x2d')][_0x3c28('0x2f')]||JSON[_0x3c28('0x30')](_0x3a69ac[_0x3c28('0x2d')])));}return!![];});}function handleError(_0x27636a,_0x2e7875,_0x4a3f2c){return _0x27636a['status'](_0x2e7875||0x1f4)['send']({'message':_0x4a3f2c?_0x4a3f2c[_0x3c28('0x2f')]||_0x4a3f2c:''});}function checkPasswordPattern(_0x2355cf,_0x16bedc,_0x50b873){if(_0x50b873){var _0x3ced41=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ced41[_0x3c28('0x31')](_0x16bedc)){return _0x2355cf;}else{throw new Error(_0x3c28('0x32'));}}else{return _0x2355cf;}}exports[_0x3c28('0x33')]=function(_0x564cac,_0x135cdb,_0x3c6fc0){passport[_0x3c28('0x18')](_0x3c28('0x34'),function(_0x4d83bc,_0x509cbc,_0x4dd87d){var _0x152a08=_0x4d83bc||_0x4dd87d;if(_0x152a08){return handleError(_0x135cdb,0x191,_0x152a08);}if(!_0x509cbc){return handleError(_0x135cdb,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x26ea95={'payload':{'id':_0x509cbc['id'],'role':_0x509cbc[_0x3c28('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x3c28('0x35')](_0x26ea95)[_0x3c28('0xd')](function(_0x2bec7c){_0x135cdb['json']({'id':_0x509cbc['id'],'token':_0x2bec7c,'statusCall':'','isAlreadyLogged':_0x509cbc['online']});});}})(_0x564cac,_0x135cdb,_0x3c6fc0);};exports['forgot']=function(_0x40cc61,_0x4aa956,_0x3ef82e){if(!_0x40cc61[_0x3c28('0x36')][_0x3c28('0x2b')]){return handleError(_0x4aa956,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x3f5704=rs[_0x3c28('0x37')]();_0x40cc61[_0x3c28('0x36')][_0x3c28('0x2b')]=_0x40cc61[_0x3c28('0x36')][_0x3c28('0x2b')][_0x3c28('0x38')]()[_0x3c28('0x39')]();var _0x3d9db5;return db[_0x3c28('0xa')][_0x3c28('0xb')]({'where':{'id':0x1},'attributes':[_0x3c28('0xc'),_0x3c28('0x19')],'raw':!![]})[_0x3c28('0xd')](function(_0x516c67){_0x3d9db5=_0x516c67;return db[_0x3c28('0x3a')][_0x3c28('0x1f')]({'where':{'email':_0x40cc61['body']['email']}});})[_0x3c28('0xd')](function(_0x44683f){if(!_0x44683f){throw new Error(_0x3c28('0x3b'));}if(_0x44683f['disabled']){throw new Error(_0x3c28('0x3c'));}if(_0x44683f[_0x3c28('0x11')]){if(moment(_0x44683f[_0x3c28('0x12')])[_0x3c28('0x1c')](_0x3d9db5[_0x3c28('0x19')],_0x3c28('0x1a'))>moment()){throw new Error(_0x3c28('0x3d'));}else{_0x44683f['blocked']=![];_0x44683f[_0x3c28('0x12')]=null;}}_0x44683f['resetPasswordToken']=_0x3f5704;_0x44683f[_0x3c28('0x3e')]=Date['now']()+0x36ee80;return _0x44683f[_0x3c28('0x3f')]();})[_0x3c28('0xd')](function(){return sendServiceMail({'to':_0x40cc61[_0x3c28('0x36')][_0x3c28('0x2b')],'subject':_0x3c28('0x40'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x3c28('0x41')+_0x3c28('0x42')+_0x40cc61[_0x3c28('0x43')][_0x3c28('0x22')]+_0x3c28('0x44')+_0x3f5704+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x3c28('0xd')](function(){_0x4aa956[_0x3c28('0x45')](0xc8)[_0x3c28('0x46')]({'message':_0x3c28('0x47')});})['catch'](function(_0x195bea){return handleError(_0x4aa956,0x1f4,_0x195bea);});};exports['reset']=function(_0x509a0d,_0x336d1c,_0x580ece){var _0x204dd5;return db['User'][_0x3c28('0x1f')]({'where':{'resetPasswordToken':_0x509a0d[_0x3c28('0x48')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x3c28('0xd')](function(_0x320095){_0x204dd5=_0x320095;if(!_0x204dd5){throw new Error(_0x3c28('0x49'));}return db[_0x3c28('0xa')][_0x3c28('0xb')]({'attributes':['id',_0x3c28('0x4a')]});})['then'](function(_0x368066){return checkPasswordPattern(_0x368066,_0x509a0d['body']['password'],_0x368066[_0x3c28('0x4a')]);})[_0x3c28('0xd')](function(){_0x204dd5[_0x3c28('0x4b')]=_0x509a0d[_0x3c28('0x36')][_0x3c28('0x4b')];_0x204dd5[_0x3c28('0x4c')]=null;_0x204dd5[_0x3c28('0x3e')]=null;return _0x204dd5[_0x3c28('0x3f')]();})[_0x3c28('0xd')](function(){_0x336d1c[_0x3c28('0x45')](0xc8)[_0x3c28('0x46')]({'message':_0x3c28('0x4d')});})[_0x3c28('0x1e')](function(_0x4b5cbd){return handleError(_0x336d1c,0x1f4,_0x4b5cbd);});};passport[_0x3c28('0x4e')](new LocalStrategy({'usernameField':'name','passwordField':_0x3c28('0x4b')},function(_0x1e8042,_0x75dda4,_0x4ddc97){return localAuthenticate(db['User'],_0x1e8042,_0x75dda4,_0x4ddc97);})); \ No newline at end of file +var _0x9565=['now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','util','passport','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','blockDuration','then','findOne','name','password','salt','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','pass','merge','\x22%s\x22\x20<%s>','request','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','error','status','send','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~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','forgot','body','email','generate','trim','toLowerCase','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires'];(function(_0x1cc322,_0x2be75c){var _0x613466=function(_0x4e9341){while(--_0x4e9341){_0x1cc322['push'](_0x1cc322['shift']());}};_0x613466(++_0x2be75c);}(_0x9565,0x10a));var _0x5956=function(_0xf58d6e,_0x30f261){_0xf58d6e=_0xf58d6e-0x0;var _0x5510c5=_0x9565[_0xf58d6e];return _0x5510c5;};'use strict';var util=require(_0x5956('0x0'));var passport=require(_0x5956('0x1'));var LocalStrategy=require('passport-local')[_0x5956('0x2')];var jayson=require(_0x5956('0x3'));var _=require(_0x5956('0x4'));var rs=require(_0x5956('0x5'));var moment=require(_0x5956('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x5956('0x7'));var utils=require(_0x5956('0x8'));var client=jayson[_0x5956('0x9')][_0x5956('0xa')]({'port':0x232b});function localAuthenticate(_0x512eb3,_0x3e9a8d,_0x57881e,_0x331d24){var _0x2b5b93,_0x2fbda0;return db[_0x5956('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5956('0xc')],'raw':!![]})[_0x5956('0xd')](function(_0x10e52b){_0x2b5b93=_0x10e52b;return _0x512eb3[_0x5956('0xe')]({'attributes':['id',_0x5956('0xf'),_0x5956('0x10'),_0x5956('0x11'),_0x5956('0x12'),_0x5956('0x13'),_0x5956('0x14'),'blockedAt',_0x5956('0x15')],'where':{'name':_0x3e9a8d,'role':{'$or':[_0x5956('0x16'),_0x5956('0x17'),_0x5956('0x18')]}}});})[_0x5956('0xd')](function(_0x1fe3e9){if(!_0x1fe3e9||_0x1fe3e9&&_0x1fe3e9[_0x5956('0xf')]!==_0x3e9a8d){throw new Error(_0x5956('0x19'));}else{_0x2fbda0=_0x1fe3e9;return _0x2fbda0;}})[_0x5956('0xd')](function(){_0x2fbda0[_0x5956('0x1a')](_0x57881e,function(_0x35a1c5,_0x2dccd8){var _0x1cc010=_0x2fbda0[_0x5956('0x15')]+0x1;if(_0x35a1c5){return _0x331d24(_0x35a1c5);}else if(!_0x2dccd8){if(_0x2fbda0[_0x5956('0x13')]){return _0x331d24(null,![],{'message':_0x5956('0x19')});}else if(_0x2b5b93[_0x5956('0x1b')]>0x0){if(_0x2fbda0[_0x5956('0x14')]){if(_0x2b5b93[_0x5956('0xc')]>0x0){if(moment(_0x2fbda0[_0x5956('0x1c')])[_0x5956('0x1d')](_0x2b5b93[_0x5956('0xc')],_0x5956('0x1e'))>moment()){return _0x331d24(null,![],{'message':_0x5956('0x19')});}else{return utils[_0x5956('0x1f')](_0x2fbda0,_0x1cc010,![],null)['then'](function(){return _0x331d24(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x331d24(null,![],{'message':_0x5956('0x19')});}}else{if(_0x1cc010>=_0x2b5b93[_0x5956('0x1b')]){return utils[_0x5956('0x1f')](_0x2fbda0,0x0,!![],moment())[_0x5956('0xd')](function(){return _0x331d24(null,![],{'message':_0x5956('0x19')});});}else{return utils['clearBlockUser'](_0x2fbda0,_0x1cc010,![],null)[_0x5956('0xd')](function(){return _0x331d24(null,![],{'message':_0x5956('0x19')});});}}}else{return _0x331d24(null,![],{'message':_0x5956('0x19')});}}else{if(_0x2fbda0['disabled']){return _0x331d24(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2b5b93[_0x5956('0x1b')]>0x0){if(_0x2fbda0[_0x5956('0x14')]){if(_0x2b5b93[_0x5956('0xc')]>0x0){if(moment(_0x2fbda0[_0x5956('0x1c')])['add'](_0x2b5b93[_0x5956('0xc')],'minutes')>moment()){return _0x331d24(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5956('0x1f')](_0x2fbda0,0x0,![],null)[_0x5956('0xd')](function(){return utils['getLicense'](_0x2fbda0);})[_0x5956('0xd')](function(){return _0x331d24(null,_0x2fbda0);});}}else{return _0x331d24(null,![],{'message':_0x5956('0x19')});}}else{return utils[_0x5956('0x1f')](_0x2fbda0,0x0,![],null)[_0x5956('0xd')](function(){return utils[_0x5956('0x20')](_0x2fbda0);})[_0x5956('0xd')](function(){return _0x331d24(null,_0x2fbda0);})[_0x5956('0x21')](function(_0x35fab2){return _0x331d24(null,![],_0x35fab2);});}}else{if(_0x2fbda0[_0x5956('0x14')]){return _0x331d24(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x2fbda0)[_0x5956('0xd')](function(){return _0x331d24(null,_0x2fbda0);});}}}});})['catch'](function(_0x6ee170){return _0x331d24(null,![],_0x6ee170);});}function sendServiceMail(_0x5ab4e5){return db[_0x5956('0x22')][_0x5956('0x23')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0x5956('0x24')}]})[_0x5956('0xd')](function(_0x4d0f19){if(!_0x4d0f19){throw new Error(_0x5956('0x25'));}var _0x10a2fa={'tls':{'rejectUnauthorized':![]}};if(_0x4d0f19[_0x5956('0x24')][_0x5956('0x26')]){_0x10a2fa[_0x5956('0x26')]=_0x4d0f19[_0x5956('0x24')]['service'];}else{_0x10a2fa['host']=_0x4d0f19[_0x5956('0x24')][_0x5956('0x27')];_0x10a2fa[_0x5956('0x28')]=_0x4d0f19[_0x5956('0x24')]['port'];_0x10a2fa[_0x5956('0x29')]=_0x4d0f19[_0x5956('0x24')][_0x5956('0x29')];}if(_0x4d0f19[_0x5956('0x24')][_0x5956('0x2a')]){_0x10a2fa['auth']={'user':_0x4d0f19[_0x5956('0x24')][_0x5956('0x17')],'pass':_0x4d0f19[_0x5956('0x24')][_0x5956('0x2b')]};}var _0x66054b={'account':_0x10a2fa,'message':_[_0x5956('0x2c')]({'from':util['format'](_0x5956('0x2d'),_0x4d0f19[_0x5956('0xf')],_0x4d0f19['email']||_0x4d0f19['Smtp']['user'])},_0x5ab4e5)};return client[_0x5956('0x2e')]('SendMail',_0x66054b);})['then'](function(_0x51520a){if(_0x51520a['error']){throw new Error(util[_0x5956('0x2f')](_0x5956('0x30'),_0x51520a['error'][_0x5956('0x31')]||JSON['stringify'](_0x51520a[_0x5956('0x32')])));}return!![];});}function handleError(_0x527646,_0x4f485d,_0x102bd4){return _0x527646[_0x5956('0x33')](_0x4f485d||0x1f4)[_0x5956('0x34')]({'message':_0x102bd4?_0x102bd4['message']||_0x102bd4:''});}function checkPasswordPattern(_0x174053,_0x559e91,_0x4d8d68){if(_0x4d8d68){var _0x2fc991=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2fc991[_0x5956('0x35')](_0x559e91)){return _0x174053;}else{throw new Error(_0x5956('0x36'));}}else{return _0x174053;}}exports[_0x5956('0x37')]=function(_0x2218f4,_0xac4e6,_0x11837a){passport[_0x5956('0x1a')](_0x5956('0x38'),function(_0x353c38,_0x4a9e5a,_0x104ac4){var _0x5aa125=_0x353c38||_0x104ac4;if(_0x5aa125){return handleError(_0xac4e6,0x191,_0x5aa125);}if(!_0x4a9e5a){return handleError(_0xac4e6,0x194,{'message':_0x5956('0x39')});}else{var _0x201009={'payload':{'id':_0x4a9e5a['id'],'role':_0x4a9e5a[_0x5956('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x201009)[_0x5956('0xd')](function(_0x4f215f){_0xac4e6['json']({'id':_0x4a9e5a['id'],'token':_0x4f215f,'statusCall':'','isAlreadyLogged':_0x4a9e5a[_0x5956('0x3a')]});});}})(_0x2218f4,_0xac4e6,_0x11837a);};exports[_0x5956('0x3b')]=function(_0x2c074a,_0x41a346,_0x1478c1){if(!_0x2c074a[_0x5956('0x3c')][_0x5956('0x3d')]){return handleError(_0x41a346,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5e69fd=rs[_0x5956('0x3e')]();_0x2c074a[_0x5956('0x3c')][_0x5956('0x3d')]=_0x2c074a[_0x5956('0x3c')][_0x5956('0x3d')][_0x5956('0x3f')]()[_0x5956('0x40')]();var _0x4ae9f9;return db[_0x5956('0xb')][_0x5956('0xe')]({'where':{'id':0x1},'attributes':[_0x5956('0x1b'),_0x5956('0xc')],'raw':!![]})[_0x5956('0xd')](function(_0x364181){_0x4ae9f9=_0x364181;return db[_0x5956('0x41')][_0x5956('0x23')]({'where':{'email':_0x2c074a[_0x5956('0x3c')][_0x5956('0x3d')]}});})[_0x5956('0xd')](function(_0x3e50e8){if(!_0x3e50e8){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x3e50e8['disabled']){throw new Error(_0x5956('0x42'));}if(_0x3e50e8[_0x5956('0x14')]){if(moment(_0x3e50e8['blockedAt'])[_0x5956('0x1d')](_0x4ae9f9[_0x5956('0xc')],_0x5956('0x1e'))>moment()){throw new Error(_0x5956('0x43'));}else{_0x3e50e8[_0x5956('0x14')]=![];_0x3e50e8[_0x5956('0x1c')]=null;}}_0x3e50e8[_0x5956('0x44')]=_0x5e69fd;_0x3e50e8[_0x5956('0x45')]=Date[_0x5956('0x46')]()+0x36ee80;return _0x3e50e8[_0x5956('0x47')]();})['then'](function(){return sendServiceMail({'to':_0x2c074a[_0x5956('0x3c')][_0x5956('0x3d')],'subject':_0x5956('0x48'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x5956('0x49')+_0x5956('0x4a')+_0x2c074a[_0x5956('0x4b')]['host']+_0x5956('0x4c')+_0x5e69fd+'\x0a\x0a'+_0x5956('0x4d')});})[_0x5956('0xd')](function(){_0x41a346[_0x5956('0x33')](0xc8)[_0x5956('0x34')]({'message':_0x5956('0x4e')});})[_0x5956('0x21')](function(_0x549939){return handleError(_0x41a346,0x1f4,_0x549939);});};exports[_0x5956('0x4f')]=function(_0x550ac2,_0x4842fb,_0x2b5fbb){var _0x1d6207;return db[_0x5956('0x41')][_0x5956('0x23')]({'where':{'resetPasswordToken':_0x550ac2[_0x5956('0x50')][_0x5956('0x51')],'resetPasswordExpires':{'$gt':Date[_0x5956('0x46')]()}}})[_0x5956('0xd')](function(_0x484353){_0x1d6207=_0x484353;if(!_0x1d6207){throw new Error(_0x5956('0x52'));}return db[_0x5956('0xb')][_0x5956('0xe')]({'attributes':['id',_0x5956('0x53')]});})[_0x5956('0xd')](function(_0x5e60da){return checkPasswordPattern(_0x5e60da,_0x550ac2[_0x5956('0x3c')][_0x5956('0x10')],_0x5e60da[_0x5956('0x53')]);})['then'](function(){_0x1d6207['password']=_0x550ac2[_0x5956('0x3c')]['password'];_0x1d6207['resetPasswordToken']=null;_0x1d6207[_0x5956('0x45')]=null;return _0x1d6207[_0x5956('0x47')]();})[_0x5956('0xd')](function(){_0x4842fb[_0x5956('0x33')](0xc8)[_0x5956('0x34')]({'message':'Password\x20reset!'});})[_0x5956('0x21')](function(_0x429862){return handleError(_0x4842fb,0x1f4,_0x429862);});};passport['use'](new LocalStrategy({'usernameField':_0x5956('0xf'),'passwordField':_0x5956('0x10')},function(_0x7e258d,_0x25b1b1,_0x43a522){return localAuthenticate(db['User'],_0x7e258d,_0x25b1b1,_0x43a522);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 7cb20f4..ccf5f51 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 _0x5873=['./authLocal.controller','post','login','/forgot','exports','Router'];(function(_0x810025,_0x34bb04){var _0x4dbc81=function(_0x2c3907){while(--_0x2c3907){_0x810025['push'](_0x810025['shift']());}};_0x4dbc81(++_0x34bb04);}(_0x5873,0x1d9));var _0x3587=function(_0x3b49a1,_0x427c87){_0x3b49a1=_0x3b49a1-0x0;var _0x30be74=_0x5873[_0x3b49a1];return _0x30be74;};'use strict';var express=require('express');var router=express[_0x3587('0x0')]();var controller=require(_0x3587('0x1'));router[_0x3587('0x2')]('/',controller[_0x3587('0x3')]);router[_0x3587('0x2')](_0x3587('0x4'),controller['forgot']);router[_0x3587('0x2')]('/reset/:token',controller['reset']);module[_0x3587('0x5')]=router; \ No newline at end of file +var _0x457b=['./authLocal.controller','post','express','Router'];(function(_0x446731,_0x4115d9){var _0x27a3ea=function(_0xf8a18){while(--_0xf8a18){_0x446731['push'](_0x446731['shift']());}};_0x27a3ea(++_0x4115d9);}(_0x457b,0x142));var _0xb457=function(_0x5d3ad7,_0x150d60){_0x5d3ad7=_0x5d3ad7-0x0;var _0x1ed853=_0x457b[_0x5d3ad7];return _0x1ed853;};'use strict';var express=require(_0xb457('0x0'));var router=express[_0xb457('0x1')]();var controller=require(_0xb457('0x2'));router['post']('/',controller['login']);router[_0xb457('0x3')]('/forgot',controller['forgot']);router[_0xb457('0x3')]('/reset/:token',controller['reset']);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 0f4cd9a..5eb48a1 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 _0xec5c=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xec5c,0x7a));var _0xcec5=function(_0x5f42f1,_0x956be5){_0x5f42f1=_0x5f42f1-0x0;var _0x5534ee=_0xec5c[_0x5f42f1];return _0x5534ee;};'use strict';var Sequelize=require(_0xcec5('0x0'));module[_0xcec5('0x1')]={'name':{'type':Sequelize[_0xcec5('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xcec5('0x2')]},'description':{'type':Sequelize[_0xcec5('0x2')]},'status':{'type':Sequelize[_0xcec5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xcec5('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xb8b1=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x1f3c11,_0x89bc65){var _0x546d69=function(_0x16c043){while(--_0x16c043){_0x1f3c11['push'](_0x1f3c11['shift']());}};_0x546d69(++_0x89bc65);}(_0xb8b1,0x1cc));var _0x1b8b=function(_0x452450,_0x40b419){_0x452450=_0x452450-0x0;var _0x448b19=_0xb8b1[_0x452450];return _0x448b19;};'use strict';var Sequelize=require(_0x1b8b('0x0'));module[_0x1b8b('0x1')]={'name':{'type':Sequelize[_0x1b8b('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x1b8b('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x1b8b('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1b8b('0x4')],'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 fa781b9..c5cb0fe 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 _0x9aaf=['offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','map','Automation','fieldName','type','query','keys','intersection','model','attributes','fields','length','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','addConditions','ids','omit','getConditions','findOne','hasOwnProperty','addActions','getActions','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','count'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x9aaf,0x87));var _0xf9aa=function(_0x126f47,_0x2199e9){_0x126f47=_0x126f47-0x0;var _0x49508a=_0x9aaf[_0x126f47];return _0x49508a;};'use strict';var pdf=require(_0xf9aa('0x0'));var emlformat=require(_0xf9aa('0x1'));var rimraf=require(_0xf9aa('0x2'));var zipdir=require(_0xf9aa('0x3'));var jsonpatch=require(_0xf9aa('0x4'));var rp=require(_0xf9aa('0x5'));var moment=require('moment');var BPromise=require(_0xf9aa('0x6'));var Mustache=require('mustache');var util=require(_0xf9aa('0x7'));var path=require('path');var sox=require(_0xf9aa('0x8'));var csv=require('to-csv');var ejs=require(_0xf9aa('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf9aa('0xa'));var crypto=require(_0xf9aa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf9aa('0xc'));var toCsv=require(_0xf9aa('0xd'));var querystring=require(_0xf9aa('0xe'));var Papa=require(_0xf9aa('0xf'));var Redis=require(_0xf9aa('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf9aa('0x11'));var as=require(_0xf9aa('0x12'));var hardwareService=require(_0xf9aa('0x13'));var logger=require(_0xf9aa('0x14'))(_0xf9aa('0x15'));var utils=require(_0xf9aa('0x16'));var config=require(_0xf9aa('0x17'));var db=require(_0xf9aa('0x18'))['db'];function respondWithStatusCode(_0x52587e,_0x1069d1){_0x1069d1=_0x1069d1||0xcc;return function(_0x5cc09e){if(_0x5cc09e){return _0x52587e['sendStatus'](_0x1069d1);}return _0x52587e[_0xf9aa('0x19')](_0x1069d1)['end']();};}function respondWithResult(_0x3cc759,_0x5e3580){_0x5e3580=_0x5e3580||0xc8;return function(_0x220dc0){if(_0x220dc0){return _0x3cc759[_0xf9aa('0x19')](_0x5e3580)['json'](_0x220dc0);}};}function respondWithFilteredResult(_0x137460,_0xa3896a){return function(_0x4d9dce){if(_0x4d9dce){var _0x1b848d=_0x4d9dce[_0xf9aa('0x1a')],_0x3b381c=_0xa3896a[_0xf9aa('0x1b')],_0x27700b=_0xa3896a['offset']+_0xa3896a['limit'],_0xa84212;if(_0x27700b>=_0x1b848d){_0x27700b=_0x1b848d;_0xa84212=0xc8;}else{_0xa84212=0xce;}_0x137460[_0xf9aa('0x19')](_0xa84212);return _0x137460[_0xf9aa('0x1c')](_0xf9aa('0x1d'),_0x3b381c+'-'+_0x27700b+'/'+_0x1b848d)[_0xf9aa('0x1e')](_0x4d9dce);}return null;};}function patchUpdates(_0x4ad4eb){return function(_0x5ddd91){try{jsonpatch[_0xf9aa('0x1f')](_0x5ddd91,_0x4ad4eb,!![]);}catch(_0x12b72d){return BPromise[_0xf9aa('0x20')](_0x12b72d);}return _0x5ddd91[_0xf9aa('0x21')]();};}function saveUpdates(_0x585e28,_0x2d9564){return function(_0x20e5d9){if(_0x20e5d9){return _0x20e5d9[_0xf9aa('0x22')](_0x585e28)[_0xf9aa('0x23')](function(_0x1e7333){return _0x1e7333;});}return null;};}function removeEntity(_0x3e0ebb,_0x5063e6){return function(_0x25181d){if(_0x25181d){return _0x25181d[_0xf9aa('0x24')]()[_0xf9aa('0x23')](function(){_0x3e0ebb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x506615,_0x3e6df9){return function(_0x2c92f0){if(!_0x2c92f0){_0x506615['sendStatus'](0x194);}return _0x2c92f0;};}function handleError(_0x2c5b27,_0x38ce81){_0x38ce81=_0x38ce81||0x1f4;return function(_0x2ece86){logger[_0xf9aa('0x25')](_0x2ece86['stack']);if(_0x2ece86[_0xf9aa('0x26')]){delete _0x2ece86[_0xf9aa('0x26')];}_0x2c5b27[_0xf9aa('0x19')](_0x38ce81)[_0xf9aa('0x27')](_0x2ece86);};}exports['index']=function(_0x3cdb90,_0x1a81f4){var _0x573742={},_0x4efa7b={},_0x3129fc={'count':0x0,'rows':[]};var _0x331bf6=_[_0xf9aa('0x28')](db[_0xf9aa('0x29')]['rawAttributes'],function(_0x338e32){return{'name':_0x338e32[_0xf9aa('0x2a')],'type':_0x338e32[_0xf9aa('0x2b')]['key']};});_0x4efa7b['model']=_[_0xf9aa('0x28')](_0x331bf6,_0xf9aa('0x26'));_0x4efa7b[_0xf9aa('0x2c')]=_[_0xf9aa('0x2d')](_0x3cdb90[_0xf9aa('0x2c')]);_0x4efa7b['filters']=_[_0xf9aa('0x2e')](_0x4efa7b[_0xf9aa('0x2f')],_0x4efa7b[_0xf9aa('0x2c')]);_0x573742[_0xf9aa('0x30')]=_[_0xf9aa('0x2e')](_0x4efa7b[_0xf9aa('0x2f')],qs[_0xf9aa('0x31')](_0x3cdb90[_0xf9aa('0x2c')][_0xf9aa('0x31')]));_0x573742[_0xf9aa('0x30')]=_0x573742[_0xf9aa('0x30')][_0xf9aa('0x32')]?_0x573742['attributes']:_0x4efa7b[_0xf9aa('0x2f')];if(!_0x3cdb90[_0xf9aa('0x2c')]['hasOwnProperty']('nolimit')){_0x573742[_0xf9aa('0x33')]=qs[_0xf9aa('0x33')](_0x3cdb90[_0xf9aa('0x2c')][_0xf9aa('0x33')]);_0x573742[_0xf9aa('0x1b')]=qs['offset'](_0x3cdb90[_0xf9aa('0x2c')]['offset']);}_0x573742[_0xf9aa('0x34')]=qs[_0xf9aa('0x35')](_0x3cdb90[_0xf9aa('0x2c')]['sort']);_0x573742['where']=qs[_0xf9aa('0x36')](_[_0xf9aa('0x37')](_0x3cdb90[_0xf9aa('0x2c')],_0x4efa7b[_0xf9aa('0x36')]),_0x331bf6);if(_0x3cdb90[_0xf9aa('0x2c')][_0xf9aa('0x38')]){_0x573742[_0xf9aa('0x39')]=_[_0xf9aa('0x3a')](_0x573742[_0xf9aa('0x39')],{'$or':_['map'](_0x331bf6,function(_0x9cff7e){if(_0x9cff7e['type']!==_0xf9aa('0x3b')){var _0x39d1ba={};_0x39d1ba[_0x9cff7e['name']]={'$like':'%'+_0x3cdb90[_0xf9aa('0x2c')][_0xf9aa('0x38')]+'%'};return _0x39d1ba;}})});}_0x573742=_[_0xf9aa('0x3a')]({},_0x573742,_0x3cdb90[_0xf9aa('0x3c')]);var _0x2a02ae={'where':_0x573742['where']};return db[_0xf9aa('0x29')][_0xf9aa('0x1a')](_0x2a02ae)[_0xf9aa('0x23')](function(_0x50bcab){_0x3129fc[_0xf9aa('0x1a')]=_0x50bcab;if(_0x3cdb90[_0xf9aa('0x2c')][_0xf9aa('0x3d')]){_0x573742['include']=[{'all':!![]}];}return db[_0xf9aa('0x29')][_0xf9aa('0x3e')](_0x573742);})['then'](function(_0xc5111e){_0x3129fc[_0xf9aa('0x3f')]=_0xc5111e;return _0x3129fc;})[_0xf9aa('0x23')](respondWithFilteredResult(_0x1a81f4,_0x573742))['catch'](handleError(_0x1a81f4,null));};exports[_0xf9aa('0x40')]=function(_0x39d04b,_0x33e427){var _0x4b195f={'raw':![],'where':{'id':_0x39d04b[_0xf9aa('0x41')]['id']}},_0x440770={};_0x440770['model']=_[_0xf9aa('0x2d')](db[_0xf9aa('0x29')][_0xf9aa('0x42')]);_0x440770[_0xf9aa('0x2c')]=_[_0xf9aa('0x2d')](_0x39d04b[_0xf9aa('0x2c')]);_0x440770[_0xf9aa('0x36')]=_['intersection'](_0x440770[_0xf9aa('0x2f')],_0x440770[_0xf9aa('0x2c')]);_0x4b195f[_0xf9aa('0x30')]=_[_0xf9aa('0x2e')](_0x440770[_0xf9aa('0x2f')],qs['fields'](_0x39d04b[_0xf9aa('0x2c')][_0xf9aa('0x31')]));_0x4b195f[_0xf9aa('0x30')]=_0x4b195f['attributes'][_0xf9aa('0x32')]?_0x4b195f[_0xf9aa('0x30')]:_0x440770[_0xf9aa('0x2f')];if(_0x39d04b[_0xf9aa('0x2c')]['includeAll']){_0x4b195f[_0xf9aa('0x43')]=[{'all':!![]}];}_0x4b195f=_['merge']({},_0x4b195f,_0x39d04b[_0xf9aa('0x3c')]);return db[_0xf9aa('0x29')][_0xf9aa('0x44')](_0x4b195f)[_0xf9aa('0x23')](handleEntityNotFound(_0x33e427,null))[_0xf9aa('0x23')](respondWithResult(_0x33e427,null))[_0xf9aa('0x45')](handleError(_0x33e427,null));};exports[_0xf9aa('0x46')]=function(_0x5876a3,_0x5ae924){return db['Automation']['create'](_0x5876a3[_0xf9aa('0x47')],{})['then'](respondWithResult(_0x5ae924,0xc9))[_0xf9aa('0x45')](handleError(_0x5ae924,null));};exports['update']=function(_0x501595,_0x3bc300){if(_0x501595[_0xf9aa('0x47')]['id']){delete _0x501595[_0xf9aa('0x47')]['id'];}return db['Automation'][_0xf9aa('0x44')]({'where':{'id':_0x501595[_0xf9aa('0x41')]['id']}})[_0xf9aa('0x23')](handleEntityNotFound(_0x3bc300,null))['then'](saveUpdates(_0x501595[_0xf9aa('0x47')],null))[_0xf9aa('0x23')](respondWithResult(_0x3bc300,null))[_0xf9aa('0x45')](handleError(_0x3bc300,null));};exports[_0xf9aa('0x24')]=function(_0x43df2d,_0x1667e2){return db[_0xf9aa('0x29')][_0xf9aa('0x44')]({'where':{'id':_0x43df2d[_0xf9aa('0x41')]['id']}})[_0xf9aa('0x23')](handleEntityNotFound(_0x1667e2,null))[_0xf9aa('0x23')](removeEntity(_0x1667e2,null))[_0xf9aa('0x45')](handleError(_0x1667e2,null));};exports[_0xf9aa('0x48')]=function(_0x5106a0,_0x3366cf,_0x15d32b){return db['Condition'][_0xf9aa('0x44')]({'where':{'id':_0x5106a0['params']['id']}})[_0xf9aa('0x23')](handleEntityNotFound(_0x3366cf,null))[_0xf9aa('0x23')](function(_0x5265ee){if(_0x5265ee){return _0x5265ee[_0xf9aa('0x48')](_0x5106a0[_0xf9aa('0x47')][_0xf9aa('0x49')],_[_0xf9aa('0x4a')](_0x5106a0[_0xf9aa('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0x3366cf,null))[_0xf9aa('0x45')](handleError(_0x3366cf,null));};exports[_0xf9aa('0x4b')]=function(_0x43be56,_0x30b097,_0x1e3790){var _0x139268={};var _0x5ad1cc={};var _0x5dca28;var _0x267d56;return db[_0xf9aa('0x29')][_0xf9aa('0x4c')]({'where':{'id':_0x43be56[_0xf9aa('0x41')]['id']}})['then'](handleEntityNotFound(_0x30b097,null))[_0xf9aa('0x23')](function(_0x52574d){if(_0x52574d){_0x5dca28=_0x52574d;_0x5ad1cc[_0xf9aa('0x2f')]=_[_0xf9aa('0x2d')](db['Condition'][_0xf9aa('0x42')]);_0x5ad1cc[_0xf9aa('0x2c')]=_[_0xf9aa('0x2d')](_0x43be56[_0xf9aa('0x2c')]);_0x5ad1cc[_0xf9aa('0x36')]=_[_0xf9aa('0x2e')](_0x5ad1cc[_0xf9aa('0x2f')],_0x5ad1cc[_0xf9aa('0x2c')]);_0x139268[_0xf9aa('0x30')]=_[_0xf9aa('0x2e')](_0x5ad1cc[_0xf9aa('0x2f')],qs['fields'](_0x43be56[_0xf9aa('0x2c')][_0xf9aa('0x31')]));_0x139268['attributes']=_0x139268[_0xf9aa('0x30')][_0xf9aa('0x32')]?_0x139268[_0xf9aa('0x30')]:_0x5ad1cc[_0xf9aa('0x2f')];_0x139268[_0xf9aa('0x34')]=qs['sort'](_0x43be56[_0xf9aa('0x2c')][_0xf9aa('0x35')]);_0x139268[_0xf9aa('0x39')]=qs[_0xf9aa('0x36')](_[_0xf9aa('0x37')](_0x43be56[_0xf9aa('0x2c')],_0x5ad1cc[_0xf9aa('0x36')]));if(_0x43be56['query']['filter']){_0x139268['where']=_[_0xf9aa('0x3a')](_0x139268[_0xf9aa('0x39')],{'$or':_['map'](_0x139268[_0xf9aa('0x30')],function(_0x57cf4f){var _0x569f1f={};_0x569f1f[_0x57cf4f]={'$like':'%'+_0x43be56[_0xf9aa('0x2c')][_0xf9aa('0x38')]+'%'};return _0x569f1f;})});}_0x139268=_['merge']({},_0x139268,_0x43be56['options']);return _0x5dca28['getConditions'](_0x139268);}})[_0xf9aa('0x23')](function(_0x46dff5){if(_0x46dff5){_0x267d56=_0x46dff5[_0xf9aa('0x32')];if(!_0x43be56[_0xf9aa('0x2c')][_0xf9aa('0x4d')]('nolimit')){_0x139268['limit']=qs[_0xf9aa('0x33')](_0x43be56['query'][_0xf9aa('0x33')]);_0x139268[_0xf9aa('0x1b')]=qs[_0xf9aa('0x1b')](_0x43be56['query'][_0xf9aa('0x1b')]);}return _0x5dca28[_0xf9aa('0x4b')](_0x139268);}})[_0xf9aa('0x23')](function(_0x47a0c9){if(_0x47a0c9){return _0x47a0c9?{'count':_0x267d56,'rows':_0x47a0c9}:null;}})[_0xf9aa('0x23')](respondWithResult(_0x30b097,null))[_0xf9aa('0x45')](handleError(_0x30b097,null));};exports[_0xf9aa('0x4e')]=function(_0x156d0d,_0x3b693a,_0x4dc1c6){return db['Action'][_0xf9aa('0x44')]({'where':{'id':_0x156d0d[_0xf9aa('0x41')]['id']}})[_0xf9aa('0x23')](handleEntityNotFound(_0x3b693a,null))['then'](function(_0x2dfb6c){if(_0x2dfb6c){return _0x2dfb6c[_0xf9aa('0x4e')](_0x156d0d[_0xf9aa('0x47')][_0xf9aa('0x49')],_[_0xf9aa('0x4a')](_0x156d0d[_0xf9aa('0x47')],['ids','id'])||{});}})['then'](respondWithResult(_0x3b693a,null))[_0xf9aa('0x45')](handleError(_0x3b693a,null));};exports[_0xf9aa('0x4f')]=function(_0x1f20bf,_0x3a4cad,_0x54cb14){var _0xf21662={};var _0x208d2a={};var _0x277d47;var _0x3a61ae;return db[_0xf9aa('0x29')][_0xf9aa('0x4c')]({'where':{'id':_0x1f20bf['params']['id']}})[_0xf9aa('0x23')](handleEntityNotFound(_0x3a4cad,null))[_0xf9aa('0x23')](function(_0x2c9b7b){if(_0x2c9b7b){_0x277d47=_0x2c9b7b;_0x208d2a[_0xf9aa('0x2f')]=_['keys'](db['Action'][_0xf9aa('0x42')]);_0x208d2a[_0xf9aa('0x2c')]=_[_0xf9aa('0x2d')](_0x1f20bf[_0xf9aa('0x2c')]);_0x208d2a[_0xf9aa('0x36')]=_['intersection'](_0x208d2a[_0xf9aa('0x2f')],_0x208d2a['query']);_0xf21662['attributes']=_['intersection'](_0x208d2a[_0xf9aa('0x2f')],qs[_0xf9aa('0x31')](_0x1f20bf[_0xf9aa('0x2c')][_0xf9aa('0x31')]));_0xf21662['attributes']=_0xf21662['attributes'][_0xf9aa('0x32')]?_0xf21662['attributes']:_0x208d2a['model'];_0xf21662['order']=qs[_0xf9aa('0x35')](_0x1f20bf[_0xf9aa('0x2c')]['sort']);_0xf21662[_0xf9aa('0x39')]=qs[_0xf9aa('0x36')](_[_0xf9aa('0x37')](_0x1f20bf[_0xf9aa('0x2c')],_0x208d2a[_0xf9aa('0x36')]));if(_0x1f20bf[_0xf9aa('0x2c')]['filter']){_0xf21662[_0xf9aa('0x39')]=_[_0xf9aa('0x3a')](_0xf21662[_0xf9aa('0x39')],{'$or':_[_0xf9aa('0x28')](_0xf21662[_0xf9aa('0x30')],function(_0x2b5888){var _0x19eefc={};_0x19eefc[_0x2b5888]={'$like':'%'+_0x1f20bf[_0xf9aa('0x2c')]['filter']+'%'};return _0x19eefc;})});}_0xf21662=_[_0xf9aa('0x3a')]({},_0xf21662,_0x1f20bf[_0xf9aa('0x3c')]);return _0x277d47[_0xf9aa('0x4f')](_0xf21662);}})[_0xf9aa('0x23')](function(_0x3badc2){if(_0x3badc2){_0x3a61ae=_0x3badc2['length'];if(!_0x1f20bf[_0xf9aa('0x2c')][_0xf9aa('0x4d')](_0xf9aa('0x50'))){_0xf21662['limit']=qs[_0xf9aa('0x33')](_0x1f20bf[_0xf9aa('0x2c')]['limit']);_0xf21662['offset']=qs[_0xf9aa('0x1b')](_0x1f20bf['query'][_0xf9aa('0x1b')]);}return _0x277d47[_0xf9aa('0x4f')](_0xf21662);}})[_0xf9aa('0x23')](function(_0x24b655){if(_0x24b655){return _0x24b655?{'count':_0x3a61ae,'rows':_0x24b655}:null;}})['then'](respondWithResult(_0x3a4cad,null))[_0xf9aa('0x45')](handleError(_0x3a4cad,null));}; \ No newline at end of file +var _0x45f6=['body','addConditions','Condition','ids','omit','getConditions','findOne','pick','Action','addActions','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find','create'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x45f6,0x110));var _0x645f=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x45f6[_0x4394b6];return _0x360244;};'use strict';var pdf=require(_0x645f('0x0'));var emlformat=require(_0x645f('0x1'));var rimraf=require(_0x645f('0x2'));var zipdir=require(_0x645f('0x3'));var jsonpatch=require(_0x645f('0x4'));var rp=require(_0x645f('0x5'));var moment=require(_0x645f('0x6'));var BPromise=require(_0x645f('0x7'));var Mustache=require(_0x645f('0x8'));var util=require(_0x645f('0x9'));var path=require(_0x645f('0xa'));var sox=require(_0x645f('0xb'));var csv=require(_0x645f('0xc'));var ejs=require(_0x645f('0xd'));var fs=require('fs');var _=require(_0x645f('0xe'));var squel=require(_0x645f('0xf'));var crypto=require(_0x645f('0x10'));var jsforce=require(_0x645f('0x11'));var deskjs=require(_0x645f('0x12'));var toCsv=require(_0x645f('0xc'));var querystring=require(_0x645f('0x13'));var Papa=require('papaparse');var Redis=require(_0x645f('0x14'));var authService=require(_0x645f('0x15'));var qs=require(_0x645f('0x16'));var as=require(_0x645f('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x645f('0x18'));var utils=require('../../config/utils');var config=require(_0x645f('0x19'));var db=require(_0x645f('0x1a'))['db'];function respondWithStatusCode(_0x348b0a,_0x16251c){_0x16251c=_0x16251c||0xcc;return function(_0x403493){if(_0x403493){return _0x348b0a[_0x645f('0x1b')](_0x16251c);}return _0x348b0a[_0x645f('0x1c')](_0x16251c)[_0x645f('0x1d')]();};}function respondWithResult(_0x14d3b2,_0x409fea){_0x409fea=_0x409fea||0xc8;return function(_0x17ad96){if(_0x17ad96){return _0x14d3b2['status'](_0x409fea)[_0x645f('0x1e')](_0x17ad96);}};}function respondWithFilteredResult(_0x39690a,_0x5b29f4){return function(_0x47518b){if(_0x47518b){var _0x49e48e=_0x47518b[_0x645f('0x1f')],_0x383862=_0x5b29f4[_0x645f('0x20')],_0x25a5b5=_0x5b29f4[_0x645f('0x20')]+_0x5b29f4['limit'],_0x426acf;if(_0x25a5b5>=_0x49e48e){_0x25a5b5=_0x49e48e;_0x426acf=0xc8;}else{_0x426acf=0xce;}_0x39690a[_0x645f('0x1c')](_0x426acf);return _0x39690a[_0x645f('0x21')]('Content-Range',_0x383862+'-'+_0x25a5b5+'/'+_0x49e48e)[_0x645f('0x1e')](_0x47518b);}return null;};}function patchUpdates(_0x2d3c06){return function(_0x56b41a){try{jsonpatch[_0x645f('0x22')](_0x56b41a,_0x2d3c06,!![]);}catch(_0x15cddf){return BPromise[_0x645f('0x23')](_0x15cddf);}return _0x56b41a[_0x645f('0x24')]();};}function saveUpdates(_0x2a2b42,_0x4c9b0e){return function(_0x45f752){if(_0x45f752){return _0x45f752[_0x645f('0x25')](_0x2a2b42)[_0x645f('0x26')](function(_0x552ad6){return _0x552ad6;});}return null;};}function removeEntity(_0x53e4d4,_0x283736){return function(_0x5307af){if(_0x5307af){return _0x5307af[_0x645f('0x27')]()[_0x645f('0x26')](function(){_0x53e4d4[_0x645f('0x1c')](0xcc)[_0x645f('0x1d')]();});}};}function handleEntityNotFound(_0x3e9c57,_0x1b5db5){return function(_0x38eb2c){if(!_0x38eb2c){_0x3e9c57[_0x645f('0x1b')](0x194);}return _0x38eb2c;};}function handleError(_0x6943,_0x5d3d2f){_0x5d3d2f=_0x5d3d2f||0x1f4;return function(_0x2b84c0){logger[_0x645f('0x28')](_0x2b84c0[_0x645f('0x29')]);if(_0x2b84c0[_0x645f('0x2a')]){delete _0x2b84c0['name'];}_0x6943[_0x645f('0x1c')](_0x5d3d2f)[_0x645f('0x2b')](_0x2b84c0);};}exports[_0x645f('0x2c')]=function(_0x1ed24f,_0x534bf7){var _0x21156e={},_0x676bd6={},_0x580f46={'count':0x0,'rows':[]};var _0x560cad=_[_0x645f('0x2d')](db[_0x645f('0x2e')][_0x645f('0x2f')],function(_0x233413){return{'name':_0x233413['fieldName'],'type':_0x233413[_0x645f('0x30')][_0x645f('0x31')]};});_0x676bd6[_0x645f('0x32')]=_[_0x645f('0x2d')](_0x560cad,_0x645f('0x2a'));_0x676bd6[_0x645f('0x33')]=_[_0x645f('0x34')](_0x1ed24f[_0x645f('0x33')]);_0x676bd6[_0x645f('0x35')]=_[_0x645f('0x36')](_0x676bd6[_0x645f('0x32')],_0x676bd6[_0x645f('0x33')]);_0x21156e[_0x645f('0x37')]=_['intersection'](_0x676bd6['model'],qs['fields'](_0x1ed24f['query'][_0x645f('0x38')]));_0x21156e['attributes']=_0x21156e[_0x645f('0x37')][_0x645f('0x39')]?_0x21156e[_0x645f('0x37')]:_0x676bd6[_0x645f('0x32')];if(!_0x1ed24f[_0x645f('0x33')][_0x645f('0x3a')](_0x645f('0x3b'))){_0x21156e['limit']=qs[_0x645f('0x3c')](_0x1ed24f[_0x645f('0x33')][_0x645f('0x3c')]);_0x21156e[_0x645f('0x20')]=qs[_0x645f('0x20')](_0x1ed24f[_0x645f('0x33')][_0x645f('0x20')]);}_0x21156e[_0x645f('0x3d')]=qs[_0x645f('0x3e')](_0x1ed24f[_0x645f('0x33')][_0x645f('0x3e')]);_0x21156e[_0x645f('0x3f')]=qs[_0x645f('0x35')](_['pick'](_0x1ed24f[_0x645f('0x33')],_0x676bd6[_0x645f('0x35')]),_0x560cad);if(_0x1ed24f[_0x645f('0x33')][_0x645f('0x40')]){_0x21156e[_0x645f('0x3f')]=_[_0x645f('0x41')](_0x21156e[_0x645f('0x3f')],{'$or':_[_0x645f('0x2d')](_0x560cad,function(_0x4ed096){if(_0x4ed096[_0x645f('0x30')]!==_0x645f('0x42')){var _0x49c196={};_0x49c196[_0x4ed096[_0x645f('0x2a')]]={'$like':'%'+_0x1ed24f['query'][_0x645f('0x40')]+'%'};return _0x49c196;}})});}_0x21156e=_[_0x645f('0x41')]({},_0x21156e,_0x1ed24f[_0x645f('0x43')]);var _0x407ad8={'where':_0x21156e['where']};return db[_0x645f('0x2e')][_0x645f('0x1f')](_0x407ad8)[_0x645f('0x26')](function(_0x23942c){_0x580f46[_0x645f('0x1f')]=_0x23942c;if(_0x1ed24f[_0x645f('0x33')]['includeAll']){_0x21156e['include']=[{'all':!![]}];}return db[_0x645f('0x2e')][_0x645f('0x44')](_0x21156e);})[_0x645f('0x26')](function(_0x7e765b){_0x580f46[_0x645f('0x45')]=_0x7e765b;return _0x580f46;})['then'](respondWithFilteredResult(_0x534bf7,_0x21156e))[_0x645f('0x46')](handleError(_0x534bf7,null));};exports[_0x645f('0x47')]=function(_0x5d16ce,_0x5c2ed2){var _0x5f3b57={'raw':![],'where':{'id':_0x5d16ce[_0x645f('0x48')]['id']}},_0xab1bc4={};_0xab1bc4[_0x645f('0x32')]=_[_0x645f('0x34')](db[_0x645f('0x2e')][_0x645f('0x2f')]);_0xab1bc4[_0x645f('0x33')]=_['keys'](_0x5d16ce['query']);_0xab1bc4['filters']=_['intersection'](_0xab1bc4[_0x645f('0x32')],_0xab1bc4[_0x645f('0x33')]);_0x5f3b57[_0x645f('0x37')]=_['intersection'](_0xab1bc4['model'],qs[_0x645f('0x38')](_0x5d16ce[_0x645f('0x33')]['fields']));_0x5f3b57[_0x645f('0x37')]=_0x5f3b57[_0x645f('0x37')][_0x645f('0x39')]?_0x5f3b57['attributes']:_0xab1bc4[_0x645f('0x32')];if(_0x5d16ce[_0x645f('0x33')][_0x645f('0x49')]){_0x5f3b57['include']=[{'all':!![]}];}_0x5f3b57=_[_0x645f('0x41')]({},_0x5f3b57,_0x5d16ce[_0x645f('0x43')]);return db[_0x645f('0x2e')][_0x645f('0x4a')](_0x5f3b57)[_0x645f('0x26')](handleEntityNotFound(_0x5c2ed2,null))[_0x645f('0x26')](respondWithResult(_0x5c2ed2,null))[_0x645f('0x46')](handleError(_0x5c2ed2,null));};exports[_0x645f('0x4b')]=function(_0xef2940,_0x5964f4){return db[_0x645f('0x2e')]['create'](_0xef2940[_0x645f('0x4c')],{})[_0x645f('0x26')](respondWithResult(_0x5964f4,0xc9))[_0x645f('0x46')](handleError(_0x5964f4,null));};exports['update']=function(_0x51d3ed,_0x4a6c79){if(_0x51d3ed['body']['id']){delete _0x51d3ed['body']['id'];}return db['Automation'][_0x645f('0x4a')]({'where':{'id':_0x51d3ed['params']['id']}})[_0x645f('0x26')](handleEntityNotFound(_0x4a6c79,null))[_0x645f('0x26')](saveUpdates(_0x51d3ed['body'],null))[_0x645f('0x26')](respondWithResult(_0x4a6c79,null))['catch'](handleError(_0x4a6c79,null));};exports[_0x645f('0x27')]=function(_0x51623b,_0x3d42e8){return db['Automation'][_0x645f('0x4a')]({'where':{'id':_0x51623b[_0x645f('0x48')]['id']}})[_0x645f('0x26')](handleEntityNotFound(_0x3d42e8,null))[_0x645f('0x26')](removeEntity(_0x3d42e8,null))[_0x645f('0x46')](handleError(_0x3d42e8,null));};exports[_0x645f('0x4d')]=function(_0x560f70,_0xb5e24b,_0x574bec){return db[_0x645f('0x4e')][_0x645f('0x4a')]({'where':{'id':_0x560f70['params']['id']}})[_0x645f('0x26')](handleEntityNotFound(_0xb5e24b,null))[_0x645f('0x26')](function(_0x56c990){if(_0x56c990){return _0x56c990[_0x645f('0x4d')](_0x560f70['body'][_0x645f('0x4f')],_[_0x645f('0x50')](_0x560f70[_0x645f('0x4c')],[_0x645f('0x4f'),'id'])||{});}})[_0x645f('0x26')](respondWithResult(_0xb5e24b,null))['catch'](handleError(_0xb5e24b,null));};exports[_0x645f('0x51')]=function(_0x2ac73b,_0x45c7bd,_0x103760){var _0x1cdc84={};var _0x2fedcc={};var _0x597dd2;var _0x208d8c;return db[_0x645f('0x2e')][_0x645f('0x52')]({'where':{'id':_0x2ac73b[_0x645f('0x48')]['id']}})[_0x645f('0x26')](handleEntityNotFound(_0x45c7bd,null))[_0x645f('0x26')](function(_0x268837){if(_0x268837){_0x597dd2=_0x268837;_0x2fedcc['model']=_['keys'](db[_0x645f('0x4e')][_0x645f('0x2f')]);_0x2fedcc[_0x645f('0x33')]=_[_0x645f('0x34')](_0x2ac73b[_0x645f('0x33')]);_0x2fedcc[_0x645f('0x35')]=_[_0x645f('0x36')](_0x2fedcc[_0x645f('0x32')],_0x2fedcc[_0x645f('0x33')]);_0x1cdc84[_0x645f('0x37')]=_['intersection'](_0x2fedcc['model'],qs[_0x645f('0x38')](_0x2ac73b[_0x645f('0x33')]['fields']));_0x1cdc84[_0x645f('0x37')]=_0x1cdc84[_0x645f('0x37')][_0x645f('0x39')]?_0x1cdc84[_0x645f('0x37')]:_0x2fedcc[_0x645f('0x32')];_0x1cdc84[_0x645f('0x3d')]=qs[_0x645f('0x3e')](_0x2ac73b[_0x645f('0x33')][_0x645f('0x3e')]);_0x1cdc84[_0x645f('0x3f')]=qs[_0x645f('0x35')](_[_0x645f('0x53')](_0x2ac73b['query'],_0x2fedcc[_0x645f('0x35')]));if(_0x2ac73b[_0x645f('0x33')][_0x645f('0x40')]){_0x1cdc84['where']=_[_0x645f('0x41')](_0x1cdc84[_0x645f('0x3f')],{'$or':_['map'](_0x1cdc84[_0x645f('0x37')],function(_0x2eb030){var _0x2aa5c1={};_0x2aa5c1[_0x2eb030]={'$like':'%'+_0x2ac73b[_0x645f('0x33')][_0x645f('0x40')]+'%'};return _0x2aa5c1;})});}_0x1cdc84=_[_0x645f('0x41')]({},_0x1cdc84,_0x2ac73b[_0x645f('0x43')]);return _0x597dd2['getConditions'](_0x1cdc84);}})['then'](function(_0x317191){if(_0x317191){_0x208d8c=_0x317191['length'];if(!_0x2ac73b[_0x645f('0x33')][_0x645f('0x3a')](_0x645f('0x3b'))){_0x1cdc84[_0x645f('0x3c')]=qs[_0x645f('0x3c')](_0x2ac73b[_0x645f('0x33')]['limit']);_0x1cdc84[_0x645f('0x20')]=qs['offset'](_0x2ac73b[_0x645f('0x33')][_0x645f('0x20')]);}return _0x597dd2[_0x645f('0x51')](_0x1cdc84);}})['then'](function(_0xf2ae00){if(_0xf2ae00){return _0xf2ae00?{'count':_0x208d8c,'rows':_0xf2ae00}:null;}})[_0x645f('0x26')](respondWithResult(_0x45c7bd,null))[_0x645f('0x46')](handleError(_0x45c7bd,null));};exports['addActions']=function(_0x207fd8,_0x1b6803,_0x53ed4c){return db[_0x645f('0x54')][_0x645f('0x4a')]({'where':{'id':_0x207fd8[_0x645f('0x48')]['id']}})[_0x645f('0x26')](handleEntityNotFound(_0x1b6803,null))[_0x645f('0x26')](function(_0x440b8e){if(_0x440b8e){return _0x440b8e[_0x645f('0x55')](_0x207fd8[_0x645f('0x4c')][_0x645f('0x4f')],_['omit'](_0x207fd8['body'],['ids','id'])||{});}})[_0x645f('0x26')](respondWithResult(_0x1b6803,null))[_0x645f('0x46')](handleError(_0x1b6803,null));};exports[_0x645f('0x56')]=function(_0x400602,_0x219df4,_0x2d6d74){var _0x20e849={};var _0x22a633={};var _0x456b67;var _0x3cf33d;return db['Automation'][_0x645f('0x52')]({'where':{'id':_0x400602[_0x645f('0x48')]['id']}})[_0x645f('0x26')](handleEntityNotFound(_0x219df4,null))[_0x645f('0x26')](function(_0xeac092){if(_0xeac092){_0x456b67=_0xeac092;_0x22a633[_0x645f('0x32')]=_[_0x645f('0x34')](db[_0x645f('0x54')][_0x645f('0x2f')]);_0x22a633[_0x645f('0x33')]=_[_0x645f('0x34')](_0x400602[_0x645f('0x33')]);_0x22a633[_0x645f('0x35')]=_[_0x645f('0x36')](_0x22a633[_0x645f('0x32')],_0x22a633[_0x645f('0x33')]);_0x20e849[_0x645f('0x37')]=_[_0x645f('0x36')](_0x22a633[_0x645f('0x32')],qs['fields'](_0x400602[_0x645f('0x33')]['fields']));_0x20e849['attributes']=_0x20e849[_0x645f('0x37')][_0x645f('0x39')]?_0x20e849[_0x645f('0x37')]:_0x22a633[_0x645f('0x32')];_0x20e849[_0x645f('0x3d')]=qs['sort'](_0x400602['query'][_0x645f('0x3e')]);_0x20e849[_0x645f('0x3f')]=qs[_0x645f('0x35')](_['pick'](_0x400602['query'],_0x22a633['filters']));if(_0x400602['query'][_0x645f('0x40')]){_0x20e849[_0x645f('0x3f')]=_[_0x645f('0x41')](_0x20e849[_0x645f('0x3f')],{'$or':_[_0x645f('0x2d')](_0x20e849[_0x645f('0x37')],function(_0x9e3f5f){var _0x465e6b={};_0x465e6b[_0x9e3f5f]={'$like':'%'+_0x400602[_0x645f('0x33')][_0x645f('0x40')]+'%'};return _0x465e6b;})});}_0x20e849=_[_0x645f('0x41')]({},_0x20e849,_0x400602[_0x645f('0x43')]);return _0x456b67[_0x645f('0x56')](_0x20e849);}})[_0x645f('0x26')](function(_0x6ef96b){if(_0x6ef96b){_0x3cf33d=_0x6ef96b[_0x645f('0x39')];if(!_0x400602[_0x645f('0x33')][_0x645f('0x3a')]('nolimit')){_0x20e849[_0x645f('0x3c')]=qs['limit'](_0x400602[_0x645f('0x33')]['limit']);_0x20e849[_0x645f('0x20')]=qs[_0x645f('0x20')](_0x400602[_0x645f('0x33')]['offset']);}return _0x456b67['getActions'](_0x20e849);}})['then'](function(_0x306fe7){if(_0x306fe7){return _0x306fe7?{'count':_0x3cf33d,'rows':_0x306fe7}:null;}})[_0x645f('0x26')](respondWithResult(_0x219df4,null))[_0x645f('0x46')](handleError(_0x219df4,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 891dabe..581bffa 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 _0x81bd=['../../config/environment','./automation.attributes','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x415ac3,_0xfe25b){var _0x419ac0=function(_0x3c0e5e){while(--_0x3c0e5e){_0x415ac3['push'](_0x415ac3['shift']());}};_0x419ac0(++_0xfe25b);}(_0x81bd,0x7c));var _0xd81b=function(_0x330740,_0x58c0c0){_0x330740=_0x330740-0x0;var _0x1cb5f2=_0x81bd[_0x330740];return _0x1cb5f2;};'use strict';var _=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var logger=require(_0xd81b('0x2'))(_0xd81b('0x3'));var moment=require(_0xd81b('0x4'));var BPromise=require(_0xd81b('0x5'));var rp=require(_0xd81b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd81b('0x7'));var config=require(_0xd81b('0x8'));var attributes=require(_0xd81b('0x9'));module['exports']=function(_0x42a0aa,_0x34eb73){return _0x42a0aa[_0xd81b('0xa')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fd1=['Automation','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x511b9a,_0x19cb15){var _0xc2ff75=function(_0x287218){while(--_0x287218){_0x511b9a['push'](_0x511b9a['shift']());}};_0xc2ff75(++_0x19cb15);}(_0x5fd1,0x155));var _0x15fd=function(_0x14dde0,_0x365b64){_0x14dde0=_0x14dde0-0x0;var _0x220381=_0x5fd1[_0x14dde0];return _0x220381;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var moment=require(_0x15fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15fd('0x4'));var rimraf=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var attributes=require('./automation.attributes');module[_0x15fd('0x7')]=function(_0x386441,_0x18450c){return _0x386441[_0x15fd('0x8')](_0x15fd('0x9'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 2110980..c75095a 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 _0x6f13=['request\x20sent','error','code','message','Automation,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x21f3c3,_0x42e32c){var _0x15957=function(_0x271f01){while(--_0x271f01){_0x21f3c3['push'](_0x21f3c3['shift']());}};_0x15957(++_0x42e32c);}(_0x6f13,0x1d4));var _0x36f1=function(_0x4be02e,_0x4a2232){_0x4be02e=_0x4be02e-0x0;var _0x946887=_0x6f13[_0x4be02e];return _0x946887;};'use strict';var _=require(_0x36f1('0x0'));var util=require(_0x36f1('0x1'));var moment=require(_0x36f1('0x2'));var BPromise=require(_0x36f1('0x3'));var rs=require(_0x36f1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x36f1('0x5'));var logger=require(_0x36f1('0x6'))(_0x36f1('0x7'));var config=require(_0x36f1('0x8'));var jayson=require(_0x36f1('0x9'));var client=jayson['client'][_0x36f1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54e131,_0x39020d,_0x2d136a){return new BPromise(function(_0x4f0a17,_0x467d2){return client[_0x36f1('0xb')](_0x54e131,_0x2d136a)['then'](function(_0x1c3eab){logger['info']('Automation,\x20%s,\x20%s',_0x39020d,_0x36f1('0xc'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x39020d,'request\x20sent',JSON['stringify'](_0x1c3eab));if(_0x1c3eab[_0x36f1('0xd')]){if(_0x1c3eab[_0x36f1('0xd')][_0x36f1('0xe')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x39020d,_0x1c3eab['error'][_0x36f1('0xf')]);return _0x467d2(_0x1c3eab[_0x36f1('0xd')][_0x36f1('0xf')]);}logger[_0x36f1('0xd')](_0x36f1('0x10'),_0x39020d,_0x1c3eab[_0x36f1('0xd')]['message']);return _0x4f0a17(_0x1c3eab['error']['message']);}else{logger[_0x36f1('0x11')](_0x36f1('0x10'),_0x39020d,_0x36f1('0xc'));_0x4f0a17(_0x1c3eab[_0x36f1('0x12')][_0x36f1('0xf')]);}})[_0x36f1('0x13')](function(_0xa02dd8){logger['error']('Automation,\x20%s,\x20%s',_0x39020d,_0xa02dd8);_0x467d2(_0xa02dd8);});});} \ No newline at end of file +var _0x632c=['request\x20sent','stringify','error','code','Automation,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x632c,0xce));var _0xc632=function(_0x1c2473,_0x33d052){_0x1c2473=_0x1c2473-0x0;var _0x26d572=_0x632c[_0x1c2473];return _0x26d572;};'use strict';var _=require(_0xc632('0x0'));var util=require(_0xc632('0x1'));var moment=require(_0xc632('0x2'));var BPromise=require(_0xc632('0x3'));var rs=require(_0xc632('0x4'));var fs=require('fs');var Redis=require(_0xc632('0x5'));var db=require(_0xc632('0x6'))['db'];var utils=require(_0xc632('0x7'));var logger=require('../../config/logger')(_0xc632('0x8'));var config=require(_0xc632('0x9'));var jayson=require(_0xc632('0xa'));var client=jayson[_0xc632('0xb')][_0xc632('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x481ad1,_0xb29835,_0x11b771){return new BPromise(function(_0x7d6ee5,_0x3deab5){return client['request'](_0x481ad1,_0x11b771)['then'](function(_0x2aa3de){logger[_0xc632('0xd')]('Automation,\x20%s,\x20%s',_0xb29835,_0xc632('0xe'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0xb29835,_0xc632('0xe'),JSON[_0xc632('0xf')](_0x2aa3de));if(_0x2aa3de[_0xc632('0x10')]){if(_0x2aa3de[_0xc632('0x10')][_0xc632('0x11')]===0x1f4){logger[_0xc632('0x10')](_0xc632('0x12'),_0xb29835,_0x2aa3de['error'][_0xc632('0x13')]);return _0x3deab5(_0x2aa3de['error'][_0xc632('0x13')]);}logger[_0xc632('0x10')](_0xc632('0x12'),_0xb29835,_0x2aa3de['error'][_0xc632('0x13')]);return _0x7d6ee5(_0x2aa3de[_0xc632('0x10')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0xb29835,_0xc632('0xe'));_0x7d6ee5(_0x2aa3de['result'][_0xc632('0x13')]);}})['catch'](function(_0x584f57){logger['error'](_0xc632('0x12'),_0xb29835,_0x584f57);_0x3deab5(_0x584f57);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index b0b3e41..f839cf6 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 _0x036f=['/:id','isAuthenticated','/:id/conditions','/:id/actions','getActions','post','addConditions','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index'];(function(_0x59cccc,_0x457312){var _0xc561f1=function(_0x370da4){while(--_0x370da4){_0x59cccc['push'](_0x59cccc['shift']());}};_0xc561f1(++_0x457312);}(_0x036f,0x109));var _0xf036=function(_0x491faa,_0x4f2907){_0x491faa=_0x491faa-0x0;var _0x414440=_0x036f[_0x491faa];return _0x414440;};'use strict';var multer=require(_0xf036('0x0'));var util=require(_0xf036('0x1'));var path=require(_0xf036('0x2'));var timeout=require('connect-timeout');var express=require(_0xf036('0x3'));var router=express[_0xf036('0x4')]();var auth=require(_0xf036('0x5'));var interaction=require(_0xf036('0x6'));var config=require(_0xf036('0x7'));var controller=require(_0xf036('0x8'));router[_0xf036('0x9')]('/',auth['isAuthenticated'](),controller[_0xf036('0xa')]);router[_0xf036('0x9')](_0xf036('0xb'),auth[_0xf036('0xc')](),controller['show']);router[_0xf036('0x9')](_0xf036('0xd'),auth[_0xf036('0xc')](),controller['getConditions']);router[_0xf036('0x9')](_0xf036('0xe'),auth['isAuthenticated'](),controller[_0xf036('0xf')]);router['post']('/',auth[_0xf036('0xc')](),controller['create']);router[_0xf036('0x10')](_0xf036('0xd'),auth['isAuthenticated'](),controller[_0xf036('0x11')]);router['post'](_0xf036('0xe'),auth[_0xf036('0xc')](),controller['addActions']);router[_0xf036('0x12')](_0xf036('0xb'),auth[_0xf036('0xc')](),controller[_0xf036('0x13')]);router[_0xf036('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xf036('0x15')]);module[_0xf036('0x16')]=router; \ No newline at end of file +var _0xd5e5=['util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete','exports'];(function(_0x82a041,_0x4845ea){var _0x4d0e89=function(_0x561b3f){while(--_0x561b3f){_0x82a041['push'](_0x82a041['shift']());}};_0x4d0e89(++_0x4845ea);}(_0xd5e5,0x187));var _0x5d5e=function(_0x18e333,_0x1caf42){_0x18e333=_0x18e333-0x0;var _0x41c26e=_0xd5e5[_0x18e333];return _0x41c26e;};'use strict';var multer=require('multer');var util=require(_0x5d5e('0x0'));var path=require('path');var timeout=require(_0x5d5e('0x1'));var express=require('express');var router=express[_0x5d5e('0x2')]();var auth=require(_0x5d5e('0x3'));var interaction=require(_0x5d5e('0x4'));var config=require(_0x5d5e('0x5'));var controller=require(_0x5d5e('0x6'));router[_0x5d5e('0x7')]('/',auth[_0x5d5e('0x8')](),controller['index']);router[_0x5d5e('0x7')](_0x5d5e('0x9'),auth[_0x5d5e('0x8')](),controller[_0x5d5e('0xa')]);router[_0x5d5e('0x7')](_0x5d5e('0xb'),auth[_0x5d5e('0x8')](),controller[_0x5d5e('0xc')]);router[_0x5d5e('0x7')]('/:id/actions',auth[_0x5d5e('0x8')](),controller[_0x5d5e('0xd')]);router[_0x5d5e('0xe')]('/',auth[_0x5d5e('0x8')](),controller[_0x5d5e('0xf')]);router[_0x5d5e('0xe')](_0x5d5e('0xb'),auth[_0x5d5e('0x8')](),controller[_0x5d5e('0x10')]);router[_0x5d5e('0xe')](_0x5d5e('0x11'),auth[_0x5d5e('0x8')](),controller[_0x5d5e('0x12')]);router[_0x5d5e('0x13')](_0x5d5e('0x9'),auth[_0x5d5e('0x8')](),controller[_0x5d5e('0x14')]);router[_0x5d5e('0x15')](_0x5d5e('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x5d5e('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 1461c60..f4440e3 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 _0x7406=['NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)'];(function(_0x58a0c8,_0x129dcd){var _0x2baf2f=function(_0x2cba07){while(--_0x2cba07){_0x58a0c8['push'](_0x58a0c8['shift']());}};_0x2baf2f(++_0x129dcd);}(_0x7406,0x16e));var _0x6740=function(_0x5902dd,_0xcf5af){_0x5902dd=_0x5902dd-0x0;var _0x52ada1=_0x7406[_0x5902dd];return _0x52ada1;};'use strict';var Sequelize=require(_0x6740('0x0'));module[_0x6740('0x1')]={'name':{'type':Sequelize[_0x6740('0x2')],'unique':_0x6740('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x6740('0x4')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x6740('0x2')]},'active':{'type':Sequelize[_0x6740('0x5')],'defaultValue':0x0,'comment':_0x6740('0x6')},'limitCalls':{'type':Sequelize[_0x6740('0x7')](0x4)[_0x6740('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x6740('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x6740('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6740('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6740('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x6740('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6740('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x6740('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6740('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x6740('0x7')](0x5)[_0x6740('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x6740('0x7')](0x3)[_0x6740('0x8')],'defaultValue':0x3,'comment':_0x6740('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x6740('0x7')](0x5)[_0x6740('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6740('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x6740('0x7')](0x3)[_0x6740('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x6740('0xf')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x6740('0x2')],'defaultValue':_0x6740('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x6740('0x11')](_0x6740('0x12'),_0x6740('0x13'),_0x6740('0x14')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x6740('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x6740('0x7')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x6740('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x6740('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x6740('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x6740('0x7')](0x9)[_0x6740('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6740('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x6740('0x7')](0x9)[_0x6740('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x6740('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x6740('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x6740('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x6740('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x6740('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x6740('0x7')](0x9)[_0x6740('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x6740('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x6740('0x11')](_0x6740('0x1c'),_0x6740('0x1d')),'defaultValue':_0x6740('0x1c')},'dialPrefix':{'type':Sequelize[_0x6740('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x6740('0x7')](0x3)[_0x6740('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x6740('0x1e')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x6740('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6740('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6740('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x6740('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6740('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x6740('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6740('0x21')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x6740('0x7')](0x3)[_0x6740('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x6740('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x6740('0x7')](0x5)[_0x6740('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6740('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x6740('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6740('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x6740('0x7')](0x3)[_0x6740('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x6740('0x7')](0x5)[_0x6740('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x6740('0x25')}}; \ No newline at end of file +var _0x39da=['#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#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','ASC','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x2dd1a5,_0x40d0c1){var _0x981a2=function(_0x2b54f5){while(--_0x2b54f5){_0x2dd1a5['push'](_0x2dd1a5['shift']());}};_0x981a2(++_0x40d0c1);}(_0x39da,0x1f1));var _0xa39d=function(_0x925106,_0x32d120){_0x925106=_0x925106-0x0;var _0x92a1ae=_0x39da[_0x925106];return _0x92a1ae;};'use strict';var Sequelize=require(_0xa39d('0x0'));module[_0xa39d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa39d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa39d('0x3')](_0xa39d('0x4')),'allowNull':![],'defaultValue':_0xa39d('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xa39d('0x5')],'defaultValue':0x0,'comment':_0xa39d('0x6')},'limitCalls':{'type':Sequelize[_0xa39d('0x7')](0x4)[_0xa39d('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa39d('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa39d('0xa')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa39d('0xb')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa39d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa39d('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xa39d('0x7')](0x3)[_0xa39d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa39d('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa39d('0x7')](0x5)[_0xa39d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa39d('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa39d('0x7')](0x3)[_0xa39d('0x8')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa39d('0x7')](0x5)[_0xa39d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa39d('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xa39d('0xa')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa39d('0xa')],'defaultValue':_0xa39d('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xa39d('0x3')](_0xa39d('0x10'),'never',_0xa39d('0x11')),'defaultValue':_0xa39d('0x10')},'dialAMDActive':{'type':Sequelize[_0xa39d('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa39d('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xa39d('0x12')},'dialAMDGreeting':{'type':Sequelize[_0xa39d('0x7')](0x9)[_0xa39d('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa39d('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xa39d('0x7')](0x9)[_0xa39d('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa39d('0x7')](0x9)[_0xa39d('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa39d('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0xa39d('0x7')](0x9)[_0xa39d('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa39d('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa39d('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa39d('0x7')](0x9)[_0xa39d('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa39d('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa39d('0x7')](0x5)[_0xa39d('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xa39d('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa39d('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa39d('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0xa39d('0x3')]('DESC',_0xa39d('0x19')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xa39d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa39d('0x7')](0x3)[_0xa39d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa39d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa39d('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa39d('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa39d('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xa39d('0x7')](0x3)[_0xa39d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa39d('0x1c')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa39d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa39d('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa39d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa39d('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa39d('0x7')](0x5)[_0xa39d('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa39d('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0xa39d('0x7')](0x3)[_0xa39d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa39d('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa39d('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa39d('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa39d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa39d('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa39d('0x22')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 6199e96..210b1a8 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 _0x91bd=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','error','name','send','index','map','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','keys','Campaign','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','intersection','omit','createdAt','updatedAt','role','UserProfileResource','getHoppers','findOne','filter','CmHopperHistory','CampaignId','getHopperFinals','pick','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','CampaignId\x20=\x20?','into','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','CmHopper','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring'];(function(_0x12efa0,_0x579590){var _0x158c02=function(_0x311422){while(--_0x311422){_0x12efa0['push'](_0x12efa0['shift']());}};_0x158c02(++_0x579590);}(_0x91bd,0x73));var _0xd91b=function(_0x1304c6,_0x6bb485){_0x1304c6=_0x1304c6-0x0;var _0x2e6654=_0x91bd[_0x1304c6];return _0x2e6654;};'use strict';var pdf=require(_0xd91b('0x0'));var emlformat=require(_0xd91b('0x1'));var rimraf=require(_0xd91b('0x2'));var zipdir=require(_0xd91b('0x3'));var jsonpatch=require(_0xd91b('0x4'));var rp=require(_0xd91b('0x5'));var moment=require(_0xd91b('0x6'));var BPromise=require(_0xd91b('0x7'));var Mustache=require(_0xd91b('0x8'));var util=require(_0xd91b('0x9'));var path=require(_0xd91b('0xa'));var sox=require(_0xd91b('0xb'));var csv=require(_0xd91b('0xc'));var ejs=require(_0xd91b('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd91b('0xe'));var crypto=require(_0xd91b('0xf'));var jsforce=require(_0xd91b('0x10'));var deskjs=require(_0xd91b('0x11'));var toCsv=require(_0xd91b('0xc'));var querystring=require(_0xd91b('0x12'));var Papa=require(_0xd91b('0x13'));var Redis=require(_0xd91b('0x14'));var authService=require(_0xd91b('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xd91b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd91b('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cda22,_0x46b044){_0x46b044=_0x46b044||0xcc;return function(_0x2686f9){if(_0x2686f9){return _0x1cda22['sendStatus'](_0x46b044);}return _0x1cda22['status'](_0x46b044)[_0xd91b('0x18')]();};}function respondWithResult(_0x55bb74,_0x5076c1){_0x5076c1=_0x5076c1||0xc8;return function(_0x12985e){if(_0x12985e){return _0x55bb74[_0xd91b('0x19')](_0x5076c1)[_0xd91b('0x1a')](_0x12985e);}};}function respondWithFilteredResult(_0x41d371,_0x43ab2e){return function(_0x373d8c){if(_0x373d8c){var _0x5cece5=_0x373d8c['count'],_0x19b840=_0x43ab2e[_0xd91b('0x1b')],_0x11f936=_0x43ab2e[_0xd91b('0x1b')]+_0x43ab2e[_0xd91b('0x1c')],_0x1e0ea2;if(_0x11f936>=_0x5cece5){_0x11f936=_0x5cece5;_0x1e0ea2=0xc8;}else{_0x1e0ea2=0xce;}_0x41d371[_0xd91b('0x19')](_0x1e0ea2);return _0x41d371[_0xd91b('0x1d')](_0xd91b('0x1e'),_0x19b840+'-'+_0x11f936+'/'+_0x5cece5)[_0xd91b('0x1a')](_0x373d8c);}return null;};}function patchUpdates(_0xe267e1){return function(_0x3ba611){try{jsonpatch[_0xd91b('0x1f')](_0x3ba611,_0xe267e1,!![]);}catch(_0x5ef333){return BPromise[_0xd91b('0x20')](_0x5ef333);}return _0x3ba611[_0xd91b('0x21')]();};}function saveUpdates(_0x16e666,_0x58ca48){return function(_0x15e927){if(_0x15e927){return _0x15e927[_0xd91b('0x22')](_0x16e666)[_0xd91b('0x23')](function(_0x165995){return _0x165995;});}return null;};}function removeEntity(_0x2ac6e4,_0x5600c7){return function(_0x37ae67){if(_0x37ae67){return _0x37ae67[_0xd91b('0x24')]()['then'](function(){var _0x3dac26=_0x37ae67[_0xd91b('0x25')]({'plain':!![]});var _0x2af43e=_0xd91b('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x2af43e,'resourceId':_0x3dac26['id']}})[_0xd91b('0x23')](function(){return _0x37ae67;});})[_0xd91b('0x23')](function(){_0x2ac6e4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dafc2,_0x264468){return function(_0x289809){if(!_0x289809){_0x1dafc2['sendStatus'](0x194);}return _0x289809;};}function handleError(_0x1df398,_0x3bfd13){_0x3bfd13=_0x3bfd13||0x1f4;return function(_0x568e79){logger[_0xd91b('0x27')](_0x568e79['stack']);if(_0x568e79[_0xd91b('0x28')]){delete _0x568e79[_0xd91b('0x28')];}_0x1df398['status'](_0x3bfd13)[_0xd91b('0x29')](_0x568e79);};}exports[_0xd91b('0x2a')]=function(_0x49af26,_0x3084eb){var _0x31e68e={},_0x23de7d={},_0x6a5f71={'count':0x0,'rows':[]};var _0x50d995=_[_0xd91b('0x2b')](db['Campaign']['rawAttributes'],function(_0x20455a){return{'name':_0x20455a[_0xd91b('0x2c')],'type':_0x20455a[_0xd91b('0x2d')][_0xd91b('0x2e')]};});_0x23de7d[_0xd91b('0x2f')]=_['map'](_0x50d995,_0xd91b('0x28'));_0x23de7d[_0xd91b('0x30')]=_['keys'](_0x49af26['query']);_0x23de7d[_0xd91b('0x31')]=_['intersection'](_0x23de7d[_0xd91b('0x2f')],_0x23de7d[_0xd91b('0x30')]);_0x31e68e[_0xd91b('0x32')]=_['intersection'](_0x23de7d[_0xd91b('0x2f')],qs[_0xd91b('0x33')](_0x49af26[_0xd91b('0x30')][_0xd91b('0x33')]));_0x31e68e[_0xd91b('0x32')]=_0x31e68e[_0xd91b('0x32')][_0xd91b('0x34')]?_0x31e68e[_0xd91b('0x32')]:_0x23de7d['model'];if(!_0x49af26['query'][_0xd91b('0x35')](_0xd91b('0x36'))){_0x31e68e[_0xd91b('0x1c')]=qs[_0xd91b('0x1c')](_0x49af26[_0xd91b('0x30')][_0xd91b('0x1c')]);_0x31e68e[_0xd91b('0x1b')]=qs[_0xd91b('0x1b')](_0x49af26['query']['offset']);}_0x31e68e[_0xd91b('0x37')]=qs['sort'](_0x49af26[_0xd91b('0x30')][_0xd91b('0x38')]);_0x31e68e[_0xd91b('0x39')]=qs['filters'](_['pick'](_0x49af26[_0xd91b('0x30')],_0x23de7d[_0xd91b('0x31')]),_0x50d995);if(_0x49af26[_0xd91b('0x30')]['filter']){_0x31e68e[_0xd91b('0x39')]=_[_0xd91b('0x3a')](_0x31e68e[_0xd91b('0x39')],{'$or':_[_0xd91b('0x2b')](_0x50d995,function(_0x48c36e){if(_0x48c36e[_0xd91b('0x2d')]!==_0xd91b('0x3b')){var _0x1e4c1f={};_0x1e4c1f[_0x48c36e[_0xd91b('0x28')]]={'$like':'%'+_0x49af26[_0xd91b('0x30')]['filter']+'%'};return _0x1e4c1f;}})});}_0x31e68e=_[_0xd91b('0x3a')]({},_0x31e68e,_0x49af26[_0xd91b('0x3c')]);var _0x500dcb={'where':_0x31e68e['where']};return db['Campaign'][_0xd91b('0x3d')](_0x500dcb)[_0xd91b('0x23')](function(_0x37f086){_0x6a5f71[_0xd91b('0x3d')]=_0x37f086;if(_0x49af26[_0xd91b('0x30')][_0xd91b('0x3e')]){_0x31e68e['include']=[{'all':!![]}];}return db['Campaign'][_0xd91b('0x3f')](_0x31e68e);})[_0xd91b('0x23')](function(_0x449848){_0x6a5f71[_0xd91b('0x40')]=_0x449848;return _0x6a5f71;})[_0xd91b('0x23')](respondWithFilteredResult(_0x3084eb,_0x31e68e))[_0xd91b('0x41')](handleError(_0x3084eb,null));};exports['show']=function(_0x367be0,_0x1d874e){var _0x1c684a={'raw':![],'where':{'id':_0x367be0[_0xd91b('0x42')]['id']}},_0x121f9b={};_0x121f9b[_0xd91b('0x2f')]=_[_0xd91b('0x43')](db[_0xd91b('0x44')][_0xd91b('0x45')]);_0x121f9b[_0xd91b('0x30')]=_[_0xd91b('0x43')](_0x367be0['query']);_0x121f9b['filters']=_['intersection'](_0x121f9b[_0xd91b('0x2f')],_0x121f9b[_0xd91b('0x30')]);_0x1c684a[_0xd91b('0x32')]=_['intersection'](_0x121f9b[_0xd91b('0x2f')],qs[_0xd91b('0x33')](_0x367be0[_0xd91b('0x30')][_0xd91b('0x33')]));_0x1c684a[_0xd91b('0x32')]=_0x1c684a[_0xd91b('0x32')][_0xd91b('0x34')]?_0x1c684a[_0xd91b('0x32')]:_0x121f9b['model'];if(_0x367be0[_0xd91b('0x30')][_0xd91b('0x3e')]){_0x1c684a[_0xd91b('0x46')]=[{'all':!![]}];}_0x1c684a=_[_0xd91b('0x3a')]({},_0x1c684a,_0x367be0[_0xd91b('0x3c')]);return db[_0xd91b('0x44')][_0xd91b('0x47')](_0x1c684a)[_0xd91b('0x23')](handleEntityNotFound(_0x1d874e,null))[_0xd91b('0x23')](respondWithResult(_0x1d874e,null))[_0xd91b('0x41')](handleError(_0x1d874e,null));};exports[_0xd91b('0x48')]=function(_0x589b13,_0x313545){return db[_0xd91b('0x44')]['create'](_0x589b13[_0xd91b('0x49')],{})[_0xd91b('0x23')](function(_0x3dd20f){var _0x59183f=_0x589b13[_0xd91b('0x4a')][_0xd91b('0x25')]({'plain':!![]});if(!_0x59183f)throw new Error(_0xd91b('0x4b'));if(_0x59183f['role']===_0xd91b('0x4a')){var _0x442247=_0x3dd20f['get']({'plain':!![]});var _0x30f534=_0xd91b('0x26');return db[_0xd91b('0x4c')][_0xd91b('0x47')]({'where':{'name':_0x30f534,'userProfileId':_0x59183f[_0xd91b('0x4d')]},'raw':!![]})['then'](function(_0xd04485){if(_0xd04485&&_0xd04485[_0xd91b('0x4e')]===0x0){return db['UserProfileResource'][_0xd91b('0x48')]({'name':_0x442247['name'],'resourceId':_0x442247['id'],'type':_0xd04485[_0xd91b('0x28')],'sectionId':_0xd04485['id']},{})[_0xd91b('0x23')](function(){return _0x3dd20f;});}else{return _0x3dd20f;}})['catch'](function(_0x32912f){logger[_0xd91b('0x27')](_0xd91b('0x4f'),_0x32912f);throw _0x32912f;});}return _0x3dd20f;})[_0xd91b('0x23')](respondWithResult(_0x313545,0xc9))[_0xd91b('0x41')](handleError(_0x313545,null));};exports[_0xd91b('0x50')]=function(_0x4a627e,_0x538511){var _0x1a9c27={'where':{'id':_0x4a627e[_0xd91b('0x42')]['id']}},_0x176b3e={};_0x176b3e[_0xd91b('0x2f')]=_[_0xd91b('0x43')](db[_0xd91b('0x44')][_0xd91b('0x45')]);_0x1a9c27[_0xd91b('0x32')]=_[_0xd91b('0x51')](_0x176b3e[_0xd91b('0x2f')],qs[_0xd91b('0x33')](_0x4a627e[_0xd91b('0x30')][_0xd91b('0x33')]));_0x1a9c27['attributes']=_0x1a9c27[_0xd91b('0x32')][_0xd91b('0x34')]?_0x1a9c27[_0xd91b('0x32')]:_0x176b3e[_0xd91b('0x2f')];if(_0x4a627e['query']['includeAll']){_0x1a9c27[_0xd91b('0x46')]=[{'all':!![]}];}_0x1a9c27=_['merge']({},_0x1a9c27,_0x4a627e[_0xd91b('0x3c')]);return db[_0xd91b('0x44')][_0xd91b('0x47')](_0x1a9c27)[_0xd91b('0x23')](handleEntityNotFound(_0x538511,null))['then'](function(_0x17c515){if(_0x17c515){var _0x54fe73=_0x17c515['get']({'plain':!![]});_0x54fe73=qs[_0xd91b('0x52')](_0x54fe73,['id',_0xd91b('0x53'),_0xd91b('0x54')]);_0x4a627e[_0xd91b('0x49')]=_[_0xd91b('0x52')](_0x4a627e['body'],['id',_0xd91b('0x53'),_0xd91b('0x54')]);return db[_0xd91b('0x44')][_0xd91b('0x48')](_[_0xd91b('0x3a')](_0x54fe73,_0x4a627e[_0xd91b('0x49')]),{'include':_0x4a627e[_0xd91b('0x30')][_0xd91b('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0x24e3cb){var _0x2c3ba6=_0x4a627e[_0xd91b('0x4a')]['get']({'plain':!![]});if(!_0x2c3ba6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c3ba6[_0xd91b('0x55')]==='user'){var _0x2e2c01=_0x24e3cb[_0xd91b('0x25')]({'plain':!![]});var _0x538843=_0xd91b('0x26');return db[_0xd91b('0x4c')]['find']({'where':{'name':_0x538843,'userProfileId':_0x2c3ba6[_0xd91b('0x4d')]},'raw':!![]})[_0xd91b('0x23')](function(_0x21c9ef){if(_0x21c9ef&&_0x21c9ef['autoAssociation']===0x0){return db[_0xd91b('0x56')][_0xd91b('0x48')]({'name':_0x2e2c01[_0xd91b('0x28')],'resourceId':_0x2e2c01['id'],'type':_0x21c9ef[_0xd91b('0x28')],'sectionId':_0x21c9ef['id']},{})[_0xd91b('0x23')](function(){return _0x24e3cb;});}else{return _0x24e3cb;}})['catch'](function(_0x32b784){logger[_0xd91b('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32b784);throw _0x32b784;});}return _0x24e3cb;});}})[_0xd91b('0x23')](respondWithResult(_0x538511,0xc9))['catch'](handleError(_0x538511,null));};exports['update']=function(_0x43d1d5,_0x1ae92f){if(_0x43d1d5[_0xd91b('0x49')]['id']){delete _0x43d1d5[_0xd91b('0x49')]['id'];}return db['Campaign']['find']({'where':{'id':_0x43d1d5[_0xd91b('0x42')]['id']}})[_0xd91b('0x23')](handleEntityNotFound(_0x1ae92f,null))[_0xd91b('0x23')](saveUpdates(_0x43d1d5[_0xd91b('0x49')],null))[_0xd91b('0x23')](respondWithResult(_0x1ae92f,null))[_0xd91b('0x41')](handleError(_0x1ae92f,null));};exports[_0xd91b('0x24')]=function(_0x5cbe7d,_0x455fc0){return db[_0xd91b('0x44')]['find']({'where':{'id':_0x5cbe7d[_0xd91b('0x42')]['id']}})['then'](handleEntityNotFound(_0x455fc0,null))['then'](removeEntity(_0x455fc0,null))['catch'](handleError(_0x455fc0,null));};exports[_0xd91b('0x57')]=function(_0x450b3a,_0x5a1e0b,_0x277eac){var _0x257b0f={'raw':!![],'where':{}};var _0x593fe7={};var _0x27b69a={'count':0x0,'rows':[]};return db[_0xd91b('0x44')][_0xd91b('0x58')]({'where':{'id':_0x450b3a['params']['id']}})['then'](handleEntityNotFound(_0x5a1e0b,null))['then'](function(_0x4f2527){if(_0x4f2527){_0x593fe7[_0xd91b('0x2f')]=_[_0xd91b('0x43')](db['CmHopper'][_0xd91b('0x45')]);_0x593fe7[_0xd91b('0x30')]=_['keys'](_0x450b3a[_0xd91b('0x30')]);_0x593fe7['filters']=_['intersection'](_0x593fe7[_0xd91b('0x2f')],_0x593fe7['query']);_0x257b0f[_0xd91b('0x32')]=_['intersection'](_0x593fe7[_0xd91b('0x2f')],qs[_0xd91b('0x33')](_0x450b3a[_0xd91b('0x30')]['fields']));_0x257b0f[_0xd91b('0x32')]=_0x257b0f[_0xd91b('0x32')][_0xd91b('0x34')]?_0x257b0f[_0xd91b('0x32')]:_0x593fe7['model'];if(!_0x450b3a[_0xd91b('0x30')]['hasOwnProperty']('nolimit')){_0x257b0f[_0xd91b('0x1c')]=qs[_0xd91b('0x1c')](_0x450b3a[_0xd91b('0x30')][_0xd91b('0x1c')]);_0x257b0f['offset']=qs['offset'](_0x450b3a['query']['offset']);}_0x257b0f[_0xd91b('0x37')]=qs['sort'](_0x450b3a['query'][_0xd91b('0x38')]);_0x257b0f[_0xd91b('0x39')]=qs[_0xd91b('0x31')](_['pick'](_0x450b3a[_0xd91b('0x30')],_0x593fe7[_0xd91b('0x31')]));_0x257b0f['where']['CampaignId']=_0x4f2527['id'];if(_0x450b3a[_0xd91b('0x30')][_0xd91b('0x59')]){_0x257b0f[_0xd91b('0x39')]=_[_0xd91b('0x3a')](_0x257b0f['where'],{'$or':_[_0xd91b('0x2b')](_0x257b0f[_0xd91b('0x32')],function(_0x396450){var _0x156261={};_0x156261[_0x396450]={'$like':'%'+_0x450b3a['query'][_0xd91b('0x59')]+'%'};return _0x156261;})});}_0x257b0f=_[_0xd91b('0x3a')]({},_0x257b0f,_0x450b3a[_0xd91b('0x3c')]);return db['CmHopper'][_0xd91b('0x3d')]({'where':_0x257b0f[_0xd91b('0x39')]})[_0xd91b('0x23')](function(_0x14f5be){_0x27b69a['count']=_0x14f5be;if(_0x450b3a['query'][_0xd91b('0x3e')]){_0x257b0f[_0xd91b('0x46')]=[{'all':!![]}];}return db['CmHopper'][_0xd91b('0x3f')](_0x257b0f);})[_0xd91b('0x23')](function(_0x510a30){_0x27b69a[_0xd91b('0x40')]=_0x510a30;return _0x27b69a;});}})['then'](respondWithFilteredResult(_0x5a1e0b,_0x257b0f))[_0xd91b('0x41')](handleError(_0x5a1e0b,null));};exports['getHopperHistories']=function(_0x42bca3,_0x3c7d2b,_0x127a2f){var _0x435637={'raw':!![],'where':{}};var _0xf68376={};var _0x383194={'count':0x0,'rows':[]};return db[_0xd91b('0x44')][_0xd91b('0x58')]({'where':{'id':_0x42bca3[_0xd91b('0x42')]['id']}})[_0xd91b('0x23')](handleEntityNotFound(_0x3c7d2b,null))[_0xd91b('0x23')](function(_0x79fb76){if(_0x79fb76){_0xf68376[_0xd91b('0x2f')]=_[_0xd91b('0x43')](db[_0xd91b('0x5a')][_0xd91b('0x45')]);_0xf68376[_0xd91b('0x30')]=_[_0xd91b('0x43')](_0x42bca3[_0xd91b('0x30')]);_0xf68376[_0xd91b('0x31')]=_[_0xd91b('0x51')](_0xf68376[_0xd91b('0x2f')],_0xf68376['query']);_0x435637[_0xd91b('0x32')]=_['intersection'](_0xf68376['model'],qs[_0xd91b('0x33')](_0x42bca3[_0xd91b('0x30')][_0xd91b('0x33')]));_0x435637[_0xd91b('0x32')]=_0x435637['attributes'][_0xd91b('0x34')]?_0x435637['attributes']:_0xf68376[_0xd91b('0x2f')];if(!_0x42bca3[_0xd91b('0x30')][_0xd91b('0x35')](_0xd91b('0x36'))){_0x435637['limit']=qs[_0xd91b('0x1c')](_0x42bca3[_0xd91b('0x30')][_0xd91b('0x1c')]);_0x435637[_0xd91b('0x1b')]=qs[_0xd91b('0x1b')](_0x42bca3[_0xd91b('0x30')][_0xd91b('0x1b')]);}_0x435637['order']=qs[_0xd91b('0x38')](_0x42bca3[_0xd91b('0x30')]['sort']);_0x435637[_0xd91b('0x39')]=qs['filters'](_['pick'](_0x42bca3['query'],_0xf68376[_0xd91b('0x31')]));_0x435637[_0xd91b('0x39')][_0xd91b('0x5b')]=_0x79fb76['id'];if(_0x42bca3[_0xd91b('0x30')][_0xd91b('0x59')]){_0x435637['where']=_[_0xd91b('0x3a')](_0x435637['where'],{'$or':_[_0xd91b('0x2b')](_0x435637[_0xd91b('0x32')],function(_0x2afa52){var _0x4201a6={};_0x4201a6[_0x2afa52]={'$like':'%'+_0x42bca3['query'][_0xd91b('0x59')]+'%'};return _0x4201a6;})});}_0x435637=_[_0xd91b('0x3a')]({},_0x435637,_0x42bca3[_0xd91b('0x3c')]);return db[_0xd91b('0x5a')][_0xd91b('0x3d')]({'where':_0x435637[_0xd91b('0x39')]})[_0xd91b('0x23')](function(_0x474bfe){_0x383194['count']=_0x474bfe;if(_0x42bca3[_0xd91b('0x30')]['includeAll']){_0x435637[_0xd91b('0x46')]=[{'all':!![]}];}return db[_0xd91b('0x5a')][_0xd91b('0x3f')](_0x435637);})[_0xd91b('0x23')](function(_0xcef1){_0x383194[_0xd91b('0x40')]=_0xcef1;return _0x383194;});}})[_0xd91b('0x23')](respondWithFilteredResult(_0x3c7d2b,_0x435637))[_0xd91b('0x41')](handleError(_0x3c7d2b,null));};exports[_0xd91b('0x5c')]=function(_0x3df3d7,_0x5493c2,_0x4c30be){var _0x4c894b={'raw':!![],'where':{}};var _0x1cde5a={};var _0x77a50d={'count':0x0,'rows':[]};return db['Campaign'][_0xd91b('0x58')]({'where':{'id':_0x3df3d7[_0xd91b('0x42')]['id']}})[_0xd91b('0x23')](handleEntityNotFound(_0x5493c2,null))[_0xd91b('0x23')](function(_0x5785a8){if(_0x5785a8){_0x1cde5a[_0xd91b('0x2f')]=_['keys'](db['CmHopperFinal'][_0xd91b('0x45')]);_0x1cde5a['query']=_[_0xd91b('0x43')](_0x3df3d7[_0xd91b('0x30')]);_0x1cde5a[_0xd91b('0x31')]=_[_0xd91b('0x51')](_0x1cde5a['model'],_0x1cde5a[_0xd91b('0x30')]);_0x4c894b[_0xd91b('0x32')]=_[_0xd91b('0x51')](_0x1cde5a[_0xd91b('0x2f')],qs[_0xd91b('0x33')](_0x3df3d7[_0xd91b('0x30')][_0xd91b('0x33')]));_0x4c894b[_0xd91b('0x32')]=_0x4c894b['attributes'][_0xd91b('0x34')]?_0x4c894b[_0xd91b('0x32')]:_0x1cde5a[_0xd91b('0x2f')];if(!_0x3df3d7[_0xd91b('0x30')][_0xd91b('0x35')](_0xd91b('0x36'))){_0x4c894b[_0xd91b('0x1c')]=qs[_0xd91b('0x1c')](_0x3df3d7[_0xd91b('0x30')][_0xd91b('0x1c')]);_0x4c894b[_0xd91b('0x1b')]=qs[_0xd91b('0x1b')](_0x3df3d7['query'][_0xd91b('0x1b')]);}_0x4c894b['order']=qs['sort'](_0x3df3d7[_0xd91b('0x30')]['sort']);_0x4c894b[_0xd91b('0x39')]=qs[_0xd91b('0x31')](_[_0xd91b('0x5d')](_0x3df3d7['query'],_0x1cde5a['filters']));_0x4c894b[_0xd91b('0x39')][_0xd91b('0x5b')]=_0x5785a8['id'];if(_0x3df3d7[_0xd91b('0x30')]['filter']){_0x4c894b[_0xd91b('0x39')]=_[_0xd91b('0x3a')](_0x4c894b['where'],{'$or':_[_0xd91b('0x2b')](_0x4c894b['attributes'],function(_0x4c86e9){var _0x15afe1={};_0x15afe1[_0x4c86e9]={'$like':'%'+_0x3df3d7[_0xd91b('0x30')][_0xd91b('0x59')]+'%'};return _0x15afe1;})});}_0x4c894b=_['merge']({},_0x4c894b,_0x3df3d7[_0xd91b('0x3c')]);return db[_0xd91b('0x5e')][_0xd91b('0x3d')]({'where':_0x4c894b[_0xd91b('0x39')]})[_0xd91b('0x23')](function(_0x158b91){_0x77a50d[_0xd91b('0x3d')]=_0x158b91;if(_0x3df3d7[_0xd91b('0x30')][_0xd91b('0x3e')]){_0x4c894b['include']=[{'all':!![]}];}return db[_0xd91b('0x5e')][_0xd91b('0x3f')](_0x4c894b);})[_0xd91b('0x23')](function(_0x5bb292){_0x77a50d[_0xd91b('0x40')]=_0x5bb292;return _0x77a50d;});}})[_0xd91b('0x23')](respondWithFilteredResult(_0x5493c2,_0x4c894b))[_0xd91b('0x41')](handleError(_0x5493c2,null));};exports[_0xd91b('0x5f')]=function(_0x5ea701,_0x536b2a,_0x11ead0){var _0x5546fd={'raw':!![],'where':{}};var _0x19d345={};var _0x259595={'count':0x0,'rows':[]};return db[_0xd91b('0x44')][_0xd91b('0x58')]({'where':{'id':_0x5ea701['params']['id']}})['then'](handleEntityNotFound(_0x536b2a,null))[_0xd91b('0x23')](function(_0x421d4b){if(_0x421d4b){_0x19d345[_0xd91b('0x2f')]=_[_0xd91b('0x43')](db[_0xd91b('0x60')][_0xd91b('0x45')]);_0x19d345[_0xd91b('0x30')]=_['keys'](_0x5ea701[_0xd91b('0x30')]);_0x19d345['filters']=_[_0xd91b('0x51')](_0x19d345[_0xd91b('0x2f')],_0x19d345[_0xd91b('0x30')]);_0x5546fd[_0xd91b('0x32')]=_[_0xd91b('0x51')](_0x19d345[_0xd91b('0x2f')],qs['fields'](_0x5ea701[_0xd91b('0x30')][_0xd91b('0x33')]));_0x5546fd['attributes']=_0x5546fd[_0xd91b('0x32')]['length']?_0x5546fd[_0xd91b('0x32')]:_0x19d345[_0xd91b('0x2f')];if(!_0x5ea701[_0xd91b('0x30')]['hasOwnProperty']('nolimit')){_0x5546fd[_0xd91b('0x1c')]=qs[_0xd91b('0x1c')](_0x5ea701['query'][_0xd91b('0x1c')]);_0x5546fd['offset']=qs[_0xd91b('0x1b')](_0x5ea701[_0xd91b('0x30')][_0xd91b('0x1b')]);}_0x5546fd[_0xd91b('0x37')]=qs[_0xd91b('0x38')](_0x5ea701[_0xd91b('0x30')]['sort']);_0x5546fd[_0xd91b('0x39')]=qs[_0xd91b('0x31')](_['pick'](_0x5ea701[_0xd91b('0x30')],_0x19d345[_0xd91b('0x31')]));_0x5546fd[_0xd91b('0x39')]['CampaignId']=_0x421d4b['id'];if(_0x5ea701[_0xd91b('0x30')][_0xd91b('0x59')]){_0x5546fd['where']=_[_0xd91b('0x3a')](_0x5546fd[_0xd91b('0x39')],{'$or':_[_0xd91b('0x2b')](_0x5546fd[_0xd91b('0x32')],function(_0x2553e5){var _0xec7cfd={};_0xec7cfd[_0x2553e5]={'$like':'%'+_0x5ea701[_0xd91b('0x30')][_0xd91b('0x59')]+'%'};return _0xec7cfd;})});}_0x5546fd=_[_0xd91b('0x3a')]({},_0x5546fd,_0x5ea701[_0xd91b('0x3c')]);return db[_0xd91b('0x60')][_0xd91b('0x3d')]({'where':_0x5546fd[_0xd91b('0x39')]})[_0xd91b('0x23')](function(_0xa75cd){_0x259595['count']=_0xa75cd;if(_0x5ea701[_0xd91b('0x30')][_0xd91b('0x3e')]){_0x5546fd[_0xd91b('0x46')]=[{'all':!![]}];}return db[_0xd91b('0x60')][_0xd91b('0x3f')](_0x5546fd);})[_0xd91b('0x23')](function(_0x587f8b){_0x259595[_0xd91b('0x40')]=_0x587f8b;return _0x259595;});}})[_0xd91b('0x23')](respondWithFilteredResult(_0x536b2a,_0x5546fd))[_0xd91b('0x41')](handleError(_0x536b2a,null));};exports[_0xd91b('0x61')]=function(_0x53e5a5,_0x402d28,_0x40c56f){var _0x284945={};var _0x19bdbe={};var _0x460bf1;var _0x506372;return db[_0xd91b('0x44')]['findOne']({'where':{'id':_0x53e5a5['params']['id']}})['then'](handleEntityNotFound(_0x402d28,null))['then'](function(_0x665a58){if(_0x665a58){_0x460bf1=_0x665a58;_0x19bdbe[_0xd91b('0x2f')]=_['keys'](db[_0xd91b('0x62')][_0xd91b('0x45')]);_0x19bdbe[_0xd91b('0x30')]=_['keys'](_0x53e5a5[_0xd91b('0x30')]);_0x19bdbe[_0xd91b('0x31')]=_[_0xd91b('0x51')](_0x19bdbe[_0xd91b('0x2f')],_0x19bdbe[_0xd91b('0x30')]);_0x284945[_0xd91b('0x32')]=_[_0xd91b('0x51')](_0x19bdbe[_0xd91b('0x2f')],qs['fields'](_0x53e5a5[_0xd91b('0x30')][_0xd91b('0x33')]));_0x284945['attributes']=_0x284945[_0xd91b('0x32')][_0xd91b('0x34')]?_0x284945[_0xd91b('0x32')]:_0x19bdbe['model'];_0x284945[_0xd91b('0x37')]=qs[_0xd91b('0x38')](_0x53e5a5[_0xd91b('0x30')]['sort']);_0x284945[_0xd91b('0x39')]=qs['filters'](_[_0xd91b('0x5d')](_0x53e5a5[_0xd91b('0x30')],_0x19bdbe['filters']));if(_0x53e5a5[_0xd91b('0x30')]['filter']){_0x284945['where']=_['merge'](_0x284945[_0xd91b('0x39')],{'$or':_[_0xd91b('0x2b')](_0x284945[_0xd91b('0x32')],function(_0x21988e){var _0x3218da={};_0x3218da[_0x21988e]={'$like':'%'+_0x53e5a5['query']['filter']+'%'};return _0x3218da;})});}_0x284945=_[_0xd91b('0x3a')]({},_0x284945,_0x53e5a5[_0xd91b('0x3c')]);return _0x460bf1[_0xd91b('0x61')](_0x284945);}})[_0xd91b('0x23')](function(_0x1d7397){if(_0x1d7397){_0x506372=_0x1d7397['length'];if(!_0x53e5a5[_0xd91b('0x30')][_0xd91b('0x35')](_0xd91b('0x36'))){_0x284945[_0xd91b('0x1c')]=qs[_0xd91b('0x1c')](_0x53e5a5[_0xd91b('0x30')][_0xd91b('0x1c')]);_0x284945[_0xd91b('0x1b')]=qs[_0xd91b('0x1b')](_0x53e5a5[_0xd91b('0x30')][_0xd91b('0x1b')]);}return _0x460bf1['getLists'](_0x284945);}})[_0xd91b('0x23')](function(_0x523a98){if(_0x523a98){return _0x523a98?{'count':_0x506372,'rows':_0x523a98}:null;}})['then'](respondWithResult(_0x402d28,null))['catch'](handleError(_0x402d28,null));};exports[_0xd91b('0x63')]=function(_0x6f746e,_0x540d63,_0x4714fd){var _0x2fa5d7,_0x1eee18;return db[_0xd91b('0x44')][_0xd91b('0x47')]({'where':{'id':_0x6f746e[_0xd91b('0x42')]['id']}})['then'](handleEntityNotFound(_0x540d63,null))[_0xd91b('0x23')](function(_0x1cc0bd){if(_0x1cc0bd){_0x1eee18=_0x1cc0bd;return _0x1cc0bd[_0xd91b('0x63')](_0x6f746e[_0xd91b('0x49')]['ids'],_['omit'](_0x6f746e[_0xd91b('0x49')],[_0xd91b('0x64'),'id'])||{});}return null;})[_0xd91b('0x65')](function(_0x26ab84){var _0x53f0ba;_0x2fa5d7=_0x26ab84||[];var _0x12a794=[];if(_0x26ab84){for(var _0x4fb4ce=0x0;_0x4fb4ce<_0x26ab84[_0xd91b('0x34')];_0x4fb4ce+=0x1){var _0x4c7d1c=_0x26ab84[_0x4fb4ce][_0xd91b('0x25')]({'plain':!![]});_0x1eee18[_0xd91b('0x66')]=_0x6f746e[_0xd91b('0x49')][_0xd91b('0x66')]?_0x6f746e[_0xd91b('0x49')][_0xd91b('0x66')]:_0x1eee18[_0xd91b('0x66')];switch(_0x1eee18[_0xd91b('0x66')]){case _0xd91b('0x67'):_0x53f0ba=squel[_0xd91b('0x68')]()['into'](_0xd91b('0x69'))[_0xd91b('0x6a')]([_0xd91b('0x6b'),_0xd91b('0x6c'),_0xd91b('0x6d'),_0xd91b('0x6e'),'CampaignId',_0xd91b('0x53'),_0xd91b('0x54')],squel[_0xd91b('0x6f')]()[_0xd91b('0x70')](_0xd91b('0x6b'),_0xd91b('0x6b'))[_0xd91b('0x70')]('NOW()',_0xd91b('0x6c'))[_0xd91b('0x70')]('id',_0xd91b('0x6d'))[_0xd91b('0x70')](_0x4c7d1c[_0xd91b('0x71')][_0xd91b('0x72')](),_0xd91b('0x6e'))[_0xd91b('0x70')](_0x6f746e['params']['id'][_0xd91b('0x72')](),_0xd91b('0x5b'))[_0xd91b('0x70')](_0xd91b('0x73'),_0xd91b('0x53'))[_0xd91b('0x70')](_0xd91b('0x73'),'updatedAt')['from'](_0xd91b('0x74'))['where'](_0xd91b('0x75'))[_0xd91b('0x39')](_0xd91b('0x76'),_0x4c7d1c[_0xd91b('0x71')][_0xd91b('0x72')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xd91b('0x39')](_0xd91b('0x77'),squel[_0xd91b('0x6f')]()[_0xd91b('0x70')]('COALESCE(calleridnum,\x27\x27)')[_0xd91b('0x78')](_0xd91b('0x79'))[_0xd91b('0x39')](_0xd91b('0x7a'),_0x6f746e['params']['id'][_0xd91b('0x72')]()))[_0xd91b('0x39')](_0xd91b('0x77'),squel[_0xd91b('0x6f')]()[_0xd91b('0x70')]('COALESCE(phone,\x27\x27)')[_0xd91b('0x78')](_0xd91b('0x69'))['where']('CampaignId\x20=\x20?',_0x6f746e[_0xd91b('0x42')]['id']['toString']())))[_0xd91b('0x72')]();break;case'onlyIfOpen':_0x53f0ba=squel[_0xd91b('0x68')]()[_0xd91b('0x7b')]('cm_hopper')[_0xd91b('0x6a')]([_0xd91b('0x6b'),_0xd91b('0x6c'),_0xd91b('0x6d'),_0xd91b('0x6e'),'CampaignId',_0xd91b('0x53'),_0xd91b('0x54')],squel[_0xd91b('0x6f')]()[_0xd91b('0x70')]('phone',_0xd91b('0x6b'))['field'](_0xd91b('0x73'),'scheduledAt')[_0xd91b('0x70')]('id','ContactId')[_0xd91b('0x70')](_0x4c7d1c[_0xd91b('0x71')][_0xd91b('0x72')](),_0xd91b('0x6e'))[_0xd91b('0x70')](_0x6f746e[_0xd91b('0x42')]['id'][_0xd91b('0x72')](),_0xd91b('0x5b'))[_0xd91b('0x70')](_0xd91b('0x73'),_0xd91b('0x53'))[_0xd91b('0x70')](_0xd91b('0x73'),_0xd91b('0x54'))[_0xd91b('0x78')](_0xd91b('0x74'))[_0xd91b('0x39')](_0xd91b('0x75'))[_0xd91b('0x39')]('ListId\x20=\x20?',_0x4c7d1c[_0xd91b('0x71')]['toString']())[_0xd91b('0x39')](_0xd91b('0x7c'))[_0xd91b('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xd91b('0x6f')]()[_0xd91b('0x70')]('COALESCE(phone,\x27\x27)')['from'](_0xd91b('0x69'))[_0xd91b('0x39')](_0xd91b('0x7a'),_0x6f746e['params']['id']['toString']())))['toString']();break;default:_0x53f0ba=squel[_0xd91b('0x68')]()['into'](_0xd91b('0x69'))[_0xd91b('0x6a')]([_0xd91b('0x6b'),_0xd91b('0x6c'),_0xd91b('0x6d'),'ListId',_0xd91b('0x5b'),_0xd91b('0x53'),'updatedAt'],squel[_0xd91b('0x6f')]()[_0xd91b('0x70')](_0xd91b('0x6b'),_0xd91b('0x6b'))[_0xd91b('0x70')](_0xd91b('0x73'),_0xd91b('0x6c'))[_0xd91b('0x70')]('id','ContactId')[_0xd91b('0x70')](_0x4c7d1c[_0xd91b('0x71')][_0xd91b('0x72')](),_0xd91b('0x6e'))[_0xd91b('0x70')](_0x6f746e[_0xd91b('0x42')]['id'][_0xd91b('0x72')](),_0xd91b('0x5b'))[_0xd91b('0x70')](_0xd91b('0x73'),_0xd91b('0x53'))[_0xd91b('0x70')](_0xd91b('0x73'),_0xd91b('0x54'))[_0xd91b('0x78')](_0xd91b('0x74'))[_0xd91b('0x39')](_0xd91b('0x75'))[_0xd91b('0x39')]('ListId\x20=\x20?',_0x4c7d1c[_0xd91b('0x71')][_0xd91b('0x72')]())['where'](_0xd91b('0x7c')))['toString']();}_0x12a794[_0xd91b('0x7d')](db[_0xd91b('0x7e')][_0xd91b('0x30')](_0x53f0ba));}return BPromise[_0xd91b('0x7f')](_0x12a794);}})['then'](function(){return _0x2fa5d7;})[_0xd91b('0x23')](respondWithResult(_0x540d63,null))[_0xd91b('0x41')](handleError(_0x540d63,null));};exports[_0xd91b('0x80')]=function(_0x453812,_0x131f78,_0x27bfa1){return db[_0xd91b('0x44')]['find']({'where':{'id':_0x453812[_0xd91b('0x42')]['id']}})[_0xd91b('0x23')](handleEntityNotFound(_0x131f78,null))[_0xd91b('0x23')](function(_0x324a88){if(_0x324a88){return _0x324a88['removeLists'](_0x453812['query'][_0xd91b('0x64')]);}})['then'](function(_0x3c732a){if(_0x3c732a){return db[_0xd91b('0x81')][_0xd91b('0x24')]({'where':{'ListId':_0x453812['query']['ids'],'CampaignId':_0x453812['params']['id']}})[_0xd91b('0x23')](function(){return _0x3c732a;});}})[_0xd91b('0x23')](respondWithStatusCode(_0x131f78,null))['catch'](handleError(_0x131f78,null));};exports[_0xd91b('0x82')]=function(_0x3d8556,_0x47fc8f,_0x31da22){var _0x49864c={'raw':!![],'where':{}};var _0x16454d={};var _0x5ee71f={'count':0x0,'rows':[]};return db[_0xd91b('0x44')][_0xd91b('0x58')]({'where':{'id':_0x3d8556[_0xd91b('0x42')]['id']}})['then'](handleEntityNotFound(_0x47fc8f,null))['then'](function(_0x2658c1){if(_0x2658c1){_0x16454d[_0xd91b('0x2f')]=_[_0xd91b('0x43')](db[_0xd91b('0x62')][_0xd91b('0x45')]);_0x16454d['query']=_[_0xd91b('0x43')](_0x3d8556[_0xd91b('0x30')]);_0x16454d['filters']=_[_0xd91b('0x51')](_0x16454d[_0xd91b('0x2f')],_0x16454d[_0xd91b('0x30')]);_0x49864c[_0xd91b('0x32')]=_[_0xd91b('0x51')](_0x16454d[_0xd91b('0x2f')],qs[_0xd91b('0x33')](_0x3d8556[_0xd91b('0x30')][_0xd91b('0x33')]));_0x49864c['attributes']=_0x49864c['attributes'][_0xd91b('0x34')]?_0x49864c[_0xd91b('0x32')]:_0x16454d['model'];if(!_0x3d8556['query'][_0xd91b('0x35')](_0xd91b('0x36'))){_0x49864c['limit']=qs[_0xd91b('0x1c')](_0x3d8556[_0xd91b('0x30')][_0xd91b('0x1c')]);_0x49864c[_0xd91b('0x1b')]=qs[_0xd91b('0x1b')](_0x3d8556['query']['offset']);}_0x49864c[_0xd91b('0x37')]=qs[_0xd91b('0x38')](_0x3d8556[_0xd91b('0x30')]['sort']);_0x49864c[_0xd91b('0x39')]=qs[_0xd91b('0x31')](_[_0xd91b('0x5d')](_0x3d8556['query'],_0x16454d[_0xd91b('0x31')]));_0x49864c['where'][_0xd91b('0x5b')]=_0x2658c1['id'];if(_0x3d8556[_0xd91b('0x30')][_0xd91b('0x59')]){_0x49864c[_0xd91b('0x39')]=_['merge'](_0x49864c[_0xd91b('0x39')],{'$or':_[_0xd91b('0x2b')](_0x49864c[_0xd91b('0x32')],function(_0x5cc5b5){var _0xd16f6d={};_0xd16f6d[_0x5cc5b5]={'$like':'%'+_0x3d8556[_0xd91b('0x30')][_0xd91b('0x59')]+'%'};return _0xd16f6d;})});}_0x49864c=_[_0xd91b('0x3a')]({},_0x49864c,_0x3d8556[_0xd91b('0x3c')]);return db[_0xd91b('0x62')][_0xd91b('0x3d')]({'where':_0x49864c[_0xd91b('0x39')]})['then'](function(_0x105583){_0x5ee71f[_0xd91b('0x3d')]=_0x105583;if(_0x3d8556[_0xd91b('0x30')][_0xd91b('0x3e')]){_0x49864c[_0xd91b('0x46')]=[{'all':!![]}];}return db['CmList']['findAll'](_0x49864c);})[_0xd91b('0x23')](function(_0x426ee8){_0x5ee71f['rows']=_0x426ee8;return _0x5ee71f;});}})[_0xd91b('0x23')](respondWithFilteredResult(_0x47fc8f,_0x49864c))[_0xd91b('0x41')](handleError(_0x47fc8f,null));};exports[_0xd91b('0x83')]=function(_0x234de6,_0x3de3f8,_0x1dad4c){var _0x45477e,_0x331f1a;return db['Campaign'][_0xd91b('0x47')]({'where':{'id':_0x234de6['params']['id']}})[_0xd91b('0x23')](handleEntityNotFound(_0x3de3f8,null))[_0xd91b('0x23')](function(_0x22d33a){if(_0x22d33a){_0x331f1a=_0x22d33a;return _0x22d33a[_0xd91b('0x83')](_0x234de6[_0xd91b('0x49')][_0xd91b('0x64')],_[_0xd91b('0x52')](_0x234de6[_0xd91b('0x49')],[_0xd91b('0x64'),'id'])||{});}return null;})[_0xd91b('0x65')](function(_0x3c3e88){var _0x30a0f6;_0x45477e=_0x3c3e88||[];var _0x568781=[];if(_0x3c3e88){for(var _0x38af55=0x0;_0x38af55<_0x3c3e88[_0xd91b('0x34')];_0x38af55+=0x1){var _0x161685=_0x3c3e88[_0x38af55][_0xd91b('0x25')]({'plain':!![]});_0x30a0f6=squel[_0xd91b('0x68')]()['into'](_0xd91b('0x84'))[_0xd91b('0x6a')]([_0xd91b('0x6b'),_0xd91b('0x6d'),_0xd91b('0x6e'),_0xd91b('0x5b'),_0xd91b('0x53'),_0xd91b('0x54')],squel[_0xd91b('0x6f')]()[_0xd91b('0x70')](_0xd91b('0x6b'),'phone')[_0xd91b('0x70')]('id','ContactId')[_0xd91b('0x70')](_0x161685[_0xd91b('0x71')]['toString'](),_0xd91b('0x6e'))[_0xd91b('0x70')](_0x234de6[_0xd91b('0x42')]['id'][_0xd91b('0x72')](),_0xd91b('0x5b'))[_0xd91b('0x70')](_0xd91b('0x73'),'createdAt')[_0xd91b('0x70')]('NOW()',_0xd91b('0x54'))[_0xd91b('0x78')]('cm_contacts')['where'](_0xd91b('0x75'))[_0xd91b('0x39')]('ListId\x20=\x20?',_0x161685[_0xd91b('0x71')]['toString']())[_0xd91b('0x39')](_0xd91b('0x7c')))['toString']();_0x568781[_0xd91b('0x7d')](db[_0xd91b('0x7e')]['query'](_0x30a0f6));}return BPromise[_0xd91b('0x7f')](_0x568781);}})[_0xd91b('0x23')](function(){return _0x45477e;})[_0xd91b('0x23')](respondWithResult(_0x3de3f8,null))[_0xd91b('0x41')](handleError(_0x3de3f8,null));};exports[_0xd91b('0x85')]=function(_0x1aef2e,_0x9f5466,_0x57b653){return db[_0xd91b('0x44')][_0xd91b('0x47')]({'where':{'id':_0x1aef2e[_0xd91b('0x42')]['id']}})['then'](handleEntityNotFound(_0x9f5466,null))['then'](function(_0x574c6f){if(_0x574c6f){return _0x574c6f['removeBlackLists'](_0x1aef2e[_0xd91b('0x30')][_0xd91b('0x64')]);}})[_0xd91b('0x23')](function(_0x48a5d3){if(_0x48a5d3){return db[_0xd91b('0x60')][_0xd91b('0x24')]({'where':{'ListId':_0x1aef2e[_0xd91b('0x30')][_0xd91b('0x64')],'CampaignId':_0x1aef2e[_0xd91b('0x42')]['id']}})[_0xd91b('0x23')](function(){return _0x48a5d3;});}})[_0xd91b('0x23')](respondWithStatusCode(_0x9f5466,null))['catch'](handleError(_0x9f5466,null));}; \ No newline at end of file +var _0x31e7=['CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','phone','ContactId','select','field','NOW()','CmListId','toString','ListId','from','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','fromQuery','scheduledAt','deletedAt\x20IS\x20NULL','into','push','sequelize','removeLists','getBlackLists','addBlackLists','insert','cm_hopper_black','all','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','set','json','apply','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','name','send','Campaign','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','options','create','body','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','autoAssociation','findOne','CmHopper','getHopperHistories','CmHopperHistory'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x31e7,0x1b0));var _0x731e=function(_0x16928e,_0x27e0b3){_0x16928e=_0x16928e-0x0;var _0x425b4f=_0x31e7[_0x16928e];return _0x425b4f;};'use strict';var pdf=require(_0x731e('0x0'));var emlformat=require(_0x731e('0x1'));var rimraf=require(_0x731e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x731e('0x3'));var rp=require(_0x731e('0x4'));var moment=require(_0x731e('0x5'));var BPromise=require(_0x731e('0x6'));var Mustache=require(_0x731e('0x7'));var util=require('util');var path=require(_0x731e('0x8'));var sox=require(_0x731e('0x9'));var csv=require(_0x731e('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x731e('0xb'));var squel=require('squel');var crypto=require(_0x731e('0xc'));var jsforce=require(_0x731e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x731e('0xa'));var querystring=require('querystring');var Papa=require(_0x731e('0xe'));var Redis=require(_0x731e('0xf'));var authService=require(_0x731e('0x10'));var qs=require(_0x731e('0x11'));var as=require(_0x731e('0x12'));var hardwareService=require(_0x731e('0x13'));var logger=require(_0x731e('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x731e('0x15'));var db=require(_0x731e('0x16'))['db'];function respondWithStatusCode(_0x15e981,_0x917eb9){_0x917eb9=_0x917eb9||0xcc;return function(_0x8d3c80){if(_0x8d3c80){return _0x15e981[_0x731e('0x17')](_0x917eb9);}return _0x15e981[_0x731e('0x18')](_0x917eb9)[_0x731e('0x19')]();};}function respondWithResult(_0x20f109,_0x4f680a){_0x4f680a=_0x4f680a||0xc8;return function(_0x108140){if(_0x108140){return _0x20f109[_0x731e('0x18')](_0x4f680a)['json'](_0x108140);}};}function respondWithFilteredResult(_0x50bf00,_0x7ff97f){return function(_0x57388f){if(_0x57388f){var _0x15d147=_0x57388f[_0x731e('0x1a')],_0xf41496=_0x7ff97f['offset'],_0x24ed60=_0x7ff97f['offset']+_0x7ff97f['limit'],_0x47da15;if(_0x24ed60>=_0x15d147){_0x24ed60=_0x15d147;_0x47da15=0xc8;}else{_0x47da15=0xce;}_0x50bf00[_0x731e('0x18')](_0x47da15);return _0x50bf00[_0x731e('0x1b')]('Content-Range',_0xf41496+'-'+_0x24ed60+'/'+_0x15d147)[_0x731e('0x1c')](_0x57388f);}return null;};}function patchUpdates(_0x3bc507){return function(_0x4e3219){try{jsonpatch[_0x731e('0x1d')](_0x4e3219,_0x3bc507,!![]);}catch(_0x178ec3){return BPromise[_0x731e('0x1e')](_0x178ec3);}return _0x4e3219['save']();};}function saveUpdates(_0x520445,_0x440c5d){return function(_0x355a64){if(_0x355a64){return _0x355a64[_0x731e('0x1f')](_0x520445)[_0x731e('0x20')](function(_0x36b910){return _0x36b910;});}return null;};}function removeEntity(_0x5c168e,_0x593ded){return function(_0x2a6140){if(_0x2a6140){return _0x2a6140['destroy']()['then'](function(){var _0x5aa3bf=_0x2a6140[_0x731e('0x21')]({'plain':!![]});var _0x23c484=_0x731e('0x22');return db[_0x731e('0x23')][_0x731e('0x24')]({'where':{'type':_0x23c484,'resourceId':_0x5aa3bf['id']}})['then'](function(){return _0x2a6140;});})[_0x731e('0x20')](function(){_0x5c168e[_0x731e('0x18')](0xcc)[_0x731e('0x19')]();});}};}function handleEntityNotFound(_0xf24d4e,_0x8984d1){return function(_0x701179){if(!_0x701179){_0xf24d4e[_0x731e('0x17')](0x194);}return _0x701179;};}function handleError(_0x12f9d2,_0x2cf5fc){_0x2cf5fc=_0x2cf5fc||0x1f4;return function(_0x54a02f){logger[_0x731e('0x25')](_0x54a02f['stack']);if(_0x54a02f[_0x731e('0x26')]){delete _0x54a02f[_0x731e('0x26')];}_0x12f9d2[_0x731e('0x18')](_0x2cf5fc)[_0x731e('0x27')](_0x54a02f);};}exports['index']=function(_0x1a7caf,_0x15a49a){var _0x24ed14={},_0x485cee={},_0x277327={'count':0x0,'rows':[]};var _0xb904b=_['map'](db[_0x731e('0x28')]['rawAttributes'],function(_0x5d30bc){return{'name':_0x5d30bc['fieldName'],'type':_0x5d30bc[_0x731e('0x29')][_0x731e('0x2a')]};});_0x485cee[_0x731e('0x2b')]=_[_0x731e('0x2c')](_0xb904b,'name');_0x485cee['query']=_['keys'](_0x1a7caf[_0x731e('0x2d')]);_0x485cee[_0x731e('0x2e')]=_['intersection'](_0x485cee[_0x731e('0x2b')],_0x485cee[_0x731e('0x2d')]);_0x24ed14[_0x731e('0x2f')]=_[_0x731e('0x30')](_0x485cee[_0x731e('0x2b')],qs[_0x731e('0x31')](_0x1a7caf[_0x731e('0x2d')]['fields']));_0x24ed14[_0x731e('0x2f')]=_0x24ed14[_0x731e('0x2f')][_0x731e('0x32')]?_0x24ed14['attributes']:_0x485cee[_0x731e('0x2b')];if(!_0x1a7caf['query'][_0x731e('0x33')](_0x731e('0x34'))){_0x24ed14['limit']=qs[_0x731e('0x35')](_0x1a7caf[_0x731e('0x2d')][_0x731e('0x35')]);_0x24ed14[_0x731e('0x36')]=qs[_0x731e('0x36')](_0x1a7caf[_0x731e('0x2d')]['offset']);}_0x24ed14[_0x731e('0x37')]=qs[_0x731e('0x38')](_0x1a7caf[_0x731e('0x2d')][_0x731e('0x38')]);_0x24ed14[_0x731e('0x39')]=qs[_0x731e('0x2e')](_[_0x731e('0x3a')](_0x1a7caf[_0x731e('0x2d')],_0x485cee[_0x731e('0x2e')]),_0xb904b);if(_0x1a7caf['query'][_0x731e('0x3b')]){_0x24ed14[_0x731e('0x39')]=_[_0x731e('0x3c')](_0x24ed14[_0x731e('0x39')],{'$or':_[_0x731e('0x2c')](_0xb904b,function(_0xd045c2){if(_0xd045c2[_0x731e('0x29')]!==_0x731e('0x3d')){var _0x4c623d={};_0x4c623d[_0xd045c2[_0x731e('0x26')]]={'$like':'%'+_0x1a7caf['query'][_0x731e('0x3b')]+'%'};return _0x4c623d;}})});}_0x24ed14=_[_0x731e('0x3c')]({},_0x24ed14,_0x1a7caf['options']);var _0x247993={'where':_0x24ed14[_0x731e('0x39')]};return db[_0x731e('0x28')][_0x731e('0x1a')](_0x247993)[_0x731e('0x20')](function(_0x5e7a89){_0x277327[_0x731e('0x1a')]=_0x5e7a89;if(_0x1a7caf[_0x731e('0x2d')][_0x731e('0x3e')]){_0x24ed14[_0x731e('0x3f')]=[{'all':!![]}];}return db[_0x731e('0x28')][_0x731e('0x40')](_0x24ed14);})['then'](function(_0x37e87f){_0x277327[_0x731e('0x41')]=_0x37e87f;return _0x277327;})[_0x731e('0x20')](respondWithFilteredResult(_0x15a49a,_0x24ed14))[_0x731e('0x42')](handleError(_0x15a49a,null));};exports[_0x731e('0x43')]=function(_0x15e861,_0x23863b){var _0x1c7be3={'raw':![],'where':{'id':_0x15e861[_0x731e('0x44')]['id']}},_0x55f15f={};_0x55f15f[_0x731e('0x2b')]=_[_0x731e('0x45')](db[_0x731e('0x28')][_0x731e('0x46')]);_0x55f15f[_0x731e('0x2d')]=_[_0x731e('0x45')](_0x15e861['query']);_0x55f15f['filters']=_[_0x731e('0x30')](_0x55f15f['model'],_0x55f15f[_0x731e('0x2d')]);_0x1c7be3[_0x731e('0x2f')]=_[_0x731e('0x30')](_0x55f15f[_0x731e('0x2b')],qs['fields'](_0x15e861[_0x731e('0x2d')][_0x731e('0x31')]));_0x1c7be3[_0x731e('0x2f')]=_0x1c7be3[_0x731e('0x2f')][_0x731e('0x32')]?_0x1c7be3[_0x731e('0x2f')]:_0x55f15f[_0x731e('0x2b')];if(_0x15e861[_0x731e('0x2d')][_0x731e('0x3e')]){_0x1c7be3[_0x731e('0x3f')]=[{'all':!![]}];}_0x1c7be3=_[_0x731e('0x3c')]({},_0x1c7be3,_0x15e861[_0x731e('0x47')]);return db[_0x731e('0x28')]['find'](_0x1c7be3)[_0x731e('0x20')](handleEntityNotFound(_0x23863b,null))[_0x731e('0x20')](respondWithResult(_0x23863b,null))[_0x731e('0x42')](handleError(_0x23863b,null));};exports['create']=function(_0x388441,_0x1705cd){return db[_0x731e('0x28')][_0x731e('0x48')](_0x388441[_0x731e('0x49')],{})[_0x731e('0x20')](function(_0x1cc447){var _0x55c4a6=_0x388441['user']['get']({'plain':!![]});if(!_0x55c4a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55c4a6[_0x731e('0x4a')]==='user'){var _0x55a048=_0x1cc447[_0x731e('0x21')]({'plain':!![]});var _0x1806b8=_0x731e('0x22');return db[_0x731e('0x4b')][_0x731e('0x4c')]({'where':{'name':_0x1806b8,'userProfileId':_0x55c4a6[_0x731e('0x4d')]},'raw':!![]})[_0x731e('0x20')](function(_0x5914aa){if(_0x5914aa&&_0x5914aa['autoAssociation']===0x0){return db[_0x731e('0x23')][_0x731e('0x48')]({'name':_0x55a048[_0x731e('0x26')],'resourceId':_0x55a048['id'],'type':_0x5914aa[_0x731e('0x26')],'sectionId':_0x5914aa['id']},{})[_0x731e('0x20')](function(){return _0x1cc447;});}else{return _0x1cc447;}})[_0x731e('0x42')](function(_0x233393){logger['error'](_0x731e('0x4e'),_0x233393);throw _0x233393;});}return _0x1cc447;})[_0x731e('0x20')](respondWithResult(_0x1705cd,0xc9))[_0x731e('0x42')](handleError(_0x1705cd,null));};exports[_0x731e('0x4f')]=function(_0x326156,_0x2707fc){var _0x51d550={'where':{'id':_0x326156['params']['id']}},_0x4542c0={};_0x4542c0[_0x731e('0x2b')]=_[_0x731e('0x45')](db[_0x731e('0x28')][_0x731e('0x46')]);_0x51d550[_0x731e('0x2f')]=_[_0x731e('0x30')](_0x4542c0[_0x731e('0x2b')],qs[_0x731e('0x31')](_0x326156[_0x731e('0x2d')]['fields']));_0x51d550[_0x731e('0x2f')]=_0x51d550['attributes'][_0x731e('0x32')]?_0x51d550[_0x731e('0x2f')]:_0x4542c0[_0x731e('0x2b')];if(_0x326156['query'][_0x731e('0x3e')]){_0x51d550[_0x731e('0x3f')]=[{'all':!![]}];}_0x51d550=_[_0x731e('0x3c')]({},_0x51d550,_0x326156[_0x731e('0x47')]);return db[_0x731e('0x28')][_0x731e('0x4c')](_0x51d550)[_0x731e('0x20')](handleEntityNotFound(_0x2707fc,null))[_0x731e('0x20')](function(_0x10c8cf){if(_0x10c8cf){var _0x23a43c=_0x10c8cf[_0x731e('0x21')]({'plain':!![]});_0x23a43c=qs[_0x731e('0x50')](_0x23a43c,['id','createdAt',_0x731e('0x51')]);_0x326156[_0x731e('0x49')]=_[_0x731e('0x50')](_0x326156['body'],['id',_0x731e('0x52'),_0x731e('0x51')]);return db['Campaign']['create'](_[_0x731e('0x3c')](_0x23a43c,_0x326156[_0x731e('0x49')]),{'include':_0x326156[_0x731e('0x2d')][_0x731e('0x3e')]?[{'all':!![]}]:undefined})[_0x731e('0x20')](function(_0x38dabb){var _0x593978=_0x326156['user'][_0x731e('0x21')]({'plain':!![]});if(!_0x593978)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x593978[_0x731e('0x4a')]==='user'){var _0x3f7cc9=_0x38dabb[_0x731e('0x21')]({'plain':!![]});var _0x4bde90=_0x731e('0x22');return db[_0x731e('0x4b')]['find']({'where':{'name':_0x4bde90,'userProfileId':_0x593978[_0x731e('0x4d')]},'raw':!![]})[_0x731e('0x20')](function(_0x443ce3){if(_0x443ce3&&_0x443ce3[_0x731e('0x53')]===0x0){return db[_0x731e('0x23')]['create']({'name':_0x3f7cc9[_0x731e('0x26')],'resourceId':_0x3f7cc9['id'],'type':_0x443ce3[_0x731e('0x26')],'sectionId':_0x443ce3['id']},{})[_0x731e('0x20')](function(){return _0x38dabb;});}else{return _0x38dabb;}})[_0x731e('0x42')](function(_0x41c697){logger[_0x731e('0x25')](_0x731e('0x4e'),_0x41c697);throw _0x41c697;});}return _0x38dabb;});}})['then'](respondWithResult(_0x2707fc,0xc9))[_0x731e('0x42')](handleError(_0x2707fc,null));};exports[_0x731e('0x1f')]=function(_0x209b9c,_0x123ab4){if(_0x209b9c[_0x731e('0x49')]['id']){delete _0x209b9c[_0x731e('0x49')]['id'];}return db['Campaign'][_0x731e('0x4c')]({'where':{'id':_0x209b9c[_0x731e('0x44')]['id']}})[_0x731e('0x20')](handleEntityNotFound(_0x123ab4,null))[_0x731e('0x20')](saveUpdates(_0x209b9c[_0x731e('0x49')],null))[_0x731e('0x20')](respondWithResult(_0x123ab4,null))['catch'](handleError(_0x123ab4,null));};exports[_0x731e('0x24')]=function(_0x53dde3,_0x179b10){return db[_0x731e('0x28')][_0x731e('0x4c')]({'where':{'id':_0x53dde3[_0x731e('0x44')]['id']}})[_0x731e('0x20')](handleEntityNotFound(_0x179b10,null))[_0x731e('0x20')](removeEntity(_0x179b10,null))['catch'](handleError(_0x179b10,null));};exports['getHoppers']=function(_0x4efdd0,_0x8b0470,_0x38e650){var _0x140a29={'raw':!![],'where':{}};var _0x66f743={};var _0x1798ec={'count':0x0,'rows':[]};return db['Campaign'][_0x731e('0x54')]({'where':{'id':_0x4efdd0[_0x731e('0x44')]['id']}})[_0x731e('0x20')](handleEntityNotFound(_0x8b0470,null))[_0x731e('0x20')](function(_0x586425){if(_0x586425){_0x66f743['model']=_[_0x731e('0x45')](db[_0x731e('0x55')][_0x731e('0x46')]);_0x66f743['query']=_[_0x731e('0x45')](_0x4efdd0[_0x731e('0x2d')]);_0x66f743[_0x731e('0x2e')]=_[_0x731e('0x30')](_0x66f743[_0x731e('0x2b')],_0x66f743[_0x731e('0x2d')]);_0x140a29[_0x731e('0x2f')]=_[_0x731e('0x30')](_0x66f743[_0x731e('0x2b')],qs[_0x731e('0x31')](_0x4efdd0[_0x731e('0x2d')]['fields']));_0x140a29[_0x731e('0x2f')]=_0x140a29[_0x731e('0x2f')][_0x731e('0x32')]?_0x140a29[_0x731e('0x2f')]:_0x66f743[_0x731e('0x2b')];if(!_0x4efdd0[_0x731e('0x2d')][_0x731e('0x33')](_0x731e('0x34'))){_0x140a29['limit']=qs[_0x731e('0x35')](_0x4efdd0[_0x731e('0x2d')][_0x731e('0x35')]);_0x140a29[_0x731e('0x36')]=qs[_0x731e('0x36')](_0x4efdd0[_0x731e('0x2d')][_0x731e('0x36')]);}_0x140a29['order']=qs['sort'](_0x4efdd0['query'][_0x731e('0x38')]);_0x140a29[_0x731e('0x39')]=qs[_0x731e('0x2e')](_[_0x731e('0x3a')](_0x4efdd0[_0x731e('0x2d')],_0x66f743[_0x731e('0x2e')]));_0x140a29[_0x731e('0x39')]['CampaignId']=_0x586425['id'];if(_0x4efdd0[_0x731e('0x2d')][_0x731e('0x3b')]){_0x140a29[_0x731e('0x39')]=_[_0x731e('0x3c')](_0x140a29[_0x731e('0x39')],{'$or':_[_0x731e('0x2c')](_0x140a29[_0x731e('0x2f')],function(_0x49da07){var _0x58eb50={};_0x58eb50[_0x49da07]={'$like':'%'+_0x4efdd0['query'][_0x731e('0x3b')]+'%'};return _0x58eb50;})});}_0x140a29=_['merge']({},_0x140a29,_0x4efdd0[_0x731e('0x47')]);return db[_0x731e('0x55')]['count']({'where':_0x140a29[_0x731e('0x39')]})[_0x731e('0x20')](function(_0x24c212){_0x1798ec[_0x731e('0x1a')]=_0x24c212;if(_0x4efdd0[_0x731e('0x2d')]['includeAll']){_0x140a29['include']=[{'all':!![]}];}return db[_0x731e('0x55')][_0x731e('0x40')](_0x140a29);})[_0x731e('0x20')](function(_0x2e1153){_0x1798ec[_0x731e('0x41')]=_0x2e1153;return _0x1798ec;});}})[_0x731e('0x20')](respondWithFilteredResult(_0x8b0470,_0x140a29))[_0x731e('0x42')](handleError(_0x8b0470,null));};exports[_0x731e('0x56')]=function(_0x212ae4,_0x5d8a03,_0x47a2a8){var _0x165d1c={'raw':!![],'where':{}};var _0x305421={};var _0x14b898={'count':0x0,'rows':[]};return db[_0x731e('0x28')][_0x731e('0x54')]({'where':{'id':_0x212ae4[_0x731e('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d8a03,null))[_0x731e('0x20')](function(_0x221285){if(_0x221285){_0x305421['model']=_[_0x731e('0x45')](db[_0x731e('0x57')]['rawAttributes']);_0x305421[_0x731e('0x2d')]=_[_0x731e('0x45')](_0x212ae4[_0x731e('0x2d')]);_0x305421[_0x731e('0x2e')]=_[_0x731e('0x30')](_0x305421[_0x731e('0x2b')],_0x305421[_0x731e('0x2d')]);_0x165d1c[_0x731e('0x2f')]=_[_0x731e('0x30')](_0x305421['model'],qs['fields'](_0x212ae4[_0x731e('0x2d')][_0x731e('0x31')]));_0x165d1c[_0x731e('0x2f')]=_0x165d1c[_0x731e('0x2f')][_0x731e('0x32')]?_0x165d1c[_0x731e('0x2f')]:_0x305421[_0x731e('0x2b')];if(!_0x212ae4[_0x731e('0x2d')][_0x731e('0x33')]('nolimit')){_0x165d1c[_0x731e('0x35')]=qs[_0x731e('0x35')](_0x212ae4[_0x731e('0x2d')][_0x731e('0x35')]);_0x165d1c[_0x731e('0x36')]=qs['offset'](_0x212ae4[_0x731e('0x2d')][_0x731e('0x36')]);}_0x165d1c[_0x731e('0x37')]=qs[_0x731e('0x38')](_0x212ae4[_0x731e('0x2d')][_0x731e('0x38')]);_0x165d1c[_0x731e('0x39')]=qs[_0x731e('0x2e')](_['pick'](_0x212ae4[_0x731e('0x2d')],_0x305421['filters']));_0x165d1c[_0x731e('0x39')][_0x731e('0x58')]=_0x221285['id'];if(_0x212ae4[_0x731e('0x2d')][_0x731e('0x3b')]){_0x165d1c[_0x731e('0x39')]=_[_0x731e('0x3c')](_0x165d1c['where'],{'$or':_[_0x731e('0x2c')](_0x165d1c[_0x731e('0x2f')],function(_0x15572f){var _0x15dd6d={};_0x15dd6d[_0x15572f]={'$like':'%'+_0x212ae4[_0x731e('0x2d')]['filter']+'%'};return _0x15dd6d;})});}_0x165d1c=_['merge']({},_0x165d1c,_0x212ae4['options']);return db[_0x731e('0x57')][_0x731e('0x1a')]({'where':_0x165d1c[_0x731e('0x39')]})[_0x731e('0x20')](function(_0x17b8bc){_0x14b898[_0x731e('0x1a')]=_0x17b8bc;if(_0x212ae4[_0x731e('0x2d')][_0x731e('0x3e')]){_0x165d1c[_0x731e('0x3f')]=[{'all':!![]}];}return db[_0x731e('0x57')][_0x731e('0x40')](_0x165d1c);})[_0x731e('0x20')](function(_0x112515){_0x14b898['rows']=_0x112515;return _0x14b898;});}})['then'](respondWithFilteredResult(_0x5d8a03,_0x165d1c))['catch'](handleError(_0x5d8a03,null));};exports[_0x731e('0x59')]=function(_0x27b0d3,_0x3f696b,_0x5ca33d){var _0x34b25d={'raw':!![],'where':{}};var _0x468fb2={};var _0x410d1a={'count':0x0,'rows':[]};return db['Campaign'][_0x731e('0x54')]({'where':{'id':_0x27b0d3[_0x731e('0x44')]['id']}})[_0x731e('0x20')](handleEntityNotFound(_0x3f696b,null))[_0x731e('0x20')](function(_0x39a8b5){if(_0x39a8b5){_0x468fb2[_0x731e('0x2b')]=_[_0x731e('0x45')](db['CmHopperFinal'][_0x731e('0x46')]);_0x468fb2['query']=_[_0x731e('0x45')](_0x27b0d3['query']);_0x468fb2[_0x731e('0x2e')]=_[_0x731e('0x30')](_0x468fb2[_0x731e('0x2b')],_0x468fb2[_0x731e('0x2d')]);_0x34b25d[_0x731e('0x2f')]=_[_0x731e('0x30')](_0x468fb2['model'],qs['fields'](_0x27b0d3[_0x731e('0x2d')][_0x731e('0x31')]));_0x34b25d[_0x731e('0x2f')]=_0x34b25d[_0x731e('0x2f')][_0x731e('0x32')]?_0x34b25d[_0x731e('0x2f')]:_0x468fb2[_0x731e('0x2b')];if(!_0x27b0d3[_0x731e('0x2d')][_0x731e('0x33')](_0x731e('0x34'))){_0x34b25d[_0x731e('0x35')]=qs[_0x731e('0x35')](_0x27b0d3[_0x731e('0x2d')][_0x731e('0x35')]);_0x34b25d[_0x731e('0x36')]=qs['offset'](_0x27b0d3[_0x731e('0x2d')][_0x731e('0x36')]);}_0x34b25d[_0x731e('0x37')]=qs[_0x731e('0x38')](_0x27b0d3['query'][_0x731e('0x38')]);_0x34b25d['where']=qs[_0x731e('0x2e')](_['pick'](_0x27b0d3[_0x731e('0x2d')],_0x468fb2[_0x731e('0x2e')]));_0x34b25d['where']['CampaignId']=_0x39a8b5['id'];if(_0x27b0d3[_0x731e('0x2d')][_0x731e('0x3b')]){_0x34b25d[_0x731e('0x39')]=_['merge'](_0x34b25d[_0x731e('0x39')],{'$or':_[_0x731e('0x2c')](_0x34b25d[_0x731e('0x2f')],function(_0x1f835a){var _0x214c73={};_0x214c73[_0x1f835a]={'$like':'%'+_0x27b0d3['query'][_0x731e('0x3b')]+'%'};return _0x214c73;})});}_0x34b25d=_['merge']({},_0x34b25d,_0x27b0d3['options']);return db[_0x731e('0x5a')]['count']({'where':_0x34b25d[_0x731e('0x39')]})['then'](function(_0x338b2f){_0x410d1a[_0x731e('0x1a')]=_0x338b2f;if(_0x27b0d3[_0x731e('0x2d')][_0x731e('0x3e')]){_0x34b25d['include']=[{'all':!![]}];}return db[_0x731e('0x5a')][_0x731e('0x40')](_0x34b25d);})['then'](function(_0x279f24){_0x410d1a[_0x731e('0x41')]=_0x279f24;return _0x410d1a;});}})[_0x731e('0x20')](respondWithFilteredResult(_0x3f696b,_0x34b25d))[_0x731e('0x42')](handleError(_0x3f696b,null));};exports['getHopperBlacks']=function(_0x6656aa,_0x20e027,_0x2627eb){var _0x484390={'raw':!![],'where':{}};var _0x348780={};var _0x1f701b={'count':0x0,'rows':[]};return db[_0x731e('0x28')][_0x731e('0x54')]({'where':{'id':_0x6656aa[_0x731e('0x44')]['id']}})[_0x731e('0x20')](handleEntityNotFound(_0x20e027,null))[_0x731e('0x20')](function(_0xadd672){if(_0xadd672){_0x348780[_0x731e('0x2b')]=_['keys'](db[_0x731e('0x5b')]['rawAttributes']);_0x348780[_0x731e('0x2d')]=_[_0x731e('0x45')](_0x6656aa[_0x731e('0x2d')]);_0x348780[_0x731e('0x2e')]=_[_0x731e('0x30')](_0x348780[_0x731e('0x2b')],_0x348780[_0x731e('0x2d')]);_0x484390[_0x731e('0x2f')]=_[_0x731e('0x30')](_0x348780[_0x731e('0x2b')],qs['fields'](_0x6656aa[_0x731e('0x2d')][_0x731e('0x31')]));_0x484390['attributes']=_0x484390[_0x731e('0x2f')][_0x731e('0x32')]?_0x484390['attributes']:_0x348780[_0x731e('0x2b')];if(!_0x6656aa[_0x731e('0x2d')][_0x731e('0x33')](_0x731e('0x34'))){_0x484390[_0x731e('0x35')]=qs['limit'](_0x6656aa['query']['limit']);_0x484390[_0x731e('0x36')]=qs[_0x731e('0x36')](_0x6656aa['query'][_0x731e('0x36')]);}_0x484390[_0x731e('0x37')]=qs[_0x731e('0x38')](_0x6656aa[_0x731e('0x2d')][_0x731e('0x38')]);_0x484390['where']=qs['filters'](_[_0x731e('0x3a')](_0x6656aa['query'],_0x348780[_0x731e('0x2e')]));_0x484390[_0x731e('0x39')][_0x731e('0x58')]=_0xadd672['id'];if(_0x6656aa['query'][_0x731e('0x3b')]){_0x484390['where']=_['merge'](_0x484390[_0x731e('0x39')],{'$or':_['map'](_0x484390[_0x731e('0x2f')],function(_0x3b00a5){var _0x544f91={};_0x544f91[_0x3b00a5]={'$like':'%'+_0x6656aa[_0x731e('0x2d')][_0x731e('0x3b')]+'%'};return _0x544f91;})});}_0x484390=_[_0x731e('0x3c')]({},_0x484390,_0x6656aa['options']);return db[_0x731e('0x5b')][_0x731e('0x1a')]({'where':_0x484390['where']})['then'](function(_0x30703d){_0x1f701b['count']=_0x30703d;if(_0x6656aa[_0x731e('0x2d')][_0x731e('0x3e')]){_0x484390[_0x731e('0x3f')]=[{'all':!![]}];}return db[_0x731e('0x5b')][_0x731e('0x40')](_0x484390);})[_0x731e('0x20')](function(_0x12a402){_0x1f701b[_0x731e('0x41')]=_0x12a402;return _0x1f701b;});}})[_0x731e('0x20')](respondWithFilteredResult(_0x20e027,_0x484390))[_0x731e('0x42')](handleError(_0x20e027,null));};exports[_0x731e('0x5c')]=function(_0x9644c7,_0x403e04,_0x55a9fc){var _0x29a362={};var _0x340b5b={};var _0x210da7;var _0x3294fe;return db[_0x731e('0x28')][_0x731e('0x54')]({'where':{'id':_0x9644c7['params']['id']}})[_0x731e('0x20')](handleEntityNotFound(_0x403e04,null))['then'](function(_0x4c11cd){if(_0x4c11cd){_0x210da7=_0x4c11cd;_0x340b5b[_0x731e('0x2b')]=_[_0x731e('0x45')](db[_0x731e('0x5d')]['rawAttributes']);_0x340b5b[_0x731e('0x2d')]=_[_0x731e('0x45')](_0x9644c7['query']);_0x340b5b['filters']=_['intersection'](_0x340b5b[_0x731e('0x2b')],_0x340b5b[_0x731e('0x2d')]);_0x29a362[_0x731e('0x2f')]=_['intersection'](_0x340b5b[_0x731e('0x2b')],qs[_0x731e('0x31')](_0x9644c7[_0x731e('0x2d')][_0x731e('0x31')]));_0x29a362[_0x731e('0x2f')]=_0x29a362[_0x731e('0x2f')][_0x731e('0x32')]?_0x29a362[_0x731e('0x2f')]:_0x340b5b[_0x731e('0x2b')];_0x29a362['order']=qs[_0x731e('0x38')](_0x9644c7['query'][_0x731e('0x38')]);_0x29a362['where']=qs['filters'](_[_0x731e('0x3a')](_0x9644c7[_0x731e('0x2d')],_0x340b5b[_0x731e('0x2e')]));if(_0x9644c7['query'][_0x731e('0x3b')]){_0x29a362['where']=_[_0x731e('0x3c')](_0x29a362['where'],{'$or':_[_0x731e('0x2c')](_0x29a362[_0x731e('0x2f')],function(_0x70ed7){var _0x19e124={};_0x19e124[_0x70ed7]={'$like':'%'+_0x9644c7[_0x731e('0x2d')]['filter']+'%'};return _0x19e124;})});}_0x29a362=_[_0x731e('0x3c')]({},_0x29a362,_0x9644c7[_0x731e('0x47')]);return _0x210da7[_0x731e('0x5c')](_0x29a362);}})['then'](function(_0x2023e6){if(_0x2023e6){_0x3294fe=_0x2023e6['length'];if(!_0x9644c7['query'][_0x731e('0x33')](_0x731e('0x34'))){_0x29a362[_0x731e('0x35')]=qs[_0x731e('0x35')](_0x9644c7['query'][_0x731e('0x35')]);_0x29a362[_0x731e('0x36')]=qs[_0x731e('0x36')](_0x9644c7[_0x731e('0x2d')][_0x731e('0x36')]);}return _0x210da7['getLists'](_0x29a362);}})[_0x731e('0x20')](function(_0x301373){if(_0x301373){return _0x301373?{'count':_0x3294fe,'rows':_0x301373}:null;}})[_0x731e('0x20')](respondWithResult(_0x403e04,null))[_0x731e('0x42')](handleError(_0x403e04,null));};exports[_0x731e('0x5e')]=function(_0x1af214,_0x4ec26f,_0x4609f0){var _0x128667,_0x349e9f;return db[_0x731e('0x28')][_0x731e('0x4c')]({'where':{'id':_0x1af214[_0x731e('0x44')]['id']}})[_0x731e('0x20')](handleEntityNotFound(_0x4ec26f,null))[_0x731e('0x20')](function(_0x7fb957){if(_0x7fb957){_0x349e9f=_0x7fb957;return _0x7fb957[_0x731e('0x5e')](_0x1af214[_0x731e('0x49')][_0x731e('0x5f')],_['omit'](_0x1af214[_0x731e('0x49')],[_0x731e('0x5f'),'id'])||{});}return null;})[_0x731e('0x60')](function(_0x1af77b){var _0x3e68b5;_0x128667=_0x1af77b||[];var _0x20d1e8=[];if(_0x1af77b){for(var _0x511460=0x0;_0x511460<_0x1af77b[_0x731e('0x32')];_0x511460+=0x1){var _0x4b5b87=_0x1af77b[_0x511460][_0x731e('0x21')]({'plain':!![]});_0x349e9f[_0x731e('0x61')]=_0x1af214['body']['dialCheckDuplicateType']?_0x1af214[_0x731e('0x49')][_0x731e('0x61')]:_0x349e9f[_0x731e('0x61')];switch(_0x349e9f['dialCheckDuplicateType']){case'always':_0x3e68b5=squel['insert']()['into']('cm_hopper')['fromQuery']([_0x731e('0x62'),'scheduledAt',_0x731e('0x63'),'ListId','CampaignId',_0x731e('0x52'),_0x731e('0x51')],squel[_0x731e('0x64')]()[_0x731e('0x65')](_0x731e('0x62'),_0x731e('0x62'))[_0x731e('0x65')](_0x731e('0x66'),'scheduledAt')[_0x731e('0x65')]('id','ContactId')['field'](_0x4b5b87[_0x731e('0x67')][_0x731e('0x68')](),_0x731e('0x69'))[_0x731e('0x65')](_0x1af214[_0x731e('0x44')]['id']['toString'](),_0x731e('0x58'))[_0x731e('0x65')](_0x731e('0x66'),_0x731e('0x52'))[_0x731e('0x65')](_0x731e('0x66'),'updatedAt')[_0x731e('0x6a')](_0x731e('0x6b'))[_0x731e('0x39')]('deletedAt\x20IS\x20NULL')[_0x731e('0x39')](_0x731e('0x6c'),_0x4b5b87[_0x731e('0x67')][_0x731e('0x68')]())[_0x731e('0x39')](_0x731e('0x6d'))[_0x731e('0x39')](_0x731e('0x6e'),squel[_0x731e('0x64')]()[_0x731e('0x65')](_0x731e('0x6f'))[_0x731e('0x6a')](_0x731e('0x70'))[_0x731e('0x39')](_0x731e('0x71'),_0x1af214[_0x731e('0x44')]['id']['toString']()))[_0x731e('0x39')](_0x731e('0x6e'),squel[_0x731e('0x64')]()[_0x731e('0x65')](_0x731e('0x72'))['from'](_0x731e('0x73'))['where'](_0x731e('0x71'),_0x1af214['params']['id'][_0x731e('0x68')]())))[_0x731e('0x68')]();break;case _0x731e('0x74'):_0x3e68b5=squel['insert']()['into'](_0x731e('0x73'))[_0x731e('0x75')]([_0x731e('0x62'),_0x731e('0x76'),'ContactId',_0x731e('0x69'),'CampaignId',_0x731e('0x52'),'updatedAt'],squel[_0x731e('0x64')]()[_0x731e('0x65')]('phone',_0x731e('0x62'))[_0x731e('0x65')](_0x731e('0x66'),_0x731e('0x76'))[_0x731e('0x65')]('id',_0x731e('0x63'))[_0x731e('0x65')](_0x4b5b87['CmListId'][_0x731e('0x68')](),_0x731e('0x69'))['field'](_0x1af214[_0x731e('0x44')]['id'][_0x731e('0x68')](),_0x731e('0x58'))[_0x731e('0x65')](_0x731e('0x66'),_0x731e('0x52'))[_0x731e('0x65')](_0x731e('0x66'),_0x731e('0x51'))['from'](_0x731e('0x6b'))[_0x731e('0x39')](_0x731e('0x77'))[_0x731e('0x39')](_0x731e('0x6c'),_0x4b5b87[_0x731e('0x67')][_0x731e('0x68')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0x731e('0x39')](_0x731e('0x6e'),squel[_0x731e('0x64')]()[_0x731e('0x65')](_0x731e('0x72'))[_0x731e('0x6a')]('cm_hopper')[_0x731e('0x39')](_0x731e('0x71'),_0x1af214[_0x731e('0x44')]['id'][_0x731e('0x68')]())))['toString']();break;default:_0x3e68b5=squel['insert']()[_0x731e('0x78')]('cm_hopper')[_0x731e('0x75')]([_0x731e('0x62'),_0x731e('0x76'),_0x731e('0x63'),_0x731e('0x69'),_0x731e('0x58'),_0x731e('0x52'),'updatedAt'],squel['select']()[_0x731e('0x65')](_0x731e('0x62'),_0x731e('0x62'))[_0x731e('0x65')](_0x731e('0x66'),_0x731e('0x76'))[_0x731e('0x65')]('id',_0x731e('0x63'))[_0x731e('0x65')](_0x4b5b87[_0x731e('0x67')]['toString'](),_0x731e('0x69'))[_0x731e('0x65')](_0x1af214['params']['id'][_0x731e('0x68')](),'CampaignId')[_0x731e('0x65')](_0x731e('0x66'),'createdAt')[_0x731e('0x65')](_0x731e('0x66'),_0x731e('0x51'))[_0x731e('0x6a')](_0x731e('0x6b'))[_0x731e('0x39')](_0x731e('0x77'))['where']('ListId\x20=\x20?',_0x4b5b87['CmListId'][_0x731e('0x68')]())[_0x731e('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0x731e('0x68')]();}_0x20d1e8[_0x731e('0x79')](db[_0x731e('0x7a')][_0x731e('0x2d')](_0x3e68b5));}return BPromise['all'](_0x20d1e8);}})[_0x731e('0x20')](function(){return _0x128667;})[_0x731e('0x20')](respondWithResult(_0x4ec26f,null))[_0x731e('0x42')](handleError(_0x4ec26f,null));};exports[_0x731e('0x7b')]=function(_0x1c964c,_0x30ec00,_0x1a2134){return db[_0x731e('0x28')][_0x731e('0x4c')]({'where':{'id':_0x1c964c[_0x731e('0x44')]['id']}})[_0x731e('0x20')](handleEntityNotFound(_0x30ec00,null))['then'](function(_0xb2ae63){if(_0xb2ae63){return _0xb2ae63['removeLists'](_0x1c964c[_0x731e('0x2d')][_0x731e('0x5f')]);}})['then'](function(_0x79cf){if(_0x79cf){return db[_0x731e('0x55')][_0x731e('0x24')]({'where':{'ListId':_0x1c964c[_0x731e('0x2d')][_0x731e('0x5f')],'CampaignId':_0x1c964c['params']['id']}})['then'](function(){return _0x79cf;});}})['then'](respondWithStatusCode(_0x30ec00,null))['catch'](handleError(_0x30ec00,null));};exports[_0x731e('0x7c')]=function(_0x29fd9d,_0x591c72,_0x4c313f){var _0x137dba={'raw':!![],'where':{}};var _0xd8050b={};var _0x202056={'count':0x0,'rows':[]};return db[_0x731e('0x28')][_0x731e('0x54')]({'where':{'id':_0x29fd9d[_0x731e('0x44')]['id']}})[_0x731e('0x20')](handleEntityNotFound(_0x591c72,null))[_0x731e('0x20')](function(_0x2f69e4){if(_0x2f69e4){_0xd8050b['model']=_[_0x731e('0x45')](db[_0x731e('0x5d')][_0x731e('0x46')]);_0xd8050b['query']=_['keys'](_0x29fd9d['query']);_0xd8050b[_0x731e('0x2e')]=_[_0x731e('0x30')](_0xd8050b[_0x731e('0x2b')],_0xd8050b[_0x731e('0x2d')]);_0x137dba[_0x731e('0x2f')]=_[_0x731e('0x30')](_0xd8050b['model'],qs[_0x731e('0x31')](_0x29fd9d[_0x731e('0x2d')][_0x731e('0x31')]));_0x137dba[_0x731e('0x2f')]=_0x137dba[_0x731e('0x2f')]['length']?_0x137dba[_0x731e('0x2f')]:_0xd8050b[_0x731e('0x2b')];if(!_0x29fd9d[_0x731e('0x2d')][_0x731e('0x33')](_0x731e('0x34'))){_0x137dba[_0x731e('0x35')]=qs[_0x731e('0x35')](_0x29fd9d[_0x731e('0x2d')][_0x731e('0x35')]);_0x137dba['offset']=qs[_0x731e('0x36')](_0x29fd9d[_0x731e('0x2d')][_0x731e('0x36')]);}_0x137dba[_0x731e('0x37')]=qs[_0x731e('0x38')](_0x29fd9d[_0x731e('0x2d')][_0x731e('0x38')]);_0x137dba[_0x731e('0x39')]=qs['filters'](_['pick'](_0x29fd9d['query'],_0xd8050b[_0x731e('0x2e')]));_0x137dba[_0x731e('0x39')][_0x731e('0x58')]=_0x2f69e4['id'];if(_0x29fd9d[_0x731e('0x2d')][_0x731e('0x3b')]){_0x137dba[_0x731e('0x39')]=_[_0x731e('0x3c')](_0x137dba[_0x731e('0x39')],{'$or':_[_0x731e('0x2c')](_0x137dba[_0x731e('0x2f')],function(_0x57a7b4){var _0xddfc11={};_0xddfc11[_0x57a7b4]={'$like':'%'+_0x29fd9d['query']['filter']+'%'};return _0xddfc11;})});}_0x137dba=_[_0x731e('0x3c')]({},_0x137dba,_0x29fd9d[_0x731e('0x47')]);return db['CmList'][_0x731e('0x1a')]({'where':_0x137dba['where']})['then'](function(_0x3b0e33){_0x202056[_0x731e('0x1a')]=_0x3b0e33;if(_0x29fd9d[_0x731e('0x2d')][_0x731e('0x3e')]){_0x137dba['include']=[{'all':!![]}];}return db[_0x731e('0x5d')][_0x731e('0x40')](_0x137dba);})['then'](function(_0x5211aa){_0x202056['rows']=_0x5211aa;return _0x202056;});}})[_0x731e('0x20')](respondWithFilteredResult(_0x591c72,_0x137dba))[_0x731e('0x42')](handleError(_0x591c72,null));};exports[_0x731e('0x7d')]=function(_0xa22aac,_0x5b0752,_0x2d0428){var _0x37a15b,_0x746422;return db[_0x731e('0x28')]['find']({'where':{'id':_0xa22aac['params']['id']}})['then'](handleEntityNotFound(_0x5b0752,null))[_0x731e('0x20')](function(_0x152197){if(_0x152197){_0x746422=_0x152197;return _0x152197['addBlackLists'](_0xa22aac[_0x731e('0x49')][_0x731e('0x5f')],_[_0x731e('0x50')](_0xa22aac[_0x731e('0x49')],[_0x731e('0x5f'),'id'])||{});}return null;})[_0x731e('0x60')](function(_0x27508f){var _0x5744cd;_0x37a15b=_0x27508f||[];var _0x122a22=[];if(_0x27508f){for(var _0xf8016e=0x0;_0xf8016e<_0x27508f[_0x731e('0x32')];_0xf8016e+=0x1){var _0x3d05cf=_0x27508f[_0xf8016e][_0x731e('0x21')]({'plain':!![]});_0x5744cd=squel[_0x731e('0x7e')]()['into'](_0x731e('0x7f'))[_0x731e('0x75')]([_0x731e('0x62'),_0x731e('0x63'),'ListId','CampaignId',_0x731e('0x52'),'updatedAt'],squel[_0x731e('0x64')]()[_0x731e('0x65')](_0x731e('0x62'),_0x731e('0x62'))[_0x731e('0x65')]('id',_0x731e('0x63'))[_0x731e('0x65')](_0x3d05cf[_0x731e('0x67')][_0x731e('0x68')](),_0x731e('0x69'))[_0x731e('0x65')](_0xa22aac[_0x731e('0x44')]['id'][_0x731e('0x68')](),'CampaignId')['field'](_0x731e('0x66'),_0x731e('0x52'))[_0x731e('0x65')](_0x731e('0x66'),'updatedAt')[_0x731e('0x6a')]('cm_contacts')[_0x731e('0x39')](_0x731e('0x77'))[_0x731e('0x39')]('ListId\x20=\x20?',_0x3d05cf[_0x731e('0x67')][_0x731e('0x68')]())[_0x731e('0x39')](_0x731e('0x6d')))[_0x731e('0x68')]();_0x122a22[_0x731e('0x79')](db['sequelize'][_0x731e('0x2d')](_0x5744cd));}return BPromise[_0x731e('0x80')](_0x122a22);}})[_0x731e('0x20')](function(){return _0x37a15b;})[_0x731e('0x20')](respondWithResult(_0x5b0752,null))['catch'](handleError(_0x5b0752,null));};exports['removeBlackLists']=function(_0xe3970c,_0xde183,_0x2ee0af){return db[_0x731e('0x28')][_0x731e('0x4c')]({'where':{'id':_0xe3970c[_0x731e('0x44')]['id']}})['then'](handleEntityNotFound(_0xde183,null))[_0x731e('0x20')](function(_0x586c0c){if(_0x586c0c){return _0x586c0c[_0x731e('0x81')](_0xe3970c[_0x731e('0x2d')][_0x731e('0x5f')]);}})[_0x731e('0x20')](function(_0x1fc1c0){if(_0x1fc1c0){return db[_0x731e('0x5b')][_0x731e('0x24')]({'where':{'ListId':_0xe3970c[_0x731e('0x2d')][_0x731e('0x5f')],'CampaignId':_0xe3970c[_0x731e('0x44')]['id']}})['then'](function(){return _0x1fc1c0;});}})[_0x731e('0x20')](respondWithStatusCode(_0xde183,null))[_0x731e('0x42')](handleError(_0xde183,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 065798d..6feff0f 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 _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','define','campaigns','lodash','../../config/logger'];(function(_0x3b2c6f,_0xa9f35c){var _0x22e219=function(_0x3ee04c){while(--_0x3ee04c){_0x3b2c6f['push'](_0x3b2c6f['shift']());}};_0x22e219(++_0xa9f35c);}(_0xb10b,0x12a));var _0xbb10=function(_0x175d1e,_0x48ad7e){_0x175d1e=_0x175d1e-0x0;var _0x10aefc=_0xb10b[_0x175d1e];return _0x10aefc;};'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')]('Campaign',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','define','campaigns','lodash','../../config/logger'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0xb10b,0x12a));var _0xbb10=function(_0x50c7d6,_0x43aaed){_0x50c7d6=_0x50c7d6-0x0;var _0x4e1b11=_0xb10b[_0x50c7d6];return _0x4e1b11;};'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')]('Campaign',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 7a77139..cc63ed6 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 _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1d57c1,_0x198777){var _0x311625=function(_0xed5e68){while(--_0xed5e68){_0x1d57c1['push'](_0x1d57c1['shift']());}};_0x311625(++_0x198777);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var 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']('Campaign,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file +var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x20f5fd,_0x4a15d4){var _0x578692=function(_0x50229e){while(--_0x50229e){_0x20f5fd['push'](_0x20f5fd['shift']());}};_0x578692(++_0x4a15d4);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index dbba9c8..d989f93 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 _0xfae3=['/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','put','delete','destroy','removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/hoppers','getHopperHistories'];(function(_0x346d2e,_0x13a631){var _0x54839d=function(_0x5444c7){while(--_0x5444c7){_0x346d2e['push'](_0x346d2e['shift']());}};_0x54839d(++_0x13a631);}(_0xfae3,0xa1));var _0x3fae=function(_0x49b9ef,_0x55547f){_0x49b9ef=_0x49b9ef-0x0;var _0x4de813=_0xfae3[_0x49b9ef];return _0x4de813;};'use strict';var multer=require(_0x3fae('0x0'));var util=require(_0x3fae('0x1'));var path=require(_0x3fae('0x2'));var timeout=require('connect-timeout');var express=require(_0x3fae('0x3'));var router=express[_0x3fae('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3fae('0x5'));var config=require(_0x3fae('0x6'));var controller=require('./campaign.controller');router[_0x3fae('0x7')]('/',auth[_0x3fae('0x8')](),controller['index']);router[_0x3fae('0x7')](_0x3fae('0x9'),auth[_0x3fae('0x8')](),controller[_0x3fae('0xa')]);router[_0x3fae('0x7')](_0x3fae('0xb'),auth[_0x3fae('0x8')](),controller['getHoppers']);router[_0x3fae('0x7')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x3fae('0xc')]);router[_0x3fae('0x7')](_0x3fae('0xd'),auth[_0x3fae('0x8')](),controller[_0x3fae('0xe')]);router[_0x3fae('0x7')](_0x3fae('0xf'),auth[_0x3fae('0x8')](),controller['getHopperBlacks']);router['get'](_0x3fae('0x10'),auth[_0x3fae('0x8')](),controller[_0x3fae('0x11')]);router[_0x3fae('0x7')](_0x3fae('0x12'),auth[_0x3fae('0x8')](),controller['getBlackLists']);router[_0x3fae('0x13')]('/',auth[_0x3fae('0x8')](),controller[_0x3fae('0x14')]);router[_0x3fae('0x13')](_0x3fae('0x15'),auth[_0x3fae('0x8')](),controller[_0x3fae('0x16')]);router[_0x3fae('0x13')](_0x3fae('0x10'),auth[_0x3fae('0x8')](),controller['addLists']);router[_0x3fae('0x13')](_0x3fae('0x12'),auth[_0x3fae('0x8')](),controller['addBlackLists']);router[_0x3fae('0x17')](_0x3fae('0x9'),auth[_0x3fae('0x8')](),controller['update']);router[_0x3fae('0x18')]('/:id',auth[_0x3fae('0x8')](),controller[_0x3fae('0x19')]);router[_0x3fae('0x18')]('/:id/lists',auth[_0x3fae('0x8')](),controller[_0x3fae('0x1a')]);router[_0x3fae('0x18')](_0x3fae('0x12'),auth['isAuthenticated'](),controller[_0x3fae('0x1b')]);module[_0x3fae('0x1c')]=router; \ No newline at end of file +var _0x7118=['getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','put','update','delete','/:id','destroy','removeLists','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists'];(function(_0x18e52a,_0x262ac6){var _0x4b5c63=function(_0x1eb225){while(--_0x1eb225){_0x18e52a['push'](_0x18e52a['shift']());}};_0x4b5c63(++_0x262ac6);}(_0x7118,0xb7));var _0x8711=function(_0x3929ed,_0x29104c){_0x3929ed=_0x3929ed-0x0;var _0x5c8bbb=_0x7118[_0x3929ed];return _0x5c8bbb;};'use strict';var multer=require(_0x8711('0x0'));var util=require(_0x8711('0x1'));var path=require(_0x8711('0x2'));var timeout=require(_0x8711('0x3'));var express=require(_0x8711('0x4'));var router=express[_0x8711('0x5')]();var auth=require(_0x8711('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8711('0x7'));var controller=require(_0x8711('0x8'));router[_0x8711('0x9')]('/',auth[_0x8711('0xa')](),controller[_0x8711('0xb')]);router['get']('/:id',auth[_0x8711('0xa')](),controller[_0x8711('0xc')]);router[_0x8711('0x9')](_0x8711('0xd'),auth[_0x8711('0xa')](),controller[_0x8711('0xe')]);router[_0x8711('0x9')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0x8711('0xf')]);router['get'](_0x8711('0x10'),auth['isAuthenticated'](),controller[_0x8711('0x11')]);router['get'](_0x8711('0x12'),auth['isAuthenticated'](),controller[_0x8711('0x13')]);router[_0x8711('0x9')](_0x8711('0x14'),auth[_0x8711('0xa')](),controller[_0x8711('0x15')]);router[_0x8711('0x9')](_0x8711('0x16'),auth[_0x8711('0xa')](),controller['getBlackLists']);router[_0x8711('0x17')]('/',auth['isAuthenticated'](),controller[_0x8711('0x18')]);router[_0x8711('0x17')](_0x8711('0x19'),auth[_0x8711('0xa')](),controller[_0x8711('0x1a')]);router[_0x8711('0x17')](_0x8711('0x14'),auth[_0x8711('0xa')](),controller[_0x8711('0x1b')]);router['post']('/:id/blacklists',auth[_0x8711('0xa')](),controller['addBlackLists']);router[_0x8711('0x1c')]('/:id',auth[_0x8711('0xa')](),controller[_0x8711('0x1d')]);router[_0x8711('0x1e')](_0x8711('0x1f'),auth[_0x8711('0xa')](),controller[_0x8711('0x20')]);router['delete'](_0x8711('0x14'),auth['isAuthenticated'](),controller[_0x8711('0x21')]);router['delete'](_0x8711('0x16'),auth[_0x8711('0xa')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index d9aaea7..a744e0d 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 _0x3479=['key','sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0x3479,0x86));var _0x9347=function(_0x494f4d,_0x2807fa){_0x494f4d=_0x494f4d-0x0;var _0x3e7dfc=_0x3479[_0x494f4d];return _0x3e7dfc;};'use strict';var Sequelize=require(_0x9347('0x0'));module[_0x9347('0x1')]={'key':{'type':Sequelize[_0x9347('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x9347('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x9347('0x4')],'get':function(){return this[_0x9347('0x5')](_0x9347('0x6'));}}}; \ No newline at end of file +var _0xee02=['sequelize','exports','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xee02,0x1d5));var _0x2ee0=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0xee02[_0xf2628e];return _0x13863a;};'use strict';var Sequelize=require(_0x2ee0('0x0'));module[_0x2ee0('0x1')]={'key':{'type':Sequelize[_0x2ee0('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x2ee0('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x2ee0('0x4')],'get':function(){return this[_0x2ee0('0x5')](_0x2ee0('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 10bf975..eb344a2 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 _0xad8e=['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/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','map','CannedAnswer','type','key','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xad8e,0xa9));var _0xead8=function(_0x4eb4f1,_0x50a96b){_0x4eb4f1=_0x4eb4f1-0x0;var _0x1e94d7=_0xad8e[_0x4eb4f1];return _0x1e94d7;};'use strict';var pdf=require(_0xead8('0x0'));var emlformat=require(_0xead8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xead8('0x2'));var jsonpatch=require(_0xead8('0x3'));var rp=require(_0xead8('0x4'));var moment=require('moment');var BPromise=require(_0xead8('0x5'));var Mustache=require(_0xead8('0x6'));var util=require(_0xead8('0x7'));var path=require(_0xead8('0x8'));var sox=require(_0xead8('0x9'));var csv=require(_0xead8('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xead8('0xb'));var squel=require(_0xead8('0xc'));var crypto=require(_0xead8('0xd'));var jsforce=require(_0xead8('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xead8('0xf'));var Papa=require(_0xead8('0x10'));var Redis=require('ioredis');var authService=require(_0xead8('0x11'));var qs=require(_0xead8('0x12'));var as=require(_0xead8('0x13'));var hardwareService=require(_0xead8('0x14'));var logger=require(_0xead8('0x15'))(_0xead8('0x16'));var utils=require(_0xead8('0x17'));var config=require(_0xead8('0x18'));var db=require(_0xead8('0x19'))['db'];function respondWithStatusCode(_0x48a8f5,_0x21274b){_0x21274b=_0x21274b||0xcc;return function(_0x36decd){if(_0x36decd){return _0x48a8f5[_0xead8('0x1a')](_0x21274b);}return _0x48a8f5[_0xead8('0x1b')](_0x21274b)['end']();};}function respondWithResult(_0x1a8374,_0x4e1cde){_0x4e1cde=_0x4e1cde||0xc8;return function(_0x19c3b5){if(_0x19c3b5){return _0x1a8374[_0xead8('0x1b')](_0x4e1cde)[_0xead8('0x1c')](_0x19c3b5);}};}function respondWithFilteredResult(_0x550e7f,_0x5c20d8){return function(_0x370d96){if(_0x370d96){var _0x27c145=_0x370d96[_0xead8('0x1d')],_0x55cc7f=_0x5c20d8[_0xead8('0x1e')],_0x134e82=_0x5c20d8[_0xead8('0x1e')]+_0x5c20d8[_0xead8('0x1f')],_0x32c092;if(_0x134e82>=_0x27c145){_0x134e82=_0x27c145;_0x32c092=0xc8;}else{_0x32c092=0xce;}_0x550e7f['status'](_0x32c092);return _0x550e7f['set'](_0xead8('0x20'),_0x55cc7f+'-'+_0x134e82+'/'+_0x27c145)[_0xead8('0x1c')](_0x370d96);}return null;};}function patchUpdates(_0x293577){return function(_0x14617c){try{jsonpatch['apply'](_0x14617c,_0x293577,!![]);}catch(_0x51e992){return BPromise[_0xead8('0x21')](_0x51e992);}return _0x14617c[_0xead8('0x22')]();};}function saveUpdates(_0x3049c2,_0x18ee1c){return function(_0x4409e1){if(_0x4409e1){return _0x4409e1[_0xead8('0x23')](_0x3049c2)[_0xead8('0x24')](function(_0x6b93f5){return _0x6b93f5;});}return null;};}function removeEntity(_0x483b38,_0x1480b9){return function(_0x12767f){if(_0x12767f){return _0x12767f[_0xead8('0x25')]()[_0xead8('0x24')](function(){var _0x4d0ce3=_0x12767f[_0xead8('0x26')]({'plain':!![]});var _0x33e918=_0xead8('0x27');return db[_0xead8('0x28')][_0xead8('0x25')]({'where':{'type':_0x33e918,'resourceId':_0x4d0ce3['id']}})[_0xead8('0x24')](function(){return _0x12767f;});})[_0xead8('0x24')](function(){_0x483b38[_0xead8('0x1b')](0xcc)[_0xead8('0x29')]();});}};}function handleEntityNotFound(_0x30bf7d,_0xf34000){return function(_0x373691){if(!_0x373691){_0x30bf7d['sendStatus'](0x194);}return _0x373691;};}function handleError(_0x43e104,_0xc7d07f){_0xc7d07f=_0xc7d07f||0x1f4;return function(_0x3bd7b8){logger[_0xead8('0x2a')](_0x3bd7b8[_0xead8('0x2b')]);if(_0x3bd7b8['name']){delete _0x3bd7b8[_0xead8('0x2c')];}_0x43e104[_0xead8('0x1b')](_0xc7d07f)[_0xead8('0x2d')](_0x3bd7b8);};}exports[_0xead8('0x2e')]=function(_0x2274e3,_0x3d9d96){var _0x3eb21a={},_0x21225d={},_0x407dc1={'count':0x0,'rows':[]};var _0x536676=_[_0xead8('0x2f')](db[_0xead8('0x30')]['rawAttributes'],function(_0x207322){return{'name':_0x207322['fieldName'],'type':_0x207322[_0xead8('0x31')][_0xead8('0x32')]};});_0x21225d[_0xead8('0x33')]=_[_0xead8('0x2f')](_0x536676,_0xead8('0x2c'));_0x21225d['query']=_[_0xead8('0x34')](_0x2274e3['query']);_0x21225d[_0xead8('0x35')]=_['intersection'](_0x21225d['model'],_0x21225d[_0xead8('0x36')]);_0x3eb21a['attributes']=_[_0xead8('0x37')](_0x21225d[_0xead8('0x33')],qs[_0xead8('0x38')](_0x2274e3[_0xead8('0x36')]['fields']));_0x3eb21a[_0xead8('0x39')]=_0x3eb21a[_0xead8('0x39')][_0xead8('0x3a')]?_0x3eb21a[_0xead8('0x39')]:_0x21225d['model'];if(!_0x2274e3[_0xead8('0x36')][_0xead8('0x3b')]('nolimit')){_0x3eb21a['limit']=qs[_0xead8('0x1f')](_0x2274e3[_0xead8('0x36')][_0xead8('0x1f')]);_0x3eb21a[_0xead8('0x1e')]=qs['offset'](_0x2274e3[_0xead8('0x36')][_0xead8('0x1e')]);}_0x3eb21a[_0xead8('0x3c')]=qs['sort'](_0x2274e3[_0xead8('0x36')][_0xead8('0x3d')]);_0x3eb21a[_0xead8('0x3e')]=qs[_0xead8('0x35')](_['pick'](_0x2274e3[_0xead8('0x36')],_0x21225d[_0xead8('0x35')]),_0x536676);if(_0x2274e3[_0xead8('0x36')][_0xead8('0x3f')]){_0x3eb21a[_0xead8('0x3e')]=_[_0xead8('0x40')](_0x3eb21a[_0xead8('0x3e')],{'$or':_[_0xead8('0x2f')](_0x536676,function(_0x190f8f){if(_0x190f8f[_0xead8('0x31')]!==_0xead8('0x41')){var _0x405085={};_0x405085[_0x190f8f[_0xead8('0x2c')]]={'$like':'%'+_0x2274e3[_0xead8('0x36')][_0xead8('0x3f')]+'%'};return _0x405085;}})});}_0x3eb21a=_[_0xead8('0x40')]({},_0x3eb21a,_0x2274e3[_0xead8('0x42')]);var _0x1b86c8={'where':_0x3eb21a['where']};return db[_0xead8('0x30')][_0xead8('0x1d')](_0x1b86c8)['then'](function(_0x40cd01){_0x407dc1[_0xead8('0x1d')]=_0x40cd01;if(_0x2274e3[_0xead8('0x36')][_0xead8('0x43')]){_0x3eb21a[_0xead8('0x44')]=[{'all':!![]}];}return db[_0xead8('0x30')][_0xead8('0x45')](_0x3eb21a);})['then'](function(_0x53700c){_0x407dc1['rows']=_0x53700c;return _0x407dc1;})[_0xead8('0x24')](respondWithFilteredResult(_0x3d9d96,_0x3eb21a))[_0xead8('0x46')](handleError(_0x3d9d96,null));};exports[_0xead8('0x47')]=function(_0x2bab99,_0x1dee56){var _0x2008f6={'raw':!![],'where':{'id':_0x2bab99['params']['id']}},_0x2ae6e7={};_0x2ae6e7[_0xead8('0x33')]=_[_0xead8('0x34')](db[_0xead8('0x30')][_0xead8('0x48')]);_0x2ae6e7[_0xead8('0x36')]=_['keys'](_0x2bab99[_0xead8('0x36')]);_0x2ae6e7[_0xead8('0x35')]=_[_0xead8('0x37')](_0x2ae6e7[_0xead8('0x33')],_0x2ae6e7[_0xead8('0x36')]);_0x2008f6[_0xead8('0x39')]=_['intersection'](_0x2ae6e7[_0xead8('0x33')],qs[_0xead8('0x38')](_0x2bab99['query'][_0xead8('0x38')]));_0x2008f6['attributes']=_0x2008f6['attributes'][_0xead8('0x3a')]?_0x2008f6[_0xead8('0x39')]:_0x2ae6e7[_0xead8('0x33')];if(_0x2bab99[_0xead8('0x36')][_0xead8('0x43')]){_0x2008f6['include']=[{'all':!![]}];}_0x2008f6=_[_0xead8('0x40')]({},_0x2008f6,_0x2bab99[_0xead8('0x42')]);return db[_0xead8('0x30')][_0xead8('0x49')](_0x2008f6)[_0xead8('0x24')](handleEntityNotFound(_0x1dee56,null))[_0xead8('0x24')](respondWithResult(_0x1dee56,null))['catch'](handleError(_0x1dee56,null));};exports[_0xead8('0x23')]=function(_0x1d49e2,_0x209b09){if(_0x1d49e2[_0xead8('0x4a')]['id']){delete _0x1d49e2[_0xead8('0x4a')]['id'];}return db[_0xead8('0x30')][_0xead8('0x49')]({'where':{'id':_0x1d49e2[_0xead8('0x4b')]['id']}})[_0xead8('0x24')](handleEntityNotFound(_0x209b09,null))['then'](saveUpdates(_0x1d49e2[_0xead8('0x4a')],null))[_0xead8('0x24')](respondWithResult(_0x209b09,null))[_0xead8('0x46')](handleError(_0x209b09,null));};exports['destroy']=function(_0x18eaca,_0x31137f){return db[_0xead8('0x30')]['find']({'where':{'id':_0x18eaca[_0xead8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x31137f,null))[_0xead8('0x24')](removeEntity(_0x31137f,null))[_0xead8('0x46')](handleError(_0x31137f,null));};exports[_0xead8('0x4c')]=function(_0x8057f2,_0x189e18){var _0x2ee3e3={'key':_0x8057f2['body']['key']};if(_0x8057f2[_0xead8('0x4a')]['MailAccountId']){_0x2ee3e3['MailAccountId']=_0x8057f2[_0xead8('0x4a')][_0xead8('0x4d')];}else if(_0x8057f2['body'][_0xead8('0x4e')]){_0x2ee3e3[_0xead8('0x4e')]=_0x8057f2[_0xead8('0x4a')][_0xead8('0x4e')];}else if(_0x8057f2[_0xead8('0x4a')]['OpenchannelAccountId']){_0x2ee3e3[_0xead8('0x4f')]=_0x8057f2[_0xead8('0x4a')][_0xead8('0x4f')];}else if(_0x8057f2[_0xead8('0x4a')][_0xead8('0x50')]){_0x2ee3e3['ChatWebsiteId']=_0x8057f2[_0xead8('0x4a')][_0xead8('0x50')];}return db['CannedAnswer'][_0xead8('0x49')]({'where':_0x2ee3e3})[_0xead8('0x24')](function(_0x2b4299){if(_0x2b4299){throw new db[(_0xead8('0x51'))][(_0xead8('0x52'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0xead8('0x30')][_0xead8('0x4c')](_0x8057f2[_0xead8('0x4a')]);})[_0xead8('0x24')](function(_0x326698){var _0x3c0d5f=_0x8057f2['user'][_0xead8('0x26')]({'plain':!![]});if(!_0x3c0d5f)throw new Error(_0xead8('0x53'));if(_0x3c0d5f['role']===_0xead8('0x54')){var _0x16cf69=_0x326698[_0xead8('0x26')]({'plain':!![]});return db[_0xead8('0x55')]['find']({'where':{'name':_0xead8('0x27'),'userProfileId':_0x3c0d5f[_0xead8('0x56')]},'raw':!![]})[_0xead8('0x24')](function(_0x1178dd){if(_0x1178dd&&_0x1178dd[_0xead8('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x16cf69['name'],'resourceId':_0x16cf69['id'],'type':_0x1178dd[_0xead8('0x2c')],'sectionId':_0x1178dd['id']},{})['then'](function(){return _0x326698;});}else{return _0x326698;}})[_0xead8('0x46')](function(_0x403262){logger['error'](_0xead8('0x58'),_0x403262);throw _0x403262;});}return _0x326698;})[_0xead8('0x24')](respondWithResult(_0x189e18,0xc9))[_0xead8('0x46')](handleError(_0x189e18,null));}; \ No newline at end of file +var _0x525f=['fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','body','find','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','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','count','offset','limit','set','apply','reject','save','update','then','destroy','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','CannedAnswer','rawAttributes'];(function(_0x1a957b,_0x3a5dca){var _0x2b79f4=function(_0x113582){while(--_0x113582){_0x1a957b['push'](_0x1a957b['shift']());}};_0x2b79f4(++_0x3a5dca);}(_0x525f,0x1f1));var _0xf525=function(_0x3b93da,_0x18a562){_0x3b93da=_0x3b93da-0x0;var _0x31b1d3=_0x525f[_0x3b93da];return _0x31b1d3;};'use strict';var pdf=require(_0xf525('0x0'));var emlformat=require(_0xf525('0x1'));var rimraf=require(_0xf525('0x2'));var zipdir=require(_0xf525('0x3'));var jsonpatch=require(_0xf525('0x4'));var rp=require(_0xf525('0x5'));var moment=require('moment');var BPromise=require(_0xf525('0x6'));var Mustache=require('mustache');var util=require(_0xf525('0x7'));var path=require(_0xf525('0x8'));var sox=require(_0xf525('0x9'));var csv=require(_0xf525('0xa'));var ejs=require(_0xf525('0xb'));var fs=require('fs');var _=require(_0xf525('0xc'));var squel=require(_0xf525('0xd'));var crypto=require(_0xf525('0xe'));var jsforce=require(_0xf525('0xf'));var deskjs=require(_0xf525('0x10'));var toCsv=require('to-csv');var querystring=require(_0xf525('0x11'));var Papa=require('papaparse');var Redis=require(_0xf525('0x12'));var authService=require(_0xf525('0x13'));var qs=require(_0xf525('0x14'));var as=require(_0xf525('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf525('0x16'))(_0xf525('0x17'));var utils=require(_0xf525('0x18'));var config=require(_0xf525('0x19'));var db=require(_0xf525('0x1a'))['db'];function respondWithStatusCode(_0xe163ed,_0x5b5b46){_0x5b5b46=_0x5b5b46||0xcc;return function(_0x2478ea){if(_0x2478ea){return _0xe163ed['sendStatus'](_0x5b5b46);}return _0xe163ed[_0xf525('0x1b')](_0x5b5b46)['end']();};}function respondWithResult(_0x512bb4,_0x178558){_0x178558=_0x178558||0xc8;return function(_0x34e8c3){if(_0x34e8c3){return _0x512bb4[_0xf525('0x1b')](_0x178558)[_0xf525('0x1c')](_0x34e8c3);}};}function respondWithFilteredResult(_0x21ab5c,_0x2dc718){return function(_0x5a2769){if(_0x5a2769){var _0x2a11d5=_0x5a2769[_0xf525('0x1d')],_0x44b4de=_0x2dc718['offset'],_0x546378=_0x2dc718[_0xf525('0x1e')]+_0x2dc718[_0xf525('0x1f')],_0x1e0939;if(_0x546378>=_0x2a11d5){_0x546378=_0x2a11d5;_0x1e0939=0xc8;}else{_0x1e0939=0xce;}_0x21ab5c['status'](_0x1e0939);return _0x21ab5c[_0xf525('0x20')]('Content-Range',_0x44b4de+'-'+_0x546378+'/'+_0x2a11d5)[_0xf525('0x1c')](_0x5a2769);}return null;};}function patchUpdates(_0x7a9fd7){return function(_0x3090d0){try{jsonpatch[_0xf525('0x21')](_0x3090d0,_0x7a9fd7,!![]);}catch(_0x4cb209){return BPromise[_0xf525('0x22')](_0x4cb209);}return _0x3090d0[_0xf525('0x23')]();};}function saveUpdates(_0x267522,_0x25df42){return function(_0x1d3bfc){if(_0x1d3bfc){return _0x1d3bfc[_0xf525('0x24')](_0x267522)[_0xf525('0x25')](function(_0x1ba103){return _0x1ba103;});}return null;};}function removeEntity(_0x5974bb,_0xc48c88){return function(_0x3f1714){if(_0x3f1714){return _0x3f1714[_0xf525('0x26')]()[_0xf525('0x25')](function(){var _0x387628=_0x3f1714['get']({'plain':!![]});var _0x4a1032=_0xf525('0x27');return db[_0xf525('0x28')][_0xf525('0x26')]({'where':{'type':_0x4a1032,'resourceId':_0x387628['id']}})[_0xf525('0x25')](function(){return _0x3f1714;});})[_0xf525('0x25')](function(){_0x5974bb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c0a04,_0x4966b8){return function(_0xe9f55f){if(!_0xe9f55f){_0x2c0a04[_0xf525('0x29')](0x194);}return _0xe9f55f;};}function handleError(_0x55195d,_0x3df5a7){_0x3df5a7=_0x3df5a7||0x1f4;return function(_0x5240bc){logger[_0xf525('0x2a')](_0x5240bc[_0xf525('0x2b')]);if(_0x5240bc[_0xf525('0x2c')]){delete _0x5240bc['name'];}_0x55195d[_0xf525('0x1b')](_0x3df5a7)[_0xf525('0x2d')](_0x5240bc);};}exports[_0xf525('0x2e')]=function(_0x3dcac0,_0x5a91da){var _0x44c5d9={},_0x477d77={},_0x43e019={'count':0x0,'rows':[]};var _0x87dbe6=_['map'](db[_0xf525('0x2f')][_0xf525('0x30')],function(_0x7509e4){return{'name':_0x7509e4[_0xf525('0x31')],'type':_0x7509e4[_0xf525('0x32')]['key']};});_0x477d77[_0xf525('0x33')]=_[_0xf525('0x34')](_0x87dbe6,_0xf525('0x2c'));_0x477d77[_0xf525('0x35')]=_[_0xf525('0x36')](_0x3dcac0[_0xf525('0x35')]);_0x477d77[_0xf525('0x37')]=_[_0xf525('0x38')](_0x477d77['model'],_0x477d77[_0xf525('0x35')]);_0x44c5d9[_0xf525('0x39')]=_[_0xf525('0x38')](_0x477d77['model'],qs['fields'](_0x3dcac0[_0xf525('0x35')][_0xf525('0x3a')]));_0x44c5d9[_0xf525('0x39')]=_0x44c5d9['attributes'][_0xf525('0x3b')]?_0x44c5d9[_0xf525('0x39')]:_0x477d77[_0xf525('0x33')];if(!_0x3dcac0[_0xf525('0x35')]['hasOwnProperty'](_0xf525('0x3c'))){_0x44c5d9[_0xf525('0x1f')]=qs[_0xf525('0x1f')](_0x3dcac0[_0xf525('0x35')][_0xf525('0x1f')]);_0x44c5d9[_0xf525('0x1e')]=qs[_0xf525('0x1e')](_0x3dcac0[_0xf525('0x35')][_0xf525('0x1e')]);}_0x44c5d9[_0xf525('0x3d')]=qs[_0xf525('0x3e')](_0x3dcac0[_0xf525('0x35')][_0xf525('0x3e')]);_0x44c5d9[_0xf525('0x3f')]=qs[_0xf525('0x37')](_['pick'](_0x3dcac0[_0xf525('0x35')],_0x477d77[_0xf525('0x37')]),_0x87dbe6);if(_0x3dcac0[_0xf525('0x35')][_0xf525('0x40')]){_0x44c5d9[_0xf525('0x3f')]=_[_0xf525('0x41')](_0x44c5d9[_0xf525('0x3f')],{'$or':_[_0xf525('0x34')](_0x87dbe6,function(_0xe1b2c7){if(_0xe1b2c7[_0xf525('0x32')]!==_0xf525('0x42')){var _0x17b835={};_0x17b835[_0xe1b2c7['name']]={'$like':'%'+_0x3dcac0[_0xf525('0x35')]['filter']+'%'};return _0x17b835;}})});}_0x44c5d9=_[_0xf525('0x41')]({},_0x44c5d9,_0x3dcac0[_0xf525('0x43')]);var _0x40487e={'where':_0x44c5d9['where']};return db[_0xf525('0x2f')][_0xf525('0x1d')](_0x40487e)['then'](function(_0x380357){_0x43e019['count']=_0x380357;if(_0x3dcac0[_0xf525('0x35')][_0xf525('0x44')]){_0x44c5d9['include']=[{'all':!![]}];}return db[_0xf525('0x2f')]['findAll'](_0x44c5d9);})[_0xf525('0x25')](function(_0x31f7f1){_0x43e019[_0xf525('0x45')]=_0x31f7f1;return _0x43e019;})[_0xf525('0x25')](respondWithFilteredResult(_0x5a91da,_0x44c5d9))[_0xf525('0x46')](handleError(_0x5a91da,null));};exports[_0xf525('0x47')]=function(_0x5c2f8f,_0x4349be){var _0xd29b43={'raw':!![],'where':{'id':_0x5c2f8f[_0xf525('0x48')]['id']}},_0x266e8f={};_0x266e8f['model']=_[_0xf525('0x36')](db[_0xf525('0x2f')][_0xf525('0x30')]);_0x266e8f[_0xf525('0x35')]=_[_0xf525('0x36')](_0x5c2f8f['query']);_0x266e8f['filters']=_[_0xf525('0x38')](_0x266e8f[_0xf525('0x33')],_0x266e8f[_0xf525('0x35')]);_0xd29b43[_0xf525('0x39')]=_[_0xf525('0x38')](_0x266e8f['model'],qs['fields'](_0x5c2f8f[_0xf525('0x35')]['fields']));_0xd29b43['attributes']=_0xd29b43[_0xf525('0x39')]['length']?_0xd29b43[_0xf525('0x39')]:_0x266e8f[_0xf525('0x33')];if(_0x5c2f8f['query']['includeAll']){_0xd29b43[_0xf525('0x49')]=[{'all':!![]}];}_0xd29b43=_[_0xf525('0x41')]({},_0xd29b43,_0x5c2f8f['options']);return db[_0xf525('0x2f')]['find'](_0xd29b43)[_0xf525('0x25')](handleEntityNotFound(_0x4349be,null))[_0xf525('0x25')](respondWithResult(_0x4349be,null))['catch'](handleError(_0x4349be,null));};exports['update']=function(_0x5a1500,_0x15e7d2){if(_0x5a1500[_0xf525('0x4a')]['id']){delete _0x5a1500['body']['id'];}return db['CannedAnswer'][_0xf525('0x4b')]({'where':{'id':_0x5a1500[_0xf525('0x48')]['id']}})['then'](handleEntityNotFound(_0x15e7d2,null))['then'](saveUpdates(_0x5a1500[_0xf525('0x4a')],null))[_0xf525('0x25')](respondWithResult(_0x15e7d2,null))[_0xf525('0x46')](handleError(_0x15e7d2,null));};exports[_0xf525('0x26')]=function(_0x57b428,_0x2c6055){return db['CannedAnswer']['find']({'where':{'id':_0x57b428['params']['id']}})[_0xf525('0x25')](handleEntityNotFound(_0x2c6055,null))[_0xf525('0x25')](removeEntity(_0x2c6055,null))[_0xf525('0x46')](handleError(_0x2c6055,null));};exports['create']=function(_0x37f8c0,_0x1e8685){var _0x4eecf2={'key':_0x37f8c0[_0xf525('0x4a')][_0xf525('0x4c')]};if(_0x37f8c0['body'][_0xf525('0x4d')]){_0x4eecf2[_0xf525('0x4d')]=_0x37f8c0[_0xf525('0x4a')]['MailAccountId'];}else if(_0x37f8c0[_0xf525('0x4a')][_0xf525('0x4e')]){_0x4eecf2['SmsAccountId']=_0x37f8c0[_0xf525('0x4a')]['SmsAccountId'];}else if(_0x37f8c0[_0xf525('0x4a')][_0xf525('0x4f')]){_0x4eecf2['OpenchannelAccountId']=_0x37f8c0[_0xf525('0x4a')]['OpenchannelAccountId'];}else if(_0x37f8c0[_0xf525('0x4a')]['ChatWebsiteId']){_0x4eecf2[_0xf525('0x50')]=_0x37f8c0[_0xf525('0x4a')][_0xf525('0x50')];}return db[_0xf525('0x2f')][_0xf525('0x4b')]({'where':_0x4eecf2})[_0xf525('0x25')](function(_0x436fb9){if(_0x436fb9){throw new db[(_0xf525('0x51'))]['ValidationError'](_0xf525('0x52'));}return db[_0xf525('0x2f')][_0xf525('0x53')](_0x37f8c0[_0xf525('0x4a')]);})[_0xf525('0x25')](function(_0xe1b42b){var _0x1fac28=_0x37f8c0[_0xf525('0x54')]['get']({'plain':!![]});if(!_0x1fac28)throw new Error(_0xf525('0x55'));if(_0x1fac28[_0xf525('0x56')]==='user'){var _0x327e55=_0xe1b42b[_0xf525('0x57')]({'plain':!![]});return db[_0xf525('0x58')][_0xf525('0x4b')]({'where':{'name':'CannedAnswers','userProfileId':_0x1fac28['userProfileId']},'raw':!![]})[_0xf525('0x25')](function(_0x560c19){if(_0x560c19&&_0x560c19[_0xf525('0x59')]===0x0){return db[_0xf525('0x28')][_0xf525('0x53')]({'name':_0x327e55[_0xf525('0x2c')],'resourceId':_0x327e55['id'],'type':_0x560c19[_0xf525('0x2c')],'sectionId':_0x560c19['id']},{})[_0xf525('0x25')](function(){return _0xe1b42b;});}else{return _0xe1b42b;}})[_0xf525('0x46')](function(_0x1f8da4){logger[_0xf525('0x2a')](_0xf525('0x5a'),_0x1f8da4);throw _0x1f8da4;});}return _0xe1b42b;})['then'](respondWithResult(_0x1e8685,0xc9))[_0xf525('0x46')](handleError(_0x1e8685,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 80c916d..01b5f90 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 _0x38d3=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x38d3,0x1a7));var _0x338d=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x38d3[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x338d('0x0'));var util=require(_0x338d('0x1'));var logger=require('../../config/logger')(_0x338d('0x2'));var moment=require(_0x338d('0x3'));var BPromise=require(_0x338d('0x4'));var rp=require(_0x338d('0x5'));var fs=require('fs');var path=require(_0x338d('0x6'));var rimraf=require(_0x338d('0x7'));var config=require(_0x338d('0x8'));var attributes=require(_0x338d('0x9'));module[_0x338d('0xa')]=function(_0x4e32b4,_0x2a056d){return _0x4e32b4[_0x338d('0xb')](_0x338d('0xc'),attributes,{'tableName':_0x338d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x338d('0xe'),'collate':_0x338d('0xf')});}; \ No newline at end of file +var _0x9b6d=['./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4cd4b1,_0x2f3d9c){var _0x709eff=function(_0x3d46c1){while(--_0x3d46c1){_0x4cd4b1['push'](_0x4cd4b1['shift']());}};_0x709eff(++_0x2f3d9c);}(_0x9b6d,0x105));var _0xd9b6=function(_0x3ce86f,_0x312a9b){_0x3ce86f=_0x3ce86f-0x0;var _0x7a93ca=_0x9b6d[_0x3ce86f];return _0x7a93ca;};'use strict';var _=require('lodash');var util=require(_0xd9b6('0x0'));var logger=require(_0xd9b6('0x1'))(_0xd9b6('0x2'));var moment=require(_0xd9b6('0x3'));var BPromise=require(_0xd9b6('0x4'));var rp=require(_0xd9b6('0x5'));var fs=require('fs');var path=require(_0xd9b6('0x6'));var rimraf=require(_0xd9b6('0x7'));var config=require(_0xd9b6('0x8'));var attributes=require(_0xd9b6('0x9'));module[_0xd9b6('0xa')]=function(_0x5724e3,_0x2d38ce){return _0x5724e3[_0xd9b6('0xb')](_0xd9b6('0xc'),attributes,{'tableName':_0xd9b6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd9b6('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 396fbc6..1f5e3fc 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 _0x47cc=['lodash','util','moment','bluebird','ioredis','rpc','jayson/promise','client','request','then','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result'];(function(_0x257e8f,_0xdc7fc9){var _0x2d8b1e=function(_0x24739a){while(--_0x24739a){_0x257e8f['push'](_0x257e8f['shift']());}};_0x2d8b1e(++_0xdc7fc9);}(_0x47cc,0xaa));var _0xc47c=function(_0x40cfb2,_0x84a8bc){_0x40cfb2=_0x40cfb2-0x0;var _0x23d18f=_0x47cc[_0x40cfb2];return _0x23d18f;};'use strict';var _=require(_0xc47c('0x0'));var util=require(_0xc47c('0x1'));var moment=require(_0xc47c('0x2'));var BPromise=require(_0xc47c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc47c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc47c('0x5'));var config=require('../../config/environment');var jayson=require(_0xc47c('0x6'));var client=jayson[_0xc47c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x272fac,_0x1e81ad,_0x1be497){return new BPromise(function(_0x4195f0,_0x183bb0){return client[_0xc47c('0x8')](_0x272fac,_0x1be497)[_0xc47c('0x9')](function(_0x1aca53){logger['info'](_0xc47c('0xa'),_0x1e81ad,_0xc47c('0xb'));logger[_0xc47c('0xc')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x1e81ad,_0xc47c('0xb'),JSON['stringify'](_0x1aca53));if(_0x1aca53[_0xc47c('0xd')]){if(_0x1aca53[_0xc47c('0xd')]['code']===0x1f4){logger['error'](_0xc47c('0xa'),_0x1e81ad,_0x1aca53[_0xc47c('0xd')][_0xc47c('0xe')]);return _0x183bb0(_0x1aca53[_0xc47c('0xd')][_0xc47c('0xe')]);}logger[_0xc47c('0xd')](_0xc47c('0xa'),_0x1e81ad,_0x1aca53['error'][_0xc47c('0xe')]);return _0x4195f0(_0x1aca53['error'][_0xc47c('0xe')]);}else{logger[_0xc47c('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x1e81ad,_0xc47c('0xb'));_0x4195f0(_0x1aca53[_0xc47c('0x10')]['message']);}})['catch'](function(_0x143a1b){logger[_0xc47c('0xd')](_0xc47c('0xa'),_0x1e81ad,_0x143a1b);_0x183bb0(_0x143a1b);});});} \ No newline at end of file +var _0x791c=['jayson/promise','client','http','request','info','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','CannedAnswer,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x490ba1,_0x111b46){var _0x5e8873=function(_0x3e4f5b){while(--_0x3e4f5b){_0x490ba1['push'](_0x490ba1['shift']());}};_0x5e8873(++_0x111b46);}(_0x791c,0x1da));var _0xc791=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0x791c[_0x52666e];return _0x515330;};'use strict';var _=require('lodash');var util=require(_0xc791('0x0'));var moment=require(_0xc791('0x1'));var BPromise=require(_0xc791('0x2'));var rs=require(_0xc791('0x3'));var fs=require('fs');var Redis=require(_0xc791('0x4'));var db=require(_0xc791('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc791('0x6'))(_0xc791('0x7'));var config=require(_0xc791('0x8'));var jayson=require(_0xc791('0x9'));var client=jayson[_0xc791('0xa')][_0xc791('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e0d48,_0x6be66f,_0x2d9758){return new BPromise(function(_0x226aaf,_0x330d34){return client[_0xc791('0xc')](_0x1e0d48,_0x2d9758)['then'](function(_0x246ce6){logger[_0xc791('0xd')]('CannedAnswer,\x20%s,\x20%s',_0x6be66f,_0xc791('0xe'));logger[_0xc791('0xf')](_0xc791('0x10'),_0x6be66f,_0xc791('0xe'),JSON[_0xc791('0x11')](_0x246ce6));if(_0x246ce6[_0xc791('0x12')]){if(_0x246ce6[_0xc791('0x12')][_0xc791('0x13')]===0x1f4){logger[_0xc791('0x12')](_0xc791('0x14'),_0x6be66f,_0x246ce6[_0xc791('0x12')][_0xc791('0x15')]);return _0x330d34(_0x246ce6[_0xc791('0x12')][_0xc791('0x15')]);}logger[_0xc791('0x12')]('CannedAnswer,\x20%s,\x20%s',_0x6be66f,_0x246ce6[_0xc791('0x12')]['message']);return _0x226aaf(_0x246ce6['error']['message']);}else{logger['info'](_0xc791('0x14'),_0x6be66f,_0xc791('0xe'));_0x226aaf(_0x246ce6[_0xc791('0x16')][_0xc791('0x15')]);}})['catch'](function(_0x591453){logger[_0xc791('0x12')](_0xc791('0x14'),_0x6be66f,_0x591453);_0x330d34(_0x591453);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 128cd3b..a9d7178 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 _0xdf97=['../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','Router','../../components/auth/service'];(function(_0x48722f,_0x170704){var _0x3eb6be=function(_0x10f596){while(--_0x10f596){_0x48722f['push'](_0x48722f['shift']());}};_0x3eb6be(++_0x170704);}(_0xdf97,0x1c7));var _0x7df9=function(_0x2ec845,_0x23cd9d){_0x2ec845=_0x2ec845-0x0;var _0x3a3002=_0xdf97[_0x2ec845];return _0x3a3002;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7df9('0x0'));var timeout=require(_0x7df9('0x1'));var express=require('express');var router=express[_0x7df9('0x2')]();var auth=require(_0x7df9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7df9('0x4'));var controller=require(_0x7df9('0x5'));router['get']('/',auth[_0x7df9('0x6')](),controller[_0x7df9('0x7')]);router[_0x7df9('0x8')](_0x7df9('0x9'),auth[_0x7df9('0x6')](),controller[_0x7df9('0xa')]);router[_0x7df9('0xb')]('/',auth[_0x7df9('0x6')](),controller[_0x7df9('0xc')]);router[_0x7df9('0xd')](_0x7df9('0x9'),auth['isAuthenticated'](),controller[_0x7df9('0xe')]);router['delete'](_0x7df9('0x9'),auth[_0x7df9('0x6')](),controller[_0x7df9('0xf')]);module[_0x7df9('0x10')]=router; \ No newline at end of file +var _0x1427=['put','update','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5cb7dd,_0x290cfb){var _0x5ee23e=function(_0x594d25){while(--_0x594d25){_0x5cb7dd['push'](_0x5cb7dd['shift']());}};_0x5ee23e(++_0x290cfb);}(_0x1427,0x7b));var _0x7142=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1427[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x7142('0x0'));var path=require(_0x7142('0x1'));var timeout=require(_0x7142('0x2'));var express=require(_0x7142('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7142('0x4'));var config=require('../../config/environment');var controller=require(_0x7142('0x5'));router[_0x7142('0x6')]('/',auth[_0x7142('0x7')](),controller[_0x7142('0x8')]);router[_0x7142('0x6')](_0x7142('0x9'),auth[_0x7142('0x7')](),controller[_0x7142('0xa')]);router[_0x7142('0xb')]('/',auth[_0x7142('0x7')](),controller[_0x7142('0xc')]);router[_0x7142('0xd')](_0x7142('0x9'),auth['isAuthenticated'](),controller[_0x7142('0xe')]);router['delete'](_0x7142('0x9'),auth[_0x7142('0x7')](),controller[_0x7142('0xf')]);module[_0x7142('0x10')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index ed3b303..03345a8 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 _0x0241=['DATE','STRING','INTEGER','sequelize','exports'];(function(_0x23349d,_0x2828ed){var _0x213f3f=function(_0x117121){while(--_0x117121){_0x23349d['push'](_0x23349d['shift']());}};_0x213f3f(++_0x2828ed);}(_0x0241,0x111));var _0x1024=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0241[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x1024('0x0'));module[_0x1024('0x1')]={'calldate':{'type':Sequelize[_0x1024('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x1024('0x3')]},'dcontext':{'type':Sequelize[_0x1024('0x3')]},'channel':{'type':Sequelize[_0x1024('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x1024('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x1024('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x1024('0x3')]},'amaflags':{'type':Sequelize[_0x1024('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x1024('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x1024('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x1024('0x3')]},'peeraccount':{'type':Sequelize[_0x1024('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x1024('0x3')]}}; \ No newline at end of file +var _0x053e=['exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1f6bcf,_0x1ec0ec){var _0x1620b8=function(_0x2084db){while(--_0x2084db){_0x1f6bcf['push'](_0x1f6bcf['shift']());}};_0x1620b8(++_0x1ec0ec);}(_0x053e,0x108));var _0xe053=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x053e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xe053('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xe053('0x1')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xe053('0x2')]},'dst':{'type':Sequelize[_0xe053('0x2')]},'dcontext':{'type':Sequelize[_0xe053('0x2')]},'channel':{'type':Sequelize[_0xe053('0x2')]},'dstchannel':{'type':Sequelize[_0xe053('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xe053('0x2')]},'duration':{'type':Sequelize[_0xe053('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe053('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe053('0x2')]},'amaflags':{'type':Sequelize[_0xe053('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe053('0x2')]},'userfield':{'type':Sequelize[_0xe053('0x2')]},'uniqueid':{'type':Sequelize[_0xe053('0x2')]},'linkedid':{'type':Sequelize[_0xe053('0x2')]},'sequence':{'type':Sequelize[_0xe053('0x2')]},'peeraccount':{'type':Sequelize[_0xe053('0x2')]},'type':{'type':Sequelize[_0xe053('0x2')]},'tag':{'type':Sequelize[_0xe053('0x2')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 887e265..b90e993 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 _0x522a=['reject','save','update','then','destroy','error','name','send','map','Cdr','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','length','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x522a,0x1cc));var _0xa522=function(_0x3b10df,_0x46d3ec){_0x3b10df=_0x3b10df-0x0;var _0x50501e=_0x522a[_0x3b10df];return _0x50501e;};'use strict';var pdf=require(_0xa522('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa522('0x1'));var zipdir=require(_0xa522('0x2'));var jsonpatch=require(_0xa522('0x3'));var rp=require(_0xa522('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa522('0x5'));var path=require(_0xa522('0x6'));var sox=require('sox');var csv=require(_0xa522('0x7'));var ejs=require(_0xa522('0x8'));var fs=require('fs');var _=require(_0xa522('0x9'));var squel=require(_0xa522('0xa'));var crypto=require(_0xa522('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xa522('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa522('0xd'));var qs=require(_0xa522('0xe'));var as=require(_0xa522('0xf'));var hardwareService=require(_0xa522('0x10'));var logger=require(_0xa522('0x11'))(_0xa522('0x12'));var utils=require(_0xa522('0x13'));var config=require(_0xa522('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54ab28,_0x13899f){_0x13899f=_0x13899f||0xcc;return function(_0x3f8191){if(_0x3f8191){return _0x54ab28[_0xa522('0x15')](_0x13899f);}return _0x54ab28[_0xa522('0x16')](_0x13899f)[_0xa522('0x17')]();};}function respondWithResult(_0x14a8b3,_0x42aa6c){_0x42aa6c=_0x42aa6c||0xc8;return function(_0x52c766){if(_0x52c766){return _0x14a8b3[_0xa522('0x16')](_0x42aa6c)['json'](_0x52c766);}};}function respondWithFilteredResult(_0x50bd30,_0x31e328){return function(_0x2b968a){if(_0x2b968a){var _0x3abd51=_0x2b968a[_0xa522('0x18')],_0x508fff=_0x31e328[_0xa522('0x19')],_0x1f88a4=_0x31e328[_0xa522('0x19')]+_0x31e328[_0xa522('0x1a')],_0x49b9f2;if(_0x1f88a4>=_0x3abd51){_0x1f88a4=_0x3abd51;_0x49b9f2=0xc8;}else{_0x49b9f2=0xce;}_0x50bd30['status'](_0x49b9f2);return _0x50bd30[_0xa522('0x1b')](_0xa522('0x1c'),_0x508fff+'-'+_0x1f88a4+'/'+_0x3abd51)[_0xa522('0x1d')](_0x2b968a);}return null;};}function patchUpdates(_0x1180be){return function(_0x222bf2){try{jsonpatch['apply'](_0x222bf2,_0x1180be,!![]);}catch(_0x230de8){return BPromise[_0xa522('0x1e')](_0x230de8);}return _0x222bf2[_0xa522('0x1f')]();};}function saveUpdates(_0x4669ac,_0x1ebada){return function(_0xc9a90){if(_0xc9a90){return _0xc9a90[_0xa522('0x20')](_0x4669ac)[_0xa522('0x21')](function(_0x1cfc99){return _0x1cfc99;});}return null;};}function removeEntity(_0x1cb12d,_0x2f24aa){return function(_0x4985e1){if(_0x4985e1){return _0x4985e1[_0xa522('0x22')]()[_0xa522('0x21')](function(){_0x1cb12d[_0xa522('0x16')](0xcc)[_0xa522('0x17')]();});}};}function handleEntityNotFound(_0x26af17,_0x5a02b4){return function(_0x263745){if(!_0x263745){_0x26af17['sendStatus'](0x194);}return _0x263745;};}function handleError(_0x208036,_0x3dc56b){_0x3dc56b=_0x3dc56b||0x1f4;return function(_0x5721e9){logger[_0xa522('0x23')](_0x5721e9['stack']);if(_0x5721e9[_0xa522('0x24')]){delete _0x5721e9[_0xa522('0x24')];}_0x208036[_0xa522('0x16')](_0x3dc56b)[_0xa522('0x25')](_0x5721e9);};}exports['index']=function(_0x3d8948,_0x30ee22){var _0x4491ce={},_0x2fdade={},_0x31c800={'count':0x0,'rows':[]};var _0x1d64a4=_[_0xa522('0x26')](db[_0xa522('0x27')][_0xa522('0x28')],function(_0x13dc4d){return{'name':_0x13dc4d[_0xa522('0x29')],'type':_0x13dc4d['type'][_0xa522('0x2a')]};});_0x2fdade[_0xa522('0x2b')]=_['map'](_0x1d64a4,'name');_0x2fdade[_0xa522('0x2c')]=_[_0xa522('0x2d')](_0x3d8948[_0xa522('0x2c')]);_0x2fdade[_0xa522('0x2e')]=_[_0xa522('0x2f')](_0x2fdade[_0xa522('0x2b')],_0x2fdade[_0xa522('0x2c')]);_0x4491ce[_0xa522('0x30')]=_[_0xa522('0x2f')](_0x2fdade[_0xa522('0x2b')],qs[_0xa522('0x31')](_0x3d8948[_0xa522('0x2c')][_0xa522('0x31')]));_0x4491ce[_0xa522('0x30')]=_0x4491ce[_0xa522('0x30')]['length']?_0x4491ce[_0xa522('0x30')]:_0x2fdade[_0xa522('0x2b')];if(!_0x3d8948[_0xa522('0x2c')][_0xa522('0x32')](_0xa522('0x33'))){_0x4491ce[_0xa522('0x1a')]=qs['limit'](_0x3d8948[_0xa522('0x2c')][_0xa522('0x1a')]);_0x4491ce[_0xa522('0x19')]=qs[_0xa522('0x19')](_0x3d8948[_0xa522('0x2c')][_0xa522('0x19')]);}_0x4491ce[_0xa522('0x34')]=qs['sort'](_0x3d8948[_0xa522('0x2c')]['sort']);_0x4491ce[_0xa522('0x35')]=qs[_0xa522('0x2e')](_[_0xa522('0x36')](_0x3d8948[_0xa522('0x2c')],_0x2fdade['filters']),_0x1d64a4);if(_0x3d8948[_0xa522('0x2c')][_0xa522('0x37')]){_0x4491ce[_0xa522('0x35')]=_['merge'](_0x4491ce['where'],{'$or':_['map'](_0x1d64a4,function(_0x5a03ef){if(_0x5a03ef[_0xa522('0x38')]!==_0xa522('0x39')){var _0x103a7f={};_0x103a7f[_0x5a03ef[_0xa522('0x24')]]={'$like':'%'+_0x3d8948['query'][_0xa522('0x37')]+'%'};return _0x103a7f;}})});}_0x4491ce=_[_0xa522('0x3a')]({},_0x4491ce,_0x3d8948[_0xa522('0x3b')]);var _0x416af8={'where':_0x4491ce[_0xa522('0x35')]};return db[_0xa522('0x27')][_0xa522('0x18')](_0x416af8)[_0xa522('0x21')](function(_0xf00876){_0x31c800[_0xa522('0x18')]=_0xf00876;if(_0x3d8948[_0xa522('0x2c')][_0xa522('0x3c')]){_0x4491ce[_0xa522('0x3d')]=[{'all':!![]}];}return db[_0xa522('0x27')]['findAll'](_0x4491ce);})[_0xa522('0x21')](function(_0x5b924d){_0x31c800[_0xa522('0x3e')]=_0x5b924d;return _0x31c800;})['then'](respondWithFilteredResult(_0x30ee22,_0x4491ce))[_0xa522('0x3f')](handleError(_0x30ee22,null));};exports[_0xa522('0x40')]=function(_0x37926b,_0x77d00e){var _0x34bf81={'raw':!![],'where':{'id':_0x37926b['params']['id']}},_0x579938={};_0x579938[_0xa522('0x2b')]=_[_0xa522('0x2d')](db[_0xa522('0x27')]['rawAttributes']);_0x579938[_0xa522('0x2c')]=_['keys'](_0x37926b['query']);_0x579938['filters']=_[_0xa522('0x2f')](_0x579938[_0xa522('0x2b')],_0x579938[_0xa522('0x2c')]);_0x34bf81['attributes']=_[_0xa522('0x2f')](_0x579938['model'],qs[_0xa522('0x31')](_0x37926b[_0xa522('0x2c')][_0xa522('0x31')]));_0x34bf81['attributes']=_0x34bf81[_0xa522('0x30')][_0xa522('0x41')]?_0x34bf81[_0xa522('0x30')]:_0x579938['model'];if(_0x37926b[_0xa522('0x2c')][_0xa522('0x3c')]){_0x34bf81['include']=[{'all':!![]}];}_0x34bf81=_[_0xa522('0x3a')]({},_0x34bf81,_0x37926b[_0xa522('0x3b')]);return db[_0xa522('0x27')][_0xa522('0x42')](_0x34bf81)[_0xa522('0x21')](handleEntityNotFound(_0x77d00e,null))[_0xa522('0x21')](respondWithResult(_0x77d00e,null))[_0xa522('0x3f')](handleError(_0x77d00e,null));};exports[_0xa522('0x43')]=function(_0x22d9fb,_0x274121){return db['Cdr'][_0xa522('0x43')](_0x22d9fb[_0xa522('0x44')],{})[_0xa522('0x21')](respondWithResult(_0x274121,0xc9))[_0xa522('0x3f')](handleError(_0x274121,null));};exports['update']=function(_0x4363dd,_0x3881af){if(_0x4363dd[_0xa522('0x44')]['id']){delete _0x4363dd[_0xa522('0x44')]['id'];}return db[_0xa522('0x27')]['find']({'where':{'id':_0x4363dd[_0xa522('0x45')]['id']}})[_0xa522('0x21')](handleEntityNotFound(_0x3881af,null))['then'](saveUpdates(_0x4363dd[_0xa522('0x44')],null))[_0xa522('0x21')](respondWithResult(_0x3881af,null))['catch'](handleError(_0x3881af,null));};exports[_0xa522('0x22')]=function(_0x2efd68,_0x3c4cee){return db[_0xa522('0x27')][_0xa522('0x42')]({'where':{'id':_0x2efd68[_0xa522('0x45')]['id']}})[_0xa522('0x21')](handleEntityNotFound(_0x3c4cee,null))[_0xa522('0x21')](removeEntity(_0x3c4cee,null))['catch'](handleError(_0x3c4cee,null));};exports['describe']=function(_0x4e9e08,_0x5bfba8){return db[_0xa522('0x27')]['describe']()['then'](respondWithResult(_0x5bfba8,null))[_0xa522('0x3f')](handleError(_0x5bfba8,null));}; \ No newline at end of file +var _0xeaa4=['lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','Cdr','includeAll','findAll','rows','catch','show','rawAttributes','include','options','find','create','body','params','describe','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeaa4,0xe3));var _0x4eaa=function(_0x1c4a20,_0x1ae235){_0x1c4a20=_0x1c4a20-0x0;var _0x266df4=_0xeaa4[_0x1c4a20];return _0x266df4;};'use strict';var pdf=require(_0x4eaa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4eaa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4eaa('0x2'));var moment=require(_0x4eaa('0x3'));var BPromise=require(_0x4eaa('0x4'));var Mustache=require(_0x4eaa('0x5'));var util=require(_0x4eaa('0x6'));var path=require(_0x4eaa('0x7'));var sox=require(_0x4eaa('0x8'));var csv=require('to-csv');var ejs=require(_0x4eaa('0x9'));var fs=require('fs');var _=require(_0x4eaa('0xa'));var squel=require(_0x4eaa('0xb'));var crypto=require(_0x4eaa('0xc'));var jsforce=require(_0x4eaa('0xd'));var deskjs=require(_0x4eaa('0xe'));var toCsv=require(_0x4eaa('0xf'));var querystring=require('querystring');var Papa=require(_0x4eaa('0x10'));var Redis=require(_0x4eaa('0x11'));var authService=require(_0x4eaa('0x12'));var qs=require(_0x4eaa('0x13'));var as=require(_0x4eaa('0x14'));var hardwareService=require(_0x4eaa('0x15'));var logger=require(_0x4eaa('0x16'))(_0x4eaa('0x17'));var utils=require(_0x4eaa('0x18'));var config=require('../../config/environment');var db=require(_0x4eaa('0x19'))['db'];function respondWithStatusCode(_0x216e95,_0x4ae984){_0x4ae984=_0x4ae984||0xcc;return function(_0x5adb4d){if(_0x5adb4d){return _0x216e95[_0x4eaa('0x1a')](_0x4ae984);}return _0x216e95[_0x4eaa('0x1b')](_0x4ae984)[_0x4eaa('0x1c')]();};}function respondWithResult(_0x233277,_0xdab390){_0xdab390=_0xdab390||0xc8;return function(_0x5c72e9){if(_0x5c72e9){return _0x233277[_0x4eaa('0x1b')](_0xdab390)[_0x4eaa('0x1d')](_0x5c72e9);}};}function respondWithFilteredResult(_0x3b5409,_0x3e07aa){return function(_0x1d7977){if(_0x1d7977){var _0x540875=_0x1d7977[_0x4eaa('0x1e')],_0x4f2507=_0x3e07aa[_0x4eaa('0x1f')],_0x3b3cbb=_0x3e07aa['offset']+_0x3e07aa['limit'],_0x819232;if(_0x3b3cbb>=_0x540875){_0x3b3cbb=_0x540875;_0x819232=0xc8;}else{_0x819232=0xce;}_0x3b5409[_0x4eaa('0x1b')](_0x819232);return _0x3b5409[_0x4eaa('0x20')](_0x4eaa('0x21'),_0x4f2507+'-'+_0x3b3cbb+'/'+_0x540875)[_0x4eaa('0x1d')](_0x1d7977);}return null;};}function patchUpdates(_0x5b3331){return function(_0x4b7e55){try{jsonpatch[_0x4eaa('0x22')](_0x4b7e55,_0x5b3331,!![]);}catch(_0x42d5b8){return BPromise[_0x4eaa('0x23')](_0x42d5b8);}return _0x4b7e55[_0x4eaa('0x24')]();};}function saveUpdates(_0x5e9c0c,_0x2065ae){return function(_0x8db1c1){if(_0x8db1c1){return _0x8db1c1[_0x4eaa('0x25')](_0x5e9c0c)[_0x4eaa('0x26')](function(_0x56f7db){return _0x56f7db;});}return null;};}function removeEntity(_0x5abf64,_0x974dd2){return function(_0x53d96f){if(_0x53d96f){return _0x53d96f[_0x4eaa('0x27')]()[_0x4eaa('0x26')](function(){_0x5abf64['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fdf82,_0x95c1a8){return function(_0x5e6125){if(!_0x5e6125){_0x1fdf82[_0x4eaa('0x1a')](0x194);}return _0x5e6125;};}function handleError(_0x1499ff,_0x397582){_0x397582=_0x397582||0x1f4;return function(_0x2d067d){logger[_0x4eaa('0x28')](_0x2d067d[_0x4eaa('0x29')]);if(_0x2d067d['name']){delete _0x2d067d[_0x4eaa('0x2a')];}_0x1499ff[_0x4eaa('0x1b')](_0x397582)[_0x4eaa('0x2b')](_0x2d067d);};}exports[_0x4eaa('0x2c')]=function(_0x6d4b0a,_0x1b199b){var _0x13c5b0={},_0x2e23d7={},_0x43b49a={'count':0x0,'rows':[]};var _0x1743ea=_['map'](db['Cdr']['rawAttributes'],function(_0x10dd42){return{'name':_0x10dd42[_0x4eaa('0x2d')],'type':_0x10dd42[_0x4eaa('0x2e')][_0x4eaa('0x2f')]};});_0x2e23d7[_0x4eaa('0x30')]=_[_0x4eaa('0x31')](_0x1743ea,_0x4eaa('0x2a'));_0x2e23d7[_0x4eaa('0x32')]=_[_0x4eaa('0x33')](_0x6d4b0a[_0x4eaa('0x32')]);_0x2e23d7[_0x4eaa('0x34')]=_['intersection'](_0x2e23d7[_0x4eaa('0x30')],_0x2e23d7[_0x4eaa('0x32')]);_0x13c5b0[_0x4eaa('0x35')]=_[_0x4eaa('0x36')](_0x2e23d7[_0x4eaa('0x30')],qs[_0x4eaa('0x37')](_0x6d4b0a[_0x4eaa('0x32')][_0x4eaa('0x37')]));_0x13c5b0['attributes']=_0x13c5b0[_0x4eaa('0x35')][_0x4eaa('0x38')]?_0x13c5b0[_0x4eaa('0x35')]:_0x2e23d7[_0x4eaa('0x30')];if(!_0x6d4b0a['query']['hasOwnProperty'](_0x4eaa('0x39'))){_0x13c5b0[_0x4eaa('0x3a')]=qs[_0x4eaa('0x3a')](_0x6d4b0a[_0x4eaa('0x32')][_0x4eaa('0x3a')]);_0x13c5b0['offset']=qs[_0x4eaa('0x1f')](_0x6d4b0a['query'][_0x4eaa('0x1f')]);}_0x13c5b0[_0x4eaa('0x3b')]=qs['sort'](_0x6d4b0a[_0x4eaa('0x32')][_0x4eaa('0x3c')]);_0x13c5b0[_0x4eaa('0x3d')]=qs[_0x4eaa('0x34')](_['pick'](_0x6d4b0a[_0x4eaa('0x32')],_0x2e23d7['filters']),_0x1743ea);if(_0x6d4b0a[_0x4eaa('0x32')][_0x4eaa('0x3e')]){_0x13c5b0['where']=_[_0x4eaa('0x3f')](_0x13c5b0['where'],{'$or':_[_0x4eaa('0x31')](_0x1743ea,function(_0x1bf542){if(_0x1bf542[_0x4eaa('0x2e')]!==_0x4eaa('0x40')){var _0x3b0f33={};_0x3b0f33[_0x1bf542['name']]={'$like':'%'+_0x6d4b0a[_0x4eaa('0x32')][_0x4eaa('0x3e')]+'%'};return _0x3b0f33;}})});}_0x13c5b0=_['merge']({},_0x13c5b0,_0x6d4b0a['options']);var _0x356ea8={'where':_0x13c5b0[_0x4eaa('0x3d')]};return db[_0x4eaa('0x41')]['count'](_0x356ea8)['then'](function(_0x27689a){_0x43b49a['count']=_0x27689a;if(_0x6d4b0a[_0x4eaa('0x32')][_0x4eaa('0x42')]){_0x13c5b0['include']=[{'all':!![]}];}return db[_0x4eaa('0x41')][_0x4eaa('0x43')](_0x13c5b0);})['then'](function(_0x228dd5){_0x43b49a[_0x4eaa('0x44')]=_0x228dd5;return _0x43b49a;})[_0x4eaa('0x26')](respondWithFilteredResult(_0x1b199b,_0x13c5b0))[_0x4eaa('0x45')](handleError(_0x1b199b,null));};exports[_0x4eaa('0x46')]=function(_0x2c0ad5,_0x356e86){var _0x2334bb={'raw':!![],'where':{'id':_0x2c0ad5['params']['id']}},_0x4482a0={};_0x4482a0[_0x4eaa('0x30')]=_['keys'](db['Cdr'][_0x4eaa('0x47')]);_0x4482a0[_0x4eaa('0x32')]=_['keys'](_0x2c0ad5[_0x4eaa('0x32')]);_0x4482a0[_0x4eaa('0x34')]=_[_0x4eaa('0x36')](_0x4482a0['model'],_0x4482a0['query']);_0x2334bb['attributes']=_[_0x4eaa('0x36')](_0x4482a0[_0x4eaa('0x30')],qs['fields'](_0x2c0ad5['query'][_0x4eaa('0x37')]));_0x2334bb[_0x4eaa('0x35')]=_0x2334bb[_0x4eaa('0x35')][_0x4eaa('0x38')]?_0x2334bb[_0x4eaa('0x35')]:_0x4482a0['model'];if(_0x2c0ad5[_0x4eaa('0x32')][_0x4eaa('0x42')]){_0x2334bb[_0x4eaa('0x48')]=[{'all':!![]}];}_0x2334bb=_['merge']({},_0x2334bb,_0x2c0ad5[_0x4eaa('0x49')]);return db[_0x4eaa('0x41')][_0x4eaa('0x4a')](_0x2334bb)['then'](handleEntityNotFound(_0x356e86,null))['then'](respondWithResult(_0x356e86,null))[_0x4eaa('0x45')](handleError(_0x356e86,null));};exports[_0x4eaa('0x4b')]=function(_0x463fb,_0x1a6908){return db['Cdr'][_0x4eaa('0x4b')](_0x463fb[_0x4eaa('0x4c')],{})[_0x4eaa('0x26')](respondWithResult(_0x1a6908,0xc9))['catch'](handleError(_0x1a6908,null));};exports['update']=function(_0x225bb6,_0x2a6ef0){if(_0x225bb6[_0x4eaa('0x4c')]['id']){delete _0x225bb6[_0x4eaa('0x4c')]['id'];}return db[_0x4eaa('0x41')]['find']({'where':{'id':_0x225bb6[_0x4eaa('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2a6ef0,null))[_0x4eaa('0x26')](saveUpdates(_0x225bb6['body'],null))['then'](respondWithResult(_0x2a6ef0,null))[_0x4eaa('0x45')](handleError(_0x2a6ef0,null));};exports[_0x4eaa('0x27')]=function(_0x10eff2,_0x2a0af3){return db[_0x4eaa('0x41')][_0x4eaa('0x4a')]({'where':{'id':_0x10eff2[_0x4eaa('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2a0af3,null))[_0x4eaa('0x26')](removeEntity(_0x2a0af3,null))[_0x4eaa('0x45')](handleError(_0x2a0af3,null));};exports[_0x4eaa('0x4e')]=function(_0xfe18b,_0x49a349){return db[_0x4eaa('0x41')][_0x4eaa('0x4e')]()['then'](respondWithResult(_0x49a349,null))[_0x4eaa('0x45')](handleError(_0x49a349,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index bfb2714..73441c8 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 _0x3283=['../../config/environment','./cdr.attributes','define','accountcode','calldate','dst','src','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x45a54c,_0x322290){var _0x2987de=function(_0x3b484d){while(--_0x3b484d){_0x45a54c['push'](_0x45a54c['shift']());}};_0x2987de(++_0x322290);}(_0x3283,0x152));var _0x3328=function(_0x2bb7a8,_0x4449c6){_0x2bb7a8=_0x2bb7a8-0x0;var _0x636204=_0x3283[_0x2bb7a8];return _0x636204;};'use strict';var _=require(_0x3328('0x0'));var util=require(_0x3328('0x1'));var logger=require('../../config/logger')(_0x3328('0x2'));var moment=require(_0x3328('0x3'));var BPromise=require(_0x3328('0x4'));var rp=require(_0x3328('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3328('0x6'));var config=require(_0x3328('0x7'));var attributes=require(_0x3328('0x8'));module['exports']=function(_0x5dac21,_0xee7cf3){return _0x5dac21[_0x3328('0x9')]('Cdr',attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x3328('0xa'),'fields':[_0x3328('0xa')]},{'name':_0x3328('0xb'),'fields':[_0x3328('0xb')]},{'name':'disposition','fields':['disposition']},{'name':_0x3328('0xc'),'fields':['dst']},{'name':_0x3328('0xd'),'fields':[_0x3328('0xd')]},{'name':'uniqueid','fields':[_0x3328('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0xcc27=['exports','define','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','util','../../config/logger','api','request-promise','../../config/environment','./cdr.attributes'];(function(_0x48ef12,_0x163ce8){var _0x427d62=function(_0x5092c8){while(--_0x5092c8){_0x48ef12['push'](_0x48ef12['shift']());}};_0x427d62(++_0x163ce8);}(_0xcc27,0x1a9));var _0x7cc2=function(_0x17d18a,_0x289108){_0x17d18a=_0x17d18a-0x0;var _0x18d146=_0xcc27[_0x17d18a];return _0x18d146;};'use strict';var _=require(_0x7cc2('0x0'));var util=require(_0x7cc2('0x1'));var logger=require(_0x7cc2('0x2'))(_0x7cc2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7cc2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7cc2('0x5'));var attributes=require(_0x7cc2('0x6'));module[_0x7cc2('0x7')]=function(_0x50067c,_0x149bdb){return _0x50067c[_0x7cc2('0x8')]('Cdr',attributes,{'tableName':_0x7cc2('0x9'),'paranoid':![],'indexes':[{'name':_0x7cc2('0xa'),'fields':['accountcode']},{'name':_0x7cc2('0xb'),'fields':[_0x7cc2('0xb')]},{'name':_0x7cc2('0xc'),'fields':[_0x7cc2('0xc')]},{'name':_0x7cc2('0xd'),'fields':[_0x7cc2('0xd')]},{'name':_0x7cc2('0xe'),'fields':[_0x7cc2('0xe')]},{'name':_0x7cc2('0xf'),'fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index feb3c1b..50bd5f5 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 _0xb9f2=['client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','Cdr,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x2d9e27,_0x5965b2){var _0xd35381=function(_0x343d18){while(--_0x343d18){_0x2d9e27['push'](_0x2d9e27['shift']());}};_0xd35381(++_0x5965b2);}(_0xb9f2,0x1dc));var _0x2b9f=function(_0x1ca59f,_0x3d3ea8){_0x1ca59f=_0x1ca59f-0x0;var _0x4033d9=_0xb9f2[_0x1ca59f];return _0x4033d9;};'use strict';var _=require(_0x2b9f('0x0'));var util=require(_0x2b9f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2b9f('0x2'));var fs=require('fs');var Redis=require(_0x2b9f('0x3'));var db=require(_0x2b9f('0x4'))['db'];var utils=require(_0x2b9f('0x5'));var logger=require(_0x2b9f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2b9f('0x7'));var client=jayson[_0x2b9f('0x8')][_0x2b9f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x220935,_0xe0bb77,_0x4b20b3){return new BPromise(function(_0x5afc2c,_0x453cd1){return client[_0x2b9f('0xa')](_0x220935,_0x4b20b3)[_0x2b9f('0xb')](function(_0xc883a7){logger[_0x2b9f('0xc')]('Cdr,\x20%s,\x20%s',_0xe0bb77,_0x2b9f('0xd'));logger[_0x2b9f('0xe')](_0x2b9f('0xf'),_0xe0bb77,_0x2b9f('0xd'),JSON[_0x2b9f('0x10')](_0xc883a7));if(_0xc883a7['error']){if(_0xc883a7[_0x2b9f('0x11')]['code']===0x1f4){logger['error'](_0x2b9f('0x12'),_0xe0bb77,_0xc883a7['error']['message']);return _0x453cd1(_0xc883a7[_0x2b9f('0x11')]['message']);}logger[_0x2b9f('0x11')](_0x2b9f('0x12'),_0xe0bb77,_0xc883a7[_0x2b9f('0x11')][_0x2b9f('0x13')]);return _0x5afc2c(_0xc883a7[_0x2b9f('0x11')]['message']);}else{logger[_0x2b9f('0xc')](_0x2b9f('0x12'),_0xe0bb77,_0x2b9f('0xd'));_0x5afc2c(_0xc883a7[_0x2b9f('0x14')][_0x2b9f('0x13')]);}})[_0x2b9f('0x15')](function(_0x48b6f4){logger['error'](_0x2b9f('0x12'),_0xe0bb77,_0x48b6f4);_0x453cd1(_0x48b6f4);});});} \ No newline at end of file +var _0xa5bf=['catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x17bef5,_0x2df330){var _0x10e7a4=function(_0x1e1b75){while(--_0x1e1b75){_0x17bef5['push'](_0x17bef5['shift']());}};_0x10e7a4(++_0x2df330);}(_0xa5bf,0x1e1));var _0xfa5b=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa5bf[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0xfa5b('0x0'));var util=require('util');var moment=require(_0xfa5b('0x1'));var BPromise=require('bluebird');var rs=require(_0xfa5b('0x2'));var fs=require('fs');var Redis=require(_0xfa5b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa5b('0x4'));var logger=require(_0xfa5b('0x5'))(_0xfa5b('0x6'));var config=require(_0xfa5b('0x7'));var jayson=require(_0xfa5b('0x8'));var client=jayson[_0xfa5b('0x9')][_0xfa5b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed185,_0x4a7af3,_0x979994){return new BPromise(function(_0x5e965e,_0x4ca788){return client[_0xfa5b('0xb')](_0x5ed185,_0x979994)['then'](function(_0x341baf){logger[_0xfa5b('0xc')](_0xfa5b('0xd'),_0x4a7af3,_0xfa5b('0xe'));logger['debug'](_0xfa5b('0xf'),_0x4a7af3,_0xfa5b('0xe'),JSON['stringify'](_0x341baf));if(_0x341baf[_0xfa5b('0x10')]){if(_0x341baf['error']['code']===0x1f4){logger[_0xfa5b('0x10')](_0xfa5b('0xd'),_0x4a7af3,_0x341baf[_0xfa5b('0x10')][_0xfa5b('0x11')]);return _0x4ca788(_0x341baf[_0xfa5b('0x10')][_0xfa5b('0x11')]);}logger['error']('Cdr,\x20%s,\x20%s',_0x4a7af3,_0x341baf[_0xfa5b('0x10')][_0xfa5b('0x11')]);return _0x5e965e(_0x341baf['error'][_0xfa5b('0x11')]);}else{logger['info'](_0xfa5b('0xd'),_0x4a7af3,'request\x20sent');_0x5e965e(_0x341baf[_0xfa5b('0x12')]['message']);}})[_0xfa5b('0x13')](function(_0xa36019){logger[_0xfa5b('0x10')]('Cdr,\x20%s,\x20%s',_0x4a7af3,_0xa36019);_0x4ca788(_0xa36019);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index cac54cc..715f3d0 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 _0x0a6e=['index','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated'];(function(_0x466f51,_0x1393ed){var _0x2db305=function(_0x126ae3){while(--_0x126ae3){_0x466f51['push'](_0x466f51['shift']());}};_0x2db305(++_0x1393ed);}(_0x0a6e,0x1a1));var _0xe0a6=function(_0x1a37c0,_0x1383a9){_0x1a37c0=_0x1a37c0-0x0;var _0xec7119=_0x0a6e[_0x1a37c0];return _0xec7119;};'use strict';var multer=require(_0xe0a6('0x0'));var util=require(_0xe0a6('0x1'));var path=require(_0xe0a6('0x2'));var timeout=require(_0xe0a6('0x3'));var express=require('express');var router=express[_0xe0a6('0x4')]();var auth=require(_0xe0a6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cdr.controller');router[_0xe0a6('0x6')]('/',auth[_0xe0a6('0x7')](),controller[_0xe0a6('0x8')]);router[_0xe0a6('0x6')]('/describe',auth[_0xe0a6('0x7')](),controller[_0xe0a6('0x9')]);router[_0xe0a6('0x6')](_0xe0a6('0xa'),auth[_0xe0a6('0x7')](),controller[_0xe0a6('0xb')]);router[_0xe0a6('0xc')]('/',auth[_0xe0a6('0x7')](),controller['create']);router[_0xe0a6('0xd')](_0xe0a6('0xa'),auth[_0xe0a6('0x7')](),controller[_0xe0a6('0xe')]);router['delete'](_0xe0a6('0xa'),auth[_0xe0a6('0x7')](),controller[_0xe0a6('0xf')]);module[_0xe0a6('0x10')]=router; \ No newline at end of file +var _0xd452=['show','post','create','update','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./cdr.controller','get','isAuthenticated','/:id'];(function(_0x180bcf,_0x23fb62){var _0x3d98c9=function(_0x1c9611){while(--_0x1c9611){_0x180bcf['push'](_0x180bcf['shift']());}};_0x3d98c9(++_0x23fb62);}(_0xd452,0x1c6));var _0x2d45=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xd452[_0x2d91c6];return _0x3a8d19;};'use strict';var multer=require('multer');var util=require(_0x2d45('0x0'));var path=require(_0x2d45('0x1'));var timeout=require('connect-timeout');var express=require(_0x2d45('0x2'));var router=express[_0x2d45('0x3')]();var auth=require(_0x2d45('0x4'));var interaction=require(_0x2d45('0x5'));var config=require('../../config/environment');var controller=require(_0x2d45('0x6'));router[_0x2d45('0x7')]('/',auth[_0x2d45('0x8')](),controller['index']);router['get']('/describe',auth[_0x2d45('0x8')](),controller['describe']);router[_0x2d45('0x7')](_0x2d45('0x9'),auth[_0x2d45('0x8')](),controller[_0x2d45('0xa')]);router[_0x2d45('0xb')]('/',auth['isAuthenticated'](),controller[_0x2d45('0xc')]);router['put'](_0x2d45('0x9'),auth['isAuthenticated'](),controller[_0x2d45('0xd')]);router['delete'](_0x2d45('0x9'),auth[_0x2d45('0x8')](),controller[_0x2d45('0xe')]);module[_0x2d45('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 65cf99b..93ec300 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 _0x74f6=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x4d887a,_0x3b05ab){var _0x5289ca=function(_0x5935b1){while(--_0x5935b1){_0x4d887a['push'](_0x4d887a['shift']());}};_0x5289ca(++_0x3b05ab);}(_0x74f6,0x7f));var _0x674f=function(_0x19bc76,_0x185078){_0x19bc76=_0x19bc76-0x0;var _0x47bc39=_0x74f6[_0x19bc76];return _0x47bc39;};'use strict';var Sequelize=require(_0x674f('0x0'));module[_0x674f('0x1')]={'priority':{'type':Sequelize[_0x674f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x674f('0x3')],'allowNull':![],'defaultValue':_0x674f('0x4')},'appdata':{'type':Sequelize[_0x674f('0x5')]()},'description':{'type':Sequelize[_0x674f('0x3')]},'interval':{'type':Sequelize[_0x674f('0x3')],'defaultValue':_0x674f('0x6')}}; \ No newline at end of file +var _0x09e7=['STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x4818f1,_0x30f131){var _0x262bbc=function(_0x49f7d6){while(--_0x49f7d6){_0x4818f1['push'](_0x4818f1['shift']());}};_0x262bbc(++_0x30f131);}(_0x09e7,0x18d));var _0x709e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x09e7[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x709e('0x0'));module[_0x709e('0x1')]={'priority':{'type':Sequelize[_0x709e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x709e('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x709e('0x3')],'defaultValue':_0x709e('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 13dcf4c..9d61c2c 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 _0xea6b=['apply','reject','save','update','then','destroy','stack','name','send','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','ChatApplication','find','catch','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','set','Content-Range'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xea6b,0xff));var _0xbea6=function(_0x25a771,_0x13026e){_0x25a771=_0x25a771-0x0;var _0x303806=_0xea6b[_0x25a771];return _0x303806;};'use strict';var pdf=require(_0xbea6('0x0'));var emlformat=require(_0xbea6('0x1'));var rimraf=require(_0xbea6('0x2'));var zipdir=require(_0xbea6('0x3'));var jsonpatch=require(_0xbea6('0x4'));var rp=require(_0xbea6('0x5'));var moment=require(_0xbea6('0x6'));var BPromise=require(_0xbea6('0x7'));var Mustache=require(_0xbea6('0x8'));var util=require(_0xbea6('0x9'));var path=require(_0xbea6('0xa'));var sox=require('sox');var csv=require(_0xbea6('0xb'));var ejs=require(_0xbea6('0xc'));var fs=require('fs');var _=require(_0xbea6('0xd'));var squel=require('squel');var crypto=require(_0xbea6('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbea6('0xb'));var querystring=require(_0xbea6('0xf'));var Papa=require(_0xbea6('0x10'));var Redis=require(_0xbea6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbea6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbea6('0x13'))(_0xbea6('0x14'));var utils=require(_0xbea6('0x15'));var config=require('../../config/environment');var db=require(_0xbea6('0x16'))['db'];function respondWithStatusCode(_0x5968ef,_0x2403ba){_0x2403ba=_0x2403ba||0xcc;return function(_0x373b95){if(_0x373b95){return _0x5968ef['sendStatus'](_0x2403ba);}return _0x5968ef[_0xbea6('0x17')](_0x2403ba)[_0xbea6('0x18')]();};}function respondWithResult(_0x2af2ff,_0x13c8fc){_0x13c8fc=_0x13c8fc||0xc8;return function(_0x2b8251){if(_0x2b8251){return _0x2af2ff[_0xbea6('0x17')](_0x13c8fc)[_0xbea6('0x19')](_0x2b8251);}};}function respondWithFilteredResult(_0x294254,_0xa1ff52){return function(_0x572010){if(_0x572010){var _0x46624c=_0x572010[_0xbea6('0x1a')],_0xc721d3=_0xa1ff52[_0xbea6('0x1b')],_0x757a7=_0xa1ff52['offset']+_0xa1ff52['limit'],_0xf65fd0;if(_0x757a7>=_0x46624c){_0x757a7=_0x46624c;_0xf65fd0=0xc8;}else{_0xf65fd0=0xce;}_0x294254[_0xbea6('0x17')](_0xf65fd0);return _0x294254[_0xbea6('0x1c')](_0xbea6('0x1d'),_0xc721d3+'-'+_0x757a7+'/'+_0x46624c)[_0xbea6('0x19')](_0x572010);}return null;};}function patchUpdates(_0xaec34f){return function(_0xed5bb2){try{jsonpatch[_0xbea6('0x1e')](_0xed5bb2,_0xaec34f,!![]);}catch(_0x32fe95){return BPromise[_0xbea6('0x1f')](_0x32fe95);}return _0xed5bb2[_0xbea6('0x20')]();};}function saveUpdates(_0x32f4f8,_0xfda0b1){return function(_0x32a21e){if(_0x32a21e){return _0x32a21e[_0xbea6('0x21')](_0x32f4f8)[_0xbea6('0x22')](function(_0x1aef92){return _0x1aef92;});}return null;};}function removeEntity(_0x27005a,_0x387a7d){return function(_0x34f434){if(_0x34f434){return _0x34f434[_0xbea6('0x23')]()[_0xbea6('0x22')](function(){_0x27005a[_0xbea6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15bc1c,_0x12ebff){return function(_0x3489bb){if(!_0x3489bb){_0x15bc1c['sendStatus'](0x194);}return _0x3489bb;};}function handleError(_0x35c0cc,_0x4a2791){_0x4a2791=_0x4a2791||0x1f4;return function(_0x36148d){logger['error'](_0x36148d[_0xbea6('0x24')]);if(_0x36148d[_0xbea6('0x25')]){delete _0x36148d[_0xbea6('0x25')];}_0x35c0cc[_0xbea6('0x17')](_0x4a2791)[_0xbea6('0x26')](_0x36148d);};}exports['show']=function(_0x224ffc,_0x5810d3){var _0xab6cae={'raw':!![],'where':{'id':_0x224ffc['params']['id']}},_0x376de6={};_0x376de6[_0xbea6('0x27')]=_[_0xbea6('0x28')](db['ChatApplication'][_0xbea6('0x29')]);_0x376de6[_0xbea6('0x2a')]=_[_0xbea6('0x28')](_0x224ffc[_0xbea6('0x2a')]);_0x376de6[_0xbea6('0x2b')]=_[_0xbea6('0x2c')](_0x376de6[_0xbea6('0x27')],_0x376de6['query']);_0xab6cae[_0xbea6('0x2d')]=_[_0xbea6('0x2c')](_0x376de6[_0xbea6('0x27')],qs[_0xbea6('0x2e')](_0x224ffc[_0xbea6('0x2a')]['fields']));_0xab6cae[_0xbea6('0x2d')]=_0xab6cae[_0xbea6('0x2d')][_0xbea6('0x2f')]?_0xab6cae[_0xbea6('0x2d')]:_0x376de6[_0xbea6('0x27')];if(_0x224ffc[_0xbea6('0x2a')][_0xbea6('0x30')]){_0xab6cae[_0xbea6('0x31')]=[{'all':!![]}];}_0xab6cae=_[_0xbea6('0x32')]({},_0xab6cae,_0x224ffc[_0xbea6('0x33')]);return db[_0xbea6('0x34')][_0xbea6('0x35')](_0xab6cae)[_0xbea6('0x22')](handleEntityNotFound(_0x5810d3,null))[_0xbea6('0x22')](respondWithResult(_0x5810d3,null))[_0xbea6('0x36')](handleError(_0x5810d3,null));};exports[_0xbea6('0x21')]=function(_0x3a9ac8,_0xb8e3c0){if(_0x3a9ac8['body']['id']){delete _0x3a9ac8[_0xbea6('0x37')]['id'];}return db[_0xbea6('0x34')][_0xbea6('0x35')]({'where':{'id':_0x3a9ac8[_0xbea6('0x38')]['id']}})['then'](handleEntityNotFound(_0xb8e3c0,null))[_0xbea6('0x22')](saveUpdates(_0x3a9ac8['body'],null))['then'](respondWithResult(_0xb8e3c0,null))[_0xbea6('0x36')](handleError(_0xb8e3c0,null));};exports[_0xbea6('0x23')]=function(_0x206a51,_0x144dcb){return db['ChatApplication'][_0xbea6('0x35')]({'where':{'id':_0x206a51[_0xbea6('0x38')]['id']}})[_0xbea6('0x22')](handleEntityNotFound(_0x144dcb,null))[_0xbea6('0x22')](removeEntity(_0x144dcb,null))[_0xbea6('0x36')](handleError(_0x144dcb,null));}; \ No newline at end of file +var _0x33d5=['then','destroy','error','stack','name','send','show','ChatApplication','query','filters','intersection','model','attributes','fields','length','includeAll','options','find','catch','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','json','apply','save','update'];(function(_0x5016c9,_0x57cdf0){var _0x5371ee=function(_0x494af9){while(--_0x494af9){_0x5016c9['push'](_0x5016c9['shift']());}};_0x5371ee(++_0x57cdf0);}(_0x33d5,0x114));var _0x533d=function(_0x41a45d,_0x1e61c3){_0x41a45d=_0x41a45d-0x0;var _0x24b1d6=_0x33d5[_0x41a45d];return _0x24b1d6;};'use strict';var pdf=require(_0x533d('0x0'));var emlformat=require(_0x533d('0x1'));var rimraf=require(_0x533d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x533d('0x3'));var rp=require(_0x533d('0x4'));var moment=require('moment');var BPromise=require(_0x533d('0x5'));var Mustache=require(_0x533d('0x6'));var util=require('util');var path=require(_0x533d('0x7'));var sox=require(_0x533d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x533d('0x9'));var squel=require(_0x533d('0xa'));var crypto=require('crypto');var jsforce=require(_0x533d('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x533d('0xc'));var Papa=require(_0x533d('0xd'));var Redis=require(_0x533d('0xe'));var authService=require(_0x533d('0xf'));var qs=require(_0x533d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x533d('0x11'));var logger=require('../../config/logger')(_0x533d('0x12'));var utils=require(_0x533d('0x13'));var config=require(_0x533d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b23a7,_0x5ab027){_0x5ab027=_0x5ab027||0xcc;return function(_0x1c8b5d){if(_0x1c8b5d){return _0x5b23a7[_0x533d('0x15')](_0x5ab027);}return _0x5b23a7[_0x533d('0x16')](_0x5ab027)[_0x533d('0x17')]();};}function respondWithResult(_0x4516c1,_0x2c2d2c){_0x2c2d2c=_0x2c2d2c||0xc8;return function(_0x537f67){if(_0x537f67){return _0x4516c1['status'](_0x2c2d2c)['json'](_0x537f67);}};}function respondWithFilteredResult(_0x47f3d9,_0x3ae061){return function(_0x269751){if(_0x269751){var _0x1c344c=_0x269751[_0x533d('0x18')],_0x29b9b9=_0x3ae061[_0x533d('0x19')],_0x515430=_0x3ae061[_0x533d('0x19')]+_0x3ae061['limit'],_0x17e237;if(_0x515430>=_0x1c344c){_0x515430=_0x1c344c;_0x17e237=0xc8;}else{_0x17e237=0xce;}_0x47f3d9[_0x533d('0x16')](_0x17e237);return _0x47f3d9['set']('Content-Range',_0x29b9b9+'-'+_0x515430+'/'+_0x1c344c)[_0x533d('0x1a')](_0x269751);}return null;};}function patchUpdates(_0x2a8488){return function(_0x24c1cf){try{jsonpatch[_0x533d('0x1b')](_0x24c1cf,_0x2a8488,!![]);}catch(_0x322020){return BPromise['reject'](_0x322020);}return _0x24c1cf[_0x533d('0x1c')]();};}function saveUpdates(_0x356122,_0x3e3053){return function(_0x339de5){if(_0x339de5){return _0x339de5[_0x533d('0x1d')](_0x356122)[_0x533d('0x1e')](function(_0x12d091){return _0x12d091;});}return null;};}function removeEntity(_0x166a2d,_0x2fbf9f){return function(_0x364bad){if(_0x364bad){return _0x364bad[_0x533d('0x1f')]()['then'](function(){_0x166a2d[_0x533d('0x16')](0xcc)[_0x533d('0x17')]();});}};}function handleEntityNotFound(_0x3e9803,_0x19e0f9){return function(_0xaf1b20){if(!_0xaf1b20){_0x3e9803[_0x533d('0x15')](0x194);}return _0xaf1b20;};}function handleError(_0x5c6d7f,_0x2aeef7){_0x2aeef7=_0x2aeef7||0x1f4;return function(_0x4db52a){logger[_0x533d('0x20')](_0x4db52a[_0x533d('0x21')]);if(_0x4db52a[_0x533d('0x22')]){delete _0x4db52a['name'];}_0x5c6d7f[_0x533d('0x16')](_0x2aeef7)[_0x533d('0x23')](_0x4db52a);};}exports[_0x533d('0x24')]=function(_0x30b112,_0x7a1699){var _0x12bd67={'raw':!![],'where':{'id':_0x30b112['params']['id']}},_0x3c8972={};_0x3c8972['model']=_['keys'](db[_0x533d('0x25')]['rawAttributes']);_0x3c8972[_0x533d('0x26')]=_['keys'](_0x30b112[_0x533d('0x26')]);_0x3c8972[_0x533d('0x27')]=_[_0x533d('0x28')](_0x3c8972[_0x533d('0x29')],_0x3c8972[_0x533d('0x26')]);_0x12bd67[_0x533d('0x2a')]=_[_0x533d('0x28')](_0x3c8972[_0x533d('0x29')],qs[_0x533d('0x2b')](_0x30b112[_0x533d('0x26')][_0x533d('0x2b')]));_0x12bd67[_0x533d('0x2a')]=_0x12bd67[_0x533d('0x2a')][_0x533d('0x2c')]?_0x12bd67[_0x533d('0x2a')]:_0x3c8972['model'];if(_0x30b112[_0x533d('0x26')][_0x533d('0x2d')]){_0x12bd67['include']=[{'all':!![]}];}_0x12bd67=_['merge']({},_0x12bd67,_0x30b112[_0x533d('0x2e')]);return db[_0x533d('0x25')][_0x533d('0x2f')](_0x12bd67)[_0x533d('0x1e')](handleEntityNotFound(_0x7a1699,null))[_0x533d('0x1e')](respondWithResult(_0x7a1699,null))[_0x533d('0x30')](handleError(_0x7a1699,null));};exports[_0x533d('0x1d')]=function(_0x41d020,_0x47ec21){if(_0x41d020[_0x533d('0x31')]['id']){delete _0x41d020[_0x533d('0x31')]['id'];}return db[_0x533d('0x25')][_0x533d('0x2f')]({'where':{'id':_0x41d020[_0x533d('0x32')]['id']}})['then'](handleEntityNotFound(_0x47ec21,null))[_0x533d('0x1e')](saveUpdates(_0x41d020[_0x533d('0x31')],null))[_0x533d('0x1e')](respondWithResult(_0x47ec21,null))[_0x533d('0x30')](handleError(_0x47ec21,null));};exports[_0x533d('0x1f')]=function(_0x53f55d,_0x38df87){return db['ChatApplication'][_0x533d('0x2f')]({'where':{'id':_0x53f55d[_0x533d('0x32')]['id']}})[_0x533d('0x1e')](handleEntityNotFound(_0x38df87,null))['then'](removeEntity(_0x38df87,null))['catch'](handleError(_0x38df87,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9d0dedc..f88da99 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 _0x7cf5=['moment','bluebird','request-promise','../../config/environment','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x3c34a8,_0x11ab31){var _0x51d18a=function(_0x7ccab8){while(--_0x7ccab8){_0x3c34a8['push'](_0x3c34a8['shift']());}};_0x51d18a(++_0x11ab31);}(_0x7cf5,0xb2));var _0x57cf=function(_0x7454d6,_0x6a4367){_0x7454d6=_0x7454d6-0x0;var _0x50f9f1=_0x7cf5[_0x7454d6];return _0x50f9f1;};'use strict';var _=require(_0x57cf('0x0'));var util=require(_0x57cf('0x1'));var logger=require(_0x57cf('0x2'))(_0x57cf('0x3'));var moment=require(_0x57cf('0x4'));var BPromise=require(_0x57cf('0x5'));var rp=require(_0x57cf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x57cf('0x7'));var attributes=require(_0x57cf('0x8'));module['exports']=function(_0x2eb99d,_0x29e750){return _0x2eb99d[_0x57cf('0x9')](_0x57cf('0xa'),attributes,{'tableName':_0x57cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x57cf('0xc'),'collate':_0x57cf('0xd')});}; \ No newline at end of file +var _0x02ef=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications'];(function(_0x3605b2,_0x17dd46){var _0x4969f2=function(_0x19c928){while(--_0x19c928){_0x3605b2['push'](_0x3605b2['shift']());}};_0x4969f2(++_0x17dd46);}(_0x02ef,0x11a));var _0xf02e=function(_0x5939c2,_0x51fc6a){_0x5939c2=_0x5939c2-0x0;var _0x1f42fd=_0x02ef[_0x5939c2];return _0x1f42fd;};'use strict';var _=require(_0xf02e('0x0'));var util=require('util');var logger=require(_0xf02e('0x1'))('api');var moment=require(_0xf02e('0x2'));var BPromise=require(_0xf02e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf02e('0x4'));var rimraf=require(_0xf02e('0x5'));var config=require(_0xf02e('0x6'));var attributes=require(_0xf02e('0x7'));module[_0xf02e('0x8')]=function(_0x511257,_0x332c29){return _0x511257[_0xf02e('0x9')](_0xf02e('0xa'),attributes,{'tableName':_0xf02e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf02e('0xc'),'collate':_0xf02e('0xd')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 973e605..5d53eed 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 _0xd7a5=['code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xd7a5,0xdd));var _0x5d7a=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xd7a5[_0x54d4a8];return _0x3b321b;};'use strict';var _=require(_0x5d7a('0x0'));var util=require(_0x5d7a('0x1'));var moment=require(_0x5d7a('0x2'));var BPromise=require(_0x5d7a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d7a('0x4'));var db=require(_0x5d7a('0x5'))['db'];var utils=require(_0x5d7a('0x6'));var logger=require(_0x5d7a('0x7'))(_0x5d7a('0x8'));var config=require(_0x5d7a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5d7a('0xa')][_0x5d7a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f519e,_0x491e33,_0xc5ce04){return new BPromise(function(_0x300777,_0x3057cd){return client[_0x5d7a('0xc')](_0x4f519e,_0xc5ce04)[_0x5d7a('0xd')](function(_0x112172){logger[_0x5d7a('0xe')]('ChatApplication,\x20%s,\x20%s',_0x491e33,_0x5d7a('0xf'));logger['debug'](_0x5d7a('0x10'),_0x491e33,_0x5d7a('0xf'),JSON[_0x5d7a('0x11')](_0x112172));if(_0x112172[_0x5d7a('0x12')]){if(_0x112172[_0x5d7a('0x12')][_0x5d7a('0x13')]===0x1f4){logger[_0x5d7a('0x12')](_0x5d7a('0x14'),_0x491e33,_0x112172[_0x5d7a('0x12')][_0x5d7a('0x15')]);return _0x3057cd(_0x112172[_0x5d7a('0x12')]['message']);}logger[_0x5d7a('0x12')](_0x5d7a('0x14'),_0x491e33,_0x112172[_0x5d7a('0x12')][_0x5d7a('0x15')]);return _0x300777(_0x112172['error'][_0x5d7a('0x15')]);}else{logger[_0x5d7a('0xe')](_0x5d7a('0x14'),_0x491e33,_0x5d7a('0xf'));_0x300777(_0x112172[_0x5d7a('0x16')][_0x5d7a('0x15')]);}})[_0x5d7a('0x17')](function(_0x1d18c5){logger['error']('ChatApplication,\x20%s,\x20%s',_0x491e33,_0x1d18c5);_0x3057cd(_0x1d18c5);});});} \ No newline at end of file +var _0x132b=['ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2e2444,_0x2e4367){var _0x192ec2=function(_0x52b317){while(--_0x52b317){_0x2e2444['push'](_0x2e2444['shift']());}};_0x192ec2(++_0x2e4367);}(_0x132b,0x7c));var _0xb132=function(_0x3337b4,_0x40bbfb){_0x3337b4=_0x3337b4-0x0;var _0x34194e=_0x132b[_0x3337b4];return _0x34194e;};'use strict';var _=require(_0xb132('0x0'));var util=require(_0xb132('0x1'));var moment=require('moment');var BPromise=require(_0xb132('0x2'));var rs=require(_0xb132('0x3'));var fs=require('fs');var Redis=require(_0xb132('0x4'));var db=require(_0xb132('0x5'))['db'];var utils=require(_0xb132('0x6'));var logger=require(_0xb132('0x7'))(_0xb132('0x8'));var config=require(_0xb132('0x9'));var jayson=require(_0xb132('0xa'));var client=jayson[_0xb132('0xb')][_0xb132('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x17cc38,_0x27d1de,_0x1b8c40){return new BPromise(function(_0x2ca816,_0x116124){return client['request'](_0x17cc38,_0x1b8c40)['then'](function(_0x2000eb){logger[_0xb132('0xd')]('ChatApplication,\x20%s,\x20%s',_0x27d1de,_0xb132('0xe'));logger[_0xb132('0xf')](_0xb132('0x10'),_0x27d1de,_0xb132('0xe'),JSON[_0xb132('0x11')](_0x2000eb));if(_0x2000eb[_0xb132('0x12')]){if(_0x2000eb[_0xb132('0x12')][_0xb132('0x13')]===0x1f4){logger[_0xb132('0x12')](_0xb132('0x14'),_0x27d1de,_0x2000eb[_0xb132('0x12')]['message']);return _0x116124(_0x2000eb['error'][_0xb132('0x15')]);}logger[_0xb132('0x12')](_0xb132('0x14'),_0x27d1de,_0x2000eb[_0xb132('0x12')][_0xb132('0x15')]);return _0x2ca816(_0x2000eb[_0xb132('0x12')][_0xb132('0x15')]);}else{logger[_0xb132('0xd')](_0xb132('0x14'),_0x27d1de,'request\x20sent');_0x2ca816(_0x2000eb[_0xb132('0x16')]['message']);}})[_0xb132('0x17')](function(_0x137e74){logger['error'](_0xb132('0x14'),_0x27d1de,_0x137e74);_0x116124(_0x137e74);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 9e1b373..9cb2c34 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 _0xe4f4=['util','path','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','put','update','delete','destroy','multer'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe4f4,0x1d3));var _0x4e4f=function(_0x4af42d,_0x226c6d){_0x4af42d=_0x4af42d-0x0;var _0x14b54f=_0xe4f4[_0x4af42d];return _0x14b54f;};'use strict';var multer=require(_0x4e4f('0x0'));var util=require(_0x4e4f('0x1'));var path=require(_0x4e4f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x4e4f('0x3'));var interaction=require(_0x4e4f('0x4'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0x4e4f('0x5')]('/:id',auth[_0x4e4f('0x6')](),controller[_0x4e4f('0x7')]);router[_0x4e4f('0x8')]('/:id',auth[_0x4e4f('0x6')](),controller[_0x4e4f('0x9')]);router[_0x4e4f('0xa')]('/:id',auth[_0x4e4f('0x6')](),controller[_0x4e4f('0xb')]);module['exports']=router; \ No newline at end of file +var _0xb236=['destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller','isAuthenticated','put','/:id','update'];(function(_0x24088,_0x5792d6){var _0x446a46=function(_0x28c989){while(--_0x28c989){_0x24088['push'](_0x24088['shift']());}};_0x446a46(++_0x5792d6);}(_0xb236,0xf8));var _0x6b23=function(_0x2161bd,_0x526243){_0x2161bd=_0x2161bd-0x0;var _0x4f60c1=_0xb236[_0x2161bd];return _0x4f60c1;};'use strict';var multer=require(_0x6b23('0x0'));var util=require(_0x6b23('0x1'));var path=require(_0x6b23('0x2'));var timeout=require('connect-timeout');var express=require(_0x6b23('0x3'));var router=express[_0x6b23('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6b23('0x5'));var config=require(_0x6b23('0x6'));var controller=require(_0x6b23('0x7'));router['get']('/:id',auth[_0x6b23('0x8')](),controller['show']);router[_0x6b23('0x9')](_0x6b23('0xa'),auth[_0x6b23('0x8')](),controller[_0x6b23('0xb')]);router['delete'](_0x6b23('0xa'),auth['isAuthenticated'](),controller[_0x6b23('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index a54fca6..edea6c8 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 _0x79df=['STRING','BOOLEAN'];(function(_0xef1e4c,_0x5cb9ae){var _0x203904=function(_0x10379c){while(--_0x10379c){_0xef1e4c['push'](_0xef1e4c['shift']());}};_0x203904(++_0x5cb9ae);}(_0x79df,0xb4));var _0xf79d=function(_0x2ceda7,_0x3762c8){_0x2ceda7=_0x2ceda7-0x0;var _0x4ed1f5=_0x79df[_0x2ceda7];return _0x4ed1f5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf79d('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xf79d('0x0')]},'write':{'type':Sequelize[_0xf79d('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x847f=['sequelize','exports','STRING'];(function(_0x4a258d,_0x30f281){var _0x104963=function(_0x55761a){while(--_0x55761a){_0x4a258d['push'](_0x4a258d['shift']());}};_0x104963(++_0x30f281);}(_0x847f,0x126));var _0xf847=function(_0x32a6b6,_0x5b4051){_0x32a6b6=_0x32a6b6-0x0;var _0x1f0d46=_0x847f[_0x32a6b6];return _0x1f0d46;};'use strict';var Sequelize=require(_0xf847('0x0'));module[_0xf847('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf847('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 39b9b82..aff233f 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 _0x6efb=['addMembers','ids','omit','User','order','getMembers','removeMembers','addMessage','ChatGroupId','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','getMessages','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','jayson/promise','http','test','Sequelize','ValidationError','request','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','name','send','map','ChatGroup','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','intersection','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6efb,0x15a));var _0xb6ef=function(_0x13cdac,_0x2d9e74){_0x13cdac=_0x13cdac-0x0;var _0x35aeda=_0x6efb[_0x13cdac];return _0x35aeda;};'use strict';var pdf=require(_0xb6ef('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb6ef('0x1'));var zipdir=require(_0xb6ef('0x2'));var jsonpatch=require(_0xb6ef('0x3'));var rp=require(_0xb6ef('0x4'));var moment=require(_0xb6ef('0x5'));var BPromise=require(_0xb6ef('0x6'));var Mustache=require(_0xb6ef('0x7'));var util=require(_0xb6ef('0x8'));var path=require(_0xb6ef('0x9'));var sox=require(_0xb6ef('0xa'));var csv=require(_0xb6ef('0xb'));var ejs=require(_0xb6ef('0xc'));var fs=require('fs');var _=require(_0xb6ef('0xd'));var squel=require(_0xb6ef('0xe'));var crypto=require('crypto');var jsforce=require(_0xb6ef('0xf'));var deskjs=require(_0xb6ef('0x10'));var toCsv=require(_0xb6ef('0xb'));var querystring=require(_0xb6ef('0x11'));var Papa=require(_0xb6ef('0x12'));var Redis=require('ioredis');var authService=require(_0xb6ef('0x13'));var qs=require(_0xb6ef('0x14'));var as=require(_0xb6ef('0x15'));var hardwareService=require(_0xb6ef('0x16'));var logger=require(_0xb6ef('0x17'))(_0xb6ef('0x18'));var utils=require('../../config/utils');var config=require(_0xb6ef('0x19'));var db=require(_0xb6ef('0x1a'))['db'];config[_0xb6ef('0x1b')]=_[_0xb6ef('0x1c')](config[_0xb6ef('0x1b')],{'host':_0xb6ef('0x1d'),'port':0x18eb});var socket=require(_0xb6ef('0x1e'))(new Redis(config[_0xb6ef('0x1b')]));require(_0xb6ef('0x1f'))['register'](socket);var jayson=require(_0xb6ef('0x20'));var client=jayson['client'][_0xb6ef('0x21')]({'port':0x232a});function checkPasswordPattern(_0xa16fdd,_0x2e5d46,_0x59c667){if(_0x59c667){var _0x34190c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x34190c[_0xb6ef('0x22')](_0x2e5d46)){return _0xa16fdd;}else{throw new db[(_0xb6ef('0x23'))][(_0xb6ef('0x24'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xa16fdd;}}function respondWithRpcPromise(_0x23c27a,_0x25b58d,_0x19c14f,_0x2b37d8){return new BPromise(function(_0x2c170f,_0x39c85d){var _0x117cdd=_0x2b37d8||client;return _0x117cdd[_0xb6ef('0x25')](_0x23c27a,_0x19c14f)['then'](function(_0x24605b){logger[_0xb6ef('0x26')](_0xb6ef('0x27'),_0x25b58d,_0xb6ef('0x28'));logger[_0xb6ef('0x29')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x25b58d,_0xb6ef('0x28'),JSON[_0xb6ef('0x2a')](_0x24605b));if(_0x24605b[_0xb6ef('0x2b')]){if(_0x24605b['error']['code']===0x1f4){logger[_0xb6ef('0x2b')](_0xb6ef('0x27'),_0x25b58d,_0x24605b['error'][_0xb6ef('0x2c')]);return _0x39c85d(_0x24605b['error'][_0xb6ef('0x2c')]);}logger[_0xb6ef('0x2b')](_0xb6ef('0x27'),_0x25b58d,_0x24605b[_0xb6ef('0x2b')][_0xb6ef('0x2c')]);return _0x2c170f(_0x24605b['error']['message']);}else{logger[_0xb6ef('0x26')](_0xb6ef('0x27'),_0x25b58d,_0xb6ef('0x28'));_0x2c170f(_0x24605b['result'][_0xb6ef('0x2c')]);}})[_0xb6ef('0x2d')](function(_0x39d9d7){logger[_0xb6ef('0x2b')](_0xb6ef('0x27'),_0x25b58d,_0x39d9d7);_0x39c85d(_0x39d9d7);});});}function respondWithStatusCode(_0x23f4fb,_0x321aca){_0x321aca=_0x321aca||0xcc;return function(_0x45bddc){if(_0x45bddc){return _0x23f4fb[_0xb6ef('0x2e')](_0x321aca);}return _0x23f4fb[_0xb6ef('0x2f')](_0x321aca)['end']();};}function respondWithResult(_0x4fa632,_0x175b10){_0x175b10=_0x175b10||0xc8;return function(_0x1c1bd5){if(_0x1c1bd5){return _0x4fa632[_0xb6ef('0x2f')](_0x175b10)[_0xb6ef('0x30')](_0x1c1bd5);}};}function respondWithFilteredResult(_0x4e2c3f,_0x4eeeda){return function(_0x2e3fd1){if(_0x2e3fd1){var _0x15db85=_0x2e3fd1[_0xb6ef('0x31')],_0x52ec3a=_0x4eeeda[_0xb6ef('0x32')],_0x1bd178=_0x4eeeda[_0xb6ef('0x32')]+_0x4eeeda[_0xb6ef('0x33')],_0xb6a77f;if(_0x1bd178>=_0x15db85){_0x1bd178=_0x15db85;_0xb6a77f=0xc8;}else{_0xb6a77f=0xce;}_0x4e2c3f[_0xb6ef('0x2f')](_0xb6a77f);return _0x4e2c3f['set'](_0xb6ef('0x34'),_0x52ec3a+'-'+_0x1bd178+'/'+_0x15db85)['json'](_0x2e3fd1);}return null;};}function patchUpdates(_0x1f919e){return function(_0xc7cc3d){try{jsonpatch[_0xb6ef('0x35')](_0xc7cc3d,_0x1f919e,!![]);}catch(_0x33d820){return BPromise[_0xb6ef('0x36')](_0x33d820);}return _0xc7cc3d[_0xb6ef('0x37')]();};}function saveUpdates(_0x102fb9,_0x4ac92e){return function(_0x57329b){if(_0x57329b){return _0x57329b[_0xb6ef('0x38')](_0x102fb9)[_0xb6ef('0x39')](function(_0xfb8302){return _0xfb8302;});}return null;};}function removeEntity(_0x47fb31,_0x53e507){return function(_0x12ee58){if(_0x12ee58){return _0x12ee58[_0xb6ef('0x3a')]()[_0xb6ef('0x39')](function(){_0x47fb31[_0xb6ef('0x2f')](0xcc)[_0xb6ef('0x3b')]();});}};}function handleEntityNotFound(_0xc8b819,_0x544af3){return function(_0x3eefb9){if(!_0x3eefb9){_0xc8b819[_0xb6ef('0x2e')](0x194);}return _0x3eefb9;};}function handleError(_0x2fedf2,_0x18619c){_0x18619c=_0x18619c||0x1f4;return function(_0x4d05b5){logger[_0xb6ef('0x2b')](_0x4d05b5['stack']);if(_0x4d05b5[_0xb6ef('0x3c')]){delete _0x4d05b5[_0xb6ef('0x3c')];}_0x2fedf2['status'](_0x18619c)[_0xb6ef('0x3d')](_0x4d05b5);};}exports['index']=function(_0x4ec1ea,_0x376ed1){var _0x36febc={},_0x2f3ce1={},_0x37ac60={'count':0x0,'rows':[]};var _0x3936e3=_[_0xb6ef('0x3e')](db[_0xb6ef('0x3f')]['rawAttributes'],function(_0x3e503c){return{'name':_0x3e503c[_0xb6ef('0x40')],'type':_0x3e503c[_0xb6ef('0x41')][_0xb6ef('0x42')]};});_0x2f3ce1[_0xb6ef('0x43')]=_[_0xb6ef('0x3e')](_0x3936e3,'name');_0x2f3ce1['query']=_[_0xb6ef('0x44')](_0x4ec1ea[_0xb6ef('0x45')]);_0x2f3ce1[_0xb6ef('0x46')]=_['intersection'](_0x2f3ce1[_0xb6ef('0x43')],_0x2f3ce1[_0xb6ef('0x45')]);_0x36febc[_0xb6ef('0x47')]=_['intersection'](_0x2f3ce1[_0xb6ef('0x43')],qs[_0xb6ef('0x48')](_0x4ec1ea[_0xb6ef('0x45')]['fields']));_0x36febc[_0xb6ef('0x47')]=_0x36febc['attributes'][_0xb6ef('0x49')]?_0x36febc['attributes']:_0x2f3ce1[_0xb6ef('0x43')];if(!_0x4ec1ea[_0xb6ef('0x45')][_0xb6ef('0x4a')](_0xb6ef('0x4b'))){_0x36febc[_0xb6ef('0x33')]=qs['limit'](_0x4ec1ea[_0xb6ef('0x45')][_0xb6ef('0x33')]);_0x36febc[_0xb6ef('0x32')]=qs[_0xb6ef('0x32')](_0x4ec1ea[_0xb6ef('0x45')][_0xb6ef('0x32')]);}_0x36febc['order']=qs['sort'](_0x4ec1ea[_0xb6ef('0x45')][_0xb6ef('0x4c')]);_0x36febc[_0xb6ef('0x4d')]=qs['filters'](_[_0xb6ef('0x4e')](_0x4ec1ea[_0xb6ef('0x45')],_0x2f3ce1[_0xb6ef('0x46')]),_0x3936e3);if(_0x4ec1ea[_0xb6ef('0x45')][_0xb6ef('0x4f')]){_0x36febc[_0xb6ef('0x4d')]=_[_0xb6ef('0x50')](_0x36febc['where'],{'$or':_['map'](_0x3936e3,function(_0x42ef39){if(_0x42ef39[_0xb6ef('0x41')]!==_0xb6ef('0x51')){var _0x18caf4={};_0x18caf4[_0x42ef39[_0xb6ef('0x3c')]]={'$like':'%'+_0x4ec1ea[_0xb6ef('0x45')][_0xb6ef('0x4f')]+'%'};return _0x18caf4;}})});}_0x36febc=_[_0xb6ef('0x50')]({},_0x36febc,_0x4ec1ea[_0xb6ef('0x52')]);var _0x2b9e93={'where':_0x36febc[_0xb6ef('0x4d')]};return db['ChatGroup'][_0xb6ef('0x31')](_0x2b9e93)[_0xb6ef('0x39')](function(_0x27187a){_0x37ac60[_0xb6ef('0x31')]=_0x27187a;if(_0x4ec1ea[_0xb6ef('0x45')][_0xb6ef('0x53')]){_0x36febc[_0xb6ef('0x54')]=[{'all':!![]}];}return db[_0xb6ef('0x3f')]['findAll'](_0x36febc);})[_0xb6ef('0x39')](function(_0x492a85){_0x37ac60[_0xb6ef('0x55')]=_0x492a85;return _0x37ac60;})[_0xb6ef('0x39')](respondWithFilteredResult(_0x376ed1,_0x36febc))['catch'](handleError(_0x376ed1,null));};exports[_0xb6ef('0x56')]=function(_0x311849,_0x47360f){var _0x14f8c2={'raw':!![],'where':{'id':_0x311849[_0xb6ef('0x57')]['id']}},_0xe8a326={};_0xe8a326['model']=_[_0xb6ef('0x44')](db[_0xb6ef('0x3f')][_0xb6ef('0x58')]);_0xe8a326[_0xb6ef('0x45')]=_[_0xb6ef('0x44')](_0x311849[_0xb6ef('0x45')]);_0xe8a326['filters']=_['intersection'](_0xe8a326[_0xb6ef('0x43')],_0xe8a326['query']);_0x14f8c2['attributes']=_[_0xb6ef('0x59')](_0xe8a326['model'],qs[_0xb6ef('0x48')](_0x311849['query'][_0xb6ef('0x48')]));_0x14f8c2['attributes']=_0x14f8c2[_0xb6ef('0x47')][_0xb6ef('0x49')]?_0x14f8c2['attributes']:_0xe8a326[_0xb6ef('0x43')];if(_0x311849[_0xb6ef('0x45')]['includeAll']){_0x14f8c2[_0xb6ef('0x54')]=[{'all':!![]}];}_0x14f8c2=_[_0xb6ef('0x50')]({},_0x14f8c2,_0x311849['options']);return db[_0xb6ef('0x3f')][_0xb6ef('0x5a')](_0x14f8c2)[_0xb6ef('0x39')](handleEntityNotFound(_0x47360f,null))['then'](respondWithResult(_0x47360f,null))['catch'](handleError(_0x47360f,null));};exports[_0xb6ef('0x5b')]=function(_0x2fcb44,_0x369957){return db['ChatGroup'][_0xb6ef('0x5b')](_0x2fcb44[_0xb6ef('0x5c')],{})['then'](respondWithResult(_0x369957,0xc9))[_0xb6ef('0x2d')](handleError(_0x369957,null));};exports[_0xb6ef('0x38')]=function(_0x42d4b1,_0x3e2f96){if(_0x42d4b1[_0xb6ef('0x5c')]['id']){delete _0x42d4b1[_0xb6ef('0x5c')]['id'];}return db['ChatGroup'][_0xb6ef('0x5a')]({'where':{'id':_0x42d4b1['params']['id']}})['then'](handleEntityNotFound(_0x3e2f96,null))[_0xb6ef('0x39')](saveUpdates(_0x42d4b1[_0xb6ef('0x5c')],null))[_0xb6ef('0x39')](respondWithResult(_0x3e2f96,null))[_0xb6ef('0x2d')](handleError(_0x3e2f96,null));};exports[_0xb6ef('0x3a')]=function(_0x5ca094,_0x5da945){return db['ChatGroup'][_0xb6ef('0x5a')]({'where':{'id':_0x5ca094[_0xb6ef('0x57')]['id']}})['then'](handleEntityNotFound(_0x5da945,null))['then'](removeEntity(_0x5da945,null))['catch'](handleError(_0x5da945,null));};exports[_0xb6ef('0x5d')]=function(_0x3ea4c4,_0xb0a423){return db['ChatGroup'][_0xb6ef('0x5d')]()[_0xb6ef('0x39')](respondWithResult(_0xb0a423,null))[_0xb6ef('0x2d')](handleError(_0xb0a423,null));};exports[_0xb6ef('0x5e')]=function(_0x68482d,_0x2ff6d2,_0x3d34f7){return db[_0xb6ef('0x5f')][_0xb6ef('0x31')]({'where':{'ChatGroupId':_0x68482d[_0xb6ef('0x57')]['id'],'ToId':_0x68482d[_0xb6ef('0x60')]['id'],'read':![]}})[_0xb6ef('0x39')](function(_0x1c7e05){return{'id':_[_0xb6ef('0x61')](_0x68482d[_0xb6ef('0x57')]['id']),'count':_0x1c7e05};})['then'](respondWithResult(_0x2ff6d2,null))[_0xb6ef('0x2d')](handleError(_0x2ff6d2,null));};exports[_0xb6ef('0x62')]=function(_0x31f36a,_0x5ec39a,_0x4d9bef){return db[_0xb6ef('0x3f')]['find']({'where':{'id':_0x31f36a[_0xb6ef('0x57')]['id']}})[_0xb6ef('0x39')](handleEntityNotFound(_0x5ec39a,null))[_0xb6ef('0x39')](function(_0x2a57ca){if(_0x2a57ca){return _0x2a57ca['addMembers'](_0x31f36a[_0xb6ef('0x5c')][_0xb6ef('0x63')],_[_0xb6ef('0x64')](_0x31f36a['body'],['ids','id'])||{});}})[_0xb6ef('0x39')](respondWithResult(_0x5ec39a,null))['catch'](handleError(_0x5ec39a,null));};exports['getMembers']=function(_0xf08b19,_0x26ba43,_0x51ec9e){var _0x3d9df7={};var _0x22d433={};var _0x51c30a;var _0x474518;return db['ChatGroup']['findOne']({'where':{'id':_0xf08b19[_0xb6ef('0x57')]['id']}})[_0xb6ef('0x39')](handleEntityNotFound(_0x26ba43,null))['then'](function(_0x3be000){if(_0x3be000){_0x51c30a=_0x3be000;_0x22d433[_0xb6ef('0x43')]=_[_0xb6ef('0x44')](db[_0xb6ef('0x65')][_0xb6ef('0x58')]);_0x22d433[_0xb6ef('0x45')]=_['keys'](_0xf08b19[_0xb6ef('0x45')]);_0x22d433[_0xb6ef('0x46')]=_[_0xb6ef('0x59')](_0x22d433[_0xb6ef('0x43')],_0x22d433[_0xb6ef('0x45')]);_0x3d9df7['attributes']=_[_0xb6ef('0x59')](_0x22d433[_0xb6ef('0x43')],qs['fields'](_0xf08b19[_0xb6ef('0x45')][_0xb6ef('0x48')]));_0x3d9df7[_0xb6ef('0x47')]=_0x3d9df7[_0xb6ef('0x47')][_0xb6ef('0x49')]?_0x3d9df7[_0xb6ef('0x47')]:_0x22d433['model'];_0x3d9df7[_0xb6ef('0x66')]=qs[_0xb6ef('0x4c')](_0xf08b19['query'][_0xb6ef('0x4c')]);_0x3d9df7[_0xb6ef('0x4d')]=qs['filters'](_[_0xb6ef('0x4e')](_0xf08b19['query'],_0x22d433[_0xb6ef('0x46')]));if(_0xf08b19[_0xb6ef('0x45')][_0xb6ef('0x4f')]){_0x3d9df7[_0xb6ef('0x4d')]=_[_0xb6ef('0x50')](_0x3d9df7[_0xb6ef('0x4d')],{'$or':_[_0xb6ef('0x3e')](_0x3d9df7['attributes'],function(_0x5730be){var _0x1fb377={};_0x1fb377[_0x5730be]={'$like':'%'+_0xf08b19[_0xb6ef('0x45')][_0xb6ef('0x4f')]+'%'};return _0x1fb377;})});}_0x3d9df7=_[_0xb6ef('0x50')]({},_0x3d9df7,_0xf08b19[_0xb6ef('0x52')]);return _0x51c30a['getMembers'](_0x3d9df7);}})[_0xb6ef('0x39')](function(_0x48a987){if(_0x48a987){_0x474518=_0x48a987[_0xb6ef('0x49')];if(!_0xf08b19['query']['hasOwnProperty'](_0xb6ef('0x4b'))){_0x3d9df7[_0xb6ef('0x33')]=qs[_0xb6ef('0x33')](_0xf08b19[_0xb6ef('0x45')][_0xb6ef('0x33')]);_0x3d9df7[_0xb6ef('0x32')]=qs[_0xb6ef('0x32')](_0xf08b19[_0xb6ef('0x45')]['offset']);}return _0x51c30a[_0xb6ef('0x67')](_0x3d9df7);}})[_0xb6ef('0x39')](function(_0x13947f){if(_0x13947f){return _0x13947f?{'count':_0x474518,'rows':_0x13947f}:null;}})[_0xb6ef('0x39')](respondWithResult(_0x26ba43,null))['catch'](handleError(_0x26ba43,null));};exports['removeMembers']=function(_0x30747c,_0x2003e2,_0x29c0d4){return db[_0xb6ef('0x3f')][_0xb6ef('0x5a')]({'where':{'id':_0x30747c[_0xb6ef('0x57')]['id']}})[_0xb6ef('0x39')](handleEntityNotFound(_0x2003e2,null))[_0xb6ef('0x39')](function(_0x3fae25){if(_0x3fae25){return _0x3fae25[_0xb6ef('0x68')](_0x30747c[_0xb6ef('0x45')]['ids']);}})['then'](respondWithStatusCode(_0x2003e2,null))[_0xb6ef('0x2d')](handleError(_0x2003e2,null));};exports[_0xb6ef('0x69')]=function(_0xb441e5,_0x59dc9b,_0x2ef040){if(_0xb441e5[_0xb6ef('0x5c')]['id']){delete _0xb441e5[_0xb6ef('0x5c')]['id'];}return db[_0xb6ef('0x3f')][_0xb6ef('0x5a')]({'where':{'id':_0xb441e5[_0xb6ef('0x57')]['id']}})[_0xb6ef('0x39')](handleEntityNotFound(_0x59dc9b,null))[_0xb6ef('0x39')](function(_0x24ef3b){if(_0x24ef3b){_0xb441e5[_0xb6ef('0x5c')][_0xb6ef('0x6a')]=_0x24ef3b['id'];return db[_0xb6ef('0x5f')][_0xb6ef('0x5b')](_0xb441e5['body']);}})[_0xb6ef('0x39')](respondWithResult(_0x59dc9b,null))[_0xb6ef('0x2d')](handleError(_0x59dc9b,null));};exports['getMessages']=function(_0x11b8e7,_0x2ee5b5,_0x5d4edb){var _0x49fddc={};var _0xe2c671={};var _0x4491c4;var _0x5f4b26;return db['ChatGroup'][_0xb6ef('0x6b')]({'where':{'id':_0x11b8e7[_0xb6ef('0x57')]['id']}})[_0xb6ef('0x39')](handleEntityNotFound(_0x2ee5b5,null))[_0xb6ef('0x39')](function(_0x26fde3){if(_0x26fde3){_0x4491c4=_0x26fde3;_0xe2c671[_0xb6ef('0x43')]=_[_0xb6ef('0x44')](db[_0xb6ef('0x5f')]['rawAttributes']);_0xe2c671[_0xb6ef('0x45')]=_[_0xb6ef('0x44')](_0x11b8e7[_0xb6ef('0x45')]);_0xe2c671[_0xb6ef('0x46')]=_['intersection'](_0xe2c671[_0xb6ef('0x43')],_0xe2c671[_0xb6ef('0x45')]);_0x49fddc[_0xb6ef('0x47')]=_[_0xb6ef('0x59')](_0xe2c671[_0xb6ef('0x43')],qs[_0xb6ef('0x48')](_0x11b8e7['query']['fields']));_0x49fddc['attributes']=_0x49fddc[_0xb6ef('0x47')][_0xb6ef('0x49')]?_0x49fddc[_0xb6ef('0x47')]:_0xe2c671['model'];_0x49fddc['order']=qs[_0xb6ef('0x4c')](_0x11b8e7[_0xb6ef('0x45')]['sort']);_0x49fddc[_0xb6ef('0x4d')]=qs['filters'](_[_0xb6ef('0x4e')](_0x11b8e7[_0xb6ef('0x45')],_0xe2c671[_0xb6ef('0x46')]));if(_0x11b8e7[_0xb6ef('0x45')][_0xb6ef('0x4f')]){_0x49fddc[_0xb6ef('0x4d')]=_[_0xb6ef('0x50')](_0x49fddc[_0xb6ef('0x4d')],{'$or':_[_0xb6ef('0x3e')](_0x49fddc[_0xb6ef('0x47')],function(_0xa037a3){var _0x1fb581={};_0x1fb581[_0xa037a3]={'$like':'%'+_0x11b8e7[_0xb6ef('0x45')]['filter']+'%'};return _0x1fb581;})});}if(_0x11b8e7['query'][_0xb6ef('0x6c')]){var _0x42802e=_0x11b8e7[_0xb6ef('0x45')][_0xb6ef('0x6c')]['split'](',');var _0x2989c1={};_0x2989c1[_0x42802e[0x0]]={'$gte':moment(_0x42802e[0x1])['format'](_0xb6ef('0x6d'))};_0x49fddc[_0xb6ef('0x4d')]=_[_0xb6ef('0x50')](_0x49fddc[_0xb6ef('0x4d')],_0x2989c1);}_0x49fddc=_[_0xb6ef('0x50')]({},_0x49fddc,_0x11b8e7['options']);return _0x4491c4[_0xb6ef('0x6e')](_0x49fddc);}})[_0xb6ef('0x39')](function(_0x5a908d){if(_0x5a908d){_0x5f4b26=_0x5a908d[_0xb6ef('0x49')];if(!_0x11b8e7['query'][_0xb6ef('0x4a')](_0xb6ef('0x4b'))){_0x49fddc['limit']=qs[_0xb6ef('0x33')](_0x11b8e7[_0xb6ef('0x45')][_0xb6ef('0x33')]);_0x49fddc[_0xb6ef('0x32')]=qs[_0xb6ef('0x32')](_0x11b8e7[_0xb6ef('0x45')][_0xb6ef('0x32')]);}return _0x4491c4[_0xb6ef('0x6e')](_0x49fddc);}})[_0xb6ef('0x39')](function(_0x3a0b91){if(_0x3a0b91){return _0x3a0b91?{'count':_0x5f4b26,'rows':_0x3a0b91}:null;}})[_0xb6ef('0x39')](respondWithResult(_0x2ee5b5,null))[_0xb6ef('0x2d')](handleError(_0x2ee5b5,null));}; \ No newline at end of file +var _0xd186=['attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','findAll','then','show','params','include','find','create','body','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','length','nolimit','removeMembers','ChatGroupId','ChatInternalMessage','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','client','test','Sequelize','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','model','query','keys','intersection'];(function(_0x4e0509,_0x465be1){var _0x1f3707=function(_0x8c1ac){while(--_0x8c1ac){_0x4e0509['push'](_0x4e0509['shift']());}};_0x1f3707(++_0x465be1);}(_0xd186,0x8f));var _0x6d18=function(_0x25d264,_0x1b4f8){_0x25d264=_0x25d264-0x0;var _0x4b2ef3=_0xd186[_0x25d264];return _0x4b2ef3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6d18('0x0'));var rimraf=require(_0x6d18('0x1'));var zipdir=require(_0x6d18('0x2'));var jsonpatch=require(_0x6d18('0x3'));var rp=require(_0x6d18('0x4'));var moment=require('moment');var BPromise=require(_0x6d18('0x5'));var Mustache=require('mustache');var util=require(_0x6d18('0x6'));var path=require('path');var sox=require(_0x6d18('0x7'));var csv=require(_0x6d18('0x8'));var ejs=require(_0x6d18('0x9'));var fs=require('fs');var _=require(_0x6d18('0xa'));var squel=require(_0x6d18('0xb'));var crypto=require(_0x6d18('0xc'));var jsforce=require(_0x6d18('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6d18('0x8'));var querystring=require(_0x6d18('0xe'));var Papa=require('papaparse');var Redis=require(_0x6d18('0xf'));var authService=require(_0x6d18('0x10'));var qs=require(_0x6d18('0x11'));var as=require(_0x6d18('0x12'));var hardwareService=require(_0x6d18('0x13'));var logger=require(_0x6d18('0x14'))('api');var utils=require(_0x6d18('0x15'));var config=require('../../config/environment');var db=require(_0x6d18('0x16'))['db'];config[_0x6d18('0x17')]=_[_0x6d18('0x18')](config[_0x6d18('0x17')],{'host':_0x6d18('0x19'),'port':0x18eb});var socket=require(_0x6d18('0x1a'))(new Redis(config['redis']));require(_0x6d18('0x1b'))[_0x6d18('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6d18('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x348159,_0x2e1f0e,_0x407d61){if(_0x407d61){var _0x440325=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x440325[_0x6d18('0x1e')](_0x2e1f0e)){return _0x348159;}else{throw new db[(_0x6d18('0x1f'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0x348159;}}function respondWithRpcPromise(_0x2fc87e,_0x393b94,_0x1c2157,_0x1a4367){return new BPromise(function(_0x1fbf2d,_0x1414e7){var _0x16e8f0=_0x1a4367||client;return _0x16e8f0['request'](_0x2fc87e,_0x1c2157)['then'](function(_0x10793a){logger[_0x6d18('0x20')](_0x6d18('0x21'),_0x393b94,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0x393b94,_0x6d18('0x22'),JSON[_0x6d18('0x23')](_0x10793a));if(_0x10793a[_0x6d18('0x24')]){if(_0x10793a[_0x6d18('0x24')][_0x6d18('0x25')]===0x1f4){logger[_0x6d18('0x24')]('ChatGroup,\x20%s,\x20%s',_0x393b94,_0x10793a[_0x6d18('0x24')][_0x6d18('0x26')]);return _0x1414e7(_0x10793a[_0x6d18('0x24')][_0x6d18('0x26')]);}logger[_0x6d18('0x24')](_0x6d18('0x21'),_0x393b94,_0x10793a[_0x6d18('0x24')][_0x6d18('0x26')]);return _0x1fbf2d(_0x10793a[_0x6d18('0x24')]['message']);}else{logger[_0x6d18('0x20')](_0x6d18('0x21'),_0x393b94,_0x6d18('0x22'));_0x1fbf2d(_0x10793a[_0x6d18('0x27')][_0x6d18('0x26')]);}})[_0x6d18('0x28')](function(_0x14693e){logger[_0x6d18('0x24')]('ChatGroup,\x20%s,\x20%s',_0x393b94,_0x14693e);_0x1414e7(_0x14693e);});});}function respondWithStatusCode(_0x1ffa59,_0x438483){_0x438483=_0x438483||0xcc;return function(_0x16e8b0){if(_0x16e8b0){return _0x1ffa59['sendStatus'](_0x438483);}return _0x1ffa59[_0x6d18('0x29')](_0x438483)[_0x6d18('0x2a')]();};}function respondWithResult(_0x85e038,_0x24f22f){_0x24f22f=_0x24f22f||0xc8;return function(_0x14d1a3){if(_0x14d1a3){return _0x85e038[_0x6d18('0x29')](_0x24f22f)['json'](_0x14d1a3);}};}function respondWithFilteredResult(_0x5a8ab5,_0x48491f){return function(_0x55be8f){if(_0x55be8f){var _0x35e6c6=_0x55be8f[_0x6d18('0x2b')],_0x38b73a=_0x48491f[_0x6d18('0x2c')],_0x3c987d=_0x48491f['offset']+_0x48491f[_0x6d18('0x2d')],_0x40149b;if(_0x3c987d>=_0x35e6c6){_0x3c987d=_0x35e6c6;_0x40149b=0xc8;}else{_0x40149b=0xce;}_0x5a8ab5[_0x6d18('0x29')](_0x40149b);return _0x5a8ab5[_0x6d18('0x2e')](_0x6d18('0x2f'),_0x38b73a+'-'+_0x3c987d+'/'+_0x35e6c6)['json'](_0x55be8f);}return null;};}function patchUpdates(_0x5c5e9f){return function(_0x222dea){try{jsonpatch[_0x6d18('0x30')](_0x222dea,_0x5c5e9f,!![]);}catch(_0x26fb17){return BPromise[_0x6d18('0x31')](_0x26fb17);}return _0x222dea[_0x6d18('0x32')]();};}function saveUpdates(_0x5d9b92,_0x3beafd){return function(_0x1fec27){if(_0x1fec27){return _0x1fec27[_0x6d18('0x33')](_0x5d9b92)['then'](function(_0x1bc2c4){return _0x1bc2c4;});}return null;};}function removeEntity(_0x290883,_0xf21009){return function(_0x1dbca2){if(_0x1dbca2){return _0x1dbca2[_0x6d18('0x34')]()['then'](function(){_0x290883['status'](0xcc)[_0x6d18('0x2a')]();});}};}function handleEntityNotFound(_0x418b05,_0x35af91){return function(_0x3c69db){if(!_0x3c69db){_0x418b05[_0x6d18('0x35')](0x194);}return _0x3c69db;};}function handleError(_0x2ebfd9,_0x2111d0){_0x2111d0=_0x2111d0||0x1f4;return function(_0x56e2dc){logger[_0x6d18('0x24')](_0x56e2dc[_0x6d18('0x36')]);if(_0x56e2dc[_0x6d18('0x37')]){delete _0x56e2dc[_0x6d18('0x37')];}_0x2ebfd9[_0x6d18('0x29')](_0x2111d0)[_0x6d18('0x38')](_0x56e2dc);};}exports[_0x6d18('0x39')]=function(_0x954d99,_0x581e55){var _0x10abf5={},_0x436904={},_0xdb3d28={'count':0x0,'rows':[]};var _0x51dc5f=_[_0x6d18('0x3a')](db[_0x6d18('0x3b')][_0x6d18('0x3c')],function(_0x1af7b5){return{'name':_0x1af7b5['fieldName'],'type':_0x1af7b5[_0x6d18('0x3d')][_0x6d18('0x3e')]};});_0x436904[_0x6d18('0x3f')]=_[_0x6d18('0x3a')](_0x51dc5f,_0x6d18('0x37'));_0x436904[_0x6d18('0x40')]=_[_0x6d18('0x41')](_0x954d99[_0x6d18('0x40')]);_0x436904['filters']=_[_0x6d18('0x42')](_0x436904[_0x6d18('0x3f')],_0x436904[_0x6d18('0x40')]);_0x10abf5[_0x6d18('0x43')]=_[_0x6d18('0x42')](_0x436904[_0x6d18('0x3f')],qs['fields'](_0x954d99[_0x6d18('0x40')][_0x6d18('0x44')]));_0x10abf5[_0x6d18('0x43')]=_0x10abf5[_0x6d18('0x43')]['length']?_0x10abf5[_0x6d18('0x43')]:_0x436904[_0x6d18('0x3f')];if(!_0x954d99[_0x6d18('0x40')][_0x6d18('0x45')]('nolimit')){_0x10abf5['limit']=qs['limit'](_0x954d99[_0x6d18('0x40')][_0x6d18('0x2d')]);_0x10abf5['offset']=qs[_0x6d18('0x2c')](_0x954d99[_0x6d18('0x40')][_0x6d18('0x2c')]);}_0x10abf5[_0x6d18('0x46')]=qs[_0x6d18('0x47')](_0x954d99['query'][_0x6d18('0x47')]);_0x10abf5[_0x6d18('0x48')]=qs[_0x6d18('0x49')](_[_0x6d18('0x4a')](_0x954d99['query'],_0x436904[_0x6d18('0x49')]),_0x51dc5f);if(_0x954d99[_0x6d18('0x40')][_0x6d18('0x4b')]){_0x10abf5[_0x6d18('0x48')]=_[_0x6d18('0x4c')](_0x10abf5[_0x6d18('0x48')],{'$or':_[_0x6d18('0x3a')](_0x51dc5f,function(_0x2000da){if(_0x2000da[_0x6d18('0x3d')]!=='VIRTUAL'){var _0x556693={};_0x556693[_0x2000da['name']]={'$like':'%'+_0x954d99['query']['filter']+'%'};return _0x556693;}})});}_0x10abf5=_[_0x6d18('0x4c')]({},_0x10abf5,_0x954d99[_0x6d18('0x4d')]);var _0x5b1be5={'where':_0x10abf5['where']};return db[_0x6d18('0x3b')][_0x6d18('0x2b')](_0x5b1be5)['then'](function(_0xa519de){_0xdb3d28[_0x6d18('0x2b')]=_0xa519de;if(_0x954d99[_0x6d18('0x40')][_0x6d18('0x4e')]){_0x10abf5['include']=[{'all':!![]}];}return db[_0x6d18('0x3b')][_0x6d18('0x4f')](_0x10abf5);})[_0x6d18('0x50')](function(_0x190547){_0xdb3d28['rows']=_0x190547;return _0xdb3d28;})[_0x6d18('0x50')](respondWithFilteredResult(_0x581e55,_0x10abf5))[_0x6d18('0x28')](handleError(_0x581e55,null));};exports[_0x6d18('0x51')]=function(_0x14f107,_0x550b91){var _0xfa8c69={'raw':!![],'where':{'id':_0x14f107[_0x6d18('0x52')]['id']}},_0xdf4f42={};_0xdf4f42[_0x6d18('0x3f')]=_[_0x6d18('0x41')](db[_0x6d18('0x3b')][_0x6d18('0x3c')]);_0xdf4f42[_0x6d18('0x40')]=_[_0x6d18('0x41')](_0x14f107[_0x6d18('0x40')]);_0xdf4f42[_0x6d18('0x49')]=_[_0x6d18('0x42')](_0xdf4f42['model'],_0xdf4f42[_0x6d18('0x40')]);_0xfa8c69[_0x6d18('0x43')]=_[_0x6d18('0x42')](_0xdf4f42[_0x6d18('0x3f')],qs[_0x6d18('0x44')](_0x14f107[_0x6d18('0x40')][_0x6d18('0x44')]));_0xfa8c69[_0x6d18('0x43')]=_0xfa8c69[_0x6d18('0x43')]['length']?_0xfa8c69[_0x6d18('0x43')]:_0xdf4f42['model'];if(_0x14f107[_0x6d18('0x40')][_0x6d18('0x4e')]){_0xfa8c69[_0x6d18('0x53')]=[{'all':!![]}];}_0xfa8c69=_[_0x6d18('0x4c')]({},_0xfa8c69,_0x14f107[_0x6d18('0x4d')]);return db[_0x6d18('0x3b')][_0x6d18('0x54')](_0xfa8c69)[_0x6d18('0x50')](handleEntityNotFound(_0x550b91,null))['then'](respondWithResult(_0x550b91,null))[_0x6d18('0x28')](handleError(_0x550b91,null));};exports[_0x6d18('0x55')]=function(_0x36bc3d,_0x25d732){return db[_0x6d18('0x3b')]['create'](_0x36bc3d[_0x6d18('0x56')],{})[_0x6d18('0x50')](respondWithResult(_0x25d732,0xc9))[_0x6d18('0x28')](handleError(_0x25d732,null));};exports[_0x6d18('0x33')]=function(_0x42d150,_0x157dac){if(_0x42d150[_0x6d18('0x56')]['id']){delete _0x42d150['body']['id'];}return db[_0x6d18('0x3b')][_0x6d18('0x54')]({'where':{'id':_0x42d150[_0x6d18('0x52')]['id']}})[_0x6d18('0x50')](handleEntityNotFound(_0x157dac,null))['then'](saveUpdates(_0x42d150[_0x6d18('0x56')],null))[_0x6d18('0x50')](respondWithResult(_0x157dac,null))['catch'](handleError(_0x157dac,null));};exports['destroy']=function(_0x3b0d39,_0x257fe3){return db[_0x6d18('0x3b')][_0x6d18('0x54')]({'where':{'id':_0x3b0d39[_0x6d18('0x52')]['id']}})[_0x6d18('0x50')](handleEntityNotFound(_0x257fe3,null))[_0x6d18('0x50')](removeEntity(_0x257fe3,null))[_0x6d18('0x28')](handleError(_0x257fe3,null));};exports['describe']=function(_0x39ccdd,_0x3e64fb){return db[_0x6d18('0x3b')]['describe']()[_0x6d18('0x50')](respondWithResult(_0x3e64fb,null))[_0x6d18('0x28')](handleError(_0x3e64fb,null));};exports[_0x6d18('0x57')]=function(_0x233331,_0x1df3b3,_0x15bfb7){return db['ChatInternalMessage'][_0x6d18('0x2b')]({'where':{'ChatGroupId':_0x233331[_0x6d18('0x52')]['id'],'ToId':_0x233331[_0x6d18('0x58')]['id'],'read':![]}})[_0x6d18('0x50')](function(_0x3cbdf4){return{'id':_[_0x6d18('0x59')](_0x233331['params']['id']),'count':_0x3cbdf4};})['then'](respondWithResult(_0x1df3b3,null))[_0x6d18('0x28')](handleError(_0x1df3b3,null));};exports['addMembers']=function(_0x2a3a47,_0x521100,_0x4b7bd1){return db[_0x6d18('0x3b')]['find']({'where':{'id':_0x2a3a47[_0x6d18('0x52')]['id']}})[_0x6d18('0x50')](handleEntityNotFound(_0x521100,null))[_0x6d18('0x50')](function(_0x106032){if(_0x106032){return _0x106032[_0x6d18('0x5a')](_0x2a3a47[_0x6d18('0x56')][_0x6d18('0x5b')],_[_0x6d18('0x5c')](_0x2a3a47[_0x6d18('0x56')],['ids','id'])||{});}})[_0x6d18('0x50')](respondWithResult(_0x521100,null))[_0x6d18('0x28')](handleError(_0x521100,null));};exports[_0x6d18('0x5d')]=function(_0x1ca117,_0x45b76a,_0x45ca01){var _0x3b19dc={};var _0x5cb439={};var _0x147eb3;var _0x5f3826;return db[_0x6d18('0x3b')][_0x6d18('0x5e')]({'where':{'id':_0x1ca117['params']['id']}})[_0x6d18('0x50')](handleEntityNotFound(_0x45b76a,null))[_0x6d18('0x50')](function(_0x2667d3){if(_0x2667d3){_0x147eb3=_0x2667d3;_0x5cb439[_0x6d18('0x3f')]=_[_0x6d18('0x41')](db[_0x6d18('0x5f')][_0x6d18('0x3c')]);_0x5cb439[_0x6d18('0x40')]=_[_0x6d18('0x41')](_0x1ca117[_0x6d18('0x40')]);_0x5cb439[_0x6d18('0x49')]=_['intersection'](_0x5cb439[_0x6d18('0x3f')],_0x5cb439[_0x6d18('0x40')]);_0x3b19dc[_0x6d18('0x43')]=_[_0x6d18('0x42')](_0x5cb439[_0x6d18('0x3f')],qs['fields'](_0x1ca117['query'][_0x6d18('0x44')]));_0x3b19dc[_0x6d18('0x43')]=_0x3b19dc['attributes']['length']?_0x3b19dc['attributes']:_0x5cb439['model'];_0x3b19dc[_0x6d18('0x46')]=qs[_0x6d18('0x47')](_0x1ca117[_0x6d18('0x40')]['sort']);_0x3b19dc[_0x6d18('0x48')]=qs[_0x6d18('0x49')](_[_0x6d18('0x4a')](_0x1ca117['query'],_0x5cb439[_0x6d18('0x49')]));if(_0x1ca117[_0x6d18('0x40')][_0x6d18('0x4b')]){_0x3b19dc[_0x6d18('0x48')]=_[_0x6d18('0x4c')](_0x3b19dc[_0x6d18('0x48')],{'$or':_[_0x6d18('0x3a')](_0x3b19dc[_0x6d18('0x43')],function(_0x112fd4){var _0x1cdaee={};_0x1cdaee[_0x112fd4]={'$like':'%'+_0x1ca117[_0x6d18('0x40')]['filter']+'%'};return _0x1cdaee;})});}_0x3b19dc=_[_0x6d18('0x4c')]({},_0x3b19dc,_0x1ca117[_0x6d18('0x4d')]);return _0x147eb3[_0x6d18('0x5d')](_0x3b19dc);}})[_0x6d18('0x50')](function(_0x56b69d){if(_0x56b69d){_0x5f3826=_0x56b69d[_0x6d18('0x60')];if(!_0x1ca117[_0x6d18('0x40')][_0x6d18('0x45')](_0x6d18('0x61'))){_0x3b19dc[_0x6d18('0x2d')]=qs[_0x6d18('0x2d')](_0x1ca117[_0x6d18('0x40')][_0x6d18('0x2d')]);_0x3b19dc[_0x6d18('0x2c')]=qs[_0x6d18('0x2c')](_0x1ca117['query'][_0x6d18('0x2c')]);}return _0x147eb3['getMembers'](_0x3b19dc);}})[_0x6d18('0x50')](function(_0x33f896){if(_0x33f896){return _0x33f896?{'count':_0x5f3826,'rows':_0x33f896}:null;}})['then'](respondWithResult(_0x45b76a,null))[_0x6d18('0x28')](handleError(_0x45b76a,null));};exports['removeMembers']=function(_0x2cc063,_0x1ebb1c,_0x2fb1fe){return db['ChatGroup']['find']({'where':{'id':_0x2cc063[_0x6d18('0x52')]['id']}})[_0x6d18('0x50')](handleEntityNotFound(_0x1ebb1c,null))['then'](function(_0x4ace13){if(_0x4ace13){return _0x4ace13[_0x6d18('0x62')](_0x2cc063[_0x6d18('0x40')][_0x6d18('0x5b')]);}})['then'](respondWithStatusCode(_0x1ebb1c,null))[_0x6d18('0x28')](handleError(_0x1ebb1c,null));};exports['addMessage']=function(_0x2f7676,_0x1aed2e,_0x626b5){if(_0x2f7676[_0x6d18('0x56')]['id']){delete _0x2f7676[_0x6d18('0x56')]['id'];}return db[_0x6d18('0x3b')]['find']({'where':{'id':_0x2f7676[_0x6d18('0x52')]['id']}})[_0x6d18('0x50')](handleEntityNotFound(_0x1aed2e,null))['then'](function(_0x9070a0){if(_0x9070a0){_0x2f7676['body'][_0x6d18('0x63')]=_0x9070a0['id'];return db[_0x6d18('0x64')][_0x6d18('0x55')](_0x2f7676[_0x6d18('0x56')]);}})['then'](respondWithResult(_0x1aed2e,null))[_0x6d18('0x28')](handleError(_0x1aed2e,null));};exports[_0x6d18('0x65')]=function(_0x42fccc,_0x2924c1,_0x5da468){var _0x3b3796={};var _0x14e7a9={};var _0x32306e;var _0x65ef4d;return db['ChatGroup'][_0x6d18('0x5e')]({'where':{'id':_0x42fccc[_0x6d18('0x52')]['id']}})[_0x6d18('0x50')](handleEntityNotFound(_0x2924c1,null))['then'](function(_0x43aa46){if(_0x43aa46){_0x32306e=_0x43aa46;_0x14e7a9[_0x6d18('0x3f')]=_[_0x6d18('0x41')](db[_0x6d18('0x64')][_0x6d18('0x3c')]);_0x14e7a9[_0x6d18('0x40')]=_['keys'](_0x42fccc[_0x6d18('0x40')]);_0x14e7a9[_0x6d18('0x49')]=_['intersection'](_0x14e7a9['model'],_0x14e7a9[_0x6d18('0x40')]);_0x3b3796[_0x6d18('0x43')]=_[_0x6d18('0x42')](_0x14e7a9[_0x6d18('0x3f')],qs[_0x6d18('0x44')](_0x42fccc[_0x6d18('0x40')][_0x6d18('0x44')]));_0x3b3796['attributes']=_0x3b3796['attributes'][_0x6d18('0x60')]?_0x3b3796['attributes']:_0x14e7a9['model'];_0x3b3796['order']=qs[_0x6d18('0x47')](_0x42fccc[_0x6d18('0x40')][_0x6d18('0x47')]);_0x3b3796['where']=qs['filters'](_[_0x6d18('0x4a')](_0x42fccc['query'],_0x14e7a9[_0x6d18('0x49')]));if(_0x42fccc[_0x6d18('0x40')][_0x6d18('0x4b')]){_0x3b3796['where']=_[_0x6d18('0x4c')](_0x3b3796['where'],{'$or':_[_0x6d18('0x3a')](_0x3b3796[_0x6d18('0x43')],function(_0x157e63){var _0x1452f3={};_0x1452f3[_0x157e63]={'$like':'%'+_0x42fccc['query'][_0x6d18('0x4b')]+'%'};return _0x1452f3;})});}if(_0x42fccc[_0x6d18('0x40')][_0x6d18('0x66')]){var _0x289cbf=_0x42fccc[_0x6d18('0x40')][_0x6d18('0x66')][_0x6d18('0x67')](',');var _0x163508={};_0x163508[_0x289cbf[0x0]]={'$gte':moment(_0x289cbf[0x1])[_0x6d18('0x68')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3b3796['where']=_[_0x6d18('0x4c')](_0x3b3796[_0x6d18('0x48')],_0x163508);}_0x3b3796=_[_0x6d18('0x4c')]({},_0x3b3796,_0x42fccc['options']);return _0x32306e[_0x6d18('0x65')](_0x3b3796);}})[_0x6d18('0x50')](function(_0x4c77d4){if(_0x4c77d4){_0x65ef4d=_0x4c77d4[_0x6d18('0x60')];if(!_0x42fccc[_0x6d18('0x40')][_0x6d18('0x45')](_0x6d18('0x61'))){_0x3b3796[_0x6d18('0x2d')]=qs['limit'](_0x42fccc[_0x6d18('0x40')][_0x6d18('0x2d')]);_0x3b3796['offset']=qs[_0x6d18('0x2c')](_0x42fccc['query'][_0x6d18('0x2c')]);}return _0x32306e['getMessages'](_0x3b3796);}})['then'](function(_0x2fc8c0){if(_0x2fc8c0){return _0x2fc8c0?{'count':_0x65ef4d,'rows':_0x2fc8c0}:null;}})[_0x6d18('0x50')](respondWithResult(_0x2924c1,null))[_0x6d18('0x28')](handleError(_0x2924c1,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 4dd3ac8..c219dc3 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 _0xdb28=['ChatGroup','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x33429f,_0x56fef2){var _0x43806d=function(_0x44e9a8){while(--_0x44e9a8){_0x33429f['push'](_0x33429f['shift']());}};_0x43806d(++_0x56fef2);}(_0xdb28,0x106));var _0x8db2=function(_0x197dfa,_0x23d743){_0x197dfa=_0x197dfa-0x0;var _0x23a1bc=_0xdb28[_0x197dfa];return _0x23a1bc;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var ChatGroup=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xdb28=['ChatGroup','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x484b66,_0x51c8de){var _0x23992=function(_0x317b9f){while(--_0x317b9f){_0x484b66['push'](_0x484b66['shift']());}};_0x23992(++_0x51c8de);}(_0xdb28,0x106));var _0x8db2=function(_0xe3b490,_0x422e5b){_0xe3b490=_0xe3b490-0x0;var _0x57cc5f=_0xdb28[_0xe3b490];return _0x57cc5f;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var ChatGroup=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);ChatGroupEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index e7cea5d..53570a6 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 _0x9f5a=['api','bluebird','request-promise','path','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util','../../config/logger'];(function(_0x16c2b1,_0x36a70c){var _0x199ac4=function(_0x2f1802){while(--_0x2f1802){_0x16c2b1['push'](_0x16c2b1['shift']());}};_0x199ac4(++_0x36a70c);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x77657f,_0xad7a4d){_0x77657f=_0x77657f-0x0;var _0x1d266b=_0x9f5a[_0x77657f];return _0x1d266b;};'use strict';var _=require(_0xa9f5('0x0'));var util=require(_0xa9f5('0x1'));var logger=require(_0xa9f5('0x2'))(_0xa9f5('0x3'));var moment=require('moment');var BPromise=require(_0xa9f5('0x4'));var rp=require(_0xa9f5('0x5'));var fs=require('fs');var path=require(_0xa9f5('0x6'));var rimraf=require('rimraf');var config=require(_0xa9f5('0x7'));var attributes=require('./chatGroup.attributes');module[_0xa9f5('0x8')]=function(_0x219e89,_0x49e337){return _0x219e89[_0xa9f5('0x9')](_0xa9f5('0xa'),attributes,{'tableName':_0xa9f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8d0a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','../../config/logger','api'];(function(_0x1a16a6,_0x405141){var _0x5e3d0b=function(_0x314c34){while(--_0x314c34){_0x1a16a6['push'](_0x1a16a6['shift']());}};_0x5e3d0b(++_0x405141);}(_0x8d0a,0x65));var _0xa8d0=function(_0x49011b,_0x4ff958){_0x49011b=_0x49011b-0x0;var _0x33ce53=_0x8d0a[_0x49011b];return _0x33ce53;};'use strict';var _=require(_0xa8d0('0x0'));var util=require('util');var logger=require(_0xa8d0('0x1'))(_0xa8d0('0x2'));var moment=require(_0xa8d0('0x3'));var BPromise=require(_0xa8d0('0x4'));var rp=require(_0xa8d0('0x5'));var fs=require('fs');var path=require(_0xa8d0('0x6'));var rimraf=require(_0xa8d0('0x7'));var config=require(_0xa8d0('0x8'));var attributes=require(_0xa8d0('0x9'));module['exports']=function(_0x1cac4f,_0x212aaf){return _0x1cac4f[_0xa8d0('0xa')](_0xa8d0('0xb'),attributes,{'tableName':_0xa8d0('0xc'),'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 f50c4fa..56b077a 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 _0x1c2b=['debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','ChatGroup,\x20%s,\x20%s'];(function(_0x2bd230,_0x2e699c){var _0x15e76e=function(_0xa871a9){while(--_0xa871a9){_0x2bd230['push'](_0x2bd230['shift']());}};_0x15e76e(++_0x2e699c);}(_0x1c2b,0x14d));var _0xb1c2=function(_0x485201,_0x3c533a){_0x485201=_0x485201-0x0;var _0x9ca98a=_0x1c2b[_0x485201];return _0x9ca98a;};'use strict';var _=require(_0xb1c2('0x0'));var util=require(_0xb1c2('0x1'));var moment=require(_0xb1c2('0x2'));var BPromise=require(_0xb1c2('0x3'));var rs=require(_0xb1c2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1c2('0x5'))['db'];var utils=require(_0xb1c2('0x6'));var logger=require('../../config/logger')(_0xb1c2('0x7'));var config=require(_0xb1c2('0x8'));var jayson=require(_0xb1c2('0x9'));var client=jayson[_0xb1c2('0xa')][_0xb1c2('0xb')]({'port':0x232a});config[_0xb1c2('0xc')]=_[_0xb1c2('0xd')](config[_0xb1c2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb1c2('0xe'))(new Redis(config[_0xb1c2('0xc')]));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x3f7252,_0x49f7ec,_0x5aaf9d){return new BPromise(function(_0x4e5354,_0x5abc40){return client[_0xb1c2('0xf')](_0x3f7252,_0x5aaf9d)[_0xb1c2('0x10')](function(_0x5bc496){logger['info'](_0xb1c2('0x11'),_0x49f7ec,'request\x20sent');logger[_0xb1c2('0x12')](_0xb1c2('0x13'),_0x49f7ec,_0xb1c2('0x14'),JSON['stringify'](_0x5bc496));if(_0x5bc496[_0xb1c2('0x15')]){if(_0x5bc496[_0xb1c2('0x15')][_0xb1c2('0x16')]===0x1f4){logger[_0xb1c2('0x15')](_0xb1c2('0x11'),_0x49f7ec,_0x5bc496[_0xb1c2('0x15')][_0xb1c2('0x17')]);return _0x5abc40(_0x5bc496['error'][_0xb1c2('0x17')]);}logger[_0xb1c2('0x15')](_0xb1c2('0x11'),_0x49f7ec,_0x5bc496['error'][_0xb1c2('0x17')]);return _0x4e5354(_0x5bc496[_0xb1c2('0x15')][_0xb1c2('0x17')]);}else{logger[_0xb1c2('0x18')]('ChatGroup,\x20%s,\x20%s',_0x49f7ec,'request\x20sent');_0x4e5354(_0x5bc496[_0xb1c2('0x19')][_0xb1c2('0x17')]);}})[_0xb1c2('0x1a')](function(_0x57e65f){logger[_0xb1c2('0x15')](_0xb1c2('0x11'),_0x49f7ec,_0x57e65f);_0x5abc40(_0x57e65f);});});} \ No newline at end of file +var _0x0425=['redis','localhost','socket.io-emitter','register','request','then','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0425,0x1c1));var _0x5042=function(_0x1a2f95,_0x20cc2a){_0x1a2f95=_0x1a2f95-0x0;var _0x47d749=_0x0425[_0x1a2f95];return _0x47d749;};'use strict';var _=require(_0x5042('0x0'));var util=require('util');var moment=require(_0x5042('0x1'));var BPromise=require(_0x5042('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5042('0x3'))['db'];var utils=require(_0x5042('0x4'));var logger=require(_0x5042('0x5'))(_0x5042('0x6'));var config=require(_0x5042('0x7'));var jayson=require(_0x5042('0x8'));var client=jayson[_0x5042('0x9')]['http']({'port':0x232a});config[_0x5042('0xa')]=_['defaults'](config[_0x5042('0xa')],{'host':_0x5042('0xb'),'port':0x18eb});var socket=require(_0x5042('0xc'))(new Redis(config[_0x5042('0xa')]));require('./chatGroup.socket')[_0x5042('0xd')](socket);function respondWithRpcPromise(_0x187c3d,_0x3b695a,_0xf22f49){return new BPromise(function(_0x5cd589,_0x2f9a21){return client[_0x5042('0xe')](_0x187c3d,_0xf22f49)[_0x5042('0xf')](function(_0x1b6ca4){logger['info'](_0x5042('0x10'),_0x3b695a,'request\x20sent');logger[_0x5042('0x11')](_0x5042('0x12'),_0x3b695a,_0x5042('0x13'),JSON[_0x5042('0x14')](_0x1b6ca4));if(_0x1b6ca4['error']){if(_0x1b6ca4[_0x5042('0x15')][_0x5042('0x16')]===0x1f4){logger[_0x5042('0x15')](_0x5042('0x10'),_0x3b695a,_0x1b6ca4[_0x5042('0x15')][_0x5042('0x17')]);return _0x2f9a21(_0x1b6ca4['error'][_0x5042('0x17')]);}logger['error'](_0x5042('0x10'),_0x3b695a,_0x1b6ca4['error'][_0x5042('0x17')]);return _0x5cd589(_0x1b6ca4[_0x5042('0x15')][_0x5042('0x17')]);}else{logger[_0x5042('0x18')](_0x5042('0x10'),_0x3b695a,_0x5042('0x13'));_0x5cd589(_0x1b6ca4[_0x5042('0x19')][_0x5042('0x17')]);}})[_0x5042('0x1a')](function(_0x28f880){logger[_0x5042('0x15')](_0x5042('0x10'),_0x3b695a,_0x28f880);_0x2f9a21(_0x28f880);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index b3a2264..1cdf175 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 _0x9334=['removeListener','register','length','chatGroup:','./chatGroup.events','remove','update','emit'];(function(_0x4455a0,_0x1bb983){var _0x588c49=function(_0x3af4cc){while(--_0x3af4cc){_0x4455a0['push'](_0x4455a0['shift']());}};_0x588c49(++_0x1bb983);}(_0x9334,0x17c));var _0x4933=function(_0x27b0d6,_0x353d5f){_0x27b0d6=_0x27b0d6-0x0;var _0x3681e8=_0x9334[_0x27b0d6];return _0x3681e8;};'use strict';var ChatGroupEvents=require(_0x4933('0x0'));var events=['save',_0x4933('0x1'),_0x4933('0x2')];function createListener(_0x519399,_0x3b1496){return function(_0xf258a3){_0x3b1496[_0x4933('0x3')](_0x519399,_0xf258a3);};}function removeListener(_0x4abfd3,_0xd73b4f){return function(){ChatGroupEvents[_0x4933('0x4')](_0x4abfd3,_0xd73b4f);};}exports[_0x4933('0x5')]=function(_0x5663e1){for(var _0x2fcb5e=0x0,_0xfcf606=events[_0x4933('0x6')];_0x2fcb5e<_0xfcf606;_0x2fcb5e++){var _0x429313=events[_0x2fcb5e];var _0x43278f=createListener(_0x4933('0x7')+_0x429313,_0x5663e1);ChatGroupEvents['on'](_0x429313,_0x43278f);}}; \ No newline at end of file +var _0x824c=['remove','update','emit','removeListener','register','chatGroup:','./chatGroup.events','save'];(function(_0x1e0d39,_0x1b94e6){var _0x25d48e=function(_0x436584){while(--_0x436584){_0x1e0d39['push'](_0x1e0d39['shift']());}};_0x25d48e(++_0x1b94e6);}(_0x824c,0x1ee));var _0xc824=function(_0xe9ac94,_0x420848){_0xe9ac94=_0xe9ac94-0x0;var _0x25bc13=_0x824c[_0xe9ac94];return _0x25bc13;};'use strict';var ChatGroupEvents=require(_0xc824('0x0'));var events=[_0xc824('0x1'),_0xc824('0x2'),_0xc824('0x3')];function createListener(_0x46a501,_0x3943af){return function(_0x429d04){_0x3943af[_0xc824('0x4')](_0x46a501,_0x429d04);};}function removeListener(_0x386516,_0x22770e){return function(){ChatGroupEvents[_0xc824('0x5')](_0x386516,_0x22770e);};}exports[_0xc824('0x6')]=function(_0x2cf32b){for(var _0x22f242=0x0,_0x4c3033=events['length'];_0x22f242<_0x4c3033;_0x22f242++){var _0x2c88f2=events[_0x22f242];var _0x9992c6=createListener(_0xc824('0x7')+_0x2c88f2,_0x2cf32b);ChatGroupEvents['on'](_0x2c88f2,_0x9992c6);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index c272a6e..544709b 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 _0x071a=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','get','/describe','describe','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','create','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout'];(function(_0x314783,_0x36ba64){var _0x581e4a=function(_0x48fe30){while(--_0x48fe30){_0x314783['push'](_0x314783['shift']());}};_0x581e4a(++_0x36ba64);}(_0x071a,0x1f0));var _0xa071=function(_0x596053,_0x1a9efd){_0x596053=_0x596053-0x0;var _0x1fb180=_0x071a[_0x596053];return _0x1fb180;};'use strict';var multer=require(_0xa071('0x0'));var util=require(_0xa071('0x1'));var path=require(_0xa071('0x2'));var timeout=require(_0xa071('0x3'));var express=require('express');var router=express[_0xa071('0x4')]();var auth=require(_0xa071('0x5'));var interaction=require(_0xa071('0x6'));var config=require(_0xa071('0x7'));var controller=require(_0xa071('0x8'));router['get']('/',auth[_0xa071('0x9')](),controller['index']);router[_0xa071('0xa')](_0xa071('0xb'),auth[_0xa071('0x9')](),controller[_0xa071('0xc')]);router[_0xa071('0xa')](_0xa071('0xd'),auth[_0xa071('0x9')](),controller['show']);router[_0xa071('0xa')](_0xa071('0xe'),auth[_0xa071('0x9')](),controller[_0xa071('0xf')]);router[_0xa071('0xa')](_0xa071('0x10'),auth[_0xa071('0x9')](),controller[_0xa071('0x11')]);router['get'](_0xa071('0x12'),auth['isAuthenticated'](),controller['getMessages']);router[_0xa071('0x13')]('/',auth['isAuthenticated'](),controller[_0xa071('0x14')]);router[_0xa071('0x13')](_0xa071('0x10'),auth[_0xa071('0x9')](),controller['addMembers']);router[_0xa071('0x13')](_0xa071('0x12'),auth[_0xa071('0x9')](),controller['addMessage']);router['put'](_0xa071('0xd'),auth[_0xa071('0x9')](),controller['update']);router[_0xa071('0x15')](_0xa071('0xd'),auth['isAuthenticated'](),controller[_0xa071('0x16')]);router[_0xa071('0x15')]('/:id/members',auth[_0xa071('0x9')](),controller[_0xa071('0x17')]);module[_0xa071('0x18')]=router; \ No newline at end of file +var _0x9eaa=['getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','destroy','delete','removeMembers','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/:id','show','/:id/unread','/:id/members'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x9eaa,0x70));var _0xa9ea=function(_0x5b54e5,_0x2d26fe){_0x5b54e5=_0x5b54e5-0x0;var _0x4c7885=_0x9eaa[_0x5b54e5];return _0x4c7885;};'use strict';var multer=require(_0xa9ea('0x0'));var util=require('util');var path=require(_0xa9ea('0x1'));var timeout=require(_0xa9ea('0x2'));var express=require(_0xa9ea('0x3'));var router=express['Router']();var auth=require(_0xa9ea('0x4'));var interaction=require(_0xa9ea('0x5'));var config=require('../../config/environment');var controller=require(_0xa9ea('0x6'));router[_0xa9ea('0x7')]('/',auth[_0xa9ea('0x8')](),controller['index']);router[_0xa9ea('0x7')]('/describe',auth[_0xa9ea('0x8')](),controller['describe']);router[_0xa9ea('0x7')](_0xa9ea('0x9'),auth[_0xa9ea('0x8')](),controller[_0xa9ea('0xa')]);router['get'](_0xa9ea('0xb'),auth['isAuthenticated'](),controller['getUnread']);router[_0xa9ea('0x7')](_0xa9ea('0xc'),auth['isAuthenticated'](),controller[_0xa9ea('0xd')]);router[_0xa9ea('0x7')](_0xa9ea('0xe'),auth['isAuthenticated'](),controller[_0xa9ea('0xf')]);router[_0xa9ea('0x10')]('/',auth[_0xa9ea('0x8')](),controller[_0xa9ea('0x11')]);router[_0xa9ea('0x10')](_0xa9ea('0xc'),auth[_0xa9ea('0x8')](),controller[_0xa9ea('0x12')]);router[_0xa9ea('0x10')]('/:id/messages',auth[_0xa9ea('0x8')](),controller[_0xa9ea('0x13')]);router[_0xa9ea('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xa9ea('0x9'),auth[_0xa9ea('0x8')](),controller[_0xa9ea('0x15')]);router[_0xa9ea('0x16')](_0xa9ea('0xc'),auth[_0xa9ea('0x8')](),controller[_0xa9ea('0x17')]);module[_0xa9ea('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 15d87f5..6f083bf 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 _0x7538=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','BOOLEAN'];(function(_0x3d9e55,_0x407319){var _0x4e7408=function(_0x4397fc){while(--_0x4397fc){_0x3d9e55['push'](_0x3d9e55['shift']());}};_0x4e7408(++_0x407319);}(_0x7538,0x167));var _0x8753=function(_0x2a100d,_0x52899d){_0x2a100d=_0x2a100d-0x0;var _0x393616=_0x7538[_0x2a100d];return _0x393616;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x8753('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8753('0x1')]},'ratingType':{'type':Sequelize[_0x8753('0x2')](_0x8753('0x3'),_0x8753('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x8753('0x5')]},'mailTranscript':{'type':Sequelize[_0x8753('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8753('0x7')]},'disposition':{'type':Sequelize[_0x8753('0x6')]},'note':{'type':Sequelize[_0x8753('0x6')]},'browserName':{'type':Sequelize[_0x8753('0x6')]},'browserVersion':{'type':Sequelize[_0x8753('0x6')]},'osName':{'type':Sequelize[_0x8753('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x8753('0x6')]},'deviceVendor':{'type':Sequelize[_0x8753('0x6')]},'deviceType':{'type':Sequelize[_0x8753('0x6')]},'referer':{'type':Sequelize[_0x8753('0x5')]},'customerIp':{'type':Sequelize[_0x8753('0x6')]},'formData':{'type':Sequelize[_0x8753('0x5')](_0x8753('0x8'))},'read1stAt':{'type':Sequelize[_0x8753('0x7')]},'lastMsgAt':{'type':Sequelize[_0x8753('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x8753('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8753('0x6')]},'customerPort':{'type':Sequelize[_0x8753('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x8753('0x5')]}}; \ No newline at end of file +var _0x8388=['star','thumb','TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','ENUM'];(function(_0x3443dd,_0x22bbb6){var _0x5808f1=function(_0x425dc6){while(--_0x425dc6){_0x3443dd['push'](_0x3443dd['shift']());}};_0x5808f1(++_0x22bbb6);}(_0x8388,0xc2));var _0x8838=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x8388[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x8838('0x0'));module[_0x8838('0x1')]={'closed':{'type':Sequelize[_0x8838('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x8838('0x3')](_0x8838('0x4'),_0x8838('0x5')),'defaultValue':_0x8838('0x4')},'ratingMessage':{'type':Sequelize[_0x8838('0x6')]},'pathTranscript':{'type':Sequelize[_0x8838('0x6')]},'mailTranscript':{'type':Sequelize[_0x8838('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8838('0x8')]},'disposition':{'type':Sequelize[_0x8838('0x7')]},'note':{'type':Sequelize[_0x8838('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x8838('0x7')]},'osVersion':{'type':Sequelize[_0x8838('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x8838('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x8838('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x8838('0x9'))},'read1stAt':{'type':Sequelize[_0x8838('0x8')]},'lastMsgAt':{'type':Sequelize[_0x8838('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x8838('0x3')]('in',_0x8838('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8838('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 2d43e91..dc7329d 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 _0x781d=['transcript-%d-%s.zip','firstName','lastName','direction','Account','Owner','mkdirSync','\x0a\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\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','pipe','createWriteStream','views','downloadInteraction.html','.pdf','log','err','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','json','offset','limit','Content-Range','apply','reject','save','update','destroy','status','stack','name','send','map','fullname','TagIds','forEach','push','catch','index','ChatInteraction','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','where','select','field','color','tools_tags','from','user_has_chat_interactions','users','chat_interactions','cm_contacts','left_join','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','end','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','buildExpression','text','body','start','keys','some','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','count','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','rows','show','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','POST','MotionCWB:','follow','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','download','root','server/files/attachments/','mailTranscript','join','format','transcript-%s.txt','pathTranscript','Messages','User','CmContact','%s%d','agentAlias','System','customer','ContactId','website_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','hasOwnProperty','pick','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','includeAgent','findAll','addTags','setTags','spread','emit','removeTags','files','tmp','server','attachments'];(function(_0x25367f,_0x2e2109){var _0x156639=function(_0x2f96dd){while(--_0x2f96dd){_0x25367f['push'](_0x25367f['shift']());}};_0x156639(++_0x2e2109);}(_0x781d,0x14a));var _0xd781=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x781d[_0x1ac595];return _0x455fff;};'use strict';var pdf=require(_0xd781('0x0'));var emlformat=require(_0xd781('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd781('0x2'));var rp=require(_0xd781('0x3'));var moment=require(_0xd781('0x4'));var BPromise=require(_0xd781('0x5'));var Mustache=require(_0xd781('0x6'));var util=require(_0xd781('0x7'));var path=require(_0xd781('0x8'));var sox=require(_0xd781('0x9'));var csv=require(_0xd781('0xa'));var ejs=require(_0xd781('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd781('0xc'));var crypto=require(_0xd781('0xd'));var jsforce=require(_0xd781('0xe'));var deskjs=require(_0xd781('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd781('0x10'));var Papa=require('papaparse');var Redis=require(_0xd781('0x11'));var authService=require(_0xd781('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd781('0x13'));var hardwareService=require(_0xd781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd781('0x15'));var config=require(_0xd781('0x16'));var db=require(_0xd781('0x17'))['db'];config[_0xd781('0x18')]=_[_0xd781('0x19')](config[_0xd781('0x18')],{'host':_0xd781('0x1a'),'port':0x18eb});var socket=require(_0xd781('0x1b'))(new Redis(config[_0xd781('0x18')]));require(_0xd781('0x1c'))[_0xd781('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd781('0x1e')][_0xd781('0x1f')]({'port':0x232b});var client9004=jayson['client'][_0xd781('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x48bffc,_0x294e5a,_0x22d787){if(_0x22d787){var _0x9f25f7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9f25f7[_0xd781('0x20')](_0x294e5a)){return _0x48bffc;}else{throw new db[(_0xd781('0x21'))][(_0xd781('0x22'))](_0xd781('0x23'));}}else{return _0x48bffc;}}function respondWithRpcPromise(_0x5770b0,_0x1407fc,_0x3f2922,_0x395d9c){return new BPromise(function(_0x2f1273,_0x3bf805){var _0x35e1bb=_0x395d9c||client;return _0x35e1bb[_0xd781('0x24')](_0x5770b0,_0x3f2922)[_0xd781('0x25')](function(_0x5a5ff5){logger[_0xd781('0x26')](_0xd781('0x27'),_0x1407fc,_0xd781('0x28'));logger[_0xd781('0x29')](_0xd781('0x2a'),_0x1407fc,_0xd781('0x28'),JSON[_0xd781('0x2b')](_0x5a5ff5));if(_0x5a5ff5['error']){if(_0x5a5ff5[_0xd781('0x2c')]['code']===0x1f4){logger['error'](_0xd781('0x27'),_0x1407fc,_0x5a5ff5['error'][_0xd781('0x2d')]);return _0x3bf805(_0x5a5ff5[_0xd781('0x2c')][_0xd781('0x2d')]);}logger[_0xd781('0x2c')](_0xd781('0x27'),_0x1407fc,_0x5a5ff5[_0xd781('0x2c')][_0xd781('0x2d')]);return _0x2f1273(_0x5a5ff5[_0xd781('0x2c')][_0xd781('0x2d')]);}else{logger['info']('ChatInteraction,\x20%s,\x20%s',_0x1407fc,_0xd781('0x28'));_0x2f1273(_0x5a5ff5[_0xd781('0x2e')][_0xd781('0x2d')]);}})['catch'](function(_0xa1349e){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x1407fc,_0xa1349e);_0x3bf805(_0xa1349e);});});}function respondWithStatusCode(_0x1e29c8,_0x54fe00){_0x54fe00=_0x54fe00||0xcc;return function(_0x3e868){if(_0x3e868){return _0x1e29c8[_0xd781('0x2f')](_0x54fe00);}return _0x1e29c8['status'](_0x54fe00)['end']();};}function respondWithResult(_0x43cc74,_0x5b0464){_0x5b0464=_0x5b0464||0xc8;return function(_0x296a0b){if(_0x296a0b){return _0x43cc74['status'](_0x5b0464)[_0xd781('0x30')](_0x296a0b);}};}function respondWithFilteredResult(_0x1a1d3d,_0x556127){return function(_0x54521e){if(_0x54521e){var _0x432d14=_0x54521e['count'],_0x29e81a=_0x556127[_0xd781('0x31')],_0x1c7d83=_0x556127[_0xd781('0x31')]+_0x556127[_0xd781('0x32')],_0x5a389c;if(_0x1c7d83>=_0x432d14){_0x1c7d83=_0x432d14;_0x5a389c=0xc8;}else{_0x5a389c=0xce;}_0x1a1d3d['status'](_0x5a389c);return _0x1a1d3d['set'](_0xd781('0x33'),_0x29e81a+'-'+_0x1c7d83+'/'+_0x432d14)[_0xd781('0x30')](_0x54521e);}return null;};}function patchUpdates(_0x5cc0bc){return function(_0x13c2f5){try{jsonpatch[_0xd781('0x34')](_0x13c2f5,_0x5cc0bc,!![]);}catch(_0x565556){return BPromise[_0xd781('0x35')](_0x565556);}return _0x13c2f5[_0xd781('0x36')]();};}function saveUpdates(_0xff39d3,_0x368e4e){return function(_0x51b711){if(_0x51b711){return _0x51b711[_0xd781('0x37')](_0xff39d3)[_0xd781('0x25')](function(_0x1c0b75){return _0x1c0b75;});}return null;};}function removeEntity(_0x37984e,_0x4dd2e0){return function(_0x27e3d9){if(_0x27e3d9){return _0x27e3d9[_0xd781('0x38')]()['then'](function(){_0x37984e[_0xd781('0x39')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e1603,_0x24aea2){return function(_0x57fdb6){if(!_0x57fdb6){_0x3e1603[_0xd781('0x2f')](0x194);}return _0x57fdb6;};}function handleError(_0x2c6be3,_0x4d7ef4){_0x4d7ef4=_0x4d7ef4||0x1f4;return function(_0x2a29b7){logger['error'](_0x2a29b7[_0xd781('0x3a')]);if(_0x2a29b7[_0xd781('0x3b')]){delete _0x2a29b7['name'];}_0x2c6be3[_0xd781('0x39')](_0x4d7ef4)[_0xd781('0x3c')](_0x2a29b7);};}function getInteractionUsers(_0x5651de,_0x2712c6){return new BPromise(function(_0x34528f,_0x281fcf){try{if(_0x2712c6[_0x5651de['id']]){_0x5651de['Users']=_[_0xd781('0x3d')](_0x2712c6[_0x5651de['id']],function(_0x22b94e){return{'id':_0x22b94e['id'],'fullname':_0x22b94e[_0xd781('0x3e')]};});}}catch(_0x6c67f3){_0x281fcf(_0x6c67f3);}_0x34528f(_0x5651de);});}function getInteractionTags(_0x2e8218,_0x282d30){return new BPromise(function(_0x2e31c3,_0x140567){try{if(_0x2e8218[_0xd781('0x3f')]){_0x2e8218['Tags']=[];_0x2e8218[_0xd781('0x3f')]['split'](',')[_0xd781('0x40')](function(_0x130dfc){_0x2e8218['Tags'][_0xd781('0x41')](_0x282d30[_0x130dfc]);});}delete _0x2e8218[_0xd781('0x3f')];}catch(_0x224488){_0x140567(_0x224488);}_0x2e31c3(_0x2e8218);});}function updateChatInteraction(_0x402c9c,_0x5b8f0e,_0x242381){return new BPromise(function(_0x515357,_0xb14b50){return getInteractionUsers(_0x402c9c,_0x242381)[_0xd781('0x25')](function(_0x5e3f9a){return getInteractionTags(_0x5e3f9a,_0x5b8f0e);})['then'](function(_0x1fb267){_0x515357(_0x1fb267);})[_0xd781('0x42')](function(_0x15b49d){_0xb14b50(_0x15b49d);});});}exports[_0xd781('0x43')]=function(_0x53aba6,_0x46e7f6){var _0x3ca8c7={},_0x4f35b6={},_0x4c9f47={'count':0x0,'rows':[]};var _0x263b3a=_[_0xd781('0x3d')](db[_0xd781('0x44')]['rawAttributes'],function(_0x594f85){return{'name':_0x594f85[_0xd781('0x45')],'type':_0x594f85[_0xd781('0x46')][_0xd781('0x47')]};});_0x4f35b6[_0xd781('0x48')]=_[_0xd781('0x3d')](_0x263b3a,_0xd781('0x3b'));_0x4f35b6['query']=_['keys'](_0x53aba6[_0xd781('0x49')]);_0x4f35b6[_0xd781('0x4a')]=_[_0xd781('0x4b')](_0x4f35b6[_0xd781('0x48')],_0x4f35b6[_0xd781('0x49')]);_0x3ca8c7['attributes']=_[_0xd781('0x4b')](_0x4f35b6[_0xd781('0x48')],qs[_0xd781('0x4c')](_0x53aba6['query'][_0xd781('0x4c')]));_0x3ca8c7[_0xd781('0x4d')]=_0x3ca8c7[_0xd781('0x4d')]['length']?_0x3ca8c7[_0xd781('0x4d')]:_0x4f35b6[_0xd781('0x48')];if(!_0x53aba6['query']['hasOwnProperty'](_0xd781('0x4e'))){_0x3ca8c7[_0xd781('0x32')]=qs[_0xd781('0x32')](_0x53aba6['query'][_0xd781('0x32')]);_0x3ca8c7[_0xd781('0x31')]=qs[_0xd781('0x31')](_0x53aba6[_0xd781('0x49')][_0xd781('0x31')]);}_0x3ca8c7[_0xd781('0x4f')]=qs[_0xd781('0x50')](_0x53aba6['query'][_0xd781('0x50')]);_0x3ca8c7[_0xd781('0x51')]=qs[_0xd781('0x4a')](_['pick'](_0x53aba6[_0xd781('0x49')],_0x4f35b6[_0xd781('0x4a')]),_0x263b3a);var _0x51dd6d=[];var _0xfa9f35=squel[_0xd781('0x52')]()[_0xd781('0x53')]('id')[_0xd781('0x53')](_0xd781('0x3b'))['field'](_0xd781('0x54'))['from'](_0xd781('0x55'));var _0x556ea4=squel[_0xd781('0x52')]()[_0xd781('0x53')]('u.id')[_0xd781('0x53')]('u.fullname')['field']('ui.ChatInteractionId')[_0xd781('0x56')](_0xd781('0x57'),'ui')['left_join'](_0xd781('0x58'),'u','u.id\x20=\x20ui.UserId');var _0x24b20f=squel[_0xd781('0x52')]()[_0xd781('0x56')](_0xd781('0x59'),'i')['left_join'](_0xd781('0x5a'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd781('0x5b')]('users','o',_0xd781('0x5c'))[_0xd781('0x5b')]('chat_websites','a',_0xd781('0x5d'))[_0xd781('0x5b')](_0xd781('0x5e'),'me',_0xd781('0x5f'))[_0xd781('0x5b')](_0xd781('0x60'),'it','it.ChatInteractionId\x20=\x20i.id')['left_join'](_0xd781('0x55'),'t',_0xd781('0x61'));var _0x46d6c9=squel[_0xd781('0x62')]();var _0x5e995c=[];var _0x13de66=squel['expr']();var _0x2aaa18;if(_0x53aba6[_0xd781('0x49')][_0xd781('0x63')]){_0x2aaa18=as[_0xd781('0x64')](_0x53aba6['query']['search']);var _0x41cb25=_0x2aaa18['sqlOperator'];for(var _0x17abb1=0x0;_0x17abb1<_0x2aaa18[_0xd781('0x65')][_0xd781('0x66')];_0x17abb1++){var _0x1a590d=_0x2aaa18[_0xd781('0x65')][_0x17abb1];var _0x49b84f='i';var _0x34bdba=_[_0xd781('0x67')](_0x263b3a,['name',_0x1a590d[_0xd781('0x53')]]);if(!_0x34bdba){switch(_0x1a590d[_0xd781('0x53')]){case _0xd781('0x68'):if(_0x1a590d[_0xd781('0x69')]==0x1){_0x24b20f[_0xd781('0x6a')]('`'+_0x1a590d[_0xd781('0x53')]+_0xd781('0x6b'));}else{_0x24b20f[_0xd781('0x6a')]('`'+_0x1a590d[_0xd781('0x53')]+_0xd781('0x6c'));}break;case _0xd781('0x6d'):if(_0x1a590d[_0xd781('0x6e')]===_0xd781('0x6f')){if(_0x1a590d[_0xd781('0x69')][_0xd781('0x70')]('\x20')[_0xd781('0x66')]>0x1){_0x46d6c9[_0x41cb25](_0xd781('0x71'),qs['getFullTextValue'](_0x1a590d[_0xd781('0x69')]),null);}else{var _0x947f4c='%'+_0x1a590d[_0xd781('0x69')]+'%';_0x46d6c9[_0x41cb25](_0xd781('0x72'),_0x947f4c,_0x947f4c,_0x947f4c);}}else{_0x34bdba=_[_0xd781('0x67')](_0x263b3a,['name','ContactId']);_0x1a590d[_0xd781('0x53')]='ContactId';_0x469a6e=as['buildExpression'](_0x49b84f,_0x34bdba['type'],_0x1a590d);_0x46d6c9[_0x41cb25](_0x469a6e['text'],_0x469a6e[_0xd781('0x69')]['start'],_0x469a6e[_0xd781('0x69')][_0xd781('0x73')]);}break;case _0xd781('0x74'):var _0x559a41=_0x1a590d[_0xd781('0x69')]['split'](',')[_0xd781('0x3d')](function(_0x455117){return Number(_0x455117);});_0x559a41[_0xd781('0x40')](function(_0x214de8){_0x13de66['or'](_0xd781('0x75'),'%,'+_0x214de8+',%');});_0x5e995c=_[_0xd781('0x76')](_0x5e995c,_0x559a41);break;case'User':if(_0x1a590d['operator']===_0xd781('0x6f')){_0x46d6c9[_0x41cb25]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1a590d[_0xd781('0x69')]+'%',null);}else{_0x34bdba=_[_0xd781('0x67')](_0x263b3a,[_0xd781('0x3b'),_0xd781('0x77')]);_0x1a590d['field']=_0xd781('0x77');_0x469a6e=as[_0xd781('0x78')](_0x49b84f,_0x34bdba[_0xd781('0x46')],_0x1a590d);_0x46d6c9[_0x41cb25](_0x469a6e[_0xd781('0x79')],_0x469a6e[_0xd781('0x69')]['start'],_0x469a6e[_0xd781('0x69')]['end']);}break;case _0xd781('0x7a'):_0x469a6e=as[_0xd781('0x78')]('me',null,_0x1a590d);_0x46d6c9[_0x41cb25](_0x469a6e['text'],_0x469a6e['value'][_0xd781('0x7b')],_0x469a6e[_0xd781('0x69')][_0xd781('0x73')]);break;}}else{var _0x469a6e=as[_0xd781('0x78')](_0x49b84f,_0x34bdba[_0xd781('0x46')],_0x1a590d);_0x46d6c9[_0x41cb25](_0x469a6e[_0xd781('0x79')],_0x469a6e[_0xd781('0x69')][_0xd781('0x7b')],_0x469a6e['value'][_0xd781('0x73')]);}}}else{var _0x43255a=_(_0x53aba6['query'])[_0xd781('0x7c')]()['map'](function(_0x2948a6){return _[_0xd781('0x7d')](_0x263b3a,['name',_0x2948a6])?_0x2948a6:undefined;})['compact']()[_0xd781('0x69')]();if(!_[_0xd781('0x7e')](_0x43255a)){_0x43255a[_0xd781('0x40')](function(_0x10cba5){if(_0x10cba5===_0xd781('0x7f')){_0x24b20f[_0xd781('0x51')]('i.ChatWebsiteId\x20IN\x20?',[][_0xd781('0x80')](_0x53aba6[_0xd781('0x49')][_0x10cba5]));}else if(_0x10cba5===_0xd781('0x81')){var _0x1cf851=JSON[_0xd781('0x82')](_0x53aba6[_0xd781('0x49')][_0x10cba5])[_0xd781('0x83')];var _0x38fbc3=JSON[_0xd781('0x82')](_0x53aba6[_0xd781('0x49')][_0x10cba5])[_0xd781('0x84')];_0x24b20f['where'](_0xd781('0x85'),_0x1cf851,_0x38fbc3);}else{if(_0x53aba6['query'][_0x10cba5]===_0xd781('0x86')){_0x24b20f[_0xd781('0x51')]('i.'+_0x10cba5+_0xd781('0x87'));}else{_0x24b20f[_0xd781('0x51')]('i.'+_0x10cba5+_0xd781('0x88'),_0x53aba6[_0xd781('0x49')][_0x10cba5]);}}});}if(_0x53aba6[_0xd781('0x49')][_0xd781('0x89')]){if(_0x53aba6[_0xd781('0x49')][_0xd781('0x89')]==0x1){_0x24b20f['having'](_0xd781('0x8a'));}else{_0x24b20f[_0xd781('0x6a')]('`unreadMessages`\x20>\x200');}}if(_0x53aba6[_0xd781('0x49')][_0xd781('0x8b')]){_0x5e995c=_[_0xd781('0x8c')](_0x53aba6['query']['tag'])?_0x53aba6[_0xd781('0x49')]['tag']:new Array(_0x53aba6[_0xd781('0x49')][_0xd781('0x8b')]);_0x5e995c[_0xd781('0x40')](function(_0x1624a3){_0x13de66['or'](_0xd781('0x75'),'%,'+_0x1624a3+',%');});}if(_0x53aba6['query'][_0xd781('0x8d')]){var _0x415beb=_0x53aba6[_0xd781('0x49')][_0xd781('0x8d')][_0xd781('0x8e')]('\x5c','\x5c\x5c')[_0xd781('0x8e')]('\x27\x27',_0xd781('0x8f'));if(qs[_0xd781('0x90')](_0x415beb)){_0x46d6c9['or'](_0xd781('0x91'),_0x415beb+'%');}else{_0x46d6c9['or'](_0xd781('0x92'),qs[_0xd781('0x93')](_0x415beb))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x415beb+'%');}}}_0x24b20f[_0xd781('0x51')](_0x46d6c9);_0x24b20f[_0xd781('0x94')]('i.id');var _0x2e346d={'type':db[_0xd781('0x21')][_0xd781('0x95')]['SELECT'],'raw':!![]};var _0x402fa6=_0x24b20f[_0xd781('0x96')]();_0x402fa6['field'](_0xd781('0x97'));_0x402fa6['field'](_0xd781('0x98'),_0xd781('0x68'));if(_0x3ca8c7[_0xd781('0x4f')]){_0x3ca8c7[_0xd781('0x4f')][_0xd781('0x40')](function(_0x5d6524){_0x24b20f[_0xd781('0x4f')]('i.'+_0x5d6524[0x0],_0x5d6524[0x1]===_0xd781('0x99')?![]:!![]);});}if(!_[_0xd781('0x7e')](_0x5e995c)){_0x24b20f[_0xd781('0x6a')](_0x13de66);_0x402fa6[_0xd781('0x51')](_0xd781('0x9a'),_0x5e995c);}BPromise['resolve']()[_0xd781('0x25')](function(){if(!_0x2aaa18){if(_0x53aba6[_0xd781('0x49')]['ChatWebsiteId']||_0x53aba6[_0xd781('0x49')][_0xd781('0x9b')])return;_0x402fa6['where'](_0xd781('0x9c'));_0x24b20f[_0xd781('0x51')](_0xd781('0x9c'));return;}return _0x53aba6[_0xd781('0x9d')][_0xd781('0x9e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x50cfad){if(_['isEmpty'](_0x50cfad)){_0x402fa6[_0xd781('0x51')](_0xd781('0x9f'));_0x24b20f[_0xd781('0x51')](_0xd781('0x9f'));}else{_0x402fa6[_0xd781('0x51')](_0xd781('0xa0'),_[_0xd781('0x3d')](_0x50cfad,'id'));_0x24b20f[_0xd781('0x51')](_0xd781('0xa0'),_['map'](_0x50cfad,'id'));}});})[_0xd781('0x25')](function(){db[_0xd781('0xa1')][_0xd781('0x49')](_0x402fa6[_0xd781('0xa2')](),_0x2e346d)[_0xd781('0x25')](function(_0x5dccc5){_0x4c9f47['count']=_0x5dccc5['length'];if(_0x4c9f47[_0xd781('0xa3')]===0x0)return[];return db['sequelize'][_0xd781('0x49')](_0xfa9f35[_0xd781('0xa2')](),_0x2e346d)['then'](function(_0x524aaf){_0x51dd6d=_[_0xd781('0xa4')](_0x524aaf,'id');_0x2e346d=_[_0xd781('0xa5')](_0x2e346d,{'model':db[_0xd781('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x53aba6[_0xd781('0x49')]['fields']){_0x3ca8c7[_0xd781('0x4d')][_0xd781('0x40')](function(_0x11f220){_0x24b20f[_0xd781('0x53')]('i.'+_0x11f220);});}else{_0x24b20f[_0xd781('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd781('0x68'));_0x24b20f[_0xd781('0x53')]('a.key',_0xd781('0xa6'));_0x24b20f[_0xd781('0x53')](_0xd781('0xa7'),_0xd781('0xa8'));_0x24b20f[_0xd781('0x53')](_0xd781('0xa9'));_0x24b20f[_0xd781('0x53')](_0xd781('0xaa'),'Contact.firstName');_0x24b20f['field'](_0xd781('0xab'),_0xd781('0xac'));_0x24b20f['field'](_0xd781('0xad'),_0xd781('0xae'));_0x24b20f['field'](_0xd781('0xaf'),_0xd781('0xb0'));_0x24b20f['field'](_0xd781('0xb1'),'Contact.mobile');_0x24b20f[_0xd781('0x53')](_0xd781('0xb2'),_0xd781('0xb3'));_0x24b20f['field']('o.fullname',_0xd781('0xb4'));_0x24b20f[_0xd781('0x53')]('o.internal',_0xd781('0xb5'));_0x24b20f[_0xd781('0x53')](_0xd781('0xb6'),_0xd781('0x3f'));}if(_0x3ca8c7[_0xd781('0x32')])_0x24b20f[_0xd781('0x32')](_0x3ca8c7[_0xd781('0x32')]);if(_0x3ca8c7[_0xd781('0x31')])_0x24b20f['offset'](_0x3ca8c7[_0xd781('0x31')]);return db[_0xd781('0xa1')][_0xd781('0x49')](_0x24b20f[_0xd781('0xa2')](),_0x2e346d);})[_0xd781('0x25')](function(_0x4c2073){_0x556ea4[_0xd781('0x51')](_0xd781('0xb7'),_[_0xd781('0x3d')](_0x4c2073,'id'));return db[_0xd781('0xa1')][_0xd781('0x49')](_0x556ea4[_0xd781('0xa2')](),_0x2e346d)[_0xd781('0x25')](function(_0x5628ba){var _0x50907b=_['groupBy'](_0x5628ba,'ChatInteractionId');var _0x307e1b=[];_0x4c2073['forEach'](function(_0x38a46a){_0x307e1b['push'](updateChatInteraction(_0x38a46a,_0x51dd6d,_0x50907b));});return BPromise['all'](_0x307e1b);});});})[_0xd781('0x25')](function(_0x35ee69){_0x4c9f47[_0xd781('0xb8')]=_0x35ee69;return _0x4c9f47;})[_0xd781('0x25')](respondWithFilteredResult(_0x46e7f6,_0x3ca8c7));})[_0xd781('0x42')](handleError(_0x46e7f6,null));};exports[_0xd781('0xb9')]=function(_0x465203,_0xbf8955){var _0xb919cf={'raw':![],'where':{'id':_0x465203[_0xd781('0xba')]['id']}},_0x467edc={};_0x467edc[_0xd781('0x48')]=_[_0xd781('0x7c')](db['ChatInteraction'][_0xd781('0xbb')]);_0x467edc[_0xd781('0x49')]=_[_0xd781('0x7c')](_0x465203[_0xd781('0x49')]);_0x467edc[_0xd781('0x4a')]=_[_0xd781('0x4b')](_0x467edc[_0xd781('0x48')],_0x467edc['query']);_0xb919cf[_0xd781('0x4d')]=_[_0xd781('0x4b')](_0x467edc[_0xd781('0x48')],qs[_0xd781('0x4c')](_0x465203['query'][_0xd781('0x4c')]));_0xb919cf[_0xd781('0x4d')]=_0xb919cf['attributes'][_0xd781('0x66')]?_0xb919cf['attributes']:_0x467edc['model'];if(_0x465203['query'][_0xd781('0xbc')]){_0xb919cf[_0xd781('0xbd')]=[{'all':!![]}];}_0xb919cf=_['merge']({},_0xb919cf,_0x465203[_0xd781('0xbe')]);return db[_0xd781('0x44')][_0xd781('0x67')](_0xb919cf)[_0xd781('0x25')](handleEntityNotFound(_0xbf8955,null))[_0xd781('0x25')](respondWithResult(_0xbf8955,null))[_0xd781('0x42')](handleError(_0xbf8955,null));};exports[_0xd781('0xbf')]=function(_0x526435,_0x22a31d){return db[_0xd781('0x44')]['create'](_0x526435[_0xd781('0x7a')],{})[_0xd781('0x25')](respondWithResult(_0x22a31d,0xc9))['catch'](handleError(_0x22a31d,null));};exports[_0xd781('0x37')]=function(_0x58c072,_0x5eff6e){if(_0x58c072[_0xd781('0x7a')]['id']){delete _0x58c072[_0xd781('0x7a')]['id'];}return db[_0xd781('0x44')][_0xd781('0x67')]({'where':{'id':_0x58c072[_0xd781('0xba')]['id']}})[_0xd781('0x25')](handleEntityNotFound(_0x5eff6e,null))[_0xd781('0x25')](saveUpdates(_0x58c072['body'],null))[_0xd781('0x25')](respondWithResult(_0x5eff6e,null))[_0xd781('0x42')](handleError(_0x5eff6e,null));};exports['destroy']=function(_0x18bfe8,_0x266cf6){return db[_0xd781('0x44')][_0xd781('0x67')]({'where':{'id':_0x18bfe8[_0xd781('0xba')]['id']}})['then'](handleEntityNotFound(_0x266cf6,null))[_0xd781('0x25')](removeEntity(_0x266cf6,null))[_0xd781('0x42')](handleError(_0x266cf6,null));};exports[_0xd781('0xc0')]=function(_0x5ef9b7,_0x45330f){return db[_0xd781('0x44')][_0xd781('0xc0')]()['then'](respondWithResult(_0x45330f,null))[_0xd781('0x42')](handleError(_0x45330f,null));};exports[_0xd781('0xc1')]=function(_0x230e3a,_0x5b3d43){var _0x281be6=_0x230e3a[_0xd781('0xba')]['id'];var _0x44116d;var _0x5651ff;var _0x148de0;return db[_0xd781('0x44')][_0xd781('0xc2')]({'where':{'id':_0x281be6}})[_0xd781('0x25')](function(_0x3c0f63){_0x44116d=_0x3c0f63;return db[_0xd781('0xc3')][_0xd781('0xc2')]({'where':{'id':_0x3c0f63['ChatWebsiteId']},'attributes':['id',_0xd781('0xc4'),'vidaooEscalation'],'raw':!![]});})[_0xd781('0x25')](function(_0x7f8d5){if(_0x7f8d5&&_0x7f8d5[_0xd781('0xc4')]&&_0x7f8d5[_0xd781('0xc5')]){_0x5651ff=_0x7f8d5;var _0x5ceadf={'rejectUnauthorized':![],'method':_0xd781('0xc6'),'uri':'https://api-vidaoo.xcally.com/api/v1/sessions','headers':{'X-APIKEY':_0x7f8d5[_0xd781('0xc4')]},'body':{'name':_0xd781('0xc7')+_0x281be6},'redirect':_0xd781('0xc8'),'json':!![]};return rp(_0x5ceadf);}else{throw new db[(_0xd781('0x21'))][(_0xd781('0x22'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd781('0x25')](function(_0x22ce85){_0x148de0=_0x22ce85;if(_0x148de0['id']){var _0x1237dd={'body':_0x148de0['join_url'],'ChatWebsiteId':_0x5651ff['id'],'ChatInteractionId':_0x44116d['id'],'direction':_0xd781('0xc9'),'UserId':_0x230e3a['user']['id']};return db[_0xd781('0xca')]['create'](_0x1237dd,{});}else{throw new db[(_0xd781('0x21'))][(_0xd781('0x22'))](_0xd781('0xcb'));}})['then'](function(){return _0x44116d['updateAttributes']({'vidaooSessionId':_0x148de0['id']});})[_0xd781('0x25')](respondWithResult(_0x5b3d43,null))[_0xd781('0x42')](handleError(_0x5b3d43,null));};exports['customUpdate']=function(_0xec199c,_0x49d8d0){if(_0xec199c['body']['id']){delete _0xec199c[_0xd781('0x7a')]['id'];}return db[_0xd781('0x44')][_0xd781('0x67')]({'where':{'id':_0xec199c[_0xd781('0xba')]['id']}})[_0xd781('0x25')](handleEntityNotFound(_0x49d8d0,null))[_0xd781('0x25')](saveUpdates(_0xec199c[_0xd781('0x7a')],null))['then'](respondWithResult(_0x49d8d0,null))['catch'](handleError(_0x49d8d0,null));};exports[_0xd781('0xcc')]=function(_0x1026b8,_0x2e36e7,_0x28f693){if(_0x1026b8['body']['id']){delete _0x1026b8[_0xd781('0x7a')]['id'];}return db[_0xd781('0x44')][_0xd781('0x67')]({'where':{'id':_0x1026b8[_0xd781('0xba')]['id']}})['then'](function(_0x1eaca5){if(!_0x1eaca5){logger[_0xd781('0x2c')](_0xd781('0xcd'),'abandon',0x194,_0xd781('0xce'));_0x2e36e7[_0xd781('0x2f')](0x194);}else{if(_0x1eaca5['UserId']){throw new db[(_0xd781('0x21'))][(_0xd781('0x22'))](_0xd781('0xcf'));}}return _0x1eaca5;})[_0xd781('0x25')](function(_0x5bc0e9){if(_0x5bc0e9){return _0x5bc0e9[_0xd781('0x37')]({'closed':_0x1026b8[_0xd781('0x7a')][_0xd781('0xd0')],'disposition':_0x1026b8['body'][_0xd781('0xd1')]})[_0xd781('0x25')](function(_0x464ada){return _0x464ada;});}})[_0xd781('0x25')](function(_0x2b450d){return respondWithRpcPromise(_0xd781('0xd2'),_0xd781('0xcc'),_0x1026b8['body'],client9004);})[_0xd781('0x25')](respondWithResult(_0x2e36e7,null))[_0xd781('0x42')](handleError(_0x2e36e7,null));};exports[_0xd781('0xd3')]=function(_0x345eee,_0xd18914,_0xe72892){_0x345eee[_0xd781('0x7a')][_0xd781('0x3b')]=_0x345eee[_0xd781('0xd4')][_0xd781('0xd5')];_0x345eee[_0xd781('0x7a')][_0xd781('0xd6')]=_0x345eee[_0xd781('0xd4')][_0xd781('0xd7')];_0x345eee['body'][_0xd781('0x46')]=_0x345eee[_0xd781('0xd4')][_0xd781('0xd8')];return db[_0xd781('0xd9')]['create'](_0x345eee['body'])['then'](respondWithResult(_0xd18914,0xc9))[_0xd781('0x42')](handleError(_0xd18914,null));};exports[_0xd781('0xda')]=function(_0xc843d9,_0x36915a,_0x1e4f60){return db[_0xd781('0x44')][_0xd781('0xc2')]({'where':{'id':_0xc843d9[_0xd781('0xba')]['id']},'raw':!![]})[_0xd781('0x25')](handleEntityNotFound(_0x36915a,null))['then'](function(_0xf3908){if(_0xf3908){if(_0xf3908[_0xd781('0xd0')]){return _0x36915a[_0xd781('0x39')](0x193)['json']({'status':0x193,'message':_0xd781('0xdb')});}return db[_0xd781('0xd9')]['findOne']({'where':{'id':_0xc843d9[_0xd781('0x49')][_0xd781('0xdc')]},'raw':!![]})[_0xd781('0x25')](handleEntityNotFound(_0x36915a,null));}})['then'](function(_0x2a19b1){if(_0x2a19b1){return _0x36915a[_0xd781('0xdd')](path['join'](config[_0xd781('0xde')],_0xd781('0xdf'),_0x2a19b1[_0xd781('0xd6')]));}})['catch'](handleError(_0x36915a,null));};exports['close']=function(_0x2c26f2,_0x3e6183){var _0x1f3e3c=null;var _0x4d64b2=null;var _0x540a86=null;var _0x3607cc=null;if(_0x2c26f2['body']['id']){delete _0x2c26f2[_0xd781('0x7a')]['id'];}if(_0x2c26f2['body'][_0xd781('0xe0')]){_0x3607cc=path[_0xd781('0xe1')](config[_0xd781('0xde')],'server/files/chat/upload/',util[_0xd781('0xe2')](_0xd781('0xe3'),Date['now']()));_0x2c26f2[_0xd781('0x7a')][_0xd781('0xe4')]=_0x3607cc;}return db[_0xd781('0x44')]['find']({'where':{'id':_0x2c26f2[_0xd781('0xba')]['id']},'include':[{'model':db[_0xd781('0xca')],'as':_0xd781('0xe5'),'include':[{'model':db[_0xd781('0xe6')],'as':_0xd781('0xe6')}]}]})['then'](handleEntityNotFound(_0x3e6183,null))[_0xd781('0x25')](saveUpdates(_0x2c26f2['body'],null))[_0xd781('0x25')](function(_0x29eacc){if(_0x29eacc){_0x1f3e3c=_0x29eacc;return db['ChatWebsite']['find']({'where':{'id':_0x1f3e3c[_0xd781('0x7f')]}});}})[_0xd781('0x25')](function(_0x55a1e7){if(_0x55a1e7){_0x540a86=_0x55a1e7;return db[_0xd781('0xe7')]['find']({'where':{'id':_0x1f3e3c['ContactId']}});}})['then'](function(_0x5e37f2){if(_0x5e37f2){_0x4d64b2=_0x5e37f2;if(_0x3607cc){var _0x3353d8=null;for(var _0x531d5f=0x1;_0x531d5f<_0x1f3e3c[_0xd781('0xe5')][_0xd781('0x66')];++_0x531d5f){_0x3353d8=_0x1f3e3c[_0xd781('0xe5')][_0x531d5f];var _0x21c0ae=_0x3353d8[_0xd781('0x77')]?util[_0xd781('0xe2')](_0xd781('0xe8'),_0x540a86[_0xd781('0xe9')],_0x3353d8[_0xd781('0x77')]):_0xd781('0xea');var _0x529748=_0x2c26f2[_0xd781('0x7a')][_0xd781('0xeb')]||util[_0xd781('0xe2')](_0xd781('0xe8'),'Visitor',_0x3353d8[_0xd781('0xec')]);switch(_0x540a86['agentIdentifier']){case _0xd781('0xed'):_0x21c0ae=_0x3353d8['UserId']?util['format']('%s%d',_0x540a86['agentAlias'],_0x3353d8[_0xd781('0x77')]):_0xd781('0xea');break;case'agent_alias':_0x21c0ae=_0x3353d8['UserId']?_0x3353d8[_0xd781('0xe6')][_0xd781('0xee')]||_0x3353d8[_0xd781('0xe6')][_0xd781('0x3e')]:_0xd781('0xea');break;case'agent_fullname':_0x21c0ae=_0x3353d8[_0xd781('0x77')]?_0x3353d8[_0xd781('0xe6')]['fullname']:_0xd781('0xea');break;default:_0x21c0ae=_0x3353d8[_0xd781('0x77')]?util[_0xd781('0xe2')]('%s%d',_0x540a86['agentAlias'],_0x3353d8[_0xd781('0x77')]):_0xd781('0xea');}var _0x3c695f=util['format'](_0xd781('0xef'),moment(_0x3353d8['createdAt'])[_0xd781('0xe2')](_0xd781('0xf0')),_0x3353d8['direction']==='in'?_0x529748:_0x21c0ae,_0x3353d8[_0xd781('0x7a')]);if(!_0x3353d8[_0xd781('0xf1')]){fs[_0xd781('0xf2')](_0x3607cc,_0x3c695f);}}return db['MailAccount'][_0xd781('0xc2')]({'where':{'service':!![]},'include':[{'model':db[_0xd781('0xf3')],'as':_0xd781('0xf4'),'raw':!![]}]});}}})[_0xd781('0x25')](function(_0x26306b){if(_0x26306b&&_0x26306b[_0xd781('0xf4')]&&_0x2c26f2[_0xd781('0x7a')]){var _0x4d6485={'tls':{'rejectUnauthorized':![]}};if(_0x26306b['Smtp']['service']){_0x4d6485[_0xd781('0xf5')]=_0x26306b['Smtp'][_0xd781('0xf5')];}else{_0x4d6485[_0xd781('0xf6')]=_0x26306b[_0xd781('0xf4')][_0xd781('0xf6')];_0x4d6485[_0xd781('0xf7')]=_0x26306b[_0xd781('0xf4')][_0xd781('0xf7')];_0x4d6485[_0xd781('0xf8')]=_0x26306b[_0xd781('0xf4')]['secure'];}if(_0x26306b[_0xd781('0xf4')][_0xd781('0xf9')]){_0x4d6485[_0xd781('0xfa')]={'user':_0x26306b[_0xd781('0xf4')]['user'],'pass':_0x26306b[_0xd781('0xf4')][_0xd781('0xfb')]};}return respondWithRpcPromise(_0xd781('0xfc'),_0xd781('0xfd'),{'account':_0x4d6485,'message':{'from':util['format'](_0xd781('0xfe'),_0x26306b['name'],_0x26306b['email']||_0x26306b[_0xd781('0xf4')][_0xd781('0x9d')]),'to':_0x2c26f2[_0xd781('0x7a')][_0xd781('0xe0')],'subject':_0xd781('0xff'),'text':util['format'](_0xd781('0x100'),_0x2c26f2['body'][_0xd781('0xe0')]),'attachments':[{'path':_0x3607cc}]}})[_0xd781('0x25')](function(){return _0x1f3e3c;})[_0xd781('0x42')](function(_0x5232da){console[_0xd781('0x2c')](_0x5232da);});}else{return _0x1f3e3c;}})[_0xd781('0x25')](respondWithStatusCode(_0x3e6183,0xc8))[_0xd781('0x42')](handleError(_0x3e6183,null));};exports[_0xd781('0x101')]=function(_0x4b86f1,_0x3faff7,_0x475a40){return db['ChatMessage']['find']({'where':{'id':_0x4b86f1['params']['id']}})[_0xd781('0x25')](handleEntityNotFound(_0x3faff7,null))['then'](function(_0x34bc95){if(_0x34bc95){return _0x34bc95[_0xd781('0x101')](_0x4b86f1['body'][_0xd781('0x102')],_['omit'](_0x4b86f1[_0xd781('0x7a')],[_0xd781('0x102'),'id'])||{});}})[_0xd781('0x25')](respondWithResult(_0x3faff7,null))[_0xd781('0x42')](handleError(_0x3faff7,null));};exports[_0xd781('0x103')]=function(_0x197d76,_0x3ef6e8,_0x50ff81){var _0x2bcc8e={'raw':![],'where':{}};var _0x185e3b={};var _0x54fa47={'count':0x0,'rows':[]};return db[_0xd781('0x44')]['findOne']({'where':{'id':_0x197d76[_0xd781('0xba')]['id']}})[_0xd781('0x25')](handleEntityNotFound(_0x3ef6e8,null))[_0xd781('0x25')](function(_0x1202e5){if(_0x1202e5){_0x185e3b[_0xd781('0x48')]=_[_0xd781('0x7c')](db['ChatMessage']['rawAttributes']);_0x185e3b[_0xd781('0x49')]=_['keys'](_0x197d76[_0xd781('0x49')]);_0x185e3b[_0xd781('0x4a')]=_[_0xd781('0x4b')](_0x185e3b[_0xd781('0x48')],_0x185e3b[_0xd781('0x49')]);_0x2bcc8e[_0xd781('0x4d')]=_[_0xd781('0x4b')](_0x185e3b[_0xd781('0x48')],qs[_0xd781('0x4c')](_0x197d76[_0xd781('0x49')][_0xd781('0x4c')]));_0x2bcc8e['attributes']=_0x2bcc8e[_0xd781('0x4d')][_0xd781('0x66')]?_0x2bcc8e[_0xd781('0x4d')]:_0x185e3b[_0xd781('0x48')];if(!_0x197d76[_0xd781('0x49')][_0xd781('0x104')](_0xd781('0x4e'))){_0x2bcc8e['limit']=qs[_0xd781('0x32')](_0x197d76[_0xd781('0x49')][_0xd781('0x32')]);_0x2bcc8e[_0xd781('0x31')]=qs['offset'](_0x197d76[_0xd781('0x49')][_0xd781('0x31')]);}_0x2bcc8e[_0xd781('0x4f')]=qs[_0xd781('0x50')](_0x197d76[_0xd781('0x49')][_0xd781('0x50')]);_0x2bcc8e[_0xd781('0x51')]=qs['filters'](_[_0xd781('0x105')](_0x197d76[_0xd781('0x49')],_0x185e3b['filters']));_0x2bcc8e[_0xd781('0x51')][_0xd781('0x106')]=_0x1202e5['id'];if(_0x197d76['query']['filter']){_0x2bcc8e[_0xd781('0x51')]=_[_0xd781('0xa5')](_0x2bcc8e[_0xd781('0x51')],{'$or':_[_0xd781('0x3d')](_0x2bcc8e[_0xd781('0x4d')],function(_0x14cc41){var _0x37ba59={};_0x37ba59[_0x14cc41]={'$like':'%'+_0x197d76[_0xd781('0x49')][_0xd781('0x8d')]+'%'};return _0x37ba59;})});}if(_0x197d76['query'][_0xd781('0x83')]){var _0x230d11=_0x197d76[_0xd781('0x49')][_0xd781('0x83')][_0xd781('0x70')](',');var _0x49037f={};_0x49037f[_0x230d11[0x0]]={'$gte':moment(_0x230d11[0x1])[_0xd781('0xe2')](_0xd781('0x107'))};_0x2bcc8e['where']=_['merge'](_0x2bcc8e['where'],_0x49037f);}_0x2bcc8e=_[_0xd781('0xa5')]({},_0x2bcc8e,_0x197d76[_0xd781('0xbe')]);return db[_0xd781('0xca')][_0xd781('0xa3')]({'where':_0x2bcc8e[_0xd781('0x51')]})[_0xd781('0x25')](function(_0x486fe1){_0x54fa47[_0xd781('0xa3')]=_0x486fe1;if(_0x197d76[_0xd781('0x49')][_0xd781('0xbc')]){_0x2bcc8e[_0xd781('0xbd')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x2bcc8e);})[_0xd781('0x25')](function(_0x2dc8f9){_0x54fa47[_0xd781('0xb8')]=_0x2dc8f9;return _0x54fa47;});}})[_0xd781('0x25')](respondWithFilteredResult(_0x3ef6e8,_0x2bcc8e))[_0xd781('0x42')](handleError(_0x3ef6e8,null));};exports[_0xd781('0x108')]=function(_0x3c241f,_0x15ad71,_0x56ea0c){var _0x254e62={'where':{}},_0x433d6c={},_0x55666b={'count':0x0,'rows':[]};return db[_0xd781('0x44')][_0xd781('0xc2')]({'where':{'id':_0x3c241f['params']['id']}})[_0xd781('0x25')](handleEntityNotFound(_0x15ad71,null))[_0xd781('0x25')](function(_0x58f9fc){if(_0x58f9fc){_0x433d6c[_0xd781('0x48')]=_[_0xd781('0x7c')](db[_0xd781('0xca')][_0xd781('0xbb')]);_0x433d6c[_0xd781('0x49')]=_[_0xd781('0x7c')](_0x3c241f['query']);_0x433d6c['filters']=_['intersection'](_0x433d6c[_0xd781('0x48')],_0x433d6c[_0xd781('0x49')]);_0x254e62[_0xd781('0x4d')]=_[_0xd781('0x4b')](_0x433d6c[_0xd781('0x48')],qs[_0xd781('0x4c')](_0x3c241f[_0xd781('0x49')]['fields']));_0x254e62[_0xd781('0x4d')]=_0x254e62[_0xd781('0x4d')][_0xd781('0x66')]?_0x254e62[_0xd781('0x4d')]:_0x433d6c[_0xd781('0x48')];if(!_0x3c241f[_0xd781('0x49')][_0xd781('0x104')](_0xd781('0x4e'))){_0x254e62[_0xd781('0x32')]=qs[_0xd781('0x32')](_0x3c241f[_0xd781('0x49')][_0xd781('0x32')]);_0x254e62[_0xd781('0x31')]=qs['offset'](_0x3c241f[_0xd781('0x49')][_0xd781('0x31')]);}_0x254e62[_0xd781('0x4f')]=qs[_0xd781('0x50')](_0x3c241f[_0xd781('0x49')]['sort']);_0x254e62[_0xd781('0x51')]=qs[_0xd781('0x4a')](_[_0xd781('0x105')](_0x3c241f[_0xd781('0x49')],_0x433d6c[_0xd781('0x4a')]));_0x254e62[_0xd781('0x51')][_0xd781('0x106')]=_0x58f9fc['id'];if(_0x3c241f[_0xd781('0x49')]['filter']){_0x254e62[_0xd781('0x51')]=_['merge'](_0x254e62[_0xd781('0x51')],{'$or':_[_0xd781('0x3d')](_0x254e62['attributes'],function(_0x3db3d0){var _0xae4517={};_0xae4517[_0x3db3d0]={'$like':'%'+_0x3c241f['query'][_0xd781('0x8d')]+'%'};return _0xae4517;})});}_0x254e62[_0xd781('0x51')][_0xd781('0xf1')]=![];if(_0x3c241f['query']['id']){_0x254e62[_0xd781('0x51')]['id']={'$gt':_0x3c241f[_0xd781('0x49')]['id']};}_0x254e62=_[_0xd781('0xa5')]({},_0x254e62,_0x3c241f[_0xd781('0xbe')]);return db[_0xd781('0xca')][_0xd781('0xa3')]({'where':_0x254e62[_0xd781('0x51')]})[_0xd781('0x25')](function(_0x51feb9){_0x55666b['count']=_0x51feb9;_0x254e62[_0xd781('0xbd')]=[];if(_0x3c241f[_0xd781('0x49')][_0xd781('0x109')]){_0x254e62[_0xd781('0xbd')][_0xd781('0x41')]({'model':db['User'],'as':'User','attributes':['id',_0xd781('0x3e'),_0xd781('0xee')]});}if(_0x3c241f['query']['includeAll']){_0x254e62[_0xd781('0xbd')]=[{'all':!![]}];}return db['ChatMessage'][_0xd781('0x10a')](_0x254e62);})[_0xd781('0x25')](function(_0x2a4dea){_0x55666b[_0xd781('0xb8')]=_0x2a4dea;return _0x55666b;});}})[_0xd781('0x25')](respondWithFilteredResult(_0x15ad71,_0x254e62))[_0xd781('0x42')](handleError(_0x15ad71,null));};exports[_0xd781('0x10b')]=function(_0x44135f,_0x397d3b,_0x3bca7c){return db['ChatInteraction'][_0xd781('0x67')]({'where':{'id':_0x44135f['params']['id']}})[_0xd781('0x25')](handleEntityNotFound(_0x397d3b,null))[_0xd781('0x25')](function(_0x2f900c){if(_0x2f900c){return _0x2f900c[_0xd781('0x10c')](_0x44135f[_0xd781('0x7a')]['ids'],_['omit'](_0x44135f[_0xd781('0x7a')],['ids','id'])||{})[_0xd781('0x10d')](function(){return db['Tag'][_0xd781('0x10a')]({'attributes':['id',_0xd781('0x3b'),_0xd781('0x54')],'where':{'id':_0x44135f['body'][_0xd781('0x102')]}});})['then'](function(_0x5bbbd8){socket[_0xd781('0x10e')]('chatInteractionTags:save',{'id':Number(_0x44135f[_0xd781('0xba')]['id']),'tags':_0x5bbbd8||[]});return{'id':Number(_0x44135f[_0xd781('0xba')]['id']),'tags':_0x5bbbd8||[]};});}})[_0xd781('0x25')](respondWithResult(_0x397d3b,null))['catch'](handleError(_0x397d3b,null));};exports['removeTags']=function(_0x28f6ca,_0x47fd62,_0x27df03){return db['ChatInteraction'][_0xd781('0x67')]({'where':{'id':_0x28f6ca['params']['id']}})[_0xd781('0x25')](handleEntityNotFound(_0x47fd62,null))[_0xd781('0x25')](function(_0x1fb5a2){if(_0x1fb5a2){return _0x1fb5a2[_0xd781('0x10f')](_0x28f6ca['query'][_0xd781('0x102')]);}})[_0xd781('0x25')](respondWithStatusCode(_0x47fd62,null))[_0xd781('0x42')](handleError(_0x47fd62,null));};exports[_0xd781('0xdd')]=function(_0x591caa,_0x2d7f36){var _0x3351ca=moment()['unix']()[_0xd781('0xa2')]();var _0x36f386=path[_0xd781('0xe1')](config[_0xd781('0xde')],'server',_0xd781('0x110'),_0xd781('0x111'));var _0x3095dc=path[_0xd781('0xe1')](config[_0xd781('0xde')],_0xd781('0x112'),_0xd781('0x110'),_0xd781('0x113'));var _0x23d33a=path[_0xd781('0xe1')](_0x36f386,_0x3351ca);var _0x35948f=util[_0xd781('0xe2')](_0xd781('0x114'),_0x591caa[_0xd781('0xba')]['id'],_0x3351ca);var _0x2b7db3=path[_0xd781('0xe1')](_0x36f386,_0x35948f);var _0x209feb=[];_0x209feb[_0xd781('0x41')]({'model':db[_0xd781('0xe6')],'as':_0xd781('0xe6'),'attributes':['id',_0xd781('0x3e')],'raw':!![]});_0x209feb[_0xd781('0x41')]({'model':db[_0xd781('0xe7')],'as':_0xd781('0x6d'),'attributes':['id',_0xd781('0x115'),_0xd781('0x116')],'raw':!![]});if(_0x591caa[_0xd781('0x49')][_0xd781('0x113')]){_0x209feb[_0xd781('0x41')]({'model':db[_0xd781('0xd9')],'as':_0xd781('0xd9'),'raw':!![]});}var _0x49ec20=[{'model':db[_0xd781('0xca')],'as':_0xd781('0xe5'),'attributes':['id',_0xd781('0x7a'),_0xd781('0x81'),_0xd781('0x117'),_0xd781('0xf1'),_0xd781('0x89')],'include':_0x209feb}];_0x49ec20['push']({'model':db[_0xd781('0xc3')],'as':_0xd781('0x118'),'attributes':['id',_0xd781('0x3b')]});_0x49ec20[_0xd781('0x41')]({'model':db[_0xd781('0xe6')],'as':_0xd781('0x119'),'attributes':['id',_0xd781('0x3e')]});return db['ChatInteraction'][_0xd781('0x67')]({'where':{'id':_0x591caa['params']['id']},'include':_0x49ec20})[_0xd781('0x25')](handleEntityNotFound(_0x2d7f36,null))[_0xd781('0x25')](function(_0x33f290){if(_0x33f290){var _0x2a7c28=_0x33f290['get']({'plain':!![]});fs[_0xd781('0x11a')](_0x23d33a);var _0x5ae38f={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':_0xd781('0x11b')}},'footer':{'height':'30px','contents':{'default':util[_0xd781('0xe2')](_0xd781('0x11c'),util['format'](_0xd781('0x11d'),_0xd781('0x11e'),_0x2a7c28['id']),moment()[_0xd781('0xe2')](_0xd781('0x11f'))[_0xd781('0xa2')]())}}};var _0x350a7d={'channel':_0xd781('0x11e'),'account':_0x2a7c28[_0xd781('0x118')][_0xd781('0x3b')],'agent':_0x2a7c28['Owner']?_0x2a7c28[_0xd781('0x119')][_0xd781('0x3e')]:_0xd781('0x120'),'createdAt':moment(_0x2a7c28['createdAt'])[_0xd781('0xe2')](_0xd781('0x107'))[_0xd781('0xa2')](),'closedAt':_0x2a7c28['closed']?moment(_0x2a7c28[_0xd781('0x121')])[_0xd781('0xe2')](_0xd781('0x107'))['toString']():'','disposition':_0x2a7c28[_0xd781('0xd1')],'chatInfo':{'browser':_0x2a7c28[_0xd781('0x122')],'os':_0x2a7c28[_0xd781('0x123')],'referer':_0x2a7c28[_0xd781('0x124')],'customerIp':_0x2a7c28[_0xd781('0x125')],'customerPort':_0x2a7c28[_0xd781('0x126')]?_0x2a7c28[_0xd781('0x126')]:'N.A.'},'messages':_(_0x2a7c28[_0xd781('0xe5')])['tail']()[_0xd781('0x8d')]({'secret':![]})[_0xd781('0x3d')](function(_0x2aaaf6){if(_0x2aaaf6[_0xd781('0xd9')]){var _0x544e57=path[_0xd781('0xe1')](_0x3095dc,_0x2aaaf6['Attachment'][_0xd781('0xd6')]);if(fs[_0xd781('0x127')](_0x544e57)){fs['createReadStream'](_0x544e57)[_0xd781('0x128')](fs[_0xd781('0x129')](path[_0xd781('0xe1')](_0x23d33a,_0x2aaaf6['Attachment']['basename'])));}}return{'date':moment(_0x2aaaf6[_0xd781('0x81')])[_0xd781('0xe2')](_0xd781('0x107'))[_0xd781('0xa2')](),'sender':_0x2aaaf6[_0xd781('0x117')]==='out'?_0x2aaaf6[_0xd781('0xe6')]?_0x2aaaf6[_0xd781('0xe6')][_0xd781('0x3e')]:_0xd781('0xea'):_0x2aaaf6[_0xd781('0x6d')][_0xd781('0x115')]+(_0x2aaaf6[_0xd781('0x6d')][_0xd781('0x116')]?'\x20'+_0x2aaaf6[_0xd781('0x6d')]['lastName']:''),'body':_0x2aaaf6[_0xd781('0xd9')]?_0x2aaaf6[_0xd781('0xd9')][_0xd781('0xd6')]:_0x2aaaf6[_0xd781('0x7a')],'direction':_0x2aaaf6[_0xd781('0x117')]==='out'?'A':'C','secret':_0x2aaaf6[_0xd781('0xf1')],'read':_0x2aaaf6[_0xd781('0x89')],'attachment':_0x2aaaf6['Attachment']};})[_0xd781('0x69')]()};return ejs['renderFile'](path['join'](config['root'],_0xd781('0x112'),_0xd781('0x12a'),_0xd781('0x12b')),{'interaction':_0x350a7d})[_0xd781('0x25')](function(_0x2894cb){return new BPromise(function(_0x45ab19,_0xc41f2c){pdf[_0xd781('0xbf')](_0x2894cb,_0x5ae38f)['toFile'](path[_0xd781('0xe1')](_0x23d33a,'transcript-'+_0x2a7c28['id']+'-'+_0x3351ca+_0xd781('0x12c')),function(_0x16b49b,_0x4424a3){if(_0x16b49b)return _0xc41f2c(_0x16b49b);_0x45ab19(_0x4424a3);});});})['then'](function(){return new BPromise(function(_0xebb435,_0x2ec038){zipdir(_0x23d33a,{'saveTo':_0x2b7db3},function(_0x5f58d0,_0x58fda7){if(_0x5f58d0)return _0x2ec038(_0x5f58d0);return _0xebb435(_0x58fda7);});})[_0xd781('0x25')](function(){return new BPromise(function(_0xa4dbd,_0x1bbc11){rimraf(_0x23d33a,function(_0x6faf18){if(_0x6faf18)_0x1bbc11(_0x6faf18);return _0xa4dbd();});});})[_0xd781('0x25')](function(){return _0x2d7f36[_0xd781('0xdd')](_0x2b7db3,_0x35948f,function(_0x4a32cb){if(_0x4a32cb){console[_0xd781('0x12d')](_0xd781('0x12e'),_0x4a32cb);}else{fs['unlinkSync'](_0x2b7db3);}});});});}else{return _0x2d7f36[_0xd781('0x2f')](0xc8);}})[_0xd781('0x42')](handleError(_0x2d7f36,null));}; \ No newline at end of file +var _0x32f4=['mailTranscript','Mail\x20Transcript','addMessage','omit','ids','rawAttributes','YYYY-MM-DD\x20HH:mm:ss','include','rows','findAll','setTags','emit','chatInteractionTags:save','removeTags','download','unix','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','10px','40px','\x0a\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\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20','YYYY-MM-DD','Chat','N.A.','closedAt','osName','referer','customerPort','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','count','offset','limit','set','apply','reject','save','update','destroy','sendStatus','stack','name','Users','map','fullname','Tags','TagIds','forEach','push','index','ChatInteraction','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','tools_tags','ui.ChatInteractionId','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','search','sqlOperator','conditions','find','having','`\x20=\x200','`\x20>\x200','Contact','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','type','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','$substring','UserId','text','body','start','end','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','SELECT','clone','unreadMessages','order','isEmpty','t.id\x20IN\x20?','resolve','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','all','show','includeAll','create','params','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/sessions','MotionCWB:','follow','Sequelize','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','basename','filename','mimetype','Attachment','Unauthorized','attachId','join','root','server/files/attachments/','close','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsite','CmContact','agentAlias','System','customer','%s%d','Visitor','agentIdentifier','website_alias','agent_alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','SendMail','sendMail','\x22%s\x22\x20<%s>','email'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x32f4,0x154));var _0x432f=function(_0x55274a,_0x1d020b){_0x55274a=_0x55274a-0x0;var _0x3a3150=_0x32f4[_0x55274a];return _0x3a3150;};'use strict';var pdf=require(_0x432f('0x0'));var emlformat=require(_0x432f('0x1'));var rimraf=require(_0x432f('0x2'));var zipdir=require(_0x432f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x432f('0x4'));var moment=require(_0x432f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x432f('0x6'));var util=require(_0x432f('0x7'));var path=require(_0x432f('0x8'));var sox=require(_0x432f('0x9'));var csv=require(_0x432f('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x432f('0xb'));var crypto=require(_0x432f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x432f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x432f('0xe'));var Papa=require(_0x432f('0xf'));var Redis=require(_0x432f('0x10'));var authService=require(_0x432f('0x11'));var qs=require(_0x432f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x432f('0x13'));var logger=require('../../config/logger')(_0x432f('0x14'));var utils=require('../../config/utils');var config=require(_0x432f('0x15'));var db=require(_0x432f('0x16'))['db'];config['redis']=_[_0x432f('0x17')](config[_0x432f('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x432f('0x19'))(new Redis(config[_0x432f('0x18')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x432f('0x1a'));var client=jayson[_0x432f('0x1b')][_0x432f('0x1c')]({'port':0x232b});var client9004=jayson[_0x432f('0x1b')][_0x432f('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x4f91c5,_0x175ba7,_0x2f0708){if(_0x2f0708){var _0x1e2c30=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e2c30[_0x432f('0x1d')](_0x175ba7)){return _0x4f91c5;}else{throw new db['Sequelize'][(_0x432f('0x1e'))](_0x432f('0x1f'));}}else{return _0x4f91c5;}}function respondWithRpcPromise(_0x42c2d2,_0x243cf,_0x3cd5da,_0x129582){return new BPromise(function(_0x5ae24e,_0x2d2c86){var _0x4ddd21=_0x129582||client;return _0x4ddd21[_0x432f('0x20')](_0x42c2d2,_0x3cd5da)[_0x432f('0x21')](function(_0x1799c4){logger[_0x432f('0x22')](_0x432f('0x23'),_0x243cf,_0x432f('0x24'));logger[_0x432f('0x25')](_0x432f('0x26'),_0x243cf,_0x432f('0x24'),JSON[_0x432f('0x27')](_0x1799c4));if(_0x1799c4[_0x432f('0x28')]){if(_0x1799c4[_0x432f('0x28')]['code']===0x1f4){logger['error'](_0x432f('0x23'),_0x243cf,_0x1799c4['error'][_0x432f('0x29')]);return _0x2d2c86(_0x1799c4['error'][_0x432f('0x29')]);}logger[_0x432f('0x28')](_0x432f('0x23'),_0x243cf,_0x1799c4[_0x432f('0x28')][_0x432f('0x29')]);return _0x5ae24e(_0x1799c4[_0x432f('0x28')]['message']);}else{logger[_0x432f('0x22')](_0x432f('0x23'),_0x243cf,'request\x20sent');_0x5ae24e(_0x1799c4[_0x432f('0x2a')][_0x432f('0x29')]);}})[_0x432f('0x2b')](function(_0x23347e){logger[_0x432f('0x28')](_0x432f('0x23'),_0x243cf,_0x23347e);_0x2d2c86(_0x23347e);});});}function respondWithStatusCode(_0x138a6a,_0x5a3d18){_0x5a3d18=_0x5a3d18||0xcc;return function(_0x294bfe){if(_0x294bfe){return _0x138a6a['sendStatus'](_0x5a3d18);}return _0x138a6a[_0x432f('0x2c')](_0x5a3d18)['end']();};}function respondWithResult(_0x20404d,_0x5a2c14){_0x5a2c14=_0x5a2c14||0xc8;return function(_0x3f768b){if(_0x3f768b){return _0x20404d['status'](_0x5a2c14)[_0x432f('0x2d')](_0x3f768b);}};}function respondWithFilteredResult(_0x12efe2,_0x263cd8){return function(_0x59c1ab){if(_0x59c1ab){var _0x6a116e=_0x59c1ab[_0x432f('0x2e')],_0x24406a=_0x263cd8[_0x432f('0x2f')],_0x48139b=_0x263cd8[_0x432f('0x2f')]+_0x263cd8[_0x432f('0x30')],_0x5ee0fa;if(_0x48139b>=_0x6a116e){_0x48139b=_0x6a116e;_0x5ee0fa=0xc8;}else{_0x5ee0fa=0xce;}_0x12efe2[_0x432f('0x2c')](_0x5ee0fa);return _0x12efe2[_0x432f('0x31')]('Content-Range',_0x24406a+'-'+_0x48139b+'/'+_0x6a116e)['json'](_0x59c1ab);}return null;};}function patchUpdates(_0x382253){return function(_0x1f9502){try{jsonpatch[_0x432f('0x32')](_0x1f9502,_0x382253,!![]);}catch(_0x4950cc){return BPromise[_0x432f('0x33')](_0x4950cc);}return _0x1f9502[_0x432f('0x34')]();};}function saveUpdates(_0x2c9dd9,_0x20281d){return function(_0x4464f3){if(_0x4464f3){return _0x4464f3[_0x432f('0x35')](_0x2c9dd9)[_0x432f('0x21')](function(_0x3e7091){return _0x3e7091;});}return null;};}function removeEntity(_0x4c480a,_0x47a693){return function(_0x41786b){if(_0x41786b){return _0x41786b[_0x432f('0x36')]()['then'](function(){_0x4c480a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1727b7,_0x141141){return function(_0x5648a7){if(!_0x5648a7){_0x1727b7[_0x432f('0x37')](0x194);}return _0x5648a7;};}function handleError(_0x2c1bc1,_0x123697){_0x123697=_0x123697||0x1f4;return function(_0x5903f6){logger[_0x432f('0x28')](_0x5903f6[_0x432f('0x38')]);if(_0x5903f6['name']){delete _0x5903f6[_0x432f('0x39')];}_0x2c1bc1[_0x432f('0x2c')](_0x123697)['send'](_0x5903f6);};}function getInteractionUsers(_0x28da2e,_0x41b292){return new BPromise(function(_0x148a95,_0x1a3273){try{if(_0x41b292[_0x28da2e['id']]){_0x28da2e[_0x432f('0x3a')]=_[_0x432f('0x3b')](_0x41b292[_0x28da2e['id']],function(_0xbef36e){return{'id':_0xbef36e['id'],'fullname':_0xbef36e[_0x432f('0x3c')]};});}}catch(_0x244970){_0x1a3273(_0x244970);}_0x148a95(_0x28da2e);});}function getInteractionTags(_0x2545b7,_0xbb7bee){return new BPromise(function(_0x556768,_0x3d835e){try{if(_0x2545b7['TagIds']){_0x2545b7[_0x432f('0x3d')]=[];_0x2545b7[_0x432f('0x3e')]['split'](',')[_0x432f('0x3f')](function(_0x47d44d){_0x2545b7[_0x432f('0x3d')][_0x432f('0x40')](_0xbb7bee[_0x47d44d]);});}delete _0x2545b7['TagIds'];}catch(_0x490db5){_0x3d835e(_0x490db5);}_0x556768(_0x2545b7);});}function updateChatInteraction(_0xbd4240,_0x25ae0d,_0x1e2487){return new BPromise(function(_0x121687,_0x63a3b4){return getInteractionUsers(_0xbd4240,_0x1e2487)['then'](function(_0x5dade1){return getInteractionTags(_0x5dade1,_0x25ae0d);})['then'](function(_0x1ceec7){_0x121687(_0x1ceec7);})[_0x432f('0x2b')](function(_0x55d64c){_0x63a3b4(_0x55d64c);});});}exports[_0x432f('0x41')]=function(_0x841572,_0x41c90c){var _0x2656eb={},_0x2d8ddf={},_0x18be7c={'count':0x0,'rows':[]};var _0x2c32d1=_[_0x432f('0x3b')](db[_0x432f('0x42')]['rawAttributes'],function(_0x247b63){return{'name':_0x247b63[_0x432f('0x43')],'type':_0x247b63['type'][_0x432f('0x44')]};});_0x2d8ddf[_0x432f('0x45')]=_[_0x432f('0x3b')](_0x2c32d1,_0x432f('0x39'));_0x2d8ddf[_0x432f('0x46')]=_[_0x432f('0x47')](_0x841572[_0x432f('0x46')]);_0x2d8ddf[_0x432f('0x48')]=_[_0x432f('0x49')](_0x2d8ddf[_0x432f('0x45')],_0x2d8ddf[_0x432f('0x46')]);_0x2656eb[_0x432f('0x4a')]=_[_0x432f('0x49')](_0x2d8ddf[_0x432f('0x45')],qs['fields'](_0x841572['query'][_0x432f('0x4b')]));_0x2656eb[_0x432f('0x4a')]=_0x2656eb[_0x432f('0x4a')][_0x432f('0x4c')]?_0x2656eb[_0x432f('0x4a')]:_0x2d8ddf['model'];if(!_0x841572[_0x432f('0x46')][_0x432f('0x4d')](_0x432f('0x4e'))){_0x2656eb[_0x432f('0x30')]=qs[_0x432f('0x30')](_0x841572[_0x432f('0x46')][_0x432f('0x30')]);_0x2656eb['offset']=qs[_0x432f('0x2f')](_0x841572[_0x432f('0x46')][_0x432f('0x2f')]);}_0x2656eb['order']=qs[_0x432f('0x4f')](_0x841572[_0x432f('0x46')]['sort']);_0x2656eb['where']=qs[_0x432f('0x48')](_[_0x432f('0x50')](_0x841572['query'],_0x2d8ddf['filters']),_0x2c32d1);var _0x33214e=[];var _0x5585d0=squel[_0x432f('0x51')]()[_0x432f('0x52')]('id')['field'](_0x432f('0x39'))['field'](_0x432f('0x53'))[_0x432f('0x54')](_0x432f('0x55'));var _0xe43f31=squel[_0x432f('0x51')]()[_0x432f('0x52')]('u.id')[_0x432f('0x52')]('u.fullname')[_0x432f('0x52')](_0x432f('0x56'))[_0x432f('0x54')](_0x432f('0x57'),'ui')['left_join'](_0x432f('0x58'),'u',_0x432f('0x59'));var _0x12e177=squel[_0x432f('0x51')]()[_0x432f('0x54')](_0x432f('0x5a'),'i')[_0x432f('0x5b')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x432f('0x5b')](_0x432f('0x58'),'o',_0x432f('0x5c'))[_0x432f('0x5b')](_0x432f('0x5d'),'a',_0x432f('0x5e'))['left_join'](_0x432f('0x5f'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join'](_0x432f('0x60'),'it',_0x432f('0x61'))[_0x432f('0x5b')](_0x432f('0x55'),'t',_0x432f('0x62'));var _0x13ba40=squel['expr']();var _0x46c36d=[];var _0x1dcb3e=squel['expr']();var _0x247ffa;if(_0x841572[_0x432f('0x46')]['search']){_0x247ffa=as[_0x432f('0x63')](_0x841572[_0x432f('0x46')][_0x432f('0x64')]);var _0x387999=_0x247ffa[_0x432f('0x65')];for(var _0xe729fc=0x0;_0xe729fc<_0x247ffa[_0x432f('0x66')][_0x432f('0x4c')];_0xe729fc++){var _0x1e17d2=_0x247ffa[_0x432f('0x66')][_0xe729fc];var _0x419c68='i';var _0x5904c6=_[_0x432f('0x67')](_0x2c32d1,[_0x432f('0x39'),_0x1e17d2[_0x432f('0x52')]]);if(!_0x5904c6){switch(_0x1e17d2[_0x432f('0x52')]){case'unreadMessages':if(_0x1e17d2['value']==0x1){_0x12e177[_0x432f('0x68')]('`'+_0x1e17d2[_0x432f('0x52')]+_0x432f('0x69'));}else{_0x12e177['having']('`'+_0x1e17d2[_0x432f('0x52')]+_0x432f('0x6a'));}break;case _0x432f('0x6b'):if(_0x1e17d2['operator']==='$substring'){if(_0x1e17d2[_0x432f('0x6c')][_0x432f('0x6d')]('\x20')['length']>0x1){_0x13ba40[_0x387999](_0x432f('0x6e'),qs['getFullTextValue'](_0x1e17d2[_0x432f('0x6c')]),null);}else{var _0x17d1f3='%'+_0x1e17d2[_0x432f('0x6c')]+'%';_0x13ba40[_0x387999]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x17d1f3,_0x17d1f3,_0x17d1f3);}}else{_0x5904c6=_[_0x432f('0x67')](_0x2c32d1,[_0x432f('0x39'),_0x432f('0x6f')]);_0x1e17d2[_0x432f('0x52')]='ContactId';_0x8e9429=as[_0x432f('0x70')](_0x419c68,_0x5904c6[_0x432f('0x71')],_0x1e17d2);_0x13ba40[_0x387999](_0x8e9429['text'],_0x8e9429[_0x432f('0x6c')]['start'],_0x8e9429['value']['end']);}break;case _0x432f('0x72'):var _0x54427a=_0x1e17d2[_0x432f('0x6c')][_0x432f('0x6d')](',')['map'](function(_0x51c6c3){return Number(_0x51c6c3);});_0x54427a[_0x432f('0x3f')](function(_0x3fe19d){_0x1dcb3e['or'](_0x432f('0x73'),'%,'+_0x3fe19d+',%');});_0x46c36d=_[_0x432f('0x74')](_0x46c36d,_0x54427a);break;case'User':if(_0x1e17d2[_0x432f('0x75')]===_0x432f('0x76')){_0x13ba40[_0x387999]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1e17d2[_0x432f('0x6c')]+'%',null);}else{_0x5904c6=_['find'](_0x2c32d1,[_0x432f('0x39'),_0x432f('0x77')]);_0x1e17d2[_0x432f('0x52')]='UserId';_0x8e9429=as[_0x432f('0x70')](_0x419c68,_0x5904c6[_0x432f('0x71')],_0x1e17d2);_0x13ba40[_0x387999](_0x8e9429[_0x432f('0x78')],_0x8e9429[_0x432f('0x6c')]['start'],_0x8e9429[_0x432f('0x6c')]['end']);}break;case _0x432f('0x79'):_0x8e9429=as[_0x432f('0x70')]('me',null,_0x1e17d2);_0x13ba40[_0x387999](_0x8e9429[_0x432f('0x78')],_0x8e9429[_0x432f('0x6c')][_0x432f('0x7a')],_0x8e9429[_0x432f('0x6c')][_0x432f('0x7b')]);break;}}else{var _0x8e9429=as['buildExpression'](_0x419c68,_0x5904c6[_0x432f('0x71')],_0x1e17d2);_0x13ba40[_0x387999](_0x8e9429[_0x432f('0x78')],_0x8e9429[_0x432f('0x6c')][_0x432f('0x7a')],_0x8e9429['value'][_0x432f('0x7b')]);}}}else{var _0x141fa8=_(_0x841572['query'])[_0x432f('0x47')]()[_0x432f('0x3b')](function(_0x32fd3c){return _['some'](_0x2c32d1,[_0x432f('0x39'),_0x32fd3c])?_0x32fd3c:undefined;})[_0x432f('0x7c')]()[_0x432f('0x6c')]();if(!_['isEmpty'](_0x141fa8)){_0x141fa8['forEach'](function(_0x16258b){if(_0x16258b===_0x432f('0x7d')){_0x12e177[_0x432f('0x7e')](_0x432f('0x7f'),[]['concat'](_0x841572['query'][_0x16258b]));}else if(_0x16258b===_0x432f('0x80')){var _0x5a198b=JSON[_0x432f('0x81')](_0x841572[_0x432f('0x46')][_0x16258b])[_0x432f('0x82')];var _0x46c56d=JSON[_0x432f('0x81')](_0x841572[_0x432f('0x46')][_0x16258b])[_0x432f('0x83')];_0x12e177[_0x432f('0x7e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5a198b,_0x46c56d);}else{if(_0x841572[_0x432f('0x46')][_0x16258b]===_0x432f('0x84')){_0x12e177['where']('i.'+_0x16258b+_0x432f('0x85'));}else{_0x12e177[_0x432f('0x7e')]('i.'+_0x16258b+'\x20=\x20?',_0x841572['query'][_0x16258b]);}}});}if(_0x841572['query'][_0x432f('0x86')]){if(_0x841572[_0x432f('0x46')][_0x432f('0x86')]==0x1){_0x12e177[_0x432f('0x68')](_0x432f('0x87'));}else{_0x12e177[_0x432f('0x68')]('`unreadMessages`\x20>\x200');}}if(_0x841572[_0x432f('0x46')][_0x432f('0x88')]){_0x46c36d=_[_0x432f('0x89')](_0x841572[_0x432f('0x46')][_0x432f('0x88')])?_0x841572[_0x432f('0x46')][_0x432f('0x88')]:new Array(_0x841572[_0x432f('0x46')][_0x432f('0x88')]);_0x46c36d['forEach'](function(_0xea89f){_0x1dcb3e['or'](_0x432f('0x73'),'%,'+_0xea89f+',%');});}if(_0x841572[_0x432f('0x46')][_0x432f('0x8a')]){var _0x43edc6=_0x841572[_0x432f('0x46')][_0x432f('0x8a')][_0x432f('0x8b')]('\x5c','\x5c\x5c')[_0x432f('0x8b')]('\x27\x27',_0x432f('0x8c'));if(qs[_0x432f('0x8d')](_0x43edc6)){_0x13ba40['or']('i.id\x20LIKE\x20?',_0x43edc6+'%');}else{_0x13ba40['or'](_0x432f('0x8e'),qs['getFullTextValue'](_0x43edc6))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x43edc6+'%');}}}_0x12e177[_0x432f('0x7e')](_0x13ba40);_0x12e177[_0x432f('0x8f')](_0x432f('0x90'));var _0x590495={'type':db['Sequelize'][_0x432f('0x91')][_0x432f('0x92')],'raw':!![]};var _0x23078a=_0x12e177[_0x432f('0x93')]();_0x23078a[_0x432f('0x52')](_0x432f('0x90'));_0x23078a[_0x432f('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x432f('0x94'));if(_0x2656eb[_0x432f('0x95')]){_0x2656eb[_0x432f('0x95')]['forEach'](function(_0x17903a){_0x12e177[_0x432f('0x95')]('i.'+_0x17903a[0x0],_0x17903a[0x1]==='DESC'?![]:!![]);});}if(!_[_0x432f('0x96')](_0x46c36d)){_0x12e177['having'](_0x1dcb3e);_0x23078a[_0x432f('0x7e')](_0x432f('0x97'),_0x46c36d);}BPromise[_0x432f('0x98')]()[_0x432f('0x21')](function(){if(!_0x247ffa){if(_0x841572[_0x432f('0x46')][_0x432f('0x7d')]||_0x841572[_0x432f('0x46')][_0x432f('0x99')])return;_0x23078a['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x12e177['where'](_0x432f('0x9a'));return;}return _0x841572[_0x432f('0x9b')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x432f('0x21')](function(_0x45a27d){if(_[_0x432f('0x96')](_0x45a27d)){_0x23078a[_0x432f('0x7e')]('i.ChatWebsiteId\x20IS\x20NULL');_0x12e177[_0x432f('0x7e')](_0x432f('0x9c'));}else{_0x23078a[_0x432f('0x7e')]('i.ChatWebsiteId\x20IN\x20?',_[_0x432f('0x3b')](_0x45a27d,'id'));_0x12e177[_0x432f('0x7e')](_0x432f('0x7f'),_[_0x432f('0x3b')](_0x45a27d,'id'));}});})[_0x432f('0x21')](function(){db[_0x432f('0x9d')][_0x432f('0x46')](_0x23078a[_0x432f('0x9e')](),_0x590495)[_0x432f('0x21')](function(_0x24cb70){_0x18be7c[_0x432f('0x2e')]=_0x24cb70[_0x432f('0x4c')];if(_0x18be7c['count']===0x0)return[];return db[_0x432f('0x9d')]['query'](_0x5585d0[_0x432f('0x9e')](),_0x590495)[_0x432f('0x21')](function(_0x2d796e){_0x33214e=_['keyBy'](_0x2d796e,'id');_0x590495=_[_0x432f('0x9f')](_0x590495,{'model':db[_0x432f('0x42')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x841572[_0x432f('0x46')][_0x432f('0x4b')]){_0x2656eb[_0x432f('0x4a')][_0x432f('0x3f')](function(_0x3aaf04){_0x12e177[_0x432f('0x52')]('i.'+_0x3aaf04);});}else{_0x12e177[_0x432f('0x52')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x432f('0x94'));_0x12e177['field'](_0x432f('0xa0'),_0x432f('0xa1'));_0x12e177[_0x432f('0x52')](_0x432f('0xa2'),_0x432f('0xa3'));_0x12e177[_0x432f('0x52')](_0x432f('0xa4'));_0x12e177[_0x432f('0x52')](_0x432f('0xa5'),_0x432f('0xa6'));_0x12e177['field'](_0x432f('0xa7'),'Contact.lastName');_0x12e177[_0x432f('0x52')]('c.email',_0x432f('0xa8'));_0x12e177[_0x432f('0x52')](_0x432f('0xa9'),_0x432f('0xaa'));_0x12e177[_0x432f('0x52')](_0x432f('0xab'),_0x432f('0xac'));_0x12e177[_0x432f('0x52')](_0x432f('0xad'),_0x432f('0xae'));_0x12e177[_0x432f('0x52')](_0x432f('0xaf'),'Owner.fullname');_0x12e177[_0x432f('0x52')](_0x432f('0xb0'),'Owner.internal');_0x12e177[_0x432f('0x52')](_0x432f('0xb1'),'TagIds');}if(_0x2656eb[_0x432f('0x30')])_0x12e177[_0x432f('0x30')](_0x2656eb['limit']);if(_0x2656eb[_0x432f('0x2f')])_0x12e177['offset'](_0x2656eb['offset']);return db[_0x432f('0x9d')]['query'](_0x12e177[_0x432f('0x9e')](),_0x590495);})[_0x432f('0x21')](function(_0x4e8265){_0xe43f31['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x432f('0x3b')](_0x4e8265,'id'));return db[_0x432f('0x9d')][_0x432f('0x46')](_0xe43f31[_0x432f('0x9e')](),_0x590495)[_0x432f('0x21')](function(_0x167ead){var _0x532b0d=_[_0x432f('0xb2')](_0x167ead,_0x432f('0xb3'));var _0x1779d0=[];_0x4e8265[_0x432f('0x3f')](function(_0x229c4e){_0x1779d0[_0x432f('0x40')](updateChatInteraction(_0x229c4e,_0x33214e,_0x532b0d));});return BPromise[_0x432f('0xb4')](_0x1779d0);});});})[_0x432f('0x21')](function(_0x196165){_0x18be7c['rows']=_0x196165;return _0x18be7c;})['then'](respondWithFilteredResult(_0x41c90c,_0x2656eb));})[_0x432f('0x2b')](handleError(_0x41c90c,null));};exports[_0x432f('0xb5')]=function(_0x1eddfb,_0x230037){var _0x53f21e={'raw':![],'where':{'id':_0x1eddfb['params']['id']}},_0x27a349={};_0x27a349[_0x432f('0x45')]=_[_0x432f('0x47')](db[_0x432f('0x42')]['rawAttributes']);_0x27a349[_0x432f('0x46')]=_[_0x432f('0x47')](_0x1eddfb['query']);_0x27a349[_0x432f('0x48')]=_['intersection'](_0x27a349['model'],_0x27a349[_0x432f('0x46')]);_0x53f21e[_0x432f('0x4a')]=_[_0x432f('0x49')](_0x27a349[_0x432f('0x45')],qs[_0x432f('0x4b')](_0x1eddfb[_0x432f('0x46')][_0x432f('0x4b')]));_0x53f21e[_0x432f('0x4a')]=_0x53f21e[_0x432f('0x4a')][_0x432f('0x4c')]?_0x53f21e[_0x432f('0x4a')]:_0x27a349[_0x432f('0x45')];if(_0x1eddfb['query'][_0x432f('0xb6')]){_0x53f21e['include']=[{'all':!![]}];}_0x53f21e=_[_0x432f('0x9f')]({},_0x53f21e,_0x1eddfb['options']);return db[_0x432f('0x42')][_0x432f('0x67')](_0x53f21e)[_0x432f('0x21')](handleEntityNotFound(_0x230037,null))[_0x432f('0x21')](respondWithResult(_0x230037,null))['catch'](handleError(_0x230037,null));};exports[_0x432f('0xb7')]=function(_0x26bdf0,_0x2dd150){return db[_0x432f('0x42')]['create'](_0x26bdf0[_0x432f('0x79')],{})[_0x432f('0x21')](respondWithResult(_0x2dd150,0xc9))[_0x432f('0x2b')](handleError(_0x2dd150,null));};exports[_0x432f('0x35')]=function(_0x97c843,_0xf6f8f7){if(_0x97c843['body']['id']){delete _0x97c843[_0x432f('0x79')]['id'];}return db[_0x432f('0x42')]['find']({'where':{'id':_0x97c843[_0x432f('0xb8')]['id']}})['then'](handleEntityNotFound(_0xf6f8f7,null))['then'](saveUpdates(_0x97c843['body'],null))['then'](respondWithResult(_0xf6f8f7,null))[_0x432f('0x2b')](handleError(_0xf6f8f7,null));};exports[_0x432f('0x36')]=function(_0x208c43,_0x50dad1){return db['ChatInteraction']['find']({'where':{'id':_0x208c43[_0x432f('0xb8')]['id']}})[_0x432f('0x21')](handleEntityNotFound(_0x50dad1,null))['then'](removeEntity(_0x50dad1,null))[_0x432f('0x2b')](handleError(_0x50dad1,null));};exports[_0x432f('0xb9')]=function(_0x3c6102,_0xb525de){return db[_0x432f('0x42')][_0x432f('0xb9')]()[_0x432f('0x21')](respondWithResult(_0xb525de,null))['catch'](handleError(_0xb525de,null));};exports[_0x432f('0xba')]=function(_0x584379,_0x3888ce){var _0x513254=_0x584379[_0x432f('0xb8')]['id'];var _0x29ec5b;var _0x749a67;var _0x285bd7;return db['ChatInteraction'][_0x432f('0xbb')]({'where':{'id':_0x513254}})[_0x432f('0x21')](function(_0x276c8a){_0x29ec5b=_0x276c8a;return db['ChatWebsite'][_0x432f('0xbb')]({'where':{'id':_0x276c8a[_0x432f('0x7d')]},'attributes':['id',_0x432f('0xbc'),_0x432f('0xbd')],'raw':!![]});})[_0x432f('0x21')](function(_0x2a330e){if(_0x2a330e&&_0x2a330e[_0x432f('0xbc')]&&_0x2a330e[_0x432f('0xbd')]){_0x749a67=_0x2a330e;var _0x13dcd0={'rejectUnauthorized':![],'method':_0x432f('0xbe'),'uri':_0x432f('0xbf'),'headers':{'X-APIKEY':_0x2a330e[_0x432f('0xbc')]},'body':{'name':_0x432f('0xc0')+_0x513254},'redirect':_0x432f('0xc1'),'json':!![]};return rp(_0x13dcd0);}else{throw new db[(_0x432f('0xc2'))][(_0x432f('0x1e'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x432f('0x21')](function(_0x2d5060){_0x285bd7=_0x2d5060;if(_0x285bd7['id']){var _0x269a20={'body':_0x285bd7['join_url'],'ChatWebsiteId':_0x749a67['id'],'ChatInteractionId':_0x29ec5b['id'],'direction':_0x432f('0xc3'),'UserId':_0x584379[_0x432f('0x9b')]['id']};return db['ChatMessage'][_0x432f('0xb7')](_0x269a20,{});}else{throw new db[(_0x432f('0xc2'))][(_0x432f('0x1e'))](_0x432f('0xc4'));}})[_0x432f('0x21')](function(){return _0x29ec5b['updateAttributes']({'vidaooSessionId':_0x285bd7['id']});})[_0x432f('0x21')](respondWithResult(_0x3888ce,null))[_0x432f('0x2b')](handleError(_0x3888ce,null));};exports[_0x432f('0xc5')]=function(_0x109bc9,_0x3b4734){if(_0x109bc9[_0x432f('0x79')]['id']){delete _0x109bc9[_0x432f('0x79')]['id'];}return db[_0x432f('0x42')][_0x432f('0x67')]({'where':{'id':_0x109bc9[_0x432f('0xb8')]['id']}})[_0x432f('0x21')](handleEntityNotFound(_0x3b4734,null))[_0x432f('0x21')](saveUpdates(_0x109bc9['body'],null))[_0x432f('0x21')](respondWithResult(_0x3b4734,null))[_0x432f('0x2b')](handleError(_0x3b4734,null));};exports[_0x432f('0xc6')]=function(_0x321e9f,_0x122fa4,_0xe37ef5){if(_0x321e9f[_0x432f('0x79')]['id']){delete _0x321e9f[_0x432f('0x79')]['id'];}return db[_0x432f('0x42')][_0x432f('0x67')]({'where':{'id':_0x321e9f[_0x432f('0xb8')]['id']}})[_0x432f('0x21')](function(_0x6f7ea6){if(!_0x6f7ea6){logger[_0x432f('0x28')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x432f('0xc6'),0x194,_0x432f('0xc7'));_0x122fa4['sendStatus'](0x194);}else{if(_0x6f7ea6['UserId']){throw new db[(_0x432f('0xc2'))][(_0x432f('0x1e'))](_0x432f('0xc8'));}}return _0x6f7ea6;})['then'](function(_0x53f204){if(_0x53f204){return _0x53f204[_0x432f('0x35')]({'closed':_0x321e9f[_0x432f('0x79')][_0x432f('0xc9')],'disposition':_0x321e9f[_0x432f('0x79')][_0x432f('0xca')]})[_0x432f('0x21')](function(_0x2bdd48){return _0x2bdd48;});}})[_0x432f('0x21')](function(_0x2d5106){return respondWithRpcPromise('AbandonInteraction','abandon',_0x321e9f[_0x432f('0x79')],client9004);})[_0x432f('0x21')](respondWithResult(_0x122fa4,null))[_0x432f('0x2b')](handleError(_0x122fa4,null));};exports[_0x432f('0xcb')]=function(_0x5b02a0,_0x39dcc1,_0x15fbe7){_0x5b02a0[_0x432f('0x79')][_0x432f('0x39')]=_0x5b02a0[_0x432f('0xcc')]['originalname'];_0x5b02a0[_0x432f('0x79')][_0x432f('0xcd')]=_0x5b02a0[_0x432f('0xcc')][_0x432f('0xce')];_0x5b02a0[_0x432f('0x79')][_0x432f('0x71')]=_0x5b02a0[_0x432f('0xcc')][_0x432f('0xcf')];return db[_0x432f('0xd0')][_0x432f('0xb7')](_0x5b02a0[_0x432f('0x79')])[_0x432f('0x21')](respondWithResult(_0x39dcc1,0xc9))[_0x432f('0x2b')](handleError(_0x39dcc1,null));};exports['attachmentDownload']=function(_0x3cfd25,_0x3dc15e,_0x246eab){return db[_0x432f('0x42')][_0x432f('0xbb')]({'where':{'id':_0x3cfd25['params']['id']},'raw':!![]})[_0x432f('0x21')](handleEntityNotFound(_0x3dc15e,null))[_0x432f('0x21')](function(_0xd75b60){if(_0xd75b60){if(_0xd75b60[_0x432f('0xc9')]){return _0x3dc15e[_0x432f('0x2c')](0x193)['json']({'status':0x193,'message':_0x432f('0xd1')});}return db[_0x432f('0xd0')][_0x432f('0xbb')]({'where':{'id':_0x3cfd25['query'][_0x432f('0xd2')]},'raw':!![]})[_0x432f('0x21')](handleEntityNotFound(_0x3dc15e,null));}})[_0x432f('0x21')](function(_0x4b9ec3){if(_0x4b9ec3){return _0x3dc15e['download'](path[_0x432f('0xd3')](config[_0x432f('0xd4')],_0x432f('0xd5'),_0x4b9ec3[_0x432f('0xcd')]));}})[_0x432f('0x2b')](handleError(_0x3dc15e,null));};exports[_0x432f('0xd6')]=function(_0x1f37d2,_0x5dbc58){var _0xfe0357=null;var _0xc4a06b=null;var _0x505273=null;var _0x39b94b=null;if(_0x1f37d2[_0x432f('0x79')]['id']){delete _0x1f37d2['body']['id'];}if(_0x1f37d2[_0x432f('0x79')]['mailTranscript']){_0x39b94b=path[_0x432f('0xd3')](config[_0x432f('0xd4')],_0x432f('0xd7'),util[_0x432f('0xd8')](_0x432f('0xd9'),Date[_0x432f('0xda')]()));_0x1f37d2[_0x432f('0x79')][_0x432f('0xdb')]=_0x39b94b;}return db[_0x432f('0x42')][_0x432f('0x67')]({'where':{'id':_0x1f37d2[_0x432f('0xb8')]['id']},'include':[{'model':db[_0x432f('0xdc')],'as':_0x432f('0xdd'),'include':[{'model':db['User'],'as':_0x432f('0xde')}]}]})[_0x432f('0x21')](handleEntityNotFound(_0x5dbc58,null))['then'](saveUpdates(_0x1f37d2['body'],null))[_0x432f('0x21')](function(_0x503ceb){if(_0x503ceb){_0xfe0357=_0x503ceb;return db[_0x432f('0xdf')][_0x432f('0x67')]({'where':{'id':_0xfe0357[_0x432f('0x7d')]}});}})['then'](function(_0xc7d373){if(_0xc7d373){_0x505273=_0xc7d373;return db[_0x432f('0xe0')][_0x432f('0x67')]({'where':{'id':_0xfe0357[_0x432f('0x6f')]}});}})[_0x432f('0x21')](function(_0x1e8bce){if(_0x1e8bce){_0xc4a06b=_0x1e8bce;if(_0x39b94b){var _0x418c15=null;for(var _0x231e57=0x1;_0x231e57<_0xfe0357['Messages'][_0x432f('0x4c')];++_0x231e57){_0x418c15=_0xfe0357[_0x432f('0xdd')][_0x231e57];var _0x29ba22=_0x418c15[_0x432f('0x77')]?util[_0x432f('0xd8')]('%s%d',_0x505273[_0x432f('0xe1')],_0x418c15['UserId']):_0x432f('0xe2');var _0x5bd96b=_0x1f37d2[_0x432f('0x79')][_0x432f('0xe3')]||util[_0x432f('0xd8')](_0x432f('0xe4'),_0x432f('0xe5'),_0x418c15[_0x432f('0x6f')]);switch(_0x505273[_0x432f('0xe6')]){case _0x432f('0xe7'):_0x29ba22=_0x418c15[_0x432f('0x77')]?util['format']('%s%d',_0x505273[_0x432f('0xe1')],_0x418c15[_0x432f('0x77')]):_0x432f('0xe2');break;case _0x432f('0xe8'):_0x29ba22=_0x418c15['UserId']?_0x418c15[_0x432f('0xde')]['alias']||_0x418c15[_0x432f('0xde')][_0x432f('0x3c')]:_0x432f('0xe2');break;case'agent_fullname':_0x29ba22=_0x418c15[_0x432f('0x77')]?_0x418c15[_0x432f('0xde')][_0x432f('0x3c')]:_0x432f('0xe2');break;default:_0x29ba22=_0x418c15[_0x432f('0x77')]?util[_0x432f('0xd8')]('%s%d',_0x505273[_0x432f('0xe1')],_0x418c15['UserId']):_0x432f('0xe2');}var _0x355419=util[_0x432f('0xd8')](_0x432f('0xe9'),moment(_0x418c15[_0x432f('0x80')])[_0x432f('0xd8')](_0x432f('0xea')),_0x418c15[_0x432f('0xeb')]==='in'?_0x5bd96b:_0x29ba22,_0x418c15[_0x432f('0x79')]);if(!_0x418c15[_0x432f('0xec')]){fs[_0x432f('0xed')](_0x39b94b,_0x355419);}}return db[_0x432f('0xee')][_0x432f('0xbb')]({'where':{'service':!![]},'include':[{'model':db[_0x432f('0xef')],'as':'Smtp','raw':!![]}]});}}})[_0x432f('0x21')](function(_0x3c0d3b){if(_0x3c0d3b&&_0x3c0d3b[_0x432f('0xf0')]&&_0x1f37d2[_0x432f('0x79')]){var _0x2e4633={'tls':{'rejectUnauthorized':![]}};if(_0x3c0d3b[_0x432f('0xf0')]['service']){_0x2e4633['service']=_0x3c0d3b['Smtp'][_0x432f('0xf1')];}else{_0x2e4633['host']=_0x3c0d3b['Smtp'][_0x432f('0xf2')];_0x2e4633[_0x432f('0xf3')]=_0x3c0d3b['Smtp'][_0x432f('0xf3')];_0x2e4633[_0x432f('0xf4')]=_0x3c0d3b['Smtp']['secure'];}if(_0x3c0d3b['Smtp'][_0x432f('0xf5')]){_0x2e4633['auth']={'user':_0x3c0d3b['Smtp'][_0x432f('0x9b')],'pass':_0x3c0d3b[_0x432f('0xf0')]['pass']};}return respondWithRpcPromise(_0x432f('0xf6'),_0x432f('0xf7'),{'account':_0x2e4633,'message':{'from':util[_0x432f('0xd8')](_0x432f('0xf8'),_0x3c0d3b[_0x432f('0x39')],_0x3c0d3b[_0x432f('0xf9')]||_0x3c0d3b[_0x432f('0xf0')][_0x432f('0x9b')]),'to':_0x1f37d2[_0x432f('0x79')][_0x432f('0xfa')],'subject':_0x432f('0xfb'),'text':util[_0x432f('0xd8')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x1f37d2[_0x432f('0x79')][_0x432f('0xfa')]),'attachments':[{'path':_0x39b94b}]}})['then'](function(){return _0xfe0357;})[_0x432f('0x2b')](function(_0x5d259c){console[_0x432f('0x28')](_0x5d259c);});}else{return _0xfe0357;}})[_0x432f('0x21')](respondWithStatusCode(_0x5dbc58,0xc8))['catch'](handleError(_0x5dbc58,null));};exports[_0x432f('0xfc')]=function(_0x254caf,_0x5f2148,_0x2c0700){return db['ChatMessage']['find']({'where':{'id':_0x254caf[_0x432f('0xb8')]['id']}})[_0x432f('0x21')](handleEntityNotFound(_0x5f2148,null))[_0x432f('0x21')](function(_0x3f892c){if(_0x3f892c){return _0x3f892c['addMessage'](_0x254caf[_0x432f('0x79')]['ids'],_[_0x432f('0xfd')](_0x254caf[_0x432f('0x79')],[_0x432f('0xfe'),'id'])||{});}})[_0x432f('0x21')](respondWithResult(_0x5f2148,null))[_0x432f('0x2b')](handleError(_0x5f2148,null));};exports['getMessages']=function(_0x25c5dc,_0x42185d,_0xb72f8e){var _0x136e35={'raw':![],'where':{}};var _0x54e595={};var _0x3ff16a={'count':0x0,'rows':[]};return db[_0x432f('0x42')]['findOne']({'where':{'id':_0x25c5dc[_0x432f('0xb8')]['id']}})['then'](handleEntityNotFound(_0x42185d,null))[_0x432f('0x21')](function(_0x3c6dbd){if(_0x3c6dbd){_0x54e595['model']=_[_0x432f('0x47')](db[_0x432f('0xdc')][_0x432f('0xff')]);_0x54e595[_0x432f('0x46')]=_['keys'](_0x25c5dc[_0x432f('0x46')]);_0x54e595[_0x432f('0x48')]=_[_0x432f('0x49')](_0x54e595[_0x432f('0x45')],_0x54e595[_0x432f('0x46')]);_0x136e35[_0x432f('0x4a')]=_[_0x432f('0x49')](_0x54e595['model'],qs[_0x432f('0x4b')](_0x25c5dc['query'][_0x432f('0x4b')]));_0x136e35['attributes']=_0x136e35[_0x432f('0x4a')]['length']?_0x136e35[_0x432f('0x4a')]:_0x54e595[_0x432f('0x45')];if(!_0x25c5dc[_0x432f('0x46')]['hasOwnProperty'](_0x432f('0x4e'))){_0x136e35[_0x432f('0x30')]=qs[_0x432f('0x30')](_0x25c5dc[_0x432f('0x46')][_0x432f('0x30')]);_0x136e35[_0x432f('0x2f')]=qs[_0x432f('0x2f')](_0x25c5dc[_0x432f('0x46')]['offset']);}_0x136e35[_0x432f('0x95')]=qs[_0x432f('0x4f')](_0x25c5dc[_0x432f('0x46')][_0x432f('0x4f')]);_0x136e35[_0x432f('0x7e')]=qs['filters'](_[_0x432f('0x50')](_0x25c5dc[_0x432f('0x46')],_0x54e595[_0x432f('0x48')]));_0x136e35[_0x432f('0x7e')][_0x432f('0xb3')]=_0x3c6dbd['id'];if(_0x25c5dc[_0x432f('0x46')][_0x432f('0x8a')]){_0x136e35[_0x432f('0x7e')]=_[_0x432f('0x9f')](_0x136e35['where'],{'$or':_[_0x432f('0x3b')](_0x136e35['attributes'],function(_0x283005){var _0x8496ea={};_0x8496ea[_0x283005]={'$like':'%'+_0x25c5dc[_0x432f('0x46')][_0x432f('0x8a')]+'%'};return _0x8496ea;})});}if(_0x25c5dc[_0x432f('0x46')][_0x432f('0x82')]){var _0x3136f7=_0x25c5dc['query'][_0x432f('0x82')][_0x432f('0x6d')](',');var _0x1907f3={};_0x1907f3[_0x3136f7[0x0]]={'$gte':moment(_0x3136f7[0x1])[_0x432f('0xd8')](_0x432f('0x100'))};_0x136e35[_0x432f('0x7e')]=_[_0x432f('0x9f')](_0x136e35[_0x432f('0x7e')],_0x1907f3);}_0x136e35=_[_0x432f('0x9f')]({},_0x136e35,_0x25c5dc['options']);return db[_0x432f('0xdc')][_0x432f('0x2e')]({'where':_0x136e35['where']})['then'](function(_0x3c6d48){_0x3ff16a[_0x432f('0x2e')]=_0x3c6d48;if(_0x25c5dc['query']['includeAll']){_0x136e35[_0x432f('0x101')]=[{'all':!![]}];}return db[_0x432f('0xdc')]['findAll'](_0x136e35);})[_0x432f('0x21')](function(_0x50f308){_0x3ff16a[_0x432f('0x102')]=_0x50f308;return _0x3ff16a;});}})[_0x432f('0x21')](respondWithFilteredResult(_0x42185d,_0x136e35))[_0x432f('0x2b')](handleError(_0x42185d,null));};exports['getMyMessages']=function(_0x4a6d66,_0x27fffd,_0x1f625a){var _0x542b2e={'where':{}},_0x4d6546={},_0x43a403={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x432f('0xbb')]({'where':{'id':_0x4a6d66[_0x432f('0xb8')]['id']}})[_0x432f('0x21')](handleEntityNotFound(_0x27fffd,null))[_0x432f('0x21')](function(_0x4a911f){if(_0x4a911f){_0x4d6546[_0x432f('0x45')]=_[_0x432f('0x47')](db['ChatMessage'][_0x432f('0xff')]);_0x4d6546[_0x432f('0x46')]=_[_0x432f('0x47')](_0x4a6d66[_0x432f('0x46')]);_0x4d6546[_0x432f('0x48')]=_[_0x432f('0x49')](_0x4d6546[_0x432f('0x45')],_0x4d6546[_0x432f('0x46')]);_0x542b2e[_0x432f('0x4a')]=_['intersection'](_0x4d6546[_0x432f('0x45')],qs[_0x432f('0x4b')](_0x4a6d66[_0x432f('0x46')]['fields']));_0x542b2e[_0x432f('0x4a')]=_0x542b2e[_0x432f('0x4a')][_0x432f('0x4c')]?_0x542b2e[_0x432f('0x4a')]:_0x4d6546[_0x432f('0x45')];if(!_0x4a6d66[_0x432f('0x46')][_0x432f('0x4d')]('nolimit')){_0x542b2e[_0x432f('0x30')]=qs[_0x432f('0x30')](_0x4a6d66[_0x432f('0x46')]['limit']);_0x542b2e[_0x432f('0x2f')]=qs[_0x432f('0x2f')](_0x4a6d66['query'][_0x432f('0x2f')]);}_0x542b2e[_0x432f('0x95')]=qs[_0x432f('0x4f')](_0x4a6d66[_0x432f('0x46')][_0x432f('0x4f')]);_0x542b2e[_0x432f('0x7e')]=qs[_0x432f('0x48')](_[_0x432f('0x50')](_0x4a6d66[_0x432f('0x46')],_0x4d6546[_0x432f('0x48')]));_0x542b2e[_0x432f('0x7e')]['ChatInteractionId']=_0x4a911f['id'];if(_0x4a6d66['query'][_0x432f('0x8a')]){_0x542b2e['where']=_['merge'](_0x542b2e[_0x432f('0x7e')],{'$or':_[_0x432f('0x3b')](_0x542b2e[_0x432f('0x4a')],function(_0x183448){var _0x357391={};_0x357391[_0x183448]={'$like':'%'+_0x4a6d66[_0x432f('0x46')]['filter']+'%'};return _0x357391;})});}_0x542b2e[_0x432f('0x7e')][_0x432f('0xec')]=![];if(_0x4a6d66['query']['id']){_0x542b2e[_0x432f('0x7e')]['id']={'$gt':_0x4a6d66['query']['id']};}_0x542b2e=_['merge']({},_0x542b2e,_0x4a6d66['options']);return db[_0x432f('0xdc')][_0x432f('0x2e')]({'where':_0x542b2e[_0x432f('0x7e')]})['then'](function(_0xd2086e){_0x43a403['count']=_0xd2086e;_0x542b2e[_0x432f('0x101')]=[];if(_0x4a6d66['query']['includeAgent']){_0x542b2e[_0x432f('0x101')][_0x432f('0x40')]({'model':db[_0x432f('0xde')],'as':'User','attributes':['id','fullname','alias']});}if(_0x4a6d66[_0x432f('0x46')][_0x432f('0xb6')]){_0x542b2e[_0x432f('0x101')]=[{'all':!![]}];}return db['ChatMessage'][_0x432f('0x103')](_0x542b2e);})['then'](function(_0x338565){_0x43a403['rows']=_0x338565;return _0x43a403;});}})['then'](respondWithFilteredResult(_0x27fffd,_0x542b2e))['catch'](handleError(_0x27fffd,null));};exports['addTags']=function(_0xfaf6b0,_0x2e0b52,_0x47e627){return db[_0x432f('0x42')][_0x432f('0x67')]({'where':{'id':_0xfaf6b0[_0x432f('0xb8')]['id']}})[_0x432f('0x21')](handleEntityNotFound(_0x2e0b52,null))[_0x432f('0x21')](function(_0x3df10a){if(_0x3df10a){return _0x3df10a[_0x432f('0x104')](_0xfaf6b0[_0x432f('0x79')][_0x432f('0xfe')],_[_0x432f('0xfd')](_0xfaf6b0[_0x432f('0x79')],[_0x432f('0xfe'),'id'])||{})['spread'](function(){return db[_0x432f('0x72')][_0x432f('0x103')]({'attributes':['id',_0x432f('0x39'),_0x432f('0x53')],'where':{'id':_0xfaf6b0[_0x432f('0x79')][_0x432f('0xfe')]}});})[_0x432f('0x21')](function(_0x580ae7){socket[_0x432f('0x105')](_0x432f('0x106'),{'id':Number(_0xfaf6b0[_0x432f('0xb8')]['id']),'tags':_0x580ae7||[]});return{'id':Number(_0xfaf6b0[_0x432f('0xb8')]['id']),'tags':_0x580ae7||[]};});}})[_0x432f('0x21')](respondWithResult(_0x2e0b52,null))[_0x432f('0x2b')](handleError(_0x2e0b52,null));};exports[_0x432f('0x107')]=function(_0x17d6a0,_0x5154be,_0x4595d2){return db['ChatInteraction'][_0x432f('0x67')]({'where':{'id':_0x17d6a0[_0x432f('0xb8')]['id']}})[_0x432f('0x21')](handleEntityNotFound(_0x5154be,null))['then'](function(_0x257bf8){if(_0x257bf8){return _0x257bf8[_0x432f('0x107')](_0x17d6a0[_0x432f('0x46')][_0x432f('0xfe')]);}})['then'](respondWithStatusCode(_0x5154be,null))[_0x432f('0x2b')](handleError(_0x5154be,null));};exports[_0x432f('0x108')]=function(_0x261815,_0x1ccd67){var _0x3a49ef=moment()[_0x432f('0x109')]()[_0x432f('0x9e')]();var _0xea65c1=path[_0x432f('0xd3')](config[_0x432f('0xd4')],_0x432f('0x10a'),_0x432f('0x10b'),'tmp');var _0x48817f=path[_0x432f('0xd3')](config[_0x432f('0xd4')],'server',_0x432f('0x10b'),_0x432f('0x10c'));var _0x3af5c9=path[_0x432f('0xd3')](_0xea65c1,_0x3a49ef);var _0x3d4836=util[_0x432f('0xd8')](_0x432f('0x10d'),_0x261815[_0x432f('0xb8')]['id'],_0x3a49ef);var _0x2cc8e4=path[_0x432f('0xd3')](_0xea65c1,_0x3d4836);var _0x23b2ce=[];_0x23b2ce[_0x432f('0x40')]({'model':db[_0x432f('0xde')],'as':_0x432f('0xde'),'attributes':['id',_0x432f('0x3c')],'raw':!![]});_0x23b2ce['push']({'model':db[_0x432f('0xe0')],'as':_0x432f('0x6b'),'attributes':['id',_0x432f('0x10e'),_0x432f('0x10f')],'raw':!![]});if(_0x261815[_0x432f('0x46')][_0x432f('0x10c')]){_0x23b2ce[_0x432f('0x40')]({'model':db[_0x432f('0xd0')],'as':'Attachment','raw':!![]});}var _0x2e4610=[{'model':db['ChatMessage'],'as':_0x432f('0xdd'),'attributes':['id',_0x432f('0x79'),_0x432f('0x80'),'direction','secret',_0x432f('0x86')],'include':_0x23b2ce}];_0x2e4610['push']({'model':db['ChatWebsite'],'as':_0x432f('0x110'),'attributes':['id',_0x432f('0x39')]});_0x2e4610[_0x432f('0x40')]({'model':db[_0x432f('0xde')],'as':_0x432f('0x111'),'attributes':['id',_0x432f('0x3c')]});return db[_0x432f('0x42')][_0x432f('0x67')]({'where':{'id':_0x261815['params']['id']},'include':_0x2e4610})['then'](handleEntityNotFound(_0x1ccd67,null))[_0x432f('0x21')](function(_0x603ef5){if(_0x603ef5){var _0x5f43d5=_0x603ef5['get']({'plain':!![]});fs['mkdirSync'](_0x3af5c9);var _0x52e377={'format':'A4','border':_0x432f('0x112'),'header':{'height':_0x432f('0x113'),'contents':{'first':_0x432f('0x114')}},'footer':{'height':'30px','contents':{'default':util['format']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0x432f('0xd8')]('%s\x20#%d','Chat',_0x5f43d5['id']),moment()[_0x432f('0xd8')](_0x432f('0x115'))[_0x432f('0x9e')]())}}};var _0x4c7dfd={'channel':_0x432f('0x116'),'account':_0x5f43d5[_0x432f('0x110')][_0x432f('0x39')],'agent':_0x5f43d5['Owner']?_0x5f43d5[_0x432f('0x111')][_0x432f('0x3c')]:_0x432f('0x117'),'createdAt':moment(_0x5f43d5['createdAt'])['format'](_0x432f('0x100'))[_0x432f('0x9e')](),'closedAt':_0x5f43d5['closed']?moment(_0x5f43d5[_0x432f('0x118')])[_0x432f('0xd8')](_0x432f('0x100'))['toString']():'','disposition':_0x5f43d5['disposition'],'chatInfo':{'browser':_0x5f43d5['browserName'],'os':_0x5f43d5[_0x432f('0x119')],'referer':_0x5f43d5[_0x432f('0x11a')],'customerIp':_0x5f43d5['customerIp'],'customerPort':_0x5f43d5['customerPort']?_0x5f43d5[_0x432f('0x11b')]:_0x432f('0x117')},'messages':_(_0x5f43d5[_0x432f('0xdd')])['tail']()[_0x432f('0x8a')]({'secret':![]})[_0x432f('0x3b')](function(_0xa555ed){if(_0xa555ed[_0x432f('0xd0')]){var _0x4a8826=path[_0x432f('0xd3')](_0x48817f,_0xa555ed[_0x432f('0xd0')]['basename']);if(fs['existsSync'](_0x4a8826)){fs[_0x432f('0x11c')](_0x4a8826)[_0x432f('0x11d')](fs[_0x432f('0x11e')](path[_0x432f('0xd3')](_0x3af5c9,_0xa555ed[_0x432f('0xd0')]['basename'])));}}return{'date':moment(_0xa555ed[_0x432f('0x80')])[_0x432f('0xd8')](_0x432f('0x100'))[_0x432f('0x9e')](),'sender':_0xa555ed[_0x432f('0xeb')]==='out'?_0xa555ed[_0x432f('0xde')]?_0xa555ed[_0x432f('0xde')][_0x432f('0x3c')]:'System':_0xa555ed[_0x432f('0x6b')][_0x432f('0x10e')]+(_0xa555ed['Contact'][_0x432f('0x10f')]?'\x20'+_0xa555ed[_0x432f('0x6b')][_0x432f('0x10f')]:''),'body':_0xa555ed[_0x432f('0xd0')]?_0xa555ed[_0x432f('0xd0')]['basename']:_0xa555ed[_0x432f('0x79')],'direction':_0xa555ed[_0x432f('0xeb')]===_0x432f('0xc3')?'A':'C','secret':_0xa555ed[_0x432f('0xec')],'read':_0xa555ed[_0x432f('0x86')],'attachment':_0xa555ed[_0x432f('0xd0')]};})['value']()};return ejs[_0x432f('0x11f')](path[_0x432f('0xd3')](config[_0x432f('0xd4')],_0x432f('0x10a'),_0x432f('0x120'),_0x432f('0x121')),{'interaction':_0x4c7dfd})[_0x432f('0x21')](function(_0xe7396f){return new BPromise(function(_0x4d6d7a,_0x3a89e6){pdf[_0x432f('0xb7')](_0xe7396f,_0x52e377)[_0x432f('0x122')](path[_0x432f('0xd3')](_0x3af5c9,_0x432f('0x123')+_0x5f43d5['id']+'-'+_0x3a49ef+_0x432f('0x124')),function(_0x471423,_0x4edc26){if(_0x471423)return _0x3a89e6(_0x471423);_0x4d6d7a(_0x4edc26);});});})[_0x432f('0x21')](function(){return new BPromise(function(_0x177f15,_0x4264ca){zipdir(_0x3af5c9,{'saveTo':_0x2cc8e4},function(_0x1c01d6,_0x463d3c){if(_0x1c01d6)return _0x4264ca(_0x1c01d6);return _0x177f15(_0x463d3c);});})['then'](function(){return new BPromise(function(_0x5ec0d3,_0x5e4b4a){rimraf(_0x3af5c9,function(_0x1e7710){if(_0x1e7710)_0x5e4b4a(_0x1e7710);return _0x5ec0d3();});});})[_0x432f('0x21')](function(){return _0x1ccd67[_0x432f('0x108')](_0x2cc8e4,_0x3d4836,function(_0x33fb5b){if(_0x33fb5b){console[_0x432f('0x125')](_0x432f('0x126'),_0x33fb5b);}else{fs['unlinkSync'](_0x2cc8e4);}});});});}else{return _0x1ccd67[_0x432f('0x37')](0xc8);}})['catch'](handleError(_0x1ccd67,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 00c95ee..48902c5 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 _0xb6fa=['Users','length','emit','catch','hasOwnProperty','exports','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','setDataValue'];(function(_0x3b267f,_0x2a7dd9){var _0x4c0cd8=function(_0x5c20c6){while(--_0x5c20c6){_0x3b267f['push'](_0x3b267f['shift']());}};_0x4c0cd8(++_0x2a7dd9);}(_0xb6fa,0x18c));var _0xab6f=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0xb6fa[_0x31eb67];return _0x2a8cb8;};'use strict';var EventEmitter=require(_0xab6f('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xab6f('0x1')];var ChatMessage=require(_0xab6f('0x2'))['db'][_0xab6f('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xab6f('0x4')](0x0);var events={'afterCreate':_0xab6f('0x5'),'afterUpdate':_0xab6f('0x6'),'afterDestroy':_0xab6f('0x7')};function emitEvent(_0x3ac444){return function(_0x194df2,_0x1ddd11,_0x2c3495){_0x194df2['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x5ef85d){_0x194df2[_0xab6f('0x8')](_0xab6f('0x9'),_0x5ef85d['map'](function(_0x2657d0){return{'id':_0x2657d0['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x194df2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x57502b){_0x194df2['setDataValue']('unreadMessages',_0x57502b[_0xab6f('0xa')]);ChatInteractionEvents['emit'](_0x3ac444+':'+_0x194df2['id'],_0x194df2);ChatInteractionEvents[_0xab6f('0xb')](_0x3ac444,_0x194df2);_0x2c3495(null);})[_0xab6f('0xc')](_0x2c3495(null));};}for(var e in events){if(events[_0xab6f('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xab6f('0xe')]=ChatInteractionEvents; \ No newline at end of file +var _0x1228=['remove','then','Users','map','findAll','emit','catch','hasOwnProperty','hook','events','ChatInteraction','ChatMessage','setMaxListeners','save'];(function(_0x49001f,_0xe397f0){var _0x67c2dc=function(_0x4ef564){while(--_0x4ef564){_0x49001f['push'](_0x49001f['shift']());}};_0x67c2dc(++_0xe397f0);}(_0x1228,0x12f));var _0x8122=function(_0x58c3ab,_0x4977c3){_0x58c3ab=_0x58c3ab-0x0;var _0x20ee8f=_0x1228[_0x58c3ab];return _0x20ee8f;};'use strict';var EventEmitter=require(_0x8122('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x8122('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0x8122('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8122('0x3')](0x0);var events={'afterCreate':_0x8122('0x4'),'afterUpdate':'update','afterDestroy':_0x8122('0x5')};function emitEvent(_0xf4d3e5){return function(_0x4de3a0,_0x274936,_0x130959){_0x4de3a0['getUsers']({'attributes':['id'],'raw':!![]})[_0x8122('0x6')](function(_0x139c44){_0x4de3a0['setDataValue'](_0x8122('0x7'),_0x139c44[_0x8122('0x8')](function(_0x55078d){return{'id':_0x55078d['id']};}));return ChatMessage[_0x8122('0x9')]({'where':{'ChatInteractionId':_0x4de3a0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8122('0x6')](function(_0x4a1378){_0x4de3a0['setDataValue']('unreadMessages',_0x4a1378['length']);ChatInteractionEvents[_0x8122('0xa')](_0xf4d3e5+':'+_0x4de3a0['id'],_0x4de3a0);ChatInteractionEvents['emit'](_0xf4d3e5,_0x4de3a0);_0x130959(null);})[_0x8122('0xb')](_0x130959(null));};}for(var e in events){if(events[_0x8122('0xc')](e)){var event=events[e];ChatInteraction[_0x8122('0xd')](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 0d3e4f9..c1f0867 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 _0x6e7e=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x10f6e8,_0x351db6){var _0x35bb3c=function(_0x30a39b){while(--_0x30a39b){_0x10f6e8['push'](_0x10f6e8['shift']());}};_0x35bb3c(++_0x351db6);}(_0x6e7e,0xa2));var _0xe6e7=function(_0x42868d,_0x165917){_0x42868d=_0x42868d-0x0;var _0xd29bb1=_0x6e7e[_0x42868d];return _0xd29bb1;};'use strict';var _=require(_0xe6e7('0x0'));var util=require(_0xe6e7('0x1'));var logger=require(_0xe6e7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe6e7('0x3'));var rp=require(_0xe6e7('0x4'));var fs=require('fs');var path=require(_0xe6e7('0x5'));var rimraf=require(_0xe6e7('0x6'));var config=require('../../config/environment');var attributes=require(_0xe6e7('0x7'));module['exports']=function(_0x130a6d,_0x576e07){return _0x130a6d[_0xe6e7('0x8')](_0xe6e7('0x9'),attributes,{'tableName':_0xe6e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42fcfd,_0x371387,_0x229473){if(_0x42fcfd[_0xe6e7('0xb')](_0xe6e7('0xc'))){_0x42fcfd[_0xe6e7('0xd')]=moment()[_0xe6e7('0xe')](_0xe6e7('0xf'));}_0x229473(null,_0x42fcfd);}},'charset':_0xe6e7('0x10'),'collate':_0xe6e7('0x11')});}; \ No newline at end of file +var _0xdbf3=['../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xdbf3,0x191));var _0x3dbf=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0xdbf3[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0x3dbf('0x0'));var util=require('util');var logger=require(_0x3dbf('0x1'))(_0x3dbf('0x2'));var moment=require(_0x3dbf('0x3'));var BPromise=require(_0x3dbf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3dbf('0x5'));var rimraf=require(_0x3dbf('0x6'));var config=require(_0x3dbf('0x7'));var attributes=require(_0x3dbf('0x8'));module['exports']=function(_0x3eb459,_0x1b1372){return _0x3eb459[_0x3dbf('0x9')](_0x3dbf('0xa'),attributes,{'tableName':_0x3dbf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x36b083,_0x182f05,_0x5e7bf3){if(_0x36b083[_0x3dbf('0xc')](_0x3dbf('0xd'))){_0x36b083['closedAt']=moment()[_0x3dbf('0xe')](_0x3dbf('0xf'));}_0x5e7bf3(null,_0x36b083);}},'charset':'utf8mb4','collate':_0x3dbf('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 8da5565..20bf928 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 _0xba23=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','attributes','then','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis'];(function(_0x570eaf,_0x14dd36){var _0x386278=function(_0x4c9184){while(--_0x4c9184){_0x570eaf['push'](_0x570eaf['shift']());}};_0x386278(++_0x14dd36);}(_0xba23,0x128));var _0x3ba2=function(_0xaf43cf,_0x30065a){_0xaf43cf=_0xaf43cf-0x0;var _0x3c792d=_0xba23[_0xaf43cf];return _0x3c792d;};'use strict';var _=require(_0x3ba2('0x0'));var util=require(_0x3ba2('0x1'));var moment=require(_0x3ba2('0x2'));var BPromise=require(_0x3ba2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ba2('0x4'));var db=require(_0x3ba2('0x5'))['db'];var utils=require(_0x3ba2('0x6'));var logger=require(_0x3ba2('0x7'))(_0x3ba2('0x8'));var config=require(_0x3ba2('0x9'));var jayson=require(_0x3ba2('0xa'));var client=jayson[_0x3ba2('0xb')][_0x3ba2('0xc')]({'port':0x232a});config[_0x3ba2('0xd')]=_['defaults'](config['redis'],{'host':_0x3ba2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ba2('0xd')]));require(_0x3ba2('0xf'))[_0x3ba2('0x10')](socket);function respondWithRpcPromise(_0x284f8d,_0x5b5926,_0x1aa8d9){return new BPromise(function(_0x504fa5,_0x5d7379){return client[_0x3ba2('0x11')](_0x284f8d,_0x1aa8d9)['then'](function(_0x2cf5a9){logger[_0x3ba2('0x12')](_0x3ba2('0x13'),_0x5b5926,_0x3ba2('0x14'));logger[_0x3ba2('0x15')](_0x3ba2('0x16'),_0x5b5926,_0x3ba2('0x14'),JSON[_0x3ba2('0x17')](_0x2cf5a9));if(_0x2cf5a9['error']){if(_0x2cf5a9[_0x3ba2('0x18')][_0x3ba2('0x19')]===0x1f4){logger[_0x3ba2('0x18')](_0x3ba2('0x13'),_0x5b5926,_0x2cf5a9[_0x3ba2('0x18')][_0x3ba2('0x1a')]);return _0x5d7379(_0x2cf5a9[_0x3ba2('0x18')]['message']);}logger[_0x3ba2('0x18')](_0x3ba2('0x13'),_0x5b5926,_0x2cf5a9[_0x3ba2('0x18')][_0x3ba2('0x1a')]);return _0x504fa5(_0x2cf5a9[_0x3ba2('0x18')][_0x3ba2('0x1a')]);}else{logger[_0x3ba2('0x12')](_0x3ba2('0x13'),_0x5b5926,_0x3ba2('0x14'));_0x504fa5(_0x2cf5a9[_0x3ba2('0x1b')][_0x3ba2('0x1a')]);}})[_0x3ba2('0x1c')](function(_0x357dc5){logger[_0x3ba2('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x5b5926,_0x357dc5);_0x5d7379(_0x357dc5);});});}exports[_0x3ba2('0x1d')]=function(_0x579f57){var _0x551d52=this;return new Promise(function(_0x44a122,_0x77a50c){return db[_0x3ba2('0x1e')][_0x3ba2('0x1f')](_0x579f57[_0x3ba2('0x20')],{'raw':_0x579f57[_0x3ba2('0x21')]?_0x579f57['options'][_0x3ba2('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x579f57[_0x3ba2('0x21')]?_0x579f57[_0x3ba2('0x21')][_0x3ba2('0x23')]||null:null,'attributes':_0x579f57['options']?_0x579f57[_0x3ba2('0x21')][_0x3ba2('0x24')]||null:null,'limit':_0x579f57[_0x3ba2('0x21')]?_0x579f57[_0x3ba2('0x21')]['limit']||null:null})[_0x3ba2('0x25')](function(_0x1b7d6c){logger[_0x3ba2('0x12')](_0x3ba2('0x1d'),_0x579f57);logger['debug'](_0x3ba2('0x1d'),_0x579f57,JSON['stringify'](_0x1b7d6c));_0x44a122(_0x1b7d6c);})[_0x3ba2('0x1c')](function(_0x474e9d){logger[_0x3ba2('0x18')](_0x3ba2('0x1d'),_0x474e9d['message'],_0x579f57);_0x77a50c(_0x551d52[_0x3ba2('0x18')](0x1f4,_0x474e9d[_0x3ba2('0x1a')]));});});};exports['AddTagsToChatInteraction']=function(_0x14e4ee){return new Promise(function(_0x1c545f,_0x329768){return db[_0x3ba2('0x1e')][_0x3ba2('0x26')]({'where':_0x14e4ee[_0x3ba2('0x21')]?_0x14e4ee['options'][_0x3ba2('0x23')]||null:null})[_0x3ba2('0x25')](function(_0x3de9d9){if(_0x3de9d9){return _0x3de9d9[_0x3ba2('0x27')](_0x14e4ee[_0x3ba2('0x20')][_0x3ba2('0x28')],_[_0x3ba2('0x29')](_0x14e4ee[_0x3ba2('0x20')],[_0x3ba2('0x28'),'id'])||{});}})['spread'](function(_0xef1f8a){logger[_0x3ba2('0x12')](_0x3ba2('0x2a'),_0x14e4ee);logger[_0x3ba2('0x15')]('AddTags',_0x14e4ee,JSON[_0x3ba2('0x17')](_0xef1f8a));_0x1c545f(_0xef1f8a);})[_0x3ba2('0x1c')](function(_0xa46f06){logger[_0x3ba2('0x18')]('AddTags',_0xa46f06[_0x3ba2('0x1a')],_0x14e4ee);_0x329768(_this[_0x3ba2('0x18')](0x1f4,_0xa46f06['message']));});});}; \ No newline at end of file +var _0xfd86=['ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','find','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./chatInteraction.socket','register','then'];(function(_0x4f3240,_0xdb0ccc){var _0x38475e=function(_0x20904a){while(--_0x20904a){_0x4f3240['push'](_0x4f3240['shift']());}};_0x38475e(++_0xdb0ccc);}(_0xfd86,0x1ac));var _0x6fd8=function(_0x19aa84,_0x549537){_0x19aa84=_0x19aa84-0x0;var _0x536146=_0xfd86[_0x19aa84];return _0x536146;};'use strict';var _=require(_0x6fd8('0x0'));var util=require(_0x6fd8('0x1'));var moment=require('moment');var BPromise=require(_0x6fd8('0x2'));var rs=require(_0x6fd8('0x3'));var fs=require('fs');var Redis=require(_0x6fd8('0x4'));var db=require(_0x6fd8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fd8('0x6'))(_0x6fd8('0x7'));var config=require(_0x6fd8('0x8'));var jayson=require(_0x6fd8('0x9'));var client=jayson[_0x6fd8('0xa')][_0x6fd8('0xb')]({'port':0x232a});config[_0x6fd8('0xc')]=_['defaults'](config[_0x6fd8('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6fd8('0xc')]));require(_0x6fd8('0xd'))[_0x6fd8('0xe')](socket);function respondWithRpcPromise(_0xa5fa2c,_0x5b4ea8,_0x19940a){return new BPromise(function(_0x4a9f0a,_0x3637fa){return client['request'](_0xa5fa2c,_0x19940a)[_0x6fd8('0xf')](function(_0x2e0b6e){logger['info'](_0x6fd8('0x10'),_0x5b4ea8,_0x6fd8('0x11'));logger[_0x6fd8('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5b4ea8,_0x6fd8('0x11'),JSON[_0x6fd8('0x13')](_0x2e0b6e));if(_0x2e0b6e['error']){if(_0x2e0b6e[_0x6fd8('0x14')][_0x6fd8('0x15')]===0x1f4){logger[_0x6fd8('0x14')](_0x6fd8('0x10'),_0x5b4ea8,_0x2e0b6e['error'][_0x6fd8('0x16')]);return _0x3637fa(_0x2e0b6e[_0x6fd8('0x14')][_0x6fd8('0x16')]);}logger['error'](_0x6fd8('0x10'),_0x5b4ea8,_0x2e0b6e[_0x6fd8('0x14')][_0x6fd8('0x16')]);return _0x4a9f0a(_0x2e0b6e[_0x6fd8('0x14')][_0x6fd8('0x16')]);}else{logger[_0x6fd8('0x17')](_0x6fd8('0x10'),_0x5b4ea8,'request\x20sent');_0x4a9f0a(_0x2e0b6e['result'][_0x6fd8('0x16')]);}})[_0x6fd8('0x18')](function(_0x36535a){logger[_0x6fd8('0x14')](_0x6fd8('0x10'),_0x5b4ea8,_0x36535a);_0x3637fa(_0x36535a);});});}exports[_0x6fd8('0x19')]=function(_0x15accf){var _0x167c68=this;return new Promise(function(_0x467baa,_0x3c6e90){return db[_0x6fd8('0x1a')]['update'](_0x15accf[_0x6fd8('0x1b')],{'raw':_0x15accf[_0x6fd8('0x1c')]?_0x15accf[_0x6fd8('0x1c')][_0x6fd8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15accf['options']?_0x15accf[_0x6fd8('0x1c')][_0x6fd8('0x1e')]||null:null,'attributes':_0x15accf[_0x6fd8('0x1c')]?_0x15accf['options'][_0x6fd8('0x1f')]||null:null,'limit':_0x15accf[_0x6fd8('0x1c')]?_0x15accf[_0x6fd8('0x1c')]['limit']||null:null})[_0x6fd8('0xf')](function(_0xbcd148){logger[_0x6fd8('0x17')](_0x6fd8('0x19'),_0x15accf);logger[_0x6fd8('0x12')]('UpdateChatInteraction',_0x15accf,JSON[_0x6fd8('0x13')](_0xbcd148));_0x467baa(_0xbcd148);})[_0x6fd8('0x18')](function(_0x5f4703){logger[_0x6fd8('0x14')](_0x6fd8('0x19'),_0x5f4703['message'],_0x15accf);_0x3c6e90(_0x167c68[_0x6fd8('0x14')](0x1f4,_0x5f4703[_0x6fd8('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0x55df79){return new Promise(function(_0x16c74b,_0x561d55){return db[_0x6fd8('0x1a')][_0x6fd8('0x20')]({'where':_0x55df79[_0x6fd8('0x1c')]?_0x55df79[_0x6fd8('0x1c')][_0x6fd8('0x1e')]||null:null})[_0x6fd8('0xf')](function(_0x56322){if(_0x56322){return _0x56322['addTags'](_0x55df79[_0x6fd8('0x1b')]['ids'],_[_0x6fd8('0x21')](_0x55df79['body'],[_0x6fd8('0x22'),'id'])||{});}})[_0x6fd8('0x23')](function(_0x27bbce){logger['info']('AddTags',_0x55df79);logger[_0x6fd8('0x12')](_0x6fd8('0x24'),_0x55df79,JSON[_0x6fd8('0x13')](_0x27bbce));_0x16c74b(_0x27bbce);})[_0x6fd8('0x18')](function(_0x56e9b8){logger['error'](_0x6fd8('0x24'),_0x56e9b8[_0x6fd8('0x16')],_0x55df79);_0x561d55(_this[_0x6fd8('0x14')](0x1f4,_0x56e9b8[_0x6fd8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 86f311c..5ceff2c 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 _0x86b4=['emit','removeListener','length','chatInteraction:','./chatInteraction.events','save','update'];(function(_0x234318,_0xf22f31){var _0x1ab719=function(_0x10a0b1){while(--_0x10a0b1){_0x234318['push'](_0x234318['shift']());}};_0x1ab719(++_0xf22f31);}(_0x86b4,0x6d));var _0x486b=function(_0x309bfb,_0x5ddf1b){_0x309bfb=_0x309bfb-0x0;var _0x364533=_0x86b4[_0x309bfb];return _0x364533;};'use strict';var ChatInteractionEvents=require(_0x486b('0x0'));var events=[_0x486b('0x1'),'remove',_0x486b('0x2')];function createListener(_0x5960ac,_0x5c33c1){return function(_0x12999f){_0x5c33c1[_0x486b('0x3')](_0x5960ac,_0x12999f);};}function removeListener(_0x2d7971,_0x5324ca){return function(){ChatInteractionEvents[_0x486b('0x4')](_0x2d7971,_0x5324ca);};}exports['register']=function(_0x28832c){for(var _0x544740=0x0,_0x22cda9=events[_0x486b('0x5')];_0x544740<_0x22cda9;_0x544740++){var _0x32d464=events[_0x544740];var _0x5cdcc7=createListener(_0x486b('0x6')+_0x32d464,_0x28832c);ChatInteractionEvents['on'](_0x32d464,_0x5cdcc7);}}; \ No newline at end of file +var _0x4871=['save','remove','update','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x4871,0x1cf));var _0x1487=function(_0x333f85,_0x745520){_0x333f85=_0x333f85-0x0;var _0x208308=_0x4871[_0x333f85];return _0x208308;};'use strict';var ChatInteractionEvents=require(_0x1487('0x0'));var events=[_0x1487('0x1'),_0x1487('0x2'),_0x1487('0x3')];function createListener(_0xbe710f,_0x30a691){return function(_0x1b74e2){_0x30a691['emit'](_0xbe710f,_0x1b74e2);};}function removeListener(_0x8570f2,_0x45e4d9){return function(){ChatInteractionEvents[_0x1487('0x4')](_0x8570f2,_0x45e4d9);};}exports[_0x1487('0x5')]=function(_0x589321){for(var _0x5aa2fc=0x0,_0x5606b2=events[_0x1487('0x6')];_0x5aa2fc<_0x5606b2;_0x5aa2fc++){var _0x132369=events[_0x5aa2fc];var _0x529c50=createListener(_0x1487('0x7')+_0x132369,_0x589321);ChatInteractionEvents['on'](_0x132369,_0x529c50);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index c1ef9ce..bf60dee 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 _0xbaf0=['show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','attachmentUpload','addMessage','/:id/tags','tracked','chat','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x33292f,_0x49e426){var _0x39a6f3=function(_0x995982){while(--_0x995982){_0x33292f['push'](_0x33292f['shift']());}};_0x39a6f3(++_0x49e426);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x10')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x8')](_0x0baf('0x12'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x13')]);router[_0x0baf('0x8')](_0x0baf('0x14'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x0baf('0x8')](_0x0baf('0x15'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router['post']('/',auth[_0x0baf('0x9')](),controller['create']);router[_0x0baf('0x17')](_0x0baf('0x18'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);var upload=multer({'storage':multer[_0x0baf('0x1a')]({'destination':function(_0x469599,_0x4f80a8,_0x4cd79d){_0x4cd79d(null,path[_0x0baf('0x1b')](config[_0x0baf('0x1c')],_0x0baf('0x1d')));},'filename':function(_0x3d83a3,_0x2cf7da,_0x288a98){_0x288a98(null,util['format'](_0x0baf('0x1e'),Date[_0x0baf('0x1f')](),_0x2cf7da[_0x0baf('0x20')][_0x0baf('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0baf('0x17')](_0x0baf('0x22'),upload['single']('file'),controller[_0x0baf('0x23')]);router[_0x0baf('0x17')](_0x0baf('0x12'),auth[_0x0baf('0x10')](),controller[_0x0baf('0x24')]);router[_0x0baf('0x17')](_0x0baf('0x25'),auth[_0x0baf('0x9')](),interaction[_0x0baf('0x26')](_0x0baf('0x27'),'chatinteraction:addtags'),controller[_0x0baf('0x28')]);router['put'](_0x0baf('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x0baf('0x27'),'chatinteraction:update'),controller['update']);router[_0x0baf('0x29')](_0x0baf('0x2a'),controller[_0x0baf('0x2b')]);router[_0x0baf('0x29')](_0x0baf('0x2c'),auth['isChatInteractionAuthorized'](),controller[_0x0baf('0x2d')]);router[_0x0baf('0x29')](_0x0baf('0x2e'),controller[_0x0baf('0x2f')]);router[_0x0baf('0x30')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),interaction['tracked'](_0x0baf('0x27'),_0x0baf('0x31')),controller[_0x0baf('0x32')]);router[_0x0baf('0x30')]('/:id/tags',auth[_0x0baf('0x9')](),controller[_0x0baf('0x33')]);module['exports']=router; \ No newline at end of file +var _0xf3f9=['get','/:id','show','/:id/messages','isAuthenticated','getMessages','/:id/my_messages','isChatInteractionAuthorized','getMyMessages','/:id/download','download','create','createVidaooSession','diskStorage','root','server/files/attachments/','format','now','replace','post','single','file','attachmentUpload','addMessage','/:id/tags','chat','chatinteraction:addtags','put','tracked','chatinteraction:update','update','/:id/custom_update','/:id/abandon','/:id/close','close','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','index','/describe','describe'];(function(_0x48cdd5,_0x3e5636){var _0x18d568=function(_0x55fec9){while(--_0x55fec9){_0x48cdd5['push'](_0x48cdd5['shift']());}};_0x18d568(++_0x3e5636);}(_0xf3f9,0x1de));var _0x9f3f=function(_0x372fdb,_0x445489){_0x372fdb=_0x372fdb-0x0;var _0x604d24=_0xf3f9[_0x372fdb];return _0x604d24;};'use strict';var multer=require(_0x9f3f('0x0'));var util=require(_0x9f3f('0x1'));var path=require('path');var timeout=require(_0x9f3f('0x2'));var express=require(_0x9f3f('0x3'));var router=express[_0x9f3f('0x4')]();var auth=require(_0x9f3f('0x5'));var interaction=require(_0x9f3f('0x6'));var config=require(_0x9f3f('0x7'));var controller=require(_0x9f3f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x9f3f('0x9')]);router['get'](_0x9f3f('0xa'),auth['isAuthenticated'](),controller[_0x9f3f('0xb')]);router[_0x9f3f('0xc')](_0x9f3f('0xd'),auth['isChatInteractionAuthorized'](),controller[_0x9f3f('0xe')]);router['get']('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x9f3f('0xc')](_0x9f3f('0xf'),auth[_0x9f3f('0x10')](),controller[_0x9f3f('0x11')]);router[_0x9f3f('0xc')](_0x9f3f('0x12'),auth[_0x9f3f('0x13')](),controller[_0x9f3f('0x14')]);router[_0x9f3f('0xc')](_0x9f3f('0x15'),auth[_0x9f3f('0x10')](),controller[_0x9f3f('0x16')]);router['post']('/',auth[_0x9f3f('0x10')](),controller[_0x9f3f('0x17')]);router['post']('/:id/vidaoo',auth[_0x9f3f('0x10')](),controller[_0x9f3f('0x18')]);var upload=multer({'storage':multer[_0x9f3f('0x19')]({'destination':function(_0x1eff51,_0x3e2d1d,_0x40a26b){_0x40a26b(null,path['join'](config[_0x9f3f('0x1a')],_0x9f3f('0x1b')));},'filename':function(_0x216cf1,_0x124077,_0x1c7633){_0x1c7633(null,util[_0x9f3f('0x1c')]('%s-%s',Date[_0x9f3f('0x1d')](),_0x124077['originalname'][_0x9f3f('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9f3f('0x1f')]('/:id/attachment_upload',upload[_0x9f3f('0x20')](_0x9f3f('0x21')),controller[_0x9f3f('0x22')]);router[_0x9f3f('0x1f')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x9f3f('0x23')]);router['post'](_0x9f3f('0x24'),auth['isAuthenticated'](),interaction['tracked'](_0x9f3f('0x25'),_0x9f3f('0x26')),controller['addTags']);router[_0x9f3f('0x27')]('/:id',auth['isAuthenticated'](),interaction[_0x9f3f('0x28')](_0x9f3f('0x25'),_0x9f3f('0x29')),controller[_0x9f3f('0x2a')]);router['put'](_0x9f3f('0x2b'),controller['customUpdate']);router[_0x9f3f('0x27')](_0x9f3f('0x2c'),auth[_0x9f3f('0x13')](),controller['abandon']);router[_0x9f3f('0x27')](_0x9f3f('0x2d'),controller[_0x9f3f('0x2e')]);router[_0x9f3f('0x2f')](_0x9f3f('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x9f3f('0x25'),'chatinteraction:destroy'),controller[_0x9f3f('0x30')]);router[_0x9f3f('0x2f')]('/:id/tags',auth[_0x9f3f('0x10')](),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 04f1941..e33bcbd 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 _0xadb5=['INTEGER','exports','medium','BOOLEAN'];(function(_0x5d7102,_0x5e5171){var _0x471bd6=function(_0x8c788f){while(--_0x8c788f){_0x5d7102['push'](_0x5d7102['shift']());}};_0x471bd6(++_0x5e5171);}(_0xadb5,0xad));var _0x5adb=function(_0x15b27c,_0x2d8477){_0x15b27c=_0x15b27c-0x0;var _0x390b1d=_0xadb5[_0x15b27c];return _0x390b1d;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x5adb('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5adb('0x3')]}}; \ No newline at end of file +var _0x0b0e=['TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5ecff9,_0x473070){_0x5ecff9=_0x5ecff9-0x0;var _0x5e1415=_0x0b0e[_0x5ecff9];return _0x5e1415;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe0b0('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index c0518a3..aacec53 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 _0x020e=['-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','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','../../mysqldb','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','findAll','catch','show','params','filters','includeAll','include','find','create','body','describe','get','lastMessageAt','createdAt','lastMessage','format','agent','admin','user','fullname','role','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','read'];(function(_0x5467f1,_0x4ca013){var _0x1c1041=function(_0x2d1764){while(--_0x2d1764){_0x5467f1['push'](_0x5467f1['shift']());}};_0x1c1041(++_0x4ca013);}(_0x020e,0x1c2));var _0xe020=function(_0x2bcbaa,_0xc36684){_0x2bcbaa=_0x2bcbaa-0x0;var _0xadab54=_0x020e[_0x2bcbaa];return _0xadab54;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe020('0x0'));var rimraf=require(_0xe020('0x1'));var zipdir=require(_0xe020('0x2'));var jsonpatch=require(_0xe020('0x3'));var rp=require(_0xe020('0x4'));var moment=require(_0xe020('0x5'));var BPromise=require(_0xe020('0x6'));var Mustache=require(_0xe020('0x7'));var util=require(_0xe020('0x8'));var path=require('path');var sox=require(_0xe020('0x9'));var csv=require(_0xe020('0xa'));var ejs=require(_0xe020('0xb'));var fs=require('fs');var _=require(_0xe020('0xc'));var squel=require(_0xe020('0xd'));var crypto=require(_0xe020('0xe'));var jsforce=require(_0xe020('0xf'));var deskjs=require(_0xe020('0x10'));var toCsv=require(_0xe020('0xa'));var querystring=require('querystring');var Papa=require(_0xe020('0x11'));var Redis=require(_0xe020('0x12'));var authService=require(_0xe020('0x13'));var qs=require(_0xe020('0x14'));var as=require(_0xe020('0x15'));var hardwareService=require(_0xe020('0x16'));var logger=require(_0xe020('0x17'))(_0xe020('0x18'));var utils=require('../../config/utils');var config=require(_0xe020('0x19'));var db=require(_0xe020('0x1a'))['db'];config[_0xe020('0x1b')]=_['defaults'](config[_0xe020('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xe020('0x1c'))(new Redis(config[_0xe020('0x1b')]));require(_0xe020('0x1d'))[_0xe020('0x1e')](socket);function respondWithStatusCode(_0x392d80,_0x570bb7){_0x570bb7=_0x570bb7||0xcc;return function(_0x481d6f){if(_0x481d6f){return _0x392d80[_0xe020('0x1f')](_0x570bb7);}return _0x392d80[_0xe020('0x20')](_0x570bb7)[_0xe020('0x21')]();};}function respondWithResult(_0x2e2013,_0x38fe5a){_0x38fe5a=_0x38fe5a||0xc8;return function(_0x4a0e48){if(_0x4a0e48){return _0x2e2013[_0xe020('0x20')](_0x38fe5a)[_0xe020('0x22')](_0x4a0e48);}};}function respondWithFilteredResult(_0x44e75a,_0x1cd773){return function(_0x3210fd){if(_0x3210fd){var _0x272256=_0x3210fd[_0xe020('0x23')],_0x234275=_0x1cd773[_0xe020('0x24')],_0x2ce20d=_0x1cd773[_0xe020('0x24')]+_0x1cd773['limit'],_0x910a6d;if(_0x2ce20d>=_0x272256){_0x2ce20d=_0x272256;_0x910a6d=0xc8;}else{_0x910a6d=0xce;}_0x44e75a['status'](_0x910a6d);return _0x44e75a[_0xe020('0x25')](_0xe020('0x26'),_0x234275+'-'+_0x2ce20d+'/'+_0x272256)[_0xe020('0x22')](_0x3210fd);}return null;};}function patchUpdates(_0x1757a2){return function(_0x23ca13){try{jsonpatch[_0xe020('0x27')](_0x23ca13,_0x1757a2,!![]);}catch(_0x2f423f){return BPromise[_0xe020('0x28')](_0x2f423f);}return _0x23ca13['save']();};}function saveUpdates(_0x83773f,_0x3fb328){return function(_0x355830){if(_0x355830){return _0x355830[_0xe020('0x29')](_0x83773f)[_0xe020('0x2a')](function(_0x313b82){return _0x313b82;});}return null;};}function removeEntity(_0x56af36,_0x41728d){return function(_0x4d7c2c){if(_0x4d7c2c){return _0x4d7c2c[_0xe020('0x2b')]()[_0xe020('0x2a')](function(){_0x56af36['status'](0xcc)[_0xe020('0x21')]();});}};}function handleEntityNotFound(_0x422b83,_0x37ec8d){return function(_0x5b9b9f){if(!_0x5b9b9f){_0x422b83['sendStatus'](0x194);}return _0x5b9b9f;};}function handleError(_0x7c9c68,_0x481fc9){_0x481fc9=_0x481fc9||0x1f4;return function(_0x55b2c0){logger['error'](_0x55b2c0['stack']);if(_0x55b2c0['name']){delete _0x55b2c0[_0xe020('0x2c')];}_0x7c9c68[_0xe020('0x20')](_0x481fc9)[_0xe020('0x2d')](_0x55b2c0);};}exports[_0xe020('0x2e')]=function(_0x2560d9,_0x1831d7){var _0x36b311={},_0x1f098f={},_0x1fcccc={'count':0x0,'rows':[]};var _0x1bb0c9=_[_0xe020('0x2f')](db[_0xe020('0x30')][_0xe020('0x31')],function(_0x541de7){return{'name':_0x541de7[_0xe020('0x32')],'type':_0x541de7[_0xe020('0x33')]['key']};});_0x1f098f[_0xe020('0x34')]=_['map'](_0x1bb0c9,_0xe020('0x2c'));_0x1f098f[_0xe020('0x35')]=_[_0xe020('0x36')](_0x2560d9[_0xe020('0x35')]);_0x1f098f['filters']=_[_0xe020('0x37')](_0x1f098f['model'],_0x1f098f[_0xe020('0x35')]);_0x36b311['attributes']=_['intersection'](_0x1f098f[_0xe020('0x34')],qs[_0xe020('0x38')](_0x2560d9[_0xe020('0x35')][_0xe020('0x38')]));_0x36b311[_0xe020('0x39')]=_0x36b311['attributes'][_0xe020('0x3a')]?_0x36b311[_0xe020('0x39')]:_0x1f098f['model'];if(!_0x2560d9[_0xe020('0x35')][_0xe020('0x3b')](_0xe020('0x3c'))){_0x36b311['limit']=qs[_0xe020('0x3d')](_0x2560d9[_0xe020('0x35')][_0xe020('0x3d')]);_0x36b311[_0xe020('0x24')]=qs['offset'](_0x2560d9[_0xe020('0x35')][_0xe020('0x24')]);}_0x36b311[_0xe020('0x3e')]=qs[_0xe020('0x3f')](_0x2560d9[_0xe020('0x35')][_0xe020('0x3f')]);_0x36b311[_0xe020('0x40')]=qs['filters'](_[_0xe020('0x41')](_0x2560d9[_0xe020('0x35')],_0x1f098f['filters']),_0x1bb0c9);if(_0x2560d9[_0xe020('0x35')][_0xe020('0x42')]){_0x36b311[_0xe020('0x40')]=_[_0xe020('0x43')](_0x36b311[_0xe020('0x40')],{'$or':_[_0xe020('0x2f')](_0x1bb0c9,function(_0x30875f){if(_0x30875f[_0xe020('0x33')]!=='VIRTUAL'){var _0x4be3d0={};_0x4be3d0[_0x30875f['name']]={'$like':'%'+_0x2560d9[_0xe020('0x35')]['filter']+'%'};return _0x4be3d0;}})});}_0x36b311=_[_0xe020('0x43')]({},_0x36b311,_0x2560d9[_0xe020('0x44')]);var _0x235f29={'where':_0x36b311[_0xe020('0x40')]};return db['ChatInternalMessage'][_0xe020('0x23')](_0x235f29)[_0xe020('0x2a')](function(_0x3777e4){_0x1fcccc[_0xe020('0x23')]=_0x3777e4;if(_0x2560d9['query']['includeAll']){_0x36b311['include']=[{'all':!![]}];}return db[_0xe020('0x30')][_0xe020('0x45')](_0x36b311);})[_0xe020('0x2a')](function(_0xad95a4){_0x1fcccc['rows']=_0xad95a4;return _0x1fcccc;})[_0xe020('0x2a')](respondWithFilteredResult(_0x1831d7,_0x36b311))[_0xe020('0x46')](handleError(_0x1831d7,null));};exports[_0xe020('0x47')]=function(_0xdc6a0a,_0x55030f){var _0x420bbe={'raw':!![],'where':{'id':_0xdc6a0a[_0xe020('0x48')]['id']}},_0x9fce8c={};_0x9fce8c[_0xe020('0x34')]=_['keys'](db[_0xe020('0x30')][_0xe020('0x31')]);_0x9fce8c[_0xe020('0x35')]=_[_0xe020('0x36')](_0xdc6a0a[_0xe020('0x35')]);_0x9fce8c[_0xe020('0x49')]=_[_0xe020('0x37')](_0x9fce8c[_0xe020('0x34')],_0x9fce8c[_0xe020('0x35')]);_0x420bbe[_0xe020('0x39')]=_[_0xe020('0x37')](_0x9fce8c[_0xe020('0x34')],qs[_0xe020('0x38')](_0xdc6a0a[_0xe020('0x35')][_0xe020('0x38')]));_0x420bbe['attributes']=_0x420bbe['attributes'][_0xe020('0x3a')]?_0x420bbe[_0xe020('0x39')]:_0x9fce8c[_0xe020('0x34')];if(_0xdc6a0a[_0xe020('0x35')][_0xe020('0x4a')]){_0x420bbe[_0xe020('0x4b')]=[{'all':!![]}];}_0x420bbe=_['merge']({},_0x420bbe,_0xdc6a0a[_0xe020('0x44')]);return db['ChatInternalMessage'][_0xe020('0x4c')](_0x420bbe)[_0xe020('0x2a')](handleEntityNotFound(_0x55030f,null))[_0xe020('0x2a')](respondWithResult(_0x55030f,null))['catch'](handleError(_0x55030f,null));};exports[_0xe020('0x4d')]=function(_0x293b0a,_0x550d35){return db[_0xe020('0x30')]['create'](_0x293b0a['body'],{})['then'](respondWithResult(_0x550d35,0xc9))['catch'](handleError(_0x550d35,null));};exports[_0xe020('0x29')]=function(_0x2f35fe,_0x2fc2a5){if(_0x2f35fe[_0xe020('0x4e')]['id']){delete _0x2f35fe[_0xe020('0x4e')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x2f35fe[_0xe020('0x48')]['id']}})[_0xe020('0x2a')](handleEntityNotFound(_0x2fc2a5,null))[_0xe020('0x2a')](saveUpdates(_0x2f35fe[_0xe020('0x4e')],null))[_0xe020('0x2a')](respondWithResult(_0x2fc2a5,null))['catch'](handleError(_0x2fc2a5,null));};exports['destroy']=function(_0xf5fb3c,_0x2a685c){return db[_0xe020('0x30')][_0xe020('0x4c')]({'where':{'id':_0xf5fb3c[_0xe020('0x48')]['id']}})[_0xe020('0x2a')](handleEntityNotFound(_0x2a685c,null))[_0xe020('0x2a')](removeEntity(_0x2a685c,null))[_0xe020('0x46')](handleError(_0x2a685c,null));};exports[_0xe020('0x4f')]=function(_0xf8ff44,_0x40c6ff){return db[_0xe020('0x30')][_0xe020('0x4f')]()[_0xe020('0x2a')](respondWithResult(_0x40c6ff,null))[_0xe020('0x46')](handleError(_0x40c6ff,null));};function wrapUser(_0x12c291){return function(_0x54189e){var _0x2e66d5=_0x12c291[_0xe020('0x50')]({'plain':!![]});_0x2e66d5['messages']=[];if(_0x54189e){_0x2e66d5[_0xe020('0x51')]=_0x54189e[_0xe020('0x52')];_0x2e66d5[_0xe020('0x53')]=_0x54189e;}else{_0x2e66d5['lastMessageAt']=moment(0x0)[_0xe020('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x2e66d5[_0xe020('0x53')]={};}return _0x2e66d5;};}exports['getUsers']=function(_0x27a2dc,_0x293449,_0x36d11a){var _0x5b09e2=[];return db['User'][_0xe020('0x45')]({'where':{'role':[_0xe020('0x55'),_0xe020('0x56'),_0xe020('0x57')]},'attributes':['id',_0xe020('0x58'),_0xe020('0x2c'),_0xe020('0x59'),'userpic',_0xe020('0x5a'),_0xe020('0x5b'),_0xe020('0x5c'),_0xe020('0x5d'),_0xe020('0x5e')],'order':qs[_0xe020('0x3f')](_0xe020('0x5f')),'include':[{'model':db['VoiceQueue'],'as':_0xe020('0x60'),'attributes':['id',_0xe020('0x2c'),_0xe020('0x33')],'through':{'attributes':[]}}]})['then'](function(_0x465c1d){if(_0x465c1d){var _0x9a4393=_0x27a2dc[_0xe020('0x57')][_0xe020('0x50')]({'plain':!![]});if(!_0x9a4393)throw new Error(_0xe020('0x61'));if(_0x9a4393[_0xe020('0x59')]==='user'){return db[_0xe020('0x62')][_0xe020('0x4c')]({'where':{'name':_0xe020('0x63'),'userProfileId':_0x9a4393[_0xe020('0x64')]},'raw':!![]})[_0xe020('0x2a')](function(_0x5e3e20){if(_0x5e3e20){if(_0x5e3e20[_0xe020('0x65')]===0x0){return db[_0xe020('0x66')]['findAll']({'where':{'sectionId':_0x5e3e20['id']},'raw':!![]})[_0xe020('0x2a')](function(_0x56d0a9){var _0x4a2661=[];if(_[_0xe020('0x67')](_0x56d0a9)){_0x4a2661=_['filter'](_0x465c1d,function(_0x171371){if(_0x171371[_0xe020('0x59')]!==_0xe020('0x55')){return _0x171371;}});return _0x4a2661;}else{for(var _0x1da26f=0x0;_0x1da26f<_0x465c1d[_0xe020('0x3a')];_0x1da26f++){var _0x4167a9=_0x465c1d[_0x1da26f];if(_0x4167a9[_0xe020('0x59')]==='agent'){var _0x374767=_['find'](_0x56d0a9,function(_0x302fc0){return _0x302fc0[_0xe020('0x68')]===_0x4167a9['id'];});if(_0x374767)_0x4a2661[_0xe020('0x69')](_0x4167a9);}else{_0x4a2661[_0xe020('0x69')](_0x4167a9);}}return _0x4a2661;}});}else{return _0x465c1d;}}else{var _0x2716fe=_['filter'](_0x465c1d,function(_0x46e409){if(_0x46e409['role']!==_0xe020('0x55')){return _0x46e409;}});return _0x2716fe;}});}else{return _0x465c1d;}}})['then'](function(_0x35d1ea){var _0x77fba1=[];if(_0x35d1ea){_0x5b09e2=_0x35d1ea;for(var _0x17fcee=0x0;_0x17fcee<_0x35d1ea[_0xe020('0x3a')];_0x17fcee+=0x1){_0x5b09e2[_0x17fcee][_0xe020('0x6a')]=[];_0x77fba1[_0xe020('0x69')](db[_0xe020('0x30')][_0xe020('0x4c')]({'where':{'FromId':[_0x27a2dc[_0xe020('0x57')]['id'],_0x35d1ea[_0x17fcee]['id']],'ToId':[_0x27a2dc['user']['id'],_0x35d1ea[_0x17fcee]['id']],'ChatGroupId':null},'attributes':['id',_0xe020('0x52'),_0xe020('0x6b'),_0xe020('0x6c'),_0xe020('0x6d'),_0xe020('0x4e')],'order':qs[_0xe020('0x3f')](_0xe020('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xe020('0x2a')](wrapUser(_0x35d1ea[_0x17fcee])));}return BPromise[_0xe020('0x6f')](_0x77fba1);}return[];})[_0xe020('0x2a')](function(_0x1cec02){return{'rows':_0x1cec02,'count':_0x1cec02[_0xe020('0x3a')]};})[_0xe020('0x2a')](respondWithResult(_0x293449,null))['catch'](handleError(_0x293449,null));}; \ No newline at end of file +var _0x9eda=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','register','sendStatus','status','json','count','offset','limit','set','reject','save','update','destroy','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','options','includeAll','include','findAll','rows','then','params','merge','catch','create','body','find','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','agent','admin','user','fullname','userpic','internal','lastLoginAt','allowmessenger','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','isEmpty','resourceId','push','messages','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir'];(function(_0x1717e5,_0x46d752){var _0x2b8c47=function(_0x25578c){while(--_0x25578c){_0x1717e5['push'](_0x1717e5['shift']());}};_0x2b8c47(++_0x46d752);}(_0x9eda,0x1a9));var _0xa9ed=function(_0x40ed6c,_0x3a6e71){_0x40ed6c=_0x40ed6c-0x0;var _0x478f3c=_0x9eda[_0x40ed6c];return _0x478f3c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa9ed('0x0'));var rimraf=require(_0xa9ed('0x1'));var zipdir=require(_0xa9ed('0x2'));var jsonpatch=require(_0xa9ed('0x3'));var rp=require(_0xa9ed('0x4'));var moment=require(_0xa9ed('0x5'));var BPromise=require(_0xa9ed('0x6'));var Mustache=require(_0xa9ed('0x7'));var util=require('util');var path=require(_0xa9ed('0x8'));var sox=require(_0xa9ed('0x9'));var csv=require(_0xa9ed('0xa'));var ejs=require(_0xa9ed('0xb'));var fs=require('fs');var _=require(_0xa9ed('0xc'));var squel=require(_0xa9ed('0xd'));var crypto=require(_0xa9ed('0xe'));var jsforce=require(_0xa9ed('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa9ed('0xa'));var querystring=require(_0xa9ed('0x10'));var Papa=require(_0xa9ed('0x11'));var Redis=require(_0xa9ed('0x12'));var authService=require(_0xa9ed('0x13'));var qs=require(_0xa9ed('0x14'));var as=require(_0xa9ed('0x15'));var hardwareService=require(_0xa9ed('0x16'));var logger=require(_0xa9ed('0x17'))(_0xa9ed('0x18'));var utils=require(_0xa9ed('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xa9ed('0x1a')]=_[_0xa9ed('0x1b')](config[_0xa9ed('0x1a')],{'host':_0xa9ed('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xa9ed('0x1d')](socket);function respondWithStatusCode(_0x128df1,_0x54fdf9){_0x54fdf9=_0x54fdf9||0xcc;return function(_0x4dd6d1){if(_0x4dd6d1){return _0x128df1[_0xa9ed('0x1e')](_0x54fdf9);}return _0x128df1[_0xa9ed('0x1f')](_0x54fdf9)['end']();};}function respondWithResult(_0x8eda4,_0x22e333){_0x22e333=_0x22e333||0xc8;return function(_0x469524){if(_0x469524){return _0x8eda4[_0xa9ed('0x1f')](_0x22e333)[_0xa9ed('0x20')](_0x469524);}};}function respondWithFilteredResult(_0x245df7,_0xf6bfa7){return function(_0x10723b){if(_0x10723b){var _0x46589f=_0x10723b[_0xa9ed('0x21')],_0x3c5b96=_0xf6bfa7[_0xa9ed('0x22')],_0x42f4e6=_0xf6bfa7['offset']+_0xf6bfa7[_0xa9ed('0x23')],_0x5e3a5f;if(_0x42f4e6>=_0x46589f){_0x42f4e6=_0x46589f;_0x5e3a5f=0xc8;}else{_0x5e3a5f=0xce;}_0x245df7[_0xa9ed('0x1f')](_0x5e3a5f);return _0x245df7[_0xa9ed('0x24')]('Content-Range',_0x3c5b96+'-'+_0x42f4e6+'/'+_0x46589f)[_0xa9ed('0x20')](_0x10723b);}return null;};}function patchUpdates(_0x361dbe){return function(_0x426148){try{jsonpatch['apply'](_0x426148,_0x361dbe,!![]);}catch(_0x5f4bd9){return BPromise[_0xa9ed('0x25')](_0x5f4bd9);}return _0x426148[_0xa9ed('0x26')]();};}function saveUpdates(_0xce29fd,_0x1cdef5){return function(_0x18d6d4){if(_0x18d6d4){return _0x18d6d4[_0xa9ed('0x27')](_0xce29fd)['then'](function(_0x5dd955){return _0x5dd955;});}return null;};}function removeEntity(_0x156311,_0x32f8bd){return function(_0x8c9bc){if(_0x8c9bc){return _0x8c9bc[_0xa9ed('0x28')]()['then'](function(){_0x156311['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2db4d0,_0x17f4c3){return function(_0x58b708){if(!_0x58b708){_0x2db4d0[_0xa9ed('0x1e')](0x194);}return _0x58b708;};}function handleError(_0x453df4,_0x1bd159){_0x1bd159=_0x1bd159||0x1f4;return function(_0x38e77c){logger['error'](_0x38e77c[_0xa9ed('0x29')]);if(_0x38e77c['name']){delete _0x38e77c[_0xa9ed('0x2a')];}_0x453df4[_0xa9ed('0x1f')](_0x1bd159)[_0xa9ed('0x2b')](_0x38e77c);};}exports[_0xa9ed('0x2c')]=function(_0x45ee40,_0x1b818f){var _0x406faa={},_0x2d189f={},_0x4cdf2d={'count':0x0,'rows':[]};var _0x573c29=_['map'](db[_0xa9ed('0x2d')][_0xa9ed('0x2e')],function(_0x4efb3b){return{'name':_0x4efb3b[_0xa9ed('0x2f')],'type':_0x4efb3b[_0xa9ed('0x30')]['key']};});_0x2d189f[_0xa9ed('0x31')]=_['map'](_0x573c29,_0xa9ed('0x2a'));_0x2d189f[_0xa9ed('0x32')]=_[_0xa9ed('0x33')](_0x45ee40['query']);_0x2d189f[_0xa9ed('0x34')]=_[_0xa9ed('0x35')](_0x2d189f[_0xa9ed('0x31')],_0x2d189f[_0xa9ed('0x32')]);_0x406faa[_0xa9ed('0x36')]=_[_0xa9ed('0x35')](_0x2d189f[_0xa9ed('0x31')],qs[_0xa9ed('0x37')](_0x45ee40[_0xa9ed('0x32')][_0xa9ed('0x37')]));_0x406faa[_0xa9ed('0x36')]=_0x406faa[_0xa9ed('0x36')][_0xa9ed('0x38')]?_0x406faa[_0xa9ed('0x36')]:_0x2d189f['model'];if(!_0x45ee40[_0xa9ed('0x32')][_0xa9ed('0x39')](_0xa9ed('0x3a'))){_0x406faa[_0xa9ed('0x23')]=qs[_0xa9ed('0x23')](_0x45ee40[_0xa9ed('0x32')][_0xa9ed('0x23')]);_0x406faa[_0xa9ed('0x22')]=qs['offset'](_0x45ee40[_0xa9ed('0x32')][_0xa9ed('0x22')]);}_0x406faa['order']=qs[_0xa9ed('0x3b')](_0x45ee40[_0xa9ed('0x32')][_0xa9ed('0x3b')]);_0x406faa[_0xa9ed('0x3c')]=qs[_0xa9ed('0x34')](_[_0xa9ed('0x3d')](_0x45ee40['query'],_0x2d189f['filters']),_0x573c29);if(_0x45ee40[_0xa9ed('0x32')][_0xa9ed('0x3e')]){_0x406faa[_0xa9ed('0x3c')]=_['merge'](_0x406faa[_0xa9ed('0x3c')],{'$or':_[_0xa9ed('0x3f')](_0x573c29,function(_0x2cbf6d){if(_0x2cbf6d[_0xa9ed('0x30')]!=='VIRTUAL'){var _0x5a371f={};_0x5a371f[_0x2cbf6d['name']]={'$like':'%'+_0x45ee40[_0xa9ed('0x32')][_0xa9ed('0x3e')]+'%'};return _0x5a371f;}})});}_0x406faa=_['merge']({},_0x406faa,_0x45ee40[_0xa9ed('0x40')]);var _0x230297={'where':_0x406faa[_0xa9ed('0x3c')]};return db[_0xa9ed('0x2d')]['count'](_0x230297)['then'](function(_0x2ddbdd){_0x4cdf2d[_0xa9ed('0x21')]=_0x2ddbdd;if(_0x45ee40[_0xa9ed('0x32')][_0xa9ed('0x41')]){_0x406faa[_0xa9ed('0x42')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xa9ed('0x43')](_0x406faa);})['then'](function(_0x8155bd){_0x4cdf2d[_0xa9ed('0x44')]=_0x8155bd;return _0x4cdf2d;})[_0xa9ed('0x45')](respondWithFilteredResult(_0x1b818f,_0x406faa))['catch'](handleError(_0x1b818f,null));};exports['show']=function(_0x25eaa6,_0x96b69c){var _0x1823b8={'raw':!![],'where':{'id':_0x25eaa6[_0xa9ed('0x46')]['id']}},_0x592eac={};_0x592eac['model']=_[_0xa9ed('0x33')](db[_0xa9ed('0x2d')]['rawAttributes']);_0x592eac['query']=_[_0xa9ed('0x33')](_0x25eaa6[_0xa9ed('0x32')]);_0x592eac[_0xa9ed('0x34')]=_['intersection'](_0x592eac[_0xa9ed('0x31')],_0x592eac[_0xa9ed('0x32')]);_0x1823b8['attributes']=_[_0xa9ed('0x35')](_0x592eac[_0xa9ed('0x31')],qs['fields'](_0x25eaa6[_0xa9ed('0x32')][_0xa9ed('0x37')]));_0x1823b8[_0xa9ed('0x36')]=_0x1823b8[_0xa9ed('0x36')][_0xa9ed('0x38')]?_0x1823b8['attributes']:_0x592eac[_0xa9ed('0x31')];if(_0x25eaa6['query'][_0xa9ed('0x41')]){_0x1823b8['include']=[{'all':!![]}];}_0x1823b8=_[_0xa9ed('0x47')]({},_0x1823b8,_0x25eaa6['options']);return db['ChatInternalMessage']['find'](_0x1823b8)[_0xa9ed('0x45')](handleEntityNotFound(_0x96b69c,null))[_0xa9ed('0x45')](respondWithResult(_0x96b69c,null))[_0xa9ed('0x48')](handleError(_0x96b69c,null));};exports['create']=function(_0x2f3942,_0x819e99){return db['ChatInternalMessage'][_0xa9ed('0x49')](_0x2f3942['body'],{})[_0xa9ed('0x45')](respondWithResult(_0x819e99,0xc9))[_0xa9ed('0x48')](handleError(_0x819e99,null));};exports['update']=function(_0x278de8,_0x56237b){if(_0x278de8[_0xa9ed('0x4a')]['id']){delete _0x278de8['body']['id'];}return db['ChatInternalMessage'][_0xa9ed('0x4b')]({'where':{'id':_0x278de8[_0xa9ed('0x46')]['id']}})[_0xa9ed('0x45')](handleEntityNotFound(_0x56237b,null))['then'](saveUpdates(_0x278de8['body'],null))[_0xa9ed('0x45')](respondWithResult(_0x56237b,null))['catch'](handleError(_0x56237b,null));};exports[_0xa9ed('0x28')]=function(_0x5053be,_0x27c65a){return db['ChatInternalMessage'][_0xa9ed('0x4b')]({'where':{'id':_0x5053be['params']['id']}})[_0xa9ed('0x45')](handleEntityNotFound(_0x27c65a,null))['then'](removeEntity(_0x27c65a,null))['catch'](handleError(_0x27c65a,null));};exports[_0xa9ed('0x4c')]=function(_0x1672f1,_0x403eef){return db[_0xa9ed('0x2d')]['describe']()[_0xa9ed('0x45')](respondWithResult(_0x403eef,null))[_0xa9ed('0x48')](handleError(_0x403eef,null));};function wrapUser(_0x328754){return function(_0x4515a5){var _0x8851a6=_0x328754[_0xa9ed('0x4d')]({'plain':!![]});_0x8851a6['messages']=[];if(_0x4515a5){_0x8851a6[_0xa9ed('0x4e')]=_0x4515a5[_0xa9ed('0x4f')];_0x8851a6[_0xa9ed('0x50')]=_0x4515a5;}else{_0x8851a6[_0xa9ed('0x4e')]=moment(0x0)[_0xa9ed('0x51')](_0xa9ed('0x52'));_0x8851a6[_0xa9ed('0x50')]={};}return _0x8851a6;};}exports['getUsers']=function(_0x1d3a3b,_0x26181d,_0x4cf64a){var _0x3f9ae1=[];return db['User'][_0xa9ed('0x43')]({'where':{'role':[_0xa9ed('0x53'),_0xa9ed('0x54'),_0xa9ed('0x55')]},'attributes':['id',_0xa9ed('0x56'),'name','role',_0xa9ed('0x57'),_0xa9ed('0x58'),'online',_0xa9ed('0x59'),_0xa9ed('0x5a'),'showWebBar'],'order':qs['sort']('-online'),'include':[{'model':db[_0xa9ed('0x5b')],'as':_0xa9ed('0x5c'),'attributes':['id',_0xa9ed('0x2a'),_0xa9ed('0x30')],'through':{'attributes':[]}}]})[_0xa9ed('0x45')](function(_0x4a597c){if(_0x4a597c){var _0x4316d2=_0x1d3a3b[_0xa9ed('0x55')]['get']({'plain':!![]});if(!_0x4316d2)throw new Error(_0xa9ed('0x5d'));if(_0x4316d2[_0xa9ed('0x5e')]===_0xa9ed('0x55')){return db[_0xa9ed('0x5f')][_0xa9ed('0x4b')]({'where':{'name':_0xa9ed('0x60'),'userProfileId':_0x4316d2[_0xa9ed('0x61')]},'raw':!![]})[_0xa9ed('0x45')](function(_0x60f1b2){if(_0x60f1b2){if(_0x60f1b2['autoAssociation']===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x60f1b2['id']},'raw':!![]})[_0xa9ed('0x45')](function(_0x3d9d80){var _0x1d04cc=[];if(_[_0xa9ed('0x62')](_0x3d9d80)){_0x1d04cc=_[_0xa9ed('0x3e')](_0x4a597c,function(_0x24f7ec){if(_0x24f7ec['role']!==_0xa9ed('0x53')){return _0x24f7ec;}});return _0x1d04cc;}else{for(var _0x375a71=0x0;_0x375a71<_0x4a597c['length'];_0x375a71++){var _0x8f4e75=_0x4a597c[_0x375a71];if(_0x8f4e75[_0xa9ed('0x5e')]===_0xa9ed('0x53')){var _0x5a8a91=_[_0xa9ed('0x4b')](_0x3d9d80,function(_0x45c286){return _0x45c286[_0xa9ed('0x63')]===_0x8f4e75['id'];});if(_0x5a8a91)_0x1d04cc[_0xa9ed('0x64')](_0x8f4e75);}else{_0x1d04cc[_0xa9ed('0x64')](_0x8f4e75);}}return _0x1d04cc;}});}else{return _0x4a597c;}}else{var _0xef52a=_[_0xa9ed('0x3e')](_0x4a597c,function(_0x544380){if(_0x544380[_0xa9ed('0x5e')]!=='agent'){return _0x544380;}});return _0xef52a;}});}else{return _0x4a597c;}}})['then'](function(_0x3ea82d){var _0x284ce6=[];if(_0x3ea82d){_0x3f9ae1=_0x3ea82d;for(var _0x22e021=0x0;_0x22e021<_0x3ea82d['length'];_0x22e021+=0x1){_0x3f9ae1[_0x22e021][_0xa9ed('0x65')]=[];_0x284ce6['push'](db[_0xa9ed('0x2d')]['find']({'where':{'FromId':[_0x1d3a3b[_0xa9ed('0x55')]['id'],_0x3ea82d[_0x22e021]['id']],'ToId':[_0x1d3a3b[_0xa9ed('0x55')]['id'],_0x3ea82d[_0x22e021]['id']],'ChatGroupId':null},'attributes':['id',_0xa9ed('0x4f'),_0xa9ed('0x66'),_0xa9ed('0x67'),_0xa9ed('0x68'),'body'],'order':qs[_0xa9ed('0x3b')](_0xa9ed('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa9ed('0x45')](wrapUser(_0x3ea82d[_0x22e021])));}return BPromise[_0xa9ed('0x6a')](_0x284ce6);}return[];})[_0xa9ed('0x45')](function(_0x45e85d){return{'rows':_0x45e85d,'count':_0x45e85d[_0xa9ed('0x38')]};})[_0xa9ed('0x45')](respondWithResult(_0x26181d,null))[_0xa9ed('0x48')](handleError(_0x26181d,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 21380a5..937f517 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 _0x4e00=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x353ad3,_0x360312){var _0xf1f727=function(_0x577513){while(--_0x577513){_0x353ad3['push'](_0x353ad3['shift']());}};_0xf1f727(++_0x360312);}(_0x4e00,0xa0));var _0x04e0=function(_0x33f126,_0x39bdb2){_0x33f126=_0x33f126-0x0;var _0x36daaa=_0x4e00[_0x33f126];return _0x36daaa;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x04e0('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x04e0('0x1')](0x0);var events={'afterCreate':_0x04e0('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x299dd9){return function(_0x55d507,_0x129c93,_0x470197){ChatInternalMessageEvents[_0x04e0('0x3')](_0x299dd9+':'+_0x55d507['id'],_0x55d507);ChatInternalMessageEvents[_0x04e0('0x3')](_0x299dd9,_0x55d507);_0x470197(null);};}for(var e in events){if(events[_0x04e0('0x4')](e)){var event=events[e];ChatInternalMessage[_0x04e0('0x5')](e,emitEvent(event));}}module[_0x04e0('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x83d3=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit'];(function(_0x46b49a,_0x4ac736){var _0x4e8334=function(_0x430838){while(--_0x430838){_0x46b49a['push'](_0x46b49a['shift']());}};_0x4e8334(++_0x4ac736);}(_0x83d3,0x17c));var _0x383d=function(_0x3ea3ae,_0x29dd29){_0x3ea3ae=_0x3ea3ae-0x0;var _0x2aa587=_0x83d3[_0x3ea3ae];return _0x2aa587;};'use strict';var EventEmitter=require(_0x383d('0x0'));var ChatInternalMessage=require(_0x383d('0x1'))['db'][_0x383d('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x383d('0x3')](0x0);var events={'afterCreate':_0x383d('0x4'),'afterUpdate':'update','afterDestroy':_0x383d('0x5')};function emitEvent(_0x1184a6){return function(_0x31cbfc,_0x202ffc,_0x52adf4){ChatInternalMessageEvents[_0x383d('0x6')](_0x1184a6+':'+_0x31cbfc['id'],_0x31cbfc);ChatInternalMessageEvents['emit'](_0x1184a6,_0x31cbfc);_0x52adf4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x383d('0x7')](e,emitEvent(event));}}module[_0x383d('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index ecb82b4..47a6877 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 _0x220b=['define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4773ad,_0x39e449){var _0x23ba59=function(_0x1bded7){while(--_0x1bded7){_0x4773ad['push'](_0x4773ad['shift']());}};_0x23ba59(++_0x39e449);}(_0x220b,0x9f));var _0xb220=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0x220b[_0x3da832];return _0xe602f2;};'use strict';var _=require(_0xb220('0x0'));var util=require(_0xb220('0x1'));var logger=require('../../config/logger')(_0xb220('0x2'));var moment=require('moment');var BPromise=require(_0xb220('0x3'));var rp=require(_0xb220('0x4'));var fs=require('fs');var path=require(_0xb220('0x5'));var rimraf=require(_0xb220('0x6'));var config=require(_0xb220('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0xb220('0x8')]=function(_0x394e6e,_0x6d4529){return _0x394e6e[_0xb220('0x9')](_0xb220('0xa'),attributes,{'tableName':_0xb220('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb220('0xc'),'collate':_0xb220('0xd')});}; \ No newline at end of file +var _0xd971=['rimraf','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','lodash','util','../../config/logger','moment','bluebird'];(function(_0x725c29,_0x38993a){var _0x481211=function(_0x45dff3){while(--_0x45dff3){_0x725c29['push'](_0x725c29['shift']());}};_0x481211(++_0x38993a);}(_0xd971,0x1a2));var _0x1d97=function(_0x4d7379,_0x4b4e63){_0x4d7379=_0x4d7379-0x0;var _0x46d7cf=_0xd971[_0x4d7379];return _0x46d7cf;};'use strict';var _=require(_0x1d97('0x0'));var util=require(_0x1d97('0x1'));var logger=require(_0x1d97('0x2'))('api');var moment=require(_0x1d97('0x3'));var BPromise=require(_0x1d97('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1d97('0x5'));var config=require(_0x1d97('0x6'));var attributes=require(_0x1d97('0x7'));module['exports']=function(_0x4a2659,_0x1feadb){return _0x4a2659['define'](_0x1d97('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index d4e3c9f..bb3bec3 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 _0x19eb=['message','ChatInternalMessage,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','./chatInternalMessage.socket','register','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x334e49,_0x1fc322){var _0x24a0fb=function(_0x7e5292){while(--_0x7e5292){_0x334e49['push'](_0x334e49['shift']());}};_0x24a0fb(++_0x1fc322);}(_0x19eb,0x1e0));var _0xb19e=function(_0x52215e,_0x3644bd){_0x52215e=_0x52215e-0x0;var _0x5e787c=_0x19eb[_0x52215e];return _0x5e787c;};'use strict';var _=require(_0xb19e('0x0'));var util=require(_0xb19e('0x1'));var moment=require('moment');var BPromise=require(_0xb19e('0x2'));var rs=require(_0xb19e('0x3'));var fs=require('fs');var Redis=require(_0xb19e('0x4'));var db=require(_0xb19e('0x5'))['db'];var utils=require(_0xb19e('0x6'));var logger=require(_0xb19e('0x7'))(_0xb19e('0x8'));var config=require(_0xb19e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb19e('0xa')][_0xb19e('0xb')]({'port':0x232a});config[_0xb19e('0xc')]=_[_0xb19e('0xd')](config[_0xb19e('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb19e('0xc')]));require(_0xb19e('0xe'))[_0xb19e('0xf')](socket);function respondWithRpcPromise(_0x5d3cc5,_0x4788f6,_0x11a637){return new BPromise(function(_0x9ff617,_0x5b8b5a){return client[_0xb19e('0x10')](_0x5d3cc5,_0x11a637)[_0xb19e('0x11')](function(_0x669be8){logger[_0xb19e('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x4788f6,'request\x20sent');logger[_0xb19e('0x13')](_0xb19e('0x14'),_0x4788f6,_0xb19e('0x15'),JSON['stringify'](_0x669be8));if(_0x669be8[_0xb19e('0x16')]){if(_0x669be8[_0xb19e('0x16')][_0xb19e('0x17')]===0x1f4){logger[_0xb19e('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x4788f6,_0x669be8[_0xb19e('0x16')]['message']);return _0x5b8b5a(_0x669be8['error'][_0xb19e('0x18')]);}logger[_0xb19e('0x16')](_0xb19e('0x19'),_0x4788f6,_0x669be8[_0xb19e('0x16')][_0xb19e('0x18')]);return _0x9ff617(_0x669be8['error'][_0xb19e('0x18')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x4788f6,'request\x20sent');_0x9ff617(_0x669be8[_0xb19e('0x1a')][_0xb19e('0x18')]);}})[_0xb19e('0x1b')](function(_0x320742){logger[_0xb19e('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x4788f6,_0x320742);_0x5b8b5a(_0x320742);});});} \ No newline at end of file +var _0x44ff=['request','then','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x2103ba,_0x5095e8){var _0x445fdf=function(_0x5f0e6b){while(--_0x5f0e6b){_0x2103ba['push'](_0x2103ba['shift']());}};_0x445fdf(++_0x5095e8);}(_0x44ff,0xd9));var _0xf44f=function(_0x5953cb,_0x37147e){_0x5953cb=_0x5953cb-0x0;var _0x2e352e=_0x44ff[_0x5953cb];return _0x2e352e;};'use strict';var _=require(_0xf44f('0x0'));var util=require(_0xf44f('0x1'));var moment=require(_0xf44f('0x2'));var BPromise=require(_0xf44f('0x3'));var rs=require(_0xf44f('0x4'));var fs=require('fs');var Redis=require(_0xf44f('0x5'));var db=require(_0xf44f('0x6'))['db'];var utils=require(_0xf44f('0x7'));var logger=require(_0xf44f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf44f('0x9'));var client=jayson[_0xf44f('0xa')][_0xf44f('0xb')]({'port':0x232a});config['redis']=_[_0xf44f('0xc')](config[_0xf44f('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xf44f('0xe'))(new Redis(config[_0xf44f('0xd')]));require(_0xf44f('0xf'))[_0xf44f('0x10')](socket);function respondWithRpcPromise(_0x53f061,_0xd5a7f1,_0x25080c){return new BPromise(function(_0x36f299,_0x194573){return client[_0xf44f('0x11')](_0x53f061,_0x25080c)[_0xf44f('0x12')](function(_0x2137c4){logger['info'](_0xf44f('0x13'),_0xd5a7f1,_0xf44f('0x14'));logger['debug']('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xd5a7f1,_0xf44f('0x14'),JSON[_0xf44f('0x15')](_0x2137c4));if(_0x2137c4[_0xf44f('0x16')]){if(_0x2137c4['error'][_0xf44f('0x17')]===0x1f4){logger[_0xf44f('0x16')](_0xf44f('0x13'),_0xd5a7f1,_0x2137c4[_0xf44f('0x16')]['message']);return _0x194573(_0x2137c4[_0xf44f('0x16')][_0xf44f('0x18')]);}logger[_0xf44f('0x16')](_0xf44f('0x13'),_0xd5a7f1,_0x2137c4[_0xf44f('0x16')][_0xf44f('0x18')]);return _0x36f299(_0x2137c4['error'][_0xf44f('0x18')]);}else{logger[_0xf44f('0x19')](_0xf44f('0x13'),_0xd5a7f1,'request\x20sent');_0x36f299(_0x2137c4['result'][_0xf44f('0x18')]);}})['catch'](function(_0x57f5e0){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0xd5a7f1,_0x57f5e0);_0x194573(_0x57f5e0);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 04a6f83..83b34bf 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 _0xee24=['length','chatInternalMessage:','save','remove','emit','removeListener','register'];(function(_0xdf9167,_0x41b087){var _0x583729=function(_0x4bbf50){while(--_0x4bbf50){_0xdf9167['push'](_0xdf9167['shift']());}};_0x583729(++_0x41b087);}(_0xee24,0x1a6));var _0x4ee2=function(_0x2379bd,_0x98d1d3){_0x2379bd=_0x2379bd-0x0;var _0x51bbf1=_0xee24[_0x2379bd];return _0x51bbf1;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x4ee2('0x0'),_0x4ee2('0x1'),'update'];function createListener(_0x234b61,_0x4e09d3){return function(_0x3ff71c){_0x4e09d3[_0x4ee2('0x2')](_0x234b61,_0x3ff71c);};}function removeListener(_0x5546e1,_0x1aee89){return function(){ChatInternalMessageEvents[_0x4ee2('0x3')](_0x5546e1,_0x1aee89);};}exports[_0x4ee2('0x4')]=function(_0x1993de){for(var _0x5c778f=0x0,_0x2e6e11=events[_0x4ee2('0x5')];_0x5c778f<_0x2e6e11;_0x5c778f++){var _0xe966eb=events[_0x5c778f];var _0x9a963c=createListener(_0x4ee2('0x6')+_0xe966eb,_0x1993de);ChatInternalMessageEvents['on'](_0xe966eb,_0x9a963c);}}; \ No newline at end of file +var _0x4de7=['chatInternalMessage:','./chatInternalMessage.events','remove','update','removeListener','length'];(function(_0x410d6e,_0x1f301a){var _0x3fbdc7=function(_0x458c7a){while(--_0x458c7a){_0x410d6e['push'](_0x410d6e['shift']());}};_0x3fbdc7(++_0x1f301a);}(_0x4de7,0x1f3));var _0x74de=function(_0x75f6d3,_0x1337f4){_0x75f6d3=_0x75f6d3-0x0;var _0x3b4a97=_0x4de7[_0x75f6d3];return _0x3b4a97;};'use strict';var ChatInternalMessageEvents=require(_0x74de('0x0'));var events=['save',_0x74de('0x1'),_0x74de('0x2')];function createListener(_0x58178c,_0x4049b1){return function(_0x35b390){_0x4049b1['emit'](_0x58178c,_0x35b390);};}function removeListener(_0x394878,_0x5de5cf){return function(){ChatInternalMessageEvents[_0x74de('0x3')](_0x394878,_0x5de5cf);};}exports['register']=function(_0x1f418e){for(var _0xba55c8=0x0,_0x2133a6=events[_0x74de('0x4')];_0xba55c8<_0x2133a6;_0xba55c8++){var _0x370dcf=events[_0xba55c8];var _0x285159=createListener(_0x74de('0x5')+_0x370dcf,_0x1f418e);ChatInternalMessageEvents['on'](_0x370dcf,_0x285159);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 3ae2353..4e2029b 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 _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x14e6f9,_0x504851){var _0x402caf=function(_0x41d390){while(--_0x41d390){_0x14e6f9['push'](_0x14e6f9['shift']());}};_0x402caf(++_0x504851);}(_0xe706,0xa3));var _0x6e70=function(_0x45cb89,_0x99520e){_0x45cb89=_0x45cb89-0x0;var _0x5948c1=_0xe706[_0x45cb89];return _0x5948c1;};'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 auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x9')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x12')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['put']('/:id',controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0x10'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);module[_0x6e70('0x17')]=router; \ No newline at end of file +var _0x70e0=['exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','describe','/users','isAuthenticated','getUsers','/:id','post','create','put','update','delete','destroy'];(function(_0x4a41ad,_0x2e6e57){var _0xab1724=function(_0x155448){while(--_0x155448){_0x4a41ad['push'](_0x4a41ad['shift']());}};_0xab1724(++_0x2e6e57);}(_0x70e0,0x17b));var _0x070e=function(_0xf771fe,_0x1d1fa8){_0xf771fe=_0xf771fe-0x0;var _0x27eecc=_0x70e0[_0xf771fe];return _0x27eecc;};'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 auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0x7')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0x7')](_0x070e('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x070e('0xe')]('/',auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);router[_0x070e('0x10')](_0x070e('0xd'),controller[_0x070e('0x11')]);router[_0x070e('0x12')](_0x070e('0xd'),auth[_0x070e('0xb')](),controller[_0x070e('0x13')]);module[_0x070e('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 37c1cd4..fc8fb05 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 _0x1e01=['exports','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x1e01,0x195));var _0x11e0=function(_0x486911,_0x4485af){_0x486911=_0x486911-0x0;var _0x4c8afd=_0x1e01[_0x486911];return _0x4c8afd;};'use strict';var Sequelize=require(_0x11e0('0x0'));module[_0x11e0('0x1')]={'body':{'type':Sequelize['TEXT'](_0x11e0('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x11e0('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x11e0('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x11e0('0x4')]('in',_0x11e0('0x5')),'defaultValue':_0x11e0('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x11e0('0x6')]}}; \ No newline at end of file +var _0x986e=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x12ee77,_0x34ee91){var _0x3e820f=function(_0x3e6fad){while(--_0x3e6fad){_0x12ee77['push'](_0x12ee77['shift']());}};_0x3e820f(++_0x34ee91);}(_0x986e,0xf6));var _0xe986=function(_0x3cdab3,_0xead947){_0x3cdab3=_0x3cdab3-0x0;var _0x2ba248=_0x986e[_0x3cdab3];return _0x2ba248;};'use strict';var Sequelize=require(_0xe986('0x0'));module[_0xe986('0x1')]={'body':{'type':Sequelize[_0xe986('0x2')](_0xe986('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe986('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xe986('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe986('0x5')]('in',_0xe986('0x6')),'defaultValue':_0xe986('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xe986('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index e82885c..ce13c62 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 _0xcb9d=['merge','filter','options','include','ChatMessage','findAll','rows','catch','params','includeAll','find','create','body','describe','chat-interactions','accept','chat','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','ChatInteractionId','isNil','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','manual','format','SIP/%s','channel','event','EventManager','acceptmessage','formData','agent','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','interface','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x90b861,_0x42540f){var _0x104ff9=function(_0x28549a){while(--_0x28549a){_0x90b861['push'](_0x90b861['shift']());}};_0x104ff9(++_0x42540f);}(_0xcb9d,0x1a2));var _0xdcb9=function(_0x117798,_0x1c9a8c){_0x117798=_0x117798-0x0;var _0x489679=_0xcb9d[_0x117798];return _0x489679;};'use strict';var pdf=require(_0xdcb9('0x0'));var emlformat=require(_0xdcb9('0x1'));var rimraf=require(_0xdcb9('0x2'));var zipdir=require(_0xdcb9('0x3'));var jsonpatch=require(_0xdcb9('0x4'));var rp=require(_0xdcb9('0x5'));var moment=require(_0xdcb9('0x6'));var BPromise=require(_0xdcb9('0x7'));var Mustache=require(_0xdcb9('0x8'));var util=require(_0xdcb9('0x9'));var path=require('path');var sox=require(_0xdcb9('0xa'));var csv=require(_0xdcb9('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdcb9('0xc'));var squel=require(_0xdcb9('0xd'));var crypto=require(_0xdcb9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdcb9('0xf'));var Redis=require(_0xdcb9('0x10'));var authService=require(_0xdcb9('0x11'));var qs=require(_0xdcb9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdcb9('0x13'));var logger=require(_0xdcb9('0x14'))(_0xdcb9('0x15'));var utils=require(_0xdcb9('0x16'));var config=require(_0xdcb9('0x17'));var db=require(_0xdcb9('0x18'))['db'];config['redis']=_[_0xdcb9('0x19')](config[_0xdcb9('0x1a')],{'host':_0xdcb9('0x1b'),'port':0x18eb});var socket=require(_0xdcb9('0x1c'))(new Redis(config[_0xdcb9('0x1a')]));require('./chatMessage.socket')[_0xdcb9('0x1d')](socket);var jayson=require(_0xdcb9('0x1e'));var client=jayson[_0xdcb9('0x1f')][_0xdcb9('0x20')]({'port':0x232c});var client9002=jayson[_0xdcb9('0x1f')][_0xdcb9('0x20')]({'port':0x232a});function checkPasswordPattern(_0xe37e1a,_0x48e19d,_0x3489a2){if(_0x3489a2){var _0x5405af=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5405af[_0xdcb9('0x21')](_0x48e19d)){return _0xe37e1a;}else{throw new db[(_0xdcb9('0x22'))][(_0xdcb9('0x23'))](_0xdcb9('0x24'));}}else{return _0xe37e1a;}}function respondWithRpcPromise(_0x413b4b,_0x35b27b,_0x484ca6,_0x4129ba){return new BPromise(function(_0x457b34,_0x5e8d07){var _0x446a57=_0x4129ba||client;return _0x446a57[_0xdcb9('0x25')](_0x413b4b,_0x484ca6)['then'](function(_0x1e9600){logger['info'](_0xdcb9('0x26'),_0x35b27b,_0xdcb9('0x27'));logger['debug'](_0xdcb9('0x28'),_0x35b27b,'request\x20sent',JSON[_0xdcb9('0x29')](_0x1e9600));if(_0x1e9600[_0xdcb9('0x2a')]){if(_0x1e9600['error'][_0xdcb9('0x2b')]===0x1f4){logger[_0xdcb9('0x2a')](_0xdcb9('0x26'),_0x35b27b,_0x1e9600['error'][_0xdcb9('0x2c')]);return _0x5e8d07(_0x1e9600[_0xdcb9('0x2a')][_0xdcb9('0x2c')]);}logger[_0xdcb9('0x2a')](_0xdcb9('0x26'),_0x35b27b,_0x1e9600[_0xdcb9('0x2a')][_0xdcb9('0x2c')]);return _0x457b34(_0x1e9600[_0xdcb9('0x2a')][_0xdcb9('0x2c')]);}else{logger[_0xdcb9('0x2d')]('ChatMessage,\x20%s,\x20%s',_0x35b27b,_0xdcb9('0x27'));_0x457b34(_0x1e9600[_0xdcb9('0x2e')][_0xdcb9('0x2c')]);}})['catch'](function(_0x578c83){logger[_0xdcb9('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x35b27b,_0x578c83);_0x5e8d07(_0x578c83);});});}function respondWithStatusCode(_0x314a4b,_0x1dea31){_0x1dea31=_0x1dea31||0xcc;return function(_0x3e378d){if(_0x3e378d){return _0x314a4b[_0xdcb9('0x2f')](_0x1dea31);}return _0x314a4b['status'](_0x1dea31)[_0xdcb9('0x30')]();};}function respondWithResult(_0x37aa27,_0x2f726f){_0x2f726f=_0x2f726f||0xc8;return function(_0x43cd70){if(_0x43cd70){return _0x37aa27[_0xdcb9('0x31')](_0x2f726f)[_0xdcb9('0x32')](_0x43cd70);}};}function respondWithFilteredResult(_0x292e39,_0x194b11){return function(_0x2950a0){if(_0x2950a0){var _0xcd031c=_0x2950a0[_0xdcb9('0x33')],_0x4a9dd7=_0x194b11[_0xdcb9('0x34')],_0x2e1825=_0x194b11[_0xdcb9('0x34')]+_0x194b11[_0xdcb9('0x35')],_0x543bd1;if(_0x2e1825>=_0xcd031c){_0x2e1825=_0xcd031c;_0x543bd1=0xc8;}else{_0x543bd1=0xce;}_0x292e39['status'](_0x543bd1);return _0x292e39[_0xdcb9('0x36')](_0xdcb9('0x37'),_0x4a9dd7+'-'+_0x2e1825+'/'+_0xcd031c)[_0xdcb9('0x32')](_0x2950a0);}return null;};}function patchUpdates(_0x431883){return function(_0x3c807b){try{jsonpatch[_0xdcb9('0x38')](_0x3c807b,_0x431883,!![]);}catch(_0x23f5f5){return BPromise[_0xdcb9('0x39')](_0x23f5f5);}return _0x3c807b[_0xdcb9('0x3a')]();};}function saveUpdates(_0x2d7278,_0x36447e){return function(_0x13bf95){if(_0x13bf95){return _0x13bf95[_0xdcb9('0x3b')](_0x2d7278)[_0xdcb9('0x3c')](function(_0x552814){return _0x552814;});}return null;};}function removeEntity(_0x3adfe9,_0x1091dd){return function(_0x3b840a){if(_0x3b840a){return _0x3b840a[_0xdcb9('0x3d')]()[_0xdcb9('0x3c')](function(){_0x3adfe9[_0xdcb9('0x31')](0xcc)[_0xdcb9('0x30')]();});}};}function handleEntityNotFound(_0x5b0704,_0x451252){return function(_0x407504){if(!_0x407504){_0x5b0704['sendStatus'](0x194);}return _0x407504;};}function handleError(_0x30ab14,_0x367132){_0x367132=_0x367132||0x1f4;return function(_0x28f686){logger[_0xdcb9('0x2a')](_0x28f686[_0xdcb9('0x3e')]);if(_0x28f686[_0xdcb9('0x3f')]){delete _0x28f686[_0xdcb9('0x3f')];}_0x30ab14[_0xdcb9('0x31')](_0x367132)['send'](_0x28f686);};}exports[_0xdcb9('0x40')]=function(_0x51b780,_0x5ce7e0){var _0x142b40={},_0x4364ab={},_0x560087={'count':0x0,'rows':[]};var _0x632e03=_[_0xdcb9('0x41')](db['ChatMessage'][_0xdcb9('0x42')],function(_0x2d7829){return{'name':_0x2d7829[_0xdcb9('0x43')],'type':_0x2d7829['type'][_0xdcb9('0x44')]};});_0x4364ab[_0xdcb9('0x45')]=_[_0xdcb9('0x41')](_0x632e03,'name');_0x4364ab[_0xdcb9('0x46')]=_[_0xdcb9('0x47')](_0x51b780['query']);_0x4364ab[_0xdcb9('0x48')]=_['intersection'](_0x4364ab['model'],_0x4364ab[_0xdcb9('0x46')]);_0x142b40[_0xdcb9('0x49')]=_[_0xdcb9('0x4a')](_0x4364ab[_0xdcb9('0x45')],qs['fields'](_0x51b780['query'][_0xdcb9('0x4b')]));_0x142b40[_0xdcb9('0x49')]=_0x142b40[_0xdcb9('0x49')][_0xdcb9('0x4c')]?_0x142b40['attributes']:_0x4364ab['model'];if(!_0x51b780[_0xdcb9('0x46')][_0xdcb9('0x4d')](_0xdcb9('0x4e'))){_0x142b40[_0xdcb9('0x35')]=qs[_0xdcb9('0x35')](_0x51b780[_0xdcb9('0x46')][_0xdcb9('0x35')]);_0x142b40[_0xdcb9('0x34')]=qs[_0xdcb9('0x34')](_0x51b780[_0xdcb9('0x46')][_0xdcb9('0x34')]);}_0x142b40[_0xdcb9('0x4f')]=qs[_0xdcb9('0x50')](_0x51b780[_0xdcb9('0x46')]['sort']);_0x142b40[_0xdcb9('0x51')]=qs['filters'](_['pick'](_0x51b780[_0xdcb9('0x46')],_0x4364ab[_0xdcb9('0x48')]),_0x632e03);if(_0x51b780[_0xdcb9('0x46')]['filter']){_0x142b40[_0xdcb9('0x51')]=_[_0xdcb9('0x52')](_0x142b40[_0xdcb9('0x51')],{'$or':_[_0xdcb9('0x41')](_0x632e03,function(_0x562eb6){if(_0x562eb6['type']!=='VIRTUAL'){var _0xe6805a={};_0xe6805a[_0x562eb6[_0xdcb9('0x3f')]]={'$like':'%'+_0x51b780[_0xdcb9('0x46')][_0xdcb9('0x53')]+'%'};return _0xe6805a;}})});}_0x142b40=_['merge']({},_0x142b40,_0x51b780[_0xdcb9('0x54')]);var _0x3f5795={'where':_0x142b40['where']};return db['ChatMessage'][_0xdcb9('0x33')](_0x3f5795)[_0xdcb9('0x3c')](function(_0x190c26){_0x560087['count']=_0x190c26;if(_0x51b780[_0xdcb9('0x46')]['includeAll']){_0x142b40[_0xdcb9('0x55')]=[{'all':!![]}];}return db[_0xdcb9('0x56')][_0xdcb9('0x57')](_0x142b40);})['then'](function(_0x3ecbcd){_0x560087[_0xdcb9('0x58')]=_0x3ecbcd;return _0x560087;})['then'](respondWithFilteredResult(_0x5ce7e0,_0x142b40))[_0xdcb9('0x59')](handleError(_0x5ce7e0,null));};exports['show']=function(_0xff532d,_0x8834f7){var _0x5a9dab={'raw':!![],'where':{'id':_0xff532d[_0xdcb9('0x5a')]['id']}},_0x59829c={};_0x59829c['model']=_[_0xdcb9('0x47')](db[_0xdcb9('0x56')][_0xdcb9('0x42')]);_0x59829c['query']=_[_0xdcb9('0x47')](_0xff532d['query']);_0x59829c[_0xdcb9('0x48')]=_[_0xdcb9('0x4a')](_0x59829c[_0xdcb9('0x45')],_0x59829c['query']);_0x5a9dab[_0xdcb9('0x49')]=_[_0xdcb9('0x4a')](_0x59829c['model'],qs[_0xdcb9('0x4b')](_0xff532d['query'][_0xdcb9('0x4b')]));_0x5a9dab['attributes']=_0x5a9dab[_0xdcb9('0x49')][_0xdcb9('0x4c')]?_0x5a9dab['attributes']:_0x59829c[_0xdcb9('0x45')];if(_0xff532d[_0xdcb9('0x46')][_0xdcb9('0x5b')]){_0x5a9dab[_0xdcb9('0x55')]=[{'all':!![]}];}_0x5a9dab=_['merge']({},_0x5a9dab,_0xff532d[_0xdcb9('0x54')]);return db[_0xdcb9('0x56')][_0xdcb9('0x5c')](_0x5a9dab)['then'](handleEntityNotFound(_0x8834f7,null))[_0xdcb9('0x3c')](respondWithResult(_0x8834f7,null))[_0xdcb9('0x59')](handleError(_0x8834f7,null));};exports[_0xdcb9('0x5d')]=function(_0x30bd01,_0x2962b2){return db[_0xdcb9('0x56')][_0xdcb9('0x5d')](_0x30bd01['body'],{})[_0xdcb9('0x3c')](respondWithResult(_0x2962b2,0xc9))[_0xdcb9('0x59')](handleError(_0x2962b2,null));};exports[_0xdcb9('0x3b')]=function(_0x270c06,_0x511fde){if(_0x270c06['body']['id']){delete _0x270c06[_0xdcb9('0x5e')]['id'];}return db[_0xdcb9('0x56')]['find']({'where':{'id':_0x270c06[_0xdcb9('0x5a')]['id']}})[_0xdcb9('0x3c')](handleEntityNotFound(_0x511fde,null))[_0xdcb9('0x3c')](saveUpdates(_0x270c06[_0xdcb9('0x5e')],null))[_0xdcb9('0x3c')](respondWithResult(_0x511fde,null))[_0xdcb9('0x59')](handleError(_0x511fde,null));};exports['destroy']=function(_0x53ee0f,_0x3680cc){return db[_0xdcb9('0x56')][_0xdcb9('0x5c')]({'where':{'id':_0x53ee0f['params']['id']}})[_0xdcb9('0x3c')](handleEntityNotFound(_0x3680cc,null))[_0xdcb9('0x3c')](removeEntity(_0x3680cc,null))['catch'](handleError(_0x3680cc,null));};exports[_0xdcb9('0x5f')]=function(_0x5d4828,_0x536644){return db[_0xdcb9('0x56')][_0xdcb9('0x5f')]()[_0xdcb9('0x3c')](respondWithResult(_0x536644,null))[_0xdcb9('0x59')](handleError(_0x536644,null));};var interaction_log=require(_0xdcb9('0x14'))(_0xdcb9('0x60'));exports[_0xdcb9('0x61')]=function(_0x13d1b6,_0xcf415b,_0x5c020a){var _0x503000={'channel':_0xdcb9('0x62')};if(_0x13d1b6['body']['id']){delete _0x13d1b6[_0xdcb9('0x5e')]['id'];}_0x13d1b6[_0xdcb9('0x5e')]['read']=!![];_0x13d1b6[_0xdcb9('0x5e')][_0xdcb9('0x63')]=moment()['format'](_0xdcb9('0x64'));_0x13d1b6[_0xdcb9('0x5e')][_0xdcb9('0x65')]=_0x13d1b6[_0xdcb9('0x5e')][_0xdcb9('0x65')]||_0x13d1b6['user']['id'];return db[_0xdcb9('0x56')][_0xdcb9('0x5c')]({'where':{'id':_0x13d1b6[_0xdcb9('0x5a')]['id'],'UserId':null},'include':[{'model':db[_0xdcb9('0x66')],'as':'Contact'}]})['then'](handleEntityNotFound(_0xcf415b,null))[_0xdcb9('0x3c')](saveUpdates(_0x13d1b6[_0xdcb9('0x5e')],null))[_0xdcb9('0x3c')](function(_0x527d8e){if(_0x527d8e){_0x503000[_0xdcb9('0x2c')]=_0x527d8e['get']({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x527d8e[_0xdcb9('0x67')]}});}return null;})[_0xdcb9('0x3c')](handleEntityNotFound(_0xcf415b,null))['then'](function(_0x53eb21){if(_0x53eb21){return _0x53eb21['update']({'UserId':_0x13d1b6[_0xdcb9('0x5e')][_0xdcb9('0x65')],'read1stAt':_[_0xdcb9('0x68')](_0x53eb21['read1stAt'])?moment()['format'](_0xdcb9('0x64')):undefined});}return null;})[_0xdcb9('0x3c')](function(_0x1761d3){if(_0x1761d3){_0x503000[_0xdcb9('0x69')]=_0x1761d3[_0xdcb9('0x6a')]({'plain':!![]});interaction_log[_0xdcb9('0x2d')](_0xdcb9('0x6b'),_0x13d1b6[_0xdcb9('0x6c')]['id'],_0x13d1b6[_0xdcb9('0x6c')]['name'],_0x13d1b6['user'][_0xdcb9('0x6d')],_0x503000['interaction']['id'],_0x13d1b6[_0xdcb9('0x5e')]?JSON['stringify'](_0x13d1b6[_0xdcb9('0x5e')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x503000);}return null;})[_0xdcb9('0x3c')](function(_0x20538b){if(_0x20538b){if(_0x13d1b6['body'][_0xdcb9('0x6e')]){_0x503000[_0xdcb9('0x2c')]['interface']=util[_0xdcb9('0x6f')](_0xdcb9('0x70'),_0x13d1b6[_0xdcb9('0x6c')][_0xdcb9('0x3f')]);_0x503000[_0xdcb9('0x2c')]['channel']=_0x503000[_0xdcb9('0x71')];_0x503000['message'][_0xdcb9('0x72')]=_0xdcb9('0x61');return respondWithRpcPromise(_0xdcb9('0x73'),_0xdcb9('0x73'),{'event':_0xdcb9('0x74'),'message':_[_0xdcb9('0x52')](_0x503000[_0xdcb9('0x2c')],JSON['parse'](_0x503000[_0xdcb9('0x69')][_0xdcb9('0x75')]))},client9002)[_0xdcb9('0x3c')](function(){return _0x503000;});}return _0x503000;}return null;})['then'](respondWithResult(_0xcf415b,null))[_0xdcb9('0x59')](handleError(_0xcf415b,null));};var interaction_log=require(_0xdcb9('0x14'))(_0xdcb9('0x60'));exports[_0xdcb9('0x39')]=function(_0x469472,_0xa0d664,_0x4cc3d5){var _0x1cc54={'agent':{},'channel':_0xdcb9('0x62')};if(_0x469472[_0xdcb9('0x5e')]['id']){delete _0x469472[_0xdcb9('0x5e')]['id'];}_0x469472[_0xdcb9('0x5e')][_0xdcb9('0x65')]=_0x469472[_0xdcb9('0x5e')]['UserId']||_0x469472[_0xdcb9('0x6c')]['id'];_0x1cc54[_0xdcb9('0x76')]['id']=_0x469472[_0xdcb9('0x5e')]['UserId'];return db[_0xdcb9('0x56')][_0xdcb9('0x5c')]({'where':{'id':_0x469472[_0xdcb9('0x5a')]['id'],'UserId':null}})[_0xdcb9('0x3c')](handleEntityNotFound(_0xa0d664,null))[_0xdcb9('0x3c')](function(_0x1487cb){if(_0x1487cb){_0x1cc54['message']=_0x1487cb[_0xdcb9('0x6a')]({'plain':!![]});return db[_0xdcb9('0x77')][_0xdcb9('0x5c')]({'where':{'id':_0x1487cb['ChatInteractionId']}});}return null;})[_0xdcb9('0x3c')](handleEntityNotFound(_0xa0d664,null))[_0xdcb9('0x3c')](function(_0x4fe490){if(_0x4fe490){_0x1cc54[_0xdcb9('0x69')]=_0x4fe490[_0xdcb9('0x6a')]({'plain':!![]});interaction_log['info'](_0xdcb9('0x78'),_0x469472[_0xdcb9('0x6c')]['id'],_0x469472[_0xdcb9('0x6c')]['name'],_0x469472[_0xdcb9('0x6c')][_0xdcb9('0x6d')],_0x1cc54['interaction']['id'],_0x469472[_0xdcb9('0x5e')]?JSON[_0xdcb9('0x29')](_0x469472['body']):_0xdcb9('0x79'));return respondWithRpcPromise(_0xdcb9('0x7a'),'rejectMessage',_0x1cc54);}return null;})[_0xdcb9('0x3c')](function(_0x11db48){if(_0x11db48){_0x11db48[_0xdcb9('0x2c')][_0xdcb9('0x7b')]=util[_0xdcb9('0x6f')]('SIP/%s',_0x469472[_0xdcb9('0x6c')]['name']);_0x11db48['message'][_0xdcb9('0x71')]=_0x1cc54[_0xdcb9('0x71')];_0x11db48['message'][_0xdcb9('0x72')]=_0xdcb9('0x39');respondWithRpcPromise('EventManager',_0xdcb9('0x73'),{'event':_0xdcb9('0x7c'),'message':_0x11db48['message']},client9002);return _0x1cc54;}return null;})['then'](respondWithResult(_0xa0d664,null))[_0xdcb9('0x59')](handleError(_0xa0d664,null));}; \ No newline at end of file +var _0xe647=['merge','count','includeAll','rows','fields','include','options','create','update','body','find','destroy','params','describe','chat-interactions','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','AcceptMessage','acceptMessage','channel','event','EventManager','acceptmessage','chat','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','interface','SIP/%s','rejectmessage','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','where','filter'];(function(_0x5c1449,_0x2af4b4){var _0x270473=function(_0x1461b6){while(--_0x1461b6){_0x5c1449['push'](_0x5c1449['shift']());}};_0x270473(++_0x2af4b4);}(_0xe647,0x128));var _0x7e64=function(_0x249d1b,_0x3aae89){_0x249d1b=_0x249d1b-0x0;var _0x4d8ce8=_0xe647[_0x249d1b];return _0x4d8ce8;};'use strict';var pdf=require(_0x7e64('0x0'));var emlformat=require(_0x7e64('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7e64('0x2'));var jsonpatch=require(_0x7e64('0x3'));var rp=require(_0x7e64('0x4'));var moment=require(_0x7e64('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7e64('0x6'));var util=require(_0x7e64('0x7'));var path=require(_0x7e64('0x8'));var sox=require(_0x7e64('0x9'));var csv=require(_0x7e64('0xa'));var ejs=require(_0x7e64('0xb'));var fs=require('fs');var _=require(_0x7e64('0xc'));var squel=require('squel');var crypto=require(_0x7e64('0xd'));var jsforce=require(_0x7e64('0xe'));var deskjs=require(_0x7e64('0xf'));var toCsv=require(_0x7e64('0xa'));var querystring=require('querystring');var Papa=require(_0x7e64('0x10'));var Redis=require('ioredis');var authService=require(_0x7e64('0x11'));var qs=require(_0x7e64('0x12'));var as=require(_0x7e64('0x13'));var hardwareService=require(_0x7e64('0x14'));var logger=require(_0x7e64('0x15'))(_0x7e64('0x16'));var utils=require('../../config/utils');var config=require(_0x7e64('0x17'));var db=require(_0x7e64('0x18'))['db'];config[_0x7e64('0x19')]=_[_0x7e64('0x1a')](config['redis'],{'host':_0x7e64('0x1b'),'port':0x18eb});var socket=require(_0x7e64('0x1c'))(new Redis(config['redis']));require('./chatMessage.socket')[_0x7e64('0x1d')](socket);var jayson=require(_0x7e64('0x1e'));var client=jayson[_0x7e64('0x1f')][_0x7e64('0x20')]({'port':0x232c});var client9002=jayson[_0x7e64('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x1c1862,_0xe52677,_0x23eb86){if(_0x23eb86){var _0x581635=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x581635[_0x7e64('0x21')](_0xe52677)){return _0x1c1862;}else{throw new db[(_0x7e64('0x22'))][(_0x7e64('0x23'))](_0x7e64('0x24'));}}else{return _0x1c1862;}}function respondWithRpcPromise(_0x39228b,_0x2e591c,_0x162dfc,_0x28c153){return new BPromise(function(_0x46b030,_0x33ddd2){var _0x33494a=_0x28c153||client;return _0x33494a[_0x7e64('0x25')](_0x39228b,_0x162dfc)[_0x7e64('0x26')](function(_0x484bea){logger['info'](_0x7e64('0x27'),_0x2e591c,_0x7e64('0x28'));logger['debug'](_0x7e64('0x29'),_0x2e591c,_0x7e64('0x28'),JSON['stringify'](_0x484bea));if(_0x484bea[_0x7e64('0x2a')]){if(_0x484bea['error'][_0x7e64('0x2b')]===0x1f4){logger[_0x7e64('0x2a')](_0x7e64('0x27'),_0x2e591c,_0x484bea[_0x7e64('0x2a')][_0x7e64('0x2c')]);return _0x33ddd2(_0x484bea[_0x7e64('0x2a')]['message']);}logger['error'](_0x7e64('0x27'),_0x2e591c,_0x484bea[_0x7e64('0x2a')][_0x7e64('0x2c')]);return _0x46b030(_0x484bea['error'][_0x7e64('0x2c')]);}else{logger[_0x7e64('0x2d')](_0x7e64('0x27'),_0x2e591c,'request\x20sent');_0x46b030(_0x484bea[_0x7e64('0x2e')][_0x7e64('0x2c')]);}})[_0x7e64('0x2f')](function(_0x179a3e){logger[_0x7e64('0x2a')](_0x7e64('0x27'),_0x2e591c,_0x179a3e);_0x33ddd2(_0x179a3e);});});}function respondWithStatusCode(_0x5ed980,_0x1e037e){_0x1e037e=_0x1e037e||0xcc;return function(_0x4fe954){if(_0x4fe954){return _0x5ed980[_0x7e64('0x30')](_0x1e037e);}return _0x5ed980[_0x7e64('0x31')](_0x1e037e)[_0x7e64('0x32')]();};}function respondWithResult(_0x2ba328,_0x2c7355){_0x2c7355=_0x2c7355||0xc8;return function(_0x23daf7){if(_0x23daf7){return _0x2ba328[_0x7e64('0x31')](_0x2c7355)[_0x7e64('0x33')](_0x23daf7);}};}function respondWithFilteredResult(_0x20832c,_0x4b8014){return function(_0x5bc565){if(_0x5bc565){var _0x3b0174=_0x5bc565['count'],_0x29f99a=_0x4b8014[_0x7e64('0x34')],_0x2e4b16=_0x4b8014[_0x7e64('0x34')]+_0x4b8014[_0x7e64('0x35')],_0x4fba64;if(_0x2e4b16>=_0x3b0174){_0x2e4b16=_0x3b0174;_0x4fba64=0xc8;}else{_0x4fba64=0xce;}_0x20832c[_0x7e64('0x31')](_0x4fba64);return _0x20832c[_0x7e64('0x36')](_0x7e64('0x37'),_0x29f99a+'-'+_0x2e4b16+'/'+_0x3b0174)[_0x7e64('0x33')](_0x5bc565);}return null;};}function patchUpdates(_0x53e3ad){return function(_0x5639a1){try{jsonpatch['apply'](_0x5639a1,_0x53e3ad,!![]);}catch(_0x5afa69){return BPromise[_0x7e64('0x38')](_0x5afa69);}return _0x5639a1[_0x7e64('0x39')]();};}function saveUpdates(_0x1eafb8,_0xf5641d){return function(_0x1d1414){if(_0x1d1414){return _0x1d1414['update'](_0x1eafb8)['then'](function(_0x4fa51c){return _0x4fa51c;});}return null;};}function removeEntity(_0x18f2fe,_0x26d125){return function(_0x24f3a9){if(_0x24f3a9){return _0x24f3a9['destroy']()[_0x7e64('0x26')](function(){_0x18f2fe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x561c76,_0x4d666d){return function(_0x1e99dd){if(!_0x1e99dd){_0x561c76['sendStatus'](0x194);}return _0x1e99dd;};}function handleError(_0x3de057,_0x2eb8be){_0x2eb8be=_0x2eb8be||0x1f4;return function(_0x4fbd7a){logger[_0x7e64('0x2a')](_0x4fbd7a[_0x7e64('0x3a')]);if(_0x4fbd7a[_0x7e64('0x3b')]){delete _0x4fbd7a['name'];}_0x3de057['status'](_0x2eb8be)[_0x7e64('0x3c')](_0x4fbd7a);};}exports[_0x7e64('0x3d')]=function(_0x20b315,_0x2371fd){var _0x5843ca={},_0x1b0d14={},_0x8680ad={'count':0x0,'rows':[]};var _0x19afe7=_[_0x7e64('0x3e')](db[_0x7e64('0x3f')][_0x7e64('0x40')],function(_0x3060bf){return{'name':_0x3060bf[_0x7e64('0x41')],'type':_0x3060bf[_0x7e64('0x42')][_0x7e64('0x43')]};});_0x1b0d14[_0x7e64('0x44')]=_[_0x7e64('0x3e')](_0x19afe7,'name');_0x1b0d14[_0x7e64('0x45')]=_[_0x7e64('0x46')](_0x20b315[_0x7e64('0x45')]);_0x1b0d14[_0x7e64('0x47')]=_[_0x7e64('0x48')](_0x1b0d14[_0x7e64('0x44')],_0x1b0d14[_0x7e64('0x45')]);_0x5843ca[_0x7e64('0x49')]=_[_0x7e64('0x48')](_0x1b0d14[_0x7e64('0x44')],qs['fields'](_0x20b315['query']['fields']));_0x5843ca[_0x7e64('0x49')]=_0x5843ca[_0x7e64('0x49')][_0x7e64('0x4a')]?_0x5843ca[_0x7e64('0x49')]:_0x1b0d14[_0x7e64('0x44')];if(!_0x20b315[_0x7e64('0x45')][_0x7e64('0x4b')](_0x7e64('0x4c'))){_0x5843ca[_0x7e64('0x35')]=qs[_0x7e64('0x35')](_0x20b315['query']['limit']);_0x5843ca[_0x7e64('0x34')]=qs[_0x7e64('0x34')](_0x20b315['query']['offset']);}_0x5843ca['order']=qs['sort'](_0x20b315[_0x7e64('0x45')]['sort']);_0x5843ca[_0x7e64('0x4d')]=qs[_0x7e64('0x47')](_['pick'](_0x20b315[_0x7e64('0x45')],_0x1b0d14[_0x7e64('0x47')]),_0x19afe7);if(_0x20b315[_0x7e64('0x45')][_0x7e64('0x4e')]){_0x5843ca[_0x7e64('0x4d')]=_[_0x7e64('0x4f')](_0x5843ca[_0x7e64('0x4d')],{'$or':_['map'](_0x19afe7,function(_0x55cc92){if(_0x55cc92['type']!=='VIRTUAL'){var _0x47503b={};_0x47503b[_0x55cc92[_0x7e64('0x3b')]]={'$like':'%'+_0x20b315[_0x7e64('0x45')][_0x7e64('0x4e')]+'%'};return _0x47503b;}})});}_0x5843ca=_[_0x7e64('0x4f')]({},_0x5843ca,_0x20b315['options']);var _0x38299e={'where':_0x5843ca['where']};return db[_0x7e64('0x3f')]['count'](_0x38299e)[_0x7e64('0x26')](function(_0x3db2ea){_0x8680ad[_0x7e64('0x50')]=_0x3db2ea;if(_0x20b315[_0x7e64('0x45')][_0x7e64('0x51')]){_0x5843ca['include']=[{'all':!![]}];}return db[_0x7e64('0x3f')]['findAll'](_0x5843ca);})[_0x7e64('0x26')](function(_0x3075c0){_0x8680ad[_0x7e64('0x52')]=_0x3075c0;return _0x8680ad;})[_0x7e64('0x26')](respondWithFilteredResult(_0x2371fd,_0x5843ca))[_0x7e64('0x2f')](handleError(_0x2371fd,null));};exports['show']=function(_0x4dcd49,_0xb39276){var _0x43ec50={'raw':!![],'where':{'id':_0x4dcd49['params']['id']}},_0x3fe12b={};_0x3fe12b[_0x7e64('0x44')]=_[_0x7e64('0x46')](db[_0x7e64('0x3f')][_0x7e64('0x40')]);_0x3fe12b[_0x7e64('0x45')]=_[_0x7e64('0x46')](_0x4dcd49[_0x7e64('0x45')]);_0x3fe12b['filters']=_[_0x7e64('0x48')](_0x3fe12b[_0x7e64('0x44')],_0x3fe12b[_0x7e64('0x45')]);_0x43ec50[_0x7e64('0x49')]=_[_0x7e64('0x48')](_0x3fe12b[_0x7e64('0x44')],qs[_0x7e64('0x53')](_0x4dcd49[_0x7e64('0x45')][_0x7e64('0x53')]));_0x43ec50[_0x7e64('0x49')]=_0x43ec50[_0x7e64('0x49')]['length']?_0x43ec50['attributes']:_0x3fe12b['model'];if(_0x4dcd49['query'][_0x7e64('0x51')]){_0x43ec50[_0x7e64('0x54')]=[{'all':!![]}];}_0x43ec50=_[_0x7e64('0x4f')]({},_0x43ec50,_0x4dcd49[_0x7e64('0x55')]);return db[_0x7e64('0x3f')]['find'](_0x43ec50)[_0x7e64('0x26')](handleEntityNotFound(_0xb39276,null))['then'](respondWithResult(_0xb39276,null))[_0x7e64('0x2f')](handleError(_0xb39276,null));};exports['create']=function(_0x14465c,_0x2448aa){return db[_0x7e64('0x3f')][_0x7e64('0x56')](_0x14465c['body'],{})[_0x7e64('0x26')](respondWithResult(_0x2448aa,0xc9))[_0x7e64('0x2f')](handleError(_0x2448aa,null));};exports[_0x7e64('0x57')]=function(_0x5d73f8,_0x3dddb5){if(_0x5d73f8[_0x7e64('0x58')]['id']){delete _0x5d73f8[_0x7e64('0x58')]['id'];}return db[_0x7e64('0x3f')][_0x7e64('0x59')]({'where':{'id':_0x5d73f8['params']['id']}})['then'](handleEntityNotFound(_0x3dddb5,null))[_0x7e64('0x26')](saveUpdates(_0x5d73f8[_0x7e64('0x58')],null))[_0x7e64('0x26')](respondWithResult(_0x3dddb5,null))[_0x7e64('0x2f')](handleError(_0x3dddb5,null));};exports[_0x7e64('0x5a')]=function(_0x5ecfb8,_0x545307){return db['ChatMessage'][_0x7e64('0x59')]({'where':{'id':_0x5ecfb8[_0x7e64('0x5b')]['id']}})['then'](handleEntityNotFound(_0x545307,null))['then'](removeEntity(_0x545307,null))[_0x7e64('0x2f')](handleError(_0x545307,null));};exports[_0x7e64('0x5c')]=function(_0x672303,_0x51011c){return db[_0x7e64('0x3f')][_0x7e64('0x5c')]()[_0x7e64('0x26')](respondWithResult(_0x51011c,null))[_0x7e64('0x2f')](handleError(_0x51011c,null));};var interaction_log=require(_0x7e64('0x15'))(_0x7e64('0x5d'));exports['accept']=function(_0x3b8b3b,_0x5c5f7c,_0x52d44c){var _0xde13d3={'channel':'chat'};if(_0x3b8b3b[_0x7e64('0x58')]['id']){delete _0x3b8b3b['body']['id'];}_0x3b8b3b['body'][_0x7e64('0x5e')]=!![];_0x3b8b3b[_0x7e64('0x58')][_0x7e64('0x5f')]=moment()[_0x7e64('0x60')](_0x7e64('0x61'));_0x3b8b3b[_0x7e64('0x58')][_0x7e64('0x62')]=_0x3b8b3b['body'][_0x7e64('0x62')]||_0x3b8b3b['user']['id'];return db['ChatMessage'][_0x7e64('0x59')]({'where':{'id':_0x3b8b3b[_0x7e64('0x5b')]['id'],'UserId':null},'include':[{'model':db[_0x7e64('0x63')],'as':_0x7e64('0x64')}]})['then'](handleEntityNotFound(_0x5c5f7c,null))[_0x7e64('0x26')](saveUpdates(_0x3b8b3b[_0x7e64('0x58')],null))[_0x7e64('0x26')](function(_0xb9edc8){if(_0xb9edc8){_0xde13d3[_0x7e64('0x2c')]=_0xb9edc8[_0x7e64('0x65')]({'plain':!![]});return db[_0x7e64('0x66')][_0x7e64('0x59')]({'where':{'id':_0xb9edc8[_0x7e64('0x67')]}});}return null;})[_0x7e64('0x26')](handleEntityNotFound(_0x5c5f7c,null))[_0x7e64('0x26')](function(_0x359ca1){if(_0x359ca1){return _0x359ca1[_0x7e64('0x57')]({'UserId':_0x3b8b3b[_0x7e64('0x58')][_0x7e64('0x62')],'read1stAt':_['isNil'](_0x359ca1[_0x7e64('0x68')])?moment()['format'](_0x7e64('0x61')):undefined});}return null;})['then'](function(_0x55c69e){if(_0x55c69e){_0xde13d3[_0x7e64('0x69')]=_0x55c69e[_0x7e64('0x65')]({'plain':!![]});interaction_log[_0x7e64('0x2d')](_0x7e64('0x6a'),_0x3b8b3b['user']['id'],_0x3b8b3b[_0x7e64('0x6b')]['name'],_0x3b8b3b[_0x7e64('0x6b')]['role'],_0xde13d3['interaction']['id'],_0x3b8b3b[_0x7e64('0x58')]?JSON[_0x7e64('0x6c')](_0x3b8b3b[_0x7e64('0x58')]):'null');return respondWithRpcPromise(_0x7e64('0x6d'),_0x7e64('0x6e'),_0xde13d3);}return null;})[_0x7e64('0x26')](function(_0x5c5340){if(_0x5c5340){if(_0x3b8b3b['body']['manual']){_0xde13d3['message']['interface']=util[_0x7e64('0x60')]('SIP/%s',_0x3b8b3b['user']['name']);_0xde13d3['message'][_0x7e64('0x6f')]=_0xde13d3[_0x7e64('0x6f')];_0xde13d3[_0x7e64('0x2c')][_0x7e64('0x70')]='accept';return respondWithRpcPromise(_0x7e64('0x71'),_0x7e64('0x71'),{'event':_0x7e64('0x72'),'message':_[_0x7e64('0x4f')](_0xde13d3[_0x7e64('0x2c')],JSON['parse'](_0xde13d3[_0x7e64('0x69')]['formData']))},client9002)[_0x7e64('0x26')](function(){return _0xde13d3;});}return _0xde13d3;}return null;})[_0x7e64('0x26')](respondWithResult(_0x5c5f7c,null))[_0x7e64('0x2f')](handleError(_0x5c5f7c,null));};var interaction_log=require(_0x7e64('0x15'))(_0x7e64('0x5d'));exports['reject']=function(_0x2437c9,_0x1c14dd,_0x3fb57b){var _0x5ec05b={'agent':{},'channel':_0x7e64('0x73')};if(_0x2437c9[_0x7e64('0x58')]['id']){delete _0x2437c9['body']['id'];}_0x2437c9[_0x7e64('0x58')]['UserId']=_0x2437c9['body']['UserId']||_0x2437c9['user']['id'];_0x5ec05b[_0x7e64('0x74')]['id']=_0x2437c9[_0x7e64('0x58')][_0x7e64('0x62')];return db['ChatMessage'][_0x7e64('0x59')]({'where':{'id':_0x2437c9['params']['id'],'UserId':null}})[_0x7e64('0x26')](handleEntityNotFound(_0x1c14dd,null))[_0x7e64('0x26')](function(_0xefdcf6){if(_0xefdcf6){_0x5ec05b[_0x7e64('0x2c')]=_0xefdcf6['get']({'plain':!![]});return db[_0x7e64('0x66')][_0x7e64('0x59')]({'where':{'id':_0xefdcf6[_0x7e64('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x1c14dd,null))[_0x7e64('0x26')](function(_0x58d5ca){if(_0x58d5ca){_0x5ec05b[_0x7e64('0x69')]=_0x58d5ca[_0x7e64('0x65')]({'plain':!![]});interaction_log[_0x7e64('0x2d')](_0x7e64('0x75'),_0x2437c9[_0x7e64('0x6b')]['id'],_0x2437c9[_0x7e64('0x6b')]['name'],_0x2437c9[_0x7e64('0x6b')][_0x7e64('0x76')],_0x5ec05b[_0x7e64('0x69')]['id'],_0x2437c9[_0x7e64('0x58')]?JSON[_0x7e64('0x6c')](_0x2437c9['body']):_0x7e64('0x77'));return respondWithRpcPromise(_0x7e64('0x78'),_0x7e64('0x79'),_0x5ec05b);}return null;})[_0x7e64('0x26')](function(_0x32cab8){if(_0x32cab8){_0x32cab8[_0x7e64('0x2c')][_0x7e64('0x7a')]=util[_0x7e64('0x60')](_0x7e64('0x7b'),_0x2437c9[_0x7e64('0x6b')]['name']);_0x32cab8['message'][_0x7e64('0x6f')]=_0x5ec05b[_0x7e64('0x6f')];_0x32cab8[_0x7e64('0x2c')][_0x7e64('0x70')]=_0x7e64('0x38');respondWithRpcPromise(_0x7e64('0x71'),'EventManager',{'event':_0x7e64('0x7c'),'message':_0x32cab8[_0x7e64('0x2c')]},client9002);return _0x5ec05b;}return null;})[_0x7e64('0x26')](respondWithResult(_0x1c14dd,null))['catch'](handleError(_0x1c14dd,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 04e16cb..c2c9632 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 _0x93bb=['ChatMessage','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x187fb3,_0x8fa3a5){var _0x3654ca=function(_0x198624){while(--_0x198624){_0x187fb3['push'](_0x187fb3['shift']());}};_0x3654ca(++_0x8fa3a5);}(_0x93bb,0x167));var _0xb93b=function(_0x9a2b27,_0x2f4fdc){_0x9a2b27=_0x9a2b27-0x0;var _0x3a23de=_0x93bb[_0x9a2b27];return _0x3a23de;};'use strict';var EventEmitter=require(_0xb93b('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xb93b('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb93b('0x2')](0x0);var events={'afterCreate':_0xb93b('0x3'),'afterUpdate':_0xb93b('0x4'),'afterDestroy':_0xb93b('0x5')};function emitEvent(_0x542ba4){return function(_0x27a80c,_0x349c32,_0xc5d5ba){ChatMessageEvents[_0xb93b('0x6')](_0x542ba4+':'+_0x27a80c['id'],_0x27a80c);ChatMessageEvents['emit'](_0x542ba4,_0x27a80c);_0xc5d5ba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xb93b('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file +var _0x4ad4=['emit','events','ChatMessage','setMaxListeners','save','update'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x4ad4,0x11b));var _0x44ad=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x4ad4[_0x556927];return _0x5f1235;};'use strict';var EventEmitter=require(_0x44ad('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x44ad('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x44ad('0x2')](0x0);var events={'afterCreate':_0x44ad('0x3'),'afterUpdate':_0x44ad('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3f8e1e){return function(_0x5cbb61,_0x2e3c44,_0x52fbf7){ChatMessageEvents['emit'](_0x3f8e1e+':'+_0x5cbb61['id'],_0x5cbb61);ChatMessageEvents[_0x44ad('0x5')](_0x3f8e1e,_0x5cbb61);_0x52fbf7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index cd10c4a..7e16daf 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 _0xfd4b=['secret','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./chatMessage.attributes','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','get','direction','toLowerCase'];(function(_0x282e53,_0x59d7f2){var _0x33bd76=function(_0x51a9ee){while(--_0x51a9ee){_0x282e53['push'](_0x282e53['shift']());}};_0x33bd76(++_0x59d7f2);}(_0xfd4b,0x96));var _0xbfd4=function(_0x6ffc2b,_0x17b3c2){_0x6ffc2b=_0x6ffc2b-0x0;var _0x50560a=_0xfd4b[_0x6ffc2b];return _0x50560a;};'use strict';var _=require(_0xbfd4('0x0'));var util=require(_0xbfd4('0x1'));var logger=require(_0xbfd4('0x2'))(_0xbfd4('0x3'));var moment=require(_0xbfd4('0x4'));var BPromise=require(_0xbfd4('0x5'));var rp=require(_0xbfd4('0x6'));var fs=require('fs');var path=require(_0xbfd4('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbfd4('0x8'));module['exports']=function(_0x28f6fb,_0x1f650b){return _0x28f6fb[_0xbfd4('0x9')](_0xbfd4('0xa'),attributes,{'tableName':_0xbfd4('0xb'),'paranoid':![],'indexes':[{'name':_0xbfd4('0xc'),'fields':[_0xbfd4('0xd')],'type':_0xbfd4('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x498ce9,_0x4a7262,_0x56c532){var _0xcdd12d=_0x28f6fb['models'];var _0x5880be=_0x498ce9[_0xbfd4('0xf')]({'plain':!![]});if(_0x5880be[_0xbfd4('0x10')]['toLowerCase']()==='in'||_0x5880be[_0xbfd4('0x10')][_0xbfd4('0x11')]()==='out'&&!_0x5880be[_0xbfd4('0x12')]&&!_['isNil'](_0x5880be[_0xbfd4('0x13')])){_0xcdd12d[_0xbfd4('0x14')][_0xbfd4('0x15')]({'where':{'id':_0x5880be[_0xbfd4('0x16')]}})[_0xbfd4('0x17')](function(_0x2c4642){if(_0x2c4642){_0x2c4642[_0xbfd4('0x18')]({'lastMsgAt':_0x5880be['createdAt'],'lastMsgDirection':_0x5880be[_0xbfd4('0x10')][_0xbfd4('0x11')]()});}})[_0xbfd4('0x19')](function(_0x52114b){console[_0xbfd4('0x1a')](_0x52114b);});}_0x56c532();}},'charset':'utf8mb4','collate':_0xbfd4('0x1b')});}; \ No newline at end of file +var _0xc37e=['direction','toLowerCase','out','isNil','UserId','findOne','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get'];(function(_0x1b20a5,_0x2b7f73){var _0x525273=function(_0x1322ae){while(--_0x1322ae){_0x1b20a5['push'](_0x1b20a5['shift']());}};_0x525273(++_0x2b7f73);}(_0xc37e,0x1ac));var _0xec37=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xc37e[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xec37('0x0'));var util=require(_0xec37('0x1'));var logger=require(_0xec37('0x2'))('api');var moment=require(_0xec37('0x3'));var BPromise=require('bluebird');var rp=require(_0xec37('0x4'));var fs=require('fs');var path=require(_0xec37('0x5'));var rimraf=require(_0xec37('0x6'));var config=require('../../config/environment');var attributes=require('./chatMessage.attributes');module[_0xec37('0x7')]=function(_0x292698,_0x97d89e){return _0x292698['define'](_0xec37('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xec37('0x9'),'fields':[_0xec37('0xa')],'type':_0xec37('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1c0a2e,_0x487ec8,_0x28e7f8){var _0x2cdb25=_0x292698[_0xec37('0xc')];var _0x58627e=_0x1c0a2e[_0xec37('0xd')]({'plain':!![]});if(_0x58627e[_0xec37('0xe')][_0xec37('0xf')]()==='in'||_0x58627e[_0xec37('0xe')][_0xec37('0xf')]()===_0xec37('0x10')&&!_0x58627e['secret']&&!_[_0xec37('0x11')](_0x58627e[_0xec37('0x12')])){_0x2cdb25['ChatInteraction'][_0xec37('0x13')]({'where':{'id':_0x58627e['ChatInteractionId']}})[_0xec37('0x14')](function(_0x249ce7){if(_0x249ce7){_0x249ce7[_0xec37('0x15')]({'lastMsgAt':_0x58627e['createdAt'],'lastMsgDirection':_0x58627e[_0xec37('0xe')][_0xec37('0xf')]()});}})[_0xec37('0x16')](function(_0x39e6e4){console[_0xec37('0x17')](_0x39e6e4);});}_0x28e7f8();}},'charset':_0xec37('0x18'),'collate':_0xec37('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index aebdd79..c0444db 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 _0x8ff6=['message','catch','CreateChatMessage','ChatMessage','body','options','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x224c22,_0x38b9f1){var _0x3665c8=function(_0x28435c){while(--_0x28435c){_0x224c22['push'](_0x224c22['shift']());}};_0x3665c8(++_0x38b9f1);}(_0x8ff6,0x17b));var _0x68ff=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x8ff6[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0x68ff('0x0'));var util=require(_0x68ff('0x1'));var moment=require(_0x68ff('0x2'));var BPromise=require('bluebird');var rs=require(_0x68ff('0x3'));var fs=require('fs');var Redis=require(_0x68ff('0x4'));var db=require(_0x68ff('0x5'))['db'];var utils=require(_0x68ff('0x6'));var logger=require('../../config/logger')(_0x68ff('0x7'));var config=require('../../config/environment');var jayson=require(_0x68ff('0x8'));var client=jayson[_0x68ff('0x9')][_0x68ff('0xa')]({'port':0x232a});config[_0x68ff('0xb')]=_[_0x68ff('0xc')](config[_0x68ff('0xb')],{'host':_0x68ff('0xd'),'port':0x18eb});var socket=require(_0x68ff('0xe'))(new Redis(config[_0x68ff('0xb')]));require(_0x68ff('0xf'))[_0x68ff('0x10')](socket);function respondWithRpcPromise(_0x36750e,_0x342944,_0x4fe1fe){return new BPromise(function(_0x2900a1,_0x3db641){return client['request'](_0x36750e,_0x4fe1fe)[_0x68ff('0x11')](function(_0x477eac){logger['info'](_0x68ff('0x12'),_0x342944,'request\x20sent');logger[_0x68ff('0x13')](_0x68ff('0x14'),_0x342944,'request\x20sent',JSON[_0x68ff('0x15')](_0x477eac));if(_0x477eac[_0x68ff('0x16')]){if(_0x477eac[_0x68ff('0x16')][_0x68ff('0x17')]===0x1f4){logger[_0x68ff('0x16')](_0x68ff('0x12'),_0x342944,_0x477eac[_0x68ff('0x16')][_0x68ff('0x18')]);return _0x3db641(_0x477eac[_0x68ff('0x16')][_0x68ff('0x18')]);}logger[_0x68ff('0x16')](_0x68ff('0x12'),_0x342944,_0x477eac[_0x68ff('0x16')][_0x68ff('0x18')]);return _0x2900a1(_0x477eac['error'][_0x68ff('0x18')]);}else{logger['info'](_0x68ff('0x12'),_0x342944,'request\x20sent');_0x2900a1(_0x477eac['result'][_0x68ff('0x18')]);}})[_0x68ff('0x19')](function(_0x264ebe){logger[_0x68ff('0x16')](_0x68ff('0x12'),_0x342944,_0x264ebe);_0x3db641(_0x264ebe);});});}exports[_0x68ff('0x1a')]=function(_0x582cc0){var _0xf86d58=this;return new Promise(function(_0x5b8caf,_0x464ba8){return db[_0x68ff('0x1b')]['create'](_0x582cc0[_0x68ff('0x1c')],{'raw':_0x582cc0[_0x68ff('0x1d')]?_0x582cc0[_0x68ff('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x68ff('0x11')](function(_0xc7e962){logger[_0x68ff('0x1e')](_0x68ff('0x1a'),_0x582cc0);logger[_0x68ff('0x13')](_0x68ff('0x1a'),_0x582cc0,JSON['stringify'](_0xc7e962));_0x5b8caf(_0xc7e962);})[_0x68ff('0x19')](function(_0x3c8106){logger[_0x68ff('0x16')]('CreateChatMessage',_0x3c8106[_0x68ff('0x18')],_0x582cc0);_0x464ba8(_0xf86d58['error'](0x1f4,_0x3c8106[_0x68ff('0x18')]));});});}; \ No newline at end of file +var _0x3222=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','then','lodash','util','moment','bluebird'];(function(_0x2c893c,_0x47f860){var _0x1100b=function(_0x419a8c){while(--_0x419a8c){_0x2c893c['push'](_0x2c893c['shift']());}};_0x1100b(++_0x47f860);}(_0x3222,0x137));var _0x2322=function(_0x44d38d,_0x579507){_0x44d38d=_0x44d38d-0x0;var _0x62b4ad=_0x3222[_0x44d38d];return _0x62b4ad;};'use strict';var _=require(_0x2322('0x0'));var util=require(_0x2322('0x1'));var moment=require(_0x2322('0x2'));var BPromise=require(_0x2322('0x3'));var rs=require(_0x2322('0x4'));var fs=require('fs');var Redis=require(_0x2322('0x5'));var db=require(_0x2322('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2322('0x7'))(_0x2322('0x8'));var config=require(_0x2322('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2322('0xa')][_0x2322('0xb')]({'port':0x232a});config[_0x2322('0xc')]=_[_0x2322('0xd')](config[_0x2322('0xc')],{'host':_0x2322('0xe'),'port':0x18eb});var socket=require(_0x2322('0xf'))(new Redis(config[_0x2322('0xc')]));require(_0x2322('0x10'))[_0x2322('0x11')](socket);function respondWithRpcPromise(_0x4fcfdb,_0x38a5b3,_0x4266f8){return new BPromise(function(_0x5a973f,_0x41ac22){return client['request'](_0x4fcfdb,_0x4266f8)['then'](function(_0x5b78c7){logger[_0x2322('0x12')](_0x2322('0x13'),_0x38a5b3,_0x2322('0x14'));logger[_0x2322('0x15')](_0x2322('0x16'),_0x38a5b3,'request\x20sent',JSON[_0x2322('0x17')](_0x5b78c7));if(_0x5b78c7[_0x2322('0x18')]){if(_0x5b78c7[_0x2322('0x18')]['code']===0x1f4){logger[_0x2322('0x18')]('ChatMessage,\x20%s,\x20%s',_0x38a5b3,_0x5b78c7[_0x2322('0x18')][_0x2322('0x19')]);return _0x41ac22(_0x5b78c7[_0x2322('0x18')]['message']);}logger['error'](_0x2322('0x13'),_0x38a5b3,_0x5b78c7[_0x2322('0x18')][_0x2322('0x19')]);return _0x5a973f(_0x5b78c7[_0x2322('0x18')]['message']);}else{logger[_0x2322('0x12')](_0x2322('0x13'),_0x38a5b3,_0x2322('0x14'));_0x5a973f(_0x5b78c7[_0x2322('0x1a')][_0x2322('0x19')]);}})[_0x2322('0x1b')](function(_0x15144f){logger[_0x2322('0x18')](_0x2322('0x13'),_0x38a5b3,_0x15144f);_0x41ac22(_0x15144f);});});}exports[_0x2322('0x1c')]=function(_0x1db20f){var _0x2403a7=this;return new Promise(function(_0x5e38d3,_0x467923){return db[_0x2322('0x1d')][_0x2322('0x1e')](_0x1db20f[_0x2322('0x1f')],{'raw':_0x1db20f[_0x2322('0x20')]?_0x1db20f[_0x2322('0x20')][_0x2322('0x21')]===undefined?!![]:![]:!![]})[_0x2322('0x22')](function(_0x3967f8){logger[_0x2322('0x12')](_0x2322('0x1c'),_0x1db20f);logger[_0x2322('0x15')]('CreateChatMessage',_0x1db20f,JSON[_0x2322('0x17')](_0x3967f8));_0x5e38d3(_0x3967f8);})[_0x2322('0x1b')](function(_0x4e93c1){logger[_0x2322('0x18')](_0x2322('0x1c'),_0x4e93c1[_0x2322('0x19')],_0x1db20f);_0x467923(_0x2403a7['error'](0x1f4,_0x4e93c1[_0x2322('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index ecb1e8d..e8f1d34 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 _0xfcf0=['removeListener','register','length','chatMessage:','./chatMessage.events','save','update'];(function(_0x597c27,_0x6e6a7f){var _0x34545d=function(_0x4f67cb){while(--_0x4f67cb){_0x597c27['push'](_0x597c27['shift']());}};_0x34545d(++_0x6e6a7f);}(_0xfcf0,0x138));var _0x0fcf=function(_0xbec8e6,_0x2841b5){_0xbec8e6=_0xbec8e6-0x0;var _0x4aa6f2=_0xfcf0[_0xbec8e6];return _0x4aa6f2;};'use strict';var ChatMessageEvents=require(_0x0fcf('0x0'));var events=[_0x0fcf('0x1'),'remove',_0x0fcf('0x2')];function createListener(_0x3d8e0f,_0x366cfa){return function(_0xd744d1){_0x366cfa['emit'](_0x3d8e0f,_0xd744d1);};}function removeListener(_0x2fe6d8,_0x265968){return function(){ChatMessageEvents[_0x0fcf('0x3')](_0x2fe6d8,_0x265968);};}exports[_0x0fcf('0x4')]=function(_0x1bace8){for(var _0x1a7b03=0x0,_0x61bbb9=events[_0x0fcf('0x5')];_0x1a7b03<_0x61bbb9;_0x1a7b03++){var _0x50c575=events[_0x1a7b03];var _0x1388d1=createListener(_0x0fcf('0x6')+_0x50c575,_0x1bace8);ChatMessageEvents['on'](_0x50c575,_0x1388d1);}}; \ No newline at end of file +var _0x187d=['./chatMessage.events','remove','update','emit','removeListener','length','chatMessage:'];(function(_0x21d2ca,_0x5a0a5f){var _0x487407=function(_0x59817e){while(--_0x59817e){_0x21d2ca['push'](_0x21d2ca['shift']());}};_0x487407(++_0x5a0a5f);}(_0x187d,0x93));var _0xd187=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x187d[_0x4154a6];return _0x3b2786;};'use strict';var ChatMessageEvents=require(_0xd187('0x0'));var events=['save',_0xd187('0x1'),_0xd187('0x2')];function createListener(_0x44d5f6,_0x1cb41f){return function(_0x18498b){_0x1cb41f[_0xd187('0x3')](_0x44d5f6,_0x18498b);};}function removeListener(_0x58622a,_0x28fa0b){return function(){ChatMessageEvents[_0xd187('0x4')](_0x58622a,_0x28fa0b);};}exports['register']=function(_0x1d2533){for(var _0x58ee7=0x0,_0x444a60=events[_0xd187('0x5')];_0x58ee7<_0x444a60;_0x58ee7++){var _0x28ce2f=events[_0x58ee7];var _0x2d6992=createListener(_0xd187('0x6')+_0x28ce2f,_0x1d2533);ChatMessageEvents['on'](_0x28ce2f,_0x2d6992);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index f7f0ed5..7ceb63f 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 _0x0a8a=['tracked','chat','chatmessage:create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','./chatMessage.controller','get','isAuthenticated','index','describe','/:id','show','post'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x0a8a,0x19b));var _0xa0a8=function(_0xd9ab80,_0x1f1968){_0xd9ab80=_0xd9ab80-0x0;var _0x559fc7=_0x0a8a[_0xd9ab80];return _0x559fc7;};'use strict';var multer=require(_0xa0a8('0x0'));var util=require(_0xa0a8('0x1'));var path=require(_0xa0a8('0x2'));var timeout=require('connect-timeout');var express=require(_0xa0a8('0x3'));var router=express[_0xa0a8('0x4')]();var auth=require(_0xa0a8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa0a8('0x6'));router[_0xa0a8('0x7')]('/',auth[_0xa0a8('0x8')](),controller[_0xa0a8('0x9')]);router['get']('/describe',auth[_0xa0a8('0x8')](),controller[_0xa0a8('0xa')]);router[_0xa0a8('0x7')](_0xa0a8('0xb'),auth[_0xa0a8('0x8')](),controller[_0xa0a8('0xc')]);router[_0xa0a8('0xd')]('/',auth[_0xa0a8('0x8')](),interaction[_0xa0a8('0xe')](_0xa0a8('0xf'),_0xa0a8('0x10')),controller['create']);router[_0xa0a8('0x11')](_0xa0a8('0xb'),controller[_0xa0a8('0x12')]);router['put'](_0xa0a8('0x13'),auth[_0xa0a8('0x8')](),controller['accept']);router['put'](_0xa0a8('0x14'),auth['isAuthenticated'](),controller[_0xa0a8('0x15')]);router[_0xa0a8('0x16')]('/:id',auth[_0xa0a8('0x8')](),controller[_0xa0a8('0x17')]);module[_0xa0a8('0x18')]=router; \ No newline at end of file +var _0xd86f=['show','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','delete','/:id','exports','multer','util','connect-timeout','../../components/interaction/service','./chatMessage.controller','index','/describe','describe','isAuthenticated'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd86f,0x1ac));var _0xfd86=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xd86f[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0xfd86('0x0'));var util=require(_0xfd86('0x1'));var path=require('path');var timeout=require(_0xfd86('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xfd86('0x3'));var config=require('../../config/environment');var controller=require(_0xfd86('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xfd86('0x5')]);router['get'](_0xfd86('0x6'),auth['isAuthenticated'](),controller[_0xfd86('0x7')]);router['get']('/:id',auth[_0xfd86('0x8')](),controller[_0xfd86('0x9')]);router[_0xfd86('0xa')]('/',auth[_0xfd86('0x8')](),interaction[_0xfd86('0xb')](_0xfd86('0xc'),_0xfd86('0xd')),controller[_0xfd86('0xe')]);router[_0xfd86('0xf')]('/:id',controller[_0xfd86('0x10')]);router[_0xfd86('0xf')]('/:id/accept',auth[_0xfd86('0x8')](),controller[_0xfd86('0x11')]);router['put'](_0xfd86('0x12'),auth[_0xfd86('0x8')](),controller[_0xfd86('0x13')]);router[_0xfd86('0x14')](_0xfd86('0x15'),auth[_0xfd86('0x8')](),controller['destroy']);module[_0xfd86('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index a114289..0ee90d8 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 _0x6ec6=['sequelize'];(function(_0x520513,_0x53d9d2){var _0x5902d2=function(_0x2004c7){while(--_0x2004c7){_0x520513['push'](_0x520513['shift']());}};_0x5902d2(++_0x53d9d2);}(_0x6ec6,0x85));var _0x66ec=function(_0x5519a9,_0x1c5147){_0x5519a9=_0x5519a9-0x0;var _0x32f2cc=_0x6ec6[_0x5519a9];return _0x32f2cc;};'use strict';var Sequelize=require(_0x66ec('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x125c=['medium'];(function(_0x86216a,_0x309bdd){var _0x91fa34=function(_0xb63281){while(--_0xb63281){_0x86216a['push'](_0x86216a['shift']());}};_0x91fa34(++_0x309bdd);}(_0x125c,0xe6));var _0xc125=function(_0x1e6f94,_0x3c74fc){_0x1e6f94=_0x1e6f94-0x0;var _0x17ab58=_0x125c[_0x1e6f94];return _0x17ab58;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT'](_0xc125('0x0')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index c092f5f..cd7a2fb 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 _0xeda8=['update','destroy','then','error','stack','name','index','map','ChatOfflineMessage','fieldName','key','model','filters','intersection','fields','query','length','attributes','hasOwnProperty','nolimit','sort','pick','where','merge','type','filter','options','count','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','json','apply','reject','save'];(function(_0x64894,_0xc3d56c){var _0x28fc82=function(_0x28eadb){while(--_0x28eadb){_0x64894['push'](_0x64894['shift']());}};_0x28fc82(++_0xc3d56c);}(_0xeda8,0x104));var _0x8eda=function(_0x263c98,_0x1108e0){_0x263c98=_0x263c98-0x0;var _0x49e4e1=_0xeda8[_0x263c98];return _0x49e4e1;};'use strict';var pdf=require(_0x8eda('0x0'));var emlformat=require(_0x8eda('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8eda('0x2'));var jsonpatch=require(_0x8eda('0x3'));var rp=require(_0x8eda('0x4'));var moment=require(_0x8eda('0x5'));var BPromise=require(_0x8eda('0x6'));var Mustache=require(_0x8eda('0x7'));var util=require(_0x8eda('0x8'));var path=require(_0x8eda('0x9'));var sox=require(_0x8eda('0xa'));var csv=require(_0x8eda('0xb'));var ejs=require(_0x8eda('0xc'));var fs=require('fs');var _=require(_0x8eda('0xd'));var squel=require('squel');var crypto=require(_0x8eda('0xe'));var jsforce=require(_0x8eda('0xf'));var deskjs=require(_0x8eda('0x10'));var toCsv=require(_0x8eda('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8eda('0x11'));var as=require(_0x8eda('0x12'));var hardwareService=require(_0x8eda('0x13'));var logger=require('../../config/logger')(_0x8eda('0x14'));var utils=require('../../config/utils');var config=require(_0x8eda('0x15'));var db=require(_0x8eda('0x16'))['db'];function respondWithStatusCode(_0x2fdec0,_0x1ad3df){_0x1ad3df=_0x1ad3df||0xcc;return function(_0x337573){if(_0x337573){return _0x2fdec0[_0x8eda('0x17')](_0x1ad3df);}return _0x2fdec0[_0x8eda('0x18')](_0x1ad3df)[_0x8eda('0x19')]();};}function respondWithResult(_0x57957c,_0x500bd4){_0x500bd4=_0x500bd4||0xc8;return function(_0xe04d90){if(_0xe04d90){return _0x57957c[_0x8eda('0x18')](_0x500bd4)['json'](_0xe04d90);}};}function respondWithFilteredResult(_0x106a04,_0x34b1ee){return function(_0x123905){if(_0x123905){var _0x56ff8a=_0x123905['count'],_0x3f2925=_0x34b1ee[_0x8eda('0x1a')],_0x5594ad=_0x34b1ee['offset']+_0x34b1ee[_0x8eda('0x1b')],_0xf7d764;if(_0x5594ad>=_0x56ff8a){_0x5594ad=_0x56ff8a;_0xf7d764=0xc8;}else{_0xf7d764=0xce;}_0x106a04[_0x8eda('0x18')](_0xf7d764);return _0x106a04['set']('Content-Range',_0x3f2925+'-'+_0x5594ad+'/'+_0x56ff8a)[_0x8eda('0x1c')](_0x123905);}return null;};}function patchUpdates(_0x1b7e94){return function(_0x1b089d){try{jsonpatch[_0x8eda('0x1d')](_0x1b089d,_0x1b7e94,!![]);}catch(_0x110f36){return BPromise[_0x8eda('0x1e')](_0x110f36);}return _0x1b089d[_0x8eda('0x1f')]();};}function saveUpdates(_0x7081dd,_0x850cce){return function(_0x232786){if(_0x232786){return _0x232786[_0x8eda('0x20')](_0x7081dd)['then'](function(_0x33143e){return _0x33143e;});}return null;};}function removeEntity(_0x4f8483,_0x45517e){return function(_0x5183bc){if(_0x5183bc){return _0x5183bc[_0x8eda('0x21')]()[_0x8eda('0x22')](function(){_0x4f8483['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56dba4,_0x2a4c99){return function(_0x17cae8){if(!_0x17cae8){_0x56dba4['sendStatus'](0x194);}return _0x17cae8;};}function handleError(_0x978502,_0x37a8ab){_0x37a8ab=_0x37a8ab||0x1f4;return function(_0x54aa7f){logger[_0x8eda('0x23')](_0x54aa7f[_0x8eda('0x24')]);if(_0x54aa7f[_0x8eda('0x25')]){delete _0x54aa7f[_0x8eda('0x25')];}_0x978502[_0x8eda('0x18')](_0x37a8ab)['send'](_0x54aa7f);};}exports[_0x8eda('0x26')]=function(_0x5a8bed,_0x35310c){var _0x2e8b2b={},_0x8337b4={},_0x567f69={'count':0x0,'rows':[]};var _0x23e892=_[_0x8eda('0x27')](db[_0x8eda('0x28')]['rawAttributes'],function(_0x1616ea){return{'name':_0x1616ea[_0x8eda('0x29')],'type':_0x1616ea['type'][_0x8eda('0x2a')]};});_0x8337b4[_0x8eda('0x2b')]=_[_0x8eda('0x27')](_0x23e892,_0x8eda('0x25'));_0x8337b4['query']=_['keys'](_0x5a8bed['query']);_0x8337b4[_0x8eda('0x2c')]=_[_0x8eda('0x2d')](_0x8337b4[_0x8eda('0x2b')],_0x8337b4['query']);_0x2e8b2b['attributes']=_['intersection'](_0x8337b4[_0x8eda('0x2b')],qs[_0x8eda('0x2e')](_0x5a8bed[_0x8eda('0x2f')]['fields']));_0x2e8b2b['attributes']=_0x2e8b2b['attributes'][_0x8eda('0x30')]?_0x2e8b2b[_0x8eda('0x31')]:_0x8337b4[_0x8eda('0x2b')];if(!_0x5a8bed[_0x8eda('0x2f')][_0x8eda('0x32')](_0x8eda('0x33'))){_0x2e8b2b[_0x8eda('0x1b')]=qs[_0x8eda('0x1b')](_0x5a8bed[_0x8eda('0x2f')][_0x8eda('0x1b')]);_0x2e8b2b[_0x8eda('0x1a')]=qs[_0x8eda('0x1a')](_0x5a8bed[_0x8eda('0x2f')][_0x8eda('0x1a')]);}_0x2e8b2b['order']=qs[_0x8eda('0x34')](_0x5a8bed[_0x8eda('0x2f')][_0x8eda('0x34')]);_0x2e8b2b['where']=qs['filters'](_[_0x8eda('0x35')](_0x5a8bed[_0x8eda('0x2f')],_0x8337b4[_0x8eda('0x2c')]),_0x23e892);if(_0x5a8bed[_0x8eda('0x2f')]['filter']){_0x2e8b2b[_0x8eda('0x36')]=_[_0x8eda('0x37')](_0x2e8b2b[_0x8eda('0x36')],{'$or':_[_0x8eda('0x27')](_0x23e892,function(_0x567aa6){if(_0x567aa6[_0x8eda('0x38')]!=='VIRTUAL'){var _0x331d95={};_0x331d95[_0x567aa6[_0x8eda('0x25')]]={'$like':'%'+_0x5a8bed[_0x8eda('0x2f')][_0x8eda('0x39')]+'%'};return _0x331d95;}})});}_0x2e8b2b=_[_0x8eda('0x37')]({},_0x2e8b2b,_0x5a8bed[_0x8eda('0x3a')]);var _0x54e1db={'where':_0x2e8b2b[_0x8eda('0x36')]};return db[_0x8eda('0x28')][_0x8eda('0x3b')](_0x54e1db)[_0x8eda('0x22')](function(_0xa1e556){_0x567f69['count']=_0xa1e556;if(_0x5a8bed[_0x8eda('0x2f')][_0x8eda('0x3c')]){_0x2e8b2b[_0x8eda('0x3d')]=[{'all':!![]}];}return db['ChatOfflineMessage'][_0x8eda('0x3e')](_0x2e8b2b);})['then'](function(_0x293683){_0x567f69[_0x8eda('0x3f')]=_0x293683;return _0x567f69;})[_0x8eda('0x22')](respondWithFilteredResult(_0x35310c,_0x2e8b2b))[_0x8eda('0x40')](handleError(_0x35310c,null));};exports[_0x8eda('0x41')]=function(_0x5cdc89,_0x49d513){var _0xbf14a1={'raw':!![],'where':{'id':_0x5cdc89[_0x8eda('0x42')]['id']}},_0xfcb278={};_0xfcb278[_0x8eda('0x2b')]=_[_0x8eda('0x43')](db[_0x8eda('0x28')][_0x8eda('0x44')]);_0xfcb278[_0x8eda('0x2f')]=_[_0x8eda('0x43')](_0x5cdc89[_0x8eda('0x2f')]);_0xfcb278[_0x8eda('0x2c')]=_[_0x8eda('0x2d')](_0xfcb278[_0x8eda('0x2b')],_0xfcb278[_0x8eda('0x2f')]);_0xbf14a1[_0x8eda('0x31')]=_[_0x8eda('0x2d')](_0xfcb278[_0x8eda('0x2b')],qs[_0x8eda('0x2e')](_0x5cdc89[_0x8eda('0x2f')]['fields']));_0xbf14a1[_0x8eda('0x31')]=_0xbf14a1[_0x8eda('0x31')]['length']?_0xbf14a1[_0x8eda('0x31')]:_0xfcb278[_0x8eda('0x2b')];if(_0x5cdc89['query'][_0x8eda('0x3c')]){_0xbf14a1[_0x8eda('0x3d')]=[{'all':!![]}];}_0xbf14a1=_['merge']({},_0xbf14a1,_0x5cdc89[_0x8eda('0x3a')]);return db[_0x8eda('0x28')][_0x8eda('0x45')](_0xbf14a1)['then'](handleEntityNotFound(_0x49d513,null))[_0x8eda('0x22')](respondWithResult(_0x49d513,null))[_0x8eda('0x40')](handleError(_0x49d513,null));};exports[_0x8eda('0x46')]=function(_0xd8b8f4,_0x1fb1a8){return db[_0x8eda('0x28')][_0x8eda('0x46')](_0xd8b8f4['body'],{})[_0x8eda('0x22')](respondWithResult(_0x1fb1a8,0xc9))['catch'](handleError(_0x1fb1a8,null));};exports[_0x8eda('0x20')]=function(_0x52b026,_0x1a64e8){if(_0x52b026['body']['id']){delete _0x52b026[_0x8eda('0x47')]['id'];}return db['ChatOfflineMessage'][_0x8eda('0x45')]({'where':{'id':_0x52b026[_0x8eda('0x42')]['id']}})[_0x8eda('0x22')](handleEntityNotFound(_0x1a64e8,null))[_0x8eda('0x22')](saveUpdates(_0x52b026[_0x8eda('0x47')],null))[_0x8eda('0x22')](respondWithResult(_0x1a64e8,null))[_0x8eda('0x40')](handleError(_0x1a64e8,null));};exports[_0x8eda('0x21')]=function(_0x1f8f23,_0x17518f){return db[_0x8eda('0x28')][_0x8eda('0x45')]({'where':{'id':_0x1f8f23['params']['id']}})[_0x8eda('0x22')](handleEntityNotFound(_0x17518f,null))[_0x8eda('0x22')](removeEntity(_0x17518f,null))[_0x8eda('0x40')](handleError(_0x17518f,null));};exports[_0x8eda('0x48')]=function(_0x33ba39,_0x389399){return db[_0x8eda('0x28')][_0x8eda('0x48')]()[_0x8eda('0x22')](respondWithResult(_0x389399,null))[_0x8eda('0x40')](handleError(_0x389399,null));}; \ No newline at end of file +var _0x8f9d=['findAll','show','params','length','find','catch','create','body','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','limit','set','json','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','rawAttributes','fieldName','type','model','map','keys','filters','intersection','query','fields','attributes','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include'];(function(_0x490be3,_0xf0fca3){var _0x3f5140=function(_0x15fa80){while(--_0x15fa80){_0x490be3['push'](_0x490be3['shift']());}};_0x3f5140(++_0xf0fca3);}(_0x8f9d,0x93));var _0xd8f9=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8f9d[_0x4a9fb1];return _0x348672;};'use strict';var pdf=require(_0xd8f9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd8f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8f9('0x2'));var rp=require(_0xd8f9('0x3'));var moment=require(_0xd8f9('0x4'));var BPromise=require(_0xd8f9('0x5'));var Mustache=require(_0xd8f9('0x6'));var util=require(_0xd8f9('0x7'));var path=require(_0xd8f9('0x8'));var sox=require('sox');var csv=require(_0xd8f9('0x9'));var ejs=require(_0xd8f9('0xa'));var fs=require('fs');var _=require(_0xd8f9('0xb'));var squel=require(_0xd8f9('0xc'));var crypto=require(_0xd8f9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xd8f9('0xe'));var toCsv=require(_0xd8f9('0x9'));var querystring=require('querystring');var Papa=require(_0xd8f9('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd8f9('0x10'));var as=require(_0xd8f9('0x11'));var hardwareService=require(_0xd8f9('0x12'));var logger=require(_0xd8f9('0x13'))(_0xd8f9('0x14'));var utils=require(_0xd8f9('0x15'));var config=require(_0xd8f9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a214b,_0x56e0d6){_0x56e0d6=_0x56e0d6||0xcc;return function(_0x39aca0){if(_0x39aca0){return _0x3a214b[_0xd8f9('0x17')](_0x56e0d6);}return _0x3a214b[_0xd8f9('0x18')](_0x56e0d6)['end']();};}function respondWithResult(_0x46468b,_0x3df6d2){_0x3df6d2=_0x3df6d2||0xc8;return function(_0x4cfebf){if(_0x4cfebf){return _0x46468b[_0xd8f9('0x18')](_0x3df6d2)['json'](_0x4cfebf);}};}function respondWithFilteredResult(_0x3529e9,_0x1525d6){return function(_0x234901){if(_0x234901){var _0x10369c=_0x234901['count'],_0x3a3a41=_0x1525d6['offset'],_0x19603a=_0x1525d6[_0xd8f9('0x19')]+_0x1525d6[_0xd8f9('0x1a')],_0x566448;if(_0x19603a>=_0x10369c){_0x19603a=_0x10369c;_0x566448=0xc8;}else{_0x566448=0xce;}_0x3529e9['status'](_0x566448);return _0x3529e9[_0xd8f9('0x1b')]('Content-Range',_0x3a3a41+'-'+_0x19603a+'/'+_0x10369c)[_0xd8f9('0x1c')](_0x234901);}return null;};}function patchUpdates(_0x49f2e7){return function(_0x4cf93a){try{jsonpatch['apply'](_0x4cf93a,_0x49f2e7,!![]);}catch(_0xa3b0cd){return BPromise['reject'](_0xa3b0cd);}return _0x4cf93a[_0xd8f9('0x1d')]();};}function saveUpdates(_0xef802d,_0x58ea35){return function(_0x3204b3){if(_0x3204b3){return _0x3204b3[_0xd8f9('0x1e')](_0xef802d)[_0xd8f9('0x1f')](function(_0x5863ad){return _0x5863ad;});}return null;};}function removeEntity(_0x1de3cc,_0x260807){return function(_0x164bf6){if(_0x164bf6){return _0x164bf6[_0xd8f9('0x20')]()[_0xd8f9('0x1f')](function(){_0x1de3cc[_0xd8f9('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39fedc,_0xbd09da){return function(_0x1fcd45){if(!_0x1fcd45){_0x39fedc[_0xd8f9('0x17')](0x194);}return _0x1fcd45;};}function handleError(_0x290553,_0x4c0002){_0x4c0002=_0x4c0002||0x1f4;return function(_0xcc9b18){logger[_0xd8f9('0x21')](_0xcc9b18[_0xd8f9('0x22')]);if(_0xcc9b18[_0xd8f9('0x23')]){delete _0xcc9b18[_0xd8f9('0x23')];}_0x290553[_0xd8f9('0x18')](_0x4c0002)[_0xd8f9('0x24')](_0xcc9b18);};}exports[_0xd8f9('0x25')]=function(_0x4aab29,_0x464a6a){var _0x4764d9={},_0x3967fb={},_0x58a3ca={'count':0x0,'rows':[]};var _0x5bd32e=_['map'](db[_0xd8f9('0x26')][_0xd8f9('0x27')],function(_0x5050a4){return{'name':_0x5050a4[_0xd8f9('0x28')],'type':_0x5050a4[_0xd8f9('0x29')]['key']};});_0x3967fb[_0xd8f9('0x2a')]=_[_0xd8f9('0x2b')](_0x5bd32e,_0xd8f9('0x23'));_0x3967fb['query']=_[_0xd8f9('0x2c')](_0x4aab29['query']);_0x3967fb[_0xd8f9('0x2d')]=_[_0xd8f9('0x2e')](_0x3967fb['model'],_0x3967fb[_0xd8f9('0x2f')]);_0x4764d9['attributes']=_[_0xd8f9('0x2e')](_0x3967fb[_0xd8f9('0x2a')],qs[_0xd8f9('0x30')](_0x4aab29[_0xd8f9('0x2f')][_0xd8f9('0x30')]));_0x4764d9[_0xd8f9('0x31')]=_0x4764d9[_0xd8f9('0x31')]['length']?_0x4764d9[_0xd8f9('0x31')]:_0x3967fb['model'];if(!_0x4aab29['query']['hasOwnProperty']('nolimit')){_0x4764d9[_0xd8f9('0x1a')]=qs[_0xd8f9('0x1a')](_0x4aab29[_0xd8f9('0x2f')][_0xd8f9('0x1a')]);_0x4764d9[_0xd8f9('0x19')]=qs['offset'](_0x4aab29['query'][_0xd8f9('0x19')]);}_0x4764d9[_0xd8f9('0x32')]=qs['sort'](_0x4aab29[_0xd8f9('0x2f')][_0xd8f9('0x33')]);_0x4764d9[_0xd8f9('0x34')]=qs['filters'](_['pick'](_0x4aab29['query'],_0x3967fb['filters']),_0x5bd32e);if(_0x4aab29[_0xd8f9('0x2f')][_0xd8f9('0x35')]){_0x4764d9[_0xd8f9('0x34')]=_[_0xd8f9('0x36')](_0x4764d9[_0xd8f9('0x34')],{'$or':_['map'](_0x5bd32e,function(_0x3333ea){if(_0x3333ea[_0xd8f9('0x29')]!==_0xd8f9('0x37')){var _0xb9ba18={};_0xb9ba18[_0x3333ea[_0xd8f9('0x23')]]={'$like':'%'+_0x4aab29[_0xd8f9('0x2f')][_0xd8f9('0x35')]+'%'};return _0xb9ba18;}})});}_0x4764d9=_[_0xd8f9('0x36')]({},_0x4764d9,_0x4aab29[_0xd8f9('0x38')]);var _0x1953af={'where':_0x4764d9[_0xd8f9('0x34')]};return db['ChatOfflineMessage'][_0xd8f9('0x39')](_0x1953af)[_0xd8f9('0x1f')](function(_0x149530){_0x58a3ca[_0xd8f9('0x39')]=_0x149530;if(_0x4aab29['query'][_0xd8f9('0x3a')]){_0x4764d9[_0xd8f9('0x3b')]=[{'all':!![]}];}return db[_0xd8f9('0x26')][_0xd8f9('0x3c')](_0x4764d9);})[_0xd8f9('0x1f')](function(_0x23330a){_0x58a3ca['rows']=_0x23330a;return _0x58a3ca;})['then'](respondWithFilteredResult(_0x464a6a,_0x4764d9))['catch'](handleError(_0x464a6a,null));};exports[_0xd8f9('0x3d')]=function(_0x293179,_0x39d0d1){var _0x1d8e5d={'raw':!![],'where':{'id':_0x293179[_0xd8f9('0x3e')]['id']}},_0x9af000={};_0x9af000[_0xd8f9('0x2a')]=_[_0xd8f9('0x2c')](db[_0xd8f9('0x26')]['rawAttributes']);_0x9af000['query']=_[_0xd8f9('0x2c')](_0x293179[_0xd8f9('0x2f')]);_0x9af000[_0xd8f9('0x2d')]=_['intersection'](_0x9af000['model'],_0x9af000[_0xd8f9('0x2f')]);_0x1d8e5d[_0xd8f9('0x31')]=_[_0xd8f9('0x2e')](_0x9af000['model'],qs[_0xd8f9('0x30')](_0x293179[_0xd8f9('0x2f')][_0xd8f9('0x30')]));_0x1d8e5d[_0xd8f9('0x31')]=_0x1d8e5d[_0xd8f9('0x31')][_0xd8f9('0x3f')]?_0x1d8e5d[_0xd8f9('0x31')]:_0x9af000[_0xd8f9('0x2a')];if(_0x293179[_0xd8f9('0x2f')]['includeAll']){_0x1d8e5d['include']=[{'all':!![]}];}_0x1d8e5d=_['merge']({},_0x1d8e5d,_0x293179[_0xd8f9('0x38')]);return db[_0xd8f9('0x26')][_0xd8f9('0x40')](_0x1d8e5d)[_0xd8f9('0x1f')](handleEntityNotFound(_0x39d0d1,null))[_0xd8f9('0x1f')](respondWithResult(_0x39d0d1,null))[_0xd8f9('0x41')](handleError(_0x39d0d1,null));};exports[_0xd8f9('0x42')]=function(_0x26b892,_0x26527c){return db[_0xd8f9('0x26')][_0xd8f9('0x42')](_0x26b892[_0xd8f9('0x43')],{})[_0xd8f9('0x1f')](respondWithResult(_0x26527c,0xc9))['catch'](handleError(_0x26527c,null));};exports[_0xd8f9('0x1e')]=function(_0x1cc33e,_0x417be0){if(_0x1cc33e[_0xd8f9('0x43')]['id']){delete _0x1cc33e['body']['id'];}return db[_0xd8f9('0x26')]['find']({'where':{'id':_0x1cc33e['params']['id']}})[_0xd8f9('0x1f')](handleEntityNotFound(_0x417be0,null))[_0xd8f9('0x1f')](saveUpdates(_0x1cc33e[_0xd8f9('0x43')],null))[_0xd8f9('0x1f')](respondWithResult(_0x417be0,null))[_0xd8f9('0x41')](handleError(_0x417be0,null));};exports[_0xd8f9('0x20')]=function(_0x2fd4d3,_0xaad657){return db[_0xd8f9('0x26')][_0xd8f9('0x40')]({'where':{'id':_0x2fd4d3['params']['id']}})['then'](handleEntityNotFound(_0xaad657,null))['then'](removeEntity(_0xaad657,null))[_0xd8f9('0x41')](handleError(_0xaad657,null));};exports[_0xd8f9('0x44')]=function(_0x4965d0,_0x21e1fb){return db[_0xd8f9('0x26')][_0xd8f9('0x44')]()[_0xd8f9('0x1f')](respondWithResult(_0x21e1fb,null))[_0xd8f9('0x41')](handleError(_0x21e1fb,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 04f125a..265f9ad 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 _0x4707=['request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','chat_offline_messages','utf8mb4','moment','bluebird'];(function(_0x280bef,_0x5e1bd3){var _0x56dc85=function(_0x533dfe){while(--_0x533dfe){_0x280bef['push'](_0x280bef['shift']());}};_0x56dc85(++_0x5e1bd3);}(_0x4707,0x1ca));var _0x7470=function(_0x5d0554,_0x59abea){_0x5d0554=_0x5d0554-0x0;var _0x4a9733=_0x4707[_0x5d0554];return _0x4a9733;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x7470('0x0'));var BPromise=require(_0x7470('0x1'));var rp=require(_0x7470('0x2'));var fs=require('fs');var path=require(_0x7470('0x3'));var rimraf=require(_0x7470('0x4'));var config=require(_0x7470('0x5'));var attributes=require(_0x7470('0x6'));module[_0x7470('0x7')]=function(_0x497984,_0x4d3701){return _0x497984['define']('ChatOfflineMessage',attributes,{'tableName':_0x7470('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7470('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xe84a=['path','rimraf','../../config/environment','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise'];(function(_0x52e94f,_0x22e52d){var _0x127d43=function(_0x423f67){while(--_0x423f67){_0x52e94f['push'](_0x52e94f['shift']());}};_0x127d43(++_0x22e52d);}(_0xe84a,0x1ad));var _0xae84=function(_0x482672,_0x49d13c){_0x482672=_0x482672-0x0;var _0x32236b=_0xe84a[_0x482672];return _0x32236b;};'use strict';var _=require(_0xae84('0x0'));var util=require(_0xae84('0x1'));var logger=require('../../config/logger')(_0xae84('0x2'));var moment=require(_0xae84('0x3'));var BPromise=require(_0xae84('0x4'));var rp=require(_0xae84('0x5'));var fs=require('fs');var path=require(_0xae84('0x6'));var rimraf=require(_0xae84('0x7'));var config=require(_0xae84('0x8'));var attributes=require('./chatOfflineMessage.attributes');module[_0xae84('0x9')]=function(_0x767d52,_0x36e6e4){return _0x767d52[_0xae84('0xa')](_0xae84('0xb'),attributes,{'tableName':_0xae84('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xae84('0xd'),'collate':_0xae84('0xe')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 7f0dbb9..f148bf8 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 _0x4640=['stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4d2d14,_0x34488c){var _0x3ea594=function(_0xd968cf){while(--_0xd968cf){_0x4d2d14['push'](_0x4d2d14['shift']());}};_0x3ea594(++_0x34488c);}(_0x4640,0x6f));var _0x0464=function(_0x1c4bcc,_0x260861){_0x1c4bcc=_0x1c4bcc-0x0;var _0x4197a2=_0x4640[_0x1c4bcc];return _0x4197a2;};'use strict';var _=require(_0x0464('0x0'));var util=require(_0x0464('0x1'));var moment=require(_0x0464('0x2'));var BPromise=require('bluebird');var rs=require(_0x0464('0x3'));var fs=require('fs');var Redis=require(_0x0464('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0464('0x5'));var logger=require(_0x0464('0x6'))('rpc');var config=require(_0x0464('0x7'));var jayson=require(_0x0464('0x8'));var client=jayson['client'][_0x0464('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a7909,_0x12ff8a,_0x1d2e84){return new BPromise(function(_0x11c568,_0x22b5fa){return client[_0x0464('0xa')](_0x2a7909,_0x1d2e84)[_0x0464('0xb')](function(_0x4f7f97){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x12ff8a,_0x0464('0xc'));logger[_0x0464('0xd')](_0x0464('0xe'),_0x12ff8a,_0x0464('0xc'),JSON[_0x0464('0xf')](_0x4f7f97));if(_0x4f7f97[_0x0464('0x10')]){if(_0x4f7f97['error'][_0x0464('0x11')]===0x1f4){logger[_0x0464('0x10')](_0x0464('0x12'),_0x12ff8a,_0x4f7f97[_0x0464('0x10')][_0x0464('0x13')]);return _0x22b5fa(_0x4f7f97['error'][_0x0464('0x13')]);}logger[_0x0464('0x10')](_0x0464('0x12'),_0x12ff8a,_0x4f7f97[_0x0464('0x10')][_0x0464('0x13')]);return _0x11c568(_0x4f7f97[_0x0464('0x10')][_0x0464('0x13')]);}else{logger['info'](_0x0464('0x12'),_0x12ff8a,'request\x20sent');_0x11c568(_0x4f7f97[_0x0464('0x14')][_0x0464('0x13')]);}})['catch'](function(_0x12a5ae){logger[_0x0464('0x10')](_0x0464('0x12'),_0x12ff8a,_0x12a5ae);_0x22b5fa(_0x12a5ae);});});} \ No newline at end of file +var _0x4823=['error','code','message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x42fe4f,_0xe17a9a){var _0x376656=function(_0x5e3523){while(--_0x5e3523){_0x42fe4f['push'](_0x42fe4f['shift']());}};_0x376656(++_0xe17a9a);}(_0x4823,0x1e9));var _0x3482=function(_0x9edfd5,_0x286486){_0x9edfd5=_0x9edfd5-0x0;var _0x330738=_0x4823[_0x9edfd5];return _0x330738;};'use strict';var _=require(_0x3482('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3482('0x1'));var rs=require(_0x3482('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3482('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3482('0x4'))(_0x3482('0x5'));var config=require(_0x3482('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3482('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x569cfa,_0x553ced,_0x329ac1){return new BPromise(function(_0x53df07,_0xdd2ecd){return client[_0x3482('0x8')](_0x569cfa,_0x329ac1)[_0x3482('0x9')](function(_0x565fb6){logger['info'](_0x3482('0xa'),_0x553ced,_0x3482('0xb'));logger[_0x3482('0xc')](_0x3482('0xd'),_0x553ced,'request\x20sent',JSON[_0x3482('0xe')](_0x565fb6));if(_0x565fb6[_0x3482('0xf')]){if(_0x565fb6[_0x3482('0xf')][_0x3482('0x10')]===0x1f4){logger[_0x3482('0xf')](_0x3482('0xa'),_0x553ced,_0x565fb6[_0x3482('0xf')][_0x3482('0x11')]);return _0xdd2ecd(_0x565fb6[_0x3482('0xf')][_0x3482('0x11')]);}logger['error'](_0x3482('0xa'),_0x553ced,_0x565fb6[_0x3482('0xf')][_0x3482('0x11')]);return _0x53df07(_0x565fb6[_0x3482('0xf')][_0x3482('0x11')]);}else{logger[_0x3482('0x12')](_0x3482('0xa'),_0x553ced,_0x3482('0xb'));_0x53df07(_0x565fb6[_0x3482('0x13')][_0x3482('0x11')]);}})[_0x3482('0x14')](function(_0x5e006a){logger[_0x3482('0xf')](_0x3482('0xa'),_0x553ced,_0x5e006a);_0xdd2ecd(_0x5e006a);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index b34bea8..35f80c3 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 _0xe0a2=['express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','describe','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x53fcb7,_0x481924){var _0x4fcfc2=function(_0x4e5f9e){while(--_0x4e5f9e){_0x53fcb7['push'](_0x53fcb7['shift']());}};_0x4fcfc2(++_0x481924);}(_0xe0a2,0x19e));var _0x2e0a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe0a2[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x2e0a('0x0'));var util=require(_0x2e0a('0x1'));var path=require(_0x2e0a('0x2'));var timeout=require(_0x2e0a('0x3'));var express=require(_0x2e0a('0x4'));var router=express[_0x2e0a('0x5')]();var auth=require(_0x2e0a('0x6'));var interaction=require(_0x2e0a('0x7'));var config=require('../../config/environment');var controller=require(_0x2e0a('0x8'));router[_0x2e0a('0x9')]('/',auth[_0x2e0a('0xa')](),controller['index']);router[_0x2e0a('0x9')]('/describe',auth[_0x2e0a('0xa')](),controller[_0x2e0a('0xb')]);router[_0x2e0a('0x9')](_0x2e0a('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x2e0a('0xa')](),controller[_0x2e0a('0xd')]);router[_0x2e0a('0xe')](_0x2e0a('0xc'),auth[_0x2e0a('0xa')](),controller[_0x2e0a('0xf')]);router[_0x2e0a('0x10')](_0x2e0a('0xc'),auth[_0x2e0a('0xa')](),controller[_0x2e0a('0x11')]);module[_0x2e0a('0x12')]=router; \ No newline at end of file +var _0xcbb2=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','exports','path','../../components/interaction/service','../../config/environment'];(function(_0x4a4563,_0x2771c3){var _0x201be1=function(_0x32505c){while(--_0x32505c){_0x4a4563['push'](_0x4a4563['shift']());}};_0x201be1(++_0x2771c3);}(_0xcbb2,0x129));var _0x2cbb=function(_0x1a8ef6,_0x251f7b){_0x1a8ef6=_0x1a8ef6-0x0;var _0x2147ab=_0xcbb2[_0x1a8ef6];return _0x2147ab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2cbb('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2cbb('0x1'));var config=require(_0x2cbb('0x2'));var controller=require(_0x2cbb('0x3'));router[_0x2cbb('0x4')]('/',auth[_0x2cbb('0x5')](),controller[_0x2cbb('0x6')]);router[_0x2cbb('0x4')](_0x2cbb('0x7'),auth[_0x2cbb('0x5')](),controller[_0x2cbb('0x8')]);router[_0x2cbb('0x4')](_0x2cbb('0x9'),auth[_0x2cbb('0x5')](),controller[_0x2cbb('0xa')]);router['post']('/',auth[_0x2cbb('0x5')](),controller['create']);router[_0x2cbb('0xb')](_0x2cbb('0x9'),auth[_0x2cbb('0x5')](),controller[_0x2cbb('0xc')]);router[_0x2cbb('0xd')]('/:id',auth[_0x2cbb('0x5')](),controller['destroy']);module[_0x2cbb('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 69f9b62..5e771aa 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 _0x3018=['STRING','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x594f36,_0x3ae5f9){var _0xbcaab9=function(_0x117715){while(--_0x117715){_0x594f36['push'](_0x594f36['shift']());}};_0xbcaab9(++_0x3ae5f9);}(_0x3018,0x190));var _0x8301=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x3018[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x8301('0x0'));module[_0x8301('0x1')]={'name':{'type':Sequelize[_0x8301('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8301('0x3'),_0x8301('0x4')),'defaultValue':_0x8301('0x3')},'selector':{'type':Sequelize[_0x8301('0x2')]},'timeout':{'type':Sequelize[_0x8301('0x5')]}}; \ No newline at end of file +var _0x1442=['ENUM','mouseOver','INTEGER','sequelize','STRING'];(function(_0x2749ea,_0x44e45f){var _0x36b5b6=function(_0x154987){while(--_0x154987){_0x2749ea['push'](_0x2749ea['shift']());}};_0x36b5b6(++_0x44e45f);}(_0x1442,0x116));var _0x2144=function(_0x40a4c2,_0x5a72c6){_0x40a4c2=_0x40a4c2-0x0;var _0x4d0d44=_0x1442[_0x40a4c2];return _0x4d0d44;};'use strict';var Sequelize=require(_0x2144('0x0'));module['exports']={'name':{'type':Sequelize[_0x2144('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x2144('0x2')](_0x2144('0x3'),'timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x2144('0x1')]},'timeout':{'type':Sequelize[_0x2144('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index d16c5ba..6a292b8 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 _0xedd9=['offset','limit','Content-Range','reject','update','then','destroy','error','stack','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','include','merge','options','find','catch','create','ChatProactiveAction','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xedd9,0xfc));var _0x9edd=function(_0x4b37e7,_0x285218){_0x4b37e7=_0x4b37e7-0x0;var _0x2f5b90=_0xedd9[_0x4b37e7];return _0x2f5b90;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');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('0xa'));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 db=require(_0x9edd('0x16'))['db'];function respondWithStatusCode(_0x25e64c,_0xfd544a){_0xfd544a=_0xfd544a||0xcc;return function(_0x287ddd){if(_0x287ddd){return _0x25e64c[_0x9edd('0x17')](_0xfd544a);}return _0x25e64c[_0x9edd('0x18')](_0xfd544a)[_0x9edd('0x19')]();};}function respondWithResult(_0x47eb64,_0x176bfa){_0x176bfa=_0x176bfa||0xc8;return function(_0x44fc7c){if(_0x44fc7c){return _0x47eb64[_0x9edd('0x18')](_0x176bfa)[_0x9edd('0x1a')](_0x44fc7c);}};}function respondWithFilteredResult(_0x13b6b6,_0x338f3c){return function(_0x1042aa){if(_0x1042aa){var _0x75a4ab=_0x1042aa[_0x9edd('0x1b')],_0x4ea60f=_0x338f3c['offset'],_0x5f5bf4=_0x338f3c[_0x9edd('0x1c')]+_0x338f3c[_0x9edd('0x1d')],_0x448996;if(_0x5f5bf4>=_0x75a4ab){_0x5f5bf4=_0x75a4ab;_0x448996=0xc8;}else{_0x448996=0xce;}_0x13b6b6[_0x9edd('0x18')](_0x448996);return _0x13b6b6['set'](_0x9edd('0x1e'),_0x4ea60f+'-'+_0x5f5bf4+'/'+_0x75a4ab)['json'](_0x1042aa);}return null;};}function patchUpdates(_0x2cdcef){return function(_0x1083e4){try{jsonpatch['apply'](_0x1083e4,_0x2cdcef,!![]);}catch(_0x498977){return BPromise[_0x9edd('0x1f')](_0x498977);}return _0x1083e4['save']();};}function saveUpdates(_0x27a95a,_0x54a03f){return function(_0x535f37){if(_0x535f37){return _0x535f37[_0x9edd('0x20')](_0x27a95a)[_0x9edd('0x21')](function(_0x4fb7bf){return _0x4fb7bf;});}return null;};}function removeEntity(_0x5823bc,_0x341d67){return function(_0x186186){if(_0x186186){return _0x186186[_0x9edd('0x22')]()['then'](function(){_0x5823bc[_0x9edd('0x18')](0xcc)[_0x9edd('0x19')]();});}};}function handleEntityNotFound(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(!_0x339a0d){_0x44a6c1['sendStatus'](0x194);}return _0x339a0d;};}function handleError(_0x46c383,_0xeaf55a){_0xeaf55a=_0xeaf55a||0x1f4;return function(_0x3a1ea5){logger[_0x9edd('0x23')](_0x3a1ea5[_0x9edd('0x24')]);if(_0x3a1ea5['name']){delete _0x3a1ea5['name'];}_0x46c383[_0x9edd('0x18')](_0xeaf55a)[_0x9edd('0x25')](_0x3a1ea5);};}exports[_0x9edd('0x26')]=function(_0x25e135,_0x3c2227){var _0x4fe471={'raw':!![],'where':{'id':_0x25e135[_0x9edd('0x27')]['id']}},_0x57a2cc={};_0x57a2cc[_0x9edd('0x28')]=_[_0x9edd('0x29')](db['ChatProactiveAction'][_0x9edd('0x2a')]);_0x57a2cc[_0x9edd('0x2b')]=_[_0x9edd('0x29')](_0x25e135[_0x9edd('0x2b')]);_0x57a2cc['filters']=_[_0x9edd('0x2c')](_0x57a2cc[_0x9edd('0x28')],_0x57a2cc[_0x9edd('0x2b')]);_0x4fe471[_0x9edd('0x2d')]=_[_0x9edd('0x2c')](_0x57a2cc[_0x9edd('0x28')],qs[_0x9edd('0x2e')](_0x25e135[_0x9edd('0x2b')][_0x9edd('0x2e')]));_0x4fe471[_0x9edd('0x2d')]=_0x4fe471[_0x9edd('0x2d')][_0x9edd('0x2f')]?_0x4fe471[_0x9edd('0x2d')]:_0x57a2cc[_0x9edd('0x28')];if(_0x25e135[_0x9edd('0x2b')]['includeAll']){_0x4fe471[_0x9edd('0x30')]=[{'all':!![]}];}_0x4fe471=_[_0x9edd('0x31')]({},_0x4fe471,_0x25e135[_0x9edd('0x32')]);return db['ChatProactiveAction'][_0x9edd('0x33')](_0x4fe471)[_0x9edd('0x21')](handleEntityNotFound(_0x3c2227,null))[_0x9edd('0x21')](respondWithResult(_0x3c2227,null))[_0x9edd('0x34')](handleError(_0x3c2227,null));};exports[_0x9edd('0x35')]=function(_0x2bc4ed,_0x473068){return db[_0x9edd('0x36')][_0x9edd('0x35')](_0x2bc4ed[_0x9edd('0x37')],{})[_0x9edd('0x21')](respondWithResult(_0x473068,0xc9))[_0x9edd('0x34')](handleError(_0x473068,null));};exports[_0x9edd('0x20')]=function(_0x14f780,_0x5757fc){if(_0x14f780[_0x9edd('0x37')]['id']){delete _0x14f780['body']['id'];}return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'id':_0x14f780[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x5757fc,null))[_0x9edd('0x21')](saveUpdates(_0x14f780['body'],null))[_0x9edd('0x21')](respondWithResult(_0x5757fc,null))[_0x9edd('0x34')](handleError(_0x5757fc,null));};exports[_0x9edd('0x22')]=function(_0x38e9be,_0x1be77f){return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'id':_0x38e9be[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x1be77f,null))[_0x9edd('0x21')](removeEntity(_0x1be77f,null))['catch'](handleError(_0x1be77f,null));}; \ No newline at end of file +var _0x70e0=['mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','options','catch','create','body','find','html-pdf','eml-format','rimraf','request-promise','moment','bluebird'];(function(_0x19466f,_0x11ea13){var _0x39af35=function(_0x145dad){while(--_0x145dad){_0x19466f['push'](_0x19466f['shift']());}};_0x39af35(++_0x11ea13);}(_0x70e0,0x17b));var _0x070e=function(_0x151e76,_0x1678c2){_0x151e76=_0x151e76-0x0;var _0x32c7e3=_0x70e0[_0x151e76];return _0x32c7e3;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={'raw':!![],'where':{'id':_0x1743cc[_0x070e('0x26')]['id']}},_0x374c54={};_0x374c54[_0x070e('0x27')]=_[_0x070e('0x28')](db[_0x070e('0x29')][_0x070e('0x2a')]);_0x374c54[_0x070e('0x2b')]=_[_0x070e('0x28')](_0x1743cc['query']);_0x374c54[_0x070e('0x2c')]=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],_0x374c54['query']);_0x497f58['attributes']=_[_0x070e('0x2d')](_0x374c54[_0x070e('0x27')],qs[_0x070e('0x2e')](_0x1743cc['query'][_0x070e('0x2e')]));_0x497f58[_0x070e('0x2f')]=_0x497f58[_0x070e('0x2f')][_0x070e('0x30')]?_0x497f58['attributes']:_0x374c54['model'];if(_0x1743cc['query']['includeAll']){_0x497f58[_0x070e('0x31')]=[{'all':!![]}];}_0x497f58=_['merge']({},_0x497f58,_0x1743cc[_0x070e('0x32')]);return db[_0x070e('0x29')]['find'](_0x497f58)['then'](handleEntityNotFound(_0x4763c6,null))[_0x070e('0x20')](respondWithResult(_0x4763c6,null))[_0x070e('0x33')](handleError(_0x4763c6,null));};exports['create']=function(_0x546a16,_0x41ade4){return db[_0x070e('0x29')][_0x070e('0x34')](_0x546a16[_0x070e('0x35')],{})[_0x070e('0x20')](respondWithResult(_0x41ade4,0xc9))['catch'](handleError(_0x41ade4,null));};exports['update']=function(_0x24d17d,_0x3011c4){if(_0x24d17d[_0x070e('0x35')]['id']){delete _0x24d17d[_0x070e('0x35')]['id'];}return db[_0x070e('0x29')]['find']({'where':{'id':_0x24d17d[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x3011c4,null))['then'](saveUpdates(_0x24d17d[_0x070e('0x35')],null))[_0x070e('0x20')](respondWithResult(_0x3011c4,null))['catch'](handleError(_0x3011c4,null));};exports['destroy']=function(_0x5ddbe9,_0x363bff){return db[_0x070e('0x29')][_0x070e('0x36')]({'where':{'id':_0x5ddbe9[_0x070e('0x26')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x363bff,null))['then'](removeEntity(_0x363bff,null))[_0x070e('0x33')](handleError(_0x363bff,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index ca7fe49..cef9666 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 _0xc516=['define','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatProactiveAction.attributes','exports'];(function(_0x4db6d7,_0x5f4e37){var _0x32ab94=function(_0x29d868){while(--_0x29d868){_0x4db6d7['push'](_0x4db6d7['shift']());}};_0x32ab94(++_0x5f4e37);}(_0xc516,0x1af));var _0x6c51=function(_0x3a7455,_0x46b004){_0x3a7455=_0x3a7455-0x0;var _0x216c72=_0xc516[_0x3a7455];return _0x216c72;};'use strict';var _=require(_0x6c51('0x0'));var util=require(_0x6c51('0x1'));var logger=require(_0x6c51('0x2'))(_0x6c51('0x3'));var moment=require(_0x6c51('0x4'));var BPromise=require(_0x6c51('0x5'));var rp=require(_0x6c51('0x6'));var fs=require('fs');var path=require(_0x6c51('0x7'));var rimraf=require(_0x6c51('0x8'));var config=require('../../config/environment');var attributes=require(_0x6c51('0x9'));module[_0x6c51('0xa')]=function(_0xa6a2e9,_0x46415d){return _0xa6a2e9[_0x6c51('0xb')]('ChatProactiveAction',attributes,{'tableName':_0x6c51('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc889=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','chat_proactive_actions','lodash'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0xc889,0x1eb));var _0x9c88=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xc889[_0x31a371];return _0x2a5bd6;};'use strict';var _=require(_0x9c88('0x0'));var util=require(_0x9c88('0x1'));var logger=require(_0x9c88('0x2'))(_0x9c88('0x3'));var moment=require(_0x9c88('0x4'));var BPromise=require('bluebird');var rp=require(_0x9c88('0x5'));var fs=require('fs');var path=require(_0x9c88('0x6'));var rimraf=require(_0x9c88('0x7'));var config=require(_0x9c88('0x8'));var attributes=require(_0x9c88('0x9'));module[_0x9c88('0xa')]=function(_0x2eada1,_0x35211e){return _0x2eada1['define']('ChatProactiveAction',attributes,{'tableName':_0x9c88('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 129d632..5b71c5a 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 _0xce1b=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0xf7b25d,_0x10665e){var _0xa86c65=function(_0x3cef33){while(--_0x3cef33){_0xf7b25d['push'](_0xf7b25d['shift']());}};_0xa86c65(++_0x10665e);}(_0xce1b,0xa2));var _0xbce1=function(_0x23fa79,_0x5cdf24){_0x23fa79=_0x23fa79-0x0;var _0x2594ba=_0xce1b[_0x23fa79];return _0x2594ba;};'use strict';var _=require(_0xbce1('0x0'));var util=require(_0xbce1('0x1'));var moment=require(_0xbce1('0x2'));var BPromise=require(_0xbce1('0x3'));var rs=require(_0xbce1('0x4'));var fs=require('fs');var Redis=require(_0xbce1('0x5'));var db=require(_0xbce1('0x6'))['db'];var utils=require(_0xbce1('0x7'));var logger=require('../../config/logger')(_0xbce1('0x8'));var config=require(_0xbce1('0x9'));var jayson=require(_0xbce1('0xa'));var client=jayson[_0xbce1('0xb')][_0xbce1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47254e,_0x458187,_0xf6c798){return new BPromise(function(_0x472907,_0x4a2ec3){return client[_0xbce1('0xd')](_0x47254e,_0xf6c798)[_0xbce1('0xe')](function(_0x34ec6f){logger[_0xbce1('0xf')](_0xbce1('0x10'),_0x458187,'request\x20sent');logger[_0xbce1('0x11')](_0xbce1('0x12'),_0x458187,_0xbce1('0x13'),JSON['stringify'](_0x34ec6f));if(_0x34ec6f[_0xbce1('0x14')]){if(_0x34ec6f['error'][_0xbce1('0x15')]===0x1f4){logger[_0xbce1('0x14')](_0xbce1('0x10'),_0x458187,_0x34ec6f[_0xbce1('0x14')][_0xbce1('0x16')]);return _0x4a2ec3(_0x34ec6f[_0xbce1('0x14')]['message']);}logger[_0xbce1('0x14')](_0xbce1('0x10'),_0x458187,_0x34ec6f['error'][_0xbce1('0x16')]);return _0x472907(_0x34ec6f[_0xbce1('0x14')]['message']);}else{logger['info'](_0xbce1('0x10'),_0x458187,_0xbce1('0x13'));_0x472907(_0x34ec6f[_0xbce1('0x17')][_0xbce1('0x16')]);}})['catch'](function(_0x4325b9){logger[_0xbce1('0x14')]('ChatProactiveAction,\x20%s,\x20%s',_0x458187,_0x4325b9);_0x4a2ec3(_0x4325b9);});});} \ No newline at end of file +var _0x7685=['result','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1c22ac,_0x4c86bd){var _0x4c867a=function(_0x370c7d){while(--_0x370c7d){_0x1c22ac['push'](_0x1c22ac['shift']());}};_0x4c867a(++_0x4c86bd);}(_0x7685,0xde));var _0x5768=function(_0x719e09,_0x11f946){_0x719e09=_0x719e09-0x0;var _0x258fdb=_0x7685[_0x719e09];return _0x258fdb;};'use strict';var _=require(_0x5768('0x0'));var util=require(_0x5768('0x1'));var moment=require('moment');var BPromise=require(_0x5768('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5768('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5768('0x4'));var logger=require('../../config/logger')(_0x5768('0x5'));var config=require(_0x5768('0x6'));var jayson=require(_0x5768('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x577b3e,_0x33c64c,_0x5e9c29){return new BPromise(function(_0x40d5fd,_0x45776d){return client[_0x5768('0x8')](_0x577b3e,_0x5e9c29)[_0x5768('0x9')](function(_0x43501b){logger[_0x5768('0xa')](_0x5768('0xb'),_0x33c64c,_0x5768('0xc'));logger[_0x5768('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x33c64c,_0x5768('0xc'),JSON[_0x5768('0xe')](_0x43501b));if(_0x43501b[_0x5768('0xf')]){if(_0x43501b[_0x5768('0xf')][_0x5768('0x10')]===0x1f4){logger[_0x5768('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x33c64c,_0x43501b[_0x5768('0xf')][_0x5768('0x11')]);return _0x45776d(_0x43501b[_0x5768('0xf')][_0x5768('0x11')]);}logger['error'](_0x5768('0xb'),_0x33c64c,_0x43501b[_0x5768('0xf')][_0x5768('0x11')]);return _0x40d5fd(_0x43501b[_0x5768('0xf')][_0x5768('0x11')]);}else{logger[_0x5768('0xa')](_0x5768('0xb'),_0x33c64c,_0x5768('0xc'));_0x40d5fd(_0x43501b[_0x5768('0x12')][_0x5768('0x11')]);}})[_0x5768('0x13')](function(_0x3ee0f4){logger[_0x5768('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x33c64c,_0x3ee0f4);_0x45776d(_0x3ee0f4);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 6f9d9f1..4e5afb4 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 _0x8f13=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports'];(function(_0x33c4bc,_0x392e10){var _0x37fd00=function(_0x67a31c){while(--_0x67a31c){_0x33c4bc['push'](_0x33c4bc['shift']());}};_0x37fd00(++_0x392e10);}(_0x8f13,0x1b0));var _0x38f1=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0x8f13[_0x35181c];return _0xe14bf9;};'use strict';var multer=require(_0x38f1('0x0'));var util=require(_0x38f1('0x1'));var path=require(_0x38f1('0x2'));var timeout=require(_0x38f1('0x3'));var express=require('express');var router=express[_0x38f1('0x4')]();var auth=require(_0x38f1('0x5'));var interaction=require(_0x38f1('0x6'));var config=require('../../config/environment');var controller=require(_0x38f1('0x7'));router[_0x38f1('0x8')](_0x38f1('0x9'),auth[_0x38f1('0xa')](),controller[_0x38f1('0xb')]);router[_0x38f1('0xc')]('/',auth[_0x38f1('0xa')](),controller['create']);router[_0x38f1('0xd')](_0x38f1('0x9'),auth[_0x38f1('0xa')](),controller[_0x38f1('0xe')]);router[_0x38f1('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x38f1('0x10')]);module[_0x38f1('0x11')]=router; \ No newline at end of file +var _0x7cf6=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cf6,0x143));var _0x67cf=function(_0x301700,_0x4b57ab){_0x301700=_0x301700-0x0;var _0x3ecfc5=_0x7cf6[_0x301700];return _0x3ecfc5;};'use strict';var multer=require('multer');var util=require(_0x67cf('0x0'));var path=require(_0x67cf('0x1'));var timeout=require(_0x67cf('0x2'));var express=require(_0x67cf('0x3'));var router=express[_0x67cf('0x4')]();var auth=require(_0x67cf('0x5'));var interaction=require(_0x67cf('0x6'));var config=require(_0x67cf('0x7'));var controller=require(_0x67cf('0x8'));router[_0x67cf('0x9')](_0x67cf('0xa'),auth[_0x67cf('0xb')](),controller[_0x67cf('0xc')]);router[_0x67cf('0xd')]('/',auth[_0x67cf('0xb')](),controller[_0x67cf('0xe')]);router[_0x67cf('0xf')](_0x67cf('0xa'),auth[_0x67cf('0xb')](),controller[_0x67cf('0x10')]);router[_0x67cf('0x11')]('/:id',auth[_0x67cf('0xb')](),controller[_0x67cf('0x12')]);module[_0x67cf('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 351f602..3486475 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 _0x2f03=['exports','STRING','name','ENUM','rrmemory','beepall','roundrobin'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2f03,0x1e3));var _0x32f0=function(_0x12e3ad,_0x115efc){_0x12e3ad=_0x12e3ad-0x0;var _0x58084b=_0x2f03[_0x12e3ad];return _0x58084b;};'use strict';var Sequelize=require('sequelize');module[_0x32f0('0x0')]={'name':{'type':Sequelize[_0x32f0('0x1')],'unique':_0x32f0('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x32f0('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x32f0('0x3')](_0x32f0('0x4'),_0x32f0('0x5'),_0x32f0('0x6'))}}; \ No newline at end of file +var _0x1827=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER'];(function(_0x31ddba,_0x28ec26){var _0x3f014c=function(_0x24aa10){while(--_0x24aa10){_0x31ddba['push'](_0x31ddba['shift']());}};_0x3f014c(++_0x28ec26);}(_0x1827,0x64));var _0x7182=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x1827[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require(_0x7182('0x0'));module[_0x7182('0x1')]={'name':{'type':Sequelize[_0x7182('0x2')],'unique':_0x7182('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7182('0x2')]},'timeout':{'type':Sequelize[_0x7182('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x7182('0x5'),_0x7182('0x6'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index df76b6c..4c73d1e 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 _0x3fe1=['team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','value','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','reject','update','destroy','get','ChatQueues','UserProfileResource','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll','rows','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','length','nolimit','UserChatQueue','User','UserId','agent','chatPause','updatedAt','format','SIP','createdAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','sequelize','each','forEach','userChatQueue:save','removeTeams','select','field','tq.TeamId'];(function(_0x52b91f,_0x499757){var _0x15f8f5=function(_0x33fbf6){while(--_0x33fbf6){_0x52b91f['push'](_0x52b91f['shift']());}};_0x15f8f5(++_0x499757);}(_0x3fe1,0x14c));var _0x13fe=function(_0x4cbab3,_0xbbbf40){_0x4cbab3=_0x4cbab3-0x0;var _0x3854b9=_0x3fe1[_0x4cbab3];return _0x3854b9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x13fe('0x0'));var rimraf=require(_0x13fe('0x1'));var zipdir=require(_0x13fe('0x2'));var jsonpatch=require(_0x13fe('0x3'));var rp=require(_0x13fe('0x4'));var moment=require(_0x13fe('0x5'));var BPromise=require(_0x13fe('0x6'));var Mustache=require('mustache');var util=require(_0x13fe('0x7'));var path=require(_0x13fe('0x8'));var sox=require('sox');var csv=require(_0x13fe('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x13fe('0xa'));var squel=require(_0x13fe('0xb'));var crypto=require(_0x13fe('0xc'));var jsforce=require(_0x13fe('0xd'));var deskjs=require(_0x13fe('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x13fe('0xf'));var Redis=require(_0x13fe('0x10'));var authService=require(_0x13fe('0x11'));var qs=require(_0x13fe('0x12'));var as=require(_0x13fe('0x13'));var hardwareService=require(_0x13fe('0x14'));var logger=require(_0x13fe('0x15'))('api');var utils=require(_0x13fe('0x16'));var config=require(_0x13fe('0x17'));var db=require('../../mysqldb')['db'];config[_0x13fe('0x18')]=_[_0x13fe('0x19')](config[_0x13fe('0x18')],{'host':_0x13fe('0x1a'),'port':0x18eb});var socket=require(_0x13fe('0x1b'))(new Redis(config[_0x13fe('0x18')]));require(_0x13fe('0x1c'))[_0x13fe('0x1d')](socket);var jayson=require(_0x13fe('0x1e'));var client=jayson[_0x13fe('0x1f')][_0x13fe('0x20')]({'port':0x232a});function checkPasswordPattern(_0x25e3b3,_0x10276e,_0x2c9bc0){if(_0x2c9bc0){var _0x419fb6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x419fb6[_0x13fe('0x21')](_0x10276e)){return _0x25e3b3;}else{throw new db[(_0x13fe('0x22'))][(_0x13fe('0x23'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x25e3b3;}}function respondWithRpcPromise(_0x9f7b57,_0xc5f7f1,_0x42b4a6,_0x6b487d){return new BPromise(function(_0xc21424,_0x52cfdf){var _0x416f4b=_0x6b487d||client;return _0x416f4b[_0x13fe('0x24')](_0x9f7b57,_0x42b4a6)[_0x13fe('0x25')](function(_0x102095){logger[_0x13fe('0x26')](_0x13fe('0x27'),_0xc5f7f1,_0x13fe('0x28'));logger[_0x13fe('0x29')](_0x13fe('0x2a'),_0xc5f7f1,_0x13fe('0x28'),JSON['stringify'](_0x102095));if(_0x102095[_0x13fe('0x2b')]){if(_0x102095[_0x13fe('0x2b')]['code']===0x1f4){logger[_0x13fe('0x2b')](_0x13fe('0x27'),_0xc5f7f1,_0x102095['error']['message']);return _0x52cfdf(_0x102095[_0x13fe('0x2b')][_0x13fe('0x2c')]);}logger[_0x13fe('0x2b')](_0x13fe('0x27'),_0xc5f7f1,_0x102095[_0x13fe('0x2b')][_0x13fe('0x2c')]);return _0xc21424(_0x102095[_0x13fe('0x2b')]['message']);}else{logger[_0x13fe('0x26')]('ChatQueue,\x20%s,\x20%s',_0xc5f7f1,'request\x20sent');_0xc21424(_0x102095[_0x13fe('0x2d')][_0x13fe('0x2c')]);}})[_0x13fe('0x2e')](function(_0x4b1709){logger[_0x13fe('0x2b')]('ChatQueue,\x20%s,\x20%s',_0xc5f7f1,_0x4b1709);_0x52cfdf(_0x4b1709);});});}function respondWithStatusCode(_0x444b93,_0x5b41f8){_0x5b41f8=_0x5b41f8||0xcc;return function(_0x52f155){if(_0x52f155){return _0x444b93[_0x13fe('0x2f')](_0x5b41f8);}return _0x444b93[_0x13fe('0x30')](_0x5b41f8)[_0x13fe('0x31')]();};}function respondWithResult(_0xb82369,_0x1ae7e9){_0x1ae7e9=_0x1ae7e9||0xc8;return function(_0x2337cd){if(_0x2337cd){return _0xb82369[_0x13fe('0x30')](_0x1ae7e9)[_0x13fe('0x32')](_0x2337cd);}};}function respondWithFilteredResult(_0x33613a,_0x589d6b){return function(_0x104208){if(_0x104208){var _0x3570b9=_0x104208[_0x13fe('0x33')],_0x1d66e8=_0x589d6b[_0x13fe('0x34')],_0xd5f576=_0x589d6b[_0x13fe('0x34')]+_0x589d6b[_0x13fe('0x35')],_0x5a56ba;if(_0xd5f576>=_0x3570b9){_0xd5f576=_0x3570b9;_0x5a56ba=0xc8;}else{_0x5a56ba=0xce;}_0x33613a[_0x13fe('0x30')](_0x5a56ba);return _0x33613a['set']('Content-Range',_0x1d66e8+'-'+_0xd5f576+'/'+_0x3570b9)[_0x13fe('0x32')](_0x104208);}return null;};}function patchUpdates(_0x25fac6){return function(_0x2d6676){try{jsonpatch['apply'](_0x2d6676,_0x25fac6,!![]);}catch(_0x39c701){return BPromise[_0x13fe('0x36')](_0x39c701);}return _0x2d6676['save']();};}function saveUpdates(_0x32e451,_0x4d744c){return function(_0x31d807){if(_0x31d807){return _0x31d807[_0x13fe('0x37')](_0x32e451)[_0x13fe('0x25')](function(_0x149bb3){return _0x149bb3;});}return null;};}function removeEntity(_0x4041ab,_0x2a49c0){return function(_0x4b26da){if(_0x4b26da){return _0x4b26da[_0x13fe('0x38')]()['then'](function(){var _0x37abc4=_0x4b26da[_0x13fe('0x39')]({'plain':!![]});var _0x10da14=_0x13fe('0x3a');return db[_0x13fe('0x3b')][_0x13fe('0x38')]({'where':{'type':_0x10da14,'resourceId':_0x37abc4['id']}})[_0x13fe('0x25')](function(){return _0x4b26da;});})[_0x13fe('0x25')](function(){_0x4041ab[_0x13fe('0x30')](0xcc)[_0x13fe('0x31')]();});}};}function handleEntityNotFound(_0x4c83ac,_0x3c96f1){return function(_0x598036){if(!_0x598036){_0x4c83ac['sendStatus'](0x194);}return _0x598036;};}function handleError(_0x2fb6de,_0x2e5e59){_0x2e5e59=_0x2e5e59||0x1f4;return function(_0x5aad45){logger[_0x13fe('0x2b')](_0x5aad45['stack']);if(_0x5aad45[_0x13fe('0x3c')]){delete _0x5aad45[_0x13fe('0x3c')];}_0x2fb6de['status'](_0x2e5e59)[_0x13fe('0x3d')](_0x5aad45);};}exports[_0x13fe('0x3e')]=function(_0x576c61,_0x3ef208){var _0x1dc854={},_0xf85210={},_0xc91032={'count':0x0,'rows':[]};var _0x15df21=_[_0x13fe('0x3f')](db[_0x13fe('0x40')][_0x13fe('0x41')],function(_0x3c615c){return{'name':_0x3c615c[_0x13fe('0x42')],'type':_0x3c615c[_0x13fe('0x43')][_0x13fe('0x44')]};});_0xf85210[_0x13fe('0x45')]=_[_0x13fe('0x3f')](_0x15df21,_0x13fe('0x3c'));_0xf85210[_0x13fe('0x46')]=_[_0x13fe('0x47')](_0x576c61[_0x13fe('0x46')]);_0xf85210[_0x13fe('0x48')]=_['intersection'](_0xf85210[_0x13fe('0x45')],_0xf85210[_0x13fe('0x46')]);_0x1dc854[_0x13fe('0x49')]=_[_0x13fe('0x4a')](_0xf85210[_0x13fe('0x45')],qs[_0x13fe('0x4b')](_0x576c61[_0x13fe('0x46')][_0x13fe('0x4b')]));_0x1dc854['attributes']=_0x1dc854[_0x13fe('0x49')]['length']?_0x1dc854['attributes']:_0xf85210[_0x13fe('0x45')];if(!_0x576c61[_0x13fe('0x46')][_0x13fe('0x4c')]('nolimit')){_0x1dc854[_0x13fe('0x35')]=qs[_0x13fe('0x35')](_0x576c61[_0x13fe('0x46')][_0x13fe('0x35')]);_0x1dc854[_0x13fe('0x34')]=qs[_0x13fe('0x34')](_0x576c61[_0x13fe('0x46')][_0x13fe('0x34')]);}_0x1dc854[_0x13fe('0x4d')]=qs[_0x13fe('0x4e')](_0x576c61[_0x13fe('0x46')]['sort']);_0x1dc854['where']=qs[_0x13fe('0x48')](_[_0x13fe('0x4f')](_0x576c61['query'],_0xf85210[_0x13fe('0x48')]),_0x15df21);if(_0x576c61[_0x13fe('0x46')][_0x13fe('0x50')]){_0x1dc854['where']=_[_0x13fe('0x51')](_0x1dc854['where'],{'$or':_[_0x13fe('0x3f')](_0x15df21,function(_0x1897b5){if(_0x1897b5['type']!==_0x13fe('0x52')){var _0x3fa9a1={};_0x3fa9a1[_0x1897b5[_0x13fe('0x3c')]]={'$like':'%'+_0x576c61[_0x13fe('0x46')]['filter']+'%'};return _0x3fa9a1;}})});}_0x1dc854=_['merge']({},_0x1dc854,_0x576c61[_0x13fe('0x53')]);var _0x2d6011={'where':_0x1dc854[_0x13fe('0x54')]};return db[_0x13fe('0x40')][_0x13fe('0x33')](_0x2d6011)[_0x13fe('0x25')](function(_0x13cfc0){_0xc91032[_0x13fe('0x33')]=_0x13cfc0;if(_0x576c61[_0x13fe('0x46')][_0x13fe('0x55')]){_0x1dc854[_0x13fe('0x56')]=[{'all':!![]}];}return db[_0x13fe('0x40')][_0x13fe('0x57')](_0x1dc854);})[_0x13fe('0x25')](function(_0x5a03b9){_0xc91032[_0x13fe('0x58')]=_0x5a03b9;return _0xc91032;})[_0x13fe('0x25')](respondWithFilteredResult(_0x3ef208,_0x1dc854))[_0x13fe('0x2e')](handleError(_0x3ef208,null));};exports[_0x13fe('0x59')]=function(_0x376db4,_0x2cc802){var _0x9e3143={'raw':!![],'where':{'id':_0x376db4[_0x13fe('0x5a')]['id']}},_0x2446f2={};_0x2446f2[_0x13fe('0x45')]=_[_0x13fe('0x47')](db[_0x13fe('0x40')][_0x13fe('0x41')]);_0x2446f2['query']=_[_0x13fe('0x47')](_0x376db4[_0x13fe('0x46')]);_0x2446f2[_0x13fe('0x48')]=_[_0x13fe('0x4a')](_0x2446f2['model'],_0x2446f2[_0x13fe('0x46')]);_0x9e3143[_0x13fe('0x49')]=_[_0x13fe('0x4a')](_0x2446f2[_0x13fe('0x45')],qs[_0x13fe('0x4b')](_0x376db4['query'][_0x13fe('0x4b')]));_0x9e3143[_0x13fe('0x49')]=_0x9e3143[_0x13fe('0x49')]['length']?_0x9e3143[_0x13fe('0x49')]:_0x2446f2['model'];if(_0x376db4['query'][_0x13fe('0x55')]){_0x9e3143['include']=[{'all':!![]}];}_0x9e3143=_[_0x13fe('0x51')]({},_0x9e3143,_0x376db4[_0x13fe('0x53')]);return db[_0x13fe('0x40')]['find'](_0x9e3143)[_0x13fe('0x25')](handleEntityNotFound(_0x2cc802,null))[_0x13fe('0x25')](respondWithResult(_0x2cc802,null))['catch'](handleError(_0x2cc802,null));};exports[_0x13fe('0x5b')]=function(_0x4c785c,_0x577681){return db[_0x13fe('0x40')]['create'](_0x4c785c['body'],{})[_0x13fe('0x25')](function(_0x27a6d1){var _0x1d6fd1=_0x4c785c[_0x13fe('0x5c')][_0x13fe('0x39')]({'plain':!![]});if(!_0x1d6fd1)throw new Error(_0x13fe('0x5d'));if(_0x1d6fd1[_0x13fe('0x5e')]==='user'){var _0x5b235e=_0x27a6d1[_0x13fe('0x39')]({'plain':!![]});var _0x4e45b4=_0x13fe('0x3a');return db[_0x13fe('0x5f')][_0x13fe('0x60')]({'where':{'name':_0x4e45b4,'userProfileId':_0x1d6fd1[_0x13fe('0x61')]},'raw':!![]})['then'](function(_0x3c46dd){if(_0x3c46dd&&_0x3c46dd['autoAssociation']===0x0){return db[_0x13fe('0x3b')][_0x13fe('0x5b')]({'name':_0x5b235e[_0x13fe('0x3c')],'resourceId':_0x5b235e['id'],'type':_0x3c46dd['name'],'sectionId':_0x3c46dd['id']},{})[_0x13fe('0x25')](function(){return _0x27a6d1;});}else{return _0x27a6d1;}})[_0x13fe('0x2e')](function(_0x1fc246){logger[_0x13fe('0x2b')](_0x13fe('0x62'),_0x1fc246);throw _0x1fc246;});}return _0x27a6d1;})[_0x13fe('0x25')](respondWithResult(_0x577681,0xc9))[_0x13fe('0x2e')](handleError(_0x577681,null));};exports[_0x13fe('0x37')]=function(_0x42c7bf,_0x43d206){if(_0x42c7bf[_0x13fe('0x63')]['id']){delete _0x42c7bf['body']['id'];}return db[_0x13fe('0x40')][_0x13fe('0x60')]({'where':{'id':_0x42c7bf[_0x13fe('0x5a')]['id']}})[_0x13fe('0x25')](handleEntityNotFound(_0x43d206,null))['then'](saveUpdates(_0x42c7bf[_0x13fe('0x63')],null))[_0x13fe('0x25')](respondWithResult(_0x43d206,null))['catch'](handleError(_0x43d206,null));};exports[_0x13fe('0x38')]=function(_0x3aae11,_0xec478a){return db['ChatQueue'][_0x13fe('0x60')]({'where':{'id':_0x3aae11['params']['id']}})[_0x13fe('0x25')](handleEntityNotFound(_0xec478a,null))['then'](removeEntity(_0xec478a,null))[_0x13fe('0x2e')](handleError(_0xec478a,null));};exports[_0x13fe('0x64')]=function(_0x4325ed,_0x39b224){return db[_0x13fe('0x40')][_0x13fe('0x64')]()[_0x13fe('0x25')](respondWithResult(_0x39b224,null))[_0x13fe('0x2e')](handleError(_0x39b224,null));};exports[_0x13fe('0x65')]=function(_0x4ca5e0,_0x3e6b17,_0x4ab3bb){var _0x1ec42f={'raw':!![],'where':{}},_0x52b0e6={},_0x5521b8;return db['ChatQueue'][_0x13fe('0x66')]({'where':{'id':_0x4ca5e0['params']['id']}})[_0x13fe('0x25')](handleEntityNotFound(_0x3e6b17,null))[_0x13fe('0x25')](function(_0x24fa35){if(_0x24fa35){_0x5521b8=_0x24fa35[_0x13fe('0x39')]({'plain':!![]});_0x52b0e6[_0x13fe('0x45')]=_[_0x13fe('0x47')](db['UserChatQueue'][_0x13fe('0x41')]);_0x52b0e6['query']=_[_0x13fe('0x47')](_0x4ca5e0[_0x13fe('0x46')]);_0x52b0e6[_0x13fe('0x48')]=_[_0x13fe('0x4a')](_0x52b0e6['model'],_0x52b0e6['query']);_0x1ec42f[_0x13fe('0x49')]=_[_0x13fe('0x4a')](_0x52b0e6[_0x13fe('0x45')],qs[_0x13fe('0x4b')](_0x4ca5e0['query'][_0x13fe('0x4b')]));_0x1ec42f['attributes']=_0x1ec42f[_0x13fe('0x49')][_0x13fe('0x67')]?_0x1ec42f[_0x13fe('0x49')]:_0x52b0e6[_0x13fe('0x45')];if(!_0x4ca5e0[_0x13fe('0x46')][_0x13fe('0x4c')](_0x13fe('0x68'))){_0x1ec42f[_0x13fe('0x35')]=qs[_0x13fe('0x35')](_0x4ca5e0[_0x13fe('0x46')][_0x13fe('0x35')]);_0x1ec42f['offset']=qs[_0x13fe('0x34')](_0x4ca5e0['query']['offset']);}_0x1ec42f[_0x13fe('0x4d')]=qs[_0x13fe('0x4e')](_0x4ca5e0[_0x13fe('0x46')][_0x13fe('0x4e')]);_0x1ec42f[_0x13fe('0x54')]=qs['filters'](_[_0x13fe('0x4f')](_0x4ca5e0[_0x13fe('0x46')],_0x52b0e6[_0x13fe('0x48')]));_0x1ec42f[_0x13fe('0x54')]['ChatQueueId']=_0x24fa35['id'];if(_0x4ca5e0[_0x13fe('0x46')]['filter']){_0x1ec42f[_0x13fe('0x54')]=_[_0x13fe('0x51')](_0x1ec42f[_0x13fe('0x54')],{'$or':_[_0x13fe('0x3f')](_0x1ec42f[_0x13fe('0x49')],function(_0x3d043d){var _0x423906={};_0x423906[_0x3d043d]={'$like':'%'+_0x4ca5e0[_0x13fe('0x46')]['filter']+'%'};return _0x423906;})});}_0x1ec42f=_[_0x13fe('0x51')]({},_0x1ec42f,_0x4ca5e0[_0x13fe('0x53')]);return db[_0x13fe('0x69')][_0x13fe('0x57')](_0x1ec42f);}})[_0x13fe('0x25')](function(_0x118e04){if(_0x118e04){return db[_0x13fe('0x6a')]['findAndCountAll']({'where':{'id':_[_0x13fe('0x3f')](_0x118e04,_0x13fe('0x6b')),'role':_0x13fe('0x6c')},'attributes':['id',_0x13fe('0x3c'),_0x13fe('0x6d'),_0x13fe('0x6e'),'createdAt']});}})[_0x13fe('0x25')](function(_0x53c6fa){if(_0x53c6fa){return{'count':_0x53c6fa[_0x13fe('0x33')],'rows':_['map'](_0x53c6fa[_0x13fe('0x58')],function(_0x4281ee){return{'membername':_0x4281ee[_0x13fe('0x3c')],'UserId':_0x4281ee['id'],'queue_name':_0x5521b8[_0x13fe('0x3c')],'ChatQueueId':_0x5521b8['id'],'interface':util[_0x13fe('0x6f')]('%s/%s',_0x13fe('0x70'),_0x4281ee[_0x13fe('0x3c')]),'penalty':0x0,'paused':_0x4281ee[_0x13fe('0x6d')],'createdAt':_0x4281ee[_0x13fe('0x71')],'updatedAt':_0x4281ee[_0x13fe('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x13fe('0x25')](respondWithFilteredResult(_0x3e6b17,_0x1ec42f))['catch'](handleError(_0x3e6b17,null));};exports['getTeams']=function(_0x36f7b6,_0x35c193,_0x293dea){var _0x503018={};var _0x292a5a={};var _0x2c5b29;var _0x21c322;return db['ChatQueue'][_0x13fe('0x66')]({'where':{'id':_0x36f7b6[_0x13fe('0x5a')]['id']}})[_0x13fe('0x25')](handleEntityNotFound(_0x35c193,null))[_0x13fe('0x25')](function(_0x1672bc){if(_0x1672bc){_0x2c5b29=_0x1672bc;_0x292a5a['model']=_['keys'](db['Team']['rawAttributes']);_0x292a5a[_0x13fe('0x46')]=_[_0x13fe('0x47')](_0x36f7b6[_0x13fe('0x46')]);_0x292a5a[_0x13fe('0x48')]=_[_0x13fe('0x4a')](_0x292a5a['model'],_0x292a5a[_0x13fe('0x46')]);_0x503018['attributes']=_['intersection'](_0x292a5a['model'],qs[_0x13fe('0x4b')](_0x36f7b6[_0x13fe('0x46')]['fields']));_0x503018[_0x13fe('0x49')]=_0x503018[_0x13fe('0x49')][_0x13fe('0x67')]?_0x503018[_0x13fe('0x49')]:_0x292a5a[_0x13fe('0x45')];_0x503018[_0x13fe('0x4d')]=qs[_0x13fe('0x4e')](_0x36f7b6[_0x13fe('0x46')][_0x13fe('0x4e')]);_0x503018['where']=qs[_0x13fe('0x48')](_['pick'](_0x36f7b6['query'],_0x292a5a[_0x13fe('0x48')]));if(_0x36f7b6[_0x13fe('0x46')][_0x13fe('0x50')]){_0x503018[_0x13fe('0x54')]=_['merge'](_0x503018[_0x13fe('0x54')],{'$or':_[_0x13fe('0x3f')](_0x503018[_0x13fe('0x49')],function(_0x55315e){var _0x362684={};_0x362684[_0x55315e]={'$like':'%'+_0x36f7b6[_0x13fe('0x46')][_0x13fe('0x50')]+'%'};return _0x362684;})});}_0x503018=_[_0x13fe('0x51')]({},_0x503018,_0x36f7b6[_0x13fe('0x53')]);return _0x2c5b29[_0x13fe('0x72')](_0x503018);}})[_0x13fe('0x25')](function(_0x424379){if(_0x424379){_0x21c322=_0x424379[_0x13fe('0x67')];if(!_0x36f7b6[_0x13fe('0x46')][_0x13fe('0x4c')](_0x13fe('0x68'))){_0x503018[_0x13fe('0x35')]=qs[_0x13fe('0x35')](_0x36f7b6[_0x13fe('0x46')]['limit']);_0x503018[_0x13fe('0x34')]=qs[_0x13fe('0x34')](_0x36f7b6[_0x13fe('0x46')][_0x13fe('0x34')]);}return _0x2c5b29[_0x13fe('0x72')](_0x503018);}})[_0x13fe('0x25')](function(_0x16b8ff){if(_0x16b8ff){return _0x16b8ff?{'count':_0x21c322,'rows':_0x16b8ff}:null;}})[_0x13fe('0x25')](respondWithResult(_0x35c193,null))[_0x13fe('0x2e')](handleError(_0x35c193,null));};exports[_0x13fe('0x73')]=function(_0x5d1878,_0x4b862c,_0x5f5db0){var _0x490924=_0x5d1878[_0x13fe('0x63')][_0x13fe('0x74')];return db[_0x13fe('0x75')][_0x13fe('0x57')]({'where':{'id':_0x490924},'attributes':['id'],'include':[{'model':db[_0x13fe('0x6a')],'as':_0x13fe('0x76'),'attributes':['id',_0x13fe('0x3c'),_0x13fe('0x77'),_0x13fe('0x78'),_0x13fe('0x79')],'raw':!![]}]})[_0x13fe('0x25')](function(_0x12879e){if(_0x12879e){var _0x4931e1=_['flatMap'](_0x12879e,function(_0x58f39e){var _0x5d95a5=_0x58f39e['get']({'plain':!![]});return _0x5d95a5['Agents'];});return db['ChatQueue']['find']({'where':{'id':_0x5d1878[_0x13fe('0x5a')]['id']}})[_0x13fe('0x25')](function(_0x2a392a){return db[_0x13fe('0x7a')]['transaction'](function(_0x112368){return _0x2a392a[_0x13fe('0x73')](_0x490924,{'transaction':_0x112368})[_0x13fe('0x25')](function(){return BPromise[_0x13fe('0x7b')](_0x4931e1,function(_0x4898cd){return db['UserChatQueue']['findOrCreate']({'where':{'UserId':_0x4898cd['id'],'ChatQueueId':_0x5d1878[_0x13fe('0x5a')]['id']},'transaction':_0x112368});});})[_0x13fe('0x25')](function(){_0x4931e1[_0x13fe('0x7c')](function(_0x3c271e){socket['emit'](_0x13fe('0x7d'),{'UserId':_0x3c271e['id'],'ChatQueueId':_0x2a392a['id']});});});});});}})['then'](respondWithStatusCode(_0x4b862c,null))['catch'](handleError(_0x4b862c,null));};exports[_0x13fe('0x7e')]=function(_0x364139,_0x3bc819,_0x14cf6e){return db[_0x13fe('0x75')][_0x13fe('0x57')]({'where':{'id':_0x364139[_0x13fe('0x46')][_0x13fe('0x74')]},'attributes':['id'],'include':[{'model':db[_0x13fe('0x6a')],'as':_0x13fe('0x76'),'attributes':['id'],'raw':!![]}]})[_0x13fe('0x25')](handleEntityNotFound(_0x3bc819,null))[_0x13fe('0x25')](function(_0x14cd46){var _0x5d0ab2=_[_0x13fe('0x3f')](_0x14cd46,'id');var _0x479e8b=[];var _0x3d564f=[];var _0x51fd3f=squel[_0x13fe('0x7f')]();_0x51fd3f[_0x13fe('0x80')](_0x13fe('0x81'))['from'](_0x13fe('0x82'),'tq')[_0x13fe('0x83')](_0x13fe('0x84'),'ut',_0x13fe('0x85'))[_0x13fe('0x54')](_0x13fe('0x86'),_0x364139[_0x13fe('0x5a')]['id']);for(var _0x2c8eef=0x0;_0x2c8eef<_0x14cd46['length'];_0x2c8eef+=0x1){let _0x22e403=_0x14cd46[_0x2c8eef];for(var _0x387499=0x0;_0x387499<_0x22e403['Agents'][_0x13fe('0x67')];_0x387499+=0x1){let _0x156827=_0x22e403[_0x13fe('0x76')][_0x387499];var _0x3c5fb4=_0x51fd3f[_0x13fe('0x87')]();_0x3c5fb4['where'](_0x13fe('0x88'),_0x156827['id']);_0x3d564f[_0x13fe('0x89')](db[_0x13fe('0x7a')][_0x13fe('0x46')](_0x3c5fb4[_0x13fe('0x8a')](),{'type':db[_0x13fe('0x7a')][_0x13fe('0x8b')][_0x13fe('0x8c')]})[_0x13fe('0x25')](function(_0xd18ec0){if(_0xd18ec0[_0x13fe('0x67')]===0x1){return _0x156827['id'];}else{var _0x542862=_[_0x13fe('0x8d')](_['map'](_0xd18ec0,_0x13fe('0x8e')),function(_0x262381){return _['includes'](_0x5d0ab2,_0x262381);});if(_0x542862){return _0x156827['id'];}}}));}}return BPromise[_0x13fe('0x8f')](_0x3d564f)[_0x13fe('0x25')](function(_0x5004e7){_0x479e8b=_(_0x479e8b)[_0x13fe('0x90')](_0x5004e7)['compact']()[_0x13fe('0x91')]();return db['ChatQueue'][_0x13fe('0x60')]({'where':{'id':_0x364139['params']['id']}})[_0x13fe('0x25')](function(_0x6e9e84){return db[_0x13fe('0x7a')]['transaction'](function(_0x257895){return _0x6e9e84['removeTeams'](_0x364139[_0x13fe('0x46')][_0x13fe('0x74')],{'transaction':_0x257895})[_0x13fe('0x25')](function(){if(!_['isEmpty'](_0x479e8b)){return _0x6e9e84[_0x13fe('0x92')](_0x479e8b,{'transaction':_0x257895});}})[_0x13fe('0x25')](function(){_0x479e8b['forEach'](function(_0x20d138){socket[_0x13fe('0x93')](_0x13fe('0x94'),{'UserId':_0x20d138,'ChatQueueId':_0x6e9e84['id']});});});});});});})['then'](respondWithStatusCode(_0x3bc819,null))[_0x13fe('0x2e')](handleError(_0x3bc819,null));};exports[_0x13fe('0x95')]=function(_0x5291b0,_0x59502b,_0x1142c8){return db[_0x13fe('0x40')][_0x13fe('0x60')]({'where':{'id':_0x5291b0['params']['id']}})[_0x13fe('0x25')](handleEntityNotFound(_0x59502b,null))['then'](function(_0x4b620d){if(_0x4b620d){return _0x4b620d['addAgents'](_0x5291b0[_0x13fe('0x63')]['ids'],_[_0x13fe('0x96')](_0x5291b0['body'],[_0x13fe('0x74'),'id'])||{})[_0x13fe('0x97')](function(_0x55dcd9){for(var _0x43a1dc=0x0;_0x43a1dc<_0x5291b0['body'][_0x13fe('0x74')][_0x13fe('0x67')];_0x43a1dc+=0x1){socket[_0x13fe('0x93')](_0x13fe('0x7d'),{'UserId':_0x5291b0['body'][_0x13fe('0x74')][_0x43a1dc],'ChatQueueId':_0x5291b0[_0x13fe('0x5a')]['id']});}return _0x55dcd9;});}})['then'](respondWithResult(_0x59502b,null))[_0x13fe('0x2e')](handleError(_0x59502b,null));};exports[_0x13fe('0x92')]=function(_0x1dfacd,_0x25055b,_0x360861){return db[_0x13fe('0x40')][_0x13fe('0x60')]({'where':{'id':_0x1dfacd[_0x13fe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x25055b,null))[_0x13fe('0x25')](function(_0x2d672f){if(_0x2d672f){return _0x2d672f[_0x13fe('0x92')](_0x1dfacd[_0x13fe('0x46')][_0x13fe('0x74')])[_0x13fe('0x25')](function(){if(_[_0x13fe('0x98')](_0x1dfacd[_0x13fe('0x46')]['ids'])){for(var _0x33496c=0x0;_0x33496c<_0x1dfacd['query']['ids']['length'];_0x33496c+=0x1){socket[_0x13fe('0x93')](_0x13fe('0x94'),{'UserId':Number(_0x1dfacd[_0x13fe('0x46')]['ids'][_0x33496c]),'ChatQueueId':Number(_0x1dfacd[_0x13fe('0x5a')]['id'])});}}else{socket[_0x13fe('0x93')](_0x13fe('0x94'),{'UserId':Number(_0x1dfacd['query'][_0x13fe('0x74')]),'ChatQueueId':Number(_0x1dfacd['params']['id'])});}});}})[_0x13fe('0x25')](respondWithStatusCode(_0x25055b,null))['catch'](handleError(_0x25055b,null));};exports[_0x13fe('0x99')]=function(_0x470f82,_0xb091bd,_0x8092b6){var _0x20e29f={};var _0x41b8fe={};var _0x272c79;var _0x4b584d;return db[_0x13fe('0x40')][_0x13fe('0x66')]({'where':{'id':_0x470f82[_0x13fe('0x5a')]['id']}})['then'](handleEntityNotFound(_0xb091bd,null))[_0x13fe('0x25')](function(_0x5c3799){if(_0x5c3799){_0x272c79=_0x5c3799;_0x41b8fe[_0x13fe('0x45')]=_[_0x13fe('0x47')](db[_0x13fe('0x6a')][_0x13fe('0x41')]);_0x41b8fe[_0x13fe('0x46')]=_[_0x13fe('0x47')](_0x470f82[_0x13fe('0x46')]);_0x41b8fe[_0x13fe('0x48')]=_[_0x13fe('0x4a')](_0x41b8fe[_0x13fe('0x45')],_0x41b8fe[_0x13fe('0x46')]);_0x20e29f[_0x13fe('0x49')]=_['intersection'](_0x41b8fe[_0x13fe('0x45')],qs[_0x13fe('0x4b')](_0x470f82[_0x13fe('0x46')][_0x13fe('0x4b')]));_0x20e29f['attributes']=_0x20e29f[_0x13fe('0x49')][_0x13fe('0x67')]?_0x20e29f[_0x13fe('0x49')]:_0x41b8fe[_0x13fe('0x45')];_0x20e29f[_0x13fe('0x4d')]=qs[_0x13fe('0x4e')](_0x470f82[_0x13fe('0x46')][_0x13fe('0x4e')]);_0x20e29f['where']=qs[_0x13fe('0x48')](_[_0x13fe('0x4f')](_0x470f82[_0x13fe('0x46')],_0x41b8fe[_0x13fe('0x48')]));if(_0x470f82[_0x13fe('0x46')][_0x13fe('0x50')]){_0x20e29f['where']=_[_0x13fe('0x51')](_0x20e29f[_0x13fe('0x54')],{'$or':_[_0x13fe('0x3f')](_0x20e29f[_0x13fe('0x49')],function(_0x39b285){var _0x3d488c={};_0x3d488c[_0x39b285]={'$like':'%'+_0x470f82[_0x13fe('0x46')][_0x13fe('0x50')]+'%'};return _0x3d488c;})});}_0x20e29f=_['merge']({},_0x20e29f,_0x470f82[_0x13fe('0x53')]);return _0x272c79[_0x13fe('0x99')](_0x20e29f);}})[_0x13fe('0x25')](function(_0xac716c){if(_0xac716c){_0x4b584d=_0xac716c['length'];if(!_0x470f82[_0x13fe('0x46')][_0x13fe('0x4c')](_0x13fe('0x68'))){_0x20e29f[_0x13fe('0x35')]=qs[_0x13fe('0x35')](_0x470f82[_0x13fe('0x46')][_0x13fe('0x35')]);_0x20e29f[_0x13fe('0x34')]=qs['offset'](_0x470f82['query']['offset']);}return _0x272c79[_0x13fe('0x99')](_0x20e29f);}})[_0x13fe('0x25')](function(_0x5607fd){if(_0x5607fd){return _0x5607fd?{'count':_0x4b584d,'rows':_0x5607fd}:null;}})[_0x13fe('0x25')](respondWithResult(_0xb091bd,null))[_0x13fe('0x2e')](handleError(_0xb091bd,null));}; \ No newline at end of file +var _0x14cd=['fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','rows','params','fields','include','find','create','body','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','ChatQueueId','UserChatQueue','findAll','User','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','online','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','update','destroy','get','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes'];(function(_0x340976,_0xfc6919){var _0x8c6548=function(_0x3044cf){while(--_0x3044cf){_0x340976['push'](_0x340976['shift']());}};_0x8c6548(++_0xfc6919);}(_0x14cd,0xe6));var _0xd14c=function(_0x49fa34,_0x426464){_0x49fa34=_0x49fa34-0x0;var _0xd54739=_0x14cd[_0x49fa34];return _0xd54739;};'use strict';var pdf=require(_0xd14c('0x0'));var emlformat=require(_0xd14c('0x1'));var rimraf=require(_0xd14c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd14c('0x3'));var moment=require('moment');var BPromise=require(_0xd14c('0x4'));var Mustache=require(_0xd14c('0x5'));var util=require(_0xd14c('0x6'));var path=require(_0xd14c('0x7'));var sox=require(_0xd14c('0x8'));var csv=require('to-csv');var ejs=require(_0xd14c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd14c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd14c('0xb'));var querystring=require(_0xd14c('0xc'));var Papa=require(_0xd14c('0xd'));var Redis=require(_0xd14c('0xe'));var authService=require(_0xd14c('0xf'));var qs=require(_0xd14c('0x10'));var as=require(_0xd14c('0x11'));var hardwareService=require(_0xd14c('0x12'));var logger=require(_0xd14c('0x13'))('api');var utils=require(_0xd14c('0x14'));var config=require(_0xd14c('0x15'));var db=require(_0xd14c('0x16'))['db'];config[_0xd14c('0x17')]=_[_0xd14c('0x18')](config[_0xd14c('0x17')],{'host':_0xd14c('0x19'),'port':0x18eb});var socket=require(_0xd14c('0x1a'))(new Redis(config[_0xd14c('0x17')]));require(_0xd14c('0x1b'))[_0xd14c('0x1c')](socket);var jayson=require(_0xd14c('0x1d'));var client=jayson['client'][_0xd14c('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x1e39a1,_0x4767dd,_0x6ee842){if(_0x6ee842){var _0x447c1d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x447c1d['test'](_0x4767dd)){return _0x1e39a1;}else{throw new db['Sequelize'][(_0xd14c('0x1f'))](_0xd14c('0x20'));}}else{return _0x1e39a1;}}function respondWithRpcPromise(_0xe67e9e,_0x2b682c,_0x195b6d,_0x5f412d){return new BPromise(function(_0x39da5d,_0x4f830b){var _0x4825b8=_0x5f412d||client;return _0x4825b8[_0xd14c('0x21')](_0xe67e9e,_0x195b6d)[_0xd14c('0x22')](function(_0x42ffe1){logger[_0xd14c('0x23')]('ChatQueue,\x20%s,\x20%s',_0x2b682c,_0xd14c('0x24'));logger[_0xd14c('0x25')](_0xd14c('0x26'),_0x2b682c,'request\x20sent',JSON['stringify'](_0x42ffe1));if(_0x42ffe1[_0xd14c('0x27')]){if(_0x42ffe1[_0xd14c('0x27')]['code']===0x1f4){logger[_0xd14c('0x27')](_0xd14c('0x28'),_0x2b682c,_0x42ffe1[_0xd14c('0x27')][_0xd14c('0x29')]);return _0x4f830b(_0x42ffe1[_0xd14c('0x27')]['message']);}logger[_0xd14c('0x27')]('ChatQueue,\x20%s,\x20%s',_0x2b682c,_0x42ffe1[_0xd14c('0x27')][_0xd14c('0x29')]);return _0x39da5d(_0x42ffe1[_0xd14c('0x27')][_0xd14c('0x29')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x2b682c,_0xd14c('0x24'));_0x39da5d(_0x42ffe1[_0xd14c('0x2a')][_0xd14c('0x29')]);}})[_0xd14c('0x2b')](function(_0x28c3da){logger[_0xd14c('0x27')]('ChatQueue,\x20%s,\x20%s',_0x2b682c,_0x28c3da);_0x4f830b(_0x28c3da);});});}function respondWithStatusCode(_0x3bd15f,_0x15d870){_0x15d870=_0x15d870||0xcc;return function(_0x2808b6){if(_0x2808b6){return _0x3bd15f[_0xd14c('0x2c')](_0x15d870);}return _0x3bd15f[_0xd14c('0x2d')](_0x15d870)[_0xd14c('0x2e')]();};}function respondWithResult(_0x114c12,_0x179ff1){_0x179ff1=_0x179ff1||0xc8;return function(_0x284356){if(_0x284356){return _0x114c12[_0xd14c('0x2d')](_0x179ff1)[_0xd14c('0x2f')](_0x284356);}};}function respondWithFilteredResult(_0x3bb85b,_0xc141b8){return function(_0x3ae65b){if(_0x3ae65b){var _0x164b76=_0x3ae65b['count'],_0x41e1ff=_0xc141b8[_0xd14c('0x30')],_0x5f2db9=_0xc141b8[_0xd14c('0x30')]+_0xc141b8['limit'],_0x4b4c87;if(_0x5f2db9>=_0x164b76){_0x5f2db9=_0x164b76;_0x4b4c87=0xc8;}else{_0x4b4c87=0xce;}_0x3bb85b['status'](_0x4b4c87);return _0x3bb85b[_0xd14c('0x31')](_0xd14c('0x32'),_0x41e1ff+'-'+_0x5f2db9+'/'+_0x164b76)[_0xd14c('0x2f')](_0x3ae65b);}return null;};}function patchUpdates(_0xd16ff8){return function(_0x31623c){try{jsonpatch['apply'](_0x31623c,_0xd16ff8,!![]);}catch(_0x5d6fad){return BPromise['reject'](_0x5d6fad);}return _0x31623c['save']();};}function saveUpdates(_0x50dbe1,_0x1193ae){return function(_0x527555){if(_0x527555){return _0x527555[_0xd14c('0x33')](_0x50dbe1)[_0xd14c('0x22')](function(_0x1d3cd1){return _0x1d3cd1;});}return null;};}function removeEntity(_0x322518,_0x30c4f2){return function(_0x514af3){if(_0x514af3){return _0x514af3[_0xd14c('0x34')]()[_0xd14c('0x22')](function(){var _0x4192df=_0x514af3[_0xd14c('0x35')]({'plain':!![]});var _0x566bf6=_0xd14c('0x36');return db['UserProfileResource'][_0xd14c('0x34')]({'where':{'type':_0x566bf6,'resourceId':_0x4192df['id']}})['then'](function(){return _0x514af3;});})['then'](function(){_0x322518[_0xd14c('0x2d')](0xcc)[_0xd14c('0x2e')]();});}};}function handleEntityNotFound(_0x582e4b,_0x3b94ba){return function(_0x4e273b){if(!_0x4e273b){_0x582e4b[_0xd14c('0x2c')](0x194);}return _0x4e273b;};}function handleError(_0x1fbe1a,_0x3f76d3){_0x3f76d3=_0x3f76d3||0x1f4;return function(_0x2b756f){logger['error'](_0x2b756f[_0xd14c('0x37')]);if(_0x2b756f[_0xd14c('0x38')]){delete _0x2b756f[_0xd14c('0x38')];}_0x1fbe1a[_0xd14c('0x2d')](_0x3f76d3)[_0xd14c('0x39')](_0x2b756f);};}exports[_0xd14c('0x3a')]=function(_0x5e8984,_0x4169af){var _0x28159c={},_0x34e11f={},_0x1cd17a={'count':0x0,'rows':[]};var _0x35c241=_[_0xd14c('0x3b')](db[_0xd14c('0x3c')][_0xd14c('0x3d')],function(_0x7fdebc){return{'name':_0x7fdebc[_0xd14c('0x3e')],'type':_0x7fdebc[_0xd14c('0x3f')][_0xd14c('0x40')]};});_0x34e11f[_0xd14c('0x41')]=_['map'](_0x35c241,_0xd14c('0x38'));_0x34e11f[_0xd14c('0x42')]=_[_0xd14c('0x43')](_0x5e8984['query']);_0x34e11f[_0xd14c('0x44')]=_[_0xd14c('0x45')](_0x34e11f[_0xd14c('0x41')],_0x34e11f[_0xd14c('0x42')]);_0x28159c[_0xd14c('0x46')]=_[_0xd14c('0x45')](_0x34e11f['model'],qs['fields'](_0x5e8984[_0xd14c('0x42')]['fields']));_0x28159c['attributes']=_0x28159c['attributes'][_0xd14c('0x47')]?_0x28159c[_0xd14c('0x46')]:_0x34e11f[_0xd14c('0x41')];if(!_0x5e8984[_0xd14c('0x42')][_0xd14c('0x48')](_0xd14c('0x49'))){_0x28159c[_0xd14c('0x4a')]=qs['limit'](_0x5e8984[_0xd14c('0x42')][_0xd14c('0x4a')]);_0x28159c[_0xd14c('0x30')]=qs['offset'](_0x5e8984[_0xd14c('0x42')][_0xd14c('0x30')]);}_0x28159c[_0xd14c('0x4b')]=qs[_0xd14c('0x4c')](_0x5e8984['query']['sort']);_0x28159c[_0xd14c('0x4d')]=qs[_0xd14c('0x44')](_[_0xd14c('0x4e')](_0x5e8984[_0xd14c('0x42')],_0x34e11f[_0xd14c('0x44')]),_0x35c241);if(_0x5e8984[_0xd14c('0x42')][_0xd14c('0x4f')]){_0x28159c['where']=_['merge'](_0x28159c[_0xd14c('0x4d')],{'$or':_['map'](_0x35c241,function(_0x58c7b4){if(_0x58c7b4[_0xd14c('0x3f')]!=='VIRTUAL'){var _0x3d7938={};_0x3d7938[_0x58c7b4[_0xd14c('0x38')]]={'$like':'%'+_0x5e8984[_0xd14c('0x42')][_0xd14c('0x4f')]+'%'};return _0x3d7938;}})});}_0x28159c=_[_0xd14c('0x50')]({},_0x28159c,_0x5e8984[_0xd14c('0x51')]);var _0x59a60d={'where':_0x28159c[_0xd14c('0x4d')]};return db[_0xd14c('0x3c')][_0xd14c('0x52')](_0x59a60d)[_0xd14c('0x22')](function(_0x298557){_0x1cd17a[_0xd14c('0x52')]=_0x298557;if(_0x5e8984[_0xd14c('0x42')][_0xd14c('0x53')]){_0x28159c['include']=[{'all':!![]}];}return db[_0xd14c('0x3c')]['findAll'](_0x28159c);})[_0xd14c('0x22')](function(_0x5ebfc7){_0x1cd17a[_0xd14c('0x54')]=_0x5ebfc7;return _0x1cd17a;})[_0xd14c('0x22')](respondWithFilteredResult(_0x4169af,_0x28159c))[_0xd14c('0x2b')](handleError(_0x4169af,null));};exports['show']=function(_0x5e840b,_0xe90bef){var _0x1069b0={'raw':!![],'where':{'id':_0x5e840b[_0xd14c('0x55')]['id']}},_0x36e4e8={};_0x36e4e8[_0xd14c('0x41')]=_[_0xd14c('0x43')](db[_0xd14c('0x3c')]['rawAttributes']);_0x36e4e8[_0xd14c('0x42')]=_[_0xd14c('0x43')](_0x5e840b['query']);_0x36e4e8[_0xd14c('0x44')]=_[_0xd14c('0x45')](_0x36e4e8['model'],_0x36e4e8[_0xd14c('0x42')]);_0x1069b0[_0xd14c('0x46')]=_[_0xd14c('0x45')](_0x36e4e8['model'],qs[_0xd14c('0x56')](_0x5e840b[_0xd14c('0x42')][_0xd14c('0x56')]));_0x1069b0['attributes']=_0x1069b0['attributes']['length']?_0x1069b0[_0xd14c('0x46')]:_0x36e4e8[_0xd14c('0x41')];if(_0x5e840b[_0xd14c('0x42')][_0xd14c('0x53')]){_0x1069b0[_0xd14c('0x57')]=[{'all':!![]}];}_0x1069b0=_['merge']({},_0x1069b0,_0x5e840b[_0xd14c('0x51')]);return db[_0xd14c('0x3c')][_0xd14c('0x58')](_0x1069b0)[_0xd14c('0x22')](handleEntityNotFound(_0xe90bef,null))[_0xd14c('0x22')](respondWithResult(_0xe90bef,null))[_0xd14c('0x2b')](handleError(_0xe90bef,null));};exports[_0xd14c('0x59')]=function(_0x32f273,_0x3bde9f){return db[_0xd14c('0x3c')][_0xd14c('0x59')](_0x32f273[_0xd14c('0x5a')],{})[_0xd14c('0x22')](function(_0x14d809){var _0x340048=_0x32f273['user'][_0xd14c('0x35')]({'plain':!![]});if(!_0x340048)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x340048[_0xd14c('0x5b')]===_0xd14c('0x5c')){var _0x308a25=_0x14d809[_0xd14c('0x35')]({'plain':!![]});var _0x17fd3d=_0xd14c('0x36');return db[_0xd14c('0x5d')][_0xd14c('0x58')]({'where':{'name':_0x17fd3d,'userProfileId':_0x340048['userProfileId']},'raw':!![]})[_0xd14c('0x22')](function(_0x45d731){if(_0x45d731&&_0x45d731['autoAssociation']===0x0){return db['UserProfileResource'][_0xd14c('0x59')]({'name':_0x308a25[_0xd14c('0x38')],'resourceId':_0x308a25['id'],'type':_0x45d731[_0xd14c('0x38')],'sectionId':_0x45d731['id']},{})[_0xd14c('0x22')](function(){return _0x14d809;});}else{return _0x14d809;}})[_0xd14c('0x2b')](function(_0x406be2){logger[_0xd14c('0x27')](_0xd14c('0x5e'),_0x406be2);throw _0x406be2;});}return _0x14d809;})['then'](respondWithResult(_0x3bde9f,0xc9))[_0xd14c('0x2b')](handleError(_0x3bde9f,null));};exports['update']=function(_0x15fb57,_0x271fa6){if(_0x15fb57[_0xd14c('0x5a')]['id']){delete _0x15fb57[_0xd14c('0x5a')]['id'];}return db[_0xd14c('0x3c')][_0xd14c('0x58')]({'where':{'id':_0x15fb57['params']['id']}})[_0xd14c('0x22')](handleEntityNotFound(_0x271fa6,null))[_0xd14c('0x22')](saveUpdates(_0x15fb57[_0xd14c('0x5a')],null))[_0xd14c('0x22')](respondWithResult(_0x271fa6,null))[_0xd14c('0x2b')](handleError(_0x271fa6,null));};exports[_0xd14c('0x34')]=function(_0x2af097,_0x712005){return db[_0xd14c('0x3c')][_0xd14c('0x58')]({'where':{'id':_0x2af097[_0xd14c('0x55')]['id']}})[_0xd14c('0x22')](handleEntityNotFound(_0x712005,null))[_0xd14c('0x22')](removeEntity(_0x712005,null))[_0xd14c('0x2b')](handleError(_0x712005,null));};exports['describe']=function(_0x54f27a,_0x84cc88){return db[_0xd14c('0x3c')][_0xd14c('0x5f')]()[_0xd14c('0x22')](respondWithResult(_0x84cc88,null))[_0xd14c('0x2b')](handleError(_0x84cc88,null));};exports[_0xd14c('0x60')]=function(_0x3d4ed6,_0x266099,_0xb97f94){var _0x2c3b70={'raw':!![],'where':{}},_0x436ce5={},_0x27c7f8;return db[_0xd14c('0x3c')][_0xd14c('0x61')]({'where':{'id':_0x3d4ed6[_0xd14c('0x55')]['id']}})[_0xd14c('0x22')](handleEntityNotFound(_0x266099,null))[_0xd14c('0x22')](function(_0x59c79e){if(_0x59c79e){_0x27c7f8=_0x59c79e[_0xd14c('0x35')]({'plain':!![]});_0x436ce5[_0xd14c('0x41')]=_[_0xd14c('0x43')](db['UserChatQueue']['rawAttributes']);_0x436ce5[_0xd14c('0x42')]=_[_0xd14c('0x43')](_0x3d4ed6[_0xd14c('0x42')]);_0x436ce5[_0xd14c('0x44')]=_['intersection'](_0x436ce5[_0xd14c('0x41')],_0x436ce5[_0xd14c('0x42')]);_0x2c3b70[_0xd14c('0x46')]=_[_0xd14c('0x45')](_0x436ce5[_0xd14c('0x41')],qs[_0xd14c('0x56')](_0x3d4ed6[_0xd14c('0x42')][_0xd14c('0x56')]));_0x2c3b70[_0xd14c('0x46')]=_0x2c3b70[_0xd14c('0x46')][_0xd14c('0x47')]?_0x2c3b70[_0xd14c('0x46')]:_0x436ce5[_0xd14c('0x41')];if(!_0x3d4ed6[_0xd14c('0x42')]['hasOwnProperty']('nolimit')){_0x2c3b70['limit']=qs[_0xd14c('0x4a')](_0x3d4ed6[_0xd14c('0x42')][_0xd14c('0x4a')]);_0x2c3b70[_0xd14c('0x30')]=qs[_0xd14c('0x30')](_0x3d4ed6[_0xd14c('0x42')][_0xd14c('0x30')]);}_0x2c3b70[_0xd14c('0x4b')]=qs[_0xd14c('0x4c')](_0x3d4ed6['query'][_0xd14c('0x4c')]);_0x2c3b70[_0xd14c('0x4d')]=qs[_0xd14c('0x44')](_[_0xd14c('0x4e')](_0x3d4ed6[_0xd14c('0x42')],_0x436ce5['filters']));_0x2c3b70['where'][_0xd14c('0x62')]=_0x59c79e['id'];if(_0x3d4ed6[_0xd14c('0x42')][_0xd14c('0x4f')]){_0x2c3b70['where']=_[_0xd14c('0x50')](_0x2c3b70['where'],{'$or':_['map'](_0x2c3b70[_0xd14c('0x46')],function(_0x6e543c){var _0x213574={};_0x213574[_0x6e543c]={'$like':'%'+_0x3d4ed6[_0xd14c('0x42')][_0xd14c('0x4f')]+'%'};return _0x213574;})});}_0x2c3b70=_['merge']({},_0x2c3b70,_0x3d4ed6[_0xd14c('0x51')]);return db[_0xd14c('0x63')][_0xd14c('0x64')](_0x2c3b70);}})[_0xd14c('0x22')](function(_0x4ab591){if(_0x4ab591){return db[_0xd14c('0x65')]['findAndCountAll']({'where':{'id':_[_0xd14c('0x3b')](_0x4ab591,_0xd14c('0x66')),'role':_0xd14c('0x67')},'attributes':['id',_0xd14c('0x38'),_0xd14c('0x68'),_0xd14c('0x69'),'createdAt']});}})[_0xd14c('0x22')](function(_0x413487){if(_0x413487){return{'count':_0x413487[_0xd14c('0x52')],'rows':_[_0xd14c('0x3b')](_0x413487[_0xd14c('0x54')],function(_0x15c86e){return{'membername':_0x15c86e['name'],'UserId':_0x15c86e['id'],'queue_name':_0x27c7f8[_0xd14c('0x38')],'ChatQueueId':_0x27c7f8['id'],'interface':util[_0xd14c('0x6a')](_0xd14c('0x6b'),_0xd14c('0x6c'),_0x15c86e[_0xd14c('0x38')]),'penalty':0x0,'paused':_0x15c86e[_0xd14c('0x68')],'createdAt':_0x15c86e[_0xd14c('0x6d')],'updatedAt':_0x15c86e[_0xd14c('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x266099,_0x2c3b70))[_0xd14c('0x2b')](handleError(_0x266099,null));};exports['getTeams']=function(_0x247a43,_0x4de51c,_0x5883fd){var _0x1d502d={};var _0x42948f={};var _0x4ddb90;var _0x43db2e;return db[_0xd14c('0x3c')][_0xd14c('0x61')]({'where':{'id':_0x247a43[_0xd14c('0x55')]['id']}})[_0xd14c('0x22')](handleEntityNotFound(_0x4de51c,null))[_0xd14c('0x22')](function(_0x4d8dfd){if(_0x4d8dfd){_0x4ddb90=_0x4d8dfd;_0x42948f[_0xd14c('0x41')]=_[_0xd14c('0x43')](db[_0xd14c('0x6e')][_0xd14c('0x3d')]);_0x42948f[_0xd14c('0x42')]=_['keys'](_0x247a43[_0xd14c('0x42')]);_0x42948f[_0xd14c('0x44')]=_['intersection'](_0x42948f[_0xd14c('0x41')],_0x42948f[_0xd14c('0x42')]);_0x1d502d['attributes']=_[_0xd14c('0x45')](_0x42948f[_0xd14c('0x41')],qs['fields'](_0x247a43['query']['fields']));_0x1d502d['attributes']=_0x1d502d['attributes'][_0xd14c('0x47')]?_0x1d502d[_0xd14c('0x46')]:_0x42948f[_0xd14c('0x41')];_0x1d502d['order']=qs[_0xd14c('0x4c')](_0x247a43[_0xd14c('0x42')][_0xd14c('0x4c')]);_0x1d502d[_0xd14c('0x4d')]=qs['filters'](_[_0xd14c('0x4e')](_0x247a43[_0xd14c('0x42')],_0x42948f[_0xd14c('0x44')]));if(_0x247a43['query'][_0xd14c('0x4f')]){_0x1d502d['where']=_[_0xd14c('0x50')](_0x1d502d[_0xd14c('0x4d')],{'$or':_[_0xd14c('0x3b')](_0x1d502d[_0xd14c('0x46')],function(_0x4e7c94){var _0x1ba5b5={};_0x1ba5b5[_0x4e7c94]={'$like':'%'+_0x247a43[_0xd14c('0x42')]['filter']+'%'};return _0x1ba5b5;})});}_0x1d502d=_['merge']({},_0x1d502d,_0x247a43[_0xd14c('0x51')]);return _0x4ddb90[_0xd14c('0x6f')](_0x1d502d);}})[_0xd14c('0x22')](function(_0x44bdc0){if(_0x44bdc0){_0x43db2e=_0x44bdc0[_0xd14c('0x47')];if(!_0x247a43['query'][_0xd14c('0x48')]('nolimit')){_0x1d502d[_0xd14c('0x4a')]=qs[_0xd14c('0x4a')](_0x247a43[_0xd14c('0x42')]['limit']);_0x1d502d[_0xd14c('0x30')]=qs[_0xd14c('0x30')](_0x247a43[_0xd14c('0x42')][_0xd14c('0x30')]);}return _0x4ddb90[_0xd14c('0x6f')](_0x1d502d);}})[_0xd14c('0x22')](function(_0x3c26f2){if(_0x3c26f2){return _0x3c26f2?{'count':_0x43db2e,'rows':_0x3c26f2}:null;}})['then'](respondWithResult(_0x4de51c,null))['catch'](handleError(_0x4de51c,null));};exports[_0xd14c('0x70')]=function(_0x263b82,_0x38423e,_0x59b99a){var _0x56378d=_0x263b82[_0xd14c('0x5a')][_0xd14c('0x71')];return db[_0xd14c('0x6e')][_0xd14c('0x64')]({'where':{'id':_0x56378d},'attributes':['id'],'include':[{'model':db[_0xd14c('0x65')],'as':'Agents','attributes':['id',_0xd14c('0x38'),_0xd14c('0x72'),'voicePause','interface'],'raw':!![]}]})[_0xd14c('0x22')](function(_0x19f570){if(_0x19f570){var _0x1e3a2f=_['flatMap'](_0x19f570,function(_0x5da6b9){var _0x7c44dd=_0x5da6b9[_0xd14c('0x35')]({'plain':!![]});return _0x7c44dd[_0xd14c('0x73')];});return db[_0xd14c('0x3c')]['find']({'where':{'id':_0x263b82[_0xd14c('0x55')]['id']}})[_0xd14c('0x22')](function(_0x5b49d1){return db[_0xd14c('0x74')][_0xd14c('0x75')](function(_0x1d9755){return _0x5b49d1[_0xd14c('0x70')](_0x56378d,{'transaction':_0x1d9755})['then'](function(){return BPromise[_0xd14c('0x76')](_0x1e3a2f,function(_0x2340f3){return db[_0xd14c('0x63')][_0xd14c('0x77')]({'where':{'UserId':_0x2340f3['id'],'ChatQueueId':_0x263b82[_0xd14c('0x55')]['id']},'transaction':_0x1d9755});});})[_0xd14c('0x22')](function(){_0x1e3a2f[_0xd14c('0x78')](function(_0x2eaf18){socket[_0xd14c('0x79')](_0xd14c('0x7a'),{'UserId':_0x2eaf18['id'],'ChatQueueId':_0x5b49d1['id']});});});});});}})[_0xd14c('0x22')](respondWithStatusCode(_0x38423e,null))[_0xd14c('0x2b')](handleError(_0x38423e,null));};exports[_0xd14c('0x7b')]=function(_0xd32c0a,_0x177be2,_0x1c3327){return db[_0xd14c('0x6e')][_0xd14c('0x64')]({'where':{'id':_0xd32c0a['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xd14c('0x65')],'as':_0xd14c('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x177be2,null))[_0xd14c('0x22')](function(_0x4c85f5){var _0x17f0dc=_['map'](_0x4c85f5,'id');var _0x3eccd5=[];var _0x3031ce=[];var _0x109865=squel[_0xd14c('0x7c')]();_0x109865['field'](_0xd14c('0x7d'))['from'](_0xd14c('0x7e'),'tq')['join'](_0xd14c('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xd14c('0x4d')](_0xd14c('0x80'),_0xd32c0a[_0xd14c('0x55')]['id']);for(var _0x3721fa=0x0;_0x3721fa<_0x4c85f5['length'];_0x3721fa+=0x1){let _0x6fdcab=_0x4c85f5[_0x3721fa];for(var _0x18eb0c=0x0;_0x18eb0c<_0x6fdcab[_0xd14c('0x73')][_0xd14c('0x47')];_0x18eb0c+=0x1){let _0x5a7a16=_0x6fdcab[_0xd14c('0x73')][_0x18eb0c];var _0x511531=_0x109865[_0xd14c('0x81')]();_0x511531[_0xd14c('0x4d')](_0xd14c('0x82'),_0x5a7a16['id']);_0x3031ce[_0xd14c('0x83')](db['sequelize']['query'](_0x511531[_0xd14c('0x84')](),{'type':db['sequelize']['QueryTypes']['SELECT']})['then'](function(_0x56ba4b){if(_0x56ba4b[_0xd14c('0x47')]===0x1){return _0x5a7a16['id'];}else{var _0x50013b=_[_0xd14c('0x85')](_[_0xd14c('0x3b')](_0x56ba4b,_0xd14c('0x86')),function(_0x42b697){return _[_0xd14c('0x87')](_0x17f0dc,_0x42b697);});if(_0x50013b){return _0x5a7a16['id'];}}}));}}return BPromise[_0xd14c('0x88')](_0x3031ce)[_0xd14c('0x22')](function(_0xb89ed7){_0x3eccd5=_(_0x3eccd5)[_0xd14c('0x89')](_0xb89ed7)[_0xd14c('0x8a')]()[_0xd14c('0x8b')]();return db['ChatQueue']['find']({'where':{'id':_0xd32c0a[_0xd14c('0x55')]['id']}})[_0xd14c('0x22')](function(_0x55ff18){return db['sequelize'][_0xd14c('0x75')](function(_0x43e8b5){return _0x55ff18[_0xd14c('0x7b')](_0xd32c0a[_0xd14c('0x42')]['ids'],{'transaction':_0x43e8b5})['then'](function(){if(!_[_0xd14c('0x8c')](_0x3eccd5)){return _0x55ff18[_0xd14c('0x8d')](_0x3eccd5,{'transaction':_0x43e8b5});}})[_0xd14c('0x22')](function(){_0x3eccd5[_0xd14c('0x78')](function(_0x216faf){socket['emit'](_0xd14c('0x8e'),{'UserId':_0x216faf,'ChatQueueId':_0x55ff18['id']});});});});});});})[_0xd14c('0x22')](respondWithStatusCode(_0x177be2,null))[_0xd14c('0x2b')](handleError(_0x177be2,null));};exports[_0xd14c('0x8f')]=function(_0x4ea8d7,_0x3f2eeb,_0x1cab42){return db[_0xd14c('0x3c')]['find']({'where':{'id':_0x4ea8d7[_0xd14c('0x55')]['id']}})[_0xd14c('0x22')](handleEntityNotFound(_0x3f2eeb,null))['then'](function(_0x3fbf40){if(_0x3fbf40){return _0x3fbf40['addAgents'](_0x4ea8d7['body']['ids'],_['omit'](_0x4ea8d7[_0xd14c('0x5a')],[_0xd14c('0x71'),'id'])||{})[_0xd14c('0x90')](function(_0x34cb13){for(var _0x1cf509=0x0;_0x1cf509<_0x4ea8d7[_0xd14c('0x5a')]['ids'][_0xd14c('0x47')];_0x1cf509+=0x1){socket[_0xd14c('0x79')](_0xd14c('0x7a'),{'UserId':_0x4ea8d7[_0xd14c('0x5a')][_0xd14c('0x71')][_0x1cf509],'ChatQueueId':_0x4ea8d7[_0xd14c('0x55')]['id']});}return _0x34cb13;});}})[_0xd14c('0x22')](respondWithResult(_0x3f2eeb,null))['catch'](handleError(_0x3f2eeb,null));};exports[_0xd14c('0x8d')]=function(_0x2b8ba2,_0x5732d3,_0x4a0125){return db[_0xd14c('0x3c')][_0xd14c('0x58')]({'where':{'id':_0x2b8ba2['params']['id']}})['then'](handleEntityNotFound(_0x5732d3,null))[_0xd14c('0x22')](function(_0x2b0131){if(_0x2b0131){return _0x2b0131[_0xd14c('0x8d')](_0x2b8ba2['query'][_0xd14c('0x71')])['then'](function(){if(_['isArray'](_0x2b8ba2[_0xd14c('0x42')][_0xd14c('0x71')])){for(var _0x42c3f7=0x0;_0x42c3f7<_0x2b8ba2[_0xd14c('0x42')][_0xd14c('0x71')][_0xd14c('0x47')];_0x42c3f7+=0x1){socket[_0xd14c('0x79')](_0xd14c('0x8e'),{'UserId':Number(_0x2b8ba2[_0xd14c('0x42')][_0xd14c('0x71')][_0x42c3f7]),'ChatQueueId':Number(_0x2b8ba2[_0xd14c('0x55')]['id'])});}}else{socket[_0xd14c('0x79')]('userChatQueue:remove',{'UserId':Number(_0x2b8ba2[_0xd14c('0x42')][_0xd14c('0x71')]),'ChatQueueId':Number(_0x2b8ba2[_0xd14c('0x55')]['id'])});}});}})[_0xd14c('0x22')](respondWithStatusCode(_0x5732d3,null))[_0xd14c('0x2b')](handleError(_0x5732d3,null));};exports[_0xd14c('0x91')]=function(_0x306350,_0x54b7ef,_0x23d430){var _0x13a38e={};var _0xab314c={};var _0x7a76cf;var _0x2f7a23;return db[_0xd14c('0x3c')]['findOne']({'where':{'id':_0x306350[_0xd14c('0x55')]['id']}})['then'](handleEntityNotFound(_0x54b7ef,null))[_0xd14c('0x22')](function(_0x147d49){if(_0x147d49){_0x7a76cf=_0x147d49;_0xab314c[_0xd14c('0x41')]=_[_0xd14c('0x43')](db[_0xd14c('0x65')][_0xd14c('0x3d')]);_0xab314c['query']=_[_0xd14c('0x43')](_0x306350[_0xd14c('0x42')]);_0xab314c[_0xd14c('0x44')]=_[_0xd14c('0x45')](_0xab314c[_0xd14c('0x41')],_0xab314c[_0xd14c('0x42')]);_0x13a38e['attributes']=_[_0xd14c('0x45')](_0xab314c[_0xd14c('0x41')],qs[_0xd14c('0x56')](_0x306350[_0xd14c('0x42')]['fields']));_0x13a38e['attributes']=_0x13a38e[_0xd14c('0x46')][_0xd14c('0x47')]?_0x13a38e[_0xd14c('0x46')]:_0xab314c[_0xd14c('0x41')];_0x13a38e['order']=qs[_0xd14c('0x4c')](_0x306350['query'][_0xd14c('0x4c')]);_0x13a38e[_0xd14c('0x4d')]=qs[_0xd14c('0x44')](_[_0xd14c('0x4e')](_0x306350[_0xd14c('0x42')],_0xab314c[_0xd14c('0x44')]));if(_0x306350[_0xd14c('0x42')][_0xd14c('0x4f')]){_0x13a38e[_0xd14c('0x4d')]=_['merge'](_0x13a38e['where'],{'$or':_['map'](_0x13a38e[_0xd14c('0x46')],function(_0x4ae09c){var _0xc7bae3={};_0xc7bae3[_0x4ae09c]={'$like':'%'+_0x306350[_0xd14c('0x42')][_0xd14c('0x4f')]+'%'};return _0xc7bae3;})});}_0x13a38e=_[_0xd14c('0x50')]({},_0x13a38e,_0x306350['options']);return _0x7a76cf[_0xd14c('0x91')](_0x13a38e);}})['then'](function(_0x31a736){if(_0x31a736){_0x2f7a23=_0x31a736[_0xd14c('0x47')];if(!_0x306350[_0xd14c('0x42')][_0xd14c('0x48')](_0xd14c('0x49'))){_0x13a38e[_0xd14c('0x4a')]=qs[_0xd14c('0x4a')](_0x306350[_0xd14c('0x42')]['limit']);_0x13a38e['offset']=qs['offset'](_0x306350[_0xd14c('0x42')][_0xd14c('0x30')]);}return _0x7a76cf[_0xd14c('0x91')](_0x13a38e);}})[_0xd14c('0x22')](function(_0x1b1f30){if(_0x1b1f30){return _0x1b1f30?{'count':_0x2f7a23,'rows':_0x1b1f30}:null;}})['then'](respondWithResult(_0x54b7ef,null))['catch'](handleError(_0x54b7ef,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index a02a1eb..3d3934a 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 _0xbaf0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue'];(function(_0x30e4c0,_0x58fed1){var _0x30b6d0=function(_0x2fe16e){while(--_0x2fe16e){_0x30e4c0['push'](_0x30e4c0['shift']());}};_0x30b6d0(++_0x58fed1);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x0baf('0x0'))['db'][_0x0baf('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0baf('0x2')](0x0);var events={'afterCreate':_0x0baf('0x3'),'afterUpdate':_0x0baf('0x4'),'afterDestroy':_0x0baf('0x5')};function emitEvent(_0x5a3e42){return function(_0x232cc7,_0x1c383e,_0x2d3fa5){ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42+':'+_0x232cc7['id'],_0x232cc7);ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42,_0x232cc7);_0x2d3fa5(null);};}for(var e in events){if(events[_0x0baf('0x7')](e)){var event=events[e];ChatQueue[_0x0baf('0x8')](e,emitEvent(event));}}module[_0x0baf('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x1fa2db,_0x43f5b2){var _0x32bfa2=function(_0x1c5c4c){while(--_0x1c5c4c){_0x1fa2db['push'](_0x1fa2db['shift']());}};_0x32bfa2(++_0x43f5b2);}(_0xb10b,0x12a));var _0xbb10=function(_0x4b0aa3,_0x198647){_0x4b0aa3=_0x4b0aa3-0x0;var _0x126ad5=_0xb10b[_0x4b0aa3];return _0x126ad5;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index b0344f2..5fd424e 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 _0xd7d6=['ChatQueue','chat_queues','lodash','util','api','moment','bluebird','request-promise','./chatQueue.attributes','exports'];(function(_0x443fe6,_0xcc1e25){var _0x1dfbee=function(_0x4263a0){while(--_0x4263a0){_0x443fe6['push'](_0x443fe6['shift']());}};_0x1dfbee(++_0xcc1e25);}(_0xd7d6,0xf2));var _0x6d7d=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0xd7d6[_0x3c22e0];return _0x215811;};'use strict';var _=require(_0x6d7d('0x0'));var util=require(_0x6d7d('0x1'));var logger=require('../../config/logger')(_0x6d7d('0x2'));var moment=require(_0x6d7d('0x3'));var BPromise=require(_0x6d7d('0x4'));var rp=require(_0x6d7d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d7d('0x6'));module[_0x6d7d('0x7')]=function(_0x324b87,_0xcd1318){return _0x324b87['define'](_0x6d7d('0x8'),attributes,{'tableName':_0x6d7d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2d3=['path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x500211,_0x1a0367){var _0x48f4e0=function(_0x47a67e){while(--_0x47a67e){_0x500211['push'](_0x500211['shift']());}};_0x48f4e0(++_0x1a0367);}(_0xa2d3,0x118));var _0x3a2d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa2d3[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x3a2d('0x0'));var util=require(_0x3a2d('0x1'));var logger=require(_0x3a2d('0x2'))(_0x3a2d('0x3'));var moment=require(_0x3a2d('0x4'));var BPromise=require('bluebird');var rp=require(_0x3a2d('0x5'));var fs=require('fs');var path=require(_0x3a2d('0x6'));var rimraf=require(_0x3a2d('0x7'));var config=require(_0x3a2d('0x8'));var attributes=require(_0x3a2d('0x9'));module[_0x3a2d('0xa')]=function(_0x320b6a,_0x2c7789){return _0x320b6a[_0x3a2d('0xb')](_0x3a2d('0xc'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 3bac726..6b74c67 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 _0x4658=['util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','ChatQueue,\x20%s,\x20%s','result','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowChatQueue','find','catch','lodash'];(function(_0x2d9aaa,_0x462688){var _0x28a13d=function(_0x3f1275){while(--_0x3f1275){_0x2d9aaa['push'](_0x2d9aaa['shift']());}};_0x28a13d(++_0x462688);}(_0x4658,0x74));var _0x8465=function(_0x23ae7a,_0x4553dc){_0x23ae7a=_0x23ae7a-0x0;var _0x3a1fa6=_0x4658[_0x23ae7a];return _0x3a1fa6;};'use strict';var _=require(_0x8465('0x0'));var util=require(_0x8465('0x1'));var moment=require(_0x8465('0x2'));var BPromise=require(_0x8465('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8465('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8465('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x8465('0x6'));var jayson=require(_0x8465('0x7'));var client=jayson[_0x8465('0x8')]['http']({'port':0x232a});config[_0x8465('0x9')]=_[_0x8465('0xa')](config[_0x8465('0x9')],{'host':_0x8465('0xb'),'port':0x18eb});var socket=require(_0x8465('0xc'))(new Redis(config['redis']));require('./chatQueue.socket')[_0x8465('0xd')](socket);function respondWithRpcPromise(_0x336a61,_0x945afb,_0x2cbcf1){return new BPromise(function(_0x581839,_0x3cf0c8){return client[_0x8465('0xe')](_0x336a61,_0x2cbcf1)[_0x8465('0xf')](function(_0x207072){logger[_0x8465('0x10')]('ChatQueue,\x20%s,\x20%s',_0x945afb,_0x8465('0x11'));logger[_0x8465('0x12')](_0x8465('0x13'),_0x945afb,_0x8465('0x11'),JSON['stringify'](_0x207072));if(_0x207072['error']){if(_0x207072[_0x8465('0x14')]['code']===0x1f4){logger[_0x8465('0x14')]('ChatQueue,\x20%s,\x20%s',_0x945afb,_0x207072[_0x8465('0x14')][_0x8465('0x15')]);return _0x3cf0c8(_0x207072[_0x8465('0x14')]['message']);}logger[_0x8465('0x14')]('ChatQueue,\x20%s,\x20%s',_0x945afb,_0x207072[_0x8465('0x14')]['message']);return _0x581839(_0x207072['error']['message']);}else{logger[_0x8465('0x10')](_0x8465('0x16'),_0x945afb,_0x8465('0x11'));_0x581839(_0x207072[_0x8465('0x17')][_0x8465('0x15')]);}})['catch'](function(_0x2b3aed){logger[_0x8465('0x14')](_0x8465('0x16'),_0x945afb,_0x2b3aed);_0x3cf0c8(_0x2b3aed);});});}exports[_0x8465('0x18')]=function(_0x332f7b){var _0x11b47d=this;return new Promise(function(_0x350470,_0x3d50eb){return db[_0x8465('0x19')][_0x8465('0x1a')]({'raw':_0x332f7b[_0x8465('0x1b')]?_0x332f7b['options'][_0x8465('0x1c')]===undefined?!![]:![]:!![],'where':_0x332f7b[_0x8465('0x1b')]?_0x332f7b['options'][_0x8465('0x1d')]||null:null,'attributes':_0x332f7b[_0x8465('0x1b')]?_0x332f7b[_0x8465('0x1b')][_0x8465('0x1e')]||null:null,'limit':_0x332f7b[_0x8465('0x1b')]?_0x332f7b[_0x8465('0x1b')][_0x8465('0x1f')]||null:null,'include':_0x332f7b['options']?_0x332f7b[_0x8465('0x1b')][_0x8465('0x20')]?_[_0x8465('0x21')](_0x332f7b[_0x8465('0x1b')][_0x8465('0x20')],function(_0x45680f){return{'model':db[_0x45680f['model']],'as':_0x45680f['as'],'attributes':_0x45680f['attributes'],'include':_0x45680f[_0x8465('0x20')]?_['map'](_0x45680f['include'],function(_0x13d9f2){return{'model':db[_0x13d9f2[_0x8465('0x22')]],'as':_0x13d9f2['as'],'attributes':_0x13d9f2[_0x8465('0x1e')],'include':_0x13d9f2['include']?_[_0x8465('0x21')](_0x13d9f2[_0x8465('0x20')],function(_0x556444){return{'model':db[_0x556444['model']],'as':_0x556444['as'],'attributes':_0x556444['attributes']};}):[]};}):[]};}):[]:[]})[_0x8465('0xf')](function(_0x4f4f36){logger[_0x8465('0x10')](_0x8465('0x18'),_0x332f7b);logger[_0x8465('0x12')](_0x8465('0x18'),_0x332f7b,JSON[_0x8465('0x23')](_0x4f4f36));_0x350470(_0x4f4f36);})['catch'](function(_0x30601f){logger[_0x8465('0x14')](_0x8465('0x18'),_0x30601f[_0x8465('0x15')],_0x332f7b);_0x3d50eb(_0x11b47d[_0x8465('0x14')](0x1f4,_0x30601f[_0x8465('0x15')]));});});};exports[_0x8465('0x24')]=function(_0x4f38da){var _0x26e5cf=this;return new Promise(function(_0x26bc53,_0xfc6075){return db[_0x8465('0x19')][_0x8465('0x25')]({'raw':_0x4f38da[_0x8465('0x1b')]?_0x4f38da[_0x8465('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4f38da[_0x8465('0x1b')]?_0x4f38da['options'][_0x8465('0x1d')]||null:null,'attributes':_0x4f38da[_0x8465('0x1b')]?_0x4f38da[_0x8465('0x1b')][_0x8465('0x1e')]||null:null,'include':_0x4f38da['options']?_0x4f38da[_0x8465('0x1b')][_0x8465('0x20')]?_[_0x8465('0x21')](_0x4f38da[_0x8465('0x1b')][_0x8465('0x20')],function(_0x3e33f6){return{'model':db[_0x3e33f6['model']],'as':_0x3e33f6['as'],'attributes':_0x3e33f6['attributes'],'include':_0x3e33f6[_0x8465('0x20')]?_['map'](_0x3e33f6[_0x8465('0x20')],function(_0x5c41f3){return{'model':db[_0x5c41f3[_0x8465('0x22')]],'as':_0x5c41f3['as'],'attributes':_0x5c41f3[_0x8465('0x1e')],'include':_0x5c41f3[_0x8465('0x20')]?_['map'](_0x5c41f3[_0x8465('0x20')],function(_0x1ef187){return{'model':db[_0x1ef187[_0x8465('0x22')]],'as':_0x1ef187['as'],'attributes':_0x1ef187['attributes']};}):[]};}):[]};}):[]:[]})[_0x8465('0xf')](function(_0x4e5156){logger['info'](_0x8465('0x24'),_0x4f38da);logger['debug'](_0x8465('0x24'),_0x4f38da,JSON[_0x8465('0x23')](_0x4e5156));_0x26bc53(_0x4e5156);})[_0x8465('0x26')](function(_0x216e8f){logger[_0x8465('0x14')]('ShowChatQueue',_0x216e8f[_0x8465('0x15')],_0x4f38da);_0xfc6075(_0x26e5cf['error'](0x1f4,_0x216e8f[_0x8465('0x15')]));});});}; \ No newline at end of file +var _0x9e63=['code','message','catch','GetChatQueue','findAll','options','raw','where','attributes','limit','include','map','then','ShowChatQueue','ChatQueue','find','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3e1a4e,_0x39984b){var _0x120c7d=function(_0x49a349){while(--_0x49a349){_0x3e1a4e['push'](_0x3e1a4e['shift']());}};_0x120c7d(++_0x39984b);}(_0x9e63,0x65));var _0x39e6=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0x9e63[_0x481bf7];return _0x461787;};'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});config[_0x39e6('0xc')]=_[_0x39e6('0xd')](config['redis'],{'host':_0x39e6('0xe'),'port':0x18eb});var socket=require(_0x39e6('0xf'))(new Redis(config['redis']));require(_0x39e6('0x10'))['register'](socket);function respondWithRpcPromise(_0x5ddfd6,_0x37731c,_0xfbdcd){return new BPromise(function(_0x3e5fec,_0x2d4acf){return client[_0x39e6('0x11')](_0x5ddfd6,_0xfbdcd)['then'](function(_0x4fcb02){logger[_0x39e6('0x12')](_0x39e6('0x13'),_0x37731c,_0x39e6('0x14'));logger[_0x39e6('0x15')](_0x39e6('0x16'),_0x37731c,'request\x20sent',JSON[_0x39e6('0x17')](_0x4fcb02));if(_0x4fcb02[_0x39e6('0x18')]){if(_0x4fcb02[_0x39e6('0x18')][_0x39e6('0x19')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x37731c,_0x4fcb02[_0x39e6('0x18')][_0x39e6('0x1a')]);return _0x2d4acf(_0x4fcb02[_0x39e6('0x18')][_0x39e6('0x1a')]);}logger[_0x39e6('0x18')]('ChatQueue,\x20%s,\x20%s',_0x37731c,_0x4fcb02[_0x39e6('0x18')][_0x39e6('0x1a')]);return _0x3e5fec(_0x4fcb02[_0x39e6('0x18')][_0x39e6('0x1a')]);}else{logger[_0x39e6('0x12')](_0x39e6('0x13'),_0x37731c,_0x39e6('0x14'));_0x3e5fec(_0x4fcb02['result'][_0x39e6('0x1a')]);}})[_0x39e6('0x1b')](function(_0x297060){logger['error']('ChatQueue,\x20%s,\x20%s',_0x37731c,_0x297060);_0x2d4acf(_0x297060);});});}exports[_0x39e6('0x1c')]=function(_0x445f12){var _0x1d81aa=this;return new Promise(function(_0x2d9a98,_0x18031b){return db['ChatQueue'][_0x39e6('0x1d')]({'raw':_0x445f12['options']?_0x445f12[_0x39e6('0x1e')][_0x39e6('0x1f')]===undefined?!![]:![]:!![],'where':_0x445f12['options']?_0x445f12[_0x39e6('0x1e')][_0x39e6('0x20')]||null:null,'attributes':_0x445f12[_0x39e6('0x1e')]?_0x445f12[_0x39e6('0x1e')][_0x39e6('0x21')]||null:null,'limit':_0x445f12[_0x39e6('0x1e')]?_0x445f12[_0x39e6('0x1e')][_0x39e6('0x22')]||null:null,'include':_0x445f12[_0x39e6('0x1e')]?_0x445f12[_0x39e6('0x1e')][_0x39e6('0x23')]?_[_0x39e6('0x24')](_0x445f12[_0x39e6('0x1e')]['include'],function(_0x537462){return{'model':db[_0x537462['model']],'as':_0x537462['as'],'attributes':_0x537462['attributes'],'include':_0x537462[_0x39e6('0x23')]?_[_0x39e6('0x24')](_0x537462[_0x39e6('0x23')],function(_0x19f780){return{'model':db[_0x19f780['model']],'as':_0x19f780['as'],'attributes':_0x19f780[_0x39e6('0x21')],'include':_0x19f780[_0x39e6('0x23')]?_['map'](_0x19f780[_0x39e6('0x23')],function(_0x1a60ae){return{'model':db[_0x1a60ae['model']],'as':_0x1a60ae['as'],'attributes':_0x1a60ae[_0x39e6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x39e6('0x25')](function(_0xc3c7fe){logger[_0x39e6('0x12')](_0x39e6('0x1c'),_0x445f12);logger['debug'](_0x39e6('0x1c'),_0x445f12,JSON['stringify'](_0xc3c7fe));_0x2d9a98(_0xc3c7fe);})[_0x39e6('0x1b')](function(_0x14c4d3){logger[_0x39e6('0x18')](_0x39e6('0x1c'),_0x14c4d3[_0x39e6('0x1a')],_0x445f12);_0x18031b(_0x1d81aa[_0x39e6('0x18')](0x1f4,_0x14c4d3[_0x39e6('0x1a')]));});});};exports[_0x39e6('0x26')]=function(_0x3ff99c){var _0x1ac113=this;return new Promise(function(_0x32a2ca,_0x251568){return db[_0x39e6('0x27')][_0x39e6('0x28')]({'raw':_0x3ff99c[_0x39e6('0x1e')]?_0x3ff99c[_0x39e6('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3ff99c[_0x39e6('0x1e')]?_0x3ff99c[_0x39e6('0x1e')][_0x39e6('0x20')]||null:null,'attributes':_0x3ff99c['options']?_0x3ff99c[_0x39e6('0x1e')][_0x39e6('0x21')]||null:null,'include':_0x3ff99c[_0x39e6('0x1e')]?_0x3ff99c['options'][_0x39e6('0x23')]?_['map'](_0x3ff99c[_0x39e6('0x1e')][_0x39e6('0x23')],function(_0x1a1580){return{'model':db[_0x1a1580['model']],'as':_0x1a1580['as'],'attributes':_0x1a1580[_0x39e6('0x21')],'include':_0x1a1580[_0x39e6('0x23')]?_[_0x39e6('0x24')](_0x1a1580[_0x39e6('0x23')],function(_0x4937e1){return{'model':db[_0x4937e1['model']],'as':_0x4937e1['as'],'attributes':_0x4937e1[_0x39e6('0x21')],'include':_0x4937e1[_0x39e6('0x23')]?_[_0x39e6('0x24')](_0x4937e1[_0x39e6('0x23')],function(_0xbbc3a3){return{'model':db[_0xbbc3a3[_0x39e6('0x29')]],'as':_0xbbc3a3['as'],'attributes':_0xbbc3a3[_0x39e6('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3926a0){logger['info']('ShowChatQueue',_0x3ff99c);logger[_0x39e6('0x15')](_0x39e6('0x26'),_0x3ff99c,JSON[_0x39e6('0x17')](_0x3926a0));_0x32a2ca(_0x3926a0);})[_0x39e6('0x1b')](function(_0x1f92b2){logger[_0x39e6('0x18')](_0x39e6('0x26'),_0x1f92b2[_0x39e6('0x1a')],_0x3ff99c);_0x251568(_0x1ac113['error'](0x1f4,_0x1f92b2[_0x39e6('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 879e662..3f2e978 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatQueue:','./chatQueue.events','save'];(function(_0x13409a,_0x8f949e){var _0x12815b=function(_0x4ee9ab){while(--_0x4ee9ab){_0x13409a['push'](_0x13409a['shift']());}};_0x12815b(++_0x8f949e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3a813b,_0x477bba){_0x3a813b=_0x3a813b-0x0;var _0x43199a=_0x5f2f[_0x3a813b];return _0x43199a;};'use strict';var ChatQueueEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatQueueEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatQueueEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x48c2ae,_0x4cea90){var _0x8f7531=function(_0x126458){while(--_0x126458){_0x48c2ae['push'](_0x48c2ae['shift']());}};_0x8f7531(++_0x4cea90);}(_0xb10b,0x12a));var _0xbb10=function(_0x234341,_0x1f0568){_0x234341=_0x234341-0x0;var _0x2fd6e9=_0xb10b[_0x234341];return _0x2fd6e9;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index ab6180c..025bdb2 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 _0x2fe8=['/:id/users','addAgents','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','show','getMembers','/:id/teams','getTeams','post','create','addTeams'];(function(_0x50b471,_0x3fa947){var _0x1adfa5=function(_0x5b3a6d){while(--_0x5b3a6d){_0x50b471['push'](_0x50b471['shift']());}};_0x1adfa5(++_0x3fa947);}(_0x2fe8,0x132));var _0x82fe=function(_0x584a03,_0x59e0c8){_0x584a03=_0x584a03-0x0;var _0x29d9c9=_0x2fe8[_0x584a03];return _0x29d9c9;};'use strict';var multer=require(_0x82fe('0x0'));var util=require(_0x82fe('0x1'));var path=require(_0x82fe('0x2'));var timeout=require('connect-timeout');var express=require(_0x82fe('0x3'));var router=express[_0x82fe('0x4')]();var auth=require(_0x82fe('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x82fe('0x6'));router[_0x82fe('0x7')]('/',auth[_0x82fe('0x8')](),controller[_0x82fe('0x9')]);router['get']('/describe',auth[_0x82fe('0x8')](),controller[_0x82fe('0xa')]);router['get'](_0x82fe('0xb'),auth[_0x82fe('0x8')](),controller[_0x82fe('0xc')]);router['get']('/:id/members',auth[_0x82fe('0x8')](),controller[_0x82fe('0xd')]);router[_0x82fe('0x7')](_0x82fe('0xe'),auth[_0x82fe('0x8')](),controller[_0x82fe('0xf')]);router[_0x82fe('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x82fe('0x10')]('/',auth['isAuthenticated'](),controller[_0x82fe('0x11')]);router[_0x82fe('0x10')]('/:id/teams',auth[_0x82fe('0x8')](),controller[_0x82fe('0x12')]);router[_0x82fe('0x10')](_0x82fe('0x13'),auth[_0x82fe('0x8')](),controller[_0x82fe('0x14')]);router['put']('/:id',auth[_0x82fe('0x8')](),controller[_0x82fe('0x15')]);router[_0x82fe('0x16')](_0x82fe('0xb'),auth[_0x82fe('0x8')](),controller[_0x82fe('0x17')]);router[_0x82fe('0x16')](_0x82fe('0xe'),auth[_0x82fe('0x8')](),controller['removeTeams']);router[_0x82fe('0x16')](_0x82fe('0x13'),auth[_0x82fe('0x8')](),controller['removeAgents']);module[_0x82fe('0x18')]=router; \ No newline at end of file +var _0xbcd9=['getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatQueue.controller','isAuthenticated','index','get','describe','/:id','show','/:id/members','getMembers','/:id/teams'];(function(_0x5427c8,_0x18f384){var _0x33a129=function(_0x1940e8){while(--_0x1940e8){_0x5427c8['push'](_0x5427c8['shift']());}};_0x33a129(++_0x18f384);}(_0xbcd9,0x85));var _0x9bcd=function(_0x3e990e,_0x217278){_0x3e990e=_0x3e990e-0x0;var _0x3c95f5=_0xbcd9[_0x3e990e];return _0x3c95f5;};'use strict';var multer=require(_0x9bcd('0x0'));var util=require(_0x9bcd('0x1'));var path=require(_0x9bcd('0x2'));var timeout=require(_0x9bcd('0x3'));var express=require('express');var router=express[_0x9bcd('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9bcd('0x5'));var config=require(_0x9bcd('0x6'));var controller=require(_0x9bcd('0x7'));router['get']('/',auth[_0x9bcd('0x8')](),controller[_0x9bcd('0x9')]);router[_0x9bcd('0xa')]('/describe',auth[_0x9bcd('0x8')](),controller[_0x9bcd('0xb')]);router[_0x9bcd('0xa')](_0x9bcd('0xc'),auth[_0x9bcd('0x8')](),controller[_0x9bcd('0xd')]);router[_0x9bcd('0xa')](_0x9bcd('0xe'),auth['isAuthenticated'](),controller[_0x9bcd('0xf')]);router['get'](_0x9bcd('0x10'),auth['isAuthenticated'](),controller[_0x9bcd('0x11')]);router[_0x9bcd('0xa')](_0x9bcd('0x12'),auth[_0x9bcd('0x8')](),controller[_0x9bcd('0x13')]);router[_0x9bcd('0x14')]('/',auth[_0x9bcd('0x8')](),controller[_0x9bcd('0x15')]);router['post']('/:id/teams',auth[_0x9bcd('0x8')](),controller[_0x9bcd('0x16')]);router[_0x9bcd('0x14')](_0x9bcd('0x12'),auth[_0x9bcd('0x8')](),controller[_0x9bcd('0x17')]);router['put'](_0x9bcd('0xc'),auth[_0x9bcd('0x8')](),controller[_0x9bcd('0x18')]);router['delete'](_0x9bcd('0xc'),auth['isAuthenticated'](),controller[_0x9bcd('0x19')]);router[_0x9bcd('0x1a')](_0x9bcd('0x10'),auth[_0x9bcd('0x8')](),controller[_0x9bcd('0x1b')]);router['delete']('/:id/users',auth[_0x9bcd('0x8')](),controller[_0x9bcd('0x1c')]);module[_0x9bcd('0x1d')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 5461e68..f820122 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 _0x291e=['moment','sequelize','exports','STRING','DATE'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x291e,0xfa));var _0xe291=function(_0x401a69,_0x42e273){_0x401a69=_0x401a69-0x0;var _0x30508f=_0x291e[_0x401a69];return _0x30508f;};'use strict';var moment=require(_0xe291('0x0'));var Sequelize=require(_0xe291('0x1'));module[_0xe291('0x2')]={'uniqueid':{'type':Sequelize[_0xe291('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe291('0x3')]},'joinAt':{'type':Sequelize[_0xe291('0x4')]},'leaveAt':{'type':Sequelize[_0xe291('0x4')]},'acceptAt':{'type':Sequelize[_0xe291('0x4')]},'exitAt':{'type':Sequelize[_0xe291('0x4')]},'reason':{'type':Sequelize[_0xe291('0x3')]}}; \ No newline at end of file +var _0x79ba=['STRING','DATE','moment','sequelize','exports'];(function(_0x247a4e,_0x5d6cfc){var _0x115bd5=function(_0x521fa6){while(--_0x521fa6){_0x247a4e['push'](_0x247a4e['shift']());}};_0x115bd5(++_0x5d6cfc);}(_0x79ba,0xde));var _0xa79b=function(_0x44124b,_0x2b2b32){_0x44124b=_0x44124b-0x0;var _0xafe8bf=_0x79ba[_0x44124b];return _0xafe8bf;};'use strict';var moment=require(_0xa79b('0x0'));var Sequelize=require(_0xa79b('0x1'));module[_0xa79b('0x2')]={'uniqueid':{'type':Sequelize[_0xa79b('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xa79b('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa79b('0x4')]},'acceptAt':{'type':Sequelize[_0xa79b('0x4')]},'exitAt':{'type':Sequelize[_0xa79b('0x4')]},'reason':{'type':Sequelize[_0xa79b('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index f521df6..d07593f 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 _0xcb91=['options','includeAll','include','findAll','params','find','catch','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','ChatQueueReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge'];(function(_0x2ddafa,_0x3ad0aa){var _0x319f45=function(_0x5be9bd){while(--_0x5be9bd){_0x2ddafa['push'](_0x2ddafa['shift']());}};_0x319f45(++_0x3ad0aa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0xcb91[_0x4d2f00];return _0x2d7b7f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1cb9('0x0'));var zipdir=require(_0x1cb9('0x1'));var jsonpatch=require(_0x1cb9('0x2'));var rp=require(_0x1cb9('0x3'));var moment=require('moment');var BPromise=require(_0x1cb9('0x4'));var Mustache=require(_0x1cb9('0x5'));var util=require('util');var path=require(_0x1cb9('0x6'));var sox=require(_0x1cb9('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb9('0x8'));var fs=require('fs');var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xd'));var authService=require(_0x1cb9('0xe'));var qs=require(_0x1cb9('0xf'));var as=require(_0x1cb9('0x10'));var hardwareService=require(_0x1cb9('0x11'));var logger=require('../../config/logger')(_0x1cb9('0x12'));var utils=require(_0x1cb9('0x13'));var config=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x46af58,_0x5445e1){_0x5445e1=_0x5445e1||0xcc;return function(_0x5e3c19){if(_0x5e3c19){return _0x46af58['sendStatus'](_0x5445e1);}return _0x46af58[_0x1cb9('0x16')](_0x5445e1)[_0x1cb9('0x17')]();};}function respondWithResult(_0x384496,_0x1c714f){_0x1c714f=_0x1c714f||0xc8;return function(_0x56884d){if(_0x56884d){return _0x384496[_0x1cb9('0x16')](_0x1c714f)[_0x1cb9('0x18')](_0x56884d);}};}function respondWithFilteredResult(_0x1b3cd7,_0x8dfa55){return function(_0x3e2d11){if(_0x3e2d11){var _0x5806d8=_0x3e2d11[_0x1cb9('0x19')],_0x5572cb=_0x8dfa55[_0x1cb9('0x1a')],_0xd446a3=_0x8dfa55[_0x1cb9('0x1a')]+_0x8dfa55[_0x1cb9('0x1b')],_0x3cc765;if(_0xd446a3>=_0x5806d8){_0xd446a3=_0x5806d8;_0x3cc765=0xc8;}else{_0x3cc765=0xce;}_0x1b3cd7[_0x1cb9('0x16')](_0x3cc765);return _0x1b3cd7['set']('Content-Range',_0x5572cb+'-'+_0xd446a3+'/'+_0x5806d8)[_0x1cb9('0x18')](_0x3e2d11);}return null;};}function patchUpdates(_0x41ac41){return function(_0x2b2669){try{jsonpatch[_0x1cb9('0x1c')](_0x2b2669,_0x41ac41,!![]);}catch(_0x280a84){return BPromise[_0x1cb9('0x1d')](_0x280a84);}return _0x2b2669[_0x1cb9('0x1e')]();};}function saveUpdates(_0x4ac422,_0x559bcc){return function(_0x1a5a72){if(_0x1a5a72){return _0x1a5a72['update'](_0x4ac422)[_0x1cb9('0x1f')](function(_0x2265ea){return _0x2265ea;});}return null;};}function removeEntity(_0x523b26,_0x599275){return function(_0x2e3854){if(_0x2e3854){return _0x2e3854[_0x1cb9('0x20')]()[_0x1cb9('0x1f')](function(){_0x523b26[_0x1cb9('0x16')](0xcc)[_0x1cb9('0x17')]();});}};}function handleEntityNotFound(_0x27db16,_0x59ebea){return function(_0x55b232){if(!_0x55b232){_0x27db16[_0x1cb9('0x21')](0x194);}return _0x55b232;};}function handleError(_0x557199,_0x10a419){_0x10a419=_0x10a419||0x1f4;return function(_0x2b1275){logger[_0x1cb9('0x22')](_0x2b1275[_0x1cb9('0x23')]);if(_0x2b1275[_0x1cb9('0x24')]){delete _0x2b1275['name'];}_0x557199[_0x1cb9('0x16')](_0x10a419)[_0x1cb9('0x25')](_0x2b1275);};}exports['index']=function(_0xd6891c,_0x21effa){var _0x41a9a0={},_0x1804fd={},_0x406821={'count':0x0,'rows':[]};var _0x21d6f5=_[_0x1cb9('0x26')](db[_0x1cb9('0x27')][_0x1cb9('0x28')],function(_0x9de64b){return{'name':_0x9de64b['fieldName'],'type':_0x9de64b[_0x1cb9('0x29')]['key']};});_0x1804fd[_0x1cb9('0x2a')]=_['map'](_0x21d6f5,_0x1cb9('0x24'));_0x1804fd[_0x1cb9('0x2b')]=_[_0x1cb9('0x2c')](_0xd6891c[_0x1cb9('0x2b')]);_0x1804fd['filters']=_[_0x1cb9('0x2d')](_0x1804fd['model'],_0x1804fd[_0x1cb9('0x2b')]);_0x41a9a0[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x1804fd['model'],qs[_0x1cb9('0x2f')](_0xd6891c['query'][_0x1cb9('0x2f')]));_0x41a9a0['attributes']=_0x41a9a0[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x41a9a0[_0x1cb9('0x2e')]:_0x1804fd[_0x1cb9('0x2a')];if(!_0xd6891c['query'][_0x1cb9('0x31')](_0x1cb9('0x32'))){_0x41a9a0[_0x1cb9('0x1b')]=qs[_0x1cb9('0x1b')](_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x1b')]);_0x41a9a0[_0x1cb9('0x1a')]=qs[_0x1cb9('0x1a')](_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x1a')]);}_0x41a9a0[_0x1cb9('0x33')]=qs[_0x1cb9('0x34')](_0xd6891c[_0x1cb9('0x2b')]['sort']);_0x41a9a0['where']=qs[_0x1cb9('0x35')](_[_0x1cb9('0x36')](_0xd6891c[_0x1cb9('0x2b')],_0x1804fd[_0x1cb9('0x35')]),_0x21d6f5);if(_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x37')]){_0x41a9a0[_0x1cb9('0x38')]=_[_0x1cb9('0x39')](_0x41a9a0['where'],{'$or':_[_0x1cb9('0x26')](_0x21d6f5,function(_0x1482c4){if(_0x1482c4[_0x1cb9('0x29')]!=='VIRTUAL'){var _0x2a5aac={};_0x2a5aac[_0x1482c4['name']]={'$like':'%'+_0xd6891c[_0x1cb9('0x2b')]['filter']+'%'};return _0x2a5aac;}})});}_0x41a9a0=_[_0x1cb9('0x39')]({},_0x41a9a0,_0xd6891c[_0x1cb9('0x3a')]);var _0x289b73={'where':_0x41a9a0[_0x1cb9('0x38')]};return db[_0x1cb9('0x27')][_0x1cb9('0x19')](_0x289b73)[_0x1cb9('0x1f')](function(_0x4a4788){_0x406821['count']=_0x4a4788;if(_0xd6891c[_0x1cb9('0x2b')][_0x1cb9('0x3b')]){_0x41a9a0[_0x1cb9('0x3c')]=[{'all':!![]}];}return db[_0x1cb9('0x27')][_0x1cb9('0x3d')](_0x41a9a0);})[_0x1cb9('0x1f')](function(_0x32130b){_0x406821['rows']=_0x32130b;return _0x406821;})[_0x1cb9('0x1f')](respondWithFilteredResult(_0x21effa,_0x41a9a0))['catch'](handleError(_0x21effa,null));};exports['show']=function(_0x4c6c75,_0x409c62){var _0x397ff9={'raw':!![],'where':{'id':_0x4c6c75[_0x1cb9('0x3e')]['id']}},_0x1bf51c={};_0x1bf51c[_0x1cb9('0x2a')]=_['keys'](db[_0x1cb9('0x27')]['rawAttributes']);_0x1bf51c[_0x1cb9('0x2b')]=_[_0x1cb9('0x2c')](_0x4c6c75[_0x1cb9('0x2b')]);_0x1bf51c['filters']=_[_0x1cb9('0x2d')](_0x1bf51c['model'],_0x1bf51c[_0x1cb9('0x2b')]);_0x397ff9[_0x1cb9('0x2e')]=_['intersection'](_0x1bf51c['model'],qs[_0x1cb9('0x2f')](_0x4c6c75[_0x1cb9('0x2b')][_0x1cb9('0x2f')]));_0x397ff9[_0x1cb9('0x2e')]=_0x397ff9[_0x1cb9('0x2e')]['length']?_0x397ff9[_0x1cb9('0x2e')]:_0x1bf51c['model'];if(_0x4c6c75['query']['includeAll']){_0x397ff9[_0x1cb9('0x3c')]=[{'all':!![]}];}_0x397ff9=_[_0x1cb9('0x39')]({},_0x397ff9,_0x4c6c75[_0x1cb9('0x3a')]);return db[_0x1cb9('0x27')][_0x1cb9('0x3f')](_0x397ff9)[_0x1cb9('0x1f')](handleEntityNotFound(_0x409c62,null))[_0x1cb9('0x1f')](respondWithResult(_0x409c62,null))[_0x1cb9('0x40')](handleError(_0x409c62,null));};exports[_0x1cb9('0x41')]=function(_0x148a01,_0x3ea88c){return db['ChatQueueReport'][_0x1cb9('0x41')](_0x148a01[_0x1cb9('0x42')],{})[_0x1cb9('0x1f')](respondWithResult(_0x3ea88c,0xc9))['catch'](handleError(_0x3ea88c,null));};exports[_0x1cb9('0x43')]=function(_0x57251,_0x3c6044){if(_0x57251[_0x1cb9('0x42')]['id']){delete _0x57251[_0x1cb9('0x42')]['id'];}return db['ChatQueueReport'][_0x1cb9('0x3f')]({'where':{'id':_0x57251['params']['id']}})[_0x1cb9('0x1f')](handleEntityNotFound(_0x3c6044,null))['then'](saveUpdates(_0x57251[_0x1cb9('0x42')],null))[_0x1cb9('0x1f')](respondWithResult(_0x3c6044,null))[_0x1cb9('0x40')](handleError(_0x3c6044,null));};exports[_0x1cb9('0x20')]=function(_0x56d0c5,_0x298475){return db[_0x1cb9('0x27')][_0x1cb9('0x3f')]({'where':{'id':_0x56d0c5[_0x1cb9('0x3e')]['id']}})[_0x1cb9('0x1f')](handleEntityNotFound(_0x298475,null))[_0x1cb9('0x1f')](removeEntity(_0x298475,null))[_0x1cb9('0x40')](handleError(_0x298475,null));};exports[_0x1cb9('0x44')]=function(_0xbb500e,_0x17f10e){return db['ChatQueueReport']['describe']()[_0x1cb9('0x1f')](respondWithResult(_0x17f10e,null))[_0x1cb9('0x40')](handleError(_0x17f10e,null));}; \ No newline at end of file +var _0xb7e7=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','ChatQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','describe','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','jsforce'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xb7e7[_0x38a7ac];return _0x53061a;};'use strict';var pdf=require(_0x7b7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7e('0x2'));var rp=require('request-promise');var moment=require(_0x7b7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b7e('0x4'));var util=require(_0x7b7e('0x5'));var path=require(_0x7b7e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b7e('0x7'));var fs=require('fs');var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var db=require(_0x7b7e('0x17'))['db'];function respondWithStatusCode(_0x55620b,_0xaadda){_0xaadda=_0xaadda||0xcc;return function(_0x54d8ce){if(_0x54d8ce){return _0x55620b[_0x7b7e('0x18')](_0xaadda);}return _0x55620b[_0x7b7e('0x19')](_0xaadda)['end']();};}function respondWithResult(_0x422d3a,_0x5976ac){_0x5976ac=_0x5976ac||0xc8;return function(_0x4c6011){if(_0x4c6011){return _0x422d3a[_0x7b7e('0x19')](_0x5976ac)[_0x7b7e('0x1a')](_0x4c6011);}};}function respondWithFilteredResult(_0xf067da,_0x457ec5){return function(_0x3d2fb2){if(_0x3d2fb2){var _0x5703fd=_0x3d2fb2[_0x7b7e('0x1b')],_0x51baf6=_0x457ec5[_0x7b7e('0x1c')],_0xc7f087=_0x457ec5[_0x7b7e('0x1c')]+_0x457ec5[_0x7b7e('0x1d')],_0x36444d;if(_0xc7f087>=_0x5703fd){_0xc7f087=_0x5703fd;_0x36444d=0xc8;}else{_0x36444d=0xce;}_0xf067da[_0x7b7e('0x19')](_0x36444d);return _0xf067da[_0x7b7e('0x1e')](_0x7b7e('0x1f'),_0x51baf6+'-'+_0xc7f087+'/'+_0x5703fd)[_0x7b7e('0x1a')](_0x3d2fb2);}return null;};}function patchUpdates(_0x12e8e9){return function(_0x14f4fe){try{jsonpatch[_0x7b7e('0x20')](_0x14f4fe,_0x12e8e9,!![]);}catch(_0x3bec7d){return BPromise[_0x7b7e('0x21')](_0x3bec7d);}return _0x14f4fe[_0x7b7e('0x22')]();};}function saveUpdates(_0x3a7b8b,_0x49eddb){return function(_0x69262b){if(_0x69262b){return _0x69262b[_0x7b7e('0x23')](_0x3a7b8b)[_0x7b7e('0x24')](function(_0x4c0647){return _0x4c0647;});}return null;};}function removeEntity(_0x313122,_0xbf0cb3){return function(_0x14243b){if(_0x14243b){return _0x14243b[_0x7b7e('0x25')]()[_0x7b7e('0x24')](function(){_0x313122[_0x7b7e('0x19')](0xcc)[_0x7b7e('0x26')]();});}};}function handleEntityNotFound(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(!_0x5d6215){_0x10a66a['sendStatus'](0x194);}return _0x5d6215;};}function handleError(_0x26ee14,_0x22598e){_0x22598e=_0x22598e||0x1f4;return function(_0x23bfa3){logger['error'](_0x23bfa3['stack']);if(_0x23bfa3['name']){delete _0x23bfa3[_0x7b7e('0x27')];}_0x26ee14[_0x7b7e('0x19')](_0x22598e)[_0x7b7e('0x28')](_0x23bfa3);};}exports[_0x7b7e('0x29')]=function(_0x3ceaf5,_0x48fad1){var _0x6a1e71={},_0x21a15={},_0x4c46b8={'count':0x0,'rows':[]};var _0x57b9da=_['map'](db[_0x7b7e('0x2a')][_0x7b7e('0x2b')],function(_0x503625){return{'name':_0x503625[_0x7b7e('0x2c')],'type':_0x503625['type'][_0x7b7e('0x2d')]};});_0x21a15[_0x7b7e('0x2e')]=_[_0x7b7e('0x2f')](_0x57b9da,'name');_0x21a15[_0x7b7e('0x30')]=_[_0x7b7e('0x31')](_0x3ceaf5[_0x7b7e('0x30')]);_0x21a15[_0x7b7e('0x32')]=_[_0x7b7e('0x33')](_0x21a15['model'],_0x21a15[_0x7b7e('0x30')]);_0x6a1e71['attributes']=_[_0x7b7e('0x33')](_0x21a15[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x34')]));_0x6a1e71[_0x7b7e('0x35')]=_0x6a1e71[_0x7b7e('0x35')]['length']?_0x6a1e71['attributes']:_0x21a15[_0x7b7e('0x2e')];if(!_0x3ceaf5[_0x7b7e('0x30')]['hasOwnProperty'](_0x7b7e('0x36'))){_0x6a1e71[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0x3ceaf5['query'][_0x7b7e('0x1d')]);_0x6a1e71[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x1c')]);}_0x6a1e71[_0x7b7e('0x37')]=qs[_0x7b7e('0x38')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x38')]);_0x6a1e71[_0x7b7e('0x39')]=qs[_0x7b7e('0x32')](_[_0x7b7e('0x3a')](_0x3ceaf5[_0x7b7e('0x30')],_0x21a15[_0x7b7e('0x32')]),_0x57b9da);if(_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x3b')]){_0x6a1e71['where']=_[_0x7b7e('0x3c')](_0x6a1e71[_0x7b7e('0x39')],{'$or':_[_0x7b7e('0x2f')](_0x57b9da,function(_0x242609){if(_0x242609[_0x7b7e('0x3d')]!==_0x7b7e('0x3e')){var _0x7f15={};_0x7f15[_0x242609[_0x7b7e('0x27')]]={'$like':'%'+_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x3b')]+'%'};return _0x7f15;}})});}_0x6a1e71=_['merge']({},_0x6a1e71,_0x3ceaf5[_0x7b7e('0x3f')]);var _0x1fa75b={'where':_0x6a1e71[_0x7b7e('0x39')]};return db[_0x7b7e('0x2a')]['count'](_0x1fa75b)[_0x7b7e('0x24')](function(_0x35b31a){_0x4c46b8[_0x7b7e('0x1b')]=_0x35b31a;if(_0x3ceaf5['query']['includeAll']){_0x6a1e71[_0x7b7e('0x40')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x7b7e('0x41')](_0x6a1e71);})[_0x7b7e('0x24')](function(_0x4de331){_0x4c46b8[_0x7b7e('0x42')]=_0x4de331;return _0x4c46b8;})[_0x7b7e('0x24')](respondWithFilteredResult(_0x48fad1,_0x6a1e71))[_0x7b7e('0x43')](handleError(_0x48fad1,null));};exports[_0x7b7e('0x44')]=function(_0x38d32f,_0x435de5){var _0xc888e4={'raw':!![],'where':{'id':_0x38d32f[_0x7b7e('0x45')]['id']}},_0x1d9bb9={};_0x1d9bb9['model']=_['keys'](db[_0x7b7e('0x2a')]['rawAttributes']);_0x1d9bb9[_0x7b7e('0x30')]=_['keys'](_0x38d32f['query']);_0x1d9bb9[_0x7b7e('0x32')]=_['intersection'](_0x1d9bb9[_0x7b7e('0x2e')],_0x1d9bb9['query']);_0xc888e4[_0x7b7e('0x35')]=_[_0x7b7e('0x33')](_0x1d9bb9[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x38d32f['query'][_0x7b7e('0x34')]));_0xc888e4[_0x7b7e('0x35')]=_0xc888e4[_0x7b7e('0x35')][_0x7b7e('0x46')]?_0xc888e4[_0x7b7e('0x35')]:_0x1d9bb9[_0x7b7e('0x2e')];if(_0x38d32f['query']['includeAll']){_0xc888e4['include']=[{'all':!![]}];}_0xc888e4=_[_0x7b7e('0x3c')]({},_0xc888e4,_0x38d32f[_0x7b7e('0x3f')]);return db[_0x7b7e('0x2a')][_0x7b7e('0x47')](_0xc888e4)[_0x7b7e('0x24')](handleEntityNotFound(_0x435de5,null))[_0x7b7e('0x24')](respondWithResult(_0x435de5,null))['catch'](handleError(_0x435de5,null));};exports[_0x7b7e('0x48')]=function(_0x42e560,_0x5a0832){return db['ChatQueueReport'][_0x7b7e('0x48')](_0x42e560[_0x7b7e('0x49')],{})[_0x7b7e('0x24')](respondWithResult(_0x5a0832,0xc9))[_0x7b7e('0x43')](handleError(_0x5a0832,null));};exports[_0x7b7e('0x23')]=function(_0xb46776,_0x590154){if(_0xb46776[_0x7b7e('0x49')]['id']){delete _0xb46776['body']['id'];}return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0xb46776[_0x7b7e('0x45')]['id']}})[_0x7b7e('0x24')](handleEntityNotFound(_0x590154,null))['then'](saveUpdates(_0xb46776[_0x7b7e('0x49')],null))[_0x7b7e('0x24')](respondWithResult(_0x590154,null))[_0x7b7e('0x43')](handleError(_0x590154,null));};exports[_0x7b7e('0x25')]=function(_0x1f9d0f,_0x5cce7c){return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0x1f9d0f[_0x7b7e('0x45')]['id']}})[_0x7b7e('0x24')](handleEntityNotFound(_0x5cce7c,null))[_0x7b7e('0x24')](removeEntity(_0x5cce7c,null))['catch'](handleError(_0x5cce7c,null));};exports[_0x7b7e('0x4a')]=function(_0x29024e,_0x46d4ee){return db[_0x7b7e('0x2a')][_0x7b7e('0x4a')]()[_0x7b7e('0x24')](respondWithResult(_0x46d4ee,null))[_0x7b7e('0x43')](handleError(_0x46d4ee,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index df94904..d6f5e2a 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 _0x973d=['uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','report_chat_queue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x973d,0x6d));var _0xd973=function(_0x1850ba,_0x55e013){_0x1850ba=_0x1850ba-0x0;var _0x2045e8=_0x973d[_0x1850ba];return _0x2045e8;};'use strict';var _=require(_0xd973('0x0'));var util=require(_0xd973('0x1'));var logger=require('../../config/logger')(_0xd973('0x2'));var moment=require(_0xd973('0x3'));var BPromise=require(_0xd973('0x4'));var rp=require(_0xd973('0x5'));var fs=require('fs');var path=require(_0xd973('0x6'));var rimraf=require(_0xd973('0x7'));var config=require(_0xd973('0x8'));var attributes=require(_0xd973('0x9'));module['exports']=function(_0x29c566,_0xd2ee7d){return _0x29c566['define']('ChatQueueReport',attributes,{'tableName':_0xd973('0xa'),'paranoid':![],'indexes':[{'name':_0xd973('0xb'),'fields':[_0xd973('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3390=['uniqueid','lodash','../../config/logger','api','request-promise','rimraf','./chatQueueReport.attributes','define','ChatQueueReport','report_chat_queue'];(function(_0x1f5245,_0xaae475){var _0x33eca7=function(_0x342f5a){while(--_0x342f5a){_0x1f5245['push'](_0x1f5245['shift']());}};_0x33eca7(++_0xaae475);}(_0x3390,0xc9));var _0x0339=function(_0x3f65a9,_0x31a2ee){_0x3f65a9=_0x3f65a9-0x0;var _0x57e678=_0x3390[_0x3f65a9];return _0x57e678;};'use strict';var _=require(_0x0339('0x0'));var util=require('util');var logger=require(_0x0339('0x1'))(_0x0339('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0339('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0339('0x4'));var config=require('../../config/environment');var attributes=require(_0x0339('0x5'));module['exports']=function(_0x53b732,_0x1bc36f){return _0x53b732[_0x0339('0x6')](_0x0339('0x7'),attributes,{'tableName':_0x0339('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0339('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 6523b0f..360f3cf 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 _0x9371=['where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueueReport','create','body','options','raw','debug','CreateChatQueueReport','UpdateChatQueueReport','update'];(function(_0x5c6736,_0x1b5de8){var _0x18fc87=function(_0x5345a9){while(--_0x5345a9){_0x5c6736['push'](_0x5c6736['shift']());}};_0x18fc87(++_0x1b5de8);}(_0x9371,0x19a));var _0x1937=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9371[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1937('0x0'));var util=require(_0x1937('0x1'));var moment=require(_0x1937('0x2'));var BPromise=require(_0x1937('0x3'));var rs=require(_0x1937('0x4'));var fs=require('fs');var Redis=require(_0x1937('0x5'));var db=require(_0x1937('0x6'))['db'];var utils=require(_0x1937('0x7'));var logger=require(_0x1937('0x8'))(_0x1937('0x9'));var config=require(_0x1937('0xa'));var jayson=require(_0x1937('0xb'));var client=jayson['client'][_0x1937('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x408543,_0x256869,_0x378e4a){return new BPromise(function(_0x2fc31c,_0x475f9b){return client[_0x1937('0xd')](_0x408543,_0x378e4a)[_0x1937('0xe')](function(_0x5f2f27){logger[_0x1937('0xf')](_0x1937('0x10'),_0x256869,_0x1937('0x11'));logger['debug'](_0x1937('0x12'),_0x256869,'request\x20sent',JSON[_0x1937('0x13')](_0x5f2f27));if(_0x5f2f27[_0x1937('0x14')]){if(_0x5f2f27[_0x1937('0x14')][_0x1937('0x15')]===0x1f4){logger[_0x1937('0x14')](_0x1937('0x10'),_0x256869,_0x5f2f27['error']['message']);return _0x475f9b(_0x5f2f27[_0x1937('0x14')][_0x1937('0x16')]);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x256869,_0x5f2f27['error']['message']);return _0x2fc31c(_0x5f2f27['error'][_0x1937('0x16')]);}else{logger[_0x1937('0xf')](_0x1937('0x10'),_0x256869,_0x1937('0x11'));_0x2fc31c(_0x5f2f27[_0x1937('0x17')][_0x1937('0x16')]);}})[_0x1937('0x18')](function(_0x2b76ec){logger[_0x1937('0x14')](_0x1937('0x10'),_0x256869,_0x2b76ec);_0x475f9b(_0x2b76ec);});});}exports['CreateChatQueueReport']=function(_0x32bbc2){var _0x4c4dbd=this;return new Promise(function(_0x534b3f,_0x4a74ec){return db[_0x1937('0x19')][_0x1937('0x1a')](_0x32bbc2[_0x1937('0x1b')],{'raw':_0x32bbc2[_0x1937('0x1c')]?_0x32bbc2['options'][_0x1937('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x4bf194){logger['info']('CreateChatQueueReport',_0x32bbc2);logger[_0x1937('0x1e')](_0x1937('0x1f'),_0x32bbc2,JSON[_0x1937('0x13')](_0x4bf194));_0x534b3f(_0x4bf194);})[_0x1937('0x18')](function(_0x4bb0f8){logger[_0x1937('0x14')]('CreateChatQueueReport',_0x4bb0f8[_0x1937('0x16')],_0x32bbc2);_0x4a74ec(_0x4c4dbd[_0x1937('0x14')](0x1f4,_0x4bb0f8[_0x1937('0x16')]));});});};exports[_0x1937('0x20')]=function(_0x4a36e9){var _0x4e08c4=this;return new Promise(function(_0x440c87,_0x443a8c){return db['ChatQueueReport'][_0x1937('0x21')](_0x4a36e9[_0x1937('0x1b')],{'raw':_0x4a36e9['options']?_0x4a36e9[_0x1937('0x1c')][_0x1937('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a36e9[_0x1937('0x1c')]?_0x4a36e9[_0x1937('0x1c')][_0x1937('0x22')]||null:null,'attributes':_0x4a36e9[_0x1937('0x1c')]?_0x4a36e9[_0x1937('0x1c')][_0x1937('0x23')]||null:null,'limit':_0x4a36e9[_0x1937('0x1c')]?_0x4a36e9[_0x1937('0x1c')][_0x1937('0x24')]||null:null})[_0x1937('0xe')](function(_0xf857ac){logger[_0x1937('0xf')]('UpdateChatQueueReport',_0x4a36e9);logger['debug'](_0x1937('0x20'),_0x4a36e9,JSON[_0x1937('0x13')](_0xf857ac));_0x440c87(_0xf857ac);})[_0x1937('0x18')](function(_0x37070f){logger[_0x1937('0x14')](_0x1937('0x20'),_0x37070f[_0x1937('0x16')],_0x4a36e9);_0x443a8c(_0x4e08c4[_0x1937('0x14')](0x1f4,_0x37070f['message']));});});}; \ No newline at end of file +var _0x20c5=['then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','create','options','body','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request'];(function(_0x511907,_0x4ae413){var _0x5e58e6=function(_0xfd27e3){while(--_0xfd27e3){_0x511907['push'](_0x511907['shift']());}};_0x5e58e6(++_0x4ae413);}(_0x20c5,0x154));var _0x520c=function(_0x4934e3,_0x124098){_0x4934e3=_0x4934e3-0x0;var _0x86a0c3=_0x20c5[_0x4934e3];return _0x86a0c3;};'use strict';var _=require(_0x520c('0x0'));var util=require(_0x520c('0x1'));var moment=require(_0x520c('0x2'));var BPromise=require(_0x520c('0x3'));var rs=require(_0x520c('0x4'));var fs=require('fs');var Redis=require(_0x520c('0x5'));var db=require(_0x520c('0x6'))['db'];var utils=require(_0x520c('0x7'));var logger=require(_0x520c('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x520c('0x9')][_0x520c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17f515,_0x473fcc,_0x33b82){return new BPromise(function(_0x3a445c,_0x2f3c1e){return client[_0x520c('0xb')](_0x17f515,_0x33b82)[_0x520c('0xc')](function(_0x176fd2){logger[_0x520c('0xd')](_0x520c('0xe'),_0x473fcc,_0x520c('0xf'));logger[_0x520c('0x10')](_0x520c('0x11'),_0x473fcc,_0x520c('0xf'),JSON[_0x520c('0x12')](_0x176fd2));if(_0x176fd2[_0x520c('0x13')]){if(_0x176fd2['error'][_0x520c('0x14')]===0x1f4){logger[_0x520c('0x13')](_0x520c('0xe'),_0x473fcc,_0x176fd2['error']['message']);return _0x2f3c1e(_0x176fd2['error'][_0x520c('0x15')]);}logger[_0x520c('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x473fcc,_0x176fd2['error'][_0x520c('0x15')]);return _0x3a445c(_0x176fd2[_0x520c('0x13')]['message']);}else{logger[_0x520c('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x473fcc,'request\x20sent');_0x3a445c(_0x176fd2[_0x520c('0x16')][_0x520c('0x15')]);}})[_0x520c('0x17')](function(_0x5b4b0c){logger[_0x520c('0x13')](_0x520c('0xe'),_0x473fcc,_0x5b4b0c);_0x2f3c1e(_0x5b4b0c);});});}exports[_0x520c('0x18')]=function(_0x284708){var _0x2b3290=this;return new Promise(function(_0x533a8b,_0x358344){return db['ChatQueueReport'][_0x520c('0x19')](_0x284708['body'],{'raw':_0x284708[_0x520c('0x1a')]?_0x284708[_0x520c('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x520c('0xc')](function(_0x1e7171){logger[_0x520c('0xd')](_0x520c('0x18'),_0x284708);logger[_0x520c('0x10')](_0x520c('0x18'),_0x284708,JSON['stringify'](_0x1e7171));_0x533a8b(_0x1e7171);})['catch'](function(_0x45cb20){logger[_0x520c('0x13')](_0x520c('0x18'),_0x45cb20[_0x520c('0x15')],_0x284708);_0x358344(_0x2b3290[_0x520c('0x13')](0x1f4,_0x45cb20[_0x520c('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x414913){var _0x2dba68=this;return new Promise(function(_0x125978,_0x22b64b){return db['ChatQueueReport']['update'](_0x414913[_0x520c('0x1b')],{'raw':_0x414913[_0x520c('0x1a')]?_0x414913[_0x520c('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x414913['options']?_0x414913[_0x520c('0x1a')][_0x520c('0x1c')]||null:null,'attributes':_0x414913[_0x520c('0x1a')]?_0x414913[_0x520c('0x1a')][_0x520c('0x1d')]||null:null,'limit':_0x414913[_0x520c('0x1a')]?_0x414913[_0x520c('0x1a')][_0x520c('0x1e')]||null:null})[_0x520c('0xc')](function(_0x4850c9){logger['info'](_0x520c('0x1f'),_0x414913);logger[_0x520c('0x10')]('UpdateChatQueueReport',_0x414913,JSON['stringify'](_0x4850c9));_0x125978(_0x4850c9);})[_0x520c('0x17')](function(_0x1eceff){logger[_0x520c('0x13')](_0x520c('0x1f'),_0x1eceff[_0x520c('0x15')],_0x414913);_0x22b64b(_0x2dba68[_0x520c('0x13')](0x1f4,_0x1eceff[_0x520c('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 168e7b3..7f6aba0 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 _0x780a=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0xae20cb,_0x43439c){var _0x117287=function(_0xfad2ba){while(--_0xfad2ba){_0xae20cb['push'](_0xae20cb['shift']());}};_0x117287(++_0x43439c);}(_0x780a,0x1d6));var _0xa780=function(_0x3ee80f,_0x2f92e3){_0x3ee80f=_0x3ee80f-0x0;var _0x7ddc0d=_0x780a[_0x3ee80f];return _0x7ddc0d;};'use strict';var multer=require(_0xa780('0x0'));var util=require(_0xa780('0x1'));var path=require(_0xa780('0x2'));var timeout=require(_0xa780('0x3'));var express=require('express');var router=express[_0xa780('0x4')]();var auth=require(_0xa780('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa780('0x6'));var controller=require('./chatQueueReport.controller');router[_0xa780('0x7')]('/',auth[_0xa780('0x8')](),controller[_0xa780('0x9')]);router[_0xa780('0x7')](_0xa780('0xa'),auth[_0xa780('0x8')](),controller[_0xa780('0xb')]);router[_0xa780('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa780('0xc')]);router[_0xa780('0xd')]('/',auth[_0xa780('0x8')](),controller[_0xa780('0xe')]);router['put'](_0xa780('0xf'),auth[_0xa780('0x8')](),controller['update']);router[_0xa780('0x10')]('/:id',auth[_0xa780('0x8')](),controller[_0xa780('0x11')]);module[_0xa780('0x12')]=router; \ No newline at end of file +var _0x9d8e=['get','isAuthenticated','/describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x70fd53,_0x2a95a6){var _0x4b71c5=function(_0x4b349d){while(--_0x4b349d){_0x70fd53['push'](_0x70fd53['shift']());}};_0x4b71c5(++_0x2a95a6);}(_0x9d8e,0x174));var _0xe9d8=function(_0x12a04a,_0x4e3d1a){_0x12a04a=_0x12a04a-0x0;var _0x6d5409=_0x9d8e[_0x12a04a];return _0x6d5409;};'use strict';var multer=require('multer');var util=require(_0xe9d8('0x0'));var path=require(_0xe9d8('0x1'));var timeout=require(_0xe9d8('0x2'));var express=require(_0xe9d8('0x3'));var router=express[_0xe9d8('0x4')]();var auth=require(_0xe9d8('0x5'));var interaction=require(_0xe9d8('0x6'));var config=require(_0xe9d8('0x7'));var controller=require('./chatQueueReport.controller');router[_0xe9d8('0x8')]('/',auth[_0xe9d8('0x9')](),controller['index']);router[_0xe9d8('0x8')](_0xe9d8('0xa'),auth[_0xe9d8('0x9')](),controller['describe']);router[_0xe9d8('0x8')](_0xe9d8('0xb'),auth[_0xe9d8('0x9')](),controller[_0xe9d8('0xc')]);router[_0xe9d8('0xd')]('/',auth[_0xe9d8('0x9')](),controller['create']);router[_0xe9d8('0xe')]('/:id',auth[_0xe9d8('0x9')](),controller[_0xe9d8('0xf')]);router[_0xe9d8('0x10')]('/:id',auth[_0xe9d8('0x9')](),controller[_0xe9d8('0x11')]);module[_0xe9d8('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 2a5e91d..83ac3b4 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 _0x2bdd=['exports','STRING','ENUM','account','agent','queue','DATE','NOW','moment','sequelize'];(function(_0x3bec7c,_0x444b1e){var _0x7084a9=function(_0x1e116f){while(--_0x1e116f){_0x3bec7c['push'](_0x3bec7c['shift']());}};_0x7084a9(++_0x444b1e);}(_0x2bdd,0x1ac));var _0xd2bd=function(_0x282ccc,_0x5d66a1){_0x282ccc=_0x282ccc-0x0;var _0x27c2dd=_0x2bdd[_0x282ccc];return _0x27c2dd;};'use strict';var moment=require(_0xd2bd('0x0'));var Sequelize=require(_0xd2bd('0x1'));module[_0xd2bd('0x2')]={'uniqueid':{'type':Sequelize[_0xd2bd('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd2bd('0x4')](_0xd2bd('0x5'),_0xd2bd('0x6'),_0xd2bd('0x7')),'allowNull':![],'defaultValue':_0xd2bd('0x7')},'transferredAt':{'type':Sequelize[_0xd2bd('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xd2bd('0x9')]}}; \ No newline at end of file +var _0x137a=['STRING','ENUM','account','agent','queue','NOW','moment','sequelize','exports'];(function(_0x5a63f4,_0x48fda4){var _0x2ff8a7=function(_0x22f8dc){while(--_0x22f8dc){_0x5a63f4['push'](_0x5a63f4['shift']());}};_0x2ff8a7(++_0x48fda4);}(_0x137a,0x192));var _0xa137=function(_0x4f1628,_0x1cc622){_0x4f1628=_0x4f1628-0x0;var _0x21315f=_0x137a[_0x4f1628];return _0x21315f;};'use strict';var moment=require(_0xa137('0x0'));var Sequelize=require(_0xa137('0x1'));module[_0xa137('0x2')]={'uniqueid':{'type':Sequelize[_0xa137('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xa137('0x4')](_0xa137('0x5'),_0xa137('0x6'),_0xa137('0x7')),'allowNull':![],'defaultValue':_0xa137('0x7')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xa137('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 95a00ea..c25fc79 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 _0xbe4d=['sendStatus','status','count','offset','limit','json','reject','save','update','destroy','then','end','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','params','create','body','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbe4d,0xbd));var _0xdbe4=function(_0x5e9666,_0x5c3b52){_0x5e9666=_0x5e9666-0x0;var _0x40f4c0=_0xbe4d[_0x5e9666];return _0x40f4c0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xdbe4('0x0'));var zipdir=require(_0xdbe4('0x1'));var jsonpatch=require(_0xdbe4('0x2'));var rp=require('request-promise');var moment=require(_0xdbe4('0x3'));var BPromise=require(_0xdbe4('0x4'));var Mustache=require(_0xdbe4('0x5'));var util=require('util');var path=require(_0xdbe4('0x6'));var sox=require(_0xdbe4('0x7'));var csv=require(_0xdbe4('0x8'));var ejs=require(_0xdbe4('0x9'));var fs=require('fs');var _=require(_0xdbe4('0xa'));var squel=require(_0xdbe4('0xb'));var crypto=require(_0xdbe4('0xc'));var jsforce=require(_0xdbe4('0xd'));var deskjs=require(_0xdbe4('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdbe4('0xf'));var Redis=require(_0xdbe4('0x10'));var authService=require(_0xdbe4('0x11'));var qs=require(_0xdbe4('0x12'));var as=require(_0xdbe4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdbe4('0x14'));var utils=require(_0xdbe4('0x15'));var config=require(_0xdbe4('0x16'));var db=require(_0xdbe4('0x17'))['db'];function respondWithStatusCode(_0xb1fb02,_0x38bac6){_0x38bac6=_0x38bac6||0xcc;return function(_0x390a65){if(_0x390a65){return _0xb1fb02[_0xdbe4('0x18')](_0x38bac6);}return _0xb1fb02[_0xdbe4('0x19')](_0x38bac6)['end']();};}function respondWithResult(_0x582e84,_0x459d94){_0x459d94=_0x459d94||0xc8;return function(_0xfcce0a){if(_0xfcce0a){return _0x582e84[_0xdbe4('0x19')](_0x459d94)['json'](_0xfcce0a);}};}function respondWithFilteredResult(_0x3358d1,_0xb6593a){return function(_0x4f4fb2){if(_0x4f4fb2){var _0x17bec2=_0x4f4fb2[_0xdbe4('0x1a')],_0x5cc66d=_0xb6593a['offset'],_0x4ae002=_0xb6593a[_0xdbe4('0x1b')]+_0xb6593a[_0xdbe4('0x1c')],_0x39aace;if(_0x4ae002>=_0x17bec2){_0x4ae002=_0x17bec2;_0x39aace=0xc8;}else{_0x39aace=0xce;}_0x3358d1[_0xdbe4('0x19')](_0x39aace);return _0x3358d1['set']('Content-Range',_0x5cc66d+'-'+_0x4ae002+'/'+_0x17bec2)[_0xdbe4('0x1d')](_0x4f4fb2);}return null;};}function patchUpdates(_0x4d1e51){return function(_0x4deab6){try{jsonpatch['apply'](_0x4deab6,_0x4d1e51,!![]);}catch(_0x443cd2){return BPromise[_0xdbe4('0x1e')](_0x443cd2);}return _0x4deab6[_0xdbe4('0x1f')]();};}function saveUpdates(_0x4ab416,_0x145b6a){return function(_0x29cb29){if(_0x29cb29){return _0x29cb29[_0xdbe4('0x20')](_0x4ab416)['then'](function(_0x355b01){return _0x355b01;});}return null;};}function removeEntity(_0x5d875c,_0xab8764){return function(_0x150fa3){if(_0x150fa3){return _0x150fa3[_0xdbe4('0x21')]()[_0xdbe4('0x22')](function(){_0x5d875c['status'](0xcc)[_0xdbe4('0x23')]();});}};}function handleEntityNotFound(_0x4012e2,_0xc1ff76){return function(_0x3854fa){if(!_0x3854fa){_0x4012e2['sendStatus'](0x194);}return _0x3854fa;};}function handleError(_0x1cf9c5,_0x1a242c){_0x1a242c=_0x1a242c||0x1f4;return function(_0x142a7f){logger['error'](_0x142a7f['stack']);if(_0x142a7f[_0xdbe4('0x24')]){delete _0x142a7f['name'];}_0x1cf9c5[_0xdbe4('0x19')](_0x1a242c)[_0xdbe4('0x25')](_0x142a7f);};}exports[_0xdbe4('0x26')]=function(_0x332ca8,_0x204d43){var _0x55a84b={},_0x36dd2a={},_0x28686b={'count':0x0,'rows':[]};var _0x21dee5=_['map'](db[_0xdbe4('0x27')][_0xdbe4('0x28')],function(_0x111835){return{'name':_0x111835[_0xdbe4('0x29')],'type':_0x111835[_0xdbe4('0x2a')][_0xdbe4('0x2b')]};});_0x36dd2a[_0xdbe4('0x2c')]=_[_0xdbe4('0x2d')](_0x21dee5,'name');_0x36dd2a[_0xdbe4('0x2e')]=_[_0xdbe4('0x2f')](_0x332ca8[_0xdbe4('0x2e')]);_0x36dd2a[_0xdbe4('0x30')]=_['intersection'](_0x36dd2a['model'],_0x36dd2a['query']);_0x55a84b[_0xdbe4('0x31')]=_[_0xdbe4('0x32')](_0x36dd2a[_0xdbe4('0x2c')],qs[_0xdbe4('0x33')](_0x332ca8[_0xdbe4('0x2e')]['fields']));_0x55a84b[_0xdbe4('0x31')]=_0x55a84b[_0xdbe4('0x31')][_0xdbe4('0x34')]?_0x55a84b[_0xdbe4('0x31')]:_0x36dd2a[_0xdbe4('0x2c')];if(!_0x332ca8[_0xdbe4('0x2e')][_0xdbe4('0x35')](_0xdbe4('0x36'))){_0x55a84b[_0xdbe4('0x1c')]=qs[_0xdbe4('0x1c')](_0x332ca8[_0xdbe4('0x2e')][_0xdbe4('0x1c')]);_0x55a84b[_0xdbe4('0x1b')]=qs[_0xdbe4('0x1b')](_0x332ca8[_0xdbe4('0x2e')]['offset']);}_0x55a84b[_0xdbe4('0x37')]=qs[_0xdbe4('0x38')](_0x332ca8['query'][_0xdbe4('0x38')]);_0x55a84b[_0xdbe4('0x39')]=qs[_0xdbe4('0x30')](_[_0xdbe4('0x3a')](_0x332ca8['query'],_0x36dd2a['filters']),_0x21dee5);if(_0x332ca8[_0xdbe4('0x2e')][_0xdbe4('0x3b')]){_0x55a84b[_0xdbe4('0x39')]=_[_0xdbe4('0x3c')](_0x55a84b['where'],{'$or':_['map'](_0x21dee5,function(_0x33eb54){if(_0x33eb54[_0xdbe4('0x2a')]!=='VIRTUAL'){var _0x1a6cc1={};_0x1a6cc1[_0x33eb54[_0xdbe4('0x24')]]={'$like':'%'+_0x332ca8[_0xdbe4('0x2e')]['filter']+'%'};return _0x1a6cc1;}})});}_0x55a84b=_[_0xdbe4('0x3c')]({},_0x55a84b,_0x332ca8[_0xdbe4('0x3d')]);var _0xbbee1={'where':_0x55a84b['where']};return db[_0xdbe4('0x27')][_0xdbe4('0x1a')](_0xbbee1)['then'](function(_0x3fdcc3){_0x28686b[_0xdbe4('0x1a')]=_0x3fdcc3;if(_0x332ca8[_0xdbe4('0x2e')][_0xdbe4('0x3e')]){_0x55a84b[_0xdbe4('0x3f')]=[{'all':!![]}];}return db[_0xdbe4('0x27')]['findAll'](_0x55a84b);})[_0xdbe4('0x22')](function(_0x166296){_0x28686b[_0xdbe4('0x40')]=_0x166296;return _0x28686b;})['then'](respondWithFilteredResult(_0x204d43,_0x55a84b))[_0xdbe4('0x41')](handleError(_0x204d43,null));};exports['show']=function(_0x3c7dac,_0x322b91){var _0xeeb609={'raw':!![],'where':{'id':_0x3c7dac[_0xdbe4('0x42')]['id']}},_0x47f7fa={};_0x47f7fa[_0xdbe4('0x2c')]=_[_0xdbe4('0x2f')](db[_0xdbe4('0x27')][_0xdbe4('0x28')]);_0x47f7fa[_0xdbe4('0x2e')]=_['keys'](_0x3c7dac[_0xdbe4('0x2e')]);_0x47f7fa['filters']=_['intersection'](_0x47f7fa['model'],_0x47f7fa['query']);_0xeeb609[_0xdbe4('0x31')]=_[_0xdbe4('0x32')](_0x47f7fa[_0xdbe4('0x2c')],qs['fields'](_0x3c7dac['query'][_0xdbe4('0x33')]));_0xeeb609[_0xdbe4('0x31')]=_0xeeb609[_0xdbe4('0x31')]['length']?_0xeeb609[_0xdbe4('0x31')]:_0x47f7fa[_0xdbe4('0x2c')];if(_0x3c7dac[_0xdbe4('0x2e')][_0xdbe4('0x3e')]){_0xeeb609['include']=[{'all':!![]}];}_0xeeb609=_['merge']({},_0xeeb609,_0x3c7dac[_0xdbe4('0x3d')]);return db[_0xdbe4('0x27')]['find'](_0xeeb609)[_0xdbe4('0x22')](handleEntityNotFound(_0x322b91,null))[_0xdbe4('0x22')](respondWithResult(_0x322b91,null))[_0xdbe4('0x41')](handleError(_0x322b91,null));};exports[_0xdbe4('0x43')]=function(_0x5488b1,_0x4c1ac9){return db['ChatTransferReport'][_0xdbe4('0x43')](_0x5488b1[_0xdbe4('0x44')],{})['then'](respondWithResult(_0x4c1ac9,0xc9))[_0xdbe4('0x41')](handleError(_0x4c1ac9,null));};exports[_0xdbe4('0x20')]=function(_0x3c1d73,_0x5e4561){if(_0x3c1d73[_0xdbe4('0x44')]['id']){delete _0x3c1d73[_0xdbe4('0x44')]['id'];}return db['ChatTransferReport'][_0xdbe4('0x45')]({'where':{'id':_0x3c1d73[_0xdbe4('0x42')]['id']}})[_0xdbe4('0x22')](handleEntityNotFound(_0x5e4561,null))[_0xdbe4('0x22')](saveUpdates(_0x3c1d73[_0xdbe4('0x44')],null))['then'](respondWithResult(_0x5e4561,null))[_0xdbe4('0x41')](handleError(_0x5e4561,null));};exports['destroy']=function(_0x2e917e,_0x361d4a){return db[_0xdbe4('0x27')][_0xdbe4('0x45')]({'where':{'id':_0x2e917e[_0xdbe4('0x42')]['id']}})[_0xdbe4('0x22')](handleEntityNotFound(_0x361d4a,null))['then'](removeEntity(_0x361d4a,null))[_0xdbe4('0x41')](handleError(_0x361d4a,null));};exports[_0xdbe4('0x46')]=function(_0x51448e,_0x4cdf28){return db[_0xdbe4('0x27')][_0xdbe4('0x46')]()['then'](respondWithResult(_0x4cdf28,null))[_0xdbe4('0x41')](handleError(_0x4cdf28,null));}; \ No newline at end of file +var _0xc495=['params','create','body','catch','update','find','describe','html-pdf','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','destroy','error','stack','name','send','ChatTransferReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','show'];(function(_0x411eb5,_0x2cd241){var _0x338798=function(_0x25013f){while(--_0x25013f){_0x411eb5['push'](_0x411eb5['shift']());}};_0x338798(++_0x2cd241);}(_0xc495,0x1c3));var _0x5c49=function(_0x35c4ca,_0x363dc5){_0x35c4ca=_0x35c4ca-0x0;var _0x17c529=_0xc495[_0x35c4ca];return _0x17c529;};'use strict';var pdf=require(_0x5c49('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5c49('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5c49('0x2'));var moment=require(_0x5c49('0x3'));var BPromise=require(_0x5c49('0x4'));var Mustache=require(_0x5c49('0x5'));var util=require(_0x5c49('0x6'));var path=require(_0x5c49('0x7'));var sox=require(_0x5c49('0x8'));var csv=require(_0x5c49('0x9'));var ejs=require(_0x5c49('0xa'));var fs=require('fs');var _=require(_0x5c49('0xb'));var squel=require(_0x5c49('0xc'));var crypto=require(_0x5c49('0xd'));var jsforce=require(_0x5c49('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5c49('0x9'));var querystring=require(_0x5c49('0xf'));var Papa=require(_0x5c49('0x10'));var Redis=require(_0x5c49('0x11'));var authService=require(_0x5c49('0x12'));var qs=require(_0x5c49('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c49('0x14'));var logger=require(_0x5c49('0x15'))(_0x5c49('0x16'));var utils=require(_0x5c49('0x17'));var config=require(_0x5c49('0x18'));var db=require(_0x5c49('0x19'))['db'];function respondWithStatusCode(_0x247887,_0x12ccf6){_0x12ccf6=_0x12ccf6||0xcc;return function(_0x206ce7){if(_0x206ce7){return _0x247887[_0x5c49('0x1a')](_0x12ccf6);}return _0x247887[_0x5c49('0x1b')](_0x12ccf6)[_0x5c49('0x1c')]();};}function respondWithResult(_0x14405e,_0x40f57c){_0x40f57c=_0x40f57c||0xc8;return function(_0x2ee4c1){if(_0x2ee4c1){return _0x14405e[_0x5c49('0x1b')](_0x40f57c)[_0x5c49('0x1d')](_0x2ee4c1);}};}function respondWithFilteredResult(_0x4d6e05,_0xfc50ef){return function(_0x1a6abe){if(_0x1a6abe){var _0xbb0af2=_0x1a6abe['count'],_0x51d7b8=_0xfc50ef['offset'],_0x34aa44=_0xfc50ef[_0x5c49('0x1e')]+_0xfc50ef[_0x5c49('0x1f')],_0x2c48b0;if(_0x34aa44>=_0xbb0af2){_0x34aa44=_0xbb0af2;_0x2c48b0=0xc8;}else{_0x2c48b0=0xce;}_0x4d6e05[_0x5c49('0x1b')](_0x2c48b0);return _0x4d6e05[_0x5c49('0x20')](_0x5c49('0x21'),_0x51d7b8+'-'+_0x34aa44+'/'+_0xbb0af2)['json'](_0x1a6abe);}return null;};}function patchUpdates(_0x29c51a){return function(_0x3a2b62){try{jsonpatch[_0x5c49('0x22')](_0x3a2b62,_0x29c51a,!![]);}catch(_0x489f03){return BPromise['reject'](_0x489f03);}return _0x3a2b62[_0x5c49('0x23')]();};}function saveUpdates(_0x39c96b,_0x319a5a){return function(_0x193202){if(_0x193202){return _0x193202['update'](_0x39c96b)['then'](function(_0x4ba543){return _0x4ba543;});}return null;};}function removeEntity(_0x577f58,_0x10c621){return function(_0x5c20a9){if(_0x5c20a9){return _0x5c20a9[_0x5c49('0x24')]()['then'](function(){_0x577f58['status'](0xcc)[_0x5c49('0x1c')]();});}};}function handleEntityNotFound(_0x5b0120,_0x445817){return function(_0x58a74c){if(!_0x58a74c){_0x5b0120[_0x5c49('0x1a')](0x194);}return _0x58a74c;};}function handleError(_0x53450c,_0x3a2af8){_0x3a2af8=_0x3a2af8||0x1f4;return function(_0x412bbd){logger[_0x5c49('0x25')](_0x412bbd[_0x5c49('0x26')]);if(_0x412bbd[_0x5c49('0x27')]){delete _0x412bbd[_0x5c49('0x27')];}_0x53450c[_0x5c49('0x1b')](_0x3a2af8)[_0x5c49('0x28')](_0x412bbd);};}exports['index']=function(_0xa660e9,_0xe24264){var _0x370976={},_0xaede5e={},_0x2f3428={'count':0x0,'rows':[]};var _0x51d5d2=_['map'](db[_0x5c49('0x29')][_0x5c49('0x2a')],function(_0x4c2dd6){return{'name':_0x4c2dd6['fieldName'],'type':_0x4c2dd6[_0x5c49('0x2b')][_0x5c49('0x2c')]};});_0xaede5e[_0x5c49('0x2d')]=_[_0x5c49('0x2e')](_0x51d5d2,'name');_0xaede5e[_0x5c49('0x2f')]=_[_0x5c49('0x30')](_0xa660e9[_0x5c49('0x2f')]);_0xaede5e[_0x5c49('0x31')]=_[_0x5c49('0x32')](_0xaede5e['model'],_0xaede5e[_0x5c49('0x2f')]);_0x370976[_0x5c49('0x33')]=_[_0x5c49('0x32')](_0xaede5e[_0x5c49('0x2d')],qs[_0x5c49('0x34')](_0xa660e9[_0x5c49('0x2f')][_0x5c49('0x34')]));_0x370976['attributes']=_0x370976[_0x5c49('0x33')][_0x5c49('0x35')]?_0x370976[_0x5c49('0x33')]:_0xaede5e[_0x5c49('0x2d')];if(!_0xa660e9[_0x5c49('0x2f')]['hasOwnProperty'](_0x5c49('0x36'))){_0x370976['limit']=qs['limit'](_0xa660e9[_0x5c49('0x2f')][_0x5c49('0x1f')]);_0x370976[_0x5c49('0x1e')]=qs[_0x5c49('0x1e')](_0xa660e9[_0x5c49('0x2f')][_0x5c49('0x1e')]);}_0x370976[_0x5c49('0x37')]=qs[_0x5c49('0x38')](_0xa660e9['query']['sort']);_0x370976[_0x5c49('0x39')]=qs[_0x5c49('0x31')](_['pick'](_0xa660e9['query'],_0xaede5e[_0x5c49('0x31')]),_0x51d5d2);if(_0xa660e9[_0x5c49('0x2f')][_0x5c49('0x3a')]){_0x370976[_0x5c49('0x39')]=_[_0x5c49('0x3b')](_0x370976[_0x5c49('0x39')],{'$or':_[_0x5c49('0x2e')](_0x51d5d2,function(_0x5668c2){if(_0x5668c2[_0x5c49('0x2b')]!==_0x5c49('0x3c')){var _0x362a09={};_0x362a09[_0x5668c2[_0x5c49('0x27')]]={'$like':'%'+_0xa660e9[_0x5c49('0x2f')]['filter']+'%'};return _0x362a09;}})});}_0x370976=_['merge']({},_0x370976,_0xa660e9[_0x5c49('0x3d')]);var _0x49773e={'where':_0x370976['where']};return db[_0x5c49('0x29')]['count'](_0x49773e)[_0x5c49('0x3e')](function(_0x1f9440){_0x2f3428['count']=_0x1f9440;if(_0xa660e9[_0x5c49('0x2f')][_0x5c49('0x3f')]){_0x370976[_0x5c49('0x40')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x5c49('0x41')](_0x370976);})[_0x5c49('0x3e')](function(_0x501bf7){_0x2f3428['rows']=_0x501bf7;return _0x2f3428;})[_0x5c49('0x3e')](respondWithFilteredResult(_0xe24264,_0x370976))['catch'](handleError(_0xe24264,null));};exports[_0x5c49('0x42')]=function(_0x565a24,_0x3e38ad){var _0x2d16d6={'raw':!![],'where':{'id':_0x565a24[_0x5c49('0x43')]['id']}},_0x41106a={};_0x41106a[_0x5c49('0x2d')]=_['keys'](db['ChatTransferReport'][_0x5c49('0x2a')]);_0x41106a[_0x5c49('0x2f')]=_[_0x5c49('0x30')](_0x565a24[_0x5c49('0x2f')]);_0x41106a['filters']=_['intersection'](_0x41106a['model'],_0x41106a['query']);_0x2d16d6[_0x5c49('0x33')]=_[_0x5c49('0x32')](_0x41106a['model'],qs[_0x5c49('0x34')](_0x565a24[_0x5c49('0x2f')][_0x5c49('0x34')]));_0x2d16d6[_0x5c49('0x33')]=_0x2d16d6[_0x5c49('0x33')][_0x5c49('0x35')]?_0x2d16d6[_0x5c49('0x33')]:_0x41106a[_0x5c49('0x2d')];if(_0x565a24[_0x5c49('0x2f')][_0x5c49('0x3f')]){_0x2d16d6[_0x5c49('0x40')]=[{'all':!![]}];}_0x2d16d6=_[_0x5c49('0x3b')]({},_0x2d16d6,_0x565a24['options']);return db[_0x5c49('0x29')]['find'](_0x2d16d6)[_0x5c49('0x3e')](handleEntityNotFound(_0x3e38ad,null))[_0x5c49('0x3e')](respondWithResult(_0x3e38ad,null))['catch'](handleError(_0x3e38ad,null));};exports[_0x5c49('0x44')]=function(_0x49e00d,_0x1ce51e){return db[_0x5c49('0x29')]['create'](_0x49e00d[_0x5c49('0x45')],{})[_0x5c49('0x3e')](respondWithResult(_0x1ce51e,0xc9))[_0x5c49('0x46')](handleError(_0x1ce51e,null));};exports[_0x5c49('0x47')]=function(_0x549682,_0x2330f1){if(_0x549682['body']['id']){delete _0x549682['body']['id'];}return db[_0x5c49('0x29')][_0x5c49('0x48')]({'where':{'id':_0x549682[_0x5c49('0x43')]['id']}})[_0x5c49('0x3e')](handleEntityNotFound(_0x2330f1,null))[_0x5c49('0x3e')](saveUpdates(_0x549682[_0x5c49('0x45')],null))[_0x5c49('0x3e')](respondWithResult(_0x2330f1,null))[_0x5c49('0x46')](handleError(_0x2330f1,null));};exports['destroy']=function(_0x524727,_0x24556e){return db['ChatTransferReport'][_0x5c49('0x48')]({'where':{'id':_0x524727[_0x5c49('0x43')]['id']}})[_0x5c49('0x3e')](handleEntityNotFound(_0x24556e,null))['then'](removeEntity(_0x24556e,null))[_0x5c49('0x46')](handleError(_0x24556e,null));};exports['describe']=function(_0x4d3f94,_0x28d42d){return db[_0x5c49('0x29')][_0x5c49('0x49')]()[_0x5c49('0x3e')](respondWithResult(_0x28d42d,null))[_0x5c49('0x46')](handleError(_0x28d42d,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 265661e..5017eb1 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 _0x00bb=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','./chatTransferReport.attributes'];(function(_0x2e78e9,_0x42957c){var _0x35aad4=function(_0x360fa1){while(--_0x360fa1){_0x2e78e9['push'](_0x2e78e9['shift']());}};_0x35aad4(++_0x42957c);}(_0x00bb,0x1d8));var _0xb00b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x00bb[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[{'name':_0xb00b('0xb'),'fields':[_0xb00b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x54ef=['uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport'];(function(_0x3ae3e2,_0x7aa47a){var _0x47d3b5=function(_0xc3fcd9){while(--_0xc3fcd9){_0x3ae3e2['push'](_0x3ae3e2['shift']());}};_0x47d3b5(++_0x7aa47a);}(_0x54ef,0x112));var _0xf54e=function(_0x5e531d,_0x264b53){_0x5e531d=_0x5e531d-0x0;var _0x5abd81=_0x54ef[_0x5e531d];return _0x5abd81;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var logger=require(_0xf54e('0x2'))('api');var moment=require(_0xf54e('0x3'));var BPromise=require(_0xf54e('0x4'));var rp=require(_0xf54e('0x5'));var fs=require('fs');var path=require(_0xf54e('0x6'));var rimraf=require(_0xf54e('0x7'));var config=require(_0xf54e('0x8'));var attributes=require(_0xf54e('0x9'));module['exports']=function(_0x55e611,_0x18e84e){return _0x55e611[_0xf54e('0xa')](_0xf54e('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xf54e('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 62f166d..2add78c 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 _0x154f=['client','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x148f22,_0x5a5572){var _0x50ccfa=function(_0x22492f){while(--_0x22492f){_0x148f22['push'](_0x148f22['shift']());}};_0x50ccfa(++_0x5a5572);}(_0x154f,0x98));var _0xf154=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x154f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf154('0x0'));var BPromise=require(_0xf154('0x1'));var rs=require(_0xf154('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf154('0x3'))['db'];var utils=require(_0xf154('0x4'));var logger=require(_0xf154('0x5'))(_0xf154('0x6'));var config=require(_0xf154('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf154('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2a67cb,_0x3de0f2,_0x1a8ca7){return new BPromise(function(_0x525939,_0x2e082b){return client[_0xf154('0x9')](_0x2a67cb,_0x1a8ca7)[_0xf154('0xa')](function(_0x16b215){logger[_0xf154('0xb')](_0xf154('0xc'),_0x3de0f2,_0xf154('0xd'));logger[_0xf154('0xe')](_0xf154('0xf'),_0x3de0f2,'request\x20sent',JSON['stringify'](_0x16b215));if(_0x16b215[_0xf154('0x10')]){if(_0x16b215[_0xf154('0x10')][_0xf154('0x11')]===0x1f4){logger[_0xf154('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x3de0f2,_0x16b215['error'][_0xf154('0x12')]);return _0x2e082b(_0x16b215['error'][_0xf154('0x12')]);}logger[_0xf154('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x3de0f2,_0x16b215[_0xf154('0x10')][_0xf154('0x12')]);return _0x525939(_0x16b215['error'][_0xf154('0x12')]);}else{logger[_0xf154('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x3de0f2,_0xf154('0xd'));_0x525939(_0x16b215[_0xf154('0x13')][_0xf154('0x12')]);}})['catch'](function(_0x26a611){logger['error'](_0xf154('0xc'),_0x3de0f2,_0x26a611);_0x2e082b(_0x26a611);});});} \ No newline at end of file +var _0x1bae=['code','ChatTransferReport,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0x1bae,0x147));var _0xe1ba=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1bae[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xe1ba('0x0'));var util=require('util');var moment=require(_0xe1ba('0x1'));var BPromise=require(_0xe1ba('0x2'));var rs=require(_0xe1ba('0x3'));var fs=require('fs');var Redis=require(_0xe1ba('0x4'));var db=require(_0xe1ba('0x5'))['db'];var utils=require(_0xe1ba('0x6'));var logger=require('../../config/logger')(_0xe1ba('0x7'));var config=require('../../config/environment');var jayson=require(_0xe1ba('0x8'));var client=jayson[_0xe1ba('0x9')][_0xe1ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2654,_0xb0303e,_0x1010d9){return new BPromise(function(_0x117c26,_0x525170){return client[_0xe1ba('0xb')](_0x3e2654,_0x1010d9)[_0xe1ba('0xc')](function(_0x5111b7){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0xb0303e,'request\x20sent');logger[_0xe1ba('0xd')](_0xe1ba('0xe'),_0xb0303e,_0xe1ba('0xf'),JSON[_0xe1ba('0x10')](_0x5111b7));if(_0x5111b7[_0xe1ba('0x11')]){if(_0x5111b7['error'][_0xe1ba('0x12')]===0x1f4){logger[_0xe1ba('0x11')](_0xe1ba('0x13'),_0xb0303e,_0x5111b7[_0xe1ba('0x11')][_0xe1ba('0x14')]);return _0x525170(_0x5111b7[_0xe1ba('0x11')][_0xe1ba('0x14')]);}logger[_0xe1ba('0x11')](_0xe1ba('0x13'),_0xb0303e,_0x5111b7[_0xe1ba('0x11')]['message']);return _0x117c26(_0x5111b7['error'][_0xe1ba('0x14')]);}else{logger[_0xe1ba('0x15')](_0xe1ba('0x13'),_0xb0303e,_0xe1ba('0xf'));_0x117c26(_0x5111b7[_0xe1ba('0x16')][_0xe1ba('0x14')]);}})['catch'](function(_0x1c38cc){logger[_0xe1ba('0x11')](_0xe1ba('0x13'),_0xb0303e,_0x1c38cc);_0x525170(_0x1c38cc);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 00f831c..272862e 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 _0x5f66=['describe','get','/:id','show','create','put','delete','destroy','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','isAuthenticated','index'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x5f66,0x1a0));var _0x65f6=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5f66[_0x465028];return _0xb783d4;};'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 auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x10')]);module['exports']=router; \ No newline at end of file +var _0x2032=['describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x1487b4,_0x438d7d){var _0x30b993=function(_0x4e1c82){while(--_0x4e1c82){_0x1487b4['push'](_0x1487b4['shift']());}};_0x30b993(++_0x438d7d);}(_0x2032,0xd9));var _0x2203=function(_0x441200,_0x41daf2){_0x441200=_0x441200-0x0;var _0x11dc1f=_0x2032[_0x441200];return _0x11dc1f;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var auth=require(_0x2203('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2203('0x5'));var controller=require(_0x2203('0x6'));router[_0x2203('0x7')]('/',auth[_0x2203('0x8')](),controller[_0x2203('0x9')]);router[_0x2203('0x7')](_0x2203('0xa'),auth[_0x2203('0x8')](),controller[_0x2203('0xb')]);router[_0x2203('0x7')](_0x2203('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller[_0x2203('0xe')]);router[_0x2203('0xf')](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x10')]);router['delete'](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);module[_0x2203('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 76a2718..91e83f4 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 _0x885a=['thumb','stringify','name','input','getDataValue','parse','onlineForm','textarea','Comments','offlineForm','setDataValue','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','star'];(function(_0x12d63a,_0x29d68c){var _0x3a5889=function(_0x482b76){while(--_0x482b76){_0x12d63a['push'](_0x12d63a['shift']());}};_0x3a5889(++_0x29d68c);}(_0x885a,0x180));var _0xa885=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x885a[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xa885('0x0'));module[_0xa885('0x1')]={'name':{'type':Sequelize[_0xa885('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xa885('0x2')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xa885('0x2')]},'mapKey':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0x3')},'mapKeyOffline':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0x3')},'key':{'type':Sequelize[_0xa885('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xa885('0x4')},'customerAlias':{'type':Sequelize[_0xa885('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xa885('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa885('0x2')],'allowNull':![],'defaultValue':_0xa885('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xa885('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa885('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa885('0x2')]},'animation':{'type':Sequelize[_0xa885('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa885('0x8')](_0xa885('0x9'),_0xa885('0xa')),'defaultValue':_0xa885('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xa885('0xb')},'start_chat_button':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0xc')},'offline_chat_button':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0xd')},'header_offline':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa885('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xa885('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa885('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa885('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xa885('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0x12')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xa885('0x13')},'placeholderMessage':{'type':Sequelize[_0xa885('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xa885('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0xd')},'skipMessageButton':{'type':Sequelize[_0xa885('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xa885('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa885('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa885('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa885('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xa885('0x8')](_0xa885('0x14'),_0xa885('0x15')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xa885('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa885('0x10')],'defaultValue':function(){return JSON[_0xa885('0x16')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xa885('0x17'),'type':'text','required':!![]},'props':{'title':_0xa885('0x17'),'helpText':''}},{'type':_0xa885('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xa885('0x3'),'type':_0xa885('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa885('0x19')]('onlineForm')?JSON[_0xa885('0x1a')](this[_0xa885('0x19')]('onlineForm')):{};},'set':function(_0x39ae58){return this['setDataValue'](_0xa885('0x1b'),JSON['stringify'](_0x39ae58));}},'offlineForm':{'type':Sequelize[_0xa885('0x10')],'defaultValue':function(){return JSON[_0xa885('0x16')]({'items':[{'type':_0xa885('0x18'),'props':{'title':_0xa885('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xa885('0x3'),'type':_0xa885('0x3')},'variable':null},{'type':_0xa885('0x1c'),'config':{'placeholder':_0xa885('0x1d')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0xa885('0x1a')](this[_0xa885('0x19')](_0xa885('0x1e'))):{};},'set':function(_0x17c0eb){return this[_0xa885('0x1f')](_0xa885('0x1e'),JSON['stringify'](_0x17c0eb));}},'token':{'type':Sequelize[_0xa885('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xa885('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa885('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xa885('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xa885('0x2')]},'waitingTitle':{'type':Sequelize[_0xa885('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0x20')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xa885('0x21')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xa885('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xa885('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa885('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0x23')},'sendUnmanaged':{'type':Sequelize[_0xa885('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xa885('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xa885('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa885('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xa885('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xa885('0x2')]},'notificationTemplate':{'type':Sequelize[_0xa885('0x10')],'defaultValue':function(){return _0xa885('0x24');}},'notificationSound':{'type':Sequelize[_0xa885('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0xa885('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0x26')},'verticalAlignment':{'type':Sequelize[_0xa885('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0x27')},'defaultTitle':{'type':Sequelize[_0xa885('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa885('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa885('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa885('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa885('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa885('0x2')],'defaultValue':_0xa885('0x28')},'systemAvatar':{'type':Sequelize[_0xa885('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa885('0x6')],'comment':_0xa885('0x29')},'mandatoryDisposition':{'type':Sequelize[_0xa885('0x7')],'defaultValue':![],'comment':_0xa885('0x2a'),'set':function(_0x2f48a9){if(!_0x2f48a9)this['setDataValue'](_0xa885('0x2b'),null);this[_0xa885('0x1f')](_0xa885('0x2c'),_0x2f48a9);}},'vidaooEscalation':{'type':Sequelize[_0xa885('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xa885('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xfb82=['TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','name','onlineForm','parse','getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','Powered\x20by\x20xCALLY'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfb82,0x17f));var _0x2fb8=function(_0x432a44,_0x5d667b){_0x432a44=_0x432a44-0x0;var _0x1e2fdd=_0xfb82[_0x432a44];return _0x1e2fdd;};'use strict';var Sequelize=require(_0x2fb8('0x0'));var rs=require(_0x2fb8('0x1'));module[_0x2fb8('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x2fb8('0x3')],'allowNull':![],'unique':_0x2fb8('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0x5')},'mapKeyOffline':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0x5')},'key':{'type':Sequelize[_0x2fb8('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0x6')},'customerAlias':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2fb8('0x3')],'allowNull':![],'defaultValue':_0x2fb8('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2fb8('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x2fb8('0x3')],'allowNull':![],'defaultValue':_0x2fb8('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2fb8('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2fb8('0x3')]},'animation':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2fb8('0xb')](_0x2fb8('0xc'),_0x2fb8('0xd')),'defaultValue':_0x2fb8('0xc')},'header_online':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0xe')},'offline_chat_button':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2fb8('0x11')]},'closingQuestion':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2fb8('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0x13')},'noteTitle':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0x14')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2fb8('0x15')},'closingMessageButton':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0xf')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x2fb8('0x16')},'ratingType':{'type':Sequelize[_0x2fb8('0xb')](_0x2fb8('0x17'),_0x2fb8('0x18')),'defaultValue':_0x2fb8('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2fb8('0x11')],'defaultValue':function(){return JSON[_0x2fb8('0x19')]({'items':[{'type':_0x2fb8('0x1a'),'variable':null,'config':{'placeholder':'name','type':'text','required':!![]},'props':{'title':_0x2fb8('0x1b'),'helpText':''}},{'type':_0x2fb8('0x1a'),'props':{'title':_0x2fb8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2fb8('0x5'),'type':_0x2fb8('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x2fb8('0x1c'))?JSON[_0x2fb8('0x1d')](this[_0x2fb8('0x1e')](_0x2fb8('0x1c'))):{};},'set':function(_0x3bfc46){return this[_0x2fb8('0x1f')](_0x2fb8('0x1c'),JSON['stringify'](_0x3bfc46));}},'offlineForm':{'type':Sequelize[_0x2fb8('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x2fb8('0x1a'),'props':{'title':_0x2fb8('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2fb8('0x5'),'type':_0x2fb8('0x5')},'variable':null},{'type':_0x2fb8('0x20'),'config':{'placeholder':_0x2fb8('0x21')},'props':{'title':_0x2fb8('0x21'),'helpText':_0x2fb8('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x2fb8('0x1e')](_0x2fb8('0x23'))?JSON[_0x2fb8('0x1d')](this[_0x2fb8('0x1e')](_0x2fb8('0x23'))):{};},'set':function(_0x3ddafb){return this[_0x2fb8('0x1f')](_0x2fb8('0x23'),JSON['stringify'](_0x3ddafb));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x2fb8('0x24')]();}},'autoclose':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2fb8('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0x25')},'waitingMessage':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0x27')},'offlineMessageBody':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2fb8('0x29')},'skipUnmanaged':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0x2a')},'sendUnmanaged':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2fb8('0x3')]},'notificationTemplate':{'type':Sequelize[_0x2fb8('0x11')],'defaultValue':function(){return _0x2fb8('0x2b');}},'notificationSound':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x2fb8('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x2fb8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x2fb8('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':_0x2fb8('0x2d')},'defaultTitle':{'type':Sequelize[_0x2fb8('0x3')]},'customerAvatar':{'type':Sequelize[_0x2fb8('0x11')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2fb8('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2fb8('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2fb8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2fb8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2fb8('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2fb8('0x9')],'comment':_0x2fb8('0x2f')},'mandatoryDisposition':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':![],'comment':_0x2fb8('0x30'),'set':function(_0x45c66b){if(!_0x45c66b)this[_0x2fb8('0x1f')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x2fb8('0x31'),_0x45c66b);}},'vidaooEscalation':{'type':Sequelize[_0x2fb8('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2fb8('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 9c7c164..1d0dcb1 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 _0x6a0d=['role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','find','describe','ChatWebsiteId','Disposition','findOne','nolimit','options','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','getLicense','isNil','existsSync','root','download','getAvatar','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Applications','account','applications','list','Contacts','contact','cf-connecting-ip','first','split','firstName','lastName','x-real-port','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','spread','readFileSync','utf8','toPairs','offlineMessageBody','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','custom','increment','all','some','server/files/chat/iframe.js','remote','x-forwarded-for','x-real-ip','connection','referer','replace','render','alignment','addApplications','transaction','ChatApplication','bulkCreate','findAndCountAll','priority','getApplications','chatProactiveAction','addProactiveActions','ids','omit','getFields','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Contact','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','set','reject','save','get','ChatWebsites','destroy','stack','name','send','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','count','includeAll','include','findAll','params','Pause','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x432fa7,_0x4055c2){var _0x4ef8fd=function(_0x428783){while(--_0x428783){_0x432fa7['push'](_0x432fa7['shift']());}};_0x4ef8fd(++_0x4055c2);}(_0x6a0d,0x1e5));var _0xd6a0=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x6a0d[_0x4154a6];return _0x3b2786;};'use strict';var pdf=require(_0xd6a0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd6a0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd6a0('0x2'));var rp=require(_0xd6a0('0x3'));var moment=require(_0xd6a0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd6a0('0x5'));var util=require(_0xd6a0('0x6'));var path=require('path');var sox=require(_0xd6a0('0x7'));var csv=require('to-csv');var ejs=require(_0xd6a0('0x8'));var fs=require('fs');var _=require(_0xd6a0('0x9'));var squel=require(_0xd6a0('0xa'));var crypto=require(_0xd6a0('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6a0('0xc'));var Papa=require(_0xd6a0('0xd'));var Redis=require('ioredis');var authService=require(_0xd6a0('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6a0('0xf'));var logger=require(_0xd6a0('0x10'))(_0xd6a0('0x11'));var utils=require(_0xd6a0('0x12'));var config=require(_0xd6a0('0x13'));var db=require(_0xd6a0('0x14'))['db'];config[_0xd6a0('0x15')]=_[_0xd6a0('0x16')](config['redis'],{'host':_0xd6a0('0x17'),'port':0x18eb});var socket=require(_0xd6a0('0x18'))(new Redis(config['redis']));require(_0xd6a0('0x19'))['register'](socket);var jayson=require(_0xd6a0('0x1a'));var client=jayson[_0xd6a0('0x1b')][_0xd6a0('0x1c')]({'port':0x232c});var client9002=jayson[_0xd6a0('0x1b')][_0xd6a0('0x1c')]({'port':0x232a});var client9003=jayson[_0xd6a0('0x1b')][_0xd6a0('0x1c')]({'port':0x232b});function checkPasswordPattern(_0x5a7e08,_0x5b868d,_0xd2ad28){if(_0xd2ad28){var _0x5f075c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5f075c[_0xd6a0('0x1d')](_0x5b868d)){return _0x5a7e08;}else{throw new db[(_0xd6a0('0x1e'))][(_0xd6a0('0x1f'))](_0xd6a0('0x20'));}}else{return _0x5a7e08;}}function respondWithRpcPromise(_0x38e71b,_0x104b80,_0x4de236,_0x5347b0){return new BPromise(function(_0x291974,_0x27eb5d){var _0x72145b=_0x5347b0||client;return _0x72145b[_0xd6a0('0x21')](_0x38e71b,_0x4de236)[_0xd6a0('0x22')](function(_0x144a6d){logger[_0xd6a0('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x104b80,'request\x20sent');logger[_0xd6a0('0x24')](_0xd6a0('0x25'),_0x104b80,_0xd6a0('0x26'),JSON[_0xd6a0('0x27')](_0x144a6d));if(_0x144a6d[_0xd6a0('0x28')]){if(_0x144a6d['error']['code']===0x1f4){logger[_0xd6a0('0x28')]('ChatWebsite,\x20%s,\x20%s',_0x104b80,_0x144a6d[_0xd6a0('0x28')][_0xd6a0('0x29')]);return _0x27eb5d(_0x144a6d[_0xd6a0('0x28')][_0xd6a0('0x29')]);}logger[_0xd6a0('0x28')](_0xd6a0('0x2a'),_0x104b80,_0x144a6d[_0xd6a0('0x28')]['message']);return _0x291974(_0x144a6d['error']['message']);}else{logger[_0xd6a0('0x23')](_0xd6a0('0x2a'),_0x104b80,_0xd6a0('0x26'));_0x291974(_0x144a6d[_0xd6a0('0x2b')][_0xd6a0('0x29')]);}})[_0xd6a0('0x2c')](function(_0x342c1e){logger[_0xd6a0('0x28')](_0xd6a0('0x2a'),_0x104b80,_0x342c1e);_0x27eb5d(_0x342c1e);});});}function respondWithStatusCode(_0x11addb,_0x5dfbc9){_0x5dfbc9=_0x5dfbc9||0xcc;return function(_0x17c264){if(_0x17c264){return _0x11addb[_0xd6a0('0x2d')](_0x5dfbc9);}return _0x11addb[_0xd6a0('0x2e')](_0x5dfbc9)[_0xd6a0('0x2f')]();};}function respondWithResult(_0x22aa06,_0x32f074){_0x32f074=_0x32f074||0xc8;return function(_0x2de211){if(_0x2de211){return _0x22aa06[_0xd6a0('0x2e')](_0x32f074)[_0xd6a0('0x30')](_0x2de211);}};}function respondWithFilteredResult(_0xaa3135,_0x34a720){return function(_0x5601ac){if(_0x5601ac){var _0x46115e=_0x5601ac['count'],_0x471a76=_0x34a720[_0xd6a0('0x31')],_0x4e34f0=_0x34a720['offset']+_0x34a720['limit'],_0x59e3ce;if(_0x4e34f0>=_0x46115e){_0x4e34f0=_0x46115e;_0x59e3ce=0xc8;}else{_0x59e3ce=0xce;}_0xaa3135['status'](_0x59e3ce);return _0xaa3135[_0xd6a0('0x32')]('Content-Range',_0x471a76+'-'+_0x4e34f0+'/'+_0x46115e)[_0xd6a0('0x30')](_0x5601ac);}return null;};}function patchUpdates(_0x5e24cb){return function(_0x3c21f7){try{jsonpatch['apply'](_0x3c21f7,_0x5e24cb,!![]);}catch(_0x3c9efb){return BPromise[_0xd6a0('0x33')](_0x3c9efb);}return _0x3c21f7[_0xd6a0('0x34')]();};}function saveUpdates(_0x35c6fc,_0x2beb64){return function(_0x507682){if(_0x507682){return _0x507682['update'](_0x35c6fc)[_0xd6a0('0x22')](function(_0x5e65f4){return _0x5e65f4;});}return null;};}function removeEntity(_0x4caff0,_0x32b90d){return function(_0x4e3b9f){if(_0x4e3b9f){return _0x4e3b9f['destroy']()[_0xd6a0('0x22')](function(){var _0x68dd9d=_0x4e3b9f[_0xd6a0('0x35')]({'plain':!![]});var _0xe321a4=_0xd6a0('0x36');return db['UserProfileResource'][_0xd6a0('0x37')]({'where':{'type':_0xe321a4,'resourceId':_0x68dd9d['id']}})[_0xd6a0('0x22')](function(){return _0x4e3b9f;});})[_0xd6a0('0x22')](function(){_0x4caff0['status'](0xcc)[_0xd6a0('0x2f')]();});}};}function handleEntityNotFound(_0x44208c,_0x3739a3){return function(_0x2c11db){if(!_0x2c11db){_0x44208c[_0xd6a0('0x2d')](0x194);}return _0x2c11db;};}function handleError(_0x248aec,_0x1b2d05){_0x1b2d05=_0x1b2d05||0x1f4;return function(_0x1a3012){logger[_0xd6a0('0x28')](_0x1a3012[_0xd6a0('0x38')]);if(_0x1a3012[_0xd6a0('0x39')]){delete _0x1a3012[_0xd6a0('0x39')];}_0x248aec[_0xd6a0('0x2e')](_0x1b2d05)[_0xd6a0('0x3a')](_0x1a3012);};}exports[_0xd6a0('0x3b')]=function(_0x5eb101,_0x16118b){var _0x2ba8ad={'include':[{'model':db['Pause'],'as':_0xd6a0('0x3c')}]},_0x51f165={},_0x1bed9a={'count':0x0,'rows':[]};var _0x1c36d6=_[_0xd6a0('0x3d')](db[_0xd6a0('0x3e')][_0xd6a0('0x3f')],function(_0x3d629c){return{'name':_0x3d629c[_0xd6a0('0x40')],'type':_0x3d629c['type'][_0xd6a0('0x41')]};});_0x51f165[_0xd6a0('0x42')]=_['map'](_0x1c36d6,'name');_0x51f165[_0xd6a0('0x43')]=_[_0xd6a0('0x44')](_0x5eb101[_0xd6a0('0x43')]);_0x51f165['filters']=_[_0xd6a0('0x45')](_0x51f165[_0xd6a0('0x42')],_0x51f165[_0xd6a0('0x43')]);_0x2ba8ad[_0xd6a0('0x46')]=_['intersection'](_0x51f165[_0xd6a0('0x42')],qs['fields'](_0x5eb101[_0xd6a0('0x43')][_0xd6a0('0x47')]));_0x2ba8ad[_0xd6a0('0x46')]=_0x2ba8ad[_0xd6a0('0x46')][_0xd6a0('0x48')]?_0x2ba8ad['attributes']:_0x51f165[_0xd6a0('0x42')];if(!_0x5eb101[_0xd6a0('0x43')][_0xd6a0('0x49')]('nolimit')){_0x2ba8ad[_0xd6a0('0x4a')]=qs[_0xd6a0('0x4a')](_0x5eb101[_0xd6a0('0x43')]['limit']);_0x2ba8ad['offset']=qs['offset'](_0x5eb101[_0xd6a0('0x43')][_0xd6a0('0x31')]);}_0x2ba8ad[_0xd6a0('0x4b')]=qs[_0xd6a0('0x4c')](_0x5eb101[_0xd6a0('0x43')][_0xd6a0('0x4c')]);_0x2ba8ad[_0xd6a0('0x4d')]=qs[_0xd6a0('0x4e')](_[_0xd6a0('0x4f')](_0x5eb101['query'],_0x51f165['filters']),_0x1c36d6);if(_0x5eb101[_0xd6a0('0x43')]['filter']){_0x2ba8ad[_0xd6a0('0x4d')]=_[_0xd6a0('0x50')](_0x2ba8ad[_0xd6a0('0x4d')],{'$or':_['map'](_0x1c36d6,function(_0x59a7d7){if(_0x59a7d7[_0xd6a0('0x51')]!==_0xd6a0('0x52')){var _0x1f9962={};_0x1f9962[_0x59a7d7['name']]={'$like':'%'+_0x5eb101[_0xd6a0('0x43')][_0xd6a0('0x53')]+'%'};return _0x1f9962;}})});}_0x2ba8ad=_['merge']({},_0x2ba8ad,_0x5eb101['options']);var _0x47f568={'where':_0x2ba8ad[_0xd6a0('0x4d')]};return db[_0xd6a0('0x3e')][_0xd6a0('0x54')](_0x47f568)[_0xd6a0('0x22')](function(_0xc7afcb){_0x1bed9a[_0xd6a0('0x54')]=_0xc7afcb;if(_0x5eb101[_0xd6a0('0x43')][_0xd6a0('0x55')]){_0x2ba8ad[_0xd6a0('0x56')]=[{'all':!![]}];}return db[_0xd6a0('0x3e')][_0xd6a0('0x57')](_0x2ba8ad);})[_0xd6a0('0x22')](function(_0x3d7bcf){_0x1bed9a['rows']=_0x3d7bcf;return _0x1bed9a;})[_0xd6a0('0x22')](respondWithFilteredResult(_0x16118b,_0x2ba8ad))[_0xd6a0('0x2c')](handleError(_0x16118b,null));};exports['show']=function(_0x381283,_0x28cc31){var _0x5725f7={'raw':![],'where':{'id':_0x381283[_0xd6a0('0x58')]['id']},'include':[{'model':db[_0xd6a0('0x59')],'as':_0xd6a0('0x3c')}]},_0x5268fb={};_0x5268fb[_0xd6a0('0x42')]=_['keys'](db[_0xd6a0('0x3e')][_0xd6a0('0x3f')]);_0x5268fb[_0xd6a0('0x43')]=_['keys'](_0x381283[_0xd6a0('0x43')]);_0x5268fb['filters']=_[_0xd6a0('0x45')](_0x5268fb['model'],_0x5268fb['query']);_0x5725f7['attributes']=_['intersection'](_0x5268fb[_0xd6a0('0x42')],qs[_0xd6a0('0x47')](_0x381283[_0xd6a0('0x43')]['fields']));_0x5725f7['attributes']=_0x5725f7[_0xd6a0('0x46')][_0xd6a0('0x48')]?_0x5725f7[_0xd6a0('0x46')]:_0x5268fb[_0xd6a0('0x42')];if(_0x381283['query'][_0xd6a0('0x55')]){_0x5725f7[_0xd6a0('0x56')]=[{'all':!![]}];}_0x5725f7=_[_0xd6a0('0x50')]({},_0x5725f7,_0x381283['options']);return db[_0xd6a0('0x3e')]['find'](_0x5725f7)[_0xd6a0('0x22')](handleEntityNotFound(_0x28cc31,null))[_0xd6a0('0x22')](respondWithResult(_0x28cc31,null))[_0xd6a0('0x2c')](handleError(_0x28cc31,null));};exports['create']=function(_0x3277e6,_0x45fe96){return db[_0xd6a0('0x3e')][_0xd6a0('0x5a')](_0x3277e6['body'],{})[_0xd6a0('0x22')](function(_0x2f085b){var _0x2220e9=_0x3277e6[_0xd6a0('0x5b')][_0xd6a0('0x35')]({'plain':!![]});if(!_0x2220e9)throw new Error(_0xd6a0('0x5c'));if(_0x2220e9[_0xd6a0('0x5d')]==='user'){var _0x37fb9c=_0x2f085b[_0xd6a0('0x35')]({'plain':!![]});var _0x5d1b65=_0xd6a0('0x36');return db[_0xd6a0('0x5e')]['find']({'where':{'name':_0x5d1b65,'userProfileId':_0x2220e9[_0xd6a0('0x5f')]},'raw':!![]})['then'](function(_0x30cd5b){if(_0x30cd5b&&_0x30cd5b[_0xd6a0('0x60')]===0x0){return db[_0xd6a0('0x61')]['create']({'name':_0x37fb9c[_0xd6a0('0x39')],'resourceId':_0x37fb9c['id'],'type':_0x30cd5b[_0xd6a0('0x39')],'sectionId':_0x30cd5b['id']},{})[_0xd6a0('0x22')](function(){return _0x2f085b;});}else{return _0x2f085b;}})['catch'](function(_0x548652){logger[_0xd6a0('0x28')](_0xd6a0('0x62'),_0x548652);throw _0x548652;});}return _0x2f085b;})['then'](respondWithResult(_0x45fe96,0xc9))[_0xd6a0('0x2c')](handleError(_0x45fe96,null));};exports[_0xd6a0('0x63')]=function(_0x35fcf7,_0xedfe21){if(_0x35fcf7[_0xd6a0('0x64')]['id']){delete _0x35fcf7['body']['id'];}return db[_0xd6a0('0x3e')][_0xd6a0('0x65')]({'where':{'id':_0x35fcf7['params']['id']},'include':[{'model':db[_0xd6a0('0x59')],'as':'mandatoryDispositionPause'}]})[_0xd6a0('0x22')](handleEntityNotFound(_0xedfe21,null))[_0xd6a0('0x22')](saveUpdates(_0x35fcf7[_0xd6a0('0x64')],null))['then'](respondWithResult(_0xedfe21,null))[_0xd6a0('0x2c')](handleError(_0xedfe21,null));};exports[_0xd6a0('0x37')]=function(_0x340e6e,_0xfd595f){return db[_0xd6a0('0x3e')][_0xd6a0('0x65')]({'where':{'id':_0x340e6e[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0xfd595f,null))[_0xd6a0('0x22')](removeEntity(_0xfd595f,null))[_0xd6a0('0x2c')](handleError(_0xfd595f,null));};exports['describe']=function(_0x45a397,_0x41ed62){return db[_0xd6a0('0x3e')][_0xd6a0('0x66')]()['then'](respondWithResult(_0x41ed62,null))['catch'](handleError(_0x41ed62,null));};exports['addDisposition']=function(_0x2e280a,_0x14fadc,_0x2b2178){if(_0x2e280a[_0xd6a0('0x64')]['id']){delete _0x2e280a[_0xd6a0('0x64')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x2e280a[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0x14fadc,null))[_0xd6a0('0x22')](function(_0x7fa43c){if(_0x7fa43c){_0x2e280a['body'][_0xd6a0('0x67')]=_0x7fa43c['id'];return db[_0xd6a0('0x68')][_0xd6a0('0x5a')](_0x2e280a[_0xd6a0('0x64')]);}})[_0xd6a0('0x22')](respondWithResult(_0x14fadc,null))[_0xd6a0('0x2c')](handleError(_0x14fadc,null));};exports['getDispositions']=function(_0x1d0633,_0x96ce9c,_0x4e562b){var _0x56665f={'raw':![],'where':{}};var _0x4b6ba3={};var _0x3440f4={'count':0x0,'rows':[]};return db[_0xd6a0('0x3e')][_0xd6a0('0x69')]({'where':{'id':_0x1d0633[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0x96ce9c,null))[_0xd6a0('0x22')](function(_0x335fa6){if(_0x335fa6){_0x4b6ba3['model']=_[_0xd6a0('0x44')](db[_0xd6a0('0x68')]['rawAttributes']);_0x4b6ba3[_0xd6a0('0x43')]=_[_0xd6a0('0x44')](_0x1d0633[_0xd6a0('0x43')]);_0x4b6ba3[_0xd6a0('0x4e')]=_['intersection'](_0x4b6ba3[_0xd6a0('0x42')],_0x4b6ba3[_0xd6a0('0x43')]);_0x56665f['attributes']=_[_0xd6a0('0x45')](_0x4b6ba3[_0xd6a0('0x42')],qs[_0xd6a0('0x47')](_0x1d0633['query'][_0xd6a0('0x47')]));_0x56665f[_0xd6a0('0x46')]=_0x56665f[_0xd6a0('0x46')][_0xd6a0('0x48')]?_0x56665f['attributes']:_0x4b6ba3['model'];if(!_0x1d0633[_0xd6a0('0x43')][_0xd6a0('0x49')](_0xd6a0('0x6a'))){_0x56665f['limit']=qs['limit'](_0x1d0633['query'][_0xd6a0('0x4a')]);_0x56665f[_0xd6a0('0x31')]=qs[_0xd6a0('0x31')](_0x1d0633['query'][_0xd6a0('0x31')]);}_0x56665f['order']=qs[_0xd6a0('0x4c')](_0x1d0633[_0xd6a0('0x43')][_0xd6a0('0x4c')]);_0x56665f[_0xd6a0('0x4d')]=qs[_0xd6a0('0x4e')](_[_0xd6a0('0x4f')](_0x1d0633['query'],_0x4b6ba3['filters']));_0x56665f['where']['ChatWebsiteId']=_0x335fa6['id'];if(_0x1d0633[_0xd6a0('0x43')][_0xd6a0('0x53')]){_0x56665f[_0xd6a0('0x4d')]=_[_0xd6a0('0x50')](_0x56665f['where'],{'$or':_[_0xd6a0('0x3d')](_0x56665f[_0xd6a0('0x46')],function(_0x52f4b3){var _0x415b64={};_0x415b64[_0x52f4b3]={'$like':'%'+_0x1d0633[_0xd6a0('0x43')]['filter']+'%'};return _0x415b64;})});}_0x56665f=_['merge']({},_0x56665f,_0x1d0633[_0xd6a0('0x6b')]);return db[_0xd6a0('0x68')][_0xd6a0('0x54')]({'where':_0x56665f[_0xd6a0('0x4d')]})[_0xd6a0('0x22')](function(_0x5abc1a){_0x3440f4[_0xd6a0('0x54')]=_0x5abc1a;if(_0x1d0633['query'][_0xd6a0('0x55')]){_0x56665f['include']=[{'all':!![]}];}return db[_0xd6a0('0x68')][_0xd6a0('0x57')](_0x56665f);})[_0xd6a0('0x22')](function(_0x2cc982){_0x3440f4[_0xd6a0('0x6c')]=_0x2cc982;return _0x3440f4;});}})[_0xd6a0('0x22')](respondWithFilteredResult(_0x96ce9c,_0x56665f))[_0xd6a0('0x2c')](handleError(_0x96ce9c,null));};exports[_0xd6a0('0x6d')]=function(_0x60ee1d,_0x9ce6a3,_0x2aed65){return db[_0xd6a0('0x3e')][_0xd6a0('0x65')]({'where':{'id':_0x60ee1d[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0x9ce6a3,null))[_0xd6a0('0x22')](function(_0x1b4cbd){if(_0x1b4cbd){return _0x1b4cbd[_0xd6a0('0x6d')](_0x60ee1d[_0xd6a0('0x43')]['ids']);}})[_0xd6a0('0x22')](respondWithStatusCode(_0x9ce6a3,null))['catch'](handleError(_0x9ce6a3,null));};exports[_0xd6a0('0x6e')]=function(_0x1878cc,_0x16eff4,_0x4ccc60){if(_0x1878cc[_0xd6a0('0x64')]['id']){delete _0x1878cc['body']['id'];}return db[_0xd6a0('0x3e')][_0xd6a0('0x65')]({'where':{'id':_0x1878cc[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0x16eff4,null))[_0xd6a0('0x22')](function(_0x4d13ba){if(_0x4d13ba){_0x1878cc['body'][_0xd6a0('0x67')]=_0x4d13ba['id'];return db[_0xd6a0('0x6f')]['create'](_0x1878cc['body']);}})['then'](respondWithResult(_0x16eff4,null))[_0xd6a0('0x2c')](handleError(_0x16eff4,null));};exports[_0xd6a0('0x70')]=function(_0x33b1af,_0x4b7ad5,_0x4f6805){var _0x265b38={'raw':![],'where':{}};var _0x588f0b={};var _0x32bdd6={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x33b1af[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0x4b7ad5,null))['then'](function(_0x677546){if(_0x677546){_0x588f0b[_0xd6a0('0x42')]=_[_0xd6a0('0x44')](db[_0xd6a0('0x6f')]['rawAttributes']);_0x588f0b[_0xd6a0('0x43')]=_[_0xd6a0('0x44')](_0x33b1af[_0xd6a0('0x43')]);_0x588f0b[_0xd6a0('0x4e')]=_[_0xd6a0('0x45')](_0x588f0b[_0xd6a0('0x42')],_0x588f0b[_0xd6a0('0x43')]);_0x265b38[_0xd6a0('0x46')]=_[_0xd6a0('0x45')](_0x588f0b[_0xd6a0('0x42')],qs['fields'](_0x33b1af[_0xd6a0('0x43')][_0xd6a0('0x47')]));_0x265b38[_0xd6a0('0x46')]=_0x265b38[_0xd6a0('0x46')][_0xd6a0('0x48')]?_0x265b38[_0xd6a0('0x46')]:_0x588f0b[_0xd6a0('0x42')];if(!_0x33b1af[_0xd6a0('0x43')][_0xd6a0('0x49')](_0xd6a0('0x6a'))){_0x265b38[_0xd6a0('0x4a')]=qs[_0xd6a0('0x4a')](_0x33b1af[_0xd6a0('0x43')]['limit']);_0x265b38[_0xd6a0('0x31')]=qs['offset'](_0x33b1af[_0xd6a0('0x43')][_0xd6a0('0x31')]);}_0x265b38['order']=qs['sort'](_0x33b1af[_0xd6a0('0x43')][_0xd6a0('0x4c')]);_0x265b38[_0xd6a0('0x4d')]=qs['filters'](_[_0xd6a0('0x4f')](_0x33b1af[_0xd6a0('0x43')],_0x588f0b[_0xd6a0('0x4e')]));_0x265b38[_0xd6a0('0x4d')]['ChatWebsiteId']=_0x677546['id'];if(_0x33b1af[_0xd6a0('0x43')][_0xd6a0('0x53')]){_0x265b38[_0xd6a0('0x4d')]=_[_0xd6a0('0x50')](_0x265b38[_0xd6a0('0x4d')],{'$or':_['map'](_0x265b38[_0xd6a0('0x46')],function(_0x29e857){var _0x3f261e={};_0x3f261e[_0x29e857]={'$like':'%'+_0x33b1af['query']['filter']+'%'};return _0x3f261e;})});}_0x265b38=_['merge']({},_0x265b38,_0x33b1af[_0xd6a0('0x6b')]);return db[_0xd6a0('0x6f')][_0xd6a0('0x54')]({'where':_0x265b38[_0xd6a0('0x4d')]})[_0xd6a0('0x22')](function(_0x5ae991){_0x32bdd6[_0xd6a0('0x54')]=_0x5ae991;if(_0x33b1af[_0xd6a0('0x43')][_0xd6a0('0x55')]){_0x265b38[_0xd6a0('0x56')]=[{'all':!![]}];}return db[_0xd6a0('0x6f')][_0xd6a0('0x57')](_0x265b38);})['then'](function(_0x466b4e){_0x32bdd6[_0xd6a0('0x6c')]=_0x466b4e;return _0x32bdd6;});}})[_0xd6a0('0x22')](respondWithFilteredResult(_0x4b7ad5,_0x265b38))[_0xd6a0('0x2c')](handleError(_0x4b7ad5,null));};exports[_0xd6a0('0x71')]=function(_0x3c8be4,_0x494d7a,_0x357d50){return db['ChatWebsite'][_0xd6a0('0x65')]({'where':{'id':_0x3c8be4[_0xd6a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x494d7a,null))[_0xd6a0('0x22')](function(_0x506d12){if(_0x506d12){return _0x506d12[_0xd6a0('0x71')](_0x3c8be4[_0xd6a0('0x43')]['ids']);}})[_0xd6a0('0x22')](respondWithStatusCode(_0x494d7a,null))[_0xd6a0('0x2c')](handleError(_0x494d7a,null));};exports[_0xd6a0('0x72')]=function(_0x8dfb6,_0x584bfe,_0x2519ba){_0x8dfb6['body'][_0xd6a0('0x73')]=_0x8dfb6[_0xd6a0('0x74')][_0xd6a0('0x75')];return db[_0xd6a0('0x3e')][_0xd6a0('0x65')]({'where':{'id':_0x8dfb6['params']['id']}})['then'](handleEntityNotFound(_0x584bfe,null))[_0xd6a0('0x22')](saveUpdates(_0x8dfb6['body'],null))[_0xd6a0('0x22')](respondWithResult(_0x584bfe,null))[_0xd6a0('0x2c')](handleError(_0x584bfe,null));};exports[_0xd6a0('0x76')]=function(_0x10eaa5,_0x1ca98e,_0x20a737){_0x10eaa5['body']['agentAvatar']=_0x10eaa5[_0xd6a0('0x74')][_0xd6a0('0x75')];return db[_0xd6a0('0x3e')][_0xd6a0('0x65')]({'where':{'id':_0x10eaa5[_0xd6a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x1ca98e,null))[_0xd6a0('0x22')](saveUpdates(_0x10eaa5[_0xd6a0('0x64')],null))[_0xd6a0('0x22')](respondWithResult(_0x1ca98e,null))[_0xd6a0('0x2c')](handleError(_0x1ca98e,null));};exports[_0xd6a0('0x77')]=function(_0x594994,_0xe6f795,_0x25df81){_0x594994[_0xd6a0('0x64')][_0xd6a0('0x78')]=_0x594994[_0xd6a0('0x74')]['filename'];return db[_0xd6a0('0x3e')][_0xd6a0('0x65')]({'where':{'id':_0x594994[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0xe6f795,null))[_0xd6a0('0x22')](saveUpdates(_0x594994['body'],null))[_0xd6a0('0x22')](respondWithResult(_0xe6f795,null))[_0xd6a0('0x2c')](handleError(_0xe6f795,null));};exports[_0xd6a0('0x79')]=function(_0x6dc746,_0x1d4256,_0x1cf0f3){_0x6dc746['body']['systemAvatar']=_0x6dc746[_0xd6a0('0x74')][_0xd6a0('0x75')];return db[_0xd6a0('0x3e')][_0xd6a0('0x65')]({'where':{'id':_0x6dc746['params']['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0x1d4256,null))[_0xd6a0('0x22')](saveUpdates(_0x6dc746[_0xd6a0('0x64')],null))[_0xd6a0('0x22')](respondWithResult(_0x1d4256,null))[_0xd6a0('0x2c')](handleError(_0x1d4256,null));};exports[_0xd6a0('0x7a')]=function(_0x228ab3,_0x145581,_0xadb33e){var _0x2be4b8=path[_0xd6a0('0x7b')](config['root'],_0xd6a0('0x7c'));var _0x307262={'where':{'id':_0x228ab3['params']['id']},'attributes':['id',_0xd6a0('0x73')],'raw':!![]};var _0x966246=![];return require('../../config/license/util')[_0xd6a0('0x7d')]()['then'](function(_0x490508){if(_0x490508){_0x966246=_0x490508['custom'];}})[_0xd6a0('0x22')](function(){return db[_0xd6a0('0x3e')][_0xd6a0('0x65')](_0x307262);})[_0xd6a0('0x22')](handleEntityNotFound(_0x145581,null))[_0xd6a0('0x22')](function(_0x4aae3d){if(_0x4aae3d){if(!_[_0xd6a0('0x7e')](_0x4aae3d['sitepic'])){if(fs[_0xd6a0('0x7f')](path[_0xd6a0('0x7b')](config[_0xd6a0('0x80')],'server/files/images/logos/',_0x4aae3d[_0xd6a0('0x73')]))&&_0x966246){_0x2be4b8=path[_0xd6a0('0x7b')](config[_0xd6a0('0x80')],'server/files/images/logos/',_0x4aae3d[_0xd6a0('0x73')]);}}return _0x145581[_0xd6a0('0x81')](_0x2be4b8);}})[_0xd6a0('0x2c')](handleError(_0x145581,null));};exports[_0xd6a0('0x82')]=function(_0x1cdfec,_0x320336,_0x213ade){var _0x2409a7=path['join'](config['root'],'server/files/images/avatars/default_avatar.png');var _0xe0cf5={'where':{'id':_0x1cdfec[_0xd6a0('0x58')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xd6a0('0x3e')][_0xd6a0('0x65')](_0xe0cf5)['then'](handleEntityNotFound(_0x320336,null))[_0xd6a0('0x22')](function(_0x471ea7){if(_0x471ea7){if(!_[_0xd6a0('0x7e')](_0x471ea7[_0xd6a0('0x83')])){if(fs[_0xd6a0('0x7f')](path[_0xd6a0('0x7b')](config[_0xd6a0('0x80')],_0xd6a0('0x84'),_0x471ea7[_0xd6a0('0x83')]))){_0x2409a7=path['join'](config[_0xd6a0('0x80')],_0xd6a0('0x84'),_0x471ea7[_0xd6a0('0x83')]);}}return _0x320336[_0xd6a0('0x81')](_0x2409a7);}})['catch'](handleError(_0x320336,null));};exports[_0xd6a0('0x85')]=function(_0x3709a4,_0x1b9dfa,_0x59f3bc){var _0x56b1bb=path[_0xd6a0('0x7b')](config[_0xd6a0('0x80')],_0xd6a0('0x86'));var _0x432892={'where':{'id':_0x3709a4['params']['id']},'attributes':['id',_0xd6a0('0x78'),_0xd6a0('0x87')],'raw':!![]};return db[_0xd6a0('0x3e')][_0xd6a0('0x65')](_0x432892)[_0xd6a0('0x22')](handleEntityNotFound(_0x1b9dfa,null))[_0xd6a0('0x22')](function(_0x55fd9f){if(_0x55fd9f){if(!_[_0xd6a0('0x7e')](_0x55fd9f[_0xd6a0('0x78')])){if(fs[_0xd6a0('0x7f')](path[_0xd6a0('0x7b')](config[_0xd6a0('0x80')],_0xd6a0('0x84'),_0x55fd9f[_0xd6a0('0x78')]))&&_0x55fd9f[_0xd6a0('0x87')]){_0x56b1bb=path[_0xd6a0('0x7b')](config[_0xd6a0('0x80')],_0xd6a0('0x84'),_0x55fd9f[_0xd6a0('0x78')]);}}return _0x1b9dfa[_0xd6a0('0x81')](_0x56b1bb);}})[_0xd6a0('0x2c')](handleError(_0x1b9dfa,null));};exports[_0xd6a0('0x88')]=function(_0x56607c,_0x1b642f,_0x2f39ea){var _0x3171=path['join'](config['root'],'server/files/images/avatars/system_avatar.png');var _0x4fde80={'where':{'id':_0x56607c['params']['id']},'attributes':['id',_0xd6a0('0x89')],'raw':!![]};return db['ChatWebsite'][_0xd6a0('0x65')](_0x4fde80)['then'](handleEntityNotFound(_0x1b642f,null))[_0xd6a0('0x22')](function(_0x195afd){if(_0x195afd){if(!_[_0xd6a0('0x7e')](_0x195afd[_0xd6a0('0x89')])){if(fs[_0xd6a0('0x7f')](path[_0xd6a0('0x7b')](config[_0xd6a0('0x80')],'server/files/images/avatars/',_0x195afd[_0xd6a0('0x89')]))){_0x3171=path[_0xd6a0('0x7b')](config[_0xd6a0('0x80')],_0xd6a0('0x84'),_0x195afd[_0xd6a0('0x89')]);}}return _0x1b642f['download'](_0x3171);}})[_0xd6a0('0x2c')](handleError(_0x1b642f,null));};exports[_0xd6a0('0x8a')]=function(_0x47915d,_0xfd36b8,_0x216e53){var _0x48315a=require(_0xd6a0('0x8b'));var _0x1bd80b=new _0x48315a();var _0xb0f71e=_0x1bd80b[_0xd6a0('0x8c')](_0x47915d[_0xd6a0('0x8d')][_0xd6a0('0x8e')])[_0xd6a0('0x8f')]();var _0x38be7d={'body':_0x47915d[_0xd6a0('0x64')],'channel':_0xd6a0('0x90')};var _0x446b68=[];var _0x46bac9=[];var _0x4eb179={};var _0x4eef7f=![];return db[_0xd6a0('0x91')][_0xd6a0('0x66')]()[_0xd6a0('0x22')](function(_0x343602){if(!_0x343602){throw new db[(_0xd6a0('0x1e'))][(_0xd6a0('0x1f'))](_0xd6a0('0x92'));}_0x446b68=_['difference'](_[_0xd6a0('0x44')](_0x343602),[_0xd6a0('0x93'),_0xd6a0('0x94')]);_0x46bac9=_[_0xd6a0('0x95')](_[_0xd6a0('0x44')](_0x343602),['createdAt',_0xd6a0('0x94'),_0xd6a0('0x96'),_0xd6a0('0x97')]);if(_0x47915d[_0xd6a0('0x64')]['id']){delete _0x47915d['body']['id'];}if(_[_0xd6a0('0x7e')](_0x47915d[_0xd6a0('0x64')][_0xd6a0('0x98')])){throw new db['Sequelize'][(_0xd6a0('0x1f'))](_0xd6a0('0x99'));}if(_[_0xd6a0('0x7e')](_0x47915d['body'][_0xd6a0('0x64')])||_0x47915d['body'][_0xd6a0('0x64')]===''){throw new db['Sequelize']['ValidationError'](_0xd6a0('0x9a'));}if(_[_0xd6a0('0x7e')](_0x47915d[_0xd6a0('0x64')][_0xd6a0('0x9b')])){throw new db[(_0xd6a0('0x1e'))][(_0xd6a0('0x1f'))](_0xd6a0('0x9c')+_0x46bac9);}if(!_[_0xd6a0('0x9d')](_0x46bac9,_0x47915d[_0xd6a0('0x64')][_0xd6a0('0x9b')])){throw new db[(_0xd6a0('0x1e'))][(_0xd6a0('0x1f'))](_0xd6a0('0x9e')+_0x46bac9);}_0x4eb179[_0x47915d[_0xd6a0('0x64')]['mapKey']]=_0x47915d[_0xd6a0('0x64')]['from'];})[_0xd6a0('0x22')](function(){return db[_0xd6a0('0x3e')][_0xd6a0('0x65')]({'where':{'id':_0x47915d[_0xd6a0('0x58')]['id']},'include':[{'model':db[_0xd6a0('0x9f')],'as':_0xd6a0('0xa0'),'include':[{'model':db[_0xd6a0('0x91')],'as':'Contacts','where':_0x4eb179,'limit':0x1,'order':[[_0xd6a0('0x94'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0xd6a0('0xa1')}]});})[_0xd6a0('0x22')](handleEntityNotFound(_0xfd36b8,null))[_0xd6a0('0x22')](function(_0x57601f){if(_0x57601f&&_0x57601f[_0xd6a0('0xa0')]){_0x38be7d[_0xd6a0('0xa2')]=_0x57601f;_0x38be7d[_0xd6a0('0xa3')]=_0x57601f['Applications'];_0x38be7d[_0xd6a0('0xa4')]=_0x57601f[_0xd6a0('0xa0')];_0x38be7d[_0xd6a0('0xa3')]=_['orderBy'](_0x38be7d['applications'],['priority'],['asc']);if(_0x38be7d[_0xd6a0('0xa2')][_0xd6a0('0xa1')]){delete _0x38be7d[_0xd6a0('0xa2')][_0xd6a0('0xa1')];}if(_0x38be7d['account'][_0xd6a0('0xa0')]&&_0x38be7d[_0xd6a0('0xa2')][_0xd6a0('0xa0')]['Contacts'][_0xd6a0('0x48')]){return _0x38be7d[_0xd6a0('0xa2')][_0xd6a0('0xa0')][_0xd6a0('0xa5')][0x0];}var _0x3205c1=_[_0xd6a0('0x16')](_0x47915d[_0xd6a0('0x64')],{'firstName':_0x47915d[_0xd6a0('0x64')]['from'],'ListId':_0x57601f['ListId']});_0x3205c1[_0x47915d[_0xd6a0('0x64')][_0xd6a0('0x9b')]]=_0x47915d[_0xd6a0('0x64')]['from'];return db[_0xd6a0('0x91')][_0xd6a0('0x5a')](_0x3205c1,{'fields':_0x446b68,'raw':!![]});}})['then'](handleEntityNotFound(_0xfd36b8,null))[_0xd6a0('0x22')](function(_0x2ffbf7){_0x38be7d[_0xd6a0('0xa6')]=_0x2ffbf7;var _0x34af50=_0x47915d[_0xd6a0('0x64')]['customerIp'];if(_0x47915d[_0xd6a0('0x8d')][_0xd6a0('0xa7')]){_0x34af50=_0x47915d[_0xd6a0('0x8d')][_0xd6a0('0xa7')];}else if(_0x47915d['headers']['x-forwarded-for']){_0x34af50=_[_0xd6a0('0xa8')](_0x47915d[_0xd6a0('0x8d')]['x-forwarded-for'][_0xd6a0('0xa9')](','));}if(_0x2ffbf7){var _0x5b9e16={'ContactId':_0x2ffbf7['id'],'ChatWebsiteId':_0x47915d[_0xd6a0('0x58')]['id'],'from':(_0x2ffbf7[_0xd6a0('0xaa')]||'')+'\x20'+(_0x2ffbf7[_0xd6a0('0xab')]||''),'customerIp':_0x34af50,'customerPort':_0x47915d[_0xd6a0('0x8d')][_0xd6a0('0xac')]?_0x47915d['headers'][_0xd6a0('0xac')]:null,'referer':_0x47915d[_0xd6a0('0x64')]['referer'],'browserName':_0xb0f71e['browser']['name']&&_0xb0f71e[_0xd6a0('0xad')][_0xd6a0('0xae')]?util[_0xd6a0('0xaf')](_0xd6a0('0xb0'),_0xb0f71e[_0xd6a0('0xad')][_0xd6a0('0x39')],_0xb0f71e[_0xd6a0('0xad')][_0xd6a0('0xae')]):_0xd6a0('0xb1'),'browserVersion':_0xb0f71e['browser'][_0xd6a0('0xae')]||'unknown','osName':util[_0xd6a0('0xaf')](_0xd6a0('0xb0'),_0xb0f71e['os'][_0xd6a0('0x39')],_0xb0f71e['os'][_0xd6a0('0xae')]),'osVersion':_0xb0f71e['os'][_0xd6a0('0xae')],'deviceModel':_0xb0f71e[_0xd6a0('0xb2')][_0xd6a0('0x42')]&&_0xb0f71e[_0xd6a0('0xb2')][_0xd6a0('0xb3')]?util[_0xd6a0('0xaf')](_0xd6a0('0xb4'),_0xb0f71e[_0xd6a0('0xb2')][_0xd6a0('0x42')],_0xb0f71e[_0xd6a0('0xb2')][_0xd6a0('0xb3')],_0xb0f71e[_0xd6a0('0xb2')][_0xd6a0('0x51')]):null,'deviceVendor':_0xb0f71e[_0xd6a0('0xb2')][_0xd6a0('0xb3')],'deviceType':_0xb0f71e[_0xd6a0('0xb2')]['type'],'formData':JSON['stringify'](_0x47915d['body'])};var _0x2261d6={'ChatWebsiteId':_0x47915d['params']['id'],'closed':![]};if(_0x47915d['body'][_0xd6a0('0xb5')]){_0x2261d6[_0xd6a0('0xb5')]=_0x47915d[_0xd6a0('0x64')][_0xd6a0('0xb5')];return db[_0xd6a0('0xb6')][_0xd6a0('0x65')]({'where':_0x2261d6})[_0xd6a0('0x22')](function(_0x2d72a7){if(_0x2d72a7){return[_0x2d72a7,![]];}_0x5b9e16['threadId']=_0x47915d[_0xd6a0('0x64')][_0xd6a0('0xb5')];_0x5b9e16[_0xd6a0('0xb7')]=_0x47915d[_0xd6a0('0x64')][_0xd6a0('0xb7')];return db[_0xd6a0('0xb6')][_0xd6a0('0x5a')](_0x5b9e16)[_0xd6a0('0x22')](function(_0x8240d6){return[_0x8240d6,!![]];});});}_0x2261d6[_0xd6a0('0xb8')]=_0x2ffbf7['id'];if(_0x47915d['body'][_0xd6a0('0xb9')]&&_0x47915d[_0xd6a0('0x64')][_0xd6a0('0xb9')]['id']){_0x2261d6['id']=_0x47915d[_0xd6a0('0x64')][_0xd6a0('0xb9')]['id'];return db[_0xd6a0('0xb6')]['find']({'where':_0x2261d6})[_0xd6a0('0x22')](function(_0x27e30c){if(_0x27e30c){return[_0x27e30c,![]];}return db[_0xd6a0('0xb6')][_0xd6a0('0x5a')](_0x5b9e16)[_0xd6a0('0x22')](function(_0xbe1746){return[_0xbe1746,!![]];});});}return db[_0xd6a0('0xb6')][_0xd6a0('0x5a')](_0x5b9e16)['then'](function(_0x34bf02){return[_0x34bf02,!![]];});}})['spread'](function(_0x5c33e4,_0x2f2450){if(_0x5c33e4){_0x4eef7f=_0x2f2450;if(!_0x2f2450){var _0x202c8e={'from':(_0x38be7d[_0xd6a0('0xa6')][_0xd6a0('0xaa')]||'')+'\x20'+(_0x38be7d[_0xd6a0('0xa6')][_0xd6a0('0xab')]||'')};if(_0x47915d[_0xd6a0('0x64')][_0xd6a0('0xb5')]&&_0x47915d[_0xd6a0('0x64')][_0xd6a0('0xba')]&&_0x47915d[_0xd6a0('0x64')]['threadId']!=_0x47915d[_0xd6a0('0x64')][_0xd6a0('0xba')]){_0x202c8e[_0xd6a0('0xb5')]=_0x47915d[_0xd6a0('0x64')][_0xd6a0('0xba')];}return _0x5c33e4[_0xd6a0('0x63')](_0x202c8e);}else{return _0x5c33e4;}}})[_0xd6a0('0x22')](function(_0x53c252){_0x38be7d[_0xd6a0('0xb9')]=_0x53c252[_0xd6a0('0x35')]({'plain':!![]});_0x38be7d[_0xd6a0('0xb9')][_0xd6a0('0xbb')]=_0x4eef7f;if(_0x38be7d['interaction'][_0xd6a0('0xbb')]){if(_0x38be7d[_0xd6a0('0xa2')][_0xd6a0('0xbc')]){_0x38be7d[_0xd6a0('0xa3')][_0xd6a0('0xbd')]({'id':0x0,'priority':_0x38be7d[_0xd6a0('0xa3')][_0xd6a0('0x48')]+0x1,'app':_0xd6a0('0xbe'),'appdata':_0xd6a0('0xbf'),'interval':_0xd6a0('0xc0')});}}return db[_0xd6a0('0xc1')][_0xd6a0('0x5a')]({'body':_0x47915d['body'][_0xd6a0('0x64')],'ChatWebsiteId':_0x47915d[_0xd6a0('0x58')]['id'],'ChatInteractionId':_0x53c252['id'],'direction':'in','ContactId':_0x38be7d['contact']['id'],'AttachmentId':_0x47915d['body'][_0xd6a0('0xc2')]});})[_0xd6a0('0x22')](function(_0x15f191){_0x38be7d[_0xd6a0('0x29')]=_0x15f191;if(_0x38be7d[_0xd6a0('0xb9')][_0xd6a0('0xc3')]){return db[_0xd6a0('0xc4')][_0xd6a0('0x65')]({'attributes':['id',_0xd6a0('0x39')],'where':{'id':_0x38be7d['interaction'][_0xd6a0('0xc3')]}})[_0xd6a0('0x22')](function(_0x46c853){if(_0x46c853){_0x38be7d[_0xd6a0('0xa3')][_0xd6a0('0xc5')]({'id':0x0,'priority':0x0,'app':_0xd6a0('0xc6'),'appdata':_0x46c853[_0xd6a0('0x39')]+','+(_0x38be7d[_0xd6a0('0xa2')][_0xd6a0('0xc7')]||0xa),'interval':'*,*,*,*'});_0x38be7d[_0xd6a0('0xc8')]=!![];}return respondWithRpcPromise(_0xd6a0('0xc9'),_0xd6a0('0xca'),_0x38be7d);});}return respondWithRpcPromise(_0xd6a0('0xc9'),_0xd6a0('0xca'),_0x38be7d);})['then'](function(_0x95b8b0){respondWithRpcPromise(_0xd6a0('0xcb'),_0xd6a0('0xcb'),{'event':_0xd6a0('0x8a'),'message':_0x95b8b0},client9002);return _0x95b8b0;})['then'](respondWithResult(_0xfd36b8,null))[_0xd6a0('0x2c')](handleError(_0xfd36b8,null));};exports[_0xd6a0('0xcc')]=function(_0x2bcccf,_0xabf72c,_0x174e76){var _0x407ed2,_0x44d7f9,_0x23fe4a;var _0x1e3c32=[];var _0x5aabb6=[];var _0x595c03={};return db['CmContact'][_0xd6a0('0x66')]()['then'](function(_0x3978d9){if(!_0x3978d9){throw new db[(_0xd6a0('0x1e'))][(_0xd6a0('0x1f'))]('no\x20available\x20attributes');}_0x5aabb6=_[_0xd6a0('0x95')](_['keys'](_0x3978d9),['createdAt',_0xd6a0('0x94')]);_0x1e3c32=_['difference'](_[_0xd6a0('0x44')](_0x3978d9),[_0xd6a0('0x93'),_0xd6a0('0x94'),_0xd6a0('0x96'),_0xd6a0('0x97')]);if(_0x2bcccf[_0xd6a0('0x64')]['id']){delete _0x2bcccf['body']['id'];}if(_[_0xd6a0('0x7e')](_0x2bcccf[_0xd6a0('0x64')][_0xd6a0('0x98')])){throw _0xabf72c[_0xd6a0('0x2e')](0x1f4)[_0xd6a0('0x3a')](new db[(_0xd6a0('0x1e'))]['ValidationError'](_0xd6a0('0x99')));}if(_[_0xd6a0('0x7e')](_0x2bcccf[_0xd6a0('0x64')]['body'])||_0x2bcccf[_0xd6a0('0x64')][_0xd6a0('0x64')]===''){throw _0xabf72c[_0xd6a0('0x2e')](0x1f4)[_0xd6a0('0x3a')](new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x2bcccf[_0xd6a0('0x64')][_0xd6a0('0xcd')])){throw _0xabf72c[_0xd6a0('0x2e')](0x1f4)[_0xd6a0('0x3a')](new db['Sequelize'][(_0xd6a0('0x1f'))](_0xd6a0('0xce')+_0x1e3c32));}if(!_[_0xd6a0('0x9d')](_0x1e3c32,_0x2bcccf['body'][_0xd6a0('0xcd')])){throw _0xabf72c[_0xd6a0('0x2e')](0x1f4)[_0xd6a0('0x3a')](new db[(_0xd6a0('0x1e'))]['ValidationError'](_0xd6a0('0xcf')+_0x1e3c32));}_0x595c03[_0x2bcccf[_0xd6a0('0x64')][_0xd6a0('0xcd')]]=_0x2bcccf[_0xd6a0('0x64')]['from'];})['then'](function(){return db[_0xd6a0('0x3e')][_0xd6a0('0x65')]({'where':{'id':_0x2bcccf[_0xd6a0('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0xd6a0('0xa0')}]});})[_0xd6a0('0x22')](handleEntityNotFound(_0xabf72c,null))['then'](function(_0x24f0f2){if(_0x24f0f2&&_0x24f0f2[_0xd6a0('0xa0')]){_0x44d7f9=_0x24f0f2;var _0x1d25bc=_[_0xd6a0('0x16')](_0x2bcccf[_0xd6a0('0x64')],{'firstName':_0x2bcccf[_0xd6a0('0x64')][_0xd6a0('0x98')],'phone':_0x2bcccf['body'][_0xd6a0('0x98')],'ListId':_0x24f0f2[_0xd6a0('0x97')]});_0x1d25bc[_0x2bcccf[_0xd6a0('0x64')][_0xd6a0('0xcd')]]=_0x2bcccf[_0xd6a0('0x64')][_0xd6a0('0x98')];return db['CmContact']['findOrCreate']({'where':_0x595c03,'defaults':_0x1d25bc});}})[_0xd6a0('0xd0')](function(_0x5d2317){if(_0x5d2317){_0x23fe4a=_0x5d2317;var _0x3c6296=fs[_0xd6a0('0xd1')](path['join'](config[_0xd6a0('0x80')],'server/files/templates/chatOfflineMessage.ejs'),_0xd6a0('0xd2'));var _0x372366=ejs['render'](_0x3c6296,{'body':_[_0xd6a0('0xd3')](_0x2bcccf[_0xd6a0('0x64')]['body']),'bodyTitle':_0x44d7f9[_0xd6a0('0xd4')]});return db['ChatOfflineMessage'][_0xd6a0('0x5a')]({'body':_0x372366,'ContactId':_0x5d2317['id'],'ChatWebsiteId':_0x44d7f9['id']});}})[_0xd6a0('0x22')](function(_0x504b66){if(_0x504b66){_0x407ed2=_0x504b66;return db[_0xd6a0('0xd5')][_0xd6a0('0x69')]({'where':{'service':!![]},'include':[{'model':db[_0xd6a0('0xd6')],'as':_0xd6a0('0xd7'),'raw':!![]}]});}})['then'](function(_0x30c07c){if(_0x30c07c&&_0x30c07c[_0xd6a0('0xd7')]&&_0x44d7f9['forwardOfflineAddress']){var _0xbad456={'tls':{'rejectUnauthorized':![]}};if(_0x30c07c[_0xd6a0('0xd7')][_0xd6a0('0xd8')]){_0xbad456[_0xd6a0('0xd8')]=_0x30c07c[_0xd6a0('0xd7')][_0xd6a0('0xd8')];}else{_0xbad456[_0xd6a0('0xd9')]=_0x30c07c[_0xd6a0('0xd7')][_0xd6a0('0xd9')];_0xbad456[_0xd6a0('0xda')]=_0x30c07c['Smtp'][_0xd6a0('0xda')];_0xbad456[_0xd6a0('0xdb')]=_0x30c07c[_0xd6a0('0xd7')][_0xd6a0('0xdb')];}if(_0x30c07c[_0xd6a0('0xd7')]['authentication']){_0xbad456[_0xd6a0('0xdc')]={'user':_0x30c07c[_0xd6a0('0xd7')][_0xd6a0('0x5b')],'pass':_0x30c07c[_0xd6a0('0xd7')][_0xd6a0('0xdd')]};}return respondWithRpcPromise(_0xd6a0('0xde'),_0xd6a0('0xdf'),{'account':_0xbad456,'message':{'from':util['format'](_0xd6a0('0xe0'),_0x30c07c[_0xd6a0('0x39')],_0x30c07c[_0xd6a0('0xe1')]||_0x30c07c[_0xd6a0('0xd7')][_0xd6a0('0x5b')]),'to':_0x44d7f9['forwardOfflineAddress'],'subject':_0x44d7f9[_0xd6a0('0xe2')],'text':_0x407ed2[_0xd6a0('0x64')]}},client9003)[_0xd6a0('0x22')](function(){return _0x407ed2;})[_0xd6a0('0x2c')](function(_0x358553){console[_0xd6a0('0x28')](_0x358553);});}})[_0xd6a0('0x22')](function(){if(_0x407ed2){return _0x407ed2;}})[_0xd6a0('0x22')](respondWithResult(_0xabf72c,null))[_0xd6a0('0x2c')](handleError(_0xabf72c,null));};exports[_0xd6a0('0xe3')]=function(_0x2dd47c,_0x29bc53,_0x171678){return db[_0xd6a0('0xb6')][_0xd6a0('0x65')]({'where':{'id':_0x2dd47c[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0x29bc53,null))[_0xd6a0('0x22')](function(_0x4fbbf9){if(_0x4fbbf9){return _0x4fbbf9[_0xd6a0('0xe3')](_0x2dd47c[_0xd6a0('0x64')]['ids'],_['omit'](_0x2dd47c['body'],['ids','id'])||{});}})[_0xd6a0('0x22')](respondWithResult(_0x29bc53,null))[_0xd6a0('0x2c')](handleError(_0x29bc53,null));};exports['getInteractions']=function(_0x5c4aea,_0x4f4705,_0x336564){var _0x33e75f={'raw':![],'where':{}};var _0x5e68ed={};var _0x52d00a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd6a0('0x69')]({'where':{'id':_0x5c4aea[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0x4f4705,null))[_0xd6a0('0x22')](function(_0x90830c){if(_0x90830c){_0x5e68ed[_0xd6a0('0x42')]=_[_0xd6a0('0x44')](db['ChatInteraction'][_0xd6a0('0x3f')]);_0x5e68ed[_0xd6a0('0x43')]=_[_0xd6a0('0x44')](_0x5c4aea[_0xd6a0('0x43')]);_0x5e68ed[_0xd6a0('0x4e')]=_['intersection'](_0x5e68ed[_0xd6a0('0x42')],_0x5e68ed[_0xd6a0('0x43')]);_0x33e75f['attributes']=_[_0xd6a0('0x45')](_0x5e68ed[_0xd6a0('0x42')],qs[_0xd6a0('0x47')](_0x5c4aea[_0xd6a0('0x43')]['fields']));_0x33e75f[_0xd6a0('0x46')]=_0x33e75f[_0xd6a0('0x46')][_0xd6a0('0x48')]?_0x33e75f[_0xd6a0('0x46')]:_0x5e68ed[_0xd6a0('0x42')];if(!_0x5c4aea[_0xd6a0('0x43')][_0xd6a0('0x49')]('nolimit')){_0x33e75f[_0xd6a0('0x4a')]=qs['limit'](_0x5c4aea['query']['limit']);_0x33e75f[_0xd6a0('0x31')]=qs[_0xd6a0('0x31')](_0x5c4aea[_0xd6a0('0x43')]['offset']);}_0x33e75f['order']=qs[_0xd6a0('0x4c')](_0x5c4aea[_0xd6a0('0x43')][_0xd6a0('0x4c')]);_0x33e75f['where']=qs['filters'](_[_0xd6a0('0x4f')](_0x5c4aea[_0xd6a0('0x43')],_0x5e68ed['filters']));_0x33e75f[_0xd6a0('0x4d')][_0xd6a0('0x67')]=_0x90830c['id'];if(_0x5c4aea[_0xd6a0('0x43')][_0xd6a0('0x53')]){_0x33e75f[_0xd6a0('0x4d')]=_[_0xd6a0('0x50')](_0x33e75f['where'],{'$or':_[_0xd6a0('0x3d')](_0x33e75f[_0xd6a0('0x46')],function(_0x316d10){var _0x2d6fb5={};_0x2d6fb5[_0x316d10]={'$like':'%'+_0x5c4aea['query'][_0xd6a0('0x53')]+'%'};return _0x2d6fb5;})});}_0x33e75f=_[_0xd6a0('0x50')]({},_0x33e75f,_0x5c4aea['options']);return db[_0xd6a0('0xb6')][_0xd6a0('0x54')]({'where':_0x33e75f[_0xd6a0('0x4d')]})[_0xd6a0('0x22')](function(_0x3c3a1d){_0x52d00a['count']=_0x3c3a1d;if(_0x5c4aea[_0xd6a0('0x43')][_0xd6a0('0x55')]){_0x33e75f['include']=[{'model':db[_0xd6a0('0x91')],'as':'Contact','required':![]},{'model':db[_0xd6a0('0xc4')],'as':_0xd6a0('0xe4'),'attributes':[_0xd6a0('0x39'),_0xd6a0('0xe5'),_0xd6a0('0xe6')],'required':![]},{'model':db[_0xd6a0('0xe7')],'as':_0xd6a0('0xe8'),'attributes':['id',_0xd6a0('0x39'),_0xd6a0('0xe9')],'where':_0x5c4aea[_0xd6a0('0x43')][_0xd6a0('0xea')]?{'id':_0x5c4aea[_0xd6a0('0x43')][_0xd6a0('0xea')]}:undefined,'required':_0x5c4aea[_0xd6a0('0x43')][_0xd6a0('0xea')]?!![]:![]}];}return db[_0xd6a0('0xb6')][_0xd6a0('0x57')](_0x33e75f);})[_0xd6a0('0x22')](function(_0x1a59e5){_0x52d00a[_0xd6a0('0x6c')]=_0x1a59e5;return _0x52d00a;});}})[_0xd6a0('0x22')](respondWithFilteredResult(_0x4f4705,_0x33e75f))[_0xd6a0('0x2c')](handleError(_0x4f4705,null));};function iftimePromise(_0x49e58e,_0x352265){return respondWithRpcPromise(_0xd6a0('0xeb'),_0xd6a0('0xec'),{'command':_0x352265[_0xd6a0('0xed')]?util[_0xd6a0('0xaf')]('iftime\x20%s,%s',_0x49e58e[_0xd6a0('0xee')],_0x352265['timezone']):util[_0xd6a0('0xaf')](_0xd6a0('0xef'),_0x49e58e[_0xd6a0('0xee')])},client9002)[_0xd6a0('0x22')](function(_0x128ee6){var _0x4920d4=_0x128ee6&&_0x128ee6[_0xd6a0('0xf0')](_0xd6a0('0xf1'))>=0x0?!![]:![];logger[_0xd6a0('0x23')](_0xd6a0('0xf2'),_0x352265['id'],_0x49e58e['id'],_0x49e58e['interval'],_0x4920d4?_0xd6a0('0xf3'):_0xd6a0('0xf4'),_0x352265[_0xd6a0('0xed')]?_0x352265[_0xd6a0('0xed')]:_0xd6a0('0xf5'));return _0x4920d4;})[_0xd6a0('0x2c')](function(_0x37855f){logger[_0xd6a0('0x28')](_0xd6a0('0xf2'),_0x352265['id'],_0x49e58e['id'],_0x49e58e[_0xd6a0('0xee')],util['inspect'](_0x37855f,{'showHidden':![],'depth':null}),_0x352265[_0xd6a0('0xed')]?_0x352265[_0xd6a0('0xed')]:_0xd6a0('0xf5'));return![];});}exports[_0xd6a0('0xec')]=function(_0x2c5107,_0x5bc7d7,_0x2dfdea){var _0x327a74=0x0;var _0x19f0b6=0x0;var _0x5510f6=![];var _0x2b3475;var _0x19cd20;return db['ChatWebsite'][_0xd6a0('0x65')]({'where':{'id':_0x2c5107[_0xd6a0('0x58')]['id']},'include':[{'model':db[_0xd6a0('0xf6')],'as':'Interval','include':[{'model':db[_0xd6a0('0xf6')],'as':_0xd6a0('0xf7'),'attributes':['id',_0xd6a0('0xee')],'raw':!![]}]}]})[_0xd6a0('0x22')](handleEntityNotFound(_0x5bc7d7,null))[_0xd6a0('0x22')](function(_0x188e29){if(_0x188e29){_0x2b3475=_0x188e29;return _0x188e29[_0xd6a0('0xf8')]({'raw':!![]});}})[_0xd6a0('0x22')](function(_0x3d8758){if(_0x2b3475){if(_0x3d8758){_0x19cd20=_0x3d8758;}}return require('../../config/license/util')[_0xd6a0('0x7d')]();})[_0xd6a0('0x22')](function(_0x525dc4){if(_0x525dc4){_0x19f0b6=_0x525dc4[_0xd6a0('0xf9')];_0x5510f6=_0x525dc4[_0xd6a0('0xfa')];}})[_0xd6a0('0x22')](function(){return db[_0xd6a0('0xb6')][_0xd6a0('0x54')]({'where':{'closed':![]}});})['then'](function(_0x168e9f){_0x327a74=_0x168e9f;if(_0x19f0b6&&_0x168e9f>_0x19f0b6){return db['License'][_0xd6a0('0x69')]({'where':{'id':0x1}})[_0xd6a0('0x22')](function(_0x15c533){if(_0x15c533){_0x15c533[_0xd6a0('0xfb')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x2b3475[_0xd6a0('0xf6')]&&_0x2b3475['Interval'][_0xd6a0('0xf7')]){var _0x1c3c46=[];for(var _0x2ba652=0x0;_0x2ba652<_0x2b3475[_0xd6a0('0xf6')][_0xd6a0('0xf7')][_0xd6a0('0x48')];_0x2ba652++){var _0x59420c=_0x2b3475[_0xd6a0('0xf6')][_0xd6a0('0xf7')][_0x2ba652][_0xd6a0('0x35')]({'plain':!![]});_0x1c3c46[_0xd6a0('0xbd')](iftimePromise(_0x59420c,_0x2b3475));}return BPromise[_0xd6a0('0xfc')](_0x1c3c46)[_0xd6a0('0x22')](function(_0x8ce152){return _[_0xd6a0('0xfd')](_0x8ce152);});}else{return!![];}})[_0xd6a0('0x22')](function(_0x4e8863){var _0x20a278=fs['readFileSync'](path[_0xd6a0('0x7b')](config['root'],_0xd6a0('0xfe')),_0xd6a0('0xd2'));var _0x418487={'remote':_0x2b3475[_0xd6a0('0xff')],'query':querystring['stringify'](_['merge'](_0x2b3475[_0xd6a0('0x35')]({'plain':!![]}),{'customerIp':_0x2c5107['headers'][_0xd6a0('0x100')]||_0x2c5107[_0xd6a0('0x8d')][_0xd6a0('0x101')]||_0x2c5107[_0xd6a0('0x102')]['remoteAddress']||_0x2c5107['ip'],'referer':_0x2c5107[_0xd6a0('0x8d')][_0xd6a0('0x103')],'openedInteractions':_0x327a74,'maxInteractions':_0x19f0b6,'virtual':_0x5510f6[_0xd6a0('0xf9')],'online':_0x4e8863,'custom':_0x5510f6}))[_0xd6a0('0x104')](/'/g,'\x5c\x27')};_0x5bc7d7['send'](ejs[_0xd6a0('0x105')](Mustache[_0xd6a0('0x105')](_0x20a278,_0x418487),{'proactiveActions':_0x19cd20,'alignment':_0x2b3475[_0xd6a0('0x106')],'verticalAlignment':_0x2b3475['verticalAlignment'],'div_color':_0x2b3475[_0xd6a0('0xe9')],'text_color':_0x2b3475['textColor']}));})[_0xd6a0('0x2c')](handleError(_0x5bc7d7,null));};exports[_0xd6a0('0x107')]=function(_0x49b582,_0x360e25,_0x8344fb){return db[_0xd6a0('0x3e')][_0xd6a0('0x69')]({'where':{'id':_0x49b582['params']['id']}})['then'](handleEntityNotFound(_0x360e25,null))[_0xd6a0('0x22')](function(_0x43bd0b){if(_0x43bd0b){return db['sequelize'][_0xd6a0('0x108')](function(_0x5804db){return db[_0xd6a0('0x109')]['destroy']({'where':{'ChatWebsiteId':_0x49b582['params']['id']},'transaction':_0x5804db})[_0xd6a0('0x22')](function(_0x3103da){var _0x1f428b=_[_0xd6a0('0x3d')](_0x49b582[_0xd6a0('0x64')],function(_0x46b923){_0x46b923[_0xd6a0('0x67')]=_0x49b582[_0xd6a0('0x58')]['id'];return _0x46b923;});return db[_0xd6a0('0x109')][_0xd6a0('0x10a')](_0x1f428b,{'transaction':_0x5804db});});})[_0xd6a0('0x22')](function(){return db['ChatApplication'][_0xd6a0('0x10b')]({'where':{'ChatWebsiteId':_0x49b582['params']['id']},'order':_0xd6a0('0x10c')});});}})[_0xd6a0('0x22')](respondWithResult(_0x360e25,null))[_0xd6a0('0x2c')](handleError(_0x360e25,null));};exports[_0xd6a0('0x10d')]=function(_0xe69982,_0xb53518,_0x4beb24){var _0x398570={};var _0x420f52={};var _0x5d34c1;var _0x3545ba;return db[_0xd6a0('0x3e')][_0xd6a0('0x69')]({'where':{'id':_0xe69982[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0xb53518,null))[_0xd6a0('0x22')](function(_0xe2ee9a){if(_0xe2ee9a){_0x5d34c1=_0xe2ee9a;_0x420f52[_0xd6a0('0x42')]=_[_0xd6a0('0x44')](db[_0xd6a0('0x109')][_0xd6a0('0x3f')]);_0x420f52[_0xd6a0('0x43')]=_[_0xd6a0('0x44')](_0xe69982['query']);_0x420f52[_0xd6a0('0x4e')]=_[_0xd6a0('0x45')](_0x420f52[_0xd6a0('0x42')],_0x420f52[_0xd6a0('0x43')]);_0x398570['attributes']=_[_0xd6a0('0x45')](_0x420f52[_0xd6a0('0x42')],qs['fields'](_0xe69982[_0xd6a0('0x43')]['fields']));_0x398570[_0xd6a0('0x46')]=_0x398570[_0xd6a0('0x46')]['length']?_0x398570[_0xd6a0('0x46')]:_0x420f52[_0xd6a0('0x42')];_0x398570[_0xd6a0('0x4b')]=qs['sort'](_0xe69982[_0xd6a0('0x43')][_0xd6a0('0x4c')]);_0x398570[_0xd6a0('0x4d')]=qs[_0xd6a0('0x4e')](_[_0xd6a0('0x4f')](_0xe69982[_0xd6a0('0x43')],_0x420f52[_0xd6a0('0x4e')]));if(_0xe69982[_0xd6a0('0x43')]['filter']){_0x398570['where']=_[_0xd6a0('0x50')](_0x398570['where'],{'$or':_[_0xd6a0('0x3d')](_0x398570[_0xd6a0('0x46')],function(_0x43df10){var _0x1c0a16={};_0x1c0a16[_0x43df10]={'$like':'%'+_0xe69982[_0xd6a0('0x43')][_0xd6a0('0x53')]+'%'};return _0x1c0a16;})});}_0x398570=_[_0xd6a0('0x50')]({},_0x398570,_0xe69982[_0xd6a0('0x6b')]);return _0x5d34c1[_0xd6a0('0x10d')](_0x398570);}})['then'](function(_0xca5e01){if(_0xca5e01){_0x3545ba=_0xca5e01[_0xd6a0('0x48')];if(!_0xe69982['query']['hasOwnProperty'](_0xd6a0('0x6a'))){_0x398570['limit']=qs['limit'](_0xe69982['query'][_0xd6a0('0x4a')]);_0x398570[_0xd6a0('0x31')]=qs[_0xd6a0('0x31')](_0xe69982[_0xd6a0('0x43')]['offset']);}return _0x5d34c1[_0xd6a0('0x10d')](_0x398570);}})['then'](function(_0x1d369b){if(_0x1d369b){return _0x1d369b?{'count':_0x3545ba,'rows':_0x1d369b}:null;}})['then'](respondWithResult(_0xb53518,null))['catch'](handleError(_0xb53518,null));};exports['addProactiveActions']=function(_0x58bf32,_0x24c4ba,_0x29973e){return db[_0xd6a0('0x10e')][_0xd6a0('0x65')]({'where':{'id':_0x58bf32[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0x24c4ba,null))[_0xd6a0('0x22')](function(_0x3ed57d){if(_0x3ed57d){return _0x3ed57d[_0xd6a0('0x10f')](_0x58bf32[_0xd6a0('0x64')][_0xd6a0('0x110')],_[_0xd6a0('0x111')](_0x58bf32[_0xd6a0('0x64')],[_0xd6a0('0x110'),'id'])||{});}})[_0xd6a0('0x22')](respondWithResult(_0x24c4ba,null))[_0xd6a0('0x2c')](handleError(_0x24c4ba,null));};exports[_0xd6a0('0xf8')]=function(_0x5c9619,_0x1f4417,_0x22b15b){var _0x3f7639={};var _0x4ad026={};var _0x497234;var _0x49083d;return db[_0xd6a0('0x3e')][_0xd6a0('0x69')]({'where':{'id':_0x5c9619[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0x1f4417,null))['then'](function(_0x5d8b75){if(_0x5d8b75){_0x497234=_0x5d8b75;_0x4ad026[_0xd6a0('0x42')]=_[_0xd6a0('0x44')](db['ChatProactiveAction'][_0xd6a0('0x3f')]);_0x4ad026[_0xd6a0('0x43')]=_['keys'](_0x5c9619['query']);_0x4ad026[_0xd6a0('0x4e')]=_['intersection'](_0x4ad026[_0xd6a0('0x42')],_0x4ad026[_0xd6a0('0x43')]);_0x3f7639['attributes']=_[_0xd6a0('0x45')](_0x4ad026['model'],qs[_0xd6a0('0x47')](_0x5c9619['query'][_0xd6a0('0x47')]));_0x3f7639[_0xd6a0('0x46')]=_0x3f7639[_0xd6a0('0x46')][_0xd6a0('0x48')]?_0x3f7639[_0xd6a0('0x46')]:_0x4ad026[_0xd6a0('0x42')];_0x3f7639[_0xd6a0('0x4b')]=qs[_0xd6a0('0x4c')](_0x5c9619[_0xd6a0('0x43')][_0xd6a0('0x4c')]);_0x3f7639[_0xd6a0('0x4d')]=qs[_0xd6a0('0x4e')](_[_0xd6a0('0x4f')](_0x5c9619[_0xd6a0('0x43')],_0x4ad026['filters']));if(_0x5c9619['query'][_0xd6a0('0x53')]){_0x3f7639['where']=_[_0xd6a0('0x50')](_0x3f7639[_0xd6a0('0x4d')],{'$or':_['map'](_0x3f7639[_0xd6a0('0x46')],function(_0x536ebf){var _0x2a74d={};_0x2a74d[_0x536ebf]={'$like':'%'+_0x5c9619['query']['filter']+'%'};return _0x2a74d;})});}_0x3f7639=_[_0xd6a0('0x50')]({},_0x3f7639,_0x5c9619[_0xd6a0('0x6b')]);return _0x497234['getProactiveActions'](_0x3f7639);}})['then'](function(_0x42bf7d){if(_0x42bf7d){_0x49083d=_0x42bf7d['length'];if(!_0x5c9619[_0xd6a0('0x43')]['hasOwnProperty']('nolimit')){_0x3f7639['limit']=qs['limit'](_0x5c9619[_0xd6a0('0x43')][_0xd6a0('0x4a')]);_0x3f7639[_0xd6a0('0x31')]=qs[_0xd6a0('0x31')](_0x5c9619[_0xd6a0('0x43')][_0xd6a0('0x31')]);}return _0x497234[_0xd6a0('0xf8')](_0x3f7639);}})[_0xd6a0('0x22')](function(_0x391f60){if(_0x391f60){return _0x391f60?{'count':_0x49083d,'rows':_0x391f60}:null;}})[_0xd6a0('0x22')](respondWithResult(_0x1f4417,null))[_0xd6a0('0x2c')](handleError(_0x1f4417,null));};exports[_0xd6a0('0x112')]=function(_0x521382,_0x98c80,_0x2f9a11){var _0x5634a9=_0x521382['query']['online']===_0xd6a0('0x113')?_0xd6a0('0x114'):_0xd6a0('0x115');return db[_0xd6a0('0x3e')][_0xd6a0('0x65')]({'attributes':['id',_0x5634a9],'where':{'id':_0x521382[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0x98c80,null))['then'](function(_0x281005){if(_0x281005){var _0x3b2d41=_0x281005[_0x5634a9];var _0x567b64=_0x3b2d41&&_0x3b2d41[_0xd6a0('0x116')]?_0x3b2d41[_0xd6a0('0x116')]:[];_0x98c80[_0xd6a0('0x3a')]({'fromKey':_[_0xd6a0('0x7e')](_0x3b2d41[_0xd6a0('0x117')])?undefined:_0x3b2d41['fromKey'],'count':_0x567b64['length'],'rows':_0x567b64});}})['catch'](handleError(_0x98c80,null));};exports[_0xd6a0('0x118')]=function(_0x5b03ba,_0x400dfe,_0x2ad24a){var _0x5e5f8c={'raw':![],'where':{}};var _0x92d052={};var _0x3b35c9={'count':0x0,'rows':[]};return db[_0xd6a0('0x3e')][_0xd6a0('0x69')]({'where':{'id':_0x5b03ba[_0xd6a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x400dfe,null))[_0xd6a0('0x22')](function(_0x4ad350){if(_0x4ad350){_0x92d052[_0xd6a0('0x42')]=_[_0xd6a0('0x44')](db['ChatOfflineMessage'][_0xd6a0('0x3f')]);_0x92d052[_0xd6a0('0x43')]=_[_0xd6a0('0x44')](_0x5b03ba[_0xd6a0('0x43')]);_0x92d052[_0xd6a0('0x4e')]=_[_0xd6a0('0x45')](_0x92d052['model'],_0x92d052[_0xd6a0('0x43')]);_0x5e5f8c[_0xd6a0('0x46')]=_[_0xd6a0('0x45')](_0x92d052['model'],qs[_0xd6a0('0x47')](_0x5b03ba['query']['fields']));_0x5e5f8c[_0xd6a0('0x46')]=_0x5e5f8c[_0xd6a0('0x46')][_0xd6a0('0x48')]?_0x5e5f8c[_0xd6a0('0x46')]:_0x92d052[_0xd6a0('0x42')];if(!_0x5b03ba['query'][_0xd6a0('0x49')](_0xd6a0('0x6a'))){_0x5e5f8c['limit']=qs[_0xd6a0('0x4a')](_0x5b03ba['query'][_0xd6a0('0x4a')]);_0x5e5f8c['offset']=qs[_0xd6a0('0x31')](_0x5b03ba[_0xd6a0('0x43')][_0xd6a0('0x31')]);}_0x5e5f8c['order']=qs[_0xd6a0('0x4c')](_0x5b03ba[_0xd6a0('0x43')][_0xd6a0('0x4c')]);_0x5e5f8c[_0xd6a0('0x4d')]=qs[_0xd6a0('0x4e')](_[_0xd6a0('0x4f')](_0x5b03ba[_0xd6a0('0x43')],_0x92d052[_0xd6a0('0x4e')]));_0x5e5f8c[_0xd6a0('0x4d')][_0xd6a0('0x67')]=_0x4ad350['id'];if(_0x5b03ba[_0xd6a0('0x43')][_0xd6a0('0x53')]){_0x5e5f8c[_0xd6a0('0x4d')]=_[_0xd6a0('0x50')](_0x5e5f8c[_0xd6a0('0x4d')],{'$or':_['map'](_0x5e5f8c[_0xd6a0('0x46')],function(_0x494e99){var _0x375fd6={};_0x375fd6[_0x494e99]={'$like':'%'+_0x5b03ba['query']['filter']+'%'};return _0x375fd6;})});}_0x5e5f8c=_['merge']({},_0x5e5f8c,_0x5b03ba[_0xd6a0('0x6b')]);return db[_0xd6a0('0x119')][_0xd6a0('0x54')]({'where':_0x5e5f8c[_0xd6a0('0x4d')]})[_0xd6a0('0x22')](function(_0x53238c){_0x3b35c9['count']=_0x53238c;if(_0x5b03ba[_0xd6a0('0x43')][_0xd6a0('0x55')]){_0x5e5f8c[_0xd6a0('0x56')]=[{'all':!![]}];}else{_0x5e5f8c[_0xd6a0('0x56')]=[{'model':db[_0xd6a0('0x91')],'as':_0xd6a0('0x11a'),'required':![]}];}return db['ChatOfflineMessage'][_0xd6a0('0x57')](_0x5e5f8c);})[_0xd6a0('0x22')](function(_0x79db91){_0x3b35c9[_0xd6a0('0x6c')]=_0x79db91;return _0x3b35c9;});}})[_0xd6a0('0x22')](respondWithFilteredResult(_0x400dfe,_0x5e5f8c))[_0xd6a0('0x2c')](handleError(_0x400dfe,null));};exports[_0xd6a0('0x11b')]=function(_0x4162f6,_0x5aa9e2,_0x5b04b1){return db['ChatWebsite']['find']({'where':{'id':_0x4162f6[_0xd6a0('0x58')]['id']}})['then'](handleEntityNotFound(_0x5aa9e2,null))['then'](function(_0x4b5858){if(_0x4b5858){return _0x4b5858['addAgents'](_0x4162f6[_0xd6a0('0x64')][_0xd6a0('0x110')],_[_0xd6a0('0x111')](_0x4162f6[_0xd6a0('0x64')],[_0xd6a0('0x110'),'id'])||{})['spread'](function(_0x3f5759){for(var _0x55135c=0x0;_0x55135c<_0x4162f6[_0xd6a0('0x64')][_0xd6a0('0x110')][_0xd6a0('0x48')];_0x55135c+=0x1){socket[_0xd6a0('0x11c')]('userChatWebsite:save',{'UserId':_0x4162f6[_0xd6a0('0x64')][_0xd6a0('0x110')][_0x55135c],'ChatWebsiteId':_0x4162f6[_0xd6a0('0x58')]['id']});}return _0x3f5759;});}})['then'](respondWithResult(_0x5aa9e2,null))[_0xd6a0('0x2c')](handleError(_0x5aa9e2,null));};exports[_0xd6a0('0x11d')]=function(_0x3ee3b5,_0x7209f6,_0x14ad83){return db[_0xd6a0('0x3e')][_0xd6a0('0x65')]({'where':{'id':_0x3ee3b5['params']['id']}})['then'](handleEntityNotFound(_0x7209f6,null))[_0xd6a0('0x22')](function(_0x1f02a1){if(_0x1f02a1){return _0x1f02a1[_0xd6a0('0x11d')](_0x3ee3b5[_0xd6a0('0x43')][_0xd6a0('0x110')])[_0xd6a0('0x22')](function(){if(_[_0xd6a0('0x11e')](_0x3ee3b5['query'][_0xd6a0('0x110')])){for(var _0x4c05b5=0x0;_0x4c05b5<_0x3ee3b5[_0xd6a0('0x43')]['ids'][_0xd6a0('0x48')];_0x4c05b5+=0x1){socket[_0xd6a0('0x11c')](_0xd6a0('0x11f'),{'UserId':Number(_0x3ee3b5['query'][_0xd6a0('0x110')][_0x4c05b5]),'ChatWebsiteId':Number(_0x3ee3b5[_0xd6a0('0x58')]['id'])});}}else{socket[_0xd6a0('0x11c')](_0xd6a0('0x11f'),{'UserId':Number(_0x3ee3b5[_0xd6a0('0x43')][_0xd6a0('0x110')]),'ChatWebsiteId':Number(_0x3ee3b5[_0xd6a0('0x58')]['id'])});}});}})[_0xd6a0('0x22')](respondWithStatusCode(_0x7209f6,null))[_0xd6a0('0x2c')](handleError(_0x7209f6,null));};exports[_0xd6a0('0x120')]=function(_0x33a7cb,_0x59e73a,_0x4b73a0){var _0x18d0ea={};var _0x5452e6={};var _0x5d5eee;var _0x581120;return db[_0xd6a0('0x3e')][_0xd6a0('0x69')]({'where':{'id':_0x33a7cb[_0xd6a0('0x58')]['id']}})[_0xd6a0('0x22')](handleEntityNotFound(_0x59e73a,null))[_0xd6a0('0x22')](function(_0x5aa99f){if(_0x5aa99f){_0x5d5eee=_0x5aa99f;_0x5452e6['model']=_[_0xd6a0('0x44')](db[_0xd6a0('0xc4')][_0xd6a0('0x3f')]);_0x5452e6[_0xd6a0('0x43')]=_[_0xd6a0('0x44')](_0x33a7cb[_0xd6a0('0x43')]);_0x5452e6[_0xd6a0('0x4e')]=_[_0xd6a0('0x45')](_0x5452e6[_0xd6a0('0x42')],_0x5452e6[_0xd6a0('0x43')]);_0x18d0ea[_0xd6a0('0x46')]=_[_0xd6a0('0x45')](_0x5452e6[_0xd6a0('0x42')],qs[_0xd6a0('0x47')](_0x33a7cb[_0xd6a0('0x43')][_0xd6a0('0x47')]));_0x18d0ea[_0xd6a0('0x46')]=_0x18d0ea[_0xd6a0('0x46')]['length']?_0x18d0ea[_0xd6a0('0x46')]:_0x5452e6[_0xd6a0('0x42')];_0x18d0ea[_0xd6a0('0x4b')]=qs[_0xd6a0('0x4c')](_0x33a7cb[_0xd6a0('0x43')][_0xd6a0('0x4c')]);_0x18d0ea[_0xd6a0('0x4d')]=qs[_0xd6a0('0x4e')](_[_0xd6a0('0x4f')](_0x33a7cb['query'],_0x5452e6[_0xd6a0('0x4e')]));if(_0x33a7cb[_0xd6a0('0x43')][_0xd6a0('0x53')]){_0x18d0ea[_0xd6a0('0x4d')]=_[_0xd6a0('0x50')](_0x18d0ea[_0xd6a0('0x4d')],{'$or':_[_0xd6a0('0x3d')](_0x18d0ea[_0xd6a0('0x46')],function(_0x15fcd6){var _0x42378f={};_0x42378f[_0x15fcd6]={'$like':'%'+_0x33a7cb[_0xd6a0('0x43')]['filter']+'%'};return _0x42378f;})});}_0x18d0ea=_[_0xd6a0('0x50')]({},_0x18d0ea,_0x33a7cb[_0xd6a0('0x6b')]);return _0x5d5eee[_0xd6a0('0x120')](_0x18d0ea);}})[_0xd6a0('0x22')](function(_0x1a1867){if(_0x1a1867){_0x581120=_0x1a1867[_0xd6a0('0x48')];if(!_0x33a7cb[_0xd6a0('0x43')][_0xd6a0('0x49')](_0xd6a0('0x6a'))){_0x18d0ea[_0xd6a0('0x4a')]=qs[_0xd6a0('0x4a')](_0x33a7cb[_0xd6a0('0x43')]['limit']);_0x18d0ea[_0xd6a0('0x31')]=qs['offset'](_0x33a7cb[_0xd6a0('0x43')][_0xd6a0('0x31')]);}return _0x5d5eee['getAgents'](_0x18d0ea);}})[_0xd6a0('0x22')](function(_0x3f5ed0){if(_0x3f5ed0){return _0x3f5ed0?{'count':_0x581120,'rows':_0x3f5ed0}:null;}})[_0xd6a0('0x22')](respondWithResult(_0x59e73a,null))['catch'](handleError(_0x59e73a,null));}; \ No newline at end of file +var _0x8bc9=['update','destroy','get','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','map','options','includeAll','include','rows','catch','show','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatWebsites','UserProfileSection','find','userProfileId','params','describe','ChatWebsiteId','Disposition','hasOwnProperty','pick','findAll','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addLogo','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','custom','isNil','existsSync','download','getAvatar','server/files/images/avatars/default_avatar.png','showCustomerAvatar','server/files/images/avatars/','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','from','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','account','applications','Applications','list','orderBy','priority','defaults','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','x-real-port','browser','version','unknown','%s\x20%s','vendor','format','device','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','difference','CompanyId','ListId','send','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','offlineMessageBody','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','port','secure','authentication','auth','pass','SendMail','sendMail','email','offlineMessageSubject','addInteraction','omit','Contact','Owner','fullname','internal','Tags','color','tag','timezone','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','License','increment','chatLicenseExceeded','some','server/files/chat/iframe.js','remote','x-real-ip','connection','remoteAddress','referer','replace','verticalAlignment','addApplications','sequelize','transaction','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','getProactiveActions','getFields','online','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply'];(function(_0x596419,_0xe860c0){var _0x35bd1a=function(_0x26139b){while(--_0x26139b){_0x596419['push'](_0x596419['shift']());}};_0x35bd1a(++_0xe860c0);}(_0x8bc9,0xe4));var _0x98bc=function(_0x5c3516,_0x2d94f0){_0x5c3516=_0x5c3516-0x0;var _0xe525b1=_0x8bc9[_0x5c3516];return _0xe525b1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x98bc('0x0'));var rimraf=require(_0x98bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x98bc('0x2'));var rp=require(_0x98bc('0x3'));var moment=require(_0x98bc('0x4'));var BPromise=require(_0x98bc('0x5'));var Mustache=require(_0x98bc('0x6'));var util=require('util');var path=require(_0x98bc('0x7'));var sox=require(_0x98bc('0x8'));var csv=require(_0x98bc('0x9'));var ejs=require(_0x98bc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x98bc('0xb'));var crypto=require(_0x98bc('0xc'));var jsforce=require(_0x98bc('0xd'));var deskjs=require(_0x98bc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x98bc('0xf'));var Papa=require(_0x98bc('0x10'));var Redis=require(_0x98bc('0x11'));var authService=require(_0x98bc('0x12'));var qs=require(_0x98bc('0x13'));var as=require(_0x98bc('0x14'));var hardwareService=require(_0x98bc('0x15'));var logger=require(_0x98bc('0x16'))(_0x98bc('0x17'));var utils=require(_0x98bc('0x18'));var config=require('../../config/environment');var db=require(_0x98bc('0x19'))['db'];config[_0x98bc('0x1a')]=_['defaults'](config[_0x98bc('0x1a')],{'host':_0x98bc('0x1b'),'port':0x18eb});var socket=require(_0x98bc('0x1c'))(new Redis(config[_0x98bc('0x1a')]));require(_0x98bc('0x1d'))[_0x98bc('0x1e')](socket);var jayson=require(_0x98bc('0x1f'));var client=jayson[_0x98bc('0x20')][_0x98bc('0x21')]({'port':0x232c});var client9002=jayson[_0x98bc('0x20')]['http']({'port':0x232a});var client9003=jayson[_0x98bc('0x20')][_0x98bc('0x21')]({'port':0x232b});function checkPasswordPattern(_0x33c07e,_0x3020a7,_0x3823a0){if(_0x3823a0){var _0x1aed22=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1aed22[_0x98bc('0x22')](_0x3020a7)){return _0x33c07e;}else{throw new db['Sequelize'][(_0x98bc('0x23'))](_0x98bc('0x24'));}}else{return _0x33c07e;}}function respondWithRpcPromise(_0x53f37c,_0x2b739d,_0x450fd2,_0x23edf3){return new BPromise(function(_0xc94e65,_0x132825){var _0x1e859d=_0x23edf3||client;return _0x1e859d['request'](_0x53f37c,_0x450fd2)[_0x98bc('0x25')](function(_0x4b57e0){logger[_0x98bc('0x26')](_0x98bc('0x27'),_0x2b739d,_0x98bc('0x28'));logger[_0x98bc('0x29')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2b739d,_0x98bc('0x28'),JSON[_0x98bc('0x2a')](_0x4b57e0));if(_0x4b57e0[_0x98bc('0x2b')]){if(_0x4b57e0[_0x98bc('0x2b')]['code']===0x1f4){logger[_0x98bc('0x2b')](_0x98bc('0x27'),_0x2b739d,_0x4b57e0['error']['message']);return _0x132825(_0x4b57e0[_0x98bc('0x2b')][_0x98bc('0x2c')]);}logger[_0x98bc('0x2b')]('ChatWebsite,\x20%s,\x20%s',_0x2b739d,_0x4b57e0['error'][_0x98bc('0x2c')]);return _0xc94e65(_0x4b57e0['error']['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x2b739d,'request\x20sent');_0xc94e65(_0x4b57e0[_0x98bc('0x2d')]['message']);}})['catch'](function(_0x3b5f32){logger[_0x98bc('0x2b')](_0x98bc('0x27'),_0x2b739d,_0x3b5f32);_0x132825(_0x3b5f32);});});}function respondWithStatusCode(_0x18162d,_0xaa2a45){_0xaa2a45=_0xaa2a45||0xcc;return function(_0x1f928b){if(_0x1f928b){return _0x18162d[_0x98bc('0x2e')](_0xaa2a45);}return _0x18162d[_0x98bc('0x2f')](_0xaa2a45)[_0x98bc('0x30')]();};}function respondWithResult(_0x2e93b6,_0x1f1e37){_0x1f1e37=_0x1f1e37||0xc8;return function(_0x45abb5){if(_0x45abb5){return _0x2e93b6[_0x98bc('0x2f')](_0x1f1e37)[_0x98bc('0x31')](_0x45abb5);}};}function respondWithFilteredResult(_0x21fc0e,_0x189187){return function(_0x3f78bb){if(_0x3f78bb){var _0x1a3cd1=_0x3f78bb[_0x98bc('0x32')],_0x5daa06=_0x189187[_0x98bc('0x33')],_0x2418f2=_0x189187['offset']+_0x189187[_0x98bc('0x34')],_0x886464;if(_0x2418f2>=_0x1a3cd1){_0x2418f2=_0x1a3cd1;_0x886464=0xc8;}else{_0x886464=0xce;}_0x21fc0e[_0x98bc('0x2f')](_0x886464);return _0x21fc0e['set'](_0x98bc('0x35'),_0x5daa06+'-'+_0x2418f2+'/'+_0x1a3cd1)[_0x98bc('0x31')](_0x3f78bb);}return null;};}function patchUpdates(_0x58c4ea){return function(_0x350a8c){try{jsonpatch[_0x98bc('0x36')](_0x350a8c,_0x58c4ea,!![]);}catch(_0x36415a){return BPromise['reject'](_0x36415a);}return _0x350a8c['save']();};}function saveUpdates(_0x463244,_0x1c289b){return function(_0x4929c8){if(_0x4929c8){return _0x4929c8[_0x98bc('0x37')](_0x463244)['then'](function(_0x2ab3c3){return _0x2ab3c3;});}return null;};}function removeEntity(_0x371be1,_0xc4dafe){return function(_0x357449){if(_0x357449){return _0x357449[_0x98bc('0x38')]()['then'](function(){var _0x2bf467=_0x357449[_0x98bc('0x39')]({'plain':!![]});var _0x528cfa='ChatWebsites';return db[_0x98bc('0x3a')][_0x98bc('0x38')]({'where':{'type':_0x528cfa,'resourceId':_0x2bf467['id']}})['then'](function(){return _0x357449;});})[_0x98bc('0x25')](function(){_0x371be1[_0x98bc('0x2f')](0xcc)[_0x98bc('0x30')]();});}};}function handleEntityNotFound(_0x556054,_0x5edbce){return function(_0x2460be){if(!_0x2460be){_0x556054[_0x98bc('0x2e')](0x194);}return _0x2460be;};}function handleError(_0x214fa6,_0x5c7a75){_0x5c7a75=_0x5c7a75||0x1f4;return function(_0x860631){logger[_0x98bc('0x2b')](_0x860631[_0x98bc('0x3b')]);if(_0x860631['name']){delete _0x860631[_0x98bc('0x3c')];}_0x214fa6['status'](_0x5c7a75)['send'](_0x860631);};}exports['index']=function(_0x1c1e6e,_0x5d69fe){var _0x508645={'include':[{'model':db[_0x98bc('0x3d')],'as':_0x98bc('0x3e')}]},_0x5f958a={},_0x5e8d70={'count':0x0,'rows':[]};var _0x156cf8=_['map'](db[_0x98bc('0x3f')][_0x98bc('0x40')],function(_0x138c3a){return{'name':_0x138c3a[_0x98bc('0x41')],'type':_0x138c3a[_0x98bc('0x42')]['key']};});_0x5f958a[_0x98bc('0x43')]=_['map'](_0x156cf8,_0x98bc('0x3c'));_0x5f958a[_0x98bc('0x44')]=_['keys'](_0x1c1e6e[_0x98bc('0x44')]);_0x5f958a['filters']=_[_0x98bc('0x45')](_0x5f958a[_0x98bc('0x43')],_0x5f958a[_0x98bc('0x44')]);_0x508645[_0x98bc('0x46')]=_[_0x98bc('0x45')](_0x5f958a[_0x98bc('0x43')],qs[_0x98bc('0x47')](_0x1c1e6e[_0x98bc('0x44')][_0x98bc('0x47')]));_0x508645['attributes']=_0x508645[_0x98bc('0x46')][_0x98bc('0x48')]?_0x508645[_0x98bc('0x46')]:_0x5f958a[_0x98bc('0x43')];if(!_0x1c1e6e[_0x98bc('0x44')]['hasOwnProperty'](_0x98bc('0x49'))){_0x508645[_0x98bc('0x34')]=qs[_0x98bc('0x34')](_0x1c1e6e[_0x98bc('0x44')][_0x98bc('0x34')]);_0x508645[_0x98bc('0x33')]=qs[_0x98bc('0x33')](_0x1c1e6e[_0x98bc('0x44')][_0x98bc('0x33')]);}_0x508645[_0x98bc('0x4a')]=qs[_0x98bc('0x4b')](_0x1c1e6e['query'][_0x98bc('0x4b')]);_0x508645[_0x98bc('0x4c')]=qs['filters'](_['pick'](_0x1c1e6e[_0x98bc('0x44')],_0x5f958a[_0x98bc('0x4d')]),_0x156cf8);if(_0x1c1e6e[_0x98bc('0x44')][_0x98bc('0x4e')]){_0x508645[_0x98bc('0x4c')]=_[_0x98bc('0x4f')](_0x508645[_0x98bc('0x4c')],{'$or':_[_0x98bc('0x50')](_0x156cf8,function(_0x43eb76){if(_0x43eb76['type']!=='VIRTUAL'){var _0x1cf02a={};_0x1cf02a[_0x43eb76[_0x98bc('0x3c')]]={'$like':'%'+_0x1c1e6e['query'][_0x98bc('0x4e')]+'%'};return _0x1cf02a;}})});}_0x508645=_['merge']({},_0x508645,_0x1c1e6e[_0x98bc('0x51')]);var _0x4c33eb={'where':_0x508645[_0x98bc('0x4c')]};return db[_0x98bc('0x3f')]['count'](_0x4c33eb)[_0x98bc('0x25')](function(_0x54b716){_0x5e8d70['count']=_0x54b716;if(_0x1c1e6e[_0x98bc('0x44')][_0x98bc('0x52')]){_0x508645[_0x98bc('0x53')]=[{'all':!![]}];}return db['ChatWebsite']['findAll'](_0x508645);})['then'](function(_0x1074b5){_0x5e8d70[_0x98bc('0x54')]=_0x1074b5;return _0x5e8d70;})[_0x98bc('0x25')](respondWithFilteredResult(_0x5d69fe,_0x508645))[_0x98bc('0x55')](handleError(_0x5d69fe,null));};exports[_0x98bc('0x56')]=function(_0x433d48,_0x5e32ff){var _0x457bc7={'raw':![],'where':{'id':_0x433d48['params']['id']},'include':[{'model':db[_0x98bc('0x3d')],'as':_0x98bc('0x3e')}]},_0x24efef={};_0x24efef[_0x98bc('0x43')]=_[_0x98bc('0x57')](db[_0x98bc('0x3f')][_0x98bc('0x40')]);_0x24efef[_0x98bc('0x44')]=_[_0x98bc('0x57')](_0x433d48['query']);_0x24efef[_0x98bc('0x4d')]=_[_0x98bc('0x45')](_0x24efef[_0x98bc('0x43')],_0x24efef[_0x98bc('0x44')]);_0x457bc7[_0x98bc('0x46')]=_[_0x98bc('0x45')](_0x24efef[_0x98bc('0x43')],qs['fields'](_0x433d48[_0x98bc('0x44')][_0x98bc('0x47')]));_0x457bc7[_0x98bc('0x46')]=_0x457bc7[_0x98bc('0x46')]['length']?_0x457bc7[_0x98bc('0x46')]:_0x24efef[_0x98bc('0x43')];if(_0x433d48[_0x98bc('0x44')]['includeAll']){_0x457bc7[_0x98bc('0x53')]=[{'all':!![]}];}_0x457bc7=_[_0x98bc('0x4f')]({},_0x457bc7,_0x433d48[_0x98bc('0x51')]);return db[_0x98bc('0x3f')]['find'](_0x457bc7)['then'](handleEntityNotFound(_0x5e32ff,null))[_0x98bc('0x25')](respondWithResult(_0x5e32ff,null))['catch'](handleError(_0x5e32ff,null));};exports[_0x98bc('0x58')]=function(_0x10a2d2,_0x2951a9){return db['ChatWebsite'][_0x98bc('0x58')](_0x10a2d2[_0x98bc('0x59')],{})['then'](function(_0x2f590c){var _0x198b31=_0x10a2d2[_0x98bc('0x5a')][_0x98bc('0x39')]({'plain':!![]});if(!_0x198b31)throw new Error(_0x98bc('0x5b'));if(_0x198b31['role']===_0x98bc('0x5a')){var _0x5a11a5=_0x2f590c[_0x98bc('0x39')]({'plain':!![]});var _0x57d326=_0x98bc('0x5c');return db[_0x98bc('0x5d')][_0x98bc('0x5e')]({'where':{'name':_0x57d326,'userProfileId':_0x198b31[_0x98bc('0x5f')]},'raw':!![]})[_0x98bc('0x25')](function(_0xa14e4a){if(_0xa14e4a&&_0xa14e4a['autoAssociation']===0x0){return db[_0x98bc('0x3a')][_0x98bc('0x58')]({'name':_0x5a11a5['name'],'resourceId':_0x5a11a5['id'],'type':_0xa14e4a[_0x98bc('0x3c')],'sectionId':_0xa14e4a['id']},{})['then'](function(){return _0x2f590c;});}else{return _0x2f590c;}})[_0x98bc('0x55')](function(_0x4cde4f){logger[_0x98bc('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4cde4f);throw _0x4cde4f;});}return _0x2f590c;})['then'](respondWithResult(_0x2951a9,0xc9))[_0x98bc('0x55')](handleError(_0x2951a9,null));};exports[_0x98bc('0x37')]=function(_0x153fa4,_0x623af8){if(_0x153fa4[_0x98bc('0x59')]['id']){delete _0x153fa4[_0x98bc('0x59')]['id'];}return db[_0x98bc('0x3f')]['find']({'where':{'id':_0x153fa4[_0x98bc('0x60')]['id']},'include':[{'model':db[_0x98bc('0x3d')],'as':_0x98bc('0x3e')}]})[_0x98bc('0x25')](handleEntityNotFound(_0x623af8,null))[_0x98bc('0x25')](saveUpdates(_0x153fa4['body'],null))[_0x98bc('0x25')](respondWithResult(_0x623af8,null))[_0x98bc('0x55')](handleError(_0x623af8,null));};exports[_0x98bc('0x38')]=function(_0x21e0ac,_0x39deea){return db[_0x98bc('0x3f')]['find']({'where':{'id':_0x21e0ac['params']['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x39deea,null))[_0x98bc('0x25')](removeEntity(_0x39deea,null))['catch'](handleError(_0x39deea,null));};exports[_0x98bc('0x61')]=function(_0x4d5316,_0x1806d3){return db[_0x98bc('0x3f')][_0x98bc('0x61')]()[_0x98bc('0x25')](respondWithResult(_0x1806d3,null))[_0x98bc('0x55')](handleError(_0x1806d3,null));};exports['addDisposition']=function(_0x1923db,_0x3f96e2,_0x3e1573){if(_0x1923db[_0x98bc('0x59')]['id']){delete _0x1923db[_0x98bc('0x59')]['id'];}return db[_0x98bc('0x3f')][_0x98bc('0x5e')]({'where':{'id':_0x1923db[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x3f96e2,null))[_0x98bc('0x25')](function(_0x24e05b){if(_0x24e05b){_0x1923db[_0x98bc('0x59')][_0x98bc('0x62')]=_0x24e05b['id'];return db[_0x98bc('0x63')][_0x98bc('0x58')](_0x1923db[_0x98bc('0x59')]);}})['then'](respondWithResult(_0x3f96e2,null))['catch'](handleError(_0x3f96e2,null));};exports['getDispositions']=function(_0x276a80,_0x11bf87,_0x1c571c){var _0x266b02={'raw':![],'where':{}};var _0x49c785={};var _0x38b388={'count':0x0,'rows':[]};return db[_0x98bc('0x3f')]['findOne']({'where':{'id':_0x276a80[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x11bf87,null))[_0x98bc('0x25')](function(_0x4a8d5c){if(_0x4a8d5c){_0x49c785[_0x98bc('0x43')]=_['keys'](db['Disposition'][_0x98bc('0x40')]);_0x49c785[_0x98bc('0x44')]=_[_0x98bc('0x57')](_0x276a80[_0x98bc('0x44')]);_0x49c785[_0x98bc('0x4d')]=_[_0x98bc('0x45')](_0x49c785[_0x98bc('0x43')],_0x49c785[_0x98bc('0x44')]);_0x266b02[_0x98bc('0x46')]=_[_0x98bc('0x45')](_0x49c785[_0x98bc('0x43')],qs['fields'](_0x276a80[_0x98bc('0x44')][_0x98bc('0x47')]));_0x266b02[_0x98bc('0x46')]=_0x266b02[_0x98bc('0x46')][_0x98bc('0x48')]?_0x266b02[_0x98bc('0x46')]:_0x49c785[_0x98bc('0x43')];if(!_0x276a80[_0x98bc('0x44')][_0x98bc('0x64')](_0x98bc('0x49'))){_0x266b02[_0x98bc('0x34')]=qs[_0x98bc('0x34')](_0x276a80[_0x98bc('0x44')][_0x98bc('0x34')]);_0x266b02[_0x98bc('0x33')]=qs[_0x98bc('0x33')](_0x276a80['query'][_0x98bc('0x33')]);}_0x266b02[_0x98bc('0x4a')]=qs[_0x98bc('0x4b')](_0x276a80[_0x98bc('0x44')][_0x98bc('0x4b')]);_0x266b02[_0x98bc('0x4c')]=qs[_0x98bc('0x4d')](_[_0x98bc('0x65')](_0x276a80[_0x98bc('0x44')],_0x49c785['filters']));_0x266b02[_0x98bc('0x4c')][_0x98bc('0x62')]=_0x4a8d5c['id'];if(_0x276a80[_0x98bc('0x44')][_0x98bc('0x4e')]){_0x266b02[_0x98bc('0x4c')]=_['merge'](_0x266b02['where'],{'$or':_[_0x98bc('0x50')](_0x266b02[_0x98bc('0x46')],function(_0x996c4){var _0x1446c0={};_0x1446c0[_0x996c4]={'$like':'%'+_0x276a80[_0x98bc('0x44')]['filter']+'%'};return _0x1446c0;})});}_0x266b02=_[_0x98bc('0x4f')]({},_0x266b02,_0x276a80[_0x98bc('0x51')]);return db['Disposition'][_0x98bc('0x32')]({'where':_0x266b02[_0x98bc('0x4c')]})['then'](function(_0x45aa6d){_0x38b388[_0x98bc('0x32')]=_0x45aa6d;if(_0x276a80[_0x98bc('0x44')]['includeAll']){_0x266b02[_0x98bc('0x53')]=[{'all':!![]}];}return db[_0x98bc('0x63')][_0x98bc('0x66')](_0x266b02);})[_0x98bc('0x25')](function(_0x1b3b13){_0x38b388[_0x98bc('0x54')]=_0x1b3b13;return _0x38b388;});}})[_0x98bc('0x25')](respondWithFilteredResult(_0x11bf87,_0x266b02))[_0x98bc('0x55')](handleError(_0x11bf87,null));};exports['removeDispositions']=function(_0x788691,_0x5a8fd0,_0x45ccc6){return db[_0x98bc('0x3f')]['find']({'where':{'id':_0x788691[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x5a8fd0,null))['then'](function(_0x47266f){if(_0x47266f){return _0x47266f[_0x98bc('0x67')](_0x788691['query'][_0x98bc('0x68')]);}})[_0x98bc('0x25')](respondWithStatusCode(_0x5a8fd0,null))[_0x98bc('0x55')](handleError(_0x5a8fd0,null));};exports[_0x98bc('0x69')]=function(_0x293890,_0x2b6cf2,_0x15874f){if(_0x293890['body']['id']){delete _0x293890['body']['id'];}return db[_0x98bc('0x3f')][_0x98bc('0x5e')]({'where':{'id':_0x293890[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x2b6cf2,null))[_0x98bc('0x25')](function(_0x3a1973){if(_0x3a1973){_0x293890['body'][_0x98bc('0x62')]=_0x3a1973['id'];return db['CannedAnswer']['create'](_0x293890[_0x98bc('0x59')]);}})[_0x98bc('0x25')](respondWithResult(_0x2b6cf2,null))[_0x98bc('0x55')](handleError(_0x2b6cf2,null));};exports[_0x98bc('0x6a')]=function(_0x2a66a6,_0x4f67be,_0x39970e){var _0x2a46d2={'raw':![],'where':{}};var _0x5951e4={};var _0x222f61={'count':0x0,'rows':[]};return db[_0x98bc('0x3f')][_0x98bc('0x6b')]({'where':{'id':_0x2a66a6[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x4f67be,null))[_0x98bc('0x25')](function(_0x2c8b4e){if(_0x2c8b4e){_0x5951e4[_0x98bc('0x43')]=_['keys'](db['CannedAnswer'][_0x98bc('0x40')]);_0x5951e4[_0x98bc('0x44')]=_[_0x98bc('0x57')](_0x2a66a6[_0x98bc('0x44')]);_0x5951e4[_0x98bc('0x4d')]=_[_0x98bc('0x45')](_0x5951e4['model'],_0x5951e4[_0x98bc('0x44')]);_0x2a46d2['attributes']=_[_0x98bc('0x45')](_0x5951e4[_0x98bc('0x43')],qs[_0x98bc('0x47')](_0x2a66a6[_0x98bc('0x44')][_0x98bc('0x47')]));_0x2a46d2[_0x98bc('0x46')]=_0x2a46d2[_0x98bc('0x46')][_0x98bc('0x48')]?_0x2a46d2[_0x98bc('0x46')]:_0x5951e4[_0x98bc('0x43')];if(!_0x2a66a6['query'][_0x98bc('0x64')](_0x98bc('0x49'))){_0x2a46d2['limit']=qs[_0x98bc('0x34')](_0x2a66a6[_0x98bc('0x44')][_0x98bc('0x34')]);_0x2a46d2[_0x98bc('0x33')]=qs[_0x98bc('0x33')](_0x2a66a6['query'][_0x98bc('0x33')]);}_0x2a46d2[_0x98bc('0x4a')]=qs[_0x98bc('0x4b')](_0x2a66a6[_0x98bc('0x44')]['sort']);_0x2a46d2[_0x98bc('0x4c')]=qs['filters'](_[_0x98bc('0x65')](_0x2a66a6[_0x98bc('0x44')],_0x5951e4[_0x98bc('0x4d')]));_0x2a46d2[_0x98bc('0x4c')][_0x98bc('0x62')]=_0x2c8b4e['id'];if(_0x2a66a6[_0x98bc('0x44')][_0x98bc('0x4e')]){_0x2a46d2['where']=_[_0x98bc('0x4f')](_0x2a46d2[_0x98bc('0x4c')],{'$or':_['map'](_0x2a46d2[_0x98bc('0x46')],function(_0x379bf6){var _0x46d8d9={};_0x46d8d9[_0x379bf6]={'$like':'%'+_0x2a66a6[_0x98bc('0x44')]['filter']+'%'};return _0x46d8d9;})});}_0x2a46d2=_['merge']({},_0x2a46d2,_0x2a66a6[_0x98bc('0x51')]);return db[_0x98bc('0x6c')][_0x98bc('0x32')]({'where':_0x2a46d2['where']})['then'](function(_0x1ce1be){_0x222f61['count']=_0x1ce1be;if(_0x2a66a6[_0x98bc('0x44')]['includeAll']){_0x2a46d2[_0x98bc('0x53')]=[{'all':!![]}];}return db['CannedAnswer'][_0x98bc('0x66')](_0x2a46d2);})['then'](function(_0x25fdf7){_0x222f61[_0x98bc('0x54')]=_0x25fdf7;return _0x222f61;});}})[_0x98bc('0x25')](respondWithFilteredResult(_0x4f67be,_0x2a46d2))[_0x98bc('0x55')](handleError(_0x4f67be,null));};exports[_0x98bc('0x6d')]=function(_0x290cdc,_0x478499,_0x36d370){return db[_0x98bc('0x3f')][_0x98bc('0x5e')]({'where':{'id':_0x290cdc[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x478499,null))['then'](function(_0x3968cb){if(_0x3968cb){return _0x3968cb[_0x98bc('0x6d')](_0x290cdc[_0x98bc('0x44')][_0x98bc('0x68')]);}})[_0x98bc('0x25')](respondWithStatusCode(_0x478499,null))['catch'](handleError(_0x478499,null));};exports[_0x98bc('0x6e')]=function(_0x27290f,_0x1e3695,_0x293fbf){_0x27290f['body']['sitepic']=_0x27290f['file'][_0x98bc('0x6f')];return db['ChatWebsite'][_0x98bc('0x5e')]({'where':{'id':_0x27290f['params']['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x1e3695,null))[_0x98bc('0x25')](saveUpdates(_0x27290f['body'],null))[_0x98bc('0x25')](respondWithResult(_0x1e3695,null))[_0x98bc('0x55')](handleError(_0x1e3695,null));};exports[_0x98bc('0x70')]=function(_0x5b135d,_0x5b7bb8,_0x55b995){_0x5b135d[_0x98bc('0x59')][_0x98bc('0x71')]=_0x5b135d[_0x98bc('0x72')][_0x98bc('0x6f')];return db[_0x98bc('0x3f')][_0x98bc('0x5e')]({'where':{'id':_0x5b135d[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x5b7bb8,null))[_0x98bc('0x25')](saveUpdates(_0x5b135d['body'],null))[_0x98bc('0x25')](respondWithResult(_0x5b7bb8,null))[_0x98bc('0x55')](handleError(_0x5b7bb8,null));};exports[_0x98bc('0x73')]=function(_0x5966fe,_0x533e01,_0xb14e7f){_0x5966fe[_0x98bc('0x59')][_0x98bc('0x74')]=_0x5966fe[_0x98bc('0x72')][_0x98bc('0x6f')];return db[_0x98bc('0x3f')][_0x98bc('0x5e')]({'where':{'id':_0x5966fe['params']['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x533e01,null))[_0x98bc('0x25')](saveUpdates(_0x5966fe[_0x98bc('0x59')],null))[_0x98bc('0x25')](respondWithResult(_0x533e01,null))[_0x98bc('0x55')](handleError(_0x533e01,null));};exports[_0x98bc('0x75')]=function(_0x17ad99,_0x505e52,_0x11a338){_0x17ad99[_0x98bc('0x59')]['systemAvatar']=_0x17ad99[_0x98bc('0x72')][_0x98bc('0x6f')];return db['ChatWebsite'][_0x98bc('0x5e')]({'where':{'id':_0x17ad99[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x505e52,null))[_0x98bc('0x25')](saveUpdates(_0x17ad99[_0x98bc('0x59')],null))['then'](respondWithResult(_0x505e52,null))[_0x98bc('0x55')](handleError(_0x505e52,null));};exports[_0x98bc('0x76')]=function(_0x5445ac,_0x19c5a3,_0x81d98a){var _0x14ac3f=path[_0x98bc('0x77')](config[_0x98bc('0x78')],_0x98bc('0x79'));var _0x4be5e8={'where':{'id':_0x5445ac[_0x98bc('0x60')]['id']},'attributes':['id',_0x98bc('0x7a')],'raw':!![]};var _0x2bf221=![];return require(_0x98bc('0x7b'))[_0x98bc('0x7c')]()['then'](function(_0x4f0ae3){if(_0x4f0ae3){_0x2bf221=_0x4f0ae3[_0x98bc('0x7d')];}})[_0x98bc('0x25')](function(){return db[_0x98bc('0x3f')]['find'](_0x4be5e8);})[_0x98bc('0x25')](handleEntityNotFound(_0x19c5a3,null))[_0x98bc('0x25')](function(_0x1863c1){if(_0x1863c1){if(!_[_0x98bc('0x7e')](_0x1863c1[_0x98bc('0x7a')])){if(fs[_0x98bc('0x7f')](path[_0x98bc('0x77')](config[_0x98bc('0x78')],'server/files/images/logos/',_0x1863c1[_0x98bc('0x7a')]))&&_0x2bf221){_0x14ac3f=path[_0x98bc('0x77')](config[_0x98bc('0x78')],'server/files/images/logos/',_0x1863c1[_0x98bc('0x7a')]);}}return _0x19c5a3[_0x98bc('0x80')](_0x14ac3f);}})['catch'](handleError(_0x19c5a3,null));};exports[_0x98bc('0x81')]=function(_0x2f318e,_0x1e28f3,_0x1ea5c4){var _0x46d9be=path[_0x98bc('0x77')](config[_0x98bc('0x78')],_0x98bc('0x82'));var _0x4cd574={'where':{'id':_0x2f318e[_0x98bc('0x60')]['id']},'attributes':['id',_0x98bc('0x71')],'raw':!![]};return db['ChatWebsite']['find'](_0x4cd574)['then'](handleEntityNotFound(_0x1e28f3,null))['then'](function(_0x30867d){if(_0x30867d){if(!_[_0x98bc('0x7e')](_0x30867d['agentAvatar'])){if(fs[_0x98bc('0x7f')](path[_0x98bc('0x77')](config[_0x98bc('0x78')],'server/files/images/avatars/',_0x30867d[_0x98bc('0x71')]))){_0x46d9be=path[_0x98bc('0x77')](config['root'],'server/files/images/avatars/',_0x30867d[_0x98bc('0x71')]);}}return _0x1e28f3[_0x98bc('0x80')](_0x46d9be);}})['catch'](handleError(_0x1e28f3,null));};exports['getCustomerAvatar']=function(_0x580c26,_0x75cbda,_0x5780c8){var _0x1b4577=path['join'](config[_0x98bc('0x78')],'server/files/images/avatars/customer_avatar.png');var _0x11454c={'where':{'id':_0x580c26[_0x98bc('0x60')]['id']},'attributes':['id',_0x98bc('0x74'),_0x98bc('0x83')],'raw':!![]};return db['ChatWebsite'][_0x98bc('0x5e')](_0x11454c)[_0x98bc('0x25')](handleEntityNotFound(_0x75cbda,null))[_0x98bc('0x25')](function(_0x483762){if(_0x483762){if(!_[_0x98bc('0x7e')](_0x483762[_0x98bc('0x74')])){if(fs['existsSync'](path['join'](config[_0x98bc('0x78')],_0x98bc('0x84'),_0x483762[_0x98bc('0x74')]))&&_0x483762[_0x98bc('0x83')]){_0x1b4577=path[_0x98bc('0x77')](config[_0x98bc('0x78')],_0x98bc('0x84'),_0x483762[_0x98bc('0x74')]);}}return _0x75cbda['download'](_0x1b4577);}})[_0x98bc('0x55')](handleError(_0x75cbda,null));};exports['getSystemAvatar']=function(_0x3978ca,_0x5731b2,_0x6742c3){var _0x30fb3e=path[_0x98bc('0x77')](config[_0x98bc('0x78')],_0x98bc('0x85'));var _0x2f5184={'where':{'id':_0x3978ca['params']['id']},'attributes':['id',_0x98bc('0x86')],'raw':!![]};return db['ChatWebsite'][_0x98bc('0x5e')](_0x2f5184)[_0x98bc('0x25')](handleEntityNotFound(_0x5731b2,null))['then'](function(_0x96d340){if(_0x96d340){if(!_[_0x98bc('0x7e')](_0x96d340[_0x98bc('0x86')])){if(fs[_0x98bc('0x7f')](path[_0x98bc('0x77')](config[_0x98bc('0x78')],_0x98bc('0x84'),_0x96d340[_0x98bc('0x86')]))){_0x30fb3e=path[_0x98bc('0x77')](config[_0x98bc('0x78')],_0x98bc('0x84'),_0x96d340['systemAvatar']);}}return _0x5731b2[_0x98bc('0x80')](_0x30fb3e);}})[_0x98bc('0x55')](handleError(_0x5731b2,null));};exports[_0x98bc('0x87')]=function(_0x12431c,_0x124070,_0x5a01a2){var _0x582557=require(_0x98bc('0x88'));var _0x435310=new _0x582557();var _0x44a423=_0x435310[_0x98bc('0x89')](_0x12431c[_0x98bc('0x8a')][_0x98bc('0x8b')])[_0x98bc('0x8c')]();var _0x1e5553={'body':_0x12431c[_0x98bc('0x59')],'channel':_0x98bc('0x8d')};var _0xf1505a=[];var _0xe143dd=[];var _0x294ec1={};var _0xb73ef8=![];return db[_0x98bc('0x8e')][_0x98bc('0x61')]()['then'](function(_0x431944){if(!_0x431944){throw new db[(_0x98bc('0x8f'))][(_0x98bc('0x23'))](_0x98bc('0x90'));}_0xf1505a=_['difference'](_[_0x98bc('0x57')](_0x431944),[_0x98bc('0x91'),_0x98bc('0x92')]);_0xe143dd=_['difference'](_[_0x98bc('0x57')](_0x431944),[_0x98bc('0x91'),_0x98bc('0x92'),'CompanyId','ListId']);if(_0x12431c[_0x98bc('0x59')]['id']){delete _0x12431c[_0x98bc('0x59')]['id'];}if(_[_0x98bc('0x7e')](_0x12431c['body'][_0x98bc('0x93')])){throw new db[(_0x98bc('0x8f'))][(_0x98bc('0x23'))](_0x98bc('0x94'));}if(_[_0x98bc('0x7e')](_0x12431c['body'][_0x98bc('0x59')])||_0x12431c[_0x98bc('0x59')][_0x98bc('0x59')]===''){throw new db[(_0x98bc('0x8f'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x98bc('0x7e')](_0x12431c[_0x98bc('0x59')]['mapKey'])){throw new db[(_0x98bc('0x8f'))][(_0x98bc('0x23'))](_0x98bc('0x95')+_0xe143dd);}if(!_[_0x98bc('0x96')](_0xe143dd,_0x12431c[_0x98bc('0x59')][_0x98bc('0x97')])){throw new db['Sequelize'][(_0x98bc('0x23'))](_0x98bc('0x98')+_0xe143dd);}_0x294ec1[_0x12431c['body'][_0x98bc('0x97')]]=_0x12431c[_0x98bc('0x59')]['from'];})['then'](function(){return db['ChatWebsite'][_0x98bc('0x5e')]({'where':{'id':_0x12431c[_0x98bc('0x60')]['id']},'include':[{'model':db[_0x98bc('0x99')],'as':'List','include':[{'model':db[_0x98bc('0x8e')],'as':_0x98bc('0x9a'),'where':_0x294ec1,'limit':0x1,'order':[['updatedAt',_0x98bc('0x9b')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})[_0x98bc('0x25')](handleEntityNotFound(_0x124070,null))[_0x98bc('0x25')](function(_0x2571c9){if(_0x2571c9&&_0x2571c9[_0x98bc('0x9c')]){_0x1e5553[_0x98bc('0x9d')]=_0x2571c9;_0x1e5553[_0x98bc('0x9e')]=_0x2571c9[_0x98bc('0x9f')];_0x1e5553[_0x98bc('0xa0')]=_0x2571c9[_0x98bc('0x9c')];_0x1e5553[_0x98bc('0x9e')]=_[_0x98bc('0xa1')](_0x1e5553[_0x98bc('0x9e')],[_0x98bc('0xa2')],['asc']);if(_0x1e5553[_0x98bc('0x9d')][_0x98bc('0x9f')]){delete _0x1e5553['account']['Applications'];}if(_0x1e5553['account'][_0x98bc('0x9c')]&&_0x1e5553[_0x98bc('0x9d')][_0x98bc('0x9c')][_0x98bc('0x9a')][_0x98bc('0x48')]){return _0x1e5553[_0x98bc('0x9d')][_0x98bc('0x9c')]['Contacts'][0x0];}var _0x53c83a=_[_0x98bc('0xa3')](_0x12431c['body'],{'firstName':_0x12431c[_0x98bc('0x59')][_0x98bc('0x93')],'ListId':_0x2571c9['ListId']});_0x53c83a[_0x12431c[_0x98bc('0x59')][_0x98bc('0x97')]]=_0x12431c[_0x98bc('0x59')][_0x98bc('0x93')];return db[_0x98bc('0x8e')][_0x98bc('0x58')](_0x53c83a,{'fields':_0xf1505a,'raw':!![]});}})[_0x98bc('0x25')](handleEntityNotFound(_0x124070,null))[_0x98bc('0x25')](function(_0x3266c6){_0x1e5553[_0x98bc('0xa4')]=_0x3266c6;var _0x36ee7f=_0x12431c[_0x98bc('0x59')][_0x98bc('0xa5')];if(_0x12431c[_0x98bc('0x8a')][_0x98bc('0xa6')]){_0x36ee7f=_0x12431c[_0x98bc('0x8a')][_0x98bc('0xa6')];}else if(_0x12431c[_0x98bc('0x8a')]['x-forwarded-for']){_0x36ee7f=_[_0x98bc('0xa7')](_0x12431c[_0x98bc('0x8a')][_0x98bc('0xa8')][_0x98bc('0xa9')](','));}if(_0x3266c6){var _0x574b3b={'ContactId':_0x3266c6['id'],'ChatWebsiteId':_0x12431c[_0x98bc('0x60')]['id'],'from':(_0x3266c6[_0x98bc('0xaa')]||'')+'\x20'+(_0x3266c6['lastName']||''),'customerIp':_0x36ee7f,'customerPort':_0x12431c[_0x98bc('0x8a')][_0x98bc('0xab')]?_0x12431c['headers']['x-real-port']:null,'referer':_0x12431c['body']['referer'],'browserName':_0x44a423[_0x98bc('0xac')][_0x98bc('0x3c')]&&_0x44a423[_0x98bc('0xac')][_0x98bc('0xad')]?util['format']('%s\x20%s',_0x44a423[_0x98bc('0xac')][_0x98bc('0x3c')],_0x44a423[_0x98bc('0xac')][_0x98bc('0xad')]):_0x98bc('0xae'),'browserVersion':_0x44a423[_0x98bc('0xac')]['version']||_0x98bc('0xae'),'osName':util['format'](_0x98bc('0xaf'),_0x44a423['os'][_0x98bc('0x3c')],_0x44a423['os'][_0x98bc('0xad')]),'osVersion':_0x44a423['os'][_0x98bc('0xad')],'deviceModel':_0x44a423['device'][_0x98bc('0x43')]&&_0x44a423['device'][_0x98bc('0xb0')]?util[_0x98bc('0xb1')]('%s\x20%s\x20%s',_0x44a423[_0x98bc('0xb2')]['model'],_0x44a423[_0x98bc('0xb2')][_0x98bc('0xb0')],_0x44a423[_0x98bc('0xb2')]['type']):null,'deviceVendor':_0x44a423[_0x98bc('0xb2')]['vendor'],'deviceType':_0x44a423[_0x98bc('0xb2')][_0x98bc('0x42')],'formData':JSON[_0x98bc('0x2a')](_0x12431c['body'])};var _0x86a54d={'ChatWebsiteId':_0x12431c[_0x98bc('0x60')]['id'],'closed':![]};if(_0x12431c[_0x98bc('0x59')][_0x98bc('0xb3')]){_0x86a54d[_0x98bc('0xb3')]=_0x12431c[_0x98bc('0x59')][_0x98bc('0xb3')];return db[_0x98bc('0xb4')][_0x98bc('0x5e')]({'where':_0x86a54d})[_0x98bc('0x25')](function(_0x219057){if(_0x219057){return[_0x219057,![]];}_0x574b3b[_0x98bc('0xb3')]=_0x12431c[_0x98bc('0x59')]['threadId'];_0x574b3b[_0x98bc('0xb5')]=_0x12431c[_0x98bc('0x59')][_0x98bc('0xb5')];return db[_0x98bc('0xb4')][_0x98bc('0x58')](_0x574b3b)['then'](function(_0x54aac5){return[_0x54aac5,!![]];});});}_0x86a54d['ContactId']=_0x3266c6['id'];if(_0x12431c[_0x98bc('0x59')]['interaction']&&_0x12431c[_0x98bc('0x59')]['interaction']['id']){_0x86a54d['id']=_0x12431c[_0x98bc('0x59')][_0x98bc('0xb6')]['id'];return db['ChatInteraction'][_0x98bc('0x5e')]({'where':_0x86a54d})['then'](function(_0x1ad6ee){if(_0x1ad6ee){return[_0x1ad6ee,![]];}return db['ChatInteraction'][_0x98bc('0x58')](_0x574b3b)[_0x98bc('0x25')](function(_0x52f3ad){return[_0x52f3ad,!![]];});});}return db[_0x98bc('0xb4')][_0x98bc('0x58')](_0x574b3b)[_0x98bc('0x25')](function(_0x44adfe){return[_0x44adfe,!![]];});}})[_0x98bc('0xb7')](function(_0x39a937,_0x5ed057){if(_0x39a937){_0xb73ef8=_0x5ed057;if(!_0x5ed057){var _0xdbe77a={'from':(_0x1e5553[_0x98bc('0xa4')][_0x98bc('0xaa')]||'')+'\x20'+(_0x1e5553[_0x98bc('0xa4')]['lastName']||'')};if(_0x12431c['body']['threadId']&&_0x12431c[_0x98bc('0x59')]['messageId']&&_0x12431c[_0x98bc('0x59')][_0x98bc('0xb3')]!=_0x12431c[_0x98bc('0x59')][_0x98bc('0xb8')]){_0xdbe77a['threadId']=_0x12431c[_0x98bc('0x59')][_0x98bc('0xb8')];}return _0x39a937[_0x98bc('0x37')](_0xdbe77a);}else{return _0x39a937;}}})[_0x98bc('0x25')](function(_0x590a2b){_0x1e5553[_0x98bc('0xb6')]=_0x590a2b[_0x98bc('0x39')]({'plain':!![]});_0x1e5553[_0x98bc('0xb6')][_0x98bc('0xb9')]=_0xb73ef8;if(_0x1e5553[_0x98bc('0xb6')]['created']){if(_0x1e5553[_0x98bc('0x9d')][_0x98bc('0xba')]){_0x1e5553[_0x98bc('0x9e')][_0x98bc('0xbb')]({'id':0x0,'priority':_0x1e5553[_0x98bc('0x9e')][_0x98bc('0x48')]+0x1,'app':'close','appdata':_0x98bc('0xbc'),'interval':_0x98bc('0xbd')});}}return db[_0x98bc('0xbe')][_0x98bc('0x58')]({'body':_0x12431c[_0x98bc('0x59')][_0x98bc('0x59')],'ChatWebsiteId':_0x12431c['params']['id'],'ChatInteractionId':_0x590a2b['id'],'direction':'in','ContactId':_0x1e5553['contact']['id'],'AttachmentId':_0x12431c[_0x98bc('0x59')][_0x98bc('0xbf')]});})[_0x98bc('0x25')](function(_0x1bb6df){_0x1e5553[_0x98bc('0x2c')]=_0x1bb6df;if(_0x1e5553['interaction'][_0x98bc('0xc0')]){return db[_0x98bc('0xc1')][_0x98bc('0x5e')]({'attributes':['id','name'],'where':{'id':_0x1e5553[_0x98bc('0xb6')]['UserId']}})['then'](function(_0x2a07c3){if(_0x2a07c3){_0x1e5553[_0x98bc('0x9e')][_0x98bc('0xc2')]({'id':0x0,'priority':0x0,'app':_0x98bc('0xc3'),'appdata':_0x2a07c3[_0x98bc('0x3c')]+','+(_0x1e5553[_0x98bc('0x9d')][_0x98bc('0xc4')]||0xa),'interval':'*,*,*,*'});_0x1e5553[_0x98bc('0xc5')]=!![];}return respondWithRpcPromise(_0x98bc('0xc6'),'startRouting',_0x1e5553);});}return respondWithRpcPromise(_0x98bc('0xc6'),_0x98bc('0xc7'),_0x1e5553);})[_0x98bc('0x25')](function(_0xb67119){respondWithRpcPromise('EventManager',_0x98bc('0xc8'),{'event':_0x98bc('0x87'),'message':_0xb67119},client9002);return _0xb67119;})[_0x98bc('0x25')](respondWithResult(_0x124070,null))['catch'](handleError(_0x124070,null));};exports[_0x98bc('0xc9')]=function(_0x520026,_0x48880c,_0x2d151d){var _0x23d851,_0x4e646d,_0xdfcc4c;var _0x5655d8=[];var _0x4911b8=[];var _0x3910f8={};return db[_0x98bc('0x8e')][_0x98bc('0x61')]()[_0x98bc('0x25')](function(_0x54b659){if(!_0x54b659){throw new db[(_0x98bc('0x8f'))]['ValidationError'](_0x98bc('0x90'));}_0x4911b8=_['difference'](_[_0x98bc('0x57')](_0x54b659),[_0x98bc('0x91'),_0x98bc('0x92')]);_0x5655d8=_[_0x98bc('0xca')](_[_0x98bc('0x57')](_0x54b659),[_0x98bc('0x91'),_0x98bc('0x92'),_0x98bc('0xcb'),_0x98bc('0xcc')]);if(_0x520026[_0x98bc('0x59')]['id']){delete _0x520026[_0x98bc('0x59')]['id'];}if(_['isNil'](_0x520026[_0x98bc('0x59')][_0x98bc('0x93')])){throw _0x48880c['status'](0x1f4)[_0x98bc('0xcd')](new db['Sequelize'][(_0x98bc('0x23'))](_0x98bc('0x94')));}if(_['isNil'](_0x520026[_0x98bc('0x59')]['body'])||_0x520026[_0x98bc('0x59')][_0x98bc('0x59')]===''){throw _0x48880c[_0x98bc('0x2f')](0x1f4)[_0x98bc('0xcd')](new db[(_0x98bc('0x8f'))]['ValidationError'](_0x98bc('0xce')));}if(_['isNil'](_0x520026[_0x98bc('0x59')][_0x98bc('0xcf')])){throw _0x48880c[_0x98bc('0x2f')](0x1f4)[_0x98bc('0xcd')](new db[(_0x98bc('0x8f'))][(_0x98bc('0x23'))](_0x98bc('0xd0')+_0x5655d8));}if(!_[_0x98bc('0x96')](_0x5655d8,_0x520026['body'][_0x98bc('0xcf')])){throw _0x48880c[_0x98bc('0x2f')](0x1f4)[_0x98bc('0xcd')](new db[(_0x98bc('0x8f'))][(_0x98bc('0x23'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5655d8));}_0x3910f8[_0x520026[_0x98bc('0x59')][_0x98bc('0xcf')]]=_0x520026[_0x98bc('0x59')]['from'];})['then'](function(){return db['ChatWebsite'][_0x98bc('0x5e')]({'where':{'id':_0x520026[_0x98bc('0x60')]['id']},'include':[{'model':db[_0x98bc('0x99')],'as':'List'}]});})[_0x98bc('0x25')](handleEntityNotFound(_0x48880c,null))[_0x98bc('0x25')](function(_0x423d3f){if(_0x423d3f&&_0x423d3f[_0x98bc('0x9c')]){_0x4e646d=_0x423d3f;var _0x4aeea6=_['defaults'](_0x520026[_0x98bc('0x59')],{'firstName':_0x520026[_0x98bc('0x59')][_0x98bc('0x93')],'phone':_0x520026['body']['from'],'ListId':_0x423d3f['ListId']});_0x4aeea6[_0x520026[_0x98bc('0x59')][_0x98bc('0xcf')]]=_0x520026[_0x98bc('0x59')]['from'];return db[_0x98bc('0x8e')][_0x98bc('0xd1')]({'where':_0x3910f8,'defaults':_0x4aeea6});}})['spread'](function(_0x523906){if(_0x523906){_0xdfcc4c=_0x523906;var _0x468bba=fs[_0x98bc('0xd2')](path['join'](config[_0x98bc('0x78')],_0x98bc('0xd3')),_0x98bc('0xd4'));var _0x3bfb36=ejs[_0x98bc('0xd5')](_0x468bba,{'body':_['toPairs'](_0x520026[_0x98bc('0x59')][_0x98bc('0x59')]),'bodyTitle':_0x4e646d[_0x98bc('0xd6')]});return db['ChatOfflineMessage'][_0x98bc('0x58')]({'body':_0x3bfb36,'ContactId':_0x523906['id'],'ChatWebsiteId':_0x4e646d['id']});}})[_0x98bc('0x25')](function(_0x541fa7){if(_0x541fa7){_0x23d851=_0x541fa7;return db[_0x98bc('0xd7')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x98bc('0xd8')],'as':_0x98bc('0xd9'),'raw':!![]}]});}})[_0x98bc('0x25')](function(_0x36d1ef){if(_0x36d1ef&&_0x36d1ef[_0x98bc('0xd9')]&&_0x4e646d[_0x98bc('0xda')]){var _0x53f28f={'tls':{'rejectUnauthorized':![]}};if(_0x36d1ef[_0x98bc('0xd9')][_0x98bc('0xdb')]){_0x53f28f[_0x98bc('0xdb')]=_0x36d1ef[_0x98bc('0xd9')]['service'];}else{_0x53f28f['host']=_0x36d1ef['Smtp']['host'];_0x53f28f[_0x98bc('0xdc')]=_0x36d1ef[_0x98bc('0xd9')][_0x98bc('0xdc')];_0x53f28f[_0x98bc('0xdd')]=_0x36d1ef[_0x98bc('0xd9')][_0x98bc('0xdd')];}if(_0x36d1ef[_0x98bc('0xd9')][_0x98bc('0xde')]){_0x53f28f[_0x98bc('0xdf')]={'user':_0x36d1ef[_0x98bc('0xd9')][_0x98bc('0x5a')],'pass':_0x36d1ef[_0x98bc('0xd9')][_0x98bc('0xe0')]};}return respondWithRpcPromise(_0x98bc('0xe1'),_0x98bc('0xe2'),{'account':_0x53f28f,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x36d1ef['name'],_0x36d1ef[_0x98bc('0xe3')]||_0x36d1ef[_0x98bc('0xd9')][_0x98bc('0x5a')]),'to':_0x4e646d[_0x98bc('0xda')],'subject':_0x4e646d[_0x98bc('0xe4')],'text':_0x23d851[_0x98bc('0x59')]}},client9003)['then'](function(){return _0x23d851;})['catch'](function(_0xefcdd7){console[_0x98bc('0x2b')](_0xefcdd7);});}})['then'](function(){if(_0x23d851){return _0x23d851;}})['then'](respondWithResult(_0x48880c,null))[_0x98bc('0x55')](handleError(_0x48880c,null));};exports[_0x98bc('0xe5')]=function(_0x322990,_0x4d0ae0,_0x512af9){return db[_0x98bc('0xb4')]['find']({'where':{'id':_0x322990['params']['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x4d0ae0,null))[_0x98bc('0x25')](function(_0x43e400){if(_0x43e400){return _0x43e400[_0x98bc('0xe5')](_0x322990[_0x98bc('0x59')][_0x98bc('0x68')],_[_0x98bc('0xe6')](_0x322990['body'],[_0x98bc('0x68'),'id'])||{});}})[_0x98bc('0x25')](respondWithResult(_0x4d0ae0,null))[_0x98bc('0x55')](handleError(_0x4d0ae0,null));};exports['getInteractions']=function(_0x4f2882,_0x1fb656,_0x1c0c14){var _0x5155dd={'raw':![],'where':{}};var _0x53d5a5={};var _0x331aff={'count':0x0,'rows':[]};return db[_0x98bc('0x3f')][_0x98bc('0x6b')]({'where':{'id':_0x4f2882['params']['id']}})['then'](handleEntityNotFound(_0x1fb656,null))['then'](function(_0x189e64){if(_0x189e64){_0x53d5a5[_0x98bc('0x43')]=_[_0x98bc('0x57')](db[_0x98bc('0xb4')][_0x98bc('0x40')]);_0x53d5a5['query']=_[_0x98bc('0x57')](_0x4f2882[_0x98bc('0x44')]);_0x53d5a5['filters']=_['intersection'](_0x53d5a5[_0x98bc('0x43')],_0x53d5a5['query']);_0x5155dd[_0x98bc('0x46')]=_['intersection'](_0x53d5a5[_0x98bc('0x43')],qs[_0x98bc('0x47')](_0x4f2882['query'][_0x98bc('0x47')]));_0x5155dd[_0x98bc('0x46')]=_0x5155dd[_0x98bc('0x46')]['length']?_0x5155dd['attributes']:_0x53d5a5['model'];if(!_0x4f2882['query'][_0x98bc('0x64')](_0x98bc('0x49'))){_0x5155dd[_0x98bc('0x34')]=qs[_0x98bc('0x34')](_0x4f2882[_0x98bc('0x44')]['limit']);_0x5155dd[_0x98bc('0x33')]=qs[_0x98bc('0x33')](_0x4f2882[_0x98bc('0x44')][_0x98bc('0x33')]);}_0x5155dd[_0x98bc('0x4a')]=qs[_0x98bc('0x4b')](_0x4f2882[_0x98bc('0x44')][_0x98bc('0x4b')]);_0x5155dd['where']=qs[_0x98bc('0x4d')](_['pick'](_0x4f2882[_0x98bc('0x44')],_0x53d5a5[_0x98bc('0x4d')]));_0x5155dd[_0x98bc('0x4c')][_0x98bc('0x62')]=_0x189e64['id'];if(_0x4f2882[_0x98bc('0x44')][_0x98bc('0x4e')]){_0x5155dd[_0x98bc('0x4c')]=_[_0x98bc('0x4f')](_0x5155dd[_0x98bc('0x4c')],{'$or':_[_0x98bc('0x50')](_0x5155dd['attributes'],function(_0x425d4f){var _0x130b31={};_0x130b31[_0x425d4f]={'$like':'%'+_0x4f2882[_0x98bc('0x44')]['filter']+'%'};return _0x130b31;})});}_0x5155dd=_['merge']({},_0x5155dd,_0x4f2882[_0x98bc('0x51')]);return db[_0x98bc('0xb4')]['count']({'where':_0x5155dd[_0x98bc('0x4c')]})[_0x98bc('0x25')](function(_0x4142e0){_0x331aff[_0x98bc('0x32')]=_0x4142e0;if(_0x4f2882['query']['includeAll']){_0x5155dd[_0x98bc('0x53')]=[{'model':db['CmContact'],'as':_0x98bc('0xe7'),'required':![]},{'model':db[_0x98bc('0xc1')],'as':_0x98bc('0xe8'),'attributes':[_0x98bc('0x3c'),_0x98bc('0xe9'),_0x98bc('0xea')],'required':![]},{'model':db['Tag'],'as':_0x98bc('0xeb'),'attributes':['id','name',_0x98bc('0xec')],'where':_0x4f2882[_0x98bc('0x44')][_0x98bc('0xed')]?{'id':_0x4f2882[_0x98bc('0x44')]['tag']}:undefined,'required':_0x4f2882[_0x98bc('0x44')][_0x98bc('0xed')]?!![]:![]}];}return db[_0x98bc('0xb4')][_0x98bc('0x66')](_0x5155dd);})['then'](function(_0x2817d9){_0x331aff[_0x98bc('0x54')]=_0x2817d9;return _0x331aff;});}})[_0x98bc('0x25')](respondWithFilteredResult(_0x1fb656,_0x5155dd))[_0x98bc('0x55')](handleError(_0x1fb656,null));};function iftimePromise(_0x1064ab,_0x2fa261){return respondWithRpcPromise('Command','getSnippet',{'command':_0x2fa261[_0x98bc('0xee')]?util[_0x98bc('0xb1')]('iftime\x20%s,%s',_0x1064ab[_0x98bc('0xef')],_0x2fa261[_0x98bc('0xee')]):util[_0x98bc('0xb1')](_0x98bc('0xf0'),_0x1064ab[_0x98bc('0xef')])},client9002)[_0x98bc('0x25')](function(_0x46a0c3){var _0x47a679=_0x46a0c3&&_0x46a0c3[_0x98bc('0xf1')]('true')>=0x0?!![]:![];logger[_0x98bc('0x26')](_0x98bc('0xf2'),_0x2fa261['id'],_0x1064ab['id'],_0x1064ab['interval'],_0x47a679?'ONLINE':_0x98bc('0xf3'),_0x2fa261[_0x98bc('0xee')]?_0x2fa261[_0x98bc('0xee')]:_0x98bc('0xf4'));return _0x47a679;})[_0x98bc('0x55')](function(_0x1dbe5e){logger['error'](_0x98bc('0xf2'),_0x2fa261['id'],_0x1064ab['id'],_0x1064ab[_0x98bc('0xef')],util[_0x98bc('0xf5')](_0x1dbe5e,{'showHidden':![],'depth':null}),_0x2fa261[_0x98bc('0xee')]?_0x2fa261[_0x98bc('0xee')]:_0x98bc('0xf4'));return![];});}exports[_0x98bc('0xf6')]=function(_0xfcd9a6,_0x8b1418,_0x5c28dd){var _0x46d331=0x0;var _0x2a8e6e=0x0;var _0x5d3182=![];var _0x4f12a7;var _0x57f09d;return db[_0x98bc('0x3f')][_0x98bc('0x5e')]({'where':{'id':_0xfcd9a6[_0x98bc('0x60')]['id']},'include':[{'model':db[_0x98bc('0xf7')],'as':_0x98bc('0xf7'),'include':[{'model':db[_0x98bc('0xf7')],'as':_0x98bc('0xf8'),'attributes':['id',_0x98bc('0xef')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x8b1418,null))['then'](function(_0x127c3b){if(_0x127c3b){_0x4f12a7=_0x127c3b;return _0x127c3b['getProactiveActions']({'raw':!![]});}})[_0x98bc('0x25')](function(_0x4f56be){if(_0x4f12a7){if(_0x4f56be){_0x57f09d=_0x4f56be;}}return require('../../config/license/util')[_0x98bc('0x7c')]();})[_0x98bc('0x25')](function(_0x378389){if(_0x378389){_0x2a8e6e=_0x378389['virtual'];_0x5d3182=_0x378389[_0x98bc('0x7d')];}})[_0x98bc('0x25')](function(){return db['ChatInteraction'][_0x98bc('0x32')]({'where':{'closed':![]}});})[_0x98bc('0x25')](function(_0xad2ca4){_0x46d331=_0xad2ca4;if(_0x2a8e6e&&_0xad2ca4>_0x2a8e6e){return db[_0x98bc('0xf9')][_0x98bc('0x6b')]({'where':{'id':0x1}})[_0x98bc('0x25')](function(_0x51ec7e){if(_0x51ec7e){_0x51ec7e[_0x98bc('0xfa')](_0x98bc('0xfb'));}});}})[_0x98bc('0x25')](function(){if(_0x4f12a7['Interval']&&_0x4f12a7['Interval']['Intervals']){var _0x2750d5=[];for(var _0x399a5f=0x0;_0x399a5f<_0x4f12a7[_0x98bc('0xf7')]['Intervals'][_0x98bc('0x48')];_0x399a5f++){var _0x50dc19=_0x4f12a7[_0x98bc('0xf7')]['Intervals'][_0x399a5f][_0x98bc('0x39')]({'plain':!![]});_0x2750d5[_0x98bc('0xbb')](iftimePromise(_0x50dc19,_0x4f12a7));}return BPromise['all'](_0x2750d5)[_0x98bc('0x25')](function(_0x5dbb34){return _[_0x98bc('0xfc')](_0x5dbb34);});}else{return!![];}})['then'](function(_0x368f25){var _0x1e58b2=fs[_0x98bc('0xd2')](path[_0x98bc('0x77')](config[_0x98bc('0x78')],_0x98bc('0xfd')),_0x98bc('0xd4'));var _0x2ec31b={'remote':_0x4f12a7[_0x98bc('0xfe')],'query':querystring[_0x98bc('0x2a')](_[_0x98bc('0x4f')](_0x4f12a7[_0x98bc('0x39')]({'plain':!![]}),{'customerIp':_0xfcd9a6[_0x98bc('0x8a')][_0x98bc('0xa8')]||_0xfcd9a6[_0x98bc('0x8a')][_0x98bc('0xff')]||_0xfcd9a6[_0x98bc('0x100')][_0x98bc('0x101')]||_0xfcd9a6['ip'],'referer':_0xfcd9a6[_0x98bc('0x8a')][_0x98bc('0x102')],'openedInteractions':_0x46d331,'maxInteractions':_0x2a8e6e,'virtual':_0x5d3182['virtual'],'online':_0x368f25,'custom':_0x5d3182}))[_0x98bc('0x103')](/'/g,'\x5c\x27')};_0x8b1418[_0x98bc('0xcd')](ejs[_0x98bc('0xd5')](Mustache[_0x98bc('0xd5')](_0x1e58b2,_0x2ec31b),{'proactiveActions':_0x57f09d,'alignment':_0x4f12a7['alignment'],'verticalAlignment':_0x4f12a7[_0x98bc('0x104')],'div_color':_0x4f12a7[_0x98bc('0xec')],'text_color':_0x4f12a7['textColor']}));})['catch'](handleError(_0x8b1418,null));};exports[_0x98bc('0x105')]=function(_0x5290db,_0x39ef56,_0x12741d){return db[_0x98bc('0x3f')][_0x98bc('0x6b')]({'where':{'id':_0x5290db[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x39ef56,null))[_0x98bc('0x25')](function(_0x227d44){if(_0x227d44){return db[_0x98bc('0x106')][_0x98bc('0x107')](function(_0x5c687d){return db['ChatApplication'][_0x98bc('0x38')]({'where':{'ChatWebsiteId':_0x5290db[_0x98bc('0x60')]['id']},'transaction':_0x5c687d})[_0x98bc('0x25')](function(_0x2e7d6b){var _0x55edde=_[_0x98bc('0x50')](_0x5290db[_0x98bc('0x59')],function(_0x5505e1){_0x5505e1['ChatWebsiteId']=_0x5290db['params']['id'];return _0x5505e1;});return db[_0x98bc('0x108')][_0x98bc('0x109')](_0x55edde,{'transaction':_0x5c687d});});})[_0x98bc('0x25')](function(){return db[_0x98bc('0x108')][_0x98bc('0x10a')]({'where':{'ChatWebsiteId':_0x5290db[_0x98bc('0x60')]['id']},'order':_0x98bc('0xa2')});});}})['then'](respondWithResult(_0x39ef56,null))[_0x98bc('0x55')](handleError(_0x39ef56,null));};exports[_0x98bc('0x10b')]=function(_0x419a95,_0x5607b9,_0x5914cb){var _0x498c11={};var _0x22079f={};var _0x2e3e7a;var _0x40d888;return db['ChatWebsite']['findOne']({'where':{'id':_0x419a95[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x5607b9,null))[_0x98bc('0x25')](function(_0x4caa67){if(_0x4caa67){_0x2e3e7a=_0x4caa67;_0x22079f[_0x98bc('0x43')]=_[_0x98bc('0x57')](db[_0x98bc('0x108')][_0x98bc('0x40')]);_0x22079f['query']=_['keys'](_0x419a95[_0x98bc('0x44')]);_0x22079f[_0x98bc('0x4d')]=_[_0x98bc('0x45')](_0x22079f[_0x98bc('0x43')],_0x22079f[_0x98bc('0x44')]);_0x498c11[_0x98bc('0x46')]=_['intersection'](_0x22079f[_0x98bc('0x43')],qs['fields'](_0x419a95['query'][_0x98bc('0x47')]));_0x498c11['attributes']=_0x498c11[_0x98bc('0x46')]['length']?_0x498c11[_0x98bc('0x46')]:_0x22079f[_0x98bc('0x43')];_0x498c11[_0x98bc('0x4a')]=qs[_0x98bc('0x4b')](_0x419a95[_0x98bc('0x44')][_0x98bc('0x4b')]);_0x498c11[_0x98bc('0x4c')]=qs[_0x98bc('0x4d')](_[_0x98bc('0x65')](_0x419a95[_0x98bc('0x44')],_0x22079f[_0x98bc('0x4d')]));if(_0x419a95[_0x98bc('0x44')][_0x98bc('0x4e')]){_0x498c11[_0x98bc('0x4c')]=_['merge'](_0x498c11[_0x98bc('0x4c')],{'$or':_[_0x98bc('0x50')](_0x498c11[_0x98bc('0x46')],function(_0x1cb8ed){var _0xe68027={};_0xe68027[_0x1cb8ed]={'$like':'%'+_0x419a95[_0x98bc('0x44')][_0x98bc('0x4e')]+'%'};return _0xe68027;})});}_0x498c11=_['merge']({},_0x498c11,_0x419a95['options']);return _0x2e3e7a[_0x98bc('0x10b')](_0x498c11);}})[_0x98bc('0x25')](function(_0x30b3da){if(_0x30b3da){_0x40d888=_0x30b3da['length'];if(!_0x419a95[_0x98bc('0x44')]['hasOwnProperty'](_0x98bc('0x49'))){_0x498c11[_0x98bc('0x34')]=qs[_0x98bc('0x34')](_0x419a95['query']['limit']);_0x498c11[_0x98bc('0x33')]=qs[_0x98bc('0x33')](_0x419a95[_0x98bc('0x44')]['offset']);}return _0x2e3e7a['getApplications'](_0x498c11);}})[_0x98bc('0x25')](function(_0x1d942b){if(_0x1d942b){return _0x1d942b?{'count':_0x40d888,'rows':_0x1d942b}:null;}})[_0x98bc('0x25')](respondWithResult(_0x5607b9,null))['catch'](handleError(_0x5607b9,null));};exports[_0x98bc('0x10c')]=function(_0x1ba730,_0xa2829d,_0x1dc6e0){return db['chatProactiveAction'][_0x98bc('0x5e')]({'where':{'id':_0x1ba730[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0xa2829d,null))[_0x98bc('0x25')](function(_0x51d5e1){if(_0x51d5e1){return _0x51d5e1['addProactiveActions'](_0x1ba730[_0x98bc('0x59')][_0x98bc('0x68')],_['omit'](_0x1ba730[_0x98bc('0x59')],[_0x98bc('0x68'),'id'])||{});}})[_0x98bc('0x25')](respondWithResult(_0xa2829d,null))[_0x98bc('0x55')](handleError(_0xa2829d,null));};exports['getProactiveActions']=function(_0x1f18f4,_0x5b13bb,_0x47eedd){var _0x58bede={};var _0x51890f={};var _0x3d0e7d;var _0x1ca847;return db[_0x98bc('0x3f')][_0x98bc('0x6b')]({'where':{'id':_0x1f18f4[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x5b13bb,null))[_0x98bc('0x25')](function(_0x57fa71){if(_0x57fa71){_0x3d0e7d=_0x57fa71;_0x51890f[_0x98bc('0x43')]=_[_0x98bc('0x57')](db['ChatProactiveAction']['rawAttributes']);_0x51890f['query']=_[_0x98bc('0x57')](_0x1f18f4[_0x98bc('0x44')]);_0x51890f[_0x98bc('0x4d')]=_[_0x98bc('0x45')](_0x51890f[_0x98bc('0x43')],_0x51890f[_0x98bc('0x44')]);_0x58bede[_0x98bc('0x46')]=_[_0x98bc('0x45')](_0x51890f['model'],qs[_0x98bc('0x47')](_0x1f18f4[_0x98bc('0x44')][_0x98bc('0x47')]));_0x58bede[_0x98bc('0x46')]=_0x58bede[_0x98bc('0x46')][_0x98bc('0x48')]?_0x58bede[_0x98bc('0x46')]:_0x51890f[_0x98bc('0x43')];_0x58bede[_0x98bc('0x4a')]=qs[_0x98bc('0x4b')](_0x1f18f4[_0x98bc('0x44')]['sort']);_0x58bede[_0x98bc('0x4c')]=qs[_0x98bc('0x4d')](_[_0x98bc('0x65')](_0x1f18f4[_0x98bc('0x44')],_0x51890f[_0x98bc('0x4d')]));if(_0x1f18f4[_0x98bc('0x44')][_0x98bc('0x4e')]){_0x58bede[_0x98bc('0x4c')]=_[_0x98bc('0x4f')](_0x58bede['where'],{'$or':_['map'](_0x58bede['attributes'],function(_0x289c02){var _0x28194c={};_0x28194c[_0x289c02]={'$like':'%'+_0x1f18f4[_0x98bc('0x44')]['filter']+'%'};return _0x28194c;})});}_0x58bede=_[_0x98bc('0x4f')]({},_0x58bede,_0x1f18f4['options']);return _0x3d0e7d[_0x98bc('0x10d')](_0x58bede);}})[_0x98bc('0x25')](function(_0x373926){if(_0x373926){_0x1ca847=_0x373926['length'];if(!_0x1f18f4[_0x98bc('0x44')][_0x98bc('0x64')]('nolimit')){_0x58bede[_0x98bc('0x34')]=qs[_0x98bc('0x34')](_0x1f18f4[_0x98bc('0x44')][_0x98bc('0x34')]);_0x58bede[_0x98bc('0x33')]=qs[_0x98bc('0x33')](_0x1f18f4[_0x98bc('0x44')][_0x98bc('0x33')]);}return _0x3d0e7d[_0x98bc('0x10d')](_0x58bede);}})[_0x98bc('0x25')](function(_0x5b7d1a){if(_0x5b7d1a){return _0x5b7d1a?{'count':_0x1ca847,'rows':_0x5b7d1a}:null;}})[_0x98bc('0x25')](respondWithResult(_0x5b13bb,null))[_0x98bc('0x55')](handleError(_0x5b13bb,null));};exports[_0x98bc('0x10e')]=function(_0x4d6a03,_0x5f18e3,_0x2ca0c1){var _0xbe0cb8=_0x4d6a03[_0x98bc('0x44')][_0x98bc('0x10f')]==='false'?'offlineForm':_0x98bc('0x110');return db[_0x98bc('0x3f')]['find']({'attributes':['id',_0xbe0cb8],'where':{'id':_0x4d6a03['params']['id']}})['then'](handleEntityNotFound(_0x5f18e3,null))[_0x98bc('0x25')](function(_0x48b60e){if(_0x48b60e){var _0x533de7=_0x48b60e[_0xbe0cb8];var _0x3b751f=_0x533de7&&_0x533de7[_0x98bc('0x111')]?_0x533de7[_0x98bc('0x111')]:[];_0x5f18e3[_0x98bc('0xcd')]({'fromKey':_[_0x98bc('0x7e')](_0x533de7[_0x98bc('0x112')])?undefined:_0x533de7['fromKey'],'count':_0x3b751f['length'],'rows':_0x3b751f});}})['catch'](handleError(_0x5f18e3,null));};exports[_0x98bc('0x113')]=function(_0xed715f,_0x37b71c,_0x36aaf2){var _0x228f1d={'raw':![],'where':{}};var _0x55efcb={};var _0x298360={'count':0x0,'rows':[]};return db[_0x98bc('0x3f')][_0x98bc('0x6b')]({'where':{'id':_0xed715f['params']['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x37b71c,null))[_0x98bc('0x25')](function(_0xdbc279){if(_0xdbc279){_0x55efcb[_0x98bc('0x43')]=_[_0x98bc('0x57')](db['ChatOfflineMessage'][_0x98bc('0x40')]);_0x55efcb['query']=_[_0x98bc('0x57')](_0xed715f[_0x98bc('0x44')]);_0x55efcb[_0x98bc('0x4d')]=_[_0x98bc('0x45')](_0x55efcb[_0x98bc('0x43')],_0x55efcb[_0x98bc('0x44')]);_0x228f1d[_0x98bc('0x46')]=_[_0x98bc('0x45')](_0x55efcb[_0x98bc('0x43')],qs[_0x98bc('0x47')](_0xed715f[_0x98bc('0x44')][_0x98bc('0x47')]));_0x228f1d[_0x98bc('0x46')]=_0x228f1d[_0x98bc('0x46')][_0x98bc('0x48')]?_0x228f1d['attributes']:_0x55efcb[_0x98bc('0x43')];if(!_0xed715f[_0x98bc('0x44')][_0x98bc('0x64')](_0x98bc('0x49'))){_0x228f1d[_0x98bc('0x34')]=qs[_0x98bc('0x34')](_0xed715f[_0x98bc('0x44')][_0x98bc('0x34')]);_0x228f1d[_0x98bc('0x33')]=qs[_0x98bc('0x33')](_0xed715f[_0x98bc('0x44')][_0x98bc('0x33')]);}_0x228f1d['order']=qs[_0x98bc('0x4b')](_0xed715f[_0x98bc('0x44')][_0x98bc('0x4b')]);_0x228f1d[_0x98bc('0x4c')]=qs['filters'](_[_0x98bc('0x65')](_0xed715f['query'],_0x55efcb['filters']));_0x228f1d[_0x98bc('0x4c')]['ChatWebsiteId']=_0xdbc279['id'];if(_0xed715f['query'][_0x98bc('0x4e')]){_0x228f1d[_0x98bc('0x4c')]=_[_0x98bc('0x4f')](_0x228f1d[_0x98bc('0x4c')],{'$or':_[_0x98bc('0x50')](_0x228f1d[_0x98bc('0x46')],function(_0x5cd55a){var _0x4c96d1={};_0x4c96d1[_0x5cd55a]={'$like':'%'+_0xed715f[_0x98bc('0x44')][_0x98bc('0x4e')]+'%'};return _0x4c96d1;})});}_0x228f1d=_['merge']({},_0x228f1d,_0xed715f[_0x98bc('0x51')]);return db[_0x98bc('0x114')]['count']({'where':_0x228f1d[_0x98bc('0x4c')]})[_0x98bc('0x25')](function(_0x18069a){_0x298360[_0x98bc('0x32')]=_0x18069a;if(_0xed715f[_0x98bc('0x44')][_0x98bc('0x52')]){_0x228f1d[_0x98bc('0x53')]=[{'all':!![]}];}else{_0x228f1d[_0x98bc('0x53')]=[{'model':db['CmContact'],'as':'Contact','required':![]}];}return db['ChatOfflineMessage'][_0x98bc('0x66')](_0x228f1d);})[_0x98bc('0x25')](function(_0x1eb4dc){_0x298360[_0x98bc('0x54')]=_0x1eb4dc;return _0x298360;});}})[_0x98bc('0x25')](respondWithFilteredResult(_0x37b71c,_0x228f1d))[_0x98bc('0x55')](handleError(_0x37b71c,null));};exports[_0x98bc('0x115')]=function(_0x4fe0b0,_0x11378e,_0x189111){return db['ChatWebsite'][_0x98bc('0x5e')]({'where':{'id':_0x4fe0b0[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x11378e,null))['then'](function(_0x13a006){if(_0x13a006){return _0x13a006['addAgents'](_0x4fe0b0[_0x98bc('0x59')]['ids'],_[_0x98bc('0xe6')](_0x4fe0b0[_0x98bc('0x59')],['ids','id'])||{})[_0x98bc('0xb7')](function(_0x2b1bb0){for(var _0x446584=0x0;_0x446584<_0x4fe0b0[_0x98bc('0x59')][_0x98bc('0x68')]['length'];_0x446584+=0x1){socket[_0x98bc('0x116')]('userChatWebsite:save',{'UserId':_0x4fe0b0[_0x98bc('0x59')][_0x98bc('0x68')][_0x446584],'ChatWebsiteId':_0x4fe0b0[_0x98bc('0x60')]['id']});}return _0x2b1bb0;});}})[_0x98bc('0x25')](respondWithResult(_0x11378e,null))[_0x98bc('0x55')](handleError(_0x11378e,null));};exports[_0x98bc('0x117')]=function(_0x4d378b,_0x275d7d,_0x211eea){return db['ChatWebsite'][_0x98bc('0x5e')]({'where':{'id':_0x4d378b[_0x98bc('0x60')]['id']}})[_0x98bc('0x25')](handleEntityNotFound(_0x275d7d,null))[_0x98bc('0x25')](function(_0x1c8fd6){if(_0x1c8fd6){return _0x1c8fd6[_0x98bc('0x117')](_0x4d378b[_0x98bc('0x44')][_0x98bc('0x68')])[_0x98bc('0x25')](function(){if(_[_0x98bc('0x118')](_0x4d378b[_0x98bc('0x44')]['ids'])){for(var _0x43f21b=0x0;_0x43f21b<_0x4d378b[_0x98bc('0x44')][_0x98bc('0x68')][_0x98bc('0x48')];_0x43f21b+=0x1){socket['emit'](_0x98bc('0x119'),{'UserId':Number(_0x4d378b[_0x98bc('0x44')][_0x98bc('0x68')][_0x43f21b]),'ChatWebsiteId':Number(_0x4d378b[_0x98bc('0x60')]['id'])});}}else{socket[_0x98bc('0x116')](_0x98bc('0x119'),{'UserId':Number(_0x4d378b['query'][_0x98bc('0x68')]),'ChatWebsiteId':Number(_0x4d378b[_0x98bc('0x60')]['id'])});}});}})['then'](respondWithStatusCode(_0x275d7d,null))['catch'](handleError(_0x275d7d,null));};exports['getAgents']=function(_0x351d10,_0x865df5,_0x32ebfb){var _0x58c811={};var _0x5efc93={};var _0x434265;var _0x634d27;return db['ChatWebsite']['findOne']({'where':{'id':_0x351d10[_0x98bc('0x60')]['id']}})['then'](handleEntityNotFound(_0x865df5,null))[_0x98bc('0x25')](function(_0x2c7d42){if(_0x2c7d42){_0x434265=_0x2c7d42;_0x5efc93[_0x98bc('0x43')]=_[_0x98bc('0x57')](db['User'][_0x98bc('0x40')]);_0x5efc93['query']=_[_0x98bc('0x57')](_0x351d10['query']);_0x5efc93[_0x98bc('0x4d')]=_['intersection'](_0x5efc93['model'],_0x5efc93[_0x98bc('0x44')]);_0x58c811['attributes']=_['intersection'](_0x5efc93[_0x98bc('0x43')],qs['fields'](_0x351d10['query']['fields']));_0x58c811[_0x98bc('0x46')]=_0x58c811['attributes'][_0x98bc('0x48')]?_0x58c811['attributes']:_0x5efc93[_0x98bc('0x43')];_0x58c811[_0x98bc('0x4a')]=qs[_0x98bc('0x4b')](_0x351d10[_0x98bc('0x44')][_0x98bc('0x4b')]);_0x58c811[_0x98bc('0x4c')]=qs[_0x98bc('0x4d')](_[_0x98bc('0x65')](_0x351d10[_0x98bc('0x44')],_0x5efc93[_0x98bc('0x4d')]));if(_0x351d10[_0x98bc('0x44')]['filter']){_0x58c811[_0x98bc('0x4c')]=_['merge'](_0x58c811[_0x98bc('0x4c')],{'$or':_[_0x98bc('0x50')](_0x58c811[_0x98bc('0x46')],function(_0x4c08d5){var _0x3b523c={};_0x3b523c[_0x4c08d5]={'$like':'%'+_0x351d10[_0x98bc('0x44')]['filter']+'%'};return _0x3b523c;})});}_0x58c811=_['merge']({},_0x58c811,_0x351d10['options']);return _0x434265[_0x98bc('0x11a')](_0x58c811);}})[_0x98bc('0x25')](function(_0x4fca3d){if(_0x4fca3d){_0x634d27=_0x4fca3d[_0x98bc('0x48')];if(!_0x351d10[_0x98bc('0x44')][_0x98bc('0x64')](_0x98bc('0x49'))){_0x58c811[_0x98bc('0x34')]=qs[_0x98bc('0x34')](_0x351d10[_0x98bc('0x44')]['limit']);_0x58c811[_0x98bc('0x33')]=qs[_0x98bc('0x33')](_0x351d10[_0x98bc('0x44')][_0x98bc('0x33')]);}return _0x434265[_0x98bc('0x11a')](_0x58c811);}})[_0x98bc('0x25')](function(_0x18888d){if(_0x18888d){return _0x18888d?{'count':_0x634d27,'rows':_0x18888d}:null;}})[_0x98bc('0x25')](respondWithResult(_0x865df5,null))[_0x98bc('0x55')](handleError(_0x865df5,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index dd1a176..a1108d3 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 _0x0e5d=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x0e5d,0x152));var _0xd0e5=function(_0x52f57f,_0x25f2a2){_0x52f57f=_0x52f57f-0x0;var _0x40ea17=_0x0e5d[_0x52f57f];return _0x40ea17;};'use strict';var EventEmitter=require(_0xd0e5('0x0'));var ChatWebsite=require(_0xd0e5('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xd0e5('0x2')](0x0);var events={'afterCreate':_0xd0e5('0x3'),'afterUpdate':_0xd0e5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x47503f){return function(_0x25644d,_0x33e42d,_0x3d942d){ChatWebsiteEvents[_0xd0e5('0x5')](_0x47503f+':'+_0x25644d['id'],_0x25644d);ChatWebsiteEvents[_0xd0e5('0x5')](_0x47503f,_0x25644d);_0x3d942d(null);};}for(var e in events){if(events[_0xd0e5('0x6')](e)){var event=events[e];ChatWebsite[_0xd0e5('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x6135=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save'];(function(_0x43055f,_0x2a7498){var _0x4e2388=function(_0xe9086d){while(--_0xe9086d){_0x43055f['push'](_0x43055f['shift']());}};_0x4e2388(++_0x2a7498);}(_0x6135,0x18b));var _0x5613=function(_0xd02def,_0x144f25){_0xd02def=_0xd02def-0x0;var _0x2e8374=_0x6135[_0xd02def];return _0x2e8374;};'use strict';var EventEmitter=require(_0x5613('0x0'));var ChatWebsite=require(_0x5613('0x1'))['db'][_0x5613('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5613('0x3')](0x0);var events={'afterCreate':_0x5613('0x4'),'afterUpdate':'update','afterDestroy':_0x5613('0x5')};function emitEvent(_0x4086f6){return function(_0x279343,_0x391222,_0x89387d){ChatWebsiteEvents['emit'](_0x4086f6+':'+_0x279343['id'],_0x279343);ChatWebsiteEvents[_0x5613('0x6')](_0x4086f6,_0x279343);_0x89387d(null);};}for(var e in events){if(events[_0x5613('0x7')](e)){var event=events[e];ChatWebsite[_0x5613('0x8')](e,emitEvent(event));}}module[_0x5613('0x9')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index b322902..42a9425 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 _0x66fa=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x469a69,_0x371584){var _0x5a45b0=function(_0x4d0765){while(--_0x4d0765){_0x469a69['push'](_0x469a69['shift']());}};_0x5a45b0(++_0x371584);}(_0x66fa,0x168));var _0xa66f=function(_0x4859f2,_0x443a08){_0x4859f2=_0x4859f2-0x0;var _0x1c5ae9=_0x66fa[_0x4859f2];return _0x1c5ae9;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var logger=require(_0xa66f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa66f('0x3'));var rp=require(_0xa66f('0x4'));var fs=require('fs');var path=require(_0xa66f('0x5'));var rimraf=require(_0xa66f('0x6'));var config=require(_0xa66f('0x7'));var attributes=require(_0xa66f('0x8'));module[_0xa66f('0x9')]=function(_0x4532ee,_0x25a7a0){return _0x4532ee[_0xa66f('0xa')](_0xa66f('0xb'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf296=['api','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','lodash','util'];(function(_0x4392a5,_0x4308fc){var _0x59b0bb=function(_0x30bbbe){while(--_0x30bbbe){_0x4392a5['push'](_0x4392a5['shift']());}};_0x59b0bb(++_0x4308fc);}(_0xf296,0x94));var _0x6f29=function(_0x57fca6,_0x497213){_0x57fca6=_0x57fca6-0x0;var _0x1f2800=_0xf296[_0x57fca6];return _0x1f2800;};'use strict';var _=require(_0x6f29('0x0'));var util=require(_0x6f29('0x1'));var logger=require('../../config/logger')(_0x6f29('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6f29('0x3'));var fs=require('fs');var path=require(_0x6f29('0x4'));var rimraf=require('rimraf');var config=require(_0x6f29('0x5'));var attributes=require(_0x6f29('0x6'));module[_0x6f29('0x7')]=function(_0x4f0712,_0x1d9c3f){return _0x4f0712[_0x6f29('0x8')]('ChatWebsite',attributes,{'tableName':_0x6f29('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 35e1ee7..15edf2a 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 _0x2542=['register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket'];(function(_0x3825cf,_0x4627b9){var _0xcdb6d9=function(_0x21927c){while(--_0x21927c){_0x3825cf['push'](_0x3825cf['shift']());}};_0xcdb6d9(++_0x4627b9);}(_0x2542,0x169));var _0x2254=function(_0x269a72,_0x2ba574){_0x269a72=_0x269a72-0x0;var _0xa8f9b0=_0x2542[_0x269a72];return _0xa8f9b0;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});config[_0x2254('0xb')]=_[_0x2254('0xc')](config[_0x2254('0xb')],{'host':_0x2254('0xd'),'port':0x18eb});var socket=require(_0x2254('0xe'))(new Redis(config[_0x2254('0xb')]));require(_0x2254('0xf'))[_0x2254('0x10')](socket);function respondWithRpcPromise(_0x1ae415,_0x38fb2b,_0x5b1ab9){return new BPromise(function(_0x336e14,_0x2655ea){return client[_0x2254('0x11')](_0x1ae415,_0x5b1ab9)[_0x2254('0x12')](function(_0x575d58){logger['info'](_0x2254('0x13'),_0x38fb2b,_0x2254('0x14'));logger[_0x2254('0x15')](_0x2254('0x16'),_0x38fb2b,_0x2254('0x14'),JSON[_0x2254('0x17')](_0x575d58));if(_0x575d58['error']){if(_0x575d58[_0x2254('0x18')][_0x2254('0x19')]===0x1f4){logger['error'](_0x2254('0x13'),_0x38fb2b,_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);return _0x2655ea(_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);}logger[_0x2254('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x38fb2b,_0x575d58[_0x2254('0x18')]['message']);return _0x336e14(_0x575d58[_0x2254('0x18')][_0x2254('0x1a')]);}else{logger[_0x2254('0x1b')](_0x2254('0x13'),_0x38fb2b,_0x2254('0x14'));_0x336e14(_0x575d58[_0x2254('0x1c')]['message']);}})['catch'](function(_0x5ec98d){logger[_0x2254('0x18')](_0x2254('0x13'),_0x38fb2b,_0x5ec98d);_0x2655ea(_0x5ec98d);});});} \ No newline at end of file +var _0x7a54=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x548188,_0x4eb52d){_0x548188=_0x548188-0x0;var _0xe6691=_0x7a54[_0x548188];return _0xe6691;};'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('./chatWebsite.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')]('ChatWebsite,\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);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 64197cd..76bab5f 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 _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_0xb10b,0x12a));var _0xbb10=function(_0x589d2f,_0xc49372){_0x589d2f=_0x589d2f-0x0;var _0x1db27c=_0xb10b[_0x589d2f];return _0x1db27c;};'use strict';var ChatWebsiteEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatWebsiteEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatWebsiteEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x2d364e,_0x301c5e){var _0x1b9312=function(_0x1b05bb){while(--_0x1b05bb){_0x2d364e['push'](_0x2d364e['shift']());}};_0x1b9312(++_0x301c5e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x57b083,_0x198f43){_0x57b083=_0x57b083-0x0;var _0x48345c=_0x5f2f[_0x57b083];return _0x48345c;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 524109b..eaebde1 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 _0x9f2c=['getInteractions','/:id/snippet','getSnippet','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','root','format','%s-%s','now','originalname','single','file','join','server/files/images/avatars/','addAvatar','diskStorage','/:id/customer_avatar','addCustomerAvatar','/:id/notify','notify','/:id/offline','offline','/:id/applications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','describe','/:id','isAuthenticated','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions'];(function(_0x179c4a,_0x10eb06){var _0x5d1879=function(_0x1f1dcd){while(--_0x1f1dcd){_0x179c4a['push'](_0x179c4a['shift']());}};_0x5d1879(++_0x10eb06);}(_0x9f2c,0x15d));var _0xc9f2=function(_0x1faa61,_0x1bd7e2){_0x1faa61=_0x1faa61-0x0;var _0x3f0e58=_0x9f2c[_0x1faa61];return _0x3f0e58;};'use strict';var multer=require(_0xc9f2('0x0'));var util=require(_0xc9f2('0x1'));var path=require(_0xc9f2('0x2'));var timeout=require(_0xc9f2('0x3'));var express=require(_0xc9f2('0x4'));var router=express[_0xc9f2('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc9f2('0x6'));var config=require(_0xc9f2('0x7'));var controller=require('./chatWebsite.controller');router[_0xc9f2('0x8')]('/',auth['isAuthenticated'](),controller[_0xc9f2('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xc9f2('0xa')]);router['get'](_0xc9f2('0xb'),auth[_0xc9f2('0xc')](),controller['show']);router[_0xc9f2('0x8')](_0xc9f2('0xd'),auth[_0xc9f2('0xc')](),controller[_0xc9f2('0xe')]);router[_0xc9f2('0x8')](_0xc9f2('0xf'),auth['isAuthenticated'](),controller[_0xc9f2('0x10')]);router[_0xc9f2('0x8')](_0xc9f2('0x11'),controller['getLogo']);router[_0xc9f2('0x8')](_0xc9f2('0x12'),controller[_0xc9f2('0x13')]);router['get']('/:id/customer_avatar',controller[_0xc9f2('0x14')]);router['get'](_0xc9f2('0x15'),controller['getSystemAvatar']);router[_0xc9f2('0x8')](_0xc9f2('0x16'),auth[_0xc9f2('0xc')](),controller[_0xc9f2('0x17')]);router['get'](_0xc9f2('0x18'),controller[_0xc9f2('0x19')]);router[_0xc9f2('0x8')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router['get']('/:id/proactive_actions',auth[_0xc9f2('0xc')](),controller['getProactiveActions']);router[_0xc9f2('0x8')](_0xc9f2('0x1a'),controller[_0xc9f2('0x1b')]);router[_0xc9f2('0x8')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0xc9f2('0x1c')]);router[_0xc9f2('0x8')](_0xc9f2('0x1d'),auth[_0xc9f2('0xc')](),controller[_0xc9f2('0x1e')]);router[_0xc9f2('0x1f')]('/',auth[_0xc9f2('0xc')](),controller[_0xc9f2('0x20')]);router[_0xc9f2('0x1f')](_0xc9f2('0xd'),auth[_0xc9f2('0xc')](),controller[_0xc9f2('0x21')]);router['post'](_0xc9f2('0xf'),auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d0c0c,_0x1e7046,_0x119722){_0x119722(null,path['join'](config[_0xc9f2('0x22')],'server/files/images/logos/'));},'filename':function(_0xf64f67,_0x32c656,_0x447523){_0x447523(null,util[_0xc9f2('0x23')](_0xc9f2('0x24'),Date[_0xc9f2('0x25')](),_0x32c656[_0xc9f2('0x26')]));}})});router['post'](_0xc9f2('0x11'),upload[_0xc9f2('0x27')](_0xc9f2('0x28')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1f5125,_0x1d0f78,_0x1bcda9){_0x1bcda9(null,path[_0xc9f2('0x29')](config[_0xc9f2('0x22')],_0xc9f2('0x2a')));},'filename':function(_0xfd4f53,_0x1b1725,_0x23c2ae){_0x23c2ae(null,util['format'](_0xc9f2('0x24'),Date[_0xc9f2('0x25')](),_0x1b1725[_0xc9f2('0x26')]));}})});router[_0xc9f2('0x1f')]('/:id/avatar',upload[_0xc9f2('0x27')]('file'),controller[_0xc9f2('0x2b')]);var upload=multer({'storage':multer[_0xc9f2('0x2c')]({'destination':function(_0x13f681,_0x48ff26,_0x18cfcd){_0x18cfcd(null,path[_0xc9f2('0x29')](config[_0xc9f2('0x22')],_0xc9f2('0x2a')));},'filename':function(_0x3a0243,_0x3c210d,_0x598bf3){_0x598bf3(null,util[_0xc9f2('0x23')](_0xc9f2('0x24'),Date[_0xc9f2('0x25')](),_0x3c210d[_0xc9f2('0x26')]));}})});router[_0xc9f2('0x1f')](_0xc9f2('0x2d'),upload[_0xc9f2('0x27')](_0xc9f2('0x28')),controller[_0xc9f2('0x2e')]);var upload=multer({'storage':multer[_0xc9f2('0x2c')]({'destination':function(_0x446f87,_0x3f4774,_0x169245){_0x169245(null,path['join'](config[_0xc9f2('0x22')],'server/files/images/avatars/'));},'filename':function(_0x4596df,_0x3aa75a,_0x3f4ecb){_0x3f4ecb(null,util[_0xc9f2('0x23')]('%s-%s',Date[_0xc9f2('0x25')](),_0x3aa75a[_0xc9f2('0x26')]));}})});router['post'](_0xc9f2('0x15'),upload[_0xc9f2('0x27')](_0xc9f2('0x28')),controller['addSystemAvatar']);router[_0xc9f2('0x1f')](_0xc9f2('0x2f'),controller[_0xc9f2('0x30')]);router[_0xc9f2('0x1f')](_0xc9f2('0x31'),controller[_0xc9f2('0x32')]);router[_0xc9f2('0x1f')](_0xc9f2('0x16'),auth[_0xc9f2('0xc')](),controller['addInteraction']);router['post'](_0xc9f2('0x33'),auth[_0xc9f2('0xc')](),controller['addApplications']);router[_0xc9f2('0x1f')](_0xc9f2('0x34'),auth[_0xc9f2('0xc')](),controller[_0xc9f2('0x35')]);router[_0xc9f2('0x1f')](_0xc9f2('0x1d'),auth[_0xc9f2('0xc')](),controller[_0xc9f2('0x36')]);router[_0xc9f2('0x37')](_0xc9f2('0xb'),auth[_0xc9f2('0xc')](),controller[_0xc9f2('0x38')]);router[_0xc9f2('0x39')]('/:id',auth[_0xc9f2('0xc')](),controller['destroy']);router[_0xc9f2('0x39')](_0xc9f2('0xd'),auth['isAuthenticated'](),controller[_0xc9f2('0x3a')]);router['delete'](_0xc9f2('0xf'),auth[_0xc9f2('0xc')](),controller[_0xc9f2('0x3b')]);router[_0xc9f2('0x39')](_0xc9f2('0x1d'),auth[_0xc9f2('0xc')](),controller[_0xc9f2('0x3c')]);module[_0xc9f2('0x3d')]=router; \ No newline at end of file +var _0x9fb5=['addInteraction','addApplications','addProactiveActions','addAgents','put','update','destroy','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','getLogo','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','file','server/files/images/avatars/','/:id/avatar','single','addAvatar','addCustomerAvatar','/:id/notify','notify','/:id/offline'];(function(_0x534620,_0x461427){var _0x545549=function(_0x76863c){while(--_0x76863c){_0x534620['push'](_0x534620['shift']());}};_0x545549(++_0x461427);}(_0x9fb5,0xd3));var _0x59fb=function(_0x114184,_0x4eed11){_0x114184=_0x114184-0x0;var _0x5c2fc9=_0x9fb5[_0x114184];return _0x5c2fc9;};'use strict';var multer=require(_0x59fb('0x0'));var util=require(_0x59fb('0x1'));var path=require(_0x59fb('0x2'));var timeout=require(_0x59fb('0x3'));var express=require(_0x59fb('0x4'));var router=express[_0x59fb('0x5')]();var auth=require(_0x59fb('0x6'));var interaction=require(_0x59fb('0x7'));var config=require(_0x59fb('0x8'));var controller=require(_0x59fb('0x9'));router[_0x59fb('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x59fb('0xa')](_0x59fb('0xb'),auth[_0x59fb('0xc')](),controller[_0x59fb('0xd')]);router[_0x59fb('0xa')](_0x59fb('0xe'),auth[_0x59fb('0xc')](),controller[_0x59fb('0xf')]);router[_0x59fb('0xa')](_0x59fb('0x10'),auth['isAuthenticated'](),controller[_0x59fb('0x11')]);router[_0x59fb('0xa')]('/:id/canned_answers',auth[_0x59fb('0xc')](),controller[_0x59fb('0x12')]);router[_0x59fb('0xa')]('/:id/logo',controller[_0x59fb('0x13')]);router[_0x59fb('0xa')]('/:id/avatar',controller['getAvatar']);router[_0x59fb('0xa')]('/:id/customer_avatar',controller[_0x59fb('0x14')]);router[_0x59fb('0xa')](_0x59fb('0x15'),controller[_0x59fb('0x16')]);router[_0x59fb('0xa')](_0x59fb('0x17'),auth['isAuthenticated'](),controller['getInteractions']);router['get']('/:id/snippet',controller[_0x59fb('0x18')]);router[_0x59fb('0xa')](_0x59fb('0x19'),auth[_0x59fb('0xc')](),controller[_0x59fb('0x1a')]);router[_0x59fb('0xa')](_0x59fb('0x1b'),auth[_0x59fb('0xc')](),controller[_0x59fb('0x1c')]);router[_0x59fb('0xa')](_0x59fb('0x1d'),controller[_0x59fb('0x1e')]);router[_0x59fb('0xa')](_0x59fb('0x1f'),auth['isAuthenticated'](),controller[_0x59fb('0x20')]);router[_0x59fb('0xa')](_0x59fb('0x21'),auth['isAuthenticated'](),controller[_0x59fb('0x22')]);router[_0x59fb('0x23')]('/',auth['isAuthenticated'](),controller['create']);router[_0x59fb('0x23')](_0x59fb('0x10'),auth[_0x59fb('0xc')](),controller[_0x59fb('0x24')]);router[_0x59fb('0x23')](_0x59fb('0x25'),auth['isAuthenticated'](),controller[_0x59fb('0x26')]);var upload=multer({'storage':multer[_0x59fb('0x27')]({'destination':function(_0x62dd7b,_0x51c92a,_0x34fc37){_0x34fc37(null,path[_0x59fb('0x28')](config[_0x59fb('0x29')],_0x59fb('0x2a')));},'filename':function(_0x69dc33,_0x210389,_0x557c2e){_0x557c2e(null,util[_0x59fb('0x2b')](_0x59fb('0x2c'),Date[_0x59fb('0x2d')](),_0x210389[_0x59fb('0x2e')]));}})});router[_0x59fb('0x23')](_0x59fb('0x2f'),upload['single'](_0x59fb('0x30')),controller['addLogo']);var upload=multer({'storage':multer[_0x59fb('0x27')]({'destination':function(_0x3c5dd1,_0xad4418,_0x444d83){_0x444d83(null,path[_0x59fb('0x28')](config[_0x59fb('0x29')],_0x59fb('0x31')));},'filename':function(_0x3472bd,_0x1d7b0f,_0x536fe0){_0x536fe0(null,util['format'](_0x59fb('0x2c'),Date['now'](),_0x1d7b0f[_0x59fb('0x2e')]));}})});router[_0x59fb('0x23')](_0x59fb('0x32'),upload[_0x59fb('0x33')](_0x59fb('0x30')),controller[_0x59fb('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2cd6c7,_0x503bc5,_0x33ebf4){_0x33ebf4(null,path[_0x59fb('0x28')](config[_0x59fb('0x29')],'server/files/images/avatars/'));},'filename':function(_0x51d9d4,_0x28fb57,_0x17cc2d){_0x17cc2d(null,util['format'](_0x59fb('0x2c'),Date[_0x59fb('0x2d')](),_0x28fb57[_0x59fb('0x2e')]));}})});router[_0x59fb('0x23')]('/:id/customer_avatar',upload[_0x59fb('0x33')]('file'),controller[_0x59fb('0x35')]);var upload=multer({'storage':multer[_0x59fb('0x27')]({'destination':function(_0xc90d9,_0x214aa1,_0x385eeb){_0x385eeb(null,path[_0x59fb('0x28')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x179d42,_0x596382,_0x2d68c3){_0x2d68c3(null,util[_0x59fb('0x2b')]('%s-%s',Date[_0x59fb('0x2d')](),_0x596382[_0x59fb('0x2e')]));}})});router['post'](_0x59fb('0x15'),upload['single'](_0x59fb('0x30')),controller['addSystemAvatar']);router['post'](_0x59fb('0x36'),controller[_0x59fb('0x37')]);router[_0x59fb('0x23')](_0x59fb('0x38'),controller['offline']);router[_0x59fb('0x23')](_0x59fb('0x17'),auth[_0x59fb('0xc')](),controller[_0x59fb('0x39')]);router[_0x59fb('0x23')](_0x59fb('0x19'),auth['isAuthenticated'](),controller[_0x59fb('0x3a')]);router[_0x59fb('0x23')](_0x59fb('0x1b'),auth[_0x59fb('0xc')](),controller[_0x59fb('0x3b')]);router[_0x59fb('0x23')](_0x59fb('0x21'),auth[_0x59fb('0xc')](),controller[_0x59fb('0x3c')]);router[_0x59fb('0x3d')](_0x59fb('0xe'),auth[_0x59fb('0xc')](),controller[_0x59fb('0x3e')]);router['delete'](_0x59fb('0xe'),auth[_0x59fb('0xc')](),controller[_0x59fb('0x3f')]);router[_0x59fb('0x40')](_0x59fb('0x10'),auth[_0x59fb('0xc')](),controller[_0x59fb('0x41')]);router[_0x59fb('0x40')](_0x59fb('0x25'),auth[_0x59fb('0xc')](),controller['removeAnswers']);router[_0x59fb('0x40')](_0x59fb('0x21'),auth[_0x59fb('0xc')](),controller['removeAgents']);module[_0x59fb('0x42')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index acf8da5..0910f22 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 _0xc812=['STRING','AmazonAWS','Google','sequelize','exports'];(function(_0x13ce4e,_0x415cbe){var _0x10ae02=function(_0x4e9f69){while(--_0x4e9f69){_0x13ce4e['push'](_0x13ce4e['shift']());}};_0x10ae02(++_0x415cbe);}(_0xc812,0xbc));var _0x2c81=function(_0x57df1b,_0x57c7dd){_0x57df1b=_0x57df1b-0x0;var _0x476a12=_0xc812[_0x57df1b];return _0x476a12;};'use strict';var Sequelize=require(_0x2c81('0x0'));module[_0x2c81('0x1')]={'name':{'type':Sequelize[_0x2c81('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0x2c81('0x3'),_0x2c81('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x2c81('0x2')]},'data2':{'type':Sequelize[_0x2c81('0x2')]}}; \ No newline at end of file +var _0xe548=['STRING','ENUM','AmazonAWS','sequelize','exports'];(function(_0x2052dc,_0x3841b6){var _0x30c5f5=function(_0x3d8f19){while(--_0x3d8f19){_0x2052dc['push'](_0x2052dc['shift']());}};_0x30c5f5(++_0x3841b6);}(_0xe548,0x184));var _0x8e54=function(_0x5df25b,_0x1bc928){_0x5df25b=_0x5df25b-0x0;var _0x19f252=_0xe548[_0x5df25b];return _0x19f252;};'use strict';var Sequelize=require(_0x8e54('0x0'));module[_0x8e54('0x1')]={'name':{'type':Sequelize[_0x8e54('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x8e54('0x3')](_0x8e54('0x4'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 231dc22..dfea48c 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 _0xae3a=['keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','params','find','create','body','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','map','CloudProvider','rawAttributes','key','query'];(function(_0x334f9a,_0x542f01){var _0x2b219d=function(_0x25bb3e){while(--_0x25bb3e){_0x334f9a['push'](_0x334f9a['shift']());}};_0x2b219d(++_0x542f01);}(_0xae3a,0xe7));var _0xaae3=function(_0x345a17,_0x3b9d2a){_0x345a17=_0x345a17-0x0;var _0xd0f947=_0xae3a[_0x345a17];return _0xd0f947;};'use strict';var pdf=require(_0xaae3('0x0'));var emlformat=require(_0xaae3('0x1'));var rimraf=require(_0xaae3('0x2'));var zipdir=require(_0xaae3('0x3'));var jsonpatch=require(_0xaae3('0x4'));var rp=require(_0xaae3('0x5'));var moment=require(_0xaae3('0x6'));var BPromise=require(_0xaae3('0x7'));var Mustache=require(_0xaae3('0x8'));var util=require(_0xaae3('0x9'));var path=require('path');var sox=require(_0xaae3('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xaae3('0xb'));var squel=require(_0xaae3('0xc'));var crypto=require(_0xaae3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xaae3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaae3('0xf'));var Papa=require('papaparse');var Redis=require(_0xaae3('0x10'));var authService=require(_0xaae3('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaae3('0x12'));var hardwareService=require(_0xaae3('0x13'));var logger=require('../../config/logger')(_0xaae3('0x14'));var utils=require(_0xaae3('0x15'));var config=require(_0xaae3('0x16'));var db=require(_0xaae3('0x17'))['db'];function respondWithStatusCode(_0x18eb24,_0x4c570b){_0x4c570b=_0x4c570b||0xcc;return function(_0x3d99c7){if(_0x3d99c7){return _0x18eb24[_0xaae3('0x18')](_0x4c570b);}return _0x18eb24[_0xaae3('0x19')](_0x4c570b)[_0xaae3('0x1a')]();};}function respondWithResult(_0x3b2d3f,_0x4bb6c0){_0x4bb6c0=_0x4bb6c0||0xc8;return function(_0x5c3754){if(_0x5c3754){return _0x3b2d3f[_0xaae3('0x19')](_0x4bb6c0)[_0xaae3('0x1b')](_0x5c3754);}};}function respondWithFilteredResult(_0x394a42,_0xbae5f6){return function(_0x3433a9){if(_0x3433a9){var _0x358cc9=_0x3433a9['count'],_0x3c6f13=_0xbae5f6['offset'],_0x5dd4b2=_0xbae5f6[_0xaae3('0x1c')]+_0xbae5f6[_0xaae3('0x1d')],_0x345add;if(_0x5dd4b2>=_0x358cc9){_0x5dd4b2=_0x358cc9;_0x345add=0xc8;}else{_0x345add=0xce;}_0x394a42[_0xaae3('0x19')](_0x345add);return _0x394a42[_0xaae3('0x1e')](_0xaae3('0x1f'),_0x3c6f13+'-'+_0x5dd4b2+'/'+_0x358cc9)['json'](_0x3433a9);}return null;};}function patchUpdates(_0x348c8e){return function(_0x204425){try{jsonpatch['apply'](_0x204425,_0x348c8e,!![]);}catch(_0x2de599){return BPromise[_0xaae3('0x20')](_0x2de599);}return _0x204425[_0xaae3('0x21')]();};}function saveUpdates(_0x40a2e7,_0x2e7eda){return function(_0x1a6783){if(_0x1a6783){return _0x1a6783[_0xaae3('0x22')](_0x40a2e7)[_0xaae3('0x23')](function(_0x32c167){return _0x32c167;});}return null;};}function removeEntity(_0x515383,_0x1162e2){return function(_0x45272c){if(_0x45272c){return _0x45272c[_0xaae3('0x24')]()[_0xaae3('0x23')](function(){_0x515383[_0xaae3('0x19')](0xcc)[_0xaae3('0x1a')]();});}};}function handleEntityNotFound(_0x29683f,_0x16777d){return function(_0x5e642f){if(!_0x5e642f){_0x29683f[_0xaae3('0x18')](0x194);}return _0x5e642f;};}function handleError(_0x3fa1fa,_0x49b27b){_0x49b27b=_0x49b27b||0x1f4;return function(_0x3d0201){logger[_0xaae3('0x25')](_0x3d0201['stack']);if(_0x3d0201[_0xaae3('0x26')]){delete _0x3d0201[_0xaae3('0x26')];}_0x3fa1fa['status'](_0x49b27b)[_0xaae3('0x27')](_0x3d0201);};}exports['index']=function(_0x2ef0ae,_0x47911c){var _0x287f84={},_0x50ff78={},_0xe0de02={'count':0x0,'rows':[]};var _0xe67ad8=_[_0xaae3('0x28')](db[_0xaae3('0x29')][_0xaae3('0x2a')],function(_0x5c5ea8){return{'name':_0x5c5ea8['fieldName'],'type':_0x5c5ea8['type'][_0xaae3('0x2b')]};});_0x50ff78['model']=_[_0xaae3('0x28')](_0xe67ad8,_0xaae3('0x26'));_0x50ff78[_0xaae3('0x2c')]=_[_0xaae3('0x2d')](_0x2ef0ae[_0xaae3('0x2c')]);_0x50ff78[_0xaae3('0x2e')]=_['intersection'](_0x50ff78[_0xaae3('0x2f')],_0x50ff78[_0xaae3('0x2c')]);_0x287f84[_0xaae3('0x30')]=_[_0xaae3('0x31')](_0x50ff78[_0xaae3('0x2f')],qs[_0xaae3('0x32')](_0x2ef0ae[_0xaae3('0x2c')][_0xaae3('0x32')]));_0x287f84[_0xaae3('0x30')]=_0x287f84[_0xaae3('0x30')][_0xaae3('0x33')]?_0x287f84[_0xaae3('0x30')]:_0x50ff78['model'];if(!_0x2ef0ae['query'][_0xaae3('0x34')](_0xaae3('0x35'))){_0x287f84[_0xaae3('0x1d')]=qs[_0xaae3('0x1d')](_0x2ef0ae[_0xaae3('0x2c')][_0xaae3('0x1d')]);_0x287f84[_0xaae3('0x1c')]=qs['offset'](_0x2ef0ae[_0xaae3('0x2c')][_0xaae3('0x1c')]);}_0x287f84['order']=qs[_0xaae3('0x36')](_0x2ef0ae[_0xaae3('0x2c')]['sort']);_0x287f84[_0xaae3('0x37')]=qs[_0xaae3('0x2e')](_[_0xaae3('0x38')](_0x2ef0ae[_0xaae3('0x2c')],_0x50ff78['filters']),_0xe67ad8);if(_0x2ef0ae[_0xaae3('0x2c')][_0xaae3('0x39')]){_0x287f84['where']=_['merge'](_0x287f84[_0xaae3('0x37')],{'$or':_['map'](_0xe67ad8,function(_0x2cbf96){if(_0x2cbf96['type']!=='VIRTUAL'){var _0x494a58={};_0x494a58[_0x2cbf96[_0xaae3('0x26')]]={'$like':'%'+_0x2ef0ae['query'][_0xaae3('0x39')]+'%'};return _0x494a58;}})});}_0x287f84=_[_0xaae3('0x3a')]({},_0x287f84,_0x2ef0ae[_0xaae3('0x3b')]);var _0x1724f7={'where':_0x287f84[_0xaae3('0x37')]};return db[_0xaae3('0x29')][_0xaae3('0x3c')](_0x1724f7)['then'](function(_0x31f0f5){_0xe0de02[_0xaae3('0x3c')]=_0x31f0f5;if(_0x2ef0ae[_0xaae3('0x2c')][_0xaae3('0x3d')]){_0x287f84[_0xaae3('0x3e')]=[{'all':!![]}];}return db['CloudProvider'][_0xaae3('0x3f')](_0x287f84);})['then'](function(_0x4b785c){_0xe0de02['rows']=_0x4b785c;return _0xe0de02;})[_0xaae3('0x23')](respondWithFilteredResult(_0x47911c,_0x287f84))['catch'](handleError(_0x47911c,null));};exports['show']=function(_0x4889e2,_0xe9c49d){var _0x2cf11f={'raw':!![],'where':{'id':_0x4889e2[_0xaae3('0x40')]['id']}},_0x3ef5af={};_0x3ef5af[_0xaae3('0x2f')]=_[_0xaae3('0x2d')](db['CloudProvider']['rawAttributes']);_0x3ef5af[_0xaae3('0x2c')]=_[_0xaae3('0x2d')](_0x4889e2[_0xaae3('0x2c')]);_0x3ef5af[_0xaae3('0x2e')]=_[_0xaae3('0x31')](_0x3ef5af['model'],_0x3ef5af[_0xaae3('0x2c')]);_0x2cf11f['attributes']=_[_0xaae3('0x31')](_0x3ef5af['model'],qs[_0xaae3('0x32')](_0x4889e2['query']['fields']));_0x2cf11f[_0xaae3('0x30')]=_0x2cf11f[_0xaae3('0x30')][_0xaae3('0x33')]?_0x2cf11f[_0xaae3('0x30')]:_0x3ef5af[_0xaae3('0x2f')];if(_0x4889e2['query']['includeAll']){_0x2cf11f[_0xaae3('0x3e')]=[{'all':!![]}];}_0x2cf11f=_['merge']({},_0x2cf11f,_0x4889e2[_0xaae3('0x3b')]);return db[_0xaae3('0x29')][_0xaae3('0x41')](_0x2cf11f)[_0xaae3('0x23')](handleEntityNotFound(_0xe9c49d,null))[_0xaae3('0x23')](respondWithResult(_0xe9c49d,null))['catch'](handleError(_0xe9c49d,null));};exports[_0xaae3('0x42')]=function(_0x3248d0,_0x389223){return db[_0xaae3('0x29')][_0xaae3('0x42')](_0x3248d0[_0xaae3('0x43')],{})[_0xaae3('0x23')](respondWithResult(_0x389223,0xc9))[_0xaae3('0x44')](handleError(_0x389223,null));};exports[_0xaae3('0x22')]=function(_0x2c1b63,_0x16828a){if(_0x2c1b63['body']['id']){delete _0x2c1b63[_0xaae3('0x43')]['id'];}return db['CloudProvider'][_0xaae3('0x41')]({'where':{'id':_0x2c1b63[_0xaae3('0x40')]['id']}})[_0xaae3('0x23')](handleEntityNotFound(_0x16828a,null))[_0xaae3('0x23')](saveUpdates(_0x2c1b63[_0xaae3('0x43')],null))['then'](respondWithResult(_0x16828a,null))['catch'](handleError(_0x16828a,null));};exports['destroy']=function(_0x130014,_0x501e07){return db[_0xaae3('0x29')][_0xaae3('0x41')]({'where':{'id':_0x130014['params']['id']}})[_0xaae3('0x23')](handleEntityNotFound(_0x501e07,null))['then'](removeEntity(_0x501e07,null))[_0xaae3('0x44')](handleError(_0x501e07,null));}; \ No newline at end of file +var _0x1727=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','stack','name','send','index','rawAttributes','fieldName','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','type','filter','merge','options','CloudProvider','count','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto'];(function(_0x2145fa,_0x2eedac){var _0x996cd2=function(_0x209377){while(--_0x209377){_0x2145fa['push'](_0x2145fa['shift']());}};_0x996cd2(++_0x2eedac);}(_0x1727,0xce));var _0x7172=function(_0x58d62c,_0x31e591){_0x58d62c=_0x58d62c-0x0;var _0x353a82=_0x1727[_0x58d62c];return _0x353a82;};'use strict';var pdf=require(_0x7172('0x0'));var emlformat=require(_0x7172('0x1'));var rimraf=require(_0x7172('0x2'));var zipdir=require(_0x7172('0x3'));var jsonpatch=require(_0x7172('0x4'));var rp=require('request-promise');var moment=require(_0x7172('0x5'));var BPromise=require(_0x7172('0x6'));var Mustache=require(_0x7172('0x7'));var util=require('util');var path=require(_0x7172('0x8'));var sox=require(_0x7172('0x9'));var csv=require(_0x7172('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7172('0xb'));var squel=require('squel');var crypto=require(_0x7172('0xc'));var jsforce=require(_0x7172('0xd'));var deskjs=require(_0x7172('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7172('0xf'));var Papa=require(_0x7172('0x10'));var Redis=require(_0x7172('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7172('0x12'));var as=require(_0x7172('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7172('0x14'));var utils=require(_0x7172('0x15'));var config=require(_0x7172('0x16'));var db=require(_0x7172('0x17'))['db'];function respondWithStatusCode(_0x1699b9,_0x576030){_0x576030=_0x576030||0xcc;return function(_0x167a77){if(_0x167a77){return _0x1699b9[_0x7172('0x18')](_0x576030);}return _0x1699b9[_0x7172('0x19')](_0x576030)[_0x7172('0x1a')]();};}function respondWithResult(_0x4657b1,_0x345070){_0x345070=_0x345070||0xc8;return function(_0x40b371){if(_0x40b371){return _0x4657b1[_0x7172('0x19')](_0x345070)[_0x7172('0x1b')](_0x40b371);}};}function respondWithFilteredResult(_0x3183dc,_0x43cc57){return function(_0xfe0fb6){if(_0xfe0fb6){var _0x544c11=_0xfe0fb6['count'],_0x5a6dad=_0x43cc57['offset'],_0x53a950=_0x43cc57[_0x7172('0x1c')]+_0x43cc57[_0x7172('0x1d')],_0x665712;if(_0x53a950>=_0x544c11){_0x53a950=_0x544c11;_0x665712=0xc8;}else{_0x665712=0xce;}_0x3183dc[_0x7172('0x19')](_0x665712);return _0x3183dc[_0x7172('0x1e')]('Content-Range',_0x5a6dad+'-'+_0x53a950+'/'+_0x544c11)[_0x7172('0x1b')](_0xfe0fb6);}return null;};}function patchUpdates(_0x48ec21){return function(_0x1ef9d6){try{jsonpatch[_0x7172('0x1f')](_0x1ef9d6,_0x48ec21,!![]);}catch(_0xecdde2){return BPromise[_0x7172('0x20')](_0xecdde2);}return _0x1ef9d6[_0x7172('0x21')]();};}function saveUpdates(_0x4d4946,_0xf1cac8){return function(_0x418e40){if(_0x418e40){return _0x418e40[_0x7172('0x22')](_0x4d4946)[_0x7172('0x23')](function(_0x355680){return _0x355680;});}return null;};}function removeEntity(_0x58b797,_0x1521c5){return function(_0x1a0b02){if(_0x1a0b02){return _0x1a0b02['destroy']()[_0x7172('0x23')](function(){_0x58b797[_0x7172('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38f683,_0x3faeb9){return function(_0x5730b1){if(!_0x5730b1){_0x38f683['sendStatus'](0x194);}return _0x5730b1;};}function handleError(_0x394112,_0x528b31){_0x528b31=_0x528b31||0x1f4;return function(_0x5d3359){logger['error'](_0x5d3359[_0x7172('0x24')]);if(_0x5d3359[_0x7172('0x25')]){delete _0x5d3359['name'];}_0x394112[_0x7172('0x19')](_0x528b31)[_0x7172('0x26')](_0x5d3359);};}exports[_0x7172('0x27')]=function(_0x579e09,_0x263a17){var _0x5d16c7={},_0x3de7ba={},_0x4c89ce={'count':0x0,'rows':[]};var _0x244793=_['map'](db['CloudProvider'][_0x7172('0x28')],function(_0x32874){return{'name':_0x32874[_0x7172('0x29')],'type':_0x32874['type'][_0x7172('0x2a')]};});_0x3de7ba[_0x7172('0x2b')]=_[_0x7172('0x2c')](_0x244793,_0x7172('0x25'));_0x3de7ba[_0x7172('0x2d')]=_['keys'](_0x579e09[_0x7172('0x2d')]);_0x3de7ba['filters']=_['intersection'](_0x3de7ba[_0x7172('0x2b')],_0x3de7ba[_0x7172('0x2d')]);_0x5d16c7[_0x7172('0x2e')]=_[_0x7172('0x2f')](_0x3de7ba['model'],qs[_0x7172('0x30')](_0x579e09[_0x7172('0x2d')][_0x7172('0x30')]));_0x5d16c7[_0x7172('0x2e')]=_0x5d16c7[_0x7172('0x2e')][_0x7172('0x31')]?_0x5d16c7[_0x7172('0x2e')]:_0x3de7ba[_0x7172('0x2b')];if(!_0x579e09[_0x7172('0x2d')][_0x7172('0x32')](_0x7172('0x33'))){_0x5d16c7[_0x7172('0x1d')]=qs[_0x7172('0x1d')](_0x579e09[_0x7172('0x2d')][_0x7172('0x1d')]);_0x5d16c7['offset']=qs[_0x7172('0x1c')](_0x579e09[_0x7172('0x2d')][_0x7172('0x1c')]);}_0x5d16c7[_0x7172('0x34')]=qs[_0x7172('0x35')](_0x579e09[_0x7172('0x2d')][_0x7172('0x35')]);_0x5d16c7[_0x7172('0x36')]=qs[_0x7172('0x37')](_['pick'](_0x579e09[_0x7172('0x2d')],_0x3de7ba[_0x7172('0x37')]),_0x244793);if(_0x579e09[_0x7172('0x2d')]['filter']){_0x5d16c7[_0x7172('0x36')]=_['merge'](_0x5d16c7[_0x7172('0x36')],{'$or':_[_0x7172('0x2c')](_0x244793,function(_0x2af107){if(_0x2af107[_0x7172('0x38')]!=='VIRTUAL'){var _0x5864d7={};_0x5864d7[_0x2af107['name']]={'$like':'%'+_0x579e09[_0x7172('0x2d')][_0x7172('0x39')]+'%'};return _0x5864d7;}})});}_0x5d16c7=_[_0x7172('0x3a')]({},_0x5d16c7,_0x579e09[_0x7172('0x3b')]);var _0x4e7a08={'where':_0x5d16c7['where']};return db[_0x7172('0x3c')][_0x7172('0x3d')](_0x4e7a08)[_0x7172('0x23')](function(_0xef0d56){_0x4c89ce[_0x7172('0x3d')]=_0xef0d56;if(_0x579e09[_0x7172('0x2d')]['includeAll']){_0x5d16c7[_0x7172('0x3e')]=[{'all':!![]}];}return db[_0x7172('0x3c')][_0x7172('0x3f')](_0x5d16c7);})['then'](function(_0x4753ae){_0x4c89ce[_0x7172('0x40')]=_0x4753ae;return _0x4c89ce;})['then'](respondWithFilteredResult(_0x263a17,_0x5d16c7))[_0x7172('0x41')](handleError(_0x263a17,null));};exports[_0x7172('0x42')]=function(_0x30ede6,_0x4e8c3c){var _0x20e58b={'raw':!![],'where':{'id':_0x30ede6[_0x7172('0x43')]['id']}},_0x6a2a40={};_0x6a2a40[_0x7172('0x2b')]=_[_0x7172('0x44')](db[_0x7172('0x3c')]['rawAttributes']);_0x6a2a40[_0x7172('0x2d')]=_[_0x7172('0x44')](_0x30ede6[_0x7172('0x2d')]);_0x6a2a40[_0x7172('0x37')]=_['intersection'](_0x6a2a40[_0x7172('0x2b')],_0x6a2a40[_0x7172('0x2d')]);_0x20e58b[_0x7172('0x2e')]=_[_0x7172('0x2f')](_0x6a2a40[_0x7172('0x2b')],qs[_0x7172('0x30')](_0x30ede6[_0x7172('0x2d')]['fields']));_0x20e58b[_0x7172('0x2e')]=_0x20e58b[_0x7172('0x2e')]['length']?_0x20e58b[_0x7172('0x2e')]:_0x6a2a40[_0x7172('0x2b')];if(_0x30ede6['query'][_0x7172('0x45')]){_0x20e58b[_0x7172('0x3e')]=[{'all':!![]}];}_0x20e58b=_['merge']({},_0x20e58b,_0x30ede6[_0x7172('0x3b')]);return db[_0x7172('0x3c')][_0x7172('0x46')](_0x20e58b)[_0x7172('0x23')](handleEntityNotFound(_0x4e8c3c,null))['then'](respondWithResult(_0x4e8c3c,null))[_0x7172('0x41')](handleError(_0x4e8c3c,null));};exports[_0x7172('0x47')]=function(_0x4d0c2d,_0x1e6ac7){return db[_0x7172('0x3c')][_0x7172('0x47')](_0x4d0c2d[_0x7172('0x48')],{})['then'](respondWithResult(_0x1e6ac7,0xc9))[_0x7172('0x41')](handleError(_0x1e6ac7,null));};exports[_0x7172('0x22')]=function(_0x5d9f05,_0xf35094){if(_0x5d9f05[_0x7172('0x48')]['id']){delete _0x5d9f05['body']['id'];}return db[_0x7172('0x3c')][_0x7172('0x46')]({'where':{'id':_0x5d9f05['params']['id']}})['then'](handleEntityNotFound(_0xf35094,null))['then'](saveUpdates(_0x5d9f05['body'],null))[_0x7172('0x23')](respondWithResult(_0xf35094,null))[_0x7172('0x41')](handleError(_0xf35094,null));};exports['destroy']=function(_0x5e3d15,_0x269028){return db[_0x7172('0x3c')][_0x7172('0x46')]({'where':{'id':_0x5e3d15[_0x7172('0x43')]['id']}})[_0x7172('0x23')](handleEntityNotFound(_0x269028,null))[_0x7172('0x23')](removeEntity(_0x269028,null))[_0x7172('0x41')](handleError(_0x269028,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 9bfa45b..df65596 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 _0x5d05=['CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cloudProvider.attributes','exports','define'];(function(_0x4ae399,_0x16988b){var _0x331009=function(_0x4d79e4){while(--_0x4d79e4){_0x4ae399['push'](_0x4ae399['shift']());}};_0x331009(++_0x16988b);}(_0x5d05,0x136));var _0x55d0=function(_0x487683,_0x58b9b8){_0x487683=_0x487683-0x0;var _0x178a4d=_0x5d05[_0x487683];return _0x178a4d;};'use strict';var _=require(_0x55d0('0x0'));var util=require(_0x55d0('0x1'));var logger=require(_0x55d0('0x2'))(_0x55d0('0x3'));var moment=require(_0x55d0('0x4'));var BPromise=require(_0x55d0('0x5'));var rp=require(_0x55d0('0x6'));var fs=require('fs');var path=require(_0x55d0('0x7'));var rimraf=require(_0x55d0('0x8'));var config=require('../../config/environment');var attributes=require(_0x55d0('0x9'));module[_0x55d0('0xa')]=function(_0x513bb2,_0x53709b){return _0x513bb2[_0x55d0('0xb')](_0x55d0('0xc'),attributes,{'tableName':_0x55d0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8899=['./cloudProvider.attributes','exports','cloud_providers','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1d908b,_0x4abdba){var _0x13559a=function(_0x4bb5f7){while(--_0x4bb5f7){_0x1d908b['push'](_0x1d908b['shift']());}};_0x13559a(++_0x4abdba);}(_0x8899,0x14d));var _0x9889=function(_0x527869,_0x60f7d2){_0x527869=_0x527869-0x0;var _0x1875ab=_0x8899[_0x527869];return _0x1875ab;};'use strict';var _=require(_0x9889('0x0'));var util=require('util');var logger=require(_0x9889('0x1'))('api');var moment=require(_0x9889('0x2'));var BPromise=require(_0x9889('0x3'));var rp=require(_0x9889('0x4'));var fs=require('fs');var path=require(_0x9889('0x5'));var rimraf=require(_0x9889('0x6'));var config=require(_0x9889('0x7'));var attributes=require(_0x9889('0x8'));module[_0x9889('0x9')]=function(_0x1e9cc9,_0x314a48){return _0x1e9cc9['define']('CloudProvider',attributes,{'tableName':_0x9889('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index d6e0ff4..807c85a 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 _0x0314=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','jayson/promise','client','request','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result'];(function(_0x4b9be3,_0x335526){var _0x259008=function(_0x2ace34){while(--_0x2ace34){_0x4b9be3['push'](_0x4b9be3['shift']());}};_0x259008(++_0x335526);}(_0x0314,0xf1));var _0x4031=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0314[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4031('0x0'));var util=require(_0x4031('0x1'));var moment=require(_0x4031('0x2'));var BPromise=require(_0x4031('0x3'));var rs=require(_0x4031('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4031('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4031('0x6'));var client=jayson[_0x4031('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d7d2e,_0x5a35ab,_0x935b84){return new BPromise(function(_0x3be051,_0x55e072){return client[_0x4031('0x8')](_0x5d7d2e,_0x935b84)['then'](function(_0x3619b4){logger[_0x4031('0x9')]('CloudProvider,\x20%s,\x20%s',_0x5a35ab,_0x4031('0xa'));logger[_0x4031('0xb')](_0x4031('0xc'),_0x5a35ab,_0x4031('0xa'),JSON[_0x4031('0xd')](_0x3619b4));if(_0x3619b4['error']){if(_0x3619b4[_0x4031('0xe')][_0x4031('0xf')]===0x1f4){logger[_0x4031('0xe')](_0x4031('0x10'),_0x5a35ab,_0x3619b4[_0x4031('0xe')][_0x4031('0x11')]);return _0x55e072(_0x3619b4[_0x4031('0xe')][_0x4031('0x11')]);}logger['error'](_0x4031('0x10'),_0x5a35ab,_0x3619b4[_0x4031('0xe')][_0x4031('0x11')]);return _0x3be051(_0x3619b4[_0x4031('0xe')]['message']);}else{logger['info'](_0x4031('0x10'),_0x5a35ab,_0x4031('0xa'));_0x3be051(_0x3619b4[_0x4031('0x12')][_0x4031('0x11')]);}})[_0x4031('0x13')](function(_0xd025b4){logger[_0x4031('0xe')](_0x4031('0x10'),_0x5a35ab,_0xd025b4);_0x55e072(_0xd025b4);});});} \ No newline at end of file +var _0x9c23=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','http','request','then','info','CloudProvider,\x20%s,\x20%s'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x9c23,0x72));var _0x39c2=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0x9c23[_0x255ac0];return _0x437bf1;};'use strict';var _=require('lodash');var util=require(_0x39c2('0x0'));var moment=require(_0x39c2('0x1'));var BPromise=require(_0x39c2('0x2'));var rs=require(_0x39c2('0x3'));var fs=require('fs');var Redis=require(_0x39c2('0x4'));var db=require(_0x39c2('0x5'))['db'];var utils=require(_0x39c2('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x39c2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x35a5eb,_0x14fe82,_0x5d6e60){return new BPromise(function(_0x2b6c5c,_0x269c16){return client[_0x39c2('0x8')](_0x35a5eb,_0x5d6e60)[_0x39c2('0x9')](function(_0x56a21b){logger[_0x39c2('0xa')](_0x39c2('0xb'),_0x14fe82,'request\x20sent');logger[_0x39c2('0xc')](_0x39c2('0xd'),_0x14fe82,'request\x20sent',JSON[_0x39c2('0xe')](_0x56a21b));if(_0x56a21b[_0x39c2('0xf')]){if(_0x56a21b[_0x39c2('0xf')][_0x39c2('0x10')]===0x1f4){logger[_0x39c2('0xf')](_0x39c2('0xb'),_0x14fe82,_0x56a21b[_0x39c2('0xf')][_0x39c2('0x11')]);return _0x269c16(_0x56a21b['error'][_0x39c2('0x11')]);}logger[_0x39c2('0xf')](_0x39c2('0xb'),_0x14fe82,_0x56a21b[_0x39c2('0xf')]['message']);return _0x2b6c5c(_0x56a21b[_0x39c2('0xf')][_0x39c2('0x11')]);}else{logger['info'](_0x39c2('0xb'),_0x14fe82,_0x39c2('0x12'));_0x2b6c5c(_0x56a21b[_0x39c2('0x13')][_0x39c2('0x11')]);}})[_0x39c2('0x14')](function(_0x201690){logger[_0x39c2('0xf')](_0x39c2('0xb'),_0x14fe82,_0x201690);_0x269c16(_0x201690);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index eaca87b..bed7a86 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 _0xc1af=['util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','multer'];(function(_0x5ae7c8,_0x6e2a7b){var _0x48eb9d=function(_0x1c4d06){while(--_0x1c4d06){_0x5ae7c8['push'](_0x5ae7c8['shift']());}};_0x48eb9d(++_0x6e2a7b);}(_0xc1af,0xc5));var _0xfc1a=function(_0x333164,_0x150169){_0x333164=_0x333164-0x0;var _0x5efc4=_0xc1af[_0x333164];return _0x5efc4;};'use strict';var multer=require(_0xfc1a('0x0'));var util=require(_0xfc1a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfc1a('0x2')]();var auth=require(_0xfc1a('0x3'));var interaction=require(_0xfc1a('0x4'));var config=require(_0xfc1a('0x5'));var controller=require(_0xfc1a('0x6'));router[_0xfc1a('0x7')]('/',auth['isAuthenticated'](),controller[_0xfc1a('0x8')]);router[_0xfc1a('0x7')]('/:id',auth[_0xfc1a('0x9')](),controller[_0xfc1a('0xa')]);router[_0xfc1a('0xb')]('/',auth[_0xfc1a('0x9')](),controller[_0xfc1a('0xc')]);router[_0xfc1a('0xd')](_0xfc1a('0xe'),auth['isAuthenticated'](),controller[_0xfc1a('0xf')]);router[_0xfc1a('0x10')](_0xfc1a('0xe'),auth[_0xfc1a('0x9')](),controller[_0xfc1a('0x11')]);module['exports']=router; \ No newline at end of file +var _0xbc05=['exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','post','put','update','delete'];(function(_0x3dd468,_0x285a43){var _0x3852c4=function(_0x36b275){while(--_0x36b275){_0x3dd468['push'](_0x3dd468['shift']());}};_0x3852c4(++_0x285a43);}(_0xbc05,0x6a));var _0x5bc0=function(_0x29acb2,_0x358426){_0x29acb2=_0x29acb2-0x0;var _0x2e48b=_0xbc05[_0x29acb2];return _0x2e48b;};'use strict';var multer=require(_0x5bc0('0x0'));var util=require('util');var path=require(_0x5bc0('0x1'));var timeout=require(_0x5bc0('0x2'));var express=require('express');var router=express[_0x5bc0('0x3')]();var auth=require(_0x5bc0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5bc0('0x5'));var controller=require('./cloudProvider.controller');router[_0x5bc0('0x6')]('/',auth['isAuthenticated'](),controller[_0x5bc0('0x7')]);router['get'](_0x5bc0('0x8'),auth[_0x5bc0('0x9')](),controller['show']);router[_0x5bc0('0xa')]('/',auth[_0x5bc0('0x9')](),controller['create']);router[_0x5bc0('0xb')](_0x5bc0('0x8'),auth[_0x5bc0('0x9')](),controller[_0x5bc0('0xc')]);router[_0x5bc0('0xd')](_0x5bc0('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x5bc0('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index b4c2618..233db26 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 _0x0683=['name','sequelize','STRING'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x0683,0xd6));var _0x3068=function(_0x3d0856,_0xc8a17){_0x3d0856=_0x3d0856-0x0;var _0x470ff9=_0x0683[_0x3d0856];return _0x470ff9;};'use strict';var Sequelize=require(_0x3068('0x0'));module['exports']={'name':{'type':Sequelize[_0x3068('0x1')],'unique':_0x3068('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x3068('0x1')]},'phone':{'type':Sequelize[_0x3068('0x1')]},'fax':{'type':Sequelize[_0x3068('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x3068('0x1')]},'postalCode':{'type':Sequelize[_0x3068('0x1')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x3068('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x3068('0x1')]},'sStreet':{'type':Sequelize[_0x3068('0x1')]},'sPostalCode':{'type':Sequelize[_0x3068('0x1')]},'sCity':{'type':Sequelize[_0x3068('0x1')]},'sCountry':{'type':Sequelize[_0x3068('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x914f=['name','sequelize','exports','STRING'];(function(_0x119e7a,_0x2e09d9){var _0x2f29d4=function(_0x1c43cb){while(--_0x1c43cb){_0x119e7a['push'](_0x119e7a['shift']());}};_0x2f29d4(++_0x2e09d9);}(_0x914f,0x149));var _0xf914=function(_0x33bad7,_0x523b96){_0x33bad7=_0x33bad7-0x0;var _0xa8175=_0x914f[_0x33bad7];return _0xa8175;};'use strict';var Sequelize=require(_0xf914('0x0'));module[_0xf914('0x1')]={'name':{'type':Sequelize[_0xf914('0x2')],'unique':_0xf914('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xf914('0x2')]},'companyId':{'type':Sequelize[_0xf914('0x2')]},'website':{'type':Sequelize[_0xf914('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xf914('0x2')]},'email':{'type':Sequelize[_0xf914('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xf914('0x2')]},'sStreet':{'type':Sequelize[_0xf914('0x2')]},'sPostalCode':{'type':Sequelize[_0xf914('0x2')]},'sCity':{'type':Sequelize[_0xf914('0x2')]},'sCountry':{'type':Sequelize[_0xf914('0x2')]},'description':{'type':Sequelize[_0xf914('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index b11db41..4d62dc8 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 _0xb5f7=['destroy','get','Companies','UserProfileResource','error','stack','name','index','CmCompany','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','count','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addContacts','ids','omit','getContacts','CmContact','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','status','json','offset','limit','Content-Range','reject','save','update','then'];(function(_0x10cb75,_0x480729){var _0x586c0f=function(_0x4d55ce){while(--_0x4d55ce){_0x10cb75['push'](_0x10cb75['shift']());}};_0x586c0f(++_0x480729);}(_0xb5f7,0x181));var _0x7b5f=function(_0x55a9a8,_0x61a948){_0x55a9a8=_0x55a9a8-0x0;var _0x5d3812=_0xb5f7[_0x55a9a8];return _0x5d3812;};'use strict';var pdf=require(_0x7b5f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7b5f('0x1'));var jsonpatch=require(_0x7b5f('0x2'));var rp=require(_0x7b5f('0x3'));var moment=require(_0x7b5f('0x4'));var BPromise=require(_0x7b5f('0x5'));var Mustache=require(_0x7b5f('0x6'));var util=require(_0x7b5f('0x7'));var path=require(_0x7b5f('0x8'));var sox=require(_0x7b5f('0x9'));var csv=require('to-csv');var ejs=require(_0x7b5f('0xa'));var fs=require('fs');var _=require(_0x7b5f('0xb'));var squel=require(_0x7b5f('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7b5f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7b5f('0xe'));var Papa=require(_0x7b5f('0xf'));var Redis=require(_0x7b5f('0x10'));var authService=require(_0x7b5f('0x11'));var qs=require(_0x7b5f('0x12'));var as=require(_0x7b5f('0x13'));var hardwareService=require(_0x7b5f('0x14'));var logger=require(_0x7b5f('0x15'))(_0x7b5f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7b5f('0x17'))['db'];function respondWithStatusCode(_0x1a5fff,_0x4a51d3){_0x4a51d3=_0x4a51d3||0xcc;return function(_0x3b6bd2){if(_0x3b6bd2){return _0x1a5fff[_0x7b5f('0x18')](_0x4a51d3);}return _0x1a5fff['status'](_0x4a51d3)[_0x7b5f('0x19')]();};}function respondWithResult(_0x55678f,_0x1c8650){_0x1c8650=_0x1c8650||0xc8;return function(_0x20a51f){if(_0x20a51f){return _0x55678f[_0x7b5f('0x1a')](_0x1c8650)[_0x7b5f('0x1b')](_0x20a51f);}};}function respondWithFilteredResult(_0x1ed476,_0x432df3){return function(_0x13c947){if(_0x13c947){var _0x53e69e=_0x13c947['count'],_0x5568b1=_0x432df3['offset'],_0x8bde9e=_0x432df3[_0x7b5f('0x1c')]+_0x432df3[_0x7b5f('0x1d')],_0x48c7c9;if(_0x8bde9e>=_0x53e69e){_0x8bde9e=_0x53e69e;_0x48c7c9=0xc8;}else{_0x48c7c9=0xce;}_0x1ed476[_0x7b5f('0x1a')](_0x48c7c9);return _0x1ed476['set'](_0x7b5f('0x1e'),_0x5568b1+'-'+_0x8bde9e+'/'+_0x53e69e)[_0x7b5f('0x1b')](_0x13c947);}return null;};}function patchUpdates(_0xc8dbf5){return function(_0xe61f70){try{jsonpatch['apply'](_0xe61f70,_0xc8dbf5,!![]);}catch(_0x1bb90f){return BPromise[_0x7b5f('0x1f')](_0x1bb90f);}return _0xe61f70[_0x7b5f('0x20')]();};}function saveUpdates(_0x1e1300,_0x1373a0){return function(_0x52de9f){if(_0x52de9f){return _0x52de9f[_0x7b5f('0x21')](_0x1e1300)[_0x7b5f('0x22')](function(_0x234abc){return _0x234abc;});}return null;};}function removeEntity(_0x1b00f5,_0x14f3a4){return function(_0x43f47b){if(_0x43f47b){return _0x43f47b[_0x7b5f('0x23')]()['then'](function(){var _0x38cf63=_0x43f47b[_0x7b5f('0x24')]({'plain':!![]});var _0x167c3c=_0x7b5f('0x25');return db[_0x7b5f('0x26')][_0x7b5f('0x23')]({'where':{'type':_0x167c3c,'resourceId':_0x38cf63['id']}})[_0x7b5f('0x22')](function(){return _0x43f47b;});})[_0x7b5f('0x22')](function(){_0x1b00f5[_0x7b5f('0x1a')](0xcc)[_0x7b5f('0x19')]();});}};}function handleEntityNotFound(_0x24308e,_0x22cf70){return function(_0x193d64){if(!_0x193d64){_0x24308e[_0x7b5f('0x18')](0x194);}return _0x193d64;};}function handleError(_0x56134d,_0xee51db){_0xee51db=_0xee51db||0x1f4;return function(_0x1965e8){logger[_0x7b5f('0x27')](_0x1965e8[_0x7b5f('0x28')]);if(_0x1965e8[_0x7b5f('0x29')]){delete _0x1965e8[_0x7b5f('0x29')];}_0x56134d[_0x7b5f('0x1a')](_0xee51db)['send'](_0x1965e8);};}exports[_0x7b5f('0x2a')]=function(_0x425c5f,_0x526798){var _0xae6bf7={},_0x30b35b={},_0xcecb43={'count':0x0,'rows':[]};return db[_0x7b5f('0x2b')]['describe']()[_0x7b5f('0x22')](function(_0x50f44a){_0x30b35b[_0x7b5f('0x2c')]=_[_0x7b5f('0x2d')](_0x50f44a);_0x30b35b['query']=_[_0x7b5f('0x2d')](_0x425c5f[_0x7b5f('0x2e')]);_0x30b35b[_0x7b5f('0x2f')]=_['intersection'](_0x30b35b[_0x7b5f('0x2c')],_0x30b35b['query']);_0xae6bf7[_0x7b5f('0x30')]=_[_0x7b5f('0x31')](_0x30b35b[_0x7b5f('0x2c')],qs[_0x7b5f('0x32')](_0x425c5f[_0x7b5f('0x2e')]['fields']));_0xae6bf7[_0x7b5f('0x30')]=_0xae6bf7[_0x7b5f('0x30')][_0x7b5f('0x33')]?_0xae6bf7[_0x7b5f('0x30')]:_0x30b35b[_0x7b5f('0x2c')];if(!_0x425c5f[_0x7b5f('0x2e')][_0x7b5f('0x34')](_0x7b5f('0x35'))){_0xae6bf7['limit']=qs[_0x7b5f('0x1d')](_0x425c5f['query'][_0x7b5f('0x1d')]);_0xae6bf7[_0x7b5f('0x1c')]=qs[_0x7b5f('0x1c')](_0x425c5f['query'][_0x7b5f('0x1c')]);}_0xae6bf7[_0x7b5f('0x36')]=qs[_0x7b5f('0x37')](_0x425c5f[_0x7b5f('0x2e')][_0x7b5f('0x37')]);_0xae6bf7[_0x7b5f('0x38')]=qs['filters'](_[_0x7b5f('0x39')](_0x425c5f[_0x7b5f('0x2e')],_0x30b35b['filters']),_0x50f44a);if(_0x425c5f['query']['filter']){_0xae6bf7[_0x7b5f('0x38')]=_[_0x7b5f('0x3a')](_0xae6bf7['where'],{'$or':_[_0x7b5f('0x3b')](_0xae6bf7[_0x7b5f('0x30')],function(_0x32e5ec){var _0x5d5498={};_0x5d5498[_0x32e5ec]={'$like':'%'+_0x425c5f[_0x7b5f('0x2e')][_0x7b5f('0x3c')]+'%'};return _0x5d5498;})});}_0xae6bf7=_[_0x7b5f('0x3a')]({},_0xae6bf7,_0x425c5f[_0x7b5f('0x3d')]);var _0x5eb226={'where':_0xae6bf7[_0x7b5f('0x38')]};return db[_0x7b5f('0x2b')][_0x7b5f('0x3e')](_0x5eb226)[_0x7b5f('0x22')](function(_0x2a9b0e){_0xcecb43[_0x7b5f('0x3e')]=_0x2a9b0e;if(_0x425c5f[_0x7b5f('0x2e')]['includeAll']){_0xae6bf7['include']=[{'all':!![]}];}return db[_0x7b5f('0x2b')]['findAll'](_0xae6bf7);})[_0x7b5f('0x22')](function(_0x15e13e){_0xcecb43[_0x7b5f('0x3f')]=_0x15e13e;return _0xcecb43;})['then'](respondWithFilteredResult(_0x526798,_0xae6bf7))[_0x7b5f('0x40')](handleError(_0x526798,null));})['catch'](handleError(_0x526798,null));};exports[_0x7b5f('0x41')]=function(_0x5b9ee8,_0x132b36){var _0x50cb85={'raw':![],'where':{'id':_0x5b9ee8[_0x7b5f('0x42')]['id']}},_0x26e13f={};_0x26e13f['model']=_[_0x7b5f('0x2d')](db[_0x7b5f('0x2b')][_0x7b5f('0x43')]);_0x26e13f[_0x7b5f('0x2e')]=_['keys'](_0x5b9ee8[_0x7b5f('0x2e')]);_0x26e13f[_0x7b5f('0x2f')]=_[_0x7b5f('0x31')](_0x26e13f['model'],_0x26e13f[_0x7b5f('0x2e')]);_0x50cb85[_0x7b5f('0x30')]=_['intersection'](_0x26e13f['model'],qs['fields'](_0x5b9ee8['query'][_0x7b5f('0x32')]));_0x50cb85['attributes']=_0x50cb85['attributes'][_0x7b5f('0x33')]?_0x50cb85[_0x7b5f('0x30')]:_0x26e13f[_0x7b5f('0x2c')];if(_0x5b9ee8[_0x7b5f('0x2e')]['includeAll']){_0x50cb85[_0x7b5f('0x44')]=[{'all':!![]}];}_0x50cb85=_[_0x7b5f('0x3a')]({},_0x50cb85,_0x5b9ee8[_0x7b5f('0x3d')]);return db[_0x7b5f('0x2b')][_0x7b5f('0x45')](_0x50cb85)['then'](handleEntityNotFound(_0x132b36,null))[_0x7b5f('0x22')](respondWithResult(_0x132b36,null))[_0x7b5f('0x40')](handleError(_0x132b36,null));};exports['create']=function(_0x41b05b,_0x1e0c6f){return db[_0x7b5f('0x2b')][_0x7b5f('0x46')](_0x41b05b[_0x7b5f('0x47')],{})[_0x7b5f('0x22')](function(_0x22f9a1){var _0x14e5c6=_0x41b05b[_0x7b5f('0x48')][_0x7b5f('0x24')]({'plain':!![]});if(!_0x14e5c6)throw new Error(_0x7b5f('0x49'));if(_0x14e5c6[_0x7b5f('0x4a')]==='user'){var _0x859579=_0x22f9a1['get']({'plain':!![]});var _0x11ea59=_0x7b5f('0x25');return db[_0x7b5f('0x4b')]['find']({'where':{'name':_0x11ea59,'userProfileId':_0x14e5c6[_0x7b5f('0x4c')]},'raw':!![]})[_0x7b5f('0x22')](function(_0x162113){if(_0x162113&&_0x162113[_0x7b5f('0x4d')]===0x0){return db[_0x7b5f('0x26')][_0x7b5f('0x46')]({'name':_0x859579[_0x7b5f('0x29')],'resourceId':_0x859579['id'],'type':_0x162113[_0x7b5f('0x29')],'sectionId':_0x162113['id']},{})[_0x7b5f('0x22')](function(){return _0x22f9a1;});}else{return _0x22f9a1;}})[_0x7b5f('0x40')](function(_0x2628a2){logger[_0x7b5f('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2628a2);throw _0x2628a2;});}return _0x22f9a1;})[_0x7b5f('0x22')](respondWithResult(_0x1e0c6f,0xc9))[_0x7b5f('0x40')](handleError(_0x1e0c6f,null));};exports[_0x7b5f('0x21')]=function(_0x459041,_0x54a4c7){if(_0x459041['body']['id']){delete _0x459041[_0x7b5f('0x47')]['id'];}return db[_0x7b5f('0x2b')][_0x7b5f('0x45')]({'where':{'id':_0x459041[_0x7b5f('0x42')]['id']}})[_0x7b5f('0x22')](handleEntityNotFound(_0x54a4c7,null))[_0x7b5f('0x22')](saveUpdates(_0x459041[_0x7b5f('0x47')],null))[_0x7b5f('0x22')](respondWithResult(_0x54a4c7,null))['catch'](handleError(_0x54a4c7,null));};exports[_0x7b5f('0x23')]=function(_0x57df5b,_0x51590b){return db[_0x7b5f('0x2b')][_0x7b5f('0x45')]({'where':{'id':_0x57df5b['params']['id']}})[_0x7b5f('0x22')](handleEntityNotFound(_0x51590b,null))['then'](removeEntity(_0x51590b,null))[_0x7b5f('0x40')](handleError(_0x51590b,null));};exports['describe']=function(_0x159b7b,_0x5352a6){return db[_0x7b5f('0x2b')][_0x7b5f('0x4e')]()['then'](respondWithResult(_0x5352a6,null))[_0x7b5f('0x40')](handleError(_0x5352a6,null));};exports[_0x7b5f('0x4f')]=function(_0x23f04e,_0x440936,_0x2d356a){return db['CmContact']['find']({'where':{'id':_0x23f04e['params']['id']}})[_0x7b5f('0x22')](handleEntityNotFound(_0x440936,null))[_0x7b5f('0x22')](function(_0x439fc7){if(_0x439fc7){return _0x439fc7[_0x7b5f('0x4f')](_0x23f04e[_0x7b5f('0x47')][_0x7b5f('0x50')],_[_0x7b5f('0x51')](_0x23f04e[_0x7b5f('0x47')],[_0x7b5f('0x50'),'id'])||{});}})[_0x7b5f('0x22')](respondWithResult(_0x440936,null))[_0x7b5f('0x40')](handleError(_0x440936,null));};exports[_0x7b5f('0x52')]=function(_0x403b98,_0x20d375,_0x174b82){var _0x158e33={};var _0x36bb8b={};var _0x43829a;var _0x511dff;return db['CmCompany']['findOne']({'where':{'id':_0x403b98[_0x7b5f('0x42')]['id']}})[_0x7b5f('0x22')](handleEntityNotFound(_0x20d375,null))[_0x7b5f('0x22')](function(_0x26ee4b){if(_0x26ee4b){_0x43829a=_0x26ee4b;_0x36bb8b[_0x7b5f('0x2c')]=_['keys'](db[_0x7b5f('0x53')][_0x7b5f('0x43')]);_0x36bb8b[_0x7b5f('0x2e')]=_[_0x7b5f('0x2d')](_0x403b98[_0x7b5f('0x2e')]);_0x36bb8b[_0x7b5f('0x2f')]=_[_0x7b5f('0x31')](_0x36bb8b[_0x7b5f('0x2c')],_0x36bb8b[_0x7b5f('0x2e')]);_0x158e33['attributes']=_[_0x7b5f('0x31')](_0x36bb8b[_0x7b5f('0x2c')],qs['fields'](_0x403b98[_0x7b5f('0x2e')][_0x7b5f('0x32')]));_0x158e33['attributes']=_0x158e33[_0x7b5f('0x30')]['length']?_0x158e33[_0x7b5f('0x30')]:_0x36bb8b[_0x7b5f('0x2c')];_0x158e33[_0x7b5f('0x36')]=qs['sort'](_0x403b98[_0x7b5f('0x2e')][_0x7b5f('0x37')]);_0x158e33[_0x7b5f('0x38')]=qs[_0x7b5f('0x2f')](_['pick'](_0x403b98[_0x7b5f('0x2e')],_0x36bb8b[_0x7b5f('0x2f')]));if(_0x403b98[_0x7b5f('0x2e')]['filter']){_0x158e33[_0x7b5f('0x38')]=_[_0x7b5f('0x3a')](_0x158e33['where'],{'$or':_[_0x7b5f('0x3b')](_0x158e33[_0x7b5f('0x30')],function(_0x35d32e){var _0x2d4324={};_0x2d4324[_0x35d32e]={'$like':'%'+_0x403b98[_0x7b5f('0x2e')][_0x7b5f('0x3c')]+'%'};return _0x2d4324;})});}_0x158e33=_[_0x7b5f('0x3a')]({},_0x158e33,_0x403b98[_0x7b5f('0x3d')]);return _0x43829a[_0x7b5f('0x52')](_0x158e33);}})[_0x7b5f('0x22')](function(_0x55131b){if(_0x55131b){_0x511dff=_0x55131b[_0x7b5f('0x33')];if(!_0x403b98['query'][_0x7b5f('0x34')](_0x7b5f('0x35'))){_0x158e33[_0x7b5f('0x1d')]=qs['limit'](_0x403b98[_0x7b5f('0x2e')][_0x7b5f('0x1d')]);_0x158e33['offset']=qs[_0x7b5f('0x1c')](_0x403b98[_0x7b5f('0x2e')][_0x7b5f('0x1c')]);}return _0x43829a[_0x7b5f('0x52')](_0x158e33);}})[_0x7b5f('0x22')](function(_0x31163a){if(_0x31163a){return _0x31163a?{'count':_0x511dff,'rows':_0x31163a}:null;}})[_0x7b5f('0x22')](respondWithResult(_0x20d375,null))['catch'](handleError(_0x20d375,null));}; \ No newline at end of file +var _0x8051=['send','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','options','count','include','findAll','params','rawAttributes','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','omit','ids','getContacts','CmContact','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Companies','UserProfileResource','stack','name'];(function(_0x1222ea,_0x55c3cd){var _0x3509af=function(_0x2bb464){while(--_0x2bb464){_0x1222ea['push'](_0x1222ea['shift']());}};_0x3509af(++_0x55c3cd);}(_0x8051,0x123));var _0x1805=function(_0xcc1148,_0x286167){_0xcc1148=_0xcc1148-0x0;var _0x2ad03c=_0x8051[_0xcc1148];return _0x2ad03c;};'use strict';var pdf=require(_0x1805('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1805('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1805('0x2'));var rp=require(_0x1805('0x3'));var moment=require('moment');var BPromise=require(_0x1805('0x4'));var Mustache=require(_0x1805('0x5'));var util=require(_0x1805('0x6'));var path=require(_0x1805('0x7'));var sox=require('sox');var csv=require(_0x1805('0x8'));var ejs=require(_0x1805('0x9'));var fs=require('fs');var _=require(_0x1805('0xa'));var squel=require(_0x1805('0xb'));var crypto=require(_0x1805('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1805('0x8'));var querystring=require(_0x1805('0xd'));var Papa=require(_0x1805('0xe'));var Redis=require(_0x1805('0xf'));var authService=require(_0x1805('0x10'));var qs=require(_0x1805('0x11'));var as=require(_0x1805('0x12'));var hardwareService=require(_0x1805('0x13'));var logger=require('../../config/logger')(_0x1805('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1805('0x15'))['db'];function respondWithStatusCode(_0xf7d1af,_0x4d9ee5){_0x4d9ee5=_0x4d9ee5||0xcc;return function(_0xc3416d){if(_0xc3416d){return _0xf7d1af[_0x1805('0x16')](_0x4d9ee5);}return _0xf7d1af['status'](_0x4d9ee5)[_0x1805('0x17')]();};}function respondWithResult(_0x1eba37,_0x2921ab){_0x2921ab=_0x2921ab||0xc8;return function(_0x197c5f){if(_0x197c5f){return _0x1eba37[_0x1805('0x18')](_0x2921ab)['json'](_0x197c5f);}};}function respondWithFilteredResult(_0x102dc8,_0x2fa2e5){return function(_0x3fd21f){if(_0x3fd21f){var _0x1cf4ad=_0x3fd21f['count'],_0x2c7907=_0x2fa2e5['offset'],_0x194f94=_0x2fa2e5[_0x1805('0x19')]+_0x2fa2e5[_0x1805('0x1a')],_0x5e522c;if(_0x194f94>=_0x1cf4ad){_0x194f94=_0x1cf4ad;_0x5e522c=0xc8;}else{_0x5e522c=0xce;}_0x102dc8[_0x1805('0x18')](_0x5e522c);return _0x102dc8[_0x1805('0x1b')](_0x1805('0x1c'),_0x2c7907+'-'+_0x194f94+'/'+_0x1cf4ad)[_0x1805('0x1d')](_0x3fd21f);}return null;};}function patchUpdates(_0x223dfe){return function(_0xe12170){try{jsonpatch[_0x1805('0x1e')](_0xe12170,_0x223dfe,!![]);}catch(_0x3c4eac){return BPromise[_0x1805('0x1f')](_0x3c4eac);}return _0xe12170[_0x1805('0x20')]();};}function saveUpdates(_0x32fb9b,_0x57a8e7){return function(_0x3f871e){if(_0x3f871e){return _0x3f871e[_0x1805('0x21')](_0x32fb9b)[_0x1805('0x22')](function(_0x356c66){return _0x356c66;});}return null;};}function removeEntity(_0xe096de,_0x3a5eb7){return function(_0x3f106d){if(_0x3f106d){return _0x3f106d[_0x1805('0x23')]()[_0x1805('0x22')](function(){var _0x43a375=_0x3f106d[_0x1805('0x24')]({'plain':!![]});var _0x5d4a46=_0x1805('0x25');return db[_0x1805('0x26')][_0x1805('0x23')]({'where':{'type':_0x5d4a46,'resourceId':_0x43a375['id']}})[_0x1805('0x22')](function(){return _0x3f106d;});})['then'](function(){_0xe096de[_0x1805('0x18')](0xcc)[_0x1805('0x17')]();});}};}function handleEntityNotFound(_0x411cd5,_0x370003){return function(_0x4ab640){if(!_0x4ab640){_0x411cd5[_0x1805('0x16')](0x194);}return _0x4ab640;};}function handleError(_0x12772a,_0x4752df){_0x4752df=_0x4752df||0x1f4;return function(_0x238745){logger['error'](_0x238745[_0x1805('0x27')]);if(_0x238745['name']){delete _0x238745[_0x1805('0x28')];}_0x12772a[_0x1805('0x18')](_0x4752df)[_0x1805('0x29')](_0x238745);};}exports['index']=function(_0x43ca49,_0x55e4b5){var _0x54be52={},_0x45ea85={},_0x212b6a={'count':0x0,'rows':[]};return db[_0x1805('0x2a')][_0x1805('0x2b')]()[_0x1805('0x22')](function(_0x53a07d){_0x45ea85[_0x1805('0x2c')]=_[_0x1805('0x2d')](_0x53a07d);_0x45ea85[_0x1805('0x2e')]=_[_0x1805('0x2d')](_0x43ca49[_0x1805('0x2e')]);_0x45ea85[_0x1805('0x2f')]=_[_0x1805('0x30')](_0x45ea85[_0x1805('0x2c')],_0x45ea85[_0x1805('0x2e')]);_0x54be52[_0x1805('0x31')]=_['intersection'](_0x45ea85[_0x1805('0x2c')],qs[_0x1805('0x32')](_0x43ca49['query'][_0x1805('0x32')]));_0x54be52[_0x1805('0x31')]=_0x54be52[_0x1805('0x31')][_0x1805('0x33')]?_0x54be52[_0x1805('0x31')]:_0x45ea85['model'];if(!_0x43ca49[_0x1805('0x2e')][_0x1805('0x34')](_0x1805('0x35'))){_0x54be52[_0x1805('0x1a')]=qs[_0x1805('0x1a')](_0x43ca49[_0x1805('0x2e')][_0x1805('0x1a')]);_0x54be52[_0x1805('0x19')]=qs[_0x1805('0x19')](_0x43ca49[_0x1805('0x2e')][_0x1805('0x19')]);}_0x54be52[_0x1805('0x36')]=qs[_0x1805('0x37')](_0x43ca49['query'][_0x1805('0x37')]);_0x54be52[_0x1805('0x38')]=qs[_0x1805('0x2f')](_['pick'](_0x43ca49['query'],_0x45ea85[_0x1805('0x2f')]),_0x53a07d);if(_0x43ca49['query'][_0x1805('0x39')]){_0x54be52[_0x1805('0x38')]=_[_0x1805('0x3a')](_0x54be52['where'],{'$or':_[_0x1805('0x3b')](_0x54be52[_0x1805('0x31')],function(_0xfb85f3){var _0x1c5fad={};_0x1c5fad[_0xfb85f3]={'$like':'%'+_0x43ca49[_0x1805('0x2e')][_0x1805('0x39')]+'%'};return _0x1c5fad;})});}_0x54be52=_['merge']({},_0x54be52,_0x43ca49[_0x1805('0x3c')]);var _0x4121dc={'where':_0x54be52[_0x1805('0x38')]};return db[_0x1805('0x2a')][_0x1805('0x3d')](_0x4121dc)[_0x1805('0x22')](function(_0x41284f){_0x212b6a[_0x1805('0x3d')]=_0x41284f;if(_0x43ca49[_0x1805('0x2e')]['includeAll']){_0x54be52[_0x1805('0x3e')]=[{'all':!![]}];}return db[_0x1805('0x2a')][_0x1805('0x3f')](_0x54be52);})[_0x1805('0x22')](function(_0xa985bf){_0x212b6a['rows']=_0xa985bf;return _0x212b6a;})['then'](respondWithFilteredResult(_0x55e4b5,_0x54be52))['catch'](handleError(_0x55e4b5,null));})['catch'](handleError(_0x55e4b5,null));};exports['show']=function(_0x46596b,_0x5a8a40){var _0x3dc9e9={'raw':![],'where':{'id':_0x46596b[_0x1805('0x40')]['id']}},_0x59761e={};_0x59761e['model']=_[_0x1805('0x2d')](db[_0x1805('0x2a')][_0x1805('0x41')]);_0x59761e[_0x1805('0x2e')]=_[_0x1805('0x2d')](_0x46596b[_0x1805('0x2e')]);_0x59761e[_0x1805('0x2f')]=_['intersection'](_0x59761e['model'],_0x59761e['query']);_0x3dc9e9[_0x1805('0x31')]=_['intersection'](_0x59761e[_0x1805('0x2c')],qs[_0x1805('0x32')](_0x46596b[_0x1805('0x2e')][_0x1805('0x32')]));_0x3dc9e9[_0x1805('0x31')]=_0x3dc9e9[_0x1805('0x31')][_0x1805('0x33')]?_0x3dc9e9[_0x1805('0x31')]:_0x59761e[_0x1805('0x2c')];if(_0x46596b[_0x1805('0x2e')][_0x1805('0x42')]){_0x3dc9e9[_0x1805('0x3e')]=[{'all':!![]}];}_0x3dc9e9=_[_0x1805('0x3a')]({},_0x3dc9e9,_0x46596b['options']);return db[_0x1805('0x2a')][_0x1805('0x43')](_0x3dc9e9)[_0x1805('0x22')](handleEntityNotFound(_0x5a8a40,null))[_0x1805('0x22')](respondWithResult(_0x5a8a40,null))[_0x1805('0x44')](handleError(_0x5a8a40,null));};exports[_0x1805('0x45')]=function(_0x7d1c7f,_0x543ab5){return db[_0x1805('0x2a')][_0x1805('0x45')](_0x7d1c7f[_0x1805('0x46')],{})[_0x1805('0x22')](function(_0x5270eb){var _0x44a130=_0x7d1c7f[_0x1805('0x47')][_0x1805('0x24')]({'plain':!![]});if(!_0x44a130)throw new Error(_0x1805('0x48'));if(_0x44a130['role']===_0x1805('0x47')){var _0x2bdb03=_0x5270eb[_0x1805('0x24')]({'plain':!![]});var _0x25542a='Companies';return db[_0x1805('0x49')][_0x1805('0x43')]({'where':{'name':_0x25542a,'userProfileId':_0x44a130[_0x1805('0x4a')]},'raw':!![]})[_0x1805('0x22')](function(_0x119722){if(_0x119722&&_0x119722[_0x1805('0x4b')]===0x0){return db['UserProfileResource'][_0x1805('0x45')]({'name':_0x2bdb03[_0x1805('0x28')],'resourceId':_0x2bdb03['id'],'type':_0x119722[_0x1805('0x28')],'sectionId':_0x119722['id']},{})['then'](function(){return _0x5270eb;});}else{return _0x5270eb;}})[_0x1805('0x44')](function(_0x1f8f0b){logger[_0x1805('0x4c')](_0x1805('0x4d'),_0x1f8f0b);throw _0x1f8f0b;});}return _0x5270eb;})[_0x1805('0x22')](respondWithResult(_0x543ab5,0xc9))['catch'](handleError(_0x543ab5,null));};exports[_0x1805('0x21')]=function(_0x4cbdd9,_0x463ec4){if(_0x4cbdd9['body']['id']){delete _0x4cbdd9[_0x1805('0x46')]['id'];}return db['CmCompany'][_0x1805('0x43')]({'where':{'id':_0x4cbdd9[_0x1805('0x40')]['id']}})[_0x1805('0x22')](handleEntityNotFound(_0x463ec4,null))['then'](saveUpdates(_0x4cbdd9[_0x1805('0x46')],null))['then'](respondWithResult(_0x463ec4,null))[_0x1805('0x44')](handleError(_0x463ec4,null));};exports[_0x1805('0x23')]=function(_0x1f6a81,_0x1e21e4){return db[_0x1805('0x2a')][_0x1805('0x43')]({'where':{'id':_0x1f6a81[_0x1805('0x40')]['id']}})['then'](handleEntityNotFound(_0x1e21e4,null))[_0x1805('0x22')](removeEntity(_0x1e21e4,null))['catch'](handleError(_0x1e21e4,null));};exports[_0x1805('0x2b')]=function(_0x3f9f6a,_0x4a1643){return db[_0x1805('0x2a')][_0x1805('0x2b')]()[_0x1805('0x22')](respondWithResult(_0x4a1643,null))['catch'](handleError(_0x4a1643,null));};exports[_0x1805('0x4e')]=function(_0x11c0a4,_0x2bba5d,_0x67e58f){return db['CmContact'][_0x1805('0x43')]({'where':{'id':_0x11c0a4[_0x1805('0x40')]['id']}})[_0x1805('0x22')](handleEntityNotFound(_0x2bba5d,null))[_0x1805('0x22')](function(_0x2f6cea){if(_0x2f6cea){return _0x2f6cea['addContacts'](_0x11c0a4['body']['ids'],_[_0x1805('0x4f')](_0x11c0a4[_0x1805('0x46')],[_0x1805('0x50'),'id'])||{});}})[_0x1805('0x22')](respondWithResult(_0x2bba5d,null))[_0x1805('0x44')](handleError(_0x2bba5d,null));};exports[_0x1805('0x51')]=function(_0x139b31,_0x432da3,_0x15bdab){var _0x35c395={};var _0xeee92a={};var _0xf59e9d;var _0x5a3ab2;return db[_0x1805('0x2a')]['findOne']({'where':{'id':_0x139b31[_0x1805('0x40')]['id']}})[_0x1805('0x22')](handleEntityNotFound(_0x432da3,null))[_0x1805('0x22')](function(_0x138662){if(_0x138662){_0xf59e9d=_0x138662;_0xeee92a[_0x1805('0x2c')]=_[_0x1805('0x2d')](db[_0x1805('0x52')]['rawAttributes']);_0xeee92a[_0x1805('0x2e')]=_['keys'](_0x139b31[_0x1805('0x2e')]);_0xeee92a[_0x1805('0x2f')]=_['intersection'](_0xeee92a[_0x1805('0x2c')],_0xeee92a[_0x1805('0x2e')]);_0x35c395['attributes']=_['intersection'](_0xeee92a[_0x1805('0x2c')],qs['fields'](_0x139b31[_0x1805('0x2e')][_0x1805('0x32')]));_0x35c395[_0x1805('0x31')]=_0x35c395['attributes'][_0x1805('0x33')]?_0x35c395[_0x1805('0x31')]:_0xeee92a[_0x1805('0x2c')];_0x35c395[_0x1805('0x36')]=qs[_0x1805('0x37')](_0x139b31[_0x1805('0x2e')]['sort']);_0x35c395['where']=qs[_0x1805('0x2f')](_['pick'](_0x139b31['query'],_0xeee92a['filters']));if(_0x139b31['query'][_0x1805('0x39')]){_0x35c395[_0x1805('0x38')]=_[_0x1805('0x3a')](_0x35c395[_0x1805('0x38')],{'$or':_[_0x1805('0x3b')](_0x35c395[_0x1805('0x31')],function(_0x114284){var _0x54a2a6={};_0x54a2a6[_0x114284]={'$like':'%'+_0x139b31[_0x1805('0x2e')][_0x1805('0x39')]+'%'};return _0x54a2a6;})});}_0x35c395=_[_0x1805('0x3a')]({},_0x35c395,_0x139b31[_0x1805('0x3c')]);return _0xf59e9d[_0x1805('0x51')](_0x35c395);}})[_0x1805('0x22')](function(_0xc12a39){if(_0xc12a39){_0x5a3ab2=_0xc12a39[_0x1805('0x33')];if(!_0x139b31['query'][_0x1805('0x34')](_0x1805('0x35'))){_0x35c395[_0x1805('0x1a')]=qs[_0x1805('0x1a')](_0x139b31[_0x1805('0x2e')][_0x1805('0x1a')]);_0x35c395['offset']=qs['offset'](_0x139b31['query'][_0x1805('0x19')]);}return _0xf59e9d[_0x1805('0x51')](_0x35c395);}})[_0x1805('0x22')](function(_0x141878){if(_0x141878){return _0x141878?{'count':_0x5a3ab2,'rows':_0x141878}:null;}})[_0x1805('0x22')](respondWithResult(_0x432da3,null))['catch'](handleError(_0x432da3,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 69a8a8c..5aee792 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 _0x5f7b=['lodash','api','moment','request-promise','path','exports','define','CmCompany'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x5f7b,0xb0));var _0xb5f7=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x5f7b[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0xb5f7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb5f7('0x1'));var moment=require(_0xb5f7('0x2'));var BPromise=require('bluebird');var rp=require(_0xb5f7('0x3'));var fs=require('fs');var path=require(_0xb5f7('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module[_0xb5f7('0x5')]=function(_0x2b96df,_0x1e6607){return _0x2b96df[_0xb5f7('0x6')](_0xb5f7('0x7'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa63c=['util','../../config/logger','bluebird','path','rimraf','../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash'];(function(_0x24d8db,_0x2392c6){var _0x13d20d=function(_0x568f80){while(--_0x568f80){_0x24d8db['push'](_0x24d8db['shift']());}};_0x13d20d(++_0x2392c6);}(_0xa63c,0x196));var _0xca63=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa63c[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xca63('0x0'));var util=require(_0xca63('0x1'));var logger=require(_0xca63('0x2'))('api');var moment=require('moment');var BPromise=require(_0xca63('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xca63('0x4'));var rimraf=require(_0xca63('0x5'));var config=require(_0xca63('0x6'));var attributes=require(_0xca63('0x7'));module[_0xca63('0x8')]=function(_0x4665d8,_0x256cab){return _0x4665d8['define'](_0xca63('0x9'),attributes,{'tableName':_0xca63('0xa'),'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 ace463b..c7b2fda 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 _0xd1f2=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s'];(function(_0x4fd71e,_0x3ec6d5){var _0x7cf1dc=function(_0x132589){while(--_0x132589){_0x4fd71e['push'](_0x4fd71e['shift']());}};_0x7cf1dc(++_0x3ec6d5);}(_0xd1f2,0x173));var _0x2d1f=function(_0x161144,_0x20cac1){_0x161144=_0x161144-0x0;var _0x426e40=_0xd1f2[_0x161144];return _0x426e40;};'use strict';var _=require(_0x2d1f('0x0'));var util=require(_0x2d1f('0x1'));var moment=require('moment');var BPromise=require(_0x2d1f('0x2'));var rs=require(_0x2d1f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d1f('0x4'))['db'];var utils=require(_0x2d1f('0x5'));var logger=require(_0x2d1f('0x6'))(_0x2d1f('0x7'));var config=require('../../config/environment');var jayson=require(_0x2d1f('0x8'));var client=jayson[_0x2d1f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd45bbb,_0x1583a1,_0x3555c3){return new BPromise(function(_0x14fe10,_0x144b40){return client[_0x2d1f('0xa')](_0xd45bbb,_0x3555c3)[_0x2d1f('0xb')](function(_0x12d485){logger[_0x2d1f('0xc')]('CmCompany,\x20%s,\x20%s',_0x1583a1,_0x2d1f('0xd'));logger[_0x2d1f('0xe')](_0x2d1f('0xf'),_0x1583a1,_0x2d1f('0xd'),JSON[_0x2d1f('0x10')](_0x12d485));if(_0x12d485[_0x2d1f('0x11')]){if(_0x12d485[_0x2d1f('0x11')][_0x2d1f('0x12')]===0x1f4){logger[_0x2d1f('0x11')](_0x2d1f('0x13'),_0x1583a1,_0x12d485['error'][_0x2d1f('0x14')]);return _0x144b40(_0x12d485['error']['message']);}logger['error'](_0x2d1f('0x13'),_0x1583a1,_0x12d485[_0x2d1f('0x11')][_0x2d1f('0x14')]);return _0x14fe10(_0x12d485[_0x2d1f('0x11')]['message']);}else{logger['info'](_0x2d1f('0x13'),_0x1583a1,_0x2d1f('0xd'));_0x14fe10(_0x12d485[_0x2d1f('0x15')][_0x2d1f('0x14')]);}})[_0x2d1f('0x16')](function(_0x232037){logger[_0x2d1f('0x11')](_0x2d1f('0x13'),_0x1583a1,_0x232037);_0x144b40(_0x232037);});});} \ No newline at end of file +var _0xe959=['code','CmCompany,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xe959,0xb8));var _0x9e95=function(_0x51b693,_0x2012de){_0x51b693=_0x51b693-0x0;var _0x2812bd=_0xe959[_0x51b693];return _0x2812bd;};'use strict';var _=require('lodash');var util=require(_0x9e95('0x0'));var moment=require(_0x9e95('0x1'));var BPromise=require(_0x9e95('0x2'));var rs=require(_0x9e95('0x3'));var fs=require('fs');var Redis=require(_0x9e95('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9e95('0x5'))(_0x9e95('0x6'));var config=require('../../config/environment');var jayson=require(_0x9e95('0x7'));var client=jayson['client'][_0x9e95('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb9b711,_0x5522fc,_0x13dd57){return new BPromise(function(_0x4173b2,_0x3ff404){return client[_0x9e95('0x9')](_0xb9b711,_0x13dd57)[_0x9e95('0xa')](function(_0x2e8ef0){logger[_0x9e95('0xb')]('CmCompany,\x20%s,\x20%s',_0x5522fc,_0x9e95('0xc'));logger['debug'](_0x9e95('0xd'),_0x5522fc,_0x9e95('0xc'),JSON[_0x9e95('0xe')](_0x2e8ef0));if(_0x2e8ef0[_0x9e95('0xf')]){if(_0x2e8ef0[_0x9e95('0xf')][_0x9e95('0x10')]===0x1f4){logger[_0x9e95('0xf')](_0x9e95('0x11'),_0x5522fc,_0x2e8ef0['error'][_0x9e95('0x12')]);return _0x3ff404(_0x2e8ef0[_0x9e95('0xf')][_0x9e95('0x12')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x5522fc,_0x2e8ef0['error']['message']);return _0x4173b2(_0x2e8ef0[_0x9e95('0xf')][_0x9e95('0x12')]);}else{logger[_0x9e95('0xb')](_0x9e95('0x11'),_0x5522fc,'request\x20sent');_0x4173b2(_0x2e8ef0[_0x9e95('0x13')]['message']);}})['catch'](function(_0x54c298){logger[_0x9e95('0xf')](_0x9e95('0x11'),_0x5522fc,_0x54c298);_0x3ff404(_0x54c298);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index f0d8c8d..e246527 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 _0x3e74=['isAuthenticated','index','describe','/:id','getContacts','post','create','/:id/contacts','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./cmCompany.controller','get'];(function(_0x1a1131,_0x404e25){var _0x2a73ee=function(_0x18690f){while(--_0x18690f){_0x1a1131['push'](_0x1a1131['shift']());}};_0x2a73ee(++_0x404e25);}(_0x3e74,0x175));var _0x43e7=function(_0x38b38a,_0x56c413){_0x38b38a=_0x38b38a-0x0;var _0x26decd=_0x3e74[_0x38b38a];return _0x26decd;};'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 auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['post'](_0x43e7('0xe'),auth[_0x43e7('0x7')](),controller['addContacts']);router[_0x43e7('0xf')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);module[_0x43e7('0x12')]=router; \ No newline at end of file +var _0xedd9=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','util'];(function(_0xc67007,_0x510962){var _0x60c1c8=function(_0x3c6004){while(--_0x3c6004){_0xc67007['push'](_0xc67007['shift']());}};_0x60c1c8(++_0x510962);}(_0xedd9,0xfc));var _0x9edd=function(_0x2e859e,_0x3eccc2){_0x2e859e=_0x2e859e-0x0;var _0x12fa65=_0xedd9[_0x2e859e];return _0x12fa65;};'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 auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./cmCompany.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/describe',auth[_0x9edd('0x9')](),controller['describe']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['get'](_0x9edd('0xd'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0xf')]('/:id/contacts',auth[_0x9edd('0x9')](),controller[_0x9edd('0x11')]);router[_0x9edd('0x12')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x13')]);router[_0x9edd('0x14')](_0x9edd('0xb'),auth['isAuthenticated'](),controller[_0x9edd('0x15')]);module[_0x9edd('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index d8a6f67..f589506 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 _0x42a1=['DATE','NOW','exports','STRING','TEXT','INTEGER'];(function(_0xf0c25c,_0x43ea36){var _0x5701ea=function(_0x587f24){while(--_0x587f24){_0xf0c25c['push'](_0xf0c25c['shift']());}};_0x5701ea(++_0x43ea36);}(_0x42a1,0x12e));var _0x142a=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x42a1[_0x102e37];return _0x35a07c;};'use strict';var _=require('lodash');var Sequelize=require('sequelize');module[_0x142a('0x0')]={'firstName':{'type':Sequelize[_0x142a('0x1')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x142a('0x1')]},'postalCode':{'type':Sequelize[_0x142a('0x1')]},'city':{'type':Sequelize[_0x142a('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x142a('0x2')]},'phone':{'type':Sequelize[_0x142a('0x1')]},'mobile':{'type':Sequelize[_0x142a('0x1')]},'fax':{'type':Sequelize[_0x142a('0x1')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x142a('0x1')]},'facebook':{'type':Sequelize[_0x142a('0x1')]},'fb_data':{'type':Sequelize[_0x142a('0x1')]},'twitter':{'type':Sequelize[_0x142a('0x1')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x142a('0x1')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x142a('0x1')]},'UserId':{'type':Sequelize[_0x142a('0x3')]},'priority':{'type':Sequelize[_0x142a('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x142a('0x4')],'defaultValue':Sequelize[_0x142a('0x5')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x142a('0x3')]}}; \ No newline at end of file +var _0x4e65=['STRING','TEXT','INTEGER','DATE','sequelize','exports'];(function(_0x3128d5,_0x464d4f){var _0x51f0f1=function(_0x1ee5f4){while(--_0x1ee5f4){_0x3128d5['push'](_0x3128d5['shift']());}};_0x51f0f1(++_0x464d4f);}(_0x4e65,0xc4));var _0x54e6=function(_0x568bde,_0x370980){_0x568bde=_0x568bde-0x0;var _0x5b99d5=_0x4e65[_0x568bde];return _0x5b99d5;};'use strict';var _=require('lodash');var Sequelize=require(_0x54e6('0x0'));module[_0x54e6('0x1')]={'firstName':{'type':Sequelize[_0x54e6('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x54e6('0x2')]},'street':{'type':Sequelize[_0x54e6('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x54e6('0x2')]},'dateOfBirth':{'type':Sequelize[_0x54e6('0x2')]},'description':{'type':Sequelize[_0x54e6('0x3')]},'phone':{'type':Sequelize[_0x54e6('0x2')]},'mobile':{'type':Sequelize[_0x54e6('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x54e6('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x54e6('0x2')]},'fb_data':{'type':Sequelize[_0x54e6('0x2')]},'twitter':{'type':Sequelize[_0x54e6('0x2')]},'skype':{'type':Sequelize[_0x54e6('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x54e6('0x2')]},'line':{'type':Sequelize[_0x54e6('0x2')]},'wechat':{'type':Sequelize[_0x54e6('0x2')]},'telegram':{'type':Sequelize[_0x54e6('0x2')]},'UserId':{'type':Sequelize[_0x54e6('0x4')]},'priority':{'type':Sequelize[_0x54e6('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x54e6('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x54e6('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 8bdffd4..9d82b61 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 _0xeea5=['firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','child_process','fork','json','pid','upload','createReadStream','file','parse','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./cmContact.socket','register','sendStatus','status','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','findOne','all','fieldType','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','conditions','find','Tag','value','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','map','Contact','isEmpty','forEach','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','having','t.id\x20IN\x20?','resolve','some','user','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','Tags','TagIds','rows','catch','params','columnName','displayName','findAll','alias','custom','values','body','get','tags','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','show','$and','format','cf_%d','omit','pickBy','setFields','id\x20=\x20?','toParam','phone','CmHopper','getTags','rawAttributes','options','setTags','ids','getHoppers','ContactId','include','getHopperHistories','CmHopperHistory','getHopperFinals','includeAll','getJscriptySessions','JscriptySessionReport','uploadCsv','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject'];(function(_0x38b25c,_0x36b544){var _0x4db378=function(_0x5e07c9){while(--_0x5e07c9){_0x38b25c['push'](_0x38b25c['shift']());}};_0x4db378(++_0x36b544);}(_0xeea5,0x10a));var _0x5eea=function(_0x17733a,_0x7f9d92){_0x17733a=_0x17733a-0x0;var _0x3b81c1=_0xeea5[_0x17733a];return _0x3b81c1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5eea('0x0'));var rimraf=require(_0x5eea('0x1'));var zipdir=require(_0x5eea('0x2'));var jsonpatch=require(_0x5eea('0x3'));var rp=require('request-promise');var moment=require(_0x5eea('0x4'));var BPromise=require(_0x5eea('0x5'));var Mustache=require(_0x5eea('0x6'));var util=require('util');var path=require(_0x5eea('0x7'));var sox=require(_0x5eea('0x8'));var csv=require(_0x5eea('0x9'));var ejs=require(_0x5eea('0xa'));var fs=require('fs');var _=require(_0x5eea('0xb'));var squel=require('squel');var crypto=require(_0x5eea('0xc'));var jsforce=require(_0x5eea('0xd'));var deskjs=require(_0x5eea('0xe'));var toCsv=require(_0x5eea('0x9'));var querystring=require(_0x5eea('0xf'));var Papa=require('papaparse');var Redis=require(_0x5eea('0x10'));var authService=require(_0x5eea('0x11'));var qs=require(_0x5eea('0x12'));var as=require(_0x5eea('0x13'));var hardwareService=require(_0x5eea('0x14'));var logger=require(_0x5eea('0x15'))(_0x5eea('0x16'));var utils=require(_0x5eea('0x17'));var config=require(_0x5eea('0x18'));var db=require(_0x5eea('0x19'))['db'];config[_0x5eea('0x1a')]=_['defaults'](config[_0x5eea('0x1a')],{'host':_0x5eea('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5eea('0x1c'))[_0x5eea('0x1d')](socket);function respondWithStatusCode(_0x3ff142,_0x4fc4f8){_0x4fc4f8=_0x4fc4f8||0xcc;return function(_0x332086){if(_0x332086){return _0x3ff142[_0x5eea('0x1e')](_0x4fc4f8);}return _0x3ff142['status'](_0x4fc4f8)['end']();};}function respondWithResult(_0x185ba1,_0x1761fe){_0x1761fe=_0x1761fe||0xc8;return function(_0x489b2b){if(_0x489b2b){return _0x185ba1[_0x5eea('0x1f')](_0x1761fe)['json'](_0x489b2b);}};}function respondWithFilteredResult(_0x523e86,_0x22e19e){return function(_0x395b5b){if(_0x395b5b){var _0x3c8d6a=_0x395b5b[_0x5eea('0x20')],_0x46ada0=_0x22e19e[_0x5eea('0x21')],_0x387f51=_0x22e19e[_0x5eea('0x21')]+_0x22e19e[_0x5eea('0x22')],_0x437641;if(_0x387f51>=_0x3c8d6a){_0x387f51=_0x3c8d6a;_0x437641=0xc8;}else{_0x437641=0xce;}_0x523e86['status'](_0x437641);return _0x523e86[_0x5eea('0x23')](_0x5eea('0x24'),_0x46ada0+'-'+_0x387f51+'/'+_0x3c8d6a)['json'](_0x395b5b);}return null;};}function patchUpdates(_0x216b6b){return function(_0x3391a4){try{jsonpatch[_0x5eea('0x25')](_0x3391a4,_0x216b6b,!![]);}catch(_0x43eea8){return BPromise[_0x5eea('0x26')](_0x43eea8);}return _0x3391a4['save']();};}function saveUpdates(_0x2daabb,_0xeab8a9){return function(_0x5e7d4f){if(_0x5e7d4f){return _0x5e7d4f[_0x5eea('0x27')](_0x2daabb)[_0x5eea('0x28')](function(_0x2b3131){return _0x2b3131;});}return null;};}function removeEntity(_0x530a1e,_0x1020c6){return function(_0x476062){if(_0x476062){return _0x476062[_0x5eea('0x29')]()[_0x5eea('0x28')](function(){_0x530a1e['status'](0xcc)[_0x5eea('0x2a')]();});}};}function handleEntityNotFound(_0x353b8e,_0x197030){return function(_0x3b8d45){if(!_0x3b8d45){_0x353b8e[_0x5eea('0x1e')](0x194);}return _0x3b8d45;};}function handleError(_0xc94c9e,_0x33e08f){_0x33e08f=_0x33e08f||0x1f4;return function(_0x5cf278){logger[_0x5eea('0x2b')](_0x5cf278[_0x5eea('0x2c')]);if(_0x5cf278[_0x5eea('0x2d')]){delete _0x5cf278[_0x5eea('0x2d')];}_0xc94c9e[_0x5eea('0x1f')](_0x33e08f)[_0x5eea('0x2e')](_0x5cf278);};}exports[_0x5eea('0x2f')]=function(_0x49bea5,_0xfcb7b5){var _0x3d07a2={},_0x2165da={},_0x17515c={'count':0x0,'rows':[]};return db[_0x5eea('0x30')][_0x5eea('0x31')]()[_0x5eea('0x28')](function(_0x4f1da0){var _0x28f51a=[];for(var _0x462a82=0x0;_0x462a820x1){_0xcff4fc['or'](_0x5eea('0x73'),qs[_0x5eea('0x74')](_0x312a0c),null);}else{if(qs['isNumeric'](_0x312a0c)){_0xcff4fc['or']('c.id\x20LIKE\x20?',_0x312a0c+'%');_0xcff4fc['or'](_0x5eea('0x75'),_0x312a0c+'%');_0xcff4fc['or']('c.mobile\x20LIKE\x20?',_0x312a0c+'%');_0xcff4fc['or'](_0x5eea('0x76'),_0x312a0c+'%');}else if(qs[_0x5eea('0x77')](_0x312a0c)){_0xcff4fc['or'](_0x5eea('0x78'),_0x312a0c+'%');}else{_0xcff4fc['or'](_0x5eea('0x79'),'%'+_0x312a0c+'%');_0xcff4fc['or'](_0x5eea('0x7a'),'%'+_0x312a0c+'%');_0xcff4fc['or'](_0x5eea('0x78'),'%'+_0x312a0c+'%');}}}}_0x5e7e8f[_0x5eea('0x46')](_0xcff4fc);_0x5e7e8f['group'](_0x5eea('0x7b'));var _0x36178d={'type':db[_0x5eea('0x7c')][_0x5eea('0x7d')][_0x5eea('0x7e')],'raw':!![]};var _0x74c8ba=_0x5e7e8f[_0x5eea('0x7f')]()[_0x5eea('0x49')](_0x5eea('0x7b'));if(_0x3d07a2['order']){_0x3d07a2[_0x5eea('0x44')]['forEach'](function(_0x2756a1){_0x5e7e8f['order']('c.'+_0x2756a1[0x0],_0x2756a1[0x1]==='DESC'?![]:!![]);});}if(!_[_0x5eea('0x69')](_0x5e62b8)){_0x5e7e8f[_0x5eea('0x80')](_0x44bf92);_0x74c8ba[_0x5eea('0x46')](_0x5eea('0x81'),_0x5e62b8);}BPromise[_0x5eea('0x82')]()[_0x5eea('0x28')](function(){if(_0x2f3305&&!_[_0x5eea('0x83')](_0x2f3305['conditions'],[_0x5eea('0x49'),_0x5eea('0x5d')])){return _0x49bea5[_0x5eea('0x84')][_0x5eea('0x85')]({'attributes':['id'],'raw':!![]})[_0x5eea('0x28')](function(_0x10ed07){if(_['isEmpty'](_0x10ed07)){_0x74c8ba[_0x5eea('0x46')]('c.ListId\x20IS\x20NULL');_0x5e7e8f[_0x5eea('0x46')](_0x5eea('0x86'));}else{_0x74c8ba[_0x5eea('0x46')]('c.ListId\x20IN\x20?',_[_0x5eea('0x67')](_0x10ed07,'id'));_0x5e7e8f['where'](_0x5eea('0x87'),_['map'](_0x10ed07,'id'));}});}else{return;}})[_0x5eea('0x28')](function(){db[_0x5eea('0x88')][_0x5eea('0x3c')](_0x74c8ba[_0x5eea('0x89')](),_0x36178d)[_0x5eea('0x28')](function(_0x22ad67){_0x17515c[_0x5eea('0x20')]=_0x22ad67['length'];if(_0x17515c[_0x5eea('0x20')]===0x0)return[];return db['sequelize'][_0x5eea('0x3c')](_0x9ff6f6['toString'](),_0x36178d);})['then'](function(_0x1eefaa){_0x5ad3bb=_['keyBy'](_0x1eefaa,'id');_0x36178d=_[_0x5eea('0x8a')](_0x36178d,{'model':db[_0x5eea('0x30')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x49bea5[_0x5eea('0x3c')][_0x5eea('0x41')]){_0x3d07a2[_0x5eea('0x40')][_0x5eea('0x6a')](function(_0x43bdeb){_0x5e7e8f[_0x5eea('0x49')]('c.'+_0x43bdeb);});}else{_0x5e7e8f[_0x5eea('0x49')](_0x5eea('0x7b'));_0x5e7e8f[_0x5eea('0x49')](_0x5eea('0x8b'));_0x5e7e8f[_0x5eea('0x49')](_0x5eea('0x8c'));_0x5e7e8f[_0x5eea('0x49')](_0x5eea('0x8d'));_0x5e7e8f[_0x5eea('0x49')](_0x5eea('0x8e'));_0x5e7e8f[_0x5eea('0x49')](_0x5eea('0x8f'));_0x5e7e8f[_0x5eea('0x49')]('c.email');_0x5e7e8f[_0x5eea('0x49')](_0x5eea('0x90'));_0x5e7e8f[_0x5eea('0x49')](_0x5eea('0x91'));_0x5e7e8f['field'](_0x5eea('0x92'),'TagIds');}if(_0x3d07a2[_0x5eea('0x22')])_0x5e7e8f[_0x5eea('0x22')](_0x3d07a2[_0x5eea('0x22')]);if(_0x3d07a2[_0x5eea('0x21')])_0x5e7e8f[_0x5eea('0x21')](_0x3d07a2[_0x5eea('0x21')]);return db[_0x5eea('0x88')]['query'](_0x5e7e8f[_0x5eea('0x89')](),_0x36178d);})[_0x5eea('0x28')](function(_0x50ffa1){_0x50ffa1[_0x5eea('0x6a')](function(_0x9ab237){if(_0x9ab237['TagIds']){_0x9ab237[_0x5eea('0x93')]=[];_0x9ab237[_0x5eea('0x94')][_0x5eea('0x5a')](',')[_0x5eea('0x6a')](function(_0x13c85d){_0x9ab237[_0x5eea('0x93')][_0x5eea('0x36')](_0x5ad3bb[_0x13c85d]);});}delete _0x9ab237[_0x5eea('0x94')];});_0x17515c[_0x5eea('0x95')]=_0x50ffa1;return _0x17515c;})[_0x5eea('0x28')](respondWithFilteredResult(_0xfcb7b5,_0x3d07a2));});})[_0x5eea('0x96')](handleError(_0xfcb7b5,null));};exports['destroy']=function(_0x3cef2b,_0xd563e0){return db[_0x5eea('0x30')]['find']({'where':{'id':_0x3cef2b[_0x5eea('0x97')]['id']}})[_0x5eea('0x28')](handleEntityNotFound(_0xd563e0,null))[_0x5eea('0x28')](removeEntity(_0xd563e0,null))['catch'](handleError(_0xd563e0,null));};exports[_0x5eea('0x31')]=function(_0x582a1e,_0xcf0e23){return db[_0x5eea('0x30')][_0x5eea('0x31')]()[_0x5eea('0x28')](function(_0x392aa8){delete _0x392aa8['tags'];for(var _0x262f2b=0x0;_0x262f2b=_0x40e4eb){_0x43422a=_0x40e4eb;_0x3c179d=0xc8;}else{_0x3c179d=0xce;}_0x27e777['status'](_0x3c179d);return _0x27e777[_0x9cad('0x22')]('Content-Range',_0x43ae4b+'-'+_0x43422a+'/'+_0x40e4eb)['json'](_0x2ca1c5);}return null;};}function patchUpdates(_0x39c616){return function(_0x145cae){try{jsonpatch['apply'](_0x145cae,_0x39c616,!![]);}catch(_0x355109){return BPromise[_0x9cad('0x23')](_0x355109);}return _0x145cae[_0x9cad('0x24')]();};}function saveUpdates(_0x5b976b,_0x2da61d){return function(_0x3f58ca){if(_0x3f58ca){return _0x3f58ca[_0x9cad('0x25')](_0x5b976b)['then'](function(_0x5637f6){return _0x5637f6;});}return null;};}function removeEntity(_0x2398f9,_0x366cd9){return function(_0x498293){if(_0x498293){return _0x498293[_0x9cad('0x26')]()[_0x9cad('0x27')](function(){_0x2398f9[_0x9cad('0x1c')](0xcc)[_0x9cad('0x1d')]();});}};}function handleEntityNotFound(_0x1696e0,_0x9d45ba){return function(_0x34932d){if(!_0x34932d){_0x1696e0[_0x9cad('0x28')](0x194);}return _0x34932d;};}function handleError(_0x1ad99a,_0x524e8d){_0x524e8d=_0x524e8d||0x1f4;return function(_0x5d17bc){logger[_0x9cad('0x29')](_0x5d17bc[_0x9cad('0x2a')]);if(_0x5d17bc['name']){delete _0x5d17bc[_0x9cad('0x2b')];}_0x1ad99a['status'](_0x524e8d)['send'](_0x5d17bc);};}exports['index']=function(_0x451010,_0x47b8b6){var _0x34d489={},_0x3f81f5={},_0x39a416={'count':0x0,'rows':[]};return db['CmContact'][_0x9cad('0x2c')]()[_0x9cad('0x27')](function(_0xe970cb){var _0x1adecb=[];for(var _0x466690=0x0;_0x4666900x1){_0x189736['or'](_0x9cad('0x67'),qs[_0x9cad('0x68')](_0x44e081),null);}else{if(qs[_0x9cad('0x69')](_0x44e081)){_0x189736['or']('c.id\x20LIKE\x20?',_0x44e081+'%');_0x189736['or'](_0x9cad('0x6a'),_0x44e081+'%');_0x189736['or'](_0x9cad('0x6b'),_0x44e081+'%');_0x189736['or'](_0x9cad('0x6c'),_0x44e081+'%');}else if(qs[_0x9cad('0x6d')](_0x44e081)){_0x189736['or']('c.email\x20LIKE\x20?',_0x44e081+'%');}else{_0x189736['or'](_0x9cad('0x6e'),'%'+_0x44e081+'%');_0x189736['or'](_0x9cad('0x6f'),'%'+_0x44e081+'%');_0x189736['or'](_0x9cad('0x70'),'%'+_0x44e081+'%');}}}}_0x2a37a0['where'](_0x189736);_0x2a37a0[_0x9cad('0x71')]('c.id');var _0x5bbe48={'type':db[_0x9cad('0x72')][_0x9cad('0x73')][_0x9cad('0x74')],'raw':!![]};var _0xf3662e=_0x2a37a0[_0x9cad('0x75')]()['field'](_0x9cad('0x76'));if(_0x34d489['order']){_0x34d489['order'][_0x9cad('0x55')](function(_0x1aed28){_0x2a37a0[_0x9cad('0x3e')]('c.'+_0x1aed28[0x0],_0x1aed28[0x1]===_0x9cad('0x77')?![]:!![]);});}if(!_[_0x9cad('0x60')](_0x34b894)){_0x2a37a0[_0x9cad('0x78')](_0x1dfafc);_0xf3662e[_0x9cad('0x40')](_0x9cad('0x79'),_0x34b894);}BPromise[_0x9cad('0x7a')]()[_0x9cad('0x27')](function(){if(_0x2f83f8&&!_['some'](_0x2f83f8['conditions'],[_0x9cad('0x43'),_0x9cad('0x7b')])){return _0x451010[_0x9cad('0x7c')][_0x9cad('0x7d')]({'attributes':['id'],'raw':!![]})[_0x9cad('0x27')](function(_0x1bfabf){if(_[_0x9cad('0x60')](_0x1bfabf)){_0xf3662e[_0x9cad('0x40')](_0x9cad('0x7e'));_0x2a37a0[_0x9cad('0x40')](_0x9cad('0x7e'));}else{_0xf3662e['where']('c.ListId\x20IN\x20?',_[_0x9cad('0x54')](_0x1bfabf,'id'));_0x2a37a0[_0x9cad('0x40')]('c.ListId\x20IN\x20?',_['map'](_0x1bfabf,'id'));}});}else{return;}})[_0x9cad('0x27')](function(){db[_0x9cad('0x7f')][_0x9cad('0x37')](_0xf3662e[_0x9cad('0x80')](),_0x5bbe48)[_0x9cad('0x27')](function(_0x4f8af6){_0x39a416[_0x9cad('0x1f')]=_0x4f8af6[_0x9cad('0x34')];if(_0x39a416[_0x9cad('0x1f')]===0x0)return[];return db[_0x9cad('0x7f')][_0x9cad('0x37')](_0x531df0[_0x9cad('0x80')](),_0x5bbe48);})[_0x9cad('0x27')](function(_0x20a646){_0x22ebdb=_[_0x9cad('0x81')](_0x20a646,'id');_0x5bbe48=_['merge'](_0x5bbe48,{'model':db[_0x9cad('0x82')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x451010[_0x9cad('0x37')][_0x9cad('0x3c')]){_0x34d489[_0x9cad('0x3b')][_0x9cad('0x55')](function(_0xa99e44){_0x2a37a0[_0x9cad('0x43')]('c.'+_0xa99e44);});}else{_0x2a37a0[_0x9cad('0x43')](_0x9cad('0x76'));_0x2a37a0['field'](_0x9cad('0x83'));_0x2a37a0[_0x9cad('0x43')](_0x9cad('0x84'));_0x2a37a0[_0x9cad('0x43')](_0x9cad('0x85'));_0x2a37a0['field'](_0x9cad('0x86'));_0x2a37a0[_0x9cad('0x43')](_0x9cad('0x87'));_0x2a37a0['field'](_0x9cad('0x88'));_0x2a37a0[_0x9cad('0x43')](_0x9cad('0x89'));_0x2a37a0['field'](_0x9cad('0x8a'));_0x2a37a0[_0x9cad('0x43')](_0x9cad('0x8b'),_0x9cad('0x8c'));}if(_0x34d489[_0x9cad('0x21')])_0x2a37a0[_0x9cad('0x21')](_0x34d489[_0x9cad('0x21')]);if(_0x34d489[_0x9cad('0x20')])_0x2a37a0['offset'](_0x34d489[_0x9cad('0x20')]);return db[_0x9cad('0x7f')][_0x9cad('0x37')](_0x2a37a0['toString'](),_0x5bbe48);})[_0x9cad('0x27')](function(_0x28560b){_0x28560b[_0x9cad('0x55')](function(_0x2361ea){if(_0x2361ea[_0x9cad('0x8c')]){_0x2361ea[_0x9cad('0x8d')]=[];_0x2361ea['TagIds'][_0x9cad('0x53')](',')['forEach'](function(_0x3de765){_0x2361ea[_0x9cad('0x8d')]['push'](_0x22ebdb[_0x3de765]);});}delete _0x2361ea[_0x9cad('0x8c')];});_0x39a416['rows']=_0x28560b;return _0x39a416;})['then'](respondWithFilteredResult(_0x47b8b6,_0x34d489));});})[_0x9cad('0x8e')](handleError(_0x47b8b6,null));};exports[_0x9cad('0x26')]=function(_0x101ee9,_0x55f55b){return db[_0x9cad('0x82')][_0x9cad('0x50')]({'where':{'id':_0x101ee9[_0x9cad('0x8f')]['id']}})[_0x9cad('0x27')](handleEntityNotFound(_0x55f55b,null))[_0x9cad('0x27')](removeEntity(_0x55f55b,null))[_0x9cad('0x8e')](handleError(_0x55f55b,null));};exports[_0x9cad('0x2c')]=function(_0x46a7c6,_0x20cc0e){return db[_0x9cad('0x82')][_0x9cad('0x2c')]()[_0x9cad('0x27')](function(_0x1cf22e){delete _0x1cf22e[_0x9cad('0x90')];for(var _0x50904f=0x0;_0x50904f{}\s\\|]/g,'-');_0x2f46f1(null,util['format']('%s-%s%s',path[_0x15fd('0x1e')](_0x3761db[_0x15fd('0x1c')],path[_0x15fd('0x1f')](_0x3761db[_0x15fd('0x1c')])),Date[_0x15fd('0x20')](),path[_0x15fd('0x1f')](_0x3761db[_0x15fd('0x1c')])));}})});router['post'](_0x15fd('0x21'),upload[_0x15fd('0x22')](_0x15fd('0x23')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x15fd('0x18')]({'destination':function(_0x49062f,_0x3d1835,_0x1fc24f){_0x1fc24f(null,path[_0x15fd('0x19')](config['root'],_0x15fd('0x1b')));},'filename':function(_0x1cbf2c,_0x24c541,_0x5d4789){_0x24c541[_0x15fd('0x1c')]=_0x24c541['originalname'][_0x15fd('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5d4789(null,util[_0x15fd('0x24')](_0x15fd('0x25'),path[_0x15fd('0x1e')](_0x24c541[_0x15fd('0x1c')],path[_0x15fd('0x1f')](_0x24c541[_0x15fd('0x1c')])),Date[_0x15fd('0x20')](),path[_0x15fd('0x1f')](_0x24c541[_0x15fd('0x1c')])));}})});router[_0x15fd('0x13')]('/upload',upload[_0x15fd('0x22')](_0x15fd('0x23')),controller['upload']);router[_0x15fd('0x13')](_0x15fd('0x26'),auth['isAuthenticated'](),controller[_0x15fd('0x27')]);router[_0x15fd('0x28')]('/:id',auth[_0x15fd('0x7')](),controller[_0x15fd('0x29')]);router[_0x15fd('0x2a')](_0x15fd('0xb'),auth[_0x15fd('0x7')](),controller[_0x15fd('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x425d=['update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/merge','merge','post','/create_many','bulkCreate','setTags','diskStorage','root','server/files/tmp','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','file','uploadCsv','join','/upload','single','upload','/upload/:id','import','put'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x425d,0x1e0));var _0xd425=function(_0x20c2e6,_0x199912){_0x20c2e6=_0x20c2e6-0x0;var _0x451b69=_0x425d[_0x20c2e6];return _0x451b69;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var auth=require(_0xd425('0x5'));var interaction=require(_0xd425('0x6'));var config=require(_0xd425('0x7'));var controller=require('./cmContact.controller');router[_0xd425('0x8')]('/',auth[_0xd425('0x9')](),controller[_0xd425('0xa')]);router[_0xd425('0x8')](_0xd425('0xb'),auth[_0xd425('0x9')](),controller['describe']);router[_0xd425('0x8')](_0xd425('0xc'),auth[_0xd425('0x9')](),controller[_0xd425('0xd')]);router[_0xd425('0x8')](_0xd425('0xe'),auth[_0xd425('0x9')](),controller[_0xd425('0xf')]);router[_0xd425('0x8')](_0xd425('0x10'),auth[_0xd425('0x9')](),controller[_0xd425('0x11')]);router[_0xd425('0x8')](_0xd425('0x12'),auth[_0xd425('0x9')](),controller[_0xd425('0x13')]);router[_0xd425('0x8')](_0xd425('0x14'),auth[_0xd425('0x9')](),controller[_0xd425('0x15')]);router['get'](_0xd425('0x16'),auth[_0xd425('0x9')](),controller[_0xd425('0x17')]);router['post'](_0xd425('0x18'),auth[_0xd425('0x9')](),controller[_0xd425('0x19')]);router[_0xd425('0x1a')]('/',auth[_0xd425('0x9')](),controller['create']);router[_0xd425('0x1a')](_0xd425('0x1b'),auth[_0xd425('0x9')](),controller[_0xd425('0x1c')]);router['post'](_0xd425('0xe'),auth[_0xd425('0x9')](),controller[_0xd425('0x1d')]);var upload=multer({'storage':multer[_0xd425('0x1e')]({'destination':function(_0x4e88fa,_0x58a0c1,_0x5debc3){_0x5debc3(null,path['join'](config[_0xd425('0x1f')],_0xd425('0x20')));},'filename':function(_0x3c98db,_0x5e797a,_0x355af0){_0x5e797a[_0xd425('0x21')]=_0x5e797a['originalname'][_0xd425('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x355af0(null,util[_0xd425('0x23')](_0xd425('0x24'),path[_0xd425('0x25')](_0x5e797a[_0xd425('0x21')],path[_0xd425('0x26')](_0x5e797a[_0xd425('0x21')])),Date[_0xd425('0x27')](),path[_0xd425('0x26')](_0x5e797a[_0xd425('0x21')])));}})});router[_0xd425('0x1a')](_0xd425('0x28'),upload['single'](_0xd425('0x29')),controller[_0xd425('0x2a')]);var upload=multer({'storage':multer[_0xd425('0x1e')]({'destination':function(_0x1908a5,_0x2afcdb,_0x400dd7){_0x400dd7(null,path[_0xd425('0x2b')](config['root'],_0xd425('0x20')));},'filename':function(_0x177de2,_0x1d8861,_0x57c950){_0x1d8861[_0xd425('0x21')]=_0x1d8861[_0xd425('0x21')][_0xd425('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x57c950(null,util[_0xd425('0x23')](_0xd425('0x24'),path[_0xd425('0x25')](_0x1d8861[_0xd425('0x21')],path[_0xd425('0x26')](_0x1d8861[_0xd425('0x21')])),Date[_0xd425('0x27')](),path['extname'](_0x1d8861[_0xd425('0x21')])));}})});router[_0xd425('0x1a')](_0xd425('0x2c'),upload[_0xd425('0x2d')](_0xd425('0x29')),controller[_0xd425('0x2e')]);router[_0xd425('0x1a')](_0xd425('0x2f'),auth[_0xd425('0x9')](),controller[_0xd425('0x30')]);router[_0xd425('0x31')]('/:id',auth[_0xd425('0x9')](),controller[_0xd425('0x32')]);router[_0xd425('0x33')](_0xd425('0xc'),auth[_0xd425('0x9')](),controller['destroy']);module[_0xd425('0x34')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 9516c27..2171748 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 _0xf96b=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x97659c,_0x584605){var _0x226a62=function(_0x5e1fc5){while(--_0x5e1fc5){_0x97659c['push'](_0x97659c['shift']());}};_0x226a62(++_0x584605);}(_0xf96b,0x109));var _0xbf96=function(_0x2e2c01,_0x1540d0){_0x2e2c01=_0x2e2c01-0x0;var _0xb6ee39=_0xf96b[_0x2e2c01];return _0xb6ee39;};'use strict';var Sequelize=require(_0xbf96('0x0'));module[_0xbf96('0x1')]={'CmContactId':{'type':Sequelize[_0xbf96('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0xbf96('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xbf96('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xbf96('0x3')],'defaultValue':_0xbf96('0x4')},'OrderBy':{'type':Sequelize[_0xbf96('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0xba0d=['STRING','PHONE','sequelize','INTEGER'];(function(_0x5e4efd,_0x1bb1f7){var _0xba07a4=function(_0x4909d0){while(--_0x4909d0){_0x5e4efd['push'](_0x5e4efd['shift']());}};_0xba07a4(++_0x1bb1f7);}(_0xba0d,0x8e));var _0xdba0=function(_0xd203a1,_0x4ef353){_0xd203a1=_0xd203a1-0x0;var _0x3a3f6d=_0xba0d[_0xd203a1];return _0x3a3f6d;};'use strict';var Sequelize=require(_0xdba0('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xdba0('0x1')],'primaryKey':!![]},'item':{'type':Sequelize[_0xdba0('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xdba0('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0xdba0('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'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 1d81590..c562dbc 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 _0x0cbc=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','CmContactHasItems','UserProfileResource','destroy','end','sendStatus','error','stack','name','index','map','CmContactHasItem','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','where','merge','type','VIRTUAL','options','includeAll','findAll','catch','rawAttributes','find','body','role','user','get','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0x0cbc,0x130));var _0xc0cb=function(_0x1d87fc,_0x1e5321){_0x1d87fc=_0x1d87fc-0x0;var _0x492b56=_0x0cbc[_0x1d87fc];return _0x492b56;};'use strict';var pdf=require(_0xc0cb('0x0'));var emlformat=require(_0xc0cb('0x1'));var rimraf=require(_0xc0cb('0x2'));var zipdir=require(_0xc0cb('0x3'));var jsonpatch=require(_0xc0cb('0x4'));var rp=require(_0xc0cb('0x5'));var moment=require(_0xc0cb('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc0cb('0x7'));var csv=require(_0xc0cb('0x8'));var ejs=require(_0xc0cb('0x9'));var fs=require('fs');var _=require(_0xc0cb('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc0cb('0xb'));var deskjs=require(_0xc0cb('0xc'));var toCsv=require(_0xc0cb('0x8'));var querystring=require(_0xc0cb('0xd'));var Papa=require(_0xc0cb('0xe'));var Redis=require(_0xc0cb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc0cb('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc0cb('0x11'))(_0xc0cb('0x12'));var utils=require(_0xc0cb('0x13'));var config=require(_0xc0cb('0x14'));var db=require(_0xc0cb('0x15'))['db'];function respondWithStatusCode(_0x93bd20,_0x22d4c3){_0x22d4c3=_0x22d4c3||0xcc;return function(_0x59d3ab){if(_0x59d3ab){return _0x93bd20['sendStatus'](_0x22d4c3);}return _0x93bd20[_0xc0cb('0x16')](_0x22d4c3)['end']();};}function respondWithResult(_0x4b5322,_0xd9ac8b){_0xd9ac8b=_0xd9ac8b||0xc8;return function(_0xeba819){if(_0xeba819){return _0x4b5322['status'](_0xd9ac8b)[_0xc0cb('0x17')](_0xeba819);}};}function respondWithFilteredResult(_0x32bccd,_0xa25902){return function(_0xf60530){if(_0xf60530){var _0x1d3290=_0xf60530[_0xc0cb('0x18')],_0x837e03=_0xa25902[_0xc0cb('0x19')],_0x2e896a=_0xa25902[_0xc0cb('0x19')]+_0xa25902[_0xc0cb('0x1a')],_0xfb6831;if(_0x2e896a>=_0x1d3290){_0x2e896a=_0x1d3290;_0xfb6831=0xc8;}else{_0xfb6831=0xce;}_0x32bccd[_0xc0cb('0x16')](_0xfb6831);return _0x32bccd['set'](_0xc0cb('0x1b'),_0x837e03+'-'+_0x2e896a+'/'+_0x1d3290)['json'](_0xf60530);}return null;};}function patchUpdates(_0x58d522){return function(_0x17e658){try{jsonpatch[_0xc0cb('0x1c')](_0x17e658,_0x58d522,!![]);}catch(_0x20df06){return BPromise[_0xc0cb('0x1d')](_0x20df06);}return _0x17e658[_0xc0cb('0x1e')]();};}function saveUpdates(_0x249a71,_0x3ebf85){return function(_0xad9025){if(_0xad9025){return _0xad9025[_0xc0cb('0x1f')](_0x249a71)[_0xc0cb('0x20')](function(_0x149d18){return _0x149d18;});}return null;};}function removeEntity(_0x10fd5d,_0x37d583){return function(_0x5c3232){if(_0x5c3232){return _0x5c3232['destroy']()[_0xc0cb('0x20')](function(){var _0x1bbd3e=_0x5c3232['get']({'plain':!![]});var _0x58c585=_0xc0cb('0x21');return db[_0xc0cb('0x22')][_0xc0cb('0x23')]({'where':{'type':_0x58c585,'resourceId':_0x1bbd3e['id']}})[_0xc0cb('0x20')](function(){return _0x5c3232;});})[_0xc0cb('0x20')](function(){_0x10fd5d['status'](0xcc)[_0xc0cb('0x24')]();});}};}function handleEntityNotFound(_0x5028c3,_0x2536b3){return function(_0x338557){if(!_0x338557){_0x5028c3[_0xc0cb('0x25')](0x194);}return _0x338557;};}function handleError(_0x48055c,_0x2f174b){_0x2f174b=_0x2f174b||0x1f4;return function(_0xcfd354){logger[_0xc0cb('0x26')](_0xcfd354[_0xc0cb('0x27')]);if(_0xcfd354[_0xc0cb('0x28')]){delete _0xcfd354[_0xc0cb('0x28')];}_0x48055c[_0xc0cb('0x16')](_0x2f174b)['send'](_0xcfd354);};}exports[_0xc0cb('0x29')]=function(_0xed7baf,_0x89ce41){var _0x16d2c4={},_0x3e8f2f={},_0x3c7c3e={'count':0x0,'rows':[]};var _0x5ac1a1=_[_0xc0cb('0x2a')](db[_0xc0cb('0x2b')]['rawAttributes'],function(_0x5dcc9c){return{'name':_0x5dcc9c[_0xc0cb('0x2c')],'type':_0x5dcc9c['type'][_0xc0cb('0x2d')]};});_0x3e8f2f[_0xc0cb('0x2e')]=_['map'](_0x5ac1a1,_0xc0cb('0x28'));_0x3e8f2f[_0xc0cb('0x2f')]=_[_0xc0cb('0x30')](_0xed7baf[_0xc0cb('0x2f')]);_0x3e8f2f[_0xc0cb('0x31')]=_[_0xc0cb('0x32')](_0x3e8f2f['model'],_0x3e8f2f['query']);_0x16d2c4[_0xc0cb('0x33')]=_[_0xc0cb('0x32')](_0x3e8f2f[_0xc0cb('0x2e')],qs[_0xc0cb('0x34')](_0xed7baf[_0xc0cb('0x2f')][_0xc0cb('0x34')]));_0x16d2c4[_0xc0cb('0x33')]=_0x16d2c4[_0xc0cb('0x33')]['length']?_0x16d2c4['attributes']:_0x3e8f2f['model'];if(!_0xed7baf['query'][_0xc0cb('0x35')]('nolimit')){_0x16d2c4[_0xc0cb('0x1a')]=qs[_0xc0cb('0x1a')](_0xed7baf[_0xc0cb('0x2f')][_0xc0cb('0x1a')]);_0x16d2c4[_0xc0cb('0x19')]=qs[_0xc0cb('0x19')](_0xed7baf[_0xc0cb('0x2f')][_0xc0cb('0x19')]);}_0x16d2c4[_0xc0cb('0x36')]=qs[_0xc0cb('0x37')](_0xed7baf['query'][_0xc0cb('0x37')]);_0x16d2c4['where']=qs[_0xc0cb('0x31')](_[_0xc0cb('0x38')](_0xed7baf[_0xc0cb('0x2f')],_0x3e8f2f[_0xc0cb('0x31')]),_0x5ac1a1);if(_0xed7baf[_0xc0cb('0x2f')]['filter']){_0x16d2c4[_0xc0cb('0x39')]=_[_0xc0cb('0x3a')](_0x16d2c4[_0xc0cb('0x39')],{'$or':_['map'](_0x5ac1a1,function(_0x42608b){if(_0x42608b[_0xc0cb('0x3b')]!==_0xc0cb('0x3c')){var _0x862ee2={};_0x862ee2[_0x42608b[_0xc0cb('0x28')]]={'$like':'%'+_0xed7baf['query']['filter']+'%'};return _0x862ee2;}})});}_0x16d2c4=_[_0xc0cb('0x3a')]({},_0x16d2c4,_0xed7baf[_0xc0cb('0x3d')]);var _0xdd832f={'where':_0x16d2c4['where']};return db[_0xc0cb('0x2b')]['count'](_0xdd832f)[_0xc0cb('0x20')](function(_0x35c9f8){_0x3c7c3e[_0xc0cb('0x18')]=_0x35c9f8;if(_0xed7baf[_0xc0cb('0x2f')][_0xc0cb('0x3e')]){_0x16d2c4['include']=[{'all':!![]}];}return db[_0xc0cb('0x2b')][_0xc0cb('0x3f')](_0x16d2c4);})[_0xc0cb('0x20')](function(_0x2eaaa8){_0x3c7c3e['rows']=_0x2eaaa8;return _0x3c7c3e;})[_0xc0cb('0x20')](respondWithFilteredResult(_0x89ce41,_0x16d2c4))[_0xc0cb('0x40')](handleError(_0x89ce41,null));};exports['show']=function(_0x432cc0,_0xbaab40){var _0x17ec8f={'raw':!![],'where':{'id':_0x432cc0['params']['id']}},_0x281de8={};_0x281de8[_0xc0cb('0x2e')]=_['keys'](db[_0xc0cb('0x2b')][_0xc0cb('0x41')]);_0x281de8[_0xc0cb('0x2f')]=_[_0xc0cb('0x30')](_0x432cc0[_0xc0cb('0x2f')]);_0x281de8[_0xc0cb('0x31')]=_['intersection'](_0x281de8[_0xc0cb('0x2e')],_0x281de8[_0xc0cb('0x2f')]);_0x17ec8f['attributes']=_[_0xc0cb('0x32')](_0x281de8[_0xc0cb('0x2e')],qs[_0xc0cb('0x34')](_0x432cc0[_0xc0cb('0x2f')][_0xc0cb('0x34')]));_0x17ec8f[_0xc0cb('0x33')]=_0x17ec8f[_0xc0cb('0x33')]['length']?_0x17ec8f[_0xc0cb('0x33')]:_0x281de8['model'];if(_0x432cc0['query']['includeAll']){_0x17ec8f['include']=[{'all':!![]}];}_0x17ec8f=_[_0xc0cb('0x3a')]({},_0x17ec8f,_0x432cc0[_0xc0cb('0x3d')]);return db['CmContactHasItem'][_0xc0cb('0x42')](_0x17ec8f)['then'](handleEntityNotFound(_0xbaab40,null))['then'](respondWithResult(_0xbaab40,null))[_0xc0cb('0x40')](handleError(_0xbaab40,null));};exports['create']=function(_0x16fc37,_0x5b9eda){return db[_0xc0cb('0x2b')]['create'](_0x16fc37[_0xc0cb('0x43')],{})['then'](function(_0x398f61){var _0x50711d=_0x16fc37['user']['get']({'plain':!![]});if(!_0x50711d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x50711d[_0xc0cb('0x44')]===_0xc0cb('0x45')){var _0x5b9aec=_0x398f61[_0xc0cb('0x46')]({'plain':!![]});var _0xa0b8e=_0xc0cb('0x21');return db['UserProfileSection'][_0xc0cb('0x42')]({'where':{'name':_0xa0b8e,'userProfileId':_0x50711d[_0xc0cb('0x47')]},'raw':!![]})[_0xc0cb('0x20')](function(_0x1c0ecc){if(_0x1c0ecc&&_0x1c0ecc[_0xc0cb('0x48')]===0x0){return db['UserProfileResource'][_0xc0cb('0x49')]({'name':_0x5b9aec[_0xc0cb('0x28')],'resourceId':_0x5b9aec['id'],'type':_0x1c0ecc[_0xc0cb('0x28')],'sectionId':_0x1c0ecc['id']},{})[_0xc0cb('0x20')](function(){return _0x398f61;});}else{return _0x398f61;}})[_0xc0cb('0x40')](function(_0x223a40){logger[_0xc0cb('0x26')](_0xc0cb('0x4a'),_0x223a40);throw _0x223a40;});}return _0x398f61;})[_0xc0cb('0x20')](respondWithResult(_0x5b9eda,0xc9))['catch'](handleError(_0x5b9eda,null));};exports[_0xc0cb('0x1f')]=function(_0x3e96de,_0x476641){if(_0x3e96de[_0xc0cb('0x43')]['id']){delete _0x3e96de['body']['id'];}return db[_0xc0cb('0x2b')][_0xc0cb('0x42')]({'where':{'id':_0x3e96de[_0xc0cb('0x4b')]['id']}})[_0xc0cb('0x20')](handleEntityNotFound(_0x476641,null))['then'](saveUpdates(_0x3e96de[_0xc0cb('0x43')],null))['then'](respondWithResult(_0x476641,null))[_0xc0cb('0x40')](handleError(_0x476641,null));};exports[_0xc0cb('0x23')]=function(_0x430c99,_0x3109aa){return db['CmContactHasItem'][_0xc0cb('0x42')]({'where':{'id':_0x430c99[_0xc0cb('0x4b')]['id']}})[_0xc0cb('0x20')](handleEntityNotFound(_0x3109aa,null))['then'](removeEntity(_0x3109aa,null))['catch'](handleError(_0x3109aa,null));}; \ No newline at end of file +var _0xf438=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','reject','save','then','destroy','UserProfileResource','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','type','filter','options','CmContactHasItem','includeAll','rows','show','params','rawAttributes','fields','include','find','catch','create','get','role','user','CmContactHasItems','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xf438,0xe0));var _0x8f43=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf438[_0x4b369d];return _0x571a98;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8f43('0x0'));var rimraf=require(_0x8f43('0x1'));var zipdir=require(_0x8f43('0x2'));var jsonpatch=require(_0x8f43('0x3'));var rp=require('request-promise');var moment=require(_0x8f43('0x4'));var BPromise=require(_0x8f43('0x5'));var Mustache=require(_0x8f43('0x6'));var util=require(_0x8f43('0x7'));var path=require(_0x8f43('0x8'));var sox=require('sox');var csv=require(_0x8f43('0x9'));var ejs=require(_0x8f43('0xa'));var fs=require('fs');var _=require(_0x8f43('0xb'));var squel=require(_0x8f43('0xc'));var crypto=require('crypto');var jsforce=require(_0x8f43('0xd'));var deskjs=require(_0x8f43('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8f43('0xf'));var Papa=require(_0x8f43('0x10'));var Redis=require('ioredis');var authService=require(_0x8f43('0x11'));var qs=require(_0x8f43('0x12'));var as=require(_0x8f43('0x13'));var hardwareService=require(_0x8f43('0x14'));var logger=require(_0x8f43('0x15'))(_0x8f43('0x16'));var utils=require(_0x8f43('0x17'));var config=require(_0x8f43('0x18'));var db=require(_0x8f43('0x19'))['db'];function respondWithStatusCode(_0x150800,_0x2a9561){_0x2a9561=_0x2a9561||0xcc;return function(_0x10ec58){if(_0x10ec58){return _0x150800[_0x8f43('0x1a')](_0x2a9561);}return _0x150800['status'](_0x2a9561)[_0x8f43('0x1b')]();};}function respondWithResult(_0x5fde30,_0x3bf1dd){_0x3bf1dd=_0x3bf1dd||0xc8;return function(_0x31639d){if(_0x31639d){return _0x5fde30[_0x8f43('0x1c')](_0x3bf1dd)[_0x8f43('0x1d')](_0x31639d);}};}function respondWithFilteredResult(_0x4032a0,_0x27219c){return function(_0x5abbfb){if(_0x5abbfb){var _0x54028b=_0x5abbfb[_0x8f43('0x1e')],_0x14ba82=_0x27219c[_0x8f43('0x1f')],_0x161e6c=_0x27219c[_0x8f43('0x1f')]+_0x27219c['limit'],_0xa66bd;if(_0x161e6c>=_0x54028b){_0x161e6c=_0x54028b;_0xa66bd=0xc8;}else{_0xa66bd=0xce;}_0x4032a0[_0x8f43('0x1c')](_0xa66bd);return _0x4032a0[_0x8f43('0x20')](_0x8f43('0x21'),_0x14ba82+'-'+_0x161e6c+'/'+_0x54028b)[_0x8f43('0x1d')](_0x5abbfb);}return null;};}function patchUpdates(_0x4e986a){return function(_0x5adb60){try{jsonpatch['apply'](_0x5adb60,_0x4e986a,!![]);}catch(_0x53a17f){return BPromise[_0x8f43('0x22')](_0x53a17f);}return _0x5adb60[_0x8f43('0x23')]();};}function saveUpdates(_0x8de411,_0x341ae8){return function(_0x17e7d1){if(_0x17e7d1){return _0x17e7d1['update'](_0x8de411)[_0x8f43('0x24')](function(_0x3e4195){return _0x3e4195;});}return null;};}function removeEntity(_0x26d809,_0x4833e9){return function(_0x2d230a){if(_0x2d230a){return _0x2d230a[_0x8f43('0x25')]()[_0x8f43('0x24')](function(){var _0xbd8b78=_0x2d230a['get']({'plain':!![]});var _0x2325e4='CmContactHasItems';return db[_0x8f43('0x26')][_0x8f43('0x25')]({'where':{'type':_0x2325e4,'resourceId':_0xbd8b78['id']}})[_0x8f43('0x24')](function(){return _0x2d230a;});})['then'](function(){_0x26d809[_0x8f43('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c65a4,_0x274f87){return function(_0xea23b6){if(!_0xea23b6){_0x2c65a4[_0x8f43('0x1a')](0x194);}return _0xea23b6;};}function handleError(_0x13a252,_0x2b2154){_0x2b2154=_0x2b2154||0x1f4;return function(_0x321c61){logger['error'](_0x321c61[_0x8f43('0x27')]);if(_0x321c61[_0x8f43('0x28')]){delete _0x321c61[_0x8f43('0x28')];}_0x13a252[_0x8f43('0x1c')](_0x2b2154)[_0x8f43('0x29')](_0x321c61);};}exports['index']=function(_0x5b4941,_0x2f94b0){var _0x18e512={},_0x26aaec={},_0x5f0d8d={'count':0x0,'rows':[]};var _0x230244=_[_0x8f43('0x2a')](db['CmContactHasItem']['rawAttributes'],function(_0xe26fb8){return{'name':_0xe26fb8[_0x8f43('0x2b')],'type':_0xe26fb8['type'][_0x8f43('0x2c')]};});_0x26aaec[_0x8f43('0x2d')]=_[_0x8f43('0x2a')](_0x230244,_0x8f43('0x28'));_0x26aaec[_0x8f43('0x2e')]=_[_0x8f43('0x2f')](_0x5b4941['query']);_0x26aaec[_0x8f43('0x30')]=_['intersection'](_0x26aaec[_0x8f43('0x2d')],_0x26aaec[_0x8f43('0x2e')]);_0x18e512['attributes']=_[_0x8f43('0x31')](_0x26aaec[_0x8f43('0x2d')],qs['fields'](_0x5b4941['query']['fields']));_0x18e512[_0x8f43('0x32')]=_0x18e512[_0x8f43('0x32')][_0x8f43('0x33')]?_0x18e512[_0x8f43('0x32')]:_0x26aaec[_0x8f43('0x2d')];if(!_0x5b4941[_0x8f43('0x2e')][_0x8f43('0x34')](_0x8f43('0x35'))){_0x18e512[_0x8f43('0x36')]=qs[_0x8f43('0x36')](_0x5b4941[_0x8f43('0x2e')][_0x8f43('0x36')]);_0x18e512[_0x8f43('0x1f')]=qs[_0x8f43('0x1f')](_0x5b4941[_0x8f43('0x2e')]['offset']);}_0x18e512['order']=qs[_0x8f43('0x37')](_0x5b4941[_0x8f43('0x2e')][_0x8f43('0x37')]);_0x18e512[_0x8f43('0x38')]=qs[_0x8f43('0x30')](_[_0x8f43('0x39')](_0x5b4941[_0x8f43('0x2e')],_0x26aaec[_0x8f43('0x30')]),_0x230244);if(_0x5b4941[_0x8f43('0x2e')]['filter']){_0x18e512[_0x8f43('0x38')]=_[_0x8f43('0x3a')](_0x18e512['where'],{'$or':_[_0x8f43('0x2a')](_0x230244,function(_0x56d72c){if(_0x56d72c[_0x8f43('0x3b')]!=='VIRTUAL'){var _0x3e4f84={};_0x3e4f84[_0x56d72c['name']]={'$like':'%'+_0x5b4941[_0x8f43('0x2e')][_0x8f43('0x3c')]+'%'};return _0x3e4f84;}})});}_0x18e512=_[_0x8f43('0x3a')]({},_0x18e512,_0x5b4941[_0x8f43('0x3d')]);var _0x3c17f7={'where':_0x18e512[_0x8f43('0x38')]};return db[_0x8f43('0x3e')]['count'](_0x3c17f7)[_0x8f43('0x24')](function(_0x569569){_0x5f0d8d['count']=_0x569569;if(_0x5b4941['query'][_0x8f43('0x3f')]){_0x18e512['include']=[{'all':!![]}];}return db[_0x8f43('0x3e')]['findAll'](_0x18e512);})['then'](function(_0xf5f762){_0x5f0d8d[_0x8f43('0x40')]=_0xf5f762;return _0x5f0d8d;})[_0x8f43('0x24')](respondWithFilteredResult(_0x2f94b0,_0x18e512))['catch'](handleError(_0x2f94b0,null));};exports[_0x8f43('0x41')]=function(_0x261ea3,_0x269144){var _0x4de399={'raw':!![],'where':{'id':_0x261ea3[_0x8f43('0x42')]['id']}},_0x5064fd={};_0x5064fd['model']=_[_0x8f43('0x2f')](db[_0x8f43('0x3e')][_0x8f43('0x43')]);_0x5064fd['query']=_[_0x8f43('0x2f')](_0x261ea3['query']);_0x5064fd['filters']=_['intersection'](_0x5064fd[_0x8f43('0x2d')],_0x5064fd['query']);_0x4de399[_0x8f43('0x32')]=_[_0x8f43('0x31')](_0x5064fd[_0x8f43('0x2d')],qs[_0x8f43('0x44')](_0x261ea3[_0x8f43('0x2e')][_0x8f43('0x44')]));_0x4de399[_0x8f43('0x32')]=_0x4de399[_0x8f43('0x32')]['length']?_0x4de399['attributes']:_0x5064fd[_0x8f43('0x2d')];if(_0x261ea3['query']['includeAll']){_0x4de399[_0x8f43('0x45')]=[{'all':!![]}];}_0x4de399=_[_0x8f43('0x3a')]({},_0x4de399,_0x261ea3['options']);return db[_0x8f43('0x3e')][_0x8f43('0x46')](_0x4de399)[_0x8f43('0x24')](handleEntityNotFound(_0x269144,null))[_0x8f43('0x24')](respondWithResult(_0x269144,null))[_0x8f43('0x47')](handleError(_0x269144,null));};exports[_0x8f43('0x48')]=function(_0xf384b8,_0x454049){return db[_0x8f43('0x3e')]['create'](_0xf384b8['body'],{})[_0x8f43('0x24')](function(_0x53f3e0){var _0x28714e=_0xf384b8['user'][_0x8f43('0x49')]({'plain':!![]});if(!_0x28714e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x28714e[_0x8f43('0x4a')]===_0x8f43('0x4b')){var _0x473579=_0x53f3e0[_0x8f43('0x49')]({'plain':!![]});var _0x220f5d=_0x8f43('0x4c');return db['UserProfileSection'][_0x8f43('0x46')]({'where':{'name':_0x220f5d,'userProfileId':_0x28714e[_0x8f43('0x4d')]},'raw':!![]})[_0x8f43('0x24')](function(_0x16217a){if(_0x16217a&&_0x16217a['autoAssociation']===0x0){return db[_0x8f43('0x26')]['create']({'name':_0x473579[_0x8f43('0x28')],'resourceId':_0x473579['id'],'type':_0x16217a[_0x8f43('0x28')],'sectionId':_0x16217a['id']},{})[_0x8f43('0x24')](function(){return _0x53f3e0;});}else{return _0x53f3e0;}})[_0x8f43('0x47')](function(_0x2fd721){logger[_0x8f43('0x4e')](_0x8f43('0x4f'),_0x2fd721);throw _0x2fd721;});}return _0x53f3e0;})[_0x8f43('0x24')](respondWithResult(_0x454049,0xc9))[_0x8f43('0x47')](handleError(_0x454049,null));};exports[_0x8f43('0x50')]=function(_0x502a06,_0x497df5){if(_0x502a06[_0x8f43('0x51')]['id']){delete _0x502a06[_0x8f43('0x51')]['id'];}return db[_0x8f43('0x3e')][_0x8f43('0x46')]({'where':{'id':_0x502a06['params']['id']}})[_0x8f43('0x24')](handleEntityNotFound(_0x497df5,null))['then'](saveUpdates(_0x502a06['body'],null))['then'](respondWithResult(_0x497df5,null))[_0x8f43('0x47')](handleError(_0x497df5,null));};exports['destroy']=function(_0x192ecf,_0x2937a7){return db[_0x8f43('0x3e')][_0x8f43('0x46')]({'where':{'id':_0x192ecf[_0x8f43('0x42')]['id']}})[_0x8f43('0x24')](handleEntityNotFound(_0x2937a7,null))[_0x8f43('0x24')](removeEntity(_0x2937a7,null))['catch'](handleError(_0x2937a7,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 16729b0..a7bcae6 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 _0xe2fe=['../../config/environment','exports','define','CmContactHasItem','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_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 logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./cmContactHasItem.attributes');module[_0xee2f('0x7')]=function(_0x2b7e7c,_0x49926b){return _0x2b7e7c[_0xee2f('0x8')](_0xee2f('0x9'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1c6=['moment','request-promise','path','rimraf','exports','CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger'];(function(_0x4e52d6,_0x2b6f99){var _0x121aac=function(_0x12993b){while(--_0x12993b){_0x4e52d6['push'](_0x4e52d6['shift']());}};_0x121aac(++_0x2b6f99);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x3798d7,_0x56a6f1){_0x3798d7=_0x3798d7-0x0;var _0x3f9814=_0xc1c6[_0x3798d7];return _0x3f9814;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var logger=require(_0x6c1c('0x2'))('api');var moment=require(_0x6c1c('0x3'));var BPromise=require('bluebird');var rp=require(_0x6c1c('0x4'));var fs=require('fs');var path=require(_0x6c1c('0x5'));var rimraf=require(_0x6c1c('0x6'));var config=require('../../config/environment');var attributes=require('./cmContactHasItem.attributes');module[_0x6c1c('0x7')]=function(_0x524a6b,_0x50c1bb){return _0x524a6b['define'](_0x6c1c('0x8'),attributes,{'tableName':_0x6c1c('0x9'),'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 75ab73f..b8ab291 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 _0x9092=['request','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9092,0xa9));var _0x2909=function(_0x1635e3,_0x24aaee){_0x1635e3=_0x1635e3-0x0;var _0x2d5277=_0x9092[_0x1635e3];return _0x2d5277;};'use strict';var _=require(_0x2909('0x0'));var util=require(_0x2909('0x1'));var moment=require(_0x2909('0x2'));var BPromise=require(_0x2909('0x3'));var rs=require(_0x2909('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2909('0x5'));var logger=require('../../config/logger')(_0x2909('0x6'));var config=require(_0x2909('0x7'));var jayson=require(_0x2909('0x8'));var client=jayson[_0x2909('0x9')][_0x2909('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f89c,_0x367753,_0x4dc912){return new BPromise(function(_0x3661b0,_0x4a1b39){return client[_0x2909('0xb')](_0x54f89c,_0x4dc912)['then'](function(_0x7bb7f6){logger['info'](_0x2909('0xc'),_0x367753,_0x2909('0xd'));logger[_0x2909('0xe')](_0x2909('0xf'),_0x367753,'request\x20sent',JSON[_0x2909('0x10')](_0x7bb7f6));if(_0x7bb7f6[_0x2909('0x11')]){if(_0x7bb7f6['error']['code']===0x1f4){logger[_0x2909('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x367753,_0x7bb7f6[_0x2909('0x11')][_0x2909('0x12')]);return _0x4a1b39(_0x7bb7f6[_0x2909('0x11')][_0x2909('0x12')]);}logger[_0x2909('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x367753,_0x7bb7f6[_0x2909('0x11')]['message']);return _0x3661b0(_0x7bb7f6[_0x2909('0x11')]['message']);}else{logger['info'](_0x2909('0xc'),_0x367753,_0x2909('0xd'));_0x3661b0(_0x7bb7f6['result'][_0x2909('0x12')]);}})[_0x2909('0x13')](function(_0x1329aa){logger[_0x2909('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x367753,_0x1329aa);_0x4a1b39(_0x1329aa);});});} \ No newline at end of file +var _0x54eb=['ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x2495b2,_0x46840d){var _0x98aa25=function(_0x3b0da0){while(--_0x3b0da0){_0x2495b2['push'](_0x2495b2['shift']());}};_0x98aa25(++_0x46840d);}(_0x54eb,0x6f));var _0xb54e=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x54eb[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xb54e('0x0'));var util=require(_0xb54e('0x1'));var moment=require(_0xb54e('0x2'));var BPromise=require(_0xb54e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb54e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb54e('0x5'));var logger=require('../../config/logger')(_0xb54e('0x6'));var config=require('../../config/environment');var jayson=require(_0xb54e('0x7'));var client=jayson[_0xb54e('0x8')][_0xb54e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x215fbb,_0x582465,_0x3edb2d){return new BPromise(function(_0x4db7c5,_0x54dd69){return client[_0xb54e('0xa')](_0x215fbb,_0x3edb2d)[_0xb54e('0xb')](function(_0x3edcc7){logger[_0xb54e('0xc')](_0xb54e('0xd'),_0x582465,_0xb54e('0xe'));logger[_0xb54e('0xf')](_0xb54e('0x10'),_0x582465,_0xb54e('0xe'),JSON[_0xb54e('0x11')](_0x3edcc7));if(_0x3edcc7[_0xb54e('0x12')]){if(_0x3edcc7[_0xb54e('0x12')][_0xb54e('0x13')]===0x1f4){logger[_0xb54e('0x12')]('CmContactHasItem,\x20%s,\x20%s',_0x582465,_0x3edcc7['error'][_0xb54e('0x14')]);return _0x54dd69(_0x3edcc7[_0xb54e('0x12')]['message']);}logger[_0xb54e('0x12')](_0xb54e('0xd'),_0x582465,_0x3edcc7[_0xb54e('0x12')][_0xb54e('0x14')]);return _0x4db7c5(_0x3edcc7['error'][_0xb54e('0x14')]);}else{logger[_0xb54e('0xc')](_0xb54e('0xd'),_0x582465,_0xb54e('0xe'));_0x4db7c5(_0x3edcc7[_0xb54e('0x15')][_0xb54e('0x14')]);}})[_0xb54e('0x16')](function(_0x3731f9){logger[_0xb54e('0x12')](_0xb54e('0xd'),_0x582465,_0x3731f9);_0x54dd69(_0x3731f9);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index 25c34c2..8933d57 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 _0x5ae4=['isAuthenticated','show','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id'];(function(_0x345b02,_0x454869){var _0x51483b=function(_0x11dc28){while(--_0x11dc28){_0x345b02['push'](_0x345b02['shift']());}};_0x51483b(++_0x454869);}(_0x5ae4,0x17d));var _0x45ae=function(_0x35555d,_0x2ddc96){_0x35555d=_0x35555d-0x0;var _0x528d99=_0x5ae4[_0x35555d];return _0x528d99;};'use strict';var multer=require(_0x45ae('0x0'));var util=require(_0x45ae('0x1'));var path=require('path');var timeout=require(_0x45ae('0x2'));var express=require(_0x45ae('0x3'));var router=express[_0x45ae('0x4')]();var auth=require(_0x45ae('0x5'));var interaction=require(_0x45ae('0x6'));var config=require(_0x45ae('0x7'));var controller=require('./cmContactHasItem.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x45ae('0x8'),auth[_0x45ae('0x9')](),controller[_0x45ae('0xa')]);router['post']('/',auth[_0x45ae('0x9')](),controller['create']);router[_0x45ae('0xb')](_0x45ae('0x8'),auth[_0x45ae('0x9')](),controller[_0x45ae('0xc')]);router[_0x45ae('0xd')](_0x45ae('0x8'),auth[_0x45ae('0x9')](),controller[_0x45ae('0xe')]);module['exports']=router; \ No newline at end of file +var _0xf2c6=['multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports'];(function(_0x5166fe,_0x6c5659){var _0x17f203=function(_0x4265ec){while(--_0x4265ec){_0x5166fe['push'](_0x5166fe['shift']());}};_0x17f203(++_0x6c5659);}(_0xf2c6,0xea));var _0x6f2c=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xf2c6[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x6f2c('0x0'));var util=require(_0x6f2c('0x1'));var path=require(_0x6f2c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6f2c('0x3'));var router=express[_0x6f2c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6f2c('0x5'));var config=require(_0x6f2c('0x6'));var controller=require('./cmContactHasItem.controller');router[_0x6f2c('0x7')]('/',auth[_0x6f2c('0x8')](),controller[_0x6f2c('0x9')]);router[_0x6f2c('0x7')]('/:id',auth[_0x6f2c('0x8')](),controller[_0x6f2c('0xa')]);router[_0x6f2c('0xb')]('/',auth[_0x6f2c('0x8')](),controller[_0x6f2c('0xc')]);router[_0x6f2c('0xd')](_0x6f2c('0xe'),auth[_0x6f2c('0x8')](),controller[_0x6f2c('0xf')]);router[_0x6f2c('0x10')](_0x6f2c('0xe'),auth[_0x6f2c('0x8')](),controller['destroy']);module[_0x6f2c('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js b/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js index c8d198c..4f0c2d0 100644 --- a/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js +++ b/server/api/cmContactHasPhone/cmContactHasPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1e09=['STRING','sequelize','exports','INTEGER'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x1e09,0x1b5));var _0x91e0=function(_0x58ed1c,_0x1b63d2){_0x58ed1c=_0x58ed1c-0x0;var _0x2c0ba2=_0x1e09[_0x58ed1c];return _0x2c0ba2;};'use strict';var Sequelize=require(_0x91e0('0x0'));module[_0x91e0('0x1')]={'CmContactId':{'type':Sequelize[_0x91e0('0x2')],'primaryKey':!![]},'phone':{'type':Sequelize[_0x91e0('0x3')],'defaultValue':'','primaryKey':!![]}}; \ No newline at end of file +var _0x360e=['INTEGER','STRING','sequelize','exports'];(function(_0x3ad1ea,_0x5b486c){var _0x514763=function(_0xfc5baf){while(--_0xfc5baf){_0x3ad1ea['push'](_0x3ad1ea['shift']());}};_0x514763(++_0x5b486c);}(_0x360e,0x162));var _0xe360=function(_0x10316a,_0x125dc8){_0x10316a=_0x10316a-0x0;var _0x36ac2e=_0x360e[_0x10316a];return _0x36ac2e;};'use strict';var Sequelize=require(_0xe360('0x0'));module[_0xe360('0x1')]={'CmContactId':{'type':Sequelize[_0xe360('0x2')],'primaryKey':!![]},'phone':{'type':Sequelize[_0xe360('0x3')],'defaultValue':'','primaryKey':!![]}}; \ No newline at end of file diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.controller.js b/server/api/cmContactHasPhone/cmContactHasPhone.controller.js index e930218..9ba5cda 100644 --- a/server/api/cmContactHasPhone/cmContactHasPhone.controller.js +++ b/server/api/cmContactHasPhone/cmContactHasPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe340=['rows','catch','show','merge','options','find','create','user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','offset','set','Content-Range','reject','save','update','then','destroy','CmContactHasPhones','UserProfileResource','sendStatus','error','stack','name','index','map','CmContactHasPhone','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','filter','count','includeAll','include','findAll'];(function(_0x2d2a33,_0x2d1d1f){var _0x32d8ba=function(_0x566914){while(--_0x566914){_0x2d2a33['push'](_0x2d2a33['shift']());}};_0x32d8ba(++_0x2d1d1f);}(_0xe340,0x10c));var _0x0e34=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xe340[_0x6cf19c];return _0xce14f3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0e34('0x0'));var rimraf=require(_0x0e34('0x1'));var zipdir=require(_0x0e34('0x2'));var jsonpatch=require(_0x0e34('0x3'));var rp=require(_0x0e34('0x4'));var moment=require('moment');var BPromise=require(_0x0e34('0x5'));var Mustache=require(_0x0e34('0x6'));var util=require('util');var path=require(_0x0e34('0x7'));var sox=require(_0x0e34('0x8'));var csv=require('to-csv');var ejs=require(_0x0e34('0x9'));var fs=require('fs');var _=require(_0x0e34('0xa'));var squel=require(_0x0e34('0xb'));var crypto=require('crypto');var jsforce=require(_0x0e34('0xc'));var deskjs=require(_0x0e34('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0e34('0xe'));var Papa=require(_0x0e34('0xf'));var Redis=require(_0x0e34('0x10'));var authService=require(_0x0e34('0x11'));var qs=require(_0x0e34('0x12'));var as=require(_0x0e34('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e34('0x14'))(_0x0e34('0x15'));var utils=require(_0x0e34('0x16'));var config=require('../../config/environment');var db=require(_0x0e34('0x17'))['db'];function respondWithStatusCode(_0x19c95e,_0x581122){_0x581122=_0x581122||0xcc;return function(_0x3e8118){if(_0x3e8118){return _0x19c95e['sendStatus'](_0x581122);}return _0x19c95e[_0x0e34('0x18')](_0x581122)[_0x0e34('0x19')]();};}function respondWithResult(_0x472e6c,_0x54fc36){_0x54fc36=_0x54fc36||0xc8;return function(_0xd3f9cf){if(_0xd3f9cf){return _0x472e6c['status'](_0x54fc36)['json'](_0xd3f9cf);}};}function respondWithFilteredResult(_0x1b85b0,_0x3f1921){return function(_0x5d444a){if(_0x5d444a){var _0x36b4e1=_0x5d444a['count'],_0x2a74b7=_0x3f1921['offset'],_0x48315b=_0x3f1921[_0x0e34('0x1a')]+_0x3f1921['limit'],_0x35e5c4;if(_0x48315b>=_0x36b4e1){_0x48315b=_0x36b4e1;_0x35e5c4=0xc8;}else{_0x35e5c4=0xce;}_0x1b85b0[_0x0e34('0x18')](_0x35e5c4);return _0x1b85b0[_0x0e34('0x1b')](_0x0e34('0x1c'),_0x2a74b7+'-'+_0x48315b+'/'+_0x36b4e1)['json'](_0x5d444a);}return null;};}function patchUpdates(_0x23bedc){return function(_0x19cb35){try{jsonpatch['apply'](_0x19cb35,_0x23bedc,!![]);}catch(_0x230836){return BPromise[_0x0e34('0x1d')](_0x230836);}return _0x19cb35[_0x0e34('0x1e')]();};}function saveUpdates(_0xb22e1b,_0x1c8392){return function(_0x1eb915){if(_0x1eb915){return _0x1eb915[_0x0e34('0x1f')](_0xb22e1b)[_0x0e34('0x20')](function(_0x46c2d3){return _0x46c2d3;});}return null;};}function removeEntity(_0x4cf661,_0x2335fa){return function(_0x219fb0){if(_0x219fb0){return _0x219fb0[_0x0e34('0x21')]()[_0x0e34('0x20')](function(){var _0x37ae53=_0x219fb0['get']({'plain':!![]});var _0x4fab40=_0x0e34('0x22');return db[_0x0e34('0x23')]['destroy']({'where':{'type':_0x4fab40,'resourceId':_0x37ae53['id']}})['then'](function(){return _0x219fb0;});})[_0x0e34('0x20')](function(){_0x4cf661[_0x0e34('0x18')](0xcc)[_0x0e34('0x19')]();});}};}function handleEntityNotFound(_0x23de3b,_0x3b7acf){return function(_0x4ca44f){if(!_0x4ca44f){_0x23de3b[_0x0e34('0x24')](0x194);}return _0x4ca44f;};}function handleError(_0x3dd3e2,_0xfcc234){_0xfcc234=_0xfcc234||0x1f4;return function(_0x1403c8){logger[_0x0e34('0x25')](_0x1403c8[_0x0e34('0x26')]);if(_0x1403c8['name']){delete _0x1403c8[_0x0e34('0x27')];}_0x3dd3e2['status'](_0xfcc234)['send'](_0x1403c8);};}exports[_0x0e34('0x28')]=function(_0x3aebbc,_0x26e43c){var _0x1ac329={},_0x494549={},_0x51071c={'count':0x0,'rows':[]};var _0x417a34=_[_0x0e34('0x29')](db[_0x0e34('0x2a')][_0x0e34('0x2b')],function(_0x42412b){return{'name':_0x42412b[_0x0e34('0x2c')],'type':_0x42412b[_0x0e34('0x2d')][_0x0e34('0x2e')]};});_0x494549[_0x0e34('0x2f')]=_[_0x0e34('0x29')](_0x417a34,_0x0e34('0x27'));_0x494549[_0x0e34('0x30')]=_[_0x0e34('0x31')](_0x3aebbc[_0x0e34('0x30')]);_0x494549['filters']=_[_0x0e34('0x32')](_0x494549[_0x0e34('0x2f')],_0x494549[_0x0e34('0x30')]);_0x1ac329[_0x0e34('0x33')]=_[_0x0e34('0x32')](_0x494549[_0x0e34('0x2f')],qs[_0x0e34('0x34')](_0x3aebbc[_0x0e34('0x30')]['fields']));_0x1ac329[_0x0e34('0x33')]=_0x1ac329[_0x0e34('0x33')][_0x0e34('0x35')]?_0x1ac329[_0x0e34('0x33')]:_0x494549[_0x0e34('0x2f')];if(!_0x3aebbc[_0x0e34('0x30')][_0x0e34('0x36')](_0x0e34('0x37'))){_0x1ac329['limit']=qs['limit'](_0x3aebbc['query'][_0x0e34('0x38')]);_0x1ac329[_0x0e34('0x1a')]=qs['offset'](_0x3aebbc[_0x0e34('0x30')][_0x0e34('0x1a')]);}_0x1ac329[_0x0e34('0x39')]=qs['sort'](_0x3aebbc['query'][_0x0e34('0x3a')]);_0x1ac329[_0x0e34('0x3b')]=qs[_0x0e34('0x3c')](_[_0x0e34('0x3d')](_0x3aebbc[_0x0e34('0x30')],_0x494549['filters']),_0x417a34);if(_0x3aebbc[_0x0e34('0x30')]['filter']){_0x1ac329[_0x0e34('0x3b')]=_['merge'](_0x1ac329[_0x0e34('0x3b')],{'$or':_[_0x0e34('0x29')](_0x417a34,function(_0x355b7b){if(_0x355b7b['type']!==_0x0e34('0x3e')){var _0x5b6de3={};_0x5b6de3[_0x355b7b[_0x0e34('0x27')]]={'$like':'%'+_0x3aebbc[_0x0e34('0x30')][_0x0e34('0x3f')]+'%'};return _0x5b6de3;}})});}_0x1ac329=_['merge']({},_0x1ac329,_0x3aebbc['options']);var _0xb00199={'where':_0x1ac329['where']};return db['CmContactHasPhone'][_0x0e34('0x40')](_0xb00199)[_0x0e34('0x20')](function(_0x3d4bda){_0x51071c[_0x0e34('0x40')]=_0x3d4bda;if(_0x3aebbc[_0x0e34('0x30')][_0x0e34('0x41')]){_0x1ac329[_0x0e34('0x42')]=[{'all':!![]}];}return db[_0x0e34('0x2a')][_0x0e34('0x43')](_0x1ac329);})[_0x0e34('0x20')](function(_0x448cff){_0x51071c[_0x0e34('0x44')]=_0x448cff;return _0x51071c;})[_0x0e34('0x20')](respondWithFilteredResult(_0x26e43c,_0x1ac329))[_0x0e34('0x45')](handleError(_0x26e43c,null));};exports[_0x0e34('0x46')]=function(_0x3b94ad,_0x1e2543){var _0x202ab2={'raw':!![],'where':{'id':_0x3b94ad['params']['id']}},_0x1a9315={};_0x1a9315['model']=_['keys'](db[_0x0e34('0x2a')][_0x0e34('0x2b')]);_0x1a9315[_0x0e34('0x30')]=_[_0x0e34('0x31')](_0x3b94ad['query']);_0x1a9315[_0x0e34('0x3c')]=_[_0x0e34('0x32')](_0x1a9315['model'],_0x1a9315[_0x0e34('0x30')]);_0x202ab2['attributes']=_[_0x0e34('0x32')](_0x1a9315[_0x0e34('0x2f')],qs['fields'](_0x3b94ad[_0x0e34('0x30')][_0x0e34('0x34')]));_0x202ab2['attributes']=_0x202ab2[_0x0e34('0x33')][_0x0e34('0x35')]?_0x202ab2[_0x0e34('0x33')]:_0x1a9315[_0x0e34('0x2f')];if(_0x3b94ad[_0x0e34('0x30')][_0x0e34('0x41')]){_0x202ab2[_0x0e34('0x42')]=[{'all':!![]}];}_0x202ab2=_[_0x0e34('0x47')]({},_0x202ab2,_0x3b94ad[_0x0e34('0x48')]);return db['CmContactHasPhone'][_0x0e34('0x49')](_0x202ab2)['then'](handleEntityNotFound(_0x1e2543,null))[_0x0e34('0x20')](respondWithResult(_0x1e2543,null))[_0x0e34('0x45')](handleError(_0x1e2543,null));};exports[_0x0e34('0x4a')]=function(_0x3521a0,_0x367ba6){return db[_0x0e34('0x2a')][_0x0e34('0x4a')](_0x3521a0['body'],{})['then'](function(_0x5a83b4){var _0x31dcd4=_0x3521a0[_0x0e34('0x4b')]['get']({'plain':!![]});if(!_0x31dcd4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x31dcd4[_0x0e34('0x4c')]==='user'){var _0xe50e76=_0x5a83b4[_0x0e34('0x4d')]({'plain':!![]});var _0x228cfe='CmContactHasPhones';return db[_0x0e34('0x4e')][_0x0e34('0x49')]({'where':{'name':_0x228cfe,'userProfileId':_0x31dcd4[_0x0e34('0x4f')]},'raw':!![]})['then'](function(_0x478c38){if(_0x478c38&&_0x478c38[_0x0e34('0x50')]===0x0){return db[_0x0e34('0x23')][_0x0e34('0x4a')]({'name':_0xe50e76['name'],'resourceId':_0xe50e76['id'],'type':_0x478c38[_0x0e34('0x27')],'sectionId':_0x478c38['id']},{})[_0x0e34('0x20')](function(){return _0x5a83b4;});}else{return _0x5a83b4;}})[_0x0e34('0x45')](function(_0x5664c8){logger[_0x0e34('0x25')](_0x0e34('0x51'),_0x5664c8);throw _0x5664c8;});}return _0x5a83b4;})['then'](respondWithResult(_0x367ba6,0xc9))[_0x0e34('0x45')](handleError(_0x367ba6,null));};exports['update']=function(_0x3420b3,_0x595177){if(_0x3420b3['body']['id']){delete _0x3420b3[_0x0e34('0x52')]['id'];}return db[_0x0e34('0x2a')]['find']({'where':{'id':_0x3420b3['params']['id']}})[_0x0e34('0x20')](handleEntityNotFound(_0x595177,null))[_0x0e34('0x20')](saveUpdates(_0x3420b3[_0x0e34('0x52')],null))['then'](respondWithResult(_0x595177,null))['catch'](handleError(_0x595177,null));};exports[_0x0e34('0x21')]=function(_0x1a1e40,_0x14a9b3){return db[_0x0e34('0x2a')][_0x0e34('0x49')]({'where':{'id':_0x1a1e40[_0x0e34('0x53')]['id']}})[_0x0e34('0x20')](handleEntityNotFound(_0x14a9b3,null))[_0x0e34('0x20')](removeEntity(_0x14a9b3,null))[_0x0e34('0x45')](handleError(_0x14a9b3,null));}; \ No newline at end of file +var _0x3124=['moment','bluebird','mustache','util','path','sox','to-csv','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','json','apply','reject','save','update','then','destroy','get','CmContactHasPhones','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','CmContactHasPhone','count','includeAll','findAll','rows','show','params','length','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','zip-dir','fast-json-patch'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0x3124,0xf8));var _0x4312=function(_0x532bfc,_0x130691){_0x532bfc=_0x532bfc-0x0;var _0x5d43db=_0x3124[_0x532bfc];return _0x5d43db;};'use strict';var pdf=require(_0x4312('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4312('0x1'));var zipdir=require(_0x4312('0x2'));var jsonpatch=require(_0x4312('0x3'));var rp=require('request-promise');var moment=require(_0x4312('0x4'));var BPromise=require(_0x4312('0x5'));var Mustache=require(_0x4312('0x6'));var util=require(_0x4312('0x7'));var path=require(_0x4312('0x8'));var sox=require(_0x4312('0x9'));var csv=require(_0x4312('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x4312('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x4312('0xc'));var toCsv=require(_0x4312('0xa'));var querystring=require(_0x4312('0xd'));var Papa=require(_0x4312('0xe'));var Redis=require(_0x4312('0xf'));var authService=require(_0x4312('0x10'));var qs=require(_0x4312('0x11'));var as=require(_0x4312('0x12'));var hardwareService=require(_0x4312('0x13'));var logger=require(_0x4312('0x14'))('api');var utils=require(_0x4312('0x15'));var config=require(_0x4312('0x16'));var db=require(_0x4312('0x17'))['db'];function respondWithStatusCode(_0x3e9dfb,_0x89b522){_0x89b522=_0x89b522||0xcc;return function(_0x1a4d9a){if(_0x1a4d9a){return _0x3e9dfb[_0x4312('0x18')](_0x89b522);}return _0x3e9dfb[_0x4312('0x19')](_0x89b522)[_0x4312('0x1a')]();};}function respondWithResult(_0x1b0ecc,_0x284b5d){_0x284b5d=_0x284b5d||0xc8;return function(_0x3763d8){if(_0x3763d8){return _0x1b0ecc[_0x4312('0x19')](_0x284b5d)['json'](_0x3763d8);}};}function respondWithFilteredResult(_0x4ff976,_0x183715){return function(_0x17a636){if(_0x17a636){var _0x3d1855=_0x17a636['count'],_0x214428=_0x183715[_0x4312('0x1b')],_0x4721b9=_0x183715['offset']+_0x183715['limit'],_0x2d2ab6;if(_0x4721b9>=_0x3d1855){_0x4721b9=_0x3d1855;_0x2d2ab6=0xc8;}else{_0x2d2ab6=0xce;}_0x4ff976[_0x4312('0x19')](_0x2d2ab6);return _0x4ff976[_0x4312('0x1c')]('Content-Range',_0x214428+'-'+_0x4721b9+'/'+_0x3d1855)[_0x4312('0x1d')](_0x17a636);}return null;};}function patchUpdates(_0x43f569){return function(_0x5e9a51){try{jsonpatch[_0x4312('0x1e')](_0x5e9a51,_0x43f569,!![]);}catch(_0x28cb54){return BPromise[_0x4312('0x1f')](_0x28cb54);}return _0x5e9a51[_0x4312('0x20')]();};}function saveUpdates(_0x3b16e8,_0xe931c3){return function(_0x9fc09c){if(_0x9fc09c){return _0x9fc09c[_0x4312('0x21')](_0x3b16e8)[_0x4312('0x22')](function(_0x4e43be){return _0x4e43be;});}return null;};}function removeEntity(_0xda44bc,_0x760f26){return function(_0x2531f7){if(_0x2531f7){return _0x2531f7[_0x4312('0x23')]()[_0x4312('0x22')](function(){var _0x22f0a6=_0x2531f7[_0x4312('0x24')]({'plain':!![]});var _0x27a6fb=_0x4312('0x25');return db['UserProfileResource'][_0x4312('0x23')]({'where':{'type':_0x27a6fb,'resourceId':_0x22f0a6['id']}})[_0x4312('0x22')](function(){return _0x2531f7;});})[_0x4312('0x22')](function(){_0xda44bc[_0x4312('0x19')](0xcc)[_0x4312('0x1a')]();});}};}function handleEntityNotFound(_0x17502b,_0x5b6a72){return function(_0x5d6dbf){if(!_0x5d6dbf){_0x17502b[_0x4312('0x18')](0x194);}return _0x5d6dbf;};}function handleError(_0x2c7a13,_0x356bbb){_0x356bbb=_0x356bbb||0x1f4;return function(_0x5e0dc3){logger[_0x4312('0x26')](_0x5e0dc3[_0x4312('0x27')]);if(_0x5e0dc3[_0x4312('0x28')]){delete _0x5e0dc3[_0x4312('0x28')];}_0x2c7a13[_0x4312('0x19')](_0x356bbb)[_0x4312('0x29')](_0x5e0dc3);};}exports[_0x4312('0x2a')]=function(_0x22e78f,_0x486218){var _0x5ba229={},_0x1ce5e3={},_0x1b373f={'count':0x0,'rows':[]};var _0x2e054a=_['map'](db['CmContactHasPhone'][_0x4312('0x2b')],function(_0x1e0871){return{'name':_0x1e0871[_0x4312('0x2c')],'type':_0x1e0871[_0x4312('0x2d')][_0x4312('0x2e')]};});_0x1ce5e3[_0x4312('0x2f')]=_[_0x4312('0x30')](_0x2e054a,_0x4312('0x28'));_0x1ce5e3[_0x4312('0x31')]=_[_0x4312('0x32')](_0x22e78f[_0x4312('0x31')]);_0x1ce5e3[_0x4312('0x33')]=_['intersection'](_0x1ce5e3[_0x4312('0x2f')],_0x1ce5e3[_0x4312('0x31')]);_0x5ba229['attributes']=_[_0x4312('0x34')](_0x1ce5e3[_0x4312('0x2f')],qs[_0x4312('0x35')](_0x22e78f['query'][_0x4312('0x35')]));_0x5ba229[_0x4312('0x36')]=_0x5ba229['attributes']['length']?_0x5ba229[_0x4312('0x36')]:_0x1ce5e3[_0x4312('0x2f')];if(!_0x22e78f[_0x4312('0x31')][_0x4312('0x37')](_0x4312('0x38'))){_0x5ba229[_0x4312('0x39')]=qs[_0x4312('0x39')](_0x22e78f['query'][_0x4312('0x39')]);_0x5ba229[_0x4312('0x1b')]=qs['offset'](_0x22e78f['query'][_0x4312('0x1b')]);}_0x5ba229[_0x4312('0x3a')]=qs[_0x4312('0x3b')](_0x22e78f[_0x4312('0x31')]['sort']);_0x5ba229[_0x4312('0x3c')]=qs[_0x4312('0x33')](_[_0x4312('0x3d')](_0x22e78f[_0x4312('0x31')],_0x1ce5e3[_0x4312('0x33')]),_0x2e054a);if(_0x22e78f['query'][_0x4312('0x3e')]){_0x5ba229[_0x4312('0x3c')]=_[_0x4312('0x3f')](_0x5ba229[_0x4312('0x3c')],{'$or':_[_0x4312('0x30')](_0x2e054a,function(_0x3136fc){if(_0x3136fc['type']!=='VIRTUAL'){var _0x2367c2={};_0x2367c2[_0x3136fc[_0x4312('0x28')]]={'$like':'%'+_0x22e78f['query'][_0x4312('0x3e')]+'%'};return _0x2367c2;}})});}_0x5ba229=_['merge']({},_0x5ba229,_0x22e78f[_0x4312('0x40')]);var _0x1e30a8={'where':_0x5ba229[_0x4312('0x3c')]};return db[_0x4312('0x41')]['count'](_0x1e30a8)['then'](function(_0x20576f){_0x1b373f[_0x4312('0x42')]=_0x20576f;if(_0x22e78f[_0x4312('0x31')][_0x4312('0x43')]){_0x5ba229['include']=[{'all':!![]}];}return db[_0x4312('0x41')][_0x4312('0x44')](_0x5ba229);})[_0x4312('0x22')](function(_0x2cad01){_0x1b373f[_0x4312('0x45')]=_0x2cad01;return _0x1b373f;})['then'](respondWithFilteredResult(_0x486218,_0x5ba229))['catch'](handleError(_0x486218,null));};exports[_0x4312('0x46')]=function(_0x3b014d,_0x1f5d47){var _0x2bf87a={'raw':!![],'where':{'id':_0x3b014d[_0x4312('0x47')]['id']}},_0x1280b3={};_0x1280b3[_0x4312('0x2f')]=_[_0x4312('0x32')](db['CmContactHasPhone'][_0x4312('0x2b')]);_0x1280b3[_0x4312('0x31')]=_['keys'](_0x3b014d[_0x4312('0x31')]);_0x1280b3[_0x4312('0x33')]=_['intersection'](_0x1280b3[_0x4312('0x2f')],_0x1280b3[_0x4312('0x31')]);_0x2bf87a[_0x4312('0x36')]=_[_0x4312('0x34')](_0x1280b3[_0x4312('0x2f')],qs['fields'](_0x3b014d[_0x4312('0x31')][_0x4312('0x35')]));_0x2bf87a[_0x4312('0x36')]=_0x2bf87a[_0x4312('0x36')][_0x4312('0x48')]?_0x2bf87a[_0x4312('0x36')]:_0x1280b3[_0x4312('0x2f')];if(_0x3b014d[_0x4312('0x31')]['includeAll']){_0x2bf87a[_0x4312('0x49')]=[{'all':!![]}];}_0x2bf87a=_['merge']({},_0x2bf87a,_0x3b014d[_0x4312('0x40')]);return db['CmContactHasPhone'][_0x4312('0x4a')](_0x2bf87a)[_0x4312('0x22')](handleEntityNotFound(_0x1f5d47,null))[_0x4312('0x22')](respondWithResult(_0x1f5d47,null))[_0x4312('0x4b')](handleError(_0x1f5d47,null));};exports[_0x4312('0x4c')]=function(_0x94b7b4,_0x560ab0){return db[_0x4312('0x41')][_0x4312('0x4c')](_0x94b7b4['body'],{})[_0x4312('0x22')](function(_0x5f400b){var _0x4b0c9f=_0x94b7b4[_0x4312('0x4d')][_0x4312('0x24')]({'plain':!![]});if(!_0x4b0c9f)throw new Error(_0x4312('0x4e'));if(_0x4b0c9f[_0x4312('0x4f')]===_0x4312('0x4d')){var _0x52bfa3=_0x5f400b['get']({'plain':!![]});var _0x305a3c=_0x4312('0x25');return db['UserProfileSection'][_0x4312('0x4a')]({'where':{'name':_0x305a3c,'userProfileId':_0x4b0c9f[_0x4312('0x50')]},'raw':!![]})['then'](function(_0x309090){if(_0x309090&&_0x309090[_0x4312('0x51')]===0x0){return db['UserProfileResource'][_0x4312('0x4c')]({'name':_0x52bfa3[_0x4312('0x28')],'resourceId':_0x52bfa3['id'],'type':_0x309090[_0x4312('0x28')],'sectionId':_0x309090['id']},{})[_0x4312('0x22')](function(){return _0x5f400b;});}else{return _0x5f400b;}})[_0x4312('0x4b')](function(_0x4b5bc8){logger['error'](_0x4312('0x52'),_0x4b5bc8);throw _0x4b5bc8;});}return _0x5f400b;})[_0x4312('0x22')](respondWithResult(_0x560ab0,0xc9))['catch'](handleError(_0x560ab0,null));};exports[_0x4312('0x21')]=function(_0x352d66,_0x493848){if(_0x352d66[_0x4312('0x53')]['id']){delete _0x352d66['body']['id'];}return db[_0x4312('0x41')][_0x4312('0x4a')]({'where':{'id':_0x352d66[_0x4312('0x47')]['id']}})[_0x4312('0x22')](handleEntityNotFound(_0x493848,null))[_0x4312('0x22')](saveUpdates(_0x352d66[_0x4312('0x53')],null))['then'](respondWithResult(_0x493848,null))['catch'](handleError(_0x493848,null));};exports['destroy']=function(_0x53ebb0,_0x5b1d1c){return db[_0x4312('0x41')][_0x4312('0x4a')]({'where':{'id':_0x53ebb0[_0x4312('0x47')]['id']}})[_0x4312('0x22')](handleEntityNotFound(_0x5b1d1c,null))[_0x4312('0x22')](removeEntity(_0x5b1d1c,null))['catch'](handleError(_0x5b1d1c,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.model.js b/server/api/cmContactHasPhone/cmContactHasPhone.model.js index 25b4c61..92b1578 100644 --- a/server/api/cmContactHasPhone/cmContactHasPhone.model.js +++ b/server/api/cmContactHasPhone/cmContactHasPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ed2=['CmContactHasPhone','cm_contact_has_phones','lodash','util','api','moment','request-promise','path','../../config/environment','./cmContactHasPhone.attributes','exports','define'];(function(_0x3e9d7a,_0x2c037b){var _0x460e31=function(_0x4b35d6){while(--_0x4b35d6){_0x3e9d7a['push'](_0x3e9d7a['shift']());}};_0x460e31(++_0x2c037b);}(_0x8ed2,0x1ee));var _0x28ed=function(_0x5a4263,_0x181577){_0x5a4263=_0x5a4263-0x0;var _0x215c8a=_0x8ed2[_0x5a4263];return _0x215c8a;};'use strict';var _=require(_0x28ed('0x0'));var util=require(_0x28ed('0x1'));var logger=require('../../config/logger')(_0x28ed('0x2'));var moment=require(_0x28ed('0x3'));var BPromise=require('bluebird');var rp=require(_0x28ed('0x4'));var fs=require('fs');var path=require(_0x28ed('0x5'));var rimraf=require('rimraf');var config=require(_0x28ed('0x6'));var attributes=require(_0x28ed('0x7'));module[_0x28ed('0x8')]=function(_0x2271b1,_0x9f5aa3){return _0x2271b1[_0x28ed('0x9')](_0x28ed('0xa'),attributes,{'tableName':_0x28ed('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3d8=['rimraf','../../config/environment','./cmContactHasPhone.attributes','exports','define','cm_contact_has_phones','lodash','util','moment','bluebird','request-promise','path'];(function(_0x4b095c,_0x41045e){var _0x4eabc6=function(_0x20e99e){while(--_0x20e99e){_0x4b095c['push'](_0x4b095c['shift']());}};_0x4eabc6(++_0x41045e);}(_0xa3d8,0x17a));var _0x8a3d=function(_0x5cf519,_0x3325f8){_0x5cf519=_0x5cf519-0x0;var _0x84406f=_0xa3d8[_0x5cf519];return _0x84406f;};'use strict';var _=require(_0x8a3d('0x0'));var util=require(_0x8a3d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8a3d('0x2'));var BPromise=require(_0x8a3d('0x3'));var rp=require(_0x8a3d('0x4'));var fs=require('fs');var path=require(_0x8a3d('0x5'));var rimraf=require(_0x8a3d('0x6'));var config=require(_0x8a3d('0x7'));var attributes=require(_0x8a3d('0x8'));module[_0x8a3d('0x9')]=function(_0xeb12cd,_0x784cad){return _0xeb12cd[_0x8a3d('0xa')]('CmContactHasPhone',attributes,{'tableName':_0x8a3d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js b/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js index 53e5261..8fa58af 100644 --- a/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js +++ b/server/api/cmContactHasPhone/cmContactHasPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fa2=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','request','CmContactHasPhone,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x42fced,_0x55d428){var _0x12c61e=function(_0x29d41b){while(--_0x29d41b){_0x42fced['push'](_0x42fced['shift']());}};_0x12c61e(++_0x55d428);}(_0x9fa2,0x67));var _0x29fa=function(_0x57d740,_0x50be99){_0x57d740=_0x57d740-0x0;var _0x6607ef=_0x9fa2[_0x57d740];return _0x6607ef;};'use strict';var _=require(_0x29fa('0x0'));var util=require(_0x29fa('0x1'));var moment=require(_0x29fa('0x2'));var BPromise=require(_0x29fa('0x3'));var rs=require(_0x29fa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x29fa('0x6'));var config=require('../../config/environment');var jayson=require(_0x29fa('0x7'));var client=jayson[_0x29fa('0x8')][_0x29fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe1cbe2,_0x462420,_0x20ebea){return new BPromise(function(_0x7e844d,_0x25bff1){return client[_0x29fa('0xa')](_0xe1cbe2,_0x20ebea)['then'](function(_0x14d284){logger['info'](_0x29fa('0xb'),_0x462420,_0x29fa('0xc'));logger[_0x29fa('0xd')]('CmContactHasPhone,\x20%s,\x20%s,\x20%s',_0x462420,_0x29fa('0xc'),JSON[_0x29fa('0xe')](_0x14d284));if(_0x14d284[_0x29fa('0xf')]){if(_0x14d284[_0x29fa('0xf')][_0x29fa('0x10')]===0x1f4){logger[_0x29fa('0xf')]('CmContactHasPhone,\x20%s,\x20%s',_0x462420,_0x14d284[_0x29fa('0xf')][_0x29fa('0x11')]);return _0x25bff1(_0x14d284['error'][_0x29fa('0x11')]);}logger[_0x29fa('0xf')](_0x29fa('0xb'),_0x462420,_0x14d284['error'][_0x29fa('0x11')]);return _0x7e844d(_0x14d284[_0x29fa('0xf')][_0x29fa('0x11')]);}else{logger['info']('CmContactHasPhone,\x20%s,\x20%s',_0x462420,'request\x20sent');_0x7e844d(_0x14d284[_0x29fa('0x12')]['message']);}})[_0x29fa('0x13')](function(_0x3ff8d9){logger['error'](_0x29fa('0xb'),_0x462420,_0x3ff8d9);_0x25bff1(_0x3ff8d9);});});} \ No newline at end of file +var _0xd114=['jayson/promise','client','request','then','info','debug','CmContactHasPhone,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmContactHasPhone,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xd114,0x157));var _0x4d11=function(_0xbbb14c,_0x267f70){_0xbbb14c=_0xbbb14c-0x0;var _0xbd6666=_0xd114[_0xbbb14c];return _0xbd6666;};'use strict';var _=require(_0x4d11('0x0'));var util=require(_0x4d11('0x1'));var moment=require(_0x4d11('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4d11('0x3'));var db=require(_0x4d11('0x4'))['db'];var utils=require(_0x4d11('0x5'));var logger=require(_0x4d11('0x6'))(_0x4d11('0x7'));var config=require(_0x4d11('0x8'));var jayson=require(_0x4d11('0x9'));var client=jayson[_0x4d11('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d50b2,_0x2775bc,_0xd4f991){return new BPromise(function(_0x44be54,_0x539720){return client[_0x4d11('0xb')](_0x5d50b2,_0xd4f991)[_0x4d11('0xc')](function(_0x3009f6){logger[_0x4d11('0xd')]('CmContactHasPhone,\x20%s,\x20%s',_0x2775bc,'request\x20sent');logger[_0x4d11('0xe')](_0x4d11('0xf'),_0x2775bc,_0x4d11('0x10'),JSON['stringify'](_0x3009f6));if(_0x3009f6['error']){if(_0x3009f6[_0x4d11('0x11')][_0x4d11('0x12')]===0x1f4){logger[_0x4d11('0x11')](_0x4d11('0x13'),_0x2775bc,_0x3009f6['error'][_0x4d11('0x14')]);return _0x539720(_0x3009f6['error'][_0x4d11('0x14')]);}logger[_0x4d11('0x11')](_0x4d11('0x13'),_0x2775bc,_0x3009f6[_0x4d11('0x11')][_0x4d11('0x14')]);return _0x44be54(_0x3009f6[_0x4d11('0x11')]['message']);}else{logger['info'](_0x4d11('0x13'),_0x2775bc,_0x4d11('0x10'));_0x44be54(_0x3009f6['result']['message']);}})[_0x4d11('0x15')](function(_0x4b88c2){logger[_0x4d11('0x11')](_0x4d11('0x13'),_0x2775bc,_0x4b88c2);_0x539720(_0x4b88c2);});});} \ No newline at end of file diff --git a/server/api/cmContactHasPhone/index.js b/server/api/cmContactHasPhone/index.js index ffb3be4..05be98d 100644 --- a/server/api/cmContactHasPhone/index.js +++ b/server/api/cmContactHasPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc76=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmContactHasPhone.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','destroy','exports','multer','util','path'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0xfc76,0x129));var _0x6fc7=function(_0x2ce9ae,_0x4f7835){_0x2ce9ae=_0x2ce9ae-0x0;var _0x4fe45b=_0xfc76[_0x2ce9ae];return _0x4fe45b;};'use strict';var multer=require(_0x6fc7('0x0'));var util=require(_0x6fc7('0x1'));var path=require(_0x6fc7('0x2'));var timeout=require(_0x6fc7('0x3'));var express=require(_0x6fc7('0x4'));var router=express[_0x6fc7('0x5')]();var auth=require(_0x6fc7('0x6'));var interaction=require(_0x6fc7('0x7'));var config=require('../../config/environment');var controller=require(_0x6fc7('0x8'));router[_0x6fc7('0x9')]('/',auth[_0x6fc7('0xa')](),controller[_0x6fc7('0xb')]);router[_0x6fc7('0x9')]('/:id',auth[_0x6fc7('0xa')](),controller[_0x6fc7('0xc')]);router[_0x6fc7('0xd')]('/',auth['isAuthenticated'](),controller[_0x6fc7('0xe')]);router[_0x6fc7('0xf')](_0x6fc7('0x10'),auth[_0x6fc7('0xa')](),controller[_0x6fc7('0x11')]);router['delete']('/:id',auth[_0x6fc7('0xa')](),controller[_0x6fc7('0x12')]);module[_0x6fc7('0x13')]=router; \ No newline at end of file +var _0x5feb=['./cmContactHasPhone.controller','get','isAuthenticated','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x501c85,_0x3eefcb){var _0x6ee4e=function(_0x51aa59){while(--_0x51aa59){_0x501c85['push'](_0x501c85['shift']());}};_0x6ee4e(++_0x3eefcb);}(_0x5feb,0xaa));var _0xb5fe=function(_0x5541ae,_0x4a902d){_0x5541ae=_0x5541ae-0x0;var _0x42adf6=_0x5feb[_0x5541ae];return _0x42adf6;};'use strict';var multer=require(_0xb5fe('0x0'));var util=require(_0xb5fe('0x1'));var path=require('path');var timeout=require(_0xb5fe('0x2'));var express=require(_0xb5fe('0x3'));var router=express[_0xb5fe('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb5fe('0x5'));var config=require('../../config/environment');var controller=require(_0xb5fe('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb5fe('0x7')]('/:id',auth[_0xb5fe('0x8')](),controller['show']);router[_0xb5fe('0x9')]('/',auth[_0xb5fe('0x8')](),controller[_0xb5fe('0xa')]);router[_0xb5fe('0xb')](_0xb5fe('0xc'),auth[_0xb5fe('0x8')](),controller[_0xb5fe('0xd')]);router[_0xb5fe('0xe')](_0xb5fe('0xc'),auth[_0xb5fe('0x8')](),controller['destroy']);module[_0xb5fe('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index ab7588d..1d5643d 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 _0x24cb=['alias','TEXT','long','getDataValue','type','select','parse','values','stringify','setDataValue','BOOLEAN','exports','VIRTUAL','STRING'];(function(_0xfad1cd,_0x21bbc7){var _0x3d9704=function(_0x59ad4b){while(--_0x59ad4b){_0xfad1cd['push'](_0xfad1cd['shift']());}};_0x3d9704(++_0x21bbc7);}(_0x24cb,0xb3));var _0xb24c=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x24cb[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0xb24c('0x0')]={'name':{'type':Sequelize[_0xb24c('0x1')],'get':function(_0x57fab6){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xb24c('0x2')],'allowNull':![],'set':function(_0x4933b6){this['setDataValue'](_0xb24c('0x3'),_0x4933b6?_0x4933b6:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0xb24c('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0xb24c('0x4')](_0xb24c('0x5')),'get':function(){if(this[_0xb24c('0x6')](_0xb24c('0x7'))===_0xb24c('0x8')){return JSON[_0xb24c('0x9')](this[_0xb24c('0x6')](_0xb24c('0xa')));}else{return this[_0xb24c('0x6')](_0xb24c('0xa'));}},'set':function(_0xde9e51){if(Array['isArray'](_0xde9e51)){this['setDataValue']('values',JSON[_0xb24c('0xb')](_0xde9e51));}else{this[_0xb24c('0xc')]('values',_0xde9e51);}}},'required':{'type':Sequelize[_0xb24c('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x6b70=['setDataValue','name','TEXT','type','values','BOOLEAN','sequelize','lodash','VIRTUAL','getDataValue','alias','STRING'];(function(_0x4ce7d2,_0x4f8e30){var _0x4017ba=function(_0x48a3a2){while(--_0x48a3a2){_0x4ce7d2['push'](_0x4ce7d2['shift']());}};_0x4017ba(++_0x4f8e30);}(_0x6b70,0x72));var _0x06b7=function(_0x57a53b,_0x11494e){_0x57a53b=_0x57a53b-0x0;var _0x29e81c=_0x6b70[_0x57a53b];return _0x29e81c;};'use strict';var Sequelize=require(_0x06b7('0x0'));var _=require(_0x06b7('0x1'));module['exports']={'name':{'type':Sequelize[_0x06b7('0x2')],'get':function(_0xffbbaa){return this[_0x06b7('0x3')](_0x06b7('0x4'));}},'alias':{'type':Sequelize[_0x06b7('0x5')],'allowNull':![],'set':function(_0x1cd894){this[_0x06b7('0x6')](_0x06b7('0x4'),_0x1cd894?_0x1cd894:this[_0x06b7('0x3')](_0x06b7('0x7')));}},'type':{'type':Sequelize[_0x06b7('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x06b7('0x8')]('long'),'get':function(){if(this[_0x06b7('0x3')](_0x06b7('0x9'))==='select'){return JSON['parse'](this[_0x06b7('0x3')](_0x06b7('0xa')));}else{return this[_0x06b7('0x3')](_0x06b7('0xa'));}},'set':function(_0xc2e1e9){if(Array['isArray'](_0xc2e1e9)){this[_0x06b7('0x6')](_0x06b7('0xa'),JSON['stringify'](_0xc2e1e9));}else{this[_0x06b7('0x6')](_0x06b7('0xa'),_0xc2e1e9);}}},'required':{'type':Sequelize[_0x06b7('0xb')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index daf473b..22848d8 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 _0x60f1=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','then','destroy','send','map','CmCustomField','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','merge','where','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','options','update','body','find','create','sequelize','Sequelize','TEXT','text','INTEGER','switch','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x2b4df5,_0x2fc06b){var _0x43b54c=function(_0xa570cf){while(--_0xa570cf){_0x2b4df5['push'](_0x2b4df5['shift']());}};_0x43b54c(++_0x2fc06b);}(_0x60f1,0x93));var _0x160f=function(_0x19dd8a,_0x4af545){_0x19dd8a=_0x19dd8a-0x0;var _0x6245d3=_0x60f1[_0x19dd8a];return _0x6245d3;};'use strict';var pdf=require(_0x160f('0x0'));var emlformat=require(_0x160f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x160f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x160f('0x3'));var moment=require(_0x160f('0x4'));var BPromise=require(_0x160f('0x5'));var Mustache=require(_0x160f('0x6'));var util=require(_0x160f('0x7'));var path=require(_0x160f('0x8'));var sox=require(_0x160f('0x9'));var csv=require(_0x160f('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x160f('0xb'));var crypto=require(_0x160f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x160f('0xd'));var toCsv=require(_0x160f('0xa'));var querystring=require(_0x160f('0xe'));var Papa=require('papaparse');var Redis=require(_0x160f('0xf'));var authService=require(_0x160f('0x10'));var qs=require(_0x160f('0x11'));var as=require(_0x160f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x160f('0x13'))(_0x160f('0x14'));var utils=require(_0x160f('0x15'));var config=require(_0x160f('0x16'));var db=require(_0x160f('0x17'))['db'];function respondWithStatusCode(_0x446e79,_0x4465cf){_0x4465cf=_0x4465cf||0xcc;return function(_0x318a25){if(_0x318a25){return _0x446e79[_0x160f('0x18')](_0x4465cf);}return _0x446e79[_0x160f('0x19')](_0x4465cf)[_0x160f('0x1a')]();};}function respondWithResult(_0x1e1d56,_0x2b0c30){_0x2b0c30=_0x2b0c30||0xc8;return function(_0x4e1e09){if(_0x4e1e09){return _0x1e1d56['status'](_0x2b0c30)[_0x160f('0x1b')](_0x4e1e09);}};}function respondWithFilteredResult(_0x2e6871,_0x45d39f){return function(_0x132ac7){if(_0x132ac7){var _0x91f07=_0x132ac7[_0x160f('0x1c')],_0x11777d=_0x45d39f[_0x160f('0x1d')],_0x146384=_0x45d39f[_0x160f('0x1d')]+_0x45d39f[_0x160f('0x1e')],_0x4b00ef;if(_0x146384>=_0x91f07){_0x146384=_0x91f07;_0x4b00ef=0xc8;}else{_0x4b00ef=0xce;}_0x2e6871['status'](_0x4b00ef);return _0x2e6871[_0x160f('0x1f')](_0x160f('0x20'),_0x11777d+'-'+_0x146384+'/'+_0x91f07)['json'](_0x132ac7);}return null;};}function patchUpdates(_0x27b317){return function(_0x2a3e50){try{jsonpatch['apply'](_0x2a3e50,_0x27b317,!![]);}catch(_0x4bb14f){return BPromise[_0x160f('0x21')](_0x4bb14f);}return _0x2a3e50['save']();};}function saveUpdates(_0x38aeb9,_0x3eb606){return function(_0x49d82f){if(_0x49d82f){return _0x49d82f['update'](_0x38aeb9)[_0x160f('0x22')](function(_0x4b88cb){return _0x4b88cb;});}return null;};}function removeEntity(_0xd5176b,_0x4eb260){return function(_0x505713){if(_0x505713){return _0x505713[_0x160f('0x23')]()[_0x160f('0x22')](function(){_0xd5176b[_0x160f('0x19')](0xcc)[_0x160f('0x1a')]();});}};}function handleEntityNotFound(_0x5da274,_0x3f4ba4){return function(_0x3d64f1){if(!_0x3d64f1){_0x5da274['sendStatus'](0x194);}return _0x3d64f1;};}function handleError(_0x202318,_0x2de5f0){_0x2de5f0=_0x2de5f0||0x1f4;return function(_0x3a0162){logger['error'](_0x3a0162['stack']);if(_0x3a0162['name']){delete _0x3a0162['name'];}_0x202318['status'](_0x2de5f0)[_0x160f('0x24')](_0x3a0162);};}exports['index']=function(_0x4fe1b1,_0x4fab64){var _0x36b236={},_0xed7fc4={},_0x3dd22f={'count':0x0,'rows':[]};var _0x411458=_[_0x160f('0x25')](db[_0x160f('0x26')][_0x160f('0x27')],function(_0x2f03bd){return{'name':_0x2f03bd[_0x160f('0x28')],'type':_0x2f03bd['type'][_0x160f('0x29')]};});_0xed7fc4[_0x160f('0x2a')]=_['differenceBy'](_[_0x160f('0x25')](_0x411458,'name'),[_0x160f('0x2b')]);_0xed7fc4[_0x160f('0x2c')]=_[_0x160f('0x2d')](_0x4fe1b1[_0x160f('0x2c')]);_0xed7fc4['filters']=_[_0x160f('0x2e')](_0xed7fc4[_0x160f('0x2a')],_0xed7fc4[_0x160f('0x2c')]);_0x36b236[_0x160f('0x2f')]=_['intersection'](_0xed7fc4[_0x160f('0x2a')],qs[_0x160f('0x30')](_0x4fe1b1[_0x160f('0x2c')][_0x160f('0x30')]));_0x36b236[_0x160f('0x2f')]=_0x36b236[_0x160f('0x2f')][_0x160f('0x31')]?_0x36b236[_0x160f('0x2f')]:_0xed7fc4[_0x160f('0x2a')];if(!_0x4fe1b1[_0x160f('0x2c')][_0x160f('0x32')]('nolimit')){_0x36b236[_0x160f('0x1e')]=qs[_0x160f('0x1e')](_0x4fe1b1[_0x160f('0x2c')][_0x160f('0x1e')]);_0x36b236[_0x160f('0x1d')]=qs['offset'](_0x4fe1b1['query'][_0x160f('0x1d')]);}_0x36b236[_0x160f('0x33')]=qs[_0x160f('0x34')](_0x4fe1b1[_0x160f('0x2c')][_0x160f('0x34')]);_0x36b236['where']=qs['filters'](_[_0x160f('0x35')](_0x4fe1b1['query'],_0xed7fc4[_0x160f('0x36')]),_0x411458);if(_0x4fe1b1[_0x160f('0x2c')]['filter']){_0x36b236['where']=_[_0x160f('0x37')](_0x36b236[_0x160f('0x38')],{'$or':_[_0x160f('0x25')](_0x411458,function(_0x1a8334){if(_0x1a8334[_0x160f('0x39')]!==_0x160f('0x3a')){var _0x4136ef={};_0x4136ef[_0x1a8334['name']]={'$like':'%'+_0x4fe1b1[_0x160f('0x2c')][_0x160f('0x3b')]+'%'};return _0x4136ef;}})});}_0x36b236=_[_0x160f('0x37')]({},_0x36b236,_0x4fe1b1['options']);var _0x2ca701={'where':_0x36b236[_0x160f('0x38')]};return db['CmCustomField'][_0x160f('0x1c')](_0x2ca701)[_0x160f('0x22')](function(_0x3de3d0){_0x3dd22f[_0x160f('0x1c')]=_0x3de3d0;if(_0x4fe1b1[_0x160f('0x2c')][_0x160f('0x3c')]){_0x36b236[_0x160f('0x3d')]=[{'all':!![]}];}return db[_0x160f('0x26')][_0x160f('0x3e')](_0x36b236);})[_0x160f('0x22')](function(_0x520899){_0x3dd22f[_0x160f('0x3f')]=_0x520899;return _0x3dd22f;})[_0x160f('0x22')](respondWithFilteredResult(_0x4fab64,_0x36b236))[_0x160f('0x40')](handleError(_0x4fab64,null));};exports[_0x160f('0x41')]=function(_0x4d1a7a,_0x276349){var _0x2f3938={'raw':!![],'where':{'id':_0x4d1a7a[_0x160f('0x42')]['id']}},_0x48449c={};_0x48449c[_0x160f('0x2a')]=_[_0x160f('0x2d')](db['CmCustomField'][_0x160f('0x27')]);_0x48449c[_0x160f('0x2c')]=_['keys'](_0x4d1a7a[_0x160f('0x2c')]);_0x48449c[_0x160f('0x36')]=_[_0x160f('0x2e')](_0x48449c[_0x160f('0x2a')],_0x48449c[_0x160f('0x2c')]);_0x2f3938[_0x160f('0x2f')]=_[_0x160f('0x2e')](_0x48449c['model'],qs['fields'](_0x4d1a7a[_0x160f('0x2c')]['fields']));_0x2f3938[_0x160f('0x2f')]=_0x2f3938['attributes']['length']?_0x2f3938['attributes']:_0x48449c[_0x160f('0x2a')];if(_0x4d1a7a[_0x160f('0x2c')]['includeAll']){_0x2f3938['include']=[{'all':!![]}];}_0x2f3938=_['merge']({},_0x2f3938,_0x4d1a7a[_0x160f('0x43')]);return db[_0x160f('0x26')]['find'](_0x2f3938)[_0x160f('0x22')](handleEntityNotFound(_0x276349,null))[_0x160f('0x22')](respondWithResult(_0x276349,null))[_0x160f('0x40')](handleError(_0x276349,null));};exports[_0x160f('0x44')]=function(_0xc9dd58,_0x243f92){if(_0xc9dd58['body']['id']){delete _0xc9dd58[_0x160f('0x45')]['id'];}return db[_0x160f('0x26')][_0x160f('0x46')]({'where':{'id':_0xc9dd58['params']['id']}})[_0x160f('0x22')](handleEntityNotFound(_0x243f92,null))['then'](saveUpdates(_0xc9dd58['body'],null))[_0x160f('0x22')](respondWithResult(_0x243f92,null))[_0x160f('0x40')](handleError(_0x243f92,null));};exports[_0x160f('0x23')]=function(_0xf9b7c3,_0x1ee582){return db[_0x160f('0x26')][_0x160f('0x46')]({'where':{'id':_0xf9b7c3[_0x160f('0x42')]['id']}})[_0x160f('0x22')](handleEntityNotFound(_0x1ee582,null))[_0x160f('0x22')](removeEntity(_0x1ee582,null))[_0x160f('0x40')](handleError(_0x1ee582,null));};exports[_0x160f('0x47')]=function(_0x1eda5a,_0x1e5a41){var _0x4204d2;return db[_0x160f('0x48')]['transaction'](function(_0x56bcd4){return db[_0x160f('0x26')][_0x160f('0x47')](_0x1eda5a[_0x160f('0x45')],{'transaction':_0x56bcd4})[_0x160f('0x22')](function(_0x2a5b7f){_0x4204d2=_0x2a5b7f;var _0x1c7823={'type':db[_0x160f('0x49')][_0x160f('0x4a')],'transaction':_0x56bcd4};switch(_0x1eda5a[_0x160f('0x45')][_0x160f('0x39')]){case _0x160f('0x4b'):_0x1c7823[_0x160f('0x39')]=db[_0x160f('0x49')]['TEXT'];break;case'number':_0x1c7823[_0x160f('0x39')]=db['Sequelize'][_0x160f('0x4c')];break;case _0x160f('0x4d'):_0x1c7823['type']=db[_0x160f('0x49')]['BOOLEAN'];_0x1c7823['defaultValue']=![];break;default:}return db[_0x160f('0x48')][_0x160f('0x4e')][_0x160f('0x4f')](_0x160f('0x50'),util[_0x160f('0x51')](_0x160f('0x52'),_0x4204d2['id']),_0x1c7823);})[_0x160f('0x22')](function(){return _0x4204d2;});})[_0x160f('0x22')](respondWithResult(_0x1e5a41,0xc9))[_0x160f('0x40')](handleError(_0x1e5a41,null));}; \ No newline at end of file +var _0xf3b0=['crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','save','update','destroy','then','error','name','send','index','CmCustomField','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','find','body','sequelize','transaction','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0xf3b0,0x17f));var _0x0f3b=function(_0x5b077b,_0x50b707){_0x5b077b=_0x5b077b-0x0;var _0x16faf7=_0xf3b0[_0x5b077b];return _0x16faf7;};'use strict';var pdf=require(_0x0f3b('0x0'));var emlformat=require(_0x0f3b('0x1'));var rimraf=require(_0x0f3b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0f3b('0x3'));var rp=require('request-promise');var moment=require(_0x0f3b('0x4'));var BPromise=require(_0x0f3b('0x5'));var Mustache=require('mustache');var util=require(_0x0f3b('0x6'));var path=require(_0x0f3b('0x7'));var sox=require(_0x0f3b('0x8'));var csv=require(_0x0f3b('0x9'));var ejs=require(_0x0f3b('0xa'));var fs=require('fs');var _=require(_0x0f3b('0xb'));var squel=require('squel');var crypto=require(_0x0f3b('0xc'));var jsforce=require(_0x0f3b('0xd'));var deskjs=require(_0x0f3b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0f3b('0xf'));var Papa=require(_0x0f3b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0f3b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f3b('0x12'))('api');var utils=require(_0x0f3b('0x13'));var config=require(_0x0f3b('0x14'));var db=require(_0x0f3b('0x15'))['db'];function respondWithStatusCode(_0x118fa4,_0xf16079){_0xf16079=_0xf16079||0xcc;return function(_0x545775){if(_0x545775){return _0x118fa4[_0x0f3b('0x16')](_0xf16079);}return _0x118fa4[_0x0f3b('0x17')](_0xf16079)[_0x0f3b('0x18')]();};}function respondWithResult(_0x581bcd,_0x253def){_0x253def=_0x253def||0xc8;return function(_0x177a21){if(_0x177a21){return _0x581bcd[_0x0f3b('0x17')](_0x253def)[_0x0f3b('0x19')](_0x177a21);}};}function respondWithFilteredResult(_0x56661d,_0x199476){return function(_0x52bef9){if(_0x52bef9){var _0x42789c=_0x52bef9['count'],_0x540a86=_0x199476[_0x0f3b('0x1a')],_0x5128dc=_0x199476['offset']+_0x199476[_0x0f3b('0x1b')],_0x22c4ec;if(_0x5128dc>=_0x42789c){_0x5128dc=_0x42789c;_0x22c4ec=0xc8;}else{_0x22c4ec=0xce;}_0x56661d[_0x0f3b('0x17')](_0x22c4ec);return _0x56661d[_0x0f3b('0x1c')]('Content-Range',_0x540a86+'-'+_0x5128dc+'/'+_0x42789c)[_0x0f3b('0x19')](_0x52bef9);}return null;};}function patchUpdates(_0x33ed5c){return function(_0x30c018){try{jsonpatch['apply'](_0x30c018,_0x33ed5c,!![]);}catch(_0xc71003){return BPromise['reject'](_0xc71003);}return _0x30c018[_0x0f3b('0x1d')]();};}function saveUpdates(_0x14c40c,_0x4ec30b){return function(_0x154423){if(_0x154423){return _0x154423[_0x0f3b('0x1e')](_0x14c40c)['then'](function(_0x48262b){return _0x48262b;});}return null;};}function removeEntity(_0x1bf520,_0x35d9a7){return function(_0x480011){if(_0x480011){return _0x480011[_0x0f3b('0x1f')]()[_0x0f3b('0x20')](function(){_0x1bf520[_0x0f3b('0x17')](0xcc)[_0x0f3b('0x18')]();});}};}function handleEntityNotFound(_0x275db5,_0x467376){return function(_0x3a1002){if(!_0x3a1002){_0x275db5[_0x0f3b('0x16')](0x194);}return _0x3a1002;};}function handleError(_0x524050,_0x3d7399){_0x3d7399=_0x3d7399||0x1f4;return function(_0x4d1b52){logger[_0x0f3b('0x21')](_0x4d1b52['stack']);if(_0x4d1b52[_0x0f3b('0x22')]){delete _0x4d1b52[_0x0f3b('0x22')];}_0x524050[_0x0f3b('0x17')](_0x3d7399)[_0x0f3b('0x23')](_0x4d1b52);};}exports[_0x0f3b('0x24')]=function(_0x56ad5c,_0x429a4e){var _0x183505={},_0x219114={},_0xcdaf7d={'count':0x0,'rows':[]};var _0x250066=_['map'](db[_0x0f3b('0x25')]['rawAttributes'],function(_0x1df74e){return{'name':_0x1df74e[_0x0f3b('0x26')],'type':_0x1df74e['type'][_0x0f3b('0x27')]};});_0x219114[_0x0f3b('0x28')]=_['differenceBy'](_[_0x0f3b('0x29')](_0x250066,_0x0f3b('0x22')),[_0x0f3b('0x22')]);_0x219114['query']=_[_0x0f3b('0x2a')](_0x56ad5c['query']);_0x219114[_0x0f3b('0x2b')]=_[_0x0f3b('0x2c')](_0x219114['model'],_0x219114[_0x0f3b('0x2d')]);_0x183505[_0x0f3b('0x2e')]=_[_0x0f3b('0x2c')](_0x219114[_0x0f3b('0x28')],qs[_0x0f3b('0x2f')](_0x56ad5c[_0x0f3b('0x2d')][_0x0f3b('0x2f')]));_0x183505[_0x0f3b('0x2e')]=_0x183505['attributes'][_0x0f3b('0x30')]?_0x183505[_0x0f3b('0x2e')]:_0x219114[_0x0f3b('0x28')];if(!_0x56ad5c[_0x0f3b('0x2d')][_0x0f3b('0x31')](_0x0f3b('0x32'))){_0x183505[_0x0f3b('0x1b')]=qs[_0x0f3b('0x1b')](_0x56ad5c[_0x0f3b('0x2d')][_0x0f3b('0x1b')]);_0x183505[_0x0f3b('0x1a')]=qs[_0x0f3b('0x1a')](_0x56ad5c[_0x0f3b('0x2d')][_0x0f3b('0x1a')]);}_0x183505[_0x0f3b('0x33')]=qs['sort'](_0x56ad5c[_0x0f3b('0x2d')]['sort']);_0x183505[_0x0f3b('0x34')]=qs[_0x0f3b('0x2b')](_[_0x0f3b('0x35')](_0x56ad5c[_0x0f3b('0x2d')],_0x219114['filters']),_0x250066);if(_0x56ad5c['query'][_0x0f3b('0x36')]){_0x183505[_0x0f3b('0x34')]=_[_0x0f3b('0x37')](_0x183505[_0x0f3b('0x34')],{'$or':_[_0x0f3b('0x29')](_0x250066,function(_0x355ce2){if(_0x355ce2[_0x0f3b('0x38')]!=='VIRTUAL'){var _0x296a4b={};_0x296a4b[_0x355ce2[_0x0f3b('0x22')]]={'$like':'%'+_0x56ad5c[_0x0f3b('0x2d')][_0x0f3b('0x36')]+'%'};return _0x296a4b;}})});}_0x183505=_[_0x0f3b('0x37')]({},_0x183505,_0x56ad5c[_0x0f3b('0x39')]);var _0x1ed696={'where':_0x183505[_0x0f3b('0x34')]};return db['CmCustomField']['count'](_0x1ed696)[_0x0f3b('0x20')](function(_0x5eccda){_0xcdaf7d['count']=_0x5eccda;if(_0x56ad5c[_0x0f3b('0x2d')][_0x0f3b('0x3a')]){_0x183505[_0x0f3b('0x3b')]=[{'all':!![]}];}return db[_0x0f3b('0x25')][_0x0f3b('0x3c')](_0x183505);})[_0x0f3b('0x20')](function(_0x1e971a){_0xcdaf7d[_0x0f3b('0x3d')]=_0x1e971a;return _0xcdaf7d;})[_0x0f3b('0x20')](respondWithFilteredResult(_0x429a4e,_0x183505))[_0x0f3b('0x3e')](handleError(_0x429a4e,null));};exports['show']=function(_0x572d98,_0x58b09f){var _0x1736d9={'raw':!![],'where':{'id':_0x572d98[_0x0f3b('0x3f')]['id']}},_0x281538={};_0x281538[_0x0f3b('0x28')]=_[_0x0f3b('0x2a')](db['CmCustomField']['rawAttributes']);_0x281538['query']=_[_0x0f3b('0x2a')](_0x572d98['query']);_0x281538[_0x0f3b('0x2b')]=_[_0x0f3b('0x2c')](_0x281538[_0x0f3b('0x28')],_0x281538[_0x0f3b('0x2d')]);_0x1736d9['attributes']=_['intersection'](_0x281538[_0x0f3b('0x28')],qs[_0x0f3b('0x2f')](_0x572d98[_0x0f3b('0x2d')][_0x0f3b('0x2f')]));_0x1736d9[_0x0f3b('0x2e')]=_0x1736d9['attributes'][_0x0f3b('0x30')]?_0x1736d9[_0x0f3b('0x2e')]:_0x281538['model'];if(_0x572d98[_0x0f3b('0x2d')][_0x0f3b('0x3a')]){_0x1736d9[_0x0f3b('0x3b')]=[{'all':!![]}];}_0x1736d9=_[_0x0f3b('0x37')]({},_0x1736d9,_0x572d98[_0x0f3b('0x39')]);return db[_0x0f3b('0x25')][_0x0f3b('0x40')](_0x1736d9)[_0x0f3b('0x20')](handleEntityNotFound(_0x58b09f,null))['then'](respondWithResult(_0x58b09f,null))[_0x0f3b('0x3e')](handleError(_0x58b09f,null));};exports[_0x0f3b('0x1e')]=function(_0x462f4b,_0x1d29b4){if(_0x462f4b[_0x0f3b('0x41')]['id']){delete _0x462f4b['body']['id'];}return db[_0x0f3b('0x25')][_0x0f3b('0x40')]({'where':{'id':_0x462f4b[_0x0f3b('0x3f')]['id']}})[_0x0f3b('0x20')](handleEntityNotFound(_0x1d29b4,null))[_0x0f3b('0x20')](saveUpdates(_0x462f4b[_0x0f3b('0x41')],null))[_0x0f3b('0x20')](respondWithResult(_0x1d29b4,null))[_0x0f3b('0x3e')](handleError(_0x1d29b4,null));};exports[_0x0f3b('0x1f')]=function(_0xf81ee3,_0x4e5120){return db[_0x0f3b('0x25')]['find']({'where':{'id':_0xf81ee3['params']['id']}})['then'](handleEntityNotFound(_0x4e5120,null))['then'](removeEntity(_0x4e5120,null))['catch'](handleError(_0x4e5120,null));};exports['create']=function(_0x529c76,_0x2b6976){var _0x31e541;return db[_0x0f3b('0x42')][_0x0f3b('0x43')](function(_0x5e2907){return db[_0x0f3b('0x25')]['create'](_0x529c76[_0x0f3b('0x41')],{'transaction':_0x5e2907})[_0x0f3b('0x20')](function(_0x2ff48c){_0x31e541=_0x2ff48c;var _0x32cfba={'type':db[_0x0f3b('0x44')][_0x0f3b('0x45')],'transaction':_0x5e2907};switch(_0x529c76[_0x0f3b('0x41')][_0x0f3b('0x38')]){case _0x0f3b('0x46'):_0x32cfba[_0x0f3b('0x38')]=db[_0x0f3b('0x44')][_0x0f3b('0x45')];break;case _0x0f3b('0x47'):_0x32cfba['type']=db[_0x0f3b('0x44')]['INTEGER'];break;case _0x0f3b('0x48'):_0x32cfba[_0x0f3b('0x38')]=db[_0x0f3b('0x44')][_0x0f3b('0x49')];_0x32cfba[_0x0f3b('0x4a')]=![];break;default:}return db[_0x0f3b('0x42')][_0x0f3b('0x4b')][_0x0f3b('0x4c')]('cm_contacts',util[_0x0f3b('0x4d')](_0x0f3b('0x4e'),_0x31e541['id']),_0x32cfba);})[_0x0f3b('0x20')](function(){return _0x31e541;});})[_0x0f3b('0x20')](respondWithResult(_0x2b6976,0xc9))[_0x0f3b('0x3e')](handleError(_0x2b6976,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 9f1e351..202cd8a 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 _0x4fc2=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes','CmCustomField','cm_custom_fields','lodash','util'];(function(_0x2730da,_0x1098bd){var _0xfe9991=function(_0x2ea521){while(--_0x2ea521){_0x2730da['push'](_0x2730da['shift']());}};_0xfe9991(++_0x1098bd);}(_0x4fc2,0x111));var _0x24fc=function(_0x284321,_0x4e0767){_0x284321=_0x284321-0x0;var _0x4b184d=_0x4fc2[_0x284321];return _0x4b184d;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f92=['request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','../../config/logger','api'];(function(_0x3beac3,_0x249377){var _0x6b3ebf=function(_0x24dd5c){while(--_0x24dd5c){_0x3beac3['push'](_0x3beac3['shift']());}};_0x6b3ebf(++_0x249377);}(_0x1f92,0x1ad));var _0x21f9=function(_0x961d22,_0x378c71){_0x961d22=_0x961d22-0x0;var _0x2653d3=_0x1f92[_0x961d22];return _0x2653d3;};'use strict';var _=require(_0x21f9('0x0'));var util=require('util');var logger=require(_0x21f9('0x1'))(_0x21f9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x21f9('0x3'));var fs=require('fs');var path=require(_0x21f9('0x4'));var rimraf=require(_0x21f9('0x5'));var config=require(_0x21f9('0x6'));var attributes=require(_0x21f9('0x7'));module[_0x21f9('0x8')]=function(_0x259f4e,_0x3be0f2){return _0x259f4e[_0x21f9('0x9')](_0x21f9('0xa'),attributes,{'tableName':_0x21f9('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 2f5f37d..134f919 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 _0x4c6d=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','CmCustomField,\x20%s,\x20%s','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x9048e8,_0x5c749e){var _0x4b66be=function(_0x496f4b){while(--_0x496f4b){_0x9048e8['push'](_0x9048e8['shift']());}};_0x4b66be(++_0x5c749e);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x3db17f,_0x21ec69){_0x3db17f=_0x3db17f-0x0;var _0x5aa225=_0x4c6d[_0x3db17f];return _0x5aa225;};'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 +var _0x5ff3=['message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','CmCustomField,\x20%s,\x20%s'];(function(_0x48617f,_0x1293a5){var _0x1d1cac=function(_0x23636f){while(--_0x23636f){_0x48617f['push'](_0x48617f['shift']());}};_0x1d1cac(++_0x1293a5);}(_0x5ff3,0x17d));var _0x35ff=function(_0x3943fd,_0x1a2ea9){_0x3943fd=_0x3943fd-0x0;var _0x513499=_0x5ff3[_0x3943fd];return _0x513499;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var moment=require('moment');var BPromise=require(_0x35ff('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ff('0x2'));var db=require(_0x35ff('0x3'))['db'];var utils=require(_0x35ff('0x4'));var logger=require(_0x35ff('0x5'))('rpc');var config=require(_0x35ff('0x6'));var jayson=require(_0x35ff('0x7'));var client=jayson[_0x35ff('0x8')][_0x35ff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30c3ff,_0x495c31,_0x92b403){return new BPromise(function(_0x4c9fab,_0x2e7470){return client[_0x35ff('0xa')](_0x30c3ff,_0x92b403)[_0x35ff('0xb')](function(_0x51967a){logger[_0x35ff('0xc')]('CmCustomField,\x20%s,\x20%s',_0x495c31,_0x35ff('0xd'));logger[_0x35ff('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x495c31,'request\x20sent',JSON[_0x35ff('0xf')](_0x51967a));if(_0x51967a['error']){if(_0x51967a['error']['code']===0x1f4){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);return _0x2e7470(_0x51967a['error'][_0x35ff('0x12')]);}logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x51967a['error'][_0x35ff('0x12')]);return _0x4c9fab(_0x51967a[_0x35ff('0x10')][_0x35ff('0x12')]);}else{logger[_0x35ff('0xc')](_0x35ff('0x11'),_0x495c31,_0x35ff('0xd'));_0x4c9fab(_0x51967a[_0x35ff('0x13')][_0x35ff('0x12')]);}})[_0x35ff('0x14')](function(_0x2f3456){logger[_0x35ff('0x10')](_0x35ff('0x11'),_0x495c31,_0x2f3456);_0x2e7470(_0x2f3456);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index a4f1c5e..eed8e85 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 _0x8512=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','create','exports'];(function(_0x5c63ac,_0x2d32b4){var _0x2548e1=function(_0x465fc8){while(--_0x465fc8){_0x5c63ac['push'](_0x5c63ac['shift']());}};_0x2548e1(++_0x2d32b4);}(_0x8512,0x70));var _0x2851=function(_0x109a5f,_0x69e074){_0x109a5f=_0x109a5f-0x0;var _0xc8ef61=_0x8512[_0x109a5f];return _0xc8ef61;};'use strict';var multer=require(_0x2851('0x0'));var util=require(_0x2851('0x1'));var path=require(_0x2851('0x2'));var timeout=require(_0x2851('0x3'));var express=require(_0x2851('0x4'));var router=express[_0x2851('0x5')]();var auth=require(_0x2851('0x6'));var interaction=require(_0x2851('0x7'));var config=require(_0x2851('0x8'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x2851('0x9')](),controller['index']);router[_0x2851('0xa')](_0x2851('0xb'),auth[_0x2851('0x9')](),controller[_0x2851('0xc')]);router[_0x2851('0xd')]('/',auth[_0x2851('0x9')](),controller[_0x2851('0xe')]);router['put'](_0x2851('0xb'),auth[_0x2851('0x9')](),controller['update']);router['delete'](_0x2851('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2851('0xf')]=router; \ No newline at end of file +var _0xc9d8=['/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x22ddc0,_0x4b8b8a){var _0x39634=function(_0x1804af){while(--_0x1804af){_0x22ddc0['push'](_0x22ddc0['shift']());}};_0x39634(++_0x4b8b8a);}(_0xc9d8,0x138));var _0x8c9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9d8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8c9d('0x0'));var util=require(_0x8c9d('0x1'));var path=require(_0x8c9d('0x2'));var timeout=require(_0x8c9d('0x3'));var express=require(_0x8c9d('0x4'));var router=express[_0x8c9d('0x5')]();var auth=require(_0x8c9d('0x6'));var interaction=require(_0x8c9d('0x7'));var config=require(_0x8c9d('0x8'));var controller=require('./cmCustomField.controller');router[_0x8c9d('0x9')]('/',auth[_0x8c9d('0xa')](),controller['index']);router[_0x8c9d('0x9')](_0x8c9d('0xb'),auth[_0x8c9d('0xa')](),controller[_0x8c9d('0xc')]);router[_0x8c9d('0xd')]('/',auth[_0x8c9d('0xa')](),controller[_0x8c9d('0xe')]);router[_0x8c9d('0xf')](_0x8c9d('0xb'),auth[_0x8c9d('0xa')](),controller[_0x8c9d('0x10')]);router[_0x8c9d('0x11')](_0x8c9d('0xb'),auth[_0x8c9d('0xa')](),controller[_0x8c9d('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 6724032..9c773eb 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 _0x326f=['UNSIGNED','contactListQueue','moment','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x326f,0xd1));var _0xf326=function(_0x3acbd9,_0x2ac576){_0x3acbd9=_0x3acbd9-0x0;var _0x423a74=_0x326f[_0x3acbd9];return _0x423a74;};'use strict';var moment=require(_0xf326('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0xf326('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xf326('0x3')],'defaultValue':moment()[_0xf326('0x4')](_0xf326('0x5'))},'countbusyretry':{'type':Sequelize[_0xf326('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf326('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xf326('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xf326('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xf326('0x6')](0x2)[_0xf326('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xf326('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xf326('0x6')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xf326('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xf326('0x6')],'unique':_0xf326('0x8')},'CampaignId':{'type':Sequelize[_0xf326('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0xf326('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xf326('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xf326('0x6')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3f8a=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x4bd539,_0x4ff3d1){var _0x18bcf3=function(_0x528738){while(--_0x528738){_0x4bd539['push'](_0x4bd539['shift']());}};_0x18bcf3(++_0x4ff3d1);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4b541e,_0x3f95cf){_0x4b541e=_0x4b541e-0x0;var _0x82d27b=_0x3f8a[_0x4b541e];return _0x82d27b;};'use strict';var moment=require(_0xa3f8('0x0'));var Sequelize=require(_0xa3f8('0x1'));module[_0xa3f8('0x2')]={'phone':{'type':Sequelize[_0xa3f8('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa3f8('0x4')],'defaultValue':moment()[_0xa3f8('0x5')](_0xa3f8('0x6'))},'countbusyretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xa3f8('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa3f8('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa3f8('0x4')]},'priority':{'type':Sequelize[_0xa3f8('0x7')](0x2)[_0xa3f8('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa3f8('0x8')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa3f8('0x7')],'unique':_0xa3f8('0xa')},'ListId':{'type':Sequelize[_0xa3f8('0x7')],'unique':_0xa3f8('0xa')},'UserId':{'type':Sequelize[_0xa3f8('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa3f8('0xa')},'CampaignId':{'type':Sequelize[_0xa3f8('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa3f8('0x7')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa3f8('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index fed2ad2..4bfb133 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 _0xc2bb=['List','VoiceQueue','Queue','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','timezones','push','utcOffset','getTimezone','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','set','apply','reject','then','destroy','end','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','key','model','query','keys','intersection','concat','filters','$and','$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','update','body','describe','VoiceQueueId','CampaignId','Campaign','omit','createdAt','updatedAt','state','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','sequelize','direction','prev','isEmpty','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','hopperIds','priority','scheduledat','LOCK','UPDATE','CmCompany','Company','CmList'];(function(_0x5a8fd7,_0x479023){var _0x99057d=function(_0x45e25d){while(--_0x45e25d){_0x5a8fd7['push'](_0x5a8fd7['shift']());}};_0x99057d(++_0x479023);}(_0xc2bb,0x137));var _0xbc2b=function(_0x1440d9,_0x4a2c7e){_0x1440d9=_0x1440d9-0x0;var _0x4a0cfb=_0xc2bb[_0x1440d9];return _0x4a0cfb;};'use strict';var pdf=require(_0xbc2b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbc2b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc2b('0x2'));var rp=require(_0xbc2b('0x3'));var moment=require('moment');var BPromise=require(_0xbc2b('0x4'));var Mustache=require(_0xbc2b('0x5'));var util=require('util');var path=require(_0xbc2b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbc2b('0x7'));var fs=require('fs');var _=require(_0xbc2b('0x8'));var squel=require('squel');var crypto=require(_0xbc2b('0x9'));var jsforce=require(_0xbc2b('0xa'));var deskjs=require(_0xbc2b('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbc2b('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var shared=require('../../config/environment');var authService=require(_0xbc2b('0xd'));var qs=require(_0xbc2b('0xe'));var as=require(_0xbc2b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbc2b('0x10'));var utils=require(_0xbc2b('0x11'));var config=require(_0xbc2b('0x12'));var db=require(_0xbc2b('0x13'))['db'];function respondWithStatusCode(_0x455ffb,_0x130ba2){_0x130ba2=_0x130ba2||0xcc;return function(_0x1f5e1d){if(_0x1f5e1d){return _0x455ffb[_0xbc2b('0x14')](_0x130ba2);}return _0x455ffb[_0xbc2b('0x15')](_0x130ba2)['end']();};}function respondWithResult(_0x43d49a,_0x5557c9){_0x5557c9=_0x5557c9||0xc8;return function(_0x4059c0){if(_0x4059c0){return _0x43d49a['status'](_0x5557c9)[_0xbc2b('0x16')](_0x4059c0);}};}function respondWithFilteredResult(_0x5c04f3,_0xb8fb10){return function(_0x415944){if(_0x415944){var _0x390978=_0x415944[_0xbc2b('0x17')],_0x3d31ec=_0xb8fb10['offset'],_0x2cbac0=_0xb8fb10['offset']+_0xb8fb10[_0xbc2b('0x18')],_0x39adf2;if(_0x2cbac0>=_0x390978){_0x2cbac0=_0x390978;_0x39adf2=0xc8;}else{_0x39adf2=0xce;}_0x5c04f3['status'](_0x39adf2);return _0x5c04f3[_0xbc2b('0x19')]('Content-Range',_0x3d31ec+'-'+_0x2cbac0+'/'+_0x390978)['json'](_0x415944);}return null;};}function patchUpdates(_0x12c06e){return function(_0x216ddd){try{jsonpatch[_0xbc2b('0x1a')](_0x216ddd,_0x12c06e,!![]);}catch(_0xc479f){return BPromise[_0xbc2b('0x1b')](_0xc479f);}return _0x216ddd['save']();};}function saveUpdates(_0x1ec44d,_0x2b4a3f){return function(_0x273ad8){if(_0x273ad8){return _0x273ad8['update'](_0x1ec44d)[_0xbc2b('0x1c')](function(_0x500d28){return _0x500d28;});}return null;};}function removeEntity(_0x903710,_0x1dffcf){return function(_0x121f0c){if(_0x121f0c){return _0x121f0c[_0xbc2b('0x1d')]()[_0xbc2b('0x1c')](function(){_0x903710[_0xbc2b('0x15')](0xcc)[_0xbc2b('0x1e')]();});}};}function handleEntityNotFound(_0x4f1272,_0x34854c){return function(_0x28a685){if(!_0x28a685){_0x4f1272[_0xbc2b('0x14')](0x194);}return _0x28a685;};}function handleError(_0x38cfdb,_0x33e0ef){_0x33e0ef=_0x33e0ef||0x1f4;return function(_0x486666){logger[_0xbc2b('0x1f')](_0x486666[_0xbc2b('0x20')]);if(_0x486666[_0xbc2b('0x21')]){delete _0x486666[_0xbc2b('0x21')];}_0x38cfdb['status'](_0x33e0ef)[_0xbc2b('0x22')](_0x486666);};}exports[_0xbc2b('0x23')]=function(_0x4e2ff9,_0x46cf67){var _0x39207f={},_0x51533b={},_0x46f167={'count':0x0,'rows':[]};var _0xe54bef=_[_0xbc2b('0x24')](db[_0xbc2b('0x25')][_0xbc2b('0x26')],function(_0x5bb9c0){return{'name':_0x5bb9c0[_0xbc2b('0x27')],'type':_0x5bb9c0['type'][_0xbc2b('0x28')]};});_0x51533b[_0xbc2b('0x29')]=_[_0xbc2b('0x24')](_0xe54bef,_0xbc2b('0x21'));_0x51533b[_0xbc2b('0x2a')]=_[_0xbc2b('0x2b')](_0x4e2ff9[_0xbc2b('0x2a')]);_0x51533b['filters']=_[_0xbc2b('0x2c')](_0x51533b['model'],_0x51533b[_0xbc2b('0x2a')]);_0x51533b['filters']=_[_0xbc2b('0x2d')](_0x51533b[_0xbc2b('0x2e')],[_0xbc2b('0x2f'),_0xbc2b('0x30'),_0xbc2b('0x31'),_0xbc2b('0x32'),'$lt',_0xbc2b('0x33'),_0xbc2b('0x34'),_0xbc2b('0x35'),_0xbc2b('0x36'),_0xbc2b('0x37'),'$notBetween',_0xbc2b('0x38'),_0xbc2b('0x39'),_0xbc2b('0x3a'),_0xbc2b('0x3b'),_0xbc2b('0x3c'),_0xbc2b('0x3d'),'$like',_0xbc2b('0x3e'),_0xbc2b('0x3f'),_0xbc2b('0x40'),_0xbc2b('0x41')]);_0x39207f[_0xbc2b('0x42')]=_[_0xbc2b('0x2c')](_0x51533b[_0xbc2b('0x29')],qs[_0xbc2b('0x43')](_0x4e2ff9[_0xbc2b('0x2a')]['fields']));_0x39207f[_0xbc2b('0x42')]=_0x39207f[_0xbc2b('0x42')][_0xbc2b('0x44')]?_0x39207f[_0xbc2b('0x42')]:_0x51533b[_0xbc2b('0x29')];if(!_0x4e2ff9[_0xbc2b('0x2a')][_0xbc2b('0x45')](_0xbc2b('0x46'))){_0x39207f[_0xbc2b('0x18')]=qs['limit'](_0x4e2ff9[_0xbc2b('0x2a')][_0xbc2b('0x18')]);_0x39207f[_0xbc2b('0x47')]=qs[_0xbc2b('0x47')](_0x4e2ff9[_0xbc2b('0x2a')][_0xbc2b('0x47')]);}_0x39207f[_0xbc2b('0x48')]=qs[_0xbc2b('0x49')](_0x4e2ff9[_0xbc2b('0x2a')]['sort']);_0x39207f[_0xbc2b('0x4a')]=qs[_0xbc2b('0x2e')](_[_0xbc2b('0x4b')](_0x4e2ff9['query'],_0x51533b[_0xbc2b('0x2e')]),_0xe54bef);if(_0x4e2ff9[_0xbc2b('0x2a')][_0xbc2b('0x4c')]){_0x39207f['where']=_[_0xbc2b('0x4d')](_0x39207f[_0xbc2b('0x4a')],{'$or':_['map'](_0xe54bef,function(_0x7563b6){if(_0x7563b6[_0xbc2b('0x4e')]!==_0xbc2b('0x4f')){var _0x16fed6={};_0x16fed6[_0x7563b6[_0xbc2b('0x21')]]={'$like':'%'+_0x4e2ff9[_0xbc2b('0x2a')][_0xbc2b('0x4c')]+'%'};return _0x16fed6;}})});}_0x39207f=_[_0xbc2b('0x4d')]({},_0x39207f,_0x4e2ff9[_0xbc2b('0x50')]);var _0x4668a7={'where':_0x39207f[_0xbc2b('0x4a')]};return db[_0xbc2b('0x25')][_0xbc2b('0x17')](_0x4668a7)[_0xbc2b('0x1c')](function(_0x140068){_0x46f167['count']=_0x140068;if(_0x4e2ff9[_0xbc2b('0x2a')]['includeAll']){_0x39207f[_0xbc2b('0x51')]=[{'all':!![]}];}return db[_0xbc2b('0x25')][_0xbc2b('0x52')](_0x39207f);})['then'](function(_0x36114b){_0x46f167[_0xbc2b('0x53')]=_0x36114b;return _0x46f167;})[_0xbc2b('0x1c')](respondWithFilteredResult(_0x46cf67,_0x39207f))[_0xbc2b('0x54')](handleError(_0x46cf67,null));};exports[_0xbc2b('0x55')]=function(_0x2608c5,_0x2b58dd){var _0xe16dc2={'raw':!![],'where':{'id':_0x2608c5[_0xbc2b('0x56')]['id']}},_0x36a3f0={};_0x36a3f0[_0xbc2b('0x29')]=_[_0xbc2b('0x2b')](db[_0xbc2b('0x25')]['rawAttributes']);_0x36a3f0[_0xbc2b('0x2a')]=_['keys'](_0x2608c5[_0xbc2b('0x2a')]);_0x36a3f0['filters']=_[_0xbc2b('0x2c')](_0x36a3f0[_0xbc2b('0x29')],_0x36a3f0[_0xbc2b('0x2a')]);_0xe16dc2['attributes']=_[_0xbc2b('0x2c')](_0x36a3f0[_0xbc2b('0x29')],qs[_0xbc2b('0x43')](_0x2608c5[_0xbc2b('0x2a')][_0xbc2b('0x43')]));_0xe16dc2[_0xbc2b('0x42')]=_0xe16dc2['attributes'][_0xbc2b('0x44')]?_0xe16dc2['attributes']:_0x36a3f0[_0xbc2b('0x29')];if(_0x2608c5[_0xbc2b('0x2a')][_0xbc2b('0x57')]){_0xe16dc2[_0xbc2b('0x51')]=[{'all':!![]}];}_0xe16dc2=_['merge']({},_0xe16dc2,_0x2608c5['options']);return db[_0xbc2b('0x25')][_0xbc2b('0x58')](_0xe16dc2)['then'](handleEntityNotFound(_0x2b58dd,null))[_0xbc2b('0x1c')](respondWithResult(_0x2b58dd,null))[_0xbc2b('0x54')](handleError(_0x2b58dd,null));};exports[_0xbc2b('0x59')]=function(_0x2657ad,_0x5bc520){return db['CmHopper'][_0xbc2b('0x59')](_0x2657ad['body'],{})[_0xbc2b('0x1c')](respondWithResult(_0x5bc520,0xc9))['catch'](handleError(_0x5bc520,null));};exports[_0xbc2b('0x5a')]=function(_0x15a24f,_0x35b708){if(_0x15a24f['body']['id']){delete _0x15a24f['body']['id'];}return db[_0xbc2b('0x25')][_0xbc2b('0x58')]({'where':{'id':_0x15a24f['params']['id']}})[_0xbc2b('0x1c')](handleEntityNotFound(_0x35b708,null))[_0xbc2b('0x1c')](saveUpdates(_0x15a24f[_0xbc2b('0x5b')],null))['then'](respondWithResult(_0x35b708,null))[_0xbc2b('0x54')](handleError(_0x35b708,null));};exports[_0xbc2b('0x5c')]=function(_0x9dd462,_0x484fd8){return db[_0xbc2b('0x25')][_0xbc2b('0x5c')]()[_0xbc2b('0x1c')](respondWithResult(_0x484fd8,null))[_0xbc2b('0x54')](handleError(_0x484fd8,null));};exports['destroy']=function(_0x589247,_0x246867){var _0x568c83;return db[_0xbc2b('0x25')][_0xbc2b('0x58')]({'where':{'id':_0x589247[_0xbc2b('0x56')]['id']}})[_0xbc2b('0x1c')](handleEntityNotFound(_0x246867,null))[_0xbc2b('0x1c')](function(_0x3ccb06){if(_0x3ccb06){return _0x3ccb06[_0xbc2b('0x1d')]()[_0xbc2b('0x1c')](function(_0x21ea87){return _0x21ea87;});}})['then'](function(_0x165dc3){_0x568c83=_0x165dc3;if(_0x165dc3){if(_0x165dc3[_0xbc2b('0x5d')]||_0x165dc3[_0xbc2b('0x5e')]){return db[_0x165dc3['VoiceQueueId']?'VoiceQueue':_0xbc2b('0x5f')]['find']({'where':{'id':_0x165dc3['VoiceQueueId']?_0x165dc3['VoiceQueueId']:_0x165dc3[_0xbc2b('0x5e')]},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x505706){var _0x54672c={};if(_0x505706){_[_0xbc2b('0x4d')](_0x54672c,_[_0xbc2b('0x60')](_0x568c83['dataValues'],[_0xbc2b('0x61'),_0xbc2b('0x62'),'id']));_0x54672c[_0xbc2b('0x63')]=0x15;_0x54672c['statedesc']='deleted';_0x54672c[_0xbc2b('0x64')]=_0x505706[_0xbc2b('0x21')];_0x54672c[_0xbc2b('0x65')]=_0x589247[_0xbc2b('0x66')][_0xbc2b('0x21')];_0x54672c[_0xbc2b('0x67')]=_0x589247[_0xbc2b('0x66')]['id'];_0x54672c['deleted']=!![];_0x54672c['deletedat']=moment()[_0xbc2b('0x68')](_0xbc2b('0x69'));_0x54672c['calleridnum']=_0x568c83[_0xbc2b('0x6a')];_0x54672c[_0xbc2b('0x6b')]=_0x568c83[_0xbc2b('0x5d')]?_0xbc2b('0x6c'):_0xbc2b('0x6d');return db[_0xbc2b('0x6e')]['find']({'where':{'id':_0x54672c[_0xbc2b('0x6f')]},'attributes':[_0xbc2b('0x70'),_0xbc2b('0x71')]})['then'](function(_0x4f73fa){if(!_[_0xbc2b('0x72')](_0x246867)&&!_[_0xbc2b('0x72')](_0x4f73fa[_0xbc2b('0x70')])){_0x54672c[_0xbc2b('0x73')]=_0x4f73fa[_0xbc2b('0x70')];if(!_[_0xbc2b('0x72')](_0x4f73fa['lastName'])){_0x54672c['calleridname']+='\x20'+_0x4f73fa[_0xbc2b('0x71')];}}})['finally'](function(){return db[_0xbc2b('0x74')][_0xbc2b('0x59')](_0x54672c);});}})[_0xbc2b('0x1c')](function(){return _0x246867[_0xbc2b('0x15')](0xcc)[_0xbc2b('0x1e')]();})[_0xbc2b('0x54')](handleError(_0x246867,null));};exports[_0xbc2b('0x75')]=function(_0x2ce31a,_0x4979d1,_0x4457f1){var _0x2caeaa=[];return db[_0xbc2b('0x6e')][_0xbc2b('0x5c')]()[_0xbc2b('0x1c')](function(_0x1ad0b8){_0x2caeaa=_['keys'](_0x1ad0b8);return _0x2ce31a[_0xbc2b('0x66')][_0xbc2b('0x76')]({'where':{'type':_0xbc2b('0x77'),'dialActive':!![],'dialMethod':_0xbc2b('0x78')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0xbc2b('0x1c')](function(_0x3ff2b2){if(_0x3ff2b2&&_0x3ff2b2[_0xbc2b('0x44')]){return db[_0xbc2b('0x79')]['transaction'](function(_0xdda940){var _0x4873ec={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xbc2b('0x69'))},'VoiceQueueId':{'$in':_['map'](_0x3ff2b2,'id')},'$or':[{'UserId':null},{'UserId':_0x2ce31a['user']['id']}]};var _0x46cde8=[];if(_0x2ce31a[_0xbc2b('0x5b')][_0xbc2b('0x7a')]&&_0x2ce31a['body'][_0xbc2b('0x7a')]===_0xbc2b('0x7b')){if(!_[_0xbc2b('0x7c')](_0x2ce31a[_0xbc2b('0x5b')]['hopperIds'])){_0x4873ec['id']={'$in':_0x2ce31a['body']['hopperIds']};}_0x46cde8=[['priority',_0xbc2b('0x7d')],[_0xbc2b('0x7e'),_0x3ff2b2[0x0][_0xbc2b('0x7f')]===_0xbc2b('0x7d')?_0xbc2b('0x80'):_0xbc2b('0x7d')],db[_0xbc2b('0x79')][_0xbc2b('0x81')](_0xbc2b('0x82')),['id',_0xbc2b('0x80')]];}else{if(!_[_0xbc2b('0x7c')](_0x2ce31a[_0xbc2b('0x5b')][_0xbc2b('0x83')])){_0x4873ec['id']={'$notIn':_0x2ce31a['body'][_0xbc2b('0x83')]};}_0x46cde8=[[_0xbc2b('0x84'),'DESC'],[_0xbc2b('0x7e'),_0x3ff2b2[0x0][_0xbc2b('0x7f')]],db[_0xbc2b('0x79')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xbc2b('0x7d')]];}return db[_0xbc2b('0x25')]['findOne']({'attributes':['id',_0xbc2b('0x85')],'where':_0x4873ec,'order':_0x46cde8,'transaction':_0xdda940,'lock':_0xdda940[_0xbc2b('0x86')][_0xbc2b('0x87')],'include':[{'model':db[_0xbc2b('0x6e')],'as':'Contact','attributes':_0x2caeaa,'include':[{'model':db[_0xbc2b('0x88')],'as':_0xbc2b('0x89'),'attributes':['id',_0xbc2b('0x21')]}]},{'model':db[_0xbc2b('0x8a')],'as':_0xbc2b('0x8b'),'attributes':['id',_0xbc2b('0x21')]},{'model':db[_0xbc2b('0x8c')],'as':_0xbc2b('0x8d'),'attributes':['id',_0xbc2b('0x21'),'dialActive']}]})[_0xbc2b('0x1c')](function(_0x29a5f4){if(_0x29a5f4){return _0x29a5f4[_0xbc2b('0x5a')]({'UserId':_0x2ce31a[_0xbc2b('0x66')]['id']},{'transaction':_0xdda940});}});});}})[_0xbc2b('0x1c')](handleEntityNotFound(_0x4979d1,null))[_0xbc2b('0x1c')](respondWithResult(_0x4979d1,null))['catch'](handleError(_0x4979d1,null));};exports[_0xbc2b('0x8e')]=function(_0x4a1f71,_0x4ced89,_0x185c76){return _0x4a1f71[_0xbc2b('0x66')]['getVoiceQueues']({'where':{'type':_0xbc2b('0x77'),'dialActive':!![],'dialMethod':_0xbc2b('0x78')},'attributes':['id'],'raw':!![]})[_0xbc2b('0x1c')](function(_0x150a2e){if(_0x150a2e&&_0x150a2e[_0xbc2b('0x44')]){return db[_0xbc2b('0x25')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xbc2b('0x68')](_0xbc2b('0x69'))},'VoiceQueueId':{'$in':_[_0xbc2b('0x24')](_0x150a2e,'id')},'$or':[{'UserId':null},{'UserId':_0x4a1f71[_0xbc2b('0x66')]['id']}]}});}return 0x0;})['then'](function(_0x17b8fc){if(!_[_0xbc2b('0x72')](_0x17b8fc)&&_[_0xbc2b('0x8f')](_0x17b8fc)){return _0x4ced89['status'](0xc8)[_0xbc2b('0x16')]({'contacts':_0x17b8fc});}else{logger[_0xbc2b('0x1f')](_0xbc2b('0x90'),_0xbc2b('0x8e'),0x194,_0xbc2b('0x91'));_0x4ced89[_0xbc2b('0x14')](0x194);}})[_0xbc2b('0x54')](handleError(_0x4ced89,null));};exports['getTimezones']=function(_0xc796f,_0x14271e,_0x48e56a){var _0xe31fc6=shared[_0xbc2b('0x92')];var _0x356f65=[];_['map'](_0xe31fc6,function(_0x508a39){_0x356f65[_0xbc2b('0x93')]({'id':_0x508a39[_0xbc2b('0x21')],'name':_0x508a39['name'],'utcOffset':_0x508a39[_0xbc2b('0x94')]});});return _0x14271e[_0xbc2b('0x15')](0xc8)[_0xbc2b('0x16')]({'tz':_0x356f65});};exports[_0xbc2b('0x95')]=function(_0x2bd303,_0x35edb9,_0x5ba866){var _0x3b0947=shared[_0xbc2b('0x92')];var _0x1d7c66={};if(!_[_0xbc2b('0x72')](_0x3b0947[_0x2bd303[_0xbc2b('0x5b')]['id']]))_0x1d7c66=_0x3b0947[_0x2bd303['body']['id']];return _0x35edb9[_0xbc2b('0x15')](0xc8)[_0xbc2b('0x16')](_0x1d7c66);}; \ No newline at end of file +var _0x09f9=['squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','error','name','send','index','map','CmHopper','fieldName','type','model','query','filters','concat','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$overlap','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','then','includeAll','findAll','rows','show','keys','rawAttributes','intersection','include','find','catch','create','body','params','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','outbound','preview','sequelize','transaction','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','dialOrderByScheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','Contact','Company','CmList','List','Queue','dialActive','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','timezones','push','getTimezone','html-pdf','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash'];(function(_0x3c4246,_0x1fd689){var _0x4b5273=function(_0x3d5a76){while(--_0x3d5a76){_0x3c4246['push'](_0x3c4246['shift']());}};_0x4b5273(++_0x1fd689);}(_0x09f9,0x1bb));var _0x909f=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x09f9[_0x16d10f];return _0x50c823;};'use strict';var pdf=require(_0x909f('0x0'));var emlformat=require(_0x909f('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x909f('0x2'));var moment=require('moment');var BPromise=require(_0x909f('0x3'));var Mustache=require(_0x909f('0x4'));var util=require(_0x909f('0x5'));var path=require(_0x909f('0x6'));var sox=require(_0x909f('0x7'));var csv=require(_0x909f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x909f('0x9'));var squel=require(_0x909f('0xa'));var crypto=require(_0x909f('0xb'));var jsforce=require(_0x909f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x909f('0xd'));var Redis=require(_0x909f('0xe'));var shared=require('../../config/environment');var authService=require(_0x909f('0xf'));var qs=require(_0x909f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x909f('0x11'));var logger=require(_0x909f('0x12'))('api');var utils=require(_0x909f('0x13'));var config=require(_0x909f('0x14'));var db=require(_0x909f('0x15'))['db'];function respondWithStatusCode(_0x36530a,_0x4bbd15){_0x4bbd15=_0x4bbd15||0xcc;return function(_0x147222){if(_0x147222){return _0x36530a[_0x909f('0x16')](_0x4bbd15);}return _0x36530a[_0x909f('0x17')](_0x4bbd15)[_0x909f('0x18')]();};}function respondWithResult(_0x195bce,_0x5ddf1e){_0x5ddf1e=_0x5ddf1e||0xc8;return function(_0x9c8fa2){if(_0x9c8fa2){return _0x195bce[_0x909f('0x17')](_0x5ddf1e)[_0x909f('0x19')](_0x9c8fa2);}};}function respondWithFilteredResult(_0x431f41,_0x555c38){return function(_0x44480c){if(_0x44480c){var _0x2da656=_0x44480c[_0x909f('0x1a')],_0x2847d5=_0x555c38['offset'],_0x10dc37=_0x555c38[_0x909f('0x1b')]+_0x555c38[_0x909f('0x1c')],_0x2de25a;if(_0x10dc37>=_0x2da656){_0x10dc37=_0x2da656;_0x2de25a=0xc8;}else{_0x2de25a=0xce;}_0x431f41[_0x909f('0x17')](_0x2de25a);return _0x431f41[_0x909f('0x1d')]('Content-Range',_0x2847d5+'-'+_0x10dc37+'/'+_0x2da656)[_0x909f('0x19')](_0x44480c);}return null;};}function patchUpdates(_0x1efdff){return function(_0x21ca7c){try{jsonpatch['apply'](_0x21ca7c,_0x1efdff,!![]);}catch(_0x50c470){return BPromise[_0x909f('0x1e')](_0x50c470);}return _0x21ca7c[_0x909f('0x1f')]();};}function saveUpdates(_0x694549,_0x4a61b5){return function(_0x4cfc6b){if(_0x4cfc6b){return _0x4cfc6b[_0x909f('0x20')](_0x694549)['then'](function(_0x16469a){return _0x16469a;});}return null;};}function removeEntity(_0x152f41,_0x2f445a){return function(_0x5ad3af){if(_0x5ad3af){return _0x5ad3af['destroy']()['then'](function(){_0x152f41[_0x909f('0x17')](0xcc)[_0x909f('0x18')]();});}};}function handleEntityNotFound(_0x4b8af1,_0xc7b8ca){return function(_0x256b8a){if(!_0x256b8a){_0x4b8af1[_0x909f('0x16')](0x194);}return _0x256b8a;};}function handleError(_0x44c03f,_0x28f528){_0x28f528=_0x28f528||0x1f4;return function(_0xe3383b){logger[_0x909f('0x21')](_0xe3383b['stack']);if(_0xe3383b[_0x909f('0x22')]){delete _0xe3383b[_0x909f('0x22')];}_0x44c03f[_0x909f('0x17')](_0x28f528)[_0x909f('0x23')](_0xe3383b);};}exports[_0x909f('0x24')]=function(_0x4dee65,_0x473168){var _0x4665b6={},_0x404e68={},_0x552aee={'count':0x0,'rows':[]};var _0x2719f8=_[_0x909f('0x25')](db[_0x909f('0x26')]['rawAttributes'],function(_0x7b290c){return{'name':_0x7b290c[_0x909f('0x27')],'type':_0x7b290c[_0x909f('0x28')]['key']};});_0x404e68[_0x909f('0x29')]=_[_0x909f('0x25')](_0x2719f8,_0x909f('0x22'));_0x404e68['query']=_['keys'](_0x4dee65[_0x909f('0x2a')]);_0x404e68[_0x909f('0x2b')]=_['intersection'](_0x404e68[_0x909f('0x29')],_0x404e68['query']);_0x404e68['filters']=_[_0x909f('0x2c')](_0x404e68[_0x909f('0x2b')],[_0x909f('0x2d'),'$or',_0x909f('0x2e'),_0x909f('0x2f'),_0x909f('0x30'),_0x909f('0x31'),_0x909f('0x32'),_0x909f('0x33'),_0x909f('0x34'),_0x909f('0x35'),_0x909f('0x36'),_0x909f('0x37'),'$notIn',_0x909f('0x38'),_0x909f('0x39'),_0x909f('0x3a'),'$notILike',_0x909f('0x38'),_0x909f('0x3b'),'$contains',_0x909f('0x3c'),_0x909f('0x3d')]);_0x4665b6[_0x909f('0x3e')]=_['intersection'](_0x404e68['model'],qs[_0x909f('0x3f')](_0x4dee65[_0x909f('0x2a')][_0x909f('0x3f')]));_0x4665b6['attributes']=_0x4665b6[_0x909f('0x3e')][_0x909f('0x40')]?_0x4665b6[_0x909f('0x3e')]:_0x404e68['model'];if(!_0x4dee65['query'][_0x909f('0x41')](_0x909f('0x42'))){_0x4665b6[_0x909f('0x1c')]=qs[_0x909f('0x1c')](_0x4dee65['query'][_0x909f('0x1c')]);_0x4665b6[_0x909f('0x1b')]=qs[_0x909f('0x1b')](_0x4dee65[_0x909f('0x2a')][_0x909f('0x1b')]);}_0x4665b6[_0x909f('0x43')]=qs[_0x909f('0x44')](_0x4dee65['query'][_0x909f('0x44')]);_0x4665b6['where']=qs['filters'](_['pick'](_0x4dee65[_0x909f('0x2a')],_0x404e68['filters']),_0x2719f8);if(_0x4dee65[_0x909f('0x2a')][_0x909f('0x45')]){_0x4665b6[_0x909f('0x46')]=_[_0x909f('0x47')](_0x4665b6[_0x909f('0x46')],{'$or':_['map'](_0x2719f8,function(_0x298df4){if(_0x298df4['type']!=='VIRTUAL'){var _0x5ebf5c={};_0x5ebf5c[_0x298df4['name']]={'$like':'%'+_0x4dee65['query'][_0x909f('0x45')]+'%'};return _0x5ebf5c;}})});}_0x4665b6=_[_0x909f('0x47')]({},_0x4665b6,_0x4dee65[_0x909f('0x48')]);var _0x42d8a4={'where':_0x4665b6['where']};return db[_0x909f('0x26')]['count'](_0x42d8a4)[_0x909f('0x49')](function(_0x27ef0c){_0x552aee[_0x909f('0x1a')]=_0x27ef0c;if(_0x4dee65[_0x909f('0x2a')][_0x909f('0x4a')]){_0x4665b6['include']=[{'all':!![]}];}return db[_0x909f('0x26')][_0x909f('0x4b')](_0x4665b6);})[_0x909f('0x49')](function(_0x156a96){_0x552aee[_0x909f('0x4c')]=_0x156a96;return _0x552aee;})['then'](respondWithFilteredResult(_0x473168,_0x4665b6))['catch'](handleError(_0x473168,null));};exports[_0x909f('0x4d')]=function(_0x252df3,_0x5991a6){var _0x4fe17c={'raw':!![],'where':{'id':_0x252df3['params']['id']}},_0x397e12={};_0x397e12[_0x909f('0x29')]=_[_0x909f('0x4e')](db[_0x909f('0x26')][_0x909f('0x4f')]);_0x397e12['query']=_[_0x909f('0x4e')](_0x252df3['query']);_0x397e12[_0x909f('0x2b')]=_[_0x909f('0x50')](_0x397e12[_0x909f('0x29')],_0x397e12[_0x909f('0x2a')]);_0x4fe17c[_0x909f('0x3e')]=_[_0x909f('0x50')](_0x397e12[_0x909f('0x29')],qs[_0x909f('0x3f')](_0x252df3[_0x909f('0x2a')]['fields']));_0x4fe17c['attributes']=_0x4fe17c[_0x909f('0x3e')][_0x909f('0x40')]?_0x4fe17c[_0x909f('0x3e')]:_0x397e12[_0x909f('0x29')];if(_0x252df3[_0x909f('0x2a')]['includeAll']){_0x4fe17c[_0x909f('0x51')]=[{'all':!![]}];}_0x4fe17c=_[_0x909f('0x47')]({},_0x4fe17c,_0x252df3[_0x909f('0x48')]);return db[_0x909f('0x26')][_0x909f('0x52')](_0x4fe17c)[_0x909f('0x49')](handleEntityNotFound(_0x5991a6,null))[_0x909f('0x49')](respondWithResult(_0x5991a6,null))[_0x909f('0x53')](handleError(_0x5991a6,null));};exports[_0x909f('0x54')]=function(_0x769442,_0x4c8400){return db[_0x909f('0x26')][_0x909f('0x54')](_0x769442[_0x909f('0x55')],{})[_0x909f('0x49')](respondWithResult(_0x4c8400,0xc9))[_0x909f('0x53')](handleError(_0x4c8400,null));};exports['update']=function(_0x43fb86,_0x30a60a){if(_0x43fb86[_0x909f('0x55')]['id']){delete _0x43fb86[_0x909f('0x55')]['id'];}return db[_0x909f('0x26')][_0x909f('0x52')]({'where':{'id':_0x43fb86[_0x909f('0x56')]['id']}})[_0x909f('0x49')](handleEntityNotFound(_0x30a60a,null))[_0x909f('0x49')](saveUpdates(_0x43fb86[_0x909f('0x55')],null))[_0x909f('0x49')](respondWithResult(_0x30a60a,null))['catch'](handleError(_0x30a60a,null));};exports[_0x909f('0x57')]=function(_0x1570d9,_0x2d3bda){return db['CmHopper'][_0x909f('0x57')]()[_0x909f('0x49')](respondWithResult(_0x2d3bda,null))[_0x909f('0x53')](handleError(_0x2d3bda,null));};exports[_0x909f('0x58')]=function(_0x53e0e9,_0x3d26e6){var _0x3ce759;return db['CmHopper'][_0x909f('0x52')]({'where':{'id':_0x53e0e9['params']['id']}})[_0x909f('0x49')](handleEntityNotFound(_0x3d26e6,null))[_0x909f('0x49')](function(_0x3b4b8c){if(_0x3b4b8c){return _0x3b4b8c[_0x909f('0x58')]()[_0x909f('0x49')](function(_0x497519){return _0x497519;});}})[_0x909f('0x49')](function(_0x7e4c67){_0x3ce759=_0x7e4c67;if(_0x7e4c67){if(_0x7e4c67[_0x909f('0x59')]||_0x7e4c67[_0x909f('0x5a')]){return db[_0x7e4c67[_0x909f('0x59')]?_0x909f('0x5b'):_0x909f('0x5c')][_0x909f('0x52')]({'where':{'id':_0x7e4c67[_0x909f('0x59')]?_0x7e4c67[_0x909f('0x59')]:_0x7e4c67[_0x909f('0x5a')]},'attributes':['id','name'],'raw':!![]});}}})[_0x909f('0x49')](function(_0x27073d){var _0x4bf608={};if(_0x27073d){_[_0x909f('0x47')](_0x4bf608,_[_0x909f('0x5d')](_0x3ce759[_0x909f('0x5e')],[_0x909f('0x5f'),_0x909f('0x60'),'id']));_0x4bf608[_0x909f('0x61')]=0x15;_0x4bf608[_0x909f('0x62')]=_0x909f('0x63');_0x4bf608['campaign']=_0x27073d['name'];_0x4bf608[_0x909f('0x64')]=_0x53e0e9[_0x909f('0x65')][_0x909f('0x22')];_0x4bf608['UserId']=_0x53e0e9[_0x909f('0x65')]['id'];_0x4bf608[_0x909f('0x63')]=!![];_0x4bf608[_0x909f('0x66')]=moment()[_0x909f('0x67')](_0x909f('0x68'));_0x4bf608[_0x909f('0x69')]=_0x3ce759[_0x909f('0x6a')];_0x4bf608[_0x909f('0x6b')]=_0x3ce759[_0x909f('0x59')]?_0x909f('0x6c'):_0x909f('0x6d');return db[_0x909f('0x6e')][_0x909f('0x52')]({'where':{'id':_0x4bf608[_0x909f('0x6f')]},'attributes':[_0x909f('0x70'),_0x909f('0x71')]})['then'](function(_0x74b880){if(!_[_0x909f('0x72')](_0x3d26e6)&&!_[_0x909f('0x72')](_0x74b880[_0x909f('0x70')])){_0x4bf608['calleridname']=_0x74b880[_0x909f('0x70')];if(!_['isNil'](_0x74b880[_0x909f('0x71')])){_0x4bf608[_0x909f('0x73')]+='\x20'+_0x74b880['lastName'];}}})[_0x909f('0x74')](function(){return db[_0x909f('0x75')][_0x909f('0x54')](_0x4bf608);});}})[_0x909f('0x49')](function(){return _0x3d26e6[_0x909f('0x17')](0xcc)['end']();})[_0x909f('0x53')](handleError(_0x3d26e6,null));};exports[_0x909f('0x76')]=function(_0x291f24,_0x249711,_0x346984){var _0xcc9022=[];return db[_0x909f('0x6e')][_0x909f('0x57')]()[_0x909f('0x49')](function(_0x179195){_0xcc9022=_['keys'](_0x179195);return _0x291f24[_0x909f('0x65')]['getVoiceQueues']({'where':{'type':_0x909f('0x77'),'dialActive':!![],'dialMethod':_0x909f('0x78')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0xbefcb2){if(_0xbefcb2&&_0xbefcb2[_0x909f('0x40')]){return db[_0x909f('0x79')][_0x909f('0x7a')](function(_0x367310){var _0x58fe4f={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x909f('0x68'))},'VoiceQueueId':{'$in':_[_0x909f('0x25')](_0xbefcb2,'id')},'$or':[{'UserId':null},{'UserId':_0x291f24['user']['id']}]};var _0x9e367c=[];if(_0x291f24[_0x909f('0x55')][_0x909f('0x7b')]&&_0x291f24['body']['direction']===_0x909f('0x7c')){if(!_['isEmpty'](_0x291f24[_0x909f('0x55')][_0x909f('0x7d')])){_0x58fe4f['id']={'$in':_0x291f24[_0x909f('0x55')][_0x909f('0x7d')]};}_0x9e367c=[[_0x909f('0x7e'),_0x909f('0x7f')],[_0x909f('0x80'),_0xbefcb2[0x0]['dialOrderByScheduledAt']===_0x909f('0x7f')?_0x909f('0x81'):_0x909f('0x7f')],db[_0x909f('0x79')][_0x909f('0x82')](_0x909f('0x83')),['id',_0x909f('0x81')]];}else{if(!_[_0x909f('0x84')](_0x291f24[_0x909f('0x55')]['hopperIds'])){_0x58fe4f['id']={'$notIn':_0x291f24[_0x909f('0x55')][_0x909f('0x7d')]};}_0x9e367c=[[_0x909f('0x7e'),_0x909f('0x81')],[_0x909f('0x80'),_0xbefcb2[0x0][_0x909f('0x85')]],db[_0x909f('0x79')][_0x909f('0x82')](_0x909f('0x86')),['id',_0x909f('0x7f')]];}return db[_0x909f('0x26')][_0x909f('0x87')]({'attributes':['id',_0x909f('0x88')],'where':_0x58fe4f,'order':_0x9e367c,'transaction':_0x367310,'lock':_0x367310['LOCK']['UPDATE'],'include':[{'model':db[_0x909f('0x6e')],'as':_0x909f('0x89'),'attributes':_0xcc9022,'include':[{'model':db['CmCompany'],'as':_0x909f('0x8a'),'attributes':['id',_0x909f('0x22')]}]},{'model':db[_0x909f('0x8b')],'as':_0x909f('0x8c'),'attributes':['id','name']},{'model':db[_0x909f('0x5b')],'as':_0x909f('0x8d'),'attributes':['id',_0x909f('0x22'),_0x909f('0x8e')]}]})[_0x909f('0x49')](function(_0x31ac76){if(_0x31ac76){return _0x31ac76[_0x909f('0x20')]({'UserId':_0x291f24[_0x909f('0x65')]['id']},{'transaction':_0x367310});}});});}})['then'](handleEntityNotFound(_0x249711,null))[_0x909f('0x49')](respondWithResult(_0x249711,null))['catch'](handleError(_0x249711,null));};exports[_0x909f('0x8f')]=function(_0x4aad9e,_0x4b0d12,_0x64b417){return _0x4aad9e[_0x909f('0x65')][_0x909f('0x90')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x909f('0x49')](function(_0x5b73de){if(_0x5b73de&&_0x5b73de[_0x909f('0x40')]){return db[_0x909f('0x26')][_0x909f('0x1a')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x909f('0x67')](_0x909f('0x68'))},'VoiceQueueId':{'$in':_[_0x909f('0x25')](_0x5b73de,'id')},'$or':[{'UserId':null},{'UserId':_0x4aad9e['user']['id']}]}});}return 0x0;})[_0x909f('0x49')](function(_0x51385f){if(!_['isNil'](_0x51385f)&&_[_0x909f('0x91')](_0x51385f)){return _0x4b0d12[_0x909f('0x17')](0xc8)[_0x909f('0x19')]({'contacts':_0x51385f});}else{logger[_0x909f('0x21')](_0x909f('0x92'),_0x909f('0x8f'),0x194,_0x909f('0x93'));_0x4b0d12[_0x909f('0x16')](0x194);}})[_0x909f('0x53')](handleError(_0x4b0d12,null));};exports['getTimezones']=function(_0x46581b,_0x1dccbe,_0x3828b8){var _0xde85fd=shared[_0x909f('0x94')];var _0x24d0c6=[];_[_0x909f('0x25')](_0xde85fd,function(_0x446c67){_0x24d0c6[_0x909f('0x95')]({'id':_0x446c67[_0x909f('0x22')],'name':_0x446c67[_0x909f('0x22')],'utcOffset':_0x446c67['utcOffset']});});return _0x1dccbe[_0x909f('0x17')](0xc8)[_0x909f('0x19')]({'tz':_0x24d0c6});};exports[_0x909f('0x96')]=function(_0x4b5132,_0x50b991,_0x1bd558){var _0x31e1cf=shared[_0x909f('0x94')];var _0xcc2b2f={};if(!_['isNil'](_0x31e1cf[_0x4b5132[_0x909f('0x55')]['id']]))_0xcc2b2f=_0x31e1cf[_0x4b5132['body']['id']];return _0x50b991[_0x909f('0x17')](0xc8)[_0x909f('0x19')](_0xcc2b2f);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index a1622f7..061f14d 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 _0x9233=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper','scheduledat','phone','priority','lodash','util'];(function(_0x20b035,_0x33e530){var _0x26d5ec=function(_0x34fafa){while(--_0x34fafa){_0x20b035['push'](_0x20b035['shift']());}};_0x26d5ec(++_0x33e530);}(_0x9233,0x11e));var _0x3923=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0x9233[_0x4e4519];return _0x340044;};'use strict';var _=require(_0x3923('0x0'));var util=require(_0x3923('0x1'));var logger=require(_0x3923('0x2'))(_0x3923('0x3'));var moment=require(_0x3923('0x4'));var BPromise=require(_0x3923('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3923('0x6'));var rimraf=require(_0x3923('0x7'));var config=require(_0x3923('0x8'));var attributes=require(_0x3923('0x9'));module[_0x3923('0xa')]=function(_0x5286b9,_0x23217d){return _0x5286b9[_0x3923('0xb')]('CmHopper',attributes,{'tableName':_0x3923('0xc'),'paranoid':![],'indexes':[{'name':_0x3923('0xd'),'fields':[_0x3923('0xd')]},{'name':_0x3923('0xe'),'fields':['phone']},{'name':_0x3923('0xf'),'fields':[_0x3923('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6e18=['../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x28011f,_0x35d67c){var _0x59b581=function(_0x4aaf0b){while(--_0x4aaf0b){_0x28011f['push'](_0x28011f['shift']());}};_0x59b581(++_0x35d67c);}(_0x6e18,0x71));var _0x86e1=function(_0x33a8fa,_0x33c5e8){_0x33a8fa=_0x33a8fa-0x0;var _0x5f2728=_0x6e18[_0x33a8fa];return _0x5f2728;};'use strict';var _=require(_0x86e1('0x0'));var util=require(_0x86e1('0x1'));var logger=require(_0x86e1('0x2'))(_0x86e1('0x3'));var moment=require('moment');var BPromise=require(_0x86e1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x86e1('0x5'));var rimraf=require(_0x86e1('0x6'));var config=require(_0x86e1('0x7'));var attributes=require(_0x86e1('0x8'));module[_0x86e1('0x9')]=function(_0x171853,_0xd00c11){return _0x171853[_0x86e1('0xa')](_0x86e1('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x86e1('0xc')]},{'name':_0x86e1('0xd'),'fields':['phone']},{'name':_0x86e1('0xe'),'fields':[_0x86e1('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 2f1d92e..6a504c8 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 _0xdb23=['format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','UPDATE','length','GetContactRecallMe','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopper','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowCmHopper','CreateCmHopper','CmHopper','create','body','update','UpdateCmHopper','DestroyCmHopper','CmContact','describe','sequelize','transaction','order','LOCK','Contact','keys','User','Agent','name','voicePause','includes','push','UserId','all','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','destroy','COUNT','literal'];(function(_0x4a4d34,_0x233dce){var _0x4ac091=function(_0x77b16d){while(--_0x77b16d){_0x4a4d34['push'](_0x4a4d34['shift']());}};_0x4ac091(++_0x233dce);}(_0xdb23,0x166));var _0x3db2=function(_0xcc7c06,_0x4ca291){_0xcc7c06=_0xcc7c06-0x0;var _0x27b445=_0xdb23[_0xcc7c06];return _0x27b445;};'use strict';var _=require(_0x3db2('0x0'));var util=require(_0x3db2('0x1'));var moment=require(_0x3db2('0x2'));var BPromise=require('bluebird');var rs=require(_0x3db2('0x3'));var fs=require('fs');var Redis=require(_0x3db2('0x4'));var db=require(_0x3db2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3db2('0x6'));var config=require(_0x3db2('0x7'));var jayson=require(_0x3db2('0x8'));var client=jayson[_0x3db2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5652fb,_0x181b8e,_0x1293fa){return new BPromise(function(_0x73b2c8,_0xc07c01){return client[_0x3db2('0xa')](_0x5652fb,_0x1293fa)[_0x3db2('0xb')](function(_0x1c3130){logger[_0x3db2('0xc')](_0x3db2('0xd'),_0x181b8e,_0x3db2('0xe'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x181b8e,'request\x20sent',JSON[_0x3db2('0xf')](_0x1c3130));if(_0x1c3130[_0x3db2('0x10')]){if(_0x1c3130[_0x3db2('0x10')][_0x3db2('0x11')]===0x1f4){logger['error'](_0x3db2('0xd'),_0x181b8e,_0x1c3130[_0x3db2('0x10')]['message']);return _0xc07c01(_0x1c3130[_0x3db2('0x10')]['message']);}logger[_0x3db2('0x10')]('CmHopper,\x20%s,\x20%s',_0x181b8e,_0x1c3130[_0x3db2('0x10')]['message']);return _0x73b2c8(_0x1c3130[_0x3db2('0x10')][_0x3db2('0x12')]);}else{logger[_0x3db2('0xc')](_0x3db2('0xd'),_0x181b8e,'request\x20sent');_0x73b2c8(_0x1c3130[_0x3db2('0x13')][_0x3db2('0x12')]);}})[_0x3db2('0x14')](function(_0x44209b){logger['error'](_0x3db2('0xd'),_0x181b8e,_0x44209b);_0xc07c01(_0x44209b);});});}exports[_0x3db2('0x15')]=function(_0x4acb17){var _0x3165b0=this;return new Promise(function(_0x856344,_0x239395){return db['CmHopper'][_0x3db2('0x16')]({'raw':_0x4acb17[_0x3db2('0x17')]?_0x4acb17['options'][_0x3db2('0x18')]===undefined?!![]:![]:!![],'where':_0x4acb17[_0x3db2('0x17')]?_0x4acb17[_0x3db2('0x17')][_0x3db2('0x19')]||null:null,'attributes':_0x4acb17[_0x3db2('0x17')]?_0x4acb17[_0x3db2('0x17')]['attributes']||null:null,'limit':_0x4acb17[_0x3db2('0x17')]?_0x4acb17[_0x3db2('0x17')][_0x3db2('0x1a')]||null:null,'include':_0x4acb17[_0x3db2('0x17')]?_0x4acb17[_0x3db2('0x17')][_0x3db2('0x1b')]?_[_0x3db2('0x1c')](_0x4acb17[_0x3db2('0x17')]['include'],function(_0x1db833){return{'model':db[_0x1db833[_0x3db2('0x1d')]],'as':_0x1db833['as'],'attributes':_0x1db833[_0x3db2('0x1e')],'include':_0x1db833['include']?_[_0x3db2('0x1c')](_0x1db833['include'],function(_0x48238){return{'model':db[_0x48238[_0x3db2('0x1d')]],'as':_0x48238['as'],'attributes':_0x48238[_0x3db2('0x1e')],'include':_0x48238[_0x3db2('0x1b')]?_[_0x3db2('0x1c')](_0x48238[_0x3db2('0x1b')],function(_0x31842b){return{'model':db[_0x31842b['model']],'as':_0x31842b['as'],'attributes':_0x31842b[_0x3db2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3db2('0xb')](function(_0x533c72){logger[_0x3db2('0xc')](_0x3db2('0x15'),_0x4acb17);logger[_0x3db2('0x1f')](_0x3db2('0x15'),_0x4acb17,JSON[_0x3db2('0xf')](_0x533c72));_0x856344(_0x533c72);})['catch'](function(_0x5cc0e3){logger['error'](_0x3db2('0x15'),_0x5cc0e3[_0x3db2('0x12')],_0x4acb17);_0x239395(_0x3165b0[_0x3db2('0x10')](0x1f4,_0x5cc0e3[_0x3db2('0x12')]));});});};exports[_0x3db2('0x20')]=function(_0x4f7b20){var _0x29d27a=this;return new Promise(function(_0x4be4ec,_0x914dc5){return db['CmHopper']['find']({'raw':_0x4f7b20[_0x3db2('0x17')]?_0x4f7b20[_0x3db2('0x17')][_0x3db2('0x18')]===undefined?!![]:![]:!![],'where':_0x4f7b20[_0x3db2('0x17')]?_0x4f7b20[_0x3db2('0x17')][_0x3db2('0x19')]||null:null,'attributes':_0x4f7b20[_0x3db2('0x17')]?_0x4f7b20[_0x3db2('0x17')][_0x3db2('0x1e')]||null:null,'include':_0x4f7b20['options']?_0x4f7b20['options']['include']?_[_0x3db2('0x1c')](_0x4f7b20[_0x3db2('0x17')][_0x3db2('0x1b')],function(_0x5144b2){return{'model':db[_0x5144b2[_0x3db2('0x1d')]],'as':_0x5144b2['as'],'attributes':_0x5144b2['attributes'],'include':_0x5144b2['include']?_[_0x3db2('0x1c')](_0x5144b2[_0x3db2('0x1b')],function(_0xb4128d){return{'model':db[_0xb4128d[_0x3db2('0x1d')]],'as':_0xb4128d['as'],'attributes':_0xb4128d[_0x3db2('0x1e')],'include':_0xb4128d[_0x3db2('0x1b')]?_[_0x3db2('0x1c')](_0xb4128d[_0x3db2('0x1b')],function(_0x20d76b){return{'model':db[_0x20d76b[_0x3db2('0x1d')]],'as':_0x20d76b['as'],'attributes':_0x20d76b[_0x3db2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3db2('0xb')](function(_0xce39d){logger[_0x3db2('0xc')](_0x3db2('0x20'),_0x4f7b20);logger[_0x3db2('0x1f')](_0x3db2('0x20'),_0x4f7b20,JSON[_0x3db2('0xf')](_0xce39d));_0x4be4ec(_0xce39d);})['catch'](function(_0x1da03b){logger[_0x3db2('0x10')](_0x3db2('0x20'),_0x1da03b[_0x3db2('0x12')],_0x4f7b20);_0x914dc5(_0x29d27a[_0x3db2('0x10')](0x1f4,_0x1da03b['message']));});});};exports[_0x3db2('0x21')]=function(_0x6fe374){var _0x4bba23=this;return new Promise(function(_0x2fdde7,_0x454c06){return db[_0x3db2('0x22')][_0x3db2('0x23')](_0x6fe374[_0x3db2('0x24')],{'raw':_0x6fe374['options']?_0x6fe374[_0x3db2('0x17')][_0x3db2('0x18')]===undefined?!![]:![]:!![]})[_0x3db2('0xb')](function(_0x38574a){logger[_0x3db2('0xc')](_0x3db2('0x21'),_0x6fe374);logger[_0x3db2('0x1f')](_0x3db2('0x21'),_0x6fe374,JSON['stringify'](_0x38574a));_0x2fdde7(_0x38574a);})['catch'](function(_0x376a4e){logger[_0x3db2('0x10')](_0x3db2('0x21'),_0x376a4e[_0x3db2('0x12')],_0x6fe374);_0x454c06(_0x4bba23[_0x3db2('0x10')](0x1f4,_0x376a4e[_0x3db2('0x12')]));});});};exports['UpdateCmHopper']=function(_0xa5aba8){var _0x204da4=this;return new Promise(function(_0x46f4da,_0x2dec24){return db[_0x3db2('0x22')][_0x3db2('0x25')](_0xa5aba8[_0x3db2('0x24')],{'raw':_0xa5aba8['options']?_0xa5aba8[_0x3db2('0x17')][_0x3db2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa5aba8['options']?_0xa5aba8[_0x3db2('0x17')][_0x3db2('0x19')]||null:null,'attributes':_0xa5aba8['options']?_0xa5aba8[_0x3db2('0x17')][_0x3db2('0x1e')]||null:null,'limit':_0xa5aba8[_0x3db2('0x17')]?_0xa5aba8[_0x3db2('0x17')][_0x3db2('0x1a')]||null:null})[_0x3db2('0xb')](function(_0x312f87){logger['info'](_0x3db2('0x26'),_0xa5aba8);logger[_0x3db2('0x1f')](_0x3db2('0x26'),_0xa5aba8,JSON[_0x3db2('0xf')](_0x312f87));_0x46f4da(_0x312f87);})[_0x3db2('0x14')](function(_0x32f46d){logger[_0x3db2('0x10')]('UpdateCmHopper',_0x32f46d['message'],_0xa5aba8);_0x2dec24(_0x204da4[_0x3db2('0x10')](0x1f4,_0x32f46d[_0x3db2('0x12')]));});});};exports[_0x3db2('0x27')]=function(_0xf0823a){var _0x537e61=this;return new Promise(function(_0x19b7c7,_0xb1587d){return db[_0x3db2('0x22')]['destroy']({'where':_0xf0823a[_0x3db2('0x17')]?_0xf0823a['options'][_0x3db2('0x19')]||null:null})[_0x3db2('0xb')](function(_0x352601){logger['info'](_0x3db2('0x27'),_0xf0823a);logger['debug']('DestroyCmHopper',_0xf0823a,JSON[_0x3db2('0xf')](_0x352601));_0x19b7c7(_0x352601);})[_0x3db2('0x14')](function(_0x3a4d0c){logger[_0x3db2('0x10')](_0x3db2('0x27'),_0x3a4d0c[_0x3db2('0x12')],_0xf0823a);_0xb1587d(_0x537e61[_0x3db2('0x10')](0x1f4,_0x3a4d0c[_0x3db2('0x12')]));});});};exports['GetContactDialer']=function(_0x5d46cf){var _0x5efceb=this;return new Promise(function(_0x560f62,_0x12040e){return db[_0x3db2('0x28')][_0x3db2('0x29')]()[_0x3db2('0xb')](function(_0x51180d){return db[_0x3db2('0x2a')][_0x3db2('0x2b')](function(_0x2f976f){return db[_0x3db2('0x22')][_0x3db2('0x16')]({'where':_0x5d46cf[_0x3db2('0x17')]?_0x5d46cf['options'][_0x3db2('0x19')]||null:null,'attributes':_0x5d46cf['options']?_0x5d46cf[_0x3db2('0x17')]['attributes']||null:null,'limit':_0x5d46cf[_0x3db2('0x17')]?_0x5d46cf[_0x3db2('0x17')][_0x3db2('0x1a')]||null:null,'order':_0x5d46cf[_0x3db2('0x17')]?_0x5d46cf[_0x3db2('0x17')][_0x3db2('0x2c')]||null:null,'transaction':_0x2f976f,'lock':_0x2f976f[_0x3db2('0x2d')]['UPDATE'],'include':[{'model':db[_0x3db2('0x28')],'as':_0x3db2('0x2e'),'attributes':_[_0x3db2('0x2f')](_0x51180d)},{'model':db[_0x3db2('0x30')],'as':_0x3db2('0x31'),'attributes':['id',_0x3db2('0x32'),_0x3db2('0x33')]}]})[_0x3db2('0xb')](function(_0x4d5386){var _0x32dabb=[];var _0x1e250c=[];for(var _0x37159b=0x0;_0x37159b<_0x4d5386['length'];_0x37159b+=0x1){if(!_0x1e250c[_0x3db2('0x34')](_0x4d5386[_0x37159b]['UserId'])){_0x1e250c[_0x3db2('0x35')](_0x4d5386[_0x37159b][_0x3db2('0x36')]);_0x32dabb[_0x3db2('0x35')](_0x4d5386[_0x37159b][_0x3db2('0x25')](_0x5d46cf[_0x3db2('0x24')],{'transaction':_0x2f976f}));}}return BPromise[_0x3db2('0x37')](_0x32dabb);});})[_0x3db2('0xb')](function(_0x520c07){logger[_0x3db2('0xc')]('GetContactDialer',_0x5d46cf);logger['debug']('GetContactDialer',_0x5d46cf,JSON[_0x3db2('0xf')](_0x520c07));_0x560f62(_0x520c07);})[_0x3db2('0x14')](function(_0x59f145){logger[_0x3db2('0x10')](_0x3db2('0x38'),_0x59f145['message'],_0x5d46cf);_0x12040e(_0x5efceb[_0x3db2('0x10')](0x1f4,_0x59f145[_0x3db2('0x12')]));});});});};exports[_0x3db2('0x39')]=function(_0x18173a){var _0x5f3627=this;return new Promise(function(_0x12b06c,_0x573834){return db[_0x3db2('0x2a')][_0x3db2('0x2b')](function(_0x32d142){return db[_0x3db2('0x3a')][_0x3db2('0x23')](_0x18173a['body'],{'raw':_0x18173a['options']?_0x18173a[_0x3db2('0x17')][_0x3db2('0x18')]===undefined?!![]:![]:!![],'transaction':_0x32d142})[_0x3db2('0xb')](function(){return db[_0x3db2('0x22')][_0x3db2('0x3b')]({'where':_0x18173a[_0x3db2('0x17')]?_0x18173a[_0x3db2('0x17')][_0x3db2('0x19')]||null:null,'transaction':_0x32d142});});})[_0x3db2('0xb')](function(_0x1e911b){logger[_0x3db2('0xc')](_0x3db2('0x39'),_0x18173a);logger['debug'](_0x3db2('0x39'),_0x18173a,JSON['stringify'](_0x1e911b));_0x12b06c(_0x1e911b);})['catch'](function(_0x2bb4fd){logger[_0x3db2('0x10')]('MoveContactManagedDialer',_0x2bb4fd[_0x3db2('0x12')],_0x18173a);_0x573834(_0x5f3627[_0x3db2('0x10')](0x1f4,_0x2bb4fd[_0x3db2('0x12')]));});});};exports['CountReScheduled']=function(_0x13f5c4){var _0x19ebfa=this;return new Promise(function(_0x152b6e,_0x4f0502){return db[_0x3db2('0x22')][_0x3db2('0x16')]({'raw':_0x13f5c4[_0x3db2('0x17')]?_0x13f5c4['options'][_0x3db2('0x18')]===undefined?!![]:![]:!![],'where':_0x13f5c4[_0x3db2('0x17')]?_0x13f5c4['options'][_0x3db2('0x19')]||null:null,'attributes':[[db[_0x3db2('0x2a')]['fn'](_0x3db2('0x3c'),db['sequelize']['fn']('IF',db[_0x3db2('0x2a')][_0x3db2('0x3d')]('`scheduledat`\x20>=\x20'+util[_0x3db2('0x3e')]('\x22%s\x22',moment()['format'](_0x3db2('0x3f')))+_0x3db2('0x40')))),_0x3db2('0x41')]]})['then'](function(_0x2442bb){logger[_0x3db2('0xc')](_0x3db2('0x42'),_0x13f5c4);logger['debug']('CountReScheduled',_0x13f5c4,JSON[_0x3db2('0xf')](_0x2442bb));_0x152b6e(_0x2442bb);})['catch'](function(_0x8b17b9){logger[_0x3db2('0x10')](_0x3db2('0x42'),_0x8b17b9[_0x3db2('0x12')],_0x13f5c4);_0x4f0502(_0x19ebfa[_0x3db2('0x10')](0x1f4,_0x8b17b9[_0x3db2('0x12')]));});});};exports['GetContactRecallMe']=function(_0x43a76d){var _0x548579=this;return new Promise(function(_0x559986,_0x5d6930){return db['CmContact'][_0x3db2('0x29')]()[_0x3db2('0xb')](function(_0x5d1819){return db[_0x3db2('0x2a')][_0x3db2('0x2b')](function(_0x3aa83c){return db[_0x3db2('0x22')][_0x3db2('0x16')]({'where':_0x43a76d[_0x3db2('0x17')]?_0x43a76d['options'][_0x3db2('0x19')]||null:null,'attributes':_0x43a76d['options']?_0x43a76d[_0x3db2('0x17')]['attributes']||null:null,'limit':0x1,'order':_0x43a76d['options']?_0x43a76d[_0x3db2('0x17')][_0x3db2('0x2c')]||null:null,'group':db[_0x3db2('0x22')][_0x3db2('0x36')],'transaction':_0x3aa83c,'lock':_0x3aa83c[_0x3db2('0x2d')][_0x3db2('0x43')],'include':_0x43a76d[_0x3db2('0x17')]?_0x43a76d[_0x3db2('0x17')][_0x3db2('0x1b')]?_[_0x3db2('0x1c')](_0x43a76d[_0x3db2('0x17')][_0x3db2('0x1b')],function(_0x53111d){return{'model':db[_0x53111d[_0x3db2('0x1d')]],'as':_0x53111d['as'],'attributes':_0x53111d['attributes'],'include':_0x53111d['include']?_[_0x3db2('0x1c')](_0x53111d[_0x3db2('0x1b')],function(_0x2fe656){return{'model':db[_0x2fe656[_0x3db2('0x1d')]],'as':_0x2fe656['as'],'attributes':_0x2fe656[_0x3db2('0x1e')],'include':_0x2fe656['include']?_[_0x3db2('0x1c')](_0x2fe656[_0x3db2('0x1b')],function(_0x44a09c){return{'model':db[_0x44a09c[_0x3db2('0x1d')]],'as':_0x44a09c['as'],'attributes':_0x44a09c[_0x3db2('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x332895){var _0x19e595=[];for(var _0xc09869=0x0;_0xc09869<_0x332895[_0x3db2('0x44')];_0xc09869+=0x1){_0x19e595[_0x3db2('0x35')](_0x332895[_0xc09869][_0x3db2('0x25')](_0x43a76d[_0x3db2('0x24')],{'transaction':_0x3aa83c}));}return BPromise['all'](_0x19e595);});})[_0x3db2('0xb')](function(_0x73f763){logger[_0x3db2('0xc')](_0x3db2('0x45'),_0x43a76d);logger['debug'](_0x3db2('0x45'),_0x43a76d,JSON[_0x3db2('0xf')](_0x73f763));_0x559986(_0x73f763);})[_0x3db2('0x14')](function(_0x15527d){logger['error']('GetContactRecallMe',_0x15527d[_0x3db2('0x12')],_0x43a76d);_0x5d6930(_0x548579[_0x3db2('0x10')](0x1f4,_0x15527d[_0x3db2('0x12')]));});});});};exports['GetCmHopperPreview']=function(_0x233099){var _0x4d2feb=this;return new Promise(function(_0x342297,_0x48985c){db['CmContact'][_0x3db2('0x29')]()[_0x3db2('0xb')](function(_0x4676aa){return db['CmHopper']['findAll']({'raw':_0x233099[_0x3db2('0x17')]?_0x233099[_0x3db2('0x17')][_0x3db2('0x18')]===undefined?!![]:![]:!![],'where':_0x233099['options']?_0x233099[_0x3db2('0x17')]['where']||null:null,'attributes':_0x233099['options']?_0x233099[_0x3db2('0x17')][_0x3db2('0x1e')]||null:null,'limit':_0x233099[_0x3db2('0x17')]?_0x233099['options'][_0x3db2('0x1a')]||null:null,'include':_0x233099[_0x3db2('0x17')]?_0x233099['options'][_0x3db2('0x1b')]?_['map'](_0x233099[_0x3db2('0x17')][_0x3db2('0x1b')],function(_0x137163){return{'model':db[_0x137163[_0x3db2('0x1d')]],'as':_0x137163['as'],'attributes':_0x137163['as']==='Contact'?_[_0x3db2('0x2f')](_0x4676aa):_0x137163[_0x3db2('0x1e')],'include':_0x137163['include']?_['map'](_0x137163[_0x3db2('0x1b')],function(_0xd68643){return{'model':db[_0xd68643[_0x3db2('0x1d')]],'as':_0xd68643['as'],'attributes':_0xd68643['attributes'],'include':_0xd68643[_0x3db2('0x1b')]?_[_0x3db2('0x1c')](_0xd68643[_0x3db2('0x1b')],function(_0x8f8ab6){return{'model':db[_0x8f8ab6[_0x3db2('0x1d')]],'as':_0x8f8ab6['as'],'attributes':_0x8f8ab6['attributes']};}):[]};}):[]};}):[]:[]})[_0x3db2('0xb')](function(_0x3f16b6){logger['info'](_0x3db2('0x15'),_0x233099);logger[_0x3db2('0x1f')]('GetCmHopper',_0x233099,JSON[_0x3db2('0xf')](_0x3f16b6));_0x342297(_0x3f16b6);})[_0x3db2('0x14')](function(_0x2d0a70){logger[_0x3db2('0x10')](_0x3db2('0x15'),_0x2d0a70[_0x3db2('0x12')],_0x233099);_0x48985c(_0x4d2feb[_0x3db2('0x10')](0x1f4,_0x2d0a70[_0x3db2('0x12')]));});});});}; \ No newline at end of file +var _0xe6c3=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','order','UPDATE','Contact','keys','name','voicePause','includes','UserId','push','all','GetContactDialer','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','LOCK','length','GetCmHopperPreview','limit','lodash','util','moment','randomstring'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xe6c3,0x1e6));var _0x3e6c=function(_0x31add1,_0x5ea1fa){_0x31add1=_0x31add1-0x0;var _0x18dff1=_0xe6c3[_0x31add1];return _0x18dff1;};'use strict';var _=require(_0x3e6c('0x0'));var util=require(_0x3e6c('0x1'));var moment=require(_0x3e6c('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e6c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e6c('0x4'))['db'];var utils=require(_0x3e6c('0x5'));var logger=require('../../config/logger')(_0x3e6c('0x6'));var config=require(_0x3e6c('0x7'));var jayson=require(_0x3e6c('0x8'));var client=jayson[_0x3e6c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ac544,_0x31e190,_0x5c7b11){return new BPromise(function(_0x15e3ef,_0x124e16){return client[_0x3e6c('0xa')](_0x1ac544,_0x5c7b11)[_0x3e6c('0xb')](function(_0x2695c3){logger[_0x3e6c('0xc')](_0x3e6c('0xd'),_0x31e190,_0x3e6c('0xe'));logger[_0x3e6c('0xf')](_0x3e6c('0x10'),_0x31e190,_0x3e6c('0xe'),JSON[_0x3e6c('0x11')](_0x2695c3));if(_0x2695c3[_0x3e6c('0x12')]){if(_0x2695c3[_0x3e6c('0x12')][_0x3e6c('0x13')]===0x1f4){logger[_0x3e6c('0x12')](_0x3e6c('0xd'),_0x31e190,_0x2695c3[_0x3e6c('0x12')][_0x3e6c('0x14')]);return _0x124e16(_0x2695c3[_0x3e6c('0x12')]['message']);}logger[_0x3e6c('0x12')](_0x3e6c('0xd'),_0x31e190,_0x2695c3[_0x3e6c('0x12')][_0x3e6c('0x14')]);return _0x15e3ef(_0x2695c3[_0x3e6c('0x12')][_0x3e6c('0x14')]);}else{logger['info']('CmHopper,\x20%s,\x20%s',_0x31e190,_0x3e6c('0xe'));_0x15e3ef(_0x2695c3['result'][_0x3e6c('0x14')]);}})[_0x3e6c('0x15')](function(_0x1f6f58){logger[_0x3e6c('0x12')](_0x3e6c('0xd'),_0x31e190,_0x1f6f58);_0x124e16(_0x1f6f58);});});}exports[_0x3e6c('0x16')]=function(_0x338e0c){var _0x20c0a3=this;return new Promise(function(_0xb3bde9,_0x5e1fa5){return db[_0x3e6c('0x17')][_0x3e6c('0x18')]({'raw':_0x338e0c[_0x3e6c('0x19')]?_0x338e0c[_0x3e6c('0x19')][_0x3e6c('0x1a')]===undefined?!![]:![]:!![],'where':_0x338e0c[_0x3e6c('0x19')]?_0x338e0c[_0x3e6c('0x19')][_0x3e6c('0x1b')]||null:null,'attributes':_0x338e0c['options']?_0x338e0c[_0x3e6c('0x19')][_0x3e6c('0x1c')]||null:null,'limit':_0x338e0c['options']?_0x338e0c['options']['limit']||null:null,'include':_0x338e0c[_0x3e6c('0x19')]?_0x338e0c[_0x3e6c('0x19')][_0x3e6c('0x1d')]?_[_0x3e6c('0x1e')](_0x338e0c[_0x3e6c('0x19')][_0x3e6c('0x1d')],function(_0x212e2b){return{'model':db[_0x212e2b[_0x3e6c('0x1f')]],'as':_0x212e2b['as'],'attributes':_0x212e2b[_0x3e6c('0x1c')],'include':_0x212e2b['include']?_['map'](_0x212e2b[_0x3e6c('0x1d')],function(_0x2dfde9){return{'model':db[_0x2dfde9[_0x3e6c('0x1f')]],'as':_0x2dfde9['as'],'attributes':_0x2dfde9[_0x3e6c('0x1c')],'include':_0x2dfde9['include']?_[_0x3e6c('0x1e')](_0x2dfde9[_0x3e6c('0x1d')],function(_0x4fefc7){return{'model':db[_0x4fefc7['model']],'as':_0x4fefc7['as'],'attributes':_0x4fefc7[_0x3e6c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3e6c('0xb')](function(_0x37fe21){logger['info'](_0x3e6c('0x16'),_0x338e0c);logger[_0x3e6c('0xf')]('GetCmHopper',_0x338e0c,JSON['stringify'](_0x37fe21));_0xb3bde9(_0x37fe21);})[_0x3e6c('0x15')](function(_0x59640c){logger[_0x3e6c('0x12')](_0x3e6c('0x16'),_0x59640c[_0x3e6c('0x14')],_0x338e0c);_0x5e1fa5(_0x20c0a3[_0x3e6c('0x12')](0x1f4,_0x59640c[_0x3e6c('0x14')]));});});};exports['ShowCmHopper']=function(_0x3e01c5){var _0x208eae=this;return new Promise(function(_0x1d1ac9,_0x1a73c5){return db[_0x3e6c('0x17')]['find']({'raw':_0x3e01c5['options']?_0x3e01c5[_0x3e6c('0x19')][_0x3e6c('0x1a')]===undefined?!![]:![]:!![],'where':_0x3e01c5['options']?_0x3e01c5[_0x3e6c('0x19')][_0x3e6c('0x1b')]||null:null,'attributes':_0x3e01c5[_0x3e6c('0x19')]?_0x3e01c5[_0x3e6c('0x19')][_0x3e6c('0x1c')]||null:null,'include':_0x3e01c5[_0x3e6c('0x19')]?_0x3e01c5[_0x3e6c('0x19')]['include']?_['map'](_0x3e01c5[_0x3e6c('0x19')][_0x3e6c('0x1d')],function(_0x5f3e9d){return{'model':db[_0x5f3e9d['model']],'as':_0x5f3e9d['as'],'attributes':_0x5f3e9d[_0x3e6c('0x1c')],'include':_0x5f3e9d['include']?_[_0x3e6c('0x1e')](_0x5f3e9d[_0x3e6c('0x1d')],function(_0x1e21c1){return{'model':db[_0x1e21c1[_0x3e6c('0x1f')]],'as':_0x1e21c1['as'],'attributes':_0x1e21c1[_0x3e6c('0x1c')],'include':_0x1e21c1[_0x3e6c('0x1d')]?_[_0x3e6c('0x1e')](_0x1e21c1[_0x3e6c('0x1d')],function(_0x37f611){return{'model':db[_0x37f611[_0x3e6c('0x1f')]],'as':_0x37f611['as'],'attributes':_0x37f611[_0x3e6c('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9a3c6){logger[_0x3e6c('0xc')](_0x3e6c('0x20'),_0x3e01c5);logger['debug'](_0x3e6c('0x20'),_0x3e01c5,JSON['stringify'](_0x9a3c6));_0x1d1ac9(_0x9a3c6);})[_0x3e6c('0x15')](function(_0x3a7177){logger[_0x3e6c('0x12')](_0x3e6c('0x20'),_0x3a7177[_0x3e6c('0x14')],_0x3e01c5);_0x1a73c5(_0x208eae['error'](0x1f4,_0x3a7177[_0x3e6c('0x14')]));});});};exports[_0x3e6c('0x21')]=function(_0x39c88c){var _0x19bc73=this;return new Promise(function(_0x4d6735,_0x9900a7){return db[_0x3e6c('0x17')][_0x3e6c('0x22')](_0x39c88c[_0x3e6c('0x23')],{'raw':_0x39c88c[_0x3e6c('0x19')]?_0x39c88c[_0x3e6c('0x19')][_0x3e6c('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3f084c){logger[_0x3e6c('0xc')](_0x3e6c('0x21'),_0x39c88c);logger['debug'](_0x3e6c('0x21'),_0x39c88c,JSON['stringify'](_0x3f084c));_0x4d6735(_0x3f084c);})[_0x3e6c('0x15')](function(_0x10ddfe){logger['error'](_0x3e6c('0x21'),_0x10ddfe['message'],_0x39c88c);_0x9900a7(_0x19bc73[_0x3e6c('0x12')](0x1f4,_0x10ddfe[_0x3e6c('0x14')]));});});};exports[_0x3e6c('0x24')]=function(_0x3bbf7d){var _0x378274=this;return new Promise(function(_0x5bbb41,_0x1029c1){return db[_0x3e6c('0x17')][_0x3e6c('0x25')](_0x3bbf7d['body'],{'raw':_0x3bbf7d[_0x3e6c('0x19')]?_0x3bbf7d[_0x3e6c('0x19')][_0x3e6c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3bbf7d[_0x3e6c('0x19')]?_0x3bbf7d[_0x3e6c('0x19')][_0x3e6c('0x1b')]||null:null,'attributes':_0x3bbf7d[_0x3e6c('0x19')]?_0x3bbf7d[_0x3e6c('0x19')][_0x3e6c('0x1c')]||null:null,'limit':_0x3bbf7d['options']?_0x3bbf7d['options']['limit']||null:null})['then'](function(_0x280fd1){logger[_0x3e6c('0xc')](_0x3e6c('0x24'),_0x3bbf7d);logger['debug']('UpdateCmHopper',_0x3bbf7d,JSON[_0x3e6c('0x11')](_0x280fd1));_0x5bbb41(_0x280fd1);})[_0x3e6c('0x15')](function(_0x3087ff){logger[_0x3e6c('0x12')](_0x3e6c('0x24'),_0x3087ff[_0x3e6c('0x14')],_0x3bbf7d);_0x1029c1(_0x378274[_0x3e6c('0x12')](0x1f4,_0x3087ff[_0x3e6c('0x14')]));});});};exports[_0x3e6c('0x26')]=function(_0x8ececc){var _0x1d9eea=this;return new Promise(function(_0x266d81,_0x34de04){return db[_0x3e6c('0x17')][_0x3e6c('0x27')]({'where':_0x8ececc['options']?_0x8ececc[_0x3e6c('0x19')]['where']||null:null})[_0x3e6c('0xb')](function(_0x1fb161){logger[_0x3e6c('0xc')](_0x3e6c('0x26'),_0x8ececc);logger['debug'](_0x3e6c('0x26'),_0x8ececc,JSON[_0x3e6c('0x11')](_0x1fb161));_0x266d81(_0x1fb161);})[_0x3e6c('0x15')](function(_0x17b663){logger['error'](_0x3e6c('0x26'),_0x17b663[_0x3e6c('0x14')],_0x8ececc);_0x34de04(_0x1d9eea[_0x3e6c('0x12')](0x1f4,_0x17b663['message']));});});};exports['GetContactDialer']=function(_0x4d4b39){var _0x439fe6=this;return new Promise(function(_0x1b9b97,_0x462c94){return db[_0x3e6c('0x28')][_0x3e6c('0x29')]()[_0x3e6c('0xb')](function(_0x56b131){return db[_0x3e6c('0x2a')][_0x3e6c('0x2b')](function(_0x5d2f84){return db[_0x3e6c('0x17')][_0x3e6c('0x18')]({'where':_0x4d4b39['options']?_0x4d4b39[_0x3e6c('0x19')][_0x3e6c('0x1b')]||null:null,'attributes':_0x4d4b39['options']?_0x4d4b39[_0x3e6c('0x19')][_0x3e6c('0x1c')]||null:null,'limit':_0x4d4b39[_0x3e6c('0x19')]?_0x4d4b39[_0x3e6c('0x19')]['limit']||null:null,'order':_0x4d4b39[_0x3e6c('0x19')]?_0x4d4b39['options'][_0x3e6c('0x2c')]||null:null,'transaction':_0x5d2f84,'lock':_0x5d2f84['LOCK'][_0x3e6c('0x2d')],'include':[{'model':db['CmContact'],'as':_0x3e6c('0x2e'),'attributes':_[_0x3e6c('0x2f')](_0x56b131)},{'model':db['User'],'as':'Agent','attributes':['id',_0x3e6c('0x30'),_0x3e6c('0x31')]}]})[_0x3e6c('0xb')](function(_0x88400f){var _0x184558=[];var _0x2e6126=[];for(var _0x7f477c=0x0;_0x7f477c<_0x88400f['length'];_0x7f477c+=0x1){if(!_0x2e6126[_0x3e6c('0x32')](_0x88400f[_0x7f477c][_0x3e6c('0x33')])){_0x2e6126[_0x3e6c('0x34')](_0x88400f[_0x7f477c][_0x3e6c('0x33')]);_0x184558[_0x3e6c('0x34')](_0x88400f[_0x7f477c][_0x3e6c('0x25')](_0x4d4b39[_0x3e6c('0x23')],{'transaction':_0x5d2f84}));}}return BPromise[_0x3e6c('0x35')](_0x184558);});})[_0x3e6c('0xb')](function(_0x498382){logger[_0x3e6c('0xc')](_0x3e6c('0x36'),_0x4d4b39);logger[_0x3e6c('0xf')](_0x3e6c('0x36'),_0x4d4b39,JSON[_0x3e6c('0x11')](_0x498382));_0x1b9b97(_0x498382);})['catch'](function(_0x2b46f8){logger['error'](_0x3e6c('0x36'),_0x2b46f8['message'],_0x4d4b39);_0x462c94(_0x439fe6[_0x3e6c('0x12')](0x1f4,_0x2b46f8[_0x3e6c('0x14')]));});});});};exports[_0x3e6c('0x37')]=function(_0x3f8641){var _0x1c60d7=this;return new Promise(function(_0x541d39,_0x4e3348){return db[_0x3e6c('0x2a')]['transaction'](function(_0x4df795){return db['CmHopperFinal'][_0x3e6c('0x22')](_0x3f8641[_0x3e6c('0x23')],{'raw':_0x3f8641[_0x3e6c('0x19')]?_0x3f8641[_0x3e6c('0x19')][_0x3e6c('0x1a')]===undefined?!![]:![]:!![],'transaction':_0x4df795})['then'](function(){return db['CmHopper'][_0x3e6c('0x27')]({'where':_0x3f8641[_0x3e6c('0x19')]?_0x3f8641[_0x3e6c('0x19')][_0x3e6c('0x1b')]||null:null,'transaction':_0x4df795});});})[_0x3e6c('0xb')](function(_0x114a66){logger[_0x3e6c('0xc')]('MoveContactManagedDialer',_0x3f8641);logger[_0x3e6c('0xf')](_0x3e6c('0x37'),_0x3f8641,JSON['stringify'](_0x114a66));_0x541d39(_0x114a66);})[_0x3e6c('0x15')](function(_0x190026){logger[_0x3e6c('0x12')](_0x3e6c('0x37'),_0x190026[_0x3e6c('0x14')],_0x3f8641);_0x4e3348(_0x1c60d7[_0x3e6c('0x12')](0x1f4,_0x190026['message']));});});};exports['CountReScheduled']=function(_0x456a89){var _0x2c9768=this;return new Promise(function(_0x57648a,_0x3e164d){return db['CmHopper'][_0x3e6c('0x18')]({'raw':_0x456a89[_0x3e6c('0x19')]?_0x456a89[_0x3e6c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x456a89[_0x3e6c('0x19')]?_0x456a89['options'][_0x3e6c('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0x3e6c('0x38'),db[_0x3e6c('0x2a')]['fn']('IF',db[_0x3e6c('0x2a')][_0x3e6c('0x39')](_0x3e6c('0x3a')+util[_0x3e6c('0x3b')](_0x3e6c('0x3c'),moment()[_0x3e6c('0x3b')](_0x3e6c('0x3d')))+_0x3e6c('0x3e')))),_0x3e6c('0x3f')]]})[_0x3e6c('0xb')](function(_0x143ffc){logger[_0x3e6c('0xc')]('CountReScheduled',_0x456a89);logger['debug'](_0x3e6c('0x40'),_0x456a89,JSON[_0x3e6c('0x11')](_0x143ffc));_0x57648a(_0x143ffc);})['catch'](function(_0x4dc51d){logger['error'](_0x3e6c('0x40'),_0x4dc51d[_0x3e6c('0x14')],_0x456a89);_0x3e164d(_0x2c9768[_0x3e6c('0x12')](0x1f4,_0x4dc51d[_0x3e6c('0x14')]));});});};exports[_0x3e6c('0x41')]=function(_0x27b85c){var _0x18a942=this;return new Promise(function(_0x231518,_0x4200a9){return db[_0x3e6c('0x28')][_0x3e6c('0x29')]()[_0x3e6c('0xb')](function(_0x2ef6bd){return db[_0x3e6c('0x2a')][_0x3e6c('0x2b')](function(_0x4e2a35){return db[_0x3e6c('0x17')][_0x3e6c('0x18')]({'where':_0x27b85c[_0x3e6c('0x19')]?_0x27b85c[_0x3e6c('0x19')][_0x3e6c('0x1b')]||null:null,'attributes':_0x27b85c[_0x3e6c('0x19')]?_0x27b85c['options'][_0x3e6c('0x1c')]||null:null,'limit':0x1,'order':_0x27b85c[_0x3e6c('0x19')]?_0x27b85c[_0x3e6c('0x19')][_0x3e6c('0x2c')]||null:null,'group':db[_0x3e6c('0x17')][_0x3e6c('0x33')],'transaction':_0x4e2a35,'lock':_0x4e2a35[_0x3e6c('0x42')][_0x3e6c('0x2d')],'include':_0x27b85c[_0x3e6c('0x19')]?_0x27b85c[_0x3e6c('0x19')][_0x3e6c('0x1d')]?_[_0x3e6c('0x1e')](_0x27b85c[_0x3e6c('0x19')][_0x3e6c('0x1d')],function(_0x2cf5a6){return{'model':db[_0x2cf5a6[_0x3e6c('0x1f')]],'as':_0x2cf5a6['as'],'attributes':_0x2cf5a6[_0x3e6c('0x1c')],'include':_0x2cf5a6[_0x3e6c('0x1d')]?_[_0x3e6c('0x1e')](_0x2cf5a6[_0x3e6c('0x1d')],function(_0xcb092e){return{'model':db[_0xcb092e[_0x3e6c('0x1f')]],'as':_0xcb092e['as'],'attributes':_0xcb092e[_0x3e6c('0x1c')],'include':_0xcb092e['include']?_[_0x3e6c('0x1e')](_0xcb092e[_0x3e6c('0x1d')],function(_0x39b2b7){return{'model':db[_0x39b2b7[_0x3e6c('0x1f')]],'as':_0x39b2b7['as'],'attributes':_0x39b2b7['attributes']};}):[]};}):[]};}):[]:[]})[_0x3e6c('0xb')](function(_0x532dc3){var _0x4fa515=[];for(var _0x502b1b=0x0;_0x502b1b<_0x532dc3[_0x3e6c('0x43')];_0x502b1b+=0x1){_0x4fa515[_0x3e6c('0x34')](_0x532dc3[_0x502b1b][_0x3e6c('0x25')](_0x27b85c['body'],{'transaction':_0x4e2a35}));}return BPromise[_0x3e6c('0x35')](_0x4fa515);});})[_0x3e6c('0xb')](function(_0x4b3b00){logger[_0x3e6c('0xc')](_0x3e6c('0x41'),_0x27b85c);logger[_0x3e6c('0xf')]('GetContactRecallMe',_0x27b85c,JSON[_0x3e6c('0x11')](_0x4b3b00));_0x231518(_0x4b3b00);})[_0x3e6c('0x15')](function(_0x1e287){logger['error'](_0x3e6c('0x41'),_0x1e287['message'],_0x27b85c);_0x4200a9(_0x18a942[_0x3e6c('0x12')](0x1f4,_0x1e287[_0x3e6c('0x14')]));});});});};exports[_0x3e6c('0x44')]=function(_0x32a842){var _0x52eee7=this;return new Promise(function(_0x2c8faf,_0x1c8000){db[_0x3e6c('0x28')][_0x3e6c('0x29')]()['then'](function(_0x3e7845){return db['CmHopper']['findAll']({'raw':_0x32a842[_0x3e6c('0x19')]?_0x32a842['options']['raw']===undefined?!![]:![]:!![],'where':_0x32a842[_0x3e6c('0x19')]?_0x32a842[_0x3e6c('0x19')][_0x3e6c('0x1b')]||null:null,'attributes':_0x32a842['options']?_0x32a842['options'][_0x3e6c('0x1c')]||null:null,'limit':_0x32a842[_0x3e6c('0x19')]?_0x32a842['options'][_0x3e6c('0x45')]||null:null,'include':_0x32a842[_0x3e6c('0x19')]?_0x32a842[_0x3e6c('0x19')][_0x3e6c('0x1d')]?_['map'](_0x32a842[_0x3e6c('0x19')][_0x3e6c('0x1d')],function(_0x287b37){return{'model':db[_0x287b37[_0x3e6c('0x1f')]],'as':_0x287b37['as'],'attributes':_0x287b37['as']===_0x3e6c('0x2e')?_['keys'](_0x3e7845):_0x287b37[_0x3e6c('0x1c')],'include':_0x287b37[_0x3e6c('0x1d')]?_[_0x3e6c('0x1e')](_0x287b37[_0x3e6c('0x1d')],function(_0x2d9162){return{'model':db[_0x2d9162[_0x3e6c('0x1f')]],'as':_0x2d9162['as'],'attributes':_0x2d9162[_0x3e6c('0x1c')],'include':_0x2d9162[_0x3e6c('0x1d')]?_[_0x3e6c('0x1e')](_0x2d9162[_0x3e6c('0x1d')],function(_0x149c27){return{'model':db[_0x149c27[_0x3e6c('0x1f')]],'as':_0x149c27['as'],'attributes':_0x149c27[_0x3e6c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3e6c('0xb')](function(_0x577987){logger[_0x3e6c('0xc')]('GetCmHopper',_0x32a842);logger[_0x3e6c('0xf')](_0x3e6c('0x16'),_0x32a842,JSON[_0x3e6c('0x11')](_0x577987));_0x2c8faf(_0x577987);})[_0x3e6c('0x15')](function(_0x50cbd5){logger[_0x3e6c('0x12')](_0x3e6c('0x16'),_0x50cbd5[_0x3e6c('0x14')],_0x32a842);_0x1c8000(_0x52eee7['error'](0x1f4,_0x50cbd5[_0x3e6c('0x14')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 22b3be2..86792bf 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 _0x7dfd=['update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','show','post','create','/preview','getPreview','/timezone','getTimezone','put','/:id'];(function(_0x43b63e,_0x3c8e97){var _0x1bc1d2=function(_0x25bb27){while(--_0x25bb27){_0x43b63e['push'](_0x43b63e['shift']());}};_0x1bc1d2(++_0x3c8e97);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd7df('0x0'));var util=require(_0xd7df('0x1'));var path=require(_0xd7df('0x2'));var timeout=require(_0xd7df('0x3'));var express=require(_0xd7df('0x4'));var router=express[_0xd7df('0x5')]();var auth=require(_0xd7df('0x6'));var interaction=require(_0xd7df('0x7'));var config=require(_0xd7df('0x8'));var controller=require(_0xd7df('0x9'));router[_0xd7df('0xa')]('/',auth[_0xd7df('0xb')](),controller[_0xd7df('0xc')]);router[_0xd7df('0xa')](_0xd7df('0xd'),auth[_0xd7df('0xb')](),controller[_0xd7df('0xe')]);router['get'](_0xd7df('0xf'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x10')]);router[_0xd7df('0xa')]('/timezones',auth[_0xd7df('0xb')](),controller['getTimezones']);router[_0xd7df('0xa')]('/:id',auth[_0xd7df('0xb')](),controller[_0xd7df('0x11')]);router[_0xd7df('0x12')]('/',auth[_0xd7df('0xb')](),controller[_0xd7df('0x13')]);router[_0xd7df('0x12')](_0xd7df('0x14'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x15')]);router[_0xd7df('0x12')](_0xd7df('0x16'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x17')]);router[_0xd7df('0x18')](_0xd7df('0x19'),auth[_0xd7df('0xb')](),controller[_0xd7df('0x1a')]);router['delete'](_0xd7df('0x19'),auth[_0xd7df('0xb')](),controller['destroy']);module[_0xd7df('0x1b')]=router; \ No newline at end of file +var _0x2bd8=['getTimezone','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','/timezone'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2bd8,0x130));var _0x82bd=function(_0x59a245,_0x57dde4){_0x59a245=_0x59a245-0x0;var _0x4e85cb=_0x2bd8[_0x59a245];return _0x4e85cb;};'use strict';var multer=require(_0x82bd('0x0'));var util=require('util');var path=require(_0x82bd('0x1'));var timeout=require(_0x82bd('0x2'));var express=require(_0x82bd('0x3'));var router=express[_0x82bd('0x4')]();var auth=require(_0x82bd('0x5'));var interaction=require(_0x82bd('0x6'));var config=require(_0x82bd('0x7'));var controller=require('./cmHopper.controller');router[_0x82bd('0x8')]('/',auth[_0x82bd('0x9')](),controller[_0x82bd('0xa')]);router['get'](_0x82bd('0xb'),auth[_0x82bd('0x9')](),controller[_0x82bd('0xc')]);router[_0x82bd('0x8')]('/opencontacts',auth[_0x82bd('0x9')](),controller['getOpenContacts']);router['get']('/timezones',auth[_0x82bd('0x9')](),controller['getTimezones']);router['get'](_0x82bd('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x82bd('0xe')]('/',auth[_0x82bd('0x9')](),controller['create']);router[_0x82bd('0xe')]('/preview',auth[_0x82bd('0x9')](),controller['getPreview']);router[_0x82bd('0xe')](_0x82bd('0xf'),auth[_0x82bd('0x9')](),controller[_0x82bd('0x10')]);router['put'](_0x82bd('0xd'),auth[_0x82bd('0x9')](),controller['update']);router[_0x82bd('0x11')]('/:id',auth[_0x82bd('0x9')](),controller[_0x82bd('0x12')]);module[_0x82bd('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index ac43c67..fa3ad23 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 _0x5a90=['DATE','format','sequelize','INTEGER','STRING'];(function(_0x5b307c,_0x349674){var _0xcaed47=function(_0x19cde3){while(--_0x19cde3){_0x5b307c['push'](_0x5b307c['shift']());}};_0xcaed47(++_0x349674);}(_0x5a90,0x1ab));var _0x05a9=function(_0x46b6df,_0x18aa59){_0x46b6df=_0x46b6df-0x0;var _0x3171db=_0x5a90[_0x46b6df];return _0x3171db;};'use strict';var moment=require('moment');var Sequelize=require(_0x05a9('0x0'));module['exports']={'CmHopperId':{'type':Sequelize[_0x05a9('0x1')]},'phone':{'type':Sequelize[_0x05a9('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x05a9('0x1')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x05a9('0x3')],'defaultValue':moment()[_0x05a9('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x05a9('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x05a9('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x05a9('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x05a9('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x05a9('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc7b7=['DATE','format','moment','sequelize','exports','INTEGER','STRING'];(function(_0x5ec707,_0x4fb06f){var _0x444c08=function(_0x4a841e){while(--_0x4a841e){_0x5ec707['push'](_0x5ec707['shift']());}};_0x444c08(++_0x4fb06f);}(_0xc7b7,0x79));var _0x7c7b=function(_0x284c0c,_0x181aee){_0x284c0c=_0x284c0c-0x0;var _0x418b18=_0xc7b7[_0x284c0c];return _0x418b18;};'use strict';var moment=require(_0x7c7b('0x0'));var Sequelize=require(_0x7c7b('0x1'));module[_0x7c7b('0x2')]={'CmHopperId':{'type':Sequelize[_0x7c7b('0x3')]},'phone':{'type':Sequelize[_0x7c7b('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x7c7b('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x7c7b('0x5')],'defaultValue':moment()[_0x7c7b('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x7c7b('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7c7b('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7c7b('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7c7b('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7c7b('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index 4544068..2dcaffb 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 _0x9a63=['includeAll','include','catch','show','params','keys','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','set','apply','reject','then','destroy','CmHopperAdditionalPhones','UserProfileResource','error','name','send','index','CmHopperAdditionalPhone','rawAttributes','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','pick','where','merge','VIRTUAL','filter','options','count'];(function(_0x4078e5,_0xaf94f9){var _0x1f0a51=function(_0x37f5bb){while(--_0x37f5bb){_0x4078e5['push'](_0x4078e5['shift']());}};_0x1f0a51(++_0xaf94f9);}(_0x9a63,0xac));var _0x39a6=function(_0x57402d,_0x3ebd30){_0x57402d=_0x57402d-0x0;var _0x224071=_0x9a63[_0x57402d];return _0x224071;};'use strict';var pdf=require(_0x39a6('0x0'));var emlformat=require(_0x39a6('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x39a6('0x2'));var rp=require('request-promise');var moment=require(_0x39a6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x39a6('0x4'));var util=require(_0x39a6('0x5'));var path=require(_0x39a6('0x6'));var sox=require(_0x39a6('0x7'));var csv=require(_0x39a6('0x8'));var ejs=require(_0x39a6('0x9'));var fs=require('fs');var _=require(_0x39a6('0xa'));var squel=require(_0x39a6('0xb'));var crypto=require(_0x39a6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x39a6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x39a6('0xe'));var Papa=require(_0x39a6('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x39a6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x39a6('0x11'))(_0x39a6('0x12'));var utils=require(_0x39a6('0x13'));var config=require(_0x39a6('0x14'));var db=require(_0x39a6('0x15'))['db'];function respondWithStatusCode(_0x1bd46a,_0x578378){_0x578378=_0x578378||0xcc;return function(_0x40e6b7){if(_0x40e6b7){return _0x1bd46a[_0x39a6('0x16')](_0x578378);}return _0x1bd46a[_0x39a6('0x17')](_0x578378)[_0x39a6('0x18')]();};}function respondWithResult(_0x34dd62,_0x5dabff){_0x5dabff=_0x5dabff||0xc8;return function(_0x218908){if(_0x218908){return _0x34dd62[_0x39a6('0x17')](_0x5dabff)[_0x39a6('0x19')](_0x218908);}};}function respondWithFilteredResult(_0x207f3c,_0xfb2bc6){return function(_0x55de3a){if(_0x55de3a){var _0x2f6f3e=_0x55de3a['count'],_0x3ece5c=_0xfb2bc6['offset'],_0x436db3=_0xfb2bc6['offset']+_0xfb2bc6['limit'],_0x7d753e;if(_0x436db3>=_0x2f6f3e){_0x436db3=_0x2f6f3e;_0x7d753e=0xc8;}else{_0x7d753e=0xce;}_0x207f3c[_0x39a6('0x17')](_0x7d753e);return _0x207f3c[_0x39a6('0x1a')]('Content-Range',_0x3ece5c+'-'+_0x436db3+'/'+_0x2f6f3e)['json'](_0x55de3a);}return null;};}function patchUpdates(_0x4f20e1){return function(_0x34f63d){try{jsonpatch[_0x39a6('0x1b')](_0x34f63d,_0x4f20e1,!![]);}catch(_0x42f1d1){return BPromise[_0x39a6('0x1c')](_0x42f1d1);}return _0x34f63d['save']();};}function saveUpdates(_0xabaf1e,_0x467506){return function(_0x17524a){if(_0x17524a){return _0x17524a['update'](_0xabaf1e)[_0x39a6('0x1d')](function(_0x18bf6a){return _0x18bf6a;});}return null;};}function removeEntity(_0x5de2b2,_0x38ad55){return function(_0x41fdb5){if(_0x41fdb5){return _0x41fdb5[_0x39a6('0x1e')]()[_0x39a6('0x1d')](function(){var _0x539830=_0x41fdb5['get']({'plain':!![]});var _0x285173=_0x39a6('0x1f');return db[_0x39a6('0x20')][_0x39a6('0x1e')]({'where':{'type':_0x285173,'resourceId':_0x539830['id']}})['then'](function(){return _0x41fdb5;});})['then'](function(){_0x5de2b2[_0x39a6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a82be,_0x2965d3){return function(_0x28e769){if(!_0x28e769){_0x1a82be[_0x39a6('0x16')](0x194);}return _0x28e769;};}function handleError(_0x45e9d6,_0x5050e4){_0x5050e4=_0x5050e4||0x1f4;return function(_0x378245){logger[_0x39a6('0x21')](_0x378245['stack']);if(_0x378245['name']){delete _0x378245[_0x39a6('0x22')];}_0x45e9d6['status'](_0x5050e4)[_0x39a6('0x23')](_0x378245);};}exports[_0x39a6('0x24')]=function(_0x1ba385,_0x45085d){var _0x143d9a={},_0x129e80={},_0x35f840={'count':0x0,'rows':[]};var _0x127398=_['map'](db[_0x39a6('0x25')][_0x39a6('0x26')],function(_0x398769){return{'name':_0x398769['fieldName'],'type':_0x398769[_0x39a6('0x27')][_0x39a6('0x28')]};});_0x129e80['model']=_[_0x39a6('0x29')](_0x127398,_0x39a6('0x22'));_0x129e80[_0x39a6('0x2a')]=_['keys'](_0x1ba385[_0x39a6('0x2a')]);_0x129e80[_0x39a6('0x2b')]=_[_0x39a6('0x2c')](_0x129e80[_0x39a6('0x2d')],_0x129e80[_0x39a6('0x2a')]);_0x143d9a[_0x39a6('0x2e')]=_[_0x39a6('0x2c')](_0x129e80[_0x39a6('0x2d')],qs['fields'](_0x1ba385[_0x39a6('0x2a')][_0x39a6('0x2f')]));_0x143d9a[_0x39a6('0x2e')]=_0x143d9a[_0x39a6('0x2e')][_0x39a6('0x30')]?_0x143d9a[_0x39a6('0x2e')]:_0x129e80['model'];if(!_0x1ba385['query'][_0x39a6('0x31')](_0x39a6('0x32'))){_0x143d9a[_0x39a6('0x33')]=qs[_0x39a6('0x33')](_0x1ba385[_0x39a6('0x2a')][_0x39a6('0x33')]);_0x143d9a[_0x39a6('0x34')]=qs[_0x39a6('0x34')](_0x1ba385[_0x39a6('0x2a')][_0x39a6('0x34')]);}_0x143d9a[_0x39a6('0x35')]=qs['sort'](_0x1ba385[_0x39a6('0x2a')][_0x39a6('0x36')]);_0x143d9a['where']=qs[_0x39a6('0x2b')](_[_0x39a6('0x37')](_0x1ba385[_0x39a6('0x2a')],_0x129e80[_0x39a6('0x2b')]),_0x127398);if(_0x1ba385[_0x39a6('0x2a')]['filter']){_0x143d9a[_0x39a6('0x38')]=_[_0x39a6('0x39')](_0x143d9a[_0x39a6('0x38')],{'$or':_[_0x39a6('0x29')](_0x127398,function(_0xa3bc74){if(_0xa3bc74[_0x39a6('0x27')]!==_0x39a6('0x3a')){var _0x35cce0={};_0x35cce0[_0xa3bc74[_0x39a6('0x22')]]={'$like':'%'+_0x1ba385[_0x39a6('0x2a')][_0x39a6('0x3b')]+'%'};return _0x35cce0;}})});}_0x143d9a=_['merge']({},_0x143d9a,_0x1ba385[_0x39a6('0x3c')]);var _0x1b3f3f={'where':_0x143d9a['where']};return db['CmHopperAdditionalPhone'][_0x39a6('0x3d')](_0x1b3f3f)[_0x39a6('0x1d')](function(_0x380650){_0x35f840['count']=_0x380650;if(_0x1ba385[_0x39a6('0x2a')][_0x39a6('0x3e')]){_0x143d9a[_0x39a6('0x3f')]=[{'all':!![]}];}return db[_0x39a6('0x25')]['findAll'](_0x143d9a);})['then'](function(_0x57a132){_0x35f840['rows']=_0x57a132;return _0x35f840;})[_0x39a6('0x1d')](respondWithFilteredResult(_0x45085d,_0x143d9a))[_0x39a6('0x40')](handleError(_0x45085d,null));};exports[_0x39a6('0x41')]=function(_0x3f9d95,_0x51210d){var _0x2bb30d={'raw':!![],'where':{'id':_0x3f9d95[_0x39a6('0x42')]['id']}},_0x786c2={};_0x786c2[_0x39a6('0x2d')]=_[_0x39a6('0x43')](db[_0x39a6('0x25')][_0x39a6('0x26')]);_0x786c2['query']=_[_0x39a6('0x43')](_0x3f9d95[_0x39a6('0x2a')]);_0x786c2['filters']=_['intersection'](_0x786c2['model'],_0x786c2[_0x39a6('0x2a')]);_0x2bb30d[_0x39a6('0x2e')]=_[_0x39a6('0x2c')](_0x786c2['model'],qs[_0x39a6('0x2f')](_0x3f9d95[_0x39a6('0x2a')][_0x39a6('0x2f')]));_0x2bb30d[_0x39a6('0x2e')]=_0x2bb30d['attributes']['length']?_0x2bb30d[_0x39a6('0x2e')]:_0x786c2[_0x39a6('0x2d')];if(_0x3f9d95[_0x39a6('0x2a')]['includeAll']){_0x2bb30d[_0x39a6('0x3f')]=[{'all':!![]}];}_0x2bb30d=_['merge']({},_0x2bb30d,_0x3f9d95[_0x39a6('0x3c')]);return db['CmHopperAdditionalPhone']['find'](_0x2bb30d)[_0x39a6('0x1d')](handleEntityNotFound(_0x51210d,null))['then'](respondWithResult(_0x51210d,null))[_0x39a6('0x40')](handleError(_0x51210d,null));};exports[_0x39a6('0x44')]=function(_0x2e7898,_0x5e1ba4){return db[_0x39a6('0x25')][_0x39a6('0x44')](_0x2e7898[_0x39a6('0x45')],{})[_0x39a6('0x1d')](function(_0x2c6139){var _0x1272b3=_0x2e7898[_0x39a6('0x46')][_0x39a6('0x47')]({'plain':!![]});if(!_0x1272b3)throw new Error(_0x39a6('0x48'));if(_0x1272b3['role']==='user'){var _0x2b6b44=_0x2c6139['get']({'plain':!![]});var _0x231f63=_0x39a6('0x1f');return db[_0x39a6('0x49')][_0x39a6('0x4a')]({'where':{'name':_0x231f63,'userProfileId':_0x1272b3[_0x39a6('0x4b')]},'raw':!![]})['then'](function(_0x476abc){if(_0x476abc&&_0x476abc['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x2b6b44[_0x39a6('0x22')],'resourceId':_0x2b6b44['id'],'type':_0x476abc[_0x39a6('0x22')],'sectionId':_0x476abc['id']},{})[_0x39a6('0x1d')](function(){return _0x2c6139;});}else{return _0x2c6139;}})[_0x39a6('0x40')](function(_0x253c42){logger[_0x39a6('0x21')](_0x39a6('0x4c'),_0x253c42);throw _0x253c42;});}return _0x2c6139;})['then'](respondWithResult(_0x5e1ba4,0xc9))[_0x39a6('0x40')](handleError(_0x5e1ba4,null));};exports[_0x39a6('0x4d')]=function(_0x206b98,_0x469b9e){if(_0x206b98[_0x39a6('0x45')]['id']){delete _0x206b98['body']['id'];}return db[_0x39a6('0x25')]['find']({'where':{'id':_0x206b98['params']['id']}})[_0x39a6('0x1d')](handleEntityNotFound(_0x469b9e,null))['then'](saveUpdates(_0x206b98['body'],null))[_0x39a6('0x1d')](respondWithResult(_0x469b9e,null))[_0x39a6('0x40')](handleError(_0x469b9e,null));};exports['destroy']=function(_0x53d366,_0x1a2f1b){return db['CmHopperAdditionalPhone'][_0x39a6('0x4a')]({'where':{'id':_0x53d366[_0x39a6('0x42')]['id']}})['then'](handleEntityNotFound(_0x1a2f1b,null))[_0x39a6('0x1d')](removeEntity(_0x1a2f1b,null))[_0x39a6('0x40')](handleError(_0x1a2f1b,null));}; \ No newline at end of file +var _0x5f56=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperAdditionalPhone','include','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','map','query','keys','filters'];(function(_0x176d14,_0x3984ea){var _0x89522c=function(_0x3aba48){while(--_0x3aba48){_0x176d14['push'](_0x176d14['shift']());}};_0x89522c(++_0x3984ea);}(_0x5f56,0x72));var _0x65f5=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0x5f56[_0xce93c];return _0x230720;};'use strict';var pdf=require(_0x65f5('0x0'));var emlformat=require(_0x65f5('0x1'));var rimraf=require(_0x65f5('0x2'));var zipdir=require(_0x65f5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x65f5('0x4'));var Mustache=require(_0x65f5('0x5'));var util=require(_0x65f5('0x6'));var path=require('path');var sox=require(_0x65f5('0x7'));var csv=require(_0x65f5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x65f5('0x9'));var squel=require(_0x65f5('0xa'));var crypto=require(_0x65f5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x65f5('0xc'));var toCsv=require(_0x65f5('0x8'));var querystring=require(_0x65f5('0xd'));var Papa=require(_0x65f5('0xe'));var Redis=require(_0x65f5('0xf'));var authService=require(_0x65f5('0x10'));var qs=require(_0x65f5('0x11'));var as=require(_0x65f5('0x12'));var hardwareService=require(_0x65f5('0x13'));var logger=require(_0x65f5('0x14'))(_0x65f5('0x15'));var utils=require(_0x65f5('0x16'));var config=require('../../config/environment');var db=require(_0x65f5('0x17'))['db'];function respondWithStatusCode(_0x1cb78d,_0x431252){_0x431252=_0x431252||0xcc;return function(_0x49fed6){if(_0x49fed6){return _0x1cb78d[_0x65f5('0x18')](_0x431252);}return _0x1cb78d[_0x65f5('0x19')](_0x431252)[_0x65f5('0x1a')]();};}function respondWithResult(_0x3e0df6,_0x553b92){_0x553b92=_0x553b92||0xc8;return function(_0x4af941){if(_0x4af941){return _0x3e0df6['status'](_0x553b92)[_0x65f5('0x1b')](_0x4af941);}};}function respondWithFilteredResult(_0x403ed4,_0x1f025c){return function(_0x3d7db3){if(_0x3d7db3){var _0x104924=_0x3d7db3[_0x65f5('0x1c')],_0x3d6471=_0x1f025c[_0x65f5('0x1d')],_0x5ab217=_0x1f025c['offset']+_0x1f025c[_0x65f5('0x1e')],_0x56b5f5;if(_0x5ab217>=_0x104924){_0x5ab217=_0x104924;_0x56b5f5=0xc8;}else{_0x56b5f5=0xce;}_0x403ed4['status'](_0x56b5f5);return _0x403ed4[_0x65f5('0x1f')](_0x65f5('0x20'),_0x3d6471+'-'+_0x5ab217+'/'+_0x104924)[_0x65f5('0x1b')](_0x3d7db3);}return null;};}function patchUpdates(_0x49c9d7){return function(_0x59c639){try{jsonpatch['apply'](_0x59c639,_0x49c9d7,!![]);}catch(_0x2d46d6){return BPromise[_0x65f5('0x21')](_0x2d46d6);}return _0x59c639[_0x65f5('0x22')]();};}function saveUpdates(_0x2fd546,_0x163755){return function(_0x1e4a2b){if(_0x1e4a2b){return _0x1e4a2b[_0x65f5('0x23')](_0x2fd546)[_0x65f5('0x24')](function(_0x9dceb6){return _0x9dceb6;});}return null;};}function removeEntity(_0x22dfd9,_0x39883b){return function(_0x145442){if(_0x145442){return _0x145442[_0x65f5('0x25')]()[_0x65f5('0x24')](function(){var _0xdfea50=_0x145442[_0x65f5('0x26')]({'plain':!![]});var _0x3f3237=_0x65f5('0x27');return db[_0x65f5('0x28')][_0x65f5('0x25')]({'where':{'type':_0x3f3237,'resourceId':_0xdfea50['id']}})[_0x65f5('0x24')](function(){return _0x145442;});})[_0x65f5('0x24')](function(){_0x22dfd9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d5cd8,_0x4a0953){return function(_0x58b4ea){if(!_0x58b4ea){_0x3d5cd8[_0x65f5('0x18')](0x194);}return _0x58b4ea;};}function handleError(_0x4b9ad6,_0x406f99){_0x406f99=_0x406f99||0x1f4;return function(_0x1974c2){logger['error'](_0x1974c2[_0x65f5('0x29')]);if(_0x1974c2['name']){delete _0x1974c2[_0x65f5('0x2a')];}_0x4b9ad6[_0x65f5('0x19')](_0x406f99)[_0x65f5('0x2b')](_0x1974c2);};}exports[_0x65f5('0x2c')]=function(_0x4a9ecf,_0x5100f5){var _0x46bb0d={},_0x6af0c6={},_0xf0ccd1={'count':0x0,'rows':[]};var _0x126fa6=_['map'](db['CmHopperAdditionalPhone'][_0x65f5('0x2d')],function(_0x414fea){return{'name':_0x414fea[_0x65f5('0x2e')],'type':_0x414fea['type'][_0x65f5('0x2f')]};});_0x6af0c6['model']=_[_0x65f5('0x30')](_0x126fa6,_0x65f5('0x2a'));_0x6af0c6[_0x65f5('0x31')]=_[_0x65f5('0x32')](_0x4a9ecf[_0x65f5('0x31')]);_0x6af0c6[_0x65f5('0x33')]=_[_0x65f5('0x34')](_0x6af0c6[_0x65f5('0x35')],_0x6af0c6[_0x65f5('0x31')]);_0x46bb0d[_0x65f5('0x36')]=_[_0x65f5('0x34')](_0x6af0c6['model'],qs[_0x65f5('0x37')](_0x4a9ecf[_0x65f5('0x31')][_0x65f5('0x37')]));_0x46bb0d[_0x65f5('0x36')]=_0x46bb0d['attributes'][_0x65f5('0x38')]?_0x46bb0d[_0x65f5('0x36')]:_0x6af0c6[_0x65f5('0x35')];if(!_0x4a9ecf[_0x65f5('0x31')][_0x65f5('0x39')](_0x65f5('0x3a'))){_0x46bb0d[_0x65f5('0x1e')]=qs['limit'](_0x4a9ecf[_0x65f5('0x31')][_0x65f5('0x1e')]);_0x46bb0d[_0x65f5('0x1d')]=qs[_0x65f5('0x1d')](_0x4a9ecf[_0x65f5('0x31')][_0x65f5('0x1d')]);}_0x46bb0d[_0x65f5('0x3b')]=qs[_0x65f5('0x3c')](_0x4a9ecf['query'][_0x65f5('0x3c')]);_0x46bb0d[_0x65f5('0x3d')]=qs['filters'](_[_0x65f5('0x3e')](_0x4a9ecf[_0x65f5('0x31')],_0x6af0c6[_0x65f5('0x33')]),_0x126fa6);if(_0x4a9ecf[_0x65f5('0x31')][_0x65f5('0x3f')]){_0x46bb0d[_0x65f5('0x3d')]=_[_0x65f5('0x40')](_0x46bb0d[_0x65f5('0x3d')],{'$or':_[_0x65f5('0x30')](_0x126fa6,function(_0x535910){if(_0x535910['type']!==_0x65f5('0x41')){var _0x38110f={};_0x38110f[_0x535910[_0x65f5('0x2a')]]={'$like':'%'+_0x4a9ecf['query']['filter']+'%'};return _0x38110f;}})});}_0x46bb0d=_[_0x65f5('0x40')]({},_0x46bb0d,_0x4a9ecf[_0x65f5('0x42')]);var _0x13df52={'where':_0x46bb0d[_0x65f5('0x3d')]};return db[_0x65f5('0x43')][_0x65f5('0x1c')](_0x13df52)['then'](function(_0x1e0ca6){_0xf0ccd1[_0x65f5('0x1c')]=_0x1e0ca6;if(_0x4a9ecf[_0x65f5('0x31')]['includeAll']){_0x46bb0d[_0x65f5('0x44')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone']['findAll'](_0x46bb0d);})[_0x65f5('0x24')](function(_0x16e46d){_0xf0ccd1['rows']=_0x16e46d;return _0xf0ccd1;})[_0x65f5('0x24')](respondWithFilteredResult(_0x5100f5,_0x46bb0d))[_0x65f5('0x45')](handleError(_0x5100f5,null));};exports[_0x65f5('0x46')]=function(_0x2a7000,_0x45748e){var _0x1e3f71={'raw':!![],'where':{'id':_0x2a7000[_0x65f5('0x47')]['id']}},_0x3c68dc={};_0x3c68dc['model']=_[_0x65f5('0x32')](db['CmHopperAdditionalPhone'][_0x65f5('0x2d')]);_0x3c68dc[_0x65f5('0x31')]=_[_0x65f5('0x32')](_0x2a7000[_0x65f5('0x31')]);_0x3c68dc['filters']=_['intersection'](_0x3c68dc[_0x65f5('0x35')],_0x3c68dc[_0x65f5('0x31')]);_0x1e3f71['attributes']=_[_0x65f5('0x34')](_0x3c68dc[_0x65f5('0x35')],qs[_0x65f5('0x37')](_0x2a7000[_0x65f5('0x31')]['fields']));_0x1e3f71[_0x65f5('0x36')]=_0x1e3f71[_0x65f5('0x36')]['length']?_0x1e3f71[_0x65f5('0x36')]:_0x3c68dc['model'];if(_0x2a7000[_0x65f5('0x31')][_0x65f5('0x48')]){_0x1e3f71['include']=[{'all':!![]}];}_0x1e3f71=_[_0x65f5('0x40')]({},_0x1e3f71,_0x2a7000[_0x65f5('0x42')]);return db[_0x65f5('0x43')][_0x65f5('0x49')](_0x1e3f71)['then'](handleEntityNotFound(_0x45748e,null))[_0x65f5('0x24')](respondWithResult(_0x45748e,null))[_0x65f5('0x45')](handleError(_0x45748e,null));};exports['create']=function(_0xc56727,_0x4756ca){return db[_0x65f5('0x43')][_0x65f5('0x4a')](_0xc56727[_0x65f5('0x4b')],{})['then'](function(_0x493b0c){var _0x30dcce=_0xc56727[_0x65f5('0x4c')][_0x65f5('0x26')]({'plain':!![]});if(!_0x30dcce)throw new Error(_0x65f5('0x4d'));if(_0x30dcce[_0x65f5('0x4e')]===_0x65f5('0x4c')){var _0x30e1f8=_0x493b0c[_0x65f5('0x26')]({'plain':!![]});var _0x15c9f1=_0x65f5('0x27');return db['UserProfileSection'][_0x65f5('0x49')]({'where':{'name':_0x15c9f1,'userProfileId':_0x30dcce[_0x65f5('0x4f')]},'raw':!![]})['then'](function(_0x2f0c68){if(_0x2f0c68&&_0x2f0c68[_0x65f5('0x50')]===0x0){return db['UserProfileResource'][_0x65f5('0x4a')]({'name':_0x30e1f8['name'],'resourceId':_0x30e1f8['id'],'type':_0x2f0c68['name'],'sectionId':_0x2f0c68['id']},{})[_0x65f5('0x24')](function(){return _0x493b0c;});}else{return _0x493b0c;}})[_0x65f5('0x45')](function(_0x5c717b){logger[_0x65f5('0x51')](_0x65f5('0x52'),_0x5c717b);throw _0x5c717b;});}return _0x493b0c;})[_0x65f5('0x24')](respondWithResult(_0x4756ca,0xc9))[_0x65f5('0x45')](handleError(_0x4756ca,null));};exports[_0x65f5('0x23')]=function(_0x444dfc,_0x2ba3b6){if(_0x444dfc[_0x65f5('0x4b')]['id']){delete _0x444dfc['body']['id'];}return db[_0x65f5('0x43')][_0x65f5('0x49')]({'where':{'id':_0x444dfc[_0x65f5('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ba3b6,null))[_0x65f5('0x24')](saveUpdates(_0x444dfc['body'],null))[_0x65f5('0x24')](respondWithResult(_0x2ba3b6,null))[_0x65f5('0x45')](handleError(_0x2ba3b6,null));};exports[_0x65f5('0x25')]=function(_0x293692,_0xe089d9){return db[_0x65f5('0x43')][_0x65f5('0x49')]({'where':{'id':_0x293692[_0x65f5('0x47')]['id']}})[_0x65f5('0x24')](handleEntityNotFound(_0xe089d9,null))[_0x65f5('0x24')](removeEntity(_0xe089d9,null))[_0x65f5('0x45')](handleError(_0xe089d9,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 804ab60..9c829eb 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 _0xd20c=['define','cm_hopper_additional_phones','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5443f5,_0x4b6f74){var _0x20ab9a=function(_0x102db2){while(--_0x102db2){_0x5443f5['push'](_0x5443f5['shift']());}};_0x20ab9a(++_0x4b6f74);}(_0xd20c,0x6e));var _0xcd20=function(_0x4dea3a,_0x3af6a1){_0x4dea3a=_0x4dea3a-0x0;var _0x3a9a38=_0xd20c[_0x4dea3a];return _0x3a9a38;};'use strict';var _=require('lodash');var util=require(_0xcd20('0x0'));var logger=require(_0xcd20('0x1'))(_0xcd20('0x2'));var moment=require(_0xcd20('0x3'));var BPromise=require(_0xcd20('0x4'));var rp=require(_0xcd20('0x5'));var fs=require('fs');var path=require(_0xcd20('0x6'));var rimraf=require(_0xcd20('0x7'));var config=require(_0xcd20('0x8'));var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0xcd20('0x9')]=function(_0x9109cf,_0x12c8f2){return _0x9109cf[_0xcd20('0xa')]('CmHopperAdditionalPhone',attributes,{'tableName':_0xcd20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9326=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x5bda42,_0x3c45e3){var _0x27b619=function(_0x46e4c0){while(--_0x46e4c0){_0x5bda42['push'](_0x5bda42['shift']());}};_0x27b619(++_0x3c45e3);}(_0x9326,0x1c3));var _0x6932=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x9326[_0x5bfa44];return _0x43815f;};'use strict';var _=require(_0x6932('0x0'));var util=require(_0x6932('0x1'));var logger=require(_0x6932('0x2'))(_0x6932('0x3'));var moment=require(_0x6932('0x4'));var BPromise=require(_0x6932('0x5'));var rp=require(_0x6932('0x6'));var fs=require('fs');var path=require(_0x6932('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperAdditionalPhone.attributes');module[_0x6932('0x8')]=function(_0x48f300,_0x2730ce){return _0x48f300['define'](_0x6932('0x9'),attributes,{'tableName':_0x6932('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 2b8987d..16f197f 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 _0x3be5=['ListId','VoiceQueueId','duration','waitTime','add','scheduledat','minutes','phone','createdAt','isNil','updatedAt','hopperToAdd','additionalToHop','sequelize','transaction','IncrementPreviewCounters','update','field','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','request\x20sent','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch','VerifyAdditionalPhones','CmHopper','findOne','ContactId','body','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','SwapAdditionalPhones'];(function(_0x39a2bc,_0x224882){var _0x451ffd=function(_0x204e02){while(--_0x204e02){_0x39a2bc['push'](_0x39a2bc['shift']());}};_0x451ffd(++_0x224882);}(_0x3be5,0x82));var _0x53be=function(_0x59f9ca,_0x1d7999){_0x59f9ca=_0x59f9ca-0x0;var _0x5c271c=_0x3be5[_0x59f9ca];return _0x5c271c;};'use strict';var _=require(_0x53be('0x0'));var util=require(_0x53be('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x53be('0x2'));var fs=require('fs');var Redis=require(_0x53be('0x3'));var db=require(_0x53be('0x4'))['db'];var utils=require(_0x53be('0x5'));var logger=require(_0x53be('0x6'))('rpc');var config=require(_0x53be('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x53be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa8834f,_0xc13c52,_0x4639b9){return new BPromise(function(_0x938d55,_0x2435bb){return client[_0x53be('0x9')](_0xa8834f,_0x4639b9)[_0x53be('0xa')](function(_0x32e667){logger[_0x53be('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0xc13c52,'request\x20sent');logger['debug']('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0xc13c52,_0x53be('0xc'),JSON['stringify'](_0x32e667));if(_0x32e667[_0x53be('0xd')]){if(_0x32e667[_0x53be('0xd')]['code']===0x1f4){logger[_0x53be('0xd')](_0x53be('0xe'),_0xc13c52,_0x32e667[_0x53be('0xd')][_0x53be('0xf')]);return _0x2435bb(_0x32e667[_0x53be('0xd')][_0x53be('0xf')]);}logger['error'](_0x53be('0xe'),_0xc13c52,_0x32e667['error'][_0x53be('0xf')]);return _0x938d55(_0x32e667[_0x53be('0xd')][_0x53be('0xf')]);}else{logger[_0x53be('0xb')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0xc13c52,_0x53be('0xc'));_0x938d55(_0x32e667[_0x53be('0x10')][_0x53be('0xf')]);}})[_0x53be('0x11')](function(_0x2ae76c){logger[_0x53be('0xd')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0xc13c52,_0x2ae76c);_0x2435bb(_0x2ae76c);});});}exports[_0x53be('0x12')]=function(_0x4c95f0){var _0x54518c=this;return new Promise(function(_0x31a72b,_0x217e07){return db[_0x53be('0x13')][_0x53be('0x14')]({'raw':!![],'where':{'ContactId':_0x4c95f0['body'][_0x53be('0x15')],'ListId':_0x4c95f0[_0x53be('0x16')]['ListId'],'VoiceQueueId':_0x4c95f0[_0x53be('0x16')]['VoiceQueueId']===undefined?null:_0x4c95f0[_0x53be('0x16')]['VoiceQueueId'],'CampaignId':_0x4c95f0[_0x53be('0x16')]['CampaignId']===undefined?null:_0x4c95f0[_0x53be('0x16')][_0x53be('0x17')]}})[_0x53be('0xa')](function(_0x1f20df){if(_0x1f20df!=null){return db[_0x53be('0x18')][_0x53be('0x14')]({'raw':!![],'where':{'CmHopperId':_0x1f20df['id'],'OrderBy':{'$gt':_0x1f20df[_0x53be('0x19')]}},'order':[[_0x53be('0x19'),_0x53be('0x1a')]]})[_0x53be('0xa')](function(_0x3e784d){var _0x3d82a8=0x0;if(_0x3e784d){if(_0x3e784d[_0x53be('0x1b')]+_0x3e784d[_0x53be('0x1c')]+_0x3e784d[_0x53be('0x1d')]+_0x3e784d[_0x53be('0x1e')]+_0x3e784d[_0x53be('0x1f')]+_0x3e784d[_0x53be('0x20')]+_0x3e784d[_0x53be('0x21')]+_0x3e784d[_0x53be('0x22')]<_0x4c95f0[_0x53be('0x23')][_0x53be('0x24')])_0x3d82a8=0x1;_0x31a72b({'additional':_0x3d82a8});}else{return db[_0x53be('0x18')][_0x53be('0x14')]({'raw':!![],'where':{'CmHopperId':_0x1f20df['id']},'order':[[_0x53be('0x19'),'ASC']]})[_0x53be('0xa')](function(_0x1363cf){var _0x356b94=0x0;if(_0x1363cf){if(_0x1363cf[_0x53be('0x1b')]+_0x1363cf[_0x53be('0x1c')]+_0x1363cf[_0x53be('0x1d')]+_0x1363cf[_0x53be('0x1e')]+_0x1363cf['countdropretry']+_0x1363cf[_0x53be('0x20')]+_0x1363cf[_0x53be('0x21')]+_0x1363cf[_0x53be('0x22')]<_0x4c95f0[_0x53be('0x23')]['dialGlobalMaxRetry'])_0x356b94=0x1;_0x31a72b({'additional':_0x356b94});}else{_0x31a72b({'additional':0x0});}})[_0x53be('0x11')](function(_0x36de3e){logger[_0x53be('0xd')]('VerifyAdditionalPhones',_0x36de3e[_0x53be('0xf')],_0x4c95f0);_0x217e07(_0x54518c['error'](0x1f4,_0x36de3e[_0x53be('0xf')]));});}})['catch'](function(_0x7c38c8){logger[_0x53be('0xd')](_0x53be('0x12'),_0x7c38c8[_0x53be('0xf')],_0x4c95f0);_0x217e07(_0x54518c[_0x53be('0xd')](0x1f4,_0x7c38c8[_0x53be('0xf')]));});}else _0x31a72b({'additional':0x0});});});};exports[_0x53be('0x25')]=function(_0x484ad7){var _0x7bece4=this;return new Promise(function(_0x3c5156,_0x42098e){return db[_0x53be('0x13')][_0x53be('0x14')]({'raw':!![],'where':{'ContactId':_0x484ad7[_0x53be('0x16')]['ContactId'],'ListId':_0x484ad7['body'][_0x53be('0x26')],'VoiceQueueId':_0x484ad7[_0x53be('0x16')][_0x53be('0x27')]===undefined?null:_0x484ad7[_0x53be('0x16')][_0x53be('0x27')],'CampaignId':_0x484ad7['body'][_0x53be('0x17')]===undefined?null:_0x484ad7[_0x53be('0x16')][_0x53be('0x17')]}})[_0x53be('0xa')](function(_0x31f84e){if(_0x31f84e!=null){return db[_0x53be('0x18')][_0x53be('0x14')]({'raw':!![],'where':{'CmHopperId':_0x31f84e['id'],'OrderBy':{'$gt':_0x31f84e[_0x53be('0x19')]}},'order':[[_0x53be('0x19'),_0x53be('0x1a')]]})['then'](function(_0x93405c){if(_0x93405c)return activateAdditionalPhone(_0x31f84e,_0x484ad7['body'],_0x93405c,_0x484ad7['duration'],_0x484ad7['waitTime'])[_0x53be('0xa')](function(_0x4412af){_0x3c5156(_0x4412af);});else{return db['CmHopperAdditionalPhone'][_0x53be('0x14')]({'raw':!![],'where':{'CmHopperId':_0x31f84e['id']},'order':[[_0x53be('0x19'),_0x53be('0x1a')]]})['then'](function(_0xfbc4bc){if(_0xfbc4bc)return activateAdditionalPhone(_0x31f84e,_0x484ad7[_0x53be('0x16')],_0xfbc4bc,_0x484ad7[_0x53be('0x28')],_0x484ad7[_0x53be('0x29')])[_0x53be('0xa')](function(_0x1d17e0){_0x3c5156(_0x1d17e0);});else{_0x3c5156({'id':_0x31f84e['id'],'phone':''});}})[_0x53be('0x11')](function(_0x5d6104){logger[_0x53be('0xd')](_0x53be('0x12'),_0x5d6104[_0x53be('0xf')],_0x484ad7);_0x42098e(_0x7bece4[_0x53be('0xd')](0x1f4,_0x5d6104[_0x53be('0xf')]));});}})[_0x53be('0x11')](function(_0x378db3){logger[_0x53be('0xd')](_0x53be('0x12'),_0x378db3[_0x53be('0xf')],_0x484ad7);_0x42098e(_0x7bece4[_0x53be('0xd')](0x1f4,_0x378db3[_0x53be('0xf')]));});}else _0x3c5156(0x1);});});};function activateAdditionalPhone(_0x3430c1,_0xd41b9f,_0x111231,_0x53885b,_0x1b2d6c){return new Promise(function(_0x53b339,_0x32837a){logger['info'](_0x53be('0x12'),_0x111231);var _0x26db2a;if(moment()>moment(_0x111231['scheduledat'])){_0x26db2a=moment()[_0x53be('0x2a')](_0x1b2d6c||0x3,'minutes');}else{if(_0x111231[_0x53be('0x19')]==0x0){_0x26db2a=moment(_0x111231[_0x53be('0x2b')]);}else{_0x26db2a=moment()['add'](_0x1b2d6c||0x3,_0x53be('0x2c'));}}var _0x5d0ec8={'phone':_0x3430c1[_0x53be('0x2d')],'active':0x0,'OrderBy':_['isNil'](_0x3430c1[_0x53be('0x19')])?0x0:_0x3430c1[_0x53be('0x19')],'scheduledat':moment()[_0x53be('0x2a')](_0x53885b||0x1,_0x53be('0x2c')),'countbusyretry':_0xd41b9f['countbusyretry'],'countcongestionretry':_0xd41b9f[_0x53be('0x1c')],'countnoanswerretry':_0xd41b9f[_0x53be('0x1d')],'countnosuchnumberretry':_0xd41b9f[_0x53be('0x1e')],'countdropretry':_0xd41b9f[_0x53be('0x1f')],'countabandonedretry':_0xd41b9f[_0x53be('0x20')],'countmachineretry':_0xd41b9f[_0x53be('0x21')],'countagentrejectretry':_0xd41b9f[_0x53be('0x22')],'createdAt':_0xd41b9f[_0x53be('0x2e')],'updatedAt':_0xd41b9f['updatedAt']};var _0x53850c={'CmHopperId':_0x3430c1['id'],'phone':_0x111231[_0x53be('0x2d')],'active':0x0,'OrderBy':_[_0x53be('0x2f')](_0x111231[_0x53be('0x19')])?0x0:_0x111231[_0x53be('0x19')],'scheduledat':_0x26db2a,'countbusyretry':_0x111231['countbusyretry'],'countcongestionretry':_0x111231[_0x53be('0x1c')],'countnoanswerretry':_0x111231[_0x53be('0x1d')],'countnosuchnumberretry':_0xd41b9f[_0x53be('0x1e')],'countdropretry':_0xd41b9f[_0x53be('0x1f')],'countabandonedretry':_0xd41b9f[_0x53be('0x20')],'countmachineretry':_0xd41b9f[_0x53be('0x21')],'countagentrejectretry':_0xd41b9f[_0x53be('0x22')],'createdAt':_0x111231[_0x53be('0x2e')],'updatedAt':_0x111231[_0x53be('0x30')]};logger[_0x53be('0xb')](_0x53be('0x31'),_0x5d0ec8);logger[_0x53be('0xb')](_0x53be('0x32'),_0x53850c);return db[_0x53be('0x33')][_0x53be('0x34')](function(_0x5914bb){return db[_0x53be('0x18')]['update'](_0x5d0ec8,{'where':{'id':_0x111231['id']}},{'transaction':_0x5914bb})[_0x53be('0xa')](function(){return db[_0x53be('0x13')]['update'](_0x53850c,{'where':{'id':_0x3430c1['id']}},{'transaction':_0x5914bb});});})[_0x53be('0xa')](function(_0x3106f8){_0x53b339({'id':_0x3430c1['id'],'phone':_0x111231['phone']});})['catch'](function(_0x3d03f9){logger['error']('VerifyAdditionalPhones',_0x3d03f9[_0x53be('0xf')],req);_0x32837a(_this[_0x53be('0xd')](0x1f4,_0x3d03f9[_0x53be('0xf')]));});});}exports[_0x53be('0x35')]=function(_0x3298d0){var _0x1d824e=this;return new Promise(function(_0x5f4ba0,_0x4bb2b9){return db[_0x53be('0x13')][_0x53be('0x36')](_0x3298d0['body'][_0x53be('0x37')],{'where':{'id':_0x3298d0[_0x53be('0x16')]['id']}})['then'](function(_0x4a78e5){_0x5f4ba0(_0x4a78e5);})[_0x53be('0x11')](function(_0x4ae480){logger[_0x53be('0xd')](_0x53be('0x35'),_0x4ae480['message'],_0x3298d0);_0x4bb2b9(_0x1d824e[_0x53be('0xd')](0x1f4,_0x4ae480[_0x53be('0xf')]));});});}; \ No newline at end of file +var _0x8a87=['CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','entity','dialGlobalMaxRetry','ASC','countnoanswerretry','countmachineretry','SwapAdditionalPhones','duration','waitTime','VerifyAdditionalPhones','scheduledat','minutes','phone','isNil','createdAt','hopperToAdd','sequelize','transaction','update','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','CmHopperAdditionalPhone,\x20%s,\x20%s','message','result','catch'];(function(_0x10e633,_0x30e941){var _0x5dc12f=function(_0x386668){while(--_0x386668){_0x10e633['push'](_0x10e633['shift']());}};_0x5dc12f(++_0x30e941);}(_0x8a87,0x1b9));var _0x78a8=function(_0x4d579b,_0x2327f3){_0x4d579b=_0x4d579b-0x0;var _0x288145=_0x8a87[_0x4d579b];return _0x288145;};'use strict';var _=require(_0x78a8('0x0'));var util=require(_0x78a8('0x1'));var moment=require(_0x78a8('0x2'));var BPromise=require(_0x78a8('0x3'));var rs=require(_0x78a8('0x4'));var fs=require('fs');var Redis=require(_0x78a8('0x5'));var db=require(_0x78a8('0x6'))['db'];var utils=require(_0x78a8('0x7'));var logger=require('../../config/logger')(_0x78a8('0x8'));var config=require(_0x78a8('0x9'));var jayson=require(_0x78a8('0xa'));var client=jayson[_0x78a8('0xb')][_0x78a8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x127f7b,_0x18f300,_0x19b5c6){return new BPromise(function(_0x5e47a4,_0x3741eb){return client['request'](_0x127f7b,_0x19b5c6)[_0x78a8('0xd')](function(_0x354b39){logger[_0x78a8('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x18f300,_0x78a8('0xf'));logger[_0x78a8('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x18f300,'request\x20sent',JSON[_0x78a8('0x11')](_0x354b39));if(_0x354b39[_0x78a8('0x12')]){if(_0x354b39[_0x78a8('0x12')]['code']===0x1f4){logger[_0x78a8('0x12')](_0x78a8('0x13'),_0x18f300,_0x354b39[_0x78a8('0x12')]['message']);return _0x3741eb(_0x354b39[_0x78a8('0x12')][_0x78a8('0x14')]);}logger['error'](_0x78a8('0x13'),_0x18f300,_0x354b39[_0x78a8('0x12')][_0x78a8('0x14')]);return _0x5e47a4(_0x354b39['error'][_0x78a8('0x14')]);}else{logger[_0x78a8('0xe')](_0x78a8('0x13'),_0x18f300,_0x78a8('0xf'));_0x5e47a4(_0x354b39[_0x78a8('0x15')][_0x78a8('0x14')]);}})[_0x78a8('0x16')](function(_0x320751){logger[_0x78a8('0x12')](_0x78a8('0x13'),_0x18f300,_0x320751);_0x3741eb(_0x320751);});});}exports['VerifyAdditionalPhones']=function(_0x15014c){var _0x5835ed=this;return new Promise(function(_0x4cc231,_0x27b4a3){return db[_0x78a8('0x17')][_0x78a8('0x18')]({'raw':!![],'where':{'ContactId':_0x15014c[_0x78a8('0x19')][_0x78a8('0x1a')],'ListId':_0x15014c[_0x78a8('0x19')][_0x78a8('0x1b')],'VoiceQueueId':_0x15014c[_0x78a8('0x19')][_0x78a8('0x1c')]===undefined?null:_0x15014c['body'][_0x78a8('0x1c')],'CampaignId':_0x15014c[_0x78a8('0x19')][_0x78a8('0x1d')]===undefined?null:_0x15014c[_0x78a8('0x19')][_0x78a8('0x1d')]}})['then'](function(_0x2fbb1a){if(_0x2fbb1a!=null){return db[_0x78a8('0x1e')][_0x78a8('0x18')]({'raw':!![],'where':{'CmHopperId':_0x2fbb1a['id'],'OrderBy':{'$gt':_0x2fbb1a[_0x78a8('0x1f')]}},'order':[[_0x78a8('0x1f'),'ASC']]})[_0x78a8('0xd')](function(_0x59c823){var _0x331298=0x0;if(_0x59c823){if(_0x59c823[_0x78a8('0x20')]+_0x59c823[_0x78a8('0x21')]+_0x59c823['countnoanswerretry']+_0x59c823[_0x78a8('0x22')]+_0x59c823[_0x78a8('0x23')]+_0x59c823[_0x78a8('0x24')]+_0x59c823['countmachineretry']+_0x59c823[_0x78a8('0x25')]<_0x15014c[_0x78a8('0x26')][_0x78a8('0x27')])_0x331298=0x1;_0x4cc231({'additional':_0x331298});}else{return db[_0x78a8('0x1e')][_0x78a8('0x18')]({'raw':!![],'where':{'CmHopperId':_0x2fbb1a['id']},'order':[[_0x78a8('0x1f'),_0x78a8('0x28')]]})[_0x78a8('0xd')](function(_0x49280c){var _0x41f698=0x0;if(_0x49280c){if(_0x49280c[_0x78a8('0x20')]+_0x49280c['countcongestionretry']+_0x49280c[_0x78a8('0x29')]+_0x49280c[_0x78a8('0x22')]+_0x49280c[_0x78a8('0x23')]+_0x49280c[_0x78a8('0x24')]+_0x49280c[_0x78a8('0x2a')]+_0x49280c[_0x78a8('0x25')]<_0x15014c[_0x78a8('0x26')][_0x78a8('0x27')])_0x41f698=0x1;_0x4cc231({'additional':_0x41f698});}else{_0x4cc231({'additional':0x0});}})[_0x78a8('0x16')](function(_0x53b893){logger[_0x78a8('0x12')]('VerifyAdditionalPhones',_0x53b893[_0x78a8('0x14')],_0x15014c);_0x27b4a3(_0x5835ed[_0x78a8('0x12')](0x1f4,_0x53b893['message']));});}})[_0x78a8('0x16')](function(_0x58bebe){logger[_0x78a8('0x12')]('VerifyAdditionalPhones',_0x58bebe[_0x78a8('0x14')],_0x15014c);_0x27b4a3(_0x5835ed['error'](0x1f4,_0x58bebe[_0x78a8('0x14')]));});}else _0x4cc231({'additional':0x0});});});};exports[_0x78a8('0x2b')]=function(_0x41a14f){var _0x800442=this;return new Promise(function(_0x406d18,_0x4fa54b){return db[_0x78a8('0x17')][_0x78a8('0x18')]({'raw':!![],'where':{'ContactId':_0x41a14f['body'][_0x78a8('0x1a')],'ListId':_0x41a14f[_0x78a8('0x19')]['ListId'],'VoiceQueueId':_0x41a14f[_0x78a8('0x19')]['VoiceQueueId']===undefined?null:_0x41a14f[_0x78a8('0x19')]['VoiceQueueId'],'CampaignId':_0x41a14f[_0x78a8('0x19')][_0x78a8('0x1d')]===undefined?null:_0x41a14f[_0x78a8('0x19')][_0x78a8('0x1d')]}})[_0x78a8('0xd')](function(_0x2924dc){if(_0x2924dc!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x2924dc['id'],'OrderBy':{'$gt':_0x2924dc['OrderBy']}},'order':[[_0x78a8('0x1f'),_0x78a8('0x28')]]})[_0x78a8('0xd')](function(_0x5af01e){if(_0x5af01e)return activateAdditionalPhone(_0x2924dc,_0x41a14f[_0x78a8('0x19')],_0x5af01e,_0x41a14f[_0x78a8('0x2c')],_0x41a14f[_0x78a8('0x2d')])['then'](function(_0x687c7a){_0x406d18(_0x687c7a);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x2924dc['id']},'order':[['OrderBy','ASC']]})[_0x78a8('0xd')](function(_0x31d4a2){if(_0x31d4a2)return activateAdditionalPhone(_0x2924dc,_0x41a14f[_0x78a8('0x19')],_0x31d4a2,_0x41a14f[_0x78a8('0x2c')],_0x41a14f['waitTime'])[_0x78a8('0xd')](function(_0x55d118){_0x406d18(_0x55d118);});else{_0x406d18({'id':_0x2924dc['id'],'phone':''});}})[_0x78a8('0x16')](function(_0x32eefd){logger['error'](_0x78a8('0x2e'),_0x32eefd[_0x78a8('0x14')],_0x41a14f);_0x4fa54b(_0x800442[_0x78a8('0x12')](0x1f4,_0x32eefd[_0x78a8('0x14')]));});}})[_0x78a8('0x16')](function(_0x1e65e5){logger[_0x78a8('0x12')](_0x78a8('0x2e'),_0x1e65e5[_0x78a8('0x14')],_0x41a14f);_0x4fa54b(_0x800442[_0x78a8('0x12')](0x1f4,_0x1e65e5['message']));});}else _0x406d18(0x1);});});};function activateAdditionalPhone(_0xbabe56,_0x3681da,_0x3b9225,_0x4d3809,_0x27d613){return new Promise(function(_0x31a36a,_0x54f262){logger[_0x78a8('0xe')](_0x78a8('0x2e'),_0x3b9225);var _0x99be72;if(moment()>moment(_0x3b9225[_0x78a8('0x2f')])){_0x99be72=moment()['add'](_0x27d613||0x3,'minutes');}else{if(_0x3b9225[_0x78a8('0x1f')]==0x0){_0x99be72=moment(_0x3b9225[_0x78a8('0x2f')]);}else{_0x99be72=moment()['add'](_0x27d613||0x3,_0x78a8('0x30'));}}var _0x3e5721={'phone':_0xbabe56[_0x78a8('0x31')],'active':0x0,'OrderBy':_[_0x78a8('0x32')](_0xbabe56['OrderBy'])?0x0:_0xbabe56['OrderBy'],'scheduledat':moment()['add'](_0x4d3809||0x1,_0x78a8('0x30')),'countbusyretry':_0x3681da[_0x78a8('0x20')],'countcongestionretry':_0x3681da[_0x78a8('0x21')],'countnoanswerretry':_0x3681da[_0x78a8('0x29')],'countnosuchnumberretry':_0x3681da['countnosuchnumberretry'],'countdropretry':_0x3681da[_0x78a8('0x23')],'countabandonedretry':_0x3681da['countabandonedretry'],'countmachineretry':_0x3681da[_0x78a8('0x2a')],'countagentrejectretry':_0x3681da[_0x78a8('0x25')],'createdAt':_0x3681da[_0x78a8('0x33')],'updatedAt':_0x3681da['updatedAt']};var _0x5a2722={'CmHopperId':_0xbabe56['id'],'phone':_0x3b9225[_0x78a8('0x31')],'active':0x0,'OrderBy':_[_0x78a8('0x32')](_0x3b9225['OrderBy'])?0x0:_0x3b9225[_0x78a8('0x1f')],'scheduledat':_0x99be72,'countbusyretry':_0x3b9225[_0x78a8('0x20')],'countcongestionretry':_0x3b9225[_0x78a8('0x21')],'countnoanswerretry':_0x3b9225['countnoanswerretry'],'countnosuchnumberretry':_0x3681da[_0x78a8('0x22')],'countdropretry':_0x3681da['countdropretry'],'countabandonedretry':_0x3681da[_0x78a8('0x24')],'countmachineretry':_0x3681da['countmachineretry'],'countagentrejectretry':_0x3681da['countagentrejectretry'],'createdAt':_0x3b9225[_0x78a8('0x33')],'updatedAt':_0x3b9225['updatedAt']};logger['info'](_0x78a8('0x34'),_0x3e5721);logger[_0x78a8('0xe')]('additionalToHop',_0x5a2722);return db[_0x78a8('0x35')][_0x78a8('0x36')](function(_0x471c6f){return db[_0x78a8('0x1e')][_0x78a8('0x37')](_0x3e5721,{'where':{'id':_0x3b9225['id']}},{'transaction':_0x471c6f})[_0x78a8('0xd')](function(){return db[_0x78a8('0x17')][_0x78a8('0x37')](_0x5a2722,{'where':{'id':_0xbabe56['id']}},{'transaction':_0x471c6f});});})['then'](function(_0x4cae2d){_0x31a36a({'id':_0xbabe56['id'],'phone':_0x3b9225[_0x78a8('0x31')]});})[_0x78a8('0x16')](function(_0x20cbf0){logger[_0x78a8('0x12')](_0x78a8('0x2e'),_0x20cbf0[_0x78a8('0x14')],req);_0x54f262(_this[_0x78a8('0x12')](0x1f4,_0x20cbf0[_0x78a8('0x14')]));});});}exports[_0x78a8('0x38')]=function(_0xc9f16b){var _0x1f7543=this;return new Promise(function(_0x4b304e,_0x5dca35){return db[_0x78a8('0x17')]['update'](_0xc9f16b['body'][_0x78a8('0x39')],{'where':{'id':_0xc9f16b[_0x78a8('0x19')]['id']}})[_0x78a8('0xd')](function(_0x27b8ca){_0x4b304e(_0x27b8ca);})[_0x78a8('0x16')](function(_0x4da187){logger[_0x78a8('0x12')]('IncrementPreviewCounters',_0x4da187[_0x78a8('0x14')],_0xc9f16b);_0x5dca35(_0x1f7543['error'](0x1f4,_0x4da187[_0x78a8('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index 1a1e11b..10607c2 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 _0x6e43=['isAuthenticated','/:id','create','put','update','exports','multer','util','express','Router','../../components/auth/service','./cmHopperAdditionalPhone.controller','get'];(function(_0x130914,_0x7d255d){var _0x25e97f=function(_0x1892cc){while(--_0x1892cc){_0x130914['push'](_0x130914['shift']());}};_0x25e97f(++_0x7d255d);}(_0x6e43,0x172));var _0x36e4=function(_0xf0b890,_0x533f8a){_0xf0b890=_0xf0b890-0x0;var _0x13422b=_0x6e43[_0xf0b890];return _0x13422b;};'use strict';var multer=require(_0x36e4('0x0'));var util=require(_0x36e4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x36e4('0x2'));var router=express[_0x36e4('0x3')]();var auth=require(_0x36e4('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x36e4('0x5'));router[_0x36e4('0x6')]('/',auth[_0x36e4('0x7')](),controller['index']);router['get'](_0x36e4('0x8'),auth[_0x36e4('0x7')](),controller['show']);router['post']('/',auth[_0x36e4('0x7')](),controller[_0x36e4('0x9')]);router[_0x36e4('0xa')](_0x36e4('0x8'),auth[_0x36e4('0x7')](),controller[_0x36e4('0xb')]);router['delete'](_0x36e4('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x36e4('0xc')]=router; \ No newline at end of file +var _0xad3e=['index','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated'];(function(_0x2daf7b,_0x310791){var _0x4a1f8c=function(_0x1cb2f8){while(--_0x1cb2f8){_0x2daf7b['push'](_0x2daf7b['shift']());}};_0x4a1f8c(++_0x310791);}(_0xad3e,0xa9));var _0xead3=function(_0x1281f1,_0x2a3652){_0x1281f1=_0x1281f1-0x0;var _0x12091c=_0xad3e[_0x1281f1];return _0x12091c;};'use strict';var multer=require(_0xead3('0x0'));var util=require(_0xead3('0x1'));var path=require(_0xead3('0x2'));var timeout=require(_0xead3('0x3'));var express=require(_0xead3('0x4'));var router=express[_0xead3('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xead3('0x6'));var config=require(_0xead3('0x7'));var controller=require(_0xead3('0x8'));router[_0xead3('0x9')]('/',auth[_0xead3('0xa')](),controller[_0xead3('0xb')]);router[_0xead3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xead3('0xc')]);router[_0xead3('0xd')]('/',auth['isAuthenticated'](),controller[_0xead3('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xead3('0xf')]);router['delete']('/:id',auth[_0xead3('0xa')](),controller[_0xead3('0x10')]);module[_0xead3('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 66c7990..f483d16 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 _0x1316=['STRING','INTEGER','contactListQueue','moment','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1316,0x1a2));var _0x6131=function(_0x632bc2,_0x119815){_0x632bc2=_0x632bc2-0x0;var _0x441453=_0x1316[_0x632bc2];return _0x441453;};'use strict';var moment=require(_0x6131('0x0'));var Sequelize=require('sequelize');module[_0x6131('0x1')]={'phone':{'type':Sequelize[_0x6131('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6131('0x3')],'unique':_0x6131('0x4')},'ListId':{'type':Sequelize[_0x6131('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x6131('0x3')],'unique':_0x6131('0x4')}}; \ No newline at end of file +var _0x5501=['INTEGER','contactListQueue','sequelize','STRING'];(function(_0x3aff46,_0x18d208){var _0x33936c=function(_0x3319be){while(--_0x3319be){_0x3aff46['push'](_0x3aff46['shift']());}};_0x33936c(++_0x18d208);}(_0x5501,0x1a2));var _0x1550=function(_0x49a241,_0x6ac43c){_0x49a241=_0x49a241-0x0;var _0x437621=_0x5501[_0x49a241];return _0x437621;};'use strict';var moment=require('moment');var Sequelize=require(_0x1550('0x0'));module['exports']={'phone':{'type':Sequelize[_0x1550('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x1550('0x2')],'unique':_0x1550('0x3')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x1550('0x2')],'unique':_0x1550('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index b0ea7eb..f07c52c 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 _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x1fe927,_0x2aa298){var _0x445b65=function(_0x229e7e){while(--_0x229e7e){_0x1fe927['push'](_0x1fe927['shift']());}};_0x445b65(++_0x2aa298);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));}; \ No newline at end of file +var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','body','find','describe','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x3a965f,_0x1d5af4){var _0x630513=function(_0x4bd84){while(--_0x4bd84){_0x3a965f['push'](_0x3a965f['shift']());}};_0x630513(++_0x1d5af4);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x1e')]=function(_0x2e8caf,_0xbe9d19){if(_0x2e8caf[_0x0a9e('0x42')]['id']){delete _0x2e8caf[_0x0a9e('0x42')]['id'];}return db['CmHopperBlack'][_0x0a9e('0x43')]({'where':{'id':_0x2e8caf['params']['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0xbe9d19,null))[_0x0a9e('0x1f')](saveUpdates(_0x2e8caf[_0x0a9e('0x42')],null))['then'](respondWithResult(_0xbe9d19,null))[_0x0a9e('0x3f')](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x20')]=function(_0x4774f4,_0x34aa5a){return db[_0x0a9e('0x27')][_0x0a9e('0x43')]({'where':{'id':_0x4774f4[_0x0a9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x34aa5a,null))[_0x0a9e('0x1f')](removeEntity(_0x34aa5a,null))[_0x0a9e('0x3f')](handleError(_0x34aa5a,null));};exports[_0x0a9e('0x44')]=function(_0x16f976,_0x409789){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]()[_0x0a9e('0x1f')](respondWithResult(_0x409789,null))[_0x0a9e('0x3f')](handleError(_0x409789,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 2ff3181..4813540 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 _0xa9e0=['../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x52766b,_0x201507){var _0x241f72=function(_0x1957ed){while(--_0x1957ed){_0x52766b['push'](_0x52766b['shift']());}};_0x241f72(++_0x201507);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./cmHopperBlack.attributes','exports','define','cm_hopper_black','../../config/logger','api','moment','bluebird','path'];(function(_0x442e21,_0x35005f){var _0x207895=function(_0x226369){while(--_0x226369){_0x442e21['push'](_0x442e21['shift']());}};_0x207895(++_0x35005f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0xcb91[_0x1793de];return _0x4f0309;};'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')]('CmHopperBlack',attributes,{'tableName':_0x1cb9('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 ebe8140..289cf85 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 _0x0b80=['DestroyCmHopperBlack','destroy','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','message','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','update','body','UpdateCmHopperBlack'];(function(_0x1e035c,_0xf906b){var _0x3a63f0=function(_0x51a230){while(--_0x51a230){_0x1e035c['push'](_0x1e035c['shift']());}};_0x3a63f0(++_0xf906b);}(_0x0b80,0x113));var _0x00b8=function(_0x193f67,_0x28fbd2){_0x193f67=_0x193f67-0x0;var _0x278982=_0x0b80[_0x193f67];return _0x278982;};'use strict';var _=require('lodash');var util=require(_0x00b8('0x0'));var moment=require(_0x00b8('0x1'));var BPromise=require(_0x00b8('0x2'));var rs=require(_0x00b8('0x3'));var fs=require('fs');var Redis=require(_0x00b8('0x4'));var db=require(_0x00b8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x00b8('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x00b8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x10ba3f,_0x52fc10,_0x370acf){return new BPromise(function(_0x3436e7,_0x8cf180){return client['request'](_0x10ba3f,_0x370acf)['then'](function(_0x182510){logger[_0x00b8('0x8')](_0x00b8('0x9'),_0x52fc10,_0x00b8('0xa'));logger['debug'](_0x00b8('0xb'),_0x52fc10,_0x00b8('0xa'),JSON['stringify'](_0x182510));if(_0x182510[_0x00b8('0xc')]){if(_0x182510['error']['code']===0x1f4){logger[_0x00b8('0xc')](_0x00b8('0x9'),_0x52fc10,_0x182510[_0x00b8('0xc')][_0x00b8('0xd')]);return _0x8cf180(_0x182510['error'][_0x00b8('0xd')]);}logger[_0x00b8('0xc')](_0x00b8('0x9'),_0x52fc10,_0x182510['error'][_0x00b8('0xd')]);return _0x3436e7(_0x182510[_0x00b8('0xc')][_0x00b8('0xd')]);}else{logger[_0x00b8('0x8')](_0x00b8('0x9'),_0x52fc10,'request\x20sent');_0x3436e7(_0x182510['result']['message']);}})[_0x00b8('0xe')](function(_0x4ba6b4){logger[_0x00b8('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x52fc10,_0x4ba6b4);_0x8cf180(_0x4ba6b4);});});}exports[_0x00b8('0xf')]=function(_0x5524aa){var _0x106232=this;return new Promise(function(_0xcfe2e,_0x50f01e){return db[_0x00b8('0x10')][_0x00b8('0x11')]({'raw':_0x5524aa[_0x00b8('0x12')]?_0x5524aa[_0x00b8('0x12')][_0x00b8('0x13')]===undefined?!![]:![]:!![],'where':_0x5524aa[_0x00b8('0x12')]?_0x5524aa[_0x00b8('0x12')][_0x00b8('0x14')]||null:null,'attributes':_0x5524aa[_0x00b8('0x12')]?_0x5524aa[_0x00b8('0x12')][_0x00b8('0x15')]||null:null,'limit':_0x5524aa['options']?_0x5524aa['options'][_0x00b8('0x16')]||null:null,'include':_0x5524aa[_0x00b8('0x12')]?_0x5524aa['options'][_0x00b8('0x17')]?_[_0x00b8('0x18')](_0x5524aa['options']['include'],function(_0x2357d1){return{'model':db[_0x2357d1[_0x00b8('0x19')]],'as':_0x2357d1['as'],'attributes':_0x2357d1['attributes'],'include':_0x2357d1[_0x00b8('0x17')]?_[_0x00b8('0x18')](_0x2357d1[_0x00b8('0x17')],function(_0x348a6c){return{'model':db[_0x348a6c[_0x00b8('0x19')]],'as':_0x348a6c['as'],'attributes':_0x348a6c[_0x00b8('0x15')],'include':_0x348a6c[_0x00b8('0x17')]?_[_0x00b8('0x18')](_0x348a6c[_0x00b8('0x17')],function(_0x338cb7){return{'model':db[_0x338cb7[_0x00b8('0x19')]],'as':_0x338cb7['as'],'attributes':_0x338cb7[_0x00b8('0x15')]};}):[]};}):[]};}):[]:[]})[_0x00b8('0x1a')](function(_0x293e85){logger['info'](_0x00b8('0xf'),_0x5524aa);logger['debug']('GetCmHopperBlack',_0x5524aa,JSON[_0x00b8('0x1b')](_0x293e85));_0xcfe2e(_0x293e85);})['catch'](function(_0x55d837){logger['error'](_0x00b8('0xf'),_0x55d837[_0x00b8('0xd')],_0x5524aa);_0x50f01e(_0x106232[_0x00b8('0xc')](0x1f4,_0x55d837['message']));});});};exports['UpdateCmHopperBlack']=function(_0x4a1eba){var _0x4a539b=this;return new Promise(function(_0x5e3e31,_0x22db6e){return db[_0x00b8('0x10')][_0x00b8('0x1c')](_0x4a1eba[_0x00b8('0x1d')],{'raw':_0x4a1eba[_0x00b8('0x12')]?_0x4a1eba[_0x00b8('0x12')][_0x00b8('0x13')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a1eba[_0x00b8('0x12')]?_0x4a1eba[_0x00b8('0x12')][_0x00b8('0x14')]||null:null,'attributes':_0x4a1eba[_0x00b8('0x12')]?_0x4a1eba[_0x00b8('0x12')][_0x00b8('0x15')]||null:null,'limit':_0x4a1eba['options']?_0x4a1eba['options']['limit']||null:null})['then'](function(_0x3e68e4){logger[_0x00b8('0x8')](_0x00b8('0x1e'),_0x4a1eba);logger['debug']('UpdateCmHopperBlack',_0x4a1eba,JSON[_0x00b8('0x1b')](_0x3e68e4));_0x5e3e31(_0x3e68e4);})[_0x00b8('0xe')](function(_0x1b06a2){logger[_0x00b8('0xc')]('UpdateCmHopperBlack',_0x1b06a2[_0x00b8('0xd')],_0x4a1eba);_0x22db6e(_0x4a539b[_0x00b8('0xc')](0x1f4,_0x1b06a2['message']));});});};exports[_0x00b8('0x1f')]=function(_0x580c60){var _0x27537b=this;return new Promise(function(_0x426600,_0x3f32df){return db['CmHopperBlack'][_0x00b8('0x20')]({'where':_0x580c60[_0x00b8('0x12')]?_0x580c60[_0x00b8('0x12')]['where']||null:null})['then'](function(_0x167db7){logger['info'](_0x00b8('0x1f'),_0x580c60);logger[_0x00b8('0x21')](_0x00b8('0x1f'),_0x580c60,JSON['stringify'](_0x167db7));_0x426600(_0x167db7);})['catch'](function(_0x4a4964){logger['error'](_0x00b8('0x1f'),_0x4a4964['message'],_0x580c60);_0x3f32df(_0x27537b[_0x00b8('0xc')](0x1f4,_0x4a4964['message']));});});}; \ No newline at end of file +var _0xfcfc=['findAll','options','raw','attributes','limit','include','map','model','UpdateCmHopperBlack','update','body','where','destroy','DestroyCmHopperBlack','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xfcfc,0x146));var _0xcfcf=function(_0x5b821b,_0x59763b){_0x5b821b=_0x5b821b-0x0;var _0x171093=_0xfcfc[_0x5b821b];return _0x171093;};'use strict';var _=require(_0xcfcf('0x0'));var util=require('util');var moment=require(_0xcfcf('0x1'));var BPromise=require(_0xcfcf('0x2'));var rs=require(_0xcfcf('0x3'));var fs=require('fs');var Redis=require(_0xcfcf('0x4'));var db=require(_0xcfcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcfcf('0x6'));var config=require(_0xcfcf('0x7'));var jayson=require(_0xcfcf('0x8'));var client=jayson[_0xcfcf('0x9')][_0xcfcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12079e,_0x173783,_0x29b921){return new BPromise(function(_0x1c88c6,_0x145fb8){return client[_0xcfcf('0xb')](_0x12079e,_0x29b921)[_0xcfcf('0xc')](function(_0x5aeb20){logger['info'](_0xcfcf('0xd'),_0x173783,'request\x20sent');logger[_0xcfcf('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x173783,_0xcfcf('0xf'),JSON[_0xcfcf('0x10')](_0x5aeb20));if(_0x5aeb20[_0xcfcf('0x11')]){if(_0x5aeb20[_0xcfcf('0x11')][_0xcfcf('0x12')]===0x1f4){logger['error'](_0xcfcf('0xd'),_0x173783,_0x5aeb20[_0xcfcf('0x11')][_0xcfcf('0x13')]);return _0x145fb8(_0x5aeb20[_0xcfcf('0x11')][_0xcfcf('0x13')]);}logger[_0xcfcf('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x173783,_0x5aeb20[_0xcfcf('0x11')]['message']);return _0x1c88c6(_0x5aeb20[_0xcfcf('0x11')][_0xcfcf('0x13')]);}else{logger[_0xcfcf('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x173783,_0xcfcf('0xf'));_0x1c88c6(_0x5aeb20[_0xcfcf('0x15')]['message']);}})[_0xcfcf('0x16')](function(_0x14c05f){logger[_0xcfcf('0x11')](_0xcfcf('0xd'),_0x173783,_0x14c05f);_0x145fb8(_0x14c05f);});});}exports[_0xcfcf('0x17')]=function(_0x5ac1e1){var _0x36b884=this;return new Promise(function(_0x174780,_0x501285){return db[_0xcfcf('0x18')][_0xcfcf('0x19')]({'raw':_0x5ac1e1[_0xcfcf('0x1a')]?_0x5ac1e1[_0xcfcf('0x1a')][_0xcfcf('0x1b')]===undefined?!![]:![]:!![],'where':_0x5ac1e1[_0xcfcf('0x1a')]?_0x5ac1e1[_0xcfcf('0x1a')]['where']||null:null,'attributes':_0x5ac1e1[_0xcfcf('0x1a')]?_0x5ac1e1['options'][_0xcfcf('0x1c')]||null:null,'limit':_0x5ac1e1['options']?_0x5ac1e1['options'][_0xcfcf('0x1d')]||null:null,'include':_0x5ac1e1[_0xcfcf('0x1a')]?_0x5ac1e1[_0xcfcf('0x1a')][_0xcfcf('0x1e')]?_[_0xcfcf('0x1f')](_0x5ac1e1[_0xcfcf('0x1a')][_0xcfcf('0x1e')],function(_0x35d3eb){return{'model':db[_0x35d3eb[_0xcfcf('0x20')]],'as':_0x35d3eb['as'],'attributes':_0x35d3eb[_0xcfcf('0x1c')],'include':_0x35d3eb[_0xcfcf('0x1e')]?_[_0xcfcf('0x1f')](_0x35d3eb[_0xcfcf('0x1e')],function(_0x1e0949){return{'model':db[_0x1e0949[_0xcfcf('0x20')]],'as':_0x1e0949['as'],'attributes':_0x1e0949[_0xcfcf('0x1c')],'include':_0x1e0949[_0xcfcf('0x1e')]?_[_0xcfcf('0x1f')](_0x1e0949[_0xcfcf('0x1e')],function(_0x33b1ed){return{'model':db[_0x33b1ed[_0xcfcf('0x20')]],'as':_0x33b1ed['as'],'attributes':_0x33b1ed[_0xcfcf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcfcf('0xc')](function(_0x2c90fe){logger[_0xcfcf('0x14')](_0xcfcf('0x17'),_0x5ac1e1);logger['debug'](_0xcfcf('0x17'),_0x5ac1e1,JSON[_0xcfcf('0x10')](_0x2c90fe));_0x174780(_0x2c90fe);})[_0xcfcf('0x16')](function(_0xcdcf64){logger[_0xcfcf('0x11')](_0xcfcf('0x17'),_0xcdcf64['message'],_0x5ac1e1);_0x501285(_0x36b884[_0xcfcf('0x11')](0x1f4,_0xcdcf64[_0xcfcf('0x13')]));});});};exports[_0xcfcf('0x21')]=function(_0x154123){var _0xa327ea=this;return new Promise(function(_0x4109e9,_0x2de436){return db[_0xcfcf('0x18')][_0xcfcf('0x22')](_0x154123[_0xcfcf('0x23')],{'raw':_0x154123['options']?_0x154123['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x154123[_0xcfcf('0x1a')]?_0x154123[_0xcfcf('0x1a')][_0xcfcf('0x24')]||null:null,'attributes':_0x154123['options']?_0x154123['options'][_0xcfcf('0x1c')]||null:null,'limit':_0x154123[_0xcfcf('0x1a')]?_0x154123[_0xcfcf('0x1a')]['limit']||null:null})[_0xcfcf('0xc')](function(_0x1edc2f){logger[_0xcfcf('0x14')](_0xcfcf('0x21'),_0x154123);logger['debug'](_0xcfcf('0x21'),_0x154123,JSON[_0xcfcf('0x10')](_0x1edc2f));_0x4109e9(_0x1edc2f);})[_0xcfcf('0x16')](function(_0x2789bb){logger[_0xcfcf('0x11')](_0xcfcf('0x21'),_0x2789bb[_0xcfcf('0x13')],_0x154123);_0x2de436(_0xa327ea[_0xcfcf('0x11')](0x1f4,_0x2789bb['message']));});});};exports['DestroyCmHopperBlack']=function(_0x396508){var _0x5c02d7=this;return new Promise(function(_0x23ec1b,_0x5147e3){return db['CmHopperBlack'][_0xcfcf('0x25')]({'where':_0x396508[_0xcfcf('0x1a')]?_0x396508[_0xcfcf('0x1a')][_0xcfcf('0x24')]||null:null})[_0xcfcf('0xc')](function(_0x4d0a81){logger[_0xcfcf('0x14')](_0xcfcf('0x26'),_0x396508);logger['debug'](_0xcfcf('0x26'),_0x396508,JSON['stringify'](_0x4d0a81));_0x23ec1b(_0x4d0a81);})[_0xcfcf('0x16')](function(_0x33729e){logger[_0xcfcf('0x11')]('DestroyCmHopperBlack',_0x33729e[_0xcfcf('0x13')],_0x396508);_0x5147e3(_0x5c02d7[_0xcfcf('0x11')](0x1f4,_0x33729e['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 7960dcf..3017bd3 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 _0xee14=['/describe','isAuthenticated','describe','/:id','put','update','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index'];(function(_0xbc8177,_0x4d1cfd){var _0x91d12f=function(_0x2855e5){while(--_0x2855e5){_0xbc8177['push'](_0xbc8177['shift']());}};_0x91d12f(++_0x4d1cfd);}(_0xee14,0x13a));var _0x4ee1=function(_0x4b25a1,_0x51a4be){_0x4b25a1=_0x4b25a1-0x0;var _0xcce241=_0xee14[_0x4b25a1];return _0xcce241;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ee1('0x0'));var timeout=require(_0x4ee1('0x1'));var express=require(_0x4ee1('0x2'));var router=express[_0x4ee1('0x3')]();var auth=require(_0x4ee1('0x4'));var interaction=require(_0x4ee1('0x5'));var config=require(_0x4ee1('0x6'));var controller=require(_0x4ee1('0x7'));router[_0x4ee1('0x8')]('/',auth['isAuthenticated'](),controller[_0x4ee1('0x9')]);router['get'](_0x4ee1('0xa'),auth[_0x4ee1('0xb')](),controller[_0x4ee1('0xc')]);router[_0x4ee1('0x8')](_0x4ee1('0xd'),auth[_0x4ee1('0xb')](),controller['show']);router[_0x4ee1('0xe')](_0x4ee1('0xd'),auth['isAuthenticated'](),controller[_0x4ee1('0xf')]);router[_0x4ee1('0x10')](_0x4ee1('0xd'),auth[_0x4ee1('0xb')](),controller['destroy']);module[_0x4ee1('0x11')]=router; \ No newline at end of file +var _0xbec5=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','/:id','show','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x1a37df,_0x3ed536){var _0x5a7d5f=function(_0x4dd8a1){while(--_0x4dd8a1){_0x1a37df['push'](_0x1a37df['shift']());}};_0x5a7d5f(++_0x3ed536);}(_0xbec5,0xe5));var _0x5bec=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0xbec5[_0x593564];return _0x211a89;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var auth=require(_0x5bec('0x5'));var interaction=require(_0x5bec('0x6'));var config=require('../../config/environment');var controller=require(_0x5bec('0x7'));router[_0x5bec('0x8')]('/',auth[_0x5bec('0x9')](),controller['index']);router[_0x5bec('0x8')](_0x5bec('0xa'),auth[_0x5bec('0x9')](),controller[_0x5bec('0xb')]);router[_0x5bec('0x8')](_0x5bec('0xc'),auth[_0x5bec('0x9')](),controller[_0x5bec('0xd')]);router['put'](_0x5bec('0xc'),auth['isAuthenticated'](),controller[_0x5bec('0xe')]);router[_0x5bec('0xf')](_0x5bec('0xc'),auth['isAuthenticated'](),controller[_0x5bec('0x10')]);module[_0x5bec('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 72214b7..fde01d9 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 _0x2be2=['DATE','STRING','getDataValue','endtime','setDataValue','followuptime','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER'];(function(_0x26cb7b,_0x614267){var _0xbff214=function(_0x1f5a26){while(--_0x1f5a26){_0x26cb7b['push'](_0x26cb7b['shift']());}};_0xbff214(++_0x614267);}(_0x2be2,0x1dd));var _0x22be=function(_0x376451,_0x3057f4){_0x376451=_0x376451-0x0;var _0xb34de9=_0x2be2[_0x376451];return _0xb34de9;};'use strict';var Sequelize=require(_0x22be('0x0'));var moment=require(_0x22be('0x1'));module[_0x22be('0x2')]={'state':{'type':Sequelize[_0x22be('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x22be('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x22be('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x22be('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x22be('0x5')]},'originatecalleridname':{'type':Sequelize[_0x22be('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x22be('0x5')]},'starttime':{'type':Sequelize[_0x22be('0x4')]},'responsetime':{'type':Sequelize[_0x22be('0x4')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x22be('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x22be('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x22be('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x22be('0x5')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x22be('0x5')]},'disposition':{'type':Sequelize[_0x22be('0x5')]},'dispositionat':{'type':Sequelize[_0x22be('0x4')],'set':function(_0x1ed2d0){var _0x523925=this[_0x22be('0x6')](_0x22be('0x7'));if(_0x523925&&_0x1ed2d0){this[_0x22be('0x8')](_0x22be('0x9'),moment(_0x1ed2d0)['diff'](moment(_0x523925),_0x22be('0xa')));}return this['setDataValue'](_0x22be('0xb'),_0x1ed2d0);}},'amd':{'type':Sequelize[_0x22be('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x22be('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x22be('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x22be('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x22be('0x4')]},'callback':{'type':Sequelize[_0x22be('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x22be('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x22be('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x22be('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x22be('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x22be('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x22be('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x651a=['seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','endtime','setDataValue','followuptime','diff'];(function(_0x5cee5d,_0x3ff6d2){var _0x4dd0f4=function(_0x4dc006){while(--_0x4dc006){_0x5cee5d['push'](_0x5cee5d['shift']());}};_0x4dd0f4(++_0x3ff6d2);}(_0x651a,0xd3));var _0xa651=function(_0x2e78e9,_0x42957c){_0x2e78e9=_0x2e78e9-0x0;var _0x35aad4=_0x651a[_0x2e78e9];return _0x35aad4;};'use strict';var Sequelize=require(_0xa651('0x0'));var moment=require(_0xa651('0x1'));module[_0xa651('0x2')]={'state':{'type':Sequelize[_0xa651('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xa651('0x4')]},'scheduledat':{'type':Sequelize[_0xa651('0x5')]},'countbusyretry':{'type':Sequelize[_0xa651('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa651('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa651('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xa651('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xa651('0x4')]},'originatecalleridname':{'type':Sequelize[_0xa651('0x4')]},'calleridnum':{'type':Sequelize[_0xa651('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xa651('0x5')]},'answertime':{'type':Sequelize[_0xa651('0x5')]},'droptime':{'type':Sequelize[_0xa651('0x5')]},'endtime':{'type':Sequelize[_0xa651('0x5')]},'ringtime':{'type':Sequelize[_0xa651('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xa651('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xa651('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xa651('0x4')]},'campaign':{'type':Sequelize[_0xa651('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xa651('0x4')]},'reason':{'type':Sequelize[_0xa651('0x4')]},'disposition':{'type':Sequelize[_0xa651('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x30fd17){var _0x1d3a8b=this['getDataValue'](_0xa651('0x6'));if(_0x1d3a8b&&_0x30fd17){this[_0xa651('0x7')](_0xa651('0x8'),moment(_0x30fd17)[_0xa651('0x9')](moment(_0x1d3a8b),_0xa651('0xa')));}return this[_0xa651('0x7')](_0xa651('0xb'),_0x30fd17);}},'amd':{'type':Sequelize[_0xa651('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0xa651('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xa651('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xa651('0x5')]},'callback':{'type':Sequelize[_0xa651('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa651('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa651('0x5')]},'deleted':{'type':Sequelize[_0xa651('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xa651('0x5')]},'recallme':{'type':Sequelize[_0xa651('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xa651('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xa651('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa651('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xa651('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa651('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index def8c8f..662769f 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 _0x3f96=['filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','params','rawAttributes','merge','find','describe','catch','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x208,\x201,\x20null','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','createdAt','select','field','ANY_VALUE(calleridnum)','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','then','error','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','query','keys'];(function(_0x54d49e,_0x5d9911){var _0x4af0f1=function(_0xf117b3){while(--_0xf117b3){_0x54d49e['push'](_0x54d49e['shift']());}};_0x4af0f1(++_0x5d9911);}(_0x3f96,0x1d3));var _0x63f9=function(_0x38dbdf,_0x4b4416){_0x38dbdf=_0x38dbdf-0x0;var _0x3701ed=_0x3f96[_0x38dbdf];return _0x3701ed;};'use strict';var pdf=require(_0x63f9('0x0'));var emlformat=require(_0x63f9('0x1'));var rimraf=require(_0x63f9('0x2'));var zipdir=require(_0x63f9('0x3'));var jsonpatch=require(_0x63f9('0x4'));var rp=require('request-promise');var moment=require(_0x63f9('0x5'));var BPromise=require(_0x63f9('0x6'));var Mustache=require(_0x63f9('0x7'));var util=require(_0x63f9('0x8'));var path=require(_0x63f9('0x9'));var sox=require('sox');var csv=require(_0x63f9('0xa'));var ejs=require(_0x63f9('0xb'));var fs=require('fs');var _=require(_0x63f9('0xc'));var squel=require(_0x63f9('0xd'));var crypto=require('crypto');var jsforce=require(_0x63f9('0xe'));var deskjs=require(_0x63f9('0xf'));var toCsv=require(_0x63f9('0xa'));var querystring=require(_0x63f9('0x10'));var Papa=require(_0x63f9('0x11'));var Redis=require(_0x63f9('0x12'));var authService=require(_0x63f9('0x13'));var qs=require(_0x63f9('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63f9('0x15'));var logger=require(_0x63f9('0x16'))('api');var utils=require(_0x63f9('0x17'));var config=require(_0x63f9('0x18'));var db=require(_0x63f9('0x19'))['db'];function respondWithStatusCode(_0x4a8acc,_0x45881b){_0x45881b=_0x45881b||0xcc;return function(_0x376780){if(_0x376780){return _0x4a8acc[_0x63f9('0x1a')](_0x45881b);}return _0x4a8acc[_0x63f9('0x1b')](_0x45881b)[_0x63f9('0x1c')]();};}function respondWithResult(_0x568e3d,_0x31997c){_0x31997c=_0x31997c||0xc8;return function(_0x51ec79){if(_0x51ec79){return _0x568e3d[_0x63f9('0x1b')](_0x31997c)['json'](_0x51ec79);}};}function respondWithFilteredResult(_0x1b874d,_0x52be5e){return function(_0x47050b){if(_0x47050b){var _0x1fa6dd=_0x47050b[_0x63f9('0x1d')],_0x37fc43=_0x52be5e[_0x63f9('0x1e')],_0x352334=_0x52be5e['offset']+_0x52be5e[_0x63f9('0x1f')],_0x100d39;if(_0x352334>=_0x1fa6dd){_0x352334=_0x1fa6dd;_0x100d39=0xc8;}else{_0x100d39=0xce;}_0x1b874d[_0x63f9('0x1b')](_0x100d39);return _0x1b874d[_0x63f9('0x20')](_0x63f9('0x21'),_0x37fc43+'-'+_0x352334+'/'+_0x1fa6dd)[_0x63f9('0x22')](_0x47050b);}return null;};}function patchUpdates(_0x4bf06f){return function(_0x1e309f){try{jsonpatch[_0x63f9('0x23')](_0x1e309f,_0x4bf06f,!![]);}catch(_0x3633d3){return BPromise['reject'](_0x3633d3);}return _0x1e309f[_0x63f9('0x24')]();};}function saveUpdates(_0x235354,_0x170f4){return function(_0x262b43){if(_0x262b43){return _0x262b43[_0x63f9('0x25')](_0x235354)['then'](function(_0x59f437){return _0x59f437;});}return null;};}function removeEntity(_0xf74a50,_0x3926a2){return function(_0x3c0589){if(_0x3c0589){return _0x3c0589[_0x63f9('0x26')]()[_0x63f9('0x27')](function(){_0xf74a50[_0x63f9('0x1b')](0xcc)[_0x63f9('0x1c')]();});}};}function handleEntityNotFound(_0x549454,_0x5994c1){return function(_0x33092b){if(!_0x33092b){_0x549454[_0x63f9('0x1a')](0x194);}return _0x33092b;};}function handleError(_0x363468,_0x46f335){_0x46f335=_0x46f335||0x1f4;return function(_0x462fe9){logger[_0x63f9('0x28')](_0x462fe9[_0x63f9('0x29')]);if(_0x462fe9[_0x63f9('0x2a')]){delete _0x462fe9['name'];}_0x363468['status'](_0x46f335)[_0x63f9('0x2b')](_0x462fe9);};}exports[_0x63f9('0x2c')]=function(_0x2361a9,_0x14d708){var _0x4bc6fd={},_0x1a43e5={},_0x4c6f08={'count':0x0,'rows':[]};var _0x40fc8a=_[_0x63f9('0x2d')](db[_0x63f9('0x2e')]['rawAttributes'],function(_0x1b56bd){return{'name':_0x1b56bd[_0x63f9('0x2f')],'type':_0x1b56bd[_0x63f9('0x30')][_0x63f9('0x31')]};});_0x1a43e5[_0x63f9('0x32')]=_[_0x63f9('0x2d')](_0x40fc8a,'name');_0x1a43e5[_0x63f9('0x33')]=_[_0x63f9('0x34')](_0x2361a9[_0x63f9('0x33')]);_0x1a43e5[_0x63f9('0x35')]=_[_0x63f9('0x36')](_0x1a43e5[_0x63f9('0x32')],_0x1a43e5[_0x63f9('0x33')]);_0x4bc6fd[_0x63f9('0x37')]=_[_0x63f9('0x36')](_0x1a43e5['model'],qs[_0x63f9('0x38')](_0x2361a9['query'][_0x63f9('0x38')]));_0x4bc6fd[_0x63f9('0x37')]=_0x4bc6fd[_0x63f9('0x37')][_0x63f9('0x39')]?_0x4bc6fd[_0x63f9('0x37')]:_0x1a43e5['model'];if(!_0x2361a9[_0x63f9('0x33')]['hasOwnProperty']('nolimit')){_0x4bc6fd[_0x63f9('0x1f')]=qs[_0x63f9('0x1f')](_0x2361a9[_0x63f9('0x33')]['limit']);_0x4bc6fd[_0x63f9('0x1e')]=qs['offset'](_0x2361a9[_0x63f9('0x33')][_0x63f9('0x1e')]);}_0x4bc6fd[_0x63f9('0x3a')]=qs['sort'](_0x2361a9['query'][_0x63f9('0x3b')]);_0x4bc6fd[_0x63f9('0x3c')]=qs[_0x63f9('0x35')](_[_0x63f9('0x3d')](_0x2361a9['query'],_0x1a43e5[_0x63f9('0x35')]),_0x40fc8a);if(_0x2361a9[_0x63f9('0x33')][_0x63f9('0x3e')]){_0x4bc6fd[_0x63f9('0x3c')]=_['merge'](_0x4bc6fd[_0x63f9('0x3c')],{'$or':_[_0x63f9('0x2d')](_0x40fc8a,function(_0x166cfa){if(_0x166cfa[_0x63f9('0x30')]!==_0x63f9('0x3f')){var _0x448be1={};_0x448be1[_0x166cfa[_0x63f9('0x2a')]]={'$like':'%'+_0x2361a9[_0x63f9('0x33')][_0x63f9('0x3e')]+'%'};return _0x448be1;}})});}_0x4bc6fd=_['merge']({},_0x4bc6fd,_0x2361a9[_0x63f9('0x40')]);var _0x26bba2={'where':_0x4bc6fd[_0x63f9('0x3c')]};return db[_0x63f9('0x2e')][_0x63f9('0x1d')](_0x26bba2)[_0x63f9('0x27')](function(_0x5c78a8){_0x4c6f08[_0x63f9('0x1d')]=_0x5c78a8;if(_0x2361a9[_0x63f9('0x33')][_0x63f9('0x41')]){_0x4bc6fd[_0x63f9('0x42')]=[{'all':!![]}];}return db[_0x63f9('0x2e')][_0x63f9('0x43')](_0x4bc6fd);})[_0x63f9('0x27')](function(_0x12f84d){_0x4c6f08['rows']=_0x12f84d;return _0x4c6f08;})['then'](respondWithFilteredResult(_0x14d708,_0x4bc6fd))['catch'](handleError(_0x14d708,null));};exports['show']=function(_0xd37f1b,_0x1c599e){var _0x19a603={'raw':!![],'where':{'id':_0xd37f1b[_0x63f9('0x44')]['id']}},_0x2cdb7e={};_0x2cdb7e[_0x63f9('0x32')]=_[_0x63f9('0x34')](db[_0x63f9('0x2e')][_0x63f9('0x45')]);_0x2cdb7e['query']=_[_0x63f9('0x34')](_0xd37f1b['query']);_0x2cdb7e[_0x63f9('0x35')]=_['intersection'](_0x2cdb7e[_0x63f9('0x32')],_0x2cdb7e[_0x63f9('0x33')]);_0x19a603[_0x63f9('0x37')]=_['intersection'](_0x2cdb7e[_0x63f9('0x32')],qs[_0x63f9('0x38')](_0xd37f1b[_0x63f9('0x33')]['fields']));_0x19a603['attributes']=_0x19a603[_0x63f9('0x37')][_0x63f9('0x39')]?_0x19a603[_0x63f9('0x37')]:_0x2cdb7e[_0x63f9('0x32')];if(_0xd37f1b[_0x63f9('0x33')][_0x63f9('0x41')]){_0x19a603['include']=[{'all':!![]}];}_0x19a603=_[_0x63f9('0x46')]({},_0x19a603,_0xd37f1b[_0x63f9('0x40')]);return db['CmHopperFinal'][_0x63f9('0x47')](_0x19a603)[_0x63f9('0x27')](handleEntityNotFound(_0x1c599e,null))[_0x63f9('0x27')](respondWithResult(_0x1c599e,null))['catch'](handleError(_0x1c599e,null));};exports['describe']=function(_0x2248b6,_0x145fc1){return db['CmHopperFinal'][_0x63f9('0x48')]()[_0x63f9('0x27')](respondWithResult(_0x145fc1,null))[_0x63f9('0x49')](handleError(_0x145fc1,null));};exports[_0x63f9('0x25')]=function(_0x119b8e,_0x51d818){if(_0x119b8e[_0x63f9('0x4a')][_0x63f9('0x4b')]){delete _0x119b8e[_0x63f9('0x4a')]['uniqueid'];}return db['CmHopperFinal']['find']({'where':{'uniqueid':_0x119b8e['params']['id']}})[_0x63f9('0x27')](handleEntityNotFound(_0x51d818,null))[_0x63f9('0x27')](saveUpdates(_0x119b8e[_0x63f9('0x4a')],null))['then'](respondWithResult(_0x51d818,null))['catch'](handleError(_0x51d818,null));};exports[_0x63f9('0x4c')]=function(_0x15c27b,_0x1a91cc,_0x803b18){return db[_0x63f9('0x2e')][_0x63f9('0x43')]({'raw':![],'where':{'VoiceQueueId':_0x15c27b[_0x63f9('0x44')]['id']},'attributes':[[db[_0x63f9('0x4d')]['fn']('COUNT',db[_0x63f9('0x4d')]['fn']('IF',db[_0x63f9('0x4d')]['literal'](_0x63f9('0x4e')))),_0x63f9('0x4f')],[db['sequelize']['fn'](_0x63f9('0x50'),db['sequelize']['fn']('IF',db[_0x63f9('0x4d')][_0x63f9('0x51')](_0x63f9('0x52')))),_0x63f9('0x53')],[db[_0x63f9('0x4d')]['fn'](_0x63f9('0x50'),db['sequelize']['fn']('IF',db[_0x63f9('0x4d')]['literal'](_0x63f9('0x54')))),_0x63f9('0x55')],[db['sequelize']['fn'](_0x63f9('0x50'),db['sequelize']['fn']('IF',db[_0x63f9('0x4d')][_0x63f9('0x51')]('`state`\x20=\x208,\x201,\x20null'))),_0x63f9('0x56')],[db['sequelize']['fn'](_0x63f9('0x50'),db[_0x63f9('0x4d')]['fn']('IF',db['sequelize'][_0x63f9('0x51')](_0x63f9('0x57')))),_0x63f9('0x58')],[db['sequelize']['fn']('COUNT',db[_0x63f9('0x4d')]['fn']('IF',db[_0x63f9('0x4d')]['literal'](_0x63f9('0x59')))),_0x63f9('0x5a')],[db['sequelize']['fn'](_0x63f9('0x50'),db[_0x63f9('0x4d')]['fn']('IF',db[_0x63f9('0x4d')]['literal'](_0x63f9('0x5b')))),_0x63f9('0x5c')],[db['sequelize']['fn'](_0x63f9('0x50'),db['sequelize']['fn']('IF',db[_0x63f9('0x4d')]['literal'](_0x63f9('0x5d')))),_0x63f9('0x5e')]]})[_0x63f9('0x27')](handleEntityNotFound(_0x1a91cc,null))[_0x63f9('0x27')](respondWithResult(_0x1a91cc,null))[_0x63f9('0x49')](handleError(_0x1a91cc,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x57ceb2,_0x2e9ac1,_0x3cd807){return db[_0x63f9('0x2e')][_0x63f9('0x43')]({'raw':![],'where':{'CampaignId':_0x57ceb2['params']['id']},'attributes':[[db[_0x63f9('0x4d')]['fn'](_0x63f9('0x50'),db['sequelize']['fn']('IF',db['sequelize'][_0x63f9('0x51')]('`state`\x20=\x200,\x201,\x20null'))),_0x63f9('0x4f')],[db[_0x63f9('0x4d')]['fn'](_0x63f9('0x50'),db['sequelize']['fn']('IF',db[_0x63f9('0x4d')]['literal'](_0x63f9('0x52')))),_0x63f9('0x53')],[db[_0x63f9('0x4d')]['fn'](_0x63f9('0x50'),db[_0x63f9('0x4d')]['fn']('IF',db[_0x63f9('0x4d')][_0x63f9('0x51')](_0x63f9('0x54')))),_0x63f9('0x55')],[db['sequelize']['fn'](_0x63f9('0x50'),db['sequelize']['fn']('IF',db[_0x63f9('0x4d')][_0x63f9('0x51')](_0x63f9('0x5f')))),_0x63f9('0x56')],[db['sequelize']['fn'](_0x63f9('0x50'),db[_0x63f9('0x4d')]['fn']('IF',db['sequelize'][_0x63f9('0x51')](_0x63f9('0x57')))),_0x63f9('0x58')],[db['sequelize']['fn'](_0x63f9('0x50'),db[_0x63f9('0x4d')]['fn']('IF',db['sequelize'][_0x63f9('0x51')](_0x63f9('0x59')))),_0x63f9('0x5a')],[db[_0x63f9('0x4d')]['fn'](_0x63f9('0x50'),db[_0x63f9('0x4d')]['fn']('IF',db['sequelize'][_0x63f9('0x51')]('`state`\x20=\x2022,\x201,\x20null'))),_0x63f9('0x5c')],[db[_0x63f9('0x4d')]['fn'](_0x63f9('0x50'),db['sequelize']['fn']('IF',db['sequelize'][_0x63f9('0x51')](_0x63f9('0x5d')))),_0x63f9('0x5e')]]})['then'](handleEntityNotFound(_0x2e9ac1,null))['then'](respondWithResult(_0x2e9ac1,null))[_0x63f9('0x49')](handleError(_0x2e9ac1,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x15fa1e,_0x3e16d5,_0xc99c25){return db[_0x63f9('0x60')][_0x63f9('0x47')]({'where':{'id':_0x15fa1e[_0x63f9('0x44')]['id']}})[_0x63f9('0x27')](handleEntityNotFound(_0x3e16d5,null))[_0x63f9('0x27')](function(_0x555776){var _0x32cc10;if(_0x555776){_0x32cc10=squel[_0x63f9('0x61')]()[_0x63f9('0x62')](_0x63f9('0x63'))[_0x63f9('0x64')]([_0x63f9('0x65'),'scheduledAt',_0x63f9('0x66'),_0x63f9('0x67'),'VoiceQueueId',_0x63f9('0x68'),'updatedAt'],squel[_0x63f9('0x69')]()[_0x63f9('0x6a')](_0x63f9('0x6b'),_0x63f9('0x65'))[_0x63f9('0x6a')](_0x63f9('0x6c'),_0x63f9('0x6d'))[_0x63f9('0x6a')](_0x63f9('0x6e'),'ContactId')[_0x63f9('0x6a')](_0x63f9('0x6f'),'ListId')[_0x63f9('0x6a')](_0x63f9('0x70'),_0x63f9('0x71'))[_0x63f9('0x6a')]('NOW()',_0x63f9('0x68'))[_0x63f9('0x6a')]('NOW()',_0x63f9('0x72'))[_0x63f9('0x73')](_0x63f9('0x74'))[_0x63f9('0x3c')](_0x63f9('0x75'),_0x15fa1e[_0x63f9('0x44')]['id'][_0x63f9('0x76')]())['where'](_0x63f9('0x77'),_0x15fa1e[_0x63f9('0x4a')][_0x63f9('0x78')]['toString']())[_0x63f9('0x3c')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x63f9('0x3c')](_0x63f9('0x79'),squel[_0x63f9('0x69')]()[_0x63f9('0x6a')](_0x63f9('0x65'))[_0x63f9('0x73')](_0x63f9('0x63'))[_0x63f9('0x3c')](_0x63f9('0x75'),_0x15fa1e[_0x63f9('0x44')]['id'][_0x63f9('0x76')]()))[_0x63f9('0x3c')](_0x63f9('0x79'),squel[_0x63f9('0x69')]()[_0x63f9('0x6a')](_0x63f9('0x7a'))[_0x63f9('0x73')](_0x63f9('0x74'))[_0x63f9('0x3c')](_0x63f9('0x75'),_0x15fa1e[_0x63f9('0x44')]['id']['toString']())['where'](_0x63f9('0x7b')))['group']('ContactId'))[_0x63f9('0x76')]();return db[_0x63f9('0x4d')][_0x63f9('0x33')](_0x32cc10);}return[];})[_0x63f9('0x27')](respondWithResult(_0x3e16d5,null))['catch'](handleError(_0x3e16d5,null));};exports[_0x63f9('0x7c')]=function(_0x34a6e2,_0x3f9efe,_0xc96639){return db[_0x63f9('0x7d')][_0x63f9('0x47')]({'where':{'id':_0x34a6e2[_0x63f9('0x44')]['id']}})[_0x63f9('0x27')](handleEntityNotFound(_0x3f9efe,null))[_0x63f9('0x27')](function(_0x336c1a){var _0x47833f;if(_0x336c1a){_0x47833f=squel[_0x63f9('0x61')]()['into'](_0x63f9('0x63'))[_0x63f9('0x64')]([_0x63f9('0x65'),_0x63f9('0x6d'),_0x63f9('0x66'),_0x63f9('0x67'),_0x63f9('0x7e'),_0x63f9('0x68'),_0x63f9('0x72')],squel[_0x63f9('0x69')]()[_0x63f9('0x6a')](_0x63f9('0x6b'),_0x63f9('0x65'))[_0x63f9('0x6a')](_0x63f9('0x6c'),_0x63f9('0x6d'))[_0x63f9('0x6a')](_0x63f9('0x6e'),_0x63f9('0x66'))[_0x63f9('0x6a')](_0x63f9('0x6f'),_0x63f9('0x67'))[_0x63f9('0x6a')](_0x63f9('0x7f'),_0x63f9('0x7e'))[_0x63f9('0x6a')](_0x63f9('0x6c'),_0x63f9('0x68'))[_0x63f9('0x6a')](_0x63f9('0x6c'),_0x63f9('0x72'))['from']('cm_hopper_final')['where'](_0x63f9('0x80'),_0x34a6e2[_0x63f9('0x44')]['id'][_0x63f9('0x76')]())['where'](_0x63f9('0x77'),_0x34a6e2[_0x63f9('0x4a')]['state'][_0x63f9('0x76')]())[_0x63f9('0x3c')](_0x63f9('0x81'))[_0x63f9('0x3c')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x63f9('0x69')]()[_0x63f9('0x6a')](_0x63f9('0x65'))['from']('cm_hopper')[_0x63f9('0x3c')](_0x63f9('0x80'),_0x34a6e2['params']['id'][_0x63f9('0x76')]()))['where'](_0x63f9('0x79'),squel[_0x63f9('0x69')]()[_0x63f9('0x6a')](_0x63f9('0x7a'))[_0x63f9('0x73')]('cm_hopper_final')[_0x63f9('0x3c')](_0x63f9('0x80'),_0x34a6e2[_0x63f9('0x44')]['id']['toString']())[_0x63f9('0x3c')]('state\x20=\x204'))['group'](_0x63f9('0x66')))[_0x63f9('0x76')]();return db[_0x63f9('0x4d')]['query'](_0x47833f);}return[];})['then'](respondWithResult(_0x3f9efe,null))[_0x63f9('0x49')](handleError(_0x3f9efe,null));};exports['checkContactHopper']=function(_0x2a77eb,_0x645b79,_0x3d9b3e){return db['CmHopper']['findOne']({'where':{'VoiceQueueId':_0x2a77eb[_0x63f9('0x4a')][_0x63f9('0x71')],'CampaignId':_0x2a77eb[_0x63f9('0x4a')]['CampaignId'],'ContactId':_0x2a77eb[_0x63f9('0x4a')][_0x63f9('0x66')]}})['then'](handleEntityNotFound(_0x645b79,null))['then'](function(_0x5c037d){if(_0x5c037d){return _0x5c037d;}return null;})['then'](respondWithResult(_0x645b79,null))['catch'](handleError(_0x645b79,null));}; \ No newline at end of file +var _0x5f2f=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','CmHopperFinal','then','include','rows','catch','show','params','intersection','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','COUNT','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','noAnswerContacts','`state`\x20=\x208,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','toString','calleridnum','state\x20=\x204','group','Campaign','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','state','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x107adf,_0x45c257){var _0x152379=function(_0x3b9fc4){while(--_0x3b9fc4){_0x107adf['push'](_0x107adf['shift']());}};_0x152379(++_0x45c257);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3dbaae,_0x377cb0){_0x3dbaae=_0x3dbaae-0x0;var _0x4cf753=_0x5f2f[_0x3dbaae];return _0x4cf753;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['CmHopperFinal']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]),_0x198c73);if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));};exports[_0xf5f2('0x41')]=function(_0x462ea3,_0x2083b3){var _0x574f24={'raw':!![],'where':{'id':_0x462ea3[_0xf5f2('0x42')]['id']}},_0x31c3c={};_0x31c3c[_0xf5f2('0x2f')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x31c3c[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x462ea3['query']);_0x31c3c[_0xf5f2('0x38')]=_[_0xf5f2('0x43')](_0x31c3c[_0xf5f2('0x2f')],_0x31c3c[_0xf5f2('0x2d')]);_0x574f24[_0xf5f2('0x30')]=_[_0xf5f2('0x43')](_0x31c3c[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x462ea3[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x574f24[_0xf5f2('0x30')]=_0x574f24[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x574f24[_0xf5f2('0x30')]:_0x31c3c['model'];if(_0x462ea3[_0xf5f2('0x2d')]['includeAll']){_0x574f24[_0xf5f2('0x3e')]=[{'all':!![]}];}_0x574f24=_[_0xf5f2('0x3a')]({},_0x574f24,_0x462ea3[_0xf5f2('0x44')]);return db[_0xf5f2('0x3c')][_0xf5f2('0x45')](_0x574f24)[_0xf5f2('0x3d')](handleEntityNotFound(_0x2083b3,null))['then'](respondWithResult(_0x2083b3,null))[_0xf5f2('0x40')](handleError(_0x2083b3,null));};exports[_0xf5f2('0x46')]=function(_0x1c1497,_0x29b108){return db[_0xf5f2('0x3c')][_0xf5f2('0x46')]()[_0xf5f2('0x3d')](respondWithResult(_0x29b108,null))[_0xf5f2('0x40')](handleError(_0x29b108,null));};exports['update']=function(_0x35dece,_0x33ec29){if(_0x35dece[_0xf5f2('0x47')]['uniqueid']){delete _0x35dece[_0xf5f2('0x47')][_0xf5f2('0x48')];}return db[_0xf5f2('0x3c')]['find']({'where':{'uniqueid':_0x35dece['params']['id']}})[_0xf5f2('0x3d')](handleEntityNotFound(_0x33ec29,null))[_0xf5f2('0x3d')](saveUpdates(_0x35dece['body'],null))[_0xf5f2('0x3d')](respondWithResult(_0x33ec29,null))['catch'](handleError(_0x33ec29,null));};exports[_0xf5f2('0x49')]=function(_0x497eb8,_0x2cbd9d,_0x5d9120){return db[_0xf5f2('0x3c')][_0xf5f2('0x4a')]({'raw':![],'where':{'VoiceQueueId':_0x497eb8[_0xf5f2('0x42')]['id']},'attributes':[[db[_0xf5f2('0x4b')]['fn']('COUNT',db[_0xf5f2('0x4b')]['fn']('IF',db[_0xf5f2('0x4b')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0xf5f2('0x4c')],[db[_0xf5f2('0x4b')]['fn']('COUNT',db[_0xf5f2('0x4b')]['fn']('IF',db[_0xf5f2('0x4b')][_0xf5f2('0x4d')](_0xf5f2('0x4e')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xf5f2('0x4f'),db[_0xf5f2('0x4b')]['fn']('IF',db['sequelize'][_0xf5f2('0x4d')](_0xf5f2('0x50')))),_0xf5f2('0x51')],[db[_0xf5f2('0x4b')]['fn'](_0xf5f2('0x4f'),db[_0xf5f2('0x4b')]['fn']('IF',db[_0xf5f2('0x4b')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf5f2('0x52')],[db[_0xf5f2('0x4b')]['fn'](_0xf5f2('0x4f'),db[_0xf5f2('0x4b')]['fn']('IF',db[_0xf5f2('0x4b')]['literal'](_0xf5f2('0x53')))),_0xf5f2('0x54')],[db[_0xf5f2('0x4b')]['fn']('COUNT',db[_0xf5f2('0x4b')]['fn']('IF',db['sequelize'][_0xf5f2('0x4d')](_0xf5f2('0x55')))),_0xf5f2('0x56')],[db[_0xf5f2('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf5f2('0x4b')]['literal'](_0xf5f2('0x57')))),_0xf5f2('0x58')],[db['sequelize']['fn'](_0xf5f2('0x4f'),db[_0xf5f2('0x4b')]['fn']('IF',db[_0xf5f2('0x4b')]['literal'](_0xf5f2('0x59')))),_0xf5f2('0x5a')]]})[_0xf5f2('0x3d')](handleEntityNotFound(_0x2cbd9d,null))[_0xf5f2('0x3d')](respondWithResult(_0x2cbd9d,null))['catch'](handleError(_0x2cbd9d,null));};exports[_0xf5f2('0x5b')]=function(_0x506fe5,_0x2cbe1e,_0x2a773d){return db[_0xf5f2('0x3c')][_0xf5f2('0x4a')]({'raw':![],'where':{'CampaignId':_0x506fe5[_0xf5f2('0x42')]['id']},'attributes':[[db['sequelize']['fn'](_0xf5f2('0x4f'),db[_0xf5f2('0x4b')]['fn']('IF',db[_0xf5f2('0x4b')][_0xf5f2('0x4d')](_0xf5f2('0x5c')))),'noSuchContacts'],[db[_0xf5f2('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf5f2('0x4b')]['literal'](_0xf5f2('0x4e')))),_0xf5f2('0x5d')],[db[_0xf5f2('0x4b')]['fn'](_0xf5f2('0x4f'),db['sequelize']['fn']('IF',db[_0xf5f2('0x4b')][_0xf5f2('0x4d')](_0xf5f2('0x50')))),_0xf5f2('0x51')],[db[_0xf5f2('0x4b')]['fn'](_0xf5f2('0x4f'),db[_0xf5f2('0x4b')]['fn']('IF',db['sequelize'][_0xf5f2('0x4d')](_0xf5f2('0x5e')))),_0xf5f2('0x52')],[db[_0xf5f2('0x4b')]['fn']('COUNT',db[_0xf5f2('0x4b')]['fn']('IF',db['sequelize'][_0xf5f2('0x4d')](_0xf5f2('0x53')))),'dropContacts'],[db[_0xf5f2('0x4b')]['fn'](_0xf5f2('0x4f'),db[_0xf5f2('0x4b')]['fn']('IF',db[_0xf5f2('0x4b')][_0xf5f2('0x4d')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf5f2('0x56')],[db[_0xf5f2('0x4b')]['fn'](_0xf5f2('0x4f'),db[_0xf5f2('0x4b')]['fn']('IF',db[_0xf5f2('0x4b')][_0xf5f2('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0xf5f2('0x58')],[db[_0xf5f2('0x4b')]['fn']('COUNT',db[_0xf5f2('0x4b')]['fn']('IF',db[_0xf5f2('0x4b')][_0xf5f2('0x4d')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x2cbe1e,null))[_0xf5f2('0x3d')](respondWithResult(_0x2cbe1e,null))[_0xf5f2('0x40')](handleError(_0x2cbe1e,null));};exports[_0xf5f2('0x5f')]=function(_0x450691,_0x55da4d,_0x4d878e){return db[_0xf5f2('0x60')][_0xf5f2('0x45')]({'where':{'id':_0x450691[_0xf5f2('0x42')]['id']}})[_0xf5f2('0x3d')](handleEntityNotFound(_0x55da4d,null))[_0xf5f2('0x3d')](function(_0x1cbe86){var _0x11c302;if(_0x1cbe86){_0x11c302=squel[_0xf5f2('0x61')]()[_0xf5f2('0x62')](_0xf5f2('0x63'))[_0xf5f2('0x64')](['phone','scheduledAt','ContactId',_0xf5f2('0x65'),_0xf5f2('0x66'),_0xf5f2('0x67'),_0xf5f2('0x68')],squel[_0xf5f2('0x69')]()['field'](_0xf5f2('0x6a'),_0xf5f2('0x6b'))[_0xf5f2('0x6c')](_0xf5f2('0x6d'),_0xf5f2('0x6e'))['field'](_0xf5f2('0x6f'),_0xf5f2('0x70'))['field'](_0xf5f2('0x71'),_0xf5f2('0x65'))[_0xf5f2('0x6c')](_0xf5f2('0x72'),'VoiceQueueId')[_0xf5f2('0x6c')](_0xf5f2('0x6d'),_0xf5f2('0x67'))[_0xf5f2('0x6c')](_0xf5f2('0x6d'),'updatedAt')['from'](_0xf5f2('0x73'))[_0xf5f2('0x37')](_0xf5f2('0x74'),_0x450691[_0xf5f2('0x42')]['id']['toString']())['where'](_0xf5f2('0x75'),_0x450691['body']['state']['toString']())['where'](_0xf5f2('0x76'))[_0xf5f2('0x37')](_0xf5f2('0x77'),squel[_0xf5f2('0x69')]()[_0xf5f2('0x6c')](_0xf5f2('0x6b'))[_0xf5f2('0x78')](_0xf5f2('0x63'))[_0xf5f2('0x37')](_0xf5f2('0x74'),_0x450691[_0xf5f2('0x42')]['id'][_0xf5f2('0x79')]()))[_0xf5f2('0x37')](_0xf5f2('0x77'),squel[_0xf5f2('0x69')]()[_0xf5f2('0x6c')](_0xf5f2('0x7a'))[_0xf5f2('0x78')]('cm_hopper_final')[_0xf5f2('0x37')](_0xf5f2('0x74'),_0x450691[_0xf5f2('0x42')]['id'][_0xf5f2('0x79')]())[_0xf5f2('0x37')](_0xf5f2('0x7b')))[_0xf5f2('0x7c')](_0xf5f2('0x70')))['toString']();return db[_0xf5f2('0x4b')]['query'](_0x11c302);}return[];})['then'](respondWithResult(_0x55da4d,null))['catch'](handleError(_0x55da4d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x50befc,_0x4dc9d0,_0x161890){return db[_0xf5f2('0x7d')][_0xf5f2('0x45')]({'where':{'id':_0x50befc[_0xf5f2('0x42')]['id']}})[_0xf5f2('0x3d')](handleEntityNotFound(_0x4dc9d0,null))[_0xf5f2('0x3d')](function(_0x5dc63f){var _0x4a0005;if(_0x5dc63f){_0x4a0005=squel[_0xf5f2('0x61')]()['into'](_0xf5f2('0x63'))[_0xf5f2('0x64')](['phone','scheduledAt',_0xf5f2('0x70'),_0xf5f2('0x65'),'CampaignId',_0xf5f2('0x67'),_0xf5f2('0x68')],squel['select']()[_0xf5f2('0x6c')](_0xf5f2('0x6a'),_0xf5f2('0x6b'))['field'](_0xf5f2('0x6d'),_0xf5f2('0x6e'))[_0xf5f2('0x6c')](_0xf5f2('0x6f'),_0xf5f2('0x70'))[_0xf5f2('0x6c')](_0xf5f2('0x71'),_0xf5f2('0x65'))[_0xf5f2('0x6c')](_0xf5f2('0x7e'),_0xf5f2('0x7f'))[_0xf5f2('0x6c')](_0xf5f2('0x6d'),_0xf5f2('0x67'))[_0xf5f2('0x6c')](_0xf5f2('0x6d'),_0xf5f2('0x68'))[_0xf5f2('0x78')](_0xf5f2('0x73'))[_0xf5f2('0x37')](_0xf5f2('0x80'),_0x50befc['params']['id'][_0xf5f2('0x79')]())[_0xf5f2('0x37')]('state\x20=\x20?',_0x50befc[_0xf5f2('0x47')][_0xf5f2('0x81')]['toString']())[_0xf5f2('0x37')](_0xf5f2('0x76'))[_0xf5f2('0x37')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xf5f2('0x6c')](_0xf5f2('0x6b'))[_0xf5f2('0x78')]('cm_hopper')['where'](_0xf5f2('0x80'),_0x50befc[_0xf5f2('0x42')]['id'][_0xf5f2('0x79')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('calleridnum')[_0xf5f2('0x78')]('cm_hopper_final')[_0xf5f2('0x37')](_0xf5f2('0x80'),_0x50befc[_0xf5f2('0x42')]['id'][_0xf5f2('0x79')]())[_0xf5f2('0x37')](_0xf5f2('0x7b')))[_0xf5f2('0x7c')](_0xf5f2('0x70')))[_0xf5f2('0x79')]();return db[_0xf5f2('0x4b')][_0xf5f2('0x2d')](_0x4a0005);}return[];})[_0xf5f2('0x3d')](respondWithResult(_0x4dc9d0,null))[_0xf5f2('0x40')](handleError(_0x4dc9d0,null));};exports['checkContactHopper']=function(_0x29f40b,_0x2a4fed,_0x5783e2){return db[_0xf5f2('0x82')][_0xf5f2('0x83')]({'where':{'VoiceQueueId':_0x29f40b['body'][_0xf5f2('0x66')],'CampaignId':_0x29f40b[_0xf5f2('0x47')][_0xf5f2('0x7f')],'ContactId':_0x29f40b['body'][_0xf5f2('0x70')]}})[_0xf5f2('0x3d')](handleEntityNotFound(_0x2a4fed,null))['then'](function(_0xbac6d2){if(_0xbac6d2){return _0xbac6d2;}return null;})[_0xf5f2('0x3d')](respondWithResult(_0x2a4fed,null))[_0xf5f2('0x40')](handleError(_0x2a4fed,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index e9eeca8..9f18401 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 _0x21a3=['api','moment','bluebird','request-promise','path','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger'];(function(_0xa85dbd,_0x2838a5){var _0x3be7aa=function(_0x2573f8){while(--_0x2573f8){_0xa85dbd['push'](_0xa85dbd['shift']());}};_0x3be7aa(++_0x2838a5);}(_0x21a3,0x66));var _0x321a=function(_0x3fd4b3,_0x17d3ef){_0x3fd4b3=_0x3fd4b3-0x0;var _0x2979a3=_0x21a3[_0x3fd4b3];return _0x2979a3;};'use strict';var _=require(_0x321a('0x0'));var util=require('util');var logger=require(_0x321a('0x1'))(_0x321a('0x2'));var moment=require(_0x321a('0x3'));var BPromise=require(_0x321a('0x4'));var rp=require(_0x321a('0x5'));var fs=require('fs');var path=require(_0x321a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x321a('0x7'));module[_0x321a('0x8')]=function(_0x467682,_0x28e166){return _0x467682['define'](_0x321a('0x9'),attributes,{'tableName':_0x321a('0xa'),'paranoid':![],'indexes':[{'name':_0x321a('0xb'),'fields':[_0x321a('0xb')]},{'name':_0x321a('0xc'),'fields':[_0x321a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0b40=['define','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x0b40,0xba));var _0x00b4=function(_0x10dc64,_0x11bb29){_0x10dc64=_0x10dc64-0x0;var _0x9cf98d=_0x0b40[_0x10dc64];return _0x9cf98d;};'use strict';var _=require('lodash');var util=require(_0x00b4('0x0'));var logger=require(_0x00b4('0x1'))('api');var moment=require(_0x00b4('0x2'));var BPromise=require(_0x00b4('0x3'));var rp=require(_0x00b4('0x4'));var fs=require('fs');var path=require(_0x00b4('0x5'));var rimraf=require(_0x00b4('0x6'));var config=require(_0x00b4('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x00b4('0x8')]=function(_0xbcf545,_0x2c44d1){return _0xbcf545[_0x00b4('0x9')]('CmHopperFinal',attributes,{'tableName':_0x00b4('0xa'),'paranoid':![],'indexes':[{'name':_0x00b4('0xb'),'fields':[_0x00b4('0xb')]},{'name':'uniqueid','fields':[_0x00b4('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 4b3ea96..5706f56 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 _0x76da=['options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperFinal','CmHopperFinal','body'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x76da,0x15e));var _0xa76d=function(_0x5edda5,_0x1bd2be){_0x5edda5=_0x5edda5-0x0;var _0x5d2737=_0x76da[_0x5edda5];return _0x5d2737;};'use strict';var _=require(_0xa76d('0x0'));var util=require('util');var moment=require(_0xa76d('0x1'));var BPromise=require(_0xa76d('0x2'));var rs=require(_0xa76d('0x3'));var fs=require('fs');var Redis=require(_0xa76d('0x4'));var db=require(_0xa76d('0x5'))['db'];var utils=require(_0xa76d('0x6'));var logger=require('../../config/logger')(_0xa76d('0x7'));var config=require('../../config/environment');var jayson=require(_0xa76d('0x8'));var client=jayson[_0xa76d('0x9')][_0xa76d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1019e3,_0x472e2a,_0x128cdd){return new BPromise(function(_0x376454,_0x4e18f1){return client[_0xa76d('0xb')](_0x1019e3,_0x128cdd)[_0xa76d('0xc')](function(_0x7a17ab){logger[_0xa76d('0xd')](_0xa76d('0xe'),_0x472e2a,'request\x20sent');logger[_0xa76d('0xf')](_0xa76d('0x10'),_0x472e2a,_0xa76d('0x11'),JSON[_0xa76d('0x12')](_0x7a17ab));if(_0x7a17ab[_0xa76d('0x13')]){if(_0x7a17ab[_0xa76d('0x13')][_0xa76d('0x14')]===0x1f4){logger[_0xa76d('0x13')](_0xa76d('0xe'),_0x472e2a,_0x7a17ab[_0xa76d('0x13')][_0xa76d('0x15')]);return _0x4e18f1(_0x7a17ab['error'][_0xa76d('0x15')]);}logger[_0xa76d('0x13')](_0xa76d('0xe'),_0x472e2a,_0x7a17ab[_0xa76d('0x13')][_0xa76d('0x15')]);return _0x376454(_0x7a17ab[_0xa76d('0x13')][_0xa76d('0x15')]);}else{logger[_0xa76d('0xd')]('CmHopperFinal,\x20%s,\x20%s',_0x472e2a,'request\x20sent');_0x376454(_0x7a17ab[_0xa76d('0x16')][_0xa76d('0x15')]);}})[_0xa76d('0x17')](function(_0x15832a){logger[_0xa76d('0x13')](_0xa76d('0xe'),_0x472e2a,_0x15832a);_0x4e18f1(_0x15832a);});});}exports[_0xa76d('0x18')]=function(_0x51ddfd){var _0x23faf3=this;return new Promise(function(_0x491514,_0xfdcf2d){return db[_0xa76d('0x19')]['create'](_0x51ddfd[_0xa76d('0x1a')],{'raw':_0x51ddfd[_0xa76d('0x1b')]?_0x51ddfd['options'][_0xa76d('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3bc5ee){logger[_0xa76d('0xd')]('CreateCmHopperFinal',_0x51ddfd);logger[_0xa76d('0xf')](_0xa76d('0x18'),_0x51ddfd,JSON['stringify'](_0x3bc5ee));_0x491514(_0x3bc5ee);})[_0xa76d('0x17')](function(_0x2162a0){logger[_0xa76d('0x13')](_0xa76d('0x18'),_0x2162a0[_0xa76d('0x15')],_0x51ddfd);_0xfdcf2d(_0x23faf3[_0xa76d('0x13')](0x1f4,_0x2162a0[_0xa76d('0x15')]));});});}; \ No newline at end of file +var _0xdfc5=['error','code','message','result','catch','CmHopperFinal','create','body','options','then','CreateCmHopperFinal','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x43c0ab,_0x4fc9e2){var _0x523745=function(_0x42b0bc){while(--_0x42b0bc){_0x43c0ab['push'](_0x43c0ab['shift']());}};_0x523745(++_0x4fc9e2);}(_0xdfc5,0x136));var _0x5dfc=function(_0x2949fa,_0x2fd36b){_0x2949fa=_0x2949fa-0x0;var _0x2501b1=_0xdfc5[_0x2949fa];return _0x2501b1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5dfc('0x0'));var BPromise=require('bluebird');var rs=require(_0x5dfc('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5dfc('0x2'));var logger=require('../../config/logger')(_0x5dfc('0x3'));var config=require(_0x5dfc('0x4'));var jayson=require(_0x5dfc('0x5'));var client=jayson[_0x5dfc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f0b0e,_0x148948,_0x1147c0){return new BPromise(function(_0x1e738a,_0x9b2129){return client[_0x5dfc('0x7')](_0x1f0b0e,_0x1147c0)['then'](function(_0x12ad8c){logger[_0x5dfc('0x8')](_0x5dfc('0x9'),_0x148948,_0x5dfc('0xa'));logger['debug']('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x148948,_0x5dfc('0xa'),JSON[_0x5dfc('0xb')](_0x12ad8c));if(_0x12ad8c[_0x5dfc('0xc')]){if(_0x12ad8c[_0x5dfc('0xc')][_0x5dfc('0xd')]===0x1f4){logger['error'](_0x5dfc('0x9'),_0x148948,_0x12ad8c['error']['message']);return _0x9b2129(_0x12ad8c['error']['message']);}logger[_0x5dfc('0xc')]('CmHopperFinal,\x20%s,\x20%s',_0x148948,_0x12ad8c[_0x5dfc('0xc')][_0x5dfc('0xe')]);return _0x1e738a(_0x12ad8c[_0x5dfc('0xc')][_0x5dfc('0xe')]);}else{logger[_0x5dfc('0x8')](_0x5dfc('0x9'),_0x148948,_0x5dfc('0xa'));_0x1e738a(_0x12ad8c[_0x5dfc('0xf')][_0x5dfc('0xe')]);}})[_0x5dfc('0x10')](function(_0x1a27ac){logger[_0x5dfc('0xc')]('CmHopperFinal,\x20%s,\x20%s',_0x148948,_0x1a27ac);_0x9b2129(_0x1a27ac);});});}exports['CreateCmHopperFinal']=function(_0x262f46){var _0xc4f157=this;return new Promise(function(_0x36f770,_0x23daad){return db[_0x5dfc('0x11')][_0x5dfc('0x12')](_0x262f46[_0x5dfc('0x13')],{'raw':_0x262f46[_0x5dfc('0x14')]?_0x262f46['options']['raw']===undefined?!![]:![]:!![]})[_0x5dfc('0x15')](function(_0x4a2578){logger[_0x5dfc('0x8')](_0x5dfc('0x16'),_0x262f46);logger['debug'](_0x5dfc('0x16'),_0x262f46,JSON[_0x5dfc('0xb')](_0x4a2578));_0x36f770(_0x4a2578);})[_0x5dfc('0x10')](function(_0x55bd36){logger[_0x5dfc('0xc')](_0x5dfc('0x16'),_0x55bd36[_0x5dfc('0xe')],_0x262f46);_0x23daad(_0xc4f157['error'](0x1f4,_0x55bd36[_0x5dfc('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 6c88790..082e22d 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 _0xa4ab=['post','moveContactsIvrCampaignHopperFinal','checkContactHopper','put','update','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','get','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal'];(function(_0x2657f7,_0x15c229){var _0x6d956=function(_0x2cb0cf){while(--_0x2cb0cf){_0x2657f7['push'](_0x2657f7['shift']());}};_0x6d956(++_0x15c229);}(_0xa4ab,0xad));var _0xba4a=function(_0x5d23be,_0x3b4f3c){_0x5d23be=_0x5d23be-0x0;var _0x4d60a9=_0xa4ab[_0x5d23be];return _0x4d60a9;};'use strict';var multer=require(_0xba4a('0x0'));var util=require('util');var path=require(_0xba4a('0x1'));var timeout=require(_0xba4a('0x2'));var express=require('express');var router=express[_0xba4a('0x3')]();var auth=require(_0xba4a('0x4'));var interaction=require(_0xba4a('0x5'));var config=require('../../config/environment');var controller=require(_0xba4a('0x6'));router['get']('/',auth[_0xba4a('0x7')](),controller['index']);router[_0xba4a('0x8')](_0xba4a('0x9'),auth[_0xba4a('0x7')](),controller[_0xba4a('0xa')]);router['get'](_0xba4a('0xb'),auth[_0xba4a('0x7')](),controller[_0xba4a('0xc')]);router[_0xba4a('0x8')](_0xba4a('0xd'),auth[_0xba4a('0x7')](),controller[_0xba4a('0xe')]);router['get'](_0xba4a('0xf'),auth[_0xba4a('0x7')](),controller[_0xba4a('0x10')]);router['post'](_0xba4a('0x11'),auth[_0xba4a('0x7')](),controller[_0xba4a('0x12')]);router[_0xba4a('0x13')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0xba4a('0x14')]);router[_0xba4a('0x13')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0xba4a('0x15')]);router[_0xba4a('0x16')](_0xba4a('0xb'),auth[_0xba4a('0x7')](),controller[_0xba4a('0x17')]);module['exports']=router; \ No newline at end of file +var _0x3513=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','describe','get','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','exports','multer','util','connect-timeout','express'];(function(_0x59c54c,_0x56fa47){var _0x3068d8=function(_0x599e76){while(--_0x599e76){_0x59c54c['push'](_0x59c54c['shift']());}};_0x3068d8(++_0x56fa47);}(_0x3513,0x183));var _0x3351=function(_0x18381f,_0x641a6e){_0x18381f=_0x18381f-0x0;var _0x2a8fe0=_0x3513[_0x18381f];return _0x2a8fe0;};'use strict';var multer=require(_0x3351('0x0'));var util=require(_0x3351('0x1'));var path=require('path');var timeout=require(_0x3351('0x2'));var express=require(_0x3351('0x3'));var router=express[_0x3351('0x4')]();var auth=require(_0x3351('0x5'));var interaction=require(_0x3351('0x6'));var config=require(_0x3351('0x7'));var controller=require(_0x3351('0x8'));router['get']('/',auth[_0x3351('0x9')](),controller[_0x3351('0xa')]);router['get']('/describe',auth[_0x3351('0x9')](),controller[_0x3351('0xb')]);router[_0x3351('0xc')](_0x3351('0xd'),auth[_0x3351('0x9')](),controller['show']);router['get'](_0x3351('0xe'),auth['isAuthenticated'](),controller[_0x3351('0xf')]);router['get'](_0x3351('0x10'),auth[_0x3351('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0x3351('0x11')](_0x3351('0x12'),auth[_0x3351('0x9')](),controller['moveContactsQueueCampaignHopperFinal']);router['post']('/voice/campaign/moveContacts/:id',auth[_0x3351('0x9')](),controller[_0x3351('0x13')]);router['post']('/checkContactHopper',auth[_0x3351('0x9')](),controller[_0x3351('0x14')]);router['put'](_0x3351('0xd'),auth['isAuthenticated'](),controller[_0x3351('0x15')]);module[_0x3351('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 057221d..d09f02d 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 _0x83d9=['DATE','INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x1660ba,_0x5eb251){var _0x336626=function(_0x27fdfd){while(--_0x27fdfd){_0x1660ba['push'](_0x1660ba['shift']());}};_0x336626(++_0x5eb251);}(_0x83d9,0xc3));var _0x983d=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x83d9[_0x50007c];return _0x5c1ec7;};'use strict';var Sequelize=require(_0x983d('0x0'));module[_0x983d('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x983d('0x2')]},'scheduledat':{'type':Sequelize[_0x983d('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x983d('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x983d('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x983d('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x983d('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x983d('0x2')]},'calleridname':{'type':Sequelize[_0x983d('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x983d('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x983d('0x3')]},'endtime':{'type':Sequelize[_0x983d('0x3')]},'ringtime':{'type':Sequelize[_0x983d('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x983d('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x983d('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x983d('0x2')]},'campaign':{'type':Sequelize[_0x983d('0x2')]},'campaigntype':{'type':Sequelize[_0x983d('0x2')]},'membername':{'type':Sequelize[_0x983d('0x2')]},'reason':{'type':Sequelize[_0x983d('0x2')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x983d('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x983d('0x3')]},'recallme':{'type':Sequelize[_0x983d('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x983d('0x3')]},'edited':{'type':Sequelize[_0x983d('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x983d('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x983d('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x983d('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x983d('0x2')]}}; \ No newline at end of file +var _0xc336=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x1ca89e,_0x32f5ef){var _0x32275f=function(_0x3d5003){while(--_0x3d5003){_0x1ca89e['push'](_0x1ca89e['shift']());}};_0x32275f(++_0x32f5ef);}(_0xc336,0xf0));var _0x6c33=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xc336[_0x5c3c0b];return _0x52ecd2;};'use strict';var Sequelize=require(_0x6c33('0x0'));module[_0x6c33('0x1')]={'state':{'type':Sequelize[_0x6c33('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x6c33('0x3')]},'scheduledat':{'type':Sequelize[_0x6c33('0x4')]},'countbusyretry':{'type':Sequelize[_0x6c33('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6c33('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6c33('0x3')]},'originatecalleridnum':{'type':Sequelize[_0x6c33('0x3')]},'originatecalleridname':{'type':Sequelize[_0x6c33('0x3')]},'calleridnum':{'type':Sequelize[_0x6c33('0x3')]},'calleridname':{'type':Sequelize[_0x6c33('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x6c33('0x4')]},'answertime':{'type':Sequelize[_0x6c33('0x4')]},'droptime':{'type':Sequelize[_0x6c33('0x4')]},'endtime':{'type':Sequelize[_0x6c33('0x4')]},'ringtime':{'type':Sequelize[_0x6c33('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6c33('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6c33('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6c33('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x6c33('0x3')]},'membername':{'type':Sequelize[_0x6c33('0x3')]},'reason':{'type':Sequelize[_0x6c33('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x6c33('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x6c33('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6c33('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6c33('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0x6c33('0x4')]},'edited':{'type':Sequelize[_0x6c33('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x6c33('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6c33('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6c33('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6c33('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 7dc6d7f..ac197f7 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 _0x4704=['limit','set','Content-Range','apply','reject','update','then','stack','name','send','index','CmHopperHistory','fieldName','type','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x2c174c,_0x85e23b){var _0x5a9871=function(_0x4e0edc){while(--_0x4e0edc){_0x2c174c['push'](_0x2c174c['shift']());}};_0x5a9871(++_0x85e23b);}(_0x4704,0x105));var _0x4470=function(_0x354bd6,_0x4a7c74){_0x354bd6=_0x354bd6-0x0;var _0x39bf52=_0x4704[_0x354bd6];return _0x39bf52;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4470('0x0'));var rimraf=require(_0x4470('0x1'));var zipdir=require(_0x4470('0x2'));var jsonpatch=require(_0x4470('0x3'));var rp=require(_0x4470('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4470('0x5'));var util=require('util');var path=require(_0x4470('0x6'));var sox=require(_0x4470('0x7'));var csv=require(_0x4470('0x8'));var ejs=require(_0x4470('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4470('0xa'));var crypto=require(_0x4470('0xb'));var jsforce=require(_0x4470('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4470('0x8'));var querystring=require(_0x4470('0xd'));var Papa=require(_0x4470('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4470('0xf'));var as=require(_0x4470('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4470('0x11'))(_0x4470('0x12'));var utils=require(_0x4470('0x13'));var config=require(_0x4470('0x14'));var db=require(_0x4470('0x15'))['db'];function respondWithStatusCode(_0x3465ee,_0x3a3ec7){_0x3a3ec7=_0x3a3ec7||0xcc;return function(_0x1ff307){if(_0x1ff307){return _0x3465ee[_0x4470('0x16')](_0x3a3ec7);}return _0x3465ee[_0x4470('0x17')](_0x3a3ec7)[_0x4470('0x18')]();};}function respondWithResult(_0x3604ba,_0x27ab63){_0x27ab63=_0x27ab63||0xc8;return function(_0x3b4c41){if(_0x3b4c41){return _0x3604ba[_0x4470('0x17')](_0x27ab63)[_0x4470('0x19')](_0x3b4c41);}};}function respondWithFilteredResult(_0x1d9607,_0x3a8862){return function(_0x3a2008){if(_0x3a2008){var _0xb4ef16=_0x3a2008['count'],_0x48979a=_0x3a8862[_0x4470('0x1a')],_0xe97e9b=_0x3a8862['offset']+_0x3a8862[_0x4470('0x1b')],_0x13474e;if(_0xe97e9b>=_0xb4ef16){_0xe97e9b=_0xb4ef16;_0x13474e=0xc8;}else{_0x13474e=0xce;}_0x1d9607[_0x4470('0x17')](_0x13474e);return _0x1d9607[_0x4470('0x1c')](_0x4470('0x1d'),_0x48979a+'-'+_0xe97e9b+'/'+_0xb4ef16)[_0x4470('0x19')](_0x3a2008);}return null;};}function patchUpdates(_0x4e27bf){return function(_0x2d3424){try{jsonpatch[_0x4470('0x1e')](_0x2d3424,_0x4e27bf,!![]);}catch(_0x647caf){return BPromise[_0x4470('0x1f')](_0x647caf);}return _0x2d3424['save']();};}function saveUpdates(_0x3e556f,_0x2a37e6){return function(_0x2cf145){if(_0x2cf145){return _0x2cf145[_0x4470('0x20')](_0x3e556f)[_0x4470('0x21')](function(_0x1f2436){return _0x1f2436;});}return null;};}function removeEntity(_0x4ec6f7,_0x8e9fdc){return function(_0x134d31){if(_0x134d31){return _0x134d31['destroy']()[_0x4470('0x21')](function(){_0x4ec6f7[_0x4470('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2abcfd,_0x255989){return function(_0x98dcd5){if(!_0x98dcd5){_0x2abcfd[_0x4470('0x16')](0x194);}return _0x98dcd5;};}function handleError(_0x15ee74,_0x198e25){_0x198e25=_0x198e25||0x1f4;return function(_0xf97175){logger['error'](_0xf97175[_0x4470('0x22')]);if(_0xf97175['name']){delete _0xf97175[_0x4470('0x23')];}_0x15ee74[_0x4470('0x17')](_0x198e25)[_0x4470('0x24')](_0xf97175);};}exports[_0x4470('0x25')]=function(_0x42c021,_0x6372f5){var _0x4d8042={},_0x547813={},_0x438113={'count':0x0,'rows':[]};var _0x55763b=_['map'](db[_0x4470('0x26')]['rawAttributes'],function(_0x2c8e42){return{'name':_0x2c8e42[_0x4470('0x27')],'type':_0x2c8e42[_0x4470('0x28')]['key']};});_0x547813[_0x4470('0x29')]=_[_0x4470('0x2a')](_0x55763b,_0x4470('0x23'));_0x547813[_0x4470('0x2b')]=_['keys'](_0x42c021[_0x4470('0x2b')]);_0x547813['filters']=_[_0x4470('0x2c')](_0x547813[_0x4470('0x29')],_0x547813['query']);_0x4d8042[_0x4470('0x2d')]=_['intersection'](_0x547813[_0x4470('0x29')],qs[_0x4470('0x2e')](_0x42c021[_0x4470('0x2b')][_0x4470('0x2e')]));_0x4d8042[_0x4470('0x2d')]=_0x4d8042[_0x4470('0x2d')][_0x4470('0x2f')]?_0x4d8042[_0x4470('0x2d')]:_0x547813[_0x4470('0x29')];if(!_0x42c021[_0x4470('0x2b')][_0x4470('0x30')](_0x4470('0x31'))){_0x4d8042[_0x4470('0x1b')]=qs['limit'](_0x42c021[_0x4470('0x2b')][_0x4470('0x1b')]);_0x4d8042['offset']=qs[_0x4470('0x1a')](_0x42c021[_0x4470('0x2b')][_0x4470('0x1a')]);}_0x4d8042[_0x4470('0x32')]=qs[_0x4470('0x33')](_0x42c021[_0x4470('0x2b')][_0x4470('0x33')]);_0x4d8042[_0x4470('0x34')]=qs[_0x4470('0x35')](_[_0x4470('0x36')](_0x42c021[_0x4470('0x2b')],_0x547813[_0x4470('0x35')]),_0x55763b);if(_0x42c021['query']['filter']){_0x4d8042[_0x4470('0x34')]=_[_0x4470('0x37')](_0x4d8042[_0x4470('0x34')],{'$or':_[_0x4470('0x2a')](_0x55763b,function(_0x15e2b6){if(_0x15e2b6['type']!==_0x4470('0x38')){var _0xb17f81={};_0xb17f81[_0x15e2b6['name']]={'$like':'%'+_0x42c021[_0x4470('0x2b')][_0x4470('0x39')]+'%'};return _0xb17f81;}})});}_0x4d8042=_[_0x4470('0x37')]({},_0x4d8042,_0x42c021[_0x4470('0x3a')]);var _0x31a331={'where':_0x4d8042[_0x4470('0x34')]};return db[_0x4470('0x26')][_0x4470('0x3b')](_0x31a331)['then'](function(_0x47e224){_0x438113['count']=_0x47e224;if(_0x42c021['query'][_0x4470('0x3c')]){_0x4d8042[_0x4470('0x3d')]=[{'all':!![]}];}return db[_0x4470('0x26')][_0x4470('0x3e')](_0x4d8042);})['then'](function(_0x3518e2){_0x438113[_0x4470('0x3f')]=_0x3518e2;return _0x438113;})['then'](respondWithFilteredResult(_0x6372f5,_0x4d8042))[_0x4470('0x40')](handleError(_0x6372f5,null));};exports[_0x4470('0x41')]=function(_0x2d6fee,_0x2d78dd){var _0x602987={'raw':!![],'where':{'id':_0x2d6fee[_0x4470('0x42')]['id']}},_0xbd8456={};_0xbd8456[_0x4470('0x29')]=_[_0x4470('0x43')](db[_0x4470('0x26')]['rawAttributes']);_0xbd8456[_0x4470('0x2b')]=_['keys'](_0x2d6fee['query']);_0xbd8456[_0x4470('0x35')]=_[_0x4470('0x2c')](_0xbd8456[_0x4470('0x29')],_0xbd8456[_0x4470('0x2b')]);_0x602987[_0x4470('0x2d')]=_[_0x4470('0x2c')](_0xbd8456[_0x4470('0x29')],qs[_0x4470('0x2e')](_0x2d6fee[_0x4470('0x2b')][_0x4470('0x2e')]));_0x602987['attributes']=_0x602987[_0x4470('0x2d')]['length']?_0x602987[_0x4470('0x2d')]:_0xbd8456[_0x4470('0x29')];if(_0x2d6fee[_0x4470('0x2b')][_0x4470('0x3c')]){_0x602987[_0x4470('0x3d')]=[{'all':!![]}];}_0x602987=_[_0x4470('0x37')]({},_0x602987,_0x2d6fee['options']);return db[_0x4470('0x26')][_0x4470('0x44')](_0x602987)[_0x4470('0x21')](handleEntityNotFound(_0x2d78dd,null))[_0x4470('0x21')](respondWithResult(_0x2d78dd,null))[_0x4470('0x40')](handleError(_0x2d78dd,null));};exports['create']=function(_0x2e6645,_0x4a2905){return db[_0x4470('0x26')][_0x4470('0x45')](_0x2e6645[_0x4470('0x46')],{})[_0x4470('0x21')](respondWithResult(_0x4a2905,0xc9))[_0x4470('0x40')](handleError(_0x4a2905,null));};exports[_0x4470('0x47')]=function(_0x136598,_0x2a706b){return db['CmHopperHistory'][_0x4470('0x47')]()[_0x4470('0x21')](respondWithResult(_0x2a706b,null))[_0x4470('0x40')](handleError(_0x2a706b,null));};exports[_0x4470('0x20')]=function(_0x61f772,_0x57c94c){if(_0x61f772['body']['uniqueid']){delete _0x61f772[_0x4470('0x46')]['uniqueid'];}return db[_0x4470('0x26')][_0x4470('0x44')]({'where':{'uniqueid':_0x61f772[_0x4470('0x42')]['id']}})[_0x4470('0x21')](handleEntityNotFound(_0x57c94c,null))[_0x4470('0x21')](saveUpdates(_0x61f772[_0x4470('0x46')],null))['then'](respondWithResult(_0x57c94c,null))[_0x4470('0x40')](handleError(_0x57c94c,null));}; \ No newline at end of file +var _0x9bcf=['model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','CmHopperHistory','count','includeAll','include','findAll','catch','show','params','find','create','body','describe','uniqueid','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','rawAttributes','fieldName','type'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x9bcf,0xb5));var _0xf9bc=function(_0x3e459f,_0x5d3dbb){_0x3e459f=_0x3e459f-0x0;var _0x2abcf6=_0x9bcf[_0x3e459f];return _0x2abcf6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xf9bc('0x0'));var zipdir=require(_0xf9bc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf9bc('0x2'));var moment=require(_0xf9bc('0x3'));var BPromise=require(_0xf9bc('0x4'));var Mustache=require(_0xf9bc('0x5'));var util=require(_0xf9bc('0x6'));var path=require(_0xf9bc('0x7'));var sox=require(_0xf9bc('0x8'));var csv=require(_0xf9bc('0x9'));var ejs=require(_0xf9bc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf9bc('0xb'));var crypto=require(_0xf9bc('0xc'));var jsforce=require(_0xf9bc('0xd'));var deskjs=require(_0xf9bc('0xe'));var toCsv=require(_0xf9bc('0x9'));var querystring=require(_0xf9bc('0xf'));var Papa=require(_0xf9bc('0x10'));var Redis=require(_0xf9bc('0x11'));var authService=require(_0xf9bc('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf9bc('0x13'));var logger=require(_0xf9bc('0x14'))(_0xf9bc('0x15'));var utils=require(_0xf9bc('0x16'));var config=require('../../config/environment');var db=require(_0xf9bc('0x17'))['db'];function respondWithStatusCode(_0x4fa005,_0x224082){_0x224082=_0x224082||0xcc;return function(_0x31cb11){if(_0x31cb11){return _0x4fa005[_0xf9bc('0x18')](_0x224082);}return _0x4fa005[_0xf9bc('0x19')](_0x224082)[_0xf9bc('0x1a')]();};}function respondWithResult(_0x446339,_0x408039){_0x408039=_0x408039||0xc8;return function(_0x3c3000){if(_0x3c3000){return _0x446339[_0xf9bc('0x19')](_0x408039)[_0xf9bc('0x1b')](_0x3c3000);}};}function respondWithFilteredResult(_0x2cd92d,_0x3a5df1){return function(_0x382673){if(_0x382673){var _0x58c7f8=_0x382673['count'],_0x489c7b=_0x3a5df1['offset'],_0x3ac688=_0x3a5df1[_0xf9bc('0x1c')]+_0x3a5df1['limit'],_0x25ae86;if(_0x3ac688>=_0x58c7f8){_0x3ac688=_0x58c7f8;_0x25ae86=0xc8;}else{_0x25ae86=0xce;}_0x2cd92d[_0xf9bc('0x19')](_0x25ae86);return _0x2cd92d[_0xf9bc('0x1d')](_0xf9bc('0x1e'),_0x489c7b+'-'+_0x3ac688+'/'+_0x58c7f8)['json'](_0x382673);}return null;};}function patchUpdates(_0x326cfd){return function(_0x144646){try{jsonpatch[_0xf9bc('0x1f')](_0x144646,_0x326cfd,!![]);}catch(_0x22df3b){return BPromise[_0xf9bc('0x20')](_0x22df3b);}return _0x144646[_0xf9bc('0x21')]();};}function saveUpdates(_0x40903a,_0x2f84af){return function(_0x4e48d8){if(_0x4e48d8){return _0x4e48d8[_0xf9bc('0x22')](_0x40903a)[_0xf9bc('0x23')](function(_0x37df2c){return _0x37df2c;});}return null;};}function removeEntity(_0x14cd99,_0x2ec211){return function(_0x519bd1){if(_0x519bd1){return _0x519bd1['destroy']()[_0xf9bc('0x23')](function(){_0x14cd99['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x232331,_0x4a9309){return function(_0x4d4e07){if(!_0x4d4e07){_0x232331[_0xf9bc('0x18')](0x194);}return _0x4d4e07;};}function handleError(_0x119b05,_0x13a44a){_0x13a44a=_0x13a44a||0x1f4;return function(_0x3cd89d){logger[_0xf9bc('0x24')](_0x3cd89d[_0xf9bc('0x25')]);if(_0x3cd89d[_0xf9bc('0x26')]){delete _0x3cd89d['name'];}_0x119b05[_0xf9bc('0x19')](_0x13a44a)[_0xf9bc('0x27')](_0x3cd89d);};}exports[_0xf9bc('0x28')]=function(_0x40f006,_0x59fa28){var _0x1e8401={},_0x429e61={},_0x32a48e={'count':0x0,'rows':[]};var _0x33ba21=_['map'](db['CmHopperHistory'][_0xf9bc('0x29')],function(_0x2c93c6){return{'name':_0x2c93c6[_0xf9bc('0x2a')],'type':_0x2c93c6[_0xf9bc('0x2b')]['key']};});_0x429e61[_0xf9bc('0x2c')]=_[_0xf9bc('0x2d')](_0x33ba21,_0xf9bc('0x26'));_0x429e61['query']=_[_0xf9bc('0x2e')](_0x40f006[_0xf9bc('0x2f')]);_0x429e61[_0xf9bc('0x30')]=_[_0xf9bc('0x31')](_0x429e61[_0xf9bc('0x2c')],_0x429e61[_0xf9bc('0x2f')]);_0x1e8401[_0xf9bc('0x32')]=_[_0xf9bc('0x31')](_0x429e61[_0xf9bc('0x2c')],qs['fields'](_0x40f006[_0xf9bc('0x2f')]['fields']));_0x1e8401['attributes']=_0x1e8401[_0xf9bc('0x32')][_0xf9bc('0x33')]?_0x1e8401[_0xf9bc('0x32')]:_0x429e61['model'];if(!_0x40f006[_0xf9bc('0x2f')][_0xf9bc('0x34')](_0xf9bc('0x35'))){_0x1e8401['limit']=qs[_0xf9bc('0x36')](_0x40f006[_0xf9bc('0x2f')][_0xf9bc('0x36')]);_0x1e8401[_0xf9bc('0x1c')]=qs[_0xf9bc('0x1c')](_0x40f006[_0xf9bc('0x2f')][_0xf9bc('0x1c')]);}_0x1e8401[_0xf9bc('0x37')]=qs[_0xf9bc('0x38')](_0x40f006['query'][_0xf9bc('0x38')]);_0x1e8401[_0xf9bc('0x39')]=qs['filters'](_[_0xf9bc('0x3a')](_0x40f006[_0xf9bc('0x2f')],_0x429e61['filters']),_0x33ba21);if(_0x40f006[_0xf9bc('0x2f')][_0xf9bc('0x3b')]){_0x1e8401[_0xf9bc('0x39')]=_[_0xf9bc('0x3c')](_0x1e8401[_0xf9bc('0x39')],{'$or':_[_0xf9bc('0x2d')](_0x33ba21,function(_0x59b425){if(_0x59b425['type']!=='VIRTUAL'){var _0x5cdf0f={};_0x5cdf0f[_0x59b425['name']]={'$like':'%'+_0x40f006[_0xf9bc('0x2f')][_0xf9bc('0x3b')]+'%'};return _0x5cdf0f;}})});}_0x1e8401=_[_0xf9bc('0x3c')]({},_0x1e8401,_0x40f006[_0xf9bc('0x3d')]);var _0x4cb1a9={'where':_0x1e8401[_0xf9bc('0x39')]};return db[_0xf9bc('0x3e')][_0xf9bc('0x3f')](_0x4cb1a9)['then'](function(_0xf4d4a2){_0x32a48e[_0xf9bc('0x3f')]=_0xf4d4a2;if(_0x40f006[_0xf9bc('0x2f')][_0xf9bc('0x40')]){_0x1e8401[_0xf9bc('0x41')]=[{'all':!![]}];}return db[_0xf9bc('0x3e')][_0xf9bc('0x42')](_0x1e8401);})['then'](function(_0x4ff92e){_0x32a48e['rows']=_0x4ff92e;return _0x32a48e;})[_0xf9bc('0x23')](respondWithFilteredResult(_0x59fa28,_0x1e8401))[_0xf9bc('0x43')](handleError(_0x59fa28,null));};exports[_0xf9bc('0x44')]=function(_0x207f71,_0x277a97){var _0x4072a1={'raw':!![],'where':{'id':_0x207f71[_0xf9bc('0x45')]['id']}},_0x1aa760={};_0x1aa760[_0xf9bc('0x2c')]=_[_0xf9bc('0x2e')](db[_0xf9bc('0x3e')][_0xf9bc('0x29')]);_0x1aa760[_0xf9bc('0x2f')]=_[_0xf9bc('0x2e')](_0x207f71[_0xf9bc('0x2f')]);_0x1aa760['filters']=_[_0xf9bc('0x31')](_0x1aa760[_0xf9bc('0x2c')],_0x1aa760[_0xf9bc('0x2f')]);_0x4072a1[_0xf9bc('0x32')]=_['intersection'](_0x1aa760[_0xf9bc('0x2c')],qs['fields'](_0x207f71['query']['fields']));_0x4072a1[_0xf9bc('0x32')]=_0x4072a1[_0xf9bc('0x32')][_0xf9bc('0x33')]?_0x4072a1[_0xf9bc('0x32')]:_0x1aa760['model'];if(_0x207f71[_0xf9bc('0x2f')][_0xf9bc('0x40')]){_0x4072a1[_0xf9bc('0x41')]=[{'all':!![]}];}_0x4072a1=_[_0xf9bc('0x3c')]({},_0x4072a1,_0x207f71[_0xf9bc('0x3d')]);return db[_0xf9bc('0x3e')][_0xf9bc('0x46')](_0x4072a1)['then'](handleEntityNotFound(_0x277a97,null))[_0xf9bc('0x23')](respondWithResult(_0x277a97,null))['catch'](handleError(_0x277a97,null));};exports['create']=function(_0x517f4b,_0x302428){return db[_0xf9bc('0x3e')][_0xf9bc('0x47')](_0x517f4b[_0xf9bc('0x48')],{})[_0xf9bc('0x23')](respondWithResult(_0x302428,0xc9))[_0xf9bc('0x43')](handleError(_0x302428,null));};exports[_0xf9bc('0x49')]=function(_0x40acc2,_0x219401){return db[_0xf9bc('0x3e')][_0xf9bc('0x49')]()[_0xf9bc('0x23')](respondWithResult(_0x219401,null))[_0xf9bc('0x43')](handleError(_0x219401,null));};exports[_0xf9bc('0x22')]=function(_0x362652,_0x121a28){if(_0x362652['body'][_0xf9bc('0x4a')]){delete _0x362652['body'][_0xf9bc('0x4a')];}return db[_0xf9bc('0x3e')][_0xf9bc('0x46')]({'where':{'uniqueid':_0x362652[_0xf9bc('0x45')]['id']}})[_0xf9bc('0x23')](handleEntityNotFound(_0x121a28,null))[_0xf9bc('0x23')](saveUpdates(_0x362652[_0xf9bc('0x48')],null))[_0xf9bc('0x23')](respondWithResult(_0x121a28,null))[_0xf9bc('0x43')](handleError(_0x121a28,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index b0e1df4..487f16b 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 _0xfe1f=['exports','define','CmHopperHistory','cm_hopper_history','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x552804,_0x3c3d1e){var _0x32be66=function(_0x14c213){while(--_0x14c213){_0x552804['push'](_0x552804['shift']());}};_0x32be66(++_0x3c3d1e);}(_0xfe1f,0x131));var _0xffe1=function(_0x2a7b8e,_0x50ffce){_0x2a7b8e=_0x2a7b8e-0x0;var _0x29b5c8=_0xfe1f[_0x2a7b8e];return _0x29b5c8;};'use strict';var _=require(_0xffe1('0x0'));var util=require(_0xffe1('0x1'));var logger=require(_0xffe1('0x2'))(_0xffe1('0x3'));var moment=require(_0xffe1('0x4'));var BPromise=require(_0xffe1('0x5'));var rp=require(_0xffe1('0x6'));var fs=require('fs');var path=require(_0xffe1('0x7'));var rimraf=require(_0xffe1('0x8'));var config=require(_0xffe1('0x9'));var attributes=require('./cmHopperHistory.attributes');module[_0xffe1('0xa')]=function(_0x19d4b8,_0x3551ce){return _0x19d4b8[_0xffe1('0xb')](_0xffe1('0xc'),attributes,{'tableName':_0xffe1('0xd'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0xffe1('0xe'),'fields':[_0xffe1('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3b73=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./cmHopperHistory.attributes','exports','cm_hopper_history','endtime'];(function(_0x45847c,_0x4a954a){var _0x506c9d=function(_0xe4409){while(--_0xe4409){_0x45847c['push'](_0x45847c['shift']());}};_0x506c9d(++_0x4a954a);}(_0x3b73,0xeb));var _0x33b7=function(_0xd1a86e,_0x35850c){_0xd1a86e=_0xd1a86e-0x0;var _0x5c54c1=_0x3b73[_0xd1a86e];return _0x5c54c1;};'use strict';var _=require(_0x33b7('0x0'));var util=require(_0x33b7('0x1'));var logger=require(_0x33b7('0x2'))(_0x33b7('0x3'));var moment=require(_0x33b7('0x4'));var BPromise=require(_0x33b7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x33b7('0x6'));var rimraf=require(_0x33b7('0x7'));var config=require('../../config/environment');var attributes=require(_0x33b7('0x8'));module[_0x33b7('0x9')]=function(_0x332b1b,_0x25aacf){return _0x332b1b['define']('CmHopperHistory',attributes,{'tableName':_0x33b7('0xa'),'paranoid':![],'indexes':[{'name':_0x33b7('0xb'),'fields':[_0x33b7('0xb')]},{'name':_0x33b7('0xc'),'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 f9321c8..c3a63f3 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 _0xee5b=['where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','catch','GetVoiceQueueHopperHistory','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrAnswerCallsDay','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xee5b,0x1f4));var _0xbee5=function(_0x5ecc02,_0x3190de){_0x5ecc02=_0x5ecc02-0x0;var _0x206cbf=_0xee5b[_0x5ecc02];return _0x206cbf;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var moment=require(_0xbee5('0x1'));var BPromise=require(_0xbee5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee5('0x3'));var db=require(_0xbee5('0x4'))['db'];var utils=require(_0xbee5('0x5'));var logger=require(_0xbee5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbee5('0x7'));var client=jayson[_0xbee5('0x8')][_0xbee5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x804ab8,_0x4f5065,_0x5505e3){return new BPromise(function(_0x53d5b9,_0x5baf5c){return client['request'](_0x804ab8,_0x5505e3)[_0xbee5('0xa')](function(_0x7dda04){logger[_0xbee5('0xb')](_0xbee5('0xc'),_0x4f5065,'request\x20sent');logger[_0xbee5('0xd')](_0xbee5('0xe'),_0x4f5065,_0xbee5('0xf'),JSON[_0xbee5('0x10')](_0x7dda04));if(_0x7dda04[_0xbee5('0x11')]){if(_0x7dda04[_0xbee5('0x11')][_0xbee5('0x12')]===0x1f4){logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error'][_0xbee5('0x13')]);return _0x5baf5c(_0x7dda04['error'][_0xbee5('0x13')]);}logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error']['message']);return _0x53d5b9(_0x7dda04[_0xbee5('0x11')]['message']);}else{logger[_0xbee5('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x4f5065,_0xbee5('0xf'));_0x53d5b9(_0x7dda04[_0xbee5('0x14')][_0xbee5('0x13')]);}})['catch'](function(_0x27e034){logger[_0xbee5('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x4f5065,_0x27e034);_0x5baf5c(_0x27e034);});});}exports[_0xbee5('0x15')]=function(_0x538460){var _0x11b4a3=this;return new Promise(function(_0x3c3f4e,_0x35eb5c){return db[_0xbee5('0x16')][_0xbee5('0x17')](_0x538460[_0xbee5('0x18')],{'raw':_0x538460[_0xbee5('0x19')]?_0x538460[_0xbee5('0x19')][_0xbee5('0x1a')]===undefined?!![]:![]:!![]})[_0xbee5('0xa')](function(_0x35d7d3){logger[_0xbee5('0xb')](_0xbee5('0x15'),_0x538460);logger['debug']('CreateCmHopperHistory',_0x538460,JSON[_0xbee5('0x10')](_0x35d7d3));_0x3c3f4e(_0x35d7d3);})['catch'](function(_0x205491){logger[_0xbee5('0x11')](_0xbee5('0x15'),_0x205491[_0xbee5('0x13')],_0x538460);_0x35eb5c(_0x11b4a3[_0xbee5('0x11')](0x1f4,_0x205491[_0xbee5('0x13')]));});});};exports[_0xbee5('0x1b')]=function(_0x3cfa8d){var _0xc79035=this;return new Promise(function(_0x520c02,_0x5b43b3){return db['CmHopperHistory']['findAll']({'raw':_0x3cfa8d['options']?_0x3cfa8d[_0xbee5('0x19')][_0xbee5('0x1a')]===undefined?!![]:![]:!![],'where':_0x3cfa8d[_0xbee5('0x19')]?_0x3cfa8d[_0xbee5('0x19')][_0xbee5('0x1c')]||null:null,'attributes':[[db[_0xbee5('0x1d')]['fn'](_0xbee5('0x1e'),db['sequelize'][_0xbee5('0x1f')]('id')),_0xbee5('0x20')],[db[_0xbee5('0x1d')]['fn'](_0xbee5('0x1e'),db[_0xbee5('0x1d')]['fn']('IF',db['sequelize'][_0xbee5('0x21')](_0xbee5('0x22')))),_0xbee5('0x23')],[db[_0xbee5('0x1d')]['fn'](_0xbee5('0x1e'),db[_0xbee5('0x1d')]['fn']('IF',db[_0xbee5('0x1d')][_0xbee5('0x21')](_0xbee5('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xbee5('0x1d')]['fn']('COUNT',db[_0xbee5('0x1d')]['fn']('IF',db['sequelize'][_0xbee5('0x21')]('`state`\x20=\x2011,\x201,\x20null'))),_0xbee5('0x25')],[db['sequelize']['fn'](_0xbee5('0x26'),db[_0xbee5('0x1d')]['fn']('IF',db[_0xbee5('0x1d')][_0xbee5('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xbee5('0x27')],[db[_0xbee5('0x1d')]['fn'](_0xbee5('0x26'),db[_0xbee5('0x1d')]['fn']('IF',db['sequelize'][_0xbee5('0x21')](_0xbee5('0x28')))),_0xbee5('0x29')]]})[_0xbee5('0xa')](function(_0x4c3428){logger[_0xbee5('0xb')](_0xbee5('0x1b'),_0x3cfa8d);logger[_0xbee5('0xd')](_0xbee5('0x1b'),_0x3cfa8d,JSON['stringify'](_0x4c3428));_0x520c02(_0x4c3428);})[_0xbee5('0x2a')](function(_0x59cacb){logger[_0xbee5('0x11')]('AvgHandleTime',_0x59cacb['message'],_0x3cfa8d);_0x5b43b3(_0xc79035['error'](0x1f4,_0x59cacb[_0xbee5('0x13')]));});});};exports[_0xbee5('0x2b')]=function(_0x14342f){var _0x42055e=this;return new Promise(function(_0x209466,_0x2b83d5){return db[_0xbee5('0x16')][_0xbee5('0x2c')]({'raw':_0x14342f['options']?_0x14342f[_0xbee5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x14342f[_0xbee5('0x19')]?_0x14342f[_0xbee5('0x19')][_0xbee5('0x1c')]||null:null,'attributes':[[_0xbee5('0x2d'),'name'],[db[_0xbee5('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xbee5('0x1d')][_0xbee5('0x21')](_0xbee5('0x2e')))),_0xbee5('0x2f')],[db['sequelize']['fn'](_0xbee5('0x1e'),db[_0xbee5('0x1d')]['fn']('IF',db[_0xbee5('0x1d')][_0xbee5('0x21')](_0xbee5('0x30')))),_0xbee5('0x31')],[db[_0xbee5('0x1d')]['fn'](_0xbee5('0x1e'),db[_0xbee5('0x1d')]['fn']('IF',db[_0xbee5('0x1d')]['literal'](_0xbee5('0x22')))),_0xbee5('0x32')],[db['sequelize']['fn'](_0xbee5('0x1e'),db[_0xbee5('0x1d')]['fn']('IF',db[_0xbee5('0x1d')][_0xbee5('0x21')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db['sequelize']['fn'](_0xbee5('0x1e'),db[_0xbee5('0x1d')]['fn']('IF',db[_0xbee5('0x1d')][_0xbee5('0x21')](_0xbee5('0x33')))),_0xbee5('0x34')],[db[_0xbee5('0x1d')]['fn'](_0xbee5('0x1e'),db[_0xbee5('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xbee5('0x35')))),'outboundDropCallsDayTimeout'],[db[_0xbee5('0x1d')]['fn'](_0xbee5('0x1e'),db['sequelize']['fn']('IF',db[_0xbee5('0x1d')][_0xbee5('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'outboundDropCallsDayCallersExit'],[db[_0xbee5('0x1d')]['fn'](_0xbee5('0x1e'),db['sequelize']['fn']('IF',db[_0xbee5('0x1d')][_0xbee5('0x21')]('`state`\x20=\x2012,\x201,\x20null'))),_0xbee5('0x36')],[db[_0xbee5('0x1d')]['fn'](_0xbee5('0x1e'),db[_0xbee5('0x1d')]['fn']('IF',db[_0xbee5('0x1d')][_0xbee5('0x21')](_0xbee5('0x37')))),'outboundBlacklistCallsDay'],[db[_0xbee5('0x1d')]['fn'](_0xbee5('0x1e'),db[_0xbee5('0x1d')]['fn']('IF',db[_0xbee5('0x1d')]['literal'](_0xbee5('0x38')))),_0xbee5('0x39')],[db[_0xbee5('0x1d')]['fn']('COUNT',db[_0xbee5('0x1d')]['fn']('IF',db[_0xbee5('0x1d')]['literal']('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xbee5('0x1d')]['fn']('COUNT',db[_0xbee5('0x1d')]['fn']('IF',db[_0xbee5('0x1d')][_0xbee5('0x21')](_0xbee5('0x3a')))),_0xbee5('0x3b')],[db[_0xbee5('0x1d')]['fn']('COUNT',db[_0xbee5('0x1d')]['fn']('IF',db[_0xbee5('0x1d')][_0xbee5('0x21')](_0xbee5('0x3c')))),'outboundRejectCallsDay'],[db[_0xbee5('0x1d')]['fn']('COUNT',db[_0xbee5('0x1d')]['fn']('IF',db[_0xbee5('0x1d')][_0xbee5('0x21')](_0xbee5('0x3d')))),_0xbee5('0x3e')]],'group':[_0xbee5('0x2d')]})[_0xbee5('0xa')](function(_0x35f1d1){logger[_0xbee5('0xb')](_0xbee5('0x2b'),_0x14342f);logger[_0xbee5('0xd')](_0xbee5('0x2b'),_0x14342f,JSON[_0xbee5('0x10')](_0x35f1d1));_0x209466(_0x35f1d1);})[_0xbee5('0x2a')](function(_0x37cf74){logger['error'](_0xbee5('0x2b'),_0x37cf74[_0xbee5('0x13')],_0x14342f);_0x2b83d5(_0x42055e[_0xbee5('0x11')](0x1f4,_0x37cf74['message']));});});};exports[_0xbee5('0x3f')]=function(_0x1b753a){var _0x21d9c6=this;return new Promise(function(_0x4e8864,_0x1cc152){return db['CmHopperHistory'][_0xbee5('0x2c')]({'raw':_0x1b753a['options']?_0x1b753a[_0xbee5('0x19')][_0xbee5('0x1a')]===undefined?!![]:![]:!![],'where':_0x1b753a[_0xbee5('0x19')]?_0x1b753a['options']['where']||null:null,'attributes':[['campaign',_0xbee5('0x40')],[db[_0xbee5('0x1d')]['fn'](_0xbee5('0x1e'),db['sequelize'][_0xbee5('0x1f')]('id')),'ivrTotalCallsDays'],[db[_0xbee5('0x1d')]['fn'](_0xbee5('0x1e'),db[_0xbee5('0x1d')]['fn']('IF',db['sequelize'][_0xbee5('0x21')](_0xbee5('0x22')))),_0xbee5('0x41')]],'group':[_0xbee5('0x2d')]})[_0xbee5('0xa')](function(_0x12a41b){logger[_0xbee5('0xb')](_0xbee5('0x3f'),_0x1b753a);logger[_0xbee5('0xd')](_0xbee5('0x3f'),_0x1b753a,JSON[_0xbee5('0x10')](_0x12a41b));_0x4e8864(_0x12a41b);})[_0xbee5('0x2a')](function(_0x318016){logger[_0xbee5('0x11')](_0xbee5('0x3f'),_0x318016[_0xbee5('0x13')],_0x1b753a);_0x1cc152(_0x21d9c6[_0xbee5('0x11')](0x1f4,_0x318016['message']));});});}; \ No newline at end of file +var _0x1775=['CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','AvgHandleTime','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0x1775,0x1db));var _0x5177=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1775[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x5177('0x0'));var moment=require(_0x5177('0x1'));var BPromise=require(_0x5177('0x2'));var rs=require(_0x5177('0x3'));var fs=require('fs');var Redis=require(_0x5177('0x4'));var db=require(_0x5177('0x5'))['db'];var utils=require(_0x5177('0x6'));var logger=require(_0x5177('0x7'))(_0x5177('0x8'));var config=require(_0x5177('0x9'));var jayson=require(_0x5177('0xa'));var client=jayson[_0x5177('0xb')][_0x5177('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ac1c6,_0x300b43,_0x245c12){return new BPromise(function(_0x363611,_0x3ce288){return client[_0x5177('0xd')](_0x2ac1c6,_0x245c12)[_0x5177('0xe')](function(_0x2c23d8){logger[_0x5177('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x300b43,'request\x20sent');logger[_0x5177('0x10')](_0x5177('0x11'),_0x300b43,_0x5177('0x12'),JSON[_0x5177('0x13')](_0x2c23d8));if(_0x2c23d8[_0x5177('0x14')]){if(_0x2c23d8['error'][_0x5177('0x15')]===0x1f4){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x3ce288(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);return _0x363611(_0x2c23d8[_0x5177('0x14')][_0x5177('0x17')]);}else{logger[_0x5177('0xf')](_0x5177('0x16'),_0x300b43,_0x5177('0x12'));_0x363611(_0x2c23d8[_0x5177('0x18')][_0x5177('0x17')]);}})[_0x5177('0x19')](function(_0x50ce2c){logger[_0x5177('0x14')](_0x5177('0x16'),_0x300b43,_0x50ce2c);_0x3ce288(_0x50ce2c);});});}exports[_0x5177('0x1a')]=function(_0x1b4102){var _0x5f5bd4=this;return new Promise(function(_0x3e6944,_0x2ebf91){return db[_0x5177('0x1b')]['create'](_0x1b4102[_0x5177('0x1c')],{'raw':_0x1b4102['options']?_0x1b4102[_0x5177('0x1d')][_0x5177('0x1e')]===undefined?!![]:![]:!![]})[_0x5177('0xe')](function(_0x27b732){logger[_0x5177('0xf')](_0x5177('0x1a'),_0x1b4102);logger[_0x5177('0x10')](_0x5177('0x1a'),_0x1b4102,JSON[_0x5177('0x13')](_0x27b732));_0x3e6944(_0x27b732);})[_0x5177('0x19')](function(_0x23dad2){logger[_0x5177('0x14')]('CreateCmHopperHistory',_0x23dad2[_0x5177('0x17')],_0x1b4102);_0x2ebf91(_0x5f5bd4['error'](0x1f4,_0x23dad2[_0x5177('0x17')]));});});};exports[_0x5177('0x1f')]=function(_0x3b39b5){var _0x2d51d0=this;return new Promise(function(_0x4bc8e2,_0x2503ef){return db['CmHopperHistory']['findAll']({'raw':_0x3b39b5[_0x5177('0x1d')]?_0x3b39b5[_0x5177('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3b39b5[_0x5177('0x1d')]?_0x3b39b5['options'][_0x5177('0x20')]||null:null,'attributes':[[db[_0x5177('0x21')]['fn']('COUNT',db[_0x5177('0x21')][_0x5177('0x22')]('id')),_0x5177('0x23')],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db[_0x5177('0x21')]['fn']('IF',db['sequelize']['literal'](_0x5177('0x25')))),_0x5177('0x26')],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db[_0x5177('0x21')]['fn']('IF',db[_0x5177('0x21')][_0x5177('0x27')](_0x5177('0x28')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db['sequelize']['fn']('IF',db[_0x5177('0x21')]['literal'](_0x5177('0x29')))),_0x5177('0x2a')],[db[_0x5177('0x21')]['fn']('AVG',db['sequelize']['fn']('IF',db[_0x5177('0x21')][_0x5177('0x27')](_0x5177('0x2b')))),_0x5177('0x2c')],[db[_0x5177('0x21')]['fn'](_0x5177('0x2d'),db[_0x5177('0x21')]['fn']('IF',db[_0x5177('0x21')]['literal'](_0x5177('0x2e')))),_0x5177('0x2f')]]})['then'](function(_0xa0851d){logger[_0x5177('0xf')](_0x5177('0x1f'),_0x3b39b5);logger[_0x5177('0x10')](_0x5177('0x1f'),_0x3b39b5,JSON[_0x5177('0x13')](_0xa0851d));_0x4bc8e2(_0xa0851d);})['catch'](function(_0x40c607){logger[_0x5177('0x14')](_0x5177('0x1f'),_0x40c607[_0x5177('0x17')],_0x3b39b5);_0x2503ef(_0x2d51d0[_0x5177('0x14')](0x1f4,_0x40c607[_0x5177('0x17')]));});});};exports[_0x5177('0x30')]=function(_0x5a5a33){var _0x257350=this;return new Promise(function(_0x2ff13b,_0x5eb62a){return db['CmHopperHistory'][_0x5177('0x31')]({'raw':_0x5a5a33[_0x5177('0x1d')]?_0x5a5a33[_0x5177('0x1d')][_0x5177('0x1e')]===undefined?!![]:![]:!![],'where':_0x5a5a33[_0x5177('0x1d')]?_0x5a5a33[_0x5177('0x1d')][_0x5177('0x20')]||null:null,'attributes':[[_0x5177('0x32'),_0x5177('0x33')],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db[_0x5177('0x21')]['fn']('IF',db[_0x5177('0x21')]['literal'](_0x5177('0x34')))),_0x5177('0x35')],[db['sequelize']['fn'](_0x5177('0x24'),db['sequelize']['fn']('IF',db[_0x5177('0x21')][_0x5177('0x27')](_0x5177('0x36')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0x5177('0x24'),db[_0x5177('0x21')]['fn']('IF',db[_0x5177('0x21')][_0x5177('0x27')](_0x5177('0x25')))),_0x5177('0x37')],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db['sequelize']['fn']('IF',db[_0x5177('0x21')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x5177('0x38')],[db[_0x5177('0x21')]['fn']('COUNT',db[_0x5177('0x21')]['fn']('IF',db['sequelize']['literal'](_0x5177('0x39')))),_0x5177('0x3a')],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db[_0x5177('0x21')]['fn']('IF',db[_0x5177('0x21')][_0x5177('0x27')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'outboundDropCallsDayTimeout'],[db[_0x5177('0x21')]['fn']('COUNT',db[_0x5177('0x21')]['fn']('IF',db[_0x5177('0x21')][_0x5177('0x27')](_0x5177('0x3b')))),'outboundDropCallsDayCallersExit'],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db[_0x5177('0x21')]['fn']('IF',db[_0x5177('0x21')][_0x5177('0x27')](_0x5177('0x3c')))),_0x5177('0x3d')],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db[_0x5177('0x21')]['fn']('IF',db[_0x5177('0x21')]['literal'](_0x5177('0x3e')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x5177('0x21')]['fn']('IF',db[_0x5177('0x21')]['literal'](_0x5177('0x3f')))),_0x5177('0x40')],[db[_0x5177('0x21')]['fn']('COUNT',db[_0x5177('0x21')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2018,\x201,\x20null'))),_0x5177('0x41')],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db['sequelize']['fn']('IF',db['sequelize'][_0x5177('0x27')]('`state`\x20=\x2016,\x201,\x20null'))),_0x5177('0x42')],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db[_0x5177('0x21')]['fn']('IF',db[_0x5177('0x21')][_0x5177('0x27')](_0x5177('0x43')))),_0x5177('0x41')],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db[_0x5177('0x21')]['fn']('IF',db[_0x5177('0x21')][_0x5177('0x27')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x5177('0x32')]})['then'](function(_0x649c6f){logger['info'](_0x5177('0x30'),_0x5a5a33);logger[_0x5177('0x10')](_0x5177('0x30'),_0x5a5a33,JSON['stringify'](_0x649c6f));_0x2ff13b(_0x649c6f);})['catch'](function(_0x19884e){logger[_0x5177('0x14')](_0x5177('0x30'),_0x19884e[_0x5177('0x17')],_0x5a5a33);_0x5eb62a(_0x257350['error'](0x1f4,_0x19884e['message']));});});};exports[_0x5177('0x44')]=function(_0x131da7){var _0x32a53a=this;return new Promise(function(_0x736b13,_0x4ad742){return db[_0x5177('0x1b')][_0x5177('0x31')]({'raw':_0x131da7[_0x5177('0x1d')]?_0x131da7['options'][_0x5177('0x1e')]===undefined?!![]:![]:!![],'where':_0x131da7[_0x5177('0x1d')]?_0x131da7[_0x5177('0x1d')]['where']||null:null,'attributes':[[_0x5177('0x32'),'name'],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db[_0x5177('0x21')]['col']('id')),_0x5177('0x45')],[db[_0x5177('0x21')]['fn'](_0x5177('0x24'),db[_0x5177('0x21')]['fn']('IF',db[_0x5177('0x21')][_0x5177('0x27')](_0x5177('0x25')))),_0x5177('0x46')]],'group':['campaign']})['then'](function(_0x4b5b6b){logger[_0x5177('0xf')](_0x5177('0x44'),_0x131da7);logger[_0x5177('0x10')](_0x5177('0x44'),_0x131da7,JSON[_0x5177('0x13')](_0x4b5b6b));_0x736b13(_0x4b5b6b);})[_0x5177('0x19')](function(_0x4b0b3f){logger['error'](_0x5177('0x44'),_0x4b0b3f[_0x5177('0x17')],_0x131da7);_0x4ad742(_0x32a53a[_0x5177('0x14')](0x1f4,_0x4b0b3f[_0x5177('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 97afaa8..0dfb4da 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 _0xef33=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe','/:id','show','put','exports','multer','path'];(function(_0x2ed58c,_0x18cb8b){var _0x31f59d=function(_0x4b7efb){while(--_0x4b7efb){_0x2ed58c['push'](_0x2ed58c['shift']());}};_0x31f59d(++_0x18cb8b);}(_0xef33,0x7e));var _0x3ef3=function(_0x172684,_0x38bde0){_0x172684=_0x172684-0x0;var _0xbad64a=_0xef33[_0x172684];return _0xbad64a;};'use strict';var multer=require(_0x3ef3('0x0'));var util=require('util');var path=require(_0x3ef3('0x1'));var timeout=require(_0x3ef3('0x2'));var express=require(_0x3ef3('0x3'));var router=express[_0x3ef3('0x4')]();var auth=require(_0x3ef3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3ef3('0x6'));var controller=require(_0x3ef3('0x7'));router[_0x3ef3('0x8')]('/',auth[_0x3ef3('0x9')](),controller[_0x3ef3('0xa')]);router[_0x3ef3('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x3ef3('0xb')]);router[_0x3ef3('0x8')](_0x3ef3('0xc'),auth[_0x3ef3('0x9')](),controller[_0x3ef3('0xd')]);router['post']('/',auth[_0x3ef3('0x9')](),controller['create']);router[_0x3ef3('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);module[_0x3ef3('0xf')]=router; \ No newline at end of file +var _0xee8c=['express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','show','post','put','update','exports','multer','util'];(function(_0x50e3b8,_0x4cca81){var _0x287f12=function(_0x251a21){while(--_0x251a21){_0x50e3b8['push'](_0x50e3b8['shift']());}};_0x287f12(++_0x4cca81);}(_0xee8c,0xee));var _0xcee8=function(_0x4d9480,_0x2f45ab){_0x4d9480=_0x4d9480-0x0;var _0x2d0eef=_0xee8c[_0x4d9480];return _0x2d0eef;};'use strict';var multer=require(_0xcee8('0x0'));var util=require(_0xcee8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcee8('0x2'));var router=express['Router']();var auth=require(_0xcee8('0x3'));var interaction=require(_0xcee8('0x4'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router['get']('/',auth[_0xcee8('0x5')](),controller[_0xcee8('0x6')]);router[_0xcee8('0x7')](_0xcee8('0x8'),auth[_0xcee8('0x5')](),controller['describe']);router[_0xcee8('0x7')](_0xcee8('0x9'),auth['isAuthenticated'](),controller[_0xcee8('0xa')]);router[_0xcee8('0xb')]('/',auth[_0xcee8('0x5')](),controller['create']);router[_0xcee8('0xc')](_0xcee8('0x9'),auth[_0xcee8('0x5')](),controller[_0xcee8('0xd')]);module[_0xcee8('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 80077d7..3804029 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 _0x5e2f=['name','exports','STRING'];(function(_0x4a2cc2,_0x1fbafa){var _0x3f5f5c=function(_0x1e2583){while(--_0x1e2583){_0x4a2cc2['push'](_0x4a2cc2['shift']());}};_0x3f5f5c(++_0x1fbafa);}(_0x5e2f,0x187));var _0xf5e2=function(_0x478978,_0x287bd7){_0x478978=_0x478978-0x0;var _0x48cac6=_0x5e2f[_0x478978];return _0x48cac6;};'use strict';var Sequelize=require('sequelize');module[_0xf5e2('0x0')]={'name':{'type':Sequelize[_0xf5e2('0x1')],'unique':_0xf5e2('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf5e2('0x1')]},'dialPrefix':{'type':Sequelize[_0xf5e2('0x1')]}}; \ No newline at end of file +var _0x55f4=['name','exports','STRING'];(function(_0x1accc2,_0x585f7a){var _0x4580c2=function(_0x174bb6){while(--_0x174bb6){_0x1accc2['push'](_0x1accc2['shift']());}};_0x4580c2(++_0x585f7a);}(_0x55f4,0x193));var _0x455f=function(_0x1bf384,_0x159538){_0x1bf384=_0x1bf384-0x0;var _0x3dbded=_0x55f4[_0x1bf384];return _0x3dbded;};'use strict';var Sequelize=require('sequelize');module[_0x455f('0x0')]={'name':{'type':Sequelize[_0x455f('0x1')],'unique':_0x455f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x455f('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index b240e36..617f663 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 _0x2189=['getAgents','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','update','destroy','then','get','Lists','error','name','send','index','map','CmList','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','limit','sort','pick','filters','filter','where','VIRTUAL','merge','includeAll','findAll','rows','show','params','length','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','nolimit','options','removeDispositions','ids','addContacts','tags','isArray','ListId','push','CmContact','omit','success','errors','message','Malformed\x20request\x20syntax','getContacts','CustomFields','concat','cf_%d','hasOwnProperty','raw','getContactsCsv','format','order','isEmpty','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','addCustomField','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','CmCustomField','spread','emit','removeAgents','userCmList:remove'];(function(_0x23e367,_0x4ab2ca){var _0x1c2362=function(_0x203d1f){while(--_0x203d1f){_0x23e367['push'](_0x23e367['shift']());}};_0x1c2362(++_0x4ab2ca);}(_0x2189,0x11a));var _0x9218=function(_0x38e9c1,_0x19dc64){_0x38e9c1=_0x38e9c1-0x0;var _0x5ee427=_0x2189[_0x38e9c1];return _0x5ee427;};'use strict';var pdf=require(_0x9218('0x0'));var emlformat=require(_0x9218('0x1'));var rimraf=require(_0x9218('0x2'));var zipdir=require(_0x9218('0x3'));var jsonpatch=require(_0x9218('0x4'));var rp=require('request-promise');var moment=require(_0x9218('0x5'));var BPromise=require(_0x9218('0x6'));var Mustache=require(_0x9218('0x7'));var util=require('util');var path=require(_0x9218('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9218('0x9'));var fs=require('fs');var _=require(_0x9218('0xa'));var squel=require(_0x9218('0xb'));var crypto=require('crypto');var jsforce=require(_0x9218('0xc'));var deskjs=require(_0x9218('0xd'));var toCsv=require(_0x9218('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9218('0xf'));var qs=require(_0x9218('0x10'));var as=require(_0x9218('0x11'));var hardwareService=require(_0x9218('0x12'));var logger=require(_0x9218('0x13'))(_0x9218('0x14'));var utils=require(_0x9218('0x15'));var config=require('../../config/environment');var db=require(_0x9218('0x16'))['db'];config[_0x9218('0x17')]=_[_0x9218('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9218('0x19'))(new Redis(config[_0x9218('0x17')]));require('./cmList.socket')[_0x9218('0x1a')](socket);function respondWithStatusCode(_0x43b89d,_0x22a1f4){_0x22a1f4=_0x22a1f4||0xcc;return function(_0x329309){if(_0x329309){return _0x43b89d[_0x9218('0x1b')](_0x22a1f4);}return _0x43b89d[_0x9218('0x1c')](_0x22a1f4)[_0x9218('0x1d')]();};}function respondWithResult(_0xf69148,_0xc85b65){_0xc85b65=_0xc85b65||0xc8;return function(_0x40ed3b){if(_0x40ed3b){return _0xf69148[_0x9218('0x1c')](_0xc85b65)['json'](_0x40ed3b);}};}function respondWithFilteredResult(_0x38a9ab,_0x5ec275){return function(_0x2a3452){if(_0x2a3452){var _0x1a8557=_0x2a3452[_0x9218('0x1e')],_0x1c87df=_0x5ec275['offset'],_0x5bfd3e=_0x5ec275[_0x9218('0x1f')]+_0x5ec275['limit'],_0x5085e0;if(_0x5bfd3e>=_0x1a8557){_0x5bfd3e=_0x1a8557;_0x5085e0=0xc8;}else{_0x5085e0=0xce;}_0x38a9ab[_0x9218('0x1c')](_0x5085e0);return _0x38a9ab[_0x9218('0x20')](_0x9218('0x21'),_0x1c87df+'-'+_0x5bfd3e+'/'+_0x1a8557)[_0x9218('0x22')](_0x2a3452);}return null;};}function patchUpdates(_0x34053a){return function(_0x2f4d73){try{jsonpatch[_0x9218('0x23')](_0x2f4d73,_0x34053a,!![]);}catch(_0x493fde){return BPromise[_0x9218('0x24')](_0x493fde);}return _0x2f4d73['save']();};}function saveUpdates(_0x12bd0b,_0x335bd8){return function(_0x4beecd){if(_0x4beecd){return _0x4beecd[_0x9218('0x25')](_0x12bd0b)['then'](function(_0x312230){return _0x312230;});}return null;};}function removeEntity(_0x1ecc2e,_0xd22555){return function(_0x48f02c){if(_0x48f02c){return _0x48f02c[_0x9218('0x26')]()[_0x9218('0x27')](function(){var _0x55fe8d=_0x48f02c[_0x9218('0x28')]({'plain':!![]});var _0x32efdf=_0x9218('0x29');return db['UserProfileResource'][_0x9218('0x26')]({'where':{'type':_0x32efdf,'resourceId':_0x55fe8d['id']}})[_0x9218('0x27')](function(){return _0x48f02c;});})[_0x9218('0x27')](function(){_0x1ecc2e[_0x9218('0x1c')](0xcc)[_0x9218('0x1d')]();});}};}function handleEntityNotFound(_0x38227e,_0x534355){return function(_0x2ed8fc){if(!_0x2ed8fc){_0x38227e['sendStatus'](0x194);}return _0x2ed8fc;};}function handleError(_0xbeb3af,_0x5c9f27){_0x5c9f27=_0x5c9f27||0x1f4;return function(_0x279255){logger[_0x9218('0x2a')](_0x279255['stack']);if(_0x279255[_0x9218('0x2b')]){delete _0x279255[_0x9218('0x2b')];}_0xbeb3af[_0x9218('0x1c')](_0x5c9f27)[_0x9218('0x2c')](_0x279255);};}exports[_0x9218('0x2d')]=function(_0x18f769,_0x57b218){var _0x8788a0={},_0x306b3e={},_0x48b86b={'count':0x0,'rows':[]};var _0x4dde38=_[_0x9218('0x2e')](db[_0x9218('0x2f')][_0x9218('0x30')],function(_0x6e8f9b){return{'name':_0x6e8f9b[_0x9218('0x31')],'type':_0x6e8f9b[_0x9218('0x32')]['key']};});_0x306b3e[_0x9218('0x33')]=_['map'](_0x4dde38,'name');_0x306b3e[_0x9218('0x34')]=_[_0x9218('0x35')](_0x18f769[_0x9218('0x34')]);_0x306b3e['filters']=_[_0x9218('0x36')](_0x306b3e['model'],_0x306b3e[_0x9218('0x34')]);_0x8788a0[_0x9218('0x37')]=_[_0x9218('0x36')](_0x306b3e[_0x9218('0x33')],qs['fields'](_0x18f769[_0x9218('0x34')][_0x9218('0x38')]));_0x8788a0[_0x9218('0x37')]=_0x8788a0[_0x9218('0x37')]['length']?_0x8788a0['attributes']:_0x306b3e[_0x9218('0x33')];if(!_0x18f769[_0x9218('0x34')]['hasOwnProperty']('nolimit')){_0x8788a0[_0x9218('0x39')]=qs['limit'](_0x18f769[_0x9218('0x34')][_0x9218('0x39')]);_0x8788a0['offset']=qs[_0x9218('0x1f')](_0x18f769['query'][_0x9218('0x1f')]);}_0x8788a0['order']=qs['sort'](_0x18f769[_0x9218('0x34')][_0x9218('0x3a')]);_0x8788a0['where']=qs['filters'](_[_0x9218('0x3b')](_0x18f769['query'],_0x306b3e[_0x9218('0x3c')]),_0x4dde38);if(_0x18f769[_0x9218('0x34')][_0x9218('0x3d')]){_0x8788a0['where']=_['merge'](_0x8788a0[_0x9218('0x3e')],{'$or':_[_0x9218('0x2e')](_0x4dde38,function(_0x28569c){if(_0x28569c['type']!==_0x9218('0x3f')){var _0x4b7d1d={};_0x4b7d1d[_0x28569c[_0x9218('0x2b')]]={'$like':'%'+_0x18f769['query'][_0x9218('0x3d')]+'%'};return _0x4b7d1d;}})});}_0x8788a0=_[_0x9218('0x40')]({},_0x8788a0,_0x18f769['options']);var _0x155bdb={'where':_0x8788a0[_0x9218('0x3e')]};return db[_0x9218('0x2f')][_0x9218('0x1e')](_0x155bdb)[_0x9218('0x27')](function(_0x4fd335){_0x48b86b[_0x9218('0x1e')]=_0x4fd335;if(_0x18f769[_0x9218('0x34')][_0x9218('0x41')]){_0x8788a0['include']=[{'all':!![]}];}return db[_0x9218('0x2f')][_0x9218('0x42')](_0x8788a0);})[_0x9218('0x27')](function(_0x1be474){_0x48b86b[_0x9218('0x43')]=_0x1be474;return _0x48b86b;})['then'](respondWithFilteredResult(_0x57b218,_0x8788a0))['catch'](handleError(_0x57b218,null));};exports[_0x9218('0x44')]=function(_0xd76d02,_0x37361f){var _0x39315d={'raw':![],'where':{'id':_0xd76d02[_0x9218('0x45')]['id']}},_0x413459={};_0x413459[_0x9218('0x33')]=_[_0x9218('0x35')](db[_0x9218('0x2f')][_0x9218('0x30')]);_0x413459['query']=_[_0x9218('0x35')](_0xd76d02['query']);_0x413459['filters']=_[_0x9218('0x36')](_0x413459['model'],_0x413459[_0x9218('0x34')]);_0x39315d['attributes']=_['intersection'](_0x413459[_0x9218('0x33')],qs[_0x9218('0x38')](_0xd76d02['query'][_0x9218('0x38')]));_0x39315d[_0x9218('0x37')]=_0x39315d[_0x9218('0x37')][_0x9218('0x46')]?_0x39315d[_0x9218('0x37')]:_0x413459[_0x9218('0x33')];if(_0xd76d02[_0x9218('0x34')][_0x9218('0x41')]){_0x39315d[_0x9218('0x47')]=[{'all':!![]}];}_0x39315d=_['merge']({},_0x39315d,_0xd76d02['options']);return db[_0x9218('0x2f')][_0x9218('0x48')](_0x39315d)[_0x9218('0x27')](handleEntityNotFound(_0x37361f,null))['then'](respondWithResult(_0x37361f,null))[_0x9218('0x49')](handleError(_0x37361f,null));};exports[_0x9218('0x4a')]=function(_0x5c2db7,_0x2f5c77){return db['CmList'][_0x9218('0x4a')](_0x5c2db7[_0x9218('0x4b')],{})['then'](function(_0x2b1c82){var _0x183580=_0x5c2db7['user'][_0x9218('0x28')]({'plain':!![]});if(!_0x183580)throw new Error(_0x9218('0x4c'));if(_0x183580[_0x9218('0x4d')]===_0x9218('0x4e')){var _0x2ca780=_0x2b1c82['get']({'plain':!![]});var _0x32fcb0=_0x9218('0x29');return db[_0x9218('0x4f')]['find']({'where':{'name':_0x32fcb0,'userProfileId':_0x183580['userProfileId']},'raw':!![]})[_0x9218('0x27')](function(_0x417425){if(_0x417425&&_0x417425[_0x9218('0x50')]===0x0){return db[_0x9218('0x51')][_0x9218('0x4a')]({'name':_0x2ca780['name'],'resourceId':_0x2ca780['id'],'type':_0x417425[_0x9218('0x2b')],'sectionId':_0x417425['id']},{})['then'](function(){return _0x2b1c82;});}else{return _0x2b1c82;}})[_0x9218('0x49')](function(_0x436c19){logger['error'](_0x9218('0x52'),_0x436c19);throw _0x436c19;});}return _0x2b1c82;})[_0x9218('0x27')](respondWithResult(_0x2f5c77,0xc9))[_0x9218('0x49')](handleError(_0x2f5c77,null));};exports[_0x9218('0x25')]=function(_0x5c77fe,_0x18d23f){if(_0x5c77fe['body']['id']){delete _0x5c77fe['body']['id'];}return db[_0x9218('0x2f')][_0x9218('0x48')]({'where':{'id':_0x5c77fe['params']['id']}})[_0x9218('0x27')](handleEntityNotFound(_0x18d23f,null))['then'](saveUpdates(_0x5c77fe['body'],null))[_0x9218('0x27')](respondWithResult(_0x18d23f,null))[_0x9218('0x49')](handleError(_0x18d23f,null));};exports[_0x9218('0x26')]=function(_0x10e016,_0x2eb1b3){return db[_0x9218('0x2f')][_0x9218('0x48')]({'where':{'id':_0x10e016['params']['id']}})['then'](handleEntityNotFound(_0x2eb1b3,null))[_0x9218('0x27')](removeEntity(_0x2eb1b3,null))[_0x9218('0x49')](handleError(_0x2eb1b3,null));};exports[_0x9218('0x53')]=function(_0xf82d1,_0xd1223a){return db[_0x9218('0x2f')]['describe']()[_0x9218('0x27')](respondWithResult(_0xd1223a,null))[_0x9218('0x49')](handleError(_0xd1223a,null));};exports[_0x9218('0x54')]=function(_0x191bd4,_0xea066c,_0x314c57){if(_0x191bd4[_0x9218('0x4b')]['id']){delete _0x191bd4[_0x9218('0x4b')]['id'];}return db[_0x9218('0x2f')][_0x9218('0x48')]({'where':{'id':_0x191bd4[_0x9218('0x45')]['id']}})[_0x9218('0x27')](handleEntityNotFound(_0xea066c,null))[_0x9218('0x27')](function(_0x411cd4){if(_0x411cd4){_0x191bd4[_0x9218('0x4b')]['ListId']=_0x411cd4['id'];return db[_0x9218('0x55')][_0x9218('0x4a')](_0x191bd4[_0x9218('0x4b')]);}})[_0x9218('0x27')](respondWithResult(_0xea066c,null))['catch'](handleError(_0xea066c,null));};exports['getDispositions']=function(_0x3ed4e2,_0x555ff3,_0x48a5be){var _0x1024b0={'raw':![],'where':{}};var _0x3c8855={};var _0x31fb2f={'count':0x0,'rows':[]};return db[_0x9218('0x2f')][_0x9218('0x56')]({'where':{'id':_0x3ed4e2[_0x9218('0x45')]['id']}})[_0x9218('0x27')](handleEntityNotFound(_0x555ff3,null))['then'](function(_0x1382c0){if(_0x1382c0){_0x3c8855[_0x9218('0x33')]=_['keys'](db[_0x9218('0x55')][_0x9218('0x30')]);_0x3c8855[_0x9218('0x34')]=_[_0x9218('0x35')](_0x3ed4e2['query']);_0x3c8855['filters']=_[_0x9218('0x36')](_0x3c8855[_0x9218('0x33')],_0x3c8855[_0x9218('0x34')]);_0x1024b0[_0x9218('0x37')]=_['intersection'](_0x3c8855['model'],qs[_0x9218('0x38')](_0x3ed4e2[_0x9218('0x34')][_0x9218('0x38')]));_0x1024b0[_0x9218('0x37')]=_0x1024b0[_0x9218('0x37')]['length']?_0x1024b0[_0x9218('0x37')]:_0x3c8855[_0x9218('0x33')];if(!_0x3ed4e2[_0x9218('0x34')]['hasOwnProperty'](_0x9218('0x57'))){_0x1024b0[_0x9218('0x39')]=qs['limit'](_0x3ed4e2[_0x9218('0x34')][_0x9218('0x39')]);_0x1024b0[_0x9218('0x1f')]=qs[_0x9218('0x1f')](_0x3ed4e2[_0x9218('0x34')]['offset']);}_0x1024b0['order']=qs[_0x9218('0x3a')](_0x3ed4e2[_0x9218('0x34')][_0x9218('0x3a')]);_0x1024b0['where']=qs[_0x9218('0x3c')](_[_0x9218('0x3b')](_0x3ed4e2[_0x9218('0x34')],_0x3c8855[_0x9218('0x3c')]));_0x1024b0[_0x9218('0x3e')]['ListId']=_0x1382c0['id'];if(_0x3ed4e2[_0x9218('0x34')]['filter']){_0x1024b0[_0x9218('0x3e')]=_[_0x9218('0x40')](_0x1024b0[_0x9218('0x3e')],{'$or':_[_0x9218('0x2e')](_0x1024b0[_0x9218('0x37')],function(_0x4b325b){var _0x357864={};_0x357864[_0x4b325b]={'$like':'%'+_0x3ed4e2[_0x9218('0x34')][_0x9218('0x3d')]+'%'};return _0x357864;})});}_0x1024b0=_[_0x9218('0x40')]({},_0x1024b0,_0x3ed4e2[_0x9218('0x58')]);return db[_0x9218('0x55')]['count']({'where':_0x1024b0[_0x9218('0x3e')]})[_0x9218('0x27')](function(_0x31bd18){_0x31fb2f['count']=_0x31bd18;if(_0x3ed4e2['query'][_0x9218('0x41')]){_0x1024b0[_0x9218('0x47')]=[{'all':!![]}];}return db[_0x9218('0x55')][_0x9218('0x42')](_0x1024b0);})['then'](function(_0x24e39c){_0x31fb2f['rows']=_0x24e39c;return _0x31fb2f;});}})[_0x9218('0x27')](respondWithFilteredResult(_0x555ff3,_0x1024b0))[_0x9218('0x49')](handleError(_0x555ff3,null));};exports[_0x9218('0x59')]=function(_0x2797ef,_0x3d654b,_0x2b3b13){return db[_0x9218('0x2f')][_0x9218('0x48')]({'where':{'id':_0x2797ef[_0x9218('0x45')]['id']}})['then'](handleEntityNotFound(_0x3d654b,null))[_0x9218('0x27')](function(_0x3cb359){if(_0x3cb359){return _0x3cb359[_0x9218('0x59')](_0x2797ef[_0x9218('0x34')][_0x9218('0x5a')]);}})[_0x9218('0x27')](respondWithStatusCode(_0x3d654b,null))['catch'](handleError(_0x3d654b,null));};exports[_0x9218('0x5b')]=function(_0x21ae22,_0x5ef586,_0x16e400){return db[_0x9218('0x2f')][_0x9218('0x48')]({'where':{'id':_0x21ae22[_0x9218('0x45')]['id']}})['then'](handleEntityNotFound(_0x5ef586,null))[_0x9218('0x27')](function(_0x1ef76e){if(_0x1ef76e){var _0x75bd08=[];var _0x4acad3={'success':[],'errors':[]};return db['CmContact'][_0x9218('0x53')]()[_0x9218('0x27')](function(_0x43339b){if(_0x21ae22[_0x9218('0x4b')][_0x9218('0x5c')]&&_[_0x9218('0x5d')](_0x21ae22[_0x9218('0x4b')][_0x9218('0x5c')])){if(_0x21ae22[_0x9218('0x4b')][_0x9218('0x5c')][_0x9218('0x46')]){_0x21ae22['body'][_0x9218('0x5c')]=_0x21ae22[_0x9218('0x4b')][_0x9218('0x5c')]['join'](';')+';';}else{_0x21ae22['body'][_0x9218('0x5c')]=null;}}else{_0x21ae22[_0x9218('0x4b')][_0x9218('0x5c')]=null;}if(_0x21ae22[_0x9218('0x4b')]&&_[_0x9218('0x5d')](_0x21ae22[_0x9218('0x4b')])){for(var _0x4f2d17=0x0;_0x4f2d17<_0x21ae22[_0x9218('0x4b')]['length'];_0x4f2d17+=0x1){_0x21ae22['body'][_0x4f2d17][_0x9218('0x5e')]=_0x21ae22[_0x9218('0x45')]['id'];_0x75bd08[_0x9218('0x5f')](_0x21ae22[_0x9218('0x4b')][_0x4f2d17]);}return BPromise['each'](_0x75bd08,function(_0x5da335){return db[_0x9218('0x60')][_0x9218('0x4a')](_[_0x9218('0x61')](_0x5da335,[_0x9218('0x5a'),'id'])||{},{'fields':_[_0x9218('0x35')](_0x43339b),'raw':!![]})[_0x9218('0x27')](function(_0x21d478){_0x4acad3[_0x9218('0x62')][_0x9218('0x5f')](_0x21d478['dataValues']);})[_0x9218('0x49')](function(_0x47b0c0){_0x4acad3[_0x9218('0x63')][_0x9218('0x5f')]({'data':_0x5da335,'error':_0x47b0c0[_0x9218('0x64')]});});})['then'](function(_0x56419b){return _0x4acad3;})[_0x9218('0x49')](function(_0x1daba6){return _0x1daba6;});}else{_0x5ef586[_0x9218('0x1c')](0x190)[_0x9218('0x22')]({'message':_0x9218('0x65')});}});}})['then'](respondWithResult(_0x5ef586,null))['catch'](handleError(_0x5ef586,null));};exports[_0x9218('0x66')]=function(_0x496a20,_0x3b5371,_0x14be14){var _0x32f467;return db['CmList'][_0x9218('0x48')]({'where':{'id':_0x496a20['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x9218('0x67')}]})['then'](handleEntityNotFound(_0x3b5371,null))[_0x9218('0x27')](function(_0x5f434c){if(_0x5f434c){_0x32f467=_0x5f434c;return db[_0x9218('0x60')][_0x9218('0x30')];}})[_0x9218('0x27')](function(_0x55b0f5){if(_0x55b0f5){var _0x1e0eee={};var _0x4d2166={};_0x4d2166[_0x9218('0x33')]=_[_0x9218('0x68')](_[_0x9218('0x35')](_0x55b0f5),_[_0x9218('0x2e')](_0x32f467[_0x9218('0x67')],function(_0x442451){return util['format'](_0x9218('0x69'),_0x442451['id']);}));_0x4d2166[_0x9218('0x34')]=_['keys'](_0x496a20[_0x9218('0x34')]);_0x4d2166[_0x9218('0x3c')]=_[_0x9218('0x36')](_0x4d2166[_0x9218('0x33')],_0x4d2166[_0x9218('0x34')]);_0x1e0eee[_0x9218('0x37')]=_['intersection'](_0x4d2166[_0x9218('0x33')],qs['fields'](_0x496a20['query'][_0x9218('0x38')]));_0x1e0eee[_0x9218('0x37')]=_0x1e0eee['attributes'][_0x9218('0x46')]?_0x1e0eee[_0x9218('0x37')]:_0x4d2166[_0x9218('0x33')];if(!_0x496a20['query'][_0x9218('0x6a')](_0x9218('0x57'))){_0x1e0eee[_0x9218('0x39')]=qs[_0x9218('0x39')](_0x496a20[_0x9218('0x34')]['limit']);_0x1e0eee[_0x9218('0x1f')]=qs['offset'](_0x496a20['query'][_0x9218('0x1f')]);}_0x1e0eee['order']=qs[_0x9218('0x3a')](_0x496a20['query']['sort']);_0x1e0eee[_0x9218('0x3e')]=qs[_0x9218('0x3c')](_[_0x9218('0x3b')](_0x496a20[_0x9218('0x34')],_0x4d2166[_0x9218('0x3c')]));_0x1e0eee[_0x9218('0x6b')]=!![];if(_0x496a20['query'][_0x9218('0x3d')]){_0x1e0eee[_0x9218('0x3e')]=_[_0x9218('0x40')](_0x1e0eee['where'],{'$or':_[_0x9218('0x2e')](_0x1e0eee[_0x9218('0x37')],function(_0x19d1c1){var _0x20929a={};_0x20929a[_0x19d1c1]={'$like':'%'+_0x496a20[_0x9218('0x34')]['filter']+'%'};return _0x20929a;})});}_0x1e0eee=_['merge']({},_0x1e0eee,_0x496a20[_0x9218('0x58')]);return _0x32f467[_0x9218('0x66')](_0x1e0eee);}})[_0x9218('0x27')](respondWithResult(_0x3b5371,null))[_0x9218('0x49')](handleError(_0x3b5371,null));};exports[_0x9218('0x6c')]=function(_0x2731a9,_0x43d083,_0x5e92a2){var _0x5c0d6;return db['CmList'][_0x9218('0x48')]({'where':{'id':_0x2731a9[_0x9218('0x45')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x9218('0x67')}]})[_0x9218('0x27')](handleEntityNotFound(_0x43d083,null))[_0x9218('0x27')](function(_0x4d23ee){if(_0x4d23ee){_0x5c0d6=_0x4d23ee;return db[_0x9218('0x60')][_0x9218('0x30')];}})[_0x9218('0x27')](function(_0x52644b){if(_0x52644b){var _0x2da68a={};var _0x451607={};_0x451607['model']=_[_0x9218('0x68')](_[_0x9218('0x35')](_0x52644b),_[_0x9218('0x2e')](_0x5c0d6[_0x9218('0x67')],function(_0x43df07){return util[_0x9218('0x6d')]('cf_%d',_0x43df07['id']);}));_0x451607[_0x9218('0x34')]=_[_0x9218('0x35')](_0x2731a9[_0x9218('0x34')]);_0x451607[_0x9218('0x3c')]=_[_0x9218('0x36')](_0x451607[_0x9218('0x33')],_0x451607[_0x9218('0x34')]);_0x2da68a['attributes']=_[_0x9218('0x36')](_0x451607[_0x9218('0x33')],qs['fields'](_0x2731a9[_0x9218('0x34')][_0x9218('0x38')]));_0x2da68a[_0x9218('0x37')]=_0x2da68a[_0x9218('0x37')][_0x9218('0x46')]?_0x2da68a[_0x9218('0x37')]:_0x451607[_0x9218('0x33')];if(!_0x2731a9[_0x9218('0x34')]['hasOwnProperty'](_0x9218('0x57'))){_0x2da68a[_0x9218('0x39')]=qs[_0x9218('0x39')](_0x2731a9[_0x9218('0x34')][_0x9218('0x39')]);_0x2da68a[_0x9218('0x1f')]=qs[_0x9218('0x1f')](_0x2731a9[_0x9218('0x34')][_0x9218('0x1f')]);}_0x2da68a[_0x9218('0x6e')]=qs[_0x9218('0x3a')](_0x2731a9['query']['sort']);_0x2da68a[_0x9218('0x3e')]=qs[_0x9218('0x3c')](_['pick'](_0x2731a9[_0x9218('0x34')],_0x451607['filters']));_0x2da68a[_0x9218('0x6b')]=!![];if(_0x2731a9['query'][_0x9218('0x3d')]){_0x2da68a['where']=_[_0x9218('0x40')](_0x2da68a['where'],{'$or':_[_0x9218('0x2e')](_0x2da68a['attributes'],function(_0x2308d8){var _0x5f1f67={};_0x5f1f67[_0x2308d8]={'$like':'%'+_0x2731a9[_0x9218('0x34')][_0x9218('0x3d')]+'%'};return _0x5f1f67;})});}_0x2da68a=_[_0x9218('0x40')]({},_0x2da68a,_0x2731a9[_0x9218('0x58')]);return _0x5c0d6['getContacts'](_0x2da68a);}})['then'](function(_0x1bb0a9){if(!_[_0x9218('0x6f')](_0x1bb0a9)){var _0x369aca=toCsv(_0x1bb0a9);var _0x14dc99=Date['now']();fs['writeFileSync'](util[_0x9218('0x6d')](_0x9218('0x70'),_0x5c0d6['id'],_0x14dc99),_0x369aca);_0x43d083[_0x9218('0x71')](_0x9218('0x72'),_0x9218('0x73')+util[_0x9218('0x6d')](_0x9218('0x74'),_0x5c0d6['id'],_0x14dc99));_0x43d083['setHeader'](_0x9218('0x75'),'text/csv');return _0x43d083[_0x9218('0x76')](util[_0x9218('0x6d')](_0x9218('0x70'),_0x5c0d6['id'],_0x14dc99));}else{return _0x43d083[_0x9218('0x1b')](0xcc);}})[_0x9218('0x49')](handleError(_0x43d083,null));};exports[_0x9218('0x77')]=function(_0x443da2,_0x29633e,_0x5c3da1){var _0x32ee21;delete _0x443da2[_0x9218('0x4b')]['id'];return db[_0x9218('0x2f')]['findOne']({'where':{'id':_0x443da2['params']['id']}})[_0x9218('0x27')](handleEntityNotFound(_0x29633e,null))[_0x9218('0x27')](function(_0x2632cd){if(_0x2632cd){return db[_0x9218('0x78')][_0x9218('0x79')](function(_0x352f36){return db['CmCustomField'][_0x9218('0x4a')](_0x443da2[_0x9218('0x4b')],{'transaction':_0x352f36})[_0x9218('0x27')](function(_0x44aceb){_0x32ee21=_0x44aceb;return _0x2632cd['addCustomFields'](_0x44aceb,{'transaction':_0x352f36});})['then'](function(){var _0x1841dd={'type':db[_0x9218('0x7a')][_0x9218('0x7b')],'transaction':_0x352f36};switch(_0x443da2['body'][_0x9218('0x32')]){case _0x9218('0x7c'):_0x1841dd['type']=db[_0x9218('0x7a')]['TEXT'];break;case _0x9218('0x7d'):_0x1841dd[_0x9218('0x32')]=db['Sequelize'][_0x9218('0x7e')];break;case _0x9218('0x7f'):_0x1841dd[_0x9218('0x32')]=db[_0x9218('0x7a')]['BOOLEAN'];_0x1841dd[_0x9218('0x80')]=![];break;default:}return db[_0x9218('0x78')][_0x9218('0x81')]['addColumn'](_0x9218('0x82'),util[_0x9218('0x6d')](_0x9218('0x83'),_0x32ee21['id']),_0x1841dd);})['then'](function(){return _0x32ee21;});});}})['then'](respondWithResult(_0x29633e,null))[_0x9218('0x49')](handleError(_0x29633e,null));};exports[_0x9218('0x84')]=function(_0x51e2b9,_0x18fe8b,_0x48fd93){var _0x5b69e={};var _0x153b1d={};var _0xa8a1;var _0x2d32eb;return db[_0x9218('0x2f')][_0x9218('0x56')]({'where':{'id':_0x51e2b9[_0x9218('0x45')]['id']}})[_0x9218('0x27')](handleEntityNotFound(_0x18fe8b,null))[_0x9218('0x27')](function(_0x4f8eae){if(_0x4f8eae){_0xa8a1=_0x4f8eae;_0x153b1d[_0x9218('0x33')]=_['keys'](db[_0x9218('0x85')][_0x9218('0x30')]);_0x153b1d[_0x9218('0x34')]=_[_0x9218('0x35')](_0x51e2b9['query']);_0x153b1d[_0x9218('0x3c')]=_['intersection'](_0x153b1d['model'],_0x153b1d['query']);_0x5b69e[_0x9218('0x37')]=_[_0x9218('0x36')](_0x153b1d[_0x9218('0x33')],qs[_0x9218('0x38')](_0x51e2b9[_0x9218('0x34')][_0x9218('0x38')]));_0x5b69e[_0x9218('0x37')]=_0x5b69e[_0x9218('0x37')][_0x9218('0x46')]?_0x5b69e['attributes']:_0x153b1d[_0x9218('0x33')];_0x5b69e[_0x9218('0x6e')]=qs[_0x9218('0x3a')](_0x51e2b9[_0x9218('0x34')][_0x9218('0x3a')]);_0x5b69e[_0x9218('0x3e')]=qs['filters'](_[_0x9218('0x3b')](_0x51e2b9['query'],_0x153b1d[_0x9218('0x3c')]));_0x5b69e['where']=_[_0x9218('0x40')](_0x5b69e[_0x9218('0x3e')],{'$or':[{'ListId':_0x4f8eae['id']},{'ListId':null}]});if(_0x51e2b9[_0x9218('0x34')]['filter']){_0x5b69e[_0x9218('0x3e')]=_[_0x9218('0x40')](_0x5b69e[_0x9218('0x3e')],{'$or':_[_0x9218('0x2e')](_0x5b69e[_0x9218('0x37')],function(_0x529d11){var _0x517ef9={};_0x517ef9[_0x529d11]={'$like':'%'+_0x51e2b9[_0x9218('0x34')][_0x9218('0x3d')]+'%'};return _0x517ef9;})});}_0x5b69e=_[_0x9218('0x40')]({},_0x5b69e,_0x51e2b9[_0x9218('0x58')]);return db[_0x9218('0x85')]['findAndCountAll'](_0x5b69e);}})[_0x9218('0x27')](respondWithResult(_0x18fe8b,null))['catch'](handleError(_0x18fe8b,null));};exports['addAgents']=function(_0x4aa32e,_0x1c189e,_0x364a22){return db['CmList'][_0x9218('0x48')]({'where':{'id':_0x4aa32e[_0x9218('0x45')]['id']}})['then'](handleEntityNotFound(_0x1c189e,null))['then'](function(_0x3506ec){if(_0x3506ec){return _0x3506ec['addAgents'](_0x4aa32e[_0x9218('0x4b')]['ids'],_[_0x9218('0x61')](_0x4aa32e[_0x9218('0x4b')],[_0x9218('0x5a'),'id'])||{})[_0x9218('0x86')](function(_0x591931){for(var _0x107d9d=0x0;_0x107d9d<_0x4aa32e[_0x9218('0x4b')][_0x9218('0x5a')][_0x9218('0x46')];_0x107d9d+=0x1){socket[_0x9218('0x87')]('userCmList:save',{'UserId':_0x4aa32e[_0x9218('0x4b')]['ids'][_0x107d9d],'CmListId':_0x4aa32e[_0x9218('0x45')]['id']});}return _0x591931;});}})['then'](respondWithResult(_0x1c189e,null))[_0x9218('0x49')](handleError(_0x1c189e,null));};exports[_0x9218('0x88')]=function(_0x1b5165,_0x15f1b7,_0x3f037b){return db[_0x9218('0x2f')][_0x9218('0x48')]({'where':{'id':_0x1b5165[_0x9218('0x45')]['id']}})[_0x9218('0x27')](handleEntityNotFound(_0x15f1b7,null))[_0x9218('0x27')](function(_0xb4edbd){if(_0xb4edbd){return _0xb4edbd['removeAgents'](_0x1b5165[_0x9218('0x34')][_0x9218('0x5a')])[_0x9218('0x27')](function(){if(_['isArray'](_0x1b5165[_0x9218('0x34')]['ids'])){for(var _0x1e2a02=0x0;_0x1e2a02<_0x1b5165['query'][_0x9218('0x5a')]['length'];_0x1e2a02+=0x1){socket[_0x9218('0x87')](_0x9218('0x89'),{'UserId':Number(_0x1b5165[_0x9218('0x34')][_0x9218('0x5a')][_0x1e2a02]),'CmListId':Number(_0x1b5165[_0x9218('0x45')]['id'])});}}else{socket[_0x9218('0x87')](_0x9218('0x89'),{'UserId':Number(_0x1b5165[_0x9218('0x34')][_0x9218('0x5a')]),'CmListId':Number(_0x1b5165[_0x9218('0x45')]['id'])});}});}})[_0x9218('0x27')](respondWithStatusCode(_0x15f1b7,null))[_0x9218('0x49')](handleError(_0x15f1b7,null));};exports[_0x9218('0x8a')]=function(_0x5933b8,_0xcc24b2,_0x5ca74b){var _0x3ffdbb={};var _0x581d0a={};var _0x3b0dd3;var _0x461662;return db[_0x9218('0x2f')]['findOne']({'where':{'id':_0x5933b8[_0x9218('0x45')]['id']}})['then'](handleEntityNotFound(_0xcc24b2,null))[_0x9218('0x27')](function(_0x11bdfd){if(_0x11bdfd){_0x3b0dd3=_0x11bdfd;_0x581d0a[_0x9218('0x33')]=_[_0x9218('0x35')](db[_0x9218('0x8b')][_0x9218('0x30')]);_0x581d0a['query']=_['keys'](_0x5933b8[_0x9218('0x34')]);_0x581d0a[_0x9218('0x3c')]=_['intersection'](_0x581d0a[_0x9218('0x33')],_0x581d0a[_0x9218('0x34')]);_0x3ffdbb[_0x9218('0x37')]=_[_0x9218('0x36')](_0x581d0a[_0x9218('0x33')],qs['fields'](_0x5933b8[_0x9218('0x34')][_0x9218('0x38')]));_0x3ffdbb[_0x9218('0x37')]=_0x3ffdbb[_0x9218('0x37')][_0x9218('0x46')]?_0x3ffdbb[_0x9218('0x37')]:_0x581d0a[_0x9218('0x33')];_0x3ffdbb[_0x9218('0x6e')]=qs['sort'](_0x5933b8[_0x9218('0x34')][_0x9218('0x3a')]);_0x3ffdbb[_0x9218('0x3e')]=qs[_0x9218('0x3c')](_['pick'](_0x5933b8[_0x9218('0x34')],_0x581d0a[_0x9218('0x3c')]));if(_0x5933b8[_0x9218('0x34')][_0x9218('0x3d')]){_0x3ffdbb[_0x9218('0x3e')]=_[_0x9218('0x40')](_0x3ffdbb['where'],{'$or':_[_0x9218('0x2e')](_0x3ffdbb['attributes'],function(_0x1edcb1){var _0xadede={};_0xadede[_0x1edcb1]={'$like':'%'+_0x5933b8[_0x9218('0x34')][_0x9218('0x3d')]+'%'};return _0xadede;})});}_0x3ffdbb=_[_0x9218('0x40')]({},_0x3ffdbb,_0x5933b8[_0x9218('0x58')]);return _0x3b0dd3[_0x9218('0x8a')](_0x3ffdbb);}})[_0x9218('0x27')](function(_0x407b83){if(_0x407b83){_0x461662=_0x407b83[_0x9218('0x46')];if(!_0x5933b8[_0x9218('0x34')]['hasOwnProperty'](_0x9218('0x57'))){_0x3ffdbb['limit']=qs[_0x9218('0x39')](_0x5933b8[_0x9218('0x34')][_0x9218('0x39')]);_0x3ffdbb['offset']=qs['offset'](_0x5933b8[_0x9218('0x34')][_0x9218('0x1f')]);}return _0x3b0dd3[_0x9218('0x8a')](_0x3ffdbb);}})[_0x9218('0x27')](function(_0x262f61){if(_0x262f61){return _0x262f61?{'count':_0x461662,'rows':_0x262f61}:null;}})[_0x9218('0x27')](respondWithResult(_0xcc24b2,null))[_0x9218('0x49')](handleError(_0xcc24b2,null));}; \ No newline at end of file +var _0x0a85=['/tmp/list_%d_%s.csv','attachment;\x20filename=','setHeader','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','text','TEXT','number','BOOLEAN','defaultValue','sequelize','getCustomFields','findOne','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','Lists','UserProfileResource','error','stack','send','index','map','CmList','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','params','keys','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','find','describe','addDisposition','Disposition','getDispositions','ListId','findAll','rows','removeDispositions','ids','addContacts','CmContact','isArray','tags','join','push','each','success','dataValues','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','isEmpty','now','writeFileSync'];(function(_0x3efadf,_0x364aa4){var _0x1d1e97=function(_0x1351c1){while(--_0x1351c1){_0x3efadf['push'](_0x3efadf['shift']());}};_0x1d1e97(++_0x364aa4);}(_0x0a85,0x141));var _0x50a8=function(_0x44bafe,_0x57a2c8){_0x44bafe=_0x44bafe-0x0;var _0x34167f=_0x0a85[_0x44bafe];return _0x34167f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x50a8('0x0'));var rimraf=require(_0x50a8('0x1'));var zipdir=require(_0x50a8('0x2'));var jsonpatch=require(_0x50a8('0x3'));var rp=require(_0x50a8('0x4'));var moment=require(_0x50a8('0x5'));var BPromise=require(_0x50a8('0x6'));var Mustache=require('mustache');var util=require(_0x50a8('0x7'));var path=require(_0x50a8('0x8'));var sox=require(_0x50a8('0x9'));var csv=require(_0x50a8('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x50a8('0xb'));var squel=require(_0x50a8('0xc'));var crypto=require(_0x50a8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x50a8('0xa'));var querystring=require('querystring');var Papa=require(_0x50a8('0xe'));var Redis=require('ioredis');var authService=require(_0x50a8('0xf'));var qs=require(_0x50a8('0x10'));var as=require(_0x50a8('0x11'));var hardwareService=require(_0x50a8('0x12'));var logger=require(_0x50a8('0x13'))(_0x50a8('0x14'));var utils=require(_0x50a8('0x15'));var config=require(_0x50a8('0x16'));var db=require(_0x50a8('0x17'))['db'];config[_0x50a8('0x18')]=_['defaults'](config['redis'],{'host':_0x50a8('0x19'),'port':0x18eb});var socket=require(_0x50a8('0x1a'))(new Redis(config[_0x50a8('0x18')]));require(_0x50a8('0x1b'))[_0x50a8('0x1c')](socket);function respondWithStatusCode(_0x2287a3,_0xaf077a){_0xaf077a=_0xaf077a||0xcc;return function(_0x38aa45){if(_0x38aa45){return _0x2287a3[_0x50a8('0x1d')](_0xaf077a);}return _0x2287a3[_0x50a8('0x1e')](_0xaf077a)[_0x50a8('0x1f')]();};}function respondWithResult(_0x4ec211,_0x11b40e){_0x11b40e=_0x11b40e||0xc8;return function(_0x5b6930){if(_0x5b6930){return _0x4ec211[_0x50a8('0x1e')](_0x11b40e)[_0x50a8('0x20')](_0x5b6930);}};}function respondWithFilteredResult(_0x37bc4f,_0x33ac96){return function(_0xafcb6b){if(_0xafcb6b){var _0x3eb127=_0xafcb6b[_0x50a8('0x21')],_0x350427=_0x33ac96[_0x50a8('0x22')],_0x2ddf87=_0x33ac96[_0x50a8('0x22')]+_0x33ac96[_0x50a8('0x23')],_0x498a6e;if(_0x2ddf87>=_0x3eb127){_0x2ddf87=_0x3eb127;_0x498a6e=0xc8;}else{_0x498a6e=0xce;}_0x37bc4f[_0x50a8('0x1e')](_0x498a6e);return _0x37bc4f[_0x50a8('0x24')](_0x50a8('0x25'),_0x350427+'-'+_0x2ddf87+'/'+_0x3eb127)[_0x50a8('0x20')](_0xafcb6b);}return null;};}function patchUpdates(_0x16b087){return function(_0x3b47f1){try{jsonpatch[_0x50a8('0x26')](_0x3b47f1,_0x16b087,!![]);}catch(_0x2c902b){return BPromise[_0x50a8('0x27')](_0x2c902b);}return _0x3b47f1[_0x50a8('0x28')]();};}function saveUpdates(_0x499a56,_0x383949){return function(_0xbafcaa){if(_0xbafcaa){return _0xbafcaa['update'](_0x499a56)[_0x50a8('0x29')](function(_0x131686){return _0x131686;});}return null;};}function removeEntity(_0x242cc4,_0x647779){return function(_0x34670c){if(_0x34670c){return _0x34670c[_0x50a8('0x2a')]()['then'](function(){var _0x1420eb=_0x34670c[_0x50a8('0x2b')]({'plain':!![]});var _0x25583d=_0x50a8('0x2c');return db[_0x50a8('0x2d')]['destroy']({'where':{'type':_0x25583d,'resourceId':_0x1420eb['id']}})['then'](function(){return _0x34670c;});})['then'](function(){_0x242cc4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55fb12,_0x117a40){return function(_0x3ae6dc){if(!_0x3ae6dc){_0x55fb12[_0x50a8('0x1d')](0x194);}return _0x3ae6dc;};}function handleError(_0x15d9f2,_0x59a892){_0x59a892=_0x59a892||0x1f4;return function(_0x4b408c){logger[_0x50a8('0x2e')](_0x4b408c[_0x50a8('0x2f')]);if(_0x4b408c['name']){delete _0x4b408c['name'];}_0x15d9f2[_0x50a8('0x1e')](_0x59a892)[_0x50a8('0x30')](_0x4b408c);};}exports[_0x50a8('0x31')]=function(_0x4de08d,_0x38d281){var _0x11502e={},_0xf7682f={},_0xf1b9e6={'count':0x0,'rows':[]};var _0x4f3ffe=_[_0x50a8('0x32')](db[_0x50a8('0x33')][_0x50a8('0x34')],function(_0x41d5e0){return{'name':_0x41d5e0[_0x50a8('0x35')],'type':_0x41d5e0[_0x50a8('0x36')][_0x50a8('0x37')]};});_0xf7682f[_0x50a8('0x38')]=_[_0x50a8('0x32')](_0x4f3ffe,_0x50a8('0x39'));_0xf7682f[_0x50a8('0x3a')]=_['keys'](_0x4de08d['query']);_0xf7682f[_0x50a8('0x3b')]=_[_0x50a8('0x3c')](_0xf7682f['model'],_0xf7682f[_0x50a8('0x3a')]);_0x11502e[_0x50a8('0x3d')]=_[_0x50a8('0x3c')](_0xf7682f[_0x50a8('0x38')],qs['fields'](_0x4de08d[_0x50a8('0x3a')][_0x50a8('0x3e')]));_0x11502e['attributes']=_0x11502e[_0x50a8('0x3d')][_0x50a8('0x3f')]?_0x11502e[_0x50a8('0x3d')]:_0xf7682f[_0x50a8('0x38')];if(!_0x4de08d[_0x50a8('0x3a')][_0x50a8('0x40')](_0x50a8('0x41'))){_0x11502e[_0x50a8('0x23')]=qs[_0x50a8('0x23')](_0x4de08d[_0x50a8('0x3a')]['limit']);_0x11502e[_0x50a8('0x22')]=qs[_0x50a8('0x22')](_0x4de08d[_0x50a8('0x3a')][_0x50a8('0x22')]);}_0x11502e[_0x50a8('0x42')]=qs[_0x50a8('0x43')](_0x4de08d[_0x50a8('0x3a')][_0x50a8('0x43')]);_0x11502e[_0x50a8('0x44')]=qs[_0x50a8('0x3b')](_[_0x50a8('0x45')](_0x4de08d[_0x50a8('0x3a')],_0xf7682f[_0x50a8('0x3b')]),_0x4f3ffe);if(_0x4de08d['query'][_0x50a8('0x46')]){_0x11502e[_0x50a8('0x44')]=_[_0x50a8('0x47')](_0x11502e[_0x50a8('0x44')],{'$or':_[_0x50a8('0x32')](_0x4f3ffe,function(_0x47f208){if(_0x47f208[_0x50a8('0x36')]!==_0x50a8('0x48')){var _0x449eff={};_0x449eff[_0x47f208[_0x50a8('0x39')]]={'$like':'%'+_0x4de08d['query']['filter']+'%'};return _0x449eff;}})});}_0x11502e=_[_0x50a8('0x47')]({},_0x11502e,_0x4de08d[_0x50a8('0x49')]);var _0x4296b7={'where':_0x11502e['where']};return db[_0x50a8('0x33')][_0x50a8('0x21')](_0x4296b7)['then'](function(_0x527a04){_0xf1b9e6['count']=_0x527a04;if(_0x4de08d[_0x50a8('0x3a')][_0x50a8('0x4a')]){_0x11502e[_0x50a8('0x4b')]=[{'all':!![]}];}return db[_0x50a8('0x33')]['findAll'](_0x11502e);})[_0x50a8('0x29')](function(_0x28a4ba){_0xf1b9e6['rows']=_0x28a4ba;return _0xf1b9e6;})[_0x50a8('0x29')](respondWithFilteredResult(_0x38d281,_0x11502e))['catch'](handleError(_0x38d281,null));};exports['show']=function(_0x213ace,_0x12e52d){var _0x49d6c8={'raw':![],'where':{'id':_0x213ace[_0x50a8('0x4c')]['id']}},_0x263fc7={};_0x263fc7['model']=_[_0x50a8('0x4d')](db['CmList'][_0x50a8('0x34')]);_0x263fc7[_0x50a8('0x3a')]=_[_0x50a8('0x4d')](_0x213ace[_0x50a8('0x3a')]);_0x263fc7[_0x50a8('0x3b')]=_[_0x50a8('0x3c')](_0x263fc7[_0x50a8('0x38')],_0x263fc7[_0x50a8('0x3a')]);_0x49d6c8[_0x50a8('0x3d')]=_[_0x50a8('0x3c')](_0x263fc7[_0x50a8('0x38')],qs[_0x50a8('0x3e')](_0x213ace['query']['fields']));_0x49d6c8[_0x50a8('0x3d')]=_0x49d6c8[_0x50a8('0x3d')][_0x50a8('0x3f')]?_0x49d6c8[_0x50a8('0x3d')]:_0x263fc7['model'];if(_0x213ace[_0x50a8('0x3a')][_0x50a8('0x4a')]){_0x49d6c8[_0x50a8('0x4b')]=[{'all':!![]}];}_0x49d6c8=_[_0x50a8('0x47')]({},_0x49d6c8,_0x213ace[_0x50a8('0x49')]);return db[_0x50a8('0x33')]['find'](_0x49d6c8)['then'](handleEntityNotFound(_0x12e52d,null))[_0x50a8('0x29')](respondWithResult(_0x12e52d,null))[_0x50a8('0x4e')](handleError(_0x12e52d,null));};exports[_0x50a8('0x4f')]=function(_0x4bf0e6,_0x231d08){return db[_0x50a8('0x33')]['create'](_0x4bf0e6['body'],{})[_0x50a8('0x29')](function(_0x5e4423){var _0xaf7c02=_0x4bf0e6[_0x50a8('0x50')][_0x50a8('0x2b')]({'plain':!![]});if(!_0xaf7c02)throw new Error(_0x50a8('0x51'));if(_0xaf7c02[_0x50a8('0x52')]===_0x50a8('0x50')){var _0x24c6bf=_0x5e4423[_0x50a8('0x2b')]({'plain':!![]});var _0x5a4763=_0x50a8('0x2c');return db[_0x50a8('0x53')]['find']({'where':{'name':_0x5a4763,'userProfileId':_0xaf7c02[_0x50a8('0x54')]},'raw':!![]})['then'](function(_0x3449f6){if(_0x3449f6&&_0x3449f6[_0x50a8('0x55')]===0x0){return db[_0x50a8('0x2d')][_0x50a8('0x4f')]({'name':_0x24c6bf['name'],'resourceId':_0x24c6bf['id'],'type':_0x3449f6[_0x50a8('0x39')],'sectionId':_0x3449f6['id']},{})[_0x50a8('0x29')](function(){return _0x5e4423;});}else{return _0x5e4423;}})[_0x50a8('0x4e')](function(_0x4b0ee3){logger[_0x50a8('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b0ee3);throw _0x4b0ee3;});}return _0x5e4423;})[_0x50a8('0x29')](respondWithResult(_0x231d08,0xc9))[_0x50a8('0x4e')](handleError(_0x231d08,null));};exports[_0x50a8('0x56')]=function(_0x4048ec,_0x476863){if(_0x4048ec[_0x50a8('0x57')]['id']){delete _0x4048ec['body']['id'];}return db[_0x50a8('0x33')]['find']({'where':{'id':_0x4048ec[_0x50a8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x476863,null))[_0x50a8('0x29')](saveUpdates(_0x4048ec[_0x50a8('0x57')],null))[_0x50a8('0x29')](respondWithResult(_0x476863,null))[_0x50a8('0x4e')](handleError(_0x476863,null));};exports[_0x50a8('0x2a')]=function(_0x256691,_0x1d92a3){return db[_0x50a8('0x33')][_0x50a8('0x58')]({'where':{'id':_0x256691['params']['id']}})['then'](handleEntityNotFound(_0x1d92a3,null))[_0x50a8('0x29')](removeEntity(_0x1d92a3,null))[_0x50a8('0x4e')](handleError(_0x1d92a3,null));};exports[_0x50a8('0x59')]=function(_0x79c4f4,_0x2947d3){return db['CmList'][_0x50a8('0x59')]()[_0x50a8('0x29')](respondWithResult(_0x2947d3,null))[_0x50a8('0x4e')](handleError(_0x2947d3,null));};exports[_0x50a8('0x5a')]=function(_0x1e1a54,_0x86d743,_0x111d98){if(_0x1e1a54[_0x50a8('0x57')]['id']){delete _0x1e1a54[_0x50a8('0x57')]['id'];}return db[_0x50a8('0x33')][_0x50a8('0x58')]({'where':{'id':_0x1e1a54[_0x50a8('0x4c')]['id']}})[_0x50a8('0x29')](handleEntityNotFound(_0x86d743,null))[_0x50a8('0x29')](function(_0x41de48){if(_0x41de48){_0x1e1a54[_0x50a8('0x57')]['ListId']=_0x41de48['id'];return db[_0x50a8('0x5b')][_0x50a8('0x4f')](_0x1e1a54[_0x50a8('0x57')]);}})['then'](respondWithResult(_0x86d743,null))[_0x50a8('0x4e')](handleError(_0x86d743,null));};exports[_0x50a8('0x5c')]=function(_0x4e4326,_0xc8c2c9,_0x579f0d){var _0x91021c={'raw':![],'where':{}};var _0x189620={};var _0x261ef2={'count':0x0,'rows':[]};return db[_0x50a8('0x33')]['findOne']({'where':{'id':_0x4e4326[_0x50a8('0x4c')]['id']}})[_0x50a8('0x29')](handleEntityNotFound(_0xc8c2c9,null))[_0x50a8('0x29')](function(_0x1cec1c){if(_0x1cec1c){_0x189620['model']=_[_0x50a8('0x4d')](db[_0x50a8('0x5b')][_0x50a8('0x34')]);_0x189620['query']=_[_0x50a8('0x4d')](_0x4e4326[_0x50a8('0x3a')]);_0x189620[_0x50a8('0x3b')]=_['intersection'](_0x189620[_0x50a8('0x38')],_0x189620[_0x50a8('0x3a')]);_0x91021c['attributes']=_['intersection'](_0x189620['model'],qs['fields'](_0x4e4326[_0x50a8('0x3a')]['fields']));_0x91021c[_0x50a8('0x3d')]=_0x91021c[_0x50a8('0x3d')][_0x50a8('0x3f')]?_0x91021c[_0x50a8('0x3d')]:_0x189620[_0x50a8('0x38')];if(!_0x4e4326[_0x50a8('0x3a')][_0x50a8('0x40')](_0x50a8('0x41'))){_0x91021c[_0x50a8('0x23')]=qs[_0x50a8('0x23')](_0x4e4326[_0x50a8('0x3a')]['limit']);_0x91021c['offset']=qs[_0x50a8('0x22')](_0x4e4326[_0x50a8('0x3a')][_0x50a8('0x22')]);}_0x91021c[_0x50a8('0x42')]=qs[_0x50a8('0x43')](_0x4e4326[_0x50a8('0x3a')][_0x50a8('0x43')]);_0x91021c[_0x50a8('0x44')]=qs['filters'](_[_0x50a8('0x45')](_0x4e4326[_0x50a8('0x3a')],_0x189620[_0x50a8('0x3b')]));_0x91021c[_0x50a8('0x44')][_0x50a8('0x5d')]=_0x1cec1c['id'];if(_0x4e4326[_0x50a8('0x3a')]['filter']){_0x91021c[_0x50a8('0x44')]=_[_0x50a8('0x47')](_0x91021c[_0x50a8('0x44')],{'$or':_[_0x50a8('0x32')](_0x91021c['attributes'],function(_0x3cf09a){var _0x2c430d={};_0x2c430d[_0x3cf09a]={'$like':'%'+_0x4e4326['query']['filter']+'%'};return _0x2c430d;})});}_0x91021c=_['merge']({},_0x91021c,_0x4e4326[_0x50a8('0x49')]);return db['Disposition'][_0x50a8('0x21')]({'where':_0x91021c['where']})[_0x50a8('0x29')](function(_0x74a4e6){_0x261ef2[_0x50a8('0x21')]=_0x74a4e6;if(_0x4e4326[_0x50a8('0x3a')][_0x50a8('0x4a')]){_0x91021c[_0x50a8('0x4b')]=[{'all':!![]}];}return db[_0x50a8('0x5b')][_0x50a8('0x5e')](_0x91021c);})[_0x50a8('0x29')](function(_0x1dcf98){_0x261ef2[_0x50a8('0x5f')]=_0x1dcf98;return _0x261ef2;});}})[_0x50a8('0x29')](respondWithFilteredResult(_0xc8c2c9,_0x91021c))[_0x50a8('0x4e')](handleError(_0xc8c2c9,null));};exports[_0x50a8('0x60')]=function(_0x2b4a85,_0x14e481,_0x3f855b){return db[_0x50a8('0x33')]['find']({'where':{'id':_0x2b4a85['params']['id']}})[_0x50a8('0x29')](handleEntityNotFound(_0x14e481,null))[_0x50a8('0x29')](function(_0x290440){if(_0x290440){return _0x290440[_0x50a8('0x60')](_0x2b4a85['query'][_0x50a8('0x61')]);}})[_0x50a8('0x29')](respondWithStatusCode(_0x14e481,null))[_0x50a8('0x4e')](handleError(_0x14e481,null));};exports[_0x50a8('0x62')]=function(_0x388444,_0xebf3c0,_0x1923f9){return db[_0x50a8('0x33')][_0x50a8('0x58')]({'where':{'id':_0x388444['params']['id']}})[_0x50a8('0x29')](handleEntityNotFound(_0xebf3c0,null))[_0x50a8('0x29')](function(_0x4dfb0a){if(_0x4dfb0a){var _0x551da7=[];var _0xc20dc7={'success':[],'errors':[]};return db[_0x50a8('0x63')][_0x50a8('0x59')]()['then'](function(_0x5b0e46){if(_0x388444[_0x50a8('0x57')]['tags']&&_[_0x50a8('0x64')](_0x388444[_0x50a8('0x57')][_0x50a8('0x65')])){if(_0x388444[_0x50a8('0x57')][_0x50a8('0x65')][_0x50a8('0x3f')]){_0x388444[_0x50a8('0x57')]['tags']=_0x388444[_0x50a8('0x57')][_0x50a8('0x65')][_0x50a8('0x66')](';')+';';}else{_0x388444[_0x50a8('0x57')][_0x50a8('0x65')]=null;}}else{_0x388444[_0x50a8('0x57')][_0x50a8('0x65')]=null;}if(_0x388444['body']&&_['isArray'](_0x388444['body'])){for(var _0x5ecdfc=0x0;_0x5ecdfc<_0x388444[_0x50a8('0x57')]['length'];_0x5ecdfc+=0x1){_0x388444['body'][_0x5ecdfc][_0x50a8('0x5d')]=_0x388444[_0x50a8('0x4c')]['id'];_0x551da7[_0x50a8('0x67')](_0x388444[_0x50a8('0x57')][_0x5ecdfc]);}return BPromise[_0x50a8('0x68')](_0x551da7,function(_0xdda813){return db[_0x50a8('0x63')][_0x50a8('0x4f')](_['omit'](_0xdda813,[_0x50a8('0x61'),'id'])||{},{'fields':_[_0x50a8('0x4d')](_0x5b0e46),'raw':!![]})[_0x50a8('0x29')](function(_0x4401c7){_0xc20dc7[_0x50a8('0x69')][_0x50a8('0x67')](_0x4401c7[_0x50a8('0x6a')]);})[_0x50a8('0x4e')](function(_0x1ab393){_0xc20dc7[_0x50a8('0x6b')][_0x50a8('0x67')]({'data':_0xdda813,'error':_0x1ab393[_0x50a8('0x6c')]});});})[_0x50a8('0x29')](function(_0x1e1121){return _0xc20dc7;})[_0x50a8('0x4e')](function(_0x2992a1){return _0x2992a1;});}else{_0xebf3c0['status'](0x190)[_0x50a8('0x20')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x50a8('0x29')](respondWithResult(_0xebf3c0,null))[_0x50a8('0x4e')](handleError(_0xebf3c0,null));};exports[_0x50a8('0x6d')]=function(_0x34b908,_0x45cfdd,_0x3b1ba8){var _0x54173e;return db[_0x50a8('0x33')][_0x50a8('0x58')]({'where':{'id':_0x34b908[_0x50a8('0x4c')]['id']},'include':[{'model':db[_0x50a8('0x6e')],'as':_0x50a8('0x6f')}]})[_0x50a8('0x29')](handleEntityNotFound(_0x45cfdd,null))[_0x50a8('0x29')](function(_0x5e4331){if(_0x5e4331){_0x54173e=_0x5e4331;return db['CmContact'][_0x50a8('0x34')];}})[_0x50a8('0x29')](function(_0x2e8d90){if(_0x2e8d90){var _0x491341={};var _0x2a70e7={};_0x2a70e7[_0x50a8('0x38')]=_[_0x50a8('0x70')](_[_0x50a8('0x4d')](_0x2e8d90),_[_0x50a8('0x32')](_0x54173e[_0x50a8('0x6f')],function(_0xc43f8d){return util[_0x50a8('0x71')](_0x50a8('0x72'),_0xc43f8d['id']);}));_0x2a70e7[_0x50a8('0x3a')]=_[_0x50a8('0x4d')](_0x34b908['query']);_0x2a70e7[_0x50a8('0x3b')]=_[_0x50a8('0x3c')](_0x2a70e7['model'],_0x2a70e7['query']);_0x491341[_0x50a8('0x3d')]=_[_0x50a8('0x3c')](_0x2a70e7[_0x50a8('0x38')],qs[_0x50a8('0x3e')](_0x34b908['query'][_0x50a8('0x3e')]));_0x491341[_0x50a8('0x3d')]=_0x491341[_0x50a8('0x3d')][_0x50a8('0x3f')]?_0x491341[_0x50a8('0x3d')]:_0x2a70e7[_0x50a8('0x38')];if(!_0x34b908['query'][_0x50a8('0x40')]('nolimit')){_0x491341[_0x50a8('0x23')]=qs[_0x50a8('0x23')](_0x34b908[_0x50a8('0x3a')]['limit']);_0x491341[_0x50a8('0x22')]=qs[_0x50a8('0x22')](_0x34b908[_0x50a8('0x3a')][_0x50a8('0x22')]);}_0x491341[_0x50a8('0x42')]=qs[_0x50a8('0x43')](_0x34b908['query'][_0x50a8('0x43')]);_0x491341[_0x50a8('0x44')]=qs['filters'](_['pick'](_0x34b908[_0x50a8('0x3a')],_0x2a70e7[_0x50a8('0x3b')]));_0x491341[_0x50a8('0x73')]=!![];if(_0x34b908[_0x50a8('0x3a')]['filter']){_0x491341[_0x50a8('0x44')]=_['merge'](_0x491341[_0x50a8('0x44')],{'$or':_['map'](_0x491341[_0x50a8('0x3d')],function(_0x1832d5){var _0x45eec4={};_0x45eec4[_0x1832d5]={'$like':'%'+_0x34b908[_0x50a8('0x3a')][_0x50a8('0x46')]+'%'};return _0x45eec4;})});}_0x491341=_['merge']({},_0x491341,_0x34b908[_0x50a8('0x49')]);return _0x54173e[_0x50a8('0x6d')](_0x491341);}})[_0x50a8('0x29')](respondWithResult(_0x45cfdd,null))[_0x50a8('0x4e')](handleError(_0x45cfdd,null));};exports[_0x50a8('0x74')]=function(_0x51c586,_0x480824,_0x92d7c){var _0x32a125;return db['CmList'][_0x50a8('0x58')]({'where':{'id':_0x51c586[_0x50a8('0x4c')]['id']},'include':[{'model':db[_0x50a8('0x6e')],'as':_0x50a8('0x6f')}]})['then'](handleEntityNotFound(_0x480824,null))[_0x50a8('0x29')](function(_0x1e9ae0){if(_0x1e9ae0){_0x32a125=_0x1e9ae0;return db[_0x50a8('0x63')]['rawAttributes'];}})[_0x50a8('0x29')](function(_0x50250){if(_0x50250){var _0x148ab9={};var _0x246c30={};_0x246c30[_0x50a8('0x38')]=_['concat'](_['keys'](_0x50250),_[_0x50a8('0x32')](_0x32a125['CustomFields'],function(_0x107493){return util['format']('cf_%d',_0x107493['id']);}));_0x246c30[_0x50a8('0x3a')]=_[_0x50a8('0x4d')](_0x51c586[_0x50a8('0x3a')]);_0x246c30[_0x50a8('0x3b')]=_[_0x50a8('0x3c')](_0x246c30[_0x50a8('0x38')],_0x246c30[_0x50a8('0x3a')]);_0x148ab9[_0x50a8('0x3d')]=_[_0x50a8('0x3c')](_0x246c30['model'],qs[_0x50a8('0x3e')](_0x51c586['query'][_0x50a8('0x3e')]));_0x148ab9[_0x50a8('0x3d')]=_0x148ab9[_0x50a8('0x3d')][_0x50a8('0x3f')]?_0x148ab9[_0x50a8('0x3d')]:_0x246c30[_0x50a8('0x38')];if(!_0x51c586[_0x50a8('0x3a')][_0x50a8('0x40')](_0x50a8('0x41'))){_0x148ab9[_0x50a8('0x23')]=qs[_0x50a8('0x23')](_0x51c586[_0x50a8('0x3a')][_0x50a8('0x23')]);_0x148ab9['offset']=qs['offset'](_0x51c586[_0x50a8('0x3a')][_0x50a8('0x22')]);}_0x148ab9[_0x50a8('0x42')]=qs[_0x50a8('0x43')](_0x51c586[_0x50a8('0x3a')][_0x50a8('0x43')]);_0x148ab9[_0x50a8('0x44')]=qs[_0x50a8('0x3b')](_[_0x50a8('0x45')](_0x51c586[_0x50a8('0x3a')],_0x246c30[_0x50a8('0x3b')]));_0x148ab9[_0x50a8('0x73')]=!![];if(_0x51c586[_0x50a8('0x3a')][_0x50a8('0x46')]){_0x148ab9[_0x50a8('0x44')]=_['merge'](_0x148ab9[_0x50a8('0x44')],{'$or':_[_0x50a8('0x32')](_0x148ab9[_0x50a8('0x3d')],function(_0x4a1d07){var _0x49f278={};_0x49f278[_0x4a1d07]={'$like':'%'+_0x51c586['query']['filter']+'%'};return _0x49f278;})});}_0x148ab9=_['merge']({},_0x148ab9,_0x51c586[_0x50a8('0x49')]);return _0x32a125[_0x50a8('0x6d')](_0x148ab9);}})['then'](function(_0x42a934){if(!_[_0x50a8('0x75')](_0x42a934)){var _0x1774fb=toCsv(_0x42a934);var _0xe3327e=Date[_0x50a8('0x76')]();fs[_0x50a8('0x77')](util[_0x50a8('0x71')](_0x50a8('0x78'),_0x32a125['id'],_0xe3327e),_0x1774fb);_0x480824['setHeader']('Content-disposition',_0x50a8('0x79')+util['format']('list_%d_%s.csv',_0x32a125['id'],_0xe3327e));_0x480824[_0x50a8('0x7a')](_0x50a8('0x7b'),_0x50a8('0x7c'));return _0x480824[_0x50a8('0x7d')](util['format']('/tmp/list_%d_%s.csv',_0x32a125['id'],_0xe3327e));}else{return _0x480824['sendStatus'](0xcc);}})[_0x50a8('0x4e')](handleError(_0x480824,null));};exports[_0x50a8('0x7e')]=function(_0x257b1e,_0x4d2e69,_0x5069d9){var _0x3c0fd5;delete _0x257b1e[_0x50a8('0x57')]['id'];return db['CmList']['findOne']({'where':{'id':_0x257b1e[_0x50a8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4d2e69,null))[_0x50a8('0x29')](function(_0x3c3f90){if(_0x3c3f90){return db['sequelize'][_0x50a8('0x7f')](function(_0x3096f3){return db[_0x50a8('0x6e')][_0x50a8('0x4f')](_0x257b1e[_0x50a8('0x57')],{'transaction':_0x3096f3})[_0x50a8('0x29')](function(_0x564af9){_0x3c0fd5=_0x564af9;return _0x3c3f90[_0x50a8('0x80')](_0x564af9,{'transaction':_0x3096f3});})['then'](function(){var _0x1eaf81={'type':db[_0x50a8('0x81')]['TEXT'],'transaction':_0x3096f3};switch(_0x257b1e['body'][_0x50a8('0x36')]){case _0x50a8('0x82'):_0x1eaf81['type']=db['Sequelize'][_0x50a8('0x83')];break;case _0x50a8('0x84'):_0x1eaf81[_0x50a8('0x36')]=db['Sequelize']['INTEGER'];break;case'switch':_0x1eaf81[_0x50a8('0x36')]=db[_0x50a8('0x81')][_0x50a8('0x85')];_0x1eaf81[_0x50a8('0x86')]=![];break;default:}return db[_0x50a8('0x87')]['queryInterface']['addColumn']('cm_contacts',util[_0x50a8('0x71')]('cf_%s',_0x3c0fd5['id']),_0x1eaf81);})[_0x50a8('0x29')](function(){return _0x3c0fd5;});});}})[_0x50a8('0x29')](respondWithResult(_0x4d2e69,null))[_0x50a8('0x4e')](handleError(_0x4d2e69,null));};exports[_0x50a8('0x88')]=function(_0x4fa02a,_0x5f0264,_0x202cbb){var _0x8cc8cd={};var _0x5d1eaa={};var _0x27fd55;var _0x295ca5;return db['CmList'][_0x50a8('0x89')]({'where':{'id':_0x4fa02a['params']['id']}})['then'](handleEntityNotFound(_0x5f0264,null))[_0x50a8('0x29')](function(_0x16f270){if(_0x16f270){_0x27fd55=_0x16f270;_0x5d1eaa[_0x50a8('0x38')]=_[_0x50a8('0x4d')](db[_0x50a8('0x6e')][_0x50a8('0x34')]);_0x5d1eaa[_0x50a8('0x3a')]=_[_0x50a8('0x4d')](_0x4fa02a[_0x50a8('0x3a')]);_0x5d1eaa[_0x50a8('0x3b')]=_[_0x50a8('0x3c')](_0x5d1eaa[_0x50a8('0x38')],_0x5d1eaa[_0x50a8('0x3a')]);_0x8cc8cd[_0x50a8('0x3d')]=_[_0x50a8('0x3c')](_0x5d1eaa[_0x50a8('0x38')],qs[_0x50a8('0x3e')](_0x4fa02a[_0x50a8('0x3a')][_0x50a8('0x3e')]));_0x8cc8cd[_0x50a8('0x3d')]=_0x8cc8cd[_0x50a8('0x3d')]['length']?_0x8cc8cd[_0x50a8('0x3d')]:_0x5d1eaa[_0x50a8('0x38')];_0x8cc8cd[_0x50a8('0x42')]=qs['sort'](_0x4fa02a[_0x50a8('0x3a')][_0x50a8('0x43')]);_0x8cc8cd[_0x50a8('0x44')]=qs[_0x50a8('0x3b')](_[_0x50a8('0x45')](_0x4fa02a[_0x50a8('0x3a')],_0x5d1eaa[_0x50a8('0x3b')]));_0x8cc8cd['where']=_[_0x50a8('0x47')](_0x8cc8cd['where'],{'$or':[{'ListId':_0x16f270['id']},{'ListId':null}]});if(_0x4fa02a[_0x50a8('0x3a')][_0x50a8('0x46')]){_0x8cc8cd[_0x50a8('0x44')]=_[_0x50a8('0x47')](_0x8cc8cd['where'],{'$or':_[_0x50a8('0x32')](_0x8cc8cd['attributes'],function(_0x4bef24){var _0x4edf81={};_0x4edf81[_0x4bef24]={'$like':'%'+_0x4fa02a[_0x50a8('0x3a')][_0x50a8('0x46')]+'%'};return _0x4edf81;})});}_0x8cc8cd=_['merge']({},_0x8cc8cd,_0x4fa02a[_0x50a8('0x49')]);return db[_0x50a8('0x6e')][_0x50a8('0x8a')](_0x8cc8cd);}})['then'](respondWithResult(_0x5f0264,null))[_0x50a8('0x4e')](handleError(_0x5f0264,null));};exports[_0x50a8('0x8b')]=function(_0x41db65,_0x3626fd,_0x5a561a){return db[_0x50a8('0x33')][_0x50a8('0x58')]({'where':{'id':_0x41db65[_0x50a8('0x4c')]['id']}})[_0x50a8('0x29')](handleEntityNotFound(_0x3626fd,null))[_0x50a8('0x29')](function(_0x10f9f4){if(_0x10f9f4){return _0x10f9f4['addAgents'](_0x41db65[_0x50a8('0x57')]['ids'],_['omit'](_0x41db65[_0x50a8('0x57')],[_0x50a8('0x61'),'id'])||{})[_0x50a8('0x8c')](function(_0x52e0d8){for(var _0x1e2f96=0x0;_0x1e2f96<_0x41db65[_0x50a8('0x57')][_0x50a8('0x61')][_0x50a8('0x3f')];_0x1e2f96+=0x1){socket[_0x50a8('0x8d')](_0x50a8('0x8e'),{'UserId':_0x41db65[_0x50a8('0x57')][_0x50a8('0x61')][_0x1e2f96],'CmListId':_0x41db65[_0x50a8('0x4c')]['id']});}return _0x52e0d8;});}})['then'](respondWithResult(_0x3626fd,null))[_0x50a8('0x4e')](handleError(_0x3626fd,null));};exports[_0x50a8('0x8f')]=function(_0x192c3c,_0x22c9af,_0xb9cb0a){return db['CmList'][_0x50a8('0x58')]({'where':{'id':_0x192c3c[_0x50a8('0x4c')]['id']}})[_0x50a8('0x29')](handleEntityNotFound(_0x22c9af,null))['then'](function(_0x1655bd){if(_0x1655bd){return _0x1655bd['removeAgents'](_0x192c3c[_0x50a8('0x3a')]['ids'])[_0x50a8('0x29')](function(){if(_[_0x50a8('0x64')](_0x192c3c['query'][_0x50a8('0x61')])){for(var _0x29291b=0x0;_0x29291b<_0x192c3c['query'][_0x50a8('0x61')][_0x50a8('0x3f')];_0x29291b+=0x1){socket[_0x50a8('0x8d')](_0x50a8('0x90'),{'UserId':Number(_0x192c3c[_0x50a8('0x3a')][_0x50a8('0x61')][_0x29291b]),'CmListId':Number(_0x192c3c[_0x50a8('0x4c')]['id'])});}}else{socket[_0x50a8('0x8d')](_0x50a8('0x90'),{'UserId':Number(_0x192c3c[_0x50a8('0x3a')][_0x50a8('0x61')]),'CmListId':Number(_0x192c3c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x22c9af,null))[_0x50a8('0x4e')](handleError(_0x22c9af,null));};exports['getAgents']=function(_0x33fabe,_0x244371,_0x46ebf1){var _0x4a391={};var _0x30c9ff={};var _0x49cc12;var _0x5eddd4;return db[_0x50a8('0x33')]['findOne']({'where':{'id':_0x33fabe[_0x50a8('0x4c')]['id']}})[_0x50a8('0x29')](handleEntityNotFound(_0x244371,null))[_0x50a8('0x29')](function(_0x4552bd){if(_0x4552bd){_0x49cc12=_0x4552bd;_0x30c9ff[_0x50a8('0x38')]=_[_0x50a8('0x4d')](db[_0x50a8('0x91')][_0x50a8('0x34')]);_0x30c9ff[_0x50a8('0x3a')]=_['keys'](_0x33fabe['query']);_0x30c9ff['filters']=_[_0x50a8('0x3c')](_0x30c9ff[_0x50a8('0x38')],_0x30c9ff[_0x50a8('0x3a')]);_0x4a391[_0x50a8('0x3d')]=_[_0x50a8('0x3c')](_0x30c9ff['model'],qs['fields'](_0x33fabe[_0x50a8('0x3a')][_0x50a8('0x3e')]));_0x4a391[_0x50a8('0x3d')]=_0x4a391['attributes']['length']?_0x4a391[_0x50a8('0x3d')]:_0x30c9ff[_0x50a8('0x38')];_0x4a391[_0x50a8('0x42')]=qs[_0x50a8('0x43')](_0x33fabe[_0x50a8('0x3a')][_0x50a8('0x43')]);_0x4a391['where']=qs['filters'](_[_0x50a8('0x45')](_0x33fabe[_0x50a8('0x3a')],_0x30c9ff[_0x50a8('0x3b')]));if(_0x33fabe[_0x50a8('0x3a')][_0x50a8('0x46')]){_0x4a391[_0x50a8('0x44')]=_[_0x50a8('0x47')](_0x4a391[_0x50a8('0x44')],{'$or':_[_0x50a8('0x32')](_0x4a391[_0x50a8('0x3d')],function(_0x22e01d){var _0x3970a7={};_0x3970a7[_0x22e01d]={'$like':'%'+_0x33fabe[_0x50a8('0x3a')]['filter']+'%'};return _0x3970a7;})});}_0x4a391=_['merge']({},_0x4a391,_0x33fabe[_0x50a8('0x49')]);return _0x49cc12['getAgents'](_0x4a391);}})[_0x50a8('0x29')](function(_0x54c2cb){if(_0x54c2cb){_0x5eddd4=_0x54c2cb[_0x50a8('0x3f')];if(!_0x33fabe['query']['hasOwnProperty'](_0x50a8('0x41'))){_0x4a391[_0x50a8('0x23')]=qs[_0x50a8('0x23')](_0x33fabe[_0x50a8('0x3a')][_0x50a8('0x23')]);_0x4a391[_0x50a8('0x22')]=qs[_0x50a8('0x22')](_0x33fabe['query'][_0x50a8('0x22')]);}return _0x49cc12[_0x50a8('0x92')](_0x4a391);}})[_0x50a8('0x29')](function(_0x1582dc){if(_0x1582dc){return _0x1582dc?{'count':_0x5eddd4,'rows':_0x1582dc}:null;}})['then'](respondWithResult(_0x244371,null))[_0x50a8('0x4e')](handleError(_0x244371,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 7b52923..6b4fa55 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 _0x2d9d=['save','update','remove','emit','hasOwnProperty','hook','events','CmList','setMaxListeners'];(function(_0x48b724,_0x5a8e26){var _0x4d38b3=function(_0xef820f){while(--_0xef820f){_0x48b724['push'](_0x48b724['shift']());}};_0x4d38b3(++_0x5a8e26);}(_0x2d9d,0x72));var _0xd2d9=function(_0x2a9580,_0x381627){_0x2a9580=_0x2a9580-0x0;var _0x3414ea=_0x2d9d[_0x2a9580];return _0x3414ea;};'use strict';var EventEmitter=require(_0xd2d9('0x0'));var CmList=require('../../mysqldb')['db'][_0xd2d9('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0xd2d9('0x2')](0x0);var events={'afterCreate':_0xd2d9('0x3'),'afterUpdate':_0xd2d9('0x4'),'afterDestroy':_0xd2d9('0x5')};function emitEvent(_0x3b4575){return function(_0x22b3fd,_0x5c720a,_0x434a27){CmListEvents['emit'](_0x3b4575+':'+_0x22b3fd['id'],_0x22b3fd);CmListEvents[_0xd2d9('0x6')](_0x3b4575,_0x22b3fd);_0x434a27(null);};}for(var e in events){if(events[_0xd2d9('0x7')](e)){var event=events[e];CmList[_0xd2d9('0x8')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0xbab4=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','CmList','setMaxListeners'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xbab4,0xc3));var _0x4bab=function(_0x5b1732,_0xe9da3){_0x5b1732=_0x5b1732-0x0;var _0x43bf81=_0xbab4[_0x5b1732];return _0x43bf81;};'use strict';var EventEmitter=require('events');var CmList=require(_0x4bab('0x0'))['db'][_0x4bab('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x4bab('0x2')](0x0);var events={'afterCreate':_0x4bab('0x3'),'afterUpdate':_0x4bab('0x4'),'afterDestroy':_0x4bab('0x5')};function emitEvent(_0x548445){return function(_0x9a0aaa,_0x21a37c,_0x1e5a9a){CmListEvents[_0x4bab('0x6')](_0x548445+':'+_0x9a0aaa['id'],_0x9a0aaa);CmListEvents[_0x4bab('0x6')](_0x548445,_0x9a0aaa);_0x1e5a9a(null);};}for(var e in events){if(events[_0x4bab('0x7')](e)){var event=events[e];CmList[_0x4bab('0x8')](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 779917a..ac8a459 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 _0xf30c=['cm_lists','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList'];(function(_0x407b07,_0x525c69){var _0x2c9b12=function(_0x54b368){while(--_0x54b368){_0x407b07['push'](_0x407b07['shift']());}};_0x2c9b12(++_0x525c69);}(_0xf30c,0x1e1));var _0xcf30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf30c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xcf30('0x0'));var logger=require(_0xcf30('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcf30('0x2'));var rp=require(_0xcf30('0x3'));var fs=require('fs');var path=require(_0xcf30('0x4'));var rimraf=require(_0xcf30('0x5'));var config=require(_0xcf30('0x6'));var attributes=require(_0xcf30('0x7'));module[_0xcf30('0x8')]=function(_0xd21e0f,_0x1ba772){return _0xd21e0f[_0xcf30('0x9')](_0xcf30('0xa'),attributes,{'tableName':_0xcf30('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x947d=['rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','api','moment','request-promise','path'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x947d,0x19e));var _0xd947=function(_0x163977,_0x4ef72e){_0x163977=_0x163977-0x0;var _0x28bf3a=_0x947d[_0x163977];return _0x28bf3a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd947('0x0'));var moment=require(_0xd947('0x1'));var BPromise=require('bluebird');var rp=require(_0xd947('0x2'));var fs=require('fs');var path=require(_0xd947('0x3'));var rimraf=require(_0xd947('0x4'));var config=require(_0xd947('0x5'));var attributes=require(_0xd947('0x6'));module[_0xd947('0x7')]=function(_0x30507d,_0x3d6913){return _0x30507d[_0xd947('0x8')](_0xd947('0x9'),attributes,{'tableName':_0xd947('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 3dbb92b..3288d33 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 _0x7552=['request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','register'];(function(_0x2e611d,_0x231de6){var _0x334a66=function(_0x336fa7){while(--_0x336fa7){_0x2e611d['push'](_0x2e611d['shift']());}};_0x334a66(++_0x231de6);}(_0x7552,0x193));var _0x2755=function(_0x2eb9f1,_0x51ae81){_0x2eb9f1=_0x2eb9f1-0x0;var _0x59f68d=_0x7552[_0x2eb9f1];return _0x59f68d;};'use strict';var _=require(_0x2755('0x0'));var util=require(_0x2755('0x1'));var moment=require(_0x2755('0x2'));var BPromise=require('bluebird');var rs=require(_0x2755('0x3'));var fs=require('fs');var Redis=require(_0x2755('0x4'));var db=require(_0x2755('0x5'))['db'];var utils=require(_0x2755('0x6'));var logger=require('../../config/logger')(_0x2755('0x7'));var config=require(_0x2755('0x8'));var jayson=require(_0x2755('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x2755('0xa')]=_['defaults'](config[_0x2755('0xa')],{'host':_0x2755('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmList.socket')[_0x2755('0xc')](socket);function respondWithRpcPromise(_0x2213b1,_0x1b7e04,_0x2f2fd9){return new BPromise(function(_0x3d2727,_0x5ac1f4){return client[_0x2755('0xd')](_0x2213b1,_0x2f2fd9)[_0x2755('0xe')](function(_0xa633a9){logger[_0x2755('0xf')](_0x2755('0x10'),_0x1b7e04,_0x2755('0x11'));logger[_0x2755('0x12')](_0x2755('0x13'),_0x1b7e04,_0x2755('0x11'),JSON[_0x2755('0x14')](_0xa633a9));if(_0xa633a9['error']){if(_0xa633a9[_0x2755('0x15')][_0x2755('0x16')]===0x1f4){logger[_0x2755('0x15')]('CmList,\x20%s,\x20%s',_0x1b7e04,_0xa633a9[_0x2755('0x15')][_0x2755('0x17')]);return _0x5ac1f4(_0xa633a9[_0x2755('0x15')][_0x2755('0x17')]);}logger[_0x2755('0x15')](_0x2755('0x10'),_0x1b7e04,_0xa633a9['error'][_0x2755('0x17')]);return _0x3d2727(_0xa633a9['error']['message']);}else{logger[_0x2755('0xf')](_0x2755('0x10'),_0x1b7e04,_0x2755('0x11'));_0x3d2727(_0xa633a9[_0x2755('0x18')][_0x2755('0x17')]);}})[_0x2755('0x19')](function(_0x19429d){logger[_0x2755('0x15')](_0x2755('0x10'),_0x1b7e04,_0x19429d);_0x5ac1f4(_0x19429d);});});} \ No newline at end of file +var _0x6bbf=['stringify','error','code','message','info','request\x20sent','result','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','localhost','socket.io-emitter','redis','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s'];(function(_0x58e5bf,_0x230b95){var _0xcc635e=function(_0x47da26){while(--_0x47da26){_0x58e5bf['push'](_0x58e5bf['shift']());}};_0xcc635e(++_0x230b95);}(_0x6bbf,0x159));var _0xf6bb=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x6bbf[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0xf6bb('0x0'));var util=require(_0xf6bb('0x1'));var moment=require(_0xf6bb('0x2'));var BPromise=require('bluebird');var rs=require(_0xf6bb('0x3'));var fs=require('fs');var Redis=require(_0xf6bb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf6bb('0x5'));var logger=require('../../config/logger')(_0xf6bb('0x6'));var config=require(_0xf6bb('0x7'));var jayson=require(_0xf6bb('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xf6bb('0x9'),'port':0x18eb});var socket=require(_0xf6bb('0xa'))(new Redis(config[_0xf6bb('0xb')]));require(_0xf6bb('0xc'))[_0xf6bb('0xd')](socket);function respondWithRpcPromise(_0xb062d,_0xbf2395,_0x240b08){return new BPromise(function(_0x4de834,_0x55e0cb){return client[_0xf6bb('0xe')](_0xb062d,_0x240b08)[_0xf6bb('0xf')](function(_0x506de7){logger['info'](_0xf6bb('0x10'),_0xbf2395,'request\x20sent');logger[_0xf6bb('0x11')](_0xf6bb('0x12'),_0xbf2395,'request\x20sent',JSON[_0xf6bb('0x13')](_0x506de7));if(_0x506de7[_0xf6bb('0x14')]){if(_0x506de7[_0xf6bb('0x14')][_0xf6bb('0x15')]===0x1f4){logger[_0xf6bb('0x14')](_0xf6bb('0x10'),_0xbf2395,_0x506de7[_0xf6bb('0x14')][_0xf6bb('0x16')]);return _0x55e0cb(_0x506de7[_0xf6bb('0x14')][_0xf6bb('0x16')]);}logger[_0xf6bb('0x14')](_0xf6bb('0x10'),_0xbf2395,_0x506de7[_0xf6bb('0x14')][_0xf6bb('0x16')]);return _0x4de834(_0x506de7['error'][_0xf6bb('0x16')]);}else{logger[_0xf6bb('0x17')](_0xf6bb('0x10'),_0xbf2395,_0xf6bb('0x18'));_0x4de834(_0x506de7[_0xf6bb('0x19')][_0xf6bb('0x16')]);}})['catch'](function(_0xbeae74){logger[_0xf6bb('0x14')](_0xf6bb('0x10'),_0xbf2395,_0xbeae74);_0x55e0cb(_0xbeae74);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 70ebf96..391d97a 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 _0x872a=['removeListener','register','length','cmList:','./cmList.events','save','remove','update','emit'];(function(_0x2b41e3,_0x49c30b){var _0x36c322=function(_0x1f04f4){while(--_0x1f04f4){_0x2b41e3['push'](_0x2b41e3['shift']());}};_0x36c322(++_0x49c30b);}(_0x872a,0x100));var _0xa872=function(_0x4f4ace,_0x52eb77){_0x4f4ace=_0x4f4ace-0x0;var _0x58221c=_0x872a[_0x4f4ace];return _0x58221c;};'use strict';var CmListEvents=require(_0xa872('0x0'));var events=[_0xa872('0x1'),_0xa872('0x2'),_0xa872('0x3')];function createListener(_0x4a2170,_0x48294d){return function(_0x4c6509){_0x48294d[_0xa872('0x4')](_0x4a2170,_0x4c6509);};}function removeListener(_0x58715a,_0x2854a7){return function(){CmListEvents[_0xa872('0x5')](_0x58715a,_0x2854a7);};}exports[_0xa872('0x6')]=function(_0x1c8d2f){for(var _0x3e3cd4=0x0,_0x4aab9d=events[_0xa872('0x7')];_0x3e3cd4<_0x4aab9d;_0x3e3cd4++){var _0x1b87b7=events[_0x3e3cd4];var _0x1e0c05=createListener(_0xa872('0x8')+_0x1b87b7,_0x1c8d2f);CmListEvents['on'](_0x1b87b7,_0x1e0c05);}}; \ No newline at end of file +var _0x2709=['length','./cmList.events','remove','update','emit','removeListener','register'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x2709,0x189));var _0x9270=function(_0x393dc9,_0x212d98){_0x393dc9=_0x393dc9-0x0;var _0x5a136e=_0x2709[_0x393dc9];return _0x5a136e;};'use strict';var CmListEvents=require(_0x9270('0x0'));var events=['save',_0x9270('0x1'),_0x9270('0x2')];function createListener(_0x5e755b,_0x1d935b){return function(_0x4f5b2e){_0x1d935b[_0x9270('0x3')](_0x5e755b,_0x4f5b2e);};}function removeListener(_0x26bdf5,_0x326c2a){return function(){CmListEvents[_0x9270('0x4')](_0x26bdf5,_0x326c2a);};}exports[_0x9270('0x5')]=function(_0x446f78){for(var _0x4c71c5=0x0,_0x421b84=events[_0x9270('0x6')];_0x4c71c5<_0x421b84;_0x4c71c5++){var _0x1927c=events[_0x4c71c5];var _0x28e580=createListener('cmList:'+_0x1927c,_0x446f78);CmListEvents['on'](_0x1927c,_0x28e580);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 10ed9f7..65a0483 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 _0x90d0=['./cmList.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','getAgents','post','create','addDisposition','addContacts','/:id/fields','addCustomField','/:id/users','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','util','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x23e0d8,_0x508764){var _0x138331=function(_0x15dcfe){while(--_0x15dcfe){_0x23e0d8['push'](_0x23e0d8['shift']());}};_0x138331(++_0x508764);}(_0x90d0,0x1a8));var _0x090d=function(_0xe719ec,_0x5a280e){_0xe719ec=_0xe719ec-0x0;var _0x4842a1=_0x90d0[_0xe719ec];return _0x4842a1;};'use strict';var multer=require('multer');var util=require(_0x090d('0x0'));var path=require(_0x090d('0x1'));var timeout=require('connect-timeout');var express=require(_0x090d('0x2'));var router=express['Router']();var auth=require(_0x090d('0x3'));var interaction=require(_0x090d('0x4'));var config=require('../../config/environment');var controller=require(_0x090d('0x5'));router[_0x090d('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x090d('0x7'),auth[_0x090d('0x8')](),controller[_0x090d('0x9')]);router[_0x090d('0x6')](_0x090d('0xa'),auth[_0x090d('0x8')](),controller[_0x090d('0xb')]);router[_0x090d('0x6')](_0x090d('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x090d('0x6')](_0x090d('0xd'),auth['isAuthenticated'](),controller[_0x090d('0xe')]);router[_0x090d('0x6')](_0x090d('0xf'),auth[_0x090d('0x8')](),controller[_0x090d('0x10')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x090d('0x11')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x090d('0x12')]);router[_0x090d('0x13')]('/',auth[_0x090d('0x8')](),controller[_0x090d('0x14')]);router[_0x090d('0x13')](_0x090d('0xc'),auth[_0x090d('0x8')](),controller[_0x090d('0x15')]);router[_0x090d('0x13')](_0x090d('0xd'),auth[_0x090d('0x8')](),controller[_0x090d('0x16')]);router[_0x090d('0x13')](_0x090d('0x17'),auth[_0x090d('0x8')](),controller[_0x090d('0x18')]);router[_0x090d('0x13')](_0x090d('0x19'),auth[_0x090d('0x8')](),controller[_0x090d('0x1a')]);router['put'](_0x090d('0xa'),auth[_0x090d('0x8')](),controller[_0x090d('0x1b')]);router[_0x090d('0x1c')](_0x090d('0xa'),auth['isAuthenticated'](),controller[_0x090d('0x1d')]);router[_0x090d('0x1c')](_0x090d('0xc'),auth[_0x090d('0x8')](),controller[_0x090d('0x1e')]);router[_0x090d('0x1c')]('/:id/users',auth[_0x090d('0x8')](),controller[_0x090d('0x1f')]);module[_0x090d('0x20')]=router; \ No newline at end of file +var _0x9663=['/:id/contacts','/:id/contacts/csv','getContactsCsv','getCustomFields','getAgents','post','create','addDisposition','addContacts','addCustomField','/:id/users','put','/:id','delete','destroy','removeDispositions','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getDispositions'];(function(_0x1e9ca7,_0x281158){var _0x4f5293=function(_0x1d11b4){while(--_0x1d11b4){_0x1e9ca7['push'](_0x1e9ca7['shift']());}};_0x4f5293(++_0x281158);}(_0x9663,0xe3));var _0x3966=function(_0x132c09,_0x368624){_0x132c09=_0x132c09-0x0;var _0x3bd5f9=_0x9663[_0x132c09];return _0x3bd5f9;};'use strict';var multer=require(_0x3966('0x0'));var util=require(_0x3966('0x1'));var path=require(_0x3966('0x2'));var timeout=require(_0x3966('0x3'));var express=require(_0x3966('0x4'));var router=express[_0x3966('0x5')]();var auth=require(_0x3966('0x6'));var interaction=require(_0x3966('0x7'));var config=require(_0x3966('0x8'));var controller=require(_0x3966('0x9'));router['get']('/',auth[_0x3966('0xa')](),controller[_0x3966('0xb')]);router[_0x3966('0xc')](_0x3966('0xd'),auth[_0x3966('0xa')](),controller[_0x3966('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3966('0xf')]);router[_0x3966('0xc')](_0x3966('0x10'),auth[_0x3966('0xa')](),controller[_0x3966('0x11')]);router['get'](_0x3966('0x12'),auth[_0x3966('0xa')](),controller['getContacts']);router[_0x3966('0xc')](_0x3966('0x13'),auth[_0x3966('0xa')](),controller[_0x3966('0x14')]);router['get']('/:id/fields',auth[_0x3966('0xa')](),controller[_0x3966('0x15')]);router['get']('/:id/users',auth[_0x3966('0xa')](),controller[_0x3966('0x16')]);router[_0x3966('0x17')]('/',auth[_0x3966('0xa')](),controller[_0x3966('0x18')]);router[_0x3966('0x17')](_0x3966('0x10'),auth['isAuthenticated'](),controller[_0x3966('0x19')]);router[_0x3966('0x17')](_0x3966('0x12'),auth[_0x3966('0xa')](),controller[_0x3966('0x1a')]);router['post']('/:id/fields',auth[_0x3966('0xa')](),controller[_0x3966('0x1b')]);router[_0x3966('0x17')](_0x3966('0x1c'),auth[_0x3966('0xa')](),controller['addAgents']);router[_0x3966('0x1d')](_0x3966('0x1e'),auth[_0x3966('0xa')](),controller['update']);router[_0x3966('0x1f')]('/:id',auth[_0x3966('0xa')](),controller[_0x3966('0x20')]);router['delete'](_0x3966('0x10'),auth[_0x3966('0xa')](),controller[_0x3966('0x21')]);router[_0x3966('0x1f')](_0x3966('0x1c'),auth[_0x3966('0xa')](),controller[_0x3966('0x22')]);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 de7297f..a4c62bb 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 _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x4dfd23,_0x4204ce){var _0x14bbd4=function(_0x258a20){while(--_0x258a20){_0x4dfd23['push'](_0x4dfd23['shift']());}};_0x14bbd4(++_0x4204ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x4a4228,_0x5f2035){var _0x5c83d7=function(_0x2ef28d){while(--_0x2ef28d){_0x4a4228['push'](_0x4a4228['shift']());}};_0x5c83d7(++_0x5f2035);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index c6cf858..0c6fa66 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 _0xb7a1=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','update','body','Condition','find','params','catch'];(function(_0x3f1aad,_0x395a79){var _0x161b00=function(_0x1b4129){while(--_0x1b4129){_0x3f1aad['push'](_0x3f1aad['shift']());}};_0x161b00(++_0x395a79);}(_0xb7a1,0xe6));var _0x1b7a=function(_0x51efc8,_0x501aac){_0x51efc8=_0x51efc8-0x0;var _0x187e6e=_0xb7a1[_0x51efc8];return _0x187e6e;};'use strict';var pdf=require(_0x1b7a('0x0'));var emlformat=require(_0x1b7a('0x1'));var rimraf=require(_0x1b7a('0x2'));var zipdir=require(_0x1b7a('0x3'));var jsonpatch=require(_0x1b7a('0x4'));var rp=require(_0x1b7a('0x5'));var moment=require(_0x1b7a('0x6'));var BPromise=require(_0x1b7a('0x7'));var Mustache=require(_0x1b7a('0x8'));var util=require(_0x1b7a('0x9'));var path=require(_0x1b7a('0xa'));var sox=require(_0x1b7a('0xb'));var csv=require(_0x1b7a('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1b7a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1b7a('0xe'));var toCsv=require(_0x1b7a('0xc'));var querystring=require('querystring');var Papa=require(_0x1b7a('0xf'));var Redis=require(_0x1b7a('0x10'));var authService=require(_0x1b7a('0x11'));var qs=require(_0x1b7a('0x12'));var as=require(_0x1b7a('0x13'));var hardwareService=require(_0x1b7a('0x14'));var logger=require(_0x1b7a('0x15'))(_0x1b7a('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1b7a('0x17'))['db'];function respondWithStatusCode(_0x2b9449,_0x4a6a10){_0x4a6a10=_0x4a6a10||0xcc;return function(_0x883f4c){if(_0x883f4c){return _0x2b9449[_0x1b7a('0x18')](_0x4a6a10);}return _0x2b9449['status'](_0x4a6a10)['end']();};}function respondWithResult(_0x380f82,_0x4908dc){_0x4908dc=_0x4908dc||0xc8;return function(_0x382d0d){if(_0x382d0d){return _0x380f82[_0x1b7a('0x19')](_0x4908dc)[_0x1b7a('0x1a')](_0x382d0d);}};}function respondWithFilteredResult(_0x2e6f25,_0x291b9e){return function(_0x2180f2){if(_0x2180f2){var _0x59afab=_0x2180f2[_0x1b7a('0x1b')],_0x1f2f86=_0x291b9e[_0x1b7a('0x1c')],_0x5b4ef9=_0x291b9e['offset']+_0x291b9e[_0x1b7a('0x1d')],_0xc53723;if(_0x5b4ef9>=_0x59afab){_0x5b4ef9=_0x59afab;_0xc53723=0xc8;}else{_0xc53723=0xce;}_0x2e6f25[_0x1b7a('0x19')](_0xc53723);return _0x2e6f25['set'](_0x1b7a('0x1e'),_0x1f2f86+'-'+_0x5b4ef9+'/'+_0x59afab)[_0x1b7a('0x1a')](_0x2180f2);}return null;};}function patchUpdates(_0x488256){return function(_0xa544fe){try{jsonpatch[_0x1b7a('0x1f')](_0xa544fe,_0x488256,!![]);}catch(_0x442471){return BPromise[_0x1b7a('0x20')](_0x442471);}return _0xa544fe[_0x1b7a('0x21')]();};}function saveUpdates(_0x4a2ab9,_0x179624){return function(_0x452a72){if(_0x452a72){return _0x452a72['update'](_0x4a2ab9)[_0x1b7a('0x22')](function(_0x2743af){return _0x2743af;});}return null;};}function removeEntity(_0x18cbd8,_0x46711b){return function(_0x28004c){if(_0x28004c){return _0x28004c[_0x1b7a('0x23')]()['then'](function(){_0x18cbd8[_0x1b7a('0x19')](0xcc)[_0x1b7a('0x24')]();});}};}function handleEntityNotFound(_0x41ced9,_0x51dd39){return function(_0x26be41){if(!_0x26be41){_0x41ced9[_0x1b7a('0x18')](0x194);}return _0x26be41;};}function handleError(_0x1192ee,_0x395491){_0x395491=_0x395491||0x1f4;return function(_0x1273a5){logger[_0x1b7a('0x25')](_0x1273a5[_0x1b7a('0x26')]);if(_0x1273a5[_0x1b7a('0x27')]){delete _0x1273a5[_0x1b7a('0x27')];}_0x1192ee[_0x1b7a('0x19')](_0x395491)['send'](_0x1273a5);};}exports[_0x1b7a('0x28')]=function(_0x313845,_0x4c09e0){if(_0x313845['body']['id']){delete _0x313845[_0x1b7a('0x29')]['id'];}return db[_0x1b7a('0x2a')][_0x1b7a('0x2b')]({'where':{'id':_0x313845[_0x1b7a('0x2c')]['id']}})[_0x1b7a('0x22')](handleEntityNotFound(_0x4c09e0,null))[_0x1b7a('0x22')](saveUpdates(_0x313845['body'],null))['then'](respondWithResult(_0x4c09e0,null))[_0x1b7a('0x2d')](handleError(_0x4c09e0,null));};exports[_0x1b7a('0x23')]=function(_0x87ef,_0x5af080){return db[_0x1b7a('0x2a')][_0x1b7a('0x2b')]({'where':{'id':_0x87ef[_0x1b7a('0x2c')]['id']}})[_0x1b7a('0x22')](handleEntityNotFound(_0x5af080,null))[_0x1b7a('0x22')](removeEntity(_0x5af080,null))[_0x1b7a('0x2d')](handleError(_0x5af080,null));}; \ No newline at end of file +var _0x4cf9=['../../config/logger','api','../../config/utils','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','body','Condition','find','params','catch','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x241e40,_0x2d9b24){var _0x5ce784=function(_0x1a6882){while(--_0x1a6882){_0x241e40['push'](_0x241e40['shift']());}};_0x5ce784(++_0x2d9b24);}(_0x4cf9,0x105));var _0x94cf=function(_0x52dee4,_0x4ab348){_0x52dee4=_0x52dee4-0x0;var _0x3ff882=_0x4cf9[_0x52dee4];return _0x3ff882;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x94cf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x94cf('0x1'));var rp=require(_0x94cf('0x2'));var moment=require(_0x94cf('0x3'));var BPromise=require(_0x94cf('0x4'));var Mustache=require(_0x94cf('0x5'));var util=require(_0x94cf('0x6'));var path=require(_0x94cf('0x7'));var sox=require(_0x94cf('0x8'));var csv=require(_0x94cf('0x9'));var ejs=require(_0x94cf('0xa'));var fs=require('fs');var _=require(_0x94cf('0xb'));var squel=require(_0x94cf('0xc'));var crypto=require(_0x94cf('0xd'));var jsforce=require(_0x94cf('0xe'));var deskjs=require(_0x94cf('0xf'));var toCsv=require(_0x94cf('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x94cf('0x10'));var authService=require(_0x94cf('0x11'));var qs=require(_0x94cf('0x12'));var as=require(_0x94cf('0x13'));var hardwareService=require(_0x94cf('0x14'));var logger=require(_0x94cf('0x15'))(_0x94cf('0x16'));var utils=require(_0x94cf('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2634d0,_0x575339){_0x575339=_0x575339||0xcc;return function(_0x1628c5){if(_0x1628c5){return _0x2634d0['sendStatus'](_0x575339);}return _0x2634d0[_0x94cf('0x18')](_0x575339)[_0x94cf('0x19')]();};}function respondWithResult(_0x38532e,_0x573b21){_0x573b21=_0x573b21||0xc8;return function(_0x3f9cac){if(_0x3f9cac){return _0x38532e['status'](_0x573b21)[_0x94cf('0x1a')](_0x3f9cac);}};}function respondWithFilteredResult(_0x20d231,_0x8acee9){return function(_0x478727){if(_0x478727){var _0x2faa4a=_0x478727[_0x94cf('0x1b')],_0x1aa51e=_0x8acee9[_0x94cf('0x1c')],_0x420763=_0x8acee9[_0x94cf('0x1c')]+_0x8acee9[_0x94cf('0x1d')],_0x326ad0;if(_0x420763>=_0x2faa4a){_0x420763=_0x2faa4a;_0x326ad0=0xc8;}else{_0x326ad0=0xce;}_0x20d231[_0x94cf('0x18')](_0x326ad0);return _0x20d231[_0x94cf('0x1e')](_0x94cf('0x1f'),_0x1aa51e+'-'+_0x420763+'/'+_0x2faa4a)[_0x94cf('0x1a')](_0x478727);}return null;};}function patchUpdates(_0x1823b6){return function(_0x434122){try{jsonpatch[_0x94cf('0x20')](_0x434122,_0x1823b6,!![]);}catch(_0x13934b){return BPromise[_0x94cf('0x21')](_0x13934b);}return _0x434122[_0x94cf('0x22')]();};}function saveUpdates(_0x196983,_0x57e381){return function(_0x11d1e1){if(_0x11d1e1){return _0x11d1e1[_0x94cf('0x23')](_0x196983)[_0x94cf('0x24')](function(_0x8c6f2e){return _0x8c6f2e;});}return null;};}function removeEntity(_0xc16f30,_0x43be2d){return function(_0x1a1b22){if(_0x1a1b22){return _0x1a1b22[_0x94cf('0x25')]()[_0x94cf('0x24')](function(){_0xc16f30[_0x94cf('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11fff9,_0x30ae85){return function(_0x56a96e){if(!_0x56a96e){_0x11fff9[_0x94cf('0x26')](0x194);}return _0x56a96e;};}function handleError(_0x37c87b,_0x1d6799){_0x1d6799=_0x1d6799||0x1f4;return function(_0x50347a){logger[_0x94cf('0x27')](_0x50347a[_0x94cf('0x28')]);if(_0x50347a[_0x94cf('0x29')]){delete _0x50347a['name'];}_0x37c87b[_0x94cf('0x18')](_0x1d6799)['send'](_0x50347a);};}exports['update']=function(_0x13c43f,_0x46d5e7){if(_0x13c43f[_0x94cf('0x2a')]['id']){delete _0x13c43f[_0x94cf('0x2a')]['id'];}return db[_0x94cf('0x2b')][_0x94cf('0x2c')]({'where':{'id':_0x13c43f[_0x94cf('0x2d')]['id']}})[_0x94cf('0x24')](handleEntityNotFound(_0x46d5e7,null))[_0x94cf('0x24')](saveUpdates(_0x13c43f['body'],null))[_0x94cf('0x24')](respondWithResult(_0x46d5e7,null))[_0x94cf('0x2e')](handleError(_0x46d5e7,null));};exports[_0x94cf('0x25')]=function(_0xa32a6c,_0x2dff46){return db[_0x94cf('0x2b')][_0x94cf('0x2c')]({'where':{'id':_0xa32a6c['params']['id']}})[_0x94cf('0x24')](handleEntityNotFound(_0x2dff46,null))[_0x94cf('0x24')](removeEntity(_0x2dff46,null))['catch'](handleError(_0x2dff46,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index d8de6f6..9a459c7 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 _0x3189=['request-promise','path','rimraf','../../config/environment','./condition.attributes','Condition','tools_conditions','lodash','util','moment'];(function(_0x2cea2d,_0x181fa3){var _0x1a6e1a=function(_0x1d8c73){while(--_0x1d8c73){_0x2cea2d['push'](_0x2cea2d['shift']());}};_0x1a6e1a(++_0x181fa3);}(_0x3189,0x151));var _0x9318=function(_0x411b14,_0x3f9e36){_0x411b14=_0x411b14-0x0;var _0x402736=_0x3189[_0x411b14];return _0x402736;};'use strict';var _=require(_0x9318('0x0'));var util=require(_0x9318('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9318('0x2'));var BPromise=require('bluebird');var rp=require(_0x9318('0x3'));var fs=require('fs');var path=require(_0x9318('0x4'));var rimraf=require(_0x9318('0x5'));var config=require(_0x9318('0x6'));var attributes=require(_0x9318('0x7'));module['exports']=function(_0x34fb85,_0x3268b5){return _0x34fb85['define'](_0x9318('0x8'),attributes,{'tableName':_0x9318('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa929=['request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','util','../../config/logger','api','moment','bluebird'];(function(_0x19d335,_0x491329){var _0x534567=function(_0x25e5c0){while(--_0x25e5c0){_0x19d335['push'](_0x19d335['shift']());}};_0x534567(++_0x491329);}(_0xa929,0x191));var _0x9a92=function(_0xa07676,_0x1b4bc3){_0xa07676=_0xa07676-0x0;var _0x182ae9=_0xa929[_0xa07676];return _0x182ae9;};'use strict';var _=require('lodash');var util=require(_0x9a92('0x0'));var logger=require(_0x9a92('0x1'))(_0x9a92('0x2'));var moment=require(_0x9a92('0x3'));var BPromise=require(_0x9a92('0x4'));var rp=require(_0x9a92('0x5'));var fs=require('fs');var path=require(_0x9a92('0x6'));var rimraf=require(_0x9a92('0x7'));var config=require(_0x9a92('0x8'));var attributes=require(_0x9a92('0x9'));module[_0x9a92('0xa')]=function(_0x1074a0,_0x5ee868){return _0x1074a0[_0x9a92('0xb')](_0x9a92('0xc'),attributes,{'tableName':_0x9a92('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 61c8eb1..1fbc211 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 _0x9fb9=['http','request','then','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','../../mysqldb','rpc','client'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x9fb9,0x162));var _0x99fb=function(_0xcc71f9,_0x54f5fd){_0xcc71f9=_0xcc71f9-0x0;var _0x5ed84a=_0x9fb9[_0xcc71f9];return _0x5ed84a;};'use strict';var _=require(_0x99fb('0x0'));var util=require(_0x99fb('0x1'));var moment=require(_0x99fb('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99fb('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x99fb('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x99fb('0x5')][_0x99fb('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3aeee5,_0x5afd9b,_0x33967f){return new BPromise(function(_0x3f68c2,_0x167055){return client[_0x99fb('0x7')](_0x3aeee5,_0x33967f)[_0x99fb('0x8')](function(_0x97eef1){logger['info'](_0x99fb('0x9'),_0x5afd9b,'request\x20sent');logger[_0x99fb('0xa')](_0x99fb('0xb'),_0x5afd9b,_0x99fb('0xc'),JSON[_0x99fb('0xd')](_0x97eef1));if(_0x97eef1[_0x99fb('0xe')]){if(_0x97eef1[_0x99fb('0xe')][_0x99fb('0xf')]===0x1f4){logger[_0x99fb('0xe')]('Condition,\x20%s,\x20%s',_0x5afd9b,_0x97eef1[_0x99fb('0xe')][_0x99fb('0x10')]);return _0x167055(_0x97eef1[_0x99fb('0xe')][_0x99fb('0x10')]);}logger['error'](_0x99fb('0x9'),_0x5afd9b,_0x97eef1[_0x99fb('0xe')][_0x99fb('0x10')]);return _0x3f68c2(_0x97eef1['error']['message']);}else{logger[_0x99fb('0x11')](_0x99fb('0x9'),_0x5afd9b,_0x99fb('0xc'));_0x3f68c2(_0x97eef1[_0x99fb('0x12')][_0x99fb('0x10')]);}})[_0x99fb('0x13')](function(_0x24ac9c){logger[_0x99fb('0xe')](_0x99fb('0x9'),_0x5afd9b,_0x24ac9c);_0x167055(_0x24ac9c);});});} \ No newline at end of file +var _0x31e1=['http','request','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x46df80,_0x1fd008){var _0x55f0da=function(_0x597403){while(--_0x597403){_0x46df80['push'](_0x46df80['shift']());}};_0x55f0da(++_0x1fd008);}(_0x31e1,0x121));var _0x131e=function(_0x10f571,_0x299d9d){_0x10f571=_0x10f571-0x0;var _0x1a87a0=_0x31e1[_0x10f571];return _0x1a87a0;};'use strict';var _=require(_0x131e('0x0'));var util=require('util');var moment=require(_0x131e('0x1'));var BPromise=require(_0x131e('0x2'));var rs=require(_0x131e('0x3'));var fs=require('fs');var Redis=require(_0x131e('0x4'));var db=require(_0x131e('0x5'))['db'];var utils=require(_0x131e('0x6'));var logger=require(_0x131e('0x7'))(_0x131e('0x8'));var config=require(_0x131e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x131e('0xa')][_0x131e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5264d7,_0x5094ef,_0x2dcd1c){return new BPromise(function(_0x17c279,_0x23539a){return client[_0x131e('0xc')](_0x5264d7,_0x2dcd1c)[_0x131e('0xd')](function(_0x1a86bc){logger[_0x131e('0xe')]('Condition,\x20%s,\x20%s',_0x5094ef,_0x131e('0xf'));logger[_0x131e('0x10')](_0x131e('0x11'),_0x5094ef,_0x131e('0xf'),JSON[_0x131e('0x12')](_0x1a86bc));if(_0x1a86bc[_0x131e('0x13')]){if(_0x1a86bc[_0x131e('0x13')][_0x131e('0x14')]===0x1f4){logger[_0x131e('0x13')](_0x131e('0x15'),_0x5094ef,_0x1a86bc[_0x131e('0x13')][_0x131e('0x16')]);return _0x23539a(_0x1a86bc['error'][_0x131e('0x16')]);}logger[_0x131e('0x13')]('Condition,\x20%s,\x20%s',_0x5094ef,_0x1a86bc[_0x131e('0x13')][_0x131e('0x16')]);return _0x17c279(_0x1a86bc[_0x131e('0x13')]['message']);}else{logger[_0x131e('0xe')](_0x131e('0x15'),_0x5094ef,_0x131e('0xf'));_0x17c279(_0x1a86bc[_0x131e('0x17')][_0x131e('0x16')]);}})[_0x131e('0x18')](function(_0x951925){logger['error'](_0x131e('0x15'),_0x5094ef,_0x951925);_0x23539a(_0x951925);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 651d808..c4651a9 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 _0xd3d7=['../../components/auth/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x4d4c82,_0x184de3){var _0x39a1f6=function(_0x2509e0){while(--_0x2509e0){_0x4d4c82['push'](_0x4d4c82['shift']());}};_0x39a1f6(++_0x184de3);}(_0xd3d7,0x18f));var _0x7d3d=function(_0x35fd3b,_0x2fa718){_0x35fd3b=_0x35fd3b-0x0;var _0x6aa6f4=_0xd3d7[_0x35fd3b];return _0x6aa6f4;};'use strict';var multer=require(_0x7d3d('0x0'));var util=require('util');var path=require(_0x7d3d('0x1'));var timeout=require('connect-timeout');var express=require(_0x7d3d('0x2'));var router=express[_0x7d3d('0x3')]();var auth=require(_0x7d3d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7d3d('0x5'));var controller=require(_0x7d3d('0x6'));router['put'](_0x7d3d('0x7'),auth[_0x7d3d('0x8')](),controller[_0x7d3d('0x9')]);router[_0x7d3d('0xa')](_0x7d3d('0x7'),auth[_0x7d3d('0x8')](),controller[_0x7d3d('0xb')]);module[_0x7d3d('0xc')]=router; \ No newline at end of file +var _0xcbcd=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update'];(function(_0x245c4f,_0x34b70f){var _0x3157a1=function(_0x18bfc7){while(--_0x18bfc7){_0x245c4f['push'](_0x245c4f['shift']());}};_0x3157a1(++_0x34b70f);}(_0xcbcd,0xc6));var _0xdcbc=function(_0x375325,_0x57a850){_0x375325=_0x375325-0x0;var _0x228f57=_0xcbcd[_0x375325];return _0x228f57;};'use strict';var multer=require(_0xdcbc('0x0'));var util=require(_0xdcbc('0x1'));var path=require(_0xdcbc('0x2'));var timeout=require(_0xdcbc('0x3'));var express=require(_0xdcbc('0x4'));var router=express[_0xdcbc('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xdcbc('0x6'));var config=require(_0xdcbc('0x7'));var controller=require(_0xdcbc('0x8'));router['put'](_0xdcbc('0x9'),auth[_0xdcbc('0xa')](),controller[_0xdcbc('0xb')]);router[_0xdcbc('0xc')](_0xdcbc('0x9'),auth['isAuthenticated'](),controller[_0xdcbc('0xd')]);module[_0xdcbc('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 82265a5..0f26d73 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 _0x6873=['INTEGER','STRING','name'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x6873,0xac));var _0x3687=function(_0x9b5bb2,_0x5db315){_0x9b5bb2=_0x9b5bb2-0x0;var _0x2e1e92=_0x6873[_0x9b5bb2];return _0x2e1e92;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3687('0x0')],'allowNull':![],'unique':_0x3687('0x1')},'OrderBy':{'type':Sequelize[_0x3687('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x3687('0x0')],'allowNull':!![]}}; \ No newline at end of file +var _0x207c=['exports','STRING','name','INTEGER'];(function(_0x4e9d45,_0x487d30){var _0x36d332=function(_0x3adf7e){while(--_0x3adf7e){_0x4e9d45['push'](_0x4e9d45['shift']());}};_0x36d332(++_0x487d30);}(_0x207c,0x1e8));var _0xc207=function(_0x543a4e,_0x544f2e){_0x543a4e=_0x543a4e-0x0;var _0x27a3a9=_0x207c[_0x543a4e];return _0x27a3a9;};'use strict';var Sequelize=require('sequelize');module[_0xc207('0x0')]={'name':{'type':Sequelize[_0xc207('0x1')],'allowNull':![],'unique':_0xc207('0x2')},'OrderBy':{'type':Sequelize[_0xc207('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xc207('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 23027cb..290b6dc 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 _0xedd9=['include','rows','show','params','intersection','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','name','send','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll'];(function(_0x4ece58,_0x50922a){var _0x20d209=function(_0x3de5f6){while(--_0x3de5f6){_0x4ece58['push'](_0x4ece58['shift']());}};_0x20d209(++_0x50922a);}(_0xedd9,0xfc));var _0x9edd=function(_0x15ac09,_0x43685b){_0x15ac09=_0x15ac09-0x0;var _0x128429=_0xedd9[_0x15ac09];return _0x128429;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');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('0xa'));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 db=require(_0x9edd('0x16'))['db'];function respondWithStatusCode(_0x25e64c,_0xfd544a){_0xfd544a=_0xfd544a||0xcc;return function(_0x287ddd){if(_0x287ddd){return _0x25e64c[_0x9edd('0x17')](_0xfd544a);}return _0x25e64c[_0x9edd('0x18')](_0xfd544a)[_0x9edd('0x19')]();};}function respondWithResult(_0x47eb64,_0x176bfa){_0x176bfa=_0x176bfa||0xc8;return function(_0x44fc7c){if(_0x44fc7c){return _0x47eb64[_0x9edd('0x18')](_0x176bfa)[_0x9edd('0x1a')](_0x44fc7c);}};}function respondWithFilteredResult(_0x13b6b6,_0x338f3c){return function(_0x1042aa){if(_0x1042aa){var _0x75a4ab=_0x1042aa[_0x9edd('0x1b')],_0x4ea60f=_0x338f3c['offset'],_0x5f5bf4=_0x338f3c[_0x9edd('0x1c')]+_0x338f3c[_0x9edd('0x1d')],_0x448996;if(_0x5f5bf4>=_0x75a4ab){_0x5f5bf4=_0x75a4ab;_0x448996=0xc8;}else{_0x448996=0xce;}_0x13b6b6[_0x9edd('0x18')](_0x448996);return _0x13b6b6['set'](_0x9edd('0x1e'),_0x4ea60f+'-'+_0x5f5bf4+'/'+_0x75a4ab)['json'](_0x1042aa);}return null;};}function patchUpdates(_0x2cdcef){return function(_0x1083e4){try{jsonpatch['apply'](_0x1083e4,_0x2cdcef,!![]);}catch(_0x498977){return BPromise[_0x9edd('0x1f')](_0x498977);}return _0x1083e4['save']();};}function saveUpdates(_0x27a95a,_0x54a03f){return function(_0x535f37){if(_0x535f37){return _0x535f37[_0x9edd('0x20')](_0x27a95a)[_0x9edd('0x21')](function(_0x4fb7bf){return _0x4fb7bf;});}return null;};}function removeEntity(_0x5823bc,_0x341d67){return function(_0x186186){if(_0x186186){return _0x186186[_0x9edd('0x22')]()['then'](function(){var _0x3741c8=_0x186186[_0x9edd('0x23')]({'plain':!![]});var _0x44a6c1=_0x9edd('0x24');return db[_0x9edd('0x25')]['destroy']({'where':{'type':_0x44a6c1,'resourceId':_0x3741c8['id']}})[_0x9edd('0x21')](function(){return _0x186186;});})[_0x9edd('0x21')](function(){_0x5823bc[_0x9edd('0x18')](0xcc)[_0x9edd('0x19')]();});}};}function handleEntityNotFound(_0x310a4d,_0x4d507f){return function(_0x4b3d1b){if(!_0x4b3d1b){_0x310a4d[_0x9edd('0x17')](0x194);}return _0x4b3d1b;};}function handleError(_0xfeca7b,_0x8d67aa){_0x8d67aa=_0x8d67aa||0x1f4;return function(_0x25e135){logger[_0x9edd('0x26')](_0x25e135['stack']);if(_0x25e135['name']){delete _0x25e135[_0x9edd('0x27')];}_0xfeca7b[_0x9edd('0x18')](_0x8d67aa)[_0x9edd('0x28')](_0x25e135);};}exports['index']=function(_0x238b22,_0x28cfae){var _0x2ae8dd={},_0x41af53={},_0x5eccfb={'count':0x0,'rows':[]};var _0x2155a1=_[_0x9edd('0x29')](db[_0x9edd('0x2a')][_0x9edd('0x2b')],function(_0xbbf08f){return{'name':_0xbbf08f[_0x9edd('0x2c')],'type':_0xbbf08f[_0x9edd('0x2d')][_0x9edd('0x2e')]};});_0x41af53[_0x9edd('0x2f')]=_[_0x9edd('0x29')](_0x2155a1,_0x9edd('0x27'));_0x41af53[_0x9edd('0x30')]=_[_0x9edd('0x31')](_0x238b22[_0x9edd('0x30')]);_0x41af53[_0x9edd('0x32')]=_['intersection'](_0x41af53[_0x9edd('0x2f')],_0x41af53[_0x9edd('0x30')]);_0x2ae8dd[_0x9edd('0x33')]=_['intersection'](_0x41af53[_0x9edd('0x2f')],qs[_0x9edd('0x34')](_0x238b22[_0x9edd('0x30')][_0x9edd('0x34')]));_0x2ae8dd[_0x9edd('0x33')]=_0x2ae8dd[_0x9edd('0x33')][_0x9edd('0x35')]?_0x2ae8dd[_0x9edd('0x33')]:_0x41af53[_0x9edd('0x2f')];if(!_0x238b22[_0x9edd('0x30')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x2ae8dd[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x238b22['query'][_0x9edd('0x1d')]);_0x2ae8dd['offset']=qs[_0x9edd('0x1c')](_0x238b22[_0x9edd('0x30')][_0x9edd('0x1c')]);}_0x2ae8dd[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x238b22['query'][_0x9edd('0x39')]);_0x2ae8dd[_0x9edd('0x3a')]=qs[_0x9edd('0x32')](_[_0x9edd('0x3b')](_0x238b22[_0x9edd('0x30')],_0x41af53[_0x9edd('0x32')]),_0x2155a1);if(_0x238b22[_0x9edd('0x30')][_0x9edd('0x3c')]){_0x2ae8dd[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x2ae8dd['where'],{'$or':_[_0x9edd('0x29')](_0x2155a1,function(_0x56a228){if(_0x56a228[_0x9edd('0x2d')]!=='VIRTUAL'){var _0x30883e={};_0x30883e[_0x56a228[_0x9edd('0x27')]]={'$like':'%'+_0x238b22[_0x9edd('0x30')]['filter']+'%'};return _0x30883e;}})});}_0x2ae8dd=_[_0x9edd('0x3d')]({},_0x2ae8dd,_0x238b22[_0x9edd('0x3e')]);var _0x2f8f61={'where':_0x2ae8dd['where']};return db[_0x9edd('0x2a')]['count'](_0x2f8f61)[_0x9edd('0x21')](function(_0xfbc492){_0x5eccfb['count']=_0xfbc492;if(_0x238b22[_0x9edd('0x30')][_0x9edd('0x3f')]){_0x2ae8dd[_0x9edd('0x40')]=[{'all':!![]}];}return db[_0x9edd('0x2a')]['findAll'](_0x2ae8dd);})[_0x9edd('0x21')](function(_0x5bbdf8){_0x5eccfb[_0x9edd('0x41')]=_0x5bbdf8;return _0x5eccfb;})[_0x9edd('0x21')](respondWithFilteredResult(_0x28cfae,_0x2ae8dd))['catch'](handleError(_0x28cfae,null));};exports[_0x9edd('0x42')]=function(_0x49a128,_0x548299){var _0x369b69={'raw':!![],'where':{'id':_0x49a128[_0x9edd('0x43')]['id']}},_0x9cab86={};_0x9cab86[_0x9edd('0x2f')]=_[_0x9edd('0x31')](db[_0x9edd('0x2a')][_0x9edd('0x2b')]);_0x9cab86[_0x9edd('0x30')]=_[_0x9edd('0x31')](_0x49a128[_0x9edd('0x30')]);_0x9cab86[_0x9edd('0x32')]=_[_0x9edd('0x44')](_0x9cab86[_0x9edd('0x2f')],_0x9cab86[_0x9edd('0x30')]);_0x369b69[_0x9edd('0x33')]=_['intersection'](_0x9cab86[_0x9edd('0x2f')],qs[_0x9edd('0x34')](_0x49a128[_0x9edd('0x30')][_0x9edd('0x34')]));_0x369b69[_0x9edd('0x33')]=_0x369b69[_0x9edd('0x33')][_0x9edd('0x35')]?_0x369b69['attributes']:_0x9cab86['model'];if(_0x49a128['query'][_0x9edd('0x3f')]){_0x369b69['include']=[{'all':!![]}];}_0x369b69=_[_0x9edd('0x3d')]({},_0x369b69,_0x49a128[_0x9edd('0x3e')]);return db[_0x9edd('0x2a')][_0x9edd('0x45')](_0x369b69)[_0x9edd('0x21')](handleEntityNotFound(_0x548299,null))['then'](respondWithResult(_0x548299,null))[_0x9edd('0x46')](handleError(_0x548299,null));};exports[_0x9edd('0x47')]=function(_0x40e33d,_0x4a89ae){return db[_0x9edd('0x2a')][_0x9edd('0x47')](_0x40e33d[_0x9edd('0x48')],{})[_0x9edd('0x21')](function(_0x1d78c4){var _0x35bdec=_0x40e33d['user'][_0x9edd('0x23')]({'plain':!![]});if(!_0x35bdec)throw new Error(_0x9edd('0x49'));if(_0x35bdec['role']===_0x9edd('0x4a')){var _0x8d8701=_0x1d78c4['get']({'plain':!![]});var _0x2bd089=_0x9edd('0x24');return db[_0x9edd('0x4b')]['find']({'where':{'name':_0x2bd089,'userProfileId':_0x35bdec[_0x9edd('0x4c')]},'raw':!![]})[_0x9edd('0x21')](function(_0x317a60){if(_0x317a60&&_0x317a60[_0x9edd('0x4d')]===0x0){return db['UserProfileResource'][_0x9edd('0x47')]({'name':_0x8d8701[_0x9edd('0x27')],'resourceId':_0x8d8701['id'],'type':_0x317a60[_0x9edd('0x27')],'sectionId':_0x317a60['id']},{})['then'](function(){return _0x1d78c4;});}else{return _0x1d78c4;}})[_0x9edd('0x46')](function(_0x21f6ce){logger['error'](_0x9edd('0x4e'),_0x21f6ce);throw _0x21f6ce;});}return _0x1d78c4;})['then'](respondWithResult(_0x4a89ae,0xc9))[_0x9edd('0x46')](handleError(_0x4a89ae,null));};exports[_0x9edd('0x20')]=function(_0x24245f,_0x3fcdf5){if(_0x24245f[_0x9edd('0x48')]['id']){delete _0x24245f[_0x9edd('0x48')]['id'];}return db[_0x9edd('0x2a')][_0x9edd('0x45')]({'where':{'id':_0x24245f[_0x9edd('0x43')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x3fcdf5,null))[_0x9edd('0x21')](saveUpdates(_0x24245f['body'],null))[_0x9edd('0x21')](respondWithResult(_0x3fcdf5,null))[_0x9edd('0x46')](handleError(_0x3fcdf5,null));};exports[_0x9edd('0x22')]=function(_0x58fe29,_0xe96d6a){return db['ContactItemType']['find']({'where':{'id':_0x58fe29['params']['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0xe96d6a,null))[_0x9edd('0x21')](removeEntity(_0xe96d6a,null))[_0x9edd('0x46')](handleError(_0xe96d6a,null));}; \ No newline at end of file +var _0x9957=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','get','ContactItemTypes','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','ContactItemType','count','include','catch','show','params','keys','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x275926,_0x184cbc){var _0x55acf1=function(_0x147984){while(--_0x147984){_0x275926['push'](_0x275926['shift']());}};_0x55acf1(++_0x184cbc);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){var _0x32a09a=_0x460924[_0x7995('0x26')]({'plain':!![]});var _0x204507=_0x7995('0x27');return db[_0x7995('0x28')][_0x7995('0x25')]({'where':{'type':_0x204507,'resourceId':_0x32a09a['id']}})[_0x7995('0x24')](function(){return _0x460924;});})[_0x7995('0x24')](function(){_0x350fd9['status'](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1a')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x29')]);if(_0x47625f[_0x7995('0x2a')]){delete _0x47625f[_0x7995('0x2a')];}_0x2a307e[_0x7995('0x1b')](_0x56691a)[_0x7995('0x2b')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['ContactItemType'][_0x7995('0x2c')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2d')],'type':_0xe6b0b3[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x3250e0[_0x7995('0x30')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x31')]=_['keys'](_0x9b2a15[_0x7995('0x31')]);_0x3250e0[_0x7995('0x32')]=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],_0x3250e0[_0x7995('0x31')]);_0x456a28['attributes']=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x34')]=_0x456a28[_0x7995('0x34')]['length']?_0x456a28[_0x7995('0x34')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x31')][_0x7995('0x35')](_0x7995('0x36'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x31')]['limit']);_0x456a28['offset']=qs[_0x7995('0x1e')](_0x9b2a15[_0x7995('0x31')]['offset']);}_0x456a28[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x9b2a15[_0x7995('0x31')][_0x7995('0x38')]);_0x456a28[_0x7995('0x39')]=qs['filters'](_[_0x7995('0x3a')](_0x9b2a15[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]),_0x574574);if(_0x9b2a15[_0x7995('0x31')]['filter']){_0x456a28[_0x7995('0x39')]=_[_0x7995('0x3b')](_0x456a28[_0x7995('0x39')],{'$or':_[_0x7995('0x3c')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2e')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2a')]]={'$like':'%'+_0x9b2a15[_0x7995('0x31')][_0x7995('0x3d')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3b')]({},_0x456a28,_0x9b2a15[_0x7995('0x3e')]);var _0x14d638={'where':_0x456a28[_0x7995('0x39')]};return db[_0x7995('0x3f')][_0x7995('0x40')](_0x14d638)[_0x7995('0x24')](function(_0x270d52){_0x4253e5[_0x7995('0x40')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x3f')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x42')](handleError(_0x514445,null));};exports[_0x7995('0x43')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':!![],'where':{'id':_0x35c8ff[_0x7995('0x44')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x3f')][_0x7995('0x2c')]);_0x5e85b9[_0x7995('0x31')]=_[_0x7995('0x45')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x33')](_0x5e85b9[_0x7995('0x30')],_0x5e85b9[_0x7995('0x31')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x30')],qs['fields'](_0x35c8ff[_0x7995('0x31')]['fields']));_0x46ac4f[_0x7995('0x34')]=_0x46ac4f['attributes'][_0x7995('0x46')]?_0x46ac4f[_0x7995('0x34')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x31')][_0x7995('0x47')]){_0x46ac4f[_0x7995('0x41')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3b')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x3f')][_0x7995('0x48')](_0x46ac4f)[_0x7995('0x24')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x42')](handleError(_0x576b96,null));};exports[_0x7995('0x49')]=function(_0x511567,_0x3d8ae3){return db[_0x7995('0x3f')]['create'](_0x511567[_0x7995('0x4a')],{})[_0x7995('0x24')](function(_0x5921b9){var _0x3d1dbb=_0x511567['user'][_0x7995('0x26')]({'plain':!![]});if(!_0x3d1dbb)throw new Error(_0x7995('0x4b'));if(_0x3d1dbb[_0x7995('0x4c')]===_0x7995('0x4d')){var _0xddf537=_0x5921b9[_0x7995('0x26')]({'plain':!![]});var _0x1579b9='ContactItemTypes';return db[_0x7995('0x4e')][_0x7995('0x48')]({'where':{'name':_0x1579b9,'userProfileId':_0x3d1dbb[_0x7995('0x4f')]},'raw':!![]})['then'](function(_0x19da63){if(_0x19da63&&_0x19da63[_0x7995('0x50')]===0x0){return db[_0x7995('0x28')]['create']({'name':_0xddf537['name'],'resourceId':_0xddf537['id'],'type':_0x19da63['name'],'sectionId':_0x19da63['id']},{})[_0x7995('0x24')](function(){return _0x5921b9;});}else{return _0x5921b9;}})[_0x7995('0x42')](function(_0x4cf5db){logger[_0x7995('0x51')](_0x7995('0x52'),_0x4cf5db);throw _0x4cf5db;});}return _0x5921b9;})[_0x7995('0x24')](respondWithResult(_0x3d8ae3,0xc9))[_0x7995('0x42')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x53')]=function(_0x528c8e,_0x29ee32){if(_0x528c8e['body']['id']){delete _0x528c8e[_0x7995('0x4a')]['id'];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':{'id':_0x528c8e['params']['id']}})['then'](handleEntityNotFound(_0x29ee32,null))['then'](saveUpdates(_0x528c8e['body'],null))[_0x7995('0x24')](respondWithResult(_0x29ee32,null))[_0x7995('0x42')](handleError(_0x29ee32,null));};exports[_0x7995('0x25')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':{'id':_0x150261[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x1d957e,null))[_0x7995('0x24')](removeEntity(_0x1d957e,null))[_0x7995('0x42')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 954d754..e079608 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 _0xed5f=['define','ContactItemType','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./contactItemType.attributes','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xed5f,0x1e6));var _0xfed5=function(_0x12598a,_0x57c8d4){_0x12598a=_0x12598a-0x0;var _0xf86ee9=_0xed5f[_0x12598a];return _0xf86ee9;};'use strict';var _=require('lodash');var util=require(_0xfed5('0x0'));var logger=require(_0xfed5('0x1'))(_0xfed5('0x2'));var moment=require('moment');var BPromise=require(_0xfed5('0x3'));var rp=require(_0xfed5('0x4'));var fs=require('fs');var path=require(_0xfed5('0x5'));var rimraf=require(_0xfed5('0x6'));var config=require('../../config/environment');var attributes=require(_0xfed5('0x7'));module[_0xfed5('0x8')]=function(_0x3d6edd,_0x5a1dcc){return _0x3d6edd[_0xfed5('0x9')](_0xfed5('0xa'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d7e=['./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x58cf07,_0x2e3858){var _0x42afe0=function(_0x3c71ff){while(--_0x3c71ff){_0x58cf07['push'](_0x58cf07['shift']());}};_0x42afe0(++_0x2e3858);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x1d7e[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var util=require(_0xe1d7('0x0'));var logger=require(_0xe1d7('0x1'))(_0xe1d7('0x2'));var moment=require('moment');var BPromise=require(_0xe1d7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1d7('0x4'));var rimraf=require(_0xe1d7('0x5'));var config=require(_0xe1d7('0x6'));var attributes=require(_0xe1d7('0x7'));module[_0xe1d7('0x8')]=function(_0x4058fe,_0x252026){return _0x4058fe[_0xe1d7('0x9')](_0xe1d7('0xa'),attributes,{'tableName':_0xe1d7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 99c3341..1fbe54f 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 _0x6737=['stringify','error','code','message','info','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','ContactItemType,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x44ecda,_0x2798d6){var _0x164fc4=function(_0x42c7ed){while(--_0x42c7ed){_0x44ecda['push'](_0x44ecda['shift']());}};_0x164fc4(++_0x2798d6);}(_0x6737,0xe2));var _0x7673=function(_0x3130ac,_0x5e31fe){_0x3130ac=_0x3130ac-0x0;var _0x128b06=_0x6737[_0x3130ac];return _0x128b06;};'use strict';var _=require('lodash');var util=require(_0x7673('0x0'));var moment=require(_0x7673('0x1'));var BPromise=require('bluebird');var rs=require(_0x7673('0x2'));var fs=require('fs');var Redis=require(_0x7673('0x3'));var db=require(_0x7673('0x4'))['db'];var utils=require(_0x7673('0x5'));var logger=require('../../config/logger')(_0x7673('0x6'));var config=require(_0x7673('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7673('0x8')][_0x7673('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af802,_0x4e4b24,_0x53d67d){return new BPromise(function(_0x5292f7,_0x285c6d){return client['request'](_0x5af802,_0x53d67d)[_0x7673('0xa')](function(_0x1fb769){logger['info'](_0x7673('0xb'),_0x4e4b24,_0x7673('0xc'));logger[_0x7673('0xd')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x4e4b24,'request\x20sent',JSON[_0x7673('0xe')](_0x1fb769));if(_0x1fb769['error']){if(_0x1fb769[_0x7673('0xf')][_0x7673('0x10')]===0x1f4){logger[_0x7673('0xf')](_0x7673('0xb'),_0x4e4b24,_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);return _0x285c6d(_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);}logger[_0x7673('0xf')](_0x7673('0xb'),_0x4e4b24,_0x1fb769['error'][_0x7673('0x11')]);return _0x5292f7(_0x1fb769[_0x7673('0xf')][_0x7673('0x11')]);}else{logger[_0x7673('0x12')](_0x7673('0xb'),_0x4e4b24,_0x7673('0xc'));_0x5292f7(_0x1fb769[_0x7673('0x13')]['message']);}})['catch'](function(_0x164d05){logger[_0x7673('0xf')]('ContactItemType,\x20%s,\x20%s',_0x4e4b24,_0x164d05);_0x285c6d(_0x164d05);});});} \ No newline at end of file +var _0xa8a8=['stringify','error','code','ContactItemType,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x10dd8f,_0x3f34e2){var _0x4d822b=function(_0x21a170){while(--_0x21a170){_0x10dd8f['push'](_0x10dd8f['shift']());}};_0x4d822b(++_0x3f34e2);}(_0xa8a8,0xec));var _0x8a8a=function(_0x3040a1,_0x1ba016){_0x3040a1=_0x3040a1-0x0;var _0x6ca3ca=_0xa8a8[_0x3040a1];return _0x6ca3ca;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('ContactItemType,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('ContactItemType,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 5826987..a3b1188 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 _0x73ed=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','put','update','destroy','util','path','express','Router'];(function(_0x152600,_0x4dc9a3){var _0x122828=function(_0x4c94a4){while(--_0x4c94a4){_0x152600['push'](_0x152600['shift']());}};_0x122828(++_0x4dc9a3);}(_0x73ed,0x1a0));var _0xd73e=function(_0x492709,_0x49d3e5){_0x492709=_0x492709-0x0;var _0x19778e=_0x73ed[_0x492709];return _0x19778e;};'use strict';var multer=require('multer');var util=require(_0xd73e('0x0'));var path=require(_0xd73e('0x1'));var timeout=require('connect-timeout');var express=require(_0xd73e('0x2'));var router=express[_0xd73e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd73e('0x4'));var config=require(_0xd73e('0x5'));var controller=require('./contactItemType.controller');router['get']('/',auth[_0xd73e('0x6')](),controller[_0xd73e('0x7')]);router[_0xd73e('0x8')](_0xd73e('0x9'),auth[_0xd73e('0x6')](),controller[_0xd73e('0xa')]);router[_0xd73e('0xb')]('/',auth[_0xd73e('0x6')](),controller['create']);router[_0xd73e('0xc')](_0xd73e('0x9'),auth['isAuthenticated'](),controller[_0xd73e('0xd')]);router['delete'](_0xd73e('0x9'),auth[_0xd73e('0x6')](),controller[_0xd73e('0xe')]);module['exports']=router; \ No newline at end of file +var _0x34a9=['create','put','update','delete','/:id','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','post'];(function(_0x5814e5,_0x1bf811){var _0x526695=function(_0x51af11){while(--_0x51af11){_0x5814e5['push'](_0x5814e5['shift']());}};_0x526695(++_0x1bf811);}(_0x34a9,0xba));var _0x934a=function(_0x2d199b,_0x1fd913){_0x2d199b=_0x2d199b-0x0;var _0x27f1a2=_0x34a9[_0x2d199b];return _0x27f1a2;};'use strict';var multer=require(_0x934a('0x0'));var util=require(_0x934a('0x1'));var path=require(_0x934a('0x2'));var timeout=require('connect-timeout');var express=require(_0x934a('0x3'));var router=express[_0x934a('0x4')]();var auth=require(_0x934a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x934a('0x6'));var controller=require('./contactItemType.controller');router[_0x934a('0x7')]('/',auth['isAuthenticated'](),controller[_0x934a('0x8')]);router['get']('/:id',auth[_0x934a('0x9')](),controller[_0x934a('0xa')]);router[_0x934a('0xb')]('/',auth['isAuthenticated'](),controller[_0x934a('0xc')]);router[_0x934a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x934a('0xe')]);router[_0x934a('0xf')](_0x934a('0x10'),auth['isAuthenticated'](),controller[_0x934a('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index e45ce4e..277be4f 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 _0x048f=['exports','name','sequelize'];(function(_0x13bc5e,_0x507587){var _0x13736c=function(_0x464a67){while(--_0x464a67){_0x13bc5e['push'](_0x13bc5e['shift']());}};_0x13736c(++_0x507587);}(_0x048f,0x1c7));var _0xf048=function(_0x4ece90,_0x50d27e){_0x4ece90=_0x4ece90-0x0;var _0x4051ca=_0x048f[_0x4ece90];return _0x4051ca;};'use strict';var Sequelize=require(_0xf048('0x0'));module[_0xf048('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf048('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8ef6=['STRING','name','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x36bab5,_0xfc0a07){_0x36bab5=_0x36bab5-0x0;var _0x504354=_0x8ef6[_0x36bab5];return _0x504354;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![],'unique':_0x68ef('0x3')},'description':{'type':Sequelize[_0x68ef('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index beb9be3..84b3398 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 _0xd3a7=['role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','pick','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./dashboard.socket','register','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','then','destroy','get','CustomDashboards','error','name','index','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','Dashboard','count','includeAll','include','findAll','rows','catch','show','params','find','create','user'];(function(_0x3631e9,_0x536b42){var _0x383a54=function(_0x4e25a1){while(--_0x4e25a1){_0x3631e9['push'](_0x3631e9['shift']());}};_0x383a54(++_0x536b42);}(_0xd3a7,0xa7));var _0x7d3a=function(_0x3398e2,_0x39026b){_0x3398e2=_0x3398e2-0x0;var _0x36b9aa=_0xd3a7[_0x3398e2];return _0x36b9aa;};'use strict';var pdf=require(_0x7d3a('0x0'));var emlformat=require(_0x7d3a('0x1'));var rimraf=require(_0x7d3a('0x2'));var zipdir=require(_0x7d3a('0x3'));var jsonpatch=require(_0x7d3a('0x4'));var rp=require(_0x7d3a('0x5'));var moment=require(_0x7d3a('0x6'));var BPromise=require(_0x7d3a('0x7'));var Mustache=require(_0x7d3a('0x8'));var util=require(_0x7d3a('0x9'));var path=require(_0x7d3a('0xa'));var sox=require(_0x7d3a('0xb'));var csv=require(_0x7d3a('0xc'));var ejs=require(_0x7d3a('0xd'));var fs=require('fs');var _=require(_0x7d3a('0xe'));var squel=require(_0x7d3a('0xf'));var crypto=require(_0x7d3a('0x10'));var jsforce=require(_0x7d3a('0x11'));var deskjs=require(_0x7d3a('0x12'));var toCsv=require(_0x7d3a('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7d3a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7d3a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d3a('0x15'))(_0x7d3a('0x16'));var utils=require(_0x7d3a('0x17'));var config=require(_0x7d3a('0x18'));var db=require(_0x7d3a('0x19'))['db'];config[_0x7d3a('0x1a')]=_[_0x7d3a('0x1b')](config[_0x7d3a('0x1a')],{'host':_0x7d3a('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7d3a('0x1d'))[_0x7d3a('0x1e')](socket);function respondWithStatusCode(_0x2f8353,_0x19f4df){_0x19f4df=_0x19f4df||0xcc;return function(_0x3a5b09){if(_0x3a5b09){return _0x2f8353[_0x7d3a('0x1f')](_0x19f4df);}return _0x2f8353[_0x7d3a('0x20')](_0x19f4df)[_0x7d3a('0x21')]();};}function respondWithResult(_0x4b0f72,_0x21fbf3){_0x21fbf3=_0x21fbf3||0xc8;return function(_0x11b3b2){if(_0x11b3b2){return _0x4b0f72[_0x7d3a('0x20')](_0x21fbf3)[_0x7d3a('0x22')](_0x11b3b2);}};}function respondWithFilteredResult(_0x126ea6,_0x4e70fb){return function(_0x848b19){if(_0x848b19){var _0x1df7b1=_0x848b19['count'],_0x2eb631=_0x4e70fb[_0x7d3a('0x23')],_0x1b61e5=_0x4e70fb[_0x7d3a('0x23')]+_0x4e70fb['limit'],_0x8c8896;if(_0x1b61e5>=_0x1df7b1){_0x1b61e5=_0x1df7b1;_0x8c8896=0xc8;}else{_0x8c8896=0xce;}_0x126ea6[_0x7d3a('0x20')](_0x8c8896);return _0x126ea6[_0x7d3a('0x24')](_0x7d3a('0x25'),_0x2eb631+'-'+_0x1b61e5+'/'+_0x1df7b1)[_0x7d3a('0x22')](_0x848b19);}return null;};}function patchUpdates(_0x503876){return function(_0x3db97a){try{jsonpatch[_0x7d3a('0x26')](_0x3db97a,_0x503876,!![]);}catch(_0x2a0f13){return BPromise[_0x7d3a('0x27')](_0x2a0f13);}return _0x3db97a['save']();};}function saveUpdates(_0x14e673,_0x1869b5){return function(_0x1942e5){if(_0x1942e5){return _0x1942e5['update'](_0x14e673)[_0x7d3a('0x28')](function(_0x14ff6e){return _0x14ff6e;});}return null;};}function removeEntity(_0x2b0c92,_0x17d15){return function(_0x3c9e69){if(_0x3c9e69){return _0x3c9e69[_0x7d3a('0x29')]()[_0x7d3a('0x28')](function(){var _0x190adf=_0x3c9e69[_0x7d3a('0x2a')]({'plain':!![]});var _0x3110f9=_0x7d3a('0x2b');return db['UserProfileResource']['destroy']({'where':{'type':_0x3110f9,'resourceId':_0x190adf['id']}})[_0x7d3a('0x28')](function(){return _0x3c9e69;});})[_0x7d3a('0x28')](function(){_0x2b0c92[_0x7d3a('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11943f,_0x2d6a5c){return function(_0x1d52d5){if(!_0x1d52d5){_0x11943f[_0x7d3a('0x1f')](0x194);}return _0x1d52d5;};}function handleError(_0x3fa863,_0x4d18cb){_0x4d18cb=_0x4d18cb||0x1f4;return function(_0x37c13a){logger[_0x7d3a('0x2c')](_0x37c13a['stack']);if(_0x37c13a['name']){delete _0x37c13a[_0x7d3a('0x2d')];}_0x3fa863[_0x7d3a('0x20')](_0x4d18cb)['send'](_0x37c13a);};}exports[_0x7d3a('0x2e')]=function(_0x33094f,_0x4be548){var _0x252895={},_0x2ca759={},_0x19d389={'count':0x0,'rows':[]};var _0x4218f5=_['map'](db['Dashboard'][_0x7d3a('0x2f')],function(_0x514e96){return{'name':_0x514e96[_0x7d3a('0x30')],'type':_0x514e96['type'][_0x7d3a('0x31')]};});_0x2ca759[_0x7d3a('0x32')]=_[_0x7d3a('0x33')](_0x4218f5,_0x7d3a('0x2d'));_0x2ca759['query']=_[_0x7d3a('0x34')](_0x33094f[_0x7d3a('0x35')]);_0x2ca759[_0x7d3a('0x36')]=_[_0x7d3a('0x37')](_0x2ca759[_0x7d3a('0x32')],_0x2ca759[_0x7d3a('0x35')]);_0x252895['attributes']=_[_0x7d3a('0x37')](_0x2ca759[_0x7d3a('0x32')],qs[_0x7d3a('0x38')](_0x33094f[_0x7d3a('0x35')][_0x7d3a('0x38')]));_0x252895[_0x7d3a('0x39')]=_0x252895[_0x7d3a('0x39')][_0x7d3a('0x3a')]?_0x252895[_0x7d3a('0x39')]:_0x2ca759['model'];if(!_0x33094f[_0x7d3a('0x35')][_0x7d3a('0x3b')](_0x7d3a('0x3c'))){_0x252895[_0x7d3a('0x3d')]=qs[_0x7d3a('0x3d')](_0x33094f['query'][_0x7d3a('0x3d')]);_0x252895[_0x7d3a('0x23')]=qs[_0x7d3a('0x23')](_0x33094f[_0x7d3a('0x35')][_0x7d3a('0x23')]);}_0x252895[_0x7d3a('0x3e')]=qs[_0x7d3a('0x3f')](_0x33094f[_0x7d3a('0x35')]['sort']);_0x252895[_0x7d3a('0x40')]=qs[_0x7d3a('0x36')](_['pick'](_0x33094f['query'],_0x2ca759[_0x7d3a('0x36')]),_0x4218f5);if(_0x33094f['query'][_0x7d3a('0x41')]){_0x252895['where']=_[_0x7d3a('0x42')](_0x252895[_0x7d3a('0x40')],{'$or':_[_0x7d3a('0x33')](_0x4218f5,function(_0x394f34){if(_0x394f34['type']!==_0x7d3a('0x43')){var _0x5c66aa={};_0x5c66aa[_0x394f34[_0x7d3a('0x2d')]]={'$like':'%'+_0x33094f[_0x7d3a('0x35')]['filter']+'%'};return _0x5c66aa;}})});}_0x252895=_[_0x7d3a('0x42')]({},_0x252895,_0x33094f[_0x7d3a('0x44')]);var _0x2ae0d7={'where':_0x252895[_0x7d3a('0x40')]};return db[_0x7d3a('0x45')][_0x7d3a('0x46')](_0x2ae0d7)[_0x7d3a('0x28')](function(_0x2a99f2){_0x19d389[_0x7d3a('0x46')]=_0x2a99f2;if(_0x33094f[_0x7d3a('0x35')][_0x7d3a('0x47')]){_0x252895[_0x7d3a('0x48')]=[{'all':!![]}];}return db[_0x7d3a('0x45')][_0x7d3a('0x49')](_0x252895);})['then'](function(_0x3e5112){_0x19d389[_0x7d3a('0x4a')]=_0x3e5112;return _0x19d389;})[_0x7d3a('0x28')](respondWithFilteredResult(_0x4be548,_0x252895))[_0x7d3a('0x4b')](handleError(_0x4be548,null));};exports[_0x7d3a('0x4c')]=function(_0x2db2e4,_0x58b71a){var _0x101850={'raw':![],'where':{'id':_0x2db2e4[_0x7d3a('0x4d')]['id']}},_0x55b665={};_0x55b665[_0x7d3a('0x32')]=_[_0x7d3a('0x34')](db['Dashboard'][_0x7d3a('0x2f')]);_0x55b665[_0x7d3a('0x35')]=_[_0x7d3a('0x34')](_0x2db2e4[_0x7d3a('0x35')]);_0x55b665['filters']=_[_0x7d3a('0x37')](_0x55b665[_0x7d3a('0x32')],_0x55b665[_0x7d3a('0x35')]);_0x101850[_0x7d3a('0x39')]=_[_0x7d3a('0x37')](_0x55b665[_0x7d3a('0x32')],qs[_0x7d3a('0x38')](_0x2db2e4[_0x7d3a('0x35')][_0x7d3a('0x38')]));_0x101850[_0x7d3a('0x39')]=_0x101850[_0x7d3a('0x39')]['length']?_0x101850['attributes']:_0x55b665[_0x7d3a('0x32')];if(_0x2db2e4[_0x7d3a('0x35')][_0x7d3a('0x47')]){_0x101850[_0x7d3a('0x48')]=[{'all':!![]}];}_0x101850=_['merge']({},_0x101850,_0x2db2e4[_0x7d3a('0x44')]);return db[_0x7d3a('0x45')][_0x7d3a('0x4e')](_0x101850)[_0x7d3a('0x28')](handleEntityNotFound(_0x58b71a,null))[_0x7d3a('0x28')](respondWithResult(_0x58b71a,null))[_0x7d3a('0x4b')](handleError(_0x58b71a,null));};exports[_0x7d3a('0x4f')]=function(_0x5551ef,_0x25ed4b){return db['Dashboard'][_0x7d3a('0x4f')](_0x5551ef['body'],{})[_0x7d3a('0x28')](function(_0xd18c7f){var _0x47d9bb=_0x5551ef[_0x7d3a('0x50')]['get']({'plain':!![]});if(!_0x47d9bb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47d9bb[_0x7d3a('0x51')]===_0x7d3a('0x50')){var _0x4f3d70=_0xd18c7f[_0x7d3a('0x2a')]({'plain':!![]});var _0x11bd9d=_0x7d3a('0x2b');return db[_0x7d3a('0x52')][_0x7d3a('0x4e')]({'where':{'name':_0x11bd9d,'userProfileId':_0x47d9bb[_0x7d3a('0x53')]},'raw':!![]})[_0x7d3a('0x28')](function(_0x3fe478){if(_0x3fe478&&_0x3fe478[_0x7d3a('0x54')]===0x0){return db[_0x7d3a('0x55')]['create']({'name':_0x4f3d70['name'],'resourceId':_0x4f3d70['id'],'type':_0x3fe478['name'],'sectionId':_0x3fe478['id']},{})[_0x7d3a('0x28')](function(){return _0xd18c7f;});}else{return _0xd18c7f;}})[_0x7d3a('0x4b')](function(_0x5d948a){logger[_0x7d3a('0x2c')](_0x7d3a('0x56'),_0x5d948a);throw _0x5d948a;});}return _0xd18c7f;})['then'](respondWithResult(_0x25ed4b,0xc9))[_0x7d3a('0x4b')](handleError(_0x25ed4b,null));};exports['clone']=function(_0x18ea13,_0x2c7a7c){var _0x390170={'where':{'id':_0x18ea13[_0x7d3a('0x4d')]['id']}},_0x5110e2={};_0x5110e2[_0x7d3a('0x32')]=_[_0x7d3a('0x34')](db['Dashboard'][_0x7d3a('0x2f')]);_0x390170[_0x7d3a('0x39')]=_[_0x7d3a('0x37')](_0x5110e2['model'],qs[_0x7d3a('0x38')](_0x18ea13['query']['fields']));_0x390170[_0x7d3a('0x39')]=_0x390170[_0x7d3a('0x39')][_0x7d3a('0x3a')]?_0x390170[_0x7d3a('0x39')]:_0x5110e2[_0x7d3a('0x32')];if(_0x18ea13[_0x7d3a('0x35')][_0x7d3a('0x47')]){_0x390170[_0x7d3a('0x48')]=[{'all':!![]}];}_0x390170=_[_0x7d3a('0x42')]({},_0x390170,_0x18ea13['options']);return db[_0x7d3a('0x45')]['find'](_0x390170)[_0x7d3a('0x28')](handleEntityNotFound(_0x2c7a7c,null))['then'](function(_0x5ae732){if(_0x5ae732){var _0x90e956=_0x5ae732[_0x7d3a('0x2a')]({'plain':!![]});_0x90e956=qs['omit'](_0x90e956,['id',_0x7d3a('0x57'),_0x7d3a('0x58')]);_0x18ea13[_0x7d3a('0x59')]=_['omit'](_0x18ea13[_0x7d3a('0x59')],['id',_0x7d3a('0x57'),_0x7d3a('0x58')]);return db[_0x7d3a('0x45')][_0x7d3a('0x4f')](_['merge'](_0x90e956,_0x18ea13[_0x7d3a('0x59')]),{'include':_0x18ea13['query'][_0x7d3a('0x47')]?[{'all':!![]}]:undefined})[_0x7d3a('0x28')](function(_0x37214e){var _0x321750=_0x18ea13[_0x7d3a('0x50')]['get']({'plain':!![]});if(!_0x321750)throw new Error(_0x7d3a('0x5a'));if(_0x321750['role']===_0x7d3a('0x50')){var _0x2adc59=_0x37214e['get']({'plain':!![]});var _0x256f6f='CustomDashboards';return db[_0x7d3a('0x52')]['find']({'where':{'name':_0x256f6f,'userProfileId':_0x321750[_0x7d3a('0x53')]},'raw':!![]})[_0x7d3a('0x28')](function(_0x52a44b){if(_0x52a44b&&_0x52a44b[_0x7d3a('0x54')]===0x0){return db['UserProfileResource'][_0x7d3a('0x4f')]({'name':_0x2adc59['name'],'resourceId':_0x2adc59['id'],'type':_0x52a44b[_0x7d3a('0x2d')],'sectionId':_0x52a44b['id']},{})[_0x7d3a('0x28')](function(){return _0x37214e;});}else{return _0x37214e;}})['catch'](function(_0x408d64){logger[_0x7d3a('0x2c')](_0x7d3a('0x56'),_0x408d64);throw _0x408d64;});}return _0x37214e;});}})[_0x7d3a('0x28')](respondWithResult(_0x2c7a7c,0xc9))[_0x7d3a('0x4b')](handleError(_0x2c7a7c,null));};exports[_0x7d3a('0x5b')]=function(_0x33cf12,_0x206d74){if(_0x33cf12[_0x7d3a('0x59')]['id']){delete _0x33cf12[_0x7d3a('0x59')]['id'];}return db[_0x7d3a('0x45')][_0x7d3a('0x4e')]({'where':{'id':_0x33cf12['params']['id']}})['then'](handleEntityNotFound(_0x206d74,null))['then'](saveUpdates(_0x33cf12[_0x7d3a('0x59')],null))['then'](respondWithResult(_0x206d74,null))['catch'](handleError(_0x206d74,null));};exports[_0x7d3a('0x29')]=function(_0x1b261d,_0x5c1d06){return db[_0x7d3a('0x45')][_0x7d3a('0x4e')]({'where':{'id':_0x1b261d[_0x7d3a('0x4d')]['id']}})[_0x7d3a('0x28')](handleEntityNotFound(_0x5c1d06,null))[_0x7d3a('0x28')](removeEntity(_0x5c1d06,null))[_0x7d3a('0x4b')](handleError(_0x5c1d06,null));};function widgetAttributes(_0x40e43c){try{switch(_0x40e43c['type']){case _0x7d3a('0x5c'):return[{'name':_0x7d3a('0x5d'),'value':_0x40e43c[_0x7d3a('0x5d')]||(_0x40e43c[_0x7d3a('0x5e')]&&_0x40e43c['attrs'][0x0]?_0x40e43c['attrs'][0x0][_0x7d3a('0x5f')]:undefined)||'https://'}];case _0x7d3a('0x60'):return[{'name':_0x7d3a('0x61'),'value':_0x40e43c[_0x7d3a('0x61')]||(_0x40e43c[_0x7d3a('0x5e')]&&_0x40e43c[_0x7d3a('0x5e')][0x0]?_0x40e43c['attrs'][0x0]['value']:undefined)||''}];case _0x7d3a('0x62'):return[{'name':'attrHourFormat','value':_0x40e43c[_0x7d3a('0x63')]||(_0x40e43c[_0x7d3a('0x5e')]&&_0x40e43c[_0x7d3a('0x5e')][0x0]?_0x40e43c[_0x7d3a('0x5e')][0x0]['value']:undefined)||_0x7d3a('0x64')},{'name':_0x7d3a('0x65'),'value':_0x40e43c[_0x7d3a('0x65')]||(_0x40e43c[_0x7d3a('0x5e')]&&_0x40e43c[_0x7d3a('0x5e')][0x1]?_0x40e43c[_0x7d3a('0x5e')][0x1][_0x7d3a('0x5f')]:undefined)||_0x7d3a('0x66')},{'name':_0x7d3a('0x67'),'value':_0x40e43c[_0x7d3a('0x67')]||(_0x40e43c['attrs']&&_0x40e43c['attrs'][0x2]?_0x40e43c[_0x7d3a('0x5e')][0x2][_0x7d3a('0x5f')]:undefined)||0xc}];case _0x7d3a('0x68'):return[{'name':_0x7d3a('0x69'),'value':_0x40e43c[_0x7d3a('0x69')]||(_0x40e43c[_0x7d3a('0x5e')]&&_0x40e43c[_0x7d3a('0x5e')][0x0]?_0x40e43c[_0x7d3a('0x5e')][0x0][_0x7d3a('0x5f')]:undefined)||_0x7d3a('0x6a')},{'name':_0x7d3a('0x6b'),'value':_0x40e43c[_0x7d3a('0x6b')]||(_0x40e43c[_0x7d3a('0x5e')]&&_0x40e43c['attrs'][0x1]?_0x40e43c[_0x7d3a('0x5e')][0x1][_0x7d3a('0x5f')]:undefined)||[]},{'name':_0x7d3a('0x67'),'value':_0x40e43c[_0x7d3a('0x67')]||(_0x40e43c[_0x7d3a('0x5e')]&&_0x40e43c[_0x7d3a('0x5e')][0x2]?_0x40e43c['attrs'][0x2]['value']:undefined)||0x14}];case _0x7d3a('0x6c'):case'pie-chart':return[{'name':_0x7d3a('0x6d'),'value':_0x40e43c[_0x7d3a('0x6d')]||(_0x40e43c[_0x7d3a('0x5e')]&&_0x40e43c[_0x7d3a('0x5e')][0x0]?_0x40e43c['attrs'][0x0][_0x7d3a('0x5f')]:undefined)||'total'},{'name':'attrSerie2','value':_0x40e43c[_0x7d3a('0x6e')]||(_0x40e43c[_0x7d3a('0x5e')]&&_0x40e43c['attrs'][0x1]?_0x40e43c[_0x7d3a('0x5e')][0x1][_0x7d3a('0x5f')]:undefined)||null},{'name':_0x7d3a('0x6f'),'value':_0x40e43c[_0x7d3a('0x6f')]||(_0x40e43c[_0x7d3a('0x5e')]&&_0x40e43c[_0x7d3a('0x5e')][0x2]?_0x40e43c[_0x7d3a('0x5e')][0x2][_0x7d3a('0x5f')]:undefined)||null},{'name':_0x7d3a('0x6b'),'value':_0x40e43c[_0x7d3a('0x6b')]||(_0x40e43c['attrs']&&_0x40e43c[_0x7d3a('0x5e')][0x3]?_0x40e43c['attrs'][0x3]['value']:undefined)||[]}];case _0x7d3a('0x70'):return[{'name':_0x7d3a('0x71'),'type':_0x40e43c[_0x7d3a('0x72')]||(_0x40e43c['attrs']&&_0x40e43c[_0x7d3a('0x5e')][0x0]?_0x40e43c['attrs'][0x0][_0x7d3a('0x73')]:undefined)||null,'value':_0x40e43c[_0x7d3a('0x71')]||(_0x40e43c[_0x7d3a('0x5e')]&&_0x40e43c['attrs'][0x0]?_0x40e43c[_0x7d3a('0x5e')][0x0]['value']:undefined)||null},{'name':_0x7d3a('0x74'),'value':_0x40e43c[_0x7d3a('0x74')]||(_0x40e43c[_0x7d3a('0x5e')]&&_0x40e43c[_0x7d3a('0x5e')][0x1]?_0x40e43c[_0x7d3a('0x5e')][0x1][_0x7d3a('0x5f')]:undefined)||0x0}];default:return[];}}catch(_0x27094e){logger[_0x7d3a('0x2c')](_0x7d3a('0x75'),JSON[_0x7d3a('0x76')](_0x27094e));return[];}}exports[_0x7d3a('0x77')]=function(_0x269422,_0x21ee3e,_0x18d94c){if(_0x269422[_0x7d3a('0x59')]['id']){delete _0x269422[_0x7d3a('0x59')]['id'];}return db['Dashboard'][_0x7d3a('0x4e')]({'where':{'id':_0x269422[_0x7d3a('0x4d')]['id']}})[_0x7d3a('0x28')](handleEntityNotFound(_0x21ee3e,null))[_0x7d3a('0x28')](function(_0x4c4062){if(_0x4c4062){_0x269422[_0x7d3a('0x59')][_0x7d3a('0x78')]=_0x4c4062['id'];_0x269422[_0x7d3a('0x59')]['attrs']=widgetAttributes(_0x269422['body']);return db[_0x7d3a('0x79')][_0x7d3a('0x4f')](_0x269422[_0x7d3a('0x59')]);}})[_0x7d3a('0x28')](respondWithResult(_0x21ee3e,null))[_0x7d3a('0x4b')](handleError(_0x21ee3e,null));};exports[_0x7d3a('0x7a')]=function(_0x279211,_0x37f320,_0x4d9c0d){var _0x5d178d={};var _0x1ca0b4={};var _0x35e510;var _0x1641c2;return db['Dashboard']['findOne']({'where':{'id':_0x279211[_0x7d3a('0x4d')]['id']}})[_0x7d3a('0x28')](handleEntityNotFound(_0x37f320,null))[_0x7d3a('0x28')](function(_0x48fb05){if(_0x48fb05){_0x35e510=_0x48fb05;_0x1ca0b4[_0x7d3a('0x32')]=_[_0x7d3a('0x34')](db['DashboardItem']['rawAttributes']);_0x1ca0b4[_0x7d3a('0x35')]=_[_0x7d3a('0x34')](_0x279211[_0x7d3a('0x35')]);_0x1ca0b4[_0x7d3a('0x36')]=_[_0x7d3a('0x37')](_0x1ca0b4[_0x7d3a('0x32')],_0x1ca0b4['query']);_0x5d178d[_0x7d3a('0x39')]=_[_0x7d3a('0x37')](_0x1ca0b4['model'],qs[_0x7d3a('0x38')](_0x279211[_0x7d3a('0x35')][_0x7d3a('0x38')]));_0x5d178d[_0x7d3a('0x39')]=_0x5d178d[_0x7d3a('0x39')][_0x7d3a('0x3a')]?_0x5d178d[_0x7d3a('0x39')]:_0x1ca0b4[_0x7d3a('0x32')];_0x5d178d[_0x7d3a('0x3e')]=qs['sort'](_0x279211[_0x7d3a('0x35')]['sort']);_0x5d178d[_0x7d3a('0x40')]=qs[_0x7d3a('0x36')](_[_0x7d3a('0x7b')](_0x279211['query'],_0x1ca0b4[_0x7d3a('0x36')]));if(_0x279211['query'][_0x7d3a('0x41')]){_0x5d178d['where']=_[_0x7d3a('0x42')](_0x5d178d[_0x7d3a('0x40')],{'$or':_[_0x7d3a('0x33')](_0x5d178d[_0x7d3a('0x39')],function(_0x26e2dd){var _0x3c6539={};_0x3c6539[_0x26e2dd]={'$like':'%'+_0x279211['query'][_0x7d3a('0x41')]+'%'};return _0x3c6539;})});}_0x5d178d=_[_0x7d3a('0x42')]({},_0x5d178d,_0x279211['options']);return _0x35e510[_0x7d3a('0x7a')](_0x5d178d);}})[_0x7d3a('0x28')](function(_0x45bccf){if(_0x45bccf){_0x1641c2=_0x45bccf[_0x7d3a('0x3a')];if(!_0x279211[_0x7d3a('0x35')][_0x7d3a('0x3b')](_0x7d3a('0x3c'))){_0x5d178d[_0x7d3a('0x3d')]=qs['limit'](_0x279211[_0x7d3a('0x35')][_0x7d3a('0x3d')]);_0x5d178d['offset']=qs[_0x7d3a('0x23')](_0x279211[_0x7d3a('0x35')][_0x7d3a('0x23')]);}return _0x35e510['getItems'](_0x5d178d);}})[_0x7d3a('0x28')](function(_0x512006){if(_0x512006){return _0x512006?{'count':_0x1641c2,'rows':_0x512006}:null;}})['then'](respondWithResult(_0x37f320,null))[_0x7d3a('0x4b')](handleError(_0x37f320,null));}; \ No newline at end of file +var _0x0305=['sendStatus','status','offset','limit','set','Content-Range','reject','update','then','destroy','get','CustomDashboards','UserProfileResource','end','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','count','includeAll','include','findAll','catch','show','params','filters','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','https://','custom','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','stringify','DashboardId','getItems','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./dashboard.socket','register'];(function(_0x59145a,_0x1f60f1){var _0xf04d7=function(_0x247581){while(--_0x247581){_0x59145a['push'](_0x59145a['shift']());}};_0xf04d7(++_0x1f60f1);}(_0x0305,0x138));var _0x5030=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0x0305[_0x5f46e7];return _0x567e95;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5030('0x0'));var rimraf=require(_0x5030('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5030('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5030('0x3'));var Mustache=require(_0x5030('0x4'));var util=require(_0x5030('0x5'));var path=require(_0x5030('0x6'));var sox=require(_0x5030('0x7'));var csv=require(_0x5030('0x8'));var ejs=require(_0x5030('0x9'));var fs=require('fs');var _=require(_0x5030('0xa'));var squel=require(_0x5030('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5030('0x8'));var querystring=require(_0x5030('0xc'));var Papa=require(_0x5030('0xd'));var Redis=require(_0x5030('0xe'));var authService=require(_0x5030('0xf'));var qs=require(_0x5030('0x10'));var as=require(_0x5030('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5030('0x12'))(_0x5030('0x13'));var utils=require('../../config/utils');var config=require(_0x5030('0x14'));var db=require(_0x5030('0x15'))['db'];config['redis']=_[_0x5030('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5030('0x17'))(new Redis(config[_0x5030('0x18')]));require(_0x5030('0x19'))[_0x5030('0x1a')](socket);function respondWithStatusCode(_0x36316f,_0x2b3c85){_0x2b3c85=_0x2b3c85||0xcc;return function(_0x2692ef){if(_0x2692ef){return _0x36316f[_0x5030('0x1b')](_0x2b3c85);}return _0x36316f['status'](_0x2b3c85)['end']();};}function respondWithResult(_0x57646e,_0x4b2f2e){_0x4b2f2e=_0x4b2f2e||0xc8;return function(_0x24e496){if(_0x24e496){return _0x57646e[_0x5030('0x1c')](_0x4b2f2e)['json'](_0x24e496);}};}function respondWithFilteredResult(_0x538ef1,_0x3f2d41){return function(_0x5b0ff4){if(_0x5b0ff4){var _0x5cfb37=_0x5b0ff4['count'],_0x45e7c1=_0x3f2d41[_0x5030('0x1d')],_0x496afb=_0x3f2d41[_0x5030('0x1d')]+_0x3f2d41[_0x5030('0x1e')],_0x56ed29;if(_0x496afb>=_0x5cfb37){_0x496afb=_0x5cfb37;_0x56ed29=0xc8;}else{_0x56ed29=0xce;}_0x538ef1[_0x5030('0x1c')](_0x56ed29);return _0x538ef1[_0x5030('0x1f')](_0x5030('0x20'),_0x45e7c1+'-'+_0x496afb+'/'+_0x5cfb37)['json'](_0x5b0ff4);}return null;};}function patchUpdates(_0x5c8c6c){return function(_0x597eaa){try{jsonpatch['apply'](_0x597eaa,_0x5c8c6c,!![]);}catch(_0xe133e8){return BPromise[_0x5030('0x21')](_0xe133e8);}return _0x597eaa['save']();};}function saveUpdates(_0x372de9,_0x18d00c){return function(_0x3bed8f){if(_0x3bed8f){return _0x3bed8f[_0x5030('0x22')](_0x372de9)[_0x5030('0x23')](function(_0x3413ed){return _0x3413ed;});}return null;};}function removeEntity(_0x468cb1,_0x56a70c){return function(_0x4f4cfd){if(_0x4f4cfd){return _0x4f4cfd[_0x5030('0x24')]()[_0x5030('0x23')](function(){var _0x8202d8=_0x4f4cfd[_0x5030('0x25')]({'plain':!![]});var _0x311ed7=_0x5030('0x26');return db[_0x5030('0x27')]['destroy']({'where':{'type':_0x311ed7,'resourceId':_0x8202d8['id']}})[_0x5030('0x23')](function(){return _0x4f4cfd;});})[_0x5030('0x23')](function(){_0x468cb1[_0x5030('0x1c')](0xcc)[_0x5030('0x28')]();});}};}function handleEntityNotFound(_0x3b2369,_0xd101b9){return function(_0x6d4bc9){if(!_0x6d4bc9){_0x3b2369[_0x5030('0x1b')](0x194);}return _0x6d4bc9;};}function handleError(_0x517f8b,_0x228f26){_0x228f26=_0x228f26||0x1f4;return function(_0x3c3ff2){logger[_0x5030('0x29')](_0x3c3ff2[_0x5030('0x2a')]);if(_0x3c3ff2['name']){delete _0x3c3ff2[_0x5030('0x2b')];}_0x517f8b[_0x5030('0x1c')](_0x228f26)[_0x5030('0x2c')](_0x3c3ff2);};}exports[_0x5030('0x2d')]=function(_0x38fcd4,_0x3b3dfb){var _0x12cc88={},_0x3cd9d9={},_0x27bffb={'count':0x0,'rows':[]};var _0x413c38=_[_0x5030('0x2e')](db[_0x5030('0x2f')][_0x5030('0x30')],function(_0x3c02f2){return{'name':_0x3c02f2[_0x5030('0x31')],'type':_0x3c02f2['type'][_0x5030('0x32')]};});_0x3cd9d9[_0x5030('0x33')]=_[_0x5030('0x2e')](_0x413c38,_0x5030('0x2b'));_0x3cd9d9[_0x5030('0x34')]=_[_0x5030('0x35')](_0x38fcd4[_0x5030('0x34')]);_0x3cd9d9['filters']=_['intersection'](_0x3cd9d9[_0x5030('0x33')],_0x3cd9d9[_0x5030('0x34')]);_0x12cc88[_0x5030('0x36')]=_[_0x5030('0x37')](_0x3cd9d9[_0x5030('0x33')],qs[_0x5030('0x38')](_0x38fcd4[_0x5030('0x34')][_0x5030('0x38')]));_0x12cc88[_0x5030('0x36')]=_0x12cc88[_0x5030('0x36')][_0x5030('0x39')]?_0x12cc88[_0x5030('0x36')]:_0x3cd9d9[_0x5030('0x33')];if(!_0x38fcd4[_0x5030('0x34')][_0x5030('0x3a')](_0x5030('0x3b'))){_0x12cc88[_0x5030('0x1e')]=qs[_0x5030('0x1e')](_0x38fcd4['query']['limit']);_0x12cc88[_0x5030('0x1d')]=qs['offset'](_0x38fcd4[_0x5030('0x34')][_0x5030('0x1d')]);}_0x12cc88[_0x5030('0x3c')]=qs[_0x5030('0x3d')](_0x38fcd4[_0x5030('0x34')][_0x5030('0x3d')]);_0x12cc88[_0x5030('0x3e')]=qs['filters'](_[_0x5030('0x3f')](_0x38fcd4[_0x5030('0x34')],_0x3cd9d9['filters']),_0x413c38);if(_0x38fcd4[_0x5030('0x34')][_0x5030('0x40')]){_0x12cc88[_0x5030('0x3e')]=_['merge'](_0x12cc88[_0x5030('0x3e')],{'$or':_[_0x5030('0x2e')](_0x413c38,function(_0x2d60d2){if(_0x2d60d2[_0x5030('0x41')]!=='VIRTUAL'){var _0x8f9511={};_0x8f9511[_0x2d60d2[_0x5030('0x2b')]]={'$like':'%'+_0x38fcd4[_0x5030('0x34')][_0x5030('0x40')]+'%'};return _0x8f9511;}})});}_0x12cc88=_[_0x5030('0x42')]({},_0x12cc88,_0x38fcd4['options']);var _0x397847={'where':_0x12cc88[_0x5030('0x3e')]};return db[_0x5030('0x2f')]['count'](_0x397847)[_0x5030('0x23')](function(_0x24295c){_0x27bffb[_0x5030('0x43')]=_0x24295c;if(_0x38fcd4[_0x5030('0x34')][_0x5030('0x44')]){_0x12cc88[_0x5030('0x45')]=[{'all':!![]}];}return db[_0x5030('0x2f')][_0x5030('0x46')](_0x12cc88);})[_0x5030('0x23')](function(_0x2ba0fa){_0x27bffb['rows']=_0x2ba0fa;return _0x27bffb;})['then'](respondWithFilteredResult(_0x3b3dfb,_0x12cc88))[_0x5030('0x47')](handleError(_0x3b3dfb,null));};exports[_0x5030('0x48')]=function(_0x341052,_0x298ee6){var _0x262697={'raw':![],'where':{'id':_0x341052[_0x5030('0x49')]['id']}},_0x5916a9={};_0x5916a9[_0x5030('0x33')]=_['keys'](db[_0x5030('0x2f')][_0x5030('0x30')]);_0x5916a9[_0x5030('0x34')]=_[_0x5030('0x35')](_0x341052[_0x5030('0x34')]);_0x5916a9[_0x5030('0x4a')]=_[_0x5030('0x37')](_0x5916a9['model'],_0x5916a9[_0x5030('0x34')]);_0x262697['attributes']=_[_0x5030('0x37')](_0x5916a9[_0x5030('0x33')],qs['fields'](_0x341052['query'][_0x5030('0x38')]));_0x262697['attributes']=_0x262697[_0x5030('0x36')][_0x5030('0x39')]?_0x262697[_0x5030('0x36')]:_0x5916a9['model'];if(_0x341052[_0x5030('0x34')]['includeAll']){_0x262697[_0x5030('0x45')]=[{'all':!![]}];}_0x262697=_[_0x5030('0x42')]({},_0x262697,_0x341052[_0x5030('0x4b')]);return db[_0x5030('0x2f')][_0x5030('0x4c')](_0x262697)[_0x5030('0x23')](handleEntityNotFound(_0x298ee6,null))[_0x5030('0x23')](respondWithResult(_0x298ee6,null))[_0x5030('0x47')](handleError(_0x298ee6,null));};exports['create']=function(_0x3cc5f5,_0x374079){return db[_0x5030('0x2f')][_0x5030('0x4d')](_0x3cc5f5['body'],{})['then'](function(_0x42460e){var _0x5a4f7b=_0x3cc5f5[_0x5030('0x4e')][_0x5030('0x25')]({'plain':!![]});if(!_0x5a4f7b)throw new Error(_0x5030('0x4f'));if(_0x5a4f7b[_0x5030('0x50')]===_0x5030('0x4e')){var _0x1581fc=_0x42460e[_0x5030('0x25')]({'plain':!![]});var _0x939025=_0x5030('0x26');return db[_0x5030('0x51')][_0x5030('0x4c')]({'where':{'name':_0x939025,'userProfileId':_0x5a4f7b[_0x5030('0x52')]},'raw':!![]})[_0x5030('0x23')](function(_0x878c07){if(_0x878c07&&_0x878c07[_0x5030('0x53')]===0x0){return db['UserProfileResource'][_0x5030('0x4d')]({'name':_0x1581fc['name'],'resourceId':_0x1581fc['id'],'type':_0x878c07[_0x5030('0x2b')],'sectionId':_0x878c07['id']},{})[_0x5030('0x23')](function(){return _0x42460e;});}else{return _0x42460e;}})[_0x5030('0x47')](function(_0x5b04c4){logger[_0x5030('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b04c4);throw _0x5b04c4;});}return _0x42460e;})['then'](respondWithResult(_0x374079,0xc9))[_0x5030('0x47')](handleError(_0x374079,null));};exports[_0x5030('0x54')]=function(_0x3baf6c,_0x4e3ef0){var _0x5aec5d={'where':{'id':_0x3baf6c[_0x5030('0x49')]['id']}},_0x8bec0f={};_0x8bec0f[_0x5030('0x33')]=_['keys'](db[_0x5030('0x2f')][_0x5030('0x30')]);_0x5aec5d[_0x5030('0x36')]=_[_0x5030('0x37')](_0x8bec0f[_0x5030('0x33')],qs['fields'](_0x3baf6c[_0x5030('0x34')][_0x5030('0x38')]));_0x5aec5d[_0x5030('0x36')]=_0x5aec5d['attributes'][_0x5030('0x39')]?_0x5aec5d['attributes']:_0x8bec0f['model'];if(_0x3baf6c[_0x5030('0x34')][_0x5030('0x44')]){_0x5aec5d[_0x5030('0x45')]=[{'all':!![]}];}_0x5aec5d=_[_0x5030('0x42')]({},_0x5aec5d,_0x3baf6c['options']);return db['Dashboard'][_0x5030('0x4c')](_0x5aec5d)[_0x5030('0x23')](handleEntityNotFound(_0x4e3ef0,null))[_0x5030('0x23')](function(_0x4d1f03){if(_0x4d1f03){var _0xea49a7=_0x4d1f03[_0x5030('0x25')]({'plain':!![]});_0xea49a7=qs[_0x5030('0x55')](_0xea49a7,['id',_0x5030('0x56'),_0x5030('0x57')]);_0x3baf6c[_0x5030('0x58')]=_[_0x5030('0x55')](_0x3baf6c[_0x5030('0x58')],['id',_0x5030('0x56'),_0x5030('0x57')]);return db[_0x5030('0x2f')][_0x5030('0x4d')](_[_0x5030('0x42')](_0xea49a7,_0x3baf6c['body']),{'include':_0x3baf6c['query'][_0x5030('0x44')]?[{'all':!![]}]:undefined})[_0x5030('0x23')](function(_0x308351){var _0x1820b7=_0x3baf6c[_0x5030('0x4e')][_0x5030('0x25')]({'plain':!![]});if(!_0x1820b7)throw new Error(_0x5030('0x4f'));if(_0x1820b7[_0x5030('0x50')]===_0x5030('0x4e')){var _0x3bdb3b=_0x308351['get']({'plain':!![]});var _0x5ed811='CustomDashboards';return db['UserProfileSection'][_0x5030('0x4c')]({'where':{'name':_0x5ed811,'userProfileId':_0x1820b7['userProfileId']},'raw':!![]})['then'](function(_0x56d453){if(_0x56d453&&_0x56d453[_0x5030('0x53')]===0x0){return db[_0x5030('0x27')][_0x5030('0x4d')]({'name':_0x3bdb3b[_0x5030('0x2b')],'resourceId':_0x3bdb3b['id'],'type':_0x56d453[_0x5030('0x2b')],'sectionId':_0x56d453['id']},{})[_0x5030('0x23')](function(){return _0x308351;});}else{return _0x308351;}})[_0x5030('0x47')](function(_0x22f8ba){logger[_0x5030('0x29')](_0x5030('0x59'),_0x22f8ba);throw _0x22f8ba;});}return _0x308351;});}})[_0x5030('0x23')](respondWithResult(_0x4e3ef0,0xc9))[_0x5030('0x47')](handleError(_0x4e3ef0,null));};exports[_0x5030('0x22')]=function(_0x1d7ec2,_0x44e5d6){if(_0x1d7ec2[_0x5030('0x58')]['id']){delete _0x1d7ec2[_0x5030('0x58')]['id'];}return db['Dashboard'][_0x5030('0x4c')]({'where':{'id':_0x1d7ec2[_0x5030('0x49')]['id']}})[_0x5030('0x23')](handleEntityNotFound(_0x44e5d6,null))[_0x5030('0x23')](saveUpdates(_0x1d7ec2[_0x5030('0x58')],null))[_0x5030('0x23')](respondWithResult(_0x44e5d6,null))['catch'](handleError(_0x44e5d6,null));};exports[_0x5030('0x24')]=function(_0x46a540,_0x480866){return db[_0x5030('0x2f')]['find']({'where':{'id':_0x46a540[_0x5030('0x49')]['id']}})[_0x5030('0x23')](handleEntityNotFound(_0x480866,null))[_0x5030('0x23')](removeEntity(_0x480866,null))[_0x5030('0x47')](handleError(_0x480866,null));};function widgetAttributes(_0x4bcdc3){try{switch(_0x4bcdc3[_0x5030('0x41')]){case'iframe':return[{'name':'attrUrl','value':_0x4bcdc3[_0x5030('0x5a')]||(_0x4bcdc3['attrs']&&_0x4bcdc3[_0x5030('0x5b')][0x0]?_0x4bcdc3['attrs'][0x0][_0x5030('0x5c')]:undefined)||_0x5030('0x5d')}];case _0x5030('0x5e'):return[{'name':'attrPath','value':_0x4bcdc3['attrPath']||(_0x4bcdc3[_0x5030('0x5b')]&&_0x4bcdc3[_0x5030('0x5b')][0x0]?_0x4bcdc3[_0x5030('0x5b')][0x0][_0x5030('0x5c')]:undefined)||''}];case _0x5030('0x5f'):return[{'name':_0x5030('0x60'),'value':_0x4bcdc3['attrHourFormat']||(_0x4bcdc3['attrs']&&_0x4bcdc3[_0x5030('0x5b')][0x0]?_0x4bcdc3[_0x5030('0x5b')][0x0][_0x5030('0x5c')]:undefined)||'HH:mm:ss'},{'name':_0x5030('0x61'),'value':_0x4bcdc3[_0x5030('0x61')]||(_0x4bcdc3[_0x5030('0x5b')]&&_0x4bcdc3[_0x5030('0x5b')][0x1]?_0x4bcdc3['attrs'][0x1]['value']:undefined)||'0.00'},{'name':_0x5030('0x62'),'value':_0x4bcdc3['attrFontSize']||(_0x4bcdc3[_0x5030('0x5b')]&&_0x4bcdc3['attrs'][0x2]?_0x4bcdc3[_0x5030('0x5b')][0x2][_0x5030('0x5c')]:undefined)||0xc}];case _0x5030('0x63'):return[{'name':_0x5030('0x64'),'value':_0x4bcdc3['attrMetric']||(_0x4bcdc3['attrs']&&_0x4bcdc3[_0x5030('0x5b')][0x0]?_0x4bcdc3[_0x5030('0x5b')][0x0][_0x5030('0x5c')]:undefined)||_0x5030('0x65')},{'name':_0x5030('0x66'),'value':_0x4bcdc3['attrVoiceQueues']||(_0x4bcdc3[_0x5030('0x5b')]&&_0x4bcdc3[_0x5030('0x5b')][0x1]?_0x4bcdc3[_0x5030('0x5b')][0x1][_0x5030('0x5c')]:undefined)||[]},{'name':_0x5030('0x62'),'value':_0x4bcdc3[_0x5030('0x62')]||(_0x4bcdc3[_0x5030('0x5b')]&&_0x4bcdc3[_0x5030('0x5b')][0x2]?_0x4bcdc3[_0x5030('0x5b')][0x2][_0x5030('0x5c')]:undefined)||0x14}];case _0x5030('0x67'):case'pie-chart':return[{'name':_0x5030('0x68'),'value':_0x4bcdc3['attrSerie1']||(_0x4bcdc3['attrs']&&_0x4bcdc3[_0x5030('0x5b')][0x0]?_0x4bcdc3[_0x5030('0x5b')][0x0][_0x5030('0x5c')]:undefined)||_0x5030('0x65')},{'name':_0x5030('0x69'),'value':_0x4bcdc3[_0x5030('0x69')]||(_0x4bcdc3[_0x5030('0x5b')]&&_0x4bcdc3[_0x5030('0x5b')][0x1]?_0x4bcdc3[_0x5030('0x5b')][0x1][_0x5030('0x5c')]:undefined)||null},{'name':_0x5030('0x6a'),'value':_0x4bcdc3[_0x5030('0x6a')]||(_0x4bcdc3['attrs']&&_0x4bcdc3[_0x5030('0x5b')][0x2]?_0x4bcdc3[_0x5030('0x5b')][0x2][_0x5030('0x5c')]:undefined)||null},{'name':_0x5030('0x66'),'value':_0x4bcdc3[_0x5030('0x66')]||(_0x4bcdc3[_0x5030('0x5b')]&&_0x4bcdc3[_0x5030('0x5b')][0x3]?_0x4bcdc3['attrs'][0x3]['value']:undefined)||[]}];case _0x5030('0x6b'):return[{'name':_0x5030('0x6c'),'type':_0x4bcdc3['reportType']||(_0x4bcdc3[_0x5030('0x5b')]&&_0x4bcdc3[_0x5030('0x5b')][0x0]?_0x4bcdc3[_0x5030('0x5b')][0x0][_0x5030('0x41')]:undefined)||null,'value':_0x4bcdc3[_0x5030('0x6c')]||(_0x4bcdc3[_0x5030('0x5b')]&&_0x4bcdc3['attrs'][0x0]?_0x4bcdc3['attrs'][0x0][_0x5030('0x5c')]:undefined)||null},{'name':_0x5030('0x6d'),'value':_0x4bcdc3[_0x5030('0x6d')]||(_0x4bcdc3[_0x5030('0x5b')]&&_0x4bcdc3['attrs'][0x1]?_0x4bcdc3[_0x5030('0x5b')][0x1][_0x5030('0x5c')]:undefined)||0x0}];default:return[];}}catch(_0x4266e8){logger[_0x5030('0x29')]('widgetAttributes:\x20%s',JSON[_0x5030('0x6e')](_0x4266e8));return[];}}exports['addItem']=function(_0x4391fa,_0x3fa3f4,_0x4d3335){if(_0x4391fa[_0x5030('0x58')]['id']){delete _0x4391fa[_0x5030('0x58')]['id'];}return db[_0x5030('0x2f')][_0x5030('0x4c')]({'where':{'id':_0x4391fa[_0x5030('0x49')]['id']}})[_0x5030('0x23')](handleEntityNotFound(_0x3fa3f4,null))[_0x5030('0x23')](function(_0x3d0913){if(_0x3d0913){_0x4391fa[_0x5030('0x58')][_0x5030('0x6f')]=_0x3d0913['id'];_0x4391fa['body'][_0x5030('0x5b')]=widgetAttributes(_0x4391fa[_0x5030('0x58')]);return db['DashboardItem']['create'](_0x4391fa[_0x5030('0x58')]);}})[_0x5030('0x23')](respondWithResult(_0x3fa3f4,null))[_0x5030('0x47')](handleError(_0x3fa3f4,null));};exports[_0x5030('0x70')]=function(_0x3e704a,_0x56aff3,_0x2b172d){var _0x107463={};var _0xe4a84f={};var _0x34eb01;var _0x584502;return db[_0x5030('0x2f')]['findOne']({'where':{'id':_0x3e704a[_0x5030('0x49')]['id']}})[_0x5030('0x23')](handleEntityNotFound(_0x56aff3,null))['then'](function(_0x371cc8){if(_0x371cc8){_0x34eb01=_0x371cc8;_0xe4a84f['model']=_[_0x5030('0x35')](db['DashboardItem'][_0x5030('0x30')]);_0xe4a84f[_0x5030('0x34')]=_[_0x5030('0x35')](_0x3e704a['query']);_0xe4a84f[_0x5030('0x4a')]=_['intersection'](_0xe4a84f[_0x5030('0x33')],_0xe4a84f[_0x5030('0x34')]);_0x107463[_0x5030('0x36')]=_[_0x5030('0x37')](_0xe4a84f['model'],qs[_0x5030('0x38')](_0x3e704a[_0x5030('0x34')][_0x5030('0x38')]));_0x107463[_0x5030('0x36')]=_0x107463[_0x5030('0x36')]['length']?_0x107463[_0x5030('0x36')]:_0xe4a84f['model'];_0x107463['order']=qs[_0x5030('0x3d')](_0x3e704a[_0x5030('0x34')]['sort']);_0x107463[_0x5030('0x3e')]=qs['filters'](_[_0x5030('0x3f')](_0x3e704a[_0x5030('0x34')],_0xe4a84f[_0x5030('0x4a')]));if(_0x3e704a[_0x5030('0x34')][_0x5030('0x40')]){_0x107463[_0x5030('0x3e')]=_[_0x5030('0x42')](_0x107463['where'],{'$or':_[_0x5030('0x2e')](_0x107463['attributes'],function(_0x5c5b3c){var _0x421449={};_0x421449[_0x5c5b3c]={'$like':'%'+_0x3e704a[_0x5030('0x34')]['filter']+'%'};return _0x421449;})});}_0x107463=_[_0x5030('0x42')]({},_0x107463,_0x3e704a[_0x5030('0x4b')]);return _0x34eb01['getItems'](_0x107463);}})[_0x5030('0x23')](function(_0x1edd82){if(_0x1edd82){_0x584502=_0x1edd82['length'];if(!_0x3e704a['query'][_0x5030('0x3a')](_0x5030('0x3b'))){_0x107463[_0x5030('0x1e')]=qs[_0x5030('0x1e')](_0x3e704a[_0x5030('0x34')][_0x5030('0x1e')]);_0x107463[_0x5030('0x1d')]=qs['offset'](_0x3e704a[_0x5030('0x34')][_0x5030('0x1d')]);}return _0x34eb01[_0x5030('0x70')](_0x107463);}})['then'](function(_0x5965a9){if(_0x5965a9){return _0x5965a9?{'count':_0x584502,'rows':_0x5965a9}:null;}})['then'](respondWithResult(_0x56aff3,null))[_0x5030('0x47')](handleError(_0x56aff3,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 9ac18ad..39660c0 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 _0xef77=['emit','hasOwnProperty','hook','../../mysqldb','Dashboard','setMaxListeners','save','remove'];(function(_0x49e216,_0x4d2a44){var _0x4a0c56=function(_0xd4feb3){while(--_0xd4feb3){_0x49e216['push'](_0x49e216['shift']());}};_0x4a0c56(++_0x4d2a44);}(_0xef77,0xd3));var _0x7ef7=function(_0x2f4090,_0x374f7b){_0x2f4090=_0x2f4090-0x0;var _0x593d48=_0xef77[_0x2f4090];return _0x593d48;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x7ef7('0x0'))['db'][_0x7ef7('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7ef7('0x2')](0x0);var events={'afterCreate':_0x7ef7('0x3'),'afterUpdate':'update','afterDestroy':_0x7ef7('0x4')};function emitEvent(_0x300e2c){return function(_0x5ced9d,_0xe47254,_0x44bca7){DashboardEvents[_0x7ef7('0x5')](_0x300e2c+':'+_0x5ced9d['id'],_0x5ced9d);DashboardEvents['emit'](_0x300e2c,_0x5ced9d);_0x44bca7(null);};}for(var e in events){if(events[_0x7ef7('0x6')](e)){var event=events[e];Dashboard[_0x7ef7('0x7')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0x1b0b=['remove','emit','exports','events','Dashboard','setMaxListeners','save'];(function(_0x87e0dc,_0x577dce){var _0x2cd2d1=function(_0x2d8173){while(--_0x2d8173){_0x87e0dc['push'](_0x87e0dc['shift']());}};_0x2cd2d1(++_0x577dce);}(_0x1b0b,0x1b5));var _0xb1b0=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x1b0b[_0x82129b];return _0x2ae5dc;};'use strict';var EventEmitter=require(_0xb1b0('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xb1b0('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xb1b0('0x2')](0x0);var events={'afterCreate':_0xb1b0('0x3'),'afterUpdate':'update','afterDestroy':_0xb1b0('0x4')};function emitEvent(_0x27208e){return function(_0xd85c6e,_0x390d67,_0x2c2140){DashboardEvents[_0xb1b0('0x5')](_0x27208e+':'+_0xd85c6e['id'],_0xd85c6e);DashboardEvents['emit'](_0x27208e,_0xd85c6e);_0x2c2140(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xb1b0('0x6')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 543c7b0..0a34c14 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 _0x703c=['util','api','bluebird','rimraf','../../config/environment','define','Dashboard'];(function(_0x134d5e,_0x2a47d8){var _0x1e166a=function(_0x53f10d){while(--_0x53f10d){_0x134d5e['push'](_0x134d5e['shift']());}};_0x1e166a(++_0x2a47d8);}(_0x703c,0xbd));var _0xc703=function(_0x24880b,_0x592571){_0x24880b=_0x24880b-0x0;var _0x365441=_0x703c[_0x24880b];return _0x365441;};'use strict';var _=require('lodash');var util=require(_0xc703('0x0'));var logger=require('../../config/logger')(_0xc703('0x1'));var moment=require('moment');var BPromise=require(_0xc703('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc703('0x3'));var config=require(_0xc703('0x4'));var attributes=require('./dashboard.attributes');module['exports']=function(_0x2699b8,_0x9c6481){return _0x2699b8[_0xc703('0x5')](_0xc703('0x6'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5a3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','Dashboard','dashboards','lodash','util','api'];(function(_0x58f21c,_0x1c77bb){var _0xf47fea=function(_0x22b034){while(--_0x22b034){_0x58f21c['push'](_0x58f21c['shift']());}};_0xf47fea(++_0x1c77bb);}(_0xb5a3,0x159));var _0x3b5a=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0xb5a3[_0x26b622];return _0x58a028;};'use strict';var _=require(_0x3b5a('0x0'));var util=require(_0x3b5a('0x1'));var logger=require('../../config/logger')(_0x3b5a('0x2'));var moment=require(_0x3b5a('0x3'));var BPromise=require(_0x3b5a('0x4'));var rp=require(_0x3b5a('0x5'));var fs=require('fs');var path=require(_0x3b5a('0x6'));var rimraf=require(_0x3b5a('0x7'));var config=require(_0x3b5a('0x8'));var attributes=require(_0x3b5a('0x9'));module['exports']=function(_0x28cc0a,_0x151122){return _0x28cc0a['define'](_0x3b5a('0xa'),attributes,{'tableName':_0x3b5a('0xb'),'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 552830e..a59ba42 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 _0xa1c6=['request','then','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','socket.io-emitter'];(function(_0x513545,_0x158f2e){var _0x18b7c5=function(_0x58514c){while(--_0x58514c){_0x513545['push'](_0x513545['shift']());}};_0x18b7c5(++_0x158f2e);}(_0xa1c6,0x96));var _0x6a1c=function(_0x103ff8,_0x1fe270){_0x103ff8=_0x103ff8-0x0;var _0x442c96=_0xa1c6[_0x103ff8];return _0x442c96;};'use strict';var _=require(_0x6a1c('0x0'));var util=require('util');var moment=require(_0x6a1c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a1c('0x2'))['db'];var utils=require(_0x6a1c('0x3'));var logger=require(_0x6a1c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6a1c('0x5'));var client=jayson[_0x6a1c('0x6')]['http']({'port':0x232a});config[_0x6a1c('0x7')]=_[_0x6a1c('0x8')](config[_0x6a1c('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x6a1c('0x9'))(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x4961b0,_0x26117d,_0x2ef2c2){return new BPromise(function(_0x2c7e08,_0x3aa3cd){return client[_0x6a1c('0xa')](_0x4961b0,_0x2ef2c2)[_0x6a1c('0xb')](function(_0x4fd4a5){logger['info'](_0x6a1c('0xc'),_0x26117d,'request\x20sent');logger['debug'](_0x6a1c('0xd'),_0x26117d,_0x6a1c('0xe'),JSON['stringify'](_0x4fd4a5));if(_0x4fd4a5[_0x6a1c('0xf')]){if(_0x4fd4a5['error'][_0x6a1c('0x10')]===0x1f4){logger['error'](_0x6a1c('0xc'),_0x26117d,_0x4fd4a5[_0x6a1c('0xf')][_0x6a1c('0x11')]);return _0x3aa3cd(_0x4fd4a5[_0x6a1c('0xf')][_0x6a1c('0x11')]);}logger[_0x6a1c('0xf')](_0x6a1c('0xc'),_0x26117d,_0x4fd4a5[_0x6a1c('0xf')][_0x6a1c('0x11')]);return _0x2c7e08(_0x4fd4a5[_0x6a1c('0xf')][_0x6a1c('0x11')]);}else{logger['info'](_0x6a1c('0xc'),_0x26117d,'request\x20sent');_0x2c7e08(_0x4fd4a5[_0x6a1c('0x12')][_0x6a1c('0x11')]);}})[_0x6a1c('0x13')](function(_0x5c2df0){logger[_0x6a1c('0xf')](_0x6a1c('0xc'),_0x26117d,_0x5c2df0);_0x3aa3cd(_0x5c2df0);});});} \ No newline at end of file +var _0x41a2=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./dashboard.socket','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch'];(function(_0x55b42d,_0x350a56){var _0x4062ac=function(_0x459881){while(--_0x459881){_0x55b42d['push'](_0x55b42d['shift']());}};_0x4062ac(++_0x350a56);}(_0x41a2,0x160));var _0x241a=function(_0x1090f8,_0xd83a11){_0x1090f8=_0x1090f8-0x0;var _0x180524=_0x41a2[_0x1090f8];return _0x180524;};'use strict';var _=require(_0x241a('0x0'));var util=require(_0x241a('0x1'));var moment=require(_0x241a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x241a('0x3'));var db=require(_0x241a('0x4'))['db'];var utils=require(_0x241a('0x5'));var logger=require(_0x241a('0x6'))('rpc');var config=require(_0x241a('0x7'));var jayson=require(_0x241a('0x8'));var client=jayson[_0x241a('0x9')][_0x241a('0xa')]({'port':0x232a});config[_0x241a('0xb')]=_['defaults'](config[_0x241a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x241a('0xb')]));require(_0x241a('0xc'))['register'](socket);function respondWithRpcPromise(_0x35a05a,_0x2674b7,_0x1d6141){return new BPromise(function(_0x3ce147,_0x342a90){return client[_0x241a('0xd')](_0x35a05a,_0x1d6141)['then'](function(_0x1d5f1d){logger[_0x241a('0xe')](_0x241a('0xf'),_0x2674b7,_0x241a('0x10'));logger[_0x241a('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x2674b7,_0x241a('0x10'),JSON['stringify'](_0x1d5f1d));if(_0x1d5f1d[_0x241a('0x12')]){if(_0x1d5f1d['error'][_0x241a('0x13')]===0x1f4){logger[_0x241a('0x12')](_0x241a('0xf'),_0x2674b7,_0x1d5f1d['error'][_0x241a('0x14')]);return _0x342a90(_0x1d5f1d[_0x241a('0x12')][_0x241a('0x14')]);}logger[_0x241a('0x12')](_0x241a('0xf'),_0x2674b7,_0x1d5f1d[_0x241a('0x12')][_0x241a('0x14')]);return _0x3ce147(_0x1d5f1d[_0x241a('0x12')][_0x241a('0x14')]);}else{logger[_0x241a('0xe')](_0x241a('0xf'),_0x2674b7,_0x241a('0x10'));_0x3ce147(_0x1d5f1d['result'][_0x241a('0x14')]);}})[_0x241a('0x15')](function(_0x4b825f){logger[_0x241a('0x12')](_0x241a('0xf'),_0x2674b7,_0x4b825f);_0x342a90(_0x4b825f);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 73d016c..6807674 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 _0x7a7f=['removeListener','register','dashboard:','./dashboard.events','save','remove','update'];(function(_0x4d96ae,_0x3cdc6b){var _0x4411c7=function(_0x51abfc){while(--_0x51abfc){_0x4d96ae['push'](_0x4d96ae['shift']());}};_0x4411c7(++_0x3cdc6b);}(_0x7a7f,0x199));var _0xf7a7=function(_0x12fb71,_0x456f22){_0x12fb71=_0x12fb71-0x0;var _0x56eeec=_0x7a7f[_0x12fb71];return _0x56eeec;};'use strict';var DashboardEvents=require(_0xf7a7('0x0'));var events=[_0xf7a7('0x1'),_0xf7a7('0x2'),_0xf7a7('0x3')];function createListener(_0x8170cb,_0x102c86){return function(_0x1ab4e5){_0x102c86['emit'](_0x8170cb,_0x1ab4e5);};}function removeListener(_0x41a4ec,_0x32d6bc){return function(){DashboardEvents[_0xf7a7('0x4')](_0x41a4ec,_0x32d6bc);};}exports[_0xf7a7('0x5')]=function(_0x478878){for(var _0x4021b2=0x0,_0x4eedf9=events['length'];_0x4021b2<_0x4eedf9;_0x4021b2++){var _0x41582f=events[_0x4021b2];var _0x4a6b58=createListener(_0xf7a7('0x6')+_0x41582f,_0x478878);DashboardEvents['on'](_0x41582f,_0x4a6b58);}}; \ No newline at end of file +var _0xb1a6=['remove','update','emit','removeListener','register','./dashboard.events','save'];(function(_0x4f7c6c,_0x12b456){var _0x503d72=function(_0x3729fd){while(--_0x3729fd){_0x4f7c6c['push'](_0x4f7c6c['shift']());}};_0x503d72(++_0x12b456);}(_0xb1a6,0x140));var _0x6b1a=function(_0x2dd19d,_0x4d02b1){_0x2dd19d=_0x2dd19d-0x0;var _0x429ecb=_0xb1a6[_0x2dd19d];return _0x429ecb;};'use strict';var DashboardEvents=require(_0x6b1a('0x0'));var events=[_0x6b1a('0x1'),_0x6b1a('0x2'),_0x6b1a('0x3')];function createListener(_0x3dd0ac,_0x518b3b){return function(_0x156dd2){_0x518b3b[_0x6b1a('0x4')](_0x3dd0ac,_0x156dd2);};}function removeListener(_0x5d077c,_0x1175ca){return function(){DashboardEvents[_0x6b1a('0x5')](_0x5d077c,_0x1175ca);};}exports[_0x6b1a('0x6')]=function(_0x2fe3dd){for(var _0x390301=0x0,_0x3f3b3e=events['length'];_0x390301<_0x3f3b3e;_0x390301++){var _0x515d5a=events[_0x390301];var _0x4cc5da=createListener('dashboard:'+_0x515d5a,_0x2fe3dd);DashboardEvents['on'](_0x515d5a,_0x4cc5da);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 79f9ef4..b5b18a7 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 _0xe706=['../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','multer','util','path','express','Router'];(function(_0x54a2e4,_0x1ff92c){var _0x4742d0=function(_0x147a6f){while(--_0x147a6f){_0x54a2e4['push'](_0x54a2e4['shift']());}};_0x4742d0(++_0x1ff92c);}(_0xe706,0xa3));var _0x6e70=function(_0x442214,_0x3a869f){_0x442214=_0x442214-0x0;var _0x2bddf9=_0xe706[_0x442214];return _0x2bddf9;};'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 auth=require(_0x6e70('0x5'));var interaction=require(_0x6e70('0x6'));var config=require(_0x6e70('0x7'));var controller=require(_0x6e70('0x8'));router[_0x6e70('0x9')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0xb')]);router[_0x6e70('0x9')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xd')]);router[_0x6e70('0x9')](_0x6e70('0xe'),auth[_0x6e70('0xa')](),controller[_0x6e70('0xf')]);router[_0x6e70('0x10')]('/',auth[_0x6e70('0xa')](),controller[_0x6e70('0x11')]);router[_0x6e70('0x10')](_0x6e70('0x12'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x13')]);router['post']('/:id/items',auth[_0x6e70('0xa')](),controller[_0x6e70('0x14')]);router[_0x6e70('0x15')](_0x6e70('0xc'),auth[_0x6e70('0xa')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','addItem','put','update'];(function(_0x5a18d8,_0x556755){var _0x3c0586=function(_0x3f81f4){while(--_0x3f81f4){_0x5a18d8['push'](_0x5a18d8['shift']());}};_0x3c0586(++_0x556755);}(_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 auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['post']('/',auth[_0x3071('0x8')](),controller[_0x3071('0xe')]);router[_0x3071('0xf')](_0x3071('0x10'),auth[_0x3071('0x8')](),controller['clone']);router[_0x3071('0xf')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0x11')]);router[_0x3071('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['delete'](_0x3071('0xa'),auth[_0x3071('0x8')](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 4a269e8..2bc87db 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 _0xff34=['STRING','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','lodash'];(function(_0x2ea7b0,_0x1ebda1){var _0x50a40d=function(_0x3ed35d){while(--_0x3ed35d){_0x2ea7b0['push'](_0x2ea7b0['shift']());}};_0x50a40d(++_0x1ebda1);}(_0xff34,0x1ad));var _0x4ff3=function(_0x4e11e7,_0x42d0b6){_0x4e11e7=_0x4e11e7-0x0;var _0x1d7d39=_0xff34[_0x4e11e7];return _0x1d7d39;};'use strict';var Sequelize=require('sequelize');var squel=require('squel');var _=require(_0x4ff3('0x0'));module['exports']={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4ff3('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON[_0x4ff3('0x2')](this[_0x4ff3('0x3')](_0x4ff3('0x4')));}catch(_0x2d2c7a){return[];}},'set':function(_0x1733a2){try{this[_0x4ff3('0x5')](_0x4ff3('0x4'),JSON[_0x4ff3('0x6')](_0x1733a2));}catch(_0xc2d499){this['setDataValue'](_0x4ff3('0x4'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x4ff3('0x7')]},'col':{'type':Sequelize[_0x4ff3('0x7')]},'background':{'type':Sequelize[_0x4ff3('0x1')],'allowNull':![],'defaultValue':_0x4ff3('0x8'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4ff3('0x9'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x4ff3('0x1')]}}; \ No newline at end of file +var _0x0327=['lodash','exports','STRING','TEXT','long','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','squel'];(function(_0x621bee,_0x58f8c0){var _0x3076c8=function(_0x228229){while(--_0x228229){_0x621bee['push'](_0x621bee['shift']());}};_0x3076c8(++_0x58f8c0);}(_0x0327,0x137));var _0x7032=function(_0x49fe7f,_0x5349c1){_0x49fe7f=_0x49fe7f-0x0;var _0x1b5ce1=_0x0327[_0x49fe7f];return _0x1b5ce1;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x7032('0x0'));var _=require(_0x7032('0x1'));module[_0x7032('0x2')]={'title':{'type':Sequelize[_0x7032('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x7032('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7032('0x4')](_0x7032('0x5')),'get':function(){try{return JSON['parse'](this[_0x7032('0x6')](_0x7032('0x7')));}catch(_0x15ada9){return[];}},'set':function(_0x21f868){try{this[_0x7032('0x8')](_0x7032('0x7'),JSON['stringify'](_0x21f868));}catch(_0xf92f36){this['setDataValue']('attrs',JSON[_0x7032('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7032('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x7032('0xa')]},'col':{'type':Sequelize[_0x7032('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7032('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7032('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7032('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 54a11e3..947d925 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 _0x8af5=['filters','intersection','attributes','fields','length','include','merge','options','find','catch','params','type','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','limit','set','reject','save','then','destroy','error','stack','name','send','model','keys','DashboardItem','query'];(function(_0x1ac2e8,_0x3c12b8){var _0x3fe9b9=function(_0x46eeb8){while(--_0x46eeb8){_0x1ac2e8['push'](_0x1ac2e8['shift']());}};_0x3fe9b9(++_0x3c12b8);}(_0x8af5,0x17c));var _0x58af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8af5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x58af('0x0'));var zipdir=require(_0x58af('0x1'));var jsonpatch=require(_0x58af('0x2'));var rp=require('request-promise');var moment=require(_0x58af('0x3'));var BPromise=require(_0x58af('0x4'));var Mustache=require(_0x58af('0x5'));var util=require('util');var path=require('path');var sox=require(_0x58af('0x6'));var csv=require(_0x58af('0x7'));var ejs=require(_0x58af('0x8'));var fs=require('fs');var _=require(_0x58af('0x9'));var squel=require(_0x58af('0xa'));var crypto=require(_0x58af('0xb'));var jsforce=require(_0x58af('0xc'));var deskjs=require(_0x58af('0xd'));var toCsv=require(_0x58af('0x7'));var querystring=require(_0x58af('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x58af('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x58af('0x10'))('api');var utils=require(_0x58af('0x11'));var config=require(_0x58af('0x12'));var db=require(_0x58af('0x13'))['db'];config['redis']=_['defaults'](config[_0x58af('0x14')],{'host':_0x58af('0x15'),'port':0x18eb});var socket=require(_0x58af('0x16'))(new Redis(config[_0x58af('0x14')]));require(_0x58af('0x17'))[_0x58af('0x18')](socket);function respondWithStatusCode(_0x2b8789,_0x22eadc){_0x22eadc=_0x22eadc||0xcc;return function(_0x5ea55){if(_0x5ea55){return _0x2b8789[_0x58af('0x19')](_0x22eadc);}return _0x2b8789[_0x58af('0x1a')](_0x22eadc)[_0x58af('0x1b')]();};}function respondWithResult(_0x31d216,_0x25278e){_0x25278e=_0x25278e||0xc8;return function(_0x5e8beb){if(_0x5e8beb){return _0x31d216[_0x58af('0x1a')](_0x25278e)[_0x58af('0x1c')](_0x5e8beb);}};}function respondWithFilteredResult(_0x539b95,_0x5600fd){return function(_0x5b1d2c){if(_0x5b1d2c){var _0xa6f87=_0x5b1d2c[_0x58af('0x1d')],_0x24d333=_0x5600fd[_0x58af('0x1e')],_0x3fd08a=_0x5600fd[_0x58af('0x1e')]+_0x5600fd[_0x58af('0x1f')],_0x3a11d1;if(_0x3fd08a>=_0xa6f87){_0x3fd08a=_0xa6f87;_0x3a11d1=0xc8;}else{_0x3a11d1=0xce;}_0x539b95[_0x58af('0x1a')](_0x3a11d1);return _0x539b95[_0x58af('0x20')]('Content-Range',_0x24d333+'-'+_0x3fd08a+'/'+_0xa6f87)[_0x58af('0x1c')](_0x5b1d2c);}return null;};}function patchUpdates(_0x276644){return function(_0x493e8f){try{jsonpatch['apply'](_0x493e8f,_0x276644,!![]);}catch(_0x370423){return BPromise[_0x58af('0x21')](_0x370423);}return _0x493e8f[_0x58af('0x22')]();};}function saveUpdates(_0x5a2546,_0x3c1047){return function(_0x183a1d){if(_0x183a1d){return _0x183a1d['update'](_0x5a2546)[_0x58af('0x23')](function(_0x39b6a7){return _0x39b6a7;});}return null;};}function removeEntity(_0xca30d,_0x1ec08a){return function(_0x23e91a){if(_0x23e91a){return _0x23e91a[_0x58af('0x24')]()[_0x58af('0x23')](function(){_0xca30d[_0x58af('0x1a')](0xcc)[_0x58af('0x1b')]();});}};}function handleEntityNotFound(_0x18eedd,_0x4a6445){return function(_0x2211ac){if(!_0x2211ac){_0x18eedd[_0x58af('0x19')](0x194);}return _0x2211ac;};}function handleError(_0x300bb9,_0x119655){_0x119655=_0x119655||0x1f4;return function(_0x1b5e92){logger[_0x58af('0x25')](_0x1b5e92[_0x58af('0x26')]);if(_0x1b5e92['name']){delete _0x1b5e92[_0x58af('0x27')];}_0x300bb9['status'](_0x119655)[_0x58af('0x28')](_0x1b5e92);};}exports['show']=function(_0x3ac071,_0x4636de){var _0x3cb5f5={'raw':![],'where':{'id':_0x3ac071['params']['id']}},_0x468f04={};_0x468f04[_0x58af('0x29')]=_[_0x58af('0x2a')](db[_0x58af('0x2b')]['rawAttributes']);_0x468f04['query']=_[_0x58af('0x2a')](_0x3ac071[_0x58af('0x2c')]);_0x468f04[_0x58af('0x2d')]=_[_0x58af('0x2e')](_0x468f04[_0x58af('0x29')],_0x468f04[_0x58af('0x2c')]);_0x3cb5f5[_0x58af('0x2f')]=_[_0x58af('0x2e')](_0x468f04[_0x58af('0x29')],qs['fields'](_0x3ac071['query'][_0x58af('0x30')]));_0x3cb5f5[_0x58af('0x2f')]=_0x3cb5f5[_0x58af('0x2f')][_0x58af('0x31')]?_0x3cb5f5[_0x58af('0x2f')]:_0x468f04[_0x58af('0x29')];if(_0x3ac071[_0x58af('0x2c')]['includeAll']){_0x3cb5f5[_0x58af('0x32')]=[{'all':!![]}];}_0x3cb5f5=_[_0x58af('0x33')]({},_0x3cb5f5,_0x3ac071[_0x58af('0x34')]);return db[_0x58af('0x2b')][_0x58af('0x35')](_0x3cb5f5)['then'](handleEntityNotFound(_0x4636de,null))[_0x58af('0x23')](respondWithResult(_0x4636de,null))[_0x58af('0x36')](handleError(_0x4636de,null));};exports[_0x58af('0x24')]=function(_0x37e244,_0x3d3f33){return db[_0x58af('0x2b')]['find']({'where':{'id':_0x37e244[_0x58af('0x37')]['id']}})[_0x58af('0x23')](handleEntityNotFound(_0x3d3f33,null))[_0x58af('0x23')](removeEntity(_0x3d3f33,null))[_0x58af('0x36')](handleError(_0x3d3f33,null));};function widgetAttributes(_0x5375c5){try{switch(_0x5375c5[_0x58af('0x38')]){case _0x58af('0x39'):return[{'name':_0x58af('0x3a'),'value':_0x5375c5[_0x58af('0x3a')]||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x0]?_0x5375c5['attrs'][0x0]['value']:undefined)||_0x58af('0x3c')}];case _0x58af('0x3d'):return[{'name':'attrPath','value':_0x5375c5[_0x58af('0x3e')]||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x0]?_0x5375c5[_0x58af('0x3b')][0x0][_0x58af('0x3f')]:undefined)||''}];case _0x58af('0x40'):return[{'name':_0x58af('0x41'),'value':_0x5375c5[_0x58af('0x41')]||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x0]?_0x5375c5['attrs'][0x0][_0x58af('0x3f')]:undefined)||_0x58af('0x42')},{'name':'attrTimezone','value':_0x5375c5[_0x58af('0x43')]||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x1]?_0x5375c5[_0x58af('0x3b')][0x1][_0x58af('0x3f')]:undefined)||_0x58af('0x44')},{'name':_0x58af('0x45'),'value':_0x5375c5[_0x58af('0x45')]||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x2]?_0x5375c5[_0x58af('0x3b')][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0x58af('0x46'),'value':_0x5375c5[_0x58af('0x46')]||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5['attrs'][0x0]?_0x5375c5[_0x58af('0x3b')][0x0][_0x58af('0x3f')]:undefined)||_0x58af('0x47')},{'name':_0x58af('0x48'),'value':_0x5375c5['attrVoiceQueues']||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x1]?_0x5375c5[_0x58af('0x3b')][0x1][_0x58af('0x3f')]:undefined)||[]},{'name':_0x58af('0x45'),'value':_0x5375c5[_0x58af('0x45')]||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x2]?_0x5375c5[_0x58af('0x3b')][0x2]['value']:undefined)||0x14}];case _0x58af('0x49'):case _0x58af('0x4a'):return[{'name':'attrSerie1','value':_0x5375c5['attrSerie1']||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x0]?_0x5375c5[_0x58af('0x3b')][0x0]['value']:undefined)||_0x58af('0x47')},{'name':_0x58af('0x4b'),'value':_0x5375c5[_0x58af('0x4b')]||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x1]?_0x5375c5[_0x58af('0x3b')][0x1]['value']:undefined)||null},{'name':_0x58af('0x4c'),'value':_0x5375c5[_0x58af('0x4c')]||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x2]?_0x5375c5[_0x58af('0x3b')][0x2]['value']:undefined)||null},{'name':_0x58af('0x48'),'value':_0x5375c5[_0x58af('0x48')]||(_0x5375c5['attrs']&&_0x5375c5[_0x58af('0x3b')][0x3]?_0x5375c5[_0x58af('0x3b')][0x3][_0x58af('0x3f')]:undefined)||[]}];case _0x58af('0x4d'):return[{'name':'attrReport','type':_0x5375c5['reportType']||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x0]?_0x5375c5[_0x58af('0x3b')][0x0][_0x58af('0x38')]:undefined)||null,'value':_0x5375c5[_0x58af('0x4e')]||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x0]?_0x5375c5['attrs'][0x0][_0x58af('0x3f')]:undefined)||null},{'name':_0x58af('0x4f'),'value':_0x5375c5[_0x58af('0x4f')]||(_0x5375c5[_0x58af('0x3b')]&&_0x5375c5[_0x58af('0x3b')][0x1]?_0x5375c5[_0x58af('0x3b')][0x1][_0x58af('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x1febf1){logger['error'](_0x58af('0x50'),JSON[_0x58af('0x51')](_0x1febf1));return[];}}exports[_0x58af('0x52')]=function(_0x47f47c,_0x3c7251){if(_0x47f47c['body']){_0x47f47c[_0x58af('0x53')][_0x58af('0x3b')]=widgetAttributes(_0x47f47c[_0x58af('0x53')]);}return db[_0x58af('0x2b')][_0x58af('0x52')](_0x47f47c[_0x58af('0x53')],{})['then'](respondWithResult(_0x3c7251,0xc9))['catch'](handleError(_0x3c7251,null));};exports[_0x58af('0x54')]=function(_0x2cfa17,_0x1edf86){if(_0x2cfa17[_0x58af('0x53')]['id']){delete _0x2cfa17[_0x58af('0x53')]['id'];}_0x2cfa17[_0x58af('0x53')]['attrs']=widgetAttributes(_0x2cfa17[_0x58af('0x53')]);return db[_0x58af('0x2b')][_0x58af('0x35')]({'where':{'id':_0x2cfa17[_0x58af('0x37')]['id']}})['then'](handleEntityNotFound(_0x1edf86,null))[_0x58af('0x23')](saveUpdates(_0x2cfa17[_0x58af('0x53')],null))[_0x58af('0x23')](respondWithResult(_0x1edf86,null))[_0x58af('0x36')](handleError(_0x1edf86,null));}; \ No newline at end of file +var _0x7cb8=['options','find','catch','type','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','query','filters','intersection','fields','attributes','length','includeAll','include'];(function(_0x5b9c46,_0x1578a9){var _0x2b2877=function(_0x590761){while(--_0x590761){_0x5b9c46['push'](_0x5b9c46['shift']());}};_0x2b2877(++_0x1578a9);}(_0x7cb8,0x139));var _0x87cb=function(_0xad5e18,_0x28472b){_0xad5e18=_0xad5e18-0x0;var _0x16c314=_0x7cb8[_0xad5e18];return _0x16c314;};'use strict';var pdf=require(_0x87cb('0x0'));var emlformat=require(_0x87cb('0x1'));var rimraf=require(_0x87cb('0x2'));var zipdir=require(_0x87cb('0x3'));var jsonpatch=require(_0x87cb('0x4'));var rp=require(_0x87cb('0x5'));var moment=require(_0x87cb('0x6'));var BPromise=require(_0x87cb('0x7'));var Mustache=require(_0x87cb('0x8'));var util=require(_0x87cb('0x9'));var path=require(_0x87cb('0xa'));var sox=require(_0x87cb('0xb'));var csv=require(_0x87cb('0xc'));var ejs=require(_0x87cb('0xd'));var fs=require('fs');var _=require(_0x87cb('0xe'));var squel=require(_0x87cb('0xf'));var crypto=require(_0x87cb('0x10'));var jsforce=require(_0x87cb('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x87cb('0x12'));var Papa=require(_0x87cb('0x13'));var Redis=require('ioredis');var authService=require(_0x87cb('0x14'));var qs=require(_0x87cb('0x15'));var as=require(_0x87cb('0x16'));var hardwareService=require(_0x87cb('0x17'));var logger=require(_0x87cb('0x18'))(_0x87cb('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x87cb('0x1a'))['db'];config[_0x87cb('0x1b')]=_[_0x87cb('0x1c')](config[_0x87cb('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x87cb('0x1d'))(new Redis(config[_0x87cb('0x1b')]));require(_0x87cb('0x1e'))['register'](socket);function respondWithStatusCode(_0x4b42f2,_0x44ce25){_0x44ce25=_0x44ce25||0xcc;return function(_0x720ec2){if(_0x720ec2){return _0x4b42f2[_0x87cb('0x1f')](_0x44ce25);}return _0x4b42f2[_0x87cb('0x20')](_0x44ce25)[_0x87cb('0x21')]();};}function respondWithResult(_0x1ab678,_0x59d1a7){_0x59d1a7=_0x59d1a7||0xc8;return function(_0x1f2a6c){if(_0x1f2a6c){return _0x1ab678[_0x87cb('0x20')](_0x59d1a7)[_0x87cb('0x22')](_0x1f2a6c);}};}function respondWithFilteredResult(_0x2137dd,_0x2049f8){return function(_0x21cfa4){if(_0x21cfa4){var _0x1cb736=_0x21cfa4[_0x87cb('0x23')],_0x4e760e=_0x2049f8[_0x87cb('0x24')],_0x479930=_0x2049f8['offset']+_0x2049f8[_0x87cb('0x25')],_0x242e73;if(_0x479930>=_0x1cb736){_0x479930=_0x1cb736;_0x242e73=0xc8;}else{_0x242e73=0xce;}_0x2137dd[_0x87cb('0x20')](_0x242e73);return _0x2137dd[_0x87cb('0x26')](_0x87cb('0x27'),_0x4e760e+'-'+_0x479930+'/'+_0x1cb736)[_0x87cb('0x22')](_0x21cfa4);}return null;};}function patchUpdates(_0x2adc64){return function(_0x2447cc){try{jsonpatch[_0x87cb('0x28')](_0x2447cc,_0x2adc64,!![]);}catch(_0x451b84){return BPromise[_0x87cb('0x29')](_0x451b84);}return _0x2447cc[_0x87cb('0x2a')]();};}function saveUpdates(_0x10e189,_0x34e1a2){return function(_0x52c222){if(_0x52c222){return _0x52c222[_0x87cb('0x2b')](_0x10e189)[_0x87cb('0x2c')](function(_0x1169ab){return _0x1169ab;});}return null;};}function removeEntity(_0x9d3c20,_0x17a3a9){return function(_0x34f21a){if(_0x34f21a){return _0x34f21a[_0x87cb('0x2d')]()[_0x87cb('0x2c')](function(){_0x9d3c20[_0x87cb('0x20')](0xcc)[_0x87cb('0x21')]();});}};}function handleEntityNotFound(_0x19cbaa,_0xfb0baf){return function(_0x1fb61c){if(!_0x1fb61c){_0x19cbaa[_0x87cb('0x1f')](0x194);}return _0x1fb61c;};}function handleError(_0x50ba77,_0x5d15e3){_0x5d15e3=_0x5d15e3||0x1f4;return function(_0xeb04f7){logger[_0x87cb('0x2e')](_0xeb04f7[_0x87cb('0x2f')]);if(_0xeb04f7[_0x87cb('0x30')]){delete _0xeb04f7['name'];}_0x50ba77[_0x87cb('0x20')](_0x5d15e3)[_0x87cb('0x31')](_0xeb04f7);};}exports[_0x87cb('0x32')]=function(_0x2840e5,_0x16b24c){var _0x5b9433={'raw':![],'where':{'id':_0x2840e5[_0x87cb('0x33')]['id']}},_0x4f446b={};_0x4f446b[_0x87cb('0x34')]=_[_0x87cb('0x35')](db[_0x87cb('0x36')]['rawAttributes']);_0x4f446b[_0x87cb('0x37')]=_[_0x87cb('0x35')](_0x2840e5['query']);_0x4f446b[_0x87cb('0x38')]=_[_0x87cb('0x39')](_0x4f446b[_0x87cb('0x34')],_0x4f446b[_0x87cb('0x37')]);_0x5b9433['attributes']=_[_0x87cb('0x39')](_0x4f446b[_0x87cb('0x34')],qs[_0x87cb('0x3a')](_0x2840e5[_0x87cb('0x37')][_0x87cb('0x3a')]));_0x5b9433[_0x87cb('0x3b')]=_0x5b9433[_0x87cb('0x3b')][_0x87cb('0x3c')]?_0x5b9433[_0x87cb('0x3b')]:_0x4f446b[_0x87cb('0x34')];if(_0x2840e5['query'][_0x87cb('0x3d')]){_0x5b9433[_0x87cb('0x3e')]=[{'all':!![]}];}_0x5b9433=_['merge']({},_0x5b9433,_0x2840e5[_0x87cb('0x3f')]);return db[_0x87cb('0x36')][_0x87cb('0x40')](_0x5b9433)[_0x87cb('0x2c')](handleEntityNotFound(_0x16b24c,null))[_0x87cb('0x2c')](respondWithResult(_0x16b24c,null))[_0x87cb('0x41')](handleError(_0x16b24c,null));};exports[_0x87cb('0x2d')]=function(_0xcfd7a9,_0x9f0069){return db[_0x87cb('0x36')][_0x87cb('0x40')]({'where':{'id':_0xcfd7a9[_0x87cb('0x33')]['id']}})['then'](handleEntityNotFound(_0x9f0069,null))[_0x87cb('0x2c')](removeEntity(_0x9f0069,null))['catch'](handleError(_0x9f0069,null));};function widgetAttributes(_0x267e5e){try{switch(_0x267e5e[_0x87cb('0x42')]){case _0x87cb('0x43'):return[{'name':_0x87cb('0x44'),'value':_0x267e5e[_0x87cb('0x44')]||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e['attrs'][0x0]?_0x267e5e[_0x87cb('0x45')][0x0][_0x87cb('0x46')]:undefined)||'https://'}];case _0x87cb('0x47'):return[{'name':_0x87cb('0x48'),'value':_0x267e5e[_0x87cb('0x48')]||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e[_0x87cb('0x45')][0x0]?_0x267e5e[_0x87cb('0x45')][0x0][_0x87cb('0x46')]:undefined)||''}];case'clock':return[{'name':_0x87cb('0x49'),'value':_0x267e5e[_0x87cb('0x49')]||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e['attrs'][0x0]?_0x267e5e['attrs'][0x0][_0x87cb('0x46')]:undefined)||_0x87cb('0x4a')},{'name':'attrTimezone','value':_0x267e5e[_0x87cb('0x4b')]||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e[_0x87cb('0x45')][0x1]?_0x267e5e[_0x87cb('0x45')][0x1][_0x87cb('0x46')]:undefined)||_0x87cb('0x4c')},{'name':_0x87cb('0x4d'),'value':_0x267e5e[_0x87cb('0x4d')]||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e['attrs'][0x2]?_0x267e5e[_0x87cb('0x45')][0x2][_0x87cb('0x46')]:undefined)||0xc}];case _0x87cb('0x4e'):return[{'name':_0x87cb('0x4f'),'value':_0x267e5e[_0x87cb('0x4f')]||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e['attrs'][0x0]?_0x267e5e[_0x87cb('0x45')][0x0][_0x87cb('0x46')]:undefined)||_0x87cb('0x50')},{'name':_0x87cb('0x51'),'value':_0x267e5e[_0x87cb('0x51')]||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e[_0x87cb('0x45')][0x1]?_0x267e5e[_0x87cb('0x45')][0x1][_0x87cb('0x46')]:undefined)||[]},{'name':_0x87cb('0x4d'),'value':_0x267e5e[_0x87cb('0x4d')]||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e[_0x87cb('0x45')][0x2]?_0x267e5e[_0x87cb('0x45')][0x2][_0x87cb('0x46')]:undefined)||0x14}];case'multibar-chart':case _0x87cb('0x52'):return[{'name':_0x87cb('0x53'),'value':_0x267e5e['attrSerie1']||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e[_0x87cb('0x45')][0x0]?_0x267e5e['attrs'][0x0][_0x87cb('0x46')]:undefined)||_0x87cb('0x50')},{'name':_0x87cb('0x54'),'value':_0x267e5e[_0x87cb('0x54')]||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e[_0x87cb('0x45')][0x1]?_0x267e5e[_0x87cb('0x45')][0x1]['value']:undefined)||null},{'name':_0x87cb('0x55'),'value':_0x267e5e[_0x87cb('0x55')]||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e['attrs'][0x2]?_0x267e5e[_0x87cb('0x45')][0x2][_0x87cb('0x46')]:undefined)||null},{'name':_0x87cb('0x51'),'value':_0x267e5e['attrVoiceQueues']||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e[_0x87cb('0x45')][0x3]?_0x267e5e[_0x87cb('0x45')][0x3][_0x87cb('0x46')]:undefined)||[]}];case _0x87cb('0x56'):return[{'name':_0x87cb('0x57'),'type':_0x267e5e[_0x87cb('0x58')]||(_0x267e5e[_0x87cb('0x45')]&&_0x267e5e[_0x87cb('0x45')][0x0]?_0x267e5e[_0x87cb('0x45')][0x0]['type']:undefined)||null,'value':_0x267e5e['attrReport']||(_0x267e5e['attrs']&&_0x267e5e['attrs'][0x0]?_0x267e5e[_0x87cb('0x45')][0x0][_0x87cb('0x46')]:undefined)||null},{'name':_0x87cb('0x59'),'value':_0x267e5e[_0x87cb('0x59')]||(_0x267e5e['attrs']&&_0x267e5e[_0x87cb('0x45')][0x1]?_0x267e5e[_0x87cb('0x45')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3037df){logger['error'](_0x87cb('0x5a'),JSON[_0x87cb('0x5b')](_0x3037df));return[];}}exports[_0x87cb('0x5c')]=function(_0x266ce6,_0x2f5d1f){if(_0x266ce6[_0x87cb('0x5d')]){_0x266ce6[_0x87cb('0x5d')][_0x87cb('0x45')]=widgetAttributes(_0x266ce6['body']);}return db[_0x87cb('0x36')][_0x87cb('0x5c')](_0x266ce6['body'],{})[_0x87cb('0x2c')](respondWithResult(_0x2f5d1f,0xc9))[_0x87cb('0x41')](handleError(_0x2f5d1f,null));};exports[_0x87cb('0x2b')]=function(_0x25d264,_0x421f0c){if(_0x25d264[_0x87cb('0x5d')]['id']){delete _0x25d264[_0x87cb('0x5d')]['id'];}_0x25d264[_0x87cb('0x5d')][_0x87cb('0x45')]=widgetAttributes(_0x25d264[_0x87cb('0x5d')]);return db[_0x87cb('0x36')][_0x87cb('0x40')]({'where':{'id':_0x25d264[_0x87cb('0x33')]['id']}})['then'](handleEntityNotFound(_0x421f0c,null))[_0x87cb('0x2c')](saveUpdates(_0x25d264['body'],null))['then'](respondWithResult(_0x421f0c,null))[_0x87cb('0x41')](handleError(_0x421f0c,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 238b155..89804d4 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 _0x7c24=['emit','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','update','remove'];(function(_0x20377f,_0x4a9496){var _0x5f2b1d=function(_0x10e280){while(--_0x10e280){_0x20377f['push'](_0x20377f['shift']());}};_0x5f2b1d(++_0x4a9496);}(_0x7c24,0x186));var _0x47c2=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x7c24[_0x40220a];return _0x3903cc;};'use strict';var EventEmitter=require(_0x47c2('0x0'));var DashboardItem=require(_0x47c2('0x1'))['db'][_0x47c2('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x47c2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x47c2('0x4'),'afterDestroy':_0x47c2('0x5')};function emitEvent(_0x20f60c){return function(_0x14d01d,_0x4e5e69,_0x48efdf){DashboardItemEvents[_0x47c2('0x6')](_0x20f60c+':'+_0x14d01d['id'],_0x14d01d);DashboardItemEvents[_0x47c2('0x6')](_0x20f60c,_0x14d01d);_0x48efdf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x47c2('0x7')](e,emitEvent(event));}}module[_0x47c2('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x243f=['exports','DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x449aaa,_0x5ab027){var _0x3f0a77=function(_0x3bdb7f){while(--_0x3bdb7f){_0x449aaa['push'](_0x449aaa['shift']());}};_0x3f0a77(++_0x5ab027);}(_0x243f,0x1eb));var _0xf243=function(_0x2920dd,_0x19d049){_0x2920dd=_0x2920dd-0x0;var _0x5d4e52=_0x243f[_0x2920dd];return _0x5d4e52;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0xf243('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xf243('0x1')](0x0);var events={'afterCreate':_0xf243('0x2'),'afterUpdate':_0xf243('0x3'),'afterDestroy':'remove'};function emitEvent(_0x94f0fa){return function(_0x579cfe,_0xaf54e9,_0x3b5779){DashboardItemEvents[_0xf243('0x4')](_0x94f0fa+':'+_0x579cfe['id'],_0x579cfe);DashboardItemEvents[_0xf243('0x4')](_0x94f0fa,_0x579cfe);_0x3b5779(null);};}for(var e in events){if(events[_0xf243('0x5')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xf243('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 3822f97..5184ca9 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 _0xe4e1=['../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','DashboardItem','dashboard_items','lodash','util'];(function(_0xa96a06,_0x2b1996){var _0x53c3b1=function(_0x33e253){while(--_0x33e253){_0xa96a06['push'](_0xa96a06['shift']());}};_0x53c3b1(++_0x2b1996);}(_0xe4e1,0xe2));var _0x1e4e=function(_0x13be43,_0x1261e8){_0x13be43=_0x13be43-0x0;var _0x2b5d2f=_0xe4e1[_0x13be43];return _0x2b5d2f;};'use strict';var _=require(_0x1e4e('0x0'));var util=require(_0x1e4e('0x1'));var logger=require(_0x1e4e('0x2'))(_0x1e4e('0x3'));var moment=require('moment');var BPromise=require(_0x1e4e('0x4'));var rp=require(_0x1e4e('0x5'));var fs=require('fs');var path=require(_0x1e4e('0x6'));var rimraf=require(_0x1e4e('0x7'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module[_0x1e4e('0x8')]=function(_0x239140,_0x15f650){return _0x239140[_0x1e4e('0x9')](_0x1e4e('0xa'),attributes,{'tableName':_0x1e4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf69d=['exports','DashboardItem','dashboard_items','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x14f132,_0x4cf31e){var _0x24bf39=function(_0x10ddad){while(--_0x10ddad){_0x14f132['push'](_0x14f132['shift']());}};_0x24bf39(++_0x4cf31e);}(_0xf69d,0x1c5));var _0xdf69=function(_0x208af6,_0x50ff7d){_0x208af6=_0x208af6-0x0;var _0x3559aa=_0xf69d[_0x208af6];return _0x3559aa;};'use strict';var _=require(_0xdf69('0x0'));var util=require('util');var logger=require(_0xdf69('0x1'))('api');var moment=require(_0xdf69('0x2'));var BPromise=require(_0xdf69('0x3'));var rp=require(_0xdf69('0x4'));var fs=require('fs');var path=require(_0xdf69('0x5'));var rimraf=require('rimraf');var config=require(_0xdf69('0x6'));var attributes=require('./dashboardItem.attributes');module[_0xdf69('0x7')]=function(_0x2a7e3d,_0x4891f7){return _0x2a7e3d['define'](_0xdf69('0x8'),attributes,{'tableName':_0xdf69('0x9'),'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 a02153e..ae11b58 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 _0x1b46=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2ae071,_0x346bee){var _0x1db8f8=function(_0x3134bf){while(--_0x3134bf){_0x2ae071['push'](_0x2ae071['shift']());}};_0x1db8f8(++_0x346bee);}(_0x1b46,0x16c));var _0x61b4=function(_0x3fe6c8,_0x57bb36){_0x3fe6c8=_0x3fe6c8-0x0;var _0x2828ae=_0x1b46[_0x3fe6c8];return _0x2828ae;};'use strict';var _=require(_0x61b4('0x0'));var util=require('util');var moment=require(_0x61b4('0x1'));var BPromise=require(_0x61b4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61b4('0x3'));var db=require(_0x61b4('0x4'))['db'];var utils=require(_0x61b4('0x5'));var logger=require('../../config/logger')(_0x61b4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x61b4('0x7')][_0x61b4('0x8')]({'port':0x232a});config[_0x61b4('0x9')]=_[_0x61b4('0xa')](config[_0x61b4('0x9')],{'host':_0x61b4('0xb'),'port':0x18eb});var socket=require(_0x61b4('0xc'))(new Redis(config['redis']));require(_0x61b4('0xd'))[_0x61b4('0xe')](socket);function respondWithRpcPromise(_0x9e0dd2,_0x4846ee,_0x5dcc10){return new BPromise(function(_0x5929c9,_0x3c93be){return client[_0x61b4('0xf')](_0x9e0dd2,_0x5dcc10)[_0x61b4('0x10')](function(_0xbf2166){logger[_0x61b4('0x11')](_0x61b4('0x12'),_0x4846ee,_0x61b4('0x13'));logger[_0x61b4('0x14')](_0x61b4('0x15'),_0x4846ee,'request\x20sent',JSON[_0x61b4('0x16')](_0xbf2166));if(_0xbf2166[_0x61b4('0x17')]){if(_0xbf2166['error'][_0x61b4('0x18')]===0x1f4){logger[_0x61b4('0x17')](_0x61b4('0x12'),_0x4846ee,_0xbf2166['error']['message']);return _0x3c93be(_0xbf2166[_0x61b4('0x17')][_0x61b4('0x19')]);}logger[_0x61b4('0x17')]('DashboardItem,\x20%s,\x20%s',_0x4846ee,_0xbf2166[_0x61b4('0x17')][_0x61b4('0x19')]);return _0x5929c9(_0xbf2166[_0x61b4('0x17')][_0x61b4('0x19')]);}else{logger[_0x61b4('0x11')](_0x61b4('0x12'),_0x4846ee,_0x61b4('0x13'));_0x5929c9(_0xbf2166[_0x61b4('0x1a')][_0x61b4('0x19')]);}})[_0x61b4('0x1b')](function(_0x2b9fed){logger[_0x61b4('0x17')](_0x61b4('0x12'),_0x4846ee,_0x2b9fed);_0x3c93be(_0x2b9fed);});});} \ No newline at end of file +var _0x1ab9=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x1ab9,0xde));var _0x91ab=function(_0x8956db,_0x565a5f){_0x8956db=_0x8956db-0x0;var _0x175a41=_0x1ab9[_0x8956db];return _0x175a41;};'use strict';var _=require(_0x91ab('0x0'));var util=require(_0x91ab('0x1'));var moment=require(_0x91ab('0x2'));var BPromise=require(_0x91ab('0x3'));var rs=require(_0x91ab('0x4'));var fs=require('fs');var Redis=require(_0x91ab('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x91ab('0x6'));var logger=require(_0x91ab('0x7'))(_0x91ab('0x8'));var config=require(_0x91ab('0x9'));var jayson=require(_0x91ab('0xa'));var client=jayson[_0x91ab('0xb')][_0x91ab('0xc')]({'port':0x232a});config[_0x91ab('0xd')]=_[_0x91ab('0xe')](config[_0x91ab('0xd')],{'host':_0x91ab('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x91ab('0xd')]));require(_0x91ab('0x10'))[_0x91ab('0x11')](socket);function respondWithRpcPromise(_0x13858c,_0xd3b891,_0xf054ca){return new BPromise(function(_0x4882dc,_0x46083e){return client['request'](_0x13858c,_0xf054ca)[_0x91ab('0x12')](function(_0x2e83c1){logger[_0x91ab('0x13')](_0x91ab('0x14'),_0xd3b891,'request\x20sent');logger[_0x91ab('0x15')](_0x91ab('0x16'),_0xd3b891,_0x91ab('0x17'),JSON['stringify'](_0x2e83c1));if(_0x2e83c1[_0x91ab('0x18')]){if(_0x2e83c1[_0x91ab('0x18')][_0x91ab('0x19')]===0x1f4){logger[_0x91ab('0x18')](_0x91ab('0x14'),_0xd3b891,_0x2e83c1[_0x91ab('0x18')][_0x91ab('0x1a')]);return _0x46083e(_0x2e83c1[_0x91ab('0x18')]['message']);}logger[_0x91ab('0x18')](_0x91ab('0x14'),_0xd3b891,_0x2e83c1[_0x91ab('0x18')][_0x91ab('0x1a')]);return _0x4882dc(_0x2e83c1['error']['message']);}else{logger[_0x91ab('0x13')](_0x91ab('0x14'),_0xd3b891,'request\x20sent');_0x4882dc(_0x2e83c1['result'][_0x91ab('0x1a')]);}})[_0x91ab('0x1b')](function(_0x4c021e){logger[_0x91ab('0x18')]('DashboardItem,\x20%s,\x20%s',_0xd3b891,_0x4c021e);_0x46083e(_0x4c021e);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 91aad84..bbd1901 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 _0xaa00=['remove','update','removeListener','register','dashboardItem:','./dashboardItem.events','save'];(function(_0x19f866,_0xf68c27){var _0x59bf91=function(_0x315b27){while(--_0x315b27){_0x19f866['push'](_0x19f866['shift']());}};_0x59bf91(++_0xf68c27);}(_0xaa00,0x91));var _0x0aa0=function(_0x1e19f4,_0x997d5f){_0x1e19f4=_0x1e19f4-0x0;var _0x153261=_0xaa00[_0x1e19f4];return _0x153261;};'use strict';var DashboardItemEvents=require(_0x0aa0('0x0'));var events=[_0x0aa0('0x1'),_0x0aa0('0x2'),_0x0aa0('0x3')];function createListener(_0x2f668e,_0x46672d){return function(_0x3574d4){_0x46672d['emit'](_0x2f668e,_0x3574d4);};}function removeListener(_0x2d8c51,_0x38967a){return function(){DashboardItemEvents[_0x0aa0('0x4')](_0x2d8c51,_0x38967a);};}exports[_0x0aa0('0x5')]=function(_0x516ea2){for(var _0x42f14d=0x0,_0x14d2e8=events['length'];_0x42f14d<_0x14d2e8;_0x42f14d++){var _0x22c8ba=events[_0x42f14d];var _0x299808=createListener(_0x0aa0('0x6')+_0x22c8ba,_0x516ea2);DashboardItemEvents['on'](_0x22c8ba,_0x299808);}}; \ No newline at end of file +var _0x8faa=['remove','dashboardItem:','./dashboardItem.events','save'];(function(_0x34ad55,_0x2fb590){var _0x4239f9=function(_0x1f95ee){while(--_0x1f95ee){_0x34ad55['push'](_0x34ad55['shift']());}};_0x4239f9(++_0x2fb590);}(_0x8faa,0x9a));var _0xa8fa=function(_0x15942a,_0x13b58c){_0x15942a=_0x15942a-0x0;var _0x36a9fb=_0x8faa[_0x15942a];return _0x36a9fb;};'use strict';var DashboardItemEvents=require(_0xa8fa('0x0'));var events=[_0xa8fa('0x1'),_0xa8fa('0x2'),'update'];function createListener(_0x42e72d,_0x443594){return function(_0x5c8e7a){_0x443594['emit'](_0x42e72d,_0x5c8e7a);};}function removeListener(_0x76b3f9,_0x107186){return function(){DashboardItemEvents['removeListener'](_0x76b3f9,_0x107186);};}exports['register']=function(_0x194d89){for(var _0x4fdb1e=0x0,_0x511c6f=events['length'];_0x4fdb1e<_0x511c6f;_0x4fdb1e++){var _0x1d65fd=events[_0x4fdb1e];var _0xf073f=createListener(_0xa8fa('0x3')+_0x1d65fd,_0x194d89);DashboardItemEvents['on'](_0x1d65fd,_0xf073f);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index dc8e470..1440cec 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 _0x3f8a=['isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x4ca3b4,_0x12b782){_0x4ca3b4=_0x4ca3b4-0x0;var _0xa61962=_0x3f8a[_0x4ca3b4];return _0xa61962;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var auth=require(_0xa3f8('0x5'));var interaction=require(_0xa3f8('0x6'));var config=require(_0xa3f8('0x7'));var controller=require(_0xa3f8('0x8'));router[_0xa3f8('0x9')](_0xa3f8('0xa'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xc')]);router[_0xa3f8('0xd')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xe')]);router[_0xa3f8('0xf')](_0xa3f8('0xa'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x10')]);router[_0xa3f8('0x11')]('/:id',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x12')]);module[_0xa3f8('0x13')]=router; \ No newline at end of file +var _0x1261=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','show','post','create','put','/:id','isAuthenticated','update','destroy'];(function(_0x4f1597,_0x533728){var _0x3e9aaf=function(_0x2ee3cb){while(--_0x2ee3cb){_0x4f1597['push'](_0x4f1597['shift']());}};_0x3e9aaf(++_0x533728);}(_0x1261,0x144));var _0x1126=function(_0x188bfe,_0x2517cc){_0x188bfe=_0x188bfe-0x0;var _0x1a9efa=_0x1261[_0x188bfe];return _0x1a9efa;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/',auth['isAuthenticated'](),controller[_0x1126('0xc')]);router[_0x1126('0xd')](_0x1126('0xe'),auth[_0x1126('0xf')](),controller[_0x1126('0x10')]);router['delete'](_0x1126('0xe'),auth[_0x1126('0xf')](),controller[_0x1126('0x11')]);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 6414964..a2b92a8 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 _0x114d=['exports','STRING','sequelize'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0x114d,0x13a));var _0xd114=function(_0x11644f,_0x221c8e){_0x11644f=_0x11644f-0x0;var _0x363641=_0x114d[_0x11644f];return _0x363641;};'use strict';var Sequelize=require(_0xd114('0x0'));module[_0xd114('0x1')]={'name':{'type':Sequelize[_0xd114('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xdcef=['STRING','exports'];(function(_0x329b5f,_0x57be5f){var _0x57181f=function(_0x492848){while(--_0x492848){_0x329b5f['push'](_0x329b5f['shift']());}};_0x57181f(++_0x57be5f);}(_0xdcef,0x169));var _0xfdce=function(_0x456816,_0x433ba2){_0x456816=_0x456816-0x0;var _0x1069af=_0xdcef[_0x456816];return _0x1069af;};'use strict';var Sequelize=require('sequelize');module[_0xfdce('0x0')]={'name':{'type':Sequelize[_0xfdce('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 5937e72..e293531 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 _0x20ee=['apply','reject','save','update','then','destroy','get','Dispositions','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','Disposition','findAll','rows','catch','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set'];(function(_0x4a3826,_0x497517){var _0x5c1a33=function(_0x342a8a){while(--_0x342a8a){_0x4a3826['push'](_0x4a3826['shift']());}};_0x5c1a33(++_0x497517);}(_0x20ee,0xe0));var _0xe20e=function(_0x55ff67,_0xdeefb4){_0x55ff67=_0x55ff67-0x0;var _0x330a5f=_0x20ee[_0x55ff67];return _0x330a5f;};'use strict';var pdf=require(_0xe20e('0x0'));var emlformat=require(_0xe20e('0x1'));var rimraf=require(_0xe20e('0x2'));var zipdir=require(_0xe20e('0x3'));var jsonpatch=require(_0xe20e('0x4'));var rp=require(_0xe20e('0x5'));var moment=require(_0xe20e('0x6'));var BPromise=require(_0xe20e('0x7'));var Mustache=require('mustache');var util=require(_0xe20e('0x8'));var path=require('path');var sox=require(_0xe20e('0x9'));var csv=require(_0xe20e('0xa'));var ejs=require(_0xe20e('0xb'));var fs=require('fs');var _=require(_0xe20e('0xc'));var squel=require(_0xe20e('0xd'));var crypto=require(_0xe20e('0xe'));var jsforce=require(_0xe20e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe20e('0xa'));var querystring=require('querystring');var Papa=require(_0xe20e('0x10'));var Redis=require(_0xe20e('0x11'));var authService=require(_0xe20e('0x12'));var qs=require(_0xe20e('0x13'));var as=require(_0xe20e('0x14'));var hardwareService=require(_0xe20e('0x15'));var logger=require(_0xe20e('0x16'))(_0xe20e('0x17'));var utils=require(_0xe20e('0x18'));var config=require(_0xe20e('0x19'));var db=require(_0xe20e('0x1a'))['db'];function respondWithStatusCode(_0x23d8e5,_0x5ee30d){_0x5ee30d=_0x5ee30d||0xcc;return function(_0x4831ef){if(_0x4831ef){return _0x23d8e5['sendStatus'](_0x5ee30d);}return _0x23d8e5[_0xe20e('0x1b')](_0x5ee30d)[_0xe20e('0x1c')]();};}function respondWithResult(_0x5aa492,_0x77f0cb){_0x77f0cb=_0x77f0cb||0xc8;return function(_0x110e8f){if(_0x110e8f){return _0x5aa492[_0xe20e('0x1b')](_0x77f0cb)[_0xe20e('0x1d')](_0x110e8f);}};}function respondWithFilteredResult(_0x4c40fa,_0x488eda){return function(_0x2138a9){if(_0x2138a9){var _0x5f45db=_0x2138a9[_0xe20e('0x1e')],_0x39fb35=_0x488eda[_0xe20e('0x1f')],_0x33b781=_0x488eda[_0xe20e('0x1f')]+_0x488eda[_0xe20e('0x20')],_0x2582ab;if(_0x33b781>=_0x5f45db){_0x33b781=_0x5f45db;_0x2582ab=0xc8;}else{_0x2582ab=0xce;}_0x4c40fa['status'](_0x2582ab);return _0x4c40fa[_0xe20e('0x21')]('Content-Range',_0x39fb35+'-'+_0x33b781+'/'+_0x5f45db)[_0xe20e('0x1d')](_0x2138a9);}return null;};}function patchUpdates(_0x57eea7){return function(_0x188d01){try{jsonpatch[_0xe20e('0x22')](_0x188d01,_0x57eea7,!![]);}catch(_0x398549){return BPromise[_0xe20e('0x23')](_0x398549);}return _0x188d01[_0xe20e('0x24')]();};}function saveUpdates(_0x294fa8,_0x431b04){return function(_0x23ee24){if(_0x23ee24){return _0x23ee24[_0xe20e('0x25')](_0x294fa8)[_0xe20e('0x26')](function(_0x16998e){return _0x16998e;});}return null;};}function removeEntity(_0x500726,_0xafda0d){return function(_0x412376){if(_0x412376){return _0x412376[_0xe20e('0x27')]()['then'](function(){var _0x5d8325=_0x412376[_0xe20e('0x28')]({'plain':!![]});var _0x45c746=_0xe20e('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x45c746,'resourceId':_0x5d8325['id']}})['then'](function(){return _0x412376;});})['then'](function(){_0x500726[_0xe20e('0x1b')](0xcc)[_0xe20e('0x1c')]();});}};}function handleEntityNotFound(_0x216120,_0xf584c7){return function(_0x5541cd){if(!_0x5541cd){_0x216120[_0xe20e('0x2a')](0x194);}return _0x5541cd;};}function handleError(_0x332d8d,_0x1ae209){_0x1ae209=_0x1ae209||0x1f4;return function(_0x8242a4){logger[_0xe20e('0x2b')](_0x8242a4['stack']);if(_0x8242a4[_0xe20e('0x2c')]){delete _0x8242a4[_0xe20e('0x2c')];}_0x332d8d[_0xe20e('0x1b')](_0x1ae209)[_0xe20e('0x2d')](_0x8242a4);};}exports[_0xe20e('0x2e')]=function(_0x28d7f2,_0x13a533){var _0xe6096d={},_0x1fe643={},_0x295e8c={'count':0x0,'rows':[]};var _0x426307=_['map'](db['Disposition'][_0xe20e('0x2f')],function(_0x2df8f1){return{'name':_0x2df8f1[_0xe20e('0x30')],'type':_0x2df8f1[_0xe20e('0x31')][_0xe20e('0x32')]};});_0x1fe643[_0xe20e('0x33')]=_[_0xe20e('0x34')](_0x426307,_0xe20e('0x2c'));_0x1fe643['query']=_['keys'](_0x28d7f2[_0xe20e('0x35')]);_0x1fe643[_0xe20e('0x36')]=_[_0xe20e('0x37')](_0x1fe643[_0xe20e('0x33')],_0x1fe643[_0xe20e('0x35')]);_0xe6096d[_0xe20e('0x38')]=_[_0xe20e('0x37')](_0x1fe643['model'],qs[_0xe20e('0x39')](_0x28d7f2[_0xe20e('0x35')]['fields']));_0xe6096d[_0xe20e('0x38')]=_0xe6096d[_0xe20e('0x38')][_0xe20e('0x3a')]?_0xe6096d[_0xe20e('0x38')]:_0x1fe643[_0xe20e('0x33')];if(!_0x28d7f2[_0xe20e('0x35')][_0xe20e('0x3b')]('nolimit')){_0xe6096d[_0xe20e('0x20')]=qs[_0xe20e('0x20')](_0x28d7f2['query'][_0xe20e('0x20')]);_0xe6096d[_0xe20e('0x1f')]=qs['offset'](_0x28d7f2[_0xe20e('0x35')][_0xe20e('0x1f')]);}_0xe6096d[_0xe20e('0x3c')]=qs[_0xe20e('0x3d')](_0x28d7f2[_0xe20e('0x35')][_0xe20e('0x3d')]);_0xe6096d[_0xe20e('0x3e')]=qs[_0xe20e('0x36')](_[_0xe20e('0x3f')](_0x28d7f2[_0xe20e('0x35')],_0x1fe643[_0xe20e('0x36')]),_0x426307);if(_0x28d7f2['query'][_0xe20e('0x40')]){_0xe6096d[_0xe20e('0x3e')]=_['merge'](_0xe6096d[_0xe20e('0x3e')],{'$or':_[_0xe20e('0x34')](_0x426307,function(_0x1836e5){if(_0x1836e5[_0xe20e('0x31')]!==_0xe20e('0x41')){var _0x193b23={};_0x193b23[_0x1836e5[_0xe20e('0x2c')]]={'$like':'%'+_0x28d7f2['query']['filter']+'%'};return _0x193b23;}})});}_0xe6096d=_[_0xe20e('0x42')]({},_0xe6096d,_0x28d7f2[_0xe20e('0x43')]);var _0x1078d1={'where':_0xe6096d[_0xe20e('0x3e')]};return db['Disposition']['count'](_0x1078d1)[_0xe20e('0x26')](function(_0x282494){_0x295e8c[_0xe20e('0x1e')]=_0x282494;if(_0x28d7f2[_0xe20e('0x35')][_0xe20e('0x44')]){_0xe6096d[_0xe20e('0x45')]=[{'all':!![]}];}return db[_0xe20e('0x46')][_0xe20e('0x47')](_0xe6096d);})[_0xe20e('0x26')](function(_0xc57698){_0x295e8c[_0xe20e('0x48')]=_0xc57698;return _0x295e8c;})[_0xe20e('0x26')](respondWithFilteredResult(_0x13a533,_0xe6096d))[_0xe20e('0x49')](handleError(_0x13a533,null));};exports[_0xe20e('0x4a')]=function(_0x54ec4a,_0x30a621){var _0x31499c={'raw':!![],'where':{'id':_0x54ec4a['params']['id']}},_0x3aadf8={};_0x3aadf8[_0xe20e('0x33')]=_[_0xe20e('0x4b')](db[_0xe20e('0x46')]['rawAttributes']);_0x3aadf8[_0xe20e('0x35')]=_[_0xe20e('0x4b')](_0x54ec4a[_0xe20e('0x35')]);_0x3aadf8[_0xe20e('0x36')]=_[_0xe20e('0x37')](_0x3aadf8[_0xe20e('0x33')],_0x3aadf8[_0xe20e('0x35')]);_0x31499c[_0xe20e('0x38')]=_['intersection'](_0x3aadf8[_0xe20e('0x33')],qs['fields'](_0x54ec4a['query']['fields']));_0x31499c[_0xe20e('0x38')]=_0x31499c[_0xe20e('0x38')]['length']?_0x31499c[_0xe20e('0x38')]:_0x3aadf8[_0xe20e('0x33')];if(_0x54ec4a['query']['includeAll']){_0x31499c['include']=[{'all':!![]}];}_0x31499c=_[_0xe20e('0x42')]({},_0x31499c,_0x54ec4a[_0xe20e('0x43')]);return db[_0xe20e('0x46')][_0xe20e('0x4c')](_0x31499c)[_0xe20e('0x26')](handleEntityNotFound(_0x30a621,null))[_0xe20e('0x26')](respondWithResult(_0x30a621,null))[_0xe20e('0x49')](handleError(_0x30a621,null));};exports[_0xe20e('0x4d')]=function(_0x19dd36,_0x136bd9){return db[_0xe20e('0x46')][_0xe20e('0x4d')](_0x19dd36[_0xe20e('0x4e')],{})['then'](function(_0x4fc20a){var _0x1870e5=_0x19dd36[_0xe20e('0x4f')][_0xe20e('0x28')]({'plain':!![]});if(!_0x1870e5)throw new Error(_0xe20e('0x50'));if(_0x1870e5['role']==='user'){var _0x30bfc6=_0x4fc20a[_0xe20e('0x28')]({'plain':!![]});var _0x241a1d=_0xe20e('0x29');return db['UserProfileSection'][_0xe20e('0x4c')]({'where':{'name':_0x241a1d,'userProfileId':_0x1870e5[_0xe20e('0x51')]},'raw':!![]})['then'](function(_0x3b6b65){if(_0x3b6b65&&_0x3b6b65[_0xe20e('0x52')]===0x0){return db[_0xe20e('0x53')][_0xe20e('0x4d')]({'name':_0x30bfc6['name'],'resourceId':_0x30bfc6['id'],'type':_0x3b6b65[_0xe20e('0x2c')],'sectionId':_0x3b6b65['id']},{})[_0xe20e('0x26')](function(){return _0x4fc20a;});}else{return _0x4fc20a;}})[_0xe20e('0x49')](function(_0x425694){logger['error'](_0xe20e('0x54'),_0x425694);throw _0x425694;});}return _0x4fc20a;})[_0xe20e('0x26')](respondWithResult(_0x136bd9,0xc9))[_0xe20e('0x49')](handleError(_0x136bd9,null));};exports[_0xe20e('0x25')]=function(_0x12c9ab,_0x538f74){if(_0x12c9ab[_0xe20e('0x4e')]['id']){delete _0x12c9ab[_0xe20e('0x4e')]['id'];}return db['Disposition'][_0xe20e('0x4c')]({'where':{'id':_0x12c9ab[_0xe20e('0x55')]['id']}})[_0xe20e('0x26')](handleEntityNotFound(_0x538f74,null))['then'](saveUpdates(_0x12c9ab['body'],null))[_0xe20e('0x26')](respondWithResult(_0x538f74,null))[_0xe20e('0x49')](handleError(_0x538f74,null));};exports[_0xe20e('0x27')]=function(_0x49232d,_0x13c436){return db[_0xe20e('0x46')]['find']({'where':{'id':_0x49232d[_0xe20e('0x55')]['id']}})[_0xe20e('0x26')](handleEntityNotFound(_0x13c436,null))['then'](removeEntity(_0x13c436,null))[_0xe20e('0x49')](handleError(_0x13c436,null));}; \ No newline at end of file +var _0x2964=['include','findAll','rows','catch','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','set','json','apply','save','update','destroy','then','Dispositions','UserProfileResource','sendStatus','error','name','send','index','map','Disposition','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll'];(function(_0x31caf8,_0x11084f){var _0x4d9b84=function(_0x1eb747){while(--_0x1eb747){_0x31caf8['push'](_0x31caf8['shift']());}};_0x4d9b84(++_0x11084f);}(_0x2964,0xad));var _0x4296=function(_0x168584,_0x3dd38c){_0x168584=_0x168584-0x0;var _0x136d29=_0x2964[_0x168584];return _0x136d29;};'use strict';var pdf=require(_0x4296('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4296('0x1'));var zipdir=require(_0x4296('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4296('0x3'));var moment=require(_0x4296('0x4'));var BPromise=require(_0x4296('0x5'));var Mustache=require(_0x4296('0x6'));var util=require(_0x4296('0x7'));var path=require(_0x4296('0x8'));var sox=require('sox');var csv=require(_0x4296('0x9'));var ejs=require(_0x4296('0xa'));var fs=require('fs');var _=require(_0x4296('0xb'));var squel=require(_0x4296('0xc'));var crypto=require(_0x4296('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4296('0xe'));var toCsv=require(_0x4296('0x9'));var querystring=require(_0x4296('0xf'));var Papa=require(_0x4296('0x10'));var Redis=require('ioredis');var authService=require(_0x4296('0x11'));var qs=require(_0x4296('0x12'));var as=require(_0x4296('0x13'));var hardwareService=require(_0x4296('0x14'));var logger=require(_0x4296('0x15'))(_0x4296('0x16'));var utils=require(_0x4296('0x17'));var config=require(_0x4296('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ded07,_0x4d2833){_0x4d2833=_0x4d2833||0xcc;return function(_0x12a31f){if(_0x12a31f){return _0x5ded07['sendStatus'](_0x4d2833);}return _0x5ded07[_0x4296('0x19')](_0x4d2833)[_0x4296('0x1a')]();};}function respondWithResult(_0x14d918,_0x51525f){_0x51525f=_0x51525f||0xc8;return function(_0xe9d8d5){if(_0xe9d8d5){return _0x14d918[_0x4296('0x19')](_0x51525f)['json'](_0xe9d8d5);}};}function respondWithFilteredResult(_0x31f67c,_0x4794c1){return function(_0x8bb79d){if(_0x8bb79d){var _0x190d14=_0x8bb79d[_0x4296('0x1b')],_0x3157af=_0x4794c1[_0x4296('0x1c')],_0x1d4a47=_0x4794c1[_0x4296('0x1c')]+_0x4794c1[_0x4296('0x1d')],_0x450b61;if(_0x1d4a47>=_0x190d14){_0x1d4a47=_0x190d14;_0x450b61=0xc8;}else{_0x450b61=0xce;}_0x31f67c[_0x4296('0x19')](_0x450b61);return _0x31f67c[_0x4296('0x1e')]('Content-Range',_0x3157af+'-'+_0x1d4a47+'/'+_0x190d14)[_0x4296('0x1f')](_0x8bb79d);}return null;};}function patchUpdates(_0x45ed46){return function(_0x4ff83e){try{jsonpatch[_0x4296('0x20')](_0x4ff83e,_0x45ed46,!![]);}catch(_0x2ab65c){return BPromise['reject'](_0x2ab65c);}return _0x4ff83e[_0x4296('0x21')]();};}function saveUpdates(_0x70b535,_0x55369e){return function(_0xd796fc){if(_0xd796fc){return _0xd796fc[_0x4296('0x22')](_0x70b535)['then'](function(_0x34d702){return _0x34d702;});}return null;};}function removeEntity(_0x1a19b9,_0x425315){return function(_0x1afdc0){if(_0x1afdc0){return _0x1afdc0[_0x4296('0x23')]()[_0x4296('0x24')](function(){var _0x4a36b6=_0x1afdc0['get']({'plain':!![]});var _0x30e4ec=_0x4296('0x25');return db[_0x4296('0x26')][_0x4296('0x23')]({'where':{'type':_0x30e4ec,'resourceId':_0x4a36b6['id']}})[_0x4296('0x24')](function(){return _0x1afdc0;});})['then'](function(){_0x1a19b9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37a16f,_0x148646){return function(_0x203b7a){if(!_0x203b7a){_0x37a16f[_0x4296('0x27')](0x194);}return _0x203b7a;};}function handleError(_0x3437e0,_0x33d145){_0x33d145=_0x33d145||0x1f4;return function(_0x5a3142){logger[_0x4296('0x28')](_0x5a3142['stack']);if(_0x5a3142[_0x4296('0x29')]){delete _0x5a3142[_0x4296('0x29')];}_0x3437e0[_0x4296('0x19')](_0x33d145)[_0x4296('0x2a')](_0x5a3142);};}exports[_0x4296('0x2b')]=function(_0x25c13f,_0x33de35){var _0x57df96={},_0xb53f64={},_0x43f582={'count':0x0,'rows':[]};var _0x5465d1=_[_0x4296('0x2c')](db[_0x4296('0x2d')]['rawAttributes'],function(_0x2e623e){return{'name':_0x2e623e['fieldName'],'type':_0x2e623e['type']['key']};});_0xb53f64['model']=_[_0x4296('0x2c')](_0x5465d1,_0x4296('0x29'));_0xb53f64['query']=_[_0x4296('0x2e')](_0x25c13f[_0x4296('0x2f')]);_0xb53f64['filters']=_[_0x4296('0x30')](_0xb53f64[_0x4296('0x31')],_0xb53f64[_0x4296('0x2f')]);_0x57df96[_0x4296('0x32')]=_['intersection'](_0xb53f64[_0x4296('0x31')],qs['fields'](_0x25c13f['query'][_0x4296('0x33')]));_0x57df96[_0x4296('0x32')]=_0x57df96[_0x4296('0x32')]['length']?_0x57df96['attributes']:_0xb53f64[_0x4296('0x31')];if(!_0x25c13f[_0x4296('0x2f')][_0x4296('0x34')](_0x4296('0x35'))){_0x57df96[_0x4296('0x1d')]=qs[_0x4296('0x1d')](_0x25c13f[_0x4296('0x2f')]['limit']);_0x57df96[_0x4296('0x1c')]=qs[_0x4296('0x1c')](_0x25c13f[_0x4296('0x2f')][_0x4296('0x1c')]);}_0x57df96[_0x4296('0x36')]=qs[_0x4296('0x37')](_0x25c13f[_0x4296('0x2f')][_0x4296('0x37')]);_0x57df96[_0x4296('0x38')]=qs['filters'](_[_0x4296('0x39')](_0x25c13f[_0x4296('0x2f')],_0xb53f64[_0x4296('0x3a')]),_0x5465d1);if(_0x25c13f['query'][_0x4296('0x3b')]){_0x57df96[_0x4296('0x38')]=_[_0x4296('0x3c')](_0x57df96[_0x4296('0x38')],{'$or':_['map'](_0x5465d1,function(_0x4e81a9){if(_0x4e81a9['type']!==_0x4296('0x3d')){var _0x302104={};_0x302104[_0x4e81a9[_0x4296('0x29')]]={'$like':'%'+_0x25c13f[_0x4296('0x2f')][_0x4296('0x3b')]+'%'};return _0x302104;}})});}_0x57df96=_[_0x4296('0x3c')]({},_0x57df96,_0x25c13f[_0x4296('0x3e')]);var _0x26380b={'where':_0x57df96[_0x4296('0x38')]};return db[_0x4296('0x2d')][_0x4296('0x1b')](_0x26380b)['then'](function(_0x2759b9){_0x43f582[_0x4296('0x1b')]=_0x2759b9;if(_0x25c13f[_0x4296('0x2f')][_0x4296('0x3f')]){_0x57df96[_0x4296('0x40')]=[{'all':!![]}];}return db[_0x4296('0x2d')][_0x4296('0x41')](_0x57df96);})['then'](function(_0x30d88a){_0x43f582[_0x4296('0x42')]=_0x30d88a;return _0x43f582;})['then'](respondWithFilteredResult(_0x33de35,_0x57df96))[_0x4296('0x43')](handleError(_0x33de35,null));};exports[_0x4296('0x44')]=function(_0x1a641c,_0x29b524){var _0x10a91a={'raw':!![],'where':{'id':_0x1a641c[_0x4296('0x45')]['id']}},_0x21b8b8={};_0x21b8b8[_0x4296('0x31')]=_['keys'](db[_0x4296('0x2d')]['rawAttributes']);_0x21b8b8['query']=_[_0x4296('0x2e')](_0x1a641c[_0x4296('0x2f')]);_0x21b8b8[_0x4296('0x3a')]=_[_0x4296('0x30')](_0x21b8b8[_0x4296('0x31')],_0x21b8b8[_0x4296('0x2f')]);_0x10a91a[_0x4296('0x32')]=_[_0x4296('0x30')](_0x21b8b8['model'],qs[_0x4296('0x33')](_0x1a641c[_0x4296('0x2f')][_0x4296('0x33')]));_0x10a91a[_0x4296('0x32')]=_0x10a91a['attributes']['length']?_0x10a91a[_0x4296('0x32')]:_0x21b8b8[_0x4296('0x31')];if(_0x1a641c[_0x4296('0x2f')][_0x4296('0x3f')]){_0x10a91a[_0x4296('0x40')]=[{'all':!![]}];}_0x10a91a=_[_0x4296('0x3c')]({},_0x10a91a,_0x1a641c['options']);return db[_0x4296('0x2d')][_0x4296('0x46')](_0x10a91a)[_0x4296('0x24')](handleEntityNotFound(_0x29b524,null))[_0x4296('0x24')](respondWithResult(_0x29b524,null))[_0x4296('0x43')](handleError(_0x29b524,null));};exports[_0x4296('0x47')]=function(_0x4d71f9,_0x4cc3d2){return db['Disposition'][_0x4296('0x47')](_0x4d71f9[_0x4296('0x48')],{})[_0x4296('0x24')](function(_0x344a2f){var _0x48d9d1=_0x4d71f9['user'][_0x4296('0x49')]({'plain':!![]});if(!_0x48d9d1)throw new Error(_0x4296('0x4a'));if(_0x48d9d1[_0x4296('0x4b')]==='user'){var _0x4c7cce=_0x344a2f['get']({'plain':!![]});var _0x192d3b='Dispositions';return db[_0x4296('0x4c')][_0x4296('0x46')]({'where':{'name':_0x192d3b,'userProfileId':_0x48d9d1[_0x4296('0x4d')]},'raw':!![]})[_0x4296('0x24')](function(_0x1876bf){if(_0x1876bf&&_0x1876bf['autoAssociation']===0x0){return db[_0x4296('0x26')]['create']({'name':_0x4c7cce['name'],'resourceId':_0x4c7cce['id'],'type':_0x1876bf[_0x4296('0x29')],'sectionId':_0x1876bf['id']},{})[_0x4296('0x24')](function(){return _0x344a2f;});}else{return _0x344a2f;}})[_0x4296('0x43')](function(_0x496469){logger[_0x4296('0x28')](_0x4296('0x4e'),_0x496469);throw _0x496469;});}return _0x344a2f;})[_0x4296('0x24')](respondWithResult(_0x4cc3d2,0xc9))[_0x4296('0x43')](handleError(_0x4cc3d2,null));};exports[_0x4296('0x22')]=function(_0x3068a3,_0x4f0ca5){if(_0x3068a3[_0x4296('0x48')]['id']){delete _0x3068a3['body']['id'];}return db[_0x4296('0x2d')]['find']({'where':{'id':_0x3068a3[_0x4296('0x45')]['id']}})[_0x4296('0x24')](handleEntityNotFound(_0x4f0ca5,null))['then'](saveUpdates(_0x3068a3['body'],null))[_0x4296('0x24')](respondWithResult(_0x4f0ca5,null))[_0x4296('0x43')](handleError(_0x4f0ca5,null));};exports[_0x4296('0x23')]=function(_0x112690,_0x42caa1){return db[_0x4296('0x2d')][_0x4296('0x46')]({'where':{'id':_0x112690[_0x4296('0x45')]['id']}})['then'](handleEntityNotFound(_0x42caa1,null))[_0x4296('0x24')](removeEntity(_0x42caa1,null))['catch'](handleError(_0x42caa1,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index cd9a4d1..05953f7 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 _0x6e4e=['name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./disposition.attributes','exports','define','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x6e4e,0x103));var _0xe6e4=function(_0x400e0f,_0x3af578){_0x400e0f=_0x400e0f-0x0;var _0x24ca6f=_0x6e4e[_0x400e0f];return _0x24ca6f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe6e4('0x0'))(_0xe6e4('0x1'));var moment=require(_0xe6e4('0x2'));var BPromise=require(_0xe6e4('0x3'));var rp=require(_0xe6e4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe6e4('0x5'));var attributes=require(_0xe6e4('0x6'));module[_0xe6e4('0x7')]=function(_0x16b6ad,_0x1bf562){return _0x16b6ad[_0xe6e4('0x8')]('Disposition',attributes,{'tableName':_0xe6e4('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xe6e4('0xa'),'fields':[_0xe6e4('0xb'),_0xe6e4('0xc')]},{'unique':!![],'name':_0xe6e4('0xd'),'fields':[_0xe6e4('0xb'),_0xe6e4('0xe')]},{'unique':!![],'name':_0xe6e4('0xf'),'fields':[_0xe6e4('0xb'),_0xe6e4('0x10')]},{'unique':!![],'name':_0xe6e4('0x11'),'fields':[_0xe6e4('0xb'),'SmsAccountId']},{'unique':!![],'name':_0xe6e4('0x12'),'fields':['name',_0xe6e4('0x13')]},{'unique':!![],'name':_0xe6e4('0x14'),'fields':['name',_0xe6e4('0x15')]},{'unique':!![],'name':_0xe6e4('0x16'),'fields':[_0xe6e4('0xb'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e05=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger'];(function(_0x1a296c,_0x488a85){var _0x267854=function(_0x1bbe2b){while(--_0x1bbe2b){_0x1a296c['push'](_0x1a296c['shift']());}};_0x267854(++_0x488a85);}(_0x8e05,0xba));var _0x58e0=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0x8e05[_0x329664];return _0x4e346e;};'use strict';var _=require(_0x58e0('0x0'));var util=require(_0x58e0('0x1'));var logger=require(_0x58e0('0x2'))(_0x58e0('0x3'));var moment=require(_0x58e0('0x4'));var BPromise=require(_0x58e0('0x5'));var rp=require(_0x58e0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x58e0('0x7'));var config=require(_0x58e0('0x8'));var attributes=require(_0x58e0('0x9'));module[_0x58e0('0xa')]=function(_0x15ad3f,_0x206d76){return _0x15ad3f[_0x58e0('0xb')](_0x58e0('0xc'),attributes,{'tableName':_0x58e0('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x58e0('0xe'),'fields':['name',_0x58e0('0xf')]},{'unique':!![],'name':_0x58e0('0x10'),'fields':[_0x58e0('0x11'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x58e0('0x11'),_0x58e0('0x12')]},{'unique':!![],'name':_0x58e0('0x13'),'fields':[_0x58e0('0x11'),_0x58e0('0x14')]},{'unique':!![],'name':_0x58e0('0x15'),'fields':[_0x58e0('0x11'),_0x58e0('0x16')]},{'unique':!![],'name':_0x58e0('0x17'),'fields':['name',_0x58e0('0x18')]},{'unique':!![],'name':_0x58e0('0x19'),'fields':[_0x58e0('0x11'),_0x58e0('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 3f22f11..b941fcd 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 _0xb835=['../../config/environment','jayson/promise','request','then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5de61c,_0x19f18a){var _0x72d378=function(_0x1d04cf){while(--_0x1d04cf){_0x5de61c['push'](_0x5de61c['shift']());}};_0x72d378(++_0x19f18a);}(_0xb835,0xa8));var _0x5b83=function(_0x2cd81e,_0x1143d5){_0x2cd81e=_0x2cd81e-0x0;var _0x1c0c03=_0xb835[_0x2cd81e];return _0x1c0c03;};'use strict';var _=require('lodash');var util=require(_0x5b83('0x0'));var moment=require('moment');var BPromise=require(_0x5b83('0x1'));var rs=require(_0x5b83('0x2'));var fs=require('fs');var Redis=require(_0x5b83('0x3'));var db=require(_0x5b83('0x4'))['db'];var utils=require(_0x5b83('0x5'));var logger=require(_0x5b83('0x6'))(_0x5b83('0x7'));var config=require(_0x5b83('0x8'));var jayson=require(_0x5b83('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49ecac,_0x482aa2,_0x405627){return new BPromise(function(_0xf17adb,_0x5d68b4){return client[_0x5b83('0xa')](_0x49ecac,_0x405627)[_0x5b83('0xb')](function(_0x295120){logger[_0x5b83('0xc')](_0x5b83('0xd'),_0x482aa2,_0x5b83('0xe'));logger[_0x5b83('0xf')](_0x5b83('0x10'),_0x482aa2,_0x5b83('0xe'),JSON[_0x5b83('0x11')](_0x295120));if(_0x295120['error']){if(_0x295120['error'][_0x5b83('0x12')]===0x1f4){logger[_0x5b83('0x13')](_0x5b83('0xd'),_0x482aa2,_0x295120[_0x5b83('0x13')][_0x5b83('0x14')]);return _0x5d68b4(_0x295120['error'][_0x5b83('0x14')]);}logger[_0x5b83('0x13')](_0x5b83('0xd'),_0x482aa2,_0x295120[_0x5b83('0x13')]['message']);return _0xf17adb(_0x295120[_0x5b83('0x13')][_0x5b83('0x14')]);}else{logger[_0x5b83('0xc')]('Disposition,\x20%s,\x20%s',_0x482aa2,_0x5b83('0xe'));_0xf17adb(_0x295120['result'][_0x5b83('0x14')]);}})[_0x5b83('0x15')](function(_0x1f17dc){logger['error'](_0x5b83('0xd'),_0x482aa2,_0x1f17dc);_0x5d68b4(_0x1f17dc);});});} \ No newline at end of file +var _0x2fa0=['debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Disposition,\x20%s,\x20%s','request\x20sent'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2fa0,0xf8));var _0x02fa=function(_0x20e90f,_0x1330f6){_0x20e90f=_0x20e90f-0x0;var _0x1a16e8=_0x2fa0[_0x20e90f];return _0x1a16e8;};'use strict';var _=require('lodash');var util=require(_0x02fa('0x0'));var moment=require('moment');var BPromise=require(_0x02fa('0x1'));var rs=require(_0x02fa('0x2'));var fs=require('fs');var Redis=require(_0x02fa('0x3'));var db=require(_0x02fa('0x4'))['db'];var utils=require(_0x02fa('0x5'));var logger=require(_0x02fa('0x6'))(_0x02fa('0x7'));var config=require(_0x02fa('0x8'));var jayson=require(_0x02fa('0x9'));var client=jayson[_0x02fa('0xa')][_0x02fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x147b4e,_0x3b9dd9,_0x367863){return new BPromise(function(_0x2c89c6,_0x201606){return client['request'](_0x147b4e,_0x367863)[_0x02fa('0xc')](function(_0x577f29){logger[_0x02fa('0xd')](_0x02fa('0xe'),_0x3b9dd9,_0x02fa('0xf'));logger[_0x02fa('0x10')](_0x02fa('0x11'),_0x3b9dd9,_0x02fa('0xf'),JSON[_0x02fa('0x12')](_0x577f29));if(_0x577f29[_0x02fa('0x13')]){if(_0x577f29[_0x02fa('0x13')][_0x02fa('0x14')]===0x1f4){logger['error'](_0x02fa('0xe'),_0x3b9dd9,_0x577f29[_0x02fa('0x13')][_0x02fa('0x15')]);return _0x201606(_0x577f29[_0x02fa('0x13')][_0x02fa('0x15')]);}logger['error'](_0x02fa('0xe'),_0x3b9dd9,_0x577f29[_0x02fa('0x13')][_0x02fa('0x15')]);return _0x2c89c6(_0x577f29[_0x02fa('0x13')][_0x02fa('0x15')]);}else{logger[_0x02fa('0xd')](_0x02fa('0xe'),_0x3b9dd9,'request\x20sent');_0x2c89c6(_0x577f29[_0x02fa('0x16')][_0x02fa('0x15')]);}})[_0x02fa('0x17')](function(_0x78a34d){logger[_0x02fa('0x13')](_0x02fa('0xe'),_0x3b9dd9,_0x78a34d);_0x201606(_0x78a34d);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 3032cb3..18d78d9 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 _0x8861=['index','/:id','show','put','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8861,0x6d));var _0x1886=function(_0x5299db,_0x4da9ad){_0x5299db=_0x5299db-0x0;var _0x2251f8=_0x8861[_0x5299db];return _0x2251f8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1886('0x0'));var timeout=require(_0x1886('0x1'));var express=require(_0x1886('0x2'));var router=express[_0x1886('0x3')]();var auth=require(_0x1886('0x4'));var interaction=require(_0x1886('0x5'));var config=require(_0x1886('0x6'));var controller=require(_0x1886('0x7'));router[_0x1886('0x8')]('/',auth[_0x1886('0x9')](),controller[_0x1886('0xa')]);router[_0x1886('0x8')](_0x1886('0xb'),auth[_0x1886('0x9')](),controller[_0x1886('0xc')]);router['post']('/',auth[_0x1886('0x9')](),controller['create']);router[_0x1886('0xd')]('/:id',auth[_0x1886('0x9')](),controller['update']);router[_0x1886('0xe')](_0x1886('0xb'),auth[_0x1886('0x9')](),controller[_0x1886('0xf')]);module[_0x1886('0x10')]=router; \ No newline at end of file +var _0x3f48=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x3f48,0x17c));var _0x83f4=function(_0x5e5b65,_0x233c82){_0x5e5b65=_0x5e5b65-0x0;var _0xd03387=_0x3f48[_0x5e5b65];return _0xd03387;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x83f4('0x0'));var timeout=require(_0x83f4('0x1'));var express=require(_0x83f4('0x2'));var router=express[_0x83f4('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x83f4('0x4'));var config=require(_0x83f4('0x5'));var controller=require('./disposition.controller');router[_0x83f4('0x6')]('/',auth['isAuthenticated'](),controller[_0x83f4('0x7')]);router[_0x83f4('0x6')](_0x83f4('0x8'),auth[_0x83f4('0x9')](),controller[_0x83f4('0xa')]);router[_0x83f4('0xb')]('/',auth[_0x83f4('0x9')](),controller[_0x83f4('0xc')]);router['put'](_0x83f4('0x8'),auth[_0x83f4('0x9')](),controller[_0x83f4('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x83f4('0xe')]);module[_0x83f4('0xf')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 543e582..89c7219 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 _0xfe95=['4800','7200','9600','12000','2400','14400','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','yes','xCALLY\x20Motion\x20Fax','localstationid','ENUM'];(function(_0x57306c,_0xdeff85){var _0x413cfb=function(_0x31c65b){while(--_0x31c65b){_0x57306c['push'](_0x57306c['shift']());}};_0x413cfb(++_0xdeff85);}(_0xfe95,0x1e7));var _0x5fe9=function(_0x4178af,_0x388652){_0x4178af=_0x4178af-0x0;var _0x20f4b1=_0xfe95[_0x4178af];return _0x20f4b1;};'use strict';var Sequelize=require(_0x5fe9('0x0'));module[_0x5fe9('0x1')]={'name':{'type':Sequelize[_0x5fe9('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x5fe9('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x5fe9('0x4')},'localstationid':{'type':Sequelize[_0x5fe9('0x2')],'unique':_0x5fe9('0x5')},'minrate':{'type':Sequelize[_0x5fe9('0x6')]('2400',_0x5fe9('0x7'),_0x5fe9('0x8'),_0x5fe9('0x9'),_0x5fe9('0xa'),'14400'),'defaultValue':_0x5fe9('0x7')},'maxrate':{'type':Sequelize[_0x5fe9('0x6')](_0x5fe9('0xb'),'4800',_0x5fe9('0x8'),'9600','12000','14400'),'defaultValue':_0x5fe9('0xc')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x5fe9('0xd')},'gateway':{'type':Sequelize[_0x5fe9('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5fe9('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x5fe9('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5fe9('0x6')]('SIP',_0x5fe9('0xf'),_0x5fe9('0x10'),_0x5fe9('0x11')),'defaultValue':_0x5fe9('0x12')},'key':{'type':Sequelize[_0x5fe9('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5fe9('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5fe9('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5fe9('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5fe9('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5fe9('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5fe9('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5fe9('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5fe9('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x5fe9('0x15')},'mandatoryDisposition':{'type':Sequelize[_0x5fe9('0x14')],'defaultValue':![],'comment':_0x5fe9('0x16'),'set':function(_0x23afa9){if(!_0x23afa9)this[_0x5fe9('0x17')](_0x5fe9('0x18'),null);this[_0x5fe9('0x17')](_0x5fe9('0x19'),_0x23afa9);}}}; \ No newline at end of file +var _0xf365=['yes','xCALLY\x20Motion\x20Fax','localstationid','7200','12000','14400','4800','2400','9600','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM'];(function(_0x2f029a,_0x52a6a5){var _0x17acb2=function(_0x534bff){while(--_0x534bff){_0x2f029a['push'](_0x2f029a['shift']());}};_0x17acb2(++_0x52a6a5);}(_0xf365,0x1a6));var _0x5f36=function(_0x5b1003,_0x4bfeb9){_0x5b1003=_0x5b1003-0x0;var _0x4a3ca8=_0xf365[_0x5b1003];return _0x4a3ca8;};'use strict';var Sequelize=require(_0x5f36('0x0'));module['exports']={'name':{'type':Sequelize[_0x5f36('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5f36('0x1')]},'ecm':{'type':Sequelize[_0x5f36('0x2')](_0x5f36('0x3'),'no'),'defaultValue':_0x5f36('0x3')},'headerinfo':{'type':Sequelize[_0x5f36('0x1')],'defaultValue':_0x5f36('0x4')},'localstationid':{'type':Sequelize[_0x5f36('0x1')],'unique':_0x5f36('0x5')},'minrate':{'type':Sequelize[_0x5f36('0x2')]('2400','4800',_0x5f36('0x6'),'9600',_0x5f36('0x7'),_0x5f36('0x8')),'defaultValue':_0x5f36('0x9')},'maxrate':{'type':Sequelize['ENUM'](_0x5f36('0xa'),_0x5f36('0x9'),_0x5f36('0x6'),_0x5f36('0xb'),_0x5f36('0x7'),_0x5f36('0x8')),'defaultValue':_0x5f36('0x8')},'modem':{'type':Sequelize[_0x5f36('0x1')],'defaultValue':_0x5f36('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5f36('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x5f36('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5f36('0x2')]('SIP',_0x5f36('0xe'),_0x5f36('0xf'),_0x5f36('0x10')),'defaultValue':_0x5f36('0x11')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5f36('0x12')],'defaultValue':function(){return _0x5f36('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5f36('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5f36('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5f36('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5f36('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5f36('0x14')],'defaultValue':![],'comment':_0x5f36('0x15'),'set':function(_0x6286e8){if(!_0x6286e8)this[_0x5f36('0x16')](_0x5f36('0x17'),null);this[_0x5f36('0x16')](_0x5f36('0x18'),_0x6286e8);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 4cab747..70df53c 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 _0x4a93=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','getDispositions','nolimit','removeDispositions','ids','CannedAnswer','findOne','removeAnswers','FaxInteraction','omit','hasOwnProperty','CmContact','Contact','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','ecm','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','createdAt','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','List','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','Sequelize','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','send','Pause','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','FaxAccount','count','includeAll','findAll','rows','show','params','mandatoryDispositionPause','length','include','create','body'];(function(_0x19c25e,_0x521038){var _0x3b9c28=function(_0xdcb1dd){while(--_0xdcb1dd){_0x19c25e['push'](_0x19c25e['shift']());}};_0x3b9c28(++_0x521038);}(_0x4a93,0x122));var _0x34a9=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x4a93[_0x3e44fa];return _0x2a0aba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x34a9('0x0'));var rimraf=require(_0x34a9('0x1'));var zipdir=require(_0x34a9('0x2'));var jsonpatch=require(_0x34a9('0x3'));var rp=require(_0x34a9('0x4'));var moment=require('moment');var BPromise=require(_0x34a9('0x5'));var Mustache=require(_0x34a9('0x6'));var util=require('util');var path=require(_0x34a9('0x7'));var sox=require(_0x34a9('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x34a9('0x9'));var squel=require(_0x34a9('0xa'));var crypto=require(_0x34a9('0xb'));var jsforce=require(_0x34a9('0xc'));var deskjs=require(_0x34a9('0xd'));var toCsv=require(_0x34a9('0xe'));var querystring=require(_0x34a9('0xf'));var Papa=require(_0x34a9('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x34a9('0x11'));var as=require(_0x34a9('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x34a9('0x13'))('api');var utils=require(_0x34a9('0x14'));var config=require(_0x34a9('0x15'));var db=require(_0x34a9('0x16'))['db'];config[_0x34a9('0x17')]=_[_0x34a9('0x18')](config[_0x34a9('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x34a9('0x19'))(new Redis(config[_0x34a9('0x17')]));require(_0x34a9('0x1a'))[_0x34a9('0x1b')](socket);var jayson=require(_0x34a9('0x1c'));var client=jayson[_0x34a9('0x1d')]['http']({'port':0x232c});var client9002=jayson['client'][_0x34a9('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x44755b,_0xbd5cc2,_0x59b0f4){if(_0x59b0f4){var _0x1f5428=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1f5428['test'](_0xbd5cc2)){return _0x44755b;}else{throw new db[(_0x34a9('0x1f'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0x44755b;}}function respondWithRpcPromise(_0xc1e957,_0x45e40c,_0x2d9b39,_0x1c967a){return new BPromise(function(_0x3b97ea,_0x29f456){var _0x3e2e74=_0x1c967a||client;return _0x3e2e74['request'](_0xc1e957,_0x2d9b39)[_0x34a9('0x20')](function(_0x4dc8d0){logger['info'](_0x34a9('0x21'),_0x45e40c,_0x34a9('0x22'));logger[_0x34a9('0x23')](_0x34a9('0x24'),_0x45e40c,_0x34a9('0x22'),JSON[_0x34a9('0x25')](_0x4dc8d0));if(_0x4dc8d0[_0x34a9('0x26')]){if(_0x4dc8d0[_0x34a9('0x26')]['code']===0x1f4){logger[_0x34a9('0x26')](_0x34a9('0x21'),_0x45e40c,_0x4dc8d0[_0x34a9('0x26')][_0x34a9('0x27')]);return _0x29f456(_0x4dc8d0[_0x34a9('0x26')]['message']);}logger[_0x34a9('0x26')]('FaxAccount,\x20%s,\x20%s',_0x45e40c,_0x4dc8d0[_0x34a9('0x26')]['message']);return _0x3b97ea(_0x4dc8d0[_0x34a9('0x26')]['message']);}else{logger[_0x34a9('0x28')](_0x34a9('0x21'),_0x45e40c,_0x34a9('0x22'));_0x3b97ea(_0x4dc8d0[_0x34a9('0x29')]['message']);}})[_0x34a9('0x2a')](function(_0x56dca2){logger[_0x34a9('0x26')](_0x34a9('0x21'),_0x45e40c,_0x56dca2);_0x29f456(_0x56dca2);});});}function respondWithStatusCode(_0x13d33e,_0x294b9c){_0x294b9c=_0x294b9c||0xcc;return function(_0x55b7ba){if(_0x55b7ba){return _0x13d33e[_0x34a9('0x2b')](_0x294b9c);}return _0x13d33e[_0x34a9('0x2c')](_0x294b9c)[_0x34a9('0x2d')]();};}function respondWithResult(_0x13f119,_0x19a0fb){_0x19a0fb=_0x19a0fb||0xc8;return function(_0x54a22c){if(_0x54a22c){return _0x13f119['status'](_0x19a0fb)[_0x34a9('0x2e')](_0x54a22c);}};}function respondWithFilteredResult(_0x5adf61,_0x49afe4){return function(_0x438fb8){if(_0x438fb8){var _0x571305=_0x438fb8['count'],_0x47537c=_0x49afe4[_0x34a9('0x2f')],_0x226467=_0x49afe4[_0x34a9('0x2f')]+_0x49afe4['limit'],_0x5bc409;if(_0x226467>=_0x571305){_0x226467=_0x571305;_0x5bc409=0xc8;}else{_0x5bc409=0xce;}_0x5adf61[_0x34a9('0x2c')](_0x5bc409);return _0x5adf61[_0x34a9('0x30')](_0x34a9('0x31'),_0x47537c+'-'+_0x226467+'/'+_0x571305)[_0x34a9('0x2e')](_0x438fb8);}return null;};}function patchUpdates(_0x506039){return function(_0x1c485d){try{jsonpatch[_0x34a9('0x32')](_0x1c485d,_0x506039,!![]);}catch(_0x21c0e7){return BPromise['reject'](_0x21c0e7);}return _0x1c485d[_0x34a9('0x33')]();};}function saveUpdates(_0x569b25,_0x5e9345){return function(_0x3e179b){if(_0x3e179b){return _0x3e179b[_0x34a9('0x34')](_0x569b25)[_0x34a9('0x20')](function(_0x5efa76){return _0x5efa76;});}return null;};}function removeEntity(_0x3b7bb6,_0x362452){return function(_0x409e4f){if(_0x409e4f){return _0x409e4f[_0x34a9('0x35')]()[_0x34a9('0x20')](function(){var _0x57979a=_0x409e4f[_0x34a9('0x36')]({'plain':!![]});var _0x26c9b6=_0x34a9('0x37');return db[_0x34a9('0x38')][_0x34a9('0x35')]({'where':{'type':_0x26c9b6,'resourceId':_0x57979a['id']}})['then'](function(){return _0x409e4f;});})[_0x34a9('0x20')](function(){_0x3b7bb6[_0x34a9('0x2c')](0xcc)[_0x34a9('0x2d')]();});}};}function handleEntityNotFound(_0x511754,_0x443b22){return function(_0x2f1b49){if(!_0x2f1b49){_0x511754[_0x34a9('0x2b')](0x194);}return _0x2f1b49;};}function handleError(_0x2e954c,_0x5bfb19){_0x5bfb19=_0x5bfb19||0x1f4;return function(_0x5ab124){logger[_0x34a9('0x26')](_0x5ab124[_0x34a9('0x39')]);if(_0x5ab124[_0x34a9('0x3a')]){delete _0x5ab124[_0x34a9('0x3a')];}_0x2e954c['status'](_0x5bfb19)[_0x34a9('0x3b')](_0x5ab124);};}exports['index']=function(_0x4e47a6,_0x280b9d){var _0x37ea5b={'include':[{'model':db[_0x34a9('0x3c')],'as':'mandatoryDispositionPause'}]},_0x472c90={},_0x775766={'count':0x0,'rows':[]};var _0x5e6460=_[_0x34a9('0x3d')](db['FaxAccount'][_0x34a9('0x3e')],function(_0x4a8cd3){return{'name':_0x4a8cd3[_0x34a9('0x3f')],'type':_0x4a8cd3[_0x34a9('0x40')][_0x34a9('0x41')]};});_0x472c90[_0x34a9('0x42')]=_[_0x34a9('0x3d')](_0x5e6460,'name');_0x472c90['query']=_[_0x34a9('0x43')](_0x4e47a6['query']);_0x472c90[_0x34a9('0x44')]=_[_0x34a9('0x45')](_0x472c90[_0x34a9('0x42')],_0x472c90[_0x34a9('0x46')]);_0x37ea5b[_0x34a9('0x47')]=_[_0x34a9('0x45')](_0x472c90[_0x34a9('0x42')],qs['fields'](_0x4e47a6['query'][_0x34a9('0x48')]));_0x37ea5b[_0x34a9('0x47')]=_0x37ea5b[_0x34a9('0x47')]['length']?_0x37ea5b[_0x34a9('0x47')]:_0x472c90[_0x34a9('0x42')];if(!_0x4e47a6[_0x34a9('0x46')]['hasOwnProperty']('nolimit')){_0x37ea5b[_0x34a9('0x49')]=qs[_0x34a9('0x49')](_0x4e47a6['query']['limit']);_0x37ea5b['offset']=qs[_0x34a9('0x2f')](_0x4e47a6[_0x34a9('0x46')][_0x34a9('0x2f')]);}_0x37ea5b[_0x34a9('0x4a')]=qs[_0x34a9('0x4b')](_0x4e47a6[_0x34a9('0x46')][_0x34a9('0x4b')]);_0x37ea5b['where']=qs['filters'](_[_0x34a9('0x4c')](_0x4e47a6[_0x34a9('0x46')],_0x472c90['filters']),_0x5e6460);if(_0x4e47a6[_0x34a9('0x46')][_0x34a9('0x4d')]){_0x37ea5b['where']=_[_0x34a9('0x4e')](_0x37ea5b[_0x34a9('0x4f')],{'$or':_[_0x34a9('0x3d')](_0x5e6460,function(_0x24a873){if(_0x24a873[_0x34a9('0x40')]!==_0x34a9('0x50')){var _0x15984e={};_0x15984e[_0x24a873[_0x34a9('0x3a')]]={'$like':'%'+_0x4e47a6[_0x34a9('0x46')][_0x34a9('0x4d')]+'%'};return _0x15984e;}})});}_0x37ea5b=_[_0x34a9('0x4e')]({},_0x37ea5b,_0x4e47a6[_0x34a9('0x51')]);var _0x113c49={'where':_0x37ea5b[_0x34a9('0x4f')]};return db[_0x34a9('0x52')]['count'](_0x113c49)[_0x34a9('0x20')](function(_0x197217){_0x775766[_0x34a9('0x53')]=_0x197217;if(_0x4e47a6['query'][_0x34a9('0x54')]){_0x37ea5b['include']=[{'all':!![]}];}return db[_0x34a9('0x52')][_0x34a9('0x55')](_0x37ea5b);})[_0x34a9('0x20')](function(_0xdbd9c8){_0x775766[_0x34a9('0x56')]=_0xdbd9c8;return _0x775766;})['then'](respondWithFilteredResult(_0x280b9d,_0x37ea5b))['catch'](handleError(_0x280b9d,null));};exports[_0x34a9('0x57')]=function(_0xa310da,_0x20cd03){var _0x284675={'raw':![],'where':{'id':_0xa310da[_0x34a9('0x58')]['id']},'include':[{'model':db[_0x34a9('0x3c')],'as':_0x34a9('0x59')}]},_0x3f0537={};_0x3f0537[_0x34a9('0x42')]=_['keys'](db[_0x34a9('0x52')]['rawAttributes']);_0x3f0537[_0x34a9('0x46')]=_['keys'](_0xa310da[_0x34a9('0x46')]);_0x3f0537['filters']=_[_0x34a9('0x45')](_0x3f0537[_0x34a9('0x42')],_0x3f0537[_0x34a9('0x46')]);_0x284675[_0x34a9('0x47')]=_[_0x34a9('0x45')](_0x3f0537['model'],qs[_0x34a9('0x48')](_0xa310da[_0x34a9('0x46')][_0x34a9('0x48')]));_0x284675[_0x34a9('0x47')]=_0x284675[_0x34a9('0x47')][_0x34a9('0x5a')]?_0x284675[_0x34a9('0x47')]:_0x3f0537[_0x34a9('0x42')];if(_0xa310da[_0x34a9('0x46')]['includeAll']){_0x284675[_0x34a9('0x5b')]=[{'all':!![]}];}_0x284675=_[_0x34a9('0x4e')]({},_0x284675,_0xa310da['options']);return db[_0x34a9('0x52')]['find'](_0x284675)[_0x34a9('0x20')](handleEntityNotFound(_0x20cd03,null))[_0x34a9('0x20')](respondWithResult(_0x20cd03,null))[_0x34a9('0x2a')](handleError(_0x20cd03,null));};exports[_0x34a9('0x5c')]=function(_0x3437be,_0x168a79){return db[_0x34a9('0x52')][_0x34a9('0x5c')](_0x3437be[_0x34a9('0x5d')],{})[_0x34a9('0x20')](function(_0x2e85a9){var _0x3cad6f=_0x3437be[_0x34a9('0x5e')][_0x34a9('0x36')]({'plain':!![]});if(!_0x3cad6f)throw new Error(_0x34a9('0x5f'));if(_0x3cad6f[_0x34a9('0x60')]===_0x34a9('0x5e')){var _0x150f0f=_0x2e85a9[_0x34a9('0x36')]({'plain':!![]});var _0x47dbd9=_0x34a9('0x37');return db['UserProfileSection'][_0x34a9('0x61')]({'where':{'name':_0x47dbd9,'userProfileId':_0x3cad6f[_0x34a9('0x62')]},'raw':!![]})[_0x34a9('0x20')](function(_0x1dbb6f){if(_0x1dbb6f&&_0x1dbb6f[_0x34a9('0x63')]===0x0){return db['UserProfileResource'][_0x34a9('0x5c')]({'name':_0x150f0f[_0x34a9('0x3a')],'resourceId':_0x150f0f['id'],'type':_0x1dbb6f[_0x34a9('0x3a')],'sectionId':_0x1dbb6f['id']},{})[_0x34a9('0x20')](function(){return _0x2e85a9;});}else{return _0x2e85a9;}})[_0x34a9('0x2a')](function(_0x48e48b){logger[_0x34a9('0x26')](_0x34a9('0x64'),_0x48e48b);throw _0x48e48b;});}return _0x2e85a9;})['then'](respondWithResult(_0x168a79,0xc9))[_0x34a9('0x2a')](handleError(_0x168a79,null));};exports[_0x34a9('0x34')]=function(_0x25ae43,_0x194b48){if(_0x25ae43['body']['id']){delete _0x25ae43[_0x34a9('0x5d')]['id'];}return db[_0x34a9('0x52')][_0x34a9('0x61')]({'where':{'id':_0x25ae43['params']['id']},'include':[{'model':db['Pause'],'as':_0x34a9('0x59')}]})['then'](handleEntityNotFound(_0x194b48,null))[_0x34a9('0x20')](saveUpdates(_0x25ae43[_0x34a9('0x5d')],null))[_0x34a9('0x20')](respondWithResult(_0x194b48,null))['catch'](handleError(_0x194b48,null));};exports[_0x34a9('0x35')]=function(_0x21fd85,_0x2be01e){return db[_0x34a9('0x52')][_0x34a9('0x61')]({'where':{'id':_0x21fd85[_0x34a9('0x58')]['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0x2be01e,null))[_0x34a9('0x20')](removeEntity(_0x2be01e,null))['catch'](handleError(_0x2be01e,null));};exports[_0x34a9('0x65')]=function(_0x5e3134,_0x15dc5e){return db['FaxAccount'][_0x34a9('0x65')]()[_0x34a9('0x20')](respondWithResult(_0x15dc5e,null))[_0x34a9('0x2a')](handleError(_0x15dc5e,null));};exports[_0x34a9('0x66')]=function(_0x2d2c78,_0x6929eb,_0x80f511){if(_0x2d2c78['body']['id']){delete _0x2d2c78['body']['id'];}return db[_0x34a9('0x52')][_0x34a9('0x61')]({'where':{'id':_0x2d2c78[_0x34a9('0x58')]['id']}})['then'](handleEntityNotFound(_0x6929eb,null))['then'](function(_0x5956aa){if(_0x5956aa){_0x2d2c78[_0x34a9('0x5d')][_0x34a9('0x67')]=_0x5956aa['id'];return db[_0x34a9('0x68')][_0x34a9('0x5c')](_0x2d2c78[_0x34a9('0x5d')]);}})[_0x34a9('0x20')](respondWithResult(_0x6929eb,null))[_0x34a9('0x2a')](handleError(_0x6929eb,null));};exports[_0x34a9('0x69')]=function(_0x18b1fe,_0x27f7a9,_0x56a1df){var _0x5cedcd={'raw':![],'where':{}};var _0x10046c={};var _0x1d6554={'count':0x0,'rows':[]};return db[_0x34a9('0x52')]['findOne']({'where':{'id':_0x18b1fe[_0x34a9('0x58')]['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0x27f7a9,null))[_0x34a9('0x20')](function(_0x31d6f1){if(_0x31d6f1){_0x10046c[_0x34a9('0x42')]=_[_0x34a9('0x43')](db[_0x34a9('0x68')][_0x34a9('0x3e')]);_0x10046c[_0x34a9('0x46')]=_[_0x34a9('0x43')](_0x18b1fe['query']);_0x10046c[_0x34a9('0x44')]=_[_0x34a9('0x45')](_0x10046c[_0x34a9('0x42')],_0x10046c[_0x34a9('0x46')]);_0x5cedcd[_0x34a9('0x47')]=_[_0x34a9('0x45')](_0x10046c[_0x34a9('0x42')],qs[_0x34a9('0x48')](_0x18b1fe['query']['fields']));_0x5cedcd[_0x34a9('0x47')]=_0x5cedcd[_0x34a9('0x47')]['length']?_0x5cedcd[_0x34a9('0x47')]:_0x10046c[_0x34a9('0x42')];if(!_0x18b1fe['query']['hasOwnProperty'](_0x34a9('0x6a'))){_0x5cedcd[_0x34a9('0x49')]=qs[_0x34a9('0x49')](_0x18b1fe[_0x34a9('0x46')][_0x34a9('0x49')]);_0x5cedcd[_0x34a9('0x2f')]=qs[_0x34a9('0x2f')](_0x18b1fe[_0x34a9('0x46')][_0x34a9('0x2f')]);}_0x5cedcd['order']=qs[_0x34a9('0x4b')](_0x18b1fe['query'][_0x34a9('0x4b')]);_0x5cedcd[_0x34a9('0x4f')]=qs[_0x34a9('0x44')](_[_0x34a9('0x4c')](_0x18b1fe['query'],_0x10046c['filters']));_0x5cedcd[_0x34a9('0x4f')]['FaxAccountId']=_0x31d6f1['id'];if(_0x18b1fe[_0x34a9('0x46')][_0x34a9('0x4d')]){_0x5cedcd[_0x34a9('0x4f')]=_['merge'](_0x5cedcd['where'],{'$or':_['map'](_0x5cedcd['attributes'],function(_0x4747cd){var _0x5339cd={};_0x5339cd[_0x4747cd]={'$like':'%'+_0x18b1fe[_0x34a9('0x46')][_0x34a9('0x4d')]+'%'};return _0x5339cd;})});}_0x5cedcd=_[_0x34a9('0x4e')]({},_0x5cedcd,_0x18b1fe[_0x34a9('0x51')]);return db[_0x34a9('0x68')][_0x34a9('0x53')]({'where':_0x5cedcd[_0x34a9('0x4f')]})['then'](function(_0x555291){_0x1d6554[_0x34a9('0x53')]=_0x555291;if(_0x18b1fe[_0x34a9('0x46')][_0x34a9('0x54')]){_0x5cedcd[_0x34a9('0x5b')]=[{'all':!![]}];}return db[_0x34a9('0x68')]['findAll'](_0x5cedcd);})[_0x34a9('0x20')](function(_0x437779){_0x1d6554['rows']=_0x437779;return _0x1d6554;});}})[_0x34a9('0x20')](respondWithFilteredResult(_0x27f7a9,_0x5cedcd))['catch'](handleError(_0x27f7a9,null));};exports[_0x34a9('0x6b')]=function(_0x13c57b,_0xce95be,_0x4f4529){return db[_0x34a9('0x52')][_0x34a9('0x61')]({'where':{'id':_0x13c57b['params']['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0xce95be,null))[_0x34a9('0x20')](function(_0x179224){if(_0x179224){return _0x179224[_0x34a9('0x6b')](_0x13c57b[_0x34a9('0x46')][_0x34a9('0x6c')]);}})[_0x34a9('0x20')](respondWithStatusCode(_0xce95be,null))[_0x34a9('0x2a')](handleError(_0xce95be,null));};exports['addAnswer']=function(_0x44b296,_0x1169d4,_0x1a4fc4){if(_0x44b296[_0x34a9('0x5d')]['id']){delete _0x44b296[_0x34a9('0x5d')]['id'];}return db[_0x34a9('0x52')][_0x34a9('0x61')]({'where':{'id':_0x44b296[_0x34a9('0x58')]['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0x1169d4,null))['then'](function(_0x3f668f){if(_0x3f668f){_0x44b296['body'][_0x34a9('0x67')]=_0x3f668f['id'];return db[_0x34a9('0x6d')][_0x34a9('0x5c')](_0x44b296[_0x34a9('0x5d')]);}})[_0x34a9('0x20')](respondWithResult(_0x1169d4,null))['catch'](handleError(_0x1169d4,null));};exports['getAnswers']=function(_0x4f2c88,_0x12e0a3,_0x36fa09){var _0x4e35c2={'raw':![],'where':{}};var _0x29fc1c={};var _0x49dd37={'count':0x0,'rows':[]};return db[_0x34a9('0x52')][_0x34a9('0x6e')]({'where':{'id':_0x4f2c88[_0x34a9('0x58')]['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0x12e0a3,null))[_0x34a9('0x20')](function(_0x440646){if(_0x440646){_0x29fc1c['model']=_[_0x34a9('0x43')](db[_0x34a9('0x6d')][_0x34a9('0x3e')]);_0x29fc1c[_0x34a9('0x46')]=_[_0x34a9('0x43')](_0x4f2c88[_0x34a9('0x46')]);_0x29fc1c[_0x34a9('0x44')]=_['intersection'](_0x29fc1c[_0x34a9('0x42')],_0x29fc1c[_0x34a9('0x46')]);_0x4e35c2[_0x34a9('0x47')]=_[_0x34a9('0x45')](_0x29fc1c[_0x34a9('0x42')],qs['fields'](_0x4f2c88[_0x34a9('0x46')][_0x34a9('0x48')]));_0x4e35c2[_0x34a9('0x47')]=_0x4e35c2[_0x34a9('0x47')]['length']?_0x4e35c2['attributes']:_0x29fc1c[_0x34a9('0x42')];if(!_0x4f2c88[_0x34a9('0x46')]['hasOwnProperty']('nolimit')){_0x4e35c2[_0x34a9('0x49')]=qs[_0x34a9('0x49')](_0x4f2c88[_0x34a9('0x46')][_0x34a9('0x49')]);_0x4e35c2[_0x34a9('0x2f')]=qs[_0x34a9('0x2f')](_0x4f2c88[_0x34a9('0x46')]['offset']);}_0x4e35c2[_0x34a9('0x4a')]=qs[_0x34a9('0x4b')](_0x4f2c88[_0x34a9('0x46')][_0x34a9('0x4b')]);_0x4e35c2['where']=qs[_0x34a9('0x44')](_[_0x34a9('0x4c')](_0x4f2c88[_0x34a9('0x46')],_0x29fc1c[_0x34a9('0x44')]));_0x4e35c2['where'][_0x34a9('0x67')]=_0x440646['id'];if(_0x4f2c88[_0x34a9('0x46')][_0x34a9('0x4d')]){_0x4e35c2[_0x34a9('0x4f')]=_[_0x34a9('0x4e')](_0x4e35c2[_0x34a9('0x4f')],{'$or':_[_0x34a9('0x3d')](_0x4e35c2[_0x34a9('0x47')],function(_0x32961c){var _0x26f6cb={};_0x26f6cb[_0x32961c]={'$like':'%'+_0x4f2c88['query'][_0x34a9('0x4d')]+'%'};return _0x26f6cb;})});}_0x4e35c2=_[_0x34a9('0x4e')]({},_0x4e35c2,_0x4f2c88[_0x34a9('0x51')]);return db[_0x34a9('0x6d')][_0x34a9('0x53')]({'where':_0x4e35c2[_0x34a9('0x4f')]})[_0x34a9('0x20')](function(_0x58be27){_0x49dd37[_0x34a9('0x53')]=_0x58be27;if(_0x4f2c88['query']['includeAll']){_0x4e35c2[_0x34a9('0x5b')]=[{'all':!![]}];}return db[_0x34a9('0x6d')][_0x34a9('0x55')](_0x4e35c2);})[_0x34a9('0x20')](function(_0x5f0cb5){_0x49dd37[_0x34a9('0x56')]=_0x5f0cb5;return _0x49dd37;});}})[_0x34a9('0x20')](respondWithFilteredResult(_0x12e0a3,_0x4e35c2))['catch'](handleError(_0x12e0a3,null));};exports[_0x34a9('0x6f')]=function(_0x53ec3e,_0x500e45,_0x4b6855){return db['FaxAccount'][_0x34a9('0x61')]({'where':{'id':_0x53ec3e[_0x34a9('0x58')]['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0x500e45,null))[_0x34a9('0x20')](function(_0x58a9c1){if(_0x58a9c1){return _0x58a9c1[_0x34a9('0x6f')](_0x53ec3e[_0x34a9('0x46')][_0x34a9('0x6c')]);}})[_0x34a9('0x20')](respondWithStatusCode(_0x500e45,null))[_0x34a9('0x2a')](handleError(_0x500e45,null));};exports['addInteraction']=function(_0x21305a,_0x252bbc,_0x3af072){return db[_0x34a9('0x70')][_0x34a9('0x61')]({'where':{'id':_0x21305a[_0x34a9('0x58')]['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0x252bbc,null))[_0x34a9('0x20')](function(_0x5dfeb7){if(_0x5dfeb7){return _0x5dfeb7['addInteraction'](_0x21305a[_0x34a9('0x5d')][_0x34a9('0x6c')],_[_0x34a9('0x71')](_0x21305a['body'],[_0x34a9('0x6c'),'id'])||{});}})[_0x34a9('0x20')](respondWithResult(_0x252bbc,null))[_0x34a9('0x2a')](handleError(_0x252bbc,null));};exports['getInteractions']=function(_0x2c850b,_0x2c5ec2,_0x5c03ac){var _0x26d11d={'raw':![],'where':{}};var _0x272f06={};var _0xfdff00={'count':0x0,'rows':[]};return db[_0x34a9('0x52')]['findOne']({'where':{'id':_0x2c850b[_0x34a9('0x58')]['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0x2c5ec2,null))[_0x34a9('0x20')](function(_0x5712b1){if(_0x5712b1){_0x272f06[_0x34a9('0x42')]=_[_0x34a9('0x43')](db[_0x34a9('0x70')][_0x34a9('0x3e')]);_0x272f06['query']=_[_0x34a9('0x43')](_0x2c850b[_0x34a9('0x46')]);_0x272f06['filters']=_[_0x34a9('0x45')](_0x272f06[_0x34a9('0x42')],_0x272f06[_0x34a9('0x46')]);_0x26d11d[_0x34a9('0x47')]=_['intersection'](_0x272f06['model'],qs[_0x34a9('0x48')](_0x2c850b[_0x34a9('0x46')][_0x34a9('0x48')]));_0x26d11d['attributes']=_0x26d11d[_0x34a9('0x47')][_0x34a9('0x5a')]?_0x26d11d['attributes']:_0x272f06[_0x34a9('0x42')];if(!_0x2c850b['query'][_0x34a9('0x72')](_0x34a9('0x6a'))){_0x26d11d[_0x34a9('0x49')]=qs['limit'](_0x2c850b['query'][_0x34a9('0x49')]);_0x26d11d[_0x34a9('0x2f')]=qs['offset'](_0x2c850b['query'][_0x34a9('0x2f')]);}_0x26d11d['order']=qs[_0x34a9('0x4b')](_0x2c850b['query'][_0x34a9('0x4b')]);_0x26d11d['where']=qs[_0x34a9('0x44')](_['pick'](_0x2c850b[_0x34a9('0x46')],_0x272f06[_0x34a9('0x44')]));_0x26d11d[_0x34a9('0x4f')]['FaxAccountId']=_0x5712b1['id'];if(_0x2c850b[_0x34a9('0x46')][_0x34a9('0x4d')]){_0x26d11d[_0x34a9('0x4f')]=_[_0x34a9('0x4e')](_0x26d11d[_0x34a9('0x4f')],{'$or':_[_0x34a9('0x3d')](_0x26d11d['attributes'],function(_0x581a3f){var _0x28b6b8={};_0x28b6b8[_0x581a3f]={'$like':'%'+_0x2c850b[_0x34a9('0x46')][_0x34a9('0x4d')]+'%'};return _0x28b6b8;})});}_0x26d11d=_[_0x34a9('0x4e')]({},_0x26d11d,_0x2c850b[_0x34a9('0x51')]);return db['FaxInteraction'][_0x34a9('0x53')]({'where':_0x26d11d[_0x34a9('0x4f')]})[_0x34a9('0x20')](function(_0xb78607){_0xfdff00[_0x34a9('0x53')]=_0xb78607;if(_0x2c850b[_0x34a9('0x46')][_0x34a9('0x54')]){_0x26d11d['include']=[{'model':db[_0x34a9('0x73')],'as':_0x34a9('0x74'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x34a9('0x75'),_0x34a9('0x76')],'required':![]},{'model':db[_0x34a9('0x77')],'as':_0x34a9('0x78'),'attributes':['id','name',_0x34a9('0x79')],'where':_0x2c850b[_0x34a9('0x46')][_0x34a9('0x7a')]?{'id':_0x2c850b[_0x34a9('0x46')][_0x34a9('0x7a')]}:undefined,'required':_0x2c850b['query'][_0x34a9('0x7a')]?!![]:![]}];}return db[_0x34a9('0x70')][_0x34a9('0x55')](_0x26d11d);})[_0x34a9('0x20')](function(_0x46c3de){_0xfdff00[_0x34a9('0x56')]=_0x46c3de;return _0xfdff00;});}})[_0x34a9('0x20')](respondWithFilteredResult(_0x2c5ec2,_0x26d11d))['catch'](handleError(_0x2c5ec2,null));};exports[_0x34a9('0x7b')]=function(_0x6581e2,_0x2a8152,_0x2d42ca){return db[_0x34a9('0x52')]['findOne']({'where':{'id':_0x6581e2[_0x34a9('0x58')]['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0x2a8152,null))[_0x34a9('0x20')](function(_0x139fc5){if(_0x139fc5){return db[_0x34a9('0x7c')][_0x34a9('0x7d')](function(_0x1b17b6){return db[_0x34a9('0x7e')][_0x34a9('0x35')]({'where':{'FaxAccountId':_0x6581e2['params']['id']},'transaction':_0x1b17b6})['then'](function(_0x16499f){var _0x57bfdb=_['map'](_0x6581e2['body'],function(_0x3ddf7a){_0x3ddf7a[_0x34a9('0x67')]=_0x6581e2[_0x34a9('0x58')]['id'];return _0x3ddf7a;});return db[_0x34a9('0x7e')]['bulkCreate'](_0x57bfdb,{'transaction':_0x1b17b6});});})[_0x34a9('0x20')](function(){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x6581e2[_0x34a9('0x58')]['id']},'order':_0x34a9('0x7f')});});}})[_0x34a9('0x20')](respondWithResult(_0x2a8152,null))['catch'](handleError(_0x2a8152,null));};exports['getApplications']=function(_0x253d98,_0x5004a9,_0x38b0b2){var _0x4d2340={};var _0x5a7f2d={};var _0xfe3e0d;var _0x2e905d;return db['FaxAccount'][_0x34a9('0x6e')]({'where':{'id':_0x253d98['params']['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0x5004a9,null))[_0x34a9('0x20')](function(_0x1618d8){if(_0x1618d8){_0xfe3e0d=_0x1618d8;_0x5a7f2d['model']=_['keys'](db[_0x34a9('0x7e')][_0x34a9('0x3e')]);_0x5a7f2d[_0x34a9('0x46')]=_[_0x34a9('0x43')](_0x253d98[_0x34a9('0x46')]);_0x5a7f2d[_0x34a9('0x44')]=_[_0x34a9('0x45')](_0x5a7f2d[_0x34a9('0x42')],_0x5a7f2d[_0x34a9('0x46')]);_0x4d2340[_0x34a9('0x47')]=_[_0x34a9('0x45')](_0x5a7f2d[_0x34a9('0x42')],qs['fields'](_0x253d98[_0x34a9('0x46')][_0x34a9('0x48')]));_0x4d2340['attributes']=_0x4d2340[_0x34a9('0x47')][_0x34a9('0x5a')]?_0x4d2340['attributes']:_0x5a7f2d[_0x34a9('0x42')];_0x4d2340[_0x34a9('0x4a')]=qs[_0x34a9('0x4b')](_0x253d98['query']['sort']);_0x4d2340[_0x34a9('0x4f')]=qs[_0x34a9('0x44')](_['pick'](_0x253d98['query'],_0x5a7f2d[_0x34a9('0x44')]));if(_0x253d98[_0x34a9('0x46')][_0x34a9('0x4d')]){_0x4d2340['where']=_['merge'](_0x4d2340[_0x34a9('0x4f')],{'$or':_[_0x34a9('0x3d')](_0x4d2340['attributes'],function(_0x5582a4){var _0x2eef1a={};_0x2eef1a[_0x5582a4]={'$like':'%'+_0x253d98[_0x34a9('0x46')][_0x34a9('0x4d')]+'%'};return _0x2eef1a;})});}_0x4d2340=_[_0x34a9('0x4e')]({},_0x4d2340,_0x253d98[_0x34a9('0x51')]);return _0xfe3e0d[_0x34a9('0x80')](_0x4d2340);}})[_0x34a9('0x20')](function(_0x327c32){if(_0x327c32){_0x2e905d=_0x327c32[_0x34a9('0x5a')];if(!_0x253d98[_0x34a9('0x46')][_0x34a9('0x72')](_0x34a9('0x6a'))){_0x4d2340['limit']=qs[_0x34a9('0x49')](_0x253d98[_0x34a9('0x46')]['limit']);_0x4d2340['offset']=qs[_0x34a9('0x2f')](_0x253d98[_0x34a9('0x46')][_0x34a9('0x2f')]);}return _0xfe3e0d['getApplications'](_0x4d2340);}})[_0x34a9('0x20')](function(_0x2d4704){if(_0x2d4704){return _0x2d4704?{'count':_0x2e905d,'rows':_0x2d4704}:null;}})['then'](respondWithResult(_0x5004a9,null))[_0x34a9('0x2a')](handleError(_0x5004a9,null));};function Extension(_0x13487c,_0x375c53,_0x40f0f7,_0x30d74c){this[_0x34a9('0x81')]=_0x34a9('0x82');this[_0x34a9('0x83')]=_0x13487c[_0x34a9('0x84')];this[_0x34a9('0x85')]=_0x30d74c;this[_0x34a9('0x40')]=_0x34a9('0x86');this['description']=_0x34a9('0x87');this[_0x34a9('0x67')]=_0x13487c['id'];this[_0x34a9('0x7f')]=_0x375c53;this[_0x34a9('0x88')]=_0x40f0f7;}function createExtensionsReciveFax(_0x5ead63){var _0x1c0290=0x1;var _0x3eee5a=[];_0x3eee5a['push'](new Extension(_0x5ead63,_0x1c0290,'','Answer'));_0x1c0290+=0x1;_0x3eee5a[_0x34a9('0x89')](new Extension(_0x5ead63,_0x1c0290,_0x34a9('0x8a'),'Set'));_0x1c0290+=0x1;for(var _0x52c51f in _0x5ead63){if(_0x5ead63[_0x34a9('0x72')](_0x52c51f)&&(_0x52c51f===_0x34a9('0x8b')||_0x52c51f==='localstationid'||_0x52c51f==='gateway'||_0x52c51f===_0x34a9('0x8c')||_0x52c51f===_0x34a9('0x8d')||_0x52c51f===_0x34a9('0x8e')||_0x52c51f==='minrate'||_0x52c51f===_0x34a9('0x8f')||_0x52c51f===_0x34a9('0x90'))){_0x3eee5a['push'](new Extension(_0x5ead63,_0x1c0290,_0x34a9('0x91')+_0x52c51f+')='+_0x5ead63[_0x52c51f],'Set'));_0x1c0290+=0x1;}}_0x3eee5a['push'](new Extension(_0x5ead63,_0x1c0290,'6','Wait'));_0x1c0290+=0x1;_0x3eee5a[_0x34a9('0x89')](new Extension(_0x5ead63,_0x1c0290,'/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',_0x34a9('0x92')));_0x1c0290=0x0;return _0x3eee5a;}exports[_0x34a9('0x93')]=function(_0x203c6d,_0x4f2dbe,_0x39b0be){var _0x385993;return db[_0x34a9('0x7c')][_0x34a9('0x7d')](function(_0x2cb626){return db[_0x34a9('0x52')][_0x34a9('0x5c')](_0x203c6d[_0x34a9('0x5d')],{'transaction':_0x2cb626})[_0x34a9('0x20')](function(_0x226344){_0x385993=_0x226344['get']({'plain':!![]});return db[_0x34a9('0x94')][_0x34a9('0x95')](createExtensionsReciveFax(_0x385993),{'transaction':_0x2cb626});});})[_0x34a9('0x20')](function(){return _0x385993;})['then'](respondWithResult(_0x4f2dbe,null))[_0x34a9('0x2a')](handleError(_0x4f2dbe,null));};exports[_0x34a9('0x96')]=function(_0x236c14,_0xc96ec3,_0x12bd1b){var _0x18a7c3;return db[_0x34a9('0x7c')][_0x34a9('0x7d')](function(_0x23d9ed){return db['FaxAccount']['update'](_0x236c14['body'],{'where':{'id':_0x236c14[_0x34a9('0x5d')]['id']},'transaction':_0x23d9ed})[_0x34a9('0x20')](function(_0x35970f){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x236c14['body']['id']},'transaction':_0x23d9ed})['then'](function(_0x49b66){return db[_0x34a9('0x94')][_0x34a9('0x95')](createExtensionsReciveFax(_[_0x34a9('0x71')](_0x236c14[_0x34a9('0x5d')],['tech',_0x34a9('0x41'),_0x34a9('0x97'),_0x34a9('0x98'),'TrunkId',_0x34a9('0x99')])),{'transaction':_0x23d9ed});});});})[_0x34a9('0x20')](function(){return db['FaxAccount'][_0x34a9('0x9a')](_0x236c14[_0x34a9('0x5d')]['id']);})[_0x34a9('0x20')](respondWithResult(_0xc96ec3,null))['catch'](handleError(_0xc96ec3,null));};exports[_0x34a9('0x9b')]=function(_0x51ba15,_0x58e940,_0x3caa12){var _0x49c5fa={'raw':!![],'where':{}};var _0x171fd5={};var _0x165e4b={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x51ba15[_0x34a9('0x58')]['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0x58e940,null))['then'](function(_0x24d685){if(_0x24d685){_0x171fd5['model']=_['keys'](db[_0x34a9('0x9c')][_0x34a9('0x3e')]);_0x171fd5['query']=_[_0x34a9('0x43')](_0x51ba15[_0x34a9('0x46')]);_0x171fd5[_0x34a9('0x44')]=_[_0x34a9('0x45')](_0x171fd5[_0x34a9('0x42')],_0x171fd5['query']);_0x49c5fa[_0x34a9('0x47')]=_[_0x34a9('0x45')](_0x171fd5[_0x34a9('0x42')],qs[_0x34a9('0x48')](_0x51ba15[_0x34a9('0x46')][_0x34a9('0x48')]));_0x49c5fa[_0x34a9('0x47')]=_0x49c5fa[_0x34a9('0x47')]['length']?_0x49c5fa['attributes']:_0x171fd5[_0x34a9('0x42')];if(!_0x51ba15['query'][_0x34a9('0x72')](_0x34a9('0x6a'))){_0x49c5fa[_0x34a9('0x49')]=qs[_0x34a9('0x49')](_0x51ba15[_0x34a9('0x46')]['limit']);_0x49c5fa[_0x34a9('0x2f')]=qs['offset'](_0x51ba15[_0x34a9('0x46')]['offset']);}_0x49c5fa[_0x34a9('0x4a')]=qs[_0x34a9('0x4b')](_0x51ba15[_0x34a9('0x46')][_0x34a9('0x4b')]);_0x49c5fa[_0x34a9('0x4f')]=qs[_0x34a9('0x44')](_[_0x34a9('0x4c')](_0x51ba15[_0x34a9('0x46')],_0x171fd5[_0x34a9('0x44')]));_0x49c5fa[_0x34a9('0x4f')][_0x34a9('0x67')]=_0x24d685['id'];if(_0x51ba15[_0x34a9('0x46')][_0x34a9('0x4d')]){_0x49c5fa['where']=_[_0x34a9('0x4e')](_0x49c5fa[_0x34a9('0x4f')],{'$or':_[_0x34a9('0x3d')](_0x49c5fa[_0x34a9('0x47')],function(_0x1796f7){var _0x324e6d={};_0x324e6d[_0x1796f7]={'$like':'%'+_0x51ba15[_0x34a9('0x46')][_0x34a9('0x4d')]+'%'};return _0x324e6d;})});}if(_0x51ba15[_0x34a9('0x46')][_0x34a9('0x9d')]){var _0x2d4e4e=_0x51ba15[_0x34a9('0x46')]['$gte'][_0x34a9('0x9e')](',');var _0xd76b05={};_0xd76b05[_0x2d4e4e[0x0]]={'$gte':moment(_0x2d4e4e[0x1])['format'](_0x34a9('0x9f'))};_0x49c5fa[_0x34a9('0x4f')]=_[_0x34a9('0x4e')](_0x49c5fa[_0x34a9('0x4f')],_0xd76b05);}_0x49c5fa=_[_0x34a9('0x4e')]({},_0x49c5fa,_0x51ba15['options']);return db['FaxMessage'][_0x34a9('0x53')]({'where':_0x49c5fa[_0x34a9('0x4f')]})[_0x34a9('0x20')](function(_0x3317b3){_0x165e4b['count']=_0x3317b3;if(_0x51ba15[_0x34a9('0x46')][_0x34a9('0x54')]){_0x49c5fa[_0x34a9('0x5b')]=[{'all':!![]}];}return db[_0x34a9('0x9c')][_0x34a9('0x55')](_0x49c5fa);})[_0x34a9('0x20')](function(_0xfebfe9){_0x165e4b['rows']=_0xfebfe9;return _0x165e4b;});}})[_0x34a9('0x20')](respondWithFilteredResult(_0x58e940,_0x49c5fa))[_0x34a9('0x2a')](handleError(_0x58e940,null));};exports[_0x34a9('0x3b')]=function(_0x82b277,_0x8a6f7c,_0x54a453){var _0x1d12df,_0x2d0a55={},_0x5aa996;if(_0x82b277[_0x34a9('0x5d')]['to']){_0x5aa996=_0x82b277[_0x34a9('0x5d')]['to'][0x0];}return db[_0x34a9('0x52')][_0x34a9('0x61')]({'where':{'id':_0x82b277[_0x34a9('0x58')]['id']},'include':[{'model':db[_0x34a9('0xa0')],'as':'List','include':[{'model':db[_0x34a9('0x73')],'as':_0x34a9('0xa1'),'where':{'fax':_0x5aa996},'limit':0x1,'order':[['updatedAt',_0x34a9('0xa2')]]}]}]})[_0x34a9('0x20')](handleEntityNotFound(_0x8a6f7c,null))['then'](function(_0x194524){_0x1d12df=_0x194524;if(_0x82b277[_0x34a9('0x5d')][_0x34a9('0xa3')]&&_0x82b277[_0x34a9('0x5d')][_0x34a9('0xa3')][_0x34a9('0x5a')]){for(var _0x13a705=0x0;_0x13a705<_0x82b277[_0x34a9('0x5d')][_0x34a9('0xa3')]['length'];_0x13a705+=0x1){_0x82b277[_0x34a9('0x5d')]['attachments'][_0x13a705]={'filename':_0x82b277[_0x34a9('0x5d')][_0x34a9('0xa3')][_0x13a705][_0x34a9('0x3a')],'id':_0x82b277['body']['attachments'][_0x13a705]['id'],'path':path['join'](config[_0x34a9('0xa4')],_0x34a9('0xa5'),_0x82b277[_0x34a9('0x5d')][_0x34a9('0xa3')][_0x13a705][_0x34a9('0xa6')])};}}return respondWithRpcPromise(_0x34a9('0xa7'),_0x34a9('0xa7'),{'FaxAccountId':_[_0x34a9('0xa8')](_0x82b277[_0x34a9('0x58')]['id'])?undefined:_0x82b277[_0x34a9('0x58')]['id'],'path':_[_0x34a9('0xa8')](_0x82b277[_0x34a9('0x5d')][_0x34a9('0xa3')][0x0][_0x34a9('0x7')])?undefined:_0x82b277[_0x34a9('0x5d')][_0x34a9('0xa3')][0x0][_0x34a9('0x7')],'fax':_[_0x34a9('0xa8')](_0x82b277['body']['to'][0x0])?undefined:_0x82b277['body']['to'][0x0]},client9002);})[_0x34a9('0x20')](function(){if(_0x1d12df){if(_[_0x34a9('0xa8')](_0x82b277['body']['from'])){_0x82b277[_0x34a9('0x5d')][_0x34a9('0xa9')]=util[_0x34a9('0xaa')](_0x34a9('0xab'),_0x1d12df[_0x34a9('0x3a')],_0x1d12df['fax']);}if(_0x1d12df['List']){if(_0x1d12df['List']['Contacts'][_0x34a9('0x5a')]){return _0x1d12df[_0x34a9('0xac')][_0x34a9('0xa1')][0x0];}else{return db[_0x34a9('0x73')]['create'](_['defaults'](_0x82b277['body'],{'firstName':_0x82b277[_0x34a9('0x5d')]['to'][0x0],'phone':_0x82b277['body']['to'][0x0],'fax':_0x82b277['body']['to'][0x0],'ListId':_0x1d12df[_0x34a9('0x99')]}));}}else{throw new Error(_0x34a9('0xad'));}}else{throw new Error(_0x34a9('0xae'));}})[_0x34a9('0x20')](function(_0x547d6d){if(_0x547d6d){return db['FaxInteraction']['find']({'where':{'ContactId':_0x547d6d['id'],'closed':![],'FaxAccountId':_0x1d12df['id']}})[_0x34a9('0x20')](function(_0x4fd0e7){if(_0x4fd0e7){return[_0x4fd0e7,![]];}return db[_0x34a9('0x70')]['create']({'UserId':_0x82b277[_0x34a9('0x5e')]['id'],'ContactId':_0x547d6d['id'],'FaxAccountId':_0x1d12df['id'],'fax':_0x82b277[_0x34a9('0x5d')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x34a9('0x4e')](_0x82b277['body'],{'read':![],'body':_0x82b277[_0x34a9('0x5d')]['attachments'][0x0][_0x34a9('0xaf')],'FaxAccountId':_0x1d12df['id'],'UserId':_0x82b277['user']['id'],'ContactId':_0x547d6d['id'],'AttachmentId':_0x82b277[_0x34a9('0x5d')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x34a9('0x9c')],'as':_0x34a9('0xb0')}]})[_0x34a9('0x20')](function(_0x4fcddd){return[_0x4fcddd,!![]];});});}else{throw new Error(_0x34a9('0xb1'));}})[_0x34a9('0xb2')](function(_0x4d46e3,_0xb5e2ff){if(_0xb5e2ff){return _0x4d46e3;}return db[_0x34a9('0x9c')][_0x34a9('0x5c')]({'direction':_0x34a9('0xb3'),'read':![],'body':_0x82b277[_0x34a9('0x5d')][_0x34a9('0xa3')][0x0][_0x34a9('0xaf')],'FaxAccountId':_0x1d12df['id'],'FaxInteractionId':_0x4d46e3['id'],'UserId':_0x82b277[_0x34a9('0x5e')]['id'],'ContactId':_0x4d46e3[_0x34a9('0xb4')],'AttachmentId':_0x82b277['body'][_0x34a9('0xa3')][0x0]['id']})[_0x34a9('0x20')](function(_0x5345b4){_0x4d46e3[_0x34a9('0xb5')]['Messages']=[];_0x4d46e3['dataValues']['Messages'][_0x34a9('0x89')](_0x5345b4[_0x34a9('0xb5')]);return _0x4d46e3;});})['then'](function(_0x2092f3){respondWithRpcPromise(_0x34a9('0xb6'),_0x34a9('0xb6'),{'FaxAccountId':_[_0x34a9('0xa8')](_0x82b277['params']['id'])?undefined:_0x82b277['params']['id'],'path':_[_0x34a9('0xa8')](_0x82b277[_0x34a9('0x5d')][_0x34a9('0xa3')][0x0][_0x34a9('0x7')])?undefined:_0x82b277[_0x34a9('0x5d')][_0x34a9('0xa3')][0x0]['path'],'fax':_[_0x34a9('0xa8')](_0x82b277[_0x34a9('0x5d')]['to'][0x0])?undefined:_0x82b277['body']['to'][0x0],'AttachmentId':_0x82b277[_0x34a9('0x5d')][_0x34a9('0xa3')][0x0]['id']},client9002)[_0x34a9('0x20')](function(_0x5cf6b3){logger[_0x34a9('0x28')]('SendFaxRpc,\x20%s',_0x5cf6b3);})[_0x34a9('0x2a')](function(_0x3f1c9e){logger['info'](_0x34a9('0xb7'),_0x3f1c9e);});return _0x2092f3;})[_0x34a9('0x20')](respondWithResult(_0x8a6f7c,null))['catch'](handleError(_0x8a6f7c,null));};exports[_0x34a9('0xb8')]=function(_0x868ee3,_0x4d0cfd,_0x5a4cb5){return db[_0x34a9('0x52')][_0x34a9('0x61')]({'where':{'id':_0x868ee3[_0x34a9('0x58')]['id']}})['then'](handleEntityNotFound(_0x4d0cfd,null))[_0x34a9('0x20')](function(_0x3ab47d){if(_0x3ab47d){return _0x3ab47d[_0x34a9('0xb8')](_0x868ee3[_0x34a9('0x5d')][_0x34a9('0x6c')],_[_0x34a9('0x71')](_0x868ee3[_0x34a9('0x5d')],['ids','id'])||{})[_0x34a9('0xb2')](function(_0x5b12d7){for(var _0x5558d1=0x0;_0x5558d1<_0x868ee3[_0x34a9('0x5d')][_0x34a9('0x6c')][_0x34a9('0x5a')];_0x5558d1+=0x1){socket['emit'](_0x34a9('0xb9'),{'UserId':_0x868ee3[_0x34a9('0x5d')][_0x34a9('0x6c')][_0x5558d1],'FaxAccountId':_0x868ee3[_0x34a9('0x58')]['id']});}return _0x5b12d7;});}})[_0x34a9('0x20')](respondWithResult(_0x4d0cfd,null))['catch'](handleError(_0x4d0cfd,null));};exports['removeAgents']=function(_0x3939eb,_0xb7b30f,_0x57ed6b){return db[_0x34a9('0x52')][_0x34a9('0x61')]({'where':{'id':_0x3939eb['params']['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0xb7b30f,null))[_0x34a9('0x20')](function(_0x129029){if(_0x129029){return _0x129029[_0x34a9('0xba')](_0x3939eb[_0x34a9('0x46')][_0x34a9('0x6c')])[_0x34a9('0x20')](function(){if(_[_0x34a9('0xbb')](_0x3939eb['query'][_0x34a9('0x6c')])){for(var _0x180e68=0x0;_0x180e68<_0x3939eb[_0x34a9('0x46')][_0x34a9('0x6c')][_0x34a9('0x5a')];_0x180e68+=0x1){socket[_0x34a9('0xbc')]('userFaxAccount:remove',{'UserId':Number(_0x3939eb['query'][_0x34a9('0x6c')][_0x180e68]),'FaxAccountId':Number(_0x3939eb[_0x34a9('0x58')]['id'])});}}else{socket[_0x34a9('0xbc')](_0x34a9('0xbd'),{'UserId':Number(_0x3939eb[_0x34a9('0x46')][_0x34a9('0x6c')]),'FaxAccountId':Number(_0x3939eb[_0x34a9('0x58')]['id'])});}});}})[_0x34a9('0x20')](respondWithStatusCode(_0xb7b30f,null))['catch'](handleError(_0xb7b30f,null));};exports[_0x34a9('0xbe')]=function(_0x1b5051,_0x24ed6f,_0x111aca){var _0x432ebd={};var _0x596a08={};var _0x4f0730;var _0x35a8b6;return db[_0x34a9('0x52')][_0x34a9('0x6e')]({'where':{'id':_0x1b5051[_0x34a9('0x58')]['id']}})[_0x34a9('0x20')](handleEntityNotFound(_0x24ed6f,null))[_0x34a9('0x20')](function(_0x176e61){if(_0x176e61){_0x4f0730=_0x176e61;_0x596a08[_0x34a9('0x42')]=_[_0x34a9('0x43')](db[_0x34a9('0xbf')][_0x34a9('0x3e')]);_0x596a08[_0x34a9('0x46')]=_['keys'](_0x1b5051[_0x34a9('0x46')]);_0x596a08['filters']=_[_0x34a9('0x45')](_0x596a08[_0x34a9('0x42')],_0x596a08[_0x34a9('0x46')]);_0x432ebd[_0x34a9('0x47')]=_[_0x34a9('0x45')](_0x596a08[_0x34a9('0x42')],qs[_0x34a9('0x48')](_0x1b5051['query']['fields']));_0x432ebd[_0x34a9('0x47')]=_0x432ebd['attributes'][_0x34a9('0x5a')]?_0x432ebd[_0x34a9('0x47')]:_0x596a08[_0x34a9('0x42')];_0x432ebd[_0x34a9('0x4a')]=qs[_0x34a9('0x4b')](_0x1b5051[_0x34a9('0x46')][_0x34a9('0x4b')]);_0x432ebd[_0x34a9('0x4f')]=qs[_0x34a9('0x44')](_[_0x34a9('0x4c')](_0x1b5051['query'],_0x596a08['filters']));if(_0x1b5051[_0x34a9('0x46')][_0x34a9('0x4d')]){_0x432ebd[_0x34a9('0x4f')]=_[_0x34a9('0x4e')](_0x432ebd[_0x34a9('0x4f')],{'$or':_['map'](_0x432ebd[_0x34a9('0x47')],function(_0x20f9e6){var _0x75870d={};_0x75870d[_0x20f9e6]={'$like':'%'+_0x1b5051[_0x34a9('0x46')][_0x34a9('0x4d')]+'%'};return _0x75870d;})});}_0x432ebd=_['merge']({},_0x432ebd,_0x1b5051['options']);return _0x4f0730['getAgents'](_0x432ebd);}})[_0x34a9('0x20')](function(_0x465f44){if(_0x465f44){_0x35a8b6=_0x465f44['length'];if(!_0x1b5051['query'][_0x34a9('0x72')]('nolimit')){_0x432ebd[_0x34a9('0x49')]=qs['limit'](_0x1b5051['query'][_0x34a9('0x49')]);_0x432ebd['offset']=qs['offset'](_0x1b5051['query'][_0x34a9('0x2f')]);}return _0x4f0730[_0x34a9('0xbe')](_0x432ebd);}})['then'](function(_0x210ad0){if(_0x210ad0){return _0x210ad0?{'count':_0x35a8b6,'rows':_0x210ad0}:null;}})['then'](respondWithResult(_0x24ed6f,null))[_0x34a9('0x2a')](handleError(_0x24ed6f,null));}; \ No newline at end of file +var _0x4cc6=['attachments','join','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','FaxAccounts','name','send','index','mandatoryDispositionPause','FaxAccount','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','Pause','fields','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','Disposition','getDispositions','findOne','options','rows','removeDispositions','ids','FaxAccountId','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','pick','CmContact','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','app','type','system','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','ReceiveFax','updateAccountApplications','VoiceExtension','bulkCreate','omit','createdAt','updatedAt','TrunkId','findById','FaxMessage','$gte','format','CmList','Contacts','DESC'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0x4cc6,0x19e));var _0x64cc=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0x4cc6[_0x80d733];return _0x435868;};'use strict';var pdf=require(_0x64cc('0x0'));var emlformat=require(_0x64cc('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x64cc('0x2'));var rp=require(_0x64cc('0x3'));var moment=require(_0x64cc('0x4'));var BPromise=require(_0x64cc('0x5'));var Mustache=require('mustache');var util=require(_0x64cc('0x6'));var path=require(_0x64cc('0x7'));var sox=require(_0x64cc('0x8'));var csv=require('to-csv');var ejs=require(_0x64cc('0x9'));var fs=require('fs');var _=require(_0x64cc('0xa'));var squel=require(_0x64cc('0xb'));var crypto=require(_0x64cc('0xc'));var jsforce=require(_0x64cc('0xd'));var deskjs=require(_0x64cc('0xe'));var toCsv=require('to-csv');var querystring=require(_0x64cc('0xf'));var Papa=require(_0x64cc('0x10'));var Redis=require(_0x64cc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x64cc('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64cc('0x13'));var logger=require(_0x64cc('0x14'))('api');var utils=require(_0x64cc('0x15'));var config=require(_0x64cc('0x16'));var db=require(_0x64cc('0x17'))['db'];config[_0x64cc('0x18')]=_['defaults'](config[_0x64cc('0x18')],{'host':_0x64cc('0x19'),'port':0x18eb});var socket=require(_0x64cc('0x1a'))(new Redis(config[_0x64cc('0x18')]));require(_0x64cc('0x1b'))[_0x64cc('0x1c')](socket);var jayson=require(_0x64cc('0x1d'));var client=jayson[_0x64cc('0x1e')][_0x64cc('0x1f')]({'port':0x232c});var client9002=jayson[_0x64cc('0x1e')][_0x64cc('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x2567ba,_0x4267a1,_0x5ee38e){if(_0x5ee38e){var _0x4fc96c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4fc96c['test'](_0x4267a1)){return _0x2567ba;}else{throw new db['Sequelize'][(_0x64cc('0x20'))](_0x64cc('0x21'));}}else{return _0x2567ba;}}function respondWithRpcPromise(_0xdfbea3,_0xfaade8,_0x4ef730,_0x15084d){return new BPromise(function(_0x2d1a16,_0x4f26b3){var _0x43fece=_0x15084d||client;return _0x43fece[_0x64cc('0x22')](_0xdfbea3,_0x4ef730)[_0x64cc('0x23')](function(_0xb2b4dc){logger[_0x64cc('0x24')](_0x64cc('0x25'),_0xfaade8,_0x64cc('0x26'));logger[_0x64cc('0x27')](_0x64cc('0x28'),_0xfaade8,_0x64cc('0x26'),JSON[_0x64cc('0x29')](_0xb2b4dc));if(_0xb2b4dc['error']){if(_0xb2b4dc[_0x64cc('0x2a')][_0x64cc('0x2b')]===0x1f4){logger[_0x64cc('0x2a')]('FaxAccount,\x20%s,\x20%s',_0xfaade8,_0xb2b4dc[_0x64cc('0x2a')][_0x64cc('0x2c')]);return _0x4f26b3(_0xb2b4dc[_0x64cc('0x2a')]['message']);}logger[_0x64cc('0x2a')](_0x64cc('0x25'),_0xfaade8,_0xb2b4dc[_0x64cc('0x2a')][_0x64cc('0x2c')]);return _0x2d1a16(_0xb2b4dc[_0x64cc('0x2a')]['message']);}else{logger[_0x64cc('0x24')]('FaxAccount,\x20%s,\x20%s',_0xfaade8,'request\x20sent');_0x2d1a16(_0xb2b4dc[_0x64cc('0x2d')][_0x64cc('0x2c')]);}})['catch'](function(_0xa91621){logger['error'](_0x64cc('0x25'),_0xfaade8,_0xa91621);_0x4f26b3(_0xa91621);});});}function respondWithStatusCode(_0x407669,_0x88cb3){_0x88cb3=_0x88cb3||0xcc;return function(_0x2030a8){if(_0x2030a8){return _0x407669[_0x64cc('0x2e')](_0x88cb3);}return _0x407669['status'](_0x88cb3)[_0x64cc('0x2f')]();};}function respondWithResult(_0x3d9a19,_0x257cb8){_0x257cb8=_0x257cb8||0xc8;return function(_0x4267f1){if(_0x4267f1){return _0x3d9a19[_0x64cc('0x30')](_0x257cb8)[_0x64cc('0x31')](_0x4267f1);}};}function respondWithFilteredResult(_0x1da2f2,_0x1fb69f){return function(_0x204fef){if(_0x204fef){var _0x5190be=_0x204fef[_0x64cc('0x32')],_0xec5002=_0x1fb69f[_0x64cc('0x33')],_0x454b12=_0x1fb69f[_0x64cc('0x33')]+_0x1fb69f[_0x64cc('0x34')],_0x196da7;if(_0x454b12>=_0x5190be){_0x454b12=_0x5190be;_0x196da7=0xc8;}else{_0x196da7=0xce;}_0x1da2f2[_0x64cc('0x30')](_0x196da7);return _0x1da2f2[_0x64cc('0x35')](_0x64cc('0x36'),_0xec5002+'-'+_0x454b12+'/'+_0x5190be)[_0x64cc('0x31')](_0x204fef);}return null;};}function patchUpdates(_0x22f512){return function(_0x4edf03){try{jsonpatch[_0x64cc('0x37')](_0x4edf03,_0x22f512,!![]);}catch(_0x2ff361){return BPromise[_0x64cc('0x38')](_0x2ff361);}return _0x4edf03[_0x64cc('0x39')]();};}function saveUpdates(_0x2501c4,_0x4f9220){return function(_0x37db5e){if(_0x37db5e){return _0x37db5e['update'](_0x2501c4)[_0x64cc('0x23')](function(_0x1f4421){return _0x1f4421;});}return null;};}function removeEntity(_0x3692ae,_0x173535){return function(_0x56ce37){if(_0x56ce37){return _0x56ce37[_0x64cc('0x3a')]()[_0x64cc('0x23')](function(){var _0x4a9a34=_0x56ce37[_0x64cc('0x3b')]({'plain':!![]});var _0xc349ae=_0x64cc('0x3c');return db['UserProfileResource'][_0x64cc('0x3a')]({'where':{'type':_0xc349ae,'resourceId':_0x4a9a34['id']}})['then'](function(){return _0x56ce37;});})['then'](function(){_0x3692ae['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x301e10,_0x353493){return function(_0x2008a7){if(!_0x2008a7){_0x301e10[_0x64cc('0x2e')](0x194);}return _0x2008a7;};}function handleError(_0x52e4de,_0x335cc8){_0x335cc8=_0x335cc8||0x1f4;return function(_0x1eba38){logger[_0x64cc('0x2a')](_0x1eba38['stack']);if(_0x1eba38[_0x64cc('0x3d')]){delete _0x1eba38['name'];}_0x52e4de['status'](_0x335cc8)[_0x64cc('0x3e')](_0x1eba38);};}exports[_0x64cc('0x3f')]=function(_0x1492bc,_0x7e704e){var _0x333b53={'include':[{'model':db['Pause'],'as':_0x64cc('0x40')}]},_0x1f0b98={},_0x3785bd={'count':0x0,'rows':[]};var _0x183651=_['map'](db[_0x64cc('0x41')][_0x64cc('0x42')],function(_0x221721){return{'name':_0x221721[_0x64cc('0x43')],'type':_0x221721['type'][_0x64cc('0x44')]};});_0x1f0b98[_0x64cc('0x45')]=_[_0x64cc('0x46')](_0x183651,_0x64cc('0x3d'));_0x1f0b98[_0x64cc('0x47')]=_[_0x64cc('0x48')](_0x1492bc['query']);_0x1f0b98['filters']=_[_0x64cc('0x49')](_0x1f0b98[_0x64cc('0x45')],_0x1f0b98[_0x64cc('0x47')]);_0x333b53[_0x64cc('0x4a')]=_[_0x64cc('0x49')](_0x1f0b98['model'],qs['fields'](_0x1492bc[_0x64cc('0x47')]['fields']));_0x333b53[_0x64cc('0x4a')]=_0x333b53[_0x64cc('0x4a')][_0x64cc('0x4b')]?_0x333b53[_0x64cc('0x4a')]:_0x1f0b98['model'];if(!_0x1492bc['query'][_0x64cc('0x4c')](_0x64cc('0x4d'))){_0x333b53[_0x64cc('0x34')]=qs[_0x64cc('0x34')](_0x1492bc[_0x64cc('0x47')][_0x64cc('0x34')]);_0x333b53[_0x64cc('0x33')]=qs[_0x64cc('0x33')](_0x1492bc['query'][_0x64cc('0x33')]);}_0x333b53[_0x64cc('0x4e')]=qs[_0x64cc('0x4f')](_0x1492bc[_0x64cc('0x47')][_0x64cc('0x4f')]);_0x333b53[_0x64cc('0x50')]=qs['filters'](_['pick'](_0x1492bc[_0x64cc('0x47')],_0x1f0b98[_0x64cc('0x51')]),_0x183651);if(_0x1492bc[_0x64cc('0x47')][_0x64cc('0x52')]){_0x333b53[_0x64cc('0x50')]=_[_0x64cc('0x53')](_0x333b53[_0x64cc('0x50')],{'$or':_[_0x64cc('0x46')](_0x183651,function(_0x24735c){if(_0x24735c['type']!==_0x64cc('0x54')){var _0x430875={};_0x430875[_0x24735c[_0x64cc('0x3d')]]={'$like':'%'+_0x1492bc[_0x64cc('0x47')][_0x64cc('0x52')]+'%'};return _0x430875;}})});}_0x333b53=_['merge']({},_0x333b53,_0x1492bc['options']);var _0x741dbd={'where':_0x333b53[_0x64cc('0x50')]};return db['FaxAccount'][_0x64cc('0x32')](_0x741dbd)[_0x64cc('0x23')](function(_0xb81fca){_0x3785bd[_0x64cc('0x32')]=_0xb81fca;if(_0x1492bc[_0x64cc('0x47')][_0x64cc('0x55')]){_0x333b53[_0x64cc('0x56')]=[{'all':!![]}];}return db[_0x64cc('0x41')][_0x64cc('0x57')](_0x333b53);})[_0x64cc('0x23')](function(_0x77e3b3){_0x3785bd['rows']=_0x77e3b3;return _0x3785bd;})[_0x64cc('0x23')](respondWithFilteredResult(_0x7e704e,_0x333b53))['catch'](handleError(_0x7e704e,null));};exports[_0x64cc('0x58')]=function(_0x3a022b,_0xff656c){var _0x56c342={'raw':![],'where':{'id':_0x3a022b[_0x64cc('0x59')]['id']},'include':[{'model':db[_0x64cc('0x5a')],'as':'mandatoryDispositionPause'}]},_0x256868={};_0x256868[_0x64cc('0x45')]=_[_0x64cc('0x48')](db['FaxAccount'][_0x64cc('0x42')]);_0x256868[_0x64cc('0x47')]=_[_0x64cc('0x48')](_0x3a022b[_0x64cc('0x47')]);_0x256868[_0x64cc('0x51')]=_['intersection'](_0x256868[_0x64cc('0x45')],_0x256868[_0x64cc('0x47')]);_0x56c342[_0x64cc('0x4a')]=_[_0x64cc('0x49')](_0x256868[_0x64cc('0x45')],qs[_0x64cc('0x5b')](_0x3a022b[_0x64cc('0x47')]['fields']));_0x56c342[_0x64cc('0x4a')]=_0x56c342[_0x64cc('0x4a')]['length']?_0x56c342[_0x64cc('0x4a')]:_0x256868[_0x64cc('0x45')];if(_0x3a022b['query'][_0x64cc('0x55')]){_0x56c342[_0x64cc('0x56')]=[{'all':!![]}];}_0x56c342=_[_0x64cc('0x53')]({},_0x56c342,_0x3a022b['options']);return db['FaxAccount'][_0x64cc('0x5c')](_0x56c342)[_0x64cc('0x23')](handleEntityNotFound(_0xff656c,null))[_0x64cc('0x23')](respondWithResult(_0xff656c,null))[_0x64cc('0x5d')](handleError(_0xff656c,null));};exports[_0x64cc('0x5e')]=function(_0x3ed554,_0x127a2c){return db['FaxAccount'][_0x64cc('0x5e')](_0x3ed554[_0x64cc('0x5f')],{})[_0x64cc('0x23')](function(_0x4d905e){var _0x1553ee=_0x3ed554[_0x64cc('0x60')][_0x64cc('0x3b')]({'plain':!![]});if(!_0x1553ee)throw new Error(_0x64cc('0x61'));if(_0x1553ee['role']===_0x64cc('0x60')){var _0x25aa0e=_0x4d905e['get']({'plain':!![]});var _0x3c5d88='FaxAccounts';return db[_0x64cc('0x62')]['find']({'where':{'name':_0x3c5d88,'userProfileId':_0x1553ee[_0x64cc('0x63')]},'raw':!![]})['then'](function(_0x1223f9){if(_0x1223f9&&_0x1223f9[_0x64cc('0x64')]===0x0){return db[_0x64cc('0x65')]['create']({'name':_0x25aa0e[_0x64cc('0x3d')],'resourceId':_0x25aa0e['id'],'type':_0x1223f9['name'],'sectionId':_0x1223f9['id']},{})['then'](function(){return _0x4d905e;});}else{return _0x4d905e;}})[_0x64cc('0x5d')](function(_0x58176d){logger[_0x64cc('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58176d);throw _0x58176d;});}return _0x4d905e;})[_0x64cc('0x23')](respondWithResult(_0x127a2c,0xc9))['catch'](handleError(_0x127a2c,null));};exports[_0x64cc('0x66')]=function(_0x56181c,_0xf8193e){if(_0x56181c[_0x64cc('0x5f')]['id']){delete _0x56181c['body']['id'];}return db[_0x64cc('0x41')][_0x64cc('0x5c')]({'where':{'id':_0x56181c['params']['id']},'include':[{'model':db[_0x64cc('0x5a')],'as':_0x64cc('0x40')}]})[_0x64cc('0x23')](handleEntityNotFound(_0xf8193e,null))[_0x64cc('0x23')](saveUpdates(_0x56181c[_0x64cc('0x5f')],null))[_0x64cc('0x23')](respondWithResult(_0xf8193e,null))[_0x64cc('0x5d')](handleError(_0xf8193e,null));};exports[_0x64cc('0x3a')]=function(_0x428ef3,_0x29d8e5){return db[_0x64cc('0x41')][_0x64cc('0x5c')]({'where':{'id':_0x428ef3[_0x64cc('0x59')]['id']}})[_0x64cc('0x23')](handleEntityNotFound(_0x29d8e5,null))[_0x64cc('0x23')](removeEntity(_0x29d8e5,null))[_0x64cc('0x5d')](handleError(_0x29d8e5,null));};exports['describe']=function(_0x721341,_0x4b1115){return db['FaxAccount']['describe']()[_0x64cc('0x23')](respondWithResult(_0x4b1115,null))[_0x64cc('0x5d')](handleError(_0x4b1115,null));};exports['addDisposition']=function(_0x43ce6e,_0x2ef797,_0x10067b){if(_0x43ce6e[_0x64cc('0x5f')]['id']){delete _0x43ce6e[_0x64cc('0x5f')]['id'];}return db[_0x64cc('0x41')][_0x64cc('0x5c')]({'where':{'id':_0x43ce6e[_0x64cc('0x59')]['id']}})[_0x64cc('0x23')](handleEntityNotFound(_0x2ef797,null))[_0x64cc('0x23')](function(_0x78ce67){if(_0x78ce67){_0x43ce6e[_0x64cc('0x5f')]['FaxAccountId']=_0x78ce67['id'];return db[_0x64cc('0x67')][_0x64cc('0x5e')](_0x43ce6e['body']);}})['then'](respondWithResult(_0x2ef797,null))['catch'](handleError(_0x2ef797,null));};exports[_0x64cc('0x68')]=function(_0x2e04d9,_0x3c402d,_0x4e1e5e){var _0xb3de2a={'raw':![],'where':{}};var _0xaf6898={};var _0x546762={'count':0x0,'rows':[]};return db['FaxAccount'][_0x64cc('0x69')]({'where':{'id':_0x2e04d9[_0x64cc('0x59')]['id']}})['then'](handleEntityNotFound(_0x3c402d,null))[_0x64cc('0x23')](function(_0x15b1d3){if(_0x15b1d3){_0xaf6898['model']=_['keys'](db[_0x64cc('0x67')]['rawAttributes']);_0xaf6898[_0x64cc('0x47')]=_[_0x64cc('0x48')](_0x2e04d9[_0x64cc('0x47')]);_0xaf6898[_0x64cc('0x51')]=_['intersection'](_0xaf6898[_0x64cc('0x45')],_0xaf6898['query']);_0xb3de2a[_0x64cc('0x4a')]=_['intersection'](_0xaf6898[_0x64cc('0x45')],qs[_0x64cc('0x5b')](_0x2e04d9[_0x64cc('0x47')]['fields']));_0xb3de2a['attributes']=_0xb3de2a[_0x64cc('0x4a')][_0x64cc('0x4b')]?_0xb3de2a[_0x64cc('0x4a')]:_0xaf6898['model'];if(!_0x2e04d9[_0x64cc('0x47')]['hasOwnProperty']('nolimit')){_0xb3de2a['limit']=qs[_0x64cc('0x34')](_0x2e04d9[_0x64cc('0x47')][_0x64cc('0x34')]);_0xb3de2a[_0x64cc('0x33')]=qs[_0x64cc('0x33')](_0x2e04d9[_0x64cc('0x47')]['offset']);}_0xb3de2a['order']=qs['sort'](_0x2e04d9[_0x64cc('0x47')][_0x64cc('0x4f')]);_0xb3de2a[_0x64cc('0x50')]=qs[_0x64cc('0x51')](_['pick'](_0x2e04d9[_0x64cc('0x47')],_0xaf6898[_0x64cc('0x51')]));_0xb3de2a['where']['FaxAccountId']=_0x15b1d3['id'];if(_0x2e04d9[_0x64cc('0x47')][_0x64cc('0x52')]){_0xb3de2a[_0x64cc('0x50')]=_['merge'](_0xb3de2a[_0x64cc('0x50')],{'$or':_[_0x64cc('0x46')](_0xb3de2a['attributes'],function(_0x4ef86a){var _0xddd9da={};_0xddd9da[_0x4ef86a]={'$like':'%'+_0x2e04d9[_0x64cc('0x47')][_0x64cc('0x52')]+'%'};return _0xddd9da;})});}_0xb3de2a=_[_0x64cc('0x53')]({},_0xb3de2a,_0x2e04d9[_0x64cc('0x6a')]);return db[_0x64cc('0x67')][_0x64cc('0x32')]({'where':_0xb3de2a[_0x64cc('0x50')]})[_0x64cc('0x23')](function(_0x2c7991){_0x546762[_0x64cc('0x32')]=_0x2c7991;if(_0x2e04d9[_0x64cc('0x47')][_0x64cc('0x55')]){_0xb3de2a['include']=[{'all':!![]}];}return db[_0x64cc('0x67')][_0x64cc('0x57')](_0xb3de2a);})[_0x64cc('0x23')](function(_0xbd4c45){_0x546762[_0x64cc('0x6b')]=_0xbd4c45;return _0x546762;});}})['then'](respondWithFilteredResult(_0x3c402d,_0xb3de2a))['catch'](handleError(_0x3c402d,null));};exports[_0x64cc('0x6c')]=function(_0x56b21d,_0x3639d4,_0x54acfa){return db[_0x64cc('0x41')][_0x64cc('0x5c')]({'where':{'id':_0x56b21d[_0x64cc('0x59')]['id']}})[_0x64cc('0x23')](handleEntityNotFound(_0x3639d4,null))[_0x64cc('0x23')](function(_0x37f813){if(_0x37f813){return _0x37f813[_0x64cc('0x6c')](_0x56b21d[_0x64cc('0x47')][_0x64cc('0x6d')]);}})['then'](respondWithStatusCode(_0x3639d4,null))[_0x64cc('0x5d')](handleError(_0x3639d4,null));};exports['addAnswer']=function(_0x408746,_0x27863f,_0x250bf5){if(_0x408746[_0x64cc('0x5f')]['id']){delete _0x408746[_0x64cc('0x5f')]['id'];}return db[_0x64cc('0x41')][_0x64cc('0x5c')]({'where':{'id':_0x408746[_0x64cc('0x59')]['id']}})['then'](handleEntityNotFound(_0x27863f,null))[_0x64cc('0x23')](function(_0x5561a6){if(_0x5561a6){_0x408746[_0x64cc('0x5f')][_0x64cc('0x6e')]=_0x5561a6['id'];return db['CannedAnswer'][_0x64cc('0x5e')](_0x408746['body']);}})[_0x64cc('0x23')](respondWithResult(_0x27863f,null))[_0x64cc('0x5d')](handleError(_0x27863f,null));};exports['getAnswers']=function(_0x5e40b9,_0x437353,_0x503252){var _0x59a503={'raw':![],'where':{}};var _0x1e95fc={};var _0x2c6743={'count':0x0,'rows':[]};return db[_0x64cc('0x41')][_0x64cc('0x69')]({'where':{'id':_0x5e40b9['params']['id']}})[_0x64cc('0x23')](handleEntityNotFound(_0x437353,null))[_0x64cc('0x23')](function(_0x31aec6){if(_0x31aec6){_0x1e95fc[_0x64cc('0x45')]=_[_0x64cc('0x48')](db[_0x64cc('0x6f')]['rawAttributes']);_0x1e95fc['query']=_[_0x64cc('0x48')](_0x5e40b9['query']);_0x1e95fc[_0x64cc('0x51')]=_['intersection'](_0x1e95fc['model'],_0x1e95fc[_0x64cc('0x47')]);_0x59a503[_0x64cc('0x4a')]=_[_0x64cc('0x49')](_0x1e95fc[_0x64cc('0x45')],qs[_0x64cc('0x5b')](_0x5e40b9[_0x64cc('0x47')][_0x64cc('0x5b')]));_0x59a503[_0x64cc('0x4a')]=_0x59a503[_0x64cc('0x4a')][_0x64cc('0x4b')]?_0x59a503[_0x64cc('0x4a')]:_0x1e95fc[_0x64cc('0x45')];if(!_0x5e40b9[_0x64cc('0x47')]['hasOwnProperty'](_0x64cc('0x4d'))){_0x59a503['limit']=qs['limit'](_0x5e40b9[_0x64cc('0x47')][_0x64cc('0x34')]);_0x59a503[_0x64cc('0x33')]=qs[_0x64cc('0x33')](_0x5e40b9[_0x64cc('0x47')]['offset']);}_0x59a503[_0x64cc('0x4e')]=qs[_0x64cc('0x4f')](_0x5e40b9[_0x64cc('0x47')][_0x64cc('0x4f')]);_0x59a503[_0x64cc('0x50')]=qs['filters'](_['pick'](_0x5e40b9[_0x64cc('0x47')],_0x1e95fc[_0x64cc('0x51')]));_0x59a503['where'][_0x64cc('0x6e')]=_0x31aec6['id'];if(_0x5e40b9['query'][_0x64cc('0x52')]){_0x59a503[_0x64cc('0x50')]=_[_0x64cc('0x53')](_0x59a503[_0x64cc('0x50')],{'$or':_[_0x64cc('0x46')](_0x59a503['attributes'],function(_0x260f44){var _0x10e398={};_0x10e398[_0x260f44]={'$like':'%'+_0x5e40b9[_0x64cc('0x47')]['filter']+'%'};return _0x10e398;})});}_0x59a503=_[_0x64cc('0x53')]({},_0x59a503,_0x5e40b9[_0x64cc('0x6a')]);return db[_0x64cc('0x6f')][_0x64cc('0x32')]({'where':_0x59a503['where']})[_0x64cc('0x23')](function(_0xb4b44c){_0x2c6743[_0x64cc('0x32')]=_0xb4b44c;if(_0x5e40b9[_0x64cc('0x47')]['includeAll']){_0x59a503[_0x64cc('0x56')]=[{'all':!![]}];}return db[_0x64cc('0x6f')]['findAll'](_0x59a503);})['then'](function(_0x43dcff){_0x2c6743[_0x64cc('0x6b')]=_0x43dcff;return _0x2c6743;});}})[_0x64cc('0x23')](respondWithFilteredResult(_0x437353,_0x59a503))[_0x64cc('0x5d')](handleError(_0x437353,null));};exports[_0x64cc('0x70')]=function(_0x373b6c,_0x8288,_0x35b452){return db[_0x64cc('0x41')][_0x64cc('0x5c')]({'where':{'id':_0x373b6c[_0x64cc('0x59')]['id']}})['then'](handleEntityNotFound(_0x8288,null))[_0x64cc('0x23')](function(_0x3a9dde){if(_0x3a9dde){return _0x3a9dde['removeAnswers'](_0x373b6c['query'][_0x64cc('0x6d')]);}})[_0x64cc('0x23')](respondWithStatusCode(_0x8288,null))[_0x64cc('0x5d')](handleError(_0x8288,null));};exports[_0x64cc('0x71')]=function(_0x378b32,_0x3c9c81,_0x301517){return db[_0x64cc('0x72')][_0x64cc('0x5c')]({'where':{'id':_0x378b32[_0x64cc('0x59')]['id']}})[_0x64cc('0x23')](handleEntityNotFound(_0x3c9c81,null))[_0x64cc('0x23')](function(_0x11f211){if(_0x11f211){return _0x11f211['addInteraction'](_0x378b32[_0x64cc('0x5f')][_0x64cc('0x6d')],_['omit'](_0x378b32[_0x64cc('0x5f')],['ids','id'])||{});}})[_0x64cc('0x23')](respondWithResult(_0x3c9c81,null))[_0x64cc('0x5d')](handleError(_0x3c9c81,null));};exports['getInteractions']=function(_0x35ad7b,_0x216e6c,_0x97b874){var _0x1c3cc0={'raw':![],'where':{}};var _0x49a6cd={};var _0x261835={'count':0x0,'rows':[]};return db['FaxAccount'][_0x64cc('0x69')]({'where':{'id':_0x35ad7b[_0x64cc('0x59')]['id']}})[_0x64cc('0x23')](handleEntityNotFound(_0x216e6c,null))[_0x64cc('0x23')](function(_0x4cd1df){if(_0x4cd1df){_0x49a6cd['model']=_[_0x64cc('0x48')](db[_0x64cc('0x72')][_0x64cc('0x42')]);_0x49a6cd['query']=_[_0x64cc('0x48')](_0x35ad7b[_0x64cc('0x47')]);_0x49a6cd[_0x64cc('0x51')]=_[_0x64cc('0x49')](_0x49a6cd[_0x64cc('0x45')],_0x49a6cd['query']);_0x1c3cc0[_0x64cc('0x4a')]=_['intersection'](_0x49a6cd[_0x64cc('0x45')],qs[_0x64cc('0x5b')](_0x35ad7b[_0x64cc('0x47')]['fields']));_0x1c3cc0[_0x64cc('0x4a')]=_0x1c3cc0[_0x64cc('0x4a')][_0x64cc('0x4b')]?_0x1c3cc0['attributes']:_0x49a6cd[_0x64cc('0x45')];if(!_0x35ad7b[_0x64cc('0x47')][_0x64cc('0x4c')]('nolimit')){_0x1c3cc0[_0x64cc('0x34')]=qs['limit'](_0x35ad7b['query']['limit']);_0x1c3cc0[_0x64cc('0x33')]=qs[_0x64cc('0x33')](_0x35ad7b[_0x64cc('0x47')][_0x64cc('0x33')]);}_0x1c3cc0[_0x64cc('0x4e')]=qs[_0x64cc('0x4f')](_0x35ad7b[_0x64cc('0x47')][_0x64cc('0x4f')]);_0x1c3cc0[_0x64cc('0x50')]=qs[_0x64cc('0x51')](_[_0x64cc('0x73')](_0x35ad7b[_0x64cc('0x47')],_0x49a6cd[_0x64cc('0x51')]));_0x1c3cc0[_0x64cc('0x50')][_0x64cc('0x6e')]=_0x4cd1df['id'];if(_0x35ad7b[_0x64cc('0x47')][_0x64cc('0x52')]){_0x1c3cc0[_0x64cc('0x50')]=_[_0x64cc('0x53')](_0x1c3cc0[_0x64cc('0x50')],{'$or':_[_0x64cc('0x46')](_0x1c3cc0[_0x64cc('0x4a')],function(_0x2749f0){var _0x31b2cd={};_0x31b2cd[_0x2749f0]={'$like':'%'+_0x35ad7b[_0x64cc('0x47')][_0x64cc('0x52')]+'%'};return _0x31b2cd;})});}_0x1c3cc0=_['merge']({},_0x1c3cc0,_0x35ad7b['options']);return db[_0x64cc('0x72')][_0x64cc('0x32')]({'where':_0x1c3cc0['where']})[_0x64cc('0x23')](function(_0x43530c){_0x261835[_0x64cc('0x32')]=_0x43530c;if(_0x35ad7b['query'][_0x64cc('0x55')]){_0x1c3cc0[_0x64cc('0x56')]=[{'model':db[_0x64cc('0x74')],'as':_0x64cc('0x75'),'required':![]},{'model':db['User'],'as':_0x64cc('0x76'),'attributes':[_0x64cc('0x3d'),_0x64cc('0x77'),_0x64cc('0x78')],'required':![]},{'model':db[_0x64cc('0x79')],'as':_0x64cc('0x7a'),'attributes':['id',_0x64cc('0x3d'),_0x64cc('0x7b')],'where':_0x35ad7b[_0x64cc('0x47')][_0x64cc('0x7c')]?{'id':_0x35ad7b['query'][_0x64cc('0x7c')]}:undefined,'required':_0x35ad7b[_0x64cc('0x47')]['tag']?!![]:![]}];}return db[_0x64cc('0x72')][_0x64cc('0x57')](_0x1c3cc0);})[_0x64cc('0x23')](function(_0x56f70d){_0x261835['rows']=_0x56f70d;return _0x261835;});}})[_0x64cc('0x23')](respondWithFilteredResult(_0x216e6c,_0x1c3cc0))[_0x64cc('0x5d')](handleError(_0x216e6c,null));};exports[_0x64cc('0x7d')]=function(_0x4d66cb,_0x681aec,_0x1506f9){return db[_0x64cc('0x41')][_0x64cc('0x69')]({'where':{'id':_0x4d66cb[_0x64cc('0x59')]['id']}})[_0x64cc('0x23')](handleEntityNotFound(_0x681aec,null))[_0x64cc('0x23')](function(_0xb51332){if(_0xb51332){return db[_0x64cc('0x7e')][_0x64cc('0x7f')](function(_0x278e82){return db[_0x64cc('0x80')][_0x64cc('0x3a')]({'where':{'FaxAccountId':_0x4d66cb[_0x64cc('0x59')]['id']},'transaction':_0x278e82})['then'](function(_0x3e4ba1){var _0x4c15bb=_[_0x64cc('0x46')](_0x4d66cb[_0x64cc('0x5f')],function(_0x481dd5){_0x481dd5[_0x64cc('0x6e')]=_0x4d66cb[_0x64cc('0x59')]['id'];return _0x481dd5;});return db[_0x64cc('0x80')]['bulkCreate'](_0x4c15bb,{'transaction':_0x278e82});});})[_0x64cc('0x23')](function(){return db[_0x64cc('0x80')][_0x64cc('0x81')]({'where':{'FaxAccountId':_0x4d66cb[_0x64cc('0x59')]['id']},'order':_0x64cc('0x82')});});}})[_0x64cc('0x23')](respondWithResult(_0x681aec,null))['catch'](handleError(_0x681aec,null));};exports[_0x64cc('0x83')]=function(_0x4e88aa,_0x47b333,_0x14b10e){var _0x4024d7={};var _0x58e2ff={};var _0x5942ba;var _0x5b1099;return db[_0x64cc('0x41')][_0x64cc('0x69')]({'where':{'id':_0x4e88aa[_0x64cc('0x59')]['id']}})[_0x64cc('0x23')](handleEntityNotFound(_0x47b333,null))[_0x64cc('0x23')](function(_0x35b231){if(_0x35b231){_0x5942ba=_0x35b231;_0x58e2ff[_0x64cc('0x45')]=_['keys'](db[_0x64cc('0x80')][_0x64cc('0x42')]);_0x58e2ff[_0x64cc('0x47')]=_[_0x64cc('0x48')](_0x4e88aa[_0x64cc('0x47')]);_0x58e2ff[_0x64cc('0x51')]=_[_0x64cc('0x49')](_0x58e2ff[_0x64cc('0x45')],_0x58e2ff['query']);_0x4024d7[_0x64cc('0x4a')]=_[_0x64cc('0x49')](_0x58e2ff[_0x64cc('0x45')],qs[_0x64cc('0x5b')](_0x4e88aa[_0x64cc('0x47')]['fields']));_0x4024d7[_0x64cc('0x4a')]=_0x4024d7['attributes']['length']?_0x4024d7['attributes']:_0x58e2ff[_0x64cc('0x45')];_0x4024d7['order']=qs['sort'](_0x4e88aa[_0x64cc('0x47')][_0x64cc('0x4f')]);_0x4024d7[_0x64cc('0x50')]=qs['filters'](_[_0x64cc('0x73')](_0x4e88aa[_0x64cc('0x47')],_0x58e2ff['filters']));if(_0x4e88aa[_0x64cc('0x47')][_0x64cc('0x52')]){_0x4024d7[_0x64cc('0x50')]=_[_0x64cc('0x53')](_0x4024d7[_0x64cc('0x50')],{'$or':_[_0x64cc('0x46')](_0x4024d7[_0x64cc('0x4a')],function(_0x546369){var _0x33c254={};_0x33c254[_0x546369]={'$like':'%'+_0x4e88aa[_0x64cc('0x47')][_0x64cc('0x52')]+'%'};return _0x33c254;})});}_0x4024d7=_[_0x64cc('0x53')]({},_0x4024d7,_0x4e88aa[_0x64cc('0x6a')]);return _0x5942ba[_0x64cc('0x83')](_0x4024d7);}})[_0x64cc('0x23')](function(_0x264478){if(_0x264478){_0x5b1099=_0x264478[_0x64cc('0x4b')];if(!_0x4e88aa[_0x64cc('0x47')]['hasOwnProperty']('nolimit')){_0x4024d7[_0x64cc('0x34')]=qs[_0x64cc('0x34')](_0x4e88aa['query'][_0x64cc('0x34')]);_0x4024d7[_0x64cc('0x33')]=qs[_0x64cc('0x33')](_0x4e88aa[_0x64cc('0x47')][_0x64cc('0x33')]);}return _0x5942ba['getApplications'](_0x4024d7);}})['then'](function(_0x284838){if(_0x284838){return _0x284838?{'count':_0x5b1099,'rows':_0x284838}:null;}})[_0x64cc('0x23')](respondWithResult(_0x47b333,null))[_0x64cc('0x5d')](handleError(_0x47b333,null));};function Extension(_0x2782d9,_0xf18af7,_0x48267e,_0x4a3df4){this[_0x64cc('0x84')]=_0x64cc('0x85');this[_0x64cc('0x86')]=_0x2782d9['localstationid'];this[_0x64cc('0x87')]=_0x4a3df4;this[_0x64cc('0x88')]=_0x64cc('0x89');this[_0x64cc('0x8a')]=_0x64cc('0x8b');this['FaxAccountId']=_0x2782d9['id'];this[_0x64cc('0x82')]=_0xf18af7;this['appdata']=_0x48267e;}function createExtensionsReciveFax(_0x521ddc){var _0x4de8f5=0x1;var _0x51fe09=[];_0x51fe09[_0x64cc('0x8c')](new Extension(_0x521ddc,_0x4de8f5,'',_0x64cc('0x8d')));_0x4de8f5+=0x1;_0x51fe09[_0x64cc('0x8c')](new Extension(_0x521ddc,_0x4de8f5,_0x64cc('0x8e'),_0x64cc('0x8f')));_0x4de8f5+=0x1;for(var _0x50606c in _0x521ddc){if(_0x521ddc[_0x64cc('0x4c')](_0x50606c)&&(_0x50606c===_0x64cc('0x90')||_0x50606c===_0x64cc('0x91')||_0x50606c===_0x64cc('0x92')||_0x50606c==='faxdetect'||_0x50606c===_0x64cc('0x93')||_0x50606c===_0x64cc('0x94')||_0x50606c==='minrate'||_0x50606c===_0x64cc('0x95')||_0x50606c===_0x64cc('0x96'))){_0x51fe09[_0x64cc('0x8c')](new Extension(_0x521ddc,_0x4de8f5,_0x64cc('0x97')+_0x50606c+')='+_0x521ddc[_0x50606c],_0x64cc('0x8f')));_0x4de8f5+=0x1;}}_0x51fe09[_0x64cc('0x8c')](new Extension(_0x521ddc,_0x4de8f5,'6',_0x64cc('0x98')));_0x4de8f5+=0x1;_0x51fe09[_0x64cc('0x8c')](new Extension(_0x521ddc,_0x4de8f5,'/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',_0x64cc('0x99')));_0x4de8f5=0x0;return _0x51fe09;}exports['addAccountApplications']=function(_0x252124,_0x4a7c46,_0x5ec160){var _0x59b9be;return db[_0x64cc('0x7e')][_0x64cc('0x7f')](function(_0xa682c5){return db[_0x64cc('0x41')][_0x64cc('0x5e')](_0x252124[_0x64cc('0x5f')],{'transaction':_0xa682c5})['then'](function(_0x50df24){_0x59b9be=_0x50df24['get']({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x59b9be),{'transaction':_0xa682c5});});})[_0x64cc('0x23')](function(){return _0x59b9be;})[_0x64cc('0x23')](respondWithResult(_0x4a7c46,null))[_0x64cc('0x5d')](handleError(_0x4a7c46,null));};exports[_0x64cc('0x9a')]=function(_0x2f955c,_0x8a5001,_0x268301){var _0x5d3cde;return db['sequelize'][_0x64cc('0x7f')](function(_0x48e458){return db[_0x64cc('0x41')][_0x64cc('0x66')](_0x2f955c[_0x64cc('0x5f')],{'where':{'id':_0x2f955c[_0x64cc('0x5f')]['id']},'transaction':_0x48e458})[_0x64cc('0x23')](function(_0x2a04f3){return db[_0x64cc('0x9b')]['destroy']({'where':{'FaxAccountId':_0x2f955c[_0x64cc('0x5f')]['id']},'transaction':_0x48e458})[_0x64cc('0x23')](function(_0x6cffae){return db[_0x64cc('0x9b')][_0x64cc('0x9c')](createExtensionsReciveFax(_[_0x64cc('0x9d')](_0x2f955c[_0x64cc('0x5f')],['tech','key',_0x64cc('0x9e'),_0x64cc('0x9f'),_0x64cc('0xa0'),'ListId'])),{'transaction':_0x48e458});});});})[_0x64cc('0x23')](function(){return db[_0x64cc('0x41')][_0x64cc('0xa1')](_0x2f955c[_0x64cc('0x5f')]['id']);})[_0x64cc('0x23')](respondWithResult(_0x8a5001,null))[_0x64cc('0x5d')](handleError(_0x8a5001,null));};exports['getMessages']=function(_0x2dd04e,_0x2a14d9,_0xf38e12){var _0x52d260={'raw':!![],'where':{}};var _0x453584={};var _0x30cd09={'count':0x0,'rows':[]};return db[_0x64cc('0x41')][_0x64cc('0x69')]({'where':{'id':_0x2dd04e[_0x64cc('0x59')]['id']}})[_0x64cc('0x23')](handleEntityNotFound(_0x2a14d9,null))[_0x64cc('0x23')](function(_0x5b9695){if(_0x5b9695){_0x453584['model']=_['keys'](db[_0x64cc('0xa2')]['rawAttributes']);_0x453584[_0x64cc('0x47')]=_[_0x64cc('0x48')](_0x2dd04e[_0x64cc('0x47')]);_0x453584[_0x64cc('0x51')]=_['intersection'](_0x453584['model'],_0x453584[_0x64cc('0x47')]);_0x52d260[_0x64cc('0x4a')]=_['intersection'](_0x453584[_0x64cc('0x45')],qs[_0x64cc('0x5b')](_0x2dd04e[_0x64cc('0x47')]['fields']));_0x52d260[_0x64cc('0x4a')]=_0x52d260[_0x64cc('0x4a')][_0x64cc('0x4b')]?_0x52d260['attributes']:_0x453584[_0x64cc('0x45')];if(!_0x2dd04e[_0x64cc('0x47')][_0x64cc('0x4c')](_0x64cc('0x4d'))){_0x52d260['limit']=qs[_0x64cc('0x34')](_0x2dd04e[_0x64cc('0x47')]['limit']);_0x52d260[_0x64cc('0x33')]=qs[_0x64cc('0x33')](_0x2dd04e[_0x64cc('0x47')][_0x64cc('0x33')]);}_0x52d260['order']=qs[_0x64cc('0x4f')](_0x2dd04e['query']['sort']);_0x52d260[_0x64cc('0x50')]=qs['filters'](_['pick'](_0x2dd04e[_0x64cc('0x47')],_0x453584[_0x64cc('0x51')]));_0x52d260[_0x64cc('0x50')][_0x64cc('0x6e')]=_0x5b9695['id'];if(_0x2dd04e[_0x64cc('0x47')][_0x64cc('0x52')]){_0x52d260[_0x64cc('0x50')]=_[_0x64cc('0x53')](_0x52d260['where'],{'$or':_['map'](_0x52d260[_0x64cc('0x4a')],function(_0x339c67){var _0x5c717a={};_0x5c717a[_0x339c67]={'$like':'%'+_0x2dd04e['query'][_0x64cc('0x52')]+'%'};return _0x5c717a;})});}if(_0x2dd04e[_0x64cc('0x47')][_0x64cc('0xa3')]){var _0x259192=_0x2dd04e[_0x64cc('0x47')][_0x64cc('0xa3')]['split'](',');var _0x1ce0d1={};_0x1ce0d1[_0x259192[0x0]]={'$gte':moment(_0x259192[0x1])[_0x64cc('0xa4')]('YYYY-MM-DD\x20HH:mm:ss')};_0x52d260[_0x64cc('0x50')]=_['merge'](_0x52d260[_0x64cc('0x50')],_0x1ce0d1);}_0x52d260=_[_0x64cc('0x53')]({},_0x52d260,_0x2dd04e['options']);return db[_0x64cc('0xa2')]['count']({'where':_0x52d260[_0x64cc('0x50')]})[_0x64cc('0x23')](function(_0x58573c){_0x30cd09[_0x64cc('0x32')]=_0x58573c;if(_0x2dd04e[_0x64cc('0x47')][_0x64cc('0x55')]){_0x52d260[_0x64cc('0x56')]=[{'all':!![]}];}return db[_0x64cc('0xa2')][_0x64cc('0x57')](_0x52d260);})[_0x64cc('0x23')](function(_0x37a076){_0x30cd09[_0x64cc('0x6b')]=_0x37a076;return _0x30cd09;});}})[_0x64cc('0x23')](respondWithFilteredResult(_0x2a14d9,_0x52d260))[_0x64cc('0x5d')](handleError(_0x2a14d9,null));};exports['send']=function(_0x13e1db,_0x67e4c9,_0x1c22b3){var _0x331ae1,_0x54936d={},_0xbc93bf;if(_0x13e1db[_0x64cc('0x5f')]['to']){_0xbc93bf=_0x13e1db['body']['to'][0x0];}return db[_0x64cc('0x41')][_0x64cc('0x5c')]({'where':{'id':_0x13e1db[_0x64cc('0x59')]['id']},'include':[{'model':db[_0x64cc('0xa5')],'as':'List','include':[{'model':db['CmContact'],'as':_0x64cc('0xa6'),'where':{'fax':_0xbc93bf},'limit':0x1,'order':[[_0x64cc('0x9f'),_0x64cc('0xa7')]]}]}]})[_0x64cc('0x23')](handleEntityNotFound(_0x67e4c9,null))[_0x64cc('0x23')](function(_0x4de65d){_0x331ae1=_0x4de65d;if(_0x13e1db[_0x64cc('0x5f')]['attachments']&&_0x13e1db['body'][_0x64cc('0xa8')][_0x64cc('0x4b')]){for(var _0x70966a=0x0;_0x70966a<_0x13e1db['body'][_0x64cc('0xa8')][_0x64cc('0x4b')];_0x70966a+=0x1){_0x13e1db[_0x64cc('0x5f')][_0x64cc('0xa8')][_0x70966a]={'filename':_0x13e1db[_0x64cc('0x5f')][_0x64cc('0xa8')][_0x70966a][_0x64cc('0x3d')],'id':_0x13e1db[_0x64cc('0x5f')][_0x64cc('0xa8')][_0x70966a]['id'],'path':path[_0x64cc('0xa9')](config['root'],'server/files/attachments',_0x13e1db['body']['attachments'][_0x70966a][_0x64cc('0xaa')])};}}return respondWithRpcPromise(_0x64cc('0xab'),_0x64cc('0xab'),{'FaxAccountId':_[_0x64cc('0xac')](_0x13e1db[_0x64cc('0x59')]['id'])?undefined:_0x13e1db[_0x64cc('0x59')]['id'],'path':_['isNil'](_0x13e1db[_0x64cc('0x5f')]['attachments'][0x0]['path'])?undefined:_0x13e1db['body']['attachments'][0x0][_0x64cc('0x7')],'fax':_['isNil'](_0x13e1db[_0x64cc('0x5f')]['to'][0x0])?undefined:_0x13e1db[_0x64cc('0x5f')]['to'][0x0]},client9002);})[_0x64cc('0x23')](function(){if(_0x331ae1){if(_[_0x64cc('0xac')](_0x13e1db['body'][_0x64cc('0xad')])){_0x13e1db[_0x64cc('0x5f')][_0x64cc('0xad')]=util[_0x64cc('0xa4')](_0x64cc('0xae'),_0x331ae1[_0x64cc('0x3d')],_0x331ae1[_0x64cc('0xaf')]);}if(_0x331ae1['List']){if(_0x331ae1[_0x64cc('0xb0')][_0x64cc('0xa6')][_0x64cc('0x4b')]){return _0x331ae1[_0x64cc('0xb0')][_0x64cc('0xa6')][0x0];}else{return db['CmContact'][_0x64cc('0x5e')](_['defaults'](_0x13e1db[_0x64cc('0x5f')],{'firstName':_0x13e1db['body']['to'][0x0],'phone':_0x13e1db[_0x64cc('0x5f')]['to'][0x0],'fax':_0x13e1db[_0x64cc('0x5f')]['to'][0x0],'ListId':_0x331ae1['ListId']}));}}else{throw new Error(_0x64cc('0xb1'));}}else{throw new Error(_0x64cc('0xb2'));}})['then'](function(_0x11863d){if(_0x11863d){return db['FaxInteraction']['find']({'where':{'ContactId':_0x11863d['id'],'closed':![],'FaxAccountId':_0x331ae1['id']}})['then'](function(_0x2d15ae){if(_0x2d15ae){return[_0x2d15ae,![]];}return db['FaxInteraction'][_0x64cc('0x5e')]({'UserId':_0x13e1db[_0x64cc('0x60')]['id'],'ContactId':_0x11863d['id'],'FaxAccountId':_0x331ae1['id'],'fax':_0x13e1db[_0x64cc('0x5f')]['to'][0x0],'firstMsgDirection':_0x64cc('0xb3'),'Messages':[_[_0x64cc('0x53')](_0x13e1db[_0x64cc('0x5f')],{'read':![],'body':_0x13e1db[_0x64cc('0x5f')][_0x64cc('0xa8')][0x0][_0x64cc('0xb4')],'FaxAccountId':_0x331ae1['id'],'UserId':_0x13e1db[_0x64cc('0x60')]['id'],'ContactId':_0x11863d['id'],'AttachmentId':_0x13e1db[_0x64cc('0x5f')][_0x64cc('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0x64cc('0xa2')],'as':_0x64cc('0xb5')}]})[_0x64cc('0x23')](function(_0x22d742){return[_0x22d742,!![]];});});}else{throw new Error(_0x64cc('0xb6'));}})[_0x64cc('0xb7')](function(_0x47554c,_0x56b452){if(_0x56b452){return _0x47554c;}return db[_0x64cc('0xa2')]['create']({'direction':_0x64cc('0xb3'),'read':![],'body':_0x13e1db[_0x64cc('0x5f')][_0x64cc('0xa8')][0x0][_0x64cc('0xb4')],'FaxAccountId':_0x331ae1['id'],'FaxInteractionId':_0x47554c['id'],'UserId':_0x13e1db[_0x64cc('0x60')]['id'],'ContactId':_0x47554c['ContactId'],'AttachmentId':_0x13e1db[_0x64cc('0x5f')][_0x64cc('0xa8')][0x0]['id']})[_0x64cc('0x23')](function(_0x5638f0){_0x47554c[_0x64cc('0xb8')][_0x64cc('0xb5')]=[];_0x47554c['dataValues'][_0x64cc('0xb5')][_0x64cc('0x8c')](_0x5638f0[_0x64cc('0xb8')]);return _0x47554c;});})[_0x64cc('0x23')](function(_0xf06d48){respondWithRpcPromise(_0x64cc('0xb9'),'SendFax',{'FaxAccountId':_[_0x64cc('0xac')](_0x13e1db[_0x64cc('0x59')]['id'])?undefined:_0x13e1db[_0x64cc('0x59')]['id'],'path':_[_0x64cc('0xac')](_0x13e1db[_0x64cc('0x5f')][_0x64cc('0xa8')][0x0][_0x64cc('0x7')])?undefined:_0x13e1db['body'][_0x64cc('0xa8')][0x0][_0x64cc('0x7')],'fax':_[_0x64cc('0xac')](_0x13e1db[_0x64cc('0x5f')]['to'][0x0])?undefined:_0x13e1db[_0x64cc('0x5f')]['to'][0x0],'AttachmentId':_0x13e1db[_0x64cc('0x5f')][_0x64cc('0xa8')][0x0]['id']},client9002)['then'](function(_0x2a5d64){logger['info']('SendFaxRpc,\x20%s',_0x2a5d64);})[_0x64cc('0x5d')](function(_0x5c45bf){logger[_0x64cc('0x24')](_0x64cc('0xba'),_0x5c45bf);});return _0xf06d48;})[_0x64cc('0x23')](respondWithResult(_0x67e4c9,null))['catch'](handleError(_0x67e4c9,null));};exports[_0x64cc('0xbb')]=function(_0x24d1e0,_0x1863e9,_0x229451){return db['FaxAccount']['find']({'where':{'id':_0x24d1e0[_0x64cc('0x59')]['id']}})[_0x64cc('0x23')](handleEntityNotFound(_0x1863e9,null))[_0x64cc('0x23')](function(_0x38bc0a){if(_0x38bc0a){return _0x38bc0a[_0x64cc('0xbb')](_0x24d1e0['body'][_0x64cc('0x6d')],_[_0x64cc('0x9d')](_0x24d1e0[_0x64cc('0x5f')],['ids','id'])||{})[_0x64cc('0xb7')](function(_0x4d76f7){for(var _0x1c0461=0x0;_0x1c0461<_0x24d1e0[_0x64cc('0x5f')][_0x64cc('0x6d')][_0x64cc('0x4b')];_0x1c0461+=0x1){socket['emit'](_0x64cc('0xbc'),{'UserId':_0x24d1e0[_0x64cc('0x5f')][_0x64cc('0x6d')][_0x1c0461],'FaxAccountId':_0x24d1e0['params']['id']});}return _0x4d76f7;});}})[_0x64cc('0x23')](respondWithResult(_0x1863e9,null))[_0x64cc('0x5d')](handleError(_0x1863e9,null));};exports['removeAgents']=function(_0x2ac2e8,_0x48b1b5,_0x317212){return db[_0x64cc('0x41')][_0x64cc('0x5c')]({'where':{'id':_0x2ac2e8[_0x64cc('0x59')]['id']}})[_0x64cc('0x23')](handleEntityNotFound(_0x48b1b5,null))[_0x64cc('0x23')](function(_0x37435d){if(_0x37435d){return _0x37435d[_0x64cc('0xbd')](_0x2ac2e8[_0x64cc('0x47')][_0x64cc('0x6d')])[_0x64cc('0x23')](function(){if(_[_0x64cc('0xbe')](_0x2ac2e8[_0x64cc('0x47')][_0x64cc('0x6d')])){for(var _0x298d59=0x0;_0x298d59<_0x2ac2e8['query'][_0x64cc('0x6d')][_0x64cc('0x4b')];_0x298d59+=0x1){socket[_0x64cc('0xbf')](_0x64cc('0xc0'),{'UserId':Number(_0x2ac2e8[_0x64cc('0x47')][_0x64cc('0x6d')][_0x298d59]),'FaxAccountId':Number(_0x2ac2e8['params']['id'])});}}else{socket[_0x64cc('0xbf')](_0x64cc('0xc0'),{'UserId':Number(_0x2ac2e8[_0x64cc('0x47')]['ids']),'FaxAccountId':Number(_0x2ac2e8['params']['id'])});}});}})[_0x64cc('0x23')](respondWithStatusCode(_0x48b1b5,null))[_0x64cc('0x5d')](handleError(_0x48b1b5,null));};exports['getAgents']=function(_0x2d4518,_0x25ac0a,_0x541b4d){var _0x314767={};var _0x4307c6={};var _0x2cea28;var _0x5a25c6;return db['FaxAccount'][_0x64cc('0x69')]({'where':{'id':_0x2d4518[_0x64cc('0x59')]['id']}})[_0x64cc('0x23')](handleEntityNotFound(_0x25ac0a,null))[_0x64cc('0x23')](function(_0x531804){if(_0x531804){_0x2cea28=_0x531804;_0x4307c6[_0x64cc('0x45')]=_[_0x64cc('0x48')](db['User']['rawAttributes']);_0x4307c6['query']=_[_0x64cc('0x48')](_0x2d4518[_0x64cc('0x47')]);_0x4307c6['filters']=_[_0x64cc('0x49')](_0x4307c6[_0x64cc('0x45')],_0x4307c6[_0x64cc('0x47')]);_0x314767[_0x64cc('0x4a')]=_[_0x64cc('0x49')](_0x4307c6['model'],qs[_0x64cc('0x5b')](_0x2d4518[_0x64cc('0x47')][_0x64cc('0x5b')]));_0x314767[_0x64cc('0x4a')]=_0x314767[_0x64cc('0x4a')][_0x64cc('0x4b')]?_0x314767[_0x64cc('0x4a')]:_0x4307c6['model'];_0x314767[_0x64cc('0x4e')]=qs[_0x64cc('0x4f')](_0x2d4518[_0x64cc('0x47')][_0x64cc('0x4f')]);_0x314767[_0x64cc('0x50')]=qs[_0x64cc('0x51')](_[_0x64cc('0x73')](_0x2d4518[_0x64cc('0x47')],_0x4307c6[_0x64cc('0x51')]));if(_0x2d4518['query']['filter']){_0x314767[_0x64cc('0x50')]=_[_0x64cc('0x53')](_0x314767['where'],{'$or':_[_0x64cc('0x46')](_0x314767[_0x64cc('0x4a')],function(_0x52038b){var _0x3b8b31={};_0x3b8b31[_0x52038b]={'$like':'%'+_0x2d4518['query'][_0x64cc('0x52')]+'%'};return _0x3b8b31;})});}_0x314767=_[_0x64cc('0x53')]({},_0x314767,_0x2d4518[_0x64cc('0x6a')]);return _0x2cea28[_0x64cc('0xc1')](_0x314767);}})[_0x64cc('0x23')](function(_0x3469f6){if(_0x3469f6){_0x5a25c6=_0x3469f6['length'];if(!_0x2d4518[_0x64cc('0x47')][_0x64cc('0x4c')](_0x64cc('0x4d'))){_0x314767[_0x64cc('0x34')]=qs[_0x64cc('0x34')](_0x2d4518[_0x64cc('0x47')][_0x64cc('0x34')]);_0x314767[_0x64cc('0x33')]=qs['offset'](_0x2d4518[_0x64cc('0x47')][_0x64cc('0x33')]);}return _0x2cea28[_0x64cc('0xc1')](_0x314767);}})[_0x64cc('0x23')](function(_0xba3578){if(_0xba3578){return _0xba3578?{'count':_0x5a25c6,'rows':_0xba3578}:null;}})[_0x64cc('0x23')](respondWithResult(_0x25ac0a,null))[_0x64cc('0x5d')](handleError(_0x25ac0a,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index af70d3e..33ab307 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 _0x18bd=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','update'];(function(_0x13175f,_0x4133d6){var _0x1f127c=function(_0x536b62){while(--_0x536b62){_0x13175f['push'](_0x13175f['shift']());}};_0x1f127c(++_0x4133d6);}(_0x18bd,0xbc));var _0xd18b=function(_0x552213,_0x52fc2c){_0x552213=_0x552213-0x0;var _0x4e442c=_0x18bd[_0x552213];return _0x4e442c;};'use strict';var EventEmitter=require(_0xd18b('0x0'));var FaxAccount=require(_0xd18b('0x1'))['db'][_0xd18b('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd18b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5a3442){return function(_0x4ba506,_0x2c02fa,_0xd2c547){FaxAccountEvents[_0xd18b('0x4')](_0x5a3442+':'+_0x4ba506['id'],_0x4ba506);FaxAccountEvents[_0xd18b('0x4')](_0x5a3442,_0x4ba506);_0xd2c547(null);};}for(var e in events){if(events[_0xd18b('0x5')](e)){var event=events[e];FaxAccount[_0xd18b('0x6')](e,emitEvent(event));}}module[_0xd18b('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x1d03=['events','FaxAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x1daecb,_0x565218){var _0x184096=function(_0x5d0ecd){while(--_0x5d0ecd){_0x1daecb['push'](_0x1daecb['shift']());}};_0x184096(++_0x565218);}(_0x1d03,0xe8));var _0x31d0=function(_0x55ea00,_0x2ff870){_0x55ea00=_0x55ea00-0x0;var _0x4758e1=_0x1d03[_0x55ea00];return _0x4758e1;};'use strict';var EventEmitter=require(_0x31d0('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x31d0('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x31d0('0x2')](0x0);var events={'afterCreate':_0x31d0('0x3'),'afterUpdate':'update','afterDestroy':_0x31d0('0x4')};function emitEvent(_0x4303dc){return function(_0x4069ef,_0x589d43,_0x3e3e0c){FaxAccountEvents[_0x31d0('0x5')](_0x4303dc+':'+_0x4069ef['id'],_0x4069ef);FaxAccountEvents[_0x31d0('0x5')](_0x4303dc,_0x4069ef);_0x3e3e0c(null);};}for(var e in events){if(events[_0x31d0('0x6')](e)){var event=events[e];FaxAccount[_0x31d0('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 99063b9..02bb84a 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 _0x31b6=['define','util','api','moment','bluebird','request-promise','../../config/environment','./faxAccount.attributes'];(function(_0x3d73bb,_0x3fd90c){var _0x22e70c=function(_0x3d91ee){while(--_0x3d91ee){_0x3d73bb['push'](_0x3d73bb['shift']());}};_0x22e70c(++_0x3fd90c);}(_0x31b6,0x79));var _0x631b=function(_0x2f102d,_0x39d6b9){_0x2f102d=_0x2f102d-0x0;var _0x12f3d9=_0x31b6[_0x2f102d];return _0x12f3d9;};'use strict';var _=require('lodash');var util=require(_0x631b('0x0'));var logger=require('../../config/logger')(_0x631b('0x1'));var moment=require(_0x631b('0x2'));var BPromise=require(_0x631b('0x3'));var rp=require(_0x631b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x631b('0x5'));var attributes=require(_0x631b('0x6'));module['exports']=function(_0x4356c1,_0x11e43a){return _0x4356c1[_0x631b('0x7')]('FaxAccount',attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3473=['FaxAccount','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define'];(function(_0x4fbc6c,_0x3b00af){var _0x2c0d74=function(_0x517967){while(--_0x517967){_0x4fbc6c['push'](_0x4fbc6c['shift']());}};_0x2c0d74(++_0x3b00af);}(_0x3473,0xe5));var _0x3347=function(_0x76e09b,_0x5d18a3){_0x76e09b=_0x76e09b-0x0;var _0xd18014=_0x3473[_0x76e09b];return _0xd18014;};'use strict';var _=require(_0x3347('0x0'));var util=require(_0x3347('0x1'));var logger=require('../../config/logger')(_0x3347('0x2'));var moment=require(_0x3347('0x3'));var BPromise=require('bluebird');var rp=require(_0x3347('0x4'));var fs=require('fs');var path=require(_0x3347('0x5'));var rimraf=require(_0x3347('0x6'));var config=require(_0x3347('0x7'));var attributes=require(_0x3347('0x8'));module[_0x3347('0x9')]=function(_0x6e08ab,_0x21d082){return _0x6e08ab[_0x3347('0xa')](_0x3347('0xb'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 454e040..4a500eb 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 _0xfdb0=['ContactId','AttachmentId','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./faxAccount.socket','register','then','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','FaxAccount,\x20%s,\x20%s','catch','FaxAccount','findAll','options','raw','where','attributes','map','include','model','info','GetFaxAccount','debug','body','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','ValidationError','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','FaxApplication','Applications','List','get','account','applications','orderBy','priority','Contacts','create','FaxInteraction','Contact\x20not\x20found','spread','push','length','close','unmanaged','*,*,*,*','created','interaction'];(function(_0x2df2b9,_0x12d8d6){var _0x5791b6=function(_0xe3559b){while(--_0xe3559b){_0x2df2b9['push'](_0x2df2b9['shift']());}};_0x5791b6(++_0x12d8d6);}(_0xfdb0,0x10b));var _0x0fdb=function(_0x303480,_0xef7888){_0x303480=_0x303480-0x0;var _0x3e9639=_0xfdb0[_0x303480];return _0x3e9639;};'use strict';var _=require(_0x0fdb('0x0'));var util=require(_0x0fdb('0x1'));var moment=require(_0x0fdb('0x2'));var BPromise=require(_0x0fdb('0x3'));var rs=require(_0x0fdb('0x4'));var fs=require('fs');var Redis=require(_0x0fdb('0x5'));var db=require(_0x0fdb('0x6'))['db'];var utils=require(_0x0fdb('0x7'));var logger=require(_0x0fdb('0x8'))(_0x0fdb('0x9'));var config=require(_0x0fdb('0xa'));var jayson=require(_0x0fdb('0xb'));var client=jayson['client'][_0x0fdb('0xc')]({'port':0x232c});config[_0x0fdb('0xd')]=_[_0x0fdb('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0fdb('0xf'))(new Redis(config[_0x0fdb('0xd')]));require(_0x0fdb('0x10'))[_0x0fdb('0x11')](socket);function respondWithRpcPromise(_0x18049b,_0x5d5360,_0x29928f){return new BPromise(function(_0x3524ae,_0x10d321){return client['request'](_0x18049b,_0x29928f)[_0x0fdb('0x12')](function(_0xcc5d47){logger['info']('FaxAccount,\x20%s,\x20%s',_0x5d5360,_0x0fdb('0x13'));logger['debug'](_0x0fdb('0x14'),_0x5d5360,'request\x20sent',JSON[_0x0fdb('0x15')](_0xcc5d47));if(_0xcc5d47['error']){if(_0xcc5d47['error']['code']===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x5d5360,_0xcc5d47[_0x0fdb('0x16')]['message']);return _0x10d321(_0xcc5d47[_0x0fdb('0x16')][_0x0fdb('0x17')]);}logger[_0x0fdb('0x16')](_0x0fdb('0x18'),_0x5d5360,_0xcc5d47[_0x0fdb('0x16')][_0x0fdb('0x17')]);return _0x3524ae(_0xcc5d47[_0x0fdb('0x16')][_0x0fdb('0x17')]);}else{logger['info'](_0x0fdb('0x18'),_0x5d5360,_0x0fdb('0x13'));_0x3524ae(_0xcc5d47['result'][_0x0fdb('0x17')]);}})[_0x0fdb('0x19')](function(_0x5e83a3){logger[_0x0fdb('0x16')](_0x0fdb('0x18'),_0x5d5360,_0x5e83a3);_0x10d321(_0x5e83a3);});});}exports['GetFaxAccount']=function(_0x3be977){var _0x1d14dd=this;return new Promise(function(_0x24ea45,_0x2fed0a){return db[_0x0fdb('0x1a')][_0x0fdb('0x1b')]({'raw':_0x3be977[_0x0fdb('0x1c')]?_0x3be977[_0x0fdb('0x1c')][_0x0fdb('0x1d')]===undefined?!![]:![]:!![],'where':_0x3be977[_0x0fdb('0x1c')]?_0x3be977[_0x0fdb('0x1c')][_0x0fdb('0x1e')]||null:null,'attributes':_0x3be977[_0x0fdb('0x1c')]?_0x3be977[_0x0fdb('0x1c')][_0x0fdb('0x1f')]||null:null,'limit':_0x3be977[_0x0fdb('0x1c')]?_0x3be977[_0x0fdb('0x1c')]['limit']||null:null,'include':_0x3be977[_0x0fdb('0x1c')]?_0x3be977['options']['include']?_[_0x0fdb('0x20')](_0x3be977['options'][_0x0fdb('0x21')],function(_0x3c8eb1){return{'model':db[_0x3c8eb1['model']],'as':_0x3c8eb1['as'],'attributes':_0x3c8eb1['attributes'],'include':_0x3c8eb1['include']?_[_0x0fdb('0x20')](_0x3c8eb1[_0x0fdb('0x21')],function(_0x1473cd){return{'model':db[_0x1473cd[_0x0fdb('0x22')]],'as':_0x1473cd['as'],'attributes':_0x1473cd['attributes'],'include':_0x1473cd[_0x0fdb('0x21')]?_['map'](_0x1473cd[_0x0fdb('0x21')],function(_0x3c7f74){return{'model':db[_0x3c7f74[_0x0fdb('0x22')]],'as':_0x3c7f74['as'],'attributes':_0x3c7f74[_0x0fdb('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0fdb('0x12')](function(_0x5cda00){logger[_0x0fdb('0x23')](_0x0fdb('0x24'),_0x3be977);logger[_0x0fdb('0x25')](_0x0fdb('0x24'),_0x3be977,JSON[_0x0fdb('0x15')](_0x5cda00));_0x24ea45(_0x5cda00);})[_0x0fdb('0x19')](function(_0x4c49f6){logger[_0x0fdb('0x16')](_0x0fdb('0x24'),_0x4c49f6[_0x0fdb('0x17')],_0x3be977);_0x2fed0a(_0x1d14dd[_0x0fdb('0x16')](0x1f4,_0x4c49f6['message']));});});};exports['NotifyFaxAccount']=function(_0x4cebae,_0x2fccdb,_0x4a8ff3){var _0x3c1c1e=this;return new Promise(function(_0x5b6fc5,_0x53ac8e){var _0x1637ed={'body':_0x4cebae[_0x0fdb('0x26')],'channel':_0x0fdb('0x27')};var _0x304b7f=[];var _0x34b8ac=[];var _0x1e1674={};return db[_0x0fdb('0x28')][_0x0fdb('0x29')]()[_0x0fdb('0x12')](function(_0x962987){if(!_0x962987){throw new db[(_0x0fdb('0x2a'))]['ValidationError'](_0x0fdb('0x2b'));}_0x304b7f=_[_0x0fdb('0x2c')](_[_0x0fdb('0x2d')](_0x962987),[_0x0fdb('0x2e'),'updatedAt']);_0x34b8ac=_[_0x0fdb('0x2c')](_[_0x0fdb('0x2d')](_0x962987),[_0x0fdb('0x2e'),_0x0fdb('0x2f'),_0x0fdb('0x30'),_0x0fdb('0x31')]);if(_0x4cebae[_0x0fdb('0x26')]['id']){delete _0x4cebae[_0x0fdb('0x26')]['id'];}if(_[_0x0fdb('0x32')](_0x4cebae[_0x0fdb('0x26')][_0x0fdb('0x33')])){throw new db[(_0x0fdb('0x2a'))]['ValidationError'](_0x0fdb('0x34'));}if(_[_0x0fdb('0x32')](_0x4cebae[_0x0fdb('0x26')][_0x0fdb('0x26')])||_0x4cebae[_0x0fdb('0x26')][_0x0fdb('0x26')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x4cebae[_0x0fdb('0x26')]['mapKey'])){throw new db[(_0x0fdb('0x2a'))][(_0x0fdb('0x35'))](_0x0fdb('0x36')+_0x34b8ac);}if(!_['includes'](_0x34b8ac,_0x4cebae[_0x0fdb('0x26')][_0x0fdb('0x37')])){throw new db[(_0x0fdb('0x2a'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x34b8ac);}_0x1e1674[_0x4cebae['body'][_0x0fdb('0x37')]]=_0x4cebae[_0x0fdb('0x26')][_0x0fdb('0x33')];})['then'](function(){return db[_0x0fdb('0x1a')][_0x0fdb('0x38')]({'where':{'id':_0x4cebae['account']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x0fdb('0x28')],'as':'Contacts','where':_0x1e1674,'limit':0x1,'order':[[_0x0fdb('0x2f'),'DESC']]}]},{'model':db[_0x0fdb('0x39')],'as':_0x0fdb('0x3a')}]});})['then'](function(_0x215e20){if(_0x215e20&&_0x215e20[_0x0fdb('0x3b')]){var _0x2e7d2f=_0x215e20[_0x0fdb('0x3c')]({'plain':!![]});_0x1637ed[_0x0fdb('0x3d')]=_0x2e7d2f;_0x1637ed['applications']=_0x2e7d2f['Applications'];_0x1637ed['list']=_0x2e7d2f[_0x0fdb('0x3b')];_0x1637ed[_0x0fdb('0x3e')]=_[_0x0fdb('0x3f')](_0x1637ed[_0x0fdb('0x3e')],[_0x0fdb('0x40')],['asc']);if(_0x1637ed[_0x0fdb('0x3d')][_0x0fdb('0x3a')]){delete _0x1637ed[_0x0fdb('0x3d')][_0x0fdb('0x3a')];}if(_0x1637ed[_0x0fdb('0x3d')][_0x0fdb('0x3b')]&&_0x1637ed[_0x0fdb('0x3d')]['List'][_0x0fdb('0x41')]['length']){return _0x1637ed[_0x0fdb('0x3d')][_0x0fdb('0x3b')][_0x0fdb('0x41')][0x0];}var _0x1354e7=_[_0x0fdb('0xe')](_0x4cebae[_0x0fdb('0x26')],{'firstName':_0x4cebae['body'][_0x0fdb('0x33')],'ListId':_0x2e7d2f[_0x0fdb('0x31')]});_0x1354e7[_0x4cebae[_0x0fdb('0x26')][_0x0fdb('0x37')]]=_0x4cebae['body'][_0x0fdb('0x33')];return db[_0x0fdb('0x28')][_0x0fdb('0x42')](_0x1354e7,{'fields':_0x304b7f,'raw':!![]});}})[_0x0fdb('0x12')](function(_0x3478e1){_0x1637ed['contact']=_0x3478e1;if(_0x3478e1){var _0x546e31={'ContactId':_0x3478e1['id'],'FaxAccountId':_0x4cebae[_0x0fdb('0x3d')]['id'],'fax':_0x3478e1[_0x0fdb('0x27')]};return db[_0x0fdb('0x43')][_0x0fdb('0x38')]({'where':{'ContactId':_0x3478e1['id'],'closed':![],'FaxAccountId':_0x4cebae[_0x0fdb('0x3d')]['id']}})['then'](function(_0x101ef3){if(_0x101ef3){return[_0x101ef3,![]];}return db[_0x0fdb('0x43')][_0x0fdb('0x42')](_0x546e31)['then'](function(_0x81ebe){return[_0x81ebe,!![]];});});}else{throw new Error(_0x0fdb('0x44'));}})[_0x0fdb('0x45')](function(_0x38306b,_0x5e6fb4){var _0x5e5342=_0x38306b['get']({'plain':!![]});if(_0x5e6fb4){if(_0x1637ed[_0x0fdb('0x3d')]['autoclose']){_0x1637ed[_0x0fdb('0x3e')][_0x0fdb('0x46')]({'id':0x0,'priority':_0x1637ed['applications'][_0x0fdb('0x47')]+0x1,'app':_0x0fdb('0x48'),'appdata':_0x0fdb('0x49'),'interval':_0x0fdb('0x4a')});}_0x5e5342[_0x0fdb('0x4b')]=!![];}else{_0x5e5342[_0x0fdb('0x4b')]=![];}_0x1637ed[_0x0fdb('0x4c')]=_0x5e5342;return db['FaxMessage']['create']({'body':_0x4cebae[_0x0fdb('0x26')][_0x0fdb('0x26')],'FaxAccountId':_0x4cebae[_0x0fdb('0x3d')]['id'],'FaxInteractionId':_0x38306b['id'],'direction':'in','ContactId':_0x38306b[_0x0fdb('0x4d')],'AttachmentId':_0x4cebae[_0x0fdb('0x26')][_0x0fdb('0x4e')]});})[_0x0fdb('0x12')](function(_0x141458){_0x1637ed[_0x0fdb('0x17')]=_0x141458;if(_0x1637ed[_0x0fdb('0x4c')][_0x0fdb('0x4f')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x1637ed[_0x0fdb('0x4c')][_0x0fdb('0x4f')]}})[_0x0fdb('0x12')](function(_0x16ab2d){if(_0x16ab2d){_0x1637ed[_0x0fdb('0x3e')][_0x0fdb('0x50')]({'id':0x0,'priority':0x0,'app':_0x0fdb('0x51'),'appdata':_0x16ab2d[_0x0fdb('0x52')]+','+(_0x1637ed[_0x0fdb('0x3d')][_0x0fdb('0x53')]||0xa),'interval':_0x0fdb('0x4a')});}return respondWithRpcPromise(_0x0fdb('0x54'),_0x0fdb('0x55'),_0x1637ed);});}return respondWithRpcPromise('Start',_0x0fdb('0x55'),_0x1637ed);})[_0x0fdb('0x12')](function(_0x29dff9){_0x5b6fc5(_0x29dff9);})[_0x0fdb('0x19')](function(_0x2fa11d){_0x53ac8e(_0x3c1c1e[_0x0fdb('0x16')](0x1f4,_0x2fa11d[_0x0fdb('0x17')]));});});}; \ No newline at end of file +var _0x4b4e=['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','account','CmList','List','Contacts','FaxApplication','Applications','applications','list','orderBy','priority','length','create','contact','FaxInteraction','find','Contact\x20not\x20found','spread','get','autoclose','push','close','unmanaged','*,*,*,*','interaction','FaxMessage','ContactId','AttachmentId','UserId','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFaxAccount','FaxAccount','options','raw','where','limit','include','map','attributes','model','catch','NotifyFaxAccount','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','keys','updatedAt','CompanyId','body','from','ValidationError','from\x20is\x20mandatory','isNil'];(function(_0x22fa35,_0x92e11){var _0x4244c6=function(_0x5d6ea0){while(--_0x5d6ea0){_0x22fa35['push'](_0x22fa35['shift']());}};_0x4244c6(++_0x92e11);}(_0x4b4e,0x1e3));var _0xe4b4=function(_0x8524c0,_0x5af8fd){_0x8524c0=_0x8524c0-0x0;var _0x5d1ea5=_0x4b4e[_0x8524c0];return _0x5d1ea5;};'use strict';var _=require(_0xe4b4('0x0'));var util=require(_0xe4b4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4b4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe4b4('0x3'));var logger=require(_0xe4b4('0x4'))(_0xe4b4('0x5'));var config=require(_0xe4b4('0x6'));var jayson=require(_0xe4b4('0x7'));var client=jayson[_0xe4b4('0x8')][_0xe4b4('0x9')]({'port':0x232c});config[_0xe4b4('0xa')]=_['defaults'](config[_0xe4b4('0xa')],{'host':_0xe4b4('0xb'),'port':0x18eb});var socket=require(_0xe4b4('0xc'))(new Redis(config[_0xe4b4('0xa')]));require(_0xe4b4('0xd'))[_0xe4b4('0xe')](socket);function respondWithRpcPromise(_0x1bab62,_0x59672e,_0x980609){return new BPromise(function(_0x63eedf,_0x25825b){return client[_0xe4b4('0xf')](_0x1bab62,_0x980609)[_0xe4b4('0x10')](function(_0x5d3550){logger[_0xe4b4('0x11')](_0xe4b4('0x12'),_0x59672e,_0xe4b4('0x13'));logger[_0xe4b4('0x14')](_0xe4b4('0x15'),_0x59672e,_0xe4b4('0x13'),JSON[_0xe4b4('0x16')](_0x5d3550));if(_0x5d3550['error']){if(_0x5d3550[_0xe4b4('0x17')]['code']===0x1f4){logger[_0xe4b4('0x17')](_0xe4b4('0x12'),_0x59672e,_0x5d3550[_0xe4b4('0x17')][_0xe4b4('0x18')]);return _0x25825b(_0x5d3550[_0xe4b4('0x17')]['message']);}logger[_0xe4b4('0x17')](_0xe4b4('0x12'),_0x59672e,_0x5d3550[_0xe4b4('0x17')]['message']);return _0x63eedf(_0x5d3550['error']['message']);}else{logger['info'](_0xe4b4('0x12'),_0x59672e,_0xe4b4('0x13'));_0x63eedf(_0x5d3550[_0xe4b4('0x19')][_0xe4b4('0x18')]);}})['catch'](function(_0x42f7ba){logger['error'](_0xe4b4('0x12'),_0x59672e,_0x42f7ba);_0x25825b(_0x42f7ba);});});}exports[_0xe4b4('0x1a')]=function(_0x2beaf4){var _0x130f02=this;return new Promise(function(_0x2d77ca,_0x3bbe49){return db[_0xe4b4('0x1b')]['findAll']({'raw':_0x2beaf4[_0xe4b4('0x1c')]?_0x2beaf4['options'][_0xe4b4('0x1d')]===undefined?!![]:![]:!![],'where':_0x2beaf4[_0xe4b4('0x1c')]?_0x2beaf4[_0xe4b4('0x1c')][_0xe4b4('0x1e')]||null:null,'attributes':_0x2beaf4[_0xe4b4('0x1c')]?_0x2beaf4[_0xe4b4('0x1c')]['attributes']||null:null,'limit':_0x2beaf4['options']?_0x2beaf4[_0xe4b4('0x1c')][_0xe4b4('0x1f')]||null:null,'include':_0x2beaf4[_0xe4b4('0x1c')]?_0x2beaf4['options'][_0xe4b4('0x20')]?_[_0xe4b4('0x21')](_0x2beaf4[_0xe4b4('0x1c')]['include'],function(_0x2811d5){return{'model':db[_0x2811d5['model']],'as':_0x2811d5['as'],'attributes':_0x2811d5[_0xe4b4('0x22')],'include':_0x2811d5[_0xe4b4('0x20')]?_[_0xe4b4('0x21')](_0x2811d5[_0xe4b4('0x20')],function(_0x337108){return{'model':db[_0x337108[_0xe4b4('0x23')]],'as':_0x337108['as'],'attributes':_0x337108[_0xe4b4('0x22')],'include':_0x337108[_0xe4b4('0x20')]?_['map'](_0x337108[_0xe4b4('0x20')],function(_0x234e3a){return{'model':db[_0x234e3a[_0xe4b4('0x23')]],'as':_0x234e3a['as'],'attributes':_0x234e3a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x540696){logger['info'](_0xe4b4('0x1a'),_0x2beaf4);logger[_0xe4b4('0x14')]('GetFaxAccount',_0x2beaf4,JSON['stringify'](_0x540696));_0x2d77ca(_0x540696);})[_0xe4b4('0x24')](function(_0x4d0983){logger[_0xe4b4('0x17')](_0xe4b4('0x1a'),_0x4d0983[_0xe4b4('0x18')],_0x2beaf4);_0x3bbe49(_0x130f02[_0xe4b4('0x17')](0x1f4,_0x4d0983['message']));});});};exports[_0xe4b4('0x25')]=function(_0x34f414,_0x55b7e7,_0x416725){var _0x143ba8=this;return new Promise(function(_0x21146c,_0x79e29f){var _0x18c43f={'body':_0x34f414['body'],'channel':'fax'};var _0x505e5a=[];var _0x566177=[];var _0x5e241b={};return db[_0xe4b4('0x26')]['describe']()['then'](function(_0x6c4dd4){if(!_0x6c4dd4){throw new db[(_0xe4b4('0x27'))]['ValidationError'](_0xe4b4('0x28'));}_0x505e5a=_[_0xe4b4('0x29')](_['keys'](_0x6c4dd4),[_0xe4b4('0x2a'),'updatedAt']);_0x566177=_[_0xe4b4('0x29')](_[_0xe4b4('0x2b')](_0x6c4dd4),['createdAt',_0xe4b4('0x2c'),_0xe4b4('0x2d'),'ListId']);if(_0x34f414[_0xe4b4('0x2e')]['id']){delete _0x34f414[_0xe4b4('0x2e')]['id'];}if(_['isNil'](_0x34f414[_0xe4b4('0x2e')][_0xe4b4('0x2f')])){throw new db[(_0xe4b4('0x27'))][(_0xe4b4('0x30'))](_0xe4b4('0x31'));}if(_[_0xe4b4('0x32')](_0x34f414[_0xe4b4('0x2e')]['body'])||_0x34f414[_0xe4b4('0x2e')]['body']===''){throw new db[(_0xe4b4('0x27'))][(_0xe4b4('0x30'))](_0xe4b4('0x33'));}if(_[_0xe4b4('0x32')](_0x34f414[_0xe4b4('0x2e')][_0xe4b4('0x34')])){throw new db[(_0xe4b4('0x27'))][(_0xe4b4('0x30'))](_0xe4b4('0x35')+_0x566177);}if(!_[_0xe4b4('0x36')](_0x566177,_0x34f414[_0xe4b4('0x2e')]['mapKey'])){throw new db[(_0xe4b4('0x27'))]['ValidationError'](_0xe4b4('0x37')+_0x566177);}_0x5e241b[_0x34f414[_0xe4b4('0x2e')][_0xe4b4('0x34')]]=_0x34f414['body']['from'];})[_0xe4b4('0x10')](function(){return db[_0xe4b4('0x1b')]['find']({'where':{'id':_0x34f414[_0xe4b4('0x38')]['id']},'include':[{'model':db[_0xe4b4('0x39')],'as':_0xe4b4('0x3a'),'include':[{'model':db[_0xe4b4('0x26')],'as':_0xe4b4('0x3b'),'where':_0x5e241b,'limit':0x1,'order':[[_0xe4b4('0x2c'),'DESC']]}]},{'model':db[_0xe4b4('0x3c')],'as':_0xe4b4('0x3d')}]});})['then'](function(_0x3e4fca){if(_0x3e4fca&&_0x3e4fca['List']){var _0x1ea0ae=_0x3e4fca['get']({'plain':!![]});_0x18c43f['account']=_0x1ea0ae;_0x18c43f[_0xe4b4('0x3e')]=_0x1ea0ae[_0xe4b4('0x3d')];_0x18c43f[_0xe4b4('0x3f')]=_0x1ea0ae[_0xe4b4('0x3a')];_0x18c43f['applications']=_[_0xe4b4('0x40')](_0x18c43f[_0xe4b4('0x3e')],[_0xe4b4('0x41')],['asc']);if(_0x18c43f[_0xe4b4('0x38')]['Applications']){delete _0x18c43f[_0xe4b4('0x38')][_0xe4b4('0x3d')];}if(_0x18c43f['account']['List']&&_0x18c43f[_0xe4b4('0x38')]['List'][_0xe4b4('0x3b')][_0xe4b4('0x42')]){return _0x18c43f[_0xe4b4('0x38')][_0xe4b4('0x3a')][_0xe4b4('0x3b')][0x0];}var _0x2776c1=_['defaults'](_0x34f414[_0xe4b4('0x2e')],{'firstName':_0x34f414[_0xe4b4('0x2e')][_0xe4b4('0x2f')],'ListId':_0x1ea0ae['ListId']});_0x2776c1[_0x34f414['body']['mapKey']]=_0x34f414[_0xe4b4('0x2e')]['from'];return db['CmContact'][_0xe4b4('0x43')](_0x2776c1,{'fields':_0x505e5a,'raw':!![]});}})['then'](function(_0x10fa97){_0x18c43f[_0xe4b4('0x44')]=_0x10fa97;if(_0x10fa97){var _0x443f68={'ContactId':_0x10fa97['id'],'FaxAccountId':_0x34f414['account']['id'],'fax':_0x10fa97['fax']};return db[_0xe4b4('0x45')][_0xe4b4('0x46')]({'where':{'ContactId':_0x10fa97['id'],'closed':![],'FaxAccountId':_0x34f414[_0xe4b4('0x38')]['id']}})[_0xe4b4('0x10')](function(_0x28309d){if(_0x28309d){return[_0x28309d,![]];}return db[_0xe4b4('0x45')][_0xe4b4('0x43')](_0x443f68)['then'](function(_0x196308){return[_0x196308,!![]];});});}else{throw new Error(_0xe4b4('0x47'));}})[_0xe4b4('0x48')](function(_0x30d837,_0x47af5d){var _0x5b9f0a=_0x30d837[_0xe4b4('0x49')]({'plain':!![]});if(_0x47af5d){if(_0x18c43f[_0xe4b4('0x38')][_0xe4b4('0x4a')]){_0x18c43f[_0xe4b4('0x3e')][_0xe4b4('0x4b')]({'id':0x0,'priority':_0x18c43f[_0xe4b4('0x3e')][_0xe4b4('0x42')]+0x1,'app':_0xe4b4('0x4c'),'appdata':_0xe4b4('0x4d'),'interval':_0xe4b4('0x4e')});}_0x5b9f0a['created']=!![];}else{_0x5b9f0a['created']=![];}_0x18c43f[_0xe4b4('0x4f')]=_0x5b9f0a;return db[_0xe4b4('0x50')][_0xe4b4('0x43')]({'body':_0x34f414[_0xe4b4('0x2e')][_0xe4b4('0x2e')],'FaxAccountId':_0x34f414['account']['id'],'FaxInteractionId':_0x30d837['id'],'direction':'in','ContactId':_0x30d837[_0xe4b4('0x51')],'AttachmentId':_0x34f414[_0xe4b4('0x2e')][_0xe4b4('0x52')]});})['then'](function(_0x5a7f0f){_0x18c43f[_0xe4b4('0x18')]=_0x5a7f0f;if(_0x18c43f[_0xe4b4('0x4f')][_0xe4b4('0x53')]){return db['User'][_0xe4b4('0x46')]({'attributes':['id','name'],'where':{'id':_0x18c43f[_0xe4b4('0x4f')][_0xe4b4('0x53')]}})[_0xe4b4('0x10')](function(_0x418568){if(_0x418568){_0x18c43f[_0xe4b4('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0xe4b4('0x54'),'appdata':_0x418568[_0xe4b4('0x55')]+','+(_0x18c43f[_0xe4b4('0x38')][_0xe4b4('0x56')]||0xa),'interval':_0xe4b4('0x4e')});}return respondWithRpcPromise(_0xe4b4('0x57'),_0xe4b4('0x58'),_0x18c43f);});}return respondWithRpcPromise('Start','startRouting',_0x18c43f);})[_0xe4b4('0x10')](function(_0x2a23c9){_0x21146c(_0x2a23c9);})['catch'](function(_0x363ae8){_0x79e29f(_0x143ba8[_0xe4b4('0x17')](0x1f4,_0x363ae8[_0xe4b4('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 1747200..06e12be 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 _0x1a85=['emit','register','length','faxAccount:','remove','update'];(function(_0x4b6380,_0x1c4757){var _0x35efce=function(_0x5be67a){while(--_0x5be67a){_0x4b6380['push'](_0x4b6380['shift']());}};_0x35efce(++_0x1c4757);}(_0x1a85,0x178));var _0x51a8=function(_0x2b35ca,_0x4943ce){_0x2b35ca=_0x2b35ca-0x0;var _0x68389e=_0x1a85[_0x2b35ca];return _0x68389e;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save',_0x51a8('0x0'),_0x51a8('0x1')];function createListener(_0x43e22a,_0x498466){return function(_0x562d89){_0x498466[_0x51a8('0x2')](_0x43e22a,_0x562d89);};}function removeListener(_0x1377a4,_0x99e371){return function(){FaxAccountEvents['removeListener'](_0x1377a4,_0x99e371);};}exports[_0x51a8('0x3')]=function(_0x4b76a8){for(var _0x2c1180=0x0,_0x5cf430=events[_0x51a8('0x4')];_0x2c1180<_0x5cf430;_0x2c1180++){var _0x16a21e=events[_0x2c1180];var _0x4f3919=createListener(_0x51a8('0x5')+_0x16a21e,_0x4b76a8);FaxAccountEvents['on'](_0x16a21e,_0x4f3919);}}; \ No newline at end of file +var _0xbff5=['register','length','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xbff5,0x1bc));var _0x5bff=function(_0x209251,_0xcbf1d1){_0x209251=_0x209251-0x0;var _0x1f01e6=_0xbff5[_0x209251];return _0x1f01e6;};'use strict';var FaxAccountEvents=require(_0x5bff('0x0'));var events=[_0x5bff('0x1'),_0x5bff('0x2'),_0x5bff('0x3')];function createListener(_0x41c38b,_0x43a41b){return function(_0x3bd90c){_0x43a41b['emit'](_0x41c38b,_0x3bd90c);};}function removeListener(_0x3868ae,_0x486083){return function(){FaxAccountEvents['removeListener'](_0x3868ae,_0x486083);};}exports[_0x5bff('0x4')]=function(_0x1d8650){for(var _0x151add=0x0,_0xa54c57=events[_0x5bff('0x5')];_0x151add<_0xa54c57;_0x151add++){var _0xd4b9dc=events[_0x151add];var _0x1acb49=createListener(_0x5bff('0x6')+_0xd4b9dc,_0x1d8650);FaxAccountEvents['on'](_0xd4b9dc,_0x1acb49);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 51daabb..624ecf9 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 _0x017a=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getInteractions','getApplications','getMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/interactions','addInteraction','/:id/applications','addApplications','addAccountApplications','updateAccountApplications','/:id/send','send','addAgents','put','destroy','removeDispositions','removeAnswers','delete','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x1255bb,_0x1a40f9){var _0x54bc3b=function(_0x5bca2d){while(--_0x5bca2d){_0x1255bb['push'](_0x1255bb['shift']());}};_0x54bc3b(++_0x1a40f9);}(_0x017a,0x152));var _0xa017=function(_0x4e3d96,_0x41fd28){_0x4e3d96=_0x4e3d96-0x0;var _0x1a733d=_0x017a[_0x4e3d96];return _0x1a733d;};'use strict';var multer=require(_0xa017('0x0'));var util=require(_0xa017('0x1'));var path=require(_0xa017('0x2'));var timeout=require('connect-timeout');var express=require(_0xa017('0x3'));var router=express[_0xa017('0x4')]();var auth=require(_0xa017('0x5'));var interaction=require(_0xa017('0x6'));var config=require(_0xa017('0x7'));var controller=require(_0xa017('0x8'));router[_0xa017('0x9')]('/',auth[_0xa017('0xa')](),controller[_0xa017('0xb')]);router[_0xa017('0x9')](_0xa017('0xc'),auth[_0xa017('0xa')](),controller[_0xa017('0xd')]);router['get'](_0xa017('0xe'),auth[_0xa017('0xa')](),controller[_0xa017('0xf')]);router['get'](_0xa017('0x10'),auth[_0xa017('0xa')](),controller[_0xa017('0x11')]);router['get'](_0xa017('0x12'),auth[_0xa017('0xa')](),controller['getAnswers']);router[_0xa017('0x9')]('/:id/interactions',auth[_0xa017('0xa')](),controller[_0xa017('0x13')]);router['get']('/:id/applications',auth[_0xa017('0xa')](),controller[_0xa017('0x14')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xa017('0x15')]);router[_0xa017('0x9')](_0xa017('0x16'),auth[_0xa017('0xa')](),controller[_0xa017('0x17')]);router[_0xa017('0x18')]('/',auth['isAuthenticated'](),controller[_0xa017('0x19')]);router['post'](_0xa017('0x10'),auth[_0xa017('0xa')](),controller[_0xa017('0x1a')]);router[_0xa017('0x18')](_0xa017('0x12'),auth[_0xa017('0xa')](),controller[_0xa017('0x1b')]);router['post'](_0xa017('0x1c'),auth[_0xa017('0xa')](),controller[_0xa017('0x1d')]);router['post'](_0xa017('0x1e'),auth['isAuthenticated'](),controller[_0xa017('0x1f')]);router['post']('/addaccountapplications',auth[_0xa017('0xa')](),controller[_0xa017('0x20')]);router[_0xa017('0x18')]('/updateaccountapplications',auth[_0xa017('0xa')](),controller[_0xa017('0x21')]);router[_0xa017('0x18')](_0xa017('0x22'),auth[_0xa017('0xa')](),controller[_0xa017('0x23')]);router[_0xa017('0x18')](_0xa017('0x16'),auth['isAuthenticated'](),controller[_0xa017('0x24')]);router[_0xa017('0x25')](_0xa017('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xa017('0xa')](),controller[_0xa017('0x26')]);router['delete'](_0xa017('0x10'),auth['isAuthenticated'](),controller[_0xa017('0x27')]);router['delete']('/:id/canned_answers',auth[_0xa017('0xa')](),controller[_0xa017('0x28')]);router[_0xa017('0x29')](_0xa017('0x16'),auth[_0xa017('0xa')](),controller[_0xa017('0x2a')]);module[_0xa017('0x2b')]=router; \ No newline at end of file +var _0xbcad=['removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/canned_answers','getAnswers','/:id/interactions','getApplications','/:id/users','getAgents','create','post','addAnswer','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send','send','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers'];(function(_0x3e9d17,_0x364b36){var _0xe975b8=function(_0x4fcf1f){while(--_0x4fcf1f){_0x3e9d17['push'](_0x3e9d17['shift']());}};_0xe975b8(++_0x364b36);}(_0xbcad,0x160));var _0xdbca=function(_0x2314b4,_0x786713){_0x2314b4=_0x2314b4-0x0;var _0x310f5a=_0xbcad[_0x2314b4];return _0x310f5a;};'use strict';var multer=require(_0xdbca('0x0'));var util=require(_0xdbca('0x1'));var path=require(_0xdbca('0x2'));var timeout=require(_0xdbca('0x3'));var express=require(_0xdbca('0x4'));var router=express[_0xdbca('0x5')]();var auth=require(_0xdbca('0x6'));var interaction=require(_0xdbca('0x7'));var config=require(_0xdbca('0x8'));var controller=require('./faxAccount.controller');router[_0xdbca('0x9')]('/',auth[_0xdbca('0xa')](),controller[_0xdbca('0xb')]);router[_0xdbca('0x9')](_0xdbca('0xc'),auth[_0xdbca('0xa')](),controller['describe']);router[_0xdbca('0x9')](_0xdbca('0xd'),auth[_0xdbca('0xa')](),controller[_0xdbca('0xe')]);router[_0xdbca('0x9')]('/:id/dispositions',auth[_0xdbca('0xa')](),controller['getDispositions']);router[_0xdbca('0x9')](_0xdbca('0xf'),auth['isAuthenticated'](),controller[_0xdbca('0x10')]);router[_0xdbca('0x9')](_0xdbca('0x11'),auth[_0xdbca('0xa')](),controller['getInteractions']);router[_0xdbca('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0xdbca('0x12')]);router['get']('/:id/messages',auth[_0xdbca('0xa')](),controller['getMessages']);router[_0xdbca('0x9')](_0xdbca('0x13'),auth[_0xdbca('0xa')](),controller[_0xdbca('0x14')]);router['post']('/',auth[_0xdbca('0xa')](),controller[_0xdbca('0x15')]);router[_0xdbca('0x16')]('/:id/dispositions',auth[_0xdbca('0xa')](),controller['addDisposition']);router[_0xdbca('0x16')](_0xdbca('0xf'),auth[_0xdbca('0xa')](),controller[_0xdbca('0x17')]);router[_0xdbca('0x16')](_0xdbca('0x11'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xdbca('0x16')](_0xdbca('0x18'),auth[_0xdbca('0xa')](),controller[_0xdbca('0x19')]);router[_0xdbca('0x16')](_0xdbca('0x1a'),auth[_0xdbca('0xa')](),controller[_0xdbca('0x1b')]);router[_0xdbca('0x16')]('/updateaccountapplications',auth[_0xdbca('0xa')](),controller[_0xdbca('0x1c')]);router[_0xdbca('0x16')](_0xdbca('0x1d'),auth[_0xdbca('0xa')](),controller[_0xdbca('0x1e')]);router[_0xdbca('0x16')](_0xdbca('0x13'),auth[_0xdbca('0xa')](),controller[_0xdbca('0x1f')]);router[_0xdbca('0x20')](_0xdbca('0xd'),auth[_0xdbca('0xa')](),controller[_0xdbca('0x21')]);router[_0xdbca('0x22')](_0xdbca('0xd'),auth[_0xdbca('0xa')](),controller[_0xdbca('0x23')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xdbca('0x24')]);router[_0xdbca('0x22')](_0xdbca('0xf'),auth[_0xdbca('0xa')](),controller[_0xdbca('0x25')]);router[_0xdbca('0x22')](_0xdbca('0x13'),auth[_0xdbca('0xa')](),controller[_0xdbca('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 76377df..f139b93 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 _0xfc4f=['noop','TEXT','exports','INTEGER','STRING'];(function(_0xcaf223,_0xd39f07){var _0x17e00d=function(_0xe2852e){while(--_0xe2852e){_0xcaf223['push'](_0xcaf223['shift']());}};_0x17e00d(++_0xd39f07);}(_0xfc4f,0x192));var _0xffc4=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfc4f[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0xffc4('0x0')]={'priority':{'type':Sequelize[_0xffc4('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xffc4('0x2')],'allowNull':![],'defaultValue':_0xffc4('0x3')},'appdata':{'type':Sequelize[_0xffc4('0x4')]()},'description':{'type':Sequelize[_0xffc4('0x2')]},'interval':{'type':Sequelize[_0xffc4('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1af1=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x5482e6,_0x3fb3ea){var _0x4efe3f=function(_0x28ba69){while(--_0x28ba69){_0x5482e6['push'](_0x5482e6['shift']());}};_0x4efe3f(++_0x3fb3ea);}(_0x1af1,0x133));var _0x11af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1af1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x11af('0x0'));module[_0x11af('0x1')]={'priority':{'type':Sequelize[_0x11af('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x11af('0x3')],'allowNull':![],'defaultValue':_0x11af('0x4')},'appdata':{'type':Sequelize[_0x11af('0x5')]()},'description':{'type':Sequelize[_0x11af('0x3')]},'interval':{'type':Sequelize[_0x11af('0x3')],'defaultValue':_0x11af('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index f7bb0ea..3b05f8b 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 _0x5fc3=['hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','sendStatus','error','stack','name','send','index','FaxApplication','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields'];(function(_0x6f62dc,_0x166c69){var _0x1c495f=function(_0x25eb48){while(--_0x25eb48){_0x6f62dc['push'](_0x6f62dc['shift']());}};_0x1c495f(++_0x166c69);}(_0x5fc3,0xa8));var _0x35fc=function(_0x30d87a,_0xf3a07f){_0x30d87a=_0x30d87a-0x0;var _0x48f64b=_0x5fc3[_0x30d87a];return _0x48f64b;};'use strict';var pdf=require(_0x35fc('0x0'));var emlformat=require(_0x35fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35fc('0x2'));var jsonpatch=require(_0x35fc('0x3'));var rp=require(_0x35fc('0x4'));var moment=require(_0x35fc('0x5'));var BPromise=require(_0x35fc('0x6'));var Mustache=require('mustache');var util=require(_0x35fc('0x7'));var path=require(_0x35fc('0x8'));var sox=require(_0x35fc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0xe'));var querystring=require(_0x35fc('0xf'));var Papa=require(_0x35fc('0x10'));var Redis=require(_0x35fc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x12'));var as=require(_0x35fc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x14'))(_0x35fc('0x15'));var utils=require('../../config/utils');var config=require(_0x35fc('0x16'));var db=require(_0x35fc('0x17'))['db'];function respondWithStatusCode(_0x5469f5,_0x4cbe74){_0x4cbe74=_0x4cbe74||0xcc;return function(_0x409357){if(_0x409357){return _0x5469f5['sendStatus'](_0x4cbe74);}return _0x5469f5[_0x35fc('0x18')](_0x4cbe74)[_0x35fc('0x19')]();};}function respondWithResult(_0x2a6ad2,_0x29730f){_0x29730f=_0x29730f||0xc8;return function(_0x38d9f2){if(_0x38d9f2){return _0x2a6ad2['status'](_0x29730f)['json'](_0x38d9f2);}};}function respondWithFilteredResult(_0x5eac0f,_0x558364){return function(_0x398b67){if(_0x398b67){var _0x229d56=_0x398b67[_0x35fc('0x1a')],_0x53b898=_0x558364['offset'],_0x154958=_0x558364[_0x35fc('0x1b')]+_0x558364[_0x35fc('0x1c')],_0x227a49;if(_0x154958>=_0x229d56){_0x154958=_0x229d56;_0x227a49=0xc8;}else{_0x227a49=0xce;}_0x5eac0f['status'](_0x227a49);return _0x5eac0f[_0x35fc('0x1d')](_0x35fc('0x1e'),_0x53b898+'-'+_0x154958+'/'+_0x229d56)[_0x35fc('0x1f')](_0x398b67);}return null;};}function patchUpdates(_0x5f56c6){return function(_0x1a86e9){try{jsonpatch[_0x35fc('0x20')](_0x1a86e9,_0x5f56c6,!![]);}catch(_0x465eb3){return BPromise['reject'](_0x465eb3);}return _0x1a86e9[_0x35fc('0x21')]();};}function saveUpdates(_0x350a27,_0x3229d1){return function(_0x251a1f){if(_0x251a1f){return _0x251a1f[_0x35fc('0x22')](_0x350a27)[_0x35fc('0x23')](function(_0x155016){return _0x155016;});}return null;};}function removeEntity(_0x3b05b0,_0x2405e8){return function(_0x427eae){if(_0x427eae){return _0x427eae['destroy']()[_0x35fc('0x23')](function(){_0x3b05b0[_0x35fc('0x18')](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(!_0x55e9e7){_0x2d8183[_0x35fc('0x24')](0x194);}return _0x55e9e7;};}function handleError(_0x4c587a,_0x561bf8){_0x561bf8=_0x561bf8||0x1f4;return function(_0x265324){logger[_0x35fc('0x25')](_0x265324[_0x35fc('0x26')]);if(_0x265324['name']){delete _0x265324[_0x35fc('0x27')];}_0x4c587a['status'](_0x561bf8)[_0x35fc('0x28')](_0x265324);};}exports[_0x35fc('0x29')]=function(_0x5cb986,_0x519264){var _0x47774c={},_0x58edb6={},_0x274208={'count':0x0,'rows':[]};var _0x1a5d92=_['map'](db[_0x35fc('0x2a')][_0x35fc('0x2b')],function(_0x383837){return{'name':_0x383837[_0x35fc('0x2c')],'type':_0x383837[_0x35fc('0x2d')][_0x35fc('0x2e')]};});_0x58edb6[_0x35fc('0x2f')]=_[_0x35fc('0x30')](_0x1a5d92,'name');_0x58edb6[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0x5cb986[_0x35fc('0x31')]);_0x58edb6['filters']=_[_0x35fc('0x33')](_0x58edb6[_0x35fc('0x2f')],_0x58edb6[_0x35fc('0x31')]);_0x47774c[_0x35fc('0x34')]=_[_0x35fc('0x33')](_0x58edb6[_0x35fc('0x2f')],qs[_0x35fc('0x35')](_0x5cb986[_0x35fc('0x31')][_0x35fc('0x35')]));_0x47774c[_0x35fc('0x34')]=_0x47774c['attributes']['length']?_0x47774c[_0x35fc('0x34')]:_0x58edb6['model'];if(!_0x5cb986[_0x35fc('0x31')][_0x35fc('0x36')](_0x35fc('0x37'))){_0x47774c[_0x35fc('0x1c')]=qs[_0x35fc('0x1c')](_0x5cb986[_0x35fc('0x31')]['limit']);_0x47774c[_0x35fc('0x1b')]=qs[_0x35fc('0x1b')](_0x5cb986[_0x35fc('0x31')][_0x35fc('0x1b')]);}_0x47774c[_0x35fc('0x38')]=qs[_0x35fc('0x39')](_0x5cb986['query'][_0x35fc('0x39')]);_0x47774c[_0x35fc('0x3a')]=qs[_0x35fc('0x3b')](_['pick'](_0x5cb986[_0x35fc('0x31')],_0x58edb6['filters']),_0x1a5d92);if(_0x5cb986[_0x35fc('0x31')][_0x35fc('0x3c')]){_0x47774c[_0x35fc('0x3a')]=_[_0x35fc('0x3d')](_0x47774c['where'],{'$or':_['map'](_0x1a5d92,function(_0x59e4fb){if(_0x59e4fb[_0x35fc('0x2d')]!=='VIRTUAL'){var _0x20f8bb={};_0x20f8bb[_0x59e4fb['name']]={'$like':'%'+_0x5cb986[_0x35fc('0x31')][_0x35fc('0x3c')]+'%'};return _0x20f8bb;}})});}_0x47774c=_[_0x35fc('0x3d')]({},_0x47774c,_0x5cb986[_0x35fc('0x3e')]);var _0x1c10e0={'where':_0x47774c[_0x35fc('0x3a')]};return db[_0x35fc('0x2a')]['count'](_0x1c10e0)[_0x35fc('0x23')](function(_0x16087d){_0x274208['count']=_0x16087d;if(_0x5cb986[_0x35fc('0x31')][_0x35fc('0x3f')]){_0x47774c[_0x35fc('0x40')]=[{'all':!![]}];}return db[_0x35fc('0x2a')][_0x35fc('0x41')](_0x47774c);})[_0x35fc('0x23')](function(_0x58f25c){_0x274208[_0x35fc('0x42')]=_0x58f25c;return _0x274208;})[_0x35fc('0x23')](respondWithFilteredResult(_0x519264,_0x47774c))[_0x35fc('0x43')](handleError(_0x519264,null));};exports['show']=function(_0x17821e,_0x350a96){var _0x596919={'raw':!![],'where':{'id':_0x17821e[_0x35fc('0x44')]['id']}},_0x237548={};_0x237548[_0x35fc('0x2f')]=_[_0x35fc('0x32')](db[_0x35fc('0x2a')][_0x35fc('0x2b')]);_0x237548[_0x35fc('0x31')]=_[_0x35fc('0x32')](_0x17821e['query']);_0x237548['filters']=_[_0x35fc('0x33')](_0x237548[_0x35fc('0x2f')],_0x237548['query']);_0x596919['attributes']=_['intersection'](_0x237548[_0x35fc('0x2f')],qs[_0x35fc('0x35')](_0x17821e['query'][_0x35fc('0x35')]));_0x596919[_0x35fc('0x34')]=_0x596919[_0x35fc('0x34')][_0x35fc('0x45')]?_0x596919['attributes']:_0x237548['model'];if(_0x17821e['query']['includeAll']){_0x596919['include']=[{'all':!![]}];}_0x596919=_[_0x35fc('0x3d')]({},_0x596919,_0x17821e[_0x35fc('0x3e')]);return db['FaxApplication'][_0x35fc('0x46')](_0x596919)['then'](handleEntityNotFound(_0x350a96,null))[_0x35fc('0x23')](respondWithResult(_0x350a96,null))[_0x35fc('0x43')](handleError(_0x350a96,null));};exports[_0x35fc('0x47')]=function(_0x2de5d1,_0x16f7c8){return db['FaxApplication'][_0x35fc('0x47')](_0x2de5d1[_0x35fc('0x48')],{})['then'](respondWithResult(_0x16f7c8,0xc9))[_0x35fc('0x43')](handleError(_0x16f7c8,null));};exports[_0x35fc('0x22')]=function(_0x2a8a09,_0x211746){if(_0x2a8a09['body']['id']){delete _0x2a8a09[_0x35fc('0x48')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x2a8a09[_0x35fc('0x44')]['id']}})[_0x35fc('0x23')](handleEntityNotFound(_0x211746,null))[_0x35fc('0x23')](saveUpdates(_0x2a8a09[_0x35fc('0x48')],null))[_0x35fc('0x23')](respondWithResult(_0x211746,null))[_0x35fc('0x43')](handleError(_0x211746,null));};exports[_0x35fc('0x49')]=function(_0x16afa6,_0x4f555f){return db[_0x35fc('0x2a')][_0x35fc('0x46')]({'where':{'id':_0x16afa6[_0x35fc('0x44')]['id']}})[_0x35fc('0x23')](handleEntityNotFound(_0x4f555f,null))[_0x35fc('0x23')](removeEntity(_0x4f555f,null))[_0x35fc('0x43')](handleError(_0x4f555f,null));}; \ No newline at end of file +var _0x53ec=['stack','name','index','FaxApplication','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','show','rawAttributes','options','find','catch','create','body','params','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error'];(function(_0x906f15,_0x35d86a){var _0x238866=function(_0x49f64a){while(--_0x49f64a){_0x906f15['push'](_0x906f15['shift']());}};_0x238866(++_0x35d86a);}(_0x53ec,0x192));var _0xc53e=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0x53ec[_0x31172e];return _0x414ada;};'use strict';var pdf=require(_0xc53e('0x0'));var emlformat=require(_0xc53e('0x1'));var rimraf=require(_0xc53e('0x2'));var zipdir=require(_0xc53e('0x3'));var jsonpatch=require(_0xc53e('0x4'));var rp=require(_0xc53e('0x5'));var moment=require('moment');var BPromise=require(_0xc53e('0x6'));var Mustache=require('mustache');var util=require(_0xc53e('0x7'));var path=require(_0xc53e('0x8'));var sox=require('sox');var csv=require(_0xc53e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0x9'));var querystring=require(_0xc53e('0xe'));var Papa=require(_0xc53e('0xf'));var Redis=require(_0xc53e('0x10'));var authService=require(_0xc53e('0x11'));var qs=require(_0xc53e('0x12'));var as=require(_0xc53e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc53e('0x15'))['db'];function respondWithStatusCode(_0x9ffbcb,_0x863fa){_0x863fa=_0x863fa||0xcc;return function(_0x4203aa){if(_0x4203aa){return _0x9ffbcb['sendStatus'](_0x863fa);}return _0x9ffbcb['status'](_0x863fa)[_0xc53e('0x16')]();};}function respondWithResult(_0x19a772,_0x7cd798){_0x7cd798=_0x7cd798||0xc8;return function(_0x3d2e17){if(_0x3d2e17){return _0x19a772[_0xc53e('0x17')](_0x7cd798)[_0xc53e('0x18')](_0x3d2e17);}};}function respondWithFilteredResult(_0x3dc2fa,_0x19c0d1){return function(_0x455e4d){if(_0x455e4d){var _0x2ad6eb=_0x455e4d[_0xc53e('0x19')],_0x5b0a88=_0x19c0d1[_0xc53e('0x1a')],_0x8a522e=_0x19c0d1[_0xc53e('0x1a')]+_0x19c0d1[_0xc53e('0x1b')],_0x191567;if(_0x8a522e>=_0x2ad6eb){_0x8a522e=_0x2ad6eb;_0x191567=0xc8;}else{_0x191567=0xce;}_0x3dc2fa[_0xc53e('0x17')](_0x191567);return _0x3dc2fa[_0xc53e('0x1c')](_0xc53e('0x1d'),_0x5b0a88+'-'+_0x8a522e+'/'+_0x2ad6eb)['json'](_0x455e4d);}return null;};}function patchUpdates(_0x546fab){return function(_0x35b7b2){try{jsonpatch[_0xc53e('0x1e')](_0x35b7b2,_0x546fab,!![]);}catch(_0x421641){return BPromise[_0xc53e('0x1f')](_0x421641);}return _0x35b7b2[_0xc53e('0x20')]();};}function saveUpdates(_0x2cfe2b,_0x15a015){return function(_0x25702b){if(_0x25702b){return _0x25702b[_0xc53e('0x21')](_0x2cfe2b)[_0xc53e('0x22')](function(_0x17d825){return _0x17d825;});}return null;};}function removeEntity(_0x44fd93,_0x426467){return function(_0x4fb695){if(_0x4fb695){return _0x4fb695['destroy']()['then'](function(){_0x44fd93[_0xc53e('0x17')](0xcc)[_0xc53e('0x16')]();});}};}function handleEntityNotFound(_0x7591c1,_0x4015c8){return function(_0x180811){if(!_0x180811){_0x7591c1['sendStatus'](0x194);}return _0x180811;};}function handleError(_0x5e5377,_0xe06e42){_0xe06e42=_0xe06e42||0x1f4;return function(_0x496167){logger[_0xc53e('0x23')](_0x496167[_0xc53e('0x24')]);if(_0x496167[_0xc53e('0x25')]){delete _0x496167[_0xc53e('0x25')];}_0x5e5377[_0xc53e('0x17')](_0xe06e42)['send'](_0x496167);};}exports[_0xc53e('0x26')]=function(_0x4b9f6a,_0x4d9a68){var _0x5c65d3={},_0x3c5056={},_0x57a1f5={'count':0x0,'rows':[]};var _0x28240a=_['map'](db[_0xc53e('0x27')]['rawAttributes'],function(_0x5ce216){return{'name':_0x5ce216[_0xc53e('0x28')],'type':_0x5ce216[_0xc53e('0x29')][_0xc53e('0x2a')]};});_0x3c5056[_0xc53e('0x2b')]=_[_0xc53e('0x2c')](_0x28240a,_0xc53e('0x25'));_0x3c5056[_0xc53e('0x2d')]=_[_0xc53e('0x2e')](_0x4b9f6a['query']);_0x3c5056[_0xc53e('0x2f')]=_[_0xc53e('0x30')](_0x3c5056[_0xc53e('0x2b')],_0x3c5056['query']);_0x5c65d3[_0xc53e('0x31')]=_['intersection'](_0x3c5056[_0xc53e('0x2b')],qs[_0xc53e('0x32')](_0x4b9f6a['query']['fields']));_0x5c65d3[_0xc53e('0x31')]=_0x5c65d3[_0xc53e('0x31')][_0xc53e('0x33')]?_0x5c65d3[_0xc53e('0x31')]:_0x3c5056[_0xc53e('0x2b')];if(!_0x4b9f6a[_0xc53e('0x2d')][_0xc53e('0x34')](_0xc53e('0x35'))){_0x5c65d3['limit']=qs[_0xc53e('0x1b')](_0x4b9f6a[_0xc53e('0x2d')][_0xc53e('0x1b')]);_0x5c65d3[_0xc53e('0x1a')]=qs[_0xc53e('0x1a')](_0x4b9f6a[_0xc53e('0x2d')][_0xc53e('0x1a')]);}_0x5c65d3[_0xc53e('0x36')]=qs[_0xc53e('0x37')](_0x4b9f6a['query'][_0xc53e('0x37')]);_0x5c65d3['where']=qs[_0xc53e('0x2f')](_[_0xc53e('0x38')](_0x4b9f6a['query'],_0x3c5056[_0xc53e('0x2f')]),_0x28240a);if(_0x4b9f6a[_0xc53e('0x2d')][_0xc53e('0x39')]){_0x5c65d3['where']=_[_0xc53e('0x3a')](_0x5c65d3[_0xc53e('0x3b')],{'$or':_[_0xc53e('0x2c')](_0x28240a,function(_0x78eb5e){if(_0x78eb5e[_0xc53e('0x29')]!==_0xc53e('0x3c')){var _0x312c1b={};_0x312c1b[_0x78eb5e['name']]={'$like':'%'+_0x4b9f6a[_0xc53e('0x2d')][_0xc53e('0x39')]+'%'};return _0x312c1b;}})});}_0x5c65d3=_[_0xc53e('0x3a')]({},_0x5c65d3,_0x4b9f6a['options']);var _0x70b6c3={'where':_0x5c65d3['where']};return db[_0xc53e('0x27')][_0xc53e('0x19')](_0x70b6c3)[_0xc53e('0x22')](function(_0xad1232){_0x57a1f5[_0xc53e('0x19')]=_0xad1232;if(_0x4b9f6a['query'][_0xc53e('0x3d')]){_0x5c65d3[_0xc53e('0x3e')]=[{'all':!![]}];}return db['FaxApplication']['findAll'](_0x5c65d3);})['then'](function(_0x52cf0a){_0x57a1f5[_0xc53e('0x3f')]=_0x52cf0a;return _0x57a1f5;})[_0xc53e('0x22')](respondWithFilteredResult(_0x4d9a68,_0x5c65d3))['catch'](handleError(_0x4d9a68,null));};exports[_0xc53e('0x40')]=function(_0x574983,_0x55d07d){var _0x53447e={'raw':!![],'where':{'id':_0x574983['params']['id']}},_0x255794={};_0x255794['model']=_[_0xc53e('0x2e')](db['FaxApplication'][_0xc53e('0x41')]);_0x255794[_0xc53e('0x2d')]=_['keys'](_0x574983[_0xc53e('0x2d')]);_0x255794[_0xc53e('0x2f')]=_['intersection'](_0x255794[_0xc53e('0x2b')],_0x255794['query']);_0x53447e['attributes']=_['intersection'](_0x255794['model'],qs[_0xc53e('0x32')](_0x574983[_0xc53e('0x2d')][_0xc53e('0x32')]));_0x53447e['attributes']=_0x53447e[_0xc53e('0x31')][_0xc53e('0x33')]?_0x53447e['attributes']:_0x255794['model'];if(_0x574983[_0xc53e('0x2d')][_0xc53e('0x3d')]){_0x53447e[_0xc53e('0x3e')]=[{'all':!![]}];}_0x53447e=_['merge']({},_0x53447e,_0x574983[_0xc53e('0x42')]);return db[_0xc53e('0x27')][_0xc53e('0x43')](_0x53447e)[_0xc53e('0x22')](handleEntityNotFound(_0x55d07d,null))[_0xc53e('0x22')](respondWithResult(_0x55d07d,null))[_0xc53e('0x44')](handleError(_0x55d07d,null));};exports[_0xc53e('0x45')]=function(_0x49b2e8,_0xed757e){return db[_0xc53e('0x27')][_0xc53e('0x45')](_0x49b2e8['body'],{})[_0xc53e('0x22')](respondWithResult(_0xed757e,0xc9))[_0xc53e('0x44')](handleError(_0xed757e,null));};exports[_0xc53e('0x21')]=function(_0x15e744,_0xa7d256){if(_0x15e744[_0xc53e('0x46')]['id']){delete _0x15e744['body']['id'];}return db[_0xc53e('0x27')][_0xc53e('0x43')]({'where':{'id':_0x15e744[_0xc53e('0x47')]['id']}})['then'](handleEntityNotFound(_0xa7d256,null))[_0xc53e('0x22')](saveUpdates(_0x15e744[_0xc53e('0x46')],null))[_0xc53e('0x22')](respondWithResult(_0xa7d256,null))[_0xc53e('0x44')](handleError(_0xa7d256,null));};exports[_0xc53e('0x48')]=function(_0x1ac62e,_0x1a5a8f){return db[_0xc53e('0x27')][_0xc53e('0x43')]({'where':{'id':_0x1ac62e[_0xc53e('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a5a8f,null))[_0xc53e('0x22')](removeEntity(_0x1a5a8f,null))[_0xc53e('0x44')](handleError(_0x1a5a8f,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 12d9491..467bc67 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 _0x38e6=['path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x56d5d4,_0x52884e){var _0x4958f1=function(_0x3c6723){while(--_0x3c6723){_0x56d5d4['push'](_0x56d5d4['shift']());}};_0x4958f1(++_0x52884e);}(_0x38e6,0xa2));var _0x638e=function(_0x5375cc,_0xe3f11a){_0x5375cc=_0x5375cc-0x0;var _0x8d92bc=_0x38e6[_0x5375cc];return _0x8d92bc;};'use strict';var _=require(_0x638e('0x0'));var util=require('util');var logger=require(_0x638e('0x1'))(_0x638e('0x2'));var moment=require(_0x638e('0x3'));var BPromise=require(_0x638e('0x4'));var rp=require(_0x638e('0x5'));var fs=require('fs');var path=require(_0x638e('0x6'));var rimraf=require(_0x638e('0x7'));var config=require(_0x638e('0x8'));var attributes=require(_0x638e('0x9'));module[_0x638e('0xa')]=function(_0x4ba0e5,_0x2b7953){return _0x4ba0e5['define'](_0x638e('0xb'),attributes,{'tableName':_0x638e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x638e('0xd')});}; \ No newline at end of file +var _0xe008=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FaxApplication','fax_applications'];(function(_0x4367b8,_0x4209a3){var _0x1d1676=function(_0x1b2a90){while(--_0x1b2a90){_0x4367b8['push'](_0x4367b8['shift']());}};_0x1d1676(++_0x4209a3);}(_0xe008,0xf1));var _0x8e00=function(_0x22c234,_0x5bdd03){_0x22c234=_0x22c234-0x0;var _0x2e6828=_0xe008[_0x22c234];return _0x2e6828;};'use strict';var _=require(_0x8e00('0x0'));var util=require(_0x8e00('0x1'));var logger=require(_0x8e00('0x2'))(_0x8e00('0x3'));var moment=require(_0x8e00('0x4'));var BPromise=require(_0x8e00('0x5'));var rp=require(_0x8e00('0x6'));var fs=require('fs');var path=require(_0x8e00('0x7'));var rimraf=require(_0x8e00('0x8'));var config=require(_0x8e00('0x9'));var attributes=require('./faxApplication.attributes');module[_0x8e00('0xa')]=function(_0x21b297,_0x235602){return _0x21b297[_0x8e00('0xb')](_0x8e00('0xc'),attributes,{'tableName':_0x8e00('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8e00('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 17f4be7..de74401 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 _0xd7f1=['rpc','../../config/environment','jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','FaxApplication','update','body','options','attributes','limit','debug','UpdateFaxApplication','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x456a4b,_0x51df8){var _0x42957c=function(_0x431de8){while(--_0x431de8){_0x456a4b['push'](_0x456a4b['shift']());}};_0x42957c(++_0x51df8);}(_0xd7f1,0x71));var _0x1d7f=function(_0x17e743,_0x568254){_0x17e743=_0x17e743-0x0;var _0x263c25=_0xd7f1[_0x17e743];return _0x263c25;};'use strict';var _=require(_0x1d7f('0x0'));var util=require('util');var moment=require(_0x1d7f('0x1'));var BPromise=require(_0x1d7f('0x2'));var rs=require(_0x1d7f('0x3'));var fs=require('fs');var Redis=require(_0x1d7f('0x4'));var db=require(_0x1d7f('0x5'))['db'];var utils=require(_0x1d7f('0x6'));var logger=require('../../config/logger')(_0x1d7f('0x7'));var config=require(_0x1d7f('0x8'));var jayson=require(_0x1d7f('0x9'));var client=jayson[_0x1d7f('0xa')][_0x1d7f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53f346,_0x439538,_0x198fe1){return new BPromise(function(_0x307c01,_0x23e169){return client[_0x1d7f('0xc')](_0x53f346,_0x198fe1)[_0x1d7f('0xd')](function(_0x3fdfad){logger['info'](_0x1d7f('0xe'),_0x439538,'request\x20sent');logger['debug'](_0x1d7f('0xf'),_0x439538,'request\x20sent',JSON[_0x1d7f('0x10')](_0x3fdfad));if(_0x3fdfad[_0x1d7f('0x11')]){if(_0x3fdfad[_0x1d7f('0x11')][_0x1d7f('0x12')]===0x1f4){logger[_0x1d7f('0x11')](_0x1d7f('0xe'),_0x439538,_0x3fdfad[_0x1d7f('0x11')][_0x1d7f('0x13')]);return _0x23e169(_0x3fdfad[_0x1d7f('0x11')][_0x1d7f('0x13')]);}logger[_0x1d7f('0x11')](_0x1d7f('0xe'),_0x439538,_0x3fdfad[_0x1d7f('0x11')][_0x1d7f('0x13')]);return _0x307c01(_0x3fdfad[_0x1d7f('0x11')][_0x1d7f('0x13')]);}else{logger['info'](_0x1d7f('0xe'),_0x439538,_0x1d7f('0x14'));_0x307c01(_0x3fdfad[_0x1d7f('0x15')][_0x1d7f('0x13')]);}})['catch'](function(_0x382db5){logger[_0x1d7f('0x11')](_0x1d7f('0xe'),_0x439538,_0x382db5);_0x23e169(_0x382db5);});});}exports['UpdateFaxApplication']=function(_0x1220b6){var _0xf7b93c=this;return new Promise(function(_0x48bc04,_0xd254e7){return db[_0x1d7f('0x16')][_0x1d7f('0x17')](_0x1220b6[_0x1d7f('0x18')],{'raw':_0x1220b6[_0x1d7f('0x19')]?_0x1220b6[_0x1d7f('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1220b6[_0x1d7f('0x19')]?_0x1220b6[_0x1d7f('0x19')]['where']||null:null,'attributes':_0x1220b6[_0x1d7f('0x19')]?_0x1220b6[_0x1d7f('0x19')][_0x1d7f('0x1a')]||null:null,'limit':_0x1220b6[_0x1d7f('0x19')]?_0x1220b6[_0x1d7f('0x19')][_0x1d7f('0x1b')]||null:null})['then'](function(_0x20406b){logger['info']('UpdateFaxApplication',_0x1220b6);logger[_0x1d7f('0x1c')](_0x1d7f('0x1d'),_0x1220b6,JSON[_0x1d7f('0x10')](_0x20406b));_0x48bc04(_0x20406b);})['catch'](function(_0x1450d9){logger[_0x1d7f('0x11')](_0x1d7f('0x1d'),_0x1450d9[_0x1d7f('0x13')],_0x1220b6);_0xd254e7(_0xf7b93c[_0x1d7f('0x11')](0x1f4,_0x1450d9[_0x1d7f('0x13')]));});});}; \ No newline at end of file +var _0xbf2f=['stringify','error','code','message','result','UpdateFaxApplication','FaxApplication','body','options','attributes','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbf2f,0x1dd));var _0xfbf2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbf2f[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xfbf2('0x0'));var util=require(_0xfbf2('0x1'));var moment=require('moment');var BPromise=require(_0xfbf2('0x2'));var rs=require(_0xfbf2('0x3'));var fs=require('fs');var Redis=require(_0xfbf2('0x4'));var db=require(_0xfbf2('0x5'))['db'];var utils=require(_0xfbf2('0x6'));var logger=require(_0xfbf2('0x7'))(_0xfbf2('0x8'));var config=require(_0xfbf2('0x9'));var jayson=require(_0xfbf2('0xa'));var client=jayson[_0xfbf2('0xb')][_0xfbf2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31e540,_0x1319d4,_0x48d1ca){return new BPromise(function(_0x3e5ebb,_0x440a47){return client['request'](_0x31e540,_0x48d1ca)[_0xfbf2('0xd')](function(_0x5442ba){logger[_0xfbf2('0xe')](_0xfbf2('0xf'),_0x1319d4,_0xfbf2('0x10'));logger[_0xfbf2('0x11')](_0xfbf2('0x12'),_0x1319d4,_0xfbf2('0x10'),JSON[_0xfbf2('0x13')](_0x5442ba));if(_0x5442ba[_0xfbf2('0x14')]){if(_0x5442ba[_0xfbf2('0x14')][_0xfbf2('0x15')]===0x1f4){logger[_0xfbf2('0x14')](_0xfbf2('0xf'),_0x1319d4,_0x5442ba[_0xfbf2('0x14')]['message']);return _0x440a47(_0x5442ba['error'][_0xfbf2('0x16')]);}logger['error'](_0xfbf2('0xf'),_0x1319d4,_0x5442ba[_0xfbf2('0x14')][_0xfbf2('0x16')]);return _0x3e5ebb(_0x5442ba[_0xfbf2('0x14')][_0xfbf2('0x16')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0x1319d4,'request\x20sent');_0x3e5ebb(_0x5442ba[_0xfbf2('0x17')][_0xfbf2('0x16')]);}})['catch'](function(_0x503aa8){logger[_0xfbf2('0x14')](_0xfbf2('0xf'),_0x1319d4,_0x503aa8);_0x440a47(_0x503aa8);});});}exports[_0xfbf2('0x18')]=function(_0x1b316b){var _0x3a7e7a=this;return new Promise(function(_0xcc9367,_0x3ad5c0){return db[_0xfbf2('0x19')]['update'](_0x1b316b[_0xfbf2('0x1a')],{'raw':_0x1b316b[_0xfbf2('0x1b')]?_0x1b316b[_0xfbf2('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b316b['options']?_0x1b316b[_0xfbf2('0x1b')]['where']||null:null,'attributes':_0x1b316b['options']?_0x1b316b[_0xfbf2('0x1b')][_0xfbf2('0x1c')]||null:null,'limit':_0x1b316b[_0xfbf2('0x1b')]?_0x1b316b[_0xfbf2('0x1b')][_0xfbf2('0x1d')]||null:null})[_0xfbf2('0xd')](function(_0x2de79d){logger[_0xfbf2('0xe')](_0xfbf2('0x18'),_0x1b316b);logger[_0xfbf2('0x11')](_0xfbf2('0x18'),_0x1b316b,JSON[_0xfbf2('0x13')](_0x2de79d));_0xcc9367(_0x2de79d);})[_0xfbf2('0x1e')](function(_0x46232c){logger[_0xfbf2('0x14')](_0xfbf2('0x18'),_0x46232c['message'],_0x1b316b);_0x3ad5c0(_0x3a7e7a[_0xfbf2('0x14')](0x1f4,_0x46232c['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d9a6378..2aa7962 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 _0x1cb9=['../../config/environment','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x46ff9d,_0x2da43c){var _0x5dc179=function(_0xce920e){while(--_0xce920e){_0x46ff9d['push'](_0x46ff9d['shift']());}};_0x5dc179(++_0x2da43c);}(_0x1cb9,0x14e));var _0x91cb=function(_0x350fad,_0x2e92c8){_0x350fad=_0x350fad-0x0;var _0x220193=_0x1cb9[_0x350fad];return _0x220193;};'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 auth=require('../../components/auth/service');var interaction=require(_0x91cb('0x5'));var config=require(_0x91cb('0x6'));var controller=require('./faxApplication.controller');router[_0x91cb('0x7')]('/',auth[_0x91cb('0x8')](),controller[_0x91cb('0x9')]);router[_0x91cb('0x7')](_0x91cb('0xa'),auth[_0x91cb('0x8')](),controller['show']);router[_0x91cb('0xb')]('/',auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['put'](_0x91cb('0xa'),auth[_0x91cb('0x8')](),controller[_0x91cb('0xd')]);router[_0x91cb('0xe')](_0x91cb('0xa'),auth[_0x91cb('0x8')](),controller[_0x91cb('0xf')]);module[_0x91cb('0x10')]=router; \ No newline at end of file +var _0xac9d=['isAuthenticated','index','get','/:id','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxApplication.controller'];(function(_0x147426,_0x56d579){var _0x3d76e8=function(_0x53034e){while(--_0x53034e){_0x147426['push'](_0x147426['shift']());}};_0x3d76e8(++_0x56d579);}(_0xac9d,0x14d));var _0xdac9=function(_0x2aaa60,_0x22258f){_0x2aaa60=_0x2aaa60-0x0;var _0x2e3fa5=_0xac9d[_0x2aaa60];return _0x2e3fa5;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var auth=require(_0xdac9('0x6'));var interaction=require(_0xdac9('0x7'));var config=require('../../config/environment');var controller=require(_0xdac9('0x8'));router['get']('/',auth[_0xdac9('0x9')](),controller[_0xdac9('0xa')]);router[_0xdac9('0xb')](_0xdac9('0xc'),auth[_0xdac9('0x9')](),controller[_0xdac9('0xd')]);router['post']('/',auth[_0xdac9('0x9')](),controller['create']);router[_0xdac9('0xe')](_0xdac9('0xc'),auth[_0xdac9('0x9')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0xc'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x11')]);module[_0xdac9('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 90fb8fe..fb553d2 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 _0xd833=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd833,0x143));var _0x3d83=function(_0x2f4311,_0xd2d511){_0x2f4311=_0x2f4311-0x0;var _0x309ccb=_0xd833[_0x2f4311];return _0x309ccb;};'use strict';var Sequelize=require(_0x3d83('0x0'));module[_0x3d83('0x1')]={'closed':{'type':Sequelize[_0x3d83('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3d83('0x3')]},'disposition':{'type':Sequelize[_0x3d83('0x4')]},'note':{'type':Sequelize[_0x3d83('0x4')]},'read1stAt':{'type':Sequelize[_0x3d83('0x3')]},'fax':{'type':Sequelize[_0x3d83('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3d83('0x5')]('in',_0x3d83('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3d83('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x3d83('0x5')]('in',_0x3d83('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xfbcc=['out','sequelize','exports','STRING','DATE','ENUM'];(function(_0x5e7b59,_0x3cdfd1){var _0x41c1ac=function(_0x1516ab){while(--_0x1516ab){_0x5e7b59['push'](_0x5e7b59['shift']());}};_0x41c1ac(++_0x3cdfd1);}(_0xfbcc,0x1e1));var _0xcfbc=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0xfbcc[_0x1ca890];return _0x3f8e01;};'use strict';var Sequelize=require(_0xcfbc('0x0'));module[_0xcfbc('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xcfbc('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xcfbc('0x3')]},'fax':{'type':Sequelize[_0xcfbc('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcfbc('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcfbc('0x4')]('in',_0xcfbc('0x5')),'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 144d967..0bddcd4 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 _0x4af8=['emit','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','basename','pipe','createWriteStream','log','err','unlinkSync','sendStatus','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','destroy','then','error','stack','name','send','Users','map','TagIds','split','Tags','catch','index','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','select','field','from','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','where','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','push','all','rows','show','params','FaxInteraction','rawAttributes','create','update','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','format','includeAll','include','findAll','setTags','spread','color'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0x4af8,0x1ad));var _0x84af=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x4af8[_0x55e08b];return _0xd1a7ff;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x84af('0x0'));var rp=require(_0x84af('0x1'));var moment=require(_0x84af('0x2'));var BPromise=require(_0x84af('0x3'));var Mustache=require('mustache');var util=require(_0x84af('0x4'));var path=require(_0x84af('0x5'));var sox=require('sox');var csv=require(_0x84af('0x6'));var ejs=require(_0x84af('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x84af('0x8'));var crypto=require(_0x84af('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x84af('0x6'));var querystring=require(_0x84af('0xa'));var Papa=require('papaparse');var Redis=require(_0x84af('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x84af('0xc'));var as=require(_0x84af('0xd'));var hardwareService=require(_0x84af('0xe'));var logger=require(_0x84af('0xf'))('api');var utils=require(_0x84af('0x10'));var config=require('../../config/environment');var db=require(_0x84af('0x11'))['db'];config[_0x84af('0x12')]=_['defaults'](config[_0x84af('0x12')],{'host':_0x84af('0x13'),'port':0x18eb});var socket=require(_0x84af('0x14'))(new Redis(config[_0x84af('0x12')]));require('./faxInteraction.socket')[_0x84af('0x15')](socket);function respondWithStatusCode(_0x5664c7,_0xedc1b9){_0xedc1b9=_0xedc1b9||0xcc;return function(_0x259c47){if(_0x259c47){return _0x5664c7['sendStatus'](_0xedc1b9);}return _0x5664c7[_0x84af('0x16')](_0xedc1b9)[_0x84af('0x17')]();};}function respondWithResult(_0x49c38d,_0x4490a9){_0x4490a9=_0x4490a9||0xc8;return function(_0x505476){if(_0x505476){return _0x49c38d[_0x84af('0x16')](_0x4490a9)[_0x84af('0x18')](_0x505476);}};}function respondWithFilteredResult(_0x4c623b,_0x5a5a61){return function(_0x3b8d95){if(_0x3b8d95){var _0xd8120b=_0x3b8d95[_0x84af('0x19')],_0x38a120=_0x5a5a61[_0x84af('0x1a')],_0x4cf5b4=_0x5a5a61[_0x84af('0x1a')]+_0x5a5a61[_0x84af('0x1b')],_0x4d0cf0;if(_0x4cf5b4>=_0xd8120b){_0x4cf5b4=_0xd8120b;_0x4d0cf0=0xc8;}else{_0x4d0cf0=0xce;}_0x4c623b[_0x84af('0x16')](_0x4d0cf0);return _0x4c623b[_0x84af('0x1c')](_0x84af('0x1d'),_0x38a120+'-'+_0x4cf5b4+'/'+_0xd8120b)[_0x84af('0x18')](_0x3b8d95);}return null;};}function patchUpdates(_0x2ec16e){return function(_0x52b819){try{jsonpatch[_0x84af('0x1e')](_0x52b819,_0x2ec16e,!![]);}catch(_0x12d0a3){return BPromise[_0x84af('0x1f')](_0x12d0a3);}return _0x52b819['save']();};}function saveUpdates(_0x2f40d6,_0xaea1ea){return function(_0x14f54d){if(_0x14f54d){return _0x14f54d['update'](_0x2f40d6)['then'](function(_0x3092f6){return _0x3092f6;});}return null;};}function removeEntity(_0x2a73ff,_0xf72093){return function(_0x24aa07){if(_0x24aa07){return _0x24aa07[_0x84af('0x20')]()[_0x84af('0x21')](function(){_0x2a73ff[_0x84af('0x16')](0xcc)[_0x84af('0x17')]();});}};}function handleEntityNotFound(_0x2d032e,_0x33ec65){return function(_0x40ca9d){if(!_0x40ca9d){_0x2d032e['sendStatus'](0x194);}return _0x40ca9d;};}function handleError(_0xc57a5e,_0x418b7c){_0x418b7c=_0x418b7c||0x1f4;return function(_0x3b7534){logger[_0x84af('0x22')](_0x3b7534[_0x84af('0x23')]);if(_0x3b7534[_0x84af('0x24')]){delete _0x3b7534[_0x84af('0x24')];}_0xc57a5e['status'](_0x418b7c)[_0x84af('0x25')](_0x3b7534);};}function getInteractionUsers(_0x3c61ae,_0x59417e){return new BPromise(function(_0x3d92d3,_0x1f5d85){try{if(_0x59417e[_0x3c61ae['id']]){_0x3c61ae[_0x84af('0x26')]=_[_0x84af('0x27')](_0x59417e[_0x3c61ae['id']],function(_0x5e124a){return{'id':_0x5e124a['id'],'fullname':_0x5e124a['fullname']};});}}catch(_0x3f37a0){_0x1f5d85(_0x3f37a0);}_0x3d92d3(_0x3c61ae);});}function getInteractionTags(_0x42d817,_0x238d03){return new BPromise(function(_0x3858b4,_0x302e67){try{if(_0x42d817[_0x84af('0x28')]){_0x42d817['Tags']=[];_0x42d817[_0x84af('0x28')][_0x84af('0x29')](',')['forEach'](function(_0x28d70b){_0x42d817[_0x84af('0x2a')]['push'](_0x238d03[_0x28d70b]);});}delete _0x42d817['TagIds'];}catch(_0x32dfed){_0x302e67(_0x32dfed);}_0x3858b4(_0x42d817);});}function updateFaxInteraction(_0x48d095,_0x3b602e,_0x1bb34c){return new BPromise(function(_0x59a4fe,_0x3b3738){return getInteractionUsers(_0x48d095,_0x1bb34c)[_0x84af('0x21')](function(_0x3d10d0){return getInteractionTags(_0x3d10d0,_0x3b602e);})[_0x84af('0x21')](function(_0x1c0c52){_0x59a4fe(_0x1c0c52);})[_0x84af('0x2b')](function(_0x365650){_0x3b3738(_0x365650);});});}exports[_0x84af('0x2c')]=function(_0x43545e,_0x2c2ee7){var _0x530154={},_0x1b5fc7={},_0x51cb6c={'count':0x0,'rows':[]};var _0x4939d8=_[_0x84af('0x27')](db['FaxInteraction']['rawAttributes'],function(_0xc8c77c){return{'name':_0xc8c77c[_0x84af('0x2d')],'type':_0xc8c77c[_0x84af('0x2e')]['key']};});_0x1b5fc7[_0x84af('0x2f')]=_[_0x84af('0x27')](_0x4939d8,'name');_0x1b5fc7[_0x84af('0x30')]=_[_0x84af('0x31')](_0x43545e['query']);_0x1b5fc7['filters']=_[_0x84af('0x32')](_0x1b5fc7['model'],_0x1b5fc7[_0x84af('0x30')]);_0x530154[_0x84af('0x33')]=_['intersection'](_0x1b5fc7['model'],qs[_0x84af('0x34')](_0x43545e[_0x84af('0x30')][_0x84af('0x34')]));_0x530154['attributes']=_0x530154[_0x84af('0x33')]['length']?_0x530154['attributes']:_0x1b5fc7[_0x84af('0x2f')];if(!_0x43545e['query'][_0x84af('0x35')](_0x84af('0x36'))){_0x530154[_0x84af('0x1b')]=qs['limit'](_0x43545e[_0x84af('0x30')][_0x84af('0x1b')]);_0x530154['offset']=qs[_0x84af('0x1a')](_0x43545e[_0x84af('0x30')][_0x84af('0x1a')]);}_0x530154[_0x84af('0x37')]=qs['sort'](_0x43545e[_0x84af('0x30')][_0x84af('0x38')]);_0x530154['where']=qs[_0x84af('0x39')](_[_0x84af('0x3a')](_0x43545e[_0x84af('0x30')],_0x1b5fc7[_0x84af('0x39')]),_0x4939d8);var _0x557e46=[];var _0x351da0=squel[_0x84af('0x3b')]()[_0x84af('0x3c')]('id')[_0x84af('0x3c')](_0x84af('0x24'))[_0x84af('0x3c')]('color')[_0x84af('0x3d')]('tools_tags');var _0x2d3846=squel[_0x84af('0x3b')]()['field'](_0x84af('0x3e'))[_0x84af('0x3c')](_0x84af('0x3f'))[_0x84af('0x3c')](_0x84af('0x40'))[_0x84af('0x3d')](_0x84af('0x41'),'ui')[_0x84af('0x42')](_0x84af('0x43'),'u',_0x84af('0x44'));var _0x1026c3=squel['select']()['from'](_0x84af('0x45'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x84af('0x42')](_0x84af('0x43'),'o',_0x84af('0x46'))[_0x84af('0x42')](_0x84af('0x47'),'a',_0x84af('0x48'))[_0x84af('0x42')]('fax_messages','me',_0x84af('0x49'))[_0x84af('0x42')]('fax_interaction_has_tags','it',_0x84af('0x4a'))[_0x84af('0x42')]('tools_tags','t',_0x84af('0x4b'));var _0x2cc34a=squel[_0x84af('0x4c')]();var _0x8d08b5=[];var _0x31621a=squel[_0x84af('0x4c')]();var _0x405e9d;if(_0x43545e['query'][_0x84af('0x4d')]){_0x405e9d=as['parseSearch'](_0x43545e[_0x84af('0x30')][_0x84af('0x4d')]);var _0x32e84a=_0x405e9d[_0x84af('0x4e')];for(var _0x2e2f79=0x0;_0x2e2f79<_0x405e9d[_0x84af('0x4f')]['length'];_0x2e2f79++){var _0x10877e=_0x405e9d[_0x84af('0x4f')][_0x2e2f79];var _0x2ee8ff='i';var _0x3318bc=_[_0x84af('0x50')](_0x4939d8,[_0x84af('0x24'),_0x10877e['field']]);if(!_0x3318bc){switch(_0x10877e[_0x84af('0x3c')]){case'unreadMessages':if(_0x10877e[_0x84af('0x51')]==0x1){_0x1026c3['having']('`'+_0x10877e['field']+_0x84af('0x52'));}else{_0x1026c3[_0x84af('0x53')]('`'+_0x10877e[_0x84af('0x3c')]+_0x84af('0x54'));}break;case _0x84af('0x55'):if(_0x10877e[_0x84af('0x56')]===_0x84af('0x57')){if(_0x10877e[_0x84af('0x51')][_0x84af('0x29')]('\x20')[_0x84af('0x58')]>0x1){_0x2cc34a[_0x32e84a](_0x84af('0x59'),qs[_0x84af('0x5a')](_0x10877e[_0x84af('0x51')]),null);}else{var _0x407f0e='%'+_0x10877e[_0x84af('0x51')]+'%';_0x2cc34a[_0x32e84a](_0x84af('0x5b'),_0x407f0e,_0x407f0e,_0x407f0e);}}else{_0x3318bc=_[_0x84af('0x50')](_0x4939d8,[_0x84af('0x24'),_0x84af('0x5c')]);_0x10877e[_0x84af('0x3c')]=_0x84af('0x5c');_0x180f18=as[_0x84af('0x5d')](_0x2ee8ff,_0x3318bc['type'],_0x10877e);_0x2cc34a[_0x32e84a](_0x180f18[_0x84af('0x5e')],_0x180f18[_0x84af('0x51')]['start'],_0x180f18[_0x84af('0x51')]['end']);}break;case'Tag':var _0x446ad1=_0x10877e[_0x84af('0x51')]['split'](',')[_0x84af('0x27')](function(_0x24cf0d){return Number(_0x24cf0d);});_0x446ad1[_0x84af('0x5f')](function(_0x26fd44){_0x31621a['or'](_0x84af('0x60'),'%,'+_0x26fd44+',%');});_0x8d08b5=_[_0x84af('0x61')](_0x8d08b5,_0x446ad1);break;case'User':if(_0x10877e[_0x84af('0x56')]===_0x84af('0x57')){_0x2cc34a[_0x32e84a](_0x84af('0x62'),'%'+_0x10877e[_0x84af('0x51')]+'%',null);}else{_0x3318bc=_[_0x84af('0x50')](_0x4939d8,[_0x84af('0x24'),_0x84af('0x63')]);_0x10877e['field']=_0x84af('0x63');_0x180f18=as['buildExpression'](_0x2ee8ff,_0x3318bc[_0x84af('0x2e')],_0x10877e);_0x2cc34a[_0x32e84a](_0x180f18['text'],_0x180f18[_0x84af('0x51')][_0x84af('0x64')],_0x180f18['value']['end']);}break;case _0x84af('0x65'):_0x180f18=as['buildExpression']('me',null,_0x10877e);_0x2cc34a[_0x32e84a](_0x180f18[_0x84af('0x5e')],_0x180f18['value']['start'],_0x180f18['value'][_0x84af('0x17')]);break;}}else{var _0x180f18=as[_0x84af('0x5d')](_0x2ee8ff,_0x3318bc[_0x84af('0x2e')],_0x10877e);_0x2cc34a[_0x32e84a](_0x180f18['text'],_0x180f18[_0x84af('0x51')][_0x84af('0x64')],_0x180f18[_0x84af('0x51')][_0x84af('0x17')]);}}}else{var _0x5d81d2=_(_0x43545e['query'])['keys']()['map'](function(_0x35b8c3){return _['some'](_0x4939d8,[_0x84af('0x24'),_0x35b8c3])?_0x35b8c3:undefined;})['compact']()[_0x84af('0x51')]();if(!_[_0x84af('0x66')](_0x5d81d2)){_0x5d81d2['forEach'](function(_0x15cd67){if(_0x15cd67===_0x84af('0x67')){_0x1026c3['where'](_0x84af('0x68'),[][_0x84af('0x69')](_0x43545e['query'][_0x15cd67]));}else if(_0x15cd67===_0x84af('0x6a')){var _0x32bc5d=JSON[_0x84af('0x6b')](_0x43545e[_0x84af('0x30')][_0x15cd67])[_0x84af('0x6c')];var _0x124abc=JSON[_0x84af('0x6b')](_0x43545e['query'][_0x15cd67])[_0x84af('0x6d')];_0x1026c3[_0x84af('0x6e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x32bc5d,_0x124abc);}else{if(_0x43545e['query'][_0x15cd67]===_0x84af('0x6f')){_0x1026c3[_0x84af('0x6e')]('i.'+_0x15cd67+_0x84af('0x70'));}else{_0x1026c3[_0x84af('0x6e')]('i.'+_0x15cd67+_0x84af('0x71'),_0x43545e[_0x84af('0x30')][_0x15cd67]);}}});}if(_0x43545e['query'][_0x84af('0x72')]){if(_0x43545e['query'][_0x84af('0x72')]==0x1){_0x1026c3[_0x84af('0x53')](_0x84af('0x73'));}else{_0x1026c3[_0x84af('0x53')]('`unreadMessages`\x20>\x200');}}if(_0x43545e[_0x84af('0x30')]['tag']){_0x8d08b5=_[_0x84af('0x74')](_0x43545e[_0x84af('0x30')][_0x84af('0x75')])?_0x43545e[_0x84af('0x30')][_0x84af('0x75')]:new Array(_0x43545e[_0x84af('0x30')][_0x84af('0x75')]);_0x8d08b5['forEach'](function(_0xdc8a47){_0x31621a['or'](_0x84af('0x60'),'%,'+_0xdc8a47+',%');});}if(_0x43545e['query'][_0x84af('0x76')]){var _0x450510=_0x43545e[_0x84af('0x30')][_0x84af('0x76')][_0x84af('0x77')]('\x5c','\x5c\x5c')[_0x84af('0x77')]('\x27\x27',_0x84af('0x78'));if(qs['isNumeric'](_0x450510)){_0x2cc34a['or'](_0x84af('0x79'),_0x450510+'%')['or'](_0x84af('0x7a'),_0x450510+'%');}_0x2cc34a['or'](_0x84af('0x7b'),_0x450510+'%');}}_0x1026c3['where'](_0x2cc34a);_0x1026c3[_0x84af('0x7c')](_0x84af('0x7d'));var _0x261b34={'type':db[_0x84af('0x7e')]['QueryTypes'][_0x84af('0x7f')],'raw':!![]};var _0x58caa1=_0x1026c3[_0x84af('0x80')]();_0x58caa1['field'](_0x84af('0x7d'));_0x58caa1[_0x84af('0x3c')](_0x84af('0x81'),_0x84af('0x82'));if(_0x530154['order']){_0x530154[_0x84af('0x37')][_0x84af('0x5f')](function(_0x291bec){_0x1026c3[_0x84af('0x37')]('i.'+_0x291bec[0x0],_0x291bec[0x1]==='DESC'?![]:!![]);});}if(!_[_0x84af('0x66')](_0x8d08b5)){_0x1026c3['having'](_0x31621a);_0x58caa1[_0x84af('0x6e')]('t.id\x20IN\x20?',_0x8d08b5);}BPromise[_0x84af('0x83')]()[_0x84af('0x21')](function(){if(!_0x405e9d){if(_0x43545e['query'][_0x84af('0x67')]||_0x43545e['query']['journey'])return;_0x58caa1[_0x84af('0x6e')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x1026c3['where'](_0x84af('0x84'));return;}return _0x43545e[_0x84af('0x85')][_0x84af('0x86')]({'attributes':['id'],'raw':!![]})[_0x84af('0x21')](function(_0x1b2331){if(_[_0x84af('0x66')](_0x1b2331)){_0x58caa1['where'](_0x84af('0x87'));_0x1026c3[_0x84af('0x6e')](_0x84af('0x87'));}else{_0x58caa1[_0x84af('0x6e')](_0x84af('0x68'),_[_0x84af('0x27')](_0x1b2331,'id'));_0x1026c3[_0x84af('0x6e')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x1b2331,'id'));}});})[_0x84af('0x21')](function(){db[_0x84af('0x88')]['query'](_0x58caa1['toString'](),_0x261b34)[_0x84af('0x21')](function(_0x2ba339){_0x51cb6c[_0x84af('0x19')]=_0x2ba339[_0x84af('0x58')];if(_0x51cb6c[_0x84af('0x19')]===0x0)return[];return db['sequelize'][_0x84af('0x30')](_0x351da0[_0x84af('0x89')](),_0x261b34)[_0x84af('0x21')](function(_0x2c83bb){_0x557e46=_[_0x84af('0x8a')](_0x2c83bb,'id');_0x261b34=_[_0x84af('0x8b')](_0x261b34,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x43545e[_0x84af('0x30')][_0x84af('0x34')]){_0x530154[_0x84af('0x33')][_0x84af('0x5f')](function(_0x476915){_0x1026c3[_0x84af('0x3c')]('i.'+_0x476915);});}else{_0x1026c3[_0x84af('0x3c')](_0x84af('0x81'),_0x84af('0x82'));_0x1026c3[_0x84af('0x3c')](_0x84af('0x8c'),_0x84af('0x8d'));_0x1026c3[_0x84af('0x3c')](_0x84af('0x8e'),_0x84af('0x8f'));_0x1026c3[_0x84af('0x3c')](_0x84af('0x90'));_0x1026c3[_0x84af('0x3c')](_0x84af('0x91'),_0x84af('0x92'));_0x1026c3[_0x84af('0x3c')](_0x84af('0x93'),_0x84af('0x94'));_0x1026c3[_0x84af('0x3c')]('c.email',_0x84af('0x95'));_0x1026c3[_0x84af('0x3c')](_0x84af('0x96'),_0x84af('0x97'));_0x1026c3[_0x84af('0x3c')]('c.mobile','Contact.mobile');_0x1026c3[_0x84af('0x3c')](_0x84af('0x98'),_0x84af('0x99'));_0x1026c3[_0x84af('0x3c')](_0x84af('0x9a'),'Owner.fullname');_0x1026c3[_0x84af('0x3c')](_0x84af('0x9b'),_0x84af('0x9c'));_0x1026c3[_0x84af('0x3c')](_0x84af('0x9d'),_0x84af('0x28'));}if(_0x530154[_0x84af('0x1b')])_0x1026c3[_0x84af('0x1b')](_0x530154['limit']);if(_0x530154[_0x84af('0x1a')])_0x1026c3[_0x84af('0x1a')](_0x530154[_0x84af('0x1a')]);return db[_0x84af('0x88')][_0x84af('0x30')](_0x1026c3[_0x84af('0x89')](),_0x261b34);})['then'](function(_0x504665){_0x2d3846[_0x84af('0x6e')](_0x84af('0x9e'),_[_0x84af('0x27')](_0x504665,'id'));return db[_0x84af('0x88')][_0x84af('0x30')](_0x2d3846[_0x84af('0x89')](),_0x261b34)[_0x84af('0x21')](function(_0xa493d){var _0x159eae=_['groupBy'](_0xa493d,_0x84af('0x9f'));var _0xdb0d38=[];_0x504665['forEach'](function(_0x193bf4){_0xdb0d38[_0x84af('0xa0')](updateFaxInteraction(_0x193bf4,_0x557e46,_0x159eae));});return BPromise[_0x84af('0xa1')](_0xdb0d38);});});})['then'](function(_0x13a4b7){_0x51cb6c[_0x84af('0xa2')]=_0x13a4b7;return _0x51cb6c;})[_0x84af('0x21')](respondWithFilteredResult(_0x2c2ee7,_0x530154));})[_0x84af('0x2b')](handleError(_0x2c2ee7,null));};exports[_0x84af('0xa3')]=function(_0x3b4a96,_0x5d0781){var _0x5d50fe={'raw':![],'where':{'id':_0x3b4a96[_0x84af('0xa4')]['id']}},_0xce6304={};_0xce6304[_0x84af('0x2f')]=_[_0x84af('0x31')](db[_0x84af('0xa5')][_0x84af('0xa6')]);_0xce6304['query']=_[_0x84af('0x31')](_0x3b4a96[_0x84af('0x30')]);_0xce6304[_0x84af('0x39')]=_[_0x84af('0x32')](_0xce6304['model'],_0xce6304['query']);_0x5d50fe['attributes']=_[_0x84af('0x32')](_0xce6304[_0x84af('0x2f')],qs[_0x84af('0x34')](_0x3b4a96[_0x84af('0x30')][_0x84af('0x34')]));_0x5d50fe[_0x84af('0x33')]=_0x5d50fe[_0x84af('0x33')][_0x84af('0x58')]?_0x5d50fe[_0x84af('0x33')]:_0xce6304['model'];if(_0x3b4a96[_0x84af('0x30')]['includeAll']){_0x5d50fe['include']=[{'all':!![]}];}_0x5d50fe=_[_0x84af('0x8b')]({},_0x5d50fe,_0x3b4a96['options']);return db[_0x84af('0xa5')][_0x84af('0x50')](_0x5d50fe)['then'](handleEntityNotFound(_0x5d0781,null))[_0x84af('0x21')](respondWithResult(_0x5d0781,null))['catch'](handleError(_0x5d0781,null));};exports[_0x84af('0xa7')]=function(_0x5303d,_0x424d1a){return db[_0x84af('0xa5')]['create'](_0x5303d[_0x84af('0x65')],{})[_0x84af('0x21')](respondWithResult(_0x424d1a,0xc9))['catch'](handleError(_0x424d1a,null));};exports[_0x84af('0xa8')]=function(_0x307b2e,_0x426f52){if(_0x307b2e['body']['id']){delete _0x307b2e[_0x84af('0x65')]['id'];}return db['FaxInteraction']['find']({'where':{'id':_0x307b2e[_0x84af('0xa4')]['id']}})[_0x84af('0x21')](handleEntityNotFound(_0x426f52,null))[_0x84af('0x21')](saveUpdates(_0x307b2e[_0x84af('0x65')],null))[_0x84af('0x21')](respondWithResult(_0x426f52,null))[_0x84af('0x2b')](handleError(_0x426f52,null));};exports[_0x84af('0x20')]=function(_0x2634e9,_0x1b8428){return db[_0x84af('0xa5')][_0x84af('0x50')]({'where':{'id':_0x2634e9[_0x84af('0xa4')]['id']}})[_0x84af('0x21')](handleEntityNotFound(_0x1b8428,null))[_0x84af('0x21')](removeEntity(_0x1b8428,null))[_0x84af('0x2b')](handleError(_0x1b8428,null));};exports['describe']=function(_0x239366,_0x7b3631){return db[_0x84af('0xa5')][_0x84af('0xa9')]()[_0x84af('0x21')](respondWithResult(_0x7b3631,null))[_0x84af('0x2b')](handleError(_0x7b3631,null));};exports[_0x84af('0xaa')]=function(_0x258492,_0x8ea768,_0x44357a){return db['FaxMessage'][_0x84af('0x50')]({'where':{'id':_0x258492[_0x84af('0xa4')]['id']}})[_0x84af('0x21')](handleEntityNotFound(_0x8ea768,null))[_0x84af('0x21')](function(_0x38f1aa){if(_0x38f1aa){return _0x38f1aa[_0x84af('0xaa')](_0x258492[_0x84af('0x65')][_0x84af('0xab')],_[_0x84af('0xac')](_0x258492['body'],[_0x84af('0xab'),'id'])||{});}})[_0x84af('0x21')](respondWithResult(_0x8ea768,null))[_0x84af('0x2b')](handleError(_0x8ea768,null));};exports[_0x84af('0xad')]=function(_0x1c7a2e,_0x367967,_0x417261){var _0x324e1a={'raw':![],'where':{}};var _0x5e6f2e={};var _0x46b944={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x84af('0xae')]({'where':{'id':_0x1c7a2e['params']['id']}})[_0x84af('0x21')](handleEntityNotFound(_0x367967,null))[_0x84af('0x21')](function(_0x16021e){if(_0x16021e){_0x5e6f2e['model']=_['keys'](db[_0x84af('0xaf')][_0x84af('0xa6')]);_0x5e6f2e[_0x84af('0x30')]=_[_0x84af('0x31')](_0x1c7a2e[_0x84af('0x30')]);_0x5e6f2e[_0x84af('0x39')]=_[_0x84af('0x32')](_0x5e6f2e[_0x84af('0x2f')],_0x5e6f2e[_0x84af('0x30')]);_0x324e1a['attributes']=_[_0x84af('0x32')](_0x5e6f2e[_0x84af('0x2f')],qs[_0x84af('0x34')](_0x1c7a2e[_0x84af('0x30')][_0x84af('0x34')]));_0x324e1a[_0x84af('0x33')]=_0x324e1a[_0x84af('0x33')][_0x84af('0x58')]?_0x324e1a[_0x84af('0x33')]:_0x5e6f2e['model'];if(!_0x1c7a2e[_0x84af('0x30')]['hasOwnProperty'](_0x84af('0x36'))){_0x324e1a[_0x84af('0x1b')]=qs[_0x84af('0x1b')](_0x1c7a2e[_0x84af('0x30')][_0x84af('0x1b')]);_0x324e1a[_0x84af('0x1a')]=qs[_0x84af('0x1a')](_0x1c7a2e[_0x84af('0x30')]['offset']);}_0x324e1a[_0x84af('0x37')]=qs[_0x84af('0x38')](_0x1c7a2e[_0x84af('0x30')][_0x84af('0x38')]);_0x324e1a[_0x84af('0x6e')]=qs[_0x84af('0x39')](_[_0x84af('0x3a')](_0x1c7a2e['query'],_0x5e6f2e[_0x84af('0x39')]));_0x324e1a[_0x84af('0x6e')]['FaxInteractionId']=_0x16021e['id'];if(_0x1c7a2e['query'][_0x84af('0x76')]){_0x324e1a[_0x84af('0x6e')]=_[_0x84af('0x8b')](_0x324e1a['where'],{'$or':_[_0x84af('0x27')](_0x324e1a[_0x84af('0x33')],function(_0x108b8f){var _0x3deb6c={};_0x3deb6c[_0x108b8f]={'$like':'%'+_0x1c7a2e[_0x84af('0x30')][_0x84af('0x76')]+'%'};return _0x3deb6c;})});}if(_0x1c7a2e[_0x84af('0x30')][_0x84af('0x6c')]){var _0x2103b5=_0x1c7a2e[_0x84af('0x30')][_0x84af('0x6c')]['split'](',');var _0x12dcf5={};_0x12dcf5[_0x2103b5[0x0]]={'$gte':moment(_0x2103b5[0x1])[_0x84af('0xb0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x324e1a[_0x84af('0x6e')]=_[_0x84af('0x8b')](_0x324e1a[_0x84af('0x6e')],_0x12dcf5);}_0x324e1a=_['merge']({},_0x324e1a,_0x1c7a2e['options']);return db[_0x84af('0xaf')]['count']({'where':_0x324e1a[_0x84af('0x6e')]})[_0x84af('0x21')](function(_0x21ad63){_0x46b944[_0x84af('0x19')]=_0x21ad63;if(_0x1c7a2e[_0x84af('0x30')][_0x84af('0xb1')]){_0x324e1a[_0x84af('0xb2')]=[{'all':!![]}];}return db[_0x84af('0xaf')][_0x84af('0xb3')](_0x324e1a);})[_0x84af('0x21')](function(_0x2ff225){_0x46b944[_0x84af('0xa2')]=_0x2ff225;return _0x46b944;});}})[_0x84af('0x21')](respondWithFilteredResult(_0x367967,_0x324e1a))[_0x84af('0x2b')](handleError(_0x367967,null));};exports['addTags']=function(_0x6aabe5,_0x368915,_0x573d5f){return db[_0x84af('0xa5')][_0x84af('0x50')]({'where':{'id':_0x6aabe5['params']['id']}})[_0x84af('0x21')](handleEntityNotFound(_0x368915,null))['then'](function(_0x43a0fc){if(_0x43a0fc){return _0x43a0fc[_0x84af('0xb4')](_0x6aabe5['body'][_0x84af('0xab')],_[_0x84af('0xac')](_0x6aabe5[_0x84af('0x65')],[_0x84af('0xab'),'id'])||{})[_0x84af('0xb5')](function(){return db['Tag']['findAll']({'attributes':['id',_0x84af('0x24'),_0x84af('0xb6')],'where':{'id':_0x6aabe5[_0x84af('0x65')][_0x84af('0xab')]}});})[_0x84af('0x21')](function(_0xa28a04){socket[_0x84af('0xb7')]('faxInteractionTags:save',{'id':Number(_0x6aabe5[_0x84af('0xa4')]['id']),'tags':_0xa28a04||[]});return{'id':Number(_0x6aabe5['params']['id']),'tags':_0xa28a04||[]};});}})[_0x84af('0x21')](respondWithResult(_0x368915,null))['catch'](handleError(_0x368915,null));};exports['removeTags']=function(_0x28e5da,_0x17bfc8,_0x29d94a){return db[_0x84af('0xa5')][_0x84af('0x50')]({'where':{'id':_0x28e5da['params']['id']}})[_0x84af('0x21')](handleEntityNotFound(_0x17bfc8,null))[_0x84af('0x21')](function(_0x3cdcfb){if(_0x3cdcfb){return _0x3cdcfb[_0x84af('0xb8')](_0x28e5da[_0x84af('0x30')][_0x84af('0xab')]);}})['then'](respondWithStatusCode(_0x17bfc8,null))[_0x84af('0x2b')](handleError(_0x17bfc8,null));};exports[_0x84af('0xb9')]=function(_0x3839fa,_0x350c47){var _0x272f66=moment()[_0x84af('0xba')]()[_0x84af('0x89')]();var _0x4491e2=path[_0x84af('0xbb')](config[_0x84af('0xbc')],_0x84af('0xbd'),_0x84af('0xbe'),_0x84af('0xbf'));var _0x310713=path[_0x84af('0xbb')](config[_0x84af('0xbc')],_0x84af('0xbd'),_0x84af('0xbe'),_0x84af('0xc0'));var _0x160384=path[_0x84af('0xbb')](_0x4491e2,_0x272f66);var _0x16c294=util['format'](_0x84af('0xc1'),_0x3839fa['params']['id'],_0x272f66);var _0x3c21eb=path[_0x84af('0xbb')](_0x4491e2,_0x16c294);var _0x45039a=[];_0x45039a[_0x84af('0xa0')]({'model':db[_0x84af('0xc2')],'as':'Attachment','raw':!![]});var _0x3d48b3=[{'model':db['FaxMessage'],'as':_0x84af('0xc3'),'attributes':['id',_0x84af('0x65'),'createdAt'],'include':_0x45039a}];return db[_0x84af('0xa5')]['find']({'where':{'id':_0x3839fa[_0x84af('0xa4')]['id']},'include':_0x3d48b3})[_0x84af('0x21')](handleEntityNotFound(_0x350c47,null))[_0x84af('0x21')](function(_0x3b0918){if(_0x3b0918&&_0x3b0918[_0x84af('0xc3')]){var _0x1ea410=_0x3b0918['get']({'plain':!![]});fs[_0x84af('0xc4')](_0x160384);for(var _0x474a12=0x0;_0x474a12<_0x1ea410[_0x84af('0xc3')][_0x84af('0x58')];_0x474a12++){var _0x56fa5a=_0x1ea410[_0x84af('0xc3')][_0x474a12][_0x84af('0xc2')];if(_0x56fa5a){var _0x473bdb=path[_0x84af('0xbb')](_0x310713,_0x56fa5a[_0x84af('0xc5')]);if(fs['existsSync'](_0x473bdb)){fs['createReadStream'](_0x473bdb)[_0x84af('0xc6')](fs[_0x84af('0xc7')](path[_0x84af('0xbb')](_0x160384,_0x56fa5a['basename'])));}}}return BPromise[_0x84af('0x83')]()['then'](function(){return new BPromise(function(_0x150530,_0x17b6b6){zipdir(_0x160384,{'saveTo':_0x3c21eb},function(_0x5dacb3,_0x2dacf0){if(_0x5dacb3)return _0x17b6b6(_0x5dacb3);return _0x150530(_0x2dacf0);});})[_0x84af('0x21')](function(){return new BPromise(function(_0x1a1673,_0x4e256f){rimraf(_0x160384,function(_0x1d5d5c){if(_0x1d5d5c)_0x4e256f(_0x1d5d5c);return _0x1a1673();});});})[_0x84af('0x21')](function(){return _0x350c47[_0x84af('0xb9')](_0x3c21eb,_0x16c294,function(_0x857889){if(_0x857889){console[_0x84af('0xc8')](_0x84af('0xc9'),_0x857889);}else{fs[_0x84af('0xca')](_0x3c21eb);}});});});}else{return _0x350c47[_0x84af('0xcb')](0xc8);}})[_0x84af('0x2b')](handleError(_0x350c47,null));}; \ No newline at end of file +var _0x49db=['papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','Users','map','TagIds','Tags','split','push','FaxInteraction','fieldName','key','model','query','keys','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','filters','select','field','color','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','fax_interactions','o.id\x20=\x20i.UserId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','forEach','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','show','params','rawAttributes','includeAll','include','merge','catch','create','describe','FaxMessage','omit','ids','findOne','nolimit','pick','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','spread','emit','faxInteractionTags:save','removeTags','download','join','root','server','tmp','files','attachments','format','Attachment','Messages','get','basename','pipe','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring'];(function(_0x45b6a7,_0x181d65){var _0x50311a=function(_0x3f62cf){while(--_0x3f62cf){_0x45b6a7['push'](_0x45b6a7['shift']());}};_0x50311a(++_0x181d65);}(_0x49db,0xc5));var _0xb49d=function(_0x106ee4,_0x5ef76a){_0x106ee4=_0x106ee4-0x0;var _0x160dc4=_0x49db[_0x106ee4];return _0x160dc4;};'use strict';var pdf=require(_0xb49d('0x0'));var emlformat=require(_0xb49d('0x1'));var rimraf=require(_0xb49d('0x2'));var zipdir=require(_0xb49d('0x3'));var jsonpatch=require(_0xb49d('0x4'));var rp=require('request-promise');var moment=require(_0xb49d('0x5'));var BPromise=require(_0xb49d('0x6'));var Mustache=require(_0xb49d('0x7'));var util=require('util');var path=require(_0xb49d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb49d('0x9'));var fs=require('fs');var _=require(_0xb49d('0xa'));var squel=require(_0xb49d('0xb'));var crypto=require('crypto');var jsforce=require(_0xb49d('0xc'));var deskjs=require(_0xb49d('0xd'));var toCsv=require(_0xb49d('0xe'));var querystring=require(_0xb49d('0xf'));var Papa=require(_0xb49d('0x10'));var Redis=require(_0xb49d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb49d('0x12'));var hardwareService=require(_0xb49d('0x13'));var logger=require(_0xb49d('0x14'))(_0xb49d('0x15'));var utils=require(_0xb49d('0x16'));var config=require(_0xb49d('0x17'));var db=require(_0xb49d('0x18'))['db'];config[_0xb49d('0x19')]=_[_0xb49d('0x1a')](config['redis'],{'host':_0xb49d('0x1b'),'port':0x18eb});var socket=require(_0xb49d('0x1c'))(new Redis(config[_0xb49d('0x19')]));require(_0xb49d('0x1d'))['register'](socket);function respondWithStatusCode(_0xf744f4,_0x2c0b41){_0x2c0b41=_0x2c0b41||0xcc;return function(_0x4ddeb5){if(_0x4ddeb5){return _0xf744f4[_0xb49d('0x1e')](_0x2c0b41);}return _0xf744f4[_0xb49d('0x1f')](_0x2c0b41)[_0xb49d('0x20')]();};}function respondWithResult(_0xcbdd6c,_0x1491fb){_0x1491fb=_0x1491fb||0xc8;return function(_0x270298){if(_0x270298){return _0xcbdd6c[_0xb49d('0x1f')](_0x1491fb)['json'](_0x270298);}};}function respondWithFilteredResult(_0x1da77c,_0x38675e){return function(_0x3781f1){if(_0x3781f1){var _0xf0bdff=_0x3781f1[_0xb49d('0x21')],_0x4abce4=_0x38675e[_0xb49d('0x22')],_0x4f3988=_0x38675e[_0xb49d('0x22')]+_0x38675e[_0xb49d('0x23')],_0xfd7a95;if(_0x4f3988>=_0xf0bdff){_0x4f3988=_0xf0bdff;_0xfd7a95=0xc8;}else{_0xfd7a95=0xce;}_0x1da77c['status'](_0xfd7a95);return _0x1da77c[_0xb49d('0x24')](_0xb49d('0x25'),_0x4abce4+'-'+_0x4f3988+'/'+_0xf0bdff)[_0xb49d('0x26')](_0x3781f1);}return null;};}function patchUpdates(_0x263c62){return function(_0x22ad15){try{jsonpatch[_0xb49d('0x27')](_0x22ad15,_0x263c62,!![]);}catch(_0x123a1c){return BPromise[_0xb49d('0x28')](_0x123a1c);}return _0x22ad15[_0xb49d('0x29')]();};}function saveUpdates(_0x38be04,_0x19ead9){return function(_0x2ba098){if(_0x2ba098){return _0x2ba098[_0xb49d('0x2a')](_0x38be04)[_0xb49d('0x2b')](function(_0x1410be){return _0x1410be;});}return null;};}function removeEntity(_0x2ccce8,_0x26db55){return function(_0x21c0e1){if(_0x21c0e1){return _0x21c0e1[_0xb49d('0x2c')]()[_0xb49d('0x2b')](function(){_0x2ccce8[_0xb49d('0x1f')](0xcc)[_0xb49d('0x20')]();});}};}function handleEntityNotFound(_0x5a6cbe,_0x227305){return function(_0x4b7134){if(!_0x4b7134){_0x5a6cbe[_0xb49d('0x1e')](0x194);}return _0x4b7134;};}function handleError(_0x3b7fee,_0x56163c){_0x56163c=_0x56163c||0x1f4;return function(_0xf4fbbf){logger[_0xb49d('0x2d')](_0xf4fbbf[_0xb49d('0x2e')]);if(_0xf4fbbf[_0xb49d('0x2f')]){delete _0xf4fbbf[_0xb49d('0x2f')];}_0x3b7fee[_0xb49d('0x1f')](_0x56163c)['send'](_0xf4fbbf);};}function getInteractionUsers(_0x3930fe,_0xf734e1){return new BPromise(function(_0x2b5e5d,_0x37901b){try{if(_0xf734e1[_0x3930fe['id']]){_0x3930fe[_0xb49d('0x30')]=_[_0xb49d('0x31')](_0xf734e1[_0x3930fe['id']],function(_0x175110){return{'id':_0x175110['id'],'fullname':_0x175110['fullname']};});}}catch(_0x3f1796){_0x37901b(_0x3f1796);}_0x2b5e5d(_0x3930fe);});}function getInteractionTags(_0x4ca384,_0xf232e1){return new BPromise(function(_0x2fbcfa,_0x978e19){try{if(_0x4ca384[_0xb49d('0x32')]){_0x4ca384[_0xb49d('0x33')]=[];_0x4ca384[_0xb49d('0x32')][_0xb49d('0x34')](',')['forEach'](function(_0x3802c8){_0x4ca384[_0xb49d('0x33')][_0xb49d('0x35')](_0xf232e1[_0x3802c8]);});}delete _0x4ca384['TagIds'];}catch(_0x5cc4e5){_0x978e19(_0x5cc4e5);}_0x2fbcfa(_0x4ca384);});}function updateFaxInteraction(_0x29fda6,_0x12abb6,_0x208967){return new BPromise(function(_0xbb8e0f,_0x3fd75e){return getInteractionUsers(_0x29fda6,_0x208967)[_0xb49d('0x2b')](function(_0x3f0cad){return getInteractionTags(_0x3f0cad,_0x12abb6);})[_0xb49d('0x2b')](function(_0x594dcb){_0xbb8e0f(_0x594dcb);})['catch'](function(_0x23e223){_0x3fd75e(_0x23e223);});});}exports['index']=function(_0x4f53b2,_0x4b790e){var _0x423399={},_0x4235ad={},_0x3964ec={'count':0x0,'rows':[]};var _0x33f922=_[_0xb49d('0x31')](db[_0xb49d('0x36')]['rawAttributes'],function(_0x1d4f5b){return{'name':_0x1d4f5b[_0xb49d('0x37')],'type':_0x1d4f5b['type'][_0xb49d('0x38')]};});_0x4235ad[_0xb49d('0x39')]=_[_0xb49d('0x31')](_0x33f922,'name');_0x4235ad[_0xb49d('0x3a')]=_[_0xb49d('0x3b')](_0x4f53b2[_0xb49d('0x3a')]);_0x4235ad['filters']=_[_0xb49d('0x3c')](_0x4235ad['model'],_0x4235ad['query']);_0x423399['attributes']=_['intersection'](_0x4235ad[_0xb49d('0x39')],qs[_0xb49d('0x3d')](_0x4f53b2[_0xb49d('0x3a')][_0xb49d('0x3d')]));_0x423399['attributes']=_0x423399['attributes'][_0xb49d('0x3e')]?_0x423399[_0xb49d('0x3f')]:_0x4235ad[_0xb49d('0x39')];if(!_0x4f53b2[_0xb49d('0x3a')][_0xb49d('0x40')]('nolimit')){_0x423399['limit']=qs[_0xb49d('0x23')](_0x4f53b2[_0xb49d('0x3a')][_0xb49d('0x23')]);_0x423399[_0xb49d('0x22')]=qs[_0xb49d('0x22')](_0x4f53b2['query'][_0xb49d('0x22')]);}_0x423399[_0xb49d('0x41')]=qs[_0xb49d('0x42')](_0x4f53b2[_0xb49d('0x3a')][_0xb49d('0x42')]);_0x423399[_0xb49d('0x43')]=qs[_0xb49d('0x44')](_['pick'](_0x4f53b2[_0xb49d('0x3a')],_0x4235ad['filters']),_0x33f922);var _0x5db393=[];var _0x3f394f=squel[_0xb49d('0x45')]()[_0xb49d('0x46')]('id')['field'](_0xb49d('0x2f'))[_0xb49d('0x46')](_0xb49d('0x47'))['from']('tools_tags');var _0x1d8833=squel[_0xb49d('0x45')]()[_0xb49d('0x46')](_0xb49d('0x48'))['field'](_0xb49d('0x49'))[_0xb49d('0x46')](_0xb49d('0x4a'))['from'](_0xb49d('0x4b'),'ui')[_0xb49d('0x4c')](_0xb49d('0x4d'),'u',_0xb49d('0x4e'));var _0x2685d1=squel[_0xb49d('0x45')]()[_0xb49d('0x4f')](_0xb49d('0x50'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xb49d('0x4c')](_0xb49d('0x4d'),'o',_0xb49d('0x51'))[_0xb49d('0x4c')]('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')['left_join'](_0xb49d('0x52'),'me',_0xb49d('0x53'))[_0xb49d('0x4c')](_0xb49d('0x54'),'it',_0xb49d('0x55'))['left_join'](_0xb49d('0x56'),'t',_0xb49d('0x57'));var _0x578498=squel[_0xb49d('0x58')]();var _0x21f650=[];var _0x4c00c3=squel[_0xb49d('0x58')]();var _0x21f5d0;if(_0x4f53b2[_0xb49d('0x3a')][_0xb49d('0x59')]){_0x21f5d0=as[_0xb49d('0x5a')](_0x4f53b2[_0xb49d('0x3a')][_0xb49d('0x59')]);var _0x570277=_0x21f5d0[_0xb49d('0x5b')];for(var _0x52faf8=0x0;_0x52faf8<_0x21f5d0[_0xb49d('0x5c')][_0xb49d('0x3e')];_0x52faf8++){var _0x27d2d8=_0x21f5d0[_0xb49d('0x5c')][_0x52faf8];var _0x45683d='i';var _0x30596b=_[_0xb49d('0x5d')](_0x33f922,['name',_0x27d2d8['field']]);if(!_0x30596b){switch(_0x27d2d8['field']){case _0xb49d('0x5e'):if(_0x27d2d8[_0xb49d('0x5f')]==0x1){_0x2685d1['having']('`'+_0x27d2d8[_0xb49d('0x46')]+_0xb49d('0x60'));}else{_0x2685d1[_0xb49d('0x61')]('`'+_0x27d2d8[_0xb49d('0x46')]+_0xb49d('0x62'));}break;case _0xb49d('0x63'):if(_0x27d2d8[_0xb49d('0x64')]===_0xb49d('0x65')){if(_0x27d2d8[_0xb49d('0x5f')][_0xb49d('0x34')]('\x20')['length']>0x1){_0x578498[_0x570277](_0xb49d('0x66'),qs[_0xb49d('0x67')](_0x27d2d8[_0xb49d('0x5f')]),null);}else{var _0x40e2bd='%'+_0x27d2d8[_0xb49d('0x5f')]+'%';_0x578498[_0x570277](_0xb49d('0x68'),_0x40e2bd,_0x40e2bd,_0x40e2bd);}}else{_0x30596b=_[_0xb49d('0x5d')](_0x33f922,[_0xb49d('0x2f'),_0xb49d('0x69')]);_0x27d2d8[_0xb49d('0x46')]=_0xb49d('0x69');_0x280689=as[_0xb49d('0x6a')](_0x45683d,_0x30596b[_0xb49d('0x6b')],_0x27d2d8);_0x578498[_0x570277](_0x280689['text'],_0x280689[_0xb49d('0x5f')][_0xb49d('0x6c')],_0x280689[_0xb49d('0x5f')][_0xb49d('0x20')]);}break;case'Tag':var _0x15a333=_0x27d2d8[_0xb49d('0x5f')][_0xb49d('0x34')](',')[_0xb49d('0x31')](function(_0x332894){return Number(_0x332894);});_0x15a333[_0xb49d('0x6d')](function(_0x118015){_0x4c00c3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x118015+',%');});_0x21f650=_[_0xb49d('0x6e')](_0x21f650,_0x15a333);break;case'User':if(_0x27d2d8[_0xb49d('0x64')]==='$substring'){_0x578498[_0x570277](_0xb49d('0x6f'),'%'+_0x27d2d8['value']+'%',null);}else{_0x30596b=_[_0xb49d('0x5d')](_0x33f922,[_0xb49d('0x2f'),_0xb49d('0x70')]);_0x27d2d8['field']=_0xb49d('0x70');_0x280689=as['buildExpression'](_0x45683d,_0x30596b['type'],_0x27d2d8);_0x578498[_0x570277](_0x280689[_0xb49d('0x71')],_0x280689[_0xb49d('0x5f')][_0xb49d('0x6c')],_0x280689[_0xb49d('0x5f')][_0xb49d('0x20')]);}break;case _0xb49d('0x72'):_0x280689=as['buildExpression']('me',null,_0x27d2d8);_0x578498[_0x570277](_0x280689['text'],_0x280689[_0xb49d('0x5f')][_0xb49d('0x6c')],_0x280689[_0xb49d('0x5f')]['end']);break;}}else{var _0x280689=as[_0xb49d('0x6a')](_0x45683d,_0x30596b['type'],_0x27d2d8);_0x578498[_0x570277](_0x280689[_0xb49d('0x71')],_0x280689[_0xb49d('0x5f')]['start'],_0x280689[_0xb49d('0x5f')][_0xb49d('0x20')]);}}}else{var _0x2f7b57=_(_0x4f53b2[_0xb49d('0x3a')])[_0xb49d('0x3b')]()[_0xb49d('0x31')](function(_0x498923){return _[_0xb49d('0x73')](_0x33f922,[_0xb49d('0x2f'),_0x498923])?_0x498923:undefined;})[_0xb49d('0x74')]()['value']();if(!_[_0xb49d('0x75')](_0x2f7b57)){_0x2f7b57[_0xb49d('0x6d')](function(_0x239c66){if(_0x239c66===_0xb49d('0x76')){_0x2685d1[_0xb49d('0x43')](_0xb49d('0x77'),[]['concat'](_0x4f53b2[_0xb49d('0x3a')][_0x239c66]));}else if(_0x239c66===_0xb49d('0x78')){var _0x651ea9=JSON[_0xb49d('0x79')](_0x4f53b2[_0xb49d('0x3a')][_0x239c66])[_0xb49d('0x7a')];var _0x11934a=JSON[_0xb49d('0x79')](_0x4f53b2[_0xb49d('0x3a')][_0x239c66])[_0xb49d('0x7b')];_0x2685d1[_0xb49d('0x43')](_0xb49d('0x7c'),_0x651ea9,_0x11934a);}else{if(_0x4f53b2['query'][_0x239c66]===_0xb49d('0x7d')){_0x2685d1['where']('i.'+_0x239c66+_0xb49d('0x7e'));}else{_0x2685d1[_0xb49d('0x43')]('i.'+_0x239c66+'\x20=\x20?',_0x4f53b2[_0xb49d('0x3a')][_0x239c66]);}}});}if(_0x4f53b2['query'][_0xb49d('0x7f')]){if(_0x4f53b2['query'][_0xb49d('0x7f')]==0x1){_0x2685d1[_0xb49d('0x61')](_0xb49d('0x80'));}else{_0x2685d1[_0xb49d('0x61')](_0xb49d('0x81'));}}if(_0x4f53b2['query'][_0xb49d('0x82')]){_0x21f650=_['isArray'](_0x4f53b2[_0xb49d('0x3a')][_0xb49d('0x82')])?_0x4f53b2[_0xb49d('0x3a')][_0xb49d('0x82')]:new Array(_0x4f53b2[_0xb49d('0x3a')][_0xb49d('0x82')]);_0x21f650[_0xb49d('0x6d')](function(_0x35aa38){_0x4c00c3['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35aa38+',%');});}if(_0x4f53b2[_0xb49d('0x3a')][_0xb49d('0x83')]){var _0x5d7c0d=_0x4f53b2[_0xb49d('0x3a')]['filter']['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xb49d('0x84'));if(qs[_0xb49d('0x85')](_0x5d7c0d)){_0x578498['or'](_0xb49d('0x86'),_0x5d7c0d+'%')['or'](_0xb49d('0x87'),_0x5d7c0d+'%');}_0x578498['or'](_0xb49d('0x88'),_0x5d7c0d+'%');}}_0x2685d1['where'](_0x578498);_0x2685d1[_0xb49d('0x89')](_0xb49d('0x8a'));var _0x1c1be2={'type':db[_0xb49d('0x8b')]['QueryTypes'][_0xb49d('0x8c')],'raw':!![]};var _0x1463e4=_0x2685d1['clone']();_0x1463e4[_0xb49d('0x46')](_0xb49d('0x8a'));_0x1463e4['field'](_0xb49d('0x8d'),_0xb49d('0x5e'));if(_0x423399['order']){_0x423399['order'][_0xb49d('0x6d')](function(_0x19e2ca){_0x2685d1[_0xb49d('0x41')]('i.'+_0x19e2ca[0x0],_0x19e2ca[0x1]===_0xb49d('0x8e')?![]:!![]);});}if(!_[_0xb49d('0x75')](_0x21f650)){_0x2685d1['having'](_0x4c00c3);_0x1463e4[_0xb49d('0x43')](_0xb49d('0x8f'),_0x21f650);}BPromise[_0xb49d('0x90')]()['then'](function(){if(!_0x21f5d0){if(_0x4f53b2[_0xb49d('0x3a')]['FaxAccountId']||_0x4f53b2[_0xb49d('0x3a')]['journey'])return;_0x1463e4[_0xb49d('0x43')](_0xb49d('0x91'));_0x2685d1[_0xb49d('0x43')](_0xb49d('0x91'));return;}return _0x4f53b2[_0xb49d('0x92')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0xb49d('0x2b')](function(_0x5b98a4){if(_[_0xb49d('0x75')](_0x5b98a4)){_0x1463e4['where'](_0xb49d('0x93'));_0x2685d1[_0xb49d('0x43')](_0xb49d('0x93'));}else{_0x1463e4[_0xb49d('0x43')](_0xb49d('0x77'),_[_0xb49d('0x31')](_0x5b98a4,'id'));_0x2685d1[_0xb49d('0x43')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x5b98a4,'id'));}});})['then'](function(){db[_0xb49d('0x94')][_0xb49d('0x3a')](_0x1463e4[_0xb49d('0x95')](),_0x1c1be2)[_0xb49d('0x2b')](function(_0x7845a8){_0x3964ec[_0xb49d('0x21')]=_0x7845a8[_0xb49d('0x3e')];if(_0x3964ec[_0xb49d('0x21')]===0x0)return[];return db[_0xb49d('0x94')][_0xb49d('0x3a')](_0x3f394f[_0xb49d('0x95')](),_0x1c1be2)[_0xb49d('0x2b')](function(_0x1fb395){_0x5db393=_[_0xb49d('0x96')](_0x1fb395,'id');_0x1c1be2=_['merge'](_0x1c1be2,{'model':db[_0xb49d('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4f53b2['query'][_0xb49d('0x3d')]){_0x423399['attributes']['forEach'](function(_0x2c29ba){_0x2685d1[_0xb49d('0x46')]('i.'+_0x2c29ba);});}else{_0x2685d1[_0xb49d('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x2685d1[_0xb49d('0x46')](_0xb49d('0x97'),_0xb49d('0x98'));_0x2685d1[_0xb49d('0x46')](_0xb49d('0x99'),'Account.mandatoryDisposition');_0x2685d1['field']('i.*');_0x2685d1[_0xb49d('0x46')](_0xb49d('0x9a'),_0xb49d('0x9b'));_0x2685d1['field'](_0xb49d('0x9c'),_0xb49d('0x9d'));_0x2685d1[_0xb49d('0x46')](_0xb49d('0x9e'),_0xb49d('0x9f'));_0x2685d1[_0xb49d('0x46')]('c.phone',_0xb49d('0xa0'));_0x2685d1[_0xb49d('0x46')](_0xb49d('0xa1'),_0xb49d('0xa2'));_0x2685d1['field'](_0xb49d('0xa3'),_0xb49d('0xa4'));_0x2685d1[_0xb49d('0x46')](_0xb49d('0xa5'),_0xb49d('0xa6'));_0x2685d1[_0xb49d('0x46')](_0xb49d('0xa7'),_0xb49d('0xa8'));_0x2685d1['field'](_0xb49d('0xa9'),_0xb49d('0x32'));}if(_0x423399[_0xb49d('0x23')])_0x2685d1['limit'](_0x423399[_0xb49d('0x23')]);if(_0x423399['offset'])_0x2685d1['offset'](_0x423399[_0xb49d('0x22')]);return db[_0xb49d('0x94')][_0xb49d('0x3a')](_0x2685d1[_0xb49d('0x95')](),_0x1c1be2);})[_0xb49d('0x2b')](function(_0x4bdf27){_0x1d8833[_0xb49d('0x43')](_0xb49d('0xaa'),_[_0xb49d('0x31')](_0x4bdf27,'id'));return db[_0xb49d('0x94')]['query'](_0x1d8833['toString'](),_0x1c1be2)[_0xb49d('0x2b')](function(_0x3f5d54){var _0x361795=_['groupBy'](_0x3f5d54,_0xb49d('0xab'));var _0x4bc3f6=[];_0x4bdf27[_0xb49d('0x6d')](function(_0x2ddc5d){_0x4bc3f6[_0xb49d('0x35')](updateFaxInteraction(_0x2ddc5d,_0x5db393,_0x361795));});return BPromise[_0xb49d('0xac')](_0x4bc3f6);});});})[_0xb49d('0x2b')](function(_0x5e8583){_0x3964ec[_0xb49d('0xad')]=_0x5e8583;return _0x3964ec;})['then'](respondWithFilteredResult(_0x4b790e,_0x423399));})['catch'](handleError(_0x4b790e,null));};exports[_0xb49d('0xae')]=function(_0x3c5448,_0xccde3d){var _0xdbf39={'raw':![],'where':{'id':_0x3c5448[_0xb49d('0xaf')]['id']}},_0x25c525={};_0x25c525['model']=_[_0xb49d('0x3b')](db[_0xb49d('0x36')][_0xb49d('0xb0')]);_0x25c525[_0xb49d('0x3a')]=_[_0xb49d('0x3b')](_0x3c5448['query']);_0x25c525[_0xb49d('0x44')]=_['intersection'](_0x25c525[_0xb49d('0x39')],_0x25c525[_0xb49d('0x3a')]);_0xdbf39[_0xb49d('0x3f')]=_[_0xb49d('0x3c')](_0x25c525['model'],qs[_0xb49d('0x3d')](_0x3c5448[_0xb49d('0x3a')]['fields']));_0xdbf39['attributes']=_0xdbf39[_0xb49d('0x3f')][_0xb49d('0x3e')]?_0xdbf39[_0xb49d('0x3f')]:_0x25c525['model'];if(_0x3c5448[_0xb49d('0x3a')][_0xb49d('0xb1')]){_0xdbf39[_0xb49d('0xb2')]=[{'all':!![]}];}_0xdbf39=_[_0xb49d('0xb3')]({},_0xdbf39,_0x3c5448['options']);return db[_0xb49d('0x36')][_0xb49d('0x5d')](_0xdbf39)[_0xb49d('0x2b')](handleEntityNotFound(_0xccde3d,null))[_0xb49d('0x2b')](respondWithResult(_0xccde3d,null))[_0xb49d('0xb4')](handleError(_0xccde3d,null));};exports[_0xb49d('0xb5')]=function(_0x54fd10,_0x4a19f7){return db[_0xb49d('0x36')][_0xb49d('0xb5')](_0x54fd10[_0xb49d('0x72')],{})['then'](respondWithResult(_0x4a19f7,0xc9))[_0xb49d('0xb4')](handleError(_0x4a19f7,null));};exports['update']=function(_0x744d73,_0x6b7e61){if(_0x744d73[_0xb49d('0x72')]['id']){delete _0x744d73[_0xb49d('0x72')]['id'];}return db['FaxInteraction'][_0xb49d('0x5d')]({'where':{'id':_0x744d73[_0xb49d('0xaf')]['id']}})[_0xb49d('0x2b')](handleEntityNotFound(_0x6b7e61,null))[_0xb49d('0x2b')](saveUpdates(_0x744d73[_0xb49d('0x72')],null))['then'](respondWithResult(_0x6b7e61,null))[_0xb49d('0xb4')](handleError(_0x6b7e61,null));};exports[_0xb49d('0x2c')]=function(_0x6f8663,_0x2eef83){return db[_0xb49d('0x36')][_0xb49d('0x5d')]({'where':{'id':_0x6f8663['params']['id']}})['then'](handleEntityNotFound(_0x2eef83,null))['then'](removeEntity(_0x2eef83,null))[_0xb49d('0xb4')](handleError(_0x2eef83,null));};exports[_0xb49d('0xb6')]=function(_0x3afc6b,_0x49967){return db['FaxInteraction'][_0xb49d('0xb6')]()[_0xb49d('0x2b')](respondWithResult(_0x49967,null))['catch'](handleError(_0x49967,null));};exports['addMessage']=function(_0x3aec09,_0x4fc2fb,_0x34ae8e){return db[_0xb49d('0xb7')][_0xb49d('0x5d')]({'where':{'id':_0x3aec09[_0xb49d('0xaf')]['id']}})[_0xb49d('0x2b')](handleEntityNotFound(_0x4fc2fb,null))[_0xb49d('0x2b')](function(_0x12c193){if(_0x12c193){return _0x12c193['addMessage'](_0x3aec09[_0xb49d('0x72')]['ids'],_[_0xb49d('0xb8')](_0x3aec09[_0xb49d('0x72')],[_0xb49d('0xb9'),'id'])||{});}})[_0xb49d('0x2b')](respondWithResult(_0x4fc2fb,null))[_0xb49d('0xb4')](handleError(_0x4fc2fb,null));};exports['getMessages']=function(_0x13b5ef,_0x4359dc,_0x30c9c2){var _0x1fd588={'raw':![],'where':{}};var _0x311f47={};var _0x3c981e={'count':0x0,'rows':[]};return db[_0xb49d('0x36')][_0xb49d('0xba')]({'where':{'id':_0x13b5ef['params']['id']}})[_0xb49d('0x2b')](handleEntityNotFound(_0x4359dc,null))[_0xb49d('0x2b')](function(_0x512fe2){if(_0x512fe2){_0x311f47[_0xb49d('0x39')]=_[_0xb49d('0x3b')](db[_0xb49d('0xb7')][_0xb49d('0xb0')]);_0x311f47['query']=_[_0xb49d('0x3b')](_0x13b5ef[_0xb49d('0x3a')]);_0x311f47[_0xb49d('0x44')]=_[_0xb49d('0x3c')](_0x311f47[_0xb49d('0x39')],_0x311f47[_0xb49d('0x3a')]);_0x1fd588[_0xb49d('0x3f')]=_[_0xb49d('0x3c')](_0x311f47[_0xb49d('0x39')],qs[_0xb49d('0x3d')](_0x13b5ef[_0xb49d('0x3a')][_0xb49d('0x3d')]));_0x1fd588[_0xb49d('0x3f')]=_0x1fd588[_0xb49d('0x3f')][_0xb49d('0x3e')]?_0x1fd588['attributes']:_0x311f47[_0xb49d('0x39')];if(!_0x13b5ef[_0xb49d('0x3a')][_0xb49d('0x40')](_0xb49d('0xbb'))){_0x1fd588['limit']=qs[_0xb49d('0x23')](_0x13b5ef[_0xb49d('0x3a')]['limit']);_0x1fd588[_0xb49d('0x22')]=qs[_0xb49d('0x22')](_0x13b5ef[_0xb49d('0x3a')][_0xb49d('0x22')]);}_0x1fd588[_0xb49d('0x41')]=qs['sort'](_0x13b5ef['query'][_0xb49d('0x42')]);_0x1fd588[_0xb49d('0x43')]=qs['filters'](_[_0xb49d('0xbc')](_0x13b5ef[_0xb49d('0x3a')],_0x311f47[_0xb49d('0x44')]));_0x1fd588[_0xb49d('0x43')][_0xb49d('0xab')]=_0x512fe2['id'];if(_0x13b5ef[_0xb49d('0x3a')]['filter']){_0x1fd588['where']=_[_0xb49d('0xb3')](_0x1fd588[_0xb49d('0x43')],{'$or':_[_0xb49d('0x31')](_0x1fd588['attributes'],function(_0xf74aa1){var _0x26d93a={};_0x26d93a[_0xf74aa1]={'$like':'%'+_0x13b5ef['query'][_0xb49d('0x83')]+'%'};return _0x26d93a;})});}if(_0x13b5ef[_0xb49d('0x3a')][_0xb49d('0x7a')]){var _0x3d6393=_0x13b5ef[_0xb49d('0x3a')][_0xb49d('0x7a')][_0xb49d('0x34')](',');var _0x4a7dcd={};_0x4a7dcd[_0x3d6393[0x0]]={'$gte':moment(_0x3d6393[0x1])['format'](_0xb49d('0xbd'))};_0x1fd588[_0xb49d('0x43')]=_[_0xb49d('0xb3')](_0x1fd588[_0xb49d('0x43')],_0x4a7dcd);}_0x1fd588=_[_0xb49d('0xb3')]({},_0x1fd588,_0x13b5ef[_0xb49d('0xbe')]);return db[_0xb49d('0xb7')]['count']({'where':_0x1fd588[_0xb49d('0x43')]})['then'](function(_0x3098c4){_0x3c981e[_0xb49d('0x21')]=_0x3098c4;if(_0x13b5ef[_0xb49d('0x3a')][_0xb49d('0xb1')]){_0x1fd588['include']=[{'all':!![]}];}return db[_0xb49d('0xb7')][_0xb49d('0xbf')](_0x1fd588);})['then'](function(_0x3bf22a){_0x3c981e['rows']=_0x3bf22a;return _0x3c981e;});}})[_0xb49d('0x2b')](respondWithFilteredResult(_0x4359dc,_0x1fd588))[_0xb49d('0xb4')](handleError(_0x4359dc,null));};exports['addTags']=function(_0x5bc213,_0x4ec4b1,_0x2f7481){return db[_0xb49d('0x36')][_0xb49d('0x5d')]({'where':{'id':_0x5bc213['params']['id']}})[_0xb49d('0x2b')](handleEntityNotFound(_0x4ec4b1,null))[_0xb49d('0x2b')](function(_0x51a105){if(_0x51a105){return _0x51a105[_0xb49d('0xc0')](_0x5bc213[_0xb49d('0x72')][_0xb49d('0xb9')],_[_0xb49d('0xb8')](_0x5bc213['body'],[_0xb49d('0xb9'),'id'])||{})[_0xb49d('0xc1')](function(){return db['Tag']['findAll']({'attributes':['id',_0xb49d('0x2f'),'color'],'where':{'id':_0x5bc213[_0xb49d('0x72')][_0xb49d('0xb9')]}});})[_0xb49d('0x2b')](function(_0x520904){socket[_0xb49d('0xc2')](_0xb49d('0xc3'),{'id':Number(_0x5bc213[_0xb49d('0xaf')]['id']),'tags':_0x520904||[]});return{'id':Number(_0x5bc213[_0xb49d('0xaf')]['id']),'tags':_0x520904||[]};});}})[_0xb49d('0x2b')](respondWithResult(_0x4ec4b1,null))[_0xb49d('0xb4')](handleError(_0x4ec4b1,null));};exports['removeTags']=function(_0x42d1d8,_0xe6ddd3,_0x3901c5){return db['FaxInteraction'][_0xb49d('0x5d')]({'where':{'id':_0x42d1d8[_0xb49d('0xaf')]['id']}})[_0xb49d('0x2b')](handleEntityNotFound(_0xe6ddd3,null))[_0xb49d('0x2b')](function(_0x187099){if(_0x187099){return _0x187099[_0xb49d('0xc4')](_0x42d1d8[_0xb49d('0x3a')][_0xb49d('0xb9')]);}})[_0xb49d('0x2b')](respondWithStatusCode(_0xe6ddd3,null))[_0xb49d('0xb4')](handleError(_0xe6ddd3,null));};exports[_0xb49d('0xc5')]=function(_0x13ea50,_0x4d87f5){var _0x59dcdd=moment()['unix']()[_0xb49d('0x95')]();var _0x388748=path[_0xb49d('0xc6')](config[_0xb49d('0xc7')],_0xb49d('0xc8'),'files',_0xb49d('0xc9'));var _0x585118=path['join'](config[_0xb49d('0xc7')],'server',_0xb49d('0xca'),_0xb49d('0xcb'));var _0x3e4867=path['join'](_0x388748,_0x59dcdd);var _0x415cf8=util[_0xb49d('0xcc')]('transcript-%d-%s.zip',_0x13ea50[_0xb49d('0xaf')]['id'],_0x59dcdd);var _0x57b736=path[_0xb49d('0xc6')](_0x388748,_0x415cf8);var _0x4e7ffa=[];_0x4e7ffa[_0xb49d('0x35')]({'model':db['Attachment'],'as':_0xb49d('0xcd'),'raw':!![]});var _0x1c926c=[{'model':db[_0xb49d('0xb7')],'as':_0xb49d('0xce'),'attributes':['id',_0xb49d('0x72'),_0xb49d('0x78')],'include':_0x4e7ffa}];return db[_0xb49d('0x36')]['find']({'where':{'id':_0x13ea50[_0xb49d('0xaf')]['id']},'include':_0x1c926c})[_0xb49d('0x2b')](handleEntityNotFound(_0x4d87f5,null))[_0xb49d('0x2b')](function(_0x44b665){if(_0x44b665&&_0x44b665[_0xb49d('0xce')]){var _0x3deef0=_0x44b665[_0xb49d('0xcf')]({'plain':!![]});fs['mkdirSync'](_0x3e4867);for(var _0x40ac1a=0x0;_0x40ac1a<_0x3deef0[_0xb49d('0xce')][_0xb49d('0x3e')];_0x40ac1a++){var _0x2e9afb=_0x3deef0['Messages'][_0x40ac1a][_0xb49d('0xcd')];if(_0x2e9afb){var _0x3c66e2=path[_0xb49d('0xc6')](_0x585118,_0x2e9afb[_0xb49d('0xd0')]);if(fs['existsSync'](_0x3c66e2)){fs['createReadStream'](_0x3c66e2)[_0xb49d('0xd1')](fs['createWriteStream'](path[_0xb49d('0xc6')](_0x3e4867,_0x2e9afb[_0xb49d('0xd0')])));}}}return BPromise[_0xb49d('0x90')]()[_0xb49d('0x2b')](function(){return new BPromise(function(_0x332099,_0xc54942){zipdir(_0x3e4867,{'saveTo':_0x57b736},function(_0x4a156c,_0x3396c1){if(_0x4a156c)return _0xc54942(_0x4a156c);return _0x332099(_0x3396c1);});})[_0xb49d('0x2b')](function(){return new BPromise(function(_0x22039a,_0x23c234){rimraf(_0x3e4867,function(_0x469f9c){if(_0x469f9c)_0x23c234(_0x469f9c);return _0x22039a();});});})[_0xb49d('0x2b')](function(){return _0x4d87f5[_0xb49d('0xc5')](_0x57b736,_0x415cf8,function(_0x2d2eba){if(_0x2d2eba){console[_0xb49d('0xd2')](_0xb49d('0xd3'),_0x2d2eba);}else{fs[_0xb49d('0xd4')](_0x57b736);}});});});}else{return _0x4d87f5[_0xb49d('0x1e')](0xc8);}})[_0xb49d('0xb4')](handleError(_0x4d87f5,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index a59a0cb..62dee0a 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 _0xdb28=['Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','setDataValue'];(function(_0xfc7019,_0x277c9e){var _0x2af8f4=function(_0x2a2ef3){while(--_0x2a2ef3){_0xfc7019['push'](_0xfc7019['shift']());}};_0x2af8f4(++_0x277c9e);}(_0xdb28,0x106));var _0x8db2=function(_0x40b3e9,_0xa8cd8c){_0x40b3e9=_0x40b3e9-0x0;var _0x1646ed=_0xdb28[_0x40b3e9];return _0x1646ed;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var FaxInteraction=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var FaxMessage=require(_0x8db2('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':_0x8db2('0x4'),'afterUpdate':_0x8db2('0x5'),'afterDestroy':_0x8db2('0x6')};function emitEvent(_0x11109e){return function(_0x52bf99,_0x21a03e,_0x1d2dd3){_0x52bf99['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x477f50){_0x52bf99[_0x8db2('0x7')](_0x8db2('0x8'),_0x477f50[_0x8db2('0x9')](function(_0x2f3f2f){return{'id':_0x2f3f2f['id']};}));return FaxMessage[_0x8db2('0xa')]({'where':{'FaxInteractionId':_0x52bf99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8db2('0xb')](function(_0x4ba340){_0x52bf99[_0x8db2('0x7')](_0x8db2('0xc'),_0x4ba340[_0x8db2('0xd')]);FaxInteractionEvents['emit'](_0x11109e+':'+_0x52bf99['id'],_0x52bf99);FaxInteractionEvents[_0x8db2('0xe')](_0x11109e,_0x52bf99);_0x1d2dd3(null);})[_0x8db2('0xf')](_0x1d2dd3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x8db2('0x10')](e,emitEvent(event));}}module[_0x8db2('0x11')]=FaxInteractionEvents; \ No newline at end of file +var _0xdb28=['Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update','remove','setDataValue'];(function(_0x1d2bc8,_0x2860bc){var _0x1857e1=function(_0x3a3073){while(--_0x3a3073){_0x1d2bc8['push'](_0x1d2bc8['shift']());}};_0x1857e1(++_0x2860bc);}(_0xdb28,0x106));var _0x8db2=function(_0x7195ee,_0x4af7b4){_0x7195ee=_0x7195ee-0x0;var _0x28ae34=_0xdb28[_0x7195ee];return _0x28ae34;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var FaxInteraction=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var FaxMessage=require(_0x8db2('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':_0x8db2('0x4'),'afterUpdate':_0x8db2('0x5'),'afterDestroy':_0x8db2('0x6')};function emitEvent(_0x11109e){return function(_0x52bf99,_0x21a03e,_0x1d2dd3){_0x52bf99['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x477f50){_0x52bf99[_0x8db2('0x7')](_0x8db2('0x8'),_0x477f50[_0x8db2('0x9')](function(_0x2f3f2f){return{'id':_0x2f3f2f['id']};}));return FaxMessage[_0x8db2('0xa')]({'where':{'FaxInteractionId':_0x52bf99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8db2('0xb')](function(_0x4ba340){_0x52bf99[_0x8db2('0x7')](_0x8db2('0xc'),_0x4ba340[_0x8db2('0xd')]);FaxInteractionEvents['emit'](_0x11109e+':'+_0x52bf99['id'],_0x52bf99);FaxInteractionEvents[_0x8db2('0xe')](_0x11109e,_0x52bf99);_0x1d2dd3(null);})[_0x8db2('0xf')](_0x1d2dd3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x8db2('0x10')](e,emitEvent(event));}}module[_0x8db2('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index c1204f2..03d9166 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 _0xcb91=['path','rimraf','./faxInteraction.attributes','exports','define','fax_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','moment','bluebird'];(function(_0x20f8e9,_0x34054b){var _0x3517fc=function(_0x1cde1e){while(--_0x1cde1e){_0x20f8e9['push'](_0x20f8e9['shift']());}};_0x3517fc(++_0x34054b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0xcb91[_0xbc2974];return _0x3a5b4f;};'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')]('FaxInteraction',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x12567c,_0x59d1be,_0x3ae0f1){if(_0x12567c['changed']('closed')){_0x12567c[_0x1cb9('0xa')]=moment()[_0x1cb9('0xb')](_0x1cb9('0xc'));}_0x3ae0f1(null,_0x12567c);}}});}; \ No newline at end of file +var _0x702d=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','FaxInteraction','changed'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x702d,0x147));var _0xd702=function(_0xce8dfc,_0x324461){_0xce8dfc=_0xce8dfc-0x0;var _0x555286=_0x702d[_0xce8dfc];return _0x555286;};'use strict';var _=require(_0xd702('0x0'));var util=require(_0xd702('0x1'));var logger=require(_0xd702('0x2'))(_0xd702('0x3'));var moment=require(_0xd702('0x4'));var BPromise=require('bluebird');var rp=require(_0xd702('0x5'));var fs=require('fs');var path=require(_0xd702('0x6'));var rimraf=require(_0xd702('0x7'));var config=require(_0xd702('0x8'));var attributes=require('./faxInteraction.attributes');module[_0xd702('0x9')]=function(_0x544e94,_0x1aecfc){return _0x544e94[_0xd702('0xa')](_0xd702('0xb'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x12bb75,_0x53bd02,_0x39c49e){if(_0x12bb75[_0xd702('0xc')](_0xd702('0xd'))){_0x12bb75[_0xd702('0xe')]=moment()[_0xd702('0xf')](_0xd702('0x10'));}_0x39c49e(null,_0x12bb75);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 248d924..fe90b06 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 _0x6fcf=['randomstring','ioredis','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','limit','then','catch','addTags','ids','AddTags','lodash','util','moment','bluebird'];(function(_0x5448aa,_0x4d2779){var _0x1408bc=function(_0x1613d5){while(--_0x1613d5){_0x5448aa['push'](_0x5448aa['shift']());}};_0x1408bc(++_0x4d2779);}(_0x6fcf,0x1d0));var _0xf6fc=function(_0x3a7258,_0x4f9d4f){_0x3a7258=_0x3a7258-0x0;var _0x2f6012=_0x6fcf[_0x3a7258];return _0x2f6012;};'use strict';var _=require(_0xf6fc('0x0'));var util=require(_0xf6fc('0x1'));var moment=require(_0xf6fc('0x2'));var BPromise=require(_0xf6fc('0x3'));var rs=require(_0xf6fc('0x4'));var fs=require('fs');var Redis=require(_0xf6fc('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf6fc('0x6'));var config=require('../../config/environment');var jayson=require(_0xf6fc('0x7'));var client=jayson[_0xf6fc('0x8')][_0xf6fc('0x9')]({'port':0x232a});config['redis']=_[_0xf6fc('0xa')](config[_0xf6fc('0xb')],{'host':_0xf6fc('0xc'),'port':0x18eb});var socket=require(_0xf6fc('0xd'))(new Redis(config[_0xf6fc('0xb')]));require(_0xf6fc('0xe'))[_0xf6fc('0xf')](socket);function respondWithRpcPromise(_0xb4ecf2,_0x5d175e,_0x4cd95a){return new BPromise(function(_0x120427,_0x2ab53a){return client[_0xf6fc('0x10')](_0xb4ecf2,_0x4cd95a)['then'](function(_0x4fa5d0){logger[_0xf6fc('0x11')](_0xf6fc('0x12'),_0x5d175e,_0xf6fc('0x13'));logger[_0xf6fc('0x14')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x5d175e,_0xf6fc('0x13'),JSON[_0xf6fc('0x15')](_0x4fa5d0));if(_0x4fa5d0[_0xf6fc('0x16')]){if(_0x4fa5d0[_0xf6fc('0x16')][_0xf6fc('0x17')]===0x1f4){logger[_0xf6fc('0x16')](_0xf6fc('0x12'),_0x5d175e,_0x4fa5d0[_0xf6fc('0x16')][_0xf6fc('0x18')]);return _0x2ab53a(_0x4fa5d0[_0xf6fc('0x16')][_0xf6fc('0x18')]);}logger[_0xf6fc('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x5d175e,_0x4fa5d0[_0xf6fc('0x16')][_0xf6fc('0x18')]);return _0x120427(_0x4fa5d0['error'][_0xf6fc('0x18')]);}else{logger[_0xf6fc('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x5d175e,'request\x20sent');_0x120427(_0x4fa5d0['result'][_0xf6fc('0x18')]);}})['catch'](function(_0x4187eb){logger[_0xf6fc('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x5d175e,_0x4187eb);_0x2ab53a(_0x4187eb);});});}exports[_0xf6fc('0x19')]=function(_0x3db7e5){var _0x260a5f=this;return new Promise(function(_0x570b2d,_0x97c35f){return db[_0xf6fc('0x1a')][_0xf6fc('0x1b')](_0x3db7e5[_0xf6fc('0x1c')],{'raw':_0x3db7e5[_0xf6fc('0x1d')]?_0x3db7e5[_0xf6fc('0x1d')][_0xf6fc('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3db7e5[_0xf6fc('0x1d')]?_0x3db7e5[_0xf6fc('0x1d')][_0xf6fc('0x1f')]||null:null,'attributes':_0x3db7e5['options']?_0x3db7e5[_0xf6fc('0x1d')][_0xf6fc('0x20')]||null:null,'limit':_0x3db7e5[_0xf6fc('0x1d')]?_0x3db7e5[_0xf6fc('0x1d')][_0xf6fc('0x21')]||null:null})[_0xf6fc('0x22')](function(_0x4d470d){logger[_0xf6fc('0x11')](_0xf6fc('0x19'),_0x3db7e5);logger[_0xf6fc('0x14')]('UpdateFaxInteraction',_0x3db7e5,JSON['stringify'](_0x4d470d));_0x570b2d(_0x4d470d);})[_0xf6fc('0x23')](function(_0x400f65){logger[_0xf6fc('0x16')]('UpdateFaxInteraction',_0x400f65[_0xf6fc('0x18')],_0x3db7e5);_0x97c35f(_0x260a5f[_0xf6fc('0x16')](0x1f4,_0x400f65[_0xf6fc('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x44ab71){return new Promise(function(_0x3bd81c,_0x2bc836){return db[_0xf6fc('0x1a')]['find']({'where':_0x44ab71[_0xf6fc('0x1d')]?_0x44ab71[_0xf6fc('0x1d')]['where']||null:null})[_0xf6fc('0x22')](function(_0x358903){if(_0x358903){return _0x358903[_0xf6fc('0x24')](_0x44ab71[_0xf6fc('0x1c')][_0xf6fc('0x25')],_['omit'](_0x44ab71[_0xf6fc('0x1c')],[_0xf6fc('0x25'),'id'])||{});}})['spread'](function(_0x2d6b75){logger['info'](_0xf6fc('0x26'),_0x44ab71);logger[_0xf6fc('0x14')](_0xf6fc('0x26'),_0x44ab71,JSON[_0xf6fc('0x15')](_0x2d6b75));_0x3bd81c(_0x2d6b75);})[_0xf6fc('0x23')](function(_0x6586e){logger[_0xf6fc('0x16')](_0xf6fc('0x26'),_0x6586e[_0xf6fc('0x18')],_0x44ab71);_0x2bc836(_this['error'](0x1f4,_0x6586e[_0xf6fc('0x18')]));});});}; \ No newline at end of file +var _0xc15b=['update','body','options','raw','where','attributes','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateFaxInteraction','FaxInteraction'];(function(_0x5c77d4,_0x1150f6){var _0x4d9b6c=function(_0x4164de){while(--_0x4164de){_0x5c77d4['push'](_0x5c77d4['shift']());}};_0x4d9b6c(++_0x1150f6);}(_0xc15b,0xa8));var _0xbc15=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xc15b[_0x2064e5];return _0x21a233;};'use strict';var _=require(_0xbc15('0x0'));var util=require('util');var moment=require(_0xbc15('0x1'));var BPromise=require(_0xbc15('0x2'));var rs=require(_0xbc15('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbc15('0x4'));var logger=require(_0xbc15('0x5'))(_0xbc15('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbc15('0x7')][_0xbc15('0x8')]({'port':0x232a});config[_0xbc15('0x9')]=_['defaults'](config[_0xbc15('0x9')],{'host':_0xbc15('0xa'),'port':0x18eb});var socket=require(_0xbc15('0xb'))(new Redis(config['redis']));require(_0xbc15('0xc'))[_0xbc15('0xd')](socket);function respondWithRpcPromise(_0x5492e1,_0x116bc3,_0x4b1581){return new BPromise(function(_0x114f49,_0x491d01){return client[_0xbc15('0xe')](_0x5492e1,_0x4b1581)[_0xbc15('0xf')](function(_0x3b5bd7){logger[_0xbc15('0x10')](_0xbc15('0x11'),_0x116bc3,_0xbc15('0x12'));logger[_0xbc15('0x13')](_0xbc15('0x14'),_0x116bc3,'request\x20sent',JSON[_0xbc15('0x15')](_0x3b5bd7));if(_0x3b5bd7[_0xbc15('0x16')]){if(_0x3b5bd7[_0xbc15('0x16')]['code']===0x1f4){logger[_0xbc15('0x16')](_0xbc15('0x11'),_0x116bc3,_0x3b5bd7[_0xbc15('0x16')][_0xbc15('0x17')]);return _0x491d01(_0x3b5bd7[_0xbc15('0x16')]['message']);}logger[_0xbc15('0x16')](_0xbc15('0x11'),_0x116bc3,_0x3b5bd7[_0xbc15('0x16')][_0xbc15('0x17')]);return _0x114f49(_0x3b5bd7[_0xbc15('0x16')][_0xbc15('0x17')]);}else{logger[_0xbc15('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x116bc3,_0xbc15('0x12'));_0x114f49(_0x3b5bd7['result']['message']);}})[_0xbc15('0x18')](function(_0x48adfa){logger[_0xbc15('0x16')](_0xbc15('0x11'),_0x116bc3,_0x48adfa);_0x491d01(_0x48adfa);});});}exports[_0xbc15('0x19')]=function(_0x45c7c0){var _0x49a5a6=this;return new Promise(function(_0x45e470,_0x317ee8){return db[_0xbc15('0x1a')][_0xbc15('0x1b')](_0x45c7c0[_0xbc15('0x1c')],{'raw':_0x45c7c0[_0xbc15('0x1d')]?_0x45c7c0['options'][_0xbc15('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45c7c0['options']?_0x45c7c0[_0xbc15('0x1d')][_0xbc15('0x1f')]||null:null,'attributes':_0x45c7c0[_0xbc15('0x1d')]?_0x45c7c0[_0xbc15('0x1d')][_0xbc15('0x20')]||null:null,'limit':_0x45c7c0[_0xbc15('0x1d')]?_0x45c7c0[_0xbc15('0x1d')]['limit']||null:null})['then'](function(_0x2fb3b7){logger[_0xbc15('0x10')]('UpdateFaxInteraction',_0x45c7c0);logger[_0xbc15('0x13')](_0xbc15('0x19'),_0x45c7c0,JSON[_0xbc15('0x15')](_0x2fb3b7));_0x45e470(_0x2fb3b7);})[_0xbc15('0x18')](function(_0x41dd6e){logger[_0xbc15('0x16')](_0xbc15('0x19'),_0x41dd6e[_0xbc15('0x17')],_0x45c7c0);_0x317ee8(_0x49a5a6[_0xbc15('0x16')](0x1f4,_0x41dd6e[_0xbc15('0x17')]));});});};exports['AddTagsToFaxInteraction']=function(_0xbd9415){return new Promise(function(_0x3133b1,_0x2873a9){return db[_0xbc15('0x1a')][_0xbc15('0x21')]({'where':_0xbd9415[_0xbc15('0x1d')]?_0xbd9415[_0xbc15('0x1d')][_0xbc15('0x1f')]||null:null})['then'](function(_0x102c35){if(_0x102c35){return _0x102c35[_0xbc15('0x22')](_0xbd9415[_0xbc15('0x1c')][_0xbc15('0x23')],_[_0xbc15('0x24')](_0xbd9415['body'],['ids','id'])||{});}})[_0xbc15('0x25')](function(_0x41820a){logger[_0xbc15('0x10')](_0xbc15('0x26'),_0xbd9415);logger[_0xbc15('0x13')](_0xbc15('0x26'),_0xbd9415,JSON[_0xbc15('0x15')](_0x41820a));_0x3133b1(_0x41820a);})[_0xbc15('0x18')](function(_0x4dbbc2){logger['error'](_0xbc15('0x26'),_0x4dbbc2[_0xbc15('0x17')],_0xbd9415);_0x2873a9(_this[_0xbc15('0x16')](0x1f4,_0x4dbbc2[_0xbc15('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 48d26ed..25c61cc 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 _0xa34c=['removeListener','register','faxInteraction:','./faxInteraction.events','save','remove','emit'];(function(_0x4f153b,_0x39818f){var _0x4e0cf8=function(_0x5a2236){while(--_0x5a2236){_0x4f153b['push'](_0x4f153b['shift']());}};_0x4e0cf8(++_0x39818f);}(_0xa34c,0xb2));var _0xca34=function(_0x288539,_0x148266){_0x288539=_0x288539-0x0;var _0x2302e3=_0xa34c[_0x288539];return _0x2302e3;};'use strict';var FaxInteractionEvents=require(_0xca34('0x0'));var events=[_0xca34('0x1'),_0xca34('0x2'),'update'];function createListener(_0x57c106,_0x42f60f){return function(_0x19c132){_0x42f60f[_0xca34('0x3')](_0x57c106,_0x19c132);};}function removeListener(_0x4af67f,_0x1fab37){return function(){FaxInteractionEvents[_0xca34('0x4')](_0x4af67f,_0x1fab37);};}exports[_0xca34('0x5')]=function(_0x16a223){for(var _0x1cb22f=0x0,_0x376817=events['length'];_0x1cb22f<_0x376817;_0x1cb22f++){var _0x590cfd=events[_0x1cb22f];var _0x1678d7=createListener(_0xca34('0x6')+_0x590cfd,_0x16a223);FaxInteractionEvents['on'](_0x590cfd,_0x1678d7);}}; \ No newline at end of file +var _0x3549=['save','update','emit','length','faxInteraction:','./faxInteraction.events'];(function(_0x3674d1,_0x867a40){var _0x3c911e=function(_0x102406){while(--_0x102406){_0x3674d1['push'](_0x3674d1['shift']());}};_0x3c911e(++_0x867a40);}(_0x3549,0x179));var _0x9354=function(_0x4ec7fd,_0x26b33f){_0x4ec7fd=_0x4ec7fd-0x0;var _0x1ebfad=_0x3549[_0x4ec7fd];return _0x1ebfad;};'use strict';var FaxInteractionEvents=require(_0x9354('0x0'));var events=[_0x9354('0x1'),'remove',_0x9354('0x2')];function createListener(_0x513ff3,_0x1d3f74){return function(_0x1c725e){_0x1d3f74[_0x9354('0x3')](_0x513ff3,_0x1c725e);};}function removeListener(_0x289ea7,_0x4b3ca6){return function(){FaxInteractionEvents['removeListener'](_0x289ea7,_0x4b3ca6);};}exports['register']=function(_0x256cd6){for(var _0x1d2e43=0x0,_0x3faad0=events[_0x9354('0x4')];_0x1d2e43<_0x3faad0;_0x1d2e43++){var _0x30eef0=events[_0x1d2e43];var _0x4b16b8=createListener(_0x9354('0x5')+_0x30eef0,_0x256cd6);FaxInteractionEvents['on'](_0x30eef0,_0x4b16b8);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index d6f9fea..72375b3 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 _0x39d6=['create','/:id/messages','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','isAuthenticated','index','get','/:id','show','getMessages','post'];(function(_0x52cb49,_0x3cf912){var _0xf337b4=function(_0x23a005){while(--_0x23a005){_0x52cb49['push'](_0x52cb49['shift']());}};_0xf337b4(++_0x3cf912);}(_0x39d6,0x8a));var _0x639d=function(_0x58b3d5,_0x5584f8){_0x58b3d5=_0x58b3d5-0x0;var _0x2f6de9=_0x39d6[_0x58b3d5];return _0x2f6de9;};'use strict';var multer=require(_0x639d('0x0'));var util=require(_0x639d('0x1'));var path=require(_0x639d('0x2'));var timeout=require(_0x639d('0x3'));var express=require(_0x639d('0x4'));var router=express[_0x639d('0x5')]();var auth=require(_0x639d('0x6'));var interaction=require(_0x639d('0x7'));var config=require(_0x639d('0x8'));var controller=require(_0x639d('0x9'));router['get']('/',auth[_0x639d('0xa')](),controller[_0x639d('0xb')]);router['get']('/describe',auth[_0x639d('0xa')](),controller['describe']);router[_0x639d('0xc')](_0x639d('0xd'),auth[_0x639d('0xa')](),controller[_0x639d('0xe')]);router[_0x639d('0xc')]('/:id/messages',auth[_0x639d('0xa')](),controller[_0x639d('0xf')]);router[_0x639d('0xc')]('/:id/download',auth[_0x639d('0xa')](),controller['download']);router[_0x639d('0x10')]('/',auth[_0x639d('0xa')](),controller[_0x639d('0x11')]);router[_0x639d('0x10')](_0x639d('0x12'),auth[_0x639d('0xa')](),controller['addMessage']);router[_0x639d('0x10')](_0x639d('0x13'),auth[_0x639d('0xa')](),interaction[_0x639d('0x14')]('fax',_0x639d('0x15')),controller[_0x639d('0x16')]);router[_0x639d('0x17')](_0x639d('0xd'),auth[_0x639d('0xa')](),interaction[_0x639d('0x14')](_0x639d('0x18'),_0x639d('0x19')),controller[_0x639d('0x1a')]);router[_0x639d('0x1b')](_0x639d('0xd'),auth['isAuthenticated'](),interaction[_0x639d('0x14')](_0x639d('0x18'),_0x639d('0x1c')),controller['destroy']);router[_0x639d('0x1b')]('/:id/tags',auth[_0x639d('0xa')](),controller[_0x639d('0x1d')]);module[_0x639d('0x1e')]=router; \ No newline at end of file +var _0xbbdc=['/:id','tracked','fax','faxinteraction:update','update','delete','faxinteraction:destroy','multer','util','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','download','post','create','faxinteraction:addtags'];(function(_0x439b69,_0x44928b){var _0xbf3a19=function(_0x5ea4b3){while(--_0x5ea4b3){_0x439b69['push'](_0x439b69['shift']());}};_0xbf3a19(++_0x44928b);}(_0xbbdc,0x1eb));var _0xcbbd=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xbbdc[_0x4ae6ef];return _0x3cbb4e;};'use strict';var multer=require(_0xcbbd('0x0'));var util=require(_0xcbbd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcbbd('0x2'));var controller=require('./faxInteraction.controller');router[_0xcbbd('0x3')]('/',auth[_0xcbbd('0x4')](),controller[_0xcbbd('0x5')]);router[_0xcbbd('0x3')](_0xcbbd('0x6'),auth['isAuthenticated'](),controller[_0xcbbd('0x7')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcbbd('0x8')]);router['get'](_0xcbbd('0x9'),auth['isAuthenticated'](),controller[_0xcbbd('0xa')]);router[_0xcbbd('0x3')]('/:id/download',auth['isAuthenticated'](),controller[_0xcbbd('0xb')]);router[_0xcbbd('0xc')]('/',auth[_0xcbbd('0x4')](),controller[_0xcbbd('0xd')]);router[_0xcbbd('0xc')](_0xcbbd('0x9'),auth[_0xcbbd('0x4')](),controller['addMessage']);router['post']('/:id/tags',auth[_0xcbbd('0x4')](),interaction['tracked']('fax',_0xcbbd('0xe')),controller['addTags']);router['put'](_0xcbbd('0xf'),auth[_0xcbbd('0x4')](),interaction[_0xcbbd('0x10')](_0xcbbd('0x11'),_0xcbbd('0x12')),controller[_0xcbbd('0x13')]);router[_0xcbbd('0x14')](_0xcbbd('0xf'),auth['isAuthenticated'](),interaction['tracked']('fax',_0xcbbd('0x15')),controller['destroy']);router[_0xcbbd('0x14')]('/:id/tags',auth[_0xcbbd('0x4')](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index b978bad..c974979 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 _0xff18=['medium','BOOLEAN','ENUM','out','TEXT','DATE','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xff18,0x14e));var _0x8ff1=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0xff18[_0x27dba4];return _0x35ec9d;};'use strict';var Sequelize=require(_0x8ff1('0x0'));module[_0x8ff1('0x1')]={'body':{'type':Sequelize['TEXT'](_0x8ff1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8ff1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8ff1('0x4')]('in',_0x8ff1('0x5')),'defaultValue':_0x8ff1('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8ff1('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8ff1('0x7')]}}; \ No newline at end of file +var _0x38ae=['ENUM','out','DATE','sequelize','exports','TEXT','BOOLEAN'];(function(_0x47adb8,_0x591ccc){var _0x4689a8=function(_0x2ba76f){while(--_0x2ba76f){_0x47adb8['push'](_0x47adb8['shift']());}};_0x4689a8(++_0x591ccc);}(_0x38ae,0xb9));var _0xe38a=function(_0x49d41c,_0x2bdc35){_0x49d41c=_0x49d41c-0x0;var _0xb64c5f=_0x38ae[_0x49d41c];return _0xb64c5f;};'use strict';var Sequelize=require(_0xe38a('0x0'));module[_0xe38a('0x1')]={'body':{'type':Sequelize[_0xe38a('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe38a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe38a('0x4')]('in',_0xe38a('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xe38a('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 5abf55f..a7d41a5 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 _0x8ed7=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','defaults','redis','socket.io-emitter','./faxMessage.socket','register','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','merge','options','FaxMessage','includeAll','include','findAll','rows','show','params','fields','find','body','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','fax-interactions','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','create','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','basename','download','join','root','server','files','attachments','html-pdf','eml-format'];(function(_0x5429ba,_0x53d00d){var _0x371b5c=function(_0x4e921d){while(--_0x4e921d){_0x5429ba['push'](_0x5429ba['shift']());}};_0x371b5c(++_0x53d00d);}(_0x8ed7,0x10c));var _0x78ed=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x8ed7[_0x1cfa0d];return _0xe33279;};'use strict';var pdf=require(_0x78ed('0x0'));var emlformat=require(_0x78ed('0x1'));var rimraf=require(_0x78ed('0x2'));var zipdir=require(_0x78ed('0x3'));var jsonpatch=require(_0x78ed('0x4'));var rp=require(_0x78ed('0x5'));var moment=require(_0x78ed('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x78ed('0x7'));var util=require(_0x78ed('0x8'));var path=require(_0x78ed('0x9'));var sox=require(_0x78ed('0xa'));var csv=require(_0x78ed('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x78ed('0xc'));var crypto=require('crypto');var jsforce=require(_0x78ed('0xd'));var deskjs=require(_0x78ed('0xe'));var toCsv=require(_0x78ed('0xb'));var querystring=require(_0x78ed('0xf'));var Papa=require(_0x78ed('0x10'));var Redis=require(_0x78ed('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x78ed('0x12'));var as=require(_0x78ed('0x13'));var hardwareService=require(_0x78ed('0x14'));var logger=require(_0x78ed('0x15'))('api');var utils=require(_0x78ed('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x78ed('0x17')](config[_0x78ed('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x78ed('0x19'))(new Redis(config['redis']));require(_0x78ed('0x1a'))[_0x78ed('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x78ed('0x1c')][_0x78ed('0x1d')]({'port':0x232c});var client9002=jayson[_0x78ed('0x1c')][_0x78ed('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x390566,_0x2630ef,_0x2d0389){if(_0x2d0389){var _0x50257c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x50257c[_0x78ed('0x1e')](_0x2630ef)){return _0x390566;}else{throw new db[(_0x78ed('0x1f'))][(_0x78ed('0x20'))](_0x78ed('0x21'));}}else{return _0x390566;}}function respondWithRpcPromise(_0x2fc7d3,_0xcc21c7,_0x5acd4b,_0x3e647f){return new BPromise(function(_0x200e1c,_0x45336c){var _0x158408=_0x3e647f||client;return _0x158408[_0x78ed('0x22')](_0x2fc7d3,_0x5acd4b)[_0x78ed('0x23')](function(_0x12fe71){logger[_0x78ed('0x24')](_0x78ed('0x25'),_0xcc21c7,_0x78ed('0x26'));logger[_0x78ed('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0xcc21c7,'request\x20sent',JSON['stringify'](_0x12fe71));if(_0x12fe71[_0x78ed('0x28')]){if(_0x12fe71[_0x78ed('0x28')][_0x78ed('0x29')]===0x1f4){logger[_0x78ed('0x28')](_0x78ed('0x25'),_0xcc21c7,_0x12fe71['error'][_0x78ed('0x2a')]);return _0x45336c(_0x12fe71[_0x78ed('0x28')][_0x78ed('0x2a')]);}logger[_0x78ed('0x28')](_0x78ed('0x25'),_0xcc21c7,_0x12fe71[_0x78ed('0x28')]['message']);return _0x200e1c(_0x12fe71[_0x78ed('0x28')]['message']);}else{logger['info'](_0x78ed('0x25'),_0xcc21c7,'request\x20sent');_0x200e1c(_0x12fe71[_0x78ed('0x2b')][_0x78ed('0x2a')]);}})[_0x78ed('0x2c')](function(_0x4ddef6){logger[_0x78ed('0x28')]('FaxMessage,\x20%s,\x20%s',_0xcc21c7,_0x4ddef6);_0x45336c(_0x4ddef6);});});}function respondWithStatusCode(_0x1afb64,_0x22a3d7){_0x22a3d7=_0x22a3d7||0xcc;return function(_0x266e18){if(_0x266e18){return _0x1afb64[_0x78ed('0x2d')](_0x22a3d7);}return _0x1afb64[_0x78ed('0x2e')](_0x22a3d7)[_0x78ed('0x2f')]();};}function respondWithResult(_0x17f065,_0x2004c3){_0x2004c3=_0x2004c3||0xc8;return function(_0x518f74){if(_0x518f74){return _0x17f065[_0x78ed('0x2e')](_0x2004c3)[_0x78ed('0x30')](_0x518f74);}};}function respondWithFilteredResult(_0x23ed4f,_0x31ca3a){return function(_0x4c65a3){if(_0x4c65a3){var _0x336a1c=_0x4c65a3[_0x78ed('0x31')],_0x53a9af=_0x31ca3a[_0x78ed('0x32')],_0xbc492e=_0x31ca3a[_0x78ed('0x32')]+_0x31ca3a[_0x78ed('0x33')],_0x101304;if(_0xbc492e>=_0x336a1c){_0xbc492e=_0x336a1c;_0x101304=0xc8;}else{_0x101304=0xce;}_0x23ed4f[_0x78ed('0x2e')](_0x101304);return _0x23ed4f[_0x78ed('0x34')](_0x78ed('0x35'),_0x53a9af+'-'+_0xbc492e+'/'+_0x336a1c)[_0x78ed('0x30')](_0x4c65a3);}return null;};}function patchUpdates(_0x5e2c7d){return function(_0x38a440){try{jsonpatch['apply'](_0x38a440,_0x5e2c7d,!![]);}catch(_0x4060dd){return BPromise[_0x78ed('0x36')](_0x4060dd);}return _0x38a440[_0x78ed('0x37')]();};}function saveUpdates(_0x176e0e,_0x1958ab){return function(_0x58a967){if(_0x58a967){return _0x58a967[_0x78ed('0x38')](_0x176e0e)[_0x78ed('0x23')](function(_0x5600d2){return _0x5600d2;});}return null;};}function removeEntity(_0xffd089,_0x14afa6){return function(_0x1c4dcb){if(_0x1c4dcb){return _0x1c4dcb[_0x78ed('0x39')]()['then'](function(){_0xffd089[_0x78ed('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58376d,_0x148dac){return function(_0x10b051){if(!_0x10b051){_0x58376d[_0x78ed('0x2d')](0x194);}return _0x10b051;};}function handleError(_0x1f79e7,_0x4cfb34){_0x4cfb34=_0x4cfb34||0x1f4;return function(_0x3b2020){logger[_0x78ed('0x28')](_0x3b2020[_0x78ed('0x3a')]);if(_0x3b2020[_0x78ed('0x3b')]){delete _0x3b2020[_0x78ed('0x3b')];}_0x1f79e7[_0x78ed('0x2e')](_0x4cfb34)['send'](_0x3b2020);};}exports[_0x78ed('0x3c')]=function(_0x4bebda,_0x565f5e){var _0x454b7f={},_0xe34015={},_0x2366cf={'count':0x0,'rows':[]};var _0x50bbd2=_[_0x78ed('0x3d')](db['FaxMessage']['rawAttributes'],function(_0x2287df){return{'name':_0x2287df[_0x78ed('0x3e')],'type':_0x2287df[_0x78ed('0x3f')][_0x78ed('0x40')]};});_0xe34015[_0x78ed('0x41')]=_[_0x78ed('0x3d')](_0x50bbd2,'name');_0xe34015[_0x78ed('0x42')]=_[_0x78ed('0x43')](_0x4bebda['query']);_0xe34015[_0x78ed('0x44')]=_[_0x78ed('0x45')](_0xe34015['model'],_0xe34015[_0x78ed('0x42')]);_0x454b7f[_0x78ed('0x46')]=_[_0x78ed('0x45')](_0xe34015['model'],qs['fields'](_0x4bebda[_0x78ed('0x42')]['fields']));_0x454b7f['attributes']=_0x454b7f['attributes']['length']?_0x454b7f[_0x78ed('0x46')]:_0xe34015[_0x78ed('0x41')];if(!_0x4bebda[_0x78ed('0x42')][_0x78ed('0x47')](_0x78ed('0x48'))){_0x454b7f['limit']=qs['limit'](_0x4bebda[_0x78ed('0x42')][_0x78ed('0x33')]);_0x454b7f['offset']=qs[_0x78ed('0x32')](_0x4bebda[_0x78ed('0x42')][_0x78ed('0x32')]);}_0x454b7f[_0x78ed('0x49')]=qs['sort'](_0x4bebda[_0x78ed('0x42')]['sort']);_0x454b7f[_0x78ed('0x4a')]=qs['filters'](_[_0x78ed('0x4b')](_0x4bebda[_0x78ed('0x42')],_0xe34015['filters']),_0x50bbd2);if(_0x4bebda[_0x78ed('0x42')][_0x78ed('0x4c')]){_0x454b7f[_0x78ed('0x4a')]=_['merge'](_0x454b7f[_0x78ed('0x4a')],{'$or':_[_0x78ed('0x3d')](_0x50bbd2,function(_0x5beae4){if(_0x5beae4[_0x78ed('0x3f')]!==_0x78ed('0x4d')){var _0x2fa655={};_0x2fa655[_0x5beae4[_0x78ed('0x3b')]]={'$like':'%'+_0x4bebda[_0x78ed('0x42')][_0x78ed('0x4c')]+'%'};return _0x2fa655;}})});}_0x454b7f=_[_0x78ed('0x4e')]({},_0x454b7f,_0x4bebda[_0x78ed('0x4f')]);var _0x1b295b={'where':_0x454b7f[_0x78ed('0x4a')]};return db[_0x78ed('0x50')][_0x78ed('0x31')](_0x1b295b)[_0x78ed('0x23')](function(_0x3d9800){_0x2366cf['count']=_0x3d9800;if(_0x4bebda[_0x78ed('0x42')][_0x78ed('0x51')]){_0x454b7f[_0x78ed('0x52')]=[{'all':!![]}];}return db[_0x78ed('0x50')][_0x78ed('0x53')](_0x454b7f);})[_0x78ed('0x23')](function(_0x238584){_0x2366cf[_0x78ed('0x54')]=_0x238584;return _0x2366cf;})['then'](respondWithFilteredResult(_0x565f5e,_0x454b7f))[_0x78ed('0x2c')](handleError(_0x565f5e,null));};exports[_0x78ed('0x55')]=function(_0x27b828,_0x1aca20){var _0x51b307={'raw':!![],'where':{'id':_0x27b828[_0x78ed('0x56')]['id']}},_0x3b8083={};_0x3b8083[_0x78ed('0x41')]=_[_0x78ed('0x43')](db['FaxMessage']['rawAttributes']);_0x3b8083['query']=_[_0x78ed('0x43')](_0x27b828[_0x78ed('0x42')]);_0x3b8083[_0x78ed('0x44')]=_['intersection'](_0x3b8083[_0x78ed('0x41')],_0x3b8083[_0x78ed('0x42')]);_0x51b307[_0x78ed('0x46')]=_['intersection'](_0x3b8083[_0x78ed('0x41')],qs[_0x78ed('0x57')](_0x27b828['query']['fields']));_0x51b307[_0x78ed('0x46')]=_0x51b307['attributes']['length']?_0x51b307['attributes']:_0x3b8083[_0x78ed('0x41')];if(_0x27b828['query'][_0x78ed('0x51')]){_0x51b307['include']=[{'all':!![]}];}_0x51b307=_[_0x78ed('0x4e')]({},_0x51b307,_0x27b828[_0x78ed('0x4f')]);return db[_0x78ed('0x50')][_0x78ed('0x58')](_0x51b307)[_0x78ed('0x23')](handleEntityNotFound(_0x1aca20,null))[_0x78ed('0x23')](respondWithResult(_0x1aca20,null))[_0x78ed('0x2c')](handleError(_0x1aca20,null));};exports[_0x78ed('0x38')]=function(_0x55137b,_0x68e14e){if(_0x55137b[_0x78ed('0x59')]['id']){delete _0x55137b[_0x78ed('0x59')]['id'];}return db[_0x78ed('0x50')]['find']({'where':{'id':_0x55137b['params']['id']}})[_0x78ed('0x23')](handleEntityNotFound(_0x68e14e,null))[_0x78ed('0x23')](saveUpdates(_0x55137b[_0x78ed('0x59')],null))[_0x78ed('0x23')](respondWithResult(_0x68e14e,null))[_0x78ed('0x2c')](handleError(_0x68e14e,null));};exports['destroy']=function(_0x51f48c,_0x3eeaa9){return db[_0x78ed('0x50')][_0x78ed('0x58')]({'where':{'id':_0x51f48c[_0x78ed('0x56')]['id']}})[_0x78ed('0x23')](handleEntityNotFound(_0x3eeaa9,null))[_0x78ed('0x23')](removeEntity(_0x3eeaa9,null))[_0x78ed('0x2c')](handleError(_0x3eeaa9,null));};exports['describe']=function(_0x24077d,_0x445439){return db[_0x78ed('0x50')]['describe']()[_0x78ed('0x23')](respondWithResult(_0x445439,null))[_0x78ed('0x2c')](handleError(_0x445439,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x78ed('0x5a')]=function(_0x1e381f,_0x167f97,_0x544095){var _0x126d15={'channel':_0x78ed('0x5b')};if(_0x1e381f['body']['id']){delete _0x1e381f[_0x78ed('0x59')]['id'];}_0x1e381f[_0x78ed('0x59')][_0x78ed('0x5c')]=!![];_0x1e381f['body'][_0x78ed('0x5d')]=moment()[_0x78ed('0x5e')](_0x78ed('0x5f'));_0x1e381f['body'][_0x78ed('0x60')]=_0x1e381f['body'][_0x78ed('0x60')]||_0x1e381f['user']['id'];return db['FaxMessage'][_0x78ed('0x58')]({'where':{'id':_0x1e381f[_0x78ed('0x56')]['id'],'UserId':null},'include':[{'model':db[_0x78ed('0x61')],'as':_0x78ed('0x62')}]})[_0x78ed('0x23')](handleEntityNotFound(_0x167f97,null))[_0x78ed('0x23')](saveUpdates(_0x1e381f[_0x78ed('0x59')],null))['then'](function(_0x15b345){if(_0x15b345){_0x126d15['message']=_0x15b345[_0x78ed('0x63')]({'plain':!![]});return db['FaxInteraction'][_0x78ed('0x58')]({'where':{'id':_0x15b345['FaxInteractionId']}});}return null;})[_0x78ed('0x23')](handleEntityNotFound(_0x167f97,null))[_0x78ed('0x23')](function(_0x3509a4){if(_0x3509a4){return _0x3509a4[_0x78ed('0x38')]({'UserId':_0x1e381f[_0x78ed('0x59')][_0x78ed('0x60')],'read1stAt':_[_0x78ed('0x64')](_0x3509a4[_0x78ed('0x65')])?moment()[_0x78ed('0x5e')](_0x78ed('0x5f')):undefined});}return null;})[_0x78ed('0x23')](function(_0x3beb81){if(_0x3beb81){_0x126d15[_0x78ed('0x66')]=_0x3beb81[_0x78ed('0x63')]({'plain':!![]});interaction_log[_0x78ed('0x24')](_0x78ed('0x67'),_0x1e381f[_0x78ed('0x68')]['id'],_0x1e381f[_0x78ed('0x68')][_0x78ed('0x3b')],_0x1e381f['user'][_0x78ed('0x69')],_0x126d15[_0x78ed('0x66')]['id'],_0x1e381f['body']?JSON[_0x78ed('0x6a')](_0x1e381f[_0x78ed('0x59')]):_0x78ed('0x6b'));return respondWithRpcPromise(_0x78ed('0x6c'),'acceptMessage',_0x126d15);}return null;})[_0x78ed('0x23')](function(_0x5d531c){if(_0x5d531c){if(_0x1e381f[_0x78ed('0x59')][_0x78ed('0x6d')]){_0x126d15['message'][_0x78ed('0x6e')]=util[_0x78ed('0x5e')](_0x78ed('0x6f'),_0x1e381f[_0x78ed('0x68')][_0x78ed('0x3b')]);_0x126d15['message'][_0x78ed('0x70')]=_0x126d15[_0x78ed('0x70')];_0x126d15[_0x78ed('0x2a')][_0x78ed('0x71')]='accept';return respondWithRpcPromise(_0x78ed('0x72'),_0x78ed('0x72'),{'event':_0x78ed('0x73'),'message':_0x126d15[_0x78ed('0x2a')]},client9002)[_0x78ed('0x23')](function(){return _0x126d15;});}return _0x126d15;}return null;})[_0x78ed('0x23')](respondWithResult(_0x167f97,null))[_0x78ed('0x2c')](handleError(_0x167f97,null));};var interaction_log=require(_0x78ed('0x15'))(_0x78ed('0x74'));exports['reject']=function(_0x4d594d,_0x4e96e9,_0x186a8e){var _0x43f3b8={'agent':{},'channel':_0x78ed('0x5b')};if(_0x4d594d[_0x78ed('0x59')]['id']){delete _0x4d594d['body']['id'];}_0x4d594d[_0x78ed('0x59')]['UserId']=_0x4d594d['body']['UserId']||_0x4d594d[_0x78ed('0x68')]['id'];_0x43f3b8[_0x78ed('0x75')]['id']=_0x4d594d[_0x78ed('0x59')][_0x78ed('0x60')];return db[_0x78ed('0x50')][_0x78ed('0x58')]({'where':{'id':_0x4d594d['params']['id'],'UserId':null}})[_0x78ed('0x23')](handleEntityNotFound(_0x4e96e9,null))[_0x78ed('0x23')](function(_0x51be88){if(_0x51be88){_0x43f3b8[_0x78ed('0x2a')]=_0x51be88[_0x78ed('0x63')]({'plain':!![]});return db['FaxInteraction'][_0x78ed('0x58')]({'where':{'id':_0x51be88[_0x78ed('0x76')]}});}return null;})[_0x78ed('0x23')](handleEntityNotFound(_0x4e96e9,null))[_0x78ed('0x23')](function(_0x582964){if(_0x582964){_0x43f3b8[_0x78ed('0x66')]=_0x582964[_0x78ed('0x63')]({'plain':!![]});interaction_log['info'](_0x78ed('0x77'),_0x4d594d[_0x78ed('0x68')]['id'],_0x4d594d[_0x78ed('0x68')]['name'],_0x4d594d[_0x78ed('0x68')]['role'],_0x43f3b8[_0x78ed('0x66')]['id'],_0x4d594d[_0x78ed('0x59')]?JSON[_0x78ed('0x6a')](_0x4d594d['body']):_0x78ed('0x6b'));return respondWithRpcPromise('RejectMessage',_0x78ed('0x78'),_0x43f3b8);}return null;})[_0x78ed('0x23')](function(_0x30d392){if(_0x30d392){_0x30d392[_0x78ed('0x2a')][_0x78ed('0x6e')]=util[_0x78ed('0x5e')](_0x78ed('0x6f'),_0x4d594d['user'][_0x78ed('0x3b')]);_0x30d392[_0x78ed('0x2a')][_0x78ed('0x70')]=_0x43f3b8[_0x78ed('0x70')];_0x30d392[_0x78ed('0x2a')][_0x78ed('0x71')]=_0x78ed('0x36');respondWithRpcPromise(_0x78ed('0x72'),'EventManager',{'event':_0x78ed('0x79'),'message':_0x30d392['message']},client9002);return _0x43f3b8;}return null;})[_0x78ed('0x23')](respondWithResult(_0x4e96e9,null))[_0x78ed('0x2c')](handleError(_0x4e96e9,null));};exports[_0x78ed('0x7a')]=function(_0x36c9ef,_0x4934b9){var _0x88cb57;return db[_0x78ed('0x50')][_0x78ed('0x7a')](_0x36c9ef[_0x78ed('0x59')],{})['then'](function(_0x2f53fd){_0x88cb57=_0x2f53fd;return db[_0x78ed('0x61')]['findOne']({'where':{'id':_0x88cb57[_0x78ed('0x7b')]}});})[_0x78ed('0x23')](function(_0x1253d7){if(_[_0x78ed('0x64')](_0x1253d7)){return;}else{_0x88cb57[_0x78ed('0x5b')]=_0x1253d7['fax'];return db[_0x78ed('0x7c')]['findOne']({'where':{'id':_0x88cb57[_0x78ed('0x7d')]}});}})[_0x78ed('0x23')](function(_0x425dd0){return respondWithRpcPromise(_0x78ed('0x7e'),'SendFax',{'FaxAccountId':_[_0x78ed('0x64')](_0x36c9ef[_0x78ed('0x59')])?undefined:_0x36c9ef[_0x78ed('0x59')][_0x78ed('0x7f')],'path':_[_0x78ed('0x64')](_0x425dd0)?undefined:util[_0x78ed('0x5e')]('/var/opt/motion2/server/files/attachments/%s',_0x425dd0[_0x78ed('0x80')]),'fax':_['isNil'](_0x88cb57[_0x78ed('0x5b')])?undefined:_0x88cb57['fax'],'AttachmentId':_0x88cb57['AttachmentId']},client9002);})[_0x78ed('0x23')](respondWithResult(_0x4934b9,0xc9))[_0x78ed('0x2c')](handleError(_0x4934b9,null));};exports[_0x78ed('0x81')]=function(_0x2d17e5,_0x456a8e){var _0x319118=path[_0x78ed('0x82')](config[_0x78ed('0x83')],_0x78ed('0x84'),_0x78ed('0x85'),_0x78ed('0x86'));return db[_0x78ed('0x50')][_0x78ed('0x58')]({'where':{'id':_0x2d17e5[_0x78ed('0x56')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x78ed('0x23')](handleEntityNotFound(_0x456a8e,null))[_0x78ed('0x23')](function(_0x50999c){if(_0x50999c){return _0x456a8e[_0x78ed('0x81')](path[_0x78ed('0x82')](_0x319118,_0x50999c[_0x78ed('0x7c')][_0x78ed('0x80')]));}})[_0x78ed('0x2c')](handleError(_0x456a8e,null));}; \ No newline at end of file +var _0x2ba2=['html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','FaxMessage','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','show','params','rawAttributes','includeAll','include','body','find','describe','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','FaxInteraction','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','SIP/%s','event','accept','EventManager','fax-interactions','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','interface','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','root','files','attachments'];(function(_0x4db7fa,_0x5ea7f7){var _0x51761a=function(_0x2c0e7f){while(--_0x2c0e7f){_0x4db7fa['push'](_0x4db7fa['shift']());}};_0x51761a(++_0x5ea7f7);}(_0x2ba2,0x87));var _0x22ba=function(_0x4df1f5,_0x39c6d2){_0x4df1f5=_0x4df1f5-0x0;var _0x56585b=_0x2ba2[_0x4df1f5];return _0x56585b;};'use strict';var pdf=require(_0x22ba('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x22ba('0x1'));var zipdir=require(_0x22ba('0x2'));var jsonpatch=require(_0x22ba('0x3'));var rp=require(_0x22ba('0x4'));var moment=require(_0x22ba('0x5'));var BPromise=require(_0x22ba('0x6'));var Mustache=require(_0x22ba('0x7'));var util=require(_0x22ba('0x8'));var path=require(_0x22ba('0x9'));var sox=require('sox');var csv=require(_0x22ba('0xa'));var ejs=require(_0x22ba('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x22ba('0xc'));var crypto=require(_0x22ba('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x22ba('0xe'));var toCsv=require(_0x22ba('0xa'));var querystring=require(_0x22ba('0xf'));var Papa=require(_0x22ba('0x10'));var Redis=require(_0x22ba('0x11'));var authService=require(_0x22ba('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x22ba('0x13'));var hardwareService=require(_0x22ba('0x14'));var logger=require(_0x22ba('0x15'))(_0x22ba('0x16'));var utils=require(_0x22ba('0x17'));var config=require(_0x22ba('0x18'));var db=require(_0x22ba('0x19'))['db'];config[_0x22ba('0x1a')]=_[_0x22ba('0x1b')](config[_0x22ba('0x1a')],{'host':_0x22ba('0x1c'),'port':0x18eb});var socket=require(_0x22ba('0x1d'))(new Redis(config['redis']));require('./faxMessage.socket')[_0x22ba('0x1e')](socket);var jayson=require(_0x22ba('0x1f'));var client=jayson[_0x22ba('0x20')]['http']({'port':0x232c});var client9002=jayson['client'][_0x22ba('0x21')]({'port':0x232a});function checkPasswordPattern(_0x234e87,_0x50d88b,_0x2c3ef4){if(_0x2c3ef4){var _0x517cd8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x517cd8[_0x22ba('0x22')](_0x50d88b)){return _0x234e87;}else{throw new db[(_0x22ba('0x23'))][(_0x22ba('0x24'))](_0x22ba('0x25'));}}else{return _0x234e87;}}function respondWithRpcPromise(_0x35c271,_0x21eaa2,_0x30eca2,_0x549cdf){return new BPromise(function(_0x76c414,_0x5e5e8d){var _0x2fccf5=_0x549cdf||client;return _0x2fccf5[_0x22ba('0x26')](_0x35c271,_0x30eca2)[_0x22ba('0x27')](function(_0x2b6230){logger[_0x22ba('0x28')]('FaxMessage,\x20%s,\x20%s',_0x21eaa2,_0x22ba('0x29'));logger[_0x22ba('0x2a')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x21eaa2,_0x22ba('0x29'),JSON[_0x22ba('0x2b')](_0x2b6230));if(_0x2b6230['error']){if(_0x2b6230[_0x22ba('0x2c')][_0x22ba('0x2d')]===0x1f4){logger[_0x22ba('0x2c')](_0x22ba('0x2e'),_0x21eaa2,_0x2b6230[_0x22ba('0x2c')][_0x22ba('0x2f')]);return _0x5e5e8d(_0x2b6230['error']['message']);}logger[_0x22ba('0x2c')](_0x22ba('0x2e'),_0x21eaa2,_0x2b6230[_0x22ba('0x2c')][_0x22ba('0x2f')]);return _0x76c414(_0x2b6230[_0x22ba('0x2c')][_0x22ba('0x2f')]);}else{logger[_0x22ba('0x28')](_0x22ba('0x2e'),_0x21eaa2,_0x22ba('0x29'));_0x76c414(_0x2b6230[_0x22ba('0x30')]['message']);}})[_0x22ba('0x31')](function(_0x4f9bdc){logger[_0x22ba('0x2c')]('FaxMessage,\x20%s,\x20%s',_0x21eaa2,_0x4f9bdc);_0x5e5e8d(_0x4f9bdc);});});}function respondWithStatusCode(_0x3cc3dc,_0x2e9a33){_0x2e9a33=_0x2e9a33||0xcc;return function(_0x546212){if(_0x546212){return _0x3cc3dc[_0x22ba('0x32')](_0x2e9a33);}return _0x3cc3dc[_0x22ba('0x33')](_0x2e9a33)[_0x22ba('0x34')]();};}function respondWithResult(_0x2f6097,_0x3a4e03){_0x3a4e03=_0x3a4e03||0xc8;return function(_0x48273b){if(_0x48273b){return _0x2f6097[_0x22ba('0x33')](_0x3a4e03)[_0x22ba('0x35')](_0x48273b);}};}function respondWithFilteredResult(_0x5d4e33,_0x4bb828){return function(_0x623546){if(_0x623546){var _0x4af141=_0x623546[_0x22ba('0x36')],_0x40d2f4=_0x4bb828[_0x22ba('0x37')],_0x492861=_0x4bb828[_0x22ba('0x37')]+_0x4bb828[_0x22ba('0x38')],_0x198e55;if(_0x492861>=_0x4af141){_0x492861=_0x4af141;_0x198e55=0xc8;}else{_0x198e55=0xce;}_0x5d4e33['status'](_0x198e55);return _0x5d4e33[_0x22ba('0x39')](_0x22ba('0x3a'),_0x40d2f4+'-'+_0x492861+'/'+_0x4af141)[_0x22ba('0x35')](_0x623546);}return null;};}function patchUpdates(_0x4f4196){return function(_0x43a1d8){try{jsonpatch[_0x22ba('0x3b')](_0x43a1d8,_0x4f4196,!![]);}catch(_0x21c0eb){return BPromise[_0x22ba('0x3c')](_0x21c0eb);}return _0x43a1d8[_0x22ba('0x3d')]();};}function saveUpdates(_0x2e6505,_0x10b716){return function(_0x3ed9dd){if(_0x3ed9dd){return _0x3ed9dd[_0x22ba('0x3e')](_0x2e6505)['then'](function(_0x5609f4){return _0x5609f4;});}return null;};}function removeEntity(_0x314c03,_0x17fbed){return function(_0x5afaa5){if(_0x5afaa5){return _0x5afaa5[_0x22ba('0x3f')]()[_0x22ba('0x27')](function(){_0x314c03[_0x22ba('0x33')](0xcc)[_0x22ba('0x34')]();});}};}function handleEntityNotFound(_0x439753,_0x4a49a5){return function(_0x1ea855){if(!_0x1ea855){_0x439753[_0x22ba('0x32')](0x194);}return _0x1ea855;};}function handleError(_0x28cb09,_0x49f215){_0x49f215=_0x49f215||0x1f4;return function(_0x62acbf){logger[_0x22ba('0x2c')](_0x62acbf[_0x22ba('0x40')]);if(_0x62acbf[_0x22ba('0x41')]){delete _0x62acbf['name'];}_0x28cb09['status'](_0x49f215)[_0x22ba('0x42')](_0x62acbf);};}exports[_0x22ba('0x43')]=function(_0x2e80d4,_0x13f85b){var _0x2dc50d={},_0x690021={},_0x11e243={'count':0x0,'rows':[]};var _0x1e72b0=_['map'](db[_0x22ba('0x44')]['rawAttributes'],function(_0x40801b){return{'name':_0x40801b['fieldName'],'type':_0x40801b['type']['key']};});_0x690021[_0x22ba('0x45')]=_[_0x22ba('0x46')](_0x1e72b0,_0x22ba('0x41'));_0x690021[_0x22ba('0x47')]=_[_0x22ba('0x48')](_0x2e80d4[_0x22ba('0x47')]);_0x690021[_0x22ba('0x49')]=_['intersection'](_0x690021[_0x22ba('0x45')],_0x690021[_0x22ba('0x47')]);_0x2dc50d[_0x22ba('0x4a')]=_[_0x22ba('0x4b')](_0x690021[_0x22ba('0x45')],qs[_0x22ba('0x4c')](_0x2e80d4[_0x22ba('0x47')][_0x22ba('0x4c')]));_0x2dc50d['attributes']=_0x2dc50d[_0x22ba('0x4a')][_0x22ba('0x4d')]?_0x2dc50d[_0x22ba('0x4a')]:_0x690021['model'];if(!_0x2e80d4[_0x22ba('0x47')]['hasOwnProperty']('nolimit')){_0x2dc50d[_0x22ba('0x38')]=qs[_0x22ba('0x38')](_0x2e80d4[_0x22ba('0x47')][_0x22ba('0x38')]);_0x2dc50d[_0x22ba('0x37')]=qs['offset'](_0x2e80d4['query'][_0x22ba('0x37')]);}_0x2dc50d[_0x22ba('0x4e')]=qs['sort'](_0x2e80d4[_0x22ba('0x47')][_0x22ba('0x4f')]);_0x2dc50d[_0x22ba('0x50')]=qs[_0x22ba('0x49')](_['pick'](_0x2e80d4[_0x22ba('0x47')],_0x690021[_0x22ba('0x49')]),_0x1e72b0);if(_0x2e80d4[_0x22ba('0x47')][_0x22ba('0x51')]){_0x2dc50d[_0x22ba('0x50')]=_[_0x22ba('0x52')](_0x2dc50d[_0x22ba('0x50')],{'$or':_[_0x22ba('0x46')](_0x1e72b0,function(_0x4d818a){if(_0x4d818a[_0x22ba('0x53')]!==_0x22ba('0x54')){var _0x5132a7={};_0x5132a7[_0x4d818a[_0x22ba('0x41')]]={'$like':'%'+_0x2e80d4['query'][_0x22ba('0x51')]+'%'};return _0x5132a7;}})});}_0x2dc50d=_['merge']({},_0x2dc50d,_0x2e80d4[_0x22ba('0x55')]);var _0x14c2b9={'where':_0x2dc50d[_0x22ba('0x50')]};return db[_0x22ba('0x44')][_0x22ba('0x36')](_0x14c2b9)[_0x22ba('0x27')](function(_0x46e47f){_0x11e243[_0x22ba('0x36')]=_0x46e47f;if(_0x2e80d4[_0x22ba('0x47')]['includeAll']){_0x2dc50d['include']=[{'all':!![]}];}return db[_0x22ba('0x44')][_0x22ba('0x56')](_0x2dc50d);})['then'](function(_0x5ccf96){_0x11e243[_0x22ba('0x57')]=_0x5ccf96;return _0x11e243;})[_0x22ba('0x27')](respondWithFilteredResult(_0x13f85b,_0x2dc50d))[_0x22ba('0x31')](handleError(_0x13f85b,null));};exports[_0x22ba('0x58')]=function(_0x2def99,_0x4f1091){var _0x4088a9={'raw':!![],'where':{'id':_0x2def99[_0x22ba('0x59')]['id']}},_0x45034a={};_0x45034a['model']=_['keys'](db[_0x22ba('0x44')][_0x22ba('0x5a')]);_0x45034a[_0x22ba('0x47')]=_['keys'](_0x2def99[_0x22ba('0x47')]);_0x45034a[_0x22ba('0x49')]=_['intersection'](_0x45034a['model'],_0x45034a[_0x22ba('0x47')]);_0x4088a9[_0x22ba('0x4a')]=_['intersection'](_0x45034a[_0x22ba('0x45')],qs[_0x22ba('0x4c')](_0x2def99['query']['fields']));_0x4088a9[_0x22ba('0x4a')]=_0x4088a9[_0x22ba('0x4a')][_0x22ba('0x4d')]?_0x4088a9[_0x22ba('0x4a')]:_0x45034a[_0x22ba('0x45')];if(_0x2def99['query'][_0x22ba('0x5b')]){_0x4088a9[_0x22ba('0x5c')]=[{'all':!![]}];}_0x4088a9=_[_0x22ba('0x52')]({},_0x4088a9,_0x2def99[_0x22ba('0x55')]);return db[_0x22ba('0x44')]['find'](_0x4088a9)[_0x22ba('0x27')](handleEntityNotFound(_0x4f1091,null))[_0x22ba('0x27')](respondWithResult(_0x4f1091,null))[_0x22ba('0x31')](handleError(_0x4f1091,null));};exports[_0x22ba('0x3e')]=function(_0x38aca5,_0x431735){if(_0x38aca5[_0x22ba('0x5d')]['id']){delete _0x38aca5[_0x22ba('0x5d')]['id'];}return db[_0x22ba('0x44')][_0x22ba('0x5e')]({'where':{'id':_0x38aca5[_0x22ba('0x59')]['id']}})[_0x22ba('0x27')](handleEntityNotFound(_0x431735,null))['then'](saveUpdates(_0x38aca5[_0x22ba('0x5d')],null))[_0x22ba('0x27')](respondWithResult(_0x431735,null))[_0x22ba('0x31')](handleError(_0x431735,null));};exports['destroy']=function(_0x344232,_0x26b718){return db[_0x22ba('0x44')][_0x22ba('0x5e')]({'where':{'id':_0x344232[_0x22ba('0x59')]['id']}})[_0x22ba('0x27')](handleEntityNotFound(_0x26b718,null))['then'](removeEntity(_0x26b718,null))[_0x22ba('0x31')](handleError(_0x26b718,null));};exports[_0x22ba('0x5f')]=function(_0x17af68,_0x23b038){return db[_0x22ba('0x44')][_0x22ba('0x5f')]()['then'](respondWithResult(_0x23b038,null))[_0x22ba('0x31')](handleError(_0x23b038,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports['accept']=function(_0xfd5f0e,_0x435cae,_0x13c76d){var _0x16f290={'channel':_0x22ba('0x60')};if(_0xfd5f0e[_0x22ba('0x5d')]['id']){delete _0xfd5f0e[_0x22ba('0x5d')]['id'];}_0xfd5f0e[_0x22ba('0x5d')][_0x22ba('0x61')]=!![];_0xfd5f0e[_0x22ba('0x5d')][_0x22ba('0x62')]=moment()[_0x22ba('0x63')](_0x22ba('0x64'));_0xfd5f0e[_0x22ba('0x5d')]['UserId']=_0xfd5f0e[_0x22ba('0x5d')][_0x22ba('0x65')]||_0xfd5f0e[_0x22ba('0x66')]['id'];return db['FaxMessage'][_0x22ba('0x5e')]({'where':{'id':_0xfd5f0e[_0x22ba('0x59')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x22ba('0x67')}]})[_0x22ba('0x27')](handleEntityNotFound(_0x435cae,null))[_0x22ba('0x27')](saveUpdates(_0xfd5f0e[_0x22ba('0x5d')],null))['then'](function(_0x1e6cfa){if(_0x1e6cfa){_0x16f290[_0x22ba('0x2f')]=_0x1e6cfa[_0x22ba('0x68')]({'plain':!![]});return db[_0x22ba('0x69')]['find']({'where':{'id':_0x1e6cfa['FaxInteractionId']}});}return null;})[_0x22ba('0x27')](handleEntityNotFound(_0x435cae,null))[_0x22ba('0x27')](function(_0x517517){if(_0x517517){return _0x517517[_0x22ba('0x3e')]({'UserId':_0xfd5f0e[_0x22ba('0x5d')][_0x22ba('0x65')],'read1stAt':_[_0x22ba('0x6a')](_0x517517['read1stAt'])?moment()['format'](_0x22ba('0x64')):undefined});}return null;})[_0x22ba('0x27')](function(_0x5ad71d){if(_0x5ad71d){_0x16f290[_0x22ba('0x6b')]=_0x5ad71d[_0x22ba('0x68')]({'plain':!![]});interaction_log[_0x22ba('0x28')](_0x22ba('0x6c'),_0xfd5f0e['user']['id'],_0xfd5f0e[_0x22ba('0x66')][_0x22ba('0x41')],_0xfd5f0e[_0x22ba('0x66')][_0x22ba('0x6d')],_0x16f290['interaction']['id'],_0xfd5f0e[_0x22ba('0x5d')]?JSON['stringify'](_0xfd5f0e[_0x22ba('0x5d')]):_0x22ba('0x6e'));return respondWithRpcPromise('AcceptMessage',_0x22ba('0x6f'),_0x16f290);}return null;})[_0x22ba('0x27')](function(_0x3fcf69){if(_0x3fcf69){if(_0xfd5f0e[_0x22ba('0x5d')][_0x22ba('0x70')]){_0x16f290[_0x22ba('0x2f')]['interface']=util[_0x22ba('0x63')](_0x22ba('0x71'),_0xfd5f0e[_0x22ba('0x66')][_0x22ba('0x41')]);_0x16f290[_0x22ba('0x2f')]['channel']=_0x16f290['channel'];_0x16f290[_0x22ba('0x2f')][_0x22ba('0x72')]=_0x22ba('0x73');return respondWithRpcPromise(_0x22ba('0x74'),'EventManager',{'event':'acceptmessage','message':_0x16f290['message']},client9002)[_0x22ba('0x27')](function(){return _0x16f290;});}return _0x16f290;}return null;})[_0x22ba('0x27')](respondWithResult(_0x435cae,null))[_0x22ba('0x31')](handleError(_0x435cae,null));};var interaction_log=require(_0x22ba('0x15'))(_0x22ba('0x75'));exports[_0x22ba('0x3c')]=function(_0x439e9b,_0x10d0d9,_0x2fd9d7){var _0x5033a6={'agent':{},'channel':'fax'};if(_0x439e9b['body']['id']){delete _0x439e9b['body']['id'];}_0x439e9b[_0x22ba('0x5d')]['UserId']=_0x439e9b[_0x22ba('0x5d')]['UserId']||_0x439e9b[_0x22ba('0x66')]['id'];_0x5033a6[_0x22ba('0x76')]['id']=_0x439e9b[_0x22ba('0x5d')][_0x22ba('0x65')];return db['FaxMessage']['find']({'where':{'id':_0x439e9b[_0x22ba('0x59')]['id'],'UserId':null}})[_0x22ba('0x27')](handleEntityNotFound(_0x10d0d9,null))[_0x22ba('0x27')](function(_0x175e4e){if(_0x175e4e){_0x5033a6[_0x22ba('0x2f')]=_0x175e4e[_0x22ba('0x68')]({'plain':!![]});return db[_0x22ba('0x69')][_0x22ba('0x5e')]({'where':{'id':_0x175e4e[_0x22ba('0x77')]}});}return null;})['then'](handleEntityNotFound(_0x10d0d9,null))[_0x22ba('0x27')](function(_0x48b5c8){if(_0x48b5c8){_0x5033a6[_0x22ba('0x6b')]=_0x48b5c8[_0x22ba('0x68')]({'plain':!![]});interaction_log['info'](_0x22ba('0x78'),_0x439e9b[_0x22ba('0x66')]['id'],_0x439e9b[_0x22ba('0x66')][_0x22ba('0x41')],_0x439e9b[_0x22ba('0x66')][_0x22ba('0x6d')],_0x5033a6[_0x22ba('0x6b')]['id'],_0x439e9b[_0x22ba('0x5d')]?JSON[_0x22ba('0x2b')](_0x439e9b[_0x22ba('0x5d')]):_0x22ba('0x6e'));return respondWithRpcPromise(_0x22ba('0x79'),'rejectMessage',_0x5033a6);}return null;})['then'](function(_0x104bcd){if(_0x104bcd){_0x104bcd['message'][_0x22ba('0x7a')]=util[_0x22ba('0x63')]('SIP/%s',_0x439e9b['user'][_0x22ba('0x41')]);_0x104bcd[_0x22ba('0x2f')]['channel']=_0x5033a6['channel'];_0x104bcd['message']['event']=_0x22ba('0x3c');respondWithRpcPromise(_0x22ba('0x74'),'EventManager',{'event':_0x22ba('0x7b'),'message':_0x104bcd['message']},client9002);return _0x5033a6;}return null;})['then'](respondWithResult(_0x10d0d9,null))['catch'](handleError(_0x10d0d9,null));};exports[_0x22ba('0x7c')]=function(_0x35f0d3,_0x5409c7){var _0x542a3b;return db[_0x22ba('0x44')]['create'](_0x35f0d3[_0x22ba('0x5d')],{})['then'](function(_0x40bfae){_0x542a3b=_0x40bfae;return db['CmContact'][_0x22ba('0x7d')]({'where':{'id':_0x542a3b['ContactId']}});})[_0x22ba('0x27')](function(_0x20c02a){if(_['isNil'](_0x20c02a)){return;}else{_0x542a3b[_0x22ba('0x60')]=_0x20c02a[_0x22ba('0x60')];return db[_0x22ba('0x7e')][_0x22ba('0x7d')]({'where':{'id':_0x542a3b[_0x22ba('0x7f')]}});}})[_0x22ba('0x27')](function(_0x28d3ea){return respondWithRpcPromise('SendFax',_0x22ba('0x80'),{'FaxAccountId':_[_0x22ba('0x6a')](_0x35f0d3[_0x22ba('0x5d')])?undefined:_0x35f0d3[_0x22ba('0x5d')][_0x22ba('0x81')],'path':_[_0x22ba('0x6a')](_0x28d3ea)?undefined:util[_0x22ba('0x63')](_0x22ba('0x82'),_0x28d3ea['basename']),'fax':_['isNil'](_0x542a3b['fax'])?undefined:_0x542a3b[_0x22ba('0x60')],'AttachmentId':_0x542a3b['AttachmentId']},client9002);})[_0x22ba('0x27')](respondWithResult(_0x5409c7,0xc9))['catch'](handleError(_0x5409c7,null));};exports[_0x22ba('0x83')]=function(_0x51bedd,_0x43faea){var _0x12acf1=path['join'](config[_0x22ba('0x84')],'server',_0x22ba('0x85'),_0x22ba('0x86'));return db[_0x22ba('0x44')][_0x22ba('0x5e')]({'where':{'id':_0x51bedd[_0x22ba('0x59')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x22ba('0x27')](handleEntityNotFound(_0x43faea,null))['then'](function(_0xe7a8c3){if(_0xe7a8c3){return _0x43faea['download'](path['join'](_0x12acf1,_0xe7a8c3[_0x22ba('0x7e')]['basename']));}})[_0x22ba('0x31')](handleError(_0x43faea,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index b974124..31044a1 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 _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage'];(function(_0x10418d,_0x5a6967){var _0x20c6d3=function(_0x5b1b91){while(--_0x5b1b91){_0x10418d['push'](_0x10418d['shift']());}};_0x20c6d3(++_0x5a6967);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require(_0x7995('0x0'));var FaxMessage=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){FaxMessageEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);FaxMessageEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];FaxMessage[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x596a18,_0x5e5499){var _0x2bbb73=function(_0x32d76e){while(--_0x32d76e){_0x596a18['push'](_0x596a18['shift']());}};_0x2bbb73(++_0x5e5499);}(_0x008c,0x188));var _0xc008=function(_0x4252fb,_0x2875b6){_0x4252fb=_0x4252fb-0x0;var _0x40b2ae=_0x008c[_0x4252fb];return _0x40b2ae;};'use strict';var EventEmitter=require(_0xc008('0x0'));var FaxMessage=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){FaxMessageEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);FaxMessageEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];FaxMessage[_0xc008('0x8')](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 a8a5399..32963ed 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 _0x8298=['define','FaxMessage','fti_fax_messages','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports'];(function(_0xe4bb3d,_0x21e87e){var _0xd9e51=function(_0x1f732b){while(--_0x1f732b){_0xe4bb3d['push'](_0xe4bb3d['shift']());}};_0xd9e51(++_0x21e87e);}(_0x8298,0x114));var _0x8829=function(_0x48a984,_0x332ee9){_0x48a984=_0x48a984-0x0;var _0x2b310b=_0x8298[_0x48a984];return _0x2b310b;};'use strict';var _=require(_0x8829('0x0'));var util=require('util');var logger=require(_0x8829('0x1'))('api');var moment=require(_0x8829('0x2'));var BPromise=require(_0x8829('0x3'));var rp=require(_0x8829('0x4'));var fs=require('fs');var path=require(_0x8829('0x5'));var rimraf=require(_0x8829('0x6'));var config=require(_0x8829('0x7'));var attributes=require(_0x8829('0x8'));module[_0x8829('0x9')]=function(_0x16c3e9,_0x53494b){return _0x16c3e9[_0x8829('0xa')](_0x8829('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x8829('0xc'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x42396c,_0x4f91b6,_0x2e0924){var _0x4b3f7e=_0x16c3e9[_0x8829('0xd')];var _0x2738af=_0x42396c[_0x8829('0xe')]({'plain':!![]});if(_0x2738af[_0x8829('0xf')]['toLowerCase']()==='in'||_0x2738af[_0x8829('0xf')][_0x8829('0x10')]()===_0x8829('0x11')&&!_0x2738af[_0x8829('0x12')]&&!_[_0x8829('0x13')](_0x2738af[_0x8829('0x14')])){_0x4b3f7e['FaxInteraction'][_0x8829('0x15')]({'where':{'id':_0x2738af['FaxInteractionId']}})[_0x8829('0x16')](function(_0x3d8709){if(_0x3d8709){_0x3d8709['update']({'lastMsgAt':_0x2738af['createdAt'],'lastMsgDirection':_0x2738af[_0x8829('0xf')]['toLowerCase']()});}})[_0x8829('0x17')](function(_0xad366b){console[_0x8829('0x18')](_0xad366b);});}_0x2e0924();}},'charset':'utf8mb4','collate':_0x8829('0x19')});}; \ No newline at end of file +var _0x9a5a=['api','moment','bluebird','request-promise','path','./faxMessage.attributes','exports','fax_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','catch','error','lodash','../../config/logger'];(function(_0x49f30d,_0x50300a){var _0x2c75fa=function(_0x3a880a){while(--_0x3a880a){_0x49f30d['push'](_0x49f30d['shift']());}};_0x2c75fa(++_0x50300a);}(_0x9a5a,0x14e));var _0xa9a5=function(_0x6be150,_0x31dfcc){_0x6be150=_0x6be150-0x0;var _0x5dd4f3=_0x9a5a[_0x6be150];return _0x5dd4f3;};'use strict';var _=require(_0xa9a5('0x0'));var util=require('util');var logger=require(_0xa9a5('0x1'))(_0xa9a5('0x2'));var moment=require(_0xa9a5('0x3'));var BPromise=require(_0xa9a5('0x4'));var rp=require(_0xa9a5('0x5'));var fs=require('fs');var path=require(_0xa9a5('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa9a5('0x7'));module[_0xa9a5('0x8')]=function(_0x5c152f,_0x3e4651){return _0x5c152f['define']('FaxMessage',attributes,{'tableName':_0xa9a5('0x9'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xa9a5('0xa')],'type':_0xa9a5('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b42d9,_0x412bbc,_0x151345){var _0x59e416=_0x5c152f['models'];var _0x3c2266=_0x3b42d9['get']({'plain':!![]});if(_0x3c2266[_0xa9a5('0xc')][_0xa9a5('0xd')]()==='in'||_0x3c2266[_0xa9a5('0xc')]['toLowerCase']()===_0xa9a5('0xe')&&!_0x3c2266[_0xa9a5('0xf')]&&!_[_0xa9a5('0x10')](_0x3c2266[_0xa9a5('0x11')])){_0x59e416[_0xa9a5('0x12')]['findOne']({'where':{'id':_0x3c2266[_0xa9a5('0x13')]}})[_0xa9a5('0x14')](function(_0x13e2ee){if(_0x13e2ee){_0x13e2ee[_0xa9a5('0x15')]({'lastMsgAt':_0x3c2266['createdAt'],'lastMsgDirection':_0x3c2266[_0xa9a5('0xc')][_0xa9a5('0xd')]()});}})[_0xa9a5('0x16')](function(_0x51979a){console[_0xa9a5('0x17')](_0x51979a);});}_0x151345();}},'charset':'utf8mb4','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 fdc40bb..787e161 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 _0xfdc1=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','attributes','limit','lodash'];(function(_0x5e48bf,_0x497646){var _0x170eaa=function(_0x260909){while(--_0x260909){_0x5e48bf['push'](_0x5e48bf['shift']());}};_0x170eaa(++_0x497646);}(_0xfdc1,0x71));var _0x1fdc=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0xfdc1[_0x5d7227];return _0x15ac55;};'use strict';var _=require(_0x1fdc('0x0'));var util=require('util');var moment=require(_0x1fdc('0x1'));var BPromise=require(_0x1fdc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1fdc('0x3'))['db'];var utils=require(_0x1fdc('0x4'));var logger=require(_0x1fdc('0x5'))(_0x1fdc('0x6'));var config=require(_0x1fdc('0x7'));var jayson=require(_0x1fdc('0x8'));var client=jayson[_0x1fdc('0x9')]['http']({'port':0x232a});config[_0x1fdc('0xa')]=_['defaults'](config['redis'],{'host':_0x1fdc('0xb'),'port':0x18eb});var socket=require(_0x1fdc('0xc'))(new Redis(config['redis']));require(_0x1fdc('0xd'))[_0x1fdc('0xe')](socket);function respondWithRpcPromise(_0x505c91,_0x20047e,_0x193419){return new BPromise(function(_0x246064,_0xf2ce83){return client[_0x1fdc('0xf')](_0x505c91,_0x193419)[_0x1fdc('0x10')](function(_0x36253a){logger[_0x1fdc('0x11')](_0x1fdc('0x12'),_0x20047e,_0x1fdc('0x13'));logger[_0x1fdc('0x14')](_0x1fdc('0x15'),_0x20047e,_0x1fdc('0x13'),JSON[_0x1fdc('0x16')](_0x36253a));if(_0x36253a['error']){if(_0x36253a[_0x1fdc('0x17')][_0x1fdc('0x18')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x20047e,_0x36253a[_0x1fdc('0x17')][_0x1fdc('0x19')]);return _0xf2ce83(_0x36253a[_0x1fdc('0x17')][_0x1fdc('0x19')]);}logger[_0x1fdc('0x17')](_0x1fdc('0x12'),_0x20047e,_0x36253a[_0x1fdc('0x17')][_0x1fdc('0x19')]);return _0x246064(_0x36253a[_0x1fdc('0x17')]['message']);}else{logger[_0x1fdc('0x11')](_0x1fdc('0x12'),_0x20047e,_0x1fdc('0x13'));_0x246064(_0x36253a[_0x1fdc('0x1a')][_0x1fdc('0x19')]);}})[_0x1fdc('0x1b')](function(_0x28897f){logger[_0x1fdc('0x17')](_0x1fdc('0x12'),_0x20047e,_0x28897f);_0xf2ce83(_0x28897f);});});}exports[_0x1fdc('0x1c')]=function(_0x327aba){var _0x1ec059=this;return new Promise(function(_0x17182d,_0x2cf343){return db[_0x1fdc('0x1d')][_0x1fdc('0x1e')](_0x327aba[_0x1fdc('0x1f')],{'raw':_0x327aba[_0x1fdc('0x20')]?_0x327aba['options'][_0x1fdc('0x21')]===undefined?!![]:![]:!![]})[_0x1fdc('0x10')](function(_0x2a2a41){logger[_0x1fdc('0x11')]('CreateFaxMessage',_0x327aba);logger['debug']('CreateFaxMessage',_0x327aba,JSON[_0x1fdc('0x16')](_0x2a2a41));_0x17182d(_0x2a2a41);})[_0x1fdc('0x1b')](function(_0x4e6fc7){logger['error']('CreateFaxMessage',_0x4e6fc7['message'],_0x327aba);_0x2cf343(_0x1ec059['error'](0x1f4,_0x4e6fc7[_0x1fdc('0x19')]));});});};exports[_0x1fdc('0x22')]=function(_0x36749a){var _0x210865=this;return new Promise(function(_0x36c8ea,_0x15b197){return db[_0x1fdc('0x1d')][_0x1fdc('0x23')](_0x36749a[_0x1fdc('0x1f')],{'raw':_0x36749a[_0x1fdc('0x20')]?_0x36749a[_0x1fdc('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36749a[_0x1fdc('0x20')]?_0x36749a['options']['where']||null:null,'attributes':_0x36749a[_0x1fdc('0x20')]?_0x36749a['options'][_0x1fdc('0x24')]||null:null,'limit':_0x36749a[_0x1fdc('0x20')]?_0x36749a[_0x1fdc('0x20')][_0x1fdc('0x25')]||null:null})[_0x1fdc('0x10')](function(_0x52ab33){logger[_0x1fdc('0x11')](_0x1fdc('0x22'),_0x36749a);logger['debug']('UpdateFaxMessage',_0x36749a,JSON[_0x1fdc('0x16')](_0x52ab33));_0x36c8ea(_0x52ab33);})['catch'](function(_0x31497b){logger['error'](_0x1fdc('0x22'),_0x31497b[_0x1fdc('0x19')],_0x36749a);_0x15b197(_0x210865[_0x1fdc('0x17')](0x1f4,_0x31497b['message']));});});}; \ No newline at end of file +var _0x9b8c=['randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateFaxMessage','FaxMessage','create','body','options','raw','catch','UpdateFaxMessage','where','attributes','limit','lodash','util','moment'];(function(_0x2f4d5a,_0x3b9bb2){var _0x2c4bc2=function(_0x22c5ed){while(--_0x22c5ed){_0x2f4d5a['push'](_0x2f4d5a['shift']());}};_0x2c4bc2(++_0x3b9bb2);}(_0x9b8c,0x16f));var _0xc9b8=function(_0x1e175d,_0x41ff45){_0x1e175d=_0x1e175d-0x0;var _0x3a3ce5=_0x9b8c[_0x1e175d];return _0x3a3ce5;};'use strict';var _=require(_0xc9b8('0x0'));var util=require(_0xc9b8('0x1'));var moment=require(_0xc9b8('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9b8('0x3'));var fs=require('fs');var Redis=require(_0xc9b8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9b8('0x5'));var logger=require('../../config/logger')(_0xc9b8('0x6'));var config=require('../../config/environment');var jayson=require(_0xc9b8('0x7'));var client=jayson[_0xc9b8('0x8')]['http']({'port':0x232a});config[_0xc9b8('0x9')]=_[_0xc9b8('0xa')](config['redis'],{'host':_0xc9b8('0xb'),'port':0x18eb});var socket=require(_0xc9b8('0xc'))(new Redis(config[_0xc9b8('0x9')]));require('./faxMessage.socket')[_0xc9b8('0xd')](socket);function respondWithRpcPromise(_0x1325bf,_0x1f522c,_0x3c821f){return new BPromise(function(_0x22d0c5,_0x28d26d){return client[_0xc9b8('0xe')](_0x1325bf,_0x3c821f)[_0xc9b8('0xf')](function(_0x36894d){logger[_0xc9b8('0x10')](_0xc9b8('0x11'),_0x1f522c,_0xc9b8('0x12'));logger[_0xc9b8('0x13')](_0xc9b8('0x14'),_0x1f522c,'request\x20sent',JSON[_0xc9b8('0x15')](_0x36894d));if(_0x36894d[_0xc9b8('0x16')]){if(_0x36894d[_0xc9b8('0x16')][_0xc9b8('0x17')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1f522c,_0x36894d[_0xc9b8('0x16')]['message']);return _0x28d26d(_0x36894d[_0xc9b8('0x16')][_0xc9b8('0x18')]);}logger[_0xc9b8('0x16')](_0xc9b8('0x11'),_0x1f522c,_0x36894d[_0xc9b8('0x16')][_0xc9b8('0x18')]);return _0x22d0c5(_0x36894d[_0xc9b8('0x16')][_0xc9b8('0x18')]);}else{logger[_0xc9b8('0x10')](_0xc9b8('0x11'),_0x1f522c,_0xc9b8('0x12'));_0x22d0c5(_0x36894d[_0xc9b8('0x19')]['message']);}})['catch'](function(_0x50b593){logger[_0xc9b8('0x16')]('FaxMessage,\x20%s,\x20%s',_0x1f522c,_0x50b593);_0x28d26d(_0x50b593);});});}exports[_0xc9b8('0x1a')]=function(_0x460a81){var _0x3968d2=this;return new Promise(function(_0x22835c,_0x22be24){return db[_0xc9b8('0x1b')][_0xc9b8('0x1c')](_0x460a81[_0xc9b8('0x1d')],{'raw':_0x460a81[_0xc9b8('0x1e')]?_0x460a81['options'][_0xc9b8('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x229a84){logger[_0xc9b8('0x10')](_0xc9b8('0x1a'),_0x460a81);logger['debug'](_0xc9b8('0x1a'),_0x460a81,JSON[_0xc9b8('0x15')](_0x229a84));_0x22835c(_0x229a84);})[_0xc9b8('0x20')](function(_0x5cd0d2){logger['error'](_0xc9b8('0x1a'),_0x5cd0d2['message'],_0x460a81);_0x22be24(_0x3968d2[_0xc9b8('0x16')](0x1f4,_0x5cd0d2[_0xc9b8('0x18')]));});});};exports[_0xc9b8('0x21')]=function(_0x1e8d11){var _0x2d318b=this;return new Promise(function(_0x4723d8,_0x37d9f8){return db[_0xc9b8('0x1b')]['update'](_0x1e8d11['body'],{'raw':_0x1e8d11[_0xc9b8('0x1e')]?_0x1e8d11[_0xc9b8('0x1e')][_0xc9b8('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e8d11[_0xc9b8('0x1e')]?_0x1e8d11['options'][_0xc9b8('0x22')]||null:null,'attributes':_0x1e8d11['options']?_0x1e8d11[_0xc9b8('0x1e')][_0xc9b8('0x23')]||null:null,'limit':_0x1e8d11[_0xc9b8('0x1e')]?_0x1e8d11['options'][_0xc9b8('0x24')]||null:null})[_0xc9b8('0xf')](function(_0x456dec){logger[_0xc9b8('0x10')](_0xc9b8('0x21'),_0x1e8d11);logger[_0xc9b8('0x13')]('UpdateFaxMessage',_0x1e8d11,JSON['stringify'](_0x456dec));_0x4723d8(_0x456dec);})['catch'](function(_0x4f394e){logger[_0xc9b8('0x16')](_0xc9b8('0x21'),_0x4f394e['message'],_0x1e8d11);_0x37d9f8(_0x2d318b[_0xc9b8('0x16')](0x1f4,_0x4f394e[_0xc9b8('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 1aeff26..1ce72e6 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 _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x1a1b6e,_0x3a07a9){var _0x571e2c=function(_0x6cea62){while(--_0x6cea62){_0x1a1b6e['push'](_0x1a1b6e['shift']());}};_0x571e2c(++_0x3a07a9);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file +var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0xdeac17,_0x19ad66){var _0x33aabd=function(_0x558a9e){while(--_0x558a9e){_0xdeac17['push'](_0xdeac17['shift']());}};_0x33aabd(++_0x19ad66);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index d763a5b..6289987 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 _0xd6ef=['create','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','download','post','tracked','fax'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd6ef,0xfb));var _0xfd6e=function(_0x5db04e,_0x2f7fbd){_0x5db04e=_0x5db04e-0x0;var _0x5b5dcb=_0xd6ef[_0x5db04e];return _0x5b5dcb;};'use strict';var multer=require(_0xfd6e('0x0'));var util=require(_0xfd6e('0x1'));var path=require('path');var timeout=require(_0xfd6e('0x2'));var express=require(_0xfd6e('0x3'));var router=express[_0xfd6e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xfd6e('0x5'));var config=require(_0xfd6e('0x6'));var controller=require(_0xfd6e('0x7'));router[_0xfd6e('0x8')]('/',auth[_0xfd6e('0x9')](),controller[_0xfd6e('0xa')]);router[_0xfd6e('0x8')](_0xfd6e('0xb'),auth[_0xfd6e('0x9')](),controller[_0xfd6e('0xc')]);router[_0xfd6e('0x8')](_0xfd6e('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0xfd6e('0xe'),auth[_0xfd6e('0x9')](),controller[_0xfd6e('0xf')]);router[_0xfd6e('0x10')]('/',auth[_0xfd6e('0x9')](),interaction[_0xfd6e('0x11')](_0xfd6e('0x12'),'faxmessage:create'),controller[_0xfd6e('0x13')]);router['put'](_0xfd6e('0xd'),auth[_0xfd6e('0x9')](),controller['update']);router[_0xfd6e('0x14')](_0xfd6e('0x15'),auth[_0xfd6e('0x9')](),controller[_0xfd6e('0x16')]);router['put']('/:id/reject',auth[_0xfd6e('0x9')](),controller[_0xfd6e('0x17')]);router[_0xfd6e('0x18')](_0xfd6e('0xd'),auth[_0xfd6e('0x9')](),controller[_0xfd6e('0x19')]);module[_0xfd6e('0x1a')]=router; \ No newline at end of file +var _0x400d=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','connect-timeout'];(function(_0x34a47b,_0x109857){var _0x3bd3d7=function(_0x30e79a){while(--_0x30e79a){_0x34a47b['push'](_0x34a47b['shift']());}};_0x3bd3d7(++_0x109857);}(_0x400d,0x80));var _0xd400=function(_0x1a127a,_0x42f6e6){_0x1a127a=_0x1a127a-0x0;var _0x2a724b=_0x400d[_0x1a127a];return _0x2a724b;};'use strict';var multer=require('multer');var util=require(_0xd400('0x0'));var path=require('path');var timeout=require(_0xd400('0x1'));var express=require(_0xd400('0x2'));var router=express['Router']();var auth=require(_0xd400('0x3'));var interaction=require(_0xd400('0x4'));var config=require(_0xd400('0x5'));var controller=require(_0xd400('0x6'));router[_0xd400('0x7')]('/',auth[_0xd400('0x8')](),controller[_0xd400('0x9')]);router['get'](_0xd400('0xa'),auth[_0xd400('0x8')](),controller['describe']);router[_0xd400('0x7')](_0xd400('0xb'),auth[_0xd400('0x8')](),controller[_0xd400('0xc')]);router[_0xd400('0x7')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xd400('0xd')]('/',auth[_0xd400('0x8')](),interaction[_0xd400('0xe')](_0xd400('0xf'),'faxmessage:create'),controller[_0xd400('0x10')]);router[_0xd400('0x11')](_0xd400('0xb'),auth[_0xd400('0x8')](),controller[_0xd400('0x12')]);router[_0xd400('0x11')](_0xd400('0x13'),auth[_0xd400('0x8')](),controller[_0xd400('0x14')]);router['put'](_0xd400('0x15'),auth[_0xd400('0x8')](),controller[_0xd400('0x16')]);router[_0xd400('0x17')](_0xd400('0xb'),auth['isAuthenticated'](),controller[_0xd400('0x18')]);module[_0xd400('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index ea066ee..23152c1 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 _0xa473=['sequelize','exports','name','STRING','ENUM','rrmemory','beepall','roundrobin','INTEGER'];(function(_0x26b85a,_0x4192ff){var _0x2b7832=function(_0x22604c){while(--_0x22604c){_0x26b85a['push'](_0x26b85a['shift']());}};_0x2b7832(++_0x4192ff);}(_0xa473,0x1cb));var _0x3a47=function(_0x178ddf,_0x425334){_0x178ddf=_0x178ddf-0x0;var _0x4d785d=_0xa473[_0x178ddf];return _0x4d785d;};'use strict';var Sequelize=require(_0x3a47('0x0'));module[_0x3a47('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3a47('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3a47('0x3')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3a47('0x4')](_0x3a47('0x5'),_0x3a47('0x6'),_0x3a47('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x3a47('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0xff6e=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x5659c0,_0x5f2532){var _0x36e3c0=function(_0x247a5f){while(--_0x247a5f){_0x5659c0['push'](_0x5659c0['shift']());}};_0x36e3c0(++_0x5f2532);}(_0xff6e,0x179));var _0xeff6=function(_0x7b5cdd,_0x8c88d8){_0x7b5cdd=_0x7b5cdd-0x0;var _0x3a29ae=_0xff6e[_0x7b5cdd];return _0x3a29ae;};'use strict';var Sequelize=require(_0xeff6('0x0'));module[_0xeff6('0x1')]={'name':{'type':Sequelize[_0xeff6('0x2')],'unique':_0xeff6('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeff6('0x2')]},'timeout':{'type':Sequelize[_0xeff6('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeff6('0x5')](_0xeff6('0x6'),_0xeff6('0x7'),_0xeff6('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xeff6('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 50817c0..f538092 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 _0x26b0=['voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','userFaxQueue:save','removeTeams','select','field','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','includes','union','compact','value','transaction','isEmpty','removeAgents','emit','userFaxQueue:remove','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','count','limit','set','Content-Range','json','apply','save','update','destroy','then','UserProfileResource','end','error','stack','name','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserFaxQueue','FaxQueueId','map','findAndCountAll','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','getTeams','ids','User','Agents','online'];(function(_0x22a8c4,_0x51c09a){var _0x104c6d=function(_0x4d4d3d){while(--_0x4d4d3d){_0x22a8c4['push'](_0x22a8c4['shift']());}};_0x104c6d(++_0x51c09a);}(_0x26b0,0x138));var _0x026b=function(_0x426711,_0x12264c){_0x426711=_0x426711-0x0;var _0x592991=_0x26b0[_0x426711];return _0x592991;};'use strict';var pdf=require(_0x026b('0x0'));var emlformat=require(_0x026b('0x1'));var rimraf=require(_0x026b('0x2'));var zipdir=require(_0x026b('0x3'));var jsonpatch=require(_0x026b('0x4'));var rp=require(_0x026b('0x5'));var moment=require('moment');var BPromise=require(_0x026b('0x6'));var Mustache=require(_0x026b('0x7'));var util=require(_0x026b('0x8'));var path=require(_0x026b('0x9'));var sox=require(_0x026b('0xa'));var csv=require('to-csv');var ejs=require(_0x026b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x026b('0xc'));var deskjs=require(_0x026b('0xd'));var toCsv=require(_0x026b('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x026b('0xf'));var authService=require(_0x026b('0x10'));var qs=require(_0x026b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x026b('0x12'));var logger=require(_0x026b('0x13'))(_0x026b('0x14'));var utils=require(_0x026b('0x15'));var config=require('../../config/environment');var db=require(_0x026b('0x16'))['db'];config[_0x026b('0x17')]=_[_0x026b('0x18')](config[_0x026b('0x17')],{'host':_0x026b('0x19'),'port':0x18eb});var socket=require(_0x026b('0x1a'))(new Redis(config[_0x026b('0x17')]));require('./faxQueue.socket')[_0x026b('0x1b')](socket);function respondWithStatusCode(_0x4e4118,_0x318199){_0x318199=_0x318199||0xcc;return function(_0xb8a72c){if(_0xb8a72c){return _0x4e4118[_0x026b('0x1c')](_0x318199);}return _0x4e4118[_0x026b('0x1d')](_0x318199)['end']();};}function respondWithResult(_0x250697,_0x1956a4){_0x1956a4=_0x1956a4||0xc8;return function(_0xe8d12){if(_0xe8d12){return _0x250697['status'](_0x1956a4)['json'](_0xe8d12);}};}function respondWithFilteredResult(_0x4bd1ff,_0x43b1a8){return function(_0x4a865f){if(_0x4a865f){var _0x52a3c6=_0x4a865f[_0x026b('0x1e')],_0xbb0e24=_0x43b1a8['offset'],_0x5b5196=_0x43b1a8['offset']+_0x43b1a8[_0x026b('0x1f')],_0x2d3567;if(_0x5b5196>=_0x52a3c6){_0x5b5196=_0x52a3c6;_0x2d3567=0xc8;}else{_0x2d3567=0xce;}_0x4bd1ff[_0x026b('0x1d')](_0x2d3567);return _0x4bd1ff[_0x026b('0x20')](_0x026b('0x21'),_0xbb0e24+'-'+_0x5b5196+'/'+_0x52a3c6)[_0x026b('0x22')](_0x4a865f);}return null;};}function patchUpdates(_0x5ae657){return function(_0x2be677){try{jsonpatch[_0x026b('0x23')](_0x2be677,_0x5ae657,!![]);}catch(_0x327911){return BPromise['reject'](_0x327911);}return _0x2be677[_0x026b('0x24')]();};}function saveUpdates(_0x44904c,_0xa71238){return function(_0x37473d){if(_0x37473d){return _0x37473d[_0x026b('0x25')](_0x44904c)['then'](function(_0x3ccaff){return _0x3ccaff;});}return null;};}function removeEntity(_0x3be606,_0x1d7f72){return function(_0x11af5a){if(_0x11af5a){return _0x11af5a[_0x026b('0x26')]()[_0x026b('0x27')](function(){var _0x4e7900=_0x11af5a['get']({'plain':!![]});var _0x3287bc='FaxQueues';return db[_0x026b('0x28')][_0x026b('0x26')]({'where':{'type':_0x3287bc,'resourceId':_0x4e7900['id']}})[_0x026b('0x27')](function(){return _0x11af5a;});})['then'](function(){_0x3be606['status'](0xcc)[_0x026b('0x29')]();});}};}function handleEntityNotFound(_0x3f3999,_0x472191){return function(_0x382e51){if(!_0x382e51){_0x3f3999[_0x026b('0x1c')](0x194);}return _0x382e51;};}function handleError(_0x4bd657,_0x2ab365){_0x2ab365=_0x2ab365||0x1f4;return function(_0x335463){logger[_0x026b('0x2a')](_0x335463[_0x026b('0x2b')]);if(_0x335463['name']){delete _0x335463[_0x026b('0x2c')];}_0x4bd657[_0x026b('0x1d')](_0x2ab365)['send'](_0x335463);};}exports['index']=function(_0x273f3d,_0x34fbba){var _0x5b7757={},_0x5b9edf={},_0x4952d1={'count':0x0,'rows':[]};var _0x40d9b6=_['map'](db[_0x026b('0x2d')][_0x026b('0x2e')],function(_0x2a9bcf){return{'name':_0x2a9bcf[_0x026b('0x2f')],'type':_0x2a9bcf[_0x026b('0x30')][_0x026b('0x31')]};});_0x5b9edf[_0x026b('0x32')]=_['map'](_0x40d9b6,_0x026b('0x2c'));_0x5b9edf[_0x026b('0x33')]=_[_0x026b('0x34')](_0x273f3d['query']);_0x5b9edf['filters']=_[_0x026b('0x35')](_0x5b9edf[_0x026b('0x32')],_0x5b9edf[_0x026b('0x33')]);_0x5b7757[_0x026b('0x36')]=_['intersection'](_0x5b9edf[_0x026b('0x32')],qs[_0x026b('0x37')](_0x273f3d[_0x026b('0x33')][_0x026b('0x37')]));_0x5b7757['attributes']=_0x5b7757[_0x026b('0x36')][_0x026b('0x38')]?_0x5b7757[_0x026b('0x36')]:_0x5b9edf[_0x026b('0x32')];if(!_0x273f3d[_0x026b('0x33')][_0x026b('0x39')](_0x026b('0x3a'))){_0x5b7757[_0x026b('0x1f')]=qs[_0x026b('0x1f')](_0x273f3d['query'][_0x026b('0x1f')]);_0x5b7757[_0x026b('0x3b')]=qs[_0x026b('0x3b')](_0x273f3d['query'][_0x026b('0x3b')]);}_0x5b7757[_0x026b('0x3c')]=qs[_0x026b('0x3d')](_0x273f3d[_0x026b('0x33')][_0x026b('0x3d')]);_0x5b7757[_0x026b('0x3e')]=qs['filters'](_[_0x026b('0x3f')](_0x273f3d[_0x026b('0x33')],_0x5b9edf[_0x026b('0x40')]),_0x40d9b6);if(_0x273f3d['query']['filter']){_0x5b7757[_0x026b('0x3e')]=_['merge'](_0x5b7757[_0x026b('0x3e')],{'$or':_['map'](_0x40d9b6,function(_0x56e0f8){if(_0x56e0f8[_0x026b('0x30')]!==_0x026b('0x41')){var _0x153446={};_0x153446[_0x56e0f8['name']]={'$like':'%'+_0x273f3d[_0x026b('0x33')][_0x026b('0x42')]+'%'};return _0x153446;}})});}_0x5b7757=_[_0x026b('0x43')]({},_0x5b7757,_0x273f3d[_0x026b('0x44')]);var _0x57acdb={'where':_0x5b7757[_0x026b('0x3e')]};return db[_0x026b('0x2d')][_0x026b('0x1e')](_0x57acdb)['then'](function(_0x25277b){_0x4952d1[_0x026b('0x1e')]=_0x25277b;if(_0x273f3d[_0x026b('0x33')][_0x026b('0x45')]){_0x5b7757[_0x026b('0x46')]=[{'all':!![]}];}return db[_0x026b('0x2d')][_0x026b('0x47')](_0x5b7757);})['then'](function(_0x146c68){_0x4952d1[_0x026b('0x48')]=_0x146c68;return _0x4952d1;})[_0x026b('0x27')](respondWithFilteredResult(_0x34fbba,_0x5b7757))[_0x026b('0x49')](handleError(_0x34fbba,null));};exports[_0x026b('0x4a')]=function(_0x3894b8,_0x237c8a){var _0x57249a={'raw':!![],'where':{'id':_0x3894b8[_0x026b('0x4b')]['id']}},_0x5f0805={};_0x5f0805['model']=_[_0x026b('0x34')](db['FaxQueue'][_0x026b('0x2e')]);_0x5f0805[_0x026b('0x33')]=_[_0x026b('0x34')](_0x3894b8[_0x026b('0x33')]);_0x5f0805[_0x026b('0x40')]=_[_0x026b('0x35')](_0x5f0805['model'],_0x5f0805['query']);_0x57249a[_0x026b('0x36')]=_[_0x026b('0x35')](_0x5f0805[_0x026b('0x32')],qs[_0x026b('0x37')](_0x3894b8[_0x026b('0x33')][_0x026b('0x37')]));_0x57249a['attributes']=_0x57249a[_0x026b('0x36')][_0x026b('0x38')]?_0x57249a[_0x026b('0x36')]:_0x5f0805[_0x026b('0x32')];if(_0x3894b8['query'][_0x026b('0x45')]){_0x57249a[_0x026b('0x46')]=[{'all':!![]}];}_0x57249a=_['merge']({},_0x57249a,_0x3894b8[_0x026b('0x44')]);return db[_0x026b('0x2d')][_0x026b('0x4c')](_0x57249a)['then'](handleEntityNotFound(_0x237c8a,null))[_0x026b('0x27')](respondWithResult(_0x237c8a,null))[_0x026b('0x49')](handleError(_0x237c8a,null));};exports[_0x026b('0x4d')]=function(_0x3d744e,_0x3bf4cf){return db['FaxQueue'][_0x026b('0x4d')](_0x3d744e[_0x026b('0x4e')],{})[_0x026b('0x27')](function(_0x5e920b){var _0x43b296=_0x3d744e[_0x026b('0x4f')][_0x026b('0x50')]({'plain':!![]});if(!_0x43b296)throw new Error(_0x026b('0x51'));if(_0x43b296[_0x026b('0x52')]===_0x026b('0x4f')){var _0x15de02=_0x5e920b[_0x026b('0x50')]({'plain':!![]});var _0x373173=_0x026b('0x53');return db[_0x026b('0x54')][_0x026b('0x4c')]({'where':{'name':_0x373173,'userProfileId':_0x43b296['userProfileId']},'raw':!![]})[_0x026b('0x27')](function(_0x2e52f9){if(_0x2e52f9&&_0x2e52f9[_0x026b('0x55')]===0x0){return db['UserProfileResource'][_0x026b('0x4d')]({'name':_0x15de02[_0x026b('0x2c')],'resourceId':_0x15de02['id'],'type':_0x2e52f9[_0x026b('0x2c')],'sectionId':_0x2e52f9['id']},{})[_0x026b('0x27')](function(){return _0x5e920b;});}else{return _0x5e920b;}})[_0x026b('0x49')](function(_0x4d8ed3){logger[_0x026b('0x2a')](_0x026b('0x56'),_0x4d8ed3);throw _0x4d8ed3;});}return _0x5e920b;})[_0x026b('0x27')](respondWithResult(_0x3bf4cf,0xc9))[_0x026b('0x49')](handleError(_0x3bf4cf,null));};exports[_0x026b('0x25')]=function(_0x21de5f,_0xa5b27c){if(_0x21de5f[_0x026b('0x4e')]['id']){delete _0x21de5f[_0x026b('0x4e')]['id'];}return db[_0x026b('0x2d')][_0x026b('0x4c')]({'where':{'id':_0x21de5f['params']['id']}})[_0x026b('0x27')](handleEntityNotFound(_0xa5b27c,null))[_0x026b('0x27')](saveUpdates(_0x21de5f[_0x026b('0x4e')],null))['then'](respondWithResult(_0xa5b27c,null))[_0x026b('0x49')](handleError(_0xa5b27c,null));};exports[_0x026b('0x26')]=function(_0x45f775,_0xca1baa){return db['FaxQueue']['find']({'where':{'id':_0x45f775[_0x026b('0x4b')]['id']}})[_0x026b('0x27')](handleEntityNotFound(_0xca1baa,null))[_0x026b('0x27')](removeEntity(_0xca1baa,null))[_0x026b('0x49')](handleError(_0xca1baa,null));};exports['describe']=function(_0x344166,_0x3f4fb1){return db['FaxQueue'][_0x026b('0x57')]()[_0x026b('0x27')](respondWithResult(_0x3f4fb1,null))[_0x026b('0x49')](handleError(_0x3f4fb1,null));};exports['getMembers']=function(_0x469bcd,_0x4a3d86,_0x3334e6){var _0x416475={'raw':!![],'where':{}},_0x54bc3b={},_0x141aee;return db[_0x026b('0x2d')]['findOne']({'where':{'id':_0x469bcd[_0x026b('0x4b')]['id']}})[_0x026b('0x27')](handleEntityNotFound(_0x4a3d86,null))['then'](function(_0x422e38){if(_0x422e38){_0x141aee=_0x422e38[_0x026b('0x50')]({'plain':!![]});_0x54bc3b[_0x026b('0x32')]=_['keys'](db[_0x026b('0x58')][_0x026b('0x2e')]);_0x54bc3b[_0x026b('0x33')]=_[_0x026b('0x34')](_0x469bcd[_0x026b('0x33')]);_0x54bc3b[_0x026b('0x40')]=_[_0x026b('0x35')](_0x54bc3b[_0x026b('0x32')],_0x54bc3b[_0x026b('0x33')]);_0x416475[_0x026b('0x36')]=_[_0x026b('0x35')](_0x54bc3b[_0x026b('0x32')],qs[_0x026b('0x37')](_0x469bcd[_0x026b('0x33')][_0x026b('0x37')]));_0x416475[_0x026b('0x36')]=_0x416475[_0x026b('0x36')][_0x026b('0x38')]?_0x416475['attributes']:_0x54bc3b['model'];if(!_0x469bcd[_0x026b('0x33')][_0x026b('0x39')](_0x026b('0x3a'))){_0x416475[_0x026b('0x1f')]=qs[_0x026b('0x1f')](_0x469bcd[_0x026b('0x33')][_0x026b('0x1f')]);_0x416475[_0x026b('0x3b')]=qs[_0x026b('0x3b')](_0x469bcd[_0x026b('0x33')][_0x026b('0x3b')]);}_0x416475['order']=qs[_0x026b('0x3d')](_0x469bcd['query'][_0x026b('0x3d')]);_0x416475['where']=qs[_0x026b('0x40')](_[_0x026b('0x3f')](_0x469bcd[_0x026b('0x33')],_0x54bc3b[_0x026b('0x40')]));_0x416475[_0x026b('0x3e')][_0x026b('0x59')]=_0x422e38['id'];if(_0x469bcd[_0x026b('0x33')][_0x026b('0x42')]){_0x416475[_0x026b('0x3e')]=_[_0x026b('0x43')](_0x416475['where'],{'$or':_[_0x026b('0x5a')](_0x416475[_0x026b('0x36')],function(_0x4a011c){var _0x391a69={};_0x391a69[_0x4a011c]={'$like':'%'+_0x469bcd[_0x026b('0x33')][_0x026b('0x42')]+'%'};return _0x391a69;})});}_0x416475=_[_0x026b('0x43')]({},_0x416475,_0x469bcd[_0x026b('0x44')]);return db['UserFaxQueue'][_0x026b('0x47')](_0x416475);}})['then'](function(_0x4438a6){if(_0x4438a6){return db['User'][_0x026b('0x5b')]({'where':{'id':_[_0x026b('0x5a')](_0x4438a6,'UserId'),'role':_0x026b('0x5c')},'attributes':['id','name',_0x026b('0x5d'),_0x026b('0x5e'),_0x026b('0x5f')]});}})[_0x026b('0x27')](function(_0x5c5023){if(_0x5c5023){return{'count':_0x5c5023[_0x026b('0x1e')],'rows':_[_0x026b('0x5a')](_0x5c5023[_0x026b('0x48')],function(_0x96c744){return{'membername':_0x96c744[_0x026b('0x2c')],'UserId':_0x96c744['id'],'queue_name':_0x141aee[_0x026b('0x2c')],'FaxQueueId':_0x141aee['id'],'interface':util['format'](_0x026b('0x60'),_0x026b('0x61'),_0x96c744[_0x026b('0x2c')]),'penalty':0x0,'paused':_0x96c744[_0x026b('0x5d')],'createdAt':_0x96c744[_0x026b('0x5f')],'updatedAt':_0x96c744[_0x026b('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4a3d86,_0x416475))[_0x026b('0x49')](handleError(_0x4a3d86,null));};exports['getTeams']=function(_0xda27af,_0x141d36,_0x4c4472){var _0x57a3ec={};var _0x4276c8={};var _0x199f05;var _0x39ae3c;return db['FaxQueue'][_0x026b('0x62')]({'where':{'id':_0xda27af['params']['id']}})['then'](handleEntityNotFound(_0x141d36,null))['then'](function(_0x41084d){if(_0x41084d){_0x199f05=_0x41084d;_0x4276c8[_0x026b('0x32')]=_[_0x026b('0x34')](db[_0x026b('0x63')]['rawAttributes']);_0x4276c8[_0x026b('0x33')]=_[_0x026b('0x34')](_0xda27af[_0x026b('0x33')]);_0x4276c8[_0x026b('0x40')]=_[_0x026b('0x35')](_0x4276c8[_0x026b('0x32')],_0x4276c8['query']);_0x57a3ec['attributes']=_[_0x026b('0x35')](_0x4276c8[_0x026b('0x32')],qs[_0x026b('0x37')](_0xda27af[_0x026b('0x33')]['fields']));_0x57a3ec[_0x026b('0x36')]=_0x57a3ec[_0x026b('0x36')][_0x026b('0x38')]?_0x57a3ec[_0x026b('0x36')]:_0x4276c8[_0x026b('0x32')];_0x57a3ec[_0x026b('0x3c')]=qs[_0x026b('0x3d')](_0xda27af[_0x026b('0x33')][_0x026b('0x3d')]);_0x57a3ec['where']=qs[_0x026b('0x40')](_[_0x026b('0x3f')](_0xda27af['query'],_0x4276c8['filters']));if(_0xda27af[_0x026b('0x33')]['filter']){_0x57a3ec['where']=_[_0x026b('0x43')](_0x57a3ec[_0x026b('0x3e')],{'$or':_[_0x026b('0x5a')](_0x57a3ec[_0x026b('0x36')],function(_0x1e334d){var _0x5c7138={};_0x5c7138[_0x1e334d]={'$like':'%'+_0xda27af['query'][_0x026b('0x42')]+'%'};return _0x5c7138;})});}_0x57a3ec=_[_0x026b('0x43')]({},_0x57a3ec,_0xda27af['options']);return _0x199f05[_0x026b('0x64')](_0x57a3ec);}})[_0x026b('0x27')](function(_0x2051e3){if(_0x2051e3){_0x39ae3c=_0x2051e3['length'];if(!_0xda27af[_0x026b('0x33')][_0x026b('0x39')]('nolimit')){_0x57a3ec[_0x026b('0x1f')]=qs[_0x026b('0x1f')](_0xda27af[_0x026b('0x33')][_0x026b('0x1f')]);_0x57a3ec[_0x026b('0x3b')]=qs['offset'](_0xda27af['query'][_0x026b('0x3b')]);}return _0x199f05[_0x026b('0x64')](_0x57a3ec);}})[_0x026b('0x27')](function(_0x27ce1){if(_0x27ce1){return _0x27ce1?{'count':_0x39ae3c,'rows':_0x27ce1}:null;}})[_0x026b('0x27')](respondWithResult(_0x141d36,null))['catch'](handleError(_0x141d36,null));};exports['addTeams']=function(_0x2b8844,_0x1c853e,_0x5cffc7){var _0x45fe88=_0x2b8844['body'][_0x026b('0x65')];return db[_0x026b('0x63')][_0x026b('0x47')]({'where':{'id':_0x45fe88},'attributes':['id'],'include':[{'model':db[_0x026b('0x66')],'as':_0x026b('0x67'),'attributes':['id',_0x026b('0x2c'),_0x026b('0x68'),_0x026b('0x69'),_0x026b('0x6a')],'raw':!![]}]})[_0x026b('0x27')](function(_0x46bc53){if(_0x46bc53){var _0x3fb49e=_[_0x026b('0x6b')](_0x46bc53,function(_0x1f82d1){var _0x39dcca=_0x1f82d1[_0x026b('0x50')]({'plain':!![]});return _0x39dcca[_0x026b('0x67')];});return db['FaxQueue'][_0x026b('0x4c')]({'where':{'id':_0x2b8844[_0x026b('0x4b')]['id']}})[_0x026b('0x27')](function(_0x234186){return db[_0x026b('0x6c')]['transaction'](function(_0x4cf058){return _0x234186['addTeams'](_0x45fe88,{'transaction':_0x4cf058})['then'](function(){return BPromise[_0x026b('0x6d')](_0x3fb49e,function(_0x2223ee){return db[_0x026b('0x58')][_0x026b('0x6e')]({'where':{'UserId':_0x2223ee['id'],'FaxQueueId':_0x2b8844[_0x026b('0x4b')]['id']},'transaction':_0x4cf058});});})[_0x026b('0x27')](function(){_0x3fb49e[_0x026b('0x6f')](function(_0x13afe9){socket['emit'](_0x026b('0x70'),{'UserId':_0x13afe9['id'],'FaxQueueId':_0x234186['id']});});});});});}})[_0x026b('0x27')](respondWithStatusCode(_0x1c853e,null))['catch'](handleError(_0x1c853e,null));};exports[_0x026b('0x71')]=function(_0x47577f,_0x961246,_0x4964e5){return db[_0x026b('0x63')][_0x026b('0x47')]({'where':{'id':_0x47577f[_0x026b('0x33')][_0x026b('0x65')]},'attributes':['id'],'include':[{'model':db[_0x026b('0x66')],'as':_0x026b('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x961246,null))[_0x026b('0x27')](function(_0xbf6bc3){var _0x2923cc=_[_0x026b('0x5a')](_0xbf6bc3,'id');var _0x1652da=[];var _0x921765=[];var _0x1f6bd6=squel[_0x026b('0x72')]();_0x1f6bd6[_0x026b('0x73')](_0x026b('0x74'))['from'](_0x026b('0x75'),'tq')['join'](_0x026b('0x76'),'ut',_0x026b('0x77'))[_0x026b('0x3e')](_0x026b('0x78'),_0x47577f[_0x026b('0x4b')]['id']);for(var _0x1884af=0x0;_0x1884af<_0xbf6bc3[_0x026b('0x38')];_0x1884af+=0x1){let _0x3472f7=_0xbf6bc3[_0x1884af];for(var _0x4928eb=0x0;_0x4928eb<_0x3472f7[_0x026b('0x67')][_0x026b('0x38')];_0x4928eb+=0x1){let _0x1041a3=_0x3472f7[_0x026b('0x67')][_0x4928eb];var _0x433a70=_0x1f6bd6[_0x026b('0x79')]();_0x433a70[_0x026b('0x3e')](_0x026b('0x7a'),_0x1041a3['id']);_0x921765[_0x026b('0x7b')](db['sequelize'][_0x026b('0x33')](_0x433a70['toString'](),{'type':db[_0x026b('0x6c')][_0x026b('0x7c')][_0x026b('0x7d')]})['then'](function(_0xc1f090){if(_0xc1f090[_0x026b('0x38')]===0x1){return _0x1041a3['id'];}else{var _0x5dafdb=_['every'](_['map'](_0xc1f090,'TeamId'),function(_0x31600b){return _[_0x026b('0x7e')](_0x2923cc,_0x31600b);});if(_0x5dafdb){return _0x1041a3['id'];}}}));}}return BPromise['all'](_0x921765)[_0x026b('0x27')](function(_0x116e58){_0x1652da=_(_0x1652da)[_0x026b('0x7f')](_0x116e58)[_0x026b('0x80')]()[_0x026b('0x81')]();return db[_0x026b('0x2d')][_0x026b('0x4c')]({'where':{'id':_0x47577f[_0x026b('0x4b')]['id']}})[_0x026b('0x27')](function(_0x356974){return db[_0x026b('0x6c')][_0x026b('0x82')](function(_0x220df2){return _0x356974[_0x026b('0x71')](_0x47577f['query'][_0x026b('0x65')],{'transaction':_0x220df2})[_0x026b('0x27')](function(){if(!_[_0x026b('0x83')](_0x1652da)){return _0x356974[_0x026b('0x84')](_0x1652da,{'transaction':_0x220df2});}})['then'](function(){_0x1652da[_0x026b('0x6f')](function(_0x6d4d2a){socket[_0x026b('0x85')](_0x026b('0x86'),{'UserId':_0x6d4d2a,'FaxQueueId':_0x356974['id']});});});});});});})[_0x026b('0x27')](respondWithStatusCode(_0x961246,null))[_0x026b('0x49')](handleError(_0x961246,null));};exports['addAgents']=function(_0x2fb514,_0x43610e,_0x2bcfae){return db[_0x026b('0x2d')][_0x026b('0x4c')]({'where':{'id':_0x2fb514[_0x026b('0x4b')]['id']}})[_0x026b('0x27')](handleEntityNotFound(_0x43610e,null))['then'](function(_0x12a6d0){if(_0x12a6d0){return _0x12a6d0['addAgents'](_0x2fb514[_0x026b('0x4e')][_0x026b('0x65')],_[_0x026b('0x87')](_0x2fb514[_0x026b('0x4e')],[_0x026b('0x65'),'id'])||{})[_0x026b('0x88')](function(_0x404d03){for(var _0x202461=0x0;_0x202461<_0x2fb514['body']['ids']['length'];_0x202461+=0x1){socket[_0x026b('0x85')](_0x026b('0x70'),{'UserId':_0x2fb514[_0x026b('0x4e')]['ids'][_0x202461],'FaxQueueId':_0x2fb514[_0x026b('0x4b')]['id']});}return _0x404d03;});}})[_0x026b('0x27')](respondWithResult(_0x43610e,null))[_0x026b('0x49')](handleError(_0x43610e,null));};exports[_0x026b('0x84')]=function(_0xdb25d7,_0xe1897d,_0x4a8b6b){return db[_0x026b('0x2d')][_0x026b('0x4c')]({'where':{'id':_0xdb25d7['params']['id']}})[_0x026b('0x27')](handleEntityNotFound(_0xe1897d,null))['then'](function(_0x266265){if(_0x266265){return _0x266265[_0x026b('0x84')](_0xdb25d7[_0x026b('0x33')][_0x026b('0x65')])['then'](function(){if(_[_0x026b('0x89')](_0xdb25d7[_0x026b('0x33')]['ids'])){for(var _0x421291=0x0;_0x421291<_0xdb25d7['query']['ids'][_0x026b('0x38')];_0x421291+=0x1){socket[_0x026b('0x85')](_0x026b('0x86'),{'UserId':Number(_0xdb25d7[_0x026b('0x33')][_0x026b('0x65')][_0x421291]),'FaxQueueId':Number(_0xdb25d7[_0x026b('0x4b')]['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0xdb25d7['query'][_0x026b('0x65')]),'FaxQueueId':Number(_0xdb25d7[_0x026b('0x4b')]['id'])});}});}})[_0x026b('0x27')](respondWithStatusCode(_0xe1897d,null))[_0x026b('0x49')](handleError(_0xe1897d,null));};exports[_0x026b('0x8a')]=function(_0x4ed573,_0x5d6c0b,_0x4b45f9){var _0x471d78={};var _0x46195f={};var _0x5413f3;var _0x2392b4;return db[_0x026b('0x2d')][_0x026b('0x62')]({'where':{'id':_0x4ed573[_0x026b('0x4b')]['id']}})[_0x026b('0x27')](handleEntityNotFound(_0x5d6c0b,null))[_0x026b('0x27')](function(_0x5b4c56){if(_0x5b4c56){_0x5413f3=_0x5b4c56;_0x46195f[_0x026b('0x32')]=_[_0x026b('0x34')](db[_0x026b('0x66')][_0x026b('0x2e')]);_0x46195f['query']=_[_0x026b('0x34')](_0x4ed573[_0x026b('0x33')]);_0x46195f[_0x026b('0x40')]=_[_0x026b('0x35')](_0x46195f['model'],_0x46195f[_0x026b('0x33')]);_0x471d78[_0x026b('0x36')]=_[_0x026b('0x35')](_0x46195f[_0x026b('0x32')],qs[_0x026b('0x37')](_0x4ed573[_0x026b('0x33')][_0x026b('0x37')]));_0x471d78['attributes']=_0x471d78[_0x026b('0x36')]['length']?_0x471d78[_0x026b('0x36')]:_0x46195f[_0x026b('0x32')];_0x471d78[_0x026b('0x3c')]=qs[_0x026b('0x3d')](_0x4ed573['query']['sort']);_0x471d78[_0x026b('0x3e')]=qs[_0x026b('0x40')](_[_0x026b('0x3f')](_0x4ed573['query'],_0x46195f[_0x026b('0x40')]));if(_0x4ed573[_0x026b('0x33')][_0x026b('0x42')]){_0x471d78[_0x026b('0x3e')]=_[_0x026b('0x43')](_0x471d78[_0x026b('0x3e')],{'$or':_[_0x026b('0x5a')](_0x471d78['attributes'],function(_0x5e26d3){var _0x525d98={};_0x525d98[_0x5e26d3]={'$like':'%'+_0x4ed573[_0x026b('0x33')]['filter']+'%'};return _0x525d98;})});}_0x471d78=_['merge']({},_0x471d78,_0x4ed573[_0x026b('0x44')]);return _0x5413f3[_0x026b('0x8a')](_0x471d78);}})['then'](function(_0x558d01){if(_0x558d01){_0x2392b4=_0x558d01[_0x026b('0x38')];if(!_0x4ed573['query'][_0x026b('0x39')](_0x026b('0x3a'))){_0x471d78['limit']=qs[_0x026b('0x1f')](_0x4ed573[_0x026b('0x33')]['limit']);_0x471d78['offset']=qs[_0x026b('0x3b')](_0x4ed573['query'][_0x026b('0x3b')]);}return _0x5413f3[_0x026b('0x8a')](_0x471d78);}})[_0x026b('0x27')](function(_0x3197ba){if(_0x3197ba){return _0x3197ba?{'count':_0x2392b4,'rows':_0x3197ba}:null;}})[_0x026b('0x27')](respondWithResult(_0x5d6c0b,null))[_0x026b('0x49')](handleError(_0x5d6c0b,null));}; \ No newline at end of file +var _0xf496=['filter','where','merge','type','VIRTUAL','options','count','include','findAll','rows','catch','show','params','keys','length','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','update','find','getMembers','findOne','order','FaxQueueId','UserFaxQueue','agent','faxPause','createdAt','format','getTeams','Team','Agents','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','emit','removeTeams','ids','User','select','field','team_has_fax_queues','join','FaxQueueId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','includes','all','compact','value','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','papaparse','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','set','Content-Range','json','save','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','index','map','FaxQueue','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick'];(function(_0x3f8fd6,_0x3a73c0){var _0x2ee089=function(_0x43977f){while(--_0x43977f){_0x3f8fd6['push'](_0x3f8fd6['shift']());}};_0x2ee089(++_0x3a73c0);}(_0xf496,0x1c7));var _0x6f49=function(_0x1f4684,_0x2de33f){_0x1f4684=_0x1f4684-0x0;var _0x11d040=_0xf496[_0x1f4684];return _0x11d040;};'use strict';var pdf=require(_0x6f49('0x0'));var emlformat=require(_0x6f49('0x1'));var rimraf=require(_0x6f49('0x2'));var zipdir=require(_0x6f49('0x3'));var jsonpatch=require(_0x6f49('0x4'));var rp=require('request-promise');var moment=require(_0x6f49('0x5'));var BPromise=require(_0x6f49('0x6'));var Mustache=require('mustache');var util=require(_0x6f49('0x7'));var path=require(_0x6f49('0x8'));var sox=require(_0x6f49('0x9'));var csv=require(_0x6f49('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6f49('0xb'));var squel=require(_0x6f49('0xc'));var crypto=require(_0x6f49('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f49('0xa'));var querystring=require('querystring');var Papa=require(_0x6f49('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f49('0xf'));var logger=require(_0x6f49('0x10'))('api');var utils=require(_0x6f49('0x11'));var config=require(_0x6f49('0x12'));var db=require(_0x6f49('0x13'))['db'];config[_0x6f49('0x14')]=_[_0x6f49('0x15')](config[_0x6f49('0x14')],{'host':_0x6f49('0x16'),'port':0x18eb});var socket=require(_0x6f49('0x17'))(new Redis(config[_0x6f49('0x14')]));require('./faxQueue.socket')[_0x6f49('0x18')](socket);function respondWithStatusCode(_0x6d374a,_0x3fb68e){_0x3fb68e=_0x3fb68e||0xcc;return function(_0x4c521e){if(_0x4c521e){return _0x6d374a[_0x6f49('0x19')](_0x3fb68e);}return _0x6d374a[_0x6f49('0x1a')](_0x3fb68e)[_0x6f49('0x1b')]();};}function respondWithResult(_0x3a628e,_0x7575ca){_0x7575ca=_0x7575ca||0xc8;return function(_0x9c5cf2){if(_0x9c5cf2){return _0x3a628e[_0x6f49('0x1a')](_0x7575ca)['json'](_0x9c5cf2);}};}function respondWithFilteredResult(_0x449b20,_0x2627f4){return function(_0x184e65){if(_0x184e65){var _0x95bc12=_0x184e65['count'],_0x143363=_0x2627f4[_0x6f49('0x1c')],_0x3d24db=_0x2627f4[_0x6f49('0x1c')]+_0x2627f4['limit'],_0xdeac3;if(_0x3d24db>=_0x95bc12){_0x3d24db=_0x95bc12;_0xdeac3=0xc8;}else{_0xdeac3=0xce;}_0x449b20[_0x6f49('0x1a')](_0xdeac3);return _0x449b20[_0x6f49('0x1d')](_0x6f49('0x1e'),_0x143363+'-'+_0x3d24db+'/'+_0x95bc12)[_0x6f49('0x1f')](_0x184e65);}return null;};}function patchUpdates(_0x12dbf7){return function(_0x27b914){try{jsonpatch['apply'](_0x27b914,_0x12dbf7,!![]);}catch(_0x12945c){return BPromise['reject'](_0x12945c);}return _0x27b914[_0x6f49('0x20')]();};}function saveUpdates(_0x430523,_0x4d3563){return function(_0x4a26b5){if(_0x4a26b5){return _0x4a26b5['update'](_0x430523)[_0x6f49('0x21')](function(_0x18b97e){return _0x18b97e;});}return null;};}function removeEntity(_0x413120,_0x4abedf){return function(_0x138a15){if(_0x138a15){return _0x138a15[_0x6f49('0x22')]()[_0x6f49('0x21')](function(){var _0x5118fd=_0x138a15[_0x6f49('0x23')]({'plain':!![]});var _0x22caa5=_0x6f49('0x24');return db[_0x6f49('0x25')]['destroy']({'where':{'type':_0x22caa5,'resourceId':_0x5118fd['id']}})[_0x6f49('0x21')](function(){return _0x138a15;});})[_0x6f49('0x21')](function(){_0x413120[_0x6f49('0x1a')](0xcc)[_0x6f49('0x1b')]();});}};}function handleEntityNotFound(_0x24a52c,_0x2e99d7){return function(_0x5aee44){if(!_0x5aee44){_0x24a52c[_0x6f49('0x19')](0x194);}return _0x5aee44;};}function handleError(_0x340172,_0x1e560e){_0x1e560e=_0x1e560e||0x1f4;return function(_0x9e4045){logger[_0x6f49('0x26')](_0x9e4045[_0x6f49('0x27')]);if(_0x9e4045['name']){delete _0x9e4045[_0x6f49('0x28')];}_0x340172[_0x6f49('0x1a')](_0x1e560e)['send'](_0x9e4045);};}exports[_0x6f49('0x29')]=function(_0x18214c,_0x31745c){var _0x5cc575={},_0x4e03a2={},_0x14eaee={'count':0x0,'rows':[]};var _0x110775=_[_0x6f49('0x2a')](db[_0x6f49('0x2b')][_0x6f49('0x2c')],function(_0x9bb6ff){return{'name':_0x9bb6ff[_0x6f49('0x2d')],'type':_0x9bb6ff['type']['key']};});_0x4e03a2[_0x6f49('0x2e')]=_[_0x6f49('0x2a')](_0x110775,_0x6f49('0x28'));_0x4e03a2['query']=_['keys'](_0x18214c[_0x6f49('0x2f')]);_0x4e03a2[_0x6f49('0x30')]=_[_0x6f49('0x31')](_0x4e03a2[_0x6f49('0x2e')],_0x4e03a2['query']);_0x5cc575[_0x6f49('0x32')]=_['intersection'](_0x4e03a2[_0x6f49('0x2e')],qs[_0x6f49('0x33')](_0x18214c[_0x6f49('0x2f')][_0x6f49('0x33')]));_0x5cc575[_0x6f49('0x32')]=_0x5cc575[_0x6f49('0x32')]['length']?_0x5cc575[_0x6f49('0x32')]:_0x4e03a2[_0x6f49('0x2e')];if(!_0x18214c[_0x6f49('0x2f')][_0x6f49('0x34')](_0x6f49('0x35'))){_0x5cc575['limit']=qs['limit'](_0x18214c[_0x6f49('0x2f')][_0x6f49('0x36')]);_0x5cc575[_0x6f49('0x1c')]=qs['offset'](_0x18214c['query'][_0x6f49('0x1c')]);}_0x5cc575['order']=qs[_0x6f49('0x37')](_0x18214c[_0x6f49('0x2f')][_0x6f49('0x37')]);_0x5cc575['where']=qs[_0x6f49('0x30')](_[_0x6f49('0x38')](_0x18214c['query'],_0x4e03a2[_0x6f49('0x30')]),_0x110775);if(_0x18214c[_0x6f49('0x2f')][_0x6f49('0x39')]){_0x5cc575[_0x6f49('0x3a')]=_[_0x6f49('0x3b')](_0x5cc575[_0x6f49('0x3a')],{'$or':_['map'](_0x110775,function(_0x2a8f29){if(_0x2a8f29[_0x6f49('0x3c')]!==_0x6f49('0x3d')){var _0x4702a7={};_0x4702a7[_0x2a8f29[_0x6f49('0x28')]]={'$like':'%'+_0x18214c[_0x6f49('0x2f')][_0x6f49('0x39')]+'%'};return _0x4702a7;}})});}_0x5cc575=_[_0x6f49('0x3b')]({},_0x5cc575,_0x18214c[_0x6f49('0x3e')]);var _0x26b97a={'where':_0x5cc575[_0x6f49('0x3a')]};return db[_0x6f49('0x2b')][_0x6f49('0x3f')](_0x26b97a)[_0x6f49('0x21')](function(_0x12f0e7){_0x14eaee[_0x6f49('0x3f')]=_0x12f0e7;if(_0x18214c[_0x6f49('0x2f')]['includeAll']){_0x5cc575[_0x6f49('0x40')]=[{'all':!![]}];}return db['FaxQueue'][_0x6f49('0x41')](_0x5cc575);})[_0x6f49('0x21')](function(_0x5f0301){_0x14eaee[_0x6f49('0x42')]=_0x5f0301;return _0x14eaee;})[_0x6f49('0x21')](respondWithFilteredResult(_0x31745c,_0x5cc575))[_0x6f49('0x43')](handleError(_0x31745c,null));};exports[_0x6f49('0x44')]=function(_0x43f724,_0x2d1ab6){var _0x1a409e={'raw':!![],'where':{'id':_0x43f724[_0x6f49('0x45')]['id']}},_0x7a2ac6={};_0x7a2ac6[_0x6f49('0x2e')]=_[_0x6f49('0x46')](db[_0x6f49('0x2b')][_0x6f49('0x2c')]);_0x7a2ac6[_0x6f49('0x2f')]=_[_0x6f49('0x46')](_0x43f724[_0x6f49('0x2f')]);_0x7a2ac6['filters']=_[_0x6f49('0x31')](_0x7a2ac6[_0x6f49('0x2e')],_0x7a2ac6[_0x6f49('0x2f')]);_0x1a409e[_0x6f49('0x32')]=_[_0x6f49('0x31')](_0x7a2ac6[_0x6f49('0x2e')],qs[_0x6f49('0x33')](_0x43f724[_0x6f49('0x2f')][_0x6f49('0x33')]));_0x1a409e[_0x6f49('0x32')]=_0x1a409e[_0x6f49('0x32')][_0x6f49('0x47')]?_0x1a409e[_0x6f49('0x32')]:_0x7a2ac6[_0x6f49('0x2e')];if(_0x43f724[_0x6f49('0x2f')][_0x6f49('0x48')]){_0x1a409e[_0x6f49('0x40')]=[{'all':!![]}];}_0x1a409e=_['merge']({},_0x1a409e,_0x43f724[_0x6f49('0x3e')]);return db[_0x6f49('0x2b')]['find'](_0x1a409e)[_0x6f49('0x21')](handleEntityNotFound(_0x2d1ab6,null))['then'](respondWithResult(_0x2d1ab6,null))[_0x6f49('0x43')](handleError(_0x2d1ab6,null));};exports['create']=function(_0x3f677f,_0x2651c0){return db['FaxQueue'][_0x6f49('0x49')](_0x3f677f[_0x6f49('0x4a')],{})[_0x6f49('0x21')](function(_0xdd8fd){var _0x11b2ec=_0x3f677f['user']['get']({'plain':!![]});if(!_0x11b2ec)throw new Error(_0x6f49('0x4b'));if(_0x11b2ec[_0x6f49('0x4c')]===_0x6f49('0x4d')){var _0x938c8d=_0xdd8fd[_0x6f49('0x23')]({'plain':!![]});var _0x4c4880='FaxQueues';return db[_0x6f49('0x4e')]['find']({'where':{'name':_0x4c4880,'userProfileId':_0x11b2ec['userProfileId']},'raw':!![]})[_0x6f49('0x21')](function(_0x33bc08){if(_0x33bc08&&_0x33bc08[_0x6f49('0x4f')]===0x0){return db[_0x6f49('0x25')]['create']({'name':_0x938c8d[_0x6f49('0x28')],'resourceId':_0x938c8d['id'],'type':_0x33bc08[_0x6f49('0x28')],'sectionId':_0x33bc08['id']},{})[_0x6f49('0x21')](function(){return _0xdd8fd;});}else{return _0xdd8fd;}})[_0x6f49('0x43')](function(_0x2e9d33){logger[_0x6f49('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e9d33);throw _0x2e9d33;});}return _0xdd8fd;})['then'](respondWithResult(_0x2651c0,0xc9))['catch'](handleError(_0x2651c0,null));};exports[_0x6f49('0x50')]=function(_0x3e5320,_0x488ede){if(_0x3e5320[_0x6f49('0x4a')]['id']){delete _0x3e5320[_0x6f49('0x4a')]['id'];}return db[_0x6f49('0x2b')]['find']({'where':{'id':_0x3e5320[_0x6f49('0x45')]['id']}})[_0x6f49('0x21')](handleEntityNotFound(_0x488ede,null))[_0x6f49('0x21')](saveUpdates(_0x3e5320['body'],null))[_0x6f49('0x21')](respondWithResult(_0x488ede,null))[_0x6f49('0x43')](handleError(_0x488ede,null));};exports[_0x6f49('0x22')]=function(_0x1bf0be,_0x2e5e35){return db[_0x6f49('0x2b')][_0x6f49('0x51')]({'where':{'id':_0x1bf0be[_0x6f49('0x45')]['id']}})[_0x6f49('0x21')](handleEntityNotFound(_0x2e5e35,null))[_0x6f49('0x21')](removeEntity(_0x2e5e35,null))[_0x6f49('0x43')](handleError(_0x2e5e35,null));};exports['describe']=function(_0xc06978,_0x16109b){return db[_0x6f49('0x2b')]['describe']()['then'](respondWithResult(_0x16109b,null))['catch'](handleError(_0x16109b,null));};exports[_0x6f49('0x52')]=function(_0x460109,_0xc011d,_0x253be0){var _0x57dd20={'raw':!![],'where':{}},_0x28bb9d={},_0x5debe1;return db['FaxQueue'][_0x6f49('0x53')]({'where':{'id':_0x460109[_0x6f49('0x45')]['id']}})[_0x6f49('0x21')](handleEntityNotFound(_0xc011d,null))['then'](function(_0x5b717f){if(_0x5b717f){_0x5debe1=_0x5b717f[_0x6f49('0x23')]({'plain':!![]});_0x28bb9d[_0x6f49('0x2e')]=_[_0x6f49('0x46')](db['UserFaxQueue']['rawAttributes']);_0x28bb9d[_0x6f49('0x2f')]=_[_0x6f49('0x46')](_0x460109['query']);_0x28bb9d[_0x6f49('0x30')]=_[_0x6f49('0x31')](_0x28bb9d[_0x6f49('0x2e')],_0x28bb9d[_0x6f49('0x2f')]);_0x57dd20[_0x6f49('0x32')]=_[_0x6f49('0x31')](_0x28bb9d['model'],qs['fields'](_0x460109['query']['fields']));_0x57dd20['attributes']=_0x57dd20[_0x6f49('0x32')][_0x6f49('0x47')]?_0x57dd20[_0x6f49('0x32')]:_0x28bb9d[_0x6f49('0x2e')];if(!_0x460109[_0x6f49('0x2f')][_0x6f49('0x34')](_0x6f49('0x35'))){_0x57dd20['limit']=qs[_0x6f49('0x36')](_0x460109['query'][_0x6f49('0x36')]);_0x57dd20['offset']=qs['offset'](_0x460109[_0x6f49('0x2f')][_0x6f49('0x1c')]);}_0x57dd20[_0x6f49('0x54')]=qs[_0x6f49('0x37')](_0x460109[_0x6f49('0x2f')][_0x6f49('0x37')]);_0x57dd20[_0x6f49('0x3a')]=qs['filters'](_[_0x6f49('0x38')](_0x460109['query'],_0x28bb9d['filters']));_0x57dd20[_0x6f49('0x3a')][_0x6f49('0x55')]=_0x5b717f['id'];if(_0x460109[_0x6f49('0x2f')][_0x6f49('0x39')]){_0x57dd20['where']=_[_0x6f49('0x3b')](_0x57dd20[_0x6f49('0x3a')],{'$or':_[_0x6f49('0x2a')](_0x57dd20['attributes'],function(_0x4c6103){var _0x4c76fe={};_0x4c76fe[_0x4c6103]={'$like':'%'+_0x460109['query'][_0x6f49('0x39')]+'%'};return _0x4c76fe;})});}_0x57dd20=_[_0x6f49('0x3b')]({},_0x57dd20,_0x460109[_0x6f49('0x3e')]);return db[_0x6f49('0x56')]['findAll'](_0x57dd20);}})[_0x6f49('0x21')](function(_0x5c51ac){if(_0x5c51ac){return db['User']['findAndCountAll']({'where':{'id':_[_0x6f49('0x2a')](_0x5c51ac,'UserId'),'role':_0x6f49('0x57')},'attributes':['id',_0x6f49('0x28'),_0x6f49('0x58'),'updatedAt',_0x6f49('0x59')]});}})['then'](function(_0x269ede){if(_0x269ede){return{'count':_0x269ede[_0x6f49('0x3f')],'rows':_[_0x6f49('0x2a')](_0x269ede[_0x6f49('0x42')],function(_0x862fda){return{'membername':_0x862fda['name'],'UserId':_0x862fda['id'],'queue_name':_0x5debe1[_0x6f49('0x28')],'FaxQueueId':_0x5debe1['id'],'interface':util[_0x6f49('0x5a')]('%s/%s','SIP',_0x862fda[_0x6f49('0x28')]),'penalty':0x0,'paused':_0x862fda['faxPause'],'createdAt':_0x862fda[_0x6f49('0x59')],'updatedAt':_0x862fda['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x6f49('0x21')](respondWithFilteredResult(_0xc011d,_0x57dd20))['catch'](handleError(_0xc011d,null));};exports[_0x6f49('0x5b')]=function(_0x508039,_0x1a8b1f,_0x4e6ac7){var _0x343bc6={};var _0x32e1ce={};var _0x15277d;var _0x27d84a;return db['FaxQueue'][_0x6f49('0x53')]({'where':{'id':_0x508039[_0x6f49('0x45')]['id']}})[_0x6f49('0x21')](handleEntityNotFound(_0x1a8b1f,null))[_0x6f49('0x21')](function(_0x1ee759){if(_0x1ee759){_0x15277d=_0x1ee759;_0x32e1ce[_0x6f49('0x2e')]=_['keys'](db['Team'][_0x6f49('0x2c')]);_0x32e1ce['query']=_[_0x6f49('0x46')](_0x508039[_0x6f49('0x2f')]);_0x32e1ce[_0x6f49('0x30')]=_[_0x6f49('0x31')](_0x32e1ce[_0x6f49('0x2e')],_0x32e1ce['query']);_0x343bc6[_0x6f49('0x32')]=_[_0x6f49('0x31')](_0x32e1ce['model'],qs[_0x6f49('0x33')](_0x508039[_0x6f49('0x2f')]['fields']));_0x343bc6[_0x6f49('0x32')]=_0x343bc6['attributes'][_0x6f49('0x47')]?_0x343bc6[_0x6f49('0x32')]:_0x32e1ce[_0x6f49('0x2e')];_0x343bc6['order']=qs[_0x6f49('0x37')](_0x508039[_0x6f49('0x2f')][_0x6f49('0x37')]);_0x343bc6[_0x6f49('0x3a')]=qs[_0x6f49('0x30')](_[_0x6f49('0x38')](_0x508039[_0x6f49('0x2f')],_0x32e1ce[_0x6f49('0x30')]));if(_0x508039[_0x6f49('0x2f')][_0x6f49('0x39')]){_0x343bc6[_0x6f49('0x3a')]=_[_0x6f49('0x3b')](_0x343bc6[_0x6f49('0x3a')],{'$or':_['map'](_0x343bc6[_0x6f49('0x32')],function(_0x1d7dea){var _0xd9d4e8={};_0xd9d4e8[_0x1d7dea]={'$like':'%'+_0x508039[_0x6f49('0x2f')][_0x6f49('0x39')]+'%'};return _0xd9d4e8;})});}_0x343bc6=_[_0x6f49('0x3b')]({},_0x343bc6,_0x508039['options']);return _0x15277d[_0x6f49('0x5b')](_0x343bc6);}})['then'](function(_0x3072ab){if(_0x3072ab){_0x27d84a=_0x3072ab[_0x6f49('0x47')];if(!_0x508039[_0x6f49('0x2f')]['hasOwnProperty'](_0x6f49('0x35'))){_0x343bc6[_0x6f49('0x36')]=qs['limit'](_0x508039[_0x6f49('0x2f')]['limit']);_0x343bc6['offset']=qs[_0x6f49('0x1c')](_0x508039[_0x6f49('0x2f')]['offset']);}return _0x15277d[_0x6f49('0x5b')](_0x343bc6);}})[_0x6f49('0x21')](function(_0x403bd0){if(_0x403bd0){return _0x403bd0?{'count':_0x27d84a,'rows':_0x403bd0}:null;}})[_0x6f49('0x21')](respondWithResult(_0x1a8b1f,null))[_0x6f49('0x43')](handleError(_0x1a8b1f,null));};exports['addTeams']=function(_0x3cd1dc,_0x204116,_0x4b0856){var _0xf40f9e=_0x3cd1dc[_0x6f49('0x4a')]['ids'];return db[_0x6f49('0x5c')][_0x6f49('0x41')]({'where':{'id':_0xf40f9e},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6f49('0x5d'),'attributes':['id',_0x6f49('0x28'),'online',_0x6f49('0x5e'),_0x6f49('0x5f')],'raw':!![]}]})[_0x6f49('0x21')](function(_0x1795f8){if(_0x1795f8){var _0x1bb0fb=_[_0x6f49('0x60')](_0x1795f8,function(_0x3f9c9d){var _0x275fbc=_0x3f9c9d['get']({'plain':!![]});return _0x275fbc['Agents'];});return db[_0x6f49('0x2b')][_0x6f49('0x51')]({'where':{'id':_0x3cd1dc[_0x6f49('0x45')]['id']}})[_0x6f49('0x21')](function(_0x428d15){return db[_0x6f49('0x61')][_0x6f49('0x62')](function(_0x194211){return _0x428d15[_0x6f49('0x63')](_0xf40f9e,{'transaction':_0x194211})[_0x6f49('0x21')](function(){return BPromise['each'](_0x1bb0fb,function(_0x4cd359){return db['UserFaxQueue'][_0x6f49('0x64')]({'where':{'UserId':_0x4cd359['id'],'FaxQueueId':_0x3cd1dc[_0x6f49('0x45')]['id']},'transaction':_0x194211});});})[_0x6f49('0x21')](function(){_0x1bb0fb['forEach'](function(_0x3d9ff8){socket[_0x6f49('0x65')]('userFaxQueue:save',{'UserId':_0x3d9ff8['id'],'FaxQueueId':_0x428d15['id']});});});});});}})[_0x6f49('0x21')](respondWithStatusCode(_0x204116,null))[_0x6f49('0x43')](handleError(_0x204116,null));};exports[_0x6f49('0x66')]=function(_0x27c5e6,_0x31abf5,_0x2534c6){return db[_0x6f49('0x5c')][_0x6f49('0x41')]({'where':{'id':_0x27c5e6[_0x6f49('0x2f')][_0x6f49('0x67')]},'attributes':['id'],'include':[{'model':db[_0x6f49('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x31abf5,null))[_0x6f49('0x21')](function(_0x4024b9){var _0x2c3ffd=_[_0x6f49('0x2a')](_0x4024b9,'id');var _0x38f4e0=[];var _0x56e0c3=[];var _0x50beb7=squel[_0x6f49('0x69')]();_0x50beb7[_0x6f49('0x6a')]('tq.TeamId')['from'](_0x6f49('0x6b'),'tq')[_0x6f49('0x6c')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6f49('0x3a')](_0x6f49('0x6d'),_0x27c5e6[_0x6f49('0x45')]['id']);for(var _0x4d4530=0x0;_0x4d4530<_0x4024b9[_0x6f49('0x47')];_0x4d4530+=0x1){let _0x277cdc=_0x4024b9[_0x4d4530];for(var _0x54fa2f=0x0;_0x54fa2f<_0x277cdc[_0x6f49('0x5d')][_0x6f49('0x47')];_0x54fa2f+=0x1){let _0x59687b=_0x277cdc[_0x6f49('0x5d')][_0x54fa2f];var _0x76d60e=_0x50beb7[_0x6f49('0x6e')]();_0x76d60e[_0x6f49('0x3a')]('ut.UserId\x20=\x20?',_0x59687b['id']);_0x56e0c3['push'](db[_0x6f49('0x61')][_0x6f49('0x2f')](_0x76d60e[_0x6f49('0x6f')](),{'type':db['sequelize'][_0x6f49('0x70')][_0x6f49('0x71')]})[_0x6f49('0x21')](function(_0x192a43){if(_0x192a43[_0x6f49('0x47')]===0x1){return _0x59687b['id'];}else{var _0x278df7=_[_0x6f49('0x72')](_[_0x6f49('0x2a')](_0x192a43,'TeamId'),function(_0x14e345){return _[_0x6f49('0x73')](_0x2c3ffd,_0x14e345);});if(_0x278df7){return _0x59687b['id'];}}}));}}return BPromise[_0x6f49('0x74')](_0x56e0c3)[_0x6f49('0x21')](function(_0x5f0f62){_0x38f4e0=_(_0x38f4e0)['union'](_0x5f0f62)[_0x6f49('0x75')]()[_0x6f49('0x76')]();return db['FaxQueue'][_0x6f49('0x51')]({'where':{'id':_0x27c5e6[_0x6f49('0x45')]['id']}})[_0x6f49('0x21')](function(_0x52daa1){return db[_0x6f49('0x61')][_0x6f49('0x62')](function(_0x36c594){return _0x52daa1[_0x6f49('0x66')](_0x27c5e6['query'][_0x6f49('0x67')],{'transaction':_0x36c594})[_0x6f49('0x21')](function(){if(!_['isEmpty'](_0x38f4e0)){return _0x52daa1[_0x6f49('0x77')](_0x38f4e0,{'transaction':_0x36c594});}})[_0x6f49('0x21')](function(){_0x38f4e0[_0x6f49('0x78')](function(_0x52f1fe){socket[_0x6f49('0x65')](_0x6f49('0x79'),{'UserId':_0x52f1fe,'FaxQueueId':_0x52daa1['id']});});});});});});})[_0x6f49('0x21')](respondWithStatusCode(_0x31abf5,null))[_0x6f49('0x43')](handleError(_0x31abf5,null));};exports[_0x6f49('0x7a')]=function(_0x5747e3,_0x4e57f2,_0xb8f1ad){return db[_0x6f49('0x2b')][_0x6f49('0x51')]({'where':{'id':_0x5747e3[_0x6f49('0x45')]['id']}})[_0x6f49('0x21')](handleEntityNotFound(_0x4e57f2,null))[_0x6f49('0x21')](function(_0x28cc2b){if(_0x28cc2b){return _0x28cc2b[_0x6f49('0x7a')](_0x5747e3[_0x6f49('0x4a')][_0x6f49('0x67')],_[_0x6f49('0x7b')](_0x5747e3[_0x6f49('0x4a')],[_0x6f49('0x67'),'id'])||{})[_0x6f49('0x7c')](function(_0x361fc4){for(var _0x324483=0x0;_0x324483<_0x5747e3[_0x6f49('0x4a')]['ids'][_0x6f49('0x47')];_0x324483+=0x1){socket[_0x6f49('0x65')](_0x6f49('0x7d'),{'UserId':_0x5747e3[_0x6f49('0x4a')][_0x6f49('0x67')][_0x324483],'FaxQueueId':_0x5747e3[_0x6f49('0x45')]['id']});}return _0x361fc4;});}})[_0x6f49('0x21')](respondWithResult(_0x4e57f2,null))[_0x6f49('0x43')](handleError(_0x4e57f2,null));};exports['removeAgents']=function(_0xe8dc5e,_0x593e8d,_0x283086){return db['FaxQueue'][_0x6f49('0x51')]({'where':{'id':_0xe8dc5e[_0x6f49('0x45')]['id']}})['then'](handleEntityNotFound(_0x593e8d,null))[_0x6f49('0x21')](function(_0x2d75d0){if(_0x2d75d0){return _0x2d75d0[_0x6f49('0x77')](_0xe8dc5e['query'][_0x6f49('0x67')])[_0x6f49('0x21')](function(){if(_[_0x6f49('0x7e')](_0xe8dc5e[_0x6f49('0x2f')][_0x6f49('0x67')])){for(var _0x21e39c=0x0;_0x21e39c<_0xe8dc5e[_0x6f49('0x2f')]['ids'][_0x6f49('0x47')];_0x21e39c+=0x1){socket[_0x6f49('0x65')](_0x6f49('0x79'),{'UserId':Number(_0xe8dc5e[_0x6f49('0x2f')][_0x6f49('0x67')][_0x21e39c]),'FaxQueueId':Number(_0xe8dc5e[_0x6f49('0x45')]['id'])});}}else{socket[_0x6f49('0x65')]('userFaxQueue:remove',{'UserId':Number(_0xe8dc5e[_0x6f49('0x2f')][_0x6f49('0x67')]),'FaxQueueId':Number(_0xe8dc5e[_0x6f49('0x45')]['id'])});}});}})[_0x6f49('0x21')](respondWithStatusCode(_0x593e8d,null))[_0x6f49('0x43')](handleError(_0x593e8d,null));};exports['getAgents']=function(_0x287f5c,_0x477164,_0x238b1b){var _0x150b97={};var _0x1b53e8={};var _0x311d68;var _0x1308f6;return db[_0x6f49('0x2b')][_0x6f49('0x53')]({'where':{'id':_0x287f5c[_0x6f49('0x45')]['id']}})[_0x6f49('0x21')](handleEntityNotFound(_0x477164,null))['then'](function(_0xf4297f){if(_0xf4297f){_0x311d68=_0xf4297f;_0x1b53e8[_0x6f49('0x2e')]=_[_0x6f49('0x46')](db[_0x6f49('0x68')][_0x6f49('0x2c')]);_0x1b53e8[_0x6f49('0x2f')]=_[_0x6f49('0x46')](_0x287f5c[_0x6f49('0x2f')]);_0x1b53e8['filters']=_['intersection'](_0x1b53e8['model'],_0x1b53e8['query']);_0x150b97[_0x6f49('0x32')]=_[_0x6f49('0x31')](_0x1b53e8[_0x6f49('0x2e')],qs[_0x6f49('0x33')](_0x287f5c[_0x6f49('0x2f')][_0x6f49('0x33')]));_0x150b97[_0x6f49('0x32')]=_0x150b97[_0x6f49('0x32')][_0x6f49('0x47')]?_0x150b97['attributes']:_0x1b53e8[_0x6f49('0x2e')];_0x150b97[_0x6f49('0x54')]=qs['sort'](_0x287f5c[_0x6f49('0x2f')]['sort']);_0x150b97[_0x6f49('0x3a')]=qs[_0x6f49('0x30')](_[_0x6f49('0x38')](_0x287f5c[_0x6f49('0x2f')],_0x1b53e8[_0x6f49('0x30')]));if(_0x287f5c['query'][_0x6f49('0x39')]){_0x150b97[_0x6f49('0x3a')]=_['merge'](_0x150b97[_0x6f49('0x3a')],{'$or':_[_0x6f49('0x2a')](_0x150b97[_0x6f49('0x32')],function(_0x407e64){var _0x343e70={};_0x343e70[_0x407e64]={'$like':'%'+_0x287f5c['query'][_0x6f49('0x39')]+'%'};return _0x343e70;})});}_0x150b97=_[_0x6f49('0x3b')]({},_0x150b97,_0x287f5c['options']);return _0x311d68[_0x6f49('0x7f')](_0x150b97);}})[_0x6f49('0x21')](function(_0x227ae2){if(_0x227ae2){_0x1308f6=_0x227ae2[_0x6f49('0x47')];if(!_0x287f5c[_0x6f49('0x2f')]['hasOwnProperty']('nolimit')){_0x150b97[_0x6f49('0x36')]=qs[_0x6f49('0x36')](_0x287f5c['query'][_0x6f49('0x36')]);_0x150b97[_0x6f49('0x1c')]=qs[_0x6f49('0x1c')](_0x287f5c[_0x6f49('0x2f')][_0x6f49('0x1c')]);}return _0x311d68[_0x6f49('0x7f')](_0x150b97);}})['then'](function(_0x194e4e){if(_0x194e4e){return _0x194e4e?{'count':_0x1308f6,'rows':_0x194e4e}:null;}})['then'](respondWithResult(_0x477164,null))['catch'](handleError(_0x477164,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 174e8e4..cf3af46 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 _0x4ffa=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0x4ffa,0x11c));var _0xa4ff=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4ffa[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0xa4ff('0x0'));var FaxQueue=require(_0xa4ff('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa4ff('0x2')](0x0);var events={'afterCreate':_0xa4ff('0x3'),'afterUpdate':'update','afterDestroy':_0xa4ff('0x4')};function emitEvent(_0x4c46c2){return function(_0x4cba34,_0x413dde,_0x2fd7ee){FaxQueueEvents['emit'](_0x4c46c2+':'+_0x4cba34['id'],_0x4cba34);FaxQueueEvents['emit'](_0x4c46c2,_0x4cba34);_0x2fd7ee(null);};}for(var e in events){if(events[_0xa4ff('0x5')](e)){var event=events[e];FaxQueue[_0xa4ff('0x6')](e,emitEvent(event));}}module[_0xa4ff('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x8fca=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8fca,0xc9));var _0xa8fc=function(_0x8df2d2,_0x590380){_0x8df2d2=_0x8df2d2-0x0;var _0xcdf8f3=_0x8fca[_0x8df2d2];return _0xcdf8f3;};'use strict';var EventEmitter=require(_0xa8fc('0x0'));var FaxQueue=require(_0xa8fc('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa8fc('0x2')};function emitEvent(_0xcd0b38){return function(_0x1dff54,_0x320478,_0x25e840){FaxQueueEvents[_0xa8fc('0x3')](_0xcd0b38+':'+_0x1dff54['id'],_0x1dff54);FaxQueueEvents[_0xa8fc('0x3')](_0xcd0b38,_0x1dff54);_0x25e840(null);};}for(var e in events){if(events[_0xa8fc('0x4')](e)){var event=events[e];FaxQueue[_0xa8fc('0x5')](e,emitEvent(event));}}module[_0xa8fc('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index ef0a6bd..473a09a 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 _0x7a43=['exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxQueue.attributes'];(function(_0x3dcbdd,_0x39a036){var _0x5300fd=function(_0x1a7629){while(--_0x1a7629){_0x3dcbdd['push'](_0x3dcbdd['shift']());}};_0x5300fd(++_0x39a036);}(_0x7a43,0x18a));var _0x37a4=function(_0x382e80,_0x2a5b21){_0x382e80=_0x382e80-0x0;var _0x16dfee=_0x7a43[_0x382e80];return _0x16dfee;};'use strict';var _=require(_0x37a4('0x0'));var util=require(_0x37a4('0x1'));var logger=require(_0x37a4('0x2'))(_0x37a4('0x3'));var moment=require(_0x37a4('0x4'));var BPromise=require(_0x37a4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37a4('0x6'));var rimraf=require(_0x37a4('0x7'));var config=require('../../config/environment');var attributes=require(_0x37a4('0x8'));module[_0x37a4('0x9')]=function(_0x485bfb,_0x422e43){return _0x485bfb[_0x37a4('0xa')](_0x37a4('0xb'),attributes,{'tableName':_0x37a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb45=['FaxQueue','fax_queues','util','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define'];(function(_0x1ff956,_0x5de43f){var _0x179f69=function(_0x301599){while(--_0x301599){_0x1ff956['push'](_0x1ff956['shift']());}};_0x179f69(++_0x5de43f);}(_0xcb45,0xf2));var _0x5cb4=function(_0x1ae9a1,_0x4e075f){_0x1ae9a1=_0x1ae9a1-0x0;var _0x2e7c02=_0xcb45[_0x1ae9a1];return _0x2e7c02;};'use strict';var _=require('lodash');var util=require(_0x5cb4('0x0'));var logger=require('../../config/logger')(_0x5cb4('0x1'));var moment=require(_0x5cb4('0x2'));var BPromise=require(_0x5cb4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5cb4('0x4'));var rimraf=require(_0x5cb4('0x5'));var config=require(_0x5cb4('0x6'));var attributes=require(_0x5cb4('0x7'));module[_0x5cb4('0x8')]=function(_0x1f3e70,_0x193974){return _0x1f3e70[_0x5cb4('0x9')](_0x5cb4('0xa'),attributes,{'tableName':_0x5cb4('0xb'),'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 b36f343..3e38da7 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 _0x2064=['where','limit','include','map','model','attributes','ShowFaxQueue','FaxQueue','find','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFaxQueue','findAll','options','raw'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x2064,0x17a));var _0x4206=function(_0x4d1965,_0x43152e){_0x4d1965=_0x4d1965-0x0;var _0xdcfade=_0x2064[_0x4d1965];return _0xdcfade;};'use strict';var _=require('lodash');var util=require(_0x4206('0x0'));var moment=require(_0x4206('0x1'));var BPromise=require(_0x4206('0x2'));var rs=require(_0x4206('0x3'));var fs=require('fs');var Redis=require(_0x4206('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4206('0x5'))(_0x4206('0x6'));var config=require('../../config/environment');var jayson=require(_0x4206('0x7'));var client=jayson[_0x4206('0x8')][_0x4206('0x9')]({'port':0x232a});config[_0x4206('0xa')]=_[_0x4206('0xb')](config['redis'],{'host':_0x4206('0xc'),'port':0x18eb});var socket=require(_0x4206('0xd'))(new Redis(config[_0x4206('0xa')]));require(_0x4206('0xe'))[_0x4206('0xf')](socket);function respondWithRpcPromise(_0x85751,_0x1c17ed,_0xcfbca){return new BPromise(function(_0x34ed13,_0x3d20b3){return client[_0x4206('0x10')](_0x85751,_0xcfbca)[_0x4206('0x11')](function(_0x2be3b9){logger[_0x4206('0x12')](_0x4206('0x13'),_0x1c17ed,'request\x20sent');logger[_0x4206('0x14')](_0x4206('0x15'),_0x1c17ed,_0x4206('0x16'),JSON[_0x4206('0x17')](_0x2be3b9));if(_0x2be3b9[_0x4206('0x18')]){if(_0x2be3b9[_0x4206('0x18')][_0x4206('0x19')]===0x1f4){logger['error'](_0x4206('0x13'),_0x1c17ed,_0x2be3b9[_0x4206('0x18')][_0x4206('0x1a')]);return _0x3d20b3(_0x2be3b9[_0x4206('0x18')][_0x4206('0x1a')]);}logger[_0x4206('0x18')](_0x4206('0x13'),_0x1c17ed,_0x2be3b9[_0x4206('0x18')][_0x4206('0x1a')]);return _0x34ed13(_0x2be3b9[_0x4206('0x18')][_0x4206('0x1a')]);}else{logger[_0x4206('0x12')]('FaxQueue,\x20%s,\x20%s',_0x1c17ed,_0x4206('0x16'));_0x34ed13(_0x2be3b9['result'][_0x4206('0x1a')]);}})[_0x4206('0x1b')](function(_0x1820e6){logger['error']('FaxQueue,\x20%s,\x20%s',_0x1c17ed,_0x1820e6);_0x3d20b3(_0x1820e6);});});}exports[_0x4206('0x1c')]=function(_0x5605a2){var _0xd1bcd6=this;return new Promise(function(_0x367bfe,_0x5a3f5e){return db['FaxQueue'][_0x4206('0x1d')]({'raw':_0x5605a2[_0x4206('0x1e')]?_0x5605a2[_0x4206('0x1e')][_0x4206('0x1f')]===undefined?!![]:![]:!![],'where':_0x5605a2[_0x4206('0x1e')]?_0x5605a2[_0x4206('0x1e')][_0x4206('0x20')]||null:null,'attributes':_0x5605a2['options']?_0x5605a2[_0x4206('0x1e')]['attributes']||null:null,'limit':_0x5605a2[_0x4206('0x1e')]?_0x5605a2[_0x4206('0x1e')][_0x4206('0x21')]||null:null,'include':_0x5605a2[_0x4206('0x1e')]?_0x5605a2[_0x4206('0x1e')][_0x4206('0x22')]?_[_0x4206('0x23')](_0x5605a2[_0x4206('0x1e')][_0x4206('0x22')],function(_0x5d7073){return{'model':db[_0x5d7073[_0x4206('0x24')]],'as':_0x5d7073['as'],'attributes':_0x5d7073[_0x4206('0x25')],'include':_0x5d7073[_0x4206('0x22')]?_['map'](_0x5d7073[_0x4206('0x22')],function(_0xbc6e87){return{'model':db[_0xbc6e87[_0x4206('0x24')]],'as':_0xbc6e87['as'],'attributes':_0xbc6e87[_0x4206('0x25')],'include':_0xbc6e87[_0x4206('0x22')]?_[_0x4206('0x23')](_0xbc6e87[_0x4206('0x22')],function(_0x41aa04){return{'model':db[_0x41aa04[_0x4206('0x24')]],'as':_0x41aa04['as'],'attributes':_0x41aa04[_0x4206('0x25')]};}):[]};}):[]};}):[]:[]})[_0x4206('0x11')](function(_0x5ca1c4){logger[_0x4206('0x12')](_0x4206('0x1c'),_0x5605a2);logger[_0x4206('0x14')]('GetFaxQueue',_0x5605a2,JSON['stringify'](_0x5ca1c4));_0x367bfe(_0x5ca1c4);})[_0x4206('0x1b')](function(_0x21cc59){logger[_0x4206('0x18')]('GetFaxQueue',_0x21cc59[_0x4206('0x1a')],_0x5605a2);_0x5a3f5e(_0xd1bcd6[_0x4206('0x18')](0x1f4,_0x21cc59['message']));});});};exports[_0x4206('0x26')]=function(_0x36f295){var _0x10084a=this;return new Promise(function(_0x2e20b9,_0x508a7c){return db[_0x4206('0x27')][_0x4206('0x28')]({'raw':_0x36f295[_0x4206('0x1e')]?_0x36f295[_0x4206('0x1e')][_0x4206('0x1f')]===undefined?!![]:![]:!![],'where':_0x36f295[_0x4206('0x1e')]?_0x36f295[_0x4206('0x1e')][_0x4206('0x20')]||null:null,'attributes':_0x36f295[_0x4206('0x1e')]?_0x36f295[_0x4206('0x1e')]['attributes']||null:null,'include':_0x36f295['options']?_0x36f295['options'][_0x4206('0x22')]?_[_0x4206('0x23')](_0x36f295['options'][_0x4206('0x22')],function(_0x3677a8){return{'model':db[_0x3677a8['model']],'as':_0x3677a8['as'],'attributes':_0x3677a8[_0x4206('0x25')],'include':_0x3677a8['include']?_['map'](_0x3677a8[_0x4206('0x22')],function(_0x9db24e){return{'model':db[_0x9db24e[_0x4206('0x24')]],'as':_0x9db24e['as'],'attributes':_0x9db24e['attributes'],'include':_0x9db24e[_0x4206('0x22')]?_[_0x4206('0x23')](_0x9db24e[_0x4206('0x22')],function(_0x3ea835){return{'model':db[_0x3ea835[_0x4206('0x24')]],'as':_0x3ea835['as'],'attributes':_0x3ea835['attributes']};}):[]};}):[]};}):[]:[]})[_0x4206('0x11')](function(_0x188aaf){logger['info'](_0x4206('0x26'),_0x36f295);logger[_0x4206('0x14')](_0x4206('0x26'),_0x36f295,JSON[_0x4206('0x17')](_0x188aaf));_0x2e20b9(_0x188aaf);})[_0x4206('0x1b')](function(_0xa153cf){logger[_0x4206('0x18')](_0x4206('0x26'),_0xa153cf[_0x4206('0x1a')],_0x36f295);_0x508a7c(_0x10084a[_0x4206('0x18')](0x1f4,_0xa153cf[_0x4206('0x1a')]));});});}; \ No newline at end of file +var _0xe766=['redis','defaults','localhost','./faxQueue.socket','request','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','options','raw','attributes','limit','include','map','then','debug','ShowFaxQueue','find','where','model','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x148b06,_0x375597){var _0x222dbf=function(_0x5e8b5d){while(--_0x5e8b5d){_0x148b06['push'](_0x148b06['shift']());}};_0x222dbf(++_0x375597);}(_0xe766,0xb8));var _0x6e76=function(_0x852450,_0xd2456e){_0x852450=_0x852450-0x0;var _0x329404=_0xe766[_0x852450];return _0x329404;};'use strict';var _=require(_0x6e76('0x0'));var util=require('util');var moment=require(_0x6e76('0x1'));var BPromise=require(_0x6e76('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e76('0x3'));var db=require(_0x6e76('0x4'))['db'];var utils=require(_0x6e76('0x5'));var logger=require(_0x6e76('0x6'))(_0x6e76('0x7'));var config=require(_0x6e76('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6e76('0x9')][_0x6e76('0xa')]({'port':0x232a});config[_0x6e76('0xb')]=_[_0x6e76('0xc')](config['redis'],{'host':_0x6e76('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6e76('0xb')]));require(_0x6e76('0xe'))['register'](socket);function respondWithRpcPromise(_0x1ab63c,_0x166337,_0x48371e){return new BPromise(function(_0x3c1ea7,_0x177e03){return client[_0x6e76('0xf')](_0x1ab63c,_0x48371e)['then'](function(_0x58e58b){logger[_0x6e76('0x10')](_0x6e76('0x11'),_0x166337,_0x6e76('0x12'));logger['debug'](_0x6e76('0x13'),_0x166337,_0x6e76('0x12'),JSON[_0x6e76('0x14')](_0x58e58b));if(_0x58e58b[_0x6e76('0x15')]){if(_0x58e58b['error'][_0x6e76('0x16')]===0x1f4){logger[_0x6e76('0x15')](_0x6e76('0x11'),_0x166337,_0x58e58b[_0x6e76('0x15')][_0x6e76('0x17')]);return _0x177e03(_0x58e58b['error']['message']);}logger[_0x6e76('0x15')]('FaxQueue,\x20%s,\x20%s',_0x166337,_0x58e58b[_0x6e76('0x15')]['message']);return _0x3c1ea7(_0x58e58b[_0x6e76('0x15')][_0x6e76('0x17')]);}else{logger[_0x6e76('0x10')](_0x6e76('0x11'),_0x166337,_0x6e76('0x12'));_0x3c1ea7(_0x58e58b['result'][_0x6e76('0x17')]);}})[_0x6e76('0x18')](function(_0x2c8e9b){logger[_0x6e76('0x15')](_0x6e76('0x11'),_0x166337,_0x2c8e9b);_0x177e03(_0x2c8e9b);});});}exports[_0x6e76('0x19')]=function(_0x1b40cc){var _0x265bc7=this;return new Promise(function(_0x124c71,_0x4c7359){return db[_0x6e76('0x1a')]['findAll']({'raw':_0x1b40cc[_0x6e76('0x1b')]?_0x1b40cc['options'][_0x6e76('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b40cc[_0x6e76('0x1b')]?_0x1b40cc['options']['where']||null:null,'attributes':_0x1b40cc['options']?_0x1b40cc[_0x6e76('0x1b')][_0x6e76('0x1d')]||null:null,'limit':_0x1b40cc['options']?_0x1b40cc['options'][_0x6e76('0x1e')]||null:null,'include':_0x1b40cc['options']?_0x1b40cc[_0x6e76('0x1b')][_0x6e76('0x1f')]?_[_0x6e76('0x20')](_0x1b40cc[_0x6e76('0x1b')]['include'],function(_0x514359){return{'model':db[_0x514359['model']],'as':_0x514359['as'],'attributes':_0x514359[_0x6e76('0x1d')],'include':_0x514359[_0x6e76('0x1f')]?_[_0x6e76('0x20')](_0x514359[_0x6e76('0x1f')],function(_0x456905){return{'model':db[_0x456905['model']],'as':_0x456905['as'],'attributes':_0x456905[_0x6e76('0x1d')],'include':_0x456905[_0x6e76('0x1f')]?_[_0x6e76('0x20')](_0x456905[_0x6e76('0x1f')],function(_0x1f470b){return{'model':db[_0x1f470b['model']],'as':_0x1f470b['as'],'attributes':_0x1f470b[_0x6e76('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6e76('0x21')](function(_0x45b137){logger[_0x6e76('0x10')]('GetFaxQueue',_0x1b40cc);logger[_0x6e76('0x22')](_0x6e76('0x19'),_0x1b40cc,JSON[_0x6e76('0x14')](_0x45b137));_0x124c71(_0x45b137);})[_0x6e76('0x18')](function(_0x5a88af){logger['error'](_0x6e76('0x19'),_0x5a88af['message'],_0x1b40cc);_0x4c7359(_0x265bc7[_0x6e76('0x15')](0x1f4,_0x5a88af[_0x6e76('0x17')]));});});};exports[_0x6e76('0x23')]=function(_0x203f34){var _0x5a1119=this;return new Promise(function(_0x4e6a79,_0x10182d){return db[_0x6e76('0x1a')][_0x6e76('0x24')]({'raw':_0x203f34[_0x6e76('0x1b')]?_0x203f34[_0x6e76('0x1b')][_0x6e76('0x1c')]===undefined?!![]:![]:!![],'where':_0x203f34[_0x6e76('0x1b')]?_0x203f34[_0x6e76('0x1b')][_0x6e76('0x25')]||null:null,'attributes':_0x203f34['options']?_0x203f34[_0x6e76('0x1b')][_0x6e76('0x1d')]||null:null,'include':_0x203f34[_0x6e76('0x1b')]?_0x203f34[_0x6e76('0x1b')][_0x6e76('0x1f')]?_[_0x6e76('0x20')](_0x203f34[_0x6e76('0x1b')]['include'],function(_0x259d4f){return{'model':db[_0x259d4f[_0x6e76('0x26')]],'as':_0x259d4f['as'],'attributes':_0x259d4f[_0x6e76('0x1d')],'include':_0x259d4f[_0x6e76('0x1f')]?_[_0x6e76('0x20')](_0x259d4f['include'],function(_0x517136){return{'model':db[_0x517136[_0x6e76('0x26')]],'as':_0x517136['as'],'attributes':_0x517136[_0x6e76('0x1d')],'include':_0x517136[_0x6e76('0x1f')]?_[_0x6e76('0x20')](_0x517136[_0x6e76('0x1f')],function(_0x466193){return{'model':db[_0x466193['model']],'as':_0x466193['as'],'attributes':_0x466193[_0x6e76('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5738e0){logger[_0x6e76('0x10')](_0x6e76('0x23'),_0x203f34);logger['debug'](_0x6e76('0x23'),_0x203f34,JSON[_0x6e76('0x14')](_0x5738e0));_0x4e6a79(_0x5738e0);})[_0x6e76('0x18')](function(_0x23895e){logger[_0x6e76('0x15')](_0x6e76('0x23'),_0x23895e[_0x6e76('0x17')],_0x203f34);_0x10182d(_0x5a1119[_0x6e76('0x15')](0x1f4,_0x23895e[_0x6e76('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 82099c3..69205ea 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 _0x3bb5=['faxQueue:','./faxQueue.events','save','remove','emit','removeListener'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x3bb5,0x1e7));var _0x53bb=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x3bb5[_0x565ed7];return _0x183ad7;};'use strict';var FaxQueueEvents=require(_0x53bb('0x0'));var events=[_0x53bb('0x1'),_0x53bb('0x2'),'update'];function createListener(_0x54d1c0,_0x36b35a){return function(_0x4b4e99){_0x36b35a[_0x53bb('0x3')](_0x54d1c0,_0x4b4e99);};}function removeListener(_0x25589e,_0x59cc59){return function(){FaxQueueEvents[_0x53bb('0x4')](_0x25589e,_0x59cc59);};}exports['register']=function(_0x39bc56){for(var _0x77478f=0x0,_0x29a78b=events['length'];_0x77478f<_0x29a78b;_0x77478f++){var _0x5e6399=events[_0x77478f];var _0x33afc4=createListener(_0x53bb('0x5')+_0x5e6399,_0x39bc56);FaxQueueEvents['on'](_0x5e6399,_0x33afc4);}}; \ No newline at end of file +var _0x488b=['update','emit','removeListener','register','length','faxQueue:','./faxQueue.events','save'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x488b,0x156));var _0xb488=function(_0x46515d,_0x1d4e46){_0x46515d=_0x46515d-0x0;var _0x4f3da1=_0x488b[_0x46515d];return _0x4f3da1;};'use strict';var FaxQueueEvents=require(_0xb488('0x0'));var events=[_0xb488('0x1'),'remove',_0xb488('0x2')];function createListener(_0x2b4158,_0x230706){return function(_0x5cfc03){_0x230706[_0xb488('0x3')](_0x2b4158,_0x5cfc03);};}function removeListener(_0x3dfdc3,_0x451de3){return function(){FaxQueueEvents[_0xb488('0x4')](_0x3dfdc3,_0x451de3);};}exports[_0xb488('0x5')]=function(_0x15dab2){for(var _0x3d8417=0x0,_0xeae3d5=events[_0xb488('0x6')];_0x3d8417<_0xeae3d5;_0x3d8417++){var _0x37c3b4=events[_0x3d8417];var _0x43d69a=createListener(_0xb488('0x7')+_0x37c3b4,_0x15dab2);FaxQueueEvents['on'](_0x37c3b4,_0x43d69a);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 39fe668..ce8a4b2 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 _0x0b0e=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','destroy','delete','removeTeams','removeAgents','multer'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0x0b0e,0x187));var _0xe0b0=function(_0x422be2,_0x1c439e){_0x422be2=_0x422be2-0x0;var _0x1b820e=_0x0b0e[_0x422be2];return _0x1b820e;};'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 auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['get'](_0xe0b0('0xe'),auth[_0xe0b0('0x9')](),controller['getMembers']);router[_0xe0b0('0x8')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x8')](_0xe0b0('0x11'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')]('/:id/teams',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x15')]);router[_0xe0b0('0x13')](_0xe0b0('0x11'),auth[_0xe0b0('0x9')](),controller['addAgents']);router[_0xe0b0('0x16')]('/:id',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x17')]);router['delete'](_0xe0b0('0xc'),auth['isAuthenticated'](),controller[_0xe0b0('0x18')]);router[_0xe0b0('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe0b0('0x1a')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xe0b0('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xd8b0=['util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','index','get','/describe','describe','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','/:id','update','delete','destroy','removeTeams','exports','multer'];(function(_0x6847c1,_0x2b81d1){var _0xf6d22d=function(_0x195568){while(--_0x195568){_0x6847c1['push'](_0x6847c1['shift']());}};_0xf6d22d(++_0x2b81d1);}(_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 auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['get'](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x13')]('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x13')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);router[_0x0d8b('0x13')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x16')]);router['put'](_0x0d8b('0x17'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x18')]);router[_0x0d8b('0x19')](_0x0d8b('0x17'),auth['isAuthenticated'](),controller[_0x0d8b('0x1a')]);router[_0x0d8b('0x19')](_0x0d8b('0xf'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x1b')]);router[_0x0d8b('0x19')](_0x0d8b('0x11'),auth[_0x0d8b('0xb')](),controller['removeAgents']);module[_0x0d8b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 66c137d..03e6a72 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 _0x5554=['DATE','exports','STRING'];(function(_0x1dbbe2,_0x4bc53a){var _0x378917=function(_0x29547c){while(--_0x29547c){_0x1dbbe2['push'](_0x1dbbe2['shift']());}};_0x378917(++_0x4bc53a);}(_0x5554,0x1db));var _0x4555=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5554[_0x4243a3];return _0x1b2a33;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x4555('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x4555('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4555('0x2')]},'acceptAt':{'type':Sequelize[_0x4555('0x2')]},'exitAt':{'type':Sequelize[_0x4555('0x2')]},'reason':{'type':Sequelize[_0x4555('0x1')]}}; \ No newline at end of file +var _0x4c51=['sequelize','exports','STRING','DATE','moment'];(function(_0x1b0307,_0x4336b1){var _0x5c8d34=function(_0x5b1b61){while(--_0x5b1b61){_0x1b0307['push'](_0x1b0307['shift']());}};_0x5c8d34(++_0x4336b1);}(_0x4c51,0xea));var _0x14c5=function(_0x2a38e4,_0xadcba5){_0x2a38e4=_0x2a38e4-0x0;var _0x49ed4b=_0x4c51[_0x2a38e4];return _0x49ed4b;};'use strict';var moment=require(_0x14c5('0x0'));var Sequelize=require(_0x14c5('0x1'));module[_0x14c5('0x2')]={'uniqueid':{'type':Sequelize[_0x14c5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x14c5('0x3')]},'joinAt':{'type':Sequelize[_0x14c5('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x14c5('0x4')]},'exitAt':{'type':Sequelize[_0x14c5('0x4')]},'reason':{'type':Sequelize[_0x14c5('0x3')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 366a5ff..1a50089 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 _0x1c99=['save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FaxQueueReport','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject'];(function(_0x35e3b8,_0x1f543f){var _0xae5b9a=function(_0x483dd6){while(--_0x483dd6){_0x35e3b8['push'](_0x35e3b8['shift']());}};_0xae5b9a(++_0x1f543f);}(_0x1c99,0x1ab));var _0x91c9=function(_0x3ccdf8,_0x584ceb){_0x3ccdf8=_0x3ccdf8-0x0;var _0x243dab=_0x1c99[_0x3ccdf8];return _0x243dab;};'use strict';var pdf=require(_0x91c9('0x0'));var emlformat=require(_0x91c9('0x1'));var rimraf=require(_0x91c9('0x2'));var zipdir=require(_0x91c9('0x3'));var jsonpatch=require(_0x91c9('0x4'));var rp=require(_0x91c9('0x5'));var moment=require(_0x91c9('0x6'));var BPromise=require(_0x91c9('0x7'));var Mustache=require(_0x91c9('0x8'));var util=require(_0x91c9('0x9'));var path=require(_0x91c9('0xa'));var sox=require(_0x91c9('0xb'));var csv=require(_0x91c9('0xc'));var ejs=require(_0x91c9('0xd'));var fs=require('fs');var _=require(_0x91c9('0xe'));var squel=require(_0x91c9('0xf'));var crypto=require('crypto');var jsforce=require(_0x91c9('0x10'));var deskjs=require(_0x91c9('0x11'));var toCsv=require(_0x91c9('0xc'));var querystring=require(_0x91c9('0x12'));var Papa=require(_0x91c9('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x91c9('0x14'));var logger=require(_0x91c9('0x15'))(_0x91c9('0x16'));var utils=require(_0x91c9('0x17'));var config=require(_0x91c9('0x18'));var db=require(_0x91c9('0x19'))['db'];function respondWithStatusCode(_0x2a1fb0,_0x5d8923){_0x5d8923=_0x5d8923||0xcc;return function(_0x10dd6e){if(_0x10dd6e){return _0x2a1fb0['sendStatus'](_0x5d8923);}return _0x2a1fb0[_0x91c9('0x1a')](_0x5d8923)[_0x91c9('0x1b')]();};}function respondWithResult(_0x3846ce,_0x1f1a6c){_0x1f1a6c=_0x1f1a6c||0xc8;return function(_0x55be9d){if(_0x55be9d){return _0x3846ce[_0x91c9('0x1a')](_0x1f1a6c)[_0x91c9('0x1c')](_0x55be9d);}};}function respondWithFilteredResult(_0x2742b0,_0x186104){return function(_0x25cfb5){if(_0x25cfb5){var _0x140960=_0x25cfb5[_0x91c9('0x1d')],_0x4a3bb3=_0x186104[_0x91c9('0x1e')],_0x32278b=_0x186104[_0x91c9('0x1e')]+_0x186104[_0x91c9('0x1f')],_0x158c04;if(_0x32278b>=_0x140960){_0x32278b=_0x140960;_0x158c04=0xc8;}else{_0x158c04=0xce;}_0x2742b0[_0x91c9('0x1a')](_0x158c04);return _0x2742b0[_0x91c9('0x20')]('Content-Range',_0x4a3bb3+'-'+_0x32278b+'/'+_0x140960)[_0x91c9('0x1c')](_0x25cfb5);}return null;};}function patchUpdates(_0x1caf01){return function(_0x140877){try{jsonpatch[_0x91c9('0x21')](_0x140877,_0x1caf01,!![]);}catch(_0x275a5a){return BPromise[_0x91c9('0x22')](_0x275a5a);}return _0x140877[_0x91c9('0x23')]();};}function saveUpdates(_0x2f5875,_0x121b8f){return function(_0x8a1c50){if(_0x8a1c50){return _0x8a1c50[_0x91c9('0x24')](_0x2f5875)[_0x91c9('0x25')](function(_0x476fe4){return _0x476fe4;});}return null;};}function removeEntity(_0x1dbe54,_0x3db44a){return function(_0x48f0da){if(_0x48f0da){return _0x48f0da[_0x91c9('0x26')]()[_0x91c9('0x25')](function(){_0x1dbe54['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2166ee,_0x1e5e5f){return function(_0x1efca8){if(!_0x1efca8){_0x2166ee[_0x91c9('0x27')](0x194);}return _0x1efca8;};}function handleError(_0x20b117,_0x522214){_0x522214=_0x522214||0x1f4;return function(_0x3f9dbd){logger[_0x91c9('0x28')](_0x3f9dbd[_0x91c9('0x29')]);if(_0x3f9dbd['name']){delete _0x3f9dbd[_0x91c9('0x2a')];}_0x20b117[_0x91c9('0x1a')](_0x522214)[_0x91c9('0x2b')](_0x3f9dbd);};}exports[_0x91c9('0x2c')]=function(_0x253af7,_0x5444f4){var _0x4e8801={},_0x27e946={},_0x4e2c20={'count':0x0,'rows':[]};var _0x31af96=_[_0x91c9('0x2d')](db[_0x91c9('0x2e')]['rawAttributes'],function(_0x4112da){return{'name':_0x4112da['fieldName'],'type':_0x4112da['type'][_0x91c9('0x2f')]};});_0x27e946[_0x91c9('0x30')]=_[_0x91c9('0x2d')](_0x31af96,_0x91c9('0x2a'));_0x27e946[_0x91c9('0x31')]=_['keys'](_0x253af7[_0x91c9('0x31')]);_0x27e946[_0x91c9('0x32')]=_[_0x91c9('0x33')](_0x27e946[_0x91c9('0x30')],_0x27e946[_0x91c9('0x31')]);_0x4e8801[_0x91c9('0x34')]=_[_0x91c9('0x33')](_0x27e946['model'],qs[_0x91c9('0x35')](_0x253af7['query'][_0x91c9('0x35')]));_0x4e8801['attributes']=_0x4e8801[_0x91c9('0x34')][_0x91c9('0x36')]?_0x4e8801['attributes']:_0x27e946[_0x91c9('0x30')];if(!_0x253af7[_0x91c9('0x31')][_0x91c9('0x37')](_0x91c9('0x38'))){_0x4e8801[_0x91c9('0x1f')]=qs[_0x91c9('0x1f')](_0x253af7[_0x91c9('0x31')][_0x91c9('0x1f')]);_0x4e8801['offset']=qs[_0x91c9('0x1e')](_0x253af7['query'][_0x91c9('0x1e')]);}_0x4e8801[_0x91c9('0x39')]=qs['sort'](_0x253af7['query'][_0x91c9('0x3a')]);_0x4e8801[_0x91c9('0x3b')]=qs[_0x91c9('0x32')](_[_0x91c9('0x3c')](_0x253af7[_0x91c9('0x31')],_0x27e946[_0x91c9('0x32')]),_0x31af96);if(_0x253af7[_0x91c9('0x31')]['filter']){_0x4e8801[_0x91c9('0x3b')]=_[_0x91c9('0x3d')](_0x4e8801[_0x91c9('0x3b')],{'$or':_[_0x91c9('0x2d')](_0x31af96,function(_0x2c5a2e){if(_0x2c5a2e[_0x91c9('0x3e')]!==_0x91c9('0x3f')){var _0x35ba70={};_0x35ba70[_0x2c5a2e[_0x91c9('0x2a')]]={'$like':'%'+_0x253af7[_0x91c9('0x31')]['filter']+'%'};return _0x35ba70;}})});}_0x4e8801=_['merge']({},_0x4e8801,_0x253af7[_0x91c9('0x40')]);var _0x59edbc={'where':_0x4e8801['where']};return db['FaxQueueReport'][_0x91c9('0x1d')](_0x59edbc)['then'](function(_0x7d22bf){_0x4e2c20[_0x91c9('0x1d')]=_0x7d22bf;if(_0x253af7['query'][_0x91c9('0x41')]){_0x4e8801['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x91c9('0x42')](_0x4e8801);})[_0x91c9('0x25')](function(_0x16191f){_0x4e2c20[_0x91c9('0x43')]=_0x16191f;return _0x4e2c20;})[_0x91c9('0x25')](respondWithFilteredResult(_0x5444f4,_0x4e8801))[_0x91c9('0x44')](handleError(_0x5444f4,null));};exports[_0x91c9('0x45')]=function(_0x58342b,_0x5e97a3){var _0x5a90a8={'raw':!![],'where':{'id':_0x58342b['params']['id']}},_0x34c233={};_0x34c233[_0x91c9('0x30')]=_[_0x91c9('0x46')](db[_0x91c9('0x2e')]['rawAttributes']);_0x34c233[_0x91c9('0x31')]=_[_0x91c9('0x46')](_0x58342b[_0x91c9('0x31')]);_0x34c233[_0x91c9('0x32')]=_[_0x91c9('0x33')](_0x34c233[_0x91c9('0x30')],_0x34c233['query']);_0x5a90a8[_0x91c9('0x34')]=_[_0x91c9('0x33')](_0x34c233[_0x91c9('0x30')],qs[_0x91c9('0x35')](_0x58342b[_0x91c9('0x31')][_0x91c9('0x35')]));_0x5a90a8[_0x91c9('0x34')]=_0x5a90a8[_0x91c9('0x34')][_0x91c9('0x36')]?_0x5a90a8[_0x91c9('0x34')]:_0x34c233[_0x91c9('0x30')];if(_0x58342b[_0x91c9('0x31')][_0x91c9('0x41')]){_0x5a90a8[_0x91c9('0x47')]=[{'all':!![]}];}_0x5a90a8=_[_0x91c9('0x3d')]({},_0x5a90a8,_0x58342b[_0x91c9('0x40')]);return db[_0x91c9('0x2e')][_0x91c9('0x48')](_0x5a90a8)['then'](handleEntityNotFound(_0x5e97a3,null))[_0x91c9('0x25')](respondWithResult(_0x5e97a3,null))[_0x91c9('0x44')](handleError(_0x5e97a3,null));};exports[_0x91c9('0x49')]=function(_0x57a9e5,_0xd5cb1){return db['FaxQueueReport'][_0x91c9('0x49')](_0x57a9e5['body'],{})['then'](respondWithResult(_0xd5cb1,0xc9))[_0x91c9('0x44')](handleError(_0xd5cb1,null));};exports[_0x91c9('0x24')]=function(_0x5778e6,_0x189df6){if(_0x5778e6[_0x91c9('0x4a')]['id']){delete _0x5778e6['body']['id'];}return db[_0x91c9('0x2e')]['find']({'where':{'id':_0x5778e6[_0x91c9('0x4b')]['id']}})[_0x91c9('0x25')](handleEntityNotFound(_0x189df6,null))[_0x91c9('0x25')](saveUpdates(_0x5778e6[_0x91c9('0x4a')],null))[_0x91c9('0x25')](respondWithResult(_0x189df6,null))[_0x91c9('0x44')](handleError(_0x189df6,null));};exports[_0x91c9('0x26')]=function(_0x39182f,_0x424c44){return db[_0x91c9('0x2e')][_0x91c9('0x48')]({'where':{'id':_0x39182f[_0x91c9('0x4b')]['id']}})[_0x91c9('0x25')](handleEntityNotFound(_0x424c44,null))[_0x91c9('0x25')](removeEntity(_0x424c44,null))[_0x91c9('0x44')](handleError(_0x424c44,null));};exports['describe']=function(_0x1357c6,_0x35e2e1){return db[_0x91c9('0x2e')][_0x91c9('0x4c')]()[_0x91c9('0x25')](respondWithResult(_0x35e2e1,null))[_0x91c9('0x44')](handleError(_0x35e2e1,null));}; \ No newline at end of file +var _0xa6a3=['reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','where','pick','filters','merge','filter','options','includeAll','include','findAll','show','find','create','body','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply'];(function(_0x2bc57e,_0xd450d7){var _0x5561fb=function(_0x3b84d7){while(--_0x3b84d7){_0x2bc57e['push'](_0x2bc57e['shift']());}};_0x5561fb(++_0xd450d7);}(_0xa6a3,0x103));var _0x3a6a=function(_0x3c3e72,_0x3e1858){_0x3c3e72=_0x3c3e72-0x0;var _0x48a7e5=_0xa6a3[_0x3c3e72];return _0x48a7e5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3a6a('0x0'));var rimraf=require(_0x3a6a('0x1'));var zipdir=require(_0x3a6a('0x2'));var jsonpatch=require(_0x3a6a('0x3'));var rp=require(_0x3a6a('0x4'));var moment=require(_0x3a6a('0x5'));var BPromise=require(_0x3a6a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3a6a('0x7'));var sox=require(_0x3a6a('0x8'));var csv=require(_0x3a6a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3a6a('0xa'));var squel=require(_0x3a6a('0xb'));var crypto=require(_0x3a6a('0xc'));var jsforce=require(_0x3a6a('0xd'));var deskjs=require(_0x3a6a('0xe'));var toCsv=require(_0x3a6a('0x9'));var querystring=require(_0x3a6a('0xf'));var Papa=require(_0x3a6a('0x10'));var Redis=require(_0x3a6a('0x11'));var authService=require(_0x3a6a('0x12'));var qs=require(_0x3a6a('0x13'));var as=require(_0x3a6a('0x14'));var hardwareService=require(_0x3a6a('0x15'));var logger=require('../../config/logger')(_0x3a6a('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3a6a('0x17'))['db'];function respondWithStatusCode(_0x2bc815,_0x172426){_0x172426=_0x172426||0xcc;return function(_0x36f324){if(_0x36f324){return _0x2bc815['sendStatus'](_0x172426);}return _0x2bc815['status'](_0x172426)[_0x3a6a('0x18')]();};}function respondWithResult(_0x806cd3,_0x31b188){_0x31b188=_0x31b188||0xc8;return function(_0x29cb28){if(_0x29cb28){return _0x806cd3[_0x3a6a('0x19')](_0x31b188)[_0x3a6a('0x1a')](_0x29cb28);}};}function respondWithFilteredResult(_0x287aa0,_0x271bb0){return function(_0x3a02bf){if(_0x3a02bf){var _0x1a0e1e=_0x3a02bf[_0x3a6a('0x1b')],_0xbfd619=_0x271bb0[_0x3a6a('0x1c')],_0x367623=_0x271bb0[_0x3a6a('0x1c')]+_0x271bb0[_0x3a6a('0x1d')],_0x36bfec;if(_0x367623>=_0x1a0e1e){_0x367623=_0x1a0e1e;_0x36bfec=0xc8;}else{_0x36bfec=0xce;}_0x287aa0[_0x3a6a('0x19')](_0x36bfec);return _0x287aa0[_0x3a6a('0x1e')](_0x3a6a('0x1f'),_0xbfd619+'-'+_0x367623+'/'+_0x1a0e1e)[_0x3a6a('0x1a')](_0x3a02bf);}return null;};}function patchUpdates(_0x41e079){return function(_0x279dfc){try{jsonpatch[_0x3a6a('0x20')](_0x279dfc,_0x41e079,!![]);}catch(_0x3f0d89){return BPromise[_0x3a6a('0x21')](_0x3f0d89);}return _0x279dfc[_0x3a6a('0x22')]();};}function saveUpdates(_0x216586,_0x443124){return function(_0x5e615e){if(_0x5e615e){return _0x5e615e[_0x3a6a('0x23')](_0x216586)[_0x3a6a('0x24')](function(_0x2aba8d){return _0x2aba8d;});}return null;};}function removeEntity(_0x254a20,_0xed4e3f){return function(_0x4b9932){if(_0x4b9932){return _0x4b9932[_0x3a6a('0x25')]()[_0x3a6a('0x24')](function(){_0x254a20['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eb819,_0x169ad7){return function(_0x2a73a1){if(!_0x2a73a1){_0x4eb819[_0x3a6a('0x26')](0x194);}return _0x2a73a1;};}function handleError(_0x553d82,_0x552321){_0x552321=_0x552321||0x1f4;return function(_0x2e60d2){logger[_0x3a6a('0x27')](_0x2e60d2[_0x3a6a('0x28')]);if(_0x2e60d2[_0x3a6a('0x29')]){delete _0x2e60d2[_0x3a6a('0x29')];}_0x553d82['status'](_0x552321)[_0x3a6a('0x2a')](_0x2e60d2);};}exports[_0x3a6a('0x2b')]=function(_0x556c1e,_0x1b4b3a){var _0x160e65={},_0x5607d4={},_0x234d62={'count':0x0,'rows':[]};var _0x3a3457=_[_0x3a6a('0x2c')](db[_0x3a6a('0x2d')][_0x3a6a('0x2e')],function(_0x3f0f00){return{'name':_0x3f0f00[_0x3a6a('0x2f')],'type':_0x3f0f00[_0x3a6a('0x30')][_0x3a6a('0x31')]};});_0x5607d4[_0x3a6a('0x32')]=_[_0x3a6a('0x2c')](_0x3a3457,_0x3a6a('0x29'));_0x5607d4[_0x3a6a('0x33')]=_[_0x3a6a('0x34')](_0x556c1e[_0x3a6a('0x33')]);_0x5607d4['filters']=_[_0x3a6a('0x35')](_0x5607d4[_0x3a6a('0x32')],_0x5607d4['query']);_0x160e65[_0x3a6a('0x36')]=_[_0x3a6a('0x35')](_0x5607d4[_0x3a6a('0x32')],qs[_0x3a6a('0x37')](_0x556c1e[_0x3a6a('0x33')][_0x3a6a('0x37')]));_0x160e65[_0x3a6a('0x36')]=_0x160e65['attributes']['length']?_0x160e65[_0x3a6a('0x36')]:_0x5607d4['model'];if(!_0x556c1e[_0x3a6a('0x33')][_0x3a6a('0x38')]('nolimit')){_0x160e65[_0x3a6a('0x1d')]=qs[_0x3a6a('0x1d')](_0x556c1e[_0x3a6a('0x33')][_0x3a6a('0x1d')]);_0x160e65['offset']=qs['offset'](_0x556c1e['query'][_0x3a6a('0x1c')]);}_0x160e65[_0x3a6a('0x39')]=qs['sort'](_0x556c1e['query']['sort']);_0x160e65[_0x3a6a('0x3a')]=qs['filters'](_[_0x3a6a('0x3b')](_0x556c1e[_0x3a6a('0x33')],_0x5607d4[_0x3a6a('0x3c')]),_0x3a3457);if(_0x556c1e[_0x3a6a('0x33')]['filter']){_0x160e65[_0x3a6a('0x3a')]=_[_0x3a6a('0x3d')](_0x160e65[_0x3a6a('0x3a')],{'$or':_[_0x3a6a('0x2c')](_0x3a3457,function(_0x48c954){if(_0x48c954[_0x3a6a('0x30')]!=='VIRTUAL'){var _0x52b9ae={};_0x52b9ae[_0x48c954[_0x3a6a('0x29')]]={'$like':'%'+_0x556c1e[_0x3a6a('0x33')][_0x3a6a('0x3e')]+'%'};return _0x52b9ae;}})});}_0x160e65=_['merge']({},_0x160e65,_0x556c1e[_0x3a6a('0x3f')]);var _0x135873={'where':_0x160e65[_0x3a6a('0x3a')]};return db[_0x3a6a('0x2d')][_0x3a6a('0x1b')](_0x135873)['then'](function(_0x9f6d75){_0x234d62[_0x3a6a('0x1b')]=_0x9f6d75;if(_0x556c1e[_0x3a6a('0x33')][_0x3a6a('0x40')]){_0x160e65[_0x3a6a('0x41')]=[{'all':!![]}];}return db[_0x3a6a('0x2d')][_0x3a6a('0x42')](_0x160e65);})[_0x3a6a('0x24')](function(_0x44c246){_0x234d62['rows']=_0x44c246;return _0x234d62;})[_0x3a6a('0x24')](respondWithFilteredResult(_0x1b4b3a,_0x160e65))['catch'](handleError(_0x1b4b3a,null));};exports[_0x3a6a('0x43')]=function(_0x397eb5,_0x1f4aeb){var _0x255378={'raw':!![],'where':{'id':_0x397eb5['params']['id']}},_0x556830={};_0x556830[_0x3a6a('0x32')]=_[_0x3a6a('0x34')](db[_0x3a6a('0x2d')][_0x3a6a('0x2e')]);_0x556830['query']=_[_0x3a6a('0x34')](_0x397eb5[_0x3a6a('0x33')]);_0x556830['filters']=_[_0x3a6a('0x35')](_0x556830[_0x3a6a('0x32')],_0x556830[_0x3a6a('0x33')]);_0x255378['attributes']=_[_0x3a6a('0x35')](_0x556830[_0x3a6a('0x32')],qs[_0x3a6a('0x37')](_0x397eb5[_0x3a6a('0x33')]['fields']));_0x255378['attributes']=_0x255378[_0x3a6a('0x36')]['length']?_0x255378[_0x3a6a('0x36')]:_0x556830[_0x3a6a('0x32')];if(_0x397eb5[_0x3a6a('0x33')][_0x3a6a('0x40')]){_0x255378[_0x3a6a('0x41')]=[{'all':!![]}];}_0x255378=_[_0x3a6a('0x3d')]({},_0x255378,_0x397eb5[_0x3a6a('0x3f')]);return db[_0x3a6a('0x2d')][_0x3a6a('0x44')](_0x255378)['then'](handleEntityNotFound(_0x1f4aeb,null))[_0x3a6a('0x24')](respondWithResult(_0x1f4aeb,null))['catch'](handleError(_0x1f4aeb,null));};exports[_0x3a6a('0x45')]=function(_0x2805c6,_0x1d1f66){return db['FaxQueueReport']['create'](_0x2805c6[_0x3a6a('0x46')],{})[_0x3a6a('0x24')](respondWithResult(_0x1d1f66,0xc9))[_0x3a6a('0x47')](handleError(_0x1d1f66,null));};exports[_0x3a6a('0x23')]=function(_0x33f951,_0x5b693e){if(_0x33f951[_0x3a6a('0x46')]['id']){delete _0x33f951[_0x3a6a('0x46')]['id'];}return db[_0x3a6a('0x2d')][_0x3a6a('0x44')]({'where':{'id':_0x33f951[_0x3a6a('0x48')]['id']}})[_0x3a6a('0x24')](handleEntityNotFound(_0x5b693e,null))['then'](saveUpdates(_0x33f951[_0x3a6a('0x46')],null))[_0x3a6a('0x24')](respondWithResult(_0x5b693e,null))[_0x3a6a('0x47')](handleError(_0x5b693e,null));};exports[_0x3a6a('0x25')]=function(_0x14b597,_0x1ef5f8){return db[_0x3a6a('0x2d')][_0x3a6a('0x44')]({'where':{'id':_0x14b597[_0x3a6a('0x48')]['id']}})[_0x3a6a('0x24')](handleEntityNotFound(_0x1ef5f8,null))[_0x3a6a('0x24')](removeEntity(_0x1ef5f8,null))[_0x3a6a('0x47')](handleError(_0x1ef5f8,null));};exports['describe']=function(_0x48886a,_0x36d459){return db[_0x3a6a('0x2d')]['describe']()[_0x3a6a('0x24')](respondWithResult(_0x36d459,null))[_0x3a6a('0x47')](handleError(_0x36d459,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 58728dc..1748714 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 _0xe2bc=['report_fax_queue','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./faxQueueReport.attributes','exports','define'];(function(_0x1ea51a,_0x3c521f){var _0x51cae6=function(_0x189a79){while(--_0x189a79){_0x1ea51a['push'](_0x1ea51a['shift']());}};_0x51cae6(++_0x3c521f);}(_0xe2bc,0x1a6));var _0xce2b=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0xe2bc[_0x38537f];return _0x141e23;};'use strict';var _=require(_0xce2b('0x0'));var util=require('util');var logger=require(_0xce2b('0x1'))('api');var moment=require(_0xce2b('0x2'));var BPromise=require(_0xce2b('0x3'));var rp=require(_0xce2b('0x4'));var fs=require('fs');var path=require(_0xce2b('0x5'));var rimraf=require(_0xce2b('0x6'));var config=require('../../config/environment');var attributes=require(_0xce2b('0x7'));module[_0xce2b('0x8')]=function(_0x3c15d3,_0x343373){return _0x3c15d3[_0xce2b('0x9')]('FaxQueueReport',attributes,{'tableName':_0xce2b('0xa'),'paranoid':![],'indexes':[{'name':_0xce2b('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5ff9=['lodash','util','api','moment','path','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x5ff9,0xa0));var _0x95ff=function(_0x78800,_0x5c6ed5){_0x78800=_0x78800-0x0;var _0x3f873a=_0x5ff9[_0x78800];return _0x3f873a;};'use strict';var _=require(_0x95ff('0x0'));var util=require(_0x95ff('0x1'));var logger=require('../../config/logger')(_0x95ff('0x2'));var moment=require(_0x95ff('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x95ff('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x95ff('0x5'));module[_0x95ff('0x6')]=function(_0x4d37f2,_0x1d9d79){return _0x4d37f2['define'](_0x95ff('0x7'),attributes,{'tableName':_0x95ff('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x95ff('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index b6338f7..a760545 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 _0xded7=['FaxQueueReport','body','options','raw','then','info','UpdateFaxQueueReport','attributes','limit','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateFaxQueueReport'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0xded7,0x86));var _0x7ded=function(_0x1b584b,_0x2c6cf5){_0x1b584b=_0x1b584b-0x0;var _0x292a5e=_0xded7[_0x1b584b];return _0x292a5e;};'use strict';var _=require(_0x7ded('0x0'));var util=require('util');var moment=require(_0x7ded('0x1'));var BPromise=require('bluebird');var rs=require(_0x7ded('0x2'));var fs=require('fs');var Redis=require(_0x7ded('0x3'));var db=require(_0x7ded('0x4'))['db'];var utils=require(_0x7ded('0x5'));var logger=require(_0x7ded('0x6'))(_0x7ded('0x7'));var config=require(_0x7ded('0x8'));var jayson=require(_0x7ded('0x9'));var client=jayson[_0x7ded('0xa')][_0x7ded('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x506b00,_0x7c0180,_0x1c1fb6){return new BPromise(function(_0x14d8df,_0x1a6213){return client['request'](_0x506b00,_0x1c1fb6)['then'](function(_0x533b40){logger['info'](_0x7ded('0xc'),_0x7c0180,_0x7ded('0xd'));logger[_0x7ded('0xe')](_0x7ded('0xf'),_0x7c0180,_0x7ded('0xd'),JSON['stringify'](_0x533b40));if(_0x533b40[_0x7ded('0x10')]){if(_0x533b40['error'][_0x7ded('0x11')]===0x1f4){logger['error'](_0x7ded('0xc'),_0x7c0180,_0x533b40['error'][_0x7ded('0x12')]);return _0x1a6213(_0x533b40[_0x7ded('0x10')][_0x7ded('0x12')]);}logger[_0x7ded('0x10')](_0x7ded('0xc'),_0x7c0180,_0x533b40[_0x7ded('0x10')][_0x7ded('0x12')]);return _0x14d8df(_0x533b40[_0x7ded('0x10')][_0x7ded('0x12')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x7c0180,_0x7ded('0xd'));_0x14d8df(_0x533b40['result'][_0x7ded('0x12')]);}})[_0x7ded('0x13')](function(_0x3401e0){logger[_0x7ded('0x10')](_0x7ded('0xc'),_0x7c0180,_0x3401e0);_0x1a6213(_0x3401e0);});});}exports[_0x7ded('0x14')]=function(_0x4e4d9b){var _0x3f2c18=this;return new Promise(function(_0x363454,_0xa7441c){return db[_0x7ded('0x15')]['create'](_0x4e4d9b[_0x7ded('0x16')],{'raw':_0x4e4d9b['options']?_0x4e4d9b[_0x7ded('0x17')][_0x7ded('0x18')]===undefined?!![]:![]:!![]})[_0x7ded('0x19')](function(_0x2a1611){logger[_0x7ded('0x1a')]('CreateFaxQueueReport',_0x4e4d9b);logger[_0x7ded('0xe')](_0x7ded('0x14'),_0x4e4d9b,JSON['stringify'](_0x2a1611));_0x363454(_0x2a1611);})[_0x7ded('0x13')](function(_0x4432bd){logger[_0x7ded('0x10')](_0x7ded('0x14'),_0x4432bd['message'],_0x4e4d9b);_0xa7441c(_0x3f2c18['error'](0x1f4,_0x4432bd[_0x7ded('0x12')]));});});};exports[_0x7ded('0x1b')]=function(_0x36dace){var _0x1b5565=this;return new Promise(function(_0x1195bd,_0x4f0e72){return db[_0x7ded('0x15')]['update'](_0x36dace[_0x7ded('0x16')],{'raw':_0x36dace['options']?_0x36dace[_0x7ded('0x17')][_0x7ded('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36dace[_0x7ded('0x17')]?_0x36dace['options']['where']||null:null,'attributes':_0x36dace['options']?_0x36dace[_0x7ded('0x17')][_0x7ded('0x1c')]||null:null,'limit':_0x36dace[_0x7ded('0x17')]?_0x36dace['options'][_0x7ded('0x1d')]||null:null})[_0x7ded('0x19')](function(_0x2b2e90){logger['info'](_0x7ded('0x1b'),_0x36dace);logger['debug'](_0x7ded('0x1b'),_0x36dace,JSON[_0x7ded('0x1e')](_0x2b2e90));_0x1195bd(_0x2b2e90);})[_0x7ded('0x13')](function(_0x5917c5){logger['error'](_0x7ded('0x1b'),_0x5917c5[_0x7ded('0x12')],_0x36dace);_0x4f0e72(_0x1b5565[_0x7ded('0x10')](0x1f4,_0x5917c5[_0x7ded('0x12')]));});});}; \ No newline at end of file +var _0x2591=['attributes','lodash','util','moment','ioredis','../../config/logger','rpc','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','CreateFaxQueueReport','create','body','options','raw','catch','UpdateFaxQueueReport','update'];(function(_0xdf9275,_0x21e51f){var _0x2eb702=function(_0x3b94b2){while(--_0x3b94b2){_0xdf9275['push'](_0xdf9275['shift']());}};_0x2eb702(++_0x21e51f);}(_0x2591,0x1cc));var _0x1259=function(_0x2991e6,_0x562c7c){_0x2991e6=_0x2991e6-0x0;var _0x27b316=_0x2591[_0x2991e6];return _0x27b316;};'use strict';var _=require(_0x1259('0x0'));var util=require(_0x1259('0x1'));var moment=require(_0x1259('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1259('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1259('0x4'))(_0x1259('0x5'));var config=require('../../config/environment');var jayson=require(_0x1259('0x6'));var client=jayson[_0x1259('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5372ed,_0xf36f36,_0x5e581c){return new BPromise(function(_0x26a738,_0x368ccb){return client[_0x1259('0x8')](_0x5372ed,_0x5e581c)[_0x1259('0x9')](function(_0x83a699){logger[_0x1259('0xa')](_0x1259('0xb'),_0xf36f36,_0x1259('0xc'));logger[_0x1259('0xd')](_0x1259('0xe'),_0xf36f36,'request\x20sent',JSON[_0x1259('0xf')](_0x83a699));if(_0x83a699[_0x1259('0x10')]){if(_0x83a699[_0x1259('0x10')]['code']===0x1f4){logger['error'](_0x1259('0xb'),_0xf36f36,_0x83a699[_0x1259('0x10')][_0x1259('0x11')]);return _0x368ccb(_0x83a699[_0x1259('0x10')][_0x1259('0x11')]);}logger[_0x1259('0x10')](_0x1259('0xb'),_0xf36f36,_0x83a699['error'][_0x1259('0x11')]);return _0x26a738(_0x83a699[_0x1259('0x10')][_0x1259('0x11')]);}else{logger[_0x1259('0xa')](_0x1259('0xb'),_0xf36f36,'request\x20sent');_0x26a738(_0x83a699['result'][_0x1259('0x11')]);}})['catch'](function(_0x59e859){logger[_0x1259('0x10')](_0x1259('0xb'),_0xf36f36,_0x59e859);_0x368ccb(_0x59e859);});});}exports[_0x1259('0x12')]=function(_0x2238b0){var _0x5cc421=this;return new Promise(function(_0x4a6de5,_0x49f194){return db['FaxQueueReport'][_0x1259('0x13')](_0x2238b0[_0x1259('0x14')],{'raw':_0x2238b0[_0x1259('0x15')]?_0x2238b0[_0x1259('0x15')][_0x1259('0x16')]===undefined?!![]:![]:!![]})[_0x1259('0x9')](function(_0x38fde1){logger[_0x1259('0xa')](_0x1259('0x12'),_0x2238b0);logger['debug'](_0x1259('0x12'),_0x2238b0,JSON[_0x1259('0xf')](_0x38fde1));_0x4a6de5(_0x38fde1);})[_0x1259('0x17')](function(_0x615a73){logger[_0x1259('0x10')](_0x1259('0x12'),_0x615a73[_0x1259('0x11')],_0x2238b0);_0x49f194(_0x5cc421[_0x1259('0x10')](0x1f4,_0x615a73[_0x1259('0x11')]));});});};exports[_0x1259('0x18')]=function(_0x2ef1a3){var _0x24e773=this;return new Promise(function(_0x464727,_0x553e3e){return db['FaxQueueReport'][_0x1259('0x19')](_0x2ef1a3['body'],{'raw':_0x2ef1a3[_0x1259('0x15')]?_0x2ef1a3[_0x1259('0x15')][_0x1259('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ef1a3[_0x1259('0x15')]?_0x2ef1a3['options']['where']||null:null,'attributes':_0x2ef1a3[_0x1259('0x15')]?_0x2ef1a3[_0x1259('0x15')][_0x1259('0x1a')]||null:null,'limit':_0x2ef1a3[_0x1259('0x15')]?_0x2ef1a3['options']['limit']||null:null})[_0x1259('0x9')](function(_0x2c7b55){logger[_0x1259('0xa')](_0x1259('0x18'),_0x2ef1a3);logger['debug'](_0x1259('0x18'),_0x2ef1a3,JSON[_0x1259('0xf')](_0x2c7b55));_0x464727(_0x2c7b55);})[_0x1259('0x17')](function(_0x5dd91a){logger[_0x1259('0x10')](_0x1259('0x18'),_0x5dd91a[_0x1259('0x11')],_0x2ef1a3);_0x553e3e(_0x24e773['error'](0x1f4,_0x5dd91a[_0x1259('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 3287931..0f7d347 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 _0x7b42=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','get','/describe','describe','post','/:id','update','delete','multer','util'];(function(_0x4cfce3,_0x5cfba0){var _0xd71772=function(_0x315f71){while(--_0x315f71){_0x4cfce3['push'](_0x4cfce3['shift']());}};_0xd71772(++_0x5cfba0);}(_0x7b42,0xdb));var _0x27b4=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x7b42[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x27b4('0x0'));var util=require(_0x27b4('0x1'));var path=require(_0x27b4('0x2'));var timeout=require(_0x27b4('0x3'));var express=require(_0x27b4('0x4'));var router=express['Router']();var auth=require(_0x27b4('0x5'));var interaction=require(_0x27b4('0x6'));var config=require(_0x27b4('0x7'));var controller=require(_0x27b4('0x8'));router['get']('/',auth[_0x27b4('0x9')](),controller['index']);router[_0x27b4('0xa')](_0x27b4('0xb'),auth['isAuthenticated'](),controller[_0x27b4('0xc')]);router[_0x27b4('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x27b4('0xd')]('/',auth[_0x27b4('0x9')](),controller['create']);router['put'](_0x27b4('0xe'),auth['isAuthenticated'](),controller[_0x27b4('0xf')]);router[_0x27b4('0x10')](_0x27b4('0xe'),auth[_0x27b4('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb2ef=['./faxQueueReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','put','update','delete','/:id','destroy','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5b99ef,_0x275373){var _0x54929b=function(_0x39a074){while(--_0x39a074){_0x5b99ef['push'](_0x5b99ef['shift']());}};_0x54929b(++_0x275373);}(_0xb2ef,0xf6));var _0xfb2e=function(_0x47cce6,_0x44946f){_0x47cce6=_0x47cce6-0x0;var _0x5207c8=_0xb2ef[_0x47cce6];return _0x5207c8;};'use strict';var multer=require('multer');var util=require(_0xfb2e('0x0'));var path=require(_0xfb2e('0x1'));var timeout=require(_0xfb2e('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xfb2e('0x3'));var interaction=require(_0xfb2e('0x4'));var config=require(_0xfb2e('0x5'));var controller=require(_0xfb2e('0x6'));router['get']('/',auth[_0xfb2e('0x7')](),controller[_0xfb2e('0x8')]);router[_0xfb2e('0x9')](_0xfb2e('0xa'),auth[_0xfb2e('0x7')](),controller[_0xfb2e('0xb')]);router[_0xfb2e('0x9')]('/:id',auth[_0xfb2e('0x7')](),controller[_0xfb2e('0xc')]);router[_0xfb2e('0xd')]('/',auth[_0xfb2e('0x7')](),controller[_0xfb2e('0xe')]);router[_0xfb2e('0xf')]('/:id',auth[_0xfb2e('0x7')](),controller[_0xfb2e('0x10')]);router[_0xfb2e('0x11')](_0xfb2e('0x12'),auth[_0xfb2e('0x7')](),controller[_0xfb2e('0x13')]);module[_0xfb2e('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index bd5ca37..f234e94 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 _0x64ac=['moment','STRING','queue','DATE','NOW'];(function(_0x30a31e,_0x31f766){var _0x170879=function(_0x313ee7){while(--_0x313ee7){_0x30a31e['push'](_0x30a31e['shift']());}};_0x170879(++_0x31f766);}(_0x64ac,0x1ef));var _0xc64a=function(_0x2ed3dd,_0x1f7f83){_0x2ed3dd=_0x2ed3dd-0x0;var _0x1f5d17=_0x64ac[_0x2ed3dd];return _0x1f5d17;};'use strict';var moment=require(_0xc64a('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xc64a('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account','agent','queue'),'allowNull':![],'defaultValue':_0xc64a('0x2')},'transferredAt':{'type':Sequelize[_0xc64a('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xc64a('0x4')]}}; \ No newline at end of file +var _0x78de=['agent','queue','moment','sequelize','STRING','ENUM','account'];(function(_0x4ec42,_0x36177b){var _0x385e11=function(_0x44e535){while(--_0x44e535){_0x4ec42['push'](_0x4ec42['shift']());}};_0x385e11(++_0x36177b);}(_0x78de,0x1a6));var _0xe78d=function(_0x55b037,_0x2d9392){_0x55b037=_0x55b037-0x0;var _0x5f1053=_0x78de[_0x55b037];return _0x5f1053;};'use strict';var moment=require(_0xe78d('0x0'));var Sequelize=require(_0xe78d('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe78d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe78d('0x3')](_0xe78d('0x4'),_0xe78d('0x5'),_0xe78d('0x6')),'allowNull':![],'defaultValue':_0xe78d('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index a5798cc..4c28f34 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 _0x0b0e=['index','map','FaxTransferReport','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','count','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','set','reject','update','then','destroy','end','error','name'];(function(_0x3911a0,_0x399077){var _0xf3dd14=function(_0x40561d){while(--_0x40561d){_0x3911a0['push'](_0x3911a0['shift']());}};_0xf3dd14(++_0x399077);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3dc089,_0x5ccb0d){_0x3dc089=_0x3dc089-0x0;var _0x34d9d3=_0x0b0e[_0x3dc089];return _0x34d9d3;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3068c0,_0x1c358a){_0x1c358a=_0x1c358a||0xcc;return function(_0x3cc19a){if(_0x3cc19a){return _0x3068c0[_0xe0b0('0x17')](_0x1c358a);}return _0x3068c0[_0xe0b0('0x18')](_0x1c358a)['end']();};}function respondWithResult(_0x3782be,_0x154de6){_0x154de6=_0x154de6||0xc8;return function(_0x743318){if(_0x743318){return _0x3782be[_0xe0b0('0x18')](_0x154de6)[_0xe0b0('0x19')](_0x743318);}};}function respondWithFilteredResult(_0x55d884,_0x41a7e2){return function(_0x5adb01){if(_0x5adb01){var _0x35cb40=_0x5adb01['count'],_0xadee6e=_0x41a7e2[_0xe0b0('0x1a')],_0x519ae8=_0x41a7e2[_0xe0b0('0x1a')]+_0x41a7e2['limit'],_0x11fdca;if(_0x519ae8>=_0x35cb40){_0x519ae8=_0x35cb40;_0x11fdca=0xc8;}else{_0x11fdca=0xce;}_0x55d884['status'](_0x11fdca);return _0x55d884[_0xe0b0('0x1b')]('Content-Range',_0xadee6e+'-'+_0x519ae8+'/'+_0x35cb40)['json'](_0x5adb01);}return null;};}function patchUpdates(_0x4bce65){return function(_0x1920ee){try{jsonpatch['apply'](_0x1920ee,_0x4bce65,!![]);}catch(_0x52598b){return BPromise[_0xe0b0('0x1c')](_0x52598b);}return _0x1920ee['save']();};}function saveUpdates(_0x472286,_0x5dba2f){return function(_0x2c84cc){if(_0x2c84cc){return _0x2c84cc[_0xe0b0('0x1d')](_0x472286)[_0xe0b0('0x1e')](function(_0x310a6d){return _0x310a6d;});}return null;};}function removeEntity(_0x2cf6a1,_0x58b804){return function(_0x4cae54){if(_0x4cae54){return _0x4cae54[_0xe0b0('0x1f')]()['then'](function(){_0x2cf6a1[_0xe0b0('0x18')](0xcc)[_0xe0b0('0x20')]();});}};}function handleEntityNotFound(_0x513e63,_0x170ad8){return function(_0x503883){if(!_0x503883){_0x513e63[_0xe0b0('0x17')](0x194);}return _0x503883;};}function handleError(_0x49a727,_0x28586d){_0x28586d=_0x28586d||0x1f4;return function(_0x576352){logger[_0xe0b0('0x21')](_0x576352['stack']);if(_0x576352[_0xe0b0('0x22')]){delete _0x576352['name'];}_0x49a727[_0xe0b0('0x18')](_0x28586d)['send'](_0x576352);};}exports[_0xe0b0('0x23')]=function(_0x3c3bc2,_0x1f1ebd){var _0x1d91ad={},_0x3ec2={},_0x10745d={'count':0x0,'rows':[]};var _0x5200a6=_[_0xe0b0('0x24')](db[_0xe0b0('0x25')]['rawAttributes'],function(_0x15e13b){return{'name':_0x15e13b[_0xe0b0('0x26')],'type':_0x15e13b[_0xe0b0('0x27')][_0xe0b0('0x28')]};});_0x3ec2[_0xe0b0('0x29')]=_[_0xe0b0('0x24')](_0x5200a6,_0xe0b0('0x22'));_0x3ec2['query']=_[_0xe0b0('0x2a')](_0x3c3bc2[_0xe0b0('0x2b')]);_0x3ec2['filters']=_['intersection'](_0x3ec2[_0xe0b0('0x29')],_0x3ec2[_0xe0b0('0x2b')]);_0x1d91ad[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x3ec2[_0xe0b0('0x29')],qs['fields'](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x2e')]));_0x1d91ad[_0xe0b0('0x2c')]=_0x1d91ad[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x1d91ad['attributes']:_0x3ec2[_0xe0b0('0x29')];if(!_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x30')](_0xe0b0('0x31'))){_0x1d91ad[_0xe0b0('0x32')]=qs[_0xe0b0('0x32')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x32')]);_0x1d91ad[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x1a')]);}_0x1d91ad[_0xe0b0('0x33')]=qs[_0xe0b0('0x34')](_0x3c3bc2[_0xe0b0('0x2b')]['sort']);_0x1d91ad[_0xe0b0('0x35')]=qs[_0xe0b0('0x36')](_[_0xe0b0('0x37')](_0x3c3bc2[_0xe0b0('0x2b')],_0x3ec2[_0xe0b0('0x36')]),_0x5200a6);if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]){_0x1d91ad['where']=_['merge'](_0x1d91ad['where'],{'$or':_['map'](_0x5200a6,function(_0x26137c){if(_0x26137c[_0xe0b0('0x27')]!==_0xe0b0('0x39')){var _0x4e4b20={};_0x4e4b20[_0x26137c[_0xe0b0('0x22')]]={'$like':'%'+_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]+'%'};return _0x4e4b20;}})});}_0x1d91ad=_[_0xe0b0('0x3a')]({},_0x1d91ad,_0x3c3bc2['options']);var _0xed3226={'where':_0x1d91ad[_0xe0b0('0x35')]};return db[_0xe0b0('0x25')][_0xe0b0('0x3b')](_0xed3226)[_0xe0b0('0x1e')](function(_0x1205db){_0x10745d[_0xe0b0('0x3b')]=_0x1205db;if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x1d91ad['include']=[{'all':!![]}];}return db[_0xe0b0('0x25')]['findAll'](_0x1d91ad);})[_0xe0b0('0x1e')](function(_0x2d5f47){_0x10745d[_0xe0b0('0x3d')]=_0x2d5f47;return _0x10745d;})[_0xe0b0('0x1e')](respondWithFilteredResult(_0x1f1ebd,_0x1d91ad))['catch'](handleError(_0x1f1ebd,null));};exports[_0xe0b0('0x3e')]=function(_0x41adcb,_0x33706d){var _0x402a0e={'raw':!![],'where':{'id':_0x41adcb[_0xe0b0('0x3f')]['id']}},_0x19c80e={};_0x19c80e[_0xe0b0('0x29')]=_[_0xe0b0('0x2a')](db['FaxTransferReport'][_0xe0b0('0x40')]);_0x19c80e[_0xe0b0('0x2b')]=_['keys'](_0x41adcb['query']);_0x19c80e[_0xe0b0('0x36')]=_[_0xe0b0('0x2d')](_0x19c80e['model'],_0x19c80e[_0xe0b0('0x2b')]);_0x402a0e[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x19c80e[_0xe0b0('0x29')],qs[_0xe0b0('0x2e')](_0x41adcb['query']['fields']));_0x402a0e['attributes']=_0x402a0e[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x402a0e['attributes']:_0x19c80e[_0xe0b0('0x29')];if(_0x41adcb[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x402a0e[_0xe0b0('0x41')]=[{'all':!![]}];}_0x402a0e=_[_0xe0b0('0x3a')]({},_0x402a0e,_0x41adcb['options']);return db['FaxTransferReport'][_0xe0b0('0x42')](_0x402a0e)[_0xe0b0('0x1e')](handleEntityNotFound(_0x33706d,null))[_0xe0b0('0x1e')](respondWithResult(_0x33706d,null))[_0xe0b0('0x43')](handleError(_0x33706d,null));};exports[_0xe0b0('0x44')]=function(_0x575c7d,_0x3b1474){return db[_0xe0b0('0x25')]['create'](_0x575c7d['body'],{})['then'](respondWithResult(_0x3b1474,0xc9))[_0xe0b0('0x43')](handleError(_0x3b1474,null));};exports[_0xe0b0('0x1d')]=function(_0x2419ce,_0x364877){if(_0x2419ce['body']['id']){delete _0x2419ce[_0xe0b0('0x45')]['id'];}return db[_0xe0b0('0x25')]['find']({'where':{'id':_0x2419ce['params']['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x364877,null))[_0xe0b0('0x1e')](saveUpdates(_0x2419ce['body'],null))[_0xe0b0('0x1e')](respondWithResult(_0x364877,null))[_0xe0b0('0x43')](handleError(_0x364877,null));};exports['destroy']=function(_0x5cb2b6,_0x123ad2){return db['FaxTransferReport'][_0xe0b0('0x42')]({'where':{'id':_0x5cb2b6[_0xe0b0('0x3f')]['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x123ad2,null))[_0xe0b0('0x1e')](removeEntity(_0x123ad2,null))[_0xe0b0('0x43')](handleError(_0x123ad2,null));};exports[_0xe0b0('0x46')]=function(_0x5f5486,_0x5d018d){return db[_0xe0b0('0x25')]['describe']()['then'](respondWithResult(_0x5d018d,null))[_0xe0b0('0x43')](handleError(_0x5d018d,null));}; \ No newline at end of file +var _0x2ef3=['send','index','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','sort','pick','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','limit','set','apply','reject','save','update','destroy','then','stack','name'];(function(_0x21c3f6,_0x3c726c){var _0x288fac=function(_0x400bc7){while(--_0x400bc7){_0x21c3f6['push'](_0x21c3f6['shift']());}};_0x288fac(++_0x3c726c);}(_0x2ef3,0xba));var _0x32ef=function(_0x5eb247,_0x3d214c){_0x5eb247=_0x5eb247-0x0;var _0x349fcc=_0x2ef3[_0x5eb247];return _0x349fcc;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');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('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];function respondWithStatusCode(_0x5afcc2,_0x1a5106){_0x1a5106=_0x1a5106||0xcc;return function(_0x49d590){if(_0x49d590){return _0x5afcc2[_0x32ef('0x19')](_0x1a5106);}return _0x5afcc2[_0x32ef('0x1a')](_0x1a5106)['end']();};}function respondWithResult(_0x539d18,_0x19ce1){_0x19ce1=_0x19ce1||0xc8;return function(_0x4d8009){if(_0x4d8009){return _0x539d18[_0x32ef('0x1a')](_0x19ce1)[_0x32ef('0x1b')](_0x4d8009);}};}function respondWithFilteredResult(_0x93d492,_0x54c7f5){return function(_0x57aff1){if(_0x57aff1){var _0x55bf0b=_0x57aff1[_0x32ef('0x1c')],_0x531e30=_0x54c7f5['offset'],_0x13db1a=_0x54c7f5['offset']+_0x54c7f5[_0x32ef('0x1d')],_0x3950e6;if(_0x13db1a>=_0x55bf0b){_0x13db1a=_0x55bf0b;_0x3950e6=0xc8;}else{_0x3950e6=0xce;}_0x93d492[_0x32ef('0x1a')](_0x3950e6);return _0x93d492[_0x32ef('0x1e')]('Content-Range',_0x531e30+'-'+_0x13db1a+'/'+_0x55bf0b)[_0x32ef('0x1b')](_0x57aff1);}return null;};}function patchUpdates(_0x33e230){return function(_0x4f4c98){try{jsonpatch[_0x32ef('0x1f')](_0x4f4c98,_0x33e230,!![]);}catch(_0x314ef1){return BPromise[_0x32ef('0x20')](_0x314ef1);}return _0x4f4c98[_0x32ef('0x21')]();};}function saveUpdates(_0x445cda,_0x3aec05){return function(_0x4de441){if(_0x4de441){return _0x4de441[_0x32ef('0x22')](_0x445cda)['then'](function(_0x309866){return _0x309866;});}return null;};}function removeEntity(_0x3a20ca,_0x49f2d8){return function(_0x1af371){if(_0x1af371){return _0x1af371[_0x32ef('0x23')]()[_0x32ef('0x24')](function(){_0x3a20ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(!_0x225feb){_0x22f2d7['sendStatus'](0x194);}return _0x225feb;};}function handleError(_0x59585f,_0x19ea6){_0x19ea6=_0x19ea6||0x1f4;return function(_0x4d584b){logger['error'](_0x4d584b[_0x32ef('0x25')]);if(_0x4d584b[_0x32ef('0x26')]){delete _0x4d584b[_0x32ef('0x26')];}_0x59585f[_0x32ef('0x1a')](_0x19ea6)[_0x32ef('0x27')](_0x4d584b);};}exports[_0x32ef('0x28')]=function(_0x1874ea,_0x38aed5){var _0x338f19={},_0x2f52d7={},_0x1335e2={'count':0x0,'rows':[]};var _0xba4b3f=_['map'](db[_0x32ef('0x29')][_0x32ef('0x2a')],function(_0x5a04cd){return{'name':_0x5a04cd[_0x32ef('0x2b')],'type':_0x5a04cd[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x2f52d7[_0x32ef('0x2e')]=_['map'](_0xba4b3f,_0x32ef('0x26'));_0x2f52d7[_0x32ef('0x2f')]=_[_0x32ef('0x30')](_0x1874ea[_0x32ef('0x2f')]);_0x2f52d7[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2f52d7[_0x32ef('0x2e')],_0x2f52d7['query']);_0x338f19[_0x32ef('0x33')]=_['intersection'](_0x2f52d7[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x1874ea['query'][_0x32ef('0x34')]));_0x338f19[_0x32ef('0x33')]=_0x338f19[_0x32ef('0x33')][_0x32ef('0x35')]?_0x338f19[_0x32ef('0x33')]:_0x2f52d7['model'];if(!_0x1874ea['query'][_0x32ef('0x36')]('nolimit')){_0x338f19[_0x32ef('0x1d')]=qs[_0x32ef('0x1d')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x338f19[_0x32ef('0x37')]=qs[_0x32ef('0x37')](_0x1874ea['query']['offset']);}_0x338f19['order']=qs[_0x32ef('0x38')](_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x38')]);_0x338f19['where']=qs['filters'](_[_0x32ef('0x39')](_0x1874ea[_0x32ef('0x2f')],_0x2f52d7[_0x32ef('0x31')]),_0xba4b3f);if(_0x1874ea['query']['filter']){_0x338f19[_0x32ef('0x3a')]=_[_0x32ef('0x3b')](_0x338f19[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x3c')](_0xba4b3f,function(_0x3a7c49){if(_0x3a7c49[_0x32ef('0x2c')]!==_0x32ef('0x3d')){var _0x21da90={};_0x21da90[_0x3a7c49[_0x32ef('0x26')]]={'$like':'%'+_0x1874ea['query'][_0x32ef('0x3e')]+'%'};return _0x21da90;}})});}_0x338f19=_[_0x32ef('0x3b')]({},_0x338f19,_0x1874ea[_0x32ef('0x3f')]);var _0x4b97dc={'where':_0x338f19[_0x32ef('0x3a')]};return db[_0x32ef('0x29')][_0x32ef('0x1c')](_0x4b97dc)[_0x32ef('0x24')](function(_0x1faf72){_0x1335e2[_0x32ef('0x1c')]=_0x1faf72;if(_0x1874ea[_0x32ef('0x2f')][_0x32ef('0x40')]){_0x338f19[_0x32ef('0x41')]=[{'all':!![]}];}return db[_0x32ef('0x29')][_0x32ef('0x42')](_0x338f19);})[_0x32ef('0x24')](function(_0x48e071){_0x1335e2[_0x32ef('0x43')]=_0x48e071;return _0x1335e2;})[_0x32ef('0x24')](respondWithFilteredResult(_0x38aed5,_0x338f19))[_0x32ef('0x44')](handleError(_0x38aed5,null));};exports[_0x32ef('0x45')]=function(_0x2f92f5,_0x2ca66b){var _0x3c0e44={'raw':!![],'where':{'id':_0x2f92f5['params']['id']}},_0x596d5a={};_0x596d5a[_0x32ef('0x2e')]=_[_0x32ef('0x30')](db[_0x32ef('0x29')][_0x32ef('0x2a')]);_0x596d5a['query']=_[_0x32ef('0x30')](_0x2f92f5[_0x32ef('0x2f')]);_0x596d5a['filters']=_[_0x32ef('0x32')](_0x596d5a['model'],_0x596d5a[_0x32ef('0x2f')]);_0x3c0e44[_0x32ef('0x33')]=_[_0x32ef('0x32')](_0x596d5a[_0x32ef('0x2e')],qs[_0x32ef('0x34')](_0x2f92f5[_0x32ef('0x2f')][_0x32ef('0x34')]));_0x3c0e44[_0x32ef('0x33')]=_0x3c0e44[_0x32ef('0x33')][_0x32ef('0x35')]?_0x3c0e44['attributes']:_0x596d5a[_0x32ef('0x2e')];if(_0x2f92f5['query'][_0x32ef('0x40')]){_0x3c0e44[_0x32ef('0x41')]=[{'all':!![]}];}_0x3c0e44=_[_0x32ef('0x3b')]({},_0x3c0e44,_0x2f92f5['options']);return db[_0x32ef('0x29')][_0x32ef('0x46')](_0x3c0e44)[_0x32ef('0x24')](handleEntityNotFound(_0x2ca66b,null))[_0x32ef('0x24')](respondWithResult(_0x2ca66b,null))[_0x32ef('0x44')](handleError(_0x2ca66b,null));};exports[_0x32ef('0x47')]=function(_0x12c9e6,_0x47dbe1){return db['FaxTransferReport'][_0x32ef('0x47')](_0x12c9e6[_0x32ef('0x48')],{})[_0x32ef('0x24')](respondWithResult(_0x47dbe1,0xc9))[_0x32ef('0x44')](handleError(_0x47dbe1,null));};exports[_0x32ef('0x22')]=function(_0xd67dc9,_0x44ad11){if(_0xd67dc9[_0x32ef('0x48')]['id']){delete _0xd67dc9[_0x32ef('0x48')]['id'];}return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0xd67dc9[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x44ad11,null))['then'](saveUpdates(_0xd67dc9[_0x32ef('0x48')],null))[_0x32ef('0x24')](respondWithResult(_0x44ad11,null))[_0x32ef('0x44')](handleError(_0x44ad11,null));};exports[_0x32ef('0x23')]=function(_0x1cc9f3,_0x4353f0){return db[_0x32ef('0x29')][_0x32ef('0x46')]({'where':{'id':_0x1cc9f3[_0x32ef('0x49')]['id']}})[_0x32ef('0x24')](handleEntityNotFound(_0x4353f0,null))[_0x32ef('0x24')](removeEntity(_0x4353f0,null))[_0x32ef('0x44')](handleError(_0x4353f0,null));};exports[_0x32ef('0x4a')]=function(_0x326445,_0x307ac8){return db[_0x32ef('0x29')][_0x32ef('0x4a')]()[_0x32ef('0x24')](respondWithResult(_0x307ac8,null))['catch'](handleError(_0x307ac8,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 537da10..6b4b234 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 _0x3aa4=['request-promise','path','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger','api','bluebird'];(function(_0x127765,_0x2882fa){var _0x56ef96=function(_0x89bd2c){while(--_0x89bd2c){_0x127765['push'](_0x127765['shift']());}};_0x56ef96(++_0x2882fa);}(_0x3aa4,0xd9));var _0x43aa=function(_0x1035d7,_0x492aaa){_0x1035d7=_0x1035d7-0x0;var _0x331a36=_0x3aa4[_0x1035d7];return _0x331a36;};'use strict';var _=require('lodash');var util=require(_0x43aa('0x0'));var logger=require(_0x43aa('0x1'))(_0x43aa('0x2'));var moment=require('moment');var BPromise=require(_0x43aa('0x3'));var rp=require(_0x43aa('0x4'));var fs=require('fs');var path=require(_0x43aa('0x5'));var rimraf=require('rimraf');var config=require(_0x43aa('0x6'));var attributes=require(_0x43aa('0x7'));module[_0x43aa('0x8')]=function(_0x5010d4,_0x4b57a0){return _0x5010d4[_0x43aa('0x9')](_0x43aa('0xa'),attributes,{'tableName':_0x43aa('0xb'),'paranoid':![],'indexes':[{'name':_0x43aa('0xc'),'fields':[_0x43aa('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x679e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x4bee59,_0x48f132){var _0x3ed6bb=function(_0x2b6c48){while(--_0x2b6c48){_0x4bee59['push'](_0x4bee59['shift']());}};_0x3ed6bb(++_0x48f132);}(_0x679e,0x1cd));var _0xe679=function(_0x20aaf1,_0x378004){_0x20aaf1=_0x20aaf1-0x0;var _0x22590e=_0x679e[_0x20aaf1];return _0x22590e;};'use strict';var _=require(_0xe679('0x0'));var util=require(_0xe679('0x1'));var logger=require(_0xe679('0x2'))(_0xe679('0x3'));var moment=require(_0xe679('0x4'));var BPromise=require(_0xe679('0x5'));var rp=require(_0xe679('0x6'));var fs=require('fs');var path=require(_0xe679('0x7'));var rimraf=require(_0xe679('0x8'));var config=require(_0xe679('0x9'));var attributes=require(_0xe679('0xa'));module['exports']=function(_0x441a4e,_0x137650){return _0x441a4e[_0xe679('0xb')](_0xe679('0xc'),attributes,{'tableName':_0xe679('0xd'),'paranoid':![],'indexes':[{'name':_0xe679('0xe'),'fields':[_0xe679('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 2a508c7..38b9bf1 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 _0x82a8=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x82a8,0x1de));var _0x882a=function(_0x32827c,_0x58c26e){_0x32827c=_0x32827c-0x0;var _0x386a98=_0x82a8[_0x32827c];return _0x386a98;};'use strict';var _=require(_0x882a('0x0'));var util=require(_0x882a('0x1'));var moment=require(_0x882a('0x2'));var BPromise=require(_0x882a('0x3'));var rs=require(_0x882a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x882a('0x5'))['db'];var utils=require(_0x882a('0x6'));var logger=require(_0x882a('0x7'))(_0x882a('0x8'));var config=require(_0x882a('0x9'));var jayson=require(_0x882a('0xa'));var client=jayson[_0x882a('0xb')][_0x882a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13baff,_0x9d1b14,_0x5be341){return new BPromise(function(_0xac389d,_0x1ef69a){return client['request'](_0x13baff,_0x5be341)[_0x882a('0xd')](function(_0xf34dc9){logger['info'](_0x882a('0xe'),_0x9d1b14,'request\x20sent');logger[_0x882a('0xf')](_0x882a('0x10'),_0x9d1b14,_0x882a('0x11'),JSON[_0x882a('0x12')](_0xf34dc9));if(_0xf34dc9[_0x882a('0x13')]){if(_0xf34dc9['error'][_0x882a('0x14')]===0x1f4){logger[_0x882a('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x9d1b14,_0xf34dc9[_0x882a('0x13')]['message']);return _0x1ef69a(_0xf34dc9[_0x882a('0x13')][_0x882a('0x15')]);}logger[_0x882a('0x13')](_0x882a('0xe'),_0x9d1b14,_0xf34dc9['error'][_0x882a('0x15')]);return _0xac389d(_0xf34dc9['error']['message']);}else{logger[_0x882a('0x16')](_0x882a('0xe'),_0x9d1b14,_0x882a('0x11'));_0xac389d(_0xf34dc9[_0x882a('0x17')][_0x882a('0x15')]);}})['catch'](function(_0x438db7){logger[_0x882a('0x13')](_0x882a('0xe'),_0x9d1b14,_0x438db7);_0x1ef69a(_0x438db7);});});} \ No newline at end of file +var _0x1a2b=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3be38f,_0x355e05){var _0x7eccac=function(_0x1e54e6){while(--_0x1e54e6){_0x3be38f['push'](_0x3be38f['shift']());}};_0x7eccac(++_0x355e05);}(_0x1a2b,0x1ad));var _0xb1a2=function(_0x167307,_0x5a60ae){_0x167307=_0x167307-0x0;var _0x550140=_0x1a2b[_0x167307];return _0x550140;};'use strict';var _=require(_0xb1a2('0x0'));var util=require('util');var moment=require(_0xb1a2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1a2('0x2'));var db=require(_0xb1a2('0x3'))['db'];var utils=require(_0xb1a2('0x4'));var logger=require(_0xb1a2('0x5'))('rpc');var config=require(_0xb1a2('0x6'));var jayson=require(_0xb1a2('0x7'));var client=jayson['client'][_0xb1a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1624e7,_0x357c97,_0x424126){return new BPromise(function(_0x34cf3d,_0x4158f0){return client[_0xb1a2('0x9')](_0x1624e7,_0x424126)['then'](function(_0x511aff){logger['info'](_0xb1a2('0xa'),_0x357c97,_0xb1a2('0xb'));logger[_0xb1a2('0xc')](_0xb1a2('0xd'),_0x357c97,_0xb1a2('0xb'),JSON[_0xb1a2('0xe')](_0x511aff));if(_0x511aff[_0xb1a2('0xf')]){if(_0x511aff[_0xb1a2('0xf')][_0xb1a2('0x10')]===0x1f4){logger[_0xb1a2('0xf')](_0xb1a2('0xa'),_0x357c97,_0x511aff[_0xb1a2('0xf')]['message']);return _0x4158f0(_0x511aff[_0xb1a2('0xf')]['message']);}logger[_0xb1a2('0xf')](_0xb1a2('0xa'),_0x357c97,_0x511aff['error']['message']);return _0x34cf3d(_0x511aff[_0xb1a2('0xf')][_0xb1a2('0x11')]);}else{logger[_0xb1a2('0x12')](_0xb1a2('0xa'),_0x357c97,'request\x20sent');_0x34cf3d(_0x511aff[_0xb1a2('0x13')]['message']);}})[_0xb1a2('0x14')](function(_0x43497e){logger[_0xb1a2('0xf')](_0xb1a2('0xa'),_0x357c97,_0x43497e);_0x4158f0(_0x43497e);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 1c2ccf4..fadda65 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 _0x3bc3=['../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x33ecd3,_0x2e038e){var _0x201c3f=function(_0x18f06d){while(--_0x18f06d){_0x33ecd3['push'](_0x33ecd3['shift']());}};_0x201c3f(++_0x2e038e);}(_0x3bc3,0x11b));var _0x33bc=function(_0x36dafe,_0xd81695){_0x36dafe=_0x36dafe-0x0;var _0x4d3548=_0x3bc3[_0x36dafe];return _0x4d3548;};'use strict';var multer=require(_0x33bc('0x0'));var util=require(_0x33bc('0x1'));var path=require(_0x33bc('0x2'));var timeout=require(_0x33bc('0x3'));var express=require('express');var router=express[_0x33bc('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x33bc('0x5'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0x33bc('0x6')]('/',auth[_0x33bc('0x7')](),controller['index']);router[_0x33bc('0x6')](_0x33bc('0x8'),auth[_0x33bc('0x7')](),controller[_0x33bc('0x9')]);router[_0x33bc('0x6')](_0x33bc('0xa'),auth['isAuthenticated'](),controller[_0x33bc('0xb')]);router['post']('/',auth[_0x33bc('0x7')](),controller[_0x33bc('0xc')]);router[_0x33bc('0xd')](_0x33bc('0xa'),auth[_0x33bc('0x7')](),controller[_0x33bc('0xe')]);router[_0x33bc('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x33bc('0x10')]);module[_0x33bc('0x11')]=router; \ No newline at end of file +var _0x0ab7=['destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete'];(function(_0x35fa5b,_0x12b98c){var _0x36fe47=function(_0x5e7901){while(--_0x5e7901){_0x35fa5b['push'](_0x35fa5b['shift']());}};_0x36fe47(++_0x12b98c);}(_0x0ab7,0x1b6));var _0x70ab=function(_0x4f9787,_0x3b16c2){_0x4f9787=_0x4f9787-0x0;var _0x1ef560=_0x0ab7[_0x4f9787];return _0x1ef560;};'use strict';var multer=require(_0x70ab('0x0'));var util=require(_0x70ab('0x1'));var path=require(_0x70ab('0x2'));var timeout=require(_0x70ab('0x3'));var express=require('express');var router=express[_0x70ab('0x4')]();var auth=require(_0x70ab('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x70ab('0x6'));var controller=require(_0x70ab('0x7'));router[_0x70ab('0x8')]('/',auth[_0x70ab('0x9')](),controller['index']);router[_0x70ab('0x8')](_0x70ab('0xa'),auth[_0x70ab('0x9')](),controller[_0x70ab('0xb')]);router[_0x70ab('0x8')](_0x70ab('0xc'),auth[_0x70ab('0x9')](),controller[_0x70ab('0xd')]);router[_0x70ab('0xe')]('/',auth['isAuthenticated'](),controller[_0x70ab('0xf')]);router[_0x70ab('0x10')](_0x70ab('0xc'),auth[_0x70ab('0x9')](),controller['update']);router[_0x70ab('0x11')](_0x70ab('0xc'),auth[_0x70ab('0x9')](),controller[_0x70ab('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index edb6243..73b3ade 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 _0x8375=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getFields','post','create','addConfiguration','put','destroy','exports'];(function(_0x1ff4d2,_0x316fe6){var _0x5b5c69=function(_0x340f54){while(--_0x340f54){_0x1ff4d2['push'](_0x1ff4d2['shift']());}};_0x5b5c69(++_0x316fe6);}(_0x8375,0xa8));var _0x5837=function(_0x49fe7e,_0x1a0b13){_0x49fe7e=_0x49fe7e-0x0;var _0x395a54=_0x8375[_0x49fe7e];return _0x395a54;};'use strict';var multer=require(_0x5837('0x0'));var util=require(_0x5837('0x1'));var path=require(_0x5837('0x2'));var timeout=require('connect-timeout');var express=require(_0x5837('0x3'));var router=express[_0x5837('0x4')]();var auth=require(_0x5837('0x5'));var interaction=require(_0x5837('0x6'));var config=require(_0x5837('0x7'));var controller=require(_0x5837('0x8'));router['get']('/',auth[_0x5837('0x9')](),controller[_0x5837('0xa')]);router[_0x5837('0xb')](_0x5837('0xc'),auth[_0x5837('0x9')](),controller['show']);router['get'](_0x5837('0xd'),auth[_0x5837('0x9')](),controller['getConfigurations']);router[_0x5837('0xb')]('/:id/fields',auth[_0x5837('0x9')](),controller[_0x5837('0xe')]);router[_0x5837('0xf')]('/',auth[_0x5837('0x9')](),controller[_0x5837('0x10')]);router[_0x5837('0xf')]('/:id/configurations',auth[_0x5837('0x9')](),controller[_0x5837('0x11')]);router[_0x5837('0x12')](_0x5837('0xc'),auth[_0x5837('0x9')](),controller['update']);router['delete']('/:id',auth[_0x5837('0x9')](),controller[_0x5837('0x13')]);module[_0x5837('0x14')]=router; \ No newline at end of file +var _0x3435=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','get','/:id/configurations','getFields','post','create','addConfiguration','/:id','update','delete','exports','multer','util'];(function(_0x2fe689,_0x345fb6){var _0x813a08=function(_0x3a48f0){while(--_0x3a48f0){_0x2fe689['push'](_0x2fe689['shift']());}};_0x813a08(++_0x345fb6);}(_0x3435,0xfa));var _0x5343=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0x3435[_0x382e89];return _0x3a1318;};'use strict';var multer=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var path=require(_0x5343('0x2'));var timeout=require(_0x5343('0x3'));var express=require(_0x5343('0x4'));var router=express[_0x5343('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5343('0x6'));var config=require(_0x5343('0x7'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0x5343('0x8')](),controller[_0x5343('0x9')]);router['get']('/:id',auth[_0x5343('0x8')](),controller[_0x5343('0xa')]);router[_0x5343('0xb')](_0x5343('0xc'),auth[_0x5343('0x8')](),controller['getConfigurations']);router[_0x5343('0xb')]('/:id/fields',auth[_0x5343('0x8')](),controller[_0x5343('0xd')]);router[_0x5343('0xe')]('/',auth[_0x5343('0x8')](),controller[_0x5343('0xf')]);router['post'](_0x5343('0xc'),auth[_0x5343('0x8')](),controller[_0x5343('0x10')]);router['put'](_0x5343('0x11'),auth['isAuthenticated'](),controller[_0x5343('0x12')]);router[_0x5343('0x13')]('/:id',auth[_0x5343('0x8')](),controller['destroy']);module[_0x5343('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 682870e..854a053 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 _0xbb79=['STRING','basic','ENUM','newTab','integrationTab','exports'];(function(_0x2cf3f6,_0x42f916){var _0x22068e=function(_0x50fc32){while(--_0x50fc32){_0x2cf3f6['push'](_0x2cf3f6['shift']());}};_0x22068e(++_0x42f916);}(_0xbb79,0xef));var _0x9bb7=function(_0x356036,_0x73d3be){_0x356036=_0x356036-0x0;var _0x2284ad=_0xbb79[_0x356036];return _0x2284ad;};'use strict';var Sequelize=require('sequelize');module[_0x9bb7('0x0')]={'name':{'type':Sequelize[_0x9bb7('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9bb7('0x1')]},'remoteUri':{'type':Sequelize[_0x9bb7('0x1')]},'authType':{'type':Sequelize['ENUM'](_0x9bb7('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x9bb7('0x1')]},'consumerSecret':{'type':Sequelize[_0x9bb7('0x1')]},'token':{'type':Sequelize[_0x9bb7('0x1')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9bb7('0x1')]},'type':{'type':Sequelize[_0x9bb7('0x3')]('integrationTab',_0x9bb7('0x4')),'defaultValue':_0x9bb7('0x5')}}; \ No newline at end of file +var _0x2581=['newTab','exports','STRING','basic','ENUM','integrationTab'];(function(_0x4a6cf8,_0x5534ef){var _0x22205e=function(_0x3f4d0d){while(--_0x3f4d0d){_0x4a6cf8['push'](_0x4a6cf8['shift']());}};_0x22205e(++_0x5534ef);}(_0x2581,0x1bd));var _0x1258=function(_0x1eff70,_0x47e56e){_0x1eff70=_0x1eff70-0x0;var _0x5c3103=_0x2581[_0x1eff70];return _0x5c3103;};'use strict';var Sequelize=require('sequelize');module[_0x1258('0x0')]={'name':{'type':Sequelize[_0x1258('0x1')]},'description':{'type':Sequelize[_0x1258('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1258('0x1')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x1258('0x2')},'password':{'type':Sequelize[_0x1258('0x1')]},'consumerKey':{'type':Sequelize[_0x1258('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x1258('0x1')]},'tokenSecret':{'type':Sequelize[_0x1258('0x1')]},'serverUrl':{'type':Sequelize[_0x1258('0x1')]},'type':{'type':Sequelize[_0x1258('0x3')](_0x1258('0x4'),_0x1258('0x5')),'defaultValue':_0x1258('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 9866d28..5879698 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 _0x0f1c=['username','consumerKey','consumerSecret','token','substring','GET','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','%s:%s','password','toString','concat','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','update','destroy','stack','name','map','DeskAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','length','find','create','body','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0x0f1c,0x96));var _0xc0f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f1c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc0f1('0x0'));var emlformat=require(_0xc0f1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc0f1('0x2'));var jsonpatch=require(_0xc0f1('0x3'));var rp=require('request-promise');var moment=require(_0xc0f1('0x4'));var BPromise=require(_0xc0f1('0x5'));var Mustache=require(_0xc0f1('0x6'));var util=require(_0xc0f1('0x7'));var path=require(_0xc0f1('0x8'));var sox=require('sox');var csv=require(_0xc0f1('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc0f1('0xa'));var squel=require(_0xc0f1('0xb'));var crypto=require(_0xc0f1('0xc'));var jsforce=require(_0xc0f1('0xd'));var deskjs=require(_0xc0f1('0xe'));var toCsv=require(_0xc0f1('0x9'));var querystring=require('querystring');var Papa=require(_0xc0f1('0xf'));var Redis=require(_0xc0f1('0x10'));var authService=require(_0xc0f1('0x11'));var qs=require(_0xc0f1('0x12'));var as=require(_0xc0f1('0x13'));var hardwareService=require(_0xc0f1('0x14'));var logger=require(_0xc0f1('0x15'))(_0xc0f1('0x16'));var utils=require(_0xc0f1('0x17'));var config=require(_0xc0f1('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xc0f1('0x19'));var client=jayson[_0xc0f1('0x1a')][_0xc0f1('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x17eb15,_0x290d41,_0x4e502b){if(_0x4e502b){var _0x430627=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x430627[_0xc0f1('0x1c')](_0x290d41)){return _0x17eb15;}else{throw new db[(_0xc0f1('0x1d'))][(_0xc0f1('0x1e'))](_0xc0f1('0x1f'));}}else{return _0x17eb15;}}function respondWithRpcPromise(_0x4894a7,_0x2448e8,_0x19ed04,_0x5271e5){return new BPromise(function(_0x18b3aa,_0x497a28){var _0x319827=_0x5271e5||client;return _0x319827[_0xc0f1('0x20')](_0x4894a7,_0x19ed04)[_0xc0f1('0x21')](function(_0x485e09){logger['info'](_0xc0f1('0x22'),_0x2448e8,_0xc0f1('0x23'));logger[_0xc0f1('0x24')](_0xc0f1('0x25'),_0x2448e8,_0xc0f1('0x23'),JSON['stringify'](_0x485e09));if(_0x485e09['error']){if(_0x485e09[_0xc0f1('0x26')][_0xc0f1('0x27')]===0x1f4){logger['error'](_0xc0f1('0x22'),_0x2448e8,_0x485e09[_0xc0f1('0x26')]['message']);return _0x497a28(_0x485e09[_0xc0f1('0x26')]['message']);}logger[_0xc0f1('0x26')]('DeskAccount,\x20%s,\x20%s',_0x2448e8,_0x485e09[_0xc0f1('0x26')][_0xc0f1('0x28')]);return _0x18b3aa(_0x485e09[_0xc0f1('0x26')]['message']);}else{logger[_0xc0f1('0x29')](_0xc0f1('0x22'),_0x2448e8,_0xc0f1('0x23'));_0x18b3aa(_0x485e09[_0xc0f1('0x2a')][_0xc0f1('0x28')]);}})['catch'](function(_0x41083f){logger[_0xc0f1('0x26')](_0xc0f1('0x22'),_0x2448e8,_0x41083f);_0x497a28(_0x41083f);});});}function respondWithStatusCode(_0x1f3c45,_0x3ab3cd){_0x3ab3cd=_0x3ab3cd||0xcc;return function(_0x56433b){if(_0x56433b){return _0x1f3c45[_0xc0f1('0x2b')](_0x3ab3cd);}return _0x1f3c45[_0xc0f1('0x2c')](_0x3ab3cd)[_0xc0f1('0x2d')]();};}function respondWithResult(_0x403738,_0x594df6){_0x594df6=_0x594df6||0xc8;return function(_0x11b729){if(_0x11b729){return _0x403738[_0xc0f1('0x2c')](_0x594df6)['json'](_0x11b729);}};}function respondWithFilteredResult(_0x2bae7e,_0x23863f){return function(_0x27453d){if(_0x27453d){var _0x2e1b25=_0x27453d['count'],_0x57ecb2=_0x23863f[_0xc0f1('0x2e')],_0x2949c6=_0x23863f['offset']+_0x23863f[_0xc0f1('0x2f')],_0x41bfe5;if(_0x2949c6>=_0x2e1b25){_0x2949c6=_0x2e1b25;_0x41bfe5=0xc8;}else{_0x41bfe5=0xce;}_0x2bae7e[_0xc0f1('0x2c')](_0x41bfe5);return _0x2bae7e['set'](_0xc0f1('0x30'),_0x57ecb2+'-'+_0x2949c6+'/'+_0x2e1b25)[_0xc0f1('0x31')](_0x27453d);}return null;};}function patchUpdates(_0x351025){return function(_0x5444dc){try{jsonpatch[_0xc0f1('0x32')](_0x5444dc,_0x351025,!![]);}catch(_0x15b3ac){return BPromise[_0xc0f1('0x33')](_0x15b3ac);}return _0x5444dc[_0xc0f1('0x34')]();};}function saveUpdates(_0xaf408e,_0x3131db){return function(_0x567ebe){if(_0x567ebe){return _0x567ebe[_0xc0f1('0x35')](_0xaf408e)[_0xc0f1('0x21')](function(_0x1815bc){return _0x1815bc;});}return null;};}function removeEntity(_0x1fd122,_0x5b01ee){return function(_0xe64fe1){if(_0xe64fe1){return _0xe64fe1[_0xc0f1('0x36')]()[_0xc0f1('0x21')](function(){_0x1fd122['status'](0xcc)[_0xc0f1('0x2d')]();});}};}function handleEntityNotFound(_0x2fd562,_0x122125){return function(_0x397b8e){if(!_0x397b8e){_0x2fd562[_0xc0f1('0x2b')](0x194);}return _0x397b8e;};}function handleError(_0x501437,_0x1d9722){_0x1d9722=_0x1d9722||0x1f4;return function(_0x5c2c52){logger['error'](_0x5c2c52[_0xc0f1('0x37')]);if(_0x5c2c52[_0xc0f1('0x38')]){delete _0x5c2c52[_0xc0f1('0x38')];}_0x501437[_0xc0f1('0x2c')](_0x1d9722)['send'](_0x5c2c52);};}exports['index']=function(_0x322bca,_0x212834){var _0x4f341f={},_0x2df39d={},_0x41c87d={'count':0x0,'rows':[]};var _0x1bf88b=_[_0xc0f1('0x39')](db[_0xc0f1('0x3a')][_0xc0f1('0x3b')],function(_0x134142){return{'name':_0x134142['fieldName'],'type':_0x134142[_0xc0f1('0x3c')][_0xc0f1('0x3d')]};});_0x2df39d[_0xc0f1('0x3e')]=_['map'](_0x1bf88b,_0xc0f1('0x38'));_0x2df39d[_0xc0f1('0x3f')]=_[_0xc0f1('0x40')](_0x322bca[_0xc0f1('0x3f')]);_0x2df39d[_0xc0f1('0x41')]=_[_0xc0f1('0x42')](_0x2df39d[_0xc0f1('0x3e')],_0x2df39d[_0xc0f1('0x3f')]);_0x4f341f[_0xc0f1('0x43')]=_['intersection'](_0x2df39d[_0xc0f1('0x3e')],qs['fields'](_0x322bca[_0xc0f1('0x3f')][_0xc0f1('0x44')]));_0x4f341f['attributes']=_0x4f341f[_0xc0f1('0x43')]['length']?_0x4f341f[_0xc0f1('0x43')]:_0x2df39d[_0xc0f1('0x3e')];if(!_0x322bca[_0xc0f1('0x3f')]['hasOwnProperty'](_0xc0f1('0x45'))){_0x4f341f[_0xc0f1('0x2f')]=qs[_0xc0f1('0x2f')](_0x322bca['query'][_0xc0f1('0x2f')]);_0x4f341f[_0xc0f1('0x2e')]=qs[_0xc0f1('0x2e')](_0x322bca[_0xc0f1('0x3f')]['offset']);}_0x4f341f[_0xc0f1('0x46')]=qs[_0xc0f1('0x47')](_0x322bca[_0xc0f1('0x3f')][_0xc0f1('0x47')]);_0x4f341f[_0xc0f1('0x48')]=qs[_0xc0f1('0x41')](_[_0xc0f1('0x49')](_0x322bca[_0xc0f1('0x3f')],_0x2df39d['filters']),_0x1bf88b);if(_0x322bca[_0xc0f1('0x3f')][_0xc0f1('0x4a')]){_0x4f341f[_0xc0f1('0x48')]=_[_0xc0f1('0x4b')](_0x4f341f[_0xc0f1('0x48')],{'$or':_[_0xc0f1('0x39')](_0x1bf88b,function(_0x395a51){if(_0x395a51[_0xc0f1('0x3c')]!==_0xc0f1('0x4c')){var _0x45a791={};_0x45a791[_0x395a51[_0xc0f1('0x38')]]={'$like':'%'+_0x322bca[_0xc0f1('0x3f')]['filter']+'%'};return _0x45a791;}})});}_0x4f341f=_[_0xc0f1('0x4b')]({},_0x4f341f,_0x322bca[_0xc0f1('0x4d')]);var _0x537bd3={'where':_0x4f341f[_0xc0f1('0x48')]};return db[_0xc0f1('0x3a')][_0xc0f1('0x4e')](_0x537bd3)[_0xc0f1('0x21')](function(_0xbd4948){_0x41c87d[_0xc0f1('0x4e')]=_0xbd4948;if(_0x322bca[_0xc0f1('0x3f')][_0xc0f1('0x4f')]){_0x4f341f[_0xc0f1('0x50')]=[{'all':!![]}];}return db[_0xc0f1('0x3a')][_0xc0f1('0x51')](_0x4f341f);})[_0xc0f1('0x21')](function(_0x587630){_0x41c87d['rows']=_0x587630;return _0x41c87d;})[_0xc0f1('0x21')](respondWithFilteredResult(_0x212834,_0x4f341f))[_0xc0f1('0x52')](handleError(_0x212834,null));};exports[_0xc0f1('0x53')]=function(_0x2eb476,_0x1fbb18){var _0x1e6c7d={'raw':![],'where':{'id':_0x2eb476[_0xc0f1('0x54')]['id']}},_0x174a32={};_0x174a32[_0xc0f1('0x3e')]=_[_0xc0f1('0x40')](db[_0xc0f1('0x3a')][_0xc0f1('0x3b')]);_0x174a32['query']=_[_0xc0f1('0x40')](_0x2eb476[_0xc0f1('0x3f')]);_0x174a32[_0xc0f1('0x41')]=_[_0xc0f1('0x42')](_0x174a32[_0xc0f1('0x3e')],_0x174a32[_0xc0f1('0x3f')]);_0x1e6c7d[_0xc0f1('0x43')]=_[_0xc0f1('0x42')](_0x174a32[_0xc0f1('0x3e')],qs[_0xc0f1('0x44')](_0x2eb476[_0xc0f1('0x3f')][_0xc0f1('0x44')]));_0x1e6c7d['attributes']=_0x1e6c7d[_0xc0f1('0x43')][_0xc0f1('0x55')]?_0x1e6c7d['attributes']:_0x174a32['model'];if(_0x2eb476['query'][_0xc0f1('0x4f')]){_0x1e6c7d['include']=[{'all':!![]}];}_0x1e6c7d=_[_0xc0f1('0x4b')]({},_0x1e6c7d,_0x2eb476[_0xc0f1('0x4d')]);return db[_0xc0f1('0x3a')][_0xc0f1('0x56')](_0x1e6c7d)[_0xc0f1('0x21')](handleEntityNotFound(_0x1fbb18,null))[_0xc0f1('0x21')](respondWithResult(_0x1fbb18,null))[_0xc0f1('0x52')](handleError(_0x1fbb18,null));};exports[_0xc0f1('0x57')]=function(_0xa7a816,_0x4ba476){return db[_0xc0f1('0x3a')][_0xc0f1('0x57')](_0xa7a816[_0xc0f1('0x58')],{})[_0xc0f1('0x21')](respondWithResult(_0x4ba476,0xc9))['catch'](handleError(_0x4ba476,null));};exports['update']=function(_0xbecaac,_0x1ccd1d){if(_0xbecaac[_0xc0f1('0x58')]['id']){delete _0xbecaac[_0xc0f1('0x58')]['id'];}return db['DeskAccount']['find']({'where':{'id':_0xbecaac[_0xc0f1('0x54')]['id']}})[_0xc0f1('0x21')](handleEntityNotFound(_0x1ccd1d,null))['then'](saveUpdates(_0xbecaac[_0xc0f1('0x58')],null))['then'](respondWithResult(_0x1ccd1d,null))[_0xc0f1('0x52')](handleError(_0x1ccd1d,null));};exports[_0xc0f1('0x36')]=function(_0x18a577,_0xc660c2){return db[_0xc0f1('0x3a')][_0xc0f1('0x56')]({'where':{'id':_0x18a577[_0xc0f1('0x54')]['id']}})[_0xc0f1('0x21')](handleEntityNotFound(_0xc660c2,null))[_0xc0f1('0x21')](removeEntity(_0xc660c2,null))[_0xc0f1('0x52')](handleError(_0xc660c2,null));};exports[_0xc0f1('0x59')]=function(_0x3c6719,_0x21ed3c,_0xd9fd6a){var _0x501151={};var _0x5489cf={};var _0x3edb7b;var _0x458d4c;return db[_0xc0f1('0x3a')][_0xc0f1('0x5a')]({'where':{'id':_0x3c6719[_0xc0f1('0x54')]['id']}})[_0xc0f1('0x21')](handleEntityNotFound(_0x21ed3c,null))[_0xc0f1('0x21')](function(_0x31f0fe){if(_0x31f0fe){_0x3edb7b=_0x31f0fe;_0x5489cf[_0xc0f1('0x3e')]=_[_0xc0f1('0x40')](db[_0xc0f1('0x5b')][_0xc0f1('0x3b')]);_0x5489cf[_0xc0f1('0x3f')]=_[_0xc0f1('0x40')](_0x3c6719['query']);_0x5489cf[_0xc0f1('0x41')]=_[_0xc0f1('0x42')](_0x5489cf['model'],_0x5489cf[_0xc0f1('0x3f')]);_0x501151['attributes']=_['intersection'](_0x5489cf[_0xc0f1('0x3e')],qs[_0xc0f1('0x44')](_0x3c6719[_0xc0f1('0x3f')]['fields']));_0x501151['attributes']=_0x501151[_0xc0f1('0x43')][_0xc0f1('0x55')]?_0x501151[_0xc0f1('0x43')]:_0x5489cf[_0xc0f1('0x3e')];_0x501151[_0xc0f1('0x46')]=qs[_0xc0f1('0x47')](_0x3c6719['query'][_0xc0f1('0x47')]);_0x501151[_0xc0f1('0x48')]=qs[_0xc0f1('0x41')](_[_0xc0f1('0x49')](_0x3c6719[_0xc0f1('0x3f')],_0x5489cf[_0xc0f1('0x41')]));if(_0x3c6719['query'][_0xc0f1('0x4a')]){_0x501151[_0xc0f1('0x48')]=_[_0xc0f1('0x4b')](_0x501151[_0xc0f1('0x48')],{'$or':_[_0xc0f1('0x39')](_0x501151[_0xc0f1('0x43')],function(_0x4e4325){var _0x4be9d3={};_0x4be9d3[_0x4e4325]={'$like':'%'+_0x3c6719[_0xc0f1('0x3f')][_0xc0f1('0x4a')]+'%'};return _0x4be9d3;})});}_0x501151=_['merge']({},_0x501151,_0x3c6719[_0xc0f1('0x4d')]);return _0x3edb7b[_0xc0f1('0x59')](_0x501151);}})[_0xc0f1('0x21')](function(_0x435020){if(_0x435020){_0x458d4c=_0x435020[_0xc0f1('0x55')];if(!_0x3c6719[_0xc0f1('0x3f')][_0xc0f1('0x5c')](_0xc0f1('0x45'))){_0x501151['limit']=qs[_0xc0f1('0x2f')](_0x3c6719[_0xc0f1('0x3f')][_0xc0f1('0x2f')]);_0x501151['offset']=qs[_0xc0f1('0x2e')](_0x3c6719[_0xc0f1('0x3f')][_0xc0f1('0x2e')]);}return _0x3edb7b[_0xc0f1('0x59')](_0x501151);}})['then'](function(_0x5dd7a7){if(_0x5dd7a7){return _0x5dd7a7?{'count':_0x458d4c,'rows':_0x5dd7a7}:null;}})['then'](respondWithResult(_0x21ed3c,null))[_0xc0f1('0x52')](handleError(_0x21ed3c,null));};exports['addConfiguration']=function(_0x150299,_0x54bd3b,_0x59ac41){if(_0x150299[_0xc0f1('0x58')]['id']){delete _0x150299[_0xc0f1('0x58')]['id'];}return db[_0xc0f1('0x3a')]['findOne']({'where':{'id':_0x150299[_0xc0f1('0x54')]['id']}})[_0xc0f1('0x21')](handleEntityNotFound(_0x54bd3b,null))['then'](function(_0x4f169f){if(_0x4f169f){_0x150299[_0xc0f1('0x58')]['AccountId']=_0x4f169f['id'];_0x150299[_0xc0f1('0x58')][_0xc0f1('0x5d')]=integrations[_0xc0f1('0x5e')](_0x150299[_0xc0f1('0x58')][_0xc0f1('0x5f')],_0x150299[_0xc0f1('0x58')]['type']);_0x150299[_0xc0f1('0x58')][_0xc0f1('0x60')]=integrations[_0xc0f1('0x61')](_0x150299['body'][_0xc0f1('0x5f')],_0x150299[_0xc0f1('0x58')][_0xc0f1('0x3c')]);return db[_0xc0f1('0x5b')]['create'](_0x150299[_0xc0f1('0x58')],{'include':[{'model':db[_0xc0f1('0x62')],'as':_0xc0f1('0x5d')},{'model':db[_0xc0f1('0x62')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x54bd3b,null))['catch'](handleError(_0x54bd3b,null));};exports[_0xc0f1('0x63')]=function(_0x3fdd5c,_0x282178,_0x370699){var _0x3344a0=[{'name':'priority','label':_0xc0f1('0x64'),'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 _0xe53c92='';return db[_0xc0f1('0x3a')]['findOne']({'where':{'id':_0x3fdd5c[_0xc0f1('0x54')]['id']},'attributes':['id',_0xc0f1('0x65'),'authType',_0xc0f1('0x66'),'password',_0xc0f1('0x67'),_0xc0f1('0x68'),_0xc0f1('0x69'),'tokenSecret']})[_0xc0f1('0x21')](handleEntityNotFound(_0x282178,null))[_0xc0f1('0x21')](function(_0x516250){if(_0x516250){_0xe53c92=_0x516250[_0xc0f1('0x65')];var _0x55b33e=_0xe53c92['slice'](-0x1);if(_0x55b33e==='/'){_0xe53c92=_0xe53c92[_0xc0f1('0x6a')](0x0,_0xe53c92['lastIndexOf'](_0x55b33e));}var _0x5c138b={'method':_0xc0f1('0x6b'),'uri':util[_0xc0f1('0x6c')](_0xc0f1('0x6d'),_0xe53c92),'headers':{'Content-Type':_0xc0f1('0x6e'),'Accept':_0xc0f1('0x6e')},'json':!![]};if(_0x516250[_0xc0f1('0x6f')]===_0xc0f1('0x70')){_0x5c138b[_0xc0f1('0x71')][_0xc0f1('0x72')]=util['format']('Basic\x20%s',new Buffer(util['format'](_0xc0f1('0x73'),_0x516250['username'],_0x516250[_0xc0f1('0x74')]))[_0xc0f1('0x75')]('base64'));}return rp(_0x5c138b)['then'](function(_0x51885c){return _0x3344a0[_0xc0f1('0x76')](_['map'](_0x51885c[_0xc0f1('0x77')][_0xc0f1('0x78')],function(_0x162a81){return{'id':_0x162a81['name'],'name':_0x162a81['name'],'type':_0x162a81[_0xc0f1('0x3c')],'active':_0x162a81[_0xc0f1('0x79')],'label':_0x162a81[_0xc0f1('0x7a')],'custom':!![]};}));});}})['then'](function(_0x358fac){return{'count':_0x358fac[_0xc0f1('0x55')],'rows':_0x358fac};})[_0xc0f1('0x21')](respondWithResult(_0x282178,null))[_0xc0f1('0x52')](function(_0x348971){var _0x4067ef=_0x3fdd5c[_0xc0f1('0x3f')]['test']?0x1f4:_0x348971[_0xc0f1('0x7b')]||0x1f4;logger['error'](_0xc0f1('0x7c'),_0xc0f1('0x63'),_0x4067ef,JSON['stringify'](_0x348971));delete _0x348971[_0xc0f1('0x38')];if(_0x4067ef===0x191){_0x4067ef=0x190;}_0x282178[_0xc0f1('0x2c')](_0x4067ef)['send'](_0x3fdd5c[_0xc0f1('0x3f')][_0xc0f1('0x1c')]?{'message':_0xc0f1('0x7d'),'statusCode':_0x348971[_0xc0f1('0x7b')]}:_0x348971);});}; \ No newline at end of file +var _0xe593=['format','application/json','authType','basic','headers','%s:%s','password','base64','_embedded','entries','active','label','statusCode','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','map','rawAttributes','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','DeskAccount','include','findAll','rows','show','options','find','create','body','params','getConfigurations','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','username','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe593,0x85));var _0x3e59=function(_0x2724eb,_0x29ba09){_0x2724eb=_0x2724eb-0x0;var _0x199f23=_0xe593[_0x2724eb];return _0x199f23;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3e59('0x0'));var rimraf=require(_0x3e59('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e59('0x2'));var rp=require(_0x3e59('0x3'));var moment=require(_0x3e59('0x4'));var BPromise=require(_0x3e59('0x5'));var Mustache=require(_0x3e59('0x6'));var util=require(_0x3e59('0x7'));var path=require(_0x3e59('0x8'));var sox=require('sox');var csv=require(_0x3e59('0x9'));var ejs=require(_0x3e59('0xa'));var fs=require('fs');var _=require(_0x3e59('0xb'));var squel=require(_0x3e59('0xc'));var crypto=require(_0x3e59('0xd'));var jsforce=require(_0x3e59('0xe'));var deskjs=require(_0x3e59('0xf'));var toCsv=require(_0x3e59('0x9'));var querystring=require('querystring');var Papa=require(_0x3e59('0x10'));var Redis=require(_0x3e59('0x11'));var authService=require(_0x3e59('0x12'));var qs=require(_0x3e59('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e59('0x14'));var logger=require('../../config/logger')(_0x3e59('0x15'));var utils=require('../../config/utils');var config=require(_0x3e59('0x16'));var db=require(_0x3e59('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x3e59('0x18')][_0x3e59('0x19')]({'port':0x232a});function checkPasswordPattern(_0x295c74,_0x3ef1b6,_0x46d110){if(_0x46d110){var _0x28f1e3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28f1e3[_0x3e59('0x1a')](_0x3ef1b6)){return _0x295c74;}else{throw new db[(_0x3e59('0x1b'))][(_0x3e59('0x1c'))](_0x3e59('0x1d'));}}else{return _0x295c74;}}function respondWithRpcPromise(_0x286307,_0xb8fa12,_0x55a71c,_0x59a173){return new BPromise(function(_0x751a12,_0x5de980){var _0x4eb495=_0x59a173||client;return _0x4eb495[_0x3e59('0x1e')](_0x286307,_0x55a71c)['then'](function(_0x497843){logger[_0x3e59('0x1f')](_0x3e59('0x20'),_0xb8fa12,_0x3e59('0x21'));logger[_0x3e59('0x22')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0xb8fa12,_0x3e59('0x21'),JSON[_0x3e59('0x23')](_0x497843));if(_0x497843[_0x3e59('0x24')]){if(_0x497843[_0x3e59('0x24')][_0x3e59('0x25')]===0x1f4){logger[_0x3e59('0x24')](_0x3e59('0x20'),_0xb8fa12,_0x497843['error'][_0x3e59('0x26')]);return _0x5de980(_0x497843[_0x3e59('0x24')][_0x3e59('0x26')]);}logger[_0x3e59('0x24')](_0x3e59('0x20'),_0xb8fa12,_0x497843['error'][_0x3e59('0x26')]);return _0x751a12(_0x497843[_0x3e59('0x24')]['message']);}else{logger['info'](_0x3e59('0x20'),_0xb8fa12,_0x3e59('0x21'));_0x751a12(_0x497843[_0x3e59('0x27')]['message']);}})[_0x3e59('0x28')](function(_0x2675f0){logger['error'](_0x3e59('0x20'),_0xb8fa12,_0x2675f0);_0x5de980(_0x2675f0);});});}function respondWithStatusCode(_0x35d4a5,_0x185568){_0x185568=_0x185568||0xcc;return function(_0x32f4a5){if(_0x32f4a5){return _0x35d4a5[_0x3e59('0x29')](_0x185568);}return _0x35d4a5[_0x3e59('0x2a')](_0x185568)['end']();};}function respondWithResult(_0x122d75,_0x38acdf){_0x38acdf=_0x38acdf||0xc8;return function(_0x59588b){if(_0x59588b){return _0x122d75[_0x3e59('0x2a')](_0x38acdf)[_0x3e59('0x2b')](_0x59588b);}};}function respondWithFilteredResult(_0x338151,_0x34ee55){return function(_0x69daad){if(_0x69daad){var _0x4ddf9d=_0x69daad['count'],_0xc8a76f=_0x34ee55[_0x3e59('0x2c')],_0x3fd7c1=_0x34ee55[_0x3e59('0x2c')]+_0x34ee55[_0x3e59('0x2d')],_0x32c139;if(_0x3fd7c1>=_0x4ddf9d){_0x3fd7c1=_0x4ddf9d;_0x32c139=0xc8;}else{_0x32c139=0xce;}_0x338151[_0x3e59('0x2a')](_0x32c139);return _0x338151['set'](_0x3e59('0x2e'),_0xc8a76f+'-'+_0x3fd7c1+'/'+_0x4ddf9d)['json'](_0x69daad);}return null;};}function patchUpdates(_0x10366c){return function(_0xc16dfc){try{jsonpatch[_0x3e59('0x2f')](_0xc16dfc,_0x10366c,!![]);}catch(_0x33ff74){return BPromise[_0x3e59('0x30')](_0x33ff74);}return _0xc16dfc[_0x3e59('0x31')]();};}function saveUpdates(_0x5d1eff,_0x5beaaa){return function(_0xbd4c74){if(_0xbd4c74){return _0xbd4c74[_0x3e59('0x32')](_0x5d1eff)[_0x3e59('0x33')](function(_0x1f512a){return _0x1f512a;});}return null;};}function removeEntity(_0x3a4bb8,_0x1e5170){return function(_0x4bcd57){if(_0x4bcd57){return _0x4bcd57[_0x3e59('0x34')]()[_0x3e59('0x33')](function(){_0x3a4bb8['status'](0xcc)[_0x3e59('0x35')]();});}};}function handleEntityNotFound(_0x2aa06c,_0x22f34a){return function(_0x23050b){if(!_0x23050b){_0x2aa06c[_0x3e59('0x29')](0x194);}return _0x23050b;};}function handleError(_0x486f6e,_0x57628f){_0x57628f=_0x57628f||0x1f4;return function(_0x2fdaca){logger['error'](_0x2fdaca[_0x3e59('0x36')]);if(_0x2fdaca[_0x3e59('0x37')]){delete _0x2fdaca[_0x3e59('0x37')];}_0x486f6e[_0x3e59('0x2a')](_0x57628f)[_0x3e59('0x38')](_0x2fdaca);};}exports['index']=function(_0x29a704,_0x34424e){var _0xa81547={},_0x39ed63={},_0x317c98={'count':0x0,'rows':[]};var _0x4d3080=_[_0x3e59('0x39')](db['DeskAccount'][_0x3e59('0x3a')],function(_0xce96da){return{'name':_0xce96da['fieldName'],'type':_0xce96da[_0x3e59('0x3b')]['key']};});_0x39ed63[_0x3e59('0x3c')]=_[_0x3e59('0x39')](_0x4d3080,_0x3e59('0x37'));_0x39ed63['query']=_[_0x3e59('0x3d')](_0x29a704[_0x3e59('0x3e')]);_0x39ed63[_0x3e59('0x3f')]=_['intersection'](_0x39ed63[_0x3e59('0x3c')],_0x39ed63[_0x3e59('0x3e')]);_0xa81547[_0x3e59('0x40')]=_[_0x3e59('0x41')](_0x39ed63[_0x3e59('0x3c')],qs[_0x3e59('0x42')](_0x29a704['query'][_0x3e59('0x42')]));_0xa81547['attributes']=_0xa81547[_0x3e59('0x40')][_0x3e59('0x43')]?_0xa81547['attributes']:_0x39ed63['model'];if(!_0x29a704[_0x3e59('0x3e')][_0x3e59('0x44')](_0x3e59('0x45'))){_0xa81547['limit']=qs['limit'](_0x29a704[_0x3e59('0x3e')][_0x3e59('0x2d')]);_0xa81547[_0x3e59('0x2c')]=qs[_0x3e59('0x2c')](_0x29a704[_0x3e59('0x3e')][_0x3e59('0x2c')]);}_0xa81547[_0x3e59('0x46')]=qs['sort'](_0x29a704[_0x3e59('0x3e')][_0x3e59('0x47')]);_0xa81547[_0x3e59('0x48')]=qs[_0x3e59('0x3f')](_['pick'](_0x29a704[_0x3e59('0x3e')],_0x39ed63[_0x3e59('0x3f')]),_0x4d3080);if(_0x29a704[_0x3e59('0x3e')][_0x3e59('0x49')]){_0xa81547[_0x3e59('0x48')]=_[_0x3e59('0x4a')](_0xa81547[_0x3e59('0x48')],{'$or':_['map'](_0x4d3080,function(_0x5a8bbe){if(_0x5a8bbe[_0x3e59('0x3b')]!==_0x3e59('0x4b')){var _0x2283fb={};_0x2283fb[_0x5a8bbe[_0x3e59('0x37')]]={'$like':'%'+_0x29a704['query']['filter']+'%'};return _0x2283fb;}})});}_0xa81547=_[_0x3e59('0x4a')]({},_0xa81547,_0x29a704['options']);var _0x84888b={'where':_0xa81547['where']};return db[_0x3e59('0x4c')]['count'](_0x84888b)[_0x3e59('0x33')](function(_0x1dbc29){_0x317c98['count']=_0x1dbc29;if(_0x29a704[_0x3e59('0x3e')]['includeAll']){_0xa81547[_0x3e59('0x4d')]=[{'all':!![]}];}return db[_0x3e59('0x4c')][_0x3e59('0x4e')](_0xa81547);})[_0x3e59('0x33')](function(_0x48b2af){_0x317c98[_0x3e59('0x4f')]=_0x48b2af;return _0x317c98;})[_0x3e59('0x33')](respondWithFilteredResult(_0x34424e,_0xa81547))[_0x3e59('0x28')](handleError(_0x34424e,null));};exports[_0x3e59('0x50')]=function(_0x2612ec,_0x7425af){var _0x2949b4={'raw':![],'where':{'id':_0x2612ec['params']['id']}},_0x34bb05={};_0x34bb05['model']=_[_0x3e59('0x3d')](db[_0x3e59('0x4c')][_0x3e59('0x3a')]);_0x34bb05['query']=_[_0x3e59('0x3d')](_0x2612ec[_0x3e59('0x3e')]);_0x34bb05['filters']=_['intersection'](_0x34bb05[_0x3e59('0x3c')],_0x34bb05[_0x3e59('0x3e')]);_0x2949b4['attributes']=_['intersection'](_0x34bb05[_0x3e59('0x3c')],qs[_0x3e59('0x42')](_0x2612ec[_0x3e59('0x3e')]['fields']));_0x2949b4[_0x3e59('0x40')]=_0x2949b4['attributes'][_0x3e59('0x43')]?_0x2949b4[_0x3e59('0x40')]:_0x34bb05[_0x3e59('0x3c')];if(_0x2612ec[_0x3e59('0x3e')]['includeAll']){_0x2949b4[_0x3e59('0x4d')]=[{'all':!![]}];}_0x2949b4=_[_0x3e59('0x4a')]({},_0x2949b4,_0x2612ec[_0x3e59('0x51')]);return db[_0x3e59('0x4c')][_0x3e59('0x52')](_0x2949b4)['then'](handleEntityNotFound(_0x7425af,null))['then'](respondWithResult(_0x7425af,null))['catch'](handleError(_0x7425af,null));};exports[_0x3e59('0x53')]=function(_0x2b9b3e,_0x21fd9e){return db[_0x3e59('0x4c')][_0x3e59('0x53')](_0x2b9b3e[_0x3e59('0x54')],{})[_0x3e59('0x33')](respondWithResult(_0x21fd9e,0xc9))[_0x3e59('0x28')](handleError(_0x21fd9e,null));};exports[_0x3e59('0x32')]=function(_0x5bd5d4,_0x374976){if(_0x5bd5d4[_0x3e59('0x54')]['id']){delete _0x5bd5d4['body']['id'];}return db[_0x3e59('0x4c')][_0x3e59('0x52')]({'where':{'id':_0x5bd5d4[_0x3e59('0x55')]['id']}})[_0x3e59('0x33')](handleEntityNotFound(_0x374976,null))[_0x3e59('0x33')](saveUpdates(_0x5bd5d4['body'],null))[_0x3e59('0x33')](respondWithResult(_0x374976,null))[_0x3e59('0x28')](handleError(_0x374976,null));};exports[_0x3e59('0x34')]=function(_0xe489b3,_0x551687){return db['DeskAccount'][_0x3e59('0x52')]({'where':{'id':_0xe489b3[_0x3e59('0x55')]['id']}})[_0x3e59('0x33')](handleEntityNotFound(_0x551687,null))['then'](removeEntity(_0x551687,null))[_0x3e59('0x28')](handleError(_0x551687,null));};exports[_0x3e59('0x56')]=function(_0x1b99d2,_0x5d817d,_0x536dd0){var _0x893b17={};var _0x12d7c6={};var _0x37d006;var _0xe93026;return db['DeskAccount'][_0x3e59('0x57')]({'where':{'id':_0x1b99d2[_0x3e59('0x55')]['id']}})[_0x3e59('0x33')](handleEntityNotFound(_0x5d817d,null))[_0x3e59('0x33')](function(_0x56cce6){if(_0x56cce6){_0x37d006=_0x56cce6;_0x12d7c6['model']=_[_0x3e59('0x3d')](db['DeskConfiguration'][_0x3e59('0x3a')]);_0x12d7c6[_0x3e59('0x3e')]=_[_0x3e59('0x3d')](_0x1b99d2[_0x3e59('0x3e')]);_0x12d7c6['filters']=_['intersection'](_0x12d7c6[_0x3e59('0x3c')],_0x12d7c6[_0x3e59('0x3e')]);_0x893b17['attributes']=_[_0x3e59('0x41')](_0x12d7c6['model'],qs['fields'](_0x1b99d2['query'][_0x3e59('0x42')]));_0x893b17['attributes']=_0x893b17[_0x3e59('0x40')][_0x3e59('0x43')]?_0x893b17['attributes']:_0x12d7c6[_0x3e59('0x3c')];_0x893b17[_0x3e59('0x46')]=qs['sort'](_0x1b99d2[_0x3e59('0x3e')][_0x3e59('0x47')]);_0x893b17[_0x3e59('0x48')]=qs[_0x3e59('0x3f')](_['pick'](_0x1b99d2[_0x3e59('0x3e')],_0x12d7c6[_0x3e59('0x3f')]));if(_0x1b99d2['query'][_0x3e59('0x49')]){_0x893b17[_0x3e59('0x48')]=_[_0x3e59('0x4a')](_0x893b17[_0x3e59('0x48')],{'$or':_[_0x3e59('0x39')](_0x893b17[_0x3e59('0x40')],function(_0x4163a5){var _0xd31d59={};_0xd31d59[_0x4163a5]={'$like':'%'+_0x1b99d2[_0x3e59('0x3e')][_0x3e59('0x49')]+'%'};return _0xd31d59;})});}_0x893b17=_[_0x3e59('0x4a')]({},_0x893b17,_0x1b99d2[_0x3e59('0x51')]);return _0x37d006[_0x3e59('0x56')](_0x893b17);}})['then'](function(_0xf9e2af){if(_0xf9e2af){_0xe93026=_0xf9e2af[_0x3e59('0x43')];if(!_0x1b99d2[_0x3e59('0x3e')][_0x3e59('0x44')]('nolimit')){_0x893b17[_0x3e59('0x2d')]=qs['limit'](_0x1b99d2['query'][_0x3e59('0x2d')]);_0x893b17[_0x3e59('0x2c')]=qs[_0x3e59('0x2c')](_0x1b99d2[_0x3e59('0x3e')][_0x3e59('0x2c')]);}return _0x37d006['getConfigurations'](_0x893b17);}})[_0x3e59('0x33')](function(_0x1a6244){if(_0x1a6244){return _0x1a6244?{'count':_0xe93026,'rows':_0x1a6244}:null;}})[_0x3e59('0x33')](respondWithResult(_0x5d817d,null))[_0x3e59('0x28')](handleError(_0x5d817d,null));};exports['addConfiguration']=function(_0x20455a,_0x43e092,_0x25d441){if(_0x20455a[_0x3e59('0x54')]['id']){delete _0x20455a['body']['id'];}return db['DeskAccount'][_0x3e59('0x57')]({'where':{'id':_0x20455a['params']['id']}})[_0x3e59('0x33')](handleEntityNotFound(_0x43e092,null))[_0x3e59('0x33')](function(_0x405e3d){if(_0x405e3d){_0x20455a[_0x3e59('0x54')][_0x3e59('0x58')]=_0x405e3d['id'];_0x20455a[_0x3e59('0x54')][_0x3e59('0x59')]=integrations[_0x3e59('0x5a')](_0x20455a[_0x3e59('0x54')][_0x3e59('0x5b')],_0x20455a[_0x3e59('0x54')][_0x3e59('0x3b')]);_0x20455a['body'][_0x3e59('0x5c')]=integrations[_0x3e59('0x5d')](_0x20455a[_0x3e59('0x54')][_0x3e59('0x5b')],_0x20455a[_0x3e59('0x54')][_0x3e59('0x3b')]);return db[_0x3e59('0x5e')][_0x3e59('0x53')](_0x20455a[_0x3e59('0x54')],{'include':[{'model':db['DeskField'],'as':_0x3e59('0x59')},{'model':db[_0x3e59('0x5f')],'as':_0x3e59('0x5c')}]});}return null;})[_0x3e59('0x33')](respondWithResult(_0x43e092,null))['catch'](handleError(_0x43e092,null));};exports[_0x3e59('0x60')]=function(_0x269949,_0x9b0903,_0x155d34){var _0x5069a5=[{'name':'priority','label':_0x3e59('0x61'),'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 _0x11c69a='';return db['DeskAccount']['findOne']({'where':{'id':_0x269949[_0x3e59('0x55')]['id']},'attributes':['id',_0x3e59('0x62'),'authType',_0x3e59('0x63'),'password','consumerKey',_0x3e59('0x64'),_0x3e59('0x65'),_0x3e59('0x66')]})[_0x3e59('0x33')](handleEntityNotFound(_0x9b0903,null))['then'](function(_0x2a5110){if(_0x2a5110){_0x11c69a=_0x2a5110['remoteUri'];var _0x108a44=_0x11c69a[_0x3e59('0x67')](-0x1);if(_0x108a44==='/'){_0x11c69a=_0x11c69a[_0x3e59('0x68')](0x0,_0x11c69a[_0x3e59('0x69')](_0x108a44));}var _0x3c0360={'method':_0x3e59('0x6a'),'uri':util[_0x3e59('0x6b')]('%s/custom_fields',_0x11c69a),'headers':{'Content-Type':_0x3e59('0x6c'),'Accept':_0x3e59('0x6c')},'json':!![]};if(_0x2a5110[_0x3e59('0x6d')]===_0x3e59('0x6e')){_0x3c0360[_0x3e59('0x6f')]['Authorization']=util[_0x3e59('0x6b')]('Basic\x20%s',new Buffer(util[_0x3e59('0x6b')](_0x3e59('0x70'),_0x2a5110[_0x3e59('0x63')],_0x2a5110[_0x3e59('0x71')]))['toString'](_0x3e59('0x72')));}return rp(_0x3c0360)[_0x3e59('0x33')](function(_0x53ca1d){return _0x5069a5['concat'](_['map'](_0x53ca1d[_0x3e59('0x73')][_0x3e59('0x74')],function(_0x384548){return{'id':_0x384548[_0x3e59('0x37')],'name':_0x384548[_0x3e59('0x37')],'type':_0x384548['type'],'active':_0x384548[_0x3e59('0x75')],'label':_0x384548[_0x3e59('0x76')],'custom':!![]};}));});}})['then'](function(_0x12636d){return{'count':_0x12636d[_0x3e59('0x43')],'rows':_0x12636d};})[_0x3e59('0x33')](respondWithResult(_0x9b0903,null))[_0x3e59('0x28')](function(_0x7e69a0){var _0x45bee6=_0x269949['query']['test']?0x1f4:_0x7e69a0[_0x3e59('0x77')]||0x1f4;logger[_0x3e59('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x3e59('0x60'),_0x45bee6,JSON[_0x3e59('0x23')](_0x7e69a0));delete _0x7e69a0[_0x3e59('0x37')];if(_0x45bee6===0x191){_0x45bee6=0x190;}_0x9b0903[_0x3e59('0x2a')](_0x45bee6)['send'](_0x269949[_0x3e59('0x3e')][_0x3e59('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x7e69a0[_0x3e59('0x77')]}:_0x7e69a0);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 35acedf..af0629a 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 _0x8f64=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./intDeskAccount.attributes','exports','DeskAccount','int_desk_accounts'];(function(_0x231f01,_0x1b6514){var _0x28b6da=function(_0xf37ad8){while(--_0xf37ad8){_0x231f01['push'](_0x231f01['shift']());}};_0x28b6da(++_0x1b6514);}(_0x8f64,0x150));var _0x48f6=function(_0x6d3b3d,_0x48cd05){_0x6d3b3d=_0x6d3b3d-0x0;var _0x5d2140=_0x8f64[_0x6d3b3d];return _0x5d2140;};'use strict';var _=require(_0x48f6('0x0'));var util=require(_0x48f6('0x1'));var logger=require(_0x48f6('0x2'))(_0x48f6('0x3'));var moment=require(_0x48f6('0x4'));var BPromise=require(_0x48f6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x48f6('0x6'));var config=require(_0x48f6('0x7'));var attributes=require(_0x48f6('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x48f6('0x9')]=function(_0x32fb17,_0x434e70){return _0x32fb17['define'](_0x48f6('0xa'),attributes,{'tableName':_0x48f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf04a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_desk_accounts'];(function(_0x53a9cc,_0x5627a3){var _0x41e130=function(_0xd40975){while(--_0xd40975){_0x53a9cc['push'](_0x53a9cc['shift']());}};_0x41e130(++_0x5627a3);}(_0xf04a,0xa9));var _0xaf04=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf04a[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xaf04('0x0'));var logger=require(_0xaf04('0x1'))(_0xaf04('0x2'));var moment=require(_0xaf04('0x3'));var BPromise=require(_0xaf04('0x4'));var rp=require(_0xaf04('0x5'));var fs=require('fs');var path=require(_0xaf04('0x6'));var rimraf=require(_0xaf04('0x7'));var config=require(_0xaf04('0x8'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xaf04('0x9'));module[_0xaf04('0xa')]=function(_0x583147,_0x32f9f0){return _0x583147[_0xaf04('0xb')]('DeskAccount',attributes,{'tableName':_0xaf04('0xc'),'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 d06e397..7cc2740 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 _0xd055=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetDeskAccount','findAll','options','raw','attributes','limit','map','include','model','ShowDeskAccount','find','where','lodash','util'];(function(_0x53ba84,_0x532ae8){var _0x1d8daa=function(_0x2a7863){while(--_0x2a7863){_0x53ba84['push'](_0x53ba84['shift']());}};_0x1d8daa(++_0x532ae8);}(_0xd055,0x15c));var _0x5d05=function(_0x16b1b2,_0xd19dfa){_0x16b1b2=_0x16b1b2-0x0;var _0x162e37=_0xd055[_0x16b1b2];return _0x162e37;};'use strict';var _=require(_0x5d05('0x0'));var util=require(_0x5d05('0x1'));var moment=require('moment');var BPromise=require(_0x5d05('0x2'));var rs=require(_0x5d05('0x3'));var fs=require('fs');var Redis=require(_0x5d05('0x4'));var db=require(_0x5d05('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d05('0x6'))(_0x5d05('0x7'));var config=require(_0x5d05('0x8'));var jayson=require(_0x5d05('0x9'));var client=jayson[_0x5d05('0xa')][_0x5d05('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x290d27,_0x5e5582,_0x24be17){return new BPromise(function(_0x3cbd38,_0x3b1971){return client['request'](_0x290d27,_0x24be17)[_0x5d05('0xc')](function(_0x250eaa){logger['info'](_0x5d05('0xd'),_0x5e5582,_0x5d05('0xe'));logger[_0x5d05('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5e5582,_0x5d05('0xe'),JSON[_0x5d05('0x10')](_0x250eaa));if(_0x250eaa['error']){if(_0x250eaa[_0x5d05('0x11')][_0x5d05('0x12')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x5e5582,_0x250eaa[_0x5d05('0x11')][_0x5d05('0x13')]);return _0x3b1971(_0x250eaa[_0x5d05('0x11')][_0x5d05('0x13')]);}logger['error'](_0x5d05('0xd'),_0x5e5582,_0x250eaa[_0x5d05('0x11')][_0x5d05('0x13')]);return _0x3cbd38(_0x250eaa[_0x5d05('0x11')][_0x5d05('0x13')]);}else{logger[_0x5d05('0x14')](_0x5d05('0xd'),_0x5e5582,_0x5d05('0xe'));_0x3cbd38(_0x250eaa[_0x5d05('0x15')][_0x5d05('0x13')]);}})[_0x5d05('0x16')](function(_0x3790c2){logger[_0x5d05('0x11')](_0x5d05('0xd'),_0x5e5582,_0x3790c2);_0x3b1971(_0x3790c2);});});}exports[_0x5d05('0x17')]=function(_0x1e2470){var _0x4baefc=this;return new Promise(function(_0x356ffb,_0xfa9312){return db['DeskAccount'][_0x5d05('0x18')]({'raw':_0x1e2470[_0x5d05('0x19')]?_0x1e2470[_0x5d05('0x19')][_0x5d05('0x1a')]===undefined?!![]:![]:!![],'where':_0x1e2470[_0x5d05('0x19')]?_0x1e2470['options']['where']||null:null,'attributes':_0x1e2470[_0x5d05('0x19')]?_0x1e2470[_0x5d05('0x19')][_0x5d05('0x1b')]||null:null,'limit':_0x1e2470[_0x5d05('0x19')]?_0x1e2470[_0x5d05('0x19')][_0x5d05('0x1c')]||null:null,'include':_0x1e2470[_0x5d05('0x19')]?_0x1e2470[_0x5d05('0x19')]['include']?_[_0x5d05('0x1d')](_0x1e2470[_0x5d05('0x19')][_0x5d05('0x1e')],function(_0x4020ee){return{'model':db[_0x4020ee[_0x5d05('0x1f')]],'as':_0x4020ee['as'],'attributes':_0x4020ee[_0x5d05('0x1b')],'include':_0x4020ee[_0x5d05('0x1e')]?_[_0x5d05('0x1d')](_0x4020ee[_0x5d05('0x1e')],function(_0x20be2e){return{'model':db[_0x20be2e[_0x5d05('0x1f')]],'as':_0x20be2e['as'],'attributes':_0x20be2e[_0x5d05('0x1b')],'include':_0x20be2e[_0x5d05('0x1e')]?_[_0x5d05('0x1d')](_0x20be2e[_0x5d05('0x1e')],function(_0x8a3889){return{'model':db[_0x8a3889[_0x5d05('0x1f')]],'as':_0x8a3889['as'],'attributes':_0x8a3889['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dde41){logger[_0x5d05('0x14')](_0x5d05('0x17'),_0x1e2470);logger[_0x5d05('0xf')](_0x5d05('0x17'),_0x1e2470,JSON['stringify'](_0x2dde41));_0x356ffb(_0x2dde41);})[_0x5d05('0x16')](function(_0x2924ac){logger['error'](_0x5d05('0x17'),_0x2924ac[_0x5d05('0x13')],_0x1e2470);_0xfa9312(_0x4baefc[_0x5d05('0x11')](0x1f4,_0x2924ac[_0x5d05('0x13')]));});});};exports[_0x5d05('0x20')]=function(_0x12bc15){var _0x61216=this;return new Promise(function(_0x5d1426,_0x39d20f){return db['DeskAccount'][_0x5d05('0x21')]({'raw':_0x12bc15[_0x5d05('0x19')]?_0x12bc15[_0x5d05('0x19')][_0x5d05('0x1a')]===undefined?!![]:![]:!![],'where':_0x12bc15[_0x5d05('0x19')]?_0x12bc15[_0x5d05('0x19')][_0x5d05('0x22')]||null:null,'attributes':_0x12bc15[_0x5d05('0x19')]?_0x12bc15[_0x5d05('0x19')][_0x5d05('0x1b')]||null:null,'include':_0x12bc15[_0x5d05('0x19')]?_0x12bc15['options']['include']?_[_0x5d05('0x1d')](_0x12bc15[_0x5d05('0x19')][_0x5d05('0x1e')],function(_0x55cafe){return{'model':db[_0x55cafe[_0x5d05('0x1f')]],'as':_0x55cafe['as'],'attributes':_0x55cafe[_0x5d05('0x1b')],'include':_0x55cafe[_0x5d05('0x1e')]?_[_0x5d05('0x1d')](_0x55cafe[_0x5d05('0x1e')],function(_0x4d642a){return{'model':db[_0x4d642a[_0x5d05('0x1f')]],'as':_0x4d642a['as'],'attributes':_0x4d642a[_0x5d05('0x1b')],'include':_0x4d642a[_0x5d05('0x1e')]?_[_0x5d05('0x1d')](_0x4d642a[_0x5d05('0x1e')],function(_0x18da7d){return{'model':db[_0x18da7d[_0x5d05('0x1f')]],'as':_0x18da7d['as'],'attributes':_0x18da7d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d05('0xc')](function(_0x8db747){logger['info']('ShowDeskAccount',_0x12bc15);logger['debug'](_0x5d05('0x20'),_0x12bc15,JSON[_0x5d05('0x10')](_0x8db747));_0x5d1426(_0x8db747);})[_0x5d05('0x16')](function(_0x35c34b){logger[_0x5d05('0x11')](_0x5d05('0x20'),_0x35c34b[_0x5d05('0x13')],_0x12bc15);_0x39d20f(_0x61216['error'](0x1f4,_0x35c34b[_0x5d05('0x13')]));});});}; \ No newline at end of file +var _0x7270=['where','attributes','map','include','model','GetDeskAccount','ShowDeskAccount','raw','lodash','moment','randomstring','ioredis','../../config/environment','jayson/promise','http','request','then','info','debug','request\x20sent','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','catch','DeskAccount','findAll','options'];(function(_0x23f0ba,_0x4a7be4){var _0x41bd76=function(_0x464c81){while(--_0x464c81){_0x23f0ba['push'](_0x23f0ba['shift']());}};_0x41bd76(++_0x4a7be4);}(_0x7270,0xf0));var _0x0727=function(_0x435592,_0x363aed){_0x435592=_0x435592-0x0;var _0x2d544d=_0x7270[_0x435592];return _0x2d544d;};'use strict';var _=require(_0x0727('0x0'));var util=require('util');var moment=require(_0x0727('0x1'));var BPromise=require('bluebird');var rs=require(_0x0727('0x2'));var fs=require('fs');var Redis=require(_0x0727('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0727('0x4'));var jayson=require(_0x0727('0x5'));var client=jayson['client'][_0x0727('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2c2c27,_0x48110e,_0x3fbbd0){return new BPromise(function(_0x4173c1,_0x592ead){return client[_0x0727('0x7')](_0x2c2c27,_0x3fbbd0)[_0x0727('0x8')](function(_0x403c07){logger[_0x0727('0x9')]('DeskAccount,\x20%s,\x20%s',_0x48110e,'request\x20sent');logger[_0x0727('0xa')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x48110e,_0x0727('0xb'),JSON[_0x0727('0xc')](_0x403c07));if(_0x403c07[_0x0727('0xd')]){if(_0x403c07[_0x0727('0xd')][_0x0727('0xe')]===0x1f4){logger[_0x0727('0xd')]('DeskAccount,\x20%s,\x20%s',_0x48110e,_0x403c07[_0x0727('0xd')][_0x0727('0xf')]);return _0x592ead(_0x403c07['error'][_0x0727('0xf')]);}logger['error'](_0x0727('0x10'),_0x48110e,_0x403c07[_0x0727('0xd')]['message']);return _0x4173c1(_0x403c07['error']['message']);}else{logger['info'](_0x0727('0x10'),_0x48110e,'request\x20sent');_0x4173c1(_0x403c07['result'][_0x0727('0xf')]);}})[_0x0727('0x11')](function(_0x2e6e6a){logger[_0x0727('0xd')]('DeskAccount,\x20%s,\x20%s',_0x48110e,_0x2e6e6a);_0x592ead(_0x2e6e6a);});});}exports['GetDeskAccount']=function(_0x56f73d){var _0x548aa2=this;return new Promise(function(_0xf3fc06,_0x10df5f){return db[_0x0727('0x12')][_0x0727('0x13')]({'raw':_0x56f73d[_0x0727('0x14')]?_0x56f73d[_0x0727('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x56f73d[_0x0727('0x14')]?_0x56f73d['options'][_0x0727('0x15')]||null:null,'attributes':_0x56f73d[_0x0727('0x14')]?_0x56f73d[_0x0727('0x14')][_0x0727('0x16')]||null:null,'limit':_0x56f73d[_0x0727('0x14')]?_0x56f73d['options']['limit']||null:null,'include':_0x56f73d[_0x0727('0x14')]?_0x56f73d[_0x0727('0x14')]['include']?_[_0x0727('0x17')](_0x56f73d['options'][_0x0727('0x18')],function(_0x6945b2){return{'model':db[_0x6945b2[_0x0727('0x19')]],'as':_0x6945b2['as'],'attributes':_0x6945b2[_0x0727('0x16')],'include':_0x6945b2[_0x0727('0x18')]?_[_0x0727('0x17')](_0x6945b2['include'],function(_0x9d3530){return{'model':db[_0x9d3530[_0x0727('0x19')]],'as':_0x9d3530['as'],'attributes':_0x9d3530[_0x0727('0x16')],'include':_0x9d3530[_0x0727('0x18')]?_[_0x0727('0x17')](_0x9d3530[_0x0727('0x18')],function(_0x3c2764){return{'model':db[_0x3c2764['model']],'as':_0x3c2764['as'],'attributes':_0x3c2764[_0x0727('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdc5bd5){logger['info'](_0x0727('0x1a'),_0x56f73d);logger[_0x0727('0xa')](_0x0727('0x1a'),_0x56f73d,JSON[_0x0727('0xc')](_0xdc5bd5));_0xf3fc06(_0xdc5bd5);})[_0x0727('0x11')](function(_0x37941d){logger[_0x0727('0xd')](_0x0727('0x1a'),_0x37941d[_0x0727('0xf')],_0x56f73d);_0x10df5f(_0x548aa2[_0x0727('0xd')](0x1f4,_0x37941d[_0x0727('0xf')]));});});};exports[_0x0727('0x1b')]=function(_0x21a897){var _0x379510=this;return new Promise(function(_0x2be533,_0x69d094){return db[_0x0727('0x12')]['find']({'raw':_0x21a897[_0x0727('0x14')]?_0x21a897[_0x0727('0x14')][_0x0727('0x1c')]===undefined?!![]:![]:!![],'where':_0x21a897[_0x0727('0x14')]?_0x21a897[_0x0727('0x14')][_0x0727('0x15')]||null:null,'attributes':_0x21a897[_0x0727('0x14')]?_0x21a897['options'][_0x0727('0x16')]||null:null,'include':_0x21a897[_0x0727('0x14')]?_0x21a897[_0x0727('0x14')][_0x0727('0x18')]?_[_0x0727('0x17')](_0x21a897['options'][_0x0727('0x18')],function(_0x19537a){return{'model':db[_0x19537a[_0x0727('0x19')]],'as':_0x19537a['as'],'attributes':_0x19537a['attributes'],'include':_0x19537a[_0x0727('0x18')]?_[_0x0727('0x17')](_0x19537a[_0x0727('0x18')],function(_0x458ab1){return{'model':db[_0x458ab1['model']],'as':_0x458ab1['as'],'attributes':_0x458ab1[_0x0727('0x16')],'include':_0x458ab1[_0x0727('0x18')]?_[_0x0727('0x17')](_0x458ab1[_0x0727('0x18')],function(_0x4cf607){return{'model':db[_0x4cf607[_0x0727('0x19')]],'as':_0x4cf607['as'],'attributes':_0x4cf607['attributes']};}):[]};}):[]};}):[]:[]})[_0x0727('0x8')](function(_0x1e8431){logger[_0x0727('0x9')](_0x0727('0x1b'),_0x21a897);logger[_0x0727('0xa')]('ShowDeskAccount',_0x21a897,JSON[_0x0727('0xc')](_0x1e8431));_0x2be533(_0x1e8431);})[_0x0727('0x11')](function(_0x5b3357){logger[_0x0727('0xd')](_0x0727('0x1b'),_0x5b3357[_0x0727('0xf')],_0x21a897);_0x69d094(_0x379510[_0x0727('0xd')](0x1f4,_0x5b3357['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 4c1a0d6..70f9089 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 _0x556a=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','put','update','delete','destroy'];(function(_0x1b4308,_0x587b3b){var _0x20872c=function(_0x53c385){while(--_0x53c385){_0x1b4308['push'](_0x1b4308['shift']());}};_0x20872c(++_0x587b3b);}(_0x556a,0x1dd));var _0xa556=function(_0x273b68,_0x1c7025){_0x273b68=_0x273b68-0x0;var _0x2d19be=_0x556a[_0x273b68];return _0x2d19be;};'use strict';var multer=require(_0xa556('0x0'));var util=require(_0xa556('0x1'));var path=require(_0xa556('0x2'));var timeout=require(_0xa556('0x3'));var express=require(_0xa556('0x4'));var router=express[_0xa556('0x5')]();var auth=require(_0xa556('0x6'));var interaction=require(_0xa556('0x7'));var config=require(_0xa556('0x8'));var controller=require('./intDeskConfiguration.controller');router[_0xa556('0x9')]('/',auth[_0xa556('0xa')](),controller[_0xa556('0xb')]);router[_0xa556('0x9')](_0xa556('0xc'),auth['isAuthenticated'](),controller[_0xa556('0xd')]);router[_0xa556('0x9')](_0xa556('0xe'),auth[_0xa556('0xa')](),controller['getFields']);router[_0xa556('0x9')](_0xa556('0xf'),auth[_0xa556('0xa')](),controller[_0xa556('0x10')]);router[_0xa556('0x9')](_0xa556('0x11'),auth[_0xa556('0xa')](),controller[_0xa556('0x12')]);router['get'](_0xa556('0x13'),auth['isAuthenticated'](),controller[_0xa556('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa556('0x15')]);router[_0xa556('0x16')](_0xa556('0x13'),auth[_0xa556('0xa')](),controller['setTags']);router[_0xa556('0x17')](_0xa556('0xc'),auth[_0xa556('0xa')](),controller[_0xa556('0x18')]);router[_0xa556('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xa556('0x1a')]);module[_0xa556('0x1b')]=router; \ No newline at end of file +var _0x8710=['getTags','post','create','/:id/tags','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x3954fe,_0x243f74){var _0x4427da=function(_0x5c7435){while(--_0x5c7435){_0x3954fe['push'](_0x3954fe['shift']());}};_0x4427da(++_0x243f74);}(_0x8710,0x68));var _0x0871=function(_0x187fa6,_0xa959d2){_0x187fa6=_0x187fa6-0x0;var _0x23f11b=_0x8710[_0x187fa6];return _0x23f11b;};'use strict';var multer=require(_0x0871('0x0'));var util=require(_0x0871('0x1'));var path=require('path');var timeout=require(_0x0871('0x2'));var express=require(_0x0871('0x3'));var router=express[_0x0871('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0871('0x5'));var config=require(_0x0871('0x6'));var controller=require('./intDeskConfiguration.controller');router[_0x0871('0x7')]('/',auth['isAuthenticated'](),controller[_0x0871('0x8')]);router[_0x0871('0x7')](_0x0871('0x9'),auth[_0x0871('0xa')](),controller[_0x0871('0xb')]);router[_0x0871('0x7')]('/:id/fields',auth[_0x0871('0xa')](),controller[_0x0871('0xc')]);router[_0x0871('0x7')](_0x0871('0xd'),auth[_0x0871('0xa')](),controller['getSubjects']);router[_0x0871('0x7')](_0x0871('0xe'),auth[_0x0871('0xa')](),controller[_0x0871('0xf')]);router[_0x0871('0x7')]('/:id/tags',auth[_0x0871('0xa')](),controller[_0x0871('0x10')]);router[_0x0871('0x11')]('/',auth[_0x0871('0xa')](),controller[_0x0871('0x12')]);router[_0x0871('0x11')](_0x0871('0x13'),auth[_0x0871('0xa')](),controller['setTags']);router['put'](_0x0871('0x9'),auth[_0x0871('0xa')](),controller[_0x0871('0x14')]);router[_0x0871('0x15')](_0x0871('0x9'),auth[_0x0871('0xa')](),controller[_0x0871('0x16')]);module[_0x0871('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index f22bdfe..4ef887c 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 _0x2798=['STRING','sequelize','exports'];(function(_0x4d9ad1,_0x593171){var _0x37168b=function(_0x3120d5){while(--_0x3120d5){_0x4d9ad1['push'](_0x4d9ad1['shift']());}};_0x37168b(++_0x593171);}(_0x2798,0x19c));var _0x8279=function(_0x5f46bf,_0x538cb6){_0x5f46bf=_0x5f46bf-0x0;var _0x57ccf4=_0x2798[_0x5f46bf];return _0x57ccf4;};'use strict';var Sequelize=require(_0x8279('0x0'));module[_0x8279('0x1')]={'name':{'type':Sequelize[_0x8279('0x2')]},'description':{'type':Sequelize[_0x8279('0x2')]}}; \ No newline at end of file +var _0xd298=['STRING','sequelize','exports'];(function(_0x5af11a,_0x25dc82){var _0x57adc6=function(_0x311e95){while(--_0x311e95){_0x5af11a['push'](_0x5af11a['shift']());}};_0x57adc6(++_0x25dc82);}(_0xd298,0x79));var _0x8d29=function(_0xdd4133,_0x5a4aae){_0xdd4133=_0xdd4133-0x0;var _0x568df7=_0xd298[_0xdd4133];return _0x568df7;};'use strict';var Sequelize=require(_0x8d29('0x0'));module[_0x8d29('0x1')]={'name':{'type':Sequelize[_0x8d29('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 640b1af..0aa49e9 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 _0x0dec=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','DeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','offset','limit','Content-Range','apply','reject','destroy','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','getFields','findOne','pick','getSubjects','DeskField','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x24fe20,_0x4b8174){var _0x2b5f9c=function(_0x1931fc){while(--_0x1931fc){_0x24fe20['push'](_0x24fe20['shift']());}};_0x2b5f9c(++_0x4b8174);}(_0x0dec,0x11c));var _0xc0de=function(_0x26960b,_0x23e30c){_0x26960b=_0x26960b-0x0;var _0x434d63=_0x0dec[_0x26960b];return _0x434d63;};'use strict';var pdf=require(_0xc0de('0x0'));var emlformat=require(_0xc0de('0x1'));var rimraf=require(_0xc0de('0x2'));var zipdir=require(_0xc0de('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc0de('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc0de('0x5'));var util=require(_0xc0de('0x6'));var path=require(_0xc0de('0x7'));var sox=require(_0xc0de('0x8'));var csv=require(_0xc0de('0x9'));var ejs=require(_0xc0de('0xa'));var fs=require('fs');var _=require(_0xc0de('0xb'));var squel=require(_0xc0de('0xc'));var crypto=require(_0xc0de('0xd'));var jsforce=require(_0xc0de('0xe'));var deskjs=require(_0xc0de('0xf'));var toCsv=require(_0xc0de('0x9'));var querystring=require(_0xc0de('0x10'));var Papa=require(_0xc0de('0x11'));var Redis=require(_0xc0de('0x12'));var authService=require(_0xc0de('0x13'));var qs=require(_0xc0de('0x14'));var as=require(_0xc0de('0x15'));var hardwareService=require(_0xc0de('0x16'));var logger=require(_0xc0de('0x17'))(_0xc0de('0x18'));var utils=require(_0xc0de('0x19'));var config=require(_0xc0de('0x1a'));var db=require(_0xc0de('0x1b'))['db'];var jayson=require(_0xc0de('0x1c'));var client=jayson['client'][_0xc0de('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x3237b7,_0x386133,_0x258c5a){if(_0x258c5a){var _0x173756=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x173756[_0xc0de('0x1e')](_0x386133)){return _0x3237b7;}else{throw new db[(_0xc0de('0x1f'))][(_0xc0de('0x20'))](_0xc0de('0x21'));}}else{return _0x3237b7;}}function respondWithRpcPromise(_0x29da96,_0x11abc2,_0x7f1e4d,_0x4e24cb){return new BPromise(function(_0x12d66c,_0x1128e9){var _0x526f67=_0x4e24cb||client;return _0x526f67[_0xc0de('0x22')](_0x29da96,_0x7f1e4d)[_0xc0de('0x23')](function(_0x21db23){logger['info'](_0xc0de('0x24'),_0x11abc2,'request\x20sent');logger[_0xc0de('0x25')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x11abc2,_0xc0de('0x26'),JSON[_0xc0de('0x27')](_0x21db23));if(_0x21db23['error']){if(_0x21db23[_0xc0de('0x28')][_0xc0de('0x29')]===0x1f4){logger[_0xc0de('0x28')](_0xc0de('0x24'),_0x11abc2,_0x21db23[_0xc0de('0x28')][_0xc0de('0x2a')]);return _0x1128e9(_0x21db23[_0xc0de('0x28')][_0xc0de('0x2a')]);}logger['error'](_0xc0de('0x24'),_0x11abc2,_0x21db23[_0xc0de('0x28')][_0xc0de('0x2a')]);return _0x12d66c(_0x21db23[_0xc0de('0x28')][_0xc0de('0x2a')]);}else{logger['info'](_0xc0de('0x24'),_0x11abc2,_0xc0de('0x26'));_0x12d66c(_0x21db23[_0xc0de('0x2b')][_0xc0de('0x2a')]);}})['catch'](function(_0x322335){logger[_0xc0de('0x28')](_0xc0de('0x24'),_0x11abc2,_0x322335);_0x1128e9(_0x322335);});});}function respondWithStatusCode(_0x1f6ef1,_0x301d65){_0x301d65=_0x301d65||0xcc;return function(_0x25a44d){if(_0x25a44d){return _0x1f6ef1[_0xc0de('0x2c')](_0x301d65);}return _0x1f6ef1[_0xc0de('0x2d')](_0x301d65)[_0xc0de('0x2e')]();};}function respondWithResult(_0x304660,_0x32fb9d){_0x32fb9d=_0x32fb9d||0xc8;return function(_0x68e803){if(_0x68e803){return _0x304660[_0xc0de('0x2d')](_0x32fb9d)['json'](_0x68e803);}};}function respondWithFilteredResult(_0x5d0bde,_0x285669){return function(_0x2d6faa){if(_0x2d6faa){var _0x59fed0=_0x2d6faa['count'],_0x4a813a=_0x285669['offset'],_0x6022ed=_0x285669[_0xc0de('0x2f')]+_0x285669[_0xc0de('0x30')],_0x29f812;if(_0x6022ed>=_0x59fed0){_0x6022ed=_0x59fed0;_0x29f812=0xc8;}else{_0x29f812=0xce;}_0x5d0bde[_0xc0de('0x2d')](_0x29f812);return _0x5d0bde['set'](_0xc0de('0x31'),_0x4a813a+'-'+_0x6022ed+'/'+_0x59fed0)['json'](_0x2d6faa);}return null;};}function patchUpdates(_0x1d6a49){return function(_0x1ccf8a){try{jsonpatch[_0xc0de('0x32')](_0x1ccf8a,_0x1d6a49,!![]);}catch(_0x526862){return BPromise[_0xc0de('0x33')](_0x526862);}return _0x1ccf8a['save']();};}function saveUpdates(_0x44b8a5,_0x2fea76){return function(_0x18aff2){if(_0x18aff2){return _0x18aff2['update'](_0x44b8a5)[_0xc0de('0x23')](function(_0x10a4d4){return _0x10a4d4;});}return null;};}function removeEntity(_0x104730,_0x2e317a){return function(_0x18844e){if(_0x18844e){return _0x18844e[_0xc0de('0x34')]()[_0xc0de('0x23')](function(){_0x104730[_0xc0de('0x2d')](0xcc)[_0xc0de('0x2e')]();});}};}function handleEntityNotFound(_0xe2a4f,_0x47a8b9){return function(_0x2df11f){if(!_0x2df11f){_0xe2a4f['sendStatus'](0x194);}return _0x2df11f;};}function handleError(_0xaca7e7,_0x11dc25){_0x11dc25=_0x11dc25||0x1f4;return function(_0x2e2899){logger[_0xc0de('0x28')](_0x2e2899[_0xc0de('0x35')]);if(_0x2e2899[_0xc0de('0x36')]){delete _0x2e2899[_0xc0de('0x36')];}_0xaca7e7[_0xc0de('0x2d')](_0x11dc25)[_0xc0de('0x37')](_0x2e2899);};}exports[_0xc0de('0x38')]=function(_0x4499e6,_0x2fd83e){var _0x52303d={},_0x534069={},_0x199aff={'count':0x0,'rows':[]};var _0xb700c0=_[_0xc0de('0x39')](db[_0xc0de('0x3a')][_0xc0de('0x3b')],function(_0x2233d4){return{'name':_0x2233d4[_0xc0de('0x3c')],'type':_0x2233d4['type']['key']};});_0x534069['model']=_[_0xc0de('0x39')](_0xb700c0,_0xc0de('0x36'));_0x534069[_0xc0de('0x3d')]=_[_0xc0de('0x3e')](_0x4499e6[_0xc0de('0x3d')]);_0x534069[_0xc0de('0x3f')]=_['intersection'](_0x534069[_0xc0de('0x40')],_0x534069[_0xc0de('0x3d')]);_0x52303d['attributes']=_[_0xc0de('0x41')](_0x534069['model'],qs[_0xc0de('0x42')](_0x4499e6[_0xc0de('0x3d')][_0xc0de('0x42')]));_0x52303d[_0xc0de('0x43')]=_0x52303d[_0xc0de('0x43')][_0xc0de('0x44')]?_0x52303d[_0xc0de('0x43')]:_0x534069[_0xc0de('0x40')];if(!_0x4499e6[_0xc0de('0x3d')][_0xc0de('0x45')](_0xc0de('0x46'))){_0x52303d['limit']=qs[_0xc0de('0x30')](_0x4499e6[_0xc0de('0x3d')][_0xc0de('0x30')]);_0x52303d[_0xc0de('0x2f')]=qs[_0xc0de('0x2f')](_0x4499e6['query']['offset']);}_0x52303d[_0xc0de('0x47')]=qs[_0xc0de('0x48')](_0x4499e6[_0xc0de('0x3d')][_0xc0de('0x48')]);_0x52303d['where']=qs['filters'](_['pick'](_0x4499e6[_0xc0de('0x3d')],_0x534069['filters']),_0xb700c0);if(_0x4499e6[_0xc0de('0x3d')][_0xc0de('0x49')]){_0x52303d[_0xc0de('0x4a')]=_[_0xc0de('0x4b')](_0x52303d[_0xc0de('0x4a')],{'$or':_[_0xc0de('0x39')](_0xb700c0,function(_0x552561){if(_0x552561[_0xc0de('0x4c')]!==_0xc0de('0x4d')){var _0xcf5aff={};_0xcf5aff[_0x552561[_0xc0de('0x36')]]={'$like':'%'+_0x4499e6['query'][_0xc0de('0x49')]+'%'};return _0xcf5aff;}})});}_0x52303d=_[_0xc0de('0x4b')]({},_0x52303d,_0x4499e6[_0xc0de('0x4e')]);var _0x5a6e17={'where':_0x52303d[_0xc0de('0x4a')]};return db[_0xc0de('0x3a')][_0xc0de('0x4f')](_0x5a6e17)['then'](function(_0x218ab2){_0x199aff['count']=_0x218ab2;if(_0x4499e6[_0xc0de('0x3d')]['includeAll']){_0x52303d[_0xc0de('0x50')]=[{'all':!![]}];}return db[_0xc0de('0x3a')][_0xc0de('0x51')](_0x52303d);})[_0xc0de('0x23')](function(_0x4f72bf){_0x199aff[_0xc0de('0x52')]=_0x4f72bf;return _0x199aff;})[_0xc0de('0x23')](respondWithFilteredResult(_0x2fd83e,_0x52303d))[_0xc0de('0x53')](handleError(_0x2fd83e,null));};exports[_0xc0de('0x54')]=function(_0x4490a4,_0x2974b0){var _0x36d8be={'raw':![],'where':{'id':_0x4490a4[_0xc0de('0x55')]['id']}},_0x3a335e={};_0x3a335e['model']=_[_0xc0de('0x3e')](db[_0xc0de('0x3a')][_0xc0de('0x3b')]);_0x3a335e['query']=_[_0xc0de('0x3e')](_0x4490a4[_0xc0de('0x3d')]);_0x3a335e[_0xc0de('0x3f')]=_['intersection'](_0x3a335e[_0xc0de('0x40')],_0x3a335e[_0xc0de('0x3d')]);_0x36d8be[_0xc0de('0x43')]=_['intersection'](_0x3a335e['model'],qs[_0xc0de('0x42')](_0x4490a4['query'][_0xc0de('0x42')]));_0x36d8be[_0xc0de('0x43')]=_0x36d8be['attributes']['length']?_0x36d8be['attributes']:_0x3a335e[_0xc0de('0x40')];if(_0x4490a4[_0xc0de('0x3d')][_0xc0de('0x56')]){_0x36d8be[_0xc0de('0x50')]=[{'all':!![]}];}_0x36d8be=_['merge']({},_0x36d8be,_0x4490a4[_0xc0de('0x4e')]);return db[_0xc0de('0x3a')][_0xc0de('0x57')](_0x36d8be)[_0xc0de('0x23')](handleEntityNotFound(_0x2974b0,null))[_0xc0de('0x23')](respondWithResult(_0x2974b0,null))[_0xc0de('0x53')](handleError(_0x2974b0,null));};exports[_0xc0de('0x58')]=function(_0x5f09a0,_0x25aed9){return db[_0xc0de('0x3a')][_0xc0de('0x58')](_0x5f09a0[_0xc0de('0x59')],{})['then'](respondWithResult(_0x25aed9,0xc9))['catch'](handleError(_0x25aed9,null));};exports[_0xc0de('0x5a')]=function(_0x2ab576,_0x2c5894){if(_0x2ab576[_0xc0de('0x59')]['id']){delete _0x2ab576[_0xc0de('0x59')]['id'];}return db[_0xc0de('0x3a')][_0xc0de('0x57')]({'where':{'id':_0x2ab576[_0xc0de('0x55')]['id']}})[_0xc0de('0x23')](handleEntityNotFound(_0x2c5894,null))[_0xc0de('0x23')](saveUpdates(_0x2ab576['body'],null))[_0xc0de('0x23')](respondWithResult(_0x2c5894,null))[_0xc0de('0x53')](handleError(_0x2c5894,null));};exports['destroy']=function(_0x4827c0,_0x556f27){return db['DeskConfiguration'][_0xc0de('0x57')]({'where':{'id':_0x4827c0[_0xc0de('0x55')]['id']}})['then'](handleEntityNotFound(_0x556f27,null))['then'](removeEntity(_0x556f27,null))[_0xc0de('0x53')](handleError(_0x556f27,null));};exports[_0xc0de('0x5b')]=function(_0x145b1d,_0x3be584,_0x329adb){var _0x3bb525={};var _0x4e1535={};var _0x3e8afe;var _0x1c14d8;return db[_0xc0de('0x3a')][_0xc0de('0x5c')]({'where':{'id':_0x145b1d[_0xc0de('0x55')]['id']}})[_0xc0de('0x23')](handleEntityNotFound(_0x3be584,null))[_0xc0de('0x23')](function(_0x1fe9af){if(_0x1fe9af){_0x3e8afe=_0x1fe9af;_0x4e1535[_0xc0de('0x40')]=_['keys'](db['DeskField'][_0xc0de('0x3b')]);_0x4e1535[_0xc0de('0x3d')]=_[_0xc0de('0x3e')](_0x145b1d[_0xc0de('0x3d')]);_0x4e1535[_0xc0de('0x3f')]=_['intersection'](_0x4e1535[_0xc0de('0x40')],_0x4e1535[_0xc0de('0x3d')]);_0x3bb525[_0xc0de('0x43')]=_[_0xc0de('0x41')](_0x4e1535[_0xc0de('0x40')],qs[_0xc0de('0x42')](_0x145b1d[_0xc0de('0x3d')][_0xc0de('0x42')]));_0x3bb525[_0xc0de('0x43')]=_0x3bb525[_0xc0de('0x43')]['length']?_0x3bb525[_0xc0de('0x43')]:_0x4e1535['model'];_0x3bb525['order']=qs[_0xc0de('0x48')](_0x145b1d[_0xc0de('0x3d')][_0xc0de('0x48')]);_0x3bb525[_0xc0de('0x4a')]=qs[_0xc0de('0x3f')](_[_0xc0de('0x5d')](_0x145b1d[_0xc0de('0x3d')],_0x4e1535[_0xc0de('0x3f')]));if(_0x145b1d[_0xc0de('0x3d')]['filter']){_0x3bb525[_0xc0de('0x4a')]=_[_0xc0de('0x4b')](_0x3bb525['where'],{'$or':_['map'](_0x3bb525['attributes'],function(_0x321805){var _0x4ea743={};_0x4ea743[_0x321805]={'$like':'%'+_0x145b1d[_0xc0de('0x3d')]['filter']+'%'};return _0x4ea743;})});}_0x3bb525=_['merge']({},_0x3bb525,_0x145b1d['options']);return _0x3e8afe[_0xc0de('0x5b')](_0x3bb525);}})[_0xc0de('0x23')](function(_0xfecd2b){if(_0xfecd2b){_0x1c14d8=_0xfecd2b[_0xc0de('0x44')];if(!_0x145b1d[_0xc0de('0x3d')][_0xc0de('0x45')](_0xc0de('0x46'))){_0x3bb525[_0xc0de('0x30')]=qs[_0xc0de('0x30')](_0x145b1d[_0xc0de('0x3d')][_0xc0de('0x30')]);_0x3bb525[_0xc0de('0x2f')]=qs[_0xc0de('0x2f')](_0x145b1d['query']['offset']);}return _0x3e8afe['getFields'](_0x3bb525);}})[_0xc0de('0x23')](function(_0x17ff83){if(_0x17ff83){return _0x17ff83?{'count':_0x1c14d8,'rows':_0x17ff83}:null;}})[_0xc0de('0x23')](respondWithResult(_0x3be584,null))[_0xc0de('0x53')](handleError(_0x3be584,null));};exports[_0xc0de('0x5e')]=function(_0x530eeb,_0x23e03b,_0x3c808c){var _0x168505={};var _0x46188a={};var _0x492809;var _0x568a82;return db[_0xc0de('0x3a')]['findOne']({'where':{'id':_0x530eeb[_0xc0de('0x55')]['id']}})['then'](handleEntityNotFound(_0x23e03b,null))[_0xc0de('0x23')](function(_0x54ed78){if(_0x54ed78){_0x492809=_0x54ed78;_0x46188a[_0xc0de('0x40')]=_[_0xc0de('0x3e')](db[_0xc0de('0x5f')]['rawAttributes']);_0x46188a['query']=_[_0xc0de('0x3e')](_0x530eeb[_0xc0de('0x3d')]);_0x46188a[_0xc0de('0x3f')]=_[_0xc0de('0x41')](_0x46188a[_0xc0de('0x40')],_0x46188a[_0xc0de('0x3d')]);_0x168505[_0xc0de('0x43')]=_['intersection'](_0x46188a[_0xc0de('0x40')],qs[_0xc0de('0x42')](_0x530eeb['query'][_0xc0de('0x42')]));_0x168505[_0xc0de('0x43')]=_0x168505['attributes'][_0xc0de('0x44')]?_0x168505['attributes']:_0x46188a[_0xc0de('0x40')];_0x168505['order']=qs[_0xc0de('0x48')](_0x530eeb[_0xc0de('0x3d')][_0xc0de('0x48')]);_0x168505[_0xc0de('0x4a')]=qs['filters'](_['pick'](_0x530eeb['query'],_0x46188a[_0xc0de('0x3f')]));if(_0x530eeb[_0xc0de('0x3d')][_0xc0de('0x49')]){_0x168505[_0xc0de('0x4a')]=_[_0xc0de('0x4b')](_0x168505['where'],{'$or':_[_0xc0de('0x39')](_0x168505[_0xc0de('0x43')],function(_0x2a719b){var _0x245df8={};_0x245df8[_0x2a719b]={'$like':'%'+_0x530eeb['query'][_0xc0de('0x49')]+'%'};return _0x245df8;})});}_0x168505=_[_0xc0de('0x4b')]({},_0x168505,_0x530eeb['options']);return _0x492809[_0xc0de('0x5e')](_0x168505);}})[_0xc0de('0x23')](function(_0x2e49ab){if(_0x2e49ab){_0x568a82=_0x2e49ab[_0xc0de('0x44')];if(!_0x530eeb[_0xc0de('0x3d')][_0xc0de('0x45')]('nolimit')){_0x168505[_0xc0de('0x30')]=qs[_0xc0de('0x30')](_0x530eeb[_0xc0de('0x3d')][_0xc0de('0x30')]);_0x168505[_0xc0de('0x2f')]=qs[_0xc0de('0x2f')](_0x530eeb[_0xc0de('0x3d')]['offset']);}return _0x492809[_0xc0de('0x5e')](_0x168505);}})['then'](function(_0x4276e7){if(_0x4276e7){return _0x4276e7?{'count':_0x568a82,'rows':_0x4276e7}:null;}})[_0xc0de('0x23')](respondWithResult(_0x23e03b,null))[_0xc0de('0x53')](handleError(_0x23e03b,null));};exports[_0xc0de('0x60')]=function(_0x35ad75,_0x36cb31,_0x6e94f2){var _0x1bc937={};var _0xe88f={};var _0x7ce1d0;var _0x2704d2;return db[_0xc0de('0x3a')][_0xc0de('0x5c')]({'where':{'id':_0x35ad75[_0xc0de('0x55')]['id']}})[_0xc0de('0x23')](handleEntityNotFound(_0x36cb31,null))[_0xc0de('0x23')](function(_0x5719e1){if(_0x5719e1){_0x7ce1d0=_0x5719e1;_0xe88f[_0xc0de('0x40')]=_[_0xc0de('0x3e')](db[_0xc0de('0x5f')]['rawAttributes']);_0xe88f[_0xc0de('0x3d')]=_[_0xc0de('0x3e')](_0x35ad75[_0xc0de('0x3d')]);_0xe88f[_0xc0de('0x3f')]=_[_0xc0de('0x41')](_0xe88f[_0xc0de('0x40')],_0xe88f[_0xc0de('0x3d')]);_0x1bc937[_0xc0de('0x43')]=_['intersection'](_0xe88f['model'],qs[_0xc0de('0x42')](_0x35ad75[_0xc0de('0x3d')]['fields']));_0x1bc937[_0xc0de('0x43')]=_0x1bc937[_0xc0de('0x43')]['length']?_0x1bc937[_0xc0de('0x43')]:_0xe88f[_0xc0de('0x40')];_0x1bc937[_0xc0de('0x47')]=qs[_0xc0de('0x48')](_0x35ad75[_0xc0de('0x3d')]['sort']);_0x1bc937[_0xc0de('0x4a')]=qs[_0xc0de('0x3f')](_[_0xc0de('0x5d')](_0x35ad75[_0xc0de('0x3d')],_0xe88f[_0xc0de('0x3f')]));if(_0x35ad75[_0xc0de('0x3d')][_0xc0de('0x49')]){_0x1bc937[_0xc0de('0x4a')]=_['merge'](_0x1bc937[_0xc0de('0x4a')],{'$or':_['map'](_0x1bc937[_0xc0de('0x43')],function(_0xdfebec){var _0x223bb7={};_0x223bb7[_0xdfebec]={'$like':'%'+_0x35ad75[_0xc0de('0x3d')]['filter']+'%'};return _0x223bb7;})});}_0x1bc937=_['merge']({},_0x1bc937,_0x35ad75['options']);return _0x7ce1d0[_0xc0de('0x60')](_0x1bc937);}})['then'](function(_0x20e908){if(_0x20e908){_0x2704d2=_0x20e908['length'];if(!_0x35ad75[_0xc0de('0x3d')][_0xc0de('0x45')](_0xc0de('0x46'))){_0x1bc937[_0xc0de('0x30')]=qs[_0xc0de('0x30')](_0x35ad75[_0xc0de('0x3d')][_0xc0de('0x30')]);_0x1bc937[_0xc0de('0x2f')]=qs['offset'](_0x35ad75[_0xc0de('0x3d')][_0xc0de('0x2f')]);}return _0x7ce1d0[_0xc0de('0x60')](_0x1bc937);}})['then'](function(_0x29cfa3){if(_0x29cfa3){return _0x29cfa3?{'count':_0x2704d2,'rows':_0x29cfa3}:null;}})['then'](respondWithResult(_0x36cb31,null))[_0xc0de('0x53')](handleError(_0x36cb31,null));};exports[_0xc0de('0x61')]=function(_0x2daff4,_0x379e29,_0x3560c7){var _0x510ef3={};var _0xec8e45={};var _0x4440f1;var _0x330a1b;return db[_0xc0de('0x3a')][_0xc0de('0x5c')]({'where':{'id':_0x2daff4[_0xc0de('0x55')]['id']}})['then'](handleEntityNotFound(_0x379e29,null))[_0xc0de('0x23')](function(_0x4b9be6){if(_0x4b9be6){_0x4440f1=_0x4b9be6;_0xec8e45['model']=_[_0xc0de('0x3e')](db['Tag']['rawAttributes']);_0xec8e45['query']=_[_0xc0de('0x3e')](_0x2daff4[_0xc0de('0x3d')]);_0xec8e45[_0xc0de('0x3f')]=_[_0xc0de('0x41')](_0xec8e45['model'],_0xec8e45[_0xc0de('0x3d')]);_0x510ef3['attributes']=_['intersection'](_0xec8e45[_0xc0de('0x40')],qs['fields'](_0x2daff4[_0xc0de('0x3d')]['fields']));_0x510ef3[_0xc0de('0x43')]=_0x510ef3['attributes'][_0xc0de('0x44')]?_0x510ef3['attributes']:_0xec8e45[_0xc0de('0x40')];_0x510ef3['order']=qs[_0xc0de('0x48')](_0x2daff4[_0xc0de('0x3d')][_0xc0de('0x48')]);_0x510ef3[_0xc0de('0x4a')]=qs[_0xc0de('0x3f')](_[_0xc0de('0x5d')](_0x2daff4[_0xc0de('0x3d')],_0xec8e45[_0xc0de('0x3f')]));if(_0x2daff4[_0xc0de('0x3d')][_0xc0de('0x49')]){_0x510ef3['where']=_['merge'](_0x510ef3['where'],{'$or':_['map'](_0x510ef3[_0xc0de('0x43')],function(_0x4d2fbb){var _0x4b4e1c={};_0x4b4e1c[_0x4d2fbb]={'$like':'%'+_0x2daff4['query'][_0xc0de('0x49')]+'%'};return _0x4b4e1c;})});}_0x510ef3=_[_0xc0de('0x4b')]({},_0x510ef3,_0x2daff4[_0xc0de('0x4e')]);return _0x4440f1[_0xc0de('0x61')](_0x510ef3);}})[_0xc0de('0x23')](function(_0xae8587){if(_0xae8587){_0x330a1b=_0xae8587[_0xc0de('0x44')];if(!_0x2daff4['query'][_0xc0de('0x45')]('nolimit')){_0x510ef3[_0xc0de('0x30')]=qs[_0xc0de('0x30')](_0x2daff4[_0xc0de('0x3d')][_0xc0de('0x30')]);_0x510ef3[_0xc0de('0x2f')]=qs['offset'](_0x2daff4['query'][_0xc0de('0x2f')]);}return _0x4440f1['getTags'](_0x510ef3);}})['then'](function(_0x58703d){if(_0x58703d){return _0x58703d?{'count':_0x330a1b,'rows':_0x58703d}:null;}})['then'](respondWithResult(_0x379e29,null))[_0xc0de('0x53')](handleError(_0x379e29,null));};exports['setTags']=function(_0x170ba9,_0x133538,_0x2c4d84){if(_0x170ba9[_0xc0de('0x59')]['id']){delete _0x170ba9[_0xc0de('0x59')]['id'];}return db[_0xc0de('0x3a')][_0xc0de('0x5c')]({'where':{'id':_0x170ba9['params']['id']}})['then'](handleEntityNotFound(_0x133538,null))['then'](function(_0x57c735){if(_0x57c735){return _0x57c735[_0xc0de('0x62')](_0x170ba9['body'][_0xc0de('0x63')]||[]);}return null;})[_0xc0de('0x23')](respondWithResult(_0x133538,null))[_0xc0de('0x53')](handleError(_0x133538,null));}; \ No newline at end of file +var _0x5645=['nolimit','order','sort','pick','filter','where','includeAll','include','findAll','rows','show','rawAttributes','merge','options','create','body','find','params','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','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~!@#$%^&-_=+[{]}.','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','stack','name','map','DeskConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x12aef1,_0x5f2a74){var _0x550412=function(_0x45918a){while(--_0x45918a){_0x12aef1['push'](_0x12aef1['shift']());}};_0x550412(++_0x5f2a74);}(_0x5645,0x19e));var _0x5564=function(_0x3b97fa,_0x4399a6){_0x3b97fa=_0x3b97fa-0x0;var _0x44267a=_0x5645[_0x3b97fa];return _0x44267a;};'use strict';var pdf=require(_0x5564('0x0'));var emlformat=require(_0x5564('0x1'));var rimraf=require(_0x5564('0x2'));var zipdir=require(_0x5564('0x3'));var jsonpatch=require(_0x5564('0x4'));var rp=require('request-promise');var moment=require(_0x5564('0x5'));var BPromise=require(_0x5564('0x6'));var Mustache=require(_0x5564('0x7'));var util=require(_0x5564('0x8'));var path=require(_0x5564('0x9'));var sox=require(_0x5564('0xa'));var csv=require(_0x5564('0xb'));var ejs=require(_0x5564('0xc'));var fs=require('fs');var _=require(_0x5564('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5564('0xe'));var deskjs=require(_0x5564('0xf'));var toCsv=require(_0x5564('0xb'));var querystring=require(_0x5564('0x10'));var Papa=require(_0x5564('0x11'));var Redis=require('ioredis');var authService=require(_0x5564('0x12'));var qs=require(_0x5564('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5564('0x14'));var logger=require(_0x5564('0x15'))(_0x5564('0x16'));var utils=require(_0x5564('0x17'));var config=require(_0x5564('0x18'));var db=require(_0x5564('0x19'))['db'];var jayson=require(_0x5564('0x1a'));var client=jayson[_0x5564('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22c05c,_0x48061d,_0x423074){if(_0x423074){var _0x10185f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x10185f['test'](_0x48061d)){return _0x22c05c;}else{throw new db[(_0x5564('0x1c'))][(_0x5564('0x1d'))](_0x5564('0x1e'));}}else{return _0x22c05c;}}function respondWithRpcPromise(_0xb49b03,_0x12a729,_0xc0764f,_0x5956b3){return new BPromise(function(_0x190d8e,_0x30f3fa){var _0x12285c=_0x5956b3||client;return _0x12285c[_0x5564('0x1f')](_0xb49b03,_0xc0764f)['then'](function(_0x258b34){logger[_0x5564('0x20')](_0x5564('0x21'),_0x12a729,_0x5564('0x22'));logger[_0x5564('0x23')](_0x5564('0x24'),_0x12a729,_0x5564('0x22'),JSON[_0x5564('0x25')](_0x258b34));if(_0x258b34[_0x5564('0x26')]){if(_0x258b34[_0x5564('0x26')][_0x5564('0x27')]===0x1f4){logger[_0x5564('0x26')](_0x5564('0x21'),_0x12a729,_0x258b34['error'][_0x5564('0x28')]);return _0x30f3fa(_0x258b34[_0x5564('0x26')]['message']);}logger[_0x5564('0x26')](_0x5564('0x21'),_0x12a729,_0x258b34[_0x5564('0x26')][_0x5564('0x28')]);return _0x190d8e(_0x258b34[_0x5564('0x26')][_0x5564('0x28')]);}else{logger['info'](_0x5564('0x21'),_0x12a729,_0x5564('0x22'));_0x190d8e(_0x258b34[_0x5564('0x29')][_0x5564('0x28')]);}})[_0x5564('0x2a')](function(_0x1327bc){logger[_0x5564('0x26')](_0x5564('0x21'),_0x12a729,_0x1327bc);_0x30f3fa(_0x1327bc);});});}function respondWithStatusCode(_0x3f7ad6,_0xd5a5e8){_0xd5a5e8=_0xd5a5e8||0xcc;return function(_0x1a8a00){if(_0x1a8a00){return _0x3f7ad6[_0x5564('0x2b')](_0xd5a5e8);}return _0x3f7ad6['status'](_0xd5a5e8)[_0x5564('0x2c')]();};}function respondWithResult(_0x1ce862,_0x3f9f21){_0x3f9f21=_0x3f9f21||0xc8;return function(_0x50d02e){if(_0x50d02e){return _0x1ce862[_0x5564('0x2d')](_0x3f9f21)[_0x5564('0x2e')](_0x50d02e);}};}function respondWithFilteredResult(_0x3126fc,_0x4c391f){return function(_0xed1f9c){if(_0xed1f9c){var _0xee6731=_0xed1f9c[_0x5564('0x2f')],_0x652953=_0x4c391f['offset'],_0x323142=_0x4c391f[_0x5564('0x30')]+_0x4c391f[_0x5564('0x31')],_0x5c35e4;if(_0x323142>=_0xee6731){_0x323142=_0xee6731;_0x5c35e4=0xc8;}else{_0x5c35e4=0xce;}_0x3126fc[_0x5564('0x2d')](_0x5c35e4);return _0x3126fc['set'](_0x5564('0x32'),_0x652953+'-'+_0x323142+'/'+_0xee6731)[_0x5564('0x2e')](_0xed1f9c);}return null;};}function patchUpdates(_0x38ed8d){return function(_0x4305ec){try{jsonpatch['apply'](_0x4305ec,_0x38ed8d,!![]);}catch(_0x235f4c){return BPromise[_0x5564('0x33')](_0x235f4c);}return _0x4305ec[_0x5564('0x34')]();};}function saveUpdates(_0x5933e9,_0x442b11){return function(_0xd2dd86){if(_0xd2dd86){return _0xd2dd86[_0x5564('0x35')](_0x5933e9)[_0x5564('0x36')](function(_0x2dbfe9){return _0x2dbfe9;});}return null;};}function removeEntity(_0x2edc10,_0x572fcf){return function(_0x52ff0){if(_0x52ff0){return _0x52ff0[_0x5564('0x37')]()[_0x5564('0x36')](function(){_0x2edc10[_0x5564('0x2d')](0xcc)[_0x5564('0x2c')]();});}};}function handleEntityNotFound(_0xdca0e8,_0x3d8f4e){return function(_0x5db16a){if(!_0x5db16a){_0xdca0e8[_0x5564('0x2b')](0x194);}return _0x5db16a;};}function handleError(_0x1c98c6,_0x44682e){_0x44682e=_0x44682e||0x1f4;return function(_0x4ebce8){logger[_0x5564('0x26')](_0x4ebce8[_0x5564('0x38')]);if(_0x4ebce8['name']){delete _0x4ebce8[_0x5564('0x39')];}_0x1c98c6['status'](_0x44682e)['send'](_0x4ebce8);};}exports['index']=function(_0x2de92a,_0x27eb59){var _0xf0dbe3={},_0x43cf67={},_0x543220={'count':0x0,'rows':[]};var _0x41c777=_[_0x5564('0x3a')](db[_0x5564('0x3b')]['rawAttributes'],function(_0x56d1ee){return{'name':_0x56d1ee['fieldName'],'type':_0x56d1ee[_0x5564('0x3c')][_0x5564('0x3d')]};});_0x43cf67[_0x5564('0x3e')]=_[_0x5564('0x3a')](_0x41c777,_0x5564('0x39'));_0x43cf67[_0x5564('0x3f')]=_[_0x5564('0x40')](_0x2de92a['query']);_0x43cf67[_0x5564('0x41')]=_[_0x5564('0x42')](_0x43cf67[_0x5564('0x3e')],_0x43cf67[_0x5564('0x3f')]);_0xf0dbe3[_0x5564('0x43')]=_[_0x5564('0x42')](_0x43cf67[_0x5564('0x3e')],qs['fields'](_0x2de92a[_0x5564('0x3f')][_0x5564('0x44')]));_0xf0dbe3['attributes']=_0xf0dbe3[_0x5564('0x43')][_0x5564('0x45')]?_0xf0dbe3['attributes']:_0x43cf67['model'];if(!_0x2de92a['query'][_0x5564('0x46')](_0x5564('0x47'))){_0xf0dbe3[_0x5564('0x31')]=qs[_0x5564('0x31')](_0x2de92a[_0x5564('0x3f')]['limit']);_0xf0dbe3[_0x5564('0x30')]=qs[_0x5564('0x30')](_0x2de92a[_0x5564('0x3f')][_0x5564('0x30')]);}_0xf0dbe3[_0x5564('0x48')]=qs[_0x5564('0x49')](_0x2de92a[_0x5564('0x3f')]['sort']);_0xf0dbe3['where']=qs[_0x5564('0x41')](_[_0x5564('0x4a')](_0x2de92a[_0x5564('0x3f')],_0x43cf67['filters']),_0x41c777);if(_0x2de92a[_0x5564('0x3f')][_0x5564('0x4b')]){_0xf0dbe3[_0x5564('0x4c')]=_['merge'](_0xf0dbe3[_0x5564('0x4c')],{'$or':_[_0x5564('0x3a')](_0x41c777,function(_0x467132){if(_0x467132[_0x5564('0x3c')]!=='VIRTUAL'){var _0x16676d={};_0x16676d[_0x467132[_0x5564('0x39')]]={'$like':'%'+_0x2de92a['query']['filter']+'%'};return _0x16676d;}})});}_0xf0dbe3=_['merge']({},_0xf0dbe3,_0x2de92a['options']);var _0x674ece={'where':_0xf0dbe3['where']};return db[_0x5564('0x3b')][_0x5564('0x2f')](_0x674ece)[_0x5564('0x36')](function(_0xc340c9){_0x543220[_0x5564('0x2f')]=_0xc340c9;if(_0x2de92a[_0x5564('0x3f')][_0x5564('0x4d')]){_0xf0dbe3[_0x5564('0x4e')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x5564('0x4f')](_0xf0dbe3);})[_0x5564('0x36')](function(_0x47556b){_0x543220[_0x5564('0x50')]=_0x47556b;return _0x543220;})['then'](respondWithFilteredResult(_0x27eb59,_0xf0dbe3))[_0x5564('0x2a')](handleError(_0x27eb59,null));};exports[_0x5564('0x51')]=function(_0xc8ff05,_0x4ae0be){var _0x4c57cd={'raw':![],'where':{'id':_0xc8ff05['params']['id']}},_0x415645={};_0x415645[_0x5564('0x3e')]=_[_0x5564('0x40')](db[_0x5564('0x3b')][_0x5564('0x52')]);_0x415645[_0x5564('0x3f')]=_['keys'](_0xc8ff05['query']);_0x415645['filters']=_['intersection'](_0x415645[_0x5564('0x3e')],_0x415645[_0x5564('0x3f')]);_0x4c57cd['attributes']=_[_0x5564('0x42')](_0x415645[_0x5564('0x3e')],qs[_0x5564('0x44')](_0xc8ff05[_0x5564('0x3f')]['fields']));_0x4c57cd['attributes']=_0x4c57cd[_0x5564('0x43')][_0x5564('0x45')]?_0x4c57cd[_0x5564('0x43')]:_0x415645[_0x5564('0x3e')];if(_0xc8ff05['query']['includeAll']){_0x4c57cd[_0x5564('0x4e')]=[{'all':!![]}];}_0x4c57cd=_[_0x5564('0x53')]({},_0x4c57cd,_0xc8ff05[_0x5564('0x54')]);return db[_0x5564('0x3b')]['find'](_0x4c57cd)['then'](handleEntityNotFound(_0x4ae0be,null))[_0x5564('0x36')](respondWithResult(_0x4ae0be,null))[_0x5564('0x2a')](handleError(_0x4ae0be,null));};exports[_0x5564('0x55')]=function(_0x2444a3,_0x4f214c){return db['DeskConfiguration'][_0x5564('0x55')](_0x2444a3[_0x5564('0x56')],{})['then'](respondWithResult(_0x4f214c,0xc9))['catch'](handleError(_0x4f214c,null));};exports[_0x5564('0x35')]=function(_0x1ff7b9,_0x16f99d){if(_0x1ff7b9[_0x5564('0x56')]['id']){delete _0x1ff7b9[_0x5564('0x56')]['id'];}return db['DeskConfiguration'][_0x5564('0x57')]({'where':{'id':_0x1ff7b9[_0x5564('0x58')]['id']}})[_0x5564('0x36')](handleEntityNotFound(_0x16f99d,null))['then'](saveUpdates(_0x1ff7b9[_0x5564('0x56')],null))['then'](respondWithResult(_0x16f99d,null))[_0x5564('0x2a')](handleError(_0x16f99d,null));};exports['destroy']=function(_0x11dfbe,_0x3f489d){return db[_0x5564('0x3b')][_0x5564('0x57')]({'where':{'id':_0x11dfbe[_0x5564('0x58')]['id']}})[_0x5564('0x36')](handleEntityNotFound(_0x3f489d,null))[_0x5564('0x36')](removeEntity(_0x3f489d,null))['catch'](handleError(_0x3f489d,null));};exports[_0x5564('0x59')]=function(_0x805394,_0x518bd1,_0x3341b8){var _0x75dfcb={};var _0x206d6b={};var _0x14de04;var _0x2bbda3;return db[_0x5564('0x3b')][_0x5564('0x5a')]({'where':{'id':_0x805394[_0x5564('0x58')]['id']}})[_0x5564('0x36')](handleEntityNotFound(_0x518bd1,null))[_0x5564('0x36')](function(_0x1addae){if(_0x1addae){_0x14de04=_0x1addae;_0x206d6b[_0x5564('0x3e')]=_[_0x5564('0x40')](db[_0x5564('0x5b')][_0x5564('0x52')]);_0x206d6b[_0x5564('0x3f')]=_['keys'](_0x805394[_0x5564('0x3f')]);_0x206d6b['filters']=_[_0x5564('0x42')](_0x206d6b[_0x5564('0x3e')],_0x206d6b[_0x5564('0x3f')]);_0x75dfcb['attributes']=_[_0x5564('0x42')](_0x206d6b[_0x5564('0x3e')],qs[_0x5564('0x44')](_0x805394['query'][_0x5564('0x44')]));_0x75dfcb[_0x5564('0x43')]=_0x75dfcb['attributes']['length']?_0x75dfcb['attributes']:_0x206d6b[_0x5564('0x3e')];_0x75dfcb['order']=qs['sort'](_0x805394[_0x5564('0x3f')][_0x5564('0x49')]);_0x75dfcb[_0x5564('0x4c')]=qs[_0x5564('0x41')](_[_0x5564('0x4a')](_0x805394[_0x5564('0x3f')],_0x206d6b[_0x5564('0x41')]));if(_0x805394[_0x5564('0x3f')][_0x5564('0x4b')]){_0x75dfcb[_0x5564('0x4c')]=_['merge'](_0x75dfcb[_0x5564('0x4c')],{'$or':_['map'](_0x75dfcb[_0x5564('0x43')],function(_0x487c56){var _0x322b71={};_0x322b71[_0x487c56]={'$like':'%'+_0x805394[_0x5564('0x3f')]['filter']+'%'};return _0x322b71;})});}_0x75dfcb=_[_0x5564('0x53')]({},_0x75dfcb,_0x805394[_0x5564('0x54')]);return _0x14de04[_0x5564('0x59')](_0x75dfcb);}})[_0x5564('0x36')](function(_0x5a667c){if(_0x5a667c){_0x2bbda3=_0x5a667c['length'];if(!_0x805394[_0x5564('0x3f')][_0x5564('0x46')](_0x5564('0x47'))){_0x75dfcb['limit']=qs[_0x5564('0x31')](_0x805394[_0x5564('0x3f')][_0x5564('0x31')]);_0x75dfcb[_0x5564('0x30')]=qs[_0x5564('0x30')](_0x805394[_0x5564('0x3f')]['offset']);}return _0x14de04['getFields'](_0x75dfcb);}})[_0x5564('0x36')](function(_0xf6a18){if(_0xf6a18){return _0xf6a18?{'count':_0x2bbda3,'rows':_0xf6a18}:null;}})['then'](respondWithResult(_0x518bd1,null))[_0x5564('0x2a')](handleError(_0x518bd1,null));};exports[_0x5564('0x5c')]=function(_0x1190cd,_0x19052e,_0x16bb1d){var _0x3e925f={};var _0x2b44cb={};var _0x5ac1fd;var _0x304624;return db['DeskConfiguration']['findOne']({'where':{'id':_0x1190cd[_0x5564('0x58')]['id']}})[_0x5564('0x36')](handleEntityNotFound(_0x19052e,null))[_0x5564('0x36')](function(_0x4179fb){if(_0x4179fb){_0x5ac1fd=_0x4179fb;_0x2b44cb[_0x5564('0x3e')]=_[_0x5564('0x40')](db[_0x5564('0x5b')][_0x5564('0x52')]);_0x2b44cb['query']=_[_0x5564('0x40')](_0x1190cd[_0x5564('0x3f')]);_0x2b44cb[_0x5564('0x41')]=_[_0x5564('0x42')](_0x2b44cb[_0x5564('0x3e')],_0x2b44cb['query']);_0x3e925f[_0x5564('0x43')]=_['intersection'](_0x2b44cb[_0x5564('0x3e')],qs['fields'](_0x1190cd[_0x5564('0x3f')][_0x5564('0x44')]));_0x3e925f[_0x5564('0x43')]=_0x3e925f[_0x5564('0x43')]['length']?_0x3e925f[_0x5564('0x43')]:_0x2b44cb[_0x5564('0x3e')];_0x3e925f['order']=qs['sort'](_0x1190cd[_0x5564('0x3f')][_0x5564('0x49')]);_0x3e925f[_0x5564('0x4c')]=qs[_0x5564('0x41')](_['pick'](_0x1190cd[_0x5564('0x3f')],_0x2b44cb[_0x5564('0x41')]));if(_0x1190cd['query'][_0x5564('0x4b')]){_0x3e925f[_0x5564('0x4c')]=_[_0x5564('0x53')](_0x3e925f['where'],{'$or':_[_0x5564('0x3a')](_0x3e925f[_0x5564('0x43')],function(_0x2d7d3e){var _0xf7113a={};_0xf7113a[_0x2d7d3e]={'$like':'%'+_0x1190cd['query'][_0x5564('0x4b')]+'%'};return _0xf7113a;})});}_0x3e925f=_[_0x5564('0x53')]({},_0x3e925f,_0x1190cd[_0x5564('0x54')]);return _0x5ac1fd[_0x5564('0x5c')](_0x3e925f);}})[_0x5564('0x36')](function(_0x3781d7){if(_0x3781d7){_0x304624=_0x3781d7['length'];if(!_0x1190cd[_0x5564('0x3f')][_0x5564('0x46')](_0x5564('0x47'))){_0x3e925f['limit']=qs[_0x5564('0x31')](_0x1190cd[_0x5564('0x3f')]['limit']);_0x3e925f[_0x5564('0x30')]=qs[_0x5564('0x30')](_0x1190cd[_0x5564('0x3f')]['offset']);}return _0x5ac1fd['getSubjects'](_0x3e925f);}})['then'](function(_0x4077a8){if(_0x4077a8){return _0x4077a8?{'count':_0x304624,'rows':_0x4077a8}:null;}})[_0x5564('0x36')](respondWithResult(_0x19052e,null))[_0x5564('0x2a')](handleError(_0x19052e,null));};exports['getDescriptions']=function(_0x179c92,_0x558f3b,_0x4a69ec){var _0x1145fa={};var _0x2da3ed={};var _0x557e28;var _0x269577;return db[_0x5564('0x3b')][_0x5564('0x5a')]({'where':{'id':_0x179c92[_0x5564('0x58')]['id']}})[_0x5564('0x36')](handleEntityNotFound(_0x558f3b,null))[_0x5564('0x36')](function(_0xd6e97a){if(_0xd6e97a){_0x557e28=_0xd6e97a;_0x2da3ed[_0x5564('0x3e')]=_[_0x5564('0x40')](db[_0x5564('0x5b')][_0x5564('0x52')]);_0x2da3ed[_0x5564('0x3f')]=_[_0x5564('0x40')](_0x179c92[_0x5564('0x3f')]);_0x2da3ed[_0x5564('0x41')]=_['intersection'](_0x2da3ed[_0x5564('0x3e')],_0x2da3ed[_0x5564('0x3f')]);_0x1145fa[_0x5564('0x43')]=_[_0x5564('0x42')](_0x2da3ed[_0x5564('0x3e')],qs['fields'](_0x179c92[_0x5564('0x3f')][_0x5564('0x44')]));_0x1145fa[_0x5564('0x43')]=_0x1145fa['attributes'][_0x5564('0x45')]?_0x1145fa[_0x5564('0x43')]:_0x2da3ed['model'];_0x1145fa[_0x5564('0x48')]=qs[_0x5564('0x49')](_0x179c92[_0x5564('0x3f')][_0x5564('0x49')]);_0x1145fa['where']=qs[_0x5564('0x41')](_[_0x5564('0x4a')](_0x179c92['query'],_0x2da3ed[_0x5564('0x41')]));if(_0x179c92[_0x5564('0x3f')][_0x5564('0x4b')]){_0x1145fa[_0x5564('0x4c')]=_[_0x5564('0x53')](_0x1145fa[_0x5564('0x4c')],{'$or':_['map'](_0x1145fa[_0x5564('0x43')],function(_0x1ef1a2){var _0xd4ae9a={};_0xd4ae9a[_0x1ef1a2]={'$like':'%'+_0x179c92[_0x5564('0x3f')][_0x5564('0x4b')]+'%'};return _0xd4ae9a;})});}_0x1145fa=_['merge']({},_0x1145fa,_0x179c92[_0x5564('0x54')]);return _0x557e28[_0x5564('0x5d')](_0x1145fa);}})[_0x5564('0x36')](function(_0x47af92){if(_0x47af92){_0x269577=_0x47af92[_0x5564('0x45')];if(!_0x179c92[_0x5564('0x3f')][_0x5564('0x46')](_0x5564('0x47'))){_0x1145fa[_0x5564('0x31')]=qs[_0x5564('0x31')](_0x179c92[_0x5564('0x3f')][_0x5564('0x31')]);_0x1145fa[_0x5564('0x30')]=qs[_0x5564('0x30')](_0x179c92['query'][_0x5564('0x30')]);}return _0x557e28[_0x5564('0x5d')](_0x1145fa);}})[_0x5564('0x36')](function(_0x26c993){if(_0x26c993){return _0x26c993?{'count':_0x269577,'rows':_0x26c993}:null;}})[_0x5564('0x36')](respondWithResult(_0x558f3b,null))[_0x5564('0x2a')](handleError(_0x558f3b,null));};exports[_0x5564('0x5e')]=function(_0x4b605f,_0x23505b,_0x28fa10){var _0x279951={};var _0x441ff7={};var _0x2d9527;var _0x95b1fd;return db[_0x5564('0x3b')][_0x5564('0x5a')]({'where':{'id':_0x4b605f[_0x5564('0x58')]['id']}})[_0x5564('0x36')](handleEntityNotFound(_0x23505b,null))[_0x5564('0x36')](function(_0x4eec80){if(_0x4eec80){_0x2d9527=_0x4eec80;_0x441ff7[_0x5564('0x3e')]=_[_0x5564('0x40')](db['Tag'][_0x5564('0x52')]);_0x441ff7['query']=_[_0x5564('0x40')](_0x4b605f[_0x5564('0x3f')]);_0x441ff7[_0x5564('0x41')]=_[_0x5564('0x42')](_0x441ff7['model'],_0x441ff7[_0x5564('0x3f')]);_0x279951[_0x5564('0x43')]=_[_0x5564('0x42')](_0x441ff7[_0x5564('0x3e')],qs[_0x5564('0x44')](_0x4b605f[_0x5564('0x3f')][_0x5564('0x44')]));_0x279951['attributes']=_0x279951[_0x5564('0x43')][_0x5564('0x45')]?_0x279951['attributes']:_0x441ff7[_0x5564('0x3e')];_0x279951[_0x5564('0x48')]=qs[_0x5564('0x49')](_0x4b605f[_0x5564('0x3f')]['sort']);_0x279951[_0x5564('0x4c')]=qs[_0x5564('0x41')](_[_0x5564('0x4a')](_0x4b605f[_0x5564('0x3f')],_0x441ff7['filters']));if(_0x4b605f[_0x5564('0x3f')]['filter']){_0x279951[_0x5564('0x4c')]=_[_0x5564('0x53')](_0x279951[_0x5564('0x4c')],{'$or':_[_0x5564('0x3a')](_0x279951[_0x5564('0x43')],function(_0x2194c){var _0x3852c2={};_0x3852c2[_0x2194c]={'$like':'%'+_0x4b605f[_0x5564('0x3f')][_0x5564('0x4b')]+'%'};return _0x3852c2;})});}_0x279951=_[_0x5564('0x53')]({},_0x279951,_0x4b605f['options']);return _0x2d9527[_0x5564('0x5e')](_0x279951);}})['then'](function(_0x5ab84d){if(_0x5ab84d){_0x95b1fd=_0x5ab84d[_0x5564('0x45')];if(!_0x4b605f[_0x5564('0x3f')][_0x5564('0x46')](_0x5564('0x47'))){_0x279951[_0x5564('0x31')]=qs[_0x5564('0x31')](_0x4b605f['query'][_0x5564('0x31')]);_0x279951[_0x5564('0x30')]=qs[_0x5564('0x30')](_0x4b605f[_0x5564('0x3f')]['offset']);}return _0x2d9527[_0x5564('0x5e')](_0x279951);}})[_0x5564('0x36')](function(_0xbd337c){if(_0xbd337c){return _0xbd337c?{'count':_0x95b1fd,'rows':_0xbd337c}:null;}})[_0x5564('0x36')](respondWithResult(_0x23505b,null))['catch'](handleError(_0x23505b,null));};exports[_0x5564('0x5f')]=function(_0x30b9cf,_0x4ed313,_0x10ed65){if(_0x30b9cf[_0x5564('0x56')]['id']){delete _0x30b9cf[_0x5564('0x56')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x30b9cf['params']['id']}})['then'](handleEntityNotFound(_0x4ed313,null))[_0x5564('0x36')](function(_0xd1163b){if(_0xd1163b){return _0xd1163b[_0x5564('0x5f')](_0x30b9cf['body'][_0x5564('0x60')]||[]);}return null;})[_0x5564('0x36')](respondWithResult(_0x4ed313,null))[_0x5564('0x2a')](handleError(_0x4ed313,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 75a57f2..dddfc8c 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 _0x575e=['int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x575e,0x91));var _0xe575=function(_0xa69592,_0x571583){_0xa69592=_0xa69592-0x0;var _0x4c5ec5=_0x575e[_0xa69592];return _0x4c5ec5;};'use strict';var _=require(_0xe575('0x0'));var util=require(_0xe575('0x1'));var logger=require(_0xe575('0x2'))(_0xe575('0x3'));var moment=require(_0xe575('0x4'));var BPromise=require(_0xe575('0x5'));var rp=require(_0xe575('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe575('0x7'));var config=require(_0xe575('0x8'));var attributes=require(_0xe575('0x9'));module[_0xe575('0xa')]=function(_0x777da1,_0x27b141){return _0x777da1['define']('DeskConfiguration',attributes,{'tableName':_0xe575('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde58=['moment','bluebird','path','rimraf','../../config/environment','DeskConfiguration','int_desk_configurations','lodash','util','api'];(function(_0x21353c,_0x2ea587){var _0xa99120=function(_0x557f33){while(--_0x557f33){_0x21353c['push'](_0x21353c['shift']());}};_0xa99120(++_0x2ea587);}(_0xde58,0x1ab));var _0x8de5=function(_0x4c5b52,_0x1a945a){_0x4c5b52=_0x4c5b52-0x0;var _0x24fce3=_0xde58[_0x4c5b52];return _0x24fce3;};'use strict';var _=require(_0x8de5('0x0'));var util=require(_0x8de5('0x1'));var logger=require('../../config/logger')(_0x8de5('0x2'));var moment=require(_0x8de5('0x3'));var BPromise=require(_0x8de5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8de5('0x5'));var rimraf=require(_0x8de5('0x6'));var config=require(_0x8de5('0x7'));var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x1ebeda,_0x719131){return _0x1ebeda['define'](_0x8de5('0x8'),attributes,{'tableName':_0x8de5('0x9'),'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 2f6393d..6ef1a5e 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 _0x19ea=['result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x150ee9,_0x14dcd0){var _0x39d181=function(_0x27d0d8){while(--_0x27d0d8){_0x150ee9['push'](_0x150ee9['shift']());}};_0x39d181(++_0x14dcd0);}(_0x19ea,0xfe));var _0xa19e=function(_0x3b150c,_0x2f93f8){_0x3b150c=_0x3b150c-0x0;var _0x5cd414=_0x19ea[_0x3b150c];return _0x5cd414;};'use strict';var _=require(_0xa19e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa19e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa19e('0x2'));var db=require(_0xa19e('0x3'))['db'];var utils=require(_0xa19e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa19e('0x5'));var jayson=require(_0xa19e('0x6'));var client=jayson[_0xa19e('0x7')][_0xa19e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1087e7,_0x30fd4a,_0x336e23){return new BPromise(function(_0x1867cb,_0x44e468){return client[_0xa19e('0x9')](_0x1087e7,_0x336e23)[_0xa19e('0xa')](function(_0x59b907){logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));logger[_0xa19e('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x30fd4a,_0xa19e('0xd'),JSON[_0xa19e('0xf')](_0x59b907));if(_0x59b907[_0xa19e('0x10')]){if(_0x59b907['error'][_0xa19e('0x11')]===0x1f4){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x44e468(_0x59b907['error'][_0xa19e('0x12')]);}logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);return _0x1867cb(_0x59b907[_0xa19e('0x10')][_0xa19e('0x12')]);}else{logger[_0xa19e('0xb')](_0xa19e('0xc'),_0x30fd4a,_0xa19e('0xd'));_0x1867cb(_0x59b907[_0xa19e('0x13')]['message']);}})[_0xa19e('0x14')](function(_0x34066a){logger[_0xa19e('0x10')](_0xa19e('0xc'),_0x30fd4a,_0x34066a);_0x44e468(_0x34066a);});});} \ No newline at end of file +var _0x235a=['http','then','DeskConfiguration,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x6c1cd3,_0x5e0889){var _0x5cbbc2=function(_0x4cbf5e){while(--_0x4cbf5e){_0x6c1cd3['push'](_0x6c1cd3['shift']());}};_0x5cbbc2(++_0x5e0889);}(_0x235a,0x1ef));var _0xa235=function(_0xba8316,_0x4b2ecf){_0xba8316=_0xba8316-0x0;var _0x185114=_0x235a[_0xba8316];return _0x185114;};'use strict';var _=require(_0xa235('0x0'));var util=require(_0xa235('0x1'));var moment=require(_0xa235('0x2'));var BPromise=require('bluebird');var rs=require(_0xa235('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa235('0x4'))['db'];var utils=require(_0xa235('0x5'));var logger=require(_0xa235('0x6'))(_0xa235('0x7'));var config=require(_0xa235('0x8'));var jayson=require(_0xa235('0x9'));var client=jayson[_0xa235('0xa')][_0xa235('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b849b,_0x2e535e,_0x2dc1ba){return new BPromise(function(_0x450e27,_0x2f3403){return client['request'](_0x4b849b,_0x2dc1ba)[_0xa235('0xc')](function(_0x561602){logger['info'](_0xa235('0xd'),_0x2e535e,'request\x20sent');logger[_0xa235('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2e535e,'request\x20sent',JSON['stringify'](_0x561602));if(_0x561602[_0xa235('0xf')]){if(_0x561602[_0xa235('0xf')][_0xa235('0x10')]===0x1f4){logger[_0xa235('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x2e535e,_0x561602['error']['message']);return _0x2f3403(_0x561602[_0xa235('0xf')][_0xa235('0x11')]);}logger[_0xa235('0xf')](_0xa235('0xd'),_0x2e535e,_0x561602[_0xa235('0xf')][_0xa235('0x11')]);return _0x450e27(_0x561602[_0xa235('0xf')][_0xa235('0x11')]);}else{logger[_0xa235('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x2e535e,_0xa235('0x13'));_0x450e27(_0x561602[_0xa235('0x14')][_0xa235('0x11')]);}})[_0xa235('0x15')](function(_0x16dbe9){logger[_0xa235('0xf')]('DeskConfiguration,\x20%s,\x20%s',_0x2e535e,_0x16dbe9);_0x2f3403(_0x16dbe9);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index bea0dfa..644fb60 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 _0x041e=['Router','../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','post','create','/:id','update','delete','exports','util','path','connect-timeout','express'];(function(_0x243eb1,_0x87b50f){var _0x1777ae=function(_0x2315b4){while(--_0x2315b4){_0x243eb1['push'](_0x243eb1['shift']());}};_0x1777ae(++_0x87b50f);}(_0x041e,0x18c));var _0xe041=function(_0x4b4dbd,_0x341276){_0x4b4dbd=_0x4b4dbd-0x0;var _0x5df992=_0x041e[_0x4b4dbd];return _0x5df992;};'use strict';var multer=require('multer');var util=require(_0xe041('0x0'));var path=require(_0xe041('0x1'));var timeout=require(_0xe041('0x2'));var express=require(_0xe041('0x3'));var router=express[_0xe041('0x4')]();var auth=require(_0xe041('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe041('0x6'));var controller=require(_0xe041('0x7'));router[_0xe041('0x8')]('/',auth[_0xe041('0x9')](),controller['index']);router[_0xe041('0x8')]('/:id',auth[_0xe041('0x9')](),controller['show']);router[_0xe041('0xa')]('/',auth['isAuthenticated'](),controller[_0xe041('0xb')]);router['put'](_0xe041('0xc'),auth[_0xe041('0x9')](),controller[_0xe041('0xd')]);router[_0xe041('0xe')](_0xe041('0xc'),auth[_0xe041('0x9')](),controller['destroy']);module[_0xe041('0xf')]=router; \ No newline at end of file +var _0x33d7=['/:id','delete','destroy','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated','create','put'];(function(_0xf3e31a,_0x3b9ea3){var _0x18333a=function(_0x33d86f){while(--_0x33d86f){_0xf3e31a['push'](_0xf3e31a['shift']());}};_0x18333a(++_0x3b9ea3);}(_0x33d7,0x143));var _0x733d=function(_0x122a75,_0x49de6f){_0x122a75=_0x122a75-0x0;var _0x1c7976=_0x33d7[_0x122a75];return _0x1c7976;};'use strict';var multer=require('multer');var util=require(_0x733d('0x0'));var path=require('path');var timeout=require(_0x733d('0x1'));var express=require('express');var router=express[_0x733d('0x2')]();var auth=require(_0x733d('0x3'));var interaction=require(_0x733d('0x4'));var config=require(_0x733d('0x5'));var controller=require('./intDeskField.controller');router[_0x733d('0x6')]('/',auth['isAuthenticated'](),controller[_0x733d('0x7')]);router[_0x733d('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x733d('0x8')]);router[_0x733d('0x9')]('/',auth[_0x733d('0xa')](),controller[_0x733d('0xb')]);router[_0x733d('0xc')](_0x733d('0xd'),auth[_0x733d('0xa')](),controller['update']);router[_0x733d('0xe')](_0x733d('0xd'),auth[_0x733d('0xa')](),controller[_0x733d('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 517441e..13bfa5c 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 _0xa088=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x368836,_0x23a436){var _0x2af436=function(_0x3d6d18){while(--_0x3d6d18){_0x368836['push'](_0x368836['shift']());}};_0x2af436(++_0x23a436);}(_0xa088,0x19f));var _0x8a08=function(_0x3ffdb6,_0x15fa26){_0x3ffdb6=_0x3ffdb6-0x0;var _0x3f96c0=_0xa088[_0x3ffdb6];return _0x3f96c0;};'use strict';var Sequelize=require(_0x8a08('0x0'));module['exports']={'type':{'type':Sequelize[_0x8a08('0x1')](_0x8a08('0x2'),_0x8a08('0x3'),_0x8a08('0x4'),_0x8a08('0x5')),'defaultValue':_0x8a08('0x2')},'content':{'type':Sequelize[_0x8a08('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8a08('0x1')](_0x8a08('0x2'),'variable',_0x8a08('0x4'))},'keyContent':{'type':Sequelize[_0x8a08('0x6')]},'idField':{'type':Sequelize[_0x8a08('0x6')]},'nameField':{'type':Sequelize[_0x8a08('0x6')]},'customField':{'type':Sequelize[_0x8a08('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8a08('0x6')]}}; \ No newline at end of file +var _0xc457=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x4f0ae2,_0x715854){var _0x5bb5e9=function(_0x1603d6){while(--_0x1603d6){_0x4f0ae2['push'](_0x4f0ae2['shift']());}};_0x5bb5e9(++_0x715854);}(_0xc457,0x83));var _0x7c45=function(_0x2395de,_0x3bf4c4){_0x2395de=_0x2395de-0x0;var _0x1bf7d4=_0xc457[_0x2395de];return _0x1bf7d4;};'use strict';var Sequelize=require(_0x7c45('0x0'));module[_0x7c45('0x1')]={'type':{'type':Sequelize[_0x7c45('0x2')](_0x7c45('0x3'),_0x7c45('0x4'),_0x7c45('0x5'),_0x7c45('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7c45('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x7c45('0x3'),_0x7c45('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x7c45('0x7')]},'idField':{'type':Sequelize[_0x7c45('0x7')]},'nameField':{'type':Sequelize[_0x7c45('0x7')]},'customField':{'type':Sequelize[_0x7c45('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7c45('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 2347776..922d768 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 _0xd91d=['create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','save','update','then','destroy','stack','name','index','map','DeskField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','catch'];(function(_0x5b1490,_0x5459ee){var _0x437bed=function(_0x27aeb0){while(--_0x27aeb0){_0x5b1490['push'](_0x5b1490['shift']());}};_0x437bed(++_0x5459ee);}(_0xd91d,0x11e));var _0xdd91=function(_0x4c58ad,_0x3d5d11){_0x4c58ad=_0x4c58ad-0x0;var _0x58ae63=_0xd91d[_0x4c58ad];return _0x58ae63;};'use strict';var pdf=require(_0xdd91('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdd91('0x1'));var zipdir=require(_0xdd91('0x2'));var jsonpatch=require(_0xdd91('0x3'));var rp=require('request-promise');var moment=require(_0xdd91('0x4'));var BPromise=require(_0xdd91('0x5'));var Mustache=require('mustache');var util=require(_0xdd91('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdd91('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdd91('0x8'));var crypto=require(_0xdd91('0x9'));var jsforce=require(_0xdd91('0xa'));var deskjs=require(_0xdd91('0xb'));var toCsv=require('to-csv');var querystring=require(_0xdd91('0xc'));var Papa=require(_0xdd91('0xd'));var Redis=require('ioredis');var authService=require(_0xdd91('0xe'));var qs=require(_0xdd91('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd91('0x10'));var logger=require(_0xdd91('0x11'))(_0xdd91('0x12'));var utils=require(_0xdd91('0x13'));var config=require(_0xdd91('0x14'));var db=require(_0xdd91('0x15'))['db'];function respondWithStatusCode(_0x12ba90,_0x4e4856){_0x4e4856=_0x4e4856||0xcc;return function(_0xf25cfd){if(_0xf25cfd){return _0x12ba90[_0xdd91('0x16')](_0x4e4856);}return _0x12ba90['status'](_0x4e4856)[_0xdd91('0x17')]();};}function respondWithResult(_0x1e319c,_0x594683){_0x594683=_0x594683||0xc8;return function(_0x9be899){if(_0x9be899){return _0x1e319c[_0xdd91('0x18')](_0x594683)[_0xdd91('0x19')](_0x9be899);}};}function respondWithFilteredResult(_0x343322,_0x19d305){return function(_0xe29b24){if(_0xe29b24){var _0x43558a=_0xe29b24[_0xdd91('0x1a')],_0x4f4a2e=_0x19d305[_0xdd91('0x1b')],_0x228b14=_0x19d305[_0xdd91('0x1b')]+_0x19d305['limit'],_0x3ba973;if(_0x228b14>=_0x43558a){_0x228b14=_0x43558a;_0x3ba973=0xc8;}else{_0x3ba973=0xce;}_0x343322[_0xdd91('0x18')](_0x3ba973);return _0x343322['set'](_0xdd91('0x1c'),_0x4f4a2e+'-'+_0x228b14+'/'+_0x43558a)['json'](_0xe29b24);}return null;};}function patchUpdates(_0x526a7e){return function(_0x74d71d){try{jsonpatch[_0xdd91('0x1d')](_0x74d71d,_0x526a7e,!![]);}catch(_0x53d5d6){return BPromise['reject'](_0x53d5d6);}return _0x74d71d[_0xdd91('0x1e')]();};}function saveUpdates(_0x52231b,_0x73fda8){return function(_0x1fb52f){if(_0x1fb52f){return _0x1fb52f[_0xdd91('0x1f')](_0x52231b)[_0xdd91('0x20')](function(_0xbbff83){return _0xbbff83;});}return null;};}function removeEntity(_0x2fa864,_0x4337b4){return function(_0x34fe85){if(_0x34fe85){return _0x34fe85[_0xdd91('0x21')]()[_0xdd91('0x20')](function(){_0x2fa864['status'](0xcc)[_0xdd91('0x17')]();});}};}function handleEntityNotFound(_0x10bc66,_0x1b5632){return function(_0x598f7e){if(!_0x598f7e){_0x10bc66[_0xdd91('0x16')](0x194);}return _0x598f7e;};}function handleError(_0xa0b4c1,_0xa08c61){_0xa08c61=_0xa08c61||0x1f4;return function(_0x2ba446){logger['error'](_0x2ba446[_0xdd91('0x22')]);if(_0x2ba446[_0xdd91('0x23')]){delete _0x2ba446[_0xdd91('0x23')];}_0xa0b4c1[_0xdd91('0x18')](_0xa08c61)['send'](_0x2ba446);};}exports[_0xdd91('0x24')]=function(_0x2cdd68,_0xb646f7){var _0x524ba9={},_0x1b85e0={},_0x17cb37={'count':0x0,'rows':[]};var _0xc13870=_[_0xdd91('0x25')](db[_0xdd91('0x26')][_0xdd91('0x27')],function(_0x1d79b0){return{'name':_0x1d79b0[_0xdd91('0x28')],'type':_0x1d79b0['type'][_0xdd91('0x29')]};});_0x1b85e0[_0xdd91('0x2a')]=_['map'](_0xc13870,'name');_0x1b85e0[_0xdd91('0x2b')]=_[_0xdd91('0x2c')](_0x2cdd68[_0xdd91('0x2b')]);_0x1b85e0[_0xdd91('0x2d')]=_[_0xdd91('0x2e')](_0x1b85e0[_0xdd91('0x2a')],_0x1b85e0[_0xdd91('0x2b')]);_0x524ba9[_0xdd91('0x2f')]=_[_0xdd91('0x2e')](_0x1b85e0[_0xdd91('0x2a')],qs[_0xdd91('0x30')](_0x2cdd68['query'][_0xdd91('0x30')]));_0x524ba9[_0xdd91('0x2f')]=_0x524ba9[_0xdd91('0x2f')][_0xdd91('0x31')]?_0x524ba9[_0xdd91('0x2f')]:_0x1b85e0[_0xdd91('0x2a')];if(!_0x2cdd68[_0xdd91('0x2b')][_0xdd91('0x32')](_0xdd91('0x33'))){_0x524ba9[_0xdd91('0x34')]=qs[_0xdd91('0x34')](_0x2cdd68[_0xdd91('0x2b')][_0xdd91('0x34')]);_0x524ba9['offset']=qs[_0xdd91('0x1b')](_0x2cdd68['query'][_0xdd91('0x1b')]);}_0x524ba9[_0xdd91('0x35')]=qs[_0xdd91('0x36')](_0x2cdd68['query'][_0xdd91('0x36')]);_0x524ba9[_0xdd91('0x37')]=qs[_0xdd91('0x2d')](_[_0xdd91('0x38')](_0x2cdd68[_0xdd91('0x2b')],_0x1b85e0[_0xdd91('0x2d')]),_0xc13870);if(_0x2cdd68[_0xdd91('0x2b')][_0xdd91('0x39')]){_0x524ba9['where']=_['merge'](_0x524ba9[_0xdd91('0x37')],{'$or':_[_0xdd91('0x25')](_0xc13870,function(_0x3f2638){if(_0x3f2638[_0xdd91('0x3a')]!==_0xdd91('0x3b')){var _0xae9866={};_0xae9866[_0x3f2638['name']]={'$like':'%'+_0x2cdd68[_0xdd91('0x2b')][_0xdd91('0x39')]+'%'};return _0xae9866;}})});}_0x524ba9=_[_0xdd91('0x3c')]({},_0x524ba9,_0x2cdd68[_0xdd91('0x3d')]);var _0x4728ee={'where':_0x524ba9['where']};return db[_0xdd91('0x26')][_0xdd91('0x1a')](_0x4728ee)[_0xdd91('0x20')](function(_0x49c3c5){_0x17cb37[_0xdd91('0x1a')]=_0x49c3c5;if(_0x2cdd68['query'][_0xdd91('0x3e')]){_0x524ba9[_0xdd91('0x3f')]=[{'all':!![]}];}return db['DeskField'][_0xdd91('0x40')](_0x524ba9);})[_0xdd91('0x20')](function(_0x590bae){_0x17cb37['rows']=_0x590bae;return _0x17cb37;})[_0xdd91('0x20')](respondWithFilteredResult(_0xb646f7,_0x524ba9))['catch'](handleError(_0xb646f7,null));};exports[_0xdd91('0x41')]=function(_0x150e78,_0x5525f1){var _0x1592b8={'raw':!![],'where':{'id':_0x150e78[_0xdd91('0x42')]['id']}},_0x5bf9f6={};_0x5bf9f6['model']=_[_0xdd91('0x2c')](db[_0xdd91('0x26')]['rawAttributes']);_0x5bf9f6['query']=_[_0xdd91('0x2c')](_0x150e78[_0xdd91('0x2b')]);_0x5bf9f6[_0xdd91('0x2d')]=_[_0xdd91('0x2e')](_0x5bf9f6[_0xdd91('0x2a')],_0x5bf9f6[_0xdd91('0x2b')]);_0x1592b8[_0xdd91('0x2f')]=_['intersection'](_0x5bf9f6[_0xdd91('0x2a')],qs[_0xdd91('0x30')](_0x150e78['query'][_0xdd91('0x30')]));_0x1592b8['attributes']=_0x1592b8['attributes']['length']?_0x1592b8[_0xdd91('0x2f')]:_0x5bf9f6[_0xdd91('0x2a')];if(_0x150e78['query'][_0xdd91('0x3e')]){_0x1592b8[_0xdd91('0x3f')]=[{'all':!![]}];}_0x1592b8=_[_0xdd91('0x3c')]({},_0x1592b8,_0x150e78['options']);return db[_0xdd91('0x26')][_0xdd91('0x43')](_0x1592b8)[_0xdd91('0x20')](handleEntityNotFound(_0x5525f1,null))['then'](respondWithResult(_0x5525f1,null))[_0xdd91('0x44')](handleError(_0x5525f1,null));};exports[_0xdd91('0x45')]=function(_0x5c13fc,_0xe6ef0d){return db[_0xdd91('0x26')][_0xdd91('0x45')](_0x5c13fc[_0xdd91('0x46')],{})[_0xdd91('0x20')](respondWithResult(_0xe6ef0d,0xc9))[_0xdd91('0x44')](handleError(_0xe6ef0d,null));};exports[_0xdd91('0x1f')]=function(_0x266e97,_0x86ca35){if(_0x266e97[_0xdd91('0x46')]['id']){delete _0x266e97[_0xdd91('0x46')]['id'];}return db[_0xdd91('0x26')][_0xdd91('0x43')]({'where':{'id':_0x266e97['params']['id']}})[_0xdd91('0x20')](handleEntityNotFound(_0x86ca35,null))[_0xdd91('0x20')](saveUpdates(_0x266e97[_0xdd91('0x46')],null))[_0xdd91('0x20')](respondWithResult(_0x86ca35,null))[_0xdd91('0x44')](handleError(_0x86ca35,null));};exports[_0xdd91('0x21')]=function(_0x420161,_0x4ee8d9){return db['DeskField'][_0xdd91('0x43')]({'where':{'id':_0x420161[_0xdd91('0x42')]['id']}})[_0xdd91('0x20')](handleEntityNotFound(_0x4ee8d9,null))[_0xdd91('0x20')](removeEntity(_0x4ee8d9,null))[_0xdd91('0x44')](handleError(_0x4ee8d9,null));}; \ No newline at end of file +var _0xc313=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','DeskField','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','body'];(function(_0x728be9,_0x5e880e){var _0x1c49ad=function(_0x58fb61){while(--_0x58fb61){_0x728be9['push'](_0x728be9['shift']());}};_0x1c49ad(++_0x5e880e);}(_0xc313,0x1c2));var _0x3c31=function(_0x2c6371,_0x15765a){_0x2c6371=_0x2c6371-0x0;var _0x52a441=_0xc313[_0x2c6371];return _0x52a441;};'use strict';var pdf=require(_0x3c31('0x0'));var emlformat=require(_0x3c31('0x1'));var rimraf=require(_0x3c31('0x2'));var zipdir=require(_0x3c31('0x3'));var jsonpatch=require(_0x3c31('0x4'));var rp=require(_0x3c31('0x5'));var moment=require('moment');var BPromise=require(_0x3c31('0x6'));var Mustache=require(_0x3c31('0x7'));var util=require(_0x3c31('0x8'));var path=require('path');var sox=require(_0x3c31('0x9'));var csv=require(_0x3c31('0xa'));var ejs=require(_0x3c31('0xb'));var fs=require('fs');var _=require(_0x3c31('0xc'));var squel=require(_0x3c31('0xd'));var crypto=require('crypto');var jsforce=require(_0x3c31('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3c31('0xf'));var Papa=require('papaparse');var Redis=require(_0x3c31('0x10'));var authService=require(_0x3c31('0x11'));var qs=require(_0x3c31('0x12'));var as=require(_0x3c31('0x13'));var hardwareService=require(_0x3c31('0x14'));var logger=require(_0x3c31('0x15'))(_0x3c31('0x16'));var utils=require(_0x3c31('0x17'));var config=require(_0x3c31('0x18'));var db=require(_0x3c31('0x19'))['db'];function respondWithStatusCode(_0xc29714,_0x4a54dc){_0x4a54dc=_0x4a54dc||0xcc;return function(_0x2bc096){if(_0x2bc096){return _0xc29714['sendStatus'](_0x4a54dc);}return _0xc29714['status'](_0x4a54dc)[_0x3c31('0x1a')]();};}function respondWithResult(_0x2ffd2a,_0x519ec4){_0x519ec4=_0x519ec4||0xc8;return function(_0xc44faa){if(_0xc44faa){return _0x2ffd2a[_0x3c31('0x1b')](_0x519ec4)['json'](_0xc44faa);}};}function respondWithFilteredResult(_0x4b7246,_0x51df16){return function(_0x3c5080){if(_0x3c5080){var _0xf7c79c=_0x3c5080[_0x3c31('0x1c')],_0x7db098=_0x51df16['offset'],_0x29f89d=_0x51df16[_0x3c31('0x1d')]+_0x51df16[_0x3c31('0x1e')],_0x4f02ef;if(_0x29f89d>=_0xf7c79c){_0x29f89d=_0xf7c79c;_0x4f02ef=0xc8;}else{_0x4f02ef=0xce;}_0x4b7246[_0x3c31('0x1b')](_0x4f02ef);return _0x4b7246[_0x3c31('0x1f')](_0x3c31('0x20'),_0x7db098+'-'+_0x29f89d+'/'+_0xf7c79c)['json'](_0x3c5080);}return null;};}function patchUpdates(_0x2bbbae){return function(_0x424575){try{jsonpatch[_0x3c31('0x21')](_0x424575,_0x2bbbae,!![]);}catch(_0x523dae){return BPromise[_0x3c31('0x22')](_0x523dae);}return _0x424575[_0x3c31('0x23')]();};}function saveUpdates(_0x2134fb,_0x16ae24){return function(_0x27e38f){if(_0x27e38f){return _0x27e38f[_0x3c31('0x24')](_0x2134fb)[_0x3c31('0x25')](function(_0x5004df){return _0x5004df;});}return null;};}function removeEntity(_0x18b613,_0x18280e){return function(_0x5173a1){if(_0x5173a1){return _0x5173a1[_0x3c31('0x26')]()[_0x3c31('0x25')](function(){_0x18b613['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b5054,_0x3cf943){return function(_0x416d21){if(!_0x416d21){_0x2b5054[_0x3c31('0x27')](0x194);}return _0x416d21;};}function handleError(_0x3a4044,_0x4c631b){_0x4c631b=_0x4c631b||0x1f4;return function(_0x4f46e3){logger[_0x3c31('0x28')](_0x4f46e3[_0x3c31('0x29')]);if(_0x4f46e3[_0x3c31('0x2a')]){delete _0x4f46e3[_0x3c31('0x2a')];}_0x3a4044[_0x3c31('0x1b')](_0x4c631b)[_0x3c31('0x2b')](_0x4f46e3);};}exports['index']=function(_0x3744b5,_0x4e025a){var _0x4404fa={},_0x4e122d={},_0x404f34={'count':0x0,'rows':[]};var _0x130211=_[_0x3c31('0x2c')](db[_0x3c31('0x2d')][_0x3c31('0x2e')],function(_0x4818b0){return{'name':_0x4818b0[_0x3c31('0x2f')],'type':_0x4818b0[_0x3c31('0x30')]['key']};});_0x4e122d[_0x3c31('0x31')]=_['map'](_0x130211,_0x3c31('0x2a'));_0x4e122d[_0x3c31('0x32')]=_['keys'](_0x3744b5[_0x3c31('0x32')]);_0x4e122d[_0x3c31('0x33')]=_[_0x3c31('0x34')](_0x4e122d[_0x3c31('0x31')],_0x4e122d[_0x3c31('0x32')]);_0x4404fa[_0x3c31('0x35')]=_[_0x3c31('0x34')](_0x4e122d['model'],qs['fields'](_0x3744b5[_0x3c31('0x32')][_0x3c31('0x36')]));_0x4404fa['attributes']=_0x4404fa[_0x3c31('0x35')]['length']?_0x4404fa['attributes']:_0x4e122d[_0x3c31('0x31')];if(!_0x3744b5[_0x3c31('0x32')][_0x3c31('0x37')](_0x3c31('0x38'))){_0x4404fa['limit']=qs[_0x3c31('0x1e')](_0x3744b5[_0x3c31('0x32')][_0x3c31('0x1e')]);_0x4404fa[_0x3c31('0x1d')]=qs[_0x3c31('0x1d')](_0x3744b5[_0x3c31('0x32')][_0x3c31('0x1d')]);}_0x4404fa[_0x3c31('0x39')]=qs[_0x3c31('0x3a')](_0x3744b5[_0x3c31('0x32')][_0x3c31('0x3a')]);_0x4404fa[_0x3c31('0x3b')]=qs['filters'](_['pick'](_0x3744b5[_0x3c31('0x32')],_0x4e122d[_0x3c31('0x33')]),_0x130211);if(_0x3744b5[_0x3c31('0x32')][_0x3c31('0x3c')]){_0x4404fa[_0x3c31('0x3b')]=_[_0x3c31('0x3d')](_0x4404fa[_0x3c31('0x3b')],{'$or':_[_0x3c31('0x2c')](_0x130211,function(_0x2e0564){if(_0x2e0564[_0x3c31('0x30')]!==_0x3c31('0x3e')){var _0x1dbb21={};_0x1dbb21[_0x2e0564[_0x3c31('0x2a')]]={'$like':'%'+_0x3744b5[_0x3c31('0x32')][_0x3c31('0x3c')]+'%'};return _0x1dbb21;}})});}_0x4404fa=_[_0x3c31('0x3d')]({},_0x4404fa,_0x3744b5[_0x3c31('0x3f')]);var _0x22e9f4={'where':_0x4404fa[_0x3c31('0x3b')]};return db[_0x3c31('0x2d')][_0x3c31('0x1c')](_0x22e9f4)[_0x3c31('0x25')](function(_0x5b5816){_0x404f34[_0x3c31('0x1c')]=_0x5b5816;if(_0x3744b5[_0x3c31('0x32')][_0x3c31('0x40')]){_0x4404fa[_0x3c31('0x41')]=[{'all':!![]}];}return db[_0x3c31('0x2d')][_0x3c31('0x42')](_0x4404fa);})[_0x3c31('0x25')](function(_0x25b611){_0x404f34[_0x3c31('0x43')]=_0x25b611;return _0x404f34;})[_0x3c31('0x25')](respondWithFilteredResult(_0x4e025a,_0x4404fa))[_0x3c31('0x44')](handleError(_0x4e025a,null));};exports[_0x3c31('0x45')]=function(_0x293953,_0x142733){var _0x486f41={'raw':!![],'where':{'id':_0x293953[_0x3c31('0x46')]['id']}},_0x31ac82={};_0x31ac82['model']=_[_0x3c31('0x47')](db[_0x3c31('0x2d')][_0x3c31('0x2e')]);_0x31ac82['query']=_[_0x3c31('0x47')](_0x293953[_0x3c31('0x32')]);_0x31ac82[_0x3c31('0x33')]=_[_0x3c31('0x34')](_0x31ac82[_0x3c31('0x31')],_0x31ac82[_0x3c31('0x32')]);_0x486f41['attributes']=_[_0x3c31('0x34')](_0x31ac82[_0x3c31('0x31')],qs[_0x3c31('0x36')](_0x293953[_0x3c31('0x32')]['fields']));_0x486f41['attributes']=_0x486f41[_0x3c31('0x35')][_0x3c31('0x48')]?_0x486f41[_0x3c31('0x35')]:_0x31ac82[_0x3c31('0x31')];if(_0x293953['query'][_0x3c31('0x40')]){_0x486f41['include']=[{'all':!![]}];}_0x486f41=_[_0x3c31('0x3d')]({},_0x486f41,_0x293953[_0x3c31('0x3f')]);return db['DeskField'][_0x3c31('0x49')](_0x486f41)['then'](handleEntityNotFound(_0x142733,null))[_0x3c31('0x25')](respondWithResult(_0x142733,null))[_0x3c31('0x44')](handleError(_0x142733,null));};exports['create']=function(_0x447a4b,_0x2f5084){return db['DeskField']['create'](_0x447a4b['body'],{})[_0x3c31('0x25')](respondWithResult(_0x2f5084,0xc9))[_0x3c31('0x44')](handleError(_0x2f5084,null));};exports[_0x3c31('0x24')]=function(_0x1b9e46,_0x41e7cd){if(_0x1b9e46['body']['id']){delete _0x1b9e46['body']['id'];}return db[_0x3c31('0x2d')][_0x3c31('0x49')]({'where':{'id':_0x1b9e46[_0x3c31('0x46')]['id']}})[_0x3c31('0x25')](handleEntityNotFound(_0x41e7cd,null))[_0x3c31('0x25')](saveUpdates(_0x1b9e46[_0x3c31('0x4a')],null))[_0x3c31('0x25')](respondWithResult(_0x41e7cd,null))[_0x3c31('0x44')](handleError(_0x41e7cd,null));};exports[_0x3c31('0x26')]=function(_0x3ee4ff,_0x37ba6e){return db[_0x3c31('0x2d')][_0x3c31('0x49')]({'where':{'id':_0x3ee4ff[_0x3c31('0x46')]['id']}})[_0x3c31('0x25')](handleEntityNotFound(_0x37ba6e,null))[_0x3c31('0x25')](removeEntity(_0x37ba6e,null))[_0x3c31('0x44')](handleError(_0x37ba6e,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 0a9b788..b50ae08 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 _0x9809=['api','moment','bluebird','path','../../config/environment','./intDeskField.attributes','exports','define','int_desk_fields','idField','FieldId','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x9809,0x137));var _0x9980=function(_0x25ed3b,_0xe5f003){_0x25ed3b=_0x25ed3b-0x0;var _0x2faccb=_0x9809[_0x25ed3b];return _0x2faccb;};'use strict';var _=require('lodash');var util=require(_0x9980('0x0'));var logger=require('../../config/logger')(_0x9980('0x1'));var moment=require(_0x9980('0x2'));var BPromise=require(_0x9980('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9980('0x4'));var rimraf=require('rimraf');var config=require(_0x9980('0x5'));var attributes=require(_0x9980('0x6'));module[_0x9980('0x7')]=function(_0x598e6d,_0x3921b9){return _0x598e6d[_0x9980('0x8')]('DeskField',attributes,{'tableName':_0x9980('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x9980('0xa'),_0x9980('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c20=['path','../../config/environment','exports','define','int_desk_fields','idField','FieldId','lodash','util','../../config/logger','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c20,0x104));var _0x06c2=function(_0xdb50e1,_0x112a80){_0xdb50e1=_0xdb50e1-0x0;var _0x2a50fc=_0x6c20[_0xdb50e1];return _0x2a50fc;};'use strict';var _=require(_0x06c2('0x0'));var util=require(_0x06c2('0x1'));var logger=require(_0x06c2('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x06c2('0x3'));var fs=require('fs');var path=require(_0x06c2('0x4'));var rimraf=require('rimraf');var config=require(_0x06c2('0x5'));var attributes=require('./intDeskField.attributes');module[_0x06c2('0x6')]=function(_0x33d496,_0x3b1ff4){return _0x33d496[_0x06c2('0x7')]('DeskField',attributes,{'tableName':_0x06c2('0x8'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x06c2('0x9'),_0x06c2('0xa')],'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 6d60b84..fc30dfd 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 _0xa0fe=['DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','debug'];(function(_0x994f91,_0x1375fa){var _0xdec0cb=function(_0x2b8349){while(--_0x2b8349){_0x994f91['push'](_0x994f91['shift']());}};_0xdec0cb(++_0x1375fa);}(_0xa0fe,0x198));var _0xea0f=function(_0x437f7a,_0x1bb07d){_0x437f7a=_0x437f7a-0x0;var _0x3fa6d3=_0xa0fe[_0x437f7a];return _0x3fa6d3;};'use strict';var _=require(_0xea0f('0x0'));var util=require('util');var moment=require(_0xea0f('0x1'));var BPromise=require(_0xea0f('0x2'));var rs=require(_0xea0f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea0f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xea0f('0x5'))(_0xea0f('0x6'));var config=require(_0xea0f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xea0f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22e80d,_0x5555fc,_0x1aa30f){return new BPromise(function(_0x39c1f9,_0x510d81){return client[_0xea0f('0x9')](_0x22e80d,_0x1aa30f)['then'](function(_0x364d6e){logger[_0xea0f('0xa')]('DeskField,\x20%s,\x20%s',_0x5555fc,'request\x20sent');logger[_0xea0f('0xb')](_0xea0f('0xc'),_0x5555fc,_0xea0f('0xd'),JSON[_0xea0f('0xe')](_0x364d6e));if(_0x364d6e[_0xea0f('0xf')]){if(_0x364d6e['error'][_0xea0f('0x10')]===0x1f4){logger[_0xea0f('0xf')](_0xea0f('0x11'),_0x5555fc,_0x364d6e[_0xea0f('0xf')][_0xea0f('0x12')]);return _0x510d81(_0x364d6e[_0xea0f('0xf')][_0xea0f('0x12')]);}logger['error'](_0xea0f('0x11'),_0x5555fc,_0x364d6e[_0xea0f('0xf')]['message']);return _0x39c1f9(_0x364d6e[_0xea0f('0xf')][_0xea0f('0x12')]);}else{logger['info'](_0xea0f('0x11'),_0x5555fc,_0xea0f('0xd'));_0x39c1f9(_0x364d6e[_0xea0f('0x13')][_0xea0f('0x12')]);}})[_0xea0f('0x14')](function(_0x541fcc){logger[_0xea0f('0xf')]('DeskField,\x20%s,\x20%s',_0x5555fc,_0x541fcc);_0x510d81(_0x541fcc);});});} \ No newline at end of file +var _0xe07e=['error','code','DeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x912d27,_0x28e0e3){var _0x31b918=function(_0x1882f7){while(--_0x1882f7){_0x912d27['push'](_0x912d27['shift']());}};_0x31b918(++_0x28e0e3);}(_0xe07e,0x96));var _0xee07=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0xe07e[_0x4ba380];return _0x4b111b;};'use strict';var _=require(_0xee07('0x0'));var util=require(_0xee07('0x1'));var moment=require(_0xee07('0x2'));var BPromise=require(_0xee07('0x3'));var rs=require(_0xee07('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee07('0x5'))['db'];var utils=require(_0xee07('0x6'));var logger=require(_0xee07('0x7'))(_0xee07('0x8'));var config=require(_0xee07('0x9'));var jayson=require(_0xee07('0xa'));var client=jayson['client'][_0xee07('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34ca31,_0x3b7193,_0x5c6196){return new BPromise(function(_0x21200d,_0x22750f){return client['request'](_0x34ca31,_0x5c6196)[_0xee07('0xc')](function(_0x4f4453){logger[_0xee07('0xd')]('DeskField,\x20%s,\x20%s',_0x3b7193,_0xee07('0xe'));logger[_0xee07('0xf')](_0xee07('0x10'),_0x3b7193,_0xee07('0xe'),JSON[_0xee07('0x11')](_0x4f4453));if(_0x4f4453[_0xee07('0x12')]){if(_0x4f4453[_0xee07('0x12')][_0xee07('0x13')]===0x1f4){logger[_0xee07('0x12')](_0xee07('0x14'),_0x3b7193,_0x4f4453['error'][_0xee07('0x15')]);return _0x22750f(_0x4f4453[_0xee07('0x12')][_0xee07('0x15')]);}logger[_0xee07('0x12')](_0xee07('0x14'),_0x3b7193,_0x4f4453[_0xee07('0x12')][_0xee07('0x15')]);return _0x21200d(_0x4f4453[_0xee07('0x12')]['message']);}else{logger[_0xee07('0xd')](_0xee07('0x14'),_0x3b7193,_0xee07('0xe'));_0x21200d(_0x4f4453[_0xee07('0x16')][_0xee07('0x15')]);}})[_0xee07('0x17')](function(_0x197a74){logger['error']('DeskField,\x20%s,\x20%s',_0x3b7193,_0x197a74);_0x22750f(_0x197a74);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 3a55f95..de8d7df 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 _0x3315=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','post','addConfiguration','put','update','delete','destroy'];(function(_0x206487,_0x28eec1){var _0x2714c7=function(_0x298179){while(--_0x298179){_0x206487['push'](_0x206487['shift']());}};_0x2714c7(++_0x28eec1);}(_0x3315,0x74));var _0x5331=function(_0x2a2ca5,_0xc58584){_0x2a2ca5=_0x2a2ca5-0x0;var _0x443c69=_0x3315[_0x2a2ca5];return _0x443c69;};'use strict';var multer=require(_0x5331('0x0'));var util=require(_0x5331('0x1'));var path=require(_0x5331('0x2'));var timeout=require(_0x5331('0x3'));var express=require(_0x5331('0x4'));var router=express[_0x5331('0x5')]();var auth=require(_0x5331('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5331('0x7'));var controller=require(_0x5331('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x5331('0x9')]);router[_0x5331('0xa')](_0x5331('0xb'),auth[_0x5331('0xc')](),controller[_0x5331('0xd')]);router[_0x5331('0xa')](_0x5331('0xe'),auth[_0x5331('0xc')](),controller[_0x5331('0xf')]);router[_0x5331('0xa')]('/:id/fields',auth[_0x5331('0xc')](),controller['getFields']);router[_0x5331('0x10')]('/',auth[_0x5331('0xc')](),controller['create']);router['post'](_0x5331('0xe'),auth[_0x5331('0xc')](),controller[_0x5331('0x11')]);router[_0x5331('0x12')](_0x5331('0xb'),auth[_0x5331('0xc')](),controller[_0x5331('0x13')]);router[_0x5331('0x14')](_0x5331('0xb'),auth[_0x5331('0xc')](),controller[_0x5331('0x15')]);module[_0x5331('0x16')]=router; \ No newline at end of file +var _0x41cf=['./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x2b84a4,_0x4af55b){var _0x16a449=function(_0x1d1373){while(--_0x1d1373){_0x2b84a4['push'](_0x2b84a4['shift']());}};_0x16a449(++_0x4af55b);}(_0x41cf,0x143));var _0xf41c=function(_0x397cfb,_0xb8f317){_0x397cfb=_0x397cfb-0x0;var _0x15fed9=_0x41cf[_0x397cfb];return _0x15fed9;};'use strict';var multer=require(_0xf41c('0x0'));var util=require(_0xf41c('0x1'));var path=require('path');var timeout=require(_0xf41c('0x2'));var express=require(_0xf41c('0x3'));var router=express[_0xf41c('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf41c('0x5'));var config=require(_0xf41c('0x6'));var controller=require(_0xf41c('0x7'));router[_0xf41c('0x8')]('/',auth[_0xf41c('0x9')](),controller[_0xf41c('0xa')]);router['get'](_0xf41c('0xb'),auth[_0xf41c('0x9')](),controller[_0xf41c('0xc')]);router[_0xf41c('0x8')](_0xf41c('0xd'),auth[_0xf41c('0x9')](),controller['getConfigurations']);router[_0xf41c('0x8')](_0xf41c('0xe'),auth[_0xf41c('0x9')](),controller['getFields']);router[_0xf41c('0xf')]('/',auth[_0xf41c('0x9')](),controller[_0xf41c('0x10')]);router[_0xf41c('0xf')](_0xf41c('0xd'),auth['isAuthenticated'](),controller[_0xf41c('0x11')]);router[_0xf41c('0x12')](_0xf41c('0xb'),auth[_0xf41c('0x9')](),controller['update']);router[_0xf41c('0x13')](_0xf41c('0xb'),auth[_0xf41c('0x9')](),controller[_0xf41c('0x14')]);module[_0xf41c('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 c6d1955..1257290 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 _0x0557=['STRING','sequelize'];(function(_0x20b9ba,_0x4943aa){var _0xa7bf5c=function(_0x5eb2cd){while(--_0x5eb2cd){_0x20b9ba['push'](_0x20b9ba['shift']());}};_0xa7bf5c(++_0x4943aa);}(_0x0557,0x163));var _0x7055=function(_0x3f7e79,_0x22f07a){_0x3f7e79=_0x3f7e79-0x0;var _0x4a7c04=_0x0557[_0x3f7e79];return _0x4a7c04;};'use strict';var Sequelize=require(_0x7055('0x0'));module['exports']={'name':{'type':Sequelize[_0x7055('0x1')]},'username':{'type':Sequelize[_0x7055('0x1')]},'password':{'type':Sequelize[_0x7055('0x1')]},'remoteUri':{'type':Sequelize[_0x7055('0x1')]},'tenantId':{'type':Sequelize[_0x7055('0x1')]},'clientId':{'type':Sequelize[_0x7055('0x1')]},'clientSecret':{'type':Sequelize[_0x7055('0x1')]},'serverUrl':{'type':Sequelize[_0x7055('0x1')]},'description':{'type':Sequelize[_0x7055('0x1')]}}; \ No newline at end of file +var _0xfba6=['STRING','sequelize','exports'];(function(_0xd0c7c4,_0x421c3d){var _0x230cc4=function(_0x3062c1){while(--_0x3062c1){_0xd0c7c4['push'](_0xd0c7c4['shift']());}};_0x230cc4(++_0x421c3d);}(_0xfba6,0x175));var _0x6fba=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xfba6[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0x6fba('0x0'));module[_0x6fba('0x1')]={'name':{'type':Sequelize[_0x6fba('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6fba('0x2')]},'tenantId':{'type':Sequelize[_0x6fba('0x2')]},'clientId':{'type':Sequelize[_0x6fba('0x2')]},'clientSecret':{'type':Sequelize[_0x6fba('0x2')]},'serverUrl':{'type':Sequelize[_0x6fba('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 751cdf0..f39e73b 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 _0x3581=['jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Dynamics365Account,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','Dynamics365Account','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','count','includeAll','include','show','params','rawAttributes','length','options','find','create','body','getConfigurations','Dynamics365Configuration','findOne','AccountId','getSubjects','channel','getDescriptions','Dynamics365Field','Subjects','getFields','ticketType','incident','PhoneCall','title','description','caseorigincode','subject','phonenumber','directioncode','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','createdbyexternalpartyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','numberofchildincidents','onholdtime','owneridname','primarycontactidname','productserialnumber','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','slaname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','slice','substring','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','DecimalAttributeMetadata','statusCode','send','Wrong\x20credentials','EntityDefinitions(',')/Attributes(','4.0','OptionSet','Options','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','false',')/Microsoft.Dynamics.CRM.','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','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','../../mysqldb','../../components/integrations/configuration'];(function(_0x432ae1,_0x4433c7){var _0x25ee93=function(_0x550105){while(--_0x550105){_0x432ae1['push'](_0x432ae1['shift']());}};_0x25ee93(++_0x4433c7);}(_0x3581,0xb4));var _0x1358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3581[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x1358('0x0'));var emlformat=require(_0x1358('0x1'));var rimraf=require(_0x1358('0x2'));var zipdir=require(_0x1358('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1358('0x4'));var moment=require(_0x1358('0x5'));var BPromise=require(_0x1358('0x6'));var Mustache=require(_0x1358('0x7'));var util=require('util');var path=require(_0x1358('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1358('0x9'));var fs=require('fs');var _=require(_0x1358('0xa'));var squel=require(_0x1358('0xb'));var crypto=require(_0x1358('0xc'));var jsforce=require(_0x1358('0xd'));var deskjs=require(_0x1358('0xe'));var toCsv=require(_0x1358('0xf'));var querystring=require(_0x1358('0x10'));var Papa=require(_0x1358('0x11'));var Redis=require(_0x1358('0x12'));var authService=require(_0x1358('0x13'));var qs=require(_0x1358('0x14'));var as=require(_0x1358('0x15'));var hardwareService=require(_0x1358('0x16'));var logger=require(_0x1358('0x17'))(_0x1358('0x18'));var utils=require(_0x1358('0x19'));var config=require('../../config/environment');var db=require(_0x1358('0x1a'))['db'];var integrations=require(_0x1358('0x1b'));var jayson=require(_0x1358('0x1c'));var client=jayson[_0x1358('0x1d')][_0x1358('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x2d75e5,_0x5af9b4,_0xa6e46c){if(_0xa6e46c){var _0x59fd81=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59fd81[_0x1358('0x1f')](_0x5af9b4)){return _0x2d75e5;}else{throw new db[(_0x1358('0x20'))][(_0x1358('0x21'))](_0x1358('0x22'));}}else{return _0x2d75e5;}}function respondWithRpcPromise(_0x54d64f,_0x35793b,_0x6f2b9f,_0x29837d){return new BPromise(function(_0xb5cfb8,_0x423ef1){var _0x18bf3e=_0x29837d||client;return _0x18bf3e[_0x1358('0x23')](_0x54d64f,_0x6f2b9f)[_0x1358('0x24')](function(_0x5c757f){logger[_0x1358('0x25')]('Dynamics365Account,\x20%s,\x20%s',_0x35793b,_0x1358('0x26'));logger[_0x1358('0x27')](_0x1358('0x28'),_0x35793b,'request\x20sent',JSON[_0x1358('0x29')](_0x5c757f));if(_0x5c757f[_0x1358('0x2a')]){if(_0x5c757f[_0x1358('0x2a')][_0x1358('0x2b')]===0x1f4){logger[_0x1358('0x2a')]('Dynamics365Account,\x20%s,\x20%s',_0x35793b,_0x5c757f['error'][_0x1358('0x2c')]);return _0x423ef1(_0x5c757f[_0x1358('0x2a')][_0x1358('0x2c')]);}logger[_0x1358('0x2a')](_0x1358('0x2d'),_0x35793b,_0x5c757f[_0x1358('0x2a')][_0x1358('0x2c')]);return _0xb5cfb8(_0x5c757f[_0x1358('0x2a')][_0x1358('0x2c')]);}else{logger[_0x1358('0x25')](_0x1358('0x2d'),_0x35793b,'request\x20sent');_0xb5cfb8(_0x5c757f[_0x1358('0x2e')][_0x1358('0x2c')]);}})[_0x1358('0x2f')](function(_0x472297){logger[_0x1358('0x2a')]('Dynamics365Account,\x20%s,\x20%s',_0x35793b,_0x472297);_0x423ef1(_0x472297);});});}function respondWithStatusCode(_0x60b6ec,_0x392793){_0x392793=_0x392793||0xcc;return function(_0x9103c7){if(_0x9103c7){return _0x60b6ec[_0x1358('0x30')](_0x392793);}return _0x60b6ec[_0x1358('0x31')](_0x392793)['end']();};}function respondWithResult(_0x5e8dc3,_0x5e8191){_0x5e8191=_0x5e8191||0xc8;return function(_0x287782){if(_0x287782){return _0x5e8dc3[_0x1358('0x31')](_0x5e8191)[_0x1358('0x32')](_0x287782);}};}function respondWithFilteredResult(_0x485472,_0x20e9ba){return function(_0x352aac){if(_0x352aac){var _0x27c4cc=_0x352aac['count'],_0x3799a6=_0x20e9ba[_0x1358('0x33')],_0x30e856=_0x20e9ba[_0x1358('0x33')]+_0x20e9ba[_0x1358('0x34')],_0xd7a6ca;if(_0x30e856>=_0x27c4cc){_0x30e856=_0x27c4cc;_0xd7a6ca=0xc8;}else{_0xd7a6ca=0xce;}_0x485472['status'](_0xd7a6ca);return _0x485472[_0x1358('0x35')](_0x1358('0x36'),_0x3799a6+'-'+_0x30e856+'/'+_0x27c4cc)['json'](_0x352aac);}return null;};}function patchUpdates(_0x2c154b){return function(_0x6bd5d5){try{jsonpatch['apply'](_0x6bd5d5,_0x2c154b,!![]);}catch(_0x11caa3){return BPromise[_0x1358('0x37')](_0x11caa3);}return _0x6bd5d5[_0x1358('0x38')]();};}function saveUpdates(_0x47fcfe,_0x4484a0){return function(_0x2f3288){if(_0x2f3288){return _0x2f3288[_0x1358('0x39')](_0x47fcfe)[_0x1358('0x24')](function(_0x3eee56){return _0x3eee56;});}return null;};}function removeEntity(_0x4ed164,_0x1588b1){return function(_0x4c046b){if(_0x4c046b){return _0x4c046b[_0x1358('0x3a')]()[_0x1358('0x24')](function(){_0x4ed164[_0x1358('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a782b,_0x58cf02){return function(_0x964b80){if(!_0x964b80){_0x2a782b[_0x1358('0x30')](0x194);}return _0x964b80;};}function handleError(_0x47dff9,_0x53ef72){_0x53ef72=_0x53ef72||0x1f4;return function(_0x3fc422){logger['error'](_0x3fc422[_0x1358('0x3b')]);if(_0x3fc422[_0x1358('0x3c')]){delete _0x3fc422[_0x1358('0x3c')];}_0x47dff9['status'](_0x53ef72)['send'](_0x3fc422);};}exports['index']=function(_0x3c7372,_0x501f4f){var _0x1ea25e={},_0x24f8eb={},_0x2a39e2={'count':0x0,'rows':[]};var _0xea1aca=_['map'](db[_0x1358('0x3d')]['rawAttributes'],function(_0xd4e3f2){return{'name':_0xd4e3f2[_0x1358('0x3e')],'type':_0xd4e3f2[_0x1358('0x3f')][_0x1358('0x40')]};});_0x24f8eb[_0x1358('0x41')]=_[_0x1358('0x42')](_0xea1aca,'name');_0x24f8eb[_0x1358('0x43')]=_[_0x1358('0x44')](_0x3c7372['query']);_0x24f8eb['filters']=_[_0x1358('0x45')](_0x24f8eb['model'],_0x24f8eb[_0x1358('0x43')]);_0x1ea25e[_0x1358('0x46')]=_[_0x1358('0x45')](_0x24f8eb[_0x1358('0x41')],qs[_0x1358('0x47')](_0x3c7372[_0x1358('0x43')][_0x1358('0x47')]));_0x1ea25e[_0x1358('0x46')]=_0x1ea25e[_0x1358('0x46')]['length']?_0x1ea25e['attributes']:_0x24f8eb[_0x1358('0x41')];if(!_0x3c7372[_0x1358('0x43')][_0x1358('0x48')](_0x1358('0x49'))){_0x1ea25e['limit']=qs[_0x1358('0x34')](_0x3c7372['query'][_0x1358('0x34')]);_0x1ea25e[_0x1358('0x33')]=qs['offset'](_0x3c7372[_0x1358('0x43')][_0x1358('0x33')]);}_0x1ea25e[_0x1358('0x4a')]=qs['sort'](_0x3c7372['query'][_0x1358('0x4b')]);_0x1ea25e['where']=qs[_0x1358('0x4c')](_[_0x1358('0x4d')](_0x3c7372['query'],_0x24f8eb[_0x1358('0x4c')]),_0xea1aca);if(_0x3c7372['query'][_0x1358('0x4e')]){_0x1ea25e[_0x1358('0x4f')]=_[_0x1358('0x50')](_0x1ea25e[_0x1358('0x4f')],{'$or':_[_0x1358('0x42')](_0xea1aca,function(_0x448246){if(_0x448246[_0x1358('0x3f')]!==_0x1358('0x51')){var _0x2c0561={};_0x2c0561[_0x448246[_0x1358('0x3c')]]={'$like':'%'+_0x3c7372['query'][_0x1358('0x4e')]+'%'};return _0x2c0561;}})});}_0x1ea25e=_[_0x1358('0x50')]({},_0x1ea25e,_0x3c7372['options']);var _0x33b997={'where':_0x1ea25e[_0x1358('0x4f')]};return db[_0x1358('0x3d')]['count'](_0x33b997)[_0x1358('0x24')](function(_0x5dfe68){_0x2a39e2[_0x1358('0x52')]=_0x5dfe68;if(_0x3c7372[_0x1358('0x43')][_0x1358('0x53')]){_0x1ea25e[_0x1358('0x54')]=[{'all':!![]}];}return db[_0x1358('0x3d')]['findAll'](_0x1ea25e);})[_0x1358('0x24')](function(_0x35c617){_0x2a39e2['rows']=_0x35c617;return _0x2a39e2;})[_0x1358('0x24')](respondWithFilteredResult(_0x501f4f,_0x1ea25e))['catch'](handleError(_0x501f4f,null));};exports[_0x1358('0x55')]=function(_0x86803b,_0x5f02cf){var _0x2341b7={'raw':![],'where':{'id':_0x86803b[_0x1358('0x56')]['id']}},_0x5c1414={};_0x5c1414['model']=_[_0x1358('0x44')](db['Dynamics365Account'][_0x1358('0x57')]);_0x5c1414[_0x1358('0x43')]=_[_0x1358('0x44')](_0x86803b[_0x1358('0x43')]);_0x5c1414[_0x1358('0x4c')]=_['intersection'](_0x5c1414[_0x1358('0x41')],_0x5c1414[_0x1358('0x43')]);_0x2341b7[_0x1358('0x46')]=_[_0x1358('0x45')](_0x5c1414['model'],qs[_0x1358('0x47')](_0x86803b[_0x1358('0x43')][_0x1358('0x47')]));_0x2341b7[_0x1358('0x46')]=_0x2341b7[_0x1358('0x46')][_0x1358('0x58')]?_0x2341b7[_0x1358('0x46')]:_0x5c1414[_0x1358('0x41')];if(_0x86803b[_0x1358('0x43')][_0x1358('0x53')]){_0x2341b7[_0x1358('0x54')]=[{'all':!![]}];}_0x2341b7=_[_0x1358('0x50')]({},_0x2341b7,_0x86803b[_0x1358('0x59')]);return db['Dynamics365Account'][_0x1358('0x5a')](_0x2341b7)[_0x1358('0x24')](handleEntityNotFound(_0x5f02cf,null))[_0x1358('0x24')](respondWithResult(_0x5f02cf,null))[_0x1358('0x2f')](handleError(_0x5f02cf,null));};exports[_0x1358('0x5b')]=function(_0x52da77,_0x5a84de){return db[_0x1358('0x3d')][_0x1358('0x5b')](_0x52da77['body'],{})[_0x1358('0x24')](respondWithResult(_0x5a84de,0xc9))[_0x1358('0x2f')](handleError(_0x5a84de,null));};exports['update']=function(_0x18764a,_0x46a4da){if(_0x18764a[_0x1358('0x5c')]['id']){delete _0x18764a[_0x1358('0x5c')]['id'];}return db[_0x1358('0x3d')][_0x1358('0x5a')]({'where':{'id':_0x18764a[_0x1358('0x56')]['id']}})[_0x1358('0x24')](handleEntityNotFound(_0x46a4da,null))['then'](saveUpdates(_0x18764a[_0x1358('0x5c')],null))[_0x1358('0x24')](respondWithResult(_0x46a4da,null))[_0x1358('0x2f')](handleError(_0x46a4da,null));};exports[_0x1358('0x3a')]=function(_0x179ac8,_0x42c098){return db[_0x1358('0x3d')]['find']({'where':{'id':_0x179ac8[_0x1358('0x56')]['id']}})['then'](handleEntityNotFound(_0x42c098,null))[_0x1358('0x24')](removeEntity(_0x42c098,null))[_0x1358('0x2f')](handleError(_0x42c098,null));};exports[_0x1358('0x5d')]=function(_0xd7ad44,_0x10f441,_0x17dc9d){var _0x2448c0={};var _0x20ea9f={};var _0x253b5f;var _0xf23460;return db[_0x1358('0x3d')]['findOne']({'where':{'id':_0xd7ad44[_0x1358('0x56')]['id']}})[_0x1358('0x24')](handleEntityNotFound(_0x10f441,null))['then'](function(_0xb3a21d){if(_0xb3a21d){_0x253b5f=_0xb3a21d;_0x20ea9f['model']=_['keys'](db[_0x1358('0x5e')]['rawAttributes']);_0x20ea9f[_0x1358('0x43')]=_[_0x1358('0x44')](_0xd7ad44[_0x1358('0x43')]);_0x20ea9f[_0x1358('0x4c')]=_[_0x1358('0x45')](_0x20ea9f['model'],_0x20ea9f[_0x1358('0x43')]);_0x2448c0[_0x1358('0x46')]=_[_0x1358('0x45')](_0x20ea9f[_0x1358('0x41')],qs[_0x1358('0x47')](_0xd7ad44[_0x1358('0x43')][_0x1358('0x47')]));_0x2448c0['attributes']=_0x2448c0[_0x1358('0x46')][_0x1358('0x58')]?_0x2448c0[_0x1358('0x46')]:_0x20ea9f[_0x1358('0x41')];_0x2448c0['order']=qs[_0x1358('0x4b')](_0xd7ad44[_0x1358('0x43')]['sort']);_0x2448c0['where']=qs[_0x1358('0x4c')](_[_0x1358('0x4d')](_0xd7ad44[_0x1358('0x43')],_0x20ea9f[_0x1358('0x4c')]));if(_0xd7ad44[_0x1358('0x43')][_0x1358('0x4e')]){_0x2448c0[_0x1358('0x4f')]=_['merge'](_0x2448c0[_0x1358('0x4f')],{'$or':_['map'](_0x2448c0[_0x1358('0x46')],function(_0x97756c){var _0x240642={};_0x240642[_0x97756c]={'$like':'%'+_0xd7ad44[_0x1358('0x43')][_0x1358('0x4e')]+'%'};return _0x240642;})});}_0x2448c0=_['merge']({},_0x2448c0,_0xd7ad44[_0x1358('0x59')]);return _0x253b5f['getConfigurations'](_0x2448c0);}})[_0x1358('0x24')](function(_0x462465){if(_0x462465){_0xf23460=_0x462465[_0x1358('0x58')];if(!_0xd7ad44[_0x1358('0x43')][_0x1358('0x48')](_0x1358('0x49'))){_0x2448c0[_0x1358('0x34')]=qs[_0x1358('0x34')](_0xd7ad44[_0x1358('0x43')][_0x1358('0x34')]);_0x2448c0[_0x1358('0x33')]=qs['offset'](_0xd7ad44[_0x1358('0x43')][_0x1358('0x33')]);}return _0x253b5f[_0x1358('0x5d')](_0x2448c0);}})[_0x1358('0x24')](function(_0x3ca4d8){if(_0x3ca4d8){return _0x3ca4d8?{'count':_0xf23460,'rows':_0x3ca4d8}:null;}})['then'](respondWithResult(_0x10f441,null))[_0x1358('0x2f')](handleError(_0x10f441,null));};exports['addConfiguration']=function(_0x43ad40,_0x55dce9,_0x19e07f){if(_0x43ad40[_0x1358('0x5c')]['id']){delete _0x43ad40[_0x1358('0x5c')]['id'];}return db[_0x1358('0x3d')][_0x1358('0x5f')]({'where':{'id':_0x43ad40[_0x1358('0x56')]['id']}})[_0x1358('0x24')](handleEntityNotFound(_0x55dce9,null))[_0x1358('0x24')](function(_0x4bfe20){if(_0x4bfe20){_0x43ad40['body'][_0x1358('0x60')]=_0x4bfe20['id'];_0x43ad40[_0x1358('0x5c')]['Subjects']=integrations[_0x1358('0x61')](_0x43ad40[_0x1358('0x5c')][_0x1358('0x62')],_0x43ad40[_0x1358('0x5c')][_0x1358('0x3f')]);_0x43ad40[_0x1358('0x5c')]['Descriptions']=integrations[_0x1358('0x63')](_0x43ad40[_0x1358('0x5c')][_0x1358('0x62')],_0x43ad40[_0x1358('0x5c')][_0x1358('0x3f')]);return db[_0x1358('0x5e')]['create'](_0x43ad40[_0x1358('0x5c')],{'include':[{'model':db[_0x1358('0x64')],'as':_0x1358('0x65')},{'model':db[_0x1358('0x64')],'as':'Descriptions'}]});}return null;})[_0x1358('0x24')](respondWithResult(_0x55dce9,null))['catch'](handleError(_0x55dce9,null));};exports[_0x1358('0x66')]=function(_0x56d76b,_0x193070,_0x53477e){var _0x1d7764=_0x56d76b[_0x1358('0x43')][_0x1358('0x67')];var _0x3f269c=_0x1d7764===_0x1358('0x68')?'Incident':_0x1358('0x69');var _0x29a227='';var _0xa2af5e='';var _0x19e88e='';var _0x386d28='';var _0x2fc563='';var _0x490ead='';var _0x5c67b9='';var _0x4476fa='';var _0x373ef0=[_0x1358('0x6a'),_0x1358('0x6b'),'customerid','ownerid',_0x1358('0x6c'),_0x1358('0x6d'),_0x1358('0x6e'),'regardingobjectid',_0x1358('0x6f'),'phonecall_activity_parties'];var _0x3cb8f6=[_0x1358('0x70'),_0x1358('0x71'),_0x1358('0x72'),'billedserviceunits',_0x1358('0x73'),_0x1358('0x74'),'contractdetailidname','contractidname','createdbyexternalpartyname',_0x1358('0x75'),'createdbyname','createdbyyominame',_0x1358('0x76'),_0x1358('0x77'),_0x1358('0x78'),_0x1358('0x79'),_0x1358('0x7a'),_0x1358('0x7b'),_0x1358('0x7c'),_0x1358('0x7d'),_0x1358('0x7e'),_0x1358('0x7f'),_0x1358('0x80'),_0x1358('0x81'),'firstresponsebykpiidname','followupby','importsequencenumber','influencescore',_0x1358('0x82'),_0x1358('0x83'),_0x1358('0x84'),_0x1358('0x85'),_0x1358('0x86'),_0x1358('0x87'),_0x1358('0x88'),_0x1358('0x89'),_0x1358('0x8a'),'modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname',_0x1358('0x8b'),_0x1358('0x8c'),'overriddencreatedon',_0x1358('0x8d'),'owneridtype','owneridyominame','parentcaseidname',_0x1358('0x8e'),'primarycontactidyominame','prioritycodename','productidname',_0x1358('0x8f'),'resolveby',_0x1358('0x90'),'responseby',_0x1358('0x91'),_0x1358('0x92'),'sentimentvalue','slainvokedidname',_0x1358('0x93'),_0x1358('0x94'),_0x1358('0x95'),_0x1358('0x96'),'subjectidname','ticketnumber',_0x1358('0x97'),_0x1358('0x98'),_0x1358('0x99'),'utcconversiontimezonecode',_0x1358('0x9a')];var _0x494db2=_0x373ef0[_0x1358('0x9b')](_0x3cb8f6);return db[_0x1358('0x3d')][_0x1358('0x5f')]({'where':{'id':_0x56d76b[_0x1358('0x56')]['id']},'attributes':['id',_0x1358('0x9c'),_0x1358('0x9d'),_0x1358('0x9e'),'tenantId',_0x1358('0x9f'),_0x1358('0xa0')]})[_0x1358('0x24')](handleEntityNotFound(_0x193070,null))[_0x1358('0x24')](function(_0x267d95){if(_0x267d95){_0x4476fa=_0x267d95[_0x1358('0x9e')];var _0x2ec1b0=_0x4476fa[_0x1358('0xa1')](-0x1);if(_0x2ec1b0==='/'){_0x4476fa=_0x4476fa[_0x1358('0xa2')](0x0,_0x4476fa['lastIndexOf'](_0x2ec1b0));}_0x5c67b9=util['format'](_0x1358('0xa3'),_0x4476fa);var _0x1544ad={'method':_0x1358('0xa4'),'uri':_0x1358('0xa5')+_0x267d95[_0x1358('0xa6')]+_0x1358('0xa7'),'form':{'client_id':_0x267d95[_0x1358('0x9f')],'resource':_0x4476fa,'username':_0x267d95['username'],'password':_0x267d95[_0x1358('0x9d')],'grant_type':_0x1358('0x9d'),'client_secret':_0x267d95[_0x1358('0xa0')]},'json':!![]};return rp(_0x1544ad);}})[_0x1358('0x24')](function(_0x5dccdb){_0x490ead=_0x5dccdb['access_token'];var _0x5495a4={'method':_0x1358('0xa8'),'uri':encodeURI(_0x5c67b9+_0x1358('0xa9')+_0x3f269c+'\x27'),'headers':{'Authorization':_0x1358('0xaa')+_0x490ead,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5495a4);})['then'](function(_0x240e78){var _0x5e8c80=_0x240e78[_0x1358('0xab')][0x0];var _0x1789f9=_0x5e8c80[_0x1358('0xac')];var _0xa39cb={'method':_0x1358('0xa8'),'uri':_0x5c67b9+'EntityDefinitions('+_0x1789f9+_0x1358('0xad'),'headers':{'Authorization':_0x1358('0xaa')+_0x490ead,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xa39cb);})['then'](function(_0x20cad6){_0x29a227=_0x20cad6;_0xa2af5e=_0x29a227[_0x1358('0xae')];_0xa2af5e=_[_0x1358('0xaf')](_0xa2af5e,function(_0x566894){return!_0x494db2[_0x1358('0xb0')](_0x566894[_0x1358('0xb1')]);});var _0x2bd4b8=[];var _0x1e8c53=[];_0xa2af5e[_0x1358('0xb2')](function(_0x436504){if(_0x436504['@odata.type']){var _0x2e3f64=_0x436504[_0x1358('0xb3')][_0x1358('0xa2')](_0x436504['@odata.type'][_0x1358('0xb4')]('.')+0x1);if(_0x2e3f64===_0x1358('0xb5')){_0x2bd4b8['push'](getSelectList(_0x5c67b9,_0x1d7764,_0x1e8c53,_0x29a227[_0x1358('0xac')],_0x436504[_0x1358('0xac')],_0x490ead));}}});return Promise[_0x1358('0xb6')](_0x2bd4b8);})[_0x1358('0x24')](function(_0x2190ae){_0x19e88e=_0x2190ae[0x0];var _0x85c7f6=[];var _0xda6aa3=[];_0xa2af5e[_0x1358('0xb2')](function(_0x244f86){if(!_[_0x1358('0xb7')](_0x244f86[_0x1358('0xb3')])){var _0xfd4422=_0x244f86[_0x1358('0xb3')]['substring'](_0x244f86['@odata.type'][_0x1358('0xb4')]('.')+0x1);if(_0xfd4422===_0x1358('0xb8')){_0x85c7f6[_0x1358('0xb9')](getBooleanList(_0x5c67b9,_0x1d7764,_0xda6aa3,_0x29a227[_0x1358('0xac')],_0x244f86[_0x1358('0xac')],_0x490ead));}}});return Promise[_0x1358('0xb6')](_0x85c7f6);})['then'](function(_0x238a39){_0x386d28=_0x238a39[0x0];var _0x31acf5=[];var _0x22c164=[];_0xa2af5e['forEach'](function(_0x521986){if(_0x521986[_0x1358('0xb3')]){var _0x5404c0=_0x521986['@odata.type']['substring'](_0x521986['@odata.type'][_0x1358('0xb4')]('.')+0x1);if(_0x5404c0===_0x1358('0xba')||_0x5404c0==='DoubleAttributeMetadata'||_0x5404c0===_0x1358('0xbb')||_0x5404c0===_0x1358('0xbc')||_0x5404c0===_0x1358('0xbd')||_0x5404c0==='DateTimeAttributeMetadata'||_0x5404c0===_0x1358('0xbe')||_0x5404c0==='EntityNameAttributeMetadata'||_0x5404c0==='StateAttributeMetadata'||_0x5404c0===_0x1358('0xbf')){_0x31acf5[_0x1358('0xb9')](getInputList(_0x5c67b9,_0x1d7764,_0x5404c0,_0x22c164,_0x29a227[_0x1358('0xac')],_0x521986[_0x1358('0xac')],_0x490ead));}}});return Promise[_0x1358('0xb6')](_0x31acf5);})['then'](function(_0x4020c5){_0x2fc563=_0x4020c5[0x0];var _0x4b9a55=_0x19e88e['concat'](_0x386d28)[_0x1358('0x9b')](_0x2fc563);var _0x19a51a={'count':_0x4b9a55[_0x1358('0x58')],'rows':_0x4b9a55};return _0x19a51a;})[_0x1358('0x24')](respondWithResult(_0x193070,null))[_0x1358('0x2f')](function(_0x32c600){var _0x58c815=_0x56d76b[_0x1358('0x43')][_0x1358('0x1f')]?0x1f4:_0x32c600[_0x1358('0xc0')]||0x1f4;logger[_0x1358('0x2a')](_0x32c600['stack']);delete _0x32c600['name'];if(_0x58c815===0x191){_0x58c815=0x190;}_0x193070[_0x1358('0x31')](_0x58c815)[_0x1358('0xc1')](_0x56d76b[_0x1358('0x43')]['test']?{'message':_0x1358('0xc2'),'statusCode':_0x32c600['statusCode']}:_0x32c600);});};function getSelectList(_0x552ee1,_0x217830,_0x5aae4f,_0x2026d6,_0x1b7434,_0x690a5b){var _0x3442c0={'method':_0x1358('0xa8'),'uri':_0x552ee1+_0x1358('0xc3')+_0x2026d6+_0x1358('0xc4')+_0x1b7434+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x1358('0xaa')+_0x690a5b,'If-None-Match':null,'OData-Version':_0x1358('0xc5')},'json':!![]};return rp(_0x3442c0)[_0x1358('0x24')](function(_0x6df5f0){var _0x57ac30=[];var _0x19d940=_0x6df5f0[_0x1358('0xc6')][_0x1358('0xc7')];_0x19d940['forEach'](function(_0x5281e9){_0x57ac30[_0x1358('0xb9')]({'name':_0x5281e9['Label'][_0x1358('0xc8')][_0x1358('0xc9')],'value':String(_0x5281e9[_0x1358('0xca')])});});var _0x45abde={'id':_0x217830+'_'+_0x6df5f0['LogicalName'],'name':_0x6df5f0[_0x1358('0xcb')][_0x1358('0xc8')][_0x1358('0xc9')],'custom':![],'options':_0x57ac30};_0x5aae4f[_0x1358('0xb9')](_0x45abde);return _0x5aae4f;});}function getBooleanList(_0x4cacc1,_0x429ac8,_0x464de9,_0xb434dd,_0x228b4d,_0x5d9870){var _0x3887be={'method':'GET','uri':_0x4cacc1+_0x1358('0xc3')+_0xb434dd+_0x1358('0xc4')+_0x228b4d+_0x1358('0xcc'),'headers':{'Authorization':_0x1358('0xaa')+_0x5d9870,'If-None-Match':null,'OData-Version':_0x1358('0xc5')},'json':!![]};return rp(_0x3887be)[_0x1358('0x24')](function(_0x23ed43){var _0x4c4c45=[];_0x4c4c45[_0x1358('0xb9')]({'name':_0x23ed43[_0x1358('0xc6')]['TrueOption'][_0x1358('0xc9')][_0x1358('0xc8')][_0x1358('0xc9')],'value':_0x1358('0xcd')},{'name':_0x23ed43[_0x1358('0xc6')]['FalseOption'][_0x1358('0xc9')][_0x1358('0xc8')]['Label'],'value':_0x1358('0xce')});var _0x3342f1={'id':_0x429ac8+'_'+_0x23ed43[_0x1358('0xb1')],'name':_0x23ed43[_0x1358('0xcb')]['UserLocalizedLabel'][_0x1358('0xc9')],'custom':![],'options':_0x4c4c45};_0x464de9['push'](_0x3342f1);return _0x464de9;});}function getInputList(_0x24cbbb,_0x4e7416,_0x225c5d,_0x281a85,_0x2bc2c4,_0x5a8a55,_0x5010c8){var _0x1d4ede={'method':_0x1358('0xa8'),'uri':_0x24cbbb+'EntityDefinitions('+_0x2bc2c4+_0x1358('0xc4')+_0x5a8a55+_0x1358('0xcf')+_0x225c5d+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x5010c8,'If-None-Match':null,'OData-Version':_0x1358('0xc5')},'json':!![]};return rp(_0x1d4ede)[_0x1358('0x24')](function(_0x221b46){var _0x27e06b={'id':_0x4e7416+'_'+_0x221b46['LogicalName'],'name':_0x221b46[_0x1358('0xcb')][_0x1358('0xc8')]?_0x221b46[_0x1358('0xcb')]['UserLocalizedLabel'][_0x1358('0xc9')]:_0x221b46[_0x1358('0xb1')],'custom':![],'options':[]};_0x281a85[_0x1358('0xb9')](_0x27e06b);return _0x281a85;});} \ No newline at end of file +var _0x492e=['productidname','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientId','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','/oauth2/token','clientSecret','access_token','GET','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','includes','forEach','@odata.type','PicklistAttributeMetadata','MetadataId','isNil','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','push','concat','send','Wrong\x20credentials','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Value','LogicalName','DisplayName','Label',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','request','then','info','request\x20sent','debug','stringify','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','end','status','json','count','offset','limit','set','Content-Range','reject','save','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','include','Dynamics365Account','params','keys','options','find','create','body','update','order','filter','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Dynamics365Configuration','Dynamics365Field','Descriptions','ticketType','incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidyominame','actualserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename'];(function(_0x37b327,_0x47b877){var _0x184e2f=function(_0x5d692d){while(--_0x5d692d){_0x37b327['push'](_0x37b327['shift']());}};_0x184e2f(++_0x47b877);}(_0x492e,0x127));var _0xe492=function(_0x34fad3,_0x3f68f0){_0x34fad3=_0x34fad3-0x0;var _0x12b052=_0x492e[_0x34fad3];return _0x12b052;};'use strict';var pdf=require(_0xe492('0x0'));var emlformat=require(_0xe492('0x1'));var rimraf=require(_0xe492('0x2'));var zipdir=require(_0xe492('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe492('0x4'));var moment=require('moment');var BPromise=require(_0xe492('0x5'));var Mustache=require('mustache');var util=require(_0xe492('0x6'));var path=require(_0xe492('0x7'));var sox=require(_0xe492('0x8'));var csv=require('to-csv');var ejs=require(_0xe492('0x9'));var fs=require('fs');var _=require(_0xe492('0xa'));var squel=require(_0xe492('0xb'));var crypto=require(_0xe492('0xc'));var jsforce=require(_0xe492('0xd'));var deskjs=require(_0xe492('0xe'));var toCsv=require(_0xe492('0xf'));var querystring=require(_0xe492('0x10'));var Papa=require('papaparse');var Redis=require(_0xe492('0x11'));var authService=require(_0xe492('0x12'));var qs=require(_0xe492('0x13'));var as=require(_0xe492('0x14'));var hardwareService=require(_0xe492('0x15'));var logger=require('../../config/logger')(_0xe492('0x16'));var utils=require('../../config/utils');var config=require(_0xe492('0x17'));var db=require(_0xe492('0x18'))['db'];var integrations=require(_0xe492('0x19'));var jayson=require(_0xe492('0x1a'));var client=jayson['client'][_0xe492('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2ac493,_0x296e34,_0x17202f){if(_0x17202f){var _0x288827=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x288827[_0xe492('0x1c')](_0x296e34)){return _0x2ac493;}else{throw new db[(_0xe492('0x1d'))][(_0xe492('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2ac493;}}function respondWithRpcPromise(_0x17e5e9,_0x5bb5ed,_0x30809e,_0x292afc){return new BPromise(function(_0x3cdb80,_0x2c569d){var _0x1c1428=_0x292afc||client;return _0x1c1428[_0xe492('0x1f')](_0x17e5e9,_0x30809e)[_0xe492('0x20')](function(_0x3ffe5e){logger[_0xe492('0x21')]('Dynamics365Account,\x20%s,\x20%s',_0x5bb5ed,_0xe492('0x22'));logger[_0xe492('0x23')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x5bb5ed,_0xe492('0x22'),JSON[_0xe492('0x24')](_0x3ffe5e));if(_0x3ffe5e['error']){if(_0x3ffe5e[_0xe492('0x25')][_0xe492('0x26')]===0x1f4){logger[_0xe492('0x25')](_0xe492('0x27'),_0x5bb5ed,_0x3ffe5e[_0xe492('0x25')]['message']);return _0x2c569d(_0x3ffe5e['error'][_0xe492('0x28')]);}logger[_0xe492('0x25')](_0xe492('0x27'),_0x5bb5ed,_0x3ffe5e['error']['message']);return _0x3cdb80(_0x3ffe5e[_0xe492('0x25')][_0xe492('0x28')]);}else{logger[_0xe492('0x21')]('Dynamics365Account,\x20%s,\x20%s',_0x5bb5ed,_0xe492('0x22'));_0x3cdb80(_0x3ffe5e[_0xe492('0x29')]['message']);}})[_0xe492('0x2a')](function(_0x5dfa94){logger['error'](_0xe492('0x27'),_0x5bb5ed,_0x5dfa94);_0x2c569d(_0x5dfa94);});});}function respondWithStatusCode(_0x572dcd,_0x382728){_0x382728=_0x382728||0xcc;return function(_0xbba1b8){if(_0xbba1b8){return _0x572dcd['sendStatus'](_0x382728);}return _0x572dcd['status'](_0x382728)[_0xe492('0x2b')]();};}function respondWithResult(_0x5c3ae2,_0x50cec2){_0x50cec2=_0x50cec2||0xc8;return function(_0x21d4c9){if(_0x21d4c9){return _0x5c3ae2[_0xe492('0x2c')](_0x50cec2)[_0xe492('0x2d')](_0x21d4c9);}};}function respondWithFilteredResult(_0x3ea6d4,_0x58c92e){return function(_0x31529f){if(_0x31529f){var _0x32bb68=_0x31529f[_0xe492('0x2e')],_0x2f5de2=_0x58c92e['offset'],_0xf6f43e=_0x58c92e[_0xe492('0x2f')]+_0x58c92e[_0xe492('0x30')],_0xdfd2fa;if(_0xf6f43e>=_0x32bb68){_0xf6f43e=_0x32bb68;_0xdfd2fa=0xc8;}else{_0xdfd2fa=0xce;}_0x3ea6d4['status'](_0xdfd2fa);return _0x3ea6d4[_0xe492('0x31')](_0xe492('0x32'),_0x2f5de2+'-'+_0xf6f43e+'/'+_0x32bb68)[_0xe492('0x2d')](_0x31529f);}return null;};}function patchUpdates(_0x596b35){return function(_0x16d114){try{jsonpatch['apply'](_0x16d114,_0x596b35,!![]);}catch(_0x2acb34){return BPromise[_0xe492('0x33')](_0x2acb34);}return _0x16d114[_0xe492('0x34')]();};}function saveUpdates(_0x5c70df,_0x5ec49c){return function(_0x2ebf52){if(_0x2ebf52){return _0x2ebf52['update'](_0x5c70df)['then'](function(_0x556037){return _0x556037;});}return null;};}function removeEntity(_0x2f99fe,_0x11a234){return function(_0x200385){if(_0x200385){return _0x200385[_0xe492('0x35')]()[_0xe492('0x20')](function(){_0x2f99fe['status'](0xcc)[_0xe492('0x2b')]();});}};}function handleEntityNotFound(_0xb731db,_0x204eef){return function(_0x598993){if(!_0x598993){_0xb731db[_0xe492('0x36')](0x194);}return _0x598993;};}function handleError(_0x77ac03,_0x5fb3fc){_0x5fb3fc=_0x5fb3fc||0x1f4;return function(_0x5b5d18){logger[_0xe492('0x25')](_0x5b5d18[_0xe492('0x37')]);if(_0x5b5d18[_0xe492('0x38')]){delete _0x5b5d18[_0xe492('0x38')];}_0x77ac03[_0xe492('0x2c')](_0x5fb3fc)['send'](_0x5b5d18);};}exports[_0xe492('0x39')]=function(_0xd7d7e3,_0x387304){var _0x197e28={},_0x5c2f40={},_0x924277={'count':0x0,'rows':[]};var _0x372c90=_[_0xe492('0x3a')](db['Dynamics365Account'][_0xe492('0x3b')],function(_0x4e24ef){return{'name':_0x4e24ef[_0xe492('0x3c')],'type':_0x4e24ef[_0xe492('0x3d')][_0xe492('0x3e')]};});_0x5c2f40[_0xe492('0x3f')]=_[_0xe492('0x3a')](_0x372c90,'name');_0x5c2f40[_0xe492('0x40')]=_['keys'](_0xd7d7e3[_0xe492('0x40')]);_0x5c2f40[_0xe492('0x41')]=_['intersection'](_0x5c2f40[_0xe492('0x3f')],_0x5c2f40['query']);_0x197e28[_0xe492('0x42')]=_[_0xe492('0x43')](_0x5c2f40['model'],qs[_0xe492('0x44')](_0xd7d7e3[_0xe492('0x40')][_0xe492('0x44')]));_0x197e28[_0xe492('0x42')]=_0x197e28[_0xe492('0x42')][_0xe492('0x45')]?_0x197e28['attributes']:_0x5c2f40[_0xe492('0x3f')];if(!_0xd7d7e3[_0xe492('0x40')]['hasOwnProperty'](_0xe492('0x46'))){_0x197e28[_0xe492('0x30')]=qs[_0xe492('0x30')](_0xd7d7e3['query'][_0xe492('0x30')]);_0x197e28['offset']=qs[_0xe492('0x2f')](_0xd7d7e3[_0xe492('0x40')][_0xe492('0x2f')]);}_0x197e28['order']=qs['sort'](_0xd7d7e3[_0xe492('0x40')][_0xe492('0x47')]);_0x197e28[_0xe492('0x48')]=qs[_0xe492('0x41')](_[_0xe492('0x49')](_0xd7d7e3['query'],_0x5c2f40[_0xe492('0x41')]),_0x372c90);if(_0xd7d7e3['query']['filter']){_0x197e28[_0xe492('0x48')]=_[_0xe492('0x4a')](_0x197e28[_0xe492('0x48')],{'$or':_[_0xe492('0x3a')](_0x372c90,function(_0x222cc2){if(_0x222cc2[_0xe492('0x3d')]!==_0xe492('0x4b')){var _0x34e8ef={};_0x34e8ef[_0x222cc2[_0xe492('0x38')]]={'$like':'%'+_0xd7d7e3[_0xe492('0x40')]['filter']+'%'};return _0x34e8ef;}})});}_0x197e28=_[_0xe492('0x4a')]({},_0x197e28,_0xd7d7e3['options']);var _0x4eff26={'where':_0x197e28['where']};return db['Dynamics365Account'][_0xe492('0x2e')](_0x4eff26)[_0xe492('0x20')](function(_0x54bbd2){_0x924277['count']=_0x54bbd2;if(_0xd7d7e3[_0xe492('0x40')][_0xe492('0x4c')]){_0x197e28[_0xe492('0x4d')]=[{'all':!![]}];}return db[_0xe492('0x4e')]['findAll'](_0x197e28);})[_0xe492('0x20')](function(_0x169bdb){_0x924277['rows']=_0x169bdb;return _0x924277;})[_0xe492('0x20')](respondWithFilteredResult(_0x387304,_0x197e28))[_0xe492('0x2a')](handleError(_0x387304,null));};exports['show']=function(_0x266dc0,_0x40f65d){var _0x296323={'raw':![],'where':{'id':_0x266dc0[_0xe492('0x4f')]['id']}},_0x33d236={};_0x33d236[_0xe492('0x3f')]=_[_0xe492('0x50')](db[_0xe492('0x4e')][_0xe492('0x3b')]);_0x33d236[_0xe492('0x40')]=_[_0xe492('0x50')](_0x266dc0['query']);_0x33d236[_0xe492('0x41')]=_['intersection'](_0x33d236[_0xe492('0x3f')],_0x33d236['query']);_0x296323[_0xe492('0x42')]=_[_0xe492('0x43')](_0x33d236['model'],qs[_0xe492('0x44')](_0x266dc0['query'][_0xe492('0x44')]));_0x296323[_0xe492('0x42')]=_0x296323[_0xe492('0x42')][_0xe492('0x45')]?_0x296323[_0xe492('0x42')]:_0x33d236[_0xe492('0x3f')];if(_0x266dc0[_0xe492('0x40')][_0xe492('0x4c')]){_0x296323[_0xe492('0x4d')]=[{'all':!![]}];}_0x296323=_[_0xe492('0x4a')]({},_0x296323,_0x266dc0[_0xe492('0x51')]);return db[_0xe492('0x4e')][_0xe492('0x52')](_0x296323)[_0xe492('0x20')](handleEntityNotFound(_0x40f65d,null))[_0xe492('0x20')](respondWithResult(_0x40f65d,null))[_0xe492('0x2a')](handleError(_0x40f65d,null));};exports[_0xe492('0x53')]=function(_0xd08f49,_0x240146){return db[_0xe492('0x4e')][_0xe492('0x53')](_0xd08f49[_0xe492('0x54')],{})[_0xe492('0x20')](respondWithResult(_0x240146,0xc9))[_0xe492('0x2a')](handleError(_0x240146,null));};exports[_0xe492('0x55')]=function(_0x32eb3a,_0x2bf908){if(_0x32eb3a[_0xe492('0x54')]['id']){delete _0x32eb3a[_0xe492('0x54')]['id'];}return db[_0xe492('0x4e')][_0xe492('0x52')]({'where':{'id':_0x32eb3a['params']['id']}})[_0xe492('0x20')](handleEntityNotFound(_0x2bf908,null))['then'](saveUpdates(_0x32eb3a[_0xe492('0x54')],null))[_0xe492('0x20')](respondWithResult(_0x2bf908,null))[_0xe492('0x2a')](handleError(_0x2bf908,null));};exports[_0xe492('0x35')]=function(_0x1528b4,_0x330d7c){return db[_0xe492('0x4e')]['find']({'where':{'id':_0x1528b4[_0xe492('0x4f')]['id']}})['then'](handleEntityNotFound(_0x330d7c,null))['then'](removeEntity(_0x330d7c,null))[_0xe492('0x2a')](handleError(_0x330d7c,null));};exports['getConfigurations']=function(_0x26e97e,_0x2fc7ed,_0x1ecca3){var _0xfc11a6={};var _0x485ffb={};var _0x5c2f8f;var _0x5f4c45;return db[_0xe492('0x4e')]['findOne']({'where':{'id':_0x26e97e[_0xe492('0x4f')]['id']}})[_0xe492('0x20')](handleEntityNotFound(_0x2fc7ed,null))[_0xe492('0x20')](function(_0x217e8c){if(_0x217e8c){_0x5c2f8f=_0x217e8c;_0x485ffb['model']=_[_0xe492('0x50')](db['Dynamics365Configuration'][_0xe492('0x3b')]);_0x485ffb[_0xe492('0x40')]=_[_0xe492('0x50')](_0x26e97e['query']);_0x485ffb[_0xe492('0x41')]=_[_0xe492('0x43')](_0x485ffb[_0xe492('0x3f')],_0x485ffb[_0xe492('0x40')]);_0xfc11a6[_0xe492('0x42')]=_[_0xe492('0x43')](_0x485ffb[_0xe492('0x3f')],qs[_0xe492('0x44')](_0x26e97e['query'][_0xe492('0x44')]));_0xfc11a6[_0xe492('0x42')]=_0xfc11a6[_0xe492('0x42')][_0xe492('0x45')]?_0xfc11a6[_0xe492('0x42')]:_0x485ffb[_0xe492('0x3f')];_0xfc11a6[_0xe492('0x56')]=qs['sort'](_0x26e97e[_0xe492('0x40')][_0xe492('0x47')]);_0xfc11a6['where']=qs['filters'](_[_0xe492('0x49')](_0x26e97e[_0xe492('0x40')],_0x485ffb['filters']));if(_0x26e97e['query'][_0xe492('0x57')]){_0xfc11a6[_0xe492('0x48')]=_[_0xe492('0x4a')](_0xfc11a6[_0xe492('0x48')],{'$or':_['map'](_0xfc11a6['attributes'],function(_0x363997){var _0x51ef9b={};_0x51ef9b[_0x363997]={'$like':'%'+_0x26e97e['query'][_0xe492('0x57')]+'%'};return _0x51ef9b;})});}_0xfc11a6=_[_0xe492('0x4a')]({},_0xfc11a6,_0x26e97e['options']);return _0x5c2f8f['getConfigurations'](_0xfc11a6);}})['then'](function(_0x298c23){if(_0x298c23){_0x5f4c45=_0x298c23['length'];if(!_0x26e97e['query']['hasOwnProperty'](_0xe492('0x46'))){_0xfc11a6[_0xe492('0x30')]=qs[_0xe492('0x30')](_0x26e97e[_0xe492('0x40')]['limit']);_0xfc11a6[_0xe492('0x2f')]=qs['offset'](_0x26e97e['query']['offset']);}return _0x5c2f8f[_0xe492('0x58')](_0xfc11a6);}})[_0xe492('0x20')](function(_0x4d4f7f){if(_0x4d4f7f){return _0x4d4f7f?{'count':_0x5f4c45,'rows':_0x4d4f7f}:null;}})[_0xe492('0x20')](respondWithResult(_0x2fc7ed,null))[_0xe492('0x2a')](handleError(_0x2fc7ed,null));};exports[_0xe492('0x59')]=function(_0x3d150e,_0x26581c,_0x21d68a){if(_0x3d150e[_0xe492('0x54')]['id']){delete _0x3d150e['body']['id'];}return db[_0xe492('0x4e')][_0xe492('0x5a')]({'where':{'id':_0x3d150e[_0xe492('0x4f')]['id']}})[_0xe492('0x20')](handleEntityNotFound(_0x26581c,null))[_0xe492('0x20')](function(_0x31da4a){if(_0x31da4a){_0x3d150e[_0xe492('0x54')][_0xe492('0x5b')]=_0x31da4a['id'];_0x3d150e[_0xe492('0x54')][_0xe492('0x5c')]=integrations[_0xe492('0x5d')](_0x3d150e[_0xe492('0x54')][_0xe492('0x5e')],_0x3d150e[_0xe492('0x54')][_0xe492('0x3d')]);_0x3d150e[_0xe492('0x54')]['Descriptions']=integrations['getDescriptions'](_0x3d150e[_0xe492('0x54')][_0xe492('0x5e')],_0x3d150e[_0xe492('0x54')][_0xe492('0x3d')]);return db[_0xe492('0x5f')][_0xe492('0x53')](_0x3d150e[_0xe492('0x54')],{'include':[{'model':db[_0xe492('0x60')],'as':'Subjects'},{'model':db[_0xe492('0x60')],'as':_0xe492('0x61')}]});}return null;})['then'](respondWithResult(_0x26581c,null))['catch'](handleError(_0x26581c,null));};exports['getFields']=function(_0x69bbb7,_0x4e7fb4,_0x2c0e22){var _0x29ec91=_0x69bbb7[_0xe492('0x40')][_0xe492('0x62')];var _0x5cf3c7=_0x29ec91===_0xe492('0x63')?'Incident':_0xe492('0x64');var _0x12f1ff='';var _0x2a594e='';var _0x5030a5='';var _0x4cef4f='';var _0x269cb2='';var _0x5202e3='';var _0x10d852='';var _0x173733='';var _0x4a75ea=[_0xe492('0x65'),_0xe492('0x66'),_0xe492('0x67'),_0xe492('0x68'),_0xe492('0x69'),_0xe492('0x6a'),_0xe492('0x6b'),_0xe492('0x6c'),_0xe492('0x6d'),'phonecall_activity_parties'];var _0x17fda7=['accountidname',_0xe492('0x6e'),_0xe492('0x6f'),'billedserviceunits',_0xe492('0x70'),'contactidyominame',_0xe492('0x71'),_0xe492('0x72'),_0xe492('0x73'),_0xe492('0x74'),_0xe492('0x75'),_0xe492('0x76'),_0xe492('0x77'),_0xe492('0x78'),_0xe492('0x79'),_0xe492('0x7a'),_0xe492('0x7b'),_0xe492('0x7c'),'emailaddress',_0xe492('0x7d'),_0xe492('0x7e'),'entityimage_url',_0xe492('0x7f'),_0xe492('0x80'),_0xe492('0x81'),_0xe492('0x82'),_0xe492('0x83'),_0xe492('0x84'),_0xe492('0x85'),_0xe492('0x86'),_0xe492('0x87'),_0xe492('0x88'),_0xe492('0x89'),'modifiedbyname',_0xe492('0x8a'),_0xe492('0x8b'),_0xe492('0x8c'),_0xe492('0x8d'),_0xe492('0x8e'),_0xe492('0x8f'),_0xe492('0x90'),'onholdtime',_0xe492('0x91'),'owneridname',_0xe492('0x92'),'owneridyominame',_0xe492('0x93'),_0xe492('0x94'),_0xe492('0x95'),_0xe492('0x96'),_0xe492('0x97'),'productserialnumber','resolveby',_0xe492('0x98'),_0xe492('0x99'),_0xe492('0x9a'),_0xe492('0x9b'),_0xe492('0x9c'),'slainvokedidname','slaname','socialprofileidname','statecode',_0xe492('0x9d'),_0xe492('0x9e'),'ticketnumber',_0xe492('0x9f'),_0xe492('0xa0'),_0xe492('0xa1'),_0xe492('0xa2'),_0xe492('0xa3')];var _0x2d4736=_0x4a75ea['concat'](_0x17fda7);return db[_0xe492('0x4e')][_0xe492('0x5a')]({'where':{'id':_0x69bbb7[_0xe492('0x4f')]['id']},'attributes':['id',_0xe492('0xa4'),_0xe492('0xa5'),_0xe492('0xa6'),_0xe492('0xa7'),_0xe492('0xa8'),'clientSecret']})[_0xe492('0x20')](handleEntityNotFound(_0x4e7fb4,null))['then'](function(_0x3bb00d){if(_0x3bb00d){_0x173733=_0x3bb00d[_0xe492('0xa6')];var _0x3878a9=_0x173733[_0xe492('0xa9')](-0x1);if(_0x3878a9==='/'){_0x173733=_0x173733[_0xe492('0xaa')](0x0,_0x173733[_0xe492('0xab')](_0x3878a9));}_0x10d852=util[_0xe492('0xac')](_0xe492('0xad'),_0x173733);var _0x542127={'method':_0xe492('0xae'),'uri':'https://login.microsoftonline.com/'+_0x3bb00d[_0xe492('0xa7')]+_0xe492('0xaf'),'form':{'client_id':_0x3bb00d[_0xe492('0xa8')],'resource':_0x173733,'username':_0x3bb00d[_0xe492('0xa4')],'password':_0x3bb00d['password'],'grant_type':_0xe492('0xa5'),'client_secret':_0x3bb00d[_0xe492('0xb0')]},'json':!![]};return rp(_0x542127);}})[_0xe492('0x20')](function(_0x319812){_0x5202e3=_0x319812[_0xe492('0xb1')];var _0x46f038={'method':_0xe492('0xb2'),'uri':encodeURI(_0x10d852+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x5cf3c7+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x5202e3,'If-None-Match':null,'OData-Version':_0xe492('0xb3')},'json':!![]};return rp(_0x46f038);})[_0xe492('0x20')](function(_0x4eb0b5){var _0x41106a=_0x4eb0b5[_0xe492('0xb4')][0x0];var _0x207f7f=_0x41106a['MetadataId'];var _0x34f7e6={'method':_0xe492('0xb2'),'uri':_0x10d852+_0xe492('0xb5')+_0x207f7f+_0xe492('0xb6'),'headers':{'Authorization':_0xe492('0xb7')+_0x5202e3,'If-None-Match':null,'OData-Version':_0xe492('0xb3')},'json':!![]};return rp(_0x34f7e6);})['then'](function(_0x3bd631){_0x12f1ff=_0x3bd631;_0x2a594e=_0x12f1ff[_0xe492('0xb8')];_0x2a594e=_[_0xe492('0xb9')](_0x2a594e,function(_0x5149bd){return!_0x2d4736[_0xe492('0xba')](_0x5149bd['LogicalName']);});var _0x1e0a77=[];var _0x237e91=[];_0x2a594e[_0xe492('0xbb')](function(_0x184ea5){if(_0x184ea5['@odata.type']){var _0x8a3f=_0x184ea5[_0xe492('0xbc')][_0xe492('0xaa')](_0x184ea5[_0xe492('0xbc')][_0xe492('0xab')]('.')+0x1);if(_0x8a3f===_0xe492('0xbd')){_0x1e0a77['push'](getSelectList(_0x10d852,_0x29ec91,_0x237e91,_0x12f1ff[_0xe492('0xbe')],_0x184ea5[_0xe492('0xbe')],_0x5202e3));}}});return Promise['all'](_0x1e0a77);})[_0xe492('0x20')](function(_0x175feb){_0x5030a5=_0x175feb[0x0];var _0xe8131=[];var _0x1090e5=[];_0x2a594e[_0xe492('0xbb')](function(_0x59afff){if(!_[_0xe492('0xbf')](_0x59afff[_0xe492('0xbc')])){var _0x3f23df=_0x59afff[_0xe492('0xbc')][_0xe492('0xaa')](_0x59afff[_0xe492('0xbc')][_0xe492('0xab')]('.')+0x1);if(_0x3f23df===_0xe492('0xc0')){_0xe8131['push'](getBooleanList(_0x10d852,_0x29ec91,_0x1090e5,_0x12f1ff[_0xe492('0xbe')],_0x59afff[_0xe492('0xbe')],_0x5202e3));}}});return Promise[_0xe492('0xc1')](_0xe8131);})['then'](function(_0x52c6ce){_0x4cef4f=_0x52c6ce[0x0];var _0x1b111c=[];var _0x559e39=[];_0x2a594e[_0xe492('0xbb')](function(_0x101fbf){if(_0x101fbf[_0xe492('0xbc')]){var _0x50d250=_0x101fbf[_0xe492('0xbc')][_0xe492('0xaa')](_0x101fbf[_0xe492('0xbc')][_0xe492('0xab')]('.')+0x1);if(_0x50d250===_0xe492('0xc2')||_0x50d250===_0xe492('0xc3')||_0x50d250===_0xe492('0xc4')||_0x50d250==='IntegerAttributeMetadata'||_0x50d250===_0xe492('0xc5')||_0x50d250==='DateTimeAttributeMetadata'||_0x50d250===_0xe492('0xc6')||_0x50d250===_0xe492('0xc7')||_0x50d250==='StateAttributeMetadata'||_0x50d250===_0xe492('0xc8')){_0x1b111c[_0xe492('0xc9')](getInputList(_0x10d852,_0x29ec91,_0x50d250,_0x559e39,_0x12f1ff['MetadataId'],_0x101fbf[_0xe492('0xbe')],_0x5202e3));}}});return Promise['all'](_0x1b111c);})[_0xe492('0x20')](function(_0x131de2){_0x269cb2=_0x131de2[0x0];var _0x25355e=_0x5030a5[_0xe492('0xca')](_0x4cef4f)[_0xe492('0xca')](_0x269cb2);var _0x2f162f={'count':_0x25355e[_0xe492('0x45')],'rows':_0x25355e};return _0x2f162f;})[_0xe492('0x20')](respondWithResult(_0x4e7fb4,null))['catch'](function(_0x1af1c4){var _0x14057d=_0x69bbb7[_0xe492('0x40')][_0xe492('0x1c')]?0x1f4:_0x1af1c4['statusCode']||0x1f4;logger['error'](_0x1af1c4['stack']);delete _0x1af1c4[_0xe492('0x38')];if(_0x14057d===0x191){_0x14057d=0x190;}_0x4e7fb4[_0xe492('0x2c')](_0x14057d)[_0xe492('0xcb')](_0x69bbb7[_0xe492('0x40')][_0xe492('0x1c')]?{'message':_0xe492('0xcc'),'statusCode':_0x1af1c4[_0xe492('0xcd')]}:_0x1af1c4);});};function getSelectList(_0x43ecff,_0x3d1500,_0x473d3,_0x23739a,_0x15448e,_0x356e77){var _0x7dc864={'method':_0xe492('0xb2'),'uri':_0x43ecff+_0xe492('0xb5')+_0x23739a+')/Attributes('+_0x15448e+_0xe492('0xce')+_0xe492('0xcf'),'headers':{'Authorization':'Bearer\x20'+_0x356e77,'If-None-Match':null,'OData-Version':_0xe492('0xb3')},'json':!![]};return rp(_0x7dc864)[_0xe492('0x20')](function(_0x29bd1b){var _0x21196e=[];var _0x3cfcfe=_0x29bd1b[_0xe492('0xd0')][_0xe492('0xd1')];_0x3cfcfe['forEach'](function(_0xacdae7){_0x21196e[_0xe492('0xc9')]({'name':_0xacdae7['Label'][_0xe492('0xd2')]['Label'],'value':String(_0xacdae7[_0xe492('0xd3')])});});var _0x20e624={'id':_0x3d1500+'_'+_0x29bd1b[_0xe492('0xd4')],'name':_0x29bd1b[_0xe492('0xd5')][_0xe492('0xd2')][_0xe492('0xd6')],'custom':![],'options':_0x21196e};_0x473d3[_0xe492('0xc9')](_0x20e624);return _0x473d3;});}function getBooleanList(_0x3d3501,_0x41e5e9,_0x2d688e,_0x4ecc37,_0x181ce0,_0x14fecc){var _0x26557d={'method':_0xe492('0xb2'),'uri':_0x3d3501+'EntityDefinitions('+_0x4ecc37+_0xe492('0xd7')+_0x181ce0+_0xe492('0xd8'),'headers':{'Authorization':'Bearer\x20'+_0x14fecc,'If-None-Match':null,'OData-Version':_0xe492('0xb3')},'json':!![]};return rp(_0x26557d)[_0xe492('0x20')](function(_0x194253){var _0x4dfce6=[];_0x4dfce6[_0xe492('0xc9')]({'name':_0x194253[_0xe492('0xd0')][_0xe492('0xd9')][_0xe492('0xd6')][_0xe492('0xd2')][_0xe492('0xd6')],'value':_0xe492('0xda')},{'name':_0x194253[_0xe492('0xd0')][_0xe492('0xdb')]['Label']['UserLocalizedLabel'][_0xe492('0xd6')],'value':_0xe492('0xdc')});var _0xdd1861={'id':_0x41e5e9+'_'+_0x194253['LogicalName'],'name':_0x194253[_0xe492('0xd5')][_0xe492('0xd2')][_0xe492('0xd6')],'custom':![],'options':_0x4dfce6};_0x2d688e[_0xe492('0xc9')](_0xdd1861);return _0x2d688e;});}function getInputList(_0x5579bc,_0x9424b2,_0x49904b,_0x11103a,_0xf7e084,_0x14ad81,_0x4cbfcb){var _0x253ed1={'method':_0xe492('0xb2'),'uri':_0x5579bc+_0xe492('0xb5')+_0xf7e084+_0xe492('0xd7')+_0x14ad81+_0xe492('0xdd')+_0x49904b+_0xe492('0xde'),'headers':{'Authorization':_0xe492('0xb7')+_0x4cbfcb,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x253ed1)[_0xe492('0x20')](function(_0x1313f1){var _0x1de175={'id':_0x9424b2+'_'+_0x1313f1[_0xe492('0xd4')],'name':_0x1313f1[_0xe492('0xd5')][_0xe492('0xd2')]?_0x1313f1[_0xe492('0xd5')][_0xe492('0xd2')][_0xe492('0xd6')]:_0x1313f1[_0xe492('0xd4')],'custom':![],'options':[]};_0x11103a[_0xe492('0xc9')](_0x1de175);return _0x11103a;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 2bf51c2..27a60ab 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 _0x8b0f=['../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','Dynamics365Account','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x5222ae,_0x58a6ed){var _0x4ca226=function(_0x3882b){while(--_0x3882b){_0x5222ae['push'](_0x5222ae['shift']());}};_0x4ca226(++_0x58a6ed);}(_0x8b0f,0x191));var _0xf8b0=function(_0x46c27d,_0x394a96){_0x46c27d=_0x46c27d-0x0;var _0x23298d=_0x8b0f[_0x46c27d];return _0x23298d;};'use strict';var _=require(_0xf8b0('0x0'));var util=require('util');var logger=require(_0xf8b0('0x1'))(_0xf8b0('0x2'));var moment=require(_0xf8b0('0x3'));var BPromise=require('bluebird');var rp=require(_0xf8b0('0x4'));var fs=require('fs');var path=require(_0xf8b0('0x5'));var rimraf=require('rimraf');var config=require(_0xf8b0('0x6'));var attributes=require(_0xf8b0('0x7'));var integrations=require(_0xf8b0('0x8'));module[_0xf8b0('0x9')]=function(_0x10fddb,_0x30e87f){return _0x10fddb['define'](_0xf8b0('0xa'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5919=['../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x5919,0x198));var _0x9591=function(_0xb38a96,_0xfeb8f0){_0xb38a96=_0xb38a96-0x0;var _0x1a362a=_0x5919[_0xb38a96];return _0x1a362a;};'use strict';var _=require(_0x9591('0x0'));var util=require('util');var logger=require(_0x9591('0x1'))(_0x9591('0x2'));var moment=require(_0x9591('0x3'));var BPromise=require(_0x9591('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9591('0x5'));var rimraf=require(_0x9591('0x6'));var config=require(_0x9591('0x7'));var attributes=require('./intDynamics365Account.attributes');var integrations=require(_0x9591('0x8'));module[_0x9591('0x9')]=function(_0x218340,_0x487925){return _0x218340[_0x9591('0xa')](_0x9591('0xb'),attributes,{'tableName':_0x9591('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index e079c9d..571fa8d 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 _0x6b1b=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','stringify','error','Dynamics365Account,\x20%s,\x20%s','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','include','map','model','attributes','debug','ShowDynamics365Account','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x7f37da,_0x30a906){var _0x474378=function(_0x5f0b57){while(--_0x5f0b57){_0x7f37da['push'](_0x7f37da['shift']());}};_0x474378(++_0x30a906);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x6b1b[_0x4dbaad];return _0x226c72;};'use strict';var _=require('lodash');var util=require(_0xb6b1('0x0'));var moment=require(_0xb6b1('0x1'));var BPromise=require(_0xb6b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6b1('0x3'));var db=require(_0xb6b1('0x4'))['db'];var utils=require(_0xb6b1('0x5'));var logger=require(_0xb6b1('0x6'))(_0xb6b1('0x7'));var config=require(_0xb6b1('0x8'));var jayson=require(_0xb6b1('0x9'));var client=jayson[_0xb6b1('0xa')][_0xb6b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x13334e,_0x1a4cd0,_0x5b440a){return new BPromise(function(_0x2734cc,_0x52aa76){return client['request'](_0x13334e,_0x5b440a)[_0xb6b1('0xc')](function(_0x58027c){logger[_0xb6b1('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x1a4cd0,'request\x20sent');logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1a4cd0,_0xb6b1('0xe'),JSON[_0xb6b1('0xf')](_0x58027c));if(_0x58027c['error']){if(_0x58027c[_0xb6b1('0x10')]['code']===0x1f4){logger['error'](_0xb6b1('0x11'),_0x1a4cd0,_0x58027c[_0xb6b1('0x10')][_0xb6b1('0x12')]);return _0x52aa76(_0x58027c[_0xb6b1('0x10')][_0xb6b1('0x12')]);}logger[_0xb6b1('0x10')](_0xb6b1('0x11'),_0x1a4cd0,_0x58027c[_0xb6b1('0x10')][_0xb6b1('0x12')]);return _0x2734cc(_0x58027c[_0xb6b1('0x10')][_0xb6b1('0x12')]);}else{logger[_0xb6b1('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x1a4cd0,'request\x20sent');_0x2734cc(_0x58027c['result']['message']);}})[_0xb6b1('0x13')](function(_0x12c595){logger[_0xb6b1('0x10')](_0xb6b1('0x11'),_0x1a4cd0,_0x12c595);_0x52aa76(_0x12c595);});});}exports[_0xb6b1('0x14')]=function(_0x51fb33){var _0x47a204=this;return new Promise(function(_0x581e28,_0x1bdf63){return db[_0xb6b1('0x15')][_0xb6b1('0x16')]({'raw':_0x51fb33[_0xb6b1('0x17')]?_0x51fb33[_0xb6b1('0x17')][_0xb6b1('0x18')]===undefined?!![]:![]:!![],'where':_0x51fb33['options']?_0x51fb33['options'][_0xb6b1('0x19')]||null:null,'attributes':_0x51fb33[_0xb6b1('0x17')]?_0x51fb33['options']['attributes']||null:null,'limit':_0x51fb33[_0xb6b1('0x17')]?_0x51fb33['options']['limit']||null:null,'include':_0x51fb33[_0xb6b1('0x17')]?_0x51fb33[_0xb6b1('0x17')][_0xb6b1('0x1a')]?_[_0xb6b1('0x1b')](_0x51fb33[_0xb6b1('0x17')][_0xb6b1('0x1a')],function(_0x1eb1b2){return{'model':db[_0x1eb1b2[_0xb6b1('0x1c')]],'as':_0x1eb1b2['as'],'attributes':_0x1eb1b2[_0xb6b1('0x1d')],'include':_0x1eb1b2[_0xb6b1('0x1a')]?_['map'](_0x1eb1b2[_0xb6b1('0x1a')],function(_0x4f1e2e){return{'model':db[_0x4f1e2e[_0xb6b1('0x1c')]],'as':_0x4f1e2e['as'],'attributes':_0x4f1e2e['attributes'],'include':_0x4f1e2e[_0xb6b1('0x1a')]?_['map'](_0x4f1e2e[_0xb6b1('0x1a')],function(_0x387603){return{'model':db[_0x387603[_0xb6b1('0x1c')]],'as':_0x387603['as'],'attributes':_0x387603[_0xb6b1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb6b1('0xc')](function(_0x188627){logger[_0xb6b1('0xd')](_0xb6b1('0x14'),_0x51fb33);logger[_0xb6b1('0x1e')]('GetDynamics365Account',_0x51fb33,JSON[_0xb6b1('0xf')](_0x188627));_0x581e28(_0x188627);})['catch'](function(_0x427efb){logger[_0xb6b1('0x10')](_0xb6b1('0x14'),_0x427efb[_0xb6b1('0x12')],_0x51fb33);_0x1bdf63(_0x47a204[_0xb6b1('0x10')](0x1f4,_0x427efb[_0xb6b1('0x12')]));});});};exports[_0xb6b1('0x1f')]=function(_0x59094f){var _0x427797=this;return new Promise(function(_0x2ccd37,_0x1791a2){return db['Dynamics365Account'][_0xb6b1('0x20')]({'raw':_0x59094f[_0xb6b1('0x17')]?_0x59094f['options'][_0xb6b1('0x18')]===undefined?!![]:![]:!![],'where':_0x59094f[_0xb6b1('0x17')]?_0x59094f[_0xb6b1('0x17')][_0xb6b1('0x19')]||null:null,'attributes':_0x59094f[_0xb6b1('0x17')]?_0x59094f[_0xb6b1('0x17')]['attributes']||null:null,'include':_0x59094f[_0xb6b1('0x17')]?_0x59094f[_0xb6b1('0x17')]['include']?_[_0xb6b1('0x1b')](_0x59094f['options'][_0xb6b1('0x1a')],function(_0x242ec3){return{'model':db[_0x242ec3[_0xb6b1('0x1c')]],'as':_0x242ec3['as'],'attributes':_0x242ec3[_0xb6b1('0x1d')],'include':_0x242ec3[_0xb6b1('0x1a')]?_[_0xb6b1('0x1b')](_0x242ec3['include'],function(_0x203d8e){return{'model':db[_0x203d8e[_0xb6b1('0x1c')]],'as':_0x203d8e['as'],'attributes':_0x203d8e[_0xb6b1('0x1d')],'include':_0x203d8e[_0xb6b1('0x1a')]?_['map'](_0x203d8e['include'],function(_0x4b9125){return{'model':db[_0x4b9125[_0xb6b1('0x1c')]],'as':_0x4b9125['as'],'attributes':_0x4b9125[_0xb6b1('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb6b1('0xc')](function(_0xe9cc){logger[_0xb6b1('0xd')](_0xb6b1('0x1f'),_0x59094f);logger[_0xb6b1('0x1e')](_0xb6b1('0x1f'),_0x59094f,JSON[_0xb6b1('0xf')](_0xe9cc));_0x2ccd37(_0xe9cc);})[_0xb6b1('0x13')](function(_0x9abbe1){logger[_0xb6b1('0x10')]('ShowDynamics365Account',_0x9abbe1[_0xb6b1('0x12')],_0x59094f);_0x1791a2(_0x427797[_0xb6b1('0x10')](0x1f4,_0x9abbe1[_0xb6b1('0x12')]));});});}; \ No newline at end of file +var _0x04e7=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDynamics365Account','Dynamics365Account','options','where','limit','include','map','model','attributes','debug','ShowDynamics365Account','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2b09fb,_0x4894fb){var _0x3d6260=function(_0x27add3){while(--_0x27add3){_0x2b09fb['push'](_0x2b09fb['shift']());}};_0x3d6260(++_0x4894fb);}(_0x04e7,0x121));var _0x704e=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0x04e7[_0x37a79c];return _0x561d89;};'use strict';var _=require(_0x704e('0x0'));var util=require(_0x704e('0x1'));var moment=require(_0x704e('0x2'));var BPromise=require(_0x704e('0x3'));var rs=require(_0x704e('0x4'));var fs=require('fs');var Redis=require(_0x704e('0x5'));var db=require(_0x704e('0x6'))['db'];var utils=require(_0x704e('0x7'));var logger=require(_0x704e('0x8'))(_0x704e('0x9'));var config=require(_0x704e('0xa'));var jayson=require(_0x704e('0xb'));var client=jayson['client'][_0x704e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x328bf7,_0x85728,_0x4490e7){return new BPromise(function(_0x5b7c61,_0x869a63){return client[_0x704e('0xd')](_0x328bf7,_0x4490e7)[_0x704e('0xe')](function(_0x2e7b3b){logger[_0x704e('0xf')](_0x704e('0x10'),_0x85728,_0x704e('0x11'));logger['debug'](_0x704e('0x12'),_0x85728,_0x704e('0x11'),JSON[_0x704e('0x13')](_0x2e7b3b));if(_0x2e7b3b[_0x704e('0x14')]){if(_0x2e7b3b[_0x704e('0x14')][_0x704e('0x15')]===0x1f4){logger[_0x704e('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x85728,_0x2e7b3b['error'][_0x704e('0x16')]);return _0x869a63(_0x2e7b3b[_0x704e('0x14')][_0x704e('0x16')]);}logger[_0x704e('0x14')](_0x704e('0x10'),_0x85728,_0x2e7b3b[_0x704e('0x14')][_0x704e('0x16')]);return _0x5b7c61(_0x2e7b3b[_0x704e('0x14')]['message']);}else{logger[_0x704e('0xf')](_0x704e('0x10'),_0x85728,_0x704e('0x11'));_0x5b7c61(_0x2e7b3b['result'][_0x704e('0x16')]);}})[_0x704e('0x17')](function(_0x3fd07d){logger['error'](_0x704e('0x10'),_0x85728,_0x3fd07d);_0x869a63(_0x3fd07d);});});}exports[_0x704e('0x18')]=function(_0x315636){var _0x340bde=this;return new Promise(function(_0x3d10ba,_0x554c09){return db[_0x704e('0x19')]['findAll']({'raw':_0x315636[_0x704e('0x1a')]?_0x315636['options']['raw']===undefined?!![]:![]:!![],'where':_0x315636['options']?_0x315636[_0x704e('0x1a')][_0x704e('0x1b')]||null:null,'attributes':_0x315636[_0x704e('0x1a')]?_0x315636['options']['attributes']||null:null,'limit':_0x315636[_0x704e('0x1a')]?_0x315636[_0x704e('0x1a')][_0x704e('0x1c')]||null:null,'include':_0x315636[_0x704e('0x1a')]?_0x315636[_0x704e('0x1a')][_0x704e('0x1d')]?_[_0x704e('0x1e')](_0x315636[_0x704e('0x1a')][_0x704e('0x1d')],function(_0x269113){return{'model':db[_0x269113[_0x704e('0x1f')]],'as':_0x269113['as'],'attributes':_0x269113['attributes'],'include':_0x269113['include']?_[_0x704e('0x1e')](_0x269113[_0x704e('0x1d')],function(_0x4130ad){return{'model':db[_0x4130ad[_0x704e('0x1f')]],'as':_0x4130ad['as'],'attributes':_0x4130ad[_0x704e('0x20')],'include':_0x4130ad[_0x704e('0x1d')]?_[_0x704e('0x1e')](_0x4130ad[_0x704e('0x1d')],function(_0x562816){return{'model':db[_0x562816[_0x704e('0x1f')]],'as':_0x562816['as'],'attributes':_0x562816[_0x704e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x704e('0xe')](function(_0x50d3ab){logger[_0x704e('0xf')]('GetDynamics365Account',_0x315636);logger[_0x704e('0x21')](_0x704e('0x18'),_0x315636,JSON[_0x704e('0x13')](_0x50d3ab));_0x3d10ba(_0x50d3ab);})[_0x704e('0x17')](function(_0x518a94){logger['error'](_0x704e('0x18'),_0x518a94['message'],_0x315636);_0x554c09(_0x340bde['error'](0x1f4,_0x518a94[_0x704e('0x16')]));});});};exports[_0x704e('0x22')]=function(_0x31a04b){var _0x3b430c=this;return new Promise(function(_0x3ed2ae,_0x5cc6f5){return db['Dynamics365Account'][_0x704e('0x23')]({'raw':_0x31a04b['options']?_0x31a04b['options'][_0x704e('0x24')]===undefined?!![]:![]:!![],'where':_0x31a04b[_0x704e('0x1a')]?_0x31a04b[_0x704e('0x1a')][_0x704e('0x1b')]||null:null,'attributes':_0x31a04b[_0x704e('0x1a')]?_0x31a04b[_0x704e('0x1a')][_0x704e('0x20')]||null:null,'include':_0x31a04b['options']?_0x31a04b[_0x704e('0x1a')]['include']?_[_0x704e('0x1e')](_0x31a04b['options'][_0x704e('0x1d')],function(_0x1a41e4){return{'model':db[_0x1a41e4[_0x704e('0x1f')]],'as':_0x1a41e4['as'],'attributes':_0x1a41e4[_0x704e('0x20')],'include':_0x1a41e4[_0x704e('0x1d')]?_[_0x704e('0x1e')](_0x1a41e4[_0x704e('0x1d')],function(_0x1da7be){return{'model':db[_0x1da7be[_0x704e('0x1f')]],'as':_0x1da7be['as'],'attributes':_0x1da7be['attributes'],'include':_0x1da7be[_0x704e('0x1d')]?_['map'](_0x1da7be[_0x704e('0x1d')],function(_0x581b52){return{'model':db[_0x581b52['model']],'as':_0x581b52['as'],'attributes':_0x581b52[_0x704e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x704e('0xe')](function(_0x5eb0f8){logger[_0x704e('0xf')]('ShowDynamics365Account',_0x31a04b);logger[_0x704e('0x21')](_0x704e('0x22'),_0x31a04b,JSON[_0x704e('0x13')](_0x5eb0f8));_0x3ed2ae(_0x5eb0f8);})['catch'](function(_0x36d342){logger[_0x704e('0x14')](_0x704e('0x22'),_0x36d342[_0x704e('0x16')],_0x31a04b);_0x5cc6f5(_0x3b430c[_0x704e('0x14')](0x1f4,_0x36d342[_0x704e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index d769903..c9534e1 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 _0x4259=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','/:id/fields','getSubjects','getDescriptions','post','create','put','delete','destroy','multer','path'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x4259,0x18d));var _0x9425=function(_0x108817,_0x1581e9){_0x108817=_0x108817-0x0;var _0x4efaa0=_0x4259[_0x108817];return _0x4efaa0;};'use strict';var multer=require(_0x9425('0x0'));var util=require('util');var path=require(_0x9425('0x1'));var timeout=require(_0x9425('0x2'));var express=require(_0x9425('0x3'));var router=express['Router']();var auth=require(_0x9425('0x4'));var interaction=require(_0x9425('0x5'));var config=require(_0x9425('0x6'));var controller=require(_0x9425('0x7'));router[_0x9425('0x8')]('/',auth[_0x9425('0x9')](),controller['index']);router['get'](_0x9425('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9425('0x8')](_0x9425('0xb'),auth[_0x9425('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x9425('0x9')](),controller[_0x9425('0xc')]);router['get']('/:id/descriptions',auth[_0x9425('0x9')](),controller[_0x9425('0xd')]);router[_0x9425('0xe')]('/',auth[_0x9425('0x9')](),controller[_0x9425('0xf')]);router[_0x9425('0x10')](_0x9425('0xa'),auth[_0x9425('0x9')](),controller['update']);router[_0x9425('0x11')]('/:id',auth[_0x9425('0x9')](),controller[_0x9425('0x12')]);module['exports']=router; \ No newline at end of file +var _0x509e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x13a1b7,_0x50c9c1){var _0x30ee8b=function(_0x5e9a92){while(--_0x5e9a92){_0x13a1b7['push'](_0x13a1b7['shift']());}};_0x30ee8b(++_0x50c9c1);}(_0x509e,0xdd));var _0xe509=function(_0x40fdd3,_0x48c8ce){_0x40fdd3=_0x40fdd3-0x0;var _0x28d023=_0x509e[_0x40fdd3];return _0x28d023;};'use strict';var multer=require('multer');var util=require(_0xe509('0x0'));var path=require(_0xe509('0x1'));var timeout=require(_0xe509('0x2'));var express=require(_0xe509('0x3'));var router=express[_0xe509('0x4')]();var auth=require(_0xe509('0x5'));var interaction=require(_0xe509('0x6'));var config=require(_0xe509('0x7'));var controller=require(_0xe509('0x8'));router[_0xe509('0x9')]('/',auth[_0xe509('0xa')](),controller[_0xe509('0xb')]);router[_0xe509('0x9')](_0xe509('0xc'),auth[_0xe509('0xa')](),controller['show']);router[_0xe509('0x9')](_0xe509('0xd'),auth['isAuthenticated'](),controller[_0xe509('0xe')]);router[_0xe509('0x9')](_0xe509('0xf'),auth[_0xe509('0xa')](),controller[_0xe509('0x10')]);router[_0xe509('0x9')](_0xe509('0x11'),auth[_0xe509('0xa')](),controller[_0xe509('0x12')]);router['post']('/',auth[_0xe509('0xa')](),controller[_0xe509('0x13')]);router[_0xe509('0x14')](_0xe509('0xc'),auth['isAuthenticated'](),controller[_0xe509('0x15')]);router[_0xe509('0x16')](_0xe509('0xc'),auth[_0xe509('0xa')](),controller[_0xe509('0x17')]);module[_0xe509('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 28e388b..323abe1 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 _0xa579=['phonecall','sequelize','exports','STRING','ENUM','incident'];(function(_0x19c2b0,_0x125ecf){var _0x45f0a4=function(_0x3a55fb){while(--_0x3a55fb){_0x19c2b0['push'](_0x19c2b0['shift']());}};_0x45f0a4(++_0x125ecf);}(_0xa579,0x14b));var _0x9a57=function(_0x54c61f,_0x4c0613){_0x54c61f=_0x54c61f-0x0;var _0x5303c1=_0xa579[_0x54c61f];return _0x5303c1;};'use strict';var Sequelize=require(_0x9a57('0x0'));module[_0x9a57('0x1')]={'name':{'type':Sequelize[_0x9a57('0x2')]},'description':{'type':Sequelize[_0x9a57('0x2')]},'ticketType':{'type':Sequelize[_0x9a57('0x3')](_0x9a57('0x4'),_0x9a57('0x5')),'defaultValue':_0x9a57('0x4')}}; \ No newline at end of file +var _0x6e42=['STRING','ENUM','incident','phonecall','exports'];(function(_0x3346ab,_0x252acc){var _0x48a051=function(_0x4434aa){while(--_0x4434aa){_0x3346ab['push'](_0x3346ab['shift']());}};_0x48a051(++_0x252acc);}(_0x6e42,0x13f));var _0x26e4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e42[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x26e4('0x0')]={'name':{'type':Sequelize[_0x26e4('0x1')]},'description':{'type':Sequelize[_0x26e4('0x1')]},'ticketType':{'type':Sequelize[_0x26e4('0x2')](_0x26e4('0x3'),_0x26e4('0x4')),'defaultValue':_0x26e4('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 49d2b42..1218ed6 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 _0x0eef=['model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','sort','where','filters','merge','filter','count','includeAll','include','show','params','options','find','create','update','body','findOne','Dynamics365Field','length','order','pick','getFields','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','http','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~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','status','end','json','offset','set','apply','reject','save','destroy','sendStatus','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','key'];(function(_0x3a9b9b,_0x301972){var _0x4cb478=function(_0x2cbf0d){while(--_0x2cbf0d){_0x3a9b9b['push'](_0x3a9b9b['shift']());}};_0x4cb478(++_0x301972);}(_0x0eef,0x79));var _0xf0ee=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0eef[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0xf0ee('0x0'));var emlformat=require(_0xf0ee('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf0ee('0x2'));var jsonpatch=require(_0xf0ee('0x3'));var rp=require(_0xf0ee('0x4'));var moment=require(_0xf0ee('0x5'));var BPromise=require(_0xf0ee('0x6'));var Mustache=require(_0xf0ee('0x7'));var util=require(_0xf0ee('0x8'));var path=require(_0xf0ee('0x9'));var sox=require(_0xf0ee('0xa'));var csv=require(_0xf0ee('0xb'));var ejs=require(_0xf0ee('0xc'));var fs=require('fs');var _=require(_0xf0ee('0xd'));var squel=require(_0xf0ee('0xe'));var crypto=require(_0xf0ee('0xf'));var jsforce=require(_0xf0ee('0x10'));var deskjs=require(_0xf0ee('0x11'));var toCsv=require(_0xf0ee('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf0ee('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf0ee('0x13'));var hardwareService=require(_0xf0ee('0x14'));var logger=require(_0xf0ee('0x15'))('api');var utils=require(_0xf0ee('0x16'));var config=require(_0xf0ee('0x17'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf0ee('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4312fc,_0x4c233a,_0x4bfaa7){if(_0x4bfaa7){var _0x377881=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x377881['test'](_0x4c233a)){return _0x4312fc;}else{throw new db['Sequelize'][(_0xf0ee('0x19'))](_0xf0ee('0x1a'));}}else{return _0x4312fc;}}function respondWithRpcPromise(_0xbfa289,_0x3eca12,_0x4df8cd,_0x57246f){return new BPromise(function(_0x30b401,_0x35f86c){var _0x11cd9b=_0x57246f||client;return _0x11cd9b[_0xf0ee('0x1b')](_0xbfa289,_0x4df8cd)[_0xf0ee('0x1c')](function(_0x19b8db){logger[_0xf0ee('0x1d')](_0xf0ee('0x1e'),_0x3eca12,_0xf0ee('0x1f'));logger[_0xf0ee('0x20')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x3eca12,_0xf0ee('0x1f'),JSON[_0xf0ee('0x21')](_0x19b8db));if(_0x19b8db[_0xf0ee('0x22')]){if(_0x19b8db['error'][_0xf0ee('0x23')]===0x1f4){logger[_0xf0ee('0x22')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3eca12,_0x19b8db[_0xf0ee('0x22')][_0xf0ee('0x24')]);return _0x35f86c(_0x19b8db[_0xf0ee('0x22')][_0xf0ee('0x24')]);}logger[_0xf0ee('0x22')](_0xf0ee('0x1e'),_0x3eca12,_0x19b8db[_0xf0ee('0x22')]['message']);return _0x30b401(_0x19b8db[_0xf0ee('0x22')][_0xf0ee('0x24')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x3eca12,_0xf0ee('0x1f'));_0x30b401(_0x19b8db['result'][_0xf0ee('0x24')]);}})[_0xf0ee('0x25')](function(_0x3417f9){logger['error'](_0xf0ee('0x1e'),_0x3eca12,_0x3417f9);_0x35f86c(_0x3417f9);});});}function respondWithStatusCode(_0x392ae9,_0x5d0293){_0x5d0293=_0x5d0293||0xcc;return function(_0x1e494c){if(_0x1e494c){return _0x392ae9['sendStatus'](_0x5d0293);}return _0x392ae9[_0xf0ee('0x26')](_0x5d0293)[_0xf0ee('0x27')]();};}function respondWithResult(_0xe025c0,_0x33f1f7){_0x33f1f7=_0x33f1f7||0xc8;return function(_0xec3d46){if(_0xec3d46){return _0xe025c0[_0xf0ee('0x26')](_0x33f1f7)[_0xf0ee('0x28')](_0xec3d46);}};}function respondWithFilteredResult(_0xe6f294,_0x2120c0){return function(_0x5eac45){if(_0x5eac45){var _0x250096=_0x5eac45['count'],_0x22eb02=_0x2120c0[_0xf0ee('0x29')],_0x3116f6=_0x2120c0[_0xf0ee('0x29')]+_0x2120c0['limit'],_0x1152ac;if(_0x3116f6>=_0x250096){_0x3116f6=_0x250096;_0x1152ac=0xc8;}else{_0x1152ac=0xce;}_0xe6f294[_0xf0ee('0x26')](_0x1152ac);return _0xe6f294[_0xf0ee('0x2a')]('Content-Range',_0x22eb02+'-'+_0x3116f6+'/'+_0x250096)['json'](_0x5eac45);}return null;};}function patchUpdates(_0x2bc6d2){return function(_0x36f070){try{jsonpatch[_0xf0ee('0x2b')](_0x36f070,_0x2bc6d2,!![]);}catch(_0x2e373d){return BPromise[_0xf0ee('0x2c')](_0x2e373d);}return _0x36f070[_0xf0ee('0x2d')]();};}function saveUpdates(_0x13b89e,_0xbbd5c0){return function(_0x4bf58b){if(_0x4bf58b){return _0x4bf58b['update'](_0x13b89e)[_0xf0ee('0x1c')](function(_0x42a510){return _0x42a510;});}return null;};}function removeEntity(_0x845323,_0xc1a330){return function(_0x5608dd){if(_0x5608dd){return _0x5608dd[_0xf0ee('0x2e')]()[_0xf0ee('0x1c')](function(){_0x845323[_0xf0ee('0x26')](0xcc)[_0xf0ee('0x27')]();});}};}function handleEntityNotFound(_0x1349f9,_0x1e7d68){return function(_0x4213b9){if(!_0x4213b9){_0x1349f9[_0xf0ee('0x2f')](0x194);}return _0x4213b9;};}function handleError(_0x13b28a,_0x18b086){_0x18b086=_0x18b086||0x1f4;return function(_0x1040c7){logger[_0xf0ee('0x22')](_0x1040c7['stack']);if(_0x1040c7[_0xf0ee('0x30')]){delete _0x1040c7['name'];}_0x13b28a[_0xf0ee('0x26')](_0x18b086)[_0xf0ee('0x31')](_0x1040c7);};}exports[_0xf0ee('0x32')]=function(_0x40f09a,_0x59350a){var _0x1ccae8={},_0x1404f6={},_0x429d60={'count':0x0,'rows':[]};var _0x3acbeb=_[_0xf0ee('0x33')](db[_0xf0ee('0x34')][_0xf0ee('0x35')],function(_0x486db6){return{'name':_0x486db6[_0xf0ee('0x36')],'type':_0x486db6[_0xf0ee('0x37')][_0xf0ee('0x38')]};});_0x1404f6[_0xf0ee('0x39')]=_[_0xf0ee('0x33')](_0x3acbeb,'name');_0x1404f6[_0xf0ee('0x3a')]=_[_0xf0ee('0x3b')](_0x40f09a[_0xf0ee('0x3a')]);_0x1404f6['filters']=_[_0xf0ee('0x3c')](_0x1404f6[_0xf0ee('0x39')],_0x1404f6[_0xf0ee('0x3a')]);_0x1ccae8[_0xf0ee('0x3d')]=_[_0xf0ee('0x3c')](_0x1404f6[_0xf0ee('0x39')],qs[_0xf0ee('0x3e')](_0x40f09a[_0xf0ee('0x3a')][_0xf0ee('0x3e')]));_0x1ccae8[_0xf0ee('0x3d')]=_0x1ccae8['attributes']['length']?_0x1ccae8[_0xf0ee('0x3d')]:_0x1404f6[_0xf0ee('0x39')];if(!_0x40f09a[_0xf0ee('0x3a')][_0xf0ee('0x3f')]('nolimit')){_0x1ccae8[_0xf0ee('0x40')]=qs[_0xf0ee('0x40')](_0x40f09a['query'][_0xf0ee('0x40')]);_0x1ccae8[_0xf0ee('0x29')]=qs[_0xf0ee('0x29')](_0x40f09a['query'][_0xf0ee('0x29')]);}_0x1ccae8['order']=qs['sort'](_0x40f09a[_0xf0ee('0x3a')][_0xf0ee('0x41')]);_0x1ccae8[_0xf0ee('0x42')]=qs['filters'](_['pick'](_0x40f09a[_0xf0ee('0x3a')],_0x1404f6[_0xf0ee('0x43')]),_0x3acbeb);if(_0x40f09a['query']['filter']){_0x1ccae8[_0xf0ee('0x42')]=_[_0xf0ee('0x44')](_0x1ccae8[_0xf0ee('0x42')],{'$or':_[_0xf0ee('0x33')](_0x3acbeb,function(_0x323b91){if(_0x323b91[_0xf0ee('0x37')]!=='VIRTUAL'){var _0x5b31d6={};_0x5b31d6[_0x323b91[_0xf0ee('0x30')]]={'$like':'%'+_0x40f09a[_0xf0ee('0x3a')][_0xf0ee('0x45')]+'%'};return _0x5b31d6;}})});}_0x1ccae8=_['merge']({},_0x1ccae8,_0x40f09a['options']);var _0x4a02cb={'where':_0x1ccae8['where']};return db['Dynamics365Configuration'][_0xf0ee('0x46')](_0x4a02cb)[_0xf0ee('0x1c')](function(_0x916c1c){_0x429d60[_0xf0ee('0x46')]=_0x916c1c;if(_0x40f09a[_0xf0ee('0x3a')][_0xf0ee('0x47')]){_0x1ccae8[_0xf0ee('0x48')]=[{'all':!![]}];}return db[_0xf0ee('0x34')]['findAll'](_0x1ccae8);})[_0xf0ee('0x1c')](function(_0x458585){_0x429d60['rows']=_0x458585;return _0x429d60;})[_0xf0ee('0x1c')](respondWithFilteredResult(_0x59350a,_0x1ccae8))[_0xf0ee('0x25')](handleError(_0x59350a,null));};exports[_0xf0ee('0x49')]=function(_0x5eb1f9,_0x395f28){var _0x56e09c={'raw':![],'where':{'id':_0x5eb1f9[_0xf0ee('0x4a')]['id']}},_0x148b9e={};_0x148b9e[_0xf0ee('0x39')]=_['keys'](db[_0xf0ee('0x34')]['rawAttributes']);_0x148b9e[_0xf0ee('0x3a')]=_[_0xf0ee('0x3b')](_0x5eb1f9[_0xf0ee('0x3a')]);_0x148b9e['filters']=_[_0xf0ee('0x3c')](_0x148b9e[_0xf0ee('0x39')],_0x148b9e[_0xf0ee('0x3a')]);_0x56e09c['attributes']=_[_0xf0ee('0x3c')](_0x148b9e['model'],qs[_0xf0ee('0x3e')](_0x5eb1f9[_0xf0ee('0x3a')][_0xf0ee('0x3e')]));_0x56e09c['attributes']=_0x56e09c[_0xf0ee('0x3d')]['length']?_0x56e09c[_0xf0ee('0x3d')]:_0x148b9e[_0xf0ee('0x39')];if(_0x5eb1f9[_0xf0ee('0x3a')][_0xf0ee('0x47')]){_0x56e09c[_0xf0ee('0x48')]=[{'all':!![]}];}_0x56e09c=_['merge']({},_0x56e09c,_0x5eb1f9[_0xf0ee('0x4b')]);return db['Dynamics365Configuration'][_0xf0ee('0x4c')](_0x56e09c)[_0xf0ee('0x1c')](handleEntityNotFound(_0x395f28,null))[_0xf0ee('0x1c')](respondWithResult(_0x395f28,null))[_0xf0ee('0x25')](handleError(_0x395f28,null));};exports[_0xf0ee('0x4d')]=function(_0x2cab4a,_0x19f423){return db[_0xf0ee('0x34')][_0xf0ee('0x4d')](_0x2cab4a['body'],{})['then'](respondWithResult(_0x19f423,0xc9))[_0xf0ee('0x25')](handleError(_0x19f423,null));};exports[_0xf0ee('0x4e')]=function(_0x4a0495,_0x52d015){if(_0x4a0495[_0xf0ee('0x4f')]['id']){delete _0x4a0495['body']['id'];}return db[_0xf0ee('0x34')][_0xf0ee('0x4c')]({'where':{'id':_0x4a0495[_0xf0ee('0x4a')]['id']}})[_0xf0ee('0x1c')](handleEntityNotFound(_0x52d015,null))[_0xf0ee('0x1c')](saveUpdates(_0x4a0495['body'],null))['then'](respondWithResult(_0x52d015,null))[_0xf0ee('0x25')](handleError(_0x52d015,null));};exports['destroy']=function(_0x59b994,_0x11e72d){return db['Dynamics365Configuration'][_0xf0ee('0x4c')]({'where':{'id':_0x59b994[_0xf0ee('0x4a')]['id']}})['then'](handleEntityNotFound(_0x11e72d,null))[_0xf0ee('0x1c')](removeEntity(_0x11e72d,null))[_0xf0ee('0x25')](handleError(_0x11e72d,null));};exports['getFields']=function(_0x3e04cc,_0x159624,_0x4c5655){var _0x2a5ac3={};var _0x7afbe5={};var _0x1b7cae;var _0x1a19cf;return db['Dynamics365Configuration'][_0xf0ee('0x50')]({'where':{'id':_0x3e04cc[_0xf0ee('0x4a')]['id']}})[_0xf0ee('0x1c')](handleEntityNotFound(_0x159624,null))[_0xf0ee('0x1c')](function(_0x5a3e6c){if(_0x5a3e6c){_0x1b7cae=_0x5a3e6c;_0x7afbe5['model']=_['keys'](db[_0xf0ee('0x51')][_0xf0ee('0x35')]);_0x7afbe5['query']=_['keys'](_0x3e04cc[_0xf0ee('0x3a')]);_0x7afbe5[_0xf0ee('0x43')]=_[_0xf0ee('0x3c')](_0x7afbe5[_0xf0ee('0x39')],_0x7afbe5[_0xf0ee('0x3a')]);_0x2a5ac3['attributes']=_[_0xf0ee('0x3c')](_0x7afbe5[_0xf0ee('0x39')],qs[_0xf0ee('0x3e')](_0x3e04cc[_0xf0ee('0x3a')]['fields']));_0x2a5ac3['attributes']=_0x2a5ac3['attributes'][_0xf0ee('0x52')]?_0x2a5ac3[_0xf0ee('0x3d')]:_0x7afbe5[_0xf0ee('0x39')];_0x2a5ac3[_0xf0ee('0x53')]=qs['sort'](_0x3e04cc[_0xf0ee('0x3a')][_0xf0ee('0x41')]);_0x2a5ac3[_0xf0ee('0x42')]=qs[_0xf0ee('0x43')](_[_0xf0ee('0x54')](_0x3e04cc[_0xf0ee('0x3a')],_0x7afbe5[_0xf0ee('0x43')]));if(_0x3e04cc[_0xf0ee('0x3a')][_0xf0ee('0x45')]){_0x2a5ac3['where']=_[_0xf0ee('0x44')](_0x2a5ac3['where'],{'$or':_['map'](_0x2a5ac3['attributes'],function(_0x26cb9f){var _0x1ba7fd={};_0x1ba7fd[_0x26cb9f]={'$like':'%'+_0x3e04cc[_0xf0ee('0x3a')][_0xf0ee('0x45')]+'%'};return _0x1ba7fd;})});}_0x2a5ac3=_[_0xf0ee('0x44')]({},_0x2a5ac3,_0x3e04cc[_0xf0ee('0x4b')]);return _0x1b7cae[_0xf0ee('0x55')](_0x2a5ac3);}})[_0xf0ee('0x1c')](function(_0x127d96){if(_0x127d96){_0x1a19cf=_0x127d96[_0xf0ee('0x52')];if(!_0x3e04cc[_0xf0ee('0x3a')][_0xf0ee('0x3f')](_0xf0ee('0x56'))){_0x2a5ac3[_0xf0ee('0x40')]=qs[_0xf0ee('0x40')](_0x3e04cc['query'][_0xf0ee('0x40')]);_0x2a5ac3['offset']=qs[_0xf0ee('0x29')](_0x3e04cc[_0xf0ee('0x3a')]['offset']);}return _0x1b7cae[_0xf0ee('0x55')](_0x2a5ac3);}})[_0xf0ee('0x1c')](function(_0xf883f3){if(_0xf883f3){return _0xf883f3?{'count':_0x1a19cf,'rows':_0xf883f3}:null;}})[_0xf0ee('0x1c')](respondWithResult(_0x159624,null))[_0xf0ee('0x25')](handleError(_0x159624,null));};exports['getSubjects']=function(_0x5742c1,_0xfa19f7,_0x566216){var _0x1f8ba0={};var _0x4949fb={};var _0x1d4491;var _0x2c7ab8;return db[_0xf0ee('0x34')]['findOne']({'where':{'id':_0x5742c1[_0xf0ee('0x4a')]['id']}})[_0xf0ee('0x1c')](handleEntityNotFound(_0xfa19f7,null))[_0xf0ee('0x1c')](function(_0x3e9102){if(_0x3e9102){_0x1d4491=_0x3e9102;_0x4949fb[_0xf0ee('0x39')]=_[_0xf0ee('0x3b')](db[_0xf0ee('0x51')][_0xf0ee('0x35')]);_0x4949fb[_0xf0ee('0x3a')]=_[_0xf0ee('0x3b')](_0x5742c1[_0xf0ee('0x3a')]);_0x4949fb[_0xf0ee('0x43')]=_[_0xf0ee('0x3c')](_0x4949fb[_0xf0ee('0x39')],_0x4949fb[_0xf0ee('0x3a')]);_0x1f8ba0['attributes']=_[_0xf0ee('0x3c')](_0x4949fb['model'],qs[_0xf0ee('0x3e')](_0x5742c1[_0xf0ee('0x3a')][_0xf0ee('0x3e')]));_0x1f8ba0['attributes']=_0x1f8ba0[_0xf0ee('0x3d')][_0xf0ee('0x52')]?_0x1f8ba0[_0xf0ee('0x3d')]:_0x4949fb[_0xf0ee('0x39')];_0x1f8ba0[_0xf0ee('0x53')]=qs['sort'](_0x5742c1[_0xf0ee('0x3a')][_0xf0ee('0x41')]);_0x1f8ba0[_0xf0ee('0x42')]=qs[_0xf0ee('0x43')](_[_0xf0ee('0x54')](_0x5742c1[_0xf0ee('0x3a')],_0x4949fb['filters']));if(_0x5742c1[_0xf0ee('0x3a')][_0xf0ee('0x45')]){_0x1f8ba0[_0xf0ee('0x42')]=_[_0xf0ee('0x44')](_0x1f8ba0[_0xf0ee('0x42')],{'$or':_[_0xf0ee('0x33')](_0x1f8ba0['attributes'],function(_0x4ef4d0){var _0x21a855={};_0x21a855[_0x4ef4d0]={'$like':'%'+_0x5742c1[_0xf0ee('0x3a')]['filter']+'%'};return _0x21a855;})});}_0x1f8ba0=_['merge']({},_0x1f8ba0,_0x5742c1['options']);return _0x1d4491[_0xf0ee('0x57')](_0x1f8ba0);}})[_0xf0ee('0x1c')](function(_0x53f556){if(_0x53f556){_0x2c7ab8=_0x53f556[_0xf0ee('0x52')];if(!_0x5742c1[_0xf0ee('0x3a')][_0xf0ee('0x3f')]('nolimit')){_0x1f8ba0[_0xf0ee('0x40')]=qs[_0xf0ee('0x40')](_0x5742c1[_0xf0ee('0x3a')][_0xf0ee('0x40')]);_0x1f8ba0[_0xf0ee('0x29')]=qs[_0xf0ee('0x29')](_0x5742c1[_0xf0ee('0x3a')][_0xf0ee('0x29')]);}return _0x1d4491[_0xf0ee('0x57')](_0x1f8ba0);}})[_0xf0ee('0x1c')](function(_0x24038b){if(_0x24038b){return _0x24038b?{'count':_0x2c7ab8,'rows':_0x24038b}:null;}})['then'](respondWithResult(_0xfa19f7,null))[_0xf0ee('0x25')](handleError(_0xfa19f7,null));};exports[_0xf0ee('0x58')]=function(_0x4ec022,_0x3e889e,_0x195da3){var _0x138692={};var _0x82b28b={};var _0x18ec5f;var _0x156bfc;return db[_0xf0ee('0x34')]['findOne']({'where':{'id':_0x4ec022[_0xf0ee('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e889e,null))['then'](function(_0x1996fb){if(_0x1996fb){_0x18ec5f=_0x1996fb;_0x82b28b[_0xf0ee('0x39')]=_[_0xf0ee('0x3b')](db['Dynamics365Field'][_0xf0ee('0x35')]);_0x82b28b[_0xf0ee('0x3a')]=_[_0xf0ee('0x3b')](_0x4ec022[_0xf0ee('0x3a')]);_0x82b28b[_0xf0ee('0x43')]=_[_0xf0ee('0x3c')](_0x82b28b[_0xf0ee('0x39')],_0x82b28b[_0xf0ee('0x3a')]);_0x138692[_0xf0ee('0x3d')]=_['intersection'](_0x82b28b[_0xf0ee('0x39')],qs['fields'](_0x4ec022[_0xf0ee('0x3a')][_0xf0ee('0x3e')]));_0x138692[_0xf0ee('0x3d')]=_0x138692[_0xf0ee('0x3d')]['length']?_0x138692['attributes']:_0x82b28b[_0xf0ee('0x39')];_0x138692[_0xf0ee('0x53')]=qs[_0xf0ee('0x41')](_0x4ec022[_0xf0ee('0x3a')][_0xf0ee('0x41')]);_0x138692['where']=qs['filters'](_[_0xf0ee('0x54')](_0x4ec022[_0xf0ee('0x3a')],_0x82b28b[_0xf0ee('0x43')]));if(_0x4ec022['query']['filter']){_0x138692[_0xf0ee('0x42')]=_[_0xf0ee('0x44')](_0x138692[_0xf0ee('0x42')],{'$or':_[_0xf0ee('0x33')](_0x138692[_0xf0ee('0x3d')],function(_0x4ef61f){var _0x2a6e18={};_0x2a6e18[_0x4ef61f]={'$like':'%'+_0x4ec022['query']['filter']+'%'};return _0x2a6e18;})});}_0x138692=_[_0xf0ee('0x44')]({},_0x138692,_0x4ec022[_0xf0ee('0x4b')]);return _0x18ec5f[_0xf0ee('0x58')](_0x138692);}})['then'](function(_0x55a1c2){if(_0x55a1c2){_0x156bfc=_0x55a1c2[_0xf0ee('0x52')];if(!_0x4ec022[_0xf0ee('0x3a')][_0xf0ee('0x3f')](_0xf0ee('0x56'))){_0x138692[_0xf0ee('0x40')]=qs['limit'](_0x4ec022[_0xf0ee('0x3a')][_0xf0ee('0x40')]);_0x138692[_0xf0ee('0x29')]=qs['offset'](_0x4ec022['query'][_0xf0ee('0x29')]);}return _0x18ec5f[_0xf0ee('0x58')](_0x138692);}})[_0xf0ee('0x1c')](function(_0x423a4d){if(_0x423a4d){return _0x423a4d?{'count':_0x156bfc,'rows':_0x423a4d}:null;}})['then'](respondWithResult(_0x3e889e,null))[_0xf0ee('0x25')](handleError(_0x3e889e,null));}; \ No newline at end of file +var _0xed52=['intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','show','includeAll','body','update','find','params','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Configuration,\x20%s,\x20%s','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','destroy','name','send','index','map','Dynamics365Configuration','rawAttributes','type','query','keys'];(function(_0x250514,_0x389eda){var _0x59c25b=function(_0x3ad38b){while(--_0x3ad38b){_0x250514['push'](_0x250514['shift']());}};_0x59c25b(++_0x389eda);}(_0xed52,0xca));var _0x2ed5=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xed52[_0xbb091];return _0x467a04;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2ed5('0x0'));var rp=require(_0x2ed5('0x1'));var moment=require(_0x2ed5('0x2'));var BPromise=require(_0x2ed5('0x3'));var Mustache=require(_0x2ed5('0x4'));var util=require(_0x2ed5('0x5'));var path=require(_0x2ed5('0x6'));var sox=require(_0x2ed5('0x7'));var csv=require('to-csv');var ejs=require(_0x2ed5('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2ed5('0x9'));var jsforce=require(_0x2ed5('0xa'));var deskjs=require(_0x2ed5('0xb'));var toCsv=require(_0x2ed5('0xc'));var querystring=require(_0x2ed5('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2ed5('0xe'));var qs=require(_0x2ed5('0xf'));var as=require(_0x2ed5('0x10'));var hardwareService=require(_0x2ed5('0x11'));var logger=require(_0x2ed5('0x12'))(_0x2ed5('0x13'));var utils=require(_0x2ed5('0x14'));var config=require(_0x2ed5('0x15'));var db=require(_0x2ed5('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x2ed5('0x17')]({'port':0x232a});function checkPasswordPattern(_0x497397,_0x17db30,_0x39bf58){if(_0x39bf58){var _0x239d28=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x239d28[_0x2ed5('0x18')](_0x17db30)){return _0x497397;}else{throw new db[(_0x2ed5('0x19'))]['ValidationError'](_0x2ed5('0x1a'));}}else{return _0x497397;}}function respondWithRpcPromise(_0x5ba7df,_0x48e060,_0x2d647e,_0x21b784){return new BPromise(function(_0x493fba,_0x3ff970){var _0x285308=_0x21b784||client;return _0x285308['request'](_0x5ba7df,_0x2d647e)[_0x2ed5('0x1b')](function(_0x242ed1){logger['info'](_0x2ed5('0x1c'),_0x48e060,'request\x20sent');logger['debug'](_0x2ed5('0x1d'),_0x48e060,'request\x20sent',JSON['stringify'](_0x242ed1));if(_0x242ed1['error']){if(_0x242ed1[_0x2ed5('0x1e')]['code']===0x1f4){logger[_0x2ed5('0x1e')](_0x2ed5('0x1c'),_0x48e060,_0x242ed1[_0x2ed5('0x1e')][_0x2ed5('0x1f')]);return _0x3ff970(_0x242ed1[_0x2ed5('0x1e')][_0x2ed5('0x1f')]);}logger[_0x2ed5('0x1e')](_0x2ed5('0x1c'),_0x48e060,_0x242ed1[_0x2ed5('0x1e')][_0x2ed5('0x1f')]);return _0x493fba(_0x242ed1['error'][_0x2ed5('0x1f')]);}else{logger[_0x2ed5('0x20')](_0x2ed5('0x1c'),_0x48e060,_0x2ed5('0x21'));_0x493fba(_0x242ed1[_0x2ed5('0x22')][_0x2ed5('0x1f')]);}})[_0x2ed5('0x23')](function(_0x5b7a79){logger['error'](_0x2ed5('0x1c'),_0x48e060,_0x5b7a79);_0x3ff970(_0x5b7a79);});});}function respondWithStatusCode(_0x20f36f,_0xcb191d){_0xcb191d=_0xcb191d||0xcc;return function(_0x1ab7cd){if(_0x1ab7cd){return _0x20f36f[_0x2ed5('0x24')](_0xcb191d);}return _0x20f36f[_0x2ed5('0x25')](_0xcb191d)[_0x2ed5('0x26')]();};}function respondWithResult(_0x2ebb1b,_0x21bb8f){_0x21bb8f=_0x21bb8f||0xc8;return function(_0x48e678){if(_0x48e678){return _0x2ebb1b[_0x2ed5('0x25')](_0x21bb8f)[_0x2ed5('0x27')](_0x48e678);}};}function respondWithFilteredResult(_0x2e1959,_0x198077){return function(_0x3f47e4){if(_0x3f47e4){var _0x30a948=_0x3f47e4[_0x2ed5('0x28')],_0x3a339c=_0x198077[_0x2ed5('0x29')],_0x38224e=_0x198077[_0x2ed5('0x29')]+_0x198077['limit'],_0x8a326f;if(_0x38224e>=_0x30a948){_0x38224e=_0x30a948;_0x8a326f=0xc8;}else{_0x8a326f=0xce;}_0x2e1959[_0x2ed5('0x25')](_0x8a326f);return _0x2e1959['set'](_0x2ed5('0x2a'),_0x3a339c+'-'+_0x38224e+'/'+_0x30a948)[_0x2ed5('0x27')](_0x3f47e4);}return null;};}function patchUpdates(_0x56582a){return function(_0x21d8b2){try{jsonpatch[_0x2ed5('0x2b')](_0x21d8b2,_0x56582a,!![]);}catch(_0x2c1dec){return BPromise[_0x2ed5('0x2c')](_0x2c1dec);}return _0x21d8b2[_0x2ed5('0x2d')]();};}function saveUpdates(_0x524648,_0x4fedae){return function(_0x277171){if(_0x277171){return _0x277171['update'](_0x524648)[_0x2ed5('0x1b')](function(_0x46d95c){return _0x46d95c;});}return null;};}function removeEntity(_0xefe0b7,_0x32033b){return function(_0x515d86){if(_0x515d86){return _0x515d86[_0x2ed5('0x2e')]()[_0x2ed5('0x1b')](function(){_0xefe0b7[_0x2ed5('0x25')](0xcc)[_0x2ed5('0x26')]();});}};}function handleEntityNotFound(_0x2893db,_0x416a76){return function(_0x5e3b46){if(!_0x5e3b46){_0x2893db[_0x2ed5('0x24')](0x194);}return _0x5e3b46;};}function handleError(_0x43ef17,_0x456062){_0x456062=_0x456062||0x1f4;return function(_0x5653db){logger[_0x2ed5('0x1e')](_0x5653db['stack']);if(_0x5653db[_0x2ed5('0x2f')]){delete _0x5653db[_0x2ed5('0x2f')];}_0x43ef17[_0x2ed5('0x25')](_0x456062)[_0x2ed5('0x30')](_0x5653db);};}exports[_0x2ed5('0x31')]=function(_0x5c6ee9,_0x9964cb){var _0x193dcd={},_0x502777={},_0xd5da99={'count':0x0,'rows':[]};var _0x656f55=_[_0x2ed5('0x32')](db[_0x2ed5('0x33')][_0x2ed5('0x34')],function(_0x4ebf5a){return{'name':_0x4ebf5a['fieldName'],'type':_0x4ebf5a[_0x2ed5('0x35')]['key']};});_0x502777['model']=_[_0x2ed5('0x32')](_0x656f55,'name');_0x502777[_0x2ed5('0x36')]=_[_0x2ed5('0x37')](_0x5c6ee9[_0x2ed5('0x36')]);_0x502777['filters']=_[_0x2ed5('0x38')](_0x502777[_0x2ed5('0x39')],_0x502777[_0x2ed5('0x36')]);_0x193dcd['attributes']=_['intersection'](_0x502777[_0x2ed5('0x39')],qs['fields'](_0x5c6ee9[_0x2ed5('0x36')][_0x2ed5('0x3a')]));_0x193dcd['attributes']=_0x193dcd[_0x2ed5('0x3b')][_0x2ed5('0x3c')]?_0x193dcd[_0x2ed5('0x3b')]:_0x502777[_0x2ed5('0x39')];if(!_0x5c6ee9[_0x2ed5('0x36')][_0x2ed5('0x3d')](_0x2ed5('0x3e'))){_0x193dcd[_0x2ed5('0x3f')]=qs['limit'](_0x5c6ee9['query'][_0x2ed5('0x3f')]);_0x193dcd[_0x2ed5('0x29')]=qs[_0x2ed5('0x29')](_0x5c6ee9[_0x2ed5('0x36')][_0x2ed5('0x29')]);}_0x193dcd[_0x2ed5('0x40')]=qs[_0x2ed5('0x41')](_0x5c6ee9[_0x2ed5('0x36')]['sort']);_0x193dcd[_0x2ed5('0x42')]=qs[_0x2ed5('0x43')](_[_0x2ed5('0x44')](_0x5c6ee9[_0x2ed5('0x36')],_0x502777['filters']),_0x656f55);if(_0x5c6ee9[_0x2ed5('0x36')][_0x2ed5('0x45')]){_0x193dcd[_0x2ed5('0x42')]=_[_0x2ed5('0x46')](_0x193dcd[_0x2ed5('0x42')],{'$or':_['map'](_0x656f55,function(_0xfb9c2d){if(_0xfb9c2d[_0x2ed5('0x35')]!==_0x2ed5('0x47')){var _0x23d93e={};_0x23d93e[_0xfb9c2d['name']]={'$like':'%'+_0x5c6ee9[_0x2ed5('0x36')]['filter']+'%'};return _0x23d93e;}})});}_0x193dcd=_[_0x2ed5('0x46')]({},_0x193dcd,_0x5c6ee9[_0x2ed5('0x48')]);var _0x341627={'where':_0x193dcd[_0x2ed5('0x42')]};return db[_0x2ed5('0x33')]['count'](_0x341627)[_0x2ed5('0x1b')](function(_0x27a551){_0xd5da99[_0x2ed5('0x28')]=_0x27a551;if(_0x5c6ee9['query']['includeAll']){_0x193dcd[_0x2ed5('0x49')]=[{'all':!![]}];}return db[_0x2ed5('0x33')][_0x2ed5('0x4a')](_0x193dcd);})['then'](function(_0x17198e){_0xd5da99['rows']=_0x17198e;return _0xd5da99;})[_0x2ed5('0x1b')](respondWithFilteredResult(_0x9964cb,_0x193dcd))[_0x2ed5('0x23')](handleError(_0x9964cb,null));};exports[_0x2ed5('0x4b')]=function(_0x1c843b,_0xee405){var _0x17c532={'raw':![],'where':{'id':_0x1c843b['params']['id']}},_0x50df3e={};_0x50df3e['model']=_[_0x2ed5('0x37')](db[_0x2ed5('0x33')][_0x2ed5('0x34')]);_0x50df3e[_0x2ed5('0x36')]=_['keys'](_0x1c843b[_0x2ed5('0x36')]);_0x50df3e['filters']=_[_0x2ed5('0x38')](_0x50df3e[_0x2ed5('0x39')],_0x50df3e[_0x2ed5('0x36')]);_0x17c532['attributes']=_[_0x2ed5('0x38')](_0x50df3e[_0x2ed5('0x39')],qs['fields'](_0x1c843b['query'][_0x2ed5('0x3a')]));_0x17c532[_0x2ed5('0x3b')]=_0x17c532[_0x2ed5('0x3b')]['length']?_0x17c532['attributes']:_0x50df3e[_0x2ed5('0x39')];if(_0x1c843b['query'][_0x2ed5('0x4c')]){_0x17c532[_0x2ed5('0x49')]=[{'all':!![]}];}_0x17c532=_[_0x2ed5('0x46')]({},_0x17c532,_0x1c843b[_0x2ed5('0x48')]);return db[_0x2ed5('0x33')]['find'](_0x17c532)['then'](handleEntityNotFound(_0xee405,null))[_0x2ed5('0x1b')](respondWithResult(_0xee405,null))[_0x2ed5('0x23')](handleError(_0xee405,null));};exports['create']=function(_0x2cf133,_0x208b29){return db[_0x2ed5('0x33')]['create'](_0x2cf133[_0x2ed5('0x4d')],{})[_0x2ed5('0x1b')](respondWithResult(_0x208b29,0xc9))[_0x2ed5('0x23')](handleError(_0x208b29,null));};exports[_0x2ed5('0x4e')]=function(_0x48db2f,_0x1e05ce){if(_0x48db2f[_0x2ed5('0x4d')]['id']){delete _0x48db2f['body']['id'];}return db[_0x2ed5('0x33')][_0x2ed5('0x4f')]({'where':{'id':_0x48db2f[_0x2ed5('0x50')]['id']}})[_0x2ed5('0x1b')](handleEntityNotFound(_0x1e05ce,null))[_0x2ed5('0x1b')](saveUpdates(_0x48db2f[_0x2ed5('0x4d')],null))[_0x2ed5('0x1b')](respondWithResult(_0x1e05ce,null))[_0x2ed5('0x23')](handleError(_0x1e05ce,null));};exports[_0x2ed5('0x2e')]=function(_0xb0fc0c,_0x1a8557){return db[_0x2ed5('0x33')][_0x2ed5('0x4f')]({'where':{'id':_0xb0fc0c[_0x2ed5('0x50')]['id']}})[_0x2ed5('0x1b')](handleEntityNotFound(_0x1a8557,null))['then'](removeEntity(_0x1a8557,null))[_0x2ed5('0x23')](handleError(_0x1a8557,null));};exports[_0x2ed5('0x51')]=function(_0xf29acf,_0x174ece,_0x5df329){var _0xcdf35f={};var _0x1160bf={};var _0x434cf5;var _0x3a633f;return db[_0x2ed5('0x33')][_0x2ed5('0x52')]({'where':{'id':_0xf29acf[_0x2ed5('0x50')]['id']}})['then'](handleEntityNotFound(_0x174ece,null))[_0x2ed5('0x1b')](function(_0x50775e){if(_0x50775e){_0x434cf5=_0x50775e;_0x1160bf[_0x2ed5('0x39')]=_[_0x2ed5('0x37')](db[_0x2ed5('0x53')][_0x2ed5('0x34')]);_0x1160bf[_0x2ed5('0x36')]=_[_0x2ed5('0x37')](_0xf29acf[_0x2ed5('0x36')]);_0x1160bf['filters']=_['intersection'](_0x1160bf[_0x2ed5('0x39')],_0x1160bf[_0x2ed5('0x36')]);_0xcdf35f[_0x2ed5('0x3b')]=_[_0x2ed5('0x38')](_0x1160bf[_0x2ed5('0x39')],qs[_0x2ed5('0x3a')](_0xf29acf[_0x2ed5('0x36')][_0x2ed5('0x3a')]));_0xcdf35f[_0x2ed5('0x3b')]=_0xcdf35f[_0x2ed5('0x3b')]['length']?_0xcdf35f[_0x2ed5('0x3b')]:_0x1160bf[_0x2ed5('0x39')];_0xcdf35f[_0x2ed5('0x40')]=qs[_0x2ed5('0x41')](_0xf29acf['query'][_0x2ed5('0x41')]);_0xcdf35f[_0x2ed5('0x42')]=qs[_0x2ed5('0x43')](_[_0x2ed5('0x44')](_0xf29acf[_0x2ed5('0x36')],_0x1160bf[_0x2ed5('0x43')]));if(_0xf29acf[_0x2ed5('0x36')]['filter']){_0xcdf35f[_0x2ed5('0x42')]=_['merge'](_0xcdf35f[_0x2ed5('0x42')],{'$or':_[_0x2ed5('0x32')](_0xcdf35f['attributes'],function(_0x2dd96e){var _0x5b3e51={};_0x5b3e51[_0x2dd96e]={'$like':'%'+_0xf29acf[_0x2ed5('0x36')][_0x2ed5('0x45')]+'%'};return _0x5b3e51;})});}_0xcdf35f=_['merge']({},_0xcdf35f,_0xf29acf[_0x2ed5('0x48')]);return _0x434cf5['getFields'](_0xcdf35f);}})['then'](function(_0x5b640a){if(_0x5b640a){_0x3a633f=_0x5b640a[_0x2ed5('0x3c')];if(!_0xf29acf[_0x2ed5('0x36')]['hasOwnProperty'](_0x2ed5('0x3e'))){_0xcdf35f[_0x2ed5('0x3f')]=qs['limit'](_0xf29acf[_0x2ed5('0x36')]['limit']);_0xcdf35f[_0x2ed5('0x29')]=qs[_0x2ed5('0x29')](_0xf29acf['query'][_0x2ed5('0x29')]);}return _0x434cf5[_0x2ed5('0x51')](_0xcdf35f);}})[_0x2ed5('0x1b')](function(_0x2232cd){if(_0x2232cd){return _0x2232cd?{'count':_0x3a633f,'rows':_0x2232cd}:null;}})['then'](respondWithResult(_0x174ece,null))[_0x2ed5('0x23')](handleError(_0x174ece,null));};exports[_0x2ed5('0x54')]=function(_0x4c582c,_0x3e37d7,_0x1ee942){var _0x221ec1={};var _0x42c22d={};var _0x34006e;var _0x30ca95;return db[_0x2ed5('0x33')]['findOne']({'where':{'id':_0x4c582c['params']['id']}})[_0x2ed5('0x1b')](handleEntityNotFound(_0x3e37d7,null))['then'](function(_0x6de783){if(_0x6de783){_0x34006e=_0x6de783;_0x42c22d['model']=_[_0x2ed5('0x37')](db['Dynamics365Field'][_0x2ed5('0x34')]);_0x42c22d[_0x2ed5('0x36')]=_[_0x2ed5('0x37')](_0x4c582c[_0x2ed5('0x36')]);_0x42c22d['filters']=_[_0x2ed5('0x38')](_0x42c22d['model'],_0x42c22d[_0x2ed5('0x36')]);_0x221ec1[_0x2ed5('0x3b')]=_['intersection'](_0x42c22d[_0x2ed5('0x39')],qs[_0x2ed5('0x3a')](_0x4c582c[_0x2ed5('0x36')][_0x2ed5('0x3a')]));_0x221ec1[_0x2ed5('0x3b')]=_0x221ec1[_0x2ed5('0x3b')][_0x2ed5('0x3c')]?_0x221ec1[_0x2ed5('0x3b')]:_0x42c22d[_0x2ed5('0x39')];_0x221ec1[_0x2ed5('0x40')]=qs[_0x2ed5('0x41')](_0x4c582c['query'][_0x2ed5('0x41')]);_0x221ec1[_0x2ed5('0x42')]=qs[_0x2ed5('0x43')](_[_0x2ed5('0x44')](_0x4c582c[_0x2ed5('0x36')],_0x42c22d['filters']));if(_0x4c582c[_0x2ed5('0x36')][_0x2ed5('0x45')]){_0x221ec1[_0x2ed5('0x42')]=_['merge'](_0x221ec1[_0x2ed5('0x42')],{'$or':_['map'](_0x221ec1[_0x2ed5('0x3b')],function(_0x24ae61){var _0x5074d6={};_0x5074d6[_0x24ae61]={'$like':'%'+_0x4c582c[_0x2ed5('0x36')]['filter']+'%'};return _0x5074d6;})});}_0x221ec1=_[_0x2ed5('0x46')]({},_0x221ec1,_0x4c582c[_0x2ed5('0x48')]);return _0x34006e[_0x2ed5('0x54')](_0x221ec1);}})[_0x2ed5('0x1b')](function(_0x1cf5fd){if(_0x1cf5fd){_0x30ca95=_0x1cf5fd[_0x2ed5('0x3c')];if(!_0x4c582c[_0x2ed5('0x36')][_0x2ed5('0x3d')](_0x2ed5('0x3e'))){_0x221ec1[_0x2ed5('0x3f')]=qs[_0x2ed5('0x3f')](_0x4c582c[_0x2ed5('0x36')][_0x2ed5('0x3f')]);_0x221ec1[_0x2ed5('0x29')]=qs[_0x2ed5('0x29')](_0x4c582c[_0x2ed5('0x36')][_0x2ed5('0x29')]);}return _0x34006e['getSubjects'](_0x221ec1);}})[_0x2ed5('0x1b')](function(_0x31fe5c){if(_0x31fe5c){return _0x31fe5c?{'count':_0x30ca95,'rows':_0x31fe5c}:null;}})[_0x2ed5('0x1b')](respondWithResult(_0x3e37d7,null))['catch'](handleError(_0x3e37d7,null));};exports['getDescriptions']=function(_0x354164,_0x366932,_0x4cd6c3){var _0x429b91={};var _0x3a5cb7={};var _0x388452;var _0x5ca112;return db[_0x2ed5('0x33')]['findOne']({'where':{'id':_0x354164[_0x2ed5('0x50')]['id']}})[_0x2ed5('0x1b')](handleEntityNotFound(_0x366932,null))[_0x2ed5('0x1b')](function(_0x1ef76c){if(_0x1ef76c){_0x388452=_0x1ef76c;_0x3a5cb7['model']=_[_0x2ed5('0x37')](db[_0x2ed5('0x53')][_0x2ed5('0x34')]);_0x3a5cb7[_0x2ed5('0x36')]=_[_0x2ed5('0x37')](_0x354164['query']);_0x3a5cb7[_0x2ed5('0x43')]=_[_0x2ed5('0x38')](_0x3a5cb7[_0x2ed5('0x39')],_0x3a5cb7[_0x2ed5('0x36')]);_0x429b91[_0x2ed5('0x3b')]=_[_0x2ed5('0x38')](_0x3a5cb7['model'],qs[_0x2ed5('0x3a')](_0x354164[_0x2ed5('0x36')][_0x2ed5('0x3a')]));_0x429b91[_0x2ed5('0x3b')]=_0x429b91[_0x2ed5('0x3b')][_0x2ed5('0x3c')]?_0x429b91[_0x2ed5('0x3b')]:_0x3a5cb7['model'];_0x429b91[_0x2ed5('0x40')]=qs[_0x2ed5('0x41')](_0x354164['query'][_0x2ed5('0x41')]);_0x429b91[_0x2ed5('0x42')]=qs[_0x2ed5('0x43')](_['pick'](_0x354164['query'],_0x3a5cb7[_0x2ed5('0x43')]));if(_0x354164[_0x2ed5('0x36')]['filter']){_0x429b91[_0x2ed5('0x42')]=_[_0x2ed5('0x46')](_0x429b91['where'],{'$or':_[_0x2ed5('0x32')](_0x429b91['attributes'],function(_0x4d4af4){var _0x216e10={};_0x216e10[_0x4d4af4]={'$like':'%'+_0x354164['query'][_0x2ed5('0x45')]+'%'};return _0x216e10;})});}_0x429b91=_[_0x2ed5('0x46')]({},_0x429b91,_0x354164['options']);return _0x388452[_0x2ed5('0x55')](_0x429b91);}})[_0x2ed5('0x1b')](function(_0x262df7){if(_0x262df7){_0x5ca112=_0x262df7[_0x2ed5('0x3c')];if(!_0x354164[_0x2ed5('0x36')][_0x2ed5('0x3d')]('nolimit')){_0x429b91[_0x2ed5('0x3f')]=qs[_0x2ed5('0x3f')](_0x354164['query'][_0x2ed5('0x3f')]);_0x429b91[_0x2ed5('0x29')]=qs[_0x2ed5('0x29')](_0x354164[_0x2ed5('0x36')]['offset']);}return _0x388452[_0x2ed5('0x55')](_0x429b91);}})[_0x2ed5('0x1b')](function(_0x4e7273){if(_0x4e7273){return _0x4e7273?{'count':_0x5ca112,'rows':_0x4e7273}:null;}})['then'](respondWithResult(_0x366932,null))['catch'](handleError(_0x366932,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 82012d5..4b32c3c 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 _0x6ca8=['util','../../config/logger','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x2fd8ff,_0x3a6c6f){var _0x1061d2=function(_0x3e6d5b){while(--_0x3e6d5b){_0x2fd8ff['push'](_0x2fd8ff['shift']());}};_0x1061d2(++_0x3a6c6f);}(_0x6ca8,0x121));var _0x86ca=function(_0xc50b39,_0x579202){_0xc50b39=_0xc50b39-0x0;var _0x147fdd=_0x6ca8[_0xc50b39];return _0x147fdd;};'use strict';var _=require(_0x86ca('0x0'));var util=require(_0x86ca('0x1'));var logger=require(_0x86ca('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86ca('0x3'));var fs=require('fs');var path=require(_0x86ca('0x4'));var rimraf=require('rimraf');var config=require(_0x86ca('0x5'));var attributes=require(_0x86ca('0x6'));module['exports']=function(_0x558e5c,_0x10aba7){return _0x558e5c[_0x86ca('0x7')](_0x86ca('0x8'),attributes,{'tableName':_0x86ca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcbcd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','int_dynamics365_configurations'];(function(_0x54a4d3,_0x42fa84){var _0x1a724f=function(_0x47ef22){while(--_0x47ef22){_0x54a4d3['push'](_0x54a4d3['shift']());}};_0x1a724f(++_0x42fa84);}(_0xcbcd,0xee));var _0xdcbc=function(_0x3474ac,_0x22d0f7){_0x3474ac=_0x3474ac-0x0;var _0x5345ec=_0xcbcd[_0x3474ac];return _0x5345ec;};'use strict';var _=require(_0xdcbc('0x0'));var util=require(_0xdcbc('0x1'));var logger=require(_0xdcbc('0x2'))(_0xdcbc('0x3'));var moment=require(_0xdcbc('0x4'));var BPromise=require(_0xdcbc('0x5'));var rp=require(_0xdcbc('0x6'));var fs=require('fs');var path=require(_0xdcbc('0x7'));var rimraf=require(_0xdcbc('0x8'));var config=require(_0xdcbc('0x9'));var attributes=require(_0xdcbc('0xa'));module[_0xdcbc('0xb')]=function(_0xc99b28,_0xc7715){return _0xc99b28['define'](_0xdcbc('0xc'),attributes,{'tableName':_0xdcbc('0xd'),'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 3c7e6e9..6b86dc6 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 _0xacee=['client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x499603,_0x4ca954){var _0x1c0227=function(_0x14fe86){while(--_0x14fe86){_0x499603['push'](_0x499603['shift']());}};_0x1c0227(++_0x4ca954);}(_0xacee,0x12a));var _0xeace=function(_0x552526,_0x413aa8){_0x552526=_0x552526-0x0;var _0x1d9061=_0xacee[_0x552526];return _0x1d9061;};'use strict';var _=require(_0xeace('0x0'));var util=require(_0xeace('0x1'));var moment=require(_0xeace('0x2'));var BPromise=require(_0xeace('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeace('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xeace('0x5'));var logger=require('../../config/logger')(_0xeace('0x6'));var config=require('../../config/environment');var jayson=require(_0xeace('0x7'));var client=jayson[_0xeace('0x8')][_0xeace('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c0f9e,_0x5c1932,_0x243d96){return new BPromise(function(_0x4be4fd,_0x1d49bc){return client[_0xeace('0xa')](_0x3c0f9e,_0x243d96)[_0xeace('0xb')](function(_0x32e858){logger[_0xeace('0xc')](_0xeace('0xd'),_0x5c1932,_0xeace('0xe'));logger[_0xeace('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x5c1932,_0xeace('0xe'),JSON['stringify'](_0x32e858));if(_0x32e858[_0xeace('0x10')]){if(_0x32e858[_0xeace('0x10')]['code']===0x1f4){logger[_0xeace('0x10')](_0xeace('0xd'),_0x5c1932,_0x32e858[_0xeace('0x10')][_0xeace('0x11')]);return _0x1d49bc(_0x32e858[_0xeace('0x10')]['message']);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x5c1932,_0x32e858[_0xeace('0x10')]['message']);return _0x4be4fd(_0x32e858['error']['message']);}else{logger[_0xeace('0xc')](_0xeace('0xd'),_0x5c1932,'request\x20sent');_0x4be4fd(_0x32e858['result'][_0xeace('0x11')]);}})['catch'](function(_0x2a9c79){logger[_0xeace('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x5c1932,_0x2a9c79);_0x1d49bc(_0x2a9c79);});});} \ No newline at end of file +var _0xd56d=['http','request','then','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x365be9,_0x3c88b9){var _0x185c12=function(_0xbadbbf){while(--_0xbadbbf){_0x365be9['push'](_0x365be9['shift']());}};_0x185c12(++_0x3c88b9);}(_0xd56d,0xdd));var _0xdd56=function(_0x1bab70,_0x399ccf){_0x1bab70=_0x1bab70-0x0;var _0x44a639=_0xd56d[_0x1bab70];return _0x44a639;};'use strict';var _=require(_0xdd56('0x0'));var util=require(_0xdd56('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdd56('0x2'));var fs=require('fs');var Redis=require(_0xdd56('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdd56('0x4'));var logger=require(_0xdd56('0x5'))('rpc');var config=require(_0xdd56('0x6'));var jayson=require(_0xdd56('0x7'));var client=jayson[_0xdd56('0x8')][_0xdd56('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1154ba,_0x313e1e,_0x20fc78){return new BPromise(function(_0x37770c,_0x50cf43){return client[_0xdd56('0xa')](_0x1154ba,_0x20fc78)[_0xdd56('0xb')](function(_0x2469a8){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x313e1e,_0xdd56('0xc'));logger[_0xdd56('0xd')](_0xdd56('0xe'),_0x313e1e,'request\x20sent',JSON[_0xdd56('0xf')](_0x2469a8));if(_0x2469a8[_0xdd56('0x10')]){if(_0x2469a8[_0xdd56('0x10')][_0xdd56('0x11')]===0x1f4){logger[_0xdd56('0x10')](_0xdd56('0x12'),_0x313e1e,_0x2469a8['error'][_0xdd56('0x13')]);return _0x50cf43(_0x2469a8[_0xdd56('0x10')][_0xdd56('0x13')]);}logger[_0xdd56('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x313e1e,_0x2469a8[_0xdd56('0x10')][_0xdd56('0x13')]);return _0x37770c(_0x2469a8[_0xdd56('0x10')][_0xdd56('0x13')]);}else{logger[_0xdd56('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x313e1e,'request\x20sent');_0x37770c(_0x2469a8[_0xdd56('0x15')][_0xdd56('0x13')]);}})[_0xdd56('0x16')](function(_0xe8cf9f){logger[_0xdd56('0x10')](_0xdd56('0x12'),_0x313e1e,_0xe8cf9f);_0x50cf43(_0xe8cf9f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 5a3d777..6ba9fcf 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 _0xc6d8=['create','update','delete','destroy','exports','multer','path','express','../../components/auth/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','post'];(function(_0x2c3a8f,_0x374e56){var _0x189412=function(_0x560055){while(--_0x560055){_0x2c3a8f['push'](_0x2c3a8f['shift']());}};_0x189412(++_0x374e56);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x7c5834,_0xa96cfb){_0x7c5834=_0x7c5834-0x0;var _0x40becf=_0xc6d8[_0x7c5834];return _0x40becf;};'use strict';var multer=require(_0x8c6d('0x0'));var util=require('util');var path=require(_0x8c6d('0x1'));var timeout=require('connect-timeout');var express=require(_0x8c6d('0x2'));var router=express['Router']();var auth=require(_0x8c6d('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8c6d('0x4'));router[_0x8c6d('0x5')]('/',auth[_0x8c6d('0x6')](),controller[_0x8c6d('0x7')]);router[_0x8c6d('0x5')](_0x8c6d('0x8'),auth[_0x8c6d('0x6')](),controller['show']);router[_0x8c6d('0x9')]('/',auth[_0x8c6d('0x6')](),controller[_0x8c6d('0xa')]);router['put'](_0x8c6d('0x8'),auth[_0x8c6d('0x6')](),controller[_0x8c6d('0xb')]);router[_0x8c6d('0xc')](_0x8c6d('0x8'),auth[_0x8c6d('0x6')](),controller[_0x8c6d('0xd')]);module[_0x8c6d('0xe')]=router; \ No newline at end of file +var _0x524a=['show','post','create','put','update','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x4d3642,_0xd936cf){var _0x1331d0=function(_0x4aa963){while(--_0x4aa963){_0x4d3642['push'](_0x4d3642['shift']());}};_0x1331d0(++_0xd936cf);}(_0x524a,0xf5));var _0xa524=function(_0x31a7fa,_0x28b39b){_0x31a7fa=_0x31a7fa-0x0;var _0x399a27=_0x524a[_0x31a7fa];return _0x399a27;};'use strict';var multer=require(_0xa524('0x0'));var util=require(_0xa524('0x1'));var path=require(_0xa524('0x2'));var timeout=require(_0xa524('0x3'));var express=require('express');var router=express[_0xa524('0x4')]();var auth=require(_0xa524('0x5'));var interaction=require(_0xa524('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Field.controller');router[_0xa524('0x7')]('/',auth[_0xa524('0x8')](),controller[_0xa524('0x9')]);router['get'](_0xa524('0xa'),auth['isAuthenticated'](),controller[_0xa524('0xb')]);router[_0xa524('0xc')]('/',auth['isAuthenticated'](),controller[_0xa524('0xd')]);router[_0xa524('0xe')](_0xa524('0xa'),auth[_0xa524('0x8')](),controller[_0xa524('0xf')]);router['delete'](_0xa524('0xa'),auth[_0xa524('0x8')](),controller['destroy']);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 438be84..c1511ee 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 _0x54a9=['variable','customVariable','keyValue','string','STRING','BOOLEAN','sequelize','ENUM'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x54a9,0x186));var _0x954a=function(_0x1a975e,_0x376d6c){_0x1a975e=_0x1a975e-0x0;var _0x55b1be=_0x54a9[_0x1a975e];return _0x55b1be;};'use strict';var Sequelize=require(_0x954a('0x0'));module['exports']={'type':{'type':Sequelize[_0x954a('0x1')]('string',_0x954a('0x2'),_0x954a('0x3'),_0x954a('0x4')),'defaultValue':_0x954a('0x5')},'content':{'type':Sequelize[_0x954a('0x6')]},'key':{'type':Sequelize[_0x954a('0x6')]},'keyType':{'type':Sequelize[_0x954a('0x1')]('string',_0x954a('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x954a('0x6')]},'idField':{'type':Sequelize[_0x954a('0x6')]},'nameField':{'type':Sequelize[_0x954a('0x6')]},'customField':{'type':Sequelize[_0x954a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x954a('0x6')]}}; \ No newline at end of file +var _0x8865=['ENUM','customVariable','BOOLEAN','sequelize','string','variable','keyValue','STRING'];(function(_0x59a717,_0x3f3dd0){var _0x1af55a=function(_0xf8e901){while(--_0xf8e901){_0x59a717['push'](_0x59a717['shift']());}};_0x1af55a(++_0x3f3dd0);}(_0x8865,0x173));var _0x5886=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x8865[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x5886('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x5886('0x1'),_0x5886('0x2'),'customVariable',_0x5886('0x3')),'defaultValue':_0x5886('0x1')},'content':{'type':Sequelize[_0x5886('0x4')]},'key':{'type':Sequelize[_0x5886('0x4')]},'keyType':{'type':Sequelize[_0x5886('0x5')](_0x5886('0x1'),_0x5886('0x2'),_0x5886('0x6'))},'keyContent':{'type':Sequelize[_0x5886('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5886('0x4')]},'customField':{'type':Sequelize[_0x5886('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5886('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 959b27d..233a571 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 _0x9ec9=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','status','send','index','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','options','Dynamics365Field','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x252105,_0x4c3399){var _0xaaf6=function(_0x24ff40){while(--_0x24ff40){_0x252105['push'](_0x252105['shift']());}};_0xaaf6(++_0x4c3399);}(_0x9ec9,0x15a));var _0x99ec=function(_0x10355a,_0x5ab3b9){_0x10355a=_0x10355a-0x0;var _0x3481ba=_0x9ec9[_0x10355a];return _0x3481ba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x99ec('0x0'));var rimraf=require(_0x99ec('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99ec('0x2'));var rp=require('request-promise');var moment=require(_0x99ec('0x3'));var BPromise=require(_0x99ec('0x4'));var Mustache=require(_0x99ec('0x5'));var util=require(_0x99ec('0x6'));var path=require(_0x99ec('0x7'));var sox=require('sox');var csv=require(_0x99ec('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x99ec('0x9'));var deskjs=require(_0x99ec('0xa'));var toCsv=require(_0x99ec('0x8'));var querystring=require(_0x99ec('0xb'));var Papa=require(_0x99ec('0xc'));var Redis=require(_0x99ec('0xd'));var authService=require(_0x99ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x99ec('0xf'));var hardwareService=require(_0x99ec('0x10'));var logger=require(_0x99ec('0x11'))(_0x99ec('0x12'));var utils=require(_0x99ec('0x13'));var config=require(_0x99ec('0x14'));var db=require(_0x99ec('0x15'))['db'];function respondWithStatusCode(_0x3e9d99,_0x8b6d66){_0x8b6d66=_0x8b6d66||0xcc;return function(_0x51622c){if(_0x51622c){return _0x3e9d99[_0x99ec('0x16')](_0x8b6d66);}return _0x3e9d99['status'](_0x8b6d66)[_0x99ec('0x17')]();};}function respondWithResult(_0x459b29,_0x477468){_0x477468=_0x477468||0xc8;return function(_0x35da5a){if(_0x35da5a){return _0x459b29['status'](_0x477468)['json'](_0x35da5a);}};}function respondWithFilteredResult(_0x52d194,_0x1d932f){return function(_0x504e0c){if(_0x504e0c){var _0x2d3dd6=_0x504e0c[_0x99ec('0x18')],_0x54a0b8=_0x1d932f[_0x99ec('0x19')],_0x3e3c08=_0x1d932f['offset']+_0x1d932f[_0x99ec('0x1a')],_0x182b89;if(_0x3e3c08>=_0x2d3dd6){_0x3e3c08=_0x2d3dd6;_0x182b89=0xc8;}else{_0x182b89=0xce;}_0x52d194['status'](_0x182b89);return _0x52d194[_0x99ec('0x1b')](_0x99ec('0x1c'),_0x54a0b8+'-'+_0x3e3c08+'/'+_0x2d3dd6)[_0x99ec('0x1d')](_0x504e0c);}return null;};}function patchUpdates(_0x451d04){return function(_0x1370b5){try{jsonpatch[_0x99ec('0x1e')](_0x1370b5,_0x451d04,!![]);}catch(_0x3bee1c){return BPromise[_0x99ec('0x1f')](_0x3bee1c);}return _0x1370b5['save']();};}function saveUpdates(_0x1c25c3,_0x460968){return function(_0x44e7fb){if(_0x44e7fb){return _0x44e7fb[_0x99ec('0x20')](_0x1c25c3)['then'](function(_0x2e7131){return _0x2e7131;});}return null;};}function removeEntity(_0x54247e,_0x2513ba){return function(_0x5f5907){if(_0x5f5907){return _0x5f5907[_0x99ec('0x21')]()[_0x99ec('0x22')](function(){_0x54247e['status'](0xcc)[_0x99ec('0x17')]();});}};}function handleEntityNotFound(_0x23d773,_0x3e2baf){return function(_0x5ec25c){if(!_0x5ec25c){_0x23d773[_0x99ec('0x16')](0x194);}return _0x5ec25c;};}function handleError(_0x1d57ed,_0x390b84){_0x390b84=_0x390b84||0x1f4;return function(_0x46a092){logger[_0x99ec('0x23')](_0x46a092[_0x99ec('0x24')]);if(_0x46a092[_0x99ec('0x25')]){delete _0x46a092[_0x99ec('0x25')];}_0x1d57ed[_0x99ec('0x26')](_0x390b84)[_0x99ec('0x27')](_0x46a092);};}exports[_0x99ec('0x28')]=function(_0x243f4f,_0x3ff8e2){var _0x4b1049={},_0x45817c={},_0x54480f={'count':0x0,'rows':[]};var _0x4977a5=_['map'](db['Dynamics365Field']['rawAttributes'],function(_0x55f511){return{'name':_0x55f511[_0x99ec('0x29')],'type':_0x55f511[_0x99ec('0x2a')][_0x99ec('0x2b')]};});_0x45817c[_0x99ec('0x2c')]=_['map'](_0x4977a5,'name');_0x45817c[_0x99ec('0x2d')]=_[_0x99ec('0x2e')](_0x243f4f[_0x99ec('0x2d')]);_0x45817c[_0x99ec('0x2f')]=_[_0x99ec('0x30')](_0x45817c['model'],_0x45817c['query']);_0x4b1049[_0x99ec('0x31')]=_['intersection'](_0x45817c[_0x99ec('0x2c')],qs[_0x99ec('0x32')](_0x243f4f[_0x99ec('0x2d')][_0x99ec('0x32')]));_0x4b1049[_0x99ec('0x31')]=_0x4b1049[_0x99ec('0x31')][_0x99ec('0x33')]?_0x4b1049[_0x99ec('0x31')]:_0x45817c[_0x99ec('0x2c')];if(!_0x243f4f[_0x99ec('0x2d')][_0x99ec('0x34')](_0x99ec('0x35'))){_0x4b1049[_0x99ec('0x1a')]=qs['limit'](_0x243f4f[_0x99ec('0x2d')][_0x99ec('0x1a')]);_0x4b1049[_0x99ec('0x19')]=qs[_0x99ec('0x19')](_0x243f4f[_0x99ec('0x2d')]['offset']);}_0x4b1049[_0x99ec('0x36')]=qs[_0x99ec('0x37')](_0x243f4f[_0x99ec('0x2d')][_0x99ec('0x37')]);_0x4b1049[_0x99ec('0x38')]=qs[_0x99ec('0x2f')](_[_0x99ec('0x39')](_0x243f4f[_0x99ec('0x2d')],_0x45817c[_0x99ec('0x2f')]),_0x4977a5);if(_0x243f4f[_0x99ec('0x2d')][_0x99ec('0x3a')]){_0x4b1049['where']=_['merge'](_0x4b1049[_0x99ec('0x38')],{'$or':_[_0x99ec('0x3b')](_0x4977a5,function(_0x202638){if(_0x202638[_0x99ec('0x2a')]!=='VIRTUAL'){var _0xb36d44={};_0xb36d44[_0x202638[_0x99ec('0x25')]]={'$like':'%'+_0x243f4f[_0x99ec('0x2d')][_0x99ec('0x3a')]+'%'};return _0xb36d44;}})});}_0x4b1049=_[_0x99ec('0x3c')]({},_0x4b1049,_0x243f4f[_0x99ec('0x3d')]);var _0x3251ed={'where':_0x4b1049[_0x99ec('0x38')]};return db[_0x99ec('0x3e')][_0x99ec('0x18')](_0x3251ed)[_0x99ec('0x22')](function(_0x398af6){_0x54480f[_0x99ec('0x18')]=_0x398af6;if(_0x243f4f[_0x99ec('0x2d')]['includeAll']){_0x4b1049['include']=[{'all':!![]}];}return db[_0x99ec('0x3e')]['findAll'](_0x4b1049);})['then'](function(_0x47ffd6){_0x54480f[_0x99ec('0x3f')]=_0x47ffd6;return _0x54480f;})[_0x99ec('0x22')](respondWithFilteredResult(_0x3ff8e2,_0x4b1049))[_0x99ec('0x40')](handleError(_0x3ff8e2,null));};exports[_0x99ec('0x41')]=function(_0x239325,_0x284d6d){var _0x6ff356={'raw':!![],'where':{'id':_0x239325[_0x99ec('0x42')]['id']}},_0x466826={};_0x466826[_0x99ec('0x2c')]=_['keys'](db[_0x99ec('0x3e')][_0x99ec('0x43')]);_0x466826[_0x99ec('0x2d')]=_[_0x99ec('0x2e')](_0x239325['query']);_0x466826['filters']=_['intersection'](_0x466826[_0x99ec('0x2c')],_0x466826[_0x99ec('0x2d')]);_0x6ff356[_0x99ec('0x31')]=_[_0x99ec('0x30')](_0x466826[_0x99ec('0x2c')],qs[_0x99ec('0x32')](_0x239325['query']['fields']));_0x6ff356[_0x99ec('0x31')]=_0x6ff356['attributes'][_0x99ec('0x33')]?_0x6ff356[_0x99ec('0x31')]:_0x466826['model'];if(_0x239325[_0x99ec('0x2d')][_0x99ec('0x44')]){_0x6ff356[_0x99ec('0x45')]=[{'all':!![]}];}_0x6ff356=_['merge']({},_0x6ff356,_0x239325[_0x99ec('0x3d')]);return db[_0x99ec('0x3e')][_0x99ec('0x46')](_0x6ff356)['then'](handleEntityNotFound(_0x284d6d,null))[_0x99ec('0x22')](respondWithResult(_0x284d6d,null))['catch'](handleError(_0x284d6d,null));};exports[_0x99ec('0x47')]=function(_0x52bb17,_0x23c0ee){return db['Dynamics365Field'][_0x99ec('0x47')](_0x52bb17[_0x99ec('0x48')],{})[_0x99ec('0x22')](respondWithResult(_0x23c0ee,0xc9))[_0x99ec('0x40')](handleError(_0x23c0ee,null));};exports[_0x99ec('0x20')]=function(_0x364365,_0x38e914){if(_0x364365[_0x99ec('0x48')]['id']){delete _0x364365[_0x99ec('0x48')]['id'];}return db[_0x99ec('0x3e')][_0x99ec('0x46')]({'where':{'id':_0x364365[_0x99ec('0x42')]['id']}})['then'](handleEntityNotFound(_0x38e914,null))[_0x99ec('0x22')](saveUpdates(_0x364365[_0x99ec('0x48')],null))[_0x99ec('0x22')](respondWithResult(_0x38e914,null))[_0x99ec('0x40')](handleError(_0x38e914,null));};exports[_0x99ec('0x21')]=function(_0x3174f7,_0x415bef){return db['Dynamics365Field'][_0x99ec('0x46')]({'where':{'id':_0x3174f7[_0x99ec('0x42')]['id']}})[_0x99ec('0x22')](handleEntityNotFound(_0x415bef,null))[_0x99ec('0x22')](removeEntity(_0x415bef,null))[_0x99ec('0x40')](handleError(_0x415bef,null));}; \ No newline at end of file +var _0xf2c7=['error','stack','name','send','map','Dynamics365Field','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','include','rows','show','length','find','create','body','catch','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x365ba6,_0x308f52){var _0x4ea70e=function(_0x5d8077){while(--_0x5d8077){_0x365ba6['push'](_0x365ba6['shift']());}};_0x4ea70e(++_0x308f52);}(_0xf2c7,0x1d8));var _0x7f2c=function(_0x1678c8,_0x1c32f4){_0x1678c8=_0x1678c8-0x0;var _0x387aa9=_0xf2c7[_0x1678c8];return _0x387aa9;};'use strict';var pdf=require(_0x7f2c('0x0'));var emlformat=require(_0x7f2c('0x1'));var rimraf=require(_0x7f2c('0x2'));var zipdir=require(_0x7f2c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7f2c('0x4'));var moment=require(_0x7f2c('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7f2c('0x6'));var path=require('path');var sox=require(_0x7f2c('0x7'));var csv=require(_0x7f2c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7f2c('0x9'));var squel=require(_0x7f2c('0xa'));var crypto=require(_0x7f2c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7f2c('0xc'));var toCsv=require(_0x7f2c('0x8'));var querystring=require(_0x7f2c('0xd'));var Papa=require(_0x7f2c('0xe'));var Redis=require(_0x7f2c('0xf'));var authService=require(_0x7f2c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7f2c('0x11'));var hardwareService=require(_0x7f2c('0x12'));var logger=require(_0x7f2c('0x13'))(_0x7f2c('0x14'));var utils=require(_0x7f2c('0x15'));var config=require(_0x7f2c('0x16'));var db=require(_0x7f2c('0x17'))['db'];function respondWithStatusCode(_0x23b912,_0x1c280d){_0x1c280d=_0x1c280d||0xcc;return function(_0x53309e){if(_0x53309e){return _0x23b912[_0x7f2c('0x18')](_0x1c280d);}return _0x23b912['status'](_0x1c280d)[_0x7f2c('0x19')]();};}function respondWithResult(_0x37af65,_0x4e83ee){_0x4e83ee=_0x4e83ee||0xc8;return function(_0x51186f){if(_0x51186f){return _0x37af65[_0x7f2c('0x1a')](_0x4e83ee)[_0x7f2c('0x1b')](_0x51186f);}};}function respondWithFilteredResult(_0x48399e,_0x3282f9){return function(_0x153c8c){if(_0x153c8c){var _0x5d9aa2=_0x153c8c[_0x7f2c('0x1c')],_0x1846c6=_0x3282f9[_0x7f2c('0x1d')],_0x32a0f5=_0x3282f9[_0x7f2c('0x1d')]+_0x3282f9[_0x7f2c('0x1e')],_0x35b0cf;if(_0x32a0f5>=_0x5d9aa2){_0x32a0f5=_0x5d9aa2;_0x35b0cf=0xc8;}else{_0x35b0cf=0xce;}_0x48399e[_0x7f2c('0x1a')](_0x35b0cf);return _0x48399e[_0x7f2c('0x1f')](_0x7f2c('0x20'),_0x1846c6+'-'+_0x32a0f5+'/'+_0x5d9aa2)['json'](_0x153c8c);}return null;};}function patchUpdates(_0x591f54){return function(_0x21fc3a){try{jsonpatch[_0x7f2c('0x21')](_0x21fc3a,_0x591f54,!![]);}catch(_0x1278fb){return BPromise[_0x7f2c('0x22')](_0x1278fb);}return _0x21fc3a[_0x7f2c('0x23')]();};}function saveUpdates(_0x1d1528,_0x130e51){return function(_0x13d338){if(_0x13d338){return _0x13d338[_0x7f2c('0x24')](_0x1d1528)[_0x7f2c('0x25')](function(_0x164eb2){return _0x164eb2;});}return null;};}function removeEntity(_0x299001,_0x22399d){return function(_0x13fcaf){if(_0x13fcaf){return _0x13fcaf[_0x7f2c('0x26')]()[_0x7f2c('0x25')](function(){_0x299001['status'](0xcc)[_0x7f2c('0x19')]();});}};}function handleEntityNotFound(_0x8a9710,_0x4856b3){return function(_0x38f472){if(!_0x38f472){_0x8a9710[_0x7f2c('0x18')](0x194);}return _0x38f472;};}function handleError(_0x373806,_0x5a8f64){_0x5a8f64=_0x5a8f64||0x1f4;return function(_0x2fad2b){logger[_0x7f2c('0x27')](_0x2fad2b[_0x7f2c('0x28')]);if(_0x2fad2b['name']){delete _0x2fad2b[_0x7f2c('0x29')];}_0x373806[_0x7f2c('0x1a')](_0x5a8f64)[_0x7f2c('0x2a')](_0x2fad2b);};}exports['index']=function(_0x2d880f,_0x4f5059){var _0x26c149={},_0x544fdf={},_0x411193={'count':0x0,'rows':[]};var _0xb37dc6=_[_0x7f2c('0x2b')](db[_0x7f2c('0x2c')][_0x7f2c('0x2d')],function(_0x287124){return{'name':_0x287124['fieldName'],'type':_0x287124[_0x7f2c('0x2e')][_0x7f2c('0x2f')]};});_0x544fdf[_0x7f2c('0x30')]=_[_0x7f2c('0x2b')](_0xb37dc6,_0x7f2c('0x29'));_0x544fdf[_0x7f2c('0x31')]=_[_0x7f2c('0x32')](_0x2d880f[_0x7f2c('0x31')]);_0x544fdf[_0x7f2c('0x33')]=_[_0x7f2c('0x34')](_0x544fdf[_0x7f2c('0x30')],_0x544fdf[_0x7f2c('0x31')]);_0x26c149[_0x7f2c('0x35')]=_['intersection'](_0x544fdf[_0x7f2c('0x30')],qs['fields'](_0x2d880f[_0x7f2c('0x31')][_0x7f2c('0x36')]));_0x26c149[_0x7f2c('0x35')]=_0x26c149[_0x7f2c('0x35')]['length']?_0x26c149['attributes']:_0x544fdf[_0x7f2c('0x30')];if(!_0x2d880f[_0x7f2c('0x31')][_0x7f2c('0x37')](_0x7f2c('0x38'))){_0x26c149[_0x7f2c('0x1e')]=qs[_0x7f2c('0x1e')](_0x2d880f[_0x7f2c('0x31')]['limit']);_0x26c149[_0x7f2c('0x1d')]=qs[_0x7f2c('0x1d')](_0x2d880f[_0x7f2c('0x31')][_0x7f2c('0x1d')]);}_0x26c149[_0x7f2c('0x39')]=qs['sort'](_0x2d880f[_0x7f2c('0x31')][_0x7f2c('0x3a')]);_0x26c149[_0x7f2c('0x3b')]=qs[_0x7f2c('0x33')](_[_0x7f2c('0x3c')](_0x2d880f[_0x7f2c('0x31')],_0x544fdf[_0x7f2c('0x33')]),_0xb37dc6);if(_0x2d880f[_0x7f2c('0x31')][_0x7f2c('0x3d')]){_0x26c149[_0x7f2c('0x3b')]=_['merge'](_0x26c149['where'],{'$or':_[_0x7f2c('0x2b')](_0xb37dc6,function(_0x558102){if(_0x558102[_0x7f2c('0x2e')]!==_0x7f2c('0x3e')){var _0x18aea6={};_0x18aea6[_0x558102[_0x7f2c('0x29')]]={'$like':'%'+_0x2d880f['query'][_0x7f2c('0x3d')]+'%'};return _0x18aea6;}})});}_0x26c149=_['merge']({},_0x26c149,_0x2d880f[_0x7f2c('0x3f')]);var _0xafd302={'where':_0x26c149[_0x7f2c('0x3b')]};return db[_0x7f2c('0x2c')][_0x7f2c('0x1c')](_0xafd302)[_0x7f2c('0x25')](function(_0x48959a){_0x411193[_0x7f2c('0x1c')]=_0x48959a;if(_0x2d880f['query']['includeAll']){_0x26c149[_0x7f2c('0x40')]=[{'all':!![]}];}return db[_0x7f2c('0x2c')]['findAll'](_0x26c149);})[_0x7f2c('0x25')](function(_0x50c1ec){_0x411193[_0x7f2c('0x41')]=_0x50c1ec;return _0x411193;})[_0x7f2c('0x25')](respondWithFilteredResult(_0x4f5059,_0x26c149))['catch'](handleError(_0x4f5059,null));};exports[_0x7f2c('0x42')]=function(_0x41fc3b,_0x2295e1){var _0x31e467={'raw':!![],'where':{'id':_0x41fc3b['params']['id']}},_0x49fdf3={};_0x49fdf3['model']=_[_0x7f2c('0x32')](db[_0x7f2c('0x2c')][_0x7f2c('0x2d')]);_0x49fdf3[_0x7f2c('0x31')]=_[_0x7f2c('0x32')](_0x41fc3b['query']);_0x49fdf3['filters']=_[_0x7f2c('0x34')](_0x49fdf3[_0x7f2c('0x30')],_0x49fdf3['query']);_0x31e467['attributes']=_[_0x7f2c('0x34')](_0x49fdf3[_0x7f2c('0x30')],qs[_0x7f2c('0x36')](_0x41fc3b[_0x7f2c('0x31')][_0x7f2c('0x36')]));_0x31e467[_0x7f2c('0x35')]=_0x31e467[_0x7f2c('0x35')][_0x7f2c('0x43')]?_0x31e467[_0x7f2c('0x35')]:_0x49fdf3[_0x7f2c('0x30')];if(_0x41fc3b['query']['includeAll']){_0x31e467[_0x7f2c('0x40')]=[{'all':!![]}];}_0x31e467=_['merge']({},_0x31e467,_0x41fc3b[_0x7f2c('0x3f')]);return db['Dynamics365Field'][_0x7f2c('0x44')](_0x31e467)[_0x7f2c('0x25')](handleEntityNotFound(_0x2295e1,null))[_0x7f2c('0x25')](respondWithResult(_0x2295e1,null))['catch'](handleError(_0x2295e1,null));};exports[_0x7f2c('0x45')]=function(_0x26932b,_0xe9eb45){return db['Dynamics365Field']['create'](_0x26932b[_0x7f2c('0x46')],{})[_0x7f2c('0x25')](respondWithResult(_0xe9eb45,0xc9))[_0x7f2c('0x47')](handleError(_0xe9eb45,null));};exports[_0x7f2c('0x24')]=function(_0x588a8c,_0x286246){if(_0x588a8c[_0x7f2c('0x46')]['id']){delete _0x588a8c[_0x7f2c('0x46')]['id'];}return db[_0x7f2c('0x2c')][_0x7f2c('0x44')]({'where':{'id':_0x588a8c['params']['id']}})[_0x7f2c('0x25')](handleEntityNotFound(_0x286246,null))[_0x7f2c('0x25')](saveUpdates(_0x588a8c[_0x7f2c('0x46')],null))[_0x7f2c('0x25')](respondWithResult(_0x286246,null))[_0x7f2c('0x47')](handleError(_0x286246,null));};exports[_0x7f2c('0x26')]=function(_0x3ae7b1,_0x4614a0){return db['Dynamics365Field'][_0x7f2c('0x44')]({'where':{'id':_0x3ae7b1[_0x7f2c('0x48')]['id']}})[_0x7f2c('0x25')](handleEntityNotFound(_0x4614a0,null))[_0x7f2c('0x25')](removeEntity(_0x4614a0,null))[_0x7f2c('0x47')](handleError(_0x4614a0,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index d164e27..7a969f1 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 _0x1c18=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x2e41d5,_0x47ebd9){var _0x3fcf11=function(_0xd9fb81){while(--_0xd9fb81){_0x2e41d5['push'](_0x2e41d5['shift']());}};_0x3fcf11(++_0x47ebd9);}(_0x1c18,0x106));var _0x81c1=function(_0x57a5e7,_0x595179){_0x57a5e7=_0x57a5e7-0x0;var _0x4f2ad7=_0x1c18[_0x57a5e7];return _0x4f2ad7;};'use strict';var _=require(_0x81c1('0x0'));var util=require(_0x81c1('0x1'));var logger=require(_0x81c1('0x2'))('api');var moment=require(_0x81c1('0x3'));var BPromise=require(_0x81c1('0x4'));var rp=require(_0x81c1('0x5'));var fs=require('fs');var path=require(_0x81c1('0x6'));var rimraf=require(_0x81c1('0x7'));var config=require(_0x81c1('0x8'));var attributes=require(_0x81c1('0x9'));module[_0x81c1('0xa')]=function(_0x1ab75c,_0x15edd3){return _0x1ab75c[_0x81c1('0xb')](_0x81c1('0xc'),attributes,{'tableName':_0x81c1('0xd'),'paranoid':![],'indexes':[{'name':_0x81c1('0xe'),'fields':[_0x81c1('0xf'),_0x81c1('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb881=['./intDynamics365Field.attributes','exports','define','Dynamics365Field','dynamics365_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x190991,_0x4673c3){var _0x3338f6=function(_0x550ce6){while(--_0x550ce6){_0x190991['push'](_0x190991['shift']());}};_0x3338f6(++_0x4673c3);}(_0xb881,0x110));var _0x1b88=function(_0x46ba12,_0x47cf95){_0x46ba12=_0x46ba12-0x0;var _0x3c2297=_0xb881[_0x46ba12];return _0x3c2297;};'use strict';var _=require('lodash');var util=require(_0x1b88('0x0'));var logger=require(_0x1b88('0x1'))(_0x1b88('0x2'));var moment=require(_0x1b88('0x3'));var BPromise=require(_0x1b88('0x4'));var rp=require(_0x1b88('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b88('0x6'));var config=require(_0x1b88('0x7'));var attributes=require(_0x1b88('0x8'));module[_0x1b88('0x9')]=function(_0x26b968,_0x537519){return _0x26b968[_0x1b88('0xa')](_0x1b88('0xb'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0x1b88('0xc'),'fields':[_0x1b88('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 31ac85e..d991c18 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 _0xbc48=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','catch'];(function(_0x29b6f1,_0x2e1812){var _0x22d27d=function(_0x508891){while(--_0x508891){_0x29b6f1['push'](_0x29b6f1['shift']());}};_0x22d27d(++_0x2e1812);}(_0xbc48,0x111));var _0x8bc4=function(_0x1c6476,_0x438e0e){_0x1c6476=_0x1c6476-0x0;var _0x9b7648=_0xbc48[_0x1c6476];return _0x9b7648;};'use strict';var _=require(_0x8bc4('0x0'));var util=require(_0x8bc4('0x1'));var moment=require(_0x8bc4('0x2'));var BPromise=require(_0x8bc4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bc4('0x4'));var db=require(_0x8bc4('0x5'))['db'];var utils=require(_0x8bc4('0x6'));var logger=require(_0x8bc4('0x7'))('rpc');var config=require(_0x8bc4('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xaaff2d,_0x5708fe,_0x58df27){return new BPromise(function(_0x19c07e,_0x4bec6c){return client[_0x8bc4('0x9')](_0xaaff2d,_0x58df27)[_0x8bc4('0xa')](function(_0x20229d){logger[_0x8bc4('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0x5708fe,_0x8bc4('0xc'));logger[_0x8bc4('0xd')](_0x8bc4('0xe'),_0x5708fe,_0x8bc4('0xc'),JSON[_0x8bc4('0xf')](_0x20229d));if(_0x20229d[_0x8bc4('0x10')]){if(_0x20229d[_0x8bc4('0x10')][_0x8bc4('0x11')]===0x1f4){logger[_0x8bc4('0x10')](_0x8bc4('0x12'),_0x5708fe,_0x20229d[_0x8bc4('0x10')][_0x8bc4('0x13')]);return _0x4bec6c(_0x20229d[_0x8bc4('0x10')][_0x8bc4('0x13')]);}logger[_0x8bc4('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x5708fe,_0x20229d[_0x8bc4('0x10')][_0x8bc4('0x13')]);return _0x19c07e(_0x20229d[_0x8bc4('0x10')][_0x8bc4('0x13')]);}else{logger[_0x8bc4('0xb')](_0x8bc4('0x12'),_0x5708fe,'request\x20sent');_0x19c07e(_0x20229d['result']['message']);}})[_0x8bc4('0x14')](function(_0x556cef){logger[_0x8bc4('0x10')](_0x8bc4('0x12'),_0x5708fe,_0x556cef);_0x4bec6c(_0x556cef);});});} \ No newline at end of file +var _0xa6ce=['error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../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'];(function(_0x215e12,_0x5d186c){var _0x2e4016=function(_0xeaf840){while(--_0xeaf840){_0x215e12['push'](_0x215e12['shift']());}};_0x2e4016(++_0x5d186c);}(_0xa6ce,0x15e));var _0xea6c=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xa6ce[_0x5834bc];return _0x3e183a;};'use strict';var _=require(_0xea6c('0x0'));var util=require('util');var moment=require(_0xea6c('0x1'));var BPromise=require(_0xea6c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea6c('0x3'));var db=require(_0xea6c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xea6c('0x5'));var config=require(_0xea6c('0x6'));var jayson=require(_0xea6c('0x7'));var client=jayson[_0xea6c('0x8')][_0xea6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8a751f,_0x5c3ba1,_0x2af078){return new BPromise(function(_0x3f1ce4,_0x1be5e8){return client[_0xea6c('0xa')](_0x8a751f,_0x2af078)[_0xea6c('0xb')](function(_0x227f1c){logger[_0xea6c('0xc')](_0xea6c('0xd'),_0x5c3ba1,_0xea6c('0xe'));logger[_0xea6c('0xf')](_0xea6c('0x10'),_0x5c3ba1,_0xea6c('0xe'),JSON[_0xea6c('0x11')](_0x227f1c));if(_0x227f1c[_0xea6c('0x12')]){if(_0x227f1c['error'][_0xea6c('0x13')]===0x1f4){logger[_0xea6c('0x12')](_0xea6c('0xd'),_0x5c3ba1,_0x227f1c['error'][_0xea6c('0x14')]);return _0x1be5e8(_0x227f1c[_0xea6c('0x12')]['message']);}logger[_0xea6c('0x12')](_0xea6c('0xd'),_0x5c3ba1,_0x227f1c[_0xea6c('0x12')][_0xea6c('0x14')]);return _0x3f1ce4(_0x227f1c[_0xea6c('0x12')][_0xea6c('0x14')]);}else{logger['info'](_0xea6c('0xd'),_0x5c3ba1,'request\x20sent');_0x3f1ce4(_0x227f1c[_0xea6c('0x15')][_0xea6c('0x14')]);}})[_0xea6c('0x16')](function(_0x105b0b){logger[_0xea6c('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x5c3ba1,_0x105b0b);_0x1be5e8(_0x105b0b);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index f5596dd..9b4c60e 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 _0x5663=['./intFreshdeskAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','/:id','update','delete','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2daea7,_0x41e7da){var _0x1f01bd=function(_0x39417b){while(--_0x39417b){_0x2daea7['push'](_0x2daea7['shift']());}};_0x1f01bd(++_0x41e7da);}(_0x5663,0x16f));var _0x3566=function(_0x2cd068,_0x7a0a83){_0x2cd068=_0x2cd068-0x0;var _0x1f2d00=_0x5663[_0x2cd068];return _0x1f2d00;};'use strict';var multer=require('multer');var util=require(_0x3566('0x0'));var path=require(_0x3566('0x1'));var timeout=require('connect-timeout');var express=require(_0x3566('0x2'));var router=express[_0x3566('0x3')]();var auth=require(_0x3566('0x4'));var interaction=require(_0x3566('0x5'));var config=require(_0x3566('0x6'));var controller=require(_0x3566('0x7'));router[_0x3566('0x8')]('/',auth[_0x3566('0x9')](),controller['index']);router[_0x3566('0x8')]('/:id',auth[_0x3566('0x9')](),controller['show']);router[_0x3566('0x8')](_0x3566('0xa'),auth[_0x3566('0x9')](),controller[_0x3566('0xb')]);router['get'](_0x3566('0xc'),auth[_0x3566('0x9')](),controller[_0x3566('0xd')]);router[_0x3566('0xe')]('/',auth[_0x3566('0x9')](),controller[_0x3566('0xf')]);router[_0x3566('0xe')]('/:id/configurations',auth[_0x3566('0x9')](),controller[_0x3566('0x10')]);router[_0x3566('0x11')](_0x3566('0x12'),auth[_0x3566('0x9')](),controller[_0x3566('0x13')]);router[_0x3566('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3566('0x15')]=router; \ No newline at end of file +var _0x2497=['./intFreshdeskAccount.controller','get','index','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','put','update','/:id','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x29c934,_0x3c30e2){var _0x4302de=function(_0x179a5a){while(--_0x179a5a){_0x29c934['push'](_0x29c934['shift']());}};_0x4302de(++_0x3c30e2);}(_0x2497,0xf6));var _0x7249=function(_0xb9c745,_0x39d98b){_0xb9c745=_0xb9c745-0x0;var _0x5f0165=_0x2497[_0xb9c745];return _0x5f0165;};'use strict';var multer=require(_0x7249('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7249('0x1'));var express=require(_0x7249('0x2'));var router=express[_0x7249('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x7249('0x4'));var config=require(_0x7249('0x5'));var controller=require(_0x7249('0x6'));router[_0x7249('0x7')]('/',auth['isAuthenticated'](),controller[_0x7249('0x8')]);router[_0x7249('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x7249('0x9')]);router['get'](_0x7249('0xa'),auth['isAuthenticated'](),controller[_0x7249('0xb')]);router[_0x7249('0x7')](_0x7249('0xc'),auth[_0x7249('0xd')](),controller[_0x7249('0xe')]);router[_0x7249('0xf')]('/',auth[_0x7249('0xd')](),controller[_0x7249('0x10')]);router['post'](_0x7249('0xa'),auth[_0x7249('0xd')](),controller['addConfiguration']);router[_0x7249('0x11')]('/:id',auth[_0x7249('0xd')](),controller[_0x7249('0x12')]);router['delete'](_0x7249('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x7249('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index f067c89..d8abd28 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 _0xa32b=['STRING','username','sequelize'];(function(_0x214377,_0x5d8d2a){var _0x275dbd=function(_0x15aac3){while(--_0x15aac3){_0x214377['push'](_0x214377['shift']());}};_0x275dbd(++_0x5d8d2a);}(_0xa32b,0x68));var _0xba32=function(_0x17ac5b,_0x1a2d16){_0x17ac5b=_0x17ac5b-0x0;var _0x2dcec9=_0xa32b[_0x17ac5b];return _0x2dcec9;};'use strict';var Sequelize=require(_0xba32('0x0'));module['exports']={'name':{'type':Sequelize[_0xba32('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0xba32('0x2')},'apiKey':{'type':Sequelize[_0xba32('0x1')]},'remoteUri':{'type':Sequelize[_0xba32('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xba32('0x1')]}}; \ No newline at end of file +var _0x731b=['username','remoteUri','sequelize','exports','STRING'];(function(_0x1b594a,_0x3af453){var _0x3a1a93=function(_0x5a1b14){while(--_0x5a1b14){_0x1b594a['push'](_0x1b594a['shift']());}};_0x3a1a93(++_0x3af453);}(_0x731b,0xf7));var _0xb731=function(_0x5232d7,_0x186b89){_0x5232d7=_0x5232d7-0x0;var _0x582b9b=_0x731b[_0x5232d7];return _0x582b9b;};'use strict';var Sequelize=require(_0xb731('0x0'));module[_0xb731('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb731('0x2')]},'username':{'type':Sequelize[_0xb731('0x2')],'unique':_0xb731('0x3')},'apiKey':{'type':Sequelize[_0xb731('0x2')]},'remoteUri':{'type':Sequelize[_0xb731('0x2')],'unique':_0xb731('0x4')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index d18651a..fafe976 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 _0x9957=['requester','subject','agent','priority','group','source','ticket_type','company','remove','includes','custom_text','custom_dropdown','label','choices','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','count','set','Content-Range','reject','update','end','stack','send','map','FreshdeskAccount','rawAttributes','type','key','model','name','query','filters','intersection','attributes','fields','limit','offset','sort','where','pick','filter','merge','VIRTUAL','include','findAll','params','keys','length','options','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','order','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X'];(function(_0x405430,_0xb490b8){var _0x2c1344=function(_0xb1cf4b){while(--_0xb1cf4b){_0x405430['push'](_0x405430['shift']());}};_0x2c1344(++_0xb490b8);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 db=require(_0x7995('0x19'))['db'];var integrations=require(_0x7995('0x1a'));var jayson=require(_0x7995('0x1b'));var client=jayson[_0x7995('0x1c')][_0x7995('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x23999f,_0x2bbe7a,_0x4cc004){if(_0x4cc004){var _0x58f5ad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58f5ad[_0x7995('0x1e')](_0x2bbe7a)){return _0x23999f;}else{throw new db[(_0x7995('0x1f'))][(_0x7995('0x20'))](_0x7995('0x21'));}}else{return _0x23999f;}}function respondWithRpcPromise(_0x3f1d3e,_0x1a5310,_0x2202ce,_0x41cbf0){return new BPromise(function(_0x5377e5,_0x2eeacc){var _0x565d97=_0x41cbf0||client;return _0x565d97[_0x7995('0x22')](_0x3f1d3e,_0x2202ce)[_0x7995('0x23')](function(_0x43d4b8){logger[_0x7995('0x24')](_0x7995('0x25'),_0x1a5310,_0x7995('0x26'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1a5310,_0x7995('0x26'),JSON['stringify'](_0x43d4b8));if(_0x43d4b8['error']){if(_0x43d4b8[_0x7995('0x27')][_0x7995('0x28')]===0x1f4){logger['error'](_0x7995('0x25'),_0x1a5310,_0x43d4b8['error']['message']);return _0x2eeacc(_0x43d4b8[_0x7995('0x27')][_0x7995('0x29')]);}logger[_0x7995('0x27')](_0x7995('0x25'),_0x1a5310,_0x43d4b8[_0x7995('0x27')][_0x7995('0x29')]);return _0x5377e5(_0x43d4b8['error'][_0x7995('0x29')]);}else{logger[_0x7995('0x24')](_0x7995('0x25'),_0x1a5310,_0x7995('0x26'));_0x5377e5(_0x43d4b8[_0x7995('0x2a')][_0x7995('0x29')]);}})[_0x7995('0x2b')](function(_0x472195){logger['error'](_0x7995('0x25'),_0x1a5310,_0x472195);_0x2eeacc(_0x472195);});});}function respondWithStatusCode(_0x34e70c,_0x401dc3){_0x401dc3=_0x401dc3||0xcc;return function(_0x268ce7){if(_0x268ce7){return _0x34e70c[_0x7995('0x2c')](_0x401dc3);}return _0x34e70c[_0x7995('0x2d')](_0x401dc3)['end']();};}function respondWithResult(_0x47625f,_0x5911c3){_0x5911c3=_0x5911c3||0xc8;return function(_0x229742){if(_0x229742){return _0x47625f[_0x7995('0x2d')](_0x5911c3)[_0x7995('0x2e')](_0x229742);}};}function respondWithFilteredResult(_0x132a42,_0x11c1eb){return function(_0x4b6f99){if(_0x4b6f99){var _0x9b2a15=_0x4b6f99[_0x7995('0x2f')],_0x514445=_0x11c1eb['offset'],_0x456a28=_0x11c1eb['offset']+_0x11c1eb['limit'],_0x3250e0;if(_0x456a28>=_0x9b2a15){_0x456a28=_0x9b2a15;_0x3250e0=0xc8;}else{_0x3250e0=0xce;}_0x132a42[_0x7995('0x2d')](_0x3250e0);return _0x132a42[_0x7995('0x30')](_0x7995('0x31'),_0x514445+'-'+_0x456a28+'/'+_0x9b2a15)[_0x7995('0x2e')](_0x4b6f99);}return null;};}function patchUpdates(_0x2e3493){return function(_0x1ca460){try{jsonpatch['apply'](_0x1ca460,_0x2e3493,!![]);}catch(_0x481c74){return BPromise[_0x7995('0x32')](_0x481c74);}return _0x1ca460['save']();};}function saveUpdates(_0x553671,_0x3eb566){return function(_0x29fac5){if(_0x29fac5){return _0x29fac5[_0x7995('0x33')](_0x553671)[_0x7995('0x23')](function(_0x510841){return _0x510841;});}return null;};}function removeEntity(_0x44309d,_0x33e24e){return function(_0x5dd802){if(_0x5dd802){return _0x5dd802['destroy']()['then'](function(){_0x44309d[_0x7995('0x2d')](0xcc)[_0x7995('0x34')]();});}};}function handleEntityNotFound(_0x4a176f,_0x3e7020){return function(_0x51b95d){if(!_0x51b95d){_0x4a176f[_0x7995('0x2c')](0x194);}return _0x51b95d;};}function handleError(_0x1cb058,_0x177cb4){_0x177cb4=_0x177cb4||0x1f4;return function(_0x5014d2){logger['error'](_0x5014d2[_0x7995('0x35')]);if(_0x5014d2['name']){delete _0x5014d2['name'];}_0x1cb058[_0x7995('0x2d')](_0x177cb4)[_0x7995('0x36')](_0x5014d2);};}exports['index']=function(_0x1baa15,_0x1922b4){var _0x2b772f={},_0x18667c={},_0x1e3dbf={'count':0x0,'rows':[]};var _0x53002a=_[_0x7995('0x37')](db[_0x7995('0x38')][_0x7995('0x39')],function(_0x1d60b8){return{'name':_0x1d60b8['fieldName'],'type':_0x1d60b8[_0x7995('0x3a')][_0x7995('0x3b')]};});_0x18667c[_0x7995('0x3c')]=_[_0x7995('0x37')](_0x53002a,_0x7995('0x3d'));_0x18667c[_0x7995('0x3e')]=_['keys'](_0x1baa15[_0x7995('0x3e')]);_0x18667c[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x18667c[_0x7995('0x3c')],_0x18667c[_0x7995('0x3e')]);_0x2b772f[_0x7995('0x41')]=_[_0x7995('0x40')](_0x18667c[_0x7995('0x3c')],qs[_0x7995('0x42')](_0x1baa15[_0x7995('0x3e')][_0x7995('0x42')]));_0x2b772f[_0x7995('0x41')]=_0x2b772f[_0x7995('0x41')]['length']?_0x2b772f['attributes']:_0x18667c[_0x7995('0x3c')];if(!_0x1baa15[_0x7995('0x3e')]['hasOwnProperty']('nolimit')){_0x2b772f[_0x7995('0x43')]=qs['limit'](_0x1baa15['query'][_0x7995('0x43')]);_0x2b772f[_0x7995('0x44')]=qs[_0x7995('0x44')](_0x1baa15['query'][_0x7995('0x44')]);}_0x2b772f['order']=qs[_0x7995('0x45')](_0x1baa15['query']['sort']);_0x2b772f[_0x7995('0x46')]=qs[_0x7995('0x3f')](_[_0x7995('0x47')](_0x1baa15[_0x7995('0x3e')],_0x18667c['filters']),_0x53002a);if(_0x1baa15[_0x7995('0x3e')][_0x7995('0x48')]){_0x2b772f[_0x7995('0x46')]=_[_0x7995('0x49')](_0x2b772f['where'],{'$or':_['map'](_0x53002a,function(_0x1c37c6){if(_0x1c37c6['type']!==_0x7995('0x4a')){var _0x59c153={};_0x59c153[_0x1c37c6[_0x7995('0x3d')]]={'$like':'%'+_0x1baa15['query'][_0x7995('0x48')]+'%'};return _0x59c153;}})});}_0x2b772f=_[_0x7995('0x49')]({},_0x2b772f,_0x1baa15['options']);var _0x3e9e62={'where':_0x2b772f[_0x7995('0x46')]};return db[_0x7995('0x38')][_0x7995('0x2f')](_0x3e9e62)['then'](function(_0x2458cb){_0x1e3dbf[_0x7995('0x2f')]=_0x2458cb;if(_0x1baa15[_0x7995('0x3e')]['includeAll']){_0x2b772f[_0x7995('0x4b')]=[{'all':!![]}];}return db[_0x7995('0x38')][_0x7995('0x4c')](_0x2b772f);})[_0x7995('0x23')](function(_0x255313){_0x1e3dbf['rows']=_0x255313;return _0x1e3dbf;})[_0x7995('0x23')](respondWithFilteredResult(_0x1922b4,_0x2b772f))[_0x7995('0x2b')](handleError(_0x1922b4,null));};exports['show']=function(_0x3d1dbb,_0x5843ba){var _0x1d87f9={'raw':![],'where':{'id':_0x3d1dbb[_0x7995('0x4d')]['id']}},_0x187735={};_0x187735[_0x7995('0x3c')]=_[_0x7995('0x4e')](db[_0x7995('0x38')][_0x7995('0x39')]);_0x187735['query']=_[_0x7995('0x4e')](_0x3d1dbb[_0x7995('0x3e')]);_0x187735[_0x7995('0x3f')]=_['intersection'](_0x187735[_0x7995('0x3c')],_0x187735[_0x7995('0x3e')]);_0x1d87f9[_0x7995('0x41')]=_['intersection'](_0x187735['model'],qs['fields'](_0x3d1dbb[_0x7995('0x3e')][_0x7995('0x42')]));_0x1d87f9['attributes']=_0x1d87f9[_0x7995('0x41')][_0x7995('0x4f')]?_0x1d87f9[_0x7995('0x41')]:_0x187735[_0x7995('0x3c')];if(_0x3d1dbb[_0x7995('0x3e')]['includeAll']){_0x1d87f9[_0x7995('0x4b')]=[{'all':!![]}];}_0x1d87f9=_['merge']({},_0x1d87f9,_0x3d1dbb[_0x7995('0x50')]);return db[_0x7995('0x38')][_0x7995('0x51')](_0x1d87f9)['then'](handleEntityNotFound(_0x5843ba,null))['then'](respondWithResult(_0x5843ba,null))['catch'](handleError(_0x5843ba,null));};exports['create']=function(_0x2e13b0,_0x3709de){return db[_0x7995('0x38')][_0x7995('0x52')](_0x2e13b0[_0x7995('0x53')],{})[_0x7995('0x23')](respondWithResult(_0x3709de,0xc9))[_0x7995('0x2b')](handleError(_0x3709de,null));};exports[_0x7995('0x33')]=function(_0x328671,_0x17ecd3){if(_0x328671[_0x7995('0x53')]['id']){delete _0x328671[_0x7995('0x53')]['id'];}return db[_0x7995('0x38')][_0x7995('0x51')]({'where':{'id':_0x328671[_0x7995('0x4d')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x17ecd3,null))[_0x7995('0x23')](saveUpdates(_0x328671[_0x7995('0x53')],null))[_0x7995('0x23')](respondWithResult(_0x17ecd3,null))['catch'](handleError(_0x17ecd3,null));};exports[_0x7995('0x54')]=function(_0x630737,_0x3b8a54){return db[_0x7995('0x38')]['find']({'where':{'id':_0x630737['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x3b8a54,null))[_0x7995('0x23')](removeEntity(_0x3b8a54,null))[_0x7995('0x2b')](handleError(_0x3b8a54,null));};exports[_0x7995('0x55')]=function(_0x51c50b,_0x13cd7b,_0x74ff38){var _0xef5044={};var _0x33c49c={};var _0x502d43;var _0x5e2d97;return db[_0x7995('0x38')][_0x7995('0x56')]({'where':{'id':_0x51c50b[_0x7995('0x4d')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x13cd7b,null))[_0x7995('0x23')](function(_0x27c5cd){if(_0x27c5cd){_0x502d43=_0x27c5cd;_0x33c49c[_0x7995('0x3c')]=_[_0x7995('0x4e')](db[_0x7995('0x57')]['rawAttributes']);_0x33c49c[_0x7995('0x3e')]=_[_0x7995('0x4e')](_0x51c50b[_0x7995('0x3e')]);_0x33c49c[_0x7995('0x3f')]=_['intersection'](_0x33c49c['model'],_0x33c49c[_0x7995('0x3e')]);_0xef5044[_0x7995('0x41')]=_['intersection'](_0x33c49c[_0x7995('0x3c')],qs[_0x7995('0x42')](_0x51c50b[_0x7995('0x3e')][_0x7995('0x42')]));_0xef5044[_0x7995('0x41')]=_0xef5044['attributes'][_0x7995('0x4f')]?_0xef5044['attributes']:_0x33c49c[_0x7995('0x3c')];_0xef5044[_0x7995('0x58')]=qs[_0x7995('0x45')](_0x51c50b[_0x7995('0x3e')][_0x7995('0x45')]);_0xef5044[_0x7995('0x46')]=qs[_0x7995('0x3f')](_[_0x7995('0x47')](_0x51c50b[_0x7995('0x3e')],_0x33c49c[_0x7995('0x3f')]));if(_0x51c50b[_0x7995('0x3e')][_0x7995('0x48')]){_0xef5044['where']=_[_0x7995('0x49')](_0xef5044[_0x7995('0x46')],{'$or':_[_0x7995('0x37')](_0xef5044[_0x7995('0x41')],function(_0x2c6548){var _0x54a2e0={};_0x54a2e0[_0x2c6548]={'$like':'%'+_0x51c50b['query'][_0x7995('0x48')]+'%'};return _0x54a2e0;})});}_0xef5044=_[_0x7995('0x49')]({},_0xef5044,_0x51c50b[_0x7995('0x50')]);return _0x502d43[_0x7995('0x55')](_0xef5044);}})['then'](function(_0x22d317){if(_0x22d317){_0x5e2d97=_0x22d317['length'];if(!_0x51c50b['query'][_0x7995('0x59')](_0x7995('0x5a'))){_0xef5044[_0x7995('0x43')]=qs[_0x7995('0x43')](_0x51c50b[_0x7995('0x3e')][_0x7995('0x43')]);_0xef5044[_0x7995('0x44')]=qs[_0x7995('0x44')](_0x51c50b[_0x7995('0x3e')][_0x7995('0x44')]);}return _0x502d43['getConfigurations'](_0xef5044);}})[_0x7995('0x23')](function(_0x8908cd){if(_0x8908cd){return _0x8908cd?{'count':_0x5e2d97,'rows':_0x8908cd}:null;}})[_0x7995('0x23')](respondWithResult(_0x13cd7b,null))['catch'](handleError(_0x13cd7b,null));};exports[_0x7995('0x5b')]=function(_0x1d2f9d,_0x705f0,_0x3a7d9d){if(_0x1d2f9d[_0x7995('0x53')]['id']){delete _0x1d2f9d[_0x7995('0x53')]['id'];}return db[_0x7995('0x38')][_0x7995('0x56')]({'where':{'id':_0x1d2f9d[_0x7995('0x4d')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x705f0,null))[_0x7995('0x23')](function(_0x535131){if(_0x535131){_0x1d2f9d['body'][_0x7995('0x5c')]=_0x535131['id'];_0x1d2f9d[_0x7995('0x53')][_0x7995('0x5d')]=integrations[_0x7995('0x5e')](_0x1d2f9d['body'][_0x7995('0x5f')],_0x1d2f9d[_0x7995('0x53')]['type']);_0x1d2f9d['body'][_0x7995('0x60')]=integrations[_0x7995('0x61')](_0x1d2f9d['body'][_0x7995('0x5f')],_0x1d2f9d['body'][_0x7995('0x3a')]);return db[_0x7995('0x57')]['create'](_0x1d2f9d['body'],{'include':[{'model':db[_0x7995('0x62')],'as':'Subjects'},{'model':db[_0x7995('0x62')],'as':_0x7995('0x60')}]});}return null;})[_0x7995('0x23')](respondWithResult(_0x705f0,null))[_0x7995('0x2b')](handleError(_0x705f0,null));};exports[_0x7995('0x63')]=function(_0x18cff7,_0x8af865,_0x14cb17){var _0x29e0ee='';return db[_0x7995('0x38')][_0x7995('0x56')]({'where':{'id':_0x18cff7[_0x7995('0x4d')]['id']},'attributes':['id',_0x7995('0x64'),_0x7995('0x65')]})[_0x7995('0x23')](handleEntityNotFound(_0x8af865,null))[_0x7995('0x23')](function(_0x6ad274){if(_0x6ad274){_0x29e0ee=_0x6ad274[_0x7995('0x64')];var _0x2ff7ba=_0x29e0ee[_0x7995('0x66')](-0x1);if(_0x2ff7ba==='/'){_0x29e0ee=_0x29e0ee[_0x7995('0x67')](0x0,_0x29e0ee[_0x7995('0x68')](_0x2ff7ba));}return rp({'method':_0x7995('0x69'),'uri':util[_0x7995('0x6a')](_0x7995('0x6b'),_0x29e0ee,_0x7995('0x6c')),'headers':{'Authorization':util[_0x7995('0x6a')](_0x7995('0x6d'),new Buffer(util['format'](_0x7995('0x6e'),_0x6ad274[_0x7995('0x65')]))['toString']('base64'))},'json':!![]});}})[_0x7995('0x23')](function(_0x3fe8fc){if(_0x3fe8fc){var _0x2d45d5=[_0x7995('0x6f'),_0x7995('0x70'),_0x7995('0x71'),'description',_0x7995('0x2d'),_0x7995('0x72'),_0x7995('0x73'),_0x7995('0x74'),_0x7995('0x75'),_0x7995('0x73'),_0x7995('0x76')];_[_0x7995('0x77')](_0x3fe8fc,function(_0x560095){return _0x2d45d5[_0x7995('0x78')](_0x560095[_0x7995('0x3d')])||!_0x560095['default']&&_0x560095['type']!==_0x7995('0x79')&&_0x560095[_0x7995('0x3a')]!==_0x7995('0x7a');});return{'count':_0x3fe8fc[_0x7995('0x4f')],'rows':_[_0x7995('0x37')](_0x3fe8fc,function(_0x4a02ea){return{'id':_0x4a02ea[_0x7995('0x3d')],'name':_0x4a02ea[_0x7995('0x7b')],'custom':!_0x4a02ea['default'],'options':_0x4a02ea[_0x7995('0x7c')]?_[_0x7995('0x37')](_0x4a02ea['choices'],function(_0x1535a3){return{'name':_['capitalize'](_0x1535a3),'value':_0x1535a3};}):[]};})};}})[_0x7995('0x23')](respondWithResult(_0x8af865,null))[_0x7995('0x2b')](function(_0x3ab421){var _0x428a1b=_0x18cff7[_0x7995('0x3e')]['test']?0x1f4:_0x3ab421[_0x7995('0x7d')]||0x1f4;logger[_0x7995('0x27')](_0x7995('0x7e'),'getFields',_0x428a1b,JSON[_0x7995('0x7f')](_0x3ab421));delete _0x3ab421[_0x7995('0x3d')];if(_0x428a1b===0x191){_0x428a1b=0x190;}_0x8af865[_0x7995('0x2d')](_0x428a1b)[_0x7995('0x36')](_0x18cff7['query'][_0x7995('0x1e')]?{'message':_0x7995('0x80'),'statusCode':_0x3ab421[_0x7995('0x7d')]}:_0x3ab421);});}; \ No newline at end of file +var _0x1cb9=['reject','save','update','destroy','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','count','includeAll','findAll','keys','include','find','create','body','params','getConfigurations','findOne','order','pick','addConfiguration','AccountId','Descriptions','channel','FreshdeskConfiguration','Subjects','FreshdeskField','getFields','remoteUri','slice','substring','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','base64','requester','subject','agent','description','priority','group','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','http','Sequelize','ValidationError','then','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','sendStatus','end','status','offset','limit','set','Content-Range','json','apply'];(function(_0x2c6705,_0x5f0836){var _0x1212b1=function(_0x2234a4){while(--_0x2234a4){_0x2c6705['push'](_0x2c6705['shift']());}};_0x1212b1(++_0x5f0836);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4001fe,_0x5c5ada){_0x4001fe=_0x4001fe-0x0;var _0x203062=_0x1cb9[_0x4001fe];return _0x203062;};'use strict';var pdf=require(_0x91cb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x91cb('0x1'));var zipdir=require(_0x91cb('0x2'));var jsonpatch=require(_0x91cb('0x3'));var rp=require(_0x91cb('0x4'));var moment=require('moment');var BPromise=require(_0x91cb('0x5'));var Mustache=require(_0x91cb('0x6'));var util=require('util');var path=require(_0x91cb('0x7'));var sox=require(_0x91cb('0x8'));var csv=require(_0x91cb('0x9'));var ejs=require(_0x91cb('0xa'));var fs=require('fs');var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x9'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x91cb('0x18'));var jayson=require(_0x91cb('0x19'));var client=jayson['client'][_0x91cb('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3ea707,_0x44f2e9,_0x2c7d40){if(_0x2c7d40){var _0x4a7d45=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4a7d45['test'](_0x44f2e9)){return _0x3ea707;}else{throw new db[(_0x91cb('0x1b'))][(_0x91cb('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3ea707;}}function respondWithRpcPromise(_0x528f73,_0x576369,_0xc3629e,_0x347980){return new BPromise(function(_0x5ea796,_0x238f11){var _0x135890=_0x347980||client;return _0x135890['request'](_0x528f73,_0xc3629e)[_0x91cb('0x1d')](function(_0x139f4b){logger[_0x91cb('0x1e')](_0x91cb('0x1f'),_0x576369,'request\x20sent');logger[_0x91cb('0x20')](_0x91cb('0x21'),_0x576369,'request\x20sent',JSON[_0x91cb('0x22')](_0x139f4b));if(_0x139f4b['error']){if(_0x139f4b['error'][_0x91cb('0x23')]===0x1f4){logger[_0x91cb('0x24')]('FreshdeskAccount,\x20%s,\x20%s',_0x576369,_0x139f4b['error']['message']);return _0x238f11(_0x139f4b[_0x91cb('0x24')][_0x91cb('0x25')]);}logger[_0x91cb('0x24')](_0x91cb('0x1f'),_0x576369,_0x139f4b['error'][_0x91cb('0x25')]);return _0x5ea796(_0x139f4b[_0x91cb('0x24')][_0x91cb('0x25')]);}else{logger['info'](_0x91cb('0x1f'),_0x576369,_0x91cb('0x26'));_0x5ea796(_0x139f4b[_0x91cb('0x27')][_0x91cb('0x25')]);}})[_0x91cb('0x28')](function(_0x7ad361){logger[_0x91cb('0x24')](_0x91cb('0x1f'),_0x576369,_0x7ad361);_0x238f11(_0x7ad361);});});}function respondWithStatusCode(_0x264e9b,_0x4c8438){_0x4c8438=_0x4c8438||0xcc;return function(_0x59bf3a){if(_0x59bf3a){return _0x264e9b[_0x91cb('0x29')](_0x4c8438);}return _0x264e9b['status'](_0x4c8438)[_0x91cb('0x2a')]();};}function respondWithResult(_0x34d372,_0x318031){_0x318031=_0x318031||0xc8;return function(_0x5595c5){if(_0x5595c5){return _0x34d372[_0x91cb('0x2b')](_0x318031)['json'](_0x5595c5);}};}function respondWithFilteredResult(_0x4572f6,_0x308e8c){return function(_0x3b3ee6){if(_0x3b3ee6){var _0x2fb473=_0x3b3ee6['count'],_0x468908=_0x308e8c[_0x91cb('0x2c')],_0x504275=_0x308e8c[_0x91cb('0x2c')]+_0x308e8c[_0x91cb('0x2d')],_0x2f04a3;if(_0x504275>=_0x2fb473){_0x504275=_0x2fb473;_0x2f04a3=0xc8;}else{_0x2f04a3=0xce;}_0x4572f6['status'](_0x2f04a3);return _0x4572f6[_0x91cb('0x2e')](_0x91cb('0x2f'),_0x468908+'-'+_0x504275+'/'+_0x2fb473)[_0x91cb('0x30')](_0x3b3ee6);}return null;};}function patchUpdates(_0x361e4c){return function(_0xf296bc){try{jsonpatch[_0x91cb('0x31')](_0xf296bc,_0x361e4c,!![]);}catch(_0x1e5bf1){return BPromise[_0x91cb('0x32')](_0x1e5bf1);}return _0xf296bc[_0x91cb('0x33')]();};}function saveUpdates(_0x5e6ed3,_0x2ccf6e){return function(_0x474a15){if(_0x474a15){return _0x474a15[_0x91cb('0x34')](_0x5e6ed3)[_0x91cb('0x1d')](function(_0x440060){return _0x440060;});}return null;};}function removeEntity(_0x4e70cd,_0x2409d3){return function(_0x74b443){if(_0x74b443){return _0x74b443[_0x91cb('0x35')]()[_0x91cb('0x1d')](function(){_0x4e70cd[_0x91cb('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x121c37,_0x5927cb){return function(_0x47fc17){if(!_0x47fc17){_0x121c37['sendStatus'](0x194);}return _0x47fc17;};}function handleError(_0x2011fc,_0x4bba88){_0x4bba88=_0x4bba88||0x1f4;return function(_0x341ebe){logger['error'](_0x341ebe['stack']);if(_0x341ebe[_0x91cb('0x36')]){delete _0x341ebe[_0x91cb('0x36')];}_0x2011fc[_0x91cb('0x2b')](_0x4bba88)[_0x91cb('0x37')](_0x341ebe);};}exports[_0x91cb('0x38')]=function(_0x4b0ca6,_0x8beb3a){var _0x3ddc0b={},_0x13a5ea={},_0x8496a3={'count':0x0,'rows':[]};var _0x486a89=_['map'](db[_0x91cb('0x39')][_0x91cb('0x3a')],function(_0x56d614){return{'name':_0x56d614[_0x91cb('0x3b')],'type':_0x56d614[_0x91cb('0x3c')]['key']};});_0x13a5ea[_0x91cb('0x3d')]=_[_0x91cb('0x3e')](_0x486a89,'name');_0x13a5ea[_0x91cb('0x3f')]=_['keys'](_0x4b0ca6[_0x91cb('0x3f')]);_0x13a5ea[_0x91cb('0x40')]=_[_0x91cb('0x41')](_0x13a5ea[_0x91cb('0x3d')],_0x13a5ea[_0x91cb('0x3f')]);_0x3ddc0b[_0x91cb('0x42')]=_['intersection'](_0x13a5ea[_0x91cb('0x3d')],qs[_0x91cb('0x43')](_0x4b0ca6['query'][_0x91cb('0x43')]));_0x3ddc0b['attributes']=_0x3ddc0b[_0x91cb('0x42')][_0x91cb('0x44')]?_0x3ddc0b[_0x91cb('0x42')]:_0x13a5ea[_0x91cb('0x3d')];if(!_0x4b0ca6['query'][_0x91cb('0x45')](_0x91cb('0x46'))){_0x3ddc0b[_0x91cb('0x2d')]=qs[_0x91cb('0x2d')](_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x2d')]);_0x3ddc0b[_0x91cb('0x2c')]=qs[_0x91cb('0x2c')](_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x2c')]);}_0x3ddc0b['order']=qs[_0x91cb('0x47')](_0x4b0ca6['query'][_0x91cb('0x47')]);_0x3ddc0b['where']=qs[_0x91cb('0x40')](_['pick'](_0x4b0ca6[_0x91cb('0x3f')],_0x13a5ea[_0x91cb('0x40')]),_0x486a89);if(_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x48')]){_0x3ddc0b['where']=_[_0x91cb('0x49')](_0x3ddc0b[_0x91cb('0x4a')],{'$or':_['map'](_0x486a89,function(_0x461e1e){if(_0x461e1e[_0x91cb('0x3c')]!==_0x91cb('0x4b')){var _0x32517d={};_0x32517d[_0x461e1e[_0x91cb('0x36')]]={'$like':'%'+_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x48')]+'%'};return _0x32517d;}})});}_0x3ddc0b=_[_0x91cb('0x49')]({},_0x3ddc0b,_0x4b0ca6[_0x91cb('0x4c')]);var _0x4b26f6={'where':_0x3ddc0b[_0x91cb('0x4a')]};return db[_0x91cb('0x39')][_0x91cb('0x4d')](_0x4b26f6)[_0x91cb('0x1d')](function(_0x3314cc){_0x8496a3[_0x91cb('0x4d')]=_0x3314cc;if(_0x4b0ca6[_0x91cb('0x3f')][_0x91cb('0x4e')]){_0x3ddc0b['include']=[{'all':!![]}];}return db[_0x91cb('0x39')][_0x91cb('0x4f')](_0x3ddc0b);})[_0x91cb('0x1d')](function(_0x3b8cfd){_0x8496a3['rows']=_0x3b8cfd;return _0x8496a3;})[_0x91cb('0x1d')](respondWithFilteredResult(_0x8beb3a,_0x3ddc0b))[_0x91cb('0x28')](handleError(_0x8beb3a,null));};exports['show']=function(_0x212473,_0x47cdb7){var _0x2c419b={'raw':![],'where':{'id':_0x212473['params']['id']}},_0x4c0acd={};_0x4c0acd['model']=_[_0x91cb('0x50')](db[_0x91cb('0x39')][_0x91cb('0x3a')]);_0x4c0acd[_0x91cb('0x3f')]=_[_0x91cb('0x50')](_0x212473['query']);_0x4c0acd['filters']=_[_0x91cb('0x41')](_0x4c0acd[_0x91cb('0x3d')],_0x4c0acd[_0x91cb('0x3f')]);_0x2c419b[_0x91cb('0x42')]=_['intersection'](_0x4c0acd['model'],qs['fields'](_0x212473[_0x91cb('0x3f')]['fields']));_0x2c419b[_0x91cb('0x42')]=_0x2c419b['attributes'][_0x91cb('0x44')]?_0x2c419b[_0x91cb('0x42')]:_0x4c0acd[_0x91cb('0x3d')];if(_0x212473[_0x91cb('0x3f')][_0x91cb('0x4e')]){_0x2c419b[_0x91cb('0x51')]=[{'all':!![]}];}_0x2c419b=_[_0x91cb('0x49')]({},_0x2c419b,_0x212473[_0x91cb('0x4c')]);return db[_0x91cb('0x39')][_0x91cb('0x52')](_0x2c419b)[_0x91cb('0x1d')](handleEntityNotFound(_0x47cdb7,null))['then'](respondWithResult(_0x47cdb7,null))[_0x91cb('0x28')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x53')]=function(_0x4d7a34,_0x3f719b){return db[_0x91cb('0x39')]['create'](_0x4d7a34[_0x91cb('0x54')],{})[_0x91cb('0x1d')](respondWithResult(_0x3f719b,0xc9))[_0x91cb('0x28')](handleError(_0x3f719b,null));};exports[_0x91cb('0x34')]=function(_0x43ddee,_0x42a9ef){if(_0x43ddee[_0x91cb('0x54')]['id']){delete _0x43ddee[_0x91cb('0x54')]['id'];}return db[_0x91cb('0x39')][_0x91cb('0x52')]({'where':{'id':_0x43ddee[_0x91cb('0x55')]['id']}})['then'](handleEntityNotFound(_0x42a9ef,null))[_0x91cb('0x1d')](saveUpdates(_0x43ddee['body'],null))[_0x91cb('0x1d')](respondWithResult(_0x42a9ef,null))['catch'](handleError(_0x42a9ef,null));};exports[_0x91cb('0x35')]=function(_0x1b2fec,_0x1986d7){return db['FreshdeskAccount'][_0x91cb('0x52')]({'where':{'id':_0x1b2fec[_0x91cb('0x55')]['id']}})['then'](handleEntityNotFound(_0x1986d7,null))[_0x91cb('0x1d')](removeEntity(_0x1986d7,null))[_0x91cb('0x28')](handleError(_0x1986d7,null));};exports[_0x91cb('0x56')]=function(_0x25548b,_0x48e825,_0x2f5658){var _0x3854e9={};var _0x4250c2={};var _0x373076;var _0x55a0e3;return db[_0x91cb('0x39')][_0x91cb('0x57')]({'where':{'id':_0x25548b['params']['id']}})['then'](handleEntityNotFound(_0x48e825,null))[_0x91cb('0x1d')](function(_0x525021){if(_0x525021){_0x373076=_0x525021;_0x4250c2[_0x91cb('0x3d')]=_[_0x91cb('0x50')](db['FreshdeskConfiguration']['rawAttributes']);_0x4250c2[_0x91cb('0x3f')]=_['keys'](_0x25548b[_0x91cb('0x3f')]);_0x4250c2[_0x91cb('0x40')]=_[_0x91cb('0x41')](_0x4250c2['model'],_0x4250c2[_0x91cb('0x3f')]);_0x3854e9['attributes']=_[_0x91cb('0x41')](_0x4250c2[_0x91cb('0x3d')],qs[_0x91cb('0x43')](_0x25548b[_0x91cb('0x3f')]['fields']));_0x3854e9[_0x91cb('0x42')]=_0x3854e9[_0x91cb('0x42')][_0x91cb('0x44')]?_0x3854e9[_0x91cb('0x42')]:_0x4250c2[_0x91cb('0x3d')];_0x3854e9[_0x91cb('0x58')]=qs[_0x91cb('0x47')](_0x25548b[_0x91cb('0x3f')][_0x91cb('0x47')]);_0x3854e9[_0x91cb('0x4a')]=qs[_0x91cb('0x40')](_[_0x91cb('0x59')](_0x25548b['query'],_0x4250c2[_0x91cb('0x40')]));if(_0x25548b[_0x91cb('0x3f')][_0x91cb('0x48')]){_0x3854e9[_0x91cb('0x4a')]=_[_0x91cb('0x49')](_0x3854e9[_0x91cb('0x4a')],{'$or':_[_0x91cb('0x3e')](_0x3854e9['attributes'],function(_0x325b2d){var _0x5a3c7d={};_0x5a3c7d[_0x325b2d]={'$like':'%'+_0x25548b[_0x91cb('0x3f')][_0x91cb('0x48')]+'%'};return _0x5a3c7d;})});}_0x3854e9=_[_0x91cb('0x49')]({},_0x3854e9,_0x25548b[_0x91cb('0x4c')]);return _0x373076['getConfigurations'](_0x3854e9);}})[_0x91cb('0x1d')](function(_0x22ab40){if(_0x22ab40){_0x55a0e3=_0x22ab40[_0x91cb('0x44')];if(!_0x25548b[_0x91cb('0x3f')][_0x91cb('0x45')](_0x91cb('0x46'))){_0x3854e9['limit']=qs[_0x91cb('0x2d')](_0x25548b[_0x91cb('0x3f')][_0x91cb('0x2d')]);_0x3854e9[_0x91cb('0x2c')]=qs[_0x91cb('0x2c')](_0x25548b[_0x91cb('0x3f')][_0x91cb('0x2c')]);}return _0x373076[_0x91cb('0x56')](_0x3854e9);}})[_0x91cb('0x1d')](function(_0x457f81){if(_0x457f81){return _0x457f81?{'count':_0x55a0e3,'rows':_0x457f81}:null;}})[_0x91cb('0x1d')](respondWithResult(_0x48e825,null))[_0x91cb('0x28')](handleError(_0x48e825,null));};exports[_0x91cb('0x5a')]=function(_0x3eead5,_0x2d2613,_0x2605c3){if(_0x3eead5[_0x91cb('0x54')]['id']){delete _0x3eead5['body']['id'];}return db[_0x91cb('0x39')][_0x91cb('0x57')]({'where':{'id':_0x3eead5['params']['id']}})[_0x91cb('0x1d')](handleEntityNotFound(_0x2d2613,null))[_0x91cb('0x1d')](function(_0x1c3e0a){if(_0x1c3e0a){_0x3eead5['body'][_0x91cb('0x5b')]=_0x1c3e0a['id'];_0x3eead5[_0x91cb('0x54')]['Subjects']=integrations['getSubjects'](_0x3eead5[_0x91cb('0x54')]['channel'],_0x3eead5[_0x91cb('0x54')][_0x91cb('0x3c')]);_0x3eead5['body'][_0x91cb('0x5c')]=integrations['getDescriptions'](_0x3eead5[_0x91cb('0x54')][_0x91cb('0x5d')],_0x3eead5['body']['type']);return db[_0x91cb('0x5e')][_0x91cb('0x53')](_0x3eead5[_0x91cb('0x54')],{'include':[{'model':db['FreshdeskField'],'as':_0x91cb('0x5f')},{'model':db[_0x91cb('0x60')],'as':_0x91cb('0x5c')}]});}return null;})[_0x91cb('0x1d')](respondWithResult(_0x2d2613,null))['catch'](handleError(_0x2d2613,null));};exports[_0x91cb('0x61')]=function(_0x4ee1e3,_0x342587,_0x4118eb){var _0x30c607='';return db[_0x91cb('0x39')]['findOne']({'where':{'id':_0x4ee1e3['params']['id']},'attributes':['id',_0x91cb('0x62'),'apiKey']})[_0x91cb('0x1d')](handleEntityNotFound(_0x342587,null))[_0x91cb('0x1d')](function(_0x2ede77){if(_0x2ede77){_0x30c607=_0x2ede77[_0x91cb('0x62')];var _0x33d4ab=_0x30c607[_0x91cb('0x63')](-0x1);if(_0x33d4ab==='/'){_0x30c607=_0x30c607[_0x91cb('0x64')](0x0,_0x30c607['lastIndexOf'](_0x33d4ab));}return rp({'method':_0x91cb('0x65'),'uri':util[_0x91cb('0x66')]('%s/%s',_0x30c607,_0x91cb('0x67')),'headers':{'Authorization':util['format'](_0x91cb('0x68'),new Buffer(util[_0x91cb('0x66')](_0x91cb('0x69'),_0x2ede77[_0x91cb('0x6a')]))[_0x91cb('0x6b')](_0x91cb('0x6c')))},'json':!![]});}})[_0x91cb('0x1d')](function(_0x30259d){if(_0x30259d){var _0x23380a=[_0x91cb('0x6d'),_0x91cb('0x6e'),_0x91cb('0x6f'),_0x91cb('0x70'),_0x91cb('0x2b'),_0x91cb('0x71'),_0x91cb('0x72'),'source',_0x91cb('0x73'),'group',_0x91cb('0x74')];_[_0x91cb('0x75')](_0x30259d,function(_0x13f358){return _0x23380a[_0x91cb('0x76')](_0x13f358[_0x91cb('0x36')])||!_0x13f358[_0x91cb('0x77')]&&_0x13f358[_0x91cb('0x3c')]!==_0x91cb('0x78')&&_0x13f358['type']!==_0x91cb('0x79');});return{'count':_0x30259d[_0x91cb('0x44')],'rows':_['map'](_0x30259d,function(_0x4fb3c0){return{'id':_0x4fb3c0[_0x91cb('0x36')],'name':_0x4fb3c0['label'],'custom':!_0x4fb3c0['default'],'options':_0x4fb3c0[_0x91cb('0x7a')]?_['map'](_0x4fb3c0[_0x91cb('0x7a')],function(_0x498382){return{'name':_[_0x91cb('0x7b')](_0x498382),'value':_0x498382};}):[]};})};}})[_0x91cb('0x1d')](respondWithResult(_0x342587,null))[_0x91cb('0x28')](function(_0x443c01){var _0x4e899c=_0x4ee1e3[_0x91cb('0x3f')][_0x91cb('0x7c')]?0x1f4:_0x443c01[_0x91cb('0x7d')]||0x1f4;logger[_0x91cb('0x24')](_0x91cb('0x7e'),_0x91cb('0x61'),_0x4e899c,JSON[_0x91cb('0x22')](_0x443c01));delete _0x443c01[_0x91cb('0x36')];if(_0x4e899c===0x191){_0x4e899c=0x190;}_0x342587[_0x91cb('0x2b')](_0x4e899c)[_0x91cb('0x37')](_0x4ee1e3[_0x91cb('0x3f')][_0x91cb('0x7c')]?{'message':_0x91cb('0x7f'),'statusCode':_0x443c01[_0x91cb('0x7d')]}:_0x443c01);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 0a33425..8bd9ddc 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 _0x26be=['rimraf','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','util','moment','request-promise','path'];(function(_0x48ec48,_0x58883d){var _0x37fc10=function(_0x2d20ae){while(--_0x2d20ae){_0x48ec48['push'](_0x48ec48['shift']());}};_0x37fc10(++_0x58883d);}(_0x26be,0x9c));var _0xe26b=function(_0x4e19be,_0x31a3ce){_0x4e19be=_0x4e19be-0x0;var _0x525e08=_0x26be[_0x4e19be];return _0x525e08;};'use strict';var _=require('lodash');var util=require(_0xe26b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe26b('0x1'));var BPromise=require('bluebird');var rp=require(_0xe26b('0x2'));var fs=require('fs');var path=require(_0xe26b('0x3'));var rimraf=require(_0xe26b('0x4'));var config=require('../../config/environment');var attributes=require(_0xe26b('0x5'));var integrations=require('../../components/integrations/configuration');module[_0xe26b('0x6')]=function(_0x9bba1e,_0x54e4f1){return _0x9bba1e[_0xe26b('0x7')](_0xe26b('0x8'),attributes,{'tableName':_0xe26b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05ea=['api','moment','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash'];(function(_0x52519f,_0x417ca6){var _0x125efe=function(_0x558674){while(--_0x558674){_0x52519f['push'](_0x52519f['shift']());}};_0x125efe(++_0x417ca6);}(_0x05ea,0x180));var _0xa05e=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0x05ea[_0x5e2152];return _0x5ddcf6;};'use strict';var _=require(_0xa05e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa05e('0x1'));var moment=require(_0xa05e('0x2'));var BPromise=require('bluebird');var rp=require(_0xa05e('0x3'));var fs=require('fs');var path=require(_0xa05e('0x4'));var rimraf=require('rimraf');var config=require(_0xa05e('0x5'));var attributes=require(_0xa05e('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xa05e('0x7')]=function(_0x5e3cb0,_0x4c6831){return _0x5e3cb0[_0xa05e('0x8')](_0xa05e('0x9'),attributes,{'tableName':_0xa05e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index f6e360e..05309c9 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 _0x9eac=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','model','include','map','ShowFreshdeskAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x1dccc3,_0x55d0fe){var _0x1c2e28=function(_0x233332){while(--_0x233332){_0x1dccc3['push'](_0x1dccc3['shift']());}};_0x1c2e28(++_0x55d0fe);}(_0x9eac,0x1ce));var _0xc9ea=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0x9eac[_0x284a61];return _0x220e3c;};'use strict';var _=require(_0xc9ea('0x0'));var util=require(_0xc9ea('0x1'));var moment=require(_0xc9ea('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9ea('0x3'));var db=require(_0xc9ea('0x4'))['db'];var utils=require(_0xc9ea('0x5'));var logger=require(_0xc9ea('0x6'))(_0xc9ea('0x7'));var config=require(_0xc9ea('0x8'));var jayson=require(_0xc9ea('0x9'));var client=jayson[_0xc9ea('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b06b1,_0x54186d,_0x359e3b){return new BPromise(function(_0x54295,_0x303c00){return client[_0xc9ea('0xb')](_0x2b06b1,_0x359e3b)[_0xc9ea('0xc')](function(_0x27cef0){logger[_0xc9ea('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x54186d,_0xc9ea('0xe'));logger[_0xc9ea('0xf')](_0xc9ea('0x10'),_0x54186d,_0xc9ea('0xe'),JSON[_0xc9ea('0x11')](_0x27cef0));if(_0x27cef0[_0xc9ea('0x12')]){if(_0x27cef0[_0xc9ea('0x12')][_0xc9ea('0x13')]===0x1f4){logger[_0xc9ea('0x12')](_0xc9ea('0x14'),_0x54186d,_0x27cef0[_0xc9ea('0x12')][_0xc9ea('0x15')]);return _0x303c00(_0x27cef0[_0xc9ea('0x12')][_0xc9ea('0x15')]);}logger[_0xc9ea('0x12')](_0xc9ea('0x14'),_0x54186d,_0x27cef0['error'][_0xc9ea('0x15')]);return _0x54295(_0x27cef0[_0xc9ea('0x12')][_0xc9ea('0x15')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x54186d,_0xc9ea('0xe'));_0x54295(_0x27cef0[_0xc9ea('0x16')][_0xc9ea('0x15')]);}})[_0xc9ea('0x17')](function(_0x2bd836){logger[_0xc9ea('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x54186d,_0x2bd836);_0x303c00(_0x2bd836);});});}exports[_0xc9ea('0x18')]=function(_0x2b2437){var _0x3f1020=this;return new Promise(function(_0x20d8dd,_0x139c6b){return db[_0xc9ea('0x19')][_0xc9ea('0x1a')]({'raw':_0x2b2437[_0xc9ea('0x1b')]?_0x2b2437['options'][_0xc9ea('0x1c')]===undefined?!![]:![]:!![],'where':_0x2b2437[_0xc9ea('0x1b')]?_0x2b2437[_0xc9ea('0x1b')][_0xc9ea('0x1d')]||null:null,'attributes':_0x2b2437[_0xc9ea('0x1b')]?_0x2b2437[_0xc9ea('0x1b')][_0xc9ea('0x1e')]||null:null,'limit':_0x2b2437[_0xc9ea('0x1b')]?_0x2b2437[_0xc9ea('0x1b')][_0xc9ea('0x1f')]||null:null,'include':_0x2b2437[_0xc9ea('0x1b')]?_0x2b2437[_0xc9ea('0x1b')]['include']?_['map'](_0x2b2437[_0xc9ea('0x1b')]['include'],function(_0x56f7d9){return{'model':db[_0x56f7d9[_0xc9ea('0x20')]],'as':_0x56f7d9['as'],'attributes':_0x56f7d9[_0xc9ea('0x1e')],'include':_0x56f7d9[_0xc9ea('0x21')]?_['map'](_0x56f7d9['include'],function(_0x260243){return{'model':db[_0x260243[_0xc9ea('0x20')]],'as':_0x260243['as'],'attributes':_0x260243[_0xc9ea('0x1e')],'include':_0x260243[_0xc9ea('0x21')]?_[_0xc9ea('0x22')](_0x260243[_0xc9ea('0x21')],function(_0x564cbe){return{'model':db[_0x564cbe['model']],'as':_0x564cbe['as'],'attributes':_0x564cbe['attributes']};}):[]};}):[]};}):[]:[]})[_0xc9ea('0xc')](function(_0x18a9ad){logger[_0xc9ea('0xd')](_0xc9ea('0x18'),_0x2b2437);logger['debug'](_0xc9ea('0x18'),_0x2b2437,JSON['stringify'](_0x18a9ad));_0x20d8dd(_0x18a9ad);})[_0xc9ea('0x17')](function(_0x5ea29c){logger[_0xc9ea('0x12')](_0xc9ea('0x18'),_0x5ea29c['message'],_0x2b2437);_0x139c6b(_0x3f1020[_0xc9ea('0x12')](0x1f4,_0x5ea29c[_0xc9ea('0x15')]));});});};exports[_0xc9ea('0x23')]=function(_0x5adf2b){var _0x267a9c=this;return new Promise(function(_0x491653,_0x4406c3){return db[_0xc9ea('0x19')]['find']({'raw':_0x5adf2b[_0xc9ea('0x1b')]?_0x5adf2b['options'][_0xc9ea('0x1c')]===undefined?!![]:![]:!![],'where':_0x5adf2b['options']?_0x5adf2b['options'][_0xc9ea('0x1d')]||null:null,'attributes':_0x5adf2b[_0xc9ea('0x1b')]?_0x5adf2b[_0xc9ea('0x1b')][_0xc9ea('0x1e')]||null:null,'include':_0x5adf2b[_0xc9ea('0x1b')]?_0x5adf2b[_0xc9ea('0x1b')][_0xc9ea('0x21')]?_[_0xc9ea('0x22')](_0x5adf2b[_0xc9ea('0x1b')][_0xc9ea('0x21')],function(_0x3880c2){return{'model':db[_0x3880c2['model']],'as':_0x3880c2['as'],'attributes':_0x3880c2['attributes'],'include':_0x3880c2[_0xc9ea('0x21')]?_[_0xc9ea('0x22')](_0x3880c2['include'],function(_0x1df4e2){return{'model':db[_0x1df4e2[_0xc9ea('0x20')]],'as':_0x1df4e2['as'],'attributes':_0x1df4e2[_0xc9ea('0x1e')],'include':_0x1df4e2[_0xc9ea('0x21')]?_[_0xc9ea('0x22')](_0x1df4e2[_0xc9ea('0x21')],function(_0xffd869){return{'model':db[_0xffd869[_0xc9ea('0x20')]],'as':_0xffd869['as'],'attributes':_0xffd869['attributes']};}):[]};}):[]};}):[]:[]})[_0xc9ea('0xc')](function(_0x436360){logger['info'](_0xc9ea('0x23'),_0x5adf2b);logger[_0xc9ea('0xf')](_0xc9ea('0x23'),_0x5adf2b,JSON['stringify'](_0x436360));_0x491653(_0x436360);})[_0xc9ea('0x17')](function(_0x2c599b){logger[_0xc9ea('0x12')](_0xc9ea('0x23'),_0x2c599b[_0xc9ea('0x15')],_0x5adf2b);_0x4406c3(_0x267a9c['error'](0x1f4,_0x2c599b[_0xc9ea('0x15')]));});});}; \ No newline at end of file +var _0x554c=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','FreshdeskAccount','findAll','options','raw','where','attributes','include','model','map','GetFreshdeskAccount','ShowFreshdeskAccount','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x554c,0x13b));var _0xc554=function(_0x410aa3,_0x9da78){_0x410aa3=_0x410aa3-0x0;var _0x316484=_0x554c[_0x410aa3];return _0x316484;};'use strict';var _=require(_0xc554('0x0'));var util=require(_0xc554('0x1'));var moment=require(_0xc554('0x2'));var BPromise=require(_0xc554('0x3'));var rs=require(_0xc554('0x4'));var fs=require('fs');var Redis=require(_0xc554('0x5'));var db=require(_0xc554('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc554('0x7'))(_0xc554('0x8'));var config=require(_0xc554('0x9'));var jayson=require(_0xc554('0xa'));var client=jayson['client'][_0xc554('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x21083f,_0x3c5523,_0x136187){return new BPromise(function(_0x432b82,_0x5bad6a){return client[_0xc554('0xc')](_0x21083f,_0x136187)[_0xc554('0xd')](function(_0x12b55e){logger[_0xc554('0xe')](_0xc554('0xf'),_0x3c5523,_0xc554('0x10'));logger[_0xc554('0x11')](_0xc554('0x12'),_0x3c5523,'request\x20sent',JSON[_0xc554('0x13')](_0x12b55e));if(_0x12b55e[_0xc554('0x14')]){if(_0x12b55e[_0xc554('0x14')]['code']===0x1f4){logger[_0xc554('0x14')](_0xc554('0xf'),_0x3c5523,_0x12b55e['error'][_0xc554('0x15')]);return _0x5bad6a(_0x12b55e[_0xc554('0x14')][_0xc554('0x15')]);}logger['error'](_0xc554('0xf'),_0x3c5523,_0x12b55e[_0xc554('0x14')][_0xc554('0x15')]);return _0x432b82(_0x12b55e[_0xc554('0x14')][_0xc554('0x15')]);}else{logger['info'](_0xc554('0xf'),_0x3c5523,'request\x20sent');_0x432b82(_0x12b55e['result'][_0xc554('0x15')]);}})[_0xc554('0x16')](function(_0x48b3a8){logger['error'](_0xc554('0xf'),_0x3c5523,_0x48b3a8);_0x5bad6a(_0x48b3a8);});});}exports['GetFreshdeskAccount']=function(_0x5dabef){var _0x4d49f0=this;return new Promise(function(_0x5222bd,_0x3dd8af){return db[_0xc554('0x17')][_0xc554('0x18')]({'raw':_0x5dabef[_0xc554('0x19')]?_0x5dabef[_0xc554('0x19')][_0xc554('0x1a')]===undefined?!![]:![]:!![],'where':_0x5dabef['options']?_0x5dabef[_0xc554('0x19')][_0xc554('0x1b')]||null:null,'attributes':_0x5dabef[_0xc554('0x19')]?_0x5dabef[_0xc554('0x19')][_0xc554('0x1c')]||null:null,'limit':_0x5dabef[_0xc554('0x19')]?_0x5dabef[_0xc554('0x19')]['limit']||null:null,'include':_0x5dabef['options']?_0x5dabef['options']['include']?_['map'](_0x5dabef[_0xc554('0x19')][_0xc554('0x1d')],function(_0x6ece16){return{'model':db[_0x6ece16[_0xc554('0x1e')]],'as':_0x6ece16['as'],'attributes':_0x6ece16[_0xc554('0x1c')],'include':_0x6ece16[_0xc554('0x1d')]?_[_0xc554('0x1f')](_0x6ece16['include'],function(_0x5f5ad7){return{'model':db[_0x5f5ad7[_0xc554('0x1e')]],'as':_0x5f5ad7['as'],'attributes':_0x5f5ad7[_0xc554('0x1c')],'include':_0x5f5ad7[_0xc554('0x1d')]?_['map'](_0x5f5ad7['include'],function(_0x507675){return{'model':db[_0x507675['model']],'as':_0x507675['as'],'attributes':_0x507675['attributes']};}):[]};}):[]};}):[]:[]})[_0xc554('0xd')](function(_0x1b196e){logger[_0xc554('0xe')](_0xc554('0x20'),_0x5dabef);logger[_0xc554('0x11')](_0xc554('0x20'),_0x5dabef,JSON[_0xc554('0x13')](_0x1b196e));_0x5222bd(_0x1b196e);})[_0xc554('0x16')](function(_0x2dead6){logger[_0xc554('0x14')](_0xc554('0x20'),_0x2dead6[_0xc554('0x15')],_0x5dabef);_0x3dd8af(_0x4d49f0[_0xc554('0x14')](0x1f4,_0x2dead6[_0xc554('0x15')]));});});};exports[_0xc554('0x21')]=function(_0x442cee){var _0x3a7b85=this;return new Promise(function(_0x22397b,_0x20732f){return db['FreshdeskAccount'][_0xc554('0x22')]({'raw':_0x442cee[_0xc554('0x19')]?_0x442cee[_0xc554('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x442cee['options']?_0x442cee[_0xc554('0x19')][_0xc554('0x1b')]||null:null,'attributes':_0x442cee['options']?_0x442cee['options']['attributes']||null:null,'include':_0x442cee[_0xc554('0x19')]?_0x442cee[_0xc554('0x19')][_0xc554('0x1d')]?_[_0xc554('0x1f')](_0x442cee[_0xc554('0x19')][_0xc554('0x1d')],function(_0x584075){return{'model':db[_0x584075[_0xc554('0x1e')]],'as':_0x584075['as'],'attributes':_0x584075[_0xc554('0x1c')],'include':_0x584075['include']?_[_0xc554('0x1f')](_0x584075[_0xc554('0x1d')],function(_0x592593){return{'model':db[_0x592593[_0xc554('0x1e')]],'as':_0x592593['as'],'attributes':_0x592593[_0xc554('0x1c')],'include':_0x592593[_0xc554('0x1d')]?_[_0xc554('0x1f')](_0x592593[_0xc554('0x1d')],function(_0xd291a7){return{'model':db[_0xd291a7[_0xc554('0x1e')]],'as':_0xd291a7['as'],'attributes':_0xd291a7['attributes']};}):[]};}):[]};}):[]:[]})[_0xc554('0xd')](function(_0x1fc0f4){logger[_0xc554('0xe')]('ShowFreshdeskAccount',_0x442cee);logger[_0xc554('0x11')](_0xc554('0x21'),_0x442cee,JSON['stringify'](_0x1fc0f4));_0x22397b(_0x1fc0f4);})['catch'](function(_0x508320){logger[_0xc554('0x14')]('ShowFreshdeskAccount',_0x508320[_0xc554('0x15')],_0x442cee);_0x20732f(_0x3a7b85[_0xc554('0x14')](0x1f4,_0x508320[_0xc554('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index d46ad78..e059962 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 _0x9089=['isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','post','create','setTags','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','get'];(function(_0x581aff,_0x208da7){var _0x2b44c4=function(_0x3fd02a){while(--_0x3fd02a){_0x581aff['push'](_0x581aff['shift']());}};_0x2b44c4(++_0x208da7);}(_0x9089,0x149));var _0x9908=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0x9089[_0xb0de07];return _0x4633d8;};'use strict';var multer=require(_0x9908('0x0'));var util=require('util');var path=require(_0x9908('0x1'));var timeout=require(_0x9908('0x2'));var express=require(_0x9908('0x3'));var router=express[_0x9908('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9908('0x5'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x9908('0x6')]('/',auth[_0x9908('0x7')](),controller[_0x9908('0x8')]);router[_0x9908('0x6')](_0x9908('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x9908('0x6')](_0x9908('0xa'),auth['isAuthenticated'](),controller[_0x9908('0xb')]);router[_0x9908('0x6')](_0x9908('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x9908('0x6')]('/:id/descriptions',auth[_0x9908('0x7')](),controller[_0x9908('0xd')]);router['get'](_0x9908('0xe'),auth[_0x9908('0x7')](),controller[_0x9908('0xf')]);router[_0x9908('0x10')]('/',auth[_0x9908('0x7')](),controller[_0x9908('0x11')]);router[_0x9908('0x10')](_0x9908('0xe'),auth[_0x9908('0x7')](),controller[_0x9908('0x12')]);router['put'](_0x9908('0x9'),auth[_0x9908('0x7')](),controller['update']);router[_0x9908('0x13')](_0x9908('0x9'),auth[_0x9908('0x7')](),controller[_0x9908('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6ff5=['delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getTags','post','create','/:id/tags','setTags','put','/:id','update'];(function(_0x30e979,_0x1c8ef2){var _0x20f9c2=function(_0x6a3c13){while(--_0x6a3c13){_0x30e979['push'](_0x30e979['shift']());}};_0x20f9c2(++_0x1c8ef2);}(_0x6ff5,0x1ce));var _0x56ff=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x6ff5[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0x56ff('0x0'));var util=require(_0x56ff('0x1'));var path=require(_0x56ff('0x2'));var timeout=require(_0x56ff('0x3'));var express=require(_0x56ff('0x4'));var router=express['Router']();var auth=require(_0x56ff('0x5'));var interaction=require(_0x56ff('0x6'));var config=require(_0x56ff('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x56ff('0x8')]('/',auth[_0x56ff('0x9')](),controller[_0x56ff('0xa')]);router[_0x56ff('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x56ff('0xb')]);router['get'](_0x56ff('0xc'),auth[_0x56ff('0x9')](),controller[_0x56ff('0xd')]);router['get'](_0x56ff('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x56ff('0xf'),auth[_0x56ff('0x9')](),controller['getDescriptions']);router[_0x56ff('0x8')]('/:id/tags',auth['isAuthenticated'](),controller[_0x56ff('0x10')]);router[_0x56ff('0x11')]('/',auth[_0x56ff('0x9')](),controller[_0x56ff('0x12')]);router[_0x56ff('0x11')](_0x56ff('0x13'),auth[_0x56ff('0x9')](),controller[_0x56ff('0x14')]);router[_0x56ff('0x15')](_0x56ff('0x16'),auth[_0x56ff('0x9')](),controller[_0x56ff('0x17')]);router[_0x56ff('0x18')](_0x56ff('0x16'),auth[_0x56ff('0x9')](),controller[_0x56ff('0x19')]);module[_0x56ff('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index dabb318..4a3cde2 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 _0x67eb=['exports','STRING','sequelize'];(function(_0x323be1,_0x428499){var _0xc4ad91=function(_0x150aa4){while(--_0x150aa4){_0x323be1['push'](_0x323be1['shift']());}};_0xc4ad91(++_0x428499);}(_0x67eb,0x134));var _0xb67e=function(_0x487456,_0x4f3093){_0x487456=_0x487456-0x0;var _0x308145=_0x67eb[_0x487456];return _0x308145;};'use strict';var Sequelize=require(_0xb67e('0x0'));module[_0xb67e('0x1')]={'name':{'type':Sequelize[_0xb67e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x39f0=['STRING','sequelize','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x39f0,0x10c));var _0x039f=function(_0x536623,_0x5a69bd){_0x536623=_0x536623-0x0;var _0x324bf3=_0x39f0[_0x536623];return _0x324bf3;};'use strict';var Sequelize=require(_0x039f('0x0'));module[_0x039f('0x1')]={'name':{'type':Sequelize[_0x039f('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 98b0828..213ad6b 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 _0x5183=['sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','show','body','update','find','params','getFields','findOne','FreshdeskField','getSubjects','order','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','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~!@#$%^&-_=+[{]}.','request','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch'];(function(_0x1c7f6b,_0xf38ba0){var _0x4cc091=function(_0xbda78a){while(--_0xbda78a){_0x1c7f6b['push'](_0x1c7f6b['shift']());}};_0x4cc091(++_0xf38ba0);}(_0x5183,0x13e));var _0x3518=function(_0xeec7dd,_0xd8fa22){_0xeec7dd=_0xeec7dd-0x0;var _0x460724=_0x5183[_0xeec7dd];return _0x460724;};'use strict';var pdf=require(_0x3518('0x0'));var emlformat=require(_0x3518('0x1'));var rimraf=require(_0x3518('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3518('0x3'));var moment=require(_0x3518('0x4'));var BPromise=require(_0x3518('0x5'));var Mustache=require(_0x3518('0x6'));var util=require('util');var path=require('path');var sox=require(_0x3518('0x7'));var csv=require(_0x3518('0x8'));var ejs=require(_0x3518('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3518('0xa'));var deskjs=require(_0x3518('0xb'));var toCsv=require(_0x3518('0x8'));var querystring=require('querystring');var Papa=require(_0x3518('0xc'));var Redis=require('ioredis');var authService=require(_0x3518('0xd'));var qs=require(_0x3518('0xe'));var as=require(_0x3518('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3518('0x10'))(_0x3518('0x11'));var utils=require('../../config/utils');var config=require(_0x3518('0x12'));var db=require(_0x3518('0x13'))['db'];var jayson=require(_0x3518('0x14'));var client=jayson[_0x3518('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x4ec528,_0x7f5c5a,_0x44db57){if(_0x44db57){var _0x1fee8a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1fee8a['test'](_0x7f5c5a)){return _0x4ec528;}else{throw new db['Sequelize'][(_0x3518('0x16'))](_0x3518('0x17'));}}else{return _0x4ec528;}}function respondWithRpcPromise(_0x7afb31,_0x488364,_0xcd8688,_0x4ed175){return new BPromise(function(_0x1faa77,_0x30a74d){var _0x58fbb0=_0x4ed175||client;return _0x58fbb0[_0x3518('0x18')](_0x7afb31,_0xcd8688)['then'](function(_0xd24f36){logger['info'](_0x3518('0x19'),_0x488364,_0x3518('0x1a'));logger['debug'](_0x3518('0x1b'),_0x488364,_0x3518('0x1a'),JSON[_0x3518('0x1c')](_0xd24f36));if(_0xd24f36[_0x3518('0x1d')]){if(_0xd24f36[_0x3518('0x1d')]['code']===0x1f4){logger[_0x3518('0x1d')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x488364,_0xd24f36[_0x3518('0x1d')][_0x3518('0x1e')]);return _0x30a74d(_0xd24f36[_0x3518('0x1d')]['message']);}logger[_0x3518('0x1d')](_0x3518('0x19'),_0x488364,_0xd24f36[_0x3518('0x1d')][_0x3518('0x1e')]);return _0x1faa77(_0xd24f36[_0x3518('0x1d')]['message']);}else{logger[_0x3518('0x1f')](_0x3518('0x19'),_0x488364,_0x3518('0x1a'));_0x1faa77(_0xd24f36[_0x3518('0x20')][_0x3518('0x1e')]);}})[_0x3518('0x21')](function(_0x15e6bd){logger[_0x3518('0x1d')](_0x3518('0x19'),_0x488364,_0x15e6bd);_0x30a74d(_0x15e6bd);});});}function respondWithStatusCode(_0x440920,_0x19577c){_0x19577c=_0x19577c||0xcc;return function(_0x369a36){if(_0x369a36){return _0x440920[_0x3518('0x22')](_0x19577c);}return _0x440920[_0x3518('0x23')](_0x19577c)[_0x3518('0x24')]();};}function respondWithResult(_0x428b25,_0xc3cab2){_0xc3cab2=_0xc3cab2||0xc8;return function(_0x30ebce){if(_0x30ebce){return _0x428b25[_0x3518('0x23')](_0xc3cab2)[_0x3518('0x25')](_0x30ebce);}};}function respondWithFilteredResult(_0x34a6d6,_0x123230){return function(_0x41e02b){if(_0x41e02b){var _0x369d58=_0x41e02b[_0x3518('0x26')],_0x4cfaa7=_0x123230['offset'],_0x5009e3=_0x123230[_0x3518('0x27')]+_0x123230[_0x3518('0x28')],_0x3f8b72;if(_0x5009e3>=_0x369d58){_0x5009e3=_0x369d58;_0x3f8b72=0xc8;}else{_0x3f8b72=0xce;}_0x34a6d6['status'](_0x3f8b72);return _0x34a6d6[_0x3518('0x29')]('Content-Range',_0x4cfaa7+'-'+_0x5009e3+'/'+_0x369d58)[_0x3518('0x25')](_0x41e02b);}return null;};}function patchUpdates(_0x550c64){return function(_0x6f3e96){try{jsonpatch[_0x3518('0x2a')](_0x6f3e96,_0x550c64,!![]);}catch(_0x24ff1a){return BPromise[_0x3518('0x2b')](_0x24ff1a);}return _0x6f3e96[_0x3518('0x2c')]();};}function saveUpdates(_0x3e7d29,_0x47dd60){return function(_0x3088a9){if(_0x3088a9){return _0x3088a9['update'](_0x3e7d29)[_0x3518('0x2d')](function(_0x1a6ebe){return _0x1a6ebe;});}return null;};}function removeEntity(_0x313be1,_0x69275b){return function(_0x1379e8){if(_0x1379e8){return _0x1379e8[_0x3518('0x2e')]()[_0x3518('0x2d')](function(){_0x313be1[_0x3518('0x23')](0xcc)[_0x3518('0x24')]();});}};}function handleEntityNotFound(_0x12cf0a,_0x16e28b){return function(_0x34a806){if(!_0x34a806){_0x12cf0a[_0x3518('0x22')](0x194);}return _0x34a806;};}function handleError(_0x4e2a20,_0x43b574){_0x43b574=_0x43b574||0x1f4;return function(_0x2c29d0){logger[_0x3518('0x1d')](_0x2c29d0[_0x3518('0x2f')]);if(_0x2c29d0[_0x3518('0x30')]){delete _0x2c29d0[_0x3518('0x30')];}_0x4e2a20[_0x3518('0x23')](_0x43b574)['send'](_0x2c29d0);};}exports[_0x3518('0x31')]=function(_0x202328,_0x23260a){var _0x1eb308={},_0x54bab9={},_0x4cfa8c={'count':0x0,'rows':[]};var _0x391f1b=_[_0x3518('0x32')](db[_0x3518('0x33')][_0x3518('0x34')],function(_0x5b76a5){return{'name':_0x5b76a5[_0x3518('0x35')],'type':_0x5b76a5[_0x3518('0x36')][_0x3518('0x37')]};});_0x54bab9[_0x3518('0x38')]=_[_0x3518('0x32')](_0x391f1b,'name');_0x54bab9[_0x3518('0x39')]=_[_0x3518('0x3a')](_0x202328[_0x3518('0x39')]);_0x54bab9[_0x3518('0x3b')]=_[_0x3518('0x3c')](_0x54bab9[_0x3518('0x38')],_0x54bab9[_0x3518('0x39')]);_0x1eb308[_0x3518('0x3d')]=_[_0x3518('0x3c')](_0x54bab9['model'],qs[_0x3518('0x3e')](_0x202328[_0x3518('0x39')][_0x3518('0x3e')]));_0x1eb308['attributes']=_0x1eb308[_0x3518('0x3d')][_0x3518('0x3f')]?_0x1eb308['attributes']:_0x54bab9['model'];if(!_0x202328[_0x3518('0x39')][_0x3518('0x40')](_0x3518('0x41'))){_0x1eb308[_0x3518('0x28')]=qs[_0x3518('0x28')](_0x202328[_0x3518('0x39')]['limit']);_0x1eb308[_0x3518('0x27')]=qs[_0x3518('0x27')](_0x202328[_0x3518('0x39')][_0x3518('0x27')]);}_0x1eb308['order']=qs[_0x3518('0x42')](_0x202328[_0x3518('0x39')][_0x3518('0x42')]);_0x1eb308[_0x3518('0x43')]=qs[_0x3518('0x3b')](_[_0x3518('0x44')](_0x202328[_0x3518('0x39')],_0x54bab9[_0x3518('0x3b')]),_0x391f1b);if(_0x202328[_0x3518('0x39')][_0x3518('0x45')]){_0x1eb308[_0x3518('0x43')]=_[_0x3518('0x46')](_0x1eb308['where'],{'$or':_['map'](_0x391f1b,function(_0x13a76b){if(_0x13a76b['type']!=='VIRTUAL'){var _0x540297={};_0x540297[_0x13a76b[_0x3518('0x30')]]={'$like':'%'+_0x202328[_0x3518('0x39')][_0x3518('0x45')]+'%'};return _0x540297;}})});}_0x1eb308=_[_0x3518('0x46')]({},_0x1eb308,_0x202328[_0x3518('0x47')]);var _0x5ecf23={'where':_0x1eb308[_0x3518('0x43')]};return db['FreshdeskConfiguration'][_0x3518('0x26')](_0x5ecf23)[_0x3518('0x2d')](function(_0x5681e6){_0x4cfa8c['count']=_0x5681e6;if(_0x202328[_0x3518('0x39')][_0x3518('0x48')]){_0x1eb308[_0x3518('0x49')]=[{'all':!![]}];}return db[_0x3518('0x33')]['findAll'](_0x1eb308);})[_0x3518('0x2d')](function(_0x2b7d33){_0x4cfa8c['rows']=_0x2b7d33;return _0x4cfa8c;})[_0x3518('0x2d')](respondWithFilteredResult(_0x23260a,_0x1eb308))['catch'](handleError(_0x23260a,null));};exports[_0x3518('0x4a')]=function(_0x3e8236,_0x5efb90){var _0x1c2506={'raw':![],'where':{'id':_0x3e8236['params']['id']}},_0x3a619e={};_0x3a619e['model']=_[_0x3518('0x3a')](db[_0x3518('0x33')][_0x3518('0x34')]);_0x3a619e[_0x3518('0x39')]=_['keys'](_0x3e8236[_0x3518('0x39')]);_0x3a619e[_0x3518('0x3b')]=_[_0x3518('0x3c')](_0x3a619e[_0x3518('0x38')],_0x3a619e[_0x3518('0x39')]);_0x1c2506[_0x3518('0x3d')]=_[_0x3518('0x3c')](_0x3a619e['model'],qs[_0x3518('0x3e')](_0x3e8236[_0x3518('0x39')]['fields']));_0x1c2506[_0x3518('0x3d')]=_0x1c2506[_0x3518('0x3d')][_0x3518('0x3f')]?_0x1c2506['attributes']:_0x3a619e[_0x3518('0x38')];if(_0x3e8236[_0x3518('0x39')]['includeAll']){_0x1c2506['include']=[{'all':!![]}];}_0x1c2506=_[_0x3518('0x46')]({},_0x1c2506,_0x3e8236['options']);return db[_0x3518('0x33')]['find'](_0x1c2506)[_0x3518('0x2d')](handleEntityNotFound(_0x5efb90,null))[_0x3518('0x2d')](respondWithResult(_0x5efb90,null))[_0x3518('0x21')](handleError(_0x5efb90,null));};exports['create']=function(_0x23dfc1,_0x54696e){return db[_0x3518('0x33')]['create'](_0x23dfc1[_0x3518('0x4b')],{})['then'](respondWithResult(_0x54696e,0xc9))[_0x3518('0x21')](handleError(_0x54696e,null));};exports[_0x3518('0x4c')]=function(_0x4033f6,_0x666f18){if(_0x4033f6[_0x3518('0x4b')]['id']){delete _0x4033f6[_0x3518('0x4b')]['id'];}return db[_0x3518('0x33')][_0x3518('0x4d')]({'where':{'id':_0x4033f6[_0x3518('0x4e')]['id']}})[_0x3518('0x2d')](handleEntityNotFound(_0x666f18,null))[_0x3518('0x2d')](saveUpdates(_0x4033f6[_0x3518('0x4b')],null))[_0x3518('0x2d')](respondWithResult(_0x666f18,null))[_0x3518('0x21')](handleError(_0x666f18,null));};exports[_0x3518('0x2e')]=function(_0x48ffe3,_0x1ffbfe){return db['FreshdeskConfiguration'][_0x3518('0x4d')]({'where':{'id':_0x48ffe3[_0x3518('0x4e')]['id']}})[_0x3518('0x2d')](handleEntityNotFound(_0x1ffbfe,null))[_0x3518('0x2d')](removeEntity(_0x1ffbfe,null))[_0x3518('0x21')](handleError(_0x1ffbfe,null));};exports[_0x3518('0x4f')]=function(_0x4bf2af,_0x40b3cf,_0x1e0c08){var _0x3befa1={};var _0x1c137e={};var _0x5a39be;var _0x994b33;return db['FreshdeskConfiguration'][_0x3518('0x50')]({'where':{'id':_0x4bf2af[_0x3518('0x4e')]['id']}})[_0x3518('0x2d')](handleEntityNotFound(_0x40b3cf,null))[_0x3518('0x2d')](function(_0x2f8b3d){if(_0x2f8b3d){_0x5a39be=_0x2f8b3d;_0x1c137e[_0x3518('0x38')]=_[_0x3518('0x3a')](db[_0x3518('0x51')][_0x3518('0x34')]);_0x1c137e['query']=_['keys'](_0x4bf2af[_0x3518('0x39')]);_0x1c137e[_0x3518('0x3b')]=_[_0x3518('0x3c')](_0x1c137e[_0x3518('0x38')],_0x1c137e[_0x3518('0x39')]);_0x3befa1[_0x3518('0x3d')]=_[_0x3518('0x3c')](_0x1c137e[_0x3518('0x38')],qs[_0x3518('0x3e')](_0x4bf2af['query'][_0x3518('0x3e')]));_0x3befa1[_0x3518('0x3d')]=_0x3befa1[_0x3518('0x3d')][_0x3518('0x3f')]?_0x3befa1[_0x3518('0x3d')]:_0x1c137e[_0x3518('0x38')];_0x3befa1['order']=qs[_0x3518('0x42')](_0x4bf2af['query'][_0x3518('0x42')]);_0x3befa1[_0x3518('0x43')]=qs[_0x3518('0x3b')](_[_0x3518('0x44')](_0x4bf2af['query'],_0x1c137e[_0x3518('0x3b')]));if(_0x4bf2af['query']['filter']){_0x3befa1[_0x3518('0x43')]=_[_0x3518('0x46')](_0x3befa1[_0x3518('0x43')],{'$or':_[_0x3518('0x32')](_0x3befa1[_0x3518('0x3d')],function(_0x589d59){var _0x74145e={};_0x74145e[_0x589d59]={'$like':'%'+_0x4bf2af[_0x3518('0x39')][_0x3518('0x45')]+'%'};return _0x74145e;})});}_0x3befa1=_[_0x3518('0x46')]({},_0x3befa1,_0x4bf2af[_0x3518('0x47')]);return _0x5a39be['getFields'](_0x3befa1);}})[_0x3518('0x2d')](function(_0x3ce6ac){if(_0x3ce6ac){_0x994b33=_0x3ce6ac[_0x3518('0x3f')];if(!_0x4bf2af['query'][_0x3518('0x40')]('nolimit')){_0x3befa1['limit']=qs[_0x3518('0x28')](_0x4bf2af[_0x3518('0x39')][_0x3518('0x28')]);_0x3befa1['offset']=qs[_0x3518('0x27')](_0x4bf2af[_0x3518('0x39')][_0x3518('0x27')]);}return _0x5a39be[_0x3518('0x4f')](_0x3befa1);}})['then'](function(_0x48ff85){if(_0x48ff85){return _0x48ff85?{'count':_0x994b33,'rows':_0x48ff85}:null;}})[_0x3518('0x2d')](respondWithResult(_0x40b3cf,null))[_0x3518('0x21')](handleError(_0x40b3cf,null));};exports[_0x3518('0x52')]=function(_0x57e6cc,_0xdb81d9,_0x544b49){var _0x147db5={};var _0x269170={};var _0x1e7d2b;var _0x568b7c;return db[_0x3518('0x33')][_0x3518('0x50')]({'where':{'id':_0x57e6cc[_0x3518('0x4e')]['id']}})['then'](handleEntityNotFound(_0xdb81d9,null))[_0x3518('0x2d')](function(_0x2669c2){if(_0x2669c2){_0x1e7d2b=_0x2669c2;_0x269170['model']=_['keys'](db['FreshdeskField'][_0x3518('0x34')]);_0x269170[_0x3518('0x39')]=_['keys'](_0x57e6cc[_0x3518('0x39')]);_0x269170['filters']=_[_0x3518('0x3c')](_0x269170[_0x3518('0x38')],_0x269170[_0x3518('0x39')]);_0x147db5['attributes']=_[_0x3518('0x3c')](_0x269170[_0x3518('0x38')],qs[_0x3518('0x3e')](_0x57e6cc[_0x3518('0x39')][_0x3518('0x3e')]));_0x147db5[_0x3518('0x3d')]=_0x147db5[_0x3518('0x3d')][_0x3518('0x3f')]?_0x147db5['attributes']:_0x269170['model'];_0x147db5[_0x3518('0x53')]=qs[_0x3518('0x42')](_0x57e6cc['query'][_0x3518('0x42')]);_0x147db5[_0x3518('0x43')]=qs[_0x3518('0x3b')](_[_0x3518('0x44')](_0x57e6cc[_0x3518('0x39')],_0x269170[_0x3518('0x3b')]));if(_0x57e6cc[_0x3518('0x39')][_0x3518('0x45')]){_0x147db5[_0x3518('0x43')]=_[_0x3518('0x46')](_0x147db5[_0x3518('0x43')],{'$or':_[_0x3518('0x32')](_0x147db5[_0x3518('0x3d')],function(_0x2c0cc3){var _0x464411={};_0x464411[_0x2c0cc3]={'$like':'%'+_0x57e6cc[_0x3518('0x39')][_0x3518('0x45')]+'%'};return _0x464411;})});}_0x147db5=_[_0x3518('0x46')]({},_0x147db5,_0x57e6cc[_0x3518('0x47')]);return _0x1e7d2b[_0x3518('0x52')](_0x147db5);}})[_0x3518('0x2d')](function(_0x56d48f){if(_0x56d48f){_0x568b7c=_0x56d48f[_0x3518('0x3f')];if(!_0x57e6cc[_0x3518('0x39')][_0x3518('0x40')](_0x3518('0x41'))){_0x147db5[_0x3518('0x28')]=qs[_0x3518('0x28')](_0x57e6cc[_0x3518('0x39')][_0x3518('0x28')]);_0x147db5[_0x3518('0x27')]=qs[_0x3518('0x27')](_0x57e6cc[_0x3518('0x39')][_0x3518('0x27')]);}return _0x1e7d2b[_0x3518('0x52')](_0x147db5);}})[_0x3518('0x2d')](function(_0x24ec37){if(_0x24ec37){return _0x24ec37?{'count':_0x568b7c,'rows':_0x24ec37}:null;}})['then'](respondWithResult(_0xdb81d9,null))[_0x3518('0x21')](handleError(_0xdb81d9,null));};exports[_0x3518('0x54')]=function(_0x1ed89c,_0x443b9a,_0x912a89){var _0x57d2ae={};var _0x268e69={};var _0x460bcd;var _0x1ae3c4;return db[_0x3518('0x33')][_0x3518('0x50')]({'where':{'id':_0x1ed89c[_0x3518('0x4e')]['id']}})[_0x3518('0x2d')](handleEntityNotFound(_0x443b9a,null))[_0x3518('0x2d')](function(_0x307f44){if(_0x307f44){_0x460bcd=_0x307f44;_0x268e69['model']=_[_0x3518('0x3a')](db[_0x3518('0x51')][_0x3518('0x34')]);_0x268e69[_0x3518('0x39')]=_[_0x3518('0x3a')](_0x1ed89c[_0x3518('0x39')]);_0x268e69[_0x3518('0x3b')]=_['intersection'](_0x268e69[_0x3518('0x38')],_0x268e69['query']);_0x57d2ae[_0x3518('0x3d')]=_[_0x3518('0x3c')](_0x268e69[_0x3518('0x38')],qs['fields'](_0x1ed89c[_0x3518('0x39')][_0x3518('0x3e')]));_0x57d2ae[_0x3518('0x3d')]=_0x57d2ae[_0x3518('0x3d')][_0x3518('0x3f')]?_0x57d2ae[_0x3518('0x3d')]:_0x268e69[_0x3518('0x38')];_0x57d2ae[_0x3518('0x53')]=qs[_0x3518('0x42')](_0x1ed89c[_0x3518('0x39')][_0x3518('0x42')]);_0x57d2ae[_0x3518('0x43')]=qs[_0x3518('0x3b')](_[_0x3518('0x44')](_0x1ed89c[_0x3518('0x39')],_0x268e69['filters']));if(_0x1ed89c['query']['filter']){_0x57d2ae['where']=_[_0x3518('0x46')](_0x57d2ae[_0x3518('0x43')],{'$or':_[_0x3518('0x32')](_0x57d2ae[_0x3518('0x3d')],function(_0x5c4ce0){var _0x4a323f={};_0x4a323f[_0x5c4ce0]={'$like':'%'+_0x1ed89c['query'][_0x3518('0x45')]+'%'};return _0x4a323f;})});}_0x57d2ae=_['merge']({},_0x57d2ae,_0x1ed89c[_0x3518('0x47')]);return _0x460bcd[_0x3518('0x54')](_0x57d2ae);}})[_0x3518('0x2d')](function(_0x1b5936){if(_0x1b5936){_0x1ae3c4=_0x1b5936[_0x3518('0x3f')];if(!_0x1ed89c[_0x3518('0x39')][_0x3518('0x40')](_0x3518('0x41'))){_0x57d2ae[_0x3518('0x28')]=qs[_0x3518('0x28')](_0x1ed89c[_0x3518('0x39')][_0x3518('0x28')]);_0x57d2ae[_0x3518('0x27')]=qs[_0x3518('0x27')](_0x1ed89c[_0x3518('0x39')][_0x3518('0x27')]);}return _0x460bcd[_0x3518('0x54')](_0x57d2ae);}})[_0x3518('0x2d')](function(_0x2ec730){if(_0x2ec730){return _0x2ec730?{'count':_0x1ae3c4,'rows':_0x2ec730}:null;}})[_0x3518('0x2d')](respondWithResult(_0x443b9a,null))[_0x3518('0x21')](handleError(_0x443b9a,null));};exports[_0x3518('0x55')]=function(_0x830134,_0x3c0279,_0x1060eb){var _0x59d72c={};var _0x4955fa={};var _0x47d68e;var _0x1e3561;return db[_0x3518('0x33')][_0x3518('0x50')]({'where':{'id':_0x830134[_0x3518('0x4e')]['id']}})[_0x3518('0x2d')](handleEntityNotFound(_0x3c0279,null))[_0x3518('0x2d')](function(_0x45ac02){if(_0x45ac02){_0x47d68e=_0x45ac02;_0x4955fa['model']=_[_0x3518('0x3a')](db[_0x3518('0x56')]['rawAttributes']);_0x4955fa[_0x3518('0x39')]=_['keys'](_0x830134[_0x3518('0x39')]);_0x4955fa['filters']=_[_0x3518('0x3c')](_0x4955fa[_0x3518('0x38')],_0x4955fa[_0x3518('0x39')]);_0x59d72c[_0x3518('0x3d')]=_[_0x3518('0x3c')](_0x4955fa['model'],qs[_0x3518('0x3e')](_0x830134[_0x3518('0x39')][_0x3518('0x3e')]));_0x59d72c[_0x3518('0x3d')]=_0x59d72c[_0x3518('0x3d')][_0x3518('0x3f')]?_0x59d72c[_0x3518('0x3d')]:_0x4955fa[_0x3518('0x38')];_0x59d72c[_0x3518('0x53')]=qs[_0x3518('0x42')](_0x830134[_0x3518('0x39')][_0x3518('0x42')]);_0x59d72c[_0x3518('0x43')]=qs[_0x3518('0x3b')](_[_0x3518('0x44')](_0x830134[_0x3518('0x39')],_0x4955fa[_0x3518('0x3b')]));if(_0x830134[_0x3518('0x39')][_0x3518('0x45')]){_0x59d72c['where']=_[_0x3518('0x46')](_0x59d72c[_0x3518('0x43')],{'$or':_['map'](_0x59d72c[_0x3518('0x3d')],function(_0x16bcec){var _0x27aaad={};_0x27aaad[_0x16bcec]={'$like':'%'+_0x830134['query'][_0x3518('0x45')]+'%'};return _0x27aaad;})});}_0x59d72c=_[_0x3518('0x46')]({},_0x59d72c,_0x830134[_0x3518('0x47')]);return _0x47d68e['getTags'](_0x59d72c);}})[_0x3518('0x2d')](function(_0x35c875){if(_0x35c875){_0x1e3561=_0x35c875[_0x3518('0x3f')];if(!_0x830134[_0x3518('0x39')][_0x3518('0x40')](_0x3518('0x41'))){_0x59d72c[_0x3518('0x28')]=qs[_0x3518('0x28')](_0x830134['query']['limit']);_0x59d72c[_0x3518('0x27')]=qs[_0x3518('0x27')](_0x830134[_0x3518('0x39')]['offset']);}return _0x47d68e[_0x3518('0x55')](_0x59d72c);}})[_0x3518('0x2d')](function(_0x4a8116){if(_0x4a8116){return _0x4a8116?{'count':_0x1e3561,'rows':_0x4a8116}:null;}})[_0x3518('0x2d')](respondWithResult(_0x3c0279,null))[_0x3518('0x21')](handleError(_0x3c0279,null));};exports['setTags']=function(_0x876bf8,_0x3849d3,_0x36518d){if(_0x876bf8['body']['id']){delete _0x876bf8[_0x3518('0x4b')]['id'];}return db[_0x3518('0x33')][_0x3518('0x50')]({'where':{'id':_0x876bf8[_0x3518('0x4e')]['id']}})[_0x3518('0x2d')](handleEntityNotFound(_0x3849d3,null))[_0x3518('0x2d')](function(_0x516d2c){if(_0x516d2c){return _0x516d2c[_0x3518('0x57')](_0x876bf8[_0x3518('0x4b')]['ids']||[]);}return null;})[_0x3518('0x2d')](respondWithResult(_0x3849d3,null))[_0x3518('0x21')](handleError(_0x3849d3,null));}; \ No newline at end of file +var _0x66f4=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','FreshdeskConfiguration,\x20%s,\x20%s','catch','sendStatus','status','end','count','offset','set','Content-Range','json','save','update','destroy','stack','name','send','index','map','FreshdeskConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','rawAttributes','create','body','find','getFields','FreshdeskField','pick','hasOwnProperty','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x200827,_0x4af951){var _0x120047=function(_0x4431de){while(--_0x4431de){_0x200827['push'](_0x200827['shift']());}};_0x120047(++_0x4af951);}(_0x66f4,0xb4));var _0x466f=function(_0x2511aa,_0x5b9685){_0x2511aa=_0x2511aa-0x0;var _0x2e32c0=_0x66f4[_0x2511aa];return _0x2e32c0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x466f('0x0'));var rimraf=require(_0x466f('0x1'));var zipdir=require(_0x466f('0x2'));var jsonpatch=require(_0x466f('0x3'));var rp=require(_0x466f('0x4'));var moment=require(_0x466f('0x5'));var BPromise=require(_0x466f('0x6'));var Mustache=require(_0x466f('0x7'));var util=require(_0x466f('0x8'));var path=require('path');var sox=require(_0x466f('0x9'));var csv=require(_0x466f('0xa'));var ejs=require(_0x466f('0xb'));var fs=require('fs');var _=require(_0x466f('0xc'));var squel=require('squel');var crypto=require(_0x466f('0xd'));var jsforce=require(_0x466f('0xe'));var deskjs=require(_0x466f('0xf'));var toCsv=require(_0x466f('0xa'));var querystring=require(_0x466f('0x10'));var Papa=require(_0x466f('0x11'));var Redis=require('ioredis');var authService=require(_0x466f('0x12'));var qs=require(_0x466f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x466f('0x14'));var logger=require(_0x466f('0x15'))(_0x466f('0x16'));var utils=require(_0x466f('0x17'));var config=require(_0x466f('0x18'));var db=require(_0x466f('0x19'))['db'];var jayson=require(_0x466f('0x1a'));var client=jayson[_0x466f('0x1b')][_0x466f('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1ce2a0,_0x2ae56c,_0x3de79d){if(_0x3de79d){var _0x4014f6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4014f6['test'](_0x2ae56c)){return _0x1ce2a0;}else{throw new db['Sequelize'][(_0x466f('0x1d'))](_0x466f('0x1e'));}}else{return _0x1ce2a0;}}function respondWithRpcPromise(_0x2f272b,_0x131a16,_0x3009bc,_0x5d869c){return new BPromise(function(_0xf685b6,_0x2c6649){var _0x590cae=_0x5d869c||client;return _0x590cae[_0x466f('0x1f')](_0x2f272b,_0x3009bc)[_0x466f('0x20')](function(_0x356ade){logger[_0x466f('0x21')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x131a16,'request\x20sent');logger[_0x466f('0x22')](_0x466f('0x23'),_0x131a16,_0x466f('0x24'),JSON[_0x466f('0x25')](_0x356ade));if(_0x356ade['error']){if(_0x356ade['error']['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x131a16,_0x356ade[_0x466f('0x26')][_0x466f('0x27')]);return _0x2c6649(_0x356ade[_0x466f('0x26')][_0x466f('0x27')]);}logger[_0x466f('0x26')](_0x466f('0x28'),_0x131a16,_0x356ade[_0x466f('0x26')][_0x466f('0x27')]);return _0xf685b6(_0x356ade[_0x466f('0x26')][_0x466f('0x27')]);}else{logger['info'](_0x466f('0x28'),_0x131a16,_0x466f('0x24'));_0xf685b6(_0x356ade['result'][_0x466f('0x27')]);}})[_0x466f('0x29')](function(_0x428a9e){logger[_0x466f('0x26')](_0x466f('0x28'),_0x131a16,_0x428a9e);_0x2c6649(_0x428a9e);});});}function respondWithStatusCode(_0x4cc38e,_0x4ef9de){_0x4ef9de=_0x4ef9de||0xcc;return function(_0x468377){if(_0x468377){return _0x4cc38e[_0x466f('0x2a')](_0x4ef9de);}return _0x4cc38e[_0x466f('0x2b')](_0x4ef9de)[_0x466f('0x2c')]();};}function respondWithResult(_0x2114bc,_0x5d9d12){_0x5d9d12=_0x5d9d12||0xc8;return function(_0x1df516){if(_0x1df516){return _0x2114bc[_0x466f('0x2b')](_0x5d9d12)['json'](_0x1df516);}};}function respondWithFilteredResult(_0x1b2840,_0x2abfe5){return function(_0x1e9872){if(_0x1e9872){var _0x13baea=_0x1e9872[_0x466f('0x2d')],_0x553d3a=_0x2abfe5[_0x466f('0x2e')],_0x6012eb=_0x2abfe5[_0x466f('0x2e')]+_0x2abfe5['limit'],_0x2e9f76;if(_0x6012eb>=_0x13baea){_0x6012eb=_0x13baea;_0x2e9f76=0xc8;}else{_0x2e9f76=0xce;}_0x1b2840['status'](_0x2e9f76);return _0x1b2840[_0x466f('0x2f')](_0x466f('0x30'),_0x553d3a+'-'+_0x6012eb+'/'+_0x13baea)[_0x466f('0x31')](_0x1e9872);}return null;};}function patchUpdates(_0x4c4f4d){return function(_0x4ceb8c){try{jsonpatch['apply'](_0x4ceb8c,_0x4c4f4d,!![]);}catch(_0x51ec27){return BPromise['reject'](_0x51ec27);}return _0x4ceb8c[_0x466f('0x32')]();};}function saveUpdates(_0x131dd8,_0x2afe1b){return function(_0x253cce){if(_0x253cce){return _0x253cce[_0x466f('0x33')](_0x131dd8)['then'](function(_0x1c2308){return _0x1c2308;});}return null;};}function removeEntity(_0x27db6a,_0x41c121){return function(_0x1b3ad6){if(_0x1b3ad6){return _0x1b3ad6[_0x466f('0x34')]()[_0x466f('0x20')](function(){_0x27db6a[_0x466f('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e60a5,_0x1d377b){return function(_0x1012d7){if(!_0x1012d7){_0x4e60a5['sendStatus'](0x194);}return _0x1012d7;};}function handleError(_0x143f6d,_0x5d7600){_0x5d7600=_0x5d7600||0x1f4;return function(_0x5727e3){logger[_0x466f('0x26')](_0x5727e3[_0x466f('0x35')]);if(_0x5727e3[_0x466f('0x36')]){delete _0x5727e3[_0x466f('0x36')];}_0x143f6d[_0x466f('0x2b')](_0x5d7600)[_0x466f('0x37')](_0x5727e3);};}exports[_0x466f('0x38')]=function(_0x512a80,_0x5ea2a2){var _0x12cd17={},_0x10d64b={},_0x25f8fe={'count':0x0,'rows':[]};var _0x5c92fa=_[_0x466f('0x39')](db[_0x466f('0x3a')]['rawAttributes'],function(_0x126b03){return{'name':_0x126b03[_0x466f('0x3b')],'type':_0x126b03['type'][_0x466f('0x3c')]};});_0x10d64b[_0x466f('0x3d')]=_['map'](_0x5c92fa,_0x466f('0x36'));_0x10d64b[_0x466f('0x3e')]=_[_0x466f('0x3f')](_0x512a80[_0x466f('0x3e')]);_0x10d64b[_0x466f('0x40')]=_[_0x466f('0x41')](_0x10d64b[_0x466f('0x3d')],_0x10d64b['query']);_0x12cd17[_0x466f('0x42')]=_[_0x466f('0x41')](_0x10d64b[_0x466f('0x3d')],qs[_0x466f('0x43')](_0x512a80[_0x466f('0x3e')][_0x466f('0x43')]));_0x12cd17[_0x466f('0x42')]=_0x12cd17[_0x466f('0x42')][_0x466f('0x44')]?_0x12cd17[_0x466f('0x42')]:_0x10d64b['model'];if(!_0x512a80[_0x466f('0x3e')]['hasOwnProperty'](_0x466f('0x45'))){_0x12cd17['limit']=qs['limit'](_0x512a80[_0x466f('0x3e')][_0x466f('0x46')]);_0x12cd17[_0x466f('0x2e')]=qs[_0x466f('0x2e')](_0x512a80[_0x466f('0x3e')][_0x466f('0x2e')]);}_0x12cd17[_0x466f('0x47')]=qs[_0x466f('0x48')](_0x512a80[_0x466f('0x3e')][_0x466f('0x48')]);_0x12cd17[_0x466f('0x49')]=qs[_0x466f('0x40')](_['pick'](_0x512a80[_0x466f('0x3e')],_0x10d64b[_0x466f('0x40')]),_0x5c92fa);if(_0x512a80[_0x466f('0x3e')][_0x466f('0x4a')]){_0x12cd17['where']=_[_0x466f('0x4b')](_0x12cd17[_0x466f('0x49')],{'$or':_[_0x466f('0x39')](_0x5c92fa,function(_0x37dbf5){if(_0x37dbf5[_0x466f('0x4c')]!==_0x466f('0x4d')){var _0x586454={};_0x586454[_0x37dbf5[_0x466f('0x36')]]={'$like':'%'+_0x512a80[_0x466f('0x3e')][_0x466f('0x4a')]+'%'};return _0x586454;}})});}_0x12cd17=_[_0x466f('0x4b')]({},_0x12cd17,_0x512a80[_0x466f('0x4e')]);var _0x37e68c={'where':_0x12cd17['where']};return db[_0x466f('0x3a')][_0x466f('0x2d')](_0x37e68c)[_0x466f('0x20')](function(_0x3511e2){_0x25f8fe[_0x466f('0x2d')]=_0x3511e2;if(_0x512a80[_0x466f('0x3e')][_0x466f('0x4f')]){_0x12cd17[_0x466f('0x50')]=[{'all':!![]}];}return db[_0x466f('0x3a')]['findAll'](_0x12cd17);})[_0x466f('0x20')](function(_0xcf7108){_0x25f8fe[_0x466f('0x51')]=_0xcf7108;return _0x25f8fe;})[_0x466f('0x20')](respondWithFilteredResult(_0x5ea2a2,_0x12cd17))['catch'](handleError(_0x5ea2a2,null));};exports[_0x466f('0x52')]=function(_0x33b750,_0x59c8f7){var _0x12f1e2={'raw':![],'where':{'id':_0x33b750[_0x466f('0x53')]['id']}},_0x1775cb={};_0x1775cb['model']=_[_0x466f('0x3f')](db[_0x466f('0x3a')][_0x466f('0x54')]);_0x1775cb[_0x466f('0x3e')]=_[_0x466f('0x3f')](_0x33b750[_0x466f('0x3e')]);_0x1775cb[_0x466f('0x40')]=_[_0x466f('0x41')](_0x1775cb[_0x466f('0x3d')],_0x1775cb[_0x466f('0x3e')]);_0x12f1e2['attributes']=_[_0x466f('0x41')](_0x1775cb['model'],qs[_0x466f('0x43')](_0x33b750['query'][_0x466f('0x43')]));_0x12f1e2[_0x466f('0x42')]=_0x12f1e2[_0x466f('0x42')]['length']?_0x12f1e2[_0x466f('0x42')]:_0x1775cb['model'];if(_0x33b750['query'][_0x466f('0x4f')]){_0x12f1e2['include']=[{'all':!![]}];}_0x12f1e2=_[_0x466f('0x4b')]({},_0x12f1e2,_0x33b750[_0x466f('0x4e')]);return db[_0x466f('0x3a')]['find'](_0x12f1e2)[_0x466f('0x20')](handleEntityNotFound(_0x59c8f7,null))[_0x466f('0x20')](respondWithResult(_0x59c8f7,null))[_0x466f('0x29')](handleError(_0x59c8f7,null));};exports['create']=function(_0x4a46d1,_0x152e9e){return db['FreshdeskConfiguration'][_0x466f('0x55')](_0x4a46d1[_0x466f('0x56')],{})[_0x466f('0x20')](respondWithResult(_0x152e9e,0xc9))[_0x466f('0x29')](handleError(_0x152e9e,null));};exports[_0x466f('0x33')]=function(_0x45861e,_0x49ec23){if(_0x45861e[_0x466f('0x56')]['id']){delete _0x45861e[_0x466f('0x56')]['id'];}return db[_0x466f('0x3a')][_0x466f('0x57')]({'where':{'id':_0x45861e['params']['id']}})[_0x466f('0x20')](handleEntityNotFound(_0x49ec23,null))['then'](saveUpdates(_0x45861e[_0x466f('0x56')],null))['then'](respondWithResult(_0x49ec23,null))[_0x466f('0x29')](handleError(_0x49ec23,null));};exports[_0x466f('0x34')]=function(_0x400d8f,_0x898a66){return db['FreshdeskConfiguration'][_0x466f('0x57')]({'where':{'id':_0x400d8f[_0x466f('0x53')]['id']}})['then'](handleEntityNotFound(_0x898a66,null))['then'](removeEntity(_0x898a66,null))[_0x466f('0x29')](handleError(_0x898a66,null));};exports[_0x466f('0x58')]=function(_0x327610,_0x1d2d15,_0x467ba9){var _0x372178={};var _0x140c9f={};var _0x5e9476;var _0x5ee2a4;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x327610[_0x466f('0x53')]['id']}})[_0x466f('0x20')](handleEntityNotFound(_0x1d2d15,null))[_0x466f('0x20')](function(_0x3bc1a5){if(_0x3bc1a5){_0x5e9476=_0x3bc1a5;_0x140c9f[_0x466f('0x3d')]=_['keys'](db[_0x466f('0x59')]['rawAttributes']);_0x140c9f[_0x466f('0x3e')]=_['keys'](_0x327610[_0x466f('0x3e')]);_0x140c9f[_0x466f('0x40')]=_[_0x466f('0x41')](_0x140c9f[_0x466f('0x3d')],_0x140c9f[_0x466f('0x3e')]);_0x372178[_0x466f('0x42')]=_[_0x466f('0x41')](_0x140c9f['model'],qs['fields'](_0x327610['query'][_0x466f('0x43')]));_0x372178[_0x466f('0x42')]=_0x372178[_0x466f('0x42')]['length']?_0x372178[_0x466f('0x42')]:_0x140c9f[_0x466f('0x3d')];_0x372178[_0x466f('0x47')]=qs[_0x466f('0x48')](_0x327610[_0x466f('0x3e')][_0x466f('0x48')]);_0x372178[_0x466f('0x49')]=qs[_0x466f('0x40')](_[_0x466f('0x5a')](_0x327610[_0x466f('0x3e')],_0x140c9f['filters']));if(_0x327610[_0x466f('0x3e')][_0x466f('0x4a')]){_0x372178[_0x466f('0x49')]=_[_0x466f('0x4b')](_0x372178[_0x466f('0x49')],{'$or':_[_0x466f('0x39')](_0x372178['attributes'],function(_0x2c9d90){var _0x41b3a5={};_0x41b3a5[_0x2c9d90]={'$like':'%'+_0x327610[_0x466f('0x3e')]['filter']+'%'};return _0x41b3a5;})});}_0x372178=_[_0x466f('0x4b')]({},_0x372178,_0x327610[_0x466f('0x4e')]);return _0x5e9476[_0x466f('0x58')](_0x372178);}})['then'](function(_0x3a6a62){if(_0x3a6a62){_0x5ee2a4=_0x3a6a62[_0x466f('0x44')];if(!_0x327610[_0x466f('0x3e')][_0x466f('0x5b')]('nolimit')){_0x372178[_0x466f('0x46')]=qs[_0x466f('0x46')](_0x327610[_0x466f('0x3e')][_0x466f('0x46')]);_0x372178[_0x466f('0x2e')]=qs[_0x466f('0x2e')](_0x327610[_0x466f('0x3e')]['offset']);}return _0x5e9476[_0x466f('0x58')](_0x372178);}})[_0x466f('0x20')](function(_0x19b495){if(_0x19b495){return _0x19b495?{'count':_0x5ee2a4,'rows':_0x19b495}:null;}})[_0x466f('0x20')](respondWithResult(_0x1d2d15,null))['catch'](handleError(_0x1d2d15,null));};exports[_0x466f('0x5c')]=function(_0xfef85c,_0x52d761,_0x5a2ee1){var _0x2ccd3b={};var _0x97c732={};var _0x4ea4bf;var _0x2d8dbc;return db['FreshdeskConfiguration'][_0x466f('0x5d')]({'where':{'id':_0xfef85c[_0x466f('0x53')]['id']}})[_0x466f('0x20')](handleEntityNotFound(_0x52d761,null))[_0x466f('0x20')](function(_0x2a084d){if(_0x2a084d){_0x4ea4bf=_0x2a084d;_0x97c732[_0x466f('0x3d')]=_['keys'](db[_0x466f('0x59')][_0x466f('0x54')]);_0x97c732[_0x466f('0x3e')]=_[_0x466f('0x3f')](_0xfef85c['query']);_0x97c732[_0x466f('0x40')]=_[_0x466f('0x41')](_0x97c732[_0x466f('0x3d')],_0x97c732['query']);_0x2ccd3b['attributes']=_[_0x466f('0x41')](_0x97c732[_0x466f('0x3d')],qs[_0x466f('0x43')](_0xfef85c[_0x466f('0x3e')][_0x466f('0x43')]));_0x2ccd3b[_0x466f('0x42')]=_0x2ccd3b[_0x466f('0x42')][_0x466f('0x44')]?_0x2ccd3b[_0x466f('0x42')]:_0x97c732[_0x466f('0x3d')];_0x2ccd3b['order']=qs[_0x466f('0x48')](_0xfef85c[_0x466f('0x3e')][_0x466f('0x48')]);_0x2ccd3b[_0x466f('0x49')]=qs[_0x466f('0x40')](_[_0x466f('0x5a')](_0xfef85c[_0x466f('0x3e')],_0x97c732[_0x466f('0x40')]));if(_0xfef85c[_0x466f('0x3e')]['filter']){_0x2ccd3b['where']=_['merge'](_0x2ccd3b[_0x466f('0x49')],{'$or':_[_0x466f('0x39')](_0x2ccd3b['attributes'],function(_0x2d8778){var _0x45050d={};_0x45050d[_0x2d8778]={'$like':'%'+_0xfef85c[_0x466f('0x3e')][_0x466f('0x4a')]+'%'};return _0x45050d;})});}_0x2ccd3b=_[_0x466f('0x4b')]({},_0x2ccd3b,_0xfef85c[_0x466f('0x4e')]);return _0x4ea4bf['getSubjects'](_0x2ccd3b);}})[_0x466f('0x20')](function(_0x3f4574){if(_0x3f4574){_0x2d8dbc=_0x3f4574[_0x466f('0x44')];if(!_0xfef85c['query'][_0x466f('0x5b')](_0x466f('0x45'))){_0x2ccd3b[_0x466f('0x46')]=qs['limit'](_0xfef85c[_0x466f('0x3e')][_0x466f('0x46')]);_0x2ccd3b[_0x466f('0x2e')]=qs['offset'](_0xfef85c[_0x466f('0x3e')]['offset']);}return _0x4ea4bf['getSubjects'](_0x2ccd3b);}})[_0x466f('0x20')](function(_0x20ef81){if(_0x20ef81){return _0x20ef81?{'count':_0x2d8dbc,'rows':_0x20ef81}:null;}})[_0x466f('0x20')](respondWithResult(_0x52d761,null))[_0x466f('0x29')](handleError(_0x52d761,null));};exports['getDescriptions']=function(_0x403945,_0x34fe4a,_0x1c666a){var _0x220f2e={};var _0x20a12c={};var _0x7400ca;var _0x368046;return db[_0x466f('0x3a')]['findOne']({'where':{'id':_0x403945[_0x466f('0x53')]['id']}})['then'](handleEntityNotFound(_0x34fe4a,null))['then'](function(_0x82e109){if(_0x82e109){_0x7400ca=_0x82e109;_0x20a12c[_0x466f('0x3d')]=_[_0x466f('0x3f')](db['FreshdeskField'][_0x466f('0x54')]);_0x20a12c[_0x466f('0x3e')]=_[_0x466f('0x3f')](_0x403945['query']);_0x20a12c[_0x466f('0x40')]=_[_0x466f('0x41')](_0x20a12c[_0x466f('0x3d')],_0x20a12c[_0x466f('0x3e')]);_0x220f2e[_0x466f('0x42')]=_['intersection'](_0x20a12c[_0x466f('0x3d')],qs[_0x466f('0x43')](_0x403945[_0x466f('0x3e')]['fields']));_0x220f2e[_0x466f('0x42')]=_0x220f2e[_0x466f('0x42')][_0x466f('0x44')]?_0x220f2e[_0x466f('0x42')]:_0x20a12c[_0x466f('0x3d')];_0x220f2e[_0x466f('0x47')]=qs[_0x466f('0x48')](_0x403945[_0x466f('0x3e')][_0x466f('0x48')]);_0x220f2e[_0x466f('0x49')]=qs[_0x466f('0x40')](_[_0x466f('0x5a')](_0x403945[_0x466f('0x3e')],_0x20a12c['filters']));if(_0x403945[_0x466f('0x3e')][_0x466f('0x4a')]){_0x220f2e[_0x466f('0x49')]=_[_0x466f('0x4b')](_0x220f2e[_0x466f('0x49')],{'$or':_[_0x466f('0x39')](_0x220f2e[_0x466f('0x42')],function(_0x244ebd){var _0x3df41f={};_0x3df41f[_0x244ebd]={'$like':'%'+_0x403945[_0x466f('0x3e')][_0x466f('0x4a')]+'%'};return _0x3df41f;})});}_0x220f2e=_[_0x466f('0x4b')]({},_0x220f2e,_0x403945[_0x466f('0x4e')]);return _0x7400ca['getDescriptions'](_0x220f2e);}})['then'](function(_0x2f2512){if(_0x2f2512){_0x368046=_0x2f2512[_0x466f('0x44')];if(!_0x403945[_0x466f('0x3e')][_0x466f('0x5b')](_0x466f('0x45'))){_0x220f2e[_0x466f('0x46')]=qs[_0x466f('0x46')](_0x403945[_0x466f('0x3e')]['limit']);_0x220f2e[_0x466f('0x2e')]=qs[_0x466f('0x2e')](_0x403945['query'][_0x466f('0x2e')]);}return _0x7400ca[_0x466f('0x5e')](_0x220f2e);}})[_0x466f('0x20')](function(_0x9a6480){if(_0x9a6480){return _0x9a6480?{'count':_0x368046,'rows':_0x9a6480}:null;}})['then'](respondWithResult(_0x34fe4a,null))[_0x466f('0x29')](handleError(_0x34fe4a,null));};exports[_0x466f('0x5f')]=function(_0x196752,_0x57ec4c,_0x55ac8b){var _0x234275={};var _0x33f0c0={};var _0x59eaff;var _0x11fba9;return db['FreshdeskConfiguration'][_0x466f('0x5d')]({'where':{'id':_0x196752['params']['id']}})[_0x466f('0x20')](handleEntityNotFound(_0x57ec4c,null))[_0x466f('0x20')](function(_0x47ad72){if(_0x47ad72){_0x59eaff=_0x47ad72;_0x33f0c0['model']=_[_0x466f('0x3f')](db[_0x466f('0x60')][_0x466f('0x54')]);_0x33f0c0['query']=_['keys'](_0x196752[_0x466f('0x3e')]);_0x33f0c0['filters']=_[_0x466f('0x41')](_0x33f0c0[_0x466f('0x3d')],_0x33f0c0[_0x466f('0x3e')]);_0x234275[_0x466f('0x42')]=_[_0x466f('0x41')](_0x33f0c0[_0x466f('0x3d')],qs[_0x466f('0x43')](_0x196752[_0x466f('0x3e')][_0x466f('0x43')]));_0x234275[_0x466f('0x42')]=_0x234275[_0x466f('0x42')][_0x466f('0x44')]?_0x234275[_0x466f('0x42')]:_0x33f0c0[_0x466f('0x3d')];_0x234275[_0x466f('0x47')]=qs[_0x466f('0x48')](_0x196752[_0x466f('0x3e')][_0x466f('0x48')]);_0x234275[_0x466f('0x49')]=qs['filters'](_[_0x466f('0x5a')](_0x196752[_0x466f('0x3e')],_0x33f0c0[_0x466f('0x40')]));if(_0x196752[_0x466f('0x3e')][_0x466f('0x4a')]){_0x234275[_0x466f('0x49')]=_[_0x466f('0x4b')](_0x234275['where'],{'$or':_[_0x466f('0x39')](_0x234275[_0x466f('0x42')],function(_0x130493){var _0x2c0f82={};_0x2c0f82[_0x130493]={'$like':'%'+_0x196752[_0x466f('0x3e')][_0x466f('0x4a')]+'%'};return _0x2c0f82;})});}_0x234275=_[_0x466f('0x4b')]({},_0x234275,_0x196752[_0x466f('0x4e')]);return _0x59eaff['getTags'](_0x234275);}})[_0x466f('0x20')](function(_0x2c9bc9){if(_0x2c9bc9){_0x11fba9=_0x2c9bc9[_0x466f('0x44')];if(!_0x196752[_0x466f('0x3e')][_0x466f('0x5b')](_0x466f('0x45'))){_0x234275['limit']=qs[_0x466f('0x46')](_0x196752[_0x466f('0x3e')][_0x466f('0x46')]);_0x234275['offset']=qs['offset'](_0x196752[_0x466f('0x3e')]['offset']);}return _0x59eaff[_0x466f('0x5f')](_0x234275);}})[_0x466f('0x20')](function(_0x287886){if(_0x287886){return _0x287886?{'count':_0x11fba9,'rows':_0x287886}:null;}})['then'](respondWithResult(_0x57ec4c,null))[_0x466f('0x29')](handleError(_0x57ec4c,null));};exports[_0x466f('0x61')]=function(_0x400b31,_0x2ef9b7,_0x5a1278){if(_0x400b31['body']['id']){delete _0x400b31[_0x466f('0x56')]['id'];}return db[_0x466f('0x3a')]['findOne']({'where':{'id':_0x400b31[_0x466f('0x53')]['id']}})[_0x466f('0x20')](handleEntityNotFound(_0x2ef9b7,null))['then'](function(_0x4d0ab9){if(_0x4d0ab9){return _0x4d0ab9[_0x466f('0x61')](_0x400b31[_0x466f('0x56')][_0x466f('0x62')]||[]);}return null;})['then'](respondWithResult(_0x2ef9b7,null))['catch'](handleError(_0x2ef9b7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 4e340a7..4716c3e 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 _0xe14b=['bluebird','path','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','moment'];(function(_0x136d08,_0xa745a0){var _0x3840a0=function(_0x1e5843){while(--_0x1e5843){_0x136d08['push'](_0x136d08['shift']());}};_0x3840a0(++_0xa745a0);}(_0xe14b,0x93));var _0xbe14=function(_0x58eb2e,_0x197c09){_0x58eb2e=_0x58eb2e-0x0;var _0x250deb=_0xe14b[_0x58eb2e];return _0x250deb;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x53ec=['bluebird','path','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','lodash','util','../../config/logger','api','moment'];(function(_0x3b3901,_0x23a00f){var _0x482c45=function(_0x217d56){while(--_0x217d56){_0x3b3901['push'](_0x3b3901['shift']());}};_0x482c45(++_0x23a00f);}(_0x53ec,0x192));var _0xc53e=function(_0x3c2407,_0x3c9a47){_0x3c2407=_0x3c2407-0x0;var _0x5d2eac=_0x53ec[_0x3c2407];return _0x5d2eac;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'int_freshdesk_configurations','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 e10750e..22e637c 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 _0xfb95=['lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch'];(function(_0x1989e2,_0x5a3b47){var _0x218d38=function(_0x572af8){while(--_0x572af8){_0x1989e2['push'](_0x1989e2['shift']());}};_0x218d38(++_0x5a3b47);}(_0xfb95,0xdd));var _0x5fb9=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0xfb95[_0x2212d1];return _0x15eec5;};'use strict';var _=require(_0x5fb9('0x0'));var util=require(_0x5fb9('0x1'));var moment=require('moment');var BPromise=require(_0x5fb9('0x2'));var rs=require(_0x5fb9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5fb9('0x4'));var logger=require('../../config/logger')(_0x5fb9('0x5'));var config=require(_0x5fb9('0x6'));var jayson=require(_0x5fb9('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x481af7,_0x4d328c,_0x237d0e){return new BPromise(function(_0x1c1dc4,_0x3fde18){return client[_0x5fb9('0x8')](_0x481af7,_0x237d0e)['then'](function(_0x4173e4){logger[_0x5fb9('0x9')](_0x5fb9('0xa'),_0x4d328c,_0x5fb9('0xb'));logger['debug'](_0x5fb9('0xc'),_0x4d328c,'request\x20sent',JSON['stringify'](_0x4173e4));if(_0x4173e4[_0x5fb9('0xd')]){if(_0x4173e4[_0x5fb9('0xd')][_0x5fb9('0xe')]===0x1f4){logger[_0x5fb9('0xd')](_0x5fb9('0xa'),_0x4d328c,_0x4173e4[_0x5fb9('0xd')]['message']);return _0x3fde18(_0x4173e4[_0x5fb9('0xd')]['message']);}logger['error'](_0x5fb9('0xa'),_0x4d328c,_0x4173e4[_0x5fb9('0xd')]['message']);return _0x1c1dc4(_0x4173e4[_0x5fb9('0xd')][_0x5fb9('0xf')]);}else{logger[_0x5fb9('0x9')](_0x5fb9('0xa'),_0x4d328c,'request\x20sent');_0x1c1dc4(_0x4173e4['result'][_0x5fb9('0xf')]);}})[_0x5fb9('0x10')](function(_0x5849ab){logger[_0x5fb9('0xd')](_0x5fb9('0xa'),_0x4d328c,_0x5849ab);_0x3fde18(_0x5849ab);});});} \ No newline at end of file +var _0x6526=['info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x561739,_0x53cb55){var _0x7dbdd0=function(_0x41cd62){while(--_0x41cd62){_0x561739['push'](_0x561739['shift']());}};_0x7dbdd0(++_0x53cb55);}(_0x6526,0x83));var _0x6652=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0x6526[_0x3f94f9];return _0x46f84f;};'use strict';var _=require('lodash');var util=require(_0x6652('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6652('0x1'));var fs=require('fs');var Redis=require(_0x6652('0x2'));var db=require(_0x6652('0x3'))['db'];var utils=require(_0x6652('0x4'));var logger=require(_0x6652('0x5'))(_0x6652('0x6'));var config=require(_0x6652('0x7'));var jayson=require(_0x6652('0x8'));var client=jayson[_0x6652('0x9')][_0x6652('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c3f4e,_0x52c0cd,_0x3c5ae5){return new BPromise(function(_0x20bf04,_0x6ab679){return client[_0x6652('0xb')](_0x4c3f4e,_0x3c5ae5)[_0x6652('0xc')](function(_0x1841fc){logger[_0x6652('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x52c0cd,_0x6652('0xe'));logger[_0x6652('0xf')](_0x6652('0x10'),_0x52c0cd,_0x6652('0xe'),JSON[_0x6652('0x11')](_0x1841fc));if(_0x1841fc['error']){if(_0x1841fc[_0x6652('0x12')][_0x6652('0x13')]===0x1f4){logger[_0x6652('0x12')](_0x6652('0x14'),_0x52c0cd,_0x1841fc[_0x6652('0x12')][_0x6652('0x15')]);return _0x6ab679(_0x1841fc[_0x6652('0x12')][_0x6652('0x15')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x52c0cd,_0x1841fc[_0x6652('0x12')][_0x6652('0x15')]);return _0x20bf04(_0x1841fc[_0x6652('0x12')][_0x6652('0x15')]);}else{logger['info'](_0x6652('0x14'),_0x52c0cd,'request\x20sent');_0x20bf04(_0x1841fc[_0x6652('0x16')][_0x6652('0x15')]);}})[_0x6652('0x17')](function(_0x178fdc){logger[_0x6652('0x12')](_0x6652('0x14'),_0x52c0cd,_0x178fdc);_0x6ab679(_0x178fdc);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 4acc04a..b251df3 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 _0x3e74=['connect-timeout','express','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','multer','path'];(function(_0x320120,_0x51ae7e){var _0x228e37=function(_0x299921){while(--_0x299921){_0x320120['push'](_0x320120['shift']());}};_0x228e37(++_0x51ae7e);}(_0x3e74,0x175));var _0x43e7=function(_0x4919dc,_0x27568a){_0x4919dc=_0x4919dc-0x0;var _0x5b0b38=_0x3e74[_0x4919dc];return _0x5b0b38;};'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 auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['put'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0xd')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);module['exports']=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','delete','/:id','destroy','exports'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0xedd9,0xfc));var _0x9edd=function(_0x986da1,_0x46d6ce){_0x986da1=_0x986da1-0x0;var _0x2133bd=_0xedd9[_0x986da1];return _0x2133bd;};'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 auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0xb')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router[_0x9edd('0xd')]('/:id',auth[_0x9edd('0x9')](),controller['update']);router[_0x9edd('0xe')](_0x9edd('0xf'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);module[_0x9edd('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index d832000..c2a048f 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 _0x1af5=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x5cda28,_0x5598ea){var _0x4a6e5c=function(_0x3eeeaa){while(--_0x3eeeaa){_0x5cda28['push'](_0x5cda28['shift']());}};_0x4a6e5c(++_0x5598ea);}(_0x1af5,0x17d));var _0x51af=function(_0x1b333e,_0x405ad3){_0x1b333e=_0x1b333e-0x0;var _0x388779=_0x1af5[_0x1b333e];return _0x388779;};'use strict';var Sequelize=require(_0x51af('0x0'));module['exports']={'type':{'type':Sequelize[_0x51af('0x1')](_0x51af('0x2'),_0x51af('0x3'),_0x51af('0x4'),_0x51af('0x5')),'defaultValue':_0x51af('0x2')},'content':{'type':Sequelize[_0x51af('0x6')]},'key':{'type':Sequelize[_0x51af('0x6')]},'keyType':{'type':Sequelize[_0x51af('0x1')](_0x51af('0x2'),_0x51af('0x3'),_0x51af('0x4'))},'keyContent':{'type':Sequelize[_0x51af('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x51af('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3337=['keyValue','string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable'];(function(_0x557fd2,_0x2c0a7a){var _0x1b54a2=function(_0x2e439b){while(--_0x2e439b){_0x557fd2['push'](_0x557fd2['shift']());}};_0x1b54a2(++_0x2c0a7a);}(_0x3337,0x12e));var _0x7333=function(_0x46ee6b,_0x7f3e6c){_0x46ee6b=_0x46ee6b-0x0;var _0x97d54b=_0x3337[_0x46ee6b];return _0x97d54b;};'use strict';var Sequelize=require(_0x7333('0x0'));module[_0x7333('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x7333('0x2'),_0x7333('0x3'),_0x7333('0x4')),'defaultValue':_0x7333('0x5')},'content':{'type':Sequelize[_0x7333('0x6')]},'key':{'type':Sequelize[_0x7333('0x6')]},'keyType':{'type':Sequelize[_0x7333('0x7')]('string',_0x7333('0x2'),_0x7333('0x3'))},'keyContent':{'type':Sequelize[_0x7333('0x6')]},'idField':{'type':Sequelize[_0x7333('0x6')]},'nameField':{'type':Sequelize[_0x7333('0x6')]},'customField':{'type':Sequelize[_0x7333('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 5a438a6..79e289c 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 _0x6a7f=['sox','to-csv','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','sendStatus','status','end','offset','limit','set','json','reject','update','destroy','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','count','then','FreshdeskField','findAll','rows','catch','show','params','includeAll','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path'];(function(_0x9812ef,_0x14b913){var _0xa9c616=function(_0x5ecbcb){while(--_0x5ecbcb){_0x9812ef['push'](_0x9812ef['shift']());}};_0xa9c616(++_0x14b913);}(_0x6a7f,0x137));var _0xf6a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a7f[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xf6a7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf6a7('0x1'));var zipdir=require(_0xf6a7('0x2'));var jsonpatch=require(_0xf6a7('0x3'));var rp=require(_0xf6a7('0x4'));var moment=require(_0xf6a7('0x5'));var BPromise=require(_0xf6a7('0x6'));var Mustache=require(_0xf6a7('0x7'));var util=require('util');var path=require(_0xf6a7('0x8'));var sox=require(_0xf6a7('0x9'));var csv=require(_0xf6a7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf6a7('0xb'));var deskjs=require(_0xf6a7('0xc'));var toCsv=require(_0xf6a7('0xa'));var querystring=require(_0xf6a7('0xd'));var Papa=require(_0xf6a7('0xe'));var Redis=require(_0xf6a7('0xf'));var authService=require(_0xf6a7('0x10'));var qs=require(_0xf6a7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6a7('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x53d129,_0x39a9d5){_0x39a9d5=_0x39a9d5||0xcc;return function(_0x58adab){if(_0x58adab){return _0x53d129[_0xf6a7('0x13')](_0x39a9d5);}return _0x53d129[_0xf6a7('0x14')](_0x39a9d5)[_0xf6a7('0x15')]();};}function respondWithResult(_0x41c063,_0x4bd682){_0x4bd682=_0x4bd682||0xc8;return function(_0x3987b4){if(_0x3987b4){return _0x41c063[_0xf6a7('0x14')](_0x4bd682)['json'](_0x3987b4);}};}function respondWithFilteredResult(_0x4de231,_0x82eac5){return function(_0x1f3991){if(_0x1f3991){var _0x25e1d6=_0x1f3991['count'],_0x3992d1=_0x82eac5[_0xf6a7('0x16')],_0x14bb2c=_0x82eac5[_0xf6a7('0x16')]+_0x82eac5[_0xf6a7('0x17')],_0x8a83eb;if(_0x14bb2c>=_0x25e1d6){_0x14bb2c=_0x25e1d6;_0x8a83eb=0xc8;}else{_0x8a83eb=0xce;}_0x4de231[_0xf6a7('0x14')](_0x8a83eb);return _0x4de231[_0xf6a7('0x18')]('Content-Range',_0x3992d1+'-'+_0x14bb2c+'/'+_0x25e1d6)[_0xf6a7('0x19')](_0x1f3991);}return null;};}function patchUpdates(_0x4cec46){return function(_0x54917a){try{jsonpatch['apply'](_0x54917a,_0x4cec46,!![]);}catch(_0xb49762){return BPromise[_0xf6a7('0x1a')](_0xb49762);}return _0x54917a['save']();};}function saveUpdates(_0x35cd28,_0x1ba82b){return function(_0x267f6f){if(_0x267f6f){return _0x267f6f[_0xf6a7('0x1b')](_0x35cd28)['then'](function(_0x2a0b09){return _0x2a0b09;});}return null;};}function removeEntity(_0x1586ea,_0x1ff015){return function(_0x48ebcc){if(_0x48ebcc){return _0x48ebcc[_0xf6a7('0x1c')]()['then'](function(){_0x1586ea['status'](0xcc)[_0xf6a7('0x15')]();});}};}function handleEntityNotFound(_0x548840,_0x2eff6c){return function(_0x3b3b6f){if(!_0x3b3b6f){_0x548840[_0xf6a7('0x13')](0x194);}return _0x3b3b6f;};}function handleError(_0x155e17,_0xfe305d){_0xfe305d=_0xfe305d||0x1f4;return function(_0x65b40d){logger['error'](_0x65b40d['stack']);if(_0x65b40d['name']){delete _0x65b40d[_0xf6a7('0x1d')];}_0x155e17[_0xf6a7('0x14')](_0xfe305d)[_0xf6a7('0x1e')](_0x65b40d);};}exports['index']=function(_0x288bb2,_0xe6928){var _0x19495d={},_0x2467a2={},_0x115610={'count':0x0,'rows':[]};var _0x4e14aa=_[_0xf6a7('0x1f')](db['FreshdeskField'][_0xf6a7('0x20')],function(_0x3262f5){return{'name':_0x3262f5[_0xf6a7('0x21')],'type':_0x3262f5[_0xf6a7('0x22')][_0xf6a7('0x23')]};});_0x2467a2[_0xf6a7('0x24')]=_[_0xf6a7('0x1f')](_0x4e14aa,_0xf6a7('0x1d'));_0x2467a2[_0xf6a7('0x25')]=_[_0xf6a7('0x26')](_0x288bb2[_0xf6a7('0x25')]);_0x2467a2[_0xf6a7('0x27')]=_[_0xf6a7('0x28')](_0x2467a2[_0xf6a7('0x24')],_0x2467a2[_0xf6a7('0x25')]);_0x19495d[_0xf6a7('0x29')]=_['intersection'](_0x2467a2[_0xf6a7('0x24')],qs[_0xf6a7('0x2a')](_0x288bb2[_0xf6a7('0x25')][_0xf6a7('0x2a')]));_0x19495d['attributes']=_0x19495d[_0xf6a7('0x29')][_0xf6a7('0x2b')]?_0x19495d[_0xf6a7('0x29')]:_0x2467a2[_0xf6a7('0x24')];if(!_0x288bb2[_0xf6a7('0x25')][_0xf6a7('0x2c')](_0xf6a7('0x2d'))){_0x19495d[_0xf6a7('0x17')]=qs['limit'](_0x288bb2[_0xf6a7('0x25')]['limit']);_0x19495d[_0xf6a7('0x16')]=qs[_0xf6a7('0x16')](_0x288bb2[_0xf6a7('0x25')][_0xf6a7('0x16')]);}_0x19495d['order']=qs[_0xf6a7('0x2e')](_0x288bb2[_0xf6a7('0x25')][_0xf6a7('0x2e')]);_0x19495d[_0xf6a7('0x2f')]=qs[_0xf6a7('0x27')](_['pick'](_0x288bb2['query'],_0x2467a2[_0xf6a7('0x27')]),_0x4e14aa);if(_0x288bb2[_0xf6a7('0x25')][_0xf6a7('0x30')]){_0x19495d['where']=_['merge'](_0x19495d['where'],{'$or':_[_0xf6a7('0x1f')](_0x4e14aa,function(_0x45ec58){if(_0x45ec58[_0xf6a7('0x22')]!==_0xf6a7('0x31')){var _0x31bd96={};_0x31bd96[_0x45ec58[_0xf6a7('0x1d')]]={'$like':'%'+_0x288bb2['query'][_0xf6a7('0x30')]+'%'};return _0x31bd96;}})});}_0x19495d=_[_0xf6a7('0x32')]({},_0x19495d,_0x288bb2[_0xf6a7('0x33')]);var _0x19738c={'where':_0x19495d[_0xf6a7('0x2f')]};return db['FreshdeskField'][_0xf6a7('0x34')](_0x19738c)[_0xf6a7('0x35')](function(_0x234043){_0x115610[_0xf6a7('0x34')]=_0x234043;if(_0x288bb2[_0xf6a7('0x25')]['includeAll']){_0x19495d['include']=[{'all':!![]}];}return db[_0xf6a7('0x36')][_0xf6a7('0x37')](_0x19495d);})[_0xf6a7('0x35')](function(_0x183d42){_0x115610[_0xf6a7('0x38')]=_0x183d42;return _0x115610;})[_0xf6a7('0x35')](respondWithFilteredResult(_0xe6928,_0x19495d))[_0xf6a7('0x39')](handleError(_0xe6928,null));};exports[_0xf6a7('0x3a')]=function(_0x2d811b,_0x4fd1db){var _0x3cc433={'raw':!![],'where':{'id':_0x2d811b[_0xf6a7('0x3b')]['id']}},_0x467dbc={};_0x467dbc[_0xf6a7('0x24')]=_[_0xf6a7('0x26')](db['FreshdeskField'][_0xf6a7('0x20')]);_0x467dbc[_0xf6a7('0x25')]=_[_0xf6a7('0x26')](_0x2d811b[_0xf6a7('0x25')]);_0x467dbc['filters']=_[_0xf6a7('0x28')](_0x467dbc['model'],_0x467dbc['query']);_0x3cc433[_0xf6a7('0x29')]=_[_0xf6a7('0x28')](_0x467dbc['model'],qs[_0xf6a7('0x2a')](_0x2d811b[_0xf6a7('0x25')][_0xf6a7('0x2a')]));_0x3cc433[_0xf6a7('0x29')]=_0x3cc433[_0xf6a7('0x29')][_0xf6a7('0x2b')]?_0x3cc433['attributes']:_0x467dbc[_0xf6a7('0x24')];if(_0x2d811b[_0xf6a7('0x25')][_0xf6a7('0x3c')]){_0x3cc433['include']=[{'all':!![]}];}_0x3cc433=_[_0xf6a7('0x32')]({},_0x3cc433,_0x2d811b['options']);return db['FreshdeskField'][_0xf6a7('0x3d')](_0x3cc433)[_0xf6a7('0x35')](handleEntityNotFound(_0x4fd1db,null))[_0xf6a7('0x35')](respondWithResult(_0x4fd1db,null))[_0xf6a7('0x39')](handleError(_0x4fd1db,null));};exports['create']=function(_0x816eba,_0x1462d3){return db[_0xf6a7('0x36')][_0xf6a7('0x3e')](_0x816eba['body'],{})['then'](respondWithResult(_0x1462d3,0xc9))['catch'](handleError(_0x1462d3,null));};exports[_0xf6a7('0x1b')]=function(_0x4459fc,_0x2161b1){if(_0x4459fc[_0xf6a7('0x3f')]['id']){delete _0x4459fc['body']['id'];}return db[_0xf6a7('0x36')][_0xf6a7('0x3d')]({'where':{'id':_0x4459fc[_0xf6a7('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2161b1,null))['then'](saveUpdates(_0x4459fc['body'],null))['then'](respondWithResult(_0x2161b1,null))[_0xf6a7('0x39')](handleError(_0x2161b1,null));};exports[_0xf6a7('0x1c')]=function(_0x1e9894,_0x5b676a){return db[_0xf6a7('0x36')]['find']({'where':{'id':_0x1e9894[_0xf6a7('0x3b')]['id']}})[_0xf6a7('0x35')](handleEntityNotFound(_0x5b676a,null))[_0xf6a7('0x35')](removeEntity(_0x5b676a,null))[_0xf6a7('0x39')](handleError(_0x5b676a,null));}; \ No newline at end of file +var _0xbda5=['create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','Content-Range','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','order','sort','where','pick','filter','merge','options','FreshdeskField','include','findAll','rows','catch','show','fields','length','includeAll','find'];(function(_0x4641fd,_0xc848b5){var _0x1e5097=function(_0x210dbc){while(--_0x210dbc){_0x4641fd['push'](_0x4641fd['shift']());}};_0x1e5097(++_0xc848b5);}(_0xbda5,0x195));var _0x5bda=function(_0x1851f9,_0x53a424){_0x1851f9=_0x1851f9-0x0;var _0x1c1729=_0xbda5[_0x1851f9];return _0x1c1729;};'use strict';var pdf=require(_0x5bda('0x0'));var emlformat=require(_0x5bda('0x1'));var rimraf=require(_0x5bda('0x2'));var zipdir=require(_0x5bda('0x3'));var jsonpatch=require(_0x5bda('0x4'));var rp=require('request-promise');var moment=require(_0x5bda('0x5'));var BPromise=require(_0x5bda('0x6'));var Mustache=require('mustache');var util=require(_0x5bda('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5bda('0x8'));var ejs=require(_0x5bda('0x9'));var fs=require('fs');var _=require(_0x5bda('0xa'));var squel=require(_0x5bda('0xb'));var crypto=require(_0x5bda('0xc'));var jsforce=require(_0x5bda('0xd'));var deskjs=require(_0x5bda('0xe'));var toCsv=require(_0x5bda('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5bda('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5bda('0x10'));var as=require(_0x5bda('0x11'));var hardwareService=require(_0x5bda('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x5bda('0x13'));var config=require(_0x5bda('0x14'));var db=require(_0x5bda('0x15'))['db'];function respondWithStatusCode(_0x3e3261,_0x409b5d){_0x409b5d=_0x409b5d||0xcc;return function(_0x2f7d27){if(_0x2f7d27){return _0x3e3261[_0x5bda('0x16')](_0x409b5d);}return _0x3e3261['status'](_0x409b5d)[_0x5bda('0x17')]();};}function respondWithResult(_0x5e4646,_0x3969bf){_0x3969bf=_0x3969bf||0xc8;return function(_0x380fbd){if(_0x380fbd){return _0x5e4646[_0x5bda('0x18')](_0x3969bf)['json'](_0x380fbd);}};}function respondWithFilteredResult(_0x293fce,_0x17558){return function(_0x7f4c02){if(_0x7f4c02){var _0x462d33=_0x7f4c02[_0x5bda('0x19')],_0x651ae7=_0x17558[_0x5bda('0x1a')],_0x5c3ceb=_0x17558['offset']+_0x17558[_0x5bda('0x1b')],_0xbbeade;if(_0x5c3ceb>=_0x462d33){_0x5c3ceb=_0x462d33;_0xbbeade=0xc8;}else{_0xbbeade=0xce;}_0x293fce['status'](_0xbbeade);return _0x293fce['set'](_0x5bda('0x1c'),_0x651ae7+'-'+_0x5c3ceb+'/'+_0x462d33)['json'](_0x7f4c02);}return null;};}function patchUpdates(_0x47e88e){return function(_0x204ad4){try{jsonpatch['apply'](_0x204ad4,_0x47e88e,!![]);}catch(_0x49fb8b){return BPromise['reject'](_0x49fb8b);}return _0x204ad4[_0x5bda('0x1d')]();};}function saveUpdates(_0x26b74a,_0x43f631){return function(_0x8cbd74){if(_0x8cbd74){return _0x8cbd74[_0x5bda('0x1e')](_0x26b74a)['then'](function(_0x4a8963){return _0x4a8963;});}return null;};}function removeEntity(_0x5ec4b2,_0x149836){return function(_0x4040d0){if(_0x4040d0){return _0x4040d0[_0x5bda('0x1f')]()[_0x5bda('0x20')](function(){_0x5ec4b2[_0x5bda('0x18')](0xcc)[_0x5bda('0x17')]();});}};}function handleEntityNotFound(_0x3e3719,_0x6d370c){return function(_0x57a167){if(!_0x57a167){_0x3e3719[_0x5bda('0x16')](0x194);}return _0x57a167;};}function handleError(_0x232715,_0x578b8a){_0x578b8a=_0x578b8a||0x1f4;return function(_0x48986a){logger[_0x5bda('0x21')](_0x48986a[_0x5bda('0x22')]);if(_0x48986a[_0x5bda('0x23')]){delete _0x48986a[_0x5bda('0x23')];}_0x232715[_0x5bda('0x18')](_0x578b8a)[_0x5bda('0x24')](_0x48986a);};}exports[_0x5bda('0x25')]=function(_0x1e48cf,_0x40f16c){var _0x58983c={},_0x363fc2={},_0x398414={'count':0x0,'rows':[]};var _0x5d42d8=_[_0x5bda('0x26')](db['FreshdeskField'][_0x5bda('0x27')],function(_0x5237bf){return{'name':_0x5237bf['fieldName'],'type':_0x5237bf[_0x5bda('0x28')]['key']};});_0x363fc2[_0x5bda('0x29')]=_['map'](_0x5d42d8,_0x5bda('0x23'));_0x363fc2[_0x5bda('0x2a')]=_[_0x5bda('0x2b')](_0x1e48cf['query']);_0x363fc2[_0x5bda('0x2c')]=_[_0x5bda('0x2d')](_0x363fc2[_0x5bda('0x29')],_0x363fc2[_0x5bda('0x2a')]);_0x58983c[_0x5bda('0x2e')]=_['intersection'](_0x363fc2[_0x5bda('0x29')],qs['fields'](_0x1e48cf[_0x5bda('0x2a')]['fields']));_0x58983c[_0x5bda('0x2e')]=_0x58983c[_0x5bda('0x2e')]['length']?_0x58983c['attributes']:_0x363fc2[_0x5bda('0x29')];if(!_0x1e48cf[_0x5bda('0x2a')]['hasOwnProperty']('nolimit')){_0x58983c['limit']=qs[_0x5bda('0x1b')](_0x1e48cf[_0x5bda('0x2a')][_0x5bda('0x1b')]);_0x58983c['offset']=qs[_0x5bda('0x1a')](_0x1e48cf[_0x5bda('0x2a')][_0x5bda('0x1a')]);}_0x58983c[_0x5bda('0x2f')]=qs[_0x5bda('0x30')](_0x1e48cf[_0x5bda('0x2a')][_0x5bda('0x30')]);_0x58983c[_0x5bda('0x31')]=qs['filters'](_[_0x5bda('0x32')](_0x1e48cf[_0x5bda('0x2a')],_0x363fc2[_0x5bda('0x2c')]),_0x5d42d8);if(_0x1e48cf[_0x5bda('0x2a')][_0x5bda('0x33')]){_0x58983c['where']=_[_0x5bda('0x34')](_0x58983c[_0x5bda('0x31')],{'$or':_[_0x5bda('0x26')](_0x5d42d8,function(_0x221370){if(_0x221370[_0x5bda('0x28')]!=='VIRTUAL'){var _0x20c7e3={};_0x20c7e3[_0x221370[_0x5bda('0x23')]]={'$like':'%'+_0x1e48cf[_0x5bda('0x2a')][_0x5bda('0x33')]+'%'};return _0x20c7e3;}})});}_0x58983c=_[_0x5bda('0x34')]({},_0x58983c,_0x1e48cf[_0x5bda('0x35')]);var _0x5c5f50={'where':_0x58983c[_0x5bda('0x31')]};return db[_0x5bda('0x36')]['count'](_0x5c5f50)[_0x5bda('0x20')](function(_0x45692b){_0x398414[_0x5bda('0x19')]=_0x45692b;if(_0x1e48cf['query']['includeAll']){_0x58983c[_0x5bda('0x37')]=[{'all':!![]}];}return db[_0x5bda('0x36')][_0x5bda('0x38')](_0x58983c);})['then'](function(_0x17ca75){_0x398414[_0x5bda('0x39')]=_0x17ca75;return _0x398414;})['then'](respondWithFilteredResult(_0x40f16c,_0x58983c))[_0x5bda('0x3a')](handleError(_0x40f16c,null));};exports[_0x5bda('0x3b')]=function(_0x4155e7,_0x16cd1f){var _0xb972a5={'raw':!![],'where':{'id':_0x4155e7['params']['id']}},_0x10c815={};_0x10c815[_0x5bda('0x29')]=_['keys'](db['FreshdeskField'][_0x5bda('0x27')]);_0x10c815['query']=_[_0x5bda('0x2b')](_0x4155e7[_0x5bda('0x2a')]);_0x10c815[_0x5bda('0x2c')]=_[_0x5bda('0x2d')](_0x10c815[_0x5bda('0x29')],_0x10c815['query']);_0xb972a5[_0x5bda('0x2e')]=_[_0x5bda('0x2d')](_0x10c815[_0x5bda('0x29')],qs[_0x5bda('0x3c')](_0x4155e7[_0x5bda('0x2a')][_0x5bda('0x3c')]));_0xb972a5[_0x5bda('0x2e')]=_0xb972a5[_0x5bda('0x2e')][_0x5bda('0x3d')]?_0xb972a5[_0x5bda('0x2e')]:_0x10c815['model'];if(_0x4155e7[_0x5bda('0x2a')][_0x5bda('0x3e')]){_0xb972a5[_0x5bda('0x37')]=[{'all':!![]}];}_0xb972a5=_[_0x5bda('0x34')]({},_0xb972a5,_0x4155e7[_0x5bda('0x35')]);return db['FreshdeskField'][_0x5bda('0x3f')](_0xb972a5)['then'](handleEntityNotFound(_0x16cd1f,null))[_0x5bda('0x20')](respondWithResult(_0x16cd1f,null))['catch'](handleError(_0x16cd1f,null));};exports[_0x5bda('0x40')]=function(_0xc58e6c,_0x3f3f93){return db['FreshdeskField'][_0x5bda('0x40')](_0xc58e6c[_0x5bda('0x41')],{})[_0x5bda('0x20')](respondWithResult(_0x3f3f93,0xc9))[_0x5bda('0x3a')](handleError(_0x3f3f93,null));};exports[_0x5bda('0x1e')]=function(_0x2e1937,_0x3e9a37){if(_0x2e1937[_0x5bda('0x41')]['id']){delete _0x2e1937[_0x5bda('0x41')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x2e1937[_0x5bda('0x42')]['id']}})['then'](handleEntityNotFound(_0x3e9a37,null))[_0x5bda('0x20')](saveUpdates(_0x2e1937[_0x5bda('0x41')],null))['then'](respondWithResult(_0x3e9a37,null))[_0x5bda('0x3a')](handleError(_0x3e9a37,null));};exports['destroy']=function(_0x4e871d,_0x2a0368){return db[_0x5bda('0x36')][_0x5bda('0x3f')]({'where':{'id':_0x4e871d[_0x5bda('0x42')]['id']}})[_0x5bda('0x20')](handleEntityNotFound(_0x2a0368,null))['then'](removeEntity(_0x2a0368,null))['catch'](handleError(_0x2a0368,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 02973d7..19c1ad3 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 _0x1663=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1663,0x1c7));var _0x3166=function(_0x2a92e5,_0x5519c1){_0x2a92e5=_0x2a92e5-0x0;var _0x3bf96e=_0x1663[_0x2a92e5];return _0x3bf96e;};'use strict';var _=require(_0x3166('0x0'));var util=require('util');var logger=require(_0x3166('0x1'))(_0x3166('0x2'));var moment=require(_0x3166('0x3'));var BPromise=require(_0x3166('0x4'));var rp=require(_0x3166('0x5'));var fs=require('fs');var path=require(_0x3166('0x6'));var rimraf=require('rimraf');var config=require(_0x3166('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0x3166('0x8')]=function(_0x1f8a62,_0x50259b){return _0x1f8a62[_0x3166('0x9')]('FreshdeskField',attributes,{'tableName':_0x3166('0xa'),'paranoid':![],'indexes':[{'name':_0x3166('0xb'),'fields':[_0x3166('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe4bd=['exports','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./intFreshdeskField.attributes'];(function(_0x19b59e,_0x2272fc){var _0x13d65c=function(_0x3065f4){while(--_0x3065f4){_0x19b59e['push'](_0x19b59e['shift']());}};_0x13d65c(++_0x2272fc);}(_0xe4bd,0x118));var _0xde4b=function(_0x499cd9,_0x5b8ade){_0x499cd9=_0x499cd9-0x0;var _0x1033e0=_0xe4bd[_0x499cd9];return _0x1033e0;};'use strict';var _=require(_0xde4b('0x0'));var util=require(_0xde4b('0x1'));var logger=require(_0xde4b('0x2'))(_0xde4b('0x3'));var moment=require(_0xde4b('0x4'));var BPromise=require(_0xde4b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xde4b('0x6'));var attributes=require(_0xde4b('0x7'));module[_0xde4b('0x8')]=function(_0x3a3fee,_0x12537a){return _0x3a3fee['define']('FreshdeskField',attributes,{'tableName':_0xde4b('0x9'),'paranoid':![],'indexes':[{'name':_0xde4b('0xa'),'fields':['idField',_0xde4b('0xb')],'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 b38283c..56a56b5 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 _0x7a54=['info','FreshdeskField,\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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0xe66209,_0x10ad1c){_0xe66209=_0xe66209-0x0;var _0xe2d034=_0x7a54[_0xe66209];return _0xe2d034;};'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')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4527ac,_0x42534f){var _0x3bb466=function(_0x21da52){while(--_0x21da52){_0x4527ac['push'](_0x4527ac['shift']());}};_0x3bb466(++_0x42534f);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c768b,_0x5e88a6){_0x5c768b=_0x5c768b-0x0;var _0x335af8=_0xb10b[_0x5c768b];return _0x335af8;};'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);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 57ec931..231dc5b 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 _0x7b60=['index','/:id','/:id/configurations','getConfigurations','getFields','post','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated'];(function(_0x1e500e,_0x2c9d74){var _0x10dc5e=function(_0x354423){while(--_0x354423){_0x1e500e['push'](_0x1e500e['shift']());}};_0x10dc5e(++_0x2c9d74);}(_0x7b60,0x129));var _0x07b6=function(_0x270d74,_0x2e7269){_0x270d74=_0x270d74-0x0;var _0x578bcd=_0x7b60[_0x270d74];return _0x578bcd;};'use strict';var multer=require(_0x07b6('0x0'));var util=require(_0x07b6('0x1'));var path=require(_0x07b6('0x2'));var timeout=require('connect-timeout');var express=require(_0x07b6('0x3'));var router=express[_0x07b6('0x4')]();var auth=require(_0x07b6('0x5'));var interaction=require(_0x07b6('0x6'));var config=require(_0x07b6('0x7'));var controller=require(_0x07b6('0x8'));router[_0x07b6('0x9')]('/',auth[_0x07b6('0xa')](),controller[_0x07b6('0xb')]);router[_0x07b6('0x9')](_0x07b6('0xc'),auth[_0x07b6('0xa')](),controller['show']);router['get'](_0x07b6('0xd'),auth[_0x07b6('0xa')](),controller[_0x07b6('0xe')]);router[_0x07b6('0x9')]('/:id/fields',auth[_0x07b6('0xa')](),controller[_0x07b6('0xf')]);router[_0x07b6('0x10')]('/',auth[_0x07b6('0xa')](),controller[_0x07b6('0x11')]);router['post'](_0x07b6('0xd'),auth[_0x07b6('0xa')](),controller['addConfiguration']);router[_0x07b6('0x12')]('/:id',auth[_0x07b6('0xa')](),controller[_0x07b6('0x13')]);router[_0x07b6('0x14')](_0x07b6('0xc'),auth[_0x07b6('0xa')](),controller['destroy']);module[_0x07b6('0x15')]=router; \ No newline at end of file +var _0xdf11=['destroy','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','addConfiguration','put','/:id','update'];(function(_0x2887dd,_0x1ff8d5){var _0x430bad=function(_0x526370){while(--_0x526370){_0x2887dd['push'](_0x2887dd['shift']());}};_0x430bad(++_0x1ff8d5);}(_0xdf11,0x1f1));var _0x1df1=function(_0x934c05,_0x2e68fd){_0x934c05=_0x934c05-0x0;var _0x1deeab=_0xdf11[_0x934c05];return _0x1deeab;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1df1('0x0'));var express=require('express');var router=express['Router']();var auth=require(_0x1df1('0x1'));var interaction=require(_0x1df1('0x2'));var config=require(_0x1df1('0x3'));var controller=require(_0x1df1('0x4'));router[_0x1df1('0x5')]('/',auth[_0x1df1('0x6')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1df1('0x7')]);router[_0x1df1('0x5')](_0x1df1('0x8'),auth[_0x1df1('0x6')](),controller['getConfigurations']);router[_0x1df1('0x5')](_0x1df1('0x9'),auth[_0x1df1('0x6')](),controller[_0x1df1('0xa')]);router['post']('/',auth[_0x1df1('0x6')](),controller['create']);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x1df1('0xb')]);router[_0x1df1('0xc')](_0x1df1('0xd'),auth['isAuthenticated'](),controller[_0x1df1('0xe')]);router['delete'](_0x1df1('0xd'),auth[_0x1df1('0x6')](),controller[_0x1df1('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 321e5e6..6117b6f 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 _0xad5f=['exports','STRING','username','remoteUri','sequelize'];(function(_0x146bce,_0xe08da){var _0x460858=function(_0x1d562f){while(--_0x1d562f){_0x146bce['push'](_0x146bce['shift']());}};_0x460858(++_0xe08da);}(_0xad5f,0x1a8));var _0xfad5=function(_0x446970,_0x2e8abc){_0x446970=_0x446970-0x0;var _0xccb49a=_0xad5f[_0x446970];return _0xccb49a;};'use strict';var Sequelize=require(_0xfad5('0x0'));module[_0xfad5('0x1')]={'name':{'type':Sequelize[_0xfad5('0x2')]},'description':{'type':Sequelize[_0xfad5('0x2')]},'username':{'type':Sequelize[_0xfad5('0x2')],'unique':_0xfad5('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfad5('0x2')],'unique':_0xfad5('0x4')},'serverUrl':{'type':Sequelize[_0xfad5('0x2')]}}; \ No newline at end of file +var _0x3da6=['STRING','username','remoteUri','sequelize','exports'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x3da6,0xc1));var _0x63da=function(_0x4cc892,_0x43fa25){_0x4cc892=_0x4cc892-0x0;var _0x95ac66=_0x3da6[_0x4cc892];return _0x95ac66;};'use strict';var Sequelize=require(_0x63da('0x0'));module[_0x63da('0x1')]={'name':{'type':Sequelize[_0x63da('0x2')]},'description':{'type':Sequelize[_0x63da('0x2')]},'username':{'type':Sequelize[_0x63da('0x2')],'unique':_0x63da('0x3')},'apiKey':{'type':Sequelize[_0x63da('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x63da('0x4')},'serverUrl':{'type':Sequelize[_0x63da('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 8acd38f..261eff4 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 _0xe2f0=['destroy','sendStatus','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','find','create','body','FreshsalesConfiguration','getConfigurations','hasOwnProperty','addConfiguration','findOne','getSubjects','channel','getDescriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','slice','substring','GET','format','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','count','offset','Content-Range','apply','reject','save','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe2f0,0xb7));var _0x0e2f=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0xe2f0[_0x2b0bc2];return _0x56e5b9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0e2f('0x0'));var rimraf=require(_0x0e2f('0x1'));var zipdir=require(_0x0e2f('0x2'));var jsonpatch=require(_0x0e2f('0x3'));var rp=require('request-promise');var moment=require(_0x0e2f('0x4'));var BPromise=require(_0x0e2f('0x5'));var Mustache=require('mustache');var util=require(_0x0e2f('0x6'));var path=require(_0x0e2f('0x7'));var sox=require(_0x0e2f('0x8'));var csv=require(_0x0e2f('0x9'));var ejs=require(_0x0e2f('0xa'));var fs=require('fs');var _=require(_0x0e2f('0xb'));var squel=require(_0x0e2f('0xc'));var crypto=require(_0x0e2f('0xd'));var jsforce=require(_0x0e2f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e2f('0x9'));var querystring=require(_0x0e2f('0xf'));var Papa=require(_0x0e2f('0x10'));var Redis=require('ioredis');var authService=require(_0x0e2f('0x11'));var qs=require(_0x0e2f('0x12'));var as=require(_0x0e2f('0x13'));var hardwareService=require(_0x0e2f('0x14'));var logger=require(_0x0e2f('0x15'))(_0x0e2f('0x16'));var utils=require('../../config/utils');var config=require(_0x0e2f('0x17'));var db=require(_0x0e2f('0x18'))['db'];var integrations=require(_0x0e2f('0x19'));var jayson=require(_0x0e2f('0x1a'));var client=jayson[_0x0e2f('0x1b')][_0x0e2f('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2eaac4,_0x2c4462,_0x4d6514){if(_0x4d6514){var _0x1e7e85=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1e7e85[_0x0e2f('0x1d')](_0x2c4462)){return _0x2eaac4;}else{throw new db[(_0x0e2f('0x1e'))][(_0x0e2f('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2eaac4;}}function respondWithRpcPromise(_0x1e28f9,_0x1d1b0a,_0x540fc4,_0x522e0e){return new BPromise(function(_0x316c59,_0x51d49a){var _0x49bd94=_0x522e0e||client;return _0x49bd94[_0x0e2f('0x20')](_0x1e28f9,_0x540fc4)[_0x0e2f('0x21')](function(_0x558fcc){logger[_0x0e2f('0x22')](_0x0e2f('0x23'),_0x1d1b0a,_0x0e2f('0x24'));logger[_0x0e2f('0x25')](_0x0e2f('0x26'),_0x1d1b0a,_0x0e2f('0x24'),JSON[_0x0e2f('0x27')](_0x558fcc));if(_0x558fcc[_0x0e2f('0x28')]){if(_0x558fcc[_0x0e2f('0x28')][_0x0e2f('0x29')]===0x1f4){logger[_0x0e2f('0x28')](_0x0e2f('0x23'),_0x1d1b0a,_0x558fcc['error'][_0x0e2f('0x2a')]);return _0x51d49a(_0x558fcc[_0x0e2f('0x28')][_0x0e2f('0x2a')]);}logger[_0x0e2f('0x28')](_0x0e2f('0x23'),_0x1d1b0a,_0x558fcc[_0x0e2f('0x28')][_0x0e2f('0x2a')]);return _0x316c59(_0x558fcc[_0x0e2f('0x28')]['message']);}else{logger[_0x0e2f('0x22')](_0x0e2f('0x23'),_0x1d1b0a,_0x0e2f('0x24'));_0x316c59(_0x558fcc[_0x0e2f('0x2b')]['message']);}})[_0x0e2f('0x2c')](function(_0x2f8203){logger[_0x0e2f('0x28')](_0x0e2f('0x23'),_0x1d1b0a,_0x2f8203);_0x51d49a(_0x2f8203);});});}function respondWithStatusCode(_0x3a6097,_0x5a7b7e){_0x5a7b7e=_0x5a7b7e||0xcc;return function(_0x57bed1){if(_0x57bed1){return _0x3a6097['sendStatus'](_0x5a7b7e);}return _0x3a6097['status'](_0x5a7b7e)[_0x0e2f('0x2d')]();};}function respondWithResult(_0x4bd289,_0x13fa7a){_0x13fa7a=_0x13fa7a||0xc8;return function(_0x32ce96){if(_0x32ce96){return _0x4bd289[_0x0e2f('0x2e')](_0x13fa7a)[_0x0e2f('0x2f')](_0x32ce96);}};}function respondWithFilteredResult(_0x6b0b40,_0x2c77c0){return function(_0x5e4b99){if(_0x5e4b99){var _0x210a7f=_0x5e4b99[_0x0e2f('0x30')],_0x3dfb87=_0x2c77c0[_0x0e2f('0x31')],_0x456dd1=_0x2c77c0[_0x0e2f('0x31')]+_0x2c77c0['limit'],_0x3b6749;if(_0x456dd1>=_0x210a7f){_0x456dd1=_0x210a7f;_0x3b6749=0xc8;}else{_0x3b6749=0xce;}_0x6b0b40[_0x0e2f('0x2e')](_0x3b6749);return _0x6b0b40['set'](_0x0e2f('0x32'),_0x3dfb87+'-'+_0x456dd1+'/'+_0x210a7f)['json'](_0x5e4b99);}return null;};}function patchUpdates(_0x1d89d6){return function(_0x1af469){try{jsonpatch[_0x0e2f('0x33')](_0x1af469,_0x1d89d6,!![]);}catch(_0xe9f52f){return BPromise[_0x0e2f('0x34')](_0xe9f52f);}return _0x1af469[_0x0e2f('0x35')]();};}function saveUpdates(_0x29fb88,_0x34b32b){return function(_0x1e3d09){if(_0x1e3d09){return _0x1e3d09[_0x0e2f('0x36')](_0x29fb88)[_0x0e2f('0x21')](function(_0x47747a){return _0x47747a;});}return null;};}function removeEntity(_0x1da2a2,_0x1fa35b){return function(_0xb2f30d){if(_0xb2f30d){return _0xb2f30d[_0x0e2f('0x37')]()['then'](function(){_0x1da2a2[_0x0e2f('0x2e')](0xcc)[_0x0e2f('0x2d')]();});}};}function handleEntityNotFound(_0x4efa5a,_0x488fdb){return function(_0x25fd97){if(!_0x25fd97){_0x4efa5a[_0x0e2f('0x38')](0x194);}return _0x25fd97;};}function handleError(_0x5c9a23,_0x54f488){_0x54f488=_0x54f488||0x1f4;return function(_0x5adc40){logger[_0x0e2f('0x28')](_0x5adc40[_0x0e2f('0x39')]);if(_0x5adc40[_0x0e2f('0x3a')]){delete _0x5adc40[_0x0e2f('0x3a')];}_0x5c9a23[_0x0e2f('0x2e')](_0x54f488)[_0x0e2f('0x3b')](_0x5adc40);};}exports[_0x0e2f('0x3c')]=function(_0x45eece,_0x5d2009){var _0x465acd={},_0x5778b2={},_0x3504bf={'count':0x0,'rows':[]};var _0x191650=_[_0x0e2f('0x3d')](db[_0x0e2f('0x3e')][_0x0e2f('0x3f')],function(_0x20c270){return{'name':_0x20c270[_0x0e2f('0x40')],'type':_0x20c270['type'][_0x0e2f('0x41')]};});_0x5778b2[_0x0e2f('0x42')]=_[_0x0e2f('0x3d')](_0x191650,_0x0e2f('0x3a'));_0x5778b2[_0x0e2f('0x43')]=_[_0x0e2f('0x44')](_0x45eece[_0x0e2f('0x43')]);_0x5778b2[_0x0e2f('0x45')]=_['intersection'](_0x5778b2[_0x0e2f('0x42')],_0x5778b2[_0x0e2f('0x43')]);_0x465acd[_0x0e2f('0x46')]=_[_0x0e2f('0x47')](_0x5778b2[_0x0e2f('0x42')],qs['fields'](_0x45eece[_0x0e2f('0x43')][_0x0e2f('0x48')]));_0x465acd[_0x0e2f('0x46')]=_0x465acd['attributes'][_0x0e2f('0x49')]?_0x465acd[_0x0e2f('0x46')]:_0x5778b2['model'];if(!_0x45eece[_0x0e2f('0x43')]['hasOwnProperty'](_0x0e2f('0x4a'))){_0x465acd[_0x0e2f('0x4b')]=qs[_0x0e2f('0x4b')](_0x45eece[_0x0e2f('0x43')][_0x0e2f('0x4b')]);_0x465acd['offset']=qs[_0x0e2f('0x31')](_0x45eece[_0x0e2f('0x43')][_0x0e2f('0x31')]);}_0x465acd[_0x0e2f('0x4c')]=qs[_0x0e2f('0x4d')](_0x45eece[_0x0e2f('0x43')]['sort']);_0x465acd[_0x0e2f('0x4e')]=qs[_0x0e2f('0x45')](_[_0x0e2f('0x4f')](_0x45eece[_0x0e2f('0x43')],_0x5778b2['filters']),_0x191650);if(_0x45eece[_0x0e2f('0x43')][_0x0e2f('0x50')]){_0x465acd[_0x0e2f('0x4e')]=_['merge'](_0x465acd[_0x0e2f('0x4e')],{'$or':_['map'](_0x191650,function(_0x134b00){if(_0x134b00[_0x0e2f('0x51')]!==_0x0e2f('0x52')){var _0x4fcb8c={};_0x4fcb8c[_0x134b00[_0x0e2f('0x3a')]]={'$like':'%'+_0x45eece[_0x0e2f('0x43')][_0x0e2f('0x50')]+'%'};return _0x4fcb8c;}})});}_0x465acd=_[_0x0e2f('0x53')]({},_0x465acd,_0x45eece[_0x0e2f('0x54')]);var _0x164365={'where':_0x465acd[_0x0e2f('0x4e')]};return db[_0x0e2f('0x3e')]['count'](_0x164365)[_0x0e2f('0x21')](function(_0x1c87af){_0x3504bf[_0x0e2f('0x30')]=_0x1c87af;if(_0x45eece[_0x0e2f('0x43')][_0x0e2f('0x55')]){_0x465acd['include']=[{'all':!![]}];}return db[_0x0e2f('0x3e')][_0x0e2f('0x56')](_0x465acd);})[_0x0e2f('0x21')](function(_0x31c7ba){_0x3504bf[_0x0e2f('0x57')]=_0x31c7ba;return _0x3504bf;})['then'](respondWithFilteredResult(_0x5d2009,_0x465acd))[_0x0e2f('0x2c')](handleError(_0x5d2009,null));};exports[_0x0e2f('0x58')]=function(_0x4bd82c,_0xc7d53b){var _0x29d47d={'raw':![],'where':{'id':_0x4bd82c[_0x0e2f('0x59')]['id']}},_0x35622b={};_0x35622b[_0x0e2f('0x42')]=_[_0x0e2f('0x44')](db['FreshsalesAccount'][_0x0e2f('0x3f')]);_0x35622b['query']=_['keys'](_0x4bd82c['query']);_0x35622b[_0x0e2f('0x45')]=_['intersection'](_0x35622b['model'],_0x35622b[_0x0e2f('0x43')]);_0x29d47d['attributes']=_['intersection'](_0x35622b[_0x0e2f('0x42')],qs[_0x0e2f('0x48')](_0x4bd82c[_0x0e2f('0x43')][_0x0e2f('0x48')]));_0x29d47d[_0x0e2f('0x46')]=_0x29d47d['attributes']['length']?_0x29d47d['attributes']:_0x35622b[_0x0e2f('0x42')];if(_0x4bd82c['query']['includeAll']){_0x29d47d[_0x0e2f('0x5a')]=[{'all':!![]}];}_0x29d47d=_[_0x0e2f('0x53')]({},_0x29d47d,_0x4bd82c[_0x0e2f('0x54')]);return db[_0x0e2f('0x3e')][_0x0e2f('0x5b')](_0x29d47d)[_0x0e2f('0x21')](handleEntityNotFound(_0xc7d53b,null))[_0x0e2f('0x21')](respondWithResult(_0xc7d53b,null))[_0x0e2f('0x2c')](handleError(_0xc7d53b,null));};exports[_0x0e2f('0x5c')]=function(_0x189cc0,_0x1f66f1){return db[_0x0e2f('0x3e')][_0x0e2f('0x5c')](_0x189cc0[_0x0e2f('0x5d')],{})[_0x0e2f('0x21')](respondWithResult(_0x1f66f1,0xc9))[_0x0e2f('0x2c')](handleError(_0x1f66f1,null));};exports['update']=function(_0x1019b0,_0x3bfd21){if(_0x1019b0[_0x0e2f('0x5d')]['id']){delete _0x1019b0[_0x0e2f('0x5d')]['id'];}return db[_0x0e2f('0x3e')][_0x0e2f('0x5b')]({'where':{'id':_0x1019b0[_0x0e2f('0x59')]['id']}})[_0x0e2f('0x21')](handleEntityNotFound(_0x3bfd21,null))[_0x0e2f('0x21')](saveUpdates(_0x1019b0[_0x0e2f('0x5d')],null))[_0x0e2f('0x21')](respondWithResult(_0x3bfd21,null))[_0x0e2f('0x2c')](handleError(_0x3bfd21,null));};exports[_0x0e2f('0x37')]=function(_0x15f1ab,_0x198b47){return db['FreshsalesAccount'][_0x0e2f('0x5b')]({'where':{'id':_0x15f1ab[_0x0e2f('0x59')]['id']}})[_0x0e2f('0x21')](handleEntityNotFound(_0x198b47,null))['then'](removeEntity(_0x198b47,null))['catch'](handleError(_0x198b47,null));};exports['getConfigurations']=function(_0x2b524c,_0x478f2b,_0x17f936){var _0x2c3f4f={};var _0x3834f4={};var _0xe350bd;var _0x2f4592;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x2b524c[_0x0e2f('0x59')]['id']}})[_0x0e2f('0x21')](handleEntityNotFound(_0x478f2b,null))[_0x0e2f('0x21')](function(_0x46b33f){if(_0x46b33f){_0xe350bd=_0x46b33f;_0x3834f4[_0x0e2f('0x42')]=_[_0x0e2f('0x44')](db[_0x0e2f('0x5e')][_0x0e2f('0x3f')]);_0x3834f4['query']=_[_0x0e2f('0x44')](_0x2b524c[_0x0e2f('0x43')]);_0x3834f4[_0x0e2f('0x45')]=_[_0x0e2f('0x47')](_0x3834f4[_0x0e2f('0x42')],_0x3834f4[_0x0e2f('0x43')]);_0x2c3f4f[_0x0e2f('0x46')]=_[_0x0e2f('0x47')](_0x3834f4[_0x0e2f('0x42')],qs[_0x0e2f('0x48')](_0x2b524c[_0x0e2f('0x43')][_0x0e2f('0x48')]));_0x2c3f4f['attributes']=_0x2c3f4f[_0x0e2f('0x46')]['length']?_0x2c3f4f[_0x0e2f('0x46')]:_0x3834f4[_0x0e2f('0x42')];_0x2c3f4f[_0x0e2f('0x4c')]=qs[_0x0e2f('0x4d')](_0x2b524c[_0x0e2f('0x43')][_0x0e2f('0x4d')]);_0x2c3f4f['where']=qs['filters'](_[_0x0e2f('0x4f')](_0x2b524c['query'],_0x3834f4[_0x0e2f('0x45')]));if(_0x2b524c[_0x0e2f('0x43')][_0x0e2f('0x50')]){_0x2c3f4f[_0x0e2f('0x4e')]=_[_0x0e2f('0x53')](_0x2c3f4f[_0x0e2f('0x4e')],{'$or':_['map'](_0x2c3f4f[_0x0e2f('0x46')],function(_0x30dc20){var _0x514b9f={};_0x514b9f[_0x30dc20]={'$like':'%'+_0x2b524c[_0x0e2f('0x43')]['filter']+'%'};return _0x514b9f;})});}_0x2c3f4f=_['merge']({},_0x2c3f4f,_0x2b524c['options']);return _0xe350bd[_0x0e2f('0x5f')](_0x2c3f4f);}})[_0x0e2f('0x21')](function(_0x48642a){if(_0x48642a){_0x2f4592=_0x48642a[_0x0e2f('0x49')];if(!_0x2b524c[_0x0e2f('0x43')][_0x0e2f('0x60')](_0x0e2f('0x4a'))){_0x2c3f4f[_0x0e2f('0x4b')]=qs[_0x0e2f('0x4b')](_0x2b524c[_0x0e2f('0x43')][_0x0e2f('0x4b')]);_0x2c3f4f['offset']=qs[_0x0e2f('0x31')](_0x2b524c['query'][_0x0e2f('0x31')]);}return _0xe350bd[_0x0e2f('0x5f')](_0x2c3f4f);}})[_0x0e2f('0x21')](function(_0x4f0281){if(_0x4f0281){return _0x4f0281?{'count':_0x2f4592,'rows':_0x4f0281}:null;}})[_0x0e2f('0x21')](respondWithResult(_0x478f2b,null))['catch'](handleError(_0x478f2b,null));};exports[_0x0e2f('0x61')]=function(_0x2f237f,_0x831949,_0x1f7cf6){if(_0x2f237f[_0x0e2f('0x5d')]['id']){delete _0x2f237f['body']['id'];}return db[_0x0e2f('0x3e')][_0x0e2f('0x62')]({'where':{'id':_0x2f237f[_0x0e2f('0x59')]['id']}})[_0x0e2f('0x21')](handleEntityNotFound(_0x831949,null))[_0x0e2f('0x21')](function(_0x1ce4d9){if(_0x1ce4d9){_0x2f237f[_0x0e2f('0x5d')]['AccountId']=_0x1ce4d9['id'];_0x2f237f[_0x0e2f('0x5d')]['Subjects']=integrations[_0x0e2f('0x63')](_0x2f237f[_0x0e2f('0x5d')][_0x0e2f('0x64')],_0x2f237f[_0x0e2f('0x5d')]['type']);_0x2f237f[_0x0e2f('0x5d')]['Descriptions']=integrations[_0x0e2f('0x65')](_0x2f237f['body'][_0x0e2f('0x64')],_0x2f237f[_0x0e2f('0x5d')][_0x0e2f('0x51')]);return db[_0x0e2f('0x5e')][_0x0e2f('0x5c')](_0x2f237f[_0x0e2f('0x5d')],{'include':[{'model':db[_0x0e2f('0x66')],'as':_0x0e2f('0x67')},{'model':db[_0x0e2f('0x66')],'as':'Descriptions'}]});}return null;})[_0x0e2f('0x21')](respondWithResult(_0x831949,null))[_0x0e2f('0x2c')](handleError(_0x831949,null));};exports[_0x0e2f('0x68')]=function(_0x184961,_0x2d506e,_0x438287){var _0x13aa2f='';var _0x1a3bc6='';return db[_0x0e2f('0x3e')][_0x0e2f('0x62')]({'where':{'id':_0x184961[_0x0e2f('0x59')]['id']},'attributes':['id',_0x0e2f('0x69'),_0x0e2f('0x6a'),_0x0e2f('0x6b')]})[_0x0e2f('0x21')](handleEntityNotFound(_0x2d506e,null))['then'](function(_0x33eade){if(_0x33eade){_0x1a3bc6=_0x33eade[_0x0e2f('0x69')];_0x13aa2f=_0x33eade['remoteUri'];var _0x1e4332=_0x33eade[_0x0e2f('0x6a')][_0x0e2f('0x6c')](-0x1);if(_0x1e4332==='/'){_0x13aa2f=_0x13aa2f[_0x0e2f('0x6d')](0x0,_0x13aa2f['lastIndexOf'](_0x1e4332));}return rp({'method':_0x0e2f('0x6e'),'uri':util[_0x0e2f('0x6f')]('%s%s',_0x13aa2f,'/api/selector/owners'),'headers':{'Authorization':_0x0e2f('0x70')+_0x33eade[_0x0e2f('0x6b')]},'json':!![]});}})[_0x0e2f('0x21')](function(_0x5bea82){if(_0x5bea82){var _0x33bd63=_0x5bea82[_0x0e2f('0x71')];var _0x518457=![];var _0x2f9dd2=null;for(_0x2f9dd2=0x0;_0x2f9dd2<_0x33bd63[_0x0e2f('0x49')];_0x2f9dd2++){if(_0x33bd63[_0x2f9dd2][_0x0e2f('0x72')]===_0x1a3bc6){_0x518457=!![];}}if(_0x518457){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x0e2f('0x73')});}}})['then'](respondWithResult(_0x2d506e,null))[_0x0e2f('0x2c')](function(_0x2b1456){var _0x1ef073=_0x184961[_0x0e2f('0x43')][_0x0e2f('0x1d')]?0x1f4:_0x2b1456[_0x0e2f('0x74')]||0x1f4;logger['error'](_0x0e2f('0x75'),'getFields',_0x1ef073,JSON['stringify'](_0x2b1456));delete _0x2b1456[_0x0e2f('0x3a')];if(_0x1ef073===0x191){_0x1ef073=0x190;}_0x2d506e[_0x0e2f('0x2e')](_0x1ef073)[_0x0e2f('0x3b')](_0x184961[_0x0e2f('0x43')][_0x0e2f('0x1d')]?{'message':_0x0e2f('0x76'),'statusCode':_0x2b1456[_0x0e2f('0x74')]}:_0x2b1456);});}; \ No newline at end of file +var _0xc2a0=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','FreshsalesAccount','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','show','params','length','includeAll','include','find','create','body','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','format','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','statusCode','Wrong\x20credentials','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0x5bc1b8,_0x156228){var _0x36fc5b=function(_0x240282){while(--_0x240282){_0x5bc1b8['push'](_0x5bc1b8['shift']());}};_0x36fc5b(++_0x156228);}(_0xc2a0,0x1c6));var _0x0c2a=function(_0x13dea0,_0x2e4096){_0x13dea0=_0x13dea0-0x0;var _0x38a143=_0xc2a0[_0x13dea0];return _0x38a143;};'use strict';var pdf=require(_0x0c2a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0c2a('0x1'));var zipdir=require(_0x0c2a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c2a('0x3'));var moment=require('moment');var BPromise=require(_0x0c2a('0x4'));var Mustache=require(_0x0c2a('0x5'));var util=require(_0x0c2a('0x6'));var path=require(_0x0c2a('0x7'));var sox=require(_0x0c2a('0x8'));var csv=require(_0x0c2a('0x9'));var ejs=require(_0x0c2a('0xa'));var fs=require('fs');var _=require(_0x0c2a('0xb'));var squel=require(_0x0c2a('0xc'));var crypto=require(_0x0c2a('0xd'));var jsforce=require(_0x0c2a('0xe'));var deskjs=require(_0x0c2a('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0c2a('0x10'));var Papa=require(_0x0c2a('0x11'));var Redis=require(_0x0c2a('0x12'));var authService=require(_0x0c2a('0x13'));var qs=require(_0x0c2a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c2a('0x15'));var logger=require(_0x0c2a('0x16'))(_0x0c2a('0x17'));var utils=require(_0x0c2a('0x18'));var config=require(_0x0c2a('0x19'));var db=require(_0x0c2a('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x0c2a('0x1b'));var client=jayson[_0x0c2a('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x6b3f1f,_0x390461,_0x3dba50){if(_0x3dba50){var _0x4c99e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4c99e4[_0x0c2a('0x1d')](_0x390461)){return _0x6b3f1f;}else{throw new db[(_0x0c2a('0x1e'))][(_0x0c2a('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x6b3f1f;}}function respondWithRpcPromise(_0x5d01a6,_0x5cf599,_0x22fd06,_0x6150f1){return new BPromise(function(_0x258cd9,_0x3b0027){var _0x202c9d=_0x6150f1||client;return _0x202c9d[_0x0c2a('0x20')](_0x5d01a6,_0x22fd06)[_0x0c2a('0x21')](function(_0x3898ec){logger[_0x0c2a('0x22')](_0x0c2a('0x23'),_0x5cf599,'request\x20sent');logger['debug'](_0x0c2a('0x24'),_0x5cf599,_0x0c2a('0x25'),JSON[_0x0c2a('0x26')](_0x3898ec));if(_0x3898ec[_0x0c2a('0x27')]){if(_0x3898ec[_0x0c2a('0x27')][_0x0c2a('0x28')]===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x5cf599,_0x3898ec[_0x0c2a('0x27')][_0x0c2a('0x29')]);return _0x3b0027(_0x3898ec[_0x0c2a('0x27')][_0x0c2a('0x29')]);}logger[_0x0c2a('0x27')](_0x0c2a('0x23'),_0x5cf599,_0x3898ec[_0x0c2a('0x27')]['message']);return _0x258cd9(_0x3898ec[_0x0c2a('0x27')][_0x0c2a('0x29')]);}else{logger[_0x0c2a('0x22')](_0x0c2a('0x23'),_0x5cf599,_0x0c2a('0x25'));_0x258cd9(_0x3898ec[_0x0c2a('0x2a')][_0x0c2a('0x29')]);}})[_0x0c2a('0x2b')](function(_0xb95e38){logger[_0x0c2a('0x27')](_0x0c2a('0x23'),_0x5cf599,_0xb95e38);_0x3b0027(_0xb95e38);});});}function respondWithStatusCode(_0x11a760,_0x316edc){_0x316edc=_0x316edc||0xcc;return function(_0x514e93){if(_0x514e93){return _0x11a760[_0x0c2a('0x2c')](_0x316edc);}return _0x11a760[_0x0c2a('0x2d')](_0x316edc)[_0x0c2a('0x2e')]();};}function respondWithResult(_0x4302cb,_0x14df51){_0x14df51=_0x14df51||0xc8;return function(_0x5d46a9){if(_0x5d46a9){return _0x4302cb[_0x0c2a('0x2d')](_0x14df51)[_0x0c2a('0x2f')](_0x5d46a9);}};}function respondWithFilteredResult(_0x16fc1b,_0x1e7ea1){return function(_0x4ae6aa){if(_0x4ae6aa){var _0x5c813c=_0x4ae6aa['count'],_0xe0bf27=_0x1e7ea1[_0x0c2a('0x30')],_0x2e728e=_0x1e7ea1[_0x0c2a('0x30')]+_0x1e7ea1[_0x0c2a('0x31')],_0x36d08f;if(_0x2e728e>=_0x5c813c){_0x2e728e=_0x5c813c;_0x36d08f=0xc8;}else{_0x36d08f=0xce;}_0x16fc1b['status'](_0x36d08f);return _0x16fc1b[_0x0c2a('0x32')](_0x0c2a('0x33'),_0xe0bf27+'-'+_0x2e728e+'/'+_0x5c813c)[_0x0c2a('0x2f')](_0x4ae6aa);}return null;};}function patchUpdates(_0x10282a){return function(_0x2819d2){try{jsonpatch[_0x0c2a('0x34')](_0x2819d2,_0x10282a,!![]);}catch(_0x22240e){return BPromise[_0x0c2a('0x35')](_0x22240e);}return _0x2819d2[_0x0c2a('0x36')]();};}function saveUpdates(_0x4bcb55,_0x5659ad){return function(_0x2b0dfa){if(_0x2b0dfa){return _0x2b0dfa[_0x0c2a('0x37')](_0x4bcb55)[_0x0c2a('0x21')](function(_0x48016c){return _0x48016c;});}return null;};}function removeEntity(_0x152396,_0x534892){return function(_0xe05269){if(_0xe05269){return _0xe05269[_0x0c2a('0x38')]()[_0x0c2a('0x21')](function(){_0x152396[_0x0c2a('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x364fa4,_0x339504){return function(_0x3a2d92){if(!_0x3a2d92){_0x364fa4[_0x0c2a('0x2c')](0x194);}return _0x3a2d92;};}function handleError(_0x3cb6ce,_0x27b2ec){_0x27b2ec=_0x27b2ec||0x1f4;return function(_0x5048e1){logger['error'](_0x5048e1[_0x0c2a('0x39')]);if(_0x5048e1['name']){delete _0x5048e1[_0x0c2a('0x3a')];}_0x3cb6ce['status'](_0x27b2ec)[_0x0c2a('0x3b')](_0x5048e1);};}exports['index']=function(_0x4dcb42,_0xd6576a){var _0x59f3e3={},_0x208df4={},_0x3afe14={'count':0x0,'rows':[]};var _0x437a38=_[_0x0c2a('0x3c')](db[_0x0c2a('0x3d')][_0x0c2a('0x3e')],function(_0x3baa01){return{'name':_0x3baa01['fieldName'],'type':_0x3baa01[_0x0c2a('0x3f')][_0x0c2a('0x40')]};});_0x208df4['model']=_[_0x0c2a('0x3c')](_0x437a38,_0x0c2a('0x3a'));_0x208df4[_0x0c2a('0x41')]=_[_0x0c2a('0x42')](_0x4dcb42[_0x0c2a('0x41')]);_0x208df4[_0x0c2a('0x43')]=_[_0x0c2a('0x44')](_0x208df4[_0x0c2a('0x45')],_0x208df4['query']);_0x59f3e3[_0x0c2a('0x46')]=_[_0x0c2a('0x44')](_0x208df4[_0x0c2a('0x45')],qs[_0x0c2a('0x47')](_0x4dcb42['query'][_0x0c2a('0x47')]));_0x59f3e3[_0x0c2a('0x46')]=_0x59f3e3[_0x0c2a('0x46')]['length']?_0x59f3e3[_0x0c2a('0x46')]:_0x208df4[_0x0c2a('0x45')];if(!_0x4dcb42[_0x0c2a('0x41')][_0x0c2a('0x48')](_0x0c2a('0x49'))){_0x59f3e3[_0x0c2a('0x31')]=qs[_0x0c2a('0x31')](_0x4dcb42['query'][_0x0c2a('0x31')]);_0x59f3e3['offset']=qs[_0x0c2a('0x30')](_0x4dcb42[_0x0c2a('0x41')][_0x0c2a('0x30')]);}_0x59f3e3['order']=qs[_0x0c2a('0x4a')](_0x4dcb42[_0x0c2a('0x41')][_0x0c2a('0x4a')]);_0x59f3e3[_0x0c2a('0x4b')]=qs[_0x0c2a('0x43')](_[_0x0c2a('0x4c')](_0x4dcb42['query'],_0x208df4[_0x0c2a('0x43')]),_0x437a38);if(_0x4dcb42[_0x0c2a('0x41')][_0x0c2a('0x4d')]){_0x59f3e3['where']=_[_0x0c2a('0x4e')](_0x59f3e3[_0x0c2a('0x4b')],{'$or':_['map'](_0x437a38,function(_0x2f2dc0){if(_0x2f2dc0[_0x0c2a('0x3f')]!==_0x0c2a('0x4f')){var _0x1d3760={};_0x1d3760[_0x2f2dc0['name']]={'$like':'%'+_0x4dcb42['query']['filter']+'%'};return _0x1d3760;}})});}_0x59f3e3=_[_0x0c2a('0x4e')]({},_0x59f3e3,_0x4dcb42[_0x0c2a('0x50')]);var _0x452ddb={'where':_0x59f3e3[_0x0c2a('0x4b')]};return db[_0x0c2a('0x3d')][_0x0c2a('0x51')](_0x452ddb)[_0x0c2a('0x21')](function(_0x5d3045){_0x3afe14[_0x0c2a('0x51')]=_0x5d3045;if(_0x4dcb42[_0x0c2a('0x41')]['includeAll']){_0x59f3e3['include']=[{'all':!![]}];}return db[_0x0c2a('0x3d')]['findAll'](_0x59f3e3);})[_0x0c2a('0x21')](function(_0x247e60){_0x3afe14['rows']=_0x247e60;return _0x3afe14;})[_0x0c2a('0x21')](respondWithFilteredResult(_0xd6576a,_0x59f3e3))[_0x0c2a('0x2b')](handleError(_0xd6576a,null));};exports[_0x0c2a('0x52')]=function(_0xc7cb9c,_0x188c0f){var _0x274e9f={'raw':![],'where':{'id':_0xc7cb9c[_0x0c2a('0x53')]['id']}},_0x4505b0={};_0x4505b0['model']=_['keys'](db['FreshsalesAccount'][_0x0c2a('0x3e')]);_0x4505b0[_0x0c2a('0x41')]=_['keys'](_0xc7cb9c['query']);_0x4505b0[_0x0c2a('0x43')]=_[_0x0c2a('0x44')](_0x4505b0[_0x0c2a('0x45')],_0x4505b0[_0x0c2a('0x41')]);_0x274e9f[_0x0c2a('0x46')]=_[_0x0c2a('0x44')](_0x4505b0[_0x0c2a('0x45')],qs['fields'](_0xc7cb9c[_0x0c2a('0x41')]['fields']));_0x274e9f[_0x0c2a('0x46')]=_0x274e9f[_0x0c2a('0x46')][_0x0c2a('0x54')]?_0x274e9f[_0x0c2a('0x46')]:_0x4505b0[_0x0c2a('0x45')];if(_0xc7cb9c[_0x0c2a('0x41')][_0x0c2a('0x55')]){_0x274e9f[_0x0c2a('0x56')]=[{'all':!![]}];}_0x274e9f=_[_0x0c2a('0x4e')]({},_0x274e9f,_0xc7cb9c[_0x0c2a('0x50')]);return db['FreshsalesAccount'][_0x0c2a('0x57')](_0x274e9f)[_0x0c2a('0x21')](handleEntityNotFound(_0x188c0f,null))[_0x0c2a('0x21')](respondWithResult(_0x188c0f,null))[_0x0c2a('0x2b')](handleError(_0x188c0f,null));};exports[_0x0c2a('0x58')]=function(_0x101ab7,_0x38ff61){return db[_0x0c2a('0x3d')]['create'](_0x101ab7[_0x0c2a('0x59')],{})['then'](respondWithResult(_0x38ff61,0xc9))[_0x0c2a('0x2b')](handleError(_0x38ff61,null));};exports[_0x0c2a('0x37')]=function(_0x1ac02e,_0x3b5f11){if(_0x1ac02e[_0x0c2a('0x59')]['id']){delete _0x1ac02e[_0x0c2a('0x59')]['id'];}return db[_0x0c2a('0x3d')][_0x0c2a('0x57')]({'where':{'id':_0x1ac02e[_0x0c2a('0x53')]['id']}})[_0x0c2a('0x21')](handleEntityNotFound(_0x3b5f11,null))[_0x0c2a('0x21')](saveUpdates(_0x1ac02e['body'],null))[_0x0c2a('0x21')](respondWithResult(_0x3b5f11,null))[_0x0c2a('0x2b')](handleError(_0x3b5f11,null));};exports['destroy']=function(_0x46b99e,_0x1366cd){return db[_0x0c2a('0x3d')][_0x0c2a('0x57')]({'where':{'id':_0x46b99e[_0x0c2a('0x53')]['id']}})[_0x0c2a('0x21')](handleEntityNotFound(_0x1366cd,null))['then'](removeEntity(_0x1366cd,null))[_0x0c2a('0x2b')](handleError(_0x1366cd,null));};exports[_0x0c2a('0x5a')]=function(_0x3b3568,_0x8845db,_0x22021f){var _0x541436={};var _0x17a134={};var _0x31ca60;var _0x41d2d4;return db[_0x0c2a('0x3d')][_0x0c2a('0x5b')]({'where':{'id':_0x3b3568[_0x0c2a('0x53')]['id']}})[_0x0c2a('0x21')](handleEntityNotFound(_0x8845db,null))[_0x0c2a('0x21')](function(_0x42ec51){if(_0x42ec51){_0x31ca60=_0x42ec51;_0x17a134[_0x0c2a('0x45')]=_['keys'](db['FreshsalesConfiguration'][_0x0c2a('0x3e')]);_0x17a134[_0x0c2a('0x41')]=_['keys'](_0x3b3568['query']);_0x17a134[_0x0c2a('0x43')]=_[_0x0c2a('0x44')](_0x17a134[_0x0c2a('0x45')],_0x17a134['query']);_0x541436[_0x0c2a('0x46')]=_[_0x0c2a('0x44')](_0x17a134[_0x0c2a('0x45')],qs[_0x0c2a('0x47')](_0x3b3568[_0x0c2a('0x41')][_0x0c2a('0x47')]));_0x541436[_0x0c2a('0x46')]=_0x541436[_0x0c2a('0x46')][_0x0c2a('0x54')]?_0x541436[_0x0c2a('0x46')]:_0x17a134[_0x0c2a('0x45')];_0x541436[_0x0c2a('0x5c')]=qs[_0x0c2a('0x4a')](_0x3b3568[_0x0c2a('0x41')][_0x0c2a('0x4a')]);_0x541436[_0x0c2a('0x4b')]=qs[_0x0c2a('0x43')](_[_0x0c2a('0x4c')](_0x3b3568[_0x0c2a('0x41')],_0x17a134[_0x0c2a('0x43')]));if(_0x3b3568[_0x0c2a('0x41')][_0x0c2a('0x4d')]){_0x541436['where']=_[_0x0c2a('0x4e')](_0x541436[_0x0c2a('0x4b')],{'$or':_['map'](_0x541436['attributes'],function(_0x26e2a2){var _0x2960dd={};_0x2960dd[_0x26e2a2]={'$like':'%'+_0x3b3568[_0x0c2a('0x41')]['filter']+'%'};return _0x2960dd;})});}_0x541436=_['merge']({},_0x541436,_0x3b3568[_0x0c2a('0x50')]);return _0x31ca60[_0x0c2a('0x5a')](_0x541436);}})[_0x0c2a('0x21')](function(_0xf6b84a){if(_0xf6b84a){_0x41d2d4=_0xf6b84a[_0x0c2a('0x54')];if(!_0x3b3568[_0x0c2a('0x41')][_0x0c2a('0x48')]('nolimit')){_0x541436[_0x0c2a('0x31')]=qs[_0x0c2a('0x31')](_0x3b3568[_0x0c2a('0x41')][_0x0c2a('0x31')]);_0x541436[_0x0c2a('0x30')]=qs[_0x0c2a('0x30')](_0x3b3568[_0x0c2a('0x41')]['offset']);}return _0x31ca60[_0x0c2a('0x5a')](_0x541436);}})[_0x0c2a('0x21')](function(_0x3c4d16){if(_0x3c4d16){return _0x3c4d16?{'count':_0x41d2d4,'rows':_0x3c4d16}:null;}})[_0x0c2a('0x21')](respondWithResult(_0x8845db,null))[_0x0c2a('0x2b')](handleError(_0x8845db,null));};exports[_0x0c2a('0x5d')]=function(_0x20977d,_0xd04585,_0x3de5bf){if(_0x20977d[_0x0c2a('0x59')]['id']){delete _0x20977d['body']['id'];}return db[_0x0c2a('0x3d')]['findOne']({'where':{'id':_0x20977d[_0x0c2a('0x53')]['id']}})[_0x0c2a('0x21')](handleEntityNotFound(_0xd04585,null))[_0x0c2a('0x21')](function(_0x5997df){if(_0x5997df){_0x20977d['body'][_0x0c2a('0x5e')]=_0x5997df['id'];_0x20977d[_0x0c2a('0x59')][_0x0c2a('0x5f')]=integrations['getSubjects'](_0x20977d[_0x0c2a('0x59')][_0x0c2a('0x60')],_0x20977d[_0x0c2a('0x59')][_0x0c2a('0x3f')]);_0x20977d[_0x0c2a('0x59')][_0x0c2a('0x61')]=integrations[_0x0c2a('0x62')](_0x20977d[_0x0c2a('0x59')]['channel'],_0x20977d[_0x0c2a('0x59')][_0x0c2a('0x3f')]);return db[_0x0c2a('0x63')][_0x0c2a('0x58')](_0x20977d['body'],{'include':[{'model':db['FreshsalesField'],'as':_0x0c2a('0x5f')},{'model':db[_0x0c2a('0x64')],'as':_0x0c2a('0x61')}]});}return null;})[_0x0c2a('0x21')](respondWithResult(_0xd04585,null))[_0x0c2a('0x2b')](handleError(_0xd04585,null));};exports[_0x0c2a('0x65')]=function(_0x2b9729,_0x5b86c3,_0x1a7d95){var _0x53131c='';var _0x3f2997='';return db[_0x0c2a('0x3d')][_0x0c2a('0x5b')]({'where':{'id':_0x2b9729[_0x0c2a('0x53')]['id']},'attributes':['id',_0x0c2a('0x66'),'remoteUri',_0x0c2a('0x67')]})[_0x0c2a('0x21')](handleEntityNotFound(_0x5b86c3,null))[_0x0c2a('0x21')](function(_0x15063d){if(_0x15063d){_0x3f2997=_0x15063d[_0x0c2a('0x66')];_0x53131c=_0x15063d[_0x0c2a('0x68')];var _0x577ed0=_0x15063d[_0x0c2a('0x68')][_0x0c2a('0x69')](-0x1);if(_0x577ed0==='/'){_0x53131c=_0x53131c[_0x0c2a('0x6a')](0x0,_0x53131c['lastIndexOf'](_0x577ed0));}return rp({'method':'GET','uri':util[_0x0c2a('0x6b')](_0x0c2a('0x6c'),_0x53131c,_0x0c2a('0x6d')),'headers':{'Authorization':'Token\x20token='+_0x15063d[_0x0c2a('0x67')]},'json':!![]});}})['then'](function(_0x1e90ea){if(_0x1e90ea){var _0x2d9362=_0x1e90ea[_0x0c2a('0x6e')];var _0x3a1f6a=![];var _0x224a1b=null;for(_0x224a1b=0x0;_0x224a1b<_0x2d9362['length'];_0x224a1b++){if(_0x2d9362[_0x224a1b][_0x0c2a('0x6f')]===_0x3f2997){_0x3a1f6a=!![];}}if(_0x3a1f6a){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x0c2a('0x70')});}}})[_0x0c2a('0x21')](respondWithResult(_0x5b86c3,null))['catch'](function(_0x375d90){var _0x26035a=_0x2b9729['query'][_0x0c2a('0x1d')]?0x1f4:_0x375d90[_0x0c2a('0x71')]||0x1f4;logger[_0x0c2a('0x27')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x26035a,JSON[_0x0c2a('0x26')](_0x375d90));delete _0x375d90['name'];if(_0x26035a===0x191){_0x26035a=0x190;}_0x5b86c3[_0x0c2a('0x2d')](_0x26035a)[_0x0c2a('0x3b')](_0x2b9729[_0x0c2a('0x41')][_0x0c2a('0x1d')]?{'message':_0x0c2a('0x72'),'statusCode':_0x375d90[_0x0c2a('0x71')]}:_0x375d90);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 1c62eb8..4ffc706 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 _0xd6d6=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2c19d7,_0x240297){_0x2c19d7=_0x2c19d7-0x0;var _0x4f55e6=_0xd6d6[_0x2c19d7];return _0x4f55e6;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var logger=require(_0x6d6d('0x2'))(_0x6d6d('0x3'));var moment=require('moment');var BPromise=require(_0x6d6d('0x4'));var rp=require(_0x6d6d('0x5'));var fs=require('fs');var path=require(_0x6d6d('0x6'));var rimraf=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var attributes=require(_0x6d6d('0x9'));var integrations=require(_0x6d6d('0xa'));module['exports']=function(_0x210ff7,_0x1bf731){return _0x210ff7[_0x6d6d('0xb')](_0x6d6d('0xc'),attributes,{'tableName':_0x6d6d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ad3=['../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x313df3,_0x4fca45){var _0x241d59=function(_0x452786){while(--_0x452786){_0x313df3['push'](_0x313df3['shift']());}};_0x241d59(++_0x4fca45);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x4ed6c7,_0x2e6803){_0x4ed6c7=_0x4ed6c7-0x0;var _0x112d0c=_0x5ad3[_0x4ed6c7];return _0x112d0c;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var logger=require(_0x35ad('0x2'))(_0x35ad('0x3'));var moment=require('moment');var BPromise=require(_0x35ad('0x4'));var rp=require(_0x35ad('0x5'));var fs=require('fs');var path=require(_0x35ad('0x6'));var rimraf=require(_0x35ad('0x7'));var config=require(_0x35ad('0x8'));var attributes=require(_0x35ad('0x9'));var integrations=require(_0x35ad('0xa'));module[_0x35ad('0xb')]=function(_0x36c606,_0x31cc6a){return _0x36c606['define'](_0x35ad('0xc'),attributes,{'tableName':_0x35ad('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 c4a3f63..48491b4 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 _0x2d07=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','attributes','limit','include','map','model','then','stringify','find','raw','where','ShowFreshsalesAccount','lodash'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x2d07,0x13a));var _0x72d0=function(_0x468a77,_0x1382be){_0x468a77=_0x468a77-0x0;var _0x2d1c33=_0x2d07[_0x468a77];return _0x2d1c33;};'use strict';var _=require(_0x72d0('0x0'));var util=require(_0x72d0('0x1'));var moment=require('moment');var BPromise=require(_0x72d0('0x2'));var rs=require(_0x72d0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d0('0x4'))['db'];var utils=require(_0x72d0('0x5'));var logger=require(_0x72d0('0x6'))(_0x72d0('0x7'));var config=require(_0x72d0('0x8'));var jayson=require(_0x72d0('0x9'));var client=jayson['client'][_0x72d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdad2db,_0x2a4100,_0x47a826){return new BPromise(function(_0x4f2c34,_0x6d0ff6){return client['request'](_0xdad2db,_0x47a826)['then'](function(_0x5db523){logger[_0x72d0('0xb')](_0x72d0('0xc'),_0x2a4100,_0x72d0('0xd'));logger[_0x72d0('0xe')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x2a4100,'request\x20sent',JSON['stringify'](_0x5db523));if(_0x5db523[_0x72d0('0xf')]){if(_0x5db523[_0x72d0('0xf')][_0x72d0('0x10')]===0x1f4){logger[_0x72d0('0xf')](_0x72d0('0xc'),_0x2a4100,_0x5db523['error'][_0x72d0('0x11')]);return _0x6d0ff6(_0x5db523[_0x72d0('0xf')][_0x72d0('0x11')]);}logger['error'](_0x72d0('0xc'),_0x2a4100,_0x5db523[_0x72d0('0xf')][_0x72d0('0x11')]);return _0x4f2c34(_0x5db523[_0x72d0('0xf')][_0x72d0('0x11')]);}else{logger[_0x72d0('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0x2a4100,_0x72d0('0xd'));_0x4f2c34(_0x5db523[_0x72d0('0x12')][_0x72d0('0x11')]);}})[_0x72d0('0x13')](function(_0x2a761c){logger[_0x72d0('0xf')](_0x72d0('0xc'),_0x2a4100,_0x2a761c);_0x6d0ff6(_0x2a761c);});});}exports[_0x72d0('0x14')]=function(_0x2fe17f){var _0x4a9367=this;return new Promise(function(_0x440f9c,_0x357553){return db[_0x72d0('0x15')][_0x72d0('0x16')]({'raw':_0x2fe17f[_0x72d0('0x17')]?_0x2fe17f[_0x72d0('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2fe17f[_0x72d0('0x17')]?_0x2fe17f['options']['where']||null:null,'attributes':_0x2fe17f['options']?_0x2fe17f[_0x72d0('0x17')][_0x72d0('0x18')]||null:null,'limit':_0x2fe17f['options']?_0x2fe17f[_0x72d0('0x17')][_0x72d0('0x19')]||null:null,'include':_0x2fe17f['options']?_0x2fe17f[_0x72d0('0x17')][_0x72d0('0x1a')]?_['map'](_0x2fe17f[_0x72d0('0x17')][_0x72d0('0x1a')],function(_0x350184){return{'model':db[_0x350184['model']],'as':_0x350184['as'],'attributes':_0x350184[_0x72d0('0x18')],'include':_0x350184[_0x72d0('0x1a')]?_[_0x72d0('0x1b')](_0x350184[_0x72d0('0x1a')],function(_0x4bc137){return{'model':db[_0x4bc137[_0x72d0('0x1c')]],'as':_0x4bc137['as'],'attributes':_0x4bc137[_0x72d0('0x18')],'include':_0x4bc137[_0x72d0('0x1a')]?_[_0x72d0('0x1b')](_0x4bc137[_0x72d0('0x1a')],function(_0x7f45){return{'model':db[_0x7f45[_0x72d0('0x1c')]],'as':_0x7f45['as'],'attributes':_0x7f45['attributes']};}):[]};}):[]};}):[]:[]})[_0x72d0('0x1d')](function(_0x4d8340){logger[_0x72d0('0xb')](_0x72d0('0x14'),_0x2fe17f);logger[_0x72d0('0xe')](_0x72d0('0x14'),_0x2fe17f,JSON[_0x72d0('0x1e')](_0x4d8340));_0x440f9c(_0x4d8340);})['catch'](function(_0x12a92b){logger[_0x72d0('0xf')]('GetFreshsalesAccount',_0x12a92b[_0x72d0('0x11')],_0x2fe17f);_0x357553(_0x4a9367[_0x72d0('0xf')](0x1f4,_0x12a92b[_0x72d0('0x11')]));});});};exports['ShowFreshsalesAccount']=function(_0x3471e1){var _0x1d16fa=this;return new Promise(function(_0x4b5b0a,_0x13892a){return db['FreshsalesAccount'][_0x72d0('0x1f')]({'raw':_0x3471e1[_0x72d0('0x17')]?_0x3471e1[_0x72d0('0x17')][_0x72d0('0x20')]===undefined?!![]:![]:!![],'where':_0x3471e1[_0x72d0('0x17')]?_0x3471e1[_0x72d0('0x17')][_0x72d0('0x21')]||null:null,'attributes':_0x3471e1[_0x72d0('0x17')]?_0x3471e1[_0x72d0('0x17')][_0x72d0('0x18')]||null:null,'include':_0x3471e1[_0x72d0('0x17')]?_0x3471e1[_0x72d0('0x17')]['include']?_[_0x72d0('0x1b')](_0x3471e1[_0x72d0('0x17')][_0x72d0('0x1a')],function(_0x457712){return{'model':db[_0x457712[_0x72d0('0x1c')]],'as':_0x457712['as'],'attributes':_0x457712[_0x72d0('0x18')],'include':_0x457712[_0x72d0('0x1a')]?_[_0x72d0('0x1b')](_0x457712['include'],function(_0x353a09){return{'model':db[_0x353a09[_0x72d0('0x1c')]],'as':_0x353a09['as'],'attributes':_0x353a09['attributes'],'include':_0x353a09['include']?_[_0x72d0('0x1b')](_0x353a09[_0x72d0('0x1a')],function(_0xd11005){return{'model':db[_0xd11005[_0x72d0('0x1c')]],'as':_0xd11005['as'],'attributes':_0xd11005[_0x72d0('0x18')]};}):[]};}):[]};}):[]:[]})[_0x72d0('0x1d')](function(_0xb0d6fa){logger[_0x72d0('0xb')](_0x72d0('0x22'),_0x3471e1);logger[_0x72d0('0xe')](_0x72d0('0x22'),_0x3471e1,JSON[_0x72d0('0x1e')](_0xb0d6fa));_0x4b5b0a(_0xb0d6fa);})[_0x72d0('0x13')](function(_0xbb98c1){logger['error']('ShowFreshsalesAccount',_0xbb98c1[_0x72d0('0x11')],_0x3471e1);_0x13892a(_0x1d16fa[_0x72d0('0xf')](0x1f4,_0xbb98c1['message']));});});}; \ No newline at end of file +var _0x6000=['debug','stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','map','model','ShowFreshsalesAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x4498ab,_0x131b61){var _0x3d2410=function(_0x5bd3c7){while(--_0x5bd3c7){_0x4498ab['push'](_0x4498ab['shift']());}};_0x3d2410(++_0x131b61);}(_0x6000,0x17c));var _0x0600=function(_0x3477f7,_0x56a2bc){_0x3477f7=_0x3477f7-0x0;var _0x2657bc=_0x6000[_0x3477f7];return _0x2657bc;};'use strict';var _=require(_0x0600('0x0'));var util=require(_0x0600('0x1'));var moment=require(_0x0600('0x2'));var BPromise=require(_0x0600('0x3'));var rs=require(_0x0600('0x4'));var fs=require('fs');var Redis=require(_0x0600('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0600('0x6'));var logger=require(_0x0600('0x7'))('rpc');var config=require(_0x0600('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0600('0x9')][_0x0600('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89927a,_0x559495,_0x45e348){return new BPromise(function(_0x5730b2,_0x15b6d2){return client[_0x0600('0xb')](_0x89927a,_0x45e348)[_0x0600('0xc')](function(_0xacb924){logger[_0x0600('0xd')](_0x0600('0xe'),_0x559495,_0x0600('0xf'));logger[_0x0600('0x10')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x559495,_0x0600('0xf'),JSON[_0x0600('0x11')](_0xacb924));if(_0xacb924['error']){if(_0xacb924[_0x0600('0x12')][_0x0600('0x13')]===0x1f4){logger[_0x0600('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x559495,_0xacb924[_0x0600('0x12')]['message']);return _0x15b6d2(_0xacb924[_0x0600('0x12')][_0x0600('0x14')]);}logger[_0x0600('0x12')](_0x0600('0xe'),_0x559495,_0xacb924[_0x0600('0x12')]['message']);return _0x5730b2(_0xacb924[_0x0600('0x12')][_0x0600('0x14')]);}else{logger['info'](_0x0600('0xe'),_0x559495,_0x0600('0xf'));_0x5730b2(_0xacb924[_0x0600('0x15')][_0x0600('0x14')]);}})[_0x0600('0x16')](function(_0x31ced0){logger[_0x0600('0x12')]('FreshsalesAccount,\x20%s,\x20%s',_0x559495,_0x31ced0);_0x15b6d2(_0x31ced0);});});}exports[_0x0600('0x17')]=function(_0x205998){var _0x25ade1=this;return new Promise(function(_0x571a0a,_0x251021){return db[_0x0600('0x18')][_0x0600('0x19')]({'raw':_0x205998[_0x0600('0x1a')]?_0x205998[_0x0600('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x205998[_0x0600('0x1a')]?_0x205998[_0x0600('0x1a')][_0x0600('0x1b')]||null:null,'attributes':_0x205998[_0x0600('0x1a')]?_0x205998['options'][_0x0600('0x1c')]||null:null,'limit':_0x205998[_0x0600('0x1a')]?_0x205998['options'][_0x0600('0x1d')]||null:null,'include':_0x205998['options']?_0x205998[_0x0600('0x1a')][_0x0600('0x1e')]?_[_0x0600('0x1f')](_0x205998['options'][_0x0600('0x1e')],function(_0x246f8c){return{'model':db[_0x246f8c['model']],'as':_0x246f8c['as'],'attributes':_0x246f8c[_0x0600('0x1c')],'include':_0x246f8c[_0x0600('0x1e')]?_['map'](_0x246f8c[_0x0600('0x1e')],function(_0x4c09fb){return{'model':db[_0x4c09fb[_0x0600('0x20')]],'as':_0x4c09fb['as'],'attributes':_0x4c09fb[_0x0600('0x1c')],'include':_0x4c09fb[_0x0600('0x1e')]?_[_0x0600('0x1f')](_0x4c09fb[_0x0600('0x1e')],function(_0x536b65){return{'model':db[_0x536b65[_0x0600('0x20')]],'as':_0x536b65['as'],'attributes':_0x536b65[_0x0600('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0600('0xc')](function(_0x5b9264){logger['info'](_0x0600('0x17'),_0x205998);logger['debug']('GetFreshsalesAccount',_0x205998,JSON[_0x0600('0x11')](_0x5b9264));_0x571a0a(_0x5b9264);})[_0x0600('0x16')](function(_0x3b543b){logger['error'](_0x0600('0x17'),_0x3b543b[_0x0600('0x14')],_0x205998);_0x251021(_0x25ade1[_0x0600('0x12')](0x1f4,_0x3b543b[_0x0600('0x14')]));});});};exports[_0x0600('0x21')]=function(_0x657d6e){var _0x1f8ccb=this;return new Promise(function(_0x454bd4,_0x57241e){return db[_0x0600('0x18')][_0x0600('0x22')]({'raw':_0x657d6e[_0x0600('0x1a')]?_0x657d6e['options'][_0x0600('0x23')]===undefined?!![]:![]:!![],'where':_0x657d6e[_0x0600('0x1a')]?_0x657d6e['options'][_0x0600('0x1b')]||null:null,'attributes':_0x657d6e[_0x0600('0x1a')]?_0x657d6e[_0x0600('0x1a')][_0x0600('0x1c')]||null:null,'include':_0x657d6e[_0x0600('0x1a')]?_0x657d6e[_0x0600('0x1a')][_0x0600('0x1e')]?_['map'](_0x657d6e['options']['include'],function(_0x6f5533){return{'model':db[_0x6f5533[_0x0600('0x20')]],'as':_0x6f5533['as'],'attributes':_0x6f5533[_0x0600('0x1c')],'include':_0x6f5533[_0x0600('0x1e')]?_[_0x0600('0x1f')](_0x6f5533[_0x0600('0x1e')],function(_0x526d59){return{'model':db[_0x526d59[_0x0600('0x20')]],'as':_0x526d59['as'],'attributes':_0x526d59['attributes'],'include':_0x526d59[_0x0600('0x1e')]?_['map'](_0x526d59['include'],function(_0x43e05d){return{'model':db[_0x43e05d[_0x0600('0x20')]],'as':_0x43e05d['as'],'attributes':_0x43e05d[_0x0600('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0600('0xc')](function(_0x589e99){logger[_0x0600('0xd')](_0x0600('0x21'),_0x657d6e);logger[_0x0600('0x10')](_0x0600('0x21'),_0x657d6e,JSON[_0x0600('0x11')](_0x589e99));_0x454bd4(_0x589e99);})[_0x0600('0x16')](function(_0x3b3e5e){logger['error'](_0x0600('0x21'),_0x3b3e5e['message'],_0x657d6e);_0x57241e(_0x1f8ccb[_0x0600('0x12')](0x1f4,_0x3b3e5e[_0x0600('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 260c0f5..c5d6189 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 _0xe9a3=['get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','getFields','create','put','/:id','delete','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index'];(function(_0x14cd98,_0x876e85){var _0x449efc=function(_0x4f7689){while(--_0x4f7689){_0x14cd98['push'](_0x14cd98['shift']());}};_0x449efc(++_0x876e85);}(_0xe9a3,0x1d7));var _0x3e9a=function(_0x161c45,_0x1d3b96){_0x161c45=_0x161c45-0x0;var _0x5c2658=_0xe9a3[_0x161c45];return _0x5c2658;};'use strict';var multer=require('multer');var util=require(_0x3e9a('0x0'));var path=require('path');var timeout=require(_0x3e9a('0x1'));var express=require('express');var router=express[_0x3e9a('0x2')]();var auth=require(_0x3e9a('0x3'));var interaction=require(_0x3e9a('0x4'));var config=require(_0x3e9a('0x5'));var controller=require(_0x3e9a('0x6'));router['get']('/',auth[_0x3e9a('0x7')](),controller[_0x3e9a('0x8')]);router[_0x3e9a('0x9')]('/:id',auth[_0x3e9a('0x7')](),controller['show']);router[_0x3e9a('0x9')](_0x3e9a('0xa'),auth['isAuthenticated'](),controller[_0x3e9a('0xb')]);router[_0x3e9a('0x9')](_0x3e9a('0xc'),auth[_0x3e9a('0x7')](),controller[_0x3e9a('0xd')]);router[_0x3e9a('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x3e9a('0xe')]);router['post']('/',auth[_0x3e9a('0x7')](),controller[_0x3e9a('0xf')]);router[_0x3e9a('0x10')](_0x3e9a('0x11'),auth[_0x3e9a('0x7')](),controller['update']);router[_0x3e9a('0x12')](_0x3e9a('0x11'),auth[_0x3e9a('0x7')](),controller['destroy']);module[_0x3e9a('0x13')]=router; \ No newline at end of file +var _0x4e37=['../../components/interaction/service','./intFreshsalesConfiguration.controller','get','index','/:id','show','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','getFields','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1bbea6,_0x245c28){var _0x24576c=function(_0x7c1b7){while(--_0x7c1b7){_0x1bbea6['push'](_0x1bbea6['shift']());}};_0x24576c(++_0x245c28);}(_0x4e37,0xae));var _0x74e3=function(_0x2515a3,_0x356de5){_0x2515a3=_0x2515a3-0x0;var _0xe8bbb=_0x4e37[_0x2515a3];return _0xe8bbb;};'use strict';var multer=require(_0x74e3('0x0'));var util=require(_0x74e3('0x1'));var path=require('path');var timeout=require(_0x74e3('0x2'));var express=require(_0x74e3('0x3'));var router=express[_0x74e3('0x4')]();var auth=require(_0x74e3('0x5'));var interaction=require(_0x74e3('0x6'));var config=require('../../config/environment');var controller=require(_0x74e3('0x7'));router[_0x74e3('0x8')]('/',auth['isAuthenticated'](),controller[_0x74e3('0x9')]);router[_0x74e3('0x8')](_0x74e3('0xa'),auth['isAuthenticated'](),controller[_0x74e3('0xb')]);router['get'](_0x74e3('0xc'),auth[_0x74e3('0xd')](),controller[_0x74e3('0xe')]);router[_0x74e3('0x8')](_0x74e3('0xf'),auth[_0x74e3('0xd')](),controller[_0x74e3('0x10')]);router[_0x74e3('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x74e3('0x11')]);router['post']('/',auth[_0x74e3('0xd')](),controller['create']);router['put'](_0x74e3('0xa'),auth[_0x74e3('0xd')](),controller[_0x74e3('0x12')]);router['delete'](_0x74e3('0xa'),auth[_0x74e3('0xd')](),controller[_0x74e3('0x13')]);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 afa82b6..61844c3 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 _0x78df=['STRING','sequelize'];(function(_0xaa0bec,_0x46131b){var _0x124991=function(_0x22df96){while(--_0x22df96){_0xaa0bec['push'](_0xaa0bec['shift']());}};_0x124991(++_0x46131b);}(_0x78df,0x85));var _0xf78d=function(_0x3cdd05,_0x5d4601){_0x3cdd05=_0x3cdd05-0x0;var _0x172e20=_0x78df[_0x3cdd05];return _0x172e20;};'use strict';var Sequelize=require(_0xf78d('0x0'));module['exports']={'name':{'type':Sequelize[_0xf78d('0x1')]},'description':{'type':Sequelize[_0xf78d('0x1')]}}; \ No newline at end of file +var _0x0fcc=['STRING','sequelize','exports'];(function(_0x4567a1,_0x13e631){var _0x2906db=function(_0x14210d){while(--_0x14210d){_0x4567a1['push'](_0x4567a1['shift']());}};_0x2906db(++_0x13e631);}(_0x0fcc,0x1f3));var _0xc0fc=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0x0fcc[_0x13606d];return _0x1b85b0;};'use strict';var Sequelize=require(_0xc0fc('0x0'));module[_0xc0fc('0x1')]={'name':{'type':Sequelize[_0xc0fc('0x2')]},'description':{'type':Sequelize[_0xc0fc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 83f754f..bd370db 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 _0x487b=['rows','catch','params','options','find','create','body','findOne','FreshsalesField','length','getSubjects','hasOwnProperty','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','sendStatus','status','json','offset','limit','apply','reject','update','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','merge','FreshsalesConfiguration','count','include','findAll'];(function(_0x72e4fa,_0x58621c){var _0x30e945=function(_0x17905c){while(--_0x17905c){_0x72e4fa['push'](_0x72e4fa['shift']());}};_0x30e945(++_0x58621c);}(_0x487b,0x110));var _0xb487=function(_0x439d87,_0x551ece){_0x439d87=_0x439d87-0x0;var _0x2f7b9d=_0x487b[_0x439d87];return _0x2f7b9d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb487('0x0'));var zipdir=require(_0xb487('0x1'));var jsonpatch=require(_0xb487('0x2'));var rp=require(_0xb487('0x3'));var moment=require(_0xb487('0x4'));var BPromise=require(_0xb487('0x5'));var Mustache=require(_0xb487('0x6'));var util=require(_0xb487('0x7'));var path=require(_0xb487('0x8'));var sox=require(_0xb487('0x9'));var csv=require('to-csv');var ejs=require(_0xb487('0xa'));var fs=require('fs');var _=require(_0xb487('0xb'));var squel=require(_0xb487('0xc'));var crypto=require(_0xb487('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb487('0xe'));var toCsv=require(_0xb487('0xf'));var querystring=require('querystring');var Papa=require(_0xb487('0x10'));var Redis=require('ioredis');var authService=require(_0xb487('0x11'));var qs=require(_0xb487('0x12'));var as=require(_0xb487('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb487('0x14'))('api');var utils=require(_0xb487('0x15'));var config=require(_0xb487('0x16'));var db=require(_0xb487('0x17'))['db'];var jayson=require(_0xb487('0x18'));var client=jayson[_0xb487('0x19')][_0xb487('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x25d79c,_0xbdaf7f,_0x2d542c){if(_0x2d542c){var _0xef2c6b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xef2c6b[_0xb487('0x1b')](_0xbdaf7f)){return _0x25d79c;}else{throw new db[(_0xb487('0x1c'))]['ValidationError'](_0xb487('0x1d'));}}else{return _0x25d79c;}}function respondWithRpcPromise(_0x25da45,_0x29b17d,_0x1dd0ca,_0x358048){return new BPromise(function(_0x4538c2,_0x897f30){var _0x789ad5=_0x358048||client;return _0x789ad5[_0xb487('0x1e')](_0x25da45,_0x1dd0ca)[_0xb487('0x1f')](function(_0x387a1c){logger[_0xb487('0x20')](_0xb487('0x21'),_0x29b17d,_0xb487('0x22'));logger[_0xb487('0x23')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x29b17d,_0xb487('0x22'),JSON['stringify'](_0x387a1c));if(_0x387a1c[_0xb487('0x24')]){if(_0x387a1c[_0xb487('0x24')]['code']===0x1f4){logger[_0xb487('0x24')](_0xb487('0x21'),_0x29b17d,_0x387a1c[_0xb487('0x24')][_0xb487('0x25')]);return _0x897f30(_0x387a1c[_0xb487('0x24')][_0xb487('0x25')]);}logger[_0xb487('0x24')](_0xb487('0x21'),_0x29b17d,_0x387a1c['error'][_0xb487('0x25')]);return _0x4538c2(_0x387a1c[_0xb487('0x24')]['message']);}else{logger[_0xb487('0x20')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x29b17d,_0xb487('0x22'));_0x4538c2(_0x387a1c[_0xb487('0x26')][_0xb487('0x25')]);}})['catch'](function(_0xc37c19){logger[_0xb487('0x24')](_0xb487('0x21'),_0x29b17d,_0xc37c19);_0x897f30(_0xc37c19);});});}function respondWithStatusCode(_0x106f54,_0x4bce47){_0x4bce47=_0x4bce47||0xcc;return function(_0x3b889f){if(_0x3b889f){return _0x106f54[_0xb487('0x27')](_0x4bce47);}return _0x106f54['status'](_0x4bce47)['end']();};}function respondWithResult(_0xd13741,_0x355dc9){_0x355dc9=_0x355dc9||0xc8;return function(_0x2bc3e2){if(_0x2bc3e2){return _0xd13741[_0xb487('0x28')](_0x355dc9)[_0xb487('0x29')](_0x2bc3e2);}};}function respondWithFilteredResult(_0x55aa90,_0x4f856e){return function(_0x4735af){if(_0x4735af){var _0x4b2736=_0x4735af['count'],_0x2f29b6=_0x4f856e[_0xb487('0x2a')],_0x8e692e=_0x4f856e[_0xb487('0x2a')]+_0x4f856e[_0xb487('0x2b')],_0x502b78;if(_0x8e692e>=_0x4b2736){_0x8e692e=_0x4b2736;_0x502b78=0xc8;}else{_0x502b78=0xce;}_0x55aa90[_0xb487('0x28')](_0x502b78);return _0x55aa90['set']('Content-Range',_0x2f29b6+'-'+_0x8e692e+'/'+_0x4b2736)['json'](_0x4735af);}return null;};}function patchUpdates(_0x2b3045){return function(_0x41d916){try{jsonpatch[_0xb487('0x2c')](_0x41d916,_0x2b3045,!![]);}catch(_0x3f2584){return BPromise[_0xb487('0x2d')](_0x3f2584);}return _0x41d916['save']();};}function saveUpdates(_0x5dc99d,_0x56b2d9){return function(_0x360e95){if(_0x360e95){return _0x360e95[_0xb487('0x2e')](_0x5dc99d)[_0xb487('0x1f')](function(_0x3bcba3){return _0x3bcba3;});}return null;};}function removeEntity(_0x582dce,_0x16c002){return function(_0x3faee0){if(_0x3faee0){return _0x3faee0['destroy']()[_0xb487('0x1f')](function(){_0x582dce[_0xb487('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38f692,_0x4879fd){return function(_0x3f823d){if(!_0x3f823d){_0x38f692['sendStatus'](0x194);}return _0x3f823d;};}function handleError(_0x1d85fd,_0x3b07d2){_0x3b07d2=_0x3b07d2||0x1f4;return function(_0x5f7a15){logger['error'](_0x5f7a15['stack']);if(_0x5f7a15[_0xb487('0x2f')]){delete _0x5f7a15[_0xb487('0x2f')];}_0x1d85fd['status'](_0x3b07d2)[_0xb487('0x30')](_0x5f7a15);};}exports['index']=function(_0x2ab89b,_0x5e0a50){var _0x31c145={},_0x176992={},_0x355d0d={'count':0x0,'rows':[]};var _0x428738=_[_0xb487('0x31')](db['FreshsalesConfiguration'][_0xb487('0x32')],function(_0x505e35){return{'name':_0x505e35[_0xb487('0x33')],'type':_0x505e35[_0xb487('0x34')][_0xb487('0x35')]};});_0x176992[_0xb487('0x36')]=_[_0xb487('0x31')](_0x428738,_0xb487('0x2f'));_0x176992[_0xb487('0x37')]=_[_0xb487('0x38')](_0x2ab89b[_0xb487('0x37')]);_0x176992[_0xb487('0x39')]=_[_0xb487('0x3a')](_0x176992['model'],_0x176992['query']);_0x31c145['attributes']=_[_0xb487('0x3a')](_0x176992[_0xb487('0x36')],qs['fields'](_0x2ab89b[_0xb487('0x37')][_0xb487('0x3b')]));_0x31c145[_0xb487('0x3c')]=_0x31c145['attributes']['length']?_0x31c145['attributes']:_0x176992['model'];if(!_0x2ab89b[_0xb487('0x37')]['hasOwnProperty'](_0xb487('0x3d'))){_0x31c145[_0xb487('0x2b')]=qs[_0xb487('0x2b')](_0x2ab89b[_0xb487('0x37')][_0xb487('0x2b')]);_0x31c145[_0xb487('0x2a')]=qs[_0xb487('0x2a')](_0x2ab89b[_0xb487('0x37')][_0xb487('0x2a')]);}_0x31c145[_0xb487('0x3e')]=qs[_0xb487('0x3f')](_0x2ab89b[_0xb487('0x37')][_0xb487('0x3f')]);_0x31c145['where']=qs['filters'](_[_0xb487('0x40')](_0x2ab89b[_0xb487('0x37')],_0x176992['filters']),_0x428738);if(_0x2ab89b[_0xb487('0x37')][_0xb487('0x41')]){_0x31c145[_0xb487('0x42')]=_[_0xb487('0x43')](_0x31c145[_0xb487('0x42')],{'$or':_[_0xb487('0x31')](_0x428738,function(_0x1095a6){if(_0x1095a6[_0xb487('0x34')]!=='VIRTUAL'){var _0x2de5ca={};_0x2de5ca[_0x1095a6[_0xb487('0x2f')]]={'$like':'%'+_0x2ab89b['query'][_0xb487('0x41')]+'%'};return _0x2de5ca;}})});}_0x31c145=_[_0xb487('0x43')]({},_0x31c145,_0x2ab89b['options']);var _0x9adfe2={'where':_0x31c145['where']};return db[_0xb487('0x44')][_0xb487('0x45')](_0x9adfe2)[_0xb487('0x1f')](function(_0x5b3be8){_0x355d0d['count']=_0x5b3be8;if(_0x2ab89b[_0xb487('0x37')]['includeAll']){_0x31c145[_0xb487('0x46')]=[{'all':!![]}];}return db[_0xb487('0x44')][_0xb487('0x47')](_0x31c145);})['then'](function(_0x396027){_0x355d0d[_0xb487('0x48')]=_0x396027;return _0x355d0d;})['then'](respondWithFilteredResult(_0x5e0a50,_0x31c145))[_0xb487('0x49')](handleError(_0x5e0a50,null));};exports['show']=function(_0x58c5cb,_0x51dcab){var _0x34d24f={'raw':![],'where':{'id':_0x58c5cb[_0xb487('0x4a')]['id']}},_0x397e77={};_0x397e77[_0xb487('0x36')]=_[_0xb487('0x38')](db[_0xb487('0x44')]['rawAttributes']);_0x397e77[_0xb487('0x37')]=_['keys'](_0x58c5cb[_0xb487('0x37')]);_0x397e77[_0xb487('0x39')]=_[_0xb487('0x3a')](_0x397e77[_0xb487('0x36')],_0x397e77[_0xb487('0x37')]);_0x34d24f[_0xb487('0x3c')]=_[_0xb487('0x3a')](_0x397e77[_0xb487('0x36')],qs[_0xb487('0x3b')](_0x58c5cb['query'][_0xb487('0x3b')]));_0x34d24f[_0xb487('0x3c')]=_0x34d24f[_0xb487('0x3c')]['length']?_0x34d24f[_0xb487('0x3c')]:_0x397e77[_0xb487('0x36')];if(_0x58c5cb[_0xb487('0x37')]['includeAll']){_0x34d24f[_0xb487('0x46')]=[{'all':!![]}];}_0x34d24f=_[_0xb487('0x43')]({},_0x34d24f,_0x58c5cb[_0xb487('0x4b')]);return db['FreshsalesConfiguration'][_0xb487('0x4c')](_0x34d24f)[_0xb487('0x1f')](handleEntityNotFound(_0x51dcab,null))['then'](respondWithResult(_0x51dcab,null))[_0xb487('0x49')](handleError(_0x51dcab,null));};exports[_0xb487('0x4d')]=function(_0x2873b7,_0x35dbdf){return db[_0xb487('0x44')][_0xb487('0x4d')](_0x2873b7[_0xb487('0x4e')],{})[_0xb487('0x1f')](respondWithResult(_0x35dbdf,0xc9))['catch'](handleError(_0x35dbdf,null));};exports['update']=function(_0x1e15ec,_0x32b76c){if(_0x1e15ec[_0xb487('0x4e')]['id']){delete _0x1e15ec[_0xb487('0x4e')]['id'];}return db[_0xb487('0x44')]['find']({'where':{'id':_0x1e15ec[_0xb487('0x4a')]['id']}})['then'](handleEntityNotFound(_0x32b76c,null))['then'](saveUpdates(_0x1e15ec['body'],null))[_0xb487('0x1f')](respondWithResult(_0x32b76c,null))[_0xb487('0x49')](handleError(_0x32b76c,null));};exports['destroy']=function(_0xa3fc7b,_0x30c646){return db[_0xb487('0x44')][_0xb487('0x4c')]({'where':{'id':_0xa3fc7b[_0xb487('0x4a')]['id']}})[_0xb487('0x1f')](handleEntityNotFound(_0x30c646,null))[_0xb487('0x1f')](removeEntity(_0x30c646,null))[_0xb487('0x49')](handleError(_0x30c646,null));};exports['getSubjects']=function(_0x2f1703,_0x43b624,_0x2440f2){var _0x2822e3={};var _0x46ae53={};var _0x400737;var _0x228dd7;return db[_0xb487('0x44')][_0xb487('0x4f')]({'where':{'id':_0x2f1703[_0xb487('0x4a')]['id']}})[_0xb487('0x1f')](handleEntityNotFound(_0x43b624,null))[_0xb487('0x1f')](function(_0x58e615){if(_0x58e615){_0x400737=_0x58e615;_0x46ae53[_0xb487('0x36')]=_[_0xb487('0x38')](db[_0xb487('0x50')][_0xb487('0x32')]);_0x46ae53[_0xb487('0x37')]=_['keys'](_0x2f1703['query']);_0x46ae53[_0xb487('0x39')]=_[_0xb487('0x3a')](_0x46ae53[_0xb487('0x36')],_0x46ae53[_0xb487('0x37')]);_0x2822e3[_0xb487('0x3c')]=_[_0xb487('0x3a')](_0x46ae53[_0xb487('0x36')],qs[_0xb487('0x3b')](_0x2f1703['query']['fields']));_0x2822e3[_0xb487('0x3c')]=_0x2822e3['attributes'][_0xb487('0x51')]?_0x2822e3[_0xb487('0x3c')]:_0x46ae53[_0xb487('0x36')];_0x2822e3[_0xb487('0x3e')]=qs[_0xb487('0x3f')](_0x2f1703[_0xb487('0x37')]['sort']);_0x2822e3[_0xb487('0x42')]=qs[_0xb487('0x39')](_[_0xb487('0x40')](_0x2f1703[_0xb487('0x37')],_0x46ae53[_0xb487('0x39')]));if(_0x2f1703['query'][_0xb487('0x41')]){_0x2822e3['where']=_[_0xb487('0x43')](_0x2822e3[_0xb487('0x42')],{'$or':_[_0xb487('0x31')](_0x2822e3[_0xb487('0x3c')],function(_0x1c9d8f){var _0x18aa69={};_0x18aa69[_0x1c9d8f]={'$like':'%'+_0x2f1703[_0xb487('0x37')][_0xb487('0x41')]+'%'};return _0x18aa69;})});}_0x2822e3=_[_0xb487('0x43')]({},_0x2822e3,_0x2f1703[_0xb487('0x4b')]);return _0x400737[_0xb487('0x52')](_0x2822e3);}})[_0xb487('0x1f')](function(_0xa38d66){if(_0xa38d66){_0x228dd7=_0xa38d66[_0xb487('0x51')];if(!_0x2f1703[_0xb487('0x37')][_0xb487('0x53')](_0xb487('0x3d'))){_0x2822e3[_0xb487('0x2b')]=qs[_0xb487('0x2b')](_0x2f1703['query'][_0xb487('0x2b')]);_0x2822e3[_0xb487('0x2a')]=qs[_0xb487('0x2a')](_0x2f1703[_0xb487('0x37')]['offset']);}return _0x400737[_0xb487('0x52')](_0x2822e3);}})[_0xb487('0x1f')](function(_0x5cfe8c){if(_0x5cfe8c){return _0x5cfe8c?{'count':_0x228dd7,'rows':_0x5cfe8c}:null;}})['then'](respondWithResult(_0x43b624,null))[_0xb487('0x49')](handleError(_0x43b624,null));};exports['getDescriptions']=function(_0xfdb10b,_0x5d3806,_0x4a57e7){var _0x1c2426={};var _0xee40ea={};var _0x7cc243;var _0x30cc05;return db[_0xb487('0x44')][_0xb487('0x4f')]({'where':{'id':_0xfdb10b[_0xb487('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5d3806,null))[_0xb487('0x1f')](function(_0xbe0657){if(_0xbe0657){_0x7cc243=_0xbe0657;_0xee40ea[_0xb487('0x36')]=_['keys'](db['FreshsalesField'][_0xb487('0x32')]);_0xee40ea[_0xb487('0x37')]=_[_0xb487('0x38')](_0xfdb10b[_0xb487('0x37')]);_0xee40ea[_0xb487('0x39')]=_[_0xb487('0x3a')](_0xee40ea['model'],_0xee40ea[_0xb487('0x37')]);_0x1c2426[_0xb487('0x3c')]=_[_0xb487('0x3a')](_0xee40ea['model'],qs['fields'](_0xfdb10b[_0xb487('0x37')][_0xb487('0x3b')]));_0x1c2426[_0xb487('0x3c')]=_0x1c2426[_0xb487('0x3c')][_0xb487('0x51')]?_0x1c2426[_0xb487('0x3c')]:_0xee40ea[_0xb487('0x36')];_0x1c2426[_0xb487('0x3e')]=qs[_0xb487('0x3f')](_0xfdb10b[_0xb487('0x37')][_0xb487('0x3f')]);_0x1c2426[_0xb487('0x42')]=qs[_0xb487('0x39')](_[_0xb487('0x40')](_0xfdb10b['query'],_0xee40ea['filters']));if(_0xfdb10b['query'][_0xb487('0x41')]){_0x1c2426[_0xb487('0x42')]=_[_0xb487('0x43')](_0x1c2426['where'],{'$or':_[_0xb487('0x31')](_0x1c2426['attributes'],function(_0x44f8c8){var _0x120031={};_0x120031[_0x44f8c8]={'$like':'%'+_0xfdb10b['query'][_0xb487('0x41')]+'%'};return _0x120031;})});}_0x1c2426=_[_0xb487('0x43')]({},_0x1c2426,_0xfdb10b['options']);return _0x7cc243[_0xb487('0x54')](_0x1c2426);}})['then'](function(_0x3e2551){if(_0x3e2551){_0x30cc05=_0x3e2551[_0xb487('0x51')];if(!_0xfdb10b['query'][_0xb487('0x53')](_0xb487('0x3d'))){_0x1c2426[_0xb487('0x2b')]=qs[_0xb487('0x2b')](_0xfdb10b[_0xb487('0x37')]['limit']);_0x1c2426[_0xb487('0x2a')]=qs[_0xb487('0x2a')](_0xfdb10b[_0xb487('0x37')]['offset']);}return _0x7cc243[_0xb487('0x54')](_0x1c2426);}})[_0xb487('0x1f')](function(_0x16555d){if(_0x16555d){return _0x16555d?{'count':_0x30cc05,'rows':_0x16555d}:null;}})['then'](respondWithResult(_0x5d3806,null))[_0xb487('0x49')](handleError(_0x5d3806,null));};exports['getFields']=function(_0x3f1db7,_0x3be17a,_0x15811f){var _0xea85bd={};var _0x56229d={};var _0x7d5cad;var _0x37c346;return db['FreshsalesConfiguration'][_0xb487('0x4f')]({'where':{'id':_0x3f1db7[_0xb487('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3be17a,null))['then'](function(_0x5a4feb){if(_0x5a4feb){_0x7d5cad=_0x5a4feb;_0x56229d['model']=_[_0xb487('0x38')](db['FreshsalesField'][_0xb487('0x32')]);_0x56229d[_0xb487('0x37')]=_[_0xb487('0x38')](_0x3f1db7['query']);_0x56229d[_0xb487('0x39')]=_[_0xb487('0x3a')](_0x56229d[_0xb487('0x36')],_0x56229d['query']);_0xea85bd[_0xb487('0x3c')]=_[_0xb487('0x3a')](_0x56229d[_0xb487('0x36')],qs[_0xb487('0x3b')](_0x3f1db7[_0xb487('0x37')][_0xb487('0x3b')]));_0xea85bd[_0xb487('0x3c')]=_0xea85bd['attributes']['length']?_0xea85bd[_0xb487('0x3c')]:_0x56229d[_0xb487('0x36')];_0xea85bd[_0xb487('0x3e')]=qs[_0xb487('0x3f')](_0x3f1db7['query']['sort']);_0xea85bd[_0xb487('0x42')]=qs[_0xb487('0x39')](_[_0xb487('0x40')](_0x3f1db7[_0xb487('0x37')],_0x56229d[_0xb487('0x39')]));if(_0x3f1db7[_0xb487('0x37')][_0xb487('0x41')]){_0xea85bd[_0xb487('0x42')]=_['merge'](_0xea85bd[_0xb487('0x42')],{'$or':_[_0xb487('0x31')](_0xea85bd[_0xb487('0x3c')],function(_0x4e2bf6){var _0x2dafbd={};_0x2dafbd[_0x4e2bf6]={'$like':'%'+_0x3f1db7[_0xb487('0x37')][_0xb487('0x41')]+'%'};return _0x2dafbd;})});}_0xea85bd=_[_0xb487('0x43')]({},_0xea85bd,_0x3f1db7[_0xb487('0x4b')]);return _0x7d5cad[_0xb487('0x55')](_0xea85bd);}})['then'](function(_0x38539c){if(_0x38539c){_0x37c346=_0x38539c['length'];if(!_0x3f1db7[_0xb487('0x37')][_0xb487('0x53')](_0xb487('0x3d'))){_0xea85bd[_0xb487('0x2b')]=qs[_0xb487('0x2b')](_0x3f1db7[_0xb487('0x37')][_0xb487('0x2b')]);_0xea85bd[_0xb487('0x2a')]=qs['offset'](_0x3f1db7[_0xb487('0x37')][_0xb487('0x2a')]);}return _0x7d5cad[_0xb487('0x55')](_0xea85bd);}})['then'](function(_0x5c03d2){if(_0x5c03d2){return _0x5c03d2?{'count':_0x37c346,'rows':_0x5c03d2}:null;}})[_0xb487('0x1f')](respondWithResult(_0x3be17a,null))['catch'](handleError(_0x3be17a,null));}; \ No newline at end of file +var _0xa6b4=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','destroy','stack','name','send','index','map','FreshsalesConfiguration','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','show','rawAttributes','create','body','update','find','params','FreshsalesField','order','filter','getSubjects','findOne','getDescriptions','getFields','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto'];(function(_0x37df1f,_0x44fc8e){var _0x40aec8=function(_0x42b250){while(--_0x42b250){_0x37df1f['push'](_0x37df1f['shift']());}};_0x40aec8(++_0x44fc8e);}(_0xa6b4,0x165));var _0x4a6b=function(_0x29c7ed,_0x389f4b){_0x29c7ed=_0x29c7ed-0x0;var _0x22b24d=_0xa6b4[_0x29c7ed];return _0x22b24d;};'use strict';var pdf=require(_0x4a6b('0x0'));var emlformat=require(_0x4a6b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4a6b('0x2'));var jsonpatch=require(_0x4a6b('0x3'));var rp=require(_0x4a6b('0x4'));var moment=require(_0x4a6b('0x5'));var BPromise=require(_0x4a6b('0x6'));var Mustache=require(_0x4a6b('0x7'));var util=require(_0x4a6b('0x8'));var path=require(_0x4a6b('0x9'));var sox=require('sox');var csv=require(_0x4a6b('0xa'));var ejs=require(_0x4a6b('0xb'));var fs=require('fs');var _=require(_0x4a6b('0xc'));var squel=require(_0x4a6b('0xd'));var crypto=require(_0x4a6b('0xe'));var jsforce=require(_0x4a6b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x4a6b('0xa'));var querystring=require(_0x4a6b('0x10'));var Papa=require(_0x4a6b('0x11'));var Redis=require(_0x4a6b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4a6b('0x13'));var as=require(_0x4a6b('0x14'));var hardwareService=require(_0x4a6b('0x15'));var logger=require(_0x4a6b('0x16'))('api');var utils=require(_0x4a6b('0x17'));var config=require(_0x4a6b('0x18'));var db=require(_0x4a6b('0x19'))['db'];var jayson=require(_0x4a6b('0x1a'));var client=jayson[_0x4a6b('0x1b')][_0x4a6b('0x1c')]({'port':0x232a});function checkPasswordPattern(_0xb2b47c,_0x531810,_0x548146){if(_0x548146){var _0x45c33=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x45c33[_0x4a6b('0x1d')](_0x531810)){return _0xb2b47c;}else{throw new db['Sequelize'][(_0x4a6b('0x1e'))](_0x4a6b('0x1f'));}}else{return _0xb2b47c;}}function respondWithRpcPromise(_0x404dac,_0x4fb76a,_0x3b9ea6,_0x4ab05e){return new BPromise(function(_0x5cc04f,_0x3562fb){var _0x17c4f4=_0x4ab05e||client;return _0x17c4f4['request'](_0x404dac,_0x3b9ea6)[_0x4a6b('0x20')](function(_0x148ed2){logger[_0x4a6b('0x21')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x4fb76a,'request\x20sent');logger['debug'](_0x4a6b('0x22'),_0x4fb76a,_0x4a6b('0x23'),JSON['stringify'](_0x148ed2));if(_0x148ed2['error']){if(_0x148ed2[_0x4a6b('0x24')][_0x4a6b('0x25')]===0x1f4){logger[_0x4a6b('0x24')](_0x4a6b('0x26'),_0x4fb76a,_0x148ed2['error']['message']);return _0x3562fb(_0x148ed2['error'][_0x4a6b('0x27')]);}logger[_0x4a6b('0x24')](_0x4a6b('0x26'),_0x4fb76a,_0x148ed2[_0x4a6b('0x24')][_0x4a6b('0x27')]);return _0x5cc04f(_0x148ed2[_0x4a6b('0x24')][_0x4a6b('0x27')]);}else{logger[_0x4a6b('0x21')](_0x4a6b('0x26'),_0x4fb76a,_0x4a6b('0x23'));_0x5cc04f(_0x148ed2['result'][_0x4a6b('0x27')]);}})[_0x4a6b('0x28')](function(_0x2779b2){logger[_0x4a6b('0x24')](_0x4a6b('0x26'),_0x4fb76a,_0x2779b2);_0x3562fb(_0x2779b2);});});}function respondWithStatusCode(_0x738920,_0x1990a0){_0x1990a0=_0x1990a0||0xcc;return function(_0x2fb3c9){if(_0x2fb3c9){return _0x738920[_0x4a6b('0x29')](_0x1990a0);}return _0x738920[_0x4a6b('0x2a')](_0x1990a0)[_0x4a6b('0x2b')]();};}function respondWithResult(_0x472f59,_0x1ad176){_0x1ad176=_0x1ad176||0xc8;return function(_0x2d644b){if(_0x2d644b){return _0x472f59['status'](_0x1ad176)[_0x4a6b('0x2c')](_0x2d644b);}};}function respondWithFilteredResult(_0x2afbd3,_0x2bf865){return function(_0x480aed){if(_0x480aed){var _0x3f26bc=_0x480aed[_0x4a6b('0x2d')],_0x4f162b=_0x2bf865['offset'],_0x502c21=_0x2bf865[_0x4a6b('0x2e')]+_0x2bf865[_0x4a6b('0x2f')],_0x3f05e5;if(_0x502c21>=_0x3f26bc){_0x502c21=_0x3f26bc;_0x3f05e5=0xc8;}else{_0x3f05e5=0xce;}_0x2afbd3[_0x4a6b('0x2a')](_0x3f05e5);return _0x2afbd3[_0x4a6b('0x30')](_0x4a6b('0x31'),_0x4f162b+'-'+_0x502c21+'/'+_0x3f26bc)[_0x4a6b('0x2c')](_0x480aed);}return null;};}function patchUpdates(_0x1d94d8){return function(_0x361e6f){try{jsonpatch['apply'](_0x361e6f,_0x1d94d8,!![]);}catch(_0x1fa5cd){return BPromise[_0x4a6b('0x32')](_0x1fa5cd);}return _0x361e6f['save']();};}function saveUpdates(_0xc07e41,_0x11e9a9){return function(_0x3174cf){if(_0x3174cf){return _0x3174cf['update'](_0xc07e41)[_0x4a6b('0x20')](function(_0x27cda6){return _0x27cda6;});}return null;};}function removeEntity(_0x26c17b,_0x2159c7){return function(_0x4c157e){if(_0x4c157e){return _0x4c157e[_0x4a6b('0x33')]()[_0x4a6b('0x20')](function(){_0x26c17b[_0x4a6b('0x2a')](0xcc)[_0x4a6b('0x2b')]();});}};}function handleEntityNotFound(_0x19e624,_0x5462df){return function(_0x40844e){if(!_0x40844e){_0x19e624[_0x4a6b('0x29')](0x194);}return _0x40844e;};}function handleError(_0x2dcb33,_0x47ab8e){_0x47ab8e=_0x47ab8e||0x1f4;return function(_0xd41d1e){logger['error'](_0xd41d1e[_0x4a6b('0x34')]);if(_0xd41d1e[_0x4a6b('0x35')]){delete _0xd41d1e['name'];}_0x2dcb33[_0x4a6b('0x2a')](_0x47ab8e)[_0x4a6b('0x36')](_0xd41d1e);};}exports[_0x4a6b('0x37')]=function(_0x5d8881,_0x3a8971){var _0x5db54f={},_0x31e748={},_0x3dc814={'count':0x0,'rows':[]};var _0x2a28e4=_[_0x4a6b('0x38')](db[_0x4a6b('0x39')]['rawAttributes'],function(_0x3109c2){return{'name':_0x3109c2[_0x4a6b('0x3a')],'type':_0x3109c2[_0x4a6b('0x3b')]['key']};});_0x31e748[_0x4a6b('0x3c')]=_[_0x4a6b('0x38')](_0x2a28e4,_0x4a6b('0x35'));_0x31e748[_0x4a6b('0x3d')]=_[_0x4a6b('0x3e')](_0x5d8881[_0x4a6b('0x3d')]);_0x31e748[_0x4a6b('0x3f')]=_[_0x4a6b('0x40')](_0x31e748[_0x4a6b('0x3c')],_0x31e748['query']);_0x5db54f[_0x4a6b('0x41')]=_[_0x4a6b('0x40')](_0x31e748[_0x4a6b('0x3c')],qs[_0x4a6b('0x42')](_0x5d8881[_0x4a6b('0x3d')][_0x4a6b('0x42')]));_0x5db54f[_0x4a6b('0x41')]=_0x5db54f[_0x4a6b('0x41')][_0x4a6b('0x43')]?_0x5db54f[_0x4a6b('0x41')]:_0x31e748[_0x4a6b('0x3c')];if(!_0x5d8881[_0x4a6b('0x3d')][_0x4a6b('0x44')](_0x4a6b('0x45'))){_0x5db54f[_0x4a6b('0x2f')]=qs[_0x4a6b('0x2f')](_0x5d8881[_0x4a6b('0x3d')][_0x4a6b('0x2f')]);_0x5db54f[_0x4a6b('0x2e')]=qs[_0x4a6b('0x2e')](_0x5d8881[_0x4a6b('0x3d')][_0x4a6b('0x2e')]);}_0x5db54f['order']=qs[_0x4a6b('0x46')](_0x5d8881[_0x4a6b('0x3d')][_0x4a6b('0x46')]);_0x5db54f['where']=qs['filters'](_[_0x4a6b('0x47')](_0x5d8881[_0x4a6b('0x3d')],_0x31e748[_0x4a6b('0x3f')]),_0x2a28e4);if(_0x5d8881[_0x4a6b('0x3d')]['filter']){_0x5db54f[_0x4a6b('0x48')]=_[_0x4a6b('0x49')](_0x5db54f[_0x4a6b('0x48')],{'$or':_[_0x4a6b('0x38')](_0x2a28e4,function(_0x6e3852){if(_0x6e3852['type']!==_0x4a6b('0x4a')){var _0x33a17f={};_0x33a17f[_0x6e3852[_0x4a6b('0x35')]]={'$like':'%'+_0x5d8881[_0x4a6b('0x3d')]['filter']+'%'};return _0x33a17f;}})});}_0x5db54f=_['merge']({},_0x5db54f,_0x5d8881[_0x4a6b('0x4b')]);var _0x45bb53={'where':_0x5db54f[_0x4a6b('0x48')]};return db[_0x4a6b('0x39')]['count'](_0x45bb53)[_0x4a6b('0x20')](function(_0x35b3de){_0x3dc814[_0x4a6b('0x2d')]=_0x35b3de;if(_0x5d8881[_0x4a6b('0x3d')][_0x4a6b('0x4c')]){_0x5db54f[_0x4a6b('0x4d')]=[{'all':!![]}];}return db[_0x4a6b('0x39')][_0x4a6b('0x4e')](_0x5db54f);})[_0x4a6b('0x20')](function(_0x8e1584){_0x3dc814['rows']=_0x8e1584;return _0x3dc814;})[_0x4a6b('0x20')](respondWithFilteredResult(_0x3a8971,_0x5db54f))['catch'](handleError(_0x3a8971,null));};exports[_0x4a6b('0x4f')]=function(_0x4ed7a5,_0x1606da){var _0x2b7fbd={'raw':![],'where':{'id':_0x4ed7a5['params']['id']}},_0x53ae83={};_0x53ae83[_0x4a6b('0x3c')]=_[_0x4a6b('0x3e')](db['FreshsalesConfiguration'][_0x4a6b('0x50')]);_0x53ae83[_0x4a6b('0x3d')]=_[_0x4a6b('0x3e')](_0x4ed7a5[_0x4a6b('0x3d')]);_0x53ae83[_0x4a6b('0x3f')]=_['intersection'](_0x53ae83['model'],_0x53ae83['query']);_0x2b7fbd[_0x4a6b('0x41')]=_[_0x4a6b('0x40')](_0x53ae83[_0x4a6b('0x3c')],qs[_0x4a6b('0x42')](_0x4ed7a5[_0x4a6b('0x3d')][_0x4a6b('0x42')]));_0x2b7fbd[_0x4a6b('0x41')]=_0x2b7fbd[_0x4a6b('0x41')][_0x4a6b('0x43')]?_0x2b7fbd['attributes']:_0x53ae83['model'];if(_0x4ed7a5[_0x4a6b('0x3d')][_0x4a6b('0x4c')]){_0x2b7fbd[_0x4a6b('0x4d')]=[{'all':!![]}];}_0x2b7fbd=_['merge']({},_0x2b7fbd,_0x4ed7a5[_0x4a6b('0x4b')]);return db[_0x4a6b('0x39')]['find'](_0x2b7fbd)['then'](handleEntityNotFound(_0x1606da,null))[_0x4a6b('0x20')](respondWithResult(_0x1606da,null))[_0x4a6b('0x28')](handleError(_0x1606da,null));};exports[_0x4a6b('0x51')]=function(_0x1899ea,_0x24fe6e){return db[_0x4a6b('0x39')][_0x4a6b('0x51')](_0x1899ea[_0x4a6b('0x52')],{})[_0x4a6b('0x20')](respondWithResult(_0x24fe6e,0xc9))['catch'](handleError(_0x24fe6e,null));};exports[_0x4a6b('0x53')]=function(_0x355f48,_0x99f695){if(_0x355f48[_0x4a6b('0x52')]['id']){delete _0x355f48['body']['id'];}return db['FreshsalesConfiguration'][_0x4a6b('0x54')]({'where':{'id':_0x355f48[_0x4a6b('0x55')]['id']}})[_0x4a6b('0x20')](handleEntityNotFound(_0x99f695,null))[_0x4a6b('0x20')](saveUpdates(_0x355f48[_0x4a6b('0x52')],null))[_0x4a6b('0x20')](respondWithResult(_0x99f695,null))[_0x4a6b('0x28')](handleError(_0x99f695,null));};exports[_0x4a6b('0x33')]=function(_0x174a49,_0x55ce0a){return db[_0x4a6b('0x39')]['find']({'where':{'id':_0x174a49[_0x4a6b('0x55')]['id']}})['then'](handleEntityNotFound(_0x55ce0a,null))[_0x4a6b('0x20')](removeEntity(_0x55ce0a,null))['catch'](handleError(_0x55ce0a,null));};exports['getSubjects']=function(_0x170b57,_0x50ec90,_0x402b6b){var _0x5a8f6c={};var _0x2b19aa={};var _0x3d8ea6;var _0x22f12f;return db[_0x4a6b('0x39')]['findOne']({'where':{'id':_0x170b57['params']['id']}})[_0x4a6b('0x20')](handleEntityNotFound(_0x50ec90,null))[_0x4a6b('0x20')](function(_0xb75d59){if(_0xb75d59){_0x3d8ea6=_0xb75d59;_0x2b19aa[_0x4a6b('0x3c')]=_['keys'](db[_0x4a6b('0x56')][_0x4a6b('0x50')]);_0x2b19aa[_0x4a6b('0x3d')]=_[_0x4a6b('0x3e')](_0x170b57[_0x4a6b('0x3d')]);_0x2b19aa[_0x4a6b('0x3f')]=_['intersection'](_0x2b19aa[_0x4a6b('0x3c')],_0x2b19aa[_0x4a6b('0x3d')]);_0x5a8f6c[_0x4a6b('0x41')]=_[_0x4a6b('0x40')](_0x2b19aa['model'],qs[_0x4a6b('0x42')](_0x170b57[_0x4a6b('0x3d')]['fields']));_0x5a8f6c[_0x4a6b('0x41')]=_0x5a8f6c[_0x4a6b('0x41')][_0x4a6b('0x43')]?_0x5a8f6c[_0x4a6b('0x41')]:_0x2b19aa['model'];_0x5a8f6c[_0x4a6b('0x57')]=qs[_0x4a6b('0x46')](_0x170b57[_0x4a6b('0x3d')][_0x4a6b('0x46')]);_0x5a8f6c[_0x4a6b('0x48')]=qs[_0x4a6b('0x3f')](_['pick'](_0x170b57['query'],_0x2b19aa['filters']));if(_0x170b57[_0x4a6b('0x3d')][_0x4a6b('0x58')]){_0x5a8f6c[_0x4a6b('0x48')]=_[_0x4a6b('0x49')](_0x5a8f6c[_0x4a6b('0x48')],{'$or':_['map'](_0x5a8f6c[_0x4a6b('0x41')],function(_0x56e079){var _0x1663f2={};_0x1663f2[_0x56e079]={'$like':'%'+_0x170b57['query'][_0x4a6b('0x58')]+'%'};return _0x1663f2;})});}_0x5a8f6c=_[_0x4a6b('0x49')]({},_0x5a8f6c,_0x170b57[_0x4a6b('0x4b')]);return _0x3d8ea6[_0x4a6b('0x59')](_0x5a8f6c);}})['then'](function(_0x48bf13){if(_0x48bf13){_0x22f12f=_0x48bf13[_0x4a6b('0x43')];if(!_0x170b57['query']['hasOwnProperty'](_0x4a6b('0x45'))){_0x5a8f6c[_0x4a6b('0x2f')]=qs['limit'](_0x170b57[_0x4a6b('0x3d')][_0x4a6b('0x2f')]);_0x5a8f6c[_0x4a6b('0x2e')]=qs[_0x4a6b('0x2e')](_0x170b57[_0x4a6b('0x3d')]['offset']);}return _0x3d8ea6[_0x4a6b('0x59')](_0x5a8f6c);}})[_0x4a6b('0x20')](function(_0x384b6d){if(_0x384b6d){return _0x384b6d?{'count':_0x22f12f,'rows':_0x384b6d}:null;}})[_0x4a6b('0x20')](respondWithResult(_0x50ec90,null))['catch'](handleError(_0x50ec90,null));};exports['getDescriptions']=function(_0x48fcc9,_0x522b42,_0x1435d8){var _0x271e73={};var _0x29d111={};var _0x5e2d55;var _0x201ed4;return db['FreshsalesConfiguration'][_0x4a6b('0x5a')]({'where':{'id':_0x48fcc9[_0x4a6b('0x55')]['id']}})['then'](handleEntityNotFound(_0x522b42,null))[_0x4a6b('0x20')](function(_0x407bc6){if(_0x407bc6){_0x5e2d55=_0x407bc6;_0x29d111[_0x4a6b('0x3c')]=_[_0x4a6b('0x3e')](db['FreshsalesField'][_0x4a6b('0x50')]);_0x29d111['query']=_[_0x4a6b('0x3e')](_0x48fcc9[_0x4a6b('0x3d')]);_0x29d111[_0x4a6b('0x3f')]=_[_0x4a6b('0x40')](_0x29d111['model'],_0x29d111[_0x4a6b('0x3d')]);_0x271e73[_0x4a6b('0x41')]=_[_0x4a6b('0x40')](_0x29d111[_0x4a6b('0x3c')],qs[_0x4a6b('0x42')](_0x48fcc9['query'][_0x4a6b('0x42')]));_0x271e73[_0x4a6b('0x41')]=_0x271e73[_0x4a6b('0x41')][_0x4a6b('0x43')]?_0x271e73[_0x4a6b('0x41')]:_0x29d111['model'];_0x271e73[_0x4a6b('0x57')]=qs['sort'](_0x48fcc9[_0x4a6b('0x3d')][_0x4a6b('0x46')]);_0x271e73[_0x4a6b('0x48')]=qs[_0x4a6b('0x3f')](_[_0x4a6b('0x47')](_0x48fcc9[_0x4a6b('0x3d')],_0x29d111['filters']));if(_0x48fcc9['query'][_0x4a6b('0x58')]){_0x271e73[_0x4a6b('0x48')]=_[_0x4a6b('0x49')](_0x271e73['where'],{'$or':_[_0x4a6b('0x38')](_0x271e73[_0x4a6b('0x41')],function(_0x10544c){var _0x381a85={};_0x381a85[_0x10544c]={'$like':'%'+_0x48fcc9[_0x4a6b('0x3d')]['filter']+'%'};return _0x381a85;})});}_0x271e73=_[_0x4a6b('0x49')]({},_0x271e73,_0x48fcc9[_0x4a6b('0x4b')]);return _0x5e2d55[_0x4a6b('0x5b')](_0x271e73);}})[_0x4a6b('0x20')](function(_0x2f8532){if(_0x2f8532){_0x201ed4=_0x2f8532['length'];if(!_0x48fcc9[_0x4a6b('0x3d')][_0x4a6b('0x44')]('nolimit')){_0x271e73[_0x4a6b('0x2f')]=qs[_0x4a6b('0x2f')](_0x48fcc9[_0x4a6b('0x3d')][_0x4a6b('0x2f')]);_0x271e73['offset']=qs[_0x4a6b('0x2e')](_0x48fcc9['query'][_0x4a6b('0x2e')]);}return _0x5e2d55[_0x4a6b('0x5b')](_0x271e73);}})[_0x4a6b('0x20')](function(_0x37c30c){if(_0x37c30c){return _0x37c30c?{'count':_0x201ed4,'rows':_0x37c30c}:null;}})[_0x4a6b('0x20')](respondWithResult(_0x522b42,null))['catch'](handleError(_0x522b42,null));};exports[_0x4a6b('0x5c')]=function(_0x58f9ab,_0x44b216,_0x469209){var _0x2afda6={};var _0x16abc3={};var _0x5b5997;var _0x2b08d7;return db[_0x4a6b('0x39')][_0x4a6b('0x5a')]({'where':{'id':_0x58f9ab[_0x4a6b('0x55')]['id']}})['then'](handleEntityNotFound(_0x44b216,null))['then'](function(_0x3f2145){if(_0x3f2145){_0x5b5997=_0x3f2145;_0x16abc3[_0x4a6b('0x3c')]=_[_0x4a6b('0x3e')](db[_0x4a6b('0x56')][_0x4a6b('0x50')]);_0x16abc3[_0x4a6b('0x3d')]=_['keys'](_0x58f9ab['query']);_0x16abc3[_0x4a6b('0x3f')]=_[_0x4a6b('0x40')](_0x16abc3['model'],_0x16abc3[_0x4a6b('0x3d')]);_0x2afda6[_0x4a6b('0x41')]=_[_0x4a6b('0x40')](_0x16abc3[_0x4a6b('0x3c')],qs['fields'](_0x58f9ab[_0x4a6b('0x3d')][_0x4a6b('0x42')]));_0x2afda6['attributes']=_0x2afda6['attributes'][_0x4a6b('0x43')]?_0x2afda6[_0x4a6b('0x41')]:_0x16abc3[_0x4a6b('0x3c')];_0x2afda6[_0x4a6b('0x57')]=qs[_0x4a6b('0x46')](_0x58f9ab[_0x4a6b('0x3d')][_0x4a6b('0x46')]);_0x2afda6[_0x4a6b('0x48')]=qs[_0x4a6b('0x3f')](_[_0x4a6b('0x47')](_0x58f9ab['query'],_0x16abc3[_0x4a6b('0x3f')]));if(_0x58f9ab[_0x4a6b('0x3d')][_0x4a6b('0x58')]){_0x2afda6[_0x4a6b('0x48')]=_[_0x4a6b('0x49')](_0x2afda6['where'],{'$or':_['map'](_0x2afda6['attributes'],function(_0x240cec){var _0x939a79={};_0x939a79[_0x240cec]={'$like':'%'+_0x58f9ab['query']['filter']+'%'};return _0x939a79;})});}_0x2afda6=_[_0x4a6b('0x49')]({},_0x2afda6,_0x58f9ab[_0x4a6b('0x4b')]);return _0x5b5997[_0x4a6b('0x5c')](_0x2afda6);}})['then'](function(_0x1ead8d){if(_0x1ead8d){_0x2b08d7=_0x1ead8d[_0x4a6b('0x43')];if(!_0x58f9ab[_0x4a6b('0x3d')][_0x4a6b('0x44')]('nolimit')){_0x2afda6['limit']=qs[_0x4a6b('0x2f')](_0x58f9ab[_0x4a6b('0x3d')][_0x4a6b('0x2f')]);_0x2afda6['offset']=qs[_0x4a6b('0x2e')](_0x58f9ab[_0x4a6b('0x3d')][_0x4a6b('0x2e')]);}return _0x5b5997[_0x4a6b('0x5c')](_0x2afda6);}})[_0x4a6b('0x20')](function(_0x18dadf){if(_0x18dadf){return _0x18dadf?{'count':_0x2b08d7,'rows':_0x18dadf}:null;}})['then'](respondWithResult(_0x44b216,null))[_0x4a6b('0x28')](handleError(_0x44b216,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 618bcd1..b0a94fb 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 _0x1c96=['./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1fd9c3,_0x46b5b4){var _0x566154=function(_0x312200){while(--_0x312200){_0x1fd9c3['push'](_0x1fd9c3['shift']());}};_0x566154(++_0x46b5b4);}(_0x1c96,0x197));var _0x61c9=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x1c96[_0x11a55c];return _0x26c390;};'use strict';var _=require(_0x61c9('0x0'));var util=require(_0x61c9('0x1'));var logger=require(_0x61c9('0x2'))(_0x61c9('0x3'));var moment=require(_0x61c9('0x4'));var BPromise=require('bluebird');var rp=require(_0x61c9('0x5'));var fs=require('fs');var path=require(_0x61c9('0x6'));var rimraf=require(_0x61c9('0x7'));var config=require(_0x61c9('0x8'));var attributes=require(_0x61c9('0x9'));module['exports']=function(_0x63a747,_0x31d2c6){return _0x63a747[_0x61c9('0xa')](_0x61c9('0xb'),attributes,{'tableName':_0x61c9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf839=['FreshsalesConfiguration','int_freshsales_configurations','util','api','moment','path','rimraf','../../config/environment','exports'];(function(_0x3c684a,_0x2807b1){var _0x55d19d=function(_0x2c39c9){while(--_0x2c39c9){_0x3c684a['push'](_0x3c684a['shift']());}};_0x55d19d(++_0x2807b1);}(_0xf839,0x13d));var _0x9f83=function(_0x28ebc2,_0x52449b){_0x28ebc2=_0x28ebc2-0x0;var _0x7c91b4=_0xf839[_0x28ebc2];return _0x7c91b4;};'use strict';var _=require('lodash');var util=require(_0x9f83('0x0'));var logger=require('../../config/logger')(_0x9f83('0x1'));var moment=require(_0x9f83('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f83('0x3'));var rimraf=require(_0x9f83('0x4'));var config=require(_0x9f83('0x5'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x9f83('0x6')]=function(_0x8e9bb5,_0x4fb413){return _0x8e9bb5['define'](_0x9f83('0x7'),attributes,{'tableName':_0x9f83('0x8'),'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 6b5c4ab..4bbc82f 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 _0x80df=['debug','FreshsalesConfiguration,\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','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x206699,_0x3873f3){var _0xbfdea6=function(_0x5660e6){while(--_0x5660e6){_0x206699['push'](_0x206699['shift']());}};_0xbfdea6(++_0x3873f3);}(_0x80df,0x17e));var _0xf80d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x80df[_0x20a584];return _0x4b41a8;};'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 _0xfc61=['lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','stringify','error','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x1cb931,_0x41493d){var _0x1ef86b=function(_0x4ad410){while(--_0x4ad410){_0x1cb931['push'](_0x1cb931['shift']());}};_0x1ef86b(++_0x41493d);}(_0xfc61,0x78));var _0x1fc6=function(_0xd29544,_0x21a193){_0xd29544=_0xd29544-0x0;var _0x5c161d=_0xfc61[_0xd29544];return _0x5c161d;};'use strict';var _=require(_0x1fc6('0x0'));var util=require(_0x1fc6('0x1'));var moment=require(_0x1fc6('0x2'));var BPromise=require(_0x1fc6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1fc6('0x4'));var logger=require(_0x1fc6('0x5'))(_0x1fc6('0x6'));var config=require(_0x1fc6('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1fc6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2afe7c,_0x3a7dfc,_0x3b7967){return new BPromise(function(_0x377d87,_0x567c47){return client[_0x1fc6('0x9')](_0x2afe7c,_0x3b7967)[_0x1fc6('0xa')](function(_0x300375){logger[_0x1fc6('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3a7dfc,_0x1fc6('0xc'));logger[_0x1fc6('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x3a7dfc,_0x1fc6('0xc'),JSON[_0x1fc6('0xe')](_0x300375));if(_0x300375[_0x1fc6('0xf')]){if(_0x300375[_0x1fc6('0xf')]['code']===0x1f4){logger['error'](_0x1fc6('0x10'),_0x3a7dfc,_0x300375[_0x1fc6('0xf')][_0x1fc6('0x11')]);return _0x567c47(_0x300375['error']['message']);}logger[_0x1fc6('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3a7dfc,_0x300375[_0x1fc6('0xf')][_0x1fc6('0x11')]);return _0x377d87(_0x300375[_0x1fc6('0xf')][_0x1fc6('0x11')]);}else{logger[_0x1fc6('0xb')](_0x1fc6('0x10'),_0x3a7dfc,_0x1fc6('0xc'));_0x377d87(_0x300375[_0x1fc6('0x12')]['message']);}})[_0x1fc6('0x13')](function(_0x48602a){logger[_0x1fc6('0xf')](_0x1fc6('0x10'),_0x3a7dfc,_0x48602a);_0x567c47(_0x48602a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index fdfdd0a..ab6a767 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 _0x0e8c=['/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3f78fb,_0x1ef471){var _0x3e85df=function(_0xd11def){while(--_0xd11def){_0x3f78fb['push'](_0x3f78fb['shift']());}};_0x3e85df(++_0x1ef471);}(_0x0e8c,0xd9));var _0xc0e8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0e8c[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xc0e8('0x0'));var util=require('util');var path=require(_0xc0e8('0x1'));var timeout=require(_0xc0e8('0x2'));var express=require(_0xc0e8('0x3'));var router=express[_0xc0e8('0x4')]();var auth=require(_0xc0e8('0x5'));var interaction=require(_0xc0e8('0x6'));var config=require(_0xc0e8('0x7'));var controller=require('./intFreshsalesField.controller');router[_0xc0e8('0x8')]('/',auth[_0xc0e8('0x9')](),controller[_0xc0e8('0xa')]);router[_0xc0e8('0x8')](_0xc0e8('0xb'),auth[_0xc0e8('0x9')](),controller[_0xc0e8('0xc')]);router[_0xc0e8('0xd')]('/',auth['isAuthenticated'](),controller[_0xc0e8('0xe')]);router[_0xc0e8('0xf')]('/:id',auth[_0xc0e8('0x9')](),controller['update']);router[_0xc0e8('0x10')](_0xc0e8('0xb'),auth[_0xc0e8('0x9')](),controller[_0xc0e8('0x11')]);module[_0xc0e8('0x12')]=router; \ No newline at end of file +var _0xc30d=['post','create','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id'];(function(_0x44c2ca,_0x49767f){var _0x54c4fa=function(_0x118dad){while(--_0x118dad){_0x44c2ca['push'](_0x44c2ca['shift']());}};_0x54c4fa(++_0x49767f);}(_0xc30d,0xe3));var _0xdc30=function(_0x2bfd4f,_0x1bbf2c){_0x2bfd4f=_0x2bfd4f-0x0;var _0x341849=_0xc30d[_0x2bfd4f];return _0x341849;};'use strict';var multer=require(_0xdc30('0x0'));var util=require(_0xdc30('0x1'));var path=require(_0xdc30('0x2'));var timeout=require('connect-timeout');var express=require(_0xdc30('0x3'));var router=express[_0xdc30('0x4')]();var auth=require(_0xdc30('0x5'));var interaction=require(_0xdc30('0x6'));var config=require(_0xdc30('0x7'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0xdc30('0x8')](),controller[_0xdc30('0x9')]);router['get'](_0xdc30('0xa'),auth[_0xdc30('0x8')](),controller['show']);router[_0xdc30('0xb')]('/',auth['isAuthenticated'](),controller[_0xdc30('0xc')]);router[_0xdc30('0xd')]('/:id',auth[_0xdc30('0x8')](),controller[_0xdc30('0xe')]);router['delete'](_0xdc30('0xa'),auth['isAuthenticated'](),controller[_0xdc30('0xf')]);module[_0xdc30('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 6064b3c..d692d4e 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 _0xc8e9=['keyValue','STRING','string','variable','customVariable','BOOLEAN','sequelize','ENUM'];(function(_0x5b9f4c,_0xfea7a){var _0x57639a=function(_0x2c811c){while(--_0x2c811c){_0x5b9f4c['push'](_0x5b9f4c['shift']());}};_0x57639a(++_0xfea7a);}(_0xc8e9,0x1d6));var _0x9c8e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc8e9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9c8e('0x0'));module['exports']={'type':{'type':Sequelize[_0x9c8e('0x1')]('string','variable','customVariable',_0x9c8e('0x2')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9c8e('0x3')]},'keyType':{'type':Sequelize[_0x9c8e('0x1')](_0x9c8e('0x4'),_0x9c8e('0x5'),_0x9c8e('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9c8e('0x3')]},'nameField':{'type':Sequelize[_0x9c8e('0x3')]},'customField':{'type':Sequelize[_0x9c8e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x91d9=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x5673c4,_0x5b672d){var _0x32b859=function(_0x4aa620){while(--_0x4aa620){_0x5673c4['push'](_0x5673c4['shift']());}};_0x32b859(++_0x5b672d);}(_0x91d9,0xe0));var _0x991d=function(_0x210ecd,_0x4c2ef2){_0x210ecd=_0x210ecd-0x0;var _0x4fd72f=_0x91d9[_0x210ecd];return _0x4fd72f;};'use strict';var Sequelize=require('sequelize');module[_0x991d('0x0')]={'type':{'type':Sequelize[_0x991d('0x1')](_0x991d('0x2'),_0x991d('0x3'),_0x991d('0x4'),_0x991d('0x5')),'defaultValue':_0x991d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x991d('0x6')]},'keyType':{'type':Sequelize[_0x991d('0x1')](_0x991d('0x2'),_0x991d('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x991d('0x6')]},'idField':{'type':Sequelize[_0x991d('0x6')]},'nameField':{'type':Sequelize[_0x991d('0x6')]},'customField':{'type':Sequelize[_0x991d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x991d('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index cc0c5cb..5932a54 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 _0x93a8=['desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','update','then','stack','name','send','index','map','FreshsalesField','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','params','keys','find','create','body','catch','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x2ebec8,_0x799e93){var _0x1bfa7e=function(_0x496141){while(--_0x496141){_0x2ebec8['push'](_0x2ebec8['shift']());}};_0x1bfa7e(++_0x799e93);}(_0x93a8,0x10d));var _0x893a=function(_0xa7cdb2,_0x3b4fe0){_0xa7cdb2=_0xa7cdb2-0x0;var _0x25dce2=_0x93a8[_0xa7cdb2];return _0x25dce2;};'use strict';var pdf=require(_0x893a('0x0'));var emlformat=require(_0x893a('0x1'));var rimraf=require(_0x893a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x893a('0x3'));var rp=require(_0x893a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x893a('0x5'));var util=require(_0x893a('0x6'));var path=require(_0x893a('0x7'));var sox=require(_0x893a('0x8'));var csv=require(_0x893a('0x9'));var ejs=require(_0x893a('0xa'));var fs=require('fs');var _=require(_0x893a('0xb'));var squel=require(_0x893a('0xc'));var crypto=require(_0x893a('0xd'));var jsforce=require(_0x893a('0xe'));var deskjs=require(_0x893a('0xf'));var toCsv=require(_0x893a('0x9'));var querystring=require(_0x893a('0x10'));var Papa=require(_0x893a('0x11'));var Redis=require(_0x893a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x893a('0x13'));var as=require(_0x893a('0x14'));var hardwareService=require(_0x893a('0x15'));var logger=require(_0x893a('0x16'))(_0x893a('0x17'));var utils=require(_0x893a('0x18'));var config=require('../../config/environment');var db=require(_0x893a('0x19'))['db'];function respondWithStatusCode(_0x234b76,_0x285647){_0x285647=_0x285647||0xcc;return function(_0x5541d6){if(_0x5541d6){return _0x234b76[_0x893a('0x1a')](_0x285647);}return _0x234b76['status'](_0x285647)['end']();};}function respondWithResult(_0x461280,_0x10e712){_0x10e712=_0x10e712||0xc8;return function(_0x2d5b4e){if(_0x2d5b4e){return _0x461280[_0x893a('0x1b')](_0x10e712)['json'](_0x2d5b4e);}};}function respondWithFilteredResult(_0x51bdb6,_0xc70220){return function(_0x2d5aeb){if(_0x2d5aeb){var _0x39ef6f=_0x2d5aeb[_0x893a('0x1c')],_0x1d471e=_0xc70220[_0x893a('0x1d')],_0x21bcc5=_0xc70220['offset']+_0xc70220['limit'],_0x439cc7;if(_0x21bcc5>=_0x39ef6f){_0x21bcc5=_0x39ef6f;_0x439cc7=0xc8;}else{_0x439cc7=0xce;}_0x51bdb6[_0x893a('0x1b')](_0x439cc7);return _0x51bdb6[_0x893a('0x1e')](_0x893a('0x1f'),_0x1d471e+'-'+_0x21bcc5+'/'+_0x39ef6f)[_0x893a('0x20')](_0x2d5aeb);}return null;};}function patchUpdates(_0x431266){return function(_0x507221){try{jsonpatch[_0x893a('0x21')](_0x507221,_0x431266,!![]);}catch(_0x286ec6){return BPromise[_0x893a('0x22')](_0x286ec6);}return _0x507221['save']();};}function saveUpdates(_0x512073,_0x43d2fb){return function(_0x42edf9){if(_0x42edf9){return _0x42edf9[_0x893a('0x23')](_0x512073)['then'](function(_0x17381e){return _0x17381e;});}return null;};}function removeEntity(_0x52d472,_0x476290){return function(_0xd4a0b3){if(_0xd4a0b3){return _0xd4a0b3['destroy']()[_0x893a('0x24')](function(){_0x52d472['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b5f4d,_0x47e492){return function(_0xdbde2a){if(!_0xdbde2a){_0x1b5f4d[_0x893a('0x1a')](0x194);}return _0xdbde2a;};}function handleError(_0x393afc,_0x5d6eb7){_0x5d6eb7=_0x5d6eb7||0x1f4;return function(_0x350df8){logger['error'](_0x350df8[_0x893a('0x25')]);if(_0x350df8[_0x893a('0x26')]){delete _0x350df8['name'];}_0x393afc[_0x893a('0x1b')](_0x5d6eb7)[_0x893a('0x27')](_0x350df8);};}exports[_0x893a('0x28')]=function(_0x3dacfb,_0xd9ef6b){var _0x46b987={},_0x54c259={},_0x523ab4={'count':0x0,'rows':[]};var _0x54bbbb=_[_0x893a('0x29')](db[_0x893a('0x2a')][_0x893a('0x2b')],function(_0x4d7302){return{'name':_0x4d7302['fieldName'],'type':_0x4d7302[_0x893a('0x2c')]['key']};});_0x54c259[_0x893a('0x2d')]=_['map'](_0x54bbbb,_0x893a('0x26'));_0x54c259['query']=_['keys'](_0x3dacfb[_0x893a('0x2e')]);_0x54c259[_0x893a('0x2f')]=_[_0x893a('0x30')](_0x54c259['model'],_0x54c259[_0x893a('0x2e')]);_0x46b987[_0x893a('0x31')]=_['intersection'](_0x54c259[_0x893a('0x2d')],qs[_0x893a('0x32')](_0x3dacfb['query'][_0x893a('0x32')]));_0x46b987['attributes']=_0x46b987[_0x893a('0x31')][_0x893a('0x33')]?_0x46b987[_0x893a('0x31')]:_0x54c259[_0x893a('0x2d')];if(!_0x3dacfb['query'][_0x893a('0x34')]('nolimit')){_0x46b987[_0x893a('0x35')]=qs[_0x893a('0x35')](_0x3dacfb['query'][_0x893a('0x35')]);_0x46b987['offset']=qs[_0x893a('0x1d')](_0x3dacfb[_0x893a('0x2e')][_0x893a('0x1d')]);}_0x46b987[_0x893a('0x36')]=qs[_0x893a('0x37')](_0x3dacfb[_0x893a('0x2e')][_0x893a('0x37')]);_0x46b987[_0x893a('0x38')]=qs[_0x893a('0x2f')](_[_0x893a('0x39')](_0x3dacfb[_0x893a('0x2e')],_0x54c259[_0x893a('0x2f')]),_0x54bbbb);if(_0x3dacfb['query'][_0x893a('0x3a')]){_0x46b987[_0x893a('0x38')]=_['merge'](_0x46b987[_0x893a('0x38')],{'$or':_[_0x893a('0x29')](_0x54bbbb,function(_0x56d243){if(_0x56d243[_0x893a('0x2c')]!=='VIRTUAL'){var _0x1fb983={};_0x1fb983[_0x56d243[_0x893a('0x26')]]={'$like':'%'+_0x3dacfb[_0x893a('0x2e')][_0x893a('0x3a')]+'%'};return _0x1fb983;}})});}_0x46b987=_[_0x893a('0x3b')]({},_0x46b987,_0x3dacfb[_0x893a('0x3c')]);var _0x1c47f1={'where':_0x46b987[_0x893a('0x38')]};return db[_0x893a('0x2a')][_0x893a('0x1c')](_0x1c47f1)[_0x893a('0x24')](function(_0x15bf3f){_0x523ab4[_0x893a('0x1c')]=_0x15bf3f;if(_0x3dacfb[_0x893a('0x2e')][_0x893a('0x3d')]){_0x46b987[_0x893a('0x3e')]=[{'all':!![]}];}return db[_0x893a('0x2a')][_0x893a('0x3f')](_0x46b987);})[_0x893a('0x24')](function(_0x46370a){_0x523ab4['rows']=_0x46370a;return _0x523ab4;})[_0x893a('0x24')](respondWithFilteredResult(_0xd9ef6b,_0x46b987))['catch'](handleError(_0xd9ef6b,null));};exports['show']=function(_0x4f78d7,_0xbc6b75){var _0x197109={'raw':!![],'where':{'id':_0x4f78d7[_0x893a('0x40')]['id']}},_0x3bae2e={};_0x3bae2e[_0x893a('0x2d')]=_[_0x893a('0x41')](db[_0x893a('0x2a')][_0x893a('0x2b')]);_0x3bae2e[_0x893a('0x2e')]=_[_0x893a('0x41')](_0x4f78d7[_0x893a('0x2e')]);_0x3bae2e[_0x893a('0x2f')]=_['intersection'](_0x3bae2e[_0x893a('0x2d')],_0x3bae2e[_0x893a('0x2e')]);_0x197109[_0x893a('0x31')]=_['intersection'](_0x3bae2e[_0x893a('0x2d')],qs[_0x893a('0x32')](_0x4f78d7[_0x893a('0x2e')][_0x893a('0x32')]));_0x197109[_0x893a('0x31')]=_0x197109[_0x893a('0x31')][_0x893a('0x33')]?_0x197109[_0x893a('0x31')]:_0x3bae2e['model'];if(_0x4f78d7[_0x893a('0x2e')][_0x893a('0x3d')]){_0x197109[_0x893a('0x3e')]=[{'all':!![]}];}_0x197109=_['merge']({},_0x197109,_0x4f78d7[_0x893a('0x3c')]);return db[_0x893a('0x2a')][_0x893a('0x42')](_0x197109)[_0x893a('0x24')](handleEntityNotFound(_0xbc6b75,null))[_0x893a('0x24')](respondWithResult(_0xbc6b75,null))['catch'](handleError(_0xbc6b75,null));};exports[_0x893a('0x43')]=function(_0x5aaa55,_0xfa8c83){return db['FreshsalesField'][_0x893a('0x43')](_0x5aaa55[_0x893a('0x44')],{})[_0x893a('0x24')](respondWithResult(_0xfa8c83,0xc9))[_0x893a('0x45')](handleError(_0xfa8c83,null));};exports[_0x893a('0x23')]=function(_0x57a730,_0x283a35){if(_0x57a730['body']['id']){delete _0x57a730['body']['id'];}return db['FreshsalesField'][_0x893a('0x42')]({'where':{'id':_0x57a730[_0x893a('0x40')]['id']}})[_0x893a('0x24')](handleEntityNotFound(_0x283a35,null))['then'](saveUpdates(_0x57a730[_0x893a('0x44')],null))['then'](respondWithResult(_0x283a35,null))['catch'](handleError(_0x283a35,null));};exports[_0x893a('0x46')]=function(_0x7621f0,_0x358796){return db[_0x893a('0x2a')][_0x893a('0x42')]({'where':{'id':_0x7621f0[_0x893a('0x40')]['id']}})['then'](handleEntityNotFound(_0x358796,null))[_0x893a('0x24')](removeEntity(_0x358796,null))[_0x893a('0x45')](handleError(_0x358796,null));}; \ No newline at end of file +var _0x5edc=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','params','keys','find','catch','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model'];(function(_0x5146f3,_0xe728c4){var _0x2672bb=function(_0x5a4a34){while(--_0x5a4a34){_0x5146f3['push'](_0x5146f3['shift']());}};_0x2672bb(++_0xe728c4);}(_0x5edc,0xa4));var _0xc5ed=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5edc[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xc5ed('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc5ed('0x1'));var zipdir=require(_0xc5ed('0x2'));var jsonpatch=require(_0xc5ed('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc5ed('0x4'));var Mustache=require(_0xc5ed('0x5'));var util=require(_0xc5ed('0x6'));var path=require(_0xc5ed('0x7'));var sox=require(_0xc5ed('0x8'));var csv=require(_0xc5ed('0x9'));var ejs=require(_0xc5ed('0xa'));var fs=require('fs');var _=require(_0xc5ed('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5ed('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc5ed('0x9'));var querystring=require('querystring');var Papa=require(_0xc5ed('0xd'));var Redis=require(_0xc5ed('0xe'));var authService=require(_0xc5ed('0xf'));var qs=require(_0xc5ed('0x10'));var as=require(_0xc5ed('0x11'));var hardwareService=require(_0xc5ed('0x12'));var logger=require(_0xc5ed('0x13'))(_0xc5ed('0x14'));var utils=require('../../config/utils');var config=require(_0xc5ed('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3baa54,_0x2d1f64){_0x2d1f64=_0x2d1f64||0xcc;return function(_0x51d36c){if(_0x51d36c){return _0x3baa54['sendStatus'](_0x2d1f64);}return _0x3baa54[_0xc5ed('0x16')](_0x2d1f64)[_0xc5ed('0x17')]();};}function respondWithResult(_0x275171,_0x277d51){_0x277d51=_0x277d51||0xc8;return function(_0x5d0d39){if(_0x5d0d39){return _0x275171['status'](_0x277d51)[_0xc5ed('0x18')](_0x5d0d39);}};}function respondWithFilteredResult(_0x3130c5,_0x155b52){return function(_0x255eb4){if(_0x255eb4){var _0x1b9a2a=_0x255eb4[_0xc5ed('0x19')],_0x3bfdb5=_0x155b52[_0xc5ed('0x1a')],_0x5eeadb=_0x155b52[_0xc5ed('0x1a')]+_0x155b52[_0xc5ed('0x1b')],_0x344a96;if(_0x5eeadb>=_0x1b9a2a){_0x5eeadb=_0x1b9a2a;_0x344a96=0xc8;}else{_0x344a96=0xce;}_0x3130c5[_0xc5ed('0x16')](_0x344a96);return _0x3130c5[_0xc5ed('0x1c')](_0xc5ed('0x1d'),_0x3bfdb5+'-'+_0x5eeadb+'/'+_0x1b9a2a)[_0xc5ed('0x18')](_0x255eb4);}return null;};}function patchUpdates(_0x91f8d3){return function(_0x3d486d){try{jsonpatch[_0xc5ed('0x1e')](_0x3d486d,_0x91f8d3,!![]);}catch(_0x3c1447){return BPromise[_0xc5ed('0x1f')](_0x3c1447);}return _0x3d486d[_0xc5ed('0x20')]();};}function saveUpdates(_0x143f98,_0x36b52d){return function(_0x32d173){if(_0x32d173){return _0x32d173[_0xc5ed('0x21')](_0x143f98)[_0xc5ed('0x22')](function(_0x3c9847){return _0x3c9847;});}return null;};}function removeEntity(_0x1be38c,_0x4e0bd5){return function(_0x4ec338){if(_0x4ec338){return _0x4ec338[_0xc5ed('0x23')]()[_0xc5ed('0x22')](function(){_0x1be38c[_0xc5ed('0x16')](0xcc)[_0xc5ed('0x17')]();});}};}function handleEntityNotFound(_0x53c7c5,_0x2f950d){return function(_0x21d1c1){if(!_0x21d1c1){_0x53c7c5[_0xc5ed('0x24')](0x194);}return _0x21d1c1;};}function handleError(_0xf6bb28,_0xeff66b){_0xeff66b=_0xeff66b||0x1f4;return function(_0x57624c){logger[_0xc5ed('0x25')](_0x57624c[_0xc5ed('0x26')]);if(_0x57624c[_0xc5ed('0x27')]){delete _0x57624c['name'];}_0xf6bb28['status'](_0xeff66b)[_0xc5ed('0x28')](_0x57624c);};}exports[_0xc5ed('0x29')]=function(_0x593134,_0x25f2ab){var _0x389ce1={},_0x3f0070={},_0x1fe312={'count':0x0,'rows':[]};var _0x29d261=_[_0xc5ed('0x2a')](db[_0xc5ed('0x2b')][_0xc5ed('0x2c')],function(_0x285b8f){return{'name':_0x285b8f[_0xc5ed('0x2d')],'type':_0x285b8f[_0xc5ed('0x2e')][_0xc5ed('0x2f')]};});_0x3f0070[_0xc5ed('0x30')]=_[_0xc5ed('0x2a')](_0x29d261,_0xc5ed('0x27'));_0x3f0070[_0xc5ed('0x31')]=_['keys'](_0x593134['query']);_0x3f0070[_0xc5ed('0x32')]=_[_0xc5ed('0x33')](_0x3f0070[_0xc5ed('0x30')],_0x3f0070['query']);_0x389ce1[_0xc5ed('0x34')]=_[_0xc5ed('0x33')](_0x3f0070['model'],qs[_0xc5ed('0x35')](_0x593134[_0xc5ed('0x31')]['fields']));_0x389ce1[_0xc5ed('0x34')]=_0x389ce1[_0xc5ed('0x34')][_0xc5ed('0x36')]?_0x389ce1['attributes']:_0x3f0070[_0xc5ed('0x30')];if(!_0x593134[_0xc5ed('0x31')][_0xc5ed('0x37')](_0xc5ed('0x38'))){_0x389ce1['limit']=qs['limit'](_0x593134[_0xc5ed('0x31')][_0xc5ed('0x1b')]);_0x389ce1[_0xc5ed('0x1a')]=qs[_0xc5ed('0x1a')](_0x593134[_0xc5ed('0x31')][_0xc5ed('0x1a')]);}_0x389ce1['order']=qs[_0xc5ed('0x39')](_0x593134[_0xc5ed('0x31')][_0xc5ed('0x39')]);_0x389ce1[_0xc5ed('0x3a')]=qs[_0xc5ed('0x32')](_['pick'](_0x593134[_0xc5ed('0x31')],_0x3f0070[_0xc5ed('0x32')]),_0x29d261);if(_0x593134[_0xc5ed('0x31')][_0xc5ed('0x3b')]){_0x389ce1[_0xc5ed('0x3a')]=_[_0xc5ed('0x3c')](_0x389ce1['where'],{'$or':_[_0xc5ed('0x2a')](_0x29d261,function(_0x3770c6){if(_0x3770c6[_0xc5ed('0x2e')]!=='VIRTUAL'){var _0x5c477e={};_0x5c477e[_0x3770c6[_0xc5ed('0x27')]]={'$like':'%'+_0x593134[_0xc5ed('0x31')]['filter']+'%'};return _0x5c477e;}})});}_0x389ce1=_[_0xc5ed('0x3c')]({},_0x389ce1,_0x593134[_0xc5ed('0x3d')]);var _0x216190={'where':_0x389ce1['where']};return db['FreshsalesField'][_0xc5ed('0x19')](_0x216190)[_0xc5ed('0x22')](function(_0x30475e){_0x1fe312[_0xc5ed('0x19')]=_0x30475e;if(_0x593134[_0xc5ed('0x31')][_0xc5ed('0x3e')]){_0x389ce1['include']=[{'all':!![]}];}return db[_0xc5ed('0x2b')][_0xc5ed('0x3f')](_0x389ce1);})[_0xc5ed('0x22')](function(_0x53e489){_0x1fe312[_0xc5ed('0x40')]=_0x53e489;return _0x1fe312;})[_0xc5ed('0x22')](respondWithFilteredResult(_0x25f2ab,_0x389ce1))['catch'](handleError(_0x25f2ab,null));};exports['show']=function(_0x266ec9,_0x2fb808){var _0x4d6179={'raw':!![],'where':{'id':_0x266ec9[_0xc5ed('0x41')]['id']}},_0x266923={};_0x266923[_0xc5ed('0x30')]=_[_0xc5ed('0x42')](db[_0xc5ed('0x2b')]['rawAttributes']);_0x266923['query']=_[_0xc5ed('0x42')](_0x266ec9['query']);_0x266923[_0xc5ed('0x32')]=_[_0xc5ed('0x33')](_0x266923[_0xc5ed('0x30')],_0x266923[_0xc5ed('0x31')]);_0x4d6179[_0xc5ed('0x34')]=_['intersection'](_0x266923['model'],qs[_0xc5ed('0x35')](_0x266ec9[_0xc5ed('0x31')][_0xc5ed('0x35')]));_0x4d6179['attributes']=_0x4d6179[_0xc5ed('0x34')]['length']?_0x4d6179[_0xc5ed('0x34')]:_0x266923[_0xc5ed('0x30')];if(_0x266ec9[_0xc5ed('0x31')]['includeAll']){_0x4d6179['include']=[{'all':!![]}];}_0x4d6179=_['merge']({},_0x4d6179,_0x266ec9[_0xc5ed('0x3d')]);return db[_0xc5ed('0x2b')][_0xc5ed('0x43')](_0x4d6179)[_0xc5ed('0x22')](handleEntityNotFound(_0x2fb808,null))['then'](respondWithResult(_0x2fb808,null))[_0xc5ed('0x44')](handleError(_0x2fb808,null));};exports[_0xc5ed('0x45')]=function(_0x23da47,_0x364190){return db[_0xc5ed('0x2b')][_0xc5ed('0x45')](_0x23da47[_0xc5ed('0x46')],{})[_0xc5ed('0x22')](respondWithResult(_0x364190,0xc9))['catch'](handleError(_0x364190,null));};exports[_0xc5ed('0x21')]=function(_0x1deb0e,_0x4fe770){if(_0x1deb0e[_0xc5ed('0x46')]['id']){delete _0x1deb0e[_0xc5ed('0x46')]['id'];}return db[_0xc5ed('0x2b')][_0xc5ed('0x43')]({'where':{'id':_0x1deb0e[_0xc5ed('0x41')]['id']}})[_0xc5ed('0x22')](handleEntityNotFound(_0x4fe770,null))[_0xc5ed('0x22')](saveUpdates(_0x1deb0e['body'],null))[_0xc5ed('0x22')](respondWithResult(_0x4fe770,null))[_0xc5ed('0x44')](handleError(_0x4fe770,null));};exports[_0xc5ed('0x23')]=function(_0x4f71bc,_0x5e0fed){return db[_0xc5ed('0x2b')][_0xc5ed('0x43')]({'where':{'id':_0x4f71bc['params']['id']}})[_0xc5ed('0x22')](handleEntityNotFound(_0x5e0fed,null))[_0xc5ed('0x22')](removeEntity(_0x5e0fed,null))['catch'](handleError(_0x5e0fed,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 708be80..ca9d2d7 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 _0x8ed0=['freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields'];(function(_0x400837,_0x374968){var _0x28f087=function(_0x1dc096){while(--_0x1dc096){_0x400837['push'](_0x400837['shift']());}};_0x28f087(++_0x374968);}(_0x8ed0,0xf3));var _0x08ed=function(_0x137a8d,_0x3c382c){_0x137a8d=_0x137a8d-0x0;var _0x56fb4d=_0x8ed0[_0x137a8d];return _0x56fb4d;};'use strict';var _=require(_0x08ed('0x0'));var util=require(_0x08ed('0x1'));var logger=require(_0x08ed('0x2'))(_0x08ed('0x3'));var moment=require(_0x08ed('0x4'));var BPromise=require(_0x08ed('0x5'));var rp=require(_0x08ed('0x6'));var fs=require('fs');var path=require(_0x08ed('0x7'));var rimraf=require(_0x08ed('0x8'));var config=require('../../config/environment');var attributes=require(_0x08ed('0x9'));module['exports']=function(_0x179e72,_0x5d8af2){return _0x179e72[_0x08ed('0xa')](_0x08ed('0xb'),attributes,{'tableName':_0x08ed('0xc'),'paranoid':![],'indexes':[{'name':_0x08ed('0xd'),'fields':[_0x08ed('0xe'),_0x08ed('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb2d=['idField','FieldId','util','../../config/logger','moment','request-promise','path','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0x9daa9f,_0xa8d1e6){var _0x1f1885=function(_0x460dd5){while(--_0x460dd5){_0x9daa9f['push'](_0x9daa9f['shift']());}};_0x1f1885(++_0xa8d1e6);}(_0xfb2d,0xd4));var _0xdfb2=function(_0x29632e,_0x5ecba4){_0x29632e=_0x29632e-0x0;var _0x426e04=_0xfb2d[_0x29632e];return _0x426e04;};'use strict';var _=require('lodash');var util=require(_0xdfb2('0x0'));var logger=require(_0xdfb2('0x1'))('api');var moment=require(_0xdfb2('0x2'));var BPromise=require('bluebird');var rp=require(_0xdfb2('0x3'));var fs=require('fs');var path=require(_0xdfb2('0x4'));var rimraf=require('rimraf');var config=require(_0xdfb2('0x5'));var attributes=require(_0xdfb2('0x6'));module[_0xdfb2('0x7')]=function(_0x32d361,_0x303d76){return _0x32d361[_0xdfb2('0x8')](_0xdfb2('0x9'),attributes,{'tableName':_0xdfb2('0xa'),'paranoid':![],'indexes':[{'name':_0xdfb2('0xb'),'fields':[_0xdfb2('0xc'),_0xdfb2('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 3cedf44..a5275ec 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 _0x845f=['FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','debug'];(function(_0x4f3d19,_0x34c3f7){var _0x46ff72=function(_0xde7ff0){while(--_0xde7ff0){_0x4f3d19['push'](_0x4f3d19['shift']());}};_0x46ff72(++_0x34c3f7);}(_0x845f,0x1b8));var _0xf845=function(_0x1fcaf1,_0x21c3c2){_0x1fcaf1=_0x1fcaf1-0x0;var _0x55f464=_0x845f[_0x1fcaf1];return _0x55f464;};'use strict';var _=require(_0xf845('0x0'));var util=require(_0xf845('0x1'));var moment=require(_0xf845('0x2'));var BPromise=require('bluebird');var rs=require(_0xf845('0x3'));var fs=require('fs');var Redis=require(_0xf845('0x4'));var db=require(_0xf845('0x5'))['db'];var utils=require(_0xf845('0x6'));var logger=require(_0xf845('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf845('0x8'));var client=jayson[_0xf845('0x9')][_0xf845('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21cea,_0x53ff77,_0x279ae6){return new BPromise(function(_0x4627c5,_0xc99da7){return client[_0xf845('0xb')](_0x21cea,_0x279ae6)[_0xf845('0xc')](function(_0x1ee440){logger[_0xf845('0xd')](_0xf845('0xe'),_0x53ff77,'request\x20sent');logger[_0xf845('0xf')](_0xf845('0x10'),_0x53ff77,_0xf845('0x11'),JSON[_0xf845('0x12')](_0x1ee440));if(_0x1ee440[_0xf845('0x13')]){if(_0x1ee440[_0xf845('0x13')][_0xf845('0x14')]===0x1f4){logger[_0xf845('0x13')](_0xf845('0xe'),_0x53ff77,_0x1ee440[_0xf845('0x13')][_0xf845('0x15')]);return _0xc99da7(_0x1ee440[_0xf845('0x13')][_0xf845('0x15')]);}logger[_0xf845('0x13')]('FreshsalesField,\x20%s,\x20%s',_0x53ff77,_0x1ee440[_0xf845('0x13')]['message']);return _0x4627c5(_0x1ee440[_0xf845('0x13')][_0xf845('0x15')]);}else{logger[_0xf845('0xd')](_0xf845('0xe'),_0x53ff77,'request\x20sent');_0x4627c5(_0x1ee440[_0xf845('0x16')][_0xf845('0x15')]);}})[_0xf845('0x17')](function(_0x4adacb){logger[_0xf845('0x13')](_0xf845('0xe'),_0x53ff77,_0x4adacb);_0xc99da7(_0x4adacb);});});} \ No newline at end of file +var _0xcde5=['rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x5d31f3,_0x4239b0){var _0x1cc88c=function(_0x1be8fc){while(--_0x1be8fc){_0x5d31f3['push'](_0x5d31f3['shift']());}};_0x1cc88c(++_0x4239b0);}(_0xcde5,0x12d));var _0x5cde=function(_0x31b1c9,_0x484ad6){_0x31b1c9=_0x31b1c9-0x0;var _0xb619ef=_0xcde5[_0x31b1c9];return _0xb619ef;};'use strict';var _=require(_0x5cde('0x0'));var util=require(_0x5cde('0x1'));var moment=require(_0x5cde('0x2'));var BPromise=require(_0x5cde('0x3'));var rs=require(_0x5cde('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5cde('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5cde('0x6'))(_0x5cde('0x7'));var config=require(_0x5cde('0x8'));var jayson=require(_0x5cde('0x9'));var client=jayson[_0x5cde('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16cd09,_0x3da754,_0x5e7de3){return new BPromise(function(_0x3acd55,_0x5e2e4c){return client[_0x5cde('0xb')](_0x16cd09,_0x5e7de3)[_0x5cde('0xc')](function(_0x1f9cb0){logger[_0x5cde('0xd')](_0x5cde('0xe'),_0x3da754,_0x5cde('0xf'));logger['debug'](_0x5cde('0x10'),_0x3da754,'request\x20sent',JSON['stringify'](_0x1f9cb0));if(_0x1f9cb0['error']){if(_0x1f9cb0[_0x5cde('0x11')][_0x5cde('0x12')]===0x1f4){logger[_0x5cde('0x11')](_0x5cde('0xe'),_0x3da754,_0x1f9cb0['error']['message']);return _0x5e2e4c(_0x1f9cb0[_0x5cde('0x11')][_0x5cde('0x13')]);}logger[_0x5cde('0x11')](_0x5cde('0xe'),_0x3da754,_0x1f9cb0[_0x5cde('0x11')][_0x5cde('0x13')]);return _0x3acd55(_0x1f9cb0['error'][_0x5cde('0x13')]);}else{logger[_0x5cde('0xd')](_0x5cde('0xe'),_0x3da754,_0x5cde('0xf'));_0x3acd55(_0x1f9cb0[_0x5cde('0x14')][_0x5cde('0x13')]);}})[_0x5cde('0x15')](function(_0x429652){logger[_0x5cde('0x11')](_0x5cde('0xe'),_0x3da754,_0x429652);_0x5e2e4c(_0x429652);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index e58e920..e48c8a2 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 _0xcba0=['../../config/environment','./intSalesforceAccount.controller','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','/:id','destroy','exports','multer','util','path','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcba0,0xe3));var _0x0cba=function(_0xc0618,_0x2972b8){_0xc0618=_0xc0618-0x0;var _0x310c39=_0xcba0[_0xc0618];return _0x310c39;};'use strict';var multer=require(_0x0cba('0x0'));var util=require(_0x0cba('0x1'));var path=require(_0x0cba('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x0cba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0cba('0x4'));var controller=require(_0x0cba('0x5'));router['get']('/',auth[_0x0cba('0x6')](),controller['index']);router['get']('/:id',auth[_0x0cba('0x6')](),controller[_0x0cba('0x7')]);router['get'](_0x0cba('0x8'),auth[_0x0cba('0x6')](),controller[_0x0cba('0x9')]);router['get'](_0x0cba('0xa'),auth['isAuthenticated'](),controller[_0x0cba('0xb')]);router[_0x0cba('0xc')]('/',auth[_0x0cba('0x6')](),controller[_0x0cba('0xd')]);router[_0x0cba('0xc')](_0x0cba('0x8'),auth['isAuthenticated'](),controller[_0x0cba('0xe')]);router[_0x0cba('0xf')]('/:id',auth[_0x0cba('0x6')](),controller[_0x0cba('0x10')]);router[_0x0cba('0x11')](_0x0cba('0x12'),auth[_0x0cba('0x6')](),controller[_0x0cba('0x13')]);module[_0x0cba('0x14')]=router; \ No newline at end of file +var _0x6da3=['show','/:id/configurations','/:id/fields','getFields','post','create','put','update','destroy','multer','util','path','express','Router','../../components/auth/service','./intSalesforceAccount.controller','isAuthenticated','index','get','/:id'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6da3,0xf9));var _0x36da=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6da3[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x36da('0x0'));var util=require(_0x36da('0x1'));var path=require(_0x36da('0x2'));var timeout=require('connect-timeout');var express=require(_0x36da('0x3'));var router=express[_0x36da('0x4')]();var auth=require(_0x36da('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x36da('0x6'));router['get']('/',auth[_0x36da('0x7')](),controller[_0x36da('0x8')]);router[_0x36da('0x9')](_0x36da('0xa'),auth[_0x36da('0x7')](),controller[_0x36da('0xb')]);router[_0x36da('0x9')](_0x36da('0xc'),auth[_0x36da('0x7')](),controller['getConfigurations']);router[_0x36da('0x9')](_0x36da('0xd'),auth[_0x36da('0x7')](),controller[_0x36da('0xe')]);router[_0x36da('0xf')]('/',auth[_0x36da('0x7')](),controller[_0x36da('0x10')]);router[_0x36da('0xf')](_0x36da('0xc'),auth[_0x36da('0x7')](),controller['addConfiguration']);router[_0x36da('0x11')](_0x36da('0xa'),auth['isAuthenticated'](),controller[_0x36da('0x12')]);router['delete'](_0x36da('0xa'),auth['isAuthenticated'](),controller[_0x36da('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 1de3dfa..6cb5b7b 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 _0xf494=['exports','STRING','username','ENUM','integrationTab','newTab','sequelize'];(function(_0x4015f2,_0x453974){var _0x5112b9=function(_0x49d9fb){while(--_0x49d9fb){_0x4015f2['push'](_0x4015f2['shift']());}};_0x5112b9(++_0x453974);}(_0xf494,0x1c6));var _0x4f49=function(_0x48b2c7,_0x2f901e){_0x48b2c7=_0x48b2c7-0x0;var _0x11d205=_0xf494[_0x48b2c7];return _0x11d205;};'use strict';var Sequelize=require(_0x4f49('0x0'));module[_0x4f49('0x1')]={'name':{'type':Sequelize[_0x4f49('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4f49('0x2')],'unique':_0x4f49('0x3')},'remoteUri':{'type':Sequelize[_0x4f49('0x2')]},'password':{'type':Sequelize[_0x4f49('0x2')]},'clientId':{'type':Sequelize[_0x4f49('0x2')]},'clientSecret':{'type':Sequelize[_0x4f49('0x2')]},'securityToken':{'type':Sequelize[_0x4f49('0x2')]},'serverUrl':{'type':Sequelize[_0x4f49('0x2')]},'type':{'type':Sequelize[_0x4f49('0x4')](_0x4f49('0x5'),_0x4f49('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x7fbe=['integrationTab','newTab','STRING','username','ENUM'];(function(_0x31ef52,_0x347cf0){var _0x33c350=function(_0x270093){while(--_0x270093){_0x31ef52['push'](_0x31ef52['shift']());}};_0x33c350(++_0x347cf0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4ce637,_0x463346){_0x4ce637=_0x4ce637-0x0;var _0x2e9cba=_0x7fbe[_0x4ce637];return _0x2e9cba;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe7fb('0x0')]},'description':{'type':Sequelize[_0xe7fb('0x0')]},'username':{'type':Sequelize[_0xe7fb('0x0')],'unique':_0xe7fb('0x1')},'remoteUri':{'type':Sequelize[_0xe7fb('0x0')]},'password':{'type':Sequelize[_0xe7fb('0x0')]},'clientId':{'type':Sequelize[_0xe7fb('0x0')]},'clientSecret':{'type':Sequelize[_0xe7fb('0x0')]},'securityToken':{'type':Sequelize[_0xe7fb('0x0')]},'serverUrl':{'type':Sequelize[_0xe7fb('0x0')]},'type':{'type':Sequelize[_0xe7fb('0x2')](_0xe7fb('0x3'),_0xe7fb('0x4')),'defaultValue':_0xe7fb('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 9b5cffc..691c219 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 _0x7aee=['update','getConfigurations','SalesforceConfiguration','keys','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','Task','remoteUri','clientId','password','securityToken','slice','substring','Connection','clientSecret','login','username','concat','ticketType','CallDisposition','CallDurationInSeconds','CallObject','IsArchived','Priority','Type','isNil','Case','Origin','Reason','Status','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','picklistValues','label','value','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','sendStatus','stack','name','send','index','map','SalesforceAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','find','create','body'];(function(_0x3eff51,_0x3cb44a){var _0x1aaf1d=function(_0x5a5787){while(--_0x5a5787){_0x3eff51['push'](_0x3eff51['shift']());}};_0x1aaf1d(++_0x3cb44a);}(_0x7aee,0xc2));var _0xe7ae=function(_0x48bf0c,_0x2d3d3e){_0x48bf0c=_0x48bf0c-0x0;var _0x535350=_0x7aee[_0x48bf0c];return _0x535350;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe7ae('0x0'));var rimraf=require(_0xe7ae('0x1'));var zipdir=require(_0xe7ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe7ae('0x3'));var moment=require(_0xe7ae('0x4'));var BPromise=require(_0xe7ae('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xe7ae('0x6'));var ejs=require(_0xe7ae('0x7'));var fs=require('fs');var _=require(_0xe7ae('0x8'));var squel=require(_0xe7ae('0x9'));var crypto=require(_0xe7ae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe7ae('0xb'));var toCsv=require(_0xe7ae('0x6'));var querystring=require(_0xe7ae('0xc'));var Papa=require(_0xe7ae('0xd'));var Redis=require(_0xe7ae('0xe'));var authService=require(_0xe7ae('0xf'));var qs=require(_0xe7ae('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe7ae('0x11'));var logger=require(_0xe7ae('0x12'))('api');var utils=require(_0xe7ae('0x13'));var config=require(_0xe7ae('0x14'));var db=require(_0xe7ae('0x15'))['db'];var integrations=require(_0xe7ae('0x16'));var jayson=require(_0xe7ae('0x17'));var client=jayson[_0xe7ae('0x18')][_0xe7ae('0x19')]({'port':0x232a});function checkPasswordPattern(_0x40477b,_0x1d7ece,_0x5b3255){if(_0x5b3255){var _0x16b225=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16b225[_0xe7ae('0x1a')](_0x1d7ece)){return _0x40477b;}else{throw new db[(_0xe7ae('0x1b'))][(_0xe7ae('0x1c'))](_0xe7ae('0x1d'));}}else{return _0x40477b;}}function respondWithRpcPromise(_0x219dbf,_0x4156db,_0x45a383,_0x574a00){return new BPromise(function(_0x5a1d7f,_0x4036c9){var _0x5f57ec=_0x574a00||client;return _0x5f57ec[_0xe7ae('0x1e')](_0x219dbf,_0x45a383)['then'](function(_0x2a4e51){logger[_0xe7ae('0x1f')](_0xe7ae('0x20'),_0x4156db,_0xe7ae('0x21'));logger[_0xe7ae('0x22')](_0xe7ae('0x23'),_0x4156db,_0xe7ae('0x21'),JSON['stringify'](_0x2a4e51));if(_0x2a4e51['error']){if(_0x2a4e51[_0xe7ae('0x24')][_0xe7ae('0x25')]===0x1f4){logger[_0xe7ae('0x24')](_0xe7ae('0x20'),_0x4156db,_0x2a4e51['error'][_0xe7ae('0x26')]);return _0x4036c9(_0x2a4e51[_0xe7ae('0x24')][_0xe7ae('0x26')]);}logger[_0xe7ae('0x24')](_0xe7ae('0x20'),_0x4156db,_0x2a4e51[_0xe7ae('0x24')]['message']);return _0x5a1d7f(_0x2a4e51['error'][_0xe7ae('0x26')]);}else{logger['info'](_0xe7ae('0x20'),_0x4156db,_0xe7ae('0x21'));_0x5a1d7f(_0x2a4e51[_0xe7ae('0x27')][_0xe7ae('0x26')]);}})[_0xe7ae('0x28')](function(_0x4dddf3){logger[_0xe7ae('0x24')](_0xe7ae('0x20'),_0x4156db,_0x4dddf3);_0x4036c9(_0x4dddf3);});});}function respondWithStatusCode(_0x2c8988,_0x170eee){_0x170eee=_0x170eee||0xcc;return function(_0x5cc62b){if(_0x5cc62b){return _0x2c8988['sendStatus'](_0x170eee);}return _0x2c8988[_0xe7ae('0x29')](_0x170eee)[_0xe7ae('0x2a')]();};}function respondWithResult(_0x5b666c,_0x34f912){_0x34f912=_0x34f912||0xc8;return function(_0x1f4419){if(_0x1f4419){return _0x5b666c['status'](_0x34f912)[_0xe7ae('0x2b')](_0x1f4419);}};}function respondWithFilteredResult(_0x14f18e,_0x51506c){return function(_0x1e254a){if(_0x1e254a){var _0x369224=_0x1e254a[_0xe7ae('0x2c')],_0x1bd9ed=_0x51506c[_0xe7ae('0x2d')],_0x3dbd35=_0x51506c[_0xe7ae('0x2d')]+_0x51506c[_0xe7ae('0x2e')],_0x4be1fd;if(_0x3dbd35>=_0x369224){_0x3dbd35=_0x369224;_0x4be1fd=0xc8;}else{_0x4be1fd=0xce;}_0x14f18e[_0xe7ae('0x29')](_0x4be1fd);return _0x14f18e[_0xe7ae('0x2f')](_0xe7ae('0x30'),_0x1bd9ed+'-'+_0x3dbd35+'/'+_0x369224)[_0xe7ae('0x2b')](_0x1e254a);}return null;};}function patchUpdates(_0xdbf940){return function(_0x3fd1db){try{jsonpatch[_0xe7ae('0x31')](_0x3fd1db,_0xdbf940,!![]);}catch(_0x3ff6ee){return BPromise[_0xe7ae('0x32')](_0x3ff6ee);}return _0x3fd1db['save']();};}function saveUpdates(_0x46ab02,_0x426e10){return function(_0x2755c7){if(_0x2755c7){return _0x2755c7['update'](_0x46ab02)[_0xe7ae('0x33')](function(_0x1bc415){return _0x1bc415;});}return null;};}function removeEntity(_0x40ac4e,_0x24e831){return function(_0x23f4ff){if(_0x23f4ff){return _0x23f4ff[_0xe7ae('0x34')]()[_0xe7ae('0x33')](function(){_0x40ac4e['status'](0xcc)[_0xe7ae('0x2a')]();});}};}function handleEntityNotFound(_0x589273,_0x6e8ac2){return function(_0x597ac2){if(!_0x597ac2){_0x589273[_0xe7ae('0x35')](0x194);}return _0x597ac2;};}function handleError(_0x1a8a2a,_0x462aa6){_0x462aa6=_0x462aa6||0x1f4;return function(_0x474f6d){logger['error'](_0x474f6d[_0xe7ae('0x36')]);if(_0x474f6d[_0xe7ae('0x37')]){delete _0x474f6d[_0xe7ae('0x37')];}_0x1a8a2a[_0xe7ae('0x29')](_0x462aa6)[_0xe7ae('0x38')](_0x474f6d);};}exports[_0xe7ae('0x39')]=function(_0xa34feb,_0x38a746){var _0x29c009={},_0x20a590={},_0x389b0d={'count':0x0,'rows':[]};var _0x583da7=_[_0xe7ae('0x3a')](db[_0xe7ae('0x3b')]['rawAttributes'],function(_0x40fe4a){return{'name':_0x40fe4a[_0xe7ae('0x3c')],'type':_0x40fe4a[_0xe7ae('0x3d')][_0xe7ae('0x3e')]};});_0x20a590[_0xe7ae('0x3f')]=_['map'](_0x583da7,_0xe7ae('0x37'));_0x20a590['query']=_['keys'](_0xa34feb[_0xe7ae('0x40')]);_0x20a590[_0xe7ae('0x41')]=_[_0xe7ae('0x42')](_0x20a590[_0xe7ae('0x3f')],_0x20a590[_0xe7ae('0x40')]);_0x29c009[_0xe7ae('0x43')]=_['intersection'](_0x20a590[_0xe7ae('0x3f')],qs[_0xe7ae('0x44')](_0xa34feb[_0xe7ae('0x40')]['fields']));_0x29c009['attributes']=_0x29c009[_0xe7ae('0x43')][_0xe7ae('0x45')]?_0x29c009[_0xe7ae('0x43')]:_0x20a590[_0xe7ae('0x3f')];if(!_0xa34feb[_0xe7ae('0x40')]['hasOwnProperty'](_0xe7ae('0x46'))){_0x29c009[_0xe7ae('0x2e')]=qs[_0xe7ae('0x2e')](_0xa34feb[_0xe7ae('0x40')][_0xe7ae('0x2e')]);_0x29c009[_0xe7ae('0x2d')]=qs['offset'](_0xa34feb['query'][_0xe7ae('0x2d')]);}_0x29c009[_0xe7ae('0x47')]=qs[_0xe7ae('0x48')](_0xa34feb['query']['sort']);_0x29c009['where']=qs[_0xe7ae('0x41')](_[_0xe7ae('0x49')](_0xa34feb[_0xe7ae('0x40')],_0x20a590[_0xe7ae('0x41')]),_0x583da7);if(_0xa34feb[_0xe7ae('0x40')][_0xe7ae('0x4a')]){_0x29c009[_0xe7ae('0x4b')]=_[_0xe7ae('0x4c')](_0x29c009[_0xe7ae('0x4b')],{'$or':_[_0xe7ae('0x3a')](_0x583da7,function(_0x2355cc){if(_0x2355cc[_0xe7ae('0x3d')]!==_0xe7ae('0x4d')){var _0x5da8dd={};_0x5da8dd[_0x2355cc[_0xe7ae('0x37')]]={'$like':'%'+_0xa34feb[_0xe7ae('0x40')][_0xe7ae('0x4a')]+'%'};return _0x5da8dd;}})});}_0x29c009=_[_0xe7ae('0x4c')]({},_0x29c009,_0xa34feb[_0xe7ae('0x4e')]);var _0x46c15b={'where':_0x29c009[_0xe7ae('0x4b')]};return db[_0xe7ae('0x3b')]['count'](_0x46c15b)['then'](function(_0x1af877){_0x389b0d[_0xe7ae('0x2c')]=_0x1af877;if(_0xa34feb['query'][_0xe7ae('0x4f')]){_0x29c009[_0xe7ae('0x50')]=[{'all':!![]}];}return db[_0xe7ae('0x3b')][_0xe7ae('0x51')](_0x29c009);})[_0xe7ae('0x33')](function(_0x54a92c){_0x389b0d['rows']=_0x54a92c;return _0x389b0d;})[_0xe7ae('0x33')](respondWithFilteredResult(_0x38a746,_0x29c009))['catch'](handleError(_0x38a746,null));};exports[_0xe7ae('0x52')]=function(_0x315766,_0xf6199){var _0x3418fc={'raw':![],'where':{'id':_0x315766[_0xe7ae('0x53')]['id']}},_0x3e904c={};_0x3e904c[_0xe7ae('0x3f')]=_['keys'](db[_0xe7ae('0x3b')][_0xe7ae('0x54')]);_0x3e904c[_0xe7ae('0x40')]=_['keys'](_0x315766['query']);_0x3e904c['filters']=_[_0xe7ae('0x42')](_0x3e904c[_0xe7ae('0x3f')],_0x3e904c[_0xe7ae('0x40')]);_0x3418fc[_0xe7ae('0x43')]=_['intersection'](_0x3e904c[_0xe7ae('0x3f')],qs['fields'](_0x315766[_0xe7ae('0x40')][_0xe7ae('0x44')]));_0x3418fc[_0xe7ae('0x43')]=_0x3418fc[_0xe7ae('0x43')][_0xe7ae('0x45')]?_0x3418fc[_0xe7ae('0x43')]:_0x3e904c[_0xe7ae('0x3f')];if(_0x315766[_0xe7ae('0x40')][_0xe7ae('0x4f')]){_0x3418fc[_0xe7ae('0x50')]=[{'all':!![]}];}_0x3418fc=_[_0xe7ae('0x4c')]({},_0x3418fc,_0x315766[_0xe7ae('0x4e')]);return db['SalesforceAccount'][_0xe7ae('0x55')](_0x3418fc)['then'](handleEntityNotFound(_0xf6199,null))[_0xe7ae('0x33')](respondWithResult(_0xf6199,null))[_0xe7ae('0x28')](handleError(_0xf6199,null));};exports[_0xe7ae('0x56')]=function(_0x52eab0,_0x513911){return db[_0xe7ae('0x3b')][_0xe7ae('0x56')](_0x52eab0[_0xe7ae('0x57')],{})[_0xe7ae('0x33')](respondWithResult(_0x513911,0xc9))[_0xe7ae('0x28')](handleError(_0x513911,null));};exports[_0xe7ae('0x58')]=function(_0x320761,_0x38b3c9){if(_0x320761['body']['id']){delete _0x320761[_0xe7ae('0x57')]['id'];}return db[_0xe7ae('0x3b')]['find']({'where':{'id':_0x320761[_0xe7ae('0x53')]['id']}})[_0xe7ae('0x33')](handleEntityNotFound(_0x38b3c9,null))[_0xe7ae('0x33')](saveUpdates(_0x320761[_0xe7ae('0x57')],null))[_0xe7ae('0x33')](respondWithResult(_0x38b3c9,null))['catch'](handleError(_0x38b3c9,null));};exports['destroy']=function(_0x30a982,_0x476f5b){return db[_0xe7ae('0x3b')][_0xe7ae('0x55')]({'where':{'id':_0x30a982[_0xe7ae('0x53')]['id']}})['then'](handleEntityNotFound(_0x476f5b,null))['then'](removeEntity(_0x476f5b,null))[_0xe7ae('0x28')](handleError(_0x476f5b,null));};exports[_0xe7ae('0x59')]=function(_0x30af61,_0x30a4bd,_0x9fd10c){var _0x512ab1={};var _0x45236a={};var _0x58bccd;var _0x4db6f5;return db[_0xe7ae('0x3b')]['findOne']({'where':{'id':_0x30af61[_0xe7ae('0x53')]['id']}})[_0xe7ae('0x33')](handleEntityNotFound(_0x30a4bd,null))['then'](function(_0x27a978){if(_0x27a978){_0x58bccd=_0x27a978;_0x45236a[_0xe7ae('0x3f')]=_['keys'](db[_0xe7ae('0x5a')][_0xe7ae('0x54')]);_0x45236a[_0xe7ae('0x40')]=_[_0xe7ae('0x5b')](_0x30af61[_0xe7ae('0x40')]);_0x45236a[_0xe7ae('0x41')]=_[_0xe7ae('0x42')](_0x45236a[_0xe7ae('0x3f')],_0x45236a[_0xe7ae('0x40')]);_0x512ab1['attributes']=_[_0xe7ae('0x42')](_0x45236a[_0xe7ae('0x3f')],qs[_0xe7ae('0x44')](_0x30af61[_0xe7ae('0x40')]['fields']));_0x512ab1[_0xe7ae('0x43')]=_0x512ab1[_0xe7ae('0x43')]['length']?_0x512ab1['attributes']:_0x45236a['model'];_0x512ab1['order']=qs[_0xe7ae('0x48')](_0x30af61[_0xe7ae('0x40')][_0xe7ae('0x48')]);_0x512ab1[_0xe7ae('0x4b')]=qs['filters'](_['pick'](_0x30af61['query'],_0x45236a['filters']));if(_0x30af61[_0xe7ae('0x40')][_0xe7ae('0x4a')]){_0x512ab1[_0xe7ae('0x4b')]=_[_0xe7ae('0x4c')](_0x512ab1['where'],{'$or':_[_0xe7ae('0x3a')](_0x512ab1['attributes'],function(_0xe73332){var _0x3f0b01={};_0x3f0b01[_0xe73332]={'$like':'%'+_0x30af61[_0xe7ae('0x40')][_0xe7ae('0x4a')]+'%'};return _0x3f0b01;})});}_0x512ab1=_[_0xe7ae('0x4c')]({},_0x512ab1,_0x30af61[_0xe7ae('0x4e')]);return _0x58bccd[_0xe7ae('0x59')](_0x512ab1);}})[_0xe7ae('0x33')](function(_0x5b7fee){if(_0x5b7fee){_0x4db6f5=_0x5b7fee[_0xe7ae('0x45')];if(!_0x30af61[_0xe7ae('0x40')]['hasOwnProperty']('nolimit')){_0x512ab1['limit']=qs[_0xe7ae('0x2e')](_0x30af61['query']['limit']);_0x512ab1[_0xe7ae('0x2d')]=qs[_0xe7ae('0x2d')](_0x30af61[_0xe7ae('0x40')][_0xe7ae('0x2d')]);}return _0x58bccd[_0xe7ae('0x59')](_0x512ab1);}})[_0xe7ae('0x33')](function(_0x54d061){if(_0x54d061){return _0x54d061?{'count':_0x4db6f5,'rows':_0x54d061}:null;}})['then'](respondWithResult(_0x30a4bd,null))[_0xe7ae('0x28')](handleError(_0x30a4bd,null));};exports[_0xe7ae('0x5c')]=function(_0x44e880,_0x19c810,_0x33652d){if(_0x44e880[_0xe7ae('0x57')]['id']){delete _0x44e880[_0xe7ae('0x57')]['id'];}return db['SalesforceAccount'][_0xe7ae('0x5d')]({'where':{'id':_0x44e880[_0xe7ae('0x53')]['id']}})['then'](handleEntityNotFound(_0x19c810,null))['then'](function(_0x4199b4){if(_0x4199b4){_0x44e880[_0xe7ae('0x57')][_0xe7ae('0x5e')]=_0x4199b4['id'];_0x44e880[_0xe7ae('0x57')][_0xe7ae('0x5f')]=integrations[_0xe7ae('0x60')](_0x44e880[_0xe7ae('0x57')][_0xe7ae('0x61')],_0x44e880['body'][_0xe7ae('0x3d')]);_0x44e880[_0xe7ae('0x57')][_0xe7ae('0x62')]=integrations[_0xe7ae('0x63')](_0x44e880[_0xe7ae('0x57')][_0xe7ae('0x61')],_0x44e880[_0xe7ae('0x57')][_0xe7ae('0x3d')]);return db[_0xe7ae('0x5a')][_0xe7ae('0x56')](_0x44e880[_0xe7ae('0x57')],{'include':[{'model':db['SalesforceField'],'as':_0xe7ae('0x5f')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xe7ae('0x33')](respondWithResult(_0x19c810,null))[_0xe7ae('0x28')](handleError(_0x19c810,null));};exports[_0xe7ae('0x64')]=function(_0x2d19a3,_0x77267b,_0x2870b6){var _0x21da92;var _0x1051c8='';var _0x165bd8=_0xe7ae('0x65');return db['SalesforceAccount']['findOne']({'where':{'id':_0x2d19a3[_0xe7ae('0x53')]['id']},'attributes':['id',_0xe7ae('0x66'),_0xe7ae('0x67'),'clientSecret','username',_0xe7ae('0x68'),_0xe7ae('0x69')]})['then'](handleEntityNotFound(_0x77267b,null))['then'](function(_0x4f023e){if(_0x4f023e){_0x1051c8=_0x4f023e[_0xe7ae('0x66')];var _0x208a5c=_0x1051c8[_0xe7ae('0x6a')](-0x1);if(_0x208a5c==='/'){_0x1051c8=_0x1051c8[_0xe7ae('0x6b')](0x0,_0x1051c8['lastIndexOf'](_0x208a5c));}_0x21da92=new jsforce[(_0xe7ae('0x6c'))]({'oauth2':{'loginUrl':_0x1051c8,'clientId':_0x4f023e[_0xe7ae('0x67')],'clientSecret':_0x4f023e[_0xe7ae('0x6d')]}});return _0x21da92[_0xe7ae('0x6e')](_0x4f023e[_0xe7ae('0x6f')],_0x4f023e[_0xe7ae('0x68')][_0xe7ae('0x70')](_0x4f023e[_0xe7ae('0x69')]));}})['then'](function(_0x14c585){if(_0x14c585){if(!_['isNil'](_0x2d19a3[_0xe7ae('0x40')][_0xe7ae('0x71')])){_0x165bd8=_0x2d19a3[_0xe7ae('0x40')][_0xe7ae('0x71')];}return _0x21da92['sobject'](_0x165bd8)['describe']();}})[_0xe7ae('0x33')](function(_0x4961c1){var _0x1d7940=[_0xe7ae('0x72'),_0xe7ae('0x73'),_0xe7ae('0x74'),'CallType',_0xe7ae('0x75'),_0xe7ae('0x76'),'Status',_0xe7ae('0x77')];if(!_[_0xe7ae('0x78')](_0x2d19a3[_0xe7ae('0x40')]['ticketType'])&&_0x2d19a3[_0xe7ae('0x40')][_0xe7ae('0x71')]===_0xe7ae('0x79')){_0x1d7940=[_0xe7ae('0x77'),_0xe7ae('0x7a'),_0xe7ae('0x7b'),_0xe7ae('0x7c'),_0xe7ae('0x76'),_0xe7ae('0x7d'),_0xe7ae('0x7e'),_0xe7ae('0x7f')];}if(_0x4961c1){_[_0xe7ae('0x80')](_0x4961c1[_0xe7ae('0x44')],function(_0x456d39){return _0x456d39[_0xe7ae('0x81')]===![]&&!_0x1d7940[_0xe7ae('0x82')](_0x456d39['name']);});return{'count':_0x4961c1[_0xe7ae('0x44')][_0xe7ae('0x45')],'rows':_[_0xe7ae('0x3a')](_0x4961c1[_0xe7ae('0x44')],function(_0x259dbd){return{'id':_0x259dbd['name'],'name':_0x259dbd['label'],'custom':_0x259dbd[_0xe7ae('0x81')],'options':_0x259dbd[_0xe7ae('0x83')][_0xe7ae('0x45')]>0x0?_['map'](_0x259dbd[_0xe7ae('0x83')],function(_0x2069b3){return{'name':_0x2069b3[_0xe7ae('0x84')],'value':_0x2069b3[_0xe7ae('0x85')]};}):_0x259dbd[_0xe7ae('0x3d')]=='boolean'?[{'name':'True','value':_0xe7ae('0x86')},{'name':_0xe7ae('0x87'),'value':_0xe7ae('0x88')}]:[]};})};}})['then'](respondWithResult(_0x77267b,null))[_0xe7ae('0x28')](function(_0xc4bacc){var _0x312c4e=_0x2d19a3['query'][_0xe7ae('0x1a')]?0x1f4:_0xc4bacc[_0xe7ae('0x89')]||0x1f4;logger[_0xe7ae('0x24')](_0xe7ae('0x8a'),_0xe7ae('0x64'),_0x312c4e,JSON[_0xe7ae('0x8b')](_0xc4bacc));delete _0xc4bacc[_0xe7ae('0x37')];if(_0x312c4e===0x191){_0x312c4e=0x190;}_0x77267b['status'](_0x312c4e)['send'](_0x2d19a3['query'][_0xe7ae('0x1a')]?{'message':_0xe7ae('0x8c'),'statusCode':_0xc4bacc[_0xe7ae('0x89')]}:_0xc4bacc);});}; \ No newline at end of file +var _0x780b=['picklistValues','value','boolean','True','true','False','false','getFields,\x20%s,\x20%s,\x20%s','send','statusCode','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','fields','create','body','find','destroy','getConfigurations','SalesforceConfiguration','options','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','findOne','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','login','concat','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Status','Type','Reason','Priority','IsEscalated','remove','custom','includes','label'];(function(_0x484cac,_0x30ad3a){var _0x1d6e77=function(_0x4f5f16){while(--_0x4f5f16){_0x484cac['push'](_0x484cac['shift']());}};_0x1d6e77(++_0x30ad3a);}(_0x780b,0x97));var _0xb780=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x780b[_0x376b45];return _0x2341b3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb780('0x0'));var rimraf=require(_0xb780('0x1'));var zipdir=require(_0xb780('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb780('0x3'));var moment=require('moment');var BPromise=require(_0xb780('0x4'));var Mustache=require(_0xb780('0x5'));var util=require(_0xb780('0x6'));var path=require('path');var sox=require(_0xb780('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xb780('0x8'));var squel=require(_0xb780('0x9'));var crypto=require('crypto');var jsforce=require(_0xb780('0xa'));var deskjs=require(_0xb780('0xb'));var toCsv=require(_0xb780('0xc'));var querystring=require('querystring');var Papa=require(_0xb780('0xd'));var Redis=require(_0xb780('0xe'));var authService=require(_0xb780('0xf'));var qs=require(_0xb780('0x10'));var as=require(_0xb780('0x11'));var hardwareService=require(_0xb780('0x12'));var logger=require(_0xb780('0x13'))(_0xb780('0x14'));var utils=require(_0xb780('0x15'));var config=require(_0xb780('0x16'));var db=require(_0xb780('0x17'))['db'];var integrations=require(_0xb780('0x18'));var jayson=require(_0xb780('0x19'));var client=jayson[_0xb780('0x1a')][_0xb780('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x391331,_0x4139a3,_0x2552c6){if(_0x2552c6){var _0x212eae=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x212eae[_0xb780('0x1c')](_0x4139a3)){return _0x391331;}else{throw new db[(_0xb780('0x1d'))][(_0xb780('0x1e'))](_0xb780('0x1f'));}}else{return _0x391331;}}function respondWithRpcPromise(_0x5f1161,_0x5cf4de,_0x44876a,_0x50b334){return new BPromise(function(_0xf30e02,_0x52f9b8){var _0xf0e43=_0x50b334||client;return _0xf0e43[_0xb780('0x20')](_0x5f1161,_0x44876a)[_0xb780('0x21')](function(_0x2b3aeb){logger['info'](_0xb780('0x22'),_0x5cf4de,'request\x20sent');logger[_0xb780('0x23')](_0xb780('0x24'),_0x5cf4de,'request\x20sent',JSON[_0xb780('0x25')](_0x2b3aeb));if(_0x2b3aeb[_0xb780('0x26')]){if(_0x2b3aeb[_0xb780('0x26')][_0xb780('0x27')]===0x1f4){logger['error'](_0xb780('0x22'),_0x5cf4de,_0x2b3aeb[_0xb780('0x26')][_0xb780('0x28')]);return _0x52f9b8(_0x2b3aeb['error'][_0xb780('0x28')]);}logger[_0xb780('0x26')](_0xb780('0x22'),_0x5cf4de,_0x2b3aeb[_0xb780('0x26')][_0xb780('0x28')]);return _0xf30e02(_0x2b3aeb[_0xb780('0x26')][_0xb780('0x28')]);}else{logger['info'](_0xb780('0x22'),_0x5cf4de,_0xb780('0x29'));_0xf30e02(_0x2b3aeb[_0xb780('0x2a')][_0xb780('0x28')]);}})[_0xb780('0x2b')](function(_0x4f1416){logger[_0xb780('0x26')](_0xb780('0x22'),_0x5cf4de,_0x4f1416);_0x52f9b8(_0x4f1416);});});}function respondWithStatusCode(_0x549109,_0x1d5952){_0x1d5952=_0x1d5952||0xcc;return function(_0x5c1758){if(_0x5c1758){return _0x549109[_0xb780('0x2c')](_0x1d5952);}return _0x549109[_0xb780('0x2d')](_0x1d5952)['end']();};}function respondWithResult(_0x3abd5b,_0x4607c3){_0x4607c3=_0x4607c3||0xc8;return function(_0x2db07c){if(_0x2db07c){return _0x3abd5b[_0xb780('0x2d')](_0x4607c3)[_0xb780('0x2e')](_0x2db07c);}};}function respondWithFilteredResult(_0xe1f007,_0x394e44){return function(_0x9e7b02){if(_0x9e7b02){var _0x23b05b=_0x9e7b02[_0xb780('0x2f')],_0x7439e1=_0x394e44[_0xb780('0x30')],_0xa0b1e4=_0x394e44['offset']+_0x394e44[_0xb780('0x31')],_0x23cb28;if(_0xa0b1e4>=_0x23b05b){_0xa0b1e4=_0x23b05b;_0x23cb28=0xc8;}else{_0x23cb28=0xce;}_0xe1f007[_0xb780('0x2d')](_0x23cb28);return _0xe1f007[_0xb780('0x32')](_0xb780('0x33'),_0x7439e1+'-'+_0xa0b1e4+'/'+_0x23b05b)['json'](_0x9e7b02);}return null;};}function patchUpdates(_0x5e1145){return function(_0x55b008){try{jsonpatch['apply'](_0x55b008,_0x5e1145,!![]);}catch(_0x490343){return BPromise[_0xb780('0x34')](_0x490343);}return _0x55b008[_0xb780('0x35')]();};}function saveUpdates(_0x4db3c0,_0x40d7cb){return function(_0x52832e){if(_0x52832e){return _0x52832e[_0xb780('0x36')](_0x4db3c0)['then'](function(_0x424273){return _0x424273;});}return null;};}function removeEntity(_0x5cf3b3,_0x206189){return function(_0x466dea){if(_0x466dea){return _0x466dea['destroy']()[_0xb780('0x21')](function(){_0x5cf3b3[_0xb780('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x453329,_0x3b74c0){return function(_0x6793c4){if(!_0x6793c4){_0x453329[_0xb780('0x2c')](0x194);}return _0x6793c4;};}function handleError(_0x1df89a,_0x2652a0){_0x2652a0=_0x2652a0||0x1f4;return function(_0xbfde85){logger['error'](_0xbfde85[_0xb780('0x37')]);if(_0xbfde85[_0xb780('0x38')]){delete _0xbfde85[_0xb780('0x38')];}_0x1df89a[_0xb780('0x2d')](_0x2652a0)['send'](_0xbfde85);};}exports[_0xb780('0x39')]=function(_0x79b5df,_0x50ebf8){var _0x353e5d={},_0x40fc3c={},_0x469886={'count':0x0,'rows':[]};var _0x1e05df=_[_0xb780('0x3a')](db[_0xb780('0x3b')][_0xb780('0x3c')],function(_0x110d13){return{'name':_0x110d13[_0xb780('0x3d')],'type':_0x110d13[_0xb780('0x3e')][_0xb780('0x3f')]};});_0x40fc3c[_0xb780('0x40')]=_[_0xb780('0x3a')](_0x1e05df,_0xb780('0x38'));_0x40fc3c[_0xb780('0x41')]=_[_0xb780('0x42')](_0x79b5df[_0xb780('0x41')]);_0x40fc3c[_0xb780('0x43')]=_[_0xb780('0x44')](_0x40fc3c['model'],_0x40fc3c[_0xb780('0x41')]);_0x353e5d[_0xb780('0x45')]=_['intersection'](_0x40fc3c[_0xb780('0x40')],qs['fields'](_0x79b5df[_0xb780('0x41')]['fields']));_0x353e5d[_0xb780('0x45')]=_0x353e5d['attributes'][_0xb780('0x46')]?_0x353e5d['attributes']:_0x40fc3c['model'];if(!_0x79b5df['query'][_0xb780('0x47')](_0xb780('0x48'))){_0x353e5d[_0xb780('0x31')]=qs[_0xb780('0x31')](_0x79b5df[_0xb780('0x41')][_0xb780('0x31')]);_0x353e5d[_0xb780('0x30')]=qs['offset'](_0x79b5df[_0xb780('0x41')]['offset']);}_0x353e5d[_0xb780('0x49')]=qs['sort'](_0x79b5df['query'][_0xb780('0x4a')]);_0x353e5d[_0xb780('0x4b')]=qs[_0xb780('0x43')](_[_0xb780('0x4c')](_0x79b5df['query'],_0x40fc3c['filters']),_0x1e05df);if(_0x79b5df['query'][_0xb780('0x4d')]){_0x353e5d[_0xb780('0x4b')]=_[_0xb780('0x4e')](_0x353e5d[_0xb780('0x4b')],{'$or':_[_0xb780('0x3a')](_0x1e05df,function(_0xd248a9){if(_0xd248a9[_0xb780('0x3e')]!==_0xb780('0x4f')){var _0x508c63={};_0x508c63[_0xd248a9['name']]={'$like':'%'+_0x79b5df[_0xb780('0x41')][_0xb780('0x4d')]+'%'};return _0x508c63;}})});}_0x353e5d=_['merge']({},_0x353e5d,_0x79b5df['options']);var _0x4c29ce={'where':_0x353e5d[_0xb780('0x4b')]};return db[_0xb780('0x3b')][_0xb780('0x2f')](_0x4c29ce)[_0xb780('0x21')](function(_0xf67377){_0x469886[_0xb780('0x2f')]=_0xf67377;if(_0x79b5df['query'][_0xb780('0x50')]){_0x353e5d[_0xb780('0x51')]=[{'all':!![]}];}return db[_0xb780('0x3b')][_0xb780('0x52')](_0x353e5d);})[_0xb780('0x21')](function(_0x1b94fa){_0x469886['rows']=_0x1b94fa;return _0x469886;})['then'](respondWithFilteredResult(_0x50ebf8,_0x353e5d))[_0xb780('0x2b')](handleError(_0x50ebf8,null));};exports[_0xb780('0x53')]=function(_0x5f4b13,_0x138333){var _0xda30f={'raw':![],'where':{'id':_0x5f4b13[_0xb780('0x54')]['id']}},_0x1c433a={};_0x1c433a['model']=_['keys'](db[_0xb780('0x3b')][_0xb780('0x3c')]);_0x1c433a[_0xb780('0x41')]=_[_0xb780('0x42')](_0x5f4b13[_0xb780('0x41')]);_0x1c433a['filters']=_[_0xb780('0x44')](_0x1c433a[_0xb780('0x40')],_0x1c433a[_0xb780('0x41')]);_0xda30f[_0xb780('0x45')]=_[_0xb780('0x44')](_0x1c433a['model'],qs[_0xb780('0x55')](_0x5f4b13[_0xb780('0x41')][_0xb780('0x55')]));_0xda30f[_0xb780('0x45')]=_0xda30f[_0xb780('0x45')][_0xb780('0x46')]?_0xda30f[_0xb780('0x45')]:_0x1c433a['model'];if(_0x5f4b13[_0xb780('0x41')]['includeAll']){_0xda30f[_0xb780('0x51')]=[{'all':!![]}];}_0xda30f=_[_0xb780('0x4e')]({},_0xda30f,_0x5f4b13['options']);return db[_0xb780('0x3b')]['find'](_0xda30f)[_0xb780('0x21')](handleEntityNotFound(_0x138333,null))[_0xb780('0x21')](respondWithResult(_0x138333,null))[_0xb780('0x2b')](handleError(_0x138333,null));};exports[_0xb780('0x56')]=function(_0x576799,_0x45a68a){return db['SalesforceAccount']['create'](_0x576799[_0xb780('0x57')],{})['then'](respondWithResult(_0x45a68a,0xc9))[_0xb780('0x2b')](handleError(_0x45a68a,null));};exports[_0xb780('0x36')]=function(_0x1f7d7e,_0x16d523){if(_0x1f7d7e[_0xb780('0x57')]['id']){delete _0x1f7d7e[_0xb780('0x57')]['id'];}return db['SalesforceAccount'][_0xb780('0x58')]({'where':{'id':_0x1f7d7e[_0xb780('0x54')]['id']}})[_0xb780('0x21')](handleEntityNotFound(_0x16d523,null))[_0xb780('0x21')](saveUpdates(_0x1f7d7e[_0xb780('0x57')],null))[_0xb780('0x21')](respondWithResult(_0x16d523,null))[_0xb780('0x2b')](handleError(_0x16d523,null));};exports[_0xb780('0x59')]=function(_0x3f37d8,_0x3d86c7){return db[_0xb780('0x3b')][_0xb780('0x58')]({'where':{'id':_0x3f37d8[_0xb780('0x54')]['id']}})[_0xb780('0x21')](handleEntityNotFound(_0x3d86c7,null))[_0xb780('0x21')](removeEntity(_0x3d86c7,null))['catch'](handleError(_0x3d86c7,null));};exports[_0xb780('0x5a')]=function(_0x305925,_0x5e0e20,_0x17870e){var _0x299549={};var _0x56f3ad={};var _0x7cdcc3;var _0x351c55;return db[_0xb780('0x3b')]['findOne']({'where':{'id':_0x305925['params']['id']}})[_0xb780('0x21')](handleEntityNotFound(_0x5e0e20,null))['then'](function(_0x3bcb36){if(_0x3bcb36){_0x7cdcc3=_0x3bcb36;_0x56f3ad[_0xb780('0x40')]=_[_0xb780('0x42')](db[_0xb780('0x5b')]['rawAttributes']);_0x56f3ad[_0xb780('0x41')]=_[_0xb780('0x42')](_0x305925[_0xb780('0x41')]);_0x56f3ad[_0xb780('0x43')]=_[_0xb780('0x44')](_0x56f3ad['model'],_0x56f3ad[_0xb780('0x41')]);_0x299549['attributes']=_[_0xb780('0x44')](_0x56f3ad[_0xb780('0x40')],qs[_0xb780('0x55')](_0x305925['query'][_0xb780('0x55')]));_0x299549[_0xb780('0x45')]=_0x299549['attributes'][_0xb780('0x46')]?_0x299549[_0xb780('0x45')]:_0x56f3ad[_0xb780('0x40')];_0x299549[_0xb780('0x49')]=qs[_0xb780('0x4a')](_0x305925[_0xb780('0x41')][_0xb780('0x4a')]);_0x299549[_0xb780('0x4b')]=qs['filters'](_[_0xb780('0x4c')](_0x305925['query'],_0x56f3ad[_0xb780('0x43')]));if(_0x305925[_0xb780('0x41')][_0xb780('0x4d')]){_0x299549[_0xb780('0x4b')]=_['merge'](_0x299549[_0xb780('0x4b')],{'$or':_[_0xb780('0x3a')](_0x299549[_0xb780('0x45')],function(_0x4ee95a){var _0x3ab537={};_0x3ab537[_0x4ee95a]={'$like':'%'+_0x305925['query'][_0xb780('0x4d')]+'%'};return _0x3ab537;})});}_0x299549=_[_0xb780('0x4e')]({},_0x299549,_0x305925[_0xb780('0x5c')]);return _0x7cdcc3[_0xb780('0x5a')](_0x299549);}})[_0xb780('0x21')](function(_0x29112a){if(_0x29112a){_0x351c55=_0x29112a[_0xb780('0x46')];if(!_0x305925[_0xb780('0x41')][_0xb780('0x47')]('nolimit')){_0x299549[_0xb780('0x31')]=qs['limit'](_0x305925[_0xb780('0x41')][_0xb780('0x31')]);_0x299549['offset']=qs[_0xb780('0x30')](_0x305925[_0xb780('0x41')]['offset']);}return _0x7cdcc3['getConfigurations'](_0x299549);}})['then'](function(_0xcff51a){if(_0xcff51a){return _0xcff51a?{'count':_0x351c55,'rows':_0xcff51a}:null;}})[_0xb780('0x21')](respondWithResult(_0x5e0e20,null))['catch'](handleError(_0x5e0e20,null));};exports[_0xb780('0x5d')]=function(_0x19d4a9,_0x2c50d2,_0x5489ee){if(_0x19d4a9['body']['id']){delete _0x19d4a9[_0xb780('0x57')]['id'];}return db[_0xb780('0x3b')]['findOne']({'where':{'id':_0x19d4a9[_0xb780('0x54')]['id']}})[_0xb780('0x21')](handleEntityNotFound(_0x2c50d2,null))[_0xb780('0x21')](function(_0x40a7c1){if(_0x40a7c1){_0x19d4a9['body'][_0xb780('0x5e')]=_0x40a7c1['id'];_0x19d4a9[_0xb780('0x57')][_0xb780('0x5f')]=integrations[_0xb780('0x60')](_0x19d4a9['body'][_0xb780('0x61')],_0x19d4a9[_0xb780('0x57')][_0xb780('0x3e')]);_0x19d4a9[_0xb780('0x57')][_0xb780('0x62')]=integrations[_0xb780('0x63')](_0x19d4a9[_0xb780('0x57')][_0xb780('0x61')],_0x19d4a9[_0xb780('0x57')][_0xb780('0x3e')]);return db[_0xb780('0x5b')]['create'](_0x19d4a9[_0xb780('0x57')],{'include':[{'model':db[_0xb780('0x64')],'as':_0xb780('0x5f')},{'model':db[_0xb780('0x64')],'as':_0xb780('0x62')}]});}return null;})[_0xb780('0x21')](respondWithResult(_0x2c50d2,null))['catch'](handleError(_0x2c50d2,null));};exports[_0xb780('0x65')]=function(_0x2dfc44,_0x400853,_0x2947ec){var _0x5eabf2;var _0x55af47='';var _0x95ae25='Task';return db[_0xb780('0x3b')][_0xb780('0x66')]({'where':{'id':_0x2dfc44['params']['id']},'attributes':['id',_0xb780('0x67'),_0xb780('0x68'),_0xb780('0x69'),_0xb780('0x6a'),_0xb780('0x6b'),_0xb780('0x6c')]})[_0xb780('0x21')](handleEntityNotFound(_0x400853,null))[_0xb780('0x21')](function(_0x31f0aa){if(_0x31f0aa){_0x55af47=_0x31f0aa['remoteUri'];var _0x2d8de9=_0x55af47[_0xb780('0x6d')](-0x1);if(_0x2d8de9==='/'){_0x55af47=_0x55af47['substring'](0x0,_0x55af47[_0xb780('0x6e')](_0x2d8de9));}_0x5eabf2=new jsforce['Connection']({'oauth2':{'loginUrl':_0x55af47,'clientId':_0x31f0aa[_0xb780('0x68')],'clientSecret':_0x31f0aa[_0xb780('0x69')]}});return _0x5eabf2[_0xb780('0x6f')](_0x31f0aa[_0xb780('0x6a')],_0x31f0aa[_0xb780('0x6b')][_0xb780('0x70')](_0x31f0aa[_0xb780('0x6c')]));}})['then'](function(_0x25297d){if(_0x25297d){if(!_[_0xb780('0x71')](_0x2dfc44['query']['ticketType'])){_0x95ae25=_0x2dfc44[_0xb780('0x41')][_0xb780('0x72')];}return _0x5eabf2[_0xb780('0x73')](_0x95ae25)[_0xb780('0x74')]();}})[_0xb780('0x21')](function(_0xc5c906){var _0x5ccf57=[_0xb780('0x75'),_0xb780('0x76'),_0xb780('0x77'),_0xb780('0x78'),_0xb780('0x79'),'Priority',_0xb780('0x7a'),_0xb780('0x7b')];if(!_[_0xb780('0x71')](_0x2dfc44[_0xb780('0x41')]['ticketType'])&&_0x2dfc44['query']['ticketType']==='Case'){_0x5ccf57=[_0xb780('0x7b'),'Origin',_0xb780('0x7c'),_0xb780('0x7a'),_0xb780('0x7d'),_0xb780('0x7e'),'SuppliedName','SuppliedCompany'];}if(_0xc5c906){_[_0xb780('0x7f')](_0xc5c906[_0xb780('0x55')],function(_0x5da06a){return _0x5da06a[_0xb780('0x80')]===![]&&!_0x5ccf57[_0xb780('0x81')](_0x5da06a[_0xb780('0x38')]);});return{'count':_0xc5c906[_0xb780('0x55')][_0xb780('0x46')],'rows':_[_0xb780('0x3a')](_0xc5c906['fields'],function(_0x436e68){return{'id':_0x436e68[_0xb780('0x38')],'name':_0x436e68[_0xb780('0x82')],'custom':_0x436e68[_0xb780('0x80')],'options':_0x436e68['picklistValues']['length']>0x0?_[_0xb780('0x3a')](_0x436e68[_0xb780('0x83')],function(_0x38e343){return{'name':_0x38e343[_0xb780('0x82')],'value':_0x38e343[_0xb780('0x84')]};}):_0x436e68[_0xb780('0x3e')]==_0xb780('0x85')?[{'name':_0xb780('0x86'),'value':_0xb780('0x87')},{'name':_0xb780('0x88'),'value':_0xb780('0x89')}]:[]};})};}})[_0xb780('0x21')](respondWithResult(_0x400853,null))['catch'](function(_0x299f37){var _0x4e86c2=_0x2dfc44[_0xb780('0x41')][_0xb780('0x1c')]?0x1f4:_0x299f37['statusCode']||0x1f4;logger[_0xb780('0x26')](_0xb780('0x8a'),'getFields',_0x4e86c2,JSON[_0xb780('0x25')](_0x299f37));delete _0x299f37[_0xb780('0x38')];if(_0x4e86c2===0x191){_0x4e86c2=0x190;}_0x400853[_0xb780('0x2d')](_0x4e86c2)[_0xb780('0x8b')](_0x2dfc44[_0xb780('0x41')][_0xb780('0x1c')]?{'message':'Wrong\x20credentials','statusCode':_0x299f37[_0xb780('0x8c')]}:_0x299f37);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index e9b94e0..4dc7f90 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 _0xcf14=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x12c6ee,_0x2c3bae){var _0x19ce6c=function(_0x35d9c0){while(--_0x35d9c0){_0x12c6ee['push'](_0x12c6ee['shift']());}};_0x19ce6c(++_0x2c3bae);}(_0xcf14,0xb0));var _0x4cf1=function(_0x132e8c,_0x246835){_0x132e8c=_0x132e8c-0x0;var _0x17da91=_0xcf14[_0x132e8c];return _0x17da91;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4cf1('0x0'))(_0x4cf1('0x1'));var moment=require(_0x4cf1('0x2'));var BPromise=require(_0x4cf1('0x3'));var rp=require(_0x4cf1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4cf1('0x5'));var config=require(_0x4cf1('0x6'));var attributes=require(_0x4cf1('0x7'));var integrations=require(_0x4cf1('0x8'));module[_0x4cf1('0x9')]=function(_0x1d4c8a,_0x5b3868){return _0x1d4c8a[_0x4cf1('0xa')](_0x4cf1('0xb'),attributes,{'tableName':_0x4cf1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf553=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./intSalesforceAccount.attributes','exports','define'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xf553,0x18c));var _0x3f55=function(_0x3a99f4,_0x2a81c1){_0x3a99f4=_0x3a99f4-0x0;var _0xea0b42=_0xf553[_0x3a99f4];return _0xea0b42;};'use strict';var _=require(_0x3f55('0x0'));var util=require(_0x3f55('0x1'));var logger=require(_0x3f55('0x2'))(_0x3f55('0x3'));var moment=require(_0x3f55('0x4'));var BPromise=require('bluebird');var rp=require(_0x3f55('0x5'));var fs=require('fs');var path=require(_0x3f55('0x6'));var rimraf=require(_0x3f55('0x7'));var config=require('../../config/environment');var attributes=require(_0x3f55('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x3f55('0x9')]=function(_0x45416a,_0x11fe15){return _0x45416a[_0x3f55('0xa')]('SalesforceAccount',attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 94d6760..aaac574 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 _0x5636=['error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','catch','SalesforceAccount','findAll','options','raw','where','attributes','include','map','GetSalesforceAccount','stringify','ShowSalesforceAccount','find','model','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug'];(function(_0x17a754,_0x5f1052){var _0x545d3e=function(_0x24ec39){while(--_0x24ec39){_0x17a754['push'](_0x17a754['shift']());}};_0x545d3e(++_0x5f1052);}(_0x5636,0x102));var _0x6563=function(_0x539f59,_0x1acac3){_0x539f59=_0x539f59-0x0;var _0x588ec0=_0x5636[_0x539f59];return _0x588ec0;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});}exports['GetSalesforceAccount']=function(_0x47972a){var _0x14c6a6=this;return new Promise(function(_0x4f5609,_0x54e69c){return db[_0x6563('0x15')][_0x6563('0x16')]({'raw':_0x47972a[_0x6563('0x17')]?_0x47972a[_0x6563('0x17')][_0x6563('0x18')]===undefined?!![]:![]:!![],'where':_0x47972a[_0x6563('0x17')]?_0x47972a[_0x6563('0x17')][_0x6563('0x19')]||null:null,'attributes':_0x47972a[_0x6563('0x17')]?_0x47972a['options'][_0x6563('0x1a')]||null:null,'limit':_0x47972a[_0x6563('0x17')]?_0x47972a[_0x6563('0x17')]['limit']||null:null,'include':_0x47972a[_0x6563('0x17')]?_0x47972a['options'][_0x6563('0x1b')]?_[_0x6563('0x1c')](_0x47972a['options']['include'],function(_0x3ab7f6){return{'model':db[_0x3ab7f6['model']],'as':_0x3ab7f6['as'],'attributes':_0x3ab7f6[_0x6563('0x1a')],'include':_0x3ab7f6[_0x6563('0x1b')]?_[_0x6563('0x1c')](_0x3ab7f6['include'],function(_0xd860d5){return{'model':db[_0xd860d5['model']],'as':_0xd860d5['as'],'attributes':_0xd860d5[_0x6563('0x1a')],'include':_0xd860d5[_0x6563('0x1b')]?_['map'](_0xd860d5[_0x6563('0x1b')],function(_0x28252d){return{'model':db[_0x28252d['model']],'as':_0x28252d['as'],'attributes':_0x28252d[_0x6563('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fe1cb){logger['info']('GetSalesforceAccount',_0x47972a);logger[_0x6563('0xd')](_0x6563('0x1d'),_0x47972a,JSON[_0x6563('0x1e')](_0x1fe1cb));_0x4f5609(_0x1fe1cb);})[_0x6563('0x14')](function(_0x3eb23b){logger['error'](_0x6563('0x1d'),_0x3eb23b['message'],_0x47972a);_0x54e69c(_0x14c6a6['error'](0x1f4,_0x3eb23b[_0x6563('0x11')]));});});};exports[_0x6563('0x1f')]=function(_0x1e2ecb){var _0xdbbdda=this;return new Promise(function(_0x116605,_0x305861){return db[_0x6563('0x15')][_0x6563('0x20')]({'raw':_0x1e2ecb[_0x6563('0x17')]?_0x1e2ecb[_0x6563('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1e2ecb[_0x6563('0x17')]?_0x1e2ecb[_0x6563('0x17')][_0x6563('0x19')]||null:null,'attributes':_0x1e2ecb[_0x6563('0x17')]?_0x1e2ecb[_0x6563('0x17')][_0x6563('0x1a')]||null:null,'include':_0x1e2ecb[_0x6563('0x17')]?_0x1e2ecb['options'][_0x6563('0x1b')]?_[_0x6563('0x1c')](_0x1e2ecb[_0x6563('0x17')][_0x6563('0x1b')],function(_0x3f79da){return{'model':db[_0x3f79da[_0x6563('0x21')]],'as':_0x3f79da['as'],'attributes':_0x3f79da['attributes'],'include':_0x3f79da[_0x6563('0x1b')]?_[_0x6563('0x1c')](_0x3f79da[_0x6563('0x1b')],function(_0x33aa0b){return{'model':db[_0x33aa0b[_0x6563('0x21')]],'as':_0x33aa0b['as'],'attributes':_0x33aa0b[_0x6563('0x1a')],'include':_0x33aa0b[_0x6563('0x1b')]?_['map'](_0x33aa0b[_0x6563('0x1b')],function(_0x394120){return{'model':db[_0x394120['model']],'as':_0x394120['as'],'attributes':_0x394120[_0x6563('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6563('0xb')](function(_0x5b0c9f){logger['info'](_0x6563('0x1f'),_0x1e2ecb);logger[_0x6563('0xd')](_0x6563('0x1f'),_0x1e2ecb,JSON[_0x6563('0x1e')](_0x5b0c9f));_0x116605(_0x5b0c9f);})['catch'](function(_0x2d36d4){logger[_0x6563('0xe')]('ShowSalesforceAccount',_0x2d36d4[_0x6563('0x11')],_0x1e2ecb);_0x305861(_0xdbbdda[_0x6563('0xe')](0x1f4,_0x2d36d4[_0x6563('0x11')]));});});}; \ No newline at end of file +var _0xa75b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','SalesforceAccount','findAll','options','raw','where','limit','map','include','model','attributes','catch','GetSalesforceAccount','find','then','ShowSalesforceAccount','lodash','bluebird'];(function(_0x254203,_0x82f676){var _0x50bc31=function(_0x3a4712){while(--_0x3a4712){_0x254203['push'](_0x254203['shift']());}};_0x50bc31(++_0x82f676);}(_0xa75b,0x170));var _0xba75=function(_0x232b95,_0x14591a){_0x232b95=_0x232b95-0x0;var _0x389baa=_0xa75b[_0x232b95];return _0x389baa;};'use strict';var _=require(_0xba75('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xba75('0x1'));var rs=require(_0xba75('0x2'));var fs=require('fs');var Redis=require(_0xba75('0x3'));var db=require(_0xba75('0x4'))['db'];var utils=require(_0xba75('0x5'));var logger=require(_0xba75('0x6'))(_0xba75('0x7'));var config=require(_0xba75('0x8'));var jayson=require(_0xba75('0x9'));var client=jayson[_0xba75('0xa')][_0xba75('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x238a33,_0x3ccab5,_0x5c79e3){return new BPromise(function(_0x4b842d,_0x731cae){return client['request'](_0x238a33,_0x5c79e3)['then'](function(_0x218dbd){logger['info'](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));logger[_0xba75('0xe')](_0xba75('0xf'),_0x3ccab5,_0xba75('0xd'),JSON[_0xba75('0x10')](_0x218dbd));if(_0x218dbd[_0xba75('0x11')]){if(_0x218dbd[_0xba75('0x11')][_0xba75('0x12')]===0x1f4){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')]['message']);return _0x731cae(_0x218dbd['error'][_0xba75('0x13')]);}logger['error'](_0xba75('0xc'),_0x3ccab5,_0x218dbd[_0xba75('0x11')][_0xba75('0x13')]);return _0x4b842d(_0x218dbd[_0xba75('0x11')]['message']);}else{logger[_0xba75('0x14')](_0xba75('0xc'),_0x3ccab5,_0xba75('0xd'));_0x4b842d(_0x218dbd[_0xba75('0x15')][_0xba75('0x13')]);}})['catch'](function(_0x350a9d){logger[_0xba75('0x11')](_0xba75('0xc'),_0x3ccab5,_0x350a9d);_0x731cae(_0x350a9d);});});}exports['GetSalesforceAccount']=function(_0x2822af){var _0xd8850f=this;return new Promise(function(_0xc4bf17,_0x132750){return db[_0xba75('0x16')][_0xba75('0x17')]({'raw':_0x2822af['options']?_0x2822af[_0xba75('0x18')][_0xba75('0x19')]===undefined?!![]:![]:!![],'where':_0x2822af['options']?_0x2822af['options'][_0xba75('0x1a')]||null:null,'attributes':_0x2822af[_0xba75('0x18')]?_0x2822af['options']['attributes']||null:null,'limit':_0x2822af[_0xba75('0x18')]?_0x2822af['options'][_0xba75('0x1b')]||null:null,'include':_0x2822af[_0xba75('0x18')]?_0x2822af[_0xba75('0x18')]['include']?_[_0xba75('0x1c')](_0x2822af[_0xba75('0x18')][_0xba75('0x1d')],function(_0x3e9bd9){return{'model':db[_0x3e9bd9[_0xba75('0x1e')]],'as':_0x3e9bd9['as'],'attributes':_0x3e9bd9[_0xba75('0x1f')],'include':_0x3e9bd9['include']?_[_0xba75('0x1c')](_0x3e9bd9[_0xba75('0x1d')],function(_0xe579fb){return{'model':db[_0xe579fb[_0xba75('0x1e')]],'as':_0xe579fb['as'],'attributes':_0xe579fb[_0xba75('0x1f')],'include':_0xe579fb[_0xba75('0x1d')]?_[_0xba75('0x1c')](_0xe579fb[_0xba75('0x1d')],function(_0x35c571){return{'model':db[_0x35c571[_0xba75('0x1e')]],'as':_0x35c571['as'],'attributes':_0x35c571['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e1987){logger[_0xba75('0x14')]('GetSalesforceAccount',_0x2822af);logger[_0xba75('0xe')]('GetSalesforceAccount',_0x2822af,JSON[_0xba75('0x10')](_0x4e1987));_0xc4bf17(_0x4e1987);})[_0xba75('0x20')](function(_0x20ac78){logger['error'](_0xba75('0x21'),_0x20ac78[_0xba75('0x13')],_0x2822af);_0x132750(_0xd8850f[_0xba75('0x11')](0x1f4,_0x20ac78[_0xba75('0x13')]));});});};exports['ShowSalesforceAccount']=function(_0x4791a5){var _0x200715=this;return new Promise(function(_0x481a04,_0x5a85ee){return db[_0xba75('0x16')][_0xba75('0x22')]({'raw':_0x4791a5[_0xba75('0x18')]?_0x4791a5['options'][_0xba75('0x19')]===undefined?!![]:![]:!![],'where':_0x4791a5[_0xba75('0x18')]?_0x4791a5['options'][_0xba75('0x1a')]||null:null,'attributes':_0x4791a5[_0xba75('0x18')]?_0x4791a5[_0xba75('0x18')][_0xba75('0x1f')]||null:null,'include':_0x4791a5['options']?_0x4791a5[_0xba75('0x18')][_0xba75('0x1d')]?_['map'](_0x4791a5[_0xba75('0x18')][_0xba75('0x1d')],function(_0x5a88a3){return{'model':db[_0x5a88a3['model']],'as':_0x5a88a3['as'],'attributes':_0x5a88a3[_0xba75('0x1f')],'include':_0x5a88a3[_0xba75('0x1d')]?_[_0xba75('0x1c')](_0x5a88a3[_0xba75('0x1d')],function(_0x5e3c8c){return{'model':db[_0x5e3c8c[_0xba75('0x1e')]],'as':_0x5e3c8c['as'],'attributes':_0x5e3c8c[_0xba75('0x1f')],'include':_0x5e3c8c['include']?_['map'](_0x5e3c8c[_0xba75('0x1d')],function(_0x39ab01){return{'model':db[_0x39ab01[_0xba75('0x1e')]],'as':_0x39ab01['as'],'attributes':_0x39ab01['attributes']};}):[]};}):[]};}):[]:[]})[_0xba75('0x23')](function(_0x2c1e9e){logger['info']('ShowSalesforceAccount',_0x4791a5);logger[_0xba75('0xe')](_0xba75('0x24'),_0x4791a5,JSON[_0xba75('0x10')](_0x2c1e9e));_0x481a04(_0x2c1e9e);})[_0xba75('0x20')](function(_0x92882d){logger['error']('ShowSalesforceAccount',_0x92882d[_0xba75('0x13')],_0x4791a5);_0x5a85ee(_0x200715[_0xba75('0x11')](0x1f4,_0x92882d[_0xba75('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index d3ed279..c7ffe5d 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 _0xc76f=['getDescriptions','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x5ca353,_0x21eb37){var _0x4f2fe5=function(_0x14cd1b){while(--_0x14cd1b){_0x5ca353['push'](_0x5ca353['shift']());}};_0x4f2fe5(++_0x21eb37);}(_0xc76f,0xaf));var _0xfc76=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc76f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xfc76('0x0'));var util=require(_0xfc76('0x1'));var path=require(_0xfc76('0x2'));var timeout=require(_0xfc76('0x3'));var express=require('express');var router=express[_0xfc76('0x4')]();var auth=require(_0xfc76('0x5'));var interaction=require(_0xfc76('0x6'));var config=require(_0xfc76('0x7'));var controller=require('./intSalesforceConfiguration.controller');router[_0xfc76('0x8')]('/',auth[_0xfc76('0x9')](),controller[_0xfc76('0xa')]);router[_0xfc76('0x8')](_0xfc76('0xb'),auth[_0xfc76('0x9')](),controller[_0xfc76('0xc')]);router['get']('/:id/fields',auth[_0xfc76('0x9')](),controller[_0xfc76('0xd')]);router[_0xfc76('0x8')](_0xfc76('0xe'),auth['isAuthenticated'](),controller[_0xfc76('0xf')]);router[_0xfc76('0x8')](_0xfc76('0x10'),auth[_0xfc76('0x9')](),controller[_0xfc76('0x11')]);router[_0xfc76('0x12')]('/',auth[_0xfc76('0x9')](),controller[_0xfc76('0x13')]);router[_0xfc76('0x14')](_0xfc76('0xb'),auth[_0xfc76('0x9')](),controller[_0xfc76('0x15')]);router[_0xfc76('0x16')](_0xfc76('0xb'),auth['isAuthenticated'](),controller[_0xfc76('0x17')]);module['exports']=router; \ No newline at end of file +var _0x221b=['multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','isAuthenticated','get','/:id','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete'];(function(_0x3658d1,_0x5b3437){var _0x3db9de=function(_0x23bb15){while(--_0x23bb15){_0x3658d1['push'](_0x3658d1['shift']());}};_0x3db9de(++_0x5b3437);}(_0x221b,0xa8));var _0xb221=function(_0x2dc59b,_0x370615){_0x2dc59b=_0x2dc59b-0x0;var _0x547f99=_0x221b[_0x2dc59b];return _0x547f99;};'use strict';var multer=require(_0xb221('0x0'));var util=require(_0xb221('0x1'));var path=require('path');var timeout=require(_0xb221('0x2'));var express=require(_0xb221('0x3'));var router=express[_0xb221('0x4')]();var auth=require(_0xb221('0x5'));var interaction=require(_0xb221('0x6'));var config=require(_0xb221('0x7'));var controller=require(_0xb221('0x8'));router['get']('/',auth[_0xb221('0x9')](),controller['index']);router[_0xb221('0xa')](_0xb221('0xb'),auth[_0xb221('0x9')](),controller['show']);router[_0xb221('0xa')](_0xb221('0xc'),auth[_0xb221('0x9')](),controller['getFields']);router[_0xb221('0xa')]('/:id/subjects',auth[_0xb221('0x9')](),controller[_0xb221('0xd')]);router[_0xb221('0xa')](_0xb221('0xe'),auth['isAuthenticated'](),controller[_0xb221('0xf')]);router[_0xb221('0x10')]('/',auth['isAuthenticated'](),controller[_0xb221('0x11')]);router[_0xb221('0x12')]('/:id',auth[_0xb221('0x9')](),controller[_0xb221('0x13')]);router[_0xb221('0x14')](_0xb221('0xb'),auth[_0xb221('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 61ad7d4..5900378 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 _0x7a14=['lead','nothing','sequelize','exports','STRING','Task','Case','ENUM','contact_lead'];(function(_0x1f8092,_0x29af08){var _0x28000f=function(_0x271ce2){while(--_0x271ce2){_0x1f8092['push'](_0x1f8092['shift']());}};_0x28000f(++_0x29af08);}(_0x7a14,0x134));var _0x47a1=function(_0x1c982b,_0x3548f0){_0x1c982b=_0x1c982b-0x0;var _0xcfc1af=_0x7a14[_0x1c982b];return _0xcfc1af;};'use strict';var Sequelize=require(_0x47a1('0x0'));module[_0x47a1('0x1')]={'name':{'type':Sequelize[_0x47a1('0x2')]},'description':{'type':Sequelize[_0x47a1('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x47a1('0x3'),_0x47a1('0x4')),'defaultValue':_0x47a1('0x3')},'moduleSearch':{'type':Sequelize[_0x47a1('0x5')](_0x47a1('0x6'),'contact',_0x47a1('0x7')),'defaultValue':_0x47a1('0x6')},'moduleCreate':{'type':Sequelize[_0x47a1('0x5')](_0x47a1('0x8'),'contact',_0x47a1('0x7')),'defaultValue':'lead'}}; \ No newline at end of file +var _0xed40=['lead','contact_lead','sequelize','exports','STRING','ENUM','Case','Task','contact'];(function(_0x4aa3cb,_0x3808c4){var _0x49a3a5=function(_0x47e493){while(--_0x47e493){_0x4aa3cb['push'](_0x4aa3cb['shift']());}};_0x49a3a5(++_0x3808c4);}(_0xed40,0x146));var _0x0ed4=function(_0x18caa1,_0x313ce8){_0x18caa1=_0x18caa1-0x0;var _0x268459=_0xed40[_0x18caa1];return _0x268459;};'use strict';var Sequelize=require(_0x0ed4('0x0'));module[_0x0ed4('0x1')]={'name':{'type':Sequelize[_0x0ed4('0x2')]},'description':{'type':Sequelize[_0x0ed4('0x2')]},'ticketType':{'type':Sequelize[_0x0ed4('0x3')]('Task',_0x0ed4('0x4')),'defaultValue':_0x0ed4('0x5')},'moduleSearch':{'type':Sequelize[_0x0ed4('0x3')]('contact_lead',_0x0ed4('0x6'),_0x0ed4('0x7')),'defaultValue':_0x0ed4('0x8')},'moduleCreate':{'type':Sequelize['ENUM']('nothing',_0x0ed4('0x6'),'lead'),'defaultValue':_0x0ed4('0x7')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index df1df11..0f7c18b 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 _0x40c2=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','client','test','Sequelize','ValidationError','request','then','info','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','end','sendStatus','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','body','getFields','findOne','params','hasOwnProperty','SalesforceField','getSubjects','getDescriptions','eml-format'];(function(_0x1298d4,_0x2d7428){var _0x15234e=function(_0x48f2e3){while(--_0x48f2e3){_0x1298d4['push'](_0x1298d4['shift']());}};_0x15234e(++_0x2d7428);}(_0x40c2,0x10d));var _0x240c=function(_0x4916ca,_0x3d19c2){_0x4916ca=_0x4916ca-0x0;var _0x598fe8=_0x40c2[_0x4916ca];return _0x598fe8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x240c('0x0'));var rimraf=require(_0x240c('0x1'));var zipdir=require(_0x240c('0x2'));var jsonpatch=require(_0x240c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x240c('0x4'));var Mustache=require(_0x240c('0x5'));var util=require(_0x240c('0x6'));var path=require(_0x240c('0x7'));var sox=require(_0x240c('0x8'));var csv=require(_0x240c('0x9'));var ejs=require(_0x240c('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x240c('0xb'));var crypto=require(_0x240c('0xc'));var jsforce=require(_0x240c('0xd'));var deskjs=require(_0x240c('0xe'));var toCsv=require(_0x240c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x240c('0xf'));var authService=require(_0x240c('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x240c('0x11'))(_0x240c('0x12'));var utils=require(_0x240c('0x13'));var config=require(_0x240c('0x14'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x240c('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x5d3058,_0x3cb503,_0x619439){if(_0x619439){var _0x18999c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18999c[_0x240c('0x16')](_0x3cb503)){return _0x5d3058;}else{throw new db[(_0x240c('0x17'))][(_0x240c('0x18'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5d3058;}}function respondWithRpcPromise(_0x1dab7f,_0x28083d,_0x128c26,_0x321076){return new BPromise(function(_0x376f4b,_0x11676f){var _0x5c41bc=_0x321076||client;return _0x5c41bc[_0x240c('0x19')](_0x1dab7f,_0x128c26)[_0x240c('0x1a')](function(_0xf21b01){logger[_0x240c('0x1b')]('SalesforceConfiguration,\x20%s,\x20%s',_0x28083d,_0x240c('0x1c'));logger['debug'](_0x240c('0x1d'),_0x28083d,_0x240c('0x1c'),JSON[_0x240c('0x1e')](_0xf21b01));if(_0xf21b01[_0x240c('0x1f')]){if(_0xf21b01[_0x240c('0x1f')][_0x240c('0x20')]===0x1f4){logger[_0x240c('0x1f')]('SalesforceConfiguration,\x20%s,\x20%s',_0x28083d,_0xf21b01[_0x240c('0x1f')]['message']);return _0x11676f(_0xf21b01['error'][_0x240c('0x21')]);}logger[_0x240c('0x1f')](_0x240c('0x22'),_0x28083d,_0xf21b01['error']['message']);return _0x376f4b(_0xf21b01['error'][_0x240c('0x21')]);}else{logger[_0x240c('0x1b')](_0x240c('0x22'),_0x28083d,_0x240c('0x1c'));_0x376f4b(_0xf21b01[_0x240c('0x23')][_0x240c('0x21')]);}})[_0x240c('0x24')](function(_0x31fc07){logger[_0x240c('0x1f')](_0x240c('0x22'),_0x28083d,_0x31fc07);_0x11676f(_0x31fc07);});});}function respondWithStatusCode(_0x111905,_0x36af6d){_0x36af6d=_0x36af6d||0xcc;return function(_0x257a4c){if(_0x257a4c){return _0x111905['sendStatus'](_0x36af6d);}return _0x111905[_0x240c('0x25')](_0x36af6d)['end']();};}function respondWithResult(_0x1313bf,_0x2b22c2){_0x2b22c2=_0x2b22c2||0xc8;return function(_0x2370c8){if(_0x2370c8){return _0x1313bf[_0x240c('0x25')](_0x2b22c2)[_0x240c('0x26')](_0x2370c8);}};}function respondWithFilteredResult(_0x34f5a3,_0x5b7c15){return function(_0x3dc6cc){if(_0x3dc6cc){var _0x4c5df8=_0x3dc6cc[_0x240c('0x27')],_0x236d61=_0x5b7c15[_0x240c('0x28')],_0x127788=_0x5b7c15[_0x240c('0x28')]+_0x5b7c15[_0x240c('0x29')],_0x242037;if(_0x127788>=_0x4c5df8){_0x127788=_0x4c5df8;_0x242037=0xc8;}else{_0x242037=0xce;}_0x34f5a3['status'](_0x242037);return _0x34f5a3[_0x240c('0x2a')](_0x240c('0x2b'),_0x236d61+'-'+_0x127788+'/'+_0x4c5df8)['json'](_0x3dc6cc);}return null;};}function patchUpdates(_0x17a562){return function(_0x25f181){try{jsonpatch[_0x240c('0x2c')](_0x25f181,_0x17a562,!![]);}catch(_0x115288){return BPromise[_0x240c('0x2d')](_0x115288);}return _0x25f181['save']();};}function saveUpdates(_0x2b158c,_0x27755a){return function(_0x53f439){if(_0x53f439){return _0x53f439[_0x240c('0x2e')](_0x2b158c)[_0x240c('0x1a')](function(_0x2698ff){return _0x2698ff;});}return null;};}function removeEntity(_0x5549f3,_0x401349){return function(_0x15d2a1){if(_0x15d2a1){return _0x15d2a1[_0x240c('0x2f')]()[_0x240c('0x1a')](function(){_0x5549f3[_0x240c('0x25')](0xcc)[_0x240c('0x30')]();});}};}function handleEntityNotFound(_0x54ba1d,_0x42c95e){return function(_0x11fe17){if(!_0x11fe17){_0x54ba1d[_0x240c('0x31')](0x194);}return _0x11fe17;};}function handleError(_0x4c1849,_0x4d2ff1){_0x4d2ff1=_0x4d2ff1||0x1f4;return function(_0x23dde8){logger[_0x240c('0x1f')](_0x23dde8[_0x240c('0x32')]);if(_0x23dde8[_0x240c('0x33')]){delete _0x23dde8[_0x240c('0x33')];}_0x4c1849[_0x240c('0x25')](_0x4d2ff1)[_0x240c('0x34')](_0x23dde8);};}exports[_0x240c('0x35')]=function(_0x42983e,_0x5f1645){var _0x19714f={},_0x4ac22e={},_0xdaa7e4={'count':0x0,'rows':[]};var _0x43a910=_[_0x240c('0x36')](db[_0x240c('0x37')][_0x240c('0x38')],function(_0x41bf4b){return{'name':_0x41bf4b[_0x240c('0x39')],'type':_0x41bf4b['type'][_0x240c('0x3a')]};});_0x4ac22e[_0x240c('0x3b')]=_[_0x240c('0x36')](_0x43a910,_0x240c('0x33'));_0x4ac22e[_0x240c('0x3c')]=_[_0x240c('0x3d')](_0x42983e['query']);_0x4ac22e['filters']=_[_0x240c('0x3e')](_0x4ac22e['model'],_0x4ac22e[_0x240c('0x3c')]);_0x19714f['attributes']=_[_0x240c('0x3e')](_0x4ac22e[_0x240c('0x3b')],qs['fields'](_0x42983e[_0x240c('0x3c')][_0x240c('0x3f')]));_0x19714f['attributes']=_0x19714f[_0x240c('0x40')][_0x240c('0x41')]?_0x19714f['attributes']:_0x4ac22e[_0x240c('0x3b')];if(!_0x42983e[_0x240c('0x3c')]['hasOwnProperty'](_0x240c('0x42'))){_0x19714f[_0x240c('0x29')]=qs['limit'](_0x42983e[_0x240c('0x3c')][_0x240c('0x29')]);_0x19714f['offset']=qs[_0x240c('0x28')](_0x42983e[_0x240c('0x3c')][_0x240c('0x28')]);}_0x19714f[_0x240c('0x43')]=qs[_0x240c('0x44')](_0x42983e[_0x240c('0x3c')]['sort']);_0x19714f['where']=qs[_0x240c('0x45')](_[_0x240c('0x46')](_0x42983e[_0x240c('0x3c')],_0x4ac22e[_0x240c('0x45')]),_0x43a910);if(_0x42983e[_0x240c('0x3c')][_0x240c('0x47')]){_0x19714f[_0x240c('0x48')]=_[_0x240c('0x49')](_0x19714f[_0x240c('0x48')],{'$or':_[_0x240c('0x36')](_0x43a910,function(_0x1b9aca){if(_0x1b9aca['type']!==_0x240c('0x4a')){var _0x11ec80={};_0x11ec80[_0x1b9aca[_0x240c('0x33')]]={'$like':'%'+_0x42983e[_0x240c('0x3c')][_0x240c('0x47')]+'%'};return _0x11ec80;}})});}_0x19714f=_[_0x240c('0x49')]({},_0x19714f,_0x42983e[_0x240c('0x4b')]);var _0x37d911={'where':_0x19714f[_0x240c('0x48')]};return db[_0x240c('0x37')][_0x240c('0x27')](_0x37d911)['then'](function(_0x45432a){_0xdaa7e4['count']=_0x45432a;if(_0x42983e[_0x240c('0x3c')][_0x240c('0x4c')]){_0x19714f[_0x240c('0x4d')]=[{'all':!![]}];}return db[_0x240c('0x37')][_0x240c('0x4e')](_0x19714f);})[_0x240c('0x1a')](function(_0x335f9c){_0xdaa7e4[_0x240c('0x4f')]=_0x335f9c;return _0xdaa7e4;})['then'](respondWithFilteredResult(_0x5f1645,_0x19714f))['catch'](handleError(_0x5f1645,null));};exports[_0x240c('0x50')]=function(_0x561c5b,_0x837769){var _0x378318={'raw':![],'where':{'id':_0x561c5b['params']['id']}},_0x43b4c2={};_0x43b4c2['model']=_[_0x240c('0x3d')](db['SalesforceConfiguration']['rawAttributes']);_0x43b4c2[_0x240c('0x3c')]=_[_0x240c('0x3d')](_0x561c5b[_0x240c('0x3c')]);_0x43b4c2['filters']=_[_0x240c('0x3e')](_0x43b4c2[_0x240c('0x3b')],_0x43b4c2[_0x240c('0x3c')]);_0x378318[_0x240c('0x40')]=_[_0x240c('0x3e')](_0x43b4c2['model'],qs[_0x240c('0x3f')](_0x561c5b[_0x240c('0x3c')]['fields']));_0x378318[_0x240c('0x40')]=_0x378318[_0x240c('0x40')][_0x240c('0x41')]?_0x378318[_0x240c('0x40')]:_0x43b4c2[_0x240c('0x3b')];if(_0x561c5b[_0x240c('0x3c')][_0x240c('0x4c')]){_0x378318[_0x240c('0x4d')]=[{'all':!![]}];}_0x378318=_['merge']({},_0x378318,_0x561c5b[_0x240c('0x4b')]);return db[_0x240c('0x37')][_0x240c('0x51')](_0x378318)[_0x240c('0x1a')](handleEntityNotFound(_0x837769,null))[_0x240c('0x1a')](respondWithResult(_0x837769,null))[_0x240c('0x24')](handleError(_0x837769,null));};exports['create']=function(_0x48db05,_0x1df2ec){return db[_0x240c('0x37')]['create'](_0x48db05[_0x240c('0x52')],{})['then'](respondWithResult(_0x1df2ec,0xc9))['catch'](handleError(_0x1df2ec,null));};exports['update']=function(_0x4d9854,_0x26f865){if(_0x4d9854['body']['id']){delete _0x4d9854[_0x240c('0x52')]['id'];}return db[_0x240c('0x37')][_0x240c('0x51')]({'where':{'id':_0x4d9854['params']['id']}})['then'](handleEntityNotFound(_0x26f865,null))[_0x240c('0x1a')](saveUpdates(_0x4d9854[_0x240c('0x52')],null))['then'](respondWithResult(_0x26f865,null))[_0x240c('0x24')](handleError(_0x26f865,null));};exports['destroy']=function(_0xaf1028,_0x324a87){return db['SalesforceConfiguration'][_0x240c('0x51')]({'where':{'id':_0xaf1028['params']['id']}})[_0x240c('0x1a')](handleEntityNotFound(_0x324a87,null))['then'](removeEntity(_0x324a87,null))[_0x240c('0x24')](handleError(_0x324a87,null));};exports[_0x240c('0x53')]=function(_0x22b12c,_0x413bf2,_0x263f74){var _0x57b836={};var _0x580847={};var _0x4d9791;var _0x31ea61;return db[_0x240c('0x37')][_0x240c('0x54')]({'where':{'id':_0x22b12c[_0x240c('0x55')]['id']}})['then'](handleEntityNotFound(_0x413bf2,null))['then'](function(_0x2ef007){if(_0x2ef007){_0x4d9791=_0x2ef007;_0x580847[_0x240c('0x3b')]=_[_0x240c('0x3d')](db['SalesforceField'][_0x240c('0x38')]);_0x580847[_0x240c('0x3c')]=_[_0x240c('0x3d')](_0x22b12c[_0x240c('0x3c')]);_0x580847[_0x240c('0x45')]=_[_0x240c('0x3e')](_0x580847[_0x240c('0x3b')],_0x580847[_0x240c('0x3c')]);_0x57b836[_0x240c('0x40')]=_[_0x240c('0x3e')](_0x580847[_0x240c('0x3b')],qs[_0x240c('0x3f')](_0x22b12c[_0x240c('0x3c')][_0x240c('0x3f')]));_0x57b836[_0x240c('0x40')]=_0x57b836[_0x240c('0x40')][_0x240c('0x41')]?_0x57b836[_0x240c('0x40')]:_0x580847[_0x240c('0x3b')];_0x57b836[_0x240c('0x43')]=qs['sort'](_0x22b12c['query'][_0x240c('0x44')]);_0x57b836[_0x240c('0x48')]=qs['filters'](_[_0x240c('0x46')](_0x22b12c[_0x240c('0x3c')],_0x580847[_0x240c('0x45')]));if(_0x22b12c[_0x240c('0x3c')]['filter']){_0x57b836[_0x240c('0x48')]=_[_0x240c('0x49')](_0x57b836['where'],{'$or':_[_0x240c('0x36')](_0x57b836['attributes'],function(_0x14db9c){var _0x877760={};_0x877760[_0x14db9c]={'$like':'%'+_0x22b12c[_0x240c('0x3c')][_0x240c('0x47')]+'%'};return _0x877760;})});}_0x57b836=_[_0x240c('0x49')]({},_0x57b836,_0x22b12c[_0x240c('0x4b')]);return _0x4d9791[_0x240c('0x53')](_0x57b836);}})[_0x240c('0x1a')](function(_0x29cefd){if(_0x29cefd){_0x31ea61=_0x29cefd[_0x240c('0x41')];if(!_0x22b12c[_0x240c('0x3c')][_0x240c('0x56')](_0x240c('0x42'))){_0x57b836[_0x240c('0x29')]=qs['limit'](_0x22b12c[_0x240c('0x3c')]['limit']);_0x57b836[_0x240c('0x28')]=qs[_0x240c('0x28')](_0x22b12c['query'][_0x240c('0x28')]);}return _0x4d9791['getFields'](_0x57b836);}})[_0x240c('0x1a')](function(_0x3e688d){if(_0x3e688d){return _0x3e688d?{'count':_0x31ea61,'rows':_0x3e688d}:null;}})[_0x240c('0x1a')](respondWithResult(_0x413bf2,null))['catch'](handleError(_0x413bf2,null));};exports['getSubjects']=function(_0x15cb39,_0x1b95e1,_0x1cc2ad){var _0x1a2b20={};var _0x5c6f93={};var _0x33ce48;var _0x44ecb8;return db[_0x240c('0x37')][_0x240c('0x54')]({'where':{'id':_0x15cb39[_0x240c('0x55')]['id']}})[_0x240c('0x1a')](handleEntityNotFound(_0x1b95e1,null))[_0x240c('0x1a')](function(_0x36c008){if(_0x36c008){_0x33ce48=_0x36c008;_0x5c6f93[_0x240c('0x3b')]=_['keys'](db[_0x240c('0x57')][_0x240c('0x38')]);_0x5c6f93[_0x240c('0x3c')]=_[_0x240c('0x3d')](_0x15cb39['query']);_0x5c6f93[_0x240c('0x45')]=_[_0x240c('0x3e')](_0x5c6f93['model'],_0x5c6f93['query']);_0x1a2b20[_0x240c('0x40')]=_['intersection'](_0x5c6f93['model'],qs[_0x240c('0x3f')](_0x15cb39[_0x240c('0x3c')][_0x240c('0x3f')]));_0x1a2b20['attributes']=_0x1a2b20[_0x240c('0x40')]['length']?_0x1a2b20[_0x240c('0x40')]:_0x5c6f93[_0x240c('0x3b')];_0x1a2b20['order']=qs[_0x240c('0x44')](_0x15cb39[_0x240c('0x3c')][_0x240c('0x44')]);_0x1a2b20['where']=qs[_0x240c('0x45')](_['pick'](_0x15cb39[_0x240c('0x3c')],_0x5c6f93[_0x240c('0x45')]));if(_0x15cb39[_0x240c('0x3c')][_0x240c('0x47')]){_0x1a2b20[_0x240c('0x48')]=_[_0x240c('0x49')](_0x1a2b20['where'],{'$or':_[_0x240c('0x36')](_0x1a2b20[_0x240c('0x40')],function(_0x5d3947){var _0x368c82={};_0x368c82[_0x5d3947]={'$like':'%'+_0x15cb39['query'][_0x240c('0x47')]+'%'};return _0x368c82;})});}_0x1a2b20=_[_0x240c('0x49')]({},_0x1a2b20,_0x15cb39[_0x240c('0x4b')]);return _0x33ce48['getSubjects'](_0x1a2b20);}})[_0x240c('0x1a')](function(_0x5c79ba){if(_0x5c79ba){_0x44ecb8=_0x5c79ba[_0x240c('0x41')];if(!_0x15cb39[_0x240c('0x3c')][_0x240c('0x56')]('nolimit')){_0x1a2b20['limit']=qs['limit'](_0x15cb39['query'][_0x240c('0x29')]);_0x1a2b20[_0x240c('0x28')]=qs['offset'](_0x15cb39[_0x240c('0x3c')][_0x240c('0x28')]);}return _0x33ce48[_0x240c('0x58')](_0x1a2b20);}})['then'](function(_0x3bd3ad){if(_0x3bd3ad){return _0x3bd3ad?{'count':_0x44ecb8,'rows':_0x3bd3ad}:null;}})[_0x240c('0x1a')](respondWithResult(_0x1b95e1,null))[_0x240c('0x24')](handleError(_0x1b95e1,null));};exports[_0x240c('0x59')]=function(_0x2cb85c,_0x23c373,_0x154f4a){var _0x3fd7fe={};var _0x3caa03={};var _0x7cbaf5;var _0x38b374;return db[_0x240c('0x37')][_0x240c('0x54')]({'where':{'id':_0x2cb85c['params']['id']}})[_0x240c('0x1a')](handleEntityNotFound(_0x23c373,null))[_0x240c('0x1a')](function(_0xf14f1d){if(_0xf14f1d){_0x7cbaf5=_0xf14f1d;_0x3caa03['model']=_['keys'](db['SalesforceField']['rawAttributes']);_0x3caa03[_0x240c('0x3c')]=_[_0x240c('0x3d')](_0x2cb85c['query']);_0x3caa03[_0x240c('0x45')]=_[_0x240c('0x3e')](_0x3caa03[_0x240c('0x3b')],_0x3caa03[_0x240c('0x3c')]);_0x3fd7fe[_0x240c('0x40')]=_[_0x240c('0x3e')](_0x3caa03['model'],qs['fields'](_0x2cb85c['query']['fields']));_0x3fd7fe[_0x240c('0x40')]=_0x3fd7fe[_0x240c('0x40')]['length']?_0x3fd7fe[_0x240c('0x40')]:_0x3caa03[_0x240c('0x3b')];_0x3fd7fe[_0x240c('0x43')]=qs[_0x240c('0x44')](_0x2cb85c[_0x240c('0x3c')][_0x240c('0x44')]);_0x3fd7fe[_0x240c('0x48')]=qs[_0x240c('0x45')](_[_0x240c('0x46')](_0x2cb85c[_0x240c('0x3c')],_0x3caa03[_0x240c('0x45')]));if(_0x2cb85c[_0x240c('0x3c')][_0x240c('0x47')]){_0x3fd7fe[_0x240c('0x48')]=_['merge'](_0x3fd7fe['where'],{'$or':_[_0x240c('0x36')](_0x3fd7fe[_0x240c('0x40')],function(_0x504f0c){var _0x66cdf6={};_0x66cdf6[_0x504f0c]={'$like':'%'+_0x2cb85c[_0x240c('0x3c')][_0x240c('0x47')]+'%'};return _0x66cdf6;})});}_0x3fd7fe=_[_0x240c('0x49')]({},_0x3fd7fe,_0x2cb85c[_0x240c('0x4b')]);return _0x7cbaf5[_0x240c('0x59')](_0x3fd7fe);}})[_0x240c('0x1a')](function(_0x356381){if(_0x356381){_0x38b374=_0x356381[_0x240c('0x41')];if(!_0x2cb85c[_0x240c('0x3c')][_0x240c('0x56')](_0x240c('0x42'))){_0x3fd7fe[_0x240c('0x29')]=qs[_0x240c('0x29')](_0x2cb85c['query'][_0x240c('0x29')]);_0x3fd7fe[_0x240c('0x28')]=qs[_0x240c('0x28')](_0x2cb85c[_0x240c('0x3c')]['offset']);}return _0x7cbaf5[_0x240c('0x59')](_0x3fd7fe);}})[_0x240c('0x1a')](function(_0x537c66){if(_0x537c66){return _0x537c66?{'count':_0x38b374,'rows':_0x537c66}:null;}})[_0x240c('0x1a')](respondWithResult(_0x23c373,null))[_0x240c('0x24')](handleError(_0x23c373,null));}; \ No newline at end of file +var _0x423b=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceConfiguration','count','findAll','rows','params','includeAll','include','find','create','body','getFields','findOne','order','getSubjects','SalesforceField','getDescriptions','hasOwnProperty','eml-format','zip-dir','request-promise','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','client','http','test','request','info','debug','request\x20sent','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','json','limit','status','set','reject','save','update','destroy','then','end','name','send','index','map'];(function(_0x429c89,_0x28d462){var _0x4ca942=function(_0x3ef399){while(--_0x3ef399){_0x429c89['push'](_0x429c89['shift']());}};_0x4ca942(++_0x28d462);}(_0x423b,0x12b));var _0xb423=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x423b[_0x2b9b7f];return _0x4ed19a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb423('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb423('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb423('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb423('0x3'));var path=require(_0xb423('0x4'));var sox=require('sox');var csv=require(_0xb423('0x5'));var ejs=require(_0xb423('0x6'));var fs=require('fs');var _=require(_0xb423('0x7'));var squel=require(_0xb423('0x8'));var crypto=require('crypto');var jsforce=require(_0xb423('0x9'));var deskjs=require(_0xb423('0xa'));var toCsv=require(_0xb423('0x5'));var querystring=require(_0xb423('0xb'));var Papa=require(_0xb423('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb423('0xd'));var as=require(_0xb423('0xe'));var hardwareService=require(_0xb423('0xf'));var logger=require(_0xb423('0x10'))(_0xb423('0x11'));var utils=require('../../config/utils');var config=require(_0xb423('0x12'));var db=require(_0xb423('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb423('0x14')][_0xb423('0x15')]({'port':0x232a});function checkPasswordPattern(_0x40855a,_0x4dea61,_0x224594){if(_0x224594){var _0x542090=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x542090[_0xb423('0x16')](_0x4dea61)){return _0x40855a;}else{throw new db['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~!@#$%^&-_=+[{]}.');}}else{return _0x40855a;}}function respondWithRpcPromise(_0x334b17,_0x4351e2,_0x222e41,_0x5abab2){return new BPromise(function(_0x1b1586,_0x204342){var _0x3310db=_0x5abab2||client;return _0x3310db[_0xb423('0x17')](_0x334b17,_0x222e41)['then'](function(_0x42b6fe){logger[_0xb423('0x18')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4351e2,'request\x20sent');logger[_0xb423('0x19')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4351e2,_0xb423('0x1a'),JSON[_0xb423('0x1b')](_0x42b6fe));if(_0x42b6fe[_0xb423('0x1c')]){if(_0x42b6fe[_0xb423('0x1c')][_0xb423('0x1d')]===0x1f4){logger[_0xb423('0x1c')](_0xb423('0x1e'),_0x4351e2,_0x42b6fe[_0xb423('0x1c')]['message']);return _0x204342(_0x42b6fe[_0xb423('0x1c')][_0xb423('0x1f')]);}logger[_0xb423('0x1c')]('SalesforceConfiguration,\x20%s,\x20%s',_0x4351e2,_0x42b6fe[_0xb423('0x1c')][_0xb423('0x1f')]);return _0x1b1586(_0x42b6fe['error'][_0xb423('0x1f')]);}else{logger[_0xb423('0x18')](_0xb423('0x1e'),_0x4351e2,'request\x20sent');_0x1b1586(_0x42b6fe[_0xb423('0x20')]['message']);}})[_0xb423('0x21')](function(_0x50d484){logger[_0xb423('0x1c')](_0xb423('0x1e'),_0x4351e2,_0x50d484);_0x204342(_0x50d484);});});}function respondWithStatusCode(_0x56ed56,_0x2cdf54){_0x2cdf54=_0x2cdf54||0xcc;return function(_0x1d3e39){if(_0x1d3e39){return _0x56ed56[_0xb423('0x22')](_0x2cdf54);}return _0x56ed56['status'](_0x2cdf54)['end']();};}function respondWithResult(_0x108f74,_0x481c7a){_0x481c7a=_0x481c7a||0xc8;return function(_0xd2e08b){if(_0xd2e08b){return _0x108f74['status'](_0x481c7a)[_0xb423('0x23')](_0xd2e08b);}};}function respondWithFilteredResult(_0x2e2b80,_0x3e7336){return function(_0x314f68){if(_0x314f68){var _0x18e26a=_0x314f68['count'],_0x4a1adc=_0x3e7336['offset'],_0x1de3ee=_0x3e7336['offset']+_0x3e7336[_0xb423('0x24')],_0x48a0ce;if(_0x1de3ee>=_0x18e26a){_0x1de3ee=_0x18e26a;_0x48a0ce=0xc8;}else{_0x48a0ce=0xce;}_0x2e2b80[_0xb423('0x25')](_0x48a0ce);return _0x2e2b80[_0xb423('0x26')]('Content-Range',_0x4a1adc+'-'+_0x1de3ee+'/'+_0x18e26a)['json'](_0x314f68);}return null;};}function patchUpdates(_0x1624bb){return function(_0x1de3dc){try{jsonpatch['apply'](_0x1de3dc,_0x1624bb,!![]);}catch(_0x3a4acc){return BPromise[_0xb423('0x27')](_0x3a4acc);}return _0x1de3dc[_0xb423('0x28')]();};}function saveUpdates(_0x6ec2ed,_0x46bb8f){return function(_0x5ab252){if(_0x5ab252){return _0x5ab252[_0xb423('0x29')](_0x6ec2ed)['then'](function(_0xfaf75d){return _0xfaf75d;});}return null;};}function removeEntity(_0x3421c9,_0x1168a7){return function(_0x387395){if(_0x387395){return _0x387395[_0xb423('0x2a')]()[_0xb423('0x2b')](function(){_0x3421c9['status'](0xcc)[_0xb423('0x2c')]();});}};}function handleEntityNotFound(_0x2ddecb,_0x5eebe5){return function(_0x3c2e7b){if(!_0x3c2e7b){_0x2ddecb['sendStatus'](0x194);}return _0x3c2e7b;};}function handleError(_0x34110a,_0x1f8b36){_0x1f8b36=_0x1f8b36||0x1f4;return function(_0x542ac0){logger[_0xb423('0x1c')](_0x542ac0['stack']);if(_0x542ac0[_0xb423('0x2d')]){delete _0x542ac0[_0xb423('0x2d')];}_0x34110a[_0xb423('0x25')](_0x1f8b36)[_0xb423('0x2e')](_0x542ac0);};}exports[_0xb423('0x2f')]=function(_0x540a27,_0x4c1f30){var _0x441937={},_0x723153={},_0x4ed1bd={'count':0x0,'rows':[]};var _0xac1a53=_[_0xb423('0x30')](db['SalesforceConfiguration'][_0xb423('0x31')],function(_0x22203b){return{'name':_0x22203b[_0xb423('0x32')],'type':_0x22203b[_0xb423('0x33')][_0xb423('0x34')]};});_0x723153[_0xb423('0x35')]=_[_0xb423('0x30')](_0xac1a53,_0xb423('0x2d'));_0x723153[_0xb423('0x36')]=_[_0xb423('0x37')](_0x540a27[_0xb423('0x36')]);_0x723153[_0xb423('0x38')]=_[_0xb423('0x39')](_0x723153[_0xb423('0x35')],_0x723153['query']);_0x441937[_0xb423('0x3a')]=_['intersection'](_0x723153['model'],qs['fields'](_0x540a27['query'][_0xb423('0x3b')]));_0x441937[_0xb423('0x3a')]=_0x441937['attributes'][_0xb423('0x3c')]?_0x441937[_0xb423('0x3a')]:_0x723153[_0xb423('0x35')];if(!_0x540a27[_0xb423('0x36')]['hasOwnProperty'](_0xb423('0x3d'))){_0x441937[_0xb423('0x24')]=qs[_0xb423('0x24')](_0x540a27['query'][_0xb423('0x24')]);_0x441937[_0xb423('0x3e')]=qs['offset'](_0x540a27['query'][_0xb423('0x3e')]);}_0x441937['order']=qs[_0xb423('0x3f')](_0x540a27[_0xb423('0x36')]['sort']);_0x441937[_0xb423('0x40')]=qs['filters'](_[_0xb423('0x41')](_0x540a27[_0xb423('0x36')],_0x723153[_0xb423('0x38')]),_0xac1a53);if(_0x540a27[_0xb423('0x36')][_0xb423('0x42')]){_0x441937[_0xb423('0x40')]=_[_0xb423('0x43')](_0x441937[_0xb423('0x40')],{'$or':_[_0xb423('0x30')](_0xac1a53,function(_0x174a6a){if(_0x174a6a[_0xb423('0x33')]!==_0xb423('0x44')){var _0x45401={};_0x45401[_0x174a6a[_0xb423('0x2d')]]={'$like':'%'+_0x540a27[_0xb423('0x36')][_0xb423('0x42')]+'%'};return _0x45401;}})});}_0x441937=_[_0xb423('0x43')]({},_0x441937,_0x540a27[_0xb423('0x45')]);var _0x35bfff={'where':_0x441937['where']};return db[_0xb423('0x46')][_0xb423('0x47')](_0x35bfff)[_0xb423('0x2b')](function(_0x34c8a4){_0x4ed1bd[_0xb423('0x47')]=_0x34c8a4;if(_0x540a27[_0xb423('0x36')]['includeAll']){_0x441937['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xb423('0x48')](_0x441937);})[_0xb423('0x2b')](function(_0x28cf46){_0x4ed1bd[_0xb423('0x49')]=_0x28cf46;return _0x4ed1bd;})[_0xb423('0x2b')](respondWithFilteredResult(_0x4c1f30,_0x441937))['catch'](handleError(_0x4c1f30,null));};exports['show']=function(_0x2b309a,_0x4cbb9b){var _0x52081f={'raw':![],'where':{'id':_0x2b309a[_0xb423('0x4a')]['id']}},_0x2d2ef5={};_0x2d2ef5[_0xb423('0x35')]=_['keys'](db['SalesforceConfiguration'][_0xb423('0x31')]);_0x2d2ef5[_0xb423('0x36')]=_[_0xb423('0x37')](_0x2b309a[_0xb423('0x36')]);_0x2d2ef5[_0xb423('0x38')]=_['intersection'](_0x2d2ef5['model'],_0x2d2ef5[_0xb423('0x36')]);_0x52081f['attributes']=_['intersection'](_0x2d2ef5[_0xb423('0x35')],qs['fields'](_0x2b309a['query']['fields']));_0x52081f[_0xb423('0x3a')]=_0x52081f[_0xb423('0x3a')][_0xb423('0x3c')]?_0x52081f['attributes']:_0x2d2ef5['model'];if(_0x2b309a[_0xb423('0x36')][_0xb423('0x4b')]){_0x52081f[_0xb423('0x4c')]=[{'all':!![]}];}_0x52081f=_[_0xb423('0x43')]({},_0x52081f,_0x2b309a[_0xb423('0x45')]);return db[_0xb423('0x46')][_0xb423('0x4d')](_0x52081f)['then'](handleEntityNotFound(_0x4cbb9b,null))[_0xb423('0x2b')](respondWithResult(_0x4cbb9b,null))[_0xb423('0x21')](handleError(_0x4cbb9b,null));};exports[_0xb423('0x4e')]=function(_0x1f5acb,_0x2047c1){return db[_0xb423('0x46')][_0xb423('0x4e')](_0x1f5acb[_0xb423('0x4f')],{})[_0xb423('0x2b')](respondWithResult(_0x2047c1,0xc9))['catch'](handleError(_0x2047c1,null));};exports['update']=function(_0x5c2876,_0x15aa60){if(_0x5c2876['body']['id']){delete _0x5c2876[_0xb423('0x4f')]['id'];}return db[_0xb423('0x46')][_0xb423('0x4d')]({'where':{'id':_0x5c2876['params']['id']}})[_0xb423('0x2b')](handleEntityNotFound(_0x15aa60,null))['then'](saveUpdates(_0x5c2876[_0xb423('0x4f')],null))[_0xb423('0x2b')](respondWithResult(_0x15aa60,null))['catch'](handleError(_0x15aa60,null));};exports[_0xb423('0x2a')]=function(_0x775a95,_0x545b32){return db[_0xb423('0x46')][_0xb423('0x4d')]({'where':{'id':_0x775a95[_0xb423('0x4a')]['id']}})[_0xb423('0x2b')](handleEntityNotFound(_0x545b32,null))[_0xb423('0x2b')](removeEntity(_0x545b32,null))['catch'](handleError(_0x545b32,null));};exports[_0xb423('0x50')]=function(_0x556deb,_0x321bd9,_0x14402c){var _0xd68878={};var _0x42bb2e={};var _0x46095e;var _0x57ed42;return db[_0xb423('0x46')][_0xb423('0x51')]({'where':{'id':_0x556deb[_0xb423('0x4a')]['id']}})[_0xb423('0x2b')](handleEntityNotFound(_0x321bd9,null))[_0xb423('0x2b')](function(_0x42b01d){if(_0x42b01d){_0x46095e=_0x42b01d;_0x42bb2e[_0xb423('0x35')]=_['keys'](db['SalesforceField']['rawAttributes']);_0x42bb2e[_0xb423('0x36')]=_[_0xb423('0x37')](_0x556deb[_0xb423('0x36')]);_0x42bb2e[_0xb423('0x38')]=_['intersection'](_0x42bb2e[_0xb423('0x35')],_0x42bb2e['query']);_0xd68878['attributes']=_[_0xb423('0x39')](_0x42bb2e[_0xb423('0x35')],qs[_0xb423('0x3b')](_0x556deb['query'][_0xb423('0x3b')]));_0xd68878[_0xb423('0x3a')]=_0xd68878[_0xb423('0x3a')]['length']?_0xd68878['attributes']:_0x42bb2e[_0xb423('0x35')];_0xd68878['order']=qs[_0xb423('0x3f')](_0x556deb['query']['sort']);_0xd68878['where']=qs[_0xb423('0x38')](_['pick'](_0x556deb[_0xb423('0x36')],_0x42bb2e['filters']));if(_0x556deb[_0xb423('0x36')][_0xb423('0x42')]){_0xd68878[_0xb423('0x40')]=_[_0xb423('0x43')](_0xd68878[_0xb423('0x40')],{'$or':_['map'](_0xd68878[_0xb423('0x3a')],function(_0x33865a){var _0x588bfc={};_0x588bfc[_0x33865a]={'$like':'%'+_0x556deb[_0xb423('0x36')][_0xb423('0x42')]+'%'};return _0x588bfc;})});}_0xd68878=_[_0xb423('0x43')]({},_0xd68878,_0x556deb['options']);return _0x46095e[_0xb423('0x50')](_0xd68878);}})[_0xb423('0x2b')](function(_0x4f0aa5){if(_0x4f0aa5){_0x57ed42=_0x4f0aa5[_0xb423('0x3c')];if(!_0x556deb[_0xb423('0x36')]['hasOwnProperty'](_0xb423('0x3d'))){_0xd68878['limit']=qs[_0xb423('0x24')](_0x556deb[_0xb423('0x36')][_0xb423('0x24')]);_0xd68878[_0xb423('0x3e')]=qs[_0xb423('0x3e')](_0x556deb[_0xb423('0x36')][_0xb423('0x3e')]);}return _0x46095e[_0xb423('0x50')](_0xd68878);}})[_0xb423('0x2b')](function(_0x3493c2){if(_0x3493c2){return _0x3493c2?{'count':_0x57ed42,'rows':_0x3493c2}:null;}})[_0xb423('0x2b')](respondWithResult(_0x321bd9,null))[_0xb423('0x21')](handleError(_0x321bd9,null));};exports['getSubjects']=function(_0x3f9098,_0x430eb1,_0x2852de){var _0x1d006a={};var _0x76c472={};var _0x1b4146;var _0x51c2ab;return db[_0xb423('0x46')][_0xb423('0x51')]({'where':{'id':_0x3f9098[_0xb423('0x4a')]['id']}})[_0xb423('0x2b')](handleEntityNotFound(_0x430eb1,null))[_0xb423('0x2b')](function(_0x51df80){if(_0x51df80){_0x1b4146=_0x51df80;_0x76c472[_0xb423('0x35')]=_[_0xb423('0x37')](db['SalesforceField'][_0xb423('0x31')]);_0x76c472['query']=_[_0xb423('0x37')](_0x3f9098[_0xb423('0x36')]);_0x76c472[_0xb423('0x38')]=_[_0xb423('0x39')](_0x76c472[_0xb423('0x35')],_0x76c472[_0xb423('0x36')]);_0x1d006a[_0xb423('0x3a')]=_['intersection'](_0x76c472['model'],qs['fields'](_0x3f9098[_0xb423('0x36')][_0xb423('0x3b')]));_0x1d006a[_0xb423('0x3a')]=_0x1d006a[_0xb423('0x3a')][_0xb423('0x3c')]?_0x1d006a[_0xb423('0x3a')]:_0x76c472[_0xb423('0x35')];_0x1d006a[_0xb423('0x52')]=qs[_0xb423('0x3f')](_0x3f9098['query']['sort']);_0x1d006a[_0xb423('0x40')]=qs['filters'](_[_0xb423('0x41')](_0x3f9098[_0xb423('0x36')],_0x76c472[_0xb423('0x38')]));if(_0x3f9098['query']['filter']){_0x1d006a[_0xb423('0x40')]=_[_0xb423('0x43')](_0x1d006a['where'],{'$or':_['map'](_0x1d006a[_0xb423('0x3a')],function(_0x3aa2d6){var _0x30b1d0={};_0x30b1d0[_0x3aa2d6]={'$like':'%'+_0x3f9098['query'][_0xb423('0x42')]+'%'};return _0x30b1d0;})});}_0x1d006a=_['merge']({},_0x1d006a,_0x3f9098[_0xb423('0x45')]);return _0x1b4146[_0xb423('0x53')](_0x1d006a);}})[_0xb423('0x2b')](function(_0x5e61e5){if(_0x5e61e5){_0x51c2ab=_0x5e61e5[_0xb423('0x3c')];if(!_0x3f9098[_0xb423('0x36')]['hasOwnProperty'](_0xb423('0x3d'))){_0x1d006a[_0xb423('0x24')]=qs['limit'](_0x3f9098['query'][_0xb423('0x24')]);_0x1d006a[_0xb423('0x3e')]=qs[_0xb423('0x3e')](_0x3f9098['query']['offset']);}return _0x1b4146[_0xb423('0x53')](_0x1d006a);}})[_0xb423('0x2b')](function(_0x3f3936){if(_0x3f3936){return _0x3f3936?{'count':_0x51c2ab,'rows':_0x3f3936}:null;}})[_0xb423('0x2b')](respondWithResult(_0x430eb1,null))[_0xb423('0x21')](handleError(_0x430eb1,null));};exports['getDescriptions']=function(_0x49f23e,_0x5c48cf,_0x2957cc){var _0x28da3e={};var _0x597f88={};var _0x83df43;var _0x170d11;return db['SalesforceConfiguration'][_0xb423('0x51')]({'where':{'id':_0x49f23e[_0xb423('0x4a')]['id']}})[_0xb423('0x2b')](handleEntityNotFound(_0x5c48cf,null))[_0xb423('0x2b')](function(_0x94159){if(_0x94159){_0x83df43=_0x94159;_0x597f88[_0xb423('0x35')]=_[_0xb423('0x37')](db[_0xb423('0x54')]['rawAttributes']);_0x597f88['query']=_[_0xb423('0x37')](_0x49f23e[_0xb423('0x36')]);_0x597f88['filters']=_[_0xb423('0x39')](_0x597f88['model'],_0x597f88[_0xb423('0x36')]);_0x28da3e[_0xb423('0x3a')]=_['intersection'](_0x597f88[_0xb423('0x35')],qs[_0xb423('0x3b')](_0x49f23e['query'][_0xb423('0x3b')]));_0x28da3e[_0xb423('0x3a')]=_0x28da3e[_0xb423('0x3a')][_0xb423('0x3c')]?_0x28da3e[_0xb423('0x3a')]:_0x597f88[_0xb423('0x35')];_0x28da3e[_0xb423('0x52')]=qs['sort'](_0x49f23e['query'][_0xb423('0x3f')]);_0x28da3e[_0xb423('0x40')]=qs['filters'](_[_0xb423('0x41')](_0x49f23e[_0xb423('0x36')],_0x597f88[_0xb423('0x38')]));if(_0x49f23e['query'][_0xb423('0x42')]){_0x28da3e['where']=_[_0xb423('0x43')](_0x28da3e[_0xb423('0x40')],{'$or':_[_0xb423('0x30')](_0x28da3e['attributes'],function(_0xbbbd5c){var _0x285f1a={};_0x285f1a[_0xbbbd5c]={'$like':'%'+_0x49f23e[_0xb423('0x36')][_0xb423('0x42')]+'%'};return _0x285f1a;})});}_0x28da3e=_[_0xb423('0x43')]({},_0x28da3e,_0x49f23e[_0xb423('0x45')]);return _0x83df43[_0xb423('0x55')](_0x28da3e);}})[_0xb423('0x2b')](function(_0x522221){if(_0x522221){_0x170d11=_0x522221[_0xb423('0x3c')];if(!_0x49f23e[_0xb423('0x36')][_0xb423('0x56')](_0xb423('0x3d'))){_0x28da3e['limit']=qs[_0xb423('0x24')](_0x49f23e[_0xb423('0x36')][_0xb423('0x24')]);_0x28da3e['offset']=qs[_0xb423('0x3e')](_0x49f23e['query']['offset']);}return _0x83df43['getDescriptions'](_0x28da3e);}})['then'](function(_0x56590e){if(_0x56590e){return _0x56590e?{'count':_0x170d11,'rows':_0x56590e}:null;}})['then'](respondWithResult(_0x5c48cf,null))[_0xb423('0x21')](handleError(_0x5c48cf,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 117837c..8b8ccd1 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 _0x9c2b=['request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x4d5d27,_0x19c365){var _0x4db851=function(_0x487f9f){while(--_0x487f9f){_0x4d5d27['push'](_0x4d5d27['shift']());}};_0x4db851(++_0x19c365);}(_0x9c2b,0x1c2));var _0xb9c2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9c2b[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xb9c2('0x0'));var util=require(_0xb9c2('0x1'));var logger=require(_0xb9c2('0x2'))('api');var moment=require(_0xb9c2('0x3'));var BPromise=require(_0xb9c2('0x4'));var rp=require(_0xb9c2('0x5'));var fs=require('fs');var path=require(_0xb9c2('0x6'));var rimraf=require(_0xb9c2('0x7'));var config=require(_0xb9c2('0x8'));var attributes=require(_0xb9c2('0x9'));module[_0xb9c2('0xa')]=function(_0x11e16f,_0x5d3d62){return _0x11e16f['define'](_0xb9c2('0xb'),attributes,{'tableName':_0xb9c2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9149=['../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x49141a,_0x32710c){var _0x4dd9ca=function(_0x456d75){while(--_0x456d75){_0x49141a['push'](_0x49141a['shift']());}};_0x4dd9ca(++_0x32710c);}(_0x9149,0x1d7));var _0x9914=function(_0x460556,_0x10cc38){_0x460556=_0x460556-0x0;var _0x373599=_0x9149[_0x460556];return _0x373599;};'use strict';var _=require(_0x9914('0x0'));var util=require(_0x9914('0x1'));var logger=require(_0x9914('0x2'))(_0x9914('0x3'));var moment=require(_0x9914('0x4'));var BPromise=require(_0x9914('0x5'));var rp=require(_0x9914('0x6'));var fs=require('fs');var path=require(_0x9914('0x7'));var rimraf=require(_0x9914('0x8'));var config=require(_0x9914('0x9'));var attributes=require(_0x9914('0xa'));module[_0x9914('0xb')]=function(_0x271a53,_0x1a7b55){return _0x271a53[_0x9914('0xc')](_0x9914('0xd'),attributes,{'tableName':_0x9914('0xe'),'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 2810c31..bbb77e5 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 _0x7002=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xdb6865,_0x7faad9){var _0x41a898=function(_0xbf301e){while(--_0xbf301e){_0xdb6865['push'](_0xdb6865['shift']());}};_0x41a898(++_0x7faad9);}(_0x7002,0xf8));var _0x2700=function(_0x44b7d6,_0x4a3f3f){_0x44b7d6=_0x44b7d6-0x0;var _0x5346f0=_0x7002[_0x44b7d6];return _0x5346f0;};'use strict';var _=require(_0x2700('0x0'));var util=require(_0x2700('0x1'));var moment=require(_0x2700('0x2'));var BPromise=require(_0x2700('0x3'));var rs=require(_0x2700('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2700('0x5'))['db'];var utils=require(_0x2700('0x6'));var logger=require('../../config/logger')(_0x2700('0x7'));var config=require(_0x2700('0x8'));var jayson=require(_0x2700('0x9'));var client=jayson['client'][_0x2700('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x547d17,_0x600c78,_0xb90baa){return new BPromise(function(_0x283b65,_0x3f5cca){return client[_0x2700('0xb')](_0x547d17,_0xb90baa)['then'](function(_0x2026fd){logger['info'](_0x2700('0xc'),_0x600c78,_0x2700('0xd'));logger[_0x2700('0xe')](_0x2700('0xf'),_0x600c78,_0x2700('0xd'),JSON[_0x2700('0x10')](_0x2026fd));if(_0x2026fd['error']){if(_0x2026fd[_0x2700('0x11')][_0x2700('0x12')]===0x1f4){logger['error'](_0x2700('0xc'),_0x600c78,_0x2026fd[_0x2700('0x11')]['message']);return _0x3f5cca(_0x2026fd[_0x2700('0x11')]['message']);}logger[_0x2700('0x11')](_0x2700('0xc'),_0x600c78,_0x2026fd['error'][_0x2700('0x13')]);return _0x283b65(_0x2026fd[_0x2700('0x11')]['message']);}else{logger[_0x2700('0x14')](_0x2700('0xc'),_0x600c78,_0x2700('0xd'));_0x283b65(_0x2026fd[_0x2700('0x15')][_0x2700('0x13')]);}})[_0x2700('0x16')](function(_0x6dd428){logger[_0x2700('0x11')](_0x2700('0xc'),_0x600c78,_0x6dd428);_0x3f5cca(_0x6dd428);});});} \ No newline at end of file +var _0x0897=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x1abbb8,_0x3638d7){var _0x388130=function(_0x33bcc4){while(--_0x33bcc4){_0x1abbb8['push'](_0x1abbb8['shift']());}};_0x388130(++_0x3638d7);}(_0x0897,0x187));var _0x7089=function(_0x3148fc,_0x439d11){_0x3148fc=_0x3148fc-0x0;var _0x48c8f6=_0x0897[_0x3148fc];return _0x48c8f6;};'use strict';var _=require(_0x7089('0x0'));var util=require(_0x7089('0x1'));var moment=require(_0x7089('0x2'));var BPromise=require(_0x7089('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7089('0x4'));var db=require(_0x7089('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7089('0x6'));var config=require(_0x7089('0x7'));var jayson=require(_0x7089('0x8'));var client=jayson[_0x7089('0x9')][_0x7089('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5efc15,_0x26403b,_0x5edb39){return new BPromise(function(_0x5f5336,_0x33baa2){return client[_0x7089('0xb')](_0x5efc15,_0x5edb39)['then'](function(_0x4b5281){logger[_0x7089('0xc')](_0x7089('0xd'),_0x26403b,_0x7089('0xe'));logger['debug'](_0x7089('0xf'),_0x26403b,_0x7089('0xe'),JSON[_0x7089('0x10')](_0x4b5281));if(_0x4b5281[_0x7089('0x11')]){if(_0x4b5281[_0x7089('0x11')][_0x7089('0x12')]===0x1f4){logger[_0x7089('0x11')](_0x7089('0xd'),_0x26403b,_0x4b5281['error'][_0x7089('0x13')]);return _0x33baa2(_0x4b5281[_0x7089('0x11')][_0x7089('0x13')]);}logger[_0x7089('0x11')]('SalesforceConfiguration,\x20%s,\x20%s',_0x26403b,_0x4b5281[_0x7089('0x11')]['message']);return _0x5f5336(_0x4b5281[_0x7089('0x11')][_0x7089('0x13')]);}else{logger['info'](_0x7089('0xd'),_0x26403b,_0x7089('0xe'));_0x5f5336(_0x4b5281[_0x7089('0x14')][_0x7089('0x13')]);}})[_0x7089('0x15')](function(_0x4c8af3){logger[_0x7089('0x11')](_0x7089('0xd'),_0x26403b,_0x4c8af3);_0x33baa2(_0x4c8af3);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 785fa68..fc49057 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 _0x90b1=['exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','update','delete','destroy'];(function(_0x418268,_0x4ec4cb){var _0x5ef455=function(_0x239f46){while(--_0x239f46){_0x418268['push'](_0x418268['shift']());}};_0x5ef455(++_0x4ec4cb);}(_0x90b1,0x1bb));var _0x190b=function(_0xe9fdc4,_0x1cc454){_0xe9fdc4=_0xe9fdc4-0x0;var _0x529cdd=_0x90b1[_0xe9fdc4];return _0x529cdd;};'use strict';var multer=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var path=require(_0x190b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x190b('0x3')]();var auth=require(_0x190b('0x4'));var interaction=require(_0x190b('0x5'));var config=require(_0x190b('0x6'));var controller=require('./intSalesforceField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x190b('0x7')](_0x190b('0x8'),auth[_0x190b('0x9')](),controller[_0x190b('0xa')]);router[_0x190b('0xb')]('/',auth[_0x190b('0x9')](),controller[_0x190b('0xc')]);router['put'](_0x190b('0x8'),auth[_0x190b('0x9')](),controller[_0x190b('0xd')]);router[_0x190b('0xe')](_0x190b('0x8'),auth[_0x190b('0x9')](),controller[_0x190b('0xf')]);module[_0x190b('0x10')]=router; \ No newline at end of file +var _0x6050=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','post','isAuthenticated'];(function(_0x1a3e2b,_0xa75584){var _0x23969f=function(_0x4c69d3){while(--_0x4c69d3){_0x1a3e2b['push'](_0x1a3e2b['shift']());}};_0x23969f(++_0xa75584);}(_0x6050,0x196));var _0x0605=function(_0x9c3353,_0x83723b){_0x9c3353=_0x9c3353-0x0;var _0x4e3398=_0x6050[_0x9c3353];return _0x4e3398;};'use strict';var multer=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var path=require(_0x0605('0x2'));var timeout=require(_0x0605('0x3'));var express=require(_0x0605('0x4'));var router=express[_0x0605('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x0605('0x6'));var config=require(_0x0605('0x7'));var controller=require(_0x0605('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0605('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0605('0xa')]('/',auth[_0x0605('0xb')](),controller[_0x0605('0xc')]);router[_0x0605('0xd')](_0x0605('0xe'),auth['isAuthenticated'](),controller[_0x0605('0xf')]);router[_0x0605('0x10')](_0x0605('0xe'),auth[_0x0605('0xb')](),controller[_0x0605('0x11')]);module[_0x0605('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index b4ebba0..50a479a 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 _0xc32e=['STRING','customVariable','ENUM','string','variable'];(function(_0x1d4cd1,_0xeefaf8){var _0x1d2f65=function(_0x3a7469){while(--_0x3a7469){_0x1d4cd1['push'](_0x1d4cd1['shift']());}};_0x1d2f65(++_0xeefaf8);}(_0xc32e,0x7f));var _0xec32=function(_0x4271ec,_0x71cb99){_0x4271ec=_0x4271ec-0x0;var _0x1c64df=_0xc32e[_0x4271ec];return _0x1c64df;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xec32('0x0')](_0xec32('0x1'),_0xec32('0x2'),'customVariable','keyValue'),'defaultValue':_0xec32('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xec32('0x3')]},'keyType':{'type':Sequelize[_0xec32('0x0')](_0xec32('0x1'),'variable',_0xec32('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xec32('0x3')]},'variableName':{'type':Sequelize[_0xec32('0x3')]}}; \ No newline at end of file +var _0x7574=['sequelize','exports','ENUM','string','customVariable','keyValue','STRING','variable'];(function(_0x1cfe21,_0x3e5e42){var _0x2d4b99=function(_0xff1adf){while(--_0xff1adf){_0x1cfe21['push'](_0x1cfe21['shift']());}};_0x2d4b99(++_0x3e5e42);}(_0x7574,0xf0));var _0x4757=function(_0x4a295a,_0x5c8c2d){_0x4a295a=_0x4a295a-0x0;var _0x46ea4f=_0x7574[_0x4a295a];return _0x46ea4f;};'use strict';var Sequelize=require(_0x4757('0x0'));module[_0x4757('0x1')]={'type':{'type':Sequelize[_0x4757('0x2')](_0x4757('0x3'),'variable',_0x4757('0x4'),_0x4757('0x5')),'defaultValue':_0x4757('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4757('0x6')]},'keyType':{'type':Sequelize[_0x4757('0x2')]('string',_0x4757('0x7'),_0x4757('0x4'))},'keyContent':{'type':Sequelize[_0x4757('0x6')]},'idField':{'type':Sequelize[_0x4757('0x6')]},'variableName':{'type':Sequelize[_0x4757('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 8ef624f..59ec411 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 _0xa0aa=['catch','show','params','find','create','body','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','SalesforceField','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','VIRTUAL','filter','merge','options','include','rows'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0xa0aa,0x96));var _0xaa0a=function(_0x300ec8,_0x4bdbe7){_0x300ec8=_0x300ec8-0x0;var _0x525d79=_0xa0aa[_0x300ec8];return _0x525d79;};'use strict';var pdf=require(_0xaa0a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaa0a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa0a('0x2'));var rp=require('request-promise');var moment=require(_0xaa0a('0x3'));var BPromise=require(_0xaa0a('0x4'));var Mustache=require(_0xaa0a('0x5'));var util=require(_0xaa0a('0x6'));var path=require('path');var sox=require(_0xaa0a('0x7'));var csv=require(_0xaa0a('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaa0a('0x9'));var squel=require(_0xaa0a('0xa'));var crypto=require('crypto');var jsforce=require(_0xaa0a('0xb'));var deskjs=require(_0xaa0a('0xc'));var toCsv=require(_0xaa0a('0x8'));var querystring=require(_0xaa0a('0xd'));var Papa=require(_0xaa0a('0xe'));var Redis=require(_0xaa0a('0xf'));var authService=require(_0xaa0a('0x10'));var qs=require(_0xaa0a('0x11'));var as=require(_0xaa0a('0x12'));var hardwareService=require(_0xaa0a('0x13'));var logger=require('../../config/logger')(_0xaa0a('0x14'));var utils=require(_0xaa0a('0x15'));var config=require(_0xaa0a('0x16'));var db=require(_0xaa0a('0x17'))['db'];function respondWithStatusCode(_0x3bf94a,_0xe7522a){_0xe7522a=_0xe7522a||0xcc;return function(_0x1b7732){if(_0x1b7732){return _0x3bf94a[_0xaa0a('0x18')](_0xe7522a);}return _0x3bf94a[_0xaa0a('0x19')](_0xe7522a)[_0xaa0a('0x1a')]();};}function respondWithResult(_0x12963b,_0x3e5d3a){_0x3e5d3a=_0x3e5d3a||0xc8;return function(_0x43aabb){if(_0x43aabb){return _0x12963b[_0xaa0a('0x19')](_0x3e5d3a)[_0xaa0a('0x1b')](_0x43aabb);}};}function respondWithFilteredResult(_0x3739e9,_0x5ee271){return function(_0x2c04d1){if(_0x2c04d1){var _0xc1f551=_0x2c04d1[_0xaa0a('0x1c')],_0x57dbee=_0x5ee271['offset'],_0xfa077b=_0x5ee271[_0xaa0a('0x1d')]+_0x5ee271[_0xaa0a('0x1e')],_0x74d47c;if(_0xfa077b>=_0xc1f551){_0xfa077b=_0xc1f551;_0x74d47c=0xc8;}else{_0x74d47c=0xce;}_0x3739e9[_0xaa0a('0x19')](_0x74d47c);return _0x3739e9[_0xaa0a('0x1f')](_0xaa0a('0x20'),_0x57dbee+'-'+_0xfa077b+'/'+_0xc1f551)[_0xaa0a('0x1b')](_0x2c04d1);}return null;};}function patchUpdates(_0x1167f8){return function(_0x332e93){try{jsonpatch['apply'](_0x332e93,_0x1167f8,!![]);}catch(_0x112292){return BPromise[_0xaa0a('0x21')](_0x112292);}return _0x332e93[_0xaa0a('0x22')]();};}function saveUpdates(_0x36e1e8,_0x25ce66){return function(_0x11e45d){if(_0x11e45d){return _0x11e45d[_0xaa0a('0x23')](_0x36e1e8)[_0xaa0a('0x24')](function(_0x25dbe7){return _0x25dbe7;});}return null;};}function removeEntity(_0x23af1d,_0x39a07e){return function(_0x12ce88){if(_0x12ce88){return _0x12ce88[_0xaa0a('0x25')]()[_0xaa0a('0x24')](function(){_0x23af1d['status'](0xcc)[_0xaa0a('0x1a')]();});}};}function handleEntityNotFound(_0x218cc9,_0x589b75){return function(_0x57caa4){if(!_0x57caa4){_0x218cc9[_0xaa0a('0x18')](0x194);}return _0x57caa4;};}function handleError(_0x470b68,_0x2a1815){_0x2a1815=_0x2a1815||0x1f4;return function(_0x48c2c9){logger[_0xaa0a('0x26')](_0x48c2c9['stack']);if(_0x48c2c9['name']){delete _0x48c2c9[_0xaa0a('0x27')];}_0x470b68[_0xaa0a('0x19')](_0x2a1815)[_0xaa0a('0x28')](_0x48c2c9);};}exports[_0xaa0a('0x29')]=function(_0x4c64d5,_0x3f62e5){var _0x388d0a={},_0x147ba1={},_0x394dfe={'count':0x0,'rows':[]};var _0x1c5b6b=_[_0xaa0a('0x2a')](db[_0xaa0a('0x2b')][_0xaa0a('0x2c')],function(_0x59c6fc){return{'name':_0x59c6fc['fieldName'],'type':_0x59c6fc[_0xaa0a('0x2d')][_0xaa0a('0x2e')]};});_0x147ba1[_0xaa0a('0x2f')]=_[_0xaa0a('0x2a')](_0x1c5b6b,'name');_0x147ba1[_0xaa0a('0x30')]=_[_0xaa0a('0x31')](_0x4c64d5[_0xaa0a('0x30')]);_0x147ba1[_0xaa0a('0x32')]=_[_0xaa0a('0x33')](_0x147ba1[_0xaa0a('0x2f')],_0x147ba1[_0xaa0a('0x30')]);_0x388d0a[_0xaa0a('0x34')]=_[_0xaa0a('0x33')](_0x147ba1[_0xaa0a('0x2f')],qs[_0xaa0a('0x35')](_0x4c64d5['query'][_0xaa0a('0x35')]));_0x388d0a[_0xaa0a('0x34')]=_0x388d0a[_0xaa0a('0x34')][_0xaa0a('0x36')]?_0x388d0a[_0xaa0a('0x34')]:_0x147ba1[_0xaa0a('0x2f')];if(!_0x4c64d5[_0xaa0a('0x30')][_0xaa0a('0x37')]('nolimit')){_0x388d0a[_0xaa0a('0x1e')]=qs[_0xaa0a('0x1e')](_0x4c64d5['query'][_0xaa0a('0x1e')]);_0x388d0a[_0xaa0a('0x1d')]=qs[_0xaa0a('0x1d')](_0x4c64d5['query'][_0xaa0a('0x1d')]);}_0x388d0a[_0xaa0a('0x38')]=qs[_0xaa0a('0x39')](_0x4c64d5[_0xaa0a('0x30')][_0xaa0a('0x39')]);_0x388d0a['where']=qs[_0xaa0a('0x32')](_[_0xaa0a('0x3a')](_0x4c64d5[_0xaa0a('0x30')],_0x147ba1[_0xaa0a('0x32')]),_0x1c5b6b);if(_0x4c64d5['query']['filter']){_0x388d0a[_0xaa0a('0x3b')]=_['merge'](_0x388d0a[_0xaa0a('0x3b')],{'$or':_[_0xaa0a('0x2a')](_0x1c5b6b,function(_0x2ebc5d){if(_0x2ebc5d[_0xaa0a('0x2d')]!==_0xaa0a('0x3c')){var _0x54b3f5={};_0x54b3f5[_0x2ebc5d[_0xaa0a('0x27')]]={'$like':'%'+_0x4c64d5[_0xaa0a('0x30')][_0xaa0a('0x3d')]+'%'};return _0x54b3f5;}})});}_0x388d0a=_[_0xaa0a('0x3e')]({},_0x388d0a,_0x4c64d5[_0xaa0a('0x3f')]);var _0x483fad={'where':_0x388d0a[_0xaa0a('0x3b')]};return db[_0xaa0a('0x2b')][_0xaa0a('0x1c')](_0x483fad)[_0xaa0a('0x24')](function(_0x49f170){_0x394dfe[_0xaa0a('0x1c')]=_0x49f170;if(_0x4c64d5[_0xaa0a('0x30')]['includeAll']){_0x388d0a[_0xaa0a('0x40')]=[{'all':!![]}];}return db[_0xaa0a('0x2b')]['findAll'](_0x388d0a);})['then'](function(_0x599887){_0x394dfe[_0xaa0a('0x41')]=_0x599887;return _0x394dfe;})['then'](respondWithFilteredResult(_0x3f62e5,_0x388d0a))[_0xaa0a('0x42')](handleError(_0x3f62e5,null));};exports[_0xaa0a('0x43')]=function(_0x324c05,_0x5712b6){var _0x897c2c={'raw':!![],'where':{'id':_0x324c05[_0xaa0a('0x44')]['id']}},_0x47d22a={};_0x47d22a['model']=_[_0xaa0a('0x31')](db[_0xaa0a('0x2b')][_0xaa0a('0x2c')]);_0x47d22a['query']=_[_0xaa0a('0x31')](_0x324c05['query']);_0x47d22a[_0xaa0a('0x32')]=_[_0xaa0a('0x33')](_0x47d22a[_0xaa0a('0x2f')],_0x47d22a[_0xaa0a('0x30')]);_0x897c2c[_0xaa0a('0x34')]=_[_0xaa0a('0x33')](_0x47d22a['model'],qs['fields'](_0x324c05[_0xaa0a('0x30')][_0xaa0a('0x35')]));_0x897c2c['attributes']=_0x897c2c[_0xaa0a('0x34')][_0xaa0a('0x36')]?_0x897c2c[_0xaa0a('0x34')]:_0x47d22a[_0xaa0a('0x2f')];if(_0x324c05[_0xaa0a('0x30')]['includeAll']){_0x897c2c[_0xaa0a('0x40')]=[{'all':!![]}];}_0x897c2c=_[_0xaa0a('0x3e')]({},_0x897c2c,_0x324c05[_0xaa0a('0x3f')]);return db[_0xaa0a('0x2b')][_0xaa0a('0x45')](_0x897c2c)['then'](handleEntityNotFound(_0x5712b6,null))['then'](respondWithResult(_0x5712b6,null))[_0xaa0a('0x42')](handleError(_0x5712b6,null));};exports['create']=function(_0xb88062,_0x29f7a7){return db['SalesforceField'][_0xaa0a('0x46')](_0xb88062[_0xaa0a('0x47')],{})[_0xaa0a('0x24')](respondWithResult(_0x29f7a7,0xc9))[_0xaa0a('0x42')](handleError(_0x29f7a7,null));};exports[_0xaa0a('0x23')]=function(_0x23d6d0,_0x4ffdbf){if(_0x23d6d0['body']['id']){delete _0x23d6d0['body']['id'];}return db['SalesforceField'][_0xaa0a('0x45')]({'where':{'id':_0x23d6d0[_0xaa0a('0x44')]['id']}})[_0xaa0a('0x24')](handleEntityNotFound(_0x4ffdbf,null))[_0xaa0a('0x24')](saveUpdates(_0x23d6d0['body'],null))[_0xaa0a('0x24')](respondWithResult(_0x4ffdbf,null))[_0xaa0a('0x42')](handleError(_0x4ffdbf,null));};exports['destroy']=function(_0x360b12,_0x1ea40c){return db[_0xaa0a('0x2b')][_0xaa0a('0x45')]({'where':{'id':_0x360b12['params']['id']}})[_0xaa0a('0x24')](handleEntityNotFound(_0x1ea40c,null))[_0xaa0a('0x24')](removeEntity(_0x1ea40c,null))[_0xaa0a('0x42')](handleError(_0x1ea40c,null));}; \ No newline at end of file +var _0x9af5=['include','findAll','rows','show','params','options','find','catch','create','body','update','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','SalesforceField','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','includeAll'];(function(_0x4c4bad,_0x9c6fec){var _0x21a025=function(_0x3b02c0){while(--_0x3b02c0){_0x4c4bad['push'](_0x4c4bad['shift']());}};_0x21a025(++_0x9c6fec);}(_0x9af5,0x17d));var _0x59af=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9af5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x59af('0x0'));var emlformat=require(_0x59af('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x59af('0x2'));var rp=require(_0x59af('0x3'));var moment=require('moment');var BPromise=require(_0x59af('0x4'));var Mustache=require(_0x59af('0x5'));var util=require('util');var path=require(_0x59af('0x6'));var sox=require(_0x59af('0x7'));var csv=require(_0x59af('0x8'));var ejs=require(_0x59af('0x9'));var fs=require('fs');var _=require(_0x59af('0xa'));var squel=require(_0x59af('0xb'));var crypto=require(_0x59af('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x59af('0x8'));var querystring=require(_0x59af('0xd'));var Papa=require(_0x59af('0xe'));var Redis=require('ioredis');var authService=require(_0x59af('0xf'));var qs=require(_0x59af('0x10'));var as=require(_0x59af('0x11'));var hardwareService=require(_0x59af('0x12'));var logger=require('../../config/logger')(_0x59af('0x13'));var utils=require(_0x59af('0x14'));var config=require(_0x59af('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273e7e,_0x3e4306){_0x3e4306=_0x3e4306||0xcc;return function(_0x296da4){if(_0x296da4){return _0x273e7e[_0x59af('0x16')](_0x3e4306);}return _0x273e7e[_0x59af('0x17')](_0x3e4306)[_0x59af('0x18')]();};}function respondWithResult(_0xaebfc7,_0x4210d1){_0x4210d1=_0x4210d1||0xc8;return function(_0xc223e2){if(_0xc223e2){return _0xaebfc7[_0x59af('0x17')](_0x4210d1)[_0x59af('0x19')](_0xc223e2);}};}function respondWithFilteredResult(_0x4d36de,_0x51182c){return function(_0x59b674){if(_0x59b674){var _0x24f450=_0x59b674[_0x59af('0x1a')],_0xedb254=_0x51182c['offset'],_0x56d2b0=_0x51182c[_0x59af('0x1b')]+_0x51182c[_0x59af('0x1c')],_0x573a6c;if(_0x56d2b0>=_0x24f450){_0x56d2b0=_0x24f450;_0x573a6c=0xc8;}else{_0x573a6c=0xce;}_0x4d36de['status'](_0x573a6c);return _0x4d36de[_0x59af('0x1d')](_0x59af('0x1e'),_0xedb254+'-'+_0x56d2b0+'/'+_0x24f450)[_0x59af('0x19')](_0x59b674);}return null;};}function patchUpdates(_0x44a071){return function(_0x6229d8){try{jsonpatch[_0x59af('0x1f')](_0x6229d8,_0x44a071,!![]);}catch(_0xffa6a7){return BPromise[_0x59af('0x20')](_0xffa6a7);}return _0x6229d8[_0x59af('0x21')]();};}function saveUpdates(_0x14a7db,_0x117fa6){return function(_0x58dc52){if(_0x58dc52){return _0x58dc52['update'](_0x14a7db)[_0x59af('0x22')](function(_0x548c46){return _0x548c46;});}return null;};}function removeEntity(_0x4ff5cd,_0x3a9196){return function(_0x5d42fc){if(_0x5d42fc){return _0x5d42fc[_0x59af('0x23')]()[_0x59af('0x22')](function(){_0x4ff5cd['status'](0xcc)[_0x59af('0x18')]();});}};}function handleEntityNotFound(_0x454d0c,_0x5b3ac3){return function(_0x329786){if(!_0x329786){_0x454d0c['sendStatus'](0x194);}return _0x329786;};}function handleError(_0x51516b,_0x5a87d4){_0x5a87d4=_0x5a87d4||0x1f4;return function(_0x1da3fb){logger[_0x59af('0x24')](_0x1da3fb[_0x59af('0x25')]);if(_0x1da3fb[_0x59af('0x26')]){delete _0x1da3fb['name'];}_0x51516b[_0x59af('0x17')](_0x5a87d4)['send'](_0x1da3fb);};}exports[_0x59af('0x27')]=function(_0x387840,_0x90e23){var _0x51533e={},_0x61c5e3={},_0x343b9e={'count':0x0,'rows':[]};var _0x45b5b3=_['map'](db[_0x59af('0x28')][_0x59af('0x29')],function(_0x2c398d){return{'name':_0x2c398d[_0x59af('0x2a')],'type':_0x2c398d[_0x59af('0x2b')]['key']};});_0x61c5e3[_0x59af('0x2c')]=_['map'](_0x45b5b3,_0x59af('0x26'));_0x61c5e3[_0x59af('0x2d')]=_[_0x59af('0x2e')](_0x387840[_0x59af('0x2d')]);_0x61c5e3['filters']=_[_0x59af('0x2f')](_0x61c5e3[_0x59af('0x2c')],_0x61c5e3[_0x59af('0x2d')]);_0x51533e['attributes']=_[_0x59af('0x2f')](_0x61c5e3[_0x59af('0x2c')],qs[_0x59af('0x30')](_0x387840[_0x59af('0x2d')][_0x59af('0x30')]));_0x51533e[_0x59af('0x31')]=_0x51533e[_0x59af('0x31')][_0x59af('0x32')]?_0x51533e[_0x59af('0x31')]:_0x61c5e3[_0x59af('0x2c')];if(!_0x387840[_0x59af('0x2d')][_0x59af('0x33')](_0x59af('0x34'))){_0x51533e[_0x59af('0x1c')]=qs['limit'](_0x387840['query']['limit']);_0x51533e[_0x59af('0x1b')]=qs['offset'](_0x387840['query'][_0x59af('0x1b')]);}_0x51533e[_0x59af('0x35')]=qs[_0x59af('0x36')](_0x387840[_0x59af('0x2d')]['sort']);_0x51533e[_0x59af('0x37')]=qs[_0x59af('0x38')](_[_0x59af('0x39')](_0x387840[_0x59af('0x2d')],_0x61c5e3[_0x59af('0x38')]),_0x45b5b3);if(_0x387840['query'][_0x59af('0x3a')]){_0x51533e['where']=_[_0x59af('0x3b')](_0x51533e[_0x59af('0x37')],{'$or':_[_0x59af('0x3c')](_0x45b5b3,function(_0x39e14e){if(_0x39e14e[_0x59af('0x2b')]!==_0x59af('0x3d')){var _0x4d21e9={};_0x4d21e9[_0x39e14e[_0x59af('0x26')]]={'$like':'%'+_0x387840['query'][_0x59af('0x3a')]+'%'};return _0x4d21e9;}})});}_0x51533e=_[_0x59af('0x3b')]({},_0x51533e,_0x387840['options']);var _0x4d2e9a={'where':_0x51533e[_0x59af('0x37')]};return db[_0x59af('0x28')][_0x59af('0x1a')](_0x4d2e9a)['then'](function(_0x483e1d){_0x343b9e[_0x59af('0x1a')]=_0x483e1d;if(_0x387840[_0x59af('0x2d')][_0x59af('0x3e')]){_0x51533e[_0x59af('0x3f')]=[{'all':!![]}];}return db[_0x59af('0x28')][_0x59af('0x40')](_0x51533e);})[_0x59af('0x22')](function(_0x429f23){_0x343b9e[_0x59af('0x41')]=_0x429f23;return _0x343b9e;})['then'](respondWithFilteredResult(_0x90e23,_0x51533e))['catch'](handleError(_0x90e23,null));};exports[_0x59af('0x42')]=function(_0x1c8073,_0x406553){var _0x437a02={'raw':!![],'where':{'id':_0x1c8073[_0x59af('0x43')]['id']}},_0x2deb05={};_0x2deb05[_0x59af('0x2c')]=_[_0x59af('0x2e')](db[_0x59af('0x28')][_0x59af('0x29')]);_0x2deb05[_0x59af('0x2d')]=_[_0x59af('0x2e')](_0x1c8073[_0x59af('0x2d')]);_0x2deb05[_0x59af('0x38')]=_[_0x59af('0x2f')](_0x2deb05[_0x59af('0x2c')],_0x2deb05['query']);_0x437a02['attributes']=_['intersection'](_0x2deb05[_0x59af('0x2c')],qs['fields'](_0x1c8073[_0x59af('0x2d')][_0x59af('0x30')]));_0x437a02[_0x59af('0x31')]=_0x437a02['attributes'][_0x59af('0x32')]?_0x437a02['attributes']:_0x2deb05[_0x59af('0x2c')];if(_0x1c8073['query'][_0x59af('0x3e')]){_0x437a02[_0x59af('0x3f')]=[{'all':!![]}];}_0x437a02=_[_0x59af('0x3b')]({},_0x437a02,_0x1c8073[_0x59af('0x44')]);return db[_0x59af('0x28')][_0x59af('0x45')](_0x437a02)['then'](handleEntityNotFound(_0x406553,null))[_0x59af('0x22')](respondWithResult(_0x406553,null))[_0x59af('0x46')](handleError(_0x406553,null));};exports[_0x59af('0x47')]=function(_0x218560,_0x572378){return db[_0x59af('0x28')][_0x59af('0x47')](_0x218560[_0x59af('0x48')],{})[_0x59af('0x22')](respondWithResult(_0x572378,0xc9))[_0x59af('0x46')](handleError(_0x572378,null));};exports[_0x59af('0x49')]=function(_0xdfb206,_0x7b9cd2){if(_0xdfb206[_0x59af('0x48')]['id']){delete _0xdfb206[_0x59af('0x48')]['id'];}return db[_0x59af('0x28')][_0x59af('0x45')]({'where':{'id':_0xdfb206[_0x59af('0x43')]['id']}})[_0x59af('0x22')](handleEntityNotFound(_0x7b9cd2,null))[_0x59af('0x22')](saveUpdates(_0xdfb206[_0x59af('0x48')],null))[_0x59af('0x22')](respondWithResult(_0x7b9cd2,null))[_0x59af('0x46')](handleError(_0x7b9cd2,null));};exports[_0x59af('0x23')]=function(_0x453553,_0x1815b0){return db[_0x59af('0x28')][_0x59af('0x45')]({'where':{'id':_0x453553[_0x59af('0x43')]['id']}})[_0x59af('0x22')](handleEntityNotFound(_0x1815b0,null))[_0x59af('0x22')](removeEntity(_0x1815b0,null))['catch'](handleError(_0x1815b0,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 37d3850..8c3fef3 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 _0x754c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','util','../../config/logger','api'];(function(_0x2d37b7,_0x3bf618){var _0x4dfbdb=function(_0x18fc40){while(--_0x18fc40){_0x2d37b7['push'](_0x2d37b7['shift']());}};_0x4dfbdb(++_0x3bf618);}(_0x754c,0x106));var _0xc754=function(_0x35660c,_0x2ee395){_0x35660c=_0x35660c-0x0;var _0x4dae1f=_0x754c[_0x35660c];return _0x4dae1f;};'use strict';var _=require(_0xc754('0x0'));var util=require(_0xc754('0x1'));var logger=require(_0xc754('0x2'))(_0xc754('0x3'));var moment=require(_0xc754('0x4'));var BPromise=require(_0xc754('0x5'));var rp=require(_0xc754('0x6'));var fs=require('fs');var path=require(_0xc754('0x7'));var rimraf=require(_0xc754('0x8'));var config=require(_0xc754('0x9'));var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x4f20a8,_0x37a17c){return _0x4f20a8[_0xc754('0xa')]('SalesforceField',attributes,{'tableName':_0xc754('0xb'),'paranoid':![],'indexes':[{'name':_0xc754('0xc'),'fields':['idField',_0xc754('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd501=['SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define'];(function(_0x5f2327,_0x123bcd){var _0x304698=function(_0x5eb594){while(--_0x5eb594){_0x5f2327['push'](_0x5f2327['shift']());}};_0x304698(++_0x123bcd);}(_0xd501,0xf3));var _0x1d50=function(_0x1c6d8b,_0x59c796){_0x1c6d8b=_0x1c6d8b-0x0;var _0x34f983=_0xd501[_0x1c6d8b];return _0x34f983;};'use strict';var _=require(_0x1d50('0x0'));var util=require('util');var logger=require(_0x1d50('0x1'))(_0x1d50('0x2'));var moment=require(_0x1d50('0x3'));var BPromise=require(_0x1d50('0x4'));var rp=require(_0x1d50('0x5'));var fs=require('fs');var path=require(_0x1d50('0x6'));var rimraf=require(_0x1d50('0x7'));var config=require(_0x1d50('0x8'));var attributes=require(_0x1d50('0x9'));module[_0x1d50('0xa')]=function(_0x580de8,_0x1d9c99){return _0x580de8[_0x1d50('0xb')](_0x1d50('0xc'),attributes,{'tableName':_0x1d50('0xd'),'paranoid':![],'indexes':[{'name':_0x1d50('0xe'),'fields':[_0x1d50('0xf'),_0x1d50('0x10')],'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 246fe70..fe97bb5 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 _0x70e0=['code','SalesforceField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2e98f4,_0x5516ea){var _0x644a7b=function(_0x5b4ab7){while(--_0x5b4ab7){_0x2e98f4['push'](_0x2e98f4['shift']());}};_0x644a7b(++_0x5516ea);}(_0x70e0,0x17b));var _0x070e=function(_0x5d9204,_0x1b0ec9){_0x5d9204=_0x5d9204-0x0;var _0x6475b4=_0x70e0[_0x5d9204];return _0x6475b4;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('SalesforceField,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('SalesforceField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('SalesforceField,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xb4e6=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','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','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x13c304,_0x4791de){var _0x12696e=function(_0x2070d4){while(--_0x2070d4){_0x13c304['push'](_0x13c304['shift']());}};_0x12696e(++_0x4791de);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x4358f5,_0x5b1ac6){_0x4358f5=_0x4358f5-0x0;var _0x4d8104=_0xb4e6[_0x4358f5];return _0x4d8104;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var moment=require(_0x6b4e('0x1'));var BPromise=require(_0x6b4e('0x2'));var rs=require(_0x6b4e('0x3'));var fs=require('fs');var Redis=require(_0x6b4e('0x4'));var db=require(_0x6b4e('0x5'))['db'];var utils=require(_0x6b4e('0x6'));var logger=require(_0x6b4e('0x7'))('rpc');var config=require(_0x6b4e('0x8'));var jayson=require(_0x6b4e('0x9'));var client=jayson[_0x6b4e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd3138f,_0x570346,_0x4f00be){return new BPromise(function(_0x2311d9,_0x48c870){return client['request'](_0xd3138f,_0x4f00be)[_0x6b4e('0xb')](function(_0x2bd576){logger[_0x6b4e('0xc')](_0x6b4e('0xd'),_0x570346,_0x6b4e('0xe'));logger[_0x6b4e('0xf')](_0x6b4e('0x10'),_0x570346,'request\x20sent',JSON[_0x6b4e('0x11')](_0x2bd576));if(_0x2bd576[_0x6b4e('0x12')]){if(_0x2bd576['error'][_0x6b4e('0x13')]===0x1f4){logger[_0x6b4e('0x12')](_0x6b4e('0xd'),_0x570346,_0x2bd576[_0x6b4e('0x12')][_0x6b4e('0x14')]);return _0x48c870(_0x2bd576[_0x6b4e('0x12')][_0x6b4e('0x14')]);}logger['error'](_0x6b4e('0xd'),_0x570346,_0x2bd576[_0x6b4e('0x12')]['message']);return _0x2311d9(_0x2bd576[_0x6b4e('0x12')]['message']);}else{logger[_0x6b4e('0xc')](_0x6b4e('0xd'),_0x570346,_0x6b4e('0xe'));_0x2311d9(_0x2bd576[_0x6b4e('0x15')][_0x6b4e('0x14')]);}})[_0x6b4e('0x16')](function(_0x53a934){logger['error'](_0x6b4e('0xd'),_0x570346,_0x53a934);_0x48c870(_0x53a934);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 760061c..70530f9 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 _0x35aa=['get','isAuthenticated','index','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x35aa,0xbe));var _0xa35a=function(_0x39ff91,_0xf461d7){_0x39ff91=_0x39ff91-0x0;var _0x151d12=_0x35aa[_0x39ff91];return _0x151d12;};'use strict';var multer=require('multer');var util=require(_0xa35a('0x0'));var path=require(_0xa35a('0x1'));var timeout=require(_0xa35a('0x2'));var express=require(_0xa35a('0x3'));var router=express['Router']();var auth=require(_0xa35a('0x4'));var interaction=require(_0xa35a('0x5'));var config=require(_0xa35a('0x6'));var controller=require(_0xa35a('0x7'));router[_0xa35a('0x8')]('/',auth[_0xa35a('0x9')](),controller[_0xa35a('0xa')]);router[_0xa35a('0x8')]('/:id',auth[_0xa35a('0x9')](),controller['show']);router[_0xa35a('0x8')](_0xa35a('0xb'),auth[_0xa35a('0x9')](),controller[_0xa35a('0xc')]);router[_0xa35a('0x8')](_0xa35a('0xd'),auth['isAuthenticated'](),controller[_0xa35a('0xe')]);router[_0xa35a('0xf')]('/',auth[_0xa35a('0x9')](),controller[_0xa35a('0x10')]);router['post'](_0xa35a('0xb'),auth[_0xa35a('0x9')](),controller['addConfiguration']);router[_0xa35a('0x11')](_0xa35a('0x12'),auth[_0xa35a('0x9')](),controller[_0xa35a('0x13')]);router[_0xa35a('0x14')](_0xa35a('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xa35a('0x15')]=router; \ No newline at end of file +var _0x35f9=['../../config/environment','./intServicenowAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','Router'];(function(_0x4108d6,_0x85984e){var _0x22eda7=function(_0x509dc9){while(--_0x509dc9){_0x4108d6['push'](_0x4108d6['shift']());}};_0x22eda7(++_0x85984e);}(_0x35f9,0x1df));var _0x935f=function(_0x29a424,_0x4b9666){_0x29a424=_0x29a424-0x0;var _0x4edbfe=_0x35f9[_0x29a424];return _0x4edbfe;};'use strict';var multer=require(_0x935f('0x0'));var util=require(_0x935f('0x1'));var path=require(_0x935f('0x2'));var timeout=require(_0x935f('0x3'));var express=require('express');var router=express[_0x935f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x935f('0x5'));var controller=require(_0x935f('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x935f('0x7')]);router[_0x935f('0x8')](_0x935f('0x9'),auth[_0x935f('0xa')](),controller[_0x935f('0xb')]);router[_0x935f('0x8')](_0x935f('0xc'),auth['isAuthenticated'](),controller[_0x935f('0xd')]);router[_0x935f('0x8')](_0x935f('0xe'),auth[_0x935f('0xa')](),controller[_0x935f('0xf')]);router[_0x935f('0x10')]('/',auth[_0x935f('0xa')](),controller[_0x935f('0x11')]);router[_0x935f('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x935f('0x12')]);router[_0x935f('0x13')](_0x935f('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x935f('0x14')](_0x935f('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x935f('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 1a9f671..ef64597 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 _0xc025=['remoteUri','sequelize','exports','STRING'];(function(_0x8ff40d,_0x31b93b){var _0x5658c5=function(_0x5c0542){while(--_0x5c0542){_0x8ff40d['push'](_0x8ff40d['shift']());}};_0x5658c5(++_0x31b93b);}(_0xc025,0xf9));var _0x5c02=function(_0x109cdc,_0x19bdcb){_0x109cdc=_0x109cdc-0x0;var _0x9269e8=_0xc025[_0x109cdc];return _0x9269e8;};'use strict';var Sequelize=require(_0x5c02('0x0'));module[_0x5c02('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5c02('0x2')]},'username':{'type':Sequelize[_0x5c02('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x5c02('0x2')]},'email':{'type':Sequelize[_0x5c02('0x2')]},'remoteUri':{'type':Sequelize[_0x5c02('0x2')],'unique':_0x5c02('0x3')},'serverUrl':{'type':Sequelize[_0x5c02('0x2')]}}; \ No newline at end of file +var _0x024b=['remoteUri','sequelize','exports','STRING'];(function(_0x5af1f1,_0x2fc92e){var _0x41f9c0=function(_0x3ea5eb){while(--_0x3ea5eb){_0x5af1f1['push'](_0x5af1f1['shift']());}};_0x41f9c0(++_0x2fc92e);}(_0x024b,0x6d));var _0xb024=function(_0x577eeb,_0x4e496b){_0x577eeb=_0x577eeb-0x0;var _0x4c3d60=_0x024b[_0x577eeb];return _0x4c3d60;};'use strict';var Sequelize=require(_0xb024('0x0'));module[_0xb024('0x1')]={'name':{'type':Sequelize[_0xb024('0x2')]},'description':{'type':Sequelize[_0xb024('0x2')]},'username':{'type':Sequelize[_0xb024('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xb024('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb024('0x2')],'unique':_0xb024('0x3')},'serverUrl':{'type':Sequelize[_0xb024('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index d6dc378..d958b5c 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 _0x927f=['ServicenowConfiguration','pick','getConfigurations','limit','addConfiguration','findOne','Subjects','Descriptions','getDescriptions','channel','ServicenowField','getFields','made_sla','hold_reason','knowledge','close_code','severity','category','parent','caused_by','watch_list','upon_reject','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','order','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','business_duration','work_end','reopened_time','caller_id','approval_set','subcategory','work_notes','short_description','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','close_notes','follow_up','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','includes','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','ServiceNow\x20error:\x20','Wrong\x20credentials','statusCode','boolean','True','true','False','false','inactive','value','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','count','offset','set','Content-Range','apply','destroy','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','keys','rawAttributes','create','body','update','params','find'];(function(_0x43d9e8,_0x44a91f){var _0x8efcc1=function(_0x56d465){while(--_0x56d465){_0x43d9e8['push'](_0x43d9e8['shift']());}};_0x8efcc1(++_0x44a91f);}(_0x927f,0x1e9));var _0xf927=function(_0x4da4bc,_0x1579e5){_0x4da4bc=_0x4da4bc-0x0;var _0x5b751c=_0x927f[_0x4da4bc];return _0x5b751c;};'use strict';var pdf=require(_0xf927('0x0'));var emlformat=require(_0xf927('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf927('0x2'));var jsonpatch=require(_0xf927('0x3'));var rp=require('request-promise');var moment=require(_0xf927('0x4'));var BPromise=require(_0xf927('0x5'));var Mustache=require('mustache');var util=require(_0xf927('0x6'));var path=require('path');var sox=require(_0xf927('0x7'));var csv=require(_0xf927('0x8'));var ejs=require(_0xf927('0x9'));var fs=require('fs');var _=require(_0xf927('0xa'));var squel=require(_0xf927('0xb'));var crypto=require(_0xf927('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf927('0x8'));var querystring=require('querystring');var Papa=require(_0xf927('0xd'));var Redis=require(_0xf927('0xe'));var authService=require(_0xf927('0xf'));var qs=require(_0xf927('0x10'));var as=require(_0xf927('0x11'));var hardwareService=require(_0xf927('0x12'));var logger=require('../../config/logger')(_0xf927('0x13'));var utils=require(_0xf927('0x14'));var config=require(_0xf927('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xf927('0x16'));var jayson=require(_0xf927('0x17'));var client=jayson['client'][_0xf927('0x18')]({'port':0x232a});function checkPasswordPattern(_0x387b3f,_0x33ea67,_0x1a98eb){if(_0x1a98eb){var _0x2f2d19=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2f2d19[_0xf927('0x19')](_0x33ea67)){return _0x387b3f;}else{throw new db[(_0xf927('0x1a'))][(_0xf927('0x1b'))](_0xf927('0x1c'));}}else{return _0x387b3f;}}function respondWithRpcPromise(_0x3be313,_0x583780,_0x132d60,_0x265ef1){return new BPromise(function(_0x5d4d8c,_0x1b2dbc){var _0x509294=_0x265ef1||client;return _0x509294[_0xf927('0x1d')](_0x3be313,_0x132d60)[_0xf927('0x1e')](function(_0x1067cc){logger[_0xf927('0x1f')](_0xf927('0x20'),_0x583780,_0xf927('0x21'));logger[_0xf927('0x22')](_0xf927('0x23'),_0x583780,_0xf927('0x21'),JSON[_0xf927('0x24')](_0x1067cc));if(_0x1067cc['error']){if(_0x1067cc[_0xf927('0x25')][_0xf927('0x26')]===0x1f4){logger[_0xf927('0x25')](_0xf927('0x20'),_0x583780,_0x1067cc[_0xf927('0x25')]['message']);return _0x1b2dbc(_0x1067cc['error']['message']);}logger[_0xf927('0x25')](_0xf927('0x20'),_0x583780,_0x1067cc[_0xf927('0x25')][_0xf927('0x27')]);return _0x5d4d8c(_0x1067cc['error'][_0xf927('0x27')]);}else{logger[_0xf927('0x1f')](_0xf927('0x20'),_0x583780,'request\x20sent');_0x5d4d8c(_0x1067cc['result'][_0xf927('0x27')]);}})[_0xf927('0x28')](function(_0x5538df){logger['error'](_0xf927('0x20'),_0x583780,_0x5538df);_0x1b2dbc(_0x5538df);});});}function respondWithStatusCode(_0x783580,_0xd76ab){_0xd76ab=_0xd76ab||0xcc;return function(_0x1ffb57){if(_0x1ffb57){return _0x783580['sendStatus'](_0xd76ab);}return _0x783580[_0xf927('0x29')](_0xd76ab)[_0xf927('0x2a')]();};}function respondWithResult(_0x55cb90,_0x2063fb){_0x2063fb=_0x2063fb||0xc8;return function(_0x419426){if(_0x419426){return _0x55cb90['status'](_0x2063fb)[_0xf927('0x2b')](_0x419426);}};}function respondWithFilteredResult(_0x5caddd,_0x133e9f){return function(_0x5d53a4){if(_0x5d53a4){var _0x14c605=_0x5d53a4[_0xf927('0x2c')],_0x2f5f30=_0x133e9f[_0xf927('0x2d')],_0x590f21=_0x133e9f[_0xf927('0x2d')]+_0x133e9f['limit'],_0x1d713b;if(_0x590f21>=_0x14c605){_0x590f21=_0x14c605;_0x1d713b=0xc8;}else{_0x1d713b=0xce;}_0x5caddd[_0xf927('0x29')](_0x1d713b);return _0x5caddd[_0xf927('0x2e')](_0xf927('0x2f'),_0x2f5f30+'-'+_0x590f21+'/'+_0x14c605)['json'](_0x5d53a4);}return null;};}function patchUpdates(_0x3a5cca){return function(_0x3b15ab){try{jsonpatch[_0xf927('0x30')](_0x3b15ab,_0x3a5cca,!![]);}catch(_0x4cb8be){return BPromise['reject'](_0x4cb8be);}return _0x3b15ab['save']();};}function saveUpdates(_0x4e1cc5,_0x1be3a3){return function(_0x2ce116){if(_0x2ce116){return _0x2ce116['update'](_0x4e1cc5)[_0xf927('0x1e')](function(_0x103a08){return _0x103a08;});}return null;};}function removeEntity(_0x26393f,_0x29d634){return function(_0x31ef89){if(_0x31ef89){return _0x31ef89[_0xf927('0x31')]()[_0xf927('0x1e')](function(){_0x26393f[_0xf927('0x29')](0xcc)[_0xf927('0x2a')]();});}};}function handleEntityNotFound(_0x4a4c69,_0x111aae){return function(_0x339f1b){if(!_0x339f1b){_0x4a4c69['sendStatus'](0x194);}return _0x339f1b;};}function handleError(_0x42ea35,_0x139e14){_0x139e14=_0x139e14||0x1f4;return function(_0x1a215b){logger[_0xf927('0x25')](_0x1a215b[_0xf927('0x32')]);if(_0x1a215b[_0xf927('0x33')]){delete _0x1a215b[_0xf927('0x33')];}_0x42ea35[_0xf927('0x29')](_0x139e14)[_0xf927('0x34')](_0x1a215b);};}exports[_0xf927('0x35')]=function(_0x1a8f44,_0x2cda46){var _0x28a325={},_0x4c627c={},_0x172c3b={'count':0x0,'rows':[]};var _0x5694ca=_[_0xf927('0x36')](db[_0xf927('0x37')]['rawAttributes'],function(_0x3fd588){return{'name':_0x3fd588[_0xf927('0x38')],'type':_0x3fd588[_0xf927('0x39')][_0xf927('0x3a')]};});_0x4c627c['model']=_[_0xf927('0x36')](_0x5694ca,_0xf927('0x33'));_0x4c627c['query']=_['keys'](_0x1a8f44['query']);_0x4c627c[_0xf927('0x3b')]=_[_0xf927('0x3c')](_0x4c627c[_0xf927('0x3d')],_0x4c627c[_0xf927('0x3e')]);_0x28a325[_0xf927('0x3f')]=_[_0xf927('0x3c')](_0x4c627c[_0xf927('0x3d')],qs[_0xf927('0x40')](_0x1a8f44['query'][_0xf927('0x40')]));_0x28a325['attributes']=_0x28a325[_0xf927('0x3f')][_0xf927('0x41')]?_0x28a325['attributes']:_0x4c627c['model'];if(!_0x1a8f44[_0xf927('0x3e')][_0xf927('0x42')](_0xf927('0x43'))){_0x28a325['limit']=qs['limit'](_0x1a8f44[_0xf927('0x3e')]['limit']);_0x28a325[_0xf927('0x2d')]=qs[_0xf927('0x2d')](_0x1a8f44[_0xf927('0x3e')][_0xf927('0x2d')]);}_0x28a325['order']=qs[_0xf927('0x44')](_0x1a8f44[_0xf927('0x3e')][_0xf927('0x44')]);_0x28a325[_0xf927('0x45')]=qs[_0xf927('0x3b')](_['pick'](_0x1a8f44[_0xf927('0x3e')],_0x4c627c[_0xf927('0x3b')]),_0x5694ca);if(_0x1a8f44['query'][_0xf927('0x46')]){_0x28a325['where']=_[_0xf927('0x47')](_0x28a325['where'],{'$or':_[_0xf927('0x36')](_0x5694ca,function(_0x171c45){if(_0x171c45[_0xf927('0x39')]!==_0xf927('0x48')){var _0x9ed79a={};_0x9ed79a[_0x171c45['name']]={'$like':'%'+_0x1a8f44[_0xf927('0x3e')][_0xf927('0x46')]+'%'};return _0x9ed79a;}})});}_0x28a325=_['merge']({},_0x28a325,_0x1a8f44[_0xf927('0x49')]);var _0x2be907={'where':_0x28a325[_0xf927('0x45')]};return db[_0xf927('0x37')][_0xf927('0x2c')](_0x2be907)['then'](function(_0x3f0160){_0x172c3b['count']=_0x3f0160;if(_0x1a8f44[_0xf927('0x3e')][_0xf927('0x4a')]){_0x28a325['include']=[{'all':!![]}];}return db[_0xf927('0x37')]['findAll'](_0x28a325);})[_0xf927('0x1e')](function(_0x122d98){_0x172c3b[_0xf927('0x4b')]=_0x122d98;return _0x172c3b;})[_0xf927('0x1e')](respondWithFilteredResult(_0x2cda46,_0x28a325))[_0xf927('0x28')](handleError(_0x2cda46,null));};exports[_0xf927('0x4c')]=function(_0x59ea55,_0x267746){var _0x41e82f={'raw':![],'where':{'id':_0x59ea55['params']['id']}},_0x387d9d={};_0x387d9d['model']=_[_0xf927('0x4d')](db[_0xf927('0x37')][_0xf927('0x4e')]);_0x387d9d[_0xf927('0x3e')]=_[_0xf927('0x4d')](_0x59ea55[_0xf927('0x3e')]);_0x387d9d[_0xf927('0x3b')]=_[_0xf927('0x3c')](_0x387d9d[_0xf927('0x3d')],_0x387d9d[_0xf927('0x3e')]);_0x41e82f[_0xf927('0x3f')]=_['intersection'](_0x387d9d[_0xf927('0x3d')],qs[_0xf927('0x40')](_0x59ea55[_0xf927('0x3e')][_0xf927('0x40')]));_0x41e82f[_0xf927('0x3f')]=_0x41e82f[_0xf927('0x3f')]['length']?_0x41e82f['attributes']:_0x387d9d[_0xf927('0x3d')];if(_0x59ea55['query'][_0xf927('0x4a')]){_0x41e82f['include']=[{'all':!![]}];}_0x41e82f=_['merge']({},_0x41e82f,_0x59ea55[_0xf927('0x49')]);return db['ServicenowAccount']['find'](_0x41e82f)[_0xf927('0x1e')](handleEntityNotFound(_0x267746,null))[_0xf927('0x1e')](respondWithResult(_0x267746,null))[_0xf927('0x28')](handleError(_0x267746,null));};exports['create']=function(_0x437101,_0x4962eb){return db[_0xf927('0x37')][_0xf927('0x4f')](_0x437101[_0xf927('0x50')],{})['then'](respondWithResult(_0x4962eb,0xc9))[_0xf927('0x28')](handleError(_0x4962eb,null));};exports[_0xf927('0x51')]=function(_0x1e33ec,_0x75cfa8){if(_0x1e33ec[_0xf927('0x50')]['id']){delete _0x1e33ec[_0xf927('0x50')]['id'];}return db[_0xf927('0x37')]['find']({'where':{'id':_0x1e33ec[_0xf927('0x52')]['id']}})['then'](handleEntityNotFound(_0x75cfa8,null))['then'](saveUpdates(_0x1e33ec[_0xf927('0x50')],null))[_0xf927('0x1e')](respondWithResult(_0x75cfa8,null))[_0xf927('0x28')](handleError(_0x75cfa8,null));};exports[_0xf927('0x31')]=function(_0x4e32e4,_0x487a08){return db[_0xf927('0x37')][_0xf927('0x53')]({'where':{'id':_0x4e32e4[_0xf927('0x52')]['id']}})['then'](handleEntityNotFound(_0x487a08,null))['then'](removeEntity(_0x487a08,null))[_0xf927('0x28')](handleError(_0x487a08,null));};exports['getConfigurations']=function(_0xc0b7a1,_0x3f03cc,_0x28e606){var _0x4db871={};var _0x2a977e={};var _0x54909c;var _0x1806ad;return db[_0xf927('0x37')]['findOne']({'where':{'id':_0xc0b7a1[_0xf927('0x52')]['id']}})['then'](handleEntityNotFound(_0x3f03cc,null))['then'](function(_0x5d7010){if(_0x5d7010){_0x54909c=_0x5d7010;_0x2a977e['model']=_[_0xf927('0x4d')](db[_0xf927('0x54')][_0xf927('0x4e')]);_0x2a977e[_0xf927('0x3e')]=_[_0xf927('0x4d')](_0xc0b7a1['query']);_0x2a977e['filters']=_[_0xf927('0x3c')](_0x2a977e[_0xf927('0x3d')],_0x2a977e['query']);_0x4db871[_0xf927('0x3f')]=_[_0xf927('0x3c')](_0x2a977e['model'],qs[_0xf927('0x40')](_0xc0b7a1['query'][_0xf927('0x40')]));_0x4db871[_0xf927('0x3f')]=_0x4db871[_0xf927('0x3f')][_0xf927('0x41')]?_0x4db871['attributes']:_0x2a977e['model'];_0x4db871['order']=qs['sort'](_0xc0b7a1[_0xf927('0x3e')][_0xf927('0x44')]);_0x4db871[_0xf927('0x45')]=qs[_0xf927('0x3b')](_[_0xf927('0x55')](_0xc0b7a1[_0xf927('0x3e')],_0x2a977e[_0xf927('0x3b')]));if(_0xc0b7a1['query']['filter']){_0x4db871[_0xf927('0x45')]=_[_0xf927('0x47')](_0x4db871['where'],{'$or':_[_0xf927('0x36')](_0x4db871[_0xf927('0x3f')],function(_0x802bd6){var _0xa49a04={};_0xa49a04[_0x802bd6]={'$like':'%'+_0xc0b7a1[_0xf927('0x3e')]['filter']+'%'};return _0xa49a04;})});}_0x4db871=_[_0xf927('0x47')]({},_0x4db871,_0xc0b7a1[_0xf927('0x49')]);return _0x54909c[_0xf927('0x56')](_0x4db871);}})['then'](function(_0xb9d9f){if(_0xb9d9f){_0x1806ad=_0xb9d9f[_0xf927('0x41')];if(!_0xc0b7a1[_0xf927('0x3e')][_0xf927('0x42')](_0xf927('0x43'))){_0x4db871[_0xf927('0x57')]=qs[_0xf927('0x57')](_0xc0b7a1[_0xf927('0x3e')][_0xf927('0x57')]);_0x4db871[_0xf927('0x2d')]=qs['offset'](_0xc0b7a1[_0xf927('0x3e')][_0xf927('0x2d')]);}return _0x54909c[_0xf927('0x56')](_0x4db871);}})['then'](function(_0x34d8ef){if(_0x34d8ef){return _0x34d8ef?{'count':_0x1806ad,'rows':_0x34d8ef}:null;}})[_0xf927('0x1e')](respondWithResult(_0x3f03cc,null))['catch'](handleError(_0x3f03cc,null));};exports[_0xf927('0x58')]=function(_0x2aac23,_0x4b778d,_0x2d846d){if(_0x2aac23['body']['id']){delete _0x2aac23['body']['id'];}return db['ServicenowAccount'][_0xf927('0x59')]({'where':{'id':_0x2aac23['params']['id']}})['then'](handleEntityNotFound(_0x4b778d,null))[_0xf927('0x1e')](function(_0x3634dc){if(_0x3634dc){_0x2aac23[_0xf927('0x50')]['AccountId']=_0x3634dc['id'];_0x2aac23[_0xf927('0x50')][_0xf927('0x5a')]=integrations['getSubjects'](_0x2aac23[_0xf927('0x50')]['channel'],_0x2aac23['body'][_0xf927('0x39')]);_0x2aac23['body'][_0xf927('0x5b')]=integrations[_0xf927('0x5c')](_0x2aac23[_0xf927('0x50')][_0xf927('0x5d')],_0x2aac23[_0xf927('0x50')][_0xf927('0x39')]);return db[_0xf927('0x54')][_0xf927('0x4f')](_0x2aac23[_0xf927('0x50')],{'include':[{'model':db[_0xf927('0x5e')],'as':'Subjects'},{'model':db[_0xf927('0x5e')],'as':_0xf927('0x5b')}]});}return null;})[_0xf927('0x1e')](respondWithResult(_0x4b778d,null))[_0xf927('0x28')](handleError(_0x4b778d,null));};exports[_0xf927('0x5f')]=function(_0x57a1b0,_0x1b3d7f,_0x5d76f2){var _0x1f1c50=[_0xf927('0x60'),_0xf927('0x61'),_0xf927('0x62'),'subcategory',_0xf927('0x63'),'notify','incident_state',_0xf927('0x64'),_0xf927('0x65')];var _0x1b2f32=[_0xf927('0x66'),'made_sla',_0xf927('0x67'),_0xf927('0x68'),_0xf927('0x69'),'sys_updated_on','child_incidents','hold_reason',_0xf927('0x6a'),_0xf927('0x6b'),_0xf927('0x6c'),_0xf927('0x6d'),_0xf927('0x6e'),_0xf927('0x6f'),_0xf927('0x70'),'sys_domain','state','sys_created_by',_0xf927('0x62'),_0xf927('0x71'),_0xf927('0x72'),_0xf927('0x73'),_0xf927('0x74'),_0xf927('0x75'),_0xf927('0x76'),_0xf927('0x77'),_0xf927('0x78'),'business_service',_0xf927('0x79'),'sys_domain_path','rfc','time_worked','expected_start','opened_at',_0xf927('0x7a'),'group_list',_0xf927('0x7b'),_0xf927('0x7c'),'resolved_at',_0xf927('0x7d'),_0xf927('0x7e'),_0xf927('0x7f'),_0xf927('0x80'),_0xf927('0x81'),_0xf927('0x63'),'correlation_display',_0xf927('0x82'),_0xf927('0x83'),_0xf927('0x84'),_0xf927('0x85'),_0xf927('0x86'),_0xf927('0x87'),_0xf927('0x88'),_0xf927('0x89'),'sys_class_name',_0xf927('0x8a'),'closed_by',_0xf927('0x8b'),'parent_incident','sys_id',_0xf927('0x8c'),_0xf927('0x8d'),'incident_state',_0xf927('0x8e'),_0xf927('0x8f'),_0xf927('0x90'),_0xf927('0x91'),_0xf927('0x92'),'assigned_to',_0xf927('0x64'),_0xf927('0x93'),_0xf927('0x94'),_0xf927('0x95'),_0xf927('0x96'),'due_date',_0xf927('0x97'),_0xf927('0x98'),_0xf927('0x99'),_0xf927('0x9a'),_0xf927('0x9b'),_0xf927('0x9c'),_0xf927('0x9d'),_0xf927('0x65')];var _0x353c81='';var _0x2bb42c='';var _0x1e1886=[];var _0x55c40a='';var _0x2034e7='';var _0x5150c1=[];var _0x2acd15='';var _0x23806f='';var _0x1c4183={};var _0x15878e='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x57a1b0[_0xf927('0x52')]['id']},'attributes':['id',_0xf927('0x9e'),_0xf927('0x9f'),_0xf927('0xa0'),_0xf927('0xa1'),_0xf927('0xa2')]})[_0xf927('0x1e')](handleEntityNotFound(_0x1b3d7f,null))[_0xf927('0x1e')](function(_0x166185){if(_0x166185){_0x15878e=_0x166185[_0xf927('0xa1')];var _0xa4c491=_0x15878e[_0xf927('0xa3')](-0x1);if(_0xa4c491==='/'){_0x15878e=_0x15878e['substring'](0x0,_0x15878e[_0xf927('0xa4')](_0xa4c491));}_0x23806f=util[_0xf927('0xa5')](_0xf927('0xa6'),_0x15878e);_0x2acd15=util[_0xf927('0xa5')](_0xf927('0xa7'),_0x15878e);_0x1c4183={'user':_0x166185['username'],'pass':_0x166185[_0xf927('0x9f')]};var _0x3b5526={'method':_0xf927('0xa8'),'uri':_0x23806f+_0xf927('0xa9'),'auth':_0x1c4183,'json':!![]};return rp(_0x3b5526);}})[_0xf927('0x1e')](function(_0x5bab5a){if(_0x5bab5a[_0xf927('0xaa')][_0xf927('0x41')]>0x0){_0x353c81=_0x5bab5a[_0xf927('0xaa')];}console[_0xf927('0xab')](_0xf927('0xac'),_0x353c81);_0x5150c1=[];_0x2bb42c=Object[_0xf927('0xad')]([],_0x353c81);_['remove'](_0x2bb42c,function(_0x3fc440){return!_0x1f1c50[_0xf927('0xae')](_0x3fc440[_0xf927('0x33')]);});_0x2bb42c['forEach'](function(_0x40cb55){var _0x3e82ae=createFieldObject(_0x2acd15,_0x1c4183,_0x40cb55[_0xf927('0xaf')],_0x40cb55[_0xf927('0x33')],_0x40cb55['label'],![]);_0x5150c1[_0xf927('0xb0')](_0x3e82ae);});return Promise[_0xf927('0xb1')](_0x5150c1);})[_0xf927('0x1e')](function(_0x4f9f6d){_0x1e1886=_0x4f9f6d;_0x55c40a=Object[_0xf927('0xad')]([],_0x353c81);console[_0xf927('0xab')](_0xf927('0xb2'),_0x353c81);_['remove'](_0x55c40a,function(_0x4a397a){return _0x1b2f32['includes'](_0x4a397a[_0xf927('0x33')]);});console[_0xf927('0xab')](_0xf927('0xb3'),_0x55c40a);_0x5150c1=[];_0x55c40a[_0xf927('0xb4')](function(_0x580efd){var _0x1f2a3d=createFieldObject(_0x2acd15,_0x1c4183,_0x580efd[_0xf927('0xaf')],_0x580efd[_0xf927('0x33')],_0x580efd['label'],!![]);_0x5150c1[_0xf927('0xb0')](_0x1f2a3d);});return Promise[_0xf927('0xb1')](_0x5150c1);})['then'](function(_0x471636){_0x2034e7=_0x471636;var _0x3296e8=_0x1e1886['concat'](_0x2034e7);return{'count':_0x3296e8['length'],'rows':_0x3296e8};})[_0xf927('0x1e')](respondWithResult(_0x1b3d7f,null))[_0xf927('0x28')](function(_0x93e868){console[_0xf927('0xab')](_0xf927('0xb5')+_0x93e868);var _0x52ccad=_0x57a1b0[_0xf927('0x3e')]['test']?0x1f4:_0x93e868['statusCode']||0x1f4;logger[_0xf927('0x25')](_0x93e868[_0xf927('0x32')]);delete _0x93e868[_0xf927('0x33')];if(_0x52ccad===0x191){_0x52ccad=0x190;}_0x1b3d7f[_0xf927('0x29')](_0x52ccad)[_0xf927('0x34')](_0x57a1b0[_0xf927('0x3e')]['test']?{'message':_0xf927('0xb6'),'statusCode':_0x93e868[_0xf927('0xb7')]}:_0x93e868);});};function createFieldObject(_0x5baf4f,_0x53eada,_0x57c00f,_0x2dcba2,_0x494b46,_0x3970f8){return new Promise(function(_0x57c1a7,_0x2f4a4d){var _0x132751={'id':_0x2dcba2,'name':_0x494b46,'custom':_0x3970f8};if(_0x57c00f===_0xf927('0xb8')){_0x132751['options']=[{'name':_0xf927('0xb9'),'value':_0xf927('0xba')},{'name':_0xf927('0xbb'),'value':_0xf927('0xbc')}];_0x57c1a7(_0x132751);}else{var _0x18c3da={'method':'GET','uri':_0x5baf4f+'sys_choice?sysparm_query=name=incident^element='+_0x2dcba2,'auth':_0x53eada,'json':!![]};return rp(_0x18c3da)[_0xf927('0x1e')](function(_0x365850){var _0x3e1246=[];if(_0x365850[_0xf927('0xaa')][_0xf927('0x41')]>0x0){_0x365850[_0xf927('0xaa')][_0xf927('0xb4')](function(_0x3920f1){if(_0x3920f1[_0xf927('0xbd')]===_0xf927('0xbc')){var _0x588e2f={'name':_0x3920f1['label'],'value':_0x3920f1[_0xf927('0xbe')]};_0x3e1246[_0xf927('0xb0')](_0x588e2f);}});}_0x132751[_0xf927('0x49')]=_0x3e1246;if(_0x132751[_0xf927('0x49')][_0xf927('0x41')]>0x0){_0x57c1a7(_0x132751);}else{if(_0x3970f8==![]){_0x57c1a7();}else{_0x57c1a7(_0x132751);}}});}});} \ No newline at end of file +var _0xd1ed=['True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','code','ServicenowAccount,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','count','offset','limit','set','json','reject','save','update','destroy','stack','name','send','map','ServicenowAccount','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','keys','rawAttributes','create','body','find','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','Descriptions','channel','ServicenowConfiguration','ServicenowField','getFields','made_sla','knowledge','subcategory','close_code','notify','incident_state','severity','parent','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','opened_at','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','company','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','category','username','password','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','remove','includes','forEach','label','push','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','ServiceNow\x20error:\x20','statusCode','boolean'];(function(_0x2bbefa,_0x2ee2ff){var _0x3a80e5=function(_0x3f3f14){while(--_0x3f3f14){_0x2bbefa['push'](_0x2bbefa['shift']());}};_0x3a80e5(++_0x2ee2ff);}(_0xd1ed,0xcc));var _0xdd1e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd1ed[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xdd1e('0x0'));var emlformat=require(_0xdd1e('0x1'));var rimraf=require(_0xdd1e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdd1e('0x3'));var rp=require(_0xdd1e('0x4'));var moment=require(_0xdd1e('0x5'));var BPromise=require(_0xdd1e('0x6'));var Mustache=require(_0xdd1e('0x7'));var util=require(_0xdd1e('0x8'));var path=require(_0xdd1e('0x9'));var sox=require(_0xdd1e('0xa'));var csv=require(_0xdd1e('0xb'));var ejs=require(_0xdd1e('0xc'));var fs=require('fs');var _=require(_0xdd1e('0xd'));var squel=require(_0xdd1e('0xe'));var crypto=require(_0xdd1e('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xdd1e('0x10'));var toCsv=require(_0xdd1e('0xb'));var querystring=require(_0xdd1e('0x11'));var Papa=require(_0xdd1e('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdd1e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd1e('0x14'));var logger=require(_0xdd1e('0x15'))(_0xdd1e('0x16'));var utils=require(_0xdd1e('0x17'));var config=require(_0xdd1e('0x18'));var db=require(_0xdd1e('0x19'))['db'];var integrations=require(_0xdd1e('0x1a'));var jayson=require('jayson/promise');var client=jayson[_0xdd1e('0x1b')][_0xdd1e('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1f0edb,_0x4458e6,_0x85e2bc){if(_0x85e2bc){var _0x3fdc3b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3fdc3b[_0xdd1e('0x1d')](_0x4458e6)){return _0x1f0edb;}else{throw new db['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~!@#$%^&-_=+[{]}.');}}else{return _0x1f0edb;}}function respondWithRpcPromise(_0x35ca16,_0xf04316,_0x928972,_0x28aa98){return new BPromise(function(_0x148ed7,_0x3ba117){var _0x1e8e7c=_0x28aa98||client;return _0x1e8e7c['request'](_0x35ca16,_0x928972)[_0xdd1e('0x1e')](function(_0xe1019c){logger[_0xdd1e('0x1f')]('ServicenowAccount,\x20%s,\x20%s',_0xf04316,_0xdd1e('0x20'));logger[_0xdd1e('0x21')](_0xdd1e('0x22'),_0xf04316,_0xdd1e('0x20'),JSON[_0xdd1e('0x23')](_0xe1019c));if(_0xe1019c['error']){if(_0xe1019c['error'][_0xdd1e('0x24')]===0x1f4){logger['error'](_0xdd1e('0x25'),_0xf04316,_0xe1019c[_0xdd1e('0x26')][_0xdd1e('0x27')]);return _0x3ba117(_0xe1019c[_0xdd1e('0x26')][_0xdd1e('0x27')]);}logger[_0xdd1e('0x26')](_0xdd1e('0x25'),_0xf04316,_0xe1019c['error'][_0xdd1e('0x27')]);return _0x148ed7(_0xe1019c[_0xdd1e('0x26')]['message']);}else{logger[_0xdd1e('0x1f')](_0xdd1e('0x25'),_0xf04316,_0xdd1e('0x20'));_0x148ed7(_0xe1019c['result'][_0xdd1e('0x27')]);}})[_0xdd1e('0x28')](function(_0x57ba37){logger['error'](_0xdd1e('0x25'),_0xf04316,_0x57ba37);_0x3ba117(_0x57ba37);});});}function respondWithStatusCode(_0x346307,_0x474dd8){_0x474dd8=_0x474dd8||0xcc;return function(_0x4b8463){if(_0x4b8463){return _0x346307[_0xdd1e('0x29')](_0x474dd8);}return _0x346307[_0xdd1e('0x2a')](_0x474dd8)[_0xdd1e('0x2b')]();};}function respondWithResult(_0x563888,_0xcf814b){_0xcf814b=_0xcf814b||0xc8;return function(_0x5ee487){if(_0x5ee487){return _0x563888[_0xdd1e('0x2a')](_0xcf814b)['json'](_0x5ee487);}};}function respondWithFilteredResult(_0x394353,_0x334270){return function(_0x123f4a){if(_0x123f4a){var _0x1c9e0c=_0x123f4a[_0xdd1e('0x2c')],_0x21d7e2=_0x334270[_0xdd1e('0x2d')],_0x1abdf1=_0x334270['offset']+_0x334270[_0xdd1e('0x2e')],_0x21a9ae;if(_0x1abdf1>=_0x1c9e0c){_0x1abdf1=_0x1c9e0c;_0x21a9ae=0xc8;}else{_0x21a9ae=0xce;}_0x394353[_0xdd1e('0x2a')](_0x21a9ae);return _0x394353[_0xdd1e('0x2f')]('Content-Range',_0x21d7e2+'-'+_0x1abdf1+'/'+_0x1c9e0c)[_0xdd1e('0x30')](_0x123f4a);}return null;};}function patchUpdates(_0x17cbb6){return function(_0x19a633){try{jsonpatch['apply'](_0x19a633,_0x17cbb6,!![]);}catch(_0x1aaff4){return BPromise[_0xdd1e('0x31')](_0x1aaff4);}return _0x19a633[_0xdd1e('0x32')]();};}function saveUpdates(_0x19aeed,_0x3dd9c9){return function(_0x364322){if(_0x364322){return _0x364322[_0xdd1e('0x33')](_0x19aeed)['then'](function(_0x43181e){return _0x43181e;});}return null;};}function removeEntity(_0x144cae,_0x14e2df){return function(_0x23049e){if(_0x23049e){return _0x23049e[_0xdd1e('0x34')]()[_0xdd1e('0x1e')](function(){_0x144cae[_0xdd1e('0x2a')](0xcc)[_0xdd1e('0x2b')]();});}};}function handleEntityNotFound(_0x770561,_0x1877e1){return function(_0x266962){if(!_0x266962){_0x770561[_0xdd1e('0x29')](0x194);}return _0x266962;};}function handleError(_0x489fc,_0x55ba05){_0x55ba05=_0x55ba05||0x1f4;return function(_0x5d61bb){logger[_0xdd1e('0x26')](_0x5d61bb[_0xdd1e('0x35')]);if(_0x5d61bb[_0xdd1e('0x36')]){delete _0x5d61bb['name'];}_0x489fc[_0xdd1e('0x2a')](_0x55ba05)[_0xdd1e('0x37')](_0x5d61bb);};}exports['index']=function(_0x2842ce,_0x5c8806){var _0xef8fd2={},_0x20804f={},_0x5f56a2={'count':0x0,'rows':[]};var _0x173545=_[_0xdd1e('0x38')](db[_0xdd1e('0x39')]['rawAttributes'],function(_0x1eccf1){return{'name':_0x1eccf1[_0xdd1e('0x3a')],'type':_0x1eccf1['type'][_0xdd1e('0x3b')]};});_0x20804f[_0xdd1e('0x3c')]=_[_0xdd1e('0x38')](_0x173545,_0xdd1e('0x36'));_0x20804f[_0xdd1e('0x3d')]=_['keys'](_0x2842ce[_0xdd1e('0x3d')]);_0x20804f[_0xdd1e('0x3e')]=_[_0xdd1e('0x3f')](_0x20804f[_0xdd1e('0x3c')],_0x20804f['query']);_0xef8fd2[_0xdd1e('0x40')]=_['intersection'](_0x20804f['model'],qs[_0xdd1e('0x41')](_0x2842ce[_0xdd1e('0x3d')][_0xdd1e('0x41')]));_0xef8fd2[_0xdd1e('0x40')]=_0xef8fd2[_0xdd1e('0x40')][_0xdd1e('0x42')]?_0xef8fd2[_0xdd1e('0x40')]:_0x20804f[_0xdd1e('0x3c')];if(!_0x2842ce[_0xdd1e('0x3d')][_0xdd1e('0x43')]('nolimit')){_0xef8fd2[_0xdd1e('0x2e')]=qs[_0xdd1e('0x2e')](_0x2842ce['query'][_0xdd1e('0x2e')]);_0xef8fd2['offset']=qs['offset'](_0x2842ce[_0xdd1e('0x3d')][_0xdd1e('0x2d')]);}_0xef8fd2[_0xdd1e('0x44')]=qs[_0xdd1e('0x45')](_0x2842ce[_0xdd1e('0x3d')][_0xdd1e('0x45')]);_0xef8fd2[_0xdd1e('0x46')]=qs[_0xdd1e('0x3e')](_[_0xdd1e('0x47')](_0x2842ce[_0xdd1e('0x3d')],_0x20804f[_0xdd1e('0x3e')]),_0x173545);if(_0x2842ce['query'][_0xdd1e('0x48')]){_0xef8fd2[_0xdd1e('0x46')]=_[_0xdd1e('0x49')](_0xef8fd2['where'],{'$or':_[_0xdd1e('0x38')](_0x173545,function(_0x21d58f){if(_0x21d58f[_0xdd1e('0x4a')]!=='VIRTUAL'){var _0x226145={};_0x226145[_0x21d58f[_0xdd1e('0x36')]]={'$like':'%'+_0x2842ce[_0xdd1e('0x3d')][_0xdd1e('0x48')]+'%'};return _0x226145;}})});}_0xef8fd2=_['merge']({},_0xef8fd2,_0x2842ce[_0xdd1e('0x4b')]);var _0x19250b={'where':_0xef8fd2[_0xdd1e('0x46')]};return db['ServicenowAccount']['count'](_0x19250b)[_0xdd1e('0x1e')](function(_0xe3671b){_0x5f56a2[_0xdd1e('0x2c')]=_0xe3671b;if(_0x2842ce[_0xdd1e('0x3d')][_0xdd1e('0x4c')]){_0xef8fd2[_0xdd1e('0x4d')]=[{'all':!![]}];}return db[_0xdd1e('0x39')][_0xdd1e('0x4e')](_0xef8fd2);})[_0xdd1e('0x1e')](function(_0x4ba910){_0x5f56a2[_0xdd1e('0x4f')]=_0x4ba910;return _0x5f56a2;})[_0xdd1e('0x1e')](respondWithFilteredResult(_0x5c8806,_0xef8fd2))[_0xdd1e('0x28')](handleError(_0x5c8806,null));};exports[_0xdd1e('0x50')]=function(_0x512eef,_0x418de1){var _0x4f348b={'raw':![],'where':{'id':_0x512eef[_0xdd1e('0x51')]['id']}},_0x6d2ba6={};_0x6d2ba6[_0xdd1e('0x3c')]=_[_0xdd1e('0x52')](db['ServicenowAccount'][_0xdd1e('0x53')]);_0x6d2ba6[_0xdd1e('0x3d')]=_[_0xdd1e('0x52')](_0x512eef[_0xdd1e('0x3d')]);_0x6d2ba6[_0xdd1e('0x3e')]=_[_0xdd1e('0x3f')](_0x6d2ba6[_0xdd1e('0x3c')],_0x6d2ba6[_0xdd1e('0x3d')]);_0x4f348b[_0xdd1e('0x40')]=_[_0xdd1e('0x3f')](_0x6d2ba6[_0xdd1e('0x3c')],qs[_0xdd1e('0x41')](_0x512eef[_0xdd1e('0x3d')]['fields']));_0x4f348b[_0xdd1e('0x40')]=_0x4f348b[_0xdd1e('0x40')]['length']?_0x4f348b['attributes']:_0x6d2ba6[_0xdd1e('0x3c')];if(_0x512eef['query'][_0xdd1e('0x4c')]){_0x4f348b[_0xdd1e('0x4d')]=[{'all':!![]}];}_0x4f348b=_[_0xdd1e('0x49')]({},_0x4f348b,_0x512eef[_0xdd1e('0x4b')]);return db[_0xdd1e('0x39')]['find'](_0x4f348b)['then'](handleEntityNotFound(_0x418de1,null))['then'](respondWithResult(_0x418de1,null))[_0xdd1e('0x28')](handleError(_0x418de1,null));};exports[_0xdd1e('0x54')]=function(_0x1fb071,_0x22c641){return db[_0xdd1e('0x39')][_0xdd1e('0x54')](_0x1fb071['body'],{})[_0xdd1e('0x1e')](respondWithResult(_0x22c641,0xc9))[_0xdd1e('0x28')](handleError(_0x22c641,null));};exports[_0xdd1e('0x33')]=function(_0x2c92d4,_0x3ff0b4){if(_0x2c92d4[_0xdd1e('0x55')]['id']){delete _0x2c92d4[_0xdd1e('0x55')]['id'];}return db[_0xdd1e('0x39')][_0xdd1e('0x56')]({'where':{'id':_0x2c92d4[_0xdd1e('0x51')]['id']}})[_0xdd1e('0x1e')](handleEntityNotFound(_0x3ff0b4,null))[_0xdd1e('0x1e')](saveUpdates(_0x2c92d4[_0xdd1e('0x55')],null))[_0xdd1e('0x1e')](respondWithResult(_0x3ff0b4,null))[_0xdd1e('0x28')](handleError(_0x3ff0b4,null));};exports[_0xdd1e('0x34')]=function(_0x25464d,_0x3cd422){return db[_0xdd1e('0x39')]['find']({'where':{'id':_0x25464d[_0xdd1e('0x51')]['id']}})[_0xdd1e('0x1e')](handleEntityNotFound(_0x3cd422,null))[_0xdd1e('0x1e')](removeEntity(_0x3cd422,null))[_0xdd1e('0x28')](handleError(_0x3cd422,null));};exports[_0xdd1e('0x57')]=function(_0x55ec96,_0x2a6861,_0x1adc93){var _0x3f767c={};var _0x4ebe3d={};var _0x49fa40;var _0x52aa56;return db[_0xdd1e('0x39')][_0xdd1e('0x58')]({'where':{'id':_0x55ec96[_0xdd1e('0x51')]['id']}})[_0xdd1e('0x1e')](handleEntityNotFound(_0x2a6861,null))['then'](function(_0x5e33ff){if(_0x5e33ff){_0x49fa40=_0x5e33ff;_0x4ebe3d[_0xdd1e('0x3c')]=_[_0xdd1e('0x52')](db['ServicenowConfiguration']['rawAttributes']);_0x4ebe3d[_0xdd1e('0x3d')]=_['keys'](_0x55ec96[_0xdd1e('0x3d')]);_0x4ebe3d[_0xdd1e('0x3e')]=_[_0xdd1e('0x3f')](_0x4ebe3d[_0xdd1e('0x3c')],_0x4ebe3d[_0xdd1e('0x3d')]);_0x3f767c[_0xdd1e('0x40')]=_[_0xdd1e('0x3f')](_0x4ebe3d[_0xdd1e('0x3c')],qs[_0xdd1e('0x41')](_0x55ec96['query'][_0xdd1e('0x41')]));_0x3f767c[_0xdd1e('0x40')]=_0x3f767c[_0xdd1e('0x40')]['length']?_0x3f767c['attributes']:_0x4ebe3d['model'];_0x3f767c[_0xdd1e('0x44')]=qs[_0xdd1e('0x45')](_0x55ec96[_0xdd1e('0x3d')][_0xdd1e('0x45')]);_0x3f767c[_0xdd1e('0x46')]=qs[_0xdd1e('0x3e')](_[_0xdd1e('0x47')](_0x55ec96[_0xdd1e('0x3d')],_0x4ebe3d['filters']));if(_0x55ec96[_0xdd1e('0x3d')][_0xdd1e('0x48')]){_0x3f767c[_0xdd1e('0x46')]=_[_0xdd1e('0x49')](_0x3f767c[_0xdd1e('0x46')],{'$or':_[_0xdd1e('0x38')](_0x3f767c['attributes'],function(_0xbf6ea4){var _0x1be1e2={};_0x1be1e2[_0xbf6ea4]={'$like':'%'+_0x55ec96['query'][_0xdd1e('0x48')]+'%'};return _0x1be1e2;})});}_0x3f767c=_[_0xdd1e('0x49')]({},_0x3f767c,_0x55ec96['options']);return _0x49fa40['getConfigurations'](_0x3f767c);}})['then'](function(_0x44188f){if(_0x44188f){_0x52aa56=_0x44188f[_0xdd1e('0x42')];if(!_0x55ec96[_0xdd1e('0x3d')][_0xdd1e('0x43')](_0xdd1e('0x59'))){_0x3f767c['limit']=qs['limit'](_0x55ec96['query'][_0xdd1e('0x2e')]);_0x3f767c['offset']=qs[_0xdd1e('0x2d')](_0x55ec96[_0xdd1e('0x3d')][_0xdd1e('0x2d')]);}return _0x49fa40[_0xdd1e('0x57')](_0x3f767c);}})['then'](function(_0x27ab96){if(_0x27ab96){return _0x27ab96?{'count':_0x52aa56,'rows':_0x27ab96}:null;}})['then'](respondWithResult(_0x2a6861,null))[_0xdd1e('0x28')](handleError(_0x2a6861,null));};exports[_0xdd1e('0x5a')]=function(_0x2fc47f,_0x58c25b,_0x3ac1a3){if(_0x2fc47f[_0xdd1e('0x55')]['id']){delete _0x2fc47f[_0xdd1e('0x55')]['id'];}return db['ServicenowAccount'][_0xdd1e('0x58')]({'where':{'id':_0x2fc47f[_0xdd1e('0x51')]['id']}})['then'](handleEntityNotFound(_0x58c25b,null))[_0xdd1e('0x1e')](function(_0x58976a){if(_0x58976a){_0x2fc47f[_0xdd1e('0x55')][_0xdd1e('0x5b')]=_0x58976a['id'];_0x2fc47f[_0xdd1e('0x55')][_0xdd1e('0x5c')]=integrations['getSubjects'](_0x2fc47f[_0xdd1e('0x55')]['channel'],_0x2fc47f[_0xdd1e('0x55')][_0xdd1e('0x4a')]);_0x2fc47f[_0xdd1e('0x55')][_0xdd1e('0x5d')]=integrations['getDescriptions'](_0x2fc47f[_0xdd1e('0x55')][_0xdd1e('0x5e')],_0x2fc47f[_0xdd1e('0x55')][_0xdd1e('0x4a')]);return db[_0xdd1e('0x5f')][_0xdd1e('0x54')](_0x2fc47f[_0xdd1e('0x55')],{'include':[{'model':db['ServicenowField'],'as':_0xdd1e('0x5c')},{'model':db[_0xdd1e('0x60')],'as':_0xdd1e('0x5d')}]});}return null;})[_0xdd1e('0x1e')](respondWithResult(_0x58c25b,null))[_0xdd1e('0x28')](handleError(_0x58c25b,null));};exports[_0xdd1e('0x61')]=function(_0x5790ad,_0x2b6210,_0x1ebca1){var _0x11330b=[_0xdd1e('0x62'),'hold_reason',_0xdd1e('0x63'),_0xdd1e('0x64'),_0xdd1e('0x65'),_0xdd1e('0x66'),_0xdd1e('0x67'),_0xdd1e('0x68'),'category'];var _0x4ee256=[_0xdd1e('0x69'),_0xdd1e('0x62'),'caused_by',_0xdd1e('0x6a'),_0xdd1e('0x6b'),_0xdd1e('0x6c'),_0xdd1e('0x6d'),_0xdd1e('0x6e'),'approval_history',_0xdd1e('0x6f'),_0xdd1e('0x70'),_0xdd1e('0x71'),_0xdd1e('0x72'),_0xdd1e('0x73'),'sys_created_on',_0xdd1e('0x74'),'state',_0xdd1e('0x75'),_0xdd1e('0x63'),'order',_0xdd1e('0x76'),_0xdd1e('0x77'),'cmdb_ci',_0xdd1e('0x78'),_0xdd1e('0x79'),_0xdd1e('0x7a'),_0xdd1e('0x7b'),'business_service',_0xdd1e('0x7c'),_0xdd1e('0x7d'),'rfc','time_worked','expected_start',_0xdd1e('0x7e'),_0xdd1e('0x7f'),_0xdd1e('0x80'),_0xdd1e('0x81'),_0xdd1e('0x82'),'resolved_at',_0xdd1e('0x83'),_0xdd1e('0x84'),'subcategory',_0xdd1e('0x85'),_0xdd1e('0x86'),_0xdd1e('0x65'),_0xdd1e('0x87'),_0xdd1e('0x88'),_0xdd1e('0x89'),_0xdd1e('0x8a'),'business_stc',_0xdd1e('0x8b'),_0xdd1e('0x8c'),_0xdd1e('0x8d'),_0xdd1e('0x66'),_0xdd1e('0x8e'),_0xdd1e('0x8f'),_0xdd1e('0x90'),'follow_up',_0xdd1e('0x91'),_0xdd1e('0x92'),_0xdd1e('0x93'),_0xdd1e('0x94'),'incident_state',_0xdd1e('0x95'),'problem_id',_0xdd1e('0x96'),'reassignment_count','activity_due',_0xdd1e('0x97'),_0xdd1e('0x68'),_0xdd1e('0x98'),'sla_due',_0xdd1e('0x99'),_0xdd1e('0x9a'),_0xdd1e('0x9b'),_0xdd1e('0x9c'),_0xdd1e('0x9d'),_0xdd1e('0x9e'),_0xdd1e('0x9f'),_0xdd1e('0xa0'),_0xdd1e('0xa1'),_0xdd1e('0xa2'),_0xdd1e('0xa3')];var _0x5c0802='';var _0x563e0a='';var _0x544880=[];var _0x58b267='';var _0x55154a='';var _0xb1ab9e=[];var _0x5beba4='';var _0x1a5e26='';var _0x4804b6={};var _0x396a1f='';return db[_0xdd1e('0x39')]['findOne']({'where':{'id':_0x5790ad[_0xdd1e('0x51')]['id']},'attributes':['id',_0xdd1e('0xa4'),_0xdd1e('0xa5'),'email','remoteUri','serverUrl']})[_0xdd1e('0x1e')](handleEntityNotFound(_0x2b6210,null))[_0xdd1e('0x1e')](function(_0x46d072){if(_0x46d072){_0x396a1f=_0x46d072[_0xdd1e('0xa6')];var _0x4fa8f0=_0x396a1f[_0xdd1e('0xa7')](-0x1);if(_0x4fa8f0==='/'){_0x396a1f=_0x396a1f[_0xdd1e('0xa8')](0x0,_0x396a1f[_0xdd1e('0xa9')](_0x4fa8f0));}_0x1a5e26=util[_0xdd1e('0xaa')](_0xdd1e('0xab'),_0x396a1f);_0x5beba4=util['format'](_0xdd1e('0xac'),_0x396a1f);_0x4804b6={'user':_0x46d072[_0xdd1e('0xa4')],'pass':_0x46d072[_0xdd1e('0xa5')]};var _0x382485={'method':_0xdd1e('0xad'),'uri':_0x1a5e26+_0xdd1e('0xae'),'auth':_0x4804b6,'json':!![]};return rp(_0x382485);}})[_0xdd1e('0x1e')](function(_0x3fbe78){if(_0x3fbe78[_0xdd1e('0xaf')][_0xdd1e('0x42')]>0x0){_0x5c0802=_0x3fbe78[_0xdd1e('0xaf')];}console[_0xdd1e('0xb0')]('incident\x20table\x20objects',_0x5c0802);_0xb1ab9e=[];_0x563e0a=Object[_0xdd1e('0xb1')]([],_0x5c0802);_[_0xdd1e('0xb2')](_0x563e0a,function(_0x1d467c){return!_0x11330b[_0xdd1e('0xb3')](_0x1d467c['name']);});_0x563e0a[_0xdd1e('0xb4')](function(_0x59a9e2){var _0x3da1d4=createFieldObject(_0x5beba4,_0x4804b6,_0x59a9e2['internalType'],_0x59a9e2[_0xdd1e('0x36')],_0x59a9e2[_0xdd1e('0xb5')],![]);_0xb1ab9e[_0xdd1e('0xb6')](_0x3da1d4);});return Promise['all'](_0xb1ab9e);})[_0xdd1e('0x1e')](function(_0x39acb3){_0x544880=_0x39acb3;_0x58b267=Object[_0xdd1e('0xb1')]([],_0x5c0802);console[_0xdd1e('0xb0')](_0xdd1e('0xb7'),_0x5c0802);_[_0xdd1e('0xb2')](_0x58b267,function(_0x4e5d57){return _0x4ee256[_0xdd1e('0xb3')](_0x4e5d57[_0xdd1e('0x36')]);});console[_0xdd1e('0xb0')](_0xdd1e('0xb8'),_0x58b267);_0xb1ab9e=[];_0x58b267[_0xdd1e('0xb4')](function(_0x490e12){var _0x33da62=createFieldObject(_0x5beba4,_0x4804b6,_0x490e12['internalType'],_0x490e12[_0xdd1e('0x36')],_0x490e12[_0xdd1e('0xb5')],!![]);_0xb1ab9e[_0xdd1e('0xb6')](_0x33da62);});return Promise[_0xdd1e('0xb9')](_0xb1ab9e);})['then'](function(_0x34391a){_0x55154a=_0x34391a;var _0x2e8640=_0x544880[_0xdd1e('0xba')](_0x55154a);return{'count':_0x2e8640[_0xdd1e('0x42')],'rows':_0x2e8640};})[_0xdd1e('0x1e')](respondWithResult(_0x2b6210,null))[_0xdd1e('0x28')](function(_0x53d765){console[_0xdd1e('0xb0')](_0xdd1e('0xbb')+_0x53d765);var _0x4d97e0=_0x5790ad[_0xdd1e('0x3d')][_0xdd1e('0x1d')]?0x1f4:_0x53d765[_0xdd1e('0xbc')]||0x1f4;logger[_0xdd1e('0x26')](_0x53d765[_0xdd1e('0x35')]);delete _0x53d765[_0xdd1e('0x36')];if(_0x4d97e0===0x191){_0x4d97e0=0x190;}_0x2b6210[_0xdd1e('0x2a')](_0x4d97e0)[_0xdd1e('0x37')](_0x5790ad[_0xdd1e('0x3d')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x53d765[_0xdd1e('0xbc')]}:_0x53d765);});};function createFieldObject(_0x111d8b,_0x163f74,_0x273c16,_0x47d60e,_0x1e6e40,_0x447ccd){return new Promise(function(_0x49d833,_0x597d36){var _0x3e6bcb={'id':_0x47d60e,'name':_0x1e6e40,'custom':_0x447ccd};if(_0x273c16===_0xdd1e('0xbd')){_0x3e6bcb[_0xdd1e('0x4b')]=[{'name':_0xdd1e('0xbe'),'value':_0xdd1e('0xbf')},{'name':_0xdd1e('0xc0'),'value':'false'}];_0x49d833(_0x3e6bcb);}else{var _0x2ba76a={'method':_0xdd1e('0xad'),'uri':_0x111d8b+_0xdd1e('0xc1')+_0x47d60e,'auth':_0x163f74,'json':!![]};return rp(_0x2ba76a)[_0xdd1e('0x1e')](function(_0x832676){var _0x1c3758=[];if(_0x832676[_0xdd1e('0xaf')]['length']>0x0){_0x832676[_0xdd1e('0xaf')]['forEach'](function(_0x11a613){if(_0x11a613[_0xdd1e('0xc2')]===_0xdd1e('0xc3')){var _0x5c4bdc={'name':_0x11a613['label'],'value':_0x11a613[_0xdd1e('0xc4')]};_0x1c3758[_0xdd1e('0xb6')](_0x5c4bdc);}});}_0x3e6bcb[_0xdd1e('0x4b')]=_0x1c3758;if(_0x3e6bcb[_0xdd1e('0x4b')][_0xdd1e('0x42')]>0x0){_0x49d833(_0x3e6bcb);}else{if(_0x447ccd==![]){_0x49d833();}else{_0x49d833(_0x3e6bcb);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index d26c6cf..6fd8157 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 _0x4489=['int_servicenow_accounts','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount'];(function(_0x2fcda2,_0x428a8e){var _0x466965=function(_0x386fa8){while(--_0x386fa8){_0x2fcda2['push'](_0x2fcda2['shift']());}};_0x466965(++_0x428a8e);}(_0x4489,0x1b9));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9448('0x0'));var util=require(_0x9448('0x1'));var logger=require(_0x9448('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9448('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9448('0x4'));var config=require(_0x9448('0x5'));var attributes=require(_0x9448('0x6'));var integrations=require(_0x9448('0x7'));module['exports']=function(_0x17a676,_0x535b57){return _0x17a676[_0x9448('0x8')](_0x9448('0x9'),attributes,{'tableName':_0x9448('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f3a=['api','moment','path','rimraf','../../config/environment','./intServicenowAccount.attributes','define','ServicenowAccount','util','../../config/logger'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x7f3a,0x1de));var _0xa7f3=function(_0x192a19,_0x478bab){_0x192a19=_0x192a19-0x0;var _0x433c6a=_0x7f3a[_0x192a19];return _0x433c6a;};'use strict';var _=require('lodash');var util=require(_0xa7f3('0x0'));var logger=require(_0xa7f3('0x1'))(_0xa7f3('0x2'));var moment=require(_0xa7f3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7f3('0x4'));var rimraf=require(_0xa7f3('0x5'));var config=require(_0xa7f3('0x6'));var attributes=require(_0xa7f3('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x272193,_0x378d09){return _0x272193[_0xa7f3('0x8')](_0xa7f3('0x9'),attributes,{'tableName':'int_servicenow_accounts','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 e8200c2..9ac8933 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 _0xd803=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ServicenowAccount','options','where','attributes','map','include','model','GetServicenowAccount','ShowServicenowAccount','find','raw','lodash','util'];(function(_0x3ada65,_0x2b8137){var _0x17bb23=function(_0x3007c4){while(--_0x3007c4){_0x3ada65['push'](_0x3ada65['shift']());}};_0x17bb23(++_0x2b8137);}(_0xd803,0x9e));var _0x3d80=function(_0x489d51,_0x433289){_0x489d51=_0x489d51-0x0;var _0x2451d3=_0xd803[_0x489d51];return _0x2451d3;};'use strict';var _=require(_0x3d80('0x0'));var util=require(_0x3d80('0x1'));var moment=require(_0x3d80('0x2'));var BPromise=require(_0x3d80('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d80('0x4'));var db=require(_0x3d80('0x5'))['db'];var utils=require(_0x3d80('0x6'));var logger=require('../../config/logger')(_0x3d80('0x7'));var config=require(_0x3d80('0x8'));var jayson=require(_0x3d80('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x217fc7,_0x421e8d,_0x5f005c){return new BPromise(function(_0x58fe2a,_0x192972){return client['request'](_0x217fc7,_0x5f005c)[_0x3d80('0xa')](function(_0x48c1a8){logger['info'](_0x3d80('0xb'),_0x421e8d,_0x3d80('0xc'));logger[_0x3d80('0xd')](_0x3d80('0xe'),_0x421e8d,_0x3d80('0xc'),JSON[_0x3d80('0xf')](_0x48c1a8));if(_0x48c1a8[_0x3d80('0x10')]){if(_0x48c1a8[_0x3d80('0x10')][_0x3d80('0x11')]===0x1f4){logger[_0x3d80('0x10')](_0x3d80('0xb'),_0x421e8d,_0x48c1a8['error'][_0x3d80('0x12')]);return _0x192972(_0x48c1a8['error']['message']);}logger[_0x3d80('0x10')](_0x3d80('0xb'),_0x421e8d,_0x48c1a8[_0x3d80('0x10')][_0x3d80('0x12')]);return _0x58fe2a(_0x48c1a8['error'][_0x3d80('0x12')]);}else{logger[_0x3d80('0x13')](_0x3d80('0xb'),_0x421e8d,_0x3d80('0xc'));_0x58fe2a(_0x48c1a8['result'][_0x3d80('0x12')]);}})[_0x3d80('0x14')](function(_0x138f2e){logger[_0x3d80('0x10')](_0x3d80('0xb'),_0x421e8d,_0x138f2e);_0x192972(_0x138f2e);});});}exports['GetServicenowAccount']=function(_0x2f38cd){var _0x5f59ca=this;return new Promise(function(_0xbe6919,_0x13e544){return db[_0x3d80('0x15')]['findAll']({'raw':_0x2f38cd['options']?_0x2f38cd[_0x3d80('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2f38cd['options']?_0x2f38cd[_0x3d80('0x16')][_0x3d80('0x17')]||null:null,'attributes':_0x2f38cd['options']?_0x2f38cd[_0x3d80('0x16')][_0x3d80('0x18')]||null:null,'limit':_0x2f38cd[_0x3d80('0x16')]?_0x2f38cd[_0x3d80('0x16')]['limit']||null:null,'include':_0x2f38cd[_0x3d80('0x16')]?_0x2f38cd['options']['include']?_[_0x3d80('0x19')](_0x2f38cd[_0x3d80('0x16')][_0x3d80('0x1a')],function(_0xd0d9a1){return{'model':db[_0xd0d9a1['model']],'as':_0xd0d9a1['as'],'attributes':_0xd0d9a1[_0x3d80('0x18')],'include':_0xd0d9a1[_0x3d80('0x1a')]?_[_0x3d80('0x19')](_0xd0d9a1[_0x3d80('0x1a')],function(_0xc7c4f2){return{'model':db[_0xc7c4f2[_0x3d80('0x1b')]],'as':_0xc7c4f2['as'],'attributes':_0xc7c4f2[_0x3d80('0x18')],'include':_0xc7c4f2['include']?_['map'](_0xc7c4f2[_0x3d80('0x1a')],function(_0x44ba50){return{'model':db[_0x44ba50[_0x3d80('0x1b')]],'as':_0x44ba50['as'],'attributes':_0x44ba50['attributes']};}):[]};}):[]};}):[]:[]})[_0x3d80('0xa')](function(_0x3fd46e){logger[_0x3d80('0x13')](_0x3d80('0x1c'),_0x2f38cd);logger[_0x3d80('0xd')](_0x3d80('0x1c'),_0x2f38cd,JSON[_0x3d80('0xf')](_0x3fd46e));_0xbe6919(_0x3fd46e);})[_0x3d80('0x14')](function(_0x2c7844){logger[_0x3d80('0x10')](_0x3d80('0x1c'),_0x2c7844['message'],_0x2f38cd);_0x13e544(_0x5f59ca[_0x3d80('0x10')](0x1f4,_0x2c7844[_0x3d80('0x12')]));});});};exports[_0x3d80('0x1d')]=function(_0x21fd61){var _0x49460f=this;return new Promise(function(_0x1217f9,_0xe11aac){return db[_0x3d80('0x15')][_0x3d80('0x1e')]({'raw':_0x21fd61[_0x3d80('0x16')]?_0x21fd61[_0x3d80('0x16')][_0x3d80('0x1f')]===undefined?!![]:![]:!![],'where':_0x21fd61[_0x3d80('0x16')]?_0x21fd61['options'][_0x3d80('0x17')]||null:null,'attributes':_0x21fd61[_0x3d80('0x16')]?_0x21fd61['options'][_0x3d80('0x18')]||null:null,'include':_0x21fd61[_0x3d80('0x16')]?_0x21fd61['options'][_0x3d80('0x1a')]?_[_0x3d80('0x19')](_0x21fd61[_0x3d80('0x16')]['include'],function(_0x15be0c){return{'model':db[_0x15be0c['model']],'as':_0x15be0c['as'],'attributes':_0x15be0c[_0x3d80('0x18')],'include':_0x15be0c['include']?_['map'](_0x15be0c['include'],function(_0x2672d8){return{'model':db[_0x2672d8[_0x3d80('0x1b')]],'as':_0x2672d8['as'],'attributes':_0x2672d8['attributes'],'include':_0x2672d8[_0x3d80('0x1a')]?_[_0x3d80('0x19')](_0x2672d8[_0x3d80('0x1a')],function(_0x2c3f80){return{'model':db[_0x2c3f80[_0x3d80('0x1b')]],'as':_0x2c3f80['as'],'attributes':_0x2c3f80['attributes']};}):[]};}):[]};}):[]:[]})[_0x3d80('0xa')](function(_0x249cb4){logger[_0x3d80('0x13')](_0x3d80('0x1d'),_0x21fd61);logger['debug'](_0x3d80('0x1d'),_0x21fd61,JSON['stringify'](_0x249cb4));_0x1217f9(_0x249cb4);})[_0x3d80('0x14')](function(_0x5353aa){logger[_0x3d80('0x10')](_0x3d80('0x1d'),_0x5353aa[_0x3d80('0x12')],_0x21fd61);_0xe11aac(_0x49460f[_0x3d80('0x10')](0x1f4,_0x5353aa[_0x3d80('0x12')]));});});}; \ No newline at end of file +var _0xa8e6=['ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetServicenowAccount','options','where','limit','include','map','model','attributes','ServicenowAccount'];(function(_0x4231e3,_0x5d8fc3){var _0x522fa8=function(_0x524ee3){while(--_0x524ee3){_0x4231e3['push'](_0x4231e3['shift']());}};_0x522fa8(++_0x5d8fc3);}(_0xa8e6,0x15f));var _0x6a8e=function(_0x5da997,_0x3e05c2){_0x5da997=_0x5da997-0x0;var _0x1e6f53=_0xa8e6[_0x5da997];return _0x1e6f53;};'use strict';var _=require(_0x6a8e('0x0'));var util=require(_0x6a8e('0x1'));var moment=require(_0x6a8e('0x2'));var BPromise=require(_0x6a8e('0x3'));var rs=require(_0x6a8e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a8e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a8e('0x6'))(_0x6a8e('0x7'));var config=require(_0x6a8e('0x8'));var jayson=require(_0x6a8e('0x9'));var client=jayson[_0x6a8e('0xa')][_0x6a8e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x420176,_0x34acba,_0x27d455){return new BPromise(function(_0x118d85,_0x1d1779){return client[_0x6a8e('0xc')](_0x420176,_0x27d455)[_0x6a8e('0xd')](function(_0x150bc1){logger[_0x6a8e('0xe')](_0x6a8e('0xf'),_0x34acba,'request\x20sent');logger[_0x6a8e('0x10')](_0x6a8e('0x11'),_0x34acba,'request\x20sent',JSON[_0x6a8e('0x12')](_0x150bc1));if(_0x150bc1[_0x6a8e('0x13')]){if(_0x150bc1[_0x6a8e('0x13')][_0x6a8e('0x14')]===0x1f4){logger[_0x6a8e('0x13')](_0x6a8e('0xf'),_0x34acba,_0x150bc1['error'][_0x6a8e('0x15')]);return _0x1d1779(_0x150bc1[_0x6a8e('0x13')][_0x6a8e('0x15')]);}logger[_0x6a8e('0x13')](_0x6a8e('0xf'),_0x34acba,_0x150bc1[_0x6a8e('0x13')][_0x6a8e('0x15')]);return _0x118d85(_0x150bc1['error']['message']);}else{logger[_0x6a8e('0xe')](_0x6a8e('0xf'),_0x34acba,_0x6a8e('0x16'));_0x118d85(_0x150bc1[_0x6a8e('0x17')]['message']);}})[_0x6a8e('0x18')](function(_0x3e3b6b){logger[_0x6a8e('0x13')](_0x6a8e('0xf'),_0x34acba,_0x3e3b6b);_0x1d1779(_0x3e3b6b);});});}exports[_0x6a8e('0x19')]=function(_0x4d605b){var _0x5856c2=this;return new Promise(function(_0x13d2cf,_0x581b34){return db['ServicenowAccount']['findAll']({'raw':_0x4d605b[_0x6a8e('0x1a')]?_0x4d605b[_0x6a8e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4d605b['options']?_0x4d605b[_0x6a8e('0x1a')][_0x6a8e('0x1b')]||null:null,'attributes':_0x4d605b['options']?_0x4d605b['options']['attributes']||null:null,'limit':_0x4d605b[_0x6a8e('0x1a')]?_0x4d605b[_0x6a8e('0x1a')][_0x6a8e('0x1c')]||null:null,'include':_0x4d605b[_0x6a8e('0x1a')]?_0x4d605b[_0x6a8e('0x1a')][_0x6a8e('0x1d')]?_[_0x6a8e('0x1e')](_0x4d605b['options'][_0x6a8e('0x1d')],function(_0x5ebb7d){return{'model':db[_0x5ebb7d[_0x6a8e('0x1f')]],'as':_0x5ebb7d['as'],'attributes':_0x5ebb7d[_0x6a8e('0x20')],'include':_0x5ebb7d[_0x6a8e('0x1d')]?_[_0x6a8e('0x1e')](_0x5ebb7d['include'],function(_0x162989){return{'model':db[_0x162989[_0x6a8e('0x1f')]],'as':_0x162989['as'],'attributes':_0x162989[_0x6a8e('0x20')],'include':_0x162989['include']?_['map'](_0x162989[_0x6a8e('0x1d')],function(_0x2338d5){return{'model':db[_0x2338d5[_0x6a8e('0x1f')]],'as':_0x2338d5['as'],'attributes':_0x2338d5['attributes']};}):[]};}):[]};}):[]:[]})[_0x6a8e('0xd')](function(_0x189249){logger[_0x6a8e('0xe')](_0x6a8e('0x19'),_0x4d605b);logger[_0x6a8e('0x10')](_0x6a8e('0x19'),_0x4d605b,JSON['stringify'](_0x189249));_0x13d2cf(_0x189249);})[_0x6a8e('0x18')](function(_0xf9f1d0){logger[_0x6a8e('0x13')](_0x6a8e('0x19'),_0xf9f1d0[_0x6a8e('0x15')],_0x4d605b);_0x581b34(_0x5856c2[_0x6a8e('0x13')](0x1f4,_0xf9f1d0[_0x6a8e('0x15')]));});});};exports['ShowServicenowAccount']=function(_0x44b252){var _0x1bfd02=this;return new Promise(function(_0x286a80,_0x411379){return db[_0x6a8e('0x21')]['find']({'raw':_0x44b252[_0x6a8e('0x1a')]?_0x44b252[_0x6a8e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x44b252[_0x6a8e('0x1a')]?_0x44b252['options'][_0x6a8e('0x1b')]||null:null,'attributes':_0x44b252[_0x6a8e('0x1a')]?_0x44b252[_0x6a8e('0x1a')]['attributes']||null:null,'include':_0x44b252[_0x6a8e('0x1a')]?_0x44b252[_0x6a8e('0x1a')][_0x6a8e('0x1d')]?_[_0x6a8e('0x1e')](_0x44b252[_0x6a8e('0x1a')][_0x6a8e('0x1d')],function(_0x58bb02){return{'model':db[_0x58bb02['model']],'as':_0x58bb02['as'],'attributes':_0x58bb02[_0x6a8e('0x20')],'include':_0x58bb02[_0x6a8e('0x1d')]?_[_0x6a8e('0x1e')](_0x58bb02[_0x6a8e('0x1d')],function(_0x1afa4e){return{'model':db[_0x1afa4e['model']],'as':_0x1afa4e['as'],'attributes':_0x1afa4e[_0x6a8e('0x20')],'include':_0x1afa4e[_0x6a8e('0x1d')]?_[_0x6a8e('0x1e')](_0x1afa4e[_0x6a8e('0x1d')],function(_0x54809c){return{'model':db[_0x54809c[_0x6a8e('0x1f')]],'as':_0x54809c['as'],'attributes':_0x54809c[_0x6a8e('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6a8e('0xd')](function(_0x222ee6){logger[_0x6a8e('0xe')]('ShowServicenowAccount',_0x44b252);logger[_0x6a8e('0x10')](_0x6a8e('0x22'),_0x44b252,JSON['stringify'](_0x222ee6));_0x286a80(_0x222ee6);})['catch'](function(_0x3a7162){logger[_0x6a8e('0x13')](_0x6a8e('0x22'),_0x3a7162[_0x6a8e('0x15')],_0x44b252);_0x411379(_0x1bfd02[_0x6a8e('0x13')](0x1f4,_0x3a7162['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 0997eba..6dde82d 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 _0x4e5f=['getDescriptions','post','create','put','/:id','update','exports','multer','util','connect-timeout','express','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x3462b5,_0x52d16e){var _0x73ae3e=function(_0x24f333){while(--_0x24f333){_0x3462b5['push'](_0x3462b5['shift']());}};_0x73ae3e(++_0x52d16e);}(_0x4e5f,0x147));var _0xf4e5=function(_0x5d9ecf,_0x10f804){_0x5d9ecf=_0x5d9ecf-0x0;var _0x513efd=_0x4e5f[_0x5d9ecf];return _0x513efd;};'use strict';var multer=require(_0xf4e5('0x0'));var util=require(_0xf4e5('0x1'));var path=require('path');var timeout=require(_0xf4e5('0x2'));var express=require(_0xf4e5('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf4e5('0x4'));var controller=require(_0xf4e5('0x5'));router[_0xf4e5('0x6')]('/',auth[_0xf4e5('0x7')](),controller['index']);router[_0xf4e5('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xf4e5('0x8')]);router[_0xf4e5('0x6')](_0xf4e5('0x9'),auth[_0xf4e5('0x7')](),controller[_0xf4e5('0xa')]);router[_0xf4e5('0x6')](_0xf4e5('0xb'),auth[_0xf4e5('0x7')](),controller[_0xf4e5('0xc')]);router['get']('/:id/descriptions',auth[_0xf4e5('0x7')](),controller[_0xf4e5('0xd')]);router[_0xf4e5('0xe')]('/',auth[_0xf4e5('0x7')](),controller[_0xf4e5('0xf')]);router[_0xf4e5('0x10')](_0xf4e5('0x11'),auth[_0xf4e5('0x7')](),controller[_0xf4e5('0x12')]);router['delete'](_0xf4e5('0x11'),auth[_0xf4e5('0x7')](),controller['destroy']);module[_0xf4e5('0x13')]=router; \ No newline at end of file +var _0xc849=['Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','create','update','delete','exports','multer','path','connect-timeout','express'];(function(_0x4e2cfc,_0xab06d1){var _0x16fefa=function(_0x5e362a){while(--_0x5e362a){_0x4e2cfc['push'](_0x4e2cfc['shift']());}};_0x16fefa(++_0xab06d1);}(_0xc849,0x1d7));var _0x9c84=function(_0x4f36e1,_0x598502){_0x4f36e1=_0x4f36e1-0x0;var _0x18e1ef=_0xc849[_0x4f36e1];return _0x18e1ef;};'use strict';var multer=require(_0x9c84('0x0'));var util=require('util');var path=require(_0x9c84('0x1'));var timeout=require(_0x9c84('0x2'));var express=require(_0x9c84('0x3'));var router=express[_0x9c84('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9c84('0x5'));var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0x9c84('0x6')]('/',auth[_0x9c84('0x7')](),controller[_0x9c84('0x8')]);router[_0x9c84('0x6')](_0x9c84('0x9'),auth[_0x9c84('0x7')](),controller[_0x9c84('0xa')]);router[_0x9c84('0x6')](_0x9c84('0xb'),auth[_0x9c84('0x7')](),controller['getFields']);router[_0x9c84('0x6')](_0x9c84('0xc'),auth[_0x9c84('0x7')](),controller[_0x9c84('0xd')]);router[_0x9c84('0x6')]('/:id/descriptions',auth[_0x9c84('0x7')](),controller[_0x9c84('0xe')]);router['post']('/',auth[_0x9c84('0x7')](),controller[_0x9c84('0xf')]);router['put'](_0x9c84('0x9'),auth[_0x9c84('0x7')](),controller[_0x9c84('0x10')]);router[_0x9c84('0x11')](_0x9c84('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9c84('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 92fcc86..c98a278 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 _0xab2e=['STRING','sequelize','exports'];(function(_0x5c347f,_0x4f3912){var _0x3b72b7=function(_0x4df335){while(--_0x4df335){_0x5c347f['push'](_0x5c347f['shift']());}};_0x3b72b7(++_0x4f3912);}(_0xab2e,0x10c));var _0xeab2=function(_0x26ed77,_0x5d3145){_0x26ed77=_0x26ed77-0x0;var _0x33ef92=_0xab2e[_0x26ed77];return _0x33ef92;};'use strict';var Sequelize=require(_0xeab2('0x0'));module[_0xeab2('0x1')]={'name':{'type':Sequelize[_0xeab2('0x2')]},'description':{'type':Sequelize[_0xeab2('0x2')]}}; \ No newline at end of file +var _0xa36a=['sequelize','STRING'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xa36a,0x136));var _0xaa36=function(_0xd7ebe1,_0x39cf7d){_0xd7ebe1=_0xd7ebe1-0x0;var _0x2e5254=_0xa36a[_0xd7ebe1];return _0x2e5254;};'use strict';var Sequelize=require(_0xaa36('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaa36('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 357584b..416f483 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 _0xe605=['result','catch','sendStatus','end','json','count','offset','limit','status','Content-Range','reject','save','update','destroy','stack','name','index','ServicenowConfiguration','rawAttributes','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','findOne','ServicenowField','pick','getFields','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message'];(function(_0xfe17fc,_0x2f93d9){var _0x3fb6b3=function(_0x50214c){while(--_0x50214c){_0xfe17fc['push'](_0xfe17fc['shift']());}};_0x3fb6b3(++_0x2f93d9);}(_0xe605,0x92));var _0x5e60=function(_0x5d468c,_0x1ccfd3){_0x5d468c=_0x5d468c-0x0;var _0x154ab4=_0xe605[_0x5d468c];return _0x154ab4;};'use strict';var pdf=require(_0x5e60('0x0'));var emlformat=require(_0x5e60('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5e60('0x2'));var jsonpatch=require(_0x5e60('0x3'));var rp=require(_0x5e60('0x4'));var moment=require(_0x5e60('0x5'));var BPromise=require(_0x5e60('0x6'));var Mustache=require(_0x5e60('0x7'));var util=require(_0x5e60('0x8'));var path=require(_0x5e60('0x9'));var sox=require(_0x5e60('0xa'));var csv=require(_0x5e60('0xb'));var ejs=require(_0x5e60('0xc'));var fs=require('fs');var _=require(_0x5e60('0xd'));var squel=require('squel');var crypto=require(_0x5e60('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5e60('0xf'));var Papa=require(_0x5e60('0x10'));var Redis=require(_0x5e60('0x11'));var authService=require(_0x5e60('0x12'));var qs=require(_0x5e60('0x13'));var as=require(_0x5e60('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5e60('0x15'))('api');var utils=require(_0x5e60('0x16'));var config=require(_0x5e60('0x17'));var db=require(_0x5e60('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x5e60('0x19')][_0x5e60('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1f4e14,_0xe039de,_0x2874c4){if(_0x2874c4){var _0xe124cd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xe124cd['test'](_0xe039de)){return _0x1f4e14;}else{throw new db[(_0x5e60('0x1b'))][(_0x5e60('0x1c'))](_0x5e60('0x1d'));}}else{return _0x1f4e14;}}function respondWithRpcPromise(_0x2a1c55,_0x5b028f,_0x20af5f,_0x529ffe){return new BPromise(function(_0x1ffd77,_0x3bc7d8){var _0x4cf084=_0x529ffe||client;return _0x4cf084[_0x5e60('0x1e')](_0x2a1c55,_0x20af5f)[_0x5e60('0x1f')](function(_0xaa7d05){logger[_0x5e60('0x20')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5b028f,_0x5e60('0x21'));logger[_0x5e60('0x22')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x5b028f,_0x5e60('0x21'),JSON[_0x5e60('0x23')](_0xaa7d05));if(_0xaa7d05[_0x5e60('0x24')]){if(_0xaa7d05[_0x5e60('0x24')][_0x5e60('0x25')]===0x1f4){logger[_0x5e60('0x24')](_0x5e60('0x26'),_0x5b028f,_0xaa7d05[_0x5e60('0x24')][_0x5e60('0x27')]);return _0x3bc7d8(_0xaa7d05[_0x5e60('0x24')][_0x5e60('0x27')]);}logger['error'](_0x5e60('0x26'),_0x5b028f,_0xaa7d05['error'][_0x5e60('0x27')]);return _0x1ffd77(_0xaa7d05[_0x5e60('0x24')][_0x5e60('0x27')]);}else{logger[_0x5e60('0x20')](_0x5e60('0x26'),_0x5b028f,_0x5e60('0x21'));_0x1ffd77(_0xaa7d05[_0x5e60('0x28')]['message']);}})[_0x5e60('0x29')](function(_0x7dbdb7){logger[_0x5e60('0x24')]('ServicenowConfiguration,\x20%s,\x20%s',_0x5b028f,_0x7dbdb7);_0x3bc7d8(_0x7dbdb7);});});}function respondWithStatusCode(_0x45cb62,_0x56e3a5){_0x56e3a5=_0x56e3a5||0xcc;return function(_0x2d8aac){if(_0x2d8aac){return _0x45cb62[_0x5e60('0x2a')](_0x56e3a5);}return _0x45cb62['status'](_0x56e3a5)[_0x5e60('0x2b')]();};}function respondWithResult(_0x5712f7,_0x23d187){_0x23d187=_0x23d187||0xc8;return function(_0x221322){if(_0x221322){return _0x5712f7['status'](_0x23d187)[_0x5e60('0x2c')](_0x221322);}};}function respondWithFilteredResult(_0x19e5ab,_0x5b1b46){return function(_0x1ee931){if(_0x1ee931){var _0xac9c7a=_0x1ee931[_0x5e60('0x2d')],_0x52c97c=_0x5b1b46[_0x5e60('0x2e')],_0x5431a8=_0x5b1b46[_0x5e60('0x2e')]+_0x5b1b46[_0x5e60('0x2f')],_0x52f668;if(_0x5431a8>=_0xac9c7a){_0x5431a8=_0xac9c7a;_0x52f668=0xc8;}else{_0x52f668=0xce;}_0x19e5ab[_0x5e60('0x30')](_0x52f668);return _0x19e5ab['set'](_0x5e60('0x31'),_0x52c97c+'-'+_0x5431a8+'/'+_0xac9c7a)[_0x5e60('0x2c')](_0x1ee931);}return null;};}function patchUpdates(_0x4d4b55){return function(_0x11fc87){try{jsonpatch['apply'](_0x11fc87,_0x4d4b55,!![]);}catch(_0x50f024){return BPromise[_0x5e60('0x32')](_0x50f024);}return _0x11fc87[_0x5e60('0x33')]();};}function saveUpdates(_0x1f474b,_0x385c77){return function(_0xaf3a35){if(_0xaf3a35){return _0xaf3a35[_0x5e60('0x34')](_0x1f474b)[_0x5e60('0x1f')](function(_0x2ff2b7){return _0x2ff2b7;});}return null;};}function removeEntity(_0xc1489a,_0x4702a6){return function(_0x5c429c){if(_0x5c429c){return _0x5c429c[_0x5e60('0x35')]()['then'](function(){_0xc1489a['status'](0xcc)[_0x5e60('0x2b')]();});}};}function handleEntityNotFound(_0x317206,_0x4fd910){return function(_0x307e54){if(!_0x307e54){_0x317206['sendStatus'](0x194);}return _0x307e54;};}function handleError(_0x3757fc,_0x45d979){_0x45d979=_0x45d979||0x1f4;return function(_0x2b2426){logger[_0x5e60('0x24')](_0x2b2426[_0x5e60('0x36')]);if(_0x2b2426[_0x5e60('0x37')]){delete _0x2b2426[_0x5e60('0x37')];}_0x3757fc[_0x5e60('0x30')](_0x45d979)['send'](_0x2b2426);};}exports[_0x5e60('0x38')]=function(_0x3f744d,_0x22d4ad){var _0x1a3782={},_0x200744={},_0x2aa7d4={'count':0x0,'rows':[]};var _0x261245=_['map'](db[_0x5e60('0x39')][_0x5e60('0x3a')],function(_0x4cba18){return{'name':_0x4cba18['fieldName'],'type':_0x4cba18[_0x5e60('0x3b')][_0x5e60('0x3c')]};});_0x200744[_0x5e60('0x3d')]=_[_0x5e60('0x3e')](_0x261245,_0x5e60('0x37'));_0x200744['query']=_[_0x5e60('0x3f')](_0x3f744d[_0x5e60('0x40')]);_0x200744[_0x5e60('0x41')]=_[_0x5e60('0x42')](_0x200744[_0x5e60('0x3d')],_0x200744[_0x5e60('0x40')]);_0x1a3782[_0x5e60('0x43')]=_['intersection'](_0x200744[_0x5e60('0x3d')],qs[_0x5e60('0x44')](_0x3f744d['query']['fields']));_0x1a3782['attributes']=_0x1a3782[_0x5e60('0x43')][_0x5e60('0x45')]?_0x1a3782[_0x5e60('0x43')]:_0x200744[_0x5e60('0x3d')];if(!_0x3f744d['query'][_0x5e60('0x46')](_0x5e60('0x47'))){_0x1a3782['limit']=qs['limit'](_0x3f744d[_0x5e60('0x40')][_0x5e60('0x2f')]);_0x1a3782[_0x5e60('0x2e')]=qs[_0x5e60('0x2e')](_0x3f744d[_0x5e60('0x40')][_0x5e60('0x2e')]);}_0x1a3782[_0x5e60('0x48')]=qs[_0x5e60('0x49')](_0x3f744d[_0x5e60('0x40')]['sort']);_0x1a3782[_0x5e60('0x4a')]=qs[_0x5e60('0x41')](_['pick'](_0x3f744d[_0x5e60('0x40')],_0x200744[_0x5e60('0x41')]),_0x261245);if(_0x3f744d[_0x5e60('0x40')][_0x5e60('0x4b')]){_0x1a3782[_0x5e60('0x4a')]=_['merge'](_0x1a3782[_0x5e60('0x4a')],{'$or':_[_0x5e60('0x3e')](_0x261245,function(_0x172aff){if(_0x172aff[_0x5e60('0x3b')]!=='VIRTUAL'){var _0x4d9787={};_0x4d9787[_0x172aff['name']]={'$like':'%'+_0x3f744d[_0x5e60('0x40')][_0x5e60('0x4b')]+'%'};return _0x4d9787;}})});}_0x1a3782=_[_0x5e60('0x4c')]({},_0x1a3782,_0x3f744d[_0x5e60('0x4d')]);var _0x39c131={'where':_0x1a3782[_0x5e60('0x4a')]};return db['ServicenowConfiguration'][_0x5e60('0x2d')](_0x39c131)[_0x5e60('0x1f')](function(_0x165bea){_0x2aa7d4[_0x5e60('0x2d')]=_0x165bea;if(_0x3f744d[_0x5e60('0x40')][_0x5e60('0x4e')]){_0x1a3782[_0x5e60('0x4f')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x5e60('0x50')](_0x1a3782);})[_0x5e60('0x1f')](function(_0x21a116){_0x2aa7d4[_0x5e60('0x51')]=_0x21a116;return _0x2aa7d4;})[_0x5e60('0x1f')](respondWithFilteredResult(_0x22d4ad,_0x1a3782))[_0x5e60('0x29')](handleError(_0x22d4ad,null));};exports[_0x5e60('0x52')]=function(_0x4470bd,_0x1518bd){var _0x350d6d={'raw':![],'where':{'id':_0x4470bd[_0x5e60('0x53')]['id']}},_0xe5e675={};_0xe5e675[_0x5e60('0x3d')]=_[_0x5e60('0x3f')](db[_0x5e60('0x39')][_0x5e60('0x3a')]);_0xe5e675[_0x5e60('0x40')]=_[_0x5e60('0x3f')](_0x4470bd['query']);_0xe5e675['filters']=_[_0x5e60('0x42')](_0xe5e675['model'],_0xe5e675[_0x5e60('0x40')]);_0x350d6d[_0x5e60('0x43')]=_[_0x5e60('0x42')](_0xe5e675[_0x5e60('0x3d')],qs[_0x5e60('0x44')](_0x4470bd[_0x5e60('0x40')]['fields']));_0x350d6d['attributes']=_0x350d6d[_0x5e60('0x43')][_0x5e60('0x45')]?_0x350d6d[_0x5e60('0x43')]:_0xe5e675['model'];if(_0x4470bd['query'][_0x5e60('0x4e')]){_0x350d6d[_0x5e60('0x4f')]=[{'all':!![]}];}_0x350d6d=_[_0x5e60('0x4c')]({},_0x350d6d,_0x4470bd['options']);return db[_0x5e60('0x39')][_0x5e60('0x54')](_0x350d6d)[_0x5e60('0x1f')](handleEntityNotFound(_0x1518bd,null))[_0x5e60('0x1f')](respondWithResult(_0x1518bd,null))[_0x5e60('0x29')](handleError(_0x1518bd,null));};exports[_0x5e60('0x55')]=function(_0x4ae313,_0x412be1){return db[_0x5e60('0x39')]['create'](_0x4ae313[_0x5e60('0x56')],{})[_0x5e60('0x1f')](respondWithResult(_0x412be1,0xc9))[_0x5e60('0x29')](handleError(_0x412be1,null));};exports['update']=function(_0xbe0bd5,_0x17429d){if(_0xbe0bd5['body']['id']){delete _0xbe0bd5[_0x5e60('0x56')]['id'];}return db[_0x5e60('0x39')][_0x5e60('0x54')]({'where':{'id':_0xbe0bd5[_0x5e60('0x53')]['id']}})['then'](handleEntityNotFound(_0x17429d,null))[_0x5e60('0x1f')](saveUpdates(_0xbe0bd5[_0x5e60('0x56')],null))['then'](respondWithResult(_0x17429d,null))[_0x5e60('0x29')](handleError(_0x17429d,null));};exports['destroy']=function(_0x8d00b9,_0x5220fc){return db[_0x5e60('0x39')][_0x5e60('0x54')]({'where':{'id':_0x8d00b9['params']['id']}})[_0x5e60('0x1f')](handleEntityNotFound(_0x5220fc,null))['then'](removeEntity(_0x5220fc,null))[_0x5e60('0x29')](handleError(_0x5220fc,null));};exports['getFields']=function(_0x157787,_0x5b4daa,_0x1481d0){var _0x17e178={};var _0xb1ef22={};var _0x28c2de;var _0x252fa3;return db[_0x5e60('0x39')][_0x5e60('0x57')]({'where':{'id':_0x157787['params']['id']}})[_0x5e60('0x1f')](handleEntityNotFound(_0x5b4daa,null))[_0x5e60('0x1f')](function(_0x442dbf){if(_0x442dbf){_0x28c2de=_0x442dbf;_0xb1ef22[_0x5e60('0x3d')]=_[_0x5e60('0x3f')](db[_0x5e60('0x58')]['rawAttributes']);_0xb1ef22['query']=_['keys'](_0x157787[_0x5e60('0x40')]);_0xb1ef22[_0x5e60('0x41')]=_['intersection'](_0xb1ef22[_0x5e60('0x3d')],_0xb1ef22[_0x5e60('0x40')]);_0x17e178['attributes']=_[_0x5e60('0x42')](_0xb1ef22[_0x5e60('0x3d')],qs[_0x5e60('0x44')](_0x157787[_0x5e60('0x40')][_0x5e60('0x44')]));_0x17e178[_0x5e60('0x43')]=_0x17e178[_0x5e60('0x43')][_0x5e60('0x45')]?_0x17e178[_0x5e60('0x43')]:_0xb1ef22[_0x5e60('0x3d')];_0x17e178[_0x5e60('0x48')]=qs[_0x5e60('0x49')](_0x157787[_0x5e60('0x40')][_0x5e60('0x49')]);_0x17e178[_0x5e60('0x4a')]=qs[_0x5e60('0x41')](_[_0x5e60('0x59')](_0x157787['query'],_0xb1ef22[_0x5e60('0x41')]));if(_0x157787[_0x5e60('0x40')][_0x5e60('0x4b')]){_0x17e178['where']=_[_0x5e60('0x4c')](_0x17e178[_0x5e60('0x4a')],{'$or':_['map'](_0x17e178[_0x5e60('0x43')],function(_0x6f4d2f){var _0x5bbaaf={};_0x5bbaaf[_0x6f4d2f]={'$like':'%'+_0x157787[_0x5e60('0x40')][_0x5e60('0x4b')]+'%'};return _0x5bbaaf;})});}_0x17e178=_[_0x5e60('0x4c')]({},_0x17e178,_0x157787[_0x5e60('0x4d')]);return _0x28c2de[_0x5e60('0x5a')](_0x17e178);}})[_0x5e60('0x1f')](function(_0x221f35){if(_0x221f35){_0x252fa3=_0x221f35[_0x5e60('0x45')];if(!_0x157787[_0x5e60('0x40')]['hasOwnProperty'](_0x5e60('0x47'))){_0x17e178[_0x5e60('0x2f')]=qs[_0x5e60('0x2f')](_0x157787['query'][_0x5e60('0x2f')]);_0x17e178[_0x5e60('0x2e')]=qs[_0x5e60('0x2e')](_0x157787[_0x5e60('0x40')][_0x5e60('0x2e')]);}return _0x28c2de['getFields'](_0x17e178);}})[_0x5e60('0x1f')](function(_0x213c7e){if(_0x213c7e){return _0x213c7e?{'count':_0x252fa3,'rows':_0x213c7e}:null;}})[_0x5e60('0x1f')](respondWithResult(_0x5b4daa,null))['catch'](handleError(_0x5b4daa,null));};exports['getSubjects']=function(_0x3ecfbe,_0x265b5a,_0x13c6dc){var _0x25f6cb={};var _0x14fb46={};var _0x44ddaa;var _0x2c5b45;return db['ServicenowConfiguration'][_0x5e60('0x57')]({'where':{'id':_0x3ecfbe[_0x5e60('0x53')]['id']}})[_0x5e60('0x1f')](handleEntityNotFound(_0x265b5a,null))['then'](function(_0x5dd41b){if(_0x5dd41b){_0x44ddaa=_0x5dd41b;_0x14fb46[_0x5e60('0x3d')]=_[_0x5e60('0x3f')](db[_0x5e60('0x58')]['rawAttributes']);_0x14fb46['query']=_[_0x5e60('0x3f')](_0x3ecfbe[_0x5e60('0x40')]);_0x14fb46[_0x5e60('0x41')]=_[_0x5e60('0x42')](_0x14fb46[_0x5e60('0x3d')],_0x14fb46[_0x5e60('0x40')]);_0x25f6cb['attributes']=_[_0x5e60('0x42')](_0x14fb46[_0x5e60('0x3d')],qs[_0x5e60('0x44')](_0x3ecfbe[_0x5e60('0x40')][_0x5e60('0x44')]));_0x25f6cb[_0x5e60('0x43')]=_0x25f6cb[_0x5e60('0x43')][_0x5e60('0x45')]?_0x25f6cb[_0x5e60('0x43')]:_0x14fb46['model'];_0x25f6cb[_0x5e60('0x48')]=qs[_0x5e60('0x49')](_0x3ecfbe['query'][_0x5e60('0x49')]);_0x25f6cb[_0x5e60('0x4a')]=qs['filters'](_[_0x5e60('0x59')](_0x3ecfbe[_0x5e60('0x40')],_0x14fb46[_0x5e60('0x41')]));if(_0x3ecfbe[_0x5e60('0x40')][_0x5e60('0x4b')]){_0x25f6cb[_0x5e60('0x4a')]=_['merge'](_0x25f6cb[_0x5e60('0x4a')],{'$or':_[_0x5e60('0x3e')](_0x25f6cb[_0x5e60('0x43')],function(_0x222d94){var _0x95d1c5={};_0x95d1c5[_0x222d94]={'$like':'%'+_0x3ecfbe[_0x5e60('0x40')][_0x5e60('0x4b')]+'%'};return _0x95d1c5;})});}_0x25f6cb=_[_0x5e60('0x4c')]({},_0x25f6cb,_0x3ecfbe[_0x5e60('0x4d')]);return _0x44ddaa['getSubjects'](_0x25f6cb);}})[_0x5e60('0x1f')](function(_0x6f826){if(_0x6f826){_0x2c5b45=_0x6f826[_0x5e60('0x45')];if(!_0x3ecfbe[_0x5e60('0x40')][_0x5e60('0x46')](_0x5e60('0x47'))){_0x25f6cb[_0x5e60('0x2f')]=qs[_0x5e60('0x2f')](_0x3ecfbe[_0x5e60('0x40')][_0x5e60('0x2f')]);_0x25f6cb['offset']=qs['offset'](_0x3ecfbe['query'][_0x5e60('0x2e')]);}return _0x44ddaa[_0x5e60('0x5b')](_0x25f6cb);}})[_0x5e60('0x1f')](function(_0x1a911a){if(_0x1a911a){return _0x1a911a?{'count':_0x2c5b45,'rows':_0x1a911a}:null;}})[_0x5e60('0x1f')](respondWithResult(_0x265b5a,null))[_0x5e60('0x29')](handleError(_0x265b5a,null));};exports[_0x5e60('0x5c')]=function(_0x58640c,_0x120fab,_0x4f9164){var _0x1d95fd={};var _0x42ac7c={};var _0x2afb9c;var _0x530e04;return db[_0x5e60('0x39')]['findOne']({'where':{'id':_0x58640c['params']['id']}})['then'](handleEntityNotFound(_0x120fab,null))[_0x5e60('0x1f')](function(_0x43803c){if(_0x43803c){_0x2afb9c=_0x43803c;_0x42ac7c[_0x5e60('0x3d')]=_[_0x5e60('0x3f')](db[_0x5e60('0x58')][_0x5e60('0x3a')]);_0x42ac7c[_0x5e60('0x40')]=_[_0x5e60('0x3f')](_0x58640c[_0x5e60('0x40')]);_0x42ac7c['filters']=_[_0x5e60('0x42')](_0x42ac7c[_0x5e60('0x3d')],_0x42ac7c[_0x5e60('0x40')]);_0x1d95fd[_0x5e60('0x43')]=_[_0x5e60('0x42')](_0x42ac7c[_0x5e60('0x3d')],qs[_0x5e60('0x44')](_0x58640c[_0x5e60('0x40')][_0x5e60('0x44')]));_0x1d95fd[_0x5e60('0x43')]=_0x1d95fd[_0x5e60('0x43')][_0x5e60('0x45')]?_0x1d95fd['attributes']:_0x42ac7c[_0x5e60('0x3d')];_0x1d95fd[_0x5e60('0x48')]=qs[_0x5e60('0x49')](_0x58640c[_0x5e60('0x40')][_0x5e60('0x49')]);_0x1d95fd[_0x5e60('0x4a')]=qs[_0x5e60('0x41')](_[_0x5e60('0x59')](_0x58640c[_0x5e60('0x40')],_0x42ac7c[_0x5e60('0x41')]));if(_0x58640c[_0x5e60('0x40')][_0x5e60('0x4b')]){_0x1d95fd[_0x5e60('0x4a')]=_[_0x5e60('0x4c')](_0x1d95fd[_0x5e60('0x4a')],{'$or':_[_0x5e60('0x3e')](_0x1d95fd[_0x5e60('0x43')],function(_0x36d256){var _0x358bb5={};_0x358bb5[_0x36d256]={'$like':'%'+_0x58640c[_0x5e60('0x40')]['filter']+'%'};return _0x358bb5;})});}_0x1d95fd=_[_0x5e60('0x4c')]({},_0x1d95fd,_0x58640c[_0x5e60('0x4d')]);return _0x2afb9c[_0x5e60('0x5c')](_0x1d95fd);}})['then'](function(_0x4a4417){if(_0x4a4417){_0x530e04=_0x4a4417[_0x5e60('0x45')];if(!_0x58640c[_0x5e60('0x40')][_0x5e60('0x46')](_0x5e60('0x47'))){_0x1d95fd[_0x5e60('0x2f')]=qs[_0x5e60('0x2f')](_0x58640c[_0x5e60('0x40')][_0x5e60('0x2f')]);_0x1d95fd[_0x5e60('0x2e')]=qs[_0x5e60('0x2e')](_0x58640c[_0x5e60('0x40')][_0x5e60('0x2e')]);}return _0x2afb9c[_0x5e60('0x5c')](_0x1d95fd);}})[_0x5e60('0x1f')](function(_0x30e4a7){if(_0x30e4a7){return _0x30e4a7?{'count':_0x530e04,'rows':_0x30e4a7}:null;}})[_0x5e60('0x1f')](respondWithResult(_0x120fab,null))[_0x5e60('0x29')](handleError(_0x120fab,null));}; \ No newline at end of file +var _0x6cb4=['http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','info','result','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','ServicenowConfiguration','options','body','find','findOne','ServicenowField','length','map','hasOwnProperty','getFields','pick','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','jayson/promise','client'];(function(_0x551b1c,_0x3584f9){var _0x131273=function(_0x553185){while(--_0x553185){_0x551b1c['push'](_0x551b1c['shift']());}};_0x131273(++_0x3584f9);}(_0x6cb4,0xff));var _0x46cb=function(_0x546137,_0x559d68){_0x546137=_0x546137-0x0;var _0x1ea796=_0x6cb4[_0x546137];return _0x1ea796;};'use strict';var pdf=require(_0x46cb('0x0'));var emlformat=require(_0x46cb('0x1'));var rimraf=require(_0x46cb('0x2'));var zipdir=require(_0x46cb('0x3'));var jsonpatch=require(_0x46cb('0x4'));var rp=require(_0x46cb('0x5'));var moment=require(_0x46cb('0x6'));var BPromise=require(_0x46cb('0x7'));var Mustache=require(_0x46cb('0x8'));var util=require('util');var path=require(_0x46cb('0x9'));var sox=require('sox');var csv=require(_0x46cb('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x46cb('0xb'));var squel=require(_0x46cb('0xc'));var crypto=require(_0x46cb('0xd'));var jsforce=require(_0x46cb('0xe'));var deskjs=require(_0x46cb('0xf'));var toCsv=require(_0x46cb('0xa'));var querystring=require('querystring');var Papa=require(_0x46cb('0x10'));var Redis=require(_0x46cb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x46cb('0x12'));var as=require(_0x46cb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46cb('0x14'))(_0x46cb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x46cb('0x16'));var client=jayson[_0x46cb('0x17')][_0x46cb('0x18')]({'port':0x232a});function checkPasswordPattern(_0xf22158,_0x553440,_0x8497cd){if(_0x8497cd){var _0x2ad351=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2ad351[_0x46cb('0x19')](_0x553440)){return _0xf22158;}else{throw new db[(_0x46cb('0x1a'))][(_0x46cb('0x1b'))](_0x46cb('0x1c'));}}else{return _0xf22158;}}function respondWithRpcPromise(_0x3d2557,_0x3c396b,_0x37d368,_0x41e398){return new BPromise(function(_0x136215,_0x5cdb4b){var _0x3da031=_0x41e398||client;return _0x3da031['request'](_0x3d2557,_0x37d368)[_0x46cb('0x1d')](function(_0x4ab22b){logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0x3c396b,_0x46cb('0x1e'));logger[_0x46cb('0x1f')](_0x46cb('0x20'),_0x3c396b,_0x46cb('0x1e'),JSON[_0x46cb('0x21')](_0x4ab22b));if(_0x4ab22b[_0x46cb('0x22')]){if(_0x4ab22b[_0x46cb('0x22')][_0x46cb('0x23')]===0x1f4){logger[_0x46cb('0x22')](_0x46cb('0x24'),_0x3c396b,_0x4ab22b[_0x46cb('0x22')][_0x46cb('0x25')]);return _0x5cdb4b(_0x4ab22b[_0x46cb('0x22')][_0x46cb('0x25')]);}logger[_0x46cb('0x22')](_0x46cb('0x24'),_0x3c396b,_0x4ab22b[_0x46cb('0x22')][_0x46cb('0x25')]);return _0x136215(_0x4ab22b[_0x46cb('0x22')][_0x46cb('0x25')]);}else{logger[_0x46cb('0x26')](_0x46cb('0x24'),_0x3c396b,_0x46cb('0x1e'));_0x136215(_0x4ab22b[_0x46cb('0x27')][_0x46cb('0x25')]);}})['catch'](function(_0x4d663e){logger[_0x46cb('0x22')](_0x46cb('0x24'),_0x3c396b,_0x4d663e);_0x5cdb4b(_0x4d663e);});});}function respondWithStatusCode(_0x2711ac,_0xe078a8){_0xe078a8=_0xe078a8||0xcc;return function(_0x6e6d9){if(_0x6e6d9){return _0x2711ac['sendStatus'](_0xe078a8);}return _0x2711ac[_0x46cb('0x28')](_0xe078a8)['end']();};}function respondWithResult(_0x495886,_0x544465){_0x544465=_0x544465||0xc8;return function(_0x180ce1){if(_0x180ce1){return _0x495886[_0x46cb('0x28')](_0x544465)[_0x46cb('0x29')](_0x180ce1);}};}function respondWithFilteredResult(_0xc1efd3,_0x7cd177){return function(_0x33218b){if(_0x33218b){var _0x378dc7=_0x33218b[_0x46cb('0x2a')],_0x8c65b2=_0x7cd177['offset'],_0x2b846a=_0x7cd177[_0x46cb('0x2b')]+_0x7cd177[_0x46cb('0x2c')],_0x12e01e;if(_0x2b846a>=_0x378dc7){_0x2b846a=_0x378dc7;_0x12e01e=0xc8;}else{_0x12e01e=0xce;}_0xc1efd3['status'](_0x12e01e);return _0xc1efd3['set'](_0x46cb('0x2d'),_0x8c65b2+'-'+_0x2b846a+'/'+_0x378dc7)['json'](_0x33218b);}return null;};}function patchUpdates(_0x27c22d){return function(_0x6f7953){try{jsonpatch[_0x46cb('0x2e')](_0x6f7953,_0x27c22d,!![]);}catch(_0xd96713){return BPromise[_0x46cb('0x2f')](_0xd96713);}return _0x6f7953[_0x46cb('0x30')]();};}function saveUpdates(_0x5dc551,_0x2e2d36){return function(_0x49ffc5){if(_0x49ffc5){return _0x49ffc5[_0x46cb('0x31')](_0x5dc551)[_0x46cb('0x1d')](function(_0x5cd048){return _0x5cd048;});}return null;};}function removeEntity(_0x46489f,_0x3f0eb4){return function(_0x2cc99d){if(_0x2cc99d){return _0x2cc99d[_0x46cb('0x32')]()[_0x46cb('0x1d')](function(){_0x46489f['status'](0xcc)[_0x46cb('0x33')]();});}};}function handleEntityNotFound(_0x49f80a,_0x46485c){return function(_0x414aef){if(!_0x414aef){_0x49f80a[_0x46cb('0x34')](0x194);}return _0x414aef;};}function handleError(_0x50000e,_0x17eb01){_0x17eb01=_0x17eb01||0x1f4;return function(_0x4290c){logger['error'](_0x4290c[_0x46cb('0x35')]);if(_0x4290c[_0x46cb('0x36')]){delete _0x4290c[_0x46cb('0x36')];}_0x50000e[_0x46cb('0x28')](_0x17eb01)[_0x46cb('0x37')](_0x4290c);};}exports[_0x46cb('0x38')]=function(_0x244084,_0x3dabed){var _0x19e0ad={},_0xe4504e={},_0xba5e93={'count':0x0,'rows':[]};var _0x4f0fb6=_['map'](db['ServicenowConfiguration'][_0x46cb('0x39')],function(_0xf8aaec){return{'name':_0xf8aaec[_0x46cb('0x3a')],'type':_0xf8aaec[_0x46cb('0x3b')][_0x46cb('0x3c')]};});_0xe4504e[_0x46cb('0x3d')]=_['map'](_0x4f0fb6,_0x46cb('0x36'));_0xe4504e['query']=_['keys'](_0x244084[_0x46cb('0x3e')]);_0xe4504e['filters']=_['intersection'](_0xe4504e[_0x46cb('0x3d')],_0xe4504e['query']);_0x19e0ad['attributes']=_[_0x46cb('0x3f')](_0xe4504e[_0x46cb('0x3d')],qs[_0x46cb('0x40')](_0x244084[_0x46cb('0x3e')][_0x46cb('0x40')]));_0x19e0ad[_0x46cb('0x41')]=_0x19e0ad[_0x46cb('0x41')]['length']?_0x19e0ad[_0x46cb('0x41')]:_0xe4504e['model'];if(!_0x244084[_0x46cb('0x3e')]['hasOwnProperty'](_0x46cb('0x42'))){_0x19e0ad[_0x46cb('0x2c')]=qs[_0x46cb('0x2c')](_0x244084['query'][_0x46cb('0x2c')]);_0x19e0ad[_0x46cb('0x2b')]=qs['offset'](_0x244084[_0x46cb('0x3e')][_0x46cb('0x2b')]);}_0x19e0ad[_0x46cb('0x43')]=qs[_0x46cb('0x44')](_0x244084[_0x46cb('0x3e')]['sort']);_0x19e0ad['where']=qs[_0x46cb('0x45')](_['pick'](_0x244084[_0x46cb('0x3e')],_0xe4504e[_0x46cb('0x45')]),_0x4f0fb6);if(_0x244084['query'][_0x46cb('0x46')]){_0x19e0ad[_0x46cb('0x47')]=_[_0x46cb('0x48')](_0x19e0ad['where'],{'$or':_['map'](_0x4f0fb6,function(_0x5cbdad){if(_0x5cbdad['type']!==_0x46cb('0x49')){var _0x23dd2e={};_0x23dd2e[_0x5cbdad[_0x46cb('0x36')]]={'$like':'%'+_0x244084[_0x46cb('0x3e')][_0x46cb('0x46')]+'%'};return _0x23dd2e;}})});}_0x19e0ad=_['merge']({},_0x19e0ad,_0x244084['options']);var _0x2908fb={'where':_0x19e0ad[_0x46cb('0x47')]};return db['ServicenowConfiguration'][_0x46cb('0x2a')](_0x2908fb)[_0x46cb('0x1d')](function(_0x12f31e){_0xba5e93[_0x46cb('0x2a')]=_0x12f31e;if(_0x244084[_0x46cb('0x3e')][_0x46cb('0x4a')]){_0x19e0ad[_0x46cb('0x4b')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x19e0ad);})[_0x46cb('0x1d')](function(_0x52ed52){_0xba5e93[_0x46cb('0x4c')]=_0x52ed52;return _0xba5e93;})[_0x46cb('0x1d')](respondWithFilteredResult(_0x3dabed,_0x19e0ad))[_0x46cb('0x4d')](handleError(_0x3dabed,null));};exports['show']=function(_0x37163b,_0x5c1665){var _0x5c02c9={'raw':![],'where':{'id':_0x37163b[_0x46cb('0x4e')]['id']}},_0x16c500={};_0x16c500[_0x46cb('0x3d')]=_[_0x46cb('0x4f')](db[_0x46cb('0x50')][_0x46cb('0x39')]);_0x16c500[_0x46cb('0x3e')]=_['keys'](_0x37163b['query']);_0x16c500[_0x46cb('0x45')]=_[_0x46cb('0x3f')](_0x16c500['model'],_0x16c500[_0x46cb('0x3e')]);_0x5c02c9[_0x46cb('0x41')]=_[_0x46cb('0x3f')](_0x16c500[_0x46cb('0x3d')],qs[_0x46cb('0x40')](_0x37163b['query'][_0x46cb('0x40')]));_0x5c02c9[_0x46cb('0x41')]=_0x5c02c9[_0x46cb('0x41')]['length']?_0x5c02c9[_0x46cb('0x41')]:_0x16c500['model'];if(_0x37163b['query'][_0x46cb('0x4a')]){_0x5c02c9[_0x46cb('0x4b')]=[{'all':!![]}];}_0x5c02c9=_[_0x46cb('0x48')]({},_0x5c02c9,_0x37163b[_0x46cb('0x51')]);return db[_0x46cb('0x50')]['find'](_0x5c02c9)[_0x46cb('0x1d')](handleEntityNotFound(_0x5c1665,null))[_0x46cb('0x1d')](respondWithResult(_0x5c1665,null))['catch'](handleError(_0x5c1665,null));};exports['create']=function(_0x1230db,_0xfccf57){return db[_0x46cb('0x50')]['create'](_0x1230db[_0x46cb('0x52')],{})[_0x46cb('0x1d')](respondWithResult(_0xfccf57,0xc9))[_0x46cb('0x4d')](handleError(_0xfccf57,null));};exports[_0x46cb('0x31')]=function(_0x46407d,_0x3f415d){if(_0x46407d[_0x46cb('0x52')]['id']){delete _0x46407d[_0x46cb('0x52')]['id'];}return db[_0x46cb('0x50')]['find']({'where':{'id':_0x46407d[_0x46cb('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3f415d,null))[_0x46cb('0x1d')](saveUpdates(_0x46407d[_0x46cb('0x52')],null))[_0x46cb('0x1d')](respondWithResult(_0x3f415d,null))[_0x46cb('0x4d')](handleError(_0x3f415d,null));};exports['destroy']=function(_0x67fb77,_0x13d25f){return db[_0x46cb('0x50')][_0x46cb('0x53')]({'where':{'id':_0x67fb77[_0x46cb('0x4e')]['id']}})[_0x46cb('0x1d')](handleEntityNotFound(_0x13d25f,null))[_0x46cb('0x1d')](removeEntity(_0x13d25f,null))[_0x46cb('0x4d')](handleError(_0x13d25f,null));};exports['getFields']=function(_0x4a0606,_0x5a4b11,_0x50626e){var _0x429189={};var _0xdb582b={};var _0x5e08f0;var _0x429b39;return db[_0x46cb('0x50')][_0x46cb('0x54')]({'where':{'id':_0x4a0606['params']['id']}})['then'](handleEntityNotFound(_0x5a4b11,null))[_0x46cb('0x1d')](function(_0x57acfc){if(_0x57acfc){_0x5e08f0=_0x57acfc;_0xdb582b[_0x46cb('0x3d')]=_[_0x46cb('0x4f')](db[_0x46cb('0x55')][_0x46cb('0x39')]);_0xdb582b[_0x46cb('0x3e')]=_[_0x46cb('0x4f')](_0x4a0606[_0x46cb('0x3e')]);_0xdb582b[_0x46cb('0x45')]=_[_0x46cb('0x3f')](_0xdb582b[_0x46cb('0x3d')],_0xdb582b[_0x46cb('0x3e')]);_0x429189[_0x46cb('0x41')]=_[_0x46cb('0x3f')](_0xdb582b['model'],qs[_0x46cb('0x40')](_0x4a0606['query'][_0x46cb('0x40')]));_0x429189[_0x46cb('0x41')]=_0x429189[_0x46cb('0x41')][_0x46cb('0x56')]?_0x429189[_0x46cb('0x41')]:_0xdb582b[_0x46cb('0x3d')];_0x429189[_0x46cb('0x43')]=qs['sort'](_0x4a0606[_0x46cb('0x3e')][_0x46cb('0x44')]);_0x429189[_0x46cb('0x47')]=qs[_0x46cb('0x45')](_['pick'](_0x4a0606[_0x46cb('0x3e')],_0xdb582b[_0x46cb('0x45')]));if(_0x4a0606[_0x46cb('0x3e')][_0x46cb('0x46')]){_0x429189[_0x46cb('0x47')]=_['merge'](_0x429189[_0x46cb('0x47')],{'$or':_[_0x46cb('0x57')](_0x429189[_0x46cb('0x41')],function(_0x2625e4){var _0x38b4a6={};_0x38b4a6[_0x2625e4]={'$like':'%'+_0x4a0606[_0x46cb('0x3e')][_0x46cb('0x46')]+'%'};return _0x38b4a6;})});}_0x429189=_[_0x46cb('0x48')]({},_0x429189,_0x4a0606['options']);return _0x5e08f0['getFields'](_0x429189);}})['then'](function(_0x2bab19){if(_0x2bab19){_0x429b39=_0x2bab19[_0x46cb('0x56')];if(!_0x4a0606[_0x46cb('0x3e')][_0x46cb('0x58')](_0x46cb('0x42'))){_0x429189[_0x46cb('0x2c')]=qs[_0x46cb('0x2c')](_0x4a0606[_0x46cb('0x3e')][_0x46cb('0x2c')]);_0x429189[_0x46cb('0x2b')]=qs[_0x46cb('0x2b')](_0x4a0606[_0x46cb('0x3e')][_0x46cb('0x2b')]);}return _0x5e08f0[_0x46cb('0x59')](_0x429189);}})['then'](function(_0x2e23e4){if(_0x2e23e4){return _0x2e23e4?{'count':_0x429b39,'rows':_0x2e23e4}:null;}})['then'](respondWithResult(_0x5a4b11,null))[_0x46cb('0x4d')](handleError(_0x5a4b11,null));};exports['getSubjects']=function(_0x424e49,_0x3a2aec,_0x2bb425){var _0x3a8b96={};var _0x585e10={};var _0xa7d3ab;var _0x243565;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x424e49[_0x46cb('0x4e')]['id']}})[_0x46cb('0x1d')](handleEntityNotFound(_0x3a2aec,null))[_0x46cb('0x1d')](function(_0x14f580){if(_0x14f580){_0xa7d3ab=_0x14f580;_0x585e10[_0x46cb('0x3d')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x585e10[_0x46cb('0x3e')]=_[_0x46cb('0x4f')](_0x424e49[_0x46cb('0x3e')]);_0x585e10[_0x46cb('0x45')]=_[_0x46cb('0x3f')](_0x585e10[_0x46cb('0x3d')],_0x585e10[_0x46cb('0x3e')]);_0x3a8b96[_0x46cb('0x41')]=_[_0x46cb('0x3f')](_0x585e10[_0x46cb('0x3d')],qs[_0x46cb('0x40')](_0x424e49['query'][_0x46cb('0x40')]));_0x3a8b96[_0x46cb('0x41')]=_0x3a8b96[_0x46cb('0x41')][_0x46cb('0x56')]?_0x3a8b96['attributes']:_0x585e10[_0x46cb('0x3d')];_0x3a8b96[_0x46cb('0x43')]=qs[_0x46cb('0x44')](_0x424e49[_0x46cb('0x3e')]['sort']);_0x3a8b96[_0x46cb('0x47')]=qs[_0x46cb('0x45')](_[_0x46cb('0x5a')](_0x424e49[_0x46cb('0x3e')],_0x585e10['filters']));if(_0x424e49['query']['filter']){_0x3a8b96[_0x46cb('0x47')]=_['merge'](_0x3a8b96[_0x46cb('0x47')],{'$or':_['map'](_0x3a8b96[_0x46cb('0x41')],function(_0x36a82b){var _0x29566a={};_0x29566a[_0x36a82b]={'$like':'%'+_0x424e49[_0x46cb('0x3e')]['filter']+'%'};return _0x29566a;})});}_0x3a8b96=_[_0x46cb('0x48')]({},_0x3a8b96,_0x424e49[_0x46cb('0x51')]);return _0xa7d3ab[_0x46cb('0x5b')](_0x3a8b96);}})[_0x46cb('0x1d')](function(_0x5747da){if(_0x5747da){_0x243565=_0x5747da['length'];if(!_0x424e49[_0x46cb('0x3e')][_0x46cb('0x58')](_0x46cb('0x42'))){_0x3a8b96[_0x46cb('0x2c')]=qs[_0x46cb('0x2c')](_0x424e49[_0x46cb('0x3e')]['limit']);_0x3a8b96['offset']=qs[_0x46cb('0x2b')](_0x424e49[_0x46cb('0x3e')]['offset']);}return _0xa7d3ab[_0x46cb('0x5b')](_0x3a8b96);}})[_0x46cb('0x1d')](function(_0x20c41d){if(_0x20c41d){return _0x20c41d?{'count':_0x243565,'rows':_0x20c41d}:null;}})[_0x46cb('0x1d')](respondWithResult(_0x3a2aec,null))[_0x46cb('0x4d')](handleError(_0x3a2aec,null));};exports[_0x46cb('0x5c')]=function(_0x1aa6f4,_0x50c575,_0x21a9ca){var _0x1264f3={};var _0x392d6d={};var _0x1641b0;var _0x2a09de;return db[_0x46cb('0x50')][_0x46cb('0x54')]({'where':{'id':_0x1aa6f4[_0x46cb('0x4e')]['id']}})['then'](handleEntityNotFound(_0x50c575,null))['then'](function(_0x3cb612){if(_0x3cb612){_0x1641b0=_0x3cb612;_0x392d6d[_0x46cb('0x3d')]=_[_0x46cb('0x4f')](db[_0x46cb('0x55')]['rawAttributes']);_0x392d6d[_0x46cb('0x3e')]=_['keys'](_0x1aa6f4['query']);_0x392d6d[_0x46cb('0x45')]=_[_0x46cb('0x3f')](_0x392d6d[_0x46cb('0x3d')],_0x392d6d[_0x46cb('0x3e')]);_0x1264f3['attributes']=_[_0x46cb('0x3f')](_0x392d6d['model'],qs[_0x46cb('0x40')](_0x1aa6f4[_0x46cb('0x3e')][_0x46cb('0x40')]));_0x1264f3[_0x46cb('0x41')]=_0x1264f3[_0x46cb('0x41')][_0x46cb('0x56')]?_0x1264f3['attributes']:_0x392d6d['model'];_0x1264f3[_0x46cb('0x43')]=qs['sort'](_0x1aa6f4[_0x46cb('0x3e')]['sort']);_0x1264f3[_0x46cb('0x47')]=qs[_0x46cb('0x45')](_[_0x46cb('0x5a')](_0x1aa6f4['query'],_0x392d6d[_0x46cb('0x45')]));if(_0x1aa6f4[_0x46cb('0x3e')][_0x46cb('0x46')]){_0x1264f3[_0x46cb('0x47')]=_[_0x46cb('0x48')](_0x1264f3[_0x46cb('0x47')],{'$or':_[_0x46cb('0x57')](_0x1264f3[_0x46cb('0x41')],function(_0x3eadbd){var _0xe82f10={};_0xe82f10[_0x3eadbd]={'$like':'%'+_0x1aa6f4['query']['filter']+'%'};return _0xe82f10;})});}_0x1264f3=_[_0x46cb('0x48')]({},_0x1264f3,_0x1aa6f4[_0x46cb('0x51')]);return _0x1641b0['getDescriptions'](_0x1264f3);}})[_0x46cb('0x1d')](function(_0x4a529b){if(_0x4a529b){_0x2a09de=_0x4a529b['length'];if(!_0x1aa6f4[_0x46cb('0x3e')][_0x46cb('0x58')]('nolimit')){_0x1264f3[_0x46cb('0x2c')]=qs[_0x46cb('0x2c')](_0x1aa6f4[_0x46cb('0x3e')][_0x46cb('0x2c')]);_0x1264f3[_0x46cb('0x2b')]=qs[_0x46cb('0x2b')](_0x1aa6f4['query'][_0x46cb('0x2b')]);}return _0x1641b0[_0x46cb('0x5c')](_0x1264f3);}})[_0x46cb('0x1d')](function(_0x368063){if(_0x368063){return _0x368063?{'count':_0x2a09de,'rows':_0x368063}:null;}})[_0x46cb('0x1d')](respondWithResult(_0x50c575,null))[_0x46cb('0x4d')](handleError(_0x50c575,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 0d502bb..b3c59e4 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 _0xedca=['exports','lodash','util','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x40e854,_0x42f1f6){var _0x1463b3=function(_0x17b100){while(--_0x17b100){_0x40e854['push'](_0x40e854['shift']());}};_0x1463b3(++_0x42f1f6);}(_0xedca,0xc9));var _0xaedc=function(_0x444b3c,_0x4c10d3){_0x444b3c=_0x444b3c-0x0;var _0x47fc18=_0xedca[_0x444b3c];return _0x47fc18;};'use strict';var _=require(_0xaedc('0x0'));var util=require(_0xaedc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaedc('0x2'));var BPromise=require('bluebird');var rp=require(_0xaedc('0x3'));var fs=require('fs');var path=require(_0xaedc('0x4'));var rimraf=require(_0xaedc('0x5'));var config=require(_0xaedc('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xaedc('0x7')]=function(_0x41e4ff,_0xeed7d1){return _0x41e4ff['define']('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xced7=['define','ServicenowConfiguration','int_servicenow_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports'];(function(_0x4babc8,_0x4b42ae){var _0x1ae416=function(_0x5a65f4){while(--_0x5a65f4){_0x4babc8['push'](_0x4babc8['shift']());}};_0x1ae416(++_0x4b42ae);}(_0xced7,0xc7));var _0x7ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7ced('0x0'));var util=require(_0x7ced('0x1'));var logger=require(_0x7ced('0x2'))(_0x7ced('0x3'));var moment=require(_0x7ced('0x4'));var BPromise=require(_0x7ced('0x5'));var rp=require(_0x7ced('0x6'));var fs=require('fs');var path=require(_0x7ced('0x7'));var rimraf=require(_0x7ced('0x8'));var config=require('../../config/environment');var attributes=require(_0x7ced('0x9'));module[_0x7ced('0xa')]=function(_0xc9acda,_0x835f4){return _0xc9acda[_0x7ced('0xb')](_0x7ced('0xc'),attributes,{'tableName':_0x7ced('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 3a80f7e..32095cd 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 _0x99e5=['info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5f46e7,_0x62f9f8){var _0x567e95=function(_0x5cb693){while(--_0x5cb693){_0x5f46e7['push'](_0x5f46e7['shift']());}};_0x567e95(++_0x62f9f8);}(_0x99e5,0x1ad));var _0x599e=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0x99e5[_0x11e30d];return _0x2d4e29;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x599e('0x0'));var rs=require(_0x599e('0x1'));var fs=require('fs');var Redis=require(_0x599e('0x2'));var db=require(_0x599e('0x3'))['db'];var utils=require(_0x599e('0x4'));var logger=require(_0x599e('0x5'))(_0x599e('0x6'));var config=require(_0x599e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x599e('0x8')][_0x599e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a804a,_0x390fa5,_0x4dc7c6){return new BPromise(function(_0x526eb0,_0x3c994b){return client[_0x599e('0xa')](_0x2a804a,_0x4dc7c6)['then'](function(_0x5b5a16){logger[_0x599e('0xb')](_0x599e('0xc'),_0x390fa5,_0x599e('0xd'));logger[_0x599e('0xe')](_0x599e('0xf'),_0x390fa5,_0x599e('0xd'),JSON[_0x599e('0x10')](_0x5b5a16));if(_0x5b5a16[_0x599e('0x11')]){if(_0x5b5a16[_0x599e('0x11')][_0x599e('0x12')]===0x1f4){logger[_0x599e('0x11')](_0x599e('0xc'),_0x390fa5,_0x5b5a16[_0x599e('0x11')]['message']);return _0x3c994b(_0x5b5a16[_0x599e('0x11')]['message']);}logger[_0x599e('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x390fa5,_0x5b5a16[_0x599e('0x11')][_0x599e('0x13')]);return _0x526eb0(_0x5b5a16[_0x599e('0x11')][_0x599e('0x13')]);}else{logger['info'](_0x599e('0xc'),_0x390fa5,'request\x20sent');_0x526eb0(_0x5b5a16[_0x599e('0x14')][_0x599e('0x13')]);}})[_0x599e('0x15')](function(_0x2a2223){logger[_0x599e('0x11')](_0x599e('0xc'),_0x390fa5,_0x2a2223);_0x3c994b(_0x2a2223);});});} \ No newline at end of file +var _0x6924=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','randomstring'];(function(_0x1c2e8e,_0x168e8a){var _0x3db1ab=function(_0x2c285b){while(--_0x2c285b){_0x1c2e8e['push'](_0x1c2e8e['shift']());}};_0x3db1ab(++_0x168e8a);}(_0x6924,0x97));var _0x4692=function(_0x386066,_0x274f3d){_0x386066=_0x386066-0x0;var _0x358d0f=_0x6924[_0x386066];return _0x358d0f;};'use strict';var _=require(_0x4692('0x0'));var util=require('util');var moment=require(_0x4692('0x1'));var BPromise=require('bluebird');var rs=require(_0x4692('0x2'));var fs=require('fs');var Redis=require(_0x4692('0x3'));var db=require(_0x4692('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4692('0x5'));var config=require(_0x4692('0x6'));var jayson=require(_0x4692('0x7'));var client=jayson[_0x4692('0x8')][_0x4692('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x7d134c,_0x3a1226,_0x24aef4){return new BPromise(function(_0x1931c0,_0x4d3fba){return client[_0x4692('0xa')](_0x7d134c,_0x24aef4)['then'](function(_0xf36572){logger[_0x4692('0xb')](_0x4692('0xc'),_0x3a1226,_0x4692('0xd'));logger[_0x4692('0xe')](_0x4692('0xf'),_0x3a1226,'request\x20sent',JSON[_0x4692('0x10')](_0xf36572));if(_0xf36572[_0x4692('0x11')]){if(_0xf36572['error'][_0x4692('0x12')]===0x1f4){logger[_0x4692('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3a1226,_0xf36572[_0x4692('0x11')][_0x4692('0x13')]);return _0x4d3fba(_0xf36572[_0x4692('0x11')][_0x4692('0x13')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x3a1226,_0xf36572[_0x4692('0x11')][_0x4692('0x13')]);return _0x1931c0(_0xf36572[_0x4692('0x11')][_0x4692('0x13')]);}else{logger[_0x4692('0xb')](_0x4692('0xc'),_0x3a1226,_0x4692('0xd'));_0x1931c0(_0xf36572[_0x4692('0x14')][_0x4692('0x13')]);}})[_0x4692('0x15')](function(_0x4afce3){logger[_0x4692('0x11')](_0x4692('0xc'),_0x3a1226,_0x4afce3);_0x4d3fba(_0x4afce3);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index a373d63..56b1b1a 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 _0x8a32=['destroy','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','create','put','update','delete'];(function(_0x5695bd,_0x566382){var _0x3c2972=function(_0x5d4f61){while(--_0x5d4f61){_0x5695bd['push'](_0x5695bd['shift']());}};_0x3c2972(++_0x566382);}(_0x8a32,0x1b5));var _0x28a3=function(_0x44137e,_0x1f5806){_0x44137e=_0x44137e-0x0;var _0x495d0f=_0x8a32[_0x44137e];return _0x495d0f;};'use strict';var multer=require(_0x28a3('0x0'));var util=require(_0x28a3('0x1'));var path=require('path');var timeout=require(_0x28a3('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x28a3('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x28a3('0x4'));var controller=require('./intServicenowField.controller');router[_0x28a3('0x5')]('/',auth[_0x28a3('0x6')](),controller['index']);router[_0x28a3('0x5')](_0x28a3('0x7'),auth[_0x28a3('0x6')](),controller[_0x28a3('0x8')]);router['post']('/',auth[_0x28a3('0x6')](),controller[_0x28a3('0x9')]);router[_0x28a3('0xa')](_0x28a3('0x7'),auth[_0x28a3('0x6')](),controller[_0x28a3('0xb')]);router[_0x28a3('0xc')](_0x28a3('0x7'),auth[_0x28a3('0x6')](),controller[_0x28a3('0xd')]);module[_0x28a3('0xe')]=router; \ No newline at end of file +var _0x5cbc=['multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy'];(function(_0x1a30c7,_0x5d5441){var _0x3be1e6=function(_0x3ee7e8){while(--_0x3ee7e8){_0x1a30c7['push'](_0x1a30c7['shift']());}};_0x3be1e6(++_0x5d5441);}(_0x5cbc,0x1ed));var _0xc5cb=function(_0x5bbff8,_0x24ae4c){_0x5bbff8=_0x5bbff8-0x0;var _0x26e756=_0x5cbc[_0x5bbff8];return _0x26e756;};'use strict';var multer=require(_0xc5cb('0x0'));var util=require(_0xc5cb('0x1'));var path=require('path');var timeout=require(_0xc5cb('0x2'));var express=require('express');var router=express[_0xc5cb('0x3')]();var auth=require(_0xc5cb('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc5cb('0x5'));var controller=require('./intServicenowField.controller');router[_0xc5cb('0x6')]('/',auth[_0xc5cb('0x7')](),controller[_0xc5cb('0x8')]);router['get'](_0xc5cb('0x9'),auth[_0xc5cb('0x7')](),controller[_0xc5cb('0xa')]);router[_0xc5cb('0xb')]('/',auth['isAuthenticated'](),controller[_0xc5cb('0xc')]);router[_0xc5cb('0xd')](_0xc5cb('0x9'),auth[_0xc5cb('0x7')](),controller[_0xc5cb('0xe')]);router[_0xc5cb('0xf')](_0xc5cb('0x9'),auth[_0xc5cb('0x7')](),controller[_0xc5cb('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 830fd51..5e3162e 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 _0x34e9=['ENUM','BOOLEAN','sequelize','string','variable','customVariable','keyValue','STRING'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x34e9,0x102));var _0x934e=function(_0x5583fa,_0x450853){_0x5583fa=_0x5583fa-0x0;var _0x2199d7=_0x34e9[_0x5583fa];return _0x2199d7;};'use strict';var Sequelize=require(_0x934e('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x934e('0x1'),_0x934e('0x2'),_0x934e('0x3'),_0x934e('0x4')),'defaultValue':_0x934e('0x1')},'content':{'type':Sequelize[_0x934e('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x934e('0x6')]('string',_0x934e('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x934e('0x5')]},'idField':{'type':Sequelize[_0x934e('0x5')]},'nameField':{'type':Sequelize[_0x934e('0x5')]},'customField':{'type':Sequelize[_0x934e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0d9f=['keyValue','string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0d9f,0x136));var _0xf0d9=function(_0x4067ac,_0x363603){_0x4067ac=_0x4067ac-0x0;var _0x53d74d=_0x0d9f[_0x4067ac];return _0x53d74d;};'use strict';var Sequelize=require(_0xf0d9('0x0'));module[_0xf0d9('0x1')]={'type':{'type':Sequelize[_0xf0d9('0x2')]('string',_0xf0d9('0x3'),_0xf0d9('0x4'),_0xf0d9('0x5')),'defaultValue':_0xf0d9('0x6')},'content':{'type':Sequelize[_0xf0d9('0x7')]},'key':{'type':Sequelize[_0xf0d9('0x7')]},'keyType':{'type':Sequelize[_0xf0d9('0x2')](_0xf0d9('0x6'),_0xf0d9('0x3'),_0xf0d9('0x4'))},'keyContent':{'type':Sequelize[_0xf0d9('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf0d9('0x7')]},'customField':{'type':Sequelize[_0xf0d9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf0d9('0x7')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index dbfb568..3f5220c 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 _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x241efe,_0x26917e){var _0x410f2c=function(_0x348b49){while(--_0x348b49){_0x241efe['push'](_0x241efe['shift']());}};_0x410f2c(++_0x26917e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));}; \ No newline at end of file +var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x1f77d1,_0x701cb2){var _0x2e65f5=function(_0x32cf34){while(--_0x32cf34){_0x1f77d1['push'](_0x1f77d1['shift']());}};_0x2e65f5(++_0x701cb2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index f3a277f..006169c 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 _0x72de=['path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x72de,0x180));var _0xe72d=function(_0x15474d,_0x504ee9){_0x15474d=_0x15474d-0x0;var _0x1ea55b=_0x72de[_0x15474d];return _0x1ea55b;};'use strict';var _=require(_0xe72d('0x0'));var util=require(_0xe72d('0x1'));var logger=require(_0xe72d('0x2'))('api');var moment=require(_0xe72d('0x3'));var BPromise=require(_0xe72d('0x4'));var rp=require(_0xe72d('0x5'));var fs=require('fs');var path=require(_0xe72d('0x6'));var rimraf=require(_0xe72d('0x7'));var config=require('../../config/environment');var attributes=require(_0xe72d('0x8'));module[_0xe72d('0x9')]=function(_0x535167,_0x1aaa2a){return _0x535167[_0xe72d('0xa')](_0xe72d('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xe72d('0xc'),'fields':[_0xe72d('0xd'),_0xe72d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2319=['servicenow_unique_index','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','ServicenowField','int_servicenow_fields'];(function(_0x4aaec9,_0xbf9622){var _0x33698b=function(_0x2816b9){while(--_0x2816b9){_0x4aaec9['push'](_0x4aaec9['shift']());}};_0x33698b(++_0xbf9622);}(_0x2319,0x1a6));var _0x9231=function(_0x502f03,_0x5635e8){_0x502f03=_0x502f03-0x0;var _0x2aa3c9=_0x2319[_0x502f03];return _0x2aa3c9;};'use strict';var _=require(_0x9231('0x0'));var util=require(_0x9231('0x1'));var logger=require(_0x9231('0x2'))(_0x9231('0x3'));var moment=require(_0x9231('0x4'));var BPromise=require('bluebird');var rp=require(_0x9231('0x5'));var fs=require('fs');var path=require(_0x9231('0x6'));var rimraf=require(_0x9231('0x7'));var config=require(_0x9231('0x8'));var attributes=require('./intServicenowField.attributes');module[_0x9231('0x9')]=function(_0x56a668,_0x5140df){return _0x56a668[_0x9231('0xa')](_0x9231('0xb'),attributes,{'tableName':_0x9231('0xc'),'paranoid':![],'indexes':[{'name':_0x9231('0xd'),'fields':['idField',_0x9231('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index b455366..136240b 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 _0x68cf=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x208897,_0x1cfafc){var _0x1fed9e=function(_0x180576){while(--_0x180576){_0x208897['push'](_0x208897['shift']());}};_0x1fed9e(++_0x1cfafc);}(_0x68cf,0xbf));var _0xf68c=function(_0x45871c,_0x2c2872){_0x45871c=_0x45871c-0x0;var _0x5c6a9c=_0x68cf[_0x45871c];return _0x5c6a9c;};'use strict';var _=require(_0xf68c('0x0'));var util=require(_0xf68c('0x1'));var moment=require(_0xf68c('0x2'));var BPromise=require(_0xf68c('0x3'));var rs=require(_0xf68c('0x4'));var fs=require('fs');var Redis=require(_0xf68c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf68c('0x6'));var logger=require(_0xf68c('0x7'))(_0xf68c('0x8'));var config=require('../../config/environment');var jayson=require(_0xf68c('0x9'));var client=jayson[_0xf68c('0xa')][_0xf68c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a29c4,_0x4a9b64,_0xd61be6){return new BPromise(function(_0x37f378,_0x2047d4){return client[_0xf68c('0xc')](_0x2a29c4,_0xd61be6)['then'](function(_0x3a7284){logger[_0xf68c('0xd')](_0xf68c('0xe'),_0x4a9b64,_0xf68c('0xf'));logger[_0xf68c('0x10')](_0xf68c('0x11'),_0x4a9b64,'request\x20sent',JSON[_0xf68c('0x12')](_0x3a7284));if(_0x3a7284[_0xf68c('0x13')]){if(_0x3a7284[_0xf68c('0x13')][_0xf68c('0x14')]===0x1f4){logger[_0xf68c('0x13')](_0xf68c('0xe'),_0x4a9b64,_0x3a7284['error'][_0xf68c('0x15')]);return _0x2047d4(_0x3a7284[_0xf68c('0x13')][_0xf68c('0x15')]);}logger[_0xf68c('0x13')]('ServicenowField,\x20%s,\x20%s',_0x4a9b64,_0x3a7284[_0xf68c('0x13')]['message']);return _0x37f378(_0x3a7284[_0xf68c('0x13')][_0xf68c('0x15')]);}else{logger[_0xf68c('0xd')](_0xf68c('0xe'),_0x4a9b64,_0xf68c('0xf'));_0x37f378(_0x3a7284[_0xf68c('0x16')]['message']);}})[_0xf68c('0x17')](function(_0x5765fa){logger[_0xf68c('0x13')](_0xf68c('0xe'),_0x4a9b64,_0x5765fa);_0x2047d4(_0x5765fa);});});} \ No newline at end of file +var _0xfacf=['error','code','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s'];(function(_0x34e9df,_0x297e62){var _0x1b04cb=function(_0x5dee0a){while(--_0x5dee0a){_0x34e9df['push'](_0x34e9df['shift']());}};_0x1b04cb(++_0x297e62);}(_0xfacf,0xbd));var _0xffac=function(_0x33754e,_0x9b17bc){_0x33754e=_0x33754e-0x0;var _0x39199c=_0xfacf[_0x33754e];return _0x39199c;};'use strict';var _=require(_0xffac('0x0'));var util=require(_0xffac('0x1'));var moment=require(_0xffac('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffac('0x3'));var db=require(_0xffac('0x4'))['db'];var utils=require(_0xffac('0x5'));var logger=require(_0xffac('0x6'))(_0xffac('0x7'));var config=require(_0xffac('0x8'));var jayson=require(_0xffac('0x9'));var client=jayson[_0xffac('0xa')][_0xffac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda4d5,_0x1ac45a,_0x1ad9dc){return new BPromise(function(_0x554570,_0x355440){return client['request'](_0xbda4d5,_0x1ad9dc)[_0xffac('0xc')](function(_0x52dc0b){logger[_0xffac('0xd')](_0xffac('0xe'),_0x1ac45a,_0xffac('0xf'));logger[_0xffac('0x10')](_0xffac('0x11'),_0x1ac45a,_0xffac('0xf'),JSON['stringify'](_0x52dc0b));if(_0x52dc0b[_0xffac('0x12')]){if(_0x52dc0b[_0xffac('0x12')][_0xffac('0x13')]===0x1f4){logger[_0xffac('0x12')](_0xffac('0xe'),_0x1ac45a,_0x52dc0b[_0xffac('0x12')][_0xffac('0x14')]);return _0x355440(_0x52dc0b[_0xffac('0x12')][_0xffac('0x14')]);}logger['error'](_0xffac('0xe'),_0x1ac45a,_0x52dc0b[_0xffac('0x12')]['message']);return _0x554570(_0x52dc0b[_0xffac('0x12')][_0xffac('0x14')]);}else{logger['info'](_0xffac('0xe'),_0x1ac45a,'request\x20sent');_0x554570(_0x52dc0b[_0xffac('0x15')][_0xffac('0x14')]);}})[_0xffac('0x16')](function(_0xecb0bc){logger[_0xffac('0x12')](_0xffac('0xe'),_0x1ac45a,_0xecb0bc);_0x355440(_0xecb0bc);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 358dfe6..139fa17 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 _0xd309=['/:id/fields','post','create','destroy','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x22a4fc,_0x26fdcf){var _0x412e79=function(_0x213de4){while(--_0x213de4){_0x22a4fc['push'](_0x22a4fc['shift']());}};_0x412e79(++_0x26fdcf);}(_0xd309,0x64));var _0x9d30=function(_0x341eba,_0x620561){_0x341eba=_0x341eba-0x0;var _0x2a0e1e=_0xd309[_0x341eba];return _0x2a0e1e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9d30('0x0'));var express=require(_0x9d30('0x1'));var router=express[_0x9d30('0x2')]();var auth=require(_0x9d30('0x3'));var interaction=require(_0x9d30('0x4'));var config=require(_0x9d30('0x5'));var controller=require(_0x9d30('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9d30('0x7')]);router[_0x9d30('0x8')](_0x9d30('0x9'),auth[_0x9d30('0xa')](),controller[_0x9d30('0xb')]);router['get'](_0x9d30('0xc'),auth[_0x9d30('0xa')](),controller[_0x9d30('0xd')]);router['get'](_0x9d30('0xe'),auth[_0x9d30('0xa')](),controller['getFields']);router[_0x9d30('0xf')]('/',auth[_0x9d30('0xa')](),controller[_0x9d30('0x10')]);router['post'](_0x9d30('0xc'),auth[_0x9d30('0xa')](),controller['addConfiguration']);router['put']('/:id',auth[_0x9d30('0xa')](),controller['update']);router['delete']('/:id',auth[_0x9d30('0xa')](),controller[_0x9d30('0x11')]);module[_0x9d30('0x12')]=router; \ No newline at end of file +var _0x7162=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete','destroy','exports','util'];(function(_0x87239,_0x38c793){var _0x53af1e=function(_0x11eb5f){while(--_0x11eb5f){_0x87239['push'](_0x87239['shift']());}};_0x53af1e(++_0x38c793);}(_0x7162,0x179));var _0x2716=function(_0xdbf14f,_0x4bfcc4){_0xdbf14f=_0xdbf14f-0x0;var _0x3e58a2=_0x7162[_0xdbf14f];return _0x3e58a2;};'use strict';var multer=require('multer');var util=require(_0x2716('0x0'));var path=require(_0x2716('0x1'));var timeout=require(_0x2716('0x2'));var express=require(_0x2716('0x3'));var router=express['Router']();var auth=require(_0x2716('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2716('0x5'));var controller=require(_0x2716('0x6'));router[_0x2716('0x7')]('/',auth['isAuthenticated'](),controller[_0x2716('0x8')]);router['get'](_0x2716('0x9'),auth[_0x2716('0xa')](),controller['show']);router[_0x2716('0x7')](_0x2716('0xb'),auth['isAuthenticated'](),controller[_0x2716('0xc')]);router[_0x2716('0x7')](_0x2716('0xd'),auth[_0x2716('0xa')](),controller['getFields']);router[_0x2716('0xe')]('/',auth[_0x2716('0xa')](),controller[_0x2716('0xf')]);router[_0x2716('0xe')]('/:id/configurations',auth[_0x2716('0xa')](),controller[_0x2716('0x10')]);router['put'](_0x2716('0x9'),auth[_0x2716('0xa')](),controller[_0x2716('0x11')]);router[_0x2716('0x12')](_0x2716('0x9'),auth[_0x2716('0xa')](),controller[_0x2716('0x13')]);module[_0x2716('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index c5b4fe7..83484e4 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 _0x237b=['STRING','username','remoteUri','sequelize','exports'];(function(_0x431e8e,_0x482fd7){var _0x53396c=function(_0x4e0b93){while(--_0x4e0b93){_0x431e8e['push'](_0x431e8e['shift']());}};_0x53396c(++_0x482fd7);}(_0x237b,0x1a7));var _0xb237=function(_0x39470d,_0x2c380d){_0x39470d=_0x39470d-0x0;var _0x11d8f3=_0x237b[_0x39470d];return _0x11d8f3;};'use strict';var Sequelize=require(_0xb237('0x0'));module[_0xb237('0x1')]={'name':{'type':Sequelize[_0xb237('0x2')]},'description':{'type':Sequelize[_0xb237('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xb237('0x3')},'password':{'type':Sequelize[_0xb237('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xb237('0x4')},'serverUrl':{'type':Sequelize[_0xb237('0x2')]}}; \ No newline at end of file +var _0xd449=['sequelize','STRING','remoteUri'];(function(_0x37d3e0,_0x51d1f4){var _0x5512a3=function(_0x496e6b){while(--_0x496e6b){_0x37d3e0['push'](_0x37d3e0['shift']());}};_0x5512a3(++_0x51d1f4);}(_0xd449,0x153));var _0x9d44=function(_0x152449,_0x49f41d){_0x152449=_0x152449-0x0;var _0x5b58b2=_0xd449[_0x152449];return _0x5b58b2;};'use strict';var Sequelize=require(_0x9d44('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9d44('0x1')],'unique':_0x9d44('0x2')},'serverUrl':{'type':Sequelize[_0x9d44('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 15a3477..6db23a1 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 _0x50f1=['The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','destroy','stack','name','send','index','map','SugarcrmAccount','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','filter','options','includeAll','findAll','rows','show','rawAttributes','include','create','body','update','find','params','getConfigurations','SugarcrmConfiguration','merge','nolimit','AccountId','Subjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','findOne','username','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','login','JSON','stringify','PLAIN','Invalid\x20Login','Password\x20Expired','POST','/service/v4_1/rest.php','Calls','values','module_fields','remove','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','client','ValidationError'];(function(_0x2f1338,_0x366e06){var _0x12bd8f=function(_0x57d685){while(--_0x57d685){_0x2f1338['push'](_0x2f1338['shift']());}};_0x12bd8f(++_0x366e06);}(_0x50f1,0x168));var _0x150f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x50f1[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x150f('0x0'));var rimraf=require(_0x150f('0x1'));var zipdir=require(_0x150f('0x2'));var jsonpatch=require(_0x150f('0x3'));var rp=require(_0x150f('0x4'));var moment=require(_0x150f('0x5'));var BPromise=require(_0x150f('0x6'));var Mustache=require(_0x150f('0x7'));var util=require(_0x150f('0x8'));var path=require(_0x150f('0x9'));var sox=require(_0x150f('0xa'));var csv=require(_0x150f('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x150f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x150f('0xd'));var toCsv=require(_0x150f('0xb'));var querystring=require(_0x150f('0xe'));var Papa=require(_0x150f('0xf'));var Redis=require(_0x150f('0x10'));var authService=require(_0x150f('0x11'));var qs=require(_0x150f('0x12'));var as=require(_0x150f('0x13'));var hardwareService=require(_0x150f('0x14'));var logger=require(_0x150f('0x15'))(_0x150f('0x16'));var utils=require('../../config/utils');var config=require(_0x150f('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x150f('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x150f('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x1063b5,_0x34be1a,_0x4bb9d6){if(_0x4bb9d6){var _0x240e2e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x240e2e['test'](_0x34be1a)){return _0x1063b5;}else{throw new db['Sequelize'][(_0x150f('0x1a'))](_0x150f('0x1b'));}}else{return _0x1063b5;}}function respondWithRpcPromise(_0x2df3ee,_0x5b1f70,_0x176b95,_0x3cfbf0){return new BPromise(function(_0x467d8c,_0x5017a9){var _0x53d287=_0x3cfbf0||client;return _0x53d287['request'](_0x2df3ee,_0x176b95)[_0x150f('0x1c')](function(_0x54355b){logger['info'](_0x150f('0x1d'),_0x5b1f70,_0x150f('0x1e'));logger[_0x150f('0x1f')](_0x150f('0x20'),_0x5b1f70,'request\x20sent',JSON['stringify'](_0x54355b));if(_0x54355b[_0x150f('0x21')]){if(_0x54355b['error']['code']===0x1f4){logger['error'](_0x150f('0x1d'),_0x5b1f70,_0x54355b['error']['message']);return _0x5017a9(_0x54355b[_0x150f('0x21')]['message']);}logger[_0x150f('0x21')](_0x150f('0x1d'),_0x5b1f70,_0x54355b[_0x150f('0x21')]['message']);return _0x467d8c(_0x54355b[_0x150f('0x21')][_0x150f('0x22')]);}else{logger['info'](_0x150f('0x1d'),_0x5b1f70,_0x150f('0x1e'));_0x467d8c(_0x54355b[_0x150f('0x23')]['message']);}})[_0x150f('0x24')](function(_0x4280c7){logger[_0x150f('0x21')](_0x150f('0x1d'),_0x5b1f70,_0x4280c7);_0x5017a9(_0x4280c7);});});}function respondWithStatusCode(_0x56e3db,_0x32402d){_0x32402d=_0x32402d||0xcc;return function(_0x5d3c25){if(_0x5d3c25){return _0x56e3db[_0x150f('0x25')](_0x32402d);}return _0x56e3db['status'](_0x32402d)[_0x150f('0x26')]();};}function respondWithResult(_0x1a3647,_0xc88a5c){_0xc88a5c=_0xc88a5c||0xc8;return function(_0x28e8a8){if(_0x28e8a8){return _0x1a3647['status'](_0xc88a5c)[_0x150f('0x27')](_0x28e8a8);}};}function respondWithFilteredResult(_0x5d4fa2,_0x3fa8d7){return function(_0x3e7812){if(_0x3e7812){var _0x160994=_0x3e7812[_0x150f('0x28')],_0x4f2f02=_0x3fa8d7['offset'],_0x6b07f5=_0x3fa8d7[_0x150f('0x29')]+_0x3fa8d7[_0x150f('0x2a')],_0x37e784;if(_0x6b07f5>=_0x160994){_0x6b07f5=_0x160994;_0x37e784=0xc8;}else{_0x37e784=0xce;}_0x5d4fa2[_0x150f('0x2b')](_0x37e784);return _0x5d4fa2[_0x150f('0x2c')](_0x150f('0x2d'),_0x4f2f02+'-'+_0x6b07f5+'/'+_0x160994)[_0x150f('0x27')](_0x3e7812);}return null;};}function patchUpdates(_0x138591){return function(_0x15b93c){try{jsonpatch[_0x150f('0x2e')](_0x15b93c,_0x138591,!![]);}catch(_0x18a447){return BPromise['reject'](_0x18a447);}return _0x15b93c[_0x150f('0x2f')]();};}function saveUpdates(_0x4446b8,_0x1f833d){return function(_0x32948c){if(_0x32948c){return _0x32948c['update'](_0x4446b8)['then'](function(_0x24321f){return _0x24321f;});}return null;};}function removeEntity(_0x33d5cc,_0x3bd3fc){return function(_0x16782f){if(_0x16782f){return _0x16782f[_0x150f('0x30')]()['then'](function(){_0x33d5cc[_0x150f('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c406b,_0x4c004e){return function(_0x911c4f){if(!_0x911c4f){_0x3c406b['sendStatus'](0x194);}return _0x911c4f;};}function handleError(_0x3953b4,_0x2cd01c){_0x2cd01c=_0x2cd01c||0x1f4;return function(_0x29bcc1){logger[_0x150f('0x21')](_0x29bcc1[_0x150f('0x31')]);if(_0x29bcc1['name']){delete _0x29bcc1[_0x150f('0x32')];}_0x3953b4[_0x150f('0x2b')](_0x2cd01c)[_0x150f('0x33')](_0x29bcc1);};}exports[_0x150f('0x34')]=function(_0x2d2584,_0x121730){var _0x4df173={},_0x2d55d9={},_0x49cd0e={'count':0x0,'rows':[]};var _0x338d07=_[_0x150f('0x35')](db[_0x150f('0x36')]['rawAttributes'],function(_0x5aacbb){return{'name':_0x5aacbb['fieldName'],'type':_0x5aacbb['type'][_0x150f('0x37')]};});_0x2d55d9[_0x150f('0x38')]=_[_0x150f('0x35')](_0x338d07,_0x150f('0x32'));_0x2d55d9[_0x150f('0x39')]=_[_0x150f('0x3a')](_0x2d2584[_0x150f('0x39')]);_0x2d55d9[_0x150f('0x3b')]=_[_0x150f('0x3c')](_0x2d55d9[_0x150f('0x38')],_0x2d55d9['query']);_0x4df173[_0x150f('0x3d')]=_['intersection'](_0x2d55d9[_0x150f('0x38')],qs[_0x150f('0x3e')](_0x2d2584[_0x150f('0x39')][_0x150f('0x3e')]));_0x4df173['attributes']=_0x4df173[_0x150f('0x3d')][_0x150f('0x3f')]?_0x4df173[_0x150f('0x3d')]:_0x2d55d9['model'];if(!_0x2d2584[_0x150f('0x39')][_0x150f('0x40')]('nolimit')){_0x4df173[_0x150f('0x2a')]=qs[_0x150f('0x2a')](_0x2d2584[_0x150f('0x39')][_0x150f('0x2a')]);_0x4df173['offset']=qs[_0x150f('0x29')](_0x2d2584[_0x150f('0x39')][_0x150f('0x29')]);}_0x4df173[_0x150f('0x41')]=qs[_0x150f('0x42')](_0x2d2584[_0x150f('0x39')][_0x150f('0x42')]);_0x4df173[_0x150f('0x43')]=qs[_0x150f('0x3b')](_[_0x150f('0x44')](_0x2d2584['query'],_0x2d55d9['filters']),_0x338d07);if(_0x2d2584[_0x150f('0x39')]['filter']){_0x4df173[_0x150f('0x43')]=_['merge'](_0x4df173[_0x150f('0x43')],{'$or':_[_0x150f('0x35')](_0x338d07,function(_0x45a056){if(_0x45a056[_0x150f('0x45')]!=='VIRTUAL'){var _0x5247b8={};_0x5247b8[_0x45a056['name']]={'$like':'%'+_0x2d2584[_0x150f('0x39')][_0x150f('0x46')]+'%'};return _0x5247b8;}})});}_0x4df173=_['merge']({},_0x4df173,_0x2d2584[_0x150f('0x47')]);var _0x4b91c0={'where':_0x4df173[_0x150f('0x43')]};return db[_0x150f('0x36')][_0x150f('0x28')](_0x4b91c0)['then'](function(_0x5ee112){_0x49cd0e[_0x150f('0x28')]=_0x5ee112;if(_0x2d2584[_0x150f('0x39')][_0x150f('0x48')]){_0x4df173['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x150f('0x49')](_0x4df173);})[_0x150f('0x1c')](function(_0x338311){_0x49cd0e[_0x150f('0x4a')]=_0x338311;return _0x49cd0e;})[_0x150f('0x1c')](respondWithFilteredResult(_0x121730,_0x4df173))[_0x150f('0x24')](handleError(_0x121730,null));};exports[_0x150f('0x4b')]=function(_0x50bdcb,_0x41af0b){var _0x3a24ad={'raw':![],'where':{'id':_0x50bdcb['params']['id']}},_0x82e31a={};_0x82e31a['model']=_['keys'](db[_0x150f('0x36')][_0x150f('0x4c')]);_0x82e31a[_0x150f('0x39')]=_[_0x150f('0x3a')](_0x50bdcb[_0x150f('0x39')]);_0x82e31a['filters']=_[_0x150f('0x3c')](_0x82e31a[_0x150f('0x38')],_0x82e31a[_0x150f('0x39')]);_0x3a24ad[_0x150f('0x3d')]=_[_0x150f('0x3c')](_0x82e31a[_0x150f('0x38')],qs[_0x150f('0x3e')](_0x50bdcb[_0x150f('0x39')][_0x150f('0x3e')]));_0x3a24ad[_0x150f('0x3d')]=_0x3a24ad[_0x150f('0x3d')][_0x150f('0x3f')]?_0x3a24ad[_0x150f('0x3d')]:_0x82e31a['model'];if(_0x50bdcb[_0x150f('0x39')][_0x150f('0x48')]){_0x3a24ad[_0x150f('0x4d')]=[{'all':!![]}];}_0x3a24ad=_['merge']({},_0x3a24ad,_0x50bdcb[_0x150f('0x47')]);return db[_0x150f('0x36')]['find'](_0x3a24ad)[_0x150f('0x1c')](handleEntityNotFound(_0x41af0b,null))[_0x150f('0x1c')](respondWithResult(_0x41af0b,null))[_0x150f('0x24')](handleError(_0x41af0b,null));};exports[_0x150f('0x4e')]=function(_0x44135c,_0x431055){return db['SugarcrmAccount']['create'](_0x44135c[_0x150f('0x4f')],{})[_0x150f('0x1c')](respondWithResult(_0x431055,0xc9))[_0x150f('0x24')](handleError(_0x431055,null));};exports[_0x150f('0x50')]=function(_0x5e0294,_0x4a7941){if(_0x5e0294[_0x150f('0x4f')]['id']){delete _0x5e0294[_0x150f('0x4f')]['id'];}return db[_0x150f('0x36')][_0x150f('0x51')]({'where':{'id':_0x5e0294[_0x150f('0x52')]['id']}})[_0x150f('0x1c')](handleEntityNotFound(_0x4a7941,null))['then'](saveUpdates(_0x5e0294['body'],null))[_0x150f('0x1c')](respondWithResult(_0x4a7941,null))[_0x150f('0x24')](handleError(_0x4a7941,null));};exports['destroy']=function(_0x347183,_0x199de6){return db[_0x150f('0x36')][_0x150f('0x51')]({'where':{'id':_0x347183['params']['id']}})['then'](handleEntityNotFound(_0x199de6,null))[_0x150f('0x1c')](removeEntity(_0x199de6,null))[_0x150f('0x24')](handleError(_0x199de6,null));};exports[_0x150f('0x53')]=function(_0x228028,_0x1cb435,_0x1eeb50){var _0x3daa77={};var _0x275e13={};var _0x556c19;var _0xe5f12a;return db[_0x150f('0x36')]['findOne']({'where':{'id':_0x228028[_0x150f('0x52')]['id']}})['then'](handleEntityNotFound(_0x1cb435,null))['then'](function(_0xf67946){if(_0xf67946){_0x556c19=_0xf67946;_0x275e13['model']=_[_0x150f('0x3a')](db[_0x150f('0x54')]['rawAttributes']);_0x275e13[_0x150f('0x39')]=_['keys'](_0x228028[_0x150f('0x39')]);_0x275e13[_0x150f('0x3b')]=_[_0x150f('0x3c')](_0x275e13[_0x150f('0x38')],_0x275e13[_0x150f('0x39')]);_0x3daa77[_0x150f('0x3d')]=_[_0x150f('0x3c')](_0x275e13[_0x150f('0x38')],qs[_0x150f('0x3e')](_0x228028['query'][_0x150f('0x3e')]));_0x3daa77[_0x150f('0x3d')]=_0x3daa77[_0x150f('0x3d')][_0x150f('0x3f')]?_0x3daa77[_0x150f('0x3d')]:_0x275e13[_0x150f('0x38')];_0x3daa77['order']=qs[_0x150f('0x42')](_0x228028[_0x150f('0x39')]['sort']);_0x3daa77[_0x150f('0x43')]=qs[_0x150f('0x3b')](_[_0x150f('0x44')](_0x228028[_0x150f('0x39')],_0x275e13[_0x150f('0x3b')]));if(_0x228028[_0x150f('0x39')]['filter']){_0x3daa77[_0x150f('0x43')]=_[_0x150f('0x55')](_0x3daa77['where'],{'$or':_[_0x150f('0x35')](_0x3daa77[_0x150f('0x3d')],function(_0xdd353d){var _0x48dffb={};_0x48dffb[_0xdd353d]={'$like':'%'+_0x228028['query'][_0x150f('0x46')]+'%'};return _0x48dffb;})});}_0x3daa77=_['merge']({},_0x3daa77,_0x228028[_0x150f('0x47')]);return _0x556c19['getConfigurations'](_0x3daa77);}})[_0x150f('0x1c')](function(_0x4e0cf6){if(_0x4e0cf6){_0xe5f12a=_0x4e0cf6['length'];if(!_0x228028[_0x150f('0x39')]['hasOwnProperty'](_0x150f('0x56'))){_0x3daa77[_0x150f('0x2a')]=qs[_0x150f('0x2a')](_0x228028[_0x150f('0x39')]['limit']);_0x3daa77[_0x150f('0x29')]=qs[_0x150f('0x29')](_0x228028[_0x150f('0x39')]['offset']);}return _0x556c19['getConfigurations'](_0x3daa77);}})[_0x150f('0x1c')](function(_0x285caf){if(_0x285caf){return _0x285caf?{'count':_0xe5f12a,'rows':_0x285caf}:null;}})[_0x150f('0x1c')](respondWithResult(_0x1cb435,null))[_0x150f('0x24')](handleError(_0x1cb435,null));};exports['addConfiguration']=function(_0x1f435d,_0x5079b3,_0x43e346){if(_0x1f435d[_0x150f('0x4f')]['id']){delete _0x1f435d[_0x150f('0x4f')]['id'];}return db[_0x150f('0x36')]['findOne']({'where':{'id':_0x1f435d[_0x150f('0x52')]['id']}})[_0x150f('0x1c')](handleEntityNotFound(_0x5079b3,null))[_0x150f('0x1c')](function(_0x585276){if(_0x585276){_0x1f435d['body'][_0x150f('0x57')]=_0x585276['id'];_0x1f435d[_0x150f('0x4f')][_0x150f('0x58')]=integrations['getSubjects'](_0x1f435d[_0x150f('0x4f')][_0x150f('0x59')],_0x1f435d[_0x150f('0x4f')][_0x150f('0x45')]);_0x1f435d[_0x150f('0x4f')]['Descriptions']=integrations[_0x150f('0x5a')](_0x1f435d[_0x150f('0x4f')][_0x150f('0x59')],_0x1f435d[_0x150f('0x4f')][_0x150f('0x45')]);return db['SugarcrmConfiguration'][_0x150f('0x4e')](_0x1f435d[_0x150f('0x4f')],{'include':[{'model':db['SugarcrmField'],'as':_0x150f('0x58')},{'model':db[_0x150f('0x5b')],'as':_0x150f('0x5c')}]});}return null;})[_0x150f('0x1c')](respondWithResult(_0x5079b3,null))[_0x150f('0x24')](handleError(_0x5079b3,null));};exports[_0x150f('0x5d')]=function(_0x3e783b,_0x3e53af,_0x359241){var _0x43b37f='';var _0x323df3=['id','name',_0x150f('0x5e'),_0x150f('0x5f'),'description',_0x150f('0x60'),_0x150f('0x61'),_0x150f('0x62'),_0x150f('0x63'),_0x150f('0x64'),_0x150f('0x65'),_0x150f('0x66')];return db['SugarcrmAccount'][_0x150f('0x67')]({'where':{'id':_0x3e783b['params']['id']},'attributes':['id',_0x150f('0x68'),_0x150f('0x69'),_0x150f('0x6a')]})[_0x150f('0x1c')](handleEntityNotFound(_0x3e53af,null))['then'](function(_0x4c6caa){if(_0x4c6caa){_0x43b37f=_0x4c6caa[_0x150f('0x6a')];var _0x449f46=_0x43b37f[_0x150f('0x6b')](-0x1);if(_0x449f46==='/'){_0x43b37f=_0x43b37f[_0x150f('0x6c')](0x0,_0x43b37f[_0x150f('0x6d')](_0x449f46));}return rp({'method':'POST','uri':util[_0x150f('0x6e')](_0x150f('0x6f'),_0x43b37f,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x150f('0x70'),'input_type':'JSON','response_type':_0x150f('0x71'),'rest_data':JSON[_0x150f('0x72')]({'user_auth':{'user_name':_0x4c6caa[_0x150f('0x68')],'password':_0x4c6caa[_0x150f('0x69')],'encryption':_0x150f('0x73')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x54ffc7){if(_0x54ffc7&&_0x54ffc7[_0x150f('0x32')]!==_0x150f('0x74')&&_0x54ffc7[_0x150f('0x32')]!==_0x150f('0x75')){return rp({'method':_0x150f('0x76'),'uri':util[_0x150f('0x6e')]('%s%s',_0x43b37f,_0x150f('0x77')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x54ffc7['id'],'module_name':_0x150f('0x78')})}})[_0x150f('0x1c')](function(_0xe2c952){if(_0xe2c952){var _0x3f4bfa=_[_0x150f('0x79')](_0xe2c952[_0x150f('0x7a')]);_[_0x150f('0x7b')](_0x3f4bfa,function(_0x203486){return _0x323df3['includes'](_0x203486[_0x150f('0x32')]);});return{'count':_0x3f4bfa[_0x150f('0x3f')],'rows':_[_0x150f('0x35')](_0x3f4bfa,function(_0x2fa54c){return{'id':_0x2fa54c[_0x150f('0x32')],'name':_0x2fa54c[_0x150f('0x7c')],'custom':_['endsWith'](_0x2fa54c[_0x150f('0x32')],'_c')?!![]:![],'options':_0x2fa54c[_0x150f('0x47')]?_[_0x150f('0x35')](_[_0x150f('0x79')](_0x2fa54c[_0x150f('0x47')]),function(_0x38a4af){return{'name':_0x38a4af['value'],'value':_0x38a4af[_0x150f('0x32')]};}):[]};})};}})['then'](respondWithResult(_0x3e53af,null))[_0x150f('0x24')](function(_0x3f5200){var _0x116bc4=_0x3e783b[_0x150f('0x39')]['test']?0x1f4:_0x3f5200[_0x150f('0x7d')]||0x1f4;logger[_0x150f('0x21')](_0x150f('0x7e'),_0x150f('0x5d'),_0x116bc4,JSON[_0x150f('0x72')](_0x3f5200));delete _0x3f5200[_0x150f('0x32')];if(_0x116bc4===0x191){_0x116bc4=0x190;}_0x3e53af[_0x150f('0x2b')](_0x116bc4)['send'](_0x3e783b[_0x150f('0x39')][_0x150f('0x7f')]?{'message':_0x150f('0x80'),'statusCode':_0x3f5200[_0x150f('0x7d')]}:_0x3f5200);});}else{var _0x7b17cb=0x1f4;_0x3e53af[_0x150f('0x2b')](_0x7b17cb)[_0x150f('0x33')]({'message':_0x150f('0x80'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xf734=['VIRTUAL','name','options','includeAll','show','params','include','find','create','body','destroy','getConfigurations','findOne','hasOwnProperty','AccountId','getSubjects','Descriptions','getDescriptions','channel','SugarcrmConfiguration','SugarcrmField','Subjects','assigned_user_id','created_by','description','parent_id','parent_name','direction','remoteUri','slice','substring','POST','/service/v4_1/rest.php','login','JSON','username','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','%s%s','get_module_fields','values','module_fields','remove','includes','value','getFields,\x20%s,\x20%s,\x20%s','getFields','statusCode','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','debug','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','info','result','catch','status','end','count','offset','limit','Content-Range','apply','reject','update','then','sendStatus','send','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x866776,_0x2416dc){var _0x548b8d=function(_0x1137fb){while(--_0x1137fb){_0x866776['push'](_0x866776['shift']());}};_0x548b8d(++_0x2416dc);}(_0xf734,0x129));var _0x4f73=function(_0x986b9,_0xfbbb1){_0x986b9=_0x986b9-0x0;var _0x16befb=_0xf734[_0x986b9];return _0x16befb;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x4f73('0x0'));var zipdir=require(_0x4f73('0x1'));var jsonpatch=require(_0x4f73('0x2'));var rp=require(_0x4f73('0x3'));var moment=require('moment');var BPromise=require(_0x4f73('0x4'));var Mustache=require('mustache');var util=require(_0x4f73('0x5'));var path=require('path');var sox=require(_0x4f73('0x6'));var csv=require(_0x4f73('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f73('0x8'));var squel=require(_0x4f73('0x9'));var crypto=require(_0x4f73('0xa'));var jsforce=require(_0x4f73('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4f73('0x7'));var querystring=require('querystring');var Papa=require(_0x4f73('0xc'));var Redis=require(_0x4f73('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x4f73('0xe'));var as=require(_0x4f73('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4f73('0x10'));var config=require(_0x4f73('0x11'));var db=require(_0x4f73('0x12'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x4f73('0x13'));var client=jayson['client'][_0x4f73('0x14')]({'port':0x232a});function checkPasswordPattern(_0x2a47c8,_0x978a49,_0x18ab22){if(_0x18ab22){var _0x90fbfc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x90fbfc[_0x4f73('0x15')](_0x978a49)){return _0x2a47c8;}else{throw new db[(_0x4f73('0x16'))][(_0x4f73('0x17'))](_0x4f73('0x18'));}}else{return _0x2a47c8;}}function respondWithRpcPromise(_0x462426,_0x52954b,_0x4c129e,_0x15af8e){return new BPromise(function(_0x2f34d4,_0x1ef2b9){var _0x39cb7e=_0x15af8e||client;return _0x39cb7e[_0x4f73('0x19')](_0x462426,_0x4c129e)['then'](function(_0x1a8769){logger['info']('SugarcrmAccount,\x20%s,\x20%s',_0x52954b,_0x4f73('0x1a'));logger[_0x4f73('0x1b')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x52954b,'request\x20sent',JSON[_0x4f73('0x1c')](_0x1a8769));if(_0x1a8769[_0x4f73('0x1d')]){if(_0x1a8769[_0x4f73('0x1d')][_0x4f73('0x1e')]===0x1f4){logger['error'](_0x4f73('0x1f'),_0x52954b,_0x1a8769['error'][_0x4f73('0x20')]);return _0x1ef2b9(_0x1a8769[_0x4f73('0x1d')][_0x4f73('0x20')]);}logger[_0x4f73('0x1d')](_0x4f73('0x1f'),_0x52954b,_0x1a8769[_0x4f73('0x1d')][_0x4f73('0x20')]);return _0x2f34d4(_0x1a8769['error'][_0x4f73('0x20')]);}else{logger[_0x4f73('0x21')](_0x4f73('0x1f'),_0x52954b,_0x4f73('0x1a'));_0x2f34d4(_0x1a8769[_0x4f73('0x22')][_0x4f73('0x20')]);}})[_0x4f73('0x23')](function(_0x17e67f){logger[_0x4f73('0x1d')](_0x4f73('0x1f'),_0x52954b,_0x17e67f);_0x1ef2b9(_0x17e67f);});});}function respondWithStatusCode(_0x31e60b,_0x385191){_0x385191=_0x385191||0xcc;return function(_0x3e4ab9){if(_0x3e4ab9){return _0x31e60b['sendStatus'](_0x385191);}return _0x31e60b[_0x4f73('0x24')](_0x385191)[_0x4f73('0x25')]();};}function respondWithResult(_0x4a1ea9,_0x42e378){_0x42e378=_0x42e378||0xc8;return function(_0x38f662){if(_0x38f662){return _0x4a1ea9[_0x4f73('0x24')](_0x42e378)['json'](_0x38f662);}};}function respondWithFilteredResult(_0x4b4efa,_0x4090c1){return function(_0x201927){if(_0x201927){var _0x86f938=_0x201927[_0x4f73('0x26')],_0x1a776e=_0x4090c1[_0x4f73('0x27')],_0x10910c=_0x4090c1[_0x4f73('0x27')]+_0x4090c1[_0x4f73('0x28')],_0xa3e46b;if(_0x10910c>=_0x86f938){_0x10910c=_0x86f938;_0xa3e46b=0xc8;}else{_0xa3e46b=0xce;}_0x4b4efa[_0x4f73('0x24')](_0xa3e46b);return _0x4b4efa['set'](_0x4f73('0x29'),_0x1a776e+'-'+_0x10910c+'/'+_0x86f938)['json'](_0x201927);}return null;};}function patchUpdates(_0x42c98c){return function(_0x2843b5){try{jsonpatch[_0x4f73('0x2a')](_0x2843b5,_0x42c98c,!![]);}catch(_0xd0ea3d){return BPromise[_0x4f73('0x2b')](_0xd0ea3d);}return _0x2843b5['save']();};}function saveUpdates(_0x460cc5,_0x521375){return function(_0x3a6796){if(_0x3a6796){return _0x3a6796[_0x4f73('0x2c')](_0x460cc5)[_0x4f73('0x2d')](function(_0x3ad3e4){return _0x3ad3e4;});}return null;};}function removeEntity(_0x24b371,_0x154505){return function(_0x5ca075){if(_0x5ca075){return _0x5ca075['destroy']()[_0x4f73('0x2d')](function(){_0x24b371[_0x4f73('0x24')](0xcc)[_0x4f73('0x25')]();});}};}function handleEntityNotFound(_0x14b1c6,_0x1eb13e){return function(_0x5bc349){if(!_0x5bc349){_0x14b1c6[_0x4f73('0x2e')](0x194);}return _0x5bc349;};}function handleError(_0x17cf21,_0x3c24ac){_0x3c24ac=_0x3c24ac||0x1f4;return function(_0xf59e92){logger[_0x4f73('0x1d')](_0xf59e92['stack']);if(_0xf59e92['name']){delete _0xf59e92['name'];}_0x17cf21['status'](_0x3c24ac)[_0x4f73('0x2f')](_0xf59e92);};}exports['index']=function(_0x2e23c1,_0x2abee5){var _0x8d024a={},_0x380906={},_0x1e8021={'count':0x0,'rows':[]};var _0x4fb4eb=_[_0x4f73('0x30')](db[_0x4f73('0x31')][_0x4f73('0x32')],function(_0x5ec3d6){return{'name':_0x5ec3d6[_0x4f73('0x33')],'type':_0x5ec3d6[_0x4f73('0x34')][_0x4f73('0x35')]};});_0x380906[_0x4f73('0x36')]=_[_0x4f73('0x30')](_0x4fb4eb,'name');_0x380906[_0x4f73('0x37')]=_[_0x4f73('0x38')](_0x2e23c1[_0x4f73('0x37')]);_0x380906[_0x4f73('0x39')]=_['intersection'](_0x380906[_0x4f73('0x36')],_0x380906[_0x4f73('0x37')]);_0x8d024a[_0x4f73('0x3a')]=_[_0x4f73('0x3b')](_0x380906[_0x4f73('0x36')],qs['fields'](_0x2e23c1['query'][_0x4f73('0x3c')]));_0x8d024a[_0x4f73('0x3a')]=_0x8d024a['attributes'][_0x4f73('0x3d')]?_0x8d024a[_0x4f73('0x3a')]:_0x380906[_0x4f73('0x36')];if(!_0x2e23c1['query']['hasOwnProperty'](_0x4f73('0x3e'))){_0x8d024a[_0x4f73('0x28')]=qs[_0x4f73('0x28')](_0x2e23c1[_0x4f73('0x37')][_0x4f73('0x28')]);_0x8d024a[_0x4f73('0x27')]=qs[_0x4f73('0x27')](_0x2e23c1['query'][_0x4f73('0x27')]);}_0x8d024a[_0x4f73('0x3f')]=qs[_0x4f73('0x40')](_0x2e23c1['query'][_0x4f73('0x40')]);_0x8d024a[_0x4f73('0x41')]=qs['filters'](_[_0x4f73('0x42')](_0x2e23c1['query'],_0x380906[_0x4f73('0x39')]),_0x4fb4eb);if(_0x2e23c1['query'][_0x4f73('0x43')]){_0x8d024a[_0x4f73('0x41')]=_[_0x4f73('0x44')](_0x8d024a['where'],{'$or':_[_0x4f73('0x30')](_0x4fb4eb,function(_0x2473a6){if(_0x2473a6[_0x4f73('0x34')]!==_0x4f73('0x45')){var _0x563f72={};_0x563f72[_0x2473a6[_0x4f73('0x46')]]={'$like':'%'+_0x2e23c1['query']['filter']+'%'};return _0x563f72;}})});}_0x8d024a=_[_0x4f73('0x44')]({},_0x8d024a,_0x2e23c1[_0x4f73('0x47')]);var _0x20b4d4={'where':_0x8d024a[_0x4f73('0x41')]};return db[_0x4f73('0x31')][_0x4f73('0x26')](_0x20b4d4)[_0x4f73('0x2d')](function(_0x5d181a){_0x1e8021[_0x4f73('0x26')]=_0x5d181a;if(_0x2e23c1[_0x4f73('0x37')][_0x4f73('0x48')]){_0x8d024a['include']=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x8d024a);})[_0x4f73('0x2d')](function(_0x530160){_0x1e8021['rows']=_0x530160;return _0x1e8021;})[_0x4f73('0x2d')](respondWithFilteredResult(_0x2abee5,_0x8d024a))['catch'](handleError(_0x2abee5,null));};exports[_0x4f73('0x49')]=function(_0xff3092,_0x21fb76){var _0xaa0405={'raw':![],'where':{'id':_0xff3092[_0x4f73('0x4a')]['id']}},_0x14bf6d={};_0x14bf6d['model']=_['keys'](db[_0x4f73('0x31')][_0x4f73('0x32')]);_0x14bf6d[_0x4f73('0x37')]=_[_0x4f73('0x38')](_0xff3092[_0x4f73('0x37')]);_0x14bf6d[_0x4f73('0x39')]=_['intersection'](_0x14bf6d[_0x4f73('0x36')],_0x14bf6d['query']);_0xaa0405[_0x4f73('0x3a')]=_[_0x4f73('0x3b')](_0x14bf6d[_0x4f73('0x36')],qs[_0x4f73('0x3c')](_0xff3092[_0x4f73('0x37')][_0x4f73('0x3c')]));_0xaa0405['attributes']=_0xaa0405[_0x4f73('0x3a')][_0x4f73('0x3d')]?_0xaa0405[_0x4f73('0x3a')]:_0x14bf6d[_0x4f73('0x36')];if(_0xff3092[_0x4f73('0x37')][_0x4f73('0x48')]){_0xaa0405[_0x4f73('0x4b')]=[{'all':!![]}];}_0xaa0405=_[_0x4f73('0x44')]({},_0xaa0405,_0xff3092[_0x4f73('0x47')]);return db['SugarcrmAccount'][_0x4f73('0x4c')](_0xaa0405)[_0x4f73('0x2d')](handleEntityNotFound(_0x21fb76,null))['then'](respondWithResult(_0x21fb76,null))['catch'](handleError(_0x21fb76,null));};exports[_0x4f73('0x4d')]=function(_0x1f3d0a,_0x1e3b08){return db[_0x4f73('0x31')][_0x4f73('0x4d')](_0x1f3d0a[_0x4f73('0x4e')],{})['then'](respondWithResult(_0x1e3b08,0xc9))['catch'](handleError(_0x1e3b08,null));};exports['update']=function(_0x143f4e,_0x4d2d7c){if(_0x143f4e[_0x4f73('0x4e')]['id']){delete _0x143f4e[_0x4f73('0x4e')]['id'];}return db['SugarcrmAccount'][_0x4f73('0x4c')]({'where':{'id':_0x143f4e[_0x4f73('0x4a')]['id']}})[_0x4f73('0x2d')](handleEntityNotFound(_0x4d2d7c,null))[_0x4f73('0x2d')](saveUpdates(_0x143f4e[_0x4f73('0x4e')],null))[_0x4f73('0x2d')](respondWithResult(_0x4d2d7c,null))['catch'](handleError(_0x4d2d7c,null));};exports[_0x4f73('0x4f')]=function(_0x4e1b0d,_0x1a2bd8){return db['SugarcrmAccount'][_0x4f73('0x4c')]({'where':{'id':_0x4e1b0d[_0x4f73('0x4a')]['id']}})[_0x4f73('0x2d')](handleEntityNotFound(_0x1a2bd8,null))[_0x4f73('0x2d')](removeEntity(_0x1a2bd8,null))[_0x4f73('0x23')](handleError(_0x1a2bd8,null));};exports[_0x4f73('0x50')]=function(_0x1eb367,_0x1e40f0,_0x54dae3){var _0x5b9fc6={};var _0x557fba={};var _0x188886;var _0x10dcfa;return db[_0x4f73('0x31')][_0x4f73('0x51')]({'where':{'id':_0x1eb367[_0x4f73('0x4a')]['id']}})[_0x4f73('0x2d')](handleEntityNotFound(_0x1e40f0,null))[_0x4f73('0x2d')](function(_0x1e5cd3){if(_0x1e5cd3){_0x188886=_0x1e5cd3;_0x557fba[_0x4f73('0x36')]=_[_0x4f73('0x38')](db['SugarcrmConfiguration'][_0x4f73('0x32')]);_0x557fba[_0x4f73('0x37')]=_[_0x4f73('0x38')](_0x1eb367[_0x4f73('0x37')]);_0x557fba[_0x4f73('0x39')]=_[_0x4f73('0x3b')](_0x557fba[_0x4f73('0x36')],_0x557fba[_0x4f73('0x37')]);_0x5b9fc6[_0x4f73('0x3a')]=_[_0x4f73('0x3b')](_0x557fba[_0x4f73('0x36')],qs[_0x4f73('0x3c')](_0x1eb367[_0x4f73('0x37')][_0x4f73('0x3c')]));_0x5b9fc6['attributes']=_0x5b9fc6[_0x4f73('0x3a')][_0x4f73('0x3d')]?_0x5b9fc6[_0x4f73('0x3a')]:_0x557fba['model'];_0x5b9fc6[_0x4f73('0x3f')]=qs['sort'](_0x1eb367[_0x4f73('0x37')]['sort']);_0x5b9fc6[_0x4f73('0x41')]=qs[_0x4f73('0x39')](_[_0x4f73('0x42')](_0x1eb367[_0x4f73('0x37')],_0x557fba['filters']));if(_0x1eb367[_0x4f73('0x37')][_0x4f73('0x43')]){_0x5b9fc6[_0x4f73('0x41')]=_[_0x4f73('0x44')](_0x5b9fc6[_0x4f73('0x41')],{'$or':_['map'](_0x5b9fc6[_0x4f73('0x3a')],function(_0x91a8a8){var _0x2b6044={};_0x2b6044[_0x91a8a8]={'$like':'%'+_0x1eb367[_0x4f73('0x37')][_0x4f73('0x43')]+'%'};return _0x2b6044;})});}_0x5b9fc6=_['merge']({},_0x5b9fc6,_0x1eb367['options']);return _0x188886[_0x4f73('0x50')](_0x5b9fc6);}})[_0x4f73('0x2d')](function(_0x36d17b){if(_0x36d17b){_0x10dcfa=_0x36d17b['length'];if(!_0x1eb367[_0x4f73('0x37')][_0x4f73('0x52')](_0x4f73('0x3e'))){_0x5b9fc6[_0x4f73('0x28')]=qs[_0x4f73('0x28')](_0x1eb367['query'][_0x4f73('0x28')]);_0x5b9fc6[_0x4f73('0x27')]=qs[_0x4f73('0x27')](_0x1eb367[_0x4f73('0x37')][_0x4f73('0x27')]);}return _0x188886['getConfigurations'](_0x5b9fc6);}})['then'](function(_0x15376a){if(_0x15376a){return _0x15376a?{'count':_0x10dcfa,'rows':_0x15376a}:null;}})[_0x4f73('0x2d')](respondWithResult(_0x1e40f0,null))[_0x4f73('0x23')](handleError(_0x1e40f0,null));};exports['addConfiguration']=function(_0x4be118,_0xb02e6b,_0x1948bc){if(_0x4be118[_0x4f73('0x4e')]['id']){delete _0x4be118['body']['id'];}return db['SugarcrmAccount'][_0x4f73('0x51')]({'where':{'id':_0x4be118[_0x4f73('0x4a')]['id']}})[_0x4f73('0x2d')](handleEntityNotFound(_0xb02e6b,null))[_0x4f73('0x2d')](function(_0x1fdde0){if(_0x1fdde0){_0x4be118[_0x4f73('0x4e')][_0x4f73('0x53')]=_0x1fdde0['id'];_0x4be118[_0x4f73('0x4e')]['Subjects']=integrations[_0x4f73('0x54')](_0x4be118[_0x4f73('0x4e')]['channel'],_0x4be118['body']['type']);_0x4be118[_0x4f73('0x4e')][_0x4f73('0x55')]=integrations[_0x4f73('0x56')](_0x4be118[_0x4f73('0x4e')][_0x4f73('0x57')],_0x4be118[_0x4f73('0x4e')][_0x4f73('0x34')]);return db[_0x4f73('0x58')]['create'](_0x4be118[_0x4f73('0x4e')],{'include':[{'model':db[_0x4f73('0x59')],'as':_0x4f73('0x5a')},{'model':db[_0x4f73('0x59')],'as':_0x4f73('0x55')}]});}return null;})[_0x4f73('0x2d')](respondWithResult(_0xb02e6b,null))[_0x4f73('0x23')](handleError(_0xb02e6b,null));};exports['getFields']=function(_0x82dc1e,_0x38f945,_0x4ef33e){var _0x2afeb0='';var _0x15f617=['id',_0x4f73('0x46'),_0x4f73('0x5b'),_0x4f73('0x5c'),_0x4f73('0x5d'),'date_start','duration_hours','duration_minutes',_0x4f73('0x5e'),'parent_type',_0x4f73('0x5f'),_0x4f73('0x60')];return db[_0x4f73('0x31')][_0x4f73('0x51')]({'where':{'id':_0x82dc1e[_0x4f73('0x4a')]['id']},'attributes':['id','username','password',_0x4f73('0x61')]})['then'](handleEntityNotFound(_0x38f945,null))[_0x4f73('0x2d')](function(_0x4330aa){if(_0x4330aa){_0x2afeb0=_0x4330aa['remoteUri'];var _0x287400=_0x2afeb0[_0x4f73('0x62')](-0x1);if(_0x287400==='/'){_0x2afeb0=_0x2afeb0[_0x4f73('0x63')](0x0,_0x2afeb0['lastIndexOf'](_0x287400));}return rp({'method':_0x4f73('0x64'),'uri':util['format']('%s%s',_0x2afeb0,_0x4f73('0x65')),'json':!![],'form':{'method':_0x4f73('0x66'),'input_type':_0x4f73('0x67'),'response_type':_0x4f73('0x67'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x4330aa[_0x4f73('0x68')],'password':_0x4330aa[_0x4f73('0x69')],'encryption':_0x4f73('0x6a')},'application':_0x4f73('0x6b')})}});}})['then'](function(_0x182b2e){if(_0x182b2e&&_0x182b2e['name']!==_0x4f73('0x6c')&&_0x182b2e['name']!==_0x4f73('0x6d')){return rp({'method':_0x4f73('0x64'),'uri':util[_0x4f73('0x6e')](_0x4f73('0x6f'),_0x2afeb0,_0x4f73('0x65')),'json':!![],'form':{'method':_0x4f73('0x70'),'input_type':_0x4f73('0x67'),'response_type':'JSON','rest_data':JSON[_0x4f73('0x1c')]({'session':_0x182b2e['id'],'module_name':'Calls'})}})['then'](function(_0x238768){if(_0x238768){var _0x29683d=_[_0x4f73('0x71')](_0x238768[_0x4f73('0x72')]);_[_0x4f73('0x73')](_0x29683d,function(_0x5a5c9){return _0x15f617[_0x4f73('0x74')](_0x5a5c9['name']);});return{'count':_0x29683d['length'],'rows':_[_0x4f73('0x30')](_0x29683d,function(_0x190dd2){return{'id':_0x190dd2[_0x4f73('0x46')],'name':_0x190dd2['label'],'custom':_['endsWith'](_0x190dd2[_0x4f73('0x46')],'_c')?!![]:![],'options':_0x190dd2[_0x4f73('0x47')]?_['map'](_[_0x4f73('0x71')](_0x190dd2['options']),function(_0x429bb9){return{'name':_0x429bb9[_0x4f73('0x75')],'value':_0x429bb9[_0x4f73('0x46')]};}):[]};})};}})[_0x4f73('0x2d')](respondWithResult(_0x38f945,null))[_0x4f73('0x23')](function(_0x1b2e73){var _0x58d5c6=_0x82dc1e['query']['test']?0x1f4:_0x1b2e73['statusCode']||0x1f4;logger[_0x4f73('0x1d')](_0x4f73('0x76'),_0x4f73('0x77'),_0x58d5c6,JSON[_0x4f73('0x1c')](_0x1b2e73));delete _0x1b2e73['name'];if(_0x58d5c6===0x191){_0x58d5c6=0x190;}_0x38f945[_0x4f73('0x24')](_0x58d5c6)[_0x4f73('0x2f')](_0x82dc1e[_0x4f73('0x37')][_0x4f73('0x15')]?{'message':'Wrong\x20credentials','statusCode':_0x1b2e73[_0x4f73('0x78')]}:_0x1b2e73);});}else{var _0x55583d=0x1f4;_0x38f945[_0x4f73('0x24')](_0x55583d)[_0x4f73('0x2f')]({'message':_0x4f73('0x79'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index b763416..3aca34e 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 _0xf4d3=['../../config/environment','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','path','rimraf'];(function(_0x2173f9,_0x143314){var _0x4bf0a5=function(_0x313b1d){while(--_0x313b1d){_0x2173f9['push'](_0x2173f9['shift']());}};_0x4bf0a5(++_0x143314);}(_0xf4d3,0x18c));var _0x3f4d=function(_0x1def13,_0x52cd74){_0x1def13=_0x1def13-0x0;var _0x19c30c=_0xf4d3[_0x1def13];return _0x19c30c;};'use strict';var _=require(_0x3f4d('0x0'));var util=require(_0x3f4d('0x1'));var logger=require(_0x3f4d('0x2'))(_0x3f4d('0x3'));var moment=require(_0x3f4d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f4d('0x5'));var rimraf=require(_0x3f4d('0x6'));var config=require(_0x3f4d('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x3f4d('0x8'));module[_0x3f4d('0x9')]=function(_0x429357,_0x30eaa9){return _0x429357[_0x3f4d('0xa')](_0x3f4d('0xb'),attributes,{'tableName':_0x3f4d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10fa=['util','../../config/logger','api','bluebird','request-promise','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x410092,_0x3d881a){var _0x4b79bc=function(_0x3a216f){while(--_0x3a216f){_0x410092['push'](_0x410092['shift']());}};_0x4b79bc(++_0x3d881a);}(_0x10fa,0x173));var _0xa10f=function(_0x9e9e74,_0x1100f0){_0x9e9e74=_0x9e9e74-0x0;var _0x27dc97=_0x10fa[_0x9e9e74];return _0x27dc97;};'use strict';var _=require(_0xa10f('0x0'));var util=require(_0xa10f('0x1'));var logger=require(_0xa10f('0x2'))(_0xa10f('0x3'));var moment=require('moment');var BPromise=require(_0xa10f('0x4'));var rp=require(_0xa10f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa10f('0x6'));var config=require('../../config/environment');var attributes=require(_0xa10f('0x7'));var integrations=require(_0xa10f('0x8'));module[_0xa10f('0x9')]=function(_0x4a6733,_0x3569fe){return _0x4a6733['define'](_0xa10f('0xa'),attributes,{'tableName':_0xa10f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index b2222a7..671ad63 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 _0xa827=['result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','raw','options','where','limit','include','map','attributes','model','ShowSugarcrmAccount','find','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa827,0x153));var _0x7a82=function(_0x5180de,_0x36e9c4){_0x5180de=_0x5180de-0x0;var _0x3ec2b9=_0xa827[_0x5180de];return _0x3ec2b9;};'use strict';var _=require(_0x7a82('0x0'));var util=require(_0x7a82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7a82('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a82('0x3'))['db'];var utils=require(_0x7a82('0x4'));var logger=require(_0x7a82('0x5'))(_0x7a82('0x6'));var config=require(_0x7a82('0x7'));var jayson=require(_0x7a82('0x8'));var client=jayson[_0x7a82('0x9')][_0x7a82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xaa27df,_0x5e5e15,_0x495f97){return new BPromise(function(_0x7a705c,_0x53fd63){return client[_0x7a82('0xb')](_0xaa27df,_0x495f97)[_0x7a82('0xc')](function(_0x36ec83){logger[_0x7a82('0xd')](_0x7a82('0xe'),_0x5e5e15,_0x7a82('0xf'));logger[_0x7a82('0x10')](_0x7a82('0x11'),_0x5e5e15,_0x7a82('0xf'),JSON[_0x7a82('0x12')](_0x36ec83));if(_0x36ec83[_0x7a82('0x13')]){if(_0x36ec83[_0x7a82('0x13')]['code']===0x1f4){logger[_0x7a82('0x13')](_0x7a82('0xe'),_0x5e5e15,_0x36ec83[_0x7a82('0x13')][_0x7a82('0x14')]);return _0x53fd63(_0x36ec83[_0x7a82('0x13')]['message']);}logger[_0x7a82('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x5e5e15,_0x36ec83[_0x7a82('0x13')][_0x7a82('0x14')]);return _0x7a705c(_0x36ec83[_0x7a82('0x13')][_0x7a82('0x14')]);}else{logger[_0x7a82('0xd')](_0x7a82('0xe'),_0x5e5e15,_0x7a82('0xf'));_0x7a705c(_0x36ec83[_0x7a82('0x15')][_0x7a82('0x14')]);}})[_0x7a82('0x16')](function(_0x5ea0aa){logger['error'](_0x7a82('0xe'),_0x5e5e15,_0x5ea0aa);_0x53fd63(_0x5ea0aa);});});}exports[_0x7a82('0x17')]=function(_0x521943){var _0x4ba829=this;return new Promise(function(_0x108cf2,_0x18dba0){return db[_0x7a82('0x18')][_0x7a82('0x19')]({'raw':_0x521943['options']?_0x521943['options'][_0x7a82('0x1a')]===undefined?!![]:![]:!![],'where':_0x521943[_0x7a82('0x1b')]?_0x521943[_0x7a82('0x1b')][_0x7a82('0x1c')]||null:null,'attributes':_0x521943[_0x7a82('0x1b')]?_0x521943['options']['attributes']||null:null,'limit':_0x521943[_0x7a82('0x1b')]?_0x521943[_0x7a82('0x1b')][_0x7a82('0x1d')]||null:null,'include':_0x521943[_0x7a82('0x1b')]?_0x521943['options'][_0x7a82('0x1e')]?_[_0x7a82('0x1f')](_0x521943['options'][_0x7a82('0x1e')],function(_0x193633){return{'model':db[_0x193633['model']],'as':_0x193633['as'],'attributes':_0x193633[_0x7a82('0x20')],'include':_0x193633[_0x7a82('0x1e')]?_[_0x7a82('0x1f')](_0x193633['include'],function(_0x1e8b62){return{'model':db[_0x1e8b62[_0x7a82('0x21')]],'as':_0x1e8b62['as'],'attributes':_0x1e8b62[_0x7a82('0x20')],'include':_0x1e8b62['include']?_['map'](_0x1e8b62[_0x7a82('0x1e')],function(_0x546da3){return{'model':db[_0x546da3[_0x7a82('0x21')]],'as':_0x546da3['as'],'attributes':_0x546da3['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a82('0xc')](function(_0x16dfff){logger[_0x7a82('0xd')]('GetSugarcrmAccount',_0x521943);logger['debug'](_0x7a82('0x17'),_0x521943,JSON[_0x7a82('0x12')](_0x16dfff));_0x108cf2(_0x16dfff);})[_0x7a82('0x16')](function(_0x1d8c7f){logger['error'](_0x7a82('0x17'),_0x1d8c7f['message'],_0x521943);_0x18dba0(_0x4ba829[_0x7a82('0x13')](0x1f4,_0x1d8c7f['message']));});});};exports[_0x7a82('0x22')]=function(_0xadec7f){var _0x207f6f=this;return new Promise(function(_0x3b3708,_0x541840){return db[_0x7a82('0x18')][_0x7a82('0x23')]({'raw':_0xadec7f['options']?_0xadec7f[_0x7a82('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xadec7f[_0x7a82('0x1b')]?_0xadec7f[_0x7a82('0x1b')][_0x7a82('0x1c')]||null:null,'attributes':_0xadec7f[_0x7a82('0x1b')]?_0xadec7f[_0x7a82('0x1b')]['attributes']||null:null,'include':_0xadec7f[_0x7a82('0x1b')]?_0xadec7f[_0x7a82('0x1b')][_0x7a82('0x1e')]?_[_0x7a82('0x1f')](_0xadec7f[_0x7a82('0x1b')]['include'],function(_0x590657){return{'model':db[_0x590657[_0x7a82('0x21')]],'as':_0x590657['as'],'attributes':_0x590657['attributes'],'include':_0x590657[_0x7a82('0x1e')]?_['map'](_0x590657[_0x7a82('0x1e')],function(_0x540a1c){return{'model':db[_0x540a1c[_0x7a82('0x21')]],'as':_0x540a1c['as'],'attributes':_0x540a1c[_0x7a82('0x20')],'include':_0x540a1c[_0x7a82('0x1e')]?_[_0x7a82('0x1f')](_0x540a1c['include'],function(_0xc8b7ab){return{'model':db[_0xc8b7ab[_0x7a82('0x21')]],'as':_0xc8b7ab['as'],'attributes':_0xc8b7ab['attributes']};}):[]};}):[]};}):[]:[]})[_0x7a82('0xc')](function(_0x128e05){logger[_0x7a82('0xd')](_0x7a82('0x22'),_0xadec7f);logger[_0x7a82('0x10')]('ShowSugarcrmAccount',_0xadec7f,JSON[_0x7a82('0x12')](_0x128e05));_0x3b3708(_0x128e05);})[_0x7a82('0x16')](function(_0x4b1265){logger[_0x7a82('0x13')](_0x7a82('0x22'),_0x4b1265[_0x7a82('0x14')],_0xadec7f);_0x541840(_0x207f6f[_0x7a82('0x13')](0x1f4,_0x4b1265[_0x7a82('0x14')]));});});}; \ No newline at end of file +var _0xffc6=['GetSugarcrmAccount','options','where','attributes','include','map','model','ShowSugarcrmAccount','SugarcrmAccount','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1064bc,_0x206f12){var _0x5edc45=function(_0x5087bd){while(--_0x5087bd){_0x1064bc['push'](_0x1064bc['shift']());}};_0x5edc45(++_0x206f12);}(_0xffc6,0x10a));var _0x6ffc=function(_0x4dbf9e,_0x27f556){_0x4dbf9e=_0x4dbf9e-0x0;var _0x4293c4=_0xffc6[_0x4dbf9e];return _0x4293c4;};'use strict';var _=require('lodash');var util=require(_0x6ffc('0x0'));var moment=require(_0x6ffc('0x1'));var BPromise=require('bluebird');var rs=require(_0x6ffc('0x2'));var fs=require('fs');var Redis=require(_0x6ffc('0x3'));var db=require(_0x6ffc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6ffc('0x5'))(_0x6ffc('0x6'));var config=require(_0x6ffc('0x7'));var jayson=require(_0x6ffc('0x8'));var client=jayson[_0x6ffc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x333c62,_0x12983d,_0x9811a5){return new BPromise(function(_0x29edc2,_0x3f9bc5){return client['request'](_0x333c62,_0x9811a5)[_0x6ffc('0xa')](function(_0x5dea49){logger[_0x6ffc('0xb')](_0x6ffc('0xc'),_0x12983d,_0x6ffc('0xd'));logger[_0x6ffc('0xe')](_0x6ffc('0xf'),_0x12983d,_0x6ffc('0xd'),JSON[_0x6ffc('0x10')](_0x5dea49));if(_0x5dea49[_0x6ffc('0x11')]){if(_0x5dea49[_0x6ffc('0x11')][_0x6ffc('0x12')]===0x1f4){logger[_0x6ffc('0x11')](_0x6ffc('0xc'),_0x12983d,_0x5dea49[_0x6ffc('0x11')][_0x6ffc('0x13')]);return _0x3f9bc5(_0x5dea49[_0x6ffc('0x11')][_0x6ffc('0x13')]);}logger['error'](_0x6ffc('0xc'),_0x12983d,_0x5dea49[_0x6ffc('0x11')][_0x6ffc('0x13')]);return _0x29edc2(_0x5dea49[_0x6ffc('0x11')]['message']);}else{logger[_0x6ffc('0xb')](_0x6ffc('0xc'),_0x12983d,_0x6ffc('0xd'));_0x29edc2(_0x5dea49[_0x6ffc('0x14')][_0x6ffc('0x13')]);}})[_0x6ffc('0x15')](function(_0x1bfebe){logger['error'](_0x6ffc('0xc'),_0x12983d,_0x1bfebe);_0x3f9bc5(_0x1bfebe);});});}exports[_0x6ffc('0x16')]=function(_0xb175d2){var _0x99dbe6=this;return new Promise(function(_0x3db4c0,_0x1c280b){return db['SugarcrmAccount']['findAll']({'raw':_0xb175d2[_0x6ffc('0x17')]?_0xb175d2[_0x6ffc('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xb175d2[_0x6ffc('0x17')]?_0xb175d2[_0x6ffc('0x17')][_0x6ffc('0x18')]||null:null,'attributes':_0xb175d2[_0x6ffc('0x17')]?_0xb175d2[_0x6ffc('0x17')][_0x6ffc('0x19')]||null:null,'limit':_0xb175d2['options']?_0xb175d2['options']['limit']||null:null,'include':_0xb175d2[_0x6ffc('0x17')]?_0xb175d2[_0x6ffc('0x17')][_0x6ffc('0x1a')]?_[_0x6ffc('0x1b')](_0xb175d2['options']['include'],function(_0x43279c){return{'model':db[_0x43279c['model']],'as':_0x43279c['as'],'attributes':_0x43279c[_0x6ffc('0x19')],'include':_0x43279c[_0x6ffc('0x1a')]?_[_0x6ffc('0x1b')](_0x43279c['include'],function(_0x3fb441){return{'model':db[_0x3fb441['model']],'as':_0x3fb441['as'],'attributes':_0x3fb441[_0x6ffc('0x19')],'include':_0x3fb441[_0x6ffc('0x1a')]?_[_0x6ffc('0x1b')](_0x3fb441[_0x6ffc('0x1a')],function(_0x41e407){return{'model':db[_0x41e407[_0x6ffc('0x1c')]],'as':_0x41e407['as'],'attributes':_0x41e407['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ffc('0xa')](function(_0x1a414e){logger[_0x6ffc('0xb')]('GetSugarcrmAccount',_0xb175d2);logger[_0x6ffc('0xe')](_0x6ffc('0x16'),_0xb175d2,JSON['stringify'](_0x1a414e));_0x3db4c0(_0x1a414e);})[_0x6ffc('0x15')](function(_0x20f079){logger[_0x6ffc('0x11')]('GetSugarcrmAccount',_0x20f079[_0x6ffc('0x13')],_0xb175d2);_0x1c280b(_0x99dbe6['error'](0x1f4,_0x20f079[_0x6ffc('0x13')]));});});};exports[_0x6ffc('0x1d')]=function(_0x20b848){var _0x253d32=this;return new Promise(function(_0x230c71,_0x4886bb){return db[_0x6ffc('0x1e')][_0x6ffc('0x1f')]({'raw':_0x20b848['options']?_0x20b848['options']['raw']===undefined?!![]:![]:!![],'where':_0x20b848[_0x6ffc('0x17')]?_0x20b848[_0x6ffc('0x17')][_0x6ffc('0x18')]||null:null,'attributes':_0x20b848[_0x6ffc('0x17')]?_0x20b848[_0x6ffc('0x17')][_0x6ffc('0x19')]||null:null,'include':_0x20b848['options']?_0x20b848[_0x6ffc('0x17')][_0x6ffc('0x1a')]?_[_0x6ffc('0x1b')](_0x20b848[_0x6ffc('0x17')][_0x6ffc('0x1a')],function(_0x48f23c){return{'model':db[_0x48f23c[_0x6ffc('0x1c')]],'as':_0x48f23c['as'],'attributes':_0x48f23c[_0x6ffc('0x19')],'include':_0x48f23c[_0x6ffc('0x1a')]?_[_0x6ffc('0x1b')](_0x48f23c[_0x6ffc('0x1a')],function(_0x23a5cf){return{'model':db[_0x23a5cf[_0x6ffc('0x1c')]],'as':_0x23a5cf['as'],'attributes':_0x23a5cf[_0x6ffc('0x19')],'include':_0x23a5cf[_0x6ffc('0x1a')]?_[_0x6ffc('0x1b')](_0x23a5cf[_0x6ffc('0x1a')],function(_0x260634){return{'model':db[_0x260634[_0x6ffc('0x1c')]],'as':_0x260634['as'],'attributes':_0x260634['attributes']};}):[]};}):[]};}):[]:[]})[_0x6ffc('0xa')](function(_0x4c13bb){logger[_0x6ffc('0xb')](_0x6ffc('0x1d'),_0x20b848);logger[_0x6ffc('0xe')](_0x6ffc('0x1d'),_0x20b848,JSON[_0x6ffc('0x10')](_0x4c13bb));_0x230c71(_0x4c13bb);})[_0x6ffc('0x15')](function(_0x449d65){logger[_0x6ffc('0x11')](_0x6ffc('0x1d'),_0x449d65['message'],_0x20b848);_0x4886bb(_0x253d32[_0x6ffc('0x11')](0x1f4,_0x449d65[_0x6ffc('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 0aa64f4..a94f552 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 _0x871c=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports'];(function(_0x79064f,_0x476065){var _0x50568d=function(_0x1703fc){while(--_0x1703fc){_0x79064f['push'](_0x79064f['shift']());}};_0x50568d(++_0x476065);}(_0x871c,0x1a0));var _0xc871=function(_0x5d5e2a,_0x4e9d13){_0x5d5e2a=_0x5d5e2a-0x0;var _0x55ef5b=_0x871c[_0x5d5e2a];return _0x55ef5b;};'use strict';var multer=require(_0xc871('0x0'));var util=require(_0xc871('0x1'));var path=require(_0xc871('0x2'));var timeout=require(_0xc871('0x3'));var express=require(_0xc871('0x4'));var router=express['Router']();var auth=require(_0xc871('0x5'));var interaction=require(_0xc871('0x6'));var config=require(_0xc871('0x7'));var controller=require(_0xc871('0x8'));router[_0xc871('0x9')]('/',auth[_0xc871('0xa')](),controller[_0xc871('0xb')]);router[_0xc871('0x9')](_0xc871('0xc'),auth[_0xc871('0xa')](),controller[_0xc871('0xd')]);router['get'](_0xc871('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xc871('0x9')](_0xc871('0xf'),auth[_0xc871('0xa')](),controller[_0xc871('0x10')]);router[_0xc871('0x9')](_0xc871('0x11'),auth['isAuthenticated'](),controller[_0xc871('0x12')]);router[_0xc871('0x13')]('/',auth[_0xc871('0xa')](),controller[_0xc871('0x14')]);router[_0xc871('0x15')]('/:id',auth[_0xc871('0xa')](),controller[_0xc871('0x16')]);router[_0xc871('0x17')]('/:id',auth[_0xc871('0xa')](),controller[_0xc871('0x18')]);module[_0xc871('0x19')]=router; \ No newline at end of file +var _0xebbe=['getFields','/:id/subjects','getDescriptions','post','create','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','/:id/fields','isAuthenticated'];(function(_0x1a0217,_0x422486){var _0x173fe6=function(_0x37f17a){while(--_0x37f17a){_0x1a0217['push'](_0x1a0217['shift']());}};_0x173fe6(++_0x422486);}(_0xebbe,0x171));var _0xeebb=function(_0x2b411a,_0x4a839b){_0x2b411a=_0x2b411a-0x0;var _0x51c3e2=_0xebbe[_0x2b411a];return _0x51c3e2;};'use strict';var multer=require('multer');var util=require(_0xeebb('0x0'));var path=require(_0xeebb('0x1'));var timeout=require(_0xeebb('0x2'));var express=require(_0xeebb('0x3'));var router=express[_0xeebb('0x4')]();var auth=require(_0xeebb('0x5'));var interaction=require(_0xeebb('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0xeebb('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xeebb('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xeebb('0x7')](_0xeebb('0x9'),auth[_0xeebb('0xa')](),controller[_0xeebb('0xb')]);router['get'](_0xeebb('0xc'),auth[_0xeebb('0xa')](),controller['getSubjects']);router[_0xeebb('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xeebb('0xd')]);router[_0xeebb('0xe')]('/',auth['isAuthenticated'](),controller[_0xeebb('0xf')]);router['put'](_0xeebb('0x8'),auth['isAuthenticated'](),controller[_0xeebb('0x10')]);router[_0xeebb('0x11')](_0xeebb('0x8'),auth[_0xeebb('0xa')](),controller['destroy']);module[_0xeebb('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 916191f..05893d9 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 _0x08d9=['STRING','sequelize','exports'];(function(_0x33ccf2,_0xd12408){var _0x9eef39=function(_0x185531){while(--_0x185531){_0x33ccf2['push'](_0x33ccf2['shift']());}};_0x9eef39(++_0xd12408);}(_0x08d9,0xe8));var _0x908d=function(_0x9a4402,_0x170c4e){_0x9a4402=_0x9a4402-0x0;var _0x1b244d=_0x08d9[_0x9a4402];return _0x1b244d;};'use strict';var Sequelize=require(_0x908d('0x0'));module[_0x908d('0x1')]={'name':{'type':Sequelize[_0x908d('0x2')]},'description':{'type':Sequelize[_0x908d('0x2')]}}; \ No newline at end of file +var _0x9b5d=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b5d,0x1d6));var _0xd9b5=function(_0x35f1ea,_0x16c2f2){_0x35f1ea=_0x35f1ea-0x0;var _0x5c2ee2=_0x9b5d[_0x35f1ea];return _0x5c2ee2;};'use strict';var Sequelize=require(_0xd9b5('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd9b5('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index cee8c49..0ab21e5 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 _0x2c96=['find','body','getFields','findOne','nolimit','getSubjects','SugarcrmField','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','request','then','info','request\x20sent','debug','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','SugarcrmConfiguration'];(function(_0x349fae,_0x44bb85){var _0x1e4f92=function(_0x42b653){while(--_0x42b653){_0x349fae['push'](_0x349fae['shift']());}};_0x1e4f92(++_0x44bb85);}(_0x2c96,0xc5));var _0x62c9=function(_0x35be4f,_0x5bbf4b){_0x35be4f=_0x35be4f-0x0;var _0x5662fe=_0x2c96[_0x35be4f];return _0x5662fe;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x62c9('0x0'));var rimraf=require(_0x62c9('0x1'));var zipdir=require(_0x62c9('0x2'));var jsonpatch=require(_0x62c9('0x3'));var rp=require(_0x62c9('0x4'));var moment=require(_0x62c9('0x5'));var BPromise=require(_0x62c9('0x6'));var Mustache=require(_0x62c9('0x7'));var util=require(_0x62c9('0x8'));var path=require(_0x62c9('0x9'));var sox=require('sox');var csv=require(_0x62c9('0xa'));var ejs=require(_0x62c9('0xb'));var fs=require('fs');var _=require(_0x62c9('0xc'));var squel=require('squel');var crypto=require(_0x62c9('0xd'));var jsforce=require(_0x62c9('0xe'));var deskjs=require(_0x62c9('0xf'));var toCsv=require(_0x62c9('0xa'));var querystring=require('querystring');var Papa=require(_0x62c9('0x10'));var Redis=require(_0x62c9('0x11'));var authService=require(_0x62c9('0x12'));var qs=require(_0x62c9('0x13'));var as=require(_0x62c9('0x14'));var hardwareService=require(_0x62c9('0x15'));var logger=require('../../config/logger')(_0x62c9('0x16'));var utils=require(_0x62c9('0x17'));var config=require(_0x62c9('0x18'));var db=require(_0x62c9('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x62c9('0x1a')][_0x62c9('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x51cd4d,_0x2e1cda,_0x2f0dd7){if(_0x2f0dd7){var _0xa358b8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa358b8[_0x62c9('0x1c')](_0x2e1cda)){return _0x51cd4d;}else{throw new db[(_0x62c9('0x1d'))][(_0x62c9('0x1e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x51cd4d;}}function respondWithRpcPromise(_0x3c29a4,_0x760c1,_0x37546f,_0x116b38){return new BPromise(function(_0xafaba0,_0x239996){var _0x54ba7d=_0x116b38||client;return _0x54ba7d[_0x62c9('0x1f')](_0x3c29a4,_0x37546f)[_0x62c9('0x20')](function(_0x702f43){logger[_0x62c9('0x21')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x760c1,_0x62c9('0x22'));logger[_0x62c9('0x23')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x760c1,'request\x20sent',JSON[_0x62c9('0x24')](_0x702f43));if(_0x702f43[_0x62c9('0x25')]){if(_0x702f43[_0x62c9('0x25')]['code']===0x1f4){logger[_0x62c9('0x25')](_0x62c9('0x26'),_0x760c1,_0x702f43[_0x62c9('0x25')][_0x62c9('0x27')]);return _0x239996(_0x702f43['error'][_0x62c9('0x27')]);}logger[_0x62c9('0x25')](_0x62c9('0x26'),_0x760c1,_0x702f43[_0x62c9('0x25')][_0x62c9('0x27')]);return _0xafaba0(_0x702f43['error'][_0x62c9('0x27')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x760c1,_0x62c9('0x22'));_0xafaba0(_0x702f43['result'][_0x62c9('0x27')]);}})['catch'](function(_0x331df4){logger[_0x62c9('0x25')](_0x62c9('0x26'),_0x760c1,_0x331df4);_0x239996(_0x331df4);});});}function respondWithStatusCode(_0x7dcb6a,_0x1cd179){_0x1cd179=_0x1cd179||0xcc;return function(_0x200450){if(_0x200450){return _0x7dcb6a[_0x62c9('0x28')](_0x1cd179);}return _0x7dcb6a[_0x62c9('0x29')](_0x1cd179)['end']();};}function respondWithResult(_0x5e0710,_0x8b77){_0x8b77=_0x8b77||0xc8;return function(_0x35303b){if(_0x35303b){return _0x5e0710[_0x62c9('0x29')](_0x8b77)[_0x62c9('0x2a')](_0x35303b);}};}function respondWithFilteredResult(_0x3d75a9,_0x59bb44){return function(_0x557d93){if(_0x557d93){var _0x3c5b9d=_0x557d93['count'],_0x3cafc2=_0x59bb44[_0x62c9('0x2b')],_0x3e6633=_0x59bb44[_0x62c9('0x2b')]+_0x59bb44[_0x62c9('0x2c')],_0x29c32e;if(_0x3e6633>=_0x3c5b9d){_0x3e6633=_0x3c5b9d;_0x29c32e=0xc8;}else{_0x29c32e=0xce;}_0x3d75a9[_0x62c9('0x29')](_0x29c32e);return _0x3d75a9[_0x62c9('0x2d')](_0x62c9('0x2e'),_0x3cafc2+'-'+_0x3e6633+'/'+_0x3c5b9d)['json'](_0x557d93);}return null;};}function patchUpdates(_0x2eee93){return function(_0x5b14ff){try{jsonpatch[_0x62c9('0x2f')](_0x5b14ff,_0x2eee93,!![]);}catch(_0xa9d117){return BPromise[_0x62c9('0x30')](_0xa9d117);}return _0x5b14ff[_0x62c9('0x31')]();};}function saveUpdates(_0x288dd0,_0x11813e){return function(_0x49a383){if(_0x49a383){return _0x49a383[_0x62c9('0x32')](_0x288dd0)[_0x62c9('0x20')](function(_0x143906){return _0x143906;});}return null;};}function removeEntity(_0x2cba9a,_0x3ac3e3){return function(_0x3620ff){if(_0x3620ff){return _0x3620ff[_0x62c9('0x33')]()[_0x62c9('0x20')](function(){_0x2cba9a[_0x62c9('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f8cf3,_0x45a63d){return function(_0x36fc54){if(!_0x36fc54){_0x3f8cf3['sendStatus'](0x194);}return _0x36fc54;};}function handleError(_0x550b0c,_0x40116f){_0x40116f=_0x40116f||0x1f4;return function(_0x52828c){logger['error'](_0x52828c[_0x62c9('0x34')]);if(_0x52828c[_0x62c9('0x35')]){delete _0x52828c['name'];}_0x550b0c[_0x62c9('0x29')](_0x40116f)[_0x62c9('0x36')](_0x52828c);};}exports[_0x62c9('0x37')]=function(_0x4bc5ca,_0x106b1c){var _0x5e3952={},_0x1870cf={},_0x46cc87={'count':0x0,'rows':[]};var _0x3ae072=_[_0x62c9('0x38')](db['SugarcrmConfiguration'][_0x62c9('0x39')],function(_0x70980d){return{'name':_0x70980d[_0x62c9('0x3a')],'type':_0x70980d[_0x62c9('0x3b')][_0x62c9('0x3c')]};});_0x1870cf['model']=_[_0x62c9('0x38')](_0x3ae072,_0x62c9('0x35'));_0x1870cf[_0x62c9('0x3d')]=_[_0x62c9('0x3e')](_0x4bc5ca[_0x62c9('0x3d')]);_0x1870cf[_0x62c9('0x3f')]=_[_0x62c9('0x40')](_0x1870cf[_0x62c9('0x41')],_0x1870cf['query']);_0x5e3952[_0x62c9('0x42')]=_[_0x62c9('0x40')](_0x1870cf['model'],qs['fields'](_0x4bc5ca[_0x62c9('0x3d')][_0x62c9('0x43')]));_0x5e3952[_0x62c9('0x42')]=_0x5e3952[_0x62c9('0x42')][_0x62c9('0x44')]?_0x5e3952[_0x62c9('0x42')]:_0x1870cf[_0x62c9('0x41')];if(!_0x4bc5ca[_0x62c9('0x3d')][_0x62c9('0x45')]('nolimit')){_0x5e3952[_0x62c9('0x2c')]=qs[_0x62c9('0x2c')](_0x4bc5ca[_0x62c9('0x3d')][_0x62c9('0x2c')]);_0x5e3952[_0x62c9('0x2b')]=qs['offset'](_0x4bc5ca['query']['offset']);}_0x5e3952['order']=qs[_0x62c9('0x46')](_0x4bc5ca['query'][_0x62c9('0x46')]);_0x5e3952[_0x62c9('0x47')]=qs['filters'](_[_0x62c9('0x48')](_0x4bc5ca[_0x62c9('0x3d')],_0x1870cf[_0x62c9('0x3f')]),_0x3ae072);if(_0x4bc5ca[_0x62c9('0x3d')][_0x62c9('0x49')]){_0x5e3952[_0x62c9('0x47')]=_[_0x62c9('0x4a')](_0x5e3952[_0x62c9('0x47')],{'$or':_[_0x62c9('0x38')](_0x3ae072,function(_0x2e58a7){if(_0x2e58a7['type']!==_0x62c9('0x4b')){var _0x14c805={};_0x14c805[_0x2e58a7[_0x62c9('0x35')]]={'$like':'%'+_0x4bc5ca[_0x62c9('0x3d')][_0x62c9('0x49')]+'%'};return _0x14c805;}})});}_0x5e3952=_['merge']({},_0x5e3952,_0x4bc5ca[_0x62c9('0x4c')]);var _0x2ab0b3={'where':_0x5e3952[_0x62c9('0x47')]};return db['SugarcrmConfiguration'][_0x62c9('0x4d')](_0x2ab0b3)[_0x62c9('0x20')](function(_0x5a0303){_0x46cc87[_0x62c9('0x4d')]=_0x5a0303;if(_0x4bc5ca[_0x62c9('0x3d')][_0x62c9('0x4e')]){_0x5e3952[_0x62c9('0x4f')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x62c9('0x50')](_0x5e3952);})[_0x62c9('0x20')](function(_0x4626cf){_0x46cc87['rows']=_0x4626cf;return _0x46cc87;})[_0x62c9('0x20')](respondWithFilteredResult(_0x106b1c,_0x5e3952))[_0x62c9('0x51')](handleError(_0x106b1c,null));};exports[_0x62c9('0x52')]=function(_0x381575,_0xf29265){var _0x2eaf65={'raw':![],'where':{'id':_0x381575[_0x62c9('0x53')]['id']}},_0x1e2652={};_0x1e2652[_0x62c9('0x41')]=_[_0x62c9('0x3e')](db['SugarcrmConfiguration']['rawAttributes']);_0x1e2652[_0x62c9('0x3d')]=_['keys'](_0x381575[_0x62c9('0x3d')]);_0x1e2652['filters']=_['intersection'](_0x1e2652[_0x62c9('0x41')],_0x1e2652[_0x62c9('0x3d')]);_0x2eaf65[_0x62c9('0x42')]=_['intersection'](_0x1e2652[_0x62c9('0x41')],qs[_0x62c9('0x43')](_0x381575[_0x62c9('0x3d')][_0x62c9('0x43')]));_0x2eaf65[_0x62c9('0x42')]=_0x2eaf65[_0x62c9('0x42')][_0x62c9('0x44')]?_0x2eaf65['attributes']:_0x1e2652[_0x62c9('0x41')];if(_0x381575[_0x62c9('0x3d')][_0x62c9('0x4e')]){_0x2eaf65[_0x62c9('0x4f')]=[{'all':!![]}];}_0x2eaf65=_[_0x62c9('0x4a')]({},_0x2eaf65,_0x381575[_0x62c9('0x4c')]);return db[_0x62c9('0x54')][_0x62c9('0x55')](_0x2eaf65)[_0x62c9('0x20')](handleEntityNotFound(_0xf29265,null))[_0x62c9('0x20')](respondWithResult(_0xf29265,null))[_0x62c9('0x51')](handleError(_0xf29265,null));};exports['create']=function(_0x562f45,_0x3f3d13){return db['SugarcrmConfiguration']['create'](_0x562f45[_0x62c9('0x56')],{})[_0x62c9('0x20')](respondWithResult(_0x3f3d13,0xc9))['catch'](handleError(_0x3f3d13,null));};exports[_0x62c9('0x32')]=function(_0x30f931,_0x419973){if(_0x30f931[_0x62c9('0x56')]['id']){delete _0x30f931[_0x62c9('0x56')]['id'];}return db[_0x62c9('0x54')][_0x62c9('0x55')]({'where':{'id':_0x30f931['params']['id']}})[_0x62c9('0x20')](handleEntityNotFound(_0x419973,null))[_0x62c9('0x20')](saveUpdates(_0x30f931[_0x62c9('0x56')],null))[_0x62c9('0x20')](respondWithResult(_0x419973,null))[_0x62c9('0x51')](handleError(_0x419973,null));};exports[_0x62c9('0x33')]=function(_0xdc1ebd,_0x325a61){return db[_0x62c9('0x54')][_0x62c9('0x55')]({'where':{'id':_0xdc1ebd[_0x62c9('0x53')]['id']}})[_0x62c9('0x20')](handleEntityNotFound(_0x325a61,null))[_0x62c9('0x20')](removeEntity(_0x325a61,null))['catch'](handleError(_0x325a61,null));};exports[_0x62c9('0x57')]=function(_0x50bf21,_0x305fe3,_0x287f8e){var _0x5339ad={};var _0x12d3ca={};var _0x2ea5cb;var _0x484e60;return db['SugarcrmConfiguration'][_0x62c9('0x58')]({'where':{'id':_0x50bf21['params']['id']}})[_0x62c9('0x20')](handleEntityNotFound(_0x305fe3,null))[_0x62c9('0x20')](function(_0x5d4efd){if(_0x5d4efd){_0x2ea5cb=_0x5d4efd;_0x12d3ca[_0x62c9('0x41')]=_['keys'](db['SugarcrmField'][_0x62c9('0x39')]);_0x12d3ca[_0x62c9('0x3d')]=_[_0x62c9('0x3e')](_0x50bf21[_0x62c9('0x3d')]);_0x12d3ca['filters']=_[_0x62c9('0x40')](_0x12d3ca['model'],_0x12d3ca['query']);_0x5339ad[_0x62c9('0x42')]=_[_0x62c9('0x40')](_0x12d3ca[_0x62c9('0x41')],qs[_0x62c9('0x43')](_0x50bf21[_0x62c9('0x3d')][_0x62c9('0x43')]));_0x5339ad['attributes']=_0x5339ad[_0x62c9('0x42')][_0x62c9('0x44')]?_0x5339ad[_0x62c9('0x42')]:_0x12d3ca[_0x62c9('0x41')];_0x5339ad['order']=qs[_0x62c9('0x46')](_0x50bf21[_0x62c9('0x3d')][_0x62c9('0x46')]);_0x5339ad[_0x62c9('0x47')]=qs[_0x62c9('0x3f')](_['pick'](_0x50bf21['query'],_0x12d3ca['filters']));if(_0x50bf21['query']['filter']){_0x5339ad[_0x62c9('0x47')]=_[_0x62c9('0x4a')](_0x5339ad[_0x62c9('0x47')],{'$or':_[_0x62c9('0x38')](_0x5339ad['attributes'],function(_0x4a113b){var _0x175188={};_0x175188[_0x4a113b]={'$like':'%'+_0x50bf21['query'][_0x62c9('0x49')]+'%'};return _0x175188;})});}_0x5339ad=_[_0x62c9('0x4a')]({},_0x5339ad,_0x50bf21['options']);return _0x2ea5cb[_0x62c9('0x57')](_0x5339ad);}})['then'](function(_0x2dd8f3){if(_0x2dd8f3){_0x484e60=_0x2dd8f3[_0x62c9('0x44')];if(!_0x50bf21[_0x62c9('0x3d')][_0x62c9('0x45')](_0x62c9('0x59'))){_0x5339ad['limit']=qs[_0x62c9('0x2c')](_0x50bf21[_0x62c9('0x3d')][_0x62c9('0x2c')]);_0x5339ad[_0x62c9('0x2b')]=qs[_0x62c9('0x2b')](_0x50bf21['query'][_0x62c9('0x2b')]);}return _0x2ea5cb[_0x62c9('0x57')](_0x5339ad);}})[_0x62c9('0x20')](function(_0x154f12){if(_0x154f12){return _0x154f12?{'count':_0x484e60,'rows':_0x154f12}:null;}})[_0x62c9('0x20')](respondWithResult(_0x305fe3,null))[_0x62c9('0x51')](handleError(_0x305fe3,null));};exports[_0x62c9('0x5a')]=function(_0x4cab75,_0x34a701,_0x5c95b1){var _0x51a901={};var _0xe6a68c={};var _0x1d458f;var _0x44a067;return db[_0x62c9('0x54')][_0x62c9('0x58')]({'where':{'id':_0x4cab75[_0x62c9('0x53')]['id']}})[_0x62c9('0x20')](handleEntityNotFound(_0x34a701,null))[_0x62c9('0x20')](function(_0x39e09a){if(_0x39e09a){_0x1d458f=_0x39e09a;_0xe6a68c[_0x62c9('0x41')]=_['keys'](db[_0x62c9('0x5b')][_0x62c9('0x39')]);_0xe6a68c[_0x62c9('0x3d')]=_['keys'](_0x4cab75[_0x62c9('0x3d')]);_0xe6a68c['filters']=_['intersection'](_0xe6a68c[_0x62c9('0x41')],_0xe6a68c[_0x62c9('0x3d')]);_0x51a901[_0x62c9('0x42')]=_[_0x62c9('0x40')](_0xe6a68c[_0x62c9('0x41')],qs[_0x62c9('0x43')](_0x4cab75[_0x62c9('0x3d')][_0x62c9('0x43')]));_0x51a901[_0x62c9('0x42')]=_0x51a901[_0x62c9('0x42')][_0x62c9('0x44')]?_0x51a901[_0x62c9('0x42')]:_0xe6a68c['model'];_0x51a901[_0x62c9('0x5c')]=qs[_0x62c9('0x46')](_0x4cab75[_0x62c9('0x3d')][_0x62c9('0x46')]);_0x51a901[_0x62c9('0x47')]=qs[_0x62c9('0x3f')](_[_0x62c9('0x48')](_0x4cab75[_0x62c9('0x3d')],_0xe6a68c[_0x62c9('0x3f')]));if(_0x4cab75['query']['filter']){_0x51a901['where']=_[_0x62c9('0x4a')](_0x51a901[_0x62c9('0x47')],{'$or':_[_0x62c9('0x38')](_0x51a901[_0x62c9('0x42')],function(_0x355edf){var _0x54abaa={};_0x54abaa[_0x355edf]={'$like':'%'+_0x4cab75[_0x62c9('0x3d')][_0x62c9('0x49')]+'%'};return _0x54abaa;})});}_0x51a901=_['merge']({},_0x51a901,_0x4cab75[_0x62c9('0x4c')]);return _0x1d458f[_0x62c9('0x5a')](_0x51a901);}})['then'](function(_0x1c891a){if(_0x1c891a){_0x44a067=_0x1c891a['length'];if(!_0x4cab75[_0x62c9('0x3d')][_0x62c9('0x45')]('nolimit')){_0x51a901[_0x62c9('0x2c')]=qs[_0x62c9('0x2c')](_0x4cab75[_0x62c9('0x3d')][_0x62c9('0x2c')]);_0x51a901[_0x62c9('0x2b')]=qs[_0x62c9('0x2b')](_0x4cab75['query'][_0x62c9('0x2b')]);}return _0x1d458f[_0x62c9('0x5a')](_0x51a901);}})[_0x62c9('0x20')](function(_0x33e6ce){if(_0x33e6ce){return _0x33e6ce?{'count':_0x44a067,'rows':_0x33e6ce}:null;}})[_0x62c9('0x20')](respondWithResult(_0x34a701,null))[_0x62c9('0x51')](handleError(_0x34a701,null));};exports[_0x62c9('0x5d')]=function(_0x276660,_0x7deecd,_0x1a218e){var _0x2dd043={};var _0x30b9bb={};var _0x3eec21;var _0x34c8a2;return db[_0x62c9('0x54')][_0x62c9('0x58')]({'where':{'id':_0x276660[_0x62c9('0x53')]['id']}})['then'](handleEntityNotFound(_0x7deecd,null))[_0x62c9('0x20')](function(_0x30f297){if(_0x30f297){_0x3eec21=_0x30f297;_0x30b9bb[_0x62c9('0x41')]=_[_0x62c9('0x3e')](db['SugarcrmField'][_0x62c9('0x39')]);_0x30b9bb[_0x62c9('0x3d')]=_[_0x62c9('0x3e')](_0x276660[_0x62c9('0x3d')]);_0x30b9bb['filters']=_[_0x62c9('0x40')](_0x30b9bb[_0x62c9('0x41')],_0x30b9bb['query']);_0x2dd043['attributes']=_[_0x62c9('0x40')](_0x30b9bb[_0x62c9('0x41')],qs['fields'](_0x276660[_0x62c9('0x3d')][_0x62c9('0x43')]));_0x2dd043['attributes']=_0x2dd043['attributes'][_0x62c9('0x44')]?_0x2dd043[_0x62c9('0x42')]:_0x30b9bb[_0x62c9('0x41')];_0x2dd043[_0x62c9('0x5c')]=qs['sort'](_0x276660[_0x62c9('0x3d')][_0x62c9('0x46')]);_0x2dd043[_0x62c9('0x47')]=qs[_0x62c9('0x3f')](_[_0x62c9('0x48')](_0x276660[_0x62c9('0x3d')],_0x30b9bb[_0x62c9('0x3f')]));if(_0x276660[_0x62c9('0x3d')]['filter']){_0x2dd043[_0x62c9('0x47')]=_[_0x62c9('0x4a')](_0x2dd043[_0x62c9('0x47')],{'$or':_['map'](_0x2dd043[_0x62c9('0x42')],function(_0x12640a){var _0x4365db={};_0x4365db[_0x12640a]={'$like':'%'+_0x276660[_0x62c9('0x3d')][_0x62c9('0x49')]+'%'};return _0x4365db;})});}_0x2dd043=_[_0x62c9('0x4a')]({},_0x2dd043,_0x276660[_0x62c9('0x4c')]);return _0x3eec21[_0x62c9('0x5d')](_0x2dd043);}})[_0x62c9('0x20')](function(_0x14e161){if(_0x14e161){_0x34c8a2=_0x14e161[_0x62c9('0x44')];if(!_0x276660[_0x62c9('0x3d')][_0x62c9('0x45')](_0x62c9('0x59'))){_0x2dd043[_0x62c9('0x2c')]=qs[_0x62c9('0x2c')](_0x276660[_0x62c9('0x3d')][_0x62c9('0x2c')]);_0x2dd043[_0x62c9('0x2b')]=qs[_0x62c9('0x2b')](_0x276660[_0x62c9('0x3d')]['offset']);}return _0x3eec21[_0x62c9('0x5d')](_0x2dd043);}})[_0x62c9('0x20')](function(_0x5b3944){if(_0x5b3944){return _0x5b3944?{'count':_0x34c8a2,'rows':_0x5b3944}:null;}})[_0x62c9('0x20')](respondWithResult(_0x7deecd,null))[_0x62c9('0x51')](handleError(_0x7deecd,null));}; \ No newline at end of file +var _0x5e0c=['jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','SugarcrmConfiguration','findAll','show','params','includeAll','include','options','find','body','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','lodash','squel'];(function(_0x4a0ed9,_0x1ed52a){var _0x5855b7=function(_0x4e143b){while(--_0x4e143b){_0x4a0ed9['push'](_0x4a0ed9['shift']());}};_0x5855b7(++_0x1ed52a);}(_0x5e0c,0x164));var _0xc5e0=function(_0x41f33c,_0xdba0f5){_0x41f33c=_0x41f33c-0x0;var _0x3e8ee3=_0x5e0c[_0x41f33c];return _0x3e8ee3;};'use strict';var pdf=require(_0xc5e0('0x0'));var emlformat=require(_0xc5e0('0x1'));var rimraf=require(_0xc5e0('0x2'));var zipdir=require(_0xc5e0('0x3'));var jsonpatch=require(_0xc5e0('0x4'));var rp=require(_0xc5e0('0x5'));var moment=require('moment');var BPromise=require(_0xc5e0('0x6'));var Mustache=require(_0xc5e0('0x7'));var util=require('util');var path=require(_0xc5e0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc5e0('0x9'));var fs=require('fs');var _=require(_0xc5e0('0xa'));var squel=require(_0xc5e0('0xb'));var crypto=require('crypto');var jsforce=require(_0xc5e0('0xc'));var deskjs=require(_0xc5e0('0xd'));var toCsv=require(_0xc5e0('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc5e0('0xf'));var authService=require(_0xc5e0('0x10'));var qs=require(_0xc5e0('0x11'));var as=require(_0xc5e0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc5e0('0x13'))(_0xc5e0('0x14'));var utils=require('../../config/utils');var config=require(_0xc5e0('0x15'));var db=require(_0xc5e0('0x16'))['db'];var jayson=require(_0xc5e0('0x17'));var client=jayson[_0xc5e0('0x18')][_0xc5e0('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3ef84,_0x17a0de,_0x3a0e17){if(_0x3a0e17){var _0xb270a8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb270a8[_0xc5e0('0x1a')](_0x17a0de)){return _0x3ef84;}else{throw new db['Sequelize'][(_0xc5e0('0x1b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3ef84;}}function respondWithRpcPromise(_0x52c94d,_0xaf0ca1,_0x3e6a75,_0xffa7e8){return new BPromise(function(_0x1cccc2,_0x186270){var _0x32834e=_0xffa7e8||client;return _0x32834e['request'](_0x52c94d,_0x3e6a75)['then'](function(_0x245b4f){logger[_0xc5e0('0x1c')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xaf0ca1,_0xc5e0('0x1d'));logger[_0xc5e0('0x1e')](_0xc5e0('0x1f'),_0xaf0ca1,_0xc5e0('0x1d'),JSON[_0xc5e0('0x20')](_0x245b4f));if(_0x245b4f[_0xc5e0('0x21')]){if(_0x245b4f['error'][_0xc5e0('0x22')]===0x1f4){logger[_0xc5e0('0x21')](_0xc5e0('0x23'),_0xaf0ca1,_0x245b4f[_0xc5e0('0x21')]['message']);return _0x186270(_0x245b4f[_0xc5e0('0x21')][_0xc5e0('0x24')]);}logger[_0xc5e0('0x21')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xaf0ca1,_0x245b4f['error'][_0xc5e0('0x24')]);return _0x1cccc2(_0x245b4f[_0xc5e0('0x21')][_0xc5e0('0x24')]);}else{logger[_0xc5e0('0x1c')]('SugarcrmConfiguration,\x20%s,\x20%s',_0xaf0ca1,_0xc5e0('0x1d'));_0x1cccc2(_0x245b4f[_0xc5e0('0x25')][_0xc5e0('0x24')]);}})[_0xc5e0('0x26')](function(_0x5a4826){logger['error'](_0xc5e0('0x23'),_0xaf0ca1,_0x5a4826);_0x186270(_0x5a4826);});});}function respondWithStatusCode(_0x156530,_0x370d11){_0x370d11=_0x370d11||0xcc;return function(_0x4ac30c){if(_0x4ac30c){return _0x156530['sendStatus'](_0x370d11);}return _0x156530['status'](_0x370d11)[_0xc5e0('0x27')]();};}function respondWithResult(_0x5a58f0,_0x57682f){_0x57682f=_0x57682f||0xc8;return function(_0x3efe97){if(_0x3efe97){return _0x5a58f0[_0xc5e0('0x28')](_0x57682f)[_0xc5e0('0x29')](_0x3efe97);}};}function respondWithFilteredResult(_0x26de59,_0x3b08b2){return function(_0xd18a4e){if(_0xd18a4e){var _0x5031d2=_0xd18a4e[_0xc5e0('0x2a')],_0xebd7d3=_0x3b08b2[_0xc5e0('0x2b')],_0x502356=_0x3b08b2[_0xc5e0('0x2b')]+_0x3b08b2[_0xc5e0('0x2c')],_0x58a434;if(_0x502356>=_0x5031d2){_0x502356=_0x5031d2;_0x58a434=0xc8;}else{_0x58a434=0xce;}_0x26de59[_0xc5e0('0x28')](_0x58a434);return _0x26de59[_0xc5e0('0x2d')](_0xc5e0('0x2e'),_0xebd7d3+'-'+_0x502356+'/'+_0x5031d2)[_0xc5e0('0x29')](_0xd18a4e);}return null;};}function patchUpdates(_0x4f1eb5){return function(_0x438a1b){try{jsonpatch[_0xc5e0('0x2f')](_0x438a1b,_0x4f1eb5,!![]);}catch(_0x66c48c){return BPromise['reject'](_0x66c48c);}return _0x438a1b[_0xc5e0('0x30')]();};}function saveUpdates(_0x1011b1,_0x570f90){return function(_0x49f59a){if(_0x49f59a){return _0x49f59a[_0xc5e0('0x31')](_0x1011b1)[_0xc5e0('0x32')](function(_0x3226b5){return _0x3226b5;});}return null;};}function removeEntity(_0x50688b,_0x2592ff){return function(_0x56db61){if(_0x56db61){return _0x56db61[_0xc5e0('0x33')]()[_0xc5e0('0x32')](function(){_0x50688b[_0xc5e0('0x28')](0xcc)[_0xc5e0('0x27')]();});}};}function handleEntityNotFound(_0x47412a,_0x14b8da){return function(_0x360adb){if(!_0x360adb){_0x47412a['sendStatus'](0x194);}return _0x360adb;};}function handleError(_0x32867f,_0x439bdc){_0x439bdc=_0x439bdc||0x1f4;return function(_0x13b929){logger[_0xc5e0('0x21')](_0x13b929[_0xc5e0('0x34')]);if(_0x13b929[_0xc5e0('0x35')]){delete _0x13b929[_0xc5e0('0x35')];}_0x32867f['status'](_0x439bdc)[_0xc5e0('0x36')](_0x13b929);};}exports[_0xc5e0('0x37')]=function(_0x4e87a5,_0x48c5eb){var _0x38653f={},_0x6e7e95={},_0x168e3a={'count':0x0,'rows':[]};var _0x208045=_['map'](db['SugarcrmConfiguration'][_0xc5e0('0x38')],function(_0x1c43bd){return{'name':_0x1c43bd[_0xc5e0('0x39')],'type':_0x1c43bd[_0xc5e0('0x3a')][_0xc5e0('0x3b')]};});_0x6e7e95[_0xc5e0('0x3c')]=_[_0xc5e0('0x3d')](_0x208045,_0xc5e0('0x35'));_0x6e7e95['query']=_[_0xc5e0('0x3e')](_0x4e87a5[_0xc5e0('0x3f')]);_0x6e7e95[_0xc5e0('0x40')]=_[_0xc5e0('0x41')](_0x6e7e95[_0xc5e0('0x3c')],_0x6e7e95[_0xc5e0('0x3f')]);_0x38653f[_0xc5e0('0x42')]=_[_0xc5e0('0x41')](_0x6e7e95[_0xc5e0('0x3c')],qs[_0xc5e0('0x43')](_0x4e87a5['query'][_0xc5e0('0x43')]));_0x38653f[_0xc5e0('0x42')]=_0x38653f[_0xc5e0('0x42')][_0xc5e0('0x44')]?_0x38653f['attributes']:_0x6e7e95[_0xc5e0('0x3c')];if(!_0x4e87a5[_0xc5e0('0x3f')][_0xc5e0('0x45')](_0xc5e0('0x46'))){_0x38653f[_0xc5e0('0x2c')]=qs[_0xc5e0('0x2c')](_0x4e87a5[_0xc5e0('0x3f')][_0xc5e0('0x2c')]);_0x38653f[_0xc5e0('0x2b')]=qs[_0xc5e0('0x2b')](_0x4e87a5[_0xc5e0('0x3f')][_0xc5e0('0x2b')]);}_0x38653f[_0xc5e0('0x47')]=qs[_0xc5e0('0x48')](_0x4e87a5[_0xc5e0('0x3f')][_0xc5e0('0x48')]);_0x38653f[_0xc5e0('0x49')]=qs['filters'](_[_0xc5e0('0x4a')](_0x4e87a5[_0xc5e0('0x3f')],_0x6e7e95[_0xc5e0('0x40')]),_0x208045);if(_0x4e87a5[_0xc5e0('0x3f')][_0xc5e0('0x4b')]){_0x38653f['where']=_[_0xc5e0('0x4c')](_0x38653f['where'],{'$or':_[_0xc5e0('0x3d')](_0x208045,function(_0x45bb35){if(_0x45bb35[_0xc5e0('0x3a')]!==_0xc5e0('0x4d')){var _0x5497e8={};_0x5497e8[_0x45bb35['name']]={'$like':'%'+_0x4e87a5['query']['filter']+'%'};return _0x5497e8;}})});}_0x38653f=_[_0xc5e0('0x4c')]({},_0x38653f,_0x4e87a5['options']);var _0x5119bd={'where':_0x38653f[_0xc5e0('0x49')]};return db[_0xc5e0('0x4e')][_0xc5e0('0x2a')](_0x5119bd)[_0xc5e0('0x32')](function(_0x27c578){_0x168e3a['count']=_0x27c578;if(_0x4e87a5[_0xc5e0('0x3f')]['includeAll']){_0x38653f['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xc5e0('0x4f')](_0x38653f);})['then'](function(_0x4e13da){_0x168e3a['rows']=_0x4e13da;return _0x168e3a;})['then'](respondWithFilteredResult(_0x48c5eb,_0x38653f))['catch'](handleError(_0x48c5eb,null));};exports[_0xc5e0('0x50')]=function(_0x4ed3d1,_0x81eafb){var _0x492418={'raw':![],'where':{'id':_0x4ed3d1[_0xc5e0('0x51')]['id']}},_0x7488a2={};_0x7488a2[_0xc5e0('0x3c')]=_['keys'](db[_0xc5e0('0x4e')][_0xc5e0('0x38')]);_0x7488a2[_0xc5e0('0x3f')]=_['keys'](_0x4ed3d1[_0xc5e0('0x3f')]);_0x7488a2[_0xc5e0('0x40')]=_[_0xc5e0('0x41')](_0x7488a2[_0xc5e0('0x3c')],_0x7488a2[_0xc5e0('0x3f')]);_0x492418[_0xc5e0('0x42')]=_[_0xc5e0('0x41')](_0x7488a2[_0xc5e0('0x3c')],qs[_0xc5e0('0x43')](_0x4ed3d1[_0xc5e0('0x3f')]['fields']));_0x492418[_0xc5e0('0x42')]=_0x492418[_0xc5e0('0x42')]['length']?_0x492418[_0xc5e0('0x42')]:_0x7488a2[_0xc5e0('0x3c')];if(_0x4ed3d1[_0xc5e0('0x3f')][_0xc5e0('0x52')]){_0x492418[_0xc5e0('0x53')]=[{'all':!![]}];}_0x492418=_['merge']({},_0x492418,_0x4ed3d1[_0xc5e0('0x54')]);return db[_0xc5e0('0x4e')][_0xc5e0('0x55')](_0x492418)[_0xc5e0('0x32')](handleEntityNotFound(_0x81eafb,null))[_0xc5e0('0x32')](respondWithResult(_0x81eafb,null))[_0xc5e0('0x26')](handleError(_0x81eafb,null));};exports['create']=function(_0x46e9df,_0x55a497){return db[_0xc5e0('0x4e')]['create'](_0x46e9df[_0xc5e0('0x56')],{})['then'](respondWithResult(_0x55a497,0xc9))['catch'](handleError(_0x55a497,null));};exports[_0xc5e0('0x31')]=function(_0x70b680,_0xb67f56){if(_0x70b680['body']['id']){delete _0x70b680[_0xc5e0('0x56')]['id'];}return db[_0xc5e0('0x4e')][_0xc5e0('0x55')]({'where':{'id':_0x70b680[_0xc5e0('0x51')]['id']}})[_0xc5e0('0x32')](handleEntityNotFound(_0xb67f56,null))[_0xc5e0('0x32')](saveUpdates(_0x70b680[_0xc5e0('0x56')],null))[_0xc5e0('0x32')](respondWithResult(_0xb67f56,null))['catch'](handleError(_0xb67f56,null));};exports[_0xc5e0('0x33')]=function(_0x40c2a2,_0x4f571d){return db[_0xc5e0('0x4e')]['find']({'where':{'id':_0x40c2a2['params']['id']}})[_0xc5e0('0x32')](handleEntityNotFound(_0x4f571d,null))[_0xc5e0('0x32')](removeEntity(_0x4f571d,null))['catch'](handleError(_0x4f571d,null));};exports[_0xc5e0('0x57')]=function(_0x50bccd,_0x245928,_0x1d9675){var _0x419f4a={};var _0x31491a={};var _0x3e5f76;var _0x1c1b81;return db[_0xc5e0('0x4e')][_0xc5e0('0x58')]({'where':{'id':_0x50bccd[_0xc5e0('0x51')]['id']}})[_0xc5e0('0x32')](handleEntityNotFound(_0x245928,null))[_0xc5e0('0x32')](function(_0x51e8f0){if(_0x51e8f0){_0x3e5f76=_0x51e8f0;_0x31491a[_0xc5e0('0x3c')]=_['keys'](db[_0xc5e0('0x59')][_0xc5e0('0x38')]);_0x31491a[_0xc5e0('0x3f')]=_[_0xc5e0('0x3e')](_0x50bccd[_0xc5e0('0x3f')]);_0x31491a[_0xc5e0('0x40')]=_[_0xc5e0('0x41')](_0x31491a[_0xc5e0('0x3c')],_0x31491a[_0xc5e0('0x3f')]);_0x419f4a[_0xc5e0('0x42')]=_[_0xc5e0('0x41')](_0x31491a[_0xc5e0('0x3c')],qs[_0xc5e0('0x43')](_0x50bccd['query'][_0xc5e0('0x43')]));_0x419f4a[_0xc5e0('0x42')]=_0x419f4a[_0xc5e0('0x42')][_0xc5e0('0x44')]?_0x419f4a[_0xc5e0('0x42')]:_0x31491a[_0xc5e0('0x3c')];_0x419f4a[_0xc5e0('0x47')]=qs[_0xc5e0('0x48')](_0x50bccd[_0xc5e0('0x3f')][_0xc5e0('0x48')]);_0x419f4a[_0xc5e0('0x49')]=qs[_0xc5e0('0x40')](_['pick'](_0x50bccd[_0xc5e0('0x3f')],_0x31491a[_0xc5e0('0x40')]));if(_0x50bccd[_0xc5e0('0x3f')][_0xc5e0('0x4b')]){_0x419f4a[_0xc5e0('0x49')]=_['merge'](_0x419f4a[_0xc5e0('0x49')],{'$or':_[_0xc5e0('0x3d')](_0x419f4a[_0xc5e0('0x42')],function(_0x38c69e){var _0x68d09c={};_0x68d09c[_0x38c69e]={'$like':'%'+_0x50bccd[_0xc5e0('0x3f')][_0xc5e0('0x4b')]+'%'};return _0x68d09c;})});}_0x419f4a=_[_0xc5e0('0x4c')]({},_0x419f4a,_0x50bccd[_0xc5e0('0x54')]);return _0x3e5f76['getFields'](_0x419f4a);}})[_0xc5e0('0x32')](function(_0x815dc0){if(_0x815dc0){_0x1c1b81=_0x815dc0[_0xc5e0('0x44')];if(!_0x50bccd[_0xc5e0('0x3f')][_0xc5e0('0x45')](_0xc5e0('0x46'))){_0x419f4a['limit']=qs[_0xc5e0('0x2c')](_0x50bccd[_0xc5e0('0x3f')][_0xc5e0('0x2c')]);_0x419f4a[_0xc5e0('0x2b')]=qs[_0xc5e0('0x2b')](_0x50bccd[_0xc5e0('0x3f')][_0xc5e0('0x2b')]);}return _0x3e5f76[_0xc5e0('0x57')](_0x419f4a);}})[_0xc5e0('0x32')](function(_0x13b903){if(_0x13b903){return _0x13b903?{'count':_0x1c1b81,'rows':_0x13b903}:null;}})[_0xc5e0('0x32')](respondWithResult(_0x245928,null))[_0xc5e0('0x26')](handleError(_0x245928,null));};exports['getSubjects']=function(_0x4d82d0,_0x21c67e,_0x17debd){var _0x47b959={};var _0x1d4fbd={};var _0xf8bb79;var _0x329914;return db[_0xc5e0('0x4e')]['findOne']({'where':{'id':_0x4d82d0['params']['id']}})[_0xc5e0('0x32')](handleEntityNotFound(_0x21c67e,null))[_0xc5e0('0x32')](function(_0xb29897){if(_0xb29897){_0xf8bb79=_0xb29897;_0x1d4fbd[_0xc5e0('0x3c')]=_[_0xc5e0('0x3e')](db[_0xc5e0('0x59')]['rawAttributes']);_0x1d4fbd[_0xc5e0('0x3f')]=_[_0xc5e0('0x3e')](_0x4d82d0['query']);_0x1d4fbd['filters']=_[_0xc5e0('0x41')](_0x1d4fbd['model'],_0x1d4fbd[_0xc5e0('0x3f')]);_0x47b959[_0xc5e0('0x42')]=_['intersection'](_0x1d4fbd['model'],qs[_0xc5e0('0x43')](_0x4d82d0[_0xc5e0('0x3f')][_0xc5e0('0x43')]));_0x47b959['attributes']=_0x47b959[_0xc5e0('0x42')][_0xc5e0('0x44')]?_0x47b959[_0xc5e0('0x42')]:_0x1d4fbd[_0xc5e0('0x3c')];_0x47b959['order']=qs[_0xc5e0('0x48')](_0x4d82d0[_0xc5e0('0x3f')][_0xc5e0('0x48')]);_0x47b959[_0xc5e0('0x49')]=qs[_0xc5e0('0x40')](_[_0xc5e0('0x4a')](_0x4d82d0['query'],_0x1d4fbd[_0xc5e0('0x40')]));if(_0x4d82d0[_0xc5e0('0x3f')][_0xc5e0('0x4b')]){_0x47b959[_0xc5e0('0x49')]=_[_0xc5e0('0x4c')](_0x47b959[_0xc5e0('0x49')],{'$or':_[_0xc5e0('0x3d')](_0x47b959[_0xc5e0('0x42')],function(_0x23a5bc){var _0x399e10={};_0x399e10[_0x23a5bc]={'$like':'%'+_0x4d82d0[_0xc5e0('0x3f')]['filter']+'%'};return _0x399e10;})});}_0x47b959=_['merge']({},_0x47b959,_0x4d82d0[_0xc5e0('0x54')]);return _0xf8bb79['getSubjects'](_0x47b959);}})[_0xc5e0('0x32')](function(_0x27395b){if(_0x27395b){_0x329914=_0x27395b['length'];if(!_0x4d82d0['query'][_0xc5e0('0x45')](_0xc5e0('0x46'))){_0x47b959['limit']=qs[_0xc5e0('0x2c')](_0x4d82d0[_0xc5e0('0x3f')][_0xc5e0('0x2c')]);_0x47b959[_0xc5e0('0x2b')]=qs['offset'](_0x4d82d0[_0xc5e0('0x3f')][_0xc5e0('0x2b')]);}return _0xf8bb79[_0xc5e0('0x5a')](_0x47b959);}})[_0xc5e0('0x32')](function(_0x56525d){if(_0x56525d){return _0x56525d?{'count':_0x329914,'rows':_0x56525d}:null;}})[_0xc5e0('0x32')](respondWithResult(_0x21c67e,null))['catch'](handleError(_0x21c67e,null));};exports[_0xc5e0('0x5b')]=function(_0x19515c,_0xf716d7,_0x47d73b){var _0x20ff15={};var _0x5395be={};var _0x822bcb;var _0x3da0ef;return db[_0xc5e0('0x4e')]['findOne']({'where':{'id':_0x19515c['params']['id']}})[_0xc5e0('0x32')](handleEntityNotFound(_0xf716d7,null))[_0xc5e0('0x32')](function(_0xcdde87){if(_0xcdde87){_0x822bcb=_0xcdde87;_0x5395be['model']=_[_0xc5e0('0x3e')](db['SugarcrmField'][_0xc5e0('0x38')]);_0x5395be[_0xc5e0('0x3f')]=_[_0xc5e0('0x3e')](_0x19515c[_0xc5e0('0x3f')]);_0x5395be[_0xc5e0('0x40')]=_['intersection'](_0x5395be[_0xc5e0('0x3c')],_0x5395be[_0xc5e0('0x3f')]);_0x20ff15[_0xc5e0('0x42')]=_[_0xc5e0('0x41')](_0x5395be[_0xc5e0('0x3c')],qs[_0xc5e0('0x43')](_0x19515c[_0xc5e0('0x3f')][_0xc5e0('0x43')]));_0x20ff15[_0xc5e0('0x42')]=_0x20ff15[_0xc5e0('0x42')]['length']?_0x20ff15[_0xc5e0('0x42')]:_0x5395be['model'];_0x20ff15[_0xc5e0('0x47')]=qs['sort'](_0x19515c[_0xc5e0('0x3f')]['sort']);_0x20ff15[_0xc5e0('0x49')]=qs[_0xc5e0('0x40')](_[_0xc5e0('0x4a')](_0x19515c['query'],_0x5395be[_0xc5e0('0x40')]));if(_0x19515c['query'][_0xc5e0('0x4b')]){_0x20ff15[_0xc5e0('0x49')]=_['merge'](_0x20ff15[_0xc5e0('0x49')],{'$or':_[_0xc5e0('0x3d')](_0x20ff15['attributes'],function(_0x1345ac){var _0x4a5366={};_0x4a5366[_0x1345ac]={'$like':'%'+_0x19515c['query']['filter']+'%'};return _0x4a5366;})});}_0x20ff15=_['merge']({},_0x20ff15,_0x19515c['options']);return _0x822bcb['getDescriptions'](_0x20ff15);}})[_0xc5e0('0x32')](function(_0x1b089c){if(_0x1b089c){_0x3da0ef=_0x1b089c[_0xc5e0('0x44')];if(!_0x19515c[_0xc5e0('0x3f')][_0xc5e0('0x45')](_0xc5e0('0x46'))){_0x20ff15[_0xc5e0('0x2c')]=qs['limit'](_0x19515c['query']['limit']);_0x20ff15[_0xc5e0('0x2b')]=qs[_0xc5e0('0x2b')](_0x19515c['query'][_0xc5e0('0x2b')]);}return _0x822bcb[_0xc5e0('0x5b')](_0x20ff15);}})[_0xc5e0('0x32')](function(_0x133826){if(_0x133826){return _0x133826?{'count':_0x3da0ef,'rows':_0x133826}:null;}})[_0xc5e0('0x32')](respondWithResult(_0xf716d7,null))[_0xc5e0('0x26')](handleError(_0xf716d7,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 73fe826..ed6fb9d 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 _0x0720=['bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x74e806,_0x14dca0){var _0x203bcb=function(_0x37e414){while(--_0x37e414){_0x74e806['push'](_0x74e806['shift']());}};_0x203bcb(++_0x14dca0);}(_0x0720,0x167));var _0x0072=function(_0x5656d0,_0x4f5620){_0x5656d0=_0x5656d0-0x0;var _0x22ba99=_0x0720[_0x5656d0];return _0x22ba99;};'use strict';var _=require(_0x0072('0x0'));var util=require(_0x0072('0x1'));var logger=require(_0x0072('0x2'))(_0x0072('0x3'));var moment=require(_0x0072('0x4'));var BPromise=require(_0x0072('0x5'));var rp=require(_0x0072('0x6'));var fs=require('fs');var path=require(_0x0072('0x7'));var rimraf=require(_0x0072('0x8'));var config=require(_0x0072('0x9'));var attributes=require(_0x0072('0xa'));module['exports']=function(_0x1daf48,_0x2538e5){return _0x1daf48[_0x0072('0xb')](_0x0072('0xc'),attributes,{'tableName':_0x0072('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb6ea=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xb6ea,0x1bc));var _0xab6e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb6ea[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xab6e('0x0'));var util=require(_0xab6e('0x1'));var logger=require(_0xab6e('0x2'))('api');var moment=require(_0xab6e('0x3'));var BPromise=require(_0xab6e('0x4'));var rp=require(_0xab6e('0x5'));var fs=require('fs');var path=require(_0xab6e('0x6'));var rimraf=require(_0xab6e('0x7'));var config=require(_0xab6e('0x8'));var attributes=require(_0xab6e('0x9'));module['exports']=function(_0x423bc8,_0x36dec5){return _0x423bc8['define']('SugarcrmConfiguration',attributes,{'tableName':_0xab6e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index d5dee65..8ce30e6 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 _0x39d5=['client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x28e240,_0x1aa91c){var _0x54211e=function(_0x1a64b1){while(--_0x1a64b1){_0x28e240['push'](_0x28e240['shift']());}};_0x54211e(++_0x1aa91c);}(_0x39d5,0xe6));var _0x539d=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x39d5[_0x487b0c];return _0x1adbdc;};'use strict';var _=require(_0x539d('0x0'));var util=require('util');var moment=require(_0x539d('0x1'));var BPromise=require(_0x539d('0x2'));var rs=require(_0x539d('0x3'));var fs=require('fs');var Redis=require(_0x539d('0x4'));var db=require(_0x539d('0x5'))['db'];var utils=require(_0x539d('0x6'));var logger=require(_0x539d('0x7'))(_0x539d('0x8'));var config=require(_0x539d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x539d('0xa')][_0x539d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3782ed,_0x7cbfab,_0x44a7c9){return new BPromise(function(_0x21407b,_0x12160b){return client[_0x539d('0xc')](_0x3782ed,_0x44a7c9)[_0x539d('0xd')](function(_0x416b1d){logger[_0x539d('0xe')](_0x539d('0xf'),_0x7cbfab,_0x539d('0x10'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x7cbfab,_0x539d('0x10'),JSON['stringify'](_0x416b1d));if(_0x416b1d[_0x539d('0x11')]){if(_0x416b1d['error']['code']===0x1f4){logger['error'](_0x539d('0xf'),_0x7cbfab,_0x416b1d[_0x539d('0x11')][_0x539d('0x12')]);return _0x12160b(_0x416b1d[_0x539d('0x11')]['message']);}logger[_0x539d('0x11')](_0x539d('0xf'),_0x7cbfab,_0x416b1d['error'][_0x539d('0x12')]);return _0x21407b(_0x416b1d[_0x539d('0x11')][_0x539d('0x12')]);}else{logger[_0x539d('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x7cbfab,_0x539d('0x10'));_0x21407b(_0x416b1d['result'][_0x539d('0x12')]);}})[_0x539d('0x13')](function(_0x32000a){logger[_0x539d('0x11')](_0x539d('0xf'),_0x7cbfab,_0x32000a);_0x12160b(_0x32000a);});});} \ No newline at end of file +var _0x94bc=['debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x2b5c75,_0xa5467b){var _0xc3df03=function(_0x5c15b5){while(--_0x5c15b5){_0x2b5c75['push'](_0x2b5c75['shift']());}};_0xc3df03(++_0xa5467b);}(_0x94bc,0x11d));var _0xc94b=function(_0x5ede1a,_0x51e4d0){_0x5ede1a=_0x5ede1a-0x0;var _0x9b0761=_0x94bc[_0x5ede1a];return _0x9b0761;};'use strict';var _=require(_0xc94b('0x0'));var util=require(_0xc94b('0x1'));var moment=require(_0xc94b('0x2'));var BPromise=require('bluebird');var rs=require(_0xc94b('0x3'));var fs=require('fs');var Redis=require(_0xc94b('0x4'));var db=require(_0xc94b('0x5'))['db'];var utils=require(_0xc94b('0x6'));var logger=require('../../config/logger')(_0xc94b('0x7'));var config=require('../../config/environment');var jayson=require(_0xc94b('0x8'));var client=jayson['client'][_0xc94b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54b128,_0x327690,_0x349b74){return new BPromise(function(_0x18aed4,_0x2773a3){return client[_0xc94b('0xa')](_0x54b128,_0x349b74)[_0xc94b('0xb')](function(_0x155095){logger['info'](_0xc94b('0xc'),_0x327690,_0xc94b('0xd'));logger[_0xc94b('0xe')](_0xc94b('0xf'),_0x327690,_0xc94b('0xd'),JSON[_0xc94b('0x10')](_0x155095));if(_0x155095[_0xc94b('0x11')]){if(_0x155095[_0xc94b('0x11')][_0xc94b('0x12')]===0x1f4){logger[_0xc94b('0x11')](_0xc94b('0xc'),_0x327690,_0x155095[_0xc94b('0x11')][_0xc94b('0x13')]);return _0x2773a3(_0x155095[_0xc94b('0x11')][_0xc94b('0x13')]);}logger[_0xc94b('0x11')](_0xc94b('0xc'),_0x327690,_0x155095[_0xc94b('0x11')]['message']);return _0x18aed4(_0x155095['error'][_0xc94b('0x13')]);}else{logger[_0xc94b('0x14')](_0xc94b('0xc'),_0x327690,'request\x20sent');_0x18aed4(_0x155095[_0xc94b('0x15')][_0xc94b('0x13')]);}})[_0xc94b('0x16')](function(_0x387017){logger['error'](_0xc94b('0xc'),_0x327690,_0x387017);_0x2773a3(_0x387017);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 5d7ce67..d745bb9 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 _0x5532=['create','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post'];(function(_0x2226c1,_0x2bed75){var _0x178716=function(_0x54bb7e){while(--_0x54bb7e){_0x2226c1['push'](_0x2226c1['shift']());}};_0x178716(++_0x2bed75);}(_0x5532,0x124));var _0x2553=function(_0x573111,_0x235567){_0x573111=_0x573111-0x0;var _0x4c1871=_0x5532[_0x573111];return _0x4c1871;};'use strict';var multer=require(_0x2553('0x0'));var util=require(_0x2553('0x1'));var path=require('path');var timeout=require(_0x2553('0x2'));var express=require(_0x2553('0x3'));var router=express[_0x2553('0x4')]();var auth=require(_0x2553('0x5'));var interaction=require(_0x2553('0x6'));var config=require(_0x2553('0x7'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x2553('0x8')]);router[_0x2553('0x9')](_0x2553('0xa'),auth[_0x2553('0xb')](),controller[_0x2553('0xc')]);router[_0x2553('0xd')]('/',auth[_0x2553('0xb')](),controller[_0x2553('0xe')]);router['put'](_0x2553('0xa'),auth[_0x2553('0xb')](),controller[_0x2553('0xf')]);router['delete']('/:id',auth[_0x2553('0xb')](),controller[_0x2553('0x10')]);module[_0x2553('0x11')]=router; \ No newline at end of file +var _0xed55=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','put'];(function(_0x19d920,_0x4300b4){var _0x7ad1d5=function(_0x2f8317){while(--_0x2f8317){_0x19d920['push'](_0x19d920['shift']());}};_0x7ad1d5(++_0x4300b4);}(_0xed55,0xd5));var _0x5ed5=function(_0x348652,_0x1ab849){_0x348652=_0x348652-0x0;var _0x18a9ea=_0xed55[_0x348652];return _0x18a9ea;};'use strict';var multer=require(_0x5ed5('0x0'));var util=require(_0x5ed5('0x1'));var path=require(_0x5ed5('0x2'));var timeout=require(_0x5ed5('0x3'));var express=require('express');var router=express[_0x5ed5('0x4')]();var auth=require(_0x5ed5('0x5'));var interaction=require(_0x5ed5('0x6'));var config=require(_0x5ed5('0x7'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0x5ed5('0x8')](),controller[_0x5ed5('0x9')]);router[_0x5ed5('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5ed5('0xb')]);router[_0x5ed5('0xc')]('/',auth['isAuthenticated'](),controller[_0x5ed5('0xd')]);router[_0x5ed5('0xe')]('/:id',auth[_0x5ed5('0x8')](),controller[_0x5ed5('0xf')]);router[_0x5ed5('0x10')]('/:id',auth[_0x5ed5('0x8')](),controller[_0x5ed5('0x11')]);module[_0x5ed5('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 818280a..536e48d 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 _0x9ca8=['customVariable','keyValue','STRING','ENUM','exports','string','variable'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ca8,0x123));var _0x89ca=function(_0x5d8631,_0x44944b){_0x5d8631=_0x5d8631-0x0;var _0x34c15e=_0x9ca8[_0x5d8631];return _0x34c15e;};'use strict';var Sequelize=require('sequelize');module[_0x89ca('0x0')]={'type':{'type':Sequelize['ENUM'](_0x89ca('0x1'),_0x89ca('0x2'),_0x89ca('0x3'),_0x89ca('0x4')),'defaultValue':_0x89ca('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x89ca('0x5')]},'keyType':{'type':Sequelize[_0x89ca('0x6')](_0x89ca('0x1'),_0x89ca('0x2'),_0x89ca('0x3'))},'keyContent':{'type':Sequelize[_0x89ca('0x5')]},'idField':{'type':Sequelize[_0x89ca('0x5')]},'nameField':{'type':Sequelize[_0x89ca('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xac9d=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x5ec7b8,_0x38a748){var _0x4f8c38=function(_0x3e9180){while(--_0x3e9180){_0x5ec7b8['push'](_0x5ec7b8['shift']());}};_0x4f8c38(++_0x38a748);}(_0xac9d,0x14d));var _0xdac9=function(_0x5732d6,_0x2c9500){_0x5732d6=_0x5732d6-0x0;var _0x3a1a0f=_0xac9d[_0x5732d6];return _0x3a1a0f;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'type':{'type':Sequelize[_0xdac9('0x2')](_0xdac9('0x3'),_0xdac9('0x4'),_0xdac9('0x5'),_0xdac9('0x6')),'defaultValue':_0xdac9('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdac9('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xdac9('0x3'),_0xdac9('0x4'),_0xdac9('0x5'))},'keyContent':{'type':Sequelize[_0xdac9('0x7')]},'idField':{'type':Sequelize[_0xdac9('0x7')]},'nameField':{'type':Sequelize[_0xdac9('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdac9('0x7')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 6b4b29e..083e4fe 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 _0x61ca=['error','stack','name','send','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','where','filter','merge','VIRTUAL','options','SugarcrmField','includeAll','include','rows','catch','params','create','body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','update','then','destroy','end'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x61ca,0x13e));var _0xa61c=function(_0x3523cb,_0x511b5c){_0x3523cb=_0x3523cb-0x0;var _0x54efd9=_0x61ca[_0x3523cb];return _0x54efd9;};'use strict';var pdf=require(_0xa61c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa61c('0x1'));var zipdir=require(_0xa61c('0x2'));var jsonpatch=require(_0xa61c('0x3'));var rp=require(_0xa61c('0x4'));var moment=require(_0xa61c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa61c('0x6'));var util=require(_0xa61c('0x7'));var path=require(_0xa61c('0x8'));var sox=require(_0xa61c('0x9'));var csv=require('to-csv');var ejs=require(_0xa61c('0xa'));var fs=require('fs');var _=require(_0xa61c('0xb'));var squel=require(_0xa61c('0xc'));var crypto=require(_0xa61c('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa61c('0xe'));var querystring=require(_0xa61c('0xf'));var Papa=require(_0xa61c('0x10'));var Redis=require('ioredis');var authService=require(_0xa61c('0x11'));var qs=require(_0xa61c('0x12'));var as=require(_0xa61c('0x13'));var hardwareService=require(_0xa61c('0x14'));var logger=require('../../config/logger')(_0xa61c('0x15'));var utils=require(_0xa61c('0x16'));var config=require(_0xa61c('0x17'));var db=require(_0xa61c('0x18'))['db'];function respondWithStatusCode(_0x156d26,_0x22fc49){_0x22fc49=_0x22fc49||0xcc;return function(_0x5187a6){if(_0x5187a6){return _0x156d26[_0xa61c('0x19')](_0x22fc49);}return _0x156d26[_0xa61c('0x1a')](_0x22fc49)['end']();};}function respondWithResult(_0xec3808,_0x27a556){_0x27a556=_0x27a556||0xc8;return function(_0x2af87d){if(_0x2af87d){return _0xec3808[_0xa61c('0x1a')](_0x27a556)[_0xa61c('0x1b')](_0x2af87d);}};}function respondWithFilteredResult(_0x59f0de,_0x4545a7){return function(_0x116a1a){if(_0x116a1a){var _0x27eb70=_0x116a1a[_0xa61c('0x1c')],_0x100920=_0x4545a7['offset'],_0x116693=_0x4545a7[_0xa61c('0x1d')]+_0x4545a7['limit'],_0x19434e;if(_0x116693>=_0x27eb70){_0x116693=_0x27eb70;_0x19434e=0xc8;}else{_0x19434e=0xce;}_0x59f0de[_0xa61c('0x1a')](_0x19434e);return _0x59f0de['set'](_0xa61c('0x1e'),_0x100920+'-'+_0x116693+'/'+_0x27eb70)[_0xa61c('0x1b')](_0x116a1a);}return null;};}function patchUpdates(_0x1fcd0a){return function(_0x51b093){try{jsonpatch[_0xa61c('0x1f')](_0x51b093,_0x1fcd0a,!![]);}catch(_0x183679){return BPromise[_0xa61c('0x20')](_0x183679);}return _0x51b093['save']();};}function saveUpdates(_0x8aca8d,_0x55ceb7){return function(_0x3eb996){if(_0x3eb996){return _0x3eb996[_0xa61c('0x21')](_0x8aca8d)[_0xa61c('0x22')](function(_0x6d9cbb){return _0x6d9cbb;});}return null;};}function removeEntity(_0x15cfd2,_0x4909f7){return function(_0x123f2c){if(_0x123f2c){return _0x123f2c[_0xa61c('0x23')]()[_0xa61c('0x22')](function(){_0x15cfd2['status'](0xcc)[_0xa61c('0x24')]();});}};}function handleEntityNotFound(_0x317578,_0x20feb2){return function(_0x364f4a){if(!_0x364f4a){_0x317578['sendStatus'](0x194);}return _0x364f4a;};}function handleError(_0x31332e,_0x2f6a15){_0x2f6a15=_0x2f6a15||0x1f4;return function(_0x8e3d05){logger[_0xa61c('0x25')](_0x8e3d05[_0xa61c('0x26')]);if(_0x8e3d05[_0xa61c('0x27')]){delete _0x8e3d05[_0xa61c('0x27')];}_0x31332e['status'](_0x2f6a15)[_0xa61c('0x28')](_0x8e3d05);};}exports[_0xa61c('0x29')]=function(_0x5b8a84,_0x5b3e26){var _0x21f423={},_0x4e3864={},_0x2cb228={'count':0x0,'rows':[]};var _0x5d33cd=_[_0xa61c('0x2a')](db['SugarcrmField'][_0xa61c('0x2b')],function(_0x36aca5){return{'name':_0x36aca5['fieldName'],'type':_0x36aca5[_0xa61c('0x2c')][_0xa61c('0x2d')]};});_0x4e3864['model']=_[_0xa61c('0x2a')](_0x5d33cd,_0xa61c('0x27'));_0x4e3864[_0xa61c('0x2e')]=_[_0xa61c('0x2f')](_0x5b8a84[_0xa61c('0x2e')]);_0x4e3864[_0xa61c('0x30')]=_[_0xa61c('0x31')](_0x4e3864[_0xa61c('0x32')],_0x4e3864[_0xa61c('0x2e')]);_0x21f423['attributes']=_['intersection'](_0x4e3864[_0xa61c('0x32')],qs[_0xa61c('0x33')](_0x5b8a84[_0xa61c('0x2e')]['fields']));_0x21f423['attributes']=_0x21f423[_0xa61c('0x34')][_0xa61c('0x35')]?_0x21f423[_0xa61c('0x34')]:_0x4e3864[_0xa61c('0x32')];if(!_0x5b8a84[_0xa61c('0x2e')][_0xa61c('0x36')](_0xa61c('0x37'))){_0x21f423['limit']=qs[_0xa61c('0x38')](_0x5b8a84[_0xa61c('0x2e')][_0xa61c('0x38')]);_0x21f423[_0xa61c('0x1d')]=qs[_0xa61c('0x1d')](_0x5b8a84[_0xa61c('0x2e')][_0xa61c('0x1d')]);}_0x21f423['order']=qs['sort'](_0x5b8a84['query']['sort']);_0x21f423[_0xa61c('0x39')]=qs[_0xa61c('0x30')](_['pick'](_0x5b8a84[_0xa61c('0x2e')],_0x4e3864['filters']),_0x5d33cd);if(_0x5b8a84[_0xa61c('0x2e')][_0xa61c('0x3a')]){_0x21f423['where']=_[_0xa61c('0x3b')](_0x21f423['where'],{'$or':_[_0xa61c('0x2a')](_0x5d33cd,function(_0x201b39){if(_0x201b39['type']!==_0xa61c('0x3c')){var _0x138666={};_0x138666[_0x201b39[_0xa61c('0x27')]]={'$like':'%'+_0x5b8a84[_0xa61c('0x2e')][_0xa61c('0x3a')]+'%'};return _0x138666;}})});}_0x21f423=_[_0xa61c('0x3b')]({},_0x21f423,_0x5b8a84[_0xa61c('0x3d')]);var _0x4b0852={'where':_0x21f423[_0xa61c('0x39')]};return db[_0xa61c('0x3e')][_0xa61c('0x1c')](_0x4b0852)[_0xa61c('0x22')](function(_0x4dda07){_0x2cb228[_0xa61c('0x1c')]=_0x4dda07;if(_0x5b8a84[_0xa61c('0x2e')][_0xa61c('0x3f')]){_0x21f423[_0xa61c('0x40')]=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x21f423);})[_0xa61c('0x22')](function(_0x1fa2a7){_0x2cb228[_0xa61c('0x41')]=_0x1fa2a7;return _0x2cb228;})['then'](respondWithFilteredResult(_0x5b3e26,_0x21f423))[_0xa61c('0x42')](handleError(_0x5b3e26,null));};exports['show']=function(_0x13373a,_0x194d79){var _0x54580f={'raw':!![],'where':{'id':_0x13373a[_0xa61c('0x43')]['id']}},_0x4fc2f2={};_0x4fc2f2[_0xa61c('0x32')]=_[_0xa61c('0x2f')](db[_0xa61c('0x3e')][_0xa61c('0x2b')]);_0x4fc2f2[_0xa61c('0x2e')]=_[_0xa61c('0x2f')](_0x13373a[_0xa61c('0x2e')]);_0x4fc2f2[_0xa61c('0x30')]=_[_0xa61c('0x31')](_0x4fc2f2[_0xa61c('0x32')],_0x4fc2f2[_0xa61c('0x2e')]);_0x54580f['attributes']=_[_0xa61c('0x31')](_0x4fc2f2[_0xa61c('0x32')],qs[_0xa61c('0x33')](_0x13373a[_0xa61c('0x2e')]['fields']));_0x54580f[_0xa61c('0x34')]=_0x54580f[_0xa61c('0x34')]['length']?_0x54580f[_0xa61c('0x34')]:_0x4fc2f2['model'];if(_0x13373a[_0xa61c('0x2e')][_0xa61c('0x3f')]){_0x54580f[_0xa61c('0x40')]=[{'all':!![]}];}_0x54580f=_[_0xa61c('0x3b')]({},_0x54580f,_0x13373a['options']);return db[_0xa61c('0x3e')]['find'](_0x54580f)[_0xa61c('0x22')](handleEntityNotFound(_0x194d79,null))[_0xa61c('0x22')](respondWithResult(_0x194d79,null))['catch'](handleError(_0x194d79,null));};exports[_0xa61c('0x44')]=function(_0x34c513,_0xcc5771){return db[_0xa61c('0x3e')]['create'](_0x34c513[_0xa61c('0x45')],{})[_0xa61c('0x22')](respondWithResult(_0xcc5771,0xc9))[_0xa61c('0x42')](handleError(_0xcc5771,null));};exports[_0xa61c('0x21')]=function(_0x3b5eac,_0xd4903d){if(_0x3b5eac['body']['id']){delete _0x3b5eac[_0xa61c('0x45')]['id'];}return db[_0xa61c('0x3e')][_0xa61c('0x46')]({'where':{'id':_0x3b5eac[_0xa61c('0x43')]['id']}})[_0xa61c('0x22')](handleEntityNotFound(_0xd4903d,null))[_0xa61c('0x22')](saveUpdates(_0x3b5eac[_0xa61c('0x45')],null))[_0xa61c('0x22')](respondWithResult(_0xd4903d,null))[_0xa61c('0x42')](handleError(_0xd4903d,null));};exports[_0xa61c('0x23')]=function(_0x546392,_0x1d3e7f){return db['SugarcrmField'][_0xa61c('0x46')]({'where':{'id':_0x546392[_0xa61c('0x43')]['id']}})[_0xa61c('0x22')](handleEntityNotFound(_0x1d3e7f,null))[_0xa61c('0x22')](removeEntity(_0x1d3e7f,null))['catch'](handleError(_0x1d3e7f,null));}; \ No newline at end of file +var _0x36e5=['fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','findAll','show','find','catch','create','body','params','html-pdf','request-promise','moment','mustache','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','map','SugarcrmField','rawAttributes'];(function(_0x4b00a8,_0x17a8dc){var _0x33b2a3=function(_0x30a786){while(--_0x30a786){_0x4b00a8['push'](_0x4b00a8['shift']());}};_0x33b2a3(++_0x17a8dc);}(_0x36e5,0xe2));var _0x536e=function(_0x239193,_0x1585ef){_0x239193=_0x239193-0x0;var _0x4f51c3=_0x36e5[_0x239193];return _0x4f51c3;};'use strict';var pdf=require(_0x536e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x536e('0x1'));var moment=require(_0x536e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x536e('0x3'));var util=require(_0x536e('0x4'));var path=require('path');var sox=require(_0x536e('0x5'));var csv=require(_0x536e('0x6'));var ejs=require(_0x536e('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x536e('0x8'));var jsforce=require(_0x536e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x536e('0x6'));var querystring=require(_0x536e('0xa'));var Papa=require(_0x536e('0xb'));var Redis=require('ioredis');var authService=require(_0x536e('0xc'));var qs=require(_0x536e('0xd'));var as=require(_0x536e('0xe'));var hardwareService=require(_0x536e('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0x536e('0x10'));var config=require(_0x536e('0x11'));var db=require(_0x536e('0x12'))['db'];function respondWithStatusCode(_0x4eb421,_0x5a2a81){_0x5a2a81=_0x5a2a81||0xcc;return function(_0x1a9c09){if(_0x1a9c09){return _0x4eb421[_0x536e('0x13')](_0x5a2a81);}return _0x4eb421[_0x536e('0x14')](_0x5a2a81)[_0x536e('0x15')]();};}function respondWithResult(_0x31b751,_0x145e74){_0x145e74=_0x145e74||0xc8;return function(_0x550f45){if(_0x550f45){return _0x31b751[_0x536e('0x14')](_0x145e74)[_0x536e('0x16')](_0x550f45);}};}function respondWithFilteredResult(_0x3ef8d6,_0x24bd69){return function(_0x2f6b58){if(_0x2f6b58){var _0x3defbd=_0x2f6b58[_0x536e('0x17')],_0x37e4cf=_0x24bd69[_0x536e('0x18')],_0x4120c3=_0x24bd69['offset']+_0x24bd69[_0x536e('0x19')],_0x46009c;if(_0x4120c3>=_0x3defbd){_0x4120c3=_0x3defbd;_0x46009c=0xc8;}else{_0x46009c=0xce;}_0x3ef8d6[_0x536e('0x14')](_0x46009c);return _0x3ef8d6[_0x536e('0x1a')](_0x536e('0x1b'),_0x37e4cf+'-'+_0x4120c3+'/'+_0x3defbd)[_0x536e('0x16')](_0x2f6b58);}return null;};}function patchUpdates(_0x1e201b){return function(_0x50bb46){try{jsonpatch['apply'](_0x50bb46,_0x1e201b,!![]);}catch(_0x368299){return BPromise['reject'](_0x368299);}return _0x50bb46[_0x536e('0x1c')]();};}function saveUpdates(_0xbf2144,_0x36275a){return function(_0x14f08f){if(_0x14f08f){return _0x14f08f[_0x536e('0x1d')](_0xbf2144)[_0x536e('0x1e')](function(_0x460944){return _0x460944;});}return null;};}function removeEntity(_0x2a82ab,_0x477d88){return function(_0x328c72){if(_0x328c72){return _0x328c72[_0x536e('0x1f')]()[_0x536e('0x1e')](function(){_0x2a82ab[_0x536e('0x14')](0xcc)[_0x536e('0x15')]();});}};}function handleEntityNotFound(_0x12ef16,_0x3c5ede){return function(_0x470c82){if(!_0x470c82){_0x12ef16['sendStatus'](0x194);}return _0x470c82;};}function handleError(_0x2deb4f,_0x44d6a1){_0x44d6a1=_0x44d6a1||0x1f4;return function(_0x5b33de){logger[_0x536e('0x20')](_0x5b33de[_0x536e('0x21')]);if(_0x5b33de[_0x536e('0x22')]){delete _0x5b33de[_0x536e('0x22')];}_0x2deb4f[_0x536e('0x14')](_0x44d6a1)['send'](_0x5b33de);};}exports['index']=function(_0x15127b,_0x560c9e){var _0x32467a={},_0x4a1318={},_0x357e69={'count':0x0,'rows':[]};var _0x1b8740=_[_0x536e('0x23')](db[_0x536e('0x24')][_0x536e('0x25')],function(_0x162c3c){return{'name':_0x162c3c[_0x536e('0x26')],'type':_0x162c3c[_0x536e('0x27')][_0x536e('0x28')]};});_0x4a1318[_0x536e('0x29')]=_['map'](_0x1b8740,_0x536e('0x22'));_0x4a1318[_0x536e('0x2a')]=_[_0x536e('0x2b')](_0x15127b['query']);_0x4a1318[_0x536e('0x2c')]=_[_0x536e('0x2d')](_0x4a1318[_0x536e('0x29')],_0x4a1318[_0x536e('0x2a')]);_0x32467a[_0x536e('0x2e')]=_[_0x536e('0x2d')](_0x4a1318['model'],qs[_0x536e('0x2f')](_0x15127b[_0x536e('0x2a')][_0x536e('0x2f')]));_0x32467a[_0x536e('0x2e')]=_0x32467a[_0x536e('0x2e')][_0x536e('0x30')]?_0x32467a['attributes']:_0x4a1318[_0x536e('0x29')];if(!_0x15127b[_0x536e('0x2a')][_0x536e('0x31')](_0x536e('0x32'))){_0x32467a[_0x536e('0x19')]=qs['limit'](_0x15127b[_0x536e('0x2a')]['limit']);_0x32467a[_0x536e('0x18')]=qs[_0x536e('0x18')](_0x15127b['query'][_0x536e('0x18')]);}_0x32467a[_0x536e('0x33')]=qs[_0x536e('0x34')](_0x15127b[_0x536e('0x2a')][_0x536e('0x34')]);_0x32467a['where']=qs[_0x536e('0x2c')](_[_0x536e('0x35')](_0x15127b[_0x536e('0x2a')],_0x4a1318['filters']),_0x1b8740);if(_0x15127b[_0x536e('0x2a')][_0x536e('0x36')]){_0x32467a[_0x536e('0x37')]=_['merge'](_0x32467a[_0x536e('0x37')],{'$or':_[_0x536e('0x23')](_0x1b8740,function(_0xb9ad83){if(_0xb9ad83['type']!==_0x536e('0x38')){var _0x1a78f5={};_0x1a78f5[_0xb9ad83[_0x536e('0x22')]]={'$like':'%'+_0x15127b[_0x536e('0x2a')][_0x536e('0x36')]+'%'};return _0x1a78f5;}})});}_0x32467a=_[_0x536e('0x39')]({},_0x32467a,_0x15127b[_0x536e('0x3a')]);var _0x5e17a9={'where':_0x32467a['where']};return db[_0x536e('0x24')]['count'](_0x5e17a9)[_0x536e('0x1e')](function(_0x36fbf9){_0x357e69[_0x536e('0x17')]=_0x36fbf9;if(_0x15127b[_0x536e('0x2a')]['includeAll']){_0x32467a['include']=[{'all':!![]}];}return db[_0x536e('0x24')][_0x536e('0x3b')](_0x32467a);})[_0x536e('0x1e')](function(_0x10149c){_0x357e69['rows']=_0x10149c;return _0x357e69;})[_0x536e('0x1e')](respondWithFilteredResult(_0x560c9e,_0x32467a))['catch'](handleError(_0x560c9e,null));};exports[_0x536e('0x3c')]=function(_0x5ee9ef,_0x4195f5){var _0x34c3d0={'raw':!![],'where':{'id':_0x5ee9ef['params']['id']}},_0x53c61f={};_0x53c61f[_0x536e('0x29')]=_[_0x536e('0x2b')](db[_0x536e('0x24')][_0x536e('0x25')]);_0x53c61f[_0x536e('0x2a')]=_[_0x536e('0x2b')](_0x5ee9ef[_0x536e('0x2a')]);_0x53c61f[_0x536e('0x2c')]=_[_0x536e('0x2d')](_0x53c61f['model'],_0x53c61f[_0x536e('0x2a')]);_0x34c3d0[_0x536e('0x2e')]=_[_0x536e('0x2d')](_0x53c61f[_0x536e('0x29')],qs[_0x536e('0x2f')](_0x5ee9ef['query'][_0x536e('0x2f')]));_0x34c3d0[_0x536e('0x2e')]=_0x34c3d0[_0x536e('0x2e')][_0x536e('0x30')]?_0x34c3d0[_0x536e('0x2e')]:_0x53c61f[_0x536e('0x29')];if(_0x5ee9ef[_0x536e('0x2a')]['includeAll']){_0x34c3d0['include']=[{'all':!![]}];}_0x34c3d0=_[_0x536e('0x39')]({},_0x34c3d0,_0x5ee9ef['options']);return db[_0x536e('0x24')][_0x536e('0x3d')](_0x34c3d0)[_0x536e('0x1e')](handleEntityNotFound(_0x4195f5,null))[_0x536e('0x1e')](respondWithResult(_0x4195f5,null))[_0x536e('0x3e')](handleError(_0x4195f5,null));};exports['create']=function(_0x20a7cb,_0x668709){return db[_0x536e('0x24')][_0x536e('0x3f')](_0x20a7cb[_0x536e('0x40')],{})['then'](respondWithResult(_0x668709,0xc9))[_0x536e('0x3e')](handleError(_0x668709,null));};exports[_0x536e('0x1d')]=function(_0x711fa9,_0x46e45c){if(_0x711fa9[_0x536e('0x40')]['id']){delete _0x711fa9[_0x536e('0x40')]['id'];}return db[_0x536e('0x24')][_0x536e('0x3d')]({'where':{'id':_0x711fa9[_0x536e('0x41')]['id']}})['then'](handleEntityNotFound(_0x46e45c,null))[_0x536e('0x1e')](saveUpdates(_0x711fa9[_0x536e('0x40')],null))['then'](respondWithResult(_0x46e45c,null))[_0x536e('0x3e')](handleError(_0x46e45c,null));};exports[_0x536e('0x1f')]=function(_0xe37212,_0x3d2299){return db[_0x536e('0x24')][_0x536e('0x3d')]({'where':{'id':_0xe37212[_0x536e('0x41')]['id']}})[_0x536e('0x1e')](handleEntityNotFound(_0x3d2299,null))[_0x536e('0x1e')](removeEntity(_0x3d2299,null))['catch'](handleError(_0x3d2299,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 556e437..a920457 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 _0xc99e=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','lodash','util'];(function(_0x287065,_0x4bb01f){var _0x5c7b40=function(_0x2dd34c){while(--_0x2dd34c){_0x287065['push'](_0x287065['shift']());}};_0x5c7b40(++_0x4bb01f);}(_0xc99e,0xde));var _0xec99=function(_0xf26f32,_0x217237){_0xf26f32=_0xf26f32-0x0;var _0x166453=_0xc99e[_0xf26f32];return _0x166453;};'use strict';var _=require(_0xec99('0x0'));var util=require(_0xec99('0x1'));var logger=require(_0xec99('0x2'))(_0xec99('0x3'));var moment=require(_0xec99('0x4'));var BPromise=require(_0xec99('0x5'));var rp=require(_0xec99('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xec99('0x7'));var config=require(_0xec99('0x8'));var attributes=require(_0xec99('0x9'));module[_0xec99('0xa')]=function(_0x1bcbb1,_0x12a094){return _0x1bcbb1[_0xec99('0xb')](_0xec99('0xc'),attributes,{'tableName':_0xec99('0xd'),'paranoid':![],'indexes':[{'name':_0xec99('0xe'),'fields':[_0xec99('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1112=['int_sugarcrm_fields','sugarcrm_unique_index','idField','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SugarcrmField'];(function(_0x3e0830,_0x287331){var _0x4bce0d=function(_0x371e2e){while(--_0x371e2e){_0x3e0830['push'](_0x3e0830['shift']());}};_0x4bce0d(++_0x287331);}(_0x1112,0x1e4));var _0x2111=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x1112[_0x37bd26];return _0xe83dc4;};'use strict';var _=require('lodash');var util=require(_0x2111('0x0'));var logger=require(_0x2111('0x1'))('api');var moment=require(_0x2111('0x2'));var BPromise=require(_0x2111('0x3'));var rp=require(_0x2111('0x4'));var fs=require('fs');var path=require(_0x2111('0x5'));var rimraf=require(_0x2111('0x6'));var config=require(_0x2111('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x2111('0x8')]=function(_0x10be33,_0x332f7c){return _0x10be33['define'](_0x2111('0x9'),attributes,{'tableName':_0x2111('0xa'),'paranoid':![],'indexes':[{'name':_0x2111('0xb'),'fields':[_0x2111('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 9b2a2e3..b572156 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 _0x8603=['message','info','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x8603,0x190));var _0x3860=function(_0x4d3187,_0x267c51){_0x4d3187=_0x4d3187-0x0;var _0x107906=_0x8603[_0x4d3187];return _0x107906;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});} \ No newline at end of file +var _0x5eb8=['info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','error','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x5bbad0,_0x4bfa58){var _0x34865f=function(_0x414611){while(--_0x414611){_0x5bbad0['push'](_0x5bbad0['shift']());}};_0x34865f(++_0x4bfa58);}(_0x5eb8,0xb0));var _0x85eb=function(_0x212579,_0xdb4d5a){_0x212579=_0x212579-0x0;var _0x55d50e=_0x5eb8[_0x212579];return _0x55d50e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 5e2c8c3..a6de00f 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 _0xcf5a=['delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./intVtigerAccount.controller','get','index','show','/:id/configurations','isAuthenticated','getConfigurations','post','create','addConfiguration','/:id','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf5a,0xca));var _0xacf5=function(_0x4acbe6,_0x304b16){_0x4acbe6=_0x4acbe6-0x0;var _0x25171a=_0xcf5a[_0x4acbe6];return _0x25171a;};'use strict';var multer=require(_0xacf5('0x0'));var util=require('util');var path=require(_0xacf5('0x1'));var timeout=require(_0xacf5('0x2'));var express=require(_0xacf5('0x3'));var router=express[_0xacf5('0x4')]();var auth=require(_0xacf5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xacf5('0x6'));router[_0xacf5('0x7')]('/',auth['isAuthenticated'](),controller[_0xacf5('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xacf5('0x9')]);router[_0xacf5('0x7')](_0xacf5('0xa'),auth[_0xacf5('0xb')](),controller[_0xacf5('0xc')]);router[_0xacf5('0x7')]('/:id/fields',auth[_0xacf5('0xb')](),controller['getFields']);router[_0xacf5('0xd')]('/',auth[_0xacf5('0xb')](),controller[_0xacf5('0xe')]);router[_0xacf5('0xd')](_0xacf5('0xa'),auth[_0xacf5('0xb')](),controller[_0xacf5('0xf')]);router['put'](_0xacf5('0x10'),auth[_0xacf5('0xb')](),controller[_0xacf5('0x11')]);router[_0xacf5('0x12')]('/:id',auth[_0xacf5('0xb')](),controller['destroy']);module[_0xacf5('0x13')]=router; \ No newline at end of file +var _0x1e42=['addConfiguration','put','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create'];(function(_0x213584,_0xb5675b){var _0x3fff0e=function(_0xb243fc){while(--_0xb243fc){_0x213584['push'](_0x213584['shift']());}};_0x3fff0e(++_0xb5675b);}(_0x1e42,0xab));var _0x21e4=function(_0x12006f,_0x12fd6e){_0x12006f=_0x12006f-0x0;var _0xf1d907=_0x1e42[_0x12006f];return _0xf1d907;};'use strict';var multer=require(_0x21e4('0x0'));var util=require(_0x21e4('0x1'));var path=require(_0x21e4('0x2'));var timeout=require('connect-timeout');var express=require(_0x21e4('0x3'));var router=express[_0x21e4('0x4')]();var auth=require(_0x21e4('0x5'));var interaction=require(_0x21e4('0x6'));var config=require('../../config/environment');var controller=require(_0x21e4('0x7'));router[_0x21e4('0x8')]('/',auth['isAuthenticated'](),controller[_0x21e4('0x9')]);router[_0x21e4('0x8')](_0x21e4('0xa'),auth[_0x21e4('0xb')](),controller[_0x21e4('0xc')]);router[_0x21e4('0x8')](_0x21e4('0xd'),auth[_0x21e4('0xb')](),controller[_0x21e4('0xe')]);router[_0x21e4('0x8')](_0x21e4('0xf'),auth[_0x21e4('0xb')](),controller['getFields']);router[_0x21e4('0x10')]('/',auth[_0x21e4('0xb')](),controller[_0x21e4('0x11')]);router[_0x21e4('0x10')](_0x21e4('0xd'),auth[_0x21e4('0xb')](),controller[_0x21e4('0x12')]);router[_0x21e4('0x13')](_0x21e4('0xa'),auth[_0x21e4('0xb')](),controller['update']);router[_0x21e4('0x14')](_0x21e4('0xa'),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 b558622..e734fb8 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 _0x87c4=['STRING','HelpDesk'];(function(_0x4c21c2,_0x1f9d92){var _0x5f49da=function(_0x22bef8){while(--_0x22bef8){_0x4c21c2['push'](_0x4c21c2['shift']());}};_0x5f49da(++_0x1f9d92);}(_0x87c4,0xd4));var _0x487c=function(_0x2aa07c,_0x5690c9){_0x2aa07c=_0x2aa07c-0x0;var _0x2f29fd=_0x87c4[_0x2aa07c];return _0x2f29fd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x487c('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x487c('0x0')]},'username':{'type':Sequelize[_0x487c('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x487c('0x0')],'allowNull':![],'defaultValue':_0x487c('0x1')},'remoteUri':{'type':Sequelize[_0x487c('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x487c('0x0')]},'accessKey':{'type':Sequelize[_0x487c('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0xbcaf=['STRING','HelpDesk','sequelize','exports'];(function(_0x3f00ee,_0x1d1673){var _0x18a07e=function(_0x4dad57){while(--_0x4dad57){_0x3f00ee['push'](_0x3f00ee['shift']());}};_0x18a07e(++_0x1d1673);}(_0xbcaf,0x142));var _0xfbca=function(_0x2deb6f,_0x40c4bb){_0x2deb6f=_0x2deb6f-0x0;var _0xac14a8=_0xbcaf[_0x2deb6f];return _0xac14a8;};'use strict';var Sequelize=require(_0xfbca('0x0'));module[_0xfbca('0x1')]={'name':{'type':Sequelize[_0xfbca('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfbca('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xfbca('0x2')],'allowNull':![],'defaultValue':_0xfbca('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xfbca('0x2')]},'accessKey':{'type':Sequelize[_0xfbca('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 70098c9..0e592ad 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 _0x363a=['%s/webservice.php','GET','getchallenge','success','POST','token','describe','reference','owner','remove','includes','editable','startsWith','cf_','picklist','picklistValues','label','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','VtigerAccount,\x20%s,\x20%s','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','status','end','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','map','VtigerAccount','rawAttributes','fieldName','type','key','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','keys','include','find','create','body','update','params','getConfigurations','findOne','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format'];(function(_0x5ea267,_0x2bb004){var _0x52d6e8=function(_0x3e57e2){while(--_0x3e57e2){_0x5ea267['push'](_0x5ea267['shift']());}};_0x52d6e8(++_0x2bb004);}(_0x363a,0x97));var _0xa363=function(_0x3d8b1d,_0x1c0f88){_0x3d8b1d=_0x3d8b1d-0x0;var _0x2bb57a=_0x363a[_0x3d8b1d];return _0x2bb57a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa363('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa363('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa363('0x2'));var moment=require(_0xa363('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa363('0x4'));var util=require(_0xa363('0x5'));var path=require(_0xa363('0x6'));var sox=require('sox');var csv=require(_0xa363('0x7'));var ejs=require(_0xa363('0x8'));var fs=require('fs');var _=require(_0xa363('0x9'));var squel=require(_0xa363('0xa'));var crypto=require(_0xa363('0xb'));var jsforce=require(_0xa363('0xc'));var deskjs=require(_0xa363('0xd'));var toCsv=require(_0xa363('0x7'));var querystring=require('querystring');var Papa=require(_0xa363('0xe'));var Redis=require(_0xa363('0xf'));var authService=require(_0xa363('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa363('0x11'));var logger=require('../../config/logger')(_0xa363('0x12'));var utils=require('../../config/utils');var config=require(_0xa363('0x13'));var db=require(_0xa363('0x14'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xa363('0x15'));var client=jayson[_0xa363('0x16')][_0xa363('0x17')]({'port':0x232a});function checkPasswordPattern(_0x41fb78,_0x1e9ad9,_0x5cc7aa){if(_0x5cc7aa){var _0x57c858=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x57c858[_0xa363('0x18')](_0x1e9ad9)){return _0x41fb78;}else{throw new db[(_0xa363('0x19'))][(_0xa363('0x1a'))](_0xa363('0x1b'));}}else{return _0x41fb78;}}function respondWithRpcPromise(_0x5d0ca8,_0x570d49,_0x1d5ef9,_0x324e21){return new BPromise(function(_0x2147a0,_0x12e61b){var _0x246d12=_0x324e21||client;return _0x246d12['request'](_0x5d0ca8,_0x1d5ef9)['then'](function(_0xf30d74){logger[_0xa363('0x1c')](_0xa363('0x1d'),_0x570d49,'request\x20sent');logger['debug'](_0xa363('0x1e'),_0x570d49,_0xa363('0x1f'),JSON[_0xa363('0x20')](_0xf30d74));if(_0xf30d74[_0xa363('0x21')]){if(_0xf30d74[_0xa363('0x21')][_0xa363('0x22')]===0x1f4){logger[_0xa363('0x21')](_0xa363('0x1d'),_0x570d49,_0xf30d74['error'][_0xa363('0x23')]);return _0x12e61b(_0xf30d74[_0xa363('0x21')]['message']);}logger[_0xa363('0x21')]('VtigerAccount,\x20%s,\x20%s',_0x570d49,_0xf30d74['error'][_0xa363('0x23')]);return _0x2147a0(_0xf30d74['error']['message']);}else{logger[_0xa363('0x1c')](_0xa363('0x1d'),_0x570d49,'request\x20sent');_0x2147a0(_0xf30d74[_0xa363('0x24')][_0xa363('0x23')]);}})['catch'](function(_0x24e511){logger[_0xa363('0x21')](_0xa363('0x1d'),_0x570d49,_0x24e511);_0x12e61b(_0x24e511);});});}function respondWithStatusCode(_0x421f21,_0x39a85f){_0x39a85f=_0x39a85f||0xcc;return function(_0x521d74){if(_0x521d74){return _0x421f21['sendStatus'](_0x39a85f);}return _0x421f21[_0xa363('0x25')](_0x39a85f)[_0xa363('0x26')]();};}function respondWithResult(_0x42601e,_0x423955){_0x423955=_0x423955||0xc8;return function(_0x2bc213){if(_0x2bc213){return _0x42601e[_0xa363('0x25')](_0x423955)['json'](_0x2bc213);}};}function respondWithFilteredResult(_0x260a17,_0x3ba948){return function(_0x3498d7){if(_0x3498d7){var _0x27e61c=_0x3498d7[_0xa363('0x27')],_0x166403=_0x3ba948[_0xa363('0x28')],_0x262078=_0x3ba948[_0xa363('0x28')]+_0x3ba948['limit'],_0x45a9e3;if(_0x262078>=_0x27e61c){_0x262078=_0x27e61c;_0x45a9e3=0xc8;}else{_0x45a9e3=0xce;}_0x260a17[_0xa363('0x25')](_0x45a9e3);return _0x260a17[_0xa363('0x29')](_0xa363('0x2a'),_0x166403+'-'+_0x262078+'/'+_0x27e61c)['json'](_0x3498d7);}return null;};}function patchUpdates(_0x4dc8ab){return function(_0x389bd8){try{jsonpatch[_0xa363('0x2b')](_0x389bd8,_0x4dc8ab,!![]);}catch(_0x276294){return BPromise[_0xa363('0x2c')](_0x276294);}return _0x389bd8[_0xa363('0x2d')]();};}function saveUpdates(_0x37afa3,_0x4e0756){return function(_0x1cbe00){if(_0x1cbe00){return _0x1cbe00['update'](_0x37afa3)[_0xa363('0x2e')](function(_0x3e87ec){return _0x3e87ec;});}return null;};}function removeEntity(_0x5ab1e4,_0x57182d){return function(_0x4605b3){if(_0x4605b3){return _0x4605b3[_0xa363('0x2f')]()[_0xa363('0x2e')](function(){_0x5ab1e4['status'](0xcc)[_0xa363('0x26')]();});}};}function handleEntityNotFound(_0xb142e,_0x3a71b1){return function(_0x3f0568){if(!_0x3f0568){_0xb142e[_0xa363('0x30')](0x194);}return _0x3f0568;};}function handleError(_0x3626d4,_0x446e2a){_0x446e2a=_0x446e2a||0x1f4;return function(_0x4172b7){logger[_0xa363('0x21')](_0x4172b7[_0xa363('0x31')]);if(_0x4172b7['name']){delete _0x4172b7[_0xa363('0x32')];}_0x3626d4[_0xa363('0x25')](_0x446e2a)[_0xa363('0x33')](_0x4172b7);};}exports['index']=function(_0x354e9c,_0x4a750b){var _0x107d45={},_0x2b3d02={},_0xdd8147={'count':0x0,'rows':[]};var _0x375fa5=_[_0xa363('0x34')](db[_0xa363('0x35')][_0xa363('0x36')],function(_0x1e97ba){return{'name':_0x1e97ba[_0xa363('0x37')],'type':_0x1e97ba[_0xa363('0x38')][_0xa363('0x39')]};});_0x2b3d02['model']=_['map'](_0x375fa5,_0xa363('0x32'));_0x2b3d02['query']=_['keys'](_0x354e9c['query']);_0x2b3d02[_0xa363('0x3a')]=_[_0xa363('0x3b')](_0x2b3d02[_0xa363('0x3c')],_0x2b3d02[_0xa363('0x3d')]);_0x107d45[_0xa363('0x3e')]=_[_0xa363('0x3b')](_0x2b3d02[_0xa363('0x3c')],qs[_0xa363('0x3f')](_0x354e9c[_0xa363('0x3d')][_0xa363('0x3f')]));_0x107d45[_0xa363('0x3e')]=_0x107d45[_0xa363('0x3e')][_0xa363('0x40')]?_0x107d45[_0xa363('0x3e')]:_0x2b3d02['model'];if(!_0x354e9c[_0xa363('0x3d')][_0xa363('0x41')]('nolimit')){_0x107d45[_0xa363('0x42')]=qs[_0xa363('0x42')](_0x354e9c['query'][_0xa363('0x42')]);_0x107d45[_0xa363('0x28')]=qs[_0xa363('0x28')](_0x354e9c[_0xa363('0x3d')][_0xa363('0x28')]);}_0x107d45[_0xa363('0x43')]=qs[_0xa363('0x44')](_0x354e9c[_0xa363('0x3d')]['sort']);_0x107d45[_0xa363('0x45')]=qs[_0xa363('0x3a')](_['pick'](_0x354e9c[_0xa363('0x3d')],_0x2b3d02[_0xa363('0x3a')]),_0x375fa5);if(_0x354e9c[_0xa363('0x3d')][_0xa363('0x46')]){_0x107d45[_0xa363('0x45')]=_['merge'](_0x107d45[_0xa363('0x45')],{'$or':_[_0xa363('0x34')](_0x375fa5,function(_0xe61a0f){if(_0xe61a0f['type']!==_0xa363('0x47')){var _0x14b78b={};_0x14b78b[_0xe61a0f[_0xa363('0x32')]]={'$like':'%'+_0x354e9c['query'][_0xa363('0x46')]+'%'};return _0x14b78b;}})});}_0x107d45=_[_0xa363('0x48')]({},_0x107d45,_0x354e9c[_0xa363('0x49')]);var _0x466441={'where':_0x107d45[_0xa363('0x45')]};return db[_0xa363('0x35')][_0xa363('0x27')](_0x466441)[_0xa363('0x2e')](function(_0x34ead2){_0xdd8147['count']=_0x34ead2;if(_0x354e9c[_0xa363('0x3d')][_0xa363('0x4a')]){_0x107d45['include']=[{'all':!![]}];}return db[_0xa363('0x35')]['findAll'](_0x107d45);})[_0xa363('0x2e')](function(_0x4d860e){_0xdd8147[_0xa363('0x4b')]=_0x4d860e;return _0xdd8147;})[_0xa363('0x2e')](respondWithFilteredResult(_0x4a750b,_0x107d45))[_0xa363('0x4c')](handleError(_0x4a750b,null));};exports[_0xa363('0x4d')]=function(_0x1066f0,_0x58111d){var _0x371d77={'raw':![],'where':{'id':_0x1066f0['params']['id']}},_0x21cdaf={};_0x21cdaf[_0xa363('0x3c')]=_[_0xa363('0x4e')](db['VtigerAccount'][_0xa363('0x36')]);_0x21cdaf[_0xa363('0x3d')]=_[_0xa363('0x4e')](_0x1066f0[_0xa363('0x3d')]);_0x21cdaf[_0xa363('0x3a')]=_['intersection'](_0x21cdaf[_0xa363('0x3c')],_0x21cdaf[_0xa363('0x3d')]);_0x371d77['attributes']=_[_0xa363('0x3b')](_0x21cdaf[_0xa363('0x3c')],qs['fields'](_0x1066f0['query'][_0xa363('0x3f')]));_0x371d77[_0xa363('0x3e')]=_0x371d77[_0xa363('0x3e')][_0xa363('0x40')]?_0x371d77[_0xa363('0x3e')]:_0x21cdaf['model'];if(_0x1066f0[_0xa363('0x3d')][_0xa363('0x4a')]){_0x371d77[_0xa363('0x4f')]=[{'all':!![]}];}_0x371d77=_['merge']({},_0x371d77,_0x1066f0[_0xa363('0x49')]);return db[_0xa363('0x35')][_0xa363('0x50')](_0x371d77)['then'](handleEntityNotFound(_0x58111d,null))['then'](respondWithResult(_0x58111d,null))['catch'](handleError(_0x58111d,null));};exports[_0xa363('0x51')]=function(_0x4ac62e,_0x3bf2d1){return db[_0xa363('0x35')]['create'](_0x4ac62e[_0xa363('0x52')],{})[_0xa363('0x2e')](respondWithResult(_0x3bf2d1,0xc9))['catch'](handleError(_0x3bf2d1,null));};exports[_0xa363('0x53')]=function(_0x466026,_0x3e77f5){if(_0x466026[_0xa363('0x52')]['id']){delete _0x466026[_0xa363('0x52')]['id'];}return db[_0xa363('0x35')][_0xa363('0x50')]({'where':{'id':_0x466026[_0xa363('0x54')]['id']}})[_0xa363('0x2e')](handleEntityNotFound(_0x3e77f5,null))[_0xa363('0x2e')](saveUpdates(_0x466026[_0xa363('0x52')],null))[_0xa363('0x2e')](respondWithResult(_0x3e77f5,null))[_0xa363('0x4c')](handleError(_0x3e77f5,null));};exports[_0xa363('0x2f')]=function(_0xabef3f,_0x3a8610){return db[_0xa363('0x35')][_0xa363('0x50')]({'where':{'id':_0xabef3f[_0xa363('0x54')]['id']}})[_0xa363('0x2e')](handleEntityNotFound(_0x3a8610,null))[_0xa363('0x2e')](removeEntity(_0x3a8610,null))[_0xa363('0x4c')](handleError(_0x3a8610,null));};exports[_0xa363('0x55')]=function(_0x58a97e,_0x47d8fb,_0xb4fc74){var _0x299021={};var _0x1a786a={};var _0x3b7783;var _0x481b00;return db[_0xa363('0x35')][_0xa363('0x56')]({'where':{'id':_0x58a97e[_0xa363('0x54')]['id']}})['then'](handleEntityNotFound(_0x47d8fb,null))[_0xa363('0x2e')](function(_0x3c919d){if(_0x3c919d){_0x3b7783=_0x3c919d;_0x1a786a[_0xa363('0x3c')]=_[_0xa363('0x4e')](db['VtigerConfiguration'][_0xa363('0x36')]);_0x1a786a[_0xa363('0x3d')]=_[_0xa363('0x4e')](_0x58a97e[_0xa363('0x3d')]);_0x1a786a[_0xa363('0x3a')]=_['intersection'](_0x1a786a['model'],_0x1a786a['query']);_0x299021[_0xa363('0x3e')]=_[_0xa363('0x3b')](_0x1a786a[_0xa363('0x3c')],qs[_0xa363('0x3f')](_0x58a97e[_0xa363('0x3d')]['fields']));_0x299021[_0xa363('0x3e')]=_0x299021['attributes'][_0xa363('0x40')]?_0x299021[_0xa363('0x3e')]:_0x1a786a[_0xa363('0x3c')];_0x299021[_0xa363('0x43')]=qs['sort'](_0x58a97e['query'][_0xa363('0x44')]);_0x299021[_0xa363('0x45')]=qs[_0xa363('0x3a')](_[_0xa363('0x57')](_0x58a97e['query'],_0x1a786a[_0xa363('0x3a')]));if(_0x58a97e[_0xa363('0x3d')][_0xa363('0x46')]){_0x299021[_0xa363('0x45')]=_[_0xa363('0x48')](_0x299021[_0xa363('0x45')],{'$or':_[_0xa363('0x34')](_0x299021[_0xa363('0x3e')],function(_0x362cd8){var _0x4e2cf3={};_0x4e2cf3[_0x362cd8]={'$like':'%'+_0x58a97e['query'][_0xa363('0x46')]+'%'};return _0x4e2cf3;})});}_0x299021=_['merge']({},_0x299021,_0x58a97e[_0xa363('0x49')]);return _0x3b7783[_0xa363('0x55')](_0x299021);}})[_0xa363('0x2e')](function(_0x5ea4f8){if(_0x5ea4f8){_0x481b00=_0x5ea4f8['length'];if(!_0x58a97e['query'][_0xa363('0x41')]('nolimit')){_0x299021['limit']=qs['limit'](_0x58a97e['query']['limit']);_0x299021[_0xa363('0x28')]=qs[_0xa363('0x28')](_0x58a97e[_0xa363('0x3d')][_0xa363('0x28')]);}return _0x3b7783[_0xa363('0x55')](_0x299021);}})[_0xa363('0x2e')](function(_0x181065){if(_0x181065){return _0x181065?{'count':_0x481b00,'rows':_0x181065}:null;}})['then'](respondWithResult(_0x47d8fb,null))[_0xa363('0x4c')](handleError(_0x47d8fb,null));};exports[_0xa363('0x58')]=function(_0x3c9be8,_0x318693,_0x42c877){if(_0x3c9be8['body']['id']){delete _0x3c9be8[_0xa363('0x52')]['id'];}return db[_0xa363('0x35')][_0xa363('0x56')]({'where':{'id':_0x3c9be8['params']['id']}})[_0xa363('0x2e')](handleEntityNotFound(_0x318693,null))[_0xa363('0x2e')](function(_0x3d4d51){if(_0x3d4d51){_0x3c9be8[_0xa363('0x52')][_0xa363('0x59')]=_0x3d4d51['id'];_0x3c9be8[_0xa363('0x52')][_0xa363('0x5a')]=integrations[_0xa363('0x5b')](_0x3c9be8[_0xa363('0x52')][_0xa363('0x5c')],_0x3c9be8['body'][_0xa363('0x38')]);_0x3c9be8[_0xa363('0x52')][_0xa363('0x5d')]=integrations[_0xa363('0x5e')](_0x3c9be8[_0xa363('0x52')][_0xa363('0x5c')],_0x3c9be8['body'][_0xa363('0x38')]);return db[_0xa363('0x5f')]['create'](_0x3c9be8[_0xa363('0x52')],{'include':[{'model':db[_0xa363('0x60')],'as':_0xa363('0x5a')},{'model':db[_0xa363('0x60')],'as':_0xa363('0x5d')}]});}return null;})['then'](respondWithResult(_0x318693,null))[_0xa363('0x4c')](handleError(_0x318693,null));};var md5=require(_0xa363('0x61'));exports[_0xa363('0x62')]=function(_0x371597,_0x352240,_0x93b157){var _0x3258c6=null;var _0x565fb7=null;var _0x276431=null;var _0x1fc74b=null;var _0x342f40='';return db[_0xa363('0x35')][_0xa363('0x56')]({'where':{'id':_0x371597['params']['id']},'attributes':['id',_0xa363('0x32'),_0xa363('0x63'),'description',_0xa363('0x64'),_0xa363('0x65'),_0xa363('0x66'),_0xa363('0x67')]})[_0xa363('0x2e')](handleEntityNotFound(_0x352240,null))[_0xa363('0x2e')](function(_0x5c7aec){if(_0x5c7aec){_0x3258c6=_0x5c7aec[_0xa363('0x63')];_0x565fb7=_0x5c7aec[_0xa363('0x67')];_0x276431=_0x5c7aec[_0xa363('0x64')];_0x342f40=_0x5c7aec[_0xa363('0x65')];var _0x350957=_0x342f40['slice'](-0x1);if(_0x350957==='/'){_0x342f40=_0x342f40[_0xa363('0x68')](0x0,_0x342f40[_0xa363('0x69')](_0x350957));}_0x1fc74b=util[_0xa363('0x6a')](_0xa363('0x6b'),_0x342f40);var _0x453796={'method':_0xa363('0x6c'),'uri':_0x1fc74b,'qs':{'operation':_0xa363('0x6d'),'username':_0x5c7aec['username']},'json':!![]};return rp(_0x453796);}})['then'](function(_0x1cc9a2){if(_0x1cc9a2[_0xa363('0x6e')]){var _0x26bdc5={'method':_0xa363('0x6f'),'uri':_0x1fc74b,'form':{'operation':'login','username':_0x3258c6,'accessKey':md5(_0x1cc9a2[_0xa363('0x24')][_0xa363('0x70')]+_0x565fb7)},'json':!![]};return rp(_0x26bdc5);}})[_0xa363('0x2e')](function(_0x38973b){if(_0x38973b[_0xa363('0x6e')]){var _0x5d13af={'method':_0xa363('0x6c'),'uri':_0x1fc74b,'qs':{'operation':_0xa363('0x71'),'username':_0x3258c6,'sessionName':_0x38973b['result']['sessionName'],'elementType':_0x276431},'json':!![]};return rp(_0x5d13af);}})['then'](function(_0x57ecba){if(_0x57ecba[_0xa363('0x6e')]){var _0x4eaaea=['autogenerated',_0xa363('0x72'),_0xa363('0x73')];_[_0xa363('0x74')](_0x57ecba[_0xa363('0x24')][_0xa363('0x3f')],function(_0x39ca8b){return _0x4eaaea[_0xa363('0x75')](_0x39ca8b[_0xa363('0x38')][_0xa363('0x32')]);});_[_0xa363('0x74')](_0x57ecba[_0xa363('0x24')][_0xa363('0x3f')],function(_0x20d431){return _0x20d431[_0xa363('0x76')]==='false';});return{'count':_0x57ecba[_0xa363('0x24')][_0xa363('0x3f')][_0xa363('0x40')],'rows':_['map'](_0x57ecba[_0xa363('0x24')][_0xa363('0x3f')],function(_0x57a8f1){return{'id':_0x57a8f1[_0xa363('0x32')],'name':_0x57a8f1['label'],'custom':_[_0xa363('0x77')](_0x57a8f1[_0xa363('0x32')],_0xa363('0x78'))?!![]:![],'options':_0x57a8f1[_0xa363('0x38')][_0xa363('0x32')]===_0xa363('0x79')&&_0x57a8f1[_0xa363('0x38')]['picklistValues'][_0xa363('0x40')]>0x0?_[_0xa363('0x34')](_0x57a8f1[_0xa363('0x38')][_0xa363('0x7a')],function(_0x4b4101){return{'name':_0x4b4101[_0xa363('0x7b')],'value':_0x4b4101[_0xa363('0x7c')]};}):[]};})};}})[_0xa363('0x2e')](respondWithResult(_0x352240,null))[_0xa363('0x4c')](function(_0x390acd){console[_0xa363('0x7d')](_0xa363('0x7e')+_0x390acd);var _0x47869f=_0x371597[_0xa363('0x3d')]['test']?0x1f4:_0x390acd[_0xa363('0x7f')]||0x1f4;logger[_0xa363('0x21')](_0xa363('0x80'),'getFields',_0x47869f,JSON['stringify'](_0x390acd));delete _0x390acd[_0xa363('0x32')];if(_0x47869f===0x191){_0x47869f=0x190;}_0x352240[_0xa363('0x25')](_0x47869f)[_0xa363('0x33')](_0x371597[_0xa363('0x3d')][_0xa363('0x18')]?{'message':'Wrong\x20credentials','statusCode':_0x390acd[_0xa363('0x7f')]}:_0x390acd);});}; \ No newline at end of file +var _0x7e8a=['nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','findOne','description','moduleName','remoteUri','username','accessKey','slice','substring','format','getchallenge','success','POST','login','token','GET','describe','sessionName','reference','includes','false','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','Wrong\x20credentials','html-pdf','eml-format','fast-json-patch','moment','bluebird','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','debug','stringify','error','code','message','VtigerAccount,\x20%s,\x20%s','info','request\x20sent','result','catch','status','json','count','offset','limit','set','Content-Range','save','update','then','destroy','end','sendStatus','name','send','index','VtigerAccount','rawAttributes','type','key','model','map','keys','filters','query','attributes','length','order','sort','where','merge','VIRTUAL','filter','options','includeAll','rows','show','params','intersection','fields','find','create','body','VtigerConfiguration','pick','hasOwnProperty'];(function(_0x2ac499,_0x270c43){var _0x39098b=function(_0x2adeae){while(--_0x2adeae){_0x2ac499['push'](_0x2ac499['shift']());}};_0x39098b(++_0x270c43);}(_0x7e8a,0x11c));var _0xa7e8=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x7e8a[_0x1beef3];return _0x5af964;};'use strict';var pdf=require(_0xa7e8('0x0'));var emlformat=require(_0xa7e8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa7e8('0x2'));var rp=require('request-promise');var moment=require(_0xa7e8('0x3'));var BPromise=require(_0xa7e8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa7e8('0x5'));var sox=require(_0xa7e8('0x6'));var csv=require(_0xa7e8('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa7e8('0x8'));var squel=require(_0xa7e8('0x9'));var crypto=require('crypto');var jsforce=require(_0xa7e8('0xa'));var deskjs=require(_0xa7e8('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa7e8('0xc'));var Papa=require('papaparse');var Redis=require(_0xa7e8('0xd'));var authService=require(_0xa7e8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa7e8('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa7e8('0x10'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa7e8('0x11'));var jayson=require(_0xa7e8('0x12'));var client=jayson[_0xa7e8('0x13')][_0xa7e8('0x14')]({'port':0x232a});function checkPasswordPattern(_0x29f742,_0x451ee7,_0x55b844){if(_0x55b844){var _0x358af7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x358af7[_0xa7e8('0x15')](_0x451ee7)){return _0x29f742;}else{throw new db[(_0xa7e8('0x16'))][(_0xa7e8('0x17'))](_0xa7e8('0x18'));}}else{return _0x29f742;}}function respondWithRpcPromise(_0x4c0b6f,_0x56b37f,_0x3a2217,_0x488fbd){return new BPromise(function(_0x2d8dfd,_0x34305b){var _0x26c15b=_0x488fbd||client;return _0x26c15b[_0xa7e8('0x19')](_0x4c0b6f,_0x3a2217)['then'](function(_0x5ee682){logger['info']('VtigerAccount,\x20%s,\x20%s',_0x56b37f,'request\x20sent');logger[_0xa7e8('0x1a')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x56b37f,'request\x20sent',JSON[_0xa7e8('0x1b')](_0x5ee682));if(_0x5ee682[_0xa7e8('0x1c')]){if(_0x5ee682['error'][_0xa7e8('0x1d')]===0x1f4){logger[_0xa7e8('0x1c')]('VtigerAccount,\x20%s,\x20%s',_0x56b37f,_0x5ee682[_0xa7e8('0x1c')][_0xa7e8('0x1e')]);return _0x34305b(_0x5ee682[_0xa7e8('0x1c')][_0xa7e8('0x1e')]);}logger[_0xa7e8('0x1c')](_0xa7e8('0x1f'),_0x56b37f,_0x5ee682[_0xa7e8('0x1c')][_0xa7e8('0x1e')]);return _0x2d8dfd(_0x5ee682['error'][_0xa7e8('0x1e')]);}else{logger[_0xa7e8('0x20')](_0xa7e8('0x1f'),_0x56b37f,_0xa7e8('0x21'));_0x2d8dfd(_0x5ee682[_0xa7e8('0x22')]['message']);}})[_0xa7e8('0x23')](function(_0x93c240){logger[_0xa7e8('0x1c')](_0xa7e8('0x1f'),_0x56b37f,_0x93c240);_0x34305b(_0x93c240);});});}function respondWithStatusCode(_0xbda61b,_0x59f3f1){_0x59f3f1=_0x59f3f1||0xcc;return function(_0x337a9b){if(_0x337a9b){return _0xbda61b['sendStatus'](_0x59f3f1);}return _0xbda61b[_0xa7e8('0x24')](_0x59f3f1)['end']();};}function respondWithResult(_0x1f6655,_0x41144f){_0x41144f=_0x41144f||0xc8;return function(_0x3b329d){if(_0x3b329d){return _0x1f6655[_0xa7e8('0x24')](_0x41144f)[_0xa7e8('0x25')](_0x3b329d);}};}function respondWithFilteredResult(_0x305421,_0x11f5db){return function(_0x1e33ad){if(_0x1e33ad){var _0x136eaa=_0x1e33ad[_0xa7e8('0x26')],_0x29cfa5=_0x11f5db[_0xa7e8('0x27')],_0x404eed=_0x11f5db[_0xa7e8('0x27')]+_0x11f5db[_0xa7e8('0x28')],_0x5d21d3;if(_0x404eed>=_0x136eaa){_0x404eed=_0x136eaa;_0x5d21d3=0xc8;}else{_0x5d21d3=0xce;}_0x305421['status'](_0x5d21d3);return _0x305421[_0xa7e8('0x29')](_0xa7e8('0x2a'),_0x29cfa5+'-'+_0x404eed+'/'+_0x136eaa)[_0xa7e8('0x25')](_0x1e33ad);}return null;};}function patchUpdates(_0x1c8319){return function(_0x4e6bb2){try{jsonpatch['apply'](_0x4e6bb2,_0x1c8319,!![]);}catch(_0x1af6b2){return BPromise['reject'](_0x1af6b2);}return _0x4e6bb2[_0xa7e8('0x2b')]();};}function saveUpdates(_0x225336,_0x5099dc){return function(_0x18cb84){if(_0x18cb84){return _0x18cb84[_0xa7e8('0x2c')](_0x225336)[_0xa7e8('0x2d')](function(_0x69abcc){return _0x69abcc;});}return null;};}function removeEntity(_0x381e83,_0x28e4b6){return function(_0x290321){if(_0x290321){return _0x290321[_0xa7e8('0x2e')]()[_0xa7e8('0x2d')](function(){_0x381e83[_0xa7e8('0x24')](0xcc)[_0xa7e8('0x2f')]();});}};}function handleEntityNotFound(_0x5265c5,_0x8788a8){return function(_0x33f21){if(!_0x33f21){_0x5265c5[_0xa7e8('0x30')](0x194);}return _0x33f21;};}function handleError(_0x434be6,_0xd67c2d){_0xd67c2d=_0xd67c2d||0x1f4;return function(_0x1eb530){logger[_0xa7e8('0x1c')](_0x1eb530['stack']);if(_0x1eb530['name']){delete _0x1eb530[_0xa7e8('0x31')];}_0x434be6[_0xa7e8('0x24')](_0xd67c2d)[_0xa7e8('0x32')](_0x1eb530);};}exports[_0xa7e8('0x33')]=function(_0x4e48ab,_0x1f0237){var _0x3564b3={},_0x369e84={},_0xe5f281={'count':0x0,'rows':[]};var _0x51ca0c=_['map'](db[_0xa7e8('0x34')][_0xa7e8('0x35')],function(_0x5a5a9c){return{'name':_0x5a5a9c['fieldName'],'type':_0x5a5a9c[_0xa7e8('0x36')][_0xa7e8('0x37')]};});_0x369e84[_0xa7e8('0x38')]=_[_0xa7e8('0x39')](_0x51ca0c,'name');_0x369e84['query']=_[_0xa7e8('0x3a')](_0x4e48ab['query']);_0x369e84[_0xa7e8('0x3b')]=_['intersection'](_0x369e84[_0xa7e8('0x38')],_0x369e84[_0xa7e8('0x3c')]);_0x3564b3[_0xa7e8('0x3d')]=_['intersection'](_0x369e84[_0xa7e8('0x38')],qs['fields'](_0x4e48ab['query']['fields']));_0x3564b3[_0xa7e8('0x3d')]=_0x3564b3['attributes'][_0xa7e8('0x3e')]?_0x3564b3[_0xa7e8('0x3d')]:_0x369e84['model'];if(!_0x4e48ab[_0xa7e8('0x3c')]['hasOwnProperty']('nolimit')){_0x3564b3[_0xa7e8('0x28')]=qs['limit'](_0x4e48ab[_0xa7e8('0x3c')]['limit']);_0x3564b3[_0xa7e8('0x27')]=qs[_0xa7e8('0x27')](_0x4e48ab['query'][_0xa7e8('0x27')]);}_0x3564b3[_0xa7e8('0x3f')]=qs[_0xa7e8('0x40')](_0x4e48ab[_0xa7e8('0x3c')][_0xa7e8('0x40')]);_0x3564b3['where']=qs['filters'](_['pick'](_0x4e48ab[_0xa7e8('0x3c')],_0x369e84[_0xa7e8('0x3b')]),_0x51ca0c);if(_0x4e48ab[_0xa7e8('0x3c')]['filter']){_0x3564b3[_0xa7e8('0x41')]=_[_0xa7e8('0x42')](_0x3564b3[_0xa7e8('0x41')],{'$or':_[_0xa7e8('0x39')](_0x51ca0c,function(_0x4f5fcd){if(_0x4f5fcd['type']!==_0xa7e8('0x43')){var _0x65748d={};_0x65748d[_0x4f5fcd[_0xa7e8('0x31')]]={'$like':'%'+_0x4e48ab[_0xa7e8('0x3c')][_0xa7e8('0x44')]+'%'};return _0x65748d;}})});}_0x3564b3=_[_0xa7e8('0x42')]({},_0x3564b3,_0x4e48ab[_0xa7e8('0x45')]);var _0xbd49ad={'where':_0x3564b3[_0xa7e8('0x41')]};return db['VtigerAccount'][_0xa7e8('0x26')](_0xbd49ad)['then'](function(_0x49ffc5){_0xe5f281[_0xa7e8('0x26')]=_0x49ffc5;if(_0x4e48ab['query'][_0xa7e8('0x46')]){_0x3564b3['include']=[{'all':!![]}];}return db[_0xa7e8('0x34')]['findAll'](_0x3564b3);})['then'](function(_0x599e57){_0xe5f281[_0xa7e8('0x47')]=_0x599e57;return _0xe5f281;})[_0xa7e8('0x2d')](respondWithFilteredResult(_0x1f0237,_0x3564b3))[_0xa7e8('0x23')](handleError(_0x1f0237,null));};exports[_0xa7e8('0x48')]=function(_0x2b46e0,_0x729122){var _0x5e1ad2={'raw':![],'where':{'id':_0x2b46e0[_0xa7e8('0x49')]['id']}},_0x1207da={};_0x1207da[_0xa7e8('0x38')]=_['keys'](db[_0xa7e8('0x34')][_0xa7e8('0x35')]);_0x1207da[_0xa7e8('0x3c')]=_[_0xa7e8('0x3a')](_0x2b46e0[_0xa7e8('0x3c')]);_0x1207da['filters']=_[_0xa7e8('0x4a')](_0x1207da[_0xa7e8('0x38')],_0x1207da[_0xa7e8('0x3c')]);_0x5e1ad2[_0xa7e8('0x3d')]=_[_0xa7e8('0x4a')](_0x1207da['model'],qs[_0xa7e8('0x4b')](_0x2b46e0['query'][_0xa7e8('0x4b')]));_0x5e1ad2['attributes']=_0x5e1ad2[_0xa7e8('0x3d')][_0xa7e8('0x3e')]?_0x5e1ad2[_0xa7e8('0x3d')]:_0x1207da[_0xa7e8('0x38')];if(_0x2b46e0[_0xa7e8('0x3c')][_0xa7e8('0x46')]){_0x5e1ad2['include']=[{'all':!![]}];}_0x5e1ad2=_[_0xa7e8('0x42')]({},_0x5e1ad2,_0x2b46e0['options']);return db[_0xa7e8('0x34')][_0xa7e8('0x4c')](_0x5e1ad2)['then'](handleEntityNotFound(_0x729122,null))[_0xa7e8('0x2d')](respondWithResult(_0x729122,null))[_0xa7e8('0x23')](handleError(_0x729122,null));};exports[_0xa7e8('0x4d')]=function(_0x166314,_0xa13d96){return db[_0xa7e8('0x34')][_0xa7e8('0x4d')](_0x166314[_0xa7e8('0x4e')],{})[_0xa7e8('0x2d')](respondWithResult(_0xa13d96,0xc9))[_0xa7e8('0x23')](handleError(_0xa13d96,null));};exports[_0xa7e8('0x2c')]=function(_0x3c1b14,_0x6d3056){if(_0x3c1b14[_0xa7e8('0x4e')]['id']){delete _0x3c1b14[_0xa7e8('0x4e')]['id'];}return db[_0xa7e8('0x34')][_0xa7e8('0x4c')]({'where':{'id':_0x3c1b14[_0xa7e8('0x49')]['id']}})['then'](handleEntityNotFound(_0x6d3056,null))[_0xa7e8('0x2d')](saveUpdates(_0x3c1b14[_0xa7e8('0x4e')],null))[_0xa7e8('0x2d')](respondWithResult(_0x6d3056,null))[_0xa7e8('0x23')](handleError(_0x6d3056,null));};exports[_0xa7e8('0x2e')]=function(_0x4d059c,_0x1fc243){return db[_0xa7e8('0x34')][_0xa7e8('0x4c')]({'where':{'id':_0x4d059c[_0xa7e8('0x49')]['id']}})[_0xa7e8('0x2d')](handleEntityNotFound(_0x1fc243,null))[_0xa7e8('0x2d')](removeEntity(_0x1fc243,null))['catch'](handleError(_0x1fc243,null));};exports['getConfigurations']=function(_0x2b39ab,_0xce88ec,_0x206d87){var _0x6a5614={};var _0x16bfb6={};var _0x19711c;var _0x27afd1;return db[_0xa7e8('0x34')]['findOne']({'where':{'id':_0x2b39ab[_0xa7e8('0x49')]['id']}})[_0xa7e8('0x2d')](handleEntityNotFound(_0xce88ec,null))[_0xa7e8('0x2d')](function(_0x280208){if(_0x280208){_0x19711c=_0x280208;_0x16bfb6[_0xa7e8('0x38')]=_[_0xa7e8('0x3a')](db[_0xa7e8('0x4f')]['rawAttributes']);_0x16bfb6[_0xa7e8('0x3c')]=_[_0xa7e8('0x3a')](_0x2b39ab['query']);_0x16bfb6[_0xa7e8('0x3b')]=_[_0xa7e8('0x4a')](_0x16bfb6[_0xa7e8('0x38')],_0x16bfb6[_0xa7e8('0x3c')]);_0x6a5614[_0xa7e8('0x3d')]=_[_0xa7e8('0x4a')](_0x16bfb6[_0xa7e8('0x38')],qs[_0xa7e8('0x4b')](_0x2b39ab[_0xa7e8('0x3c')]['fields']));_0x6a5614[_0xa7e8('0x3d')]=_0x6a5614[_0xa7e8('0x3d')]['length']?_0x6a5614[_0xa7e8('0x3d')]:_0x16bfb6[_0xa7e8('0x38')];_0x6a5614[_0xa7e8('0x3f')]=qs[_0xa7e8('0x40')](_0x2b39ab[_0xa7e8('0x3c')][_0xa7e8('0x40')]);_0x6a5614[_0xa7e8('0x41')]=qs[_0xa7e8('0x3b')](_[_0xa7e8('0x50')](_0x2b39ab[_0xa7e8('0x3c')],_0x16bfb6[_0xa7e8('0x3b')]));if(_0x2b39ab['query'][_0xa7e8('0x44')]){_0x6a5614[_0xa7e8('0x41')]=_[_0xa7e8('0x42')](_0x6a5614[_0xa7e8('0x41')],{'$or':_[_0xa7e8('0x39')](_0x6a5614[_0xa7e8('0x3d')],function(_0x1836d7){var _0x396d01={};_0x396d01[_0x1836d7]={'$like':'%'+_0x2b39ab[_0xa7e8('0x3c')][_0xa7e8('0x44')]+'%'};return _0x396d01;})});}_0x6a5614=_['merge']({},_0x6a5614,_0x2b39ab['options']);return _0x19711c['getConfigurations'](_0x6a5614);}})[_0xa7e8('0x2d')](function(_0x62e338){if(_0x62e338){_0x27afd1=_0x62e338[_0xa7e8('0x3e')];if(!_0x2b39ab[_0xa7e8('0x3c')][_0xa7e8('0x51')](_0xa7e8('0x52'))){_0x6a5614[_0xa7e8('0x28')]=qs['limit'](_0x2b39ab[_0xa7e8('0x3c')][_0xa7e8('0x28')]);_0x6a5614[_0xa7e8('0x27')]=qs[_0xa7e8('0x27')](_0x2b39ab[_0xa7e8('0x3c')]['offset']);}return _0x19711c['getConfigurations'](_0x6a5614);}})[_0xa7e8('0x2d')](function(_0x4841a1){if(_0x4841a1){return _0x4841a1?{'count':_0x27afd1,'rows':_0x4841a1}:null;}})['then'](respondWithResult(_0xce88ec,null))[_0xa7e8('0x23')](handleError(_0xce88ec,null));};exports[_0xa7e8('0x53')]=function(_0x4d1105,_0x39ba5b,_0x157d2e){if(_0x4d1105[_0xa7e8('0x4e')]['id']){delete _0x4d1105[_0xa7e8('0x4e')]['id'];}return db[_0xa7e8('0x34')]['findOne']({'where':{'id':_0x4d1105[_0xa7e8('0x49')]['id']}})[_0xa7e8('0x2d')](handleEntityNotFound(_0x39ba5b,null))[_0xa7e8('0x2d')](function(_0x3bcc18){if(_0x3bcc18){_0x4d1105[_0xa7e8('0x4e')][_0xa7e8('0x54')]=_0x3bcc18['id'];_0x4d1105[_0xa7e8('0x4e')][_0xa7e8('0x55')]=integrations[_0xa7e8('0x56')](_0x4d1105[_0xa7e8('0x4e')][_0xa7e8('0x57')],_0x4d1105['body'][_0xa7e8('0x36')]);_0x4d1105[_0xa7e8('0x4e')]['Descriptions']=integrations[_0xa7e8('0x58')](_0x4d1105[_0xa7e8('0x4e')][_0xa7e8('0x57')],_0x4d1105[_0xa7e8('0x4e')][_0xa7e8('0x36')]);return db[_0xa7e8('0x4f')][_0xa7e8('0x4d')](_0x4d1105[_0xa7e8('0x4e')],{'include':[{'model':db[_0xa7e8('0x59')],'as':_0xa7e8('0x55')},{'model':db['VtigerField'],'as':_0xa7e8('0x5a')}]});}return null;})[_0xa7e8('0x2d')](respondWithResult(_0x39ba5b,null))[_0xa7e8('0x23')](handleError(_0x39ba5b,null));};var md5=require(_0xa7e8('0x5b'));exports[_0xa7e8('0x5c')]=function(_0x32d6ec,_0x3fb7f5,_0x443cb1){var _0x2a02a6=null;var _0x3736c8=null;var _0x6f85c=null;var _0x4ff773=null;var _0x45a685='';return db['VtigerAccount'][_0xa7e8('0x5d')]({'where':{'id':_0x32d6ec[_0xa7e8('0x49')]['id']},'attributes':['id',_0xa7e8('0x31'),'username',_0xa7e8('0x5e'),_0xa7e8('0x5f'),_0xa7e8('0x60'),'serverUrl','accessKey']})[_0xa7e8('0x2d')](handleEntityNotFound(_0x3fb7f5,null))[_0xa7e8('0x2d')](function(_0x3d8065){if(_0x3d8065){_0x2a02a6=_0x3d8065[_0xa7e8('0x61')];_0x3736c8=_0x3d8065[_0xa7e8('0x62')];_0x6f85c=_0x3d8065[_0xa7e8('0x5f')];_0x45a685=_0x3d8065[_0xa7e8('0x60')];var _0x3b4a93=_0x45a685[_0xa7e8('0x63')](-0x1);if(_0x3b4a93==='/'){_0x45a685=_0x45a685[_0xa7e8('0x64')](0x0,_0x45a685['lastIndexOf'](_0x3b4a93));}_0x4ff773=util[_0xa7e8('0x65')]('%s/webservice.php',_0x45a685);var _0x11f8a9={'method':'GET','uri':_0x4ff773,'qs':{'operation':_0xa7e8('0x66'),'username':_0x3d8065['username']},'json':!![]};return rp(_0x11f8a9);}})['then'](function(_0x30efbd){if(_0x30efbd[_0xa7e8('0x67')]){var _0x9be1f1={'method':_0xa7e8('0x68'),'uri':_0x4ff773,'form':{'operation':_0xa7e8('0x69'),'username':_0x2a02a6,'accessKey':md5(_0x30efbd[_0xa7e8('0x22')][_0xa7e8('0x6a')]+_0x3736c8)},'json':!![]};return rp(_0x9be1f1);}})[_0xa7e8('0x2d')](function(_0x35b38a){if(_0x35b38a[_0xa7e8('0x67')]){var _0x3cfea0={'method':_0xa7e8('0x6b'),'uri':_0x4ff773,'qs':{'operation':_0xa7e8('0x6c'),'username':_0x2a02a6,'sessionName':_0x35b38a[_0xa7e8('0x22')][_0xa7e8('0x6d')],'elementType':_0x6f85c},'json':!![]};return rp(_0x3cfea0);}})[_0xa7e8('0x2d')](function(_0x2b67fa){if(_0x2b67fa['success']){var _0x340c47=['autogenerated',_0xa7e8('0x6e'),'owner'];_['remove'](_0x2b67fa[_0xa7e8('0x22')][_0xa7e8('0x4b')],function(_0x54b66d){return _0x340c47[_0xa7e8('0x6f')](_0x54b66d[_0xa7e8('0x36')][_0xa7e8('0x31')]);});_['remove'](_0x2b67fa[_0xa7e8('0x22')][_0xa7e8('0x4b')],function(_0x5c9b30){return _0x5c9b30['editable']===_0xa7e8('0x70');});return{'count':_0x2b67fa[_0xa7e8('0x22')][_0xa7e8('0x4b')][_0xa7e8('0x3e')],'rows':_[_0xa7e8('0x39')](_0x2b67fa['result'][_0xa7e8('0x4b')],function(_0x119b95){return{'id':_0x119b95['name'],'name':_0x119b95['label'],'custom':_[_0xa7e8('0x71')](_0x119b95[_0xa7e8('0x31')],_0xa7e8('0x72'))?!![]:![],'options':_0x119b95['type'][_0xa7e8('0x31')]===_0xa7e8('0x73')&&_0x119b95[_0xa7e8('0x36')][_0xa7e8('0x74')]['length']>0x0?_[_0xa7e8('0x39')](_0x119b95[_0xa7e8('0x36')][_0xa7e8('0x74')],function(_0x3f253b){return{'name':_0x3f253b['label'],'value':_0x3f253b[_0xa7e8('0x75')]};}):[]};})};}})[_0xa7e8('0x2d')](respondWithResult(_0x3fb7f5,null))[_0xa7e8('0x23')](function(_0x11ecb8){console[_0xa7e8('0x76')](_0xa7e8('0x77')+_0x11ecb8);var _0x226829=_0x32d6ec[_0xa7e8('0x3c')][_0xa7e8('0x15')]?0x1f4:_0x11ecb8[_0xa7e8('0x78')]||0x1f4;logger[_0xa7e8('0x1c')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x226829,JSON[_0xa7e8('0x1b')](_0x11ecb8));delete _0x11ecb8[_0xa7e8('0x31')];if(_0x226829===0x191){_0x226829=0x190;}_0x3fb7f5[_0xa7e8('0x24')](_0x226829)[_0xa7e8('0x32')](_0x32d6ec[_0xa7e8('0x3c')][_0xa7e8('0x15')]?{'message':_0xa7e8('0x79'),'statusCode':_0x11ecb8[_0xa7e8('0x78')]}:_0x11ecb8);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index f0c34e7..cb65278 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 _0xe831=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x74cef,_0x5aa42b){var _0x2d54cf=function(_0x5f0e06){while(--_0x5f0e06){_0x74cef['push'](_0x74cef['shift']());}};_0x2d54cf(++_0x5aa42b);}(_0xe831,0x1c9));var _0x1e83=function(_0x72a6ef,_0x2aa36b){_0x72a6ef=_0x72a6ef-0x0;var _0x592806=_0xe831[_0x72a6ef];return _0x592806;};'use strict';var _=require(_0x1e83('0x0'));var util=require(_0x1e83('0x1'));var logger=require(_0x1e83('0x2'))(_0x1e83('0x3'));var moment=require(_0x1e83('0x4'));var BPromise=require(_0x1e83('0x5'));var rp=require(_0x1e83('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1e83('0x7'));var config=require(_0x1e83('0x8'));var attributes=require(_0x1e83('0x9'));var integrations=require(_0x1e83('0xa'));module[_0x1e83('0xb')]=function(_0x8c4914,_0x59cb4c){return _0x8c4914[_0x1e83('0xc')](_0x1e83('0xd'),attributes,{'tableName':_0x1e83('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc2ce=['../../components/integrations/configuration','exports','define','VtigerAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes'];(function(_0x12c3c8,_0x9f61e9){var _0x256e35=function(_0xce2ea0){while(--_0xce2ea0){_0x12c3c8['push'](_0x12c3c8['shift']());}};_0x256e35(++_0x9f61e9);}(_0xc2ce,0x82));var _0xec2c=function(_0x3c5e54,_0x2b991b){_0x3c5e54=_0x3c5e54-0x0;var _0x3ae1f3=_0xc2ce[_0x3c5e54];return _0x3ae1f3;};'use strict';var _=require(_0xec2c('0x0'));var util=require(_0xec2c('0x1'));var logger=require(_0xec2c('0x2'))(_0xec2c('0x3'));var moment=require(_0xec2c('0x4'));var BPromise=require(_0xec2c('0x5'));var rp=require(_0xec2c('0x6'));var fs=require('fs');var path=require(_0xec2c('0x7'));var rimraf=require('rimraf');var config=require(_0xec2c('0x8'));var attributes=require(_0xec2c('0x9'));var integrations=require(_0xec2c('0xa'));module[_0xec2c('0xb')]=function(_0x4afebf,_0xce3585){return _0x4afebf[_0xec2c('0xc')](_0xec2c('0xd'),attributes,{'tableName':'int_vtiger_accounts','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 f1217c1..18afe32 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 _0x370d=['attributes','limit','include','model','map','then','ShowVtigerAccount','VtigerAccount','raw','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','catch','GetVtigerAccount','findAll','options','where'];(function(_0x4d2263,_0x3fbf0d){var _0x24aba0=function(_0x389a59){while(--_0x389a59){_0x4d2263['push'](_0x4d2263['shift']());}};_0x24aba0(++_0x3fbf0d);}(_0x370d,0x1f3));var _0xd370=function(_0x368a70,_0xd21308){_0x368a70=_0x368a70-0x0;var _0x14b963=_0x370d[_0x368a70];return _0x14b963;};'use strict';var _=require(_0xd370('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd370('0x1'));var rs=require(_0xd370('0x2'));var fs=require('fs');var Redis=require(_0xd370('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd370('0x4'));var logger=require(_0xd370('0x5'))(_0xd370('0x6'));var config=require(_0xd370('0x7'));var jayson=require(_0xd370('0x8'));var client=jayson[_0xd370('0x9')][_0xd370('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x724498,_0x131a2b,_0x32f52a){return new BPromise(function(_0x262616,_0x4a0a2f){return client[_0xd370('0xb')](_0x724498,_0x32f52a)['then'](function(_0x236afc){logger['info'](_0xd370('0xc'),_0x131a2b,_0xd370('0xd'));logger[_0xd370('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x131a2b,_0xd370('0xd'),JSON[_0xd370('0xf')](_0x236afc));if(_0x236afc['error']){if(_0x236afc['error'][_0xd370('0x10')]===0x1f4){logger[_0xd370('0x11')](_0xd370('0xc'),_0x131a2b,_0x236afc['error']['message']);return _0x4a0a2f(_0x236afc['error'][_0xd370('0x12')]);}logger[_0xd370('0x11')](_0xd370('0xc'),_0x131a2b,_0x236afc['error'][_0xd370('0x12')]);return _0x262616(_0x236afc[_0xd370('0x11')]['message']);}else{logger[_0xd370('0x13')](_0xd370('0xc'),_0x131a2b,'request\x20sent');_0x262616(_0x236afc[_0xd370('0x14')][_0xd370('0x12')]);}})[_0xd370('0x15')](function(_0x4558d7){logger[_0xd370('0x11')](_0xd370('0xc'),_0x131a2b,_0x4558d7);_0x4a0a2f(_0x4558d7);});});}exports[_0xd370('0x16')]=function(_0x2a0e16){var _0x98d0ef=this;return new Promise(function(_0x5bc61b,_0x2d36ca){return db['VtigerAccount'][_0xd370('0x17')]({'raw':_0x2a0e16[_0xd370('0x18')]?_0x2a0e16[_0xd370('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x2a0e16[_0xd370('0x18')]?_0x2a0e16[_0xd370('0x18')][_0xd370('0x19')]||null:null,'attributes':_0x2a0e16[_0xd370('0x18')]?_0x2a0e16[_0xd370('0x18')][_0xd370('0x1a')]||null:null,'limit':_0x2a0e16[_0xd370('0x18')]?_0x2a0e16[_0xd370('0x18')][_0xd370('0x1b')]||null:null,'include':_0x2a0e16['options']?_0x2a0e16[_0xd370('0x18')]['include']?_['map'](_0x2a0e16['options'][_0xd370('0x1c')],function(_0xf7efd1){return{'model':db[_0xf7efd1[_0xd370('0x1d')]],'as':_0xf7efd1['as'],'attributes':_0xf7efd1[_0xd370('0x1a')],'include':_0xf7efd1[_0xd370('0x1c')]?_[_0xd370('0x1e')](_0xf7efd1[_0xd370('0x1c')],function(_0x524e71){return{'model':db[_0x524e71[_0xd370('0x1d')]],'as':_0x524e71['as'],'attributes':_0x524e71[_0xd370('0x1a')],'include':_0x524e71['include']?_[_0xd370('0x1e')](_0x524e71[_0xd370('0x1c')],function(_0x5e62c1){return{'model':db[_0x5e62c1['model']],'as':_0x5e62c1['as'],'attributes':_0x5e62c1[_0xd370('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd370('0x1f')](function(_0x5a5447){logger[_0xd370('0x13')](_0xd370('0x16'),_0x2a0e16);logger[_0xd370('0xe')](_0xd370('0x16'),_0x2a0e16,JSON['stringify'](_0x5a5447));_0x5bc61b(_0x5a5447);})[_0xd370('0x15')](function(_0x240bbe){logger[_0xd370('0x11')](_0xd370('0x16'),_0x240bbe[_0xd370('0x12')],_0x2a0e16);_0x2d36ca(_0x98d0ef[_0xd370('0x11')](0x1f4,_0x240bbe[_0xd370('0x12')]));});});};exports[_0xd370('0x20')]=function(_0x4b635a){var _0x3bc5ca=this;return new Promise(function(_0xf35766,_0x460093){return db[_0xd370('0x21')]['find']({'raw':_0x4b635a['options']?_0x4b635a[_0xd370('0x18')][_0xd370('0x22')]===undefined?!![]:![]:!![],'where':_0x4b635a[_0xd370('0x18')]?_0x4b635a[_0xd370('0x18')][_0xd370('0x19')]||null:null,'attributes':_0x4b635a[_0xd370('0x18')]?_0x4b635a[_0xd370('0x18')]['attributes']||null:null,'include':_0x4b635a['options']?_0x4b635a[_0xd370('0x18')][_0xd370('0x1c')]?_[_0xd370('0x1e')](_0x4b635a[_0xd370('0x18')]['include'],function(_0x278724){return{'model':db[_0x278724[_0xd370('0x1d')]],'as':_0x278724['as'],'attributes':_0x278724['attributes'],'include':_0x278724['include']?_[_0xd370('0x1e')](_0x278724[_0xd370('0x1c')],function(_0x12d503){return{'model':db[_0x12d503[_0xd370('0x1d')]],'as':_0x12d503['as'],'attributes':_0x12d503['attributes'],'include':_0x12d503[_0xd370('0x1c')]?_[_0xd370('0x1e')](_0x12d503[_0xd370('0x1c')],function(_0x561a92){return{'model':db[_0x561a92[_0xd370('0x1d')]],'as':_0x561a92['as'],'attributes':_0x561a92['attributes']};}):[]};}):[]};}):[]:[]})[_0xd370('0x1f')](function(_0x30dbea){logger['info'](_0xd370('0x20'),_0x4b635a);logger[_0xd370('0xe')](_0xd370('0x20'),_0x4b635a,JSON[_0xd370('0xf')](_0x30dbea));_0xf35766(_0x30dbea);})[_0xd370('0x15')](function(_0xe5c55d){logger[_0xd370('0x11')](_0xd370('0x20'),_0xe5c55d[_0xd370('0x12')],_0x4b635a);_0x460093(_0x3bc5ca['error'](0x1f4,_0xe5c55d[_0xd370('0x12')]));});});}; \ No newline at end of file +var _0xf580=['moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','VtigerAccount','findAll','raw','options','where','attributes','limit','map','model','include','GetVtigerAccount','debug','stringify','ShowVtigerAccount','catch','util'];(function(_0x2e195b,_0xe002d1){var _0x33e15f=function(_0x51913d){while(--_0x51913d){_0x2e195b['push'](_0x2e195b['shift']());}};_0x33e15f(++_0xe002d1);}(_0xf580,0xa9));var _0x0f58=function(_0xb09664,_0x49e6f2){_0xb09664=_0xb09664-0x0;var _0x4d4303=_0xf580[_0xb09664];return _0x4d4303;};'use strict';var _=require('lodash');var util=require(_0x0f58('0x0'));var moment=require(_0x0f58('0x1'));var BPromise=require(_0x0f58('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f58('0x3'));var db=require(_0x0f58('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0f58('0x5'));var config=require('../../config/environment');var jayson=require(_0x0f58('0x6'));var client=jayson[_0x0f58('0x7')][_0x0f58('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x206838,_0xaa806f,_0x28e650){return new BPromise(function(_0x3fe2f3,_0x413d87){return client[_0x0f58('0x9')](_0x206838,_0x28e650)[_0x0f58('0xa')](function(_0x2b6e1b){logger[_0x0f58('0xb')](_0x0f58('0xc'),_0xaa806f,_0x0f58('0xd'));logger['debug'](_0x0f58('0xe'),_0xaa806f,_0x0f58('0xd'),JSON['stringify'](_0x2b6e1b));if(_0x2b6e1b[_0x0f58('0xf')]){if(_0x2b6e1b['error'][_0x0f58('0x10')]===0x1f4){logger[_0x0f58('0xf')]('VtigerAccount,\x20%s,\x20%s',_0xaa806f,_0x2b6e1b[_0x0f58('0xf')][_0x0f58('0x11')]);return _0x413d87(_0x2b6e1b[_0x0f58('0xf')]['message']);}logger[_0x0f58('0xf')](_0x0f58('0xc'),_0xaa806f,_0x2b6e1b['error']['message']);return _0x3fe2f3(_0x2b6e1b[_0x0f58('0xf')]['message']);}else{logger[_0x0f58('0xb')](_0x0f58('0xc'),_0xaa806f,_0x0f58('0xd'));_0x3fe2f3(_0x2b6e1b[_0x0f58('0x12')][_0x0f58('0x11')]);}})['catch'](function(_0x2d0c65){logger[_0x0f58('0xf')](_0x0f58('0xc'),_0xaa806f,_0x2d0c65);_0x413d87(_0x2d0c65);});});}exports['GetVtigerAccount']=function(_0x1c6454){var _0x1e2da5=this;return new Promise(function(_0x258aae,_0x40ed0a){return db[_0x0f58('0x13')][_0x0f58('0x14')]({'raw':_0x1c6454['options']?_0x1c6454['options'][_0x0f58('0x15')]===undefined?!![]:![]:!![],'where':_0x1c6454['options']?_0x1c6454[_0x0f58('0x16')][_0x0f58('0x17')]||null:null,'attributes':_0x1c6454[_0x0f58('0x16')]?_0x1c6454[_0x0f58('0x16')][_0x0f58('0x18')]||null:null,'limit':_0x1c6454['options']?_0x1c6454[_0x0f58('0x16')][_0x0f58('0x19')]||null:null,'include':_0x1c6454[_0x0f58('0x16')]?_0x1c6454['options']['include']?_[_0x0f58('0x1a')](_0x1c6454[_0x0f58('0x16')]['include'],function(_0x10d72e){return{'model':db[_0x10d72e[_0x0f58('0x1b')]],'as':_0x10d72e['as'],'attributes':_0x10d72e[_0x0f58('0x18')],'include':_0x10d72e[_0x0f58('0x1c')]?_[_0x0f58('0x1a')](_0x10d72e[_0x0f58('0x1c')],function(_0x174a6c){return{'model':db[_0x174a6c[_0x0f58('0x1b')]],'as':_0x174a6c['as'],'attributes':_0x174a6c[_0x0f58('0x18')],'include':_0x174a6c[_0x0f58('0x1c')]?_['map'](_0x174a6c[_0x0f58('0x1c')],function(_0x16de93){return{'model':db[_0x16de93['model']],'as':_0x16de93['as'],'attributes':_0x16de93[_0x0f58('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0f58('0xa')](function(_0x59d1c3){logger[_0x0f58('0xb')](_0x0f58('0x1d'),_0x1c6454);logger[_0x0f58('0x1e')](_0x0f58('0x1d'),_0x1c6454,JSON[_0x0f58('0x1f')](_0x59d1c3));_0x258aae(_0x59d1c3);})['catch'](function(_0x4d1196){logger[_0x0f58('0xf')](_0x0f58('0x1d'),_0x4d1196[_0x0f58('0x11')],_0x1c6454);_0x40ed0a(_0x1e2da5[_0x0f58('0xf')](0x1f4,_0x4d1196['message']));});});};exports[_0x0f58('0x20')]=function(_0x5aa4c3){var _0x3ed402=this;return new Promise(function(_0x3e1600,_0x3b6fa9){return db['VtigerAccount']['find']({'raw':_0x5aa4c3['options']?_0x5aa4c3[_0x0f58('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5aa4c3['options']?_0x5aa4c3[_0x0f58('0x16')]['where']||null:null,'attributes':_0x5aa4c3[_0x0f58('0x16')]?_0x5aa4c3[_0x0f58('0x16')]['attributes']||null:null,'include':_0x5aa4c3['options']?_0x5aa4c3[_0x0f58('0x16')]['include']?_[_0x0f58('0x1a')](_0x5aa4c3['options'][_0x0f58('0x1c')],function(_0x4224ad){return{'model':db[_0x4224ad[_0x0f58('0x1b')]],'as':_0x4224ad['as'],'attributes':_0x4224ad[_0x0f58('0x18')],'include':_0x4224ad[_0x0f58('0x1c')]?_[_0x0f58('0x1a')](_0x4224ad[_0x0f58('0x1c')],function(_0x7036f7){return{'model':db[_0x7036f7[_0x0f58('0x1b')]],'as':_0x7036f7['as'],'attributes':_0x7036f7[_0x0f58('0x18')],'include':_0x7036f7[_0x0f58('0x1c')]?_[_0x0f58('0x1a')](_0x7036f7[_0x0f58('0x1c')],function(_0x13a07a){return{'model':db[_0x13a07a[_0x0f58('0x1b')]],'as':_0x13a07a['as'],'attributes':_0x13a07a[_0x0f58('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0f58('0xa')](function(_0x3b19e2){logger[_0x0f58('0xb')](_0x0f58('0x20'),_0x5aa4c3);logger[_0x0f58('0x1e')](_0x0f58('0x20'),_0x5aa4c3,JSON[_0x0f58('0x1f')](_0x3b19e2));_0x3e1600(_0x3b19e2);})[_0x0f58('0x21')](function(_0x3c14ef){logger[_0x0f58('0xf')](_0x0f58('0x20'),_0x3c14ef[_0x0f58('0x11')],_0x5aa4c3);_0x3b6fa9(_0x3ed402[_0x0f58('0xf')](0x1f4,_0x3c14ef[_0x0f58('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 46390ef..83663ad 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 _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x131944,_0x3d3e9f){var _0x411bd7=function(_0x77684e){while(--_0x77684e){_0x131944['push'](_0x131944['shift']());}};_0x411bd7(++_0x3d3e9f);}(_0xb10b,0x12a));var _0xbb10=function(_0x5954d2,_0x15db93){_0x5954d2=_0x5954d2-0x0;var _0x316928=_0xb10b[_0x5954d2];return _0x316928;};'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 auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file +var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getDescriptions','post','create'];(function(_0x2a72ce,_0x543624){var _0x18685b=function(_0x421d2a){while(--_0x421d2a){_0x2a72ce['push'](_0x2a72ce['shift']());}};_0x18685b(++_0x543624);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1606f7,_0x41b8da){_0x1606f7=_0x1606f7-0x0;var _0x5e49ab=_0x5f2f[_0x1606f7];return _0x5e49ab;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['getFields']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['getSubjects']);router[_0xf5f2('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0xf')]('/',auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router[_0xf5f2('0x11')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index ae23915..e6860cb 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 _0x0663=['exports','STRING','sequelize'];(function(_0x98e9d5,_0x6b63bd){var _0x575573=function(_0x3b9c92){while(--_0x3b9c92){_0x98e9d5['push'](_0x98e9d5['shift']());}};_0x575573(++_0x6b63bd);}(_0x0663,0x179));var _0x3066=function(_0x4cbda2,_0x29b9bf){_0x4cbda2=_0x4cbda2-0x0;var _0x55a6c1=_0x0663[_0x4cbda2];return _0x55a6c1;};'use strict';var Sequelize=require(_0x3066('0x0'));module[_0x3066('0x1')]={'name':{'type':Sequelize[_0x3066('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5d85=['exports','STRING'];(function(_0x23846f,_0x10a218){var _0x3a5d19=function(_0x4e5144){while(--_0x4e5144){_0x23846f['push'](_0x23846f['shift']());}};_0x3a5d19(++_0x10a218);}(_0x5d85,0x140));var _0x55d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d85[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x55d8('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x55d8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index ea122f2..2c99334 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 _0x7da6=['name','send','index','map','fieldName','query','keys','model','attributes','intersection','fields','hasOwnProperty','offset','order','sort','where','pick','type','VIRTUAL','filter','includeAll','VtigerConfiguration','rows','catch','show','rawAttributes','length','find','create','body','params','destroy','getFields','findOne','VtigerField','filters','merge','options','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','end','status','json','count','limit','set','Content-Range','apply','reject','save','update','then','stack'];(function(_0x5774be,_0x2259d3){var _0x4914b4=function(_0x1eebc3){while(--_0x1eebc3){_0x5774be['push'](_0x5774be['shift']());}};_0x4914b4(++_0x2259d3);}(_0x7da6,0x199));var _0x67da=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0x7da6[_0x28b0a4];return _0x105ce6;};'use strict';var pdf=require(_0x67da('0x0'));var emlformat=require(_0x67da('0x1'));var rimraf=require(_0x67da('0x2'));var zipdir=require(_0x67da('0x3'));var jsonpatch=require(_0x67da('0x4'));var rp=require(_0x67da('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x67da('0x6'));var util=require('util');var path=require(_0x67da('0x7'));var sox=require(_0x67da('0x8'));var csv=require('to-csv');var ejs=require(_0x67da('0x9'));var fs=require('fs');var _=require(_0x67da('0xa'));var squel=require(_0x67da('0xb'));var crypto=require('crypto');var jsforce=require(_0x67da('0xc'));var deskjs=require(_0x67da('0xd'));var toCsv=require('to-csv');var querystring=require(_0x67da('0xe'));var Papa=require('papaparse');var Redis=require(_0x67da('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x67da('0x10'));var as=require(_0x67da('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x67da('0x12'));var utils=require(_0x67da('0x13'));var config=require(_0x67da('0x14'));var db=require(_0x67da('0x15'))['db'];var jayson=require(_0x67da('0x16'));var client=jayson[_0x67da('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x5c31f9,_0x253d30,_0xe6c2a9){if(_0xe6c2a9){var _0x355b95=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x355b95[_0x67da('0x18')](_0x253d30)){return _0x5c31f9;}else{throw new db[(_0x67da('0x19'))][(_0x67da('0x1a'))](_0x67da('0x1b'));}}else{return _0x5c31f9;}}function respondWithRpcPromise(_0x6027dc,_0x2b44d9,_0x54f89e,_0x4cbbf2){return new BPromise(function(_0x30b9d2,_0x59116d){var _0x2b1fd5=_0x4cbbf2||client;return _0x2b1fd5[_0x67da('0x1c')](_0x6027dc,_0x54f89e)['then'](function(_0x29ef2b){logger[_0x67da('0x1d')](_0x67da('0x1e'),_0x2b44d9,_0x67da('0x1f'));logger['debug'](_0x67da('0x20'),_0x2b44d9,_0x67da('0x1f'),JSON[_0x67da('0x21')](_0x29ef2b));if(_0x29ef2b[_0x67da('0x22')]){if(_0x29ef2b[_0x67da('0x22')]['code']===0x1f4){logger[_0x67da('0x22')](_0x67da('0x1e'),_0x2b44d9,_0x29ef2b[_0x67da('0x22')][_0x67da('0x23')]);return _0x59116d(_0x29ef2b[_0x67da('0x22')][_0x67da('0x23')]);}logger[_0x67da('0x22')](_0x67da('0x1e'),_0x2b44d9,_0x29ef2b[_0x67da('0x22')][_0x67da('0x23')]);return _0x30b9d2(_0x29ef2b[_0x67da('0x22')][_0x67da('0x23')]);}else{logger[_0x67da('0x1d')]('VtigerConfiguration,\x20%s,\x20%s',_0x2b44d9,_0x67da('0x1f'));_0x30b9d2(_0x29ef2b[_0x67da('0x24')]['message']);}})['catch'](function(_0x4e2f91){logger['error'](_0x67da('0x1e'),_0x2b44d9,_0x4e2f91);_0x59116d(_0x4e2f91);});});}function respondWithStatusCode(_0x1faf34,_0x13e2fe){_0x13e2fe=_0x13e2fe||0xcc;return function(_0x283d27){if(_0x283d27){return _0x1faf34[_0x67da('0x25')](_0x13e2fe);}return _0x1faf34['status'](_0x13e2fe)[_0x67da('0x26')]();};}function respondWithResult(_0x854ee9,_0x409d52){_0x409d52=_0x409d52||0xc8;return function(_0x38590f){if(_0x38590f){return _0x854ee9[_0x67da('0x27')](_0x409d52)[_0x67da('0x28')](_0x38590f);}};}function respondWithFilteredResult(_0x3d3b9f,_0x277b2a){return function(_0x32da33){if(_0x32da33){var _0x499b00=_0x32da33[_0x67da('0x29')],_0x3ee9cc=_0x277b2a['offset'],_0xd8f9c4=_0x277b2a['offset']+_0x277b2a[_0x67da('0x2a')],_0xb8267e;if(_0xd8f9c4>=_0x499b00){_0xd8f9c4=_0x499b00;_0xb8267e=0xc8;}else{_0xb8267e=0xce;}_0x3d3b9f['status'](_0xb8267e);return _0x3d3b9f[_0x67da('0x2b')](_0x67da('0x2c'),_0x3ee9cc+'-'+_0xd8f9c4+'/'+_0x499b00)[_0x67da('0x28')](_0x32da33);}return null;};}function patchUpdates(_0x1564dc){return function(_0x492b52){try{jsonpatch[_0x67da('0x2d')](_0x492b52,_0x1564dc,!![]);}catch(_0x3ba5d9){return BPromise[_0x67da('0x2e')](_0x3ba5d9);}return _0x492b52[_0x67da('0x2f')]();};}function saveUpdates(_0x94ebaf,_0x4c2ae1){return function(_0x46b02c){if(_0x46b02c){return _0x46b02c[_0x67da('0x30')](_0x94ebaf)['then'](function(_0x3bc933){return _0x3bc933;});}return null;};}function removeEntity(_0x138625,_0x518c0f){return function(_0x2e865e){if(_0x2e865e){return _0x2e865e['destroy']()[_0x67da('0x31')](function(){_0x138625[_0x67da('0x27')](0xcc)[_0x67da('0x26')]();});}};}function handleEntityNotFound(_0x3cd73f,_0x5bff39){return function(_0x65bac1){if(!_0x65bac1){_0x3cd73f[_0x67da('0x25')](0x194);}return _0x65bac1;};}function handleError(_0x13a3c0,_0x4fad6a){_0x4fad6a=_0x4fad6a||0x1f4;return function(_0x394d9e){logger[_0x67da('0x22')](_0x394d9e[_0x67da('0x32')]);if(_0x394d9e[_0x67da('0x33')]){delete _0x394d9e[_0x67da('0x33')];}_0x13a3c0[_0x67da('0x27')](_0x4fad6a)[_0x67da('0x34')](_0x394d9e);};}exports[_0x67da('0x35')]=function(_0x2ea42f,_0x378e5e){var _0x4e9dba={},_0x4b3777={},_0x3ac7f7={'count':0x0,'rows':[]};var _0xae4cb0=_[_0x67da('0x36')](db['VtigerConfiguration']['rawAttributes'],function(_0x128d9c){return{'name':_0x128d9c[_0x67da('0x37')],'type':_0x128d9c['type']['key']};});_0x4b3777['model']=_[_0x67da('0x36')](_0xae4cb0,'name');_0x4b3777[_0x67da('0x38')]=_[_0x67da('0x39')](_0x2ea42f[_0x67da('0x38')]);_0x4b3777['filters']=_['intersection'](_0x4b3777[_0x67da('0x3a')],_0x4b3777[_0x67da('0x38')]);_0x4e9dba[_0x67da('0x3b')]=_[_0x67da('0x3c')](_0x4b3777[_0x67da('0x3a')],qs[_0x67da('0x3d')](_0x2ea42f[_0x67da('0x38')][_0x67da('0x3d')]));_0x4e9dba[_0x67da('0x3b')]=_0x4e9dba[_0x67da('0x3b')]['length']?_0x4e9dba[_0x67da('0x3b')]:_0x4b3777[_0x67da('0x3a')];if(!_0x2ea42f['query'][_0x67da('0x3e')]('nolimit')){_0x4e9dba['limit']=qs[_0x67da('0x2a')](_0x2ea42f[_0x67da('0x38')]['limit']);_0x4e9dba['offset']=qs['offset'](_0x2ea42f[_0x67da('0x38')][_0x67da('0x3f')]);}_0x4e9dba[_0x67da('0x40')]=qs[_0x67da('0x41')](_0x2ea42f[_0x67da('0x38')][_0x67da('0x41')]);_0x4e9dba[_0x67da('0x42')]=qs['filters'](_[_0x67da('0x43')](_0x2ea42f[_0x67da('0x38')],_0x4b3777['filters']),_0xae4cb0);if(_0x2ea42f[_0x67da('0x38')]['filter']){_0x4e9dba[_0x67da('0x42')]=_['merge'](_0x4e9dba[_0x67da('0x42')],{'$or':_[_0x67da('0x36')](_0xae4cb0,function(_0x4e09ce){if(_0x4e09ce[_0x67da('0x44')]!==_0x67da('0x45')){var _0x24ceda={};_0x24ceda[_0x4e09ce[_0x67da('0x33')]]={'$like':'%'+_0x2ea42f[_0x67da('0x38')][_0x67da('0x46')]+'%'};return _0x24ceda;}})});}_0x4e9dba=_['merge']({},_0x4e9dba,_0x2ea42f['options']);var _0x53efc5={'where':_0x4e9dba['where']};return db['VtigerConfiguration'][_0x67da('0x29')](_0x53efc5)[_0x67da('0x31')](function(_0x323bcb){_0x3ac7f7[_0x67da('0x29')]=_0x323bcb;if(_0x2ea42f['query'][_0x67da('0x47')]){_0x4e9dba['include']=[{'all':!![]}];}return db[_0x67da('0x48')]['findAll'](_0x4e9dba);})[_0x67da('0x31')](function(_0x5572a7){_0x3ac7f7[_0x67da('0x49')]=_0x5572a7;return _0x3ac7f7;})[_0x67da('0x31')](respondWithFilteredResult(_0x378e5e,_0x4e9dba))[_0x67da('0x4a')](handleError(_0x378e5e,null));};exports[_0x67da('0x4b')]=function(_0xd9f964,_0x2425d3){var _0x30ee1d={'raw':![],'where':{'id':_0xd9f964['params']['id']}},_0xd939f7={};_0xd939f7[_0x67da('0x3a')]=_['keys'](db[_0x67da('0x48')][_0x67da('0x4c')]);_0xd939f7['query']=_[_0x67da('0x39')](_0xd9f964[_0x67da('0x38')]);_0xd939f7['filters']=_[_0x67da('0x3c')](_0xd939f7[_0x67da('0x3a')],_0xd939f7[_0x67da('0x38')]);_0x30ee1d[_0x67da('0x3b')]=_['intersection'](_0xd939f7['model'],qs['fields'](_0xd9f964[_0x67da('0x38')]['fields']));_0x30ee1d['attributes']=_0x30ee1d['attributes'][_0x67da('0x4d')]?_0x30ee1d['attributes']:_0xd939f7[_0x67da('0x3a')];if(_0xd9f964[_0x67da('0x38')]['includeAll']){_0x30ee1d['include']=[{'all':!![]}];}_0x30ee1d=_['merge']({},_0x30ee1d,_0xd9f964['options']);return db['VtigerConfiguration'][_0x67da('0x4e')](_0x30ee1d)[_0x67da('0x31')](handleEntityNotFound(_0x2425d3,null))[_0x67da('0x31')](respondWithResult(_0x2425d3,null))[_0x67da('0x4a')](handleError(_0x2425d3,null));};exports[_0x67da('0x4f')]=function(_0x3f9c67,_0x1898a6){return db[_0x67da('0x48')][_0x67da('0x4f')](_0x3f9c67[_0x67da('0x50')],{})[_0x67da('0x31')](respondWithResult(_0x1898a6,0xc9))['catch'](handleError(_0x1898a6,null));};exports[_0x67da('0x30')]=function(_0x2c43ef,_0x2708e6){if(_0x2c43ef[_0x67da('0x50')]['id']){delete _0x2c43ef[_0x67da('0x50')]['id'];}return db[_0x67da('0x48')][_0x67da('0x4e')]({'where':{'id':_0x2c43ef[_0x67da('0x51')]['id']}})[_0x67da('0x31')](handleEntityNotFound(_0x2708e6,null))[_0x67da('0x31')](saveUpdates(_0x2c43ef[_0x67da('0x50')],null))['then'](respondWithResult(_0x2708e6,null))[_0x67da('0x4a')](handleError(_0x2708e6,null));};exports[_0x67da('0x52')]=function(_0x583545,_0x3e4246){return db[_0x67da('0x48')][_0x67da('0x4e')]({'where':{'id':_0x583545[_0x67da('0x51')]['id']}})[_0x67da('0x31')](handleEntityNotFound(_0x3e4246,null))[_0x67da('0x31')](removeEntity(_0x3e4246,null))[_0x67da('0x4a')](handleError(_0x3e4246,null));};exports[_0x67da('0x53')]=function(_0x4cd6c4,_0x3fa1eb,_0x30cc60){var _0x11dd06={};var _0x19ac61={};var _0x3693f1;var _0xd49f45;return db[_0x67da('0x48')][_0x67da('0x54')]({'where':{'id':_0x4cd6c4[_0x67da('0x51')]['id']}})[_0x67da('0x31')](handleEntityNotFound(_0x3fa1eb,null))[_0x67da('0x31')](function(_0x507357){if(_0x507357){_0x3693f1=_0x507357;_0x19ac61[_0x67da('0x3a')]=_['keys'](db[_0x67da('0x55')]['rawAttributes']);_0x19ac61[_0x67da('0x38')]=_[_0x67da('0x39')](_0x4cd6c4[_0x67da('0x38')]);_0x19ac61['filters']=_[_0x67da('0x3c')](_0x19ac61['model'],_0x19ac61[_0x67da('0x38')]);_0x11dd06[_0x67da('0x3b')]=_[_0x67da('0x3c')](_0x19ac61['model'],qs[_0x67da('0x3d')](_0x4cd6c4[_0x67da('0x38')][_0x67da('0x3d')]));_0x11dd06['attributes']=_0x11dd06['attributes']['length']?_0x11dd06[_0x67da('0x3b')]:_0x19ac61[_0x67da('0x3a')];_0x11dd06[_0x67da('0x40')]=qs[_0x67da('0x41')](_0x4cd6c4[_0x67da('0x38')][_0x67da('0x41')]);_0x11dd06['where']=qs[_0x67da('0x56')](_['pick'](_0x4cd6c4[_0x67da('0x38')],_0x19ac61[_0x67da('0x56')]));if(_0x4cd6c4[_0x67da('0x38')][_0x67da('0x46')]){_0x11dd06['where']=_[_0x67da('0x57')](_0x11dd06[_0x67da('0x42')],{'$or':_[_0x67da('0x36')](_0x11dd06['attributes'],function(_0x487129){var _0x14b667={};_0x14b667[_0x487129]={'$like':'%'+_0x4cd6c4[_0x67da('0x38')][_0x67da('0x46')]+'%'};return _0x14b667;})});}_0x11dd06=_[_0x67da('0x57')]({},_0x11dd06,_0x4cd6c4[_0x67da('0x58')]);return _0x3693f1[_0x67da('0x53')](_0x11dd06);}})[_0x67da('0x31')](function(_0x47f87e){if(_0x47f87e){_0xd49f45=_0x47f87e[_0x67da('0x4d')];if(!_0x4cd6c4[_0x67da('0x38')][_0x67da('0x3e')](_0x67da('0x59'))){_0x11dd06[_0x67da('0x2a')]=qs['limit'](_0x4cd6c4[_0x67da('0x38')]['limit']);_0x11dd06[_0x67da('0x3f')]=qs[_0x67da('0x3f')](_0x4cd6c4[_0x67da('0x38')][_0x67da('0x3f')]);}return _0x3693f1[_0x67da('0x53')](_0x11dd06);}})[_0x67da('0x31')](function(_0xc62cb3){if(_0xc62cb3){return _0xc62cb3?{'count':_0xd49f45,'rows':_0xc62cb3}:null;}})[_0x67da('0x31')](respondWithResult(_0x3fa1eb,null))[_0x67da('0x4a')](handleError(_0x3fa1eb,null));};exports[_0x67da('0x5a')]=function(_0x4038de,_0x58a949,_0x2540fb){var _0x4a1a36={};var _0x18fa14={};var _0xa1a32b;var _0x4c92ae;return db[_0x67da('0x48')][_0x67da('0x54')]({'where':{'id':_0x4038de[_0x67da('0x51')]['id']}})['then'](handleEntityNotFound(_0x58a949,null))[_0x67da('0x31')](function(_0x13a46f){if(_0x13a46f){_0xa1a32b=_0x13a46f;_0x18fa14[_0x67da('0x3a')]=_[_0x67da('0x39')](db['VtigerField'][_0x67da('0x4c')]);_0x18fa14[_0x67da('0x38')]=_['keys'](_0x4038de[_0x67da('0x38')]);_0x18fa14['filters']=_[_0x67da('0x3c')](_0x18fa14[_0x67da('0x3a')],_0x18fa14['query']);_0x4a1a36['attributes']=_[_0x67da('0x3c')](_0x18fa14[_0x67da('0x3a')],qs['fields'](_0x4038de['query']['fields']));_0x4a1a36[_0x67da('0x3b')]=_0x4a1a36[_0x67da('0x3b')][_0x67da('0x4d')]?_0x4a1a36['attributes']:_0x18fa14[_0x67da('0x3a')];_0x4a1a36[_0x67da('0x40')]=qs[_0x67da('0x41')](_0x4038de[_0x67da('0x38')][_0x67da('0x41')]);_0x4a1a36['where']=qs['filters'](_[_0x67da('0x43')](_0x4038de[_0x67da('0x38')],_0x18fa14[_0x67da('0x56')]));if(_0x4038de[_0x67da('0x38')][_0x67da('0x46')]){_0x4a1a36['where']=_['merge'](_0x4a1a36['where'],{'$or':_[_0x67da('0x36')](_0x4a1a36['attributes'],function(_0x5150c5){var _0xe8673b={};_0xe8673b[_0x5150c5]={'$like':'%'+_0x4038de[_0x67da('0x38')][_0x67da('0x46')]+'%'};return _0xe8673b;})});}_0x4a1a36=_[_0x67da('0x57')]({},_0x4a1a36,_0x4038de['options']);return _0xa1a32b[_0x67da('0x5a')](_0x4a1a36);}})[_0x67da('0x31')](function(_0x58eb63){if(_0x58eb63){_0x4c92ae=_0x58eb63[_0x67da('0x4d')];if(!_0x4038de['query'][_0x67da('0x3e')]('nolimit')){_0x4a1a36['limit']=qs[_0x67da('0x2a')](_0x4038de[_0x67da('0x38')][_0x67da('0x2a')]);_0x4a1a36['offset']=qs['offset'](_0x4038de['query']['offset']);}return _0xa1a32b[_0x67da('0x5a')](_0x4a1a36);}})[_0x67da('0x31')](function(_0x24e551){if(_0x24e551){return _0x24e551?{'count':_0x4c92ae,'rows':_0x24e551}:null;}})['then'](respondWithResult(_0x58a949,null))[_0x67da('0x4a')](handleError(_0x58a949,null));};exports[_0x67da('0x5b')]=function(_0x1b920e,_0x386c3,_0x4ba5be){var _0x59f486={};var _0x51d389={};var _0x3d0cf8;var _0x4beb0a;return db[_0x67da('0x48')]['findOne']({'where':{'id':_0x1b920e['params']['id']}})['then'](handleEntityNotFound(_0x386c3,null))[_0x67da('0x31')](function(_0x109cb4){if(_0x109cb4){_0x3d0cf8=_0x109cb4;_0x51d389[_0x67da('0x3a')]=_['keys'](db['VtigerField'][_0x67da('0x4c')]);_0x51d389[_0x67da('0x38')]=_[_0x67da('0x39')](_0x1b920e[_0x67da('0x38')]);_0x51d389['filters']=_[_0x67da('0x3c')](_0x51d389[_0x67da('0x3a')],_0x51d389[_0x67da('0x38')]);_0x59f486[_0x67da('0x3b')]=_[_0x67da('0x3c')](_0x51d389[_0x67da('0x3a')],qs[_0x67da('0x3d')](_0x1b920e[_0x67da('0x38')][_0x67da('0x3d')]));_0x59f486[_0x67da('0x3b')]=_0x59f486[_0x67da('0x3b')][_0x67da('0x4d')]?_0x59f486[_0x67da('0x3b')]:_0x51d389['model'];_0x59f486[_0x67da('0x40')]=qs[_0x67da('0x41')](_0x1b920e[_0x67da('0x38')]['sort']);_0x59f486[_0x67da('0x42')]=qs['filters'](_[_0x67da('0x43')](_0x1b920e['query'],_0x51d389['filters']));if(_0x1b920e[_0x67da('0x38')]['filter']){_0x59f486[_0x67da('0x42')]=_[_0x67da('0x57')](_0x59f486[_0x67da('0x42')],{'$or':_[_0x67da('0x36')](_0x59f486[_0x67da('0x3b')],function(_0x2ab01d){var _0x341b38={};_0x341b38[_0x2ab01d]={'$like':'%'+_0x1b920e[_0x67da('0x38')][_0x67da('0x46')]+'%'};return _0x341b38;})});}_0x59f486=_[_0x67da('0x57')]({},_0x59f486,_0x1b920e['options']);return _0x3d0cf8[_0x67da('0x5b')](_0x59f486);}})[_0x67da('0x31')](function(_0x3daaaf){if(_0x3daaaf){_0x4beb0a=_0x3daaaf[_0x67da('0x4d')];if(!_0x1b920e[_0x67da('0x38')]['hasOwnProperty'](_0x67da('0x59'))){_0x59f486[_0x67da('0x2a')]=qs[_0x67da('0x2a')](_0x1b920e[_0x67da('0x38')][_0x67da('0x2a')]);_0x59f486[_0x67da('0x3f')]=qs[_0x67da('0x3f')](_0x1b920e[_0x67da('0x38')][_0x67da('0x3f')]);}return _0x3d0cf8['getDescriptions'](_0x59f486);}})[_0x67da('0x31')](function(_0x14fb7f){if(_0x14fb7f){return _0x14fb7f?{'count':_0x4beb0a,'rows':_0x14fb7f}:null;}})[_0x67da('0x31')](respondWithResult(_0x386c3,null))[_0x67da('0x4a')](handleError(_0x386c3,null));}; \ No newline at end of file +var _0xe06f=['request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','filter','merge','VtigerConfiguration','includeAll','include','findAll','rows','length','options','find','create','body','params','destroy','getFields','VtigerField','order','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info'];(function(_0x1de66b,_0x50b768){var _0x54b2c8=function(_0x14ab7b){while(--_0x14ab7b){_0x1de66b['push'](_0x1de66b['shift']());}};_0x54b2c8(++_0x50b768);}(_0xe06f,0x104));var _0xfe06=function(_0x246132,_0x2941a0){_0x246132=_0x246132-0x0;var _0x3fe578=_0xe06f[_0x246132];return _0x3fe578;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfe06('0x0'));var rimraf=require(_0xfe06('0x1'));var zipdir=require(_0xfe06('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfe06('0x3'));var Mustache=require(_0xfe06('0x4'));var util=require(_0xfe06('0x5'));var path=require(_0xfe06('0x6'));var sox=require(_0xfe06('0x7'));var csv=require(_0xfe06('0x8'));var ejs=require(_0xfe06('0x9'));var fs=require('fs');var _=require(_0xfe06('0xa'));var squel=require(_0xfe06('0xb'));var crypto=require(_0xfe06('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfe06('0xd'));var toCsv=require('to-csv');var querystring=require(_0xfe06('0xe'));var Papa=require(_0xfe06('0xf'));var Redis=require(_0xfe06('0x10'));var authService=require(_0xfe06('0x11'));var qs=require(_0xfe06('0x12'));var as=require(_0xfe06('0x13'));var hardwareService=require(_0xfe06('0x14'));var logger=require('../../config/logger')(_0xfe06('0x15'));var utils=require(_0xfe06('0x16'));var config=require(_0xfe06('0x17'));var db=require(_0xfe06('0x18'))['db'];var jayson=require(_0xfe06('0x19'));var client=jayson['client'][_0xfe06('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x51aabd,_0x4068da,_0x4cb59e){if(_0x4cb59e){var _0x33c852=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33c852[_0xfe06('0x1b')](_0x4068da)){return _0x51aabd;}else{throw new db[(_0xfe06('0x1c'))][(_0xfe06('0x1d'))](_0xfe06('0x1e'));}}else{return _0x51aabd;}}function respondWithRpcPromise(_0x386718,_0x16f1bb,_0x34e305,_0x457a72){return new BPromise(function(_0x2cac65,_0x31a51d){var _0x3288b4=_0x457a72||client;return _0x3288b4[_0xfe06('0x1f')](_0x386718,_0x34e305)[_0xfe06('0x20')](function(_0x586000){logger[_0xfe06('0x21')]('VtigerConfiguration,\x20%s,\x20%s',_0x16f1bb,_0xfe06('0x22'));logger[_0xfe06('0x23')](_0xfe06('0x24'),_0x16f1bb,_0xfe06('0x22'),JSON[_0xfe06('0x25')](_0x586000));if(_0x586000['error']){if(_0x586000[_0xfe06('0x26')][_0xfe06('0x27')]===0x1f4){logger[_0xfe06('0x26')](_0xfe06('0x28'),_0x16f1bb,_0x586000[_0xfe06('0x26')][_0xfe06('0x29')]);return _0x31a51d(_0x586000[_0xfe06('0x26')][_0xfe06('0x29')]);}logger[_0xfe06('0x26')](_0xfe06('0x28'),_0x16f1bb,_0x586000['error']['message']);return _0x2cac65(_0x586000[_0xfe06('0x26')][_0xfe06('0x29')]);}else{logger['info'](_0xfe06('0x28'),_0x16f1bb,'request\x20sent');_0x2cac65(_0x586000[_0xfe06('0x2a')]['message']);}})[_0xfe06('0x2b')](function(_0x44e7bf){logger[_0xfe06('0x26')]('VtigerConfiguration,\x20%s,\x20%s',_0x16f1bb,_0x44e7bf);_0x31a51d(_0x44e7bf);});});}function respondWithStatusCode(_0xd4d5b9,_0x29ee28){_0x29ee28=_0x29ee28||0xcc;return function(_0x5aa372){if(_0x5aa372){return _0xd4d5b9[_0xfe06('0x2c')](_0x29ee28);}return _0xd4d5b9[_0xfe06('0x2d')](_0x29ee28)[_0xfe06('0x2e')]();};}function respondWithResult(_0x5654dc,_0x2399c0){_0x2399c0=_0x2399c0||0xc8;return function(_0x1fc1c8){if(_0x1fc1c8){return _0x5654dc[_0xfe06('0x2d')](_0x2399c0)[_0xfe06('0x2f')](_0x1fc1c8);}};}function respondWithFilteredResult(_0x5b69e0,_0x441cc3){return function(_0x1e7f88){if(_0x1e7f88){var _0x355f86=_0x1e7f88[_0xfe06('0x30')],_0x26ef14=_0x441cc3[_0xfe06('0x31')],_0x40a91e=_0x441cc3['offset']+_0x441cc3['limit'],_0x2ff54a;if(_0x40a91e>=_0x355f86){_0x40a91e=_0x355f86;_0x2ff54a=0xc8;}else{_0x2ff54a=0xce;}_0x5b69e0[_0xfe06('0x2d')](_0x2ff54a);return _0x5b69e0[_0xfe06('0x32')](_0xfe06('0x33'),_0x26ef14+'-'+_0x40a91e+'/'+_0x355f86)[_0xfe06('0x2f')](_0x1e7f88);}return null;};}function patchUpdates(_0x5eb067){return function(_0x4faf58){try{jsonpatch[_0xfe06('0x34')](_0x4faf58,_0x5eb067,!![]);}catch(_0x24d84c){return BPromise[_0xfe06('0x35')](_0x24d84c);}return _0x4faf58[_0xfe06('0x36')]();};}function saveUpdates(_0x1aa921,_0x3cb3a4){return function(_0x20e1c9){if(_0x20e1c9){return _0x20e1c9[_0xfe06('0x37')](_0x1aa921)[_0xfe06('0x20')](function(_0x40d785){return _0x40d785;});}return null;};}function removeEntity(_0x18c964,_0x582d0e){return function(_0xa587be){if(_0xa587be){return _0xa587be['destroy']()[_0xfe06('0x20')](function(){_0x18c964[_0xfe06('0x2d')](0xcc)[_0xfe06('0x2e')]();});}};}function handleEntityNotFound(_0xbabfb8,_0xb817a3){return function(_0x319d11){if(!_0x319d11){_0xbabfb8[_0xfe06('0x2c')](0x194);}return _0x319d11;};}function handleError(_0xb522d,_0x502fba){_0x502fba=_0x502fba||0x1f4;return function(_0x1d3c3a){logger[_0xfe06('0x26')](_0x1d3c3a[_0xfe06('0x38')]);if(_0x1d3c3a['name']){delete _0x1d3c3a[_0xfe06('0x39')];}_0xb522d['status'](_0x502fba)['send'](_0x1d3c3a);};}exports[_0xfe06('0x3a')]=function(_0x45bb03,_0x19e2ff){var _0x2fc2b3={},_0xeffe2a={},_0x45e7fb={'count':0x0,'rows':[]};var _0x52799b=_[_0xfe06('0x3b')](db['VtigerConfiguration'][_0xfe06('0x3c')],function(_0x271155){return{'name':_0x271155[_0xfe06('0x3d')],'type':_0x271155[_0xfe06('0x3e')][_0xfe06('0x3f')]};});_0xeffe2a['model']=_[_0xfe06('0x3b')](_0x52799b,_0xfe06('0x39'));_0xeffe2a[_0xfe06('0x40')]=_[_0xfe06('0x41')](_0x45bb03['query']);_0xeffe2a[_0xfe06('0x42')]=_[_0xfe06('0x43')](_0xeffe2a[_0xfe06('0x44')],_0xeffe2a[_0xfe06('0x40')]);_0x2fc2b3[_0xfe06('0x45')]=_[_0xfe06('0x43')](_0xeffe2a[_0xfe06('0x44')],qs['fields'](_0x45bb03[_0xfe06('0x40')][_0xfe06('0x46')]));_0x2fc2b3[_0xfe06('0x45')]=_0x2fc2b3[_0xfe06('0x45')]['length']?_0x2fc2b3[_0xfe06('0x45')]:_0xeffe2a[_0xfe06('0x44')];if(!_0x45bb03[_0xfe06('0x40')][_0xfe06('0x47')](_0xfe06('0x48'))){_0x2fc2b3[_0xfe06('0x49')]=qs[_0xfe06('0x49')](_0x45bb03[_0xfe06('0x40')][_0xfe06('0x49')]);_0x2fc2b3['offset']=qs[_0xfe06('0x31')](_0x45bb03['query'][_0xfe06('0x31')]);}_0x2fc2b3['order']=qs[_0xfe06('0x4a')](_0x45bb03[_0xfe06('0x40')][_0xfe06('0x4a')]);_0x2fc2b3[_0xfe06('0x4b')]=qs['filters'](_[_0xfe06('0x4c')](_0x45bb03[_0xfe06('0x40')],_0xeffe2a[_0xfe06('0x42')]),_0x52799b);if(_0x45bb03['query']['filter']){_0x2fc2b3[_0xfe06('0x4b')]=_['merge'](_0x2fc2b3[_0xfe06('0x4b')],{'$or':_[_0xfe06('0x3b')](_0x52799b,function(_0x12dd85){if(_0x12dd85[_0xfe06('0x3e')]!==_0xfe06('0x4d')){var _0x1f3d27={};_0x1f3d27[_0x12dd85[_0xfe06('0x39')]]={'$like':'%'+_0x45bb03[_0xfe06('0x40')][_0xfe06('0x4e')]+'%'};return _0x1f3d27;}})});}_0x2fc2b3=_[_0xfe06('0x4f')]({},_0x2fc2b3,_0x45bb03['options']);var _0x341991={'where':_0x2fc2b3['where']};return db[_0xfe06('0x50')][_0xfe06('0x30')](_0x341991)['then'](function(_0x2855f1){_0x45e7fb[_0xfe06('0x30')]=_0x2855f1;if(_0x45bb03[_0xfe06('0x40')][_0xfe06('0x51')]){_0x2fc2b3[_0xfe06('0x52')]=[{'all':!![]}];}return db[_0xfe06('0x50')][_0xfe06('0x53')](_0x2fc2b3);})[_0xfe06('0x20')](function(_0x5009e0){_0x45e7fb[_0xfe06('0x54')]=_0x5009e0;return _0x45e7fb;})[_0xfe06('0x20')](respondWithFilteredResult(_0x19e2ff,_0x2fc2b3))[_0xfe06('0x2b')](handleError(_0x19e2ff,null));};exports['show']=function(_0x35890c,_0x9ed7c8){var _0x2741ab={'raw':![],'where':{'id':_0x35890c['params']['id']}},_0x26428c={};_0x26428c['model']=_[_0xfe06('0x41')](db[_0xfe06('0x50')][_0xfe06('0x3c')]);_0x26428c['query']=_[_0xfe06('0x41')](_0x35890c[_0xfe06('0x40')]);_0x26428c[_0xfe06('0x42')]=_[_0xfe06('0x43')](_0x26428c['model'],_0x26428c[_0xfe06('0x40')]);_0x2741ab['attributes']=_[_0xfe06('0x43')](_0x26428c[_0xfe06('0x44')],qs[_0xfe06('0x46')](_0x35890c['query']['fields']));_0x2741ab[_0xfe06('0x45')]=_0x2741ab[_0xfe06('0x45')][_0xfe06('0x55')]?_0x2741ab['attributes']:_0x26428c[_0xfe06('0x44')];if(_0x35890c[_0xfe06('0x40')][_0xfe06('0x51')]){_0x2741ab['include']=[{'all':!![]}];}_0x2741ab=_['merge']({},_0x2741ab,_0x35890c[_0xfe06('0x56')]);return db[_0xfe06('0x50')][_0xfe06('0x57')](_0x2741ab)[_0xfe06('0x20')](handleEntityNotFound(_0x9ed7c8,null))[_0xfe06('0x20')](respondWithResult(_0x9ed7c8,null))[_0xfe06('0x2b')](handleError(_0x9ed7c8,null));};exports[_0xfe06('0x58')]=function(_0x8035f7,_0x541d7c){return db[_0xfe06('0x50')]['create'](_0x8035f7[_0xfe06('0x59')],{})[_0xfe06('0x20')](respondWithResult(_0x541d7c,0xc9))[_0xfe06('0x2b')](handleError(_0x541d7c,null));};exports[_0xfe06('0x37')]=function(_0x1ce04c,_0x1eae76){if(_0x1ce04c[_0xfe06('0x59')]['id']){delete _0x1ce04c[_0xfe06('0x59')]['id'];}return db[_0xfe06('0x50')][_0xfe06('0x57')]({'where':{'id':_0x1ce04c[_0xfe06('0x5a')]['id']}})[_0xfe06('0x20')](handleEntityNotFound(_0x1eae76,null))[_0xfe06('0x20')](saveUpdates(_0x1ce04c['body'],null))[_0xfe06('0x20')](respondWithResult(_0x1eae76,null))['catch'](handleError(_0x1eae76,null));};exports[_0xfe06('0x5b')]=function(_0x35d5e9,_0xe0e015){return db[_0xfe06('0x50')]['find']({'where':{'id':_0x35d5e9['params']['id']}})[_0xfe06('0x20')](handleEntityNotFound(_0xe0e015,null))[_0xfe06('0x20')](removeEntity(_0xe0e015,null))[_0xfe06('0x2b')](handleError(_0xe0e015,null));};exports[_0xfe06('0x5c')]=function(_0x2e097a,_0x324785,_0x3bbed4){var _0x589092={};var _0x5b3ac0={};var _0xa4e6dc;var _0x548f6d;return db[_0xfe06('0x50')]['findOne']({'where':{'id':_0x2e097a[_0xfe06('0x5a')]['id']}})[_0xfe06('0x20')](handleEntityNotFound(_0x324785,null))[_0xfe06('0x20')](function(_0x394924){if(_0x394924){_0xa4e6dc=_0x394924;_0x5b3ac0[_0xfe06('0x44')]=_['keys'](db[_0xfe06('0x5d')][_0xfe06('0x3c')]);_0x5b3ac0['query']=_[_0xfe06('0x41')](_0x2e097a[_0xfe06('0x40')]);_0x5b3ac0[_0xfe06('0x42')]=_[_0xfe06('0x43')](_0x5b3ac0[_0xfe06('0x44')],_0x5b3ac0[_0xfe06('0x40')]);_0x589092[_0xfe06('0x45')]=_[_0xfe06('0x43')](_0x5b3ac0[_0xfe06('0x44')],qs[_0xfe06('0x46')](_0x2e097a[_0xfe06('0x40')][_0xfe06('0x46')]));_0x589092['attributes']=_0x589092['attributes'][_0xfe06('0x55')]?_0x589092[_0xfe06('0x45')]:_0x5b3ac0[_0xfe06('0x44')];_0x589092[_0xfe06('0x5e')]=qs[_0xfe06('0x4a')](_0x2e097a[_0xfe06('0x40')][_0xfe06('0x4a')]);_0x589092[_0xfe06('0x4b')]=qs[_0xfe06('0x42')](_['pick'](_0x2e097a[_0xfe06('0x40')],_0x5b3ac0['filters']));if(_0x2e097a['query']['filter']){_0x589092['where']=_[_0xfe06('0x4f')](_0x589092[_0xfe06('0x4b')],{'$or':_[_0xfe06('0x3b')](_0x589092[_0xfe06('0x45')],function(_0x5a2b1e){var _0x19ed3d={};_0x19ed3d[_0x5a2b1e]={'$like':'%'+_0x2e097a[_0xfe06('0x40')]['filter']+'%'};return _0x19ed3d;})});}_0x589092=_['merge']({},_0x589092,_0x2e097a[_0xfe06('0x56')]);return _0xa4e6dc[_0xfe06('0x5c')](_0x589092);}})[_0xfe06('0x20')](function(_0x5edceb){if(_0x5edceb){_0x548f6d=_0x5edceb['length'];if(!_0x2e097a['query']['hasOwnProperty']('nolimit')){_0x589092[_0xfe06('0x49')]=qs['limit'](_0x2e097a[_0xfe06('0x40')][_0xfe06('0x49')]);_0x589092[_0xfe06('0x31')]=qs[_0xfe06('0x31')](_0x2e097a[_0xfe06('0x40')][_0xfe06('0x31')]);}return _0xa4e6dc[_0xfe06('0x5c')](_0x589092);}})[_0xfe06('0x20')](function(_0x33aea4){if(_0x33aea4){return _0x33aea4?{'count':_0x548f6d,'rows':_0x33aea4}:null;}})[_0xfe06('0x20')](respondWithResult(_0x324785,null))[_0xfe06('0x2b')](handleError(_0x324785,null));};exports['getSubjects']=function(_0x3dc129,_0x2a4495,_0x568b5b){var _0x532ca8={};var _0x15f5b4={};var _0x1631ec;var _0x1182dc;return db[_0xfe06('0x50')][_0xfe06('0x5f')]({'where':{'id':_0x3dc129[_0xfe06('0x5a')]['id']}})[_0xfe06('0x20')](handleEntityNotFound(_0x2a4495,null))[_0xfe06('0x20')](function(_0x5a734c){if(_0x5a734c){_0x1631ec=_0x5a734c;_0x15f5b4[_0xfe06('0x44')]=_['keys'](db[_0xfe06('0x5d')][_0xfe06('0x3c')]);_0x15f5b4[_0xfe06('0x40')]=_[_0xfe06('0x41')](_0x3dc129[_0xfe06('0x40')]);_0x15f5b4[_0xfe06('0x42')]=_[_0xfe06('0x43')](_0x15f5b4['model'],_0x15f5b4['query']);_0x532ca8[_0xfe06('0x45')]=_['intersection'](_0x15f5b4[_0xfe06('0x44')],qs['fields'](_0x3dc129[_0xfe06('0x40')][_0xfe06('0x46')]));_0x532ca8[_0xfe06('0x45')]=_0x532ca8['attributes'][_0xfe06('0x55')]?_0x532ca8[_0xfe06('0x45')]:_0x15f5b4[_0xfe06('0x44')];_0x532ca8[_0xfe06('0x5e')]=qs[_0xfe06('0x4a')](_0x3dc129[_0xfe06('0x40')][_0xfe06('0x4a')]);_0x532ca8[_0xfe06('0x4b')]=qs[_0xfe06('0x42')](_['pick'](_0x3dc129[_0xfe06('0x40')],_0x15f5b4[_0xfe06('0x42')]));if(_0x3dc129[_0xfe06('0x40')][_0xfe06('0x4e')]){_0x532ca8[_0xfe06('0x4b')]=_[_0xfe06('0x4f')](_0x532ca8[_0xfe06('0x4b')],{'$or':_[_0xfe06('0x3b')](_0x532ca8[_0xfe06('0x45')],function(_0x1dc538){var _0x4a4ed1={};_0x4a4ed1[_0x1dc538]={'$like':'%'+_0x3dc129[_0xfe06('0x40')]['filter']+'%'};return _0x4a4ed1;})});}_0x532ca8=_[_0xfe06('0x4f')]({},_0x532ca8,_0x3dc129[_0xfe06('0x56')]);return _0x1631ec[_0xfe06('0x60')](_0x532ca8);}})[_0xfe06('0x20')](function(_0x48f046){if(_0x48f046){_0x1182dc=_0x48f046[_0xfe06('0x55')];if(!_0x3dc129[_0xfe06('0x40')]['hasOwnProperty'](_0xfe06('0x48'))){_0x532ca8['limit']=qs[_0xfe06('0x49')](_0x3dc129[_0xfe06('0x40')][_0xfe06('0x49')]);_0x532ca8['offset']=qs['offset'](_0x3dc129[_0xfe06('0x40')]['offset']);}return _0x1631ec[_0xfe06('0x60')](_0x532ca8);}})[_0xfe06('0x20')](function(_0x155e09){if(_0x155e09){return _0x155e09?{'count':_0x1182dc,'rows':_0x155e09}:null;}})['then'](respondWithResult(_0x2a4495,null))['catch'](handleError(_0x2a4495,null));};exports[_0xfe06('0x61')]=function(_0x3b9b66,_0x7ad70b,_0x13d6c0){var _0x4f061f={};var _0xe51f5={};var _0x5ac9e8;var _0x501cc2;return db[_0xfe06('0x50')][_0xfe06('0x5f')]({'where':{'id':_0x3b9b66[_0xfe06('0x5a')]['id']}})[_0xfe06('0x20')](handleEntityNotFound(_0x7ad70b,null))[_0xfe06('0x20')](function(_0x31c05a){if(_0x31c05a){_0x5ac9e8=_0x31c05a;_0xe51f5[_0xfe06('0x44')]=_['keys'](db[_0xfe06('0x5d')][_0xfe06('0x3c')]);_0xe51f5[_0xfe06('0x40')]=_['keys'](_0x3b9b66[_0xfe06('0x40')]);_0xe51f5[_0xfe06('0x42')]=_[_0xfe06('0x43')](_0xe51f5['model'],_0xe51f5[_0xfe06('0x40')]);_0x4f061f[_0xfe06('0x45')]=_['intersection'](_0xe51f5[_0xfe06('0x44')],qs[_0xfe06('0x46')](_0x3b9b66['query']['fields']));_0x4f061f[_0xfe06('0x45')]=_0x4f061f['attributes'][_0xfe06('0x55')]?_0x4f061f[_0xfe06('0x45')]:_0xe51f5[_0xfe06('0x44')];_0x4f061f[_0xfe06('0x5e')]=qs['sort'](_0x3b9b66['query'][_0xfe06('0x4a')]);_0x4f061f[_0xfe06('0x4b')]=qs[_0xfe06('0x42')](_['pick'](_0x3b9b66[_0xfe06('0x40')],_0xe51f5['filters']));if(_0x3b9b66['query'][_0xfe06('0x4e')]){_0x4f061f['where']=_[_0xfe06('0x4f')](_0x4f061f[_0xfe06('0x4b')],{'$or':_[_0xfe06('0x3b')](_0x4f061f['attributes'],function(_0x584460){var _0x2b0362={};_0x2b0362[_0x584460]={'$like':'%'+_0x3b9b66['query'][_0xfe06('0x4e')]+'%'};return _0x2b0362;})});}_0x4f061f=_['merge']({},_0x4f061f,_0x3b9b66[_0xfe06('0x56')]);return _0x5ac9e8[_0xfe06('0x61')](_0x4f061f);}})['then'](function(_0x3557b1){if(_0x3557b1){_0x501cc2=_0x3557b1[_0xfe06('0x55')];if(!_0x3b9b66[_0xfe06('0x40')][_0xfe06('0x47')](_0xfe06('0x48'))){_0x4f061f[_0xfe06('0x49')]=qs[_0xfe06('0x49')](_0x3b9b66[_0xfe06('0x40')][_0xfe06('0x49')]);_0x4f061f[_0xfe06('0x31')]=qs['offset'](_0x3b9b66[_0xfe06('0x40')]['offset']);}return _0x5ac9e8[_0xfe06('0x61')](_0x4f061f);}})[_0xfe06('0x20')](function(_0x2b2c11){if(_0x2b2c11){return _0x2b2c11?{'count':_0x501cc2,'rows':_0x2b2c11}:null;}})[_0xfe06('0x20')](respondWithResult(_0x7ad70b,null))['catch'](handleError(_0x7ad70b,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index c0d1187..2fef935 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 _0xddc0=['util','../../config/logger','api','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash'];(function(_0x1f5591,_0x121284){var _0x463017=function(_0x5f4b43){while(--_0x5f4b43){_0x1f5591['push'](_0x1f5591['shift']());}};_0x463017(++_0x121284);}(_0xddc0,0xaf));var _0x0ddc=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0xddc0[_0x3792e6];return _0x441e44;};'use strict';var _=require(_0x0ddc('0x0'));var util=require(_0x0ddc('0x1'));var logger=require(_0x0ddc('0x2'))(_0x0ddc('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0ddc('0x4'));var fs=require('fs');var path=require(_0x0ddc('0x5'));var rimraf=require(_0x0ddc('0x6'));var config=require('../../config/environment');var attributes=require(_0x0ddc('0x7'));module[_0x0ddc('0x8')]=function(_0x366dda,_0x294e03){return _0x366dda[_0x0ddc('0x9')](_0x0ddc('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1e7=['bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','api','moment'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xb1e7,0x18f));var _0x7b1e=function(_0x144db7,_0x592719){_0x144db7=_0x144db7-0x0;var _0x3efe6a=_0xb1e7[_0x144db7];return _0x3efe6a;};'use strict';var _=require(_0x7b1e('0x0'));var util=require('util');var logger=require(_0x7b1e('0x1'))(_0x7b1e('0x2'));var moment=require(_0x7b1e('0x3'));var BPromise=require(_0x7b1e('0x4'));var rp=require(_0x7b1e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b1e('0x6'));var config=require(_0x7b1e('0x7'));var attributes=require(_0x7b1e('0x8'));module[_0x7b1e('0x9')]=function(_0x128ee4,_0x99139a){return _0x128ee4[_0x7b1e('0xa')](_0x7b1e('0xb'),attributes,{'tableName':_0x7b1e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 14d4534..797aba3 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 _0xb807=['info','debug','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','request\x20sent','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x3ddb02,_0x184ada){var _0x52b85f=function(_0xc7f427){while(--_0xc7f427){_0x3ddb02['push'](_0x3ddb02['shift']());}};_0x52b85f(++_0x184ada);}(_0xb807,0xf9));var _0x7b80=function(_0x4fe93e,_0x44f9e2){_0x4fe93e=_0x4fe93e-0x0;var _0x5f1d5a=_0xb807[_0x4fe93e];return _0x5f1d5a;};'use strict';var _=require('lodash');var util=require(_0x7b80('0x0'));var moment=require('moment');var BPromise=require(_0x7b80('0x1'));var rs=require(_0x7b80('0x2'));var fs=require('fs');var Redis=require(_0x7b80('0x3'));var db=require(_0x7b80('0x4'))['db'];var utils=require(_0x7b80('0x5'));var logger=require('../../config/logger')(_0x7b80('0x6'));var config=require(_0x7b80('0x7'));var jayson=require(_0x7b80('0x8'));var client=jayson[_0x7b80('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dfb2d,_0x2a6183,_0x12af51){return new BPromise(function(_0x2a5bcf,_0x3a4ee2){return client['request'](_0x3dfb2d,_0x12af51)[_0x7b80('0xa')](function(_0x5571a6){logger[_0x7b80('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x2a6183,'request\x20sent');logger[_0x7b80('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x2a6183,'request\x20sent',JSON[_0x7b80('0xd')](_0x5571a6));if(_0x5571a6[_0x7b80('0xe')]){if(_0x5571a6['error'][_0x7b80('0xf')]===0x1f4){logger['error'](_0x7b80('0x10'),_0x2a6183,_0x5571a6['error'][_0x7b80('0x11')]);return _0x3a4ee2(_0x5571a6['error'][_0x7b80('0x11')]);}logger[_0x7b80('0xe')]('VtigerConfiguration,\x20%s,\x20%s',_0x2a6183,_0x5571a6[_0x7b80('0xe')]['message']);return _0x2a5bcf(_0x5571a6[_0x7b80('0xe')][_0x7b80('0x11')]);}else{logger['info'](_0x7b80('0x10'),_0x2a6183,_0x7b80('0x12'));_0x2a5bcf(_0x5571a6['result'][_0x7b80('0x11')]);}})[_0x7b80('0x13')](function(_0x1f480f){logger[_0x7b80('0xe')](_0x7b80('0x10'),_0x2a6183,_0x1f480f);_0x3a4ee2(_0x1f480f);});});} \ No newline at end of file +var _0xd151=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','../../config/utils'];(function(_0x3184f9,_0x36c935){var _0x26b384=function(_0x462f5d){while(--_0x462f5d){_0x3184f9['push'](_0x3184f9['shift']());}};_0x26b384(++_0x36c935);}(_0xd151,0x1ca));var _0x1d15=function(_0x2a99ea,_0x1bfb13){_0x2a99ea=_0x2a99ea-0x0;var _0x5887ae=_0xd151[_0x2a99ea];return _0x5887ae;};'use strict';var _=require(_0x1d15('0x0'));var util=require(_0x1d15('0x1'));var moment=require(_0x1d15('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1d15('0x3'));var logger=require(_0x1d15('0x4'))(_0x1d15('0x5'));var config=require(_0x1d15('0x6'));var jayson=require(_0x1d15('0x7'));var client=jayson['client'][_0x1d15('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a8d04,_0x28aefc,_0xcb014b){return new BPromise(function(_0x7fa5cb,_0x386c3c){return client[_0x1d15('0x9')](_0x1a8d04,_0xcb014b)[_0x1d15('0xa')](function(_0x2708c5){logger['info'](_0x1d15('0xb'),_0x28aefc,_0x1d15('0xc'));logger[_0x1d15('0xd')](_0x1d15('0xe'),_0x28aefc,'request\x20sent',JSON[_0x1d15('0xf')](_0x2708c5));if(_0x2708c5[_0x1d15('0x10')]){if(_0x2708c5[_0x1d15('0x10')][_0x1d15('0x11')]===0x1f4){logger['error'](_0x1d15('0xb'),_0x28aefc,_0x2708c5[_0x1d15('0x10')][_0x1d15('0x12')]);return _0x386c3c(_0x2708c5[_0x1d15('0x10')]['message']);}logger[_0x1d15('0x10')](_0x1d15('0xb'),_0x28aefc,_0x2708c5[_0x1d15('0x10')][_0x1d15('0x12')]);return _0x7fa5cb(_0x2708c5[_0x1d15('0x10')][_0x1d15('0x12')]);}else{logger[_0x1d15('0x13')](_0x1d15('0xb'),_0x28aefc,_0x1d15('0xc'));_0x7fa5cb(_0x2708c5[_0x1d15('0x14')]['message']);}})['catch'](function(_0x2af1d1){logger[_0x1d15('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x28aefc,_0x2af1d1);_0x386c3c(_0x2af1d1);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 920f6ca..715e181 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 _0x0b42=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x1bc305,_0x474316){var _0x542e5e=function(_0x26b4eb){while(--_0x26b4eb){_0x1bc305['push'](_0x1bc305['shift']());}};_0x542e5e(++_0x474316);}(_0x0b42,0x1b1));var _0x20b4=function(_0x48fa85,_0x445824){_0x48fa85=_0x48fa85-0x0;var _0x406d8e=_0x0b42[_0x48fa85];return _0x406d8e;};'use strict';var multer=require(_0x20b4('0x0'));var util=require(_0x20b4('0x1'));var path=require('path');var timeout=require(_0x20b4('0x2'));var express=require(_0x20b4('0x3'));var router=express[_0x20b4('0x4')]();var auth=require(_0x20b4('0x5'));var interaction=require(_0x20b4('0x6'));var config=require(_0x20b4('0x7'));var controller=require('./intVtigerField.controller');router[_0x20b4('0x8')]('/',auth[_0x20b4('0x9')](),controller[_0x20b4('0xa')]);router[_0x20b4('0x8')](_0x20b4('0xb'),auth[_0x20b4('0x9')](),controller[_0x20b4('0xc')]);router[_0x20b4('0xd')]('/',auth[_0x20b4('0x9')](),controller['create']);router[_0x20b4('0xe')]('/:id',auth[_0x20b4('0x9')](),controller[_0x20b4('0xf')]);router[_0x20b4('0x10')](_0x20b4('0xb'),auth['isAuthenticated'](),controller[_0x20b4('0x11')]);module[_0x20b4('0x12')]=router; \ No newline at end of file +var _0xaa0c=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','multer','path'];(function(_0x4fd965,_0xc047be){var _0x3a121b=function(_0x5c81fa){while(--_0x5c81fa){_0x4fd965['push'](_0x4fd965['shift']());}};_0x3a121b(++_0xc047be);}(_0xaa0c,0xfa));var _0xcaa0=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0xaa0c[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0xcaa0('0x0'));var util=require('util');var path=require(_0xcaa0('0x1'));var timeout=require(_0xcaa0('0x2'));var express=require(_0xcaa0('0x3'));var router=express['Router']();var auth=require(_0xcaa0('0x4'));var interaction=require(_0xcaa0('0x5'));var config=require(_0xcaa0('0x6'));var controller=require('./intVtigerField.controller');router['get']('/',auth[_0xcaa0('0x7')](),controller[_0xcaa0('0x8')]);router[_0xcaa0('0x9')](_0xcaa0('0xa'),auth[_0xcaa0('0x7')](),controller[_0xcaa0('0xb')]);router[_0xcaa0('0xc')]('/',auth[_0xcaa0('0x7')](),controller[_0xcaa0('0xd')]);router[_0xcaa0('0xe')]('/:id',auth[_0xcaa0('0x7')](),controller[_0xcaa0('0xf')]);router['delete']('/:id',auth[_0xcaa0('0x7')](),controller[_0xcaa0('0x10')]);module[_0xcaa0('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 1fe2aec..23741a9 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 _0x13e3=['customVariable','keyValue','string','STRING','variable','ENUM'];(function(_0x3d8d0a,_0x11bb87){var _0x5b9df5=function(_0x3ecba2){while(--_0x3ecba2){_0x3d8d0a['push'](_0x3d8d0a['shift']());}};_0x5b9df5(++_0x11bb87);}(_0x13e3,0x137));var _0x313e=function(_0xcfeff4,_0x3f2e19){_0xcfeff4=_0xcfeff4-0x0;var _0xb2fadc=_0x13e3[_0xcfeff4];return _0xb2fadc;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x313e('0x0')]('string','variable',_0x313e('0x1'),_0x313e('0x2')),'defaultValue':_0x313e('0x3')},'content':{'type':Sequelize[_0x313e('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x313e('0x0')](_0x313e('0x3'),_0x313e('0x5'),'customVariable')},'keyContent':{'type':Sequelize[_0x313e('0x4')]},'idField':{'type':Sequelize[_0x313e('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf350=['STRING','BOOLEAN','sequelize','string','variable','customVariable','keyValue'];(function(_0x2947e6,_0x5df1e7){var _0x35be73=function(_0xc449c6){while(--_0xc449c6){_0x2947e6['push'](_0x2947e6['shift']());}};_0x35be73(++_0x5df1e7);}(_0xf350,0x105));var _0x0f35=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf350[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0f35('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x0f35('0x1'),_0x0f35('0x2'),_0x0f35('0x3'),_0x0f35('0x4')),'defaultValue':_0x0f35('0x1')},'content':{'type':Sequelize[_0x0f35('0x5')]},'key':{'type':Sequelize[_0x0f35('0x5')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x0f35('0x3'))},'keyContent':{'type':Sequelize[_0x0f35('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0f35('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index a02141a..29d26ee 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 _0x2227=['destroy','error','stack','name','send','index','map','VtigerField','rawAttributes','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then'];(function(_0x3ae689,_0x256781){var _0x454fdf=function(_0x50c565){while(--_0x50c565){_0x3ae689['push'](_0x3ae689['shift']());}};_0x454fdf(++_0x256781);}(_0x2227,0x147));var _0x7222=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x2227[_0x3b5250];return _0xc844a1;};'use strict';var pdf=require(_0x7222('0x0'));var emlformat=require(_0x7222('0x1'));var rimraf=require(_0x7222('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7222('0x3'));var rp=require(_0x7222('0x4'));var moment=require(_0x7222('0x5'));var BPromise=require(_0x7222('0x6'));var Mustache=require(_0x7222('0x7'));var util=require(_0x7222('0x8'));var path=require(_0x7222('0x9'));var sox=require('sox');var csv=require(_0x7222('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7222('0xb'));var crypto=require(_0x7222('0xc'));var jsforce=require(_0x7222('0xd'));var deskjs=require(_0x7222('0xe'));var toCsv=require('to-csv');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(_0x7222('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf0e578,_0x8956e1){_0x8956e1=_0x8956e1||0xcc;return function(_0x3d75f4){if(_0x3d75f4){return _0xf0e578[_0x7222('0x1a')](_0x8956e1);}return _0xf0e578[_0x7222('0x1b')](_0x8956e1)[_0x7222('0x1c')]();};}function respondWithResult(_0x570a99,_0x41b2e5){_0x41b2e5=_0x41b2e5||0xc8;return function(_0x56ebd7){if(_0x56ebd7){return _0x570a99[_0x7222('0x1b')](_0x41b2e5)[_0x7222('0x1d')](_0x56ebd7);}};}function respondWithFilteredResult(_0x4bf49f,_0x467fbf){return function(_0x385b63){if(_0x385b63){var _0x13ab59=_0x385b63[_0x7222('0x1e')],_0x30f595=_0x467fbf[_0x7222('0x1f')],_0x119ab6=_0x467fbf[_0x7222('0x1f')]+_0x467fbf[_0x7222('0x20')],_0x1c05c2;if(_0x119ab6>=_0x13ab59){_0x119ab6=_0x13ab59;_0x1c05c2=0xc8;}else{_0x1c05c2=0xce;}_0x4bf49f['status'](_0x1c05c2);return _0x4bf49f[_0x7222('0x21')](_0x7222('0x22'),_0x30f595+'-'+_0x119ab6+'/'+_0x13ab59)['json'](_0x385b63);}return null;};}function patchUpdates(_0x53a1ed){return function(_0x53928b){try{jsonpatch['apply'](_0x53928b,_0x53a1ed,!![]);}catch(_0x151ad3){return BPromise[_0x7222('0x23')](_0x151ad3);}return _0x53928b['save']();};}function saveUpdates(_0x70e2b3,_0x41a30b){return function(_0xb0c88c){if(_0xb0c88c){return _0xb0c88c[_0x7222('0x24')](_0x70e2b3)[_0x7222('0x25')](function(_0x2d9e7b){return _0x2d9e7b;});}return null;};}function removeEntity(_0x353986,_0x19d47f){return function(_0x3db2f7){if(_0x3db2f7){return _0x3db2f7[_0x7222('0x26')]()[_0x7222('0x25')](function(){_0x353986[_0x7222('0x1b')](0xcc)[_0x7222('0x1c')]();});}};}function handleEntityNotFound(_0x2bdf19,_0xa53c48){return function(_0x463443){if(!_0x463443){_0x2bdf19[_0x7222('0x1a')](0x194);}return _0x463443;};}function handleError(_0x322f8f,_0x14e8ac){_0x14e8ac=_0x14e8ac||0x1f4;return function(_0x2c3594){logger[_0x7222('0x27')](_0x2c3594[_0x7222('0x28')]);if(_0x2c3594[_0x7222('0x29')]){delete _0x2c3594[_0x7222('0x29')];}_0x322f8f['status'](_0x14e8ac)[_0x7222('0x2a')](_0x2c3594);};}exports[_0x7222('0x2b')]=function(_0x130a63,_0x36f671){var _0x6f08c3={},_0x435549={},_0x4acf30={'count':0x0,'rows':[]};var _0x3c5cf2=_[_0x7222('0x2c')](db[_0x7222('0x2d')][_0x7222('0x2e')],function(_0x120a46){return{'name':_0x120a46['fieldName'],'type':_0x120a46['type']['key']};});_0x435549['model']=_[_0x7222('0x2c')](_0x3c5cf2,'name');_0x435549[_0x7222('0x2f')]=_['keys'](_0x130a63[_0x7222('0x2f')]);_0x435549[_0x7222('0x30')]=_[_0x7222('0x31')](_0x435549[_0x7222('0x32')],_0x435549['query']);_0x6f08c3[_0x7222('0x33')]=_[_0x7222('0x31')](_0x435549[_0x7222('0x32')],qs['fields'](_0x130a63['query'][_0x7222('0x34')]));_0x6f08c3[_0x7222('0x33')]=_0x6f08c3[_0x7222('0x33')][_0x7222('0x35')]?_0x6f08c3[_0x7222('0x33')]:_0x435549[_0x7222('0x32')];if(!_0x130a63[_0x7222('0x2f')][_0x7222('0x36')]('nolimit')){_0x6f08c3[_0x7222('0x20')]=qs['limit'](_0x130a63['query'][_0x7222('0x20')]);_0x6f08c3[_0x7222('0x1f')]=qs[_0x7222('0x1f')](_0x130a63[_0x7222('0x2f')]['offset']);}_0x6f08c3[_0x7222('0x37')]=qs[_0x7222('0x38')](_0x130a63[_0x7222('0x2f')]['sort']);_0x6f08c3[_0x7222('0x39')]=qs[_0x7222('0x30')](_['pick'](_0x130a63[_0x7222('0x2f')],_0x435549['filters']),_0x3c5cf2);if(_0x130a63['query'][_0x7222('0x3a')]){_0x6f08c3[_0x7222('0x39')]=_[_0x7222('0x3b')](_0x6f08c3['where'],{'$or':_['map'](_0x3c5cf2,function(_0x468517){if(_0x468517[_0x7222('0x3c')]!==_0x7222('0x3d')){var _0x290282={};_0x290282[_0x468517[_0x7222('0x29')]]={'$like':'%'+_0x130a63[_0x7222('0x2f')][_0x7222('0x3a')]+'%'};return _0x290282;}})});}_0x6f08c3=_['merge']({},_0x6f08c3,_0x130a63['options']);var _0x121c3d={'where':_0x6f08c3['where']};return db[_0x7222('0x2d')][_0x7222('0x1e')](_0x121c3d)['then'](function(_0x38e255){_0x4acf30[_0x7222('0x1e')]=_0x38e255;if(_0x130a63['query']['includeAll']){_0x6f08c3[_0x7222('0x3e')]=[{'all':!![]}];}return db['VtigerField'][_0x7222('0x3f')](_0x6f08c3);})[_0x7222('0x25')](function(_0x52fe24){_0x4acf30[_0x7222('0x40')]=_0x52fe24;return _0x4acf30;})[_0x7222('0x25')](respondWithFilteredResult(_0x36f671,_0x6f08c3))[_0x7222('0x41')](handleError(_0x36f671,null));};exports[_0x7222('0x42')]=function(_0x3470c3,_0x12a56a){var _0x374a49={'raw':!![],'where':{'id':_0x3470c3[_0x7222('0x43')]['id']}},_0x3da8d2={};_0x3da8d2[_0x7222('0x32')]=_[_0x7222('0x44')](db[_0x7222('0x2d')][_0x7222('0x2e')]);_0x3da8d2[_0x7222('0x2f')]=_['keys'](_0x3470c3['query']);_0x3da8d2['filters']=_[_0x7222('0x31')](_0x3da8d2[_0x7222('0x32')],_0x3da8d2['query']);_0x374a49[_0x7222('0x33')]=_['intersection'](_0x3da8d2[_0x7222('0x32')],qs[_0x7222('0x34')](_0x3470c3['query']['fields']));_0x374a49[_0x7222('0x33')]=_0x374a49[_0x7222('0x33')][_0x7222('0x35')]?_0x374a49[_0x7222('0x33')]:_0x3da8d2[_0x7222('0x32')];if(_0x3470c3[_0x7222('0x2f')][_0x7222('0x45')]){_0x374a49[_0x7222('0x3e')]=[{'all':!![]}];}_0x374a49=_[_0x7222('0x3b')]({},_0x374a49,_0x3470c3['options']);return db['VtigerField'][_0x7222('0x46')](_0x374a49)[_0x7222('0x25')](handleEntityNotFound(_0x12a56a,null))[_0x7222('0x25')](respondWithResult(_0x12a56a,null))[_0x7222('0x41')](handleError(_0x12a56a,null));};exports['create']=function(_0x36d15f,_0x5327c6){return db[_0x7222('0x2d')][_0x7222('0x47')](_0x36d15f['body'],{})['then'](respondWithResult(_0x5327c6,0xc9))[_0x7222('0x41')](handleError(_0x5327c6,null));};exports[_0x7222('0x24')]=function(_0x7c669b,_0x341a57){if(_0x7c669b['body']['id']){delete _0x7c669b['body']['id'];}return db['VtigerField'][_0x7222('0x46')]({'where':{'id':_0x7c669b['params']['id']}})[_0x7222('0x25')](handleEntityNotFound(_0x341a57,null))[_0x7222('0x25')](saveUpdates(_0x7c669b[_0x7222('0x48')],null))[_0x7222('0x25')](respondWithResult(_0x341a57,null))[_0x7222('0x41')](handleError(_0x341a57,null));};exports[_0x7222('0x26')]=function(_0x32f32a,_0x5eb47d){return db[_0x7222('0x2d')]['find']({'where':{'id':_0x32f32a[_0x7222('0x43')]['id']}})['then'](handleEntityNotFound(_0x5eb47d,null))[_0x7222('0x25')](removeEntity(_0x5eb47d,null))[_0x7222('0x41')](handleError(_0x5eb47d,null));}; \ No newline at end of file +var _0x834d=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','save','update','then','destroy','stack','name','send','index','map','VtigerField','rawAttributes','key','query','keys','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','sort','where','filters','type','VIRTUAL','filter','merge','options','include','findAll','catch','show','params','create','body','find','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5beb17,_0x1520d4){var _0x2fe077=function(_0x11da79){while(--_0x11da79){_0x5beb17['push'](_0x5beb17['shift']());}};_0x2fe077(++_0x1520d4);}(_0x834d,0x140));var _0xd834=function(_0x10716b,_0x590dbc){_0x10716b=_0x10716b-0x0;var _0x25a213=_0x834d[_0x10716b];return _0x25a213;};'use strict';var pdf=require(_0xd834('0x0'));var emlformat=require(_0xd834('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd834('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd834('0x3'));var BPromise=require(_0xd834('0x4'));var Mustache=require(_0xd834('0x5'));var util=require(_0xd834('0x6'));var path=require('path');var sox=require(_0xd834('0x7'));var csv=require(_0xd834('0x8'));var ejs=require(_0xd834('0x9'));var fs=require('fs');var _=require(_0xd834('0xa'));var squel=require(_0xd834('0xb'));var crypto=require(_0xd834('0xc'));var jsforce=require(_0xd834('0xd'));var deskjs=require(_0xd834('0xe'));var toCsv=require(_0xd834('0x8'));var querystring=require(_0xd834('0xf'));var Papa=require('papaparse');var Redis=require(_0xd834('0x10'));var authService=require(_0xd834('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd834('0x12'));var hardwareService=require(_0xd834('0x13'));var logger=require('../../config/logger')(_0xd834('0x14'));var utils=require(_0xd834('0x15'));var config=require(_0xd834('0x16'));var db=require(_0xd834('0x17'))['db'];function respondWithStatusCode(_0x218d94,_0xbcb6cc){_0xbcb6cc=_0xbcb6cc||0xcc;return function(_0x472126){if(_0x472126){return _0x218d94[_0xd834('0x18')](_0xbcb6cc);}return _0x218d94[_0xd834('0x19')](_0xbcb6cc)[_0xd834('0x1a')]();};}function respondWithResult(_0x3d6374,_0x5d6c9a){_0x5d6c9a=_0x5d6c9a||0xc8;return function(_0x12d1d4){if(_0x12d1d4){return _0x3d6374[_0xd834('0x19')](_0x5d6c9a)[_0xd834('0x1b')](_0x12d1d4);}};}function respondWithFilteredResult(_0x4b41d9,_0xfbe0dd){return function(_0x30315a){if(_0x30315a){var _0x1aa77a=_0x30315a[_0xd834('0x1c')],_0x3ddd9f=_0xfbe0dd[_0xd834('0x1d')],_0x4f5198=_0xfbe0dd[_0xd834('0x1d')]+_0xfbe0dd['limit'],_0x5ca711;if(_0x4f5198>=_0x1aa77a){_0x4f5198=_0x1aa77a;_0x5ca711=0xc8;}else{_0x5ca711=0xce;}_0x4b41d9[_0xd834('0x19')](_0x5ca711);return _0x4b41d9[_0xd834('0x1e')]('Content-Range',_0x3ddd9f+'-'+_0x4f5198+'/'+_0x1aa77a)[_0xd834('0x1b')](_0x30315a);}return null;};}function patchUpdates(_0x46d26a){return function(_0x12e676){try{jsonpatch['apply'](_0x12e676,_0x46d26a,!![]);}catch(_0x91f006){return BPromise['reject'](_0x91f006);}return _0x12e676[_0xd834('0x1f')]();};}function saveUpdates(_0x36380a,_0x4b451e){return function(_0x40852a){if(_0x40852a){return _0x40852a[_0xd834('0x20')](_0x36380a)[_0xd834('0x21')](function(_0x23b6a7){return _0x23b6a7;});}return null;};}function removeEntity(_0xbec036,_0x45d83f){return function(_0x59b604){if(_0x59b604){return _0x59b604[_0xd834('0x22')]()['then'](function(){_0xbec036[_0xd834('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb7e09f,_0x40874f){return function(_0xd1a893){if(!_0xd1a893){_0xb7e09f['sendStatus'](0x194);}return _0xd1a893;};}function handleError(_0x4a399e,_0x4b89b5){_0x4b89b5=_0x4b89b5||0x1f4;return function(_0x2a5921){logger['error'](_0x2a5921[_0xd834('0x23')]);if(_0x2a5921['name']){delete _0x2a5921[_0xd834('0x24')];}_0x4a399e['status'](_0x4b89b5)[_0xd834('0x25')](_0x2a5921);};}exports[_0xd834('0x26')]=function(_0x3a412a,_0x42cebf){var _0x244e3f={},_0x570c95={},_0x16fac4={'count':0x0,'rows':[]};var _0x557f7e=_[_0xd834('0x27')](db[_0xd834('0x28')][_0xd834('0x29')],function(_0xf8813d){return{'name':_0xf8813d['fieldName'],'type':_0xf8813d['type'][_0xd834('0x2a')]};});_0x570c95['model']=_['map'](_0x557f7e,'name');_0x570c95[_0xd834('0x2b')]=_[_0xd834('0x2c')](_0x3a412a[_0xd834('0x2b')]);_0x570c95['filters']=_['intersection'](_0x570c95[_0xd834('0x2d')],_0x570c95[_0xd834('0x2b')]);_0x244e3f[_0xd834('0x2e')]=_[_0xd834('0x2f')](_0x570c95[_0xd834('0x2d')],qs[_0xd834('0x30')](_0x3a412a[_0xd834('0x2b')][_0xd834('0x30')]));_0x244e3f['attributes']=_0x244e3f[_0xd834('0x2e')]['length']?_0x244e3f[_0xd834('0x2e')]:_0x570c95[_0xd834('0x2d')];if(!_0x3a412a['query'][_0xd834('0x31')](_0xd834('0x32'))){_0x244e3f['limit']=qs[_0xd834('0x33')](_0x3a412a['query'][_0xd834('0x33')]);_0x244e3f[_0xd834('0x1d')]=qs[_0xd834('0x1d')](_0x3a412a['query'][_0xd834('0x1d')]);}_0x244e3f['order']=qs[_0xd834('0x34')](_0x3a412a[_0xd834('0x2b')]['sort']);_0x244e3f[_0xd834('0x35')]=qs[_0xd834('0x36')](_['pick'](_0x3a412a[_0xd834('0x2b')],_0x570c95[_0xd834('0x36')]),_0x557f7e);if(_0x3a412a[_0xd834('0x2b')]['filter']){_0x244e3f[_0xd834('0x35')]=_['merge'](_0x244e3f[_0xd834('0x35')],{'$or':_['map'](_0x557f7e,function(_0x3cb3ec){if(_0x3cb3ec[_0xd834('0x37')]!==_0xd834('0x38')){var _0x5a8761={};_0x5a8761[_0x3cb3ec[_0xd834('0x24')]]={'$like':'%'+_0x3a412a[_0xd834('0x2b')][_0xd834('0x39')]+'%'};return _0x5a8761;}})});}_0x244e3f=_[_0xd834('0x3a')]({},_0x244e3f,_0x3a412a[_0xd834('0x3b')]);var _0xe1f164={'where':_0x244e3f[_0xd834('0x35')]};return db['VtigerField'][_0xd834('0x1c')](_0xe1f164)[_0xd834('0x21')](function(_0x386537){_0x16fac4[_0xd834('0x1c')]=_0x386537;if(_0x3a412a[_0xd834('0x2b')]['includeAll']){_0x244e3f[_0xd834('0x3c')]=[{'all':!![]}];}return db[_0xd834('0x28')][_0xd834('0x3d')](_0x244e3f);})['then'](function(_0x5c7b24){_0x16fac4['rows']=_0x5c7b24;return _0x16fac4;})[_0xd834('0x21')](respondWithFilteredResult(_0x42cebf,_0x244e3f))[_0xd834('0x3e')](handleError(_0x42cebf,null));};exports[_0xd834('0x3f')]=function(_0x5c2414,_0x3e53bc){var _0x473260={'raw':!![],'where':{'id':_0x5c2414[_0xd834('0x40')]['id']}},_0x2a7b2b={};_0x2a7b2b[_0xd834('0x2d')]=_['keys'](db[_0xd834('0x28')][_0xd834('0x29')]);_0x2a7b2b[_0xd834('0x2b')]=_[_0xd834('0x2c')](_0x5c2414[_0xd834('0x2b')]);_0x2a7b2b['filters']=_['intersection'](_0x2a7b2b[_0xd834('0x2d')],_0x2a7b2b[_0xd834('0x2b')]);_0x473260[_0xd834('0x2e')]=_[_0xd834('0x2f')](_0x2a7b2b['model'],qs['fields'](_0x5c2414['query'][_0xd834('0x30')]));_0x473260['attributes']=_0x473260[_0xd834('0x2e')]['length']?_0x473260['attributes']:_0x2a7b2b[_0xd834('0x2d')];if(_0x5c2414[_0xd834('0x2b')]['includeAll']){_0x473260['include']=[{'all':!![]}];}_0x473260=_[_0xd834('0x3a')]({},_0x473260,_0x5c2414['options']);return db[_0xd834('0x28')]['find'](_0x473260)[_0xd834('0x21')](handleEntityNotFound(_0x3e53bc,null))['then'](respondWithResult(_0x3e53bc,null))['catch'](handleError(_0x3e53bc,null));};exports[_0xd834('0x41')]=function(_0x2fc3fa,_0x2a6518){return db[_0xd834('0x28')]['create'](_0x2fc3fa[_0xd834('0x42')],{})[_0xd834('0x21')](respondWithResult(_0x2a6518,0xc9))[_0xd834('0x3e')](handleError(_0x2a6518,null));};exports[_0xd834('0x20')]=function(_0x511558,_0x35de4b){if(_0x511558['body']['id']){delete _0x511558[_0xd834('0x42')]['id'];}return db[_0xd834('0x28')]['find']({'where':{'id':_0x511558[_0xd834('0x40')]['id']}})['then'](handleEntityNotFound(_0x35de4b,null))[_0xd834('0x21')](saveUpdates(_0x511558['body'],null))[_0xd834('0x21')](respondWithResult(_0x35de4b,null))['catch'](handleError(_0x35de4b,null));};exports[_0xd834('0x22')]=function(_0x3d5073,_0x5c1c02){return db[_0xd834('0x28')][_0xd834('0x43')]({'where':{'id':_0x3d5073['params']['id']}})['then'](handleEntityNotFound(_0x5c1c02,null))[_0xd834('0x21')](removeEntity(_0x5c1c02,null))[_0xd834('0x3e')](handleError(_0x5c1c02,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 68b95bc..b2f8423 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 _0xf4eb=['int_vtiger_fields','FieldId','lodash','bluebird','rimraf','../../config/environment','./intVtigerField.attributes','exports','define'];(function(_0x1250c9,_0x4034c2){var _0x6fbaa=function(_0x368ea0){while(--_0x368ea0){_0x1250c9['push'](_0x1250c9['shift']());}};_0x6fbaa(++_0x4034c2);}(_0xf4eb,0xec));var _0xbf4e=function(_0x540258,_0x166877){_0x540258=_0x540258-0x0;var _0x4e9181=_0xf4eb[_0x540258];return _0x4e9181;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbf4e('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var attributes=require(_0xbf4e('0x4'));module[_0xbf4e('0x5')]=function(_0xa4dcf5,_0x2fcfed){return _0xa4dcf5[_0xbf4e('0x6')]('VtigerField',attributes,{'tableName':_0xbf4e('0x7'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0xbf4e('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x00bb=['request-promise','path','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util','../../config/logger','moment'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x00bb,0x1d8));var _0xb00b=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x00bb[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[{'name':_0xb00b('0xb'),'fields':[_0xb00b('0xc'),_0xb00b('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index c7b4693..e6162ba 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 _0x1ca7=['catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x58df55,_0x2fcada){var _0x59aa9e=function(_0x4e5dc8){while(--_0x4e5dc8){_0x58df55['push'](_0x58df55['shift']());}};_0x59aa9e(++_0x2fcada);}(_0x1ca7,0x157));var _0x71ca=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x1ca7[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x71ca('0x0'));var util=require(_0x71ca('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71ca('0x2'));var db=require(_0x71ca('0x3'))['db'];var utils=require(_0x71ca('0x4'));var logger=require('../../config/logger')(_0x71ca('0x5'));var config=require(_0x71ca('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x71ca('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d5d49,_0x31444d,_0xa06a89){return new BPromise(function(_0x4f25f6,_0x378012){return client[_0x71ca('0x8')](_0x2d5d49,_0xa06a89)['then'](function(_0x2ad516){logger[_0x71ca('0x9')](_0x71ca('0xa'),_0x31444d,'request\x20sent');logger[_0x71ca('0xb')](_0x71ca('0xc'),_0x31444d,_0x71ca('0xd'),JSON[_0x71ca('0xe')](_0x2ad516));if(_0x2ad516[_0x71ca('0xf')]){if(_0x2ad516[_0x71ca('0xf')]['code']===0x1f4){logger[_0x71ca('0xf')](_0x71ca('0xa'),_0x31444d,_0x2ad516['error'][_0x71ca('0x10')]);return _0x378012(_0x2ad516[_0x71ca('0xf')][_0x71ca('0x10')]);}logger[_0x71ca('0xf')](_0x71ca('0xa'),_0x31444d,_0x2ad516[_0x71ca('0xf')][_0x71ca('0x10')]);return _0x4f25f6(_0x2ad516[_0x71ca('0xf')][_0x71ca('0x10')]);}else{logger[_0x71ca('0x9')]('VtigerField,\x20%s,\x20%s',_0x31444d,'request\x20sent');_0x4f25f6(_0x2ad516[_0x71ca('0x11')]['message']);}})[_0x71ca('0x12')](function(_0x22f5f9){logger['error']('VtigerField,\x20%s,\x20%s',_0x31444d,_0x22f5f9);_0x378012(_0x22f5f9);});});} \ No newline at end of file +var _0x97e7=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x97e7,0x1a1));var _0x797e=function(_0x118af2,_0x189684){_0x118af2=_0x118af2-0x0;var _0x8df22e=_0x97e7[_0x118af2];return _0x8df22e;};'use strict';var _=require(_0x797e('0x0'));var util=require(_0x797e('0x1'));var moment=require(_0x797e('0x2'));var BPromise=require('bluebird');var rs=require(_0x797e('0x3'));var fs=require('fs');var Redis=require(_0x797e('0x4'));var db=require(_0x797e('0x5'))['db'];var utils=require(_0x797e('0x6'));var logger=require(_0x797e('0x7'))(_0x797e('0x8'));var config=require(_0x797e('0x9'));var jayson=require(_0x797e('0xa'));var client=jayson[_0x797e('0xb')][_0x797e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x460f22,_0x138402,_0x5db8f6){return new BPromise(function(_0x2fed68,_0xb72f64){return client[_0x797e('0xd')](_0x460f22,_0x5db8f6)[_0x797e('0xe')](function(_0x5ad3cf){logger[_0x797e('0xf')](_0x797e('0x10'),_0x138402,_0x797e('0x11'));logger[_0x797e('0x12')](_0x797e('0x13'),_0x138402,_0x797e('0x11'),JSON[_0x797e('0x14')](_0x5ad3cf));if(_0x5ad3cf['error']){if(_0x5ad3cf[_0x797e('0x15')][_0x797e('0x16')]===0x1f4){logger[_0x797e('0x15')]('VtigerField,\x20%s,\x20%s',_0x138402,_0x5ad3cf[_0x797e('0x15')]['message']);return _0xb72f64(_0x5ad3cf[_0x797e('0x15')]['message']);}logger[_0x797e('0x15')](_0x797e('0x10'),_0x138402,_0x5ad3cf['error'][_0x797e('0x17')]);return _0x2fed68(_0x5ad3cf['error'][_0x797e('0x17')]);}else{logger[_0x797e('0xf')](_0x797e('0x10'),_0x138402,_0x797e('0x11'));_0x2fed68(_0x5ad3cf[_0x797e('0x18')][_0x797e('0x17')]);}})[_0x797e('0x19')](function(_0xfe2fff){logger[_0x797e('0x15')]('VtigerField,\x20%s,\x20%s',_0x138402,_0xfe2fff);_0xb72f64(_0xfe2fff);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 5bf6447..e53b80f 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 _0x2d10=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x2d10,0x13a));var _0x02d1=function(_0x1c34e7,_0x33f9a8){_0x1c34e7=_0x1c34e7-0x0;var _0x378cb1=_0x2d10[_0x1c34e7];return _0x378cb1;};'use strict';var multer=require(_0x02d1('0x0'));var util=require(_0x02d1('0x1'));var path=require(_0x02d1('0x2'));var timeout=require(_0x02d1('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x02d1('0x4'));var interaction=require(_0x02d1('0x5'));var config=require(_0x02d1('0x6'));var controller=require(_0x02d1('0x7'));router[_0x02d1('0x8')]('/',auth[_0x02d1('0x9')](),controller[_0x02d1('0xa')]);router['get'](_0x02d1('0xb'),auth[_0x02d1('0x9')](),controller[_0x02d1('0xc')]);router[_0x02d1('0x8')](_0x02d1('0xd'),auth[_0x02d1('0x9')](),controller[_0x02d1('0xe')]);router['get'](_0x02d1('0xf'),auth[_0x02d1('0x9')](),controller[_0x02d1('0x10')]);router['post']('/',auth[_0x02d1('0x9')](),controller[_0x02d1('0x11')]);router[_0x02d1('0x12')](_0x02d1('0xd'),auth[_0x02d1('0x9')](),controller['addConfiguration']);router[_0x02d1('0x13')](_0x02d1('0xb'),auth[_0x02d1('0x9')](),controller['update']);router[_0x02d1('0x14')](_0x02d1('0xb'),auth['isAuthenticated'](),controller[_0x02d1('0x15')]);module[_0x02d1('0x16')]=router; \ No newline at end of file +var _0x8c40=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','delete','destroy','multer','util'];(function(_0x10108f,_0x3b81d7){var _0x4d27cc=function(_0x388160){while(--_0x388160){_0x10108f['push'](_0x10108f['shift']());}};_0x4d27cc(++_0x3b81d7);}(_0x8c40,0xbb));var _0x08c4=function(_0x56f9d3,_0x101a1b){_0x56f9d3=_0x56f9d3-0x0;var _0x483cf5=_0x8c40[_0x56f9d3];return _0x483cf5;};'use strict';var multer=require(_0x08c4('0x0'));var util=require(_0x08c4('0x1'));var path=require(_0x08c4('0x2'));var timeout=require(_0x08c4('0x3'));var express=require(_0x08c4('0x4'));var router=express[_0x08c4('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x08c4('0x6'));var config=require(_0x08c4('0x7'));var controller=require('./intZendeskAccount.controller');router[_0x08c4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x08c4('0x8')]('/:id',auth[_0x08c4('0x9')](),controller[_0x08c4('0xa')]);router['get'](_0x08c4('0xb'),auth['isAuthenticated'](),controller[_0x08c4('0xc')]);router[_0x08c4('0x8')](_0x08c4('0xd'),auth[_0x08c4('0x9')](),controller[_0x08c4('0xe')]);router[_0x08c4('0xf')]('/',auth[_0x08c4('0x9')](),controller[_0x08c4('0x10')]);router['post'](_0x08c4('0xb'),auth[_0x08c4('0x9')](),controller['addConfiguration']);router[_0x08c4('0x11')](_0x08c4('0x12'),auth['isAuthenticated'](),controller['update']);router[_0x08c4('0x13')](_0x08c4('0x12'),auth[_0x08c4('0x9')](),controller[_0x08c4('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 7dca5a1..caea63a 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 _0xa2b4=['remoteUri','ENUM','password','integrationTab','newTab','STRING','username'];(function(_0x10e3b4,_0x354176){var _0x5d01fd=function(_0x32fb9e){while(--_0x32fb9e){_0x10e3b4['push'](_0x10e3b4['shift']());}};_0x5d01fd(++_0x354176);}(_0xa2b4,0x14e));var _0x4a2b=function(_0x5ef304,_0x105d0c){_0x5ef304=_0x5ef304-0x0;var _0x3bfd68=_0xa2b4[_0x5ef304];return _0x3bfd68;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4a2b('0x0')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4a2b('0x0')],'unique':_0x4a2b('0x1')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x4a2b('0x0')]},'remoteUri':{'type':Sequelize[_0x4a2b('0x0')],'unique':_0x4a2b('0x2')},'authType':{'type':Sequelize[_0x4a2b('0x3')](_0x4a2b('0x4'),'token'),'defaultValue':_0x4a2b('0x4')},'serverUrl':{'type':Sequelize[_0x4a2b('0x0')]},'type':{'type':Sequelize[_0x4a2b('0x3')](_0x4a2b('0x5'),_0x4a2b('0x6')),'defaultValue':_0x4a2b('0x5')}}; \ No newline at end of file +var _0x13f7=['integrationTab','newTab','exports','STRING','username','ENUM','password','token'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x13f7,0x72));var _0x713f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13f7[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x713f('0x0')]={'name':{'type':Sequelize[_0x713f('0x1')]},'description':{'type':Sequelize[_0x713f('0x1')]},'username':{'type':Sequelize[_0x713f('0x1')],'unique':_0x713f('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x713f('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x713f('0x3')](_0x713f('0x4'),_0x713f('0x5')),'defaultValue':_0x713f('0x4')},'serverUrl':{'type':Sequelize[_0x713f('0x1')]},'type':{'type':Sequelize[_0x713f('0x3')](_0x713f('0x6'),_0x713f('0x7')),'defaultValue':_0x713f('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 058de60..dc4e709 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 _0x8668=['test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','save','update','destroy','end','stack','name','send','index','map','ZendeskAccount','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','show','rawAttributes','include','options','find','create','body','params','findOne','ZendeskConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','substring','GET','format','%s/%s','authType','headers','Basic\x20%s','%s/token:%s','toString','base64','description','assignee','remove','ticket_fields','includes','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','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/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client'];(function(_0x10b3ef,_0x48d450){var _0xd0f88f=function(_0x265e22){while(--_0x265e22){_0x10b3ef['push'](_0x10b3ef['shift']());}};_0xd0f88f(++_0x48d450);}(_0x8668,0xe5));var _0x8866=function(_0x5b5aa0,_0x1b4cc0){_0x5b5aa0=_0x5b5aa0-0x0;var _0x38545b=_0x8668[_0x5b5aa0];return _0x38545b;};'use strict';var pdf=require(_0x8866('0x0'));var emlformat=require(_0x8866('0x1'));var rimraf=require(_0x8866('0x2'));var zipdir=require(_0x8866('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8866('0x4'));var BPromise=require(_0x8866('0x5'));var Mustache=require(_0x8866('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8866('0x7'));var csv=require(_0x8866('0x8'));var ejs=require(_0x8866('0x9'));var fs=require('fs');var _=require(_0x8866('0xa'));var squel=require(_0x8866('0xb'));var crypto=require(_0x8866('0xc'));var jsforce=require(_0x8866('0xd'));var deskjs=require(_0x8866('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8866('0xf'));var Papa=require(_0x8866('0x10'));var Redis=require(_0x8866('0x11'));var authService=require(_0x8866('0x12'));var qs=require(_0x8866('0x13'));var as=require(_0x8866('0x14'));var hardwareService=require(_0x8866('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x8866('0x16'));var config=require(_0x8866('0x17'));var db=require(_0x8866('0x18'))['db'];var integrations=require(_0x8866('0x19'));var jayson=require('jayson/promise');var client=jayson[_0x8866('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x3c4fb3,_0x291240,_0x42590b){if(_0x42590b){var _0x31f6e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x31f6e8[_0x8866('0x1b')](_0x291240)){return _0x3c4fb3;}else{throw new db[(_0x8866('0x1c'))][(_0x8866('0x1d'))](_0x8866('0x1e'));}}else{return _0x3c4fb3;}}function respondWithRpcPromise(_0x253dda,_0x4ad0cc,_0x862f62,_0x534c35){return new BPromise(function(_0x5c8c98,_0x8c1c8d){var _0x3ed86b=_0x534c35||client;return _0x3ed86b[_0x8866('0x1f')](_0x253dda,_0x862f62)[_0x8866('0x20')](function(_0x5a51e2){logger[_0x8866('0x21')](_0x8866('0x22'),_0x4ad0cc,_0x8866('0x23'));logger[_0x8866('0x24')](_0x8866('0x25'),_0x4ad0cc,'request\x20sent',JSON[_0x8866('0x26')](_0x5a51e2));if(_0x5a51e2[_0x8866('0x27')]){if(_0x5a51e2[_0x8866('0x27')]['code']===0x1f4){logger[_0x8866('0x27')](_0x8866('0x22'),_0x4ad0cc,_0x5a51e2[_0x8866('0x27')][_0x8866('0x28')]);return _0x8c1c8d(_0x5a51e2[_0x8866('0x27')][_0x8866('0x28')]);}logger[_0x8866('0x27')]('ZendeskAccount,\x20%s,\x20%s',_0x4ad0cc,_0x5a51e2['error'][_0x8866('0x28')]);return _0x5c8c98(_0x5a51e2[_0x8866('0x27')][_0x8866('0x28')]);}else{logger[_0x8866('0x21')]('ZendeskAccount,\x20%s,\x20%s',_0x4ad0cc,'request\x20sent');_0x5c8c98(_0x5a51e2[_0x8866('0x29')][_0x8866('0x28')]);}})[_0x8866('0x2a')](function(_0x15c4f2){logger[_0x8866('0x27')]('ZendeskAccount,\x20%s,\x20%s',_0x4ad0cc,_0x15c4f2);_0x8c1c8d(_0x15c4f2);});});}function respondWithStatusCode(_0x3a91b1,_0x10379f){_0x10379f=_0x10379f||0xcc;return function(_0x55cd68){if(_0x55cd68){return _0x3a91b1[_0x8866('0x2b')](_0x10379f);}return _0x3a91b1[_0x8866('0x2c')](_0x10379f)['end']();};}function respondWithResult(_0xce1c94,_0x5542cb){_0x5542cb=_0x5542cb||0xc8;return function(_0x532514){if(_0x532514){return _0xce1c94['status'](_0x5542cb)[_0x8866('0x2d')](_0x532514);}};}function respondWithFilteredResult(_0x3db72b,_0x22f628){return function(_0x6b3aa6){if(_0x6b3aa6){var _0x5cde89=_0x6b3aa6[_0x8866('0x2e')],_0x4e4167=_0x22f628[_0x8866('0x2f')],_0x588eba=_0x22f628[_0x8866('0x2f')]+_0x22f628['limit'],_0x3384ef;if(_0x588eba>=_0x5cde89){_0x588eba=_0x5cde89;_0x3384ef=0xc8;}else{_0x3384ef=0xce;}_0x3db72b[_0x8866('0x2c')](_0x3384ef);return _0x3db72b[_0x8866('0x30')](_0x8866('0x31'),_0x4e4167+'-'+_0x588eba+'/'+_0x5cde89)[_0x8866('0x2d')](_0x6b3aa6);}return null;};}function patchUpdates(_0x127a72){return function(_0x5d99fa){try{jsonpatch[_0x8866('0x32')](_0x5d99fa,_0x127a72,!![]);}catch(_0x379d59){return BPromise['reject'](_0x379d59);}return _0x5d99fa[_0x8866('0x33')]();};}function saveUpdates(_0x419a77,_0x3ff2ad){return function(_0x5dd28d){if(_0x5dd28d){return _0x5dd28d[_0x8866('0x34')](_0x419a77)[_0x8866('0x20')](function(_0x15e51e){return _0x15e51e;});}return null;};}function removeEntity(_0x5b6a72,_0x23cd41){return function(_0x430524){if(_0x430524){return _0x430524[_0x8866('0x35')]()[_0x8866('0x20')](function(){_0x5b6a72[_0x8866('0x2c')](0xcc)[_0x8866('0x36')]();});}};}function handleEntityNotFound(_0x23f3c2,_0x2d0a4a){return function(_0x49bc1e){if(!_0x49bc1e){_0x23f3c2['sendStatus'](0x194);}return _0x49bc1e;};}function handleError(_0x4b249b,_0xdd2d07){_0xdd2d07=_0xdd2d07||0x1f4;return function(_0x4d6a6f){logger['error'](_0x4d6a6f[_0x8866('0x37')]);if(_0x4d6a6f[_0x8866('0x38')]){delete _0x4d6a6f[_0x8866('0x38')];}_0x4b249b[_0x8866('0x2c')](_0xdd2d07)[_0x8866('0x39')](_0x4d6a6f);};}exports[_0x8866('0x3a')]=function(_0x4c5a36,_0x597b7e){var _0x3b8a3c={},_0x601baf={},_0x318b7a={'count':0x0,'rows':[]};var _0x39a46b=_[_0x8866('0x3b')](db[_0x8866('0x3c')]['rawAttributes'],function(_0xef0aae){return{'name':_0xef0aae[_0x8866('0x3d')],'type':_0xef0aae[_0x8866('0x3e')][_0x8866('0x3f')]};});_0x601baf['model']=_[_0x8866('0x3b')](_0x39a46b,_0x8866('0x38'));_0x601baf['query']=_[_0x8866('0x40')](_0x4c5a36[_0x8866('0x41')]);_0x601baf[_0x8866('0x42')]=_['intersection'](_0x601baf[_0x8866('0x43')],_0x601baf['query']);_0x3b8a3c[_0x8866('0x44')]=_[_0x8866('0x45')](_0x601baf[_0x8866('0x43')],qs[_0x8866('0x46')](_0x4c5a36[_0x8866('0x41')][_0x8866('0x46')]));_0x3b8a3c[_0x8866('0x44')]=_0x3b8a3c[_0x8866('0x44')][_0x8866('0x47')]?_0x3b8a3c[_0x8866('0x44')]:_0x601baf[_0x8866('0x43')];if(!_0x4c5a36[_0x8866('0x41')][_0x8866('0x48')](_0x8866('0x49'))){_0x3b8a3c[_0x8866('0x4a')]=qs[_0x8866('0x4a')](_0x4c5a36[_0x8866('0x41')]['limit']);_0x3b8a3c[_0x8866('0x2f')]=qs[_0x8866('0x2f')](_0x4c5a36[_0x8866('0x41')][_0x8866('0x2f')]);}_0x3b8a3c[_0x8866('0x4b')]=qs[_0x8866('0x4c')](_0x4c5a36['query']['sort']);_0x3b8a3c['where']=qs[_0x8866('0x42')](_[_0x8866('0x4d')](_0x4c5a36[_0x8866('0x41')],_0x601baf[_0x8866('0x42')]),_0x39a46b);if(_0x4c5a36[_0x8866('0x41')][_0x8866('0x4e')]){_0x3b8a3c[_0x8866('0x4f')]=_[_0x8866('0x50')](_0x3b8a3c[_0x8866('0x4f')],{'$or':_[_0x8866('0x3b')](_0x39a46b,function(_0x435f3d){if(_0x435f3d[_0x8866('0x3e')]!==_0x8866('0x51')){var _0x2c335b={};_0x2c335b[_0x435f3d[_0x8866('0x38')]]={'$like':'%'+_0x4c5a36[_0x8866('0x41')][_0x8866('0x4e')]+'%'};return _0x2c335b;}})});}_0x3b8a3c=_[_0x8866('0x50')]({},_0x3b8a3c,_0x4c5a36['options']);var _0x4ae360={'where':_0x3b8a3c[_0x8866('0x4f')]};return db[_0x8866('0x3c')]['count'](_0x4ae360)[_0x8866('0x20')](function(_0x2531d1){_0x318b7a[_0x8866('0x2e')]=_0x2531d1;if(_0x4c5a36['query'][_0x8866('0x52')]){_0x3b8a3c['include']=[{'all':!![]}];}return db[_0x8866('0x3c')]['findAll'](_0x3b8a3c);})[_0x8866('0x20')](function(_0x1e7bee){_0x318b7a[_0x8866('0x53')]=_0x1e7bee;return _0x318b7a;})[_0x8866('0x20')](respondWithFilteredResult(_0x597b7e,_0x3b8a3c))[_0x8866('0x2a')](handleError(_0x597b7e,null));};exports[_0x8866('0x54')]=function(_0x473ba7,_0x1a777d){var _0x1a2569={'raw':![],'where':{'id':_0x473ba7['params']['id']}},_0x21ea7e={};_0x21ea7e[_0x8866('0x43')]=_[_0x8866('0x40')](db[_0x8866('0x3c')][_0x8866('0x55')]);_0x21ea7e[_0x8866('0x41')]=_[_0x8866('0x40')](_0x473ba7[_0x8866('0x41')]);_0x21ea7e[_0x8866('0x42')]=_[_0x8866('0x45')](_0x21ea7e['model'],_0x21ea7e[_0x8866('0x41')]);_0x1a2569[_0x8866('0x44')]=_[_0x8866('0x45')](_0x21ea7e[_0x8866('0x43')],qs[_0x8866('0x46')](_0x473ba7['query'][_0x8866('0x46')]));_0x1a2569[_0x8866('0x44')]=_0x1a2569['attributes'][_0x8866('0x47')]?_0x1a2569['attributes']:_0x21ea7e[_0x8866('0x43')];if(_0x473ba7[_0x8866('0x41')][_0x8866('0x52')]){_0x1a2569[_0x8866('0x56')]=[{'all':!![]}];}_0x1a2569=_['merge']({},_0x1a2569,_0x473ba7[_0x8866('0x57')]);return db[_0x8866('0x3c')][_0x8866('0x58')](_0x1a2569)[_0x8866('0x20')](handleEntityNotFound(_0x1a777d,null))[_0x8866('0x20')](respondWithResult(_0x1a777d,null))[_0x8866('0x2a')](handleError(_0x1a777d,null));};exports[_0x8866('0x59')]=function(_0x16579d,_0x2ae0ab){return db[_0x8866('0x3c')]['create'](_0x16579d[_0x8866('0x5a')],{})[_0x8866('0x20')](respondWithResult(_0x2ae0ab,0xc9))[_0x8866('0x2a')](handleError(_0x2ae0ab,null));};exports[_0x8866('0x34')]=function(_0x53f183,_0x57d765){if(_0x53f183[_0x8866('0x5a')]['id']){delete _0x53f183[_0x8866('0x5a')]['id'];}return db[_0x8866('0x3c')][_0x8866('0x58')]({'where':{'id':_0x53f183[_0x8866('0x5b')]['id']}})[_0x8866('0x20')](handleEntityNotFound(_0x57d765,null))['then'](saveUpdates(_0x53f183[_0x8866('0x5a')],null))[_0x8866('0x20')](respondWithResult(_0x57d765,null))[_0x8866('0x2a')](handleError(_0x57d765,null));};exports[_0x8866('0x35')]=function(_0x505fbe,_0x262372){return db['ZendeskAccount'][_0x8866('0x58')]({'where':{'id':_0x505fbe['params']['id']}})[_0x8866('0x20')](handleEntityNotFound(_0x262372,null))[_0x8866('0x20')](removeEntity(_0x262372,null))[_0x8866('0x2a')](handleError(_0x262372,null));};exports['getConfigurations']=function(_0x438550,_0x56e3db,_0xebafb8){var _0x487783={};var _0x34705d={};var _0x2061d8;var _0x5cfd21;return db[_0x8866('0x3c')][_0x8866('0x5c')]({'where':{'id':_0x438550[_0x8866('0x5b')]['id']}})[_0x8866('0x20')](handleEntityNotFound(_0x56e3db,null))[_0x8866('0x20')](function(_0x85178a){if(_0x85178a){_0x2061d8=_0x85178a;_0x34705d[_0x8866('0x43')]=_[_0x8866('0x40')](db[_0x8866('0x5d')][_0x8866('0x55')]);_0x34705d[_0x8866('0x41')]=_[_0x8866('0x40')](_0x438550['query']);_0x34705d[_0x8866('0x42')]=_[_0x8866('0x45')](_0x34705d['model'],_0x34705d[_0x8866('0x41')]);_0x487783[_0x8866('0x44')]=_[_0x8866('0x45')](_0x34705d[_0x8866('0x43')],qs['fields'](_0x438550['query'][_0x8866('0x46')]));_0x487783[_0x8866('0x44')]=_0x487783['attributes'][_0x8866('0x47')]?_0x487783[_0x8866('0x44')]:_0x34705d[_0x8866('0x43')];_0x487783['order']=qs['sort'](_0x438550[_0x8866('0x41')]['sort']);_0x487783[_0x8866('0x4f')]=qs['filters'](_['pick'](_0x438550[_0x8866('0x41')],_0x34705d[_0x8866('0x42')]));if(_0x438550['query'][_0x8866('0x4e')]){_0x487783[_0x8866('0x4f')]=_[_0x8866('0x50')](_0x487783['where'],{'$or':_['map'](_0x487783['attributes'],function(_0x37c975){var _0x5ec627={};_0x5ec627[_0x37c975]={'$like':'%'+_0x438550[_0x8866('0x41')][_0x8866('0x4e')]+'%'};return _0x5ec627;})});}_0x487783=_[_0x8866('0x50')]({},_0x487783,_0x438550[_0x8866('0x57')]);return _0x2061d8[_0x8866('0x5e')](_0x487783);}})[_0x8866('0x20')](function(_0x3a1cc5){if(_0x3a1cc5){_0x5cfd21=_0x3a1cc5['length'];if(!_0x438550[_0x8866('0x41')][_0x8866('0x48')](_0x8866('0x49'))){_0x487783[_0x8866('0x4a')]=qs[_0x8866('0x4a')](_0x438550[_0x8866('0x41')][_0x8866('0x4a')]);_0x487783[_0x8866('0x2f')]=qs[_0x8866('0x2f')](_0x438550[_0x8866('0x41')][_0x8866('0x2f')]);}return _0x2061d8[_0x8866('0x5e')](_0x487783);}})['then'](function(_0x427647){if(_0x427647){return _0x427647?{'count':_0x5cfd21,'rows':_0x427647}:null;}})[_0x8866('0x20')](respondWithResult(_0x56e3db,null))[_0x8866('0x2a')](handleError(_0x56e3db,null));};exports['addConfiguration']=function(_0x2d10e8,_0x192506,_0x35b00f){if(_0x2d10e8[_0x8866('0x5a')]['id']){delete _0x2d10e8['body']['id'];}return db[_0x8866('0x3c')][_0x8866('0x5c')]({'where':{'id':_0x2d10e8['params']['id']}})[_0x8866('0x20')](handleEntityNotFound(_0x192506,null))[_0x8866('0x20')](function(_0x1237ca){if(_0x1237ca){_0x2d10e8['body'][_0x8866('0x5f')]=_0x1237ca['id'];_0x2d10e8[_0x8866('0x5a')][_0x8866('0x60')]=integrations[_0x8866('0x61')](_0x2d10e8[_0x8866('0x5a')][_0x8866('0x62')],_0x2d10e8[_0x8866('0x5a')][_0x8866('0x3e')]);_0x2d10e8[_0x8866('0x5a')][_0x8866('0x63')]=integrations['getDescriptions'](_0x2d10e8['body'][_0x8866('0x62')],_0x2d10e8[_0x8866('0x5a')][_0x8866('0x3e')]);return db[_0x8866('0x5d')][_0x8866('0x59')](_0x2d10e8['body'],{'include':[{'model':db[_0x8866('0x64')],'as':'Subjects'},{'model':db[_0x8866('0x64')],'as':'Descriptions'}]});}return null;})[_0x8866('0x20')](respondWithResult(_0x192506,null))['catch'](handleError(_0x192506,null));};exports[_0x8866('0x65')]=function(_0x166e0e,_0xf28120,_0x1b98da){var _0x2e3266='';return db[_0x8866('0x3c')][_0x8866('0x5c')]({'where':{'id':_0x166e0e['params']['id']},'attributes':['id',_0x8866('0x66'),_0x8866('0x67'),_0x8866('0x68'),'authType',_0x8866('0x69')]})[_0x8866('0x20')](handleEntityNotFound(_0xf28120,null))[_0x8866('0x20')](function(_0x476135){if(_0x476135){_0x2e3266=_0x476135[_0x8866('0x69')];var _0x2a8d3e=_0x2e3266[_0x8866('0x6a')](-0x1);if(_0x2a8d3e==='/'){_0x2e3266=_0x2e3266[_0x8866('0x6b')](0x0,_0x2e3266['lastIndexOf'](_0x2a8d3e));}var _0x193e1d={'method':_0x8866('0x6c'),'uri':util[_0x8866('0x6d')](_0x8866('0x6e'),_0x2e3266,'ticket_fields'),'json':!![]};switch(_0x476135[_0x8866('0x6f')]){case _0x8866('0x67'):_0x193e1d[_0x8866('0x70')]={'Authorization':util[_0x8866('0x6d')](_0x8866('0x71'),new Buffer(util['format']('%s:%s',_0x476135[_0x8866('0x66')],_0x476135['password']))['toString']('base64'))};break;case _0x8866('0x68'):_0x193e1d[_0x8866('0x70')]={'Authorization':util[_0x8866('0x6d')](_0x8866('0x71'),new Buffer(util[_0x8866('0x6d')](_0x8866('0x72'),_0x476135[_0x8866('0x66')],_0x476135[_0x8866('0x68')]))[_0x8866('0x73')](_0x8866('0x74')))};break;default:throw new db[(_0x8866('0x1c'))][(_0x8866('0x1d'))]('Unknown\x20authentication\x20type');}return rp(_0x193e1d);}})['then'](function(_0x3a7371){if(_0x3a7371){var _0x4a13f6=['subject',_0x8866('0x75'),'group',_0x8866('0x76')];_[_0x8866('0x77')](_0x3a7371[_0x8866('0x78')],function(_0x157c04){return _0x4a13f6[_0x8866('0x79')](_0x157c04['type']);});return{'count':_0x3a7371[_0x8866('0x78')][_0x8866('0x47')],'rows':_['map'](_0x3a7371[_0x8866('0x78')],function(_0x4d96eb){return{'id':_0x4d96eb['id'],'name':_0x4d96eb[_0x8866('0x7a')]>0x7?_0x4d96eb['title']:_0x4d96eb[_0x8866('0x3e')],'custom':_0x4d96eb['position']>0x7?!![]:![],'options':_0x4d96eb[_0x8866('0x7b')]?_0x4d96eb[_0x8866('0x7b')]:_0x4d96eb[_0x8866('0x7c')]?_0x4d96eb[_0x8866('0x7c')]:[]};})};}})[_0x8866('0x20')](respondWithResult(_0xf28120,null))[_0x8866('0x2a')](function(_0x351cb3){var _0x5700e6=_0x166e0e[_0x8866('0x41')]['test']?0x1f4:_0x351cb3[_0x8866('0x7d')]||0x1f4;logger[_0x8866('0x27')](_0x8866('0x7e'),_0x8866('0x65'),_0x5700e6,JSON[_0x8866('0x26')](_0x351cb3));delete _0x351cb3[_0x8866('0x38')];if(_0x5700e6===0x191){_0x5700e6=0x190;}_0xf28120['status'](_0x5700e6)[_0x8866('0x39')](_0x166e0e[_0x8866('0x41')][_0x8866('0x1b')]?{'message':_0x8866('0x7f'),'statusCode':_0x351cb3[_0x8866('0x7d')]}:_0x351cb3);});}; \ No newline at end of file +var _0x0f48=['info','result','sendStatus','status','json','offset','limit','Content-Range','reject','save','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','order','sort','where','filters','pick','merge','filter','options','count','includeAll','include','ZendeskAccount','findAll','rows','params','length','find','create','update','body','catch','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','token','authType','remoteUri','slice','substring','GET','ticket_fields','password','headers','Basic\x20%s','format','toString','base64','%s/token:%s','username','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','title','system_field_options','custom_field_options','statusCode','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','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~!@#$%^&-_=+[{]}.','then','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message'];(function(_0x5e7617,_0xbd51f9){var _0x2b260e=function(_0xfa3a48){while(--_0xfa3a48){_0x5e7617['push'](_0x5e7617['shift']());}};_0x2b260e(++_0xbd51f9);}(_0x0f48,0x1ca));var _0x80f4=function(_0x46c210,_0x512eb5){_0x46c210=_0x46c210-0x0;var _0x88e123=_0x0f48[_0x46c210];return _0x88e123;};'use strict';var pdf=require(_0x80f4('0x0'));var emlformat=require(_0x80f4('0x1'));var rimraf=require(_0x80f4('0x2'));var zipdir=require(_0x80f4('0x3'));var jsonpatch=require(_0x80f4('0x4'));var rp=require('request-promise');var moment=require(_0x80f4('0x5'));var BPromise=require(_0x80f4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x80f4('0x7'));var sox=require(_0x80f4('0x8'));var csv=require('to-csv');var ejs=require(_0x80f4('0x9'));var fs=require('fs');var _=require(_0x80f4('0xa'));var squel=require('squel');var crypto=require(_0x80f4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x80f4('0xc'));var toCsv=require(_0x80f4('0xd'));var querystring=require(_0x80f4('0xe'));var Papa=require(_0x80f4('0xf'));var Redis=require(_0x80f4('0x10'));var authService=require(_0x80f4('0x11'));var qs=require(_0x80f4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x80f4('0x13'));var logger=require(_0x80f4('0x14'))('api');var utils=require(_0x80f4('0x15'));var config=require(_0x80f4('0x16'));var db=require(_0x80f4('0x17'))['db'];var integrations=require(_0x80f4('0x18'));var jayson=require('jayson/promise');var client=jayson[_0x80f4('0x19')][_0x80f4('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x299270,_0xee538,_0x1f65d1){if(_0x1f65d1){var _0x81842e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x81842e[_0x80f4('0x1b')](_0xee538)){return _0x299270;}else{throw new db['Sequelize']['ValidationError'](_0x80f4('0x1c'));}}else{return _0x299270;}}function respondWithRpcPromise(_0x26624a,_0x47829e,_0x298f12,_0x34f9e1){return new BPromise(function(_0x2fa8ce,_0x2cb1ce){var _0x32f54e=_0x34f9e1||client;return _0x32f54e['request'](_0x26624a,_0x298f12)[_0x80f4('0x1d')](function(_0x40a133){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x47829e,'request\x20sent');logger[_0x80f4('0x1e')](_0x80f4('0x1f'),_0x47829e,_0x80f4('0x20'),JSON[_0x80f4('0x21')](_0x40a133));if(_0x40a133[_0x80f4('0x22')]){if(_0x40a133[_0x80f4('0x22')][_0x80f4('0x23')]===0x1f4){logger[_0x80f4('0x22')](_0x80f4('0x24'),_0x47829e,_0x40a133[_0x80f4('0x22')][_0x80f4('0x25')]);return _0x2cb1ce(_0x40a133[_0x80f4('0x22')][_0x80f4('0x25')]);}logger[_0x80f4('0x22')]('ZendeskAccount,\x20%s,\x20%s',_0x47829e,_0x40a133[_0x80f4('0x22')][_0x80f4('0x25')]);return _0x2fa8ce(_0x40a133[_0x80f4('0x22')][_0x80f4('0x25')]);}else{logger[_0x80f4('0x26')](_0x80f4('0x24'),_0x47829e,_0x80f4('0x20'));_0x2fa8ce(_0x40a133[_0x80f4('0x27')]['message']);}})['catch'](function(_0xc50d8b){logger[_0x80f4('0x22')](_0x80f4('0x24'),_0x47829e,_0xc50d8b);_0x2cb1ce(_0xc50d8b);});});}function respondWithStatusCode(_0x6a12d,_0x3504ba){_0x3504ba=_0x3504ba||0xcc;return function(_0x2e37ff){if(_0x2e37ff){return _0x6a12d[_0x80f4('0x28')](_0x3504ba);}return _0x6a12d[_0x80f4('0x29')](_0x3504ba)['end']();};}function respondWithResult(_0x156daf,_0x4731c0){_0x4731c0=_0x4731c0||0xc8;return function(_0x5ee532){if(_0x5ee532){return _0x156daf[_0x80f4('0x29')](_0x4731c0)[_0x80f4('0x2a')](_0x5ee532);}};}function respondWithFilteredResult(_0x1f0361,_0x5280a8){return function(_0x38bc4a){if(_0x38bc4a){var _0x5572bb=_0x38bc4a['count'],_0x44b8a5=_0x5280a8[_0x80f4('0x2b')],_0x5d5b1c=_0x5280a8[_0x80f4('0x2b')]+_0x5280a8[_0x80f4('0x2c')],_0x49d92d;if(_0x5d5b1c>=_0x5572bb){_0x5d5b1c=_0x5572bb;_0x49d92d=0xc8;}else{_0x49d92d=0xce;}_0x1f0361['status'](_0x49d92d);return _0x1f0361['set'](_0x80f4('0x2d'),_0x44b8a5+'-'+_0x5d5b1c+'/'+_0x5572bb)['json'](_0x38bc4a);}return null;};}function patchUpdates(_0x49381e){return function(_0x45426e){try{jsonpatch['apply'](_0x45426e,_0x49381e,!![]);}catch(_0xd1e691){return BPromise[_0x80f4('0x2e')](_0xd1e691);}return _0x45426e[_0x80f4('0x2f')]();};}function saveUpdates(_0x136f84,_0x2d6ac4){return function(_0x475d83){if(_0x475d83){return _0x475d83['update'](_0x136f84)[_0x80f4('0x1d')](function(_0x4ba210){return _0x4ba210;});}return null;};}function removeEntity(_0x17b112,_0x5bf491){return function(_0x567232){if(_0x567232){return _0x567232[_0x80f4('0x30')]()[_0x80f4('0x1d')](function(){_0x17b112['status'](0xcc)[_0x80f4('0x31')]();});}};}function handleEntityNotFound(_0x21223f,_0x5f19fd){return function(_0x5d5df6){if(!_0x5d5df6){_0x21223f['sendStatus'](0x194);}return _0x5d5df6;};}function handleError(_0x44179f,_0x539101){_0x539101=_0x539101||0x1f4;return function(_0xd1e95){logger[_0x80f4('0x22')](_0xd1e95[_0x80f4('0x32')]);if(_0xd1e95[_0x80f4('0x33')]){delete _0xd1e95[_0x80f4('0x33')];}_0x44179f[_0x80f4('0x29')](_0x539101)[_0x80f4('0x34')](_0xd1e95);};}exports[_0x80f4('0x35')]=function(_0x5d33e5,_0x48231b){var _0x12f942={},_0x4a7c63={},_0x455a65={'count':0x0,'rows':[]};var _0x4431d3=_[_0x80f4('0x36')](db['ZendeskAccount'][_0x80f4('0x37')],function(_0x3b49eb){return{'name':_0x3b49eb[_0x80f4('0x38')],'type':_0x3b49eb[_0x80f4('0x39')]['key']};});_0x4a7c63[_0x80f4('0x3a')]=_[_0x80f4('0x36')](_0x4431d3,_0x80f4('0x33'));_0x4a7c63[_0x80f4('0x3b')]=_[_0x80f4('0x3c')](_0x5d33e5[_0x80f4('0x3b')]);_0x4a7c63['filters']=_['intersection'](_0x4a7c63[_0x80f4('0x3a')],_0x4a7c63['query']);_0x12f942[_0x80f4('0x3d')]=_[_0x80f4('0x3e')](_0x4a7c63[_0x80f4('0x3a')],qs[_0x80f4('0x3f')](_0x5d33e5[_0x80f4('0x3b')][_0x80f4('0x3f')]));_0x12f942[_0x80f4('0x3d')]=_0x12f942['attributes']['length']?_0x12f942[_0x80f4('0x3d')]:_0x4a7c63[_0x80f4('0x3a')];if(!_0x5d33e5[_0x80f4('0x3b')]['hasOwnProperty']('nolimit')){_0x12f942[_0x80f4('0x2c')]=qs[_0x80f4('0x2c')](_0x5d33e5['query'][_0x80f4('0x2c')]);_0x12f942[_0x80f4('0x2b')]=qs[_0x80f4('0x2b')](_0x5d33e5[_0x80f4('0x3b')]['offset']);}_0x12f942[_0x80f4('0x40')]=qs['sort'](_0x5d33e5[_0x80f4('0x3b')][_0x80f4('0x41')]);_0x12f942[_0x80f4('0x42')]=qs[_0x80f4('0x43')](_[_0x80f4('0x44')](_0x5d33e5[_0x80f4('0x3b')],_0x4a7c63[_0x80f4('0x43')]),_0x4431d3);if(_0x5d33e5[_0x80f4('0x3b')]['filter']){_0x12f942['where']=_[_0x80f4('0x45')](_0x12f942[_0x80f4('0x42')],{'$or':_[_0x80f4('0x36')](_0x4431d3,function(_0x11e2cf){if(_0x11e2cf[_0x80f4('0x39')]!=='VIRTUAL'){var _0x318680={};_0x318680[_0x11e2cf[_0x80f4('0x33')]]={'$like':'%'+_0x5d33e5[_0x80f4('0x3b')][_0x80f4('0x46')]+'%'};return _0x318680;}})});}_0x12f942=_[_0x80f4('0x45')]({},_0x12f942,_0x5d33e5[_0x80f4('0x47')]);var _0x52380d={'where':_0x12f942[_0x80f4('0x42')]};return db['ZendeskAccount'][_0x80f4('0x48')](_0x52380d)['then'](function(_0x4d82c6){_0x455a65[_0x80f4('0x48')]=_0x4d82c6;if(_0x5d33e5['query'][_0x80f4('0x49')]){_0x12f942[_0x80f4('0x4a')]=[{'all':!![]}];}return db[_0x80f4('0x4b')][_0x80f4('0x4c')](_0x12f942);})[_0x80f4('0x1d')](function(_0x14e392){_0x455a65[_0x80f4('0x4d')]=_0x14e392;return _0x455a65;})[_0x80f4('0x1d')](respondWithFilteredResult(_0x48231b,_0x12f942))['catch'](handleError(_0x48231b,null));};exports['show']=function(_0x1550cb,_0x19d3e4){var _0x13cdd1={'raw':![],'where':{'id':_0x1550cb[_0x80f4('0x4e')]['id']}},_0x462326={};_0x462326[_0x80f4('0x3a')]=_[_0x80f4('0x3c')](db[_0x80f4('0x4b')][_0x80f4('0x37')]);_0x462326[_0x80f4('0x3b')]=_['keys'](_0x1550cb['query']);_0x462326[_0x80f4('0x43')]=_[_0x80f4('0x3e')](_0x462326['model'],_0x462326[_0x80f4('0x3b')]);_0x13cdd1[_0x80f4('0x3d')]=_[_0x80f4('0x3e')](_0x462326[_0x80f4('0x3a')],qs[_0x80f4('0x3f')](_0x1550cb[_0x80f4('0x3b')]['fields']));_0x13cdd1[_0x80f4('0x3d')]=_0x13cdd1[_0x80f4('0x3d')][_0x80f4('0x4f')]?_0x13cdd1[_0x80f4('0x3d')]:_0x462326[_0x80f4('0x3a')];if(_0x1550cb['query'][_0x80f4('0x49')]){_0x13cdd1[_0x80f4('0x4a')]=[{'all':!![]}];}_0x13cdd1=_[_0x80f4('0x45')]({},_0x13cdd1,_0x1550cb[_0x80f4('0x47')]);return db[_0x80f4('0x4b')][_0x80f4('0x50')](_0x13cdd1)[_0x80f4('0x1d')](handleEntityNotFound(_0x19d3e4,null))[_0x80f4('0x1d')](respondWithResult(_0x19d3e4,null))['catch'](handleError(_0x19d3e4,null));};exports[_0x80f4('0x51')]=function(_0xfbe74,_0x3a4e41){return db[_0x80f4('0x4b')][_0x80f4('0x51')](_0xfbe74['body'],{})['then'](respondWithResult(_0x3a4e41,0xc9))['catch'](handleError(_0x3a4e41,null));};exports[_0x80f4('0x52')]=function(_0x52bbb0,_0x56834f){if(_0x52bbb0[_0x80f4('0x53')]['id']){delete _0x52bbb0[_0x80f4('0x53')]['id'];}return db[_0x80f4('0x4b')][_0x80f4('0x50')]({'where':{'id':_0x52bbb0[_0x80f4('0x4e')]['id']}})[_0x80f4('0x1d')](handleEntityNotFound(_0x56834f,null))['then'](saveUpdates(_0x52bbb0['body'],null))[_0x80f4('0x1d')](respondWithResult(_0x56834f,null))['catch'](handleError(_0x56834f,null));};exports[_0x80f4('0x30')]=function(_0x4adc23,_0x14fcec){return db[_0x80f4('0x4b')][_0x80f4('0x50')]({'where':{'id':_0x4adc23[_0x80f4('0x4e')]['id']}})[_0x80f4('0x1d')](handleEntityNotFound(_0x14fcec,null))[_0x80f4('0x1d')](removeEntity(_0x14fcec,null))[_0x80f4('0x54')](handleError(_0x14fcec,null));};exports[_0x80f4('0x55')]=function(_0x5b8374,_0x276b23,_0x9dbe7){var _0x47fa43={};var _0x4f33a9={};var _0x35e37d;var _0x4553f8;return db[_0x80f4('0x4b')][_0x80f4('0x56')]({'where':{'id':_0x5b8374[_0x80f4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x276b23,null))['then'](function(_0x1641ff){if(_0x1641ff){_0x35e37d=_0x1641ff;_0x4f33a9[_0x80f4('0x3a')]=_[_0x80f4('0x3c')](db[_0x80f4('0x57')][_0x80f4('0x37')]);_0x4f33a9[_0x80f4('0x3b')]=_['keys'](_0x5b8374[_0x80f4('0x3b')]);_0x4f33a9[_0x80f4('0x43')]=_['intersection'](_0x4f33a9[_0x80f4('0x3a')],_0x4f33a9[_0x80f4('0x3b')]);_0x47fa43[_0x80f4('0x3d')]=_[_0x80f4('0x3e')](_0x4f33a9[_0x80f4('0x3a')],qs[_0x80f4('0x3f')](_0x5b8374['query'][_0x80f4('0x3f')]));_0x47fa43[_0x80f4('0x3d')]=_0x47fa43[_0x80f4('0x3d')][_0x80f4('0x4f')]?_0x47fa43[_0x80f4('0x3d')]:_0x4f33a9[_0x80f4('0x3a')];_0x47fa43[_0x80f4('0x40')]=qs[_0x80f4('0x41')](_0x5b8374[_0x80f4('0x3b')][_0x80f4('0x41')]);_0x47fa43[_0x80f4('0x42')]=qs[_0x80f4('0x43')](_['pick'](_0x5b8374[_0x80f4('0x3b')],_0x4f33a9['filters']));if(_0x5b8374[_0x80f4('0x3b')][_0x80f4('0x46')]){_0x47fa43[_0x80f4('0x42')]=_[_0x80f4('0x45')](_0x47fa43[_0x80f4('0x42')],{'$or':_['map'](_0x47fa43[_0x80f4('0x3d')],function(_0x2a0002){var _0x16f2d1={};_0x16f2d1[_0x2a0002]={'$like':'%'+_0x5b8374[_0x80f4('0x3b')][_0x80f4('0x46')]+'%'};return _0x16f2d1;})});}_0x47fa43=_[_0x80f4('0x45')]({},_0x47fa43,_0x5b8374[_0x80f4('0x47')]);return _0x35e37d['getConfigurations'](_0x47fa43);}})[_0x80f4('0x1d')](function(_0x5bd721){if(_0x5bd721){_0x4553f8=_0x5bd721['length'];if(!_0x5b8374[_0x80f4('0x3b')][_0x80f4('0x58')]('nolimit')){_0x47fa43[_0x80f4('0x2c')]=qs[_0x80f4('0x2c')](_0x5b8374[_0x80f4('0x3b')][_0x80f4('0x2c')]);_0x47fa43[_0x80f4('0x2b')]=qs[_0x80f4('0x2b')](_0x5b8374[_0x80f4('0x3b')]['offset']);}return _0x35e37d[_0x80f4('0x55')](_0x47fa43);}})[_0x80f4('0x1d')](function(_0x2bda54){if(_0x2bda54){return _0x2bda54?{'count':_0x4553f8,'rows':_0x2bda54}:null;}})['then'](respondWithResult(_0x276b23,null))['catch'](handleError(_0x276b23,null));};exports['addConfiguration']=function(_0x251d5b,_0x27c950,_0x52e1d1){if(_0x251d5b[_0x80f4('0x53')]['id']){delete _0x251d5b['body']['id'];}return db[_0x80f4('0x4b')][_0x80f4('0x56')]({'where':{'id':_0x251d5b['params']['id']}})[_0x80f4('0x1d')](handleEntityNotFound(_0x27c950,null))[_0x80f4('0x1d')](function(_0x255d19){if(_0x255d19){_0x251d5b[_0x80f4('0x53')][_0x80f4('0x59')]=_0x255d19['id'];_0x251d5b[_0x80f4('0x53')][_0x80f4('0x5a')]=integrations['getSubjects'](_0x251d5b[_0x80f4('0x53')][_0x80f4('0x5b')],_0x251d5b[_0x80f4('0x53')][_0x80f4('0x39')]);_0x251d5b[_0x80f4('0x53')][_0x80f4('0x5c')]=integrations[_0x80f4('0x5d')](_0x251d5b[_0x80f4('0x53')]['channel'],_0x251d5b[_0x80f4('0x53')][_0x80f4('0x39')]);return db['ZendeskConfiguration']['create'](_0x251d5b[_0x80f4('0x53')],{'include':[{'model':db['ZendeskField'],'as':_0x80f4('0x5a')},{'model':db[_0x80f4('0x5e')],'as':_0x80f4('0x5c')}]});}return null;})[_0x80f4('0x1d')](respondWithResult(_0x27c950,null))[_0x80f4('0x54')](handleError(_0x27c950,null));};exports[_0x80f4('0x5f')]=function(_0x5bff66,_0x170825,_0x28a713){var _0x2ce820='';return db[_0x80f4('0x4b')][_0x80f4('0x56')]({'where':{'id':_0x5bff66[_0x80f4('0x4e')]['id']},'attributes':['id','username','password',_0x80f4('0x60'),_0x80f4('0x61'),_0x80f4('0x62')]})['then'](handleEntityNotFound(_0x170825,null))[_0x80f4('0x1d')](function(_0x93e8b9){if(_0x93e8b9){_0x2ce820=_0x93e8b9['remoteUri'];var _0x383ece=_0x2ce820[_0x80f4('0x63')](-0x1);if(_0x383ece==='/'){_0x2ce820=_0x2ce820[_0x80f4('0x64')](0x0,_0x2ce820['lastIndexOf'](_0x383ece));}var _0x1e8630={'method':_0x80f4('0x65'),'uri':util['format']('%s/%s',_0x2ce820,_0x80f4('0x66')),'json':!![]};switch(_0x93e8b9[_0x80f4('0x61')]){case _0x80f4('0x67'):_0x1e8630[_0x80f4('0x68')]={'Authorization':util['format'](_0x80f4('0x69'),new Buffer(util[_0x80f4('0x6a')]('%s:%s',_0x93e8b9['username'],_0x93e8b9[_0x80f4('0x67')]))[_0x80f4('0x6b')](_0x80f4('0x6c')))};break;case _0x80f4('0x60'):_0x1e8630['headers']={'Authorization':util['format'](_0x80f4('0x69'),new Buffer(util['format'](_0x80f4('0x6d'),_0x93e8b9[_0x80f4('0x6e')],_0x93e8b9[_0x80f4('0x60')]))['toString'](_0x80f4('0x6c')))};break;default:throw new db[(_0x80f4('0x6f'))][(_0x80f4('0x70'))](_0x80f4('0x71'));}return rp(_0x1e8630);}})[_0x80f4('0x1d')](function(_0x3e329c){if(_0x3e329c){var _0x43f45e=[_0x80f4('0x72'),_0x80f4('0x73'),_0x80f4('0x74'),'assignee'];_[_0x80f4('0x75')](_0x3e329c[_0x80f4('0x66')],function(_0x426cf5){return _0x43f45e[_0x80f4('0x76')](_0x426cf5[_0x80f4('0x39')]);});return{'count':_0x3e329c['ticket_fields'][_0x80f4('0x4f')],'rows':_[_0x80f4('0x36')](_0x3e329c['ticket_fields'],function(_0x480039){return{'id':_0x480039['id'],'name':_0x480039[_0x80f4('0x77')]>0x7?_0x480039[_0x80f4('0x78')]:_0x480039[_0x80f4('0x39')],'custom':_0x480039[_0x80f4('0x77')]>0x7?!![]:![],'options':_0x480039[_0x80f4('0x79')]?_0x480039[_0x80f4('0x79')]:_0x480039[_0x80f4('0x7a')]?_0x480039[_0x80f4('0x7a')]:[]};})};}})[_0x80f4('0x1d')](respondWithResult(_0x170825,null))[_0x80f4('0x54')](function(_0x344397){var _0x3c46ee=_0x5bff66[_0x80f4('0x3b')][_0x80f4('0x1b')]?0x1f4:_0x344397[_0x80f4('0x7b')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x80f4('0x5f'),_0x3c46ee,JSON[_0x80f4('0x21')](_0x344397));delete _0x344397[_0x80f4('0x33')];if(_0x3c46ee===0x191){_0x3c46ee=0x190;}_0x170825['status'](_0x3c46ee)['send'](_0x5bff66[_0x80f4('0x3b')][_0x80f4('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0x344397[_0x80f4('0x7b')]}:_0x344397);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index e4d28cf..9fc4d94 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 _0x4f71=['bluebird','request-promise','path','rimraf','../../config/environment','define','ZendeskAccount','lodash','util','../../config/logger','moment'];(function(_0x6bc19e,_0x3be317){var _0x11996f=function(_0x3bcec6){while(--_0x3bcec6){_0x6bc19e['push'](_0x6bc19e['shift']());}};_0x11996f(++_0x3be317);}(_0x4f71,0xf9));var _0x14f7=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x4f71[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0x14f7('0x0'));var util=require(_0x14f7('0x1'));var logger=require(_0x14f7('0x2'))('api');var moment=require(_0x14f7('0x3'));var BPromise=require(_0x14f7('0x4'));var rp=require(_0x14f7('0x5'));var fs=require('fs');var path=require(_0x14f7('0x6'));var rimraf=require(_0x14f7('0x7'));var config=require(_0x14f7('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x44b162,_0x2aea20){return _0x44b162[_0x14f7('0x9')](_0x14f7('0xa'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd319=['../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes'];(function(_0x5df25b,_0x1bc928){var _0x19f252=function(_0x41de28){while(--_0x41de28){_0x5df25b['push'](_0x5df25b['shift']());}};_0x19f252(++_0x1bc928);}(_0xd319,0x79));var _0x9d31=function(_0x3c30ed,_0x5e3dc5){_0x3c30ed=_0x3c30ed-0x0;var _0x5eb035=_0xd319[_0x3c30ed];return _0x5eb035;};'use strict';var _=require(_0x9d31('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9d31('0x1'));var moment=require(_0x9d31('0x2'));var BPromise=require(_0x9d31('0x3'));var rp=require(_0x9d31('0x4'));var fs=require('fs');var path=require(_0x9d31('0x5'));var rimraf=require(_0x9d31('0x6'));var config=require(_0x9d31('0x7'));var attributes=require(_0x9d31('0x8'));var integrations=require(_0x9d31('0x9'));module['exports']=function(_0x2774ea,_0x67021e){return _0x2774ea[_0x9d31('0xa')](_0x9d31('0xb'),attributes,{'tableName':_0x9d31('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index a967fbd..2d4a3cc 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 _0xbaf0=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','model','map','ShowZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x43a5c7,_0x2286bf){var _0x3b12a2=function(_0x1f8f53){while(--_0x1f8f53){_0x43a5c7['push'](_0x43a5c7['shift']());}};_0x3b12a2(++_0x2286bf);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetZendeskAccount',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowZendeskAccount',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});}; \ No newline at end of file +var _0xbaf0=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','model','map','ShowZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2f62aa,_0x108e95){var _0x1a341f=function(_0x3aedcf){while(--_0x3aedcf){_0x2f62aa['push'](_0x2f62aa['shift']());}};_0x1a341f(++_0x108e95);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetZendeskAccount',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowZendeskAccount',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 7f05be7..c45500a 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 _0x5dfd=['../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','destroy','exports','multer','util','path','../../components/auth/service','../../components/interaction/service'];(function(_0x3ef8f7,_0x35359a){var _0x3b097e=function(_0x189c92){while(--_0x189c92){_0x3ef8f7['push'](_0x3ef8f7['shift']());}};_0x3b097e(++_0x35359a);}(_0x5dfd,0x133));var _0xd5df=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x5dfd[_0x1d9aa0];return _0x226868;};'use strict';var multer=require(_0xd5df('0x0'));var util=require(_0xd5df('0x1'));var path=require(_0xd5df('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0xd5df('0x3'));var interaction=require(_0xd5df('0x4'));var config=require(_0xd5df('0x5'));var controller=require('./intZendeskConfiguration.controller');router[_0xd5df('0x6')]('/',auth[_0xd5df('0x7')](),controller[_0xd5df('0x8')]);router['get'](_0xd5df('0x9'),auth['isAuthenticated'](),controller[_0xd5df('0xa')]);router[_0xd5df('0x6')](_0xd5df('0xb'),auth[_0xd5df('0x7')](),controller['getFields']);router['get']('/:id/subjects',auth[_0xd5df('0x7')](),controller[_0xd5df('0xc')]);router[_0xd5df('0x6')](_0xd5df('0xd'),auth[_0xd5df('0x7')](),controller[_0xd5df('0xe')]);router[_0xd5df('0x6')](_0xd5df('0xf'),auth['isAuthenticated'](),controller[_0xd5df('0x10')]);router[_0xd5df('0x11')]('/',auth['isAuthenticated'](),controller[_0xd5df('0x12')]);router[_0xd5df('0x11')](_0xd5df('0xf'),auth[_0xd5df('0x7')](),controller[_0xd5df('0x13')]);router[_0xd5df('0x14')](_0xd5df('0x9'),auth[_0xd5df('0x7')](),controller[_0xd5df('0x15')]);router['delete']('/:id',auth[_0xd5df('0x7')](),controller[_0xd5df('0x16')]);module[_0xd5df('0x17')]=router; \ No newline at end of file +var _0xe018=['../../components/interaction/service','./intZendeskConfiguration.controller','isAuthenticated','get','/:id','/:id/fields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x540298,_0x24d10c){var _0x3bf667=function(_0x4f665d){while(--_0x4f665d){_0x540298['push'](_0x540298['shift']());}};_0x3bf667(++_0x24d10c);}(_0xe018,0x80));var _0x8e01=function(_0x33b4b9,_0x3bb9e1){_0x33b4b9=_0x33b4b9-0x0;var _0x5443da=_0xe018[_0x33b4b9];return _0x5443da;};'use strict';var multer=require(_0x8e01('0x0'));var util=require(_0x8e01('0x1'));var path=require('path');var timeout=require(_0x8e01('0x2'));var express=require(_0x8e01('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8e01('0x4'));var config=require('../../config/environment');var controller=require(_0x8e01('0x5'));router['get']('/',auth[_0x8e01('0x6')](),controller['index']);router[_0x8e01('0x7')](_0x8e01('0x8'),auth[_0x8e01('0x6')](),controller['show']);router[_0x8e01('0x7')](_0x8e01('0x9'),auth['isAuthenticated'](),controller['getFields']);router[_0x8e01('0x7')]('/:id/subjects',auth[_0x8e01('0x6')](),controller['getSubjects']);router['get'](_0x8e01('0xa'),auth[_0x8e01('0x6')](),controller[_0x8e01('0xb')]);router['get'](_0x8e01('0xc'),auth[_0x8e01('0x6')](),controller[_0x8e01('0xd')]);router[_0x8e01('0xe')]('/',auth[_0x8e01('0x6')](),controller[_0x8e01('0xf')]);router['post'](_0x8e01('0xc'),auth[_0x8e01('0x6')](),controller[_0x8e01('0x10')]);router[_0x8e01('0x11')](_0x8e01('0x8'),auth[_0x8e01('0x6')](),controller[_0x8e01('0x12')]);router[_0x8e01('0x13')](_0x8e01('0x8'),auth['isAuthenticated'](),controller[_0x8e01('0x14')]);module[_0x8e01('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 9533471..ad0e66d 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 _0x9bab=['exports','STRING','sequelize'];(function(_0x56dc8c,_0x1b15ca){var _0x166838=function(_0x30257a){while(--_0x30257a){_0x56dc8c['push'](_0x56dc8c['shift']());}};_0x166838(++_0x1b15ca);}(_0x9bab,0x107));var _0xb9ba=function(_0x22959e,_0x344358){_0x22959e=_0x22959e-0x0;var _0x385632=_0x9bab[_0x22959e];return _0x385632;};'use strict';var Sequelize=require(_0xb9ba('0x0'));module[_0xb9ba('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb9ba('0x2')]}}; \ No newline at end of file +var _0x8f35=['exports','STRING','sequelize'];(function(_0x3694f7,_0x309db2){var _0x1c5a95=function(_0x21990c){while(--_0x21990c){_0x3694f7['push'](_0x3694f7['shift']());}};_0x1c5a95(++_0x309db2);}(_0x8f35,0x158));var _0x58f3=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0x8f35[_0x58e469];return _0x4c01c5;};'use strict';var Sequelize=require(_0x58f3('0x0'));module[_0x58f3('0x1')]={'name':{'type':Sequelize[_0x58f3('0x2')]},'description':{'type':Sequelize[_0x58f3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index f762d79..2087da4 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 _0xcc27=['eml-format','rimraf','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','stringify','error','code','message','ZendeskConfiguration,\x20%s,\x20%s','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ZendeskConfiguration','include','findAll','show','params','includeAll','find','create','body','update','destroy','findOne','getFields','nolimit','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','html-pdf'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xcc27,0x17b));var _0x7cc2=function(_0x18cf8a,_0xcc5571){_0x18cf8a=_0x18cf8a-0x0;var _0x1f13c9=_0xcc27[_0x18cf8a];return _0x1f13c9;};'use strict';var pdf=require(_0x7cc2('0x0'));var emlformat=require(_0x7cc2('0x1'));var rimraf=require(_0x7cc2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7cc2('0x3'));var moment=require(_0x7cc2('0x4'));var BPromise=require(_0x7cc2('0x5'));var Mustache=require('mustache');var util=require(_0x7cc2('0x6'));var path=require('path');var sox=require(_0x7cc2('0x7'));var csv=require('to-csv');var ejs=require(_0x7cc2('0x8'));var fs=require('fs');var _=require(_0x7cc2('0x9'));var squel=require(_0x7cc2('0xa'));var crypto=require(_0x7cc2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7cc2('0xc'));var toCsv=require(_0x7cc2('0xd'));var querystring=require('querystring');var Papa=require(_0x7cc2('0xe'));var Redis=require(_0x7cc2('0xf'));var authService=require(_0x7cc2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7cc2('0x11'));var hardwareService=require(_0x7cc2('0x12'));var logger=require(_0x7cc2('0x13'))(_0x7cc2('0x14'));var utils=require(_0x7cc2('0x15'));var config=require('../../config/environment');var db=require(_0x7cc2('0x16'))['db'];var jayson=require(_0x7cc2('0x17'));var client=jayson['client'][_0x7cc2('0x18')]({'port':0x232a});function checkPasswordPattern(_0x20c1ec,_0x1c82ff,_0xf63796){if(_0xf63796){var _0x271bc9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x271bc9[_0x7cc2('0x19')](_0x1c82ff)){return _0x20c1ec;}else{throw new db['Sequelize'][(_0x7cc2('0x1a'))](_0x7cc2('0x1b'));}}else{return _0x20c1ec;}}function respondWithRpcPromise(_0x9bab5f,_0x3f903a,_0x43f551,_0x5d0cdc){return new BPromise(function(_0x1858cf,_0x2267a4){var _0x2016bb=_0x5d0cdc||client;return _0x2016bb[_0x7cc2('0x1c')](_0x9bab5f,_0x43f551)[_0x7cc2('0x1d')](function(_0x58192d){logger[_0x7cc2('0x1e')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3f903a,_0x7cc2('0x1f'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x3f903a,'request\x20sent',JSON[_0x7cc2('0x20')](_0x58192d));if(_0x58192d[_0x7cc2('0x21')]){if(_0x58192d['error'][_0x7cc2('0x22')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x3f903a,_0x58192d[_0x7cc2('0x21')]['message']);return _0x2267a4(_0x58192d[_0x7cc2('0x21')][_0x7cc2('0x23')]);}logger[_0x7cc2('0x21')](_0x7cc2('0x24'),_0x3f903a,_0x58192d[_0x7cc2('0x21')][_0x7cc2('0x23')]);return _0x1858cf(_0x58192d[_0x7cc2('0x21')][_0x7cc2('0x23')]);}else{logger[_0x7cc2('0x1e')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3f903a,_0x7cc2('0x1f'));_0x1858cf(_0x58192d['result']['message']);}})[_0x7cc2('0x25')](function(_0x3da726){logger['error'](_0x7cc2('0x24'),_0x3f903a,_0x3da726);_0x2267a4(_0x3da726);});});}function respondWithStatusCode(_0xd4650f,_0x213880){_0x213880=_0x213880||0xcc;return function(_0x19347c){if(_0x19347c){return _0xd4650f[_0x7cc2('0x26')](_0x213880);}return _0xd4650f[_0x7cc2('0x27')](_0x213880)[_0x7cc2('0x28')]();};}function respondWithResult(_0xc13085,_0x6d3c00){_0x6d3c00=_0x6d3c00||0xc8;return function(_0x10db3a){if(_0x10db3a){return _0xc13085['status'](_0x6d3c00)[_0x7cc2('0x29')](_0x10db3a);}};}function respondWithFilteredResult(_0x57bca6,_0x230992){return function(_0x2306ed){if(_0x2306ed){var _0x29aa39=_0x2306ed[_0x7cc2('0x2a')],_0x3fb005=_0x230992[_0x7cc2('0x2b')],_0x3acd2a=_0x230992['offset']+_0x230992[_0x7cc2('0x2c')],_0x12046f;if(_0x3acd2a>=_0x29aa39){_0x3acd2a=_0x29aa39;_0x12046f=0xc8;}else{_0x12046f=0xce;}_0x57bca6[_0x7cc2('0x27')](_0x12046f);return _0x57bca6[_0x7cc2('0x2d')](_0x7cc2('0x2e'),_0x3fb005+'-'+_0x3acd2a+'/'+_0x29aa39)['json'](_0x2306ed);}return null;};}function patchUpdates(_0x10f47b){return function(_0x2d2614){try{jsonpatch['apply'](_0x2d2614,_0x10f47b,!![]);}catch(_0x18f74c){return BPromise[_0x7cc2('0x2f')](_0x18f74c);}return _0x2d2614[_0x7cc2('0x30')]();};}function saveUpdates(_0x3cac31,_0x3c3fed){return function(_0x17a816){if(_0x17a816){return _0x17a816['update'](_0x3cac31)['then'](function(_0x297c9f){return _0x297c9f;});}return null;};}function removeEntity(_0x55a81a,_0x2d76a2){return function(_0x17d696){if(_0x17d696){return _0x17d696['destroy']()[_0x7cc2('0x1d')](function(){_0x55a81a[_0x7cc2('0x27')](0xcc)[_0x7cc2('0x28')]();});}};}function handleEntityNotFound(_0x5f111d,_0x142367){return function(_0x5a2f9b){if(!_0x5a2f9b){_0x5f111d[_0x7cc2('0x26')](0x194);}return _0x5a2f9b;};}function handleError(_0x2486d8,_0x438f34){_0x438f34=_0x438f34||0x1f4;return function(_0x589aa9){logger[_0x7cc2('0x21')](_0x589aa9['stack']);if(_0x589aa9[_0x7cc2('0x31')]){delete _0x589aa9[_0x7cc2('0x31')];}_0x2486d8[_0x7cc2('0x27')](_0x438f34)[_0x7cc2('0x32')](_0x589aa9);};}exports[_0x7cc2('0x33')]=function(_0x289c3c,_0xae5b45){var _0x33dacd={},_0x23052c={},_0x1ed0f4={'count':0x0,'rows':[]};var _0x581c9e=_['map'](db['ZendeskConfiguration'][_0x7cc2('0x34')],function(_0x598503){return{'name':_0x598503[_0x7cc2('0x35')],'type':_0x598503[_0x7cc2('0x36')][_0x7cc2('0x37')]};});_0x23052c[_0x7cc2('0x38')]=_[_0x7cc2('0x39')](_0x581c9e,'name');_0x23052c[_0x7cc2('0x3a')]=_[_0x7cc2('0x3b')](_0x289c3c[_0x7cc2('0x3a')]);_0x23052c[_0x7cc2('0x3c')]=_[_0x7cc2('0x3d')](_0x23052c['model'],_0x23052c['query']);_0x33dacd[_0x7cc2('0x3e')]=_[_0x7cc2('0x3d')](_0x23052c[_0x7cc2('0x38')],qs[_0x7cc2('0x3f')](_0x289c3c[_0x7cc2('0x3a')]['fields']));_0x33dacd[_0x7cc2('0x3e')]=_0x33dacd[_0x7cc2('0x3e')][_0x7cc2('0x40')]?_0x33dacd['attributes']:_0x23052c[_0x7cc2('0x38')];if(!_0x289c3c[_0x7cc2('0x3a')][_0x7cc2('0x41')]('nolimit')){_0x33dacd['limit']=qs[_0x7cc2('0x2c')](_0x289c3c['query'][_0x7cc2('0x2c')]);_0x33dacd[_0x7cc2('0x2b')]=qs[_0x7cc2('0x2b')](_0x289c3c[_0x7cc2('0x3a')][_0x7cc2('0x2b')]);}_0x33dacd[_0x7cc2('0x42')]=qs['sort'](_0x289c3c['query'][_0x7cc2('0x43')]);_0x33dacd[_0x7cc2('0x44')]=qs['filters'](_[_0x7cc2('0x45')](_0x289c3c[_0x7cc2('0x3a')],_0x23052c[_0x7cc2('0x3c')]),_0x581c9e);if(_0x289c3c[_0x7cc2('0x3a')][_0x7cc2('0x46')]){_0x33dacd[_0x7cc2('0x44')]=_[_0x7cc2('0x47')](_0x33dacd[_0x7cc2('0x44')],{'$or':_['map'](_0x581c9e,function(_0x2992a7){if(_0x2992a7[_0x7cc2('0x36')]!==_0x7cc2('0x48')){var _0x3b7c2d={};_0x3b7c2d[_0x2992a7[_0x7cc2('0x31')]]={'$like':'%'+_0x289c3c[_0x7cc2('0x3a')]['filter']+'%'};return _0x3b7c2d;}})});}_0x33dacd=_['merge']({},_0x33dacd,_0x289c3c[_0x7cc2('0x49')]);var _0x2a6bba={'where':_0x33dacd['where']};return db[_0x7cc2('0x4a')][_0x7cc2('0x2a')](_0x2a6bba)[_0x7cc2('0x1d')](function(_0x33349c){_0x1ed0f4['count']=_0x33349c;if(_0x289c3c[_0x7cc2('0x3a')]['includeAll']){_0x33dacd[_0x7cc2('0x4b')]=[{'all':!![]}];}return db[_0x7cc2('0x4a')][_0x7cc2('0x4c')](_0x33dacd);})[_0x7cc2('0x1d')](function(_0x10bc68){_0x1ed0f4['rows']=_0x10bc68;return _0x1ed0f4;})['then'](respondWithFilteredResult(_0xae5b45,_0x33dacd))[_0x7cc2('0x25')](handleError(_0xae5b45,null));};exports[_0x7cc2('0x4d')]=function(_0x5a78e3,_0xea4b2e){var _0x1c19e2={'raw':![],'where':{'id':_0x5a78e3[_0x7cc2('0x4e')]['id']}},_0x3a72b5={};_0x3a72b5[_0x7cc2('0x38')]=_[_0x7cc2('0x3b')](db[_0x7cc2('0x4a')]['rawAttributes']);_0x3a72b5['query']=_['keys'](_0x5a78e3[_0x7cc2('0x3a')]);_0x3a72b5[_0x7cc2('0x3c')]=_['intersection'](_0x3a72b5[_0x7cc2('0x38')],_0x3a72b5[_0x7cc2('0x3a')]);_0x1c19e2[_0x7cc2('0x3e')]=_[_0x7cc2('0x3d')](_0x3a72b5[_0x7cc2('0x38')],qs[_0x7cc2('0x3f')](_0x5a78e3[_0x7cc2('0x3a')][_0x7cc2('0x3f')]));_0x1c19e2[_0x7cc2('0x3e')]=_0x1c19e2['attributes'][_0x7cc2('0x40')]?_0x1c19e2[_0x7cc2('0x3e')]:_0x3a72b5['model'];if(_0x5a78e3[_0x7cc2('0x3a')][_0x7cc2('0x4f')]){_0x1c19e2[_0x7cc2('0x4b')]=[{'all':!![]}];}_0x1c19e2=_[_0x7cc2('0x47')]({},_0x1c19e2,_0x5a78e3[_0x7cc2('0x49')]);return db['ZendeskConfiguration'][_0x7cc2('0x50')](_0x1c19e2)[_0x7cc2('0x1d')](handleEntityNotFound(_0xea4b2e,null))[_0x7cc2('0x1d')](respondWithResult(_0xea4b2e,null))['catch'](handleError(_0xea4b2e,null));};exports[_0x7cc2('0x51')]=function(_0x47db34,_0x2d51bd){return db['ZendeskConfiguration'][_0x7cc2('0x51')](_0x47db34[_0x7cc2('0x52')],{})[_0x7cc2('0x1d')](respondWithResult(_0x2d51bd,0xc9))[_0x7cc2('0x25')](handleError(_0x2d51bd,null));};exports[_0x7cc2('0x53')]=function(_0x20929e,_0x4a060d){if(_0x20929e[_0x7cc2('0x52')]['id']){delete _0x20929e[_0x7cc2('0x52')]['id'];}return db[_0x7cc2('0x4a')][_0x7cc2('0x50')]({'where':{'id':_0x20929e['params']['id']}})[_0x7cc2('0x1d')](handleEntityNotFound(_0x4a060d,null))[_0x7cc2('0x1d')](saveUpdates(_0x20929e[_0x7cc2('0x52')],null))[_0x7cc2('0x1d')](respondWithResult(_0x4a060d,null))[_0x7cc2('0x25')](handleError(_0x4a060d,null));};exports[_0x7cc2('0x54')]=function(_0x357e02,_0x4d4242){return db[_0x7cc2('0x4a')][_0x7cc2('0x50')]({'where':{'id':_0x357e02[_0x7cc2('0x4e')]['id']}})[_0x7cc2('0x1d')](handleEntityNotFound(_0x4d4242,null))[_0x7cc2('0x1d')](removeEntity(_0x4d4242,null))[_0x7cc2('0x25')](handleError(_0x4d4242,null));};exports['getFields']=function(_0x491fd9,_0x1d929d,_0x300416){var _0x53e59e={};var _0x25d60a={};var _0x341d31;var _0x29b8de;return db['ZendeskConfiguration'][_0x7cc2('0x55')]({'where':{'id':_0x491fd9['params']['id']}})['then'](handleEntityNotFound(_0x1d929d,null))[_0x7cc2('0x1d')](function(_0x16bc12){if(_0x16bc12){_0x341d31=_0x16bc12;_0x25d60a['model']=_[_0x7cc2('0x3b')](db['ZendeskField'][_0x7cc2('0x34')]);_0x25d60a[_0x7cc2('0x3a')]=_[_0x7cc2('0x3b')](_0x491fd9[_0x7cc2('0x3a')]);_0x25d60a[_0x7cc2('0x3c')]=_[_0x7cc2('0x3d')](_0x25d60a['model'],_0x25d60a[_0x7cc2('0x3a')]);_0x53e59e[_0x7cc2('0x3e')]=_['intersection'](_0x25d60a[_0x7cc2('0x38')],qs['fields'](_0x491fd9[_0x7cc2('0x3a')][_0x7cc2('0x3f')]));_0x53e59e[_0x7cc2('0x3e')]=_0x53e59e['attributes'][_0x7cc2('0x40')]?_0x53e59e[_0x7cc2('0x3e')]:_0x25d60a[_0x7cc2('0x38')];_0x53e59e[_0x7cc2('0x42')]=qs[_0x7cc2('0x43')](_0x491fd9[_0x7cc2('0x3a')][_0x7cc2('0x43')]);_0x53e59e[_0x7cc2('0x44')]=qs['filters'](_['pick'](_0x491fd9[_0x7cc2('0x3a')],_0x25d60a[_0x7cc2('0x3c')]));if(_0x491fd9[_0x7cc2('0x3a')][_0x7cc2('0x46')]){_0x53e59e[_0x7cc2('0x44')]=_[_0x7cc2('0x47')](_0x53e59e[_0x7cc2('0x44')],{'$or':_[_0x7cc2('0x39')](_0x53e59e[_0x7cc2('0x3e')],function(_0x5c54ad){var _0x252181={};_0x252181[_0x5c54ad]={'$like':'%'+_0x491fd9['query'][_0x7cc2('0x46')]+'%'};return _0x252181;})});}_0x53e59e=_[_0x7cc2('0x47')]({},_0x53e59e,_0x491fd9[_0x7cc2('0x49')]);return _0x341d31[_0x7cc2('0x56')](_0x53e59e);}})[_0x7cc2('0x1d')](function(_0x2e0f41){if(_0x2e0f41){_0x29b8de=_0x2e0f41[_0x7cc2('0x40')];if(!_0x491fd9[_0x7cc2('0x3a')][_0x7cc2('0x41')](_0x7cc2('0x57'))){_0x53e59e[_0x7cc2('0x2c')]=qs['limit'](_0x491fd9[_0x7cc2('0x3a')][_0x7cc2('0x2c')]);_0x53e59e[_0x7cc2('0x2b')]=qs['offset'](_0x491fd9[_0x7cc2('0x3a')][_0x7cc2('0x2b')]);}return _0x341d31['getFields'](_0x53e59e);}})[_0x7cc2('0x1d')](function(_0x4d9c80){if(_0x4d9c80){return _0x4d9c80?{'count':_0x29b8de,'rows':_0x4d9c80}:null;}})[_0x7cc2('0x1d')](respondWithResult(_0x1d929d,null))[_0x7cc2('0x25')](handleError(_0x1d929d,null));};exports[_0x7cc2('0x58')]=function(_0x214d18,_0x3be967,_0x30bcf6){var _0x2bb7d7={};var _0x123f45={};var _0x3dddcc;var _0xcaed05;return db[_0x7cc2('0x4a')][_0x7cc2('0x55')]({'where':{'id':_0x214d18[_0x7cc2('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3be967,null))[_0x7cc2('0x1d')](function(_0x2e6cfb){if(_0x2e6cfb){_0x3dddcc=_0x2e6cfb;_0x123f45[_0x7cc2('0x38')]=_['keys'](db[_0x7cc2('0x59')][_0x7cc2('0x34')]);_0x123f45[_0x7cc2('0x3a')]=_[_0x7cc2('0x3b')](_0x214d18[_0x7cc2('0x3a')]);_0x123f45[_0x7cc2('0x3c')]=_[_0x7cc2('0x3d')](_0x123f45[_0x7cc2('0x38')],_0x123f45['query']);_0x2bb7d7[_0x7cc2('0x3e')]=_[_0x7cc2('0x3d')](_0x123f45[_0x7cc2('0x38')],qs[_0x7cc2('0x3f')](_0x214d18['query']['fields']));_0x2bb7d7[_0x7cc2('0x3e')]=_0x2bb7d7[_0x7cc2('0x3e')][_0x7cc2('0x40')]?_0x2bb7d7[_0x7cc2('0x3e')]:_0x123f45[_0x7cc2('0x38')];_0x2bb7d7[_0x7cc2('0x42')]=qs['sort'](_0x214d18['query'][_0x7cc2('0x43')]);_0x2bb7d7[_0x7cc2('0x44')]=qs['filters'](_[_0x7cc2('0x45')](_0x214d18[_0x7cc2('0x3a')],_0x123f45[_0x7cc2('0x3c')]));if(_0x214d18[_0x7cc2('0x3a')][_0x7cc2('0x46')]){_0x2bb7d7[_0x7cc2('0x44')]=_[_0x7cc2('0x47')](_0x2bb7d7[_0x7cc2('0x44')],{'$or':_['map'](_0x2bb7d7[_0x7cc2('0x3e')],function(_0xf4ae5e){var _0x18959c={};_0x18959c[_0xf4ae5e]={'$like':'%'+_0x214d18[_0x7cc2('0x3a')][_0x7cc2('0x46')]+'%'};return _0x18959c;})});}_0x2bb7d7=_[_0x7cc2('0x47')]({},_0x2bb7d7,_0x214d18[_0x7cc2('0x49')]);return _0x3dddcc[_0x7cc2('0x58')](_0x2bb7d7);}})[_0x7cc2('0x1d')](function(_0x1e3fde){if(_0x1e3fde){_0xcaed05=_0x1e3fde[_0x7cc2('0x40')];if(!_0x214d18[_0x7cc2('0x3a')][_0x7cc2('0x41')](_0x7cc2('0x57'))){_0x2bb7d7[_0x7cc2('0x2c')]=qs['limit'](_0x214d18['query'][_0x7cc2('0x2c')]);_0x2bb7d7[_0x7cc2('0x2b')]=qs['offset'](_0x214d18[_0x7cc2('0x3a')][_0x7cc2('0x2b')]);}return _0x3dddcc[_0x7cc2('0x58')](_0x2bb7d7);}})['then'](function(_0x825d30){if(_0x825d30){return _0x825d30?{'count':_0xcaed05,'rows':_0x825d30}:null;}})[_0x7cc2('0x1d')](respondWithResult(_0x3be967,null))[_0x7cc2('0x25')](handleError(_0x3be967,null));};exports[_0x7cc2('0x5a')]=function(_0x1f1d31,_0x47d3f6,_0x28c200){var _0x5edc69={};var _0x3c5843={};var _0x2db512;var _0x4e4a37;return db[_0x7cc2('0x4a')]['findOne']({'where':{'id':_0x1f1d31[_0x7cc2('0x4e')]['id']}})[_0x7cc2('0x1d')](handleEntityNotFound(_0x47d3f6,null))[_0x7cc2('0x1d')](function(_0x2fda1e){if(_0x2fda1e){_0x2db512=_0x2fda1e;_0x3c5843[_0x7cc2('0x38')]=_[_0x7cc2('0x3b')](db[_0x7cc2('0x59')][_0x7cc2('0x34')]);_0x3c5843[_0x7cc2('0x3a')]=_[_0x7cc2('0x3b')](_0x1f1d31[_0x7cc2('0x3a')]);_0x3c5843[_0x7cc2('0x3c')]=_[_0x7cc2('0x3d')](_0x3c5843[_0x7cc2('0x38')],_0x3c5843[_0x7cc2('0x3a')]);_0x5edc69['attributes']=_[_0x7cc2('0x3d')](_0x3c5843[_0x7cc2('0x38')],qs[_0x7cc2('0x3f')](_0x1f1d31[_0x7cc2('0x3a')]['fields']));_0x5edc69[_0x7cc2('0x3e')]=_0x5edc69['attributes'][_0x7cc2('0x40')]?_0x5edc69['attributes']:_0x3c5843[_0x7cc2('0x38')];_0x5edc69[_0x7cc2('0x42')]=qs[_0x7cc2('0x43')](_0x1f1d31[_0x7cc2('0x3a')]['sort']);_0x5edc69[_0x7cc2('0x44')]=qs[_0x7cc2('0x3c')](_[_0x7cc2('0x45')](_0x1f1d31[_0x7cc2('0x3a')],_0x3c5843['filters']));if(_0x1f1d31[_0x7cc2('0x3a')][_0x7cc2('0x46')]){_0x5edc69[_0x7cc2('0x44')]=_['merge'](_0x5edc69[_0x7cc2('0x44')],{'$or':_[_0x7cc2('0x39')](_0x5edc69[_0x7cc2('0x3e')],function(_0xd6c88d){var _0x297bfa={};_0x297bfa[_0xd6c88d]={'$like':'%'+_0x1f1d31[_0x7cc2('0x3a')][_0x7cc2('0x46')]+'%'};return _0x297bfa;})});}_0x5edc69=_[_0x7cc2('0x47')]({},_0x5edc69,_0x1f1d31[_0x7cc2('0x49')]);return _0x2db512[_0x7cc2('0x5a')](_0x5edc69);}})[_0x7cc2('0x1d')](function(_0x28baaf){if(_0x28baaf){_0x4e4a37=_0x28baaf['length'];if(!_0x1f1d31[_0x7cc2('0x3a')][_0x7cc2('0x41')](_0x7cc2('0x57'))){_0x5edc69['limit']=qs['limit'](_0x1f1d31['query']['limit']);_0x5edc69[_0x7cc2('0x2b')]=qs[_0x7cc2('0x2b')](_0x1f1d31[_0x7cc2('0x3a')][_0x7cc2('0x2b')]);}return _0x2db512[_0x7cc2('0x5a')](_0x5edc69);}})[_0x7cc2('0x1d')](function(_0x18d85f){if(_0x18d85f){return _0x18d85f?{'count':_0x4e4a37,'rows':_0x18d85f}:null;}})[_0x7cc2('0x1d')](respondWithResult(_0x47d3f6,null))[_0x7cc2('0x25')](handleError(_0x47d3f6,null));};exports[_0x7cc2('0x5b')]=function(_0x44c14d,_0x5cf015,_0x582d0a){var _0x56a31e={};var _0x5c066c={};var _0x2c927e;var _0x18c709;return db['ZendeskConfiguration'][_0x7cc2('0x55')]({'where':{'id':_0x44c14d[_0x7cc2('0x4e')]['id']}})[_0x7cc2('0x1d')](handleEntityNotFound(_0x5cf015,null))[_0x7cc2('0x1d')](function(_0x2b859e){if(_0x2b859e){_0x2c927e=_0x2b859e;_0x5c066c[_0x7cc2('0x38')]=_['keys'](db[_0x7cc2('0x5c')]['rawAttributes']);_0x5c066c[_0x7cc2('0x3a')]=_[_0x7cc2('0x3b')](_0x44c14d[_0x7cc2('0x3a')]);_0x5c066c[_0x7cc2('0x3c')]=_[_0x7cc2('0x3d')](_0x5c066c[_0x7cc2('0x38')],_0x5c066c[_0x7cc2('0x3a')]);_0x56a31e[_0x7cc2('0x3e')]=_[_0x7cc2('0x3d')](_0x5c066c[_0x7cc2('0x38')],qs[_0x7cc2('0x3f')](_0x44c14d[_0x7cc2('0x3a')]['fields']));_0x56a31e[_0x7cc2('0x3e')]=_0x56a31e[_0x7cc2('0x3e')][_0x7cc2('0x40')]?_0x56a31e['attributes']:_0x5c066c[_0x7cc2('0x38')];_0x56a31e[_0x7cc2('0x42')]=qs['sort'](_0x44c14d[_0x7cc2('0x3a')]['sort']);_0x56a31e[_0x7cc2('0x44')]=qs[_0x7cc2('0x3c')](_[_0x7cc2('0x45')](_0x44c14d[_0x7cc2('0x3a')],_0x5c066c[_0x7cc2('0x3c')]));if(_0x44c14d[_0x7cc2('0x3a')][_0x7cc2('0x46')]){_0x56a31e[_0x7cc2('0x44')]=_[_0x7cc2('0x47')](_0x56a31e['where'],{'$or':_[_0x7cc2('0x39')](_0x56a31e[_0x7cc2('0x3e')],function(_0x52e715){var _0x46f217={};_0x46f217[_0x52e715]={'$like':'%'+_0x44c14d['query']['filter']+'%'};return _0x46f217;})});}_0x56a31e=_['merge']({},_0x56a31e,_0x44c14d[_0x7cc2('0x49')]);return _0x2c927e['getTags'](_0x56a31e);}})[_0x7cc2('0x1d')](function(_0x44e56f){if(_0x44e56f){_0x18c709=_0x44e56f[_0x7cc2('0x40')];if(!_0x44c14d[_0x7cc2('0x3a')][_0x7cc2('0x41')]('nolimit')){_0x56a31e[_0x7cc2('0x2c')]=qs[_0x7cc2('0x2c')](_0x44c14d[_0x7cc2('0x3a')][_0x7cc2('0x2c')]);_0x56a31e[_0x7cc2('0x2b')]=qs[_0x7cc2('0x2b')](_0x44c14d[_0x7cc2('0x3a')][_0x7cc2('0x2b')]);}return _0x2c927e[_0x7cc2('0x5b')](_0x56a31e);}})['then'](function(_0x2755bd){if(_0x2755bd){return _0x2755bd?{'count':_0x18c709,'rows':_0x2755bd}:null;}})[_0x7cc2('0x1d')](respondWithResult(_0x5cf015,null))['catch'](handleError(_0x5cf015,null));};exports[_0x7cc2('0x5d')]=function(_0x91f8a,_0x1aeba7,_0x1c94f4){if(_0x91f8a[_0x7cc2('0x52')]['id']){delete _0x91f8a[_0x7cc2('0x52')]['id'];}return db['ZendeskConfiguration'][_0x7cc2('0x55')]({'where':{'id':_0x91f8a[_0x7cc2('0x4e')]['id']}})[_0x7cc2('0x1d')](handleEntityNotFound(_0x1aeba7,null))[_0x7cc2('0x1d')](function(_0x702cd2){if(_0x702cd2){return _0x702cd2['setTags'](_0x91f8a[_0x7cc2('0x52')][_0x7cc2('0x5e')]||[]);}return null;})[_0x7cc2('0x1d')](respondWithResult(_0x1aeba7,null))[_0x7cc2('0x25')](handleError(_0x1aeba7,null));}; \ No newline at end of file +var _0x9abb=['where','pick','filter','VIRTUAL','merge','count','includeAll','include','rows','show','params','find','create','update','body','destroy','findOne','ZendeskField','options','getFields','getSubjects','nolimit','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskConfiguration,\x20%s,\x20%s','info','result','catch','sendStatus','end','status','offset','limit','Content-Range','json','reject','save','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x9abb,0xd4));var _0xb9ab=function(_0x356e72,_0x116250){_0x356e72=_0x356e72-0x0;var _0x33816c=_0x9abb[_0x356e72];return _0x33816c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb9ab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb9ab('0x1'));var jsonpatch=require(_0xb9ab('0x2'));var rp=require(_0xb9ab('0x3'));var moment=require(_0xb9ab('0x4'));var BPromise=require(_0xb9ab('0x5'));var Mustache=require(_0xb9ab('0x6'));var util=require('util');var path=require(_0xb9ab('0x7'));var sox=require('sox');var csv=require(_0xb9ab('0x8'));var ejs=require(_0xb9ab('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb9ab('0xa'));var crypto=require('crypto');var jsforce=require(_0xb9ab('0xb'));var deskjs=require(_0xb9ab('0xc'));var toCsv=require(_0xb9ab('0x8'));var querystring=require(_0xb9ab('0xd'));var Papa=require('papaparse');var Redis=require(_0xb9ab('0xe'));var authService=require(_0xb9ab('0xf'));var qs=require(_0xb9ab('0x10'));var as=require(_0xb9ab('0x11'));var hardwareService=require(_0xb9ab('0x12'));var logger=require(_0xb9ab('0x13'))('api');var utils=require(_0xb9ab('0x14'));var config=require(_0xb9ab('0x15'));var db=require(_0xb9ab('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xb9ab('0x17')]({'port':0x232a});function checkPasswordPattern(_0x13e3b8,_0xe14ab5,_0x4e67b3){if(_0x4e67b3){var _0x5e5ac5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e5ac5[_0xb9ab('0x18')](_0xe14ab5)){return _0x13e3b8;}else{throw new db['Sequelize'][(_0xb9ab('0x19'))](_0xb9ab('0x1a'));}}else{return _0x13e3b8;}}function respondWithRpcPromise(_0x42767d,_0x319825,_0xb9d430,_0x5d14db){return new BPromise(function(_0x50242b,_0x486b9d){var _0x465ec3=_0x5d14db||client;return _0x465ec3[_0xb9ab('0x1b')](_0x42767d,_0xb9d430)[_0xb9ab('0x1c')](function(_0x4c08b8){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x319825,_0xb9ab('0x1d'));logger[_0xb9ab('0x1e')](_0xb9ab('0x1f'),_0x319825,_0xb9ab('0x1d'),JSON[_0xb9ab('0x20')](_0x4c08b8));if(_0x4c08b8[_0xb9ab('0x21')]){if(_0x4c08b8[_0xb9ab('0x21')][_0xb9ab('0x22')]===0x1f4){logger[_0xb9ab('0x21')]('ZendeskConfiguration,\x20%s,\x20%s',_0x319825,_0x4c08b8['error'][_0xb9ab('0x23')]);return _0x486b9d(_0x4c08b8['error'][_0xb9ab('0x23')]);}logger[_0xb9ab('0x21')](_0xb9ab('0x24'),_0x319825,_0x4c08b8[_0xb9ab('0x21')]['message']);return _0x50242b(_0x4c08b8[_0xb9ab('0x21')]['message']);}else{logger[_0xb9ab('0x25')](_0xb9ab('0x24'),_0x319825,_0xb9ab('0x1d'));_0x50242b(_0x4c08b8[_0xb9ab('0x26')][_0xb9ab('0x23')]);}})[_0xb9ab('0x27')](function(_0x50c96f){logger[_0xb9ab('0x21')](_0xb9ab('0x24'),_0x319825,_0x50c96f);_0x486b9d(_0x50c96f);});});}function respondWithStatusCode(_0x21d4c2,_0x5c566f){_0x5c566f=_0x5c566f||0xcc;return function(_0x5edb95){if(_0x5edb95){return _0x21d4c2[_0xb9ab('0x28')](_0x5c566f);}return _0x21d4c2['status'](_0x5c566f)[_0xb9ab('0x29')]();};}function respondWithResult(_0x186e8d,_0x4cfe61){_0x4cfe61=_0x4cfe61||0xc8;return function(_0x2c534f){if(_0x2c534f){return _0x186e8d[_0xb9ab('0x2a')](_0x4cfe61)['json'](_0x2c534f);}};}function respondWithFilteredResult(_0x3ac558,_0x3f51d1){return function(_0x51bd34){if(_0x51bd34){var _0x320672=_0x51bd34['count'],_0x1b2f05=_0x3f51d1[_0xb9ab('0x2b')],_0xd3218b=_0x3f51d1[_0xb9ab('0x2b')]+_0x3f51d1[_0xb9ab('0x2c')],_0x1d457b;if(_0xd3218b>=_0x320672){_0xd3218b=_0x320672;_0x1d457b=0xc8;}else{_0x1d457b=0xce;}_0x3ac558[_0xb9ab('0x2a')](_0x1d457b);return _0x3ac558['set'](_0xb9ab('0x2d'),_0x1b2f05+'-'+_0xd3218b+'/'+_0x320672)[_0xb9ab('0x2e')](_0x51bd34);}return null;};}function patchUpdates(_0x59c479){return function(_0x35c25f){try{jsonpatch['apply'](_0x35c25f,_0x59c479,!![]);}catch(_0x3b5338){return BPromise[_0xb9ab('0x2f')](_0x3b5338);}return _0x35c25f[_0xb9ab('0x30')]();};}function saveUpdates(_0x134926,_0x5685da){return function(_0x1c894f){if(_0x1c894f){return _0x1c894f['update'](_0x134926)[_0xb9ab('0x1c')](function(_0x3607ff){return _0x3607ff;});}return null;};}function removeEntity(_0x1daf57,_0x4a1ab2){return function(_0x2c4e8c){if(_0x2c4e8c){return _0x2c4e8c['destroy']()[_0xb9ab('0x1c')](function(){_0x1daf57[_0xb9ab('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c71f8,_0x2afb19){return function(_0x1c3e7d){if(!_0x1c3e7d){_0x3c71f8[_0xb9ab('0x28')](0x194);}return _0x1c3e7d;};}function handleError(_0x26c390,_0x572935){_0x572935=_0x572935||0x1f4;return function(_0x308413){logger[_0xb9ab('0x21')](_0x308413['stack']);if(_0x308413['name']){delete _0x308413[_0xb9ab('0x31')];}_0x26c390[_0xb9ab('0x2a')](_0x572935)['send'](_0x308413);};}exports[_0xb9ab('0x32')]=function(_0x5e8425,_0x2641d6){var _0x3bacb5={},_0xfc784d={},_0x4aa549={'count':0x0,'rows':[]};var _0x24cbd8=_[_0xb9ab('0x33')](db[_0xb9ab('0x34')][_0xb9ab('0x35')],function(_0x4c6fd2){return{'name':_0x4c6fd2[_0xb9ab('0x36')],'type':_0x4c6fd2[_0xb9ab('0x37')]['key']};});_0xfc784d[_0xb9ab('0x38')]=_[_0xb9ab('0x33')](_0x24cbd8,_0xb9ab('0x31'));_0xfc784d[_0xb9ab('0x39')]=_[_0xb9ab('0x3a')](_0x5e8425[_0xb9ab('0x39')]);_0xfc784d[_0xb9ab('0x3b')]=_[_0xb9ab('0x3c')](_0xfc784d[_0xb9ab('0x38')],_0xfc784d[_0xb9ab('0x39')]);_0x3bacb5[_0xb9ab('0x3d')]=_[_0xb9ab('0x3c')](_0xfc784d[_0xb9ab('0x38')],qs[_0xb9ab('0x3e')](_0x5e8425['query'][_0xb9ab('0x3e')]));_0x3bacb5[_0xb9ab('0x3d')]=_0x3bacb5[_0xb9ab('0x3d')][_0xb9ab('0x3f')]?_0x3bacb5['attributes']:_0xfc784d['model'];if(!_0x5e8425[_0xb9ab('0x39')][_0xb9ab('0x40')]('nolimit')){_0x3bacb5[_0xb9ab('0x2c')]=qs[_0xb9ab('0x2c')](_0x5e8425[_0xb9ab('0x39')][_0xb9ab('0x2c')]);_0x3bacb5[_0xb9ab('0x2b')]=qs[_0xb9ab('0x2b')](_0x5e8425[_0xb9ab('0x39')]['offset']);}_0x3bacb5[_0xb9ab('0x41')]=qs[_0xb9ab('0x42')](_0x5e8425['query'][_0xb9ab('0x42')]);_0x3bacb5[_0xb9ab('0x43')]=qs[_0xb9ab('0x3b')](_[_0xb9ab('0x44')](_0x5e8425[_0xb9ab('0x39')],_0xfc784d[_0xb9ab('0x3b')]),_0x24cbd8);if(_0x5e8425[_0xb9ab('0x39')][_0xb9ab('0x45')]){_0x3bacb5['where']=_['merge'](_0x3bacb5['where'],{'$or':_[_0xb9ab('0x33')](_0x24cbd8,function(_0x5e0728){if(_0x5e0728[_0xb9ab('0x37')]!==_0xb9ab('0x46')){var _0x1c0213={};_0x1c0213[_0x5e0728[_0xb9ab('0x31')]]={'$like':'%'+_0x5e8425[_0xb9ab('0x39')][_0xb9ab('0x45')]+'%'};return _0x1c0213;}})});}_0x3bacb5=_[_0xb9ab('0x47')]({},_0x3bacb5,_0x5e8425['options']);var _0x174ef2={'where':_0x3bacb5[_0xb9ab('0x43')]};return db[_0xb9ab('0x34')][_0xb9ab('0x48')](_0x174ef2)[_0xb9ab('0x1c')](function(_0x5373f4){_0x4aa549['count']=_0x5373f4;if(_0x5e8425['query'][_0xb9ab('0x49')]){_0x3bacb5[_0xb9ab('0x4a')]=[{'all':!![]}];}return db[_0xb9ab('0x34')]['findAll'](_0x3bacb5);})['then'](function(_0x390cc5){_0x4aa549[_0xb9ab('0x4b')]=_0x390cc5;return _0x4aa549;})[_0xb9ab('0x1c')](respondWithFilteredResult(_0x2641d6,_0x3bacb5))[_0xb9ab('0x27')](handleError(_0x2641d6,null));};exports[_0xb9ab('0x4c')]=function(_0x13ee5d,_0x55196e){var _0x2d83bd={'raw':![],'where':{'id':_0x13ee5d[_0xb9ab('0x4d')]['id']}},_0x5d9172={};_0x5d9172[_0xb9ab('0x38')]=_['keys'](db[_0xb9ab('0x34')][_0xb9ab('0x35')]);_0x5d9172[_0xb9ab('0x39')]=_[_0xb9ab('0x3a')](_0x13ee5d[_0xb9ab('0x39')]);_0x5d9172[_0xb9ab('0x3b')]=_[_0xb9ab('0x3c')](_0x5d9172['model'],_0x5d9172[_0xb9ab('0x39')]);_0x2d83bd[_0xb9ab('0x3d')]=_[_0xb9ab('0x3c')](_0x5d9172[_0xb9ab('0x38')],qs['fields'](_0x13ee5d[_0xb9ab('0x39')][_0xb9ab('0x3e')]));_0x2d83bd[_0xb9ab('0x3d')]=_0x2d83bd[_0xb9ab('0x3d')][_0xb9ab('0x3f')]?_0x2d83bd['attributes']:_0x5d9172[_0xb9ab('0x38')];if(_0x13ee5d[_0xb9ab('0x39')][_0xb9ab('0x49')]){_0x2d83bd[_0xb9ab('0x4a')]=[{'all':!![]}];}_0x2d83bd=_[_0xb9ab('0x47')]({},_0x2d83bd,_0x13ee5d['options']);return db[_0xb9ab('0x34')][_0xb9ab('0x4e')](_0x2d83bd)[_0xb9ab('0x1c')](handleEntityNotFound(_0x55196e,null))['then'](respondWithResult(_0x55196e,null))[_0xb9ab('0x27')](handleError(_0x55196e,null));};exports[_0xb9ab('0x4f')]=function(_0x438d60,_0x296859){return db[_0xb9ab('0x34')]['create'](_0x438d60['body'],{})[_0xb9ab('0x1c')](respondWithResult(_0x296859,0xc9))[_0xb9ab('0x27')](handleError(_0x296859,null));};exports[_0xb9ab('0x50')]=function(_0x14a787,_0x2f4db8){if(_0x14a787[_0xb9ab('0x51')]['id']){delete _0x14a787[_0xb9ab('0x51')]['id'];}return db['ZendeskConfiguration'][_0xb9ab('0x4e')]({'where':{'id':_0x14a787['params']['id']}})[_0xb9ab('0x1c')](handleEntityNotFound(_0x2f4db8,null))[_0xb9ab('0x1c')](saveUpdates(_0x14a787[_0xb9ab('0x51')],null))[_0xb9ab('0x1c')](respondWithResult(_0x2f4db8,null))[_0xb9ab('0x27')](handleError(_0x2f4db8,null));};exports[_0xb9ab('0x52')]=function(_0x494ea3,_0xa63b7f){return db['ZendeskConfiguration'][_0xb9ab('0x4e')]({'where':{'id':_0x494ea3[_0xb9ab('0x4d')]['id']}})[_0xb9ab('0x1c')](handleEntityNotFound(_0xa63b7f,null))['then'](removeEntity(_0xa63b7f,null))[_0xb9ab('0x27')](handleError(_0xa63b7f,null));};exports['getFields']=function(_0x1279e8,_0xeff950,_0x4ed002){var _0x3cb10c={};var _0x34065b={};var _0x43a25a;var _0x31d792;return db[_0xb9ab('0x34')][_0xb9ab('0x53')]({'where':{'id':_0x1279e8[_0xb9ab('0x4d')]['id']}})[_0xb9ab('0x1c')](handleEntityNotFound(_0xeff950,null))['then'](function(_0x58e2a2){if(_0x58e2a2){_0x43a25a=_0x58e2a2;_0x34065b[_0xb9ab('0x38')]=_[_0xb9ab('0x3a')](db[_0xb9ab('0x54')]['rawAttributes']);_0x34065b[_0xb9ab('0x39')]=_[_0xb9ab('0x3a')](_0x1279e8['query']);_0x34065b[_0xb9ab('0x3b')]=_['intersection'](_0x34065b[_0xb9ab('0x38')],_0x34065b[_0xb9ab('0x39')]);_0x3cb10c[_0xb9ab('0x3d')]=_['intersection'](_0x34065b[_0xb9ab('0x38')],qs[_0xb9ab('0x3e')](_0x1279e8[_0xb9ab('0x39')][_0xb9ab('0x3e')]));_0x3cb10c[_0xb9ab('0x3d')]=_0x3cb10c[_0xb9ab('0x3d')][_0xb9ab('0x3f')]?_0x3cb10c[_0xb9ab('0x3d')]:_0x34065b[_0xb9ab('0x38')];_0x3cb10c[_0xb9ab('0x41')]=qs['sort'](_0x1279e8[_0xb9ab('0x39')][_0xb9ab('0x42')]);_0x3cb10c[_0xb9ab('0x43')]=qs[_0xb9ab('0x3b')](_[_0xb9ab('0x44')](_0x1279e8[_0xb9ab('0x39')],_0x34065b['filters']));if(_0x1279e8['query']['filter']){_0x3cb10c[_0xb9ab('0x43')]=_[_0xb9ab('0x47')](_0x3cb10c['where'],{'$or':_[_0xb9ab('0x33')](_0x3cb10c[_0xb9ab('0x3d')],function(_0x163bd0){var _0x5584fb={};_0x5584fb[_0x163bd0]={'$like':'%'+_0x1279e8[_0xb9ab('0x39')][_0xb9ab('0x45')]+'%'};return _0x5584fb;})});}_0x3cb10c=_[_0xb9ab('0x47')]({},_0x3cb10c,_0x1279e8[_0xb9ab('0x55')]);return _0x43a25a[_0xb9ab('0x56')](_0x3cb10c);}})[_0xb9ab('0x1c')](function(_0x5553e4){if(_0x5553e4){_0x31d792=_0x5553e4['length'];if(!_0x1279e8[_0xb9ab('0x39')][_0xb9ab('0x40')]('nolimit')){_0x3cb10c[_0xb9ab('0x2c')]=qs[_0xb9ab('0x2c')](_0x1279e8[_0xb9ab('0x39')][_0xb9ab('0x2c')]);_0x3cb10c[_0xb9ab('0x2b')]=qs[_0xb9ab('0x2b')](_0x1279e8[_0xb9ab('0x39')][_0xb9ab('0x2b')]);}return _0x43a25a[_0xb9ab('0x56')](_0x3cb10c);}})[_0xb9ab('0x1c')](function(_0x190745){if(_0x190745){return _0x190745?{'count':_0x31d792,'rows':_0x190745}:null;}})[_0xb9ab('0x1c')](respondWithResult(_0xeff950,null))['catch'](handleError(_0xeff950,null));};exports[_0xb9ab('0x57')]=function(_0x55c164,_0x485ae2,_0x20b861){var _0x121be5={};var _0x27b146={};var _0x4b30fd;var _0x31688e;return db[_0xb9ab('0x34')][_0xb9ab('0x53')]({'where':{'id':_0x55c164[_0xb9ab('0x4d')]['id']}})[_0xb9ab('0x1c')](handleEntityNotFound(_0x485ae2,null))['then'](function(_0x1ff075){if(_0x1ff075){_0x4b30fd=_0x1ff075;_0x27b146[_0xb9ab('0x38')]=_[_0xb9ab('0x3a')](db[_0xb9ab('0x54')][_0xb9ab('0x35')]);_0x27b146[_0xb9ab('0x39')]=_['keys'](_0x55c164[_0xb9ab('0x39')]);_0x27b146[_0xb9ab('0x3b')]=_[_0xb9ab('0x3c')](_0x27b146[_0xb9ab('0x38')],_0x27b146['query']);_0x121be5['attributes']=_[_0xb9ab('0x3c')](_0x27b146[_0xb9ab('0x38')],qs[_0xb9ab('0x3e')](_0x55c164[_0xb9ab('0x39')][_0xb9ab('0x3e')]));_0x121be5[_0xb9ab('0x3d')]=_0x121be5[_0xb9ab('0x3d')][_0xb9ab('0x3f')]?_0x121be5['attributes']:_0x27b146[_0xb9ab('0x38')];_0x121be5[_0xb9ab('0x41')]=qs[_0xb9ab('0x42')](_0x55c164[_0xb9ab('0x39')][_0xb9ab('0x42')]);_0x121be5[_0xb9ab('0x43')]=qs['filters'](_[_0xb9ab('0x44')](_0x55c164['query'],_0x27b146[_0xb9ab('0x3b')]));if(_0x55c164['query']['filter']){_0x121be5[_0xb9ab('0x43')]=_['merge'](_0x121be5[_0xb9ab('0x43')],{'$or':_[_0xb9ab('0x33')](_0x121be5[_0xb9ab('0x3d')],function(_0x2ca3cb){var _0x1be4c6={};_0x1be4c6[_0x2ca3cb]={'$like':'%'+_0x55c164[_0xb9ab('0x39')][_0xb9ab('0x45')]+'%'};return _0x1be4c6;})});}_0x121be5=_['merge']({},_0x121be5,_0x55c164[_0xb9ab('0x55')]);return _0x4b30fd[_0xb9ab('0x57')](_0x121be5);}})[_0xb9ab('0x1c')](function(_0x3ae932){if(_0x3ae932){_0x31688e=_0x3ae932[_0xb9ab('0x3f')];if(!_0x55c164[_0xb9ab('0x39')][_0xb9ab('0x40')](_0xb9ab('0x58'))){_0x121be5[_0xb9ab('0x2c')]=qs[_0xb9ab('0x2c')](_0x55c164[_0xb9ab('0x39')][_0xb9ab('0x2c')]);_0x121be5[_0xb9ab('0x2b')]=qs[_0xb9ab('0x2b')](_0x55c164['query']['offset']);}return _0x4b30fd['getSubjects'](_0x121be5);}})[_0xb9ab('0x1c')](function(_0x4a78c2){if(_0x4a78c2){return _0x4a78c2?{'count':_0x31688e,'rows':_0x4a78c2}:null;}})['then'](respondWithResult(_0x485ae2,null))[_0xb9ab('0x27')](handleError(_0x485ae2,null));};exports[_0xb9ab('0x59')]=function(_0x6a45c0,_0x1451ab,_0x3a2acb){var _0x5481ea={};var _0x5c5661={};var _0x13cb17;var _0x33a86f;return db[_0xb9ab('0x34')][_0xb9ab('0x53')]({'where':{'id':_0x6a45c0[_0xb9ab('0x4d')]['id']}})[_0xb9ab('0x1c')](handleEntityNotFound(_0x1451ab,null))['then'](function(_0x48b3ea){if(_0x48b3ea){_0x13cb17=_0x48b3ea;_0x5c5661[_0xb9ab('0x38')]=_[_0xb9ab('0x3a')](db['ZendeskField']['rawAttributes']);_0x5c5661[_0xb9ab('0x39')]=_['keys'](_0x6a45c0[_0xb9ab('0x39')]);_0x5c5661[_0xb9ab('0x3b')]=_[_0xb9ab('0x3c')](_0x5c5661[_0xb9ab('0x38')],_0x5c5661[_0xb9ab('0x39')]);_0x5481ea[_0xb9ab('0x3d')]=_[_0xb9ab('0x3c')](_0x5c5661[_0xb9ab('0x38')],qs[_0xb9ab('0x3e')](_0x6a45c0['query']['fields']));_0x5481ea[_0xb9ab('0x3d')]=_0x5481ea[_0xb9ab('0x3d')][_0xb9ab('0x3f')]?_0x5481ea['attributes']:_0x5c5661[_0xb9ab('0x38')];_0x5481ea['order']=qs[_0xb9ab('0x42')](_0x6a45c0[_0xb9ab('0x39')][_0xb9ab('0x42')]);_0x5481ea[_0xb9ab('0x43')]=qs[_0xb9ab('0x3b')](_[_0xb9ab('0x44')](_0x6a45c0['query'],_0x5c5661[_0xb9ab('0x3b')]));if(_0x6a45c0[_0xb9ab('0x39')]['filter']){_0x5481ea[_0xb9ab('0x43')]=_[_0xb9ab('0x47')](_0x5481ea[_0xb9ab('0x43')],{'$or':_[_0xb9ab('0x33')](_0x5481ea[_0xb9ab('0x3d')],function(_0x41a930){var _0x207353={};_0x207353[_0x41a930]={'$like':'%'+_0x6a45c0['query'][_0xb9ab('0x45')]+'%'};return _0x207353;})});}_0x5481ea=_['merge']({},_0x5481ea,_0x6a45c0['options']);return _0x13cb17[_0xb9ab('0x59')](_0x5481ea);}})[_0xb9ab('0x1c')](function(_0x3cb928){if(_0x3cb928){_0x33a86f=_0x3cb928['length'];if(!_0x6a45c0[_0xb9ab('0x39')][_0xb9ab('0x40')](_0xb9ab('0x58'))){_0x5481ea['limit']=qs[_0xb9ab('0x2c')](_0x6a45c0[_0xb9ab('0x39')]['limit']);_0x5481ea[_0xb9ab('0x2b')]=qs[_0xb9ab('0x2b')](_0x6a45c0[_0xb9ab('0x39')][_0xb9ab('0x2b')]);}return _0x13cb17[_0xb9ab('0x59')](_0x5481ea);}})[_0xb9ab('0x1c')](function(_0x5d8f72){if(_0x5d8f72){return _0x5d8f72?{'count':_0x33a86f,'rows':_0x5d8f72}:null;}})['then'](respondWithResult(_0x1451ab,null))[_0xb9ab('0x27')](handleError(_0x1451ab,null));};exports[_0xb9ab('0x5a')]=function(_0x42cd8d,_0x501a06,_0x3c9281){var _0x2471f6={};var _0x2c62fa={};var _0x4b4959;var _0x192db3;return db[_0xb9ab('0x34')][_0xb9ab('0x53')]({'where':{'id':_0x42cd8d[_0xb9ab('0x4d')]['id']}})[_0xb9ab('0x1c')](handleEntityNotFound(_0x501a06,null))[_0xb9ab('0x1c')](function(_0x13275e){if(_0x13275e){_0x4b4959=_0x13275e;_0x2c62fa[_0xb9ab('0x38')]=_[_0xb9ab('0x3a')](db['Tag'][_0xb9ab('0x35')]);_0x2c62fa['query']=_[_0xb9ab('0x3a')](_0x42cd8d[_0xb9ab('0x39')]);_0x2c62fa[_0xb9ab('0x3b')]=_[_0xb9ab('0x3c')](_0x2c62fa[_0xb9ab('0x38')],_0x2c62fa['query']);_0x2471f6[_0xb9ab('0x3d')]=_[_0xb9ab('0x3c')](_0x2c62fa[_0xb9ab('0x38')],qs['fields'](_0x42cd8d[_0xb9ab('0x39')][_0xb9ab('0x3e')]));_0x2471f6[_0xb9ab('0x3d')]=_0x2471f6[_0xb9ab('0x3d')]['length']?_0x2471f6[_0xb9ab('0x3d')]:_0x2c62fa[_0xb9ab('0x38')];_0x2471f6[_0xb9ab('0x41')]=qs[_0xb9ab('0x42')](_0x42cd8d[_0xb9ab('0x39')][_0xb9ab('0x42')]);_0x2471f6[_0xb9ab('0x43')]=qs['filters'](_[_0xb9ab('0x44')](_0x42cd8d[_0xb9ab('0x39')],_0x2c62fa[_0xb9ab('0x3b')]));if(_0x42cd8d[_0xb9ab('0x39')][_0xb9ab('0x45')]){_0x2471f6[_0xb9ab('0x43')]=_[_0xb9ab('0x47')](_0x2471f6['where'],{'$or':_[_0xb9ab('0x33')](_0x2471f6[_0xb9ab('0x3d')],function(_0xc04dd3){var _0x52ee8d={};_0x52ee8d[_0xc04dd3]={'$like':'%'+_0x42cd8d[_0xb9ab('0x39')]['filter']+'%'};return _0x52ee8d;})});}_0x2471f6=_['merge']({},_0x2471f6,_0x42cd8d[_0xb9ab('0x55')]);return _0x4b4959[_0xb9ab('0x5a')](_0x2471f6);}})['then'](function(_0x3b2bb3){if(_0x3b2bb3){_0x192db3=_0x3b2bb3['length'];if(!_0x42cd8d['query'][_0xb9ab('0x40')]('nolimit')){_0x2471f6['limit']=qs['limit'](_0x42cd8d['query'][_0xb9ab('0x2c')]);_0x2471f6['offset']=qs[_0xb9ab('0x2b')](_0x42cd8d[_0xb9ab('0x39')][_0xb9ab('0x2b')]);}return _0x4b4959[_0xb9ab('0x5a')](_0x2471f6);}})[_0xb9ab('0x1c')](function(_0x57ac92){if(_0x57ac92){return _0x57ac92?{'count':_0x192db3,'rows':_0x57ac92}:null;}})[_0xb9ab('0x1c')](respondWithResult(_0x501a06,null))[_0xb9ab('0x27')](handleError(_0x501a06,null));};exports[_0xb9ab('0x5b')]=function(_0x131b9e,_0x15488c,_0x120c00){if(_0x131b9e[_0xb9ab('0x51')]['id']){delete _0x131b9e['body']['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x131b9e[_0xb9ab('0x4d')]['id']}})[_0xb9ab('0x1c')](handleEntityNotFound(_0x15488c,null))[_0xb9ab('0x1c')](function(_0x453a19){if(_0x453a19){return _0x453a19[_0xb9ab('0x5b')](_0x131b9e[_0xb9ab('0x51')][_0xb9ab('0x5c')]||[]);}return null;})[_0xb9ab('0x1c')](respondWithResult(_0x15488c,null))[_0xb9ab('0x27')](handleError(_0x15488c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 0748695..5f38955 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 _0x1057=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0x30d18a,_0x9dd77b){var _0x227b00=function(_0x372c3d){while(--_0x372c3d){_0x30d18a['push'](_0x30d18a['shift']());}};_0x227b00(++_0x9dd77b);}(_0x1057,0xc3));var _0x7105=function(_0xd28043,_0x5f441b){_0xd28043=_0xd28043-0x0;var _0xdb379d=_0x1057[_0xd28043];return _0xdb379d;};'use strict';var _=require(_0x7105('0x0'));var util=require(_0x7105('0x1'));var logger=require(_0x7105('0x2'))(_0x7105('0x3'));var moment=require(_0x7105('0x4'));var BPromise=require('bluebird');var rp=require(_0x7105('0x5'));var fs=require('fs');var path=require(_0x7105('0x6'));var rimraf=require(_0x7105('0x7'));var config=require(_0x7105('0x8'));var attributes=require(_0x7105('0x9'));module[_0x7105('0xa')]=function(_0x6b83ed,_0xcb314){return _0x6b83ed[_0x7105('0xb')](_0x7105('0xc'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c2c=['request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger'];(function(_0x5c8c15,_0x44f742){var _0x5d3b1c=function(_0x1b7ae4){while(--_0x1b7ae4){_0x5c8c15['push'](_0x5c8c15['shift']());}};_0x5d3b1c(++_0x44f742);}(_0x4c2c,0xef));var _0xc4c2=function(_0x5c7107,_0x3c9e3a){_0x5c7107=_0x5c7107-0x0;var _0x52d2cb=_0x4c2c[_0x5c7107];return _0x52d2cb;};'use strict';var _=require(_0xc4c2('0x0'));var util=require(_0xc4c2('0x1'));var logger=require(_0xc4c2('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc4c2('0x3'));var fs=require('fs');var path=require(_0xc4c2('0x4'));var rimraf=require(_0xc4c2('0x5'));var config=require(_0xc4c2('0x6'));var attributes=require(_0xc4c2('0x7'));module['exports']=function(_0x3d9211,_0x6c2c66){return _0x3d9211[_0xc4c2('0x8')](_0xc4c2('0x9'),attributes,{'tableName':_0xc4c2('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 374539b..d869f70 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 _0x86d6=['debug','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x34ba44,_0xb28ac5){var _0x186159=function(_0xa4bb5e){while(--_0xa4bb5e){_0x34ba44['push'](_0x34ba44['shift']());}};_0x186159(++_0xb28ac5);}(_0x86d6,0xb6));var _0x686d=function(_0x5af492,_0x459688){_0x5af492=_0x5af492-0x0;var _0x49f29e=_0x86d6[_0x5af492];return _0x49f29e;};'use strict';var _=require('lodash');var util=require(_0x686d('0x0'));var moment=require(_0x686d('0x1'));var BPromise=require(_0x686d('0x2'));var rs=require(_0x686d('0x3'));var fs=require('fs');var Redis=require(_0x686d('0x4'));var db=require(_0x686d('0x5'))['db'];var utils=require(_0x686d('0x6'));var logger=require(_0x686d('0x7'))(_0x686d('0x8'));var config=require(_0x686d('0x9'));var jayson=require(_0x686d('0xa'));var client=jayson[_0x686d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x341dee,_0xd1e58f,_0x55bc7c){return new BPromise(function(_0x505dbc,_0x2c441a){return client[_0x686d('0xc')](_0x341dee,_0x55bc7c)[_0x686d('0xd')](function(_0x4d8150){logger[_0x686d('0xe')]('ZendeskConfiguration,\x20%s,\x20%s',_0xd1e58f,_0x686d('0xf'));logger[_0x686d('0x10')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0xd1e58f,_0x686d('0xf'),JSON['stringify'](_0x4d8150));if(_0x4d8150[_0x686d('0x11')]){if(_0x4d8150[_0x686d('0x11')][_0x686d('0x12')]===0x1f4){logger[_0x686d('0x11')](_0x686d('0x13'),_0xd1e58f,_0x4d8150[_0x686d('0x11')][_0x686d('0x14')]);return _0x2c441a(_0x4d8150[_0x686d('0x11')]['message']);}logger[_0x686d('0x11')](_0x686d('0x13'),_0xd1e58f,_0x4d8150[_0x686d('0x11')][_0x686d('0x14')]);return _0x505dbc(_0x4d8150[_0x686d('0x11')]['message']);}else{logger['info'](_0x686d('0x13'),_0xd1e58f,'request\x20sent');_0x505dbc(_0x4d8150[_0x686d('0x15')][_0x686d('0x14')]);}})['catch'](function(_0x30a21a){logger[_0x686d('0x11')](_0x686d('0x13'),_0xd1e58f,_0x30a21a);_0x2c441a(_0x30a21a);});});} \ No newline at end of file +var _0xa5ee=['../../config/utils','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','ZendeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x46a551,_0x222d67){var _0x57aaf4=function(_0x547a7a){while(--_0x547a7a){_0x46a551['push'](_0x46a551['shift']());}};_0x57aaf4(++_0x222d67);}(_0xa5ee,0x1c9));var _0xea5e=function(_0x3843f6,_0x184013){_0x3843f6=_0x3843f6-0x0;var _0x1591b9=_0xa5ee[_0x3843f6];return _0x1591b9;};'use strict';var _=require(_0xea5e('0x0'));var util=require(_0xea5e('0x1'));var moment=require('moment');var BPromise=require(_0xea5e('0x2'));var rs=require(_0xea5e('0x3'));var fs=require('fs');var Redis=require(_0xea5e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea5e('0x5'));var logger=require(_0xea5e('0x6'))(_0xea5e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xea5e('0x8')][_0xea5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x187870,_0x5d4ba8,_0x23ca50){return new BPromise(function(_0x2fe8d4,_0x68bd19){return client['request'](_0x187870,_0x23ca50)[_0xea5e('0xa')](function(_0x42365c){logger[_0xea5e('0xb')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5d4ba8,_0xea5e('0xc'));logger[_0xea5e('0xd')](_0xea5e('0xe'),_0x5d4ba8,_0xea5e('0xc'),JSON['stringify'](_0x42365c));if(_0x42365c[_0xea5e('0xf')]){if(_0x42365c[_0xea5e('0xf')][_0xea5e('0x10')]===0x1f4){logger[_0xea5e('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5d4ba8,_0x42365c[_0xea5e('0xf')]['message']);return _0x68bd19(_0x42365c[_0xea5e('0xf')][_0xea5e('0x11')]);}logger[_0xea5e('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5d4ba8,_0x42365c['error'][_0xea5e('0x11')]);return _0x2fe8d4(_0x42365c['error'][_0xea5e('0x11')]);}else{logger[_0xea5e('0xb')](_0xea5e('0x12'),_0x5d4ba8,_0xea5e('0xc'));_0x2fe8d4(_0x42365c[_0xea5e('0x13')][_0xea5e('0x11')]);}})[_0xea5e('0x14')](function(_0x13edd9){logger[_0xea5e('0xf')](_0xea5e('0x12'),_0x5d4ba8,_0x13edd9);_0x68bd19(_0x13edd9);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 32c4342..8c5749f 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 _0x074f=['/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x4c2dfc,_0x4814c0){var _0xfd728d=function(_0x5b8d81){while(--_0x5b8d81){_0x4c2dfc['push'](_0x4c2dfc['shift']());}};_0xfd728d(++_0x4814c0);}(_0x074f,0x97));var _0xf074=function(_0x3fc855,_0x33ad4c){_0x3fc855=_0x3fc855-0x0;var _0x1a28d8=_0x074f[_0x3fc855];return _0x1a28d8;};'use strict';var multer=require(_0xf074('0x0'));var util=require(_0xf074('0x1'));var path=require(_0xf074('0x2'));var timeout=require(_0xf074('0x3'));var express=require('express');var router=express[_0xf074('0x4')]();var auth=require(_0xf074('0x5'));var interaction=require(_0xf074('0x6'));var config=require('../../config/environment');var controller=require(_0xf074('0x7'));router[_0xf074('0x8')]('/',auth[_0xf074('0x9')](),controller[_0xf074('0xa')]);router[_0xf074('0x8')](_0xf074('0xb'),auth[_0xf074('0x9')](),controller[_0xf074('0xc')]);router[_0xf074('0xd')]('/',auth[_0xf074('0x9')](),controller[_0xf074('0xe')]);router['put'](_0xf074('0xb'),auth[_0xf074('0x9')](),controller['update']);router[_0xf074('0xf')](_0xf074('0xb'),auth['isAuthenticated'](),controller[_0xf074('0x10')]);module[_0xf074('0x11')]=router; \ No newline at end of file +var _0x074b=['show','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','/:id'];(function(_0x55cde0,_0x10f749){var _0x3240ad=function(_0x22de77){while(--_0x22de77){_0x55cde0['push'](_0x55cde0['shift']());}};_0x3240ad(++_0x10f749);}(_0x074b,0x195));var _0xb074=function(_0x4b0446,_0x4cb11c){_0x4b0446=_0x4b0446-0x0;var _0x27cf5d=_0x074b[_0x4b0446];return _0x27cf5d;};'use strict';var multer=require(_0xb074('0x0'));var util=require(_0xb074('0x1'));var path=require(_0xb074('0x2'));var timeout=require(_0xb074('0x3'));var express=require(_0xb074('0x4'));var router=express[_0xb074('0x5')]();var auth=require(_0xb074('0x6'));var interaction=require(_0xb074('0x7'));var config=require(_0xb074('0x8'));var controller=require(_0xb074('0x9'));router['get']('/',auth[_0xb074('0xa')](),controller[_0xb074('0xb')]);router['get'](_0xb074('0xc'),auth[_0xb074('0xa')](),controller[_0xb074('0xd')]);router[_0xb074('0xe')]('/',auth[_0xb074('0xa')](),controller['create']);router[_0xb074('0xf')](_0xb074('0xc'),auth[_0xb074('0xa')](),controller[_0xb074('0x10')]);router[_0xb074('0x11')](_0xb074('0xc'),auth['isAuthenticated'](),controller[_0xb074('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 6c44745..a0bbda3 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 _0x00b3=['BOOLEAN','sequelize','string','variable','STRING','customVariable'];(function(_0x51b37a,_0xceffc5){var _0x3e2a22=function(_0x58af1b){while(--_0x58af1b){_0x51b37a['push'](_0x51b37a['shift']());}};_0x3e2a22(++_0xceffc5);}(_0x00b3,0x97));var _0x300b=function(_0xc29574,_0x56eaa4){_0xc29574=_0xc29574-0x0;var _0x33ab11=_0x00b3[_0xc29574];return _0x33ab11;};'use strict';var Sequelize=require(_0x300b('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x300b('0x1'),_0x300b('0x2'),'customVariable','keyValue'),'defaultValue':_0x300b('0x1')},'content':{'type':Sequelize[_0x300b('0x3')]},'key':{'type':Sequelize[_0x300b('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0x300b('0x1'),_0x300b('0x2'),_0x300b('0x4'))},'keyContent':{'type':Sequelize[_0x300b('0x3')]},'idField':{'type':Sequelize[_0x300b('0x3')]},'nameField':{'type':Sequelize[_0x300b('0x3')]},'customField':{'type':Sequelize[_0x300b('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x300b('0x3')]}}; \ No newline at end of file +var _0x3c06=['exports','ENUM','string','variable','customVariable','STRING','BOOLEAN','sequelize'];(function(_0x5f43b3,_0x3e64d7){var _0xbc3960=function(_0x4efdf8){while(--_0x4efdf8){_0x5f43b3['push'](_0x5f43b3['shift']());}};_0xbc3960(++_0x3e64d7);}(_0x3c06,0xf7));var _0x63c0=function(_0x4456c9,_0x29aff0){_0x4456c9=_0x4456c9-0x0;var _0x3a9e5d=_0x3c06[_0x4456c9];return _0x3a9e5d;};'use strict';var Sequelize=require(_0x63c0('0x0'));module[_0x63c0('0x1')]={'type':{'type':Sequelize[_0x63c0('0x2')](_0x63c0('0x3'),_0x63c0('0x4'),_0x63c0('0x5'),'keyValue'),'defaultValue':_0x63c0('0x3')},'content':{'type':Sequelize[_0x63c0('0x6')]},'key':{'type':Sequelize[_0x63c0('0x6')]},'keyType':{'type':Sequelize[_0x63c0('0x2')](_0x63c0('0x3'),_0x63c0('0x4'),_0x63c0('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x63c0('0x6')]},'customField':{'type':Sequelize[_0x63c0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x63c0('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index cf359e3..2eb09da 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 _0xf3ed=['fields','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','length','includeAll','merge','find','create','body','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes'];(function(_0xdfe34d,_0x21161d){var _0x54887d=function(_0x3286a2){while(--_0x3286a2){_0xdfe34d['push'](_0xdfe34d['shift']());}};_0x54887d(++_0x21161d);}(_0xf3ed,0x1d3));var _0xdf3e=function(_0x1d48ca,_0x1479da){_0x1d48ca=_0x1d48ca-0x0;var _0x336129=_0xf3ed[_0x1d48ca];return _0x336129;};'use strict';var pdf=require(_0xdf3e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdf3e('0x1'));var zipdir=require(_0xdf3e('0x2'));var jsonpatch=require(_0xdf3e('0x3'));var rp=require('request-promise');var moment=require(_0xdf3e('0x4'));var BPromise=require(_0xdf3e('0x5'));var Mustache=require('mustache');var util=require(_0xdf3e('0x6'));var path=require(_0xdf3e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdf3e('0x8'));var fs=require('fs');var _=require(_0xdf3e('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdf3e('0xa'));var deskjs=require(_0xdf3e('0xb'));var toCsv=require(_0xdf3e('0xc'));var querystring=require(_0xdf3e('0xd'));var Papa=require(_0xdf3e('0xe'));var Redis=require('ioredis');var authService=require(_0xdf3e('0xf'));var qs=require(_0xdf3e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdf3e('0x11'))(_0xdf3e('0x12'));var utils=require(_0xdf3e('0x13'));var config=require(_0xdf3e('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x832e03,_0x3ba3c3){_0x3ba3c3=_0x3ba3c3||0xcc;return function(_0x34bed4){if(_0x34bed4){return _0x832e03[_0xdf3e('0x15')](_0x3ba3c3);}return _0x832e03[_0xdf3e('0x16')](_0x3ba3c3)[_0xdf3e('0x17')]();};}function respondWithResult(_0x318dd6,_0x505952){_0x505952=_0x505952||0xc8;return function(_0x3ee0b4){if(_0x3ee0b4){return _0x318dd6[_0xdf3e('0x16')](_0x505952)[_0xdf3e('0x18')](_0x3ee0b4);}};}function respondWithFilteredResult(_0x1b4bb2,_0x28a6bb){return function(_0xcd735d){if(_0xcd735d){var _0x3f4ad6=_0xcd735d[_0xdf3e('0x19')],_0xb5c8f4=_0x28a6bb[_0xdf3e('0x1a')],_0x3ff2cc=_0x28a6bb[_0xdf3e('0x1a')]+_0x28a6bb[_0xdf3e('0x1b')],_0x1c9c42;if(_0x3ff2cc>=_0x3f4ad6){_0x3ff2cc=_0x3f4ad6;_0x1c9c42=0xc8;}else{_0x1c9c42=0xce;}_0x1b4bb2[_0xdf3e('0x16')](_0x1c9c42);return _0x1b4bb2[_0xdf3e('0x1c')](_0xdf3e('0x1d'),_0xb5c8f4+'-'+_0x3ff2cc+'/'+_0x3f4ad6)[_0xdf3e('0x18')](_0xcd735d);}return null;};}function patchUpdates(_0x54ac5d){return function(_0x32209){try{jsonpatch[_0xdf3e('0x1e')](_0x32209,_0x54ac5d,!![]);}catch(_0x84d221){return BPromise[_0xdf3e('0x1f')](_0x84d221);}return _0x32209[_0xdf3e('0x20')]();};}function saveUpdates(_0x714852,_0x8e58eb){return function(_0x10a2cc){if(_0x10a2cc){return _0x10a2cc[_0xdf3e('0x21')](_0x714852)[_0xdf3e('0x22')](function(_0x472656){return _0x472656;});}return null;};}function removeEntity(_0x3d9fa1,_0x454473){return function(_0x22ce49){if(_0x22ce49){return _0x22ce49['destroy']()[_0xdf3e('0x22')](function(){_0x3d9fa1[_0xdf3e('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ee2ea,_0x4da048){return function(_0xdc40ba){if(!_0xdc40ba){_0x1ee2ea[_0xdf3e('0x15')](0x194);}return _0xdc40ba;};}function handleError(_0x1784bf,_0x7c5d7f){_0x7c5d7f=_0x7c5d7f||0x1f4;return function(_0x51871c){logger[_0xdf3e('0x23')](_0x51871c[_0xdf3e('0x24')]);if(_0x51871c[_0xdf3e('0x25')]){delete _0x51871c[_0xdf3e('0x25')];}_0x1784bf[_0xdf3e('0x16')](_0x7c5d7f)[_0xdf3e('0x26')](_0x51871c);};}exports[_0xdf3e('0x27')]=function(_0x5ad1ae,_0x2aaa97){var _0x4cb7d0={},_0x2d3879={},_0x16bdd7={'count':0x0,'rows':[]};var _0x2848e3=_[_0xdf3e('0x28')](db[_0xdf3e('0x29')][_0xdf3e('0x2a')],function(_0x587824){return{'name':_0x587824[_0xdf3e('0x2b')],'type':_0x587824[_0xdf3e('0x2c')][_0xdf3e('0x2d')]};});_0x2d3879[_0xdf3e('0x2e')]=_[_0xdf3e('0x28')](_0x2848e3,'name');_0x2d3879[_0xdf3e('0x2f')]=_[_0xdf3e('0x30')](_0x5ad1ae[_0xdf3e('0x2f')]);_0x2d3879['filters']=_[_0xdf3e('0x31')](_0x2d3879['model'],_0x2d3879['query']);_0x4cb7d0[_0xdf3e('0x32')]=_[_0xdf3e('0x31')](_0x2d3879[_0xdf3e('0x2e')],qs['fields'](_0x5ad1ae['query'][_0xdf3e('0x33')]));_0x4cb7d0['attributes']=_0x4cb7d0[_0xdf3e('0x32')]['length']?_0x4cb7d0['attributes']:_0x2d3879[_0xdf3e('0x2e')];if(!_0x5ad1ae['query'][_0xdf3e('0x34')]('nolimit')){_0x4cb7d0[_0xdf3e('0x1b')]=qs[_0xdf3e('0x1b')](_0x5ad1ae[_0xdf3e('0x2f')][_0xdf3e('0x1b')]);_0x4cb7d0[_0xdf3e('0x1a')]=qs[_0xdf3e('0x1a')](_0x5ad1ae[_0xdf3e('0x2f')][_0xdf3e('0x1a')]);}_0x4cb7d0[_0xdf3e('0x35')]=qs[_0xdf3e('0x36')](_0x5ad1ae[_0xdf3e('0x2f')][_0xdf3e('0x36')]);_0x4cb7d0[_0xdf3e('0x37')]=qs[_0xdf3e('0x38')](_[_0xdf3e('0x39')](_0x5ad1ae[_0xdf3e('0x2f')],_0x2d3879[_0xdf3e('0x38')]),_0x2848e3);if(_0x5ad1ae[_0xdf3e('0x2f')]['filter']){_0x4cb7d0[_0xdf3e('0x37')]=_['merge'](_0x4cb7d0[_0xdf3e('0x37')],{'$or':_[_0xdf3e('0x28')](_0x2848e3,function(_0x130faa){if(_0x130faa[_0xdf3e('0x2c')]!==_0xdf3e('0x3a')){var _0x462662={};_0x462662[_0x130faa[_0xdf3e('0x25')]]={'$like':'%'+_0x5ad1ae['query'][_0xdf3e('0x3b')]+'%'};return _0x462662;}})});}_0x4cb7d0=_['merge']({},_0x4cb7d0,_0x5ad1ae[_0xdf3e('0x3c')]);var _0x534b0d={'where':_0x4cb7d0[_0xdf3e('0x37')]};return db[_0xdf3e('0x29')][_0xdf3e('0x19')](_0x534b0d)[_0xdf3e('0x22')](function(_0x1fef25){_0x16bdd7[_0xdf3e('0x19')]=_0x1fef25;if(_0x5ad1ae['query']['includeAll']){_0x4cb7d0[_0xdf3e('0x3d')]=[{'all':!![]}];}return db[_0xdf3e('0x29')][_0xdf3e('0x3e')](_0x4cb7d0);})[_0xdf3e('0x22')](function(_0x4bbebc){_0x16bdd7[_0xdf3e('0x3f')]=_0x4bbebc;return _0x16bdd7;})[_0xdf3e('0x22')](respondWithFilteredResult(_0x2aaa97,_0x4cb7d0))[_0xdf3e('0x40')](handleError(_0x2aaa97,null));};exports[_0xdf3e('0x41')]=function(_0x5854ed,_0x309e70){var _0x545af0={'raw':!![],'where':{'id':_0x5854ed[_0xdf3e('0x42')]['id']}},_0x376c02={};_0x376c02[_0xdf3e('0x2e')]=_['keys'](db[_0xdf3e('0x29')][_0xdf3e('0x2a')]);_0x376c02['query']=_['keys'](_0x5854ed[_0xdf3e('0x2f')]);_0x376c02[_0xdf3e('0x38')]=_[_0xdf3e('0x31')](_0x376c02[_0xdf3e('0x2e')],_0x376c02[_0xdf3e('0x2f')]);_0x545af0['attributes']=_[_0xdf3e('0x31')](_0x376c02['model'],qs[_0xdf3e('0x33')](_0x5854ed[_0xdf3e('0x2f')][_0xdf3e('0x33')]));_0x545af0[_0xdf3e('0x32')]=_0x545af0[_0xdf3e('0x32')][_0xdf3e('0x43')]?_0x545af0[_0xdf3e('0x32')]:_0x376c02['model'];if(_0x5854ed[_0xdf3e('0x2f')][_0xdf3e('0x44')]){_0x545af0[_0xdf3e('0x3d')]=[{'all':!![]}];}_0x545af0=_[_0xdf3e('0x45')]({},_0x545af0,_0x5854ed[_0xdf3e('0x3c')]);return db[_0xdf3e('0x29')][_0xdf3e('0x46')](_0x545af0)[_0xdf3e('0x22')](handleEntityNotFound(_0x309e70,null))[_0xdf3e('0x22')](respondWithResult(_0x309e70,null))[_0xdf3e('0x40')](handleError(_0x309e70,null));};exports[_0xdf3e('0x47')]=function(_0x1b814a,_0x3d451c){return db[_0xdf3e('0x29')][_0xdf3e('0x47')](_0x1b814a['body'],{})['then'](respondWithResult(_0x3d451c,0xc9))['catch'](handleError(_0x3d451c,null));};exports['update']=function(_0x106660,_0x1fb4f8){if(_0x106660['body']['id']){delete _0x106660[_0xdf3e('0x48')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x106660[_0xdf3e('0x42')]['id']}})['then'](handleEntityNotFound(_0x1fb4f8,null))[_0xdf3e('0x22')](saveUpdates(_0x106660[_0xdf3e('0x48')],null))[_0xdf3e('0x22')](respondWithResult(_0x1fb4f8,null))['catch'](handleError(_0x1fb4f8,null));};exports[_0xdf3e('0x49')]=function(_0x1fe659,_0x3ced6a){return db[_0xdf3e('0x29')]['find']({'where':{'id':_0x1fe659[_0xdf3e('0x42')]['id']}})[_0xdf3e('0x22')](handleEntityNotFound(_0x3ced6a,null))[_0xdf3e('0x22')](removeEntity(_0x3ced6a,null))[_0xdf3e('0x40')](handleError(_0x3ced6a,null));}; \ No newline at end of file +var _0xa055=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','includeAll','rows','catch','params','include','options','find','body','update','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','destroy','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa055,0x161));var _0x5a05=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xa055[_0x413feb];return _0x40ee88;};'use strict';var pdf=require(_0x5a05('0x0'));var emlformat=require(_0x5a05('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5a05('0x2'));var moment=require(_0x5a05('0x3'));var BPromise=require(_0x5a05('0x4'));var Mustache=require(_0x5a05('0x5'));var util=require(_0x5a05('0x6'));var path=require(_0x5a05('0x7'));var sox=require(_0x5a05('0x8'));var csv=require(_0x5a05('0x9'));var ejs=require(_0x5a05('0xa'));var fs=require('fs');var _=require(_0x5a05('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5a05('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a05('0xc'));var authService=require(_0x5a05('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5a05('0xe'));var hardwareService=require(_0x5a05('0xf'));var logger=require(_0x5a05('0x10'))(_0x5a05('0x11'));var utils=require(_0x5a05('0x12'));var config=require(_0x5a05('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ede8,_0x4d9e11){_0x4d9e11=_0x4d9e11||0xcc;return function(_0x3b474a){if(_0x3b474a){return _0x24ede8[_0x5a05('0x14')](_0x4d9e11);}return _0x24ede8[_0x5a05('0x15')](_0x4d9e11)[_0x5a05('0x16')]();};}function respondWithResult(_0x37d94a,_0x2bb00b){_0x2bb00b=_0x2bb00b||0xc8;return function(_0x40c02f){if(_0x40c02f){return _0x37d94a[_0x5a05('0x15')](_0x2bb00b)[_0x5a05('0x17')](_0x40c02f);}};}function respondWithFilteredResult(_0x21ca35,_0x35e2c1){return function(_0x5751c4){if(_0x5751c4){var _0x3a5211=_0x5751c4[_0x5a05('0x18')],_0x475f82=_0x35e2c1[_0x5a05('0x19')],_0x388dc2=_0x35e2c1[_0x5a05('0x19')]+_0x35e2c1[_0x5a05('0x1a')],_0xb4b49e;if(_0x388dc2>=_0x3a5211){_0x388dc2=_0x3a5211;_0xb4b49e=0xc8;}else{_0xb4b49e=0xce;}_0x21ca35['status'](_0xb4b49e);return _0x21ca35['set'](_0x5a05('0x1b'),_0x475f82+'-'+_0x388dc2+'/'+_0x3a5211)[_0x5a05('0x17')](_0x5751c4);}return null;};}function patchUpdates(_0x342bd8){return function(_0x45e3d7){try{jsonpatch[_0x5a05('0x1c')](_0x45e3d7,_0x342bd8,!![]);}catch(_0x26f3be){return BPromise[_0x5a05('0x1d')](_0x26f3be);}return _0x45e3d7['save']();};}function saveUpdates(_0x4085c3,_0x7dd647){return function(_0x44c7a3){if(_0x44c7a3){return _0x44c7a3['update'](_0x4085c3)['then'](function(_0x4c6845){return _0x4c6845;});}return null;};}function removeEntity(_0x1f0d9c,_0x5df3e7){return function(_0x26fe8b){if(_0x26fe8b){return _0x26fe8b[_0x5a05('0x1e')]()[_0x5a05('0x1f')](function(){_0x1f0d9c[_0x5a05('0x15')](0xcc)[_0x5a05('0x16')]();});}};}function handleEntityNotFound(_0x2948e1,_0x473f45){return function(_0x316408){if(!_0x316408){_0x2948e1[_0x5a05('0x14')](0x194);}return _0x316408;};}function handleError(_0x563da4,_0x4b98a1){_0x4b98a1=_0x4b98a1||0x1f4;return function(_0x2c0508){logger[_0x5a05('0x20')](_0x2c0508[_0x5a05('0x21')]);if(_0x2c0508[_0x5a05('0x22')]){delete _0x2c0508[_0x5a05('0x22')];}_0x563da4[_0x5a05('0x15')](_0x4b98a1)[_0x5a05('0x23')](_0x2c0508);};}exports[_0x5a05('0x24')]=function(_0x5934f3,_0x43bcd7){var _0x245ac0={},_0x43980b={},_0x4f6249={'count':0x0,'rows':[]};var _0x49f129=_[_0x5a05('0x25')](db[_0x5a05('0x26')][_0x5a05('0x27')],function(_0x533ea0){return{'name':_0x533ea0[_0x5a05('0x28')],'type':_0x533ea0[_0x5a05('0x29')][_0x5a05('0x2a')]};});_0x43980b[_0x5a05('0x2b')]=_[_0x5a05('0x25')](_0x49f129,_0x5a05('0x22'));_0x43980b[_0x5a05('0x2c')]=_['keys'](_0x5934f3['query']);_0x43980b[_0x5a05('0x2d')]=_[_0x5a05('0x2e')](_0x43980b[_0x5a05('0x2b')],_0x43980b[_0x5a05('0x2c')]);_0x245ac0[_0x5a05('0x2f')]=_[_0x5a05('0x2e')](_0x43980b[_0x5a05('0x2b')],qs[_0x5a05('0x30')](_0x5934f3['query'][_0x5a05('0x30')]));_0x245ac0['attributes']=_0x245ac0[_0x5a05('0x2f')][_0x5a05('0x31')]?_0x245ac0['attributes']:_0x43980b[_0x5a05('0x2b')];if(!_0x5934f3[_0x5a05('0x2c')][_0x5a05('0x32')]('nolimit')){_0x245ac0['limit']=qs[_0x5a05('0x1a')](_0x5934f3[_0x5a05('0x2c')][_0x5a05('0x1a')]);_0x245ac0[_0x5a05('0x19')]=qs[_0x5a05('0x19')](_0x5934f3[_0x5a05('0x2c')][_0x5a05('0x19')]);}_0x245ac0[_0x5a05('0x33')]=qs[_0x5a05('0x34')](_0x5934f3[_0x5a05('0x2c')][_0x5a05('0x34')]);_0x245ac0[_0x5a05('0x35')]=qs['filters'](_[_0x5a05('0x36')](_0x5934f3[_0x5a05('0x2c')],_0x43980b[_0x5a05('0x2d')]),_0x49f129);if(_0x5934f3[_0x5a05('0x2c')]['filter']){_0x245ac0['where']=_[_0x5a05('0x37')](_0x245ac0[_0x5a05('0x35')],{'$or':_[_0x5a05('0x25')](_0x49f129,function(_0x414065){if(_0x414065['type']!=='VIRTUAL'){var _0x3ba1df={};_0x3ba1df[_0x414065['name']]={'$like':'%'+_0x5934f3['query'][_0x5a05('0x38')]+'%'};return _0x3ba1df;}})});}_0x245ac0=_[_0x5a05('0x37')]({},_0x245ac0,_0x5934f3['options']);var _0x4ce916={'where':_0x245ac0[_0x5a05('0x35')]};return db[_0x5a05('0x26')]['count'](_0x4ce916)[_0x5a05('0x1f')](function(_0x3e6964){_0x4f6249[_0x5a05('0x18')]=_0x3e6964;if(_0x5934f3[_0x5a05('0x2c')][_0x5a05('0x39')]){_0x245ac0['include']=[{'all':!![]}];}return db['ZendeskField']['findAll'](_0x245ac0);})[_0x5a05('0x1f')](function(_0x33bc41){_0x4f6249[_0x5a05('0x3a')]=_0x33bc41;return _0x4f6249;})[_0x5a05('0x1f')](respondWithFilteredResult(_0x43bcd7,_0x245ac0))[_0x5a05('0x3b')](handleError(_0x43bcd7,null));};exports['show']=function(_0x1e1f29,_0x37f5ae){var _0x34b280={'raw':!![],'where':{'id':_0x1e1f29[_0x5a05('0x3c')]['id']}},_0x1da95b={};_0x1da95b[_0x5a05('0x2b')]=_['keys'](db[_0x5a05('0x26')]['rawAttributes']);_0x1da95b[_0x5a05('0x2c')]=_['keys'](_0x1e1f29['query']);_0x1da95b[_0x5a05('0x2d')]=_['intersection'](_0x1da95b[_0x5a05('0x2b')],_0x1da95b[_0x5a05('0x2c')]);_0x34b280[_0x5a05('0x2f')]=_[_0x5a05('0x2e')](_0x1da95b[_0x5a05('0x2b')],qs[_0x5a05('0x30')](_0x1e1f29[_0x5a05('0x2c')][_0x5a05('0x30')]));_0x34b280[_0x5a05('0x2f')]=_0x34b280['attributes'][_0x5a05('0x31')]?_0x34b280['attributes']:_0x1da95b[_0x5a05('0x2b')];if(_0x1e1f29['query'][_0x5a05('0x39')]){_0x34b280[_0x5a05('0x3d')]=[{'all':!![]}];}_0x34b280=_[_0x5a05('0x37')]({},_0x34b280,_0x1e1f29[_0x5a05('0x3e')]);return db['ZendeskField'][_0x5a05('0x3f')](_0x34b280)['then'](handleEntityNotFound(_0x37f5ae,null))[_0x5a05('0x1f')](respondWithResult(_0x37f5ae,null))[_0x5a05('0x3b')](handleError(_0x37f5ae,null));};exports['create']=function(_0x42c04b,_0x20939a){return db['ZendeskField']['create'](_0x42c04b[_0x5a05('0x40')],{})[_0x5a05('0x1f')](respondWithResult(_0x20939a,0xc9))[_0x5a05('0x3b')](handleError(_0x20939a,null));};exports[_0x5a05('0x41')]=function(_0x1ec30c,_0x3a85d3){if(_0x1ec30c[_0x5a05('0x40')]['id']){delete _0x1ec30c[_0x5a05('0x40')]['id'];}return db['ZendeskField'][_0x5a05('0x3f')]({'where':{'id':_0x1ec30c[_0x5a05('0x3c')]['id']}})['then'](handleEntityNotFound(_0x3a85d3,null))['then'](saveUpdates(_0x1ec30c[_0x5a05('0x40')],null))[_0x5a05('0x1f')](respondWithResult(_0x3a85d3,null))[_0x5a05('0x3b')](handleError(_0x3a85d3,null));};exports[_0x5a05('0x1e')]=function(_0x87a12b,_0x171a7c){return db[_0x5a05('0x26')][_0x5a05('0x3f')]({'where':{'id':_0x87a12b[_0x5a05('0x3c')]['id']}})['then'](handleEntityNotFound(_0x171a7c,null))[_0x5a05('0x1f')](removeEntity(_0x171a7c,null))[_0x5a05('0x3b')](handleError(_0x171a7c,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 273d4e1..344a8dc 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 _0xf45e=['ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define'];(function(_0x1997db,_0x179579){var _0x1e85f6=function(_0x3ada1d){while(--_0x3ada1d){_0x1997db['push'](_0x1997db['shift']());}};_0x1e85f6(++_0x179579);}(_0xf45e,0x115));var _0xef45=function(_0x3ac7d2,_0x1bc622){_0x3ac7d2=_0x3ac7d2-0x0;var _0x3d5ccb=_0xf45e[_0x3ac7d2];return _0x3d5ccb;};'use strict';var _=require(_0xef45('0x0'));var util=require('util');var logger=require(_0xef45('0x1'))('api');var moment=require(_0xef45('0x2'));var BPromise=require(_0xef45('0x3'));var rp=require(_0xef45('0x4'));var fs=require('fs');var path=require(_0xef45('0x5'));var rimraf=require(_0xef45('0x6'));var config=require(_0xef45('0x7'));var attributes=require(_0xef45('0x8'));module[_0xef45('0x9')]=function(_0x338960,_0x315b84){return _0x338960[_0xef45('0xa')](_0xef45('0xb'),attributes,{'tableName':_0xef45('0xc'),'paranoid':![],'indexes':[{'name':_0xef45('0xd'),'fields':[_0xef45('0xe'),_0xef45('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['FieldId','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','int_zendesk_fields','zendesk_unique_index','idField'];(function(_0x41cb50,_0x27cadb){var _0x3588dc=function(_0x4d580a){while(--_0x4d580a){_0x41cb50['push'](_0x41cb50['shift']());}};_0x3588dc(++_0x27cadb);}(_0x757a,0xde));var _0xa757=function(_0x4cd9f6,_0x4a0554){_0x4cd9f6=_0x4cd9f6-0x0;var _0x3c03e4=_0x757a[_0x4cd9f6];return _0x3c03e4;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ZendeskField',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xb'),_0xa757('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 b769728..1602721 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 _0x6c31=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','util','moment','randomstring','ioredis'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x6c31,0xf8));var _0x16c3=function(_0xcb0eb2,_0x3906bf){_0xcb0eb2=_0xcb0eb2-0x0;var _0xbab9b8=_0x6c31[_0xcb0eb2];return _0xbab9b8;};'use strict';var _=require('lodash');var util=require(_0x16c3('0x0'));var moment=require(_0x16c3('0x1'));var BPromise=require('bluebird');var rs=require(_0x16c3('0x2'));var fs=require('fs');var Redis=require(_0x16c3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x16c3('0x4'));var logger=require(_0x16c3('0x5'))('rpc');var config=require(_0x16c3('0x6'));var jayson=require(_0x16c3('0x7'));var client=jayson[_0x16c3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d1212,_0x88fec9,_0x11a180){return new BPromise(function(_0x1a2495,_0x10222f){return client[_0x16c3('0x9')](_0x3d1212,_0x11a180)[_0x16c3('0xa')](function(_0x2bd410){logger['info'](_0x16c3('0xb'),_0x88fec9,'request\x20sent');logger[_0x16c3('0xc')](_0x16c3('0xd'),_0x88fec9,_0x16c3('0xe'),JSON['stringify'](_0x2bd410));if(_0x2bd410[_0x16c3('0xf')]){if(_0x2bd410[_0x16c3('0xf')][_0x16c3('0x10')]===0x1f4){logger[_0x16c3('0xf')](_0x16c3('0xb'),_0x88fec9,_0x2bd410[_0x16c3('0xf')]['message']);return _0x10222f(_0x2bd410[_0x16c3('0xf')][_0x16c3('0x11')]);}logger[_0x16c3('0xf')](_0x16c3('0xb'),_0x88fec9,_0x2bd410['error']['message']);return _0x1a2495(_0x2bd410[_0x16c3('0xf')]['message']);}else{logger[_0x16c3('0x12')](_0x16c3('0xb'),_0x88fec9,_0x16c3('0xe'));_0x1a2495(_0x2bd410[_0x16c3('0x13')][_0x16c3('0x11')]);}})[_0x16c3('0x14')](function(_0x543413){logger[_0x16c3('0xf')](_0x16c3('0xb'),_0x88fec9,_0x543413);_0x10222f(_0x543413);});});} \ No newline at end of file +var _0x5538=['randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x1da580,_0x27f76d){var _0x4e6c87=function(_0x5de2b7){while(--_0x5de2b7){_0x1da580['push'](_0x1da580['shift']());}};_0x4e6c87(++_0x27f76d);}(_0x5538,0x11b));var _0x8553=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0x5538[_0x34ad72];return _0x5c9aa8;};'use strict';var _=require(_0x8553('0x0'));var util=require('util');var moment=require(_0x8553('0x1'));var BPromise=require(_0x8553('0x2'));var rs=require(_0x8553('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8553('0x4'));var logger=require('../../config/logger')(_0x8553('0x5'));var config=require(_0x8553('0x6'));var jayson=require(_0x8553('0x7'));var client=jayson[_0x8553('0x8')][_0x8553('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x332818,_0x1d561a,_0x64a739){return new BPromise(function(_0x3c35e3,_0x2c1a30){return client[_0x8553('0xa')](_0x332818,_0x64a739)[_0x8553('0xb')](function(_0x81c08e){logger[_0x8553('0xc')](_0x8553('0xd'),_0x1d561a,_0x8553('0xe'));logger[_0x8553('0xf')](_0x8553('0x10'),_0x1d561a,_0x8553('0xe'),JSON[_0x8553('0x11')](_0x81c08e));if(_0x81c08e[_0x8553('0x12')]){if(_0x81c08e[_0x8553('0x12')][_0x8553('0x13')]===0x1f4){logger[_0x8553('0x12')](_0x8553('0xd'),_0x1d561a,_0x81c08e[_0x8553('0x12')][_0x8553('0x14')]);return _0x2c1a30(_0x81c08e['error'][_0x8553('0x14')]);}logger[_0x8553('0x12')](_0x8553('0xd'),_0x1d561a,_0x81c08e['error'][_0x8553('0x14')]);return _0x3c35e3(_0x81c08e[_0x8553('0x12')][_0x8553('0x14')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x1d561a,'request\x20sent');_0x3c35e3(_0x81c08e[_0x8553('0x15')][_0x8553('0x14')]);}})['catch'](function(_0x4178fc){logger['error'](_0x8553('0xd'),_0x1d561a,_0x4178fc);_0x2c1a30(_0x4178fc);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index f41226b..fb5d61d 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 _0xab46=['../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','/:id','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','util','connect-timeout','express'];(function(_0x5a2ba3,_0x1c7e23){var _0x53ac3b=function(_0x1edcd9){while(--_0x1edcd9){_0x5a2ba3['push'](_0x5a2ba3['shift']());}};_0x53ac3b(++_0x1c7e23);}(_0xab46,0x101));var _0x6ab4=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xab46[_0x173d7e];return _0x2220d6;};'use strict';var multer=require('multer');var util=require(_0x6ab4('0x0'));var path=require('path');var timeout=require(_0x6ab4('0x1'));var express=require(_0x6ab4('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6ab4('0x3'));var config=require(_0x6ab4('0x4'));var controller=require(_0x6ab4('0x5'));router[_0x6ab4('0x6')]('/',auth['isAuthenticated'](),controller[_0x6ab4('0x7')]);router[_0x6ab4('0x6')](_0x6ab4('0x8'),auth[_0x6ab4('0x9')](),controller['show']);router['get']('/:id/configurations',auth[_0x6ab4('0x9')](),controller[_0x6ab4('0xa')]);router['get'](_0x6ab4('0xb'),auth['isAuthenticated'](),controller[_0x6ab4('0xc')]);router[_0x6ab4('0xd')]('/',auth[_0x6ab4('0x9')](),controller[_0x6ab4('0xe')]);router['post'](_0x6ab4('0xf'),auth[_0x6ab4('0x9')](),controller[_0x6ab4('0x10')]);router[_0x6ab4('0x11')](_0x6ab4('0x8'),auth[_0x6ab4('0x9')](),controller[_0x6ab4('0x12')]);router[_0x6ab4('0x13')](_0x6ab4('0x8'),auth[_0x6ab4('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1721=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','index','/:id','show','isAuthenticated','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1721,0x1df));var _0x1172=function(_0x5922b1,_0x2f76cb){_0x5922b1=_0x5922b1-0x0;var _0x2cbf1b=_0x1721[_0x5922b1];return _0x2cbf1b;};'use strict';var multer=require('multer');var util=require(_0x1172('0x0'));var path=require(_0x1172('0x1'));var timeout=require('connect-timeout');var express=require(_0x1172('0x2'));var router=express[_0x1172('0x3')]();var auth=require(_0x1172('0x4'));var interaction=require(_0x1172('0x5'));var config=require(_0x1172('0x6'));var controller=require(_0x1172('0x7'));router[_0x1172('0x8')]('/',auth['isAuthenticated'](),controller[_0x1172('0x9')]);router[_0x1172('0x8')](_0x1172('0xa'),auth['isAuthenticated'](),controller[_0x1172('0xb')]);router[_0x1172('0x8')]('/:id/configurations',auth[_0x1172('0xc')](),controller[_0x1172('0xd')]);router[_0x1172('0x8')](_0x1172('0xe'),auth[_0x1172('0xc')](),controller['getFields']);router[_0x1172('0xf')]('/',auth['isAuthenticated'](),controller[_0x1172('0x10')]);router[_0x1172('0xf')](_0x1172('0x11'),auth[_0x1172('0xc')](),controller[_0x1172('0x12')]);router[_0x1172('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x1172('0x14')]);router[_0x1172('0x15')](_0x1172('0xa'),auth[_0x1172('0xc')](),controller[_0x1172('0x16')]);module[_0x1172('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 8493788..a7e11bd 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 _0x75b8=['sequelize','exports','STRING'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x75b8,0x198));var _0x875b=function(_0x3da612,_0x332456){_0x3da612=_0x3da612-0x0;var _0x1a9d1d=_0x75b8[_0x3da612];return _0x1a9d1d;};'use strict';var Sequelize=require(_0x875b('0x0'));module[_0x875b('0x1')]={'name':{'type':Sequelize[_0x875b('0x2')]},'description':{'type':Sequelize[_0x875b('0x2')]},'host':{'type':Sequelize[_0x875b('0x2')]},'zone':{'type':Sequelize[_0x875b('0x2')]},'clientId':{'type':Sequelize[_0x875b('0x2')]},'clientSecret':{'type':Sequelize[_0x875b('0x2')]},'serverUrl':{'type':Sequelize[_0x875b('0x2')]},'code':{'type':Sequelize[_0x875b('0x2')]},'refreshToken':{'type':Sequelize[_0x875b('0x2')]}}; \ No newline at end of file +var _0x50cd=['sequelize','exports','STRING'];(function(_0xaaab21,_0x1700b5){var _0x271681=function(_0x5c695c){while(--_0x5c695c){_0xaaab21['push'](_0xaaab21['shift']());}};_0x271681(++_0x1700b5);}(_0x50cd,0x123));var _0xd50c=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0x50cd[_0x57fa7e];return _0x320671;};'use strict';var Sequelize=require(_0xd50c('0x0'));module[_0xd50c('0x1')]={'name':{'type':Sequelize[_0xd50c('0x2')]},'description':{'type':Sequelize[_0xd50c('0x2')]},'host':{'type':Sequelize[_0xd50c('0x2')]},'zone':{'type':Sequelize[_0xd50c('0x2')]},'clientId':{'type':Sequelize[_0xd50c('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xd50c('0x2')]},'code':{'type':Sequelize[_0xd50c('0x2')]},'refreshToken':{'type':Sequelize[_0xd50c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 27ad28d..edc7fe6 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 _0xd0fb=['rimraf','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','then','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','status','json','count','offset','limit','set','apply','reject','update','destroy','end','sendStatus','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','body','getConfigurations','findOne','ZohoConfiguration','order','addConfiguration','Subjects','getSubjects','channel','getDescriptions','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','/oauth/v2/token','clientId','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','clientSecret','serverUrl','refreshToken','com','lastIndexOf','GET','format','Calls','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','data_type','picklist','pick_list_values','Wrong\x20credentials','statusCode','html-pdf','eml-format'];(function(_0x523a61,_0x8ff44d){var _0x1a634a=function(_0x17c45c){while(--_0x17c45c){_0x523a61['push'](_0x523a61['shift']());}};_0x1a634a(++_0x8ff44d);}(_0xd0fb,0x7e));var _0xbd0f=function(_0x396235,_0x46936d){_0x396235=_0x396235-0x0;var _0xb911a8=_0xd0fb[_0x396235];return _0xb911a8;};'use strict';var pdf=require(_0xbd0f('0x0'));var emlformat=require(_0xbd0f('0x1'));var rimraf=require(_0xbd0f('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbd0f('0x3'));var moment=require('moment');var BPromise=require(_0xbd0f('0x4'));var Mustache=require(_0xbd0f('0x5'));var util=require(_0xbd0f('0x6'));var path=require(_0xbd0f('0x7'));var sox=require(_0xbd0f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xbd0f('0x9'));var squel=require(_0xbd0f('0xa'));var crypto=require(_0xbd0f('0xb'));var jsforce=require(_0xbd0f('0xc'));var deskjs=require(_0xbd0f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbd0f('0xe'));var Papa=require('papaparse');var Redis=require(_0xbd0f('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd0f('0x10'));var logger=require(_0xbd0f('0x11'))(_0xbd0f('0x12'));var utils=require('../../config/utils');var config=require(_0xbd0f('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbd0f('0x14'));var jayson=require('jayson/promise');var client=jayson[_0xbd0f('0x15')][_0xbd0f('0x16')]({'port':0x232a});function checkPasswordPattern(_0x24fdac,_0x533de1,_0x18b0e7){if(_0x18b0e7){var _0x449877=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x449877[_0xbd0f('0x17')](_0x533de1)){return _0x24fdac;}else{throw new db[(_0xbd0f('0x18'))][(_0xbd0f('0x19'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x24fdac;}}function respondWithRpcPromise(_0x522e3c,_0x1c66aa,_0x50831d,_0x56911a){return new BPromise(function(_0x3d1d86,_0x38e518){var _0x4d07d9=_0x56911a||client;return _0x4d07d9['request'](_0x522e3c,_0x50831d)[_0xbd0f('0x1a')](function(_0x57c05a){logger['info'](_0xbd0f('0x1b'),_0x1c66aa,'request\x20sent');logger[_0xbd0f('0x1c')](_0xbd0f('0x1d'),_0x1c66aa,_0xbd0f('0x1e'),JSON['stringify'](_0x57c05a));if(_0x57c05a[_0xbd0f('0x1f')]){if(_0x57c05a[_0xbd0f('0x1f')][_0xbd0f('0x20')]===0x1f4){logger[_0xbd0f('0x1f')](_0xbd0f('0x1b'),_0x1c66aa,_0x57c05a[_0xbd0f('0x1f')][_0xbd0f('0x21')]);return _0x38e518(_0x57c05a[_0xbd0f('0x1f')][_0xbd0f('0x21')]);}logger[_0xbd0f('0x1f')](_0xbd0f('0x1b'),_0x1c66aa,_0x57c05a['error'][_0xbd0f('0x21')]);return _0x3d1d86(_0x57c05a[_0xbd0f('0x1f')]['message']);}else{logger['info'](_0xbd0f('0x1b'),_0x1c66aa,'request\x20sent');_0x3d1d86(_0x57c05a['result'][_0xbd0f('0x21')]);}})[_0xbd0f('0x22')](function(_0x298722){logger['error'](_0xbd0f('0x1b'),_0x1c66aa,_0x298722);_0x38e518(_0x298722);});});}function respondWithStatusCode(_0x34148c,_0x4c81e0){_0x4c81e0=_0x4c81e0||0xcc;return function(_0x1a21e0){if(_0x1a21e0){return _0x34148c['sendStatus'](_0x4c81e0);}return _0x34148c[_0xbd0f('0x23')](_0x4c81e0)['end']();};}function respondWithResult(_0x39fce1,_0x5770e0){_0x5770e0=_0x5770e0||0xc8;return function(_0x125c41){if(_0x125c41){return _0x39fce1[_0xbd0f('0x23')](_0x5770e0)[_0xbd0f('0x24')](_0x125c41);}};}function respondWithFilteredResult(_0x1c08d5,_0x589a5b){return function(_0x5d1065){if(_0x5d1065){var _0x82dc9d=_0x5d1065[_0xbd0f('0x25')],_0x1d521e=_0x589a5b[_0xbd0f('0x26')],_0xbc6352=_0x589a5b[_0xbd0f('0x26')]+_0x589a5b[_0xbd0f('0x27')],_0x29be4e;if(_0xbc6352>=_0x82dc9d){_0xbc6352=_0x82dc9d;_0x29be4e=0xc8;}else{_0x29be4e=0xce;}_0x1c08d5[_0xbd0f('0x23')](_0x29be4e);return _0x1c08d5[_0xbd0f('0x28')]('Content-Range',_0x1d521e+'-'+_0xbc6352+'/'+_0x82dc9d)[_0xbd0f('0x24')](_0x5d1065);}return null;};}function patchUpdates(_0x13dcc9){return function(_0x53b905){try{jsonpatch[_0xbd0f('0x29')](_0x53b905,_0x13dcc9,!![]);}catch(_0x24efc3){return BPromise[_0xbd0f('0x2a')](_0x24efc3);}return _0x53b905['save']();};}function saveUpdates(_0x6baf1d,_0x5c4564){return function(_0x3d8b9b){if(_0x3d8b9b){return _0x3d8b9b[_0xbd0f('0x2b')](_0x6baf1d)['then'](function(_0x5560ec){return _0x5560ec;});}return null;};}function removeEntity(_0x2d31b6,_0x479b0f){return function(_0x345fc3){if(_0x345fc3){return _0x345fc3[_0xbd0f('0x2c')]()[_0xbd0f('0x1a')](function(){_0x2d31b6[_0xbd0f('0x23')](0xcc)[_0xbd0f('0x2d')]();});}};}function handleEntityNotFound(_0x2c3d04,_0x4a5d55){return function(_0x4e0616){if(!_0x4e0616){_0x2c3d04[_0xbd0f('0x2e')](0x194);}return _0x4e0616;};}function handleError(_0x29f62d,_0x4c7798){_0x4c7798=_0x4c7798||0x1f4;return function(_0x554772){logger[_0xbd0f('0x1f')](_0x554772[_0xbd0f('0x2f')]);if(_0x554772['name']){delete _0x554772[_0xbd0f('0x30')];}_0x29f62d['status'](_0x4c7798)[_0xbd0f('0x31')](_0x554772);};}exports[_0xbd0f('0x32')]=function(_0x1a5a57,_0x1a590f){var _0x206208={},_0x2ff907={},_0x2b98b2={'count':0x0,'rows':[]};var _0x3c8d91=_[_0xbd0f('0x33')](db[_0xbd0f('0x34')][_0xbd0f('0x35')],function(_0x53db56){return{'name':_0x53db56[_0xbd0f('0x36')],'type':_0x53db56[_0xbd0f('0x37')][_0xbd0f('0x38')]};});_0x2ff907[_0xbd0f('0x39')]=_[_0xbd0f('0x33')](_0x3c8d91,_0xbd0f('0x30'));_0x2ff907[_0xbd0f('0x3a')]=_[_0xbd0f('0x3b')](_0x1a5a57[_0xbd0f('0x3a')]);_0x2ff907['filters']=_[_0xbd0f('0x3c')](_0x2ff907[_0xbd0f('0x39')],_0x2ff907[_0xbd0f('0x3a')]);_0x206208[_0xbd0f('0x3d')]=_[_0xbd0f('0x3c')](_0x2ff907[_0xbd0f('0x39')],qs[_0xbd0f('0x3e')](_0x1a5a57[_0xbd0f('0x3a')][_0xbd0f('0x3e')]));_0x206208['attributes']=_0x206208[_0xbd0f('0x3d')][_0xbd0f('0x3f')]?_0x206208['attributes']:_0x2ff907[_0xbd0f('0x39')];if(!_0x1a5a57[_0xbd0f('0x3a')][_0xbd0f('0x40')](_0xbd0f('0x41'))){_0x206208[_0xbd0f('0x27')]=qs[_0xbd0f('0x27')](_0x1a5a57[_0xbd0f('0x3a')][_0xbd0f('0x27')]);_0x206208[_0xbd0f('0x26')]=qs[_0xbd0f('0x26')](_0x1a5a57['query'][_0xbd0f('0x26')]);}_0x206208['order']=qs[_0xbd0f('0x42')](_0x1a5a57[_0xbd0f('0x3a')]['sort']);_0x206208[_0xbd0f('0x43')]=qs[_0xbd0f('0x44')](_[_0xbd0f('0x45')](_0x1a5a57[_0xbd0f('0x3a')],_0x2ff907['filters']),_0x3c8d91);if(_0x1a5a57[_0xbd0f('0x3a')][_0xbd0f('0x46')]){_0x206208[_0xbd0f('0x43')]=_[_0xbd0f('0x47')](_0x206208[_0xbd0f('0x43')],{'$or':_['map'](_0x3c8d91,function(_0x134f26){if(_0x134f26[_0xbd0f('0x37')]!==_0xbd0f('0x48')){var _0x9eb793={};_0x9eb793[_0x134f26[_0xbd0f('0x30')]]={'$like':'%'+_0x1a5a57[_0xbd0f('0x3a')][_0xbd0f('0x46')]+'%'};return _0x9eb793;}})});}_0x206208=_[_0xbd0f('0x47')]({},_0x206208,_0x1a5a57[_0xbd0f('0x49')]);var _0x4de10d={'where':_0x206208['where']};return db[_0xbd0f('0x34')][_0xbd0f('0x25')](_0x4de10d)[_0xbd0f('0x1a')](function(_0x3309c1){_0x2b98b2['count']=_0x3309c1;if(_0x1a5a57['query'][_0xbd0f('0x4a')]){_0x206208[_0xbd0f('0x4b')]=[{'all':!![]}];}return db[_0xbd0f('0x34')]['findAll'](_0x206208);})[_0xbd0f('0x1a')](function(_0x170afd){_0x2b98b2[_0xbd0f('0x4c')]=_0x170afd;return _0x2b98b2;})[_0xbd0f('0x1a')](respondWithFilteredResult(_0x1a590f,_0x206208))[_0xbd0f('0x22')](handleError(_0x1a590f,null));};exports[_0xbd0f('0x4d')]=function(_0x956f30,_0x3210a8){var _0x303ece={'raw':![],'where':{'id':_0x956f30[_0xbd0f('0x4e')]['id']}},_0x89686c={};_0x89686c[_0xbd0f('0x39')]=_[_0xbd0f('0x3b')](db[_0xbd0f('0x34')][_0xbd0f('0x35')]);_0x89686c[_0xbd0f('0x3a')]=_[_0xbd0f('0x3b')](_0x956f30[_0xbd0f('0x3a')]);_0x89686c[_0xbd0f('0x44')]=_[_0xbd0f('0x3c')](_0x89686c[_0xbd0f('0x39')],_0x89686c[_0xbd0f('0x3a')]);_0x303ece['attributes']=_['intersection'](_0x89686c[_0xbd0f('0x39')],qs[_0xbd0f('0x3e')](_0x956f30[_0xbd0f('0x3a')]['fields']));_0x303ece[_0xbd0f('0x3d')]=_0x303ece[_0xbd0f('0x3d')][_0xbd0f('0x3f')]?_0x303ece[_0xbd0f('0x3d')]:_0x89686c[_0xbd0f('0x39')];if(_0x956f30[_0xbd0f('0x3a')][_0xbd0f('0x4a')]){_0x303ece['include']=[{'all':!![]}];}_0x303ece=_['merge']({},_0x303ece,_0x956f30[_0xbd0f('0x49')]);return db[_0xbd0f('0x34')][_0xbd0f('0x4f')](_0x303ece)['then'](handleEntityNotFound(_0x3210a8,null))['then'](respondWithResult(_0x3210a8,null))[_0xbd0f('0x22')](handleError(_0x3210a8,null));};exports['create']=function(_0x3c1802,_0x55ff69){return db[_0xbd0f('0x34')][_0xbd0f('0x50')](_0x3c1802[_0xbd0f('0x51')],{})['then'](respondWithResult(_0x55ff69,0xc9))[_0xbd0f('0x22')](handleError(_0x55ff69,null));};exports[_0xbd0f('0x2b')]=function(_0x3b77c1,_0x1edb00){if(_0x3b77c1[_0xbd0f('0x51')]['id']){delete _0x3b77c1[_0xbd0f('0x51')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x3b77c1[_0xbd0f('0x4e')]['id']}})[_0xbd0f('0x1a')](handleEntityNotFound(_0x1edb00,null))[_0xbd0f('0x1a')](saveUpdates(_0x3b77c1[_0xbd0f('0x51')],null))[_0xbd0f('0x1a')](respondWithResult(_0x1edb00,null))[_0xbd0f('0x22')](handleError(_0x1edb00,null));};exports[_0xbd0f('0x2c')]=function(_0x1734c1,_0x3b9651){return db['ZohoAccount']['find']({'where':{'id':_0x1734c1[_0xbd0f('0x4e')]['id']}})[_0xbd0f('0x1a')](handleEntityNotFound(_0x3b9651,null))[_0xbd0f('0x1a')](removeEntity(_0x3b9651,null))[_0xbd0f('0x22')](handleError(_0x3b9651,null));};exports[_0xbd0f('0x52')]=function(_0x3201d1,_0x16b288,_0x48f5c7){var _0x850ac8={};var _0x21f75d={};var _0x580aa8;var _0x1c26a2;return db[_0xbd0f('0x34')][_0xbd0f('0x53')]({'where':{'id':_0x3201d1[_0xbd0f('0x4e')]['id']}})[_0xbd0f('0x1a')](handleEntityNotFound(_0x16b288,null))[_0xbd0f('0x1a')](function(_0x1806da){if(_0x1806da){_0x580aa8=_0x1806da;_0x21f75d[_0xbd0f('0x39')]=_[_0xbd0f('0x3b')](db[_0xbd0f('0x54')][_0xbd0f('0x35')]);_0x21f75d['query']=_[_0xbd0f('0x3b')](_0x3201d1['query']);_0x21f75d['filters']=_[_0xbd0f('0x3c')](_0x21f75d['model'],_0x21f75d[_0xbd0f('0x3a')]);_0x850ac8[_0xbd0f('0x3d')]=_['intersection'](_0x21f75d[_0xbd0f('0x39')],qs[_0xbd0f('0x3e')](_0x3201d1[_0xbd0f('0x3a')][_0xbd0f('0x3e')]));_0x850ac8['attributes']=_0x850ac8['attributes']['length']?_0x850ac8[_0xbd0f('0x3d')]:_0x21f75d[_0xbd0f('0x39')];_0x850ac8[_0xbd0f('0x55')]=qs[_0xbd0f('0x42')](_0x3201d1[_0xbd0f('0x3a')][_0xbd0f('0x42')]);_0x850ac8['where']=qs[_0xbd0f('0x44')](_[_0xbd0f('0x45')](_0x3201d1[_0xbd0f('0x3a')],_0x21f75d['filters']));if(_0x3201d1[_0xbd0f('0x3a')]['filter']){_0x850ac8[_0xbd0f('0x43')]=_['merge'](_0x850ac8['where'],{'$or':_[_0xbd0f('0x33')](_0x850ac8[_0xbd0f('0x3d')],function(_0x2f2cd2){var _0x549dec={};_0x549dec[_0x2f2cd2]={'$like':'%'+_0x3201d1[_0xbd0f('0x3a')][_0xbd0f('0x46')]+'%'};return _0x549dec;})});}_0x850ac8=_[_0xbd0f('0x47')]({},_0x850ac8,_0x3201d1[_0xbd0f('0x49')]);return _0x580aa8[_0xbd0f('0x52')](_0x850ac8);}})[_0xbd0f('0x1a')](function(_0x42ed7a){if(_0x42ed7a){_0x1c26a2=_0x42ed7a[_0xbd0f('0x3f')];if(!_0x3201d1[_0xbd0f('0x3a')]['hasOwnProperty']('nolimit')){_0x850ac8[_0xbd0f('0x27')]=qs[_0xbd0f('0x27')](_0x3201d1[_0xbd0f('0x3a')][_0xbd0f('0x27')]);_0x850ac8[_0xbd0f('0x26')]=qs[_0xbd0f('0x26')](_0x3201d1['query']['offset']);}return _0x580aa8[_0xbd0f('0x52')](_0x850ac8);}})['then'](function(_0x15c66f){if(_0x15c66f){return _0x15c66f?{'count':_0x1c26a2,'rows':_0x15c66f}:null;}})[_0xbd0f('0x1a')](respondWithResult(_0x16b288,null))[_0xbd0f('0x22')](handleError(_0x16b288,null));};exports[_0xbd0f('0x56')]=function(_0x381893,_0x3f7be3,_0xfc67){if(_0x381893[_0xbd0f('0x51')]['id']){delete _0x381893[_0xbd0f('0x51')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x381893[_0xbd0f('0x4e')]['id']}})[_0xbd0f('0x1a')](handleEntityNotFound(_0x3f7be3,null))[_0xbd0f('0x1a')](function(_0x216c7c){if(_0x216c7c){_0x381893['body']['AccountId']=_0x216c7c['id'];_0x381893[_0xbd0f('0x51')][_0xbd0f('0x57')]=integrations[_0xbd0f('0x58')](_0x381893[_0xbd0f('0x51')][_0xbd0f('0x59')],_0x381893[_0xbd0f('0x51')][_0xbd0f('0x37')]);_0x381893[_0xbd0f('0x51')]['Descriptions']=integrations[_0xbd0f('0x5a')](_0x381893[_0xbd0f('0x51')][_0xbd0f('0x59')],_0x381893[_0xbd0f('0x51')][_0xbd0f('0x37')]);return db['ZohoConfiguration'][_0xbd0f('0x50')](_0x381893['body'],{'include':[{'model':db[_0xbd0f('0x5b')],'as':_0xbd0f('0x57')},{'model':db[_0xbd0f('0x5b')],'as':_0xbd0f('0x5c')}]});}return null;})['then'](respondWithResult(_0x3f7be3,null))[_0xbd0f('0x22')](handleError(_0x3f7be3,null));};function getAccessToken(_0x32b7e0){return new Promise(function(_0x452052,_0x973691){var _0x371703;switch(_0x32b7e0[_0xbd0f('0x5d')]){case'US':_0x371703=_0xbd0f('0x5e');break;case'AU':_0x371703=_0xbd0f('0x5f');break;case'EU':_0x371703=_0xbd0f('0x60');break;case'IN':_0x371703='https://accounts.zoho.in';break;case'CN':_0x371703='https://accounts.zoho.com.cn';break;default:_0x371703=_0xbd0f('0x60');break;}var _0x186f50={'method':'POST','uri':_0x371703+_0xbd0f('0x61'),'qs':{'refresh_token':_0x32b7e0['refreshToken'],'client_id':_0x32b7e0[_0xbd0f('0x62')],'client_secret':_0x32b7e0['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x186f50)[_0xbd0f('0x1a')](function(_0x56e05c){if(_0x56e05c[_0xbd0f('0x63')]){_0x452052(_0x56e05c[_0xbd0f('0x63')]);}else{_0x973691(_0xbd0f('0x64'));}})[_0xbd0f('0x22')](function(_0x13db11){_0x973691(_0x13db11);});});}exports[_0xbd0f('0x65')]=function(_0x525117,_0x32208c,_0x47c18c){var _0x21fa85,_0x4607a3,_0x1525ad,_0x385322,_0x5e00e7;return db[_0xbd0f('0x34')]['findOne']({'where':{'id':_0x525117['params']['id']},'attributes':['id','host','zone',_0xbd0f('0x62'),_0xbd0f('0x66'),_0xbd0f('0x67'),_0xbd0f('0x20'),_0xbd0f('0x68')]})[_0xbd0f('0x1a')](handleEntityNotFound(_0x32208c,null))[_0xbd0f('0x1a')](function(_0xff670b){_0x5e00e7=_0xff670b;_0x21fa85=_0x5e00e7['host'];_0x4607a3=_0x21fa85==='zoho.eu'?'eu':_0xbd0f('0x69');_0x1525ad=_0x5e00e7[_0xbd0f('0x67')];var _0x496e45=_0x1525ad['slice'](-0x1);if(_0x496e45==='/'||_0x496e45==='\x5c'||_0x496e45===':'){_0x1525ad=_0x1525ad['substring'](0x0,_0x1525ad[_0xbd0f('0x6a')](_0x496e45));}if(!_0x5e00e7[_0xbd0f('0x68')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x5e00e7);})[_0xbd0f('0x1a')](function(_0x8b9e63){if(_0x8b9e63){return rp({'method':_0xbd0f('0x6b'),'uri':util[_0xbd0f('0x6c')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x4607a3),'qs':{'module':_0xbd0f('0x6d')},'headers':{'Authorization':_0xbd0f('0x6e')+_0x8b9e63},'json':!![]});}})[_0xbd0f('0x1a')](function(_0x3135a6){if(_0x3135a6){if(_0x3135a6[_0xbd0f('0x6f')]&&_0x3135a6['response'][_0xbd0f('0x1f')]){throw new Error(_0x3135a6[_0xbd0f('0x6f')][_0xbd0f('0x1f')][_0xbd0f('0x21')]);}var _0x3c0036=[];var _0x1a682f=[];var _0x2b73b=['Owner',_0xbd0f('0x70'),_0xbd0f('0x71'),_0xbd0f('0x72'),_0xbd0f('0x73'),'Call_Result',_0xbd0f('0x74'),_0xbd0f('0x75')];_0x1a682f=_[_0xbd0f('0x76')](_0x3135a6[_0xbd0f('0x3e')],function(_0x50aef2){return _0x2b73b[_0xbd0f('0x77')](_0x50aef2[_0xbd0f('0x78')]);});for(var _0x5ccbdb=0x0;_0x5ccbdb<_0x1a682f[_0xbd0f('0x3f')];_0x5ccbdb++){if(_0x1a682f[_0x5ccbdb]['system_mandatory']===![]){_0x3c0036[_0xbd0f('0x79')]({'id':_0x1a682f[_0x5ccbdb]['id'],'name':_0x1a682f[_0x5ccbdb][_0xbd0f('0x7a')],'custom':_0x1a682f[_0x5ccbdb]['custom_field'],'options':_0x1a682f[_0x5ccbdb][_0xbd0f('0x7b')]===_0xbd0f('0x7c')&&_0x1a682f[_0x5ccbdb][_0xbd0f('0x7d')][_0xbd0f('0x3f')]>-0x1?_[_0xbd0f('0x33')](_0x1a682f[_0x5ccbdb][_0xbd0f('0x7d')],function(_0x59918a){return{'name':_0x59918a,'value':_0x59918a};}):[]});}}return{'count':_0x3c0036[_0xbd0f('0x3f')],'rows':_0x3c0036};}else{return{'count':0x0,'rows':[]};}})[_0xbd0f('0x1a')](respondWithResult(_0x32208c,null))[_0xbd0f('0x22')](function(_0x36f5c1){var _0x3a812a=_0x525117[_0xbd0f('0x3a')][_0xbd0f('0x17')]?0x1f4:_0x36f5c1['statusCode']||0x1f4;logger[_0xbd0f('0x1f')]('getFields,\x20%s,\x20%s,\x20%s',_0xbd0f('0x65'),_0x3a812a,JSON['stringify'](_0x36f5c1));delete _0x36f5c1[_0xbd0f('0x30')];if(_0x3a812a===0x191){_0x3a812a=0x190;}_0x32208c[_0xbd0f('0x23')](_0x3a812a)[_0xbd0f('0x31')](_0x525117[_0xbd0f('0x3a')][_0xbd0f('0x17')]?{'message':_0xbd0f('0x7e'),'statusCode':_0x36f5c1[_0xbd0f('0x7f')]}:_0x36f5c1);});}; \ No newline at end of file +var _0xe48a=['lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Duration','Call_Type','remove','includes','system_mandatory','display_label','custom_field','data_type','picklist','statusCode','getFields','stringify','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','http','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~!@#$%^&-_=+[{]}.','request','info','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then','destroy','end','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','count','includeAll','findAll','rows','show','params','length','include','options','find','create','body','findOne','getConfigurations','hasOwnProperty','addConfiguration','getSubjects','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zoho.eu','slice'];(function(_0x49516f,_0x13b9b1){var _0x450152=function(_0x70dbd){while(--_0x70dbd){_0x49516f['push'](_0x49516f['shift']());}};_0x450152(++_0x13b9b1);}(_0xe48a,0x1aa));var _0xae48=function(_0x408de5,_0x24fa7b){_0x408de5=_0x408de5-0x0;var _0x2015a1=_0xe48a[_0x408de5];return _0x2015a1;};'use strict';var pdf=require(_0xae48('0x0'));var emlformat=require(_0xae48('0x1'));var rimraf=require(_0xae48('0x2'));var zipdir=require(_0xae48('0x3'));var jsonpatch=require(_0xae48('0x4'));var rp=require(_0xae48('0x5'));var moment=require(_0xae48('0x6'));var BPromise=require(_0xae48('0x7'));var Mustache=require(_0xae48('0x8'));var util=require(_0xae48('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xae48('0xa'));var ejs=require(_0xae48('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xae48('0xc'));var crypto=require('crypto');var jsforce=require(_0xae48('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xae48('0xe'));var Papa=require(_0xae48('0xf'));var Redis=require(_0xae48('0x10'));var authService=require(_0xae48('0x11'));var qs=require(_0xae48('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae48('0x13'));var logger=require(_0xae48('0x14'))('api');var utils=require(_0xae48('0x15'));var config=require(_0xae48('0x16'));var db=require(_0xae48('0x17'))['db'];var integrations=require(_0xae48('0x18'));var jayson=require('jayson/promise');var client=jayson['client'][_0xae48('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5c46a7,_0x51de5e,_0x541cdf){if(_0x541cdf){var _0x26c4c7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26c4c7[_0xae48('0x1a')](_0x51de5e)){return _0x5c46a7;}else{throw new db['Sequelize']['ValidationError'](_0xae48('0x1b'));}}else{return _0x5c46a7;}}function respondWithRpcPromise(_0x1b2668,_0x3fe6f0,_0x20f199,_0x4cc89f){return new BPromise(function(_0x2c5e4f,_0x1c5019){var _0x3082a0=_0x4cc89f||client;return _0x3082a0[_0xae48('0x1c')](_0x1b2668,_0x20f199)['then'](function(_0x1f4cc8){logger[_0xae48('0x1d')]('ZohoAccount,\x20%s,\x20%s',_0x3fe6f0,'request\x20sent');logger[_0xae48('0x1e')](_0xae48('0x1f'),_0x3fe6f0,_0xae48('0x20'),JSON['stringify'](_0x1f4cc8));if(_0x1f4cc8[_0xae48('0x21')]){if(_0x1f4cc8[_0xae48('0x21')][_0xae48('0x22')]===0x1f4){logger[_0xae48('0x21')](_0xae48('0x23'),_0x3fe6f0,_0x1f4cc8[_0xae48('0x21')][_0xae48('0x24')]);return _0x1c5019(_0x1f4cc8['error'][_0xae48('0x24')]);}logger[_0xae48('0x21')](_0xae48('0x23'),_0x3fe6f0,_0x1f4cc8[_0xae48('0x21')][_0xae48('0x24')]);return _0x2c5e4f(_0x1f4cc8[_0xae48('0x21')][_0xae48('0x24')]);}else{logger[_0xae48('0x1d')](_0xae48('0x23'),_0x3fe6f0,_0xae48('0x20'));_0x2c5e4f(_0x1f4cc8[_0xae48('0x25')]['message']);}})[_0xae48('0x26')](function(_0x10c204){logger['error'](_0xae48('0x23'),_0x3fe6f0,_0x10c204);_0x1c5019(_0x10c204);});});}function respondWithStatusCode(_0x5547aa,_0x5e20ee){_0x5e20ee=_0x5e20ee||0xcc;return function(_0x3b419d){if(_0x3b419d){return _0x5547aa[_0xae48('0x27')](_0x5e20ee);}return _0x5547aa[_0xae48('0x28')](_0x5e20ee)['end']();};}function respondWithResult(_0x32a3eb,_0x385ca3){_0x385ca3=_0x385ca3||0xc8;return function(_0x4f8334){if(_0x4f8334){return _0x32a3eb[_0xae48('0x28')](_0x385ca3)[_0xae48('0x29')](_0x4f8334);}};}function respondWithFilteredResult(_0x568a78,_0x25825c){return function(_0x2c589){if(_0x2c589){var _0x52a76c=_0x2c589['count'],_0x663c78=_0x25825c['offset'],_0x4348e6=_0x25825c[_0xae48('0x2a')]+_0x25825c[_0xae48('0x2b')],_0x508a6b;if(_0x4348e6>=_0x52a76c){_0x4348e6=_0x52a76c;_0x508a6b=0xc8;}else{_0x508a6b=0xce;}_0x568a78[_0xae48('0x28')](_0x508a6b);return _0x568a78[_0xae48('0x2c')]('Content-Range',_0x663c78+'-'+_0x4348e6+'/'+_0x52a76c)[_0xae48('0x29')](_0x2c589);}return null;};}function patchUpdates(_0xdd5976){return function(_0xa9f8e){try{jsonpatch[_0xae48('0x2d')](_0xa9f8e,_0xdd5976,!![]);}catch(_0x4e99e0){return BPromise[_0xae48('0x2e')](_0x4e99e0);}return _0xa9f8e[_0xae48('0x2f')]();};}function saveUpdates(_0x3e2a4b,_0x5e85d0){return function(_0x432569){if(_0x432569){return _0x432569[_0xae48('0x30')](_0x3e2a4b)[_0xae48('0x31')](function(_0x237c22){return _0x237c22;});}return null;};}function removeEntity(_0x38d7aa,_0x536a8f){return function(_0x75ebcb){if(_0x75ebcb){return _0x75ebcb[_0xae48('0x32')]()[_0xae48('0x31')](function(){_0x38d7aa[_0xae48('0x28')](0xcc)[_0xae48('0x33')]();});}};}function handleEntityNotFound(_0x385ef8,_0x1bf51c){return function(_0x3ebbd0){if(!_0x3ebbd0){_0x385ef8[_0xae48('0x27')](0x194);}return _0x3ebbd0;};}function handleError(_0x20ce5c,_0x45df0b){_0x45df0b=_0x45df0b||0x1f4;return function(_0x57eaee){logger[_0xae48('0x21')](_0x57eaee[_0xae48('0x34')]);if(_0x57eaee[_0xae48('0x35')]){delete _0x57eaee['name'];}_0x20ce5c['status'](_0x45df0b)['send'](_0x57eaee);};}exports[_0xae48('0x36')]=function(_0x566400,_0x7f04bd){var _0x46931c={},_0x4e44a5={},_0x3c9429={'count':0x0,'rows':[]};var _0x357ab2=_[_0xae48('0x37')](db[_0xae48('0x38')][_0xae48('0x39')],function(_0x1687be){return{'name':_0x1687be[_0xae48('0x3a')],'type':_0x1687be['type']['key']};});_0x4e44a5['model']=_[_0xae48('0x37')](_0x357ab2,_0xae48('0x35'));_0x4e44a5[_0xae48('0x3b')]=_[_0xae48('0x3c')](_0x566400[_0xae48('0x3b')]);_0x4e44a5[_0xae48('0x3d')]=_[_0xae48('0x3e')](_0x4e44a5[_0xae48('0x3f')],_0x4e44a5[_0xae48('0x3b')]);_0x46931c[_0xae48('0x40')]=_['intersection'](_0x4e44a5[_0xae48('0x3f')],qs[_0xae48('0x41')](_0x566400[_0xae48('0x3b')][_0xae48('0x41')]));_0x46931c['attributes']=_0x46931c[_0xae48('0x40')]['length']?_0x46931c[_0xae48('0x40')]:_0x4e44a5[_0xae48('0x3f')];if(!_0x566400[_0xae48('0x3b')]['hasOwnProperty'](_0xae48('0x42'))){_0x46931c[_0xae48('0x2b')]=qs[_0xae48('0x2b')](_0x566400['query'][_0xae48('0x2b')]);_0x46931c['offset']=qs[_0xae48('0x2a')](_0x566400[_0xae48('0x3b')][_0xae48('0x2a')]);}_0x46931c[_0xae48('0x43')]=qs[_0xae48('0x44')](_0x566400[_0xae48('0x3b')][_0xae48('0x44')]);_0x46931c[_0xae48('0x45')]=qs['filters'](_[_0xae48('0x46')](_0x566400[_0xae48('0x3b')],_0x4e44a5['filters']),_0x357ab2);if(_0x566400[_0xae48('0x3b')]['filter']){_0x46931c[_0xae48('0x45')]=_[_0xae48('0x47')](_0x46931c[_0xae48('0x45')],{'$or':_['map'](_0x357ab2,function(_0x4e538a){if(_0x4e538a[_0xae48('0x48')]!==_0xae48('0x49')){var _0x40e8e1={};_0x40e8e1[_0x4e538a[_0xae48('0x35')]]={'$like':'%'+_0x566400[_0xae48('0x3b')][_0xae48('0x4a')]+'%'};return _0x40e8e1;}})});}_0x46931c=_[_0xae48('0x47')]({},_0x46931c,_0x566400['options']);var _0x5db033={'where':_0x46931c['where']};return db[_0xae48('0x38')][_0xae48('0x4b')](_0x5db033)[_0xae48('0x31')](function(_0xe64e26){_0x3c9429[_0xae48('0x4b')]=_0xe64e26;if(_0x566400[_0xae48('0x3b')][_0xae48('0x4c')]){_0x46931c['include']=[{'all':!![]}];}return db[_0xae48('0x38')][_0xae48('0x4d')](_0x46931c);})[_0xae48('0x31')](function(_0x41f08e){_0x3c9429[_0xae48('0x4e')]=_0x41f08e;return _0x3c9429;})[_0xae48('0x31')](respondWithFilteredResult(_0x7f04bd,_0x46931c))[_0xae48('0x26')](handleError(_0x7f04bd,null));};exports[_0xae48('0x4f')]=function(_0x1fc039,_0x26dae3){var _0x4785a6={'raw':![],'where':{'id':_0x1fc039[_0xae48('0x50')]['id']}},_0x286735={};_0x286735[_0xae48('0x3f')]=_[_0xae48('0x3c')](db[_0xae48('0x38')][_0xae48('0x39')]);_0x286735['query']=_[_0xae48('0x3c')](_0x1fc039['query']);_0x286735[_0xae48('0x3d')]=_[_0xae48('0x3e')](_0x286735[_0xae48('0x3f')],_0x286735[_0xae48('0x3b')]);_0x4785a6[_0xae48('0x40')]=_[_0xae48('0x3e')](_0x286735[_0xae48('0x3f')],qs[_0xae48('0x41')](_0x1fc039['query'][_0xae48('0x41')]));_0x4785a6[_0xae48('0x40')]=_0x4785a6[_0xae48('0x40')][_0xae48('0x51')]?_0x4785a6[_0xae48('0x40')]:_0x286735[_0xae48('0x3f')];if(_0x1fc039[_0xae48('0x3b')][_0xae48('0x4c')]){_0x4785a6[_0xae48('0x52')]=[{'all':!![]}];}_0x4785a6=_[_0xae48('0x47')]({},_0x4785a6,_0x1fc039[_0xae48('0x53')]);return db[_0xae48('0x38')][_0xae48('0x54')](_0x4785a6)[_0xae48('0x31')](handleEntityNotFound(_0x26dae3,null))[_0xae48('0x31')](respondWithResult(_0x26dae3,null))[_0xae48('0x26')](handleError(_0x26dae3,null));};exports[_0xae48('0x55')]=function(_0x1be78c,_0x2926fc){return db[_0xae48('0x38')][_0xae48('0x55')](_0x1be78c[_0xae48('0x56')],{})[_0xae48('0x31')](respondWithResult(_0x2926fc,0xc9))['catch'](handleError(_0x2926fc,null));};exports[_0xae48('0x30')]=function(_0x5c643c,_0xa6c3b8){if(_0x5c643c['body']['id']){delete _0x5c643c[_0xae48('0x56')]['id'];}return db[_0xae48('0x38')][_0xae48('0x54')]({'where':{'id':_0x5c643c['params']['id']}})['then'](handleEntityNotFound(_0xa6c3b8,null))[_0xae48('0x31')](saveUpdates(_0x5c643c[_0xae48('0x56')],null))[_0xae48('0x31')](respondWithResult(_0xa6c3b8,null))[_0xae48('0x26')](handleError(_0xa6c3b8,null));};exports[_0xae48('0x32')]=function(_0x5ebe97,_0x13eab0){return db[_0xae48('0x38')][_0xae48('0x54')]({'where':{'id':_0x5ebe97[_0xae48('0x50')]['id']}})[_0xae48('0x31')](handleEntityNotFound(_0x13eab0,null))[_0xae48('0x31')](removeEntity(_0x13eab0,null))['catch'](handleError(_0x13eab0,null));};exports['getConfigurations']=function(_0x51606f,_0x1089b8,_0x163156){var _0x389dc5={};var _0x37e256={};var _0x154e26;var _0x1522e0;return db[_0xae48('0x38')][_0xae48('0x57')]({'where':{'id':_0x51606f[_0xae48('0x50')]['id']}})['then'](handleEntityNotFound(_0x1089b8,null))[_0xae48('0x31')](function(_0x2f6665){if(_0x2f6665){_0x154e26=_0x2f6665;_0x37e256['model']=_['keys'](db['ZohoConfiguration']['rawAttributes']);_0x37e256['query']=_[_0xae48('0x3c')](_0x51606f[_0xae48('0x3b')]);_0x37e256[_0xae48('0x3d')]=_[_0xae48('0x3e')](_0x37e256[_0xae48('0x3f')],_0x37e256[_0xae48('0x3b')]);_0x389dc5[_0xae48('0x40')]=_['intersection'](_0x37e256[_0xae48('0x3f')],qs[_0xae48('0x41')](_0x51606f[_0xae48('0x3b')][_0xae48('0x41')]));_0x389dc5[_0xae48('0x40')]=_0x389dc5['attributes'][_0xae48('0x51')]?_0x389dc5[_0xae48('0x40')]:_0x37e256[_0xae48('0x3f')];_0x389dc5[_0xae48('0x43')]=qs[_0xae48('0x44')](_0x51606f['query'][_0xae48('0x44')]);_0x389dc5[_0xae48('0x45')]=qs['filters'](_[_0xae48('0x46')](_0x51606f[_0xae48('0x3b')],_0x37e256[_0xae48('0x3d')]));if(_0x51606f[_0xae48('0x3b')][_0xae48('0x4a')]){_0x389dc5[_0xae48('0x45')]=_[_0xae48('0x47')](_0x389dc5[_0xae48('0x45')],{'$or':_[_0xae48('0x37')](_0x389dc5[_0xae48('0x40')],function(_0x3c5ec5){var _0x418a14={};_0x418a14[_0x3c5ec5]={'$like':'%'+_0x51606f[_0xae48('0x3b')][_0xae48('0x4a')]+'%'};return _0x418a14;})});}_0x389dc5=_[_0xae48('0x47')]({},_0x389dc5,_0x51606f[_0xae48('0x53')]);return _0x154e26[_0xae48('0x58')](_0x389dc5);}})['then'](function(_0x5a5186){if(_0x5a5186){_0x1522e0=_0x5a5186['length'];if(!_0x51606f[_0xae48('0x3b')][_0xae48('0x59')](_0xae48('0x42'))){_0x389dc5[_0xae48('0x2b')]=qs['limit'](_0x51606f[_0xae48('0x3b')]['limit']);_0x389dc5[_0xae48('0x2a')]=qs['offset'](_0x51606f[_0xae48('0x3b')][_0xae48('0x2a')]);}return _0x154e26['getConfigurations'](_0x389dc5);}})[_0xae48('0x31')](function(_0x51fea0){if(_0x51fea0){return _0x51fea0?{'count':_0x1522e0,'rows':_0x51fea0}:null;}})[_0xae48('0x31')](respondWithResult(_0x1089b8,null))[_0xae48('0x26')](handleError(_0x1089b8,null));};exports[_0xae48('0x5a')]=function(_0x2d6d0a,_0x53a383,_0x39b6e2){if(_0x2d6d0a[_0xae48('0x56')]['id']){delete _0x2d6d0a[_0xae48('0x56')]['id'];}return db['ZohoAccount'][_0xae48('0x57')]({'where':{'id':_0x2d6d0a['params']['id']}})[_0xae48('0x31')](handleEntityNotFound(_0x53a383,null))[_0xae48('0x31')](function(_0x40119e){if(_0x40119e){_0x2d6d0a['body']['AccountId']=_0x40119e['id'];_0x2d6d0a[_0xae48('0x56')]['Subjects']=integrations[_0xae48('0x5b')](_0x2d6d0a['body'][_0xae48('0x5c')],_0x2d6d0a[_0xae48('0x56')][_0xae48('0x48')]);_0x2d6d0a[_0xae48('0x56')]['Descriptions']=integrations['getDescriptions'](_0x2d6d0a[_0xae48('0x56')]['channel'],_0x2d6d0a[_0xae48('0x56')][_0xae48('0x48')]);return db['ZohoConfiguration']['create'](_0x2d6d0a[_0xae48('0x56')],{'include':[{'model':db[_0xae48('0x5d')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0xae48('0x5e')}]});}return null;})[_0xae48('0x31')](respondWithResult(_0x53a383,null))[_0xae48('0x26')](handleError(_0x53a383,null));};function getAccessToken(_0x562ce8){return new Promise(function(_0x2da979,_0x5196d0){var _0x5c40cf;switch(_0x562ce8[_0xae48('0x5f')]){case'US':_0x5c40cf=_0xae48('0x60');break;case'AU':_0x5c40cf=_0xae48('0x61');break;case'EU':_0x5c40cf=_0xae48('0x62');break;case'IN':_0x5c40cf=_0xae48('0x63');break;case'CN':_0x5c40cf='https://accounts.zoho.com.cn';break;default:_0x5c40cf='https://accounts.zoho.eu';break;}var _0x172e76={'method':'POST','uri':_0x5c40cf+_0xae48('0x64'),'qs':{'refresh_token':_0x562ce8[_0xae48('0x65')],'client_id':_0x562ce8[_0xae48('0x66')],'client_secret':_0x562ce8[_0xae48('0x67')],'grant_type':_0xae48('0x68')},'json':!![]};return rp(_0x172e76)[_0xae48('0x31')](function(_0x27dcd6){if(_0x27dcd6[_0xae48('0x69')]){_0x2da979(_0x27dcd6[_0xae48('0x69')]);}else{_0x5196d0(_0xae48('0x6a'));}})[_0xae48('0x26')](function(_0x43345f){_0x5196d0(_0x43345f);});});}exports['getFields']=function(_0x1221a3,_0x5a7ccd,_0x184bab){var _0x2c93fb,_0x57f966,_0x5e5889,_0x2969d0,_0x159356;return db[_0xae48('0x38')][_0xae48('0x57')]({'where':{'id':_0x1221a3[_0xae48('0x50')]['id']},'attributes':['id',_0xae48('0x6b'),_0xae48('0x5f'),_0xae48('0x66'),_0xae48('0x67'),'serverUrl',_0xae48('0x22'),_0xae48('0x65')]})[_0xae48('0x31')](handleEntityNotFound(_0x5a7ccd,null))[_0xae48('0x31')](function(_0x1ace72){_0x159356=_0x1ace72;_0x2c93fb=_0x159356[_0xae48('0x6b')];_0x57f966=_0x2c93fb===_0xae48('0x6c')?'eu':'com';_0x5e5889=_0x159356['serverUrl'];var _0xa38353=_0x5e5889[_0xae48('0x6d')](-0x1);if(_0xa38353==='/'||_0xa38353==='\x5c'||_0xa38353===':'){_0x5e5889=_0x5e5889['substring'](0x0,_0x5e5889[_0xae48('0x6e')](_0xa38353));}if(!_0x159356[_0xae48('0x65')]){throw new Error(_0xae48('0x6f'));}return getAccessToken(_0x159356);})['then'](function(_0x23d93b){if(_0x23d93b){return rp({'method':_0xae48('0x70'),'uri':util[_0xae48('0x71')](_0xae48('0x72'),_0x57f966),'qs':{'module':_0xae48('0x73')},'headers':{'Authorization':_0xae48('0x74')+_0x23d93b},'json':!![]});}})['then'](function(_0x5515e7){if(_0x5515e7){if(_0x5515e7['response']&&_0x5515e7[_0xae48('0x75')]['error']){throw new Error(_0x5515e7[_0xae48('0x75')][_0xae48('0x21')][_0xae48('0x24')]);}var _0x32beff=[];var _0x8e644c=[];var _0x23f9f0=['Owner',_0xae48('0x76'),_0xae48('0x77'),_0xae48('0x78'),_0xae48('0x79'),'Call_Result','Call_Start_Time',_0xae48('0x7a')];_0x8e644c=_[_0xae48('0x7b')](_0x5515e7['fields'],function(_0x42fd4c){return _0x23f9f0[_0xae48('0x7c')](_0x42fd4c['api_name']);});for(var _0x5ae523=0x0;_0x5ae523<_0x8e644c[_0xae48('0x51')];_0x5ae523++){if(_0x8e644c[_0x5ae523][_0xae48('0x7d')]===![]){_0x32beff['push']({'id':_0x8e644c[_0x5ae523]['id'],'name':_0x8e644c[_0x5ae523][_0xae48('0x7e')],'custom':_0x8e644c[_0x5ae523][_0xae48('0x7f')],'options':_0x8e644c[_0x5ae523][_0xae48('0x80')]===_0xae48('0x81')&&_0x8e644c[_0x5ae523]['pick_list_values'][_0xae48('0x51')]>-0x1?_[_0xae48('0x37')](_0x8e644c[_0x5ae523]['pick_list_values'],function(_0x14d88e){return{'name':_0x14d88e,'value':_0x14d88e};}):[]});}}return{'count':_0x32beff[_0xae48('0x51')],'rows':_0x32beff};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x5a7ccd,null))[_0xae48('0x26')](function(_0x670447){var _0x5b4138=_0x1221a3[_0xae48('0x3b')]['test']?0x1f4:_0x670447[_0xae48('0x82')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xae48('0x83'),_0x5b4138,JSON[_0xae48('0x84')](_0x670447));delete _0x670447[_0xae48('0x35')];if(_0x5b4138===0x191){_0x5b4138=0x190;}_0x5a7ccd[_0xae48('0x28')](_0x5b4138)[_0xae48('0x85')](_0x1221a3['query'][_0xae48('0x1a')]?{'message':'Wrong\x20credentials','statusCode':_0x670447[_0xae48('0x82')]}:_0x670447);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 06a907d..f287bc9 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 _0x5ecc=['zone','serverUrl','clientId','changed','clientSecret','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','code','then','parse','refresh_token','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','slice','https://accounts.zoho.com.cn','authorization_code','refreshToken','catch','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts'];(function(_0x3b3750,_0x28f3b8){var _0x1b9e8b=function(_0xaf75c3){while(--_0xaf75c3){_0x3b3750['push'](_0x3b3750['shift']());}};_0x1b9e8b(++_0x28f3b8);}(_0x5ecc,0x184));var _0xc5ec=function(_0x110d5f,_0x2fe2ee){_0x110d5f=_0x110d5f-0x0;var _0x108100=_0x5ecc[_0x110d5f];return _0x108100;};'use strict';var _=require(_0xc5ec('0x0'));var util=require(_0xc5ec('0x1'));var logger=require(_0xc5ec('0x2'))('api');var moment=require(_0xc5ec('0x3'));var BPromise=require(_0xc5ec('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc5ec('0x5'));var config=require(_0xc5ec('0x6'));var attributes=require(_0xc5ec('0x7'));var integrations=require(_0xc5ec('0x8'));module['exports']=function(_0x3b2fed,_0xbb8b3e){return _0x3b2fed[_0xc5ec('0x9')](_0xc5ec('0xa'),attributes,{'tableName':_0xc5ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3d95d4,_0x12aba7,_0x548e32){if(_0x3d95d4['changed'](_0xc5ec('0xc'))||_0x3d95d4['changed'](_0xc5ec('0xd'))||_0x3d95d4['changed'](_0xc5ec('0xe'))||_0x3d95d4[_0xc5ec('0xf')](_0xc5ec('0x10'))||_0x3d95d4[_0xc5ec('0xf')]('code')||_0x3d95d4[_0xc5ec('0xf')](_0xc5ec('0x11'))){var _0x5b5536,_0x43ebdc;_0x5b5536=_0x3d95d4[_0xc5ec('0xd')];var _0x4015e5=_0x5b5536['slice'](-0x1);if(_0x4015e5==='/'||_0x4015e5==='\x5c'||_0x4015e5===':'){_0x5b5536=_0x5b5536[_0xc5ec('0x12')](0x0,_0x5b5536[_0xc5ec('0x13')](_0x4015e5));}switch(_0x3d95d4['zone']){case'US':_0x43ebdc=_0xc5ec('0x14');break;case'AU':_0x43ebdc='https://accounts.zoho.com.au';break;case'IN':_0x43ebdc=_0xc5ec('0x15');break;case'CN':_0x43ebdc='https://accounts.zoho.com.cn';break;default:_0x43ebdc=_0xc5ec('0x16');break;}var _0x28f45d={'method':_0xc5ec('0x17'),'uri':_0x43ebdc+_0xc5ec('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x3d95d4['clientId'],'client_secret':_0x3d95d4[_0xc5ec('0x10')],'redirect_uri':_0x3d95d4[_0xc5ec('0xd')],'code':_0x3d95d4[_0xc5ec('0x19')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x28f45d)[_0xc5ec('0x1a')](function(_0x4e748a){var _0x5a202b=JSON[_0xc5ec('0x1b')](_0x4e748a);if(_0x5a202b[_0xc5ec('0x1c')]){_0x3d95d4['refreshToken']=_0x5a202b[_0xc5ec('0x1c')];logger['info'](util[_0xc5ec('0x1d')](_0xc5ec('0x1e'),_0x3d95d4[_0xc5ec('0x1f')],_0x3d95d4['id']));}else{logger[_0xc5ec('0x20')](util['format'](_0xc5ec('0x21'),_0x3d95d4[_0xc5ec('0x1f')],_0x3d95d4['id']),util[_0xc5ec('0x22')](_0x5a202b,{'showHidden':![],'depth':null}));}return _0x548e32(null,_0x12aba7);})['catch'](function(_0x27910a){logger[_0xc5ec('0x20')](util[_0xc5ec('0x1d')](_0xc5ec('0x21'),_0x3d95d4[_0xc5ec('0x1f')],_0x3d95d4['id']),util[_0xc5ec('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x548e32(_0x27910a);});}else{return _0x548e32(null,_0x12aba7);}},'beforeUpdate':function(_0x47846f,_0x5e63e3,_0x7c5c93){if(_0x47846f['changed'](_0xc5ec('0xc'))||_0x47846f[_0xc5ec('0xf')](_0xc5ec('0xd'))||_0x47846f['changed'](_0xc5ec('0xe'))||_0x47846f[_0xc5ec('0xf')](_0xc5ec('0x10'))||_0x47846f['changed']('code')||_0x47846f[_0xc5ec('0xf')](_0xc5ec('0x11'))){var _0x28fa19,_0x34eb59;_0x28fa19=_0x47846f[_0xc5ec('0xd')];var _0x30f930=_0x28fa19[_0xc5ec('0x23')](-0x1);if(_0x30f930==='/'||_0x30f930==='\x5c'||_0x30f930===':'){_0x28fa19=_0x28fa19[_0xc5ec('0x12')](0x0,_0x28fa19['lastIndexOf'](_0x30f930));}switch(_0x47846f[_0xc5ec('0xc')]){case'US':_0x34eb59=_0xc5ec('0x14');break;case'AU':_0x34eb59='https://accounts.zoho.com.au';break;case'IN':_0x34eb59='https://accounts.zoho.in';break;case'CN':_0x34eb59=_0xc5ec('0x24');break;default:_0x34eb59=_0xc5ec('0x16');break;}var _0x2f05f1={'method':'POST','uri':_0x34eb59+_0xc5ec('0x18'),'form':{'grant_type':_0xc5ec('0x25'),'client_id':_0x47846f[_0xc5ec('0xe')],'client_secret':_0x47846f[_0xc5ec('0x10')],'redirect_uri':_0x47846f[_0xc5ec('0xd')],'code':_0x47846f[_0xc5ec('0x19')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2f05f1)[_0xc5ec('0x1a')](function(_0x236272){var _0x4fd7f4=JSON['parse'](_0x236272);if(_0x4fd7f4['refresh_token']){_0x47846f[_0xc5ec('0x26')]=_0x4fd7f4['refresh_token'];logger['info'](util['format'](_0xc5ec('0x1e'),_0x47846f[_0xc5ec('0x1f')],_0x47846f['id']));}else{logger[_0xc5ec('0x20')](util['format'](_0xc5ec('0x21'),_0x47846f['name'],_0x47846f['id']),util['inspect'](_0x4fd7f4,{'showHidden':![],'depth':null}));}return _0x7c5c93(null,_0x5e63e3);})[_0xc5ec('0x27')](function(_0x22a339){logger[_0xc5ec('0x20')](util[_0xc5ec('0x1d')](_0xc5ec('0x21'),_0x47846f[_0xc5ec('0x1f')],_0x47846f['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x7c5c93(_0x22a339);});}else{return _0x7c5c93(null,_0x5e63e3);}}}});}; \ No newline at end of file +var _0x10e9=['api','moment','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','int_zoho_accounts','zone','changed','serverUrl','clientId','clientSecret','code','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','host','lodash','../../config/logger'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x10e9,0xfa));var _0x910e=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0x10e9[_0x44a64f];return _0x52024b;};'use strict';var _=require(_0x910e('0x0'));var util=require('util');var logger=require(_0x910e('0x1'))(_0x910e('0x2'));var moment=require(_0x910e('0x3'));var BPromise=require('bluebird');var rp=require(_0x910e('0x4'));var fs=require('fs');var path=require(_0x910e('0x5'));var rimraf=require(_0x910e('0x6'));var config=require(_0x910e('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x910e('0x8'));module[_0x910e('0x9')]=function(_0x4aeaaf,_0x4b861d){return _0x4aeaaf['define']('ZohoAccount',attributes,{'tableName':_0x910e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4faccb,_0x531ca5,_0x498acd){if(_0x4faccb['changed'](_0x910e('0xb'))||_0x4faccb[_0x910e('0xc')](_0x910e('0xd'))||_0x4faccb[_0x910e('0xc')](_0x910e('0xe'))||_0x4faccb['changed'](_0x910e('0xf'))||_0x4faccb['changed'](_0x910e('0x10'))||_0x4faccb[_0x910e('0xc')]('host')){var _0x341d36,_0x4363f9;_0x341d36=_0x4faccb['serverUrl'];var _0xc427ba=_0x341d36[_0x910e('0x11')](-0x1);if(_0xc427ba==='/'||_0xc427ba==='\x5c'||_0xc427ba===':'){_0x341d36=_0x341d36[_0x910e('0x12')](0x0,_0x341d36[_0x910e('0x13')](_0xc427ba));}switch(_0x4faccb[_0x910e('0xb')]){case'US':_0x4363f9=_0x910e('0x14');break;case'AU':_0x4363f9=_0x910e('0x15');break;case'IN':_0x4363f9=_0x910e('0x16');break;case'CN':_0x4363f9=_0x910e('0x17');break;default:_0x4363f9=_0x910e('0x18');break;}var _0x254d37={'method':_0x910e('0x19'),'uri':_0x4363f9+_0x910e('0x1a'),'form':{'grant_type':_0x910e('0x1b'),'client_id':_0x4faccb['clientId'],'client_secret':_0x4faccb[_0x910e('0xf')],'redirect_uri':_0x4faccb[_0x910e('0xd')],'code':_0x4faccb[_0x910e('0x10')]},'headers':{'Content-Type':_0x910e('0x1c')}};return rp(_0x254d37)[_0x910e('0x1d')](function(_0x53e47e){var _0xbdacb5=JSON[_0x910e('0x1e')](_0x53e47e);if(_0xbdacb5[_0x910e('0x1f')]){_0x4faccb[_0x910e('0x20')]=_0xbdacb5[_0x910e('0x1f')];logger[_0x910e('0x21')](util[_0x910e('0x22')](_0x910e('0x23'),_0x4faccb['name'],_0x4faccb['id']));}else{logger[_0x910e('0x24')](util[_0x910e('0x22')](_0x910e('0x25'),_0x4faccb[_0x910e('0x26')],_0x4faccb['id']),util[_0x910e('0x27')](_0xbdacb5,{'showHidden':![],'depth':null}));}return _0x498acd(null,_0x531ca5);})[_0x910e('0x28')](function(_0x496b76){logger['error'](util[_0x910e('0x22')](_0x910e('0x25'),_0x4faccb[_0x910e('0x26')],_0x4faccb['id']),util[_0x910e('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x498acd(_0x496b76);});}else{return _0x498acd(null,_0x531ca5);}},'beforeUpdate':function(_0x559e12,_0x18897d,_0x11edad){if(_0x559e12[_0x910e('0xc')](_0x910e('0xb'))||_0x559e12[_0x910e('0xc')](_0x910e('0xd'))||_0x559e12[_0x910e('0xc')]('clientId')||_0x559e12[_0x910e('0xc')](_0x910e('0xf'))||_0x559e12[_0x910e('0xc')](_0x910e('0x10'))||_0x559e12[_0x910e('0xc')](_0x910e('0x29'))){var _0x3b6faf,_0x42a6bc;_0x3b6faf=_0x559e12[_0x910e('0xd')];var _0x3fa2d9=_0x3b6faf['slice'](-0x1);if(_0x3fa2d9==='/'||_0x3fa2d9==='\x5c'||_0x3fa2d9===':'){_0x3b6faf=_0x3b6faf[_0x910e('0x12')](0x0,_0x3b6faf[_0x910e('0x13')](_0x3fa2d9));}switch(_0x559e12[_0x910e('0xb')]){case'US':_0x42a6bc=_0x910e('0x14');break;case'AU':_0x42a6bc='https://accounts.zoho.com.au';break;case'IN':_0x42a6bc=_0x910e('0x16');break;case'CN':_0x42a6bc=_0x910e('0x17');break;default:_0x42a6bc=_0x910e('0x18');break;}var _0x41b40d={'method':'POST','uri':_0x42a6bc+_0x910e('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x559e12[_0x910e('0xe')],'client_secret':_0x559e12[_0x910e('0xf')],'redirect_uri':_0x559e12[_0x910e('0xd')],'code':_0x559e12['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x41b40d)[_0x910e('0x1d')](function(_0x1ee094){var _0x3a10fe=JSON[_0x910e('0x1e')](_0x1ee094);if(_0x3a10fe[_0x910e('0x1f')]){_0x559e12[_0x910e('0x20')]=_0x3a10fe[_0x910e('0x1f')];logger['info'](util[_0x910e('0x22')](_0x910e('0x23'),_0x559e12['name'],_0x559e12['id']));}else{logger['error'](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x559e12[_0x910e('0x26')],_0x559e12['id']),util['inspect'](_0x3a10fe,{'showHidden':![],'depth':null}));}return _0x11edad(null,_0x18897d);})['catch'](function(_0x15675c){logger[_0x910e('0x24')](util[_0x910e('0x22')](_0x910e('0x25'),_0x559e12[_0x910e('0x26')],_0x559e12['id']),util[_0x910e('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x11edad(_0x15675c);});}else{return _0x11edad(null,_0x18897d);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 8f6945f..1f1bdbf 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 _0x693a=['request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ZohoAccount','findAll','options','raw','where','limit','include','map','model','attributes','GetZohoAccount','debug','catch','ShowZohoAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http'];(function(_0x4cb74e,_0x3da374){var _0x4a7534=function(_0x4d31a3){while(--_0x4d31a3){_0x4cb74e['push'](_0x4cb74e['shift']());}};_0x4a7534(++_0x3da374);}(_0x693a,0x1ee));var _0xa693=function(_0x17823f,_0xffd807){_0x17823f=_0x17823f-0x0;var _0x51fc21=_0x693a[_0x17823f];return _0x51fc21;};'use strict';var _=require(_0xa693('0x0'));var util=require(_0xa693('0x1'));var moment=require('moment');var BPromise=require(_0xa693('0x2'));var rs=require(_0xa693('0x3'));var fs=require('fs');var Redis=require(_0xa693('0x4'));var db=require(_0xa693('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa693('0x6'))(_0xa693('0x7'));var config=require('../../config/environment');var jayson=require(_0xa693('0x8'));var client=jayson['client'][_0xa693('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3abc7d,_0x1fa171,_0x1b9a50){return new BPromise(function(_0x23889a,_0x81d415){return client[_0xa693('0xa')](_0x3abc7d,_0x1b9a50)[_0xa693('0xb')](function(_0x2a9942){logger[_0xa693('0xc')](_0xa693('0xd'),_0x1fa171,_0xa693('0xe'));logger['debug'](_0xa693('0xf'),_0x1fa171,_0xa693('0xe'),JSON[_0xa693('0x10')](_0x2a9942));if(_0x2a9942[_0xa693('0x11')]){if(_0x2a9942[_0xa693('0x11')][_0xa693('0x12')]===0x1f4){logger[_0xa693('0x11')](_0xa693('0xd'),_0x1fa171,_0x2a9942[_0xa693('0x11')]['message']);return _0x81d415(_0x2a9942[_0xa693('0x11')][_0xa693('0x13')]);}logger[_0xa693('0x11')](_0xa693('0xd'),_0x1fa171,_0x2a9942['error'][_0xa693('0x13')]);return _0x23889a(_0x2a9942[_0xa693('0x11')][_0xa693('0x13')]);}else{logger[_0xa693('0xc')](_0xa693('0xd'),_0x1fa171,'request\x20sent');_0x23889a(_0x2a9942[_0xa693('0x14')][_0xa693('0x13')]);}})['catch'](function(_0xbffb8d){logger[_0xa693('0x11')](_0xa693('0xd'),_0x1fa171,_0xbffb8d);_0x81d415(_0xbffb8d);});});}exports['GetZohoAccount']=function(_0x2c1da1){var _0x2ce706=this;return new Promise(function(_0xb501d0,_0x12c63f){return db[_0xa693('0x15')][_0xa693('0x16')]({'raw':_0x2c1da1[_0xa693('0x17')]?_0x2c1da1[_0xa693('0x17')][_0xa693('0x18')]===undefined?!![]:![]:!![],'where':_0x2c1da1['options']?_0x2c1da1[_0xa693('0x17')][_0xa693('0x19')]||null:null,'attributes':_0x2c1da1[_0xa693('0x17')]?_0x2c1da1[_0xa693('0x17')]['attributes']||null:null,'limit':_0x2c1da1['options']?_0x2c1da1['options'][_0xa693('0x1a')]||null:null,'include':_0x2c1da1[_0xa693('0x17')]?_0x2c1da1['options'][_0xa693('0x1b')]?_[_0xa693('0x1c')](_0x2c1da1[_0xa693('0x17')][_0xa693('0x1b')],function(_0x21e186){return{'model':db[_0x21e186[_0xa693('0x1d')]],'as':_0x21e186['as'],'attributes':_0x21e186[_0xa693('0x1e')],'include':_0x21e186[_0xa693('0x1b')]?_[_0xa693('0x1c')](_0x21e186[_0xa693('0x1b')],function(_0x5d5e35){return{'model':db[_0x5d5e35[_0xa693('0x1d')]],'as':_0x5d5e35['as'],'attributes':_0x5d5e35['attributes'],'include':_0x5d5e35[_0xa693('0x1b')]?_[_0xa693('0x1c')](_0x5d5e35[_0xa693('0x1b')],function(_0x2a9ef4){return{'model':db[_0x2a9ef4['model']],'as':_0x2a9ef4['as'],'attributes':_0x2a9ef4[_0xa693('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa693('0xb')](function(_0xe30d72){logger[_0xa693('0xc')](_0xa693('0x1f'),_0x2c1da1);logger[_0xa693('0x20')](_0xa693('0x1f'),_0x2c1da1,JSON[_0xa693('0x10')](_0xe30d72));_0xb501d0(_0xe30d72);})[_0xa693('0x21')](function(_0x2d86e6){logger['error'](_0xa693('0x1f'),_0x2d86e6[_0xa693('0x13')],_0x2c1da1);_0x12c63f(_0x2ce706['error'](0x1f4,_0x2d86e6[_0xa693('0x13')]));});});};exports[_0xa693('0x22')]=function(_0x4238b8){var _0x1a67f4=this;return new Promise(function(_0x397db3,_0x14a582){return db[_0xa693('0x15')][_0xa693('0x23')]({'raw':_0x4238b8[_0xa693('0x17')]?_0x4238b8[_0xa693('0x17')][_0xa693('0x18')]===undefined?!![]:![]:!![],'where':_0x4238b8['options']?_0x4238b8[_0xa693('0x17')][_0xa693('0x19')]||null:null,'attributes':_0x4238b8['options']?_0x4238b8['options']['attributes']||null:null,'include':_0x4238b8['options']?_0x4238b8['options'][_0xa693('0x1b')]?_[_0xa693('0x1c')](_0x4238b8[_0xa693('0x17')][_0xa693('0x1b')],function(_0x3b03e6){return{'model':db[_0x3b03e6[_0xa693('0x1d')]],'as':_0x3b03e6['as'],'attributes':_0x3b03e6[_0xa693('0x1e')],'include':_0x3b03e6[_0xa693('0x1b')]?_['map'](_0x3b03e6[_0xa693('0x1b')],function(_0x463f75){return{'model':db[_0x463f75[_0xa693('0x1d')]],'as':_0x463f75['as'],'attributes':_0x463f75[_0xa693('0x1e')],'include':_0x463f75[_0xa693('0x1b')]?_['map'](_0x463f75[_0xa693('0x1b')],function(_0x54b7ef){return{'model':db[_0x54b7ef[_0xa693('0x1d')]],'as':_0x54b7ef['as'],'attributes':_0x54b7ef[_0xa693('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa693('0xb')](function(_0x54bb47){logger[_0xa693('0xc')](_0xa693('0x22'),_0x4238b8);logger[_0xa693('0x20')](_0xa693('0x22'),_0x4238b8,JSON[_0xa693('0x10')](_0x54bb47));_0x397db3(_0x54bb47);})[_0xa693('0x21')](function(_0x4d7ba6){logger[_0xa693('0x11')](_0xa693('0x22'),_0x4d7ba6[_0xa693('0x13')],_0x4238b8);_0x14a582(_0x1a67f4[_0xa693('0x11')](0x1f4,_0x4d7ba6[_0xa693('0x13')]));});});}; \ No newline at end of file +var _0xb3d9=['message','result','catch','ZohoAccount','findAll','options','raw','limit','include','model','map','GetZohoAccount','ShowZohoAccount','find','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2ac686,_0x54fb04){var _0xbc434f=function(_0x73c8da){while(--_0x73c8da){_0x2ac686['push'](_0x2ac686['shift']());}};_0xbc434f(++_0x54fb04);}(_0xb3d9,0x182));var _0x9b3d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb3d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9b3d('0x0'));var util=require('util');var moment=require(_0x9b3d('0x1'));var BPromise=require(_0x9b3d('0x2'));var rs=require(_0x9b3d('0x3'));var fs=require('fs');var Redis=require(_0x9b3d('0x4'));var db=require(_0x9b3d('0x5'))['db'];var utils=require(_0x9b3d('0x6'));var logger=require(_0x9b3d('0x7'))(_0x9b3d('0x8'));var config=require(_0x9b3d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9b3d('0xa')][_0x9b3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4672f8,_0x5de0ad,_0x5958d3){return new BPromise(function(_0x561526,_0x461697){return client[_0x9b3d('0xc')](_0x4672f8,_0x5958d3)[_0x9b3d('0xd')](function(_0x4ff37e){logger[_0x9b3d('0xe')](_0x9b3d('0xf'),_0x5de0ad,'request\x20sent');logger[_0x9b3d('0x10')](_0x9b3d('0x11'),_0x5de0ad,_0x9b3d('0x12'),JSON[_0x9b3d('0x13')](_0x4ff37e));if(_0x4ff37e[_0x9b3d('0x14')]){if(_0x4ff37e['error']['code']===0x1f4){logger[_0x9b3d('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x5de0ad,_0x4ff37e[_0x9b3d('0x14')][_0x9b3d('0x15')]);return _0x461697(_0x4ff37e[_0x9b3d('0x14')][_0x9b3d('0x15')]);}logger[_0x9b3d('0x14')](_0x9b3d('0xf'),_0x5de0ad,_0x4ff37e[_0x9b3d('0x14')][_0x9b3d('0x15')]);return _0x561526(_0x4ff37e['error'][_0x9b3d('0x15')]);}else{logger[_0x9b3d('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x5de0ad,_0x9b3d('0x12'));_0x561526(_0x4ff37e[_0x9b3d('0x16')][_0x9b3d('0x15')]);}})[_0x9b3d('0x17')](function(_0x3776ad){logger[_0x9b3d('0x14')](_0x9b3d('0xf'),_0x5de0ad,_0x3776ad);_0x461697(_0x3776ad);});});}exports['GetZohoAccount']=function(_0x510dff){var _0x18dffb=this;return new Promise(function(_0x5e68de,_0x512988){return db[_0x9b3d('0x18')][_0x9b3d('0x19')]({'raw':_0x510dff[_0x9b3d('0x1a')]?_0x510dff[_0x9b3d('0x1a')][_0x9b3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x510dff[_0x9b3d('0x1a')]?_0x510dff[_0x9b3d('0x1a')]['where']||null:null,'attributes':_0x510dff['options']?_0x510dff[_0x9b3d('0x1a')]['attributes']||null:null,'limit':_0x510dff[_0x9b3d('0x1a')]?_0x510dff[_0x9b3d('0x1a')][_0x9b3d('0x1c')]||null:null,'include':_0x510dff[_0x9b3d('0x1a')]?_0x510dff[_0x9b3d('0x1a')]['include']?_['map'](_0x510dff[_0x9b3d('0x1a')][_0x9b3d('0x1d')],function(_0x575548){return{'model':db[_0x575548[_0x9b3d('0x1e')]],'as':_0x575548['as'],'attributes':_0x575548['attributes'],'include':_0x575548[_0x9b3d('0x1d')]?_[_0x9b3d('0x1f')](_0x575548['include'],function(_0x17dc4b){return{'model':db[_0x17dc4b[_0x9b3d('0x1e')]],'as':_0x17dc4b['as'],'attributes':_0x17dc4b['attributes'],'include':_0x17dc4b[_0x9b3d('0x1d')]?_[_0x9b3d('0x1f')](_0x17dc4b[_0x9b3d('0x1d')],function(_0x1d7897){return{'model':db[_0x1d7897[_0x9b3d('0x1e')]],'as':_0x1d7897['as'],'attributes':_0x1d7897['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x21dd8e){logger[_0x9b3d('0xe')](_0x9b3d('0x20'),_0x510dff);logger['debug'](_0x9b3d('0x20'),_0x510dff,JSON[_0x9b3d('0x13')](_0x21dd8e));_0x5e68de(_0x21dd8e);})[_0x9b3d('0x17')](function(_0x28e380){logger[_0x9b3d('0x14')](_0x9b3d('0x20'),_0x28e380['message'],_0x510dff);_0x512988(_0x18dffb[_0x9b3d('0x14')](0x1f4,_0x28e380[_0x9b3d('0x15')]));});});};exports[_0x9b3d('0x21')]=function(_0x43c791){var _0x413a05=this;return new Promise(function(_0x243a5f,_0x5135a3){return db[_0x9b3d('0x18')][_0x9b3d('0x22')]({'raw':_0x43c791[_0x9b3d('0x1a')]?_0x43c791[_0x9b3d('0x1a')][_0x9b3d('0x1b')]===undefined?!![]:![]:!![],'where':_0x43c791[_0x9b3d('0x1a')]?_0x43c791[_0x9b3d('0x1a')][_0x9b3d('0x23')]||null:null,'attributes':_0x43c791[_0x9b3d('0x1a')]?_0x43c791[_0x9b3d('0x1a')]['attributes']||null:null,'include':_0x43c791[_0x9b3d('0x1a')]?_0x43c791[_0x9b3d('0x1a')][_0x9b3d('0x1d')]?_[_0x9b3d('0x1f')](_0x43c791[_0x9b3d('0x1a')]['include'],function(_0xabb829){return{'model':db[_0xabb829['model']],'as':_0xabb829['as'],'attributes':_0xabb829[_0x9b3d('0x24')],'include':_0xabb829[_0x9b3d('0x1d')]?_['map'](_0xabb829['include'],function(_0x433fc6){return{'model':db[_0x433fc6['model']],'as':_0x433fc6['as'],'attributes':_0x433fc6[_0x9b3d('0x24')],'include':_0x433fc6[_0x9b3d('0x1d')]?_['map'](_0x433fc6['include'],function(_0x256cff){return{'model':db[_0x256cff[_0x9b3d('0x1e')]],'as':_0x256cff['as'],'attributes':_0x256cff['attributes']};}):[]};}):[]};}):[]:[]})[_0x9b3d('0xd')](function(_0x21e59d){logger[_0x9b3d('0xe')](_0x9b3d('0x21'),_0x43c791);logger[_0x9b3d('0x10')](_0x9b3d('0x21'),_0x43c791,JSON[_0x9b3d('0x13')](_0x21e59d));_0x243a5f(_0x21e59d);})[_0x9b3d('0x17')](function(_0x28cda5){logger[_0x9b3d('0x14')](_0x9b3d('0x21'),_0x28cda5[_0x9b3d('0x15')],_0x43c791);_0x5135a3(_0x413a05[_0x9b3d('0x14')](0x1f4,_0x28cda5[_0x9b3d('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 39a96b4..aab242b 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 _0x3451=['./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','getDescriptions','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc669ab,_0x4b06bb){var _0x3f192=function(_0x4c3095){while(--_0x4c3095){_0xc669ab['push'](_0xc669ab['shift']());}};_0x3f192(++_0x4b06bb);}(_0x3451,0x19a));var _0x1345=function(_0x47305b,_0x5e6696){_0x47305b=_0x47305b-0x0;var _0x2be76b=_0x3451[_0x47305b];return _0x2be76b;};'use strict';var multer=require(_0x1345('0x0'));var util=require(_0x1345('0x1'));var path=require('path');var timeout=require(_0x1345('0x2'));var express=require(_0x1345('0x3'));var router=express[_0x1345('0x4')]();var auth=require(_0x1345('0x5'));var interaction=require(_0x1345('0x6'));var config=require(_0x1345('0x7'));var controller=require(_0x1345('0x8'));router[_0x1345('0x9')]('/',auth[_0x1345('0xa')](),controller[_0x1345('0xb')]);router[_0x1345('0x9')](_0x1345('0xc'),auth['isAuthenticated'](),controller[_0x1345('0xd')]);router[_0x1345('0x9')]('/:id/fields',auth[_0x1345('0xa')](),controller['getFields']);router['get'](_0x1345('0xe'),auth['isAuthenticated'](),controller[_0x1345('0xf')]);router[_0x1345('0x9')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x1345('0x10')]);router['post']('/',auth[_0x1345('0xa')](),controller[_0x1345('0x11')]);router[_0x1345('0x12')](_0x1345('0xc'),auth['isAuthenticated'](),controller[_0x1345('0x13')]);router[_0x1345('0x14')](_0x1345('0xc'),auth[_0x1345('0xa')](),controller['destroy']);module[_0x1345('0x15')]=router; \ No newline at end of file +var _0xdbfc=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','/:id','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','isAuthenticated','show','/:id/fields','getFields'];(function(_0x408672,_0x69e962){var _0x12f00b=function(_0x4de041){while(--_0x4de041){_0x408672['push'](_0x408672['shift']());}};_0x12f00b(++_0x69e962);}(_0xdbfc,0x11d));var _0xcdbf=function(_0x151558,_0x3ccdb2){_0x151558=_0x151558-0x0;var _0x3ab05e=_0xdbfc[_0x151558];return _0x3ab05e;};'use strict';var multer=require(_0xcdbf('0x0'));var util=require(_0xcdbf('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcdbf('0x2'));var router=express[_0xcdbf('0x3')]();var auth=require(_0xcdbf('0x4'));var interaction=require(_0xcdbf('0x5'));var config=require(_0xcdbf('0x6'));var controller=require(_0xcdbf('0x7'));router[_0xcdbf('0x8')]('/',auth['isAuthenticated'](),controller[_0xcdbf('0x9')]);router[_0xcdbf('0x8')]('/:id',auth[_0xcdbf('0xa')](),controller[_0xcdbf('0xb')]);router[_0xcdbf('0x8')](_0xcdbf('0xc'),auth['isAuthenticated'](),controller[_0xcdbf('0xd')]);router[_0xcdbf('0x8')](_0xcdbf('0xe'),auth[_0xcdbf('0xa')](),controller[_0xcdbf('0xf')]);router['get'](_0xcdbf('0x10'),auth['isAuthenticated'](),controller[_0xcdbf('0x11')]);router['post']('/',auth[_0xcdbf('0xa')](),controller['create']);router[_0xcdbf('0x12')](_0xcdbf('0x13'),auth[_0xcdbf('0xa')](),controller['update']);router[_0xcdbf('0x14')]('/:id',auth[_0xcdbf('0xa')](),controller[_0xcdbf('0x15')]);module[_0xcdbf('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index fbad99f..3dce992 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 _0x3245=['STRING','lead','contact','nothing','ENUM','contact_lead','sequelize','exports'];(function(_0x237b8b,_0x309253){var _0x4ebe62=function(_0x1a3d9c){while(--_0x1a3d9c){_0x237b8b['push'](_0x237b8b['shift']());}};_0x4ebe62(++_0x309253);}(_0x3245,0x11e));var _0x5324=function(_0x4ee943,_0x178976){_0x4ee943=_0x4ee943-0x0;var _0x3dc030=_0x3245[_0x4ee943];return _0x3dc030;};'use strict';var Sequelize=require(_0x5324('0x0'));module[_0x5324('0x1')]={'name':{'type':Sequelize[_0x5324('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x5324('0x3'),_0x5324('0x4'),_0x5324('0x5')),'defaultValue':_0x5324('0x3')},'moduleSearch':{'type':Sequelize[_0x5324('0x6')](_0x5324('0x7'),_0x5324('0x4'),_0x5324('0x3')),'defaultValue':_0x5324('0x7')},'description':{'type':Sequelize[_0x5324('0x2')]}}; \ No newline at end of file +var _0xc456=['lead','nothing','contact_lead','contact','STRING','sequelize','exports','ENUM'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc456,0xf5));var _0x6c45=function(_0x1c0a06,_0x53b821){_0x1c0a06=_0x1c0a06-0x0;var _0x43e800=_0xc456[_0x1c0a06];return _0x43e800;};'use strict';var Sequelize=require(_0x6c45('0x0'));module[_0x6c45('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x6c45('0x2')](_0x6c45('0x3'),'contact',_0x6c45('0x4')),'defaultValue':_0x6c45('0x3')},'moduleSearch':{'type':Sequelize[_0x6c45('0x2')](_0x6c45('0x5'),_0x6c45('0x6'),'lead'),'defaultValue':_0x6c45('0x5')},'description':{'type':Sequelize[_0x6c45('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index d4233d2..8e763d4 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 _0xfaa1=['fields','length','hasOwnProperty','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','params','include','find','create','body','destroy','findOne','rawAttributes','getFields','nolimit','getSubjects','ZohoField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','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~!@#$%^&-_=+[{]}.','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','count','limit','set','Content-Range','reject','save','update','then','stack','name','ZohoConfiguration','fieldName','type','model','map','query','keys','attributes','intersection'];(function(_0x18d631,_0x4376d2){var _0x50d708=function(_0x3b6ab5){while(--_0x3b6ab5){_0x18d631['push'](_0x18d631['shift']());}};_0x50d708(++_0x4376d2);}(_0xfaa1,0xd4));var _0x1faa=function(_0x477db1,_0x4a495c){_0x477db1=_0x477db1-0x0;var _0xfce3c2=_0xfaa1[_0x477db1];return _0xfce3c2;};'use strict';var pdf=require(_0x1faa('0x0'));var emlformat=require(_0x1faa('0x1'));var rimraf=require(_0x1faa('0x2'));var zipdir=require(_0x1faa('0x3'));var jsonpatch=require(_0x1faa('0x4'));var rp=require(_0x1faa('0x5'));var moment=require('moment');var BPromise=require(_0x1faa('0x6'));var Mustache=require(_0x1faa('0x7'));var util=require(_0x1faa('0x8'));var path=require('path');var sox=require(_0x1faa('0x9'));var csv=require(_0x1faa('0xa'));var ejs=require(_0x1faa('0xb'));var fs=require('fs');var _=require(_0x1faa('0xc'));var squel=require(_0x1faa('0xd'));var crypto=require(_0x1faa('0xe'));var jsforce=require(_0x1faa('0xf'));var deskjs=require(_0x1faa('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1faa('0x11'));var Papa=require('papaparse');var Redis=require(_0x1faa('0x12'));var authService=require(_0x1faa('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1faa('0x14'));var logger=require(_0x1faa('0x15'))('api');var utils=require(_0x1faa('0x16'));var config=require(_0x1faa('0x17'));var db=require(_0x1faa('0x18'))['db'];var jayson=require(_0x1faa('0x19'));var client=jayson['client'][_0x1faa('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1f0edf,_0x899006,_0x306f3d){if(_0x306f3d){var _0x459933=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x459933['test'](_0x899006)){return _0x1f0edf;}else{throw new db[(_0x1faa('0x1b'))][(_0x1faa('0x1c'))](_0x1faa('0x1d'));}}else{return _0x1f0edf;}}function respondWithRpcPromise(_0x473a37,_0x6d8967,_0x597a68,_0x5725d9){return new BPromise(function(_0x5f3b16,_0x74273f){var _0x5610a4=_0x5725d9||client;return _0x5610a4[_0x1faa('0x1e')](_0x473a37,_0x597a68)['then'](function(_0x23d46e){logger[_0x1faa('0x1f')](_0x1faa('0x20'),_0x6d8967,_0x1faa('0x21'));logger['debug'](_0x1faa('0x22'),_0x6d8967,'request\x20sent',JSON[_0x1faa('0x23')](_0x23d46e));if(_0x23d46e[_0x1faa('0x24')]){if(_0x23d46e['error'][_0x1faa('0x25')]===0x1f4){logger[_0x1faa('0x24')](_0x1faa('0x20'),_0x6d8967,_0x23d46e[_0x1faa('0x24')]['message']);return _0x74273f(_0x23d46e[_0x1faa('0x24')][_0x1faa('0x26')]);}logger[_0x1faa('0x24')](_0x1faa('0x20'),_0x6d8967,_0x23d46e[_0x1faa('0x24')]['message']);return _0x5f3b16(_0x23d46e[_0x1faa('0x24')][_0x1faa('0x26')]);}else{logger[_0x1faa('0x1f')]('ZohoConfiguration,\x20%s,\x20%s',_0x6d8967,_0x1faa('0x21'));_0x5f3b16(_0x23d46e[_0x1faa('0x27')][_0x1faa('0x26')]);}})[_0x1faa('0x28')](function(_0x33409f){logger['error'](_0x1faa('0x20'),_0x6d8967,_0x33409f);_0x74273f(_0x33409f);});});}function respondWithStatusCode(_0x3b68de,_0x378683){_0x378683=_0x378683||0xcc;return function(_0x348520){if(_0x348520){return _0x3b68de[_0x1faa('0x29')](_0x378683);}return _0x3b68de['status'](_0x378683)[_0x1faa('0x2a')]();};}function respondWithResult(_0x1e734b,_0x5cf293){_0x5cf293=_0x5cf293||0xc8;return function(_0x388825){if(_0x388825){return _0x1e734b[_0x1faa('0x2b')](_0x5cf293)[_0x1faa('0x2c')](_0x388825);}};}function respondWithFilteredResult(_0x3bd875,_0x2fa030){return function(_0x4338a6){if(_0x4338a6){var _0x43355d=_0x4338a6[_0x1faa('0x2d')],_0x3f92c9=_0x2fa030['offset'],_0x4e997a=_0x2fa030['offset']+_0x2fa030[_0x1faa('0x2e')],_0x3e04ee;if(_0x4e997a>=_0x43355d){_0x4e997a=_0x43355d;_0x3e04ee=0xc8;}else{_0x3e04ee=0xce;}_0x3bd875[_0x1faa('0x2b')](_0x3e04ee);return _0x3bd875[_0x1faa('0x2f')](_0x1faa('0x30'),_0x3f92c9+'-'+_0x4e997a+'/'+_0x43355d)[_0x1faa('0x2c')](_0x4338a6);}return null;};}function patchUpdates(_0xc9eac7){return function(_0x423bea){try{jsonpatch['apply'](_0x423bea,_0xc9eac7,!![]);}catch(_0x5318a6){return BPromise[_0x1faa('0x31')](_0x5318a6);}return _0x423bea[_0x1faa('0x32')]();};}function saveUpdates(_0x2689df,_0x12cc0c){return function(_0x15d76e){if(_0x15d76e){return _0x15d76e[_0x1faa('0x33')](_0x2689df)['then'](function(_0x43103e){return _0x43103e;});}return null;};}function removeEntity(_0x249e6e,_0x5c238a){return function(_0x5e1eef){if(_0x5e1eef){return _0x5e1eef['destroy']()[_0x1faa('0x34')](function(){_0x249e6e[_0x1faa('0x2b')](0xcc)[_0x1faa('0x2a')]();});}};}function handleEntityNotFound(_0x3c1568,_0x354169){return function(_0x378eff){if(!_0x378eff){_0x3c1568['sendStatus'](0x194);}return _0x378eff;};}function handleError(_0x1367ba,_0x1cec84){_0x1cec84=_0x1cec84||0x1f4;return function(_0x5a1877){logger['error'](_0x5a1877[_0x1faa('0x35')]);if(_0x5a1877[_0x1faa('0x36')]){delete _0x5a1877[_0x1faa('0x36')];}_0x1367ba['status'](_0x1cec84)['send'](_0x5a1877);};}exports['index']=function(_0x47ea04,_0x2382ce){var _0x15f779={},_0x4222de={},_0x8a411e={'count':0x0,'rows':[]};var _0xa26b10=_['map'](db[_0x1faa('0x37')]['rawAttributes'],function(_0x3fcc49){return{'name':_0x3fcc49[_0x1faa('0x38')],'type':_0x3fcc49[_0x1faa('0x39')]['key']};});_0x4222de[_0x1faa('0x3a')]=_[_0x1faa('0x3b')](_0xa26b10,_0x1faa('0x36'));_0x4222de[_0x1faa('0x3c')]=_[_0x1faa('0x3d')](_0x47ea04[_0x1faa('0x3c')]);_0x4222de['filters']=_['intersection'](_0x4222de[_0x1faa('0x3a')],_0x4222de[_0x1faa('0x3c')]);_0x15f779[_0x1faa('0x3e')]=_[_0x1faa('0x3f')](_0x4222de['model'],qs[_0x1faa('0x40')](_0x47ea04[_0x1faa('0x3c')][_0x1faa('0x40')]));_0x15f779[_0x1faa('0x3e')]=_0x15f779[_0x1faa('0x3e')][_0x1faa('0x41')]?_0x15f779[_0x1faa('0x3e')]:_0x4222de['model'];if(!_0x47ea04[_0x1faa('0x3c')][_0x1faa('0x42')]('nolimit')){_0x15f779[_0x1faa('0x2e')]=qs[_0x1faa('0x2e')](_0x47ea04['query'][_0x1faa('0x2e')]);_0x15f779[_0x1faa('0x43')]=qs[_0x1faa('0x43')](_0x47ea04[_0x1faa('0x3c')][_0x1faa('0x43')]);}_0x15f779[_0x1faa('0x44')]=qs['sort'](_0x47ea04[_0x1faa('0x3c')][_0x1faa('0x45')]);_0x15f779[_0x1faa('0x46')]=qs[_0x1faa('0x47')](_[_0x1faa('0x48')](_0x47ea04[_0x1faa('0x3c')],_0x4222de[_0x1faa('0x47')]),_0xa26b10);if(_0x47ea04[_0x1faa('0x3c')][_0x1faa('0x49')]){_0x15f779[_0x1faa('0x46')]=_[_0x1faa('0x4a')](_0x15f779[_0x1faa('0x46')],{'$or':_['map'](_0xa26b10,function(_0x5a8400){if(_0x5a8400['type']!==_0x1faa('0x4b')){var _0x4fa7e2={};_0x4fa7e2[_0x5a8400[_0x1faa('0x36')]]={'$like':'%'+_0x47ea04[_0x1faa('0x3c')]['filter']+'%'};return _0x4fa7e2;}})});}_0x15f779=_[_0x1faa('0x4a')]({},_0x15f779,_0x47ea04[_0x1faa('0x4c')]);var _0x238c91={'where':_0x15f779[_0x1faa('0x46')]};return db[_0x1faa('0x37')][_0x1faa('0x2d')](_0x238c91)[_0x1faa('0x34')](function(_0x8da21d){_0x8a411e[_0x1faa('0x2d')]=_0x8da21d;if(_0x47ea04[_0x1faa('0x3c')][_0x1faa('0x4d')]){_0x15f779['include']=[{'all':!![]}];}return db[_0x1faa('0x37')]['findAll'](_0x15f779);})[_0x1faa('0x34')](function(_0x3c4e05){_0x8a411e[_0x1faa('0x4e')]=_0x3c4e05;return _0x8a411e;})[_0x1faa('0x34')](respondWithFilteredResult(_0x2382ce,_0x15f779))[_0x1faa('0x28')](handleError(_0x2382ce,null));};exports['show']=function(_0x577c35,_0x3c6441){var _0xff48c2={'raw':![],'where':{'id':_0x577c35[_0x1faa('0x4f')]['id']}},_0x9cb79d={};_0x9cb79d[_0x1faa('0x3a')]=_['keys'](db['ZohoConfiguration']['rawAttributes']);_0x9cb79d['query']=_['keys'](_0x577c35[_0x1faa('0x3c')]);_0x9cb79d[_0x1faa('0x47')]=_[_0x1faa('0x3f')](_0x9cb79d[_0x1faa('0x3a')],_0x9cb79d[_0x1faa('0x3c')]);_0xff48c2[_0x1faa('0x3e')]=_['intersection'](_0x9cb79d[_0x1faa('0x3a')],qs[_0x1faa('0x40')](_0x577c35['query']['fields']));_0xff48c2[_0x1faa('0x3e')]=_0xff48c2[_0x1faa('0x3e')]['length']?_0xff48c2[_0x1faa('0x3e')]:_0x9cb79d[_0x1faa('0x3a')];if(_0x577c35[_0x1faa('0x3c')][_0x1faa('0x4d')]){_0xff48c2[_0x1faa('0x50')]=[{'all':!![]}];}_0xff48c2=_[_0x1faa('0x4a')]({},_0xff48c2,_0x577c35[_0x1faa('0x4c')]);return db['ZohoConfiguration'][_0x1faa('0x51')](_0xff48c2)['then'](handleEntityNotFound(_0x3c6441,null))[_0x1faa('0x34')](respondWithResult(_0x3c6441,null))[_0x1faa('0x28')](handleError(_0x3c6441,null));};exports[_0x1faa('0x52')]=function(_0x561727,_0x2b611e){return db['ZohoConfiguration']['create'](_0x561727[_0x1faa('0x53')],{})[_0x1faa('0x34')](respondWithResult(_0x2b611e,0xc9))[_0x1faa('0x28')](handleError(_0x2b611e,null));};exports['update']=function(_0x3829d6,_0x17dfbb){if(_0x3829d6[_0x1faa('0x53')]['id']){delete _0x3829d6[_0x1faa('0x53')]['id'];}return db[_0x1faa('0x37')][_0x1faa('0x51')]({'where':{'id':_0x3829d6['params']['id']}})[_0x1faa('0x34')](handleEntityNotFound(_0x17dfbb,null))['then'](saveUpdates(_0x3829d6[_0x1faa('0x53')],null))['then'](respondWithResult(_0x17dfbb,null))['catch'](handleError(_0x17dfbb,null));};exports[_0x1faa('0x54')]=function(_0x2b3b2d,_0x52ea58){return db[_0x1faa('0x37')][_0x1faa('0x51')]({'where':{'id':_0x2b3b2d[_0x1faa('0x4f')]['id']}})[_0x1faa('0x34')](handleEntityNotFound(_0x52ea58,null))[_0x1faa('0x34')](removeEntity(_0x52ea58,null))['catch'](handleError(_0x52ea58,null));};exports['getFields']=function(_0x5cc386,_0x3bcf58,_0x5d6789){var _0x587bf3={};var _0x1e09f2={};var _0x39f272;var _0x252952;return db[_0x1faa('0x37')][_0x1faa('0x55')]({'where':{'id':_0x5cc386[_0x1faa('0x4f')]['id']}})[_0x1faa('0x34')](handleEntityNotFound(_0x3bcf58,null))[_0x1faa('0x34')](function(_0xf989d7){if(_0xf989d7){_0x39f272=_0xf989d7;_0x1e09f2[_0x1faa('0x3a')]=_['keys'](db['ZohoField'][_0x1faa('0x56')]);_0x1e09f2['query']=_[_0x1faa('0x3d')](_0x5cc386['query']);_0x1e09f2[_0x1faa('0x47')]=_[_0x1faa('0x3f')](_0x1e09f2[_0x1faa('0x3a')],_0x1e09f2[_0x1faa('0x3c')]);_0x587bf3[_0x1faa('0x3e')]=_[_0x1faa('0x3f')](_0x1e09f2[_0x1faa('0x3a')],qs[_0x1faa('0x40')](_0x5cc386[_0x1faa('0x3c')][_0x1faa('0x40')]));_0x587bf3[_0x1faa('0x3e')]=_0x587bf3['attributes']['length']?_0x587bf3[_0x1faa('0x3e')]:_0x1e09f2[_0x1faa('0x3a')];_0x587bf3[_0x1faa('0x44')]=qs['sort'](_0x5cc386['query'][_0x1faa('0x45')]);_0x587bf3[_0x1faa('0x46')]=qs[_0x1faa('0x47')](_[_0x1faa('0x48')](_0x5cc386['query'],_0x1e09f2[_0x1faa('0x47')]));if(_0x5cc386['query'][_0x1faa('0x49')]){_0x587bf3[_0x1faa('0x46')]=_[_0x1faa('0x4a')](_0x587bf3[_0x1faa('0x46')],{'$or':_[_0x1faa('0x3b')](_0x587bf3['attributes'],function(_0x3d5089){var _0x4b73ac={};_0x4b73ac[_0x3d5089]={'$like':'%'+_0x5cc386[_0x1faa('0x3c')][_0x1faa('0x49')]+'%'};return _0x4b73ac;})});}_0x587bf3=_[_0x1faa('0x4a')]({},_0x587bf3,_0x5cc386['options']);return _0x39f272[_0x1faa('0x57')](_0x587bf3);}})[_0x1faa('0x34')](function(_0x5980cd){if(_0x5980cd){_0x252952=_0x5980cd[_0x1faa('0x41')];if(!_0x5cc386[_0x1faa('0x3c')][_0x1faa('0x42')](_0x1faa('0x58'))){_0x587bf3[_0x1faa('0x2e')]=qs[_0x1faa('0x2e')](_0x5cc386['query']['limit']);_0x587bf3[_0x1faa('0x43')]=qs[_0x1faa('0x43')](_0x5cc386[_0x1faa('0x3c')][_0x1faa('0x43')]);}return _0x39f272['getFields'](_0x587bf3);}})[_0x1faa('0x34')](function(_0x3b6c2c){if(_0x3b6c2c){return _0x3b6c2c?{'count':_0x252952,'rows':_0x3b6c2c}:null;}})['then'](respondWithResult(_0x3bcf58,null))[_0x1faa('0x28')](handleError(_0x3bcf58,null));};exports[_0x1faa('0x59')]=function(_0x33348f,_0x54db1b,_0x5e7552){var _0x1c2661={};var _0xdb23b6={};var _0x8f05ec;var _0x21dd1e;return db[_0x1faa('0x37')]['findOne']({'where':{'id':_0x33348f[_0x1faa('0x4f')]['id']}})[_0x1faa('0x34')](handleEntityNotFound(_0x54db1b,null))['then'](function(_0x34f24e){if(_0x34f24e){_0x8f05ec=_0x34f24e;_0xdb23b6[_0x1faa('0x3a')]=_[_0x1faa('0x3d')](db[_0x1faa('0x5a')][_0x1faa('0x56')]);_0xdb23b6['query']=_[_0x1faa('0x3d')](_0x33348f[_0x1faa('0x3c')]);_0xdb23b6[_0x1faa('0x47')]=_['intersection'](_0xdb23b6[_0x1faa('0x3a')],_0xdb23b6[_0x1faa('0x3c')]);_0x1c2661[_0x1faa('0x3e')]=_[_0x1faa('0x3f')](_0xdb23b6['model'],qs['fields'](_0x33348f[_0x1faa('0x3c')][_0x1faa('0x40')]));_0x1c2661['attributes']=_0x1c2661[_0x1faa('0x3e')][_0x1faa('0x41')]?_0x1c2661[_0x1faa('0x3e')]:_0xdb23b6[_0x1faa('0x3a')];_0x1c2661[_0x1faa('0x44')]=qs['sort'](_0x33348f[_0x1faa('0x3c')]['sort']);_0x1c2661['where']=qs[_0x1faa('0x47')](_[_0x1faa('0x48')](_0x33348f[_0x1faa('0x3c')],_0xdb23b6['filters']));if(_0x33348f['query']['filter']){_0x1c2661[_0x1faa('0x46')]=_[_0x1faa('0x4a')](_0x1c2661[_0x1faa('0x46')],{'$or':_[_0x1faa('0x3b')](_0x1c2661[_0x1faa('0x3e')],function(_0x17cb75){var _0x3837fa={};_0x3837fa[_0x17cb75]={'$like':'%'+_0x33348f['query'][_0x1faa('0x49')]+'%'};return _0x3837fa;})});}_0x1c2661=_[_0x1faa('0x4a')]({},_0x1c2661,_0x33348f[_0x1faa('0x4c')]);return _0x8f05ec['getSubjects'](_0x1c2661);}})[_0x1faa('0x34')](function(_0x114703){if(_0x114703){_0x21dd1e=_0x114703[_0x1faa('0x41')];if(!_0x33348f[_0x1faa('0x3c')][_0x1faa('0x42')](_0x1faa('0x58'))){_0x1c2661['limit']=qs[_0x1faa('0x2e')](_0x33348f['query'][_0x1faa('0x2e')]);_0x1c2661[_0x1faa('0x43')]=qs[_0x1faa('0x43')](_0x33348f[_0x1faa('0x3c')][_0x1faa('0x43')]);}return _0x8f05ec['getSubjects'](_0x1c2661);}})['then'](function(_0x29a695){if(_0x29a695){return _0x29a695?{'count':_0x21dd1e,'rows':_0x29a695}:null;}})[_0x1faa('0x34')](respondWithResult(_0x54db1b,null))[_0x1faa('0x28')](handleError(_0x54db1b,null));};exports[_0x1faa('0x5b')]=function(_0x275eb0,_0x42dd5d,_0x34fc9c){var _0x546bcd={};var _0x58c127={};var _0x503832;var _0x3a5983;return db[_0x1faa('0x37')][_0x1faa('0x55')]({'where':{'id':_0x275eb0[_0x1faa('0x4f')]['id']}})[_0x1faa('0x34')](handleEntityNotFound(_0x42dd5d,null))[_0x1faa('0x34')](function(_0xcc47a3){if(_0xcc47a3){_0x503832=_0xcc47a3;_0x58c127[_0x1faa('0x3a')]=_[_0x1faa('0x3d')](db[_0x1faa('0x5a')]['rawAttributes']);_0x58c127['query']=_[_0x1faa('0x3d')](_0x275eb0['query']);_0x58c127['filters']=_['intersection'](_0x58c127[_0x1faa('0x3a')],_0x58c127[_0x1faa('0x3c')]);_0x546bcd[_0x1faa('0x3e')]=_[_0x1faa('0x3f')](_0x58c127['model'],qs['fields'](_0x275eb0[_0x1faa('0x3c')][_0x1faa('0x40')]));_0x546bcd[_0x1faa('0x3e')]=_0x546bcd[_0x1faa('0x3e')][_0x1faa('0x41')]?_0x546bcd['attributes']:_0x58c127['model'];_0x546bcd['order']=qs[_0x1faa('0x45')](_0x275eb0[_0x1faa('0x3c')][_0x1faa('0x45')]);_0x546bcd['where']=qs[_0x1faa('0x47')](_[_0x1faa('0x48')](_0x275eb0[_0x1faa('0x3c')],_0x58c127['filters']));if(_0x275eb0[_0x1faa('0x3c')][_0x1faa('0x49')]){_0x546bcd['where']=_[_0x1faa('0x4a')](_0x546bcd['where'],{'$or':_['map'](_0x546bcd[_0x1faa('0x3e')],function(_0x596154){var _0x4e9b90={};_0x4e9b90[_0x596154]={'$like':'%'+_0x275eb0[_0x1faa('0x3c')][_0x1faa('0x49')]+'%'};return _0x4e9b90;})});}_0x546bcd=_[_0x1faa('0x4a')]({},_0x546bcd,_0x275eb0[_0x1faa('0x4c')]);return _0x503832[_0x1faa('0x5b')](_0x546bcd);}})['then'](function(_0x44a0e7){if(_0x44a0e7){_0x3a5983=_0x44a0e7[_0x1faa('0x41')];if(!_0x275eb0['query']['hasOwnProperty'](_0x1faa('0x58'))){_0x546bcd['limit']=qs['limit'](_0x275eb0['query'][_0x1faa('0x2e')]);_0x546bcd[_0x1faa('0x43')]=qs[_0x1faa('0x43')](_0x275eb0['query'][_0x1faa('0x43')]);}return _0x503832[_0x1faa('0x5b')](_0x546bcd);}})[_0x1faa('0x34')](function(_0x5db561){if(_0x5db561){return _0x5db561?{'count':_0x3a5983,'rows':_0x5db561}:null;}})[_0x1faa('0x34')](respondWithResult(_0x42dd5d,null))[_0x1faa('0x28')](handleError(_0x42dd5d,null));}; \ No newline at end of file +var _0xa6cc=['hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','type','options','ZohoConfiguration','count','includeAll','include','findAll','rows','find','create','body','update','params','getFields','findOne','ZohoField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','destroy','then','end','name','index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length'];(function(_0x594c45,_0x47ce91){var _0x19b572=function(_0x239828){while(--_0x239828){_0x594c45['push'](_0x594c45['shift']());}};_0x19b572(++_0x47ce91);}(_0xa6cc,0x13c));var _0xca6c=function(_0x5d7299,_0x544bc0){_0x5d7299=_0x5d7299-0x0;var _0x3125ea=_0xa6cc[_0x5d7299];return _0x3125ea;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xca6c('0x0'));var rimraf=require(_0xca6c('0x1'));var zipdir=require(_0xca6c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca6c('0x3'));var moment=require(_0xca6c('0x4'));var BPromise=require(_0xca6c('0x5'));var Mustache=require(_0xca6c('0x6'));var util=require(_0xca6c('0x7'));var path=require(_0xca6c('0x8'));var sox=require(_0xca6c('0x9'));var csv=require(_0xca6c('0xa'));var ejs=require(_0xca6c('0xb'));var fs=require('fs');var _=require(_0xca6c('0xc'));var squel=require(_0xca6c('0xd'));var crypto=require(_0xca6c('0xe'));var jsforce=require(_0xca6c('0xf'));var deskjs=require(_0xca6c('0x10'));var toCsv=require(_0xca6c('0xa'));var querystring=require(_0xca6c('0x11'));var Papa=require(_0xca6c('0x12'));var Redis=require(_0xca6c('0x13'));var authService=require(_0xca6c('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca6c('0x15'));var logger=require(_0xca6c('0x16'))('api');var utils=require(_0xca6c('0x17'));var config=require(_0xca6c('0x18'));var db=require(_0xca6c('0x19'))['db'];var jayson=require(_0xca6c('0x1a'));var client=jayson[_0xca6c('0x1b')][_0xca6c('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x41a587,_0x4b7459,_0xe566f7){if(_0xe566f7){var _0x2641bc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2641bc['test'](_0x4b7459)){return _0x41a587;}else{throw new db[(_0xca6c('0x1d'))][(_0xca6c('0x1e'))](_0xca6c('0x1f'));}}else{return _0x41a587;}}function respondWithRpcPromise(_0x187327,_0xe6df56,_0x55fce1,_0x96890){return new BPromise(function(_0x2909e6,_0x48b79e){var _0x2c781c=_0x96890||client;return _0x2c781c[_0xca6c('0x20')](_0x187327,_0x55fce1)['then'](function(_0x5cd671){logger[_0xca6c('0x21')](_0xca6c('0x22'),_0xe6df56,_0xca6c('0x23'));logger[_0xca6c('0x24')](_0xca6c('0x25'),_0xe6df56,_0xca6c('0x23'),JSON[_0xca6c('0x26')](_0x5cd671));if(_0x5cd671[_0xca6c('0x27')]){if(_0x5cd671[_0xca6c('0x27')]['code']===0x1f4){logger[_0xca6c('0x27')](_0xca6c('0x22'),_0xe6df56,_0x5cd671[_0xca6c('0x27')][_0xca6c('0x28')]);return _0x48b79e(_0x5cd671[_0xca6c('0x27')][_0xca6c('0x28')]);}logger[_0xca6c('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0xe6df56,_0x5cd671[_0xca6c('0x27')][_0xca6c('0x28')]);return _0x2909e6(_0x5cd671[_0xca6c('0x27')][_0xca6c('0x28')]);}else{logger[_0xca6c('0x21')]('ZohoConfiguration,\x20%s,\x20%s',_0xe6df56,'request\x20sent');_0x2909e6(_0x5cd671[_0xca6c('0x29')][_0xca6c('0x28')]);}})[_0xca6c('0x2a')](function(_0x2fd0df){logger[_0xca6c('0x27')](_0xca6c('0x22'),_0xe6df56,_0x2fd0df);_0x48b79e(_0x2fd0df);});});}function respondWithStatusCode(_0x1d6c9a,_0x588736){_0x588736=_0x588736||0xcc;return function(_0x283da1){if(_0x283da1){return _0x1d6c9a[_0xca6c('0x2b')](_0x588736);}return _0x1d6c9a[_0xca6c('0x2c')](_0x588736)['end']();};}function respondWithResult(_0x5800c6,_0x1e588f){_0x1e588f=_0x1e588f||0xc8;return function(_0x6e6ec2){if(_0x6e6ec2){return _0x5800c6[_0xca6c('0x2c')](_0x1e588f)[_0xca6c('0x2d')](_0x6e6ec2);}};}function respondWithFilteredResult(_0x31a1cf,_0x4fabc0){return function(_0x5a9cb1){if(_0x5a9cb1){var _0x311ecf=_0x5a9cb1['count'],_0x556bf3=_0x4fabc0[_0xca6c('0x2e')],_0x1e1f68=_0x4fabc0[_0xca6c('0x2e')]+_0x4fabc0['limit'],_0x112e90;if(_0x1e1f68>=_0x311ecf){_0x1e1f68=_0x311ecf;_0x112e90=0xc8;}else{_0x112e90=0xce;}_0x31a1cf[_0xca6c('0x2c')](_0x112e90);return _0x31a1cf[_0xca6c('0x2f')](_0xca6c('0x30'),_0x556bf3+'-'+_0x1e1f68+'/'+_0x311ecf)[_0xca6c('0x2d')](_0x5a9cb1);}return null;};}function patchUpdates(_0x4f920a){return function(_0x1764e7){try{jsonpatch[_0xca6c('0x31')](_0x1764e7,_0x4f920a,!![]);}catch(_0x3782c1){return BPromise[_0xca6c('0x32')](_0x3782c1);}return _0x1764e7[_0xca6c('0x33')]();};}function saveUpdates(_0x24ea84,_0x1cc0a4){return function(_0x33e3d3){if(_0x33e3d3){return _0x33e3d3['update'](_0x24ea84)['then'](function(_0x416e86){return _0x416e86;});}return null;};}function removeEntity(_0x5669cc,_0x1ef9d4){return function(_0x13c3b6){if(_0x13c3b6){return _0x13c3b6[_0xca6c('0x34')]()[_0xca6c('0x35')](function(){_0x5669cc[_0xca6c('0x2c')](0xcc)[_0xca6c('0x36')]();});}};}function handleEntityNotFound(_0x1a852e,_0x4b1305){return function(_0x328266){if(!_0x328266){_0x1a852e[_0xca6c('0x2b')](0x194);}return _0x328266;};}function handleError(_0x5dc9ff,_0x4cfebe){_0x4cfebe=_0x4cfebe||0x1f4;return function(_0x575ce1){logger[_0xca6c('0x27')](_0x575ce1['stack']);if(_0x575ce1[_0xca6c('0x37')]){delete _0x575ce1['name'];}_0x5dc9ff['status'](_0x4cfebe)['send'](_0x575ce1);};}exports[_0xca6c('0x38')]=function(_0x431ea1,_0x4b6b97){var _0xe844f={},_0x2f2aee={},_0x373543={'count':0x0,'rows':[]};var _0x45f303=_[_0xca6c('0x39')](db['ZohoConfiguration'][_0xca6c('0x3a')],function(_0x27c6ce){return{'name':_0x27c6ce[_0xca6c('0x3b')],'type':_0x27c6ce['type'][_0xca6c('0x3c')]};});_0x2f2aee[_0xca6c('0x3d')]=_[_0xca6c('0x39')](_0x45f303,'name');_0x2f2aee['query']=_[_0xca6c('0x3e')](_0x431ea1['query']);_0x2f2aee['filters']=_[_0xca6c('0x3f')](_0x2f2aee[_0xca6c('0x3d')],_0x2f2aee[_0xca6c('0x40')]);_0xe844f[_0xca6c('0x41')]=_[_0xca6c('0x3f')](_0x2f2aee[_0xca6c('0x3d')],qs[_0xca6c('0x42')](_0x431ea1[_0xca6c('0x40')][_0xca6c('0x42')]));_0xe844f[_0xca6c('0x41')]=_0xe844f['attributes'][_0xca6c('0x43')]?_0xe844f[_0xca6c('0x41')]:_0x2f2aee[_0xca6c('0x3d')];if(!_0x431ea1[_0xca6c('0x40')][_0xca6c('0x44')](_0xca6c('0x45'))){_0xe844f[_0xca6c('0x46')]=qs[_0xca6c('0x46')](_0x431ea1['query'][_0xca6c('0x46')]);_0xe844f['offset']=qs[_0xca6c('0x2e')](_0x431ea1[_0xca6c('0x40')][_0xca6c('0x2e')]);}_0xe844f[_0xca6c('0x47')]=qs[_0xca6c('0x48')](_0x431ea1[_0xca6c('0x40')][_0xca6c('0x48')]);_0xe844f[_0xca6c('0x49')]=qs[_0xca6c('0x4a')](_['pick'](_0x431ea1[_0xca6c('0x40')],_0x2f2aee[_0xca6c('0x4a')]),_0x45f303);if(_0x431ea1[_0xca6c('0x40')][_0xca6c('0x4b')]){_0xe844f[_0xca6c('0x49')]=_[_0xca6c('0x4c')](_0xe844f[_0xca6c('0x49')],{'$or':_['map'](_0x45f303,function(_0x3f74a9){if(_0x3f74a9[_0xca6c('0x4d')]!=='VIRTUAL'){var _0x44991d={};_0x44991d[_0x3f74a9[_0xca6c('0x37')]]={'$like':'%'+_0x431ea1[_0xca6c('0x40')][_0xca6c('0x4b')]+'%'};return _0x44991d;}})});}_0xe844f=_[_0xca6c('0x4c')]({},_0xe844f,_0x431ea1[_0xca6c('0x4e')]);var _0x4b021c={'where':_0xe844f['where']};return db[_0xca6c('0x4f')][_0xca6c('0x50')](_0x4b021c)[_0xca6c('0x35')](function(_0x2ea20e){_0x373543['count']=_0x2ea20e;if(_0x431ea1['query'][_0xca6c('0x51')]){_0xe844f[_0xca6c('0x52')]=[{'all':!![]}];}return db[_0xca6c('0x4f')][_0xca6c('0x53')](_0xe844f);})[_0xca6c('0x35')](function(_0x4f76bd){_0x373543[_0xca6c('0x54')]=_0x4f76bd;return _0x373543;})[_0xca6c('0x35')](respondWithFilteredResult(_0x4b6b97,_0xe844f))['catch'](handleError(_0x4b6b97,null));};exports['show']=function(_0x465794,_0x498c69){var _0x338d70={'raw':![],'where':{'id':_0x465794['params']['id']}},_0x35fb32={};_0x35fb32[_0xca6c('0x3d')]=_['keys'](db[_0xca6c('0x4f')][_0xca6c('0x3a')]);_0x35fb32[_0xca6c('0x40')]=_[_0xca6c('0x3e')](_0x465794[_0xca6c('0x40')]);_0x35fb32['filters']=_['intersection'](_0x35fb32[_0xca6c('0x3d')],_0x35fb32[_0xca6c('0x40')]);_0x338d70[_0xca6c('0x41')]=_['intersection'](_0x35fb32[_0xca6c('0x3d')],qs[_0xca6c('0x42')](_0x465794[_0xca6c('0x40')][_0xca6c('0x42')]));_0x338d70['attributes']=_0x338d70['attributes'][_0xca6c('0x43')]?_0x338d70['attributes']:_0x35fb32[_0xca6c('0x3d')];if(_0x465794['query'][_0xca6c('0x51')]){_0x338d70[_0xca6c('0x52')]=[{'all':!![]}];}_0x338d70=_['merge']({},_0x338d70,_0x465794[_0xca6c('0x4e')]);return db[_0xca6c('0x4f')][_0xca6c('0x55')](_0x338d70)[_0xca6c('0x35')](handleEntityNotFound(_0x498c69,null))[_0xca6c('0x35')](respondWithResult(_0x498c69,null))[_0xca6c('0x2a')](handleError(_0x498c69,null));};exports[_0xca6c('0x56')]=function(_0x42c31,_0x486cb4){return db[_0xca6c('0x4f')][_0xca6c('0x56')](_0x42c31[_0xca6c('0x57')],{})['then'](respondWithResult(_0x486cb4,0xc9))[_0xca6c('0x2a')](handleError(_0x486cb4,null));};exports[_0xca6c('0x58')]=function(_0x570400,_0x87d1d9){if(_0x570400['body']['id']){delete _0x570400[_0xca6c('0x57')]['id'];}return db[_0xca6c('0x4f')][_0xca6c('0x55')]({'where':{'id':_0x570400[_0xca6c('0x59')]['id']}})[_0xca6c('0x35')](handleEntityNotFound(_0x87d1d9,null))[_0xca6c('0x35')](saveUpdates(_0x570400[_0xca6c('0x57')],null))[_0xca6c('0x35')](respondWithResult(_0x87d1d9,null))[_0xca6c('0x2a')](handleError(_0x87d1d9,null));};exports[_0xca6c('0x34')]=function(_0x2cf14d,_0x3cab43){return db['ZohoConfiguration'][_0xca6c('0x55')]({'where':{'id':_0x2cf14d['params']['id']}})[_0xca6c('0x35')](handleEntityNotFound(_0x3cab43,null))[_0xca6c('0x35')](removeEntity(_0x3cab43,null))[_0xca6c('0x2a')](handleError(_0x3cab43,null));};exports[_0xca6c('0x5a')]=function(_0x814e47,_0x5e73a0,_0x3da6b1){var _0x14eaf5={};var _0x5c8791={};var _0x4c4a11;var _0x43cd43;return db[_0xca6c('0x4f')][_0xca6c('0x5b')]({'where':{'id':_0x814e47[_0xca6c('0x59')]['id']}})[_0xca6c('0x35')](handleEntityNotFound(_0x5e73a0,null))[_0xca6c('0x35')](function(_0x456163){if(_0x456163){_0x4c4a11=_0x456163;_0x5c8791[_0xca6c('0x3d')]=_[_0xca6c('0x3e')](db[_0xca6c('0x5c')][_0xca6c('0x3a')]);_0x5c8791[_0xca6c('0x40')]=_[_0xca6c('0x3e')](_0x814e47[_0xca6c('0x40')]);_0x5c8791[_0xca6c('0x4a')]=_['intersection'](_0x5c8791['model'],_0x5c8791[_0xca6c('0x40')]);_0x14eaf5[_0xca6c('0x41')]=_[_0xca6c('0x3f')](_0x5c8791[_0xca6c('0x3d')],qs[_0xca6c('0x42')](_0x814e47['query'][_0xca6c('0x42')]));_0x14eaf5[_0xca6c('0x41')]=_0x14eaf5['attributes'][_0xca6c('0x43')]?_0x14eaf5[_0xca6c('0x41')]:_0x5c8791[_0xca6c('0x3d')];_0x14eaf5[_0xca6c('0x47')]=qs[_0xca6c('0x48')](_0x814e47[_0xca6c('0x40')][_0xca6c('0x48')]);_0x14eaf5[_0xca6c('0x49')]=qs[_0xca6c('0x4a')](_[_0xca6c('0x5d')](_0x814e47[_0xca6c('0x40')],_0x5c8791[_0xca6c('0x4a')]));if(_0x814e47[_0xca6c('0x40')]['filter']){_0x14eaf5[_0xca6c('0x49')]=_['merge'](_0x14eaf5[_0xca6c('0x49')],{'$or':_[_0xca6c('0x39')](_0x14eaf5[_0xca6c('0x41')],function(_0x4d4269){var _0x2d9c68={};_0x2d9c68[_0x4d4269]={'$like':'%'+_0x814e47[_0xca6c('0x40')][_0xca6c('0x4b')]+'%'};return _0x2d9c68;})});}_0x14eaf5=_[_0xca6c('0x4c')]({},_0x14eaf5,_0x814e47[_0xca6c('0x4e')]);return _0x4c4a11[_0xca6c('0x5a')](_0x14eaf5);}})['then'](function(_0x35d8a7){if(_0x35d8a7){_0x43cd43=_0x35d8a7['length'];if(!_0x814e47[_0xca6c('0x40')]['hasOwnProperty']('nolimit')){_0x14eaf5['limit']=qs['limit'](_0x814e47['query']['limit']);_0x14eaf5[_0xca6c('0x2e')]=qs['offset'](_0x814e47['query'][_0xca6c('0x2e')]);}return _0x4c4a11[_0xca6c('0x5a')](_0x14eaf5);}})['then'](function(_0x27b395){if(_0x27b395){return _0x27b395?{'count':_0x43cd43,'rows':_0x27b395}:null;}})[_0xca6c('0x35')](respondWithResult(_0x5e73a0,null))[_0xca6c('0x2a')](handleError(_0x5e73a0,null));};exports[_0xca6c('0x5e')]=function(_0x31dc98,_0x50a924,_0x573ee7){var _0x1839a7={};var _0x536267={};var _0x41cd99;var _0x1c4278;return db[_0xca6c('0x4f')][_0xca6c('0x5b')]({'where':{'id':_0x31dc98[_0xca6c('0x59')]['id']}})[_0xca6c('0x35')](handleEntityNotFound(_0x50a924,null))[_0xca6c('0x35')](function(_0x2cdaa6){if(_0x2cdaa6){_0x41cd99=_0x2cdaa6;_0x536267[_0xca6c('0x3d')]=_['keys'](db[_0xca6c('0x5c')]['rawAttributes']);_0x536267[_0xca6c('0x40')]=_[_0xca6c('0x3e')](_0x31dc98[_0xca6c('0x40')]);_0x536267[_0xca6c('0x4a')]=_['intersection'](_0x536267[_0xca6c('0x3d')],_0x536267['query']);_0x1839a7[_0xca6c('0x41')]=_['intersection'](_0x536267[_0xca6c('0x3d')],qs['fields'](_0x31dc98['query'][_0xca6c('0x42')]));_0x1839a7['attributes']=_0x1839a7[_0xca6c('0x41')][_0xca6c('0x43')]?_0x1839a7[_0xca6c('0x41')]:_0x536267[_0xca6c('0x3d')];_0x1839a7[_0xca6c('0x47')]=qs['sort'](_0x31dc98[_0xca6c('0x40')][_0xca6c('0x48')]);_0x1839a7[_0xca6c('0x49')]=qs['filters'](_[_0xca6c('0x5d')](_0x31dc98['query'],_0x536267['filters']));if(_0x31dc98['query'][_0xca6c('0x4b')]){_0x1839a7[_0xca6c('0x49')]=_[_0xca6c('0x4c')](_0x1839a7[_0xca6c('0x49')],{'$or':_['map'](_0x1839a7[_0xca6c('0x41')],function(_0x58fce2){var _0x3b153e={};_0x3b153e[_0x58fce2]={'$like':'%'+_0x31dc98[_0xca6c('0x40')][_0xca6c('0x4b')]+'%'};return _0x3b153e;})});}_0x1839a7=_[_0xca6c('0x4c')]({},_0x1839a7,_0x31dc98['options']);return _0x41cd99[_0xca6c('0x5e')](_0x1839a7);}})[_0xca6c('0x35')](function(_0x8b8815){if(_0x8b8815){_0x1c4278=_0x8b8815[_0xca6c('0x43')];if(!_0x31dc98['query']['hasOwnProperty'](_0xca6c('0x45'))){_0x1839a7[_0xca6c('0x46')]=qs[_0xca6c('0x46')](_0x31dc98['query'][_0xca6c('0x46')]);_0x1839a7[_0xca6c('0x2e')]=qs[_0xca6c('0x2e')](_0x31dc98[_0xca6c('0x40')][_0xca6c('0x2e')]);}return _0x41cd99['getSubjects'](_0x1839a7);}})[_0xca6c('0x35')](function(_0x3a2cb8){if(_0x3a2cb8){return _0x3a2cb8?{'count':_0x1c4278,'rows':_0x3a2cb8}:null;}})[_0xca6c('0x35')](respondWithResult(_0x50a924,null))[_0xca6c('0x2a')](handleError(_0x50a924,null));};exports[_0xca6c('0x5f')]=function(_0x3f87e3,_0x371fb7,_0x247969){var _0x4c99da={};var _0x2b7ef7={};var _0x8f95cf;var _0x563669;return db[_0xca6c('0x4f')][_0xca6c('0x5b')]({'where':{'id':_0x3f87e3['params']['id']}})[_0xca6c('0x35')](handleEntityNotFound(_0x371fb7,null))[_0xca6c('0x35')](function(_0x253b8f){if(_0x253b8f){_0x8f95cf=_0x253b8f;_0x2b7ef7[_0xca6c('0x3d')]=_[_0xca6c('0x3e')](db[_0xca6c('0x5c')][_0xca6c('0x3a')]);_0x2b7ef7[_0xca6c('0x40')]=_[_0xca6c('0x3e')](_0x3f87e3['query']);_0x2b7ef7[_0xca6c('0x4a')]=_[_0xca6c('0x3f')](_0x2b7ef7['model'],_0x2b7ef7[_0xca6c('0x40')]);_0x4c99da[_0xca6c('0x41')]=_[_0xca6c('0x3f')](_0x2b7ef7[_0xca6c('0x3d')],qs[_0xca6c('0x42')](_0x3f87e3[_0xca6c('0x40')][_0xca6c('0x42')]));_0x4c99da[_0xca6c('0x41')]=_0x4c99da[_0xca6c('0x41')][_0xca6c('0x43')]?_0x4c99da[_0xca6c('0x41')]:_0x2b7ef7[_0xca6c('0x3d')];_0x4c99da[_0xca6c('0x47')]=qs[_0xca6c('0x48')](_0x3f87e3['query'][_0xca6c('0x48')]);_0x4c99da[_0xca6c('0x49')]=qs[_0xca6c('0x4a')](_[_0xca6c('0x5d')](_0x3f87e3[_0xca6c('0x40')],_0x2b7ef7[_0xca6c('0x4a')]));if(_0x3f87e3['query'][_0xca6c('0x4b')]){_0x4c99da[_0xca6c('0x49')]=_[_0xca6c('0x4c')](_0x4c99da[_0xca6c('0x49')],{'$or':_[_0xca6c('0x39')](_0x4c99da[_0xca6c('0x41')],function(_0x2bdde5){var _0x3a9880={};_0x3a9880[_0x2bdde5]={'$like':'%'+_0x3f87e3[_0xca6c('0x40')][_0xca6c('0x4b')]+'%'};return _0x3a9880;})});}_0x4c99da=_[_0xca6c('0x4c')]({},_0x4c99da,_0x3f87e3[_0xca6c('0x4e')]);return _0x8f95cf[_0xca6c('0x5f')](_0x4c99da);}})['then'](function(_0x57d7c0){if(_0x57d7c0){_0x563669=_0x57d7c0['length'];if(!_0x3f87e3[_0xca6c('0x40')][_0xca6c('0x44')](_0xca6c('0x45'))){_0x4c99da[_0xca6c('0x46')]=qs[_0xca6c('0x46')](_0x3f87e3['query'][_0xca6c('0x46')]);_0x4c99da[_0xca6c('0x2e')]=qs[_0xca6c('0x2e')](_0x3f87e3[_0xca6c('0x40')][_0xca6c('0x2e')]);}return _0x8f95cf[_0xca6c('0x5f')](_0x4c99da);}})[_0xca6c('0x35')](function(_0x5001be){if(_0x5001be){return _0x5001be?{'count':_0x563669,'rows':_0x5001be}:null;}})[_0xca6c('0x35')](respondWithResult(_0x371fb7,null))[_0xca6c('0x2a')](handleError(_0x371fb7,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 073885d..e595e2c 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 _0x3087=['../../config/logger','api','request-promise','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0x3769f8,_0x2510f2){var _0x2ff1d2=function(_0x44e894){while(--_0x44e894){_0x3769f8['push'](_0x3769f8['shift']());}};_0x2ff1d2(++_0x2510f2);}(_0x3087,0x10c));var _0x7308=function(_0x356f19,_0x20a902){_0x356f19=_0x356f19-0x0;var _0x556d3d=_0x3087[_0x356f19];return _0x556d3d;};'use strict';var _=require(_0x7308('0x0'));var util=require(_0x7308('0x1'));var logger=require(_0x7308('0x2'))(_0x7308('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7308('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7308('0x5'));var attributes=require(_0x7308('0x6'));module[_0x7308('0x7')]=function(_0x5b518d,_0x72c17d){return _0x5b518d['define'](_0x7308('0x8'),attributes,{'tableName':_0x7308('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2120=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','ZohoConfiguration','int_zoho_configurations','lodash','util'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0x2120,0xca));var _0x0212=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0x2120[_0x52085a];return _0x5afc1a;};'use strict';var _=require(_0x0212('0x0'));var util=require(_0x0212('0x1'));var logger=require(_0x0212('0x2'))(_0x0212('0x3'));var moment=require(_0x0212('0x4'));var BPromise=require(_0x0212('0x5'));var rp=require(_0x0212('0x6'));var fs=require('fs');var path=require(_0x0212('0x7'));var rimraf=require('rimraf');var config=require(_0x0212('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0x0212('0x9')]=function(_0x461b91,_0x541fa1){return _0x461b91['define'](_0x0212('0xa'),attributes,{'tableName':_0x0212('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index a04d0eb..de8237a 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 _0x582a=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','client','http','request','info'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x582a,0x1ae));var _0xa582=function(_0x13117b,_0x3449eb){_0x13117b=_0x13117b-0x0;var _0x418124=_0x582a[_0x13117b];return _0x418124;};'use strict';var _=require(_0xa582('0x0'));var util=require(_0xa582('0x1'));var moment=require(_0xa582('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa582('0x3'));var db=require(_0xa582('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa582('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa582('0x6')][_0xa582('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x447fec,_0x3deb31,_0x1f1289){return new BPromise(function(_0x4a1042,_0x39832b){return client[_0xa582('0x8')](_0x447fec,_0x1f1289)['then'](function(_0x5e0a41){logger[_0xa582('0x9')]('ZohoConfiguration,\x20%s,\x20%s',_0x3deb31,'request\x20sent');logger[_0xa582('0xa')](_0xa582('0xb'),_0x3deb31,'request\x20sent',JSON[_0xa582('0xc')](_0x5e0a41));if(_0x5e0a41[_0xa582('0xd')]){if(_0x5e0a41[_0xa582('0xd')][_0xa582('0xe')]===0x1f4){logger[_0xa582('0xd')](_0xa582('0xf'),_0x3deb31,_0x5e0a41['error'][_0xa582('0x10')]);return _0x39832b(_0x5e0a41['error'][_0xa582('0x10')]);}logger['error'](_0xa582('0xf'),_0x3deb31,_0x5e0a41[_0xa582('0xd')][_0xa582('0x10')]);return _0x4a1042(_0x5e0a41[_0xa582('0xd')]['message']);}else{logger[_0xa582('0x9')](_0xa582('0xf'),_0x3deb31,_0xa582('0x11'));_0x4a1042(_0x5e0a41[_0xa582('0x12')][_0xa582('0x10')]);}})[_0xa582('0x13')](function(_0x44d614){logger[_0xa582('0xd')](_0xa582('0xf'),_0x3deb31,_0x44d614);_0x39832b(_0x44d614);});});} \ No newline at end of file +var _0x98a4=['catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x98a4,0x1e4));var _0x498a=function(_0x1cfe7f,_0x59e0fd){_0x1cfe7f=_0x1cfe7f-0x0;var _0x24a7c7=_0x98a4[_0x1cfe7f];return _0x24a7c7;};'use strict';var _=require(_0x498a('0x0'));var util=require(_0x498a('0x1'));var moment=require(_0x498a('0x2'));var BPromise=require(_0x498a('0x3'));var rs=require(_0x498a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x498a('0x5'));var logger=require(_0x498a('0x6'))(_0x498a('0x7'));var config=require(_0x498a('0x8'));var jayson=require(_0x498a('0x9'));var client=jayson[_0x498a('0xa')][_0x498a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27971c,_0x29dcbb,_0x185a02){return new BPromise(function(_0x3b1c85,_0x57207c){return client[_0x498a('0xc')](_0x27971c,_0x185a02)[_0x498a('0xd')](function(_0xfd106d){logger[_0x498a('0xe')](_0x498a('0xf'),_0x29dcbb,_0x498a('0x10'));logger[_0x498a('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x29dcbb,_0x498a('0x10'),JSON[_0x498a('0x12')](_0xfd106d));if(_0xfd106d[_0x498a('0x13')]){if(_0xfd106d[_0x498a('0x13')]['code']===0x1f4){logger[_0x498a('0x13')](_0x498a('0xf'),_0x29dcbb,_0xfd106d[_0x498a('0x13')][_0x498a('0x14')]);return _0x57207c(_0xfd106d[_0x498a('0x13')][_0x498a('0x14')]);}logger[_0x498a('0x13')](_0x498a('0xf'),_0x29dcbb,_0xfd106d[_0x498a('0x13')][_0x498a('0x14')]);return _0x3b1c85(_0xfd106d[_0x498a('0x13')][_0x498a('0x14')]);}else{logger[_0x498a('0xe')]('ZohoConfiguration,\x20%s,\x20%s',_0x29dcbb,'request\x20sent');_0x3b1c85(_0xfd106d[_0x498a('0x15')][_0x498a('0x14')]);}})[_0x498a('0x16')](function(_0x4329cb){logger[_0x498a('0x13')]('ZohoConfiguration,\x20%s,\x20%s',_0x29dcbb,_0x4329cb);_0x57207c(_0x4329cb);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 89ebaa6..1c50d4c 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 _0x430c=['exports','multer','connect-timeout','express','Router','get','isAuthenticated','show','post','create','put','/:id','update'];(function(_0x1b4607,_0x578127){var _0x1ec73f=function(_0x5007b7){while(--_0x5007b7){_0x1b4607['push'](_0x1b4607['shift']());}};_0x1ec73f(++_0x578127);}(_0x430c,0x1a1));var _0xc430=function(_0x2b9e8a,_0x7b21d4){_0x2b9e8a=_0x2b9e8a-0x0;var _0x520e67=_0x430c[_0x2b9e8a];return _0x520e67;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoField.controller');router[_0xc430('0x4')]('/',auth[_0xc430('0x5')](),controller['index']);router[_0xc430('0x4')]('/:id',auth[_0xc430('0x5')](),controller[_0xc430('0x6')]);router[_0xc430('0x7')]('/',auth[_0xc430('0x5')](),controller[_0xc430('0x8')]);router[_0xc430('0x9')](_0xc430('0xa'),auth[_0xc430('0x5')](),controller[_0xc430('0xb')]);router['delete'](_0xc430('0xa'),auth[_0xc430('0x5')](),controller['destroy']);module[_0xc430('0xc')]=router; \ No newline at end of file +var _0x1a37=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','get','/:id','show','update','delete','destroy','exports'];(function(_0x37cb4d,_0x334dd0){var _0x29f21e=function(_0x444304){while(--_0x444304){_0x37cb4d['push'](_0x37cb4d['shift']());}};_0x29f21e(++_0x334dd0);}(_0x1a37,0xb4));var _0x71a3=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x1a37[_0x3511d3];return _0x5d6321;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var auth=require(_0x71a3('0x6'));var interaction=require(_0x71a3('0x7'));var config=require(_0x71a3('0x8'));var controller=require(_0x71a3('0x9'));router['get']('/',auth[_0x71a3('0xa')](),controller['index']);router[_0x71a3('0xb')](_0x71a3('0xc'),auth[_0x71a3('0xa')](),controller[_0x71a3('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x71a3('0xc'),auth[_0x71a3('0xa')](),controller[_0x71a3('0xe')]);router[_0x71a3('0xf')](_0x71a3('0xc'),auth[_0x71a3('0xa')](),controller[_0x71a3('0x10')]);module[_0x71a3('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 457154f..998c5f6 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 _0x89bf=['keyValue','string','STRING','customVariable','BOOLEAN','sequelize','ENUM','variable'];(function(_0x5d20aa,_0x20625d){var _0x467ee0=function(_0x5b4ee9){while(--_0x5b4ee9){_0x5d20aa['push'](_0x5d20aa['shift']());}};_0x467ee0(++_0x20625d);}(_0x89bf,0x11d));var _0xf89b=function(_0x96dbf3,_0x74299){_0x96dbf3=_0x96dbf3-0x0;var _0x4f447a=_0x89bf[_0x96dbf3];return _0x4f447a;};'use strict';var Sequelize=require(_0xf89b('0x0'));module['exports']={'type':{'type':Sequelize[_0xf89b('0x1')]('string',_0xf89b('0x2'),'customVariable',_0xf89b('0x3')),'defaultValue':_0xf89b('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf89b('0x5')]},'keyType':{'type':Sequelize[_0xf89b('0x1')](_0xf89b('0x4'),_0xf89b('0x2'),_0xf89b('0x6'))},'keyContent':{'type':Sequelize[_0xf89b('0x5')]},'idField':{'type':Sequelize[_0xf89b('0x5')]},'nameField':{'type':Sequelize[_0xf89b('0x5')]},'customField':{'type':Sequelize[_0xf89b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf89b('0x5')]}}; \ No newline at end of file +var _0xa8a8=['variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','STRING'];(function(_0x42732f,_0x5ac5cc){var _0x10be49=function(_0x5657d6){while(--_0x5657d6){_0x42732f['push'](_0x42732f['shift']());}};_0x10be49(++_0x5ac5cc);}(_0xa8a8,0xec));var _0x8a8a=function(_0x5b4f20,_0x177690){_0x5b4f20=_0x5b4f20-0x0;var _0x506511=_0xa8a8[_0x5b4f20];return _0x506511;};'use strict';var Sequelize=require(_0x8a8a('0x0'));module[_0x8a8a('0x1')]={'type':{'type':Sequelize[_0x8a8a('0x2')](_0x8a8a('0x3'),'variable',_0x8a8a('0x4'),_0x8a8a('0x5')),'defaultValue':_0x8a8a('0x3')},'content':{'type':Sequelize[_0x8a8a('0x6')]},'key':{'type':Sequelize[_0x8a8a('0x6')]},'keyType':{'type':Sequelize[_0x8a8a('0x2')](_0x8a8a('0x3'),_0x8a8a('0x7'),_0x8a8a('0x4'))},'keyContent':{'type':Sequelize[_0x8a8a('0x6')]},'idField':{'type':Sequelize[_0x8a8a('0x6')]},'nameField':{'type':Sequelize[_0x8a8a('0x6')]},'customField':{'type':Sequelize[_0x8a8a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8a8a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index bc884b7..5bfef35 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 _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0x73d3a0,_0x3dad5a){var _0x432516=function(_0x3c6033){while(--_0x3c6033){_0x73d3a0['push'](_0x73d3a0['shift']());}};_0x432516(++_0x3dad5a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));}; \ No newline at end of file +var _0xa9e0=['sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit'];(function(_0xd04a57,_0x58e16a){var _0x479d6c=function(_0x413183){while(--_0x413183){_0xd04a57['push'](_0xd04a57['shift']());}};_0x479d6c(++_0x58e16a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));};exports['show']=function(_0x183991,_0x1dec2e){var _0x1459bb={'raw':!![],'where':{'id':_0x183991[_0x0a9e('0x40')]['id']}},_0x5b4f5e={};_0x5b4f5e[_0x0a9e('0x30')]=_[_0x0a9e('0x2d')](db[_0x0a9e('0x27')][_0x0a9e('0x28')]);_0x5b4f5e[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x183991[_0x0a9e('0x2c')]);_0x5b4f5e[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],_0x5b4f5e[_0x0a9e('0x2c')]);_0x1459bb[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x5b4f5e[_0x0a9e('0x30')],qs['fields'](_0x183991['query'][_0x0a9e('0x32')]));_0x1459bb[_0x0a9e('0x31')]=_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x33')]?_0x1459bb[_0x0a9e('0x31')]:_0x5b4f5e[_0x0a9e('0x30')];if(_0x183991[_0x0a9e('0x2c')][_0x0a9e('0x41')]){_0x1459bb[_0x0a9e('0x3d')]=[{'all':!![]}];}_0x1459bb=_[_0x0a9e('0x3b')]({},_0x1459bb,_0x183991[_0x0a9e('0x3c')]);return db[_0x0a9e('0x27')]['find'](_0x1459bb)[_0x0a9e('0x1f')](handleEntityNotFound(_0x1dec2e,null))[_0x0a9e('0x1f')](respondWithResult(_0x1dec2e,null))[_0x0a9e('0x3f')](handleError(_0x1dec2e,null));};exports[_0x0a9e('0x42')]=function(_0x2e8caf,_0xbe9d19){return db[_0x0a9e('0x27')][_0x0a9e('0x42')](_0x2e8caf['body'],{})[_0x0a9e('0x1f')](respondWithResult(_0xbe9d19,0xc9))['catch'](handleError(_0xbe9d19,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x43')]['id'];}return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x476688[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x43')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x3f')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x27')][_0x0a9e('0x44')]({'where':{'id':_0x1b5e80[_0x0a9e('0x40')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index b19ddd4..32c7e78 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 _0xeccb=['define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoField.attributes','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeccb,0x76));var _0xbecc=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xeccb[_0x2a6809];return _0x11c371;};'use strict';var _=require('lodash');var util=require(_0xbecc('0x0'));var logger=require(_0xbecc('0x1'))(_0xbecc('0x2'));var moment=require(_0xbecc('0x3'));var BPromise=require(_0xbecc('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbecc('0x5'));var rimraf=require(_0xbecc('0x6'));var config=require(_0xbecc('0x7'));var attributes=require(_0xbecc('0x8'));module[_0xbecc('0x9')]=function(_0x25f73c,_0x42b913){return _0x25f73c[_0xbecc('0xa')](_0xbecc('0xb'),attributes,{'tableName':_0xbecc('0xc'),'paranoid':![],'indexes':[{'name':_0xbecc('0xd'),'fields':[_0xbecc('0xe'),_0xbecc('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa44=['ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./intZohoField.attributes','exports','define'];(function(_0x268b88,_0xfaa6fc){var _0x1e5033=function(_0x583e8f){while(--_0x583e8f){_0x268b88['push'](_0x268b88['shift']());}};_0x1e5033(++_0xfaa6fc);}(_0xfa44,0xd6));var _0x4fa4=function(_0xe24841,_0x2c0f66){_0xe24841=_0xe24841-0x0;var _0x2e41b3=_0xfa44[_0xe24841];return _0x2e41b3;};'use strict';var _=require(_0x4fa4('0x0'));var util=require(_0x4fa4('0x1'));var logger=require(_0x4fa4('0x2'))(_0x4fa4('0x3'));var moment=require(_0x4fa4('0x4'));var BPromise=require('bluebird');var rp=require(_0x4fa4('0x5'));var fs=require('fs');var path=require(_0x4fa4('0x6'));var rimraf=require(_0x4fa4('0x7'));var config=require('../../config/environment');var attributes=require(_0x4fa4('0x8'));module[_0x4fa4('0x9')]=function(_0x2f7794,_0x31cf0e){return _0x2f7794[_0x4fa4('0xa')](_0x4fa4('0xb'),attributes,{'tableName':_0x4fa4('0xc'),'paranoid':![],'indexes':[{'name':_0x4fa4('0xd'),'fields':[_0x4fa4('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 9edd2e5..a3a38ac 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 _0xb138=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xb138,0x1dd));var _0x8b13=function(_0x189af7,_0x42e7ed){_0x189af7=_0x189af7-0x0;var _0x483af6=_0xb138[_0x189af7];return _0x483af6;};'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(_0x8b13('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b13('0x7'))(_0x8b13('0x8'));var config=require(_0x8b13('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8b13('0xa')][_0x8b13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d51b1,_0x3fdf4d,_0x33d1a7){return new BPromise(function(_0x22e157,_0x498832){return client[_0x8b13('0xc')](_0x5d51b1,_0x33d1a7)[_0x8b13('0xd')](function(_0x58683a){logger['info'](_0x8b13('0xe'),_0x3fdf4d,_0x8b13('0xf'));logger[_0x8b13('0x10')](_0x8b13('0x11'),_0x3fdf4d,_0x8b13('0xf'),JSON['stringify'](_0x58683a));if(_0x58683a[_0x8b13('0x12')]){if(_0x58683a[_0x8b13('0x12')][_0x8b13('0x13')]===0x1f4){logger[_0x8b13('0x12')](_0x8b13('0xe'),_0x3fdf4d,_0x58683a[_0x8b13('0x12')]['message']);return _0x498832(_0x58683a['error'][_0x8b13('0x14')]);}logger[_0x8b13('0x12')]('ZohoField,\x20%s,\x20%s',_0x3fdf4d,_0x58683a['error']['message']);return _0x22e157(_0x58683a[_0x8b13('0x12')][_0x8b13('0x14')]);}else{logger[_0x8b13('0x15')](_0x8b13('0xe'),_0x3fdf4d,_0x8b13('0xf'));_0x22e157(_0x58683a['result'][_0x8b13('0x14')]);}})[_0x8b13('0x16')](function(_0x393bc1){logger[_0x8b13('0x12')](_0x8b13('0xe'),_0x3fdf4d,_0x393bc1);_0x498832(_0x393bc1);});});} \ No newline at end of file +var _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x58ff74,_0x49f534){var _0x23ef43=function(_0x540a3d){while(--_0x540a3d){_0x58ff74['push'](_0x58ff74['shift']());}};_0x23ef43(++_0x49f534);}(_0x4c4e,0x152));var _0xe4c4=function(_0x1d22e9,_0x3866b0){_0x1d22e9=_0x1d22e9-0x0;var _0x313ab2=_0x4c4e[_0x1d22e9];return _0x313ab2;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x262b64,_0xad105,_0x22085a){return new BPromise(function(_0x329d29,_0x28a42e){return client[_0xe4c4('0xa')](_0x262b64,_0x22085a)['then'](function(_0x589b2e){logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));logger[_0xe4c4('0xe')](_0xe4c4('0xf'),_0xad105,_0xe4c4('0xd'),JSON['stringify'](_0x589b2e));if(_0x589b2e[_0xe4c4('0x10')]){if(_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x11')]===0x1f4){logger[_0xe4c4('0x10')]('ZohoField,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('ZohoField,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x329d29(_0x589b2e['error'][_0xe4c4('0x12')]);}else{logger[_0xe4c4('0xb')](_0xe4c4('0xc'),_0xad105,_0xe4c4('0xd'));_0x329d29(_0x589b2e[_0xe4c4('0x13')][_0xe4c4('0x12')]);}})[_0xe4c4('0x14')](function(_0x1038cb){logger[_0xe4c4('0x10')](_0xe4c4('0xc'),_0xad105,_0x1038cb);_0x28a42e(_0x1038cb);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 2237046..af5944b 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 _0xcf7b=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports','multer','util','path'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xcf7b,0x14a));var _0xbcf7=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xcf7b[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require(_0xbcf7('0x0'));var util=require(_0xbcf7('0x1'));var path=require(_0xbcf7('0x2'));var timeout=require(_0xbcf7('0x3'));var express=require(_0xbcf7('0x4'));var router=express[_0xbcf7('0x5')]();var auth=require(_0xbcf7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbcf7('0x7'));module[_0xbcf7('0x8')]=router; \ No newline at end of file +var _0x33a9=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x51cc1c,_0x2b4e14){var _0x327452=function(_0x5b09d9){while(--_0x5b09d9){_0x51cc1c['push'](_0x51cc1c['shift']());}};_0x327452(++_0x2b4e14);}(_0x33a9,0x98));var _0x933a=function(_0xea1570,_0x2f7856){_0xea1570=_0xea1570-0x0;var _0x579e74=_0x33a9[_0xea1570];return _0x579e74;};'use strict';var multer=require(_0x933a('0x0'));var util=require(_0x933a('0x1'));var path=require(_0x933a('0x2'));var timeout=require(_0x933a('0x3'));var express=require(_0x933a('0x4'));var router=express[_0x933a('0x5')]();var auth=require(_0x933a('0x6'));var interaction=require(_0x933a('0x7'));var config=require('../../config/environment');module[_0x933a('0x8')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 95d274a..79866e5 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 _0xbbf3=['unique_name_and_version','BOOLEAN','state','exports','STRING'];(function(_0x49379d,_0x149fb4){var _0x5408ce=function(_0x2f04ff){while(--_0x2f04ff){_0x49379d['push'](_0x49379d['shift']());}};_0x5408ce(++_0x149fb4);}(_0xbbf3,0x1c0));var _0x3bbf=function(_0x3da94b,_0x502545){_0x3da94b=_0x3da94b-0x0;var _0x33f84c=_0xbbf3[_0x3da94b];return _0x33f84c;};'use strict';var Sequelize=require('sequelize');module[_0x3bbf('0x0')]={'name':{'type':Sequelize[_0x3bbf('0x1')],'allowNull':![],'unique':_0x3bbf('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3bbf('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x3bbf('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3bbf('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x3bbf('0x3')],'defaultValue':![]},'author':{'type':Sequelize[_0x3bbf('0x1')]},'logo':{'type':Sequelize[_0x3bbf('0x1')]},'state':{'type':Sequelize[_0x3bbf('0x1')],'unique':_0x3bbf('0x4')},'description':{'type':Sequelize[_0x3bbf('0x1')]},'title':{'type':Sequelize[_0x3bbf('0x1')]},'remoteUri':{'type':Sequelize[_0x3bbf('0x1')]},'link':{'type':Sequelize[_0x3bbf('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0xf9bb=['BOOLEAN','state','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x402deb,_0x476cb8){var _0x5a01a5=function(_0x382fa1){while(--_0x382fa1){_0x402deb['push'](_0x402deb['shift']());}};_0x5a01a5(++_0x476cb8);}(_0xf9bb,0xe2));var _0xbf9b=function(_0xcffae0,_0x1f70ca){_0xcffae0=_0xcffae0-0x0;var _0x24f329=_0xf9bb[_0xcffae0];return _0x24f329;};'use strict';var Sequelize=require('sequelize');module[_0xbf9b('0x0')]={'name':{'type':Sequelize[_0xbf9b('0x1')],'allowNull':![],'unique':_0xbf9b('0x2')},'version':{'type':Sequelize[_0xbf9b('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0xbf9b('0x1')],'defaultValue':_0xbf9b('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xbf9b('0x1')]},'type':{'type':Sequelize[_0xbf9b('0x1')]},'size':{'type':Sequelize[_0xbf9b('0x4')]},'active':{'type':Sequelize[_0xbf9b('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xbf9b('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xbf9b('0x1')],'unique':_0xbf9b('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xbf9b('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 2695bc4..d39a17a 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 _0x77ce=['map','Integration','fieldName','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','merge','type','filter','count','includeAll','include','findAll','rows','show','rawAttributes','options','find','create','body','catch','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','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','sendStatus','status','json','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index'];(function(_0x150b9b,_0x553afd){var _0x61b861=function(_0x46fc8d){while(--_0x46fc8d){_0x150b9b['push'](_0x150b9b['shift']());}};_0x61b861(++_0x553afd);}(_0x77ce,0x102));var _0xe77c=function(_0x47bc67,_0x30a346){_0x47bc67=_0x47bc67-0x0;var _0x4e909a=_0x77ce[_0x47bc67];return _0x4e909a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe77c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe77c('0x1'));var jsonpatch=require(_0xe77c('0x2'));var rp=require(_0xe77c('0x3'));var moment=require(_0xe77c('0x4'));var BPromise=require(_0xe77c('0x5'));var Mustache=require('mustache');var util=require(_0xe77c('0x6'));var path=require('path');var sox=require(_0xe77c('0x7'));var csv=require(_0xe77c('0x8'));var ejs=require(_0xe77c('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe77c('0xa'));var crypto=require(_0xe77c('0xb'));var jsforce=require(_0xe77c('0xc'));var deskjs=require(_0xe77c('0xd'));var toCsv=require(_0xe77c('0x8'));var querystring=require(_0xe77c('0xe'));var Papa=require(_0xe77c('0xf'));var Redis=require('ioredis');var authService=require(_0xe77c('0x10'));var qs=require(_0xe77c('0x11'));var as=require(_0xe77c('0x12'));var hardwareService=require(_0xe77c('0x13'));var logger=require(_0xe77c('0x14'))(_0xe77c('0x15'));var utils=require(_0xe77c('0x16'));var config=require(_0xe77c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36483d,_0xb26d37){_0xb26d37=_0xb26d37||0xcc;return function(_0x41ebca){if(_0x41ebca){return _0x36483d[_0xe77c('0x18')](_0xb26d37);}return _0x36483d['status'](_0xb26d37)['end']();};}function respondWithResult(_0x546eb5,_0x25b463){_0x25b463=_0x25b463||0xc8;return function(_0x14d09d){if(_0x14d09d){return _0x546eb5[_0xe77c('0x19')](_0x25b463)[_0xe77c('0x1a')](_0x14d09d);}};}function respondWithFilteredResult(_0x47bee6,_0x57f795){return function(_0xc5c412){if(_0xc5c412){var _0x4f9055=_0xc5c412['count'],_0x41d482=_0x57f795['offset'],_0x4784c1=_0x57f795['offset']+_0x57f795[_0xe77c('0x1b')],_0x2d3c29;if(_0x4784c1>=_0x4f9055){_0x4784c1=_0x4f9055;_0x2d3c29=0xc8;}else{_0x2d3c29=0xce;}_0x47bee6[_0xe77c('0x19')](_0x2d3c29);return _0x47bee6[_0xe77c('0x1c')](_0xe77c('0x1d'),_0x41d482+'-'+_0x4784c1+'/'+_0x4f9055)['json'](_0xc5c412);}return null;};}function patchUpdates(_0x4b432c){return function(_0x654c4b){try{jsonpatch[_0xe77c('0x1e')](_0x654c4b,_0x4b432c,!![]);}catch(_0x25039c){return BPromise[_0xe77c('0x1f')](_0x25039c);}return _0x654c4b[_0xe77c('0x20')]();};}function saveUpdates(_0x52ba26,_0x27c7b7){return function(_0x10dcc5){if(_0x10dcc5){return _0x10dcc5[_0xe77c('0x21')](_0x52ba26)[_0xe77c('0x22')](function(_0x2c5bf8){return _0x2c5bf8;});}return null;};}function removeEntity(_0x431bfc,_0x5881a4){return function(_0x46b59e){if(_0x46b59e){return _0x46b59e[_0xe77c('0x23')]()['then'](function(){_0x431bfc[_0xe77c('0x19')](0xcc)[_0xe77c('0x24')]();});}};}function handleEntityNotFound(_0x5b9126,_0x12f3a6){return function(_0x7f0dad){if(!_0x7f0dad){_0x5b9126[_0xe77c('0x18')](0x194);}return _0x7f0dad;};}function handleError(_0x57991b,_0x34f2fd){_0x34f2fd=_0x34f2fd||0x1f4;return function(_0x2589eb){logger[_0xe77c('0x25')](_0x2589eb[_0xe77c('0x26')]);if(_0x2589eb[_0xe77c('0x27')]){delete _0x2589eb[_0xe77c('0x27')];}_0x57991b[_0xe77c('0x19')](_0x34f2fd)[_0xe77c('0x28')](_0x2589eb);};}exports[_0xe77c('0x29')]=function(_0x9cfe7b,_0x38c829){var _0x1c84f4={},_0x505cdc={},_0xa08f49={'count':0x0,'rows':[]};var _0x243fad=_[_0xe77c('0x2a')](db[_0xe77c('0x2b')]['rawAttributes'],function(_0x5e7897){return{'name':_0x5e7897[_0xe77c('0x2c')],'type':_0x5e7897['type']['key']};});_0x505cdc['model']=_[_0xe77c('0x2a')](_0x243fad,'name');_0x505cdc[_0xe77c('0x2d')]=_[_0xe77c('0x2e')](_0x9cfe7b[_0xe77c('0x2d')]);_0x505cdc[_0xe77c('0x2f')]=_[_0xe77c('0x30')](_0x505cdc['model'],_0x505cdc[_0xe77c('0x2d')]);_0x1c84f4[_0xe77c('0x31')]=_[_0xe77c('0x30')](_0x505cdc[_0xe77c('0x32')],qs[_0xe77c('0x33')](_0x9cfe7b[_0xe77c('0x2d')][_0xe77c('0x33')]));_0x1c84f4[_0xe77c('0x31')]=_0x1c84f4[_0xe77c('0x31')][_0xe77c('0x34')]?_0x1c84f4['attributes']:_0x505cdc['model'];if(!_0x9cfe7b[_0xe77c('0x2d')][_0xe77c('0x35')](_0xe77c('0x36'))){_0x1c84f4[_0xe77c('0x1b')]=qs[_0xe77c('0x1b')](_0x9cfe7b[_0xe77c('0x2d')]['limit']);_0x1c84f4[_0xe77c('0x37')]=qs[_0xe77c('0x37')](_0x9cfe7b[_0xe77c('0x2d')][_0xe77c('0x37')]);}_0x1c84f4[_0xe77c('0x38')]=qs[_0xe77c('0x39')](_0x9cfe7b[_0xe77c('0x2d')]['sort']);_0x1c84f4[_0xe77c('0x3a')]=qs['filters'](_['pick'](_0x9cfe7b[_0xe77c('0x2d')],_0x505cdc[_0xe77c('0x2f')]),_0x243fad);if(_0x9cfe7b[_0xe77c('0x2d')]['filter']){_0x1c84f4[_0xe77c('0x3a')]=_[_0xe77c('0x3b')](_0x1c84f4['where'],{'$or':_[_0xe77c('0x2a')](_0x243fad,function(_0x38a430){if(_0x38a430[_0xe77c('0x3c')]!=='VIRTUAL'){var _0x128749={};_0x128749[_0x38a430['name']]={'$like':'%'+_0x9cfe7b[_0xe77c('0x2d')][_0xe77c('0x3d')]+'%'};return _0x128749;}})});}_0x1c84f4=_[_0xe77c('0x3b')]({},_0x1c84f4,_0x9cfe7b['options']);var _0x27fe92={'where':_0x1c84f4[_0xe77c('0x3a')]};return db['Integration'][_0xe77c('0x3e')](_0x27fe92)[_0xe77c('0x22')](function(_0x1cc46a){_0xa08f49[_0xe77c('0x3e')]=_0x1cc46a;if(_0x9cfe7b['query'][_0xe77c('0x3f')]){_0x1c84f4[_0xe77c('0x40')]=[{'all':!![]}];}return db[_0xe77c('0x2b')][_0xe77c('0x41')](_0x1c84f4);})[_0xe77c('0x22')](function(_0x26c48d){_0xa08f49[_0xe77c('0x42')]=_0x26c48d;return _0xa08f49;})[_0xe77c('0x22')](respondWithFilteredResult(_0x38c829,_0x1c84f4))['catch'](handleError(_0x38c829,null));};exports[_0xe77c('0x43')]=function(_0x4937f6,_0x2c4147){var _0x4f22a3={'raw':![],'where':{'id':_0x4937f6['params']['id']}},_0x16929e={};_0x16929e[_0xe77c('0x32')]=_['keys'](db[_0xe77c('0x2b')][_0xe77c('0x44')]);_0x16929e[_0xe77c('0x2d')]=_['keys'](_0x4937f6[_0xe77c('0x2d')]);_0x16929e[_0xe77c('0x2f')]=_['intersection'](_0x16929e[_0xe77c('0x32')],_0x16929e['query']);_0x4f22a3['attributes']=_[_0xe77c('0x30')](_0x16929e['model'],qs[_0xe77c('0x33')](_0x4937f6['query'][_0xe77c('0x33')]));_0x4f22a3[_0xe77c('0x31')]=_0x4f22a3['attributes']['length']?_0x4f22a3[_0xe77c('0x31')]:_0x16929e[_0xe77c('0x32')];if(_0x4937f6[_0xe77c('0x2d')]['includeAll']){_0x4f22a3['include']=[{'all':!![]}];}_0x4f22a3=_[_0xe77c('0x3b')]({},_0x4f22a3,_0x4937f6[_0xe77c('0x45')]);return db['Integration'][_0xe77c('0x46')](_0x4f22a3)[_0xe77c('0x22')](handleEntityNotFound(_0x2c4147,null))[_0xe77c('0x22')](respondWithResult(_0x2c4147,null))['catch'](handleError(_0x2c4147,null));};exports[_0xe77c('0x47')]=function(_0x3a67f4,_0x19d695){return db[_0xe77c('0x2b')][_0xe77c('0x47')](_0x3a67f4[_0xe77c('0x48')],{})['then'](respondWithResult(_0x19d695,0xc9))[_0xe77c('0x49')](handleError(_0x19d695,null));};exports[_0xe77c('0x21')]=function(_0x1cca33,_0x4300db){if(_0x1cca33[_0xe77c('0x48')]['id']){delete _0x1cca33['body']['id'];}return db[_0xe77c('0x2b')][_0xe77c('0x46')]({'where':{'id':_0x1cca33[_0xe77c('0x4a')]['id']}})[_0xe77c('0x22')](handleEntityNotFound(_0x4300db,null))[_0xe77c('0x22')](saveUpdates(_0x1cca33['body'],null))[_0xe77c('0x22')](respondWithResult(_0x4300db,null))[_0xe77c('0x49')](handleError(_0x4300db,null));};exports[_0xe77c('0x23')]=function(_0x1409e8,_0x59d242){return db['Integration'][_0xe77c('0x46')]({'where':{'id':_0x1409e8[_0xe77c('0x4a')]['id']}})[_0xe77c('0x22')](handleEntityNotFound(_0x59d242,null))[_0xe77c('0x22')](removeEntity(_0x59d242,null))[_0xe77c('0x49')](handleError(_0x59d242,null));}; \ No newline at end of file +var _0x8a8c=['count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','Integration','fieldName','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','intersection','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x8a8c,0x19f));var _0xc8a8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a8c[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc8a8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc8a8('0x1'));var zipdir=require(_0xc8a8('0x2'));var jsonpatch=require(_0xc8a8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc8a8('0x4'));var Mustache=require(_0xc8a8('0x5'));var util=require(_0xc8a8('0x6'));var path=require(_0xc8a8('0x7'));var sox=require(_0xc8a8('0x8'));var csv=require(_0xc8a8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc8a8('0xa'));var squel=require(_0xc8a8('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc8a8('0xc'));var toCsv=require(_0xc8a8('0x9'));var querystring=require(_0xc8a8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc8a8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc8a8('0xf'));var hardwareService=require(_0xc8a8('0x10'));var logger=require('../../config/logger')(_0xc8a8('0x11'));var utils=require(_0xc8a8('0x12'));var config=require(_0xc8a8('0x13'));var db=require(_0xc8a8('0x14'))['db'];function respondWithStatusCode(_0x12e839,_0xe70646){_0xe70646=_0xe70646||0xcc;return function(_0x465e34){if(_0x465e34){return _0x12e839[_0xc8a8('0x15')](_0xe70646);}return _0x12e839[_0xc8a8('0x16')](_0xe70646)['end']();};}function respondWithResult(_0x47d827,_0x2af386){_0x2af386=_0x2af386||0xc8;return function(_0x523f1f){if(_0x523f1f){return _0x47d827[_0xc8a8('0x16')](_0x2af386)['json'](_0x523f1f);}};}function respondWithFilteredResult(_0x9e31a4,_0x5d88d8){return function(_0xbb21bd){if(_0xbb21bd){var _0x32a2c2=_0xbb21bd[_0xc8a8('0x17')],_0x35944a=_0x5d88d8['offset'],_0x5eff52=_0x5d88d8[_0xc8a8('0x18')]+_0x5d88d8[_0xc8a8('0x19')],_0x3fd3b8;if(_0x5eff52>=_0x32a2c2){_0x5eff52=_0x32a2c2;_0x3fd3b8=0xc8;}else{_0x3fd3b8=0xce;}_0x9e31a4[_0xc8a8('0x16')](_0x3fd3b8);return _0x9e31a4[_0xc8a8('0x1a')](_0xc8a8('0x1b'),_0x35944a+'-'+_0x5eff52+'/'+_0x32a2c2)[_0xc8a8('0x1c')](_0xbb21bd);}return null;};}function patchUpdates(_0x411deb){return function(_0x2bf861){try{jsonpatch[_0xc8a8('0x1d')](_0x2bf861,_0x411deb,!![]);}catch(_0x3b60e6){return BPromise['reject'](_0x3b60e6);}return _0x2bf861[_0xc8a8('0x1e')]();};}function saveUpdates(_0x325489,_0x2aff52){return function(_0x344f3f){if(_0x344f3f){return _0x344f3f[_0xc8a8('0x1f')](_0x325489)[_0xc8a8('0x20')](function(_0x1391f9){return _0x1391f9;});}return null;};}function removeEntity(_0x32f9ef,_0x16493f){return function(_0x236d33){if(_0x236d33){return _0x236d33[_0xc8a8('0x21')]()[_0xc8a8('0x20')](function(){_0x32f9ef[_0xc8a8('0x16')](0xcc)[_0xc8a8('0x22')]();});}};}function handleEntityNotFound(_0x1a12f6,_0x56597e){return function(_0x21dadf){if(!_0x21dadf){_0x1a12f6[_0xc8a8('0x15')](0x194);}return _0x21dadf;};}function handleError(_0x3c1932,_0x11f220){_0x11f220=_0x11f220||0x1f4;return function(_0x5cdbcb){logger[_0xc8a8('0x23')](_0x5cdbcb[_0xc8a8('0x24')]);if(_0x5cdbcb[_0xc8a8('0x25')]){delete _0x5cdbcb[_0xc8a8('0x25')];}_0x3c1932[_0xc8a8('0x16')](_0x11f220)[_0xc8a8('0x26')](_0x5cdbcb);};}exports[_0xc8a8('0x27')]=function(_0x4df795,_0x5c47f5){var _0x2deccb={},_0x504a45={},_0x5b2aca={'count':0x0,'rows':[]};var _0x33dfdc=_[_0xc8a8('0x28')](db[_0xc8a8('0x29')]['rawAttributes'],function(_0x5229bc){return{'name':_0x5229bc[_0xc8a8('0x2a')],'type':_0x5229bc['type'][_0xc8a8('0x2b')]};});_0x504a45['model']=_[_0xc8a8('0x28')](_0x33dfdc,_0xc8a8('0x25'));_0x504a45[_0xc8a8('0x2c')]=_[_0xc8a8('0x2d')](_0x4df795[_0xc8a8('0x2c')]);_0x504a45[_0xc8a8('0x2e')]=_['intersection'](_0x504a45[_0xc8a8('0x2f')],_0x504a45['query']);_0x2deccb[_0xc8a8('0x30')]=_['intersection'](_0x504a45[_0xc8a8('0x2f')],qs[_0xc8a8('0x31')](_0x4df795[_0xc8a8('0x2c')][_0xc8a8('0x31')]));_0x2deccb[_0xc8a8('0x30')]=_0x2deccb[_0xc8a8('0x30')][_0xc8a8('0x32')]?_0x2deccb[_0xc8a8('0x30')]:_0x504a45[_0xc8a8('0x2f')];if(!_0x4df795['query'][_0xc8a8('0x33')](_0xc8a8('0x34'))){_0x2deccb[_0xc8a8('0x19')]=qs[_0xc8a8('0x19')](_0x4df795[_0xc8a8('0x2c')][_0xc8a8('0x19')]);_0x2deccb['offset']=qs[_0xc8a8('0x18')](_0x4df795['query'][_0xc8a8('0x18')]);}_0x2deccb[_0xc8a8('0x35')]=qs['sort'](_0x4df795[_0xc8a8('0x2c')][_0xc8a8('0x36')]);_0x2deccb[_0xc8a8('0x37')]=qs[_0xc8a8('0x2e')](_['pick'](_0x4df795['query'],_0x504a45[_0xc8a8('0x2e')]),_0x33dfdc);if(_0x4df795['query'][_0xc8a8('0x38')]){_0x2deccb[_0xc8a8('0x37')]=_[_0xc8a8('0x39')](_0x2deccb['where'],{'$or':_[_0xc8a8('0x28')](_0x33dfdc,function(_0x9c1523){if(_0x9c1523[_0xc8a8('0x3a')]!==_0xc8a8('0x3b')){var _0x588b75={};_0x588b75[_0x9c1523[_0xc8a8('0x25')]]={'$like':'%'+_0x4df795[_0xc8a8('0x2c')][_0xc8a8('0x38')]+'%'};return _0x588b75;}})});}_0x2deccb=_[_0xc8a8('0x39')]({},_0x2deccb,_0x4df795[_0xc8a8('0x3c')]);var _0x2b1dac={'where':_0x2deccb[_0xc8a8('0x37')]};return db['Integration'][_0xc8a8('0x17')](_0x2b1dac)[_0xc8a8('0x20')](function(_0x54afe2){_0x5b2aca[_0xc8a8('0x17')]=_0x54afe2;if(_0x4df795[_0xc8a8('0x2c')][_0xc8a8('0x3d')]){_0x2deccb[_0xc8a8('0x3e')]=[{'all':!![]}];}return db[_0xc8a8('0x29')][_0xc8a8('0x3f')](_0x2deccb);})['then'](function(_0x1a4238){_0x5b2aca[_0xc8a8('0x40')]=_0x1a4238;return _0x5b2aca;})[_0xc8a8('0x20')](respondWithFilteredResult(_0x5c47f5,_0x2deccb))[_0xc8a8('0x41')](handleError(_0x5c47f5,null));};exports[_0xc8a8('0x42')]=function(_0x324728,_0x40428c){var _0x6fa53a={'raw':![],'where':{'id':_0x324728['params']['id']}},_0x2de107={};_0x2de107[_0xc8a8('0x2f')]=_[_0xc8a8('0x2d')](db[_0xc8a8('0x29')][_0xc8a8('0x43')]);_0x2de107['query']=_[_0xc8a8('0x2d')](_0x324728[_0xc8a8('0x2c')]);_0x2de107[_0xc8a8('0x2e')]=_[_0xc8a8('0x44')](_0x2de107['model'],_0x2de107[_0xc8a8('0x2c')]);_0x6fa53a['attributes']=_['intersection'](_0x2de107['model'],qs['fields'](_0x324728[_0xc8a8('0x2c')][_0xc8a8('0x31')]));_0x6fa53a[_0xc8a8('0x30')]=_0x6fa53a[_0xc8a8('0x30')][_0xc8a8('0x32')]?_0x6fa53a[_0xc8a8('0x30')]:_0x2de107['model'];if(_0x324728[_0xc8a8('0x2c')][_0xc8a8('0x3d')]){_0x6fa53a['include']=[{'all':!![]}];}_0x6fa53a=_[_0xc8a8('0x39')]({},_0x6fa53a,_0x324728[_0xc8a8('0x3c')]);return db['Integration'][_0xc8a8('0x45')](_0x6fa53a)['then'](handleEntityNotFound(_0x40428c,null))[_0xc8a8('0x20')](respondWithResult(_0x40428c,null))[_0xc8a8('0x41')](handleError(_0x40428c,null));};exports[_0xc8a8('0x46')]=function(_0x1f3ad9,_0xc7d895){return db[_0xc8a8('0x29')][_0xc8a8('0x46')](_0x1f3ad9[_0xc8a8('0x47')],{})[_0xc8a8('0x20')](respondWithResult(_0xc7d895,0xc9))[_0xc8a8('0x41')](handleError(_0xc7d895,null));};exports['update']=function(_0xadce87,_0x312aea){if(_0xadce87[_0xc8a8('0x47')]['id']){delete _0xadce87['body']['id'];}return db['Integration'][_0xc8a8('0x45')]({'where':{'id':_0xadce87[_0xc8a8('0x48')]['id']}})[_0xc8a8('0x20')](handleEntityNotFound(_0x312aea,null))[_0xc8a8('0x20')](saveUpdates(_0xadce87[_0xc8a8('0x47')],null))[_0xc8a8('0x20')](respondWithResult(_0x312aea,null))[_0xc8a8('0x41')](handleError(_0x312aea,null));};exports[_0xc8a8('0x21')]=function(_0x340930,_0x206a30){return db['Integration'][_0xc8a8('0x45')]({'where':{'id':_0x340930['params']['id']}})[_0xc8a8('0x20')](handleEntityNotFound(_0x206a30,null))[_0xc8a8('0x20')](removeEntity(_0x206a30,null))['catch'](handleError(_0x206a30,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 9192d6a..d9d8a36 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 _0x9e2e=['request-promise','path','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api'];(function(_0x606048,_0x315db9){var _0x18a51a=function(_0x435673){while(--_0x435673){_0x606048['push'](_0x606048['shift']());}};_0x18a51a(++_0x315db9);}(_0x9e2e,0x110));var _0xe9e2=function(_0x4eea54,_0x4da56e){_0x4eea54=_0x4eea54-0x0;var _0xc2bec2=_0x9e2e[_0x4eea54];return _0xc2bec2;};'use strict';var _=require(_0xe9e2('0x0'));var util=require(_0xe9e2('0x1'));var logger=require(_0xe9e2('0x2'))(_0xe9e2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe9e2('0x4'));var fs=require('fs');var path=require(_0xe9e2('0x5'));var rimraf=require('rimraf');var config=require(_0xe9e2('0x6'));var attributes=require(_0xe9e2('0x7'));module[_0xe9e2('0x8')]=function(_0x253f12,_0x3b168a){return _0x253f12[_0xe9e2('0x9')](_0xe9e2('0xa'),attributes,{'tableName':_0xe9e2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e05=['../../config/environment','exports','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x355ee9,_0x503894){var _0x26b46e=function(_0x2e5d70){while(--_0x2e5d70){_0x355ee9['push'](_0x355ee9['shift']());}};_0x26b46e(++_0x503894);}(_0x3e05,0xe0));var _0x53e0=function(_0x334074,_0x2c0c27){_0x334074=_0x334074-0x0;var _0x3e4b9c=_0x3e05[_0x334074];return _0x3e4b9c;};'use strict';var _=require(_0x53e0('0x0'));var util=require(_0x53e0('0x1'));var logger=require(_0x53e0('0x2'))(_0x53e0('0x3'));var moment=require(_0x53e0('0x4'));var BPromise=require(_0x53e0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53e0('0x6'));var rimraf=require('rimraf');var config=require(_0x53e0('0x7'));var attributes=require('./integration.attributes');module[_0x53e0('0x8')]=function(_0x46bec8,_0x236733){return _0x46bec8['define'](_0x53e0('0x9'),attributes,{'tableName':_0x53e0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index e26482f..ab3aa97 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 _0x0dec=['request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x0dec,0x11c));var _0xc0de=function(_0x4a266f,_0x16b928){_0x4a266f=_0x4a266f-0x0;var _0x65031d=_0x0dec[_0x4a266f];return _0x65031d;};'use strict';var _=require(_0xc0de('0x0'));var util=require(_0xc0de('0x1'));var moment=require(_0xc0de('0x2'));var BPromise=require(_0xc0de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0de('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc0de('0x5'))(_0xc0de('0x6'));var config=require(_0xc0de('0x7'));var jayson=require(_0xc0de('0x8'));var client=jayson[_0xc0de('0x9')][_0xc0de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3639e8,_0x3f7c10,_0x4090cf){return new BPromise(function(_0x2d9bae,_0xfeb87c){return client[_0xc0de('0xb')](_0x3639e8,_0x4090cf)[_0xc0de('0xc')](function(_0x46ed3f){logger[_0xc0de('0xd')](_0xc0de('0xe'),_0x3f7c10,_0xc0de('0xf'));logger[_0xc0de('0x10')](_0xc0de('0x11'),_0x3f7c10,_0xc0de('0xf'),JSON[_0xc0de('0x12')](_0x46ed3f));if(_0x46ed3f[_0xc0de('0x13')]){if(_0x46ed3f[_0xc0de('0x13')][_0xc0de('0x14')]===0x1f4){logger[_0xc0de('0x13')]('Integration,\x20%s,\x20%s',_0x3f7c10,_0x46ed3f[_0xc0de('0x13')][_0xc0de('0x15')]);return _0xfeb87c(_0x46ed3f[_0xc0de('0x13')][_0xc0de('0x15')]);}logger[_0xc0de('0x13')](_0xc0de('0xe'),_0x3f7c10,_0x46ed3f[_0xc0de('0x13')][_0xc0de('0x15')]);return _0x2d9bae(_0x46ed3f[_0xc0de('0x13')][_0xc0de('0x15')]);}else{logger[_0xc0de('0xd')](_0xc0de('0xe'),_0x3f7c10,'request\x20sent');_0x2d9bae(_0x46ed3f[_0xc0de('0x16')][_0xc0de('0x15')]);}})['catch'](function(_0x100458){logger[_0xc0de('0x13')](_0xc0de('0xe'),_0x3f7c10,_0x100458);_0xfeb87c(_0x100458);});});} \ No newline at end of file +var _0x12f1=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x233e46,_0x3262f1){var _0x39601f=function(_0x24d119){while(--_0x24d119){_0x233e46['push'](_0x233e46['shift']());}};_0x39601f(++_0x3262f1);}(_0x12f1,0xf4));var _0x112f=function(_0x43c679,_0x8cf685){_0x43c679=_0x43c679-0x0;var _0x246ffb=_0x12f1[_0x43c679];return _0x246ffb;};'use strict';var _=require(_0x112f('0x0'));var util=require('util');var moment=require(_0x112f('0x1'));var BPromise=require(_0x112f('0x2'));var rs=require(_0x112f('0x3'));var fs=require('fs');var Redis=require(_0x112f('0x4'));var db=require(_0x112f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x112f('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x112f('0x7')][_0x112f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39d5a6,_0x287953,_0x32612d){return new BPromise(function(_0x48ae1d,_0x46d22a){return client[_0x112f('0x9')](_0x39d5a6,_0x32612d)[_0x112f('0xa')](function(_0x4d7956){logger[_0x112f('0xb')](_0x112f('0xc'),_0x287953,_0x112f('0xd'));logger[_0x112f('0xe')](_0x112f('0xf'),_0x287953,_0x112f('0xd'),JSON[_0x112f('0x10')](_0x4d7956));if(_0x4d7956['error']){if(_0x4d7956[_0x112f('0x11')][_0x112f('0x12')]===0x1f4){logger[_0x112f('0x11')](_0x112f('0xc'),_0x287953,_0x4d7956[_0x112f('0x11')][_0x112f('0x13')]);return _0x46d22a(_0x4d7956['error'][_0x112f('0x13')]);}logger[_0x112f('0x11')](_0x112f('0xc'),_0x287953,_0x4d7956[_0x112f('0x11')][_0x112f('0x13')]);return _0x48ae1d(_0x4d7956[_0x112f('0x11')]['message']);}else{logger['info'](_0x112f('0xc'),_0x287953,'request\x20sent');_0x48ae1d(_0x4d7956[_0x112f('0x14')][_0x112f('0x13')]);}})[_0x112f('0x15')](function(_0x1c3b82){logger[_0x112f('0x11')](_0x112f('0xc'),_0x287953,_0x1c3b82);_0x46d22a(_0x1c3b82);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index d44e8ec..84ec076 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 _0x8a2a=['show','post','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe'];(function(_0x1f0831,_0x222b9a){var _0x39ce5c=function(_0x539693){while(--_0x539693){_0x1f0831['push'](_0x1f0831['shift']());}};_0x39ce5c(++_0x222b9a);}(_0x8a2a,0x8d));var _0xa8a2=function(_0x340380,_0x4bd2a8){_0x340380=_0x340380-0x0;var _0x49ce1c=_0x8a2a[_0x340380];return _0x49ce1c;};'use strict';var multer=require('multer');var util=require(_0xa8a2('0x0'));var path=require('path');var timeout=require(_0xa8a2('0x1'));var express=require(_0xa8a2('0x2'));var router=express[_0xa8a2('0x3')]();var auth=require(_0xa8a2('0x4'));var interaction=require(_0xa8a2('0x5'));var config=require(_0xa8a2('0x6'));var controller=require('./integrationReport.controller');router[_0xa8a2('0x7')]('/',auth[_0xa8a2('0x8')](),controller[_0xa8a2('0x9')]);router[_0xa8a2('0x7')]('/describe',auth[_0xa8a2('0x8')](),controller[_0xa8a2('0xa')]);router[_0xa8a2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xa8a2('0xb')]);router[_0xa8a2('0xc')]('/',auth[_0xa8a2('0x8')](),controller['create']);router[_0xa8a2('0xd')](_0xa8a2('0xe'),auth[_0xa8a2('0x8')](),controller[_0xa8a2('0xf')]);router[_0xa8a2('0x10')](_0xa8a2('0xe'),auth[_0xa8a2('0x8')](),controller[_0xa8a2('0x11')]);module[_0xa8a2('0x12')]=router; \ No newline at end of file +var _0xd023=['../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x4b55d8,_0x559721){var _0x3d2c30=function(_0x38d7e5){while(--_0x38d7e5){_0x4b55d8['push'](_0x4b55d8['shift']());}};_0x3d2c30(++_0x559721);}(_0xd023,0x94));var _0x3d02=function(_0x11c4b6,_0x572fdb){_0x11c4b6=_0x11c4b6-0x0;var _0x2cb405=_0xd023[_0x11c4b6];return _0x2cb405;};'use strict';var multer=require(_0x3d02('0x0'));var util=require('util');var path=require(_0x3d02('0x1'));var timeout=require(_0x3d02('0x2'));var express=require('express');var router=express[_0x3d02('0x3')]();var auth=require(_0x3d02('0x4'));var interaction=require(_0x3d02('0x5'));var config=require('../../config/environment');var controller=require(_0x3d02('0x6'));router[_0x3d02('0x7')]('/',auth[_0x3d02('0x8')](),controller[_0x3d02('0x9')]);router[_0x3d02('0x7')](_0x3d02('0xa'),auth['isAuthenticated'](),controller[_0x3d02('0xb')]);router[_0x3d02('0x7')](_0x3d02('0xc'),auth[_0x3d02('0x8')](),controller[_0x3d02('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3d02('0xe')]);router[_0x3d02('0xf')](_0x3d02('0xc'),auth[_0x3d02('0x8')](),controller[_0x3d02('0x10')]);router['delete']('/:id',auth[_0x3d02('0x8')](),controller[_0x3d02('0x11')]);module[_0x3d02('0x12')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 68915ee..587fafb 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 _0xf503=['INTEGER','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING','DATE'];(function(_0x4f4738,_0x508cda){var _0xb753fd=function(_0x31f91b){while(--_0x31f91b){_0x4f4738['push'](_0x4f4738['shift']());}};_0xb753fd(++_0x508cda);}(_0xf503,0xb7));var _0x3f50=function(_0x2c981e,_0x48e951){_0x2c981e=_0x2c981e-0x0;var _0x20b142=_0xf503[_0x2c981e];return _0x20b142;};'use strict';var Sequelize=require(_0x3f50('0x0'));module[_0x3f50('0x1')]={'integration':{'type':Sequelize[_0x3f50('0x2')]},'eventChannel':{'type':Sequelize[_0x3f50('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x3f50('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x3f50('0x2')]},'uniqueid':{'type':Sequelize[_0x3f50('0x2')]},'calleridnum':{'type':Sequelize[_0x3f50('0x2')]},'calleridname':{'type':Sequelize[_0x3f50('0x2')]},'queue':{'type':Sequelize[_0x3f50('0x2')]},'interface':{'type':Sequelize[_0x3f50('0x2')]},'membername':{'type':Sequelize[_0x3f50('0x2')]},'agentcalledAt':{'type':Sequelize[_0x3f50('0x3')]},'agentconnectAt':{'type':Sequelize[_0x3f50('0x3')]},'holdtime':{'type':Sequelize[_0x3f50('0x4')]},'agentcomplete':{'type':Sequelize[_0x3f50('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x3f50('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x3f50('0x2')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x3f50('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x3f50('0x3')]},'lastevent':{'type':Sequelize[_0x3f50('0x2')]},'channel':{'type':Sequelize[_0x3f50('0x2')]},'channelstate':{'type':Sequelize[_0x3f50('0x4')]},'channelstatedesc':{'type':Sequelize[_0x3f50('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x3f50('0x2')]},'language':{'type':Sequelize[_0x3f50('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x3f50('0x2')]},'exten':{'type':Sequelize[_0x3f50('0x2')]},'priority':{'type':Sequelize[_0x3f50('0x2')]},'destchannel':{'type':Sequelize[_0x3f50('0x2')]},'destchannelstate':{'type':Sequelize[_0x3f50('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x3f50('0x2')]},'destcalleridnum':{'type':Sequelize[_0x3f50('0x2')]},'destcalleridname':{'type':Sequelize[_0x3f50('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x3f50('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x3f50('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x3f50('0x2')]},'destcontext':{'type':Sequelize[_0x3f50('0x2')]},'destexten':{'type':Sequelize[_0x3f50('0x2')]},'destpriority':{'type':Sequelize[_0x3f50('0x2')]},'destuniqueid':{'type':Sequelize[_0x3f50('0x2')]},'messageId':{'type':Sequelize[_0x3f50('0x2')]},'inReplyTo':{'type':Sequelize[_0x3f50('0x2')]},'subject':{'type':Sequelize[_0x3f50('0x2')]},'from':{'type':Sequelize[_0x3f50('0x2')]},'to':{'type':Sequelize[_0x3f50('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x3f50('0x6')]},'status':{'type':Sequelize['ENUM'](_0x3f50('0x7'),_0x3f50('0x8'),_0x3f50('0x9'),_0x3f50('0xa'))},'url':{'type':Sequelize[_0x3f50('0x2')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x3f50('0x2')]},'projectId':{'type':Sequelize[_0x3f50('0x4')]}}; \ No newline at end of file +var _0x1b3a=['ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x1b3a,0x143));var _0xa1b3=function(_0x6b2e61,_0x1d408c){_0x6b2e61=_0x6b2e61-0x0;var _0x3c4a9e=_0x1b3a[_0x6b2e61];return _0x3c4a9e;};'use strict';var Sequelize=require(_0xa1b3('0x0'));module[_0xa1b3('0x1')]={'integration':{'type':Sequelize[_0xa1b3('0x2')]},'eventChannel':{'type':Sequelize[_0xa1b3('0x2')]},'exitStatus':{'type':Sequelize[_0xa1b3('0x2')]},'ticketId':{'type':Sequelize[_0xa1b3('0x2')]},'integrationId':{'type':Sequelize[_0xa1b3('0x3')]},'contacts':{'type':Sequelize[_0xa1b3('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa1b3('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa1b3('0x2')]},'interface':{'type':Sequelize[_0xa1b3('0x2')]},'membername':{'type':Sequelize[_0xa1b3('0x2')]},'agentcalledAt':{'type':Sequelize[_0xa1b3('0x4')]},'agentconnectAt':{'type':Sequelize[_0xa1b3('0x4')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xa1b3('0x3')]},'agentacw':{'type':Sequelize[_0xa1b3('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xa1b3('0x3')]},'reason':{'type':Sequelize[_0xa1b3('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xa1b3('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xa1b3('0x4')]},'agentdump':{'type':Sequelize[_0xa1b3('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xa1b3('0x4')]},'lastevent':{'type':Sequelize[_0xa1b3('0x2')]},'channel':{'type':Sequelize[_0xa1b3('0x2')]},'channelstate':{'type':Sequelize[_0xa1b3('0x3')]},'channelstatedesc':{'type':Sequelize[_0xa1b3('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa1b3('0x2')]},'connectedlinename':{'type':Sequelize[_0xa1b3('0x2')]},'language':{'type':Sequelize[_0xa1b3('0x2')]},'accountcode':{'type':Sequelize[_0xa1b3('0x2')]},'context':{'type':Sequelize[_0xa1b3('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xa1b3('0x2')]},'destchannel':{'type':Sequelize[_0xa1b3('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xa1b3('0x2')]},'destcalleridnum':{'type':Sequelize[_0xa1b3('0x2')]},'destcalleridname':{'type':Sequelize[_0xa1b3('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xa1b3('0x2')]},'destlanguage':{'type':Sequelize[_0xa1b3('0x2')]},'destaccountcode':{'type':Sequelize[_0xa1b3('0x2')]},'destcontext':{'type':Sequelize[_0xa1b3('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xa1b3('0x2')]},'destuniqueid':{'type':Sequelize[_0xa1b3('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xa1b3('0x2')]},'subject':{'type':Sequelize[_0xa1b3('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xa1b3('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0xa1b3('0x6')]},'html':{'type':Sequelize[_0xa1b3('0x6')]},'text':{'type':Sequelize[_0xa1b3('0x6')]},'status':{'type':Sequelize[_0xa1b3('0x7')](_0xa1b3('0x8'),'SENDING',_0xa1b3('0x9'),_0xa1b3('0xa'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0xa1b3('0x2')]},'appdata':{'type':Sequelize[_0xa1b3('0x2')]},'projectId':{'type':Sequelize[_0xa1b3('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index b5dda14..8a4f5e7 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 _0x1736=['hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','options','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','IntegrationReport','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x1736,0x1ef));var _0x6173=function(_0x3c206b,_0x59463d){_0x3c206b=_0x3c206b-0x0;var _0x222cbe=_0x1736[_0x3c206b];return _0x222cbe;};'use strict';var pdf=require(_0x6173('0x0'));var emlformat=require(_0x6173('0x1'));var rimraf=require(_0x6173('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6173('0x3'));var rp=require(_0x6173('0x4'));var moment=require(_0x6173('0x5'));var BPromise=require(_0x6173('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6173('0x7'));var csv=require(_0x6173('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6173('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6173('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6173('0x8'));var querystring=require('querystring');var Papa=require(_0x6173('0xb'));var Redis=require(_0x6173('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6173('0xd'));var hardwareService=require(_0x6173('0xe'));var logger=require(_0x6173('0xf'))(_0x6173('0x10'));var utils=require(_0x6173('0x11'));var config=require(_0x6173('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d1fc3,_0xed135a){_0xed135a=_0xed135a||0xcc;return function(_0xfb9766){if(_0xfb9766){return _0x3d1fc3[_0x6173('0x13')](_0xed135a);}return _0x3d1fc3[_0x6173('0x14')](_0xed135a)[_0x6173('0x15')]();};}function respondWithResult(_0x256153,_0x16adfb){_0x16adfb=_0x16adfb||0xc8;return function(_0x5b0962){if(_0x5b0962){return _0x256153[_0x6173('0x14')](_0x16adfb)[_0x6173('0x16')](_0x5b0962);}};}function respondWithFilteredResult(_0x9f7c5,_0x1f6845){return function(_0x2ca1a9){if(_0x2ca1a9){var _0x171bb3=_0x2ca1a9[_0x6173('0x17')],_0x3e229d=_0x1f6845[_0x6173('0x18')],_0xbab8c9=_0x1f6845[_0x6173('0x18')]+_0x1f6845['limit'],_0x648c1c;if(_0xbab8c9>=_0x171bb3){_0xbab8c9=_0x171bb3;_0x648c1c=0xc8;}else{_0x648c1c=0xce;}_0x9f7c5[_0x6173('0x14')](_0x648c1c);return _0x9f7c5[_0x6173('0x19')]('Content-Range',_0x3e229d+'-'+_0xbab8c9+'/'+_0x171bb3)[_0x6173('0x16')](_0x2ca1a9);}return null;};}function patchUpdates(_0x169481){return function(_0xef1ab5){try{jsonpatch[_0x6173('0x1a')](_0xef1ab5,_0x169481,!![]);}catch(_0x435a81){return BPromise[_0x6173('0x1b')](_0x435a81);}return _0xef1ab5[_0x6173('0x1c')]();};}function saveUpdates(_0x52ce4a,_0x536aad){return function(_0x5f4e5d){if(_0x5f4e5d){return _0x5f4e5d[_0x6173('0x1d')](_0x52ce4a)[_0x6173('0x1e')](function(_0x2e498b){return _0x2e498b;});}return null;};}function removeEntity(_0x21e841,_0x4a0099){return function(_0x3fcca3){if(_0x3fcca3){return _0x3fcca3[_0x6173('0x1f')]()[_0x6173('0x1e')](function(){_0x21e841['status'](0xcc)[_0x6173('0x15')]();});}};}function handleEntityNotFound(_0x350672,_0x1a1992){return function(_0x35c344){if(!_0x35c344){_0x350672[_0x6173('0x13')](0x194);}return _0x35c344;};}function handleError(_0x4b9a88,_0x27177b){_0x27177b=_0x27177b||0x1f4;return function(_0x3082c8){logger['error'](_0x3082c8[_0x6173('0x20')]);if(_0x3082c8[_0x6173('0x21')]){delete _0x3082c8[_0x6173('0x21')];}_0x4b9a88[_0x6173('0x14')](_0x27177b)[_0x6173('0x22')](_0x3082c8);};}exports[_0x6173('0x23')]=function(_0x1d21e4,_0x17e370){var _0x25f467={},_0x54b8ce={},_0x29242c={'count':0x0,'rows':[]};var _0x59c1e0=_[_0x6173('0x24')](db[_0x6173('0x25')][_0x6173('0x26')],function(_0x2e651e){return{'name':_0x2e651e['fieldName'],'type':_0x2e651e[_0x6173('0x27')][_0x6173('0x28')]};});_0x54b8ce[_0x6173('0x29')]=_[_0x6173('0x24')](_0x59c1e0,_0x6173('0x21'));_0x54b8ce[_0x6173('0x2a')]=_[_0x6173('0x2b')](_0x1d21e4['query']);_0x54b8ce[_0x6173('0x2c')]=_['intersection'](_0x54b8ce[_0x6173('0x29')],_0x54b8ce[_0x6173('0x2a')]);_0x25f467['attributes']=_[_0x6173('0x2d')](_0x54b8ce[_0x6173('0x29')],qs[_0x6173('0x2e')](_0x1d21e4['query'][_0x6173('0x2e')]));_0x25f467[_0x6173('0x2f')]=_0x25f467['attributes'][_0x6173('0x30')]?_0x25f467['attributes']:_0x54b8ce[_0x6173('0x29')];if(!_0x1d21e4[_0x6173('0x2a')][_0x6173('0x31')]('nolimit')){_0x25f467[_0x6173('0x32')]=qs['limit'](_0x1d21e4[_0x6173('0x2a')][_0x6173('0x32')]);_0x25f467[_0x6173('0x18')]=qs[_0x6173('0x18')](_0x1d21e4[_0x6173('0x2a')][_0x6173('0x18')]);}_0x25f467[_0x6173('0x33')]=qs['sort'](_0x1d21e4[_0x6173('0x2a')][_0x6173('0x34')]);_0x25f467[_0x6173('0x35')]=qs[_0x6173('0x2c')](_[_0x6173('0x36')](_0x1d21e4[_0x6173('0x2a')],_0x54b8ce['filters']),_0x59c1e0);if(_0x1d21e4[_0x6173('0x2a')][_0x6173('0x37')]){_0x25f467[_0x6173('0x35')]=_[_0x6173('0x38')](_0x25f467[_0x6173('0x35')],{'$or':_['map'](_0x59c1e0,function(_0x21b4f2){if(_0x21b4f2[_0x6173('0x27')]!==_0x6173('0x39')){var _0x1fd94a={};_0x1fd94a[_0x21b4f2[_0x6173('0x21')]]={'$like':'%'+_0x1d21e4[_0x6173('0x2a')][_0x6173('0x37')]+'%'};return _0x1fd94a;}})});}_0x25f467=_[_0x6173('0x38')]({},_0x25f467,_0x1d21e4['options']);var _0x360782={'where':_0x25f467[_0x6173('0x35')]};return db[_0x6173('0x25')][_0x6173('0x17')](_0x360782)[_0x6173('0x1e')](function(_0x2c8e1b){_0x29242c['count']=_0x2c8e1b;if(_0x1d21e4[_0x6173('0x2a')][_0x6173('0x3a')]){_0x25f467[_0x6173('0x3b')]=[{'all':!![]}];}return db[_0x6173('0x25')][_0x6173('0x3c')](_0x25f467);})[_0x6173('0x1e')](function(_0x474454){_0x29242c['rows']=_0x474454;return _0x29242c;})['then'](respondWithFilteredResult(_0x17e370,_0x25f467))[_0x6173('0x3d')](handleError(_0x17e370,null));};exports['show']=function(_0x27af69,_0x474e76){var _0x45168e={'raw':![],'where':{'id':_0x27af69[_0x6173('0x3e')]['id']}},_0x1d73ac={};_0x1d73ac[_0x6173('0x29')]=_['keys'](db[_0x6173('0x25')][_0x6173('0x26')]);_0x1d73ac[_0x6173('0x2a')]=_[_0x6173('0x2b')](_0x27af69[_0x6173('0x2a')]);_0x1d73ac[_0x6173('0x2c')]=_[_0x6173('0x2d')](_0x1d73ac['model'],_0x1d73ac[_0x6173('0x2a')]);_0x45168e['attributes']=_['intersection'](_0x1d73ac['model'],qs['fields'](_0x27af69[_0x6173('0x2a')]['fields']));_0x45168e[_0x6173('0x2f')]=_0x45168e[_0x6173('0x2f')]['length']?_0x45168e[_0x6173('0x2f')]:_0x1d73ac[_0x6173('0x29')];if(_0x27af69[_0x6173('0x2a')][_0x6173('0x3a')]){_0x45168e['include']=[{'all':!![]}];}_0x45168e=_['merge']({},_0x45168e,_0x27af69[_0x6173('0x3f')]);return db['IntegrationReport'][_0x6173('0x40')](_0x45168e)[_0x6173('0x1e')](handleEntityNotFound(_0x474e76,null))[_0x6173('0x1e')](respondWithResult(_0x474e76,null))[_0x6173('0x3d')](handleError(_0x474e76,null));};exports[_0x6173('0x41')]=function(_0x922f49,_0x3bf247){return db[_0x6173('0x25')][_0x6173('0x41')](_0x922f49[_0x6173('0x42')],{})[_0x6173('0x1e')](respondWithResult(_0x3bf247,0xc9))['catch'](handleError(_0x3bf247,null));};exports[_0x6173('0x1d')]=function(_0x626c9,_0x33b852){if(_0x626c9[_0x6173('0x42')]['id']){delete _0x626c9[_0x6173('0x42')]['id'];}return db['IntegrationReport'][_0x6173('0x40')]({'where':{'id':_0x626c9['params']['id']}})[_0x6173('0x1e')](handleEntityNotFound(_0x33b852,null))[_0x6173('0x1e')](saveUpdates(_0x626c9[_0x6173('0x42')],null))[_0x6173('0x1e')](respondWithResult(_0x33b852,null))[_0x6173('0x3d')](handleError(_0x33b852,null));};exports[_0x6173('0x1f')]=function(_0x94ddb9,_0xb24ce8){return db['IntegrationReport'][_0x6173('0x40')]({'where':{'id':_0x94ddb9['params']['id']}})[_0x6173('0x1e')](handleEntityNotFound(_0xb24ce8,null))[_0x6173('0x1e')](removeEntity(_0xb24ce8,null))[_0x6173('0x3d')](handleError(_0xb24ce8,null));};exports[_0x6173('0x43')]=function(_0x4dd078,_0x306694){return db[_0x6173('0x25')][_0x6173('0x43')]()[_0x6173('0x1e')](respondWithResult(_0x306694,null))[_0x6173('0x3d')](handleError(_0x306694,null));}; \ No newline at end of file +var _0xcab1=['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','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','fields','create','body','params','find','html-pdf','rimraf','fast-json-patch','request-promise'];(function(_0x5f15a3,_0x504b4b){var _0x3afa59=function(_0x21d4ed){while(--_0x21d4ed){_0x5f15a3['push'](_0x5f15a3['shift']());}};_0x3afa59(++_0x504b4b);}(_0xcab1,0xe6));var _0x1cab=function(_0x213998,_0x343a80){_0x213998=_0x213998-0x0;var _0x1f2d49=_0xcab1[_0x213998];return _0x1f2d49;};'use strict';var pdf=require(_0x1cab('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1cab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1cab('0x2'));var rp=require(_0x1cab('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1cab('0x4'));var util=require(_0x1cab('0x5'));var path=require(_0x1cab('0x6'));var sox=require(_0x1cab('0x7'));var csv=require(_0x1cab('0x8'));var ejs=require(_0x1cab('0x9'));var fs=require('fs');var _=require(_0x1cab('0xa'));var squel=require(_0x1cab('0xb'));var crypto=require(_0x1cab('0xc'));var jsforce=require(_0x1cab('0xd'));var deskjs=require(_0x1cab('0xe'));var toCsv=require(_0x1cab('0x8'));var querystring=require(_0x1cab('0xf'));var Papa=require(_0x1cab('0x10'));var Redis=require(_0x1cab('0x11'));var authService=require(_0x1cab('0x12'));var qs=require(_0x1cab('0x13'));var as=require(_0x1cab('0x14'));var hardwareService=require(_0x1cab('0x15'));var logger=require(_0x1cab('0x16'))(_0x1cab('0x17'));var utils=require(_0x1cab('0x18'));var config=require(_0x1cab('0x19'));var db=require(_0x1cab('0x1a'))['db'];function respondWithStatusCode(_0x5d655d,_0x834f44){_0x834f44=_0x834f44||0xcc;return function(_0x3a5956){if(_0x3a5956){return _0x5d655d[_0x1cab('0x1b')](_0x834f44);}return _0x5d655d[_0x1cab('0x1c')](_0x834f44)[_0x1cab('0x1d')]();};}function respondWithResult(_0x548d7c,_0xdea1b4){_0xdea1b4=_0xdea1b4||0xc8;return function(_0x20dc3e){if(_0x20dc3e){return _0x548d7c[_0x1cab('0x1c')](_0xdea1b4)[_0x1cab('0x1e')](_0x20dc3e);}};}function respondWithFilteredResult(_0x3634f9,_0xaa8823){return function(_0x2f9571){if(_0x2f9571){var _0x29268f=_0x2f9571['count'],_0x424283=_0xaa8823['offset'],_0x503ddc=_0xaa8823[_0x1cab('0x1f')]+_0xaa8823[_0x1cab('0x20')],_0x1c085d;if(_0x503ddc>=_0x29268f){_0x503ddc=_0x29268f;_0x1c085d=0xc8;}else{_0x1c085d=0xce;}_0x3634f9[_0x1cab('0x1c')](_0x1c085d);return _0x3634f9[_0x1cab('0x21')](_0x1cab('0x22'),_0x424283+'-'+_0x503ddc+'/'+_0x29268f)[_0x1cab('0x1e')](_0x2f9571);}return null;};}function patchUpdates(_0x5ca44c){return function(_0x128e98){try{jsonpatch[_0x1cab('0x23')](_0x128e98,_0x5ca44c,!![]);}catch(_0x46a59b){return BPromise[_0x1cab('0x24')](_0x46a59b);}return _0x128e98['save']();};}function saveUpdates(_0x4c13f0,_0x2a50b3){return function(_0x83fc67){if(_0x83fc67){return _0x83fc67[_0x1cab('0x25')](_0x4c13f0)[_0x1cab('0x26')](function(_0x114003){return _0x114003;});}return null;};}function removeEntity(_0x28d5c9,_0x44471e){return function(_0x2ea7bd){if(_0x2ea7bd){return _0x2ea7bd[_0x1cab('0x27')]()[_0x1cab('0x26')](function(){_0x28d5c9[_0x1cab('0x1c')](0xcc)[_0x1cab('0x1d')]();});}};}function handleEntityNotFound(_0x3e8a7b,_0xe1f687){return function(_0x4886c5){if(!_0x4886c5){_0x3e8a7b[_0x1cab('0x1b')](0x194);}return _0x4886c5;};}function handleError(_0x1f1e0e,_0x3472ce){_0x3472ce=_0x3472ce||0x1f4;return function(_0x55271a){logger['error'](_0x55271a[_0x1cab('0x28')]);if(_0x55271a[_0x1cab('0x29')]){delete _0x55271a['name'];}_0x1f1e0e[_0x1cab('0x1c')](_0x3472ce)[_0x1cab('0x2a')](_0x55271a);};}exports[_0x1cab('0x2b')]=function(_0x580eaa,_0xa68960){var _0x565234={},_0x4e60c6={},_0x2370e6={'count':0x0,'rows':[]};var _0x41d9ec=_[_0x1cab('0x2c')](db[_0x1cab('0x2d')][_0x1cab('0x2e')],function(_0x3c6dd7){return{'name':_0x3c6dd7[_0x1cab('0x2f')],'type':_0x3c6dd7['type'][_0x1cab('0x30')]};});_0x4e60c6['model']=_['map'](_0x41d9ec,_0x1cab('0x29'));_0x4e60c6[_0x1cab('0x31')]=_[_0x1cab('0x32')](_0x580eaa[_0x1cab('0x31')]);_0x4e60c6[_0x1cab('0x33')]=_['intersection'](_0x4e60c6[_0x1cab('0x34')],_0x4e60c6[_0x1cab('0x31')]);_0x565234[_0x1cab('0x35')]=_[_0x1cab('0x36')](_0x4e60c6[_0x1cab('0x34')],qs['fields'](_0x580eaa[_0x1cab('0x31')]['fields']));_0x565234['attributes']=_0x565234['attributes'][_0x1cab('0x37')]?_0x565234[_0x1cab('0x35')]:_0x4e60c6[_0x1cab('0x34')];if(!_0x580eaa[_0x1cab('0x31')]['hasOwnProperty'](_0x1cab('0x38'))){_0x565234['limit']=qs[_0x1cab('0x20')](_0x580eaa[_0x1cab('0x31')][_0x1cab('0x20')]);_0x565234[_0x1cab('0x1f')]=qs[_0x1cab('0x1f')](_0x580eaa[_0x1cab('0x31')][_0x1cab('0x1f')]);}_0x565234[_0x1cab('0x39')]=qs[_0x1cab('0x3a')](_0x580eaa['query']['sort']);_0x565234[_0x1cab('0x3b')]=qs[_0x1cab('0x33')](_[_0x1cab('0x3c')](_0x580eaa[_0x1cab('0x31')],_0x4e60c6[_0x1cab('0x33')]),_0x41d9ec);if(_0x580eaa[_0x1cab('0x31')][_0x1cab('0x3d')]){_0x565234[_0x1cab('0x3b')]=_[_0x1cab('0x3e')](_0x565234[_0x1cab('0x3b')],{'$or':_[_0x1cab('0x2c')](_0x41d9ec,function(_0x47252d){if(_0x47252d[_0x1cab('0x3f')]!==_0x1cab('0x40')){var _0x46cb73={};_0x46cb73[_0x47252d[_0x1cab('0x29')]]={'$like':'%'+_0x580eaa[_0x1cab('0x31')][_0x1cab('0x3d')]+'%'};return _0x46cb73;}})});}_0x565234=_[_0x1cab('0x3e')]({},_0x565234,_0x580eaa[_0x1cab('0x41')]);var _0x582ee2={'where':_0x565234['where']};return db[_0x1cab('0x2d')][_0x1cab('0x42')](_0x582ee2)[_0x1cab('0x26')](function(_0x1055b6){_0x2370e6['count']=_0x1055b6;if(_0x580eaa[_0x1cab('0x31')][_0x1cab('0x43')]){_0x565234[_0x1cab('0x44')]=[{'all':!![]}];}return db[_0x1cab('0x2d')][_0x1cab('0x45')](_0x565234);})[_0x1cab('0x26')](function(_0x5e39bf){_0x2370e6[_0x1cab('0x46')]=_0x5e39bf;return _0x2370e6;})[_0x1cab('0x26')](respondWithFilteredResult(_0xa68960,_0x565234))[_0x1cab('0x47')](handleError(_0xa68960,null));};exports[_0x1cab('0x48')]=function(_0x26c1dc,_0x3787e5){var _0x301982={'raw':![],'where':{'id':_0x26c1dc['params']['id']}},_0xe2ebb2={};_0xe2ebb2[_0x1cab('0x34')]=_['keys'](db[_0x1cab('0x2d')][_0x1cab('0x2e')]);_0xe2ebb2[_0x1cab('0x31')]=_[_0x1cab('0x32')](_0x26c1dc[_0x1cab('0x31')]);_0xe2ebb2[_0x1cab('0x33')]=_[_0x1cab('0x36')](_0xe2ebb2[_0x1cab('0x34')],_0xe2ebb2[_0x1cab('0x31')]);_0x301982['attributes']=_['intersection'](_0xe2ebb2[_0x1cab('0x34')],qs[_0x1cab('0x49')](_0x26c1dc[_0x1cab('0x31')][_0x1cab('0x49')]));_0x301982[_0x1cab('0x35')]=_0x301982['attributes']['length']?_0x301982['attributes']:_0xe2ebb2[_0x1cab('0x34')];if(_0x26c1dc[_0x1cab('0x31')][_0x1cab('0x43')]){_0x301982['include']=[{'all':!![]}];}_0x301982=_['merge']({},_0x301982,_0x26c1dc[_0x1cab('0x41')]);return db[_0x1cab('0x2d')]['find'](_0x301982)[_0x1cab('0x26')](handleEntityNotFound(_0x3787e5,null))[_0x1cab('0x26')](respondWithResult(_0x3787e5,null))['catch'](handleError(_0x3787e5,null));};exports[_0x1cab('0x4a')]=function(_0x200785,_0x262a89){return db[_0x1cab('0x2d')][_0x1cab('0x4a')](_0x200785[_0x1cab('0x4b')],{})['then'](respondWithResult(_0x262a89,0xc9))[_0x1cab('0x47')](handleError(_0x262a89,null));};exports[_0x1cab('0x25')]=function(_0x4aa9ca,_0xec5f09){if(_0x4aa9ca['body']['id']){delete _0x4aa9ca['body']['id'];}return db[_0x1cab('0x2d')]['find']({'where':{'id':_0x4aa9ca[_0x1cab('0x4c')]['id']}})[_0x1cab('0x26')](handleEntityNotFound(_0xec5f09,null))['then'](saveUpdates(_0x4aa9ca[_0x1cab('0x4b')],null))[_0x1cab('0x26')](respondWithResult(_0xec5f09,null))[_0x1cab('0x47')](handleError(_0xec5f09,null));};exports[_0x1cab('0x27')]=function(_0x499c58,_0x431fc6){return db[_0x1cab('0x2d')][_0x1cab('0x4d')]({'where':{'id':_0x499c58[_0x1cab('0x4c')]['id']}})[_0x1cab('0x26')](handleEntityNotFound(_0x431fc6,null))[_0x1cab('0x26')](removeEntity(_0x431fc6,null))[_0x1cab('0x47')](handleError(_0x431fc6,null));};exports['describe']=function(_0x50e263,_0x51409f){return db[_0x1cab('0x2d')]['describe']()[_0x1cab('0x26')](respondWithResult(_0x51409f,null))[_0x1cab('0x47')](handleError(_0x51409f,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index e5892b8..de4bb9c 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 _0x6abb=['api','moment','request-promise','path','../../config/environment','./integrationReport.attributes','define','../../config/logger'];(function(_0x2da0c4,_0x2ab0a7){var _0x3794b7=function(_0x1a5cb7){while(--_0x1a5cb7){_0x2da0c4['push'](_0x2da0c4['shift']());}};_0x3794b7(++_0x2ab0a7);}(_0x6abb,0x1c7));var _0xb6ab=function(_0x343fcf,_0x1835ca){_0x343fcf=_0x343fcf-0x0;var _0x4699c6=_0x6abb[_0x343fcf];return _0x4699c6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb6ab('0x0'))(_0xb6ab('0x1'));var moment=require(_0xb6ab('0x2'));var BPromise=require('bluebird');var rp=require(_0xb6ab('0x3'));var fs=require('fs');var path=require(_0xb6ab('0x4'));var rimraf=require('rimraf');var config=require(_0xb6ab('0x5'));var attributes=require(_0xb6ab('0x6'));module['exports']=function(_0x3976f2,_0x506025){return _0x3976f2[_0xb6ab('0x7')]('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb344=['api','moment','bluebird','path','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','report_integration','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb344,0xfc));var _0x4b34=function(_0x2e2857,_0x2c8066){_0x2e2857=_0x2e2857-0x0;var _0x294569=_0xb344[_0x2e2857];return _0x294569;};'use strict';var _=require('lodash');var util=require(_0x4b34('0x0'));var logger=require('../../config/logger')(_0x4b34('0x1'));var moment=require(_0x4b34('0x2'));var BPromise=require(_0x4b34('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b34('0x4'));var rimraf=require(_0x4b34('0x5'));var config=require(_0x4b34('0x6'));var attributes=require(_0x4b34('0x7'));module[_0x4b34('0x8')]=function(_0x4a762f,_0x22b5f9){return _0x4a762f['define'](_0x4b34('0x9'),attributes,{'tableName':_0x4b34('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 807a49c..cac835f 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 _0x0713=['IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2c3a24,_0x575c7f){var _0x418013=function(_0x1c5648){while(--_0x1c5648){_0x2c3a24['push'](_0x2c3a24['shift']());}};_0x418013(++_0x575c7f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xda3f,0xec));var _0xfda3=function(_0x4bf679,_0x1e3541){_0x4bf679=_0x4bf679-0x0;var _0xbb75b7=_0xda3f[_0x4bf679];return _0xbb75b7;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('IntegrationReport,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('IntegrationReport,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('IntegrationReport,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 3269462..1453864 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 _0xedd9=['getIntervals','post','addInterval','addIntervals','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/sub_intervals'];(function(_0x47dfab,_0x3ca73d){var _0x426e66=function(_0x3f66fc){while(--_0x3f66fc){_0x47dfab['push'](_0x47dfab['shift']());}};_0x426e66(++_0x3ca73d);}(_0xedd9,0xfc));var _0x9edd=function(_0x483483,_0x19df3a){_0x483483=_0x483483-0x0;var _0x175b04=_0xedd9[_0x483483];return _0x175b04;};'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 auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./interval.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['post']('/',auth[_0x9edd('0x9')](),controller['create']);router[_0x9edd('0xd')](_0x9edd('0xb'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0xd')]('/:id/sub_intervals/create_many',auth[_0x9edd('0x9')](),controller[_0x9edd('0xf')]);router[_0x9edd('0x10')](_0x9edd('0x11'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')](_0x9edd('0x11'),auth['isAuthenticated'](),controller[_0x9edd('0x14')]);module[_0x9edd('0x15')]=router; \ No newline at end of file +var _0x3e74=['isAuthenticated','index','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./interval.controller','get'];(function(_0x2e76a7,_0x23871a){var _0x454cde=function(_0x51724d){while(--_0x51724d){_0x2e76a7['push'](_0x2e76a7['shift']());}};_0x454cde(++_0x23871a);}(_0x3e74,0x175));var _0x43e7=function(_0x2657e4,_0x236653){_0x2657e4=_0x2657e4-0x0;var _0xb87188=_0x3e74[_0x2657e4];return _0xb87188;};'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 auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['getIntervals']);router[_0x43e7('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x43e7('0xb')](_0x43e7('0xa'),auth['isAuthenticated'](),controller[_0x43e7('0xc')]);router['post'](_0x43e7('0xd'),auth[_0x43e7('0x7')](),controller['addIntervals']);router[_0x43e7('0xe')](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);module[_0x43e7('0x12')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index a3c1a63..5bcc20b 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 _0xeba5=['sequelize','exports','STRING'];(function(_0x36c55d,_0x1c8efa){var _0xa16625=function(_0x3071f7){while(--_0x3071f7){_0x36c55d['push'](_0x36c55d['shift']());}};_0xa16625(++_0x1c8efa);}(_0xeba5,0x1ce));var _0x5eba=function(_0x462fdd,_0x3ca920){_0x462fdd=_0x462fdd-0x0;var _0xc56413=_0xeba5[_0x462fdd];return _0xc56413;};'use strict';var Sequelize=require(_0x5eba('0x0'));module[_0x5eba('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5eba('0x2')]},'interval':{'type':Sequelize[_0x5eba('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xc443=['exports','STRING','sequelize'];(function(_0x1c4004,_0x5bb18d){var _0x2b9169=function(_0x21192a){while(--_0x21192a){_0x1c4004['push'](_0x1c4004['shift']());}};_0x2b9169(++_0x5bb18d);}(_0xc443,0x7a));var _0x3c44=function(_0x1d47aa,_0x5ea014){_0x1d47aa=_0x1d47aa-0x0;var _0x25db2b=_0xc443[_0x1d47aa];return _0x25db2b;};'use strict';var Sequelize=require(_0x3c44('0x0'));module[_0x3c44('0x1')]={'name':{'type':Sequelize[_0x3c44('0x2')]},'description':{'type':Sequelize[_0x3c44('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 8662631..146a0e9 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 _0x4f1c=['rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','Intervals','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','IntervalId','getIntervals','length','addIntervals','findOne','sequelize','transaction','bulkCreate','findAll','eml-format','rimraf','moment','bluebird','mustache','util','path','ejs','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/environment','../../mysqldb','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','index','map','Interval','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show'];(function(_0x1e8319,_0x29cb89){var _0x27b501=function(_0x2c5804){while(--_0x2c5804){_0x1e8319['push'](_0x1e8319['shift']());}};_0x27b501(++_0x29cb89);}(_0x4f1c,0x127));var _0xc4f1=function(_0x1a0e53,_0x2a1857){_0x1a0e53=_0x1a0e53-0x0;var _0x1a3c54=_0x4f1c[_0x1a0e53];return _0x1a3c54;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc4f1('0x0'));var rimraf=require(_0xc4f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc4f1('0x2'));var BPromise=require(_0xc4f1('0x3'));var Mustache=require(_0xc4f1('0x4'));var util=require(_0xc4f1('0x5'));var path=require(_0xc4f1('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc4f1('0x7'));var fs=require('fs');var _=require(_0xc4f1('0x8'));var squel=require(_0xc4f1('0x9'));var crypto=require(_0xc4f1('0xa'));var jsforce=require(_0xc4f1('0xb'));var deskjs=require(_0xc4f1('0xc'));var toCsv=require(_0xc4f1('0xd'));var querystring=require(_0xc4f1('0xe'));var Papa=require(_0xc4f1('0xf'));var Redis=require(_0xc4f1('0x10'));var authService=require(_0xc4f1('0x11'));var qs=require(_0xc4f1('0x12'));var as=require(_0xc4f1('0x13'));var hardwareService=require(_0xc4f1('0x14'));var logger=require(_0xc4f1('0x15'))(_0xc4f1('0x16'));var utils=require('../../config/utils');var config=require(_0xc4f1('0x17'));var db=require(_0xc4f1('0x18'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x724c5f,_0x3282c7){_0x3282c7=_0x3282c7||0xcc;return function(_0x14716b){if(_0x14716b){return _0x724c5f['sendStatus'](_0x3282c7);}return _0x724c5f[_0xc4f1('0x19')](_0x3282c7)[_0xc4f1('0x1a')]();};}function respondWithResult(_0x2ff271,_0x54be7b){_0x54be7b=_0x54be7b||0xc8;return function(_0x22ee29){if(_0x22ee29){return _0x2ff271[_0xc4f1('0x19')](_0x54be7b)[_0xc4f1('0x1b')](_0x22ee29);}};}function respondWithFilteredResult(_0x3f47b0,_0x48125d){return function(_0x530da5){if(_0x530da5){var _0x2d708b=_0x530da5[_0xc4f1('0x1c')],_0x5b050a=_0x48125d[_0xc4f1('0x1d')],_0x4b734e=_0x48125d[_0xc4f1('0x1d')]+_0x48125d['limit'],_0x1069ea;if(_0x4b734e>=_0x2d708b){_0x4b734e=_0x2d708b;_0x1069ea=0xc8;}else{_0x1069ea=0xce;}_0x3f47b0[_0xc4f1('0x19')](_0x1069ea);return _0x3f47b0[_0xc4f1('0x1e')]('Content-Range',_0x5b050a+'-'+_0x4b734e+'/'+_0x2d708b)[_0xc4f1('0x1b')](_0x530da5);}return null;};}function patchUpdates(_0x5ed1c9){return function(_0x2a01af){try{jsonpatch[_0xc4f1('0x1f')](_0x2a01af,_0x5ed1c9,!![]);}catch(_0xdf4c45){return BPromise[_0xc4f1('0x20')](_0xdf4c45);}return _0x2a01af[_0xc4f1('0x21')]();};}function saveUpdates(_0x5f30ea,_0x2fbe25){return function(_0x49c613){if(_0x49c613){return _0x49c613[_0xc4f1('0x22')](_0x5f30ea)[_0xc4f1('0x23')](function(_0x18747b){return _0x18747b;});}return null;};}function removeEntity(_0x220d8d,_0x28a082){return function(_0x27c7ad){if(_0x27c7ad){return _0x27c7ad[_0xc4f1('0x24')]()['then'](function(){var _0x20a75c=_0x27c7ad['get']({'plain':!![]});var _0x39104d='Intervals';return db[_0xc4f1('0x25')][_0xc4f1('0x24')]({'where':{'type':_0x39104d,'resourceId':_0x20a75c['id']}})[_0xc4f1('0x23')](function(){return _0x27c7ad;});})[_0xc4f1('0x23')](function(){_0x220d8d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa15c73,_0x4c9684){return function(_0x5a6666){if(!_0x5a6666){_0xa15c73['sendStatus'](0x194);}return _0x5a6666;};}function handleError(_0x45c28c,_0xd37fbd){_0xd37fbd=_0xd37fbd||0x1f4;return function(_0x4815b7){logger[_0xc4f1('0x26')](_0x4815b7[_0xc4f1('0x27')]);if(_0x4815b7[_0xc4f1('0x28')]){delete _0x4815b7[_0xc4f1('0x28')];}_0x45c28c[_0xc4f1('0x19')](_0xd37fbd)['send'](_0x4815b7);};}exports[_0xc4f1('0x29')]=function(_0x5bca2c,_0x3a1c9b){var _0x30425b={},_0x49a691={},_0x555868={'count':0x0,'rows':[]};var _0x496934=_[_0xc4f1('0x2a')](db[_0xc4f1('0x2b')]['rawAttributes'],function(_0x1b28bc){return{'name':_0x1b28bc[_0xc4f1('0x2c')],'type':_0x1b28bc[_0xc4f1('0x2d')][_0xc4f1('0x2e')]};});_0x49a691['model']=_[_0xc4f1('0x2a')](_0x496934,_0xc4f1('0x28'));_0x49a691[_0xc4f1('0x2f')]=_[_0xc4f1('0x30')](_0x5bca2c[_0xc4f1('0x2f')]);_0x49a691['filters']=_[_0xc4f1('0x31')](_0x49a691[_0xc4f1('0x32')],_0x49a691[_0xc4f1('0x2f')]);_0x30425b[_0xc4f1('0x33')]=_[_0xc4f1('0x31')](_0x49a691[_0xc4f1('0x32')],qs[_0xc4f1('0x34')](_0x5bca2c['query'][_0xc4f1('0x34')]));_0x30425b[_0xc4f1('0x33')]=_0x30425b[_0xc4f1('0x33')]['length']?_0x30425b[_0xc4f1('0x33')]:_0x49a691[_0xc4f1('0x32')];if(!_0x5bca2c[_0xc4f1('0x2f')][_0xc4f1('0x35')](_0xc4f1('0x36'))){_0x30425b[_0xc4f1('0x37')]=qs['limit'](_0x5bca2c[_0xc4f1('0x2f')][_0xc4f1('0x37')]);_0x30425b[_0xc4f1('0x1d')]=qs[_0xc4f1('0x1d')](_0x5bca2c['query'][_0xc4f1('0x1d')]);}_0x30425b[_0xc4f1('0x38')]=qs[_0xc4f1('0x39')](_0x5bca2c['query']['sort']);_0x30425b['where']=qs[_0xc4f1('0x3a')](_[_0xc4f1('0x3b')](_0x5bca2c[_0xc4f1('0x2f')],_0x49a691['filters']),_0x496934);if(_0x5bca2c[_0xc4f1('0x2f')]['filter']){_0x30425b[_0xc4f1('0x3c')]=_[_0xc4f1('0x3d')](_0x30425b[_0xc4f1('0x3c')],{'$or':_[_0xc4f1('0x2a')](_0x496934,function(_0x49e7e6){if(_0x49e7e6['type']!==_0xc4f1('0x3e')){var _0x2f2a48={};_0x2f2a48[_0x49e7e6['name']]={'$like':'%'+_0x5bca2c['query'][_0xc4f1('0x3f')]+'%'};return _0x2f2a48;}})});}_0x30425b=_[_0xc4f1('0x3d')]({},_0x30425b,_0x5bca2c[_0xc4f1('0x40')]);var _0xf3005f={'where':_0x30425b[_0xc4f1('0x3c')]};return db[_0xc4f1('0x2b')][_0xc4f1('0x1c')](_0xf3005f)[_0xc4f1('0x23')](function(_0x1aea1a){_0x555868[_0xc4f1('0x1c')]=_0x1aea1a;if(_0x5bca2c['query'][_0xc4f1('0x41')]){_0x30425b[_0xc4f1('0x42')]=[{'all':!![]}];}return db[_0xc4f1('0x2b')]['findAll'](_0x30425b);})[_0xc4f1('0x23')](function(_0x3ec65d){_0x555868['rows']=_0x3ec65d;return _0x555868;})[_0xc4f1('0x23')](respondWithFilteredResult(_0x3a1c9b,_0x30425b))[_0xc4f1('0x43')](handleError(_0x3a1c9b,null));};exports[_0xc4f1('0x44')]=function(_0x405644,_0x506209){var _0x4fdce7={'raw':!![],'where':{'id':_0x405644['params']['id']}},_0x2e6946={};_0x2e6946[_0xc4f1('0x32')]=_['keys'](db['Interval'][_0xc4f1('0x45')]);_0x2e6946['query']=_['keys'](_0x405644['query']);_0x2e6946[_0xc4f1('0x3a')]=_['intersection'](_0x2e6946['model'],_0x2e6946[_0xc4f1('0x2f')]);_0x4fdce7[_0xc4f1('0x33')]=_[_0xc4f1('0x31')](_0x2e6946[_0xc4f1('0x32')],qs['fields'](_0x405644[_0xc4f1('0x2f')][_0xc4f1('0x34')]));_0x4fdce7[_0xc4f1('0x33')]=_0x4fdce7['attributes']['length']?_0x4fdce7[_0xc4f1('0x33')]:_0x2e6946[_0xc4f1('0x32')];if(_0x405644[_0xc4f1('0x2f')][_0xc4f1('0x41')]){_0x4fdce7[_0xc4f1('0x42')]=[{'all':!![]}];}_0x4fdce7=_[_0xc4f1('0x3d')]({},_0x4fdce7,_0x405644[_0xc4f1('0x40')]);return db[_0xc4f1('0x2b')][_0xc4f1('0x46')](_0x4fdce7)[_0xc4f1('0x23')](handleEntityNotFound(_0x506209,null))[_0xc4f1('0x23')](respondWithResult(_0x506209,null))['catch'](handleError(_0x506209,null));};exports[_0xc4f1('0x47')]=function(_0x4573f6,_0x31d327){return db[_0xc4f1('0x2b')]['create'](_0x4573f6[_0xc4f1('0x48')],{})['then'](function(_0x307ddf){var _0x6dc6ae=_0x4573f6[_0xc4f1('0x49')]['get']({'plain':!![]});if(!_0x6dc6ae)throw new Error(_0xc4f1('0x4a'));if(_0x6dc6ae['role']===_0xc4f1('0x49')){var _0x5ec4e4=_0x307ddf[_0xc4f1('0x4b')]({'plain':!![]});var _0x2d1174=_0xc4f1('0x4c');return db[_0xc4f1('0x4d')][_0xc4f1('0x46')]({'where':{'name':_0x2d1174,'userProfileId':_0x6dc6ae[_0xc4f1('0x4e')]},'raw':!![]})['then'](function(_0xb125ec){if(_0xb125ec&&_0xb125ec['autoAssociation']===0x0){return db[_0xc4f1('0x25')]['create']({'name':_0x5ec4e4[_0xc4f1('0x28')],'resourceId':_0x5ec4e4['id'],'type':_0xb125ec[_0xc4f1('0x28')],'sectionId':_0xb125ec['id']},{})[_0xc4f1('0x23')](function(){return _0x307ddf;});}else{return _0x307ddf;}})['catch'](function(_0x199ce6){logger[_0xc4f1('0x26')](_0xc4f1('0x4f'),_0x199ce6);throw _0x199ce6;});}return _0x307ddf;})[_0xc4f1('0x23')](respondWithResult(_0x31d327,0xc9))[_0xc4f1('0x43')](handleError(_0x31d327,null));};exports['update']=function(_0x495b12,_0x607f77){if(_0x495b12[_0xc4f1('0x48')]['id']){delete _0x495b12[_0xc4f1('0x48')]['id'];}return db[_0xc4f1('0x2b')]['find']({'where':{'id':_0x495b12[_0xc4f1('0x50')]['id']}})[_0xc4f1('0x23')](handleEntityNotFound(_0x607f77,null))[_0xc4f1('0x23')](saveUpdates(_0x495b12[_0xc4f1('0x48')],null))['then'](respondWithResult(_0x607f77,null))[_0xc4f1('0x43')](handleError(_0x607f77,null));};exports[_0xc4f1('0x24')]=function(_0xae49d0,_0x28244b){return db['Interval'][_0xc4f1('0x46')]({'where':{'id':_0xae49d0[_0xc4f1('0x50')]['id']}})['then'](handleEntityNotFound(_0x28244b,null))[_0xc4f1('0x23')](removeEntity(_0x28244b,null))['catch'](handleError(_0x28244b,null));};exports[_0xc4f1('0x51')]=function(_0x69e703,_0x595945,_0x3edc9e){if(_0x69e703[_0xc4f1('0x48')]['id']){delete _0x69e703[_0xc4f1('0x48')]['id'];}return db[_0xc4f1('0x2b')][_0xc4f1('0x46')]({'where':{'id':_0x69e703[_0xc4f1('0x50')]['id']}})[_0xc4f1('0x23')](handleEntityNotFound(_0x595945,null))[_0xc4f1('0x23')](function(_0x40fb6e){if(_0x40fb6e){_0x69e703[_0xc4f1('0x48')][_0xc4f1('0x52')]=_0x40fb6e['id'];return db[_0xc4f1('0x2b')][_0xc4f1('0x47')](_0x69e703['body']);}})[_0xc4f1('0x23')](respondWithResult(_0x595945,null))['catch'](handleError(_0x595945,null));};exports[_0xc4f1('0x53')]=function(_0x57b56d,_0x10f545,_0x1a77ef){var _0x27457e={};var _0x4d236f={};var _0x38eb47;var _0xda488;return db[_0xc4f1('0x2b')]['findOne']({'where':{'id':_0x57b56d[_0xc4f1('0x50')]['id']}})[_0xc4f1('0x23')](handleEntityNotFound(_0x10f545,null))[_0xc4f1('0x23')](function(_0x5ba1f3){if(_0x5ba1f3){_0x38eb47=_0x5ba1f3;_0x4d236f[_0xc4f1('0x32')]=_[_0xc4f1('0x30')](db[_0xc4f1('0x2b')][_0xc4f1('0x45')]);_0x4d236f[_0xc4f1('0x2f')]=_[_0xc4f1('0x30')](_0x57b56d[_0xc4f1('0x2f')]);_0x4d236f[_0xc4f1('0x3a')]=_[_0xc4f1('0x31')](_0x4d236f[_0xc4f1('0x32')],_0x4d236f[_0xc4f1('0x2f')]);_0x27457e['attributes']=_['intersection'](_0x4d236f[_0xc4f1('0x32')],qs['fields'](_0x57b56d[_0xc4f1('0x2f')][_0xc4f1('0x34')]));_0x27457e[_0xc4f1('0x33')]=_0x27457e['attributes'][_0xc4f1('0x54')]?_0x27457e[_0xc4f1('0x33')]:_0x4d236f[_0xc4f1('0x32')];_0x27457e[_0xc4f1('0x38')]=qs['sort'](_0x57b56d[_0xc4f1('0x2f')][_0xc4f1('0x39')]);_0x27457e[_0xc4f1('0x3c')]=qs[_0xc4f1('0x3a')](_[_0xc4f1('0x3b')](_0x57b56d['query'],_0x4d236f[_0xc4f1('0x3a')]));if(_0x57b56d[_0xc4f1('0x2f')][_0xc4f1('0x3f')]){_0x27457e[_0xc4f1('0x3c')]=_[_0xc4f1('0x3d')](_0x27457e[_0xc4f1('0x3c')],{'$or':_[_0xc4f1('0x2a')](_0x27457e['attributes'],function(_0x4cbf8b){var _0xb22808={};_0xb22808[_0x4cbf8b]={'$like':'%'+_0x57b56d[_0xc4f1('0x2f')][_0xc4f1('0x3f')]+'%'};return _0xb22808;})});}_0x27457e=_[_0xc4f1('0x3d')]({},_0x27457e,_0x57b56d['options']);return _0x38eb47[_0xc4f1('0x53')](_0x27457e);}})[_0xc4f1('0x23')](function(_0x334c33){if(_0x334c33){_0xda488=_0x334c33[_0xc4f1('0x54')];if(!_0x57b56d[_0xc4f1('0x2f')][_0xc4f1('0x35')]('nolimit')){_0x27457e['limit']=qs[_0xc4f1('0x37')](_0x57b56d['query'][_0xc4f1('0x37')]);_0x27457e['offset']=qs[_0xc4f1('0x1d')](_0x57b56d['query'][_0xc4f1('0x1d')]);}return _0x38eb47['getIntervals'](_0x27457e);}})[_0xc4f1('0x23')](function(_0x38f2eb){if(_0x38f2eb){return _0x38f2eb?{'count':_0xda488,'rows':_0x38f2eb}:null;}})['then'](respondWithResult(_0x10f545,null))['catch'](handleError(_0x10f545,null));};exports[_0xc4f1('0x55')]=function(_0x7ee37a,_0x2bb344,_0x47c5ba){return db['Interval'][_0xc4f1('0x56')]({'where':{'id':_0x7ee37a[_0xc4f1('0x50')]['id']}})[_0xc4f1('0x23')](handleEntityNotFound(_0x2bb344,null))[_0xc4f1('0x23')](function(_0x549fda){if(_0x549fda){return db[_0xc4f1('0x57')][_0xc4f1('0x58')](function(_0x3f8bfd){return db[_0xc4f1('0x2b')]['destroy']({'where':{'IntervalId':_0x7ee37a[_0xc4f1('0x50')]['id']},'transaction':_0x3f8bfd})[_0xc4f1('0x23')](function(_0x1cc932){var _0x2e05e3=_[_0xc4f1('0x2a')](_0x7ee37a[_0xc4f1('0x48')],function(_0x3322eb){delete _0x3322eb['id'];_0x3322eb[_0xc4f1('0x52')]=_0x7ee37a[_0xc4f1('0x50')]['id'];return _0x3322eb;});return db[_0xc4f1('0x2b')][_0xc4f1('0x59')](_0x2e05e3,{'transaction':_0x3f8bfd});});})[_0xc4f1('0x23')](function(){return db[_0xc4f1('0x2b')][_0xc4f1('0x5a')]({'where':{'IntervalId':_0x7ee37a[_0xc4f1('0x50')]['id']}});});}})[_0xc4f1('0x23')](respondWithResult(_0x2bb344,null))['catch'](handleError(_0x2bb344,null));}; \ No newline at end of file +var _0x9a59=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','length','order','addIntervals','sequelize','transaction','bulkCreate','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','Interval','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort'];(function(_0x534455,_0x3b9e7c){var _0x2e1f36=function(_0x493536){while(--_0x493536){_0x534455['push'](_0x534455['shift']());}};_0x2e1f36(++_0x3b9e7c);}(_0x9a59,0x7e));var _0x99a5=function(_0x1c00e3,_0x31a1bb){_0x1c00e3=_0x1c00e3-0x0;var _0x370782=_0x9a59[_0x1c00e3];return _0x370782;};'use strict';var pdf=require(_0x99a5('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x99a5('0x1'));var jsonpatch=require(_0x99a5('0x2'));var rp=require(_0x99a5('0x3'));var moment=require(_0x99a5('0x4'));var BPromise=require(_0x99a5('0x5'));var Mustache=require('mustache');var util=require(_0x99a5('0x6'));var path=require(_0x99a5('0x7'));var sox=require(_0x99a5('0x8'));var csv=require(_0x99a5('0x9'));var ejs=require(_0x99a5('0xa'));var fs=require('fs');var _=require(_0x99a5('0xb'));var squel=require(_0x99a5('0xc'));var crypto=require(_0x99a5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x99a5('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x99a5('0xf'));var Redis=require('ioredis');var authService=require(_0x99a5('0x10'));var qs=require(_0x99a5('0x11'));var as=require(_0x99a5('0x12'));var hardwareService=require(_0x99a5('0x13'));var logger=require('../../config/logger')(_0x99a5('0x14'));var utils=require(_0x99a5('0x15'));var config=require('../../config/environment');var db=require(_0x99a5('0x16'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x8726da,_0x2620a7){_0x2620a7=_0x2620a7||0xcc;return function(_0x23b720){if(_0x23b720){return _0x8726da[_0x99a5('0x17')](_0x2620a7);}return _0x8726da[_0x99a5('0x18')](_0x2620a7)[_0x99a5('0x19')]();};}function respondWithResult(_0x1cc56d,_0x404d7a){_0x404d7a=_0x404d7a||0xc8;return function(_0x3638fa){if(_0x3638fa){return _0x1cc56d['status'](_0x404d7a)[_0x99a5('0x1a')](_0x3638fa);}};}function respondWithFilteredResult(_0x3ee409,_0x4bda90){return function(_0x986c48){if(_0x986c48){var _0x38a9d2=_0x986c48[_0x99a5('0x1b')],_0x4714f6=_0x4bda90[_0x99a5('0x1c')],_0x43a63a=_0x4bda90[_0x99a5('0x1c')]+_0x4bda90[_0x99a5('0x1d')],_0x46cf8a;if(_0x43a63a>=_0x38a9d2){_0x43a63a=_0x38a9d2;_0x46cf8a=0xc8;}else{_0x46cf8a=0xce;}_0x3ee409[_0x99a5('0x18')](_0x46cf8a);return _0x3ee409[_0x99a5('0x1e')](_0x99a5('0x1f'),_0x4714f6+'-'+_0x43a63a+'/'+_0x38a9d2)[_0x99a5('0x1a')](_0x986c48);}return null;};}function patchUpdates(_0x1843f1){return function(_0x5e1b81){try{jsonpatch[_0x99a5('0x20')](_0x5e1b81,_0x1843f1,!![]);}catch(_0x119803){return BPromise[_0x99a5('0x21')](_0x119803);}return _0x5e1b81[_0x99a5('0x22')]();};}function saveUpdates(_0x8c4ef5,_0x1ecccc){return function(_0x13aa6e){if(_0x13aa6e){return _0x13aa6e[_0x99a5('0x23')](_0x8c4ef5)[_0x99a5('0x24')](function(_0x5b569b){return _0x5b569b;});}return null;};}function removeEntity(_0x45912f,_0x345e36){return function(_0x27180b){if(_0x27180b){return _0x27180b[_0x99a5('0x25')]()[_0x99a5('0x24')](function(){var _0x20675d=_0x27180b[_0x99a5('0x26')]({'plain':!![]});var _0x3832fc='Intervals';return db['UserProfileResource'][_0x99a5('0x25')]({'where':{'type':_0x3832fc,'resourceId':_0x20675d['id']}})['then'](function(){return _0x27180b;});})[_0x99a5('0x24')](function(){_0x45912f[_0x99a5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c584d,_0x367dc3){return function(_0x45a950){if(!_0x45a950){_0x4c584d[_0x99a5('0x17')](0x194);}return _0x45a950;};}function handleError(_0x201106,_0xce7cce){_0xce7cce=_0xce7cce||0x1f4;return function(_0x2ca470){logger[_0x99a5('0x27')](_0x2ca470[_0x99a5('0x28')]);if(_0x2ca470['name']){delete _0x2ca470[_0x99a5('0x29')];}_0x201106[_0x99a5('0x18')](_0xce7cce)[_0x99a5('0x2a')](_0x2ca470);};}exports[_0x99a5('0x2b')]=function(_0x587cfd,_0x5ac110){var _0x14a151={},_0x419e10={},_0x479248={'count':0x0,'rows':[]};var _0x16a832=_[_0x99a5('0x2c')](db[_0x99a5('0x2d')]['rawAttributes'],function(_0x3537c2){return{'name':_0x3537c2[_0x99a5('0x2e')],'type':_0x3537c2[_0x99a5('0x2f')][_0x99a5('0x30')]};});_0x419e10[_0x99a5('0x31')]=_[_0x99a5('0x2c')](_0x16a832,_0x99a5('0x29'));_0x419e10[_0x99a5('0x32')]=_[_0x99a5('0x33')](_0x587cfd['query']);_0x419e10[_0x99a5('0x34')]=_[_0x99a5('0x35')](_0x419e10[_0x99a5('0x31')],_0x419e10[_0x99a5('0x32')]);_0x14a151['attributes']=_[_0x99a5('0x35')](_0x419e10['model'],qs['fields'](_0x587cfd['query'][_0x99a5('0x36')]));_0x14a151[_0x99a5('0x37')]=_0x14a151[_0x99a5('0x37')]['length']?_0x14a151[_0x99a5('0x37')]:_0x419e10[_0x99a5('0x31')];if(!_0x587cfd[_0x99a5('0x32')][_0x99a5('0x38')]('nolimit')){_0x14a151[_0x99a5('0x1d')]=qs['limit'](_0x587cfd[_0x99a5('0x32')][_0x99a5('0x1d')]);_0x14a151[_0x99a5('0x1c')]=qs[_0x99a5('0x1c')](_0x587cfd[_0x99a5('0x32')][_0x99a5('0x1c')]);}_0x14a151['order']=qs[_0x99a5('0x39')](_0x587cfd['query']['sort']);_0x14a151[_0x99a5('0x3a')]=qs[_0x99a5('0x34')](_[_0x99a5('0x3b')](_0x587cfd[_0x99a5('0x32')],_0x419e10[_0x99a5('0x34')]),_0x16a832);if(_0x587cfd['query'][_0x99a5('0x3c')]){_0x14a151[_0x99a5('0x3a')]=_[_0x99a5('0x3d')](_0x14a151[_0x99a5('0x3a')],{'$or':_[_0x99a5('0x2c')](_0x16a832,function(_0x30e091){if(_0x30e091[_0x99a5('0x2f')]!==_0x99a5('0x3e')){var _0xf18104={};_0xf18104[_0x30e091[_0x99a5('0x29')]]={'$like':'%'+_0x587cfd['query']['filter']+'%'};return _0xf18104;}})});}_0x14a151=_['merge']({},_0x14a151,_0x587cfd[_0x99a5('0x3f')]);var _0x328401={'where':_0x14a151['where']};return db[_0x99a5('0x2d')]['count'](_0x328401)[_0x99a5('0x24')](function(_0xd49cb8){_0x479248[_0x99a5('0x1b')]=_0xd49cb8;if(_0x587cfd[_0x99a5('0x32')][_0x99a5('0x40')]){_0x14a151[_0x99a5('0x41')]=[{'all':!![]}];}return db[_0x99a5('0x2d')][_0x99a5('0x42')](_0x14a151);})['then'](function(_0xb877d1){_0x479248[_0x99a5('0x43')]=_0xb877d1;return _0x479248;})['then'](respondWithFilteredResult(_0x5ac110,_0x14a151))[_0x99a5('0x44')](handleError(_0x5ac110,null));};exports[_0x99a5('0x45')]=function(_0x3406b0,_0x27353c){var _0x5d3486={'raw':!![],'where':{'id':_0x3406b0[_0x99a5('0x46')]['id']}},_0x889dcf={};_0x889dcf[_0x99a5('0x31')]=_[_0x99a5('0x33')](db[_0x99a5('0x2d')][_0x99a5('0x47')]);_0x889dcf[_0x99a5('0x32')]=_[_0x99a5('0x33')](_0x3406b0[_0x99a5('0x32')]);_0x889dcf[_0x99a5('0x34')]=_[_0x99a5('0x35')](_0x889dcf['model'],_0x889dcf[_0x99a5('0x32')]);_0x5d3486[_0x99a5('0x37')]=_['intersection'](_0x889dcf[_0x99a5('0x31')],qs[_0x99a5('0x36')](_0x3406b0['query'][_0x99a5('0x36')]));_0x5d3486[_0x99a5('0x37')]=_0x5d3486['attributes']['length']?_0x5d3486[_0x99a5('0x37')]:_0x889dcf['model'];if(_0x3406b0[_0x99a5('0x32')][_0x99a5('0x40')]){_0x5d3486[_0x99a5('0x41')]=[{'all':!![]}];}_0x5d3486=_[_0x99a5('0x3d')]({},_0x5d3486,_0x3406b0[_0x99a5('0x3f')]);return db[_0x99a5('0x2d')][_0x99a5('0x48')](_0x5d3486)[_0x99a5('0x24')](handleEntityNotFound(_0x27353c,null))[_0x99a5('0x24')](respondWithResult(_0x27353c,null))[_0x99a5('0x44')](handleError(_0x27353c,null));};exports[_0x99a5('0x49')]=function(_0x4ec6bc,_0x4c2642){return db[_0x99a5('0x2d')][_0x99a5('0x49')](_0x4ec6bc[_0x99a5('0x4a')],{})[_0x99a5('0x24')](function(_0x9c2ecb){var _0x255c74=_0x4ec6bc[_0x99a5('0x4b')][_0x99a5('0x26')]({'plain':!![]});if(!_0x255c74)throw new Error(_0x99a5('0x4c'));if(_0x255c74[_0x99a5('0x4d')]===_0x99a5('0x4b')){var _0x3ba1d5=_0x9c2ecb[_0x99a5('0x26')]({'plain':!![]});var _0xea9717=_0x99a5('0x4e');return db[_0x99a5('0x4f')]['find']({'where':{'name':_0xea9717,'userProfileId':_0x255c74[_0x99a5('0x50')]},'raw':!![]})[_0x99a5('0x24')](function(_0x39ec86){if(_0x39ec86&&_0x39ec86['autoAssociation']===0x0){return db['UserProfileResource'][_0x99a5('0x49')]({'name':_0x3ba1d5['name'],'resourceId':_0x3ba1d5['id'],'type':_0x39ec86[_0x99a5('0x29')],'sectionId':_0x39ec86['id']},{})[_0x99a5('0x24')](function(){return _0x9c2ecb;});}else{return _0x9c2ecb;}})['catch'](function(_0x20dc1c){logger[_0x99a5('0x27')](_0x99a5('0x51'),_0x20dc1c);throw _0x20dc1c;});}return _0x9c2ecb;})[_0x99a5('0x24')](respondWithResult(_0x4c2642,0xc9))[_0x99a5('0x44')](handleError(_0x4c2642,null));};exports[_0x99a5('0x23')]=function(_0x4f08be,_0x5121bf){if(_0x4f08be[_0x99a5('0x4a')]['id']){delete _0x4f08be[_0x99a5('0x4a')]['id'];}return db[_0x99a5('0x2d')][_0x99a5('0x48')]({'where':{'id':_0x4f08be[_0x99a5('0x46')]['id']}})[_0x99a5('0x24')](handleEntityNotFound(_0x5121bf,null))[_0x99a5('0x24')](saveUpdates(_0x4f08be[_0x99a5('0x4a')],null))['then'](respondWithResult(_0x5121bf,null))[_0x99a5('0x44')](handleError(_0x5121bf,null));};exports[_0x99a5('0x25')]=function(_0x4f4481,_0x3b1ebc){return db[_0x99a5('0x2d')]['find']({'where':{'id':_0x4f4481[_0x99a5('0x46')]['id']}})[_0x99a5('0x24')](handleEntityNotFound(_0x3b1ebc,null))[_0x99a5('0x24')](removeEntity(_0x3b1ebc,null))[_0x99a5('0x44')](handleError(_0x3b1ebc,null));};exports[_0x99a5('0x52')]=function(_0x4729c3,_0x4ff1bf,_0x52f7f8){if(_0x4729c3[_0x99a5('0x4a')]['id']){delete _0x4729c3[_0x99a5('0x4a')]['id'];}return db[_0x99a5('0x2d')][_0x99a5('0x48')]({'where':{'id':_0x4729c3[_0x99a5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ff1bf,null))[_0x99a5('0x24')](function(_0x3432e1){if(_0x3432e1){_0x4729c3[_0x99a5('0x4a')][_0x99a5('0x53')]=_0x3432e1['id'];return db[_0x99a5('0x2d')][_0x99a5('0x49')](_0x4729c3[_0x99a5('0x4a')]);}})[_0x99a5('0x24')](respondWithResult(_0x4ff1bf,null))[_0x99a5('0x44')](handleError(_0x4ff1bf,null));};exports[_0x99a5('0x54')]=function(_0xe81426,_0x18368f,_0x1174d5){var _0x55c5b2={};var _0x1b7215={};var _0x86c462;var _0x2b8736;return db[_0x99a5('0x2d')][_0x99a5('0x55')]({'where':{'id':_0xe81426['params']['id']}})['then'](handleEntityNotFound(_0x18368f,null))[_0x99a5('0x24')](function(_0x3f5cc5){if(_0x3f5cc5){_0x86c462=_0x3f5cc5;_0x1b7215['model']=_[_0x99a5('0x33')](db[_0x99a5('0x2d')][_0x99a5('0x47')]);_0x1b7215[_0x99a5('0x32')]=_[_0x99a5('0x33')](_0xe81426['query']);_0x1b7215['filters']=_[_0x99a5('0x35')](_0x1b7215[_0x99a5('0x31')],_0x1b7215[_0x99a5('0x32')]);_0x55c5b2[_0x99a5('0x37')]=_[_0x99a5('0x35')](_0x1b7215[_0x99a5('0x31')],qs[_0x99a5('0x36')](_0xe81426['query']['fields']));_0x55c5b2[_0x99a5('0x37')]=_0x55c5b2[_0x99a5('0x37')][_0x99a5('0x56')]?_0x55c5b2[_0x99a5('0x37')]:_0x1b7215[_0x99a5('0x31')];_0x55c5b2[_0x99a5('0x57')]=qs[_0x99a5('0x39')](_0xe81426['query']['sort']);_0x55c5b2[_0x99a5('0x3a')]=qs[_0x99a5('0x34')](_['pick'](_0xe81426[_0x99a5('0x32')],_0x1b7215[_0x99a5('0x34')]));if(_0xe81426['query'][_0x99a5('0x3c')]){_0x55c5b2['where']=_[_0x99a5('0x3d')](_0x55c5b2[_0x99a5('0x3a')],{'$or':_['map'](_0x55c5b2[_0x99a5('0x37')],function(_0x519ba1){var _0x3176e8={};_0x3176e8[_0x519ba1]={'$like':'%'+_0xe81426['query']['filter']+'%'};return _0x3176e8;})});}_0x55c5b2=_[_0x99a5('0x3d')]({},_0x55c5b2,_0xe81426[_0x99a5('0x3f')]);return _0x86c462[_0x99a5('0x54')](_0x55c5b2);}})[_0x99a5('0x24')](function(_0x4cdced){if(_0x4cdced){_0x2b8736=_0x4cdced[_0x99a5('0x56')];if(!_0xe81426[_0x99a5('0x32')][_0x99a5('0x38')]('nolimit')){_0x55c5b2[_0x99a5('0x1d')]=qs[_0x99a5('0x1d')](_0xe81426[_0x99a5('0x32')][_0x99a5('0x1d')]);_0x55c5b2[_0x99a5('0x1c')]=qs[_0x99a5('0x1c')](_0xe81426['query'][_0x99a5('0x1c')]);}return _0x86c462[_0x99a5('0x54')](_0x55c5b2);}})[_0x99a5('0x24')](function(_0x597bce){if(_0x597bce){return _0x597bce?{'count':_0x2b8736,'rows':_0x597bce}:null;}})['then'](respondWithResult(_0x18368f,null))[_0x99a5('0x44')](handleError(_0x18368f,null));};exports[_0x99a5('0x58')]=function(_0x193a63,_0x31de26,_0xae4e93){return db[_0x99a5('0x2d')][_0x99a5('0x55')]({'where':{'id':_0x193a63[_0x99a5('0x46')]['id']}})['then'](handleEntityNotFound(_0x31de26,null))[_0x99a5('0x24')](function(_0x168197){if(_0x168197){return db[_0x99a5('0x59')][_0x99a5('0x5a')](function(_0x23454f){return db[_0x99a5('0x2d')][_0x99a5('0x25')]({'where':{'IntervalId':_0x193a63['params']['id']},'transaction':_0x23454f})[_0x99a5('0x24')](function(_0x176b73){var _0x184560=_[_0x99a5('0x2c')](_0x193a63[_0x99a5('0x4a')],function(_0x4f5a9a){delete _0x4f5a9a['id'];_0x4f5a9a['IntervalId']=_0x193a63[_0x99a5('0x46')]['id'];return _0x4f5a9a;});return db[_0x99a5('0x2d')][_0x99a5('0x5b')](_0x184560,{'transaction':_0x23454f});});})['then'](function(){return db[_0x99a5('0x2d')][_0x99a5('0x42')]({'where':{'IntervalId':_0x193a63[_0x99a5('0x46')]['id']}});});}})[_0x99a5('0x24')](respondWithResult(_0x31de26,null))[_0x99a5('0x44')](handleError(_0x31de26,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index e36dd2a..2db54c2 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 _0x593e=['bluebird','request-promise','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment'];(function(_0x170522,_0x273df0){var _0x2a0a7b=function(_0x5539a5){while(--_0x5539a5){_0x170522['push'](_0x170522['shift']());}};_0x2a0a7b(++_0x273df0);}(_0x593e,0xcb));var _0xe593=function(_0x13532d,_0x5198a9){_0x13532d=_0x13532d-0x0;var _0x12dae7=_0x593e[_0x13532d];return _0x12dae7;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var logger=require(_0xe593('0x2'))(_0xe593('0x3'));var moment=require(_0xe593('0x4'));var BPromise=require(_0xe593('0x5'));var rp=require(_0xe593('0x6'));var fs=require('fs');var path=require(_0xe593('0x7'));var rimraf=require('rimraf');var config=require(_0xe593('0x8'));var attributes=require(_0xe593('0x9'));var extensions=require(_0xe593('0xa'));module[_0xe593('0xb')]=function(_0x3b7082,_0x14cff3){return _0x3b7082[_0xe593('0xc')](_0xe593('0xd'),attributes,{'tableName':_0xe593('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x265099,_0x51b862){extensions[_0xe593('0xf')](_0x3b7082,_0x265099);},'afterBulkCreate':function(_0x4091db,_0x38d977,_0x5ba75c){_0x5ba75c();extensions['rewrite'](_0x3b7082,_0x4091db[0x0]);},'afterUpdate':function(_0x3032ee,_0xeefe30){extensions[_0xe593('0xf')](_0x3b7082,_0x3032ee);},'afterDestroy':function(_0x55fb84,_0x6a5d4f){extensions[_0xe593('0xf')](_0x3b7082,_0x55fb84);}}});}; \ No newline at end of file +var _0xf257=['define','Interval','tools_intervals','rewrite','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0x26dc89,_0x372cef){var _0x3de277=function(_0x141d9f){while(--_0x141d9f){_0x26dc89['push'](_0x26dc89['shift']());}};_0x3de277(++_0x372cef);}(_0xf257,0x82));var _0x7f25=function(_0x1a77e6,_0x3b75e6){_0x1a77e6=_0x1a77e6-0x0;var _0x9ea6e8=_0xf257[_0x1a77e6];return _0x9ea6e8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7f25('0x0'))(_0x7f25('0x1'));var moment=require(_0x7f25('0x2'));var BPromise=require(_0x7f25('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7f25('0x4'));var rimraf=require(_0x7f25('0x5'));var config=require(_0x7f25('0x6'));var attributes=require(_0x7f25('0x7'));var extensions=require(_0x7f25('0x8'));module[_0x7f25('0x9')]=function(_0x1998d7,_0x242a3e){return _0x1998d7[_0x7f25('0xa')](_0x7f25('0xb'),attributes,{'tableName':_0x7f25('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ae607,_0x245602){extensions[_0x7f25('0xd')](_0x1998d7,_0x1ae607);},'afterBulkCreate':function(_0x57ba17,_0x1b9268,_0x362a80){_0x362a80();extensions['rewrite'](_0x1998d7,_0x57ba17[0x0]);},'afterUpdate':function(_0x557d2a,_0x26a033){extensions['rewrite'](_0x1998d7,_0x557d2a);},'afterDestroy':function(_0x1d9f33,_0x38232d){extensions[_0x7f25('0xd')](_0x1998d7,_0x1d9f33);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index b0bf204..fea197e 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 _0xd84c=['Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetInterval','Interval','findAll','options','where','limit','include','map','model','attributes','find','raw','ShowInterval','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then'];(function(_0x4c6e97,_0x214cf1){var _0x4bf6db=function(_0x1099a4){while(--_0x1099a4){_0x4c6e97['push'](_0x4c6e97['shift']());}};_0x4bf6db(++_0x214cf1);}(_0xd84c,0x197));var _0xcd84=function(_0x3709ec,_0x148d2d){_0x3709ec=_0x3709ec-0x0;var _0x359d77=_0xd84c[_0x3709ec];return _0x359d77;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcd84('0x0'));var BPromise=require(_0xcd84('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd84('0x2'));var db=require(_0xcd84('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcd84('0x4'));var config=require('../../config/environment');var jayson=require(_0xcd84('0x5'));var client=jayson[_0xcd84('0x6')][_0xcd84('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x45aa22,_0x5ace37,_0x40e1b9){return new BPromise(function(_0x5270e4,_0x22d2de){return client['request'](_0x45aa22,_0x40e1b9)[_0xcd84('0x8')](function(_0x3dd606){logger['info'](_0xcd84('0x9'),_0x5ace37,_0xcd84('0xa'));logger[_0xcd84('0xb')](_0xcd84('0xc'),_0x5ace37,_0xcd84('0xa'),JSON[_0xcd84('0xd')](_0x3dd606));if(_0x3dd606[_0xcd84('0xe')]){if(_0x3dd606['error'][_0xcd84('0xf')]===0x1f4){logger[_0xcd84('0xe')]('Interval,\x20%s,\x20%s',_0x5ace37,_0x3dd606[_0xcd84('0xe')][_0xcd84('0x10')]);return _0x22d2de(_0x3dd606[_0xcd84('0xe')][_0xcd84('0x10')]);}logger['error'](_0xcd84('0x9'),_0x5ace37,_0x3dd606[_0xcd84('0xe')]['message']);return _0x5270e4(_0x3dd606[_0xcd84('0xe')][_0xcd84('0x10')]);}else{logger[_0xcd84('0x11')](_0xcd84('0x9'),_0x5ace37,_0xcd84('0xa'));_0x5270e4(_0x3dd606['result'][_0xcd84('0x10')]);}})[_0xcd84('0x12')](function(_0xb0b410){logger[_0xcd84('0xe')]('Interval,\x20%s,\x20%s',_0x5ace37,_0xb0b410);_0x22d2de(_0xb0b410);});});}exports[_0xcd84('0x13')]=function(_0x3c36c7){var _0x50618f=this;return new Promise(function(_0x5eb35d,_0x55ded8){return db[_0xcd84('0x14')][_0xcd84('0x15')]({'raw':_0x3c36c7[_0xcd84('0x16')]?_0x3c36c7['options']['raw']===undefined?!![]:![]:!![],'where':_0x3c36c7['options']?_0x3c36c7[_0xcd84('0x16')][_0xcd84('0x17')]||null:null,'attributes':_0x3c36c7[_0xcd84('0x16')]?_0x3c36c7[_0xcd84('0x16')]['attributes']||null:null,'limit':_0x3c36c7[_0xcd84('0x16')]?_0x3c36c7['options'][_0xcd84('0x18')]||null:null,'include':_0x3c36c7['options']?_0x3c36c7['options'][_0xcd84('0x19')]?_[_0xcd84('0x1a')](_0x3c36c7[_0xcd84('0x16')][_0xcd84('0x19')],function(_0x1e5c72){return{'model':db[_0x1e5c72[_0xcd84('0x1b')]],'as':_0x1e5c72['as'],'attributes':_0x1e5c72[_0xcd84('0x1c')],'include':_0x1e5c72[_0xcd84('0x19')]?_[_0xcd84('0x1a')](_0x1e5c72[_0xcd84('0x19')],function(_0x55f26f){return{'model':db[_0x55f26f[_0xcd84('0x1b')]],'as':_0x55f26f['as'],'attributes':_0x55f26f[_0xcd84('0x1c')],'include':_0x55f26f['include']?_['map'](_0x55f26f['include'],function(_0x235de6){return{'model':db[_0x235de6['model']],'as':_0x235de6['as'],'attributes':_0x235de6[_0xcd84('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcd84('0x8')](function(_0x42feec){logger[_0xcd84('0x11')](_0xcd84('0x13'),_0x3c36c7);logger[_0xcd84('0xb')]('GetInterval',_0x3c36c7,JSON[_0xcd84('0xd')](_0x42feec));_0x5eb35d(_0x42feec);})[_0xcd84('0x12')](function(_0x257e1e){logger[_0xcd84('0xe')](_0xcd84('0x13'),_0x257e1e[_0xcd84('0x10')],_0x3c36c7);_0x55ded8(_0x50618f[_0xcd84('0xe')](0x1f4,_0x257e1e[_0xcd84('0x10')]));});});};exports['ShowInterval']=function(_0x1a12a3){var _0x48751a=this;return new Promise(function(_0x49ddef,_0x394394){return db['Interval'][_0xcd84('0x1d')]({'raw':_0x1a12a3[_0xcd84('0x16')]?_0x1a12a3['options'][_0xcd84('0x1e')]===undefined?!![]:![]:!![],'where':_0x1a12a3[_0xcd84('0x16')]?_0x1a12a3[_0xcd84('0x16')][_0xcd84('0x17')]||null:null,'attributes':_0x1a12a3['options']?_0x1a12a3[_0xcd84('0x16')]['attributes']||null:null,'include':_0x1a12a3['options']?_0x1a12a3[_0xcd84('0x16')][_0xcd84('0x19')]?_[_0xcd84('0x1a')](_0x1a12a3[_0xcd84('0x16')][_0xcd84('0x19')],function(_0x5a5f7a){return{'model':db[_0x5a5f7a['model']],'as':_0x5a5f7a['as'],'attributes':_0x5a5f7a[_0xcd84('0x1c')],'include':_0x5a5f7a[_0xcd84('0x19')]?_[_0xcd84('0x1a')](_0x5a5f7a['include'],function(_0x1103a8){return{'model':db[_0x1103a8['model']],'as':_0x1103a8['as'],'attributes':_0x1103a8[_0xcd84('0x1c')],'include':_0x1103a8[_0xcd84('0x19')]?_[_0xcd84('0x1a')](_0x1103a8['include'],function(_0x1ea1d6){return{'model':db[_0x1ea1d6[_0xcd84('0x1b')]],'as':_0x1ea1d6['as'],'attributes':_0x1ea1d6[_0xcd84('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcd84('0x8')](function(_0x392514){logger['info']('ShowInterval',_0x1a12a3);logger[_0xcd84('0xb')](_0xcd84('0x1f'),_0x1a12a3,JSON[_0xcd84('0xd')](_0x392514));_0x49ddef(_0x392514);})[_0xcd84('0x12')](function(_0x4b4dc8){logger[_0xcd84('0xe')](_0xcd84('0x1f'),_0x4b4dc8[_0xcd84('0x10')],_0x1a12a3);_0x394394(_0x48751a[_0xcd84('0xe')](0x1f4,_0x4b4dc8[_0xcd84('0x10')]));});});}; \ No newline at end of file +var _0xa4d6=['info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','error','code','message','GetInterval','Interval','findAll','options','where','attributes','limit','include','map','model','stringify','catch','ShowInterval','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x519bc5,_0x5c5bc3){var _0x438558=function(_0x43499c){while(--_0x43499c){_0x519bc5['push'](_0x519bc5['shift']());}};_0x438558(++_0x5c5bc3);}(_0xa4d6,0x113));var _0x6a4d=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0xa4d6[_0x2543d6];return _0x55213c;};'use strict';var _=require(_0x6a4d('0x0'));var util=require(_0x6a4d('0x1'));var moment=require(_0x6a4d('0x2'));var BPromise=require(_0x6a4d('0x3'));var rs=require(_0x6a4d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a4d('0x5'))['db'];var utils=require(_0x6a4d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x6a4d('0x7'));var jayson=require(_0x6a4d('0x8'));var client=jayson[_0x6a4d('0x9')][_0x6a4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed2dd,_0x1ac931,_0x350f1d){return new BPromise(function(_0x14c5c7,_0x348b8b){return client[_0x6a4d('0xb')](_0x5ed2dd,_0x350f1d)[_0x6a4d('0xc')](function(_0x403b63){logger[_0x6a4d('0xd')](_0x6a4d('0xe'),_0x1ac931,_0x6a4d('0xf'));logger[_0x6a4d('0x10')](_0x6a4d('0x11'),_0x1ac931,_0x6a4d('0xf'),JSON['stringify'](_0x403b63));if(_0x403b63[_0x6a4d('0x12')]){if(_0x403b63[_0x6a4d('0x12')][_0x6a4d('0x13')]===0x1f4){logger[_0x6a4d('0x12')](_0x6a4d('0xe'),_0x1ac931,_0x403b63[_0x6a4d('0x12')][_0x6a4d('0x14')]);return _0x348b8b(_0x403b63[_0x6a4d('0x12')]['message']);}logger['error'](_0x6a4d('0xe'),_0x1ac931,_0x403b63['error'][_0x6a4d('0x14')]);return _0x14c5c7(_0x403b63[_0x6a4d('0x12')][_0x6a4d('0x14')]);}else{logger[_0x6a4d('0xd')](_0x6a4d('0xe'),_0x1ac931,_0x6a4d('0xf'));_0x14c5c7(_0x403b63['result']['message']);}})['catch'](function(_0x5f4b9b){logger[_0x6a4d('0x12')](_0x6a4d('0xe'),_0x1ac931,_0x5f4b9b);_0x348b8b(_0x5f4b9b);});});}exports[_0x6a4d('0x15')]=function(_0x5d9433){var _0x1b8385=this;return new Promise(function(_0x5f3bd3,_0x12eef0){return db[_0x6a4d('0x16')][_0x6a4d('0x17')]({'raw':_0x5d9433[_0x6a4d('0x18')]?_0x5d9433['options']['raw']===undefined?!![]:![]:!![],'where':_0x5d9433['options']?_0x5d9433[_0x6a4d('0x18')][_0x6a4d('0x19')]||null:null,'attributes':_0x5d9433[_0x6a4d('0x18')]?_0x5d9433[_0x6a4d('0x18')][_0x6a4d('0x1a')]||null:null,'limit':_0x5d9433['options']?_0x5d9433[_0x6a4d('0x18')][_0x6a4d('0x1b')]||null:null,'include':_0x5d9433[_0x6a4d('0x18')]?_0x5d9433[_0x6a4d('0x18')][_0x6a4d('0x1c')]?_[_0x6a4d('0x1d')](_0x5d9433[_0x6a4d('0x18')][_0x6a4d('0x1c')],function(_0x388d48){return{'model':db[_0x388d48['model']],'as':_0x388d48['as'],'attributes':_0x388d48[_0x6a4d('0x1a')],'include':_0x388d48[_0x6a4d('0x1c')]?_['map'](_0x388d48[_0x6a4d('0x1c')],function(_0x8e9799){return{'model':db[_0x8e9799[_0x6a4d('0x1e')]],'as':_0x8e9799['as'],'attributes':_0x8e9799[_0x6a4d('0x1a')],'include':_0x8e9799[_0x6a4d('0x1c')]?_[_0x6a4d('0x1d')](_0x8e9799[_0x6a4d('0x1c')],function(_0x396963){return{'model':db[_0x396963[_0x6a4d('0x1e')]],'as':_0x396963['as'],'attributes':_0x396963[_0x6a4d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x6a4d('0xc')](function(_0x1513b5){logger[_0x6a4d('0xd')](_0x6a4d('0x15'),_0x5d9433);logger[_0x6a4d('0x10')](_0x6a4d('0x15'),_0x5d9433,JSON[_0x6a4d('0x1f')](_0x1513b5));_0x5f3bd3(_0x1513b5);})[_0x6a4d('0x20')](function(_0x115352){logger[_0x6a4d('0x12')](_0x6a4d('0x15'),_0x115352[_0x6a4d('0x14')],_0x5d9433);_0x12eef0(_0x1b8385[_0x6a4d('0x12')](0x1f4,_0x115352[_0x6a4d('0x14')]));});});};exports[_0x6a4d('0x21')]=function(_0x4fd9d0){var _0x44bd83=this;return new Promise(function(_0x3d5c8b,_0x1498d8){return db[_0x6a4d('0x16')][_0x6a4d('0x22')]({'raw':_0x4fd9d0['options']?_0x4fd9d0[_0x6a4d('0x18')][_0x6a4d('0x23')]===undefined?!![]:![]:!![],'where':_0x4fd9d0[_0x6a4d('0x18')]?_0x4fd9d0[_0x6a4d('0x18')][_0x6a4d('0x19')]||null:null,'attributes':_0x4fd9d0[_0x6a4d('0x18')]?_0x4fd9d0[_0x6a4d('0x18')]['attributes']||null:null,'include':_0x4fd9d0[_0x6a4d('0x18')]?_0x4fd9d0[_0x6a4d('0x18')][_0x6a4d('0x1c')]?_[_0x6a4d('0x1d')](_0x4fd9d0[_0x6a4d('0x18')][_0x6a4d('0x1c')],function(_0x55d934){return{'model':db[_0x55d934[_0x6a4d('0x1e')]],'as':_0x55d934['as'],'attributes':_0x55d934[_0x6a4d('0x1a')],'include':_0x55d934[_0x6a4d('0x1c')]?_['map'](_0x55d934[_0x6a4d('0x1c')],function(_0x56bf21){return{'model':db[_0x56bf21[_0x6a4d('0x1e')]],'as':_0x56bf21['as'],'attributes':_0x56bf21[_0x6a4d('0x1a')],'include':_0x56bf21['include']?_['map'](_0x56bf21[_0x6a4d('0x1c')],function(_0x5ee1b7){return{'model':db[_0x5ee1b7[_0x6a4d('0x1e')]],'as':_0x5ee1b7['as'],'attributes':_0x5ee1b7['attributes']};}):[]};}):[]};}):[]:[]})[_0x6a4d('0xc')](function(_0x85d6d5){logger[_0x6a4d('0xd')]('ShowInterval',_0x4fd9d0);logger['debug'](_0x6a4d('0x21'),_0x4fd9d0,JSON[_0x6a4d('0x1f')](_0x85d6d5));_0x3d5c8b(_0x85d6d5);})[_0x6a4d('0x20')](function(_0x1f0108){logger['error'](_0x6a4d('0x21'),_0x1f0108['message'],_0x4fd9d0);_0x1498d8(_0x44bd83['error'](0x1f4,_0x1f0108[_0x6a4d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index d11c3ea..4610ec7 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 _0x6e07=['post','send','express','Router','./jira.controller'];(function(_0x226500,_0x1d95d1){var _0x12f316=function(_0x110237){while(--_0x110237){_0x226500['push'](_0x226500['shift']());}};_0x12f316(++_0x1d95d1);}(_0x6e07,0x70));var _0x76e0=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x6e07[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x76e0('0x0'));var router=express[_0x76e0('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x76e0('0x2'));router[_0x76e0('0x3')]('/',auth['isAuthenticated'](),controller[_0x76e0('0x4')]);module['exports']=router; \ No newline at end of file +var _0x6915=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x2fef09,_0x2097f4){var _0x2b292f=function(_0x5f3351){while(--_0x5f3351){_0x2fef09['push'](_0x2fef09['shift']());}};_0x2b292f(++_0x2097f4);}(_0x6915,0x146));var _0x5691=function(_0x1586b6,_0x1e9bc1){_0x1586b6=_0x1586b6-0x0;var _0x4f6682=_0x6915[_0x1586b6];return _0x4f6682;};'use strict';var express=require(_0x5691('0x0'));var router=express[_0x5691('0x1')]();var auth=require(_0x5691('0x2'));var controller=require(_0x5691('0x3'));router[_0x5691('0x4')]('/',auth[_0x5691('0x5')](),controller['send']);module[_0x5691('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 74b4937..75f9182 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 _0x4a05=['utf8','end','status','statusCode','json','error','api.jira','write','openIssue','headers','connection','remoteAddress','socket','body','https','../../config/logger','api','3eAmWpBVP0','key','MOTGUI','summary','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','reason','track.xcallymotion.com','/rest/api/2/issue','POST','toString','base64','request','setEncoding'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x4a05,0xb2));var _0x54a0=function(_0x3b65b7,_0x1756e2){_0x3b65b7=_0x3b65b7-0x0;var _0x186695=_0x4a05[_0x3b65b7];return _0x186695;};'use strict';var BPromise=require('bluebird');var https=require(_0x54a0('0x0'));var logger=require(_0x54a0('0x1'))(_0x54a0('0x2'));var USERNAME='support';var PASSWORD=_0x54a0('0x3');function openIssue(_0x530aa1,_0x2e8b04){var _0xb9c82f={'fields':{'project':{'key':_0x530aa1[_0x54a0('0x4')]||_0x54a0('0x5')},'summary':(_0x530aa1[_0x54a0('0x6')]||'Report')+'\x20from\x20'+_0x530aa1['ip'],'description':_0x530aa1[_0x54a0('0x7')]||JSON[_0x54a0('0x8')](_0x530aa1),'issuetype':{'name':_0x530aa1[_0x54a0('0x9')]||'Bug'}}};_0xb9c82f[_0x54a0('0xa')][_0x54a0('0xb')]=_0x530aa1[_0x54a0('0xc')];_0xb9c82f['fields'][_0x54a0('0xd')]=_0x530aa1[_0x54a0('0xe')];_0xb9c82f[_0x54a0('0xa')][_0x54a0('0xf')]=_0x530aa1[_0x54a0('0x10')];_0xb9c82f[_0x54a0('0xa')][_0x54a0('0x11')]=_0x530aa1[_0x54a0('0x12')];_0xb9c82f[_0x54a0('0xa')]['customfield_11504']=_0x530aa1[_0x54a0('0x13')];_0xb9c82f['fields']['customfield_10102']=_0x530aa1['ip'];var _0x398e94={'host':_0x54a0('0x14'),'port':0x1bb,'path':_0x54a0('0x15'),'method':_0x54a0('0x16'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x54a0('0x17')](_0x54a0('0x18'))}};var _0x3e794c=JSON['stringify'](_0xb9c82f);var _0x3edf3c=https[_0x54a0('0x19')](_0x398e94,function(_0x2ca536){_0x2ca536[_0x54a0('0x1a')](_0x54a0('0x1b'));var _0x5bf170='';_0x2ca536['on']('data',function(_0x4d4e02){_0x5bf170+=_0x4d4e02;});_0x2ca536['on'](_0x54a0('0x1c'),function(){if(_0x2e8b04){return _0x2e8b04[_0x54a0('0x1d')](_0x2ca536[_0x54a0('0x1e')])[_0x54a0('0x1f')](JSON['parse'](_0x5bf170));}});});_0x3edf3c['on'](_0x54a0('0x20'),function(_0x32b6d4){if(_0x2e8b04){return _0x2e8b04[_0x54a0('0x1d')](0x1f4)['json']({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x54a0('0x21')}]});}});_0x3edf3c[_0x54a0('0x22')](_0x3e794c);_0x3edf3c[_0x54a0('0x1c')]();}exports[_0x54a0('0x23')]=openIssue;exports['send']=function(_0x265b82,_0x1af20c){_0x265b82['body']['ip']=_0x265b82[_0x54a0('0x24')]['x-forwarded-for']||_0x265b82[_0x54a0('0x25')][_0x54a0('0x26')]||_0x265b82[_0x54a0('0x27')][_0x54a0('0x26')]||_0x265b82[_0x54a0('0x25')]['socket']['remoteAddress'];return openIssue(_0x265b82[_0x54a0('0x28')],_0x1af20c);}; \ No newline at end of file +var _0xcf46=['connection','socket','body','bluebird','../../config/logger','api','support','3eAmWpBVP0','key','Report','description','issuetype','email','fields','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','Basic\x20','toString','stringify','setEncoding','data','end','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','openIssue','send','headers','x-forwarded-for','remoteAddress'];(function(_0x1f27df,_0x4f1a64){var _0x286ee2=function(_0x255ea7){while(--_0x255ea7){_0x1f27df['push'](_0x1f27df['shift']());}};_0x286ee2(++_0x4f1a64);}(_0xcf46,0xe7));var _0x6cf4=function(_0x4993c7,_0x485c76){_0x4993c7=_0x4993c7-0x0;var _0x431f35=_0xcf46[_0x4993c7];return _0x431f35;};'use strict';var BPromise=require(_0x6cf4('0x0'));var https=require('https');var logger=require(_0x6cf4('0x1'))(_0x6cf4('0x2'));var USERNAME=_0x6cf4('0x3');var PASSWORD=_0x6cf4('0x4');function openIssue(_0x1b7f07,_0x2f9930){var _0x4da604={'fields':{'project':{'key':_0x1b7f07[_0x6cf4('0x5')]||'MOTGUI'},'summary':(_0x1b7f07['summary']||_0x6cf4('0x6'))+'\x20from\x20'+_0x1b7f07['ip'],'description':_0x1b7f07[_0x6cf4('0x7')]||JSON['stringify'](_0x1b7f07),'issuetype':{'name':_0x1b7f07[_0x6cf4('0x8')]||'Bug'}}};_0x4da604['fields']['customfield_11500']=_0x1b7f07[_0x6cf4('0x9')];_0x4da604[_0x6cf4('0xa')]['customfield_11501']=_0x1b7f07['oldToken'];_0x4da604['fields'][_0x6cf4('0xb')]=_0x1b7f07[_0x6cf4('0xc')];_0x4da604[_0x6cf4('0xa')][_0x6cf4('0xd')]=_0x1b7f07[_0x6cf4('0xe')];_0x4da604[_0x6cf4('0xa')]['customfield_11504']=_0x1b7f07[_0x6cf4('0xf')];_0x4da604[_0x6cf4('0xa')][_0x6cf4('0x10')]=_0x1b7f07['ip'];var _0x3600c6={'host':_0x6cf4('0x11'),'port':0x1bb,'path':_0x6cf4('0x12'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x6cf4('0x13')+new Buffer(USERNAME+':'+PASSWORD)[_0x6cf4('0x14')]('base64')}};var _0x30ea18=JSON[_0x6cf4('0x15')](_0x4da604);var _0x5e7ccd=https['request'](_0x3600c6,function(_0x5584df){_0x5584df[_0x6cf4('0x16')]('utf8');var _0x3bd1e9='';_0x5584df['on'](_0x6cf4('0x17'),function(_0x2abfda){_0x3bd1e9+=_0x2abfda;});_0x5584df['on'](_0x6cf4('0x18'),function(){if(_0x2f9930){return _0x2f9930['status'](_0x5584df['statusCode'])[_0x6cf4('0x19')](JSON[_0x6cf4('0x1a')](_0x3bd1e9));}});});_0x5e7ccd['on'](_0x6cf4('0x1b'),function(_0x30a1df){if(_0x2f9930){return _0x2f9930[_0x6cf4('0x1c')](0x1f4)['json']({'errors':[{'message':_0x6cf4('0x1d'),'type':'api.jira'}]});}});_0x5e7ccd['write'](_0x30ea18);_0x5e7ccd[_0x6cf4('0x18')]();}exports[_0x6cf4('0x1e')]=openIssue;exports[_0x6cf4('0x1f')]=function(_0x1bf73b,_0x418ad8){_0x1bf73b['body']['ip']=_0x1bf73b[_0x6cf4('0x20')][_0x6cf4('0x21')]||_0x1bf73b['connection'][_0x6cf4('0x22')]||_0x1bf73b['socket']['remoteAddress']||_0x1bf73b[_0x6cf4('0x23')][_0x6cf4('0x24')][_0x6cf4('0x22')];return openIssue(_0x1bf73b[_0x6cf4('0x25')],_0x418ad8);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index e257f91..603f596 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 _0x405c=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x405c,0x136));var _0xc405=function(_0x131dff,_0x5047bd){_0x131dff=_0x131dff-0x0;var _0x2c433b=_0x405c[_0x131dff];return _0x2c433b;};'use strict';var multer=require(_0xc405('0x0'));var util=require(_0xc405('0x1'));var path=require(_0xc405('0x2'));var timeout=require(_0xc405('0x3'));var express=require(_0xc405('0x4'));var router=express[_0xc405('0x5')]();var auth=require(_0xc405('0x6'));var interaction=require(_0xc405('0x7'));var config=require(_0xc405('0x8'));var controller=require('./jscriptyAnswerReport.controller');router['get']('/',auth[_0xc405('0x9')](),controller[_0xc405('0xa')]);router[_0xc405('0xb')](_0xc405('0xc'),auth['isAuthenticated'](),controller[_0xc405('0xd')]);router['get'](_0xc405('0xe'),auth[_0xc405('0x9')](),controller[_0xc405('0xf')]);router[_0xc405('0x10')]('/',auth[_0xc405('0x9')](),controller[_0xc405('0x11')]);router[_0xc405('0x12')](_0xc405('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xc405('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xc405('0x14')]);module[_0xc405('0x15')]=router; \ No newline at end of file +var _0x5b10=['create','put','delete','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','post'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x5b10,0x1ad));var _0x05b1=function(_0x112274,_0x5de002){_0x112274=_0x112274-0x0;var _0x536ff4=_0x5b10[_0x112274];return _0x536ff4;};'use strict';var multer=require(_0x05b1('0x0'));var util=require('util');var path=require(_0x05b1('0x1'));var timeout=require(_0x05b1('0x2'));var express=require('express');var router=express[_0x05b1('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x05b1('0x4'));var config=require(_0x05b1('0x5'));var controller=require(_0x05b1('0x6'));router[_0x05b1('0x7')]('/',auth[_0x05b1('0x8')](),controller[_0x05b1('0x9')]);router['get'](_0x05b1('0xa'),auth[_0x05b1('0x8')](),controller[_0x05b1('0xb')]);router[_0x05b1('0x7')]('/:id',auth[_0x05b1('0x8')](),controller['show']);router[_0x05b1('0xc')]('/',auth[_0x05b1('0x8')](),controller[_0x05b1('0xd')]);router[_0x05b1('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x05b1('0xf')]('/:id',auth[_0x05b1('0x8')](),controller['destroy']);module[_0x05b1('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index d03b257..ba147ca 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 _0xd6f6=['sequelize','exports','STRING','TEXT','long'];(function(_0x3ee947,_0x41bf7c){var _0x4b4721=function(_0x2233b1){while(--_0x2233b1){_0x3ee947['push'](_0x3ee947['shift']());}};_0x4b4721(++_0x41bf7c);}(_0xd6f6,0x19a));var _0x6d6f=function(_0x3eb300,_0x36ce78){_0x3eb300=_0x3eb300-0x0;var _0x53df4f=_0xd6f6[_0x3eb300];return _0x53df4f;};'use strict';var Sequelize=require(_0x6d6f('0x0'));module[_0x6d6f('0x1')]={'question':{'type':Sequelize[_0x6d6f('0x2')]},'answer':{'type':Sequelize[_0x6d6f('0x3')](_0x6d6f('0x4'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x6d6f('0x2')]},'calleridname':{'type':Sequelize[_0x6d6f('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x6d6f('0x2')]}}; \ No newline at end of file +var _0xacb7=['TEXT','exports','STRING'];(function(_0x3137c1,_0x535382){var _0x195276=function(_0x118f8b){while(--_0x118f8b){_0x3137c1['push'](_0x3137c1['shift']());}};_0x195276(++_0x535382);}(_0xacb7,0xfd));var _0x7acb=function(_0x43e0fd,_0x4a4f46){_0x43e0fd=_0x43e0fd-0x0;var _0x334c72=_0xacb7[_0x43e0fd];return _0x334c72;};'use strict';var Sequelize=require('sequelize');module[_0x7acb('0x0')]={'question':{'type':Sequelize[_0x7acb('0x1')]},'answer':{'type':Sequelize[_0x7acb('0x2')]('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x7acb('0x1')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x7acb('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7acb('0x1')]},'questionId':{'type':Sequelize[_0x7acb('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 088c183..c3e1da3 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 _0xe124=['../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xe124,0x81));var _0x4e12=function(_0x3b59fd,_0x39cd4b){_0x3b59fd=_0x3b59fd-0x0;var _0x1e7c57=_0xe124[_0x3b59fd];return _0x1e7c57;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4e12('0x0'));var rimraf=require(_0x4e12('0x1'));var zipdir=require(_0x4e12('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4e12('0x3'));var moment=require('moment');var BPromise=require(_0x4e12('0x4'));var Mustache=require(_0x4e12('0x5'));var util=require(_0x4e12('0x6'));var path=require(_0x4e12('0x7'));var sox=require(_0x4e12('0x8'));var csv=require(_0x4e12('0x9'));var ejs=require(_0x4e12('0xa'));var fs=require('fs');var _=require(_0x4e12('0xb'));var squel=require(_0x4e12('0xc'));var crypto=require(_0x4e12('0xd'));var jsforce=require(_0x4e12('0xe'));var deskjs=require(_0x4e12('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4e12('0x10'));var Papa=require('papaparse');var Redis=require(_0x4e12('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4e12('0x12'));var hardwareService=require(_0x4e12('0x13'));var logger=require(_0x4e12('0x14'))(_0x4e12('0x15'));var utils=require(_0x4e12('0x16'));var config=require(_0x4e12('0x17'));var db=require(_0x4e12('0x18'))['db'];function respondWithStatusCode(_0x5e2062,_0x5cdf04){_0x5cdf04=_0x5cdf04||0xcc;return function(_0x296941){if(_0x296941){return _0x5e2062[_0x4e12('0x19')](_0x5cdf04);}return _0x5e2062[_0x4e12('0x1a')](_0x5cdf04)['end']();};}function respondWithResult(_0x68ef17,_0x111c33){_0x111c33=_0x111c33||0xc8;return function(_0x588487){if(_0x588487){return _0x68ef17['status'](_0x111c33)['json'](_0x588487);}};}function respondWithFilteredResult(_0x3ed6d4,_0x374385){return function(_0x1de08e){if(_0x1de08e){var _0x2ad353=_0x1de08e[_0x4e12('0x1b')],_0x103554=_0x374385[_0x4e12('0x1c')],_0x1126d6=_0x374385[_0x4e12('0x1c')]+_0x374385[_0x4e12('0x1d')],_0x36cdb0;if(_0x1126d6>=_0x2ad353){_0x1126d6=_0x2ad353;_0x36cdb0=0xc8;}else{_0x36cdb0=0xce;}_0x3ed6d4[_0x4e12('0x1a')](_0x36cdb0);return _0x3ed6d4[_0x4e12('0x1e')](_0x4e12('0x1f'),_0x103554+'-'+_0x1126d6+'/'+_0x2ad353)[_0x4e12('0x20')](_0x1de08e);}return null;};}function patchUpdates(_0x12c741){return function(_0x5c5ae6){try{jsonpatch[_0x4e12('0x21')](_0x5c5ae6,_0x12c741,!![]);}catch(_0x108738){return BPromise[_0x4e12('0x22')](_0x108738);}return _0x5c5ae6['save']();};}function saveUpdates(_0x5dd91e,_0xcbd836){return function(_0x4f1595){if(_0x4f1595){return _0x4f1595[_0x4e12('0x23')](_0x5dd91e)[_0x4e12('0x24')](function(_0x14da87){return _0x14da87;});}return null;};}function removeEntity(_0x5cdbd7,_0x99b197){return function(_0x1d6418){if(_0x1d6418){return _0x1d6418[_0x4e12('0x25')]()[_0x4e12('0x24')](function(){_0x5cdbd7[_0x4e12('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5067a4,_0x32daae){return function(_0xf1d16f){if(!_0xf1d16f){_0x5067a4['sendStatus'](0x194);}return _0xf1d16f;};}function handleError(_0x169c2b,_0x43843e){_0x43843e=_0x43843e||0x1f4;return function(_0x4f728e){logger[_0x4e12('0x26')](_0x4f728e[_0x4e12('0x27')]);if(_0x4f728e[_0x4e12('0x28')]){delete _0x4f728e[_0x4e12('0x28')];}_0x169c2b[_0x4e12('0x1a')](_0x43843e)[_0x4e12('0x29')](_0x4f728e);};}exports[_0x4e12('0x2a')]=function(_0x5f5231,_0x11df77){var _0x27840d={},_0x45444e={},_0x5570b5={'count':0x0,'rows':[]};var _0x15250a=_[_0x4e12('0x2b')](db[_0x4e12('0x2c')][_0x4e12('0x2d')],function(_0x1b156c){return{'name':_0x1b156c['fieldName'],'type':_0x1b156c[_0x4e12('0x2e')][_0x4e12('0x2f')]};});_0x45444e[_0x4e12('0x30')]=_[_0x4e12('0x2b')](_0x15250a,_0x4e12('0x28'));_0x45444e[_0x4e12('0x31')]=_[_0x4e12('0x32')](_0x5f5231[_0x4e12('0x31')]);_0x45444e[_0x4e12('0x33')]=_[_0x4e12('0x34')](_0x45444e[_0x4e12('0x30')],_0x45444e[_0x4e12('0x31')]);_0x27840d[_0x4e12('0x35')]=_[_0x4e12('0x34')](_0x45444e[_0x4e12('0x30')],qs[_0x4e12('0x36')](_0x5f5231[_0x4e12('0x31')]['fields']));_0x27840d[_0x4e12('0x35')]=_0x27840d['attributes'][_0x4e12('0x37')]?_0x27840d[_0x4e12('0x35')]:_0x45444e[_0x4e12('0x30')];if(!_0x5f5231[_0x4e12('0x31')][_0x4e12('0x38')](_0x4e12('0x39'))){_0x27840d[_0x4e12('0x1d')]=qs[_0x4e12('0x1d')](_0x5f5231['query'][_0x4e12('0x1d')]);_0x27840d[_0x4e12('0x1c')]=qs[_0x4e12('0x1c')](_0x5f5231['query']['offset']);}_0x27840d[_0x4e12('0x3a')]=qs['sort'](_0x5f5231[_0x4e12('0x31')][_0x4e12('0x3b')]);_0x27840d[_0x4e12('0x3c')]=qs[_0x4e12('0x33')](_[_0x4e12('0x3d')](_0x5f5231[_0x4e12('0x31')],_0x45444e[_0x4e12('0x33')]),_0x15250a);if(_0x5f5231['query'][_0x4e12('0x3e')]){_0x27840d[_0x4e12('0x3c')]=_[_0x4e12('0x3f')](_0x27840d[_0x4e12('0x3c')],{'$or':_[_0x4e12('0x2b')](_0x15250a,function(_0x307fc5){if(_0x307fc5[_0x4e12('0x2e')]!=='VIRTUAL'){var _0x31e40c={};_0x31e40c[_0x307fc5[_0x4e12('0x28')]]={'$like':'%'+_0x5f5231[_0x4e12('0x31')]['filter']+'%'};return _0x31e40c;}})});}_0x27840d=_[_0x4e12('0x3f')]({},_0x27840d,_0x5f5231[_0x4e12('0x40')]);var _0x50cfd7={'where':_0x27840d['where']};return db[_0x4e12('0x2c')][_0x4e12('0x1b')](_0x50cfd7)['then'](function(_0x3e9f91){_0x5570b5[_0x4e12('0x1b')]=_0x3e9f91;if(_0x5f5231[_0x4e12('0x31')][_0x4e12('0x41')]){_0x27840d[_0x4e12('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x4e12('0x43')](_0x27840d);})[_0x4e12('0x24')](function(_0x220267){_0x5570b5[_0x4e12('0x44')]=_0x220267;return _0x5570b5;})[_0x4e12('0x24')](respondWithFilteredResult(_0x11df77,_0x27840d))[_0x4e12('0x45')](handleError(_0x11df77,null));};exports[_0x4e12('0x46')]=function(_0x26e25c,_0x5047de){var _0x565a05={'raw':!![],'where':{'id':_0x26e25c['params']['id']}},_0x1b9bd1={};_0x1b9bd1[_0x4e12('0x30')]=_[_0x4e12('0x32')](db[_0x4e12('0x2c')]['rawAttributes']);_0x1b9bd1[_0x4e12('0x31')]=_['keys'](_0x26e25c[_0x4e12('0x31')]);_0x1b9bd1[_0x4e12('0x33')]=_[_0x4e12('0x34')](_0x1b9bd1[_0x4e12('0x30')],_0x1b9bd1[_0x4e12('0x31')]);_0x565a05[_0x4e12('0x35')]=_['intersection'](_0x1b9bd1[_0x4e12('0x30')],qs['fields'](_0x26e25c[_0x4e12('0x31')][_0x4e12('0x36')]));_0x565a05[_0x4e12('0x35')]=_0x565a05[_0x4e12('0x35')][_0x4e12('0x37')]?_0x565a05[_0x4e12('0x35')]:_0x1b9bd1[_0x4e12('0x30')];if(_0x26e25c[_0x4e12('0x31')]['includeAll']){_0x565a05[_0x4e12('0x42')]=[{'all':!![]}];}_0x565a05=_[_0x4e12('0x3f')]({},_0x565a05,_0x26e25c[_0x4e12('0x40')]);return db[_0x4e12('0x2c')][_0x4e12('0x47')](_0x565a05)[_0x4e12('0x24')](handleEntityNotFound(_0x5047de,null))[_0x4e12('0x24')](respondWithResult(_0x5047de,null))[_0x4e12('0x45')](handleError(_0x5047de,null));};exports[_0x4e12('0x48')]=function(_0x2fba88,_0x324858){return db[_0x4e12('0x2c')][_0x4e12('0x48')](_0x2fba88['body'],{})[_0x4e12('0x24')](respondWithResult(_0x324858,0xc9))[_0x4e12('0x45')](handleError(_0x324858,null));};exports[_0x4e12('0x23')]=function(_0x2f1031,_0x43b9d8){if(_0x2f1031[_0x4e12('0x49')]['id']){delete _0x2f1031[_0x4e12('0x49')]['id'];}return db['JscriptyAnswerReport'][_0x4e12('0x47')]({'where':{'id':_0x2f1031['params']['id']}})[_0x4e12('0x24')](handleEntityNotFound(_0x43b9d8,null))[_0x4e12('0x24')](saveUpdates(_0x2f1031['body'],null))[_0x4e12('0x24')](respondWithResult(_0x43b9d8,null))['catch'](handleError(_0x43b9d8,null));};exports[_0x4e12('0x25')]=function(_0x5a380b,_0xeb58c){return db[_0x4e12('0x2c')]['find']({'where':{'id':_0x5a380b[_0x4e12('0x4a')]['id']}})['then'](handleEntityNotFound(_0xeb58c,null))[_0x4e12('0x24')](removeEntity(_0xeb58c,null))['catch'](handleError(_0xeb58c,null));};exports[_0x4e12('0x4b')]=function(_0x2aac24,_0x437e34){return db[_0x4e12('0x2c')][_0x4e12('0x4b')]()[_0x4e12('0x24')](respondWithResult(_0x437e34,null))[_0x4e12('0x45')](handleError(_0x437e34,null));}; \ No newline at end of file +var _0xd749=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','json','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','offset','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','html-pdf','rimraf','zip-dir','request-promise','bluebird','sox'];(function(_0x441563,_0x1d4a28){var _0x2369ec=function(_0x1f97ba){while(--_0x1f97ba){_0x441563['push'](_0x441563['shift']());}};_0x2369ec(++_0x1d4a28);}(_0xd749,0x11e));var _0x9d74=function(_0x3fd7f5,_0x49e460){_0x3fd7f5=_0x3fd7f5-0x0;var _0x2281a5=_0xd749[_0x3fd7f5];return _0x2281a5;};'use strict';var pdf=require(_0x9d74('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9d74('0x1'));var zipdir=require(_0x9d74('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9d74('0x3'));var moment=require('moment');var BPromise=require(_0x9d74('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9d74('0x5'));var csv=require(_0x9d74('0x6'));var ejs=require(_0x9d74('0x7'));var fs=require('fs');var _=require(_0x9d74('0x8'));var squel=require(_0x9d74('0x9'));var crypto=require(_0x9d74('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x9d74('0xb'));var toCsv=require(_0x9d74('0x6'));var querystring=require(_0x9d74('0xc'));var Papa=require(_0x9d74('0xd'));var Redis=require('ioredis');var authService=require(_0x9d74('0xe'));var qs=require(_0x9d74('0xf'));var as=require(_0x9d74('0x10'));var hardwareService=require(_0x9d74('0x11'));var logger=require(_0x9d74('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9d74('0x13'));var db=require(_0x9d74('0x14'))['db'];function respondWithStatusCode(_0x1d94da,_0x3b436c){_0x3b436c=_0x3b436c||0xcc;return function(_0x4fd269){if(_0x4fd269){return _0x1d94da['sendStatus'](_0x3b436c);}return _0x1d94da[_0x9d74('0x15')](_0x3b436c)[_0x9d74('0x16')]();};}function respondWithResult(_0x3b38c9,_0x3a90b6){_0x3a90b6=_0x3a90b6||0xc8;return function(_0x109d5e){if(_0x109d5e){return _0x3b38c9[_0x9d74('0x15')](_0x3a90b6)[_0x9d74('0x17')](_0x109d5e);}};}function respondWithFilteredResult(_0x14a9c4,_0x4e3938){return function(_0x301a34){if(_0x301a34){var _0x13833b=_0x301a34['count'],_0x572c4d=_0x4e3938['offset'],_0x2baf3d=_0x4e3938['offset']+_0x4e3938['limit'],_0x202e5a;if(_0x2baf3d>=_0x13833b){_0x2baf3d=_0x13833b;_0x202e5a=0xc8;}else{_0x202e5a=0xce;}_0x14a9c4['status'](_0x202e5a);return _0x14a9c4[_0x9d74('0x18')]('Content-Range',_0x572c4d+'-'+_0x2baf3d+'/'+_0x13833b)[_0x9d74('0x17')](_0x301a34);}return null;};}function patchUpdates(_0x1dd9eb){return function(_0x1eaded){try{jsonpatch[_0x9d74('0x19')](_0x1eaded,_0x1dd9eb,!![]);}catch(_0x4fcf76){return BPromise[_0x9d74('0x1a')](_0x4fcf76);}return _0x1eaded[_0x9d74('0x1b')]();};}function saveUpdates(_0x2c59df,_0x30cbf9){return function(_0x40ecd7){if(_0x40ecd7){return _0x40ecd7[_0x9d74('0x1c')](_0x2c59df)[_0x9d74('0x1d')](function(_0x510f08){return _0x510f08;});}return null;};}function removeEntity(_0x117e54,_0x4de102){return function(_0x2a54b5){if(_0x2a54b5){return _0x2a54b5['destroy']()[_0x9d74('0x1d')](function(){_0x117e54[_0x9d74('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33c73c,_0x37e500){return function(_0x7fbe82){if(!_0x7fbe82){_0x33c73c[_0x9d74('0x1e')](0x194);}return _0x7fbe82;};}function handleError(_0x2c453f,_0x563fc5){_0x563fc5=_0x563fc5||0x1f4;return function(_0x4e88ac){logger[_0x9d74('0x1f')](_0x4e88ac[_0x9d74('0x20')]);if(_0x4e88ac[_0x9d74('0x21')]){delete _0x4e88ac['name'];}_0x2c453f[_0x9d74('0x15')](_0x563fc5)[_0x9d74('0x22')](_0x4e88ac);};}exports[_0x9d74('0x23')]=function(_0x4061df,_0x17b262){var _0x2fe25c={},_0x52545c={},_0x5e103e={'count':0x0,'rows':[]};var _0x543643=_[_0x9d74('0x24')](db[_0x9d74('0x25')][_0x9d74('0x26')],function(_0x4fcb08){return{'name':_0x4fcb08[_0x9d74('0x27')],'type':_0x4fcb08[_0x9d74('0x28')][_0x9d74('0x29')]};});_0x52545c['model']=_[_0x9d74('0x24')](_0x543643,_0x9d74('0x21'));_0x52545c[_0x9d74('0x2a')]=_[_0x9d74('0x2b')](_0x4061df['query']);_0x52545c[_0x9d74('0x2c')]=_[_0x9d74('0x2d')](_0x52545c[_0x9d74('0x2e')],_0x52545c['query']);_0x2fe25c['attributes']=_['intersection'](_0x52545c[_0x9d74('0x2e')],qs[_0x9d74('0x2f')](_0x4061df[_0x9d74('0x2a')][_0x9d74('0x2f')]));_0x2fe25c[_0x9d74('0x30')]=_0x2fe25c['attributes'][_0x9d74('0x31')]?_0x2fe25c[_0x9d74('0x30')]:_0x52545c[_0x9d74('0x2e')];if(!_0x4061df[_0x9d74('0x2a')][_0x9d74('0x32')]('nolimit')){_0x2fe25c[_0x9d74('0x33')]=qs[_0x9d74('0x33')](_0x4061df['query'][_0x9d74('0x33')]);_0x2fe25c[_0x9d74('0x34')]=qs[_0x9d74('0x34')](_0x4061df[_0x9d74('0x2a')][_0x9d74('0x34')]);}_0x2fe25c[_0x9d74('0x35')]=qs[_0x9d74('0x36')](_0x4061df[_0x9d74('0x2a')][_0x9d74('0x36')]);_0x2fe25c[_0x9d74('0x37')]=qs['filters'](_[_0x9d74('0x38')](_0x4061df['query'],_0x52545c[_0x9d74('0x2c')]),_0x543643);if(_0x4061df[_0x9d74('0x2a')][_0x9d74('0x39')]){_0x2fe25c[_0x9d74('0x37')]=_[_0x9d74('0x3a')](_0x2fe25c[_0x9d74('0x37')],{'$or':_[_0x9d74('0x24')](_0x543643,function(_0x1a2f6d){if(_0x1a2f6d[_0x9d74('0x28')]!=='VIRTUAL'){var _0x6aed2={};_0x6aed2[_0x1a2f6d['name']]={'$like':'%'+_0x4061df[_0x9d74('0x2a')][_0x9d74('0x39')]+'%'};return _0x6aed2;}})});}_0x2fe25c=_[_0x9d74('0x3a')]({},_0x2fe25c,_0x4061df[_0x9d74('0x3b')]);var _0x3fb65a={'where':_0x2fe25c[_0x9d74('0x37')]};return db['JscriptyAnswerReport'][_0x9d74('0x3c')](_0x3fb65a)[_0x9d74('0x1d')](function(_0x49cac5){_0x5e103e[_0x9d74('0x3c')]=_0x49cac5;if(_0x4061df['query'][_0x9d74('0x3d')]){_0x2fe25c[_0x9d74('0x3e')]=[{'all':!![]}];}return db[_0x9d74('0x25')][_0x9d74('0x3f')](_0x2fe25c);})[_0x9d74('0x1d')](function(_0x24806f){_0x5e103e[_0x9d74('0x40')]=_0x24806f;return _0x5e103e;})[_0x9d74('0x1d')](respondWithFilteredResult(_0x17b262,_0x2fe25c))[_0x9d74('0x41')](handleError(_0x17b262,null));};exports[_0x9d74('0x42')]=function(_0x555339,_0x528ad2){var _0x405bac={'raw':!![],'where':{'id':_0x555339[_0x9d74('0x43')]['id']}},_0x38ab1f={};_0x38ab1f[_0x9d74('0x2e')]=_[_0x9d74('0x2b')](db[_0x9d74('0x25')][_0x9d74('0x26')]);_0x38ab1f['query']=_[_0x9d74('0x2b')](_0x555339['query']);_0x38ab1f[_0x9d74('0x2c')]=_[_0x9d74('0x2d')](_0x38ab1f[_0x9d74('0x2e')],_0x38ab1f[_0x9d74('0x2a')]);_0x405bac[_0x9d74('0x30')]=_[_0x9d74('0x2d')](_0x38ab1f['model'],qs[_0x9d74('0x2f')](_0x555339[_0x9d74('0x2a')][_0x9d74('0x2f')]));_0x405bac[_0x9d74('0x30')]=_0x405bac[_0x9d74('0x30')][_0x9d74('0x31')]?_0x405bac['attributes']:_0x38ab1f[_0x9d74('0x2e')];if(_0x555339[_0x9d74('0x2a')][_0x9d74('0x3d')]){_0x405bac['include']=[{'all':!![]}];}_0x405bac=_[_0x9d74('0x3a')]({},_0x405bac,_0x555339[_0x9d74('0x3b')]);return db[_0x9d74('0x25')][_0x9d74('0x44')](_0x405bac)[_0x9d74('0x1d')](handleEntityNotFound(_0x528ad2,null))[_0x9d74('0x1d')](respondWithResult(_0x528ad2,null))[_0x9d74('0x41')](handleError(_0x528ad2,null));};exports[_0x9d74('0x45')]=function(_0x4d6b97,_0x27a3e8){return db[_0x9d74('0x25')][_0x9d74('0x45')](_0x4d6b97[_0x9d74('0x46')],{})[_0x9d74('0x1d')](respondWithResult(_0x27a3e8,0xc9))['catch'](handleError(_0x27a3e8,null));};exports[_0x9d74('0x1c')]=function(_0x441628,_0x4727b1){if(_0x441628[_0x9d74('0x46')]['id']){delete _0x441628[_0x9d74('0x46')]['id'];}return db[_0x9d74('0x25')][_0x9d74('0x44')]({'where':{'id':_0x441628[_0x9d74('0x43')]['id']}})[_0x9d74('0x1d')](handleEntityNotFound(_0x4727b1,null))[_0x9d74('0x1d')](saveUpdates(_0x441628['body'],null))['then'](respondWithResult(_0x4727b1,null))[_0x9d74('0x41')](handleError(_0x4727b1,null));};exports[_0x9d74('0x47')]=function(_0x4a67cf,_0x2814a9){return db[_0x9d74('0x25')]['find']({'where':{'id':_0x4a67cf['params']['id']}})['then'](handleEntityNotFound(_0x2814a9,null))[_0x9d74('0x1d')](removeEntity(_0x2814a9,null))[_0x9d74('0x41')](handleError(_0x2814a9,null));};exports[_0x9d74('0x48')]=function(_0x3d2c61,_0x56cafe){return db[_0x9d74('0x25')][_0x9d74('0x48')]()[_0x9d74('0x1d')](respondWithResult(_0x56cafe,null))['catch'](handleError(_0x56cafe,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index ffe8e23..3a135b7 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 _0x5990=['exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0xd63e3a,_0x1bd6eb){var _0x19c178=function(_0x56be0d){while(--_0x56be0d){_0xd63e3a['push'](_0xd63e3a['shift']());}};_0x19c178(++_0x1bd6eb);}(_0x5990,0x16f));var _0x0599=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5990[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0599('0x0'));var util=require(_0x0599('0x1'));var logger=require(_0x0599('0x2'))(_0x0599('0x3'));var moment=require(_0x0599('0x4'));var BPromise=require(_0x0599('0x5'));var rp=require(_0x0599('0x6'));var fs=require('fs');var path=require(_0x0599('0x7'));var rimraf=require('rimraf');var config=require(_0x0599('0x8'));var attributes=require(_0x0599('0x9'));module[_0x0599('0xa')]=function(_0x5dcd06,_0x15f25c){return _0x5dcd06['define'](_0x0599('0xb'),attributes,{'tableName':_0x0599('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2286=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define'];(function(_0x3349b2,_0x431492){var _0x15fd84=function(_0x3c9f79){while(--_0x3c9f79){_0x3349b2['push'](_0x3349b2['shift']());}};_0x15fd84(++_0x431492);}(_0x2286,0x8f));var _0x6228=function(_0x40eabd,_0x174cff){_0x40eabd=_0x40eabd-0x0;var _0x3f8769=_0x2286[_0x40eabd];return _0x3f8769;};'use strict';var _=require(_0x6228('0x0'));var util=require(_0x6228('0x1'));var logger=require(_0x6228('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6228('0x3'));var rp=require(_0x6228('0x4'));var fs=require('fs');var path=require(_0x6228('0x5'));var rimraf=require(_0x6228('0x6'));var config=require(_0x6228('0x7'));var attributes=require(_0x6228('0x8'));module[_0x6228('0x9')]=function(_0x5bb3a5,_0x3a3a5d){return _0x5bb3a5[_0x6228('0xa')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 439f237..4c73597 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 _0x96ac=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x37f94e,_0x59de8e){var _0xdf2908=function(_0x2401b5){while(--_0x2401b5){_0x37f94e['push'](_0x37f94e['shift']());}};_0xdf2908(++_0x59de8e);}(_0x96ac,0x129));var _0xc96a=function(_0x421f24,_0x2a4fba){_0x421f24=_0x421f24-0x0;var _0x37424c=_0x96ac[_0x421f24];return _0x37424c;};'use strict';var _=require(_0xc96a('0x0'));var util=require(_0xc96a('0x1'));var moment=require(_0xc96a('0x2'));var BPromise=require(_0xc96a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc96a('0x4'));var db=require(_0xc96a('0x5'))['db'];var utils=require(_0xc96a('0x6'));var logger=require('../../config/logger')(_0xc96a('0x7'));var config=require('../../config/environment');var jayson=require(_0xc96a('0x8'));var client=jayson['client'][_0xc96a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2514f4,_0x50f46f,_0x33573b){return new BPromise(function(_0x1da6bf,_0x3f9864){return client['request'](_0x2514f4,_0x33573b)[_0xc96a('0xa')](function(_0x10e482){logger[_0xc96a('0xb')](_0xc96a('0xc'),_0x50f46f,'request\x20sent');logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x50f46f,_0xc96a('0xd'),JSON[_0xc96a('0xe')](_0x10e482));if(_0x10e482[_0xc96a('0xf')]){if(_0x10e482[_0xc96a('0xf')][_0xc96a('0x10')]===0x1f4){logger[_0xc96a('0xf')](_0xc96a('0xc'),_0x50f46f,_0x10e482[_0xc96a('0xf')][_0xc96a('0x11')]);return _0x3f9864(_0x10e482['error'][_0xc96a('0x11')]);}logger[_0xc96a('0xf')](_0xc96a('0xc'),_0x50f46f,_0x10e482['error'][_0xc96a('0x11')]);return _0x1da6bf(_0x10e482['error'][_0xc96a('0x11')]);}else{logger[_0xc96a('0xb')](_0xc96a('0xc'),_0x50f46f,'request\x20sent');_0x1da6bf(_0x10e482[_0xc96a('0x12')][_0xc96a('0x11')]);}})[_0xc96a('0x13')](function(_0x5c3ba5){logger[_0xc96a('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x50f46f,_0x5c3ba5);_0x3f9864(_0x5c3ba5);});});} \ No newline at end of file +var _0x2a3e=['then','request\x20sent','debug','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x26de92,_0x17137e){var _0x56ab01=function(_0x112cfe){while(--_0x112cfe){_0x26de92['push'](_0x26de92['shift']());}};_0x56ab01(++_0x17137e);}(_0x2a3e,0x11e));var _0xe2a3=function(_0x439aaf,_0x2ec9ad){_0x439aaf=_0x439aaf-0x0;var _0xc3144f=_0x2a3e[_0x439aaf];return _0xc3144f;};'use strict';var _=require(_0xe2a3('0x0'));var util=require(_0xe2a3('0x1'));var moment=require(_0xe2a3('0x2'));var BPromise=require(_0xe2a3('0x3'));var rs=require(_0xe2a3('0x4'));var fs=require('fs');var Redis=require(_0xe2a3('0x5'));var db=require(_0xe2a3('0x6'))['db'];var utils=require(_0xe2a3('0x7'));var logger=require(_0xe2a3('0x8'))('rpc');var config=require(_0xe2a3('0x9'));var jayson=require(_0xe2a3('0xa'));var client=jayson[_0xe2a3('0xb')][_0xe2a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d6503,_0xddf673,_0x45df3c){return new BPromise(function(_0x227513,_0x35688a){return client[_0xe2a3('0xd')](_0x3d6503,_0x45df3c)[_0xe2a3('0xe')](function(_0xb50830){logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0xddf673,_0xe2a3('0xf'));logger[_0xe2a3('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0xddf673,'request\x20sent',JSON[_0xe2a3('0x11')](_0xb50830));if(_0xb50830['error']){if(_0xb50830[_0xe2a3('0x12')][_0xe2a3('0x13')]===0x1f4){logger[_0xe2a3('0x12')](_0xe2a3('0x14'),_0xddf673,_0xb50830[_0xe2a3('0x12')][_0xe2a3('0x15')]);return _0x35688a(_0xb50830[_0xe2a3('0x12')][_0xe2a3('0x15')]);}logger[_0xe2a3('0x12')](_0xe2a3('0x14'),_0xddf673,_0xb50830[_0xe2a3('0x12')][_0xe2a3('0x15')]);return _0x227513(_0xb50830[_0xe2a3('0x12')][_0xe2a3('0x15')]);}else{logger[_0xe2a3('0x16')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xddf673,_0xe2a3('0xf'));_0x227513(_0xb50830[_0xe2a3('0x17')][_0xe2a3('0x15')]);}})[_0xe2a3('0x18')](function(_0xdac72b){logger['error'](_0xe2a3('0x14'),_0xddf673,_0xdac72b);_0x35688a(_0xdac72b);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index ee01e69..01a7a8e 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 _0x46e0=['getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','update','destroy','exports','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','/:id/answers'];(function(_0x5c5d93,_0x5e6648){var _0x5a4519=function(_0xecd4fe){while(--_0xecd4fe){_0x5c5d93['push'](_0x5c5d93['shift']());}};_0x5a4519(++_0x5e6648);}(_0x46e0,0x1d7));var _0x046e=function(_0x3cecdc,_0x2f394b){_0x3cecdc=_0x3cecdc-0x0;var _0x5823e6=_0x46e0[_0x3cecdc];return _0x5823e6;};'use strict';var multer=require(_0x046e('0x0'));var util=require('util');var path=require(_0x046e('0x1'));var timeout=require(_0x046e('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x046e('0x3'));var config=require(_0x046e('0x4'));var controller=require(_0x046e('0x5'));router[_0x046e('0x6')]('/',auth[_0x046e('0x7')](),controller[_0x046e('0x8')]);router[_0x046e('0x6')](_0x046e('0x9'),auth['isAuthenticated'](),controller[_0x046e('0xa')]);router[_0x046e('0x6')]('/:id/sessions',auth[_0x046e('0x7')](),controller['getSessions']);router[_0x046e('0x6')](_0x046e('0xb'),auth[_0x046e('0x7')](),controller[_0x046e('0xc')]);router[_0x046e('0x6')](_0x046e('0xd'),auth[_0x046e('0x7')](),timeout(_0x046e('0xe')),controller[_0x046e('0xf')]);router[_0x046e('0x10')]('/',auth['isAuthenticated'](),controller[_0x046e('0x11')]);router['post'](_0x046e('0x12'),auth[_0x046e('0x7')](),controller[_0x046e('0x13')]);router['put'](_0x046e('0x9'),auth[_0x046e('0x7')](),controller[_0x046e('0x14')]);router['delete']('/:id',auth[_0x046e('0x7')](),controller[_0x046e('0x15')]);module[_0x046e('0x16')]=router; \ No newline at end of file +var _0x363e=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','/:id/clone','clone','put','/:id','update','delete','destroy','multer'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x363e,0x179));var _0xe363=function(_0x39bb09,_0xe9a313){_0x39bb09=_0x39bb09-0x0;var _0x473096=_0x363e[_0x39bb09];return _0x473096;};'use strict';var multer=require(_0xe363('0x0'));var util=require(_0xe363('0x1'));var path=require('path');var timeout=require(_0xe363('0x2'));var express=require(_0xe363('0x3'));var router=express[_0xe363('0x4')]();var auth=require(_0xe363('0x5'));var interaction=require(_0xe363('0x6'));var config=require(_0xe363('0x7'));var controller=require(_0xe363('0x8'));router[_0xe363('0x9')]('/',auth[_0xe363('0xa')](),controller[_0xe363('0xb')]);router[_0xe363('0x9')]('/:id',auth[_0xe363('0xa')](),controller[_0xe363('0xc')]);router[_0xe363('0x9')](_0xe363('0xd'),auth['isAuthenticated'](),controller[_0xe363('0xe')]);router[_0xe363('0x9')](_0xe363('0xf'),auth[_0xe363('0xa')](),controller[_0xe363('0x10')]);router[_0xe363('0x9')](_0xe363('0x11'),auth['isAuthenticated'](),timeout(_0xe363('0x12')),controller[_0xe363('0x13')]);router['post']('/',auth[_0xe363('0xa')](),controller['create']);router['post'](_0xe363('0x14'),auth[_0xe363('0xa')](),controller[_0xe363('0x15')]);router[_0xe363('0x16')](_0xe363('0x17'),auth['isAuthenticated'](),controller[_0xe363('0x18')]);router[_0xe363('0x19')]('/:id',auth[_0xe363('0xa')](),controller[_0xe363('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 4570288..abed9fb 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 _0x42dc=['stringify','isString','name','getDataValue','BOOLEAN','sequelize','lodash','util','STRING','TEXT','long','isObjectLike','setDataValue','formData'];(function(_0x1e2aae,_0x2349e3){var _0x4d8a43=function(_0x305d4c){while(--_0x305d4c){_0x1e2aae['push'](_0x1e2aae['shift']());}};_0x4d8a43(++_0x2349e3);}(_0x42dc,0x1d3));var _0xc42d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x42dc[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc42d('0x0'));var _=require(_0xc42d('0x1'));var util=require(_0xc42d('0x2'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xc42d('0x3')]},'formData':{'type':Sequelize[_0xc42d('0x4')](_0xc42d('0x5')),'set':function(_0x5d6333){if(_[_0xc42d('0x6')](_0x5d6333)){this[_0xc42d('0x7')](_0xc42d('0x8'),JSON[_0xc42d('0x9')](_0x5d6333));}else if(_[_0xc42d('0xa')](_0x5d6333)){this[_0xc42d('0x7')](_0xc42d('0x8'),_0x5d6333);}else{this[_0xc42d('0x7')](_0xc42d('0x8'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this['getDataValue'](_0xc42d('0xb'))||'',this[_0xc42d('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xc42d('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xc42d('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x1ca1=['lodash','util','exports','STRING','name','TEXT','long','setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN'];(function(_0x217b76,_0x4f806d){var _0xe74b7=function(_0x2f9b80){while(--_0x2f9b80){_0x217b76['push'](_0x217b76['shift']());}};_0xe74b7(++_0x4f806d);}(_0x1ca1,0x12c));var _0x11ca=function(_0x8b902e,_0x2cdbdf){_0x8b902e=_0x8b902e-0x0;var _0x25f63a=_0x1ca1[_0x8b902e];return _0x25f63a;};'use strict';var Sequelize=require('sequelize');var _=require(_0x11ca('0x0'));var util=require(_0x11ca('0x1'));module[_0x11ca('0x2')]={'name':{'type':Sequelize[_0x11ca('0x3')],'unique':_0x11ca('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x11ca('0x5')](_0x11ca('0x6')),'set':function(_0x120214){if(_['isObjectLike'](_0x120214)){this[_0x11ca('0x7')](_0x11ca('0x8'),JSON[_0x11ca('0x9')](_0x120214));}else if(_[_0x11ca('0xa')](_0x120214)){this['setDataValue'](_0x11ca('0x8'),_0x120214);}else{this[_0x11ca('0x7')](_0x11ca('0x8'),util['format'](_0x11ca('0xb'),this['getDataValue'](_0x11ca('0x4'))||'',this[_0x11ca('0xc')](_0x11ca('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x11ca('0xe')],'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 5a61c92..7c5b16f 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 _0x3f3b=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','userProfileId','error','getSessions','JscriptySessionReport','nolimit','ProjectId','findOne','JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','starttime','parse','startTime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','setHeader','Content-type','text/csv','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','update','then','get','Projects','UserProfileResource','stack','name','index','map','rawAttributes','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyProject','includeAll','include','findAll','rows','catch','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation'];(function(_0x3f2186,_0x37a65a){var _0x345637=function(_0xc74417){while(--_0xc74417){_0x3f2186['push'](_0x3f2186['shift']());}};_0x345637(++_0x37a65a);}(_0x3f3b,0x17b));var _0xb3f3=function(_0x785376,_0x1d4576){_0x785376=_0x785376-0x0;var _0x2bb87b=_0x3f3b[_0x785376];return _0x2bb87b;};'use strict';var pdf=require(_0xb3f3('0x0'));var emlformat=require(_0xb3f3('0x1'));var rimraf=require(_0xb3f3('0x2'));var zipdir=require(_0xb3f3('0x3'));var jsonpatch=require(_0xb3f3('0x4'));var rp=require(_0xb3f3('0x5'));var moment=require(_0xb3f3('0x6'));var BPromise=require(_0xb3f3('0x7'));var Mustache=require(_0xb3f3('0x8'));var util=require(_0xb3f3('0x9'));var path=require(_0xb3f3('0xa'));var sox=require(_0xb3f3('0xb'));var csv=require(_0xb3f3('0xc'));var ejs=require(_0xb3f3('0xd'));var fs=require('fs');var _=require(_0xb3f3('0xe'));var squel=require(_0xb3f3('0xf'));var crypto=require(_0xb3f3('0x10'));var jsforce=require('jsforce');var deskjs=require(_0xb3f3('0x11'));var toCsv=require(_0xb3f3('0xc'));var querystring=require(_0xb3f3('0x12'));var Papa=require(_0xb3f3('0x13'));var Redis=require(_0xb3f3('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb3f3('0x15'));var hardwareService=require(_0xb3f3('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xb3f3('0x17'));var config=require(_0xb3f3('0x18'));var db=require(_0xb3f3('0x19'))['db'];function respondWithStatusCode(_0x19bdbb,_0x56537f){_0x56537f=_0x56537f||0xcc;return function(_0x3e514e){if(_0x3e514e){return _0x19bdbb[_0xb3f3('0x1a')](_0x56537f);}return _0x19bdbb[_0xb3f3('0x1b')](_0x56537f)[_0xb3f3('0x1c')]();};}function respondWithResult(_0x1d7db8,_0x3e2667){_0x3e2667=_0x3e2667||0xc8;return function(_0x563752){if(_0x563752){return _0x1d7db8[_0xb3f3('0x1b')](_0x3e2667)[_0xb3f3('0x1d')](_0x563752);}};}function respondWithFilteredResult(_0x2293d9,_0x3b998f){return function(_0x1d3ce1){if(_0x1d3ce1){var _0x272ee0=_0x1d3ce1[_0xb3f3('0x1e')],_0x1a0fad=_0x3b998f[_0xb3f3('0x1f')],_0x5addfd=_0x3b998f['offset']+_0x3b998f['limit'],_0x2014c6;if(_0x5addfd>=_0x272ee0){_0x5addfd=_0x272ee0;_0x2014c6=0xc8;}else{_0x2014c6=0xce;}_0x2293d9['status'](_0x2014c6);return _0x2293d9[_0xb3f3('0x20')](_0xb3f3('0x21'),_0x1a0fad+'-'+_0x5addfd+'/'+_0x272ee0)[_0xb3f3('0x1d')](_0x1d3ce1);}return null;};}function patchUpdates(_0xa8ca46){return function(_0x4e48bb){try{jsonpatch[_0xb3f3('0x22')](_0x4e48bb,_0xa8ca46,!![]);}catch(_0x2ce116){return BPromise['reject'](_0x2ce116);}return _0x4e48bb['save']();};}function saveUpdates(_0xe66834,_0x2bcbe3){return function(_0x3bb5ce){if(_0x3bb5ce){return _0x3bb5ce[_0xb3f3('0x23')](_0xe66834)[_0xb3f3('0x24')](function(_0x3c62b5){return _0x3c62b5;});}return null;};}function removeEntity(_0x278f00,_0x5d4e87){return function(_0x28152f){if(_0x28152f){return _0x28152f['destroy']()[_0xb3f3('0x24')](function(){var _0x3e1c12=_0x28152f[_0xb3f3('0x25')]({'plain':!![]});var _0x5c0b85=_0xb3f3('0x26');return db[_0xb3f3('0x27')]['destroy']({'where':{'type':_0x5c0b85,'resourceId':_0x3e1c12['id']}})['then'](function(){return _0x28152f;});})[_0xb3f3('0x24')](function(){_0x278f00[_0xb3f3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x151bfb,_0x3d83a0){return function(_0x21fdba){if(!_0x21fdba){_0x151bfb[_0xb3f3('0x1a')](0x194);}return _0x21fdba;};}function handleError(_0x4c063b,_0x1b995b){_0x1b995b=_0x1b995b||0x1f4;return function(_0x274db4){logger['error'](_0x274db4[_0xb3f3('0x28')]);if(_0x274db4[_0xb3f3('0x29')]){delete _0x274db4[_0xb3f3('0x29')];}_0x4c063b[_0xb3f3('0x1b')](_0x1b995b)['send'](_0x274db4);};}exports[_0xb3f3('0x2a')]=function(_0xcd975f,_0xd1351b){var _0x380353={},_0x177dfb={},_0x3fc6a5={'count':0x0,'rows':[]};var _0x2c0aef=_[_0xb3f3('0x2b')](db['JscriptyProject'][_0xb3f3('0x2c')],function(_0x441b77){return{'name':_0x441b77['fieldName'],'type':_0x441b77[_0xb3f3('0x2d')]['key']};});_0x177dfb[_0xb3f3('0x2e')]=_[_0xb3f3('0x2b')](_0x2c0aef,_0xb3f3('0x29'));_0x177dfb['query']=_[_0xb3f3('0x2f')](_0xcd975f[_0xb3f3('0x30')]);_0x177dfb[_0xb3f3('0x31')]=_[_0xb3f3('0x32')](_0x177dfb[_0xb3f3('0x2e')],_0x177dfb[_0xb3f3('0x30')]);_0x380353[_0xb3f3('0x33')]=_['intersection'](_0x177dfb[_0xb3f3('0x2e')],qs[_0xb3f3('0x34')](_0xcd975f[_0xb3f3('0x30')][_0xb3f3('0x34')]));_0x380353[_0xb3f3('0x33')]=_0x380353[_0xb3f3('0x33')][_0xb3f3('0x35')]?_0x380353[_0xb3f3('0x33')]:_0x177dfb['model'];if(!_0xcd975f[_0xb3f3('0x30')][_0xb3f3('0x36')]('nolimit')){_0x380353[_0xb3f3('0x37')]=qs[_0xb3f3('0x37')](_0xcd975f[_0xb3f3('0x30')][_0xb3f3('0x37')]);_0x380353[_0xb3f3('0x1f')]=qs['offset'](_0xcd975f[_0xb3f3('0x30')][_0xb3f3('0x1f')]);}_0x380353[_0xb3f3('0x38')]=qs[_0xb3f3('0x39')](_0xcd975f[_0xb3f3('0x30')][_0xb3f3('0x39')]);_0x380353[_0xb3f3('0x3a')]=qs[_0xb3f3('0x31')](_[_0xb3f3('0x3b')](_0xcd975f[_0xb3f3('0x30')],_0x177dfb['filters']),_0x2c0aef);if(_0xcd975f[_0xb3f3('0x30')][_0xb3f3('0x3c')]){_0x380353[_0xb3f3('0x3a')]=_[_0xb3f3('0x3d')](_0x380353['where'],{'$or':_[_0xb3f3('0x2b')](_0x2c0aef,function(_0x447dc8){if(_0x447dc8[_0xb3f3('0x2d')]!==_0xb3f3('0x3e')){var _0x8b065d={};_0x8b065d[_0x447dc8[_0xb3f3('0x29')]]={'$like':'%'+_0xcd975f[_0xb3f3('0x30')][_0xb3f3('0x3c')]+'%'};return _0x8b065d;}})});}_0x380353=_[_0xb3f3('0x3d')]({},_0x380353,_0xcd975f[_0xb3f3('0x3f')]);var _0x56e430={'where':_0x380353['where']};return db[_0xb3f3('0x40')][_0xb3f3('0x1e')](_0x56e430)[_0xb3f3('0x24')](function(_0x583e16){_0x3fc6a5[_0xb3f3('0x1e')]=_0x583e16;if(_0xcd975f['query'][_0xb3f3('0x41')]){_0x380353[_0xb3f3('0x42')]=[{'all':!![]}];}return db['JscriptyProject'][_0xb3f3('0x43')](_0x380353);})[_0xb3f3('0x24')](function(_0x592242){_0x3fc6a5[_0xb3f3('0x44')]=_0x592242;return _0x3fc6a5;})[_0xb3f3('0x24')](respondWithFilteredResult(_0xd1351b,_0x380353))[_0xb3f3('0x45')](handleError(_0xd1351b,null));};exports['show']=function(_0x1ce00f,_0x4410a8){var _0xbc2c72={'raw':![],'where':{'id':_0x1ce00f['params']['id']}},_0x5aa431={};_0x5aa431[_0xb3f3('0x2e')]=_[_0xb3f3('0x2f')](db[_0xb3f3('0x40')][_0xb3f3('0x2c')]);_0x5aa431['query']=_[_0xb3f3('0x2f')](_0x1ce00f[_0xb3f3('0x30')]);_0x5aa431[_0xb3f3('0x31')]=_[_0xb3f3('0x32')](_0x5aa431[_0xb3f3('0x2e')],_0x5aa431[_0xb3f3('0x30')]);_0xbc2c72[_0xb3f3('0x33')]=_[_0xb3f3('0x32')](_0x5aa431[_0xb3f3('0x2e')],qs[_0xb3f3('0x34')](_0x1ce00f[_0xb3f3('0x30')][_0xb3f3('0x34')]));_0xbc2c72[_0xb3f3('0x33')]=_0xbc2c72[_0xb3f3('0x33')][_0xb3f3('0x35')]?_0xbc2c72['attributes']:_0x5aa431['model'];if(_0x1ce00f[_0xb3f3('0x30')]['includeAll']){_0xbc2c72['include']=[{'all':!![]}];}_0xbc2c72=_[_0xb3f3('0x3d')]({},_0xbc2c72,_0x1ce00f[_0xb3f3('0x3f')]);return db[_0xb3f3('0x40')][_0xb3f3('0x46')](_0xbc2c72)[_0xb3f3('0x24')](handleEntityNotFound(_0x4410a8,null))['then'](respondWithResult(_0x4410a8,null))[_0xb3f3('0x45')](handleError(_0x4410a8,null));};exports[_0xb3f3('0x47')]=function(_0x1e2909,_0x34d2c7){return db['JscriptyProject'][_0xb3f3('0x47')](_0x1e2909[_0xb3f3('0x48')],{})[_0xb3f3('0x24')](function(_0x5efdb8){var _0x6260ab=_0x1e2909[_0xb3f3('0x49')][_0xb3f3('0x25')]({'plain':!![]});if(!_0x6260ab)throw new Error(_0xb3f3('0x4a'));if(_0x6260ab['role']==='user'){var _0x33298a=_0x5efdb8[_0xb3f3('0x25')]({'plain':!![]});var _0x15a630=_0xb3f3('0x26');return db[_0xb3f3('0x4b')]['find']({'where':{'name':_0x15a630,'userProfileId':_0x6260ab['userProfileId']},'raw':!![]})['then'](function(_0x57b838){if(_0x57b838&&_0x57b838[_0xb3f3('0x4c')]===0x0){return db[_0xb3f3('0x27')][_0xb3f3('0x47')]({'name':_0x33298a[_0xb3f3('0x29')],'resourceId':_0x33298a['id'],'type':_0x57b838[_0xb3f3('0x29')],'sectionId':_0x57b838['id']},{})[_0xb3f3('0x24')](function(){return _0x5efdb8;});}else{return _0x5efdb8;}})[_0xb3f3('0x45')](function(_0x23a633){logger['error'](_0xb3f3('0x4d'),_0x23a633);throw _0x23a633;});}return _0x5efdb8;})[_0xb3f3('0x24')](respondWithResult(_0x34d2c7,0xc9))['catch'](handleError(_0x34d2c7,null));};exports[_0xb3f3('0x4e')]=function(_0x2f5e93,_0x426ab7){var _0x9835c7={'where':{'id':_0x2f5e93[_0xb3f3('0x4f')]['id']}},_0x4080bf={};_0x4080bf[_0xb3f3('0x2e')]=_[_0xb3f3('0x2f')](db[_0xb3f3('0x40')][_0xb3f3('0x2c')]);_0x9835c7['attributes']=_['intersection'](_0x4080bf['model'],qs['fields'](_0x2f5e93[_0xb3f3('0x30')][_0xb3f3('0x34')]));_0x9835c7[_0xb3f3('0x33')]=_0x9835c7[_0xb3f3('0x33')]['length']?_0x9835c7[_0xb3f3('0x33')]:_0x4080bf[_0xb3f3('0x2e')];if(_0x2f5e93[_0xb3f3('0x30')]['includeAll']){_0x9835c7[_0xb3f3('0x42')]=[{'all':!![]}];}_0x9835c7=_[_0xb3f3('0x3d')]({},_0x9835c7,_0x2f5e93['options']);return db[_0xb3f3('0x40')][_0xb3f3('0x46')](_0x9835c7)['then'](handleEntityNotFound(_0x426ab7,null))['then'](function(_0xcbd4f1){if(_0xcbd4f1){var _0x1bff1c=_0xcbd4f1[_0xb3f3('0x25')]({'plain':!![]});_0x1bff1c=qs[_0xb3f3('0x50')](_0x1bff1c,['id',_0xb3f3('0x51'),_0xb3f3('0x52')]);_0x2f5e93[_0xb3f3('0x48')]=_[_0xb3f3('0x50')](_0x2f5e93[_0xb3f3('0x48')],['id',_0xb3f3('0x51'),_0xb3f3('0x52')]);return db['JscriptyProject'][_0xb3f3('0x47')](_[_0xb3f3('0x3d')](_0x1bff1c,_0x2f5e93[_0xb3f3('0x48')]),{'include':_0x2f5e93['query'][_0xb3f3('0x41')]?[{'all':!![]}]:undefined})[_0xb3f3('0x24')](function(_0x41708b){var _0x1cf60b=_0x2f5e93[_0xb3f3('0x49')][_0xb3f3('0x25')]({'plain':!![]});if(!_0x1cf60b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1cf60b['role']===_0xb3f3('0x49')){var _0x48d6f9=_0x41708b[_0xb3f3('0x25')]({'plain':!![]});var _0x21006d=_0xb3f3('0x26');return db[_0xb3f3('0x4b')][_0xb3f3('0x46')]({'where':{'name':_0x21006d,'userProfileId':_0x1cf60b[_0xb3f3('0x53')]},'raw':!![]})[_0xb3f3('0x24')](function(_0xaf585f){if(_0xaf585f&&_0xaf585f['autoAssociation']===0x0){return db[_0xb3f3('0x27')][_0xb3f3('0x47')]({'name':_0x48d6f9[_0xb3f3('0x29')],'resourceId':_0x48d6f9['id'],'type':_0xaf585f[_0xb3f3('0x29')],'sectionId':_0xaf585f['id']},{})[_0xb3f3('0x24')](function(){return _0x41708b;});}else{return _0x41708b;}})[_0xb3f3('0x45')](function(_0x39c46e){logger[_0xb3f3('0x54')](_0xb3f3('0x4d'),_0x39c46e);throw _0x39c46e;});}return _0x41708b;});}})[_0xb3f3('0x24')](respondWithResult(_0x426ab7,0xc9))[_0xb3f3('0x45')](handleError(_0x426ab7,null));};exports['update']=function(_0x1aa5fe,_0x2b459b){if(_0x1aa5fe[_0xb3f3('0x48')]['id']){delete _0x1aa5fe[_0xb3f3('0x48')]['id'];}return db[_0xb3f3('0x40')][_0xb3f3('0x46')]({'where':{'id':_0x1aa5fe['params']['id']}})[_0xb3f3('0x24')](handleEntityNotFound(_0x2b459b,null))[_0xb3f3('0x24')](saveUpdates(_0x1aa5fe[_0xb3f3('0x48')],null))['then'](respondWithResult(_0x2b459b,null))[_0xb3f3('0x45')](handleError(_0x2b459b,null));};exports['destroy']=function(_0x5f4b8a,_0x5bb8ef){return db[_0xb3f3('0x40')][_0xb3f3('0x46')]({'where':{'id':_0x5f4b8a[_0xb3f3('0x4f')]['id']}})[_0xb3f3('0x24')](handleEntityNotFound(_0x5bb8ef,null))[_0xb3f3('0x24')](removeEntity(_0x5bb8ef,null))[_0xb3f3('0x45')](handleError(_0x5bb8ef,null));};exports[_0xb3f3('0x55')]=function(_0x495f6d,_0x18f42a,_0x25a66c){var _0x58ce90={'raw':!![],'where':{}};var _0x67fc28={};var _0x3a1dd2={'count':0x0,'rows':[]};return db[_0xb3f3('0x40')]['findOne']({'where':{'id':_0x495f6d[_0xb3f3('0x4f')]['id']}})['then'](handleEntityNotFound(_0x18f42a,null))[_0xb3f3('0x24')](function(_0x26d75a){if(_0x26d75a){_0x67fc28['model']=_[_0xb3f3('0x2f')](db[_0xb3f3('0x56')]['rawAttributes']);_0x67fc28[_0xb3f3('0x30')]=_[_0xb3f3('0x2f')](_0x495f6d[_0xb3f3('0x30')]);_0x67fc28[_0xb3f3('0x31')]=_[_0xb3f3('0x32')](_0x67fc28['model'],_0x67fc28[_0xb3f3('0x30')]);_0x58ce90[_0xb3f3('0x33')]=_[_0xb3f3('0x32')](_0x67fc28['model'],qs['fields'](_0x495f6d[_0xb3f3('0x30')][_0xb3f3('0x34')]));_0x58ce90[_0xb3f3('0x33')]=_0x58ce90[_0xb3f3('0x33')][_0xb3f3('0x35')]?_0x58ce90[_0xb3f3('0x33')]:_0x67fc28[_0xb3f3('0x2e')];if(!_0x495f6d[_0xb3f3('0x30')][_0xb3f3('0x36')](_0xb3f3('0x57'))){_0x58ce90['limit']=qs[_0xb3f3('0x37')](_0x495f6d['query'][_0xb3f3('0x37')]);_0x58ce90['offset']=qs[_0xb3f3('0x1f')](_0x495f6d[_0xb3f3('0x30')][_0xb3f3('0x1f')]);}_0x58ce90[_0xb3f3('0x38')]=qs[_0xb3f3('0x39')](_0x495f6d[_0xb3f3('0x30')][_0xb3f3('0x39')]);_0x58ce90[_0xb3f3('0x3a')]=qs[_0xb3f3('0x31')](_[_0xb3f3('0x3b')](_0x495f6d['query'],_0x67fc28[_0xb3f3('0x31')]));_0x58ce90['where'][_0xb3f3('0x58')]=_0x26d75a['id'];if(_0x495f6d['query'][_0xb3f3('0x3c')]){_0x58ce90['where']=_[_0xb3f3('0x3d')](_0x58ce90['where'],{'$or':_[_0xb3f3('0x2b')](_0x58ce90[_0xb3f3('0x33')],function(_0x5915dc){var _0x317023={};_0x317023[_0x5915dc]={'$like':'%'+_0x495f6d['query'][_0xb3f3('0x3c')]+'%'};return _0x317023;})});}_0x58ce90=_[_0xb3f3('0x3d')]({},_0x58ce90,_0x495f6d['options']);return db[_0xb3f3('0x56')]['count']({'where':_0x58ce90[_0xb3f3('0x3a')]})[_0xb3f3('0x24')](function(_0x1ce8a1){_0x3a1dd2[_0xb3f3('0x1e')]=_0x1ce8a1;if(_0x495f6d[_0xb3f3('0x30')]['includeAll']){_0x58ce90['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xb3f3('0x43')](_0x58ce90);})[_0xb3f3('0x24')](function(_0x4a6730){_0x3a1dd2[_0xb3f3('0x44')]=_0x4a6730;return _0x3a1dd2;});}})[_0xb3f3('0x24')](respondWithFilteredResult(_0x18f42a,_0x58ce90))[_0xb3f3('0x45')](handleError(_0x18f42a,null));};exports['getAnswers']=function(_0x53a1a2,_0x5e493d,_0x4f1a75){var _0x47eb6f={'raw':!![],'where':{}};var _0x315088={};var _0x3a33e1={'count':0x0,'rows':[]};return db[_0xb3f3('0x40')][_0xb3f3('0x59')]({'where':{'id':_0x53a1a2['params']['id']}})[_0xb3f3('0x24')](handleEntityNotFound(_0x5e493d,null))[_0xb3f3('0x24')](function(_0x50feb8){if(_0x50feb8){_0x315088[_0xb3f3('0x2e')]=_[_0xb3f3('0x2f')](db[_0xb3f3('0x5a')][_0xb3f3('0x2c')]);_0x315088[_0xb3f3('0x30')]=_[_0xb3f3('0x2f')](_0x53a1a2[_0xb3f3('0x30')]);_0x315088['filters']=_[_0xb3f3('0x32')](_0x315088['model'],_0x315088[_0xb3f3('0x30')]);_0x47eb6f[_0xb3f3('0x33')]=_[_0xb3f3('0x32')](_0x315088['model'],qs[_0xb3f3('0x34')](_0x53a1a2[_0xb3f3('0x30')][_0xb3f3('0x34')]));_0x47eb6f[_0xb3f3('0x33')]=_0x47eb6f[_0xb3f3('0x33')]['length']?_0x47eb6f[_0xb3f3('0x33')]:_0x315088['model'];if(!_0x53a1a2[_0xb3f3('0x30')][_0xb3f3('0x36')](_0xb3f3('0x57'))){_0x47eb6f['limit']=qs[_0xb3f3('0x37')](_0x53a1a2[_0xb3f3('0x30')][_0xb3f3('0x37')]);_0x47eb6f[_0xb3f3('0x1f')]=qs[_0xb3f3('0x1f')](_0x53a1a2[_0xb3f3('0x30')][_0xb3f3('0x1f')]);}_0x47eb6f[_0xb3f3('0x38')]=qs[_0xb3f3('0x39')](_0x53a1a2[_0xb3f3('0x30')][_0xb3f3('0x39')]);_0x47eb6f[_0xb3f3('0x3a')]=qs['filters'](_['pick'](_0x53a1a2[_0xb3f3('0x30')],_0x315088[_0xb3f3('0x31')]));_0x47eb6f['where']['ProjectId']=_0x50feb8['id'];if(_0x53a1a2[_0xb3f3('0x30')]['filter']){_0x47eb6f[_0xb3f3('0x3a')]=_[_0xb3f3('0x3d')](_0x47eb6f['where'],{'$or':_[_0xb3f3('0x2b')](_0x47eb6f[_0xb3f3('0x33')],function(_0x14283c){var _0x508f0d={};_0x508f0d[_0x14283c]={'$like':'%'+_0x53a1a2['query']['filter']+'%'};return _0x508f0d;})});}_0x47eb6f=_[_0xb3f3('0x3d')]({},_0x47eb6f,_0x53a1a2[_0xb3f3('0x3f')]);return db[_0xb3f3('0x5a')][_0xb3f3('0x1e')]({'where':_0x47eb6f[_0xb3f3('0x3a')]})['then'](function(_0x188598){_0x3a33e1[_0xb3f3('0x1e')]=_0x188598;if(_0x53a1a2['query'][_0xb3f3('0x41')]){_0x47eb6f[_0xb3f3('0x42')]=[{'all':!![]}];}return db[_0xb3f3('0x5a')]['findAll'](_0x47eb6f);})['then'](function(_0x14035d){_0x3a33e1[_0xb3f3('0x44')]=_0x14035d;return _0x3a33e1;});}})[_0xb3f3('0x24')](respondWithFilteredResult(_0x5e493d,_0x47eb6f))[_0xb3f3('0x45')](handleError(_0x5e493d,null));};function char(_0x1eb2c5){return _0xb3f3('0x5b')===typeof _0x1eb2c5?String[_0xb3f3('0x5c')][_0xb3f3('0x22')](null,arguments):_0x1eb2c5;}function needsEncapsulation(_0x127f70){return!!_0x127f70&&(_0x127f70['toString']()[_0xb3f3('0x5d')](char(0xd))>=0x0||_0x127f70[_0xb3f3('0x5e')]()['indexOf'](char(0xa))>=0x0||_0x127f70[_0xb3f3('0x5e')]()['indexOf'](char(0x2c))>=0x0||_0x127f70[_0xb3f3('0x5e')]()[_0xb3f3('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x68ee1a){var _0x1eb19f=char(0x22),_0x221617='\x5c'+char(0x22),_0x5a81e8=_0x68ee1a['toString']()[_0xb3f3('0x5f')](new RegExp(_0x1eb19f,'g'),_0x221617);return _0x1eb19f+_0x5a81e8+_0x1eb19f;}exports['getSummary']=function(_0x4543e8,_0x57e0fd,_0x5416da){var _0x560b7e,_0x330a95;var _0x160f87={'where':{'ProjectId':_0x4543e8[_0xb3f3('0x4f')]['id']}};if(_0x4543e8[_0xb3f3('0x30')]['startTime']){_0x160f87[_0xb3f3('0x3a')][_0xb3f3('0x60')]=JSON[_0xb3f3('0x61')](_0x4543e8[_0xb3f3('0x30')][_0xb3f3('0x62')]);}return db['JscriptySessionReport'][_0xb3f3('0x43')](_0x160f87)['then'](handleEntityNotFound(_0x57e0fd,null))[_0xb3f3('0x24')](function(_0xed106c){if(_0xed106c){_0x560b7e=_0xed106c;return db['JscriptyQuestionReport'][_0xb3f3('0x43')]({'where':{'SessionId':{'$in':_['map'](_0x560b7e,'id')},'ProjectId':_0x4543e8['params']['id']},'order':_0xb3f3('0x63')});}})[_0xb3f3('0x24')](handleEntityNotFound(_0x57e0fd,null))[_0xb3f3('0x24')](function(_0x33ec59){if(_0x33ec59){_0x330a95=_0x33ec59;var _0xd69b4={};for(var _0x45edca=0x0,_0x35594f=_0x330a95['length'];_0x45edca<_0x35594f;_0x45edca++){if(!_0xd69b4[_0xb3f3('0x36')](_0x330a95[_0x45edca][_0xb3f3('0x64')])){_0xd69b4[_0x330a95[_0x45edca][_0xb3f3('0x64')]]=needsEncapsulation(_0x330a95[_0x45edca][_0xb3f3('0x65')])?encapsulate(_0x330a95[_0x45edca]['question']):_0x330a95[_0x45edca]['question'];}}var _0x1060e5=[],_0x5204eb={};for(var _0x34ea01=0x0,_0xfd5f36=_0x560b7e[_0xb3f3('0x35')];_0x34ea01<_0xfd5f36;_0x34ea01++){_0x5204eb={'ProjectId':_0x4543e8[_0xb3f3('0x4f')]['id'],'SessionId':_0x560b7e[_0x34ea01]['id'],'StartTime':moment(_0x560b7e[_0x34ea01][_0xb3f3('0x60')])[_0xb3f3('0x66')](_0xb3f3('0x67'))};for(var _0xd021b0=0x0,_0x5ae540=_0x330a95[_0xb3f3('0x35')];_0xd021b0<_0x5ae540;_0xd021b0++){if(_0x330a95[_0xd021b0][_0xb3f3('0x68')]==_0x560b7e[_0x34ea01]['id']&&_0xd69b4['hasOwnProperty'](_0x330a95[_0xd021b0][_0xb3f3('0x64')])){_0x5204eb[_0xd69b4[_0x330a95[_0xd021b0][_0xb3f3('0x64')]]]=_0x330a95[_0xd021b0][_0xb3f3('0x69')];}}for(var _0x4dc75d in _0xd69b4){if(!_0x5204eb[_0xb3f3('0x36')](_0xd69b4[_0x4dc75d])){_0x5204eb[_0xd69b4[_0x4dc75d]]=null;}}_0x1060e5['push'](_0x5204eb);}return _0x1060e5;}})['then'](function(_0x4db5b3){if(!_[_0xb3f3('0x6a')](_0x4db5b3)){var _0x18a78f=toCsv(_0x4db5b3);var _0x32d28=Date[_0xb3f3('0x6b')]();fs['writeFileSync'](util['format'](_0xb3f3('0x6c'),_0x4543e8['params']['id'],_0x32d28),_0x18a78f);_0x57e0fd['setHeader'](_0xb3f3('0x6d'),_0xb3f3('0x6e')+util[_0xb3f3('0x66')]('Jscripty_Project_%d_Summary_%s.csv',_0x4543e8[_0xb3f3('0x4f')]['id'],_0x32d28));_0x57e0fd[_0xb3f3('0x6f')](_0xb3f3('0x70'),_0xb3f3('0x71'));return _0x57e0fd['download'](util[_0xb3f3('0x66')](_0xb3f3('0x6c'),_0x4543e8[_0xb3f3('0x4f')]['id'],_0x32d28));}else{return _0x57e0fd[_0xb3f3('0x1a')](0xcc);}})[_0xb3f3('0x45')](handleError(_0x57e0fd,null));}; \ No newline at end of file +var _0xbfd6=['intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','type','VIRTUAL','filter','include','findAll','rows','catch','show','params','keys','includeAll','find','create','role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','options','createdAt','body','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','push','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','reject','save','update','destroy','then','get','Projects','UserProfileResource','sendStatus','name','index','JscriptyProject','rawAttributes','fieldName','key','model','map','query','filters','attributes'];(function(_0x377621,_0x456b93){var _0x5dca84=function(_0x446302){while(--_0x446302){_0x377621['push'](_0x377621['shift']());}};_0x5dca84(++_0x456b93);}(_0xbfd6,0x12b));var _0x6bfd=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbfd6[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require(_0x6bfd('0x0'));var emlformat=require(_0x6bfd('0x1'));var rimraf=require(_0x6bfd('0x2'));var zipdir=require(_0x6bfd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6bfd('0x4'));var moment=require(_0x6bfd('0x5'));var BPromise=require(_0x6bfd('0x6'));var Mustache=require(_0x6bfd('0x7'));var util=require(_0x6bfd('0x8'));var path=require(_0x6bfd('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6bfd('0xa'));var fs=require('fs');var _=require(_0x6bfd('0xb'));var squel=require(_0x6bfd('0xc'));var crypto=require(_0x6bfd('0xd'));var jsforce=require(_0x6bfd('0xe'));var deskjs=require(_0x6bfd('0xf'));var toCsv=require(_0x6bfd('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6bfd('0x11'));var authService=require(_0x6bfd('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6bfd('0x13'))('api');var utils=require(_0x6bfd('0x14'));var config=require(_0x6bfd('0x15'));var db=require(_0x6bfd('0x16'))['db'];function respondWithStatusCode(_0x1d8ebe,_0x5a78e0){_0x5a78e0=_0x5a78e0||0xcc;return function(_0x2e9643){if(_0x2e9643){return _0x1d8ebe['sendStatus'](_0x5a78e0);}return _0x1d8ebe['status'](_0x5a78e0)[_0x6bfd('0x17')]();};}function respondWithResult(_0xf84a62,_0x3c4b6b){_0x3c4b6b=_0x3c4b6b||0xc8;return function(_0x166460){if(_0x166460){return _0xf84a62[_0x6bfd('0x18')](_0x3c4b6b)[_0x6bfd('0x19')](_0x166460);}};}function respondWithFilteredResult(_0x1fd354,_0x5ac961){return function(_0x5c5fd8){if(_0x5c5fd8){var _0x212842=_0x5c5fd8[_0x6bfd('0x1a')],_0x1062da=_0x5ac961[_0x6bfd('0x1b')],_0xf0bba=_0x5ac961[_0x6bfd('0x1b')]+_0x5ac961['limit'],_0x4d4c8f;if(_0xf0bba>=_0x212842){_0xf0bba=_0x212842;_0x4d4c8f=0xc8;}else{_0x4d4c8f=0xce;}_0x1fd354[_0x6bfd('0x18')](_0x4d4c8f);return _0x1fd354[_0x6bfd('0x1c')]('Content-Range',_0x1062da+'-'+_0xf0bba+'/'+_0x212842)[_0x6bfd('0x19')](_0x5c5fd8);}return null;};}function patchUpdates(_0x39742c){return function(_0xcd6c3f){try{jsonpatch['apply'](_0xcd6c3f,_0x39742c,!![]);}catch(_0x224526){return BPromise[_0x6bfd('0x1d')](_0x224526);}return _0xcd6c3f[_0x6bfd('0x1e')]();};}function saveUpdates(_0x5c44ed,_0x32c4c3){return function(_0x5dd715){if(_0x5dd715){return _0x5dd715[_0x6bfd('0x1f')](_0x5c44ed)['then'](function(_0x4980d3){return _0x4980d3;});}return null;};}function removeEntity(_0x42f8e5,_0xf504f2){return function(_0x39b18c){if(_0x39b18c){return _0x39b18c[_0x6bfd('0x20')]()[_0x6bfd('0x21')](function(){var _0x25ff9d=_0x39b18c[_0x6bfd('0x22')]({'plain':!![]});var _0x44c6b5=_0x6bfd('0x23');return db[_0x6bfd('0x24')][_0x6bfd('0x20')]({'where':{'type':_0x44c6b5,'resourceId':_0x25ff9d['id']}})['then'](function(){return _0x39b18c;});})[_0x6bfd('0x21')](function(){_0x42f8e5[_0x6bfd('0x18')](0xcc)[_0x6bfd('0x17')]();});}};}function handleEntityNotFound(_0x322c03,_0x7452b){return function(_0x339ecc){if(!_0x339ecc){_0x322c03[_0x6bfd('0x25')](0x194);}return _0x339ecc;};}function handleError(_0x27ecf4,_0x291f0e){_0x291f0e=_0x291f0e||0x1f4;return function(_0x32fa31){logger['error'](_0x32fa31['stack']);if(_0x32fa31[_0x6bfd('0x26')]){delete _0x32fa31[_0x6bfd('0x26')];}_0x27ecf4[_0x6bfd('0x18')](_0x291f0e)['send'](_0x32fa31);};}exports[_0x6bfd('0x27')]=function(_0x411b43,_0x41961f){var _0x4df9b8={},_0x2d947c={},_0x508184={'count':0x0,'rows':[]};var _0x119ae5=_['map'](db[_0x6bfd('0x28')][_0x6bfd('0x29')],function(_0x598d9f){return{'name':_0x598d9f[_0x6bfd('0x2a')],'type':_0x598d9f['type'][_0x6bfd('0x2b')]};});_0x2d947c[_0x6bfd('0x2c')]=_[_0x6bfd('0x2d')](_0x119ae5,_0x6bfd('0x26'));_0x2d947c[_0x6bfd('0x2e')]=_['keys'](_0x411b43[_0x6bfd('0x2e')]);_0x2d947c[_0x6bfd('0x2f')]=_['intersection'](_0x2d947c[_0x6bfd('0x2c')],_0x2d947c[_0x6bfd('0x2e')]);_0x4df9b8[_0x6bfd('0x30')]=_[_0x6bfd('0x31')](_0x2d947c['model'],qs['fields'](_0x411b43[_0x6bfd('0x2e')][_0x6bfd('0x32')]));_0x4df9b8[_0x6bfd('0x30')]=_0x4df9b8[_0x6bfd('0x30')]['length']?_0x4df9b8[_0x6bfd('0x30')]:_0x2d947c['model'];if(!_0x411b43[_0x6bfd('0x2e')][_0x6bfd('0x33')](_0x6bfd('0x34'))){_0x4df9b8[_0x6bfd('0x35')]=qs['limit'](_0x411b43[_0x6bfd('0x2e')][_0x6bfd('0x35')]);_0x4df9b8[_0x6bfd('0x1b')]=qs[_0x6bfd('0x1b')](_0x411b43['query']['offset']);}_0x4df9b8[_0x6bfd('0x36')]=qs[_0x6bfd('0x37')](_0x411b43['query'][_0x6bfd('0x37')]);_0x4df9b8[_0x6bfd('0x38')]=qs['filters'](_[_0x6bfd('0x39')](_0x411b43[_0x6bfd('0x2e')],_0x2d947c['filters']),_0x119ae5);if(_0x411b43[_0x6bfd('0x2e')]['filter']){_0x4df9b8[_0x6bfd('0x38')]=_[_0x6bfd('0x3a')](_0x4df9b8[_0x6bfd('0x38')],{'$or':_['map'](_0x119ae5,function(_0x406e80){if(_0x406e80[_0x6bfd('0x3b')]!==_0x6bfd('0x3c')){var _0x1153e2={};_0x1153e2[_0x406e80[_0x6bfd('0x26')]]={'$like':'%'+_0x411b43[_0x6bfd('0x2e')][_0x6bfd('0x3d')]+'%'};return _0x1153e2;}})});}_0x4df9b8=_['merge']({},_0x4df9b8,_0x411b43['options']);var _0x4689f0={'where':_0x4df9b8[_0x6bfd('0x38')]};return db[_0x6bfd('0x28')][_0x6bfd('0x1a')](_0x4689f0)['then'](function(_0x5a1317){_0x508184[_0x6bfd('0x1a')]=_0x5a1317;if(_0x411b43['query']['includeAll']){_0x4df9b8[_0x6bfd('0x3e')]=[{'all':!![]}];}return db[_0x6bfd('0x28')][_0x6bfd('0x3f')](_0x4df9b8);})[_0x6bfd('0x21')](function(_0x81a88f){_0x508184[_0x6bfd('0x40')]=_0x81a88f;return _0x508184;})['then'](respondWithFilteredResult(_0x41961f,_0x4df9b8))[_0x6bfd('0x41')](handleError(_0x41961f,null));};exports[_0x6bfd('0x42')]=function(_0x4d95bc,_0x54178f){var _0xf96bc={'raw':![],'where':{'id':_0x4d95bc[_0x6bfd('0x43')]['id']}},_0xa5f8c4={};_0xa5f8c4[_0x6bfd('0x2c')]=_['keys'](db[_0x6bfd('0x28')][_0x6bfd('0x29')]);_0xa5f8c4[_0x6bfd('0x2e')]=_[_0x6bfd('0x44')](_0x4d95bc['query']);_0xa5f8c4['filters']=_['intersection'](_0xa5f8c4[_0x6bfd('0x2c')],_0xa5f8c4['query']);_0xf96bc[_0x6bfd('0x30')]=_[_0x6bfd('0x31')](_0xa5f8c4['model'],qs[_0x6bfd('0x32')](_0x4d95bc[_0x6bfd('0x2e')]['fields']));_0xf96bc[_0x6bfd('0x30')]=_0xf96bc['attributes']['length']?_0xf96bc[_0x6bfd('0x30')]:_0xa5f8c4[_0x6bfd('0x2c')];if(_0x4d95bc[_0x6bfd('0x2e')][_0x6bfd('0x45')]){_0xf96bc[_0x6bfd('0x3e')]=[{'all':!![]}];}_0xf96bc=_[_0x6bfd('0x3a')]({},_0xf96bc,_0x4d95bc['options']);return db['JscriptyProject'][_0x6bfd('0x46')](_0xf96bc)[_0x6bfd('0x21')](handleEntityNotFound(_0x54178f,null))[_0x6bfd('0x21')](respondWithResult(_0x54178f,null))[_0x6bfd('0x41')](handleError(_0x54178f,null));};exports[_0x6bfd('0x47')]=function(_0x3c3b5c,_0x1148bd){return db[_0x6bfd('0x28')][_0x6bfd('0x47')](_0x3c3b5c['body'],{})[_0x6bfd('0x21')](function(_0x2fa3cb){var _0x2b9b2d=_0x3c3b5c['user'][_0x6bfd('0x22')]({'plain':!![]});if(!_0x2b9b2d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2b9b2d[_0x6bfd('0x48')]===_0x6bfd('0x49')){var _0x476d6c=_0x2fa3cb[_0x6bfd('0x22')]({'plain':!![]});var _0x2ed6cf=_0x6bfd('0x23');return db['UserProfileSection'][_0x6bfd('0x46')]({'where':{'name':_0x2ed6cf,'userProfileId':_0x2b9b2d[_0x6bfd('0x4a')]},'raw':!![]})[_0x6bfd('0x21')](function(_0x37838c){if(_0x37838c&&_0x37838c[_0x6bfd('0x4b')]===0x0){return db[_0x6bfd('0x24')][_0x6bfd('0x47')]({'name':_0x476d6c['name'],'resourceId':_0x476d6c['id'],'type':_0x37838c[_0x6bfd('0x26')],'sectionId':_0x37838c['id']},{})[_0x6bfd('0x21')](function(){return _0x2fa3cb;});}else{return _0x2fa3cb;}})[_0x6bfd('0x41')](function(_0x5361e9){logger[_0x6bfd('0x4c')](_0x6bfd('0x4d'),_0x5361e9);throw _0x5361e9;});}return _0x2fa3cb;})[_0x6bfd('0x21')](respondWithResult(_0x1148bd,0xc9))[_0x6bfd('0x41')](handleError(_0x1148bd,null));};exports[_0x6bfd('0x4e')]=function(_0xf1ed2a,_0x31f0e1){var _0x225d44={'where':{'id':_0xf1ed2a[_0x6bfd('0x43')]['id']}},_0x54f4d1={};_0x54f4d1[_0x6bfd('0x2c')]=_['keys'](db[_0x6bfd('0x28')][_0x6bfd('0x29')]);_0x225d44[_0x6bfd('0x30')]=_[_0x6bfd('0x31')](_0x54f4d1[_0x6bfd('0x2c')],qs['fields'](_0xf1ed2a[_0x6bfd('0x2e')]['fields']));_0x225d44[_0x6bfd('0x30')]=_0x225d44['attributes'][_0x6bfd('0x4f')]?_0x225d44['attributes']:_0x54f4d1[_0x6bfd('0x2c')];if(_0xf1ed2a['query'][_0x6bfd('0x45')]){_0x225d44[_0x6bfd('0x3e')]=[{'all':!![]}];}_0x225d44=_[_0x6bfd('0x3a')]({},_0x225d44,_0xf1ed2a[_0x6bfd('0x50')]);return db[_0x6bfd('0x28')]['find'](_0x225d44)[_0x6bfd('0x21')](handleEntityNotFound(_0x31f0e1,null))['then'](function(_0x456118){if(_0x456118){var _0x9117d6=_0x456118[_0x6bfd('0x22')]({'plain':!![]});_0x9117d6=qs['omit'](_0x9117d6,['id',_0x6bfd('0x51'),'updatedAt']);_0xf1ed2a[_0x6bfd('0x52')]=_[_0x6bfd('0x53')](_0xf1ed2a[_0x6bfd('0x52')],['id',_0x6bfd('0x51'),_0x6bfd('0x54')]);return db[_0x6bfd('0x28')]['create'](_[_0x6bfd('0x3a')](_0x9117d6,_0xf1ed2a[_0x6bfd('0x52')]),{'include':_0xf1ed2a['query']['includeAll']?[{'all':!![]}]:undefined})[_0x6bfd('0x21')](function(_0x246aa4){var _0x3065dc=_0xf1ed2a[_0x6bfd('0x49')][_0x6bfd('0x22')]({'plain':!![]});if(!_0x3065dc)throw new Error(_0x6bfd('0x55'));if(_0x3065dc[_0x6bfd('0x48')]===_0x6bfd('0x49')){var _0x1109b7=_0x246aa4[_0x6bfd('0x22')]({'plain':!![]});var _0x410647=_0x6bfd('0x23');return db[_0x6bfd('0x56')][_0x6bfd('0x46')]({'where':{'name':_0x410647,'userProfileId':_0x3065dc[_0x6bfd('0x4a')]},'raw':!![]})[_0x6bfd('0x21')](function(_0x36b3ab){if(_0x36b3ab&&_0x36b3ab['autoAssociation']===0x0){return db['UserProfileResource'][_0x6bfd('0x47')]({'name':_0x1109b7['name'],'resourceId':_0x1109b7['id'],'type':_0x36b3ab[_0x6bfd('0x26')],'sectionId':_0x36b3ab['id']},{})[_0x6bfd('0x21')](function(){return _0x246aa4;});}else{return _0x246aa4;}})[_0x6bfd('0x41')](function(_0x439d86){logger['error'](_0x6bfd('0x4d'),_0x439d86);throw _0x439d86;});}return _0x246aa4;});}})[_0x6bfd('0x21')](respondWithResult(_0x31f0e1,0xc9))[_0x6bfd('0x41')](handleError(_0x31f0e1,null));};exports[_0x6bfd('0x1f')]=function(_0x8407c5,_0x1be72b){if(_0x8407c5[_0x6bfd('0x52')]['id']){delete _0x8407c5['body']['id'];}return db[_0x6bfd('0x28')][_0x6bfd('0x46')]({'where':{'id':_0x8407c5[_0x6bfd('0x43')]['id']}})[_0x6bfd('0x21')](handleEntityNotFound(_0x1be72b,null))[_0x6bfd('0x21')](saveUpdates(_0x8407c5['body'],null))[_0x6bfd('0x21')](respondWithResult(_0x1be72b,null))[_0x6bfd('0x41')](handleError(_0x1be72b,null));};exports['destroy']=function(_0x1ff42e,_0x5ce5e9){return db[_0x6bfd('0x28')]['find']({'where':{'id':_0x1ff42e['params']['id']}})['then'](handleEntityNotFound(_0x5ce5e9,null))[_0x6bfd('0x21')](removeEntity(_0x5ce5e9,null))[_0x6bfd('0x41')](handleError(_0x5ce5e9,null));};exports[_0x6bfd('0x57')]=function(_0x25d3c9,_0x3b4ad2,_0x3b7ecc){var _0x3af899={'raw':!![],'where':{}};var _0x22126c={};var _0x230bb4={'count':0x0,'rows':[]};return db[_0x6bfd('0x28')][_0x6bfd('0x58')]({'where':{'id':_0x25d3c9['params']['id']}})['then'](handleEntityNotFound(_0x3b4ad2,null))['then'](function(_0x5be611){if(_0x5be611){_0x22126c[_0x6bfd('0x2c')]=_[_0x6bfd('0x44')](db[_0x6bfd('0x59')][_0x6bfd('0x29')]);_0x22126c[_0x6bfd('0x2e')]=_[_0x6bfd('0x44')](_0x25d3c9[_0x6bfd('0x2e')]);_0x22126c[_0x6bfd('0x2f')]=_['intersection'](_0x22126c[_0x6bfd('0x2c')],_0x22126c[_0x6bfd('0x2e')]);_0x3af899[_0x6bfd('0x30')]=_[_0x6bfd('0x31')](_0x22126c['model'],qs[_0x6bfd('0x32')](_0x25d3c9[_0x6bfd('0x2e')]['fields']));_0x3af899[_0x6bfd('0x30')]=_0x3af899[_0x6bfd('0x30')][_0x6bfd('0x4f')]?_0x3af899[_0x6bfd('0x30')]:_0x22126c[_0x6bfd('0x2c')];if(!_0x25d3c9[_0x6bfd('0x2e')][_0x6bfd('0x33')](_0x6bfd('0x34'))){_0x3af899['limit']=qs[_0x6bfd('0x35')](_0x25d3c9['query'][_0x6bfd('0x35')]);_0x3af899[_0x6bfd('0x1b')]=qs[_0x6bfd('0x1b')](_0x25d3c9[_0x6bfd('0x2e')][_0x6bfd('0x1b')]);}_0x3af899[_0x6bfd('0x36')]=qs['sort'](_0x25d3c9[_0x6bfd('0x2e')][_0x6bfd('0x37')]);_0x3af899[_0x6bfd('0x38')]=qs[_0x6bfd('0x2f')](_['pick'](_0x25d3c9[_0x6bfd('0x2e')],_0x22126c['filters']));_0x3af899['where'][_0x6bfd('0x5a')]=_0x5be611['id'];if(_0x25d3c9[_0x6bfd('0x2e')]['filter']){_0x3af899[_0x6bfd('0x38')]=_['merge'](_0x3af899[_0x6bfd('0x38')],{'$or':_[_0x6bfd('0x2d')](_0x3af899[_0x6bfd('0x30')],function(_0x14047f){var _0x4044d6={};_0x4044d6[_0x14047f]={'$like':'%'+_0x25d3c9[_0x6bfd('0x2e')]['filter']+'%'};return _0x4044d6;})});}_0x3af899=_[_0x6bfd('0x3a')]({},_0x3af899,_0x25d3c9[_0x6bfd('0x50')]);return db[_0x6bfd('0x59')][_0x6bfd('0x1a')]({'where':_0x3af899[_0x6bfd('0x38')]})['then'](function(_0x5b1374){_0x230bb4['count']=_0x5b1374;if(_0x25d3c9[_0x6bfd('0x2e')][_0x6bfd('0x45')]){_0x3af899['include']=[{'all':!![]}];}return db[_0x6bfd('0x59')][_0x6bfd('0x3f')](_0x3af899);})[_0x6bfd('0x21')](function(_0x212134){_0x230bb4['rows']=_0x212134;return _0x230bb4;});}})[_0x6bfd('0x21')](respondWithFilteredResult(_0x3b4ad2,_0x3af899))[_0x6bfd('0x41')](handleError(_0x3b4ad2,null));};exports[_0x6bfd('0x5b')]=function(_0x160de8,_0x559167,_0x62539c){var _0xef6db3={'raw':!![],'where':{}};var _0x2784f7={};var _0x1ed917={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x6bfd('0x58')]({'where':{'id':_0x160de8[_0x6bfd('0x43')]['id']}})[_0x6bfd('0x21')](handleEntityNotFound(_0x559167,null))[_0x6bfd('0x21')](function(_0x47024a){if(_0x47024a){_0x2784f7[_0x6bfd('0x2c')]=_[_0x6bfd('0x44')](db['JscriptyAnswerReport'][_0x6bfd('0x29')]);_0x2784f7['query']=_['keys'](_0x160de8[_0x6bfd('0x2e')]);_0x2784f7[_0x6bfd('0x2f')]=_['intersection'](_0x2784f7['model'],_0x2784f7[_0x6bfd('0x2e')]);_0xef6db3[_0x6bfd('0x30')]=_[_0x6bfd('0x31')](_0x2784f7[_0x6bfd('0x2c')],qs[_0x6bfd('0x32')](_0x160de8[_0x6bfd('0x2e')][_0x6bfd('0x32')]));_0xef6db3[_0x6bfd('0x30')]=_0xef6db3['attributes']['length']?_0xef6db3[_0x6bfd('0x30')]:_0x2784f7['model'];if(!_0x160de8[_0x6bfd('0x2e')]['hasOwnProperty'](_0x6bfd('0x34'))){_0xef6db3[_0x6bfd('0x35')]=qs['limit'](_0x160de8[_0x6bfd('0x2e')]['limit']);_0xef6db3['offset']=qs[_0x6bfd('0x1b')](_0x160de8['query']['offset']);}_0xef6db3[_0x6bfd('0x36')]=qs[_0x6bfd('0x37')](_0x160de8[_0x6bfd('0x2e')][_0x6bfd('0x37')]);_0xef6db3['where']=qs['filters'](_[_0x6bfd('0x39')](_0x160de8[_0x6bfd('0x2e')],_0x2784f7['filters']));_0xef6db3[_0x6bfd('0x38')]['ProjectId']=_0x47024a['id'];if(_0x160de8['query'][_0x6bfd('0x3d')]){_0xef6db3['where']=_[_0x6bfd('0x3a')](_0xef6db3[_0x6bfd('0x38')],{'$or':_[_0x6bfd('0x2d')](_0xef6db3[_0x6bfd('0x30')],function(_0x50c295){var _0x15d17a={};_0x15d17a[_0x50c295]={'$like':'%'+_0x160de8[_0x6bfd('0x2e')][_0x6bfd('0x3d')]+'%'};return _0x15d17a;})});}_0xef6db3=_['merge']({},_0xef6db3,_0x160de8['options']);return db[_0x6bfd('0x5c')]['count']({'where':_0xef6db3[_0x6bfd('0x38')]})['then'](function(_0xe8be35){_0x1ed917[_0x6bfd('0x1a')]=_0xe8be35;if(_0x160de8[_0x6bfd('0x2e')]['includeAll']){_0xef6db3['include']=[{'all':!![]}];}return db[_0x6bfd('0x5c')][_0x6bfd('0x3f')](_0xef6db3);})['then'](function(_0x5b6871){_0x1ed917['rows']=_0x5b6871;return _0x1ed917;});}})[_0x6bfd('0x21')](respondWithFilteredResult(_0x559167,_0xef6db3))[_0x6bfd('0x41')](handleError(_0x559167,null));};function char(_0x457872){return'number'===typeof _0x457872?String[_0x6bfd('0x5d')]['apply'](null,arguments):_0x457872;}function needsEncapsulation(_0x56c816){return!!_0x56c816&&(_0x56c816[_0x6bfd('0x5e')]()[_0x6bfd('0x5f')](char(0xd))>=0x0||_0x56c816[_0x6bfd('0x5e')]()['indexOf'](char(0xa))>=0x0||_0x56c816[_0x6bfd('0x5e')]()[_0x6bfd('0x5f')](char(0x2c))>=0x0||_0x56c816[_0x6bfd('0x5e')]()[_0x6bfd('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x2a73de){var _0x4c542c=char(0x22),_0x36ca41='\x5c'+char(0x22),_0x13920e=_0x2a73de[_0x6bfd('0x5e')]()[_0x6bfd('0x60')](new RegExp(_0x4c542c,'g'),_0x36ca41);return _0x4c542c+_0x13920e+_0x4c542c;}exports[_0x6bfd('0x61')]=function(_0x344433,_0x55ca05,_0x16f68a){var _0x3a1058,_0x28a9b4;var _0x45e276={'where':{'ProjectId':_0x344433[_0x6bfd('0x43')]['id']}};if(_0x344433[_0x6bfd('0x2e')][_0x6bfd('0x62')]){_0x45e276[_0x6bfd('0x38')][_0x6bfd('0x63')]=JSON[_0x6bfd('0x64')](_0x344433['query'][_0x6bfd('0x62')]);}return db['JscriptySessionReport'][_0x6bfd('0x3f')](_0x45e276)['then'](handleEntityNotFound(_0x55ca05,null))['then'](function(_0x35c7bf){if(_0x35c7bf){_0x3a1058=_0x35c7bf;return db[_0x6bfd('0x65')][_0x6bfd('0x3f')]({'where':{'SessionId':{'$in':_[_0x6bfd('0x2d')](_0x3a1058,'id')},'ProjectId':_0x344433['params']['id']},'order':_0x6bfd('0x66')});}})[_0x6bfd('0x21')](handleEntityNotFound(_0x55ca05,null))[_0x6bfd('0x21')](function(_0x4e0cb1){if(_0x4e0cb1){_0x28a9b4=_0x4e0cb1;var _0x3fc8c5={};for(var _0x4f49a4=0x0,_0x44a821=_0x28a9b4[_0x6bfd('0x4f')];_0x4f49a4<_0x44a821;_0x4f49a4++){if(!_0x3fc8c5[_0x6bfd('0x33')](_0x28a9b4[_0x4f49a4][_0x6bfd('0x67')])){_0x3fc8c5[_0x28a9b4[_0x4f49a4][_0x6bfd('0x67')]]=needsEncapsulation(_0x28a9b4[_0x4f49a4][_0x6bfd('0x68')])?encapsulate(_0x28a9b4[_0x4f49a4][_0x6bfd('0x68')]):_0x28a9b4[_0x4f49a4]['question'];}}var _0x69d192=[],_0x2baa5a={};for(var _0x4c6fca=0x0,_0x532532=_0x3a1058[_0x6bfd('0x4f')];_0x4c6fca<_0x532532;_0x4c6fca++){_0x2baa5a={'ProjectId':_0x344433[_0x6bfd('0x43')]['id'],'SessionId':_0x3a1058[_0x4c6fca]['id'],'StartTime':moment(_0x3a1058[_0x4c6fca][_0x6bfd('0x63')])[_0x6bfd('0x69')](_0x6bfd('0x6a'))};for(var _0x7c1d17=0x0,_0x3021d7=_0x28a9b4[_0x6bfd('0x4f')];_0x7c1d17<_0x3021d7;_0x7c1d17++){if(_0x28a9b4[_0x7c1d17]['SessionId']==_0x3a1058[_0x4c6fca]['id']&&_0x3fc8c5[_0x6bfd('0x33')](_0x28a9b4[_0x7c1d17][_0x6bfd('0x67')])){_0x2baa5a[_0x3fc8c5[_0x28a9b4[_0x7c1d17][_0x6bfd('0x67')]]]=_0x28a9b4[_0x7c1d17]['answer'];}}for(var _0x36ad00 in _0x3fc8c5){if(!_0x2baa5a[_0x6bfd('0x33')](_0x3fc8c5[_0x36ad00])){_0x2baa5a[_0x3fc8c5[_0x36ad00]]=null;}}_0x69d192[_0x6bfd('0x6b')](_0x2baa5a);}return _0x69d192;}})[_0x6bfd('0x21')](function(_0x49081d){if(!_[_0x6bfd('0x6c')](_0x49081d)){var _0x40e36e=toCsv(_0x49081d);var _0x4f458f=Date[_0x6bfd('0x6d')]();fs['writeFileSync'](util[_0x6bfd('0x69')](_0x6bfd('0x6e'),_0x344433[_0x6bfd('0x43')]['id'],_0x4f458f),_0x40e36e);_0x55ca05[_0x6bfd('0x6f')]('Content-disposition',_0x6bfd('0x70')+util[_0x6bfd('0x69')](_0x6bfd('0x71'),_0x344433[_0x6bfd('0x43')]['id'],_0x4f458f));_0x55ca05[_0x6bfd('0x6f')](_0x6bfd('0x72'),'text/csv');return _0x55ca05[_0x6bfd('0x73')](util[_0x6bfd('0x69')](_0x6bfd('0x6e'),_0x344433[_0x6bfd('0x43')]['id'],_0x4f458f));}else{return _0x55ca05[_0x6bfd('0x25')](0xcc);}})['catch'](handleError(_0x55ca05,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index e9a1bd1..9322d79 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 _0x16a7=['moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','api'];(function(_0x537bf3,_0x1c6b92){var _0x55c1b4=function(_0x3bac14){while(--_0x3bac14){_0x537bf3['push'](_0x537bf3['shift']());}};_0x55c1b4(++_0x1c6b92);}(_0x16a7,0xe7));var _0x716a=function(_0x244cdc,_0x4bf61c){_0x244cdc=_0x244cdc-0x0;var _0x2e5689=_0x16a7[_0x244cdc];return _0x2e5689;};'use strict';var _=require('lodash');var util=require(_0x716a('0x0'));var logger=require(_0x716a('0x1'))(_0x716a('0x2'));var moment=require(_0x716a('0x3'));var BPromise=require(_0x716a('0x4'));var rp=require(_0x716a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x716a('0x6'));var config=require(_0x716a('0x7'));var attributes=require(_0x716a('0x8'));module[_0x716a('0x9')]=function(_0x252ca7,_0x1d510b){return _0x252ca7[_0x716a('0xa')](_0x716a('0xb'),attributes,{'tableName':_0x716a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa03c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','util','../../config/logger'];(function(_0x5e8e8a,_0x536abc){var _0x54af95=function(_0x36af74){while(--_0x36af74){_0x5e8e8a['push'](_0x5e8e8a['shift']());}};_0x54af95(++_0x536abc);}(_0xa03c,0x16a));var _0xca03=function(_0x475b20,_0x8cead4){_0x475b20=_0x475b20-0x0;var _0x5c69cd=_0xa03c[_0x475b20];return _0x5c69cd;};'use strict';var _=require('lodash');var util=require(_0xca03('0x0'));var logger=require(_0xca03('0x1'))(_0xca03('0x2'));var moment=require(_0xca03('0x3'));var BPromise=require(_0xca03('0x4'));var rp=require(_0xca03('0x5'));var fs=require('fs');var path=require(_0xca03('0x6'));var rimraf=require(_0xca03('0x7'));var config=require(_0xca03('0x8'));var attributes=require(_0xca03('0x9'));module[_0xca03('0xa')]=function(_0x484e74,_0x4615b5){return _0x484e74[_0xca03('0xb')](_0xca03('0xc'),attributes,{'tableName':'jscripty_projects','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 910fb1d..229503d 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 _0x327f=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x2feb53,_0x264ef7){var _0x5700ee=function(_0x700c98){while(--_0x700c98){_0x2feb53['push'](_0x2feb53['shift']());}};_0x5700ee(++_0x264ef7);}(_0x327f,0xe8));var _0xf327=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x327f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf327('0x0'));var util=require(_0xf327('0x1'));var moment=require(_0xf327('0x2'));var BPromise=require(_0xf327('0x3'));var rs=require(_0xf327('0x4'));var fs=require('fs');var Redis=require(_0xf327('0x5'));var db=require(_0xf327('0x6'))['db'];var utils=require(_0xf327('0x7'));var logger=require(_0xf327('0x8'))('rpc');var config=require(_0xf327('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf327('0xa')][_0xf327('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x250117,_0x4d92ee,_0x4e4858){return new BPromise(function(_0xe468ec,_0xc4d85e){return client['request'](_0x250117,_0x4e4858)[_0xf327('0xc')](function(_0x247c65){logger[_0xf327('0xd')](_0xf327('0xe'),_0x4d92ee,_0xf327('0xf'));logger['debug'](_0xf327('0x10'),_0x4d92ee,_0xf327('0xf'),JSON['stringify'](_0x247c65));if(_0x247c65[_0xf327('0x11')]){if(_0x247c65[_0xf327('0x11')][_0xf327('0x12')]===0x1f4){logger[_0xf327('0x11')](_0xf327('0xe'),_0x4d92ee,_0x247c65['error'][_0xf327('0x13')]);return _0xc4d85e(_0x247c65[_0xf327('0x11')][_0xf327('0x13')]);}logger[_0xf327('0x11')](_0xf327('0xe'),_0x4d92ee,_0x247c65[_0xf327('0x11')][_0xf327('0x13')]);return _0xe468ec(_0x247c65[_0xf327('0x11')][_0xf327('0x13')]);}else{logger[_0xf327('0xd')]('JscriptyProject,\x20%s,\x20%s',_0x4d92ee,_0xf327('0xf'));_0xe468ec(_0x247c65[_0xf327('0x14')]['message']);}})['catch'](function(_0xc2e56c){logger['error'](_0xf327('0xe'),_0x4d92ee,_0xc2e56c);_0xc4d85e(_0xc2e56c);});});} \ No newline at end of file +var _0x41a1=['info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request'];(function(_0x2ee08a,_0x4e0388){var _0xd3ca88=function(_0x36638b){while(--_0x36638b){_0x2ee08a['push'](_0x2ee08a['shift']());}};_0xd3ca88(++_0x4e0388);}(_0x41a1,0x173));var _0x141a=function(_0x37c6d7,_0x38c8ea){_0x37c6d7=_0x37c6d7-0x0;var _0xc960e3=_0x41a1[_0x37c6d7];return _0xc960e3;};'use strict';var _=require(_0x141a('0x0'));var util=require(_0x141a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x141a('0x2'))['db'];var utils=require(_0x141a('0x3'));var logger=require(_0x141a('0x4'))(_0x141a('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x141a('0x6')][_0x141a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x387b81,_0x469152,_0x2a332c){return new BPromise(function(_0x31c03a,_0x5e3736){return client[_0x141a('0x8')](_0x387b81,_0x2a332c)['then'](function(_0x480af5){logger[_0x141a('0x9')](_0x141a('0xa'),_0x469152,_0x141a('0xb'));logger[_0x141a('0xc')](_0x141a('0xd'),_0x469152,_0x141a('0xb'),JSON[_0x141a('0xe')](_0x480af5));if(_0x480af5[_0x141a('0xf')]){if(_0x480af5[_0x141a('0xf')][_0x141a('0x10')]===0x1f4){logger[_0x141a('0xf')](_0x141a('0xa'),_0x469152,_0x480af5[_0x141a('0xf')][_0x141a('0x11')]);return _0x5e3736(_0x480af5[_0x141a('0xf')][_0x141a('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x469152,_0x480af5[_0x141a('0xf')]['message']);return _0x31c03a(_0x480af5[_0x141a('0xf')][_0x141a('0x11')]);}else{logger['info'](_0x141a('0xa'),_0x469152,_0x141a('0xb'));_0x31c03a(_0x480af5[_0x141a('0x12')][_0x141a('0x11')]);}})[_0x141a('0x13')](function(_0x156c45){logger[_0x141a('0xf')](_0x141a('0xa'),_0x469152,_0x156c45);_0x5e3736(_0x156c45);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 5a78769..8058e0f 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 _0x7554=['index','describe','post','create','put','/:id','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x2cbddf,_0x35bf53){var _0x241728=function(_0x314614){while(--_0x314614){_0x2cbddf['push'](_0x2cbddf['shift']());}};_0x241728(++_0x35bf53);}(_0x7554,0xbd));var _0x4755=function(_0x55570d,_0x474dc5){_0x55570d=_0x55570d-0x0;var _0x217495=_0x7554[_0x55570d];return _0x217495;};'use strict';var multer=require(_0x4755('0x0'));var util=require(_0x4755('0x1'));var path=require(_0x4755('0x2'));var timeout=require('connect-timeout');var express=require(_0x4755('0x3'));var router=express[_0x4755('0x4')]();var auth=require(_0x4755('0x5'));var interaction=require(_0x4755('0x6'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x4755('0x7')]('/',auth[_0x4755('0x8')](),controller[_0x4755('0x9')]);router[_0x4755('0x7')]('/describe',auth[_0x4755('0x8')](),controller[_0x4755('0xa')]);router[_0x4755('0x7')]('/:id',auth[_0x4755('0x8')](),controller['show']);router[_0x4755('0xb')]('/',auth[_0x4755('0x8')](),controller[_0x4755('0xc')]);router[_0x4755('0xd')](_0x4755('0xe'),auth[_0x4755('0x8')](),controller[_0x4755('0xf')]);router[_0x4755('0x10')](_0x4755('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x4755('0x11')]=router; \ No newline at end of file +var _0xc1e9=['/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x73fddd,_0x4241ea){var _0x58b95a=function(_0x399186){while(--_0x399186){_0x73fddd['push'](_0x73fddd['shift']());}};_0x58b95a(++_0x4241ea);}(_0xc1e9,0x15d));var _0x9c1e=function(_0x7b454c,_0x4f103d){_0x7b454c=_0x7b454c-0x0;var _0x525313=_0xc1e9[_0x7b454c];return _0x525313;};'use strict';var multer=require(_0x9c1e('0x0'));var util=require(_0x9c1e('0x1'));var path=require(_0x9c1e('0x2'));var timeout=require(_0x9c1e('0x3'));var express=require('express');var router=express[_0x9c1e('0x4')]();var auth=require(_0x9c1e('0x5'));var interaction=require(_0x9c1e('0x6'));var config=require(_0x9c1e('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x9c1e('0x8')]('/',auth[_0x9c1e('0x9')](),controller['index']);router['get'](_0x9c1e('0xa'),auth['isAuthenticated'](),controller[_0x9c1e('0xb')]);router[_0x9c1e('0x8')](_0x9c1e('0xc'),auth[_0x9c1e('0x9')](),controller['show']);router[_0x9c1e('0xd')]('/',auth[_0x9c1e('0x9')](),controller[_0x9c1e('0xe')]);router[_0x9c1e('0xf')](_0x9c1e('0xc'),auth[_0x9c1e('0x9')](),controller[_0x9c1e('0x10')]);router[_0x9c1e('0x11')](_0x9c1e('0xc'),auth[_0x9c1e('0x9')](),controller['destroy']);module[_0x9c1e('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 6944a8d..2ed2afe 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 _0x943f=['sequelize','exports','STRING','TEXT','long'];(function(_0x4966ab,_0x385715){var _0x9e39aa=function(_0x152197){while(--_0x152197){_0x4966ab['push'](_0x4966ab['shift']());}};_0x9e39aa(++_0x385715);}(_0x943f,0xcd));var _0xf943=function(_0xbdd3b3,_0x11d541){_0xbdd3b3=_0xbdd3b3-0x0;var _0x3e683f=_0x943f[_0xbdd3b3];return _0x3e683f;};'use strict';var Sequelize=require(_0xf943('0x0'));module[_0xf943('0x1')]={'question':{'type':Sequelize[_0xf943('0x2')]},'answer':{'type':Sequelize[_0xf943('0x3')](_0xf943('0x4'))},'membername':{'type':Sequelize[_0xf943('0x2')]},'projectname':{'type':Sequelize[_0xf943('0x2')]},'queue':{'type':Sequelize[_0xf943('0x2')]},'uniqueid':{'type':Sequelize[_0xf943('0x2')]},'calleridname':{'type':Sequelize[_0xf943('0x2')]},'calleridnum':{'type':Sequelize[_0xf943('0x2')]},'questionId':{'type':Sequelize[_0xf943('0x2')]}}; \ No newline at end of file +var _0x1579=['STRING','sequelize','exports'];(function(_0x2703cf,_0x526b31){var _0x28f18a=function(_0x10e33b){while(--_0x10e33b){_0x2703cf['push'](_0x2703cf['shift']());}};_0x28f18a(++_0x526b31);}(_0x1579,0xd6));var _0x9157=function(_0x3bb5d4,_0x43bcc3){_0x3bb5d4=_0x3bb5d4-0x0;var _0x2cc52d=_0x1579[_0x3bb5d4];return _0x2cc52d;};'use strict';var Sequelize=require(_0x9157('0x0'));module[_0x9157('0x1')]={'question':{'type':Sequelize[_0x9157('0x2')]},'answer':{'type':Sequelize['TEXT']('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x9157('0x2')]},'queue':{'type':Sequelize[_0x9157('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 604d514..21e9215 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 _0x0246=['JscriptyQuestionReport','rawAttributes','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','show','params','include','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','stack','name','map'];(function(_0x37ab0b,_0xab6354){var _0x2e6c41=function(_0x42ef45){while(--_0x42ef45){_0x37ab0b['push'](_0x37ab0b['shift']());}};_0x2e6c41(++_0xab6354);}(_0x0246,0xf9));var _0x6024=function(_0x2d708e,_0x429ee2){_0x2d708e=_0x2d708e-0x0;var _0x472c84=_0x0246[_0x2d708e];return _0x472c84;};'use strict';var pdf=require(_0x6024('0x0'));var emlformat=require(_0x6024('0x1'));var rimraf=require(_0x6024('0x2'));var zipdir=require(_0x6024('0x3'));var jsonpatch=require(_0x6024('0x4'));var rp=require(_0x6024('0x5'));var moment=require(_0x6024('0x6'));var BPromise=require(_0x6024('0x7'));var Mustache=require(_0x6024('0x8'));var util=require('util');var path=require(_0x6024('0x9'));var sox=require(_0x6024('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6024('0xb'));var squel=require(_0x6024('0xc'));var crypto=require(_0x6024('0xd'));var jsforce=require(_0x6024('0xe'));var deskjs=require(_0x6024('0xf'));var toCsv=require(_0x6024('0x10'));var querystring=require(_0x6024('0x11'));var Papa=require(_0x6024('0x12'));var Redis=require(_0x6024('0x13'));var authService=require(_0x6024('0x14'));var qs=require(_0x6024('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6024('0x16'));var logger=require(_0x6024('0x17'))(_0x6024('0x18'));var utils=require(_0x6024('0x19'));var config=require('../../config/environment');var db=require(_0x6024('0x1a'))['db'];function respondWithStatusCode(_0x1f129f,_0x393921){_0x393921=_0x393921||0xcc;return function(_0x252de8){if(_0x252de8){return _0x1f129f['sendStatus'](_0x393921);}return _0x1f129f[_0x6024('0x1b')](_0x393921)[_0x6024('0x1c')]();};}function respondWithResult(_0x34cfd0,_0x1e3a3f){_0x1e3a3f=_0x1e3a3f||0xc8;return function(_0x21e9af){if(_0x21e9af){return _0x34cfd0[_0x6024('0x1b')](_0x1e3a3f)[_0x6024('0x1d')](_0x21e9af);}};}function respondWithFilteredResult(_0x454c3b,_0x50c712){return function(_0x1d9959){if(_0x1d9959){var _0x200902=_0x1d9959[_0x6024('0x1e')],_0x50dc58=_0x50c712[_0x6024('0x1f')],_0x31024f=_0x50c712[_0x6024('0x1f')]+_0x50c712[_0x6024('0x20')],_0x287060;if(_0x31024f>=_0x200902){_0x31024f=_0x200902;_0x287060=0xc8;}else{_0x287060=0xce;}_0x454c3b['status'](_0x287060);return _0x454c3b[_0x6024('0x21')](_0x6024('0x22'),_0x50dc58+'-'+_0x31024f+'/'+_0x200902)['json'](_0x1d9959);}return null;};}function patchUpdates(_0x451b09){return function(_0x1f4e29){try{jsonpatch[_0x6024('0x23')](_0x1f4e29,_0x451b09,!![]);}catch(_0x591fe9){return BPromise[_0x6024('0x24')](_0x591fe9);}return _0x1f4e29['save']();};}function saveUpdates(_0x177132,_0x5c1039){return function(_0x572ae9){if(_0x572ae9){return _0x572ae9[_0x6024('0x25')](_0x177132)['then'](function(_0x2cfe9c){return _0x2cfe9c;});}return null;};}function removeEntity(_0x5cf176,_0x5f088f){return function(_0x227c2e){if(_0x227c2e){return _0x227c2e[_0x6024('0x26')]()[_0x6024('0x27')](function(){_0x5cf176[_0x6024('0x1b')](0xcc)[_0x6024('0x1c')]();});}};}function handleEntityNotFound(_0x3852a8,_0x4aa2b3){return function(_0x434536){if(!_0x434536){_0x3852a8['sendStatus'](0x194);}return _0x434536;};}function handleError(_0x3428ab,_0x2e4659){_0x2e4659=_0x2e4659||0x1f4;return function(_0x5b2af0){logger['error'](_0x5b2af0[_0x6024('0x28')]);if(_0x5b2af0[_0x6024('0x29')]){delete _0x5b2af0['name'];}_0x3428ab['status'](_0x2e4659)['send'](_0x5b2af0);};}exports['index']=function(_0x96b0b2,_0x177c71){var _0x219ab5={},_0x2b9485={},_0x3a7569={'count':0x0,'rows':[]};var _0x19eeeb=_[_0x6024('0x2a')](db[_0x6024('0x2b')][_0x6024('0x2c')],function(_0x296501){return{'name':_0x296501['fieldName'],'type':_0x296501['type'][_0x6024('0x2d')]};});_0x2b9485[_0x6024('0x2e')]=_[_0x6024('0x2a')](_0x19eeeb,_0x6024('0x29'));_0x2b9485['query']=_[_0x6024('0x2f')](_0x96b0b2[_0x6024('0x30')]);_0x2b9485[_0x6024('0x31')]=_['intersection'](_0x2b9485['model'],_0x2b9485[_0x6024('0x30')]);_0x219ab5[_0x6024('0x32')]=_[_0x6024('0x33')](_0x2b9485[_0x6024('0x2e')],qs['fields'](_0x96b0b2['query'][_0x6024('0x34')]));_0x219ab5[_0x6024('0x32')]=_0x219ab5['attributes'][_0x6024('0x35')]?_0x219ab5[_0x6024('0x32')]:_0x2b9485['model'];if(!_0x96b0b2[_0x6024('0x30')][_0x6024('0x36')](_0x6024('0x37'))){_0x219ab5[_0x6024('0x20')]=qs['limit'](_0x96b0b2[_0x6024('0x30')]['limit']);_0x219ab5[_0x6024('0x1f')]=qs[_0x6024('0x1f')](_0x96b0b2[_0x6024('0x30')]['offset']);}_0x219ab5[_0x6024('0x38')]=qs[_0x6024('0x39')](_0x96b0b2[_0x6024('0x30')][_0x6024('0x39')]);_0x219ab5[_0x6024('0x3a')]=qs[_0x6024('0x31')](_[_0x6024('0x3b')](_0x96b0b2[_0x6024('0x30')],_0x2b9485[_0x6024('0x31')]),_0x19eeeb);if(_0x96b0b2[_0x6024('0x30')]['filter']){_0x219ab5[_0x6024('0x3a')]=_[_0x6024('0x3c')](_0x219ab5['where'],{'$or':_[_0x6024('0x2a')](_0x19eeeb,function(_0x5f33c8){if(_0x5f33c8['type']!=='VIRTUAL'){var _0x11fa12={};_0x11fa12[_0x5f33c8[_0x6024('0x29')]]={'$like':'%'+_0x96b0b2[_0x6024('0x30')][_0x6024('0x3d')]+'%'};return _0x11fa12;}})});}_0x219ab5=_[_0x6024('0x3c')]({},_0x219ab5,_0x96b0b2[_0x6024('0x3e')]);var _0x5594b5={'where':_0x219ab5[_0x6024('0x3a')]};return db[_0x6024('0x2b')][_0x6024('0x1e')](_0x5594b5)[_0x6024('0x27')](function(_0x323d11){_0x3a7569[_0x6024('0x1e')]=_0x323d11;if(_0x96b0b2[_0x6024('0x30')][_0x6024('0x3f')]){_0x219ab5['include']=[{'all':!![]}];}return db[_0x6024('0x2b')][_0x6024('0x40')](_0x219ab5);})[_0x6024('0x27')](function(_0x38e757){_0x3a7569['rows']=_0x38e757;return _0x3a7569;})[_0x6024('0x27')](respondWithFilteredResult(_0x177c71,_0x219ab5))['catch'](handleError(_0x177c71,null));};exports[_0x6024('0x41')]=function(_0x89ba7a,_0x586810){var _0x55f856={'raw':!![],'where':{'id':_0x89ba7a[_0x6024('0x42')]['id']}},_0x19d3f0={};_0x19d3f0[_0x6024('0x2e')]=_[_0x6024('0x2f')](db[_0x6024('0x2b')][_0x6024('0x2c')]);_0x19d3f0[_0x6024('0x30')]=_[_0x6024('0x2f')](_0x89ba7a['query']);_0x19d3f0[_0x6024('0x31')]=_[_0x6024('0x33')](_0x19d3f0['model'],_0x19d3f0[_0x6024('0x30')]);_0x55f856[_0x6024('0x32')]=_[_0x6024('0x33')](_0x19d3f0['model'],qs[_0x6024('0x34')](_0x89ba7a[_0x6024('0x30')][_0x6024('0x34')]));_0x55f856['attributes']=_0x55f856[_0x6024('0x32')]['length']?_0x55f856[_0x6024('0x32')]:_0x19d3f0['model'];if(_0x89ba7a[_0x6024('0x30')]['includeAll']){_0x55f856[_0x6024('0x43')]=[{'all':!![]}];}_0x55f856=_[_0x6024('0x3c')]({},_0x55f856,_0x89ba7a[_0x6024('0x3e')]);return db[_0x6024('0x2b')][_0x6024('0x44')](_0x55f856)['then'](handleEntityNotFound(_0x586810,null))[_0x6024('0x27')](respondWithResult(_0x586810,null))[_0x6024('0x45')](handleError(_0x586810,null));};exports[_0x6024('0x46')]=function(_0x77e5e7,_0x59953a){return db[_0x6024('0x2b')][_0x6024('0x46')](_0x77e5e7[_0x6024('0x47')],{})['then'](respondWithResult(_0x59953a,0xc9))[_0x6024('0x45')](handleError(_0x59953a,null));};exports['update']=function(_0x433fe6,_0x2b3111){if(_0x433fe6[_0x6024('0x47')]['id']){delete _0x433fe6[_0x6024('0x47')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x433fe6[_0x6024('0x42')]['id']}})['then'](handleEntityNotFound(_0x2b3111,null))[_0x6024('0x27')](saveUpdates(_0x433fe6[_0x6024('0x47')],null))[_0x6024('0x27')](respondWithResult(_0x2b3111,null))[_0x6024('0x45')](handleError(_0x2b3111,null));};exports[_0x6024('0x26')]=function(_0x1f62e3,_0x29051a){return db[_0x6024('0x2b')][_0x6024('0x44')]({'where':{'id':_0x1f62e3[_0x6024('0x42')]['id']}})[_0x6024('0x27')](handleEntityNotFound(_0x29051a,null))['then'](removeEntity(_0x29051a,null))[_0x6024('0x45')](handleError(_0x29051a,null));};exports[_0x6024('0x48')]=function(_0x45d37f,_0xe5aa59){return db[_0x6024('0x2b')][_0x6024('0x48')]()[_0x6024('0x27')](respondWithResult(_0xe5aa59,null))[_0x6024('0x45')](handleError(_0xe5aa59,null));}; \ No newline at end of file +var _0x2007=['includeAll','findAll','show','keys','include','find','catch','create','body','params','describe','html-pdf','rimraf','zip-dir','request-promise','moment','util','path','ejs','lodash','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','status','index','JscriptyQuestionReport','rawAttributes','fieldName','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options'];(function(_0x1c36a8,_0x49c835){var _0xb622c5=function(_0x24f4f3){while(--_0x24f4f3){_0x1c36a8['push'](_0x1c36a8['shift']());}};_0xb622c5(++_0x49c835);}(_0x2007,0x16e));var _0x7200=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2007[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x7200('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7200('0x1'));var zipdir=require(_0x7200('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7200('0x3'));var moment=require(_0x7200('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7200('0x5'));var path=require(_0x7200('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7200('0x7'));var fs=require('fs');var _=require(_0x7200('0x8'));var squel=require(_0x7200('0x9'));var crypto=require('crypto');var jsforce=require(_0x7200('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7200('0xb'));var querystring=require('querystring');var Papa=require(_0x7200('0xc'));var Redis=require(_0x7200('0xd'));var authService=require(_0x7200('0xe'));var qs=require(_0x7200('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7200('0x10'));var logger=require(_0x7200('0x11'))('api');var utils=require(_0x7200('0x12'));var config=require(_0x7200('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1fc91c,_0x267cad){_0x267cad=_0x267cad||0xcc;return function(_0x488aa6){if(_0x488aa6){return _0x1fc91c[_0x7200('0x14')](_0x267cad);}return _0x1fc91c['status'](_0x267cad)[_0x7200('0x15')]();};}function respondWithResult(_0x83c40a,_0x59aeea){_0x59aeea=_0x59aeea||0xc8;return function(_0x4f2485){if(_0x4f2485){return _0x83c40a['status'](_0x59aeea)[_0x7200('0x16')](_0x4f2485);}};}function respondWithFilteredResult(_0x2392a2,_0x1dc89a){return function(_0x13d58c){if(_0x13d58c){var _0x2722b7=_0x13d58c[_0x7200('0x17')],_0x4ce0b3=_0x1dc89a[_0x7200('0x18')],_0x4036ac=_0x1dc89a[_0x7200('0x18')]+_0x1dc89a[_0x7200('0x19')],_0x46f6a1;if(_0x4036ac>=_0x2722b7){_0x4036ac=_0x2722b7;_0x46f6a1=0xc8;}else{_0x46f6a1=0xce;}_0x2392a2['status'](_0x46f6a1);return _0x2392a2['set'](_0x7200('0x1a'),_0x4ce0b3+'-'+_0x4036ac+'/'+_0x2722b7)[_0x7200('0x16')](_0x13d58c);}return null;};}function patchUpdates(_0x227dab){return function(_0x59dc20){try{jsonpatch[_0x7200('0x1b')](_0x59dc20,_0x227dab,!![]);}catch(_0x4f7097){return BPromise[_0x7200('0x1c')](_0x4f7097);}return _0x59dc20[_0x7200('0x1d')]();};}function saveUpdates(_0x3e0bc1,_0x2036d4){return function(_0xd2111a){if(_0xd2111a){return _0xd2111a[_0x7200('0x1e')](_0x3e0bc1)[_0x7200('0x1f')](function(_0x2d3a99){return _0x2d3a99;});}return null;};}function removeEntity(_0x2e2eb2,_0x459718){return function(_0x2223f0){if(_0x2223f0){return _0x2223f0[_0x7200('0x20')]()['then'](function(){_0x2e2eb2['status'](0xcc)[_0x7200('0x15')]();});}};}function handleEntityNotFound(_0x49a0c8,_0x578c79){return function(_0x3a9039){if(!_0x3a9039){_0x49a0c8['sendStatus'](0x194);}return _0x3a9039;};}function handleError(_0x221e3d,_0x13cf80){_0x13cf80=_0x13cf80||0x1f4;return function(_0x1b3676){logger[_0x7200('0x21')](_0x1b3676[_0x7200('0x22')]);if(_0x1b3676[_0x7200('0x23')]){delete _0x1b3676[_0x7200('0x23')];}_0x221e3d[_0x7200('0x24')](_0x13cf80)['send'](_0x1b3676);};}exports[_0x7200('0x25')]=function(_0x100ef,_0x1ca821){var _0x3e8024={},_0x45fe83={},_0x8b10cb={'count':0x0,'rows':[]};var _0x11de36=_['map'](db[_0x7200('0x26')][_0x7200('0x27')],function(_0x33af4c){return{'name':_0x33af4c[_0x7200('0x28')],'type':_0x33af4c['type']['key']};});_0x45fe83['model']=_[_0x7200('0x29')](_0x11de36,_0x7200('0x23'));_0x45fe83[_0x7200('0x2a')]=_['keys'](_0x100ef[_0x7200('0x2a')]);_0x45fe83['filters']=_[_0x7200('0x2b')](_0x45fe83[_0x7200('0x2c')],_0x45fe83[_0x7200('0x2a')]);_0x3e8024[_0x7200('0x2d')]=_[_0x7200('0x2b')](_0x45fe83[_0x7200('0x2c')],qs[_0x7200('0x2e')](_0x100ef[_0x7200('0x2a')][_0x7200('0x2e')]));_0x3e8024[_0x7200('0x2d')]=_0x3e8024[_0x7200('0x2d')][_0x7200('0x2f')]?_0x3e8024[_0x7200('0x2d')]:_0x45fe83[_0x7200('0x2c')];if(!_0x100ef[_0x7200('0x2a')][_0x7200('0x30')](_0x7200('0x31'))){_0x3e8024[_0x7200('0x19')]=qs['limit'](_0x100ef[_0x7200('0x2a')]['limit']);_0x3e8024[_0x7200('0x18')]=qs[_0x7200('0x18')](_0x100ef[_0x7200('0x2a')]['offset']);}_0x3e8024[_0x7200('0x32')]=qs[_0x7200('0x33')](_0x100ef[_0x7200('0x2a')][_0x7200('0x33')]);_0x3e8024[_0x7200('0x34')]=qs[_0x7200('0x35')](_[_0x7200('0x36')](_0x100ef[_0x7200('0x2a')],_0x45fe83[_0x7200('0x35')]),_0x11de36);if(_0x100ef['query'][_0x7200('0x37')]){_0x3e8024[_0x7200('0x34')]=_[_0x7200('0x38')](_0x3e8024['where'],{'$or':_[_0x7200('0x29')](_0x11de36,function(_0x3cb051){if(_0x3cb051[_0x7200('0x39')]!==_0x7200('0x3a')){var _0x4d323d={};_0x4d323d[_0x3cb051[_0x7200('0x23')]]={'$like':'%'+_0x100ef[_0x7200('0x2a')]['filter']+'%'};return _0x4d323d;}})});}_0x3e8024=_[_0x7200('0x38')]({},_0x3e8024,_0x100ef[_0x7200('0x3b')]);var _0x482e96={'where':_0x3e8024['where']};return db[_0x7200('0x26')][_0x7200('0x17')](_0x482e96)['then'](function(_0x2e8798){_0x8b10cb['count']=_0x2e8798;if(_0x100ef[_0x7200('0x2a')][_0x7200('0x3c')]){_0x3e8024['include']=[{'all':!![]}];}return db[_0x7200('0x26')][_0x7200('0x3d')](_0x3e8024);})[_0x7200('0x1f')](function(_0x4b6116){_0x8b10cb['rows']=_0x4b6116;return _0x8b10cb;})['then'](respondWithFilteredResult(_0x1ca821,_0x3e8024))['catch'](handleError(_0x1ca821,null));};exports[_0x7200('0x3e')]=function(_0x218d6f,_0x221d6a){var _0x28d3f4={'raw':!![],'where':{'id':_0x218d6f['params']['id']}},_0x39d2cf={};_0x39d2cf[_0x7200('0x2c')]=_[_0x7200('0x3f')](db[_0x7200('0x26')][_0x7200('0x27')]);_0x39d2cf[_0x7200('0x2a')]=_[_0x7200('0x3f')](_0x218d6f[_0x7200('0x2a')]);_0x39d2cf[_0x7200('0x35')]=_['intersection'](_0x39d2cf[_0x7200('0x2c')],_0x39d2cf[_0x7200('0x2a')]);_0x28d3f4[_0x7200('0x2d')]=_['intersection'](_0x39d2cf[_0x7200('0x2c')],qs[_0x7200('0x2e')](_0x218d6f[_0x7200('0x2a')][_0x7200('0x2e')]));_0x28d3f4[_0x7200('0x2d')]=_0x28d3f4[_0x7200('0x2d')]['length']?_0x28d3f4[_0x7200('0x2d')]:_0x39d2cf[_0x7200('0x2c')];if(_0x218d6f['query']['includeAll']){_0x28d3f4[_0x7200('0x40')]=[{'all':!![]}];}_0x28d3f4=_['merge']({},_0x28d3f4,_0x218d6f[_0x7200('0x3b')]);return db[_0x7200('0x26')][_0x7200('0x41')](_0x28d3f4)[_0x7200('0x1f')](handleEntityNotFound(_0x221d6a,null))[_0x7200('0x1f')](respondWithResult(_0x221d6a,null))[_0x7200('0x42')](handleError(_0x221d6a,null));};exports[_0x7200('0x43')]=function(_0x1a99c9,_0x25cb95){return db[_0x7200('0x26')][_0x7200('0x43')](_0x1a99c9[_0x7200('0x44')],{})['then'](respondWithResult(_0x25cb95,0xc9))[_0x7200('0x42')](handleError(_0x25cb95,null));};exports[_0x7200('0x1e')]=function(_0x137fd1,_0x2b215d){if(_0x137fd1[_0x7200('0x44')]['id']){delete _0x137fd1[_0x7200('0x44')]['id'];}return db[_0x7200('0x26')][_0x7200('0x41')]({'where':{'id':_0x137fd1[_0x7200('0x45')]['id']}})[_0x7200('0x1f')](handleEntityNotFound(_0x2b215d,null))[_0x7200('0x1f')](saveUpdates(_0x137fd1[_0x7200('0x44')],null))[_0x7200('0x1f')](respondWithResult(_0x2b215d,null))[_0x7200('0x42')](handleError(_0x2b215d,null));};exports[_0x7200('0x20')]=function(_0x3f63d9,_0x12c84f){return db['JscriptyQuestionReport'][_0x7200('0x41')]({'where':{'id':_0x3f63d9[_0x7200('0x45')]['id']}})[_0x7200('0x1f')](handleEntityNotFound(_0x12c84f,null))[_0x7200('0x1f')](removeEntity(_0x12c84f,null))[_0x7200('0x42')](handleError(_0x12c84f,null));};exports['describe']=function(_0x47d865,_0x11b0de){return db[_0x7200('0x26')][_0x7200('0x46')]()[_0x7200('0x1f')](respondWithResult(_0x11b0de,null))[_0x7200('0x42')](handleError(_0x11b0de,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 1eeec54..d4bcf8d 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 _0xa4e8=['./jscriptyQuestionReport.attributes','define','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x3d8c63,_0x428849){var _0x5c67cd=function(_0x356912){while(--_0x356912){_0x3d8c63['push'](_0x3d8c63['shift']());}};_0x5c67cd(++_0x428849);}(_0xa4e8,0x143));var _0x8a4e=function(_0x4408e8,_0x457473){_0x4408e8=_0x4408e8-0x0;var _0x57e5a7=_0xa4e8[_0x4408e8];return _0x57e5a7;};'use strict';var _=require(_0x8a4e('0x0'));var util=require(_0x8a4e('0x1'));var logger=require(_0x8a4e('0x2'))(_0x8a4e('0x3'));var moment=require(_0x8a4e('0x4'));var BPromise=require(_0x8a4e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8a4e('0x6'));var config=require('../../config/environment');var attributes=require(_0x8a4e('0x7'));module['exports']=function(_0x1c6049,_0x1376d2){return _0x1c6049[_0x8a4e('0x8')]('JscriptyQuestionReport',attributes,{'tableName':_0x8a4e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xceab=['path','rimraf','../../config/environment','exports','report_jscripty_questions','lodash','util','api','moment','request-promise'];(function(_0x1cccc8,_0x469be1){var _0x4361e9=function(_0x1a784c){while(--_0x1a784c){_0x1cccc8['push'](_0x1cccc8['shift']());}};_0x4361e9(++_0x469be1);}(_0xceab,0xc3));var _0xbcea=function(_0x42a122,_0x1a2c4d){_0x42a122=_0x42a122-0x0;var _0x16121a=_0xceab[_0x42a122];return _0x16121a;};'use strict';var _=require(_0xbcea('0x0'));var util=require(_0xbcea('0x1'));var logger=require('../../config/logger')(_0xbcea('0x2'));var moment=require(_0xbcea('0x3'));var BPromise=require('bluebird');var rp=require(_0xbcea('0x4'));var fs=require('fs');var path=require(_0xbcea('0x5'));var rimraf=require(_0xbcea('0x6'));var config=require(_0xbcea('0x7'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xbcea('0x8')]=function(_0x35082a,_0x180cc3){return _0x35082a['define']('JscriptyQuestionReport',attributes,{'tableName':_0xbcea('0x9'),'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 c160943..36fe8f8 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 _0xa165=['request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa165,0x179));var _0x5a16=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xa165[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require(_0x5a16('0x0'));var moment=require(_0x5a16('0x1'));var BPromise=require(_0x5a16('0x2'));var rs=require(_0x5a16('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a16('0x4'))['db'];var utils=require(_0x5a16('0x5'));var logger=require(_0x5a16('0x6'))('rpc');var config=require(_0x5a16('0x7'));var jayson=require(_0x5a16('0x8'));var client=jayson['client'][_0x5a16('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x518ac6,_0x342da4,_0x57e043){return new BPromise(function(_0x3b4b65,_0x2e2351){return client[_0x5a16('0xa')](_0x518ac6,_0x57e043)[_0x5a16('0xb')](function(_0x156a0b){logger[_0x5a16('0xc')](_0x5a16('0xd'),_0x342da4,_0x5a16('0xe'));logger[_0x5a16('0xf')](_0x5a16('0x10'),_0x342da4,_0x5a16('0xe'),JSON[_0x5a16('0x11')](_0x156a0b));if(_0x156a0b[_0x5a16('0x12')]){if(_0x156a0b[_0x5a16('0x12')][_0x5a16('0x13')]===0x1f4){logger['error'](_0x5a16('0xd'),_0x342da4,_0x156a0b[_0x5a16('0x12')][_0x5a16('0x14')]);return _0x2e2351(_0x156a0b[_0x5a16('0x12')][_0x5a16('0x14')]);}logger[_0x5a16('0x12')](_0x5a16('0xd'),_0x342da4,_0x156a0b[_0x5a16('0x12')][_0x5a16('0x14')]);return _0x3b4b65(_0x156a0b[_0x5a16('0x12')][_0x5a16('0x14')]);}else{logger[_0x5a16('0xc')](_0x5a16('0xd'),_0x342da4,'request\x20sent');_0x3b4b65(_0x156a0b[_0x5a16('0x15')]['message']);}})[_0x5a16('0x16')](function(_0x468d9a){logger['error'](_0x5a16('0xd'),_0x342da4,_0x468d9a);_0x2e2351(_0x468d9a);});});} \ No newline at end of file +var _0x6182=['request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6182,0x78));var _0x2618=function(_0x2a9bb2,_0x37e184){_0x2a9bb2=_0x2a9bb2-0x0;var _0x53d6b3=_0x6182[_0x2a9bb2];return _0x53d6b3;};'use strict';var _=require(_0x2618('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2618('0x1'));var rs=require(_0x2618('0x2'));var fs=require('fs');var Redis=require(_0x2618('0x3'));var db=require(_0x2618('0x4'))['db'];var utils=require(_0x2618('0x5'));var logger=require(_0x2618('0x6'))(_0x2618('0x7'));var config=require(_0x2618('0x8'));var jayson=require(_0x2618('0x9'));var client=jayson[_0x2618('0xa')][_0x2618('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42d431,_0x39bd6c,_0x2f1e94){return new BPromise(function(_0x4d91b3,_0x5a480b){return client[_0x2618('0xc')](_0x42d431,_0x2f1e94)['then'](function(_0x2b7987){logger[_0x2618('0xd')](_0x2618('0xe'),_0x39bd6c,_0x2618('0xf'));logger[_0x2618('0x10')](_0x2618('0x11'),_0x39bd6c,_0x2618('0xf'),JSON[_0x2618('0x12')](_0x2b7987));if(_0x2b7987[_0x2618('0x13')]){if(_0x2b7987[_0x2618('0x13')][_0x2618('0x14')]===0x1f4){logger[_0x2618('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x39bd6c,_0x2b7987['error']['message']);return _0x5a480b(_0x2b7987[_0x2618('0x13')][_0x2618('0x15')]);}logger[_0x2618('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x39bd6c,_0x2b7987[_0x2618('0x13')][_0x2618('0x15')]);return _0x4d91b3(_0x2b7987[_0x2618('0x13')][_0x2618('0x15')]);}else{logger['info'](_0x2618('0xe'),_0x39bd6c,_0x2618('0xf'));_0x4d91b3(_0x2b7987['result'][_0x2618('0x15')]);}})['catch'](function(_0x3b7514){logger[_0x2618('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x39bd6c,_0x3b7514);_0x5a480b(_0x3b7514);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 0af2796..24a0928 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 _0x9f62=['./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id/questions','create','/:id','destroy','exports','util','connect-timeout','express','Router','../../config/environment'];(function(_0x274598,_0x2c7251){var _0xbca5fa=function(_0x35459c){while(--_0x35459c){_0x274598['push'](_0x274598['shift']());}};_0xbca5fa(++_0x2c7251);}(_0x9f62,0x154));var _0x29f6=function(_0x4cfe52,_0x2728e0){_0x4cfe52=_0x4cfe52-0x0;var _0x9f5605=_0x9f62[_0x4cfe52];return _0x9f5605;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x29f6('0x4'));var controller=require(_0x29f6('0x5'));router[_0x29f6('0x6')]('/',auth[_0x29f6('0x7')](),controller['index']);router[_0x29f6('0x6')](_0x29f6('0x8'),auth[_0x29f6('0x7')](),controller[_0x29f6('0x9')]);router[_0x29f6('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x29f6('0xa'),auth[_0x29f6('0x7')](),controller['getQuestions']);router['post']('/',auth[_0x29f6('0x7')](),controller[_0x29f6('0xb')]);router['put'](_0x29f6('0xc'),auth[_0x29f6('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x29f6('0xd')]);module[_0x29f6('0xe')]=router; \ No newline at end of file +var _0x7a2d=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./jscriptySessionReport.controller'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0x7a2d,0x142));var _0xd7a2=function(_0x3f412f,_0x3aea71){_0x3f412f=_0x3f412f-0x0;var _0xef390f=_0x7a2d[_0x3f412f];return _0xef390f;};'use strict';var multer=require(_0xd7a2('0x0'));var util=require(_0xd7a2('0x1'));var path=require(_0xd7a2('0x2'));var timeout=require(_0xd7a2('0x3'));var express=require(_0xd7a2('0x4'));var router=express[_0xd7a2('0x5')]();var auth=require(_0xd7a2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd7a2('0x7'));router[_0xd7a2('0x8')]('/',auth[_0xd7a2('0x9')](),controller[_0xd7a2('0xa')]);router['get'](_0xd7a2('0xb'),auth[_0xd7a2('0x9')](),controller[_0xd7a2('0xc')]);router[_0xd7a2('0x8')](_0xd7a2('0xd'),auth[_0xd7a2('0x9')](),controller[_0xd7a2('0xe')]);router[_0xd7a2('0x8')](_0xd7a2('0xf'),auth['isAuthenticated'](),controller[_0xd7a2('0x10')]);router[_0xd7a2('0x11')]('/',auth[_0xd7a2('0x9')](),controller[_0xd7a2('0x12')]);router[_0xd7a2('0x13')](_0xd7a2('0xd'),auth[_0xd7a2('0x9')](),controller['update']);router['delete'](_0xd7a2('0xd'),auth['isAuthenticated'](),controller[_0xd7a2('0x14')]);module[_0xd7a2('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index febdeee..f6e0651 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 _0x2446=['starttime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','DATE','setDataValue'];(function(_0x2d5f0,_0x3984bc){var _0x43b664=function(_0x2020ec){while(--_0x2020ec){_0x2d5f0['push'](_0x2d5f0['shift']());}};_0x43b664(++_0x3984bc);}(_0x2446,0x1e2));var _0x6244=function(_0xb9a592,_0x1ac328){_0xb9a592=_0xb9a592-0x0;var _0xfec78c=_0x2446[_0xb9a592];return _0xfec78c;};'use strict';var moment=require('moment');var Sequelize=require(_0x6244('0x0'));module[_0x6244('0x1')]={'starttime':{'type':Sequelize[_0x6244('0x2')],'set':function(_0x33ce34){this[_0x6244('0x3')](_0x6244('0x4'),_0x33ce34);this['setDataValue']('endtime',moment()[_0x6244('0x5')](_0x6244('0x6')));}},'endtime':{'type':Sequelize[_0x6244('0x2')]},'membername':{'type':Sequelize[_0x6244('0x7')]},'projectname':{'type':Sequelize[_0x6244('0x7')]},'queue':{'type':Sequelize[_0x6244('0x7')]},'uniqueid':{'type':Sequelize[_0x6244('0x7')]},'calleridname':{'type':Sequelize[_0x6244('0x7')]},'calleridnum':{'type':Sequelize[_0x6244('0x7')]},'completed':{'type':Sequelize[_0x6244('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x9e25=['starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','sequelize','setDataValue'];(function(_0xed2a84,_0x4f30e2){var _0x468093=function(_0x4e4964){while(--_0x4e4964){_0xed2a84['push'](_0xed2a84['shift']());}};_0x468093(++_0x4f30e2);}(_0x9e25,0xfa));var _0x59e2=function(_0x432b24,_0x2f11ae){_0x432b24=_0x432b24-0x0;var _0x1c37db=_0x9e25[_0x432b24];return _0x1c37db;};'use strict';var moment=require('moment');var Sequelize=require(_0x59e2('0x0'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0xb4a0d2){this[_0x59e2('0x1')](_0x59e2('0x2'),_0xb4a0d2);this[_0x59e2('0x1')](_0x59e2('0x3'),moment()[_0x59e2('0x4')](_0x59e2('0x5')));}},'endtime':{'type':Sequelize[_0x59e2('0x6')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x59e2('0x7')]},'uniqueid':{'type':Sequelize[_0x59e2('0x7')]},'calleridname':{'type':Sequelize[_0x59e2('0x7')]},'calleridnum':{'type':Sequelize[_0x59e2('0x7')]},'completed':{'type':Sequelize[_0x59e2('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 4f6787a..0ef8780 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 _0x87f5=['getQuestions','findOne','JscriptyQuestionReport','order','pick','SessionId','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','stack','name','index','JscriptySessionReport','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','describe'];(function(_0x523423,_0x417cee){var _0x106ea6=function(_0x4df21b){while(--_0x4df21b){_0x523423['push'](_0x523423['shift']());}};_0x106ea6(++_0x417cee);}(_0x87f5,0x126));var _0x587f=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x87f5[_0x50aa2e];return _0x5e07f0;};'use strict';var pdf=require(_0x587f('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x587f('0x1'));var jsonpatch=require(_0x587f('0x2'));var rp=require('request-promise');var moment=require(_0x587f('0x3'));var BPromise=require(_0x587f('0x4'));var Mustache=require(_0x587f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x587f('0x6'));var csv=require(_0x587f('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x587f('0x8'));var squel=require('squel');var crypto=require(_0x587f('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x587f('0x7'));var querystring=require(_0x587f('0xa'));var Papa=require(_0x587f('0xb'));var Redis=require('ioredis');var authService=require(_0x587f('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x587f('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x587f('0xe'))('api');var utils=require('../../config/utils');var config=require(_0x587f('0xf'));var db=require(_0x587f('0x10'))['db'];function respondWithStatusCode(_0x234989,_0x66af1d){_0x66af1d=_0x66af1d||0xcc;return function(_0x1d12d1){if(_0x1d12d1){return _0x234989['sendStatus'](_0x66af1d);}return _0x234989[_0x587f('0x11')](_0x66af1d)[_0x587f('0x12')]();};}function respondWithResult(_0x568aa0,_0x348eab){_0x348eab=_0x348eab||0xc8;return function(_0x44b67e){if(_0x44b67e){return _0x568aa0[_0x587f('0x11')](_0x348eab)[_0x587f('0x13')](_0x44b67e);}};}function respondWithFilteredResult(_0x5580ed,_0x3b2082){return function(_0x2dd658){if(_0x2dd658){var _0x11b6a2=_0x2dd658[_0x587f('0x14')],_0xe0cc92=_0x3b2082[_0x587f('0x15')],_0x236476=_0x3b2082['offset']+_0x3b2082[_0x587f('0x16')],_0x2138c2;if(_0x236476>=_0x11b6a2){_0x236476=_0x11b6a2;_0x2138c2=0xc8;}else{_0x2138c2=0xce;}_0x5580ed['status'](_0x2138c2);return _0x5580ed[_0x587f('0x17')]('Content-Range',_0xe0cc92+'-'+_0x236476+'/'+_0x11b6a2)[_0x587f('0x13')](_0x2dd658);}return null;};}function patchUpdates(_0x741a34){return function(_0x51ce54){try{jsonpatch[_0x587f('0x18')](_0x51ce54,_0x741a34,!![]);}catch(_0x3e11cf){return BPromise[_0x587f('0x19')](_0x3e11cf);}return _0x51ce54[_0x587f('0x1a')]();};}function saveUpdates(_0x4df5ef,_0x2ebcf2){return function(_0x3bad3e){if(_0x3bad3e){return _0x3bad3e['update'](_0x4df5ef)[_0x587f('0x1b')](function(_0x1b25f3){return _0x1b25f3;});}return null;};}function removeEntity(_0x25ebd8,_0x465ea4){return function(_0x3c0b6f){if(_0x3c0b6f){return _0x3c0b6f[_0x587f('0x1c')]()[_0x587f('0x1b')](function(){_0x25ebd8[_0x587f('0x11')](0xcc)[_0x587f('0x12')]();});}};}function handleEntityNotFound(_0x44c42f,_0x3312be){return function(_0x18a96d){if(!_0x18a96d){_0x44c42f['sendStatus'](0x194);}return _0x18a96d;};}function handleError(_0x4474d7,_0x46f738){_0x46f738=_0x46f738||0x1f4;return function(_0x46e3bd){logger['error'](_0x46e3bd[_0x587f('0x1d')]);if(_0x46e3bd[_0x587f('0x1e')]){delete _0x46e3bd['name'];}_0x4474d7[_0x587f('0x11')](_0x46f738)['send'](_0x46e3bd);};}exports[_0x587f('0x1f')]=function(_0x4af2d4,_0x58188c){var _0x478938={},_0x3740e4={},_0x5ede05={'count':0x0,'rows':[]};var _0x22610=_['map'](db[_0x587f('0x20')]['rawAttributes'],function(_0x3ec98c){return{'name':_0x3ec98c[_0x587f('0x21')],'type':_0x3ec98c['type'][_0x587f('0x22')]};});_0x3740e4[_0x587f('0x23')]=_[_0x587f('0x24')](_0x22610,'name');_0x3740e4[_0x587f('0x25')]=_[_0x587f('0x26')](_0x4af2d4[_0x587f('0x25')]);_0x3740e4[_0x587f('0x27')]=_[_0x587f('0x28')](_0x3740e4[_0x587f('0x23')],_0x3740e4[_0x587f('0x25')]);_0x478938[_0x587f('0x29')]=_['intersection'](_0x3740e4[_0x587f('0x23')],qs[_0x587f('0x2a')](_0x4af2d4[_0x587f('0x25')][_0x587f('0x2a')]));_0x478938[_0x587f('0x29')]=_0x478938[_0x587f('0x29')][_0x587f('0x2b')]?_0x478938['attributes']:_0x3740e4[_0x587f('0x23')];if(!_0x4af2d4[_0x587f('0x25')][_0x587f('0x2c')](_0x587f('0x2d'))){_0x478938[_0x587f('0x16')]=qs[_0x587f('0x16')](_0x4af2d4[_0x587f('0x25')][_0x587f('0x16')]);_0x478938[_0x587f('0x15')]=qs['offset'](_0x4af2d4[_0x587f('0x25')][_0x587f('0x15')]);}_0x478938['order']=qs[_0x587f('0x2e')](_0x4af2d4[_0x587f('0x25')]['sort']);_0x478938['where']=qs['filters'](_['pick'](_0x4af2d4['query'],_0x3740e4['filters']),_0x22610);if(_0x4af2d4[_0x587f('0x25')][_0x587f('0x2f')]){_0x478938['where']=_['merge'](_0x478938[_0x587f('0x30')],{'$or':_[_0x587f('0x24')](_0x22610,function(_0x5a23af){if(_0x5a23af[_0x587f('0x31')]!==_0x587f('0x32')){var _0x5860b2={};_0x5860b2[_0x5a23af[_0x587f('0x1e')]]={'$like':'%'+_0x4af2d4[_0x587f('0x25')][_0x587f('0x2f')]+'%'};return _0x5860b2;}})});}_0x478938=_[_0x587f('0x33')]({},_0x478938,_0x4af2d4[_0x587f('0x34')]);var _0x55ce32={'where':_0x478938[_0x587f('0x30')]};return db[_0x587f('0x20')]['count'](_0x55ce32)[_0x587f('0x1b')](function(_0x3405e6){_0x5ede05[_0x587f('0x14')]=_0x3405e6;if(_0x4af2d4[_0x587f('0x25')][_0x587f('0x35')]){_0x478938[_0x587f('0x36')]=[{'all':!![]}];}return db[_0x587f('0x20')][_0x587f('0x37')](_0x478938);})[_0x587f('0x1b')](function(_0x2ce442){_0x5ede05[_0x587f('0x38')]=_0x2ce442;return _0x5ede05;})[_0x587f('0x1b')](respondWithFilteredResult(_0x58188c,_0x478938))[_0x587f('0x39')](handleError(_0x58188c,null));};exports[_0x587f('0x3a')]=function(_0x443de3,_0x51606e){var _0x45a898={'raw':!![],'where':{'id':_0x443de3['params']['id']}},_0x567854={};_0x567854['model']=_[_0x587f('0x26')](db[_0x587f('0x20')][_0x587f('0x3b')]);_0x567854[_0x587f('0x25')]=_[_0x587f('0x26')](_0x443de3['query']);_0x567854['filters']=_[_0x587f('0x28')](_0x567854[_0x587f('0x23')],_0x567854[_0x587f('0x25')]);_0x45a898[_0x587f('0x29')]=_[_0x587f('0x28')](_0x567854['model'],qs[_0x587f('0x2a')](_0x443de3['query'][_0x587f('0x2a')]));_0x45a898[_0x587f('0x29')]=_0x45a898[_0x587f('0x29')][_0x587f('0x2b')]?_0x45a898[_0x587f('0x29')]:_0x567854[_0x587f('0x23')];if(_0x443de3[_0x587f('0x25')][_0x587f('0x35')]){_0x45a898[_0x587f('0x36')]=[{'all':!![]}];}_0x45a898=_[_0x587f('0x33')]({},_0x45a898,_0x443de3[_0x587f('0x34')]);return db['JscriptySessionReport'][_0x587f('0x3c')](_0x45a898)[_0x587f('0x1b')](handleEntityNotFound(_0x51606e,null))['then'](respondWithResult(_0x51606e,null))[_0x587f('0x39')](handleError(_0x51606e,null));};exports[_0x587f('0x3d')]=function(_0x7de416,_0x3b5c96){return db[_0x587f('0x20')][_0x587f('0x3d')](_0x7de416[_0x587f('0x3e')],{})[_0x587f('0x1b')](respondWithResult(_0x3b5c96,0xc9))['catch'](handleError(_0x3b5c96,null));};exports[_0x587f('0x3f')]=function(_0x2dfec1,_0x2bf88d){if(_0x2dfec1[_0x587f('0x3e')]['id']){delete _0x2dfec1['body']['id'];}return db[_0x587f('0x20')][_0x587f('0x3c')]({'where':{'id':_0x2dfec1[_0x587f('0x40')]['id']}})['then'](handleEntityNotFound(_0x2bf88d,null))[_0x587f('0x1b')](saveUpdates(_0x2dfec1[_0x587f('0x3e')],null))[_0x587f('0x1b')](respondWithResult(_0x2bf88d,null))[_0x587f('0x39')](handleError(_0x2bf88d,null));};exports['destroy']=function(_0x242925,_0x3db35c){return db['JscriptySessionReport'][_0x587f('0x3c')]({'where':{'id':_0x242925[_0x587f('0x40')]['id']}})[_0x587f('0x1b')](handleEntityNotFound(_0x3db35c,null))[_0x587f('0x1b')](removeEntity(_0x3db35c,null))[_0x587f('0x39')](handleError(_0x3db35c,null));};exports['describe']=function(_0x390fc2,_0x26ce83){return db[_0x587f('0x20')][_0x587f('0x41')]()['then'](respondWithResult(_0x26ce83,null))[_0x587f('0x39')](handleError(_0x26ce83,null));};exports[_0x587f('0x42')]=function(_0x4c02df,_0x16bb33,_0x3cd17b){var _0x570e16={'raw':!![],'where':{}};var _0x59674e={};var _0x5e7b09={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x587f('0x43')]({'where':{'id':_0x4c02df[_0x587f('0x40')]['id']}})[_0x587f('0x1b')](handleEntityNotFound(_0x16bb33,null))['then'](function(_0x33d638){if(_0x33d638){_0x59674e[_0x587f('0x23')]=_[_0x587f('0x26')](db[_0x587f('0x44')][_0x587f('0x3b')]);_0x59674e[_0x587f('0x25')]=_['keys'](_0x4c02df['query']);_0x59674e[_0x587f('0x27')]=_[_0x587f('0x28')](_0x59674e[_0x587f('0x23')],_0x59674e[_0x587f('0x25')]);_0x570e16['attributes']=_[_0x587f('0x28')](_0x59674e[_0x587f('0x23')],qs[_0x587f('0x2a')](_0x4c02df[_0x587f('0x25')][_0x587f('0x2a')]));_0x570e16[_0x587f('0x29')]=_0x570e16[_0x587f('0x29')][_0x587f('0x2b')]?_0x570e16[_0x587f('0x29')]:_0x59674e[_0x587f('0x23')];if(!_0x4c02df[_0x587f('0x25')]['hasOwnProperty']('nolimit')){_0x570e16[_0x587f('0x16')]=qs[_0x587f('0x16')](_0x4c02df['query'][_0x587f('0x16')]);_0x570e16[_0x587f('0x15')]=qs[_0x587f('0x15')](_0x4c02df['query'][_0x587f('0x15')]);}_0x570e16[_0x587f('0x45')]=qs[_0x587f('0x2e')](_0x4c02df[_0x587f('0x25')]['sort']);_0x570e16[_0x587f('0x30')]=qs[_0x587f('0x27')](_[_0x587f('0x46')](_0x4c02df[_0x587f('0x25')],_0x59674e['filters']));_0x570e16[_0x587f('0x30')][_0x587f('0x47')]=_0x33d638['id'];if(_0x4c02df[_0x587f('0x25')]['filter']){_0x570e16[_0x587f('0x30')]=_['merge'](_0x570e16[_0x587f('0x30')],{'$or':_[_0x587f('0x24')](_0x570e16[_0x587f('0x29')],function(_0x4e1e5c){var _0x2440ab={};_0x2440ab[_0x4e1e5c]={'$like':'%'+_0x4c02df[_0x587f('0x25')][_0x587f('0x2f')]+'%'};return _0x2440ab;})});}_0x570e16=_[_0x587f('0x33')]({},_0x570e16,_0x4c02df[_0x587f('0x34')]);return db[_0x587f('0x44')][_0x587f('0x14')]({'where':_0x570e16[_0x587f('0x30')]})[_0x587f('0x1b')](function(_0x309469){_0x5e7b09[_0x587f('0x14')]=_0x309469;if(_0x4c02df[_0x587f('0x25')][_0x587f('0x35')]){_0x570e16[_0x587f('0x36')]=[{'all':!![]}];}return db[_0x587f('0x44')][_0x587f('0x37')](_0x570e16);})[_0x587f('0x1b')](function(_0x42bd98){_0x5e7b09['rows']=_0x42bd98;return _0x5e7b09;});}})[_0x587f('0x1b')](respondWithFilteredResult(_0x16bb33,_0x570e16))[_0x587f('0x39')](handleError(_0x16bb33,null));}; \ No newline at end of file +var _0xcfcc=['then','destroy','error','stack','name','send','index','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','map','options','JscriptySessionReport','includeAll','include','rows','catch','show','find','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','order','SessionId','filter','findAll','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','save','update'];(function(_0x385f81,_0x394333){var _0x390b9e=function(_0x5541b7){while(--_0x5541b7){_0x385f81['push'](_0x385f81['shift']());}};_0x390b9e(++_0x394333);}(_0xcfcc,0x76));var _0xccfc=function(_0x17fcd0,_0x12d544){_0x17fcd0=_0x17fcd0-0x0;var _0xc38f51=_0xcfcc[_0x17fcd0];return _0xc38f51;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xccfc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xccfc('0x1'));var rp=require(_0xccfc('0x2'));var moment=require(_0xccfc('0x3'));var BPromise=require(_0xccfc('0x4'));var Mustache=require(_0xccfc('0x5'));var util=require('util');var path=require(_0xccfc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xccfc('0x7'));var fs=require('fs');var _=require(_0xccfc('0x8'));var squel=require('squel');var crypto=require(_0xccfc('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xccfc('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xccfc('0xb'));var Redis=require(_0xccfc('0xc'));var authService=require(_0xccfc('0xd'));var qs=require(_0xccfc('0xe'));var as=require(_0xccfc('0xf'));var hardwareService=require(_0xccfc('0x10'));var logger=require(_0xccfc('0x11'))(_0xccfc('0x12'));var utils=require(_0xccfc('0x13'));var config=require('../../config/environment');var db=require(_0xccfc('0x14'))['db'];function respondWithStatusCode(_0x39d868,_0x2239fc){_0x2239fc=_0x2239fc||0xcc;return function(_0x177417){if(_0x177417){return _0x39d868[_0xccfc('0x15')](_0x2239fc);}return _0x39d868['status'](_0x2239fc)[_0xccfc('0x16')]();};}function respondWithResult(_0x1c4bc8,_0x744f41){_0x744f41=_0x744f41||0xc8;return function(_0x3fef58){if(_0x3fef58){return _0x1c4bc8[_0xccfc('0x17')](_0x744f41)[_0xccfc('0x18')](_0x3fef58);}};}function respondWithFilteredResult(_0x43b766,_0x2cd99e){return function(_0x3b8ab7){if(_0x3b8ab7){var _0x50c0c0=_0x3b8ab7[_0xccfc('0x19')],_0x3b9187=_0x2cd99e[_0xccfc('0x1a')],_0x374e41=_0x2cd99e[_0xccfc('0x1a')]+_0x2cd99e[_0xccfc('0x1b')],_0x16795d;if(_0x374e41>=_0x50c0c0){_0x374e41=_0x50c0c0;_0x16795d=0xc8;}else{_0x16795d=0xce;}_0x43b766['status'](_0x16795d);return _0x43b766['set'](_0xccfc('0x1c'),_0x3b9187+'-'+_0x374e41+'/'+_0x50c0c0)[_0xccfc('0x18')](_0x3b8ab7);}return null;};}function patchUpdates(_0x4804f7){return function(_0x401b1e){try{jsonpatch[_0xccfc('0x1d')](_0x401b1e,_0x4804f7,!![]);}catch(_0x2d67d7){return BPromise['reject'](_0x2d67d7);}return _0x401b1e[_0xccfc('0x1e')]();};}function saveUpdates(_0x500a4e,_0x36913f){return function(_0x1343f6){if(_0x1343f6){return _0x1343f6[_0xccfc('0x1f')](_0x500a4e)[_0xccfc('0x20')](function(_0x4a875c){return _0x4a875c;});}return null;};}function removeEntity(_0x210c9b,_0x2e1398){return function(_0x562538){if(_0x562538){return _0x562538[_0xccfc('0x21')]()[_0xccfc('0x20')](function(){_0x210c9b[_0xccfc('0x17')](0xcc)[_0xccfc('0x16')]();});}};}function handleEntityNotFound(_0x3ed3f2,_0x21f826){return function(_0x3f311a){if(!_0x3f311a){_0x3ed3f2[_0xccfc('0x15')](0x194);}return _0x3f311a;};}function handleError(_0x4b36b8,_0x1e6b1d){_0x1e6b1d=_0x1e6b1d||0x1f4;return function(_0x2fb7ae){logger[_0xccfc('0x22')](_0x2fb7ae[_0xccfc('0x23')]);if(_0x2fb7ae[_0xccfc('0x24')]){delete _0x2fb7ae[_0xccfc('0x24')];}_0x4b36b8[_0xccfc('0x17')](_0x1e6b1d)[_0xccfc('0x25')](_0x2fb7ae);};}exports[_0xccfc('0x26')]=function(_0xda8510,_0x30f992){var _0x3315a6={},_0x541653={},_0x1ba9f3={'count':0x0,'rows':[]};var _0x2974fb=_['map'](db['JscriptySessionReport'][_0xccfc('0x27')],function(_0x42d04e){return{'name':_0x42d04e['fieldName'],'type':_0x42d04e[_0xccfc('0x28')]['key']};});_0x541653[_0xccfc('0x29')]=_['map'](_0x2974fb,_0xccfc('0x24'));_0x541653[_0xccfc('0x2a')]=_[_0xccfc('0x2b')](_0xda8510[_0xccfc('0x2a')]);_0x541653[_0xccfc('0x2c')]=_[_0xccfc('0x2d')](_0x541653['model'],_0x541653['query']);_0x3315a6[_0xccfc('0x2e')]=_[_0xccfc('0x2d')](_0x541653[_0xccfc('0x29')],qs[_0xccfc('0x2f')](_0xda8510['query'][_0xccfc('0x2f')]));_0x3315a6[_0xccfc('0x2e')]=_0x3315a6[_0xccfc('0x2e')][_0xccfc('0x30')]?_0x3315a6[_0xccfc('0x2e')]:_0x541653['model'];if(!_0xda8510[_0xccfc('0x2a')][_0xccfc('0x31')](_0xccfc('0x32'))){_0x3315a6[_0xccfc('0x1b')]=qs[_0xccfc('0x1b')](_0xda8510['query'][_0xccfc('0x1b')]);_0x3315a6['offset']=qs['offset'](_0xda8510[_0xccfc('0x2a')]['offset']);}_0x3315a6['order']=qs[_0xccfc('0x33')](_0xda8510['query']['sort']);_0x3315a6['where']=qs[_0xccfc('0x2c')](_[_0xccfc('0x34')](_0xda8510['query'],_0x541653[_0xccfc('0x2c')]),_0x2974fb);if(_0xda8510['query']['filter']){_0x3315a6['where']=_[_0xccfc('0x35')](_0x3315a6[_0xccfc('0x36')],{'$or':_[_0xccfc('0x37')](_0x2974fb,function(_0x29a58f){if(_0x29a58f[_0xccfc('0x28')]!=='VIRTUAL'){var _0x360c16={};_0x360c16[_0x29a58f[_0xccfc('0x24')]]={'$like':'%'+_0xda8510[_0xccfc('0x2a')]['filter']+'%'};return _0x360c16;}})});}_0x3315a6=_[_0xccfc('0x35')]({},_0x3315a6,_0xda8510[_0xccfc('0x38')]);var _0xcb6e59={'where':_0x3315a6[_0xccfc('0x36')]};return db[_0xccfc('0x39')][_0xccfc('0x19')](_0xcb6e59)[_0xccfc('0x20')](function(_0x37ea03){_0x1ba9f3[_0xccfc('0x19')]=_0x37ea03;if(_0xda8510['query'][_0xccfc('0x3a')]){_0x3315a6[_0xccfc('0x3b')]=[{'all':!![]}];}return db[_0xccfc('0x39')]['findAll'](_0x3315a6);})['then'](function(_0x61d52){_0x1ba9f3[_0xccfc('0x3c')]=_0x61d52;return _0x1ba9f3;})[_0xccfc('0x20')](respondWithFilteredResult(_0x30f992,_0x3315a6))[_0xccfc('0x3d')](handleError(_0x30f992,null));};exports[_0xccfc('0x3e')]=function(_0x34cd84,_0x4be9f5){var _0x1bf939={'raw':!![],'where':{'id':_0x34cd84['params']['id']}},_0x4a397a={};_0x4a397a['model']=_[_0xccfc('0x2b')](db[_0xccfc('0x39')][_0xccfc('0x27')]);_0x4a397a['query']=_[_0xccfc('0x2b')](_0x34cd84[_0xccfc('0x2a')]);_0x4a397a['filters']=_[_0xccfc('0x2d')](_0x4a397a[_0xccfc('0x29')],_0x4a397a[_0xccfc('0x2a')]);_0x1bf939[_0xccfc('0x2e')]=_['intersection'](_0x4a397a[_0xccfc('0x29')],qs[_0xccfc('0x2f')](_0x34cd84[_0xccfc('0x2a')][_0xccfc('0x2f')]));_0x1bf939[_0xccfc('0x2e')]=_0x1bf939[_0xccfc('0x2e')][_0xccfc('0x30')]?_0x1bf939['attributes']:_0x4a397a[_0xccfc('0x29')];if(_0x34cd84[_0xccfc('0x2a')][_0xccfc('0x3a')]){_0x1bf939[_0xccfc('0x3b')]=[{'all':!![]}];}_0x1bf939=_['merge']({},_0x1bf939,_0x34cd84['options']);return db[_0xccfc('0x39')][_0xccfc('0x3f')](_0x1bf939)[_0xccfc('0x20')](handleEntityNotFound(_0x4be9f5,null))[_0xccfc('0x20')](respondWithResult(_0x4be9f5,null))['catch'](handleError(_0x4be9f5,null));};exports[_0xccfc('0x40')]=function(_0x4cef9c,_0x109f66){return db[_0xccfc('0x39')][_0xccfc('0x40')](_0x4cef9c[_0xccfc('0x41')],{})[_0xccfc('0x20')](respondWithResult(_0x109f66,0xc9))[_0xccfc('0x3d')](handleError(_0x109f66,null));};exports[_0xccfc('0x1f')]=function(_0x53f15a,_0x5cfffa){if(_0x53f15a[_0xccfc('0x41')]['id']){delete _0x53f15a[_0xccfc('0x41')]['id'];}return db[_0xccfc('0x39')][_0xccfc('0x3f')]({'where':{'id':_0x53f15a['params']['id']}})[_0xccfc('0x20')](handleEntityNotFound(_0x5cfffa,null))[_0xccfc('0x20')](saveUpdates(_0x53f15a[_0xccfc('0x41')],null))[_0xccfc('0x20')](respondWithResult(_0x5cfffa,null))[_0xccfc('0x3d')](handleError(_0x5cfffa,null));};exports[_0xccfc('0x21')]=function(_0x2d1086,_0x1f9959){return db[_0xccfc('0x39')][_0xccfc('0x3f')]({'where':{'id':_0x2d1086[_0xccfc('0x42')]['id']}})[_0xccfc('0x20')](handleEntityNotFound(_0x1f9959,null))[_0xccfc('0x20')](removeEntity(_0x1f9959,null))[_0xccfc('0x3d')](handleError(_0x1f9959,null));};exports[_0xccfc('0x43')]=function(_0xe1985a,_0x18e236){return db[_0xccfc('0x39')][_0xccfc('0x43')]()[_0xccfc('0x20')](respondWithResult(_0x18e236,null))[_0xccfc('0x3d')](handleError(_0x18e236,null));};exports[_0xccfc('0x44')]=function(_0x32aa5b,_0x3f79b1,_0x47d61f){var _0x26fb51={'raw':!![],'where':{}};var _0x566ce3={};var _0x551ab2={'count':0x0,'rows':[]};return db[_0xccfc('0x39')][_0xccfc('0x45')]({'where':{'id':_0x32aa5b[_0xccfc('0x42')]['id']}})[_0xccfc('0x20')](handleEntityNotFound(_0x3f79b1,null))['then'](function(_0x553678){if(_0x553678){_0x566ce3[_0xccfc('0x29')]=_[_0xccfc('0x2b')](db[_0xccfc('0x46')][_0xccfc('0x27')]);_0x566ce3[_0xccfc('0x2a')]=_[_0xccfc('0x2b')](_0x32aa5b[_0xccfc('0x2a')]);_0x566ce3[_0xccfc('0x2c')]=_['intersection'](_0x566ce3[_0xccfc('0x29')],_0x566ce3[_0xccfc('0x2a')]);_0x26fb51[_0xccfc('0x2e')]=_[_0xccfc('0x2d')](_0x566ce3['model'],qs[_0xccfc('0x2f')](_0x32aa5b[_0xccfc('0x2a')][_0xccfc('0x2f')]));_0x26fb51[_0xccfc('0x2e')]=_0x26fb51[_0xccfc('0x2e')][_0xccfc('0x30')]?_0x26fb51[_0xccfc('0x2e')]:_0x566ce3[_0xccfc('0x29')];if(!_0x32aa5b[_0xccfc('0x2a')][_0xccfc('0x31')](_0xccfc('0x32'))){_0x26fb51[_0xccfc('0x1b')]=qs[_0xccfc('0x1b')](_0x32aa5b[_0xccfc('0x2a')][_0xccfc('0x1b')]);_0x26fb51[_0xccfc('0x1a')]=qs[_0xccfc('0x1a')](_0x32aa5b[_0xccfc('0x2a')]['offset']);}_0x26fb51[_0xccfc('0x47')]=qs['sort'](_0x32aa5b[_0xccfc('0x2a')][_0xccfc('0x33')]);_0x26fb51[_0xccfc('0x36')]=qs[_0xccfc('0x2c')](_[_0xccfc('0x34')](_0x32aa5b['query'],_0x566ce3['filters']));_0x26fb51[_0xccfc('0x36')][_0xccfc('0x48')]=_0x553678['id'];if(_0x32aa5b['query'][_0xccfc('0x49')]){_0x26fb51[_0xccfc('0x36')]=_[_0xccfc('0x35')](_0x26fb51[_0xccfc('0x36')],{'$or':_['map'](_0x26fb51[_0xccfc('0x2e')],function(_0x55eaa8){var _0x3c6e32={};_0x3c6e32[_0x55eaa8]={'$like':'%'+_0x32aa5b[_0xccfc('0x2a')][_0xccfc('0x49')]+'%'};return _0x3c6e32;})});}_0x26fb51=_['merge']({},_0x26fb51,_0x32aa5b[_0xccfc('0x38')]);return db[_0xccfc('0x46')][_0xccfc('0x19')]({'where':_0x26fb51[_0xccfc('0x36')]})['then'](function(_0x55ba44){_0x551ab2[_0xccfc('0x19')]=_0x55ba44;if(_0x32aa5b[_0xccfc('0x2a')][_0xccfc('0x3a')]){_0x26fb51['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xccfc('0x4a')](_0x26fb51);})[_0xccfc('0x20')](function(_0x4f0f6f){_0x551ab2[_0xccfc('0x3c')]=_0x4f0f6f;return _0x551ab2;});}})[_0xccfc('0x20')](respondWithFilteredResult(_0x3f79b1,_0x26fb51))[_0xccfc('0x3d')](handleError(_0x3f79b1,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index dc2d574..feac4fb 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 _0x6931=['moment','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api'];(function(_0x2d15a0,_0x1ace85){var _0xdb8f45=function(_0x9a87e9){while(--_0x9a87e9){_0x2d15a0['push'](_0x2d15a0['shift']());}};_0xdb8f45(++_0x1ace85);}(_0x6931,0x1a9));var _0x1693=function(_0x35c548,_0xeaab19){_0x35c548=_0x35c548-0x0;var _0x4d8254=_0x6931[_0x35c548];return _0x4d8254;};'use strict';var _=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var logger=require(_0x1693('0x2'))(_0x1693('0x3'));var moment=require(_0x1693('0x4'));var BPromise=require(_0x1693('0x5'));var rp=require(_0x1693('0x6'));var fs=require('fs');var path=require(_0x1693('0x7'));var rimraf=require('rimraf');var config=require(_0x1693('0x8'));var attributes=require(_0x1693('0x9'));module[_0x1693('0xa')]=function(_0x455646,_0x379d6c){return _0x455646['define'](_0x1693('0xb'),attributes,{'tableName':_0x1693('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0f4=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','util','moment','bluebird','path'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xf0f4,0x182));var _0x4f0f=function(_0x1dce77,_0x53d96b){_0x1dce77=_0x1dce77-0x0;var _0x1ed728=_0xf0f4[_0x1dce77];return _0x1ed728;};'use strict';var _=require('lodash');var util=require(_0x4f0f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4f0f('0x1'));var BPromise=require(_0x4f0f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f0f('0x3'));var rimraf=require(_0x4f0f('0x4'));var config=require(_0x4f0f('0x5'));var attributes=require(_0x4f0f('0x6'));module[_0x4f0f('0x7')]=function(_0x15e6cd,_0x3285cd){return _0x15e6cd['define'](_0x4f0f('0x8'),attributes,{'tableName':_0x4f0f('0x9'),'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 04f8347..07b26ea 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 _0xc29d=['jayson/promise','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x3b8ab0,_0x54e199){var _0x14a63f=function(_0x2714ef){while(--_0x2714ef){_0x3b8ab0['push'](_0x3b8ab0['shift']());}};_0x14a63f(++_0x54e199);}(_0xc29d,0x149));var _0xdc29=function(_0x8a9fdd,_0x2bd167){_0x8a9fdd=_0x8a9fdd-0x0;var _0x47858b=_0xc29d[_0x8a9fdd];return _0x47858b;};'use strict';var _=require(_0xdc29('0x0'));var util=require(_0xdc29('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdc29('0x2'));var db=require(_0xdc29('0x3'))['db'];var utils=require(_0xdc29('0x4'));var logger=require(_0xdc29('0x5'))(_0xdc29('0x6'));var config=require('../../config/environment');var jayson=require(_0xdc29('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c729d,_0x17f46b,_0x37764e){return new BPromise(function(_0x35bbb2,_0x6b13f5){return client[_0xdc29('0x8')](_0x3c729d,_0x37764e)[_0xdc29('0x9')](function(_0x578f57){logger[_0xdc29('0xa')](_0xdc29('0xb'),_0x17f46b,_0xdc29('0xc'));logger[_0xdc29('0xd')](_0xdc29('0xe'),_0x17f46b,_0xdc29('0xc'),JSON[_0xdc29('0xf')](_0x578f57));if(_0x578f57[_0xdc29('0x10')]){if(_0x578f57[_0xdc29('0x10')][_0xdc29('0x11')]===0x1f4){logger[_0xdc29('0x10')](_0xdc29('0xb'),_0x17f46b,_0x578f57[_0xdc29('0x10')][_0xdc29('0x12')]);return _0x6b13f5(_0x578f57[_0xdc29('0x10')]['message']);}logger[_0xdc29('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x17f46b,_0x578f57[_0xdc29('0x10')][_0xdc29('0x12')]);return _0x35bbb2(_0x578f57[_0xdc29('0x10')][_0xdc29('0x12')]);}else{logger[_0xdc29('0xa')](_0xdc29('0xb'),_0x17f46b,_0xdc29('0xc'));_0x35bbb2(_0x578f57[_0xdc29('0x13')]['message']);}})[_0xdc29('0x14')](function(_0x401d43){logger[_0xdc29('0x10')](_0xdc29('0xb'),_0x17f46b,_0x401d43);_0x6b13f5(_0x401d43);});});} \ No newline at end of file +var _0xa38f=['code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x89a001,_0x3a9a8c){var _0x5f3ec2=function(_0x3e849b){while(--_0x3e849b){_0x89a001['push'](_0x89a001['shift']());}};_0x5f3ec2(++_0x3a9a8c);}(_0xa38f,0xea));var _0xfa38=function(_0x181c76,_0x1b169e){_0x181c76=_0x181c76-0x0;var _0x34d09d=_0xa38f[_0x181c76];return _0x34d09d;};'use strict';var _=require(_0xfa38('0x0'));var util=require(_0xfa38('0x1'));var moment=require('moment');var BPromise=require(_0xfa38('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa38('0x3'));var db=require(_0xfa38('0x4'))['db'];var utils=require(_0xfa38('0x5'));var logger=require(_0xfa38('0x6'))(_0xfa38('0x7'));var config=require(_0xfa38('0x8'));var jayson=require(_0xfa38('0x9'));var client=jayson[_0xfa38('0xa')][_0xfa38('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35d15c,_0x1dfc76,_0x106147){return new BPromise(function(_0x353e25,_0x1bfdb4){return client[_0xfa38('0xc')](_0x35d15c,_0x106147)['then'](function(_0x5e9b0d){logger[_0xfa38('0xd')](_0xfa38('0xe'),_0x1dfc76,_0xfa38('0xf'));logger[_0xfa38('0x10')](_0xfa38('0x11'),_0x1dfc76,'request\x20sent',JSON['stringify'](_0x5e9b0d));if(_0x5e9b0d[_0xfa38('0x12')]){if(_0x5e9b0d[_0xfa38('0x12')][_0xfa38('0x13')]===0x1f4){logger[_0xfa38('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x1dfc76,_0x5e9b0d[_0xfa38('0x12')][_0xfa38('0x14')]);return _0x1bfdb4(_0x5e9b0d[_0xfa38('0x12')][_0xfa38('0x14')]);}logger[_0xfa38('0x12')](_0xfa38('0xe'),_0x1dfc76,_0x5e9b0d[_0xfa38('0x12')][_0xfa38('0x14')]);return _0x353e25(_0x5e9b0d[_0xfa38('0x12')][_0xfa38('0x14')]);}else{logger[_0xfa38('0xd')](_0xfa38('0xe'),_0x1dfc76,_0xfa38('0xf'));_0x353e25(_0x5e9b0d[_0xfa38('0x15')][_0xfa38('0x14')]);}})[_0xfa38('0x16')](function(_0x445b19){logger[_0xfa38('0x12')](_0xfa38('0xe'),_0x1dfc76,_0x445b19);_0x1bfdb4(_0x445b19);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index b15e9e0..feb62cf 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 _0x1608=['../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express'];(function(_0x274a4e,_0x520529){var _0x1d5ce9=function(_0x4704b2){while(--_0x4704b2){_0x274a4e['push'](_0x274a4e['shift']());}};_0x1d5ce9(++_0x520529);}(_0x1608,0xcb));var _0x8160=function(_0xe433a,_0x270aea){_0xe433a=_0xe433a-0x0;var _0x450472=_0x1608[_0xe433a];return _0x450472;};'use strict';var multer=require(_0x8160('0x0'));var util=require(_0x8160('0x1'));var path=require(_0x8160('0x2'));var timeout=require(_0x8160('0x3'));var express=require(_0x8160('0x4'));var router=express['Router']();var auth=require(_0x8160('0x5'));var interaction=require(_0x8160('0x6'));var config=require(_0x8160('0x7'));var controller=require(_0x8160('0x8'));router[_0x8160('0x9')]('/',controller[_0x8160('0xa')]);router[_0x8160('0xb')](_0x8160('0xc'),auth[_0x8160('0xd')](),controller[_0x8160('0xe')]);module[_0x8160('0xf')]=router; \ No newline at end of file +var _0xe838=['update','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','isAuthenticated'];(function(_0xe9a47c,_0x1c6713){var _0x23ea59=function(_0xd39811){while(--_0xd39811){_0xe9a47c['push'](_0xe9a47c['shift']());}};_0x23ea59(++_0x1c6713);}(_0xe838,0x144));var _0x8e83=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe838[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x8e83('0x0'));var path=require(_0x8e83('0x1'));var timeout=require(_0x8e83('0x2'));var express=require(_0x8e83('0x3'));var router=express['Router']();var auth=require(_0x8e83('0x4'));var interaction=require(_0x8e83('0x5'));var config=require(_0x8e83('0x6'));var controller=require(_0x8e83('0x7'));router[_0x8e83('0x8')]('/',controller[_0x8e83('0x9')]);router[_0x8e83('0xa')]('/:id',auth[_0x8e83('0xb')](),controller[_0x8e83('0xc')]);module[_0x8e83('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 94f8e94..b7073b3 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 _0x31f0=['TEXT','STRING','INTEGER','sequelize'];(function(_0x2bde9f,_0x3ccd1b){var _0x3e8886=function(_0x3984bf){while(--_0x3984bf){_0x2bde9f['push'](_0x2bde9f['shift']());}};_0x3e8886(++_0x3ccd1b);}(_0x31f0,0xb7));var _0x031f=function(_0x379957,_0x3ab032){_0x379957=_0x379957-0x0;var _0x1a0cc0=_0x31f0[_0x379957];return _0x1a0cc0;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'license':{'type':Sequelize[_0x031f('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x031f('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x031f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1261=['exports','TEXT','STRING','INTEGER'];(function(_0x2f8d02,_0x84cc4c){var _0x1dcbdc=function(_0x51349c){while(--_0x51349c){_0x2f8d02['push'](_0x2f8d02['shift']());}};_0x1dcbdc(++_0x84cc4c);}(_0x1261,0x144));var _0x1126=function(_0x46688f,_0x302e66){_0x46688f=_0x46688f-0x0;var _0x5ee527=_0x1261[_0x46688f];return _0x5ee527;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'license':{'type':Sequelize[_0x1126('0x1')]},'data1':{'type':Sequelize[_0x1126('0x2')]},'data2':{'type':Sequelize[_0x1126('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x1126('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 3afcc9f..b7c97d9 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 _0x3298=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','end','error','name','send','../../config/license/util','model','keys','License','rawAttributes','filters','intersection','attributes','query','fields','length','merge','options','getLicense','catch','update','body','find','get','checkLicense','key','demo','html-pdf'];(function(_0x67cd27,_0x2f90a9){var _0x5aacd7=function(_0xa87bf6){while(--_0xa87bf6){_0x67cd27['push'](_0x67cd27['shift']());}};_0x5aacd7(++_0x2f90a9);}(_0x3298,0x173));var _0x8329=function(_0x2b1f1b,_0x4cec23){_0x2b1f1b=_0x2b1f1b-0x0;var _0x4e0ad4=_0x3298[_0x2b1f1b];return _0x4e0ad4;};'use strict';var pdf=require(_0x8329('0x0'));var emlformat=require(_0x8329('0x1'));var rimraf=require(_0x8329('0x2'));var zipdir=require(_0x8329('0x3'));var jsonpatch=require(_0x8329('0x4'));var rp=require(_0x8329('0x5'));var moment=require('moment');var BPromise=require(_0x8329('0x6'));var Mustache=require(_0x8329('0x7'));var util=require(_0x8329('0x8'));var path=require(_0x8329('0x9'));var sox=require(_0x8329('0xa'));var csv=require(_0x8329('0xb'));var ejs=require(_0x8329('0xc'));var fs=require('fs');var _=require(_0x8329('0xd'));var squel=require('squel');var crypto=require(_0x8329('0xe'));var jsforce=require(_0x8329('0xf'));var deskjs=require(_0x8329('0x10'));var toCsv=require(_0x8329('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8329('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8329('0x12'));var hardwareService=require(_0x8329('0x13'));var logger=require('../../config/logger')(_0x8329('0x14'));var utils=require(_0x8329('0x15'));var config=require(_0x8329('0x16'));var db=require(_0x8329('0x17'))['db'];function respondWithStatusCode(_0x4ab4d7,_0x322530){_0x322530=_0x322530||0xcc;return function(_0x2a2296){if(_0x2a2296){return _0x4ab4d7[_0x8329('0x18')](_0x322530);}return _0x4ab4d7[_0x8329('0x19')](_0x322530)['end']();};}function respondWithResult(_0x5b6596,_0x459ac9){_0x459ac9=_0x459ac9||0xc8;return function(_0x2e0780){if(_0x2e0780){return _0x5b6596[_0x8329('0x19')](_0x459ac9)['json'](_0x2e0780);}};}function respondWithFilteredResult(_0x1823d5,_0x1cee4f){return function(_0x1d3401){if(_0x1d3401){var _0x43ad6c=_0x1d3401[_0x8329('0x1a')],_0x5786a1=_0x1cee4f[_0x8329('0x1b')],_0x522e17=_0x1cee4f['offset']+_0x1cee4f['limit'],_0x98b70d;if(_0x522e17>=_0x43ad6c){_0x522e17=_0x43ad6c;_0x98b70d=0xc8;}else{_0x98b70d=0xce;}_0x1823d5[_0x8329('0x19')](_0x98b70d);return _0x1823d5[_0x8329('0x1c')](_0x8329('0x1d'),_0x5786a1+'-'+_0x522e17+'/'+_0x43ad6c)[_0x8329('0x1e')](_0x1d3401);}return null;};}function patchUpdates(_0x35bf82){return function(_0x139532){try{jsonpatch[_0x8329('0x1f')](_0x139532,_0x35bf82,!![]);}catch(_0x2dc34d){return BPromise[_0x8329('0x20')](_0x2dc34d);}return _0x139532[_0x8329('0x21')]();};}function saveUpdates(_0x1add9f,_0xb402a7){return function(_0x3baa79){if(_0x3baa79){return _0x3baa79['update'](_0x1add9f)[_0x8329('0x22')](function(_0x3b5e8f){return _0x3b5e8f;});}return null;};}function removeEntity(_0x55f479,_0x5b32f6){return function(_0x5ebdd1){if(_0x5ebdd1){return _0x5ebdd1[_0x8329('0x23')]()[_0x8329('0x22')](function(){_0x55f479[_0x8329('0x19')](0xcc)[_0x8329('0x24')]();});}};}function handleEntityNotFound(_0x48a312,_0x57f77f){return function(_0x31f9d3){if(!_0x31f9d3){_0x48a312[_0x8329('0x18')](0x194);}return _0x31f9d3;};}function handleError(_0x20cdfb,_0x31e85b){_0x31e85b=_0x31e85b||0x1f4;return function(_0x23ef69){logger[_0x8329('0x25')](_0x23ef69['stack']);if(_0x23ef69['name']){delete _0x23ef69[_0x8329('0x26')];}_0x20cdfb['status'](_0x31e85b)[_0x8329('0x27')](_0x23ef69);};}var utilLicense=require(_0x8329('0x28'));exports['index']=function(_0x311125,_0x2d36fa){var _0x5bfa43={'raw':!![],'where':{'id':0x1}},_0x527f69={};_0x527f69[_0x8329('0x29')]=_[_0x8329('0x2a')](db[_0x8329('0x2b')][_0x8329('0x2c')]);_0x527f69['query']=_['keys'](_0x311125['query']);_0x527f69[_0x8329('0x2d')]=_[_0x8329('0x2e')](_0x527f69[_0x8329('0x29')],_0x527f69['query']);_0x5bfa43[_0x8329('0x2f')]=_[_0x8329('0x2e')](_0x527f69[_0x8329('0x29')],qs['fields'](_0x311125[_0x8329('0x30')][_0x8329('0x31')]));_0x5bfa43[_0x8329('0x2f')]=_0x5bfa43['attributes'][_0x8329('0x32')]?_0x5bfa43[_0x8329('0x2f')]:_0x527f69[_0x8329('0x29')];_0x5bfa43=_[_0x8329('0x33')]({},_0x5bfa43,_0x311125[_0x8329('0x34')]);return utilLicense[_0x8329('0x35')](_0x5bfa43)[_0x8329('0x22')](respondWithResult(_0x2d36fa,null))[_0x8329('0x36')](handleError(_0x2d36fa,null));};exports[_0x8329('0x37')]=function(_0x45725c,_0xaa252d){if(_0x45725c[_0x8329('0x38')]['id']){delete _0x45725c[_0x8329('0x38')]['id'];}return db[_0x8329('0x2b')][_0x8329('0x39')]({'where':{'id':_0x45725c['params']['id']}})[_0x8329('0x22')](handleEntityNotFound(_0xaa252d,null))[_0x8329('0x22')](function(_0x129380){var _0x3fc6f8=_0x129380[_0x8329('0x3a')]({'plain':!![]});return utilLicense[_0x8329('0x3b')](_0x3fc6f8,_0x45725c[_0x8329('0x38')][_0x8329('0x3c')]);})['then'](function(_0x1fc698){if(!_0x1fc698[_0x8329('0x3d')]){return saveUpdates(_0x45725c[_0x8329('0x38')],null);}return _0x1fc698;})[_0x8329('0x22')](respondWithResult(_0xaa252d,null))[_0x8329('0x36')](handleError(_0xaa252d,null));}; \ No newline at end of file +var _0x0b85=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','model','keys','License','rawAttributes','query','filters','attributes','intersection','fields','options','getLicense','catch','body','find','params','get','key','demo','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','querystring'];(function(_0x2284ac,_0x332de4){var _0x1fce10=function(_0x1d5ce3){while(--_0x1d5ce3){_0x2284ac['push'](_0x2284ac['shift']());}};_0x1fce10(++_0x332de4);}(_0x0b85,0x1d7));var _0x50b8=function(_0x73c753,_0xde472f){_0x73c753=_0x73c753-0x0;var _0x7e207e=_0x0b85[_0x73c753];return _0x7e207e;};'use strict';var pdf=require(_0x50b8('0x0'));var emlformat=require(_0x50b8('0x1'));var rimraf=require(_0x50b8('0x2'));var zipdir=require(_0x50b8('0x3'));var jsonpatch=require(_0x50b8('0x4'));var rp=require(_0x50b8('0x5'));var moment=require(_0x50b8('0x6'));var BPromise=require(_0x50b8('0x7'));var Mustache=require(_0x50b8('0x8'));var util=require(_0x50b8('0x9'));var path=require(_0x50b8('0xa'));var sox=require(_0x50b8('0xb'));var csv=require('to-csv');var ejs=require(_0x50b8('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x50b8('0xd'));var crypto=require(_0x50b8('0xe'));var jsforce=require(_0x50b8('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50b8('0x10'));var Papa=require('papaparse');var Redis=require(_0x50b8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x50b8('0x12'));var as=require(_0x50b8('0x13'));var hardwareService=require(_0x50b8('0x14'));var logger=require(_0x50b8('0x15'))(_0x50b8('0x16'));var utils=require(_0x50b8('0x17'));var config=require(_0x50b8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21a9dc,_0x1542e2){_0x1542e2=_0x1542e2||0xcc;return function(_0x4105e1){if(_0x4105e1){return _0x21a9dc['sendStatus'](_0x1542e2);}return _0x21a9dc[_0x50b8('0x19')](_0x1542e2)['end']();};}function respondWithResult(_0x31b525,_0x59add2){_0x59add2=_0x59add2||0xc8;return function(_0x21eef7){if(_0x21eef7){return _0x31b525[_0x50b8('0x19')](_0x59add2)[_0x50b8('0x1a')](_0x21eef7);}};}function respondWithFilteredResult(_0x2f259b,_0x1041e3){return function(_0x2b2091){if(_0x2b2091){var _0x3ddae6=_0x2b2091[_0x50b8('0x1b')],_0x761c19=_0x1041e3[_0x50b8('0x1c')],_0x5b6360=_0x1041e3[_0x50b8('0x1c')]+_0x1041e3['limit'],_0xddef6d;if(_0x5b6360>=_0x3ddae6){_0x5b6360=_0x3ddae6;_0xddef6d=0xc8;}else{_0xddef6d=0xce;}_0x2f259b[_0x50b8('0x19')](_0xddef6d);return _0x2f259b['set'](_0x50b8('0x1d'),_0x761c19+'-'+_0x5b6360+'/'+_0x3ddae6)['json'](_0x2b2091);}return null;};}function patchUpdates(_0x56988c){return function(_0xb142da){try{jsonpatch[_0x50b8('0x1e')](_0xb142da,_0x56988c,!![]);}catch(_0x404c00){return BPromise[_0x50b8('0x1f')](_0x404c00);}return _0xb142da[_0x50b8('0x20')]();};}function saveUpdates(_0x5637da,_0x1fec60){return function(_0x32e41b){if(_0x32e41b){return _0x32e41b[_0x50b8('0x21')](_0x5637da)[_0x50b8('0x22')](function(_0x2c544b){return _0x2c544b;});}return null;};}function removeEntity(_0x2d676e,_0x329722){return function(_0x2289e5){if(_0x2289e5){return _0x2289e5[_0x50b8('0x23')]()[_0x50b8('0x22')](function(){_0x2d676e['status'](0xcc)[_0x50b8('0x24')]();});}};}function handleEntityNotFound(_0x39f6e8,_0x4b239a){return function(_0x31efa3){if(!_0x31efa3){_0x39f6e8[_0x50b8('0x25')](0x194);}return _0x31efa3;};}function handleError(_0x4c3b04,_0x3813d3){_0x3813d3=_0x3813d3||0x1f4;return function(_0x4ca935){logger[_0x50b8('0x26')](_0x4ca935[_0x50b8('0x27')]);if(_0x4ca935['name']){delete _0x4ca935[_0x50b8('0x28')];}_0x4c3b04[_0x50b8('0x19')](_0x3813d3)[_0x50b8('0x29')](_0x4ca935);};}var utilLicense=require('../../config/license/util');exports[_0x50b8('0x2a')]=function(_0x544d9a,_0x1f2994){var _0x485a6f={'raw':!![],'where':{'id':0x1}},_0x52c6c1={};_0x52c6c1[_0x50b8('0x2b')]=_[_0x50b8('0x2c')](db[_0x50b8('0x2d')][_0x50b8('0x2e')]);_0x52c6c1[_0x50b8('0x2f')]=_[_0x50b8('0x2c')](_0x544d9a[_0x50b8('0x2f')]);_0x52c6c1[_0x50b8('0x30')]=_['intersection'](_0x52c6c1[_0x50b8('0x2b')],_0x52c6c1['query']);_0x485a6f[_0x50b8('0x31')]=_[_0x50b8('0x32')](_0x52c6c1['model'],qs[_0x50b8('0x33')](_0x544d9a[_0x50b8('0x2f')]['fields']));_0x485a6f['attributes']=_0x485a6f[_0x50b8('0x31')]['length']?_0x485a6f[_0x50b8('0x31')]:_0x52c6c1['model'];_0x485a6f=_['merge']({},_0x485a6f,_0x544d9a[_0x50b8('0x34')]);return utilLicense[_0x50b8('0x35')](_0x485a6f)['then'](respondWithResult(_0x1f2994,null))[_0x50b8('0x36')](handleError(_0x1f2994,null));};exports[_0x50b8('0x21')]=function(_0x1cc1e4,_0x145138){if(_0x1cc1e4[_0x50b8('0x37')]['id']){delete _0x1cc1e4[_0x50b8('0x37')]['id'];}return db[_0x50b8('0x2d')][_0x50b8('0x38')]({'where':{'id':_0x1cc1e4[_0x50b8('0x39')]['id']}})['then'](handleEntityNotFound(_0x145138,null))[_0x50b8('0x22')](function(_0x6807d0){var _0x5450b=_0x6807d0[_0x50b8('0x3a')]({'plain':!![]});return utilLicense['checkLicense'](_0x5450b,_0x1cc1e4[_0x50b8('0x37')][_0x50b8('0x3b')]);})[_0x50b8('0x22')](function(_0x52afb8){if(!_0x52afb8[_0x50b8('0x3c')]){return saveUpdates(_0x1cc1e4[_0x50b8('0x37')],null);}return _0x52afb8;})[_0x50b8('0x22')](respondWithResult(_0x145138,null))[_0x50b8('0x36')](handleError(_0x145138,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 7ed9495..3b6d3fe 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 _0xd8b0=['define','license','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x516bd3,_0x1c2c8d){var _0xe8aca6=function(_0x2e51c1){while(--_0x2e51c1){_0x516bd3['push'](_0x516bd3['shift']());}};_0xe8aca6(++_0x1c2c8d);}(_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('./license.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('License',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['api','moment','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','license','lodash','../../config/logger'];(function(_0x2bc400,_0x27208f){var _0x36ab53=function(_0x257660){while(--_0x257660){_0x2bc400['push'](_0x2bc400['shift']());}};_0x36ab53(++_0x27208f);}(_0xb10b,0x12a));var _0xbb10=function(_0x275a90,_0xa0f3cc){_0x275a90=_0x275a90-0x0;var _0x17b092=_0xb10b[_0x275a90];return _0x17b092;};'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')]('License',attributes,{'tableName':_0xbb10('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 de7dfcb..9bd6f62 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 _0x1ab1=['info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1918c7,_0x53ca10){var _0x4932c0=function(_0x4d66aa){while(--_0x4d66aa){_0x1918c7['push'](_0x1918c7['shift']());}};_0x4932c0(++_0x53ca10);}(_0x1ab1,0x83));var _0x11ab=function(_0x2e3095,_0x21da27){_0x2e3095=_0x2e3095-0x0;var _0x15cf5f=_0x1ab1[_0x2e3095];return _0x15cf5f;};'use strict';var _=require('lodash');var util=require(_0x11ab('0x0'));var moment=require(_0x11ab('0x1'));var BPromise=require(_0x11ab('0x2'));var rs=require(_0x11ab('0x3'));var fs=require('fs');var Redis=require(_0x11ab('0x4'));var db=require(_0x11ab('0x5'))['db'];var utils=require(_0x11ab('0x6'));var logger=require('../../config/logger')(_0x11ab('0x7'));var config=require(_0x11ab('0x8'));var jayson=require(_0x11ab('0x9'));var client=jayson[_0x11ab('0xa')][_0x11ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x531999,_0xe4281a,_0x26c091){return new BPromise(function(_0x4702b2,_0xa65ec9){return client['request'](_0x531999,_0x26c091)[_0x11ab('0xc')](function(_0x3979f9){logger[_0x11ab('0xd')](_0x11ab('0xe'),_0xe4281a,_0x11ab('0xf'));logger[_0x11ab('0x10')](_0x11ab('0x11'),_0xe4281a,'request\x20sent',JSON[_0x11ab('0x12')](_0x3979f9));if(_0x3979f9['error']){if(_0x3979f9[_0x11ab('0x13')][_0x11ab('0x14')]===0x1f4){logger[_0x11ab('0x13')]('License,\x20%s,\x20%s',_0xe4281a,_0x3979f9['error'][_0x11ab('0x15')]);return _0xa65ec9(_0x3979f9[_0x11ab('0x13')]['message']);}logger[_0x11ab('0x13')](_0x11ab('0xe'),_0xe4281a,_0x3979f9['error'][_0x11ab('0x15')]);return _0x4702b2(_0x3979f9['error'][_0x11ab('0x15')]);}else{logger[_0x11ab('0xd')]('License,\x20%s,\x20%s',_0xe4281a,'request\x20sent');_0x4702b2(_0x3979f9[_0x11ab('0x16')][_0x11ab('0x15')]);}})[_0x11ab('0x17')](function(_0x396011){logger[_0x11ab('0x13')](_0x11ab('0xe'),_0xe4281a,_0x396011);_0xa65ec9(_0x396011);});});} \ No newline at end of file +var _0xc4e6=['rpc','../../config/environment','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xc4e6,0x1d9));var _0x6c4e=function(_0x3f59b1,_0x25cdbe){_0x3f59b1=_0x3f59b1-0x0;var _0x11d2e8=_0xc4e6[_0x3f59b1];return _0x11d2e8;};'use strict';var _=require(_0x6c4e('0x0'));var util=require(_0x6c4e('0x1'));var moment=require('moment');var BPromise=require(_0x6c4e('0x2'));var rs=require(_0x6c4e('0x3'));var fs=require('fs');var Redis=require(_0x6c4e('0x4'));var db=require(_0x6c4e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c4e('0x6'))(_0x6c4e('0x7'));var config=require(_0x6c4e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6c4e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56fec4,_0x3355f9,_0x394d8b){return new BPromise(function(_0xb0496a,_0x2f91ad){return client[_0x6c4e('0xa')](_0x56fec4,_0x394d8b)[_0x6c4e('0xb')](function(_0x58c1da){logger[_0x6c4e('0xc')](_0x6c4e('0xd'),_0x3355f9,_0x6c4e('0xe'));logger[_0x6c4e('0xf')](_0x6c4e('0x10'),_0x3355f9,'request\x20sent',JSON['stringify'](_0x58c1da));if(_0x58c1da[_0x6c4e('0x11')]){if(_0x58c1da[_0x6c4e('0x11')][_0x6c4e('0x12')]===0x1f4){logger['error'](_0x6c4e('0xd'),_0x3355f9,_0x58c1da[_0x6c4e('0x11')][_0x6c4e('0x13')]);return _0x2f91ad(_0x58c1da[_0x6c4e('0x11')]['message']);}logger[_0x6c4e('0x11')](_0x6c4e('0xd'),_0x3355f9,_0x58c1da[_0x6c4e('0x11')][_0x6c4e('0x13')]);return _0xb0496a(_0x58c1da[_0x6c4e('0x11')]['message']);}else{logger[_0x6c4e('0xc')](_0x6c4e('0xd'),_0x3355f9,_0x6c4e('0xe'));_0xb0496a(_0x58c1da['result']['message']);}})['catch'](function(_0x5e4e88){logger[_0x6c4e('0x11')](_0x6c4e('0xd'),_0x3355f9,_0x5e4e88);_0x2f91ad(_0x5e4e88);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 019306d..503de1d 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 _0x9114=['removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','index','/describe','describe','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','getMessages','/:id/verify','verifySmtp','getAgents','addDisposition','post','addImap','addSmtp','addInteraction','addApplications','/:id/users','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers'];(function(_0x1d96c6,_0x1976c0){var _0x5273c4=function(_0x455d35){while(--_0x455d35){_0x1d96c6['push'](_0x1d96c6['shift']());}};_0x5273c4(++_0x1976c0);}(_0x9114,0x8c));var _0x4911=function(_0x312516,_0x51ffb6){_0x312516=_0x312516-0x0;var _0x104468=_0x9114[_0x312516];return _0x104468;};'use strict';var multer=require(_0x4911('0x0'));var util=require('util');var path=require(_0x4911('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4911('0x2')]();var auth=require(_0x4911('0x3'));var interaction=require(_0x4911('0x4'));var config=require('../../config/environment');var controller=require(_0x4911('0x5'));router[_0x4911('0x6')]('/',auth['isAuthenticated'](),controller[_0x4911('0x7')]);router[_0x4911('0x6')](_0x4911('0x8'),auth['isAuthenticated'](),controller[_0x4911('0x9')]);router[_0x4911('0x6')]('/:id',auth[_0x4911('0xa')](),controller[_0x4911('0xb')]);router[_0x4911('0x6')](_0x4911('0xc'),auth[_0x4911('0xa')](),controller[_0x4911('0xd')]);router['get'](_0x4911('0xe'),auth[_0x4911('0xa')](),controller['getAnswers']);router[_0x4911('0x6')](_0x4911('0xf'),auth[_0x4911('0xa')](),controller[_0x4911('0x10')]);router[_0x4911('0x6')](_0x4911('0x11'),auth[_0x4911('0xa')](),controller[_0x4911('0x12')]);router[_0x4911('0x6')](_0x4911('0x13'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x4911('0x6')](_0x4911('0x14'),auth['isAuthenticated'](),controller[_0x4911('0x15')]);router[_0x4911('0x6')]('/:id/messages',auth[_0x4911('0xa')](),controller[_0x4911('0x16')]);router[_0x4911('0x6')](_0x4911('0x17'),auth[_0x4911('0xa')](),controller[_0x4911('0x18')]);router[_0x4911('0x6')]('/:id/users',auth[_0x4911('0xa')](),controller[_0x4911('0x19')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x4911('0x1a')]);router[_0x4911('0x1b')](_0x4911('0xe'),auth[_0x4911('0xa')](),controller['addAnswer']);router['post']('/',auth[_0x4911('0xa')](),controller['create']);router[_0x4911('0x1b')](_0x4911('0xf'),auth[_0x4911('0xa')](),controller[_0x4911('0x1c')]);router['post'](_0x4911('0x11'),auth['isAuthenticated'](),controller[_0x4911('0x1d')]);router[_0x4911('0x1b')](_0x4911('0x13'),auth[_0x4911('0xa')](),controller[_0x4911('0x1e')]);router[_0x4911('0x1b')](_0x4911('0x14'),auth['isAuthenticated'](),controller[_0x4911('0x1f')]);router[_0x4911('0x1b')]('/:id/send',auth['isAuthenticated'](),controller['send']);router['post'](_0x4911('0x20'),auth['isAuthenticated'](),controller[_0x4911('0x21')]);router[_0x4911('0x22')](_0x4911('0x23'),auth['isAuthenticated'](),controller[_0x4911('0x24')]);router[_0x4911('0x25')](_0x4911('0xc'),auth[_0x4911('0xa')](),controller[_0x4911('0x26')]);router['delete'](_0x4911('0xe'),auth[_0x4911('0xa')](),controller[_0x4911('0x27')]);router[_0x4911('0x25')](_0x4911('0xf'),auth[_0x4911('0xa')](),controller[_0x4911('0x28')]);router['delete']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x4911('0x29')]);router[_0x4911('0x25')]('/:id',auth['isAuthenticated'](),controller[_0x4911('0x2a')]);router['delete']('/:id/users',auth[_0x4911('0xa')](),controller[_0x4911('0x2b')]);module[_0x4911('0x2c')]=router; \ No newline at end of file +var _0xc287=['/:id/out_servers','getSmtp','getInteractions','/:id/applications','getApplications','getMessages','verifySmtp','getAgents','/:id/dispositions','post','create','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','addAgents','put','/:id','update','removeImap','delete','removeSmtp','destroy','/:id/users','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','isAuthenticated','index','get','/describe','describe','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap'];(function(_0x3132e8,_0x499a0e){var _0x43eb8c=function(_0x2321e1){while(--_0x2321e1){_0x3132e8['push'](_0x3132e8['shift']());}};_0x43eb8c(++_0x499a0e);}(_0xc287,0x17b));var _0x7c28=function(_0x1d533b,_0x5d5961){_0x1d533b=_0x1d533b-0x0;var _0x2eac2a=_0xc287[_0x1d533b];return _0x2eac2a;};'use strict';var multer=require(_0x7c28('0x0'));var util=require('util');var path=require(_0x7c28('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7c28('0x2')]();var auth=require(_0x7c28('0x3'));var interaction=require(_0x7c28('0x4'));var config=require(_0x7c28('0x5'));var controller=require(_0x7c28('0x6'));router['get']('/',auth[_0x7c28('0x7')](),controller[_0x7c28('0x8')]);router[_0x7c28('0x9')](_0x7c28('0xa'),auth[_0x7c28('0x7')](),controller[_0x7c28('0xb')]);router[_0x7c28('0x9')]('/:id',auth[_0x7c28('0x7')](),controller['show']);router[_0x7c28('0x9')]('/:id/dispositions',auth[_0x7c28('0x7')](),controller[_0x7c28('0xc')]);router['get'](_0x7c28('0xd'),auth[_0x7c28('0x7')](),controller[_0x7c28('0xe')]);router[_0x7c28('0x9')](_0x7c28('0xf'),auth[_0x7c28('0x7')](),controller[_0x7c28('0x10')]);router[_0x7c28('0x9')](_0x7c28('0x11'),auth[_0x7c28('0x7')](),controller[_0x7c28('0x12')]);router['get']('/:id/interactions',auth[_0x7c28('0x7')](),controller[_0x7c28('0x13')]);router[_0x7c28('0x9')](_0x7c28('0x14'),auth[_0x7c28('0x7')](),controller[_0x7c28('0x15')]);router[_0x7c28('0x9')]('/:id/messages',auth[_0x7c28('0x7')](),controller[_0x7c28('0x16')]);router[_0x7c28('0x9')]('/:id/verify',auth[_0x7c28('0x7')](),controller[_0x7c28('0x17')]);router[_0x7c28('0x9')]('/:id/users',auth[_0x7c28('0x7')](),controller[_0x7c28('0x18')]);router['post'](_0x7c28('0x19'),auth[_0x7c28('0x7')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x7c28('0x7')](),controller['addAnswer']);router[_0x7c28('0x1a')]('/',auth[_0x7c28('0x7')](),controller[_0x7c28('0x1b')]);router[_0x7c28('0x1a')]('/:id/in_servers',auth[_0x7c28('0x7')](),controller['addImap']);router[_0x7c28('0x1a')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0x7c28('0x1c')]);router[_0x7c28('0x1a')](_0x7c28('0x1d'),auth[_0x7c28('0x7')](),controller[_0x7c28('0x1e')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x7c28('0x1f')]);router[_0x7c28('0x1a')](_0x7c28('0x20'),auth['isAuthenticated'](),controller[_0x7c28('0x21')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x7c28('0x22')]);router[_0x7c28('0x23')](_0x7c28('0x24'),auth[_0x7c28('0x7')](),controller[_0x7c28('0x25')]);router['delete'](_0x7c28('0x19'),auth['isAuthenticated'](),controller['removeDispositions']);router['delete'](_0x7c28('0xd'),auth[_0x7c28('0x7')](),controller['removeAnswers']);router['delete'](_0x7c28('0xf'),auth[_0x7c28('0x7')](),controller[_0x7c28('0x26')]);router[_0x7c28('0x27')]('/:id/out_servers',auth[_0x7c28('0x7')](),controller[_0x7c28('0x28')]);router[_0x7c28('0x27')](_0x7c28('0x24'),auth[_0x7c28('0x7')](),controller[_0x7c28('0x29')]);router[_0x7c28('0x27')](_0x7c28('0x2a'),auth[_0x7c28('0x7')](),controller['removeAgents']);module[_0x7c28('0x2b')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 808acde..e08f005 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 _0xa495=['BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','sequelize','STRING'];(function(_0x10c53a,_0x4c06a0){var _0x21e9fa=function(_0x434c88){while(--_0x434c88){_0x10c53a['push'](_0x10c53a['shift']());}};_0x21e9fa(++_0x4c06a0);}(_0xa495,0x14b));var _0x5a49=function(_0x295811,_0x2825f4){_0x295811=_0x295811-0x0;var _0x147146=_0xa495[_0x295811];return _0x147146;};'use strict';var Sequelize=require(_0x5a49('0x0'));module['exports']={'description':{'type':Sequelize[_0x5a49('0x1')]},'name':{'type':Sequelize[_0x5a49('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x5a49('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x5a49('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x5a49('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5a49('0x1')],'allowNull':![],'defaultValue':_0x5a49('0x4')},'fontSize':{'type':Sequelize[_0x5a49('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x5a49('0x3')],'defaultValue':function(){return _0x5a49('0x6');}},'notificationSound':{'type':Sequelize[_0x5a49('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5a49('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5a49('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5a49('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5a49('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5a49('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5a49('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5a49('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x5a49('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x5a49('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5605c8){if(!_0x5605c8)this[_0x5a49('0x8')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x5605c8);}}}; \ No newline at end of file +var _0xf8ec=['Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING','BOOLEAN','TEXT'];(function(_0x5e761b,_0x355e38){var _0x98502c=function(_0x4e52d5){while(--_0x4e52d5){_0x5e761b['push'](_0x5e761b['shift']());}};_0x98502c(++_0x355e38);}(_0xf8ec,0x1ca));var _0xcf8e=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xf8ec[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require(_0xcf8e('0x0'));module['exports']={'description':{'type':Sequelize[_0xcf8e('0x1')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xcf8e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xcf8e('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xcf8e('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xcf8e('0x3')]},'markAsUnread':{'type':Sequelize[_0xcf8e('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xcf8e('0x1')],'allowNull':![],'defaultValue':_0xcf8e('0x4')},'fontSize':{'type':Sequelize[_0xcf8e('0x5')](0x2)[_0xcf8e('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xcf8e('0x3')],'defaultValue':function(){return _0xcf8e('0x7');}},'notificationSound':{'type':Sequelize[_0xcf8e('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xcf8e('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xcf8e('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xcf8e('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xcf8e('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xcf8e('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xcf8e('0x2')],'defaultValue':![],'comment':_0xcf8e('0x9'),'set':function(_0x2b5285){if(!_0x2b5285)this['setDataValue'](_0xcf8e('0xa'),null);this['setDataValue']('mandatoryDisposition',_0x2b5285);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 95c2915..f9e0a45 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 _0x20bb=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','UserProfileResource','stack','name','index','Imap','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','options','includeAll','include','rows','show','params','MailServerOut','body','find','MailServerIn','catch','describe','addDisposition','MailAccountId','Disposition','create','findOne','order','pick','merge','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','key','email','ListId','isNil','active','description','cservice','cuser','password','cpassword','authentication','host','port','service','user','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','internal','Tag','Tags','addApplications','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','List','updatedAt','from','attachments','join','root','server/files/attachments','basename','auth','secure','sendMail','List\x20not\x20found','Contacts','messageId','attach','out','Interaction','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x20bb,0x180));var _0xb20b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x20bb[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb20b('0x0'));var rimraf=require(_0xb20b('0x1'));var zipdir=require(_0xb20b('0x2'));var jsonpatch=require(_0xb20b('0x3'));var rp=require(_0xb20b('0x4'));var moment=require(_0xb20b('0x5'));var BPromise=require(_0xb20b('0x6'));var Mustache=require('mustache');var util=require(_0xb20b('0x7'));var path=require('path');var sox=require(_0xb20b('0x8'));var csv=require(_0xb20b('0x9'));var ejs=require(_0xb20b('0xa'));var fs=require('fs');var _=require(_0xb20b('0xb'));var squel=require('squel');var crypto=require(_0xb20b('0xc'));var jsforce=require(_0xb20b('0xd'));var deskjs=require(_0xb20b('0xe'));var toCsv=require(_0xb20b('0x9'));var querystring=require(_0xb20b('0xf'));var Papa=require(_0xb20b('0x10'));var Redis=require(_0xb20b('0x11'));var authService=require(_0xb20b('0x12'));var qs=require(_0xb20b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb20b('0x14'));var logger=require(_0xb20b('0x15'))(_0xb20b('0x16'));var utils=require(_0xb20b('0x17'));var config=require(_0xb20b('0x18'));var db=require(_0xb20b('0x19'))['db'];config[_0xb20b('0x1a')]=_['defaults'](config['redis'],{'host':_0xb20b('0x1b'),'port':0x18eb});var socket=require(_0xb20b('0x1c'))(new Redis(config[_0xb20b('0x1a')]));require(_0xb20b('0x1d'))[_0xb20b('0x1e')](socket);var jayson=require(_0xb20b('0x1f'));var client=jayson[_0xb20b('0x20')][_0xb20b('0x21')]({'port':0x232b});function checkPasswordPattern(_0x40aae5,_0x53c106,_0x5897af){if(_0x5897af){var _0x418f4a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x418f4a['test'](_0x53c106)){return _0x40aae5;}else{throw new db[(_0xb20b('0x22'))][(_0xb20b('0x23'))](_0xb20b('0x24'));}}else{return _0x40aae5;}}function respondWithRpcPromise(_0x21d224,_0x495af6,_0x23638f,_0x3e1bb1){return new BPromise(function(_0x531d0c,_0xe2669){var _0x4e7285=_0x3e1bb1||client;return _0x4e7285['request'](_0x21d224,_0x23638f)[_0xb20b('0x25')](function(_0x5b549f){logger[_0xb20b('0x26')](_0xb20b('0x27'),_0x495af6,'request\x20sent');logger['debug'](_0xb20b('0x28'),_0x495af6,'request\x20sent',JSON[_0xb20b('0x29')](_0x5b549f));if(_0x5b549f[_0xb20b('0x2a')]){if(_0x5b549f[_0xb20b('0x2a')]['code']===0x1f4){logger['error'](_0xb20b('0x27'),_0x495af6,_0x5b549f[_0xb20b('0x2a')][_0xb20b('0x2b')]);return _0xe2669(_0x5b549f['error']['message']);}logger['error'](_0xb20b('0x27'),_0x495af6,_0x5b549f[_0xb20b('0x2a')]['message']);return _0x531d0c(_0x5b549f[_0xb20b('0x2a')][_0xb20b('0x2b')]);}else{logger[_0xb20b('0x26')](_0xb20b('0x27'),_0x495af6,_0xb20b('0x2c'));_0x531d0c(_0x5b549f[_0xb20b('0x2d')]['message']);}})['catch'](function(_0x27a54b){logger[_0xb20b('0x2a')](_0xb20b('0x27'),_0x495af6,_0x27a54b);_0xe2669(_0x27a54b);});});}function respondWithStatusCode(_0x7787fa,_0x5c7f36){_0x5c7f36=_0x5c7f36||0xcc;return function(_0x14bd6f){if(_0x14bd6f){return _0x7787fa[_0xb20b('0x2e')](_0x5c7f36);}return _0x7787fa['status'](_0x5c7f36)[_0xb20b('0x2f')]();};}function respondWithResult(_0x82308,_0x1f1e5c){_0x1f1e5c=_0x1f1e5c||0xc8;return function(_0x2db9f1){if(_0x2db9f1){return _0x82308['status'](_0x1f1e5c)[_0xb20b('0x30')](_0x2db9f1);}};}function respondWithFilteredResult(_0x317938,_0x2f8831){return function(_0x22c51a){if(_0x22c51a){var _0x2ab4b4=_0x22c51a[_0xb20b('0x31')],_0x3c6070=_0x2f8831[_0xb20b('0x32')],_0x4138f7=_0x2f8831[_0xb20b('0x32')]+_0x2f8831[_0xb20b('0x33')],_0x3d44c0;if(_0x4138f7>=_0x2ab4b4){_0x4138f7=_0x2ab4b4;_0x3d44c0=0xc8;}else{_0x3d44c0=0xce;}_0x317938[_0xb20b('0x34')](_0x3d44c0);return _0x317938[_0xb20b('0x35')](_0xb20b('0x36'),_0x3c6070+'-'+_0x4138f7+'/'+_0x2ab4b4)['json'](_0x22c51a);}return null;};}function patchUpdates(_0x448278){return function(_0x2983a0){try{jsonpatch[_0xb20b('0x37')](_0x2983a0,_0x448278,!![]);}catch(_0x54caf0){return BPromise[_0xb20b('0x38')](_0x54caf0);}return _0x2983a0[_0xb20b('0x39')]();};}function saveUpdates(_0x4d7270,_0x35e5de){return function(_0x3b6d44){if(_0x3b6d44){return _0x3b6d44[_0xb20b('0x3a')](_0x4d7270)[_0xb20b('0x25')](function(_0x546402){return _0x546402;});}return null;};}function removeEntity(_0x2776cc,_0x4aa7cb){return function(_0x1633e4){if(_0x1633e4){return _0x1633e4[_0xb20b('0x3b')]()[_0xb20b('0x25')](function(){var _0x31ea65=_0x1633e4['get']({'plain':!![]});var _0x149a26='MailAccounts';return db[_0xb20b('0x3c')][_0xb20b('0x3b')]({'where':{'type':_0x149a26,'resourceId':_0x31ea65['id']}})['then'](function(){return _0x1633e4;});})['then'](function(){_0x2776cc['status'](0xcc)[_0xb20b('0x2f')]();});}};}function handleEntityNotFound(_0x38d235,_0x97f366){return function(_0x5c2950){if(!_0x5c2950){_0x38d235[_0xb20b('0x2e')](0x194);}return _0x5c2950;};}function handleError(_0x35449e,_0x741184){_0x741184=_0x741184||0x1f4;return function(_0x132da8){logger['error'](_0x132da8[_0xb20b('0x3d')]);if(_0x132da8[_0xb20b('0x3e')]){delete _0x132da8[_0xb20b('0x3e')];}_0x35449e[_0xb20b('0x34')](_0x741184)['send'](_0x132da8);};}exports[_0xb20b('0x3f')]=function(_0x34886a,_0x90ea07){var _0x3fa828={'include':[{'model':db['MailServerIn'],'as':_0xb20b('0x40')},{'model':db['MailServerOut'],'as':_0xb20b('0x41')},{'model':db[_0xb20b('0x42')],'as':_0xb20b('0x43')}]},_0x5262e8={},_0x16e6e8={'count':0x0,'rows':[]};var _0x5aa269=_[_0xb20b('0x44')](db[_0xb20b('0x45')][_0xb20b('0x46')],function(_0x3be985){return{'name':_0x3be985[_0xb20b('0x47')],'type':_0x3be985[_0xb20b('0x48')]['key']};});_0x5262e8['model']=_['map'](_0x5aa269,_0xb20b('0x3e'));_0x5262e8[_0xb20b('0x49')]=_[_0xb20b('0x4a')](_0x34886a['query']);_0x5262e8[_0xb20b('0x4b')]=_[_0xb20b('0x4c')](_0x5262e8[_0xb20b('0x4d')],_0x5262e8['query']);_0x3fa828['attributes']=_['intersection'](_0x5262e8[_0xb20b('0x4d')],qs[_0xb20b('0x4e')](_0x34886a[_0xb20b('0x49')][_0xb20b('0x4e')]));_0x3fa828['attributes']=_0x3fa828[_0xb20b('0x4f')][_0xb20b('0x50')]?_0x3fa828[_0xb20b('0x4f')]:_0x5262e8['model'];if(!_0x34886a[_0xb20b('0x49')][_0xb20b('0x51')](_0xb20b('0x52'))){_0x3fa828[_0xb20b('0x33')]=qs[_0xb20b('0x33')](_0x34886a[_0xb20b('0x49')][_0xb20b('0x33')]);_0x3fa828[_0xb20b('0x32')]=qs['offset'](_0x34886a['query'][_0xb20b('0x32')]);}_0x3fa828['order']=qs[_0xb20b('0x53')](_0x34886a[_0xb20b('0x49')]['sort']);_0x3fa828['where']=qs[_0xb20b('0x4b')](_['pick'](_0x34886a[_0xb20b('0x49')],_0x5262e8['filters']),_0x5aa269);if(_0x34886a[_0xb20b('0x49')][_0xb20b('0x54')]){_0x3fa828[_0xb20b('0x55')]=_['merge'](_0x3fa828[_0xb20b('0x55')],{'$or':_[_0xb20b('0x44')](_0x5aa269,function(_0x50d944){if(_0x50d944['type']!==_0xb20b('0x56')){var _0x1f485e={};_0x1f485e[_0x50d944[_0xb20b('0x3e')]]={'$like':'%'+_0x34886a['query'][_0xb20b('0x54')]+'%'};return _0x1f485e;}})});}_0x3fa828=_['merge']({},_0x3fa828,_0x34886a[_0xb20b('0x57')]);var _0x24efdc={'where':_0x3fa828['where']};return db[_0xb20b('0x45')][_0xb20b('0x31')](_0x24efdc)[_0xb20b('0x25')](function(_0x45214e){_0x16e6e8['count']=_0x45214e;if(_0x34886a[_0xb20b('0x49')][_0xb20b('0x58')]){_0x3fa828[_0xb20b('0x59')]=[{'all':!![]}];}return db[_0xb20b('0x45')]['findAll'](_0x3fa828);})['then'](function(_0x1ca1b1){_0x16e6e8[_0xb20b('0x5a')]=_0x1ca1b1;return _0x16e6e8;})[_0xb20b('0x25')](respondWithFilteredResult(_0x90ea07,_0x3fa828))['catch'](handleError(_0x90ea07,null));};exports[_0xb20b('0x5b')]=function(_0x3dc139,_0x3d7034){var _0x42d6e0={'raw':![],'where':{'id':_0x3dc139[_0xb20b('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xb20b('0x40')},{'model':db[_0xb20b('0x5d')],'as':_0xb20b('0x41')},{'model':db[_0xb20b('0x42')],'as':_0xb20b('0x43')}]},_0x177e6c={};_0x177e6c[_0xb20b('0x4d')]=_[_0xb20b('0x4a')](db['MailAccount'][_0xb20b('0x46')]);_0x177e6c[_0xb20b('0x49')]=_[_0xb20b('0x4a')](_0x3dc139[_0xb20b('0x49')]);_0x177e6c[_0xb20b('0x4b')]=_['intersection'](_0x177e6c['model'],_0x177e6c['query']);_0x42d6e0['attributes']=_['intersection'](_0x177e6c[_0xb20b('0x4d')],qs[_0xb20b('0x4e')](_0x3dc139[_0xb20b('0x49')]['fields']));_0x42d6e0['attributes']=_0x42d6e0['attributes'][_0xb20b('0x50')]?_0x42d6e0['attributes']:_0x177e6c[_0xb20b('0x4d')];if(_0x3dc139[_0xb20b('0x49')][_0xb20b('0x58')]){_0x42d6e0[_0xb20b('0x59')]=[{'all':!![]}];}_0x42d6e0=_['merge']({},_0x42d6e0,_0x3dc139[_0xb20b('0x57')]);return db[_0xb20b('0x45')]['find'](_0x42d6e0)[_0xb20b('0x25')](handleEntityNotFound(_0x3d7034,null))[_0xb20b('0x25')](respondWithResult(_0x3d7034,null))['catch'](handleError(_0x3d7034,null));};exports[_0xb20b('0x3a')]=function(_0xbf235c,_0x2496f7){if(_0xbf235c[_0xb20b('0x5e')]['id']){delete _0xbf235c['body']['id'];}return db[_0xb20b('0x45')][_0xb20b('0x5f')]({'where':{'id':_0xbf235c[_0xb20b('0x5c')]['id']},'include':[{'model':db[_0xb20b('0x60')],'as':_0xb20b('0x40')},{'model':db[_0xb20b('0x5d')],'as':_0xb20b('0x41')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x2496f7,null))['then'](saveUpdates(_0xbf235c[_0xb20b('0x5e')],null))[_0xb20b('0x25')](function(_0x43a6ce){if(_0x43a6ce&&_0xbf235c[_0xb20b('0x5e')]['Imap']){return db[_0xb20b('0x60')][_0xb20b('0x3a')](_0xbf235c['body'][_0xb20b('0x40')],{'where':{'MailAccountId':_0x43a6ce['id']}})[_0xb20b('0x25')](function(){return _0x43a6ce;});}return _0x43a6ce;})['then'](function(_0x19c196){if(_0x19c196&&_0xbf235c['body']['Smtp']){return db['MailServerOut'][_0xb20b('0x3a')](_0xbf235c[_0xb20b('0x5e')]['Smtp'],{'where':{'MailAccountId':_0x19c196['id']}})['then'](function(){return _0x19c196;});}return _0x19c196;})[_0xb20b('0x25')](respondWithResult(_0x2496f7,null))[_0xb20b('0x61')](handleError(_0x2496f7,null));};exports[_0xb20b('0x62')]=function(_0x5d1a23,_0x5c0099){return db[_0xb20b('0x45')][_0xb20b('0x62')]()[_0xb20b('0x25')](respondWithResult(_0x5c0099,null))['catch'](handleError(_0x5c0099,null));};exports[_0xb20b('0x63')]=function(_0x450395,_0x3a4844,_0x12752b){if(_0x450395['body']['id']){delete _0x450395[_0xb20b('0x5e')]['id'];}return db['MailAccount'][_0xb20b('0x5f')]({'where':{'id':_0x450395['params']['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x3a4844,null))[_0xb20b('0x25')](function(_0x588ce2){if(_0x588ce2){_0x450395[_0xb20b('0x5e')][_0xb20b('0x64')]=_0x588ce2['id'];return db[_0xb20b('0x65')][_0xb20b('0x66')](_0x450395[_0xb20b('0x5e')]);}})[_0xb20b('0x25')](respondWithResult(_0x3a4844,null))[_0xb20b('0x61')](handleError(_0x3a4844,null));};exports['getDispositions']=function(_0x2b26a2,_0x2f7d67,_0x531abb){var _0x18a0e9={'raw':![],'where':{}};var _0x231ca4={};var _0x130669={'count':0x0,'rows':[]};return db[_0xb20b('0x45')][_0xb20b('0x67')]({'where':{'id':_0x2b26a2[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x2f7d67,null))[_0xb20b('0x25')](function(_0x2588b2){if(_0x2588b2){_0x231ca4[_0xb20b('0x4d')]=_[_0xb20b('0x4a')](db[_0xb20b('0x65')]['rawAttributes']);_0x231ca4['query']=_[_0xb20b('0x4a')](_0x2b26a2[_0xb20b('0x49')]);_0x231ca4[_0xb20b('0x4b')]=_[_0xb20b('0x4c')](_0x231ca4[_0xb20b('0x4d')],_0x231ca4[_0xb20b('0x49')]);_0x18a0e9['attributes']=_[_0xb20b('0x4c')](_0x231ca4[_0xb20b('0x4d')],qs[_0xb20b('0x4e')](_0x2b26a2['query'][_0xb20b('0x4e')]));_0x18a0e9['attributes']=_0x18a0e9[_0xb20b('0x4f')]['length']?_0x18a0e9[_0xb20b('0x4f')]:_0x231ca4[_0xb20b('0x4d')];if(!_0x2b26a2[_0xb20b('0x49')][_0xb20b('0x51')]('nolimit')){_0x18a0e9[_0xb20b('0x33')]=qs[_0xb20b('0x33')](_0x2b26a2[_0xb20b('0x49')][_0xb20b('0x33')]);_0x18a0e9[_0xb20b('0x32')]=qs[_0xb20b('0x32')](_0x2b26a2[_0xb20b('0x49')]['offset']);}_0x18a0e9[_0xb20b('0x68')]=qs[_0xb20b('0x53')](_0x2b26a2[_0xb20b('0x49')][_0xb20b('0x53')]);_0x18a0e9[_0xb20b('0x55')]=qs[_0xb20b('0x4b')](_[_0xb20b('0x69')](_0x2b26a2[_0xb20b('0x49')],_0x231ca4[_0xb20b('0x4b')]));_0x18a0e9[_0xb20b('0x55')][_0xb20b('0x64')]=_0x2588b2['id'];if(_0x2b26a2[_0xb20b('0x49')][_0xb20b('0x54')]){_0x18a0e9[_0xb20b('0x55')]=_[_0xb20b('0x6a')](_0x18a0e9[_0xb20b('0x55')],{'$or':_['map'](_0x18a0e9[_0xb20b('0x4f')],function(_0x14f220){var _0x322854={};_0x322854[_0x14f220]={'$like':'%'+_0x2b26a2[_0xb20b('0x49')][_0xb20b('0x54')]+'%'};return _0x322854;})});}_0x18a0e9=_['merge']({},_0x18a0e9,_0x2b26a2['options']);return db[_0xb20b('0x65')]['count']({'where':_0x18a0e9[_0xb20b('0x55')]})[_0xb20b('0x25')](function(_0x347a75){_0x130669['count']=_0x347a75;if(_0x2b26a2[_0xb20b('0x49')][_0xb20b('0x58')]){_0x18a0e9['include']=[{'all':!![]}];}return db[_0xb20b('0x65')][_0xb20b('0x6b')](_0x18a0e9);})[_0xb20b('0x25')](function(_0x413adf){_0x130669['rows']=_0x413adf;return _0x130669;});}})[_0xb20b('0x25')](respondWithFilteredResult(_0x2f7d67,_0x18a0e9))[_0xb20b('0x61')](handleError(_0x2f7d67,null));};exports[_0xb20b('0x6c')]=function(_0x34a907,_0x3335b7,_0x5ea76a){return db['MailAccount'][_0xb20b('0x5f')]({'where':{'id':_0x34a907[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x3335b7,null))[_0xb20b('0x25')](function(_0x1275a9){if(_0x1275a9){return _0x1275a9[_0xb20b('0x6c')](_0x34a907[_0xb20b('0x49')]['ids']);}})['then'](respondWithStatusCode(_0x3335b7,null))[_0xb20b('0x61')](handleError(_0x3335b7,null));};exports[_0xb20b('0x6d')]=function(_0xfbeea2,_0x15017e,_0xb6fab9){if(_0xfbeea2[_0xb20b('0x5e')]['id']){delete _0xfbeea2['body']['id'];}return db[_0xb20b('0x45')][_0xb20b('0x5f')]({'where':{'id':_0xfbeea2[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x15017e,null))['then'](function(_0x444070){if(_0x444070){_0xfbeea2[_0xb20b('0x5e')][_0xb20b('0x64')]=_0x444070['id'];return db[_0xb20b('0x6e')][_0xb20b('0x66')](_0xfbeea2['body']);}})[_0xb20b('0x25')](respondWithResult(_0x15017e,null))[_0xb20b('0x61')](handleError(_0x15017e,null));};exports[_0xb20b('0x6f')]=function(_0x32f7bb,_0x2977c3,_0x4b4bca){var _0x4119d4={'raw':![],'where':{}};var _0x304c44={};var _0x370306={'count':0x0,'rows':[]};return db[_0xb20b('0x45')]['findOne']({'where':{'id':_0x32f7bb[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x2977c3,null))[_0xb20b('0x25')](function(_0x3b06ff){if(_0x3b06ff){_0x304c44[_0xb20b('0x4d')]=_[_0xb20b('0x4a')](db[_0xb20b('0x6e')][_0xb20b('0x46')]);_0x304c44[_0xb20b('0x49')]=_[_0xb20b('0x4a')](_0x32f7bb[_0xb20b('0x49')]);_0x304c44[_0xb20b('0x4b')]=_[_0xb20b('0x4c')](_0x304c44['model'],_0x304c44['query']);_0x4119d4[_0xb20b('0x4f')]=_[_0xb20b('0x4c')](_0x304c44['model'],qs['fields'](_0x32f7bb[_0xb20b('0x49')][_0xb20b('0x4e')]));_0x4119d4['attributes']=_0x4119d4['attributes'][_0xb20b('0x50')]?_0x4119d4[_0xb20b('0x4f')]:_0x304c44[_0xb20b('0x4d')];if(!_0x32f7bb[_0xb20b('0x49')]['hasOwnProperty'](_0xb20b('0x52'))){_0x4119d4[_0xb20b('0x33')]=qs[_0xb20b('0x33')](_0x32f7bb['query']['limit']);_0x4119d4[_0xb20b('0x32')]=qs[_0xb20b('0x32')](_0x32f7bb['query'][_0xb20b('0x32')]);}_0x4119d4[_0xb20b('0x68')]=qs['sort'](_0x32f7bb['query']['sort']);_0x4119d4['where']=qs['filters'](_[_0xb20b('0x69')](_0x32f7bb['query'],_0x304c44['filters']));_0x4119d4['where'][_0xb20b('0x64')]=_0x3b06ff['id'];if(_0x32f7bb[_0xb20b('0x49')][_0xb20b('0x54')]){_0x4119d4[_0xb20b('0x55')]=_['merge'](_0x4119d4['where'],{'$or':_[_0xb20b('0x44')](_0x4119d4['attributes'],function(_0x409f0d){var _0x542181={};_0x542181[_0x409f0d]={'$like':'%'+_0x32f7bb[_0xb20b('0x49')][_0xb20b('0x54')]+'%'};return _0x542181;})});}_0x4119d4=_[_0xb20b('0x6a')]({},_0x4119d4,_0x32f7bb[_0xb20b('0x57')]);return db['CannedAnswer'][_0xb20b('0x31')]({'where':_0x4119d4[_0xb20b('0x55')]})['then'](function(_0x128413){_0x370306[_0xb20b('0x31')]=_0x128413;if(_0x32f7bb[_0xb20b('0x49')][_0xb20b('0x58')]){_0x4119d4[_0xb20b('0x59')]=[{'all':!![]}];}return db[_0xb20b('0x6e')]['findAll'](_0x4119d4);})[_0xb20b('0x25')](function(_0x41f346){_0x370306[_0xb20b('0x5a')]=_0x41f346;return _0x370306;});}})[_0xb20b('0x25')](respondWithFilteredResult(_0x2977c3,_0x4119d4))['catch'](handleError(_0x2977c3,null));};exports[_0xb20b('0x70')]=function(_0x264cea,_0x3edda3,_0x34327d){return db[_0xb20b('0x45')][_0xb20b('0x5f')]({'where':{'id':_0x264cea[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x3edda3,null))['then'](function(_0x4a186b){if(_0x4a186b){return _0x4a186b[_0xb20b('0x70')](_0x264cea[_0xb20b('0x49')][_0xb20b('0x71')]);}})[_0xb20b('0x25')](respondWithStatusCode(_0x3edda3,null))['catch'](handleError(_0x3edda3,null));};exports['create']=function(_0x4f9849,_0x467812){var _0x3fb7a0={'name':_0x4f9849[_0xb20b('0x5e')][_0xb20b('0x3e')],'key':_0x4f9849[_0xb20b('0x5e')][_0xb20b('0x72')],'email':_0x4f9849[_0xb20b('0x5e')][_0xb20b('0x73')],'ListId':_0x4f9849[_0xb20b('0x5e')][_0xb20b('0x74')],'active':!_[_0xb20b('0x75')](_0x4f9849['body'][_0xb20b('0x76')])?_0x4f9849[_0xb20b('0x5e')][_0xb20b('0x76')]:!![],'description':_0x4f9849[_0xb20b('0x5e')][_0xb20b('0x77')]||null,'Imap':{},'Smtp':{}};if(_[_0xb20b('0x75')](_0x4f9849['body'][_0xb20b('0x78')])){if(_0x4f9849['body']['cauthentication']){_0x3fb7a0[_0xb20b('0x40')]['user']=_0x3fb7a0[_0xb20b('0x41')]['user']=_0x4f9849[_0xb20b('0x5e')][_0xb20b('0x79')];_0x3fb7a0[_0xb20b('0x40')][_0xb20b('0x7a')]=_0x3fb7a0[_0xb20b('0x41')]['pass']=_0x4f9849[_0xb20b('0x5e')][_0xb20b('0x7b')];}else{_0x3fb7a0[_0xb20b('0x40')]['authentication']=_0x3fb7a0[_0xb20b('0x41')][_0xb20b('0x7c')]=![];}_0x3fb7a0[_0xb20b('0x40')][_0xb20b('0x7d')]=_0x4f9849[_0xb20b('0x5e')]['Imap'][_0xb20b('0x7d')];_0x3fb7a0[_0xb20b('0x40')]['port']=_0x4f9849[_0xb20b('0x5e')][_0xb20b('0x40')][_0xb20b('0x7e')];_0x3fb7a0[_0xb20b('0x41')][_0xb20b('0x7d')]=_0x4f9849['body'][_0xb20b('0x41')][_0xb20b('0x7d')];_0x3fb7a0['Smtp']['port']=_0x4f9849[_0xb20b('0x5e')][_0xb20b('0x41')][_0xb20b('0x7e')];}else{_0x3fb7a0[_0xb20b('0x40')][_0xb20b('0x7f')]=_0x3fb7a0[_0xb20b('0x41')][_0xb20b('0x7f')]=_0x4f9849['body'][_0xb20b('0x78')];_0x3fb7a0[_0xb20b('0x40')][_0xb20b('0x80')]=_0x3fb7a0[_0xb20b('0x41')]['user']=_0x4f9849[_0xb20b('0x5e')]['cuser'];_0x3fb7a0['Imap'][_0xb20b('0x7a')]=_0x3fb7a0[_0xb20b('0x41')][_0xb20b('0x81')]=_0x4f9849[_0xb20b('0x5e')][_0xb20b('0x7b')];}return db[_0xb20b('0x45')]['create'](_0x3fb7a0,{'include':[{'model':db[_0xb20b('0x5d')],'as':_0xb20b('0x41')},{'model':db[_0xb20b('0x60')],'as':'Imap'}]})[_0xb20b('0x25')](function(_0xb7966e){var _0x315df6=_0x4f9849[_0xb20b('0x80')]['get']({'plain':!![]});if(!_0x315df6)throw new Error(_0xb20b('0x82'));if(_0x315df6[_0xb20b('0x83')]==='user'){var _0x579cba=_0xb7966e[_0xb20b('0x84')]({'plain':!![]});return db[_0xb20b('0x85')][_0xb20b('0x5f')]({'where':{'name':'MailAccounts','userProfileId':_0x315df6['userProfileId']},'raw':!![]})[_0xb20b('0x25')](function(_0x388365){if(_0x388365&&_0x388365[_0xb20b('0x86')]===0x0){return db[_0xb20b('0x3c')][_0xb20b('0x66')]({'name':_0x579cba[_0xb20b('0x3e')],'resourceId':_0x579cba['id'],'type':_0x388365['name'],'sectionId':_0x388365['id']},{})[_0xb20b('0x25')](function(){return _0xb7966e;});}else{return _0xb7966e;}})['catch'](function(_0x4caceb){logger['error'](_0xb20b('0x87'),_0x4caceb);throw _0x4caceb;});}return _0xb7966e;})[_0xb20b('0x25')](respondWithResult(_0x467812,0xc9))[_0xb20b('0x61')](handleError(_0x467812,null));};exports[_0xb20b('0x88')]=function(_0x455fdf,_0x39fc2a,_0x2b7bf9){return db['MailAccount'][_0xb20b('0x67')]({'where':{'id':_0x455fdf[_0xb20b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x39fc2a,null))[_0xb20b('0x25')](function(_0x1c345c){if(_0x1c345c){return _0x1c345c[_0xb20b('0x88')]();}return null;})[_0xb20b('0x25')](respondWithResult(_0x39fc2a,null))[_0xb20b('0x61')](handleError(_0x39fc2a,null));};exports[_0xb20b('0x89')]=function(_0x18174b,_0x53149d,_0xffddee){if(_0x18174b[_0xb20b('0x5e')]['id']){delete _0x18174b[_0xb20b('0x5e')]['id'];}return db['MailAccount'][_0xb20b('0x5f')]({'where':{'id':_0x18174b[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x53149d,null))[_0xb20b('0x25')](function(_0x2ea0bf){if(_0x2ea0bf){_0x18174b[_0xb20b('0x5e')][_0xb20b('0x64')]=_0x2ea0bf['id'];return db[_0xb20b('0x60')][_0xb20b('0x66')](_0x18174b[_0xb20b('0x5e')]);}})[_0xb20b('0x25')](respondWithResult(_0x53149d,null))[_0xb20b('0x61')](handleError(_0x53149d,null));};exports[_0xb20b('0x8a')]=function(_0x3df33b,_0x1e17d7,_0x5f37a6){return db[_0xb20b('0x45')]['findOne']({'where':{'id':_0x3df33b[_0xb20b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1e17d7,null))[_0xb20b('0x25')](function(_0x48cfea){if(_0x48cfea){return _0x48cfea[_0xb20b('0x8b')](null);}return null;})[_0xb20b('0x25')](respondWithStatusCode(_0x1e17d7,null))['catch'](handleError(_0x1e17d7,null));};exports['getSmtp']=function(_0x1c93b8,_0x100e31,_0x308dfa){return db[_0xb20b('0x45')][_0xb20b('0x67')]({'where':{'id':_0x1c93b8[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x100e31,null))[_0xb20b('0x25')](function(_0x4b8cae){if(_0x4b8cae){return _0x4b8cae[_0xb20b('0x8c')]();}return null;})[_0xb20b('0x25')](respondWithResult(_0x100e31,null))[_0xb20b('0x61')](handleError(_0x100e31,null));};exports[_0xb20b('0x8d')]=function(_0x1efd38,_0x56ad76,_0x4285e1){if(_0x1efd38['body']['id']){delete _0x1efd38['body']['id'];}return db[_0xb20b('0x45')][_0xb20b('0x5f')]({'where':{'id':_0x1efd38[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x56ad76,null))['then'](function(_0x3db6cb){if(_0x3db6cb){_0x1efd38[_0xb20b('0x5e')]['MailAccountId']=_0x3db6cb['id'];return db[_0xb20b('0x5d')][_0xb20b('0x66')](_0x1efd38[_0xb20b('0x5e')]);}})[_0xb20b('0x25')](respondWithResult(_0x56ad76,null))[_0xb20b('0x61')](handleError(_0x56ad76,null));};exports[_0xb20b('0x8e')]=function(_0x23bbe8,_0x301882,_0xfd652a){return db['MailAccount'][_0xb20b('0x67')]({'where':{'id':_0x23bbe8[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x301882,null))['then'](function(_0x156ea2){if(_0x156ea2){return _0x156ea2[_0xb20b('0x8f')](null);}return null;})[_0xb20b('0x25')](respondWithStatusCode(_0x301882,null))[_0xb20b('0x61')](handleError(_0x301882,null));};exports[_0xb20b('0x90')]=function(_0x36b1d6,_0x4e3bf1,_0x151280){return db[_0xb20b('0x91')]['find']({'where':{'id':_0x36b1d6[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x4e3bf1,null))[_0xb20b('0x25')](function(_0x2f3d0f){if(_0x2f3d0f){return _0x2f3d0f[_0xb20b('0x90')](_0x36b1d6['body']['ids'],_[_0xb20b('0x92')](_0x36b1d6[_0xb20b('0x5e')],[_0xb20b('0x71'),'id'])||{});}})['then'](respondWithResult(_0x4e3bf1,null))[_0xb20b('0x61')](handleError(_0x4e3bf1,null));};exports[_0xb20b('0x93')]=function(_0x597a30,_0xaf9ae2,_0x171b50){var _0x5b7c60={'raw':![],'where':{}};var _0x4eda4c={};var _0x55fcb6={'count':0x0,'rows':[]};return db['MailAccount'][_0xb20b('0x67')]({'where':{'id':_0x597a30[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0xaf9ae2,null))['then'](function(_0x581df4){if(_0x581df4){_0x4eda4c['model']=_[_0xb20b('0x4a')](db[_0xb20b('0x91')][_0xb20b('0x46')]);_0x4eda4c[_0xb20b('0x49')]=_[_0xb20b('0x4a')](_0x597a30[_0xb20b('0x49')]);_0x4eda4c['filters']=_['intersection'](_0x4eda4c[_0xb20b('0x4d')],_0x4eda4c['query']);_0x5b7c60['attributes']=_[_0xb20b('0x4c')](_0x4eda4c[_0xb20b('0x4d')],qs[_0xb20b('0x4e')](_0x597a30[_0xb20b('0x49')]['fields']));_0x5b7c60[_0xb20b('0x4f')]=_0x5b7c60['attributes'][_0xb20b('0x50')]?_0x5b7c60[_0xb20b('0x4f')]:_0x4eda4c[_0xb20b('0x4d')];if(!_0x597a30[_0xb20b('0x49')][_0xb20b('0x51')](_0xb20b('0x52'))){_0x5b7c60[_0xb20b('0x33')]=qs[_0xb20b('0x33')](_0x597a30['query'][_0xb20b('0x33')]);_0x5b7c60[_0xb20b('0x32')]=qs[_0xb20b('0x32')](_0x597a30[_0xb20b('0x49')][_0xb20b('0x32')]);}_0x5b7c60[_0xb20b('0x68')]=qs[_0xb20b('0x53')](_0x597a30['query'][_0xb20b('0x53')]);_0x5b7c60[_0xb20b('0x55')]=qs['filters'](_['pick'](_0x597a30[_0xb20b('0x49')],_0x4eda4c['filters']));_0x5b7c60[_0xb20b('0x55')][_0xb20b('0x64')]=_0x581df4['id'];if(_0x597a30[_0xb20b('0x49')][_0xb20b('0x54')]){_0x5b7c60[_0xb20b('0x55')]=_[_0xb20b('0x6a')](_0x5b7c60[_0xb20b('0x55')],{'$or':_[_0xb20b('0x44')](_0x5b7c60['attributes'],function(_0x3fe6c9){var _0x16c741={};_0x16c741[_0x3fe6c9]={'$like':'%'+_0x597a30[_0xb20b('0x49')][_0xb20b('0x54')]+'%'};return _0x16c741;})});}_0x5b7c60=_[_0xb20b('0x6a')]({},_0x5b7c60,_0x597a30[_0xb20b('0x57')]);return db[_0xb20b('0x91')][_0xb20b('0x31')]({'where':_0x5b7c60[_0xb20b('0x55')]})['then'](function(_0x43589c){_0x55fcb6[_0xb20b('0x31')]=_0x43589c;if(_0x597a30[_0xb20b('0x49')][_0xb20b('0x58')]){_0x5b7c60[_0xb20b('0x59')]=[{'model':db[_0xb20b('0x94')],'as':_0xb20b('0x95'),'required':![]},{'model':db[_0xb20b('0x96')],'as':'Owner','attributes':[_0xb20b('0x3e'),'fullname',_0xb20b('0x97')],'required':![]},{'model':db[_0xb20b('0x98')],'as':_0xb20b('0x99'),'attributes':['id',_0xb20b('0x3e'),'color'],'where':_0x597a30['query']['tag']?{'id':_0x597a30[_0xb20b('0x49')]['tag']}:undefined,'required':_0x597a30[_0xb20b('0x49')]['tag']?!![]:![]}];}return db['MailInteraction']['findAll'](_0x5b7c60);})['then'](function(_0x30e7ad){_0x55fcb6[_0xb20b('0x5a')]=_0x30e7ad;return _0x55fcb6;});}})['then'](respondWithFilteredResult(_0xaf9ae2,_0x5b7c60))[_0xb20b('0x61')](handleError(_0xaf9ae2,null));};exports[_0xb20b('0x9a')]=function(_0x4e53ab,_0x495a01,_0x32a7d7){return db[_0xb20b('0x45')]['findOne']({'where':{'id':_0x4e53ab[_0xb20b('0x5c')]['id']}})['then'](handleEntityNotFound(_0x495a01,null))[_0xb20b('0x25')](function(_0x3dedd1){if(_0x3dedd1){return db[_0xb20b('0x9b')][_0xb20b('0x9c')](function(_0x4a6952){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x4e53ab['params']['id']},'transaction':_0x4a6952})['then'](function(_0xf1af3f){var _0x3ef5b5=_[_0xb20b('0x44')](_0x4e53ab[_0xb20b('0x5e')],function(_0x289311){_0x289311[_0xb20b('0x64')]=_0x4e53ab[_0xb20b('0x5c')]['id'];return _0x289311;});return db[_0xb20b('0x9d')]['bulkCreate'](_0x3ef5b5,{'transaction':_0x4a6952});});})[_0xb20b('0x25')](function(){return db['MailApplication'][_0xb20b('0x9e')]({'where':{'MailAccountId':_0x4e53ab[_0xb20b('0x5c')]['id']},'order':_0xb20b('0x9f')});});}})['then'](respondWithResult(_0x495a01,null))[_0xb20b('0x61')](handleError(_0x495a01,null));};exports['getApplications']=function(_0x4e852b,_0x1dd355,_0x47296){var _0x59a7d3={};var _0x15594f={};var _0x3dde5c;var _0x2831f7;return db[_0xb20b('0x45')][_0xb20b('0x67')]({'where':{'id':_0x4e852b[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x1dd355,null))['then'](function(_0x124a69){if(_0x124a69){_0x3dde5c=_0x124a69;_0x15594f[_0xb20b('0x4d')]=_[_0xb20b('0x4a')](db[_0xb20b('0x9d')][_0xb20b('0x46')]);_0x15594f[_0xb20b('0x49')]=_[_0xb20b('0x4a')](_0x4e852b['query']);_0x15594f[_0xb20b('0x4b')]=_[_0xb20b('0x4c')](_0x15594f[_0xb20b('0x4d')],_0x15594f[_0xb20b('0x49')]);_0x59a7d3[_0xb20b('0x4f')]=_[_0xb20b('0x4c')](_0x15594f[_0xb20b('0x4d')],qs[_0xb20b('0x4e')](_0x4e852b[_0xb20b('0x49')][_0xb20b('0x4e')]));_0x59a7d3[_0xb20b('0x4f')]=_0x59a7d3[_0xb20b('0x4f')]['length']?_0x59a7d3[_0xb20b('0x4f')]:_0x15594f[_0xb20b('0x4d')];_0x59a7d3[_0xb20b('0x68')]=qs[_0xb20b('0x53')](_0x4e852b[_0xb20b('0x49')][_0xb20b('0x53')]);_0x59a7d3[_0xb20b('0x55')]=qs[_0xb20b('0x4b')](_[_0xb20b('0x69')](_0x4e852b[_0xb20b('0x49')],_0x15594f['filters']));if(_0x4e852b[_0xb20b('0x49')][_0xb20b('0x54')]){_0x59a7d3[_0xb20b('0x55')]=_['merge'](_0x59a7d3['where'],{'$or':_[_0xb20b('0x44')](_0x59a7d3[_0xb20b('0x4f')],function(_0x41d2ea){var _0x40b753={};_0x40b753[_0x41d2ea]={'$like':'%'+_0x4e852b[_0xb20b('0x49')][_0xb20b('0x54')]+'%'};return _0x40b753;})});}_0x59a7d3=_[_0xb20b('0x6a')]({},_0x59a7d3,_0x4e852b['options']);return _0x3dde5c['getApplications'](_0x59a7d3);}})[_0xb20b('0x25')](function(_0x43dd74){if(_0x43dd74){_0x2831f7=_0x43dd74[_0xb20b('0x50')];if(!_0x4e852b['query'][_0xb20b('0x51')](_0xb20b('0x52'))){_0x59a7d3['limit']=qs['limit'](_0x4e852b[_0xb20b('0x49')][_0xb20b('0x33')]);_0x59a7d3[_0xb20b('0x32')]=qs[_0xb20b('0x32')](_0x4e852b[_0xb20b('0x49')][_0xb20b('0x32')]);}return _0x3dde5c[_0xb20b('0xa0')](_0x59a7d3);}})[_0xb20b('0x25')](function(_0x2d3b23){if(_0x2d3b23){return _0x2d3b23?{'count':_0x2831f7,'rows':_0x2d3b23}:null;}})[_0xb20b('0x25')](respondWithResult(_0x1dd355,null))[_0xb20b('0x61')](handleError(_0x1dd355,null));};exports[_0xb20b('0xa1')]=function(_0x57a0b3,_0x17243,_0x3bdae8){var _0x199aa6={'raw':!![],'where':{}};var _0x56242b={};var _0x377a24={'count':0x0,'rows':[]};return db[_0xb20b('0x45')][_0xb20b('0x67')]({'where':{'id':_0x57a0b3[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x17243,null))[_0xb20b('0x25')](function(_0x3dd018){if(_0x3dd018){_0x56242b[_0xb20b('0x4d')]=_[_0xb20b('0x4a')](db['MailMessage'][_0xb20b('0x46')]);_0x56242b['query']=_[_0xb20b('0x4a')](_0x57a0b3[_0xb20b('0x49')]);_0x56242b['filters']=_[_0xb20b('0x4c')](_0x56242b[_0xb20b('0x4d')],_0x56242b[_0xb20b('0x49')]);_0x199aa6[_0xb20b('0x4f')]=_[_0xb20b('0x4c')](_0x56242b[_0xb20b('0x4d')],qs[_0xb20b('0x4e')](_0x57a0b3['query'][_0xb20b('0x4e')]));_0x199aa6[_0xb20b('0x4f')]=_0x199aa6[_0xb20b('0x4f')][_0xb20b('0x50')]?_0x199aa6[_0xb20b('0x4f')]:_0x56242b[_0xb20b('0x4d')];if(!_0x57a0b3['query'][_0xb20b('0x51')](_0xb20b('0x52'))){_0x199aa6[_0xb20b('0x33')]=qs[_0xb20b('0x33')](_0x57a0b3[_0xb20b('0x49')][_0xb20b('0x33')]);_0x199aa6[_0xb20b('0x32')]=qs[_0xb20b('0x32')](_0x57a0b3[_0xb20b('0x49')]['offset']);}_0x199aa6[_0xb20b('0x68')]=qs[_0xb20b('0x53')](_0x57a0b3[_0xb20b('0x49')]['sort']);_0x199aa6['where']=qs[_0xb20b('0x4b')](_['pick'](_0x57a0b3[_0xb20b('0x49')],_0x56242b[_0xb20b('0x4b')]));_0x199aa6[_0xb20b('0x55')]['MailAccountId']=_0x3dd018['id'];if(_0x57a0b3[_0xb20b('0x49')][_0xb20b('0x54')]){_0x199aa6[_0xb20b('0x55')]=_[_0xb20b('0x6a')](_0x199aa6['where'],{'$or':_[_0xb20b('0x44')](_0x199aa6[_0xb20b('0x4f')],function(_0x592a05){var _0x57a780={};_0x57a780[_0x592a05]={'$like':'%'+_0x57a0b3[_0xb20b('0x49')][_0xb20b('0x54')]+'%'};return _0x57a780;})});}if(_0x57a0b3[_0xb20b('0x49')][_0xb20b('0xa2')]){var _0x11486=_0x57a0b3[_0xb20b('0x49')][_0xb20b('0xa2')][_0xb20b('0xa3')](',');var _0x4a32ad={};_0x4a32ad[_0x11486[0x0]]={'$gte':moment(_0x11486[0x1])[_0xb20b('0xa4')](_0xb20b('0xa5'))};_0x199aa6[_0xb20b('0x55')]=_[_0xb20b('0x6a')](_0x199aa6[_0xb20b('0x55')],_0x4a32ad);}_0x199aa6=_[_0xb20b('0x6a')]({},_0x199aa6,_0x57a0b3[_0xb20b('0x57')]);return db[_0xb20b('0xa6')]['count']({'where':_0x199aa6['where']})[_0xb20b('0x25')](function(_0x14108d){_0x377a24[_0xb20b('0x31')]=_0x14108d;if(_0x57a0b3['query'][_0xb20b('0x58')]){_0x199aa6['include']=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x199aa6);})[_0xb20b('0x25')](function(_0x111388){_0x377a24[_0xb20b('0x5a')]=_0x111388;return _0x377a24;});}})[_0xb20b('0x25')](respondWithFilteredResult(_0x17243,_0x199aa6))[_0xb20b('0x61')](handleError(_0x17243,null));};exports['send']=function(_0x44ae5a,_0x33ad7a,_0x53ce7e){var _0x5eef17,_0x1bf7e7={},_0x3a20f1;if(_0x44ae5a[_0xb20b('0x5e')]['to']){_0x3a20f1=_0x44ae5a['body']['to']['split'](',')[0x0];}return db[_0xb20b('0x45')][_0xb20b('0x5f')]({'where':{'id':_0x44ae5a[_0xb20b('0x5c')]['id']},'include':[{'model':db[_0xb20b('0xa7')],'as':_0xb20b('0xa8'),'include':[{'model':db[_0xb20b('0x94')],'as':'Contacts','where':{'email':_0x3a20f1},'limit':0x1,'order':[[_0xb20b('0xa9'),'DESC']]}]},{'model':db[_0xb20b('0x5d')],'as':_0xb20b('0x41'),'raw':!![]}]})[_0xb20b('0x25')](handleEntityNotFound(_0x33ad7a,null))[_0xb20b('0x25')](function(_0x1102fe){if(_0x1102fe){_0x5eef17=_0x1102fe;if(_0x1102fe[_0xb20b('0x41')]){if(_['isNil'](_0x44ae5a['body'][_0xb20b('0xaa')])){_0x44ae5a[_0xb20b('0x5e')][_0xb20b('0xaa')]=util[_0xb20b('0xa4')]('%s\x20<%s>',_0x1102fe['name'],_0x1102fe[_0xb20b('0x73')]||_0x1102fe[_0xb20b('0x41')][_0xb20b('0x80')]);}if(_0x44ae5a[_0xb20b('0x5e')][_0xb20b('0xab')]&&_0x44ae5a['body'][_0xb20b('0xab')][_0xb20b('0x50')]){for(var _0x203a10=0x0;_0x203a10<_0x44ae5a[_0xb20b('0x5e')]['attachments'][_0xb20b('0x50')];_0x203a10+=0x1){_0x44ae5a[_0xb20b('0x5e')][_0xb20b('0xab')][_0x203a10]={'filename':_0x44ae5a['body'][_0xb20b('0xab')][_0x203a10][_0xb20b('0x3e')],'path':path[_0xb20b('0xac')](config[_0xb20b('0xad')],_0xb20b('0xae'),_0x44ae5a['body'][_0xb20b('0xab')][_0x203a10][_0xb20b('0xaf')])};}}var _0x5bc9e7={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x1102fe[_0xb20b('0x41')][_0xb20b('0x7f')])){if(_0x1102fe[_0xb20b('0x41')][_0xb20b('0x7c')]){_0x5bc9e7[_0xb20b('0xb0')]={'user':_0x1102fe[_0xb20b('0x41')][_0xb20b('0x80')],'pass':_0x1102fe[_0xb20b('0x41')]['pass']};}_0x5bc9e7[_0xb20b('0x7d')]=_0x1102fe['Smtp'][_0xb20b('0x7d')];_0x5bc9e7[_0xb20b('0x7e')]=_0x1102fe[_0xb20b('0x41')][_0xb20b('0x7e')];_0x5bc9e7['secure']=_0x1102fe['Smtp'][_0xb20b('0xb1')];}else{_0x5bc9e7[_0xb20b('0x7f')]=_0x1102fe[_0xb20b('0x41')][_0xb20b('0x7f')];_0x5bc9e7['auth']={'user':_0x1102fe[_0xb20b('0x41')][_0xb20b('0x80')],'pass':_0x1102fe[_0xb20b('0x41')][_0xb20b('0x81')]};}return respondWithRpcPromise('SendMail',_0xb20b('0xb2'),{'account':_0x5bc9e7,'message':_0x44ae5a[_0xb20b('0x5e')]});}else{throw new Error(_0xb20b('0xb3'));}}})['then'](function(_0x1da3d0){if(_0x1da3d0){_0x1bf7e7=_0x1da3d0;if(_0x5eef17[_0xb20b('0xa8')]){if(_0x5eef17[_0xb20b('0xa8')][_0xb20b('0xb4')]['length']){return _0x5eef17[_0xb20b('0xa8')][_0xb20b('0xb4')][0x0];}else{return db['CmContact'][_0xb20b('0x66')](_['defaults'](_0x44ae5a[_0xb20b('0x5e')],{'firstName':_0x44ae5a['body']['to'],'email':_0x44ae5a['body']['to'],'phone':_0x44ae5a[_0xb20b('0x5e')]['to'],'ListId':_0x5eef17[_0xb20b('0x74')]}));}}else{throw new Error(_0xb20b('0xb3'));}}})['then'](function(_0x4b4c44){if(_0x4b4c44){var _0x598924={'UserId':_0x44ae5a[_0xb20b('0x80')]['id'],'ContactId':_0x4b4c44['id'],'MailAccountId':_0x5eef17['id'],'inReplyTo':_0x1bf7e7[_0xb20b('0xb5')],'to':_0x44ae5a[_0xb20b('0x5e')]['from'],'cc':_0x44ae5a[_0xb20b('0x5e')]['cc'],'subject':_0x44ae5a[_0xb20b('0x5e')]['subject'],'attach':_0x44ae5a[_0xb20b('0x5e')][_0xb20b('0xb6')],'firstMsgDirection':_0xb20b('0xb7'),'lastMsgAt':moment()[_0xb20b('0xa4')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0xb20b('0xb7'),'lastMsgBody':_0x44ae5a[_0xb20b('0x5e')]['body'],'Messages':[_[_0xb20b('0x6a')](_0x44ae5a[_0xb20b('0x5e')],{'messageId':_0x1bf7e7['messageId'],'sentAt':moment()['format'](_0xb20b('0xa5')),'read':!![],'MailAccountId':_0x5eef17['id'],'UserId':_0x44ae5a[_0xb20b('0x80')]['id'],'ContactId':_0x4b4c44['id']})]};if(_0x44ae5a['body'][_0xb20b('0xb8')]){_0x598924=_[_0xb20b('0x6a')](_0x598924,_0x44ae5a['body'][_0xb20b('0xb8')]);}return db[_0xb20b('0x91')][_0xb20b('0x66')](_0x598924,{'include':[{'model':db['MailMessage'],'as':'Messages'}]});}})[_0xb20b('0x25')](respondWithResult(_0x33ad7a,null))[_0xb20b('0x61')](handleError(_0x33ad7a,null));};exports['verifySmtp']=function(_0x44a3e1,_0xf9918a,_0x56d1dd){return db[_0xb20b('0x45')][_0xb20b('0x5f')]({'where':{'id':_0x44a3e1[_0xb20b('0x5c')]['id']},'include':[{'model':db[_0xb20b('0x5d')],'as':_0xb20b('0x41'),'raw':!![]}]})[_0xb20b('0x25')](handleEntityNotFound(_0xf9918a,null))[_0xb20b('0x25')](function(_0x5ea711){if(_0x5ea711&&_0x5ea711[_0xb20b('0x41')]){var _0x43d711={'id':_0x5ea711['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5ea711[_0xb20b('0x41')][_0xb20b('0x7f')]){_0x43d711[_0xb20b('0x7f')]=_0x5ea711[_0xb20b('0x41')][_0xb20b('0x7f')];}else{_0x43d711['host']=_0x5ea711['Smtp']['host'];_0x43d711[_0xb20b('0x7e')]=_0x5ea711['Smtp'][_0xb20b('0x7e')];_0x43d711[_0xb20b('0xb1')]=_0x5ea711[_0xb20b('0x41')][_0xb20b('0xb1')];}if(_0x5ea711[_0xb20b('0x41')][_0xb20b('0x7c')]){_0x43d711[_0xb20b('0xb0')]={'user':_0x5ea711[_0xb20b('0x41')][_0xb20b('0x80')],'pass':_0x5ea711[_0xb20b('0x41')][_0xb20b('0x81')]};}return respondWithRpcPromise('VerifySmtp',_0xb20b('0xb9'),{'account':_0x43d711});}})['then'](respondWithResult(_0xf9918a,null))['catch'](handleError(_0xf9918a,null));};exports['destroy']=function(_0x4cc585,_0x191697){return db[_0xb20b('0x45')][_0xb20b('0x5f')]({'where':{'id':_0x4cc585[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x191697,null))[_0xb20b('0x25')](function(_0x570e8b){if(_0x570e8b&&_0x570e8b[_0xb20b('0x7f')]){throw new db[(_0xb20b('0x22'))][(_0xb20b('0x23'))](_0xb20b('0xba'));}return _0x570e8b;})[_0xb20b('0x25')](removeEntity(_0x191697,null))[_0xb20b('0x61')](handleError(_0x191697,null));};exports[_0xb20b('0xbb')]=function(_0x42dbac,_0x433855,_0x424de9){return db[_0xb20b('0x45')][_0xb20b('0x5f')]({'where':{'id':_0x42dbac['params']['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x433855,null))[_0xb20b('0x25')](function(_0x3a867e){if(_0x3a867e){return _0x3a867e[_0xb20b('0xbb')](_0x42dbac[_0xb20b('0x5e')][_0xb20b('0x71')],_['omit'](_0x42dbac['body'],[_0xb20b('0x71'),'id'])||{})['spread'](function(_0x24e2db){for(var _0x4999c8=0x0;_0x4999c8<_0x42dbac[_0xb20b('0x5e')][_0xb20b('0x71')][_0xb20b('0x50')];_0x4999c8+=0x1){socket[_0xb20b('0xbc')]('userMailAccount:save',{'UserId':_0x42dbac[_0xb20b('0x5e')]['ids'][_0x4999c8],'MailAccountId':_0x42dbac[_0xb20b('0x5c')]['id']});}return _0x24e2db;});}})['then'](respondWithResult(_0x433855,null))[_0xb20b('0x61')](handleError(_0x433855,null));};exports['removeAgents']=function(_0x2830f0,_0x38b7d4,_0x46c307){return db[_0xb20b('0x45')]['find']({'where':{'id':_0x2830f0[_0xb20b('0x5c')]['id']}})[_0xb20b('0x25')](handleEntityNotFound(_0x38b7d4,null))[_0xb20b('0x25')](function(_0x505bec){if(_0x505bec){return _0x505bec[_0xb20b('0xbd')](_0x2830f0['query'][_0xb20b('0x71')])[_0xb20b('0x25')](function(){if(_[_0xb20b('0xbe')](_0x2830f0[_0xb20b('0x49')][_0xb20b('0x71')])){for(var _0x548db9=0x0;_0x548db9<_0x2830f0['query'][_0xb20b('0x71')][_0xb20b('0x50')];_0x548db9+=0x1){socket[_0xb20b('0xbc')](_0xb20b('0xbf'),{'UserId':Number(_0x2830f0[_0xb20b('0x49')][_0xb20b('0x71')][_0x548db9]),'MailAccountId':Number(_0x2830f0['params']['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x2830f0[_0xb20b('0x49')][_0xb20b('0x71')]),'MailAccountId':Number(_0x2830f0['params']['id'])});}});}})[_0xb20b('0x25')](respondWithStatusCode(_0x38b7d4,null))[_0xb20b('0x61')](handleError(_0x38b7d4,null));};exports[_0xb20b('0xc0')]=function(_0x4370af,_0xd7a0d4,_0x36e152){var _0x3d806c={};var _0x440064={};var _0x5c0cd1;var _0x21ab6a;return db[_0xb20b('0x45')][_0xb20b('0x67')]({'where':{'id':_0x4370af[_0xb20b('0x5c')]['id']}})['then'](handleEntityNotFound(_0xd7a0d4,null))[_0xb20b('0x25')](function(_0xb190fd){if(_0xb190fd){_0x5c0cd1=_0xb190fd;_0x440064[_0xb20b('0x4d')]=_[_0xb20b('0x4a')](db[_0xb20b('0x96')]['rawAttributes']);_0x440064['query']=_[_0xb20b('0x4a')](_0x4370af[_0xb20b('0x49')]);_0x440064['filters']=_[_0xb20b('0x4c')](_0x440064[_0xb20b('0x4d')],_0x440064[_0xb20b('0x49')]);_0x3d806c[_0xb20b('0x4f')]=_[_0xb20b('0x4c')](_0x440064[_0xb20b('0x4d')],qs[_0xb20b('0x4e')](_0x4370af[_0xb20b('0x49')][_0xb20b('0x4e')]));_0x3d806c['attributes']=_0x3d806c[_0xb20b('0x4f')][_0xb20b('0x50')]?_0x3d806c[_0xb20b('0x4f')]:_0x440064['model'];_0x3d806c[_0xb20b('0x68')]=qs[_0xb20b('0x53')](_0x4370af[_0xb20b('0x49')]['sort']);_0x3d806c[_0xb20b('0x55')]=qs['filters'](_[_0xb20b('0x69')](_0x4370af[_0xb20b('0x49')],_0x440064['filters']));if(_0x4370af[_0xb20b('0x49')]['filter']){_0x3d806c[_0xb20b('0x55')]=_[_0xb20b('0x6a')](_0x3d806c[_0xb20b('0x55')],{'$or':_[_0xb20b('0x44')](_0x3d806c[_0xb20b('0x4f')],function(_0x45b613){var _0xdc9763={};_0xdc9763[_0x45b613]={'$like':'%'+_0x4370af[_0xb20b('0x49')][_0xb20b('0x54')]+'%'};return _0xdc9763;})});}_0x3d806c=_[_0xb20b('0x6a')]({},_0x3d806c,_0x4370af[_0xb20b('0x57')]);return _0x5c0cd1[_0xb20b('0xc0')](_0x3d806c);}})[_0xb20b('0x25')](function(_0xeae00c){if(_0xeae00c){_0x21ab6a=_0xeae00c['length'];if(!_0x4370af[_0xb20b('0x49')][_0xb20b('0x51')]('nolimit')){_0x3d806c[_0xb20b('0x33')]=qs['limit'](_0x4370af[_0xb20b('0x49')][_0xb20b('0x33')]);_0x3d806c[_0xb20b('0x32')]=qs[_0xb20b('0x32')](_0x4370af[_0xb20b('0x49')][_0xb20b('0x32')]);}return _0x5c0cd1[_0xb20b('0xc0')](_0x3d806c);}})[_0xb20b('0x25')](function(_0x47133f){if(_0x47133f){return _0x47133f?{'count':_0x21ab6a,'rows':_0x47133f}:null;}})['then'](respondWithResult(_0xd7a0d4,null))[_0xb20b('0x61')](handleError(_0xd7a0d4,null));}; \ No newline at end of file +var _0x27a7=['email','isNil','active','description','cauthentication','user','cuser','password','cpassword','authentication','host','port','service','cservice','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','CmContact','User','Owner','fullname','internal','Tag','color','tag','sequelize','MailApplication','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','CmList','List','Contacts','DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','pass','secure','auth','SendMail','sendMail','List\x20not\x20found','attach','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','./mailAccount.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','reject','save','update','destroy','MailAccounts','end','stack','name','send','MailServerOut','Pause','map','MailAccount','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','show','params','MailServerIn','Imap','rawAttributes','options','find','body','Smtp','describe','addDisposition','getDispositions','findOne','Disposition','MailAccountId','removeDispositions','ids','addAnswer','CannedAnswer','create','rows','removeAnswers'];(function(_0x2d5838,_0x301f3b){var _0x51d1db=function(_0x2510df){while(--_0x2510df){_0x2d5838['push'](_0x2d5838['shift']());}};_0x51d1db(++_0x301f3b);}(_0x27a7,0x10c));var _0x727a=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0x27a7[_0x211632];return _0x5a1da1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x727a('0x0'));var rimraf=require(_0x727a('0x1'));var zipdir=require(_0x727a('0x2'));var jsonpatch=require(_0x727a('0x3'));var rp=require(_0x727a('0x4'));var moment=require(_0x727a('0x5'));var BPromise=require(_0x727a('0x6'));var Mustache=require(_0x727a('0x7'));var util=require(_0x727a('0x8'));var path=require(_0x727a('0x9'));var sox=require(_0x727a('0xa'));var csv=require(_0x727a('0xb'));var ejs=require(_0x727a('0xc'));var fs=require('fs');var _=require(_0x727a('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x727a('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(_0x727a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x727a('0x10'));var hardwareService=require(_0x727a('0x11'));var logger=require('../../config/logger')(_0x727a('0x12'));var utils=require(_0x727a('0x13'));var config=require(_0x727a('0x14'));var db=require('../../mysqldb')['db'];config[_0x727a('0x15')]=_[_0x727a('0x16')](config[_0x727a('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x727a('0x15')]));require(_0x727a('0x17'))[_0x727a('0x18')](socket);var jayson=require(_0x727a('0x19'));var client=jayson[_0x727a('0x1a')][_0x727a('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x4b654e,_0x3e7de7,_0x41260f){if(_0x41260f){var _0x224a5c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x224a5c[_0x727a('0x1c')](_0x3e7de7)){return _0x4b654e;}else{throw new db[(_0x727a('0x1d'))]['ValidationError'](_0x727a('0x1e'));}}else{return _0x4b654e;}}function respondWithRpcPromise(_0x1c6997,_0x221da0,_0x563975,_0x3dd67b){return new BPromise(function(_0x1ee346,_0x1779cc){var _0x30cf3c=_0x3dd67b||client;return _0x30cf3c[_0x727a('0x1f')](_0x1c6997,_0x563975)[_0x727a('0x20')](function(_0x491382){logger[_0x727a('0x21')](_0x727a('0x22'),_0x221da0,_0x727a('0x23'));logger['debug'](_0x727a('0x24'),_0x221da0,'request\x20sent',JSON['stringify'](_0x491382));if(_0x491382['error']){if(_0x491382[_0x727a('0x25')][_0x727a('0x26')]===0x1f4){logger[_0x727a('0x25')](_0x727a('0x22'),_0x221da0,_0x491382[_0x727a('0x25')][_0x727a('0x27')]);return _0x1779cc(_0x491382['error'][_0x727a('0x27')]);}logger[_0x727a('0x25')](_0x727a('0x22'),_0x221da0,_0x491382['error'][_0x727a('0x27')]);return _0x1ee346(_0x491382[_0x727a('0x25')][_0x727a('0x27')]);}else{logger[_0x727a('0x21')](_0x727a('0x22'),_0x221da0,_0x727a('0x23'));_0x1ee346(_0x491382[_0x727a('0x28')]['message']);}})[_0x727a('0x29')](function(_0x15f7fe){logger[_0x727a('0x25')]('MailAccount,\x20%s,\x20%s',_0x221da0,_0x15f7fe);_0x1779cc(_0x15f7fe);});});}function respondWithStatusCode(_0x286c8a,_0x617dae){_0x617dae=_0x617dae||0xcc;return function(_0x1f3582){if(_0x1f3582){return _0x286c8a[_0x727a('0x2a')](_0x617dae);}return _0x286c8a[_0x727a('0x2b')](_0x617dae)['end']();};}function respondWithResult(_0x4d61fd,_0xfbe4ae){_0xfbe4ae=_0xfbe4ae||0xc8;return function(_0x299600){if(_0x299600){return _0x4d61fd[_0x727a('0x2b')](_0xfbe4ae)[_0x727a('0x2c')](_0x299600);}};}function respondWithFilteredResult(_0x5e9778,_0x42b63c){return function(_0x2ce9e5){if(_0x2ce9e5){var _0x37f324=_0x2ce9e5[_0x727a('0x2d')],_0x288dc2=_0x42b63c[_0x727a('0x2e')],_0x478010=_0x42b63c[_0x727a('0x2e')]+_0x42b63c[_0x727a('0x2f')],_0x1be972;if(_0x478010>=_0x37f324){_0x478010=_0x37f324;_0x1be972=0xc8;}else{_0x1be972=0xce;}_0x5e9778[_0x727a('0x2b')](_0x1be972);return _0x5e9778[_0x727a('0x30')]('Content-Range',_0x288dc2+'-'+_0x478010+'/'+_0x37f324)[_0x727a('0x2c')](_0x2ce9e5);}return null;};}function patchUpdates(_0x419825){return function(_0x3ad8cf){try{jsonpatch['apply'](_0x3ad8cf,_0x419825,!![]);}catch(_0x143110){return BPromise[_0x727a('0x31')](_0x143110);}return _0x3ad8cf[_0x727a('0x32')]();};}function saveUpdates(_0x3e2a86,_0x57db40){return function(_0x4c0c41){if(_0x4c0c41){return _0x4c0c41[_0x727a('0x33')](_0x3e2a86)[_0x727a('0x20')](function(_0x1c9c31){return _0x1c9c31;});}return null;};}function removeEntity(_0x5d98f4,_0x281049){return function(_0x4dd2dc){if(_0x4dd2dc){return _0x4dd2dc[_0x727a('0x34')]()[_0x727a('0x20')](function(){var _0x5a4040=_0x4dd2dc['get']({'plain':!![]});var _0x3883eb=_0x727a('0x35');return db['UserProfileResource'][_0x727a('0x34')]({'where':{'type':_0x3883eb,'resourceId':_0x5a4040['id']}})[_0x727a('0x20')](function(){return _0x4dd2dc;});})['then'](function(){_0x5d98f4[_0x727a('0x2b')](0xcc)[_0x727a('0x36')]();});}};}function handleEntityNotFound(_0x1a3037,_0x271784){return function(_0xc9aaa7){if(!_0xc9aaa7){_0x1a3037[_0x727a('0x2a')](0x194);}return _0xc9aaa7;};}function handleError(_0xa76f82,_0x1cdc9f){_0x1cdc9f=_0x1cdc9f||0x1f4;return function(_0x3f9b64){logger[_0x727a('0x25')](_0x3f9b64[_0x727a('0x37')]);if(_0x3f9b64[_0x727a('0x38')]){delete _0x3f9b64[_0x727a('0x38')];}_0xa76f82[_0x727a('0x2b')](_0x1cdc9f)[_0x727a('0x39')](_0x3f9b64);};}exports['index']=function(_0x7acdd0,_0x176e5d){var _0x769261={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x727a('0x3a')],'as':'Smtp'},{'model':db[_0x727a('0x3b')],'as':'mandatoryDispositionPause'}]},_0x163289={},_0xe3ad31={'count':0x0,'rows':[]};var _0x47a0f5=_[_0x727a('0x3c')](db[_0x727a('0x3d')]['rawAttributes'],function(_0x5f4b20){return{'name':_0x5f4b20['fieldName'],'type':_0x5f4b20[_0x727a('0x3e')][_0x727a('0x3f')]};});_0x163289[_0x727a('0x40')]=_[_0x727a('0x3c')](_0x47a0f5,'name');_0x163289['query']=_[_0x727a('0x41')](_0x7acdd0[_0x727a('0x42')]);_0x163289[_0x727a('0x43')]=_[_0x727a('0x44')](_0x163289[_0x727a('0x40')],_0x163289['query']);_0x769261[_0x727a('0x45')]=_[_0x727a('0x44')](_0x163289[_0x727a('0x40')],qs[_0x727a('0x46')](_0x7acdd0['query'][_0x727a('0x46')]));_0x769261[_0x727a('0x45')]=_0x769261[_0x727a('0x45')][_0x727a('0x47')]?_0x769261[_0x727a('0x45')]:_0x163289[_0x727a('0x40')];if(!_0x7acdd0[_0x727a('0x42')][_0x727a('0x48')](_0x727a('0x49'))){_0x769261[_0x727a('0x2f')]=qs[_0x727a('0x2f')](_0x7acdd0[_0x727a('0x42')][_0x727a('0x2f')]);_0x769261[_0x727a('0x2e')]=qs[_0x727a('0x2e')](_0x7acdd0[_0x727a('0x42')][_0x727a('0x2e')]);}_0x769261[_0x727a('0x4a')]=qs['sort'](_0x7acdd0[_0x727a('0x42')][_0x727a('0x4b')]);_0x769261[_0x727a('0x4c')]=qs['filters'](_[_0x727a('0x4d')](_0x7acdd0[_0x727a('0x42')],_0x163289[_0x727a('0x43')]),_0x47a0f5);if(_0x7acdd0[_0x727a('0x42')]['filter']){_0x769261[_0x727a('0x4c')]=_[_0x727a('0x4e')](_0x769261[_0x727a('0x4c')],{'$or':_[_0x727a('0x3c')](_0x47a0f5,function(_0x393960){if(_0x393960[_0x727a('0x3e')]!==_0x727a('0x4f')){var _0x33b975={};_0x33b975[_0x393960[_0x727a('0x38')]]={'$like':'%'+_0x7acdd0[_0x727a('0x42')][_0x727a('0x50')]+'%'};return _0x33b975;}})});}_0x769261=_['merge']({},_0x769261,_0x7acdd0['options']);var _0x4c320f={'where':_0x769261[_0x727a('0x4c')]};return db[_0x727a('0x3d')][_0x727a('0x2d')](_0x4c320f)[_0x727a('0x20')](function(_0x50126d){_0xe3ad31['count']=_0x50126d;if(_0x7acdd0[_0x727a('0x42')][_0x727a('0x51')]){_0x769261[_0x727a('0x52')]=[{'all':!![]}];}return db[_0x727a('0x3d')][_0x727a('0x53')](_0x769261);})[_0x727a('0x20')](function(_0x2d92e4){_0xe3ad31['rows']=_0x2d92e4;return _0xe3ad31;})['then'](respondWithFilteredResult(_0x176e5d,_0x769261))[_0x727a('0x29')](handleError(_0x176e5d,null));};exports[_0x727a('0x54')]=function(_0x572b3d,_0x3ecc49){var _0x11f889={'raw':![],'where':{'id':_0x572b3d[_0x727a('0x55')]['id']},'include':[{'model':db[_0x727a('0x56')],'as':_0x727a('0x57')},{'model':db[_0x727a('0x3a')],'as':'Smtp'},{'model':db[_0x727a('0x3b')],'as':'mandatoryDispositionPause'}]},_0x24b81f={};_0x24b81f[_0x727a('0x40')]=_[_0x727a('0x41')](db['MailAccount'][_0x727a('0x58')]);_0x24b81f[_0x727a('0x42')]=_[_0x727a('0x41')](_0x572b3d[_0x727a('0x42')]);_0x24b81f['filters']=_[_0x727a('0x44')](_0x24b81f[_0x727a('0x40')],_0x24b81f[_0x727a('0x42')]);_0x11f889['attributes']=_['intersection'](_0x24b81f[_0x727a('0x40')],qs['fields'](_0x572b3d[_0x727a('0x42')][_0x727a('0x46')]));_0x11f889[_0x727a('0x45')]=_0x11f889['attributes'][_0x727a('0x47')]?_0x11f889[_0x727a('0x45')]:_0x24b81f[_0x727a('0x40')];if(_0x572b3d[_0x727a('0x42')][_0x727a('0x51')]){_0x11f889[_0x727a('0x52')]=[{'all':!![]}];}_0x11f889=_['merge']({},_0x11f889,_0x572b3d[_0x727a('0x59')]);return db[_0x727a('0x3d')][_0x727a('0x5a')](_0x11f889)[_0x727a('0x20')](handleEntityNotFound(_0x3ecc49,null))[_0x727a('0x20')](respondWithResult(_0x3ecc49,null))[_0x727a('0x29')](handleError(_0x3ecc49,null));};exports[_0x727a('0x33')]=function(_0x21510d,_0x2d2559){if(_0x21510d['body']['id']){delete _0x21510d[_0x727a('0x5b')]['id'];}return db['MailAccount'][_0x727a('0x5a')]({'where':{'id':_0x21510d['params']['id']},'include':[{'model':db[_0x727a('0x56')],'as':_0x727a('0x57')},{'model':db[_0x727a('0x3a')],'as':_0x727a('0x5c')},{'model':db[_0x727a('0x3b')],'as':'mandatoryDispositionPause'}]})[_0x727a('0x20')](handleEntityNotFound(_0x2d2559,null))[_0x727a('0x20')](saveUpdates(_0x21510d['body'],null))[_0x727a('0x20')](function(_0x142f10){if(_0x142f10&&_0x21510d[_0x727a('0x5b')][_0x727a('0x57')]){return db[_0x727a('0x56')][_0x727a('0x33')](_0x21510d[_0x727a('0x5b')][_0x727a('0x57')],{'where':{'MailAccountId':_0x142f10['id']}})[_0x727a('0x20')](function(){return _0x142f10;});}return _0x142f10;})[_0x727a('0x20')](function(_0xfbb420){if(_0xfbb420&&_0x21510d['body'][_0x727a('0x5c')]){return db['MailServerOut'][_0x727a('0x33')](_0x21510d[_0x727a('0x5b')]['Smtp'],{'where':{'MailAccountId':_0xfbb420['id']}})[_0x727a('0x20')](function(){return _0xfbb420;});}return _0xfbb420;})[_0x727a('0x20')](respondWithResult(_0x2d2559,null))[_0x727a('0x29')](handleError(_0x2d2559,null));};exports[_0x727a('0x5d')]=function(_0x2b8bf2,_0x1176ba){return db[_0x727a('0x3d')][_0x727a('0x5d')]()[_0x727a('0x20')](respondWithResult(_0x1176ba,null))[_0x727a('0x29')](handleError(_0x1176ba,null));};exports[_0x727a('0x5e')]=function(_0x26f9ce,_0x58e914,_0x52d24c){if(_0x26f9ce['body']['id']){delete _0x26f9ce[_0x727a('0x5b')]['id'];}return db[_0x727a('0x3d')]['find']({'where':{'id':_0x26f9ce[_0x727a('0x55')]['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x58e914,null))[_0x727a('0x20')](function(_0x2fc259){if(_0x2fc259){_0x26f9ce[_0x727a('0x5b')]['MailAccountId']=_0x2fc259['id'];return db['Disposition']['create'](_0x26f9ce[_0x727a('0x5b')]);}})[_0x727a('0x20')](respondWithResult(_0x58e914,null))[_0x727a('0x29')](handleError(_0x58e914,null));};exports[_0x727a('0x5f')]=function(_0x3115d5,_0x499d07,_0x31cc1c){var _0x58fd7e={'raw':![],'where':{}};var _0x4565e6={};var _0x13cb7c={'count':0x0,'rows':[]};return db[_0x727a('0x3d')][_0x727a('0x60')]({'where':{'id':_0x3115d5[_0x727a('0x55')]['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x499d07,null))[_0x727a('0x20')](function(_0x1b0668){if(_0x1b0668){_0x4565e6['model']=_[_0x727a('0x41')](db[_0x727a('0x61')][_0x727a('0x58')]);_0x4565e6[_0x727a('0x42')]=_[_0x727a('0x41')](_0x3115d5[_0x727a('0x42')]);_0x4565e6[_0x727a('0x43')]=_[_0x727a('0x44')](_0x4565e6[_0x727a('0x40')],_0x4565e6[_0x727a('0x42')]);_0x58fd7e[_0x727a('0x45')]=_['intersection'](_0x4565e6[_0x727a('0x40')],qs[_0x727a('0x46')](_0x3115d5[_0x727a('0x42')][_0x727a('0x46')]));_0x58fd7e[_0x727a('0x45')]=_0x58fd7e['attributes'][_0x727a('0x47')]?_0x58fd7e['attributes']:_0x4565e6[_0x727a('0x40')];if(!_0x3115d5['query']['hasOwnProperty']('nolimit')){_0x58fd7e[_0x727a('0x2f')]=qs[_0x727a('0x2f')](_0x3115d5[_0x727a('0x42')][_0x727a('0x2f')]);_0x58fd7e[_0x727a('0x2e')]=qs[_0x727a('0x2e')](_0x3115d5[_0x727a('0x42')]['offset']);}_0x58fd7e['order']=qs[_0x727a('0x4b')](_0x3115d5[_0x727a('0x42')][_0x727a('0x4b')]);_0x58fd7e[_0x727a('0x4c')]=qs['filters'](_['pick'](_0x3115d5[_0x727a('0x42')],_0x4565e6[_0x727a('0x43')]));_0x58fd7e[_0x727a('0x4c')][_0x727a('0x62')]=_0x1b0668['id'];if(_0x3115d5[_0x727a('0x42')][_0x727a('0x50')]){_0x58fd7e[_0x727a('0x4c')]=_[_0x727a('0x4e')](_0x58fd7e[_0x727a('0x4c')],{'$or':_[_0x727a('0x3c')](_0x58fd7e[_0x727a('0x45')],function(_0x3a4718){var _0x1c4a6a={};_0x1c4a6a[_0x3a4718]={'$like':'%'+_0x3115d5['query'][_0x727a('0x50')]+'%'};return _0x1c4a6a;})});}_0x58fd7e=_[_0x727a('0x4e')]({},_0x58fd7e,_0x3115d5[_0x727a('0x59')]);return db['Disposition'][_0x727a('0x2d')]({'where':_0x58fd7e[_0x727a('0x4c')]})[_0x727a('0x20')](function(_0x46a51f){_0x13cb7c[_0x727a('0x2d')]=_0x46a51f;if(_0x3115d5[_0x727a('0x42')]['includeAll']){_0x58fd7e['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x58fd7e);})[_0x727a('0x20')](function(_0x3241fd){_0x13cb7c['rows']=_0x3241fd;return _0x13cb7c;});}})[_0x727a('0x20')](respondWithFilteredResult(_0x499d07,_0x58fd7e))['catch'](handleError(_0x499d07,null));};exports[_0x727a('0x63')]=function(_0x756e25,_0x304599,_0x3bb0f8){return db[_0x727a('0x3d')][_0x727a('0x5a')]({'where':{'id':_0x756e25[_0x727a('0x55')]['id']}})['then'](handleEntityNotFound(_0x304599,null))[_0x727a('0x20')](function(_0x1ca5de){if(_0x1ca5de){return _0x1ca5de[_0x727a('0x63')](_0x756e25[_0x727a('0x42')][_0x727a('0x64')]);}})[_0x727a('0x20')](respondWithStatusCode(_0x304599,null))[_0x727a('0x29')](handleError(_0x304599,null));};exports[_0x727a('0x65')]=function(_0x53b18c,_0x4d8696,_0x3fa5bf){if(_0x53b18c[_0x727a('0x5b')]['id']){delete _0x53b18c[_0x727a('0x5b')]['id'];}return db[_0x727a('0x3d')][_0x727a('0x5a')]({'where':{'id':_0x53b18c[_0x727a('0x55')]['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x4d8696,null))[_0x727a('0x20')](function(_0x63b8fc){if(_0x63b8fc){_0x53b18c['body'][_0x727a('0x62')]=_0x63b8fc['id'];return db[_0x727a('0x66')][_0x727a('0x67')](_0x53b18c['body']);}})[_0x727a('0x20')](respondWithResult(_0x4d8696,null))[_0x727a('0x29')](handleError(_0x4d8696,null));};exports['getAnswers']=function(_0x53975d,_0x5e3a0d,_0x4049b1){var _0x3e4b78={'raw':![],'where':{}};var _0x3a2788={};var _0x592506={'count':0x0,'rows':[]};return db[_0x727a('0x3d')][_0x727a('0x60')]({'where':{'id':_0x53975d[_0x727a('0x55')]['id']}})['then'](handleEntityNotFound(_0x5e3a0d,null))['then'](function(_0x38bf89){if(_0x38bf89){_0x3a2788[_0x727a('0x40')]=_[_0x727a('0x41')](db[_0x727a('0x66')][_0x727a('0x58')]);_0x3a2788[_0x727a('0x42')]=_[_0x727a('0x41')](_0x53975d[_0x727a('0x42')]);_0x3a2788[_0x727a('0x43')]=_['intersection'](_0x3a2788[_0x727a('0x40')],_0x3a2788[_0x727a('0x42')]);_0x3e4b78[_0x727a('0x45')]=_[_0x727a('0x44')](_0x3a2788[_0x727a('0x40')],qs[_0x727a('0x46')](_0x53975d['query'][_0x727a('0x46')]));_0x3e4b78[_0x727a('0x45')]=_0x3e4b78[_0x727a('0x45')][_0x727a('0x47')]?_0x3e4b78[_0x727a('0x45')]:_0x3a2788[_0x727a('0x40')];if(!_0x53975d[_0x727a('0x42')][_0x727a('0x48')](_0x727a('0x49'))){_0x3e4b78[_0x727a('0x2f')]=qs[_0x727a('0x2f')](_0x53975d[_0x727a('0x42')]['limit']);_0x3e4b78['offset']=qs[_0x727a('0x2e')](_0x53975d[_0x727a('0x42')][_0x727a('0x2e')]);}_0x3e4b78[_0x727a('0x4a')]=qs[_0x727a('0x4b')](_0x53975d[_0x727a('0x42')][_0x727a('0x4b')]);_0x3e4b78[_0x727a('0x4c')]=qs[_0x727a('0x43')](_[_0x727a('0x4d')](_0x53975d[_0x727a('0x42')],_0x3a2788[_0x727a('0x43')]));_0x3e4b78[_0x727a('0x4c')]['MailAccountId']=_0x38bf89['id'];if(_0x53975d[_0x727a('0x42')][_0x727a('0x50')]){_0x3e4b78[_0x727a('0x4c')]=_[_0x727a('0x4e')](_0x3e4b78[_0x727a('0x4c')],{'$or':_[_0x727a('0x3c')](_0x3e4b78[_0x727a('0x45')],function(_0x54ba6e){var _0x2d79a2={};_0x2d79a2[_0x54ba6e]={'$like':'%'+_0x53975d[_0x727a('0x42')][_0x727a('0x50')]+'%'};return _0x2d79a2;})});}_0x3e4b78=_[_0x727a('0x4e')]({},_0x3e4b78,_0x53975d[_0x727a('0x59')]);return db['CannedAnswer'][_0x727a('0x2d')]({'where':_0x3e4b78[_0x727a('0x4c')]})['then'](function(_0x12f48a){_0x592506[_0x727a('0x2d')]=_0x12f48a;if(_0x53975d['query'][_0x727a('0x51')]){_0x3e4b78[_0x727a('0x52')]=[{'all':!![]}];}return db[_0x727a('0x66')][_0x727a('0x53')](_0x3e4b78);})[_0x727a('0x20')](function(_0x59a35c){_0x592506[_0x727a('0x68')]=_0x59a35c;return _0x592506;});}})['then'](respondWithFilteredResult(_0x5e3a0d,_0x3e4b78))['catch'](handleError(_0x5e3a0d,null));};exports[_0x727a('0x69')]=function(_0x3ad5cc,_0x15e45,_0x20cd97){return db[_0x727a('0x3d')]['find']({'where':{'id':_0x3ad5cc[_0x727a('0x55')]['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x15e45,null))['then'](function(_0x125876){if(_0x125876){return _0x125876[_0x727a('0x69')](_0x3ad5cc['query'][_0x727a('0x64')]);}})[_0x727a('0x20')](respondWithStatusCode(_0x15e45,null))[_0x727a('0x29')](handleError(_0x15e45,null));};exports[_0x727a('0x67')]=function(_0x288313,_0x28d355){var _0x1a3871={'name':_0x288313[_0x727a('0x5b')]['name'],'key':_0x288313['body']['key'],'email':_0x288313['body'][_0x727a('0x6a')],'ListId':_0x288313[_0x727a('0x5b')]['ListId'],'active':!_[_0x727a('0x6b')](_0x288313[_0x727a('0x5b')][_0x727a('0x6c')])?_0x288313[_0x727a('0x5b')][_0x727a('0x6c')]:!![],'description':_0x288313[_0x727a('0x5b')][_0x727a('0x6d')]||null,'Imap':{},'Smtp':{}};if(_[_0x727a('0x6b')](_0x288313[_0x727a('0x5b')]['cservice'])){if(_0x288313[_0x727a('0x5b')][_0x727a('0x6e')]){_0x1a3871['Imap'][_0x727a('0x6f')]=_0x1a3871[_0x727a('0x5c')][_0x727a('0x6f')]=_0x288313['body'][_0x727a('0x70')];_0x1a3871['Imap'][_0x727a('0x71')]=_0x1a3871[_0x727a('0x5c')]['pass']=_0x288313['body'][_0x727a('0x72')];}else{_0x1a3871[_0x727a('0x57')][_0x727a('0x73')]=_0x1a3871[_0x727a('0x5c')]['authentication']=![];}_0x1a3871[_0x727a('0x57')][_0x727a('0x74')]=_0x288313[_0x727a('0x5b')][_0x727a('0x57')]['host'];_0x1a3871[_0x727a('0x57')][_0x727a('0x75')]=_0x288313[_0x727a('0x5b')][_0x727a('0x57')][_0x727a('0x75')];_0x1a3871[_0x727a('0x5c')][_0x727a('0x74')]=_0x288313[_0x727a('0x5b')][_0x727a('0x5c')][_0x727a('0x74')];_0x1a3871['Smtp']['port']=_0x288313[_0x727a('0x5b')][_0x727a('0x5c')][_0x727a('0x75')];}else{_0x1a3871[_0x727a('0x57')][_0x727a('0x76')]=_0x1a3871[_0x727a('0x5c')]['service']=_0x288313[_0x727a('0x5b')][_0x727a('0x77')];_0x1a3871['Imap'][_0x727a('0x6f')]=_0x1a3871[_0x727a('0x5c')][_0x727a('0x6f')]=_0x288313[_0x727a('0x5b')]['cuser'];_0x1a3871['Imap'][_0x727a('0x71')]=_0x1a3871[_0x727a('0x5c')]['pass']=_0x288313[_0x727a('0x5b')]['cpassword'];}return db[_0x727a('0x3d')][_0x727a('0x67')](_0x1a3871,{'include':[{'model':db[_0x727a('0x3a')],'as':_0x727a('0x5c')},{'model':db[_0x727a('0x56')],'as':'Imap'}]})['then'](function(_0x47bf65){var _0x550cfc=_0x288313[_0x727a('0x6f')][_0x727a('0x78')]({'plain':!![]});if(!_0x550cfc)throw new Error(_0x727a('0x79'));if(_0x550cfc[_0x727a('0x7a')]===_0x727a('0x6f')){var _0x980b22=_0x47bf65['get']({'plain':!![]});return db[_0x727a('0x7b')][_0x727a('0x5a')]({'where':{'name':_0x727a('0x35'),'userProfileId':_0x550cfc[_0x727a('0x7c')]},'raw':!![]})[_0x727a('0x20')](function(_0x590f9a){if(_0x590f9a&&_0x590f9a[_0x727a('0x7d')]===0x0){return db[_0x727a('0x7e')][_0x727a('0x67')]({'name':_0x980b22[_0x727a('0x38')],'resourceId':_0x980b22['id'],'type':_0x590f9a[_0x727a('0x38')],'sectionId':_0x590f9a['id']},{})['then'](function(){return _0x47bf65;});}else{return _0x47bf65;}})[_0x727a('0x29')](function(_0x4c0915){logger[_0x727a('0x25')](_0x727a('0x7f'),_0x4c0915);throw _0x4c0915;});}return _0x47bf65;})['then'](respondWithResult(_0x28d355,0xc9))['catch'](handleError(_0x28d355,null));};exports['getImap']=function(_0x20cf06,_0x469262,_0x42d756){return db[_0x727a('0x3d')]['findOne']({'where':{'id':_0x20cf06[_0x727a('0x55')]['id']}})['then'](handleEntityNotFound(_0x469262,null))['then'](function(_0x1fd21f){if(_0x1fd21f){return _0x1fd21f[_0x727a('0x80')]();}return null;})[_0x727a('0x20')](respondWithResult(_0x469262,null))[_0x727a('0x29')](handleError(_0x469262,null));};exports[_0x727a('0x81')]=function(_0x2bf2f8,_0x82a0e7,_0x18e2f4){if(_0x2bf2f8['body']['id']){delete _0x2bf2f8['body']['id'];}return db['MailAccount'][_0x727a('0x5a')]({'where':{'id':_0x2bf2f8[_0x727a('0x55')]['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x82a0e7,null))[_0x727a('0x20')](function(_0x2f105f){if(_0x2f105f){_0x2bf2f8[_0x727a('0x5b')][_0x727a('0x62')]=_0x2f105f['id'];return db[_0x727a('0x56')]['create'](_0x2bf2f8['body']);}})[_0x727a('0x20')](respondWithResult(_0x82a0e7,null))['catch'](handleError(_0x82a0e7,null));};exports[_0x727a('0x82')]=function(_0x51565f,_0x143bc6,_0x3ed147){return db[_0x727a('0x3d')][_0x727a('0x60')]({'where':{'id':_0x51565f[_0x727a('0x55')]['id']}})['then'](handleEntityNotFound(_0x143bc6,null))['then'](function(_0xe9c3a0){if(_0xe9c3a0){return _0xe9c3a0[_0x727a('0x83')](null);}return null;})['then'](respondWithStatusCode(_0x143bc6,null))[_0x727a('0x29')](handleError(_0x143bc6,null));};exports[_0x727a('0x84')]=function(_0xad1cdb,_0x2896de,_0x3164a5){return db['MailAccount']['findOne']({'where':{'id':_0xad1cdb[_0x727a('0x55')]['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x2896de,null))[_0x727a('0x20')](function(_0x115ab5){if(_0x115ab5){return _0x115ab5[_0x727a('0x84')]();}return null;})['then'](respondWithResult(_0x2896de,null))[_0x727a('0x29')](handleError(_0x2896de,null));};exports[_0x727a('0x85')]=function(_0x4fedaa,_0x4faee1,_0x39a963){if(_0x4fedaa[_0x727a('0x5b')]['id']){delete _0x4fedaa[_0x727a('0x5b')]['id'];}return db['MailAccount'][_0x727a('0x5a')]({'where':{'id':_0x4fedaa[_0x727a('0x55')]['id']}})['then'](handleEntityNotFound(_0x4faee1,null))[_0x727a('0x20')](function(_0x1b6ca7){if(_0x1b6ca7){_0x4fedaa['body'][_0x727a('0x62')]=_0x1b6ca7['id'];return db[_0x727a('0x3a')][_0x727a('0x67')](_0x4fedaa[_0x727a('0x5b')]);}})[_0x727a('0x20')](respondWithResult(_0x4faee1,null))[_0x727a('0x29')](handleError(_0x4faee1,null));};exports[_0x727a('0x86')]=function(_0x4877ba,_0x50ea39,_0xdf81af){return db[_0x727a('0x3d')][_0x727a('0x60')]({'where':{'id':_0x4877ba['params']['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x50ea39,null))[_0x727a('0x20')](function(_0x555f87){if(_0x555f87){return _0x555f87[_0x727a('0x87')](null);}return null;})[_0x727a('0x20')](respondWithStatusCode(_0x50ea39,null))[_0x727a('0x29')](handleError(_0x50ea39,null));};exports[_0x727a('0x88')]=function(_0x51810b,_0x4722b3,_0xbb1ae1){return db[_0x727a('0x89')]['find']({'where':{'id':_0x51810b[_0x727a('0x55')]['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x4722b3,null))[_0x727a('0x20')](function(_0x280fd9){if(_0x280fd9){return _0x280fd9[_0x727a('0x88')](_0x51810b[_0x727a('0x5b')]['ids'],_['omit'](_0x51810b['body'],[_0x727a('0x64'),'id'])||{});}})[_0x727a('0x20')](respondWithResult(_0x4722b3,null))[_0x727a('0x29')](handleError(_0x4722b3,null));};exports['getInteractions']=function(_0x4872c7,_0x561164,_0x14fdae){var _0x2017e2={'raw':![],'where':{}};var _0x12e85b={};var _0x1a8748={'count':0x0,'rows':[]};return db[_0x727a('0x3d')][_0x727a('0x60')]({'where':{'id':_0x4872c7['params']['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x561164,null))[_0x727a('0x20')](function(_0x15e213){if(_0x15e213){_0x12e85b[_0x727a('0x40')]=_[_0x727a('0x41')](db[_0x727a('0x89')][_0x727a('0x58')]);_0x12e85b[_0x727a('0x42')]=_[_0x727a('0x41')](_0x4872c7['query']);_0x12e85b[_0x727a('0x43')]=_[_0x727a('0x44')](_0x12e85b[_0x727a('0x40')],_0x12e85b[_0x727a('0x42')]);_0x2017e2[_0x727a('0x45')]=_[_0x727a('0x44')](_0x12e85b[_0x727a('0x40')],qs['fields'](_0x4872c7[_0x727a('0x42')]['fields']));_0x2017e2[_0x727a('0x45')]=_0x2017e2[_0x727a('0x45')][_0x727a('0x47')]?_0x2017e2[_0x727a('0x45')]:_0x12e85b[_0x727a('0x40')];if(!_0x4872c7[_0x727a('0x42')][_0x727a('0x48')](_0x727a('0x49'))){_0x2017e2[_0x727a('0x2f')]=qs[_0x727a('0x2f')](_0x4872c7[_0x727a('0x42')][_0x727a('0x2f')]);_0x2017e2[_0x727a('0x2e')]=qs[_0x727a('0x2e')](_0x4872c7[_0x727a('0x42')][_0x727a('0x2e')]);}_0x2017e2[_0x727a('0x4a')]=qs[_0x727a('0x4b')](_0x4872c7[_0x727a('0x42')][_0x727a('0x4b')]);_0x2017e2[_0x727a('0x4c')]=qs['filters'](_[_0x727a('0x4d')](_0x4872c7[_0x727a('0x42')],_0x12e85b[_0x727a('0x43')]));_0x2017e2[_0x727a('0x4c')]['MailAccountId']=_0x15e213['id'];if(_0x4872c7[_0x727a('0x42')]['filter']){_0x2017e2['where']=_[_0x727a('0x4e')](_0x2017e2[_0x727a('0x4c')],{'$or':_['map'](_0x2017e2['attributes'],function(_0x316adc){var _0x1b196f={};_0x1b196f[_0x316adc]={'$like':'%'+_0x4872c7[_0x727a('0x42')]['filter']+'%'};return _0x1b196f;})});}_0x2017e2=_[_0x727a('0x4e')]({},_0x2017e2,_0x4872c7[_0x727a('0x59')]);return db['MailInteraction'][_0x727a('0x2d')]({'where':_0x2017e2[_0x727a('0x4c')]})['then'](function(_0x5ec8a5){_0x1a8748[_0x727a('0x2d')]=_0x5ec8a5;if(_0x4872c7[_0x727a('0x42')][_0x727a('0x51')]){_0x2017e2[_0x727a('0x52')]=[{'model':db[_0x727a('0x8a')],'as':'Contact','required':![]},{'model':db[_0x727a('0x8b')],'as':_0x727a('0x8c'),'attributes':['name',_0x727a('0x8d'),_0x727a('0x8e')],'required':![]},{'model':db[_0x727a('0x8f')],'as':'Tags','attributes':['id',_0x727a('0x38'),_0x727a('0x90')],'where':_0x4872c7['query'][_0x727a('0x91')]?{'id':_0x4872c7[_0x727a('0x42')][_0x727a('0x91')]}:undefined,'required':_0x4872c7[_0x727a('0x42')][_0x727a('0x91')]?!![]:![]}];}return db[_0x727a('0x89')][_0x727a('0x53')](_0x2017e2);})[_0x727a('0x20')](function(_0x3efc3e){_0x1a8748[_0x727a('0x68')]=_0x3efc3e;return _0x1a8748;});}})[_0x727a('0x20')](respondWithFilteredResult(_0x561164,_0x2017e2))[_0x727a('0x29')](handleError(_0x561164,null));};exports['addApplications']=function(_0x244cb3,_0x40f0fd,_0x3e19cf){return db[_0x727a('0x3d')]['findOne']({'where':{'id':_0x244cb3[_0x727a('0x55')]['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x40f0fd,null))['then'](function(_0x233de5){if(_0x233de5){return db[_0x727a('0x92')]['transaction'](function(_0x1dae9e){return db[_0x727a('0x93')][_0x727a('0x34')]({'where':{'MailAccountId':_0x244cb3['params']['id']},'transaction':_0x1dae9e})['then'](function(_0x3dd211){var _0x5a3536=_[_0x727a('0x3c')](_0x244cb3[_0x727a('0x5b')],function(_0x2d42fa){_0x2d42fa[_0x727a('0x62')]=_0x244cb3[_0x727a('0x55')]['id'];return _0x2d42fa;});return db['MailApplication']['bulkCreate'](_0x5a3536,{'transaction':_0x1dae9e});});})[_0x727a('0x20')](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x244cb3[_0x727a('0x55')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x40f0fd,null))[_0x727a('0x29')](handleError(_0x40f0fd,null));};exports['getApplications']=function(_0x420728,_0x177f16,_0x3d02d4){var _0x2c407b={};var _0x4e8ae1={};var _0x4221bc;var _0xb0c4bb;return db[_0x727a('0x3d')]['findOne']({'where':{'id':_0x420728[_0x727a('0x55')]['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x177f16,null))[_0x727a('0x20')](function(_0x45450e){if(_0x45450e){_0x4221bc=_0x45450e;_0x4e8ae1[_0x727a('0x40')]=_[_0x727a('0x41')](db['MailApplication'][_0x727a('0x58')]);_0x4e8ae1[_0x727a('0x42')]=_[_0x727a('0x41')](_0x420728[_0x727a('0x42')]);_0x4e8ae1[_0x727a('0x43')]=_[_0x727a('0x44')](_0x4e8ae1[_0x727a('0x40')],_0x4e8ae1[_0x727a('0x42')]);_0x2c407b[_0x727a('0x45')]=_['intersection'](_0x4e8ae1['model'],qs[_0x727a('0x46')](_0x420728[_0x727a('0x42')][_0x727a('0x46')]));_0x2c407b[_0x727a('0x45')]=_0x2c407b[_0x727a('0x45')][_0x727a('0x47')]?_0x2c407b[_0x727a('0x45')]:_0x4e8ae1['model'];_0x2c407b[_0x727a('0x4a')]=qs[_0x727a('0x4b')](_0x420728['query'][_0x727a('0x4b')]);_0x2c407b['where']=qs[_0x727a('0x43')](_['pick'](_0x420728[_0x727a('0x42')],_0x4e8ae1[_0x727a('0x43')]));if(_0x420728[_0x727a('0x42')][_0x727a('0x50')]){_0x2c407b[_0x727a('0x4c')]=_['merge'](_0x2c407b['where'],{'$or':_[_0x727a('0x3c')](_0x2c407b['attributes'],function(_0x5186f3){var _0x209356={};_0x209356[_0x5186f3]={'$like':'%'+_0x420728[_0x727a('0x42')][_0x727a('0x50')]+'%'};return _0x209356;})});}_0x2c407b=_['merge']({},_0x2c407b,_0x420728[_0x727a('0x59')]);return _0x4221bc[_0x727a('0x94')](_0x2c407b);}})['then'](function(_0x257940){if(_0x257940){_0xb0c4bb=_0x257940[_0x727a('0x47')];if(!_0x420728[_0x727a('0x42')][_0x727a('0x48')](_0x727a('0x49'))){_0x2c407b[_0x727a('0x2f')]=qs[_0x727a('0x2f')](_0x420728[_0x727a('0x42')][_0x727a('0x2f')]);_0x2c407b[_0x727a('0x2e')]=qs[_0x727a('0x2e')](_0x420728[_0x727a('0x42')][_0x727a('0x2e')]);}return _0x4221bc[_0x727a('0x94')](_0x2c407b);}})[_0x727a('0x20')](function(_0x2185d8){if(_0x2185d8){return _0x2185d8?{'count':_0xb0c4bb,'rows':_0x2185d8}:null;}})[_0x727a('0x20')](respondWithResult(_0x177f16,null))[_0x727a('0x29')](handleError(_0x177f16,null));};exports[_0x727a('0x95')]=function(_0x1a07c1,_0x4ad636,_0x459b56){var _0x3fe6ef={'raw':!![],'where':{}};var _0x3faa36={};var _0x289e41={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x1a07c1[_0x727a('0x55')]['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x4ad636,null))[_0x727a('0x20')](function(_0x22e9bb){if(_0x22e9bb){_0x3faa36[_0x727a('0x40')]=_[_0x727a('0x41')](db['MailMessage'][_0x727a('0x58')]);_0x3faa36['query']=_['keys'](_0x1a07c1[_0x727a('0x42')]);_0x3faa36[_0x727a('0x43')]=_[_0x727a('0x44')](_0x3faa36['model'],_0x3faa36[_0x727a('0x42')]);_0x3fe6ef[_0x727a('0x45')]=_[_0x727a('0x44')](_0x3faa36[_0x727a('0x40')],qs[_0x727a('0x46')](_0x1a07c1[_0x727a('0x42')]['fields']));_0x3fe6ef[_0x727a('0x45')]=_0x3fe6ef[_0x727a('0x45')][_0x727a('0x47')]?_0x3fe6ef['attributes']:_0x3faa36[_0x727a('0x40')];if(!_0x1a07c1[_0x727a('0x42')][_0x727a('0x48')]('nolimit')){_0x3fe6ef[_0x727a('0x2f')]=qs[_0x727a('0x2f')](_0x1a07c1[_0x727a('0x42')][_0x727a('0x2f')]);_0x3fe6ef[_0x727a('0x2e')]=qs['offset'](_0x1a07c1[_0x727a('0x42')][_0x727a('0x2e')]);}_0x3fe6ef['order']=qs['sort'](_0x1a07c1['query'][_0x727a('0x4b')]);_0x3fe6ef[_0x727a('0x4c')]=qs[_0x727a('0x43')](_['pick'](_0x1a07c1[_0x727a('0x42')],_0x3faa36[_0x727a('0x43')]));_0x3fe6ef[_0x727a('0x4c')][_0x727a('0x62')]=_0x22e9bb['id'];if(_0x1a07c1[_0x727a('0x42')][_0x727a('0x50')]){_0x3fe6ef[_0x727a('0x4c')]=_['merge'](_0x3fe6ef[_0x727a('0x4c')],{'$or':_['map'](_0x3fe6ef[_0x727a('0x45')],function(_0x5ac7cd){var _0x1e2628={};_0x1e2628[_0x5ac7cd]={'$like':'%'+_0x1a07c1[_0x727a('0x42')][_0x727a('0x50')]+'%'};return _0x1e2628;})});}if(_0x1a07c1[_0x727a('0x42')][_0x727a('0x96')]){var _0x3abf3e=_0x1a07c1[_0x727a('0x42')][_0x727a('0x96')][_0x727a('0x97')](',');var _0x554755={};_0x554755[_0x3abf3e[0x0]]={'$gte':moment(_0x3abf3e[0x1])[_0x727a('0x98')](_0x727a('0x99'))};_0x3fe6ef['where']=_[_0x727a('0x4e')](_0x3fe6ef['where'],_0x554755);}_0x3fe6ef=_[_0x727a('0x4e')]({},_0x3fe6ef,_0x1a07c1[_0x727a('0x59')]);return db[_0x727a('0x9a')][_0x727a('0x2d')]({'where':_0x3fe6ef[_0x727a('0x4c')]})['then'](function(_0x188a40){_0x289e41[_0x727a('0x2d')]=_0x188a40;if(_0x1a07c1['query'][_0x727a('0x51')]){_0x3fe6ef[_0x727a('0x52')]=[{'all':!![]}];}return db['MailMessage'][_0x727a('0x53')](_0x3fe6ef);})[_0x727a('0x20')](function(_0x47728f){_0x289e41['rows']=_0x47728f;return _0x289e41;});}})['then'](respondWithFilteredResult(_0x4ad636,_0x3fe6ef))['catch'](handleError(_0x4ad636,null));};exports['send']=function(_0xe80753,_0x56e0d9,_0x2926cf){var _0x7d7364,_0x54cf5b={},_0x760898;if(_0xe80753[_0x727a('0x5b')]['to']){_0x760898=_0xe80753['body']['to'][_0x727a('0x97')](',')[0x0];}return db[_0x727a('0x3d')][_0x727a('0x5a')]({'where':{'id':_0xe80753[_0x727a('0x55')]['id']},'include':[{'model':db[_0x727a('0x9b')],'as':_0x727a('0x9c'),'include':[{'model':db[_0x727a('0x8a')],'as':_0x727a('0x9d'),'where':{'email':_0x760898},'limit':0x1,'order':[['updatedAt',_0x727a('0x9e')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x727a('0x20')](handleEntityNotFound(_0x56e0d9,null))[_0x727a('0x20')](function(_0x5c9c31){if(_0x5c9c31){_0x7d7364=_0x5c9c31;if(_0x5c9c31[_0x727a('0x5c')]){if(_[_0x727a('0x6b')](_0xe80753['body'][_0x727a('0x9f')])){_0xe80753[_0x727a('0x5b')][_0x727a('0x9f')]=util[_0x727a('0x98')](_0x727a('0xa0'),_0x5c9c31['name'],_0x5c9c31[_0x727a('0x6a')]||_0x5c9c31[_0x727a('0x5c')][_0x727a('0x6f')]);}if(_0xe80753[_0x727a('0x5b')][_0x727a('0xa1')]&&_0xe80753[_0x727a('0x5b')][_0x727a('0xa1')][_0x727a('0x47')]){for(var _0x22b660=0x0;_0x22b660<_0xe80753[_0x727a('0x5b')][_0x727a('0xa1')][_0x727a('0x47')];_0x22b660+=0x1){_0xe80753[_0x727a('0x5b')][_0x727a('0xa1')][_0x22b660]={'filename':_0xe80753[_0x727a('0x5b')][_0x727a('0xa1')][_0x22b660][_0x727a('0x38')],'path':path[_0x727a('0xa2')](config['root'],_0x727a('0xa3'),_0xe80753[_0x727a('0x5b')][_0x727a('0xa1')][_0x22b660][_0x727a('0xa4')])};}}var _0x11b789={'tls':{'rejectUnauthorized':![]}};if(_[_0x727a('0x6b')](_0x5c9c31[_0x727a('0x5c')]['service'])){if(_0x5c9c31['Smtp'][_0x727a('0x73')]){_0x11b789['auth']={'user':_0x5c9c31['Smtp'][_0x727a('0x6f')],'pass':_0x5c9c31[_0x727a('0x5c')][_0x727a('0xa5')]};}_0x11b789[_0x727a('0x74')]=_0x5c9c31['Smtp'][_0x727a('0x74')];_0x11b789[_0x727a('0x75')]=_0x5c9c31[_0x727a('0x5c')]['port'];_0x11b789[_0x727a('0xa6')]=_0x5c9c31['Smtp'][_0x727a('0xa6')];}else{_0x11b789[_0x727a('0x76')]=_0x5c9c31[_0x727a('0x5c')][_0x727a('0x76')];_0x11b789[_0x727a('0xa7')]={'user':_0x5c9c31['Smtp'][_0x727a('0x6f')],'pass':_0x5c9c31[_0x727a('0x5c')]['pass']};}return respondWithRpcPromise(_0x727a('0xa8'),_0x727a('0xa9'),{'account':_0x11b789,'message':_0xe80753[_0x727a('0x5b')]});}else{throw new Error(_0x727a('0xaa'));}}})[_0x727a('0x20')](function(_0x5a63f2){if(_0x5a63f2){_0x54cf5b=_0x5a63f2;if(_0x7d7364[_0x727a('0x9c')]){if(_0x7d7364['List'][_0x727a('0x9d')][_0x727a('0x47')]){return _0x7d7364[_0x727a('0x9c')][_0x727a('0x9d')][0x0];}else{return db[_0x727a('0x8a')][_0x727a('0x67')](_[_0x727a('0x16')](_0xe80753['body'],{'firstName':_0xe80753[_0x727a('0x5b')]['to'],'email':_0xe80753[_0x727a('0x5b')]['to'],'phone':_0xe80753[_0x727a('0x5b')]['to'],'ListId':_0x7d7364['ListId']}));}}else{throw new Error(_0x727a('0xaa'));}}})[_0x727a('0x20')](function(_0x8a7d89){if(_0x8a7d89){var _0x10ba65={'UserId':_0xe80753[_0x727a('0x6f')]['id'],'ContactId':_0x8a7d89['id'],'MailAccountId':_0x7d7364['id'],'inReplyTo':_0x54cf5b['messageId'],'to':_0xe80753['body'][_0x727a('0x9f')],'cc':_0xe80753[_0x727a('0x5b')]['cc'],'subject':_0xe80753[_0x727a('0x5b')]['subject'],'attach':_0xe80753[_0x727a('0x5b')][_0x727a('0xab')],'firstMsgDirection':'out','lastMsgAt':moment()[_0x727a('0x98')](_0x727a('0x99')),'lastMsgDirection':_0x727a('0xac'),'lastMsgBody':_0xe80753['body'][_0x727a('0x5b')],'Messages':[_['merge'](_0xe80753[_0x727a('0x5b')],{'messageId':_0x54cf5b[_0x727a('0xad')],'sentAt':moment()['format'](_0x727a('0x99')),'read':!![],'MailAccountId':_0x7d7364['id'],'UserId':_0xe80753[_0x727a('0x6f')]['id'],'ContactId':_0x8a7d89['id']})]};if(_0xe80753['body'][_0x727a('0xae')]){_0x10ba65=_[_0x727a('0x4e')](_0x10ba65,_0xe80753[_0x727a('0x5b')]['Interaction']);}return db[_0x727a('0x89')][_0x727a('0x67')](_0x10ba65,{'include':[{'model':db['MailMessage'],'as':_0x727a('0xaf')}]});}})[_0x727a('0x20')](respondWithResult(_0x56e0d9,null))[_0x727a('0x29')](handleError(_0x56e0d9,null));};exports[_0x727a('0xb0')]=function(_0x59b308,_0x56fc16,_0x24616e){return db['MailAccount']['find']({'where':{'id':_0x59b308[_0x727a('0x55')]['id']},'include':[{'model':db[_0x727a('0x3a')],'as':'Smtp','raw':!![]}]})[_0x727a('0x20')](handleEntityNotFound(_0x56fc16,null))[_0x727a('0x20')](function(_0x1cb56c){if(_0x1cb56c&&_0x1cb56c[_0x727a('0x5c')]){var _0x34ec11={'id':_0x1cb56c['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1cb56c[_0x727a('0x5c')][_0x727a('0x76')]){_0x34ec11['service']=_0x1cb56c[_0x727a('0x5c')]['service'];}else{_0x34ec11[_0x727a('0x74')]=_0x1cb56c[_0x727a('0x5c')]['host'];_0x34ec11[_0x727a('0x75')]=_0x1cb56c[_0x727a('0x5c')][_0x727a('0x75')];_0x34ec11['secure']=_0x1cb56c[_0x727a('0x5c')][_0x727a('0xa6')];}if(_0x1cb56c[_0x727a('0x5c')]['authentication']){_0x34ec11[_0x727a('0xa7')]={'user':_0x1cb56c['Smtp']['user'],'pass':_0x1cb56c[_0x727a('0x5c')][_0x727a('0xa5')]};}return respondWithRpcPromise(_0x727a('0xb1'),'verifySmtp',{'account':_0x34ec11});}})[_0x727a('0x20')](respondWithResult(_0x56fc16,null))['catch'](handleError(_0x56fc16,null));};exports[_0x727a('0x34')]=function(_0x2778e4,_0x129cdc){return db[_0x727a('0x3d')][_0x727a('0x5a')]({'where':{'id':_0x2778e4[_0x727a('0x55')]['id']}})['then'](handleEntityNotFound(_0x129cdc,null))[_0x727a('0x20')](function(_0xed66ce){if(_0xed66ce&&_0xed66ce[_0x727a('0x76')]){throw new db[(_0x727a('0x1d'))][(_0x727a('0xb2'))](_0x727a('0xb3'));}return _0xed66ce;})[_0x727a('0x20')](removeEntity(_0x129cdc,null))[_0x727a('0x29')](handleError(_0x129cdc,null));};exports[_0x727a('0xb4')]=function(_0x537de9,_0x10ba33,_0x11ba0d){return db[_0x727a('0x3d')][_0x727a('0x5a')]({'where':{'id':_0x537de9[_0x727a('0x55')]['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x10ba33,null))['then'](function(_0x3a607b){if(_0x3a607b){return _0x3a607b['addAgents'](_0x537de9[_0x727a('0x5b')]['ids'],_[_0x727a('0xb5')](_0x537de9[_0x727a('0x5b')],[_0x727a('0x64'),'id'])||{})['spread'](function(_0x32d361){for(var _0x553cf9=0x0;_0x553cf9<_0x537de9['body'][_0x727a('0x64')][_0x727a('0x47')];_0x553cf9+=0x1){socket['emit'](_0x727a('0xb6'),{'UserId':_0x537de9['body'][_0x727a('0x64')][_0x553cf9],'MailAccountId':_0x537de9[_0x727a('0x55')]['id']});}return _0x32d361;});}})[_0x727a('0x20')](respondWithResult(_0x10ba33,null))[_0x727a('0x29')](handleError(_0x10ba33,null));};exports[_0x727a('0xb7')]=function(_0x4abe85,_0x201798,_0x1744b7){return db[_0x727a('0x3d')][_0x727a('0x5a')]({'where':{'id':_0x4abe85['params']['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x201798,null))['then'](function(_0x154356){if(_0x154356){return _0x154356[_0x727a('0xb7')](_0x4abe85[_0x727a('0x42')][_0x727a('0x64')])[_0x727a('0x20')](function(){if(_['isArray'](_0x4abe85[_0x727a('0x42')][_0x727a('0x64')])){for(var _0x14230e=0x0;_0x14230e<_0x4abe85[_0x727a('0x42')][_0x727a('0x64')]['length'];_0x14230e+=0x1){socket[_0x727a('0xb8')](_0x727a('0xb9'),{'UserId':Number(_0x4abe85[_0x727a('0x42')][_0x727a('0x64')][_0x14230e]),'MailAccountId':Number(_0x4abe85[_0x727a('0x55')]['id'])});}}else{socket['emit'](_0x727a('0xb9'),{'UserId':Number(_0x4abe85[_0x727a('0x42')]['ids']),'MailAccountId':Number(_0x4abe85[_0x727a('0x55')]['id'])});}});}})[_0x727a('0x20')](respondWithStatusCode(_0x201798,null))['catch'](handleError(_0x201798,null));};exports[_0x727a('0xba')]=function(_0x4992da,_0x4e0b21,_0x4109d6){var _0x11bd9f={};var _0x458ae1={};var _0x4c88b7;var _0x1bafe8;return db['MailAccount'][_0x727a('0x60')]({'where':{'id':_0x4992da[_0x727a('0x55')]['id']}})[_0x727a('0x20')](handleEntityNotFound(_0x4e0b21,null))[_0x727a('0x20')](function(_0x3bf362){if(_0x3bf362){_0x4c88b7=_0x3bf362;_0x458ae1[_0x727a('0x40')]=_[_0x727a('0x41')](db[_0x727a('0x8b')][_0x727a('0x58')]);_0x458ae1[_0x727a('0x42')]=_[_0x727a('0x41')](_0x4992da[_0x727a('0x42')]);_0x458ae1[_0x727a('0x43')]=_[_0x727a('0x44')](_0x458ae1[_0x727a('0x40')],_0x458ae1[_0x727a('0x42')]);_0x11bd9f[_0x727a('0x45')]=_[_0x727a('0x44')](_0x458ae1[_0x727a('0x40')],qs['fields'](_0x4992da[_0x727a('0x42')]['fields']));_0x11bd9f[_0x727a('0x45')]=_0x11bd9f[_0x727a('0x45')][_0x727a('0x47')]?_0x11bd9f[_0x727a('0x45')]:_0x458ae1[_0x727a('0x40')];_0x11bd9f[_0x727a('0x4a')]=qs['sort'](_0x4992da[_0x727a('0x42')][_0x727a('0x4b')]);_0x11bd9f['where']=qs['filters'](_['pick'](_0x4992da[_0x727a('0x42')],_0x458ae1[_0x727a('0x43')]));if(_0x4992da['query'][_0x727a('0x50')]){_0x11bd9f[_0x727a('0x4c')]=_[_0x727a('0x4e')](_0x11bd9f[_0x727a('0x4c')],{'$or':_[_0x727a('0x3c')](_0x11bd9f['attributes'],function(_0x87c09){var _0x487f34={};_0x487f34[_0x87c09]={'$like':'%'+_0x4992da[_0x727a('0x42')][_0x727a('0x50')]+'%'};return _0x487f34;})});}_0x11bd9f=_['merge']({},_0x11bd9f,_0x4992da[_0x727a('0x59')]);return _0x4c88b7[_0x727a('0xba')](_0x11bd9f);}})['then'](function(_0x8b117b){if(_0x8b117b){_0x1bafe8=_0x8b117b[_0x727a('0x47')];if(!_0x4992da[_0x727a('0x42')]['hasOwnProperty']('nolimit')){_0x11bd9f[_0x727a('0x2f')]=qs[_0x727a('0x2f')](_0x4992da[_0x727a('0x42')][_0x727a('0x2f')]);_0x11bd9f[_0x727a('0x2e')]=qs[_0x727a('0x2e')](_0x4992da[_0x727a('0x42')]['offset']);}return _0x4c88b7[_0x727a('0xba')](_0x11bd9f);}})[_0x727a('0x20')](function(_0x58ac20){if(_0x58ac20){return _0x58ac20?{'count':_0x1bafe8,'rows':_0x58ac20}:null;}})[_0x727a('0x20')](respondWithResult(_0x4e0b21,null))['catch'](handleError(_0x4e0b21,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 04129db..8e437a3 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 _0x6d8b=['events','../../mysqldb','MailAccount','save','emit','hasOwnProperty','hook','exports'];(function(_0x3f1581,_0x1cab00){var _0x4bc75e=function(_0x3fc977){while(--_0x3fc977){_0x3f1581['push'](_0x3f1581['shift']());}};_0x4bc75e(++_0x1cab00);}(_0x6d8b,0x1b0));var _0xb6d8=function(_0x43866d,_0x72b584){_0x43866d=_0x43866d-0x0;var _0x3100a5=_0x6d8b[_0x43866d];return _0x3100a5;};'use strict';var EventEmitter=require(_0xb6d8('0x0'));var MailAccount=require(_0xb6d8('0x1'))['db'][_0xb6d8('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb6d8('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x480185){return function(_0x3a6491,_0x1aa75c,_0x3256cc){MailAccountEvents[_0xb6d8('0x4')](_0x480185+':'+_0x3a6491['id'],_0x3a6491);MailAccountEvents[_0xb6d8('0x4')](_0x480185,_0x3a6491);_0x3256cc(null);};}for(var e in events){if(events[_0xb6d8('0x5')](e)){var event=events[e];MailAccount[_0xb6d8('0x6')](e,emitEvent(event));}}module[_0xb6d8('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x778c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','MailAccount'];(function(_0x2b7a96,_0xbbf291){var _0x5f5dfb=function(_0x31a6e0){while(--_0x31a6e0){_0x2b7a96['push'](_0x2b7a96['shift']());}};_0x5f5dfb(++_0xbbf291);}(_0x778c,0x1e4));var _0xc778=function(_0x2b1551,_0x1776fe){_0x2b1551=_0x2b1551-0x0;var _0x2fc2a1=_0x778c[_0x2b1551];return _0x2fc2a1;};'use strict';var EventEmitter=require(_0xc778('0x0'));var MailAccount=require('../../mysqldb')['db'][_0xc778('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xc778('0x2')](0x0);var events={'afterCreate':_0xc778('0x3'),'afterUpdate':_0xc778('0x4'),'afterDestroy':_0xc778('0x5')};function emitEvent(_0x405cda){return function(_0x5be380,_0x2b759f,_0x552344){MailAccountEvents['emit'](_0x405cda+':'+_0x5be380['id'],_0x5be380);MailAccountEvents[_0xc778('0x6')](_0x405cda,_0x5be380);_0x552344(null);};}for(var e in events){if(events[_0xc778('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0xc778('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 2a2bc18..ae576f0 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 _0x1ff7=['../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','api','moment','request-promise','path','rimraf'];(function(_0x2466d9,_0x2ca48e){var _0x2fd587=function(_0x5bbb76){while(--_0x5bbb76){_0x2466d9['push'](_0x2466d9['shift']());}};_0x2fd587(++_0x2ca48e);}(_0x1ff7,0x17c));var _0x71ff=function(_0x3caa7d,_0x3baae9){_0x3caa7d=_0x3caa7d-0x0;var _0x319f6b=_0x1ff7[_0x3caa7d];return _0x319f6b;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x71ff('0x0'));var moment=require(_0x71ff('0x1'));var BPromise=require('bluebird');var rp=require(_0x71ff('0x2'));var fs=require('fs');var path=require(_0x71ff('0x3'));var rimraf=require(_0x71ff('0x4'));var config=require(_0x71ff('0x5'));var attributes=require(_0x71ff('0x6'));module[_0x71ff('0x7')]=function(_0x1f9098,_0x21ea6){return _0x1f9098[_0x71ff('0x8')](_0x71ff('0x9'),attributes,{'tableName':_0x71ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4740=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailAccount.attributes','define','mail_accounts','lodash'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4740,0x83));var _0x0474=function(_0x546956,_0x1910c2){_0x546956=_0x546956-0x0;var _0x19614e=_0x4740[_0x546956];return _0x19614e;};'use strict';var _=require(_0x0474('0x0'));var util=require('util');var logger=require(_0x0474('0x1'))(_0x0474('0x2'));var moment=require(_0x0474('0x3'));var BPromise=require(_0x0474('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0474('0x5'));var rimraf=require(_0x0474('0x6'));var config=require(_0x0474('0x7'));var attributes=require(_0x0474('0x8'));module['exports']=function(_0x462103,_0x4f3471){return _0x462103[_0x0474('0x9')]('MailAccount',attributes,{'tableName':_0x0474('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 55112ee..d5900b2 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 _0x1da6=['originTo','originCc','bcc','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowMailAccount','MailAccount','find','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','MailServerOut','Smtp','get','omit','Applications','list','orderBy','applications','priority','asc','length','close','autoclose','create','List\x20not\x20found','contact','messageId','generate','subject','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','Contact\x20not\x20found','spread','update','attach','format','interaction','created','attachments'];(function(_0x46d219,_0x43339c){var _0x5a5eba=function(_0x48e034){while(--_0x48e034){_0x46d219['push'](_0x46d219['shift']());}};_0x5a5eba(++_0x43339c);}(_0x1da6,0x7c));var _0x61da=function(_0x54a229,_0x479dd1){_0x54a229=_0x54a229-0x0;var _0x36232e=_0x1da6[_0x54a229];return _0x36232e;};'use strict';var _=require(_0x61da('0x0'));var util=require(_0x61da('0x1'));var moment=require(_0x61da('0x2'));var BPromise=require(_0x61da('0x3'));var rs=require(_0x61da('0x4'));var fs=require('fs');var Redis=require(_0x61da('0x5'));var db=require(_0x61da('0x6'))['db'];var utils=require(_0x61da('0x7'));var logger=require(_0x61da('0x8'))(_0x61da('0x9'));var config=require(_0x61da('0xa'));var jayson=require(_0x61da('0xb'));var client=jayson[_0x61da('0xc')][_0x61da('0xd')]({'port':0x232c});config[_0x61da('0xe')]=_[_0x61da('0xf')](config[_0x61da('0xe')],{'host':_0x61da('0x10'),'port':0x18eb});var socket=require(_0x61da('0x11'))(new Redis(config[_0x61da('0xe')]));require('./mailAccount.socket')[_0x61da('0x12')](socket);function respondWithRpcPromise(_0x284ed6,_0x438239,_0x25bd3d){return new BPromise(function(_0x4b715f,_0x5dc795){return client[_0x61da('0x13')](_0x284ed6,_0x25bd3d)[_0x61da('0x14')](function(_0x2f6257){logger[_0x61da('0x15')](_0x61da('0x16'),_0x438239,_0x61da('0x17'));logger[_0x61da('0x18')](_0x61da('0x19'),_0x438239,_0x61da('0x17'),JSON['stringify'](_0x2f6257));if(_0x2f6257[_0x61da('0x1a')]){if(_0x2f6257[_0x61da('0x1a')][_0x61da('0x1b')]===0x1f4){logger[_0x61da('0x1a')]('MailAccount,\x20%s,\x20%s',_0x438239,_0x2f6257[_0x61da('0x1a')]['message']);return _0x5dc795(_0x2f6257[_0x61da('0x1a')][_0x61da('0x1c')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x438239,_0x2f6257[_0x61da('0x1a')][_0x61da('0x1c')]);return _0x4b715f(_0x2f6257[_0x61da('0x1a')][_0x61da('0x1c')]);}else{logger[_0x61da('0x15')](_0x61da('0x16'),_0x438239,'request\x20sent');_0x4b715f(_0x2f6257[_0x61da('0x1d')][_0x61da('0x1c')]);}})[_0x61da('0x1e')](function(_0x20e2c4){logger['error'](_0x61da('0x16'),_0x438239,_0x20e2c4);_0x5dc795(_0x20e2c4);});});}exports[_0x61da('0x1f')]=function(_0x789727){var _0x16d17e=this;return new Promise(function(_0x48e19e,_0x22b8bc){return db['MailAccount'][_0x61da('0x20')]({'raw':_0x789727[_0x61da('0x21')]?_0x789727[_0x61da('0x21')][_0x61da('0x22')]===undefined?!![]:![]:!![],'where':_0x789727[_0x61da('0x21')]?_0x789727[_0x61da('0x21')][_0x61da('0x23')]||null:null,'attributes':_0x789727[_0x61da('0x21')]?_0x789727[_0x61da('0x21')][_0x61da('0x24')]||null:null,'limit':_0x789727['options']?_0x789727[_0x61da('0x21')][_0x61da('0x25')]||null:null,'include':_0x789727[_0x61da('0x21')]?_0x789727[_0x61da('0x21')][_0x61da('0x26')]?_[_0x61da('0x27')](_0x789727['options'][_0x61da('0x26')],function(_0xe37079){return{'model':db[_0xe37079[_0x61da('0x28')]],'as':_0xe37079['as'],'attributes':_0xe37079[_0x61da('0x24')],'include':_0xe37079[_0x61da('0x26')]?_[_0x61da('0x27')](_0xe37079[_0x61da('0x26')],function(_0x29b642){return{'model':db[_0x29b642['model']],'as':_0x29b642['as'],'attributes':_0x29b642[_0x61da('0x24')],'include':_0x29b642[_0x61da('0x26')]?_[_0x61da('0x27')](_0x29b642[_0x61da('0x26')],function(_0x52f486){return{'model':db[_0x52f486[_0x61da('0x28')]],'as':_0x52f486['as'],'attributes':_0x52f486['attributes']};}):[]};}):[]};}):[]:[]})[_0x61da('0x14')](function(_0x2cc862){logger[_0x61da('0x15')](_0x61da('0x1f'),_0x789727);logger[_0x61da('0x18')](_0x61da('0x1f'),_0x789727,JSON[_0x61da('0x29')](_0x2cc862));_0x48e19e(_0x2cc862);})['catch'](function(_0x46b77b){logger['error']('GetMailAccount',_0x46b77b[_0x61da('0x1c')],_0x789727);_0x22b8bc(_0x16d17e[_0x61da('0x1a')](0x1f4,_0x46b77b[_0x61da('0x1c')]));});});};exports[_0x61da('0x2a')]=function(_0x14069a){var _0x48391a=this;return new Promise(function(_0x3d5098,_0x1c0ab4){return db[_0x61da('0x2b')][_0x61da('0x2c')]({'raw':_0x14069a['options']?_0x14069a[_0x61da('0x21')][_0x61da('0x22')]===undefined?!![]:![]:!![],'where':_0x14069a['options']?_0x14069a[_0x61da('0x21')]['where']||null:null,'attributes':_0x14069a['options']?_0x14069a['options']['attributes']||null:null,'include':_0x14069a['options']?_0x14069a[_0x61da('0x21')][_0x61da('0x26')]?_[_0x61da('0x27')](_0x14069a[_0x61da('0x21')][_0x61da('0x26')],function(_0x500378){return{'model':db[_0x500378[_0x61da('0x28')]],'as':_0x500378['as'],'attributes':_0x500378[_0x61da('0x24')],'include':_0x500378[_0x61da('0x26')]?_['map'](_0x500378[_0x61da('0x26')],function(_0x23b148){return{'model':db[_0x23b148[_0x61da('0x28')]],'as':_0x23b148['as'],'attributes':_0x23b148['attributes'],'include':_0x23b148[_0x61da('0x26')]?_[_0x61da('0x27')](_0x23b148[_0x61da('0x26')],function(_0x76383c){return{'model':db[_0x76383c[_0x61da('0x28')]],'as':_0x76383c['as'],'attributes':_0x76383c['attributes']};}):[]};}):[]};}):[]:[]})[_0x61da('0x14')](function(_0x2bbce9){logger[_0x61da('0x15')](_0x61da('0x2a'),_0x14069a);logger[_0x61da('0x18')]('ShowMailAccount',_0x14069a,JSON['stringify'](_0x2bbce9));_0x3d5098(_0x2bbce9);})['catch'](function(_0x2deb98){logger[_0x61da('0x1a')](_0x61da('0x2a'),_0x2deb98[_0x61da('0x1c')],_0x14069a);_0x1c0ab4(_0x48391a[_0x61da('0x1a')](0x1f4,_0x2deb98[_0x61da('0x1c')]));});});};exports[_0x61da('0x2d')]=function(_0x522aeb){var _0x13fa27=this;return new Promise(function(_0x669497,_0x5d4d5e){var _0xf24ef6={'body':_0x522aeb[_0x61da('0x2e')],'channel':_0x61da('0x2f')};var _0x5aa141=_[_0x61da('0x30')](_['keys'](db[_0x61da('0x31')][_0x61da('0x32')]),[_0x61da('0x33'),_0x61da('0x34'),'CompanyId',_0x61da('0x35')]);var _0x27c23a=![];if(_0x522aeb[_0x61da('0x2e')]['id']){delete _0x522aeb[_0x61da('0x2e')]['id'];}if(_[_0x61da('0x36')](_0x522aeb[_0x61da('0x2e')][_0x61da('0x37')])){return _0x5d4d5e(_0x13fa27[_0x61da('0x1a')](0x1f4,_0x61da('0x38')));}if(_[_0x61da('0x36')](_0x522aeb['body'][_0x61da('0x2e')])||_0x522aeb[_0x61da('0x2e')][_0x61da('0x2e')]===''){return _0x5d4d5e(_0x13fa27[_0x61da('0x1a')](0x1f4,_0x61da('0x39')));}if(_[_0x61da('0x36')](_0x522aeb[_0x61da('0x2e')][_0x61da('0x3a')])){return _0x5d4d5e(_0x13fa27['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5aa141));}if(!_[_0x61da('0x3b')](_0x5aa141,_0x522aeb[_0x61da('0x2e')][_0x61da('0x3a')])){return _0x5d4d5e(_0x13fa27[_0x61da('0x1a')](0x1f4,_0x61da('0x3c')+_0x5aa141));}var _0x4c594e={};_0x4c594e[_0x522aeb[_0x61da('0x2e')][_0x61da('0x3a')]]=_0x522aeb[_0x61da('0x2e')][_0x61da('0x37')];return db[_0x61da('0x2b')][_0x61da('0x2c')]({'where':{'id':_0x522aeb[_0x61da('0x3d')]['id']},'include':[{'model':db[_0x61da('0x3e')],'as':_0x61da('0x3f'),'include':[{'model':db['CmContact'],'as':_0x61da('0x40'),'where':_0x4c594e,'limit':0x1,'order':[[_0x61da('0x34'),_0x61da('0x41')]]}]},{'model':db[_0x61da('0x42')],'as':'Applications'},{'model':db[_0x61da('0x43')],'as':_0x61da('0x44')}]})[_0x61da('0x14')](function(_0x257e34){if(_0x257e34&&_0x257e34[_0x61da('0x3f')]){var _0x549ccd=_0x257e34[_0x61da('0x45')]({'plain':!![]});_0xf24ef6[_0x61da('0x3d')]=_[_0x61da('0x46')](_0x549ccd,[_0x61da('0x47'),_0x61da('0x3f')]);_0xf24ef6['applications']=_0x549ccd[_0x61da('0x47')];_0xf24ef6[_0x61da('0x48')]=_0x549ccd[_0x61da('0x3f')];_0xf24ef6['applications']=_[_0x61da('0x49')](_0xf24ef6[_0x61da('0x4a')],[_0x61da('0x4b')],[_0x61da('0x4c')]);if(_0xf24ef6['account']&&_0xf24ef6[_0x61da('0x3d')]['autoclose']){_0xf24ef6[_0x61da('0x4a')]['push']({'id':0x0,'priority':_0xf24ef6[_0x61da('0x4a')][_0x61da('0x4d')]+0x1,'app':_0x61da('0x4e'),'appdata':_0x61da('0x4f'),'interval':'*,*,*,*'});}if(_0xf24ef6[_0x61da('0x3d')][_0x61da('0x47')]){delete _0xf24ef6[_0x61da('0x3d')][_0x61da('0x47')];}if(_0xf24ef6[_0x61da('0x3d')][_0x61da('0x3f')]){delete _0xf24ef6[_0x61da('0x3d')]['List'];}if(_0x549ccd['List']['Contacts'][_0x61da('0x4d')]){return _0x549ccd[_0x61da('0x3f')][_0x61da('0x40')][0x0];}var _0x531562=_[_0x61da('0xf')](_0x522aeb[_0x61da('0x2e')],{'firstName':_0x522aeb[_0x61da('0x2e')][_0x61da('0x37')],'ListId':_0x549ccd[_0x61da('0x35')]});_0x531562[_0x522aeb[_0x61da('0x2e')][_0x61da('0x3a')]]=_0x522aeb['body']['from'];return db[_0x61da('0x31')][_0x61da('0x50')](_0x531562);}else{throw new Error(_0x61da('0x51'));}})[_0x61da('0x14')](function(_0x1246a6){_0xf24ef6[_0x61da('0x52')]=_0x1246a6;if(_0x1246a6){if(!_0x522aeb[_0x61da('0x2e')][_0x61da('0x1c')][_0x61da('0x53')]){_0x522aeb[_0x61da('0x2e')][_0x61da('0x1c')]['messageId']=rs[_0x61da('0x54')]()+'\x20'+_0x522aeb[_0x61da('0x2e')]['message'][_0x61da('0x37')];}var _0xe6c118={'ContactId':_0x1246a6['id'],'MailAccountId':_0x522aeb[_0x61da('0x3d')]['id'],'inReplyTo':_0x522aeb['body'][_0x61da('0x1c')][_0x61da('0x53')],'to':_0x522aeb['body'][_0x61da('0x1c')][_0x61da('0x37')],'cc':_0x522aeb[_0x61da('0x2e')][_0x61da('0x1c')]['cc'],'subject':_0x522aeb[_0x61da('0x2e')][_0x61da('0x1c')][_0x61da('0x55')],'attach':_0x522aeb[_0x61da('0x2e')][_0x61da('0x1c')]['attach'],'lastMsgAt':moment()['format'](_0x61da('0x56')),'lastMsgDirection':'in','lastMsgBody':_0x522aeb['body'][_0x61da('0x2e')]};return db[_0x61da('0x57')][_0x61da('0x2c')]({'where':{'closed':![],'MailAccountId':_0x522aeb['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x61da('0x58'),'attributes':[_0x61da('0x53')],'where':{'messageId':_0x522aeb['body'][_0x61da('0x1c')][_0x61da('0x59')]}}]})[_0x61da('0x14')](function(_0x3226a3){if(_0x3226a3){return[_0x3226a3,![]];}return db[_0x61da('0x57')][_0x61da('0x50')](_0xe6c118)[_0x61da('0x14')](function(_0x11370f){return[_0x11370f,!![]];});});}else{throw new Error(_0x61da('0x5a'));}})[_0x61da('0x5b')](function(_0x2006bc,_0x55511a){if(_0x2006bc){_0x27c23a=_0x55511a;if(!_0x55511a){return _0x2006bc[_0x61da('0x5c')]({'inReplyTo':_0x522aeb['body'][_0x61da('0x1c')][_0x61da('0x53')],'to':_0x522aeb[_0x61da('0x2e')][_0x61da('0x1c')][_0x61da('0x37')],'cc':_0x522aeb[_0x61da('0x2e')][_0x61da('0x1c')]['cc'],'subject':_0x522aeb[_0x61da('0x2e')][_0x61da('0x1c')][_0x61da('0x55')],'attach':_0x2006bc[_0x61da('0x5d')]?_0x2006bc[_0x61da('0x5d')]:_0x522aeb[_0x61da('0x2e')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0x61da('0x5e')](_0x61da('0x56')),'lastMsgAt':moment()[_0x61da('0x5e')](_0x61da('0x56')),'lastMsgDirection':'in','lastMsgBody':_0x522aeb[_0x61da('0x2e')][_0x61da('0x2e')]});}else{return _0x2006bc;}}})['then'](function(_0x5d48e4){_0xf24ef6[_0x61da('0x5f')]=_0x5d48e4[_0x61da('0x45')]({'plain':!![]});_0xf24ef6[_0x61da('0x5f')][_0x61da('0x60')]=_0x27c23a;return db['MailMessage'][_0x61da('0x50')]({'body':_0x522aeb['body'][_0x61da('0x2e')],'MailAccountId':_0x522aeb['account']['id'],'MailInteractionId':_0x5d48e4['id'],'direction':'in','ContactId':_0xf24ef6['contact']['id'],'messageId':_0x522aeb[_0x61da('0x2e')]['message'][_0x61da('0x53')],'from':_0x522aeb['body'][_0x61da('0x1c')]['from'],'to':_0x522aeb['body']['message']['to'],'cc':_0x522aeb[_0x61da('0x2e')][_0x61da('0x1c')]['cc'],'subject':_0x522aeb['body'][_0x61da('0x1c')][_0x61da('0x55')],'attach':_0x522aeb[_0x61da('0x2e')][_0x61da('0x1c')]['attach'],'Attachments':_0x522aeb[_0x61da('0x2e')][_0x61da('0x1c')][_0x61da('0x61')],'originTo':_0x522aeb['body'][_0x61da('0x1c')][_0x61da('0x62')],'originCc':_0x522aeb['body'][_0x61da('0x1c')][_0x61da('0x63')],'bcc':_0x522aeb['body'][_0x61da('0x1c')][_0x61da('0x64')]},{'include':[{'model':db['Attachment'],'as':_0x61da('0x65')}]});})[_0x61da('0x14')](function(_0x230790){_0xf24ef6[_0x61da('0x1c')]=_0x230790;if(_0xf24ef6['interaction'][_0x61da('0x66')]){return db[_0x61da('0x67')]['find']({'attributes':['id',_0x61da('0x68')],'where':{'id':_0xf24ef6[_0x61da('0x5f')][_0x61da('0x66')]}})['then'](function(_0x214c83){if(_0x214c83){_0xf24ef6['applications'][_0x61da('0x69')]({'id':0x0,'priority':0x0,'app':_0x61da('0x6a'),'appdata':_0x214c83[_0x61da('0x68')]+','+(_0xf24ef6['account'][_0x61da('0x6b')]||0xa),'interval':_0x61da('0x6c')});}return respondWithRpcPromise(_0x61da('0x6d'),_0x61da('0x6e'),_0xf24ef6);});}return respondWithRpcPromise(_0x61da('0x6d'),'startRouting',_0xf24ef6);})[_0x61da('0x14')](function(_0x49e77c){_0x669497(_0x49e77c);})['catch'](function(_0x1cbff0){_0x5d4d5e(_0x13fa27[_0x61da('0x1a')](0x1f4,_0x1cbff0[_0x61da('0x1c')]));});});}; \ No newline at end of file +var _0xee4f=['message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','model','include','map','stringify','ShowMailAccount','then','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','List','Contacts','DESC','MailApplication','Applications','Smtp','get','applications','list','orderBy','priority','push','length','autoclose','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','find','MailMessage','Messages','inReplyTo','MailInteraction','spread','update','format','interaction','attachments','originTo','originCc','bcc','Attachment','Attachments','User','name','UserId','unshift','*,*,*,*','startRouting','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','client','defaults','redis','localhost','./mailAccount.socket','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error'];(function(_0x57645b,_0x25f73a){var _0xe82f00=function(_0x526b4){while(--_0x526b4){_0x57645b['push'](_0x57645b['shift']());}};_0xe82f00(++_0x25f73a);}(_0xee4f,0xad));var _0xfee4=function(_0x5855d0,_0x5289cd){_0x5855d0=_0x5855d0-0x0;var _0x41b252=_0xee4f[_0x5855d0];return _0x41b252;};'use strict';var _=require(_0xfee4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfee4('0x1'));var rs=require(_0xfee4('0x2'));var fs=require('fs');var Redis=require(_0xfee4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfee4('0x4'));var logger=require('../../config/logger')(_0xfee4('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfee4('0x6')]['http']({'port':0x232c});config['redis']=_[_0xfee4('0x7')](config[_0xfee4('0x8')],{'host':_0xfee4('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xfee4('0xa'))[_0xfee4('0xb')](socket);function respondWithRpcPromise(_0xa77876,_0x4dc812,_0x53f260){return new BPromise(function(_0x2ca5f9,_0x1d6855){return client[_0xfee4('0xc')](_0xa77876,_0x53f260)['then'](function(_0x2ef3c3){logger[_0xfee4('0xd')](_0xfee4('0xe'),_0x4dc812,_0xfee4('0xf'));logger[_0xfee4('0x10')](_0xfee4('0x11'),_0x4dc812,_0xfee4('0xf'),JSON['stringify'](_0x2ef3c3));if(_0x2ef3c3[_0xfee4('0x12')]){if(_0x2ef3c3[_0xfee4('0x12')]['code']===0x1f4){logger[_0xfee4('0x12')](_0xfee4('0xe'),_0x4dc812,_0x2ef3c3[_0xfee4('0x12')][_0xfee4('0x13')]);return _0x1d6855(_0x2ef3c3[_0xfee4('0x12')][_0xfee4('0x13')]);}logger[_0xfee4('0x12')]('MailAccount,\x20%s,\x20%s',_0x4dc812,_0x2ef3c3[_0xfee4('0x12')][_0xfee4('0x13')]);return _0x2ca5f9(_0x2ef3c3[_0xfee4('0x12')]['message']);}else{logger[_0xfee4('0xd')]('MailAccount,\x20%s,\x20%s',_0x4dc812,'request\x20sent');_0x2ca5f9(_0x2ef3c3[_0xfee4('0x14')][_0xfee4('0x13')]);}})[_0xfee4('0x15')](function(_0x44a1ec){logger[_0xfee4('0x12')](_0xfee4('0xe'),_0x4dc812,_0x44a1ec);_0x1d6855(_0x44a1ec);});});}exports[_0xfee4('0x16')]=function(_0x22766){var _0x153649=this;return new Promise(function(_0x5826da,_0x194cd8){return db[_0xfee4('0x17')][_0xfee4('0x18')]({'raw':_0x22766[_0xfee4('0x19')]?_0x22766[_0xfee4('0x19')][_0xfee4('0x1a')]===undefined?!![]:![]:!![],'where':_0x22766['options']?_0x22766[_0xfee4('0x19')][_0xfee4('0x1b')]||null:null,'attributes':_0x22766[_0xfee4('0x19')]?_0x22766[_0xfee4('0x19')][_0xfee4('0x1c')]||null:null,'limit':_0x22766[_0xfee4('0x19')]?_0x22766[_0xfee4('0x19')][_0xfee4('0x1d')]||null:null,'include':_0x22766[_0xfee4('0x19')]?_0x22766[_0xfee4('0x19')]['include']?_['map'](_0x22766['options']['include'],function(_0x5176a1){return{'model':db[_0x5176a1[_0xfee4('0x1e')]],'as':_0x5176a1['as'],'attributes':_0x5176a1[_0xfee4('0x1c')],'include':_0x5176a1[_0xfee4('0x1f')]?_[_0xfee4('0x20')](_0x5176a1[_0xfee4('0x1f')],function(_0x1eb0b9){return{'model':db[_0x1eb0b9[_0xfee4('0x1e')]],'as':_0x1eb0b9['as'],'attributes':_0x1eb0b9[_0xfee4('0x1c')],'include':_0x1eb0b9['include']?_[_0xfee4('0x20')](_0x1eb0b9['include'],function(_0x4c4c1e){return{'model':db[_0x4c4c1e[_0xfee4('0x1e')]],'as':_0x4c4c1e['as'],'attributes':_0x4c4c1e[_0xfee4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x49f138){logger[_0xfee4('0xd')]('GetMailAccount',_0x22766);logger['debug'](_0xfee4('0x16'),_0x22766,JSON[_0xfee4('0x21')](_0x49f138));_0x5826da(_0x49f138);})['catch'](function(_0x3b12ae){logger['error'](_0xfee4('0x16'),_0x3b12ae[_0xfee4('0x13')],_0x22766);_0x194cd8(_0x153649[_0xfee4('0x12')](0x1f4,_0x3b12ae['message']));});});};exports[_0xfee4('0x22')]=function(_0x1701e1){var _0x2d2312=this;return new Promise(function(_0x347f73,_0x5a2cbe){return db[_0xfee4('0x17')]['find']({'raw':_0x1701e1[_0xfee4('0x19')]?_0x1701e1[_0xfee4('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1701e1[_0xfee4('0x19')]?_0x1701e1[_0xfee4('0x19')]['where']||null:null,'attributes':_0x1701e1[_0xfee4('0x19')]?_0x1701e1['options'][_0xfee4('0x1c')]||null:null,'include':_0x1701e1[_0xfee4('0x19')]?_0x1701e1[_0xfee4('0x19')][_0xfee4('0x1f')]?_[_0xfee4('0x20')](_0x1701e1[_0xfee4('0x19')]['include'],function(_0x384581){return{'model':db[_0x384581['model']],'as':_0x384581['as'],'attributes':_0x384581[_0xfee4('0x1c')],'include':_0x384581['include']?_[_0xfee4('0x20')](_0x384581[_0xfee4('0x1f')],function(_0x3ffe29){return{'model':db[_0x3ffe29[_0xfee4('0x1e')]],'as':_0x3ffe29['as'],'attributes':_0x3ffe29[_0xfee4('0x1c')],'include':_0x3ffe29[_0xfee4('0x1f')]?_['map'](_0x3ffe29[_0xfee4('0x1f')],function(_0x1212e5){return{'model':db[_0x1212e5[_0xfee4('0x1e')]],'as':_0x1212e5['as'],'attributes':_0x1212e5[_0xfee4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfee4('0x23')](function(_0x1cf89d){logger[_0xfee4('0xd')]('ShowMailAccount',_0x1701e1);logger[_0xfee4('0x10')](_0xfee4('0x22'),_0x1701e1,JSON[_0xfee4('0x21')](_0x1cf89d));_0x347f73(_0x1cf89d);})['catch'](function(_0x485109){logger[_0xfee4('0x12')](_0xfee4('0x22'),_0x485109[_0xfee4('0x13')],_0x1701e1);_0x5a2cbe(_0x2d2312['error'](0x1f4,_0x485109['message']));});});};exports['NotifyMailAccount']=function(_0x19d416){var _0x1609a1=this;return new Promise(function(_0xcbede8,_0x3baadc){var _0x53809c={'body':_0x19d416['body'],'channel':_0xfee4('0x24')};var _0x24d515=_[_0xfee4('0x25')](_[_0xfee4('0x26')](db[_0xfee4('0x27')][_0xfee4('0x28')]),[_0xfee4('0x29'),_0xfee4('0x2a'),_0xfee4('0x2b'),_0xfee4('0x2c')]);var _0x49c343=![];if(_0x19d416[_0xfee4('0x2d')]['id']){delete _0x19d416[_0xfee4('0x2d')]['id'];}if(_[_0xfee4('0x2e')](_0x19d416[_0xfee4('0x2d')][_0xfee4('0x2f')])){return _0x3baadc(_0x1609a1[_0xfee4('0x12')](0x1f4,_0xfee4('0x30')));}if(_[_0xfee4('0x2e')](_0x19d416[_0xfee4('0x2d')][_0xfee4('0x2d')])||_0x19d416[_0xfee4('0x2d')][_0xfee4('0x2d')]===''){return _0x3baadc(_0x1609a1[_0xfee4('0x12')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xfee4('0x2e')](_0x19d416[_0xfee4('0x2d')][_0xfee4('0x31')])){return _0x3baadc(_0x1609a1[_0xfee4('0x12')](0x1f4,_0xfee4('0x32')+_0x24d515));}if(!_[_0xfee4('0x33')](_0x24d515,_0x19d416[_0xfee4('0x2d')][_0xfee4('0x31')])){return _0x3baadc(_0x1609a1[_0xfee4('0x12')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x24d515));}var _0x29af02={};_0x29af02[_0x19d416[_0xfee4('0x2d')]['mapKey']]=_0x19d416[_0xfee4('0x2d')][_0xfee4('0x2f')];return db['MailAccount']['find']({'where':{'id':_0x19d416[_0xfee4('0x34')]['id']},'include':[{'model':db['CmList'],'as':_0xfee4('0x35'),'include':[{'model':db[_0xfee4('0x27')],'as':_0xfee4('0x36'),'where':_0x29af02,'limit':0x1,'order':[[_0xfee4('0x2a'),_0xfee4('0x37')]]}]},{'model':db[_0xfee4('0x38')],'as':_0xfee4('0x39')},{'model':db['MailServerOut'],'as':_0xfee4('0x3a')}]})['then'](function(_0x4d018b){if(_0x4d018b&&_0x4d018b['List']){var _0x40cf21=_0x4d018b[_0xfee4('0x3b')]({'plain':!![]});_0x53809c[_0xfee4('0x34')]=_['omit'](_0x40cf21,[_0xfee4('0x39'),_0xfee4('0x35')]);_0x53809c[_0xfee4('0x3c')]=_0x40cf21['Applications'];_0x53809c[_0xfee4('0x3d')]=_0x40cf21['List'];_0x53809c[_0xfee4('0x3c')]=_[_0xfee4('0x3e')](_0x53809c[_0xfee4('0x3c')],[_0xfee4('0x3f')],['asc']);if(_0x53809c[_0xfee4('0x34')]&&_0x53809c[_0xfee4('0x34')]['autoclose']){_0x53809c[_0xfee4('0x3c')][_0xfee4('0x40')]({'id':0x0,'priority':_0x53809c['applications'][_0xfee4('0x41')]+0x1,'app':'close','appdata':_0xfee4('0x42'),'interval':'*,*,*,*'});}if(_0x53809c[_0xfee4('0x34')][_0xfee4('0x39')]){delete _0x53809c['account'][_0xfee4('0x39')];}if(_0x53809c[_0xfee4('0x34')][_0xfee4('0x35')]){delete _0x53809c['account'][_0xfee4('0x35')];}if(_0x40cf21['List'][_0xfee4('0x36')][_0xfee4('0x41')]){return _0x40cf21[_0xfee4('0x35')]['Contacts'][0x0];}var _0x3b0c75=_[_0xfee4('0x7')](_0x19d416[_0xfee4('0x2d')],{'firstName':_0x19d416['body'][_0xfee4('0x2f')],'ListId':_0x40cf21[_0xfee4('0x2c')]});_0x3b0c75[_0x19d416[_0xfee4('0x2d')]['mapKey']]=_0x19d416['body'][_0xfee4('0x2f')];return db[_0xfee4('0x27')][_0xfee4('0x43')](_0x3b0c75);}else{throw new Error(_0xfee4('0x44'));}})['then'](function(_0xd6c79c){_0x53809c[_0xfee4('0x45')]=_0xd6c79c;if(_0xd6c79c){if(!_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')]['messageId']){_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')][_0xfee4('0x46')]=rs[_0xfee4('0x47')]()+'\x20'+_0x19d416['body'][_0xfee4('0x13')][_0xfee4('0x2f')];}var _0xe7b3a1={'ContactId':_0xd6c79c['id'],'MailAccountId':_0x19d416[_0xfee4('0x34')]['id'],'inReplyTo':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')][_0xfee4('0x46')],'to':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')]['from'],'cc':_0x19d416[_0xfee4('0x2d')]['message']['cc'],'subject':_0x19d416['body'][_0xfee4('0x13')][_0xfee4('0x48')],'attach':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')][_0xfee4('0x49')],'lastMsgAt':moment()['format'](_0xfee4('0x4a')),'lastMsgDirection':'in','lastMsgBody':_0x19d416['body'][_0xfee4('0x2d')]};return db['MailInteraction'][_0xfee4('0x4b')]({'where':{'closed':![],'MailAccountId':_0x19d416[_0xfee4('0x34')]['id']},'include':[{'model':db[_0xfee4('0x4c')],'as':_0xfee4('0x4d'),'attributes':[_0xfee4('0x46')],'where':{'messageId':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')][_0xfee4('0x4e')]}}]})[_0xfee4('0x23')](function(_0x46e29e){if(_0x46e29e){return[_0x46e29e,![]];}return db[_0xfee4('0x4f')][_0xfee4('0x43')](_0xe7b3a1)['then'](function(_0x2e5a3c){return[_0x2e5a3c,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xfee4('0x50')](function(_0x4f9120,_0x2b4226){if(_0x4f9120){_0x49c343=_0x2b4226;if(!_0x2b4226){return _0x4f9120[_0xfee4('0x51')]({'inReplyTo':_0x19d416['body'][_0xfee4('0x13')][_0xfee4('0x46')],'to':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')][_0xfee4('0x2f')],'cc':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')]['cc'],'subject':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')]['subject'],'attach':_0x4f9120['attach']?_0x4f9120[_0xfee4('0x49')]:_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')]['attach'],'substatus':null,'substatusAt':moment()[_0xfee4('0x52')](_0xfee4('0x4a')),'lastMsgAt':moment()[_0xfee4('0x52')](_0xfee4('0x4a')),'lastMsgDirection':'in','lastMsgBody':_0x19d416[_0xfee4('0x2d')]['body']});}else{return _0x4f9120;}}})[_0xfee4('0x23')](function(_0x49b8c7){_0x53809c['interaction']=_0x49b8c7['get']({'plain':!![]});_0x53809c[_0xfee4('0x53')]['created']=_0x49c343;return db[_0xfee4('0x4c')][_0xfee4('0x43')]({'body':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x2d')],'MailAccountId':_0x19d416[_0xfee4('0x34')]['id'],'MailInteractionId':_0x49b8c7['id'],'direction':'in','ContactId':_0x53809c[_0xfee4('0x45')]['id'],'messageId':_0x19d416[_0xfee4('0x2d')]['message'][_0xfee4('0x46')],'from':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')][_0xfee4('0x2f')],'to':_0x19d416['body'][_0xfee4('0x13')]['to'],'cc':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')]['cc'],'subject':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')][_0xfee4('0x48')],'attach':_0x19d416['body'][_0xfee4('0x13')][_0xfee4('0x49')],'Attachments':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')][_0xfee4('0x54')],'originTo':_0x19d416['body'][_0xfee4('0x13')][_0xfee4('0x55')],'originCc':_0x19d416[_0xfee4('0x2d')][_0xfee4('0x13')][_0xfee4('0x56')],'bcc':_0x19d416['body'][_0xfee4('0x13')][_0xfee4('0x57')]},{'include':[{'model':db[_0xfee4('0x58')],'as':_0xfee4('0x59')}]});})['then'](function(_0x581168){_0x53809c['message']=_0x581168;if(_0x53809c[_0xfee4('0x53')]['UserId']){return db[_0xfee4('0x5a')][_0xfee4('0x4b')]({'attributes':['id',_0xfee4('0x5b')],'where':{'id':_0x53809c['interaction'][_0xfee4('0x5c')]}})[_0xfee4('0x23')](function(_0x161178){if(_0x161178){_0x53809c[_0xfee4('0x3c')][_0xfee4('0x5d')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x161178['name']+','+(_0x53809c['account']['waitForTheAssignedAgent']||0xa),'interval':_0xfee4('0x5e')});}return respondWithRpcPromise('Start',_0xfee4('0x5f'),_0x53809c);});}return respondWithRpcPromise('Start','startRouting',_0x53809c);})[_0xfee4('0x23')](function(_0x20d8ae){_0xcbede8(_0x20d8ae);})[_0xfee4('0x15')](function(_0x1f4cdf){_0x3baadc(_0x1609a1[_0xfee4('0x12')](0x1f4,_0x1f4cdf[_0xfee4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 07e207f..86fe6a4 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 _0x078c=['register','length','./mailAccount.events','remove','update','emit','removeListener'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x078c,0x19f));var _0xc078=function(_0x98db33,_0x397f20){_0x98db33=_0x98db33-0x0;var _0x5ae63a=_0x078c[_0x98db33];return _0x5ae63a;};'use strict';var MailAccountEvents=require(_0xc078('0x0'));var events=['save',_0xc078('0x1'),_0xc078('0x2')];function createListener(_0x503bd4,_0x82572){return function(_0x107624){_0x82572[_0xc078('0x3')](_0x503bd4,_0x107624);};}function removeListener(_0x217004,_0x56bf2e){return function(){MailAccountEvents[_0xc078('0x4')](_0x217004,_0x56bf2e);};}exports[_0xc078('0x5')]=function(_0x394068){for(var _0x24b241=0x0,_0x40e428=events[_0xc078('0x6')];_0x24b241<_0x40e428;_0x24b241++){var _0x22661e=events[_0x24b241];var _0x4030b1=createListener('mailAccount:'+_0x22661e,_0x394068);MailAccountEvents['on'](_0x22661e,_0x4030b1);}}; \ No newline at end of file +var _0xa4bd=['removeListener','register','length','mailAccount:','./mailAccount.events','save','remove','emit'];(function(_0x207ad3,_0x58611d){var _0x41c3d8=function(_0x49502b){while(--_0x49502b){_0x207ad3['push'](_0x207ad3['shift']());}};_0x41c3d8(++_0x58611d);}(_0xa4bd,0x1e4));var _0xda4b=function(_0x575e9f,_0x3da592){_0x575e9f=_0x575e9f-0x0;var _0x1954f8=_0xa4bd[_0x575e9f];return _0x1954f8;};'use strict';var MailAccountEvents=require(_0xda4b('0x0'));var events=[_0xda4b('0x1'),_0xda4b('0x2'),'update'];function createListener(_0x3ee575,_0x1330a5){return function(_0x11c201){_0x1330a5[_0xda4b('0x3')](_0x3ee575,_0x11c201);};}function removeListener(_0x2b900e,_0xc42c1c){return function(){MailAccountEvents[_0xda4b('0x4')](_0x2b900e,_0xc42c1c);};}exports[_0xda4b('0x5')]=function(_0x3b9c97){for(var _0x3afa0b=0x0,_0x490a68=events[_0xda4b('0x6')];_0x3afa0b<_0x490a68;_0x3afa0b++){var _0x29f805=events[_0x3afa0b];var _0x212d98=createListener(_0xda4b('0x7')+_0x29f805,_0x3b9c97);MailAccountEvents['on'](_0x29f805,_0x212d98);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index bf7e266..f070c23 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 _0x16d2=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','update'];(function(_0x5598d6,_0xeb5fa2){var _0xbf1ceb=function(_0x276c03){while(--_0x276c03){_0x5598d6['push'](_0x5598d6['shift']());}};_0xbf1ceb(++_0xeb5fa2);}(_0x16d2,0x123));var _0x216d=function(_0x48604b,_0x518ed1){_0x48604b=_0x48604b-0x0;var _0x874edb=_0x16d2[_0x48604b];return _0x874edb;};'use strict';var multer=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var path=require(_0x216d('0x2'));var timeout=require(_0x216d('0x3'));var express=require(_0x216d('0x4'));var router=express[_0x216d('0x5')]();var auth=require(_0x216d('0x6'));var interaction=require(_0x216d('0x7'));var config=require(_0x216d('0x8'));var controller=require('./mailApplication.controller');router[_0x216d('0x9')](_0x216d('0xa'),auth[_0x216d('0xb')](),controller[_0x216d('0xc')]);router[_0x216d('0xd')](_0x216d('0xa'),auth[_0x216d('0xb')](),controller[_0x216d('0xe')]);router['delete'](_0x216d('0xa'),auth[_0x216d('0xb')](),controller[_0x216d('0xf')]);module[_0x216d('0x10')]=router; \ No newline at end of file +var _0x4522=['../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','path','connect-timeout','express','../../components/auth/service'];(function(_0x5c89bd,_0x71181){var _0x280ac6=function(_0x5a78e5){while(--_0x5a78e5){_0x5c89bd['push'](_0x5c89bd['shift']());}};_0x280ac6(++_0x71181);}(_0x4522,0x1a0));var _0x2452=function(_0x52067d,_0x25ba55){_0x52067d=_0x52067d-0x0;var _0x278376=_0x4522[_0x52067d];return _0x278376;};'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 auth=require(_0x2452('0x3'));var interaction=require(_0x2452('0x4'));var config=require(_0x2452('0x5'));var controller=require(_0x2452('0x6'));router[_0x2452('0x7')](_0x2452('0x8'),auth[_0x2452('0x9')](),controller[_0x2452('0xa')]);router[_0x2452('0xb')](_0x2452('0x8'),auth[_0x2452('0x9')](),controller[_0x2452('0xc')]);router[_0x2452('0xd')](_0x2452('0x8'),auth[_0x2452('0x9')](),controller[_0x2452('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 6876d3e..0522709 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 _0x4a18=['INTEGER','noop','STRING','*,*,*,*','exports'];(function(_0x340973,_0x2fe6a5){var _0x26fbb7=function(_0x386111){while(--_0x386111){_0x340973['push'](_0x340973['shift']());}};_0x26fbb7(++_0x2fe6a5);}(_0x4a18,0x1a3));var _0x84a1=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0x4a18[_0x4394b6];return _0x360244;};'use strict';var Sequelize=require('sequelize');module[_0x84a1('0x0')]={'priority':{'type':Sequelize[_0x84a1('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x84a1('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x84a1('0x3')]},'interval':{'type':Sequelize[_0x84a1('0x3')],'defaultValue':_0x84a1('0x4')}}; \ No newline at end of file +var _0xc686=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x599ed8,_0x1b69e9){var _0x116c5d=function(_0x31aea9){while(--_0x31aea9){_0x599ed8['push'](_0x599ed8['shift']());}};_0x116c5d(++_0x1b69e9);}(_0xc686,0x76));var _0x6c68=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xc686[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require(_0x6c68('0x0'));module[_0x6c68('0x1')]={'priority':{'type':Sequelize[_0x6c68('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6c68('0x3')],'allowNull':![],'defaultValue':_0x6c68('0x4')},'appdata':{'type':Sequelize[_0x6c68('0x5')]()},'description':{'type':Sequelize[_0x6c68('0x3')]},'interval':{'type':Sequelize[_0x6c68('0x3')],'defaultValue':_0x6c68('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 0e73330..520968b 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 _0x2401=['reject','save','then','destroy','sendStatus','stack','name','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','catch','update','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply'];(function(_0xb4e0c2,_0x22ede7){var _0x45cfd6=function(_0x367297){while(--_0x367297){_0xb4e0c2['push'](_0xb4e0c2['shift']());}};_0x45cfd6(++_0x22ede7);}(_0x2401,0x1af));var _0x1240=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2401[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x1240('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1240('0x1'));var zipdir=require(_0x1240('0x2'));var jsonpatch=require(_0x1240('0x3'));var rp=require(_0x1240('0x4'));var moment=require(_0x1240('0x5'));var BPromise=require(_0x1240('0x6'));var Mustache=require(_0x1240('0x7'));var util=require('util');var path=require(_0x1240('0x8'));var sox=require(_0x1240('0x9'));var csv=require(_0x1240('0xa'));var ejs=require(_0x1240('0xb'));var fs=require('fs');var _=require(_0x1240('0xc'));var squel=require(_0x1240('0xd'));var crypto=require(_0x1240('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1240('0xf'));var Redis=require(_0x1240('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1240('0x11'));var as=require(_0x1240('0x12'));var hardwareService=require(_0x1240('0x13'));var logger=require(_0x1240('0x14'))(_0x1240('0x15'));var utils=require(_0x1240('0x16'));var config=require(_0x1240('0x17'));var db=require(_0x1240('0x18'))['db'];function respondWithStatusCode(_0x4983ef,_0x151158){_0x151158=_0x151158||0xcc;return function(_0x4487ed){if(_0x4487ed){return _0x4983ef['sendStatus'](_0x151158);}return _0x4983ef[_0x1240('0x19')](_0x151158)[_0x1240('0x1a')]();};}function respondWithResult(_0x334745,_0x15f6d4){_0x15f6d4=_0x15f6d4||0xc8;return function(_0x16ce37){if(_0x16ce37){return _0x334745['status'](_0x15f6d4)[_0x1240('0x1b')](_0x16ce37);}};}function respondWithFilteredResult(_0xacb2e3,_0x5e4b73){return function(_0x30c0c8){if(_0x30c0c8){var _0x54c4e4=_0x30c0c8[_0x1240('0x1c')],_0xc0e635=_0x5e4b73['offset'],_0x2f72d3=_0x5e4b73[_0x1240('0x1d')]+_0x5e4b73[_0x1240('0x1e')],_0x6b647e;if(_0x2f72d3>=_0x54c4e4){_0x2f72d3=_0x54c4e4;_0x6b647e=0xc8;}else{_0x6b647e=0xce;}_0xacb2e3[_0x1240('0x19')](_0x6b647e);return _0xacb2e3['set'](_0x1240('0x1f'),_0xc0e635+'-'+_0x2f72d3+'/'+_0x54c4e4)[_0x1240('0x1b')](_0x30c0c8);}return null;};}function patchUpdates(_0x25873e){return function(_0x5249fa){try{jsonpatch[_0x1240('0x20')](_0x5249fa,_0x25873e,!![]);}catch(_0x372120){return BPromise[_0x1240('0x21')](_0x372120);}return _0x5249fa[_0x1240('0x22')]();};}function saveUpdates(_0x288ae8,_0x3db1c9){return function(_0x25cdb6){if(_0x25cdb6){return _0x25cdb6['update'](_0x288ae8)[_0x1240('0x23')](function(_0x5c55b9){return _0x5c55b9;});}return null;};}function removeEntity(_0x5e1ea7,_0xacc074){return function(_0x35f69f){if(_0x35f69f){return _0x35f69f[_0x1240('0x24')]()[_0x1240('0x23')](function(){_0x5e1ea7[_0x1240('0x19')](0xcc)[_0x1240('0x1a')]();});}};}function handleEntityNotFound(_0x5d9780,_0x3387b7){return function(_0xc0ca4d){if(!_0xc0ca4d){_0x5d9780[_0x1240('0x25')](0x194);}return _0xc0ca4d;};}function handleError(_0xf9471b,_0x535dce){_0x535dce=_0x535dce||0x1f4;return function(_0x3d84d9){logger['error'](_0x3d84d9[_0x1240('0x26')]);if(_0x3d84d9[_0x1240('0x27')]){delete _0x3d84d9[_0x1240('0x27')];}_0xf9471b[_0x1240('0x19')](_0x535dce)['send'](_0x3d84d9);};}exports['show']=function(_0x112535,_0x59fdc5){var _0x35012c={'raw':!![],'where':{'id':_0x112535[_0x1240('0x28')]['id']}},_0x11b901={};_0x11b901[_0x1240('0x29')]=_['keys'](db[_0x1240('0x2a')][_0x1240('0x2b')]);_0x11b901[_0x1240('0x2c')]=_[_0x1240('0x2d')](_0x112535[_0x1240('0x2c')]);_0x11b901[_0x1240('0x2e')]=_[_0x1240('0x2f')](_0x11b901['model'],_0x11b901[_0x1240('0x2c')]);_0x35012c['attributes']=_['intersection'](_0x11b901['model'],qs[_0x1240('0x30')](_0x112535['query'][_0x1240('0x30')]));_0x35012c[_0x1240('0x31')]=_0x35012c[_0x1240('0x31')][_0x1240('0x32')]?_0x35012c[_0x1240('0x31')]:_0x11b901[_0x1240('0x29')];if(_0x112535['query'][_0x1240('0x33')]){_0x35012c['include']=[{'all':!![]}];}_0x35012c=_[_0x1240('0x34')]({},_0x35012c,_0x112535[_0x1240('0x35')]);return db[_0x1240('0x2a')][_0x1240('0x36')](_0x35012c)[_0x1240('0x23')](handleEntityNotFound(_0x59fdc5,null))[_0x1240('0x23')](respondWithResult(_0x59fdc5,null))[_0x1240('0x37')](handleError(_0x59fdc5,null));};exports[_0x1240('0x38')]=function(_0x342f7b,_0x5edd09){if(_0x342f7b[_0x1240('0x39')]['id']){delete _0x342f7b['body']['id'];}return db[_0x1240('0x2a')][_0x1240('0x36')]({'where':{'id':_0x342f7b[_0x1240('0x28')]['id']}})[_0x1240('0x23')](handleEntityNotFound(_0x5edd09,null))[_0x1240('0x23')](saveUpdates(_0x342f7b['body'],null))[_0x1240('0x23')](respondWithResult(_0x5edd09,null))[_0x1240('0x37')](handleError(_0x5edd09,null));};exports['destroy']=function(_0x411fbd,_0x110cd5){return db[_0x1240('0x2a')]['find']({'where':{'id':_0x411fbd[_0x1240('0x28')]['id']}})[_0x1240('0x23')](handleEntityNotFound(_0x110cd5,null))[_0x1240('0x23')](removeEntity(_0x110cd5,null))[_0x1240('0x37')](handleError(_0x110cd5,null));}; \ No newline at end of file +var _0x7f52=['params','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','end','count','offset','limit','status','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','body','find'];(function(_0x512489,_0x284a2a){var _0x234f5a=function(_0x33167c){while(--_0x33167c){_0x512489['push'](_0x512489['shift']());}};_0x234f5a(++_0x284a2a);}(_0x7f52,0x12e));var _0x27f5=function(_0x13593a,_0x29b71e){_0x13593a=_0x13593a-0x0;var _0x5073a9=_0x7f52[_0x13593a];return _0x5073a9;};'use strict';var pdf=require(_0x27f5('0x0'));var emlformat=require(_0x27f5('0x1'));var rimraf=require(_0x27f5('0x2'));var zipdir=require(_0x27f5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x27f5('0x4'));var moment=require(_0x27f5('0x5'));var BPromise=require(_0x27f5('0x6'));var Mustache=require(_0x27f5('0x7'));var util=require(_0x27f5('0x8'));var path=require(_0x27f5('0x9'));var sox=require(_0x27f5('0xa'));var csv=require(_0x27f5('0xb'));var ejs=require(_0x27f5('0xc'));var fs=require('fs');var _=require(_0x27f5('0xd'));var squel=require('squel');var crypto=require(_0x27f5('0xe'));var jsforce=require(_0x27f5('0xf'));var deskjs=require(_0x27f5('0x10'));var toCsv=require(_0x27f5('0xb'));var querystring=require('querystring');var Papa=require(_0x27f5('0x11'));var Redis=require(_0x27f5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x27f5('0x13'));var as=require(_0x27f5('0x14'));var hardwareService=require(_0x27f5('0x15'));var logger=require(_0x27f5('0x16'))(_0x27f5('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc8eef4,_0x3cb717){_0x3cb717=_0x3cb717||0xcc;return function(_0x5a541d){if(_0x5a541d){return _0xc8eef4[_0x27f5('0x18')](_0x3cb717);}return _0xc8eef4['status'](_0x3cb717)[_0x27f5('0x19')]();};}function respondWithResult(_0x5ad529,_0x2dca98){_0x2dca98=_0x2dca98||0xc8;return function(_0x330fff){if(_0x330fff){return _0x5ad529['status'](_0x2dca98)['json'](_0x330fff);}};}function respondWithFilteredResult(_0x42e602,_0x56d62f){return function(_0x251036){if(_0x251036){var _0x594c44=_0x251036[_0x27f5('0x1a')],_0x428702=_0x56d62f[_0x27f5('0x1b')],_0x285703=_0x56d62f[_0x27f5('0x1b')]+_0x56d62f[_0x27f5('0x1c')],_0x6bce5b;if(_0x285703>=_0x594c44){_0x285703=_0x594c44;_0x6bce5b=0xc8;}else{_0x6bce5b=0xce;}_0x42e602[_0x27f5('0x1d')](_0x6bce5b);return _0x42e602['set'](_0x27f5('0x1e'),_0x428702+'-'+_0x285703+'/'+_0x594c44)[_0x27f5('0x1f')](_0x251036);}return null;};}function patchUpdates(_0x2e1ad6){return function(_0x340187){try{jsonpatch['apply'](_0x340187,_0x2e1ad6,!![]);}catch(_0x43cb3f){return BPromise[_0x27f5('0x20')](_0x43cb3f);}return _0x340187[_0x27f5('0x21')]();};}function saveUpdates(_0x4acc68,_0x4e33d){return function(_0x150bce){if(_0x150bce){return _0x150bce[_0x27f5('0x22')](_0x4acc68)[_0x27f5('0x23')](function(_0x2cb6b3){return _0x2cb6b3;});}return null;};}function removeEntity(_0x39aa47,_0x17f30e){return function(_0x2f46d1){if(_0x2f46d1){return _0x2f46d1[_0x27f5('0x24')]()[_0x27f5('0x23')](function(){_0x39aa47[_0x27f5('0x1d')](0xcc)[_0x27f5('0x19')]();});}};}function handleEntityNotFound(_0x41cb9c,_0x2fd6e6){return function(_0x24dd13){if(!_0x24dd13){_0x41cb9c[_0x27f5('0x18')](0x194);}return _0x24dd13;};}function handleError(_0x514499,_0x17416b){_0x17416b=_0x17416b||0x1f4;return function(_0x392952){logger[_0x27f5('0x25')](_0x392952[_0x27f5('0x26')]);if(_0x392952['name']){delete _0x392952[_0x27f5('0x27')];}_0x514499[_0x27f5('0x1d')](_0x17416b)[_0x27f5('0x28')](_0x392952);};}exports[_0x27f5('0x29')]=function(_0x107bf5,_0x40403c){var _0x3abec9={'raw':!![],'where':{'id':_0x107bf5['params']['id']}},_0x3ee1b5={};_0x3ee1b5[_0x27f5('0x2a')]=_[_0x27f5('0x2b')](db[_0x27f5('0x2c')][_0x27f5('0x2d')]);_0x3ee1b5[_0x27f5('0x2e')]=_['keys'](_0x107bf5[_0x27f5('0x2e')]);_0x3ee1b5[_0x27f5('0x2f')]=_[_0x27f5('0x30')](_0x3ee1b5[_0x27f5('0x2a')],_0x3ee1b5[_0x27f5('0x2e')]);_0x3abec9[_0x27f5('0x31')]=_[_0x27f5('0x30')](_0x3ee1b5['model'],qs['fields'](_0x107bf5[_0x27f5('0x2e')][_0x27f5('0x32')]));_0x3abec9[_0x27f5('0x31')]=_0x3abec9['attributes'][_0x27f5('0x33')]?_0x3abec9[_0x27f5('0x31')]:_0x3ee1b5[_0x27f5('0x2a')];if(_0x107bf5[_0x27f5('0x2e')][_0x27f5('0x34')]){_0x3abec9[_0x27f5('0x35')]=[{'all':!![]}];}_0x3abec9=_[_0x27f5('0x36')]({},_0x3abec9,_0x107bf5[_0x27f5('0x37')]);return db[_0x27f5('0x2c')]['find'](_0x3abec9)[_0x27f5('0x23')](handleEntityNotFound(_0x40403c,null))[_0x27f5('0x23')](respondWithResult(_0x40403c,null))['catch'](handleError(_0x40403c,null));};exports[_0x27f5('0x22')]=function(_0x1f9e85,_0x1644e6){if(_0x1f9e85['body']['id']){delete _0x1f9e85[_0x27f5('0x38')]['id'];}return db['MailApplication'][_0x27f5('0x39')]({'where':{'id':_0x1f9e85[_0x27f5('0x3a')]['id']}})[_0x27f5('0x23')](handleEntityNotFound(_0x1644e6,null))['then'](saveUpdates(_0x1f9e85[_0x27f5('0x38')],null))[_0x27f5('0x23')](respondWithResult(_0x1644e6,null))[_0x27f5('0x3b')](handleError(_0x1644e6,null));};exports[_0x27f5('0x24')]=function(_0xd89db9,_0x433258){return db['MailApplication']['find']({'where':{'id':_0xd89db9[_0x27f5('0x3a')]['id']}})[_0x27f5('0x23')](handleEntityNotFound(_0x433258,null))[_0x27f5('0x23')](removeEntity(_0x433258,null))['catch'](handleError(_0x433258,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 53aa0ea..a4a05db 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 _0xa0c9=['../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x436e27,_0x45ef8f){var _0xd16f00=function(_0x3d7a8b){while(--_0x3d7a8b){_0x436e27['push'](_0x436e27['shift']());}};_0xd16f00(++_0x45ef8f);}(_0xa0c9,0x1f0));var _0x9a0c=function(_0x3413e9,_0x2a6957){_0x3413e9=_0x3413e9-0x0;var _0x463cc5=_0xa0c9[_0x3413e9];return _0x463cc5;};'use strict';var _=require(_0x9a0c('0x0'));var util=require(_0x9a0c('0x1'));var logger=require('../../config/logger')(_0x9a0c('0x2'));var moment=require(_0x9a0c('0x3'));var BPromise=require(_0x9a0c('0x4'));var rp=require(_0x9a0c('0x5'));var fs=require('fs');var path=require(_0x9a0c('0x6'));var rimraf=require(_0x9a0c('0x7'));var config=require(_0x9a0c('0x8'));var attributes=require(_0x9a0c('0x9'));module[_0x9a0c('0xa')]=function(_0x1dc65a,_0x3324a0){return _0x1dc65a[_0x9a0c('0xb')](_0x9a0c('0xc'),attributes,{'tableName':_0x9a0c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6217=['rimraf','./mailApplication.attributes','exports','mail_applications','util','../../config/logger','moment','bluebird','path'];(function(_0x4defff,_0x5c76d1){var _0x5d1f57=function(_0x60caa8){while(--_0x60caa8){_0x4defff['push'](_0x4defff['shift']());}};_0x5d1f57(++_0x5c76d1);}(_0x6217,0x67));var _0x7621=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0x6217[_0x1aba25];return _0x47d997;};'use strict';var _=require('lodash');var util=require(_0x7621('0x0'));var logger=require(_0x7621('0x1'))('api');var moment=require(_0x7621('0x2'));var BPromise=require(_0x7621('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7621('0x4'));var rimraf=require(_0x7621('0x5'));var config=require('../../config/environment');var attributes=require(_0x7621('0x6'));module[_0x7621('0x7')]=function(_0x163902,_0x16b7aa){return _0x163902['define']('MailApplication',attributes,{'tableName':_0x7621('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 4bc5780..ad42fed 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 _0x9251=['MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','body','options','raw','where','attributes','limit','UpdateMailApplication','lodash','util','moment','bluebird','ioredis','../../config/utils','jayson/promise','client','http','request','info'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x9251,0x199));var _0x1925=function(_0x48c615,_0x4cc757){_0x48c615=_0x48c615-0x0;var _0x3d9e22=_0x9251[_0x48c615];return _0x3d9e22;};'use strict';var _=require(_0x1925('0x0'));var util=require(_0x1925('0x1'));var moment=require(_0x1925('0x2'));var BPromise=require(_0x1925('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1925('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1925('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1925('0x6'));var client=jayson[_0x1925('0x7')][_0x1925('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x86a100,_0x5caa77,_0x12359b){return new BPromise(function(_0x12175e,_0x5a91cb){return client[_0x1925('0x9')](_0x86a100,_0x12359b)['then'](function(_0xfa749f){logger[_0x1925('0xa')](_0x1925('0xb'),_0x5caa77,'request\x20sent');logger[_0x1925('0xc')](_0x1925('0xd'),_0x5caa77,_0x1925('0xe'),JSON[_0x1925('0xf')](_0xfa749f));if(_0xfa749f[_0x1925('0x10')]){if(_0xfa749f[_0x1925('0x10')][_0x1925('0x11')]===0x1f4){logger[_0x1925('0x10')](_0x1925('0xb'),_0x5caa77,_0xfa749f[_0x1925('0x10')][_0x1925('0x12')]);return _0x5a91cb(_0xfa749f[_0x1925('0x10')]['message']);}logger[_0x1925('0x10')](_0x1925('0xb'),_0x5caa77,_0xfa749f['error'][_0x1925('0x12')]);return _0x12175e(_0xfa749f[_0x1925('0x10')][_0x1925('0x12')]);}else{logger[_0x1925('0xa')](_0x1925('0xb'),_0x5caa77,_0x1925('0xe'));_0x12175e(_0xfa749f[_0x1925('0x13')][_0x1925('0x12')]);}})[_0x1925('0x14')](function(_0x7af346){logger['error'](_0x1925('0xb'),_0x5caa77,_0x7af346);_0x5a91cb(_0x7af346);});});}exports['UpdateMailApplication']=function(_0x58916e){var _0x4cd80f=this;return new Promise(function(_0xf9422b,_0x516a65){return db['MailApplication']['update'](_0x58916e[_0x1925('0x15')],{'raw':_0x58916e['options']?_0x58916e[_0x1925('0x16')][_0x1925('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58916e['options']?_0x58916e[_0x1925('0x16')][_0x1925('0x18')]||null:null,'attributes':_0x58916e[_0x1925('0x16')]?_0x58916e[_0x1925('0x16')][_0x1925('0x19')]||null:null,'limit':_0x58916e[_0x1925('0x16')]?_0x58916e[_0x1925('0x16')][_0x1925('0x1a')]||null:null})['then'](function(_0x28adc2){logger[_0x1925('0xa')](_0x1925('0x1b'),_0x58916e);logger[_0x1925('0xc')](_0x1925('0x1b'),_0x58916e,JSON['stringify'](_0x28adc2));_0xf9422b(_0x28adc2);})[_0x1925('0x14')](function(_0x5e4d2a){logger['error'](_0x1925('0x1b'),_0x5e4d2a[_0x1925('0x12')],_0x58916e);_0x516a65(_0x4cd80f[_0x1925('0x10')](0x1f4,_0x5e4d2a[_0x1925('0x12')]));});});}; \ No newline at end of file +var _0x4139=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateMailApplication','MailApplication','update','body','options','raw','attributes','limit','then','lodash','util','moment','bluebird'];(function(_0x2c48e5,_0x1e7cf6){var _0x53eb31=function(_0x1bbf39){while(--_0x1bbf39){_0x2c48e5['push'](_0x2c48e5['shift']());}};_0x53eb31(++_0x1e7cf6);}(_0x4139,0xdc));var _0x9413=function(_0x26e1d8,_0x4d13a9){_0x26e1d8=_0x26e1d8-0x0;var _0x29d5fc=_0x4139[_0x26e1d8];return _0x29d5fc;};'use strict';var _=require(_0x9413('0x0'));var util=require(_0x9413('0x1'));var moment=require(_0x9413('0x2'));var BPromise=require(_0x9413('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9413('0x4'));var db=require(_0x9413('0x5'))['db'];var utils=require(_0x9413('0x6'));var logger=require(_0x9413('0x7'))(_0x9413('0x8'));var config=require(_0x9413('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x24346f,_0x78400f,_0x3d7472){return new BPromise(function(_0x5755e8,_0x47198a){return client[_0x9413('0xa')](_0x24346f,_0x3d7472)['then'](function(_0x5e0d0e){logger[_0x9413('0xb')](_0x9413('0xc'),_0x78400f,_0x9413('0xd'));logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x78400f,'request\x20sent',JSON[_0x9413('0xe')](_0x5e0d0e));if(_0x5e0d0e[_0x9413('0xf')]){if(_0x5e0d0e[_0x9413('0xf')][_0x9413('0x10')]===0x1f4){logger[_0x9413('0xf')](_0x9413('0xc'),_0x78400f,_0x5e0d0e[_0x9413('0xf')][_0x9413('0x11')]);return _0x47198a(_0x5e0d0e[_0x9413('0xf')][_0x9413('0x11')]);}logger['error'](_0x9413('0xc'),_0x78400f,_0x5e0d0e['error'][_0x9413('0x11')]);return _0x5755e8(_0x5e0d0e[_0x9413('0xf')]['message']);}else{logger[_0x9413('0xb')]('MailApplication,\x20%s,\x20%s',_0x78400f,_0x9413('0xd'));_0x5755e8(_0x5e0d0e['result']['message']);}})[_0x9413('0x12')](function(_0x4d0b18){logger[_0x9413('0xf')](_0x9413('0xc'),_0x78400f,_0x4d0b18);_0x47198a(_0x4d0b18);});});}exports[_0x9413('0x13')]=function(_0x23be95){var _0x48b21a=this;return new Promise(function(_0x47ca62,_0x35fb92){return db[_0x9413('0x14')][_0x9413('0x15')](_0x23be95[_0x9413('0x16')],{'raw':_0x23be95['options']?_0x23be95[_0x9413('0x17')][_0x9413('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23be95[_0x9413('0x17')]?_0x23be95[_0x9413('0x17')]['where']||null:null,'attributes':_0x23be95['options']?_0x23be95[_0x9413('0x17')][_0x9413('0x19')]||null:null,'limit':_0x23be95[_0x9413('0x17')]?_0x23be95[_0x9413('0x17')][_0x9413('0x1a')]||null:null})[_0x9413('0x1b')](function(_0x4f125b){logger[_0x9413('0xb')](_0x9413('0x13'),_0x23be95);logger['debug'](_0x9413('0x13'),_0x23be95,JSON[_0x9413('0xe')](_0x4f125b));_0x47ca62(_0x4f125b);})['catch'](function(_0x3d0635){logger[_0x9413('0xf')]('UpdateMailApplication',_0x3d0635['message'],_0x23be95);_0x35fb92(_0x48b21a[_0x9413('0xf')](0x1f4,_0x3d0635[_0x9413('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index aa2ed16..ccddb08 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 _0xa3ea=['/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','addTags','put','mailinteraction:update','delete','mailinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','isAuthenticated','index','get'];(function(_0x882ce7,_0x337948){var _0xbb237f=function(_0x38a985){while(--_0x38a985){_0x882ce7['push'](_0x882ce7['shift']());}};_0xbb237f(++_0x337948);}(_0xa3ea,0x77));var _0xaa3e=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa3ea[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xaa3e('0x0'));var util=require(_0xaa3e('0x1'));var path=require(_0xaa3e('0x2'));var timeout=require(_0xaa3e('0x3'));var express=require(_0xaa3e('0x4'));var router=express[_0xaa3e('0x5')]();var auth=require(_0xaa3e('0x6'));var interaction=require(_0xaa3e('0x7'));var config=require(_0xaa3e('0x8'));var controller=require(_0xaa3e('0x9'));router['get']('/',auth[_0xaa3e('0xa')](),controller[_0xaa3e('0xb')]);router[_0xaa3e('0xc')](_0xaa3e('0xd'),auth[_0xaa3e('0xa')](),controller[_0xaa3e('0xe')]);router[_0xaa3e('0xc')](_0xaa3e('0xf'),auth[_0xaa3e('0xa')](),controller['show']);router[_0xaa3e('0xc')](_0xaa3e('0x10'),auth[_0xaa3e('0xa')](),controller[_0xaa3e('0x11')]);router[_0xaa3e('0xc')](_0xaa3e('0x12'),auth['isAuthenticated'](),controller[_0xaa3e('0x13')]);router[_0xaa3e('0x14')]('/',auth[_0xaa3e('0xa')](),controller[_0xaa3e('0x15')]);router[_0xaa3e('0x14')](_0xaa3e('0x10'),auth['isAuthenticated'](),controller[_0xaa3e('0x16')]);router[_0xaa3e('0x14')](_0xaa3e('0x17'),auth[_0xaa3e('0xa')](),interaction[_0xaa3e('0x18')](_0xaa3e('0x19'),'mailinteraction:addtags'),controller[_0xaa3e('0x1a')]);router[_0xaa3e('0x1b')]('/:id',auth[_0xaa3e('0xa')](),interaction[_0xaa3e('0x18')](_0xaa3e('0x19'),_0xaa3e('0x1c')),controller['update']);router[_0xaa3e('0x1d')](_0xaa3e('0xf'),auth[_0xaa3e('0xa')](),interaction[_0xaa3e('0x18')]('mail',_0xaa3e('0x1e')),controller[_0xaa3e('0x1f')]);router['delete'](_0xaa3e('0x17'),auth[_0xaa3e('0xa')](),controller['removeTags']);module[_0xaa3e('0x20')]=router; \ No newline at end of file +var _0xc492=['addTags','put','mailinteraction:update','update','delete','destroy','exports','multer','util','path','Router','../../config/environment','./mailInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags'];(function(_0x4b7795,_0x945a96){var _0x1a4433=function(_0x2b2e49){while(--_0x2b2e49){_0x4b7795['push'](_0x4b7795['shift']());}};_0x1a4433(++_0x945a96);}(_0xc492,0xd7));var _0x2c49=function(_0xe57c95,_0x5d9780){_0xe57c95=_0xe57c95-0x0;var _0x8204=_0xc492[_0xe57c95];return _0x8204;};'use strict';var multer=require(_0x2c49('0x0'));var util=require(_0x2c49('0x1'));var path=require(_0x2c49('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2c49('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c49('0x4'));var controller=require(_0x2c49('0x5'));router['get']('/',auth[_0x2c49('0x6')](),controller['index']);router[_0x2c49('0x7')](_0x2c49('0x8'),auth['isAuthenticated'](),controller[_0x2c49('0x9')]);router[_0x2c49('0x7')](_0x2c49('0xa'),auth[_0x2c49('0x6')](),controller[_0x2c49('0xb')]);router['get'](_0x2c49('0xc'),auth['isAuthenticated'](),controller['getMessages']);router['get']('/:id/download',auth[_0x2c49('0x6')](),controller['download']);router[_0x2c49('0xd')]('/',auth[_0x2c49('0x6')](),controller['create']);router[_0x2c49('0xd')](_0x2c49('0xc'),auth[_0x2c49('0x6')](),controller[_0x2c49('0xe')]);router[_0x2c49('0xd')](_0x2c49('0xf'),auth['isAuthenticated'](),interaction[_0x2c49('0x10')](_0x2c49('0x11'),_0x2c49('0x12')),controller[_0x2c49('0x13')]);router[_0x2c49('0x14')]('/:id',auth[_0x2c49('0x6')](),interaction[_0x2c49('0x10')](_0x2c49('0x11'),_0x2c49('0x15')),controller[_0x2c49('0x16')]);router[_0x2c49('0x17')](_0x2c49('0xa'),auth[_0x2c49('0x6')](),interaction[_0x2c49('0x10')](_0x2c49('0x11'),'mailinteraction:destroy'),controller[_0x2c49('0x18')]);router[_0x2c49('0x17')](_0x2c49('0xf'),auth[_0x2c49('0x6')](),controller['removeTags']);module[_0x2c49('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 08e6bef..5184697 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 _0xe4e0=['BOOLEAN','DATE','STRING','long','ENUM','out','TEXT','sequelize','exports'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe4e0,0x1a5));var _0x0e4e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xe4e0[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x0e4e('0x0'));var iconv=require('iconv');module[_0x0e4e('0x1')]={'closed':{'type':Sequelize[_0x0e4e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0e4e('0x3')]},'disposition':{'type':Sequelize[_0x0e4e('0x4')]},'note':{'type':Sequelize[_0x0e4e('0x4')]},'inReplyTo':{'type':Sequelize[_0x0e4e('0x4')](0x1fe)},'to':{'type':Sequelize[_0x0e4e('0x4')]},'cc':{'type':Sequelize['TEXT'](_0x0e4e('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x0e4e('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0e4e('0x3')]},'substatus':{'type':Sequelize[_0x0e4e('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x0e4e('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0e4e('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0e4e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0e4e('0x6')]('in',_0x0e4e('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x0e4e('0x8')](_0x0e4e('0x5'))},'lastMsgText':{'type':Sequelize[_0x0e4e('0x8')](_0x0e4e('0x5'))}}; \ No newline at end of file +var _0x1fb8=['DATE','STRING','TEXT','long','out','iconv','BOOLEAN'];(function(_0x597dff,_0x3af909){var _0x4334c2=function(_0x56aa5e){while(--_0x56aa5e){_0x597dff['push'](_0x597dff['shift']());}};_0x4334c2(++_0x3af909);}(_0x1fb8,0xd7));var _0x81fb=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0x1fb8[_0x336376];return _0x1d2a8e;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x81fb('0x0'));module['exports']={'closed':{'type':Sequelize[_0x81fb('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x81fb('0x2')]},'disposition':{'type':Sequelize[_0x81fb('0x3')]},'note':{'type':Sequelize[_0x81fb('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x81fb('0x3')]},'cc':{'type':Sequelize[_0x81fb('0x4')](_0x81fb('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x81fb('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x81fb('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x81fb('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x81fb('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x81fb('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0x81fb('0x5'))},'lastMsgText':{'type':Sequelize[_0x81fb('0x4')]('long')}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 2081403..772d5d1 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 _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x67f9f7,_0x5de18f){var _0x226c24=function(_0x458ae3){while(--_0x458ae3){_0x67f9f7['push'](_0x67f9f7['shift']());}};_0x226c24(++_0x5de18f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));}; \ No newline at end of file +var _0xa9e0=['MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','include','merge','options','create','body','describe','addMessage','MailMessage','ids','omit','intersection','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','emit','mailInteractionTags:save','removeTags','unix','root','files','tmp','server','transcript-%d-%s.zip','join','attachments','Attachment','subject','Messages','get','mkdirSync','each','headers','bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailInteraction.socket','register','status','count','offset','limit','set','Content-Range','update','destroy','then','sendStatus','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','tools_tags','ui.MailInteractionId','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','value','having','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','end','Tag','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','type','some','compact','isEmpty','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy'];(function(_0x103f03,_0x4ea47c){var _0x127c84=function(_0x49096){while(--_0x49096){_0x103f03['push'](_0x103f03['shift']());}};_0x127c84(++_0x4ea47c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 htmlToText=require(_0x0a9e('0xe'));var Redis=require(_0x0a9e('0xf'));var authService=require(_0x0a9e('0x10'));var qs=require(_0x0a9e('0x11'));var as=require(_0x0a9e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];config[_0x0a9e('0x15')]=_[_0x0a9e('0x16')](config[_0x0a9e('0x15')],{'host':_0x0a9e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x15')]));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x281129,_0x44dcfd){_0x44dcfd=_0x44dcfd||0xcc;return function(_0x4d5611){if(_0x4d5611){return _0x281129['sendStatus'](_0x44dcfd);}return _0x281129[_0x0a9e('0x1a')](_0x44dcfd)['end']();};}function respondWithResult(_0x1985b6,_0x519dfd){_0x519dfd=_0x519dfd||0xc8;return function(_0x16033c){if(_0x16033c){return _0x1985b6[_0x0a9e('0x1a')](_0x519dfd)['json'](_0x16033c);}};}function respondWithFilteredResult(_0x225616,_0x5a0a06){return function(_0x459eb1){if(_0x459eb1){var _0x478723=_0x459eb1[_0x0a9e('0x1b')],_0x106033=_0x5a0a06[_0x0a9e('0x1c')],_0x205fd6=_0x5a0a06[_0x0a9e('0x1c')]+_0x5a0a06[_0x0a9e('0x1d')],_0x31b1ca;if(_0x205fd6>=_0x478723){_0x205fd6=_0x478723;_0x31b1ca=0xc8;}else{_0x31b1ca=0xce;}_0x225616[_0x0a9e('0x1a')](_0x31b1ca);return _0x225616[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033+'-'+_0x205fd6+'/'+_0x478723)['json'](_0x459eb1);}return null;};}function patchUpdates(_0x2c3407){return function(_0x155cce){try{jsonpatch['apply'](_0x155cce,_0x2c3407,!![]);}catch(_0x20f109){return BPromise['reject'](_0x20f109);}return _0x155cce['save']();};}function saveUpdates(_0x3a02e1,_0x432e56){return function(_0x38e7c4){if(_0x38e7c4){return _0x38e7c4[_0x0a9e('0x20')](_0x3a02e1)['then'](function(_0xfb6e48){return _0xfb6e48;});}return null;};}function removeEntity(_0x2fb0e4,_0x3b45bc){return function(_0x4d00e6){if(_0x4d00e6){return _0x4d00e6[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){_0x2fb0e4[_0x0a9e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x23')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x24')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x25')];}_0x33161b[_0x0a9e('0x1a')](_0x526cf3)[_0x0a9e('0x26')](_0x384319);};}function getInteractionUsers(_0x14433c,_0x140511){return new BPromise(function(_0x1538a4,_0x11c3b6){try{if(_0x140511[_0x14433c['id']]){_0x14433c[_0x0a9e('0x27')]=_['map'](_0x140511[_0x14433c['id']],function(_0x3652a7){return{'id':_0x3652a7['id'],'fullname':_0x3652a7[_0x0a9e('0x28')]};});}}catch(_0x2b1f27){_0x11c3b6(_0x2b1f27);}_0x1538a4(_0x14433c);});}function getInteractionTags(_0x2ec755,_0x5c877d){return new BPromise(function(_0x15b200,_0x40e7a3){try{if(_0x2ec755[_0x0a9e('0x29')]){_0x2ec755[_0x0a9e('0x2a')]=[];_0x2ec755[_0x0a9e('0x29')][_0x0a9e('0x2b')](',')[_0x0a9e('0x2c')](function(_0x2e8759){_0x2ec755[_0x0a9e('0x2a')]['push'](_0x5c877d[_0x2e8759]);});}delete _0x2ec755[_0x0a9e('0x29')];}catch(_0x5d1e0e){_0x40e7a3(_0x5d1e0e);}_0x15b200(_0x2ec755);});}function getLastMessageText(_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x2407f9['id']},'attributes':['lastMsgBody',_0x0a9e('0x2f')],'raw':!![]})[_0x0a9e('0x22')](function(_0x40cb85){if(!_0x40cb85[_0x0a9e('0x2f')]){_0x2407f9[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](htmlToText[_0x0a9e('0x31')](_0x40cb85[_0x0a9e('0x32')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x2407f9['lastMsgText']=_0x40cb85[_0x0a9e('0x2f')];}_0x3ae878(_0x2407f9);})['catch'](function(_0x2cc7a0){_0x1122db(_0x2cc7a0);});});}function updateMailInteraction(_0x14b13f,_0x2b7e7f,_0x3f3d41,_0x567193){return new BPromise(function(_0x191e91,_0xd1836d){return getInteractionUsers(_0x14b13f,_0x3f3d41)[_0x0a9e('0x22')](function(_0x15de0e){return getInteractionTags(_0x15de0e,_0x2b7e7f);})['then'](function(_0x54135e){if(_0x567193){_0x191e91(getLastMessageText(_0x54135e));}else{_0x191e91(_0x54135e);}})[_0x0a9e('0x33')](function(_0x5640eb){_0xd1836d(_0x5640eb);});});}exports[_0x0a9e('0x34')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x35')](db['MailInteraction'][_0x0a9e('0x36')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x37')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x38')]=_[_0x0a9e('0x35')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x3d9717[_0x0a9e('0x39')]);_0x4f41ae[_0x0a9e('0x3b')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x39')]);_0x1ef87a[_0x0a9e('0x3c')]=_['intersection'](_0x4f41ae[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x3d9717[_0x0a9e('0x39')]['fields']));_0x1ef87a[_0x0a9e('0x3c')]=_0x1ef87a[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1ef87a[_0x0a9e('0x3c')]:_0x4f41ae[_0x0a9e('0x38')];if(!_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x3f')](_0x0a9e('0x40'))){_0x1ef87a[_0x0a9e('0x1d')]=qs[_0x0a9e('0x1d')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1ef87a[_0x0a9e('0x1c')]=qs[_0x0a9e('0x1c')](_0x3d9717[_0x0a9e('0x39')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1ef87a[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x3d9717[_0x0a9e('0x39')],_0x4f41ae[_0x0a9e('0x3b')]),_0x3bfce8);var _0x432fcc=[];var _0x25c6e6=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('id')['field'](_0x0a9e('0x25'))[_0x0a9e('0x45')](_0x0a9e('0x46'))[_0x0a9e('0x47')](_0x0a9e('0x48'));var _0xbe9d19=squel[_0x0a9e('0x44')]()[_0x0a9e('0x45')]('u.id')[_0x0a9e('0x45')]('u.fullname')[_0x0a9e('0x45')](_0x0a9e('0x49'))[_0x0a9e('0x47')]('user_has_mail_interactions','ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x34aa5a=squel[_0x0a9e('0x44')]()[_0x0a9e('0x47')](_0x0a9e('0x4d'),'i')['left_join'](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')](_0x0a9e('0x51'),'a',_0x0a9e('0x52'))[_0x0a9e('0x4a')]('mail_messages','me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it','it.MailInteractionId\x20=\x20i.id')['left_join'](_0x0a9e('0x48'),'t',_0x0a9e('0x54'));var _0x37edaa=squel[_0x0a9e('0x55')]();var _0x61bb17=[];var _0x30decb=squel[_0x0a9e('0x55')]();var _0x375c18;if(_0x3d9717['query']['search']){_0x375c18=as['parseSearch'](_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x56')]);var _0x14d602=_0x375c18['sqlOperator'];for(var _0x2b69d9=0x0;_0x2b69d9<_0x375c18[_0x0a9e('0x57')]['length'];_0x2b69d9++){var _0x5a88da=_0x375c18[_0x0a9e('0x57')][_0x2b69d9];var _0x59c6ff='i';var _0x443e72=_['find'](_0x3bfce8,[_0x0a9e('0x25'),_0x5a88da[_0x0a9e('0x45')]]);if(!_0x443e72){switch(_0x5a88da[_0x0a9e('0x45')]){case'unreadMessages':if(_0x5a88da[_0x0a9e('0x58')]==0x1){_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da['field']+'`\x20=\x200');}else{_0x34aa5a[_0x0a9e('0x59')]('`'+_0x5a88da[_0x0a9e('0x45')]+'`\x20>\x200');}break;case _0x0a9e('0x5a'):if(_0x5a88da['operator']===_0x0a9e('0x5b')){if(_0x5a88da['value'][_0x0a9e('0x2b')]('\x20')['length']>0x1){_0x37edaa[_0x14d602]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5a88da[_0x0a9e('0x58')]),null);}else{var _0x47de4c='%'+_0x5a88da[_0x0a9e('0x58')]+'%';_0x37edaa[_0x14d602](_0x0a9e('0x5c'),_0x47de4c,_0x47de4c,_0x47de4c);}}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x5e')]);_0x5a88da[_0x0a9e('0x45')]=_0x0a9e('0x5e');_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}break;case _0x0a9e('0x63'):var _0x5d86e9=_0x5a88da[_0x0a9e('0x58')][_0x0a9e('0x2b')](',')['map'](function(_0x3649cc){return Number(_0x3649cc);});_0x5d86e9['forEach'](function(_0x20c668){_0x30decb['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20c668+',%');});_0x61bb17=_['union'](_0x61bb17,_0x5d86e9);break;case'User':if(_0x5a88da[_0x0a9e('0x64')]==='$substring'){_0x37edaa[_0x14d602](_0x0a9e('0x65'),'%'+_0x5a88da[_0x0a9e('0x58')]+'%',null);}else{_0x443e72=_[_0x0a9e('0x5d')](_0x3bfce8,[_0x0a9e('0x25'),_0x0a9e('0x66')]);_0x5a88da[_0x0a9e('0x45')]='UserId';_0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72['type'],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x61')],_0x797b45['value'][_0x0a9e('0x62')]);}break;case _0x0a9e('0x67'):_0x797b45=as[_0x0a9e('0x5f')]('me',null,_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45['value'][_0x0a9e('0x61')],_0x797b45[_0x0a9e('0x58')]['end']);break;}}else{var _0x797b45=as[_0x0a9e('0x5f')](_0x59c6ff,_0x443e72[_0x0a9e('0x68')],_0x5a88da);_0x37edaa[_0x14d602](_0x797b45[_0x0a9e('0x60')],_0x797b45[_0x0a9e('0x58')]['start'],_0x797b45[_0x0a9e('0x58')][_0x0a9e('0x62')]);}}}else{var _0x281c7d=_(_0x3d9717['query'])[_0x0a9e('0x3a')]()['map'](function(_0x5211e3){return _[_0x0a9e('0x69')](_0x3bfce8,[_0x0a9e('0x25'),_0x5211e3])?_0x5211e3:undefined;})[_0x0a9e('0x6a')]()[_0x0a9e('0x58')]();if(!_[_0x0a9e('0x6b')](_0x281c7d)){_0x281c7d[_0x0a9e('0x2c')](function(_0x387489){if(_0x387489===_0x0a9e('0x6c')){_0x34aa5a[_0x0a9e('0x42')](_0x0a9e('0x6d'),[][_0x0a9e('0x6e')](_0x3d9717[_0x0a9e('0x39')][_0x387489]));}else if(_0x387489===_0x0a9e('0x6f')){var _0x2b8192=JSON[_0x0a9e('0x70')](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x71')];var _0x4257c9=JSON['parse'](_0x3d9717[_0x0a9e('0x39')][_0x387489])[_0x0a9e('0x72')];_0x34aa5a[_0x0a9e('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2b8192,_0x4257c9);}else{if(_0x3d9717[_0x0a9e('0x39')][_0x387489]===_0x0a9e('0x73')){_0x34aa5a['where']('i.'+_0x387489+_0x0a9e('0x74'));}else{_0x34aa5a[_0x0a9e('0x42')]('i.'+_0x387489+_0x0a9e('0x75'),_0x3d9717[_0x0a9e('0x39')][_0x387489]);}}});}if(_0x3d9717[_0x0a9e('0x39')]['read']){if(_0x3d9717['query']['read']==0x1){_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x76'));}else{_0x34aa5a[_0x0a9e('0x59')](_0x0a9e('0x77'));}}if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]){_0x61bb17=_[_0x0a9e('0x79')](_0x3d9717[_0x0a9e('0x39')]['tag'])?_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x78')]:new Array(_0x3d9717[_0x0a9e('0x39')]['tag']);_0x61bb17[_0x0a9e('0x2c')](function(_0x583b2e){_0x30decb['or'](_0x0a9e('0x7a'),'%,'+_0x583b2e+',%');});}if(_0x3d9717[_0x0a9e('0x39')]['filter']){var _0x2ed01e=_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x7b')][_0x0a9e('0x7c')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x0a9e('0x7d'));if(qs[_0x0a9e('0x7e')](_0x2ed01e)){_0x37edaa['or'](_0x0a9e('0x7f'),_0x2ed01e+'%');}else if(qs[_0x0a9e('0x80')](_0x2ed01e)){_0x37edaa['or']('c.email\x20LIKE\x20?',_0x2ed01e+'%');}else{_0x37edaa['or'](_0x0a9e('0x81'),qs[_0x0a9e('0x82')](_0x2ed01e))['or'](_0x0a9e('0x83'),qs[_0x0a9e('0x82')](_0x2ed01e));}}}_0x34aa5a['where'](_0x37edaa);_0x34aa5a[_0x0a9e('0x84')](_0x0a9e('0x85'));var _0x30a4c7={'type':db[_0x0a9e('0x86')][_0x0a9e('0x87')][_0x0a9e('0x88')],'raw':!![]};var _0x40fc56=_0x34aa5a[_0x0a9e('0x89')]();_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x40fc56[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));if(_0x1ef87a[_0x0a9e('0x8c')]){_0x1ef87a['order'][_0x0a9e('0x2c')](function(_0x11da9c){_0x34aa5a[_0x0a9e('0x8c')]('i.'+_0x11da9c[0x0],_0x11da9c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x0a9e('0x6b')](_0x61bb17)){_0x34aa5a[_0x0a9e('0x59')](_0x30decb);_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x8d'),_0x61bb17);}BPromise['resolve']()['then'](function(){if(!_0x375c18){if(_0x3d9717[_0x0a9e('0x39')][_0x0a9e('0x6c')]||_0x3d9717['query'][_0x0a9e('0x8e')])return;_0x40fc56['where'](_0x0a9e('0x8f'));_0x34aa5a[_0x0a9e('0x42')]('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}return _0x3d9717[_0x0a9e('0x90')][_0x0a9e('0x91')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x22')](function(_0x42b959){if(_[_0x0a9e('0x6b')](_0x42b959)){_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x92'));_0x34aa5a['where'](_0x0a9e('0x92'));}else{_0x40fc56[_0x0a9e('0x42')](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));_0x34aa5a['where'](_0x0a9e('0x6d'),_[_0x0a9e('0x35')](_0x42b959,'id'));}});})['then'](function(){db[_0x0a9e('0x93')]['query'](_0x40fc56[_0x0a9e('0x94')](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x3003eb){_0x31916f[_0x0a9e('0x1b')]=_0x3003eb['length'];if(_0x31916f['count']===0x0)return[];return db[_0x0a9e('0x93')][_0x0a9e('0x39')](_0x25c6e6[_0x0a9e('0x94')](),_0x30a4c7)['then'](function(_0x3b4a9f){_0x432fcc=_[_0x0a9e('0x95')](_0x3b4a9f,'id');_0x30a4c7=_['merge'](_0x30a4c7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9717[_0x0a9e('0x39')]['fields']){_0x1ef87a['attributes']['forEach'](function(_0x81d748){_0x34aa5a[_0x0a9e('0x45')]('i.'+_0x81d748);});}else{_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x8a'),_0x0a9e('0x8b'));_0x34aa5a[_0x0a9e('0x45')]('a.key',_0x0a9e('0x96'));_0x34aa5a['field'](_0x0a9e('0x97'),_0x0a9e('0x98'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x85'));_0x34aa5a['field'](_0x0a9e('0x99'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9a'));_0x34aa5a['field'](_0x0a9e('0x9b'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9c'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9d'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9e'));_0x34aa5a[_0x0a9e('0x45')]('i.lastMsgDirection');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0x9f'));_0x34aa5a['field'](_0x0a9e('0xa0'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa1'));_0x34aa5a['field'](_0x0a9e('0xa2'));_0x34aa5a['field'](_0x0a9e('0xa3'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa4'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa5'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xa6'),_0x0a9e('0xa7'));_0x34aa5a['field'](_0x0a9e('0xa8'),_0x0a9e('0xa9'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xaa'),_0x0a9e('0xab'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xac'),_0x0a9e('0xad'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb0'),'Contact.fax');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb1'),_0x0a9e('0xb2'));_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb3'),'Owner.internal');_0x34aa5a[_0x0a9e('0x45')](_0x0a9e('0xb4'),'TagIds');}if(_0x1ef87a[_0x0a9e('0x1d')])_0x34aa5a['limit'](_0x1ef87a[_0x0a9e('0x1d')]);if(_0x1ef87a[_0x0a9e('0x1c')])_0x34aa5a[_0x0a9e('0x1c')](_0x1ef87a[_0x0a9e('0x1c')]);return db['sequelize'][_0x0a9e('0x39')](_0x34aa5a['toString'](),_0x30a4c7);})[_0x0a9e('0x22')](function(_0x3d0a77){_0xbe9d19['where'](_0x0a9e('0xb5'),_[_0x0a9e('0x35')](_0x3d0a77,'id'));return db[_0x0a9e('0x93')]['query'](_0xbe9d19['toString'](),_0x30a4c7)[_0x0a9e('0x22')](function(_0x6ba2be){var _0x1707dc=_[_0x0a9e('0xb6')](_0x6ba2be,_0x0a9e('0xb7'));var _0x2450a8=[];return db[_0x0a9e('0xb8')][_0x0a9e('0x2e')]({'attributes':[_0x0a9e('0xb9')],'raw':!![]})['then'](function(_0x3156c7){var _0x517081=_0x3156c7[_0x0a9e('0xb9')];_0x3d0a77[_0x0a9e('0x2c')](function(_0x34e745){_0x2450a8[_0x0a9e('0xba')](updateMailInteraction(_0x34e745,_0x432fcc,_0x1707dc,_0x517081));});return BPromise[_0x0a9e('0xbb')](_0x2450a8);});});});})['then'](function(_0x436313){_0x31916f[_0x0a9e('0xbc')]=_0x436313;return _0x31916f;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x381c37,_0x1ef87a));})[_0x0a9e('0x33')](handleError(_0x381c37,null));};exports[_0x0a9e('0xbd')]=function(_0x5c66ef,_0x4f074c){var _0x22a3cb={'raw':![],'where':{'id':_0x5c66ef[_0x0a9e('0xbe')]['id']}},_0x583662={};_0x583662[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0x2d')][_0x0a9e('0x36')]);_0x583662[_0x0a9e('0x39')]=_['keys'](_0x5c66ef['query']);_0x583662[_0x0a9e('0x3b')]=_['intersection'](_0x583662[_0x0a9e('0x38')],_0x583662['query']);_0x22a3cb[_0x0a9e('0x3c')]=_['intersection'](_0x583662['model'],qs[_0x0a9e('0x3d')](_0x5c66ef[_0x0a9e('0x39')]['fields']));_0x22a3cb[_0x0a9e('0x3c')]=_0x22a3cb[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x22a3cb[_0x0a9e('0x3c')]:_0x583662[_0x0a9e('0x38')];if(_0x5c66ef['query']['includeAll']){_0x22a3cb[_0x0a9e('0xbf')]=[{'all':!![]}];}_0x22a3cb=_[_0x0a9e('0xc0')]({},_0x22a3cb,_0x5c66ef[_0x0a9e('0xc1')]);return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')](_0x22a3cb)['then'](handleEntityNotFound(_0x4f074c,null))[_0x0a9e('0x22')](respondWithResult(_0x4f074c,null))[_0x0a9e('0x33')](handleError(_0x4f074c,null));};exports['create']=function(_0x3c313d,_0x19fd11){return db[_0x0a9e('0x2d')][_0x0a9e('0xc2')](_0x3c313d[_0x0a9e('0xc3')],{})[_0x0a9e('0x22')](respondWithResult(_0x19fd11,0xc9))[_0x0a9e('0x33')](handleError(_0x19fd11,null));};exports[_0x0a9e('0x20')]=function(_0x40dd2a,_0x16afb3){if(_0x40dd2a['body']['id']){delete _0x40dd2a[_0x0a9e('0xc3')]['id'];}return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x40dd2a[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x16afb3,null))['then'](saveUpdates(_0x40dd2a['body'],null))[_0x0a9e('0x22')](respondWithResult(_0x16afb3,null))[_0x0a9e('0x33')](handleError(_0x16afb3,null));};exports[_0x0a9e('0x21')]=function(_0x2fea95,_0x34f7b5){return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x2fea95[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x34f7b5,null))['then'](removeEntity(_0x34f7b5,null))[_0x0a9e('0x33')](handleError(_0x34f7b5,null));};exports['describe']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x2d')][_0x0a9e('0xc4')]()[_0x0a9e('0x22')](respondWithResult(_0x4799d4,null))['catch'](handleError(_0x4799d4,null));};exports[_0x0a9e('0xc5')]=function(_0x5ed560,_0x4383da,_0x2b1824){return db[_0x0a9e('0xc6')][_0x0a9e('0x5d')]({'where':{'id':_0x5ed560[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4383da,null))[_0x0a9e('0x22')](function(_0xe89aaa){if(_0xe89aaa){return _0xe89aaa[_0x0a9e('0xc5')](_0x5ed560[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x5ed560[_0x0a9e('0xc3')],[_0x0a9e('0xc7'),'id'])||{});}})[_0x0a9e('0x22')](respondWithResult(_0x4383da,null))[_0x0a9e('0x33')](handleError(_0x4383da,null));};exports['getMessages']=function(_0x556443,_0x6eaaf0,_0x5c4be0){var _0x1d999b={'raw':![],'where':{}};var _0x3428c9={};var _0x5d6b69={'count':0x0,'rows':[]};return db[_0x0a9e('0x2d')][_0x0a9e('0x2e')]({'where':{'id':_0x556443[_0x0a9e('0xbe')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x6eaaf0,null))['then'](function(_0x148fd9){if(_0x148fd9){_0x3428c9[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](db[_0x0a9e('0xc6')]['rawAttributes']);_0x3428c9[_0x0a9e('0x39')]=_[_0x0a9e('0x3a')](_0x556443[_0x0a9e('0x39')]);_0x3428c9['filters']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],_0x3428c9[_0x0a9e('0x39')]);_0x1d999b['attributes']=_[_0x0a9e('0xc9')](_0x3428c9[_0x0a9e('0x38')],qs[_0x0a9e('0x3d')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3d')]));_0x1d999b['attributes']=_0x1d999b[_0x0a9e('0x3c')][_0x0a9e('0x3e')]?_0x1d999b['attributes']:_0x3428c9[_0x0a9e('0x38')];if(!_0x556443[_0x0a9e('0x39')][_0x0a9e('0x3f')]('nolimit')){_0x1d999b['limit']=qs['limit'](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1d')]);_0x1d999b['offset']=qs[_0x0a9e('0x1c')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x1c')]);}_0x1d999b['order']=qs[_0x0a9e('0x41')](_0x556443[_0x0a9e('0x39')][_0x0a9e('0x41')]);_0x1d999b[_0x0a9e('0x42')]=qs[_0x0a9e('0x3b')](_[_0x0a9e('0x43')](_0x556443[_0x0a9e('0x39')],_0x3428c9[_0x0a9e('0x3b')]));_0x1d999b[_0x0a9e('0x42')]['MailInteractionId']=_0x148fd9['id'];if(_0x556443[_0x0a9e('0x39')]['filter']){_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],{'$or':_[_0x0a9e('0x35')](_0x1d999b[_0x0a9e('0x3c')],function(_0x344cd4){var _0x53d9fc={};_0x53d9fc[_0x344cd4]={'$like':'%'+_0x556443[_0x0a9e('0x39')][_0x0a9e('0x7b')]+'%'};return _0x53d9fc;})});}if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')]){var _0x51aa2f=_0x556443[_0x0a9e('0x39')][_0x0a9e('0x71')][_0x0a9e('0x2b')](',');var _0x1c9539={};_0x1c9539[_0x51aa2f[0x0]]={'$gte':moment(_0x51aa2f[0x1])[_0x0a9e('0xca')](_0x0a9e('0xcb'))};_0x1d999b[_0x0a9e('0x42')]=_[_0x0a9e('0xc0')](_0x1d999b[_0x0a9e('0x42')],_0x1c9539);}_0x1d999b=_[_0x0a9e('0xc0')]({},_0x1d999b,_0x556443['options']);return db[_0x0a9e('0xc6')][_0x0a9e('0x1b')]({'where':_0x1d999b[_0x0a9e('0x42')]})[_0x0a9e('0x22')](function(_0xea8bd1){_0x5d6b69[_0x0a9e('0x1b')]=_0xea8bd1;if(_0x556443[_0x0a9e('0x39')][_0x0a9e('0xcc')]){_0x1d999b['include']=[{'all':!![]}];}return db[_0x0a9e('0xc6')][_0x0a9e('0xcd')](_0x1d999b);})[_0x0a9e('0x22')](function(_0x5c65fc){_0x5d6b69[_0x0a9e('0xbc')]=_0x5c65fc;return _0x5d6b69;});}})[_0x0a9e('0x22')](respondWithFilteredResult(_0x6eaaf0,_0x1d999b))[_0x0a9e('0x33')](handleError(_0x6eaaf0,null));};exports[_0x0a9e('0xce')]=function(_0x370b5e,_0x1ba457,_0x424f1b){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x370b5e[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x1ba457,null))[_0x0a9e('0x22')](function(_0x446e6){if(_0x446e6){return _0x446e6[_0x0a9e('0xcf')](_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')],_[_0x0a9e('0xc8')](_0x370b5e['body'],[_0x0a9e('0xc7'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x0a9e('0x25'),_0x0a9e('0x46')],'where':{'id':_0x370b5e[_0x0a9e('0xc3')][_0x0a9e('0xc7')]}});})['then'](function(_0x4156a5){socket[_0x0a9e('0xd0')](_0x0a9e('0xd1'),{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]});return{'id':Number(_0x370b5e[_0x0a9e('0xbe')]['id']),'tags':_0x4156a5||[]};});}})['then'](respondWithResult(_0x1ba457,null))['catch'](handleError(_0x1ba457,null));};exports[_0x0a9e('0xd2')]=function(_0x33bcb2,_0x2a293f,_0x5e85d0){return db[_0x0a9e('0x2d')][_0x0a9e('0x5d')]({'where':{'id':_0x33bcb2[_0x0a9e('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2a293f,null))[_0x0a9e('0x22')](function(_0x2bf85d){if(_0x2bf85d){return _0x2bf85d[_0x0a9e('0xd2')](_0x33bcb2['query'][_0x0a9e('0xc7')]);}})[_0x0a9e('0x22')](respondWithStatusCode(_0x2a293f,null))[_0x0a9e('0x33')](handleError(_0x2a293f,null));};exports['download']=function(_0x549697,_0x53ef46){var _0x3b04fd=moment()[_0x0a9e('0xd3')]()[_0x0a9e('0x94')]();var _0x26931c=path['join'](config[_0x0a9e('0xd4')],'server',_0x0a9e('0xd5'),_0x0a9e('0xd6'));var _0x242f23=path['join'](config[_0x0a9e('0xd4')],_0x0a9e('0xd7'),_0x0a9e('0xd5'),'attachments');var _0x40eb5d=path['join'](_0x26931c,_0x3b04fd);var _0x1b637c=util['format'](_0x0a9e('0xd8'),_0x549697['params']['id'],_0x3b04fd);var _0xb14971=path[_0x0a9e('0xd9')](_0x26931c,_0x1b637c);var _0xa288e4=[];if(_0x549697[_0x0a9e('0x39')][_0x0a9e('0xda')]){_0xa288e4[_0x0a9e('0xba')]({'model':db[_0x0a9e('0xdb')],'as':'Attachments','raw':!![]});}var _0x35ace3=[{'model':db[_0x0a9e('0xc6')],'as':'Messages','attributes':['id',_0x0a9e('0xc3'),_0x0a9e('0x47'),'to','cc','bcc',_0x0a9e('0xdc'),_0x0a9e('0x6f')],'where':{'secret':![]},'order':qs[_0x0a9e('0x41')]('id'),'include':_0xa288e4}];return db['MailInteraction'][_0x0a9e('0x5d')]({'where':{'id':_0x549697[_0x0a9e('0xbe')]['id']},'include':_0x35ace3})[_0x0a9e('0x22')](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x22')](function(_0x2003bc){if(_0x2003bc&&_0x2003bc[_0x0a9e('0xdd')]){var _0x3ba897=_0x2003bc[_0x0a9e('0xde')]({'plain':!![]});fs[_0x0a9e('0xdf')](_0x40eb5d);return BPromise[_0x0a9e('0xe0')](_0x3ba897['Messages'],function(_0x1799d8,_0x53c7de){var _0x3c9854={'from':_0x1799d8[_0x0a9e('0x47')],'to':_0x1799d8['to'],'subject':_0x1799d8[_0x0a9e('0xdc')],'html':_0x1799d8[_0x0a9e('0xc3')],'headers':{'Date':moment(_0x1799d8[_0x0a9e('0x6f')])[_0x0a9e('0xca')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1799d8['cc']){_0x3c9854[_0x0a9e('0xe1')]['Cc']=_0x1799d8['cc'];}if(_0x1799d8[_0x0a9e('0xe2')]){_0x3c9854[_0x0a9e('0xe1')]['Bcc']=_0x1799d8[_0x0a9e('0xe2')];}return new BPromise(function(_0x402544,_0x4435d2){if(_0x1799d8[_0x0a9e('0xe3')]){for(var _0x31e1e0=0x0;_0x31e1e0<_0x1799d8[_0x0a9e('0xe3')][_0x0a9e('0x3e')];_0x31e1e0++){var _0x5f2c51=_0x1799d8[_0x0a9e('0xe3')][_0x31e1e0];var _0x228c10=path[_0x0a9e('0xd9')](_0x242f23,_0x5f2c51[_0x0a9e('0xe4')]);if(fs[_0x0a9e('0xe5')](_0x228c10)){_0x3c9854[_0x0a9e('0xda')][_0x0a9e('0xba')]({'name':_0x5f2c51['name'],'contentType':_0x5f2c51['type'],'data':fs[_0x0a9e('0xe6')](_0x228c10)});}}}emlformat[_0x0a9e('0xe7')](_0x3c9854,function(_0x1f4929,_0x1bf692){if(_0x1f4929)return _0x4435d2(_0x1f4929);fs[_0x0a9e('0xe8')](path[_0x0a9e('0xd9')](_0x40eb5d,util[_0x0a9e('0xca')]('message%d.eml',_0x53c7de)),_0x1bf692);return _0x402544(_0x1bf692);});});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x1d7fc4,_0x2d8e91){zipdir(_0x40eb5d,{'saveTo':_0xb14971},function(_0x2675a5,_0x1b1757){if(_0x2675a5)return _0x2d8e91(_0x2675a5);return _0x1d7fc4(_0x1b1757);});})[_0x0a9e('0x22')](function(){return new BPromise(function(_0x16be7e,_0x54f0b8){rimraf(_0x40eb5d,function(_0x311288){if(_0x311288)_0x54f0b8(_0x311288);return _0x16be7e();});});})[_0x0a9e('0x22')](function(){return _0x53ef46[_0x0a9e('0xe9')](_0xb14971,_0x1b637c,function(_0x5885c3){if(_0x5885c3){console[_0x0a9e('0xea')](_0x0a9e('0xeb'),_0x5885c3);}else{fs[_0x0a9e('0xec')](_0xb14971);}});});});}else{return _0x53ef46[_0x0a9e('0x23')](0xc8);}})['catch'](handleError(_0x53ef46,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 6672de2..4985349 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 _0x7721=['length','emit','catch','hasOwnProperty','exports','events','MailInteraction','../../mysqldb','MailMessage','update','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages'];(function(_0x1449ed,_0x5293b0){var _0x5ea2aa=function(_0x558b0b){while(--_0x558b0b){_0x1449ed['push'](_0x1449ed['shift']());}};_0x5ea2aa(++_0x5293b0);}(_0x7721,0x1e1));var _0x1772=function(_0x354f3a,_0x18eb78){_0x354f3a=_0x354f3a-0x0;var _0x30ef9f=_0x7721[_0x354f3a];return _0x30ef9f;};'use strict';var EventEmitter=require(_0x1772('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x1772('0x1')];var MailMessage=require(_0x1772('0x2'))['db'][_0x1772('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1772('0x4'),'afterDestroy':_0x1772('0x5')};function emitEvent(_0x56b254){return function(_0x1021ab,_0x4dde2d,_0x337186){_0x1021ab[_0x1772('0x6')]({'attributes':['id'],'raw':!![]})[_0x1772('0x7')](function(_0x14e7d4){_0x1021ab[_0x1772('0x8')](_0x1772('0x9'),_0x14e7d4['map'](function(_0x57d32e){return{'id':_0x57d32e['id']};}));return MailMessage[_0x1772('0xa')]({'where':{'MailInteractionId':_0x1021ab['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1772('0x7')](function(_0x504226){_0x1021ab[_0x1772('0x8')](_0x1772('0xb'),_0x504226[_0x1772('0xc')]);MailInteractionEvents[_0x1772('0xd')](_0x56b254+':'+_0x1021ab['id'],_0x1021ab);MailInteractionEvents['emit'](_0x56b254,_0x1021ab);_0x337186(null);})[_0x1772('0xe')](_0x337186(null));};}for(var e in events){if(events[_0x1772('0xf')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x1772('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x7e4e=['map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','setMaxListeners','update','remove','then','setDataValue'];(function(_0x256432,_0x5e9a18){var _0x2849e7=function(_0xfeab60){while(--_0xfeab60){_0x256432['push'](_0x256432['shift']());}};_0x2849e7(++_0x5e9a18);}(_0x7e4e,0x118));var _0xe7e4=function(_0x5c0dcb,_0x16cd83){_0x5c0dcb=_0x5c0dcb-0x0;var _0x183a0e=_0x7e4e[_0x5c0dcb];return _0x183a0e;};'use strict';var EventEmitter=require(_0xe7e4('0x0'));var MailInteraction=require(_0xe7e4('0x1'))['db'][_0xe7e4('0x2')];var MailMessage=require(_0xe7e4('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xe7e4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe7e4('0x4'),'afterDestroy':_0xe7e4('0x5')};function emitEvent(_0x4ee46f){return function(_0x2e7667,_0x2261fb,_0x1402fa){_0x2e7667['getUsers']({'attributes':['id'],'raw':!![]})[_0xe7e4('0x6')](function(_0x3cc2d8){_0x2e7667[_0xe7e4('0x7')]('Users',_0x3cc2d8[_0xe7e4('0x8')](function(_0x3427ca){return{'id':_0x3427ca['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x2e7667['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x40b5dd){_0x2e7667['setDataValue'](_0xe7e4('0x9'),_0x40b5dd[_0xe7e4('0xa')]);MailInteractionEvents['emit'](_0x4ee46f+':'+_0x2e7667['id'],_0x2e7667);MailInteractionEvents[_0xe7e4('0xb')](_0x4ee46f,_0x2e7667);_0x1402fa(null);})[_0xe7e4('0xc')](_0x1402fa(null));};}for(var e in events){if(events[_0xe7e4('0xd')](e)){var event=events[e];MailInteraction[_0xe7e4('0xe')](e,emitEvent(event));}}module[_0xe7e4('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 357fdc3..36a4e47 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 _0xedd9=['subject','FULLTEXT','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','changed','substatus','get','update','catch','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','MailInteraction','fti_mail_interactions'];(function(_0x35a543,_0xc66455){var _0x301ab6=function(_0x1f3821){while(--_0x1f3821){_0x35a543['push'](_0x35a543['shift']());}};_0x301ab6(++_0xc66455);}(_0xedd9,0xfc));var _0x9edd=function(_0x59f77e,_0x150a49){_0x59f77e=_0x59f77e-0x0;var _0x465587=_0xedd9[_0x59f77e];return _0x465587;};'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':'mail_interactions','paranoid':![],'indexes':[{'name':_0x9edd('0xb'),'fields':[_0x9edd('0xc'),'to'],'type':_0x9edd('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3280fd,_0x49d5e3,_0x494a24){if(_0x3280fd['substatus']){_0x3280fd[_0x9edd('0xe')]=moment()[_0x9edd('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3280fd[_0x9edd('0x10')]){_0x3280fd[_0x9edd('0x11')]=moment()['format'](_0x9edd('0x12'));}_0x494a24(null,_0x49d5e3);},'beforeUpdate':function(_0x1b73d1,_0x25e64c,_0xfd544a){if(_0x1b73d1[_0x9edd('0x13')](_0x9edd('0x14'))){_0x1b73d1[_0x9edd('0xe')]=_0x1b73d1[_0x9edd('0x14')]?moment()['format'](_0x9edd('0x12')):null;}if(_0x1b73d1[_0x9edd('0x13')](_0x9edd('0x10'))){_0x1b73d1[_0x9edd('0x11')]=moment()[_0x9edd('0xf')](_0x9edd('0x12'));_0x1b73d1[_0x9edd('0x14')]=null;_0x1b73d1[_0x9edd('0xe')]=null;}_0xfd544a(null,_0x1b73d1);},'afterUpdate':function(_0x4ea60f,_0x5f5bf4,_0x448996){var _0x449cee=_0x268f9e['models'];var _0x1b54c0=_0x4ea60f[_0x9edd('0x15')]({'plain':!![]});if(_0x1b54c0[_0x9edd('0x10')]){return _0x449cee['MailMessage'][_0x9edd('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x1b54c0['id']}})['then'](function(){_0x448996();})[_0x9edd('0x17')](function(_0x1083e4){_0x448996(_0x1083e4);});}else{_0x448996();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7217=['api','moment','bluebird','request-promise','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x4e9b94,_0x37c164){var _0x908533=function(_0x17b66c){while(--_0x17b66c){_0x4e9b94['push'](_0x4e9b94['shift']());}};_0x908533(++_0x37c164);}(_0x7217,0x19e));var _0x7721=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7217[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[{'name':_0x7721('0xc'),'fields':[_0x7721('0xd'),'to'],'type':_0x7721('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2a66cb,_0xfa8835,_0x138740){if(_0x2a66cb[_0x7721('0xf')]){_0x2a66cb['substatusAt']=moment()[_0x7721('0x10')](_0x7721('0x11'));}if(_0x2a66cb[_0x7721('0x12')]){_0x2a66cb[_0x7721('0x13')]=moment()[_0x7721('0x10')](_0x7721('0x11'));}_0x138740(null,_0xfa8835);},'beforeUpdate':function(_0x1e7fd7,_0x27b36b,_0x55b4ca){if(_0x1e7fd7[_0x7721('0x14')](_0x7721('0xf'))){_0x1e7fd7['substatusAt']=_0x1e7fd7[_0x7721('0xf')]?moment()[_0x7721('0x10')](_0x7721('0x11')):null;}if(_0x1e7fd7[_0x7721('0x14')]('closed')){_0x1e7fd7[_0x7721('0x13')]=moment()[_0x7721('0x10')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e7fd7['substatus']=null;_0x1e7fd7['substatusAt']=null;}_0x55b4ca(null,_0x1e7fd7);},'afterUpdate':function(_0x5ed54,_0x25a628,_0x3cc909){var _0x32550d=_0x3fe47c['models'];var _0x20f669=_0x5ed54['get']({'plain':!![]});if(_0x20f669[_0x7721('0x12')]){return _0x32550d['MailMessage'][_0x7721('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x20f669['id']}})[_0x7721('0x16')](function(){_0x3cc909();})[_0x7721('0x17')](function(_0x3e140d){_0x3cc909(_0x3e140d);});}else{_0x3cc909();}}},'charset':_0x7721('0x18'),'collate':_0x7721('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index b4f7453..d8bae2a 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 _0x7980=['spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailInteraction','update','body','options','where','attributes','limit','UpdateMailInteraction','AddTagsToMailInteraction','find','omit','ids'];(function(_0x357921,_0x4c0ea0){var _0x5c0950=function(_0x2790fb){while(--_0x2790fb){_0x357921['push'](_0x357921['shift']());}};_0x5c0950(++_0x4c0ea0);}(_0x7980,0xab));var _0x0798=function(_0x3337d0,_0x4cf1d8){_0x3337d0=_0x3337d0-0x0;var _0x3e68f5=_0x7980[_0x3337d0];return _0x3e68f5;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var moment=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var rs=require(_0x0798('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0798('0x5'))['db'];var utils=require(_0x0798('0x6'));var logger=require(_0x0798('0x7'))(_0x0798('0x8'));var config=require(_0x0798('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0798('0xa')]['http']({'port':0x232a});config[_0x0798('0xb')]=_[_0x0798('0xc')](config[_0x0798('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0798('0xb')]));require(_0x0798('0xd'))[_0x0798('0xe')](socket);function respondWithRpcPromise(_0x1601f2,_0x53e9a1,_0x181c33){return new BPromise(function(_0x44e8df,_0xc9b741){return client[_0x0798('0xf')](_0x1601f2,_0x181c33)[_0x0798('0x10')](function(_0x597e45){logger[_0x0798('0x11')](_0x0798('0x12'),_0x53e9a1,'request\x20sent');logger['debug'](_0x0798('0x13'),_0x53e9a1,_0x0798('0x14'),JSON[_0x0798('0x15')](_0x597e45));if(_0x597e45[_0x0798('0x16')]){if(_0x597e45[_0x0798('0x16')][_0x0798('0x17')]===0x1f4){logger[_0x0798('0x16')]('MailInteraction,\x20%s,\x20%s',_0x53e9a1,_0x597e45['error'][_0x0798('0x18')]);return _0xc9b741(_0x597e45[_0x0798('0x16')]['message']);}logger['error'](_0x0798('0x12'),_0x53e9a1,_0x597e45[_0x0798('0x16')][_0x0798('0x18')]);return _0x44e8df(_0x597e45['error']['message']);}else{logger[_0x0798('0x11')]('MailInteraction,\x20%s,\x20%s',_0x53e9a1,_0x0798('0x14'));_0x44e8df(_0x597e45[_0x0798('0x19')][_0x0798('0x18')]);}})[_0x0798('0x1a')](function(_0x4d1545){logger[_0x0798('0x16')](_0x0798('0x12'),_0x53e9a1,_0x4d1545);_0xc9b741(_0x4d1545);});});}exports['UpdateMailInteraction']=function(_0xd2a2a){var _0x64536=this;return new Promise(function(_0x45d512,_0x44ac33){return db[_0x0798('0x1b')][_0x0798('0x1c')](_0xd2a2a[_0x0798('0x1d')],{'raw':_0xd2a2a[_0x0798('0x1e')]?_0xd2a2a[_0x0798('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd2a2a[_0x0798('0x1e')]?_0xd2a2a[_0x0798('0x1e')][_0x0798('0x1f')]||null:null,'attributes':_0xd2a2a[_0x0798('0x1e')]?_0xd2a2a[_0x0798('0x1e')][_0x0798('0x20')]||null:null,'limit':_0xd2a2a['options']?_0xd2a2a[_0x0798('0x1e')][_0x0798('0x21')]||null:null})[_0x0798('0x10')](function(_0xd5e027){logger[_0x0798('0x11')](_0x0798('0x22'),_0xd2a2a);logger['debug'](_0x0798('0x22'),_0xd2a2a,JSON[_0x0798('0x15')](_0xd5e027));_0x45d512(_0xd5e027);})[_0x0798('0x1a')](function(_0x4d4e0a){logger[_0x0798('0x16')]('UpdateMailInteraction',_0x4d4e0a['message'],_0xd2a2a);_0x44ac33(_0x64536[_0x0798('0x16')](0x1f4,_0x4d4e0a[_0x0798('0x18')]));});});};exports[_0x0798('0x23')]=function(_0xaa949b){return new Promise(function(_0x11b7f4,_0x161244){return db[_0x0798('0x1b')][_0x0798('0x24')]({'where':_0xaa949b['options']?_0xaa949b[_0x0798('0x1e')]['where']||null:null})['then'](function(_0x1196c0){if(_0x1196c0){return _0x1196c0['addTags'](_0xaa949b[_0x0798('0x1d')]['ids'],_[_0x0798('0x25')](_0xaa949b[_0x0798('0x1d')],[_0x0798('0x26'),'id'])||{});}})[_0x0798('0x27')](function(_0x2eaaeb){logger[_0x0798('0x11')](_0x0798('0x28'),_0xaa949b);logger[_0x0798('0x29')](_0x0798('0x28'),_0xaa949b,JSON[_0x0798('0x15')](_0x2eaaeb));_0x11b7f4(_0x2eaaeb);})[_0x0798('0x1a')](function(_0x21de23){logger['error'](_0x0798('0x28'),_0x21de23['message'],_0xaa949b);_0x161244(_this['error'](0x1f4,_0x21de23[_0x0798('0x18')]));});});}; \ No newline at end of file +var _0x867f=['attributes','limit','stringify','AddTagsToMailInteraction','find','then','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','request','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','MailInteraction,\x20%s,\x20%s','info','catch','UpdateMailInteraction','MailInteraction','update','body','options','raw','where'];(function(_0x4c22c2,_0x585a69){var _0x1b0704=function(_0x3fdccb){while(--_0x3fdccb){_0x4c22c2['push'](_0x4c22c2['shift']());}};_0x1b0704(++_0x585a69);}(_0x867f,0xe6));var _0xf867=function(_0x2c0557,_0x4314fd){_0x2c0557=_0x2c0557-0x0;var _0x2878cd=_0x867f[_0x2c0557];return _0x2878cd;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var moment=require(_0xf867('0x2'));var BPromise=require(_0xf867('0x3'));var rs=require(_0xf867('0x4'));var fs=require('fs');var Redis=require(_0xf867('0x5'));var db=require(_0xf867('0x6'))['db'];var utils=require(_0xf867('0x7'));var logger=require(_0xf867('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf867('0x9'));var client=jayson[_0xf867('0xa')][_0xf867('0xb')]({'port':0x232a});config[_0xf867('0xc')]=_[_0xf867('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf867('0xe'))(new Redis(config['redis']));require(_0xf867('0xf'))[_0xf867('0x10')](socket);function respondWithRpcPromise(_0x1cf341,_0xb26c33,_0x4a385d){return new BPromise(function(_0x462870,_0x43eeb2){return client[_0xf867('0x11')](_0x1cf341,_0x4a385d)['then'](function(_0x2ff341){logger['info']('MailInteraction,\x20%s,\x20%s',_0xb26c33,_0xf867('0x12'));logger[_0xf867('0x13')](_0xf867('0x14'),_0xb26c33,'request\x20sent',JSON['stringify'](_0x2ff341));if(_0x2ff341[_0xf867('0x15')]){if(_0x2ff341['error'][_0xf867('0x16')]===0x1f4){logger['error']('MailInteraction,\x20%s,\x20%s',_0xb26c33,_0x2ff341[_0xf867('0x15')][_0xf867('0x17')]);return _0x43eeb2(_0x2ff341[_0xf867('0x15')][_0xf867('0x17')]);}logger[_0xf867('0x15')](_0xf867('0x18'),_0xb26c33,_0x2ff341[_0xf867('0x15')][_0xf867('0x17')]);return _0x462870(_0x2ff341[_0xf867('0x15')]['message']);}else{logger[_0xf867('0x19')]('MailInteraction,\x20%s,\x20%s',_0xb26c33,_0xf867('0x12'));_0x462870(_0x2ff341['result']['message']);}})[_0xf867('0x1a')](function(_0x59ea7e){logger['error'](_0xf867('0x18'),_0xb26c33,_0x59ea7e);_0x43eeb2(_0x59ea7e);});});}exports[_0xf867('0x1b')]=function(_0x55068f){var _0x4bdabc=this;return new Promise(function(_0xd503ca,_0x23e7dd){return db[_0xf867('0x1c')][_0xf867('0x1d')](_0x55068f[_0xf867('0x1e')],{'raw':_0x55068f[_0xf867('0x1f')]?_0x55068f[_0xf867('0x1f')][_0xf867('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55068f['options']?_0x55068f['options'][_0xf867('0x21')]||null:null,'attributes':_0x55068f['options']?_0x55068f[_0xf867('0x1f')][_0xf867('0x22')]||null:null,'limit':_0x55068f['options']?_0x55068f[_0xf867('0x1f')][_0xf867('0x23')]||null:null})['then'](function(_0x231076){logger[_0xf867('0x19')](_0xf867('0x1b'),_0x55068f);logger[_0xf867('0x13')](_0xf867('0x1b'),_0x55068f,JSON[_0xf867('0x24')](_0x231076));_0xd503ca(_0x231076);})[_0xf867('0x1a')](function(_0x2efca3){logger[_0xf867('0x15')](_0xf867('0x1b'),_0x2efca3[_0xf867('0x17')],_0x55068f);_0x23e7dd(_0x4bdabc[_0xf867('0x15')](0x1f4,_0x2efca3[_0xf867('0x17')]));});});};exports[_0xf867('0x25')]=function(_0x327a13){return new Promise(function(_0x3ed616,_0x57bf28){return db[_0xf867('0x1c')][_0xf867('0x26')]({'where':_0x327a13[_0xf867('0x1f')]?_0x327a13[_0xf867('0x1f')][_0xf867('0x21')]||null:null})[_0xf867('0x27')](function(_0x1979c5){if(_0x1979c5){return _0x1979c5['addTags'](_0x327a13[_0xf867('0x1e')][_0xf867('0x28')],_[_0xf867('0x29')](_0x327a13[_0xf867('0x1e')],[_0xf867('0x28'),'id'])||{});}})[_0xf867('0x2a')](function(_0x76232a){logger[_0xf867('0x19')]('AddTags',_0x327a13);logger[_0xf867('0x13')]('AddTags',_0x327a13,JSON[_0xf867('0x24')](_0x76232a));_0x3ed616(_0x76232a);})['catch'](function(_0x3b3ccf){logger[_0xf867('0x15')](_0xf867('0x2b'),_0x3b3ccf['message'],_0x327a13);_0x57bf28(_this[_0xf867('0x15')](0x1f4,_0x3b3ccf[_0xf867('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index d03b617..475b4cc 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 _0x8bfa=['save','update','emit','removeListener','register','length','./mailInteraction.events'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0x8bfa,0x125));var _0xa8bf=function(_0x1627cd,_0x2a9058){_0x1627cd=_0x1627cd-0x0;var _0x3d7971=_0x8bfa[_0x1627cd];return _0x3d7971;};'use strict';var MailInteractionEvents=require(_0xa8bf('0x0'));var events=[_0xa8bf('0x1'),'remove',_0xa8bf('0x2')];function createListener(_0x17e896,_0x12421e){return function(_0x514a76){_0x12421e[_0xa8bf('0x3')](_0x17e896,_0x514a76);};}function removeListener(_0x18f8fd,_0x413081){return function(){MailInteractionEvents[_0xa8bf('0x4')](_0x18f8fd,_0x413081);};}exports[_0xa8bf('0x5')]=function(_0x3a2286){for(var _0x2b1a9c=0x0,_0x1bc17a=events[_0xa8bf('0x6')];_0x2b1a9c<_0x1bc17a;_0x2b1a9c++){var _0x5c236c=events[_0x2b1a9c];var _0x4fc485=createListener('mailInteraction:'+_0x5c236c,_0x3a2286);MailInteractionEvents['on'](_0x5c236c,_0x4fc485);}}; \ No newline at end of file +var _0x6789=['save','update','emit','removeListener','length','mailInteraction:','./mailInteraction.events'];(function(_0x5dd709,_0x23f8c9){var _0x40ac82=function(_0x51102c){while(--_0x51102c){_0x5dd709['push'](_0x5dd709['shift']());}};_0x40ac82(++_0x23f8c9);}(_0x6789,0xae));var _0x9678=function(_0x479fe5,_0x5bb4f7){_0x479fe5=_0x479fe5-0x0;var _0x362922=_0x6789[_0x479fe5];return _0x362922;};'use strict';var MailInteractionEvents=require(_0x9678('0x0'));var events=[_0x9678('0x1'),'remove',_0x9678('0x2')];function createListener(_0x2cc409,_0x10fa0a){return function(_0x4d6584){_0x10fa0a[_0x9678('0x3')](_0x2cc409,_0x4d6584);};}function removeListener(_0x5829c0,_0x34af2b){return function(){MailInteractionEvents[_0x9678('0x4')](_0x5829c0,_0x34af2b);};}exports['register']=function(_0xf037f9){for(var _0x26951f=0x0,_0x2c4828=events[_0x9678('0x5')];_0x26951f<_0x2c4828;_0x26951f++){var _0x2ba6c0=events[_0x26951f];var _0x3f4689=createListener(_0x9678('0x6')+_0x2ba6c0,_0xf037f9);MailInteractionEvents['on'](_0x2ba6c0,_0x3f4689);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index c10d0c9..5d30c32 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 _0xbec5=['/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','mail','mailmessage:create','create','put','/:id/accept','accept'];(function(_0x64f6b4,_0x555f90){var _0x274b2d=function(_0x10cec0){while(--_0x10cec0){_0x64f6b4['push'](_0x64f6b4['shift']());}};_0x274b2d(++_0x555f90);}(_0xbec5,0xe5));var _0x5bec=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0xbec5[_0x1f7996];return _0x584609;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var auth=require(_0x5bec('0x5'));var interaction=require(_0x5bec('0x6'));var config=require('../../config/environment');var controller=require(_0x5bec('0x7'));router[_0x5bec('0x8')]('/',auth[_0x5bec('0x9')](),controller['index']);router[_0x5bec('0x8')](_0x5bec('0xa'),auth[_0x5bec('0x9')](),controller[_0x5bec('0xb')]);router[_0x5bec('0x8')](_0x5bec('0xc'),auth[_0x5bec('0x9')](),controller[_0x5bec('0xd')]);router['get'](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0xf')]);router[_0x5bec('0x10')]('/',auth[_0x5bec('0x9')](),interaction['tracked'](_0x5bec('0x11'),_0x5bec('0x12')),controller[_0x5bec('0x13')]);router['put'](_0x5bec('0xc'),auth[_0x5bec('0x9')](),controller['update']);router[_0x5bec('0x14')](_0x5bec('0x15'),auth[_0x5bec('0x9')](),controller[_0x5bec('0x16')]);router[_0x5bec('0x14')](_0x5bec('0x17'),auth[_0x5bec('0x9')](),controller[_0x5bec('0x18')]);router[_0x5bec('0x19')](_0x5bec('0xc'),auth[_0x5bec('0x9')](),controller[_0x5bec('0x1a')]);module[_0x5bec('0x1b')]=router; \ No newline at end of file +var _0xf2ca=['mailmessage:create','create','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','isAuthenticated','index','get','/describe','describe','download','post'];(function(_0x4162b3,_0x5690ad){var _0x539297=function(_0x4be8b7){while(--_0x4be8b7){_0x4162b3['push'](_0x4162b3['shift']());}};_0x539297(++_0x5690ad);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0xf2ca[_0x454e6d];return _0x4bc294;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var auth=require(_0xaf2c('0x5'));var interaction=require(_0xaf2c('0x6'));var config=require(_0xaf2c('0x7'));var controller=require(_0xaf2c('0x8'));router['get']('/',auth[_0xaf2c('0x9')](),controller[_0xaf2c('0xa')]);router[_0xaf2c('0xb')](_0xaf2c('0xc'),auth['isAuthenticated'](),controller[_0xaf2c('0xd')]);router[_0xaf2c('0xb')]('/:id',auth[_0xaf2c('0x9')](),controller['show']);router[_0xaf2c('0xb')]('/:id/download',auth[_0xaf2c('0x9')](),controller[_0xaf2c('0xe')]);router[_0xaf2c('0xf')]('/',auth[_0xaf2c('0x9')](),interaction['tracked']('mail',_0xaf2c('0x10')),controller[_0xaf2c('0x11')]);router[_0xaf2c('0x12')](_0xaf2c('0x13'),auth[_0xaf2c('0x9')](),controller['update']);router['put'](_0xaf2c('0x14'),auth[_0xaf2c('0x9')](),controller[_0xaf2c('0x15')]);router[_0xaf2c('0x12')](_0xaf2c('0x16'),auth[_0xaf2c('0x9')](),controller[_0xaf2c('0x17')]);router[_0xaf2c('0x18')](_0xaf2c('0x13'),auth[_0xaf2c('0x9')](),controller[_0xaf2c('0x19')]);module[_0xaf2c('0x1a')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index aa4634b..6ea4ce8 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 _0x500c=['long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','sequelize','lodash','exports','TEXT'];(function(_0xd189dc,_0xb0d901){var _0xe86441=function(_0x20f8ce){while(--_0x20f8ce){_0xd189dc['push'](_0xd189dc['shift']());}};_0xe86441(++_0xb0d901);}(_0x500c,0x188));var _0xc500=function(_0x573eec,_0x4cf956){_0x573eec=_0x573eec-0x0;var _0x537d1f=_0x500c[_0x573eec];return _0x537d1f;};'use strict';var Sequelize=require(_0xc500('0x0'));var _=require(_0xc500('0x1'));module[_0xc500('0x2')]={'body':{'type':Sequelize[_0xc500('0x3')](_0xc500('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xc500('0x3')](_0xc500('0x5'))},'read':{'type':Sequelize[_0xc500('0x6')],'defaultValue':![]},'direction':{'type':Sequelize[_0xc500('0x7')]('in',_0xc500('0x8')),'defaultValue':_0xc500('0x8'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc500('0x9')](0x1fe)},'from':{'type':Sequelize[_0xc500('0x9')]},'to':{'type':Sequelize[_0xc500('0x3')](_0xc500('0x4'))},'cc':{'type':Sequelize['TEXT'](_0xc500('0x4'))},'bcc':{'type':Sequelize['TEXT'](_0xc500('0x4'))},'subject':{'type':Sequelize[_0xc500('0x3')]},'sentAt':{'type':Sequelize[_0xc500('0xa')]},'attach':{'type':Sequelize[_0xc500('0xb')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xc500('0x6')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xc500('0xa')]},'originTo':{'type':Sequelize['TEXT'](_0xc500('0x4'))},'originCc':{'type':Sequelize['TEXT'](_0xc500('0x4'))}}; \ No newline at end of file +var _0x4b11=['DATE','INTEGER','sequelize','lodash','exports','TEXT','medium','BOOLEAN','out','STRING','long'];(function(_0x47a601,_0x21a5e7){var _0x596144=function(_0x49a6f8){while(--_0x49a6f8){_0x47a601['push'](_0x47a601['shift']());}};_0x596144(++_0x21a5e7);}(_0x4b11,0xf4));var _0x14b1=function(_0x52311f,_0x4dd8c6){_0x52311f=_0x52311f-0x0;var _0x383c9f=_0x4b11[_0x52311f];return _0x383c9f;};'use strict';var Sequelize=require(_0x14b1('0x0'));var _=require(_0x14b1('0x1'));module[_0x14b1('0x2')]={'body':{'type':Sequelize[_0x14b1('0x3')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x14b1('0x3')](_0x14b1('0x4'))},'read':{'type':Sequelize[_0x14b1('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x14b1('0x6')),'defaultValue':_0x14b1('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x14b1('0x7')](0x1fe)},'from':{'type':Sequelize[_0x14b1('0x7')]},'to':{'type':Sequelize[_0x14b1('0x3')](_0x14b1('0x8'))},'cc':{'type':Sequelize[_0x14b1('0x3')](_0x14b1('0x8'))},'bcc':{'type':Sequelize[_0x14b1('0x3')](_0x14b1('0x8'))},'subject':{'type':Sequelize[_0x14b1('0x3')]},'sentAt':{'type':Sequelize[_0x14b1('0x9')]},'attach':{'type':Sequelize[_0x14b1('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x14b1('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x14b1('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x14b1('0x8'))},'originCc':{'type':Sequelize[_0x14b1('0x3')]('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 5f8a31c..05b91e3 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 _0x1ef3=['keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','includeAll','include','findAll','show','params','length','options','body','find','describe','create','direction','secret','split','MailAccount','CmList','List','CmContact','Contacts','updatedAt','MailServerOut','Smtp','host','port','secure','authentication','auth','pass','service','user','attachments','join','root','server/files/attachments','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','stringify','../../config/logger','accept','mail','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','MailInteractionId','read1stAt','get','role','interaction','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','acceptmessage','mail-interactions','agent','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','EventManager','rejectmessage','download','toString','server','files','tmp','message-%s.eml','from','bcc','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','build','log','err','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','register','jayson/promise','http','client','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~!@#$%^&-_=+[{]}.','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then','destroy','end','stack','name','index','map','MailMessage','rawAttributes','type','key','model','query'];(function(_0x21f98f,_0x3a67da){var _0x48fc8d=function(_0x91e5d){while(--_0x91e5d){_0x21f98f['push'](_0x21f98f['shift']());}};_0x48fc8d(++_0x3a67da);}(_0x1ef3,0x69));var _0x31ef=function(_0x58fcdd,_0x58e627){_0x58fcdd=_0x58fcdd-0x0;var _0x31f614=_0x1ef3[_0x58fcdd];return _0x31f614;};'use strict';var pdf=require(_0x31ef('0x0'));var emlformat=require(_0x31ef('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x31ef('0x2'));var jsonpatch=require(_0x31ef('0x3'));var rp=require(_0x31ef('0x4'));var moment=require('moment');var BPromise=require(_0x31ef('0x5'));var Mustache=require(_0x31ef('0x6'));var util=require('util');var path=require(_0x31ef('0x7'));var sox=require(_0x31ef('0x8'));var csv=require(_0x31ef('0x9'));var ejs=require(_0x31ef('0xa'));var fs=require('fs');var _=require(_0x31ef('0xb'));var squel=require(_0x31ef('0xc'));var crypto=require('crypto');var jsforce=require(_0x31ef('0xd'));var deskjs=require(_0x31ef('0xe'));var toCsv=require(_0x31ef('0x9'));var querystring=require(_0x31ef('0xf'));var Papa=require('papaparse');var Redis=require(_0x31ef('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x31ef('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x31ef('0x12'));var utils=require(_0x31ef('0x13'));var config=require(_0x31ef('0x14'));var db=require(_0x31ef('0x15'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x31ef('0x16')]));require('./mailMessage.socket')[_0x31ef('0x17')](socket);var jayson=require(_0x31ef('0x18'));var client=jayson['client'][_0x31ef('0x19')]({'port':0x232c});var client9003=jayson[_0x31ef('0x1a')][_0x31ef('0x19')]({'port':0x232b});var client9002=jayson[_0x31ef('0x1a')][_0x31ef('0x19')]({'port':0x232a});function checkPasswordPattern(_0x341912,_0x5d99f1,_0x5777fb){if(_0x5777fb){var _0x8910a9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x8910a9['test'](_0x5d99f1)){return _0x341912;}else{throw new db[(_0x31ef('0x1b'))][(_0x31ef('0x1c'))](_0x31ef('0x1d'));}}else{return _0x341912;}}function respondWithRpcPromise(_0xf71183,_0x987f38,_0x5d3d17,_0x256be4){return new BPromise(function(_0x44339d,_0x452043){var _0x1e8227=_0x256be4||client;return _0x1e8227['request'](_0xf71183,_0x5d3d17)['then'](function(_0x39a39f){logger[_0x31ef('0x1e')](_0x31ef('0x1f'),_0x987f38,_0x31ef('0x20'));logger['debug'](_0x31ef('0x21'),_0x987f38,_0x31ef('0x20'),JSON['stringify'](_0x39a39f));if(_0x39a39f[_0x31ef('0x22')]){if(_0x39a39f[_0x31ef('0x22')][_0x31ef('0x23')]===0x1f4){logger[_0x31ef('0x22')](_0x31ef('0x1f'),_0x987f38,_0x39a39f[_0x31ef('0x22')][_0x31ef('0x24')]);return _0x452043(_0x39a39f[_0x31ef('0x22')][_0x31ef('0x24')]);}logger[_0x31ef('0x22')]('MailMessage,\x20%s,\x20%s',_0x987f38,_0x39a39f['error'][_0x31ef('0x24')]);return _0x44339d(_0x39a39f['error'][_0x31ef('0x24')]);}else{logger[_0x31ef('0x1e')]('MailMessage,\x20%s,\x20%s',_0x987f38,_0x31ef('0x20'));_0x44339d(_0x39a39f['result'][_0x31ef('0x24')]);}})[_0x31ef('0x25')](function(_0x3ab05f){logger[_0x31ef('0x22')](_0x31ef('0x1f'),_0x987f38,_0x3ab05f);_0x452043(_0x3ab05f);});});}function respondWithStatusCode(_0x25e55e,_0x4c4f47){_0x4c4f47=_0x4c4f47||0xcc;return function(_0x13704a){if(_0x13704a){return _0x25e55e[_0x31ef('0x26')](_0x4c4f47);}return _0x25e55e['status'](_0x4c4f47)['end']();};}function respondWithResult(_0x21574a,_0x1d52f4){_0x1d52f4=_0x1d52f4||0xc8;return function(_0x4399dc){if(_0x4399dc){return _0x21574a[_0x31ef('0x27')](_0x1d52f4)[_0x31ef('0x28')](_0x4399dc);}};}function respondWithFilteredResult(_0x3de402,_0xc35e69){return function(_0x423e19){if(_0x423e19){var _0xce815b=_0x423e19['count'],_0x13e95b=_0xc35e69[_0x31ef('0x29')],_0x4dbb4c=_0xc35e69[_0x31ef('0x29')]+_0xc35e69[_0x31ef('0x2a')],_0x565942;if(_0x4dbb4c>=_0xce815b){_0x4dbb4c=_0xce815b;_0x565942=0xc8;}else{_0x565942=0xce;}_0x3de402['status'](_0x565942);return _0x3de402[_0x31ef('0x2b')]('Content-Range',_0x13e95b+'-'+_0x4dbb4c+'/'+_0xce815b)['json'](_0x423e19);}return null;};}function patchUpdates(_0x257275){return function(_0x80a560){try{jsonpatch[_0x31ef('0x2c')](_0x80a560,_0x257275,!![]);}catch(_0x44f6d6){return BPromise[_0x31ef('0x2d')](_0x44f6d6);}return _0x80a560[_0x31ef('0x2e')]();};}function saveUpdates(_0x521708,_0x4a4d8c){return function(_0x3ac151){if(_0x3ac151){return _0x3ac151[_0x31ef('0x2f')](_0x521708)[_0x31ef('0x30')](function(_0x4f4604){return _0x4f4604;});}return null;};}function removeEntity(_0x4ea4cb,_0x4d4fb8){return function(_0x31bef3){if(_0x31bef3){return _0x31bef3[_0x31ef('0x31')]()[_0x31ef('0x30')](function(){_0x4ea4cb[_0x31ef('0x27')](0xcc)[_0x31ef('0x32')]();});}};}function handleEntityNotFound(_0x30989b,_0x2753cd){return function(_0x1316f4){if(!_0x1316f4){_0x30989b['sendStatus'](0x194);}return _0x1316f4;};}function handleError(_0x179bc9,_0x44f474){_0x44f474=_0x44f474||0x1f4;return function(_0x18a5bf){logger[_0x31ef('0x22')](_0x18a5bf[_0x31ef('0x33')]);if(_0x18a5bf[_0x31ef('0x34')]){delete _0x18a5bf[_0x31ef('0x34')];}_0x179bc9['status'](_0x44f474)['send'](_0x18a5bf);};}exports[_0x31ef('0x35')]=function(_0xf0b957,_0x48c2f8){var _0x12919f={},_0x3581db={},_0x5ea27e={'count':0x0,'rows':[]};var _0x270428=_[_0x31ef('0x36')](db[_0x31ef('0x37')][_0x31ef('0x38')],function(_0x102736){return{'name':_0x102736['fieldName'],'type':_0x102736[_0x31ef('0x39')][_0x31ef('0x3a')]};});_0x3581db[_0x31ef('0x3b')]=_[_0x31ef('0x36')](_0x270428,_0x31ef('0x34'));_0x3581db[_0x31ef('0x3c')]=_[_0x31ef('0x3d')](_0xf0b957[_0x31ef('0x3c')]);_0x3581db['filters']=_[_0x31ef('0x3e')](_0x3581db[_0x31ef('0x3b')],_0x3581db[_0x31ef('0x3c')]);_0x12919f[_0x31ef('0x3f')]=_['intersection'](_0x3581db['model'],qs[_0x31ef('0x40')](_0xf0b957[_0x31ef('0x3c')][_0x31ef('0x40')]));_0x12919f[_0x31ef('0x3f')]=_0x12919f[_0x31ef('0x3f')]['length']?_0x12919f[_0x31ef('0x3f')]:_0x3581db[_0x31ef('0x3b')];if(!_0xf0b957[_0x31ef('0x3c')]['hasOwnProperty'](_0x31ef('0x41'))){_0x12919f['limit']=qs[_0x31ef('0x2a')](_0xf0b957[_0x31ef('0x3c')][_0x31ef('0x2a')]);_0x12919f['offset']=qs[_0x31ef('0x29')](_0xf0b957[_0x31ef('0x3c')][_0x31ef('0x29')]);}_0x12919f[_0x31ef('0x42')]=qs['sort'](_0xf0b957[_0x31ef('0x3c')][_0x31ef('0x43')]);_0x12919f[_0x31ef('0x44')]=qs[_0x31ef('0x45')](_['pick'](_0xf0b957['query'],_0x3581db[_0x31ef('0x45')]),_0x270428);if(_0xf0b957[_0x31ef('0x3c')][_0x31ef('0x46')]){_0x12919f[_0x31ef('0x44')]=_['merge'](_0x12919f[_0x31ef('0x44')],{'$or':_[_0x31ef('0x36')](_0x270428,function(_0x140e4e){if(_0x140e4e[_0x31ef('0x39')]!==_0x31ef('0x47')){var _0x19d280={};_0x19d280[_0x140e4e['name']]={'$like':'%'+_0xf0b957['query'][_0x31ef('0x46')]+'%'};return _0x19d280;}})});}_0x12919f=_[_0x31ef('0x48')]({},_0x12919f,_0xf0b957['options']);var _0x2f7c74={'where':_0x12919f[_0x31ef('0x44')]};return db[_0x31ef('0x37')]['count'](_0x2f7c74)[_0x31ef('0x30')](function(_0x1ac151){_0x5ea27e['count']=_0x1ac151;if(_0xf0b957[_0x31ef('0x3c')][_0x31ef('0x49')]){_0x12919f[_0x31ef('0x4a')]=[{'all':!![]}];}return db['MailMessage'][_0x31ef('0x4b')](_0x12919f);})[_0x31ef('0x30')](function(_0x5dd5fb){_0x5ea27e['rows']=_0x5dd5fb;return _0x5ea27e;})[_0x31ef('0x30')](respondWithFilteredResult(_0x48c2f8,_0x12919f))[_0x31ef('0x25')](handleError(_0x48c2f8,null));};exports[_0x31ef('0x4c')]=function(_0x1a6bd0,_0x48421c){var _0x43d863={'raw':!![],'where':{'id':_0x1a6bd0[_0x31ef('0x4d')]['id']}},_0x83809c={};_0x83809c[_0x31ef('0x3b')]=_[_0x31ef('0x3d')](db[_0x31ef('0x37')][_0x31ef('0x38')]);_0x83809c[_0x31ef('0x3c')]=_['keys'](_0x1a6bd0[_0x31ef('0x3c')]);_0x83809c[_0x31ef('0x45')]=_[_0x31ef('0x3e')](_0x83809c['model'],_0x83809c[_0x31ef('0x3c')]);_0x43d863[_0x31ef('0x3f')]=_[_0x31ef('0x3e')](_0x83809c['model'],qs[_0x31ef('0x40')](_0x1a6bd0[_0x31ef('0x3c')][_0x31ef('0x40')]));_0x43d863[_0x31ef('0x3f')]=_0x43d863['attributes'][_0x31ef('0x4e')]?_0x43d863['attributes']:_0x83809c[_0x31ef('0x3b')];if(_0x1a6bd0[_0x31ef('0x3c')][_0x31ef('0x49')]){_0x43d863[_0x31ef('0x4a')]=[{'all':!![]}];}_0x43d863=_[_0x31ef('0x48')]({},_0x43d863,_0x1a6bd0[_0x31ef('0x4f')]);return db[_0x31ef('0x37')]['find'](_0x43d863)[_0x31ef('0x30')](handleEntityNotFound(_0x48421c,null))[_0x31ef('0x30')](respondWithResult(_0x48421c,null))[_0x31ef('0x25')](handleError(_0x48421c,null));};exports[_0x31ef('0x2f')]=function(_0x2766ca,_0x434717){if(_0x2766ca['body']['id']){delete _0x2766ca[_0x31ef('0x50')]['id'];}return db[_0x31ef('0x37')][_0x31ef('0x51')]({'where':{'id':_0x2766ca['params']['id']}})['then'](handleEntityNotFound(_0x434717,null))[_0x31ef('0x30')](saveUpdates(_0x2766ca['body'],null))[_0x31ef('0x30')](respondWithResult(_0x434717,null))['catch'](handleError(_0x434717,null));};exports['destroy']=function(_0x3c9f53,_0x5447f2){return db[_0x31ef('0x37')][_0x31ef('0x51')]({'where':{'id':_0x3c9f53['params']['id']}})['then'](handleEntityNotFound(_0x5447f2,null))['then'](removeEntity(_0x5447f2,null))[_0x31ef('0x25')](handleError(_0x5447f2,null));};exports[_0x31ef('0x52')]=function(_0x14be97,_0x1097bb){return db[_0x31ef('0x37')]['describe']()[_0x31ef('0x30')](respondWithResult(_0x1097bb,null))[_0x31ef('0x25')](handleError(_0x1097bb,null));};exports[_0x31ef('0x53')]=function(_0x25c7b4,_0x47167c){return db['MailMessage']['create'](_0x25c7b4[_0x31ef('0x50')])[_0x31ef('0x30')](function(_0x341c96){if(_0x341c96){if(_0x341c96[_0x31ef('0x54')]==='out'&&!_0x341c96[_0x31ef('0x55')]){var _0x1de064,_0x21accd,_0x42bda9;if(_0x25c7b4['body']['to']){_0x21accd=_0x25c7b4[_0x31ef('0x50')]['to'][_0x31ef('0x56')](',')[0x0];}return db[_0x31ef('0x57')]['findOne']({'where':{'id':_0x341c96['MailAccountId']},'include':[{'model':db[_0x31ef('0x58')],'as':_0x31ef('0x59'),'include':[{'model':db[_0x31ef('0x5a')],'as':_0x31ef('0x5b'),'where':{'email':_0x21accd},'limit':0x1,'order':[[_0x31ef('0x5c'),'DESC']]}]},{'model':db[_0x31ef('0x5d')],'as':'Smtp','raw':!![]}]})['then'](function(_0x494dfd){_0x1de064=_0x494dfd;if(_0x1de064&&_0x1de064[_0x31ef('0x5e')]){var _0x2ca6d9={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x1de064['Smtp']['service'])){_0x2ca6d9[_0x31ef('0x5f')]=_0x1de064['Smtp'][_0x31ef('0x5f')];_0x2ca6d9[_0x31ef('0x60')]=_0x1de064[_0x31ef('0x5e')]['port'];_0x2ca6d9[_0x31ef('0x61')]=_0x1de064[_0x31ef('0x5e')][_0x31ef('0x61')];if(_0x1de064[_0x31ef('0x5e')][_0x31ef('0x62')]){_0x2ca6d9[_0x31ef('0x63')]={'user':_0x1de064[_0x31ef('0x5e')]['user'],'pass':_0x1de064['Smtp'][_0x31ef('0x64')]};}}else{_0x2ca6d9[_0x31ef('0x65')]=_0x1de064[_0x31ef('0x5e')][_0x31ef('0x65')];_0x2ca6d9[_0x31ef('0x63')]={'user':_0x1de064[_0x31ef('0x5e')][_0x31ef('0x66')],'pass':_0x1de064[_0x31ef('0x5e')][_0x31ef('0x64')]};_0x2ca6d9['secure']=_0x1de064['Smtp']['secure'];}if(_0x25c7b4[_0x31ef('0x50')]['attachments']&&_0x25c7b4['body'][_0x31ef('0x67')]['length']){for(var _0x538991=0x0;_0x538991<_0x25c7b4[_0x31ef('0x50')][_0x31ef('0x67')][_0x31ef('0x4e')];_0x538991+=0x1){_0x25c7b4[_0x31ef('0x50')][_0x31ef('0x67')][_0x538991]={'filename':_0x25c7b4[_0x31ef('0x50')]['attachments'][_0x538991]['name'],'path':path[_0x31ef('0x68')](config[_0x31ef('0x69')],_0x31ef('0x6a'),_0x25c7b4[_0x31ef('0x50')][_0x31ef('0x67')][_0x538991]['basename'])};}}_0x42bda9={'account':_0x2ca6d9,'message':_0x25c7b4[_0x31ef('0x50')]};return;}})[_0x31ef('0x30')](function(){if(_0x1de064[_0x31ef('0x59')]){if(_0x1de064[_0x31ef('0x59')][_0x31ef('0x5b')][_0x31ef('0x4e')]){return _0x1de064['List'][_0x31ef('0x5b')][0x0];}else{return db['CmContact'][_0x31ef('0x53')](_[_0x31ef('0x6b')](_0x25c7b4['body'],{'firstName':_0x25c7b4[_0x31ef('0x50')]['to'],'email':_0x25c7b4[_0x31ef('0x50')]['to'],'phone':_0x25c7b4[_0x31ef('0x50')]['to'],'ListId':_0x1de064[_0x31ef('0x6c')]}));}}else{throw new Error(_0x31ef('0x6d'));}})[_0x31ef('0x30')](function(){if(_0x42bda9){return respondWithRpcPromise(_0x31ef('0x6e'),_0x31ef('0x6f'),_0x42bda9,client9003)['then'](function(_0x5d750d){return _0x341c96[_0x31ef('0x2f')]({'read':!![],'messageId':_0x5d750d[_0x31ef('0x70')],'sentAt':moment()[_0x31ef('0x71')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x4ae20e){logger[_0x31ef('0x22')]('%s',JSON[_0x31ef('0x72')](_0x4ae20e));return _0x341c96;});}return _0x341c96;});}return _0x341c96;}})[_0x31ef('0x30')](respondWithResult(_0x47167c,0xc9))[_0x31ef('0x25')](handleError(_0x47167c,null));};var interaction_log=require(_0x31ef('0x73'))('mail-interactions');exports[_0x31ef('0x74')]=function(_0x1d6969,_0x479609,_0x3f5a93){var _0x5c26e6={'channel':_0x31ef('0x75')};if(_0x1d6969[_0x31ef('0x50')]['id']){delete _0x1d6969[_0x31ef('0x50')]['id'];}_0x1d6969['body'][_0x31ef('0x76')]=!![];_0x1d6969[_0x31ef('0x50')][_0x31ef('0x77')]=moment()['format'](_0x31ef('0x78'));_0x1d6969[_0x31ef('0x50')][_0x31ef('0x79')]=_0x1d6969[_0x31ef('0x50')][_0x31ef('0x79')]||_0x1d6969[_0x31ef('0x66')]['id'];return db[_0x31ef('0x37')][_0x31ef('0x51')]({'where':{'id':_0x1d6969['params']['id'],'UserId':null},'include':[{'model':db[_0x31ef('0x5a')],'as':_0x31ef('0x7a')}]})[_0x31ef('0x30')](handleEntityNotFound(_0x479609,null))['then'](saveUpdates(_0x1d6969[_0x31ef('0x50')],null))[_0x31ef('0x30')](function(_0x327449){if(_0x327449){_0x5c26e6['message']=_0x327449['get']({'plain':!![]});return db['MailInteraction'][_0x31ef('0x51')]({'where':{'id':_0x327449[_0x31ef('0x7b')]}});}return null;})[_0x31ef('0x30')](handleEntityNotFound(_0x479609,null))[_0x31ef('0x30')](function(_0x477b3e){if(_0x477b3e){return _0x477b3e[_0x31ef('0x2f')]({'UserId':_0x1d6969[_0x31ef('0x50')][_0x31ef('0x79')],'read1stAt':_['isNil'](_0x477b3e[_0x31ef('0x7c')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x31ef('0x30')](function(_0x319baa){if(_0x319baa){_0x5c26e6['interaction']=_0x319baa[_0x31ef('0x7d')]({'plain':!![]});interaction_log[_0x31ef('0x1e')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1d6969[_0x31ef('0x66')]['id'],_0x1d6969[_0x31ef('0x66')][_0x31ef('0x34')],_0x1d6969[_0x31ef('0x66')][_0x31ef('0x7e')],_0x5c26e6[_0x31ef('0x7f')]['id'],_0x1d6969['body']?JSON[_0x31ef('0x72')](_0x1d6969[_0x31ef('0x50')]):_0x31ef('0x80'));return respondWithRpcPromise(_0x31ef('0x81'),_0x31ef('0x82'),_0x5c26e6);}return null;})[_0x31ef('0x30')](function(_0x1c7dad){if(_0x1c7dad){if(_0x1d6969[_0x31ef('0x50')][_0x31ef('0x83')]){_0x5c26e6[_0x31ef('0x24')][_0x31ef('0x84')]=util['format'](_0x31ef('0x85'),_0x1d6969['user'][_0x31ef('0x34')]);_0x5c26e6[_0x31ef('0x24')][_0x31ef('0x86')]=_0x5c26e6[_0x31ef('0x86')];_0x5c26e6[_0x31ef('0x24')][_0x31ef('0x87')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':_0x31ef('0x88'),'message':_0x5c26e6[_0x31ef('0x24')]},client9002)['then'](function(){return _0x5c26e6;});}return _0x5c26e6;}return null;})[_0x31ef('0x30')](respondWithResult(_0x479609,null))[_0x31ef('0x25')](handleError(_0x479609,null));};var interaction_log=require(_0x31ef('0x73'))(_0x31ef('0x89'));exports[_0x31ef('0x2d')]=function(_0x544833,_0xa6fb8c,_0x293477){var _0x35aca6={'agent':{},'channel':_0x31ef('0x75')};if(_0x544833[_0x31ef('0x50')]['id']){delete _0x544833[_0x31ef('0x50')]['id'];}_0x544833[_0x31ef('0x50')][_0x31ef('0x79')]=_0x544833[_0x31ef('0x50')][_0x31ef('0x79')]||_0x544833['user']['id'];_0x35aca6[_0x31ef('0x8a')]['id']=_0x544833['body'][_0x31ef('0x79')];return db[_0x31ef('0x37')][_0x31ef('0x51')]({'where':{'id':_0x544833['params']['id'],'UserId':null}})[_0x31ef('0x30')](handleEntityNotFound(_0xa6fb8c,null))[_0x31ef('0x30')](function(_0x826290){if(_0x826290){_0x35aca6['message']=_0x826290[_0x31ef('0x7d')]({'plain':!![]});return db[_0x31ef('0x8b')][_0x31ef('0x51')]({'where':{'id':_0x826290[_0x31ef('0x7b')]}});}return null;})[_0x31ef('0x30')](handleEntityNotFound(_0xa6fb8c,null))[_0x31ef('0x30')](function(_0x9c512d){if(_0x9c512d){_0x35aca6[_0x31ef('0x7f')]=_0x9c512d[_0x31ef('0x7d')]({'plain':!![]});interaction_log[_0x31ef('0x1e')](_0x31ef('0x8c'),_0x544833['user']['id'],_0x544833[_0x31ef('0x66')][_0x31ef('0x34')],_0x544833['user'][_0x31ef('0x7e')],_0x35aca6[_0x31ef('0x7f')]['id'],_0x544833['body']?JSON[_0x31ef('0x72')](_0x544833[_0x31ef('0x50')]):_0x31ef('0x80'));return respondWithRpcPromise(_0x31ef('0x8d'),_0x31ef('0x8e'),_0x35aca6);}return null;})[_0x31ef('0x30')](function(_0x386e9f){if(_0x386e9f){_0x386e9f[_0x31ef('0x24')][_0x31ef('0x84')]=util[_0x31ef('0x71')](_0x31ef('0x85'),_0x544833[_0x31ef('0x66')]['name']);_0x386e9f['message'][_0x31ef('0x86')]=_0x35aca6[_0x31ef('0x86')];_0x386e9f[_0x31ef('0x24')][_0x31ef('0x87')]='reject';respondWithRpcPromise(_0x31ef('0x8f'),'EventManager',{'event':_0x31ef('0x90'),'message':_0x386e9f[_0x31ef('0x24')]},client9002);return _0x35aca6;}return null;})['then'](respondWithResult(_0xa6fb8c,null))[_0x31ef('0x25')](handleError(_0xa6fb8c,null));};exports[_0x31ef('0x91')]=function(_0x486bb8,_0x20d59d){var _0x5a170c=moment()['unix']()[_0x31ef('0x92')]();var _0x505b41=path['join'](config[_0x31ef('0x69')],_0x31ef('0x93'),_0x31ef('0x94'),_0x31ef('0x95'));var _0x406354=path['join'](config[_0x31ef('0x69')],_0x31ef('0x93'),_0x31ef('0x94'),_0x31ef('0x67'));var _0x2ea6a1=util['format'](_0x31ef('0x96'),_0x5a170c);return db[_0x31ef('0x37')][_0x31ef('0x51')]({'where':{'id':_0x486bb8[_0x31ef('0x4d')]['id']},'attributes':['id',_0x31ef('0x50'),_0x31ef('0x97'),'to','cc',_0x31ef('0x98'),'subject',_0x31ef('0x99')],'include':_0x486bb8[_0x31ef('0x3c')][_0x31ef('0x67')]?[{'model':db[_0x31ef('0x9a')],'as':_0x31ef('0x9b')}]:undefined})[_0x31ef('0x30')](handleEntityNotFound(_0x20d59d,null))[_0x31ef('0x30')](function(_0x386fcd){if(_0x386fcd){var _0x427055=_0x386fcd;var _0x1ec8e1={'from':_0x427055[_0x31ef('0x97')],'to':_0x427055['to'],'subject':_0x427055['subject'],'html':_0x427055[_0x31ef('0x50')],'headers':{'Date':moment(_0x427055[_0x31ef('0x99')])[_0x31ef('0x71')](_0x31ef('0x9c'))},'attachments':[]};if(_0x386fcd['cc']){_0x1ec8e1[_0x31ef('0x9d')]['Cc']=_0x386fcd['cc'];}if(_0x386fcd['bcc']){_0x1ec8e1[_0x31ef('0x9d')][_0x31ef('0x9e')]=_0x386fcd['bcc'];}return new BPromise(function(_0x5f519d,_0x43ad3e){if(_0x386fcd[_0x31ef('0x9b')]){for(var _0x219eb7=0x0;_0x219eb7<_0x386fcd[_0x31ef('0x9b')][_0x31ef('0x4e')];_0x219eb7++){var _0x329348=_0x386fcd['Attachments'][_0x219eb7];var _0xd1dcef=path['join'](_0x406354,_0x329348[_0x31ef('0x9f')]);if(fs[_0x31ef('0xa0')](_0xd1dcef)){_0x1ec8e1['attachments'][_0x31ef('0xa1')]({'name':_0x329348[_0x31ef('0x34')],'contentType':_0x329348['type'],'data':fs['readFileSync'](_0xd1dcef)});}}}emlformat[_0x31ef('0xa2')](_0x1ec8e1,function(_0x2402f5,_0x1a1743){if(_0x2402f5)return _0x43ad3e(_0x2402f5);fs['writeFileSync'](path[_0x31ef('0x68')](_0x505b41,_0x2ea6a1),_0x1a1743);return _0x5f519d(_0x1a1743);});});}})['then'](function(_0xd6e98a){if(_0xd6e98a){return _0x20d59d[_0x31ef('0x91')](path[_0x31ef('0x68')](_0x505b41,_0x2ea6a1),_0x2ea6a1,function(_0x1ab351){if(_0x1ab351){console[_0x31ef('0xa3')](_0x31ef('0xa4'),_0x1ab351);}else{fs[_0x31ef('0xa5')](path['join'](_0x505b41,_0x2ea6a1));}});}})[_0x31ef('0x25')](handleError(_0x20d59d,null));}; \ No newline at end of file +var _0xc4a1=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','./mailMessage.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','stringify','error','code','MailMessage,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','name','send','index','map','MailMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','find','update','body','destroy','params','describe','direction','out','secret','split','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','Smtp','service','host','port','secure','authentication','auth','user','pass','attachments','join','server/files/attachments','basename','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','mail','read','readAt','UserId','Contact','MailInteraction','MailInteractionId','isNil','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','channel','event','accept','EventManager','acceptmessage','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','download','unix','toString','root','server','message-%s.eml','bcc','createdAt','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','type','readFileSync','build','writeFileSync','log','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path'];(function(_0x1236ce,_0x5afdf0){var _0xcd493=function(_0x24923e){while(--_0x24923e){_0x1236ce['push'](_0x1236ce['shift']());}};_0xcd493(++_0x5afdf0);}(_0xc4a1,0x1ef));var _0x1c4a=function(_0x3249b4,_0x5a1bf1){_0x3249b4=_0x3249b4-0x0;var _0x2721ec=_0xc4a1[_0x3249b4];return _0x2721ec;};'use strict';var pdf=require(_0x1c4a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1c4a('0x1'));var zipdir=require(_0x1c4a('0x2'));var jsonpatch=require(_0x1c4a('0x3'));var rp=require('request-promise');var moment=require(_0x1c4a('0x4'));var BPromise=require(_0x1c4a('0x5'));var Mustache=require(_0x1c4a('0x6'));var util=require(_0x1c4a('0x7'));var path=require(_0x1c4a('0x8'));var sox=require(_0x1c4a('0x9'));var csv=require(_0x1c4a('0xa'));var ejs=require(_0x1c4a('0xb'));var fs=require('fs');var _=require(_0x1c4a('0xc'));var squel=require(_0x1c4a('0xd'));var crypto=require(_0x1c4a('0xe'));var jsforce=require(_0x1c4a('0xf'));var deskjs=require(_0x1c4a('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1c4a('0x11'));var Papa=require(_0x1c4a('0x12'));var Redis=require('ioredis');var authService=require(_0x1c4a('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c4a('0x14'));var logger=require(_0x1c4a('0x15'))('api');var utils=require(_0x1c4a('0x16'));var config=require(_0x1c4a('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1c4a('0x18')](config[_0x1c4a('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c4a('0x19')]));require(_0x1c4a('0x1a'))[_0x1c4a('0x1b')](socket);var jayson=require(_0x1c4a('0x1c'));var client=jayson[_0x1c4a('0x1d')][_0x1c4a('0x1e')]({'port':0x232c});var client9003=jayson[_0x1c4a('0x1d')][_0x1c4a('0x1e')]({'port':0x232b});var client9002=jayson[_0x1c4a('0x1d')][_0x1c4a('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x48c1af,_0x3be487,_0x2355f8){if(_0x2355f8){var _0x1b1358=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b1358[_0x1c4a('0x1f')](_0x3be487)){return _0x48c1af;}else{throw new db['Sequelize']['ValidationError'](_0x1c4a('0x20'));}}else{return _0x48c1af;}}function respondWithRpcPromise(_0x2f1cf0,_0x1f59da,_0x5f4cac,_0x4a5055){return new BPromise(function(_0x99895e,_0x25252c){var _0x56ea92=_0x4a5055||client;return _0x56ea92[_0x1c4a('0x21')](_0x2f1cf0,_0x5f4cac)[_0x1c4a('0x22')](function(_0x22f46e){logger['info']('MailMessage,\x20%s,\x20%s',_0x1f59da,_0x1c4a('0x23'));logger[_0x1c4a('0x24')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x1f59da,'request\x20sent',JSON[_0x1c4a('0x25')](_0x22f46e));if(_0x22f46e[_0x1c4a('0x26')]){if(_0x22f46e[_0x1c4a('0x26')][_0x1c4a('0x27')]===0x1f4){logger['error'](_0x1c4a('0x28'),_0x1f59da,_0x22f46e[_0x1c4a('0x26')][_0x1c4a('0x29')]);return _0x25252c(_0x22f46e[_0x1c4a('0x26')][_0x1c4a('0x29')]);}logger[_0x1c4a('0x26')](_0x1c4a('0x28'),_0x1f59da,_0x22f46e[_0x1c4a('0x26')][_0x1c4a('0x29')]);return _0x99895e(_0x22f46e[_0x1c4a('0x26')][_0x1c4a('0x29')]);}else{logger[_0x1c4a('0x2a')]('MailMessage,\x20%s,\x20%s',_0x1f59da,_0x1c4a('0x23'));_0x99895e(_0x22f46e[_0x1c4a('0x2b')][_0x1c4a('0x29')]);}})[_0x1c4a('0x2c')](function(_0x3a5ffb){logger[_0x1c4a('0x26')](_0x1c4a('0x28'),_0x1f59da,_0x3a5ffb);_0x25252c(_0x3a5ffb);});});}function respondWithStatusCode(_0x15ea64,_0x337742){_0x337742=_0x337742||0xcc;return function(_0x3ef241){if(_0x3ef241){return _0x15ea64[_0x1c4a('0x2d')](_0x337742);}return _0x15ea64[_0x1c4a('0x2e')](_0x337742)[_0x1c4a('0x2f')]();};}function respondWithResult(_0x13778f,_0x28bf26){_0x28bf26=_0x28bf26||0xc8;return function(_0x1095ff){if(_0x1095ff){return _0x13778f[_0x1c4a('0x2e')](_0x28bf26)[_0x1c4a('0x30')](_0x1095ff);}};}function respondWithFilteredResult(_0x2603ed,_0x5f5332){return function(_0x3b268f){if(_0x3b268f){var _0x5a7c22=_0x3b268f['count'],_0x2b9dd3=_0x5f5332[_0x1c4a('0x31')],_0x1696ee=_0x5f5332['offset']+_0x5f5332[_0x1c4a('0x32')],_0x36863e;if(_0x1696ee>=_0x5a7c22){_0x1696ee=_0x5a7c22;_0x36863e=0xc8;}else{_0x36863e=0xce;}_0x2603ed[_0x1c4a('0x2e')](_0x36863e);return _0x2603ed[_0x1c4a('0x33')](_0x1c4a('0x34'),_0x2b9dd3+'-'+_0x1696ee+'/'+_0x5a7c22)[_0x1c4a('0x30')](_0x3b268f);}return null;};}function patchUpdates(_0x485eee){return function(_0x4efdf7){try{jsonpatch[_0x1c4a('0x35')](_0x4efdf7,_0x485eee,!![]);}catch(_0x4b6c94){return BPromise[_0x1c4a('0x36')](_0x4b6c94);}return _0x4efdf7[_0x1c4a('0x37')]();};}function saveUpdates(_0xb34517,_0x6ab0b6){return function(_0x49d785){if(_0x49d785){return _0x49d785['update'](_0xb34517)[_0x1c4a('0x22')](function(_0x1db864){return _0x1db864;});}return null;};}function removeEntity(_0xba2cfa,_0x2c2b99){return function(_0x2640e0){if(_0x2640e0){return _0x2640e0['destroy']()[_0x1c4a('0x22')](function(){_0xba2cfa[_0x1c4a('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f9f4f,_0x2965a2){return function(_0x48b4d5){if(!_0x48b4d5){_0x2f9f4f['sendStatus'](0x194);}return _0x48b4d5;};}function handleError(_0x596f60,_0x45a66f){_0x45a66f=_0x45a66f||0x1f4;return function(_0x142452){logger[_0x1c4a('0x26')](_0x142452['stack']);if(_0x142452[_0x1c4a('0x38')]){delete _0x142452[_0x1c4a('0x38')];}_0x596f60[_0x1c4a('0x2e')](_0x45a66f)[_0x1c4a('0x39')](_0x142452);};}exports[_0x1c4a('0x3a')]=function(_0xac8710,_0x56446c){var _0x4adcf0={},_0x91c284={},_0x1995be={'count':0x0,'rows':[]};var _0x582776=_[_0x1c4a('0x3b')](db[_0x1c4a('0x3c')][_0x1c4a('0x3d')],function(_0x482fa1){return{'name':_0x482fa1[_0x1c4a('0x3e')],'type':_0x482fa1['type'][_0x1c4a('0x3f')]};});_0x91c284[_0x1c4a('0x40')]=_[_0x1c4a('0x3b')](_0x582776,_0x1c4a('0x38'));_0x91c284[_0x1c4a('0x41')]=_[_0x1c4a('0x42')](_0xac8710[_0x1c4a('0x41')]);_0x91c284[_0x1c4a('0x43')]=_[_0x1c4a('0x44')](_0x91c284['model'],_0x91c284[_0x1c4a('0x41')]);_0x4adcf0['attributes']=_[_0x1c4a('0x44')](_0x91c284[_0x1c4a('0x40')],qs[_0x1c4a('0x45')](_0xac8710[_0x1c4a('0x41')][_0x1c4a('0x45')]));_0x4adcf0[_0x1c4a('0x46')]=_0x4adcf0[_0x1c4a('0x46')][_0x1c4a('0x47')]?_0x4adcf0[_0x1c4a('0x46')]:_0x91c284[_0x1c4a('0x40')];if(!_0xac8710[_0x1c4a('0x41')][_0x1c4a('0x48')](_0x1c4a('0x49'))){_0x4adcf0[_0x1c4a('0x32')]=qs[_0x1c4a('0x32')](_0xac8710[_0x1c4a('0x41')]['limit']);_0x4adcf0[_0x1c4a('0x31')]=qs[_0x1c4a('0x31')](_0xac8710[_0x1c4a('0x41')][_0x1c4a('0x31')]);}_0x4adcf0[_0x1c4a('0x4a')]=qs[_0x1c4a('0x4b')](_0xac8710[_0x1c4a('0x41')][_0x1c4a('0x4b')]);_0x4adcf0[_0x1c4a('0x4c')]=qs[_0x1c4a('0x43')](_[_0x1c4a('0x4d')](_0xac8710[_0x1c4a('0x41')],_0x91c284[_0x1c4a('0x43')]),_0x582776);if(_0xac8710['query']['filter']){_0x4adcf0[_0x1c4a('0x4c')]=_[_0x1c4a('0x4e')](_0x4adcf0[_0x1c4a('0x4c')],{'$or':_[_0x1c4a('0x3b')](_0x582776,function(_0x1892b5){if(_0x1892b5['type']!==_0x1c4a('0x4f')){var _0x50ae13={};_0x50ae13[_0x1892b5['name']]={'$like':'%'+_0xac8710[_0x1c4a('0x41')][_0x1c4a('0x50')]+'%'};return _0x50ae13;}})});}_0x4adcf0=_[_0x1c4a('0x4e')]({},_0x4adcf0,_0xac8710[_0x1c4a('0x51')]);var _0x110e6a={'where':_0x4adcf0[_0x1c4a('0x4c')]};return db[_0x1c4a('0x3c')][_0x1c4a('0x52')](_0x110e6a)[_0x1c4a('0x22')](function(_0x37c64d){_0x1995be[_0x1c4a('0x52')]=_0x37c64d;if(_0xac8710[_0x1c4a('0x41')][_0x1c4a('0x53')]){_0x4adcf0[_0x1c4a('0x54')]=[{'all':!![]}];}return db[_0x1c4a('0x3c')][_0x1c4a('0x55')](_0x4adcf0);})['then'](function(_0x99db2c){_0x1995be[_0x1c4a('0x56')]=_0x99db2c;return _0x1995be;})[_0x1c4a('0x22')](respondWithFilteredResult(_0x56446c,_0x4adcf0))[_0x1c4a('0x2c')](handleError(_0x56446c,null));};exports['show']=function(_0x1ed64c,_0x2aa4c2){var _0xd48550={'raw':!![],'where':{'id':_0x1ed64c['params']['id']}},_0x4b9181={};_0x4b9181[_0x1c4a('0x40')]=_[_0x1c4a('0x42')](db[_0x1c4a('0x3c')]['rawAttributes']);_0x4b9181['query']=_[_0x1c4a('0x42')](_0x1ed64c[_0x1c4a('0x41')]);_0x4b9181[_0x1c4a('0x43')]=_[_0x1c4a('0x44')](_0x4b9181[_0x1c4a('0x40')],_0x4b9181['query']);_0xd48550[_0x1c4a('0x46')]=_[_0x1c4a('0x44')](_0x4b9181[_0x1c4a('0x40')],qs[_0x1c4a('0x45')](_0x1ed64c[_0x1c4a('0x41')][_0x1c4a('0x45')]));_0xd48550[_0x1c4a('0x46')]=_0xd48550[_0x1c4a('0x46')][_0x1c4a('0x47')]?_0xd48550[_0x1c4a('0x46')]:_0x4b9181[_0x1c4a('0x40')];if(_0x1ed64c[_0x1c4a('0x41')][_0x1c4a('0x53')]){_0xd48550[_0x1c4a('0x54')]=[{'all':!![]}];}_0xd48550=_[_0x1c4a('0x4e')]({},_0xd48550,_0x1ed64c[_0x1c4a('0x51')]);return db[_0x1c4a('0x3c')][_0x1c4a('0x57')](_0xd48550)[_0x1c4a('0x22')](handleEntityNotFound(_0x2aa4c2,null))[_0x1c4a('0x22')](respondWithResult(_0x2aa4c2,null))[_0x1c4a('0x2c')](handleError(_0x2aa4c2,null));};exports[_0x1c4a('0x58')]=function(_0x36e00b,_0x2eeff4){if(_0x36e00b['body']['id']){delete _0x36e00b[_0x1c4a('0x59')]['id'];}return db[_0x1c4a('0x3c')][_0x1c4a('0x57')]({'where':{'id':_0x36e00b['params']['id']}})[_0x1c4a('0x22')](handleEntityNotFound(_0x2eeff4,null))['then'](saveUpdates(_0x36e00b[_0x1c4a('0x59')],null))[_0x1c4a('0x22')](respondWithResult(_0x2eeff4,null))[_0x1c4a('0x2c')](handleError(_0x2eeff4,null));};exports[_0x1c4a('0x5a')]=function(_0x665a0e,_0x381afd){return db[_0x1c4a('0x3c')][_0x1c4a('0x57')]({'where':{'id':_0x665a0e[_0x1c4a('0x5b')]['id']}})[_0x1c4a('0x22')](handleEntityNotFound(_0x381afd,null))[_0x1c4a('0x22')](removeEntity(_0x381afd,null))[_0x1c4a('0x2c')](handleError(_0x381afd,null));};exports['describe']=function(_0x2cefed,_0x3e8ca1){return db[_0x1c4a('0x3c')][_0x1c4a('0x5c')]()['then'](respondWithResult(_0x3e8ca1,null))['catch'](handleError(_0x3e8ca1,null));};exports['create']=function(_0x1e0bee,_0xb32d4c){return db[_0x1c4a('0x3c')]['create'](_0x1e0bee[_0x1c4a('0x59')])[_0x1c4a('0x22')](function(_0x217d4a){if(_0x217d4a){if(_0x217d4a[_0x1c4a('0x5d')]===_0x1c4a('0x5e')&&!_0x217d4a[_0x1c4a('0x5f')]){var _0xefa6aa,_0x225260,_0x36af19;if(_0x1e0bee['body']['to']){_0x225260=_0x1e0bee[_0x1c4a('0x59')]['to'][_0x1c4a('0x60')](',')[0x0];}return db['MailAccount'][_0x1c4a('0x61')]({'where':{'id':_0x217d4a[_0x1c4a('0x62')]},'include':[{'model':db['CmList'],'as':_0x1c4a('0x63'),'include':[{'model':db[_0x1c4a('0x64')],'as':_0x1c4a('0x65'),'where':{'email':_0x225260},'limit':0x1,'order':[[_0x1c4a('0x66'),_0x1c4a('0x67')]]}]},{'model':db['MailServerOut'],'as':_0x1c4a('0x68'),'raw':!![]}]})['then'](function(_0x424613){_0xefa6aa=_0x424613;if(_0xefa6aa&&_0xefa6aa['Smtp']){var _0x1693a5={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0xefa6aa[_0x1c4a('0x68')][_0x1c4a('0x69')])){_0x1693a5[_0x1c4a('0x6a')]=_0xefa6aa[_0x1c4a('0x68')][_0x1c4a('0x6a')];_0x1693a5[_0x1c4a('0x6b')]=_0xefa6aa[_0x1c4a('0x68')][_0x1c4a('0x6b')];_0x1693a5['secure']=_0xefa6aa['Smtp'][_0x1c4a('0x6c')];if(_0xefa6aa[_0x1c4a('0x68')][_0x1c4a('0x6d')]){_0x1693a5[_0x1c4a('0x6e')]={'user':_0xefa6aa[_0x1c4a('0x68')][_0x1c4a('0x6f')],'pass':_0xefa6aa[_0x1c4a('0x68')]['pass']};}}else{_0x1693a5[_0x1c4a('0x69')]=_0xefa6aa[_0x1c4a('0x68')]['service'];_0x1693a5['auth']={'user':_0xefa6aa[_0x1c4a('0x68')]['user'],'pass':_0xefa6aa[_0x1c4a('0x68')][_0x1c4a('0x70')]};_0x1693a5['secure']=_0xefa6aa['Smtp'][_0x1c4a('0x6c')];}if(_0x1e0bee[_0x1c4a('0x59')][_0x1c4a('0x71')]&&_0x1e0bee[_0x1c4a('0x59')][_0x1c4a('0x71')][_0x1c4a('0x47')]){for(var _0x6c064=0x0;_0x6c064<_0x1e0bee[_0x1c4a('0x59')][_0x1c4a('0x71')][_0x1c4a('0x47')];_0x6c064+=0x1){_0x1e0bee[_0x1c4a('0x59')]['attachments'][_0x6c064]={'filename':_0x1e0bee[_0x1c4a('0x59')][_0x1c4a('0x71')][_0x6c064][_0x1c4a('0x38')],'path':path[_0x1c4a('0x72')](config['root'],_0x1c4a('0x73'),_0x1e0bee[_0x1c4a('0x59')][_0x1c4a('0x71')][_0x6c064][_0x1c4a('0x74')])};}}_0x36af19={'account':_0x1693a5,'message':_0x1e0bee[_0x1c4a('0x59')]};return;}})[_0x1c4a('0x22')](function(){if(_0xefa6aa[_0x1c4a('0x63')]){if(_0xefa6aa[_0x1c4a('0x63')][_0x1c4a('0x65')]['length']){return _0xefa6aa[_0x1c4a('0x63')]['Contacts'][0x0];}else{return db[_0x1c4a('0x64')]['create'](_[_0x1c4a('0x18')](_0x1e0bee['body'],{'firstName':_0x1e0bee[_0x1c4a('0x59')]['to'],'email':_0x1e0bee[_0x1c4a('0x59')]['to'],'phone':_0x1e0bee[_0x1c4a('0x59')]['to'],'ListId':_0xefa6aa[_0x1c4a('0x75')]}));}}else{throw new Error(_0x1c4a('0x76'));}})[_0x1c4a('0x22')](function(){if(_0x36af19){return respondWithRpcPromise('SendMail',_0x1c4a('0x77'),_0x36af19,client9003)[_0x1c4a('0x22')](function(_0x3fad42){return _0x217d4a[_0x1c4a('0x58')]({'read':!![],'messageId':_0x3fad42[_0x1c4a('0x78')],'sentAt':moment()[_0x1c4a('0x79')](_0x1c4a('0x7a'))});})[_0x1c4a('0x2c')](function(_0x18b0e6){logger[_0x1c4a('0x26')]('%s',JSON[_0x1c4a('0x25')](_0x18b0e6));return _0x217d4a;});}return _0x217d4a;});}return _0x217d4a;}})[_0x1c4a('0x22')](respondWithResult(_0xb32d4c,0xc9))[_0x1c4a('0x2c')](handleError(_0xb32d4c,null));};var interaction_log=require('../../config/logger')(_0x1c4a('0x7b'));exports['accept']=function(_0x23425a,_0x1e15b4,_0x16a024){var _0x118459={'channel':_0x1c4a('0x7c')};if(_0x23425a[_0x1c4a('0x59')]['id']){delete _0x23425a[_0x1c4a('0x59')]['id'];}_0x23425a['body'][_0x1c4a('0x7d')]=!![];_0x23425a[_0x1c4a('0x59')][_0x1c4a('0x7e')]=moment()[_0x1c4a('0x79')](_0x1c4a('0x7a'));_0x23425a['body'][_0x1c4a('0x7f')]=_0x23425a[_0x1c4a('0x59')][_0x1c4a('0x7f')]||_0x23425a[_0x1c4a('0x6f')]['id'];return db[_0x1c4a('0x3c')][_0x1c4a('0x57')]({'where':{'id':_0x23425a[_0x1c4a('0x5b')]['id'],'UserId':null},'include':[{'model':db[_0x1c4a('0x64')],'as':_0x1c4a('0x80')}]})[_0x1c4a('0x22')](handleEntityNotFound(_0x1e15b4,null))[_0x1c4a('0x22')](saveUpdates(_0x23425a['body'],null))['then'](function(_0x2fe46f){if(_0x2fe46f){_0x118459[_0x1c4a('0x29')]=_0x2fe46f['get']({'plain':!![]});return db[_0x1c4a('0x81')][_0x1c4a('0x57')]({'where':{'id':_0x2fe46f[_0x1c4a('0x82')]}});}return null;})[_0x1c4a('0x22')](handleEntityNotFound(_0x1e15b4,null))['then'](function(_0xec2908){if(_0xec2908){return _0xec2908[_0x1c4a('0x58')]({'UserId':_0x23425a[_0x1c4a('0x59')][_0x1c4a('0x7f')],'read1stAt':_[_0x1c4a('0x83')](_0xec2908['read1stAt'])?moment()[_0x1c4a('0x79')](_0x1c4a('0x7a')):undefined});}return null;})['then'](function(_0x2bbf14){if(_0x2bbf14){_0x118459[_0x1c4a('0x84')]=_0x2bbf14[_0x1c4a('0x85')]({'plain':!![]});interaction_log[_0x1c4a('0x2a')](_0x1c4a('0x86'),_0x23425a[_0x1c4a('0x6f')]['id'],_0x23425a['user'][_0x1c4a('0x38')],_0x23425a[_0x1c4a('0x6f')][_0x1c4a('0x87')],_0x118459[_0x1c4a('0x84')]['id'],_0x23425a[_0x1c4a('0x59')]?JSON[_0x1c4a('0x25')](_0x23425a['body']):_0x1c4a('0x88'));return respondWithRpcPromise(_0x1c4a('0x89'),_0x1c4a('0x8a'),_0x118459);}return null;})[_0x1c4a('0x22')](function(_0x25189b){if(_0x25189b){if(_0x23425a[_0x1c4a('0x59')][_0x1c4a('0x8b')]){_0x118459[_0x1c4a('0x29')][_0x1c4a('0x8c')]=util[_0x1c4a('0x79')]('SIP/%s',_0x23425a['user'][_0x1c4a('0x38')]);_0x118459[_0x1c4a('0x29')][_0x1c4a('0x8d')]=_0x118459[_0x1c4a('0x8d')];_0x118459['message'][_0x1c4a('0x8e')]=_0x1c4a('0x8f');return respondWithRpcPromise(_0x1c4a('0x90'),'EventManager',{'event':_0x1c4a('0x91'),'message':_0x118459[_0x1c4a('0x29')]},client9002)[_0x1c4a('0x22')](function(){return _0x118459;});}return _0x118459;}return null;})['then'](respondWithResult(_0x1e15b4,null))[_0x1c4a('0x2c')](handleError(_0x1e15b4,null));};var interaction_log=require(_0x1c4a('0x15'))(_0x1c4a('0x7b'));exports[_0x1c4a('0x36')]=function(_0x12c6c3,_0xc5e9d9,_0x3df320){var _0x1d37d0={'agent':{},'channel':'mail'};if(_0x12c6c3[_0x1c4a('0x59')]['id']){delete _0x12c6c3[_0x1c4a('0x59')]['id'];}_0x12c6c3[_0x1c4a('0x59')][_0x1c4a('0x7f')]=_0x12c6c3[_0x1c4a('0x59')]['UserId']||_0x12c6c3[_0x1c4a('0x6f')]['id'];_0x1d37d0[_0x1c4a('0x92')]['id']=_0x12c6c3[_0x1c4a('0x59')][_0x1c4a('0x7f')];return db['MailMessage'][_0x1c4a('0x57')]({'where':{'id':_0x12c6c3[_0x1c4a('0x5b')]['id'],'UserId':null}})[_0x1c4a('0x22')](handleEntityNotFound(_0xc5e9d9,null))['then'](function(_0x479478){if(_0x479478){_0x1d37d0[_0x1c4a('0x29')]=_0x479478[_0x1c4a('0x85')]({'plain':!![]});return db[_0x1c4a('0x81')][_0x1c4a('0x57')]({'where':{'id':_0x479478[_0x1c4a('0x82')]}});}return null;})[_0x1c4a('0x22')](handleEntityNotFound(_0xc5e9d9,null))[_0x1c4a('0x22')](function(_0x3f00ec){if(_0x3f00ec){_0x1d37d0[_0x1c4a('0x84')]=_0x3f00ec['get']({'plain':!![]});interaction_log['info'](_0x1c4a('0x93'),_0x12c6c3[_0x1c4a('0x6f')]['id'],_0x12c6c3[_0x1c4a('0x6f')][_0x1c4a('0x38')],_0x12c6c3['user'][_0x1c4a('0x87')],_0x1d37d0['interaction']['id'],_0x12c6c3['body']?JSON['stringify'](_0x12c6c3[_0x1c4a('0x59')]):_0x1c4a('0x88'));return respondWithRpcPromise('RejectMessage',_0x1c4a('0x94'),_0x1d37d0);}return null;})[_0x1c4a('0x22')](function(_0x380007){if(_0x380007){_0x380007[_0x1c4a('0x29')][_0x1c4a('0x8c')]=util[_0x1c4a('0x79')]('SIP/%s',_0x12c6c3[_0x1c4a('0x6f')][_0x1c4a('0x38')]);_0x380007[_0x1c4a('0x29')][_0x1c4a('0x8d')]=_0x1d37d0[_0x1c4a('0x8d')];_0x380007[_0x1c4a('0x29')][_0x1c4a('0x8e')]='reject';respondWithRpcPromise(_0x1c4a('0x90'),_0x1c4a('0x90'),{'event':_0x1c4a('0x95'),'message':_0x380007[_0x1c4a('0x29')]},client9002);return _0x1d37d0;}return null;})[_0x1c4a('0x22')](respondWithResult(_0xc5e9d9,null))[_0x1c4a('0x2c')](handleError(_0xc5e9d9,null));};exports[_0x1c4a('0x96')]=function(_0x43aa28,_0x458dc9){var _0x2821f0=moment()[_0x1c4a('0x97')]()[_0x1c4a('0x98')]();var _0x3dab58=path[_0x1c4a('0x72')](config[_0x1c4a('0x99')],'server','files','tmp');var _0x203808=path['join'](config[_0x1c4a('0x99')],_0x1c4a('0x9a'),'files',_0x1c4a('0x71'));var _0x2f7b9d=util[_0x1c4a('0x79')](_0x1c4a('0x9b'),_0x2821f0);return db[_0x1c4a('0x3c')][_0x1c4a('0x57')]({'where':{'id':_0x43aa28['params']['id']},'attributes':['id',_0x1c4a('0x59'),'from','to','cc',_0x1c4a('0x9c'),'subject',_0x1c4a('0x9d')],'include':_0x43aa28[_0x1c4a('0x41')][_0x1c4a('0x71')]?[{'model':db['Attachment'],'as':_0x1c4a('0x9e')}]:undefined})[_0x1c4a('0x22')](handleEntityNotFound(_0x458dc9,null))['then'](function(_0x362b97){if(_0x362b97){var _0x3aee52=_0x362b97;var _0x39343c={'from':_0x3aee52[_0x1c4a('0x9f')],'to':_0x3aee52['to'],'subject':_0x3aee52['subject'],'html':_0x3aee52[_0x1c4a('0x59')],'headers':{'Date':moment(_0x3aee52[_0x1c4a('0x9d')])[_0x1c4a('0x79')](_0x1c4a('0xa0'))},'attachments':[]};if(_0x362b97['cc']){_0x39343c[_0x1c4a('0xa1')]['Cc']=_0x362b97['cc'];}if(_0x362b97[_0x1c4a('0x9c')]){_0x39343c['headers'][_0x1c4a('0xa2')]=_0x362b97[_0x1c4a('0x9c')];}return new BPromise(function(_0x49fbd7,_0x2f814b){if(_0x362b97[_0x1c4a('0x9e')]){for(var _0x445c1a=0x0;_0x445c1a<_0x362b97['Attachments'][_0x1c4a('0x47')];_0x445c1a++){var _0x5e33b8=_0x362b97[_0x1c4a('0x9e')][_0x445c1a];var _0xf2540b=path[_0x1c4a('0x72')](_0x203808,_0x5e33b8[_0x1c4a('0x74')]);if(fs['existsSync'](_0xf2540b)){_0x39343c[_0x1c4a('0x71')]['push']({'name':_0x5e33b8[_0x1c4a('0x38')],'contentType':_0x5e33b8[_0x1c4a('0xa3')],'data':fs[_0x1c4a('0xa4')](_0xf2540b)});}}}emlformat[_0x1c4a('0xa5')](_0x39343c,function(_0x5bf5cb,_0x3fc073){if(_0x5bf5cb)return _0x2f814b(_0x5bf5cb);fs[_0x1c4a('0xa6')](path['join'](_0x3dab58,_0x2f7b9d),_0x3fc073);return _0x49fbd7(_0x3fc073);});});}})[_0x1c4a('0x22')](function(_0x89b4d8){if(_0x89b4d8){return _0x458dc9[_0x1c4a('0x96')](path[_0x1c4a('0x72')](_0x3dab58,_0x2f7b9d),_0x2f7b9d,function(_0x486398){if(_0x486398){console[_0x1c4a('0xa7')]('err',_0x486398);}else{fs['unlinkSync'](path[_0x1c4a('0x72')](_0x3dab58,_0x2f7b9d));}});}})[_0x1c4a('0x2c')](handleError(_0x458dc9,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index aa658dc..8a74c78 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 _0x630a=['exports','events','../../mysqldb','MailMessage','update','remove','emit','hasOwnProperty'];(function(_0x44b3df,_0x3438d7){var _0x414e73=function(_0x3f89f6){while(--_0x3f89f6){_0x44b3df['push'](_0x44b3df['shift']());}};_0x414e73(++_0x3438d7);}(_0x630a,0x1d9));var _0xa630=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0x630a[_0x163040];return _0x364667;};'use strict';var EventEmitter=require(_0xa630('0x0'));var MailMessage=require(_0xa630('0x1'))['db'][_0xa630('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa630('0x3'),'afterDestroy':_0xa630('0x4')};function emitEvent(_0x2d7d44){return function(_0x27ea61,_0x654898,_0x586445){MailMessageEvents[_0xa630('0x5')](_0x2d7d44+':'+_0x27ea61['id'],_0x27ea61);MailMessageEvents[_0xa630('0x5')](_0x2d7d44,_0x27ea61);_0x586445(null);};}for(var e in events){if(events[_0xa630('0x6')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xa630('0x7')]=MailMessageEvents; \ No newline at end of file +var _0x3d4b=['events','../../mysqldb','MailMessage','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x193f9b,_0x420ee6){var _0x5a0466=function(_0x29b2d5){while(--_0x29b2d5){_0x193f9b['push'](_0x193f9b['shift']());}};_0x5a0466(++_0x420ee6);}(_0x3d4b,0xfc));var _0xb3d4=function(_0x1bb235,_0x2792){_0x1bb235=_0x1bb235-0x0;var _0x108d42=_0x3d4b[_0x1bb235];return _0x108d42;};'use strict';var EventEmitter=require(_0xb3d4('0x0'));var MailMessage=require(_0xb3d4('0x1'))['db'][_0xb3d4('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xb3d4('0x3')](0x0);var events={'afterCreate':_0xb3d4('0x4'),'afterUpdate':_0xb3d4('0x5'),'afterDestroy':'remove'};function emitEvent(_0x382e18){return function(_0x46af5e,_0x4ef16c,_0x1dd50a){MailMessageEvents[_0xb3d4('0x6')](_0x382e18+':'+_0x46af5e['id'],_0x46af5e);MailMessageEvents[_0xb3d4('0x6')](_0x382e18,_0x46af5e);_0x1dd50a(null);};}for(var e in events){if(events[_0xb3d4('0x7')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xb3d4('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 3115779..347b0a7 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 _0x7014=['request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','FULLTEXT','body','plainBody','fromString','direction','toLowerCase','secret','MailInteraction','findOne','MailInteractionId','then','createdAt','catch','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x7014,0x158));var _0x4701=function(_0x294e39,_0x4e1363){_0x294e39=_0x294e39-0x0;var _0xd5b8b1=_0x7014[_0x294e39];return _0xd5b8b1;};'use strict';var _=require('lodash');var util=require(_0x4701('0x0'));var logger=require(_0x4701('0x1'))('api');var moment=require(_0x4701('0x2'));var BPromise=require(_0x4701('0x3'));var rp=require(_0x4701('0x4'));var htmlToText=require(_0x4701('0x5'));var fs=require('fs');var path=require(_0x4701('0x6'));var rimraf=require('rimraf');var config=require(_0x4701('0x7'));var attributes=require(_0x4701('0x8'));module[_0x4701('0x9')]=function(_0x755dc7,_0x323e02){return _0x755dc7[_0x4701('0xa')](_0x4701('0xb'),attributes,{'tableName':_0x4701('0xc'),'paranoid':![],'indexes':[{'name':_0x4701('0xd'),'fields':['messageId']},{'name':_0x4701('0xe'),'fields':['plainBody','subject'],'type':_0x4701('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x92393f,_0x373b81,_0x44519a){if(_0x92393f[_0x4701('0x10')]){_0x92393f[_0x4701('0x11')]=htmlToText[_0x4701('0x12')](_0x92393f[_0x4701('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x44519a(null,_0x373b81);},'afterCreate':function(_0x44327e,_0x67a5ee,_0xcf9834){var _0xdee4cc=_0x755dc7['models'];var _0x54e371=_0x44327e['get']({'plain':!![]});if(_0x54e371[_0x4701('0x13')][_0x4701('0x14')]()==='in'||_0x54e371[_0x4701('0x13')][_0x4701('0x14')]()==='out'&&!_0x54e371[_0x4701('0x15')]&&!_['isNil'](_0x54e371['UserId'])){_0xdee4cc[_0x4701('0x16')][_0x4701('0x17')]({'where':{'id':_0x54e371[_0x4701('0x18')]}})[_0x4701('0x19')](function(_0x3500cc){if(_0x3500cc){_0x3500cc['update']({'lastMsgAt':_0x54e371[_0x4701('0x1a')],'lastMsgDirection':_0x54e371[_0x4701('0x13')][_0x4701('0x14')](),'lastMsgBody':_0x54e371[_0x4701('0x10')]});}})[_0x4701('0x1b')](function(_0xab95f0){console['error'](_0xab95f0);});}_0xcf9834();}},'charset':'utf8mb4','collate':_0x4701('0x1c')});}; \ No newline at end of file +var _0xaa6a=['MailInteraction','findOne','MailInteractionId','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId'];(function(_0x18841f,_0x4e8d18){var _0x17187a=function(_0x419612){while(--_0x419612){_0x18841f['push'](_0x18841f['shift']());}};_0x17187a(++_0x4e8d18);}(_0xaa6a,0x165));var _0xaaa6=function(_0x35f5e3,_0x33c0d7){_0x35f5e3=_0x35f5e3-0x0;var _0x9235bd=_0xaa6a[_0x35f5e3];return _0x9235bd;};'use strict';var _=require('lodash');var util=require(_0xaaa6('0x0'));var logger=require(_0xaaa6('0x1'))(_0xaaa6('0x2'));var moment=require(_0xaaa6('0x3'));var BPromise=require(_0xaaa6('0x4'));var rp=require(_0xaaa6('0x5'));var htmlToText=require(_0xaaa6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaaa6('0x7'));var config=require(_0xaaa6('0x8'));var attributes=require(_0xaaa6('0x9'));module[_0xaaa6('0xa')]=function(_0x357bdf,_0x5274e5){return _0x357bdf[_0xaaa6('0xb')](_0xaaa6('0xc'),attributes,{'tableName':_0xaaa6('0xd'),'paranoid':![],'indexes':[{'name':_0xaaa6('0xe'),'fields':[_0xaaa6('0xe')]},{'name':'fti_mail_messages','fields':[_0xaaa6('0xf'),_0xaaa6('0x10')],'type':_0xaaa6('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b0c90,_0x44e0b5,_0x2d761c){if(_0x2b0c90[_0xaaa6('0x12')]){_0x2b0c90[_0xaaa6('0xf')]=htmlToText[_0xaaa6('0x13')](_0x2b0c90[_0xaaa6('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2d761c(null,_0x44e0b5);},'afterCreate':function(_0x30e644,_0x4c48d0,_0x3878d3){var _0x252220=_0x357bdf[_0xaaa6('0x14')];var _0x290cca=_0x30e644[_0xaaa6('0x15')]({'plain':!![]});if(_0x290cca[_0xaaa6('0x16')][_0xaaa6('0x17')]()==='in'||_0x290cca[_0xaaa6('0x16')]['toLowerCase']()===_0xaaa6('0x18')&&!_0x290cca[_0xaaa6('0x19')]&&!_[_0xaaa6('0x1a')](_0x290cca[_0xaaa6('0x1b')])){_0x252220[_0xaaa6('0x1c')][_0xaaa6('0x1d')]({'where':{'id':_0x290cca[_0xaaa6('0x1e')]}})['then'](function(_0x7e0444){if(_0x7e0444){_0x7e0444['update']({'lastMsgAt':_0x290cca['createdAt'],'lastMsgDirection':_0x290cca[_0xaaa6('0x16')][_0xaaa6('0x17')](),'lastMsgBody':_0x290cca[_0xaaa6('0x12')]});}})[_0xaaa6('0x1f')](function(_0x374a0a){console[_0xaaa6('0x20')](_0x374a0a);});}_0x3878d3();}},'charset':_0xaaa6('0x21'),'collate':_0xaaa6('0x22')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 1773f73..fe6f10d 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 _0x6455=['./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','MailMessage','body','raw','CreateMailMessage','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6455,0x97));var _0x5645=function(_0x415fda,_0x258391){_0x415fda=_0x415fda-0x0;var _0x4bf6a8=_0x6455[_0x415fda];return _0x4bf6a8;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var moment=require(_0x5645('0x1'));var BPromise=require(_0x5645('0x2'));var rs=require(_0x5645('0x3'));var fs=require('fs');var Redis=require(_0x5645('0x4'));var db=require(_0x5645('0x5'))['db'];var utils=require(_0x5645('0x6'));var logger=require('../../config/logger')(_0x5645('0x7'));var config=require(_0x5645('0x8'));var jayson=require(_0x5645('0x9'));var client=jayson[_0x5645('0xa')][_0x5645('0xb')]({'port':0x232a});config[_0x5645('0xc')]=_[_0x5645('0xd')](config[_0x5645('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5645('0xc')]));require(_0x5645('0xe'))[_0x5645('0xf')](socket);function respondWithRpcPromise(_0x34fe4e,_0x7f9893,_0x16af81){return new BPromise(function(_0x587c61,_0x212e46){return client[_0x5645('0x10')](_0x34fe4e,_0x16af81)[_0x5645('0x11')](function(_0x21e32c){logger['info'](_0x5645('0x12'),_0x7f9893,'request\x20sent');logger[_0x5645('0x13')](_0x5645('0x14'),_0x7f9893,_0x5645('0x15'),JSON[_0x5645('0x16')](_0x21e32c));if(_0x21e32c[_0x5645('0x17')]){if(_0x21e32c[_0x5645('0x17')][_0x5645('0x18')]===0x1f4){logger[_0x5645('0x17')]('MailMessage,\x20%s,\x20%s',_0x7f9893,_0x21e32c[_0x5645('0x17')][_0x5645('0x19')]);return _0x212e46(_0x21e32c[_0x5645('0x17')]['message']);}logger['error'](_0x5645('0x12'),_0x7f9893,_0x21e32c[_0x5645('0x17')]['message']);return _0x587c61(_0x21e32c[_0x5645('0x17')][_0x5645('0x19')]);}else{logger[_0x5645('0x1a')]('MailMessage,\x20%s,\x20%s',_0x7f9893,_0x5645('0x15'));_0x587c61(_0x21e32c[_0x5645('0x1b')][_0x5645('0x19')]);}})[_0x5645('0x1c')](function(_0x5ac9ee){logger[_0x5645('0x17')]('MailMessage,\x20%s,\x20%s',_0x7f9893,_0x5ac9ee);_0x212e46(_0x5ac9ee);});});}exports['CreateMailMessage']=function(_0x7c39d7){var _0x1e2cba=this;return new Promise(function(_0x2e3350,_0x59a491){return db[_0x5645('0x1d')]['create'](_0x7c39d7[_0x5645('0x1e')],{'raw':_0x7c39d7['options']?_0x7c39d7['options'][_0x5645('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x465a01){logger[_0x5645('0x1a')]('CreateMailMessage',_0x7c39d7);logger[_0x5645('0x13')](_0x5645('0x20'),_0x7c39d7,JSON[_0x5645('0x16')](_0x465a01));_0x2e3350(_0x465a01);})['catch'](function(_0x1e70ad){logger[_0x5645('0x17')](_0x5645('0x20'),_0x1e70ad[_0x5645('0x19')],_0x7c39d7);_0x59a491(_0x1e2cba['error'](0x1f4,_0x1e70ad['message']));});});}; \ No newline at end of file +var _0xcb41=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./mailMessage.socket','register','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailMessage','create','body','options','lodash'];(function(_0x36f5ae,_0x53960b){var _0x10c86c=function(_0x597583){while(--_0x597583){_0x36f5ae['push'](_0x36f5ae['shift']());}};_0x10c86c(++_0x53960b);}(_0xcb41,0x1df));var _0x1cb4=function(_0x3dd200,_0x174432){_0x3dd200=_0x3dd200-0x0;var _0x4204e8=_0xcb41[_0x3dd200];return _0x4204e8;};'use strict';var _=require(_0x1cb4('0x0'));var util=require(_0x1cb4('0x1'));var moment=require(_0x1cb4('0x2'));var BPromise=require(_0x1cb4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cb4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb4('0x5'));var logger=require(_0x1cb4('0x6'))(_0x1cb4('0x7'));var config=require(_0x1cb4('0x8'));var jayson=require(_0x1cb4('0x9'));var client=jayson[_0x1cb4('0xa')][_0x1cb4('0xb')]({'port':0x232a});config[_0x1cb4('0xc')]=_['defaults'](config[_0x1cb4('0xc')],{'host':_0x1cb4('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1cb4('0xc')]));require(_0x1cb4('0xe'))[_0x1cb4('0xf')](socket);function respondWithRpcPromise(_0x5afadd,_0x2f5ddc,_0x21d6a7){return new BPromise(function(_0x30c281,_0x4c8bde){return client['request'](_0x5afadd,_0x21d6a7)[_0x1cb4('0x10')](function(_0x574f01){logger[_0x1cb4('0x11')](_0x1cb4('0x12'),_0x2f5ddc,_0x1cb4('0x13'));logger[_0x1cb4('0x14')](_0x1cb4('0x15'),_0x2f5ddc,'request\x20sent',JSON[_0x1cb4('0x16')](_0x574f01));if(_0x574f01['error']){if(_0x574f01[_0x1cb4('0x17')][_0x1cb4('0x18')]===0x1f4){logger[_0x1cb4('0x17')](_0x1cb4('0x12'),_0x2f5ddc,_0x574f01[_0x1cb4('0x17')][_0x1cb4('0x19')]);return _0x4c8bde(_0x574f01[_0x1cb4('0x17')][_0x1cb4('0x19')]);}logger[_0x1cb4('0x17')](_0x1cb4('0x12'),_0x2f5ddc,_0x574f01['error'][_0x1cb4('0x19')]);return _0x30c281(_0x574f01['error'][_0x1cb4('0x19')]);}else{logger[_0x1cb4('0x11')]('MailMessage,\x20%s,\x20%s',_0x2f5ddc,'request\x20sent');_0x30c281(_0x574f01[_0x1cb4('0x1a')][_0x1cb4('0x19')]);}})[_0x1cb4('0x1b')](function(_0x3c4493){logger[_0x1cb4('0x17')](_0x1cb4('0x12'),_0x2f5ddc,_0x3c4493);_0x4c8bde(_0x3c4493);});});}exports[_0x1cb4('0x1c')]=function(_0xdbb325){var _0x544001=this;return new Promise(function(_0x3ae54d,_0x1d1a19){return db['MailMessage'][_0x1cb4('0x1d')](_0xdbb325[_0x1cb4('0x1e')],{'raw':_0xdbb325[_0x1cb4('0x1f')]?_0xdbb325[_0x1cb4('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x1cb4('0x10')](function(_0x51fc8d){logger['info'](_0x1cb4('0x1c'),_0xdbb325);logger[_0x1cb4('0x14')](_0x1cb4('0x1c'),_0xdbb325,JSON['stringify'](_0x51fc8d));_0x3ae54d(_0x51fc8d);})[_0x1cb4('0x1b')](function(_0x33ec9c){logger[_0x1cb4('0x17')]('CreateMailMessage',_0x33ec9c[_0x1cb4('0x19')],_0xdbb325);_0x1d1a19(_0x544001[_0x1cb4('0x17')](0x1f4,_0x33ec9c[_0x1cb4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 2942c1b..4e39c71 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 _0x2e61=['save','remove','emit','removeListener','length','mailMessage:','./mailMessage.events'];(function(_0x4e0f70,_0x870a71){var _0x460281=function(_0x3f4a9f){while(--_0x3f4a9f){_0x4e0f70['push'](_0x4e0f70['shift']());}};_0x460281(++_0x870a71);}(_0x2e61,0x1d4));var _0x12e6=function(_0x1916f9,_0x20a4ad){_0x1916f9=_0x1916f9-0x0;var _0x1091e3=_0x2e61[_0x1916f9];return _0x1091e3;};'use strict';var MailMessageEvents=require(_0x12e6('0x0'));var events=[_0x12e6('0x1'),_0x12e6('0x2'),'update'];function createListener(_0x7dc09a,_0x154eb8){return function(_0x3d4109){_0x154eb8[_0x12e6('0x3')](_0x7dc09a,_0x3d4109);};}function removeListener(_0x226859,_0x1d0aa6){return function(){MailMessageEvents[_0x12e6('0x4')](_0x226859,_0x1d0aa6);};}exports['register']=function(_0x14e2df){for(var _0x56a097=0x0,_0x456105=events[_0x12e6('0x5')];_0x56a097<_0x456105;_0x56a097++){var _0x4706dd=events[_0x56a097];var _0x56c3ed=createListener(_0x12e6('0x6')+_0x4706dd,_0x14e2df);MailMessageEvents['on'](_0x4706dd,_0x56c3ed);}}; \ No newline at end of file +var _0x6efc=['remove','update','removeListener','length','mailMessage:','./mailMessage.events','save'];(function(_0x995343,_0x59b614){var _0x36a192=function(_0x2d0f3b){while(--_0x2d0f3b){_0x995343['push'](_0x995343['shift']());}};_0x36a192(++_0x59b614);}(_0x6efc,0xec));var _0xc6ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6efc[_0x3dd15e];return _0x231fd0;};'use strict';var MailMessageEvents=require(_0xc6ef('0x0'));var events=[_0xc6ef('0x1'),_0xc6ef('0x2'),_0xc6ef('0x3')];function createListener(_0x50c095,_0x57b848){return function(_0x1852b5){_0x57b848['emit'](_0x50c095,_0x1852b5);};}function removeListener(_0x7b12d4,_0x51eb29){return function(){MailMessageEvents[_0xc6ef('0x4')](_0x7b12d4,_0x51eb29);};}exports['register']=function(_0x3f0506){for(var _0x315b00=0x0,_0x1441f2=events[_0xc6ef('0x5')];_0x315b00<_0x1441f2;_0x315b00++){var _0x5524f5=events[_0x315b00];var _0x7b3fa6=createListener(_0xc6ef('0x6')+_0x5524f5,_0x3f0506);MailMessageEvents['on'](_0x5524f5,_0x7b3fa6);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 0d2e1f2..c85a056 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 _0x08da=['addAgents','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x08da,0x14b));var _0xa08d=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0x08da[_0x525c7b];return _0x27b33e;};'use strict';var multer=require(_0xa08d('0x0'));var util=require(_0xa08d('0x1'));var path=require(_0xa08d('0x2'));var timeout=require(_0xa08d('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa08d('0x4'));var config=require('../../config/environment');var controller=require(_0xa08d('0x5'));router[_0xa08d('0x6')]('/',auth[_0xa08d('0x7')](),controller['index']);router[_0xa08d('0x6')](_0xa08d('0x8'),auth['isAuthenticated'](),controller[_0xa08d('0x9')]);router[_0xa08d('0x6')](_0xa08d('0xa'),auth[_0xa08d('0x7')](),controller[_0xa08d('0xb')]);router['get'](_0xa08d('0xc'),auth[_0xa08d('0x7')](),controller[_0xa08d('0xd')]);router[_0xa08d('0x6')]('/:id/teams',auth[_0xa08d('0x7')](),controller[_0xa08d('0xe')]);router['get'](_0xa08d('0xf'),auth[_0xa08d('0x7')](),controller[_0xa08d('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa08d('0x11')](_0xa08d('0x12'),auth[_0xa08d('0x7')](),controller[_0xa08d('0x13')]);router[_0xa08d('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0xa08d('0x14')]);router[_0xa08d('0x15')](_0xa08d('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xa08d('0x16')]('/:id',auth[_0xa08d('0x7')](),controller[_0xa08d('0x17')]);router[_0xa08d('0x16')](_0xa08d('0x12'),auth['isAuthenticated'](),controller[_0xa08d('0x18')]);router[_0xa08d('0x16')](_0xa08d('0xf'),auth[_0xa08d('0x7')](),controller[_0xa08d('0x19')]);module[_0xa08d('0x1a')]=router; \ No newline at end of file +var _0x23c8=['/:id','show','/:id/members','getMembers','getTeams','/:id/users','post','create','addTeams','delete','/:id/teams','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','get','describe'];(function(_0x3c3203,_0x375a91){var _0x4cb7dd=function(_0x388372){while(--_0x388372){_0x3c3203['push'](_0x3c3203['shift']());}};_0x4cb7dd(++_0x375a91);}(_0x23c8,0x146));var _0x823c=function(_0x4d621b,_0x19275a){_0x4d621b=_0x4d621b-0x0;var _0x16ff5b=_0x23c8[_0x4d621b];return _0x16ff5b;};'use strict';var multer=require(_0x823c('0x0'));var util=require(_0x823c('0x1'));var path=require(_0x823c('0x2'));var timeout=require(_0x823c('0x3'));var express=require(_0x823c('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x823c('0x5'));var config=require(_0x823c('0x6'));var controller=require(_0x823c('0x7'));router['get']('/',auth[_0x823c('0x8')](),controller[_0x823c('0x9')]);router[_0x823c('0xa')]('/describe',auth[_0x823c('0x8')](),controller[_0x823c('0xb')]);router[_0x823c('0xa')](_0x823c('0xc'),auth['isAuthenticated'](),controller[_0x823c('0xd')]);router['get'](_0x823c('0xe'),auth[_0x823c('0x8')](),controller[_0x823c('0xf')]);router[_0x823c('0xa')]('/:id/teams',auth['isAuthenticated'](),controller[_0x823c('0x10')]);router[_0x823c('0xa')](_0x823c('0x11'),auth[_0x823c('0x8')](),controller['getAgents']);router[_0x823c('0x12')]('/',auth['isAuthenticated'](),controller[_0x823c('0x13')]);router[_0x823c('0x12')]('/:id/teams',auth['isAuthenticated'](),controller[_0x823c('0x14')]);router['post']('/:id/users',auth[_0x823c('0x8')](),controller['addAgents']);router['put'](_0x823c('0xc'),auth[_0x823c('0x8')](),controller['update']);router[_0x823c('0x15')](_0x823c('0xc'),auth[_0x823c('0x8')](),controller['destroy']);router[_0x823c('0x15')](_0x823c('0x16'),auth[_0x823c('0x8')](),controller[_0x823c('0x17')]);router[_0x823c('0x15')](_0x823c('0x11'),auth[_0x823c('0x8')](),controller[_0x823c('0x18')]);module[_0x823c('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index f8c5a14..0396f86 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 _0xdca4=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING','INTEGER'];(function(_0x269ac2,_0x139b30){var _0x288e11=function(_0x3886e3){while(--_0x3886e3){_0x269ac2['push'](_0x269ac2['shift']());}};_0x288e11(++_0x139b30);}(_0xdca4,0x138));var _0x4dca=function(_0x58374b,_0x5be5c1){_0x58374b=_0x58374b-0x0;var _0x4ae033=_0xdca4[_0x58374b];return _0x4ae033;};'use strict';var Sequelize=require(_0x4dca('0x0'));module['exports']={'name':{'type':Sequelize[_0x4dca('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4dca('0x1')]},'timeout':{'type':Sequelize[_0x4dca('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4dca('0x3')](_0x4dca('0x4'),_0x4dca('0x5'),_0x4dca('0x6'))}}; \ No newline at end of file +var _0xebae=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xebae,0x83));var _0xeeba=function(_0x344128,_0x9b9e88){_0x344128=_0x344128-0x0;var _0x693fae=_0xebae[_0x344128];return _0x693fae;};'use strict';var Sequelize=require(_0xeeba('0x0'));module[_0xeeba('0x1')]={'name':{'type':Sequelize[_0xeeba('0x2')],'unique':_0xeeba('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeeba('0x4')](_0xeeba('0x5'),_0xeeba('0x6'),_0xeeba('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index d46e3cb..d9b5e77 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 _0x517e=['MailQueue','includeAll','findAll','rows','show','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','MailQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','rawAttributes','order','MailQueueId','UserMailQueue','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','field','tq.TeamId','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','all','union','compact','value','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','then','destroy','get','error','stack','name','send','map','fieldName','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x517e,0x1e9));var _0xe517=function(_0x62a9c1,_0x1e5f1e){_0x62a9c1=_0x62a9c1-0x0;var _0x30e7f1=_0x517e[_0x62a9c1];return _0x30e7f1;};'use strict';var pdf=require(_0xe517('0x0'));var emlformat=require(_0xe517('0x1'));var rimraf=require(_0xe517('0x2'));var zipdir=require(_0xe517('0x3'));var jsonpatch=require(_0xe517('0x4'));var rp=require(_0xe517('0x5'));var moment=require(_0xe517('0x6'));var BPromise=require(_0xe517('0x7'));var Mustache=require(_0xe517('0x8'));var util=require('util');var path=require(_0xe517('0x9'));var sox=require('sox');var csv=require(_0xe517('0xa'));var ejs=require(_0xe517('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe517('0xc'));var crypto=require(_0xe517('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe517('0xe'));var toCsv=require(_0xe517('0xa'));var querystring=require('querystring');var Papa=require(_0xe517('0xf'));var Redis=require(_0xe517('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe517('0x11'));var as=require(_0xe517('0x12'));var hardwareService=require(_0xe517('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xe517('0x14'));var config=require(_0xe517('0x15'));var db=require('../../mysqldb')['db'];config[_0xe517('0x16')]=_['defaults'](config[_0xe517('0x16')],{'host':_0xe517('0x17'),'port':0x18eb});var socket=require(_0xe517('0x18'))(new Redis(config[_0xe517('0x16')]));require(_0xe517('0x19'))[_0xe517('0x1a')](socket);function respondWithStatusCode(_0x2843d1,_0x8f2f97){_0x8f2f97=_0x8f2f97||0xcc;return function(_0x4a88ff){if(_0x4a88ff){return _0x2843d1[_0xe517('0x1b')](_0x8f2f97);}return _0x2843d1[_0xe517('0x1c')](_0x8f2f97)[_0xe517('0x1d')]();};}function respondWithResult(_0x1ce232,_0x285c49){_0x285c49=_0x285c49||0xc8;return function(_0x588433){if(_0x588433){return _0x1ce232[_0xe517('0x1c')](_0x285c49)[_0xe517('0x1e')](_0x588433);}};}function respondWithFilteredResult(_0xab1ff1,_0x447884){return function(_0x6ae8c){if(_0x6ae8c){var _0x488888=_0x6ae8c[_0xe517('0x1f')],_0x490628=_0x447884['offset'],_0x5c0989=_0x447884[_0xe517('0x20')]+_0x447884[_0xe517('0x21')],_0x739d9f;if(_0x5c0989>=_0x488888){_0x5c0989=_0x488888;_0x739d9f=0xc8;}else{_0x739d9f=0xce;}_0xab1ff1[_0xe517('0x1c')](_0x739d9f);return _0xab1ff1['set'](_0xe517('0x22'),_0x490628+'-'+_0x5c0989+'/'+_0x488888)[_0xe517('0x1e')](_0x6ae8c);}return null;};}function patchUpdates(_0x31355a){return function(_0x542714){try{jsonpatch[_0xe517('0x23')](_0x542714,_0x31355a,!![]);}catch(_0x413943){return BPromise[_0xe517('0x24')](_0x413943);}return _0x542714['save']();};}function saveUpdates(_0x26e264,_0x52f99a){return function(_0x5845a8){if(_0x5845a8){return _0x5845a8['update'](_0x26e264)[_0xe517('0x25')](function(_0x27f1ca){return _0x27f1ca;});}return null;};}function removeEntity(_0x4ee96d,_0x476558){return function(_0x514f08){if(_0x514f08){return _0x514f08[_0xe517('0x26')]()[_0xe517('0x25')](function(){var _0x56753a=_0x514f08[_0xe517('0x27')]({'plain':!![]});var _0x22cba2='MailQueues';return db['UserProfileResource'][_0xe517('0x26')]({'where':{'type':_0x22cba2,'resourceId':_0x56753a['id']}})[_0xe517('0x25')](function(){return _0x514f08;});})[_0xe517('0x25')](function(){_0x4ee96d['status'](0xcc)[_0xe517('0x1d')]();});}};}function handleEntityNotFound(_0xddfd6a,_0x422cd1){return function(_0x3381cf){if(!_0x3381cf){_0xddfd6a['sendStatus'](0x194);}return _0x3381cf;};}function handleError(_0x17612a,_0x24a8be){_0x24a8be=_0x24a8be||0x1f4;return function(_0x330dcb){logger[_0xe517('0x28')](_0x330dcb[_0xe517('0x29')]);if(_0x330dcb[_0xe517('0x2a')]){delete _0x330dcb['name'];}_0x17612a[_0xe517('0x1c')](_0x24a8be)[_0xe517('0x2b')](_0x330dcb);};}exports['index']=function(_0x165f38,_0x53d299){var _0x1ba44a={},_0x59dc08={},_0x274786={'count':0x0,'rows':[]};var _0x280771=_[_0xe517('0x2c')](db['MailQueue']['rawAttributes'],function(_0xc20164){return{'name':_0xc20164[_0xe517('0x2d')],'type':_0xc20164[_0xe517('0x2e')]['key']};});_0x59dc08[_0xe517('0x2f')]=_[_0xe517('0x2c')](_0x280771,_0xe517('0x2a'));_0x59dc08['query']=_[_0xe517('0x30')](_0x165f38[_0xe517('0x31')]);_0x59dc08['filters']=_['intersection'](_0x59dc08[_0xe517('0x2f')],_0x59dc08['query']);_0x1ba44a[_0xe517('0x32')]=_[_0xe517('0x33')](_0x59dc08[_0xe517('0x2f')],qs['fields'](_0x165f38[_0xe517('0x31')][_0xe517('0x34')]));_0x1ba44a['attributes']=_0x1ba44a[_0xe517('0x32')][_0xe517('0x35')]?_0x1ba44a[_0xe517('0x32')]:_0x59dc08[_0xe517('0x2f')];if(!_0x165f38['query'][_0xe517('0x36')](_0xe517('0x37'))){_0x1ba44a['limit']=qs[_0xe517('0x21')](_0x165f38['query'][_0xe517('0x21')]);_0x1ba44a['offset']=qs[_0xe517('0x20')](_0x165f38[_0xe517('0x31')][_0xe517('0x20')]);}_0x1ba44a['order']=qs[_0xe517('0x38')](_0x165f38[_0xe517('0x31')][_0xe517('0x38')]);_0x1ba44a[_0xe517('0x39')]=qs[_0xe517('0x3a')](_[_0xe517('0x3b')](_0x165f38['query'],_0x59dc08['filters']),_0x280771);if(_0x165f38[_0xe517('0x31')][_0xe517('0x3c')]){_0x1ba44a[_0xe517('0x39')]=_['merge'](_0x1ba44a['where'],{'$or':_[_0xe517('0x2c')](_0x280771,function(_0x36428d){if(_0x36428d[_0xe517('0x2e')]!=='VIRTUAL'){var _0x217605={};_0x217605[_0x36428d[_0xe517('0x2a')]]={'$like':'%'+_0x165f38[_0xe517('0x31')][_0xe517('0x3c')]+'%'};return _0x217605;}})});}_0x1ba44a=_[_0xe517('0x3d')]({},_0x1ba44a,_0x165f38[_0xe517('0x3e')]);var _0xaf21ee={'where':_0x1ba44a['where']};return db[_0xe517('0x3f')][_0xe517('0x1f')](_0xaf21ee)[_0xe517('0x25')](function(_0x1f67d0){_0x274786[_0xe517('0x1f')]=_0x1f67d0;if(_0x165f38['query'][_0xe517('0x40')]){_0x1ba44a['include']=[{'all':!![]}];}return db['MailQueue'][_0xe517('0x41')](_0x1ba44a);})[_0xe517('0x25')](function(_0x24b8c9){_0x274786[_0xe517('0x42')]=_0x24b8c9;return _0x274786;})['then'](respondWithFilteredResult(_0x53d299,_0x1ba44a))['catch'](handleError(_0x53d299,null));};exports[_0xe517('0x43')]=function(_0x4effca,_0x217d68){var _0x1c6184={'raw':!![],'where':{'id':_0x4effca[_0xe517('0x44')]['id']}},_0x193c5e={};_0x193c5e[_0xe517('0x2f')]=_[_0xe517('0x30')](db[_0xe517('0x3f')]['rawAttributes']);_0x193c5e[_0xe517('0x31')]=_[_0xe517('0x30')](_0x4effca['query']);_0x193c5e[_0xe517('0x3a')]=_[_0xe517('0x33')](_0x193c5e['model'],_0x193c5e[_0xe517('0x31')]);_0x1c6184[_0xe517('0x32')]=_[_0xe517('0x33')](_0x193c5e[_0xe517('0x2f')],qs[_0xe517('0x34')](_0x4effca[_0xe517('0x31')][_0xe517('0x34')]));_0x1c6184[_0xe517('0x32')]=_0x1c6184[_0xe517('0x32')][_0xe517('0x35')]?_0x1c6184['attributes']:_0x193c5e['model'];if(_0x4effca[_0xe517('0x31')]['includeAll']){_0x1c6184['include']=[{'all':!![]}];}_0x1c6184=_[_0xe517('0x3d')]({},_0x1c6184,_0x4effca[_0xe517('0x3e')]);return db[_0xe517('0x3f')][_0xe517('0x45')](_0x1c6184)[_0xe517('0x25')](handleEntityNotFound(_0x217d68,null))['then'](respondWithResult(_0x217d68,null))[_0xe517('0x46')](handleError(_0x217d68,null));};exports[_0xe517('0x47')]=function(_0x43b76d,_0x1531ea){return db[_0xe517('0x3f')][_0xe517('0x47')](_0x43b76d[_0xe517('0x48')],{})['then'](function(_0x12bc96){var _0x56518f=_0x43b76d['user'][_0xe517('0x27')]({'plain':!![]});if(!_0x56518f)throw new Error(_0xe517('0x49'));if(_0x56518f[_0xe517('0x4a')]===_0xe517('0x4b')){var _0x4b5a78=_0x12bc96[_0xe517('0x27')]({'plain':!![]});var _0x3901e5=_0xe517('0x4c');return db[_0xe517('0x4d')][_0xe517('0x45')]({'where':{'name':_0x3901e5,'userProfileId':_0x56518f[_0xe517('0x4e')]},'raw':!![]})[_0xe517('0x25')](function(_0x251f6a){if(_0x251f6a&&_0x251f6a[_0xe517('0x4f')]===0x0){return db[_0xe517('0x50')][_0xe517('0x47')]({'name':_0x4b5a78[_0xe517('0x2a')],'resourceId':_0x4b5a78['id'],'type':_0x251f6a['name'],'sectionId':_0x251f6a['id']},{})[_0xe517('0x25')](function(){return _0x12bc96;});}else{return _0x12bc96;}})[_0xe517('0x46')](function(_0x13b831){logger[_0xe517('0x28')](_0xe517('0x51'),_0x13b831);throw _0x13b831;});}return _0x12bc96;})[_0xe517('0x25')](respondWithResult(_0x1531ea,0xc9))['catch'](handleError(_0x1531ea,null));};exports['update']=function(_0x259d77,_0x444917){if(_0x259d77[_0xe517('0x48')]['id']){delete _0x259d77[_0xe517('0x48')]['id'];}return db[_0xe517('0x3f')]['find']({'where':{'id':_0x259d77[_0xe517('0x44')]['id']}})['then'](handleEntityNotFound(_0x444917,null))[_0xe517('0x25')](saveUpdates(_0x259d77[_0xe517('0x48')],null))['then'](respondWithResult(_0x444917,null))[_0xe517('0x46')](handleError(_0x444917,null));};exports[_0xe517('0x26')]=function(_0x241681,_0xd276d0){return db[_0xe517('0x3f')][_0xe517('0x45')]({'where':{'id':_0x241681[_0xe517('0x44')]['id']}})[_0xe517('0x25')](handleEntityNotFound(_0xd276d0,null))['then'](removeEntity(_0xd276d0,null))[_0xe517('0x46')](handleError(_0xd276d0,null));};exports['describe']=function(_0xf9e46,_0xcbe63e){return db[_0xe517('0x3f')][_0xe517('0x52')]()[_0xe517('0x25')](respondWithResult(_0xcbe63e,null))[_0xe517('0x46')](handleError(_0xcbe63e,null));};exports[_0xe517('0x53')]=function(_0x50e0eb,_0x1b7d90,_0x4c1a72){var _0x38e81d={'raw':!![],'where':{}},_0x3ff86a={},_0x42f7a4;return db[_0xe517('0x3f')]['findOne']({'where':{'id':_0x50e0eb['params']['id']}})[_0xe517('0x25')](handleEntityNotFound(_0x1b7d90,null))[_0xe517('0x25')](function(_0x4584c8){if(_0x4584c8){_0x42f7a4=_0x4584c8[_0xe517('0x27')]({'plain':!![]});_0x3ff86a['model']=_[_0xe517('0x30')](db['UserMailQueue'][_0xe517('0x54')]);_0x3ff86a[_0xe517('0x31')]=_[_0xe517('0x30')](_0x50e0eb[_0xe517('0x31')]);_0x3ff86a[_0xe517('0x3a')]=_[_0xe517('0x33')](_0x3ff86a['model'],_0x3ff86a[_0xe517('0x31')]);_0x38e81d[_0xe517('0x32')]=_[_0xe517('0x33')](_0x3ff86a[_0xe517('0x2f')],qs[_0xe517('0x34')](_0x50e0eb[_0xe517('0x31')]['fields']));_0x38e81d[_0xe517('0x32')]=_0x38e81d[_0xe517('0x32')][_0xe517('0x35')]?_0x38e81d[_0xe517('0x32')]:_0x3ff86a[_0xe517('0x2f')];if(!_0x50e0eb[_0xe517('0x31')][_0xe517('0x36')](_0xe517('0x37'))){_0x38e81d[_0xe517('0x21')]=qs[_0xe517('0x21')](_0x50e0eb[_0xe517('0x31')][_0xe517('0x21')]);_0x38e81d[_0xe517('0x20')]=qs[_0xe517('0x20')](_0x50e0eb['query'][_0xe517('0x20')]);}_0x38e81d[_0xe517('0x55')]=qs['sort'](_0x50e0eb[_0xe517('0x31')]['sort']);_0x38e81d[_0xe517('0x39')]=qs[_0xe517('0x3a')](_['pick'](_0x50e0eb[_0xe517('0x31')],_0x3ff86a[_0xe517('0x3a')]));_0x38e81d[_0xe517('0x39')][_0xe517('0x56')]=_0x4584c8['id'];if(_0x50e0eb['query']['filter']){_0x38e81d[_0xe517('0x39')]=_[_0xe517('0x3d')](_0x38e81d['where'],{'$or':_[_0xe517('0x2c')](_0x38e81d['attributes'],function(_0x5c21c7){var _0x101886={};_0x101886[_0x5c21c7]={'$like':'%'+_0x50e0eb[_0xe517('0x31')][_0xe517('0x3c')]+'%'};return _0x101886;})});}_0x38e81d=_['merge']({},_0x38e81d,_0x50e0eb[_0xe517('0x3e')]);return db[_0xe517('0x57')][_0xe517('0x41')](_0x38e81d);}})[_0xe517('0x25')](function(_0x58bcb1){if(_0x58bcb1){return db[_0xe517('0x58')][_0xe517('0x59')]({'where':{'id':_[_0xe517('0x2c')](_0x58bcb1,_0xe517('0x5a')),'role':_0xe517('0x5b')},'attributes':['id',_0xe517('0x2a'),_0xe517('0x5c'),_0xe517('0x5d'),_0xe517('0x5e')]});}})['then'](function(_0x28b147){if(_0x28b147){return{'count':_0x28b147[_0xe517('0x1f')],'rows':_[_0xe517('0x2c')](_0x28b147[_0xe517('0x42')],function(_0x3f7106){return{'membername':_0x3f7106['name'],'UserId':_0x3f7106['id'],'queue_name':_0x42f7a4[_0xe517('0x2a')],'MailQueueId':_0x42f7a4['id'],'interface':util['format'](_0xe517('0x5f'),_0xe517('0x60'),_0x3f7106[_0xe517('0x2a')]),'penalty':0x0,'paused':_0x3f7106['mailPause'],'createdAt':_0x3f7106['createdAt'],'updatedAt':_0x3f7106['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1b7d90,_0x38e81d))[_0xe517('0x46')](handleError(_0x1b7d90,null));};exports[_0xe517('0x61')]=function(_0x12157d,_0x5c4e80,_0x52d234){var _0x372f4e={};var _0x91ad0f={};var _0x687a13;var _0x50d9e3;return db[_0xe517('0x3f')][_0xe517('0x62')]({'where':{'id':_0x12157d[_0xe517('0x44')]['id']}})[_0xe517('0x25')](handleEntityNotFound(_0x5c4e80,null))['then'](function(_0x2031fe){if(_0x2031fe){_0x687a13=_0x2031fe;_0x91ad0f[_0xe517('0x2f')]=_[_0xe517('0x30')](db[_0xe517('0x63')][_0xe517('0x54')]);_0x91ad0f[_0xe517('0x31')]=_['keys'](_0x12157d[_0xe517('0x31')]);_0x91ad0f[_0xe517('0x3a')]=_[_0xe517('0x33')](_0x91ad0f['model'],_0x91ad0f['query']);_0x372f4e[_0xe517('0x32')]=_[_0xe517('0x33')](_0x91ad0f[_0xe517('0x2f')],qs['fields'](_0x12157d[_0xe517('0x31')][_0xe517('0x34')]));_0x372f4e[_0xe517('0x32')]=_0x372f4e[_0xe517('0x32')]['length']?_0x372f4e[_0xe517('0x32')]:_0x91ad0f[_0xe517('0x2f')];_0x372f4e['order']=qs[_0xe517('0x38')](_0x12157d[_0xe517('0x31')]['sort']);_0x372f4e[_0xe517('0x39')]=qs[_0xe517('0x3a')](_[_0xe517('0x3b')](_0x12157d[_0xe517('0x31')],_0x91ad0f[_0xe517('0x3a')]));if(_0x12157d['query'][_0xe517('0x3c')]){_0x372f4e['where']=_['merge'](_0x372f4e[_0xe517('0x39')],{'$or':_[_0xe517('0x2c')](_0x372f4e['attributes'],function(_0x5400e2){var _0x5c4af9={};_0x5c4af9[_0x5400e2]={'$like':'%'+_0x12157d[_0xe517('0x31')]['filter']+'%'};return _0x5c4af9;})});}_0x372f4e=_[_0xe517('0x3d')]({},_0x372f4e,_0x12157d[_0xe517('0x3e')]);return _0x687a13[_0xe517('0x61')](_0x372f4e);}})[_0xe517('0x25')](function(_0x44b14a){if(_0x44b14a){_0x50d9e3=_0x44b14a[_0xe517('0x35')];if(!_0x12157d[_0xe517('0x31')]['hasOwnProperty'](_0xe517('0x37'))){_0x372f4e[_0xe517('0x21')]=qs['limit'](_0x12157d[_0xe517('0x31')][_0xe517('0x21')]);_0x372f4e[_0xe517('0x20')]=qs[_0xe517('0x20')](_0x12157d['query'][_0xe517('0x20')]);}return _0x687a13[_0xe517('0x61')](_0x372f4e);}})['then'](function(_0x2e906a){if(_0x2e906a){return _0x2e906a?{'count':_0x50d9e3,'rows':_0x2e906a}:null;}})[_0xe517('0x25')](respondWithResult(_0x5c4e80,null))[_0xe517('0x46')](handleError(_0x5c4e80,null));};exports[_0xe517('0x64')]=function(_0x4ff7d3,_0xf69f0e,_0x2d91d0){var _0x439a0c=_0x4ff7d3[_0xe517('0x48')][_0xe517('0x65')];return db[_0xe517('0x63')][_0xe517('0x41')]({'where':{'id':_0x439a0c},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe517('0x66'),'attributes':['id',_0xe517('0x2a'),_0xe517('0x67'),_0xe517('0x68'),_0xe517('0x69')],'raw':!![]}]})[_0xe517('0x25')](function(_0x1b51d4){if(_0x1b51d4){var _0x6e1b0a=_[_0xe517('0x6a')](_0x1b51d4,function(_0x4ed94e){var _0x3d22a9=_0x4ed94e[_0xe517('0x27')]({'plain':!![]});return _0x3d22a9[_0xe517('0x66')];});return db[_0xe517('0x3f')]['find']({'where':{'id':_0x4ff7d3[_0xe517('0x44')]['id']}})[_0xe517('0x25')](function(_0x168455){return db[_0xe517('0x6b')][_0xe517('0x6c')](function(_0x319c6d){return _0x168455[_0xe517('0x64')](_0x439a0c,{'transaction':_0x319c6d})[_0xe517('0x25')](function(){return BPromise['each'](_0x6e1b0a,function(_0x4dd497){return db[_0xe517('0x57')][_0xe517('0x6d')]({'where':{'UserId':_0x4dd497['id'],'MailQueueId':_0x4ff7d3[_0xe517('0x44')]['id']},'transaction':_0x319c6d});});})['then'](function(){_0x6e1b0a[_0xe517('0x6e')](function(_0x2f178e){socket[_0xe517('0x6f')](_0xe517('0x70'),{'UserId':_0x2f178e['id'],'MailQueueId':_0x168455['id']});});});});});}})[_0xe517('0x25')](respondWithStatusCode(_0xf69f0e,null))[_0xe517('0x46')](handleError(_0xf69f0e,null));};exports[_0xe517('0x71')]=function(_0x56d845,_0x25f088,_0x4229df){return db[_0xe517('0x63')][_0xe517('0x41')]({'where':{'id':_0x56d845['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe517('0x25')](handleEntityNotFound(_0x25f088,null))[_0xe517('0x25')](function(_0x39ccb3){var _0x46dfbf=_[_0xe517('0x2c')](_0x39ccb3,'id');var _0x3c1f9f=[];var _0x4241f6=[];var _0x31d149=squel['select']();_0x31d149[_0xe517('0x72')](_0xe517('0x73'))['from'](_0xe517('0x74'),'tq')[_0xe517('0x75')]('user_has_teams','ut',_0xe517('0x76'))[_0xe517('0x39')](_0xe517('0x77'),_0x56d845['params']['id']);for(var _0x1ad43d=0x0;_0x1ad43d<_0x39ccb3['length'];_0x1ad43d+=0x1){let _0x36a170=_0x39ccb3[_0x1ad43d];for(var _0x2fc9a7=0x0;_0x2fc9a7<_0x36a170[_0xe517('0x66')][_0xe517('0x35')];_0x2fc9a7+=0x1){let _0x1aed0b=_0x36a170[_0xe517('0x66')][_0x2fc9a7];var _0x242e9c=_0x31d149[_0xe517('0x78')]();_0x242e9c[_0xe517('0x39')](_0xe517('0x79'),_0x1aed0b['id']);_0x4241f6[_0xe517('0x7a')](db[_0xe517('0x6b')]['query'](_0x242e9c['toString'](),{'type':db[_0xe517('0x6b')][_0xe517('0x7b')][_0xe517('0x7c')]})[_0xe517('0x25')](function(_0x243dcc){if(_0x243dcc[_0xe517('0x35')]===0x1){return _0x1aed0b['id'];}else{var _0x169f82=_[_0xe517('0x7d')](_[_0xe517('0x2c')](_0x243dcc,'TeamId'),function(_0x48ceba){return _['includes'](_0x46dfbf,_0x48ceba);});if(_0x169f82){return _0x1aed0b['id'];}}}));}}return BPromise[_0xe517('0x7e')](_0x4241f6)[_0xe517('0x25')](function(_0x581e2a){_0x3c1f9f=_(_0x3c1f9f)[_0xe517('0x7f')](_0x581e2a)[_0xe517('0x80')]()[_0xe517('0x81')]();return db[_0xe517('0x3f')][_0xe517('0x45')]({'where':{'id':_0x56d845[_0xe517('0x44')]['id']}})[_0xe517('0x25')](function(_0x47874d){return db[_0xe517('0x6b')][_0xe517('0x6c')](function(_0x467d55){return _0x47874d['removeTeams'](_0x56d845[_0xe517('0x31')]['ids'],{'transaction':_0x467d55})[_0xe517('0x25')](function(){if(!_[_0xe517('0x82')](_0x3c1f9f)){return _0x47874d['removeAgents'](_0x3c1f9f,{'transaction':_0x467d55});}})['then'](function(){_0x3c1f9f['forEach'](function(_0x5bd026){socket['emit'](_0xe517('0x83'),{'UserId':_0x5bd026,'MailQueueId':_0x47874d['id']});});});});});});})['then'](respondWithStatusCode(_0x25f088,null))[_0xe517('0x46')](handleError(_0x25f088,null));};exports['addAgents']=function(_0x4e9966,_0x1b3b77,_0x42ee51){return db[_0xe517('0x3f')][_0xe517('0x45')]({'where':{'id':_0x4e9966[_0xe517('0x44')]['id']}})[_0xe517('0x25')](handleEntityNotFound(_0x1b3b77,null))[_0xe517('0x25')](function(_0x5ead87){if(_0x5ead87){return _0x5ead87[_0xe517('0x84')](_0x4e9966[_0xe517('0x48')][_0xe517('0x65')],_[_0xe517('0x85')](_0x4e9966['body'],[_0xe517('0x65'),'id'])||{})[_0xe517('0x86')](function(_0xebf19a){for(var _0x34ed5b=0x0;_0x34ed5b<_0x4e9966[_0xe517('0x48')][_0xe517('0x65')][_0xe517('0x35')];_0x34ed5b+=0x1){socket[_0xe517('0x6f')](_0xe517('0x70'),{'UserId':_0x4e9966[_0xe517('0x48')][_0xe517('0x65')][_0x34ed5b],'MailQueueId':_0x4e9966['params']['id']});}return _0xebf19a;});}})[_0xe517('0x25')](respondWithResult(_0x1b3b77,null))[_0xe517('0x46')](handleError(_0x1b3b77,null));};exports[_0xe517('0x87')]=function(_0x52c9b3,_0x27526b,_0x2c7635){return db[_0xe517('0x3f')][_0xe517('0x45')]({'where':{'id':_0x52c9b3[_0xe517('0x44')]['id']}})[_0xe517('0x25')](handleEntityNotFound(_0x27526b,null))['then'](function(_0x3c1fd0){if(_0x3c1fd0){return _0x3c1fd0[_0xe517('0x87')](_0x52c9b3[_0xe517('0x31')][_0xe517('0x65')])[_0xe517('0x25')](function(){if(_[_0xe517('0x88')](_0x52c9b3['query'][_0xe517('0x65')])){for(var _0x405d82=0x0;_0x405d82<_0x52c9b3[_0xe517('0x31')][_0xe517('0x65')][_0xe517('0x35')];_0x405d82+=0x1){socket['emit'](_0xe517('0x83'),{'UserId':Number(_0x52c9b3[_0xe517('0x31')][_0xe517('0x65')][_0x405d82]),'MailQueueId':Number(_0x52c9b3['params']['id'])});}}else{socket['emit'](_0xe517('0x83'),{'UserId':Number(_0x52c9b3[_0xe517('0x31')][_0xe517('0x65')]),'MailQueueId':Number(_0x52c9b3[_0xe517('0x44')]['id'])});}});}})['then'](respondWithStatusCode(_0x27526b,null))['catch'](handleError(_0x27526b,null));};exports[_0xe517('0x89')]=function(_0x334ad0,_0xb063e4,_0x12286d){var _0x1c4813={};var _0x1b188d={};var _0x2dece4;var _0x12f0d9;return db[_0xe517('0x3f')][_0xe517('0x62')]({'where':{'id':_0x334ad0[_0xe517('0x44')]['id']}})[_0xe517('0x25')](handleEntityNotFound(_0xb063e4,null))[_0xe517('0x25')](function(_0x550d15){if(_0x550d15){_0x2dece4=_0x550d15;_0x1b188d['model']=_['keys'](db['User'][_0xe517('0x54')]);_0x1b188d[_0xe517('0x31')]=_[_0xe517('0x30')](_0x334ad0[_0xe517('0x31')]);_0x1b188d[_0xe517('0x3a')]=_[_0xe517('0x33')](_0x1b188d[_0xe517('0x2f')],_0x1b188d[_0xe517('0x31')]);_0x1c4813['attributes']=_['intersection'](_0x1b188d['model'],qs[_0xe517('0x34')](_0x334ad0[_0xe517('0x31')]['fields']));_0x1c4813[_0xe517('0x32')]=_0x1c4813[_0xe517('0x32')][_0xe517('0x35')]?_0x1c4813['attributes']:_0x1b188d[_0xe517('0x2f')];_0x1c4813[_0xe517('0x55')]=qs[_0xe517('0x38')](_0x334ad0[_0xe517('0x31')]['sort']);_0x1c4813[_0xe517('0x39')]=qs['filters'](_[_0xe517('0x3b')](_0x334ad0[_0xe517('0x31')],_0x1b188d[_0xe517('0x3a')]));if(_0x334ad0[_0xe517('0x31')][_0xe517('0x3c')]){_0x1c4813['where']=_[_0xe517('0x3d')](_0x1c4813[_0xe517('0x39')],{'$or':_[_0xe517('0x2c')](_0x1c4813[_0xe517('0x32')],function(_0x122b78){var _0xb9a708={};_0xb9a708[_0x122b78]={'$like':'%'+_0x334ad0[_0xe517('0x31')][_0xe517('0x3c')]+'%'};return _0xb9a708;})});}_0x1c4813=_[_0xe517('0x3d')]({},_0x1c4813,_0x334ad0['options']);return _0x2dece4['getAgents'](_0x1c4813);}})[_0xe517('0x25')](function(_0x598517){if(_0x598517){_0x12f0d9=_0x598517[_0xe517('0x35')];if(!_0x334ad0[_0xe517('0x31')][_0xe517('0x36')](_0xe517('0x37'))){_0x1c4813['limit']=qs[_0xe517('0x21')](_0x334ad0[_0xe517('0x31')][_0xe517('0x21')]);_0x1c4813[_0xe517('0x20')]=qs[_0xe517('0x20')](_0x334ad0[_0xe517('0x31')]['offset']);}return _0x2dece4['getAgents'](_0x1c4813);}})[_0xe517('0x25')](function(_0x392535){if(_0x392535){return _0x392535?{'count':_0x12f0d9,'rows':_0x392535}:null;}})[_0xe517('0x25')](respondWithResult(_0xb063e4,null))[_0xe517('0x46')](handleError(_0xb063e4,null));}; \ No newline at end of file +var _0x7732=['rows','format','%s/%s','SIP','getTeams','ids','Team','Agents','interface','sequelize','transaction','addTeams','findOrCreate','emit','userMailQueue:save','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','union','removeTeams','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./mailQueue.socket','register','status','end','json','count','set','Content-Range','reject','update','destroy','then','get','UserProfileResource','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','key','map','keys','query','model','attributes','intersection','fields','length','nolimit','limit','offset','sort','where','filters','filter','VIRTUAL','merge','options','catch','params','MailQueue','includeAll','include','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','body','describe','getMembers','findOne','hasOwnProperty','order','pick','MailQueueId','UserMailQueue','findAll','User','findAndCountAll','mailPause','updatedAt','createdAt'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x7732,0xad));var _0x2773=function(_0x188d31,_0x576e87){_0x188d31=_0x188d31-0x0;var _0x30ed33=_0x7732[_0x188d31];return _0x30ed33;};'use strict';var pdf=require(_0x2773('0x0'));var emlformat=require(_0x2773('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2773('0x2'));var rp=require(_0x2773('0x3'));var moment=require(_0x2773('0x4'));var BPromise=require(_0x2773('0x5'));var Mustache=require(_0x2773('0x6'));var util=require('util');var path=require('path');var sox=require(_0x2773('0x7'));var csv=require(_0x2773('0x8'));var ejs=require(_0x2773('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2773('0xa'));var crypto=require(_0x2773('0xb'));var jsforce=require(_0x2773('0xc'));var deskjs=require(_0x2773('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2773('0xe'));var Redis=require('ioredis');var authService=require(_0x2773('0xf'));var qs=require(_0x2773('0x10'));var as=require(_0x2773('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2773('0x12'))(_0x2773('0x13'));var utils=require(_0x2773('0x14'));var config=require('../../config/environment');var db=require(_0x2773('0x15'))['db'];config['redis']=_[_0x2773('0x16')](config[_0x2773('0x17')],{'host':_0x2773('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2773('0x17')]));require(_0x2773('0x19'))[_0x2773('0x1a')](socket);function respondWithStatusCode(_0x2d4066,_0x37abdd){_0x37abdd=_0x37abdd||0xcc;return function(_0x1a7706){if(_0x1a7706){return _0x2d4066['sendStatus'](_0x37abdd);}return _0x2d4066[_0x2773('0x1b')](_0x37abdd)[_0x2773('0x1c')]();};}function respondWithResult(_0x43a180,_0x59bd62){_0x59bd62=_0x59bd62||0xc8;return function(_0x2ea6b0){if(_0x2ea6b0){return _0x43a180[_0x2773('0x1b')](_0x59bd62)[_0x2773('0x1d')](_0x2ea6b0);}};}function respondWithFilteredResult(_0x50784d,_0x28584b){return function(_0x28634a){if(_0x28634a){var _0x33a3e9=_0x28634a[_0x2773('0x1e')],_0xcdba40=_0x28584b['offset'],_0x2e1999=_0x28584b['offset']+_0x28584b['limit'],_0x24985d;if(_0x2e1999>=_0x33a3e9){_0x2e1999=_0x33a3e9;_0x24985d=0xc8;}else{_0x24985d=0xce;}_0x50784d['status'](_0x24985d);return _0x50784d[_0x2773('0x1f')](_0x2773('0x20'),_0xcdba40+'-'+_0x2e1999+'/'+_0x33a3e9)['json'](_0x28634a);}return null;};}function patchUpdates(_0x1db4e7){return function(_0x2b41ac){try{jsonpatch['apply'](_0x2b41ac,_0x1db4e7,!![]);}catch(_0x1d0f25){return BPromise[_0x2773('0x21')](_0x1d0f25);}return _0x2b41ac['save']();};}function saveUpdates(_0x3507b5,_0x16feb5){return function(_0x14eba0){if(_0x14eba0){return _0x14eba0[_0x2773('0x22')](_0x3507b5)['then'](function(_0xa2b1af){return _0xa2b1af;});}return null;};}function removeEntity(_0xa58022,_0xd52612){return function(_0x15c0ec){if(_0x15c0ec){return _0x15c0ec[_0x2773('0x23')]()[_0x2773('0x24')](function(){var _0x2bdf47=_0x15c0ec[_0x2773('0x25')]({'plain':!![]});var _0x37bd20='MailQueues';return db[_0x2773('0x26')]['destroy']({'where':{'type':_0x37bd20,'resourceId':_0x2bdf47['id']}})[_0x2773('0x24')](function(){return _0x15c0ec;});})[_0x2773('0x24')](function(){_0xa58022[_0x2773('0x1b')](0xcc)[_0x2773('0x1c')]();});}};}function handleEntityNotFound(_0x39dc6a,_0x579908){return function(_0x8c1149){if(!_0x8c1149){_0x39dc6a[_0x2773('0x27')](0x194);}return _0x8c1149;};}function handleError(_0x308329,_0x124d96){_0x124d96=_0x124d96||0x1f4;return function(_0x451063){logger[_0x2773('0x28')](_0x451063[_0x2773('0x29')]);if(_0x451063['name']){delete _0x451063[_0x2773('0x2a')];}_0x308329[_0x2773('0x1b')](_0x124d96)[_0x2773('0x2b')](_0x451063);};}exports['index']=function(_0x1985ad,_0x1655e8){var _0x3eb356={},_0x58ce74={},_0x5d07f4={'count':0x0,'rows':[]};var _0x2fe5bd=_['map'](db['MailQueue'][_0x2773('0x2c')],function(_0x392ab4){return{'name':_0x392ab4[_0x2773('0x2d')],'type':_0x392ab4[_0x2773('0x2e')][_0x2773('0x2f')]};});_0x58ce74['model']=_[_0x2773('0x30')](_0x2fe5bd,_0x2773('0x2a'));_0x58ce74['query']=_[_0x2773('0x31')](_0x1985ad[_0x2773('0x32')]);_0x58ce74['filters']=_['intersection'](_0x58ce74[_0x2773('0x33')],_0x58ce74[_0x2773('0x32')]);_0x3eb356[_0x2773('0x34')]=_[_0x2773('0x35')](_0x58ce74[_0x2773('0x33')],qs['fields'](_0x1985ad[_0x2773('0x32')][_0x2773('0x36')]));_0x3eb356[_0x2773('0x34')]=_0x3eb356['attributes'][_0x2773('0x37')]?_0x3eb356['attributes']:_0x58ce74['model'];if(!_0x1985ad[_0x2773('0x32')]['hasOwnProperty'](_0x2773('0x38'))){_0x3eb356[_0x2773('0x39')]=qs[_0x2773('0x39')](_0x1985ad['query']['limit']);_0x3eb356[_0x2773('0x3a')]=qs[_0x2773('0x3a')](_0x1985ad[_0x2773('0x32')][_0x2773('0x3a')]);}_0x3eb356['order']=qs[_0x2773('0x3b')](_0x1985ad[_0x2773('0x32')]['sort']);_0x3eb356[_0x2773('0x3c')]=qs['filters'](_['pick'](_0x1985ad['query'],_0x58ce74[_0x2773('0x3d')]),_0x2fe5bd);if(_0x1985ad['query'][_0x2773('0x3e')]){_0x3eb356[_0x2773('0x3c')]=_['merge'](_0x3eb356['where'],{'$or':_['map'](_0x2fe5bd,function(_0x2d3264){if(_0x2d3264[_0x2773('0x2e')]!==_0x2773('0x3f')){var _0x2e4323={};_0x2e4323[_0x2d3264[_0x2773('0x2a')]]={'$like':'%'+_0x1985ad[_0x2773('0x32')][_0x2773('0x3e')]+'%'};return _0x2e4323;}})});}_0x3eb356=_[_0x2773('0x40')]({},_0x3eb356,_0x1985ad[_0x2773('0x41')]);var _0x8f9453={'where':_0x3eb356[_0x2773('0x3c')]};return db['MailQueue']['count'](_0x8f9453)[_0x2773('0x24')](function(_0x1786d9){_0x5d07f4[_0x2773('0x1e')]=_0x1786d9;if(_0x1985ad['query']['includeAll']){_0x3eb356['include']=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x3eb356);})[_0x2773('0x24')](function(_0x5cd052){_0x5d07f4['rows']=_0x5cd052;return _0x5d07f4;})[_0x2773('0x24')](respondWithFilteredResult(_0x1655e8,_0x3eb356))[_0x2773('0x42')](handleError(_0x1655e8,null));};exports['show']=function(_0x4d81fb,_0xa3e1c7){var _0x550922={'raw':!![],'where':{'id':_0x4d81fb[_0x2773('0x43')]['id']}},_0xf69b00={};_0xf69b00[_0x2773('0x33')]=_[_0x2773('0x31')](db[_0x2773('0x44')][_0x2773('0x2c')]);_0xf69b00['query']=_[_0x2773('0x31')](_0x4d81fb[_0x2773('0x32')]);_0xf69b00[_0x2773('0x3d')]=_['intersection'](_0xf69b00[_0x2773('0x33')],_0xf69b00[_0x2773('0x32')]);_0x550922[_0x2773('0x34')]=_[_0x2773('0x35')](_0xf69b00[_0x2773('0x33')],qs[_0x2773('0x36')](_0x4d81fb[_0x2773('0x32')][_0x2773('0x36')]));_0x550922[_0x2773('0x34')]=_0x550922[_0x2773('0x34')]['length']?_0x550922[_0x2773('0x34')]:_0xf69b00[_0x2773('0x33')];if(_0x4d81fb['query'][_0x2773('0x45')]){_0x550922[_0x2773('0x46')]=[{'all':!![]}];}_0x550922=_[_0x2773('0x40')]({},_0x550922,_0x4d81fb[_0x2773('0x41')]);return db[_0x2773('0x44')][_0x2773('0x47')](_0x550922)[_0x2773('0x24')](handleEntityNotFound(_0xa3e1c7,null))[_0x2773('0x24')](respondWithResult(_0xa3e1c7,null))[_0x2773('0x42')](handleError(_0xa3e1c7,null));};exports['create']=function(_0x2b73fa,_0x55e0b9){return db[_0x2773('0x44')][_0x2773('0x48')](_0x2b73fa['body'],{})[_0x2773('0x24')](function(_0x116eae){var _0x4762a7=_0x2b73fa[_0x2773('0x49')][_0x2773('0x25')]({'plain':!![]});if(!_0x4762a7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4762a7[_0x2773('0x4a')]===_0x2773('0x49')){var _0x2c4ea0=_0x116eae[_0x2773('0x25')]({'plain':!![]});var _0x3ed311='MailQueues';return db[_0x2773('0x4b')][_0x2773('0x47')]({'where':{'name':_0x3ed311,'userProfileId':_0x4762a7[_0x2773('0x4c')]},'raw':!![]})['then'](function(_0x158583){if(_0x158583&&_0x158583[_0x2773('0x4d')]===0x0){return db[_0x2773('0x26')][_0x2773('0x48')]({'name':_0x2c4ea0['name'],'resourceId':_0x2c4ea0['id'],'type':_0x158583[_0x2773('0x2a')],'sectionId':_0x158583['id']},{})['then'](function(){return _0x116eae;});}else{return _0x116eae;}})[_0x2773('0x42')](function(_0x78eb4e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x78eb4e);throw _0x78eb4e;});}return _0x116eae;})['then'](respondWithResult(_0x55e0b9,0xc9))[_0x2773('0x42')](handleError(_0x55e0b9,null));};exports[_0x2773('0x22')]=function(_0x4819d8,_0x58ff32){if(_0x4819d8[_0x2773('0x4e')]['id']){delete _0x4819d8[_0x2773('0x4e')]['id'];}return db[_0x2773('0x44')][_0x2773('0x47')]({'where':{'id':_0x4819d8[_0x2773('0x43')]['id']}})['then'](handleEntityNotFound(_0x58ff32,null))[_0x2773('0x24')](saveUpdates(_0x4819d8[_0x2773('0x4e')],null))[_0x2773('0x24')](respondWithResult(_0x58ff32,null))[_0x2773('0x42')](handleError(_0x58ff32,null));};exports['destroy']=function(_0x9918cf,_0x23b931){return db[_0x2773('0x44')]['find']({'where':{'id':_0x9918cf[_0x2773('0x43')]['id']}})['then'](handleEntityNotFound(_0x23b931,null))['then'](removeEntity(_0x23b931,null))[_0x2773('0x42')](handleError(_0x23b931,null));};exports['describe']=function(_0x4bafe6,_0x47e410){return db[_0x2773('0x44')][_0x2773('0x4f')]()[_0x2773('0x24')](respondWithResult(_0x47e410,null))[_0x2773('0x42')](handleError(_0x47e410,null));};exports[_0x2773('0x50')]=function(_0x2ef015,_0x584283,_0xe1c743){var _0x49e758={'raw':!![],'where':{}},_0x315f09={},_0x468ab7;return db[_0x2773('0x44')][_0x2773('0x51')]({'where':{'id':_0x2ef015[_0x2773('0x43')]['id']}})[_0x2773('0x24')](handleEntityNotFound(_0x584283,null))[_0x2773('0x24')](function(_0x33b1ab){if(_0x33b1ab){_0x468ab7=_0x33b1ab['get']({'plain':!![]});_0x315f09['model']=_[_0x2773('0x31')](db['UserMailQueue'][_0x2773('0x2c')]);_0x315f09[_0x2773('0x32')]=_[_0x2773('0x31')](_0x2ef015[_0x2773('0x32')]);_0x315f09[_0x2773('0x3d')]=_['intersection'](_0x315f09[_0x2773('0x33')],_0x315f09[_0x2773('0x32')]);_0x49e758[_0x2773('0x34')]=_[_0x2773('0x35')](_0x315f09['model'],qs[_0x2773('0x36')](_0x2ef015[_0x2773('0x32')][_0x2773('0x36')]));_0x49e758[_0x2773('0x34')]=_0x49e758['attributes'][_0x2773('0x37')]?_0x49e758[_0x2773('0x34')]:_0x315f09[_0x2773('0x33')];if(!_0x2ef015[_0x2773('0x32')][_0x2773('0x52')]('nolimit')){_0x49e758[_0x2773('0x39')]=qs[_0x2773('0x39')](_0x2ef015['query'][_0x2773('0x39')]);_0x49e758[_0x2773('0x3a')]=qs[_0x2773('0x3a')](_0x2ef015[_0x2773('0x32')][_0x2773('0x3a')]);}_0x49e758[_0x2773('0x53')]=qs[_0x2773('0x3b')](_0x2ef015[_0x2773('0x32')][_0x2773('0x3b')]);_0x49e758['where']=qs[_0x2773('0x3d')](_[_0x2773('0x54')](_0x2ef015['query'],_0x315f09[_0x2773('0x3d')]));_0x49e758[_0x2773('0x3c')][_0x2773('0x55')]=_0x33b1ab['id'];if(_0x2ef015[_0x2773('0x32')][_0x2773('0x3e')]){_0x49e758[_0x2773('0x3c')]=_[_0x2773('0x40')](_0x49e758[_0x2773('0x3c')],{'$or':_[_0x2773('0x30')](_0x49e758['attributes'],function(_0xbbaea3){var _0xb9f32d={};_0xb9f32d[_0xbbaea3]={'$like':'%'+_0x2ef015['query'][_0x2773('0x3e')]+'%'};return _0xb9f32d;})});}_0x49e758=_[_0x2773('0x40')]({},_0x49e758,_0x2ef015[_0x2773('0x41')]);return db[_0x2773('0x56')][_0x2773('0x57')](_0x49e758);}})[_0x2773('0x24')](function(_0x2f084f){if(_0x2f084f){return db[_0x2773('0x58')][_0x2773('0x59')]({'where':{'id':_[_0x2773('0x30')](_0x2f084f,'UserId'),'role':'agent'},'attributes':['id',_0x2773('0x2a'),_0x2773('0x5a'),_0x2773('0x5b'),_0x2773('0x5c')]});}})[_0x2773('0x24')](function(_0x4049ad){if(_0x4049ad){return{'count':_0x4049ad[_0x2773('0x1e')],'rows':_[_0x2773('0x30')](_0x4049ad[_0x2773('0x5d')],function(_0xdec34e){return{'membername':_0xdec34e['name'],'UserId':_0xdec34e['id'],'queue_name':_0x468ab7[_0x2773('0x2a')],'MailQueueId':_0x468ab7['id'],'interface':util[_0x2773('0x5e')](_0x2773('0x5f'),_0x2773('0x60'),_0xdec34e['name']),'penalty':0x0,'paused':_0xdec34e[_0x2773('0x5a')],'createdAt':_0xdec34e[_0x2773('0x5c')],'updatedAt':_0xdec34e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2773('0x24')](respondWithFilteredResult(_0x584283,_0x49e758))[_0x2773('0x42')](handleError(_0x584283,null));};exports['getTeams']=function(_0x42a7c8,_0x174753,_0x1e4fe9){var _0x2e591d={};var _0x59e7c4={};var _0x1bd38a;var _0x1ab264;return db['MailQueue'][_0x2773('0x51')]({'where':{'id':_0x42a7c8['params']['id']}})['then'](handleEntityNotFound(_0x174753,null))[_0x2773('0x24')](function(_0x591b72){if(_0x591b72){_0x1bd38a=_0x591b72;_0x59e7c4[_0x2773('0x33')]=_['keys'](db['Team'][_0x2773('0x2c')]);_0x59e7c4[_0x2773('0x32')]=_['keys'](_0x42a7c8[_0x2773('0x32')]);_0x59e7c4[_0x2773('0x3d')]=_[_0x2773('0x35')](_0x59e7c4[_0x2773('0x33')],_0x59e7c4[_0x2773('0x32')]);_0x2e591d[_0x2773('0x34')]=_[_0x2773('0x35')](_0x59e7c4[_0x2773('0x33')],qs[_0x2773('0x36')](_0x42a7c8[_0x2773('0x32')][_0x2773('0x36')]));_0x2e591d[_0x2773('0x34')]=_0x2e591d[_0x2773('0x34')]['length']?_0x2e591d[_0x2773('0x34')]:_0x59e7c4['model'];_0x2e591d[_0x2773('0x53')]=qs[_0x2773('0x3b')](_0x42a7c8[_0x2773('0x32')][_0x2773('0x3b')]);_0x2e591d[_0x2773('0x3c')]=qs['filters'](_[_0x2773('0x54')](_0x42a7c8['query'],_0x59e7c4[_0x2773('0x3d')]));if(_0x42a7c8[_0x2773('0x32')]['filter']){_0x2e591d['where']=_[_0x2773('0x40')](_0x2e591d[_0x2773('0x3c')],{'$or':_[_0x2773('0x30')](_0x2e591d[_0x2773('0x34')],function(_0x4184b9){var _0x3d832f={};_0x3d832f[_0x4184b9]={'$like':'%'+_0x42a7c8[_0x2773('0x32')][_0x2773('0x3e')]+'%'};return _0x3d832f;})});}_0x2e591d=_[_0x2773('0x40')]({},_0x2e591d,_0x42a7c8[_0x2773('0x41')]);return _0x1bd38a[_0x2773('0x61')](_0x2e591d);}})[_0x2773('0x24')](function(_0x469953){if(_0x469953){_0x1ab264=_0x469953['length'];if(!_0x42a7c8[_0x2773('0x32')][_0x2773('0x52')](_0x2773('0x38'))){_0x2e591d[_0x2773('0x39')]=qs['limit'](_0x42a7c8[_0x2773('0x32')][_0x2773('0x39')]);_0x2e591d[_0x2773('0x3a')]=qs['offset'](_0x42a7c8[_0x2773('0x32')]['offset']);}return _0x1bd38a[_0x2773('0x61')](_0x2e591d);}})['then'](function(_0x3d3d4d){if(_0x3d3d4d){return _0x3d3d4d?{'count':_0x1ab264,'rows':_0x3d3d4d}:null;}})['then'](respondWithResult(_0x174753,null))['catch'](handleError(_0x174753,null));};exports['addTeams']=function(_0x296f7e,_0x5e43f,_0x1c5b78){var _0x845d3d=_0x296f7e['body'][_0x2773('0x62')];return db[_0x2773('0x63')][_0x2773('0x57')]({'where':{'id':_0x845d3d},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2773('0x64'),'attributes':['id',_0x2773('0x2a'),'online','voicePause',_0x2773('0x65')],'raw':!![]}]})['then'](function(_0x52c9d0){if(_0x52c9d0){var _0x1576c8=_['flatMap'](_0x52c9d0,function(_0x370c0b){var _0x2df4f2=_0x370c0b['get']({'plain':!![]});return _0x2df4f2[_0x2773('0x64')];});return db[_0x2773('0x44')][_0x2773('0x47')]({'where':{'id':_0x296f7e[_0x2773('0x43')]['id']}})['then'](function(_0x2f62b9){return db[_0x2773('0x66')][_0x2773('0x67')](function(_0x257d6c){return _0x2f62b9[_0x2773('0x68')](_0x845d3d,{'transaction':_0x257d6c})[_0x2773('0x24')](function(){return BPromise['each'](_0x1576c8,function(_0x195cd8){return db[_0x2773('0x56')][_0x2773('0x69')]({'where':{'UserId':_0x195cd8['id'],'MailQueueId':_0x296f7e[_0x2773('0x43')]['id']},'transaction':_0x257d6c});});})[_0x2773('0x24')](function(){_0x1576c8['forEach'](function(_0x50a4b8){socket[_0x2773('0x6a')](_0x2773('0x6b'),{'UserId':_0x50a4b8['id'],'MailQueueId':_0x2f62b9['id']});});});});});}})[_0x2773('0x24')](respondWithStatusCode(_0x5e43f,null))[_0x2773('0x42')](handleError(_0x5e43f,null));};exports['removeTeams']=function(_0x47c726,_0x994eb4,_0x38fb75){return db[_0x2773('0x63')][_0x2773('0x57')]({'where':{'id':_0x47c726[_0x2773('0x32')][_0x2773('0x62')]},'attributes':['id'],'include':[{'model':db[_0x2773('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x994eb4,null))['then'](function(_0x463a67){var _0x58886e=_[_0x2773('0x30')](_0x463a67,'id');var _0x34e10b=[];var _0x3b76cf=[];var _0x110015=squel[_0x2773('0x6c')]();_0x110015[_0x2773('0x6d')]('tq.TeamId')[_0x2773('0x6e')]('team_has_mail_queues','tq')[_0x2773('0x6f')](_0x2773('0x70'),'ut',_0x2773('0x71'))[_0x2773('0x3c')]('MailQueueId\x20=\x20?',_0x47c726['params']['id']);for(var _0x4d5557=0x0;_0x4d5557<_0x463a67[_0x2773('0x37')];_0x4d5557+=0x1){let _0x21521a=_0x463a67[_0x4d5557];for(var _0x335a59=0x0;_0x335a59<_0x21521a[_0x2773('0x64')][_0x2773('0x37')];_0x335a59+=0x1){let _0x576c12=_0x21521a[_0x2773('0x64')][_0x335a59];var _0x485c2f=_0x110015[_0x2773('0x72')]();_0x485c2f['where'](_0x2773('0x73'),_0x576c12['id']);_0x3b76cf[_0x2773('0x74')](db[_0x2773('0x66')][_0x2773('0x32')](_0x485c2f[_0x2773('0x75')](),{'type':db[_0x2773('0x66')]['QueryTypes'][_0x2773('0x76')]})[_0x2773('0x24')](function(_0x2a2035){if(_0x2a2035['length']===0x1){return _0x576c12['id'];}else{var _0x42402d=_[_0x2773('0x77')](_[_0x2773('0x30')](_0x2a2035,_0x2773('0x78')),function(_0x3621ac){return _[_0x2773('0x79')](_0x58886e,_0x3621ac);});if(_0x42402d){return _0x576c12['id'];}}}));}}return BPromise['all'](_0x3b76cf)[_0x2773('0x24')](function(_0x5e8651){_0x34e10b=_(_0x34e10b)[_0x2773('0x7a')](_0x5e8651)['compact']()['value']();return db[_0x2773('0x44')][_0x2773('0x47')]({'where':{'id':_0x47c726['params']['id']}})[_0x2773('0x24')](function(_0x3a4b3e){return db[_0x2773('0x66')][_0x2773('0x67')](function(_0x472335){return _0x3a4b3e[_0x2773('0x7b')](_0x47c726['query'][_0x2773('0x62')],{'transaction':_0x472335})[_0x2773('0x24')](function(){if(!_[_0x2773('0x7c')](_0x34e10b)){return _0x3a4b3e[_0x2773('0x7d')](_0x34e10b,{'transaction':_0x472335});}})[_0x2773('0x24')](function(){_0x34e10b[_0x2773('0x7e')](function(_0x13fce2){socket[_0x2773('0x6a')](_0x2773('0x7f'),{'UserId':_0x13fce2,'MailQueueId':_0x3a4b3e['id']});});});});});});})[_0x2773('0x24')](respondWithStatusCode(_0x994eb4,null))['catch'](handleError(_0x994eb4,null));};exports[_0x2773('0x80')]=function(_0x110283,_0x38ec52,_0x57be05){return db['MailQueue']['find']({'where':{'id':_0x110283[_0x2773('0x43')]['id']}})['then'](handleEntityNotFound(_0x38ec52,null))['then'](function(_0x288507){if(_0x288507){return _0x288507[_0x2773('0x80')](_0x110283[_0x2773('0x4e')][_0x2773('0x62')],_[_0x2773('0x81')](_0x110283[_0x2773('0x4e')],['ids','id'])||{})[_0x2773('0x82')](function(_0x500d15){for(var _0x31ed18=0x0;_0x31ed18<_0x110283['body'][_0x2773('0x62')][_0x2773('0x37')];_0x31ed18+=0x1){socket[_0x2773('0x6a')]('userMailQueue:save',{'UserId':_0x110283[_0x2773('0x4e')][_0x2773('0x62')][_0x31ed18],'MailQueueId':_0x110283[_0x2773('0x43')]['id']});}return _0x500d15;});}})[_0x2773('0x24')](respondWithResult(_0x38ec52,null))[_0x2773('0x42')](handleError(_0x38ec52,null));};exports['removeAgents']=function(_0x4b7909,_0x198f7d,_0x4151f0){return db['MailQueue'][_0x2773('0x47')]({'where':{'id':_0x4b7909[_0x2773('0x43')]['id']}})['then'](handleEntityNotFound(_0x198f7d,null))[_0x2773('0x24')](function(_0x255723){if(_0x255723){return _0x255723[_0x2773('0x7d')](_0x4b7909[_0x2773('0x32')][_0x2773('0x62')])[_0x2773('0x24')](function(){if(_[_0x2773('0x83')](_0x4b7909[_0x2773('0x32')]['ids'])){for(var _0xbedfee=0x0;_0xbedfee<_0x4b7909[_0x2773('0x32')]['ids'][_0x2773('0x37')];_0xbedfee+=0x1){socket[_0x2773('0x6a')](_0x2773('0x7f'),{'UserId':Number(_0x4b7909[_0x2773('0x32')][_0x2773('0x62')][_0xbedfee]),'MailQueueId':Number(_0x4b7909[_0x2773('0x43')]['id'])});}}else{socket['emit']('userMailQueue:remove',{'UserId':Number(_0x4b7909[_0x2773('0x32')]['ids']),'MailQueueId':Number(_0x4b7909['params']['id'])});}});}})[_0x2773('0x24')](respondWithStatusCode(_0x198f7d,null))['catch'](handleError(_0x198f7d,null));};exports[_0x2773('0x84')]=function(_0x491322,_0xccace6,_0x2b23f0){var _0xe3d47d={};var _0x2d327e={};var _0x223beb;var _0x5500c5;return db[_0x2773('0x44')][_0x2773('0x51')]({'where':{'id':_0x491322['params']['id']}})[_0x2773('0x24')](handleEntityNotFound(_0xccace6,null))['then'](function(_0x283c10){if(_0x283c10){_0x223beb=_0x283c10;_0x2d327e[_0x2773('0x33')]=_[_0x2773('0x31')](db['User'][_0x2773('0x2c')]);_0x2d327e[_0x2773('0x32')]=_[_0x2773('0x31')](_0x491322[_0x2773('0x32')]);_0x2d327e['filters']=_['intersection'](_0x2d327e[_0x2773('0x33')],_0x2d327e[_0x2773('0x32')]);_0xe3d47d[_0x2773('0x34')]=_['intersection'](_0x2d327e['model'],qs[_0x2773('0x36')](_0x491322['query'][_0x2773('0x36')]));_0xe3d47d[_0x2773('0x34')]=_0xe3d47d[_0x2773('0x34')]['length']?_0xe3d47d[_0x2773('0x34')]:_0x2d327e[_0x2773('0x33')];_0xe3d47d['order']=qs[_0x2773('0x3b')](_0x491322[_0x2773('0x32')]['sort']);_0xe3d47d[_0x2773('0x3c')]=qs[_0x2773('0x3d')](_['pick'](_0x491322['query'],_0x2d327e['filters']));if(_0x491322[_0x2773('0x32')][_0x2773('0x3e')]){_0xe3d47d[_0x2773('0x3c')]=_[_0x2773('0x40')](_0xe3d47d[_0x2773('0x3c')],{'$or':_[_0x2773('0x30')](_0xe3d47d[_0x2773('0x34')],function(_0x356769){var _0x51af54={};_0x51af54[_0x356769]={'$like':'%'+_0x491322[_0x2773('0x32')][_0x2773('0x3e')]+'%'};return _0x51af54;})});}_0xe3d47d=_[_0x2773('0x40')]({},_0xe3d47d,_0x491322[_0x2773('0x41')]);return _0x223beb[_0x2773('0x84')](_0xe3d47d);}})[_0x2773('0x24')](function(_0x1c1a19){if(_0x1c1a19){_0x5500c5=_0x1c1a19[_0x2773('0x37')];if(!_0x491322['query'][_0x2773('0x52')](_0x2773('0x38'))){_0xe3d47d[_0x2773('0x39')]=qs[_0x2773('0x39')](_0x491322[_0x2773('0x32')][_0x2773('0x39')]);_0xe3d47d['offset']=qs[_0x2773('0x3a')](_0x491322[_0x2773('0x32')][_0x2773('0x3a')]);}return _0x223beb[_0x2773('0x84')](_0xe3d47d);}})[_0x2773('0x24')](function(_0x355894){if(_0x355894){return _0x355894?{'count':_0x5500c5,'rows':_0x355894}:null;}})['then'](respondWithResult(_0xccace6,null))[_0x2773('0x42')](handleError(_0xccace6,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index fc0f819..b118e5b 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 _0x0809=['hook','exports','events','MailQueue','save','remove','emit','hasOwnProperty'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0x0809,0x1d2));var _0x9080=function(_0x27eb1e,_0x28410f){_0x27eb1e=_0x27eb1e-0x0;var _0x3467a6=_0x0809[_0x27eb1e];return _0x3467a6;};'use strict';var EventEmitter=require(_0x9080('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x9080('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9080('0x2'),'afterUpdate':'update','afterDestroy':_0x9080('0x3')};function emitEvent(_0x397d30){return function(_0x508972,_0x50728d,_0x115a6f){MailQueueEvents[_0x9080('0x4')](_0x397d30+':'+_0x508972['id'],_0x508972);MailQueueEvents[_0x9080('0x4')](_0x397d30,_0x508972);_0x115a6f(null);};}for(var e in events){if(events[_0x9080('0x5')](e)){var event=events[e];MailQueue[_0x9080('0x6')](e,emitEvent(event));}}module[_0x9080('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xf2db=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save'];(function(_0xad9d4d,_0x5bf432){var _0x195e72=function(_0x1d2e78){while(--_0x1d2e78){_0xad9d4d['push'](_0xad9d4d['shift']());}};_0x195e72(++_0x5bf432);}(_0xf2db,0x74));var _0xbf2d=function(_0x393420,_0xfa697c){_0x393420=_0x393420-0x0;var _0x185944=_0xf2db[_0x393420];return _0x185944;};'use strict';var EventEmitter=require(_0xbf2d('0x0'));var MailQueue=require(_0xbf2d('0x1'))['db'][_0xbf2d('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xbf2d('0x3')](0x0);var events={'afterCreate':_0xbf2d('0x4'),'afterUpdate':_0xbf2d('0x5'),'afterDestroy':_0xbf2d('0x6')};function emitEvent(_0x15d589){return function(_0x40aa48,_0x3ccf3d,_0x1ea16f){MailQueueEvents[_0xbf2d('0x7')](_0x15d589+':'+_0x40aa48['id'],_0x40aa48);MailQueueEvents['emit'](_0x15d589,_0x40aa48);_0x1ea16f(null);};}for(var e in events){if(events[_0xbf2d('0x8')](e)){var event=events[e];MailQueue[_0xbf2d('0x9')](e,emitEvent(event));}}module[_0xbf2d('0xa')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 7fd2c1e..0676cd8 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 _0xdad0=['../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x548d22,_0xc8aeff){var _0x10a23c=function(_0x4d704b){while(--_0x4d704b){_0x548d22['push'](_0x548d22['shift']());}};_0x10a23c(++_0xc8aeff);}(_0xdad0,0x14b));var _0x0dad=function(_0x34b4f0,_0x3eb124){_0x34b4f0=_0x34b4f0-0x0;var _0x4ea24e=_0xdad0[_0x34b4f0];return _0x4ea24e;};'use strict';var _=require(_0x0dad('0x0'));var util=require('util');var logger=require(_0x0dad('0x1'))('api');var moment=require(_0x0dad('0x2'));var BPromise=require(_0x0dad('0x3'));var rp=require(_0x0dad('0x4'));var fs=require('fs');var path=require(_0x0dad('0x5'));var rimraf=require(_0x0dad('0x6'));var config=require(_0x0dad('0x7'));var attributes=require(_0x0dad('0x8'));module[_0x0dad('0x9')]=function(_0x38e5c2,_0x2b6192){return _0x38e5c2[_0x0dad('0xa')](_0x0dad('0xb'),attributes,{'tableName':_0x0dad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b6e=['exports','define','mail_queues','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x7a0979,_0x217643){var _0x1a31f9=function(_0x4d42df){while(--_0x4d42df){_0x7a0979['push'](_0x7a0979['shift']());}};_0x1a31f9(++_0x217643);}(_0x2b6e,0x14d));var _0xe2b6=function(_0x2a0191,_0x42bf3f){_0x2a0191=_0x2a0191-0x0;var _0x4fd5a8=_0x2b6e[_0x2a0191];return _0x4fd5a8;};'use strict';var _=require(_0xe2b6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe2b6('0x1'));var moment=require(_0xe2b6('0x2'));var BPromise=require(_0xe2b6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2b6('0x4'));var rimraf=require(_0xe2b6('0x5'));var config=require(_0xe2b6('0x6'));var attributes=require(_0xe2b6('0x7'));module[_0xe2b6('0x8')]=function(_0x49c501,_0xa6d6d6){return _0x49c501[_0xe2b6('0x9')]('MailQueue',attributes,{'tableName':_0xe2b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 6ab58f7..d1644b6 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 _0x8a84=['register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetMailQueue','MailQueue','options','raw','where','attributes','include','map','model','ShowMailQueue','find','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x8a84,0x1ba));var _0x48a8=function(_0x208749,_0x2b7b66){_0x208749=_0x208749-0x0;var _0x3e0042=_0x8a84[_0x208749];return _0x3e0042;};'use strict';var _=require(_0x48a8('0x0'));var util=require('util');var moment=require(_0x48a8('0x1'));var BPromise=require(_0x48a8('0x2'));var rs=require(_0x48a8('0x3'));var fs=require('fs');var Redis=require(_0x48a8('0x4'));var db=require(_0x48a8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x48a8('0x6'));var jayson=require(_0x48a8('0x7'));var client=jayson[_0x48a8('0x8')][_0x48a8('0x9')]({'port':0x232a});config[_0x48a8('0xa')]=_[_0x48a8('0xb')](config[_0x48a8('0xa')],{'host':_0x48a8('0xc'),'port':0x18eb});var socket=require(_0x48a8('0xd'))(new Redis(config[_0x48a8('0xa')]));require('./mailQueue.socket')[_0x48a8('0xe')](socket);function respondWithRpcPromise(_0x1490cc,_0x1ba40b,_0x392c06){return new BPromise(function(_0xb4ef8d,_0x407c6d){return client[_0x48a8('0xf')](_0x1490cc,_0x392c06)[_0x48a8('0x10')](function(_0x574584){logger[_0x48a8('0x11')](_0x48a8('0x12'),_0x1ba40b,_0x48a8('0x13'));logger[_0x48a8('0x14')](_0x48a8('0x15'),_0x1ba40b,_0x48a8('0x13'),JSON[_0x48a8('0x16')](_0x574584));if(_0x574584[_0x48a8('0x17')]){if(_0x574584[_0x48a8('0x17')][_0x48a8('0x18')]===0x1f4){logger[_0x48a8('0x17')]('MailQueue,\x20%s,\x20%s',_0x1ba40b,_0x574584['error'][_0x48a8('0x19')]);return _0x407c6d(_0x574584[_0x48a8('0x17')][_0x48a8('0x19')]);}logger[_0x48a8('0x17')]('MailQueue,\x20%s,\x20%s',_0x1ba40b,_0x574584[_0x48a8('0x17')][_0x48a8('0x19')]);return _0xb4ef8d(_0x574584[_0x48a8('0x17')][_0x48a8('0x19')]);}else{logger[_0x48a8('0x11')](_0x48a8('0x12'),_0x1ba40b,_0x48a8('0x13'));_0xb4ef8d(_0x574584['result']['message']);}})['catch'](function(_0x7dc64){logger[_0x48a8('0x17')](_0x48a8('0x12'),_0x1ba40b,_0x7dc64);_0x407c6d(_0x7dc64);});});}exports[_0x48a8('0x1a')]=function(_0x2b11ae){var _0x47232b=this;return new Promise(function(_0x48a791,_0x2a88d8){return db[_0x48a8('0x1b')]['findAll']({'raw':_0x2b11ae[_0x48a8('0x1c')]?_0x2b11ae[_0x48a8('0x1c')][_0x48a8('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b11ae[_0x48a8('0x1c')]?_0x2b11ae[_0x48a8('0x1c')][_0x48a8('0x1e')]||null:null,'attributes':_0x2b11ae[_0x48a8('0x1c')]?_0x2b11ae[_0x48a8('0x1c')][_0x48a8('0x1f')]||null:null,'limit':_0x2b11ae[_0x48a8('0x1c')]?_0x2b11ae[_0x48a8('0x1c')]['limit']||null:null,'include':_0x2b11ae[_0x48a8('0x1c')]?_0x2b11ae[_0x48a8('0x1c')][_0x48a8('0x20')]?_[_0x48a8('0x21')](_0x2b11ae[_0x48a8('0x1c')][_0x48a8('0x20')],function(_0x141aa9){return{'model':db[_0x141aa9[_0x48a8('0x22')]],'as':_0x141aa9['as'],'attributes':_0x141aa9['attributes'],'include':_0x141aa9[_0x48a8('0x20')]?_[_0x48a8('0x21')](_0x141aa9['include'],function(_0x302903){return{'model':db[_0x302903[_0x48a8('0x22')]],'as':_0x302903['as'],'attributes':_0x302903[_0x48a8('0x1f')],'include':_0x302903[_0x48a8('0x20')]?_[_0x48a8('0x21')](_0x302903[_0x48a8('0x20')],function(_0x509eeb){return{'model':db[_0x509eeb[_0x48a8('0x22')]],'as':_0x509eeb['as'],'attributes':_0x509eeb[_0x48a8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ddf25){logger[_0x48a8('0x11')]('GetMailQueue',_0x2b11ae);logger[_0x48a8('0x14')](_0x48a8('0x1a'),_0x2b11ae,JSON[_0x48a8('0x16')](_0x3ddf25));_0x48a791(_0x3ddf25);})['catch'](function(_0x47bc52){logger[_0x48a8('0x17')](_0x48a8('0x1a'),_0x47bc52['message'],_0x2b11ae);_0x2a88d8(_0x47232b[_0x48a8('0x17')](0x1f4,_0x47bc52[_0x48a8('0x19')]));});});};exports[_0x48a8('0x23')]=function(_0x2e4fec){var _0x39cc1f=this;return new Promise(function(_0x485ff7,_0x30ddba){return db['MailQueue'][_0x48a8('0x24')]({'raw':_0x2e4fec[_0x48a8('0x1c')]?_0x2e4fec['options'][_0x48a8('0x1d')]===undefined?!![]:![]:!![],'where':_0x2e4fec[_0x48a8('0x1c')]?_0x2e4fec[_0x48a8('0x1c')][_0x48a8('0x1e')]||null:null,'attributes':_0x2e4fec[_0x48a8('0x1c')]?_0x2e4fec[_0x48a8('0x1c')][_0x48a8('0x1f')]||null:null,'include':_0x2e4fec[_0x48a8('0x1c')]?_0x2e4fec[_0x48a8('0x1c')]['include']?_[_0x48a8('0x21')](_0x2e4fec[_0x48a8('0x1c')][_0x48a8('0x20')],function(_0x2c4314){return{'model':db[_0x2c4314[_0x48a8('0x22')]],'as':_0x2c4314['as'],'attributes':_0x2c4314[_0x48a8('0x1f')],'include':_0x2c4314[_0x48a8('0x20')]?_[_0x48a8('0x21')](_0x2c4314[_0x48a8('0x20')],function(_0x3711cc){return{'model':db[_0x3711cc[_0x48a8('0x22')]],'as':_0x3711cc['as'],'attributes':_0x3711cc[_0x48a8('0x1f')],'include':_0x3711cc[_0x48a8('0x20')]?_[_0x48a8('0x21')](_0x3711cc[_0x48a8('0x20')],function(_0x361798){return{'model':db[_0x361798[_0x48a8('0x22')]],'as':_0x361798['as'],'attributes':_0x361798[_0x48a8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56b0c7){logger[_0x48a8('0x11')](_0x48a8('0x23'),_0x2e4fec);logger[_0x48a8('0x14')]('ShowMailQueue',_0x2e4fec,JSON['stringify'](_0x56b0c7));_0x485ff7(_0x56b0c7);})[_0x48a8('0x25')](function(_0x872b78){logger[_0x48a8('0x17')]('ShowMailQueue',_0x872b78[_0x48a8('0x19')],_0x2e4fec);_0x30ddba(_0x39cc1f[_0x48a8('0x17')](0x1f4,_0x872b78[_0x48a8('0x19')]));});});}; \ No newline at end of file +var _0x8db4=['ShowMailQueue','find','where','info','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','MailQueue','findAll','options','raw','include','map','model','attributes','then','stringify'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8db4,0xc2));var _0x48db=function(_0x4516d9,_0x5dff26){_0x4516d9=_0x4516d9-0x0;var _0x25b1ae=_0x8db4[_0x4516d9];return _0x25b1ae;};'use strict';var _=require(_0x48db('0x0'));var util=require(_0x48db('0x1'));var moment=require(_0x48db('0x2'));var BPromise=require(_0x48db('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48db('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x48db('0x5'))(_0x48db('0x6'));var config=require('../../config/environment');var jayson=require(_0x48db('0x7'));var client=jayson[_0x48db('0x8')][_0x48db('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x48db('0xa')],{'host':_0x48db('0xb'),'port':0x18eb});var socket=require(_0x48db('0xc'))(new Redis(config[_0x48db('0xa')]));require(_0x48db('0xd'))[_0x48db('0xe')](socket);function respondWithRpcPromise(_0x1c06cf,_0xc01c93,_0x19887e){return new BPromise(function(_0x414c80,_0x436a34){return client[_0x48db('0xf')](_0x1c06cf,_0x19887e)['then'](function(_0x411b7a){logger['info'](_0x48db('0x10'),_0xc01c93,_0x48db('0x11'));logger[_0x48db('0x12')](_0x48db('0x13'),_0xc01c93,_0x48db('0x11'),JSON['stringify'](_0x411b7a));if(_0x411b7a['error']){if(_0x411b7a[_0x48db('0x14')]['code']===0x1f4){logger[_0x48db('0x14')]('MailQueue,\x20%s,\x20%s',_0xc01c93,_0x411b7a[_0x48db('0x14')][_0x48db('0x15')]);return _0x436a34(_0x411b7a[_0x48db('0x14')][_0x48db('0x15')]);}logger[_0x48db('0x14')](_0x48db('0x10'),_0xc01c93,_0x411b7a[_0x48db('0x14')]['message']);return _0x414c80(_0x411b7a[_0x48db('0x14')][_0x48db('0x15')]);}else{logger['info'](_0x48db('0x10'),_0xc01c93,_0x48db('0x11'));_0x414c80(_0x411b7a[_0x48db('0x16')]['message']);}})[_0x48db('0x17')](function(_0x10b73f){logger['error'](_0x48db('0x10'),_0xc01c93,_0x10b73f);_0x436a34(_0x10b73f);});});}exports['GetMailQueue']=function(_0x143ace){var _0x43d808=this;return new Promise(function(_0x19d925,_0x5a6918){return db[_0x48db('0x18')][_0x48db('0x19')]({'raw':_0x143ace[_0x48db('0x1a')]?_0x143ace['options'][_0x48db('0x1b')]===undefined?!![]:![]:!![],'where':_0x143ace[_0x48db('0x1a')]?_0x143ace[_0x48db('0x1a')]['where']||null:null,'attributes':_0x143ace[_0x48db('0x1a')]?_0x143ace[_0x48db('0x1a')]['attributes']||null:null,'limit':_0x143ace['options']?_0x143ace[_0x48db('0x1a')]['limit']||null:null,'include':_0x143ace[_0x48db('0x1a')]?_0x143ace[_0x48db('0x1a')][_0x48db('0x1c')]?_[_0x48db('0x1d')](_0x143ace[_0x48db('0x1a')]['include'],function(_0x40fdeb){return{'model':db[_0x40fdeb['model']],'as':_0x40fdeb['as'],'attributes':_0x40fdeb['attributes'],'include':_0x40fdeb['include']?_[_0x48db('0x1d')](_0x40fdeb[_0x48db('0x1c')],function(_0x139cf5){return{'model':db[_0x139cf5[_0x48db('0x1e')]],'as':_0x139cf5['as'],'attributes':_0x139cf5[_0x48db('0x1f')],'include':_0x139cf5[_0x48db('0x1c')]?_[_0x48db('0x1d')](_0x139cf5[_0x48db('0x1c')],function(_0x3994bb){return{'model':db[_0x3994bb[_0x48db('0x1e')]],'as':_0x3994bb['as'],'attributes':_0x3994bb[_0x48db('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x48db('0x20')](function(_0x4a817e){logger['info']('GetMailQueue',_0x143ace);logger[_0x48db('0x12')]('GetMailQueue',_0x143ace,JSON[_0x48db('0x21')](_0x4a817e));_0x19d925(_0x4a817e);})['catch'](function(_0x3b302d){logger['error']('GetMailQueue',_0x3b302d[_0x48db('0x15')],_0x143ace);_0x5a6918(_0x43d808[_0x48db('0x14')](0x1f4,_0x3b302d[_0x48db('0x15')]));});});};exports[_0x48db('0x22')]=function(_0x4de5db){var _0x299a8a=this;return new Promise(function(_0x334cf1,_0x3cb8c2){return db[_0x48db('0x18')][_0x48db('0x23')]({'raw':_0x4de5db[_0x48db('0x1a')]?_0x4de5db[_0x48db('0x1a')][_0x48db('0x1b')]===undefined?!![]:![]:!![],'where':_0x4de5db[_0x48db('0x1a')]?_0x4de5db[_0x48db('0x1a')][_0x48db('0x24')]||null:null,'attributes':_0x4de5db[_0x48db('0x1a')]?_0x4de5db['options'][_0x48db('0x1f')]||null:null,'include':_0x4de5db[_0x48db('0x1a')]?_0x4de5db[_0x48db('0x1a')]['include']?_['map'](_0x4de5db[_0x48db('0x1a')]['include'],function(_0x1f4a1b){return{'model':db[_0x1f4a1b[_0x48db('0x1e')]],'as':_0x1f4a1b['as'],'attributes':_0x1f4a1b['attributes'],'include':_0x1f4a1b[_0x48db('0x1c')]?_[_0x48db('0x1d')](_0x1f4a1b[_0x48db('0x1c')],function(_0x7500f8){return{'model':db[_0x7500f8[_0x48db('0x1e')]],'as':_0x7500f8['as'],'attributes':_0x7500f8['attributes'],'include':_0x7500f8[_0x48db('0x1c')]?_[_0x48db('0x1d')](_0x7500f8['include'],function(_0x41e245){return{'model':db[_0x41e245[_0x48db('0x1e')]],'as':_0x41e245['as'],'attributes':_0x41e245['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x174101){logger[_0x48db('0x25')]('ShowMailQueue',_0x4de5db);logger[_0x48db('0x12')](_0x48db('0x22'),_0x4de5db,JSON[_0x48db('0x21')](_0x174101));_0x334cf1(_0x174101);})[_0x48db('0x17')](function(_0x1a7d55){logger[_0x48db('0x14')](_0x48db('0x22'),_0x1a7d55[_0x48db('0x15')],_0x4de5db);_0x3cb8c2(_0x299a8a[_0x48db('0x14')](0x1f4,_0x1a7d55[_0x48db('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index d6d9154..3372b34 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 _0x035e=['mailQueue:','./mailQueue.events','save','update','emit','removeListener','length'];(function(_0xc705a1,_0xc6a828){var _0x2206f4=function(_0x40b0a4){while(--_0x40b0a4){_0xc705a1['push'](_0xc705a1['shift']());}};_0x2206f4(++_0xc6a828);}(_0x035e,0x6a));var _0xe035=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x035e[_0x3dd15e];return _0x231fd0;};'use strict';var MailQueueEvents=require(_0xe035('0x0'));var events=[_0xe035('0x1'),'remove',_0xe035('0x2')];function createListener(_0x5092a9,_0x38d36d){return function(_0x118450){_0x38d36d[_0xe035('0x3')](_0x5092a9,_0x118450);};}function removeListener(_0x33e722,_0x608d58){return function(){MailQueueEvents[_0xe035('0x4')](_0x33e722,_0x608d58);};}exports['register']=function(_0x2d713e){for(var _0x3c889d=0x0,_0x2b88b5=events[_0xe035('0x5')];_0x3c889d<_0x2b88b5;_0x3c889d++){var _0x275e66=events[_0x3c889d];var _0x5947fb=createListener(_0xe035('0x6')+_0x275e66,_0x2d713e);MailQueueEvents['on'](_0x275e66,_0x5947fb);}}; \ No newline at end of file +var _0xb57d=['mailQueue:','./mailQueue.events','save','emit','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb57d,0x74));var _0xdb57=function(_0x18f05c,_0x2cdeda){_0x18f05c=_0x18f05c-0x0;var _0x10ea3b=_0xb57d[_0x18f05c];return _0x10ea3b;};'use strict';var MailQueueEvents=require(_0xdb57('0x0'));var events=[_0xdb57('0x1'),'remove','update'];function createListener(_0xfe60fd,_0x19d18f){return function(_0xd4779e){_0x19d18f[_0xdb57('0x2')](_0xfe60fd,_0xd4779e);};}function removeListener(_0x4e3dea,_0x1326a8){return function(){MailQueueEvents['removeListener'](_0x4e3dea,_0x1326a8);};}exports[_0xdb57('0x3')]=function(_0x1b4f00){for(var _0x516478=0x0,_0x506a8a=events['length'];_0x516478<_0x506a8a;_0x516478++){var _0x10b762=events[_0x516478];var _0x2b2ab6=createListener(_0xdb57('0x4')+_0x10b762,_0x1b4f00);MailQueueEvents['on'](_0x10b762,_0x2b2ab6);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index a63c743..5e95465 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 _0x5787=['put','update','delete','/:id','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x2084ca,_0x300fc3){var _0x1a3268=function(_0x26e0e3){while(--_0x26e0e3){_0x2084ca['push'](_0x2084ca['shift']());}};_0x1a3268(++_0x300fc3);}(_0x5787,0x1e6));var _0x7578=function(_0x1d65cd,_0x3e4ce0){_0x1d65cd=_0x1d65cd-0x0;var _0x274319=_0x5787[_0x1d65cd];return _0x274319;};'use strict';var multer=require('multer');var util=require(_0x7578('0x0'));var path=require('path');var timeout=require(_0x7578('0x1'));var express=require(_0x7578('0x2'));var router=express['Router']();var auth=require(_0x7578('0x3'));var interaction=require(_0x7578('0x4'));var config=require('../../config/environment');var controller=require(_0x7578('0x5'));router[_0x7578('0x6')]('/',auth[_0x7578('0x7')](),controller[_0x7578('0x8')]);router[_0x7578('0x6')](_0x7578('0x9'),auth[_0x7578('0x7')](),controller[_0x7578('0xa')]);router['get']('/:id',auth[_0x7578('0x7')](),controller[_0x7578('0xb')]);router[_0x7578('0xc')]('/',auth[_0x7578('0x7')](),controller[_0x7578('0xd')]);router[_0x7578('0xe')]('/:id',auth[_0x7578('0x7')](),controller[_0x7578('0xf')]);router[_0x7578('0x10')](_0x7578('0x11'),auth[_0x7578('0x7')](),controller[_0x7578('0x12')]);module[_0x7578('0x13')]=router; \ No newline at end of file +var _0x765b=['put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','/describe','describe','show'];(function(_0x26f3e4,_0x49f8d2){var _0x2cc40a=function(_0x24f563){while(--_0x24f563){_0x26f3e4['push'](_0x26f3e4['shift']());}};_0x2cc40a(++_0x49f8d2);}(_0x765b,0x18b));var _0xb765=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0x765b[_0x58a4fe];return _0x697de2;};'use strict';var multer=require(_0xb765('0x0'));var util=require('util');var path=require(_0xb765('0x1'));var timeout=require(_0xb765('0x2'));var express=require(_0xb765('0x3'));var router=express[_0xb765('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb765('0x5'));var config=require(_0xb765('0x6'));var controller=require(_0xb765('0x7'));router[_0xb765('0x8')]('/',auth[_0xb765('0x9')](),controller['index']);router['get'](_0xb765('0xa'),auth['isAuthenticated'](),controller[_0xb765('0xb')]);router['get']('/:id',auth[_0xb765('0x9')](),controller[_0xb765('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb765('0xd')]('/:id',auth[_0xb765('0x9')](),controller[_0xb765('0xe')]);router[_0xb765('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb765('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 50020e3..a95ced3 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 _0x32de=['DATE','sequelize','exports','STRING'];(function(_0x246eef,_0x316649){var _0x130023=function(_0x313699){while(--_0x313699){_0x246eef['push'](_0x246eef['shift']());}};_0x130023(++_0x316649);}(_0x32de,0x1e1));var _0xe32d=function(_0x4cbce7,_0x139ba2){_0x4cbce7=_0x4cbce7-0x0;var _0x127bf5=_0x32de[_0x4cbce7];return _0x127bf5;};'use strict';var moment=require('moment');var Sequelize=require(_0xe32d('0x0'));module[_0xe32d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe32d('0x2')]},'joinAt':{'type':Sequelize[_0xe32d('0x3')]},'leaveAt':{'type':Sequelize[_0xe32d('0x3')]},'acceptAt':{'type':Sequelize[_0xe32d('0x3')]},'exitAt':{'type':Sequelize[_0xe32d('0x3')]},'reason':{'type':Sequelize[_0xe32d('0x2')]}}; \ No newline at end of file +var _0xff74=['exports','STRING','DATE','moment','sequelize'];(function(_0x285b48,_0x41b4c6){var _0x5020e9=function(_0x537f18){while(--_0x537f18){_0x285b48['push'](_0x285b48['shift']());}};_0x5020e9(++_0x41b4c6);}(_0xff74,0xc6));var _0x4ff7=function(_0x2dacca,_0x3b55a5){_0x2dacca=_0x2dacca-0x0;var _0x4e8745=_0xff74[_0x2dacca];return _0x4e8745;};'use strict';var moment=require(_0x4ff7('0x0'));var Sequelize=require(_0x4ff7('0x1'));module[_0x4ff7('0x2')]={'uniqueid':{'type':Sequelize[_0x4ff7('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4ff7('0x3')]},'joinAt':{'type':Sequelize[_0x4ff7('0x4')]},'leaveAt':{'type':Sequelize[_0x4ff7('0x4')]},'acceptAt':{'type':Sequelize[_0x4ff7('0x4')]},'exitAt':{'type':Sequelize[_0x4ff7('0x4')]},'reason':{'type':Sequelize[_0x4ff7('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index bfa2f40..70954f4 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 _0x522b=['rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','find','create','body','html-pdf','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','MailQueueReport'];(function(_0x1cd633,_0x21c3db){var _0x5bf6d8=function(_0x19de57){while(--_0x19de57){_0x1cd633['push'](_0x1cd633['shift']());}};_0x5bf6d8(++_0x21c3db);}(_0x522b,0x1c3));var _0xb522=function(_0x2ac5f8,_0x4c3a9f){_0x2ac5f8=_0x2ac5f8-0x0;var _0x3b8229=_0x522b[_0x2ac5f8];return _0x3b8229;};'use strict';var pdf=require(_0xb522('0x0'));var emlformat=require(_0xb522('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb522('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb522('0x3'));var BPromise=require(_0xb522('0x4'));var Mustache=require('mustache');var util=require(_0xb522('0x5'));var path=require(_0xb522('0x6'));var sox=require(_0xb522('0x7'));var csv=require(_0xb522('0x8'));var ejs=require(_0xb522('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb522('0xa'));var crypto=require(_0xb522('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb522('0x8'));var querystring=require('querystring');var Papa=require(_0xb522('0xc'));var Redis=require(_0xb522('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xb522('0xe'));var as=require(_0xb522('0xf'));var hardwareService=require(_0xb522('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xb522('0x11'));var config=require(_0xb522('0x12'));var db=require(_0xb522('0x13'))['db'];function respondWithStatusCode(_0x572c2e,_0x2f9b7a){_0x2f9b7a=_0x2f9b7a||0xcc;return function(_0x595dd6){if(_0x595dd6){return _0x572c2e[_0xb522('0x14')](_0x2f9b7a);}return _0x572c2e[_0xb522('0x15')](_0x2f9b7a)['end']();};}function respondWithResult(_0x470b4a,_0x5c79df){_0x5c79df=_0x5c79df||0xc8;return function(_0x2087d5){if(_0x2087d5){return _0x470b4a[_0xb522('0x15')](_0x5c79df)[_0xb522('0x16')](_0x2087d5);}};}function respondWithFilteredResult(_0x369cd9,_0x37d26c){return function(_0x2a8eba){if(_0x2a8eba){var _0x210a00=_0x2a8eba[_0xb522('0x17')],_0x4c31cd=_0x37d26c[_0xb522('0x18')],_0x1c778f=_0x37d26c[_0xb522('0x18')]+_0x37d26c['limit'],_0x56abe9;if(_0x1c778f>=_0x210a00){_0x1c778f=_0x210a00;_0x56abe9=0xc8;}else{_0x56abe9=0xce;}_0x369cd9[_0xb522('0x15')](_0x56abe9);return _0x369cd9['set'](_0xb522('0x19'),_0x4c31cd+'-'+_0x1c778f+'/'+_0x210a00)[_0xb522('0x16')](_0x2a8eba);}return null;};}function patchUpdates(_0x10b0b7){return function(_0x3de7f5){try{jsonpatch[_0xb522('0x1a')](_0x3de7f5,_0x10b0b7,!![]);}catch(_0x3baef8){return BPromise[_0xb522('0x1b')](_0x3baef8);}return _0x3de7f5['save']();};}function saveUpdates(_0x58a513,_0x4e53be){return function(_0x34b79c){if(_0x34b79c){return _0x34b79c[_0xb522('0x1c')](_0x58a513)[_0xb522('0x1d')](function(_0x374b7b){return _0x374b7b;});}return null;};}function removeEntity(_0x2bfe71,_0x3fe54a){return function(_0x1d0764){if(_0x1d0764){return _0x1d0764[_0xb522('0x1e')]()[_0xb522('0x1d')](function(){_0x2bfe71[_0xb522('0x15')](0xcc)[_0xb522('0x1f')]();});}};}function handleEntityNotFound(_0x118be7,_0x3799ec){return function(_0x5434ef){if(!_0x5434ef){_0x118be7[_0xb522('0x14')](0x194);}return _0x5434ef;};}function handleError(_0x2baa5b,_0x4c9ffc){_0x4c9ffc=_0x4c9ffc||0x1f4;return function(_0x22a1d1){logger[_0xb522('0x20')](_0x22a1d1[_0xb522('0x21')]);if(_0x22a1d1['name']){delete _0x22a1d1[_0xb522('0x22')];}_0x2baa5b['status'](_0x4c9ffc)[_0xb522('0x23')](_0x22a1d1);};}exports[_0xb522('0x24')]=function(_0x197523,_0x4295e6){var _0x5ed9ae={},_0x518f56={},_0x1e9785={'count':0x0,'rows':[]};var _0x4a6599=_[_0xb522('0x25')](db[_0xb522('0x26')][_0xb522('0x27')],function(_0x4fca53){return{'name':_0x4fca53[_0xb522('0x28')],'type':_0x4fca53[_0xb522('0x29')]['key']};});_0x518f56[_0xb522('0x2a')]=_[_0xb522('0x25')](_0x4a6599,_0xb522('0x22'));_0x518f56[_0xb522('0x2b')]=_[_0xb522('0x2c')](_0x197523['query']);_0x518f56[_0xb522('0x2d')]=_[_0xb522('0x2e')](_0x518f56[_0xb522('0x2a')],_0x518f56[_0xb522('0x2b')]);_0x5ed9ae[_0xb522('0x2f')]=_[_0xb522('0x2e')](_0x518f56[_0xb522('0x2a')],qs['fields'](_0x197523[_0xb522('0x2b')][_0xb522('0x30')]));_0x5ed9ae[_0xb522('0x2f')]=_0x5ed9ae['attributes'][_0xb522('0x31')]?_0x5ed9ae[_0xb522('0x2f')]:_0x518f56['model'];if(!_0x197523['query'][_0xb522('0x32')](_0xb522('0x33'))){_0x5ed9ae[_0xb522('0x34')]=qs[_0xb522('0x34')](_0x197523[_0xb522('0x2b')][_0xb522('0x34')]);_0x5ed9ae[_0xb522('0x18')]=qs[_0xb522('0x18')](_0x197523[_0xb522('0x2b')][_0xb522('0x18')]);}_0x5ed9ae[_0xb522('0x35')]=qs[_0xb522('0x36')](_0x197523[_0xb522('0x2b')][_0xb522('0x36')]);_0x5ed9ae[_0xb522('0x37')]=qs[_0xb522('0x2d')](_[_0xb522('0x38')](_0x197523[_0xb522('0x2b')],_0x518f56[_0xb522('0x2d')]),_0x4a6599);if(_0x197523['query']['filter']){_0x5ed9ae['where']=_[_0xb522('0x39')](_0x5ed9ae[_0xb522('0x37')],{'$or':_[_0xb522('0x25')](_0x4a6599,function(_0x1c39d7){if(_0x1c39d7[_0xb522('0x29')]!==_0xb522('0x3a')){var _0x1bd870={};_0x1bd870[_0x1c39d7['name']]={'$like':'%'+_0x197523['query'][_0xb522('0x3b')]+'%'};return _0x1bd870;}})});}_0x5ed9ae=_['merge']({},_0x5ed9ae,_0x197523[_0xb522('0x3c')]);var _0x2257f4={'where':_0x5ed9ae[_0xb522('0x37')]};return db[_0xb522('0x26')][_0xb522('0x17')](_0x2257f4)[_0xb522('0x1d')](function(_0x2604e2){_0x1e9785[_0xb522('0x17')]=_0x2604e2;if(_0x197523['query'][_0xb522('0x3d')]){_0x5ed9ae[_0xb522('0x3e')]=[{'all':!![]}];}return db['MailQueueReport']['findAll'](_0x5ed9ae);})['then'](function(_0x4518c0){_0x1e9785[_0xb522('0x3f')]=_0x4518c0;return _0x1e9785;})[_0xb522('0x1d')](respondWithFilteredResult(_0x4295e6,_0x5ed9ae))[_0xb522('0x40')](handleError(_0x4295e6,null));};exports[_0xb522('0x41')]=function(_0x4665a1,_0x31decb){var _0x4bbd8f={'raw':!![],'where':{'id':_0x4665a1[_0xb522('0x42')]['id']}},_0x3dcdcb={};_0x3dcdcb[_0xb522('0x2a')]=_[_0xb522('0x2c')](db['MailQueueReport'][_0xb522('0x27')]);_0x3dcdcb[_0xb522('0x2b')]=_[_0xb522('0x2c')](_0x4665a1['query']);_0x3dcdcb[_0xb522('0x2d')]=_[_0xb522('0x2e')](_0x3dcdcb['model'],_0x3dcdcb['query']);_0x4bbd8f[_0xb522('0x2f')]=_[_0xb522('0x2e')](_0x3dcdcb[_0xb522('0x2a')],qs[_0xb522('0x30')](_0x4665a1[_0xb522('0x2b')][_0xb522('0x30')]));_0x4bbd8f['attributes']=_0x4bbd8f[_0xb522('0x2f')]['length']?_0x4bbd8f[_0xb522('0x2f')]:_0x3dcdcb[_0xb522('0x2a')];if(_0x4665a1[_0xb522('0x2b')][_0xb522('0x3d')]){_0x4bbd8f['include']=[{'all':!![]}];}_0x4bbd8f=_[_0xb522('0x39')]({},_0x4bbd8f,_0x4665a1['options']);return db[_0xb522('0x26')][_0xb522('0x43')](_0x4bbd8f)[_0xb522('0x1d')](handleEntityNotFound(_0x31decb,null))[_0xb522('0x1d')](respondWithResult(_0x31decb,null))[_0xb522('0x40')](handleError(_0x31decb,null));};exports[_0xb522('0x44')]=function(_0x53f053,_0x4e9252){return db[_0xb522('0x26')][_0xb522('0x44')](_0x53f053[_0xb522('0x45')],{})[_0xb522('0x1d')](respondWithResult(_0x4e9252,0xc9))['catch'](handleError(_0x4e9252,null));};exports[_0xb522('0x1c')]=function(_0x5a6c76,_0x397249){if(_0x5a6c76['body']['id']){delete _0x5a6c76['body']['id'];}return db[_0xb522('0x26')]['find']({'where':{'id':_0x5a6c76[_0xb522('0x42')]['id']}})[_0xb522('0x1d')](handleEntityNotFound(_0x397249,null))['then'](saveUpdates(_0x5a6c76[_0xb522('0x45')],null))[_0xb522('0x1d')](respondWithResult(_0x397249,null))[_0xb522('0x40')](handleError(_0x397249,null));};exports[_0xb522('0x1e')]=function(_0x341730,_0x184a3f){return db[_0xb522('0x26')][_0xb522('0x43')]({'where':{'id':_0x341730[_0xb522('0x42')]['id']}})['then'](handleEntityNotFound(_0x184a3f,null))['then'](removeEntity(_0x184a3f,null))[_0xb522('0x40')](handleError(_0x184a3f,null));};exports['describe']=function(_0x451cc6,_0x8b54df){return db[_0xb522('0x26')]['describe']()['then'](respondWithResult(_0x8b54df,null))['catch'](handleError(_0x8b54df,null));}; \ No newline at end of file +var _0xe198=['update','then','destroy','sendStatus','error','stack','name','send','map','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','MailQueueReport','findAll','catch','include','find','create','body','params','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','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','../../mysqldb','end','json','count','offset','limit','status','set','Content-Range','apply','save'];(function(_0x262744,_0x4ef281){var _0x39ca85=function(_0x1632d2){while(--_0x1632d2){_0x262744['push'](_0x262744['shift']());}};_0x39ca85(++_0x4ef281);}(_0xe198,0x6f));var _0x8e19=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xe198[_0x6cf19c];return _0xce14f3;};'use strict';var pdf=require(_0x8e19('0x0'));var emlformat=require(_0x8e19('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8e19('0x2'));var rp=require(_0x8e19('0x3'));var moment=require(_0x8e19('0x4'));var BPromise=require(_0x8e19('0x5'));var Mustache=require(_0x8e19('0x6'));var util=require('util');var path=require(_0x8e19('0x7'));var sox=require(_0x8e19('0x8'));var csv=require(_0x8e19('0x9'));var ejs=require(_0x8e19('0xa'));var fs=require('fs');var _=require(_0x8e19('0xb'));var squel=require(_0x8e19('0xc'));var crypto=require(_0x8e19('0xd'));var jsforce=require(_0x8e19('0xe'));var deskjs=require(_0x8e19('0xf'));var toCsv=require(_0x8e19('0x9'));var querystring=require(_0x8e19('0x10'));var Papa=require(_0x8e19('0x11'));var Redis=require(_0x8e19('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8e19('0x13'));var as=require(_0x8e19('0x14'));var hardwareService=require(_0x8e19('0x15'));var logger=require(_0x8e19('0x16'))(_0x8e19('0x17'));var utils=require(_0x8e19('0x18'));var config=require(_0x8e19('0x19'));var db=require(_0x8e19('0x1a'))['db'];function respondWithStatusCode(_0x48433d,_0x51a0c4){_0x51a0c4=_0x51a0c4||0xcc;return function(_0x3f4a6d){if(_0x3f4a6d){return _0x48433d['sendStatus'](_0x51a0c4);}return _0x48433d['status'](_0x51a0c4)[_0x8e19('0x1b')]();};}function respondWithResult(_0x2c2d05,_0x16b584){_0x16b584=_0x16b584||0xc8;return function(_0x76ccdb){if(_0x76ccdb){return _0x2c2d05['status'](_0x16b584)[_0x8e19('0x1c')](_0x76ccdb);}};}function respondWithFilteredResult(_0x32f3ef,_0x5c474d){return function(_0x34a7c9){if(_0x34a7c9){var _0x319971=_0x34a7c9[_0x8e19('0x1d')],_0x4b2c05=_0x5c474d[_0x8e19('0x1e')],_0x325f54=_0x5c474d[_0x8e19('0x1e')]+_0x5c474d[_0x8e19('0x1f')],_0x33c590;if(_0x325f54>=_0x319971){_0x325f54=_0x319971;_0x33c590=0xc8;}else{_0x33c590=0xce;}_0x32f3ef[_0x8e19('0x20')](_0x33c590);return _0x32f3ef[_0x8e19('0x21')](_0x8e19('0x22'),_0x4b2c05+'-'+_0x325f54+'/'+_0x319971)[_0x8e19('0x1c')](_0x34a7c9);}return null;};}function patchUpdates(_0x18a9d0){return function(_0x1118f2){try{jsonpatch[_0x8e19('0x23')](_0x1118f2,_0x18a9d0,!![]);}catch(_0xba6a62){return BPromise['reject'](_0xba6a62);}return _0x1118f2[_0x8e19('0x24')]();};}function saveUpdates(_0x8d132c,_0x142265){return function(_0x314798){if(_0x314798){return _0x314798[_0x8e19('0x25')](_0x8d132c)[_0x8e19('0x26')](function(_0xed03e0){return _0xed03e0;});}return null;};}function removeEntity(_0x3db765,_0x473d03){return function(_0x1223c9){if(_0x1223c9){return _0x1223c9[_0x8e19('0x27')]()[_0x8e19('0x26')](function(){_0x3db765[_0x8e19('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33d921,_0x556f61){return function(_0x54cd89){if(!_0x54cd89){_0x33d921[_0x8e19('0x28')](0x194);}return _0x54cd89;};}function handleError(_0x1d2e25,_0x157cca){_0x157cca=_0x157cca||0x1f4;return function(_0x4f7bed){logger[_0x8e19('0x29')](_0x4f7bed[_0x8e19('0x2a')]);if(_0x4f7bed[_0x8e19('0x2b')]){delete _0x4f7bed[_0x8e19('0x2b')];}_0x1d2e25[_0x8e19('0x20')](_0x157cca)[_0x8e19('0x2c')](_0x4f7bed);};}exports['index']=function(_0x43a860,_0x168cd3){var _0x25dd6b={},_0x2866cd={},_0x551feb={'count':0x0,'rows':[]};var _0x3a7557=_[_0x8e19('0x2d')](db['MailQueueReport']['rawAttributes'],function(_0x329421){return{'name':_0x329421[_0x8e19('0x2e')],'type':_0x329421[_0x8e19('0x2f')][_0x8e19('0x30')]};});_0x2866cd[_0x8e19('0x31')]=_[_0x8e19('0x2d')](_0x3a7557,'name');_0x2866cd['query']=_[_0x8e19('0x32')](_0x43a860['query']);_0x2866cd[_0x8e19('0x33')]=_[_0x8e19('0x34')](_0x2866cd[_0x8e19('0x31')],_0x2866cd[_0x8e19('0x35')]);_0x25dd6b['attributes']=_[_0x8e19('0x34')](_0x2866cd[_0x8e19('0x31')],qs['fields'](_0x43a860['query'][_0x8e19('0x36')]));_0x25dd6b[_0x8e19('0x37')]=_0x25dd6b[_0x8e19('0x37')][_0x8e19('0x38')]?_0x25dd6b[_0x8e19('0x37')]:_0x2866cd[_0x8e19('0x31')];if(!_0x43a860[_0x8e19('0x35')][_0x8e19('0x39')]('nolimit')){_0x25dd6b[_0x8e19('0x1f')]=qs[_0x8e19('0x1f')](_0x43a860['query'][_0x8e19('0x1f')]);_0x25dd6b[_0x8e19('0x1e')]=qs[_0x8e19('0x1e')](_0x43a860[_0x8e19('0x35')][_0x8e19('0x1e')]);}_0x25dd6b[_0x8e19('0x3a')]=qs[_0x8e19('0x3b')](_0x43a860['query'][_0x8e19('0x3b')]);_0x25dd6b[_0x8e19('0x3c')]=qs[_0x8e19('0x33')](_[_0x8e19('0x3d')](_0x43a860[_0x8e19('0x35')],_0x2866cd[_0x8e19('0x33')]),_0x3a7557);if(_0x43a860[_0x8e19('0x35')][_0x8e19('0x3e')]){_0x25dd6b[_0x8e19('0x3c')]=_[_0x8e19('0x3f')](_0x25dd6b[_0x8e19('0x3c')],{'$or':_[_0x8e19('0x2d')](_0x3a7557,function(_0x518b89){if(_0x518b89[_0x8e19('0x2f')]!=='VIRTUAL'){var _0x4bab63={};_0x4bab63[_0x518b89['name']]={'$like':'%'+_0x43a860['query'][_0x8e19('0x3e')]+'%'};return _0x4bab63;}})});}_0x25dd6b=_[_0x8e19('0x3f')]({},_0x25dd6b,_0x43a860[_0x8e19('0x40')]);var _0xc15b5={'where':_0x25dd6b['where']};return db[_0x8e19('0x41')][_0x8e19('0x1d')](_0xc15b5)[_0x8e19('0x26')](function(_0x39aee0){_0x551feb[_0x8e19('0x1d')]=_0x39aee0;if(_0x43a860[_0x8e19('0x35')]['includeAll']){_0x25dd6b['include']=[{'all':!![]}];}return db[_0x8e19('0x41')][_0x8e19('0x42')](_0x25dd6b);})[_0x8e19('0x26')](function(_0x15b8be){_0x551feb['rows']=_0x15b8be;return _0x551feb;})[_0x8e19('0x26')](respondWithFilteredResult(_0x168cd3,_0x25dd6b))[_0x8e19('0x43')](handleError(_0x168cd3,null));};exports['show']=function(_0x860d35,_0x3ced59){var _0x4577db={'raw':!![],'where':{'id':_0x860d35['params']['id']}},_0x59d9c0={};_0x59d9c0[_0x8e19('0x31')]=_[_0x8e19('0x32')](db[_0x8e19('0x41')]['rawAttributes']);_0x59d9c0[_0x8e19('0x35')]=_[_0x8e19('0x32')](_0x860d35[_0x8e19('0x35')]);_0x59d9c0[_0x8e19('0x33')]=_['intersection'](_0x59d9c0[_0x8e19('0x31')],_0x59d9c0[_0x8e19('0x35')]);_0x4577db[_0x8e19('0x37')]=_[_0x8e19('0x34')](_0x59d9c0['model'],qs[_0x8e19('0x36')](_0x860d35[_0x8e19('0x35')][_0x8e19('0x36')]));_0x4577db[_0x8e19('0x37')]=_0x4577db[_0x8e19('0x37')][_0x8e19('0x38')]?_0x4577db[_0x8e19('0x37')]:_0x59d9c0[_0x8e19('0x31')];if(_0x860d35[_0x8e19('0x35')]['includeAll']){_0x4577db[_0x8e19('0x44')]=[{'all':!![]}];}_0x4577db=_['merge']({},_0x4577db,_0x860d35[_0x8e19('0x40')]);return db[_0x8e19('0x41')][_0x8e19('0x45')](_0x4577db)[_0x8e19('0x26')](handleEntityNotFound(_0x3ced59,null))[_0x8e19('0x26')](respondWithResult(_0x3ced59,null))[_0x8e19('0x43')](handleError(_0x3ced59,null));};exports[_0x8e19('0x46')]=function(_0x426ac7,_0x504007){return db[_0x8e19('0x41')][_0x8e19('0x46')](_0x426ac7[_0x8e19('0x47')],{})[_0x8e19('0x26')](respondWithResult(_0x504007,0xc9))[_0x8e19('0x43')](handleError(_0x504007,null));};exports[_0x8e19('0x25')]=function(_0x1bb5c8,_0x3edb29){if(_0x1bb5c8[_0x8e19('0x47')]['id']){delete _0x1bb5c8['body']['id'];}return db[_0x8e19('0x41')][_0x8e19('0x45')]({'where':{'id':_0x1bb5c8[_0x8e19('0x48')]['id']}})[_0x8e19('0x26')](handleEntityNotFound(_0x3edb29,null))[_0x8e19('0x26')](saveUpdates(_0x1bb5c8[_0x8e19('0x47')],null))[_0x8e19('0x26')](respondWithResult(_0x3edb29,null))['catch'](handleError(_0x3edb29,null));};exports['destroy']=function(_0x511c11,_0x22f71b){return db[_0x8e19('0x41')][_0x8e19('0x45')]({'where':{'id':_0x511c11[_0x8e19('0x48')]['id']}})[_0x8e19('0x26')](handleEntityNotFound(_0x22f71b,null))['then'](removeEntity(_0x22f71b,null))[_0x8e19('0x43')](handleError(_0x22f71b,null));};exports[_0x8e19('0x49')]=function(_0x63e5db,_0x30b223){return db[_0x8e19('0x41')][_0x8e19('0x49')]()[_0x8e19('0x26')](respondWithResult(_0x30b223,null))[_0x8e19('0x43')](handleError(_0x30b223,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 70166b2..56c9ef4 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 _0x27c8=['bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','define','MailQueueReport','report_mail_queue','uniqueid','util','../../config/logger'];(function(_0x1dae0f,_0x5d8469){var _0x316039=function(_0xa51f8c){while(--_0xa51f8c){_0x1dae0f['push'](_0x1dae0f['shift']());}};_0x316039(++_0x5d8469);}(_0x27c8,0x6a));var _0x827c=function(_0x33a7c0,_0x5970d9){_0x33a7c0=_0x33a7c0-0x0;var _0x30bc54=_0x27c8[_0x33a7c0];return _0x30bc54;};'use strict';var _=require('lodash');var util=require(_0x827c('0x0'));var logger=require(_0x827c('0x1'))('api');var moment=require('moment');var BPromise=require(_0x827c('0x2'));var rp=require(_0x827c('0x3'));var fs=require('fs');var path=require(_0x827c('0x4'));var rimraf=require(_0x827c('0x5'));var config=require(_0x827c('0x6'));var attributes=require(_0x827c('0x7'));module['exports']=function(_0x56b4eb,_0x390119){return _0x56b4eb[_0x827c('0x8')](_0x827c('0x9'),attributes,{'tableName':_0x827c('0xa'),'paranoid':![],'indexes':[{'name':_0x827c('0xb'),'fields':[_0x827c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc3b7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','MailQueueReport','uniqueid'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0xc3b7,0xb4));var _0x7c3b=function(_0xa4dc1,_0x550489){_0xa4dc1=_0xa4dc1-0x0;var _0x2b8c58=_0xc3b7[_0xa4dc1];return _0x2b8c58;};'use strict';var _=require('lodash');var util=require(_0x7c3b('0x0'));var logger=require(_0x7c3b('0x1'))(_0x7c3b('0x2'));var moment=require(_0x7c3b('0x3'));var BPromise=require(_0x7c3b('0x4'));var rp=require(_0x7c3b('0x5'));var fs=require('fs');var path=require(_0x7c3b('0x6'));var rimraf=require(_0x7c3b('0x7'));var config=require(_0x7c3b('0x8'));var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x20fa26,_0x40ef6a){return _0x20fa26[_0x7c3b('0x9')](_0x7c3b('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x7c3b('0xb'),'fields':[_0x7c3b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 65825e6..d51a6bf 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 _0x5d17=['catch','CreateMailQueueReport','create','body','options','raw','then','UpdateMailQueueReport','MailQueueReport','update','attributes','limit','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailQueueReport,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x155499,_0x29da45){var _0x835c3b=function(_0x455d08){while(--_0x455d08){_0x155499['push'](_0x155499['shift']());}};_0x835c3b(++_0x29da45);}(_0x5d17,0x114));var _0x75d1=function(_0xcd49bd,_0x2a12a3){_0xcd49bd=_0xcd49bd-0x0;var _0xb6ee44=_0x5d17[_0xcd49bd];return _0xb6ee44;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x75d1('0x2'));var fs=require('fs');var Redis=require(_0x75d1('0x3'));var db=require(_0x75d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75d1('0x5'))(_0x75d1('0x6'));var config=require(_0x75d1('0x7'));var jayson=require(_0x75d1('0x8'));var client=jayson['client'][_0x75d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x116a51,_0x5c957a,_0x1ee61b){return new BPromise(function(_0x3a9d5e,_0x105607){return client[_0x75d1('0xa')](_0x116a51,_0x1ee61b)['then'](function(_0x4cf632){logger[_0x75d1('0xb')]('MailQueueReport,\x20%s,\x20%s',_0x5c957a,'request\x20sent');logger[_0x75d1('0xc')](_0x75d1('0xd'),_0x5c957a,'request\x20sent',JSON[_0x75d1('0xe')](_0x4cf632));if(_0x4cf632[_0x75d1('0xf')]){if(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x10')]===0x1f4){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x4cf632['error'][_0x75d1('0x12')]);return _0x105607(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}logger[_0x75d1('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x5c957a,_0x4cf632['error']['message']);return _0x3a9d5e(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}else{logger[_0x75d1('0xb')]('MailQueueReport,\x20%s,\x20%s',_0x5c957a,_0x75d1('0x13'));_0x3a9d5e(_0x4cf632[_0x75d1('0x14')][_0x75d1('0x12')]);}})[_0x75d1('0x15')](function(_0x1160ca){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x1160ca);_0x105607(_0x1160ca);});});}exports[_0x75d1('0x16')]=function(_0x1bc5de){var _0x3d0717=this;return new Promise(function(_0x2c2a6d,_0x5761db){return db['MailQueueReport'][_0x75d1('0x17')](_0x1bc5de[_0x75d1('0x18')],{'raw':_0x1bc5de['options']?_0x1bc5de[_0x75d1('0x19')][_0x75d1('0x1a')]===undefined?!![]:![]:!![]})[_0x75d1('0x1b')](function(_0xf6cc70){logger[_0x75d1('0xb')](_0x75d1('0x16'),_0x1bc5de);logger['debug'](_0x75d1('0x16'),_0x1bc5de,JSON[_0x75d1('0xe')](_0xf6cc70));_0x2c2a6d(_0xf6cc70);})['catch'](function(_0x1cb58c){logger[_0x75d1('0xf')]('CreateMailQueueReport',_0x1cb58c[_0x75d1('0x12')],_0x1bc5de);_0x5761db(_0x3d0717['error'](0x1f4,_0x1cb58c[_0x75d1('0x12')]));});});};exports[_0x75d1('0x1c')]=function(_0x345cf5){var _0x4b2a25=this;return new Promise(function(_0x525588,_0x4590ac){return db[_0x75d1('0x1d')][_0x75d1('0x1e')](_0x345cf5[_0x75d1('0x18')],{'raw':_0x345cf5['options']?_0x345cf5[_0x75d1('0x19')][_0x75d1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x345cf5[_0x75d1('0x19')]?_0x345cf5['options']['where']||null:null,'attributes':_0x345cf5['options']?_0x345cf5[_0x75d1('0x19')][_0x75d1('0x1f')]||null:null,'limit':_0x345cf5[_0x75d1('0x19')]?_0x345cf5[_0x75d1('0x19')][_0x75d1('0x20')]||null:null})['then'](function(_0x4d292e){logger[_0x75d1('0xb')](_0x75d1('0x1c'),_0x345cf5);logger['debug'](_0x75d1('0x1c'),_0x345cf5,JSON['stringify'](_0x4d292e));_0x525588(_0x4d292e);})[_0x75d1('0x15')](function(_0x244da6){logger[_0x75d1('0xf')](_0x75d1('0x1c'),_0x244da6[_0x75d1('0x12')],_0x345cf5);_0x4590ac(_0x4b2a25['error'](0x1f4,_0x244da6[_0x75d1('0x12')]));});});}; \ No newline at end of file +var _0x524e=['info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailQueueReport','create','options','CreateMailQueueReport','catch','UpdateMailQueueReport','update','body','raw','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x524e,0x15e));var _0xe524=function(_0x51a97f,_0x462a1a){_0x51a97f=_0x51a97f-0x0;var _0x38deb6=_0x524e[_0x51a97f];return _0x38deb6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('MailQueueReport,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}exports['CreateMailQueueReport']=function(_0x3a4027){var _0x4f1dfb=this;return new Promise(function(_0x11b2a1,_0x238f8f){return db[_0xe524('0x16')][_0xe524('0x17')](_0x3a4027['body'],{'raw':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xe524('0xc')](function(_0x309f85){logger[_0xe524('0xd')](_0xe524('0x19'),_0x3a4027);logger[_0xe524('0x10')](_0xe524('0x19'),_0x3a4027,JSON[_0xe524('0x12')](_0x309f85));_0x11b2a1(_0x309f85);})[_0xe524('0x1a')](function(_0x7dfe97){logger['error'](_0xe524('0x19'),_0x7dfe97['message'],_0x3a4027);_0x238f8f(_0x4f1dfb['error'](0x1f4,_0x7dfe97[_0xe524('0x15')]));});});};exports[_0xe524('0x1b')]=function(_0x1ad106){var _0x85fc51=this;return new Promise(function(_0x599d5d,_0x158f07){return db['MailQueueReport'][_0xe524('0x1c')](_0x1ad106[_0xe524('0x1d')],{'raw':_0x1ad106[_0xe524('0x18')]?_0x1ad106[_0xe524('0x18')][_0xe524('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ad106[_0xe524('0x18')]?_0x1ad106[_0xe524('0x18')]['where']||null:null,'attributes':_0x1ad106['options']?_0x1ad106[_0xe524('0x18')][_0xe524('0x1f')]||null:null,'limit':_0x1ad106[_0xe524('0x18')]?_0x1ad106[_0xe524('0x18')][_0xe524('0x20')]||null:null})['then'](function(_0x52f140){logger[_0xe524('0xd')](_0xe524('0x1b'),_0x1ad106);logger[_0xe524('0x10')](_0xe524('0x1b'),_0x1ad106,JSON[_0xe524('0x12')](_0x52f140));_0x599d5d(_0x52f140);})['catch'](function(_0x365a1f){logger[_0xe524('0x13')]('UpdateMailQueueReport',_0x365a1f['message'],_0x1ad106);_0x158f07(_0x85fc51[_0xe524('0x13')](0x1f4,_0x365a1f[_0xe524('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index fde3315..f421ada 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 _0x9d5a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x19369e,_0x37d390){var _0xe9b794=function(_0x12d59b){while(--_0x12d59b){_0x19369e['push'](_0x19369e['shift']());}};_0xe9b794(++_0x37d390);}(_0x9d5a,0x187));var _0xa9d5=function(_0x48b00c,_0x16690b){_0x48b00c=_0x48b00c-0x0;var _0x55d181=_0x9d5a[_0x48b00c];return _0x55d181;};'use strict';var multer=require(_0xa9d5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa9d5('0x1'));var express=require(_0xa9d5('0x2'));var router=express[_0xa9d5('0x3')]();var auth=require(_0xa9d5('0x4'));var interaction=require(_0xa9d5('0x5'));var config=require(_0xa9d5('0x6'));module[_0xa9d5('0x7')]=router; \ No newline at end of file +var _0x1d98=['../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','Router','../../components/auth/service'];(function(_0xb7d03,_0x43fc49){var _0x1af9ff=function(_0x105fd5){while(--_0x105fd5){_0xb7d03['push'](_0xb7d03['shift']());}};_0x1af9ff(++_0x43fc49);}(_0x1d98,0xb3));var _0x81d9=function(_0x465ceb,_0x55ccd4){_0x465ceb=_0x465ceb-0x0;var _0x239ce0=_0x1d98[_0x465ceb];return _0x239ce0;};'use strict';var multer=require(_0x81d9('0x0'));var util=require(_0x81d9('0x1'));var path=require('path');var timeout=require(_0x81d9('0x2'));var express=require('express');var router=express[_0x81d9('0x3')]();var auth=require(_0x81d9('0x4'));var interaction=require(_0x81d9('0x5'));var config=require(_0x81d9('0x6'));module[_0x81d9('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 40eed02..6ffe8aa 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 _0x5126=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x57494a,_0x408b35){var _0x1ac526=function(_0x2fc54b){while(--_0x2fc54b){_0x57494a['push'](_0x57494a['shift']());}};_0x1ac526(++_0x408b35);}(_0x5126,0x192));var _0x6512=function(_0x329d69,_0x40afd2){_0x329d69=_0x329d69-0x0;var _0xc45b63=_0x5126[_0x329d69];return _0xc45b63;};'use strict';var Sequelize=require(_0x6512('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x6512('0x1')]},'authentication':{'type':Sequelize[_0x6512('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x6512('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x6512('0x3')]},'tls':{'type':Sequelize[_0x6512('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x6512('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x6512('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x39d0=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x1ef46b,_0x928fd8){var _0x914119=function(_0x3a265e){while(--_0x3a265e){_0x1ef46b['push'](_0x1ef46b['shift']());}};_0x914119(++_0x928fd8);}(_0x39d0,0x9d));var _0x039d=function(_0x28a476,_0x35e9d3){_0x28a476=_0x28a476-0x0;var _0xe236cc=_0x39d0[_0x28a476];return _0xe236cc;};'use strict';var Sequelize=require(_0x039d('0x0'));module['exports']={'description':{'type':Sequelize[_0x039d('0x1')]},'host':{'type':Sequelize[_0x039d('0x1')]},'authentication':{'type':Sequelize[_0x039d('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x039d('0x1')]},'port':{'type':Sequelize[_0x039d('0x3')]},'tls':{'type':Sequelize[_0x039d('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x039d('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x039d('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 24ee745..5b775d0 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 _0x6f7b=['moment','bluebird','request-promise','path','../../config/environment','exports','define','mail_servers_in','util','../../config/logger','api'];(function(_0x10dc60,_0x2fcce1){var _0x47dec5=function(_0x24b5e4){while(--_0x24b5e4){_0x10dc60['push'](_0x10dc60['shift']());}};_0x47dec5(++_0x2fcce1);}(_0x6f7b,0x168));var _0xb6f7=function(_0x3d478a,_0x5310d1){_0x3d478a=_0x3d478a-0x0;var _0x1d94c6=_0x6f7b[_0x3d478a];return _0x1d94c6;};'use strict';var _=require('lodash');var util=require(_0xb6f7('0x0'));var logger=require(_0xb6f7('0x1'))(_0xb6f7('0x2'));var moment=require(_0xb6f7('0x3'));var BPromise=require(_0xb6f7('0x4'));var rp=require(_0xb6f7('0x5'));var fs=require('fs');var path=require(_0xb6f7('0x6'));var rimraf=require('rimraf');var config=require(_0xb6f7('0x7'));var attributes=require('./mailServerIn.attributes');module[_0xb6f7('0x8')]=function(_0x25cec3,_0x59b2d9){return _0x25cec3[_0xb6f7('0x9')]('MailServerIn',attributes,{'tableName':_0xb6f7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x254a=['exports','mail_servers_in','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2d8221,_0x38ec13){var _0x5a6b89=function(_0x350836){while(--_0x350836){_0x2d8221['push'](_0x2d8221['shift']());}};_0x5a6b89(++_0x38ec13);}(_0x254a,0x138));var _0xa254=function(_0x184f5f,_0x2034dd){_0x184f5f=_0x184f5f-0x0;var _0x467cd7=_0x254a[_0x184f5f];return _0x467cd7;};'use strict';var _=require(_0xa254('0x0'));var util=require(_0xa254('0x1'));var logger=require(_0xa254('0x2'))('api');var moment=require(_0xa254('0x3'));var BPromise=require(_0xa254('0x4'));var rp=require(_0xa254('0x5'));var fs=require('fs');var path=require(_0xa254('0x6'));var rimraf=require('rimraf');var config=require(_0xa254('0x7'));var attributes=require('./mailServerIn.attributes');module[_0xa254('0x8')]=function(_0x3d5886,_0x1201ae){return _0x3d5886['define']('MailServerIn',attributes,{'tableName':_0xa254('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 db547e6..fecbbc5 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 _0x1814=['MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','GetMailServerIn','MailServerIn','options','raw','where','attributes','include','model','map','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x286726,_0x20a337){var _0xcd4fe9=function(_0x4d7da6){while(--_0x4d7da6){_0x286726['push'](_0x286726['shift']());}};_0xcd4fe9(++_0x20a337);}(_0x1814,0x109));var _0x4181=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1814[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4181('0x0'));var util=require(_0x4181('0x1'));var moment=require('moment');var BPromise=require(_0x4181('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4181('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4181('0x4'));var logger=require(_0x4181('0x5'))(_0x4181('0x6'));var config=require('../../config/environment');var jayson=require(_0x4181('0x7'));var client=jayson[_0x4181('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf27177,_0x5d0bc7,_0x52b7f6){return new BPromise(function(_0x4091c0,_0x116585){return client[_0x4181('0x9')](_0xf27177,_0x52b7f6)[_0x4181('0xa')](function(_0x4ed9f7){logger[_0x4181('0xb')]('MailServerIn,\x20%s,\x20%s',_0x5d0bc7,_0x4181('0xc'));logger[_0x4181('0xd')](_0x4181('0xe'),_0x5d0bc7,_0x4181('0xc'),JSON[_0x4181('0xf')](_0x4ed9f7));if(_0x4ed9f7[_0x4181('0x10')]){if(_0x4ed9f7[_0x4181('0x10')][_0x4181('0x11')]===0x1f4){logger[_0x4181('0x10')](_0x4181('0x12'),_0x5d0bc7,_0x4ed9f7[_0x4181('0x10')][_0x4181('0x13')]);return _0x116585(_0x4ed9f7[_0x4181('0x10')][_0x4181('0x13')]);}logger[_0x4181('0x10')](_0x4181('0x12'),_0x5d0bc7,_0x4ed9f7[_0x4181('0x10')][_0x4181('0x13')]);return _0x4091c0(_0x4ed9f7[_0x4181('0x10')]['message']);}else{logger[_0x4181('0xb')](_0x4181('0x12'),_0x5d0bc7,_0x4181('0xc'));_0x4091c0(_0x4ed9f7[_0x4181('0x14')][_0x4181('0x13')]);}})['catch'](function(_0xb4c3da){logger[_0x4181('0x10')]('MailServerIn,\x20%s,\x20%s',_0x5d0bc7,_0xb4c3da);_0x116585(_0xb4c3da);});});}exports[_0x4181('0x15')]=function(_0x38b262){var _0x227049=this;return new Promise(function(_0x18bc20,_0x584f1d){return db[_0x4181('0x16')]['findAll']({'raw':_0x38b262[_0x4181('0x17')]?_0x38b262[_0x4181('0x17')][_0x4181('0x18')]===undefined?!![]:![]:!![],'where':_0x38b262[_0x4181('0x17')]?_0x38b262['options'][_0x4181('0x19')]||null:null,'attributes':_0x38b262[_0x4181('0x17')]?_0x38b262[_0x4181('0x17')][_0x4181('0x1a')]||null:null,'limit':_0x38b262['options']?_0x38b262[_0x4181('0x17')]['limit']||null:null,'include':_0x38b262[_0x4181('0x17')]?_0x38b262['options'][_0x4181('0x1b')]?_['map'](_0x38b262[_0x4181('0x17')][_0x4181('0x1b')],function(_0x3be257){return{'model':db[_0x3be257[_0x4181('0x1c')]],'as':_0x3be257['as'],'attributes':_0x3be257[_0x4181('0x1a')],'include':_0x3be257['include']?_['map'](_0x3be257['include'],function(_0x2b4784){return{'model':db[_0x2b4784['model']],'as':_0x2b4784['as'],'attributes':_0x2b4784[_0x4181('0x1a')],'include':_0x2b4784['include']?_[_0x4181('0x1d')](_0x2b4784[_0x4181('0x1b')],function(_0x547ecd){return{'model':db[_0x547ecd[_0x4181('0x1c')]],'as':_0x547ecd['as'],'attributes':_0x547ecd[_0x4181('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4181('0xa')](function(_0x28a5d0){logger[_0x4181('0xb')](_0x4181('0x15'),_0x38b262);logger[_0x4181('0xd')](_0x4181('0x15'),_0x38b262,JSON[_0x4181('0xf')](_0x28a5d0));_0x18bc20(_0x28a5d0);})[_0x4181('0x1e')](function(_0x7de0a){logger['error']('GetMailServerIn',_0x7de0a[_0x4181('0x13')],_0x38b262);_0x584f1d(_0x227049[_0x4181('0x10')](0x1f4,_0x7de0a['message']));});});}; \ No newline at end of file +var _0x0bfe=['model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','catch','GetMailServerIn','MailServerIn','options','raw','where','attributes','limit','include','map'];(function(_0x3d9cfa,_0x596edc){var _0x21d89d=function(_0x5668c2){while(--_0x5668c2){_0x3d9cfa['push'](_0x3d9cfa['shift']());}};_0x21d89d(++_0x596edc);}(_0x0bfe,0x1e1));var _0xe0bf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0bfe[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0xe0bf('0x0'));var moment=require(_0xe0bf('0x1'));var BPromise=require(_0xe0bf('0x2'));var rs=require(_0xe0bf('0x3'));var fs=require('fs');var Redis=require(_0xe0bf('0x4'));var db=require(_0xe0bf('0x5'))['db'];var utils=require(_0xe0bf('0x6'));var logger=require('../../config/logger')(_0xe0bf('0x7'));var config=require(_0xe0bf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe0bf('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1013ec,_0x632662,_0x30be45){return new BPromise(function(_0x2115b0,_0x32e041){return client[_0xe0bf('0xa')](_0x1013ec,_0x30be45)[_0xe0bf('0xb')](function(_0x584cdc){logger[_0xe0bf('0xc')]('MailServerIn,\x20%s,\x20%s',_0x632662,_0xe0bf('0xd'));logger[_0xe0bf('0xe')](_0xe0bf('0xf'),_0x632662,_0xe0bf('0xd'),JSON[_0xe0bf('0x10')](_0x584cdc));if(_0x584cdc[_0xe0bf('0x11')]){if(_0x584cdc[_0xe0bf('0x11')][_0xe0bf('0x12')]===0x1f4){logger[_0xe0bf('0x11')](_0xe0bf('0x13'),_0x632662,_0x584cdc['error']['message']);return _0x32e041(_0x584cdc[_0xe0bf('0x11')]['message']);}logger[_0xe0bf('0x11')](_0xe0bf('0x13'),_0x632662,_0x584cdc[_0xe0bf('0x11')][_0xe0bf('0x14')]);return _0x2115b0(_0x584cdc['error']['message']);}else{logger[_0xe0bf('0xc')](_0xe0bf('0x13'),_0x632662,'request\x20sent');_0x2115b0(_0x584cdc['result'][_0xe0bf('0x14')]);}})[_0xe0bf('0x15')](function(_0x392486){logger['error'](_0xe0bf('0x13'),_0x632662,_0x392486);_0x32e041(_0x392486);});});}exports[_0xe0bf('0x16')]=function(_0x17da4e){var _0x18434=this;return new Promise(function(_0x12376a,_0x366115){return db[_0xe0bf('0x17')]['findAll']({'raw':_0x17da4e[_0xe0bf('0x18')]?_0x17da4e[_0xe0bf('0x18')][_0xe0bf('0x19')]===undefined?!![]:![]:!![],'where':_0x17da4e[_0xe0bf('0x18')]?_0x17da4e['options'][_0xe0bf('0x1a')]||null:null,'attributes':_0x17da4e[_0xe0bf('0x18')]?_0x17da4e[_0xe0bf('0x18')][_0xe0bf('0x1b')]||null:null,'limit':_0x17da4e[_0xe0bf('0x18')]?_0x17da4e[_0xe0bf('0x18')][_0xe0bf('0x1c')]||null:null,'include':_0x17da4e[_0xe0bf('0x18')]?_0x17da4e[_0xe0bf('0x18')]['include']?_['map'](_0x17da4e['options']['include'],function(_0x5798dc){return{'model':db[_0x5798dc['model']],'as':_0x5798dc['as'],'attributes':_0x5798dc[_0xe0bf('0x1b')],'include':_0x5798dc[_0xe0bf('0x1d')]?_[_0xe0bf('0x1e')](_0x5798dc['include'],function(_0x312fc0){return{'model':db[_0x312fc0[_0xe0bf('0x1f')]],'as':_0x312fc0['as'],'attributes':_0x312fc0[_0xe0bf('0x1b')],'include':_0x312fc0['include']?_[_0xe0bf('0x1e')](_0x312fc0[_0xe0bf('0x1d')],function(_0x145b6e){return{'model':db[_0x145b6e[_0xe0bf('0x1f')]],'as':_0x145b6e['as'],'attributes':_0x145b6e[_0xe0bf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe0bf('0xb')](function(_0x39a6fe){logger[_0xe0bf('0xc')](_0xe0bf('0x16'),_0x17da4e);logger['debug']('GetMailServerIn',_0x17da4e,JSON['stringify'](_0x39a6fe));_0x12376a(_0x39a6fe);})[_0xe0bf('0x15')](function(_0x29352a){logger[_0xe0bf('0x11')](_0xe0bf('0x16'),_0x29352a[_0xe0bf('0x14')],_0x17da4e);_0x366115(_0x18434[_0xe0bf('0x11')](0x1f4,_0x29352a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 8d1ce8c..095d410 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 _0x15f3=['./mailServerOut.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x15f3,0x1c2));var _0x315f=function(_0x291e8f,_0x56c2cf){_0x291e8f=_0x291e8f-0x0;var _0x26e744=_0x15f3[_0x291e8f];return _0x26e744;};'use strict';var multer=require(_0x315f('0x0'));var util=require(_0x315f('0x1'));var path=require(_0x315f('0x2'));var timeout=require('connect-timeout');var express=require(_0x315f('0x3'));var router=express['Router']();var auth=require(_0x315f('0x4'));var interaction=require(_0x315f('0x5'));var config=require('../../config/environment');var controller=require(_0x315f('0x6'));router[_0x315f('0x7')]('/',auth['isAuthenticated'](),controller[_0x315f('0x8')]);router['get']('/:id',auth[_0x315f('0x9')](),controller[_0x315f('0xa')]);router[_0x315f('0xb')]('/',auth['isAuthenticated'](),controller[_0x315f('0xc')]);router[_0x315f('0xd')](_0x315f('0xe'),auth[_0x315f('0x9')](),controller[_0x315f('0xf')]);router[_0x315f('0x10')](_0x315f('0xe'),auth['isAuthenticated'](),controller[_0x315f('0x11')]);module[_0x315f('0x12')]=router; \ No newline at end of file +var _0x4a8a=['get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./mailServerOut.controller'];(function(_0x5120fa,_0x162040){var _0x2c3432=function(_0x271ce2){while(--_0x271ce2){_0x5120fa['push'](_0x5120fa['shift']());}};_0x2c3432(++_0x162040);}(_0x4a8a,0x102));var _0xa4a8=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0x4a8a[_0x118139];return _0x2fece9;};'use strict';var multer=require(_0xa4a8('0x0'));var util=require(_0xa4a8('0x1'));var path=require(_0xa4a8('0x2'));var timeout=require('connect-timeout');var express=require(_0xa4a8('0x3'));var router=express[_0xa4a8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa4a8('0x5'));var config=require(_0xa4a8('0x6'));var controller=require(_0xa4a8('0x7'));router[_0xa4a8('0x8')]('/',auth[_0xa4a8('0x9')](),controller[_0xa4a8('0xa')]);router[_0xa4a8('0x8')](_0xa4a8('0xb'),auth['isAuthenticated'](),controller[_0xa4a8('0xc')]);router[_0xa4a8('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa4a8('0xe')](_0xa4a8('0xb'),auth[_0xa4a8('0x9')](),controller[_0xa4a8('0xf')]);router[_0xa4a8('0x10')](_0xa4a8('0xb'),auth[_0xa4a8('0x9')](),controller[_0xa4a8('0x11')]);module[_0xa4a8('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index f7d2430..2a56652 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 _0x7c09=['INTEGER','BOOLEAN','exports','STRING'];(function(_0x392ff3,_0x3830b0){var _0xaa6057=function(_0x4abfa3){while(--_0x4abfa3){_0x392ff3['push'](_0x392ff3['shift']());}};_0xaa6057(++_0x3830b0);}(_0x7c09,0x102));var _0x97c0=function(_0x36aedc,_0x34b7ca){_0x36aedc=_0x36aedc-0x0;var _0x294f89=_0x7c09[_0x36aedc];return _0x294f89;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'description':{'type':Sequelize[_0x97c0('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x97c0('0x1')]},'pass':{'type':Sequelize[_0x97c0('0x1')]},'port':{'type':Sequelize[_0x97c0('0x2')]},'secure':{'type':Sequelize[_0x97c0('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x97c0('0x1')]},'authentication':{'type':Sequelize[_0x97c0('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4c60=['STRING','sequelize','exports'];(function(_0x5235dd,_0x3f91cf){var _0x13059d=function(_0x355a98){while(--_0x355a98){_0x5235dd['push'](_0x5235dd['shift']());}};_0x13059d(++_0x3f91cf);}(_0x4c60,0xc1));var _0x04c6=function(_0x2378da,_0x48c6ae){_0x2378da=_0x2378da-0x0;var _0xd10b68=_0x4c60[_0x2378da];return _0xd10b68;};'use strict';var Sequelize=require(_0x04c6('0x0'));module[_0x04c6('0x1')]={'description':{'type':Sequelize[_0x04c6('0x2')]},'host':{'type':Sequelize[_0x04c6('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x04c6('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index d24354c..106bb92 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 _0xbf51=['order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','length','include','find','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty'];(function(_0x356127,_0x4873ac){var _0x5d4c75=function(_0x4fe60c){while(--_0x4fe60c){_0x356127['push'](_0x356127['shift']());}};_0x5d4c75(++_0x4873ac);}(_0xbf51,0x1ef));var _0x1bf5=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xbf51[_0x35da42];return _0x370035;};'use strict';var pdf=require(_0x1bf5('0x0'));var emlformat=require(_0x1bf5('0x1'));var rimraf=require(_0x1bf5('0x2'));var zipdir=require(_0x1bf5('0x3'));var jsonpatch=require(_0x1bf5('0x4'));var rp=require(_0x1bf5('0x5'));var moment=require(_0x1bf5('0x6'));var BPromise=require(_0x1bf5('0x7'));var Mustache=require(_0x1bf5('0x8'));var util=require(_0x1bf5('0x9'));var path=require(_0x1bf5('0xa'));var sox=require('sox');var csv=require(_0x1bf5('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1bf5('0xc'));var squel=require(_0x1bf5('0xd'));var crypto=require(_0x1bf5('0xe'));var jsforce=require(_0x1bf5('0xf'));var deskjs=require(_0x1bf5('0x10'));var toCsv=require(_0x1bf5('0xb'));var querystring=require(_0x1bf5('0x11'));var Papa=require(_0x1bf5('0x12'));var Redis=require(_0x1bf5('0x13'));var authService=require(_0x1bf5('0x14'));var qs=require(_0x1bf5('0x15'));var as=require(_0x1bf5('0x16'));var hardwareService=require(_0x1bf5('0x17'));var logger=require(_0x1bf5('0x18'))(_0x1bf5('0x19'));var utils=require(_0x1bf5('0x1a'));var config=require(_0x1bf5('0x1b'));var db=require(_0x1bf5('0x1c'))['db'];function respondWithStatusCode(_0x5646ec,_0x4f85b2){_0x4f85b2=_0x4f85b2||0xcc;return function(_0x3da3ef){if(_0x3da3ef){return _0x5646ec[_0x1bf5('0x1d')](_0x4f85b2);}return _0x5646ec[_0x1bf5('0x1e')](_0x4f85b2)['end']();};}function respondWithResult(_0x1411f2,_0x5be531){_0x5be531=_0x5be531||0xc8;return function(_0x19eeb1){if(_0x19eeb1){return _0x1411f2[_0x1bf5('0x1e')](_0x5be531)[_0x1bf5('0x1f')](_0x19eeb1);}};}function respondWithFilteredResult(_0x5173f4,_0x16a313){return function(_0x56de64){if(_0x56de64){var _0x3760fa=_0x56de64['count'],_0x31e5ed=_0x16a313[_0x1bf5('0x20')],_0x2b952e=_0x16a313[_0x1bf5('0x20')]+_0x16a313[_0x1bf5('0x21')],_0x2030d8;if(_0x2b952e>=_0x3760fa){_0x2b952e=_0x3760fa;_0x2030d8=0xc8;}else{_0x2030d8=0xce;}_0x5173f4[_0x1bf5('0x1e')](_0x2030d8);return _0x5173f4[_0x1bf5('0x22')](_0x1bf5('0x23'),_0x31e5ed+'-'+_0x2b952e+'/'+_0x3760fa)['json'](_0x56de64);}return null;};}function patchUpdates(_0x53f5df){return function(_0x1c440e){try{jsonpatch[_0x1bf5('0x24')](_0x1c440e,_0x53f5df,!![]);}catch(_0x323193){return BPromise[_0x1bf5('0x25')](_0x323193);}return _0x1c440e[_0x1bf5('0x26')]();};}function saveUpdates(_0x43773b,_0x10d2e2){return function(_0x538b2e){if(_0x538b2e){return _0x538b2e[_0x1bf5('0x27')](_0x43773b)[_0x1bf5('0x28')](function(_0x2e5e59){return _0x2e5e59;});}return null;};}function removeEntity(_0x4327d2,_0x20cf1a){return function(_0x2fe1ea){if(_0x2fe1ea){return _0x2fe1ea['destroy']()[_0x1bf5('0x28')](function(){_0x4327d2[_0x1bf5('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cc66d,_0x31166c){return function(_0x25df27){if(!_0x25df27){_0x1cc66d[_0x1bf5('0x1d')](0x194);}return _0x25df27;};}function handleError(_0x3d9a14,_0x54d5b4){_0x54d5b4=_0x54d5b4||0x1f4;return function(_0x1a21b1){logger[_0x1bf5('0x29')](_0x1a21b1[_0x1bf5('0x2a')]);if(_0x1a21b1[_0x1bf5('0x2b')]){delete _0x1a21b1[_0x1bf5('0x2b')];}_0x3d9a14[_0x1bf5('0x1e')](_0x54d5b4)['send'](_0x1a21b1);};}exports[_0x1bf5('0x2c')]=function(_0x18b12f,_0x32c847){var _0xd58753={},_0x3866a6={},_0x402420={'count':0x0,'rows':[]};var _0x36da7c=_[_0x1bf5('0x2d')](db[_0x1bf5('0x2e')][_0x1bf5('0x2f')],function(_0x5afacd){return{'name':_0x5afacd[_0x1bf5('0x30')],'type':_0x5afacd[_0x1bf5('0x31')][_0x1bf5('0x32')]};});_0x3866a6[_0x1bf5('0x33')]=_[_0x1bf5('0x2d')](_0x36da7c,_0x1bf5('0x2b'));_0x3866a6[_0x1bf5('0x34')]=_[_0x1bf5('0x35')](_0x18b12f['query']);_0x3866a6['filters']=_['intersection'](_0x3866a6['model'],_0x3866a6['query']);_0xd58753['attributes']=_[_0x1bf5('0x36')](_0x3866a6[_0x1bf5('0x33')],qs[_0x1bf5('0x37')](_0x18b12f[_0x1bf5('0x34')][_0x1bf5('0x37')]));_0xd58753[_0x1bf5('0x38')]=_0xd58753['attributes']['length']?_0xd58753['attributes']:_0x3866a6[_0x1bf5('0x33')];if(!_0x18b12f[_0x1bf5('0x34')][_0x1bf5('0x39')]('nolimit')){_0xd58753[_0x1bf5('0x21')]=qs['limit'](_0x18b12f[_0x1bf5('0x34')][_0x1bf5('0x21')]);_0xd58753['offset']=qs['offset'](_0x18b12f['query']['offset']);}_0xd58753[_0x1bf5('0x3a')]=qs[_0x1bf5('0x3b')](_0x18b12f[_0x1bf5('0x34')][_0x1bf5('0x3b')]);_0xd58753[_0x1bf5('0x3c')]=qs[_0x1bf5('0x3d')](_[_0x1bf5('0x3e')](_0x18b12f[_0x1bf5('0x34')],_0x3866a6[_0x1bf5('0x3d')]),_0x36da7c);if(_0x18b12f[_0x1bf5('0x34')][_0x1bf5('0x3f')]){_0xd58753[_0x1bf5('0x3c')]=_[_0x1bf5('0x40')](_0xd58753[_0x1bf5('0x3c')],{'$or':_[_0x1bf5('0x2d')](_0x36da7c,function(_0x938f89){if(_0x938f89[_0x1bf5('0x31')]!==_0x1bf5('0x41')){var _0x494db0={};_0x494db0[_0x938f89['name']]={'$like':'%'+_0x18b12f['query'][_0x1bf5('0x3f')]+'%'};return _0x494db0;}})});}_0xd58753=_[_0x1bf5('0x40')]({},_0xd58753,_0x18b12f[_0x1bf5('0x42')]);var _0x18f8ca={'where':_0xd58753[_0x1bf5('0x3c')]};return db[_0x1bf5('0x2e')]['count'](_0x18f8ca)[_0x1bf5('0x28')](function(_0x15d194){_0x402420[_0x1bf5('0x43')]=_0x15d194;if(_0x18b12f[_0x1bf5('0x34')][_0x1bf5('0x44')]){_0xd58753['include']=[{'all':!![]}];}return db[_0x1bf5('0x2e')][_0x1bf5('0x45')](_0xd58753);})[_0x1bf5('0x28')](function(_0x5934a4){_0x402420[_0x1bf5('0x46')]=_0x5934a4;return _0x402420;})['then'](respondWithFilteredResult(_0x32c847,_0xd58753))[_0x1bf5('0x47')](handleError(_0x32c847,null));};exports[_0x1bf5('0x48')]=function(_0x31ed4e,_0x40c403){var _0x46f458={'raw':!![],'where':{'id':_0x31ed4e[_0x1bf5('0x49')]['id']}},_0x20e3ee={};_0x20e3ee[_0x1bf5('0x33')]=_[_0x1bf5('0x35')](db['MailServerOut'][_0x1bf5('0x2f')]);_0x20e3ee[_0x1bf5('0x34')]=_[_0x1bf5('0x35')](_0x31ed4e[_0x1bf5('0x34')]);_0x20e3ee[_0x1bf5('0x3d')]=_[_0x1bf5('0x36')](_0x20e3ee[_0x1bf5('0x33')],_0x20e3ee[_0x1bf5('0x34')]);_0x46f458[_0x1bf5('0x38')]=_[_0x1bf5('0x36')](_0x20e3ee[_0x1bf5('0x33')],qs[_0x1bf5('0x37')](_0x31ed4e[_0x1bf5('0x34')][_0x1bf5('0x37')]));_0x46f458[_0x1bf5('0x38')]=_0x46f458[_0x1bf5('0x38')][_0x1bf5('0x4a')]?_0x46f458[_0x1bf5('0x38')]:_0x20e3ee[_0x1bf5('0x33')];if(_0x31ed4e[_0x1bf5('0x34')][_0x1bf5('0x44')]){_0x46f458[_0x1bf5('0x4b')]=[{'all':!![]}];}_0x46f458=_[_0x1bf5('0x40')]({},_0x46f458,_0x31ed4e[_0x1bf5('0x42')]);return db[_0x1bf5('0x2e')][_0x1bf5('0x4c')](_0x46f458)[_0x1bf5('0x28')](handleEntityNotFound(_0x40c403,null))[_0x1bf5('0x28')](respondWithResult(_0x40c403,null))[_0x1bf5('0x47')](handleError(_0x40c403,null));};exports['create']=function(_0x1c8176,_0x102275){return db['MailServerOut']['create'](_0x1c8176[_0x1bf5('0x4d')],{})[_0x1bf5('0x28')](respondWithResult(_0x102275,0xc9))[_0x1bf5('0x47')](handleError(_0x102275,null));};exports['update']=function(_0x9f7419,_0x1ce2a3){if(_0x9f7419[_0x1bf5('0x4d')]['id']){delete _0x9f7419[_0x1bf5('0x4d')]['id'];}return db[_0x1bf5('0x2e')][_0x1bf5('0x4c')]({'where':{'id':_0x9f7419['params']['id']}})['then'](handleEntityNotFound(_0x1ce2a3,null))[_0x1bf5('0x28')](saveUpdates(_0x9f7419[_0x1bf5('0x4d')],null))[_0x1bf5('0x28')](respondWithResult(_0x1ce2a3,null))[_0x1bf5('0x47')](handleError(_0x1ce2a3,null));};exports[_0x1bf5('0x4e')]=function(_0x2d6777,_0x3dea64){return db[_0x1bf5('0x2e')][_0x1bf5('0x4c')]({'where':{'id':_0x2d6777[_0x1bf5('0x49')]['id']}})[_0x1bf5('0x28')](handleEntityNotFound(_0x3dea64,null))['then'](removeEntity(_0x3dea64,null))[_0x1bf5('0x47')](handleError(_0x3dea64,null));}; \ No newline at end of file +var _0xf5d4=['end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailServerOut','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','options','create','body','find','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status'];(function(_0x328fc2,_0x137708){var _0x5ed36b=function(_0x5bdf04){while(--_0x5bdf04){_0x328fc2['push'](_0x328fc2['shift']());}};_0x5ed36b(++_0x137708);}(_0xf5d4,0x19f));var _0x4f5d=function(_0x96a6d8,_0x102b97){_0x96a6d8=_0x96a6d8-0x0;var _0x115059=_0xf5d4[_0x96a6d8];return _0x115059;};'use strict';var pdf=require(_0x4f5d('0x0'));var emlformat=require(_0x4f5d('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f5d('0x2'));var moment=require(_0x4f5d('0x3'));var BPromise=require(_0x4f5d('0x4'));var Mustache=require(_0x4f5d('0x5'));var util=require(_0x4f5d('0x6'));var path=require('path');var sox=require(_0x4f5d('0x7'));var csv=require('to-csv');var ejs=require(_0x4f5d('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4f5d('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4f5d('0xa'));var toCsv=require(_0x4f5d('0xb'));var querystring=require(_0x4f5d('0xc'));var Papa=require(_0x4f5d('0xd'));var Redis=require(_0x4f5d('0xe'));var authService=require(_0x4f5d('0xf'));var qs=require(_0x4f5d('0x10'));var as=require(_0x4f5d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4f5d('0x12'));var utils=require(_0x4f5d('0x13'));var config=require('../../config/environment');var db=require(_0x4f5d('0x14'))['db'];function respondWithStatusCode(_0x3e6bf5,_0x2ba2f8){_0x2ba2f8=_0x2ba2f8||0xcc;return function(_0x4413b7){if(_0x4413b7){return _0x3e6bf5[_0x4f5d('0x15')](_0x2ba2f8);}return _0x3e6bf5[_0x4f5d('0x16')](_0x2ba2f8)[_0x4f5d('0x17')]();};}function respondWithResult(_0x3e489a,_0x545926){_0x545926=_0x545926||0xc8;return function(_0xac1dda){if(_0xac1dda){return _0x3e489a[_0x4f5d('0x16')](_0x545926)['json'](_0xac1dda);}};}function respondWithFilteredResult(_0x4d8ac4,_0x1d8040){return function(_0x409390){if(_0x409390){var _0x59f140=_0x409390[_0x4f5d('0x18')],_0x46afd9=_0x1d8040[_0x4f5d('0x19')],_0x107ace=_0x1d8040['offset']+_0x1d8040['limit'],_0x45af27;if(_0x107ace>=_0x59f140){_0x107ace=_0x59f140;_0x45af27=0xc8;}else{_0x45af27=0xce;}_0x4d8ac4[_0x4f5d('0x16')](_0x45af27);return _0x4d8ac4[_0x4f5d('0x1a')](_0x4f5d('0x1b'),_0x46afd9+'-'+_0x107ace+'/'+_0x59f140)[_0x4f5d('0x1c')](_0x409390);}return null;};}function patchUpdates(_0x3c28bd){return function(_0xa1177c){try{jsonpatch[_0x4f5d('0x1d')](_0xa1177c,_0x3c28bd,!![]);}catch(_0x282be5){return BPromise[_0x4f5d('0x1e')](_0x282be5);}return _0xa1177c[_0x4f5d('0x1f')]();};}function saveUpdates(_0x183f02,_0x464193){return function(_0x34a281){if(_0x34a281){return _0x34a281[_0x4f5d('0x20')](_0x183f02)[_0x4f5d('0x21')](function(_0x5f0fd5){return _0x5f0fd5;});}return null;};}function removeEntity(_0x55d0e3,_0x467d76){return function(_0x47eaf8){if(_0x47eaf8){return _0x47eaf8[_0x4f5d('0x22')]()[_0x4f5d('0x21')](function(){_0x55d0e3['status'](0xcc)[_0x4f5d('0x17')]();});}};}function handleEntityNotFound(_0x1d2871,_0x493091){return function(_0x48971d){if(!_0x48971d){_0x1d2871[_0x4f5d('0x15')](0x194);}return _0x48971d;};}function handleError(_0x32e2e3,_0x25149d){_0x25149d=_0x25149d||0x1f4;return function(_0x293814){logger[_0x4f5d('0x23')](_0x293814[_0x4f5d('0x24')]);if(_0x293814[_0x4f5d('0x25')]){delete _0x293814[_0x4f5d('0x25')];}_0x32e2e3[_0x4f5d('0x16')](_0x25149d)[_0x4f5d('0x26')](_0x293814);};}exports[_0x4f5d('0x27')]=function(_0x4b0e32,_0x287588){var _0x17e315={},_0x768c0={},_0x3a56e6={'count':0x0,'rows':[]};var _0xb474b2=_[_0x4f5d('0x28')](db[_0x4f5d('0x29')]['rawAttributes'],function(_0x560c6f){return{'name':_0x560c6f[_0x4f5d('0x2a')],'type':_0x560c6f[_0x4f5d('0x2b')][_0x4f5d('0x2c')]};});_0x768c0[_0x4f5d('0x2d')]=_[_0x4f5d('0x28')](_0xb474b2,_0x4f5d('0x25'));_0x768c0['query']=_['keys'](_0x4b0e32[_0x4f5d('0x2e')]);_0x768c0[_0x4f5d('0x2f')]=_[_0x4f5d('0x30')](_0x768c0['model'],_0x768c0[_0x4f5d('0x2e')]);_0x17e315[_0x4f5d('0x31')]=_[_0x4f5d('0x30')](_0x768c0[_0x4f5d('0x2d')],qs['fields'](_0x4b0e32[_0x4f5d('0x2e')][_0x4f5d('0x32')]));_0x17e315[_0x4f5d('0x31')]=_0x17e315['attributes']['length']?_0x17e315[_0x4f5d('0x31')]:_0x768c0['model'];if(!_0x4b0e32[_0x4f5d('0x2e')][_0x4f5d('0x33')](_0x4f5d('0x34'))){_0x17e315[_0x4f5d('0x35')]=qs['limit'](_0x4b0e32['query'][_0x4f5d('0x35')]);_0x17e315[_0x4f5d('0x19')]=qs[_0x4f5d('0x19')](_0x4b0e32['query']['offset']);}_0x17e315['order']=qs['sort'](_0x4b0e32[_0x4f5d('0x2e')][_0x4f5d('0x36')]);_0x17e315['where']=qs[_0x4f5d('0x2f')](_[_0x4f5d('0x37')](_0x4b0e32[_0x4f5d('0x2e')],_0x768c0[_0x4f5d('0x2f')]),_0xb474b2);if(_0x4b0e32['query'][_0x4f5d('0x38')]){_0x17e315['where']=_[_0x4f5d('0x39')](_0x17e315[_0x4f5d('0x3a')],{'$or':_[_0x4f5d('0x28')](_0xb474b2,function(_0x250575){if(_0x250575[_0x4f5d('0x2b')]!==_0x4f5d('0x3b')){var _0x453060={};_0x453060[_0x250575[_0x4f5d('0x25')]]={'$like':'%'+_0x4b0e32[_0x4f5d('0x2e')][_0x4f5d('0x38')]+'%'};return _0x453060;}})});}_0x17e315=_['merge']({},_0x17e315,_0x4b0e32['options']);var _0x214b65={'where':_0x17e315[_0x4f5d('0x3a')]};return db[_0x4f5d('0x29')][_0x4f5d('0x18')](_0x214b65)['then'](function(_0x3b262b){_0x3a56e6['count']=_0x3b262b;if(_0x4b0e32[_0x4f5d('0x2e')][_0x4f5d('0x3c')]){_0x17e315[_0x4f5d('0x3d')]=[{'all':!![]}];}return db['MailServerOut'][_0x4f5d('0x3e')](_0x17e315);})[_0x4f5d('0x21')](function(_0x49be48){_0x3a56e6[_0x4f5d('0x3f')]=_0x49be48;return _0x3a56e6;})[_0x4f5d('0x21')](respondWithFilteredResult(_0x287588,_0x17e315))[_0x4f5d('0x40')](handleError(_0x287588,null));};exports['show']=function(_0x1adfb5,_0x53a833){var _0x310731={'raw':!![],'where':{'id':_0x1adfb5[_0x4f5d('0x41')]['id']}},_0x29da43={};_0x29da43[_0x4f5d('0x2d')]=_[_0x4f5d('0x42')](db[_0x4f5d('0x29')][_0x4f5d('0x43')]);_0x29da43[_0x4f5d('0x2e')]=_[_0x4f5d('0x42')](_0x1adfb5[_0x4f5d('0x2e')]);_0x29da43['filters']=_[_0x4f5d('0x30')](_0x29da43[_0x4f5d('0x2d')],_0x29da43[_0x4f5d('0x2e')]);_0x310731['attributes']=_[_0x4f5d('0x30')](_0x29da43[_0x4f5d('0x2d')],qs[_0x4f5d('0x32')](_0x1adfb5[_0x4f5d('0x2e')][_0x4f5d('0x32')]));_0x310731[_0x4f5d('0x31')]=_0x310731['attributes'][_0x4f5d('0x44')]?_0x310731[_0x4f5d('0x31')]:_0x29da43[_0x4f5d('0x2d')];if(_0x1adfb5[_0x4f5d('0x2e')]['includeAll']){_0x310731[_0x4f5d('0x3d')]=[{'all':!![]}];}_0x310731=_[_0x4f5d('0x39')]({},_0x310731,_0x1adfb5[_0x4f5d('0x45')]);return db['MailServerOut']['find'](_0x310731)[_0x4f5d('0x21')](handleEntityNotFound(_0x53a833,null))['then'](respondWithResult(_0x53a833,null))[_0x4f5d('0x40')](handleError(_0x53a833,null));};exports[_0x4f5d('0x46')]=function(_0x4df295,_0x199bc1){return db[_0x4f5d('0x29')]['create'](_0x4df295[_0x4f5d('0x47')],{})[_0x4f5d('0x21')](respondWithResult(_0x199bc1,0xc9))[_0x4f5d('0x40')](handleError(_0x199bc1,null));};exports[_0x4f5d('0x20')]=function(_0xb94920,_0x2efeb1){if(_0xb94920[_0x4f5d('0x47')]['id']){delete _0xb94920['body']['id'];}return db[_0x4f5d('0x29')][_0x4f5d('0x48')]({'where':{'id':_0xb94920['params']['id']}})[_0x4f5d('0x21')](handleEntityNotFound(_0x2efeb1,null))[_0x4f5d('0x21')](saveUpdates(_0xb94920[_0x4f5d('0x47')],null))['then'](respondWithResult(_0x2efeb1,null))[_0x4f5d('0x40')](handleError(_0x2efeb1,null));};exports[_0x4f5d('0x22')]=function(_0x2fcc9b,_0x2f7d39){return db['MailServerOut'][_0x4f5d('0x48')]({'where':{'id':_0x2fcc9b[_0x4f5d('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f7d39,null))[_0x4f5d('0x21')](removeEntity(_0x2f7d39,null))[_0x4f5d('0x40')](handleError(_0x2f7d39,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 00964c4..de9f664 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 _0x5d82=['mail_servers_out','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut'];(function(_0xf7111d,_0x4b8d3c){var _0x122698=function(_0x48d48b){while(--_0x48d48b){_0xf7111d['push'](_0xf7111d['shift']());}};_0x122698(++_0x4b8d3c);}(_0x5d82,0x194));var _0x25d8=function(_0x3cccbb,_0x4ecab8){_0x3cccbb=_0x3cccbb-0x0;var _0x37cd4e=_0x5d82[_0x3cccbb];return _0x37cd4e;};'use strict';var _=require(_0x25d8('0x0'));var util=require(_0x25d8('0x1'));var logger=require(_0x25d8('0x2'))(_0x25d8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25d8('0x4'));var fs=require('fs');var path=require(_0x25d8('0x5'));var rimraf=require(_0x25d8('0x6'));var config=require(_0x25d8('0x7'));var attributes=require(_0x25d8('0x8'));module[_0x25d8('0x9')]=function(_0x42fde7,_0x5b460f){return _0x42fde7[_0x25d8('0xa')](_0x25d8('0xb'),attributes,{'tableName':_0x25d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x73e2=['../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x101f0b,_0x968687){var _0x346d11=function(_0x3e2b66){while(--_0x3e2b66){_0x101f0b['push'](_0x101f0b['shift']());}};_0x346d11(++_0x968687);}(_0x73e2,0x14f));var _0x273e=function(_0x9bcde2,_0x34d4b4){_0x9bcde2=_0x9bcde2-0x0;var _0x1af924=_0x73e2[_0x9bcde2];return _0x1af924;};'use strict';var _=require('lodash');var util=require(_0x273e('0x0'));var logger=require(_0x273e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x273e('0x2'));var rp=require(_0x273e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x273e('0x4'));var config=require(_0x273e('0x5'));var attributes=require(_0x273e('0x6'));module[_0x273e('0x7')]=function(_0x3b9db8,_0x313636){return _0x3b9db8[_0x273e('0x8')](_0x273e('0x9'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index e7fe3a8..33cc918 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 _0x42ce=['bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','then','info','request\x20sent','debug','stringify','error','code','message','MailServerOut,\x20%s,\x20%s','result','catch','moment'];(function(_0x1e592f,_0x2da2bf){var _0x367992=function(_0x1a2921){while(--_0x1a2921){_0x1e592f['push'](_0x1e592f['shift']());}};_0x367992(++_0x2da2bf);}(_0x42ce,0x142));var _0xe42c=function(_0x23ec3d,_0x5dad91){_0x23ec3d=_0x23ec3d-0x0;var _0x5767f4=_0x42ce[_0x23ec3d];return _0x5767f4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe42c('0x0'));var BPromise=require(_0xe42c('0x1'));var rs=require(_0xe42c('0x2'));var fs=require('fs');var Redis=require(_0xe42c('0x3'));var db=require(_0xe42c('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe42c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe42c('0x6')][_0xe42c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4292c8,_0x4b884c,_0x1ce27a){return new BPromise(function(_0x4b4aab,_0x2382fd){return client['request'](_0x4292c8,_0x1ce27a)[_0xe42c('0x8')](function(_0xb6b3cc){logger[_0xe42c('0x9')]('MailServerOut,\x20%s,\x20%s',_0x4b884c,_0xe42c('0xa'));logger[_0xe42c('0xb')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x4b884c,_0xe42c('0xa'),JSON[_0xe42c('0xc')](_0xb6b3cc));if(_0xb6b3cc[_0xe42c('0xd')]){if(_0xb6b3cc[_0xe42c('0xd')][_0xe42c('0xe')]===0x1f4){logger[_0xe42c('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4b884c,_0xb6b3cc['error'][_0xe42c('0xf')]);return _0x2382fd(_0xb6b3cc[_0xe42c('0xd')][_0xe42c('0xf')]);}logger[_0xe42c('0xd')](_0xe42c('0x10'),_0x4b884c,_0xb6b3cc[_0xe42c('0xd')][_0xe42c('0xf')]);return _0x4b4aab(_0xb6b3cc[_0xe42c('0xd')][_0xe42c('0xf')]);}else{logger[_0xe42c('0x9')](_0xe42c('0x10'),_0x4b884c,_0xe42c('0xa'));_0x4b4aab(_0xb6b3cc[_0xe42c('0x11')]['message']);}})[_0xe42c('0x12')](function(_0x427147){logger['error'](_0xe42c('0x10'),_0x4b884c,_0x427147);_0x2382fd(_0x427147);});});} \ No newline at end of file +var _0x514a=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x31c3,_0x319393){var _0x3dd35d=function(_0x5b9807){while(--_0x5b9807){_0x31c3['push'](_0x31c3['shift']());}};_0x3dd35d(++_0x319393);}(_0x514a,0x141));var _0xa514=function(_0x3f4b5c,_0x6f4e03){_0x3f4b5c=_0x3f4b5c-0x0;var _0x15940f=_0x514a[_0x3f4b5c];return _0x15940f;};'use strict';var _=require(_0xa514('0x0'));var util=require(_0xa514('0x1'));var moment=require(_0xa514('0x2'));var BPromise=require(_0xa514('0x3'));var rs=require(_0xa514('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa514('0x5'))['db'];var utils=require(_0xa514('0x6'));var logger=require(_0xa514('0x7'))(_0xa514('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa514('0x9')][_0xa514('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x223147,_0x4346ba,_0x1fe5b1){return new BPromise(function(_0x410ef2,_0x484180){return client['request'](_0x223147,_0x1fe5b1)[_0xa514('0xb')](function(_0x2c0b65){logger[_0xa514('0xc')](_0xa514('0xd'),_0x4346ba,_0xa514('0xe'));logger['debug']('MailServerOut,\x20%s,\x20%s,\x20%s',_0x4346ba,'request\x20sent',JSON['stringify'](_0x2c0b65));if(_0x2c0b65[_0xa514('0xf')]){if(_0x2c0b65[_0xa514('0xf')][_0xa514('0x10')]===0x1f4){logger[_0xa514('0xf')](_0xa514('0xd'),_0x4346ba,_0x2c0b65['error'][_0xa514('0x11')]);return _0x484180(_0x2c0b65['error'][_0xa514('0x11')]);}logger[_0xa514('0xf')](_0xa514('0xd'),_0x4346ba,_0x2c0b65[_0xa514('0xf')]['message']);return _0x410ef2(_0x2c0b65[_0xa514('0xf')][_0xa514('0x11')]);}else{logger[_0xa514('0xc')](_0xa514('0xd'),_0x4346ba,_0xa514('0xe'));_0x410ef2(_0x2c0b65[_0xa514('0x12')][_0xa514('0x11')]);}})[_0xa514('0x13')](function(_0x1bd012){logger['error'](_0xa514('0xd'),_0x4346ba,_0x1bd012);_0x484180(_0x1bd012);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index d4d902f..9ccea59 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 _0x22ea=['isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller'];(function(_0x16298c,_0x46fd9a){var _0x596174=function(_0xfdacaf){while(--_0xfdacaf){_0x16298c['push'](_0x16298c['shift']());}};_0x596174(++_0x46fd9a);}(_0x22ea,0x14c));var _0xa22e=function(_0x1142ec,_0x370b18){_0x1142ec=_0x1142ec-0x0;var _0xc3fabd=_0x22ea[_0x1142ec];return _0xc3fabd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa22e('0x0'));var timeout=require(_0xa22e('0x1'));var express=require(_0xa22e('0x2'));var router=express[_0xa22e('0x3')]();var auth=require(_0xa22e('0x4'));var interaction=require(_0xa22e('0x5'));var config=require(_0xa22e('0x6'));var controller=require(_0xa22e('0x7'));router['get']('/',auth[_0xa22e('0x8')](),controller['index']);router[_0xa22e('0x9')](_0xa22e('0xa'),auth[_0xa22e('0x8')](),controller[_0xa22e('0xb')]);router[_0xa22e('0x9')](_0xa22e('0xc'),auth['isAuthenticated'](),controller[_0xa22e('0xd')]);router[_0xa22e('0xe')]('/',auth['isAuthenticated'](),controller[_0xa22e('0xf')]);router[_0xa22e('0x10')](_0xa22e('0xc'),auth['isAuthenticated'](),controller[_0xa22e('0x11')]);router['delete'](_0xa22e('0xc'),auth[_0xa22e('0x8')](),controller[_0xa22e('0x12')]);module[_0xa22e('0x13')]=router; \ No newline at end of file +var _0xb2d6=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','/describe','describe','get','post','create','put','/:id','update','delete'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0xb2d6,0x166));var _0x6b2d=function(_0x27ed06,_0x390241){_0x27ed06=_0x27ed06-0x0;var _0x49079a=_0xb2d6[_0x27ed06];return _0x49079a;};'use strict';var multer=require(_0x6b2d('0x0'));var util=require(_0x6b2d('0x1'));var path=require(_0x6b2d('0x2'));var timeout=require(_0x6b2d('0x3'));var express=require(_0x6b2d('0x4'));var router=express[_0x6b2d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x6b2d('0x6'));var config=require(_0x6b2d('0x7'));var controller=require(_0x6b2d('0x8'));router['get']('/',auth[_0x6b2d('0x9')](),controller[_0x6b2d('0xa')]);router['get'](_0x6b2d('0xb'),auth[_0x6b2d('0x9')](),controller[_0x6b2d('0xc')]);router[_0x6b2d('0xd')]('/:id',auth[_0x6b2d('0x9')](),controller['show']);router[_0x6b2d('0xe')]('/',auth[_0x6b2d('0x9')](),controller[_0x6b2d('0xf')]);router[_0x6b2d('0x10')](_0x6b2d('0x11'),auth[_0x6b2d('0x9')](),controller[_0x6b2d('0x12')]);router[_0x6b2d('0x13')](_0x6b2d('0x11'),auth[_0x6b2d('0x9')](),controller['destroy']);module[_0x6b2d('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index feaf164..047252a 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 _0x61f1=['STRING','exports','name'];(function(_0x334ae8,_0x67f305){var _0x58a361=function(_0x26738c){while(--_0x26738c){_0x334ae8['push'](_0x334ae8['shift']());}};_0x58a361(++_0x67f305);}(_0x61f1,0x18a));var _0x161f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x61f1[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0x161f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x161f('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x161f('0x2')]}}; \ No newline at end of file +var _0x2da6=['name','sequelize','exports','STRING'];(function(_0x30767a,_0x7a6d24){var _0xa21732=function(_0x6c0542){while(--_0x6c0542){_0x30767a['push'](_0x30767a['shift']());}};_0xa21732(++_0x7a6d24);}(_0x2da6,0x1dd));var _0x62da=function(_0x53d1a8,_0xc3d454){_0x53d1a8=_0x53d1a8-0x0;var _0x32f257=_0x2da6[_0x53d1a8];return _0x32f257;};'use strict';var Sequelize=require(_0x62da('0x0'));module[_0x62da('0x1')]={'name':{'type':Sequelize[_0x62da('0x2')],'unique':_0x62da('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x62da('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 606f15a..a1c0841 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 _0x6110=['moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','options','MailSubstatus','include','findAll','catch','params','includeAll','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x6110,0x1a5));var _0x0611=function(_0x1b166c,_0x33e749){_0x1b166c=_0x1b166c-0x0;var _0x33b8d6=_0x6110[_0x1b166c];return _0x33b8d6;};'use strict';var pdf=require(_0x0611('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0611('0x1'));var zipdir=require(_0x0611('0x2'));var jsonpatch=require(_0x0611('0x3'));var rp=require(_0x0611('0x4'));var moment=require(_0x0611('0x5'));var BPromise=require(_0x0611('0x6'));var Mustache=require('mustache');var util=require(_0x0611('0x7'));var path=require(_0x0611('0x8'));var sox=require(_0x0611('0x9'));var csv=require(_0x0611('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0611('0xb'));var squel=require(_0x0611('0xc'));var crypto=require(_0x0611('0xd'));var jsforce=require(_0x0611('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0611('0xa'));var querystring=require('querystring');var Papa=require(_0x0611('0xf'));var Redis=require(_0x0611('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x0611('0x11'));var as=require(_0x0611('0x12'));var hardwareService=require(_0x0611('0x13'));var logger=require('../../config/logger')(_0x0611('0x14'));var utils=require(_0x0611('0x15'));var config=require('../../config/environment');var db=require(_0x0611('0x16'))['db'];function respondWithStatusCode(_0x468cd4,_0x495add){_0x495add=_0x495add||0xcc;return function(_0x2c8d78){if(_0x2c8d78){return _0x468cd4[_0x0611('0x17')](_0x495add);}return _0x468cd4[_0x0611('0x18')](_0x495add)[_0x0611('0x19')]();};}function respondWithResult(_0x5e8bf8,_0x5cb23c){_0x5cb23c=_0x5cb23c||0xc8;return function(_0x4d10ee){if(_0x4d10ee){return _0x5e8bf8[_0x0611('0x18')](_0x5cb23c)[_0x0611('0x1a')](_0x4d10ee);}};}function respondWithFilteredResult(_0x131fe9,_0x43c297){return function(_0x32394d){if(_0x32394d){var _0x22c82f=_0x32394d[_0x0611('0x1b')],_0x4571b6=_0x43c297['offset'],_0x4e8fb4=_0x43c297[_0x0611('0x1c')]+_0x43c297['limit'],_0x34a946;if(_0x4e8fb4>=_0x22c82f){_0x4e8fb4=_0x22c82f;_0x34a946=0xc8;}else{_0x34a946=0xce;}_0x131fe9[_0x0611('0x18')](_0x34a946);return _0x131fe9['set'](_0x0611('0x1d'),_0x4571b6+'-'+_0x4e8fb4+'/'+_0x22c82f)['json'](_0x32394d);}return null;};}function patchUpdates(_0x24e6fb){return function(_0x26f300){try{jsonpatch[_0x0611('0x1e')](_0x26f300,_0x24e6fb,!![]);}catch(_0x5e251e){return BPromise[_0x0611('0x1f')](_0x5e251e);}return _0x26f300[_0x0611('0x20')]();};}function saveUpdates(_0x339f4,_0x2f4dc3){return function(_0x42f773){if(_0x42f773){return _0x42f773[_0x0611('0x21')](_0x339f4)[_0x0611('0x22')](function(_0x537a3a){return _0x537a3a;});}return null;};}function removeEntity(_0x5f0f77,_0x5dd4a5){return function(_0x28d352){if(_0x28d352){return _0x28d352[_0x0611('0x23')]()['then'](function(){_0x5f0f77[_0x0611('0x18')](0xcc)[_0x0611('0x19')]();});}};}function handleEntityNotFound(_0x409f73,_0x13778b){return function(_0x127735){if(!_0x127735){_0x409f73[_0x0611('0x17')](0x194);}return _0x127735;};}function handleError(_0x2a66ef,_0x53218a){_0x53218a=_0x53218a||0x1f4;return function(_0x1391f2){logger[_0x0611('0x24')](_0x1391f2['stack']);if(_0x1391f2[_0x0611('0x25')]){delete _0x1391f2[_0x0611('0x25')];}_0x2a66ef[_0x0611('0x18')](_0x53218a)[_0x0611('0x26')](_0x1391f2);};}exports[_0x0611('0x27')]=function(_0x416f0c,_0x20b84c){var _0x56ed0c={},_0x22d543={},_0x1b0af={'count':0x0,'rows':[]};var _0x44573b=_[_0x0611('0x28')](db['MailSubstatus'][_0x0611('0x29')],function(_0x1bc24c){return{'name':_0x1bc24c[_0x0611('0x2a')],'type':_0x1bc24c[_0x0611('0x2b')]['key']};});_0x22d543[_0x0611('0x2c')]=_[_0x0611('0x28')](_0x44573b,_0x0611('0x25'));_0x22d543[_0x0611('0x2d')]=_[_0x0611('0x2e')](_0x416f0c[_0x0611('0x2d')]);_0x22d543[_0x0611('0x2f')]=_[_0x0611('0x30')](_0x22d543[_0x0611('0x2c')],_0x22d543[_0x0611('0x2d')]);_0x56ed0c[_0x0611('0x31')]=_[_0x0611('0x30')](_0x22d543[_0x0611('0x2c')],qs[_0x0611('0x32')](_0x416f0c['query']['fields']));_0x56ed0c[_0x0611('0x31')]=_0x56ed0c['attributes'][_0x0611('0x33')]?_0x56ed0c[_0x0611('0x31')]:_0x22d543['model'];if(!_0x416f0c[_0x0611('0x2d')][_0x0611('0x34')]('nolimit')){_0x56ed0c['limit']=qs[_0x0611('0x35')](_0x416f0c[_0x0611('0x2d')][_0x0611('0x35')]);_0x56ed0c[_0x0611('0x1c')]=qs[_0x0611('0x1c')](_0x416f0c[_0x0611('0x2d')][_0x0611('0x1c')]);}_0x56ed0c['order']=qs[_0x0611('0x36')](_0x416f0c[_0x0611('0x2d')][_0x0611('0x36')]);_0x56ed0c[_0x0611('0x37')]=qs[_0x0611('0x2f')](_[_0x0611('0x38')](_0x416f0c[_0x0611('0x2d')],_0x22d543[_0x0611('0x2f')]),_0x44573b);if(_0x416f0c['query'][_0x0611('0x39')]){_0x56ed0c[_0x0611('0x37')]=_['merge'](_0x56ed0c[_0x0611('0x37')],{'$or':_['map'](_0x44573b,function(_0x1342df){if(_0x1342df[_0x0611('0x2b')]!==_0x0611('0x3a')){var _0x1429b8={};_0x1429b8[_0x1342df['name']]={'$like':'%'+_0x416f0c[_0x0611('0x2d')][_0x0611('0x39')]+'%'};return _0x1429b8;}})});}_0x56ed0c=_[_0x0611('0x3b')]({},_0x56ed0c,_0x416f0c[_0x0611('0x3c')]);var _0x370903={'where':_0x56ed0c[_0x0611('0x37')]};return db[_0x0611('0x3d')][_0x0611('0x1b')](_0x370903)[_0x0611('0x22')](function(_0x4d1338){_0x1b0af['count']=_0x4d1338;if(_0x416f0c['query']['includeAll']){_0x56ed0c[_0x0611('0x3e')]=[{'all':!![]}];}return db[_0x0611('0x3d')][_0x0611('0x3f')](_0x56ed0c);})[_0x0611('0x22')](function(_0x5b5866){_0x1b0af['rows']=_0x5b5866;return _0x1b0af;})[_0x0611('0x22')](respondWithFilteredResult(_0x20b84c,_0x56ed0c))[_0x0611('0x40')](handleError(_0x20b84c,null));};exports['show']=function(_0x569130,_0x2ca431){var _0x432ff1={'raw':!![],'where':{'id':_0x569130[_0x0611('0x41')]['id']}},_0xd57a3c={};_0xd57a3c[_0x0611('0x2c')]=_['keys'](db['MailSubstatus']['rawAttributes']);_0xd57a3c['query']=_[_0x0611('0x2e')](_0x569130[_0x0611('0x2d')]);_0xd57a3c[_0x0611('0x2f')]=_[_0x0611('0x30')](_0xd57a3c[_0x0611('0x2c')],_0xd57a3c[_0x0611('0x2d')]);_0x432ff1['attributes']=_[_0x0611('0x30')](_0xd57a3c[_0x0611('0x2c')],qs['fields'](_0x569130['query'][_0x0611('0x32')]));_0x432ff1['attributes']=_0x432ff1['attributes'][_0x0611('0x33')]?_0x432ff1['attributes']:_0xd57a3c['model'];if(_0x569130[_0x0611('0x2d')][_0x0611('0x42')]){_0x432ff1[_0x0611('0x3e')]=[{'all':!![]}];}_0x432ff1=_[_0x0611('0x3b')]({},_0x432ff1,_0x569130[_0x0611('0x3c')]);return db[_0x0611('0x3d')][_0x0611('0x43')](_0x432ff1)[_0x0611('0x22')](handleEntityNotFound(_0x2ca431,null))['then'](respondWithResult(_0x2ca431,null))[_0x0611('0x40')](handleError(_0x2ca431,null));};exports[_0x0611('0x44')]=function(_0x447d14,_0x1b30f4){return db[_0x0611('0x3d')][_0x0611('0x44')](_0x447d14[_0x0611('0x45')],{})[_0x0611('0x22')](respondWithResult(_0x1b30f4,0xc9))[_0x0611('0x40')](handleError(_0x1b30f4,null));};exports['update']=function(_0x99536a,_0x16ea86){if(_0x99536a[_0x0611('0x45')]['id']){delete _0x99536a['body']['id'];}return db['MailSubstatus'][_0x0611('0x43')]({'where':{'id':_0x99536a['params']['id']}})[_0x0611('0x22')](handleEntityNotFound(_0x16ea86,null))['then'](saveUpdates(_0x99536a[_0x0611('0x45')],null))['then'](respondWithResult(_0x16ea86,null))['catch'](handleError(_0x16ea86,null));};exports[_0x0611('0x23')]=function(_0x47e09a,_0x29ae5f){return db[_0x0611('0x3d')][_0x0611('0x43')]({'where':{'id':_0x47e09a[_0x0611('0x41')]['id']}})[_0x0611('0x22')](handleEntityNotFound(_0x29ae5f,null))[_0x0611('0x22')](removeEntity(_0x29ae5f,null))[_0x0611('0x40')](handleError(_0x29ae5f,null));};exports[_0x0611('0x46')]=function(_0x2f10a7,_0x47a164){return db['MailSubstatus'][_0x0611('0x46')]()[_0x0611('0x22')](respondWithResult(_0x47a164,null))[_0x0611('0x40')](handleError(_0x47a164,null));}; \ No newline at end of file +var _0x0989=['create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','nolimit','limit','order','sort','pick','filters','merge','where','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','fields'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x0989,0x13c));var _0x9098=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x0989[_0x35a274];return _0x40d905;};'use strict';var pdf=require(_0x9098('0x0'));var emlformat=require(_0x9098('0x1'));var rimraf=require(_0x9098('0x2'));var zipdir=require(_0x9098('0x3'));var jsonpatch=require(_0x9098('0x4'));var rp=require(_0x9098('0x5'));var moment=require(_0x9098('0x6'));var BPromise=require(_0x9098('0x7'));var Mustache=require(_0x9098('0x8'));var util=require(_0x9098('0x9'));var path=require(_0x9098('0xa'));var sox=require(_0x9098('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9098('0xc'));var squel=require('squel');var crypto=require(_0x9098('0xd'));var jsforce=require(_0x9098('0xe'));var deskjs=require(_0x9098('0xf'));var toCsv=require(_0x9098('0x10'));var querystring=require(_0x9098('0x11'));var Papa=require(_0x9098('0x12'));var Redis=require(_0x9098('0x13'));var authService=require(_0x9098('0x14'));var qs=require(_0x9098('0x15'));var as=require(_0x9098('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9098('0x17'))(_0x9098('0x18'));var utils=require(_0x9098('0x19'));var config=require(_0x9098('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x401fa8,_0x1cf7fd){_0x1cf7fd=_0x1cf7fd||0xcc;return function(_0x40ddfd){if(_0x40ddfd){return _0x401fa8[_0x9098('0x1b')](_0x1cf7fd);}return _0x401fa8['status'](_0x1cf7fd)[_0x9098('0x1c')]();};}function respondWithResult(_0x16bbca,_0x4bc07f){_0x4bc07f=_0x4bc07f||0xc8;return function(_0x3ba683){if(_0x3ba683){return _0x16bbca[_0x9098('0x1d')](_0x4bc07f)[_0x9098('0x1e')](_0x3ba683);}};}function respondWithFilteredResult(_0x5ae6c3,_0x41f6fc){return function(_0x49ea13){if(_0x49ea13){var _0x957572=_0x49ea13['count'],_0x551c06=_0x41f6fc[_0x9098('0x1f')],_0x1f9aed=_0x41f6fc['offset']+_0x41f6fc['limit'],_0x548cc8;if(_0x1f9aed>=_0x957572){_0x1f9aed=_0x957572;_0x548cc8=0xc8;}else{_0x548cc8=0xce;}_0x5ae6c3[_0x9098('0x1d')](_0x548cc8);return _0x5ae6c3[_0x9098('0x20')](_0x9098('0x21'),_0x551c06+'-'+_0x1f9aed+'/'+_0x957572)[_0x9098('0x1e')](_0x49ea13);}return null;};}function patchUpdates(_0x1ba546){return function(_0x596eff){try{jsonpatch[_0x9098('0x22')](_0x596eff,_0x1ba546,!![]);}catch(_0x2c03c7){return BPromise[_0x9098('0x23')](_0x2c03c7);}return _0x596eff[_0x9098('0x24')]();};}function saveUpdates(_0x5314f4,_0x2d9296){return function(_0x5e6ce2){if(_0x5e6ce2){return _0x5e6ce2[_0x9098('0x25')](_0x5314f4)[_0x9098('0x26')](function(_0x482d06){return _0x482d06;});}return null;};}function removeEntity(_0x57d04f,_0x317103){return function(_0x2a6212){if(_0x2a6212){return _0x2a6212[_0x9098('0x27')]()['then'](function(){_0x57d04f['status'](0xcc)[_0x9098('0x1c')]();});}};}function handleEntityNotFound(_0xfa08fd,_0xf92ac9){return function(_0x3c285f){if(!_0x3c285f){_0xfa08fd['sendStatus'](0x194);}return _0x3c285f;};}function handleError(_0xca9112,_0x12d5d1){_0x12d5d1=_0x12d5d1||0x1f4;return function(_0x499c38){logger[_0x9098('0x28')](_0x499c38[_0x9098('0x29')]);if(_0x499c38[_0x9098('0x2a')]){delete _0x499c38[_0x9098('0x2a')];}_0xca9112[_0x9098('0x1d')](_0x12d5d1)['send'](_0x499c38);};}exports[_0x9098('0x2b')]=function(_0x577801,_0xde082b){var _0x4257e5={},_0x394a86={},_0x41958b={'count':0x0,'rows':[]};var _0x52b4e0=_[_0x9098('0x2c')](db[_0x9098('0x2d')][_0x9098('0x2e')],function(_0x48de74){return{'name':_0x48de74[_0x9098('0x2f')],'type':_0x48de74[_0x9098('0x30')][_0x9098('0x31')]};});_0x394a86[_0x9098('0x32')]=_['map'](_0x52b4e0,_0x9098('0x2a'));_0x394a86[_0x9098('0x33')]=_[_0x9098('0x34')](_0x577801[_0x9098('0x33')]);_0x394a86['filters']=_['intersection'](_0x394a86[_0x9098('0x32')],_0x394a86['query']);_0x4257e5['attributes']=_[_0x9098('0x35')](_0x394a86['model'],qs['fields'](_0x577801[_0x9098('0x33')]['fields']));_0x4257e5[_0x9098('0x36')]=_0x4257e5[_0x9098('0x36')][_0x9098('0x37')]?_0x4257e5[_0x9098('0x36')]:_0x394a86[_0x9098('0x32')];if(!_0x577801[_0x9098('0x33')]['hasOwnProperty'](_0x9098('0x38'))){_0x4257e5[_0x9098('0x39')]=qs[_0x9098('0x39')](_0x577801[_0x9098('0x33')][_0x9098('0x39')]);_0x4257e5[_0x9098('0x1f')]=qs[_0x9098('0x1f')](_0x577801['query'][_0x9098('0x1f')]);}_0x4257e5[_0x9098('0x3a')]=qs[_0x9098('0x3b')](_0x577801[_0x9098('0x33')][_0x9098('0x3b')]);_0x4257e5['where']=qs['filters'](_[_0x9098('0x3c')](_0x577801[_0x9098('0x33')],_0x394a86[_0x9098('0x3d')]),_0x52b4e0);if(_0x577801[_0x9098('0x33')]['filter']){_0x4257e5['where']=_[_0x9098('0x3e')](_0x4257e5[_0x9098('0x3f')],{'$or':_['map'](_0x52b4e0,function(_0x2e8288){if(_0x2e8288[_0x9098('0x30')]!==_0x9098('0x40')){var _0x193267={};_0x193267[_0x2e8288[_0x9098('0x2a')]]={'$like':'%'+_0x577801[_0x9098('0x33')]['filter']+'%'};return _0x193267;}})});}_0x4257e5=_[_0x9098('0x3e')]({},_0x4257e5,_0x577801[_0x9098('0x41')]);var _0x271fe1={'where':_0x4257e5[_0x9098('0x3f')]};return db[_0x9098('0x2d')][_0x9098('0x42')](_0x271fe1)[_0x9098('0x26')](function(_0x500df6){_0x41958b['count']=_0x500df6;if(_0x577801[_0x9098('0x33')][_0x9098('0x43')]){_0x4257e5[_0x9098('0x44')]=[{'all':!![]}];}return db['MailSubstatus'][_0x9098('0x45')](_0x4257e5);})[_0x9098('0x26')](function(_0x26bc57){_0x41958b['rows']=_0x26bc57;return _0x41958b;})[_0x9098('0x26')](respondWithFilteredResult(_0xde082b,_0x4257e5))[_0x9098('0x46')](handleError(_0xde082b,null));};exports[_0x9098('0x47')]=function(_0x1afadc,_0x578c6c){var _0x3ae303={'raw':!![],'where':{'id':_0x1afadc[_0x9098('0x48')]['id']}},_0x26a8c9={};_0x26a8c9[_0x9098('0x32')]=_[_0x9098('0x34')](db[_0x9098('0x2d')][_0x9098('0x2e')]);_0x26a8c9['query']=_[_0x9098('0x34')](_0x1afadc[_0x9098('0x33')]);_0x26a8c9['filters']=_['intersection'](_0x26a8c9['model'],_0x26a8c9[_0x9098('0x33')]);_0x3ae303[_0x9098('0x36')]=_[_0x9098('0x35')](_0x26a8c9[_0x9098('0x32')],qs[_0x9098('0x49')](_0x1afadc[_0x9098('0x33')]['fields']));_0x3ae303[_0x9098('0x36')]=_0x3ae303[_0x9098('0x36')]['length']?_0x3ae303[_0x9098('0x36')]:_0x26a8c9[_0x9098('0x32')];if(_0x1afadc[_0x9098('0x33')]['includeAll']){_0x3ae303[_0x9098('0x44')]=[{'all':!![]}];}_0x3ae303=_['merge']({},_0x3ae303,_0x1afadc[_0x9098('0x41')]);return db[_0x9098('0x2d')]['find'](_0x3ae303)[_0x9098('0x26')](handleEntityNotFound(_0x578c6c,null))[_0x9098('0x26')](respondWithResult(_0x578c6c,null))[_0x9098('0x46')](handleError(_0x578c6c,null));};exports[_0x9098('0x4a')]=function(_0x438f8f,_0x460748){return db[_0x9098('0x2d')][_0x9098('0x4a')](_0x438f8f['body'],{})['then'](respondWithResult(_0x460748,0xc9))['catch'](handleError(_0x460748,null));};exports['update']=function(_0x11f04c,_0x306642){if(_0x11f04c[_0x9098('0x4b')]['id']){delete _0x11f04c[_0x9098('0x4b')]['id'];}return db[_0x9098('0x2d')][_0x9098('0x4c')]({'where':{'id':_0x11f04c[_0x9098('0x48')]['id']}})['then'](handleEntityNotFound(_0x306642,null))[_0x9098('0x26')](saveUpdates(_0x11f04c[_0x9098('0x4b')],null))['then'](respondWithResult(_0x306642,null))['catch'](handleError(_0x306642,null));};exports[_0x9098('0x27')]=function(_0x1fcbdf,_0xe4d729){return db['MailSubstatus'][_0x9098('0x4c')]({'where':{'id':_0x1fcbdf[_0x9098('0x48')]['id']}})[_0x9098('0x26')](handleEntityNotFound(_0xe4d729,null))['then'](removeEntity(_0xe4d729,null))[_0x9098('0x46')](handleError(_0xe4d729,null));};exports[_0x9098('0x4d')]=function(_0x15f8d2,_0x250eeb){return db[_0x9098('0x2d')][_0x9098('0x4d')]()['then'](respondWithResult(_0x250eeb,null))[_0x9098('0x46')](handleError(_0x250eeb,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index b9840a6..d840ae5 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 _0xd465=['api','moment','path','rimraf','../../config/environment','./mailSubstatus.attributes','define','MailSubstatus','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd465,0xb2));var _0x5d46=function(_0x21d406,_0x43b024){_0x21d406=_0x21d406-0x0;var _0x1c867e=_0xd465[_0x21d406];return _0x1c867e;};'use strict';var _=require(_0x5d46('0x0'));var util=require(_0x5d46('0x1'));var logger=require('../../config/logger')(_0x5d46('0x2'));var moment=require(_0x5d46('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5d46('0x4'));var rimraf=require(_0x5d46('0x5'));var config=require(_0x5d46('0x6'));var attributes=require(_0x5d46('0x7'));module['exports']=function(_0xfdf8dc,_0x1c7e0d){return _0xfdf8dc[_0x5d46('0x8')](_0x5d46('0x9'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x469a=['moment','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','mail_substatuses','lodash','util','../../config/logger','api'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x469a,0x140));var _0xa469=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0x469a[_0x1a0ef3];return _0x2b86da;};'use strict';var _=require(_0xa469('0x0'));var util=require(_0xa469('0x1'));var logger=require(_0xa469('0x2'))(_0xa469('0x3'));var moment=require(_0xa469('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa469('0x5'));var rimraf=require(_0xa469('0x6'));var config=require(_0xa469('0x7'));var attributes=require(_0xa469('0x8'));module[_0xa469('0x9')]=function(_0x46663e,_0x3ca3a6){return _0x46663e[_0xa469('0xa')]('MailSubstatus',attributes,{'tableName':_0xa469('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 43913ff..1680e93 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 _0x70e0=['code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5605e7,_0x49bee5){var _0x2eee80=function(_0x1a1bab){while(--_0x1a1bab){_0x5605e7['push'](_0x5605e7['shift']());}};_0x2eee80(++_0x49bee5);}(_0x70e0,0x17b));var _0x070e=function(_0x26ceff,_0x31f7ee){_0x26ceff=_0x26ceff-0x0;var _0x5bd0e8=_0x70e0[_0x26ceff];return _0x5bd0e8;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x070e('0x3'));var db=require(_0x070e('0x4'))['db'];var utils=require(_0x070e('0x5'));var logger=require(_0x070e('0x6'))('rpc');var config=require(_0x070e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x070e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56e420,_0x5032e5,_0x35ab0c){return new BPromise(function(_0x1e11f0,_0x604664){return client[_0x070e('0x9')](_0x56e420,_0x35ab0c)[_0x070e('0xa')](function(_0x68a09e){logger[_0x070e('0xb')]('MailSubstatus,\x20%s,\x20%s',_0x5032e5,'request\x20sent');logger[_0x070e('0xc')](_0x070e('0xd'),_0x5032e5,_0x070e('0xe'),JSON[_0x070e('0xf')](_0x68a09e));if(_0x68a09e[_0x070e('0x10')]){if(_0x68a09e[_0x070e('0x10')][_0x070e('0x11')]===0x1f4){logger[_0x070e('0x10')](_0x070e('0x12'),_0x5032e5,_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);return _0x604664(_0x68a09e['error']['message']);}logger[_0x070e('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('MailSubstatus,\x20%s,\x20%s',_0x5032e5,_0x070e('0xe'));_0x1e11f0(_0x68a09e[_0x070e('0x14')][_0x070e('0x13')]);}})[_0x070e('0x15')](function(_0x5bc71e){logger['error'](_0x070e('0x12'),_0x5032e5,_0x5bc71e);_0x604664(_0x5bc71e);});});} \ No newline at end of file +var _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','result'];(function(_0x455f1c,_0x4a24fc){var _0x4b06c2=function(_0x192ddb){while(--_0x192ddb){_0x455f1c['push'](_0x455f1c['shift']());}};_0x4b06c2(++_0x4a24fc);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x380af2,_0x36cf66){_0x380af2=_0x380af2-0x0;var _0x1789dc=_0xf3cd[_0x380af2];return _0x1789dc;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 1fdab87..72e513c 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 _0xb68f=['/:id','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','get','post','create','put','update','delete'];(function(_0x3af179,_0x2841a8){var _0x4a35a7=function(_0x59f8bb){while(--_0x59f8bb){_0x3af179['push'](_0x3af179['shift']());}};_0x4a35a7(++_0x2841a8);}(_0xb68f,0x135));var _0xfb68=function(_0x22ca7b,_0x295d7d){_0x22ca7b=_0x22ca7b-0x0;var _0x46ef64=_0xb68f[_0x22ca7b];return _0x46ef64;};'use strict';var multer=require(_0xfb68('0x0'));var util=require(_0xfb68('0x1'));var path=require(_0xfb68('0x2'));var timeout=require(_0xfb68('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xfb68('0x4'));var interaction=require(_0xfb68('0x5'));var config=require(_0xfb68('0x6'));var controller=require(_0xfb68('0x7'));router['get']('/',auth[_0xfb68('0x8')](),controller['index']);router['get']('/describe',auth[_0xfb68('0x8')](),controller['describe']);router[_0xfb68('0x9')]('/:id',auth[_0xfb68('0x8')](),controller['show']);router[_0xfb68('0xa')]('/',auth[_0xfb68('0x8')](),controller[_0xfb68('0xb')]);router[_0xfb68('0xc')]('/:id',auth[_0xfb68('0x8')](),controller[_0xfb68('0xd')]);router[_0xfb68('0xe')](_0xfb68('0xf'),auth['isAuthenticated'](),controller[_0xfb68('0x10')]);module[_0xfb68('0x11')]=router; \ No newline at end of file +var _0x0873=['../../components/auth/service','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x426f00,_0x4f7131){var _0x324a41=function(_0x30060c){while(--_0x30060c){_0x426f00['push'](_0x426f00['shift']());}};_0x324a41(++_0x4f7131);}(_0x0873,0xae));var _0x3087=function(_0x2b3d01,_0x4ef1a0){_0x2b3d01=_0x2b3d01-0x0;var _0x359771=_0x0873[_0x2b3d01];return _0x359771;};'use strict';var multer=require(_0x3087('0x0'));var util=require(_0x3087('0x1'));var path=require(_0x3087('0x2'));var timeout=require(_0x3087('0x3'));var express=require(_0x3087('0x4'));var router=express[_0x3087('0x5')]();var auth=require(_0x3087('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3087('0x7'));router[_0x3087('0x8')]('/',auth[_0x3087('0x9')](),controller[_0x3087('0xa')]);router[_0x3087('0x8')](_0x3087('0xb'),auth[_0x3087('0x9')](),controller[_0x3087('0xc')]);router[_0x3087('0x8')](_0x3087('0xd'),auth[_0x3087('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3087('0xe')](_0x3087('0xd'),auth['isAuthenticated'](),controller[_0x3087('0xf')]);router[_0x3087('0x10')](_0x3087('0xd'),auth[_0x3087('0x9')](),controller['destroy']);module[_0x3087('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 76f2609..8a728c9 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 _0x59bb=['agent','queue','NOW','sequelize','STRING','ENUM','account'];(function(_0x551e6b,_0x378961){var _0x5e35cb=function(_0x11f67e){while(--_0x11f67e){_0x551e6b['push'](_0x551e6b['shift']());}};_0x5e35cb(++_0x378961);}(_0x59bb,0x73));var _0xb59b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x59bb[_0x432682];return _0x463d05;};'use strict';var moment=require('moment');var Sequelize=require(_0xb59b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xb59b('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb59b('0x2')](_0xb59b('0x3'),_0xb59b('0x4'),'queue'),'allowNull':![],'defaultValue':_0xb59b('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xb59b('0x6')]}}; \ No newline at end of file +var _0xa974=['ENUM','agent','queue','DATE','exports','STRING'];(function(_0x3b1393,_0xa70d84){var _0x564aa7=function(_0x2d0320){while(--_0x2d0320){_0x3b1393['push'](_0x3b1393['shift']());}};_0x564aa7(++_0xa70d84);}(_0xa974,0x130));var _0x4a97=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0xa974[_0x4d8dc3];return _0x9b03d9;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x4a97('0x0')]={'uniqueid':{'type':Sequelize[_0x4a97('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4a97('0x2')]('account',_0x4a97('0x3'),'queue'),'allowNull':![],'defaultValue':_0x4a97('0x4')},'transferredAt':{'type':Sequelize[_0x4a97('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 548376a..6073ed9 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 _0x0e08=['offset','set','Content-Range','apply','update','then','destroy','end','sendStatus','error','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filter','merge','count','includeAll','rows','catch','params','length','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','json'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x0e08,0xfc));var _0x80e0=function(_0x53f259,_0xd43b5f){_0x53f259=_0x53f259-0x0;var _0x56ff12=_0x0e08[_0x53f259];return _0x56ff12;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x80e0('0x0'));var rimraf=require(_0x80e0('0x1'));var zipdir=require(_0x80e0('0x2'));var jsonpatch=require(_0x80e0('0x3'));var rp=require(_0x80e0('0x4'));var moment=require(_0x80e0('0x5'));var BPromise=require(_0x80e0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x80e0('0x7'));var sox=require(_0x80e0('0x8'));var csv=require(_0x80e0('0x9'));var ejs=require(_0x80e0('0xa'));var fs=require('fs');var _=require(_0x80e0('0xb'));var squel=require('squel');var crypto=require(_0x80e0('0xc'));var jsforce=require(_0x80e0('0xd'));var deskjs=require(_0x80e0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x80e0('0xf'));var Papa=require(_0x80e0('0x10'));var Redis=require(_0x80e0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x80e0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x80e0('0x13'));var logger=require(_0x80e0('0x14'))(_0x80e0('0x15'));var utils=require(_0x80e0('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25cc6f,_0x410e7c){_0x410e7c=_0x410e7c||0xcc;return function(_0x3ab7a0){if(_0x3ab7a0){return _0x25cc6f['sendStatus'](_0x410e7c);}return _0x25cc6f['status'](_0x410e7c)['end']();};}function respondWithResult(_0x4422dd,_0xb9f7b5){_0xb9f7b5=_0xb9f7b5||0xc8;return function(_0x2776fb){if(_0x2776fb){return _0x4422dd['status'](_0xb9f7b5)[_0x80e0('0x17')](_0x2776fb);}};}function respondWithFilteredResult(_0x16bcf2,_0x3d9673){return function(_0x37a702){if(_0x37a702){var _0x6bcb3=_0x37a702['count'],_0x2af29e=_0x3d9673[_0x80e0('0x18')],_0x1c5eb6=_0x3d9673['offset']+_0x3d9673['limit'],_0x995d49;if(_0x1c5eb6>=_0x6bcb3){_0x1c5eb6=_0x6bcb3;_0x995d49=0xc8;}else{_0x995d49=0xce;}_0x16bcf2['status'](_0x995d49);return _0x16bcf2[_0x80e0('0x19')](_0x80e0('0x1a'),_0x2af29e+'-'+_0x1c5eb6+'/'+_0x6bcb3)[_0x80e0('0x17')](_0x37a702);}return null;};}function patchUpdates(_0x2250e0){return function(_0x28511f){try{jsonpatch[_0x80e0('0x1b')](_0x28511f,_0x2250e0,!![]);}catch(_0x714215){return BPromise['reject'](_0x714215);}return _0x28511f['save']();};}function saveUpdates(_0x1ae08b,_0x56b807){return function(_0x17d0f0){if(_0x17d0f0){return _0x17d0f0[_0x80e0('0x1c')](_0x1ae08b)[_0x80e0('0x1d')](function(_0x2f9624){return _0x2f9624;});}return null;};}function removeEntity(_0x7b51d0,_0x829051){return function(_0x55c31d){if(_0x55c31d){return _0x55c31d[_0x80e0('0x1e')]()[_0x80e0('0x1d')](function(){_0x7b51d0['status'](0xcc)[_0x80e0('0x1f')]();});}};}function handleEntityNotFound(_0x116401,_0x3d6634){return function(_0x5d923e){if(!_0x5d923e){_0x116401[_0x80e0('0x20')](0x194);}return _0x5d923e;};}function handleError(_0x86f8ed,_0x40cd22){_0x40cd22=_0x40cd22||0x1f4;return function(_0x5e0e60){logger[_0x80e0('0x21')](_0x5e0e60[_0x80e0('0x22')]);if(_0x5e0e60[_0x80e0('0x23')]){delete _0x5e0e60['name'];}_0x86f8ed['status'](_0x40cd22)[_0x80e0('0x24')](_0x5e0e60);};}exports['index']=function(_0x5f2395,_0x34262a){var _0x39fa9b={},_0x206392={},_0xf71cca={'count':0x0,'rows':[]};var _0x58e444=_[_0x80e0('0x25')](db[_0x80e0('0x26')][_0x80e0('0x27')],function(_0x2091f3){return{'name':_0x2091f3[_0x80e0('0x28')],'type':_0x2091f3[_0x80e0('0x29')][_0x80e0('0x2a')]};});_0x206392['model']=_['map'](_0x58e444,'name');_0x206392[_0x80e0('0x2b')]=_[_0x80e0('0x2c')](_0x5f2395[_0x80e0('0x2b')]);_0x206392[_0x80e0('0x2d')]=_[_0x80e0('0x2e')](_0x206392[_0x80e0('0x2f')],_0x206392['query']);_0x39fa9b[_0x80e0('0x30')]=_[_0x80e0('0x2e')](_0x206392[_0x80e0('0x2f')],qs[_0x80e0('0x31')](_0x5f2395['query'][_0x80e0('0x31')]));_0x39fa9b[_0x80e0('0x30')]=_0x39fa9b[_0x80e0('0x30')]['length']?_0x39fa9b[_0x80e0('0x30')]:_0x206392['model'];if(!_0x5f2395[_0x80e0('0x2b')][_0x80e0('0x32')](_0x80e0('0x33'))){_0x39fa9b[_0x80e0('0x34')]=qs[_0x80e0('0x34')](_0x5f2395[_0x80e0('0x2b')][_0x80e0('0x34')]);_0x39fa9b[_0x80e0('0x18')]=qs[_0x80e0('0x18')](_0x5f2395[_0x80e0('0x2b')][_0x80e0('0x18')]);}_0x39fa9b['order']=qs[_0x80e0('0x35')](_0x5f2395[_0x80e0('0x2b')][_0x80e0('0x35')]);_0x39fa9b[_0x80e0('0x36')]=qs['filters'](_['pick'](_0x5f2395['query'],_0x206392[_0x80e0('0x2d')]),_0x58e444);if(_0x5f2395[_0x80e0('0x2b')][_0x80e0('0x37')]){_0x39fa9b['where']=_[_0x80e0('0x38')](_0x39fa9b[_0x80e0('0x36')],{'$or':_[_0x80e0('0x25')](_0x58e444,function(_0x8d8e4a){if(_0x8d8e4a[_0x80e0('0x29')]!=='VIRTUAL'){var _0x4fce14={};_0x4fce14[_0x8d8e4a['name']]={'$like':'%'+_0x5f2395[_0x80e0('0x2b')]['filter']+'%'};return _0x4fce14;}})});}_0x39fa9b=_[_0x80e0('0x38')]({},_0x39fa9b,_0x5f2395['options']);var _0x5d245a={'where':_0x39fa9b[_0x80e0('0x36')]};return db['MailTransferReport'][_0x80e0('0x39')](_0x5d245a)[_0x80e0('0x1d')](function(_0x58624b){_0xf71cca[_0x80e0('0x39')]=_0x58624b;if(_0x5f2395['query'][_0x80e0('0x3a')]){_0x39fa9b['include']=[{'all':!![]}];}return db[_0x80e0('0x26')]['findAll'](_0x39fa9b);})[_0x80e0('0x1d')](function(_0x4533bf){_0xf71cca[_0x80e0('0x3b')]=_0x4533bf;return _0xf71cca;})[_0x80e0('0x1d')](respondWithFilteredResult(_0x34262a,_0x39fa9b))[_0x80e0('0x3c')](handleError(_0x34262a,null));};exports['show']=function(_0x3bf49c,_0x3e2537){var _0x2ccf42={'raw':!![],'where':{'id':_0x3bf49c[_0x80e0('0x3d')]['id']}},_0x535036={};_0x535036['model']=_['keys'](db[_0x80e0('0x26')]['rawAttributes']);_0x535036[_0x80e0('0x2b')]=_[_0x80e0('0x2c')](_0x3bf49c['query']);_0x535036['filters']=_[_0x80e0('0x2e')](_0x535036[_0x80e0('0x2f')],_0x535036['query']);_0x2ccf42['attributes']=_[_0x80e0('0x2e')](_0x535036['model'],qs[_0x80e0('0x31')](_0x3bf49c[_0x80e0('0x2b')][_0x80e0('0x31')]));_0x2ccf42['attributes']=_0x2ccf42[_0x80e0('0x30')][_0x80e0('0x3e')]?_0x2ccf42[_0x80e0('0x30')]:_0x535036[_0x80e0('0x2f')];if(_0x3bf49c[_0x80e0('0x2b')][_0x80e0('0x3a')]){_0x2ccf42[_0x80e0('0x3f')]=[{'all':!![]}];}_0x2ccf42=_['merge']({},_0x2ccf42,_0x3bf49c[_0x80e0('0x40')]);return db['MailTransferReport'][_0x80e0('0x41')](_0x2ccf42)[_0x80e0('0x1d')](handleEntityNotFound(_0x3e2537,null))[_0x80e0('0x1d')](respondWithResult(_0x3e2537,null))[_0x80e0('0x3c')](handleError(_0x3e2537,null));};exports['create']=function(_0x29826b,_0x5dd261){return db['MailTransferReport'][_0x80e0('0x42')](_0x29826b[_0x80e0('0x43')],{})[_0x80e0('0x1d')](respondWithResult(_0x5dd261,0xc9))[_0x80e0('0x3c')](handleError(_0x5dd261,null));};exports[_0x80e0('0x1c')]=function(_0x289842,_0xf12ef1){if(_0x289842['body']['id']){delete _0x289842[_0x80e0('0x43')]['id'];}return db[_0x80e0('0x26')][_0x80e0('0x41')]({'where':{'id':_0x289842[_0x80e0('0x3d')]['id']}})['then'](handleEntityNotFound(_0xf12ef1,null))['then'](saveUpdates(_0x289842[_0x80e0('0x43')],null))['then'](respondWithResult(_0xf12ef1,null))['catch'](handleError(_0xf12ef1,null));};exports['destroy']=function(_0x71bd7a,_0x326f63){return db['MailTransferReport'][_0x80e0('0x41')]({'where':{'id':_0x71bd7a[_0x80e0('0x3d')]['id']}})[_0x80e0('0x1d')](handleEntityNotFound(_0x326f63,null))['then'](removeEntity(_0x326f63,null))[_0x80e0('0x3c')](handleError(_0x326f63,null));};exports[_0x80e0('0x44')]=function(_0x2b43c1,_0x22d904){return db[_0x80e0('0x26')][_0x80e0('0x44')]()[_0x80e0('0x1d')](respondWithResult(_0x22d904,null))['catch'](handleError(_0x22d904,null));}; \ No newline at end of file +var _0x6aa2=['type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','show','rawAttributes','include','find','catch','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','Content-Range','reject','update','then','destroy','sendStatus','stack','name','send','map','MailTransferReport','fieldName'];(function(_0x288742,_0x1cae8d){var _0x48e6e6=function(_0x209add){while(--_0x209add){_0x288742['push'](_0x288742['shift']());}};_0x48e6e6(++_0x1cae8d);}(_0x6aa2,0x17c));var _0x26aa=function(_0x13945b,_0x289c94){_0x13945b=_0x13945b-0x0;var _0x1b1643=_0x6aa2[_0x13945b];return _0x1b1643;};'use strict';var pdf=require(_0x26aa('0x0'));var emlformat=require(_0x26aa('0x1'));var rimraf=require(_0x26aa('0x2'));var zipdir=require(_0x26aa('0x3'));var jsonpatch=require(_0x26aa('0x4'));var rp=require(_0x26aa('0x5'));var moment=require('moment');var BPromise=require(_0x26aa('0x6'));var Mustache=require('mustache');var util=require(_0x26aa('0x7'));var path=require(_0x26aa('0x8'));var sox=require(_0x26aa('0x9'));var csv=require(_0x26aa('0xa'));var ejs=require(_0x26aa('0xb'));var fs=require('fs');var _=require(_0x26aa('0xc'));var squel=require(_0x26aa('0xd'));var crypto=require('crypto');var jsforce=require(_0x26aa('0xe'));var deskjs=require(_0x26aa('0xf'));var toCsv=require('to-csv');var querystring=require(_0x26aa('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x26aa('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x26aa('0x12'));var hardwareService=require(_0x26aa('0x13'));var logger=require('../../config/logger')(_0x26aa('0x14'));var utils=require(_0x26aa('0x15'));var config=require(_0x26aa('0x16'));var db=require(_0x26aa('0x17'))['db'];function respondWithStatusCode(_0x2f150f,_0x576fa5){_0x576fa5=_0x576fa5||0xcc;return function(_0x30f92e){if(_0x30f92e){return _0x2f150f['sendStatus'](_0x576fa5);}return _0x2f150f[_0x26aa('0x18')](_0x576fa5)[_0x26aa('0x19')]();};}function respondWithResult(_0x5aae7,_0x52b013){_0x52b013=_0x52b013||0xc8;return function(_0x1096cb){if(_0x1096cb){return _0x5aae7[_0x26aa('0x18')](_0x52b013)[_0x26aa('0x1a')](_0x1096cb);}};}function respondWithFilteredResult(_0x1e09fb,_0x2ebfd1){return function(_0x2c18c1){if(_0x2c18c1){var _0x5186f1=_0x2c18c1['count'],_0x530bf8=_0x2ebfd1[_0x26aa('0x1b')],_0x19f80b=_0x2ebfd1['offset']+_0x2ebfd1['limit'],_0x20afbf;if(_0x19f80b>=_0x5186f1){_0x19f80b=_0x5186f1;_0x20afbf=0xc8;}else{_0x20afbf=0xce;}_0x1e09fb[_0x26aa('0x18')](_0x20afbf);return _0x1e09fb['set'](_0x26aa('0x1c'),_0x530bf8+'-'+_0x19f80b+'/'+_0x5186f1)[_0x26aa('0x1a')](_0x2c18c1);}return null;};}function patchUpdates(_0x7d4000){return function(_0x183a21){try{jsonpatch['apply'](_0x183a21,_0x7d4000,!![]);}catch(_0x19b9d8){return BPromise[_0x26aa('0x1d')](_0x19b9d8);}return _0x183a21['save']();};}function saveUpdates(_0x407f1b,_0x5e06f7){return function(_0x16ca4a){if(_0x16ca4a){return _0x16ca4a[_0x26aa('0x1e')](_0x407f1b)[_0x26aa('0x1f')](function(_0x25fd04){return _0x25fd04;});}return null;};}function removeEntity(_0x1df9b5,_0x153348){return function(_0x12ce21){if(_0x12ce21){return _0x12ce21[_0x26aa('0x20')]()['then'](function(){_0x1df9b5[_0x26aa('0x18')](0xcc)[_0x26aa('0x19')]();});}};}function handleEntityNotFound(_0x4f0e7b,_0x57d004){return function(_0x5103ec){if(!_0x5103ec){_0x4f0e7b[_0x26aa('0x21')](0x194);}return _0x5103ec;};}function handleError(_0xa52da8,_0x428e8a){_0x428e8a=_0x428e8a||0x1f4;return function(_0x1d2657){logger['error'](_0x1d2657[_0x26aa('0x22')]);if(_0x1d2657[_0x26aa('0x23')]){delete _0x1d2657['name'];}_0xa52da8[_0x26aa('0x18')](_0x428e8a)[_0x26aa('0x24')](_0x1d2657);};}exports['index']=function(_0x3b7de9,_0x7370a3){var _0x3a8b70={},_0x42986a={},_0x4a6144={'count':0x0,'rows':[]};var _0x192841=_[_0x26aa('0x25')](db[_0x26aa('0x26')]['rawAttributes'],function(_0x3173ac){return{'name':_0x3173ac[_0x26aa('0x27')],'type':_0x3173ac[_0x26aa('0x28')]['key']};});_0x42986a['model']=_[_0x26aa('0x25')](_0x192841,_0x26aa('0x23'));_0x42986a[_0x26aa('0x29')]=_[_0x26aa('0x2a')](_0x3b7de9['query']);_0x42986a[_0x26aa('0x2b')]=_['intersection'](_0x42986a[_0x26aa('0x2c')],_0x42986a[_0x26aa('0x29')]);_0x3a8b70[_0x26aa('0x2d')]=_[_0x26aa('0x2e')](_0x42986a[_0x26aa('0x2c')],qs['fields'](_0x3b7de9[_0x26aa('0x29')][_0x26aa('0x2f')]));_0x3a8b70[_0x26aa('0x2d')]=_0x3a8b70[_0x26aa('0x2d')][_0x26aa('0x30')]?_0x3a8b70['attributes']:_0x42986a[_0x26aa('0x2c')];if(!_0x3b7de9[_0x26aa('0x29')][_0x26aa('0x31')](_0x26aa('0x32'))){_0x3a8b70['limit']=qs[_0x26aa('0x33')](_0x3b7de9[_0x26aa('0x29')][_0x26aa('0x33')]);_0x3a8b70['offset']=qs[_0x26aa('0x1b')](_0x3b7de9[_0x26aa('0x29')]['offset']);}_0x3a8b70[_0x26aa('0x34')]=qs[_0x26aa('0x35')](_0x3b7de9[_0x26aa('0x29')][_0x26aa('0x35')]);_0x3a8b70[_0x26aa('0x36')]=qs[_0x26aa('0x2b')](_[_0x26aa('0x37')](_0x3b7de9[_0x26aa('0x29')],_0x42986a[_0x26aa('0x2b')]),_0x192841);if(_0x3b7de9['query'][_0x26aa('0x38')]){_0x3a8b70[_0x26aa('0x36')]=_[_0x26aa('0x39')](_0x3a8b70[_0x26aa('0x36')],{'$or':_[_0x26aa('0x25')](_0x192841,function(_0x521dde){if(_0x521dde[_0x26aa('0x28')]!==_0x26aa('0x3a')){var _0x2d7625={};_0x2d7625[_0x521dde[_0x26aa('0x23')]]={'$like':'%'+_0x3b7de9[_0x26aa('0x29')][_0x26aa('0x38')]+'%'};return _0x2d7625;}})});}_0x3a8b70=_[_0x26aa('0x39')]({},_0x3a8b70,_0x3b7de9[_0x26aa('0x3b')]);var _0x165d6b={'where':_0x3a8b70[_0x26aa('0x36')]};return db[_0x26aa('0x26')]['count'](_0x165d6b)[_0x26aa('0x1f')](function(_0x2b7346){_0x4a6144[_0x26aa('0x3c')]=_0x2b7346;if(_0x3b7de9[_0x26aa('0x29')][_0x26aa('0x3d')]){_0x3a8b70['include']=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x3a8b70);})['then'](function(_0x5777bb){_0x4a6144[_0x26aa('0x3e')]=_0x5777bb;return _0x4a6144;})[_0x26aa('0x1f')](respondWithFilteredResult(_0x7370a3,_0x3a8b70))['catch'](handleError(_0x7370a3,null));};exports[_0x26aa('0x3f')]=function(_0x531a0a,_0x5aff7c){var _0x596ad2={'raw':!![],'where':{'id':_0x531a0a['params']['id']}},_0x537888={};_0x537888['model']=_[_0x26aa('0x2a')](db['MailTransferReport'][_0x26aa('0x40')]);_0x537888[_0x26aa('0x29')]=_[_0x26aa('0x2a')](_0x531a0a['query']);_0x537888[_0x26aa('0x2b')]=_[_0x26aa('0x2e')](_0x537888[_0x26aa('0x2c')],_0x537888[_0x26aa('0x29')]);_0x596ad2[_0x26aa('0x2d')]=_['intersection'](_0x537888[_0x26aa('0x2c')],qs['fields'](_0x531a0a['query'][_0x26aa('0x2f')]));_0x596ad2[_0x26aa('0x2d')]=_0x596ad2[_0x26aa('0x2d')][_0x26aa('0x30')]?_0x596ad2[_0x26aa('0x2d')]:_0x537888[_0x26aa('0x2c')];if(_0x531a0a[_0x26aa('0x29')]['includeAll']){_0x596ad2[_0x26aa('0x41')]=[{'all':!![]}];}_0x596ad2=_[_0x26aa('0x39')]({},_0x596ad2,_0x531a0a[_0x26aa('0x3b')]);return db[_0x26aa('0x26')][_0x26aa('0x42')](_0x596ad2)['then'](handleEntityNotFound(_0x5aff7c,null))[_0x26aa('0x1f')](respondWithResult(_0x5aff7c,null))[_0x26aa('0x43')](handleError(_0x5aff7c,null));};exports['create']=function(_0x489797,_0x446ba5){return db[_0x26aa('0x26')]['create'](_0x489797[_0x26aa('0x44')],{})[_0x26aa('0x1f')](respondWithResult(_0x446ba5,0xc9))[_0x26aa('0x43')](handleError(_0x446ba5,null));};exports[_0x26aa('0x1e')]=function(_0x8d51c7,_0x448924){if(_0x8d51c7['body']['id']){delete _0x8d51c7[_0x26aa('0x44')]['id'];}return db[_0x26aa('0x26')]['find']({'where':{'id':_0x8d51c7['params']['id']}})[_0x26aa('0x1f')](handleEntityNotFound(_0x448924,null))[_0x26aa('0x1f')](saveUpdates(_0x8d51c7[_0x26aa('0x44')],null))[_0x26aa('0x1f')](respondWithResult(_0x448924,null))[_0x26aa('0x43')](handleError(_0x448924,null));};exports[_0x26aa('0x20')]=function(_0x5472f5,_0x1691e9){return db['MailTransferReport']['find']({'where':{'id':_0x5472f5['params']['id']}})[_0x26aa('0x1f')](handleEntityNotFound(_0x1691e9,null))[_0x26aa('0x1f')](removeEntity(_0x1691e9,null))[_0x26aa('0x43')](handleError(_0x1691e9,null));};exports['describe']=function(_0x1d5a94,_0x55b5ae){return db[_0x26aa('0x26')][_0x26aa('0x45')]()[_0x26aa('0x1f')](respondWithResult(_0x55b5ae,null))[_0x26aa('0x43')](handleError(_0x55b5ae,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 7f42a06..b055389 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 _0xaf9d=['../../config/logger','api','moment','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','lodash','util'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0xaf9d,0xf5));var _0xdaf9=function(_0x25be55,_0xb0dc9f){_0x25be55=_0x25be55-0x0;var _0x460a64=_0xaf9d[_0x25be55];return _0x460a64;};'use strict';var _=require(_0xdaf9('0x0'));var util=require(_0xdaf9('0x1'));var logger=require(_0xdaf9('0x2'))(_0xdaf9('0x3'));var moment=require(_0xdaf9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdaf9('0x5'));var rimraf=require(_0xdaf9('0x6'));var config=require(_0xdaf9('0x7'));var attributes=require(_0xdaf9('0x8'));module[_0xdaf9('0x9')]=function(_0x10d617,_0x2eb53a){return _0x10d617[_0xdaf9('0xa')](_0xdaf9('0xb'),attributes,{'tableName':_0xdaf9('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdec9=['./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2c56b2,_0x29489c){var _0x26fbf8=function(_0x148aab){while(--_0x148aab){_0x2c56b2['push'](_0x2c56b2['shift']());}};_0x26fbf8(++_0x29489c);}(_0xdec9,0x113));var _0x9dec=function(_0x5eae8b,_0x1b4ba8){_0x5eae8b=_0x5eae8b-0x0;var _0x4485e6=_0xdec9[_0x5eae8b];return _0x4485e6;};'use strict';var _=require(_0x9dec('0x0'));var util=require(_0x9dec('0x1'));var logger=require(_0x9dec('0x2'))(_0x9dec('0x3'));var moment=require(_0x9dec('0x4'));var BPromise=require(_0x9dec('0x5'));var rp=require(_0x9dec('0x6'));var fs=require('fs');var path=require(_0x9dec('0x7'));var rimraf=require(_0x9dec('0x8'));var config=require(_0x9dec('0x9'));var attributes=require(_0x9dec('0xa'));module['exports']=function(_0x4f9ea7,_0x2f04fb){return _0x4f9ea7[_0x9dec('0xb')](_0x9dec('0xc'),attributes,{'tableName':_0x9dec('0xd'),'paranoid':![],'indexes':[{'name':_0x9dec('0xe'),'fields':[_0x9dec('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 8304822..4b5a586 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 _0xbf70=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x40f435,_0x126ea3){var _0x5c2061=function(_0x5d35fe){while(--_0x5d35fe){_0x40f435['push'](_0x40f435['shift']());}};_0x5c2061(++_0x126ea3);}(_0xbf70,0x131));var _0x0bf7=function(_0x246508,_0x2e55ce){_0x246508=_0x246508-0x0;var _0x20d281=_0xbf70[_0x246508];return _0x20d281;};'use strict';var _=require(_0x0bf7('0x0'));var util=require('util');var moment=require(_0x0bf7('0x1'));var BPromise=require(_0x0bf7('0x2'));var rs=require(_0x0bf7('0x3'));var fs=require('fs');var Redis=require(_0x0bf7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bf7('0x5'));var logger=require(_0x0bf7('0x6'))('rpc');var config=require(_0x0bf7('0x7'));var jayson=require(_0x0bf7('0x8'));var client=jayson['client'][_0x0bf7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d765e,_0xe94212,_0x23c7e7){return new BPromise(function(_0x3e13b0,_0x1c8278){return client[_0x0bf7('0xa')](_0x4d765e,_0x23c7e7)[_0x0bf7('0xb')](function(_0x1c3f08){logger[_0x0bf7('0xc')](_0x0bf7('0xd'),_0xe94212,_0x0bf7('0xe'));logger[_0x0bf7('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xe94212,_0x0bf7('0xe'),JSON[_0x0bf7('0x10')](_0x1c3f08));if(_0x1c3f08[_0x0bf7('0x11')]){if(_0x1c3f08[_0x0bf7('0x11')][_0x0bf7('0x12')]===0x1f4){logger[_0x0bf7('0x11')](_0x0bf7('0xd'),_0xe94212,_0x1c3f08[_0x0bf7('0x11')][_0x0bf7('0x13')]);return _0x1c8278(_0x1c3f08[_0x0bf7('0x11')][_0x0bf7('0x13')]);}logger[_0x0bf7('0x11')](_0x0bf7('0xd'),_0xe94212,_0x1c3f08['error'][_0x0bf7('0x13')]);return _0x3e13b0(_0x1c3f08[_0x0bf7('0x11')][_0x0bf7('0x13')]);}else{logger[_0x0bf7('0xc')](_0x0bf7('0xd'),_0xe94212,_0x0bf7('0xe'));_0x3e13b0(_0x1c3f08[_0x0bf7('0x14')]['message']);}})[_0x0bf7('0x15')](function(_0x304f08){logger['error'](_0x0bf7('0xd'),_0xe94212,_0x304f08);_0x1c8278(_0x304f08);});});} \ No newline at end of file +var _0xbfca=['client','http','then','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x4b4e82,_0x1affdc){var _0x43d5fe=function(_0x1a814b){while(--_0x1a814b){_0x4b4e82['push'](_0x4b4e82['shift']());}};_0x43d5fe(++_0x1affdc);}(_0xbfca,0x139));var _0xabfc=function(_0xbfdd53,_0x252e09){_0xbfdd53=_0xbfdd53-0x0;var _0x17ef24=_0xbfca[_0xbfdd53];return _0x17ef24;};'use strict';var _=require(_0xabfc('0x0'));var util=require(_0xabfc('0x1'));var moment=require(_0xabfc('0x2'));var BPromise=require('bluebird');var rs=require(_0xabfc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xabfc('0x4'))['db'];var utils=require(_0xabfc('0x5'));var logger=require('../../config/logger')(_0xabfc('0x6'));var config=require(_0xabfc('0x7'));var jayson=require(_0xabfc('0x8'));var client=jayson[_0xabfc('0x9')][_0xabfc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc066bc,_0x5cf852,_0x206884){return new BPromise(function(_0x49538c,_0x16f3bf){return client['request'](_0xc066bc,_0x206884)[_0xabfc('0xb')](function(_0xb4fa89){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x5cf852,_0xabfc('0xc'));logger[_0xabfc('0xd')](_0xabfc('0xe'),_0x5cf852,_0xabfc('0xc'),JSON[_0xabfc('0xf')](_0xb4fa89));if(_0xb4fa89[_0xabfc('0x10')]){if(_0xb4fa89[_0xabfc('0x10')][_0xabfc('0x11')]===0x1f4){logger[_0xabfc('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x5cf852,_0xb4fa89[_0xabfc('0x10')]['message']);return _0x16f3bf(_0xb4fa89[_0xabfc('0x10')]['message']);}logger[_0xabfc('0x10')](_0xabfc('0x12'),_0x5cf852,_0xb4fa89[_0xabfc('0x10')][_0xabfc('0x13')]);return _0x49538c(_0xb4fa89[_0xabfc('0x10')]['message']);}else{logger[_0xabfc('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x5cf852,_0xabfc('0xc'));_0x49538c(_0xb4fa89[_0xabfc('0x15')][_0xabfc('0x13')]);}})[_0xabfc('0x16')](function(_0x14d51d){logger[_0xabfc('0x10')](_0xabfc('0x12'),_0x5cf852,_0x14d51d);_0x16f3bf(_0x14d51d);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 904445f..9b172e8 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 _0x5c05=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x408a6c,_0x14dc74){var _0x343ee3=function(_0x1bd44a){while(--_0x1bd44a){_0x408a6c['push'](_0x408a6c['shift']());}};_0x343ee3(++_0x14dc74);}(_0x5c05,0x89));var _0x55c0=function(_0x25adba,_0x4d7fe6){_0x25adba=_0x25adba-0x0;var _0x34fd87=_0x5c05[_0x25adba];return _0x34fd87;};'use strict';var multer=require(_0x55c0('0x0'));var util=require(_0x55c0('0x1'));var path=require(_0x55c0('0x2'));var timeout=require(_0x55c0('0x3'));var express=require('express');var router=express[_0x55c0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x55c0('0x5'));var config=require(_0x55c0('0x6'));var controller=require(_0x55c0('0x7'));router[_0x55c0('0x8')]('/',auth['isAuthenticated'](),controller[_0x55c0('0x9')]);router[_0x55c0('0x8')](_0x55c0('0xa'),auth[_0x55c0('0xb')](),controller[_0x55c0('0xc')]);router[_0x55c0('0x8')](_0x55c0('0xd'),auth[_0x55c0('0xb')](),controller[_0x55c0('0xe')]);router[_0x55c0('0xf')]('/',auth['isAuthenticated'](),controller[_0x55c0('0x10')]);router[_0x55c0('0x11')]('/:id',auth[_0x55c0('0xb')](),controller[_0x55c0('0x12')]);router[_0x55c0('0x13')](_0x55c0('0xd'),auth[_0x55c0('0xb')](),controller[_0x55c0('0x14')]);module[_0x55c0('0x15')]=router; \ No newline at end of file +var _0x7f4a=['index','get','/describe','/:id','show','update','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated'];(function(_0x335749,_0x3e1ad8){var _0x4bd164=function(_0x3c63da){while(--_0x3c63da){_0x335749['push'](_0x335749['shift']());}};_0x4bd164(++_0x3e1ad8);}(_0x7f4a,0xc3));var _0xa7f4=function(_0x51a9d0,_0xbebd29){_0x51a9d0=_0x51a9d0-0x0;var _0x4db0ee=_0x7f4a[_0x51a9d0];return _0x4db0ee;};'use strict';var multer=require('multer');var util=require(_0xa7f4('0x0'));var path=require(_0xa7f4('0x1'));var timeout=require('connect-timeout');var express=require(_0xa7f4('0x2'));var router=express[_0xa7f4('0x3')]();var auth=require(_0xa7f4('0x4'));var interaction=require(_0xa7f4('0x5'));var config=require(_0xa7f4('0x6'));var controller=require(_0xa7f4('0x7'));router['get']('/',auth[_0xa7f4('0x8')](),controller[_0xa7f4('0x9')]);router[_0xa7f4('0xa')](_0xa7f4('0xb'),auth[_0xa7f4('0x8')](),controller['describe']);router[_0xa7f4('0xa')](_0xa7f4('0xc'),auth[_0xa7f4('0x8')](),controller[_0xa7f4('0xd')]);router['post']('/',auth[_0xa7f4('0x8')](),controller['create']);router['put'](_0xa7f4('0xc'),auth['isAuthenticated'](),controller[_0xa7f4('0xe')]);router['delete'](_0xa7f4('0xc'),auth['isAuthenticated'](),controller[_0xa7f4('0xf')]);module[_0xa7f4('0x10')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index f88b3a6..ab31b28 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 _0xdbbe=['talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]'];(function(_0x21b1a0,_0xa08791){var _0x1c4e78=function(_0xf7348){while(--_0xf7348){_0x21b1a0['push'](_0x21b1a0['shift']());}};_0x1c4e78(++_0xa08791);}(_0xdbbe,0x134));var _0xedbb=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0xdbbe[_0x737a1f];return _0x16eba1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xedbb('0x0'));module['exports']={'channel':{'type':Sequelize[_0xedbb('0x1')]},'membername':{'type':Sequelize[_0xedbb('0x1')]},'interface':{'type':Sequelize[_0xedbb('0x1')]},'type':{'type':Sequelize[_0xedbb('0x1')],'defaultValue':_0xedbb('0x2'),'comment':_0xedbb('0x3')},'duration':{'type':Sequelize[_0xedbb('0x4')]},'enterAt':{'type':Sequelize[_0xedbb('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x1e7ebf){var _0x33c191=moment(_0x1e7ebf);var _0x564b32=moment(this[_0xedbb('0x6')]('enterAt'));var _0xfee823=_0x33c191['diff'](_0x564b32,_0xedbb('0x7'));this[_0xedbb('0x8')](_0xedbb('0x9'),_0x1e7ebf);this['setDataValue'](_0xedbb('0xa'),_0xfee823||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xedbb('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0xedbb('0xc')},'data3':{'type':Sequelize[_0xedbb('0x1')],'comment':_0xedbb('0xd')},'data4':{'type':Sequelize[_0xedbb('0x1')],'comment':_0xedbb('0xe')},'data5':{'type':Sequelize[_0xedbb('0x1')],'comment':_0xedbb('0xf')},'role':{'type':Sequelize[_0xedbb('0x1')]},'internal':{'type':Sequelize[_0xedbb('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xb563=['exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','setDataValue','exitAt','duration','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment'];(function(_0x8f385a,_0x34a09a){var _0x3f2c76=function(_0x4b838c){while(--_0x4b838c){_0x8f385a['push'](_0x8f385a['shift']());}};_0x3f2c76(++_0x34a09a);}(_0xb563,0xb4));var _0x3b56=function(_0x4eac29,_0x2ac1cf){_0x4eac29=_0x4eac29-0x0;var _0xd0d6d5=_0xb563[_0x4eac29];return _0xd0d6d5;};'use strict';var Sequelize=require(_0x3b56('0x0'));var moment=require(_0x3b56('0x1'));module[_0x3b56('0x2')]={'channel':{'type':Sequelize[_0x3b56('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3b56('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x3b56('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3b56('0x5')],'set':function(_0x1c47b2){var _0x14f215=moment(_0x1c47b2);var _0x35b1a2=moment(this[_0x3b56('0x6')]('enterAt'));var _0x11ab74=_0x14f215['diff'](_0x35b1a2,'seconds');this[_0x3b56('0x7')](_0x3b56('0x8'),_0x1c47b2);this[_0x3b56('0x7')](_0x3b56('0x9'),_0x11ab74||null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x3b56('0x3')],'comment':_0x3b56('0xa')},'data4':{'type':Sequelize['STRING'],'comment':_0x3b56('0xb')},'data5':{'type':Sequelize[_0x3b56('0x3')],'comment':_0x3b56('0xc')},'role':{'type':Sequelize[_0x3b56('0x3')]},'internal':{'type':Sequelize[_0x3b56('0xd')]},'uniqueid':{'type':Sequelize[_0x3b56('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 6aa540d..4fc203f 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 _0x087e=['../../config/utils','../../mysqldb','sendStatus','status','offset','Content-Range','json','apply','update','then','destroy','error','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','show','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x087e,0x1e9));var _0xe087=function(_0x3c86b4,_0x431782){_0x3c86b4=_0x3c86b4-0x0;var _0x268334=_0x087e[_0x3c86b4];return _0x268334;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe087('0x0'));var rimraf=require(_0xe087('0x1'));var zipdir=require(_0xe087('0x2'));var jsonpatch=require(_0xe087('0x3'));var rp=require(_0xe087('0x4'));var moment=require(_0xe087('0x5'));var BPromise=require(_0xe087('0x6'));var Mustache=require(_0xe087('0x7'));var util=require(_0xe087('0x8'));var path=require(_0xe087('0x9'));var sox=require(_0xe087('0xa'));var csv=require(_0xe087('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe087('0xc'));var squel=require('squel');var crypto=require(_0xe087('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe087('0xe'));var toCsv=require(_0xe087('0xb'));var querystring=require(_0xe087('0xf'));var Papa=require(_0xe087('0x10'));var Redis=require(_0xe087('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe087('0x12'));var as=require(_0xe087('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe087('0x14'))(_0xe087('0x15'));var utils=require(_0xe087('0x16'));var config=require('../../config/environment');var db=require(_0xe087('0x17'))['db'];function respondWithStatusCode(_0x15a4be,_0x401321){_0x401321=_0x401321||0xcc;return function(_0xa6d303){if(_0xa6d303){return _0x15a4be[_0xe087('0x18')](_0x401321);}return _0x15a4be[_0xe087('0x19')](_0x401321)['end']();};}function respondWithResult(_0x5d235e,_0x195a8a){_0x195a8a=_0x195a8a||0xc8;return function(_0x18b15c){if(_0x18b15c){return _0x5d235e[_0xe087('0x19')](_0x195a8a)['json'](_0x18b15c);}};}function respondWithFilteredResult(_0x397d42,_0x729bd5){return function(_0x29bacd){if(_0x29bacd){var _0x1b17f2=_0x29bacd['count'],_0x37a63f=_0x729bd5[_0xe087('0x1a')],_0x23970e=_0x729bd5[_0xe087('0x1a')]+_0x729bd5['limit'],_0x3d18e6;if(_0x23970e>=_0x1b17f2){_0x23970e=_0x1b17f2;_0x3d18e6=0xc8;}else{_0x3d18e6=0xce;}_0x397d42[_0xe087('0x19')](_0x3d18e6);return _0x397d42['set'](_0xe087('0x1b'),_0x37a63f+'-'+_0x23970e+'/'+_0x1b17f2)[_0xe087('0x1c')](_0x29bacd);}return null;};}function patchUpdates(_0x50af7d){return function(_0x435459){try{jsonpatch[_0xe087('0x1d')](_0x435459,_0x50af7d,!![]);}catch(_0xe71b04){return BPromise['reject'](_0xe71b04);}return _0x435459['save']();};}function saveUpdates(_0xeea44,_0x1dc9f3){return function(_0x2d88aa){if(_0x2d88aa){return _0x2d88aa[_0xe087('0x1e')](_0xeea44)[_0xe087('0x1f')](function(_0x2308f1){return _0x2308f1;});}return null;};}function removeEntity(_0x76ffd6,_0x22df03){return function(_0x2bee0a){if(_0x2bee0a){return _0x2bee0a[_0xe087('0x20')]()[_0xe087('0x1f')](function(){_0x76ffd6[_0xe087('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b173a,_0x27045f){return function(_0xa46c5a){if(!_0xa46c5a){_0x1b173a[_0xe087('0x18')](0x194);}return _0xa46c5a;};}function handleError(_0x2093f7,_0x40843c){_0x40843c=_0x40843c||0x1f4;return function(_0x211f67){logger[_0xe087('0x21')](_0x211f67['stack']);if(_0x211f67[_0xe087('0x22')]){delete _0x211f67[_0xe087('0x22')];}_0x2093f7['status'](_0x40843c)[_0xe087('0x23')](_0x211f67);};}exports[_0xe087('0x24')]=function(_0x25d209,_0x4cf1d2){var _0x3d3192={},_0x29b57d={},_0x4c6117={'count':0x0,'rows':[]};var _0xe611e8=_[_0xe087('0x25')](db[_0xe087('0x26')][_0xe087('0x27')],function(_0x50c79e){return{'name':_0x50c79e[_0xe087('0x28')],'type':_0x50c79e[_0xe087('0x29')][_0xe087('0x2a')]};});_0x29b57d[_0xe087('0x2b')]=_[_0xe087('0x25')](_0xe611e8,_0xe087('0x22'));_0x29b57d[_0xe087('0x2c')]=_[_0xe087('0x2d')](_0x25d209[_0xe087('0x2c')]);_0x29b57d[_0xe087('0x2e')]=_[_0xe087('0x2f')](_0x29b57d[_0xe087('0x2b')],_0x29b57d[_0xe087('0x2c')]);_0x3d3192[_0xe087('0x30')]=_['intersection'](_0x29b57d[_0xe087('0x2b')],qs['fields'](_0x25d209['query'][_0xe087('0x31')]));_0x3d3192['attributes']=_0x3d3192['attributes'][_0xe087('0x32')]?_0x3d3192[_0xe087('0x30')]:_0x29b57d[_0xe087('0x2b')];if(!_0x25d209['query'][_0xe087('0x33')](_0xe087('0x34'))){_0x3d3192[_0xe087('0x35')]=qs[_0xe087('0x35')](_0x25d209[_0xe087('0x2c')][_0xe087('0x35')]);_0x3d3192[_0xe087('0x1a')]=qs[_0xe087('0x1a')](_0x25d209[_0xe087('0x2c')]['offset']);}_0x3d3192[_0xe087('0x36')]=qs[_0xe087('0x37')](_0x25d209['query'][_0xe087('0x37')]);_0x3d3192[_0xe087('0x38')]=qs[_0xe087('0x2e')](_[_0xe087('0x39')](_0x25d209[_0xe087('0x2c')],_0x29b57d[_0xe087('0x2e')]),_0xe611e8);if(_0x25d209[_0xe087('0x2c')][_0xe087('0x3a')]){_0x3d3192[_0xe087('0x38')]=_[_0xe087('0x3b')](_0x3d3192['where'],{'$or':_['map'](_0xe611e8,function(_0x453db8){if(_0x453db8[_0xe087('0x29')]!==_0xe087('0x3c')){var _0x5c82f8={};_0x5c82f8[_0x453db8['name']]={'$like':'%'+_0x25d209[_0xe087('0x2c')][_0xe087('0x3a')]+'%'};return _0x5c82f8;}})});}_0x3d3192=_[_0xe087('0x3b')]({},_0x3d3192,_0x25d209['options']);var _0x23289e={'where':_0x3d3192['where']};return db[_0xe087('0x26')][_0xe087('0x3d')](_0x23289e)[_0xe087('0x1f')](function(_0x4a3a25){_0x4c6117[_0xe087('0x3d')]=_0x4a3a25;if(_0x25d209[_0xe087('0x2c')][_0xe087('0x3e')]){_0x3d3192[_0xe087('0x3f')]=[{'all':!![]}];}return db[_0xe087('0x26')][_0xe087('0x40')](_0x3d3192);})[_0xe087('0x1f')](function(_0xeeacfe){_0x4c6117[_0xe087('0x41')]=_0xeeacfe;return _0x4c6117;})[_0xe087('0x1f')](respondWithFilteredResult(_0x4cf1d2,_0x3d3192))['catch'](handleError(_0x4cf1d2,null));};exports[_0xe087('0x42')]=function(_0x56287d,_0x323d8d){var _0x123c36={'raw':!![],'where':{'id':_0x56287d['params']['id']}},_0x55e1bb={};_0x55e1bb[_0xe087('0x2b')]=_[_0xe087('0x2d')](db['MemberReport'][_0xe087('0x27')]);_0x55e1bb[_0xe087('0x2c')]=_[_0xe087('0x2d')](_0x56287d[_0xe087('0x2c')]);_0x55e1bb[_0xe087('0x2e')]=_[_0xe087('0x2f')](_0x55e1bb[_0xe087('0x2b')],_0x55e1bb[_0xe087('0x2c')]);_0x123c36['attributes']=_[_0xe087('0x2f')](_0x55e1bb[_0xe087('0x2b')],qs[_0xe087('0x31')](_0x56287d[_0xe087('0x2c')][_0xe087('0x31')]));_0x123c36[_0xe087('0x30')]=_0x123c36[_0xe087('0x30')][_0xe087('0x32')]?_0x123c36[_0xe087('0x30')]:_0x55e1bb[_0xe087('0x2b')];if(_0x56287d[_0xe087('0x2c')][_0xe087('0x3e')]){_0x123c36[_0xe087('0x3f')]=[{'all':!![]}];}_0x123c36=_['merge']({},_0x123c36,_0x56287d[_0xe087('0x43')]);return db[_0xe087('0x26')][_0xe087('0x44')](_0x123c36)['then'](handleEntityNotFound(_0x323d8d,null))[_0xe087('0x1f')](respondWithResult(_0x323d8d,null))[_0xe087('0x45')](handleError(_0x323d8d,null));};exports[_0xe087('0x46')]=function(_0x44ddd8,_0x422c55){return db['MemberReport'][_0xe087('0x46')](_0x44ddd8[_0xe087('0x47')],{})[_0xe087('0x1f')](respondWithResult(_0x422c55,0xc9))['catch'](handleError(_0x422c55,null));};exports[_0xe087('0x1e')]=function(_0x42c8a0,_0x5ebde9){if(_0x42c8a0['body']['id']){delete _0x42c8a0[_0xe087('0x47')]['id'];}return db[_0xe087('0x26')][_0xe087('0x44')]({'where':{'id':_0x42c8a0[_0xe087('0x48')]['id']}})[_0xe087('0x1f')](handleEntityNotFound(_0x5ebde9,null))[_0xe087('0x1f')](saveUpdates(_0x42c8a0[_0xe087('0x47')],null))[_0xe087('0x1f')](respondWithResult(_0x5ebde9,null))['catch'](handleError(_0x5ebde9,null));};exports['destroy']=function(_0x741af0,_0x423573){return db[_0xe087('0x26')][_0xe087('0x44')]({'where':{'id':_0x741af0[_0xe087('0x48')]['id']}})[_0xe087('0x1f')](handleEntityNotFound(_0x423573,null))[_0xe087('0x1f')](removeEntity(_0x423573,null))['catch'](handleError(_0x423573,null));};exports['describe']=function(_0xfa58b8,_0x3eb7b7){return db['MemberReport']['describe']()[_0xe087('0x1f')](respondWithResult(_0x3eb7b7,null))[_0xe087('0x45')](handleError(_0x3eb7b7,null));}; \ No newline at end of file +var _0xefc7=['fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','count','includeAll','findAll','catch','show','params','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','MemberReport','rawAttributes'];(function(_0x4b9b3e,_0x3d5ed0){var _0x4465e5=function(_0xc11da){while(--_0xc11da){_0x4b9b3e['push'](_0x4b9b3e['shift']());}};_0x4465e5(++_0x3d5ed0);}(_0xefc7,0x1cc));var _0x7efc=function(_0x559e22,_0x40739d){_0x559e22=_0x559e22-0x0;var _0x5bfc2d=_0xefc7[_0x559e22];return _0x5bfc2d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7efc('0x0'));var rimraf=require(_0x7efc('0x1'));var zipdir=require(_0x7efc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7efc('0x3'));var moment=require(_0x7efc('0x4'));var BPromise=require(_0x7efc('0x5'));var Mustache=require(_0x7efc('0x6'));var util=require(_0x7efc('0x7'));var path=require('path');var sox=require(_0x7efc('0x8'));var csv=require(_0x7efc('0x9'));var ejs=require(_0x7efc('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7efc('0xb'));var crypto=require(_0x7efc('0xc'));var jsforce=require(_0x7efc('0xd'));var deskjs=require(_0x7efc('0xe'));var toCsv=require(_0x7efc('0x9'));var querystring=require('querystring');var Papa=require(_0x7efc('0xf'));var Redis=require(_0x7efc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7efc('0x11'));var as=require(_0x7efc('0x12'));var hardwareService=require(_0x7efc('0x13'));var logger=require('../../config/logger')(_0x7efc('0x14'));var utils=require(_0x7efc('0x15'));var config=require(_0x7efc('0x16'));var db=require(_0x7efc('0x17'))['db'];function respondWithStatusCode(_0x59198b,_0x588ace){_0x588ace=_0x588ace||0xcc;return function(_0x17d4a0){if(_0x17d4a0){return _0x59198b[_0x7efc('0x18')](_0x588ace);}return _0x59198b[_0x7efc('0x19')](_0x588ace)['end']();};}function respondWithResult(_0x19ea63,_0xbfdc69){_0xbfdc69=_0xbfdc69||0xc8;return function(_0x220749){if(_0x220749){return _0x19ea63[_0x7efc('0x19')](_0xbfdc69)[_0x7efc('0x1a')](_0x220749);}};}function respondWithFilteredResult(_0x52b723,_0x584664){return function(_0x30cd21){if(_0x30cd21){var _0x276699=_0x30cd21['count'],_0x3d14f3=_0x584664['offset'],_0xf37f61=_0x584664[_0x7efc('0x1b')]+_0x584664[_0x7efc('0x1c')],_0x1f39ff;if(_0xf37f61>=_0x276699){_0xf37f61=_0x276699;_0x1f39ff=0xc8;}else{_0x1f39ff=0xce;}_0x52b723[_0x7efc('0x19')](_0x1f39ff);return _0x52b723[_0x7efc('0x1d')](_0x7efc('0x1e'),_0x3d14f3+'-'+_0xf37f61+'/'+_0x276699)[_0x7efc('0x1a')](_0x30cd21);}return null;};}function patchUpdates(_0x1f7076){return function(_0x3f6afa){try{jsonpatch[_0x7efc('0x1f')](_0x3f6afa,_0x1f7076,!![]);}catch(_0x344836){return BPromise[_0x7efc('0x20')](_0x344836);}return _0x3f6afa[_0x7efc('0x21')]();};}function saveUpdates(_0x24bceb,_0x3e79dc){return function(_0x2b9b24){if(_0x2b9b24){return _0x2b9b24[_0x7efc('0x22')](_0x24bceb)['then'](function(_0x4222d5){return _0x4222d5;});}return null;};}function removeEntity(_0x194bcd,_0x3a8483){return function(_0x763209){if(_0x763209){return _0x763209[_0x7efc('0x23')]()[_0x7efc('0x24')](function(){_0x194bcd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57a4ee,_0x25491f){return function(_0x4a63cc){if(!_0x4a63cc){_0x57a4ee[_0x7efc('0x18')](0x194);}return _0x4a63cc;};}function handleError(_0x49b22b,_0x380be6){_0x380be6=_0x380be6||0x1f4;return function(_0x187e5a){logger[_0x7efc('0x25')](_0x187e5a[_0x7efc('0x26')]);if(_0x187e5a[_0x7efc('0x27')]){delete _0x187e5a[_0x7efc('0x27')];}_0x49b22b['status'](_0x380be6)[_0x7efc('0x28')](_0x187e5a);};}exports['index']=function(_0x416442,_0x194393){var _0x3f634e={},_0x2ed5cd={},_0x2d7411={'count':0x0,'rows':[]};var _0x3861e6=_[_0x7efc('0x29')](db[_0x7efc('0x2a')][_0x7efc('0x2b')],function(_0x1cef84){return{'name':_0x1cef84[_0x7efc('0x2c')],'type':_0x1cef84[_0x7efc('0x2d')][_0x7efc('0x2e')]};});_0x2ed5cd[_0x7efc('0x2f')]=_[_0x7efc('0x29')](_0x3861e6,_0x7efc('0x27'));_0x2ed5cd['query']=_['keys'](_0x416442[_0x7efc('0x30')]);_0x2ed5cd[_0x7efc('0x31')]=_[_0x7efc('0x32')](_0x2ed5cd[_0x7efc('0x2f')],_0x2ed5cd[_0x7efc('0x30')]);_0x3f634e['attributes']=_[_0x7efc('0x32')](_0x2ed5cd[_0x7efc('0x2f')],qs['fields'](_0x416442[_0x7efc('0x30')][_0x7efc('0x33')]));_0x3f634e[_0x7efc('0x34')]=_0x3f634e[_0x7efc('0x34')][_0x7efc('0x35')]?_0x3f634e['attributes']:_0x2ed5cd[_0x7efc('0x2f')];if(!_0x416442['query'][_0x7efc('0x36')](_0x7efc('0x37'))){_0x3f634e['limit']=qs[_0x7efc('0x1c')](_0x416442[_0x7efc('0x30')][_0x7efc('0x1c')]);_0x3f634e[_0x7efc('0x1b')]=qs[_0x7efc('0x1b')](_0x416442[_0x7efc('0x30')][_0x7efc('0x1b')]);}_0x3f634e['order']=qs[_0x7efc('0x38')](_0x416442['query'][_0x7efc('0x38')]);_0x3f634e[_0x7efc('0x39')]=qs[_0x7efc('0x31')](_['pick'](_0x416442['query'],_0x2ed5cd['filters']),_0x3861e6);if(_0x416442[_0x7efc('0x30')][_0x7efc('0x3a')]){_0x3f634e[_0x7efc('0x39')]=_['merge'](_0x3f634e[_0x7efc('0x39')],{'$or':_['map'](_0x3861e6,function(_0x14605d){if(_0x14605d['type']!==_0x7efc('0x3b')){var _0x5895d0={};_0x5895d0[_0x14605d[_0x7efc('0x27')]]={'$like':'%'+_0x416442[_0x7efc('0x30')]['filter']+'%'};return _0x5895d0;}})});}_0x3f634e=_['merge']({},_0x3f634e,_0x416442[_0x7efc('0x3c')]);var _0x50e19b={'where':_0x3f634e[_0x7efc('0x39')]};return db[_0x7efc('0x2a')][_0x7efc('0x3d')](_0x50e19b)['then'](function(_0x5c91dd){_0x2d7411[_0x7efc('0x3d')]=_0x5c91dd;if(_0x416442[_0x7efc('0x30')][_0x7efc('0x3e')]){_0x3f634e['include']=[{'all':!![]}];}return db[_0x7efc('0x2a')][_0x7efc('0x3f')](_0x3f634e);})[_0x7efc('0x24')](function(_0x2169e0){_0x2d7411['rows']=_0x2169e0;return _0x2d7411;})['then'](respondWithFilteredResult(_0x194393,_0x3f634e))[_0x7efc('0x40')](handleError(_0x194393,null));};exports[_0x7efc('0x41')]=function(_0x5b57f8,_0x575f59){var _0x4acb32={'raw':!![],'where':{'id':_0x5b57f8[_0x7efc('0x42')]['id']}},_0x2c8c4b={};_0x2c8c4b[_0x7efc('0x2f')]=_['keys'](db[_0x7efc('0x2a')][_0x7efc('0x2b')]);_0x2c8c4b[_0x7efc('0x30')]=_['keys'](_0x5b57f8[_0x7efc('0x30')]);_0x2c8c4b[_0x7efc('0x31')]=_[_0x7efc('0x32')](_0x2c8c4b[_0x7efc('0x2f')],_0x2c8c4b[_0x7efc('0x30')]);_0x4acb32['attributes']=_['intersection'](_0x2c8c4b[_0x7efc('0x2f')],qs[_0x7efc('0x33')](_0x5b57f8[_0x7efc('0x30')][_0x7efc('0x33')]));_0x4acb32[_0x7efc('0x34')]=_0x4acb32[_0x7efc('0x34')][_0x7efc('0x35')]?_0x4acb32[_0x7efc('0x34')]:_0x2c8c4b['model'];if(_0x5b57f8['query'][_0x7efc('0x3e')]){_0x4acb32[_0x7efc('0x43')]=[{'all':!![]}];}_0x4acb32=_['merge']({},_0x4acb32,_0x5b57f8[_0x7efc('0x3c')]);return db['MemberReport'][_0x7efc('0x44')](_0x4acb32)[_0x7efc('0x24')](handleEntityNotFound(_0x575f59,null))[_0x7efc('0x24')](respondWithResult(_0x575f59,null))['catch'](handleError(_0x575f59,null));};exports[_0x7efc('0x45')]=function(_0x4a49b1,_0x48154b){return db[_0x7efc('0x2a')]['create'](_0x4a49b1[_0x7efc('0x46')],{})[_0x7efc('0x24')](respondWithResult(_0x48154b,0xc9))['catch'](handleError(_0x48154b,null));};exports[_0x7efc('0x22')]=function(_0x9a1b0,_0x3edb6b){if(_0x9a1b0[_0x7efc('0x46')]['id']){delete _0x9a1b0['body']['id'];}return db[_0x7efc('0x2a')]['find']({'where':{'id':_0x9a1b0[_0x7efc('0x42')]['id']}})['then'](handleEntityNotFound(_0x3edb6b,null))['then'](saveUpdates(_0x9a1b0[_0x7efc('0x46')],null))[_0x7efc('0x24')](respondWithResult(_0x3edb6b,null))[_0x7efc('0x40')](handleError(_0x3edb6b,null));};exports[_0x7efc('0x23')]=function(_0x2cc2ad,_0x3c23ea){return db[_0x7efc('0x2a')][_0x7efc('0x44')]({'where':{'id':_0x2cc2ad[_0x7efc('0x42')]['id']}})[_0x7efc('0x24')](handleEntityNotFound(_0x3c23ea,null))[_0x7efc('0x24')](removeEntity(_0x3c23ea,null))[_0x7efc('0x40')](handleError(_0x3c23ea,null));};exports[_0x7efc('0x47')]=function(_0x41438f,_0x3bbd17){return db[_0x7efc('0x2a')][_0x7efc('0x47')]()['then'](respondWithResult(_0x3bbd17,null))[_0x7efc('0x40')](handleError(_0x3bbd17,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 34d2335..f1e6e99 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 _0xb66c=['rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xb66c,0x175));var _0xcb66=function(_0x1cba9e,_0x1d8a1e){_0x1cba9e=_0x1cba9e-0x0;var _0x31d48f=_0xb66c[_0x1cba9e];return _0x31d48f;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var logger=require(_0xcb66('0x1'))('api');var moment=require(_0xcb66('0x2'));var BPromise=require(_0xcb66('0x3'));var rp=require(_0xcb66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var attributes=require(_0xcb66('0x7'));module[_0xcb66('0x8')]=function(_0x5d766d,_0x518163){return _0x5d766d[_0xcb66('0x9')](_0xcb66('0xa'),attributes,{'tableName':_0xcb66('0xb'),'paranoid':![],'indexes':[{'name':_0xcb66('0xc'),'fields':[_0xcb66('0xd'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0x44e8=['define','MemberReport','report_member','membername','interface','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./memberReport.attributes','exports'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0x44e8,0xd7));var _0x844e=function(_0x1f4f08,_0x45890f){_0x1f4f08=_0x1f4f08-0x0;var _0x504c9d=_0x44e8[_0x1f4f08];return _0x504c9d;};'use strict';var _=require(_0x844e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x844e('0x1'));var moment=require(_0x844e('0x2'));var BPromise=require(_0x844e('0x3'));var rp=require(_0x844e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var attributes=require(_0x844e('0x7'));module[_0x844e('0x8')]=function(_0x5c8f67,_0x2f6539){return _0x5c8f67[_0x844e('0x9')](_0x844e('0xa'),attributes,{'tableName':_0x844e('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x844e('0xc'),_0x844e('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 7b03b0e..24e03df 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 _0x9d57=['../../config/utils','../../config/environment','jayson/promise','client','http','request','info','debug','request\x20sent','error','code','MemberReport,\x20%s,\x20%s','message','findAll','options','where','attributes','limit','include','map','model','GetMemberReport','stringify','catch','create','body','then','CreateMemberReport','UpdateMemberReport','MemberReport','update','raw','util','moment','bluebird','ioredis'];(function(_0x19d63e,_0x5c4660){var _0x177476=function(_0x18111f){while(--_0x18111f){_0x19d63e['push'](_0x19d63e['shift']());}};_0x177476(++_0x5c4660);}(_0x9d57,0xd4));var _0x79d5=function(_0x1a23d6,_0x313608){_0x1a23d6=_0x1a23d6-0x0;var _0x2a835d=_0x9d57[_0x1a23d6];return _0x2a835d;};'use strict';var _=require('lodash');var util=require(_0x79d5('0x0'));var moment=require(_0x79d5('0x1'));var BPromise=require(_0x79d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x79d5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x79d5('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x79d5('0x5'));var jayson=require(_0x79d5('0x6'));var client=jayson[_0x79d5('0x7')][_0x79d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c536d,_0x2b5317,_0x4dd360){return new BPromise(function(_0x190e19,_0x40aa4f){return client[_0x79d5('0x9')](_0x1c536d,_0x4dd360)['then'](function(_0x3431aa){logger[_0x79d5('0xa')]('MemberReport,\x20%s,\x20%s',_0x2b5317,'request\x20sent');logger[_0x79d5('0xb')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x2b5317,_0x79d5('0xc'),JSON['stringify'](_0x3431aa));if(_0x3431aa[_0x79d5('0xd')]){if(_0x3431aa[_0x79d5('0xd')][_0x79d5('0xe')]===0x1f4){logger['error'](_0x79d5('0xf'),_0x2b5317,_0x3431aa[_0x79d5('0xd')][_0x79d5('0x10')]);return _0x40aa4f(_0x3431aa[_0x79d5('0xd')][_0x79d5('0x10')]);}logger[_0x79d5('0xd')](_0x79d5('0xf'),_0x2b5317,_0x3431aa['error'][_0x79d5('0x10')]);return _0x190e19(_0x3431aa['error'][_0x79d5('0x10')]);}else{logger[_0x79d5('0xa')]('MemberReport,\x20%s,\x20%s',_0x2b5317,_0x79d5('0xc'));_0x190e19(_0x3431aa['result'][_0x79d5('0x10')]);}})['catch'](function(_0x53010c){logger[_0x79d5('0xd')](_0x79d5('0xf'),_0x2b5317,_0x53010c);_0x40aa4f(_0x53010c);});});}exports['GetMemberReport']=function(_0x6ce22){var _0x1cce2a=this;return new Promise(function(_0x3020f8,_0x1e9427){return db['MemberReport'][_0x79d5('0x11')]({'raw':_0x6ce22[_0x79d5('0x12')]?_0x6ce22[_0x79d5('0x12')]['raw']===undefined?!![]:![]:!![],'where':_0x6ce22[_0x79d5('0x12')]?_0x6ce22[_0x79d5('0x12')][_0x79d5('0x13')]||null:null,'attributes':_0x6ce22['options']?_0x6ce22[_0x79d5('0x12')][_0x79d5('0x14')]||null:null,'limit':_0x6ce22[_0x79d5('0x12')]?_0x6ce22['options'][_0x79d5('0x15')]||null:null,'include':_0x6ce22['options']?_0x6ce22[_0x79d5('0x12')][_0x79d5('0x16')]?_[_0x79d5('0x17')](_0x6ce22[_0x79d5('0x12')][_0x79d5('0x16')],function(_0x184550){return{'model':db[_0x184550[_0x79d5('0x18')]],'as':_0x184550['as'],'attributes':_0x184550[_0x79d5('0x14')],'include':_0x184550[_0x79d5('0x16')]?_[_0x79d5('0x17')](_0x184550[_0x79d5('0x16')],function(_0x401b0c){return{'model':db[_0x401b0c[_0x79d5('0x18')]],'as':_0x401b0c['as'],'attributes':_0x401b0c[_0x79d5('0x14')],'include':_0x401b0c[_0x79d5('0x16')]?_[_0x79d5('0x17')](_0x401b0c[_0x79d5('0x16')],function(_0x534180){return{'model':db[_0x534180[_0x79d5('0x18')]],'as':_0x534180['as'],'attributes':_0x534180[_0x79d5('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xad4365){logger[_0x79d5('0xa')](_0x79d5('0x19'),_0x6ce22);logger[_0x79d5('0xb')]('GetMemberReport',_0x6ce22,JSON[_0x79d5('0x1a')](_0xad4365));_0x3020f8(_0xad4365);})[_0x79d5('0x1b')](function(_0x237949){logger[_0x79d5('0xd')](_0x79d5('0x19'),_0x237949['message'],_0x6ce22);_0x1e9427(_0x1cce2a[_0x79d5('0xd')](0x1f4,_0x237949[_0x79d5('0x10')]));});});};exports['CreateMemberReport']=function(_0x2f16a3){var _0x30de0f=this;return new Promise(function(_0x255893,_0x182b2e){return db['MemberReport'][_0x79d5('0x1c')](_0x2f16a3[_0x79d5('0x1d')],{'raw':_0x2f16a3[_0x79d5('0x12')]?_0x2f16a3[_0x79d5('0x12')]['raw']===undefined?!![]:![]:!![]})[_0x79d5('0x1e')](function(_0x42022a){logger[_0x79d5('0xa')]('CreateMemberReport',_0x2f16a3);logger['debug'](_0x79d5('0x1f'),_0x2f16a3,JSON[_0x79d5('0x1a')](_0x42022a));_0x255893(_0x42022a);})['catch'](function(_0x238289){logger[_0x79d5('0xd')](_0x79d5('0x1f'),_0x238289[_0x79d5('0x10')],_0x2f16a3);_0x182b2e(_0x30de0f['error'](0x1f4,_0x238289[_0x79d5('0x10')]));});});};exports[_0x79d5('0x20')]=function(_0x3fe2d9){var _0x4550f8=this;return new Promise(function(_0x5536c5,_0x4921fb){return db[_0x79d5('0x21')][_0x79d5('0x22')](_0x3fe2d9[_0x79d5('0x1d')],{'raw':_0x3fe2d9['options']?_0x3fe2d9[_0x79d5('0x12')][_0x79d5('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fe2d9[_0x79d5('0x12')]?_0x3fe2d9['options'][_0x79d5('0x13')]||null:null,'attributes':_0x3fe2d9['options']?_0x3fe2d9[_0x79d5('0x12')][_0x79d5('0x14')]||null:null,'limit':_0x3fe2d9[_0x79d5('0x12')]?_0x3fe2d9[_0x79d5('0x12')][_0x79d5('0x15')]||null:null})[_0x79d5('0x1e')](function(_0x3fcc11){logger[_0x79d5('0xa')](_0x79d5('0x20'),_0x3fe2d9);logger['debug'](_0x79d5('0x20'),_0x3fe2d9,JSON[_0x79d5('0x1a')](_0x3fcc11));_0x5536c5(_0x3fcc11);})[_0x79d5('0x1b')](function(_0x3794d0){logger[_0x79d5('0xd')]('UpdateMemberReport',_0x3794d0['message'],_0x3fe2d9);_0x4921fb(_0x4550f8['error'](0x1f4,_0x3794d0[_0x79d5('0x10')]));});});}; \ No newline at end of file +var _0x5ebd=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','model','include','debug','stringify','create','body','CreateMemberReport','UpdateMemberReport','lodash'];(function(_0x2a0419,_0x5556fa){var _0x20dec0=function(_0x4b13f6){while(--_0x4b13f6){_0x2a0419['push'](_0x2a0419['shift']());}};_0x20dec0(++_0x5556fa);}(_0x5ebd,0x97));var _0xd5eb=function(_0x4700d2,_0x38911c){_0x4700d2=_0x4700d2-0x0;var _0x37aa93=_0x5ebd[_0x4700d2];return _0x37aa93;};'use strict';var _=require(_0xd5eb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd5eb('0x1'));var rs=require(_0xd5eb('0x2'));var fs=require('fs');var Redis=require(_0xd5eb('0x3'));var db=require(_0xd5eb('0x4'))['db'];var utils=require(_0xd5eb('0x5'));var logger=require(_0xd5eb('0x6'))(_0xd5eb('0x7'));var config=require(_0xd5eb('0x8'));var jayson=require(_0xd5eb('0x9'));var client=jayson[_0xd5eb('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3bc7fb,_0xbcbcf3,_0x4b3e71){return new BPromise(function(_0x1a6e5f,_0x50bbef){return client[_0xd5eb('0xb')](_0x3bc7fb,_0x4b3e71)[_0xd5eb('0xc')](function(_0x71d411){logger[_0xd5eb('0xd')](_0xd5eb('0xe'),_0xbcbcf3,'request\x20sent');logger['debug'](_0xd5eb('0xf'),_0xbcbcf3,_0xd5eb('0x10'),JSON['stringify'](_0x71d411));if(_0x71d411[_0xd5eb('0x11')]){if(_0x71d411['error']['code']===0x1f4){logger[_0xd5eb('0x11')](_0xd5eb('0xe'),_0xbcbcf3,_0x71d411['error'][_0xd5eb('0x12')]);return _0x50bbef(_0x71d411[_0xd5eb('0x11')]['message']);}logger[_0xd5eb('0x11')](_0xd5eb('0xe'),_0xbcbcf3,_0x71d411['error']['message']);return _0x1a6e5f(_0x71d411['error'][_0xd5eb('0x12')]);}else{logger[_0xd5eb('0xd')](_0xd5eb('0xe'),_0xbcbcf3,_0xd5eb('0x10'));_0x1a6e5f(_0x71d411[_0xd5eb('0x13')]['message']);}})[_0xd5eb('0x14')](function(_0x27c2a8){logger[_0xd5eb('0x11')](_0xd5eb('0xe'),_0xbcbcf3,_0x27c2a8);_0x50bbef(_0x27c2a8);});});}exports[_0xd5eb('0x15')]=function(_0x4eb89d){var _0x4b4acd=this;return new Promise(function(_0x27e2d4,_0x5dc251){return db[_0xd5eb('0x16')][_0xd5eb('0x17')]({'raw':_0x4eb89d['options']?_0x4eb89d[_0xd5eb('0x18')][_0xd5eb('0x19')]===undefined?!![]:![]:!![],'where':_0x4eb89d[_0xd5eb('0x18')]?_0x4eb89d['options'][_0xd5eb('0x1a')]||null:null,'attributes':_0x4eb89d[_0xd5eb('0x18')]?_0x4eb89d[_0xd5eb('0x18')][_0xd5eb('0x1b')]||null:null,'limit':_0x4eb89d[_0xd5eb('0x18')]?_0x4eb89d[_0xd5eb('0x18')][_0xd5eb('0x1c')]||null:null,'include':_0x4eb89d['options']?_0x4eb89d[_0xd5eb('0x18')]['include']?_[_0xd5eb('0x1d')](_0x4eb89d[_0xd5eb('0x18')]['include'],function(_0x8bdc8a){return{'model':db[_0x8bdc8a[_0xd5eb('0x1e')]],'as':_0x8bdc8a['as'],'attributes':_0x8bdc8a['attributes'],'include':_0x8bdc8a[_0xd5eb('0x1f')]?_[_0xd5eb('0x1d')](_0x8bdc8a[_0xd5eb('0x1f')],function(_0x414b39){return{'model':db[_0x414b39[_0xd5eb('0x1e')]],'as':_0x414b39['as'],'attributes':_0x414b39[_0xd5eb('0x1b')],'include':_0x414b39[_0xd5eb('0x1f')]?_[_0xd5eb('0x1d')](_0x414b39[_0xd5eb('0x1f')],function(_0x8e50d9){return{'model':db[_0x8e50d9[_0xd5eb('0x1e')]],'as':_0x8e50d9['as'],'attributes':_0x8e50d9['attributes']};}):[]};}):[]};}):[]:[]})[_0xd5eb('0xc')](function(_0x14cc95){logger[_0xd5eb('0xd')](_0xd5eb('0x15'),_0x4eb89d);logger[_0xd5eb('0x20')]('GetMemberReport',_0x4eb89d,JSON[_0xd5eb('0x21')](_0x14cc95));_0x27e2d4(_0x14cc95);})[_0xd5eb('0x14')](function(_0x258883){logger['error'](_0xd5eb('0x15'),_0x258883[_0xd5eb('0x12')],_0x4eb89d);_0x5dc251(_0x4b4acd[_0xd5eb('0x11')](0x1f4,_0x258883['message']));});});};exports['CreateMemberReport']=function(_0x313e4f){var _0x42a3a8=this;return new Promise(function(_0x77e726,_0x291277){return db[_0xd5eb('0x16')][_0xd5eb('0x22')](_0x313e4f[_0xd5eb('0x23')],{'raw':_0x313e4f[_0xd5eb('0x18')]?_0x313e4f[_0xd5eb('0x18')][_0xd5eb('0x19')]===undefined?!![]:![]:!![]})[_0xd5eb('0xc')](function(_0x319486){logger[_0xd5eb('0xd')](_0xd5eb('0x24'),_0x313e4f);logger[_0xd5eb('0x20')]('CreateMemberReport',_0x313e4f,JSON['stringify'](_0x319486));_0x77e726(_0x319486);})[_0xd5eb('0x14')](function(_0x2a0525){logger[_0xd5eb('0x11')](_0xd5eb('0x24'),_0x2a0525['message'],_0x313e4f);_0x291277(_0x42a3a8['error'](0x1f4,_0x2a0525[_0xd5eb('0x12')]));});});};exports['UpdateMemberReport']=function(_0x23dd21){var _0x33c259=this;return new Promise(function(_0x519424,_0x4e9888){return db[_0xd5eb('0x16')]['update'](_0x23dd21[_0xd5eb('0x23')],{'raw':_0x23dd21['options']?_0x23dd21['options'][_0xd5eb('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23dd21[_0xd5eb('0x18')]?_0x23dd21[_0xd5eb('0x18')][_0xd5eb('0x1a')]||null:null,'attributes':_0x23dd21['options']?_0x23dd21['options'][_0xd5eb('0x1b')]||null:null,'limit':_0x23dd21['options']?_0x23dd21['options'][_0xd5eb('0x1c')]||null:null})['then'](function(_0x530862){logger[_0xd5eb('0xd')](_0xd5eb('0x25'),_0x23dd21);logger['debug'](_0xd5eb('0x25'),_0x23dd21,JSON[_0xd5eb('0x21')](_0x530862));_0x519424(_0x530862);})[_0xd5eb('0x14')](function(_0xc976e){logger[_0xd5eb('0x11')](_0xd5eb('0x25'),_0xc976e[_0xd5eb('0x12')],_0x23dd21);_0x4e9888(_0x33c259[_0xd5eb('0x11')](0x1f4,_0xc976e['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 85eaa76..44ef0e1 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 _0xb688=['express','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index','util','path','connect-timeout'];(function(_0x1d756f,_0x1eb94c){var _0x1adf5e=function(_0x4ffd73){while(--_0x4ffd73){_0x1d756f['push'](_0x1d756f['shift']());}};_0x1adf5e(++_0x1eb94c);}(_0xb688,0xcf));var _0x8b68=function(_0x212154,_0x425326){_0x212154=_0x212154-0x0;var _0x38a980=_0xb688[_0x212154];return _0x38a980;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var auth=require(_0x8b68('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8b68('0x6'));var controller=require(_0x8b68('0x7'));router[_0x8b68('0x8')]('/',controller[_0x8b68('0x9')]);module['exports']=router; \ No newline at end of file +var _0x4024=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./migration.controller'];(function(_0x3f9246,_0x3ef20e){var _0x17861a=function(_0x285e35){while(--_0x285e35){_0x3f9246['push'](_0x3f9246['shift']());}};_0x17861a(++_0x3ef20e);}(_0x4024,0x89));var _0x4402=function(_0x280527,_0x55e080){_0x280527=_0x280527-0x0;var _0x148371=_0x4024[_0x280527];return _0x148371;};'use strict';var multer=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var path=require('path');var timeout=require(_0x4402('0x2'));var express=require(_0x4402('0x3'));var router=express['Router']();var auth=require(_0x4402('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4402('0x5'));var controller=require(_0x4402('0x6'));router['get']('/',controller['index']);module[_0x4402('0x7')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 5fd7517..b01e1e7 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 _0x4740=['STRING','sequelize','exports'];(function(_0x1501d7,_0x2c6b1e){var _0x1e06c5=function(_0x160951){while(--_0x160951){_0x1501d7['push'](_0x1501d7['shift']());}};_0x1e06c5(++_0x2c6b1e);}(_0x4740,0x157));var _0x0474=function(_0x25fca8,_0x5d25d7){_0x25fca8=_0x25fca8-0x0;var _0xa0859=_0x4740[_0x25fca8];return _0xa0859;};'use strict';var Sequelize=require(_0x0474('0x0'));module[_0x0474('0x1')]={'version':{'type':Sequelize[_0x0474('0x2')],'unique':'version'}}; \ No newline at end of file +var _0x9ae5=['STRING','version','sequelize','exports'];(function(_0x5aca4b,_0x396c85){var _0x4610f0=function(_0x47165d){while(--_0x47165d){_0x5aca4b['push'](_0x5aca4b['shift']());}};_0x4610f0(++_0x396c85);}(_0x9ae5,0xee));var _0x59ae=function(_0x12fa53,_0x4c9469){_0x12fa53=_0x12fa53-0x0;var _0x39936b=_0x9ae5[_0x12fa53];return _0x39936b;};'use strict';var Sequelize=require(_0x59ae('0x0'));module[_0x59ae('0x1')]={'version':{'type':Sequelize[_0x59ae('0x2')],'unique':_0x59ae('0x3')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index fb6e9f5..85a8582 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 _0x4b84=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','count','offset','limit','set','Content-Range','reject','save','update','then','status','error','stack','name','index','map','Migration','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','html-pdf','eml-format','fast-json-patch','bluebird','mustache','util','ejs','squel','jsforce','querystring','papaparse','ioredis'];(function(_0x2fbd0e,_0x3460a9){var _0x481c9f=function(_0x4bc402){while(--_0x4bc402){_0x2fbd0e['push'](_0x2fbd0e['shift']());}};_0x481c9f(++_0x3460a9);}(_0x4b84,0x1cc));var _0x44b8=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x4b84[_0x550d12];return _0x12103d;};'use strict';var pdf=require(_0x44b8('0x0'));var emlformat=require(_0x44b8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x44b8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x44b8('0x3'));var Mustache=require(_0x44b8('0x4'));var util=require(_0x44b8('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x44b8('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x44b8('0x7'));var crypto=require('crypto');var jsforce=require(_0x44b8('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44b8('0x9'));var Papa=require(_0x44b8('0xa'));var Redis=require(_0x44b8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x44b8('0xc'));var as=require(_0x44b8('0xd'));var hardwareService=require(_0x44b8('0xe'));var logger=require(_0x44b8('0xf'))(_0x44b8('0x10'));var utils=require(_0x44b8('0x11'));var config=require(_0x44b8('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x147529,_0x4301a6){_0x4301a6=_0x4301a6||0xcc;return function(_0x4bcc43){if(_0x4bcc43){return _0x147529[_0x44b8('0x13')](_0x4301a6);}return _0x147529['status'](_0x4301a6)[_0x44b8('0x14')]();};}function respondWithResult(_0x18d642,_0x4df670){_0x4df670=_0x4df670||0xc8;return function(_0x63e8f6){if(_0x63e8f6){return _0x18d642['status'](_0x4df670)['json'](_0x63e8f6);}};}function respondWithFilteredResult(_0x2a3e4c,_0x2af0ad){return function(_0x1722da){if(_0x1722da){var _0x41ab46=_0x1722da[_0x44b8('0x15')],_0x5e52f2=_0x2af0ad['offset'],_0x495c74=_0x2af0ad[_0x44b8('0x16')]+_0x2af0ad[_0x44b8('0x17')],_0x5d6349;if(_0x495c74>=_0x41ab46){_0x495c74=_0x41ab46;_0x5d6349=0xc8;}else{_0x5d6349=0xce;}_0x2a3e4c['status'](_0x5d6349);return _0x2a3e4c[_0x44b8('0x18')](_0x44b8('0x19'),_0x5e52f2+'-'+_0x495c74+'/'+_0x41ab46)['json'](_0x1722da);}return null;};}function patchUpdates(_0x89bc30){return function(_0x3f4688){try{jsonpatch['apply'](_0x3f4688,_0x89bc30,!![]);}catch(_0xcce202){return BPromise[_0x44b8('0x1a')](_0xcce202);}return _0x3f4688[_0x44b8('0x1b')]();};}function saveUpdates(_0x235bdc,_0x102ef9){return function(_0x369c09){if(_0x369c09){return _0x369c09[_0x44b8('0x1c')](_0x235bdc)[_0x44b8('0x1d')](function(_0x429461){return _0x429461;});}return null;};}function removeEntity(_0x1e0f2d,_0x1d642b){return function(_0x14996c){if(_0x14996c){return _0x14996c['destroy']()[_0x44b8('0x1d')](function(){_0x1e0f2d[_0x44b8('0x1e')](0xcc)[_0x44b8('0x14')]();});}};}function handleEntityNotFound(_0x1418db,_0x305a5c){return function(_0x51a34a){if(!_0x51a34a){_0x1418db[_0x44b8('0x13')](0x194);}return _0x51a34a;};}function handleError(_0x54677c,_0x41a922){_0x41a922=_0x41a922||0x1f4;return function(_0x228c81){logger[_0x44b8('0x1f')](_0x228c81[_0x44b8('0x20')]);if(_0x228c81[_0x44b8('0x21')]){delete _0x228c81['name'];}_0x54677c[_0x44b8('0x1e')](_0x41a922)['send'](_0x228c81);};}exports[_0x44b8('0x22')]=function(_0x350482,_0x549a26){var _0x17ac44={},_0x470f49={},_0x2656d7={'count':0x0,'rows':[]};var _0x59c1bf=_[_0x44b8('0x23')](db[_0x44b8('0x24')]['rawAttributes'],function(_0x2e0174){return{'name':_0x2e0174['fieldName'],'type':_0x2e0174[_0x44b8('0x25')]['key']};});_0x470f49['model']=_['map'](_0x59c1bf,_0x44b8('0x21'));_0x470f49[_0x44b8('0x26')]=_[_0x44b8('0x27')](_0x350482[_0x44b8('0x26')]);_0x470f49[_0x44b8('0x28')]=_[_0x44b8('0x29')](_0x470f49[_0x44b8('0x2a')],_0x470f49[_0x44b8('0x26')]);_0x17ac44[_0x44b8('0x2b')]=_[_0x44b8('0x29')](_0x470f49[_0x44b8('0x2a')],qs[_0x44b8('0x2c')](_0x350482[_0x44b8('0x26')]['fields']));_0x17ac44[_0x44b8('0x2b')]=_0x17ac44['attributes'][_0x44b8('0x2d')]?_0x17ac44[_0x44b8('0x2b')]:_0x470f49[_0x44b8('0x2a')];if(!_0x350482[_0x44b8('0x26')][_0x44b8('0x2e')]('nolimit')){_0x17ac44[_0x44b8('0x17')]=qs[_0x44b8('0x17')](_0x350482[_0x44b8('0x26')][_0x44b8('0x17')]);_0x17ac44[_0x44b8('0x16')]=qs['offset'](_0x350482[_0x44b8('0x26')][_0x44b8('0x16')]);}_0x17ac44[_0x44b8('0x2f')]=qs[_0x44b8('0x30')](_0x350482[_0x44b8('0x26')][_0x44b8('0x30')]);_0x17ac44[_0x44b8('0x31')]=qs[_0x44b8('0x28')](_[_0x44b8('0x32')](_0x350482[_0x44b8('0x26')],_0x470f49[_0x44b8('0x28')]),_0x59c1bf);if(_0x350482[_0x44b8('0x26')][_0x44b8('0x33')]){_0x17ac44[_0x44b8('0x31')]=_[_0x44b8('0x34')](_0x17ac44[_0x44b8('0x31')],{'$or':_[_0x44b8('0x23')](_0x59c1bf,function(_0xeff999){if(_0xeff999[_0x44b8('0x25')]!==_0x44b8('0x35')){var _0x2c02d6={};_0x2c02d6[_0xeff999[_0x44b8('0x21')]]={'$like':'%'+_0x350482['query'][_0x44b8('0x33')]+'%'};return _0x2c02d6;}})});}_0x17ac44=_[_0x44b8('0x34')]({},_0x17ac44,_0x350482['options']);var _0x25688b={'where':_0x17ac44[_0x44b8('0x31')]};return db[_0x44b8('0x24')][_0x44b8('0x15')](_0x25688b)['then'](function(_0x221543){_0x2656d7[_0x44b8('0x15')]=_0x221543;if(_0x350482[_0x44b8('0x26')][_0x44b8('0x36')]){_0x17ac44[_0x44b8('0x37')]=[{'all':!![]}];}return db[_0x44b8('0x24')][_0x44b8('0x38')](_0x17ac44);})[_0x44b8('0x1d')](function(_0x209039){_0x2656d7[_0x44b8('0x39')]=_0x209039;return _0x2656d7;})[_0x44b8('0x1d')](respondWithFilteredResult(_0x549a26,_0x17ac44))[_0x44b8('0x3a')](handleError(_0x549a26,null));}; \ No newline at end of file +var _0xa9e0=['save','update','then','destroy','end','error','name','send','index','map','Migration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','catch','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject'];(function(_0x1afa69,_0x1bcba5){var _0x295843=function(_0x131a6a){while(--_0x131a6a){_0x1afa69['push'](_0x1afa69['shift']());}};_0x295843(++_0x1bcba5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x21')]();});}};}function handleEntityNotFound(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(!_0x2fb0e4){_0x4abc77[_0x0a9e('0x14')](0x194);}return _0x2fb0e4;};}function handleError(_0x4d00e6,_0x370d86){_0x370d86=_0x370d86||0x1f4;return function(_0x42ac8f){logger[_0x0a9e('0x22')](_0x42ac8f['stack']);if(_0x42ac8f['name']){delete _0x42ac8f[_0x0a9e('0x23')];}_0x4d00e6[_0x0a9e('0x15')](_0x370d86)[_0x0a9e('0x24')](_0x42ac8f);};}exports[_0x0a9e('0x25')]=function(_0x526cf3,_0x384319){var _0x479bc4={},_0x45a1e7={},_0x5bfb33={'count':0x0,'rows':[]};var _0x1dc186=_[_0x0a9e('0x26')](db[_0x0a9e('0x27')][_0x0a9e('0x28')],function(_0x140511){return{'name':_0x140511[_0x0a9e('0x29')],'type':_0x140511[_0x0a9e('0x2a')][_0x0a9e('0x2b')]};});_0x45a1e7['model']=_[_0x0a9e('0x26')](_0x1dc186,_0x0a9e('0x23'));_0x45a1e7[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x526cf3['query']);_0x45a1e7[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],_0x45a1e7[_0x0a9e('0x2c')]);_0x479bc4[_0x0a9e('0x31')]=_[_0x0a9e('0x2f')](_0x45a1e7[_0x0a9e('0x30')],qs[_0x0a9e('0x32')](_0x526cf3[_0x0a9e('0x2c')]['fields']));_0x479bc4[_0x0a9e('0x31')]=_0x479bc4['attributes'][_0x0a9e('0x33')]?_0x479bc4[_0x0a9e('0x31')]:_0x45a1e7[_0x0a9e('0x30')];if(!_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x34')]('nolimit')){_0x479bc4[_0x0a9e('0x35')]=qs[_0x0a9e('0x35')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x35')]);_0x479bc4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x18')]);}_0x479bc4['order']=qs[_0x0a9e('0x36')](_0x526cf3['query'][_0x0a9e('0x36')]);_0x479bc4[_0x0a9e('0x37')]=qs[_0x0a9e('0x2e')](_[_0x0a9e('0x38')](_0x526cf3['query'],_0x45a1e7[_0x0a9e('0x2e')]),_0x1dc186);if(_0x526cf3[_0x0a9e('0x2c')][_0x0a9e('0x39')]){_0x479bc4[_0x0a9e('0x37')]=_['merge'](_0x479bc4['where'],{'$or':_[_0x0a9e('0x26')](_0x1dc186,function(_0x5640eb){if(_0x5640eb[_0x0a9e('0x2a')]!==_0x0a9e('0x3a')){var _0x381c37={};_0x381c37[_0x5640eb[_0x0a9e('0x23')]]={'$like':'%'+_0x526cf3['query'][_0x0a9e('0x39')]+'%'};return _0x381c37;}})});}_0x479bc4=_[_0x0a9e('0x3b')]({},_0x479bc4,_0x526cf3[_0x0a9e('0x3c')]);var _0x533942={'where':_0x479bc4[_0x0a9e('0x37')]};return db[_0x0a9e('0x27')][_0x0a9e('0x17')](_0x533942)['then'](function(_0x546ef8){_0x5bfb33[_0x0a9e('0x17')]=_0x546ef8;if(_0x526cf3[_0x0a9e('0x2c')]['includeAll']){_0x479bc4[_0x0a9e('0x3d')]=[{'all':!![]}];}return db[_0x0a9e('0x27')][_0x0a9e('0x3e')](_0x479bc4);})[_0x0a9e('0x1f')](function(_0x4b38d9){_0x5bfb33['rows']=_0x4b38d9;return _0x5bfb33;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x384319,_0x479bc4))[_0x0a9e('0x3f')](handleError(_0x384319,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 4d0b767..cd9babe 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 _0x4a5a=['define','migrations','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports'];(function(_0x56340f,_0x57f38c){var _0x2f3b4d=function(_0x1f5c4d){while(--_0x1f5c4d){_0x56340f['push'](_0x56340f['shift']());}};_0x2f3b4d(++_0x57f38c);}(_0x4a5a,0x6e));var _0xa4a5=function(_0x52068e,_0x3ec3de){_0x52068e=_0x52068e-0x0;var _0x3d0694=_0x4a5a[_0x52068e];return _0x3d0694;};'use strict';var _=require(_0xa4a5('0x0'));var util=require('util');var logger=require(_0xa4a5('0x1'))(_0xa4a5('0x2'));var moment=require(_0xa4a5('0x3'));var BPromise=require('bluebird');var rp=require(_0xa4a5('0x4'));var fs=require('fs');var path=require(_0xa4a5('0x5'));var rimraf=require(_0xa4a5('0x6'));var config=require(_0xa4a5('0x7'));var attributes=require(_0xa4a5('0x8'));module[_0xa4a5('0x9')]=function(_0x491af5,_0x4bc593){return _0x491af5[_0xa4a5('0xa')]('Migration',attributes,{'tableName':_0xa4a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9f0=['../../config/logger','api','moment','path','rimraf','exports','define','migrations'];(function(_0x42c797,_0x16382b){var _0x320035=function(_0x39f50b){while(--_0x39f50b){_0x42c797['push'](_0x42c797['shift']());}};_0x320035(++_0x16382b);}(_0xb9f0,0xc8));var _0x0b9f=function(_0x11dbbe,_0x7b04d3){_0x11dbbe=_0x11dbbe-0x0;var _0x475061=_0xb9f0[_0x11dbbe];return _0x475061;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0b9f('0x0'))(_0x0b9f('0x1'));var moment=require(_0x0b9f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0b9f('0x3'));var rimraf=require(_0x0b9f('0x4'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0x0b9f('0x5')]=function(_0x1a1456,_0x5e3c06){return _0x1a1456[_0x0b9f('0x6')]('Migration',attributes,{'tableName':_0x0b9f('0x7'),'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 a5e73fd..d417fa6 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 _0xb666=['Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4551f6,_0x48151b){var _0x581dc2=function(_0x1842af){while(--_0x1842af){_0x4551f6['push'](_0x4551f6['shift']());}};_0x581dc2(++_0x48151b);}(_0xb666,0x1e6));var _0x6b66=function(_0x7b341f,_0x11e481){_0x7b341f=_0x7b341f-0x0;var _0x46d0a1=_0xb666[_0x7b341f];return _0x46d0a1;};'use strict';var _=require(_0x6b66('0x0'));var util=require(_0x6b66('0x1'));var moment=require(_0x6b66('0x2'));var BPromise=require(_0x6b66('0x3'));var rs=require(_0x6b66('0x4'));var fs=require('fs');var Redis=require(_0x6b66('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6b66('0x6'));var logger=require(_0x6b66('0x7'))(_0x6b66('0x8'));var config=require(_0x6b66('0x9'));var jayson=require(_0x6b66('0xa'));var client=jayson[_0x6b66('0xb')][_0x6b66('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xaa65ba,_0x449e41,_0x1b6914){return new BPromise(function(_0x250ab1,_0x3d7ee0){return client[_0x6b66('0xd')](_0xaa65ba,_0x1b6914)['then'](function(_0x531d28){logger[_0x6b66('0xe')](_0x6b66('0xf'),_0x449e41,_0x6b66('0x10'));logger[_0x6b66('0x11')](_0x6b66('0x12'),_0x449e41,_0x6b66('0x10'),JSON[_0x6b66('0x13')](_0x531d28));if(_0x531d28['error']){if(_0x531d28[_0x6b66('0x14')][_0x6b66('0x15')]===0x1f4){logger['error'](_0x6b66('0xf'),_0x449e41,_0x531d28[_0x6b66('0x14')][_0x6b66('0x16')]);return _0x3d7ee0(_0x531d28[_0x6b66('0x14')][_0x6b66('0x16')]);}logger[_0x6b66('0x14')]('Migration,\x20%s,\x20%s',_0x449e41,_0x531d28[_0x6b66('0x14')]['message']);return _0x250ab1(_0x531d28[_0x6b66('0x14')]['message']);}else{logger[_0x6b66('0xe')](_0x6b66('0xf'),_0x449e41,_0x6b66('0x10'));_0x250ab1(_0x531d28['result'][_0x6b66('0x16')]);}})[_0x6b66('0x17')](function(_0xef1c2){logger['error'](_0x6b66('0xf'),_0x449e41,_0xef1c2);_0x3d7ee0(_0xef1c2);});});} \ No newline at end of file +var _0x3feb=['lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','client','http','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch'];(function(_0x384a65,_0x4a54b1){var _0x158090=function(_0x12b455){while(--_0x12b455){_0x384a65['push'](_0x384a65['shift']());}};_0x158090(++_0x4a54b1);}(_0x3feb,0x1ce));var _0xb3fe=function(_0x38711b,_0x15fed2){_0x38711b=_0x38711b-0x0;var _0x3b1b5=_0x3feb[_0x38711b];return _0x3b1b5;};'use strict';var _=require(_0xb3fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb3fe('0x1'));var rs=require(_0xb3fe('0x2'));var fs=require('fs');var Redis=require(_0xb3fe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3fe('0x4'));var logger=require('../../config/logger')(_0xb3fe('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb3fe('0x6')][_0xb3fe('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2424a3,_0x3e79a4,_0x5e2aba){return new BPromise(function(_0x208c95,_0x29c961){return client[_0xb3fe('0x8')](_0x2424a3,_0x5e2aba)[_0xb3fe('0x9')](function(_0xf2fa1e){logger[_0xb3fe('0xa')]('Migration,\x20%s,\x20%s',_0x3e79a4,_0xb3fe('0xb'));logger[_0xb3fe('0xc')](_0xb3fe('0xd'),_0x3e79a4,_0xb3fe('0xb'),JSON[_0xb3fe('0xe')](_0xf2fa1e));if(_0xf2fa1e[_0xb3fe('0xf')]){if(_0xf2fa1e[_0xb3fe('0xf')][_0xb3fe('0x10')]===0x1f4){logger['error'](_0xb3fe('0x11'),_0x3e79a4,_0xf2fa1e['error'][_0xb3fe('0x12')]);return _0x29c961(_0xf2fa1e[_0xb3fe('0xf')][_0xb3fe('0x12')]);}logger[_0xb3fe('0xf')]('Migration,\x20%s,\x20%s',_0x3e79a4,_0xf2fa1e[_0xb3fe('0xf')][_0xb3fe('0x12')]);return _0x208c95(_0xf2fa1e[_0xb3fe('0xf')]['message']);}else{logger[_0xb3fe('0xa')]('Migration,\x20%s,\x20%s',_0x3e79a4,_0xb3fe('0xb'));_0x208c95(_0xf2fa1e[_0xb3fe('0x13')]['message']);}})[_0xb3fe('0x14')](function(_0x122287){logger[_0xb3fe('0xf')](_0xb3fe('0x11'),_0x3e79a4,_0x122287);_0x29c961(_0x122287);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index d5ed0e8..9234ecd 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 _0x5e61=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports'];(function(_0x2b012b,_0x463e28){var _0x32c4cf=function(_0x5871f2){while(--_0x5871f2){_0x2b012b['push'](_0x2b012b['shift']());}};_0x32c4cf(++_0x463e28);}(_0x5e61,0x1e0));var _0x15e6=function(_0x411557,_0x275cc8){_0x411557=_0x411557-0x0;var _0x4c0fb0=_0x5e61[_0x411557];return _0x4c0fb0;};'use strict';var multer=require(_0x15e6('0x0'));var util=require(_0x15e6('0x1'));var path=require(_0x15e6('0x2'));var timeout=require(_0x15e6('0x3'));var express=require(_0x15e6('0x4'));var router=express[_0x15e6('0x5')]();var auth=require(_0x15e6('0x6'));var interaction=require(_0x15e6('0x7'));var config=require(_0x15e6('0x8'));var controller=require(_0x15e6('0x9'));router[_0x15e6('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x15e6('0xa')](_0x15e6('0xb'),auth[_0x15e6('0xc')](),controller['show']);router[_0x15e6('0xd')]('/',auth['isAuthenticated'](),controller[_0x15e6('0xe')]);router[_0x15e6('0xf')]('/:id',auth[_0x15e6('0xc')](),controller[_0x15e6('0x10')]);router[_0x15e6('0x11')]('/:id',auth[_0x15e6('0xc')](),controller[_0x15e6('0x12')]);module[_0x15e6('0x13')]=router; \ No newline at end of file +var _0x1c8a=['put','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x1635fe,_0x5f1d9f){var _0x3c512a=function(_0x26b53d){while(--_0x26b53d){_0x1635fe['push'](_0x1635fe['shift']());}};_0x3c512a(++_0x5f1d9f);}(_0x1c8a,0x1f0));var _0xa1c8=function(_0x2e68e6,_0x119e37){_0x2e68e6=_0x2e68e6-0x0;var _0x32b8f6=_0x1c8a[_0x2e68e6];return _0x32b8f6;};'use strict';var multer=require(_0xa1c8('0x0'));var util=require(_0xa1c8('0x1'));var path=require(_0xa1c8('0x2'));var timeout=require(_0xa1c8('0x3'));var express=require(_0xa1c8('0x4'));var router=express[_0xa1c8('0x5')]();var auth=require(_0xa1c8('0x6'));var interaction=require(_0xa1c8('0x7'));var config=require(_0xa1c8('0x8'));var controller=require(_0xa1c8('0x9'));router[_0xa1c8('0xa')]('/',auth[_0xa1c8('0xb')](),controller[_0xa1c8('0xc')]);router[_0xa1c8('0xa')](_0xa1c8('0xd'),auth['isAuthenticated'](),controller[_0xa1c8('0xe')]);router[_0xa1c8('0xf')]('/',auth[_0xa1c8('0xb')](),controller[_0xa1c8('0x10')]);router[_0xa1c8('0x11')](_0xa1c8('0xd'),auth['isAuthenticated'](),controller[_0xa1c8('0x12')]);router['delete']('/:id',auth[_0xa1c8('0xb')](),controller['destroy']);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 483478f..81e4e17 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 _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x2867b9,_0x1c319d){var _0x5a6054=function(_0x257aa5){while(--_0x257aa5){_0x2867b9['push'](_0x2867b9['shift']());}};_0x5a6054(++_0x1c319d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x45d71f,_0x54d9d3){var _0x5b640b=function(_0xcab3a5){while(--_0xcab3a5){_0x45d71f['push'](_0x45d71f['shift']());}};_0x5b640b(++_0x54d9d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 9e7aa90..b3a0cbb 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 _0xd5dd=['html-pdf','eml-format','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','Network,\x20%s,\x20%s','message','result','sendStatus','status','end','count','offset','set','Content-Range','apply','save','destroy','stack','name','index','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','type','VIRTUAL','includeAll','include','catch','show','params','Network','merge','options','find','create','sequelize','body','toUpperCase','readFileSync','join','root','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','format','toLowerCase','chan_sip.so','update','findAll','STUN','server/files/templates/stun_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','server/files/templates/turn_multiple.ejs','/etc/asterisk/sip_xcally_%s.conf'];(function(_0x140d7f,_0x1c6987){var _0x37c8d1=function(_0xdba297){while(--_0xdba297){_0x140d7f['push'](_0x140d7f['shift']());}};_0x37c8d1(++_0x1c6987);}(_0xd5dd,0xd4));var _0xdd5d=function(_0x5e31d4,_0x31c516){_0x5e31d4=_0x5e31d4-0x0;var _0x4317bb=_0xd5dd[_0x5e31d4];return _0x4317bb;};'use strict';var pdf=require(_0xdd5d('0x0'));var emlformat=require(_0xdd5d('0x1'));var rimraf=require(_0xdd5d('0x2'));var zipdir=require(_0xdd5d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdd5d('0x4'));var Mustache=require('mustache');var util=require(_0xdd5d('0x5'));var path=require(_0xdd5d('0x6'));var sox=require(_0xdd5d('0x7'));var csv=require(_0xdd5d('0x8'));var ejs=require(_0xdd5d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdd5d('0xa'));var crypto=require(_0xdd5d('0xb'));var jsforce=require(_0xdd5d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xdd5d('0x8'));var querystring=require(_0xdd5d('0xd'));var Papa=require(_0xdd5d('0xe'));var Redis=require('ioredis');var authService=require(_0xdd5d('0xf'));var qs=require(_0xdd5d('0x10'));var as=require(_0xdd5d('0x11'));var hardwareService=require(_0xdd5d('0x12'));var logger=require('../../config/logger')(_0xdd5d('0x13'));var utils=require(_0xdd5d('0x14'));var config=require(_0xdd5d('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0xdd5d('0x16'));var client=jayson[_0xdd5d('0x17')][_0xdd5d('0x18')]({'port':0x232a});function checkPasswordPattern(_0x1a383c,_0x3abf8a,_0x5747bb){if(_0x5747bb){var _0x3c6c57=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3c6c57[_0xdd5d('0x19')](_0x3abf8a)){return _0x1a383c;}else{throw new db[(_0xdd5d('0x1a'))]['ValidationError'](_0xdd5d('0x1b'));}}else{return _0x1a383c;}}function respondWithRpcPromise(_0x122bc1,_0x2d4681,_0x5d3fa9,_0x1b75aa){return new BPromise(function(_0x14e896,_0x2f7b25){var _0x34841b=_0x1b75aa||client;return _0x34841b[_0xdd5d('0x1c')](_0x122bc1,_0x5d3fa9)[_0xdd5d('0x1d')](function(_0x1a6be9){logger[_0xdd5d('0x1e')]('Network,\x20%s,\x20%s',_0x2d4681,_0xdd5d('0x1f'));logger[_0xdd5d('0x20')](_0xdd5d('0x21'),_0x2d4681,'request\x20sent',JSON['stringify'](_0x1a6be9));if(_0x1a6be9[_0xdd5d('0x22')]){if(_0x1a6be9['error'][_0xdd5d('0x23')]===0x1f4){logger[_0xdd5d('0x22')](_0xdd5d('0x24'),_0x2d4681,_0x1a6be9['error']['message']);return _0x2f7b25(_0x1a6be9[_0xdd5d('0x22')][_0xdd5d('0x25')]);}logger[_0xdd5d('0x22')](_0xdd5d('0x24'),_0x2d4681,_0x1a6be9[_0xdd5d('0x22')][_0xdd5d('0x25')]);return _0x14e896(_0x1a6be9['error'][_0xdd5d('0x25')]);}else{logger[_0xdd5d('0x1e')](_0xdd5d('0x24'),_0x2d4681,'request\x20sent');_0x14e896(_0x1a6be9[_0xdd5d('0x26')][_0xdd5d('0x25')]);}})['catch'](function(_0x5f5594){logger[_0xdd5d('0x22')](_0xdd5d('0x24'),_0x2d4681,_0x5f5594);_0x2f7b25(_0x5f5594);});});}function respondWithStatusCode(_0x283b66,_0x58bb0e){_0x58bb0e=_0x58bb0e||0xcc;return function(_0x16911f){if(_0x16911f){return _0x283b66[_0xdd5d('0x27')](_0x58bb0e);}return _0x283b66[_0xdd5d('0x28')](_0x58bb0e)[_0xdd5d('0x29')]();};}function respondWithResult(_0xd7ca07,_0x583085){_0x583085=_0x583085||0xc8;return function(_0x146b07){if(_0x146b07){return _0xd7ca07[_0xdd5d('0x28')](_0x583085)['json'](_0x146b07);}};}function respondWithFilteredResult(_0x36df6b,_0x2b2ad8){return function(_0x578dd2){if(_0x578dd2){var _0x2e1157=_0x578dd2[_0xdd5d('0x2a')],_0x4c1fe5=_0x2b2ad8['offset'],_0x24660f=_0x2b2ad8[_0xdd5d('0x2b')]+_0x2b2ad8['limit'],_0x224db5;if(_0x24660f>=_0x2e1157){_0x24660f=_0x2e1157;_0x224db5=0xc8;}else{_0x224db5=0xce;}_0x36df6b[_0xdd5d('0x28')](_0x224db5);return _0x36df6b[_0xdd5d('0x2c')](_0xdd5d('0x2d'),_0x4c1fe5+'-'+_0x24660f+'/'+_0x2e1157)['json'](_0x578dd2);}return null;};}function patchUpdates(_0x403b7f){return function(_0x2dbe56){try{jsonpatch[_0xdd5d('0x2e')](_0x2dbe56,_0x403b7f,!![]);}catch(_0x59f699){return BPromise['reject'](_0x59f699);}return _0x2dbe56[_0xdd5d('0x2f')]();};}function saveUpdates(_0x66b292,_0xeff018){return function(_0x5700d2){if(_0x5700d2){return _0x5700d2['update'](_0x66b292)[_0xdd5d('0x1d')](function(_0x54c2d0){return _0x54c2d0;});}return null;};}function removeEntity(_0x402050,_0xc741fa){return function(_0x288bef){if(_0x288bef){return _0x288bef[_0xdd5d('0x30')]()[_0xdd5d('0x1d')](function(){_0x402050[_0xdd5d('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d742d,_0x36f56d){return function(_0x2d653c){if(!_0x2d653c){_0x1d742d[_0xdd5d('0x27')](0x194);}return _0x2d653c;};}function handleError(_0x25b7ec,_0x3385dc){_0x3385dc=_0x3385dc||0x1f4;return function(_0x13852f){logger[_0xdd5d('0x22')](_0x13852f[_0xdd5d('0x31')]);if(_0x13852f[_0xdd5d('0x32')]){delete _0x13852f[_0xdd5d('0x32')];}_0x25b7ec['status'](_0x3385dc)['send'](_0x13852f);};}exports[_0xdd5d('0x33')]=function(_0x583985,_0x220e0b){var _0x38042a={},_0x256636={},_0x325eed={'count':0x0,'rows':[]};var _0x3676b3=_['map'](db['Network'][_0xdd5d('0x34')],function(_0x4ad0e0){return{'name':_0x4ad0e0[_0xdd5d('0x35')],'type':_0x4ad0e0['type'][_0xdd5d('0x36')]};});_0x256636[_0xdd5d('0x37')]=_[_0xdd5d('0x38')](_0x3676b3,_0xdd5d('0x32'));_0x256636['query']=_[_0xdd5d('0x39')](_0x583985['query']);_0x256636[_0xdd5d('0x3a')]=_[_0xdd5d('0x3b')](_0x256636[_0xdd5d('0x37')],_0x256636[_0xdd5d('0x3c')]);_0x38042a[_0xdd5d('0x3d')]=_[_0xdd5d('0x3b')](_0x256636['model'],qs['fields'](_0x583985[_0xdd5d('0x3c')][_0xdd5d('0x3e')]));_0x38042a[_0xdd5d('0x3d')]=_0x38042a['attributes'][_0xdd5d('0x3f')]?_0x38042a[_0xdd5d('0x3d')]:_0x256636[_0xdd5d('0x37')];if(!_0x583985[_0xdd5d('0x3c')][_0xdd5d('0x40')]('nolimit')){_0x38042a[_0xdd5d('0x41')]=qs[_0xdd5d('0x41')](_0x583985[_0xdd5d('0x3c')][_0xdd5d('0x41')]);_0x38042a[_0xdd5d('0x2b')]=qs[_0xdd5d('0x2b')](_0x583985[_0xdd5d('0x3c')][_0xdd5d('0x2b')]);}_0x38042a[_0xdd5d('0x42')]=qs[_0xdd5d('0x43')](_0x583985[_0xdd5d('0x3c')][_0xdd5d('0x43')]);_0x38042a[_0xdd5d('0x44')]=qs[_0xdd5d('0x3a')](_['pick'](_0x583985[_0xdd5d('0x3c')],_0x256636[_0xdd5d('0x3a')]),_0x3676b3);if(_0x583985[_0xdd5d('0x3c')][_0xdd5d('0x45')]){_0x38042a[_0xdd5d('0x44')]=_['merge'](_0x38042a[_0xdd5d('0x44')],{'$or':_[_0xdd5d('0x38')](_0x3676b3,function(_0x144ec2){if(_0x144ec2[_0xdd5d('0x46')]!==_0xdd5d('0x47')){var _0x543108={};_0x543108[_0x144ec2[_0xdd5d('0x32')]]={'$like':'%'+_0x583985[_0xdd5d('0x3c')][_0xdd5d('0x45')]+'%'};return _0x543108;}})});}_0x38042a=_['merge']({},_0x38042a,_0x583985['options']);var _0x1f3504={'where':_0x38042a[_0xdd5d('0x44')]};return db['Network'][_0xdd5d('0x2a')](_0x1f3504)[_0xdd5d('0x1d')](function(_0x240e60){_0x325eed[_0xdd5d('0x2a')]=_0x240e60;if(_0x583985[_0xdd5d('0x3c')][_0xdd5d('0x48')]){_0x38042a[_0xdd5d('0x49')]=[{'all':!![]}];}return db['Network']['findAll'](_0x38042a);})[_0xdd5d('0x1d')](function(_0x118343){_0x325eed['rows']=_0x118343;return _0x325eed;})[_0xdd5d('0x1d')](respondWithFilteredResult(_0x220e0b,_0x38042a))[_0xdd5d('0x4a')](handleError(_0x220e0b,null));};exports[_0xdd5d('0x4b')]=function(_0x5cfc1d,_0x5492f5){var _0x203785={'raw':!![],'where':{'id':_0x5cfc1d[_0xdd5d('0x4c')]['id']}},_0x2c3fea={};_0x2c3fea[_0xdd5d('0x37')]=_[_0xdd5d('0x39')](db[_0xdd5d('0x4d')][_0xdd5d('0x34')]);_0x2c3fea[_0xdd5d('0x3c')]=_['keys'](_0x5cfc1d[_0xdd5d('0x3c')]);_0x2c3fea[_0xdd5d('0x3a')]=_[_0xdd5d('0x3b')](_0x2c3fea[_0xdd5d('0x37')],_0x2c3fea[_0xdd5d('0x3c')]);_0x203785[_0xdd5d('0x3d')]=_[_0xdd5d('0x3b')](_0x2c3fea[_0xdd5d('0x37')],qs['fields'](_0x5cfc1d[_0xdd5d('0x3c')][_0xdd5d('0x3e')]));_0x203785[_0xdd5d('0x3d')]=_0x203785[_0xdd5d('0x3d')][_0xdd5d('0x3f')]?_0x203785[_0xdd5d('0x3d')]:_0x2c3fea['model'];if(_0x5cfc1d[_0xdd5d('0x3c')][_0xdd5d('0x48')]){_0x203785[_0xdd5d('0x49')]=[{'all':!![]}];}_0x203785=_[_0xdd5d('0x4e')]({},_0x203785,_0x5cfc1d[_0xdd5d('0x4f')]);return db[_0xdd5d('0x4d')][_0xdd5d('0x50')](_0x203785)[_0xdd5d('0x1d')](handleEntityNotFound(_0x5492f5,null))[_0xdd5d('0x1d')](respondWithResult(_0x5492f5,null))[_0xdd5d('0x4a')](handleError(_0x5492f5,null));};exports[_0xdd5d('0x51')]=function(_0xc54f07,_0x58c0be,_0x4efcac){var _0x266064;return db[_0xdd5d('0x52')]['transaction'](function(_0x4a472c){return db[_0xdd5d('0x4d')][_0xdd5d('0x51')](_0xc54f07[_0xdd5d('0x53')],{'raw':!![]})[_0xdd5d('0x1d')](function(_0x2b8ae5){_0x266064=_0x2b8ae5;return db[_0xdd5d('0x4d')]['findAll']({'where':{'type':_0xc54f07['body']['type']},'raw':!![]});})[_0xdd5d('0x1d')](function(_0x4afe39){if(_0x266064[_0xdd5d('0x46')][_0xdd5d('0x54')]()=='STUN'){var _0x3d1012=fs[_0xdd5d('0x55')](path[_0xdd5d('0x56')](config[_0xdd5d('0x57')],'server/files/templates/stun_multiple.ejs'),_0xdd5d('0x58'));var _0x5f209e=ejs[_0xdd5d('0x59')](_0x3d1012,{'networks':_0x4afe39||[]});fs['writeFileSync'](_0xdd5d('0x5a'),_0x5f209e);return respondWithRpcPromise(_0xdd5d('0x5b'),_0xdd5d('0x51'),{'module':_0xdd5d('0x5c')});}else if(_0x266064[_0xdd5d('0x46')]['toUpperCase']()==_0xdd5d('0x5d')){var _0x189997=fs[_0xdd5d('0x55')](path[_0xdd5d('0x56')](config[_0xdd5d('0x57')],'server/files/templates/turn_multiple.ejs'),_0xdd5d('0x58'));var _0x32c7b8=ejs[_0xdd5d('0x59')](_0x189997,{'networks':_0x4afe39||[]});fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x32c7b8);return respondWithRpcPromise(_0xdd5d('0x5b'),'create',{'module':_0xdd5d('0x5c')});}else{var _0x1a9170=fs[_0xdd5d('0x55')](path[_0xdd5d('0x56')](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x48d643=ejs[_0xdd5d('0x59')](_0x1a9170,{'networks':_0x4afe39||[]});fs['writeFileSync'](util[_0xdd5d('0x5e')]('/etc/asterisk/sip_xcally_%s.conf',_0xc54f07[_0xdd5d('0x53')][_0xdd5d('0x46')][_0xdd5d('0x5f')]()),_0x48d643);return respondWithRpcPromise(_0xdd5d('0x5b'),_0xdd5d('0x51'),{'module':_0xdd5d('0x60')});}return null;})['then'](function(){return _0x266064;});})['then'](respondWithResult(_0x58c0be,0xc9))['catch'](handleError(_0x58c0be,null));};exports[_0xdd5d('0x61')]=function(_0x16dacd,_0x27dce4,_0x82902e){var _0x1afaec;return db['sequelize']['transaction'](function(_0x32f2bb){return db[_0xdd5d('0x4d')][_0xdd5d('0x50')]({'where':{'id':_0x16dacd['params']['id']}})[_0xdd5d('0x1d')](handleEntityNotFound(_0x27dce4,null))[_0xdd5d('0x1d')](saveUpdates(_0x16dacd['body'],null))['then'](function(_0x3a4d44){if(_0x3a4d44){_0x1afaec=_0x3a4d44;return db['Network'][_0xdd5d('0x62')]({'where':{'type':_0x1afaec['type']},'raw':!![]});}return null;})['then'](function(_0x7daa72){if(_0x1afaec[_0xdd5d('0x46')][_0xdd5d('0x54')]()==_0xdd5d('0x63')){var _0xd55908=fs[_0xdd5d('0x55')](path[_0xdd5d('0x56')](config[_0xdd5d('0x57')],_0xdd5d('0x64')),'utf8');var _0x3dfaf8=ejs['render'](_0xd55908,{'networks':_0x7daa72||[]});fs['writeFileSync'](_0xdd5d('0x5a'),_0x3dfaf8);return respondWithRpcPromise(_0xdd5d('0x5b'),_0xdd5d('0x61'),{'module':_0xdd5d('0x5c')});}else if(_0x1afaec[_0xdd5d('0x46')][_0xdd5d('0x54')]()=='TURN'){var _0x495c20=fs[_0xdd5d('0x55')](path['join'](config[_0xdd5d('0x57')],'server/files/templates/turn_multiple.ejs'),_0xdd5d('0x58'));var _0x5cceb7=ejs[_0xdd5d('0x59')](_0x495c20,{'networks':_0x7daa72||[]});fs[_0xdd5d('0x65')](_0xdd5d('0x66'),_0x5cceb7);return respondWithRpcPromise('Reload',_0xdd5d('0x61'),{'module':_0xdd5d('0x5c')});}else{var _0x3118b2=fs['readFileSync'](path[_0xdd5d('0x56')](config[_0xdd5d('0x57')],_0xdd5d('0x67')),_0xdd5d('0x58'));var _0x1f0eed=ejs[_0xdd5d('0x59')](_0x3118b2,{'networks':_0x7daa72||[]});fs[_0xdd5d('0x65')](util[_0xdd5d('0x5e')]('/etc/asterisk/sip_xcally_%s.conf',_0x16dacd[_0xdd5d('0x53')]['type'][_0xdd5d('0x5f')]()),_0x1f0eed);return respondWithRpcPromise('Reload',_0xdd5d('0x61'),{'module':'chan_sip.so'});}return null;})[_0xdd5d('0x1d')](function(_0x519d46){if(_0x519d46){return _0x1afaec;}return null;});})[_0xdd5d('0x1d')](respondWithResult(_0x27dce4,null))['catch'](handleError(_0x27dce4,null));};exports['destroy']=function(_0x4c4ae1,_0xde6d4b,_0x7f8d31){var _0x31cb24;return db[_0xdd5d('0x4d')][_0xdd5d('0x50')]({'where':{'id':_0x4c4ae1[_0xdd5d('0x4c')]['id']}})[_0xdd5d('0x1d')](function(_0x28adc9){_0x31cb24=_0x28adc9;return _0x28adc9;})['then'](handleEntityNotFound(_0xde6d4b,null))[_0xdd5d('0x1d')](removeEntity(_0xde6d4b,null))['then'](function(){if(_0x31cb24){return db[_0xdd5d('0x4d')][_0xdd5d('0x62')]({'where':{'type':_0x31cb24[_0xdd5d('0x46')]},'raw':!![]});}})[_0xdd5d('0x1d')](function(_0x30a131){if(_0x31cb24[_0xdd5d('0x46')][_0xdd5d('0x54')]()==_0xdd5d('0x63')){var _0x16d3ac=fs[_0xdd5d('0x55')](path[_0xdd5d('0x56')](config[_0xdd5d('0x57')],_0xdd5d('0x64')),_0xdd5d('0x58'));var _0x15a532=ejs[_0xdd5d('0x59')](_0x16d3ac,{'networks':_0x30a131||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x15a532);return respondWithRpcPromise(_0xdd5d('0x5b'),_0xdd5d('0x30'),{'module':'res_stun_monitor.so'});}else if(_0x31cb24[_0xdd5d('0x46')]['toUpperCase']()==_0xdd5d('0x5d')){var _0x5a76a4=fs[_0xdd5d('0x55')](path[_0xdd5d('0x56')](config[_0xdd5d('0x57')],_0xdd5d('0x68')),_0xdd5d('0x58'));var _0x3ee1bb=ejs[_0xdd5d('0x59')](_0x5a76a4,{'networks':_0x30a131||[]});fs[_0xdd5d('0x65')](_0xdd5d('0x66'),_0x3ee1bb);return respondWithRpcPromise(_0xdd5d('0x5b'),_0xdd5d('0x30'),{'module':_0xdd5d('0x5c')});}else{var _0x51f9aa=fs[_0xdd5d('0x55')](path['join'](config[_0xdd5d('0x57')],'server/files/templates/network.ejs'),_0xdd5d('0x58'));var _0x5735c7=ejs[_0xdd5d('0x59')](_0x51f9aa,{'networks':_0x30a131||[]});fs[_0xdd5d('0x65')](util['format'](_0xdd5d('0x69'),_0x4c4ae1[_0xdd5d('0x53')][_0xdd5d('0x46')][_0xdd5d('0x5f')]()),_0x5735c7);return respondWithRpcPromise(_0xdd5d('0x5b'),_0xdd5d('0x30'),{'module':_0xdd5d('0x60')});}return null;})['catch'](handleError(_0xde6d4b,null));}; \ No newline at end of file +var _0x88a9=['name','send','index','map','Network','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','sequelize','transaction','create','body','toUpperCase','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','params','STUN','server/files/templates/stun_multiple.ejs','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','stringify','error','code','Network,\x20%s,\x20%s','message','result','catch','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','end','sendStatus'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x88a9,0xac));var _0x988a=function(_0x5e2331,_0x4113ae){_0x5e2331=_0x5e2331-0x0;var _0x582630=_0x88a9[_0x5e2331];return _0x582630;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x988a('0x0'));var rimraf=require(_0x988a('0x1'));var zipdir=require(_0x988a('0x2'));var jsonpatch=require(_0x988a('0x3'));var rp=require(_0x988a('0x4'));var moment=require(_0x988a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x988a('0x6'));var util=require(_0x988a('0x7'));var path=require(_0x988a('0x8'));var sox=require(_0x988a('0x9'));var csv=require(_0x988a('0xa'));var ejs=require(_0x988a('0xb'));var fs=require('fs');var _=require(_0x988a('0xc'));var squel=require(_0x988a('0xd'));var crypto=require(_0x988a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x988a('0xf'));var toCsv=require(_0x988a('0xa'));var querystring=require(_0x988a('0x10'));var Papa=require(_0x988a('0x11'));var Redis=require(_0x988a('0x12'));var authService=require(_0x988a('0x13'));var qs=require(_0x988a('0x14'));var as=require(_0x988a('0x15'));var hardwareService=require(_0x988a('0x16'));var logger=require(_0x988a('0x17'))(_0x988a('0x18'));var utils=require(_0x988a('0x19'));var config=require(_0x988a('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x988a('0x1b')][_0x988a('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5b59d7,_0x40023b,_0x22f20e){if(_0x22f20e){var _0x256169=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x256169[_0x988a('0x1d')](_0x40023b)){return _0x5b59d7;}else{throw new db['Sequelize'][(_0x988a('0x1e'))](_0x988a('0x1f'));}}else{return _0x5b59d7;}}function respondWithRpcPromise(_0x45fe35,_0x5a76f4,_0x184ed0,_0x53b101){return new BPromise(function(_0x3c1a58,_0xc12c59){var _0x537bf3=_0x53b101||client;return _0x537bf3['request'](_0x45fe35,_0x184ed0)[_0x988a('0x20')](function(_0x32a5c0){logger[_0x988a('0x21')]('Network,\x20%s,\x20%s',_0x5a76f4,_0x988a('0x22'));logger[_0x988a('0x23')]('Network,\x20%s,\x20%s,\x20%s',_0x5a76f4,_0x988a('0x22'),JSON[_0x988a('0x24')](_0x32a5c0));if(_0x32a5c0['error']){if(_0x32a5c0[_0x988a('0x25')][_0x988a('0x26')]===0x1f4){logger[_0x988a('0x25')](_0x988a('0x27'),_0x5a76f4,_0x32a5c0[_0x988a('0x25')][_0x988a('0x28')]);return _0xc12c59(_0x32a5c0[_0x988a('0x25')]['message']);}logger[_0x988a('0x25')]('Network,\x20%s,\x20%s',_0x5a76f4,_0x32a5c0['error'][_0x988a('0x28')]);return _0x3c1a58(_0x32a5c0[_0x988a('0x25')][_0x988a('0x28')]);}else{logger[_0x988a('0x21')](_0x988a('0x27'),_0x5a76f4,_0x988a('0x22'));_0x3c1a58(_0x32a5c0[_0x988a('0x29')][_0x988a('0x28')]);}})[_0x988a('0x2a')](function(_0x35c262){logger['error'](_0x988a('0x27'),_0x5a76f4,_0x35c262);_0xc12c59(_0x35c262);});});}function respondWithStatusCode(_0x7abba6,_0x4912f4){_0x4912f4=_0x4912f4||0xcc;return function(_0x1626fb){if(_0x1626fb){return _0x7abba6['sendStatus'](_0x4912f4);}return _0x7abba6[_0x988a('0x2b')](_0x4912f4)['end']();};}function respondWithResult(_0x1fae3b,_0x5efa45){_0x5efa45=_0x5efa45||0xc8;return function(_0x325f82){if(_0x325f82){return _0x1fae3b[_0x988a('0x2b')](_0x5efa45)[_0x988a('0x2c')](_0x325f82);}};}function respondWithFilteredResult(_0x3f51f1,_0x1c7913){return function(_0x1a74f7){if(_0x1a74f7){var _0xaa44f0=_0x1a74f7[_0x988a('0x2d')],_0x13fe78=_0x1c7913[_0x988a('0x2e')],_0x234314=_0x1c7913['offset']+_0x1c7913[_0x988a('0x2f')],_0x458ace;if(_0x234314>=_0xaa44f0){_0x234314=_0xaa44f0;_0x458ace=0xc8;}else{_0x458ace=0xce;}_0x3f51f1['status'](_0x458ace);return _0x3f51f1[_0x988a('0x30')](_0x988a('0x31'),_0x13fe78+'-'+_0x234314+'/'+_0xaa44f0)[_0x988a('0x2c')](_0x1a74f7);}return null;};}function patchUpdates(_0x5258fe){return function(_0xec31c4){try{jsonpatch[_0x988a('0x32')](_0xec31c4,_0x5258fe,!![]);}catch(_0x1608ec){return BPromise[_0x988a('0x33')](_0x1608ec);}return _0xec31c4[_0x988a('0x34')]();};}function saveUpdates(_0x96c861,_0x2ff145){return function(_0x37a21a){if(_0x37a21a){return _0x37a21a[_0x988a('0x35')](_0x96c861)[_0x988a('0x20')](function(_0x231dc8){return _0x231dc8;});}return null;};}function removeEntity(_0x222247,_0x1f9e80){return function(_0x218a45){if(_0x218a45){return _0x218a45['destroy']()[_0x988a('0x20')](function(){_0x222247[_0x988a('0x2b')](0xcc)[_0x988a('0x36')]();});}};}function handleEntityNotFound(_0x4df3cb,_0x295ac7){return function(_0x353830){if(!_0x353830){_0x4df3cb[_0x988a('0x37')](0x194);}return _0x353830;};}function handleError(_0x48a923,_0x1fe10a){_0x1fe10a=_0x1fe10a||0x1f4;return function(_0x9720ed){logger[_0x988a('0x25')](_0x9720ed['stack']);if(_0x9720ed[_0x988a('0x38')]){delete _0x9720ed['name'];}_0x48a923[_0x988a('0x2b')](_0x1fe10a)[_0x988a('0x39')](_0x9720ed);};}exports[_0x988a('0x3a')]=function(_0x20182a,_0x20946c){var _0x505290={},_0x156623={},_0x903652={'count':0x0,'rows':[]};var _0x566fd9=_[_0x988a('0x3b')](db[_0x988a('0x3c')][_0x988a('0x3d')],function(_0x1dab98){return{'name':_0x1dab98[_0x988a('0x3e')],'type':_0x1dab98['type']['key']};});_0x156623[_0x988a('0x3f')]=_['map'](_0x566fd9,'name');_0x156623[_0x988a('0x40')]=_[_0x988a('0x41')](_0x20182a[_0x988a('0x40')]);_0x156623[_0x988a('0x42')]=_['intersection'](_0x156623[_0x988a('0x3f')],_0x156623[_0x988a('0x40')]);_0x505290[_0x988a('0x43')]=_[_0x988a('0x44')](_0x156623[_0x988a('0x3f')],qs[_0x988a('0x45')](_0x20182a['query'][_0x988a('0x45')]));_0x505290[_0x988a('0x43')]=_0x505290[_0x988a('0x43')][_0x988a('0x46')]?_0x505290[_0x988a('0x43')]:_0x156623[_0x988a('0x3f')];if(!_0x20182a[_0x988a('0x40')][_0x988a('0x47')](_0x988a('0x48'))){_0x505290[_0x988a('0x2f')]=qs['limit'](_0x20182a['query']['limit']);_0x505290[_0x988a('0x2e')]=qs[_0x988a('0x2e')](_0x20182a[_0x988a('0x40')][_0x988a('0x2e')]);}_0x505290[_0x988a('0x49')]=qs[_0x988a('0x4a')](_0x20182a[_0x988a('0x40')][_0x988a('0x4a')]);_0x505290[_0x988a('0x4b')]=qs['filters'](_[_0x988a('0x4c')](_0x20182a[_0x988a('0x40')],_0x156623[_0x988a('0x42')]),_0x566fd9);if(_0x20182a[_0x988a('0x40')][_0x988a('0x4d')]){_0x505290[_0x988a('0x4b')]=_['merge'](_0x505290[_0x988a('0x4b')],{'$or':_[_0x988a('0x3b')](_0x566fd9,function(_0x5cc23a){if(_0x5cc23a[_0x988a('0x4e')]!==_0x988a('0x4f')){var _0x293e16={};_0x293e16[_0x5cc23a[_0x988a('0x38')]]={'$like':'%'+_0x20182a[_0x988a('0x40')][_0x988a('0x4d')]+'%'};return _0x293e16;}})});}_0x505290=_[_0x988a('0x50')]({},_0x505290,_0x20182a[_0x988a('0x51')]);var _0x4d9f91={'where':_0x505290[_0x988a('0x4b')]};return db['Network']['count'](_0x4d9f91)[_0x988a('0x20')](function(_0x430f57){_0x903652['count']=_0x430f57;if(_0x20182a[_0x988a('0x40')][_0x988a('0x52')]){_0x505290[_0x988a('0x53')]=[{'all':!![]}];}return db[_0x988a('0x3c')][_0x988a('0x54')](_0x505290);})[_0x988a('0x20')](function(_0x2fdb2a){_0x903652[_0x988a('0x55')]=_0x2fdb2a;return _0x903652;})[_0x988a('0x20')](respondWithFilteredResult(_0x20946c,_0x505290))[_0x988a('0x2a')](handleError(_0x20946c,null));};exports[_0x988a('0x56')]=function(_0x4e008b,_0x231b3c){var _0x24ba15={'raw':!![],'where':{'id':_0x4e008b['params']['id']}},_0x588b9d={};_0x588b9d[_0x988a('0x3f')]=_[_0x988a('0x41')](db[_0x988a('0x3c')]['rawAttributes']);_0x588b9d[_0x988a('0x40')]=_[_0x988a('0x41')](_0x4e008b[_0x988a('0x40')]);_0x588b9d[_0x988a('0x42')]=_['intersection'](_0x588b9d[_0x988a('0x3f')],_0x588b9d[_0x988a('0x40')]);_0x24ba15[_0x988a('0x43')]=_[_0x988a('0x44')](_0x588b9d[_0x988a('0x3f')],qs[_0x988a('0x45')](_0x4e008b[_0x988a('0x40')][_0x988a('0x45')]));_0x24ba15[_0x988a('0x43')]=_0x24ba15[_0x988a('0x43')][_0x988a('0x46')]?_0x24ba15[_0x988a('0x43')]:_0x588b9d[_0x988a('0x3f')];if(_0x4e008b[_0x988a('0x40')][_0x988a('0x52')]){_0x24ba15[_0x988a('0x53')]=[{'all':!![]}];}_0x24ba15=_['merge']({},_0x24ba15,_0x4e008b[_0x988a('0x51')]);return db[_0x988a('0x3c')][_0x988a('0x57')](_0x24ba15)[_0x988a('0x20')](handleEntityNotFound(_0x231b3c,null))[_0x988a('0x20')](respondWithResult(_0x231b3c,null))[_0x988a('0x2a')](handleError(_0x231b3c,null));};exports['create']=function(_0x18c835,_0x18e1c8,_0x486310){var _0x5c015d;return db[_0x988a('0x58')][_0x988a('0x59')](function(_0x37b90a){return db[_0x988a('0x3c')][_0x988a('0x5a')](_0x18c835[_0x988a('0x5b')],{'raw':!![]})[_0x988a('0x20')](function(_0x1a93a8){_0x5c015d=_0x1a93a8;return db['Network'][_0x988a('0x54')]({'where':{'type':_0x18c835[_0x988a('0x5b')][_0x988a('0x4e')]},'raw':!![]});})[_0x988a('0x20')](function(_0x178d55){if(_0x5c015d[_0x988a('0x4e')][_0x988a('0x5c')]()=='STUN'){var _0x1130f1=fs['readFileSync'](path[_0x988a('0x5d')](config[_0x988a('0x5e')],'server/files/templates/stun_multiple.ejs'),_0x988a('0x5f'));var _0x4374f5=ejs[_0x988a('0x60')](_0x1130f1,{'networks':_0x178d55||[]});fs[_0x988a('0x61')](_0x988a('0x62'),_0x4374f5);return respondWithRpcPromise(_0x988a('0x63'),_0x988a('0x5a'),{'module':_0x988a('0x64')});}else if(_0x5c015d['type'][_0x988a('0x5c')]()==_0x988a('0x65')){var _0x3889a9=fs[_0x988a('0x66')](path[_0x988a('0x5d')](config[_0x988a('0x5e')],_0x988a('0x67')),'utf8');var _0x14a439=ejs[_0x988a('0x60')](_0x3889a9,{'networks':_0x178d55||[]});fs[_0x988a('0x61')](_0x988a('0x68'),_0x14a439);return respondWithRpcPromise(_0x988a('0x63'),_0x988a('0x5a'),{'module':_0x988a('0x64')});}else{var _0x410b98=fs[_0x988a('0x66')](path[_0x988a('0x5d')](config[_0x988a('0x5e')],_0x988a('0x69')),_0x988a('0x5f'));var _0x4a01a3=ejs[_0x988a('0x60')](_0x410b98,{'networks':_0x178d55||[]});fs[_0x988a('0x61')](util[_0x988a('0x6a')](_0x988a('0x6b'),_0x18c835[_0x988a('0x5b')][_0x988a('0x4e')][_0x988a('0x6c')]()),_0x4a01a3);return respondWithRpcPromise(_0x988a('0x63'),_0x988a('0x5a'),{'module':_0x988a('0x6d')});}return null;})['then'](function(){return _0x5c015d;});})[_0x988a('0x20')](respondWithResult(_0x18e1c8,0xc9))[_0x988a('0x2a')](handleError(_0x18e1c8,null));};exports[_0x988a('0x35')]=function(_0x4a23af,_0x42ec2b,_0x1a12dd){var _0x202f8c;return db[_0x988a('0x58')]['transaction'](function(_0x99a9d){return db[_0x988a('0x3c')]['find']({'where':{'id':_0x4a23af[_0x988a('0x6e')]['id']}})[_0x988a('0x20')](handleEntityNotFound(_0x42ec2b,null))[_0x988a('0x20')](saveUpdates(_0x4a23af[_0x988a('0x5b')],null))[_0x988a('0x20')](function(_0x33f503){if(_0x33f503){_0x202f8c=_0x33f503;return db[_0x988a('0x3c')]['findAll']({'where':{'type':_0x202f8c['type']},'raw':!![]});}return null;})[_0x988a('0x20')](function(_0x17cd71){if(_0x202f8c[_0x988a('0x4e')][_0x988a('0x5c')]()==_0x988a('0x6f')){var _0x46e801=fs['readFileSync'](path['join'](config[_0x988a('0x5e')],_0x988a('0x70')),_0x988a('0x5f'));var _0x1dd840=ejs[_0x988a('0x60')](_0x46e801,{'networks':_0x17cd71||[]});fs[_0x988a('0x61')](_0x988a('0x62'),_0x1dd840);return respondWithRpcPromise('Reload',_0x988a('0x35'),{'module':_0x988a('0x64')});}else if(_0x202f8c[_0x988a('0x4e')][_0x988a('0x5c')]()=='TURN'){var _0x1722f8=fs[_0x988a('0x66')](path[_0x988a('0x5d')](config[_0x988a('0x5e')],_0x988a('0x67')),'utf8');var _0x2f3565=ejs[_0x988a('0x60')](_0x1722f8,{'networks':_0x17cd71||[]});fs['writeFileSync'](_0x988a('0x68'),_0x2f3565);return respondWithRpcPromise(_0x988a('0x63'),_0x988a('0x35'),{'module':_0x988a('0x64')});}else{var _0x5a3d26=fs['readFileSync'](path[_0x988a('0x5d')](config['root'],_0x988a('0x69')),_0x988a('0x5f'));var _0x2e9db9=ejs['render'](_0x5a3d26,{'networks':_0x17cd71||[]});fs['writeFileSync'](util[_0x988a('0x6a')]('/etc/asterisk/sip_xcally_%s.conf',_0x4a23af[_0x988a('0x5b')][_0x988a('0x4e')][_0x988a('0x6c')]()),_0x2e9db9);return respondWithRpcPromise('Reload','update',{'module':_0x988a('0x6d')});}return null;})[_0x988a('0x20')](function(_0xca6fd6){if(_0xca6fd6){return _0x202f8c;}return null;});})[_0x988a('0x20')](respondWithResult(_0x42ec2b,null))[_0x988a('0x2a')](handleError(_0x42ec2b,null));};exports['destroy']=function(_0xfbeefd,_0x25c692,_0x520d49){var _0x485cd8;return db[_0x988a('0x3c')][_0x988a('0x57')]({'where':{'id':_0xfbeefd['params']['id']}})[_0x988a('0x20')](function(_0x51c043){_0x485cd8=_0x51c043;return _0x51c043;})['then'](handleEntityNotFound(_0x25c692,null))['then'](removeEntity(_0x25c692,null))[_0x988a('0x20')](function(){if(_0x485cd8){return db[_0x988a('0x3c')][_0x988a('0x54')]({'where':{'type':_0x485cd8[_0x988a('0x4e')]},'raw':!![]});}})['then'](function(_0x1dc5dd){if(_0x485cd8['type'][_0x988a('0x5c')]()=='STUN'){var _0x8010b3=fs[_0x988a('0x66')](path[_0x988a('0x5d')](config[_0x988a('0x5e')],_0x988a('0x70')),'utf8');var _0x258554=ejs['render'](_0x8010b3,{'networks':_0x1dc5dd||[]});fs[_0x988a('0x61')](_0x988a('0x62'),_0x258554);return respondWithRpcPromise(_0x988a('0x63'),_0x988a('0x71'),{'module':'res_stun_monitor.so'});}else if(_0x485cd8[_0x988a('0x4e')][_0x988a('0x5c')]()==_0x988a('0x65')){var _0x2cb226=fs['readFileSync'](path[_0x988a('0x5d')](config[_0x988a('0x5e')],_0x988a('0x67')),_0x988a('0x5f'));var _0x354f84=ejs[_0x988a('0x60')](_0x2cb226,{'networks':_0x1dc5dd||[]});fs[_0x988a('0x61')]('/etc/asterisk/turn_xcally.conf',_0x354f84);return respondWithRpcPromise(_0x988a('0x63'),_0x988a('0x71'),{'module':_0x988a('0x64')});}else{var _0xba9cdd=fs['readFileSync'](path[_0x988a('0x5d')](config[_0x988a('0x5e')],_0x988a('0x69')),_0x988a('0x5f'));var _0x59aa75=ejs[_0x988a('0x60')](_0xba9cdd,{'networks':_0x1dc5dd||[]});fs[_0x988a('0x61')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0xfbeefd[_0x988a('0x5b')][_0x988a('0x4e')][_0x988a('0x6c')]()),_0x59aa75);return respondWithRpcPromise(_0x988a('0x63'),_0x988a('0x71'),{'module':_0x988a('0x6d')});}return null;})[_0x988a('0x2a')](handleError(_0x25c692,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index c857204..47491c8 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 _0x593e=['path','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x16d593,_0x4150ff){var _0x3ba454=function(_0xb7b354){while(--_0xb7b354){_0x16d593['push'](_0x16d593['shift']());}};_0x3ba454(++_0x4150ff);}(_0x593e,0xcb));var _0xe593=function(_0x5ebe17,_0x45f892){_0x5ebe17=_0x5ebe17-0x0;var _0x1f9e57=_0x593e[_0x5ebe17];return _0x1f9e57;};'use strict';var _=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var logger=require(_0xe593('0x2'))(_0xe593('0x3'));var moment=require(_0xe593('0x4'));var BPromise=require(_0xe593('0x5'));var rp=require(_0xe593('0x6'));var fs=require('fs');var path=require(_0xe593('0x7'));var rimraf=require('rimraf');var config=require(_0xe593('0x8'));var attributes=require(_0xe593('0x9'));module[_0xe593('0xa')]=function(_0x1e50d3,_0x3b7082){return _0x1e50d3[_0xe593('0xb')](_0xe593('0xc'),attributes,{'tableName':_0xe593('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5178=['rimraf','../../config/environment','exports','define','Network','network','util','../../config/logger','api','moment','bluebird'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0x5178,0x171));var _0x8517=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x5178[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var logger=require(_0x8517('0x1'))(_0x8517('0x2'));var moment=require(_0x8517('0x3'));var BPromise=require(_0x8517('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var attributes=require('./network.attributes');module[_0x8517('0x7')]=function(_0x58ed7e,_0x13ba05){return _0x58ed7e[_0x8517('0x8')](_0x8517('0x9'),attributes,{'tableName':_0x8517('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index a36c98b..3fc3a3f 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 _0x7e99=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x80544e,_0x37a3f3){var _0x4f9b90=function(_0x4f95d6){while(--_0x4f95d6){_0x80544e['push'](_0x80544e['shift']());}};_0x4f9b90(++_0x37a3f3);}(_0x7e99,0x10d));var _0x97e9=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0x7e99[_0x3e3bee];return _0x3ae14c;};'use strict';var _=require(_0x97e9('0x0'));var util=require(_0x97e9('0x1'));var moment=require('moment');var BPromise=require(_0x97e9('0x2'));var rs=require(_0x97e9('0x3'));var fs=require('fs');var Redis=require(_0x97e9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x97e9('0x5'));var logger=require('../../config/logger')(_0x97e9('0x6'));var config=require(_0x97e9('0x7'));var jayson=require(_0x97e9('0x8'));var client=jayson[_0x97e9('0x9')][_0x97e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b3079,_0x4e9a0b,_0x52e5b0){return new BPromise(function(_0x3f3602,_0x22f7d9){return client['request'](_0x1b3079,_0x52e5b0)[_0x97e9('0xb')](function(_0x40de19){logger[_0x97e9('0xc')](_0x97e9('0xd'),_0x4e9a0b,'request\x20sent');logger['debug'](_0x97e9('0xe'),_0x4e9a0b,_0x97e9('0xf'),JSON[_0x97e9('0x10')](_0x40de19));if(_0x40de19[_0x97e9('0x11')]){if(_0x40de19['error']['code']===0x1f4){logger['error'](_0x97e9('0xd'),_0x4e9a0b,_0x40de19[_0x97e9('0x11')][_0x97e9('0x12')]);return _0x22f7d9(_0x40de19[_0x97e9('0x11')][_0x97e9('0x12')]);}logger[_0x97e9('0x11')]('Network,\x20%s,\x20%s',_0x4e9a0b,_0x40de19[_0x97e9('0x11')][_0x97e9('0x12')]);return _0x3f3602(_0x40de19[_0x97e9('0x11')][_0x97e9('0x12')]);}else{logger[_0x97e9('0xc')](_0x97e9('0xd'),_0x4e9a0b,_0x97e9('0xf'));_0x3f3602(_0x40de19[_0x97e9('0x13')][_0x97e9('0x12')]);}})[_0x97e9('0x14')](function(_0x2189e8){logger['error'](_0x97e9('0xd'),_0x4e9a0b,_0x2189e8);_0x22f7d9(_0x2189e8);});});} \ No newline at end of file +var _0xee15=['error','code','message','info','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x54388a,_0x112d3e){var _0x3f5f0e=function(_0x2f1016){while(--_0x2f1016){_0x54388a['push'](_0x54388a['shift']());}};_0x3f5f0e(++_0x112d3e);}(_0xee15,0x180));var _0x5ee1=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0xee15[_0x2cc711];return _0x31a52e;};'use strict';var _=require(_0x5ee1('0x0'));var util=require('util');var moment=require(_0x5ee1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ee1('0x2'));var db=require(_0x5ee1('0x3'))['db'];var utils=require(_0x5ee1('0x4'));var logger=require('../../config/logger')(_0x5ee1('0x5'));var config=require(_0x5ee1('0x6'));var jayson=require(_0x5ee1('0x7'));var client=jayson[_0x5ee1('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e202b,_0x1e14a8,_0x45cbf1){return new BPromise(function(_0x4f5704,_0x114b5b){return client[_0x5ee1('0x9')](_0x3e202b,_0x45cbf1)[_0x5ee1('0xa')](function(_0x43ac60){logger['info'](_0x5ee1('0xb'),_0x1e14a8,_0x5ee1('0xc'));logger[_0x5ee1('0xd')](_0x5ee1('0xe'),_0x1e14a8,_0x5ee1('0xc'),JSON[_0x5ee1('0xf')](_0x43ac60));if(_0x43ac60[_0x5ee1('0x10')]){if(_0x43ac60['error'][_0x5ee1('0x11')]===0x1f4){logger[_0x5ee1('0x10')](_0x5ee1('0xb'),_0x1e14a8,_0x43ac60[_0x5ee1('0x10')][_0x5ee1('0x12')]);return _0x114b5b(_0x43ac60[_0x5ee1('0x10')]['message']);}logger['error'](_0x5ee1('0xb'),_0x1e14a8,_0x43ac60[_0x5ee1('0x10')]['message']);return _0x4f5704(_0x43ac60[_0x5ee1('0x10')]['message']);}else{logger[_0x5ee1('0x13')](_0x5ee1('0xb'),_0x1e14a8,'request\x20sent');_0x4f5704(_0x43ac60['result'][_0x5ee1('0x12')]);}})['catch'](function(_0xa3754b){logger[_0x5ee1('0x10')](_0x5ee1('0xb'),_0x1e14a8,_0xa3754b);_0x114b5b(_0xa3754b);});});} \ No newline at end of file diff --git a/server/api/notification/index.js b/server/api/notification/index.js index d90b6cd..422509c 100644 --- a/server/api/notification/index.js +++ b/server/api/notification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc00c=['express','Router','../../components/interaction/service','../../config/environment','./notification.controller','post','isAuthenticated','multer','path'];(function(_0x33452f,_0x394f9e){var _0x2f09d6=function(_0x3988b7){while(--_0x3988b7){_0x33452f['push'](_0x33452f['shift']());}};_0x2f09d6(++_0x394f9e);}(_0xc00c,0xe8));var _0xcc00=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xc00c[_0x3305de];return _0x3b5a84;};'use strict';var multer=require(_0xcc00('0x0'));var util=require('util');var path=require(_0xcc00('0x1'));var timeout=require('connect-timeout');var express=require(_0xcc00('0x2'));var router=express[_0xcc00('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xcc00('0x4'));var config=require(_0xcc00('0x5'));var controller=require(_0xcc00('0x6'));router[_0xcc00('0x7')]('/',auth[_0xcc00('0x8')](),controller['sendNotification']);module['exports']=router; \ No newline at end of file +var _0x3b4b=['./notification.controller','post','isAuthenticated','sendNotification','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x30fde3,_0x69fd6){var _0x45703f=function(_0x470c4e){while(--_0x470c4e){_0x30fde3['push'](_0x30fde3['shift']());}};_0x45703f(++_0x69fd6);}(_0x3b4b,0x1d3));var _0xb3b4=function(_0x66ff82,_0xabdb1c){_0x66ff82=_0x66ff82-0x0;var _0x318053=_0x3b4b[_0x66ff82];return _0x318053;};'use strict';var multer=require(_0xb3b4('0x0'));var util=require(_0xb3b4('0x1'));var path=require(_0xb3b4('0x2'));var timeout=require(_0xb3b4('0x3'));var express=require('express');var router=express[_0xb3b4('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb3b4('0x5'));var config=require('../../config/environment');var controller=require(_0xb3b4('0x6'));router[_0xb3b4('0x7')]('/',auth[_0xb3b4('0x8')](),controller[_0xb3b4('0x9')]);module[_0xb3b4('0xa')]=router; \ No newline at end of file diff --git a/server/api/notification/notification.attributes.js b/server/api/notification/notification.attributes.js index e86bc12..8ddad4e 100644 --- a/server/api/notification/notification.attributes.js +++ b/server/api/notification/notification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf86d=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x31ce60,_0x37833e){var _0x8470dc=function(_0x3844ee){while(--_0x3844ee){_0x31ce60['push'](_0x31ce60['shift']());}};_0x8470dc(++_0x37833e);}(_0xf86d,0xde));var _0xdf86=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xf86d[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require(_0xdf86('0x0'));module['exports']={'body':{'type':Sequelize[_0xdf86('0x1')]},'senderName':{'type':Sequelize[_0xdf86('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0xdf86('0x2')]},'beep':{'type':Sequelize[_0xdf86('0x3')]}}; \ No newline at end of file +var _0x48b7=['BOOLEAN','exports','TEXT','STRING'];(function(_0x235fd5,_0x43a5f2){var _0x5f4cd3=function(_0x105945){while(--_0x105945){_0x235fd5['push'](_0x235fd5['shift']());}};_0x5f4cd3(++_0x43a5f2);}(_0x48b7,0xf5));var _0x748b=function(_0x426e92,_0x554cd2){_0x426e92=_0x426e92-0x0;var _0x5034eb=_0x48b7[_0x426e92];return _0x5034eb;};'use strict';var Sequelize=require('sequelize');module[_0x748b('0x0')]={'body':{'type':Sequelize[_0x748b('0x1')]},'senderName':{'type':Sequelize[_0x748b('0x2')]},'recipientsId':{'type':Sequelize[_0x748b('0x1')]},'recipientsDescription':{'type':Sequelize[_0x748b('0x2')]},'beep':{'type':Sequelize[_0x748b('0x3')]}}; \ No newline at end of file diff --git a/server/api/notification/notification.controller.js b/server/api/notification/notification.controller.js index 04e72d6..42064f0 100644 --- a/server/api/notification/notification.controller.js +++ b/server/api/notification/notification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb021=['mustache','path','sox','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','localhost','redis','register','sendStatus','status','end','count','offset','limit','set','json','apply','save','then','destroy','error','stack','name','sendNotification','hasOwnProperty','text','body','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','voicequeue','team','user','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sequelize','transaction','create','recipient','emit','notification:send','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','forEach','startCase','toLowerCase','User','ids','queue','replace','Queue','push','union','getAgents','map','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x4dfd70,_0x35e8d2){var _0x48d818=function(_0x4e9e22){while(--_0x4e9e22){_0x4dfd70['push'](_0x4dfd70['shift']());}};_0x48d818(++_0x35e8d2);}(_0xb021,0x170));var _0x1b02=function(_0x287eaf,_0x41d318){_0x287eaf=_0x287eaf-0x0;var _0x321683=_0xb021[_0x287eaf];return _0x321683;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1b02('0x0'));var jsonpatch=require(_0x1b02('0x1'));var rp=require(_0x1b02('0x2'));var moment=require(_0x1b02('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b02('0x4'));var util=require('util');var path=require(_0x1b02('0x5'));var sox=require(_0x1b02('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1b02('0x7'));var crypto=require(_0x1b02('0x8'));var jsforce=require(_0x1b02('0x9'));var deskjs=require(_0x1b02('0xa'));var toCsv=require('to-csv');var querystring=require(_0x1b02('0xb'));var Papa=require(_0x1b02('0xc'));var Redis=require(_0x1b02('0xd'));var authService=require(_0x1b02('0xe'));var qs=require(_0x1b02('0xf'));var as=require(_0x1b02('0x10'));var hardwareService=require(_0x1b02('0x11'));var logger=require(_0x1b02('0x12'))(_0x1b02('0x13'));var utils=require(_0x1b02('0x14'));var config=require(_0x1b02('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x1b02('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1b02('0x17')]));require('./notification.socket')[_0x1b02('0x18')](socket);function respondWithStatusCode(_0x40916b,_0x575b6f){_0x575b6f=_0x575b6f||0xcc;return function(_0x5d1483){if(_0x5d1483){return _0x40916b[_0x1b02('0x19')](_0x575b6f);}return _0x40916b[_0x1b02('0x1a')](_0x575b6f)[_0x1b02('0x1b')]();};}function respondWithResult(_0x422f53,_0x4be7f6){_0x4be7f6=_0x4be7f6||0xc8;return function(_0x5c72ea){if(_0x5c72ea){return _0x422f53[_0x1b02('0x1a')](_0x4be7f6)['json'](_0x5c72ea);}};}function respondWithFilteredResult(_0x348c5b,_0x5a8702){return function(_0x652335){if(_0x652335){var _0xbb5ad0=_0x652335[_0x1b02('0x1c')],_0x4107e2=_0x5a8702['offset'],_0x1f67af=_0x5a8702[_0x1b02('0x1d')]+_0x5a8702[_0x1b02('0x1e')],_0x2c8c4d;if(_0x1f67af>=_0xbb5ad0){_0x1f67af=_0xbb5ad0;_0x2c8c4d=0xc8;}else{_0x2c8c4d=0xce;}_0x348c5b[_0x1b02('0x1a')](_0x2c8c4d);return _0x348c5b[_0x1b02('0x1f')]('Content-Range',_0x4107e2+'-'+_0x1f67af+'/'+_0xbb5ad0)[_0x1b02('0x20')](_0x652335);}return null;};}function patchUpdates(_0x124a99){return function(_0x13f604){try{jsonpatch[_0x1b02('0x21')](_0x13f604,_0x124a99,!![]);}catch(_0x4b0bab){return BPromise['reject'](_0x4b0bab);}return _0x13f604[_0x1b02('0x22')]();};}function saveUpdates(_0x4d371f,_0x2d63d1){return function(_0x4e7584){if(_0x4e7584){return _0x4e7584['update'](_0x4d371f)[_0x1b02('0x23')](function(_0x4edcb0){return _0x4edcb0;});}return null;};}function removeEntity(_0x24d3ba,_0x194c4b){return function(_0xd75f25){if(_0xd75f25){return _0xd75f25[_0x1b02('0x24')]()['then'](function(){_0x24d3ba[_0x1b02('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d4abf,_0x4293c5){return function(_0x11ba64){if(!_0x11ba64){_0x2d4abf['sendStatus'](0x194);}return _0x11ba64;};}function handleError(_0x30f891,_0x712300){_0x712300=_0x712300||0x1f4;return function(_0x401708){logger[_0x1b02('0x25')](_0x401708[_0x1b02('0x26')]);if(_0x401708[_0x1b02('0x27')]){delete _0x401708['name'];}_0x30f891[_0x1b02('0x1a')](_0x712300)['send'](_0x401708);};}exports[_0x1b02('0x28')]=function(_0x5e759f,_0xfe9d8c,_0x11f27b){if(!_0x5e759f['body'][_0x1b02('0x29')](_0x1b02('0x2a'))&&!_0x5e759f[_0x1b02('0x2b')]['hasOwnProperty'](_0x1b02('0x2c'))){throw new db[(_0x1b02('0x2d'))][(_0x1b02('0x2e'))](_0x1b02('0x2f'));}else{if(_0x5e759f[_0x1b02('0x2b')][_0x1b02('0x29')](_0x1b02('0x2c'))&&!_0x5e759f['body'][_0x1b02('0x29')](_0x1b02('0x30'))){throw new db[(_0x1b02('0x2d'))]['ValidationError'](_0x1b02('0x31'));}if(!_0x5e759f[_0x1b02('0x2b')][_0x1b02('0x29')](_0x1b02('0x32'))){throw new db[(_0x1b02('0x2d'))][(_0x1b02('0x2e'))](_0x1b02('0x33'));}else{try{var _0x5a74=JSON[_0x1b02('0x34')](_0x5e759f[_0x1b02('0x2b')][_0x1b02('0x32')]);}catch(_0x2b31af){logger[_0x1b02('0x25')](_0x2b31af);throw new db[(_0x1b02('0x2d'))][(_0x1b02('0x2e'))](_0x1b02('0x35'));}var _0x355ed6=[_0x1b02('0x36'),_0x1b02('0x37'),_0x1b02('0x38'),'openchannelqueue','smsqueue',_0x1b02('0x39'),'whatsappqueue',_0x1b02('0x3a'),_0x1b02('0x3b')];if(_[_0x1b02('0x3c')](_0x5a74,function(_0x33530f){return!_[_0x1b02('0x3d')](_0x355ed6,_0x33530f[_0x1b02('0x3e')]['toLowerCase']());})){throw new db[(_0x1b02('0x2d'))][(_0x1b02('0x2e'))](_0x1b02('0x3f'));}}}var _0x319f26={};_0x319f26['senderName']=_0x5e759f[_0x1b02('0x2b')][_0x1b02('0x29')](_0x1b02('0x40'))?_0x5e759f[_0x1b02('0x2b')][_0x1b02('0x40')]:_0x5e759f[_0x1b02('0x3b')]['fullname'];_0x319f26[_0x1b02('0x41')]=_[_0x1b02('0x42')](_0x5e759f[_0x1b02('0x2b')]['recipientsDescription'])?null:_0x5e759f['body'][_0x1b02('0x41')];_0x319f26[_0x1b02('0x43')]=_0x5e759f[_0x1b02('0x2b')][_0x1b02('0x43')]||![];_0x319f26[_0x1b02('0x44')]=_0x5e759f['user']['id'];return getContent(_0x5e759f[_0x1b02('0x2b')])[_0x1b02('0x23')](function(_0xfdf7e0){_0x319f26['body']=_0xfdf7e0;return getRecipients(_0x5a74);})[_0x1b02('0x23')](function(_0x3e8881){_0x319f26[_0x1b02('0x45')]=_['sortBy'](_0x3e8881)['join'](',');return db[_0x1b02('0x46')][_0x1b02('0x47')](function(_0x3a6e15){return db['Notification'][_0x1b02('0x48')](_0x319f26,{'raw':!![],'transaction':_0x3a6e15})[_0x1b02('0x23')](function(_0x2d90eb){var _0x438b88={'sender':_0x319f26[_0x1b02('0x40')],'description':_0x319f26[_0x1b02('0x41')],'content':_0x319f26[_0x1b02('0x2b')],'beep':_0x319f26[_0x1b02('0x43')]};_0x3e8881['forEach'](function(_0x3b8105){_0x438b88[_0x1b02('0x49')]=_0x3b8105;socket[_0x1b02('0x4a')](_0x1b02('0x4b'),_0x438b88);});return _0x2d90eb;});});})[_0x1b02('0x23')](respondWithResult(_0xfe9d8c,0xc9))['catch'](handleError(_0xfe9d8c,null));};function getContent(_0x9b3cc1){return new BPromise(function(_0x33e1fa,_0x552b81){if(_0x9b3cc1['text']){_0x33e1fa(_0x9b3cc1[_0x1b02('0x2a')]);return;}return db[_0x1b02('0x4c')][_0x1b02('0x4d')]({'attributes':['html'],'where':{'id':_0x9b3cc1['TemplateId']},'raw':!![]})[_0x1b02('0x23')](function(_0x488136){if(!_0x488136)throw new db[(_0x1b02('0x2d'))][(_0x1b02('0x2e'))](_0x1b02('0x4e'));var _0x5e55ba=Mustache[_0x1b02('0x4f')](_0x488136['html'],_0x9b3cc1[_0x1b02('0x30')]);_0x33e1fa(_0x5e55ba);})[_0x1b02('0x50')](function(_0x514db9){_0x552b81(_0x514db9);});});}function getRecipients(_0x3d543a){return new BPromise(function(_0x48c261,_0x4795ec){var _0x4414ef=[];var _0x5ee9a0=[];_0x3d543a[_0x1b02('0x51')](function(_0x4c0ef7){var _0x324e6e=_[_0x1b02('0x52')](_0x4c0ef7[_0x1b02('0x3e')][_0x1b02('0x53')]());if(_0x324e6e===_0x1b02('0x54')){_0x4414ef=_['union'](_0x4414ef,_0x4c0ef7[_0x1b02('0x55')]);}else{if(_[_0x1b02('0x3d')](_0x324e6e,_0x1b02('0x56')))_0x324e6e=_0x324e6e[_0x1b02('0x57')]('queue',_0x1b02('0x58'));_0x4c0ef7[_0x1b02('0x55')][_0x1b02('0x51')](function(_0x56974c){_0x5ee9a0[_0x1b02('0x59')](getAgents(_0x324e6e,_0x56974c));});}});return BPromise['all'](_0x5ee9a0)['then'](function(_0x4e2a5e){_0x4414ef=_[_0x1b02('0x5a')](_0x4414ef,_['flatten'](_0x4e2a5e));_0x48c261(_0x4414ef);})['catch'](function(_0x5bdc9e){_0x4795ec(_0x5bdc9e);});});}function getAgents(_0x585c07,_0x4195fb){return new BPromise(function(_0x320d81,_0x514d17){return db[_0x585c07][_0x1b02('0x4d')]({'where':{'id':_0x4195fb}})[_0x1b02('0x23')](function(_0xead6ed){return _0xead6ed[_0x1b02('0x5b')]({'attributes':['id'],'raw':!![]})[_0x1b02('0x23')](function(_0x1a366b){var _0x26b57d=_[_0x1b02('0x5c')](_0x1a366b,'id');_0x320d81(_0x26b57d);});})[_0x1b02('0x50')](function(_0x2b3dab){_0x514d17(_0x2b3dab);});});} \ No newline at end of file +var _0x5c68=['desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./notification.socket','sendStatus','status','end','count','offset','set','json','apply','reject','save','then','destroy','stack','name','send','sendNotification','body','text','hasOwnProperty','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','ValidationError','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','chatqueue','faxqueue','openchannelqueue','whatsappqueue','team','user','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','SenderId','recipientsId','sortBy','sequelize','transaction','Notification','create','beep','forEach','emit','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','includes','queue','Queue','ids','push','union','flatten','getAgents','map','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x10e0cf,_0x367065){var _0x1a330a=function(_0xe5b316){while(--_0xe5b316){_0x10e0cf['push'](_0x10e0cf['shift']());}};_0x1a330a(++_0x367065);}(_0x5c68,0x1cb));var _0x85c6=function(_0x1e3671,_0x9ae4fc){_0x1e3671=_0x1e3671-0x0;var _0x48d5f5=_0x5c68[_0x1e3671];return _0x48d5f5;};'use strict';var pdf=require(_0x85c6('0x0'));var emlformat=require(_0x85c6('0x1'));var rimraf=require(_0x85c6('0x2'));var zipdir=require(_0x85c6('0x3'));var jsonpatch=require(_0x85c6('0x4'));var rp=require('request-promise');var moment=require(_0x85c6('0x5'));var BPromise=require(_0x85c6('0x6'));var Mustache=require(_0x85c6('0x7'));var util=require(_0x85c6('0x8'));var path=require(_0x85c6('0x9'));var sox=require(_0x85c6('0xa'));var csv=require(_0x85c6('0xb'));var ejs=require(_0x85c6('0xc'));var fs=require('fs');var _=require(_0x85c6('0xd'));var squel=require(_0x85c6('0xe'));var crypto=require(_0x85c6('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x85c6('0x10'));var toCsv=require(_0x85c6('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x85c6('0x11'));var authService=require(_0x85c6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x85c6('0x13'));var hardwareService=require(_0x85c6('0x14'));var logger=require(_0x85c6('0x15'))('api');var utils=require(_0x85c6('0x16'));var config=require(_0x85c6('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x85c6('0x18')](config[_0x85c6('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x85c6('0x1a'))(new Redis(config['redis']));require(_0x85c6('0x1b'))['register'](socket);function respondWithStatusCode(_0x44f4a5,_0x59904e){_0x59904e=_0x59904e||0xcc;return function(_0x3d2de6){if(_0x3d2de6){return _0x44f4a5[_0x85c6('0x1c')](_0x59904e);}return _0x44f4a5[_0x85c6('0x1d')](_0x59904e)[_0x85c6('0x1e')]();};}function respondWithResult(_0x2ddaaa,_0x22720f){_0x22720f=_0x22720f||0xc8;return function(_0x4801b7){if(_0x4801b7){return _0x2ddaaa[_0x85c6('0x1d')](_0x22720f)['json'](_0x4801b7);}};}function respondWithFilteredResult(_0x5070c5,_0x2f377e){return function(_0xdfc3f7){if(_0xdfc3f7){var _0xaae627=_0xdfc3f7[_0x85c6('0x1f')],_0x29fe15=_0x2f377e[_0x85c6('0x20')],_0x5deace=_0x2f377e[_0x85c6('0x20')]+_0x2f377e['limit'],_0x5629e9;if(_0x5deace>=_0xaae627){_0x5deace=_0xaae627;_0x5629e9=0xc8;}else{_0x5629e9=0xce;}_0x5070c5[_0x85c6('0x1d')](_0x5629e9);return _0x5070c5[_0x85c6('0x21')]('Content-Range',_0x29fe15+'-'+_0x5deace+'/'+_0xaae627)[_0x85c6('0x22')](_0xdfc3f7);}return null;};}function patchUpdates(_0x50f71d){return function(_0x4b9454){try{jsonpatch[_0x85c6('0x23')](_0x4b9454,_0x50f71d,!![]);}catch(_0x44bb30){return BPromise[_0x85c6('0x24')](_0x44bb30);}return _0x4b9454[_0x85c6('0x25')]();};}function saveUpdates(_0x529733,_0x55cafc){return function(_0x13cb4c){if(_0x13cb4c){return _0x13cb4c['update'](_0x529733)[_0x85c6('0x26')](function(_0x7f5e00){return _0x7f5e00;});}return null;};}function removeEntity(_0x4bc8a6,_0x54d148){return function(_0x39bb7d){if(_0x39bb7d){return _0x39bb7d[_0x85c6('0x27')]()[_0x85c6('0x26')](function(){_0x4bc8a6[_0x85c6('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x545995,_0x16e81){return function(_0x29fff4){if(!_0x29fff4){_0x545995['sendStatus'](0x194);}return _0x29fff4;};}function handleError(_0x5a53b6,_0x30e858){_0x30e858=_0x30e858||0x1f4;return function(_0x4492ff){logger['error'](_0x4492ff[_0x85c6('0x28')]);if(_0x4492ff[_0x85c6('0x29')]){delete _0x4492ff[_0x85c6('0x29')];}_0x5a53b6[_0x85c6('0x1d')](_0x30e858)[_0x85c6('0x2a')](_0x4492ff);};}exports[_0x85c6('0x2b')]=function(_0x4e7d20,_0x2748a0,_0x3cd78b){if(!_0x4e7d20[_0x85c6('0x2c')]['hasOwnProperty'](_0x85c6('0x2d'))&&!_0x4e7d20[_0x85c6('0x2c')][_0x85c6('0x2e')](_0x85c6('0x2f'))){throw new db[(_0x85c6('0x30'))]['ValidationError'](_0x85c6('0x31'));}else{if(_0x4e7d20[_0x85c6('0x2c')][_0x85c6('0x2e')](_0x85c6('0x2f'))&&!_0x4e7d20[_0x85c6('0x2c')]['hasOwnProperty'](_0x85c6('0x32'))){throw new db['Sequelize'][(_0x85c6('0x33'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x4e7d20[_0x85c6('0x2c')]['hasOwnProperty'](_0x85c6('0x34'))){throw new db[(_0x85c6('0x30'))]['ValidationError'](_0x85c6('0x35'));}else{try{var _0x23fc1d=JSON[_0x85c6('0x36')](_0x4e7d20[_0x85c6('0x2c')][_0x85c6('0x34')]);}catch(_0x140385){logger[_0x85c6('0x37')](_0x140385);throw new db['Sequelize'][(_0x85c6('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x4b71ea=[_0x85c6('0x38'),_0x85c6('0x39'),'mailqueue',_0x85c6('0x3a'),'smsqueue','voicequeue',_0x85c6('0x3b'),_0x85c6('0x3c'),_0x85c6('0x3d')];if(_['some'](_0x23fc1d,function(_0x148671){return!_['includes'](_0x4b71ea,_0x148671[_0x85c6('0x3e')][_0x85c6('0x3f')]());})){throw new db['Sequelize'][(_0x85c6('0x33'))](_0x85c6('0x40'));}}}var _0x2f139c={};_0x2f139c['senderName']=_0x4e7d20[_0x85c6('0x2c')][_0x85c6('0x2e')](_0x85c6('0x41'))?_0x4e7d20[_0x85c6('0x2c')][_0x85c6('0x41')]:_0x4e7d20['user'][_0x85c6('0x42')];_0x2f139c[_0x85c6('0x43')]=_[_0x85c6('0x44')](_0x4e7d20[_0x85c6('0x2c')][_0x85c6('0x43')])?null:_0x4e7d20[_0x85c6('0x2c')][_0x85c6('0x43')];_0x2f139c['beep']=_0x4e7d20[_0x85c6('0x2c')]['beep']||![];_0x2f139c[_0x85c6('0x45')]=_0x4e7d20[_0x85c6('0x3d')]['id'];return getContent(_0x4e7d20[_0x85c6('0x2c')])[_0x85c6('0x26')](function(_0x2df0a0){_0x2f139c['body']=_0x2df0a0;return getRecipients(_0x23fc1d);})[_0x85c6('0x26')](function(_0x4a86a6){_0x2f139c[_0x85c6('0x46')]=_[_0x85c6('0x47')](_0x4a86a6)['join'](',');return db[_0x85c6('0x48')][_0x85c6('0x49')](function(_0x567bfe){return db[_0x85c6('0x4a')][_0x85c6('0x4b')](_0x2f139c,{'raw':!![],'transaction':_0x567bfe})[_0x85c6('0x26')](function(_0x5eb0fe){var _0x1eecb3={'sender':_0x2f139c[_0x85c6('0x41')],'description':_0x2f139c[_0x85c6('0x43')],'content':_0x2f139c['body'],'beep':_0x2f139c[_0x85c6('0x4c')]};_0x4a86a6[_0x85c6('0x4d')](function(_0x3f8394){_0x1eecb3['recipient']=_0x3f8394;socket[_0x85c6('0x4e')]('notification:send',_0x1eecb3);});return _0x5eb0fe;});});})['then'](respondWithResult(_0x2748a0,0xc9))[_0x85c6('0x4f')](handleError(_0x2748a0,null));};function getContent(_0x3a0e04){return new BPromise(function(_0x4dec76,_0x1860aa){if(_0x3a0e04[_0x85c6('0x2d')]){_0x4dec76(_0x3a0e04['text']);return;}return db[_0x85c6('0x50')][_0x85c6('0x51')]({'attributes':[_0x85c6('0x52')],'where':{'id':_0x3a0e04['TemplateId']},'raw':!![]})[_0x85c6('0x26')](function(_0xfeb1e6){if(!_0xfeb1e6)throw new db[(_0x85c6('0x30'))][(_0x85c6('0x33'))](_0x85c6('0x53'));var _0xc671b0=Mustache[_0x85c6('0x54')](_0xfeb1e6[_0x85c6('0x52')],_0x3a0e04['view']);_0x4dec76(_0xc671b0);})[_0x85c6('0x4f')](function(_0x48004c){_0x1860aa(_0x48004c);});});}function getRecipients(_0x4ca2d2){return new BPromise(function(_0x3084b3,_0x390d6a){var _0x1cef6c=[];var _0x50c496=[];_0x4ca2d2[_0x85c6('0x4d')](function(_0x4ce871){var _0x5752b2=_[_0x85c6('0x55')](_0x4ce871['model'][_0x85c6('0x3f')]());if(_0x5752b2==='User'){_0x1cef6c=_['union'](_0x1cef6c,_0x4ce871['ids']);}else{if(_[_0x85c6('0x56')](_0x5752b2,_0x85c6('0x57')))_0x5752b2=_0x5752b2['replace']('queue',_0x85c6('0x58'));_0x4ce871[_0x85c6('0x59')][_0x85c6('0x4d')](function(_0x19b8ba){_0x50c496[_0x85c6('0x5a')](getAgents(_0x5752b2,_0x19b8ba));});}});return BPromise['all'](_0x50c496)['then'](function(_0x381a1d){_0x1cef6c=_[_0x85c6('0x5b')](_0x1cef6c,_[_0x85c6('0x5c')](_0x381a1d));_0x3084b3(_0x1cef6c);})[_0x85c6('0x4f')](function(_0x2e618d){_0x390d6a(_0x2e618d);});});}function getAgents(_0x3f370d,_0x3b0f3f){return new BPromise(function(_0x54fb70,_0x4b9989){return db[_0x3f370d][_0x85c6('0x51')]({'where':{'id':_0x3b0f3f}})[_0x85c6('0x26')](function(_0x5b0d65){return _0x5b0d65[_0x85c6('0x5d')]({'attributes':['id'],'raw':!![]})[_0x85c6('0x26')](function(_0x2a5e34){var _0x5ed028=_[_0x85c6('0x5e')](_0x2a5e34,'id');_0x54fb70(_0x5ed028);});})[_0x85c6('0x4f')](function(_0x1a58e1){_0x4b9989(_0x1a58e1);});});} \ No newline at end of file diff --git a/server/api/notification/notification.events.js b/server/api/notification/notification.events.js index 4999570..93ae7cf 100644 --- a/server/api/notification/notification.events.js +++ b/server/api/notification/notification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['Notification','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x348135,_0x21dd2b){var _0x49621a=function(_0x210bf4){while(--_0x210bf4){_0x348135['push'](_0x348135['shift']());}};_0x49621a(++_0x21dd2b);}(_0xdb28,0x106));var _0x8db2=function(_0x150095,_0x393d81){_0x150095=_0x150095-0x0;var _0x20f4e8=_0xdb28[_0x150095];return _0x20f4e8;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var Notification=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var NotificationEvents=new EventEmitter();NotificationEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){NotificationEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);NotificationEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Notification['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=NotificationEvents; \ No newline at end of file +var _0xdb28=['Notification','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x1c21ea,_0x1cd741){var _0xf5ea6b=function(_0x4dfcf5){while(--_0x4dfcf5){_0x1c21ea['push'](_0x1c21ea['shift']());}};_0xf5ea6b(++_0x1cd741);}(_0xdb28,0x106));var _0x8db2=function(_0x2d28c8,_0x522b89){_0x2d28c8=_0x2d28c8-0x0;var _0x2ff038=_0xdb28[_0x2d28c8];return _0x2ff038;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var Notification=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var NotificationEvents=new EventEmitter();NotificationEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){NotificationEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);NotificationEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Notification['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=NotificationEvents; \ No newline at end of file diff --git a/server/api/notification/notification.model.js b/server/api/notification/notification.model.js index ddbce9c..6ecd2ed 100644 --- a/server/api/notification/notification.model.js +++ b/server/api/notification/notification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x955f=['moment','request-promise','../../config/environment','exports','Notification','notifications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x3ba41d,_0x30ac3a){var _0x39595c=function(_0x353969){while(--_0x353969){_0x3ba41d['push'](_0x3ba41d['shift']());}};_0x39595c(++_0x30ac3a);}(_0x955f,0x1eb));var _0xf955=function(_0x4d0477,_0x158ca4){_0x4d0477=_0x4d0477-0x0;var _0x38ec78=_0x955f[_0x4d0477];return _0x38ec78;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var logger=require(_0xf955('0x2'))(_0xf955('0x3'));var moment=require(_0xf955('0x4'));var BPromise=require('bluebird');var rp=require(_0xf955('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf955('0x6'));var attributes=require('./notification.attributes');module[_0xf955('0x7')]=function(_0x2caff2,_0x3fdac2){return _0x2caff2['define'](_0xf955('0x8'),attributes,{'tableName':_0xf955('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf955('0xa')});}; \ No newline at end of file +var _0xb7e7=['Notification','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./notification.attributes','define'];(function(_0x555479,_0x3aa2b4){var _0x560c8e=function(_0x5168ef){while(--_0x5168ef){_0x555479['push'](_0x555479['shift']());}};_0x560c8e(++_0x3aa2b4);}(_0xb7e7,0x121));var _0x7b7e=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xb7e7[_0x24259d];return _0x5a701;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'notifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b7e('0x9'),'collate':_0x7b7e('0xa')});}; \ No newline at end of file diff --git a/server/api/notification/notification.rpc.js b/server/api/notification/notification.rpc.js index 9b48d13..16cd74e 100644 --- a/server/api/notification/notification.rpc.js +++ b/server/api/notification/notification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1b0=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./notification.socket','then','Notification,\x20%s,\x20%s','request\x20sent','Notification,\x20%s,\x20%s,\x20%s','error','code','message','util','moment','bluebird','randomstring','ioredis'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xc1b0,0x1df));var _0x0c1b=function(_0x400322,_0x4353a8){_0x400322=_0x400322-0x0;var _0xfdd597=_0xc1b0[_0x400322];return _0xfdd597;};'use strict';var _=require('lodash');var util=require(_0x0c1b('0x0'));var moment=require(_0x0c1b('0x1'));var BPromise=require(_0x0c1b('0x2'));var rs=require(_0x0c1b('0x3'));var fs=require('fs');var Redis=require(_0x0c1b('0x4'));var db=require(_0x0c1b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0c1b('0x6'));var config=require(_0x0c1b('0x7'));var jayson=require(_0x0c1b('0x8'));var client=jayson[_0x0c1b('0x9')][_0x0c1b('0xa')]({'port':0x232a});config[_0x0c1b('0xb')]=_[_0x0c1b('0xc')](config[_0x0c1b('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0c1b('0xd'))(new Redis(config[_0x0c1b('0xb')]));require(_0x0c1b('0xe'))['register'](socket);function respondWithRpcPromise(_0x12305d,_0xe7a8e7,_0x1d1aee){return new BPromise(function(_0x4847e5,_0x582948){return client['request'](_0x12305d,_0x1d1aee)[_0x0c1b('0xf')](function(_0x51d435){logger['info'](_0x0c1b('0x10'),_0xe7a8e7,_0x0c1b('0x11'));logger['debug'](_0x0c1b('0x12'),_0xe7a8e7,_0x0c1b('0x11'),JSON['stringify'](_0x51d435));if(_0x51d435[_0x0c1b('0x13')]){if(_0x51d435[_0x0c1b('0x13')][_0x0c1b('0x14')]===0x1f4){logger[_0x0c1b('0x13')](_0x0c1b('0x10'),_0xe7a8e7,_0x51d435[_0x0c1b('0x13')]['message']);return _0x582948(_0x51d435['error'][_0x0c1b('0x15')]);}logger[_0x0c1b('0x13')](_0x0c1b('0x10'),_0xe7a8e7,_0x51d435[_0x0c1b('0x13')][_0x0c1b('0x15')]);return _0x4847e5(_0x51d435[_0x0c1b('0x13')]['message']);}else{logger['info'](_0x0c1b('0x10'),_0xe7a8e7,_0x0c1b('0x11'));_0x4847e5(_0x51d435['result']['message']);}})['catch'](function(_0x17fee1){logger[_0x0c1b('0x13')](_0x0c1b('0x10'),_0xe7a8e7,_0x17fee1);_0x582948(_0x17fee1);});});} \ No newline at end of file +var _0x4f17=['redis','socket.io-emitter','./notification.socket','register','request','then','debug','request\x20sent','stringify','error','code','message','info','Notification,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x4f17,0x8c));var _0x74f1=function(_0x451e44,_0x2a4226){_0x451e44=_0x451e44-0x0;var _0x58f6ca=_0x4f17[_0x451e44];return _0x58f6ca;};'use strict';var _=require(_0x74f1('0x0'));var util=require(_0x74f1('0x1'));var moment=require(_0x74f1('0x2'));var BPromise=require(_0x74f1('0x3'));var rs=require(_0x74f1('0x4'));var fs=require('fs');var Redis=require(_0x74f1('0x5'));var db=require(_0x74f1('0x6'))['db'];var utils=require(_0x74f1('0x7'));var logger=require(_0x74f1('0x8'))(_0x74f1('0x9'));var config=require(_0x74f1('0xa'));var jayson=require(_0x74f1('0xb'));var client=jayson[_0x74f1('0xc')][_0x74f1('0xd')]({'port':0x232a});config['redis']=_[_0x74f1('0xe')](config[_0x74f1('0xf')],{'host':'localhost','port':0x18eb});var socket=require(_0x74f1('0x10'))(new Redis(config[_0x74f1('0xf')]));require(_0x74f1('0x11'))[_0x74f1('0x12')](socket);function respondWithRpcPromise(_0x2c26e2,_0x5e1595,_0x2cfae6){return new BPromise(function(_0x25f289,_0x4f1bd1){return client[_0x74f1('0x13')](_0x2c26e2,_0x2cfae6)[_0x74f1('0x14')](function(_0x251a86){logger['info']('Notification,\x20%s,\x20%s',_0x5e1595,'request\x20sent');logger[_0x74f1('0x15')]('Notification,\x20%s,\x20%s,\x20%s',_0x5e1595,_0x74f1('0x16'),JSON[_0x74f1('0x17')](_0x251a86));if(_0x251a86[_0x74f1('0x18')]){if(_0x251a86[_0x74f1('0x18')][_0x74f1('0x19')]===0x1f4){logger[_0x74f1('0x18')]('Notification,\x20%s,\x20%s',_0x5e1595,_0x251a86['error'][_0x74f1('0x1a')]);return _0x4f1bd1(_0x251a86[_0x74f1('0x18')][_0x74f1('0x1a')]);}logger[_0x74f1('0x18')]('Notification,\x20%s,\x20%s',_0x5e1595,_0x251a86['error'][_0x74f1('0x1a')]);return _0x25f289(_0x251a86[_0x74f1('0x18')][_0x74f1('0x1a')]);}else{logger[_0x74f1('0x1b')](_0x74f1('0x1c'),_0x5e1595,_0x74f1('0x16'));_0x25f289(_0x251a86[_0x74f1('0x1d')]['message']);}})[_0x74f1('0x1e')](function(_0x532ec5){logger[_0x74f1('0x18')](_0x74f1('0x1c'),_0x5e1595,_0x532ec5);_0x4f1bd1(_0x532ec5);});});} \ No newline at end of file diff --git a/server/api/notification/notification.socket.js b/server/api/notification/notification.socket.js index 968b42b..579d132 100644 --- a/server/api/notification/notification.socket.js +++ b/server/api/notification/notification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e7=['notification:','save','remove','update','emit','register'];(function(_0x49d30a,_0x5568dc){var _0x42af57=function(_0x4614e2){while(--_0x4614e2){_0x49d30a['push'](_0x49d30a['shift']());}};_0x42af57(++_0x5568dc);}(_0xa9e7,0x1ed));var _0x7a9e=function(_0x559a6b,_0xe942f0){_0x559a6b=_0x559a6b-0x0;var _0x1cdb6b=_0xa9e7[_0x559a6b];return _0x1cdb6b;};'use strict';var NotificationEvents=require('./notification.events');var events=[_0x7a9e('0x0'),_0x7a9e('0x1'),_0x7a9e('0x2')];function createListener(_0x2383ff,_0x2593b9){return function(_0x47060e){_0x2593b9[_0x7a9e('0x3')](_0x2383ff,_0x47060e);};}function removeListener(_0x274260,_0x580767){return function(){NotificationEvents['removeListener'](_0x274260,_0x580767);};}exports[_0x7a9e('0x4')]=function(_0x5b6f0c){for(var _0x5e25ee=0x0,_0xb5b3a2=events['length'];_0x5e25ee<_0xb5b3a2;_0x5e25ee++){var _0x1dc0f4=events[_0x5e25ee];var _0xaeec1f=createListener(_0x7a9e('0x5')+_0x1dc0f4,_0x5b6f0c);NotificationEvents['on'](_0x1dc0f4,_0xaeec1f);}}; \ No newline at end of file +var _0x7c8c=['notification:','./notification.events','save','remove','update','emit','register','length'];(function(_0x518d0d,_0x3b7294){var _0x39ef54=function(_0x87940d){while(--_0x87940d){_0x518d0d['push'](_0x518d0d['shift']());}};_0x39ef54(++_0x3b7294);}(_0x7c8c,0x1b1));var _0xc7c8=function(_0x39877a,_0xc63b02){_0x39877a=_0x39877a-0x0;var _0x3786cc=_0x7c8c[_0x39877a];return _0x3786cc;};'use strict';var NotificationEvents=require(_0xc7c8('0x0'));var events=[_0xc7c8('0x1'),_0xc7c8('0x2'),_0xc7c8('0x3')];function createListener(_0x33e522,_0x64145f){return function(_0x46a8dc){_0x64145f[_0xc7c8('0x4')](_0x33e522,_0x46a8dc);};}function removeListener(_0x9adbdb,_0x3b464a){return function(){NotificationEvents['removeListener'](_0x9adbdb,_0x3b464a);};}exports[_0xc7c8('0x5')]=function(_0x5ecec3){for(var _0x2badfd=0x0,_0x4d1713=events[_0xc7c8('0x6')];_0x2badfd<_0x4d1713;_0x2badfd++){var _0x444d5e=events[_0x2badfd];var _0x2b2458=createListener(_0xc7c8('0x7')+_0x444d5e,_0x5ecec3);NotificationEvents['on'](_0x444d5e,_0x2b2458);}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 3bf1597..b6a3b75 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 _0x140c=['send','put','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','/:id/interactions','getInteractions','/:id/users','post','addAnswer','/:id/notify','notify','addApplications','addAgents'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x140c,0x94));var _0xc140=function(_0x364ba4,_0x5e797f){_0x364ba4=_0x364ba4-0x0;var _0x4aa4ef=_0x140c[_0x364ba4];return _0x4aa4ef;};'use strict';var multer=require(_0xc140('0x0'));var util=require(_0xc140('0x1'));var path=require(_0xc140('0x2'));var timeout=require(_0xc140('0x3'));var express=require('express');var router=express[_0xc140('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xc140('0x5'));var config=require(_0xc140('0x6'));var controller=require(_0xc140('0x7'));router[_0xc140('0x8')]('/',auth[_0xc140('0x9')](),controller['index']);router['get'](_0xc140('0xa'),auth[_0xc140('0x9')](),controller[_0xc140('0xb')]);router['get'](_0xc140('0xc'),auth['isAuthenticated'](),controller[_0xc140('0xd')]);router[_0xc140('0x8')](_0xc140('0xe'),auth[_0xc140('0x9')](),controller[_0xc140('0xf')]);router[_0xc140('0x8')](_0xc140('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xc140('0x8')](_0xc140('0x11'),auth[_0xc140('0x9')](),controller['getApplications']);router[_0xc140('0x8')](_0xc140('0x12'),auth[_0xc140('0x9')](),controller[_0xc140('0x13')]);router['get'](_0xc140('0x14'),auth[_0xc140('0x9')](),controller['getAgents']);router['post']('/',auth[_0xc140('0x9')](),controller['create']);router[_0xc140('0x15')](_0xc140('0xe'),auth[_0xc140('0x9')](),controller['addDisposition']);router[_0xc140('0x15')](_0xc140('0x10'),auth[_0xc140('0x9')](),controller[_0xc140('0x16')]);router['post'](_0xc140('0x17'),controller[_0xc140('0x18')]);router['post'](_0xc140('0x11'),auth[_0xc140('0x9')](),controller[_0xc140('0x19')]);router['post'](_0xc140('0x14'),auth[_0xc140('0x9')](),controller[_0xc140('0x1a')]);router[_0xc140('0x15')]('/:id/send',auth[_0xc140('0x9')](),controller[_0xc140('0x1b')]);router[_0xc140('0x1c')]('/:id',auth[_0xc140('0x9')](),controller[_0xc140('0x1d')]);router[_0xc140('0x1e')](_0xc140('0xc'),auth[_0xc140('0x9')](),controller[_0xc140('0x1f')]);router[_0xc140('0x1e')]('/:id/dispositions',auth[_0xc140('0x9')](),controller[_0xc140('0x20')]);router[_0xc140('0x1e')](_0xc140('0x10'),auth[_0xc140('0x9')](),controller[_0xc140('0x21')]);router[_0xc140('0x1e')](_0xc140('0x14'),auth[_0xc140('0x9')](),controller['removeAgents']);module[_0xc140('0x22')]=router; \ No newline at end of file +var _0x9c3c=['/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','/:id/dispositions','addDisposition','post','addAnswer','/:id/notify','addAgents','/:id/send','send','put','/:id','update','destroy','delete','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','show','getDispositions'];(function(_0x25286c,_0x2b4e13){var _0x3fea9f=function(_0x115c83){while(--_0x115c83){_0x25286c['push'](_0x25286c['shift']());}};_0x3fea9f(++_0x2b4e13);}(_0x9c3c,0x13e));var _0xc9c3=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9c3c[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0xc9c3('0x0'));var util=require(_0xc9c3('0x1'));var path=require(_0xc9c3('0x2'));var timeout=require('connect-timeout');var express=require(_0xc9c3('0x3'));var router=express[_0xc9c3('0x4')]();var auth=require(_0xc9c3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc9c3('0x6'));var controller=require(_0xc9c3('0x7'));router[_0xc9c3('0x8')]('/',auth[_0xc9c3('0x9')](),controller[_0xc9c3('0xa')]);router[_0xc9c3('0x8')](_0xc9c3('0xb'),auth[_0xc9c3('0x9')](),controller[_0xc9c3('0xc')]);router[_0xc9c3('0x8')]('/:id',auth[_0xc9c3('0x9')](),controller[_0xc9c3('0xd')]);router[_0xc9c3('0x8')]('/:id/dispositions',auth[_0xc9c3('0x9')](),controller[_0xc9c3('0xe')]);router[_0xc9c3('0x8')](_0xc9c3('0xf'),auth[_0xc9c3('0x9')](),controller[_0xc9c3('0x10')]);router[_0xc9c3('0x8')](_0xc9c3('0x11'),auth[_0xc9c3('0x9')](),controller[_0xc9c3('0x12')]);router[_0xc9c3('0x8')](_0xc9c3('0x13'),auth[_0xc9c3('0x9')](),controller['getInteractions']);router[_0xc9c3('0x8')](_0xc9c3('0x14'),auth[_0xc9c3('0x9')](),controller[_0xc9c3('0x15')]);router['post']('/',auth[_0xc9c3('0x9')](),controller['create']);router['post'](_0xc9c3('0x16'),auth['isAuthenticated'](),controller[_0xc9c3('0x17')]);router[_0xc9c3('0x18')](_0xc9c3('0xf'),auth[_0xc9c3('0x9')](),controller[_0xc9c3('0x19')]);router[_0xc9c3('0x18')](_0xc9c3('0x1a'),controller['notify']);router[_0xc9c3('0x18')](_0xc9c3('0x11'),auth['isAuthenticated'](),controller['addApplications']);router[_0xc9c3('0x18')](_0xc9c3('0x14'),auth[_0xc9c3('0x9')](),controller[_0xc9c3('0x1b')]);router[_0xc9c3('0x18')](_0xc9c3('0x1c'),auth['isAuthenticated'](),controller[_0xc9c3('0x1d')]);router[_0xc9c3('0x1e')](_0xc9c3('0x1f'),auth['isAuthenticated'](),controller[_0xc9c3('0x20')]);router['delete']('/:id',auth[_0xc9c3('0x9')](),controller[_0xc9c3('0x21')]);router['delete'](_0xc9c3('0x16'),auth[_0xc9c3('0x9')](),controller['removeDispositions']);router[_0xc9c3('0x22')](_0xc9c3('0xf'),auth[_0xc9c3('0x9')](),controller['removeAnswers']);router[_0xc9c3('0x22')](_0xc9c3('0x14'),auth[_0xc9c3('0x9')](),controller[_0xc9c3('0x23')]);module[_0xc9c3('0x24')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index bd2f1c8..c886af5 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 _0x0377=['name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','randomstring','exports','STRING'];(function(_0x32d2fe,_0x9407ac){var _0x3eb9a1=function(_0x4eed29){while(--_0x4eed29){_0x32d2fe['push'](_0x32d2fe['shift']());}};_0x3eb9a1(++_0x9407ac);}(_0x0377,0x183));var _0x7037=function(_0x64047,_0x2ec109){_0x64047=_0x64047-0x0;var _0x47d285=_0x0377[_0x64047];return _0x47d285;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x7037('0x0'));module[_0x7037('0x1')]={'name':{'type':Sequelize[_0x7037('0x2')],'unique':_0x7037('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7037('0x2')]},'token':{'type':Sequelize[_0x7037('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x7037('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7037('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7037('0x4')],'defaultValue':function(){return _0x7037('0x5');}},'notificationSound':{'type':Sequelize[_0x7037('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7037('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7037('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x7037('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7037('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7037('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7037('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7037('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x7037('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x7037('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5779be){if(!_0x5779be)this[_0x7037('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x5779be);}}}; \ No newline at end of file +var _0x26ce=['INTEGER','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}'];(function(_0x391b57,_0x1f10be){var _0x54b1dd=function(_0x48d26e){while(--_0x48d26e){_0x391b57['push'](_0x391b57['shift']());}};_0x54b1dd(++_0x1f10be);}(_0x26ce,0x106));var _0xe26c=function(_0x318841,_0x4992c5){_0x318841=_0x318841-0x0;var _0x399a00=_0x26ce[_0x318841];return _0x399a00;};'use strict';var Sequelize=require(_0xe26c('0x0'));var rs=require(_0xe26c('0x1'));module[_0xe26c('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xe26c('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xe26c('0x4')]},'token':{'type':Sequelize[_0xe26c('0x4')],'defaultValue':function(){return rs[_0xe26c('0x5')]();}},'replyUri':{'type':Sequelize[_0xe26c('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xe26c('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe26c('0x6')],'defaultValue':function(){return _0xe26c('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe26c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xe26c('0x4')]},'queueTransfer':{'type':Sequelize[_0xe26c('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe26c('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe26c('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe26c('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xe26c('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xe26c('0x9')],'defaultValue':![],'comment':_0xe26c('0xb'),'set':function(_0x31f056){if(!_0x31f056)this[_0xe26c('0xc')](_0xe26c('0xd'),null);this['setDataValue'](_0xe26c('0xe'),_0x31f056);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index beed51b..4b28c37 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 _0x2b06=['sort','where','pick','merge','VIRTUAL','options','includeAll','include','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','keys','nolimit','OpenchannelAccountId','filter','findAll','rows','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','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','from','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','orderBy','priority','defaults','contact','firstName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','lastName','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','EventManager','addApplications','sequelize','transaction','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','dataValues','Messages','push','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','http','client','Sequelize','ValidationError','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','update','destroy','get','OpenchannelAccounts','UserProfileResource','name','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order'];(function(_0x47888a,_0x7d2f3a){var _0x2b15a4=function(_0x12a3e9){while(--_0x12a3e9){_0x47888a['push'](_0x47888a['shift']());}};_0x2b15a4(++_0x7d2f3a);}(_0x2b06,0x1ed));var _0x62b0=function(_0x350aeb,_0x3d265a){_0x350aeb=_0x350aeb-0x0;var _0x3c5273=_0x2b06[_0x350aeb];return _0x3c5273;};'use strict';var pdf=require(_0x62b0('0x0'));var emlformat=require(_0x62b0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x62b0('0x2'));var jsonpatch=require(_0x62b0('0x3'));var rp=require(_0x62b0('0x4'));var moment=require(_0x62b0('0x5'));var BPromise=require(_0x62b0('0x6'));var Mustache=require(_0x62b0('0x7'));var util=require(_0x62b0('0x8'));var path=require(_0x62b0('0x9'));var sox=require('sox');var csv=require(_0x62b0('0xa'));var ejs=require(_0x62b0('0xb'));var fs=require('fs');var _=require(_0x62b0('0xc'));var squel=require(_0x62b0('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x62b0('0xe'));var toCsv=require(_0x62b0('0xa'));var querystring=require(_0x62b0('0xf'));var Papa=require(_0x62b0('0x10'));var Redis=require(_0x62b0('0x11'));var authService=require(_0x62b0('0x12'));var qs=require(_0x62b0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62b0('0x14'));var logger=require(_0x62b0('0x15'))(_0x62b0('0x16'));var utils=require(_0x62b0('0x17'));var config=require('../../config/environment');var db=require(_0x62b0('0x18'))['db'];config[_0x62b0('0x19')]=_['defaults'](config[_0x62b0('0x19')],{'host':_0x62b0('0x1a'),'port':0x18eb});var socket=require(_0x62b0('0x1b'))(new Redis(config[_0x62b0('0x19')]));require(_0x62b0('0x1c'))['register'](socket);var jayson=require(_0x62b0('0x1d'));var client=jayson['client'][_0x62b0('0x1e')]({'port':0x232c});var client9002=jayson[_0x62b0('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x48eba9,_0xed142f,_0x40b211){if(_0x40b211){var _0x2d081d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d081d['test'](_0xed142f)){return _0x48eba9;}else{throw new db[(_0x62b0('0x20'))][(_0x62b0('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x48eba9;}}function respondWithRpcPromise(_0x1c8b35,_0x48f5ea,_0x36bb63,_0x3c2d0b){return new BPromise(function(_0x2c9f90,_0x3cac90){var _0x159dee=_0x3c2d0b||client;return _0x159dee[_0x62b0('0x22')](_0x1c8b35,_0x36bb63)[_0x62b0('0x23')](function(_0x4f54aa){logger[_0x62b0('0x24')](_0x62b0('0x25'),_0x48f5ea,_0x62b0('0x26'));logger[_0x62b0('0x27')](_0x62b0('0x28'),_0x48f5ea,_0x62b0('0x26'),JSON[_0x62b0('0x29')](_0x4f54aa));if(_0x4f54aa[_0x62b0('0x2a')]){if(_0x4f54aa[_0x62b0('0x2a')][_0x62b0('0x2b')]===0x1f4){logger[_0x62b0('0x2a')](_0x62b0('0x25'),_0x48f5ea,_0x4f54aa['error'][_0x62b0('0x2c')]);return _0x3cac90(_0x4f54aa[_0x62b0('0x2a')][_0x62b0('0x2c')]);}logger['error'](_0x62b0('0x25'),_0x48f5ea,_0x4f54aa[_0x62b0('0x2a')][_0x62b0('0x2c')]);return _0x2c9f90(_0x4f54aa[_0x62b0('0x2a')][_0x62b0('0x2c')]);}else{logger['info'](_0x62b0('0x25'),_0x48f5ea,_0x62b0('0x26'));_0x2c9f90(_0x4f54aa['result'][_0x62b0('0x2c')]);}})[_0x62b0('0x2d')](function(_0x18abd0){logger[_0x62b0('0x2a')](_0x62b0('0x25'),_0x48f5ea,_0x18abd0);_0x3cac90(_0x18abd0);});});}function respondWithStatusCode(_0x1bb082,_0x107768){_0x107768=_0x107768||0xcc;return function(_0xa84857){if(_0xa84857){return _0x1bb082[_0x62b0('0x2e')](_0x107768);}return _0x1bb082[_0x62b0('0x2f')](_0x107768)[_0x62b0('0x30')]();};}function respondWithResult(_0xe25520,_0x56299e){_0x56299e=_0x56299e||0xc8;return function(_0x44ab81){if(_0x44ab81){return _0xe25520[_0x62b0('0x2f')](_0x56299e)['json'](_0x44ab81);}};}function respondWithFilteredResult(_0x557525,_0x5b35c0){return function(_0x13e902){if(_0x13e902){var _0x2cd785=_0x13e902[_0x62b0('0x31')],_0x5f4ce1=_0x5b35c0['offset'],_0x17d618=_0x5b35c0['offset']+_0x5b35c0[_0x62b0('0x32')],_0x28b284;if(_0x17d618>=_0x2cd785){_0x17d618=_0x2cd785;_0x28b284=0xc8;}else{_0x28b284=0xce;}_0x557525[_0x62b0('0x2f')](_0x28b284);return _0x557525[_0x62b0('0x33')](_0x62b0('0x34'),_0x5f4ce1+'-'+_0x17d618+'/'+_0x2cd785)['json'](_0x13e902);}return null;};}function patchUpdates(_0x5d204b){return function(_0x5d9407){try{jsonpatch[_0x62b0('0x35')](_0x5d9407,_0x5d204b,!![]);}catch(_0x5d7fe8){return BPromise[_0x62b0('0x36')](_0x5d7fe8);}return _0x5d9407['save']();};}function saveUpdates(_0x393cf3,_0x419d48){return function(_0xb4cdc0){if(_0xb4cdc0){return _0xb4cdc0[_0x62b0('0x37')](_0x393cf3)[_0x62b0('0x23')](function(_0x12f4a2){return _0x12f4a2;});}return null;};}function removeEntity(_0x3209e2,_0x3ed525){return function(_0x440606){if(_0x440606){return _0x440606[_0x62b0('0x38')]()[_0x62b0('0x23')](function(){var _0xfe57c=_0x440606[_0x62b0('0x39')]({'plain':!![]});var _0x2ca041=_0x62b0('0x3a');return db[_0x62b0('0x3b')][_0x62b0('0x38')]({'where':{'type':_0x2ca041,'resourceId':_0xfe57c['id']}})[_0x62b0('0x23')](function(){return _0x440606;});})[_0x62b0('0x23')](function(){_0x3209e2[_0x62b0('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d9e38,_0x5316fa){return function(_0x206268){if(!_0x206268){_0x2d9e38['sendStatus'](0x194);}return _0x206268;};}function handleError(_0xfe08f3,_0x43f2b9){_0x43f2b9=_0x43f2b9||0x1f4;return function(_0x2fd6e0){logger['error'](_0x2fd6e0['stack']);if(_0x2fd6e0['name']){delete _0x2fd6e0[_0x62b0('0x3c')];}_0xfe08f3['status'](_0x43f2b9)['send'](_0x2fd6e0);};}exports[_0x62b0('0x3d')]=function(_0x147b2c,_0x4d6f82){var _0x9d177d={'include':[{'model':db[_0x62b0('0x3e')],'as':_0x62b0('0x3f')}]},_0x296b69={},_0x2e6997={'count':0x0,'rows':[]};var _0x20f05b=_[_0x62b0('0x40')](db[_0x62b0('0x41')][_0x62b0('0x42')],function(_0x364fb7){return{'name':_0x364fb7[_0x62b0('0x43')],'type':_0x364fb7[_0x62b0('0x44')][_0x62b0('0x45')]};});_0x296b69[_0x62b0('0x46')]=_[_0x62b0('0x40')](_0x20f05b,_0x62b0('0x3c'));_0x296b69['query']=_['keys'](_0x147b2c[_0x62b0('0x47')]);_0x296b69[_0x62b0('0x48')]=_[_0x62b0('0x49')](_0x296b69['model'],_0x296b69['query']);_0x9d177d[_0x62b0('0x4a')]=_[_0x62b0('0x49')](_0x296b69[_0x62b0('0x46')],qs[_0x62b0('0x4b')](_0x147b2c[_0x62b0('0x47')]['fields']));_0x9d177d[_0x62b0('0x4a')]=_0x9d177d[_0x62b0('0x4a')][_0x62b0('0x4c')]?_0x9d177d[_0x62b0('0x4a')]:_0x296b69[_0x62b0('0x46')];if(!_0x147b2c[_0x62b0('0x47')][_0x62b0('0x4d')]('nolimit')){_0x9d177d[_0x62b0('0x32')]=qs['limit'](_0x147b2c[_0x62b0('0x47')]['limit']);_0x9d177d[_0x62b0('0x4e')]=qs['offset'](_0x147b2c[_0x62b0('0x47')]['offset']);}_0x9d177d[_0x62b0('0x4f')]=qs[_0x62b0('0x50')](_0x147b2c[_0x62b0('0x47')]['sort']);_0x9d177d[_0x62b0('0x51')]=qs[_0x62b0('0x48')](_[_0x62b0('0x52')](_0x147b2c['query'],_0x296b69[_0x62b0('0x48')]),_0x20f05b);if(_0x147b2c['query']['filter']){_0x9d177d[_0x62b0('0x51')]=_[_0x62b0('0x53')](_0x9d177d[_0x62b0('0x51')],{'$or':_['map'](_0x20f05b,function(_0x1b187b){if(_0x1b187b[_0x62b0('0x44')]!==_0x62b0('0x54')){var _0xbb3a30={};_0xbb3a30[_0x1b187b['name']]={'$like':'%'+_0x147b2c[_0x62b0('0x47')]['filter']+'%'};return _0xbb3a30;}})});}_0x9d177d=_['merge']({},_0x9d177d,_0x147b2c[_0x62b0('0x55')]);var _0x478e06={'where':_0x9d177d[_0x62b0('0x51')]};return db[_0x62b0('0x41')][_0x62b0('0x31')](_0x478e06)['then'](function(_0x1735ec){_0x2e6997[_0x62b0('0x31')]=_0x1735ec;if(_0x147b2c[_0x62b0('0x47')][_0x62b0('0x56')]){_0x9d177d[_0x62b0('0x57')]=[{'all':!![]}];}return db[_0x62b0('0x41')]['findAll'](_0x9d177d);})[_0x62b0('0x23')](function(_0x3b0a20){_0x2e6997['rows']=_0x3b0a20;return _0x2e6997;})['then'](respondWithFilteredResult(_0x4d6f82,_0x9d177d))['catch'](handleError(_0x4d6f82,null));};exports[_0x62b0('0x58')]=function(_0x268b3d,_0x1a82ee){var _0xe14043={'raw':![],'where':{'id':_0x268b3d[_0x62b0('0x59')]['id']},'include':[{'model':db[_0x62b0('0x3e')],'as':'mandatoryDispositionPause'}]},_0x48a847={};_0x48a847[_0x62b0('0x46')]=_['keys'](db[_0x62b0('0x41')][_0x62b0('0x42')]);_0x48a847[_0x62b0('0x47')]=_['keys'](_0x268b3d[_0x62b0('0x47')]);_0x48a847[_0x62b0('0x48')]=_['intersection'](_0x48a847[_0x62b0('0x46')],_0x48a847[_0x62b0('0x47')]);_0xe14043['attributes']=_[_0x62b0('0x49')](_0x48a847[_0x62b0('0x46')],qs[_0x62b0('0x4b')](_0x268b3d[_0x62b0('0x47')][_0x62b0('0x4b')]));_0xe14043[_0x62b0('0x4a')]=_0xe14043[_0x62b0('0x4a')][_0x62b0('0x4c')]?_0xe14043[_0x62b0('0x4a')]:_0x48a847[_0x62b0('0x46')];if(_0x268b3d[_0x62b0('0x47')][_0x62b0('0x56')]){_0xe14043[_0x62b0('0x57')]=[{'all':!![]}];}_0xe14043=_[_0x62b0('0x53')]({},_0xe14043,_0x268b3d[_0x62b0('0x55')]);return db[_0x62b0('0x41')][_0x62b0('0x5a')](_0xe14043)[_0x62b0('0x23')](handleEntityNotFound(_0x1a82ee,null))[_0x62b0('0x23')](respondWithResult(_0x1a82ee,null))['catch'](handleError(_0x1a82ee,null));};exports[_0x62b0('0x5b')]=function(_0xebe007,_0x19581f){return db['OpenchannelAccount'][_0x62b0('0x5b')](_0xebe007[_0x62b0('0x5c')],{})[_0x62b0('0x23')](function(_0x39e8d7){var _0x5887db=_0xebe007[_0x62b0('0x5d')]['get']({'plain':!![]});if(!_0x5887db)throw new Error(_0x62b0('0x5e'));if(_0x5887db[_0x62b0('0x5f')]===_0x62b0('0x5d')){var _0x4f18b4=_0x39e8d7[_0x62b0('0x39')]({'plain':!![]});var _0x1ede1c=_0x62b0('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x1ede1c,'userProfileId':_0x5887db['userProfileId']},'raw':!![]})[_0x62b0('0x23')](function(_0x210abd){if(_0x210abd&&_0x210abd[_0x62b0('0x60')]===0x0){return db[_0x62b0('0x3b')][_0x62b0('0x5b')]({'name':_0x4f18b4[_0x62b0('0x3c')],'resourceId':_0x4f18b4['id'],'type':_0x210abd['name'],'sectionId':_0x210abd['id']},{})['then'](function(){return _0x39e8d7;});}else{return _0x39e8d7;}})[_0x62b0('0x2d')](function(_0x2f6148){logger[_0x62b0('0x2a')](_0x62b0('0x61'),_0x2f6148);throw _0x2f6148;});}return _0x39e8d7;})['then'](respondWithResult(_0x19581f,0xc9))['catch'](handleError(_0x19581f,null));};exports[_0x62b0('0x37')]=function(_0x3e3f48,_0x52f7e4){if(_0x3e3f48[_0x62b0('0x5c')]['id']){delete _0x3e3f48[_0x62b0('0x5c')]['id'];}return db[_0x62b0('0x41')]['find']({'where':{'id':_0x3e3f48[_0x62b0('0x59')]['id']},'include':[{'model':db[_0x62b0('0x3e')],'as':_0x62b0('0x3f')}]})['then'](handleEntityNotFound(_0x52f7e4,null))['then'](saveUpdates(_0x3e3f48[_0x62b0('0x5c')],null))['then'](respondWithResult(_0x52f7e4,null))[_0x62b0('0x2d')](handleError(_0x52f7e4,null));};exports[_0x62b0('0x38')]=function(_0x246476,_0x4c8eb5){return db['OpenchannelAccount'][_0x62b0('0x5a')]({'where':{'id':_0x246476[_0x62b0('0x59')]['id']}})[_0x62b0('0x23')](handleEntityNotFound(_0x4c8eb5,null))[_0x62b0('0x23')](removeEntity(_0x4c8eb5,null))[_0x62b0('0x2d')](handleError(_0x4c8eb5,null));};exports[_0x62b0('0x62')]=function(_0x67620c,_0x22b653){return db['OpenchannelAccount'][_0x62b0('0x62')]()['then'](respondWithResult(_0x22b653,null))[_0x62b0('0x2d')](handleError(_0x22b653,null));};exports['addDisposition']=function(_0x312f69,_0xc4a80,_0x3589a3){if(_0x312f69[_0x62b0('0x5c')]['id']){delete _0x312f69[_0x62b0('0x5c')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x312f69[_0x62b0('0x59')]['id']}})[_0x62b0('0x23')](handleEntityNotFound(_0xc4a80,null))['then'](function(_0x3cbc6c){if(_0x3cbc6c){_0x312f69[_0x62b0('0x5c')][_0x62b0('0x63')]=_0x3cbc6c['id'];return db[_0x62b0('0x64')]['create'](_0x312f69[_0x62b0('0x5c')]);}})[_0x62b0('0x23')](respondWithResult(_0xc4a80,null))['catch'](handleError(_0xc4a80,null));};exports[_0x62b0('0x65')]=function(_0x576dbd,_0x27e424,_0x411a77){var _0x2466ee={'raw':![],'where':{}};var _0x268429={};var _0xdad8b={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x62b0('0x66')]({'where':{'id':_0x576dbd[_0x62b0('0x59')]['id']}})[_0x62b0('0x23')](handleEntityNotFound(_0x27e424,null))[_0x62b0('0x23')](function(_0x24709e){if(_0x24709e){_0x268429[_0x62b0('0x46')]=_['keys'](db[_0x62b0('0x64')][_0x62b0('0x42')]);_0x268429['query']=_[_0x62b0('0x67')](_0x576dbd[_0x62b0('0x47')]);_0x268429[_0x62b0('0x48')]=_[_0x62b0('0x49')](_0x268429[_0x62b0('0x46')],_0x268429['query']);_0x2466ee[_0x62b0('0x4a')]=_[_0x62b0('0x49')](_0x268429[_0x62b0('0x46')],qs[_0x62b0('0x4b')](_0x576dbd[_0x62b0('0x47')][_0x62b0('0x4b')]));_0x2466ee[_0x62b0('0x4a')]=_0x2466ee['attributes'][_0x62b0('0x4c')]?_0x2466ee[_0x62b0('0x4a')]:_0x268429[_0x62b0('0x46')];if(!_0x576dbd[_0x62b0('0x47')][_0x62b0('0x4d')](_0x62b0('0x68'))){_0x2466ee[_0x62b0('0x32')]=qs[_0x62b0('0x32')](_0x576dbd[_0x62b0('0x47')][_0x62b0('0x32')]);_0x2466ee[_0x62b0('0x4e')]=qs[_0x62b0('0x4e')](_0x576dbd[_0x62b0('0x47')]['offset']);}_0x2466ee[_0x62b0('0x4f')]=qs[_0x62b0('0x50')](_0x576dbd[_0x62b0('0x47')]['sort']);_0x2466ee[_0x62b0('0x51')]=qs[_0x62b0('0x48')](_[_0x62b0('0x52')](_0x576dbd[_0x62b0('0x47')],_0x268429[_0x62b0('0x48')]));_0x2466ee[_0x62b0('0x51')][_0x62b0('0x69')]=_0x24709e['id'];if(_0x576dbd['query'][_0x62b0('0x6a')]){_0x2466ee[_0x62b0('0x51')]=_[_0x62b0('0x53')](_0x2466ee[_0x62b0('0x51')],{'$or':_['map'](_0x2466ee[_0x62b0('0x4a')],function(_0x3c8306){var _0x2352cc={};_0x2352cc[_0x3c8306]={'$like':'%'+_0x576dbd[_0x62b0('0x47')][_0x62b0('0x6a')]+'%'};return _0x2352cc;})});}_0x2466ee=_[_0x62b0('0x53')]({},_0x2466ee,_0x576dbd['options']);return db[_0x62b0('0x64')][_0x62b0('0x31')]({'where':_0x2466ee[_0x62b0('0x51')]})[_0x62b0('0x23')](function(_0x1d782a){_0xdad8b[_0x62b0('0x31')]=_0x1d782a;if(_0x576dbd[_0x62b0('0x47')][_0x62b0('0x56')]){_0x2466ee[_0x62b0('0x57')]=[{'all':!![]}];}return db[_0x62b0('0x64')][_0x62b0('0x6b')](_0x2466ee);})['then'](function(_0x474d45){_0xdad8b[_0x62b0('0x6c')]=_0x474d45;return _0xdad8b;});}})[_0x62b0('0x23')](respondWithFilteredResult(_0x27e424,_0x2466ee))[_0x62b0('0x2d')](handleError(_0x27e424,null));};exports[_0x62b0('0x6d')]=function(_0x547175,_0x1854c2,_0x504fd0){return db['OpenchannelAccount'][_0x62b0('0x5a')]({'where':{'id':_0x547175[_0x62b0('0x59')]['id']}})[_0x62b0('0x23')](handleEntityNotFound(_0x1854c2,null))[_0x62b0('0x23')](function(_0x130b6a){if(_0x130b6a){return _0x130b6a[_0x62b0('0x6d')](_0x547175['query'][_0x62b0('0x6e')]);}})[_0x62b0('0x23')](respondWithStatusCode(_0x1854c2,null))[_0x62b0('0x2d')](handleError(_0x1854c2,null));};exports['addAnswer']=function(_0x29e301,_0x4a95ce,_0x30bffc){if(_0x29e301[_0x62b0('0x5c')]['id']){delete _0x29e301[_0x62b0('0x5c')]['id'];}return db[_0x62b0('0x41')][_0x62b0('0x5a')]({'where':{'id':_0x29e301[_0x62b0('0x59')]['id']}})[_0x62b0('0x23')](handleEntityNotFound(_0x4a95ce,null))[_0x62b0('0x23')](function(_0x4b01f1){if(_0x4b01f1){_0x29e301[_0x62b0('0x5c')][_0x62b0('0x69')]=_0x4b01f1['id'];return db[_0x62b0('0x6f')][_0x62b0('0x5b')](_0x29e301[_0x62b0('0x5c')]);}})[_0x62b0('0x23')](respondWithResult(_0x4a95ce,null))['catch'](handleError(_0x4a95ce,null));};exports[_0x62b0('0x70')]=function(_0x2b4f4f,_0x5329a3,_0x5a1db1){var _0x5565bd={'raw':![],'where':{}};var _0x19a806={};var _0x29f69c={'count':0x0,'rows':[]};return db[_0x62b0('0x41')]['findOne']({'where':{'id':_0x2b4f4f['params']['id']}})[_0x62b0('0x23')](handleEntityNotFound(_0x5329a3,null))[_0x62b0('0x23')](function(_0x5e1207){if(_0x5e1207){_0x19a806['model']=_[_0x62b0('0x67')](db[_0x62b0('0x6f')][_0x62b0('0x42')]);_0x19a806['query']=_[_0x62b0('0x67')](_0x2b4f4f[_0x62b0('0x47')]);_0x19a806[_0x62b0('0x48')]=_['intersection'](_0x19a806[_0x62b0('0x46')],_0x19a806['query']);_0x5565bd[_0x62b0('0x4a')]=_[_0x62b0('0x49')](_0x19a806[_0x62b0('0x46')],qs[_0x62b0('0x4b')](_0x2b4f4f[_0x62b0('0x47')][_0x62b0('0x4b')]));_0x5565bd[_0x62b0('0x4a')]=_0x5565bd['attributes']['length']?_0x5565bd[_0x62b0('0x4a')]:_0x19a806[_0x62b0('0x46')];if(!_0x2b4f4f[_0x62b0('0x47')][_0x62b0('0x4d')](_0x62b0('0x68'))){_0x5565bd[_0x62b0('0x32')]=qs[_0x62b0('0x32')](_0x2b4f4f[_0x62b0('0x47')][_0x62b0('0x32')]);_0x5565bd['offset']=qs['offset'](_0x2b4f4f['query']['offset']);}_0x5565bd[_0x62b0('0x4f')]=qs[_0x62b0('0x50')](_0x2b4f4f['query']['sort']);_0x5565bd[_0x62b0('0x51')]=qs['filters'](_[_0x62b0('0x52')](_0x2b4f4f['query'],_0x19a806[_0x62b0('0x48')]));_0x5565bd[_0x62b0('0x51')][_0x62b0('0x69')]=_0x5e1207['id'];if(_0x2b4f4f['query'][_0x62b0('0x6a')]){_0x5565bd[_0x62b0('0x51')]=_[_0x62b0('0x53')](_0x5565bd[_0x62b0('0x51')],{'$or':_[_0x62b0('0x40')](_0x5565bd[_0x62b0('0x4a')],function(_0x2dcb3c){var _0x35cfb7={};_0x35cfb7[_0x2dcb3c]={'$like':'%'+_0x2b4f4f['query']['filter']+'%'};return _0x35cfb7;})});}_0x5565bd=_[_0x62b0('0x53')]({},_0x5565bd,_0x2b4f4f[_0x62b0('0x55')]);return db[_0x62b0('0x6f')]['count']({'where':_0x5565bd[_0x62b0('0x51')]})[_0x62b0('0x23')](function(_0x28ffe8){_0x29f69c[_0x62b0('0x31')]=_0x28ffe8;if(_0x2b4f4f[_0x62b0('0x47')][_0x62b0('0x56')]){_0x5565bd[_0x62b0('0x57')]=[{'all':!![]}];}return db[_0x62b0('0x6f')][_0x62b0('0x6b')](_0x5565bd);})['then'](function(_0x35770a){_0x29f69c[_0x62b0('0x6c')]=_0x35770a;return _0x29f69c;});}})[_0x62b0('0x23')](respondWithFilteredResult(_0x5329a3,_0x5565bd))[_0x62b0('0x2d')](handleError(_0x5329a3,null));};exports[_0x62b0('0x71')]=function(_0xe0345a,_0x19c272,_0x1ed86d){return db['OpenchannelAccount'][_0x62b0('0x5a')]({'where':{'id':_0xe0345a[_0x62b0('0x59')]['id']}})[_0x62b0('0x23')](handleEntityNotFound(_0x19c272,null))[_0x62b0('0x23')](function(_0x2c1772){if(_0x2c1772){return _0x2c1772['removeAnswers'](_0xe0345a[_0x62b0('0x47')]['ids']);}})[_0x62b0('0x23')](respondWithStatusCode(_0x19c272,null))[_0x62b0('0x2d')](handleError(_0x19c272,null));};exports[_0x62b0('0x72')]=function(_0x1a79bc,_0x23c564,_0x2f8970){var _0x5d9903={'body':_0x1a79bc[_0x62b0('0x5c')],'channel':_0x62b0('0x73')};var _0x26de4c=[];var _0x379a73=[];var _0x13eb59={};var _0x256584=![];return db[_0x62b0('0x74')][_0x62b0('0x62')]()['then'](function(_0x2ebe97){if(!_0x2ebe97){throw new db[(_0x62b0('0x20'))][(_0x62b0('0x21'))]('no\x20available\x20attributes');}_0x26de4c=_[_0x62b0('0x75')](_[_0x62b0('0x67')](_0x2ebe97),[_0x62b0('0x76'),_0x62b0('0x77')]);_0x379a73=_[_0x62b0('0x75')](_[_0x62b0('0x67')](_0x2ebe97),['createdAt',_0x62b0('0x77'),_0x62b0('0x78'),_0x62b0('0x79')]);if(_0x1a79bc[_0x62b0('0x5c')]['id']){delete _0x1a79bc[_0x62b0('0x5c')]['id'];}if(_['isNil'](_0x1a79bc[_0x62b0('0x5c')]['from'])){throw new db[(_0x62b0('0x20'))][(_0x62b0('0x21'))](_0x62b0('0x7a'));}if(_[_0x62b0('0x7b')](_0x1a79bc[_0x62b0('0x5c')][_0x62b0('0x5c')])||_0x1a79bc['body'][_0x62b0('0x5c')]===''){throw new db[(_0x62b0('0x20'))][(_0x62b0('0x21'))](_0x62b0('0x7c'));}if(_[_0x62b0('0x7b')](_0x1a79bc[_0x62b0('0x5c')][_0x62b0('0x7d')])){throw new db['Sequelize'][(_0x62b0('0x21'))](_0x62b0('0x7e')+_0x379a73);}if(!_[_0x62b0('0x7f')](_0x379a73,_0x1a79bc[_0x62b0('0x5c')]['mapKey'])){throw new db[(_0x62b0('0x20'))][(_0x62b0('0x21'))](_0x62b0('0x80')+_0x379a73);}_0x13eb59[_0x1a79bc['body'][_0x62b0('0x7d')]]=_0x1a79bc[_0x62b0('0x5c')][_0x62b0('0x81')];})['then'](function(){return db[_0x62b0('0x41')][_0x62b0('0x5a')]({'where':{'id':_0x1a79bc[_0x62b0('0x59')]['id']},'include':[{'model':db[_0x62b0('0x82')],'as':_0x62b0('0x83'),'include':[{'model':db[_0x62b0('0x74')],'as':_0x62b0('0x84'),'where':_0x13eb59,'limit':0x1,'order':[[_0x62b0('0x77'),_0x62b0('0x85')]]}]},{'model':db[_0x62b0('0x86')],'as':'Applications'}]});})[_0x62b0('0x23')](handleEntityNotFound(_0x23c564,null))[_0x62b0('0x23')](function(_0x4fe8c0){if(_0x4fe8c0&&_0x4fe8c0[_0x62b0('0x83')]){_0x5d9903[_0x62b0('0x87')]=_0x4fe8c0;_0x5d9903[_0x62b0('0x88')]=_0x4fe8c0[_0x62b0('0x89')];_0x5d9903['list']=_0x4fe8c0['List'];_0x5d9903['applications']=_[_0x62b0('0x8a')](_0x5d9903['applications'],[_0x62b0('0x8b')],['asc']);if(_0x5d9903['account']['Applications']){delete _0x5d9903['account'][_0x62b0('0x89')];}if(_0x5d9903[_0x62b0('0x87')][_0x62b0('0x83')]&&_0x5d9903[_0x62b0('0x87')][_0x62b0('0x83')][_0x62b0('0x84')][_0x62b0('0x4c')]){return _0x5d9903[_0x62b0('0x87')][_0x62b0('0x83')]['Contacts'][0x0];}var _0x54c476=_[_0x62b0('0x8c')](_0x1a79bc[_0x62b0('0x5c')],{'firstName':_0x1a79bc[_0x62b0('0x5c')][_0x62b0('0x81')],'ListId':_0x4fe8c0[_0x62b0('0x79')]});_0x54c476[_0x1a79bc['body'][_0x62b0('0x7d')]]=_0x1a79bc[_0x62b0('0x5c')]['from'];return db[_0x62b0('0x74')]['create'](_0x54c476,{'fields':_0x26de4c,'raw':!![]});}})[_0x62b0('0x23')](handleEntityNotFound(_0x23c564,null))[_0x62b0('0x23')](function(_0x1093ad){_0x5d9903[_0x62b0('0x8d')]=_0x1093ad;if(_0x1093ad){var _0x5b0c99={'ContactId':_0x1093ad['id'],'OpenchannelAccountId':_0x1a79bc[_0x62b0('0x59')]['id'],'from':(_0x1093ad[_0x62b0('0x8e')]||'')+'\x20'+(_0x1093ad['lastName']||'')};var _0x471d2e={'OpenchannelAccountId':_0x1a79bc[_0x62b0('0x59')]['id'],'closed':![]};if(_0x1a79bc[_0x62b0('0x5c')][_0x62b0('0x8f')]){_0x471d2e['threadId']=_0x1a79bc['body'][_0x62b0('0x8f')];return db['OpenchannelInteraction'][_0x62b0('0x5a')]({'where':_0x471d2e})[_0x62b0('0x23')](function(_0x10d7f0){if(_0x10d7f0){return[_0x10d7f0,![]];}_0x5b0c99[_0x62b0('0x8f')]=_0x1a79bc[_0x62b0('0x5c')][_0x62b0('0x8f')];_0x5b0c99[_0x62b0('0x90')]=_0x1a79bc[_0x62b0('0x5c')][_0x62b0('0x90')];return db[_0x62b0('0x91')]['create'](_0x5b0c99)['then'](function(_0x608a32){return[_0x608a32,!![]];});});}else{_0x471d2e[_0x62b0('0x8f')]=null;}_0x471d2e[_0x62b0('0x92')]=_0x1093ad['id'];return db[_0x62b0('0x91')][_0x62b0('0x5a')]({'where':_0x471d2e})['then'](function(_0x5d3be0){if(_0x5d3be0){return[_0x5d3be0,![]];}return db['OpenchannelInteraction'][_0x62b0('0x5b')](_0x5b0c99)[_0x62b0('0x23')](function(_0x2612c8){return[_0x2612c8,!![]];});});}})[_0x62b0('0x93')](function(_0x4a986c,_0x342819){if(_0x4a986c){_0x256584=_0x342819;if(!_0x342819){var _0x30b902={'from':(_0x5d9903[_0x62b0('0x8d')]['firstName']||'')+'\x20'+(_0x5d9903['contact'][_0x62b0('0x94')]||'')};if(_0x1a79bc[_0x62b0('0x5c')][_0x62b0('0x8f')]&&_0x1a79bc[_0x62b0('0x5c')]['messageId']&&_0x1a79bc[_0x62b0('0x5c')]['threadId']!=_0x1a79bc['body'][_0x62b0('0x95')]){_0x30b902[_0x62b0('0x8f')]=_0x1a79bc[_0x62b0('0x5c')][_0x62b0('0x95')];}return _0x4a986c[_0x62b0('0x37')](_0x30b902);}else{return _0x4a986c;}}})['then'](function(_0x59f824){_0x5d9903[_0x62b0('0x96')]=_0x59f824[_0x62b0('0x39')]({'plain':!![]});_0x5d9903[_0x62b0('0x96')][_0x62b0('0x97')]=_0x256584;if(_0x5d9903[_0x62b0('0x96')][_0x62b0('0x97')]){if(_0x5d9903[_0x62b0('0x87')][_0x62b0('0x98')]){_0x5d9903[_0x62b0('0x88')]['push']({'id':0x0,'priority':_0x5d9903['applications'][_0x62b0('0x4c')]+0x1,'app':_0x62b0('0x99'),'appdata':_0x62b0('0x9a'),'interval':_0x62b0('0x9b')});}}return db[_0x62b0('0x9c')][_0x62b0('0x5b')]({'body':_0x1a79bc[_0x62b0('0x5c')][_0x62b0('0x5c')],'OpenchannelAccountId':_0x1a79bc['params']['id'],'OpenchannelInteractionId':_0x59f824['id'],'direction':'in','ContactId':_0x5d9903[_0x62b0('0x8d')]['id'],'AttachmentId':_0x1a79bc[_0x62b0('0x5c')][_0x62b0('0x9d')]});})['then'](function(_0x22fb98){_0x5d9903['message']=_0x22fb98;if(_0x5d9903[_0x62b0('0x96')][_0x62b0('0x9e')]){return db[_0x62b0('0x9f')][_0x62b0('0x5a')]({'attributes':['id',_0x62b0('0x3c')],'where':{'id':_0x5d9903[_0x62b0('0x96')][_0x62b0('0x9e')]}})[_0x62b0('0x23')](function(_0xec49b2){if(_0xec49b2){_0x5d9903[_0x62b0('0x88')][_0x62b0('0xa0')]({'id':0x0,'priority':0x0,'app':_0x62b0('0xa1'),'appdata':_0xec49b2['name']+','+(_0x5d9903[_0x62b0('0x87')][_0x62b0('0xa2')]||0xa),'interval':'*,*,*,*'});_0x5d9903[_0x62b0('0xa3')]=![];}return respondWithRpcPromise('Start','startRouting',_0x5d9903);});}return respondWithRpcPromise('Start',_0x62b0('0xa4'),_0x5d9903);})[_0x62b0('0x23')](function(_0x5b4dd2){respondWithRpcPromise('EventManager',_0x62b0('0xa5'),{'event':_0x62b0('0x72'),'message':_0x5b4dd2},client9002);return _0x5b4dd2;})[_0x62b0('0x23')](respondWithResult(_0x23c564,null))[_0x62b0('0x2d')](handleError(_0x23c564,null));};exports[_0x62b0('0xa6')]=function(_0x592242,_0x3e7767,_0x32adf8){return db[_0x62b0('0x41')][_0x62b0('0x66')]({'where':{'id':_0x592242['params']['id']}})[_0x62b0('0x23')](handleEntityNotFound(_0x3e7767,null))[_0x62b0('0x23')](function(_0x5b5e2d){if(_0x5b5e2d){return db[_0x62b0('0xa7')][_0x62b0('0xa8')](function(_0x4c72cf){return db[_0x62b0('0x86')][_0x62b0('0x38')]({'where':{'OpenchannelAccountId':_0x592242[_0x62b0('0x59')]['id']},'transaction':_0x4c72cf})[_0x62b0('0x23')](function(_0x1b3d00){var _0x3713ac=_['map'](_0x592242[_0x62b0('0x5c')],function(_0x40e497){_0x40e497[_0x62b0('0x69')]=_0x592242['params']['id'];return _0x40e497;});return db[_0x62b0('0x86')]['bulkCreate'](_0x3713ac,{'transaction':_0x4c72cf});});})[_0x62b0('0x23')](function(){return db[_0x62b0('0x86')][_0x62b0('0xa9')]({'where':{'OpenchannelAccountId':_0x592242[_0x62b0('0x59')]['id']},'order':_0x62b0('0x8b')});});}})[_0x62b0('0x23')](respondWithResult(_0x3e7767,null))[_0x62b0('0x2d')](handleError(_0x3e7767,null));};exports[_0x62b0('0xaa')]=function(_0x31c4d7,_0x67d221,_0x567175){var _0xfa3b36={};var _0x29b303={};var _0x477b39;var _0x29ab57;return db['OpenchannelAccount'][_0x62b0('0x66')]({'where':{'id':_0x31c4d7['params']['id']}})[_0x62b0('0x23')](handleEntityNotFound(_0x67d221,null))['then'](function(_0x2345ea){if(_0x2345ea){_0x477b39=_0x2345ea;_0x29b303[_0x62b0('0x46')]=_[_0x62b0('0x67')](db['OpenchannelApplication'][_0x62b0('0x42')]);_0x29b303[_0x62b0('0x47')]=_['keys'](_0x31c4d7['query']);_0x29b303[_0x62b0('0x48')]=_['intersection'](_0x29b303[_0x62b0('0x46')],_0x29b303['query']);_0xfa3b36[_0x62b0('0x4a')]=_['intersection'](_0x29b303[_0x62b0('0x46')],qs[_0x62b0('0x4b')](_0x31c4d7['query']['fields']));_0xfa3b36[_0x62b0('0x4a')]=_0xfa3b36['attributes']['length']?_0xfa3b36[_0x62b0('0x4a')]:_0x29b303[_0x62b0('0x46')];_0xfa3b36[_0x62b0('0x4f')]=qs['sort'](_0x31c4d7['query'][_0x62b0('0x50')]);_0xfa3b36[_0x62b0('0x51')]=qs[_0x62b0('0x48')](_['pick'](_0x31c4d7['query'],_0x29b303[_0x62b0('0x48')]));if(_0x31c4d7['query'][_0x62b0('0x6a')]){_0xfa3b36[_0x62b0('0x51')]=_[_0x62b0('0x53')](_0xfa3b36[_0x62b0('0x51')],{'$or':_[_0x62b0('0x40')](_0xfa3b36[_0x62b0('0x4a')],function(_0x480e64){var _0x12012b={};_0x12012b[_0x480e64]={'$like':'%'+_0x31c4d7[_0x62b0('0x47')][_0x62b0('0x6a')]+'%'};return _0x12012b;})});}_0xfa3b36=_[_0x62b0('0x53')]({},_0xfa3b36,_0x31c4d7[_0x62b0('0x55')]);return _0x477b39['getApplications'](_0xfa3b36);}})['then'](function(_0x3f681d){if(_0x3f681d){_0x29ab57=_0x3f681d[_0x62b0('0x4c')];if(!_0x31c4d7[_0x62b0('0x47')][_0x62b0('0x4d')](_0x62b0('0x68'))){_0xfa3b36[_0x62b0('0x32')]=qs[_0x62b0('0x32')](_0x31c4d7[_0x62b0('0x47')][_0x62b0('0x32')]);_0xfa3b36[_0x62b0('0x4e')]=qs[_0x62b0('0x4e')](_0x31c4d7[_0x62b0('0x47')]['offset']);}return _0x477b39[_0x62b0('0xaa')](_0xfa3b36);}})[_0x62b0('0x23')](function(_0x392ccc){if(_0x392ccc){return _0x392ccc?{'count':_0x29ab57,'rows':_0x392ccc}:null;}})[_0x62b0('0x23')](respondWithResult(_0x67d221,null))['catch'](handleError(_0x67d221,null));};exports[_0x62b0('0xab')]=function(_0x179ff5,_0x3e21b4,_0x4fab5b){var _0x65f1f0={'raw':![],'where':{}};var _0x1d74bc={};var _0x34f296={'count':0x0,'rows':[]};return db[_0x62b0('0x41')][_0x62b0('0x66')]({'where':{'id':_0x179ff5[_0x62b0('0x59')]['id']}})['then'](handleEntityNotFound(_0x3e21b4,null))[_0x62b0('0x23')](function(_0x13d484){if(_0x13d484){_0x1d74bc[_0x62b0('0x46')]=_[_0x62b0('0x67')](db[_0x62b0('0x91')][_0x62b0('0x42')]);_0x1d74bc[_0x62b0('0x47')]=_[_0x62b0('0x67')](_0x179ff5[_0x62b0('0x47')]);_0x1d74bc[_0x62b0('0x48')]=_[_0x62b0('0x49')](_0x1d74bc[_0x62b0('0x46')],_0x1d74bc['query']);_0x65f1f0[_0x62b0('0x4a')]=_[_0x62b0('0x49')](_0x1d74bc[_0x62b0('0x46')],qs['fields'](_0x179ff5[_0x62b0('0x47')]['fields']));_0x65f1f0[_0x62b0('0x4a')]=_0x65f1f0['attributes']['length']?_0x65f1f0[_0x62b0('0x4a')]:_0x1d74bc[_0x62b0('0x46')];if(!_0x179ff5[_0x62b0('0x47')][_0x62b0('0x4d')]('nolimit')){_0x65f1f0[_0x62b0('0x32')]=qs[_0x62b0('0x32')](_0x179ff5[_0x62b0('0x47')][_0x62b0('0x32')]);_0x65f1f0[_0x62b0('0x4e')]=qs['offset'](_0x179ff5[_0x62b0('0x47')][_0x62b0('0x4e')]);}_0x65f1f0[_0x62b0('0x4f')]=qs[_0x62b0('0x50')](_0x179ff5[_0x62b0('0x47')][_0x62b0('0x50')]);_0x65f1f0[_0x62b0('0x51')]=qs[_0x62b0('0x48')](_[_0x62b0('0x52')](_0x179ff5[_0x62b0('0x47')],_0x1d74bc[_0x62b0('0x48')]));_0x65f1f0[_0x62b0('0x51')][_0x62b0('0x69')]=_0x13d484['id'];if(_0x179ff5['query']['filter']){_0x65f1f0[_0x62b0('0x51')]=_['merge'](_0x65f1f0['where'],{'$or':_[_0x62b0('0x40')](_0x65f1f0['attributes'],function(_0x5b0199){var _0x49a6d7={};_0x49a6d7[_0x5b0199]={'$like':'%'+_0x179ff5[_0x62b0('0x47')][_0x62b0('0x6a')]+'%'};return _0x49a6d7;})});}_0x65f1f0=_[_0x62b0('0x53')]({},_0x65f1f0,_0x179ff5['options']);return db[_0x62b0('0x91')][_0x62b0('0x31')]({'where':_0x65f1f0[_0x62b0('0x51')]})['then'](function(_0x549c33){_0x34f296[_0x62b0('0x31')]=_0x549c33;if(_0x179ff5[_0x62b0('0x47')]['includeAll']){_0x65f1f0[_0x62b0('0x57')]=[{'model':db['CmContact'],'as':_0x62b0('0xac'),'required':![]},{'model':db[_0x62b0('0x9f')],'as':_0x62b0('0xad'),'attributes':['name',_0x62b0('0xae'),_0x62b0('0xaf')],'required':![]},{'model':db[_0x62b0('0xb0')],'as':_0x62b0('0xb1'),'attributes':['id',_0x62b0('0x3c'),_0x62b0('0xb2')],'where':_0x179ff5[_0x62b0('0x47')][_0x62b0('0xb3')]?{'id':_0x179ff5[_0x62b0('0x47')][_0x62b0('0xb3')]}:undefined,'required':_0x179ff5[_0x62b0('0x47')][_0x62b0('0xb3')]?!![]:![]}];}return db[_0x62b0('0x91')]['findAll'](_0x65f1f0);})[_0x62b0('0x23')](function(_0x4d29ba){_0x34f296[_0x62b0('0x6c')]=_0x4d29ba;return _0x34f296;});}})[_0x62b0('0x23')](respondWithFilteredResult(_0x3e21b4,_0x65f1f0))[_0x62b0('0x2d')](handleError(_0x3e21b4,null));};exports[_0x62b0('0xb4')]=function(_0x209294,_0x1b8687,_0x1ca9a0){return db[_0x62b0('0x41')]['find']({'where':{'id':_0x209294['params']['id']}})[_0x62b0('0x23')](handleEntityNotFound(_0x1b8687,null))['then'](function(_0x571c17){if(_0x571c17){return _0x571c17[_0x62b0('0xb4')](_0x209294[_0x62b0('0x5c')][_0x62b0('0x6e')],_[_0x62b0('0xb5')](_0x209294['body'],[_0x62b0('0x6e'),'id'])||{})['spread'](function(_0x34e338){for(var _0x318274=0x0;_0x318274<_0x209294['body'][_0x62b0('0x6e')][_0x62b0('0x4c')];_0x318274+=0x1){socket[_0x62b0('0xb6')]('userOpenchannelAccount:save',{'UserId':_0x209294['body'][_0x62b0('0x6e')][_0x318274],'OpenchannelAccountId':_0x209294['params']['id']});}return _0x34e338;});}})[_0x62b0('0x23')](respondWithResult(_0x1b8687,null))[_0x62b0('0x2d')](handleError(_0x1b8687,null));};exports[_0x62b0('0xb7')]=function(_0x13f141,_0x38e14a,_0x3b1d44){return db[_0x62b0('0x41')]['find']({'where':{'id':_0x13f141['params']['id']}})[_0x62b0('0x23')](handleEntityNotFound(_0x38e14a,null))[_0x62b0('0x23')](function(_0x5c8c38){if(_0x5c8c38){return _0x5c8c38[_0x62b0('0xb7')](_0x13f141[_0x62b0('0x47')][_0x62b0('0x6e')])[_0x62b0('0x23')](function(){if(_[_0x62b0('0xb8')](_0x13f141[_0x62b0('0x47')][_0x62b0('0x6e')])){for(var _0x2797ea=0x0;_0x2797ea<_0x13f141[_0x62b0('0x47')]['ids'][_0x62b0('0x4c')];_0x2797ea+=0x1){socket[_0x62b0('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x13f141['query']['ids'][_0x2797ea]),'OpenchannelAccountId':Number(_0x13f141[_0x62b0('0x59')]['id'])});}}else{socket[_0x62b0('0xb6')](_0x62b0('0xb9'),{'UserId':Number(_0x13f141[_0x62b0('0x47')]['ids']),'OpenchannelAccountId':Number(_0x13f141[_0x62b0('0x59')]['id'])});}});}})[_0x62b0('0x23')](respondWithStatusCode(_0x38e14a,null))['catch'](handleError(_0x38e14a,null));};exports[_0x62b0('0xba')]=function(_0x5401c2,_0x1f930d,_0x493d80){var _0x144a78={};var _0x5822a1={};var _0xd38766;var _0x1572c5;return db[_0x62b0('0x41')][_0x62b0('0x66')]({'where':{'id':_0x5401c2[_0x62b0('0x59')]['id']}})[_0x62b0('0x23')](handleEntityNotFound(_0x1f930d,null))[_0x62b0('0x23')](function(_0x3ef5cc){if(_0x3ef5cc){_0xd38766=_0x3ef5cc;_0x5822a1[_0x62b0('0x46')]=_[_0x62b0('0x67')](db[_0x62b0('0x9f')][_0x62b0('0x42')]);_0x5822a1['query']=_[_0x62b0('0x67')](_0x5401c2[_0x62b0('0x47')]);_0x5822a1[_0x62b0('0x48')]=_['intersection'](_0x5822a1[_0x62b0('0x46')],_0x5822a1[_0x62b0('0x47')]);_0x144a78[_0x62b0('0x4a')]=_['intersection'](_0x5822a1['model'],qs[_0x62b0('0x4b')](_0x5401c2['query'][_0x62b0('0x4b')]));_0x144a78[_0x62b0('0x4a')]=_0x144a78['attributes']['length']?_0x144a78[_0x62b0('0x4a')]:_0x5822a1['model'];_0x144a78[_0x62b0('0x4f')]=qs['sort'](_0x5401c2[_0x62b0('0x47')][_0x62b0('0x50')]);_0x144a78['where']=qs['filters'](_['pick'](_0x5401c2[_0x62b0('0x47')],_0x5822a1[_0x62b0('0x48')]));if(_0x5401c2[_0x62b0('0x47')][_0x62b0('0x6a')]){_0x144a78[_0x62b0('0x51')]=_[_0x62b0('0x53')](_0x144a78[_0x62b0('0x51')],{'$or':_[_0x62b0('0x40')](_0x144a78[_0x62b0('0x4a')],function(_0x2755b0){var _0xbd8670={};_0xbd8670[_0x2755b0]={'$like':'%'+_0x5401c2[_0x62b0('0x47')][_0x62b0('0x6a')]+'%'};return _0xbd8670;})});}_0x144a78=_['merge']({},_0x144a78,_0x5401c2[_0x62b0('0x55')]);return _0xd38766[_0x62b0('0xba')](_0x144a78);}})['then'](function(_0x594461){if(_0x594461){_0x1572c5=_0x594461[_0x62b0('0x4c')];if(!_0x5401c2['query'][_0x62b0('0x4d')](_0x62b0('0x68'))){_0x144a78['limit']=qs[_0x62b0('0x32')](_0x5401c2[_0x62b0('0x47')][_0x62b0('0x32')]);_0x144a78[_0x62b0('0x4e')]=qs[_0x62b0('0x4e')](_0x5401c2[_0x62b0('0x47')]['offset']);}return _0xd38766[_0x62b0('0xba')](_0x144a78);}})[_0x62b0('0x23')](function(_0x51355a){if(_0x51355a){return _0x51355a?{'count':_0x1572c5,'rows':_0x51355a}:null;}})[_0x62b0('0x23')](respondWithResult(_0x1f930d,null))[_0x62b0('0x2d')](handleError(_0x1f930d,null));};exports['send']=function(_0x34a3f0,_0x14ac08,_0x3e2f9c){var _0x5c767d,_0x35d19d,_0x5da879;if(_[_0x62b0('0x7b')](_0x34a3f0[_0x62b0('0x5c')][_0x62b0('0x5c')])||_0x34a3f0['body'][_0x62b0('0x5c')]===''){throw new db[(_0x62b0('0x20'))][(_0x62b0('0x21'))](_0x62b0('0x7c'));}if(_[_0x62b0('0x7b')](_0x34a3f0[_0x62b0('0x5c')]['to'])){}_0x5c767d=_0x34a3f0[_0x62b0('0x5c')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x34a3f0[_0x62b0('0x59')]['id']}})['then'](handleEntityNotFound(_0x14ac08,null))[_0x62b0('0x23')](function(_0x2f3dc2){if(_0x2f3dc2){return db[_0x62b0('0x41')][_0x62b0('0x5a')]({'where':{'id':_0x2f3dc2['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0x62b0('0x84'),'where':{[_0x2f3dc2[_0x62b0('0x7d')]]:_0x5c767d},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x62b0('0x23')](handleEntityNotFound(_0x14ac08,null))['then'](function(_0x3109b0){if(_0x3109b0&&_0x3109b0[_0x62b0('0x83')]){_0x35d19d=_0x3109b0[_0x62b0('0x39')]({'plain':!![]});if(_0x35d19d['List']&&_0x35d19d[_0x62b0('0x83')][_0x62b0('0x84')]['length']){return _0x35d19d[_0x62b0('0x83')][_0x62b0('0x84')][0x0];}return db[_0x62b0('0x74')]['create'](_[_0x62b0('0x8c')](_0x34a3f0['body'],{'firstName':_0x5c767d,[_0x3109b0[_0x62b0('0x7d')]]:_0x5c767d,'phone':_0x5c767d,'ListId':_0x35d19d['ListId']}));}})[_0x62b0('0x23')](handleEntityNotFound(_0x14ac08,null))[_0x62b0('0x23')](function(_0x5da5de){if(_0x5da5de){_0x5da879=_0x5da5de;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x5da879['id'],'closed':![],'OpenchannelAccountId':_0x35d19d['id']}})[_0x62b0('0x23')](function(_0x823887){if(_0x823887){return[_0x823887,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x34a3f0['user']['id'],'ContactId':_0x5da879['id'],'OpenchannelAccountId':_0x35d19d['id'],'lastMsgDirection':_0x62b0('0xbb'),'Messages':[_[_0x62b0('0x53')](_0x34a3f0['body'],{'read':![],'body':_0x34a3f0[_0x62b0('0x5c')][_0x62b0('0x5c')],'OpenchannelAccountId':_0x35d19d['id'],'UserId':_0x34a3f0[_0x62b0('0x5d')]['id'],'ContactId':_0x5da879['id']})]},{'include':[{'model':db[_0x62b0('0x9c')],'as':'Messages'}]})['then'](function(_0x295a34){return[_0x295a34,!![]];});});}})['spread'](function(_0xae6c32,_0x4448b7){if(_0x4448b7){return _0xae6c32;}return db[_0x62b0('0x9c')][_0x62b0('0x5b')](_[_0x62b0('0x53')](_0x34a3f0[_0x62b0('0x5c')],{'read':![],'body':_0x34a3f0[_0x62b0('0x5c')]['body'],'OpenchannelAccountId':_0x35d19d['id'],'OpenchannelInteractionId':_0xae6c32['id'],'UserId':_0x34a3f0[_0x62b0('0x5d')]['id'],'ContactId':_0x5da879['id']}))['then'](function(_0x8a61d2){_0xae6c32[_0x62b0('0xbc')][_0x62b0('0xbd')]=[];_0xae6c32[_0x62b0('0xbc')]['Messages'][_0x62b0('0xbe')](_0x8a61d2[_0x62b0('0xbc')]);return _0xae6c32;});});}})[_0x62b0('0x23')](respondWithResult(_0x14ac08,null))['catch'](handleError(_0x14ac08,null));}; \ No newline at end of file +var _0x2a6a=['update','get','OpenchannelAccounts','destroy','name','send','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','Pause','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpnechannelAccountId','getDispositions','findOne','Disposition','order','rows','ids','OpenchannelAccountId','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','DESC','OpenchannelApplication','applications','Applications','list','priority','asc','account','Contacts','defaults','ListId','lastName','threadId','externalUrl','OpenchannelInteraction','firstName','contact','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','unshift','waitForTheAssignedAgent','Start','EventManager','addApplications','sequelize','bulkCreate','getApplications','getInteractions','Contact','Owner','Tags','color','tag','addAgents','omit','spread','emit','removeAgents','userOpenchannelAccount:remove','getAgents','Messages','dataValues','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0x2a6a,0x7e));var _0xa2a6=function(_0x1237b5,_0x4786ad){_0x1237b5=_0x1237b5-0x0;var _0x5a2b68=_0x2a6a[_0x1237b5];return _0x5a2b68;};'use strict';var pdf=require(_0xa2a6('0x0'));var emlformat=require(_0xa2a6('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa2a6('0x2'));var jsonpatch=require(_0xa2a6('0x3'));var rp=require(_0xa2a6('0x4'));var moment=require('moment');var BPromise=require(_0xa2a6('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa2a6('0x6'));var sox=require(_0xa2a6('0x7'));var csv=require(_0xa2a6('0x8'));var ejs=require(_0xa2a6('0x9'));var fs=require('fs');var _=require(_0xa2a6('0xa'));var squel=require(_0xa2a6('0xb'));var crypto=require(_0xa2a6('0xc'));var jsforce=require(_0xa2a6('0xd'));var deskjs=require(_0xa2a6('0xe'));var toCsv=require(_0xa2a6('0x8'));var querystring=require(_0xa2a6('0xf'));var Papa=require('papaparse');var Redis=require(_0xa2a6('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa2a6('0x11'));var hardwareService=require(_0xa2a6('0x12'));var logger=require('../../config/logger')(_0xa2a6('0x13'));var utils=require(_0xa2a6('0x14'));var config=require(_0xa2a6('0x15'));var db=require(_0xa2a6('0x16'))['db'];config['redis']=_['defaults'](config[_0xa2a6('0x17')],{'host':_0xa2a6('0x18'),'port':0x18eb});var socket=require(_0xa2a6('0x19'))(new Redis(config[_0xa2a6('0x17')]));require(_0xa2a6('0x1a'))['register'](socket);var jayson=require(_0xa2a6('0x1b'));var client=jayson[_0xa2a6('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xa2a6('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x370f7e,_0x2915bb,_0x2184b3){if(_0x2184b3){var _0x1d0046=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d0046[_0xa2a6('0x1d')](_0x2915bb)){return _0x370f7e;}else{throw new db[(_0xa2a6('0x1e'))][(_0xa2a6('0x1f'))](_0xa2a6('0x20'));}}else{return _0x370f7e;}}function respondWithRpcPromise(_0x3cac41,_0x28118c,_0x2044dc,_0x414b3d){return new BPromise(function(_0x3ae38c,_0x26caec){var _0x1f57d5=_0x414b3d||client;return _0x1f57d5[_0xa2a6('0x21')](_0x3cac41,_0x2044dc)[_0xa2a6('0x22')](function(_0x2b7876){logger['info'](_0xa2a6('0x23'),_0x28118c,_0xa2a6('0x24'));logger['debug'](_0xa2a6('0x25'),_0x28118c,'request\x20sent',JSON[_0xa2a6('0x26')](_0x2b7876));if(_0x2b7876[_0xa2a6('0x27')]){if(_0x2b7876[_0xa2a6('0x27')][_0xa2a6('0x28')]===0x1f4){logger['error'](_0xa2a6('0x23'),_0x28118c,_0x2b7876[_0xa2a6('0x27')][_0xa2a6('0x29')]);return _0x26caec(_0x2b7876[_0xa2a6('0x27')][_0xa2a6('0x29')]);}logger[_0xa2a6('0x27')](_0xa2a6('0x23'),_0x28118c,_0x2b7876[_0xa2a6('0x27')]['message']);return _0x3ae38c(_0x2b7876[_0xa2a6('0x27')][_0xa2a6('0x29')]);}else{logger[_0xa2a6('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x28118c,_0xa2a6('0x24'));_0x3ae38c(_0x2b7876['result'][_0xa2a6('0x29')]);}})[_0xa2a6('0x2b')](function(_0x1ac72e){logger[_0xa2a6('0x27')](_0xa2a6('0x23'),_0x28118c,_0x1ac72e);_0x26caec(_0x1ac72e);});});}function respondWithStatusCode(_0x1b3765,_0x3cd282){_0x3cd282=_0x3cd282||0xcc;return function(_0x3d408f){if(_0x3d408f){return _0x1b3765[_0xa2a6('0x2c')](_0x3cd282);}return _0x1b3765[_0xa2a6('0x2d')](_0x3cd282)['end']();};}function respondWithResult(_0x45231e,_0x4fdcb6){_0x4fdcb6=_0x4fdcb6||0xc8;return function(_0x3f790a){if(_0x3f790a){return _0x45231e[_0xa2a6('0x2d')](_0x4fdcb6)[_0xa2a6('0x2e')](_0x3f790a);}};}function respondWithFilteredResult(_0x105ec1,_0xb2b3f9){return function(_0x11dbcc){if(_0x11dbcc){var _0x5d6f7b=_0x11dbcc[_0xa2a6('0x2f')],_0x5476b8=_0xb2b3f9['offset'],_0x24ca7e=_0xb2b3f9[_0xa2a6('0x30')]+_0xb2b3f9[_0xa2a6('0x31')],_0x40b917;if(_0x24ca7e>=_0x5d6f7b){_0x24ca7e=_0x5d6f7b;_0x40b917=0xc8;}else{_0x40b917=0xce;}_0x105ec1[_0xa2a6('0x2d')](_0x40b917);return _0x105ec1[_0xa2a6('0x32')](_0xa2a6('0x33'),_0x5476b8+'-'+_0x24ca7e+'/'+_0x5d6f7b)[_0xa2a6('0x2e')](_0x11dbcc);}return null;};}function patchUpdates(_0x791117){return function(_0x3ff2f4){try{jsonpatch[_0xa2a6('0x34')](_0x3ff2f4,_0x791117,!![]);}catch(_0x3eb9f2){return BPromise[_0xa2a6('0x35')](_0x3eb9f2);}return _0x3ff2f4[_0xa2a6('0x36')]();};}function saveUpdates(_0x424deb,_0x599011){return function(_0x40ab92){if(_0x40ab92){return _0x40ab92[_0xa2a6('0x37')](_0x424deb)[_0xa2a6('0x22')](function(_0x20322f){return _0x20322f;});}return null;};}function removeEntity(_0x296312,_0x30966f){return function(_0x542fbb){if(_0x542fbb){return _0x542fbb['destroy']()['then'](function(){var _0x1ea895=_0x542fbb[_0xa2a6('0x38')]({'plain':!![]});var _0x593972=_0xa2a6('0x39');return db['UserProfileResource'][_0xa2a6('0x3a')]({'where':{'type':_0x593972,'resourceId':_0x1ea895['id']}})[_0xa2a6('0x22')](function(){return _0x542fbb;});})[_0xa2a6('0x22')](function(){_0x296312[_0xa2a6('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a06a2,_0x1d0d69){return function(_0x4e6888){if(!_0x4e6888){_0x1a06a2['sendStatus'](0x194);}return _0x4e6888;};}function handleError(_0x21bb11,_0x51a265){_0x51a265=_0x51a265||0x1f4;return function(_0x24287a){logger[_0xa2a6('0x27')](_0x24287a['stack']);if(_0x24287a[_0xa2a6('0x3b')]){delete _0x24287a[_0xa2a6('0x3b')];}_0x21bb11[_0xa2a6('0x2d')](_0x51a265)[_0xa2a6('0x3c')](_0x24287a);};}exports['index']=function(_0x4306f0,_0x7b7320){var _0x3a030f={'include':[{'model':db['Pause'],'as':_0xa2a6('0x3d')}]},_0x23c9d3={},_0x1eeafe={'count':0x0,'rows':[]};var _0x30c854=_[_0xa2a6('0x3e')](db[_0xa2a6('0x3f')][_0xa2a6('0x40')],function(_0xd1511f){return{'name':_0xd1511f[_0xa2a6('0x41')],'type':_0xd1511f['type'][_0xa2a6('0x42')]};});_0x23c9d3[_0xa2a6('0x43')]=_[_0xa2a6('0x3e')](_0x30c854,'name');_0x23c9d3[_0xa2a6('0x44')]=_['keys'](_0x4306f0[_0xa2a6('0x44')]);_0x23c9d3['filters']=_[_0xa2a6('0x45')](_0x23c9d3[_0xa2a6('0x43')],_0x23c9d3[_0xa2a6('0x44')]);_0x3a030f['attributes']=_['intersection'](_0x23c9d3['model'],qs[_0xa2a6('0x46')](_0x4306f0['query'][_0xa2a6('0x46')]));_0x3a030f[_0xa2a6('0x47')]=_0x3a030f['attributes'][_0xa2a6('0x48')]?_0x3a030f[_0xa2a6('0x47')]:_0x23c9d3[_0xa2a6('0x43')];if(!_0x4306f0['query'][_0xa2a6('0x49')](_0xa2a6('0x4a'))){_0x3a030f[_0xa2a6('0x31')]=qs[_0xa2a6('0x31')](_0x4306f0['query']['limit']);_0x3a030f[_0xa2a6('0x30')]=qs[_0xa2a6('0x30')](_0x4306f0[_0xa2a6('0x44')][_0xa2a6('0x30')]);}_0x3a030f['order']=qs[_0xa2a6('0x4b')](_0x4306f0[_0xa2a6('0x44')][_0xa2a6('0x4b')]);_0x3a030f['where']=qs[_0xa2a6('0x4c')](_[_0xa2a6('0x4d')](_0x4306f0[_0xa2a6('0x44')],_0x23c9d3['filters']),_0x30c854);if(_0x4306f0[_0xa2a6('0x44')][_0xa2a6('0x4e')]){_0x3a030f[_0xa2a6('0x4f')]=_[_0xa2a6('0x50')](_0x3a030f[_0xa2a6('0x4f')],{'$or':_[_0xa2a6('0x3e')](_0x30c854,function(_0xd53b48){if(_0xd53b48[_0xa2a6('0x51')]!==_0xa2a6('0x52')){var _0x596242={};_0x596242[_0xd53b48[_0xa2a6('0x3b')]]={'$like':'%'+_0x4306f0[_0xa2a6('0x44')]['filter']+'%'};return _0x596242;}})});}_0x3a030f=_[_0xa2a6('0x50')]({},_0x3a030f,_0x4306f0[_0xa2a6('0x53')]);var _0x322660={'where':_0x3a030f[_0xa2a6('0x4f')]};return db[_0xa2a6('0x3f')]['count'](_0x322660)[_0xa2a6('0x22')](function(_0x5cd435){_0x1eeafe[_0xa2a6('0x2f')]=_0x5cd435;if(_0x4306f0[_0xa2a6('0x44')][_0xa2a6('0x54')]){_0x3a030f[_0xa2a6('0x55')]=[{'all':!![]}];}return db[_0xa2a6('0x3f')][_0xa2a6('0x56')](_0x3a030f);})[_0xa2a6('0x22')](function(_0x4beeb5){_0x1eeafe['rows']=_0x4beeb5;return _0x1eeafe;})['then'](respondWithFilteredResult(_0x7b7320,_0x3a030f))[_0xa2a6('0x2b')](handleError(_0x7b7320,null));};exports[_0xa2a6('0x57')]=function(_0x30dfea,_0x217aee){var _0x5979d0={'raw':![],'where':{'id':_0x30dfea[_0xa2a6('0x58')]['id']},'include':[{'model':db[_0xa2a6('0x59')],'as':_0xa2a6('0x3d')}]},_0x26fd9c={};_0x26fd9c[_0xa2a6('0x43')]=_[_0xa2a6('0x5a')](db[_0xa2a6('0x3f')][_0xa2a6('0x40')]);_0x26fd9c[_0xa2a6('0x44')]=_[_0xa2a6('0x5a')](_0x30dfea[_0xa2a6('0x44')]);_0x26fd9c['filters']=_[_0xa2a6('0x45')](_0x26fd9c['model'],_0x26fd9c['query']);_0x5979d0[_0xa2a6('0x47')]=_[_0xa2a6('0x45')](_0x26fd9c[_0xa2a6('0x43')],qs[_0xa2a6('0x46')](_0x30dfea[_0xa2a6('0x44')][_0xa2a6('0x46')]));_0x5979d0['attributes']=_0x5979d0[_0xa2a6('0x47')][_0xa2a6('0x48')]?_0x5979d0[_0xa2a6('0x47')]:_0x26fd9c[_0xa2a6('0x43')];if(_0x30dfea['query'][_0xa2a6('0x54')]){_0x5979d0[_0xa2a6('0x55')]=[{'all':!![]}];}_0x5979d0=_[_0xa2a6('0x50')]({},_0x5979d0,_0x30dfea[_0xa2a6('0x53')]);return db[_0xa2a6('0x3f')][_0xa2a6('0x5b')](_0x5979d0)[_0xa2a6('0x22')](handleEntityNotFound(_0x217aee,null))['then'](respondWithResult(_0x217aee,null))[_0xa2a6('0x2b')](handleError(_0x217aee,null));};exports[_0xa2a6('0x5c')]=function(_0x26beb8,_0x538976){return db['OpenchannelAccount'][_0xa2a6('0x5c')](_0x26beb8['body'],{})[_0xa2a6('0x22')](function(_0xb33cdd){var _0x4d88f5=_0x26beb8[_0xa2a6('0x5d')][_0xa2a6('0x38')]({'plain':!![]});if(!_0x4d88f5)throw new Error(_0xa2a6('0x5e'));if(_0x4d88f5[_0xa2a6('0x5f')]===_0xa2a6('0x5d')){var _0x3b68d1=_0xb33cdd['get']({'plain':!![]});var _0x4eb232=_0xa2a6('0x39');return db[_0xa2a6('0x60')][_0xa2a6('0x5b')]({'where':{'name':_0x4eb232,'userProfileId':_0x4d88f5[_0xa2a6('0x61')]},'raw':!![]})[_0xa2a6('0x22')](function(_0x5e4747){if(_0x5e4747&&_0x5e4747[_0xa2a6('0x62')]===0x0){return db[_0xa2a6('0x63')][_0xa2a6('0x5c')]({'name':_0x3b68d1[_0xa2a6('0x3b')],'resourceId':_0x3b68d1['id'],'type':_0x5e4747['name'],'sectionId':_0x5e4747['id']},{})[_0xa2a6('0x22')](function(){return _0xb33cdd;});}else{return _0xb33cdd;}})[_0xa2a6('0x2b')](function(_0x1008f9){logger[_0xa2a6('0x27')](_0xa2a6('0x64'),_0x1008f9);throw _0x1008f9;});}return _0xb33cdd;})[_0xa2a6('0x22')](respondWithResult(_0x538976,0xc9))['catch'](handleError(_0x538976,null));};exports[_0xa2a6('0x37')]=function(_0xc6eef8,_0x49f216){if(_0xc6eef8[_0xa2a6('0x65')]['id']){delete _0xc6eef8['body']['id'];}return db[_0xa2a6('0x3f')]['find']({'where':{'id':_0xc6eef8[_0xa2a6('0x58')]['id']},'include':[{'model':db[_0xa2a6('0x59')],'as':_0xa2a6('0x3d')}]})['then'](handleEntityNotFound(_0x49f216,null))[_0xa2a6('0x22')](saveUpdates(_0xc6eef8[_0xa2a6('0x65')],null))[_0xa2a6('0x22')](respondWithResult(_0x49f216,null))['catch'](handleError(_0x49f216,null));};exports[_0xa2a6('0x3a')]=function(_0x2d796c,_0x23d0d7){return db[_0xa2a6('0x3f')]['find']({'where':{'id':_0x2d796c[_0xa2a6('0x58')]['id']}})['then'](handleEntityNotFound(_0x23d0d7,null))['then'](removeEntity(_0x23d0d7,null))['catch'](handleError(_0x23d0d7,null));};exports[_0xa2a6('0x66')]=function(_0x515ac8,_0x45a2cf){return db['OpenchannelAccount'][_0xa2a6('0x66')]()['then'](respondWithResult(_0x45a2cf,null))['catch'](handleError(_0x45a2cf,null));};exports[_0xa2a6('0x67')]=function(_0x284c95,_0xee0304,_0x1e4b84){if(_0x284c95[_0xa2a6('0x65')]['id']){delete _0x284c95['body']['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x284c95[_0xa2a6('0x58')]['id']}})[_0xa2a6('0x22')](handleEntityNotFound(_0xee0304,null))[_0xa2a6('0x22')](function(_0x16b987){if(_0x16b987){_0x284c95[_0xa2a6('0x65')][_0xa2a6('0x68')]=_0x16b987['id'];return db['Disposition'][_0xa2a6('0x5c')](_0x284c95[_0xa2a6('0x65')]);}})['then'](respondWithResult(_0xee0304,null))[_0xa2a6('0x2b')](handleError(_0xee0304,null));};exports[_0xa2a6('0x69')]=function(_0x3d8552,_0x2ce63c,_0x1f9cbf){var _0x192474={'raw':![],'where':{}};var _0x5400f2={};var _0x1cdbe3={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa2a6('0x6a')]({'where':{'id':_0x3d8552[_0xa2a6('0x58')]['id']}})['then'](handleEntityNotFound(_0x2ce63c,null))[_0xa2a6('0x22')](function(_0x212d94){if(_0x212d94){_0x5400f2[_0xa2a6('0x43')]=_[_0xa2a6('0x5a')](db[_0xa2a6('0x6b')][_0xa2a6('0x40')]);_0x5400f2[_0xa2a6('0x44')]=_['keys'](_0x3d8552[_0xa2a6('0x44')]);_0x5400f2[_0xa2a6('0x4c')]=_['intersection'](_0x5400f2[_0xa2a6('0x43')],_0x5400f2['query']);_0x192474[_0xa2a6('0x47')]=_[_0xa2a6('0x45')](_0x5400f2['model'],qs[_0xa2a6('0x46')](_0x3d8552[_0xa2a6('0x44')]['fields']));_0x192474[_0xa2a6('0x47')]=_0x192474[_0xa2a6('0x47')][_0xa2a6('0x48')]?_0x192474[_0xa2a6('0x47')]:_0x5400f2['model'];if(!_0x3d8552['query'][_0xa2a6('0x49')]('nolimit')){_0x192474[_0xa2a6('0x31')]=qs[_0xa2a6('0x31')](_0x3d8552[_0xa2a6('0x44')]['limit']);_0x192474[_0xa2a6('0x30')]=qs['offset'](_0x3d8552['query'][_0xa2a6('0x30')]);}_0x192474[_0xa2a6('0x6c')]=qs[_0xa2a6('0x4b')](_0x3d8552[_0xa2a6('0x44')][_0xa2a6('0x4b')]);_0x192474['where']=qs[_0xa2a6('0x4c')](_['pick'](_0x3d8552['query'],_0x5400f2[_0xa2a6('0x4c')]));_0x192474[_0xa2a6('0x4f')]['OpenchannelAccountId']=_0x212d94['id'];if(_0x3d8552[_0xa2a6('0x44')][_0xa2a6('0x4e')]){_0x192474[_0xa2a6('0x4f')]=_['merge'](_0x192474[_0xa2a6('0x4f')],{'$or':_[_0xa2a6('0x3e')](_0x192474['attributes'],function(_0x4f8019){var _0x5bc885={};_0x5bc885[_0x4f8019]={'$like':'%'+_0x3d8552[_0xa2a6('0x44')][_0xa2a6('0x4e')]+'%'};return _0x5bc885;})});}_0x192474=_[_0xa2a6('0x50')]({},_0x192474,_0x3d8552[_0xa2a6('0x53')]);return db['Disposition'][_0xa2a6('0x2f')]({'where':_0x192474[_0xa2a6('0x4f')]})['then'](function(_0x3d50d4){_0x1cdbe3[_0xa2a6('0x2f')]=_0x3d50d4;if(_0x3d8552[_0xa2a6('0x44')][_0xa2a6('0x54')]){_0x192474[_0xa2a6('0x55')]=[{'all':!![]}];}return db['Disposition'][_0xa2a6('0x56')](_0x192474);})[_0xa2a6('0x22')](function(_0x336fe0){_0x1cdbe3[_0xa2a6('0x6d')]=_0x336fe0;return _0x1cdbe3;});}})['then'](respondWithFilteredResult(_0x2ce63c,_0x192474))[_0xa2a6('0x2b')](handleError(_0x2ce63c,null));};exports['removeDispositions']=function(_0x3ec02e,_0x124e5c,_0x342390){return db['OpenchannelAccount'][_0xa2a6('0x5b')]({'where':{'id':_0x3ec02e[_0xa2a6('0x58')]['id']}})['then'](handleEntityNotFound(_0x124e5c,null))[_0xa2a6('0x22')](function(_0x444800){if(_0x444800){return _0x444800['removeDispositions'](_0x3ec02e[_0xa2a6('0x44')][_0xa2a6('0x6e')]);}})['then'](respondWithStatusCode(_0x124e5c,null))[_0xa2a6('0x2b')](handleError(_0x124e5c,null));};exports['addAnswer']=function(_0x1b3f43,_0x38e49e,_0x28cb25){if(_0x1b3f43[_0xa2a6('0x65')]['id']){delete _0x1b3f43['body']['id'];}return db[_0xa2a6('0x3f')][_0xa2a6('0x5b')]({'where':{'id':_0x1b3f43[_0xa2a6('0x58')]['id']}})['then'](handleEntityNotFound(_0x38e49e,null))[_0xa2a6('0x22')](function(_0x271cbb){if(_0x271cbb){_0x1b3f43['body'][_0xa2a6('0x6f')]=_0x271cbb['id'];return db[_0xa2a6('0x70')][_0xa2a6('0x5c')](_0x1b3f43[_0xa2a6('0x65')]);}})[_0xa2a6('0x22')](respondWithResult(_0x38e49e,null))[_0xa2a6('0x2b')](handleError(_0x38e49e,null));};exports[_0xa2a6('0x71')]=function(_0x2ec99c,_0x4a0e3b,_0x4f552b){var _0x32ad35={'raw':![],'where':{}};var _0x3fb1b7={};var _0x47535e={'count':0x0,'rows':[]};return db[_0xa2a6('0x3f')][_0xa2a6('0x6a')]({'where':{'id':_0x2ec99c['params']['id']}})[_0xa2a6('0x22')](handleEntityNotFound(_0x4a0e3b,null))[_0xa2a6('0x22')](function(_0x543fbf){if(_0x543fbf){_0x3fb1b7[_0xa2a6('0x43')]=_[_0xa2a6('0x5a')](db[_0xa2a6('0x70')][_0xa2a6('0x40')]);_0x3fb1b7[_0xa2a6('0x44')]=_['keys'](_0x2ec99c[_0xa2a6('0x44')]);_0x3fb1b7[_0xa2a6('0x4c')]=_['intersection'](_0x3fb1b7['model'],_0x3fb1b7[_0xa2a6('0x44')]);_0x32ad35['attributes']=_['intersection'](_0x3fb1b7[_0xa2a6('0x43')],qs[_0xa2a6('0x46')](_0x2ec99c[_0xa2a6('0x44')]['fields']));_0x32ad35[_0xa2a6('0x47')]=_0x32ad35[_0xa2a6('0x47')][_0xa2a6('0x48')]?_0x32ad35[_0xa2a6('0x47')]:_0x3fb1b7[_0xa2a6('0x43')];if(!_0x2ec99c['query'][_0xa2a6('0x49')]('nolimit')){_0x32ad35[_0xa2a6('0x31')]=qs['limit'](_0x2ec99c[_0xa2a6('0x44')][_0xa2a6('0x31')]);_0x32ad35[_0xa2a6('0x30')]=qs[_0xa2a6('0x30')](_0x2ec99c[_0xa2a6('0x44')][_0xa2a6('0x30')]);}_0x32ad35[_0xa2a6('0x6c')]=qs[_0xa2a6('0x4b')](_0x2ec99c[_0xa2a6('0x44')][_0xa2a6('0x4b')]);_0x32ad35['where']=qs[_0xa2a6('0x4c')](_[_0xa2a6('0x4d')](_0x2ec99c['query'],_0x3fb1b7[_0xa2a6('0x4c')]));_0x32ad35[_0xa2a6('0x4f')][_0xa2a6('0x6f')]=_0x543fbf['id'];if(_0x2ec99c[_0xa2a6('0x44')]['filter']){_0x32ad35[_0xa2a6('0x4f')]=_[_0xa2a6('0x50')](_0x32ad35[_0xa2a6('0x4f')],{'$or':_['map'](_0x32ad35[_0xa2a6('0x47')],function(_0x50edfd){var _0x306fa4={};_0x306fa4[_0x50edfd]={'$like':'%'+_0x2ec99c[_0xa2a6('0x44')][_0xa2a6('0x4e')]+'%'};return _0x306fa4;})});}_0x32ad35=_[_0xa2a6('0x50')]({},_0x32ad35,_0x2ec99c[_0xa2a6('0x53')]);return db[_0xa2a6('0x70')][_0xa2a6('0x2f')]({'where':_0x32ad35[_0xa2a6('0x4f')]})[_0xa2a6('0x22')](function(_0x6c7b3b){_0x47535e[_0xa2a6('0x2f')]=_0x6c7b3b;if(_0x2ec99c[_0xa2a6('0x44')][_0xa2a6('0x54')]){_0x32ad35[_0xa2a6('0x55')]=[{'all':!![]}];}return db[_0xa2a6('0x70')][_0xa2a6('0x56')](_0x32ad35);})[_0xa2a6('0x22')](function(_0x4a7dc2){_0x47535e[_0xa2a6('0x6d')]=_0x4a7dc2;return _0x47535e;});}})[_0xa2a6('0x22')](respondWithFilteredResult(_0x4a0e3b,_0x32ad35))[_0xa2a6('0x2b')](handleError(_0x4a0e3b,null));};exports[_0xa2a6('0x72')]=function(_0x17a837,_0x27da6d,_0x33b6a0){return db[_0xa2a6('0x3f')]['find']({'where':{'id':_0x17a837[_0xa2a6('0x58')]['id']}})[_0xa2a6('0x22')](handleEntityNotFound(_0x27da6d,null))[_0xa2a6('0x22')](function(_0x1686b6){if(_0x1686b6){return _0x1686b6[_0xa2a6('0x72')](_0x17a837['query'][_0xa2a6('0x6e')]);}})[_0xa2a6('0x22')](respondWithStatusCode(_0x27da6d,null))[_0xa2a6('0x2b')](handleError(_0x27da6d,null));};exports[_0xa2a6('0x73')]=function(_0x1b9fad,_0x53ec23,_0x524588){var _0x3c0c68={'body':_0x1b9fad[_0xa2a6('0x65')],'channel':_0xa2a6('0x74')};var _0x735310=[];var _0x588222=[];var _0x436880={};var _0x5b69ac=![];return db['CmContact']['describe']()[_0xa2a6('0x22')](function(_0x2a877d){if(!_0x2a877d){throw new db[(_0xa2a6('0x1e'))][(_0xa2a6('0x1f'))](_0xa2a6('0x75'));}_0x735310=_[_0xa2a6('0x76')](_[_0xa2a6('0x5a')](_0x2a877d),['createdAt','updatedAt']);_0x588222=_[_0xa2a6('0x76')](_[_0xa2a6('0x5a')](_0x2a877d),[_0xa2a6('0x77'),_0xa2a6('0x78'),_0xa2a6('0x79'),'ListId']);if(_0x1b9fad[_0xa2a6('0x65')]['id']){delete _0x1b9fad[_0xa2a6('0x65')]['id'];}if(_[_0xa2a6('0x7a')](_0x1b9fad['body'][_0xa2a6('0x7b')])){throw new db[(_0xa2a6('0x1e'))][(_0xa2a6('0x1f'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x1b9fad['body'][_0xa2a6('0x65')])||_0x1b9fad[_0xa2a6('0x65')][_0xa2a6('0x65')]===''){throw new db[(_0xa2a6('0x1e'))][(_0xa2a6('0x1f'))](_0xa2a6('0x7c'));}if(_[_0xa2a6('0x7a')](_0x1b9fad[_0xa2a6('0x65')][_0xa2a6('0x7d')])){throw new db[(_0xa2a6('0x1e'))][(_0xa2a6('0x1f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x588222);}if(!_[_0xa2a6('0x7e')](_0x588222,_0x1b9fad[_0xa2a6('0x65')][_0xa2a6('0x7d')])){throw new db[(_0xa2a6('0x1e'))][(_0xa2a6('0x1f'))](_0xa2a6('0x7f')+_0x588222);}_0x436880[_0x1b9fad['body'][_0xa2a6('0x7d')]]=_0x1b9fad[_0xa2a6('0x65')]['from'];})[_0xa2a6('0x22')](function(){return db['OpenchannelAccount'][_0xa2a6('0x5b')]({'where':{'id':_0x1b9fad[_0xa2a6('0x58')]['id']},'include':[{'model':db[_0xa2a6('0x80')],'as':_0xa2a6('0x81'),'include':[{'model':db[_0xa2a6('0x82')],'as':'Contacts','where':_0x436880,'limit':0x1,'order':[[_0xa2a6('0x78'),_0xa2a6('0x83')]]}]},{'model':db[_0xa2a6('0x84')],'as':'Applications'}]});})[_0xa2a6('0x22')](handleEntityNotFound(_0x53ec23,null))['then'](function(_0x52c5ca){if(_0x52c5ca&&_0x52c5ca['List']){_0x3c0c68['account']=_0x52c5ca;_0x3c0c68[_0xa2a6('0x85')]=_0x52c5ca[_0xa2a6('0x86')];_0x3c0c68[_0xa2a6('0x87')]=_0x52c5ca[_0xa2a6('0x81')];_0x3c0c68[_0xa2a6('0x85')]=_['orderBy'](_0x3c0c68[_0xa2a6('0x85')],[_0xa2a6('0x88')],[_0xa2a6('0x89')]);if(_0x3c0c68['account'][_0xa2a6('0x86')]){delete _0x3c0c68[_0xa2a6('0x8a')][_0xa2a6('0x86')];}if(_0x3c0c68[_0xa2a6('0x8a')]['List']&&_0x3c0c68[_0xa2a6('0x8a')][_0xa2a6('0x81')][_0xa2a6('0x8b')][_0xa2a6('0x48')]){return _0x3c0c68['account'][_0xa2a6('0x81')][_0xa2a6('0x8b')][0x0];}var _0x5622fe=_[_0xa2a6('0x8c')](_0x1b9fad['body'],{'firstName':_0x1b9fad[_0xa2a6('0x65')][_0xa2a6('0x7b')],'ListId':_0x52c5ca[_0xa2a6('0x8d')]});_0x5622fe[_0x1b9fad['body'][_0xa2a6('0x7d')]]=_0x1b9fad['body']['from'];return db[_0xa2a6('0x82')][_0xa2a6('0x5c')](_0x5622fe,{'fields':_0x735310,'raw':!![]});}})[_0xa2a6('0x22')](handleEntityNotFound(_0x53ec23,null))[_0xa2a6('0x22')](function(_0x3025de){_0x3c0c68['contact']=_0x3025de;if(_0x3025de){var _0x3e9e92={'ContactId':_0x3025de['id'],'OpenchannelAccountId':_0x1b9fad[_0xa2a6('0x58')]['id'],'from':(_0x3025de['firstName']||'')+'\x20'+(_0x3025de[_0xa2a6('0x8e')]||'')};var _0x35b8c5={'OpenchannelAccountId':_0x1b9fad[_0xa2a6('0x58')]['id'],'closed':![]};if(_0x1b9fad[_0xa2a6('0x65')][_0xa2a6('0x8f')]){_0x35b8c5[_0xa2a6('0x8f')]=_0x1b9fad[_0xa2a6('0x65')]['threadId'];return db['OpenchannelInteraction']['find']({'where':_0x35b8c5})['then'](function(_0x495bbd){if(_0x495bbd){return[_0x495bbd,![]];}_0x3e9e92[_0xa2a6('0x8f')]=_0x1b9fad[_0xa2a6('0x65')][_0xa2a6('0x8f')];_0x3e9e92[_0xa2a6('0x90')]=_0x1b9fad[_0xa2a6('0x65')][_0xa2a6('0x90')];return db[_0xa2a6('0x91')][_0xa2a6('0x5c')](_0x3e9e92)[_0xa2a6('0x22')](function(_0x1d54e7){return[_0x1d54e7,!![]];});});}else{_0x35b8c5[_0xa2a6('0x8f')]=null;}_0x35b8c5['ContactId']=_0x3025de['id'];return db[_0xa2a6('0x91')]['find']({'where':_0x35b8c5})[_0xa2a6('0x22')](function(_0x5e5402){if(_0x5e5402){return[_0x5e5402,![]];}return db[_0xa2a6('0x91')]['create'](_0x3e9e92)[_0xa2a6('0x22')](function(_0x20fa15){return[_0x20fa15,!![]];});});}})['spread'](function(_0x233cd0,_0x4c5d8a){if(_0x233cd0){_0x5b69ac=_0x4c5d8a;if(!_0x4c5d8a){var _0x24ff3b={'from':(_0x3c0c68['contact'][_0xa2a6('0x92')]||'')+'\x20'+(_0x3c0c68[_0xa2a6('0x93')]['lastName']||'')};if(_0x1b9fad['body']['threadId']&&_0x1b9fad['body'][_0xa2a6('0x94')]&&_0x1b9fad[_0xa2a6('0x65')]['threadId']!=_0x1b9fad['body'][_0xa2a6('0x94')]){_0x24ff3b[_0xa2a6('0x8f')]=_0x1b9fad[_0xa2a6('0x65')][_0xa2a6('0x94')];}return _0x233cd0[_0xa2a6('0x37')](_0x24ff3b);}else{return _0x233cd0;}}})[_0xa2a6('0x22')](function(_0x483cdc){_0x3c0c68[_0xa2a6('0x95')]=_0x483cdc[_0xa2a6('0x38')]({'plain':!![]});_0x3c0c68[_0xa2a6('0x95')][_0xa2a6('0x96')]=_0x5b69ac;if(_0x3c0c68[_0xa2a6('0x95')][_0xa2a6('0x96')]){if(_0x3c0c68['account']['autoclose']){_0x3c0c68[_0xa2a6('0x85')][_0xa2a6('0x97')]({'id':0x0,'priority':_0x3c0c68['applications']['length']+0x1,'app':_0xa2a6('0x98'),'appdata':_0xa2a6('0x99'),'interval':_0xa2a6('0x9a')});}}return db[_0xa2a6('0x9b')][_0xa2a6('0x5c')]({'body':_0x1b9fad['body']['body'],'OpenchannelAccountId':_0x1b9fad[_0xa2a6('0x58')]['id'],'OpenchannelInteractionId':_0x483cdc['id'],'direction':'in','ContactId':_0x3c0c68[_0xa2a6('0x93')]['id'],'AttachmentId':_0x1b9fad[_0xa2a6('0x65')]['AttachmentId']});})[_0xa2a6('0x22')](function(_0x454686){_0x3c0c68[_0xa2a6('0x29')]=_0x454686;if(_0x3c0c68[_0xa2a6('0x95')][_0xa2a6('0x9c')]){return db[_0xa2a6('0x9d')]['find']({'attributes':['id',_0xa2a6('0x3b')],'where':{'id':_0x3c0c68['interaction'][_0xa2a6('0x9c')]}})[_0xa2a6('0x22')](function(_0x1cf0dc){if(_0x1cf0dc){_0x3c0c68[_0xa2a6('0x85')][_0xa2a6('0x9e')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1cf0dc[_0xa2a6('0x3b')]+','+(_0x3c0c68[_0xa2a6('0x8a')][_0xa2a6('0x9f')]||0xa),'interval':'*,*,*,*'});_0x3c0c68['forcedOwnership']=![];}return respondWithRpcPromise(_0xa2a6('0xa0'),'startRouting',_0x3c0c68);});}return respondWithRpcPromise(_0xa2a6('0xa0'),'startRouting',_0x3c0c68);})['then'](function(_0x2e6001){respondWithRpcPromise(_0xa2a6('0xa1'),_0xa2a6('0xa1'),{'event':'notify','message':_0x2e6001},client9002);return _0x2e6001;})[_0xa2a6('0x22')](respondWithResult(_0x53ec23,null))['catch'](handleError(_0x53ec23,null));};exports[_0xa2a6('0xa2')]=function(_0x498c4c,_0x39e638,_0x330f70){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x498c4c[_0xa2a6('0x58')]['id']}})[_0xa2a6('0x22')](handleEntityNotFound(_0x39e638,null))[_0xa2a6('0x22')](function(_0x20626e){if(_0x20626e){return db[_0xa2a6('0xa3')]['transaction'](function(_0x24bd78){return db['OpenchannelApplication'][_0xa2a6('0x3a')]({'where':{'OpenchannelAccountId':_0x498c4c['params']['id']},'transaction':_0x24bd78})[_0xa2a6('0x22')](function(_0x1f6fbd){var _0x3f2318=_[_0xa2a6('0x3e')](_0x498c4c[_0xa2a6('0x65')],function(_0x144357){_0x144357[_0xa2a6('0x6f')]=_0x498c4c[_0xa2a6('0x58')]['id'];return _0x144357;});return db[_0xa2a6('0x84')][_0xa2a6('0xa4')](_0x3f2318,{'transaction':_0x24bd78});});})['then'](function(){return db[_0xa2a6('0x84')]['findAndCountAll']({'where':{'OpenchannelAccountId':_0x498c4c['params']['id']},'order':_0xa2a6('0x88')});});}})['then'](respondWithResult(_0x39e638,null))['catch'](handleError(_0x39e638,null));};exports[_0xa2a6('0xa5')]=function(_0x4def80,_0x10f289,_0x1f99d8){var _0x522cf1={};var _0x23a473={};var _0x700bbf;var _0x40f0e4;return db[_0xa2a6('0x3f')][_0xa2a6('0x6a')]({'where':{'id':_0x4def80[_0xa2a6('0x58')]['id']}})[_0xa2a6('0x22')](handleEntityNotFound(_0x10f289,null))[_0xa2a6('0x22')](function(_0x3caf01){if(_0x3caf01){_0x700bbf=_0x3caf01;_0x23a473[_0xa2a6('0x43')]=_[_0xa2a6('0x5a')](db['OpenchannelApplication'][_0xa2a6('0x40')]);_0x23a473[_0xa2a6('0x44')]=_[_0xa2a6('0x5a')](_0x4def80[_0xa2a6('0x44')]);_0x23a473[_0xa2a6('0x4c')]=_['intersection'](_0x23a473[_0xa2a6('0x43')],_0x23a473[_0xa2a6('0x44')]);_0x522cf1[_0xa2a6('0x47')]=_['intersection'](_0x23a473['model'],qs[_0xa2a6('0x46')](_0x4def80['query'][_0xa2a6('0x46')]));_0x522cf1['attributes']=_0x522cf1[_0xa2a6('0x47')][_0xa2a6('0x48')]?_0x522cf1['attributes']:_0x23a473[_0xa2a6('0x43')];_0x522cf1[_0xa2a6('0x6c')]=qs['sort'](_0x4def80[_0xa2a6('0x44')][_0xa2a6('0x4b')]);_0x522cf1[_0xa2a6('0x4f')]=qs[_0xa2a6('0x4c')](_[_0xa2a6('0x4d')](_0x4def80[_0xa2a6('0x44')],_0x23a473['filters']));if(_0x4def80[_0xa2a6('0x44')][_0xa2a6('0x4e')]){_0x522cf1['where']=_[_0xa2a6('0x50')](_0x522cf1[_0xa2a6('0x4f')],{'$or':_['map'](_0x522cf1[_0xa2a6('0x47')],function(_0xeaf9b6){var _0x34b07a={};_0x34b07a[_0xeaf9b6]={'$like':'%'+_0x4def80['query'][_0xa2a6('0x4e')]+'%'};return _0x34b07a;})});}_0x522cf1=_[_0xa2a6('0x50')]({},_0x522cf1,_0x4def80[_0xa2a6('0x53')]);return _0x700bbf[_0xa2a6('0xa5')](_0x522cf1);}})[_0xa2a6('0x22')](function(_0x9df38a){if(_0x9df38a){_0x40f0e4=_0x9df38a[_0xa2a6('0x48')];if(!_0x4def80['query'][_0xa2a6('0x49')](_0xa2a6('0x4a'))){_0x522cf1[_0xa2a6('0x31')]=qs[_0xa2a6('0x31')](_0x4def80[_0xa2a6('0x44')][_0xa2a6('0x31')]);_0x522cf1[_0xa2a6('0x30')]=qs[_0xa2a6('0x30')](_0x4def80['query']['offset']);}return _0x700bbf[_0xa2a6('0xa5')](_0x522cf1);}})['then'](function(_0x237291){if(_0x237291){return _0x237291?{'count':_0x40f0e4,'rows':_0x237291}:null;}})[_0xa2a6('0x22')](respondWithResult(_0x10f289,null))[_0xa2a6('0x2b')](handleError(_0x10f289,null));};exports[_0xa2a6('0xa6')]=function(_0xd77259,_0x4dca70,_0x578c2f){var _0x25e333={'raw':![],'where':{}};var _0x346fce={};var _0x290eba={'count':0x0,'rows':[]};return db[_0xa2a6('0x3f')]['findOne']({'where':{'id':_0xd77259['params']['id']}})[_0xa2a6('0x22')](handleEntityNotFound(_0x4dca70,null))[_0xa2a6('0x22')](function(_0x1d43da){if(_0x1d43da){_0x346fce['model']=_['keys'](db[_0xa2a6('0x91')][_0xa2a6('0x40')]);_0x346fce[_0xa2a6('0x44')]=_['keys'](_0xd77259[_0xa2a6('0x44')]);_0x346fce[_0xa2a6('0x4c')]=_[_0xa2a6('0x45')](_0x346fce[_0xa2a6('0x43')],_0x346fce[_0xa2a6('0x44')]);_0x25e333[_0xa2a6('0x47')]=_[_0xa2a6('0x45')](_0x346fce['model'],qs[_0xa2a6('0x46')](_0xd77259[_0xa2a6('0x44')]['fields']));_0x25e333[_0xa2a6('0x47')]=_0x25e333['attributes'][_0xa2a6('0x48')]?_0x25e333[_0xa2a6('0x47')]:_0x346fce[_0xa2a6('0x43')];if(!_0xd77259[_0xa2a6('0x44')][_0xa2a6('0x49')](_0xa2a6('0x4a'))){_0x25e333['limit']=qs['limit'](_0xd77259['query']['limit']);_0x25e333[_0xa2a6('0x30')]=qs['offset'](_0xd77259['query'][_0xa2a6('0x30')]);}_0x25e333[_0xa2a6('0x6c')]=qs[_0xa2a6('0x4b')](_0xd77259[_0xa2a6('0x44')][_0xa2a6('0x4b')]);_0x25e333[_0xa2a6('0x4f')]=qs[_0xa2a6('0x4c')](_['pick'](_0xd77259[_0xa2a6('0x44')],_0x346fce[_0xa2a6('0x4c')]));_0x25e333[_0xa2a6('0x4f')][_0xa2a6('0x6f')]=_0x1d43da['id'];if(_0xd77259['query']['filter']){_0x25e333[_0xa2a6('0x4f')]=_['merge'](_0x25e333['where'],{'$or':_['map'](_0x25e333[_0xa2a6('0x47')],function(_0x3e89c9){var _0x556c3d={};_0x556c3d[_0x3e89c9]={'$like':'%'+_0xd77259['query']['filter']+'%'};return _0x556c3d;})});}_0x25e333=_[_0xa2a6('0x50')]({},_0x25e333,_0xd77259['options']);return db[_0xa2a6('0x91')]['count']({'where':_0x25e333['where']})[_0xa2a6('0x22')](function(_0x46857c){_0x290eba[_0xa2a6('0x2f')]=_0x46857c;if(_0xd77259[_0xa2a6('0x44')][_0xa2a6('0x54')]){_0x25e333[_0xa2a6('0x55')]=[{'model':db[_0xa2a6('0x82')],'as':_0xa2a6('0xa7'),'required':![]},{'model':db[_0xa2a6('0x9d')],'as':_0xa2a6('0xa8'),'attributes':[_0xa2a6('0x3b'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0xa2a6('0xa9'),'attributes':['id',_0xa2a6('0x3b'),_0xa2a6('0xaa')],'where':_0xd77259[_0xa2a6('0x44')]['tag']?{'id':_0xd77259['query'][_0xa2a6('0xab')]}:undefined,'required':_0xd77259[_0xa2a6('0x44')]['tag']?!![]:![]}];}return db[_0xa2a6('0x91')][_0xa2a6('0x56')](_0x25e333);})[_0xa2a6('0x22')](function(_0x3a5251){_0x290eba[_0xa2a6('0x6d')]=_0x3a5251;return _0x290eba;});}})[_0xa2a6('0x22')](respondWithFilteredResult(_0x4dca70,_0x25e333))[_0xa2a6('0x2b')](handleError(_0x4dca70,null));};exports[_0xa2a6('0xac')]=function(_0x11a246,_0x49770f,_0x3e75dd){return db['OpenchannelAccount'][_0xa2a6('0x5b')]({'where':{'id':_0x11a246[_0xa2a6('0x58')]['id']}})[_0xa2a6('0x22')](handleEntityNotFound(_0x49770f,null))['then'](function(_0x36d782){if(_0x36d782){return _0x36d782[_0xa2a6('0xac')](_0x11a246[_0xa2a6('0x65')][_0xa2a6('0x6e')],_[_0xa2a6('0xad')](_0x11a246['body'],['ids','id'])||{})[_0xa2a6('0xae')](function(_0x32fd5d){for(var _0xb2d193=0x0;_0xb2d193<_0x11a246['body'][_0xa2a6('0x6e')]['length'];_0xb2d193+=0x1){socket[_0xa2a6('0xaf')]('userOpenchannelAccount:save',{'UserId':_0x11a246[_0xa2a6('0x65')][_0xa2a6('0x6e')][_0xb2d193],'OpenchannelAccountId':_0x11a246[_0xa2a6('0x58')]['id']});}return _0x32fd5d;});}})[_0xa2a6('0x22')](respondWithResult(_0x49770f,null))[_0xa2a6('0x2b')](handleError(_0x49770f,null));};exports[_0xa2a6('0xb0')]=function(_0x8c69f7,_0x27976d,_0x9b18e8){return db[_0xa2a6('0x3f')][_0xa2a6('0x5b')]({'where':{'id':_0x8c69f7[_0xa2a6('0x58')]['id']}})[_0xa2a6('0x22')](handleEntityNotFound(_0x27976d,null))[_0xa2a6('0x22')](function(_0x577b19){if(_0x577b19){return _0x577b19[_0xa2a6('0xb0')](_0x8c69f7[_0xa2a6('0x44')][_0xa2a6('0x6e')])[_0xa2a6('0x22')](function(){if(_['isArray'](_0x8c69f7[_0xa2a6('0x44')][_0xa2a6('0x6e')])){for(var _0x5f059a=0x0;_0x5f059a<_0x8c69f7['query'][_0xa2a6('0x6e')][_0xa2a6('0x48')];_0x5f059a+=0x1){socket[_0xa2a6('0xaf')](_0xa2a6('0xb1'),{'UserId':Number(_0x8c69f7['query'][_0xa2a6('0x6e')][_0x5f059a]),'OpenchannelAccountId':Number(_0x8c69f7[_0xa2a6('0x58')]['id'])});}}else{socket[_0xa2a6('0xaf')](_0xa2a6('0xb1'),{'UserId':Number(_0x8c69f7[_0xa2a6('0x44')][_0xa2a6('0x6e')]),'OpenchannelAccountId':Number(_0x8c69f7[_0xa2a6('0x58')]['id'])});}});}})[_0xa2a6('0x22')](respondWithStatusCode(_0x27976d,null))[_0xa2a6('0x2b')](handleError(_0x27976d,null));};exports[_0xa2a6('0xb2')]=function(_0x4b4b22,_0x211cee,_0x33d365){var _0x4569aa={};var _0x4b3f4d={};var _0x5087d1;var _0x269db7;return db['OpenchannelAccount'][_0xa2a6('0x6a')]({'where':{'id':_0x4b4b22[_0xa2a6('0x58')]['id']}})[_0xa2a6('0x22')](handleEntityNotFound(_0x211cee,null))[_0xa2a6('0x22')](function(_0x23ac75){if(_0x23ac75){_0x5087d1=_0x23ac75;_0x4b3f4d[_0xa2a6('0x43')]=_[_0xa2a6('0x5a')](db[_0xa2a6('0x9d')]['rawAttributes']);_0x4b3f4d[_0xa2a6('0x44')]=_['keys'](_0x4b4b22[_0xa2a6('0x44')]);_0x4b3f4d[_0xa2a6('0x4c')]=_[_0xa2a6('0x45')](_0x4b3f4d[_0xa2a6('0x43')],_0x4b3f4d['query']);_0x4569aa[_0xa2a6('0x47')]=_[_0xa2a6('0x45')](_0x4b3f4d[_0xa2a6('0x43')],qs[_0xa2a6('0x46')](_0x4b4b22[_0xa2a6('0x44')][_0xa2a6('0x46')]));_0x4569aa[_0xa2a6('0x47')]=_0x4569aa[_0xa2a6('0x47')][_0xa2a6('0x48')]?_0x4569aa[_0xa2a6('0x47')]:_0x4b3f4d[_0xa2a6('0x43')];_0x4569aa[_0xa2a6('0x6c')]=qs[_0xa2a6('0x4b')](_0x4b4b22[_0xa2a6('0x44')]['sort']);_0x4569aa[_0xa2a6('0x4f')]=qs[_0xa2a6('0x4c')](_['pick'](_0x4b4b22[_0xa2a6('0x44')],_0x4b3f4d[_0xa2a6('0x4c')]));if(_0x4b4b22[_0xa2a6('0x44')][_0xa2a6('0x4e')]){_0x4569aa[_0xa2a6('0x4f')]=_[_0xa2a6('0x50')](_0x4569aa[_0xa2a6('0x4f')],{'$or':_[_0xa2a6('0x3e')](_0x4569aa[_0xa2a6('0x47')],function(_0x5e23ac){var _0x56488a={};_0x56488a[_0x5e23ac]={'$like':'%'+_0x4b4b22[_0xa2a6('0x44')][_0xa2a6('0x4e')]+'%'};return _0x56488a;})});}_0x4569aa=_[_0xa2a6('0x50')]({},_0x4569aa,_0x4b4b22[_0xa2a6('0x53')]);return _0x5087d1['getAgents'](_0x4569aa);}})[_0xa2a6('0x22')](function(_0x458629){if(_0x458629){_0x269db7=_0x458629[_0xa2a6('0x48')];if(!_0x4b4b22['query']['hasOwnProperty'](_0xa2a6('0x4a'))){_0x4569aa['limit']=qs[_0xa2a6('0x31')](_0x4b4b22[_0xa2a6('0x44')]['limit']);_0x4569aa['offset']=qs[_0xa2a6('0x30')](_0x4b4b22[_0xa2a6('0x44')][_0xa2a6('0x30')]);}return _0x5087d1[_0xa2a6('0xb2')](_0x4569aa);}})[_0xa2a6('0x22')](function(_0x5a1951){if(_0x5a1951){return _0x5a1951?{'count':_0x269db7,'rows':_0x5a1951}:null;}})[_0xa2a6('0x22')](respondWithResult(_0x211cee,null))[_0xa2a6('0x2b')](handleError(_0x211cee,null));};exports[_0xa2a6('0x3c')]=function(_0x4bd281,_0x1116ea,_0x3e1855){var _0x5a6fb3,_0x3558a7,_0x124a8e;if(_[_0xa2a6('0x7a')](_0x4bd281[_0xa2a6('0x65')][_0xa2a6('0x65')])||_0x4bd281[_0xa2a6('0x65')][_0xa2a6('0x65')]===''){throw new db[(_0xa2a6('0x1e'))][(_0xa2a6('0x1f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xa2a6('0x7a')](_0x4bd281['body']['to'])){}_0x5a6fb3=_0x4bd281['body']['to'];return db[_0xa2a6('0x3f')][_0xa2a6('0x6a')]({'where':{'id':_0x4bd281[_0xa2a6('0x58')]['id']}})[_0xa2a6('0x22')](handleEntityNotFound(_0x1116ea,null))[_0xa2a6('0x22')](function(_0x4dbe21){if(_0x4dbe21){return db[_0xa2a6('0x3f')][_0xa2a6('0x5b')]({'where':{'id':_0x4dbe21['id']},'include':[{'model':db['CmList'],'as':_0xa2a6('0x81'),'include':[{'model':db[_0xa2a6('0x82')],'as':_0xa2a6('0x8b'),'where':{[_0x4dbe21[_0xa2a6('0x7d')]]:_0x5a6fb3},'limit':0x1,'order':[[_0xa2a6('0x78'),_0xa2a6('0x83')]]}]}]})[_0xa2a6('0x22')](handleEntityNotFound(_0x1116ea,null))[_0xa2a6('0x22')](function(_0x1390c1){if(_0x1390c1&&_0x1390c1['List']){_0x3558a7=_0x1390c1[_0xa2a6('0x38')]({'plain':!![]});if(_0x3558a7[_0xa2a6('0x81')]&&_0x3558a7[_0xa2a6('0x81')][_0xa2a6('0x8b')][_0xa2a6('0x48')]){return _0x3558a7[_0xa2a6('0x81')][_0xa2a6('0x8b')][0x0];}return db[_0xa2a6('0x82')][_0xa2a6('0x5c')](_[_0xa2a6('0x8c')](_0x4bd281[_0xa2a6('0x65')],{'firstName':_0x5a6fb3,[_0x1390c1[_0xa2a6('0x7d')]]:_0x5a6fb3,'phone':_0x5a6fb3,'ListId':_0x3558a7['ListId']}));}})[_0xa2a6('0x22')](handleEntityNotFound(_0x1116ea,null))[_0xa2a6('0x22')](function(_0x462d64){if(_0x462d64){_0x124a8e=_0x462d64;return db['OpenchannelInteraction'][_0xa2a6('0x5b')]({'where':{'ContactId':_0x124a8e['id'],'closed':![],'OpenchannelAccountId':_0x3558a7['id']}})[_0xa2a6('0x22')](function(_0x4ceee9){if(_0x4ceee9){return[_0x4ceee9,![]];}return db[_0xa2a6('0x91')]['create']({'UserId':_0x4bd281[_0xa2a6('0x5d')]['id'],'ContactId':_0x124a8e['id'],'OpenchannelAccountId':_0x3558a7['id'],'lastMsgDirection':'out','Messages':[_[_0xa2a6('0x50')](_0x4bd281[_0xa2a6('0x65')],{'read':![],'body':_0x4bd281['body'][_0xa2a6('0x65')],'OpenchannelAccountId':_0x3558a7['id'],'UserId':_0x4bd281['user']['id'],'ContactId':_0x124a8e['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0xa2a6('0xb3')}]})[_0xa2a6('0x22')](function(_0x12e18b){return[_0x12e18b,!![]];});});}})['spread'](function(_0x5b2459,_0x59610d){if(_0x59610d){return _0x5b2459;}return db[_0xa2a6('0x9b')][_0xa2a6('0x5c')](_['merge'](_0x4bd281[_0xa2a6('0x65')],{'read':![],'body':_0x4bd281[_0xa2a6('0x65')][_0xa2a6('0x65')],'OpenchannelAccountId':_0x3558a7['id'],'OpenchannelInteractionId':_0x5b2459['id'],'UserId':_0x4bd281['user']['id'],'ContactId':_0x124a8e['id']}))['then'](function(_0x1c3639){_0x5b2459[_0xa2a6('0xb4')][_0xa2a6('0xb3')]=[];_0x5b2459[_0xa2a6('0xb4')][_0xa2a6('0xb3')][_0xa2a6('0x97')](_0x1c3639[_0xa2a6('0xb4')]);return _0x5b2459;});});}})[_0xa2a6('0x22')](respondWithResult(_0x1116ea,null))['catch'](handleError(_0x1116ea,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index c56b264..b53b066 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 _0x887c=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelAccount','save'];(function(_0x1339f2,_0x1889f2){var _0x1e548f=function(_0xeb7985){while(--_0xeb7985){_0x1339f2['push'](_0x1339f2['shift']());}};_0x1e548f(++_0x1889f2);}(_0x887c,0x8c));var _0xc887=function(_0x2a25ae,_0x37e6ec){_0x2a25ae=_0x2a25ae-0x0;var _0x3b863f=_0x887c[_0x2a25ae];return _0x3b863f;};'use strict';var EventEmitter=require(_0xc887('0x0'));var OpenchannelAccount=require(_0xc887('0x1'))['db'][_0xc887('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc887('0x3'),'afterUpdate':_0xc887('0x4'),'afterDestroy':_0xc887('0x5')};function emitEvent(_0x19bb57){return function(_0x22507e,_0x39a5b3,_0x1b7b72){OpenchannelAccountEvents['emit'](_0x19bb57+':'+_0x22507e['id'],_0x22507e);OpenchannelAccountEvents[_0xc887('0x6')](_0x19bb57,_0x22507e);_0x1b7b72(null);};}for(var e in events){if(events[_0xc887('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xc887('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x322a=['OpenchannelAccount','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x178b4e,_0x3810c2){var _0x176a81=function(_0x490fc4){while(--_0x490fc4){_0x178b4e['push'](_0x178b4e['shift']());}};_0x176a81(++_0x3810c2);}(_0x322a,0x1d2));var _0xa322=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x322a[_0xbb9dbf];return _0x30223c;};'use strict';var EventEmitter=require(_0xa322('0x0'));var OpenchannelAccount=require(_0xa322('0x1'))['db'][_0xa322('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xa322('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xa322('0x4')};function emitEvent(_0x10825e){return function(_0x1a474e,_0x48eb47,_0x163424){OpenchannelAccountEvents[_0xa322('0x5')](_0x10825e+':'+_0x1a474e['id'],_0x1a474e);OpenchannelAccountEvents['emit'](_0x10825e,_0x1a474e);_0x163424(null);};}for(var e in events){if(events[_0xa322('0x6')](e)){var event=events[e];OpenchannelAccount[_0xa322('0x7')](e,emitEvent(event));}}module[_0xa322('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 3fcb2a5..4a4679f 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 _0x6dba=['OpenchannelAccount','openchannel_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define'];(function(_0xdc66e7,_0x13a216){var _0x1a46af=function(_0x4a11a5){while(--_0x4a11a5){_0xdc66e7['push'](_0xdc66e7['shift']());}};_0x1a46af(++_0x13a216);}(_0x6dba,0x16e));var _0xa6db=function(_0x2c9f51,_0x2eec01){_0x2c9f51=_0x2c9f51-0x0;var _0x12abf9=_0x6dba[_0x2c9f51];return _0x12abf9;};'use strict';var _=require(_0xa6db('0x0'));var util=require('util');var logger=require(_0xa6db('0x1'))(_0xa6db('0x2'));var moment=require('moment');var BPromise=require(_0xa6db('0x3'));var rp=require(_0xa6db('0x4'));var fs=require('fs');var path=require(_0xa6db('0x5'));var rimraf=require(_0xa6db('0x6'));var config=require(_0xa6db('0x7'));var attributes=require(_0xa6db('0x8'));module[_0xa6db('0x9')]=function(_0x2e6331,_0x12ec7f){return _0x2e6331[_0xa6db('0xa')](_0xa6db('0xb'),attributes,{'tableName':_0xa6db('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c51=['define','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./openchannelAccount.attributes'];(function(_0x1f4993,_0x1ae952){var _0x2be12a=function(_0x4c0784){while(--_0x4c0784){_0x1f4993['push'](_0x1f4993['shift']());}};_0x2be12a(++_0x1ae952);}(_0x3c51,0xf5));var _0x13c5=function(_0x477879,_0x39901b){_0x477879=_0x477879-0x0;var _0x1a3e73=_0x3c51[_0x477879];return _0x1a3e73;};'use strict';var _=require(_0x13c5('0x0'));var util=require(_0x13c5('0x1'));var logger=require(_0x13c5('0x2'))(_0x13c5('0x3'));var moment=require(_0x13c5('0x4'));var BPromise=require('bluebird');var rp=require(_0x13c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x13c5('0x6'));var attributes=require(_0x13c5('0x7'));module['exports']=function(_0x17bb27,_0x27bbb3){return _0x17bb27[_0x13c5('0x8')](_0x13c5('0x9'),attributes,{'tableName':_0x13c5('0xa'),'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 77bfc77..3203ee6 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 _0x7703=['result','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','info'];(function(_0x772b80,_0x39b2be){var _0x30b292=function(_0x599382){while(--_0x599382){_0x772b80['push'](_0x772b80['shift']());}};_0x30b292(++_0x39b2be);}(_0x7703,0x1d5));var _0x3770=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7703[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x3770('0x0'));var util=require(_0x3770('0x1'));var moment=require(_0x3770('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3770('0x3'));var db=require(_0x3770('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3770('0x5'))(_0x3770('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3770('0x7')][_0x3770('0x8')]({'port':0x232a});config[_0x3770('0x9')]=_[_0x3770('0xa')](config['redis'],{'host':_0x3770('0xb'),'port':0x18eb});var socket=require(_0x3770('0xc'))(new Redis(config[_0x3770('0x9')]));require(_0x3770('0xd'))[_0x3770('0xe')](socket);function respondWithRpcPromise(_0x42f947,_0x19e61e,_0x260d50){return new BPromise(function(_0x4b62ed,_0x2322e6){return client[_0x3770('0xf')](_0x42f947,_0x260d50)[_0x3770('0x10')](function(_0x399683){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x19e61e,_0x3770('0x11'));logger[_0x3770('0x12')](_0x3770('0x13'),_0x19e61e,_0x3770('0x11'),JSON[_0x3770('0x14')](_0x399683));if(_0x399683[_0x3770('0x15')]){if(_0x399683['error']['code']===0x1f4){logger[_0x3770('0x15')](_0x3770('0x16'),_0x19e61e,_0x399683[_0x3770('0x15')][_0x3770('0x17')]);return _0x2322e6(_0x399683['error'][_0x3770('0x17')]);}logger[_0x3770('0x15')](_0x3770('0x16'),_0x19e61e,_0x399683[_0x3770('0x15')][_0x3770('0x17')]);return _0x4b62ed(_0x399683['error'][_0x3770('0x17')]);}else{logger[_0x3770('0x18')](_0x3770('0x16'),_0x19e61e,_0x3770('0x11'));_0x4b62ed(_0x399683[_0x3770('0x19')][_0x3770('0x17')]);}})['catch'](function(_0x2af93a){logger[_0x3770('0x15')](_0x3770('0x16'),_0x19e61e,_0x2af93a);_0x2322e6(_0x2af93a);});});} \ No newline at end of file +var _0x5a6a=['defaults','localhost','redis','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x53d6d3,_0xe7ae32){var _0x3a5215=function(_0x4babd6){while(--_0x4babd6){_0x53d6d3['push'](_0x53d6d3['shift']());}};_0x3a5215(++_0xe7ae32);}(_0x5a6a,0x1c0));var _0xa5a6=function(_0x42bc6b,_0x284de6){_0x42bc6b=_0x42bc6b-0x0;var _0x43529a=_0x5a6a[_0x42bc6b];return _0x43529a;};'use strict';var _=require(_0xa5a6('0x0'));var util=require(_0xa5a6('0x1'));var moment=require(_0xa5a6('0x2'));var BPromise=require('bluebird');var rs=require(_0xa5a6('0x3'));var fs=require('fs');var Redis=require(_0xa5a6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa5a6('0x5'));var logger=require(_0xa5a6('0x6'))(_0xa5a6('0x7'));var config=require(_0xa5a6('0x8'));var jayson=require(_0xa5a6('0x9'));var client=jayson[_0xa5a6('0xa')]['http']({'port':0x232a});config['redis']=_[_0xa5a6('0xb')](config['redis'],{'host':_0xa5a6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa5a6('0xd')]));require('./openchannelAccount.socket')[_0xa5a6('0xe')](socket);function respondWithRpcPromise(_0x1a52bd,_0x52d77b,_0x6ca0a4){return new BPromise(function(_0x1ba48d,_0x4d9d41){return client[_0xa5a6('0xf')](_0x1a52bd,_0x6ca0a4)[_0xa5a6('0x10')](function(_0x492080){logger[_0xa5a6('0x11')](_0xa5a6('0x12'),_0x52d77b,_0xa5a6('0x13'));logger[_0xa5a6('0x14')](_0xa5a6('0x15'),_0x52d77b,'request\x20sent',JSON[_0xa5a6('0x16')](_0x492080));if(_0x492080[_0xa5a6('0x17')]){if(_0x492080[_0xa5a6('0x17')][_0xa5a6('0x18')]===0x1f4){logger[_0xa5a6('0x17')](_0xa5a6('0x12'),_0x52d77b,_0x492080['error'][_0xa5a6('0x19')]);return _0x4d9d41(_0x492080[_0xa5a6('0x17')]['message']);}logger[_0xa5a6('0x17')](_0xa5a6('0x12'),_0x52d77b,_0x492080[_0xa5a6('0x17')][_0xa5a6('0x19')]);return _0x1ba48d(_0x492080[_0xa5a6('0x17')][_0xa5a6('0x19')]);}else{logger[_0xa5a6('0x11')](_0xa5a6('0x12'),_0x52d77b,'request\x20sent');_0x1ba48d(_0x492080['result']['message']);}})[_0xa5a6('0x1a')](function(_0x2de427){logger[_0xa5a6('0x17')](_0xa5a6('0x12'),_0x52d77b,_0x2de427);_0x4d9d41(_0x2de427);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 0799a40..bf2dece 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 _0xdab5=['save','remove','update','emit','removeListener','register','length','openchannelAccount:'];(function(_0x29b3a3,_0x559368){var _0xadd503=function(_0x2f890d){while(--_0x2f890d){_0x29b3a3['push'](_0x29b3a3['shift']());}};_0xadd503(++_0x559368);}(_0xdab5,0x1d0));var _0x5dab=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xdab5[_0x4d613c];return _0x301fe3;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x5dab('0x0'),_0x5dab('0x1'),_0x5dab('0x2')];function createListener(_0x43e804,_0x38ba2b){return function(_0xae0aac){_0x38ba2b[_0x5dab('0x3')](_0x43e804,_0xae0aac);};}function removeListener(_0x572d06,_0x3e6dba){return function(){OpenchannelAccountEvents[_0x5dab('0x4')](_0x572d06,_0x3e6dba);};}exports[_0x5dab('0x5')]=function(_0x37adb0){for(var _0x575e94=0x0,_0xde8c8e=events[_0x5dab('0x6')];_0x575e94<_0xde8c8e;_0x575e94++){var _0x57704c=events[_0x575e94];var _0x2196d4=createListener(_0x5dab('0x7')+_0x57704c,_0x37adb0);OpenchannelAccountEvents['on'](_0x57704c,_0x2196d4);}}; \ No newline at end of file +var _0x2010=['removeListener','register','length','./openchannelAccount.events','save','remove','update','emit'];(function(_0x400dd3,_0x2ec3f3){var _0x54c379=function(_0x50f42b){while(--_0x50f42b){_0x400dd3['push'](_0x400dd3['shift']());}};_0x54c379(++_0x2ec3f3);}(_0x2010,0x1d3));var _0x0201=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2010[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelAccountEvents=require(_0x0201('0x0'));var events=[_0x0201('0x1'),_0x0201('0x2'),_0x0201('0x3')];function createListener(_0x580f1a,_0x3ccc9e){return function(_0x1cc5e3){_0x3ccc9e[_0x0201('0x4')](_0x580f1a,_0x1cc5e3);};}function removeListener(_0xf67d61,_0x539311){return function(){OpenchannelAccountEvents[_0x0201('0x5')](_0xf67d61,_0x539311);};}exports[_0x0201('0x6')]=function(_0x59a419){for(var _0x2f15d8=0x0,_0x49e69b=events[_0x0201('0x7')];_0x2f15d8<_0x49e69b;_0x2f15d8++){var _0x1be4cb=events[_0x2f15d8];var _0x1215c4=createListener('openchannelAccount:'+_0x1be4cb,_0x59a419);OpenchannelAccountEvents['on'](_0x1be4cb,_0x1215c4);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 71a6aa7..c62684a 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 _0xafef=['delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xafef,0xec));var _0xfafe=function(_0x285811,_0x378eec){_0x285811=_0x285811-0x0;var _0x31b99b=_0xafef[_0x285811];return _0x31b99b;};'use strict';var multer=require(_0xfafe('0x0'));var util=require(_0xfafe('0x1'));var path=require(_0xfafe('0x2'));var timeout=require('connect-timeout');var express=require(_0xfafe('0x3'));var router=express[_0xfafe('0x4')]();var auth=require(_0xfafe('0x5'));var interaction=require(_0xfafe('0x6'));var config=require(_0xfafe('0x7'));var controller=require('./openchannelApplication.controller');router[_0xfafe('0x8')]('/',auth[_0xfafe('0x9')](),controller[_0xfafe('0xa')]);router[_0xfafe('0x8')](_0xfafe('0xb'),auth[_0xfafe('0x9')](),controller['show']);router[_0xfafe('0xc')]('/',auth['isAuthenticated'](),controller[_0xfafe('0xd')]);router[_0xfafe('0xe')](_0xfafe('0xb'),auth[_0xfafe('0x9')](),controller[_0xfafe('0xf')]);router[_0xfafe('0x10')](_0xfafe('0xb'),auth[_0xfafe('0x9')](),controller['destroy']);module[_0xfafe('0x11')]=router; \ No newline at end of file +var _0xe825=['update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','create','put'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0xe825,0xaf));var _0x5e82=function(_0x2ba428,_0x2c4da2){_0x2ba428=_0x2ba428-0x0;var _0x51dfc3=_0xe825[_0x2ba428];return _0x51dfc3;};'use strict';var multer=require(_0x5e82('0x0'));var util=require(_0x5e82('0x1'));var path=require(_0x5e82('0x2'));var timeout=require('connect-timeout');var express=require(_0x5e82('0x3'));var router=express[_0x5e82('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5e82('0x5'));var config=require(_0x5e82('0x6'));var controller=require(_0x5e82('0x7'));router[_0x5e82('0x8')]('/',auth[_0x5e82('0x9')](),controller[_0x5e82('0xa')]);router['get'](_0x5e82('0xb'),auth[_0x5e82('0x9')](),controller['show']);router[_0x5e82('0xc')]('/',auth[_0x5e82('0x9')](),controller[_0x5e82('0xd')]);router[_0x5e82('0xe')]('/:id',auth[_0x5e82('0x9')](),controller[_0x5e82('0xf')]);router[_0x5e82('0x10')]('/:id',auth[_0x5e82('0x9')](),controller[_0x5e82('0x11')]);module[_0x5e82('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 627c46d..356c14c 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 _0x6143=['exports','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x5b11ff,_0x29c699){var _0x7dccba=function(_0x2be506){while(--_0x2be506){_0x5b11ff['push'](_0x5b11ff['shift']());}};_0x7dccba(++_0x29c699);}(_0x6143,0x1cb));var _0x3614=function(_0x1c63ef,_0x393220){_0x1c63ef=_0x1c63ef-0x0;var _0x342fd6=_0x6143[_0x1c63ef];return _0x342fd6;};'use strict';var Sequelize=require(_0x3614('0x0'));module[_0x3614('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x3614('0x2')]()},'description':{'type':Sequelize[_0x3614('0x3')]},'interval':{'type':Sequelize[_0x3614('0x3')],'defaultValue':_0x3614('0x4')}}; \ No newline at end of file +var _0xfc64=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xfc64,0x1b3));var _0x4fc6=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xfc64[_0x5783f4];return _0x28e380;};'use strict';var Sequelize=require(_0x4fc6('0x0'));module[_0x4fc6('0x1')]={'priority':{'type':Sequelize[_0x4fc6('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4fc6('0x3')},'appdata':{'type':Sequelize[_0x4fc6('0x4')]()},'description':{'type':Sequelize[_0x4fc6('0x5')]},'interval':{'type':Sequelize[_0x4fc6('0x5')],'defaultValue':_0x4fc6('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index b11e070..8b58913 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 _0xe176=['fast-json-patch','request-promise','bluebird','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','save','then','destroy','sendStatus','error','stack','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','name','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','catch','show','params','keys','includeAll','options','find','body','update','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x149213,_0x3124c3){var _0x57c600=function(_0x1c52e1){while(--_0x1c52e1){_0x149213['push'](_0x149213['shift']());}};_0x57c600(++_0x3124c3);}(_0xe176,0x1a0));var _0x6e17=function(_0xaa37af,_0x9c97e7){_0xaa37af=_0xaa37af-0x0;var _0x56d335=_0xe176[_0xaa37af];return _0x56d335;};'use strict';var pdf=require(_0x6e17('0x0'));var emlformat=require(_0x6e17('0x1'));var rimraf=require(_0x6e17('0x2'));var zipdir=require(_0x6e17('0x3'));var jsonpatch=require(_0x6e17('0x4'));var rp=require(_0x6e17('0x5'));var moment=require('moment');var BPromise=require(_0x6e17('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6e17('0x7'));var sox=require('sox');var csv=require(_0x6e17('0x8'));var ejs=require(_0x6e17('0x9'));var fs=require('fs');var _=require(_0x6e17('0xa'));var squel=require('squel');var crypto=require(_0x6e17('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6e17('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6e17('0xd'));var Papa=require(_0x6e17('0xe'));var Redis=require('ioredis');var authService=require(_0x6e17('0xf'));var qs=require(_0x6e17('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6e17('0x11'));var logger=require('../../config/logger')(_0x6e17('0x12'));var utils=require(_0x6e17('0x13'));var config=require(_0x6e17('0x14'));var db=require(_0x6e17('0x15'))['db'];function respondWithStatusCode(_0x52987,_0x544bf5){_0x544bf5=_0x544bf5||0xcc;return function(_0x3636a6){if(_0x3636a6){return _0x52987['sendStatus'](_0x544bf5);}return _0x52987[_0x6e17('0x16')](_0x544bf5)[_0x6e17('0x17')]();};}function respondWithResult(_0x354d5d,_0x2a517c){_0x2a517c=_0x2a517c||0xc8;return function(_0x26b106){if(_0x26b106){return _0x354d5d[_0x6e17('0x16')](_0x2a517c)[_0x6e17('0x18')](_0x26b106);}};}function respondWithFilteredResult(_0x242c89,_0x27c20e){return function(_0x480025){if(_0x480025){var _0x378443=_0x480025[_0x6e17('0x19')],_0x56dfd7=_0x27c20e[_0x6e17('0x1a')],_0x1ffa4=_0x27c20e[_0x6e17('0x1a')]+_0x27c20e[_0x6e17('0x1b')],_0x1afaed;if(_0x1ffa4>=_0x378443){_0x1ffa4=_0x378443;_0x1afaed=0xc8;}else{_0x1afaed=0xce;}_0x242c89[_0x6e17('0x16')](_0x1afaed);return _0x242c89[_0x6e17('0x1c')]('Content-Range',_0x56dfd7+'-'+_0x1ffa4+'/'+_0x378443)[_0x6e17('0x18')](_0x480025);}return null;};}function patchUpdates(_0x1eb006){return function(_0x17b8c2){try{jsonpatch[_0x6e17('0x1d')](_0x17b8c2,_0x1eb006,!![]);}catch(_0x54a3be){return BPromise['reject'](_0x54a3be);}return _0x17b8c2[_0x6e17('0x1e')]();};}function saveUpdates(_0x33d315,_0x1de1b8){return function(_0x37b707){if(_0x37b707){return _0x37b707['update'](_0x33d315)[_0x6e17('0x1f')](function(_0x897c6b){return _0x897c6b;});}return null;};}function removeEntity(_0x186d10,_0x33b3fe){return function(_0x14a514){if(_0x14a514){return _0x14a514[_0x6e17('0x20')]()[_0x6e17('0x1f')](function(){_0x186d10[_0x6e17('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43d34d,_0xc3ddad){return function(_0x1f4355){if(!_0x1f4355){_0x43d34d[_0x6e17('0x21')](0x194);}return _0x1f4355;};}function handleError(_0x39ee5d,_0x559664){_0x559664=_0x559664||0x1f4;return function(_0x21d579){logger[_0x6e17('0x22')](_0x21d579[_0x6e17('0x23')]);if(_0x21d579['name']){delete _0x21d579['name'];}_0x39ee5d['status'](_0x559664)['send'](_0x21d579);};}exports['index']=function(_0x10a27b,_0x276e73){var _0x191dc3={},_0x5167eb={},_0x2b9a4b={'count':0x0,'rows':[]};var _0x3ef711=_[_0x6e17('0x24')](db[_0x6e17('0x25')][_0x6e17('0x26')],function(_0x10edee){return{'name':_0x10edee[_0x6e17('0x27')],'type':_0x10edee[_0x6e17('0x28')][_0x6e17('0x29')]};});_0x5167eb[_0x6e17('0x2a')]=_['map'](_0x3ef711,_0x6e17('0x2b'));_0x5167eb['query']=_['keys'](_0x10a27b['query']);_0x5167eb[_0x6e17('0x2c')]=_['intersection'](_0x5167eb['model'],_0x5167eb['query']);_0x191dc3['attributes']=_[_0x6e17('0x2d')](_0x5167eb[_0x6e17('0x2a')],qs[_0x6e17('0x2e')](_0x10a27b[_0x6e17('0x2f')][_0x6e17('0x2e')]));_0x191dc3[_0x6e17('0x30')]=_0x191dc3[_0x6e17('0x30')][_0x6e17('0x31')]?_0x191dc3[_0x6e17('0x30')]:_0x5167eb['model'];if(!_0x10a27b['query'][_0x6e17('0x32')](_0x6e17('0x33'))){_0x191dc3[_0x6e17('0x1b')]=qs[_0x6e17('0x1b')](_0x10a27b[_0x6e17('0x2f')][_0x6e17('0x1b')]);_0x191dc3[_0x6e17('0x1a')]=qs[_0x6e17('0x1a')](_0x10a27b[_0x6e17('0x2f')][_0x6e17('0x1a')]);}_0x191dc3[_0x6e17('0x34')]=qs[_0x6e17('0x35')](_0x10a27b[_0x6e17('0x2f')][_0x6e17('0x35')]);_0x191dc3[_0x6e17('0x36')]=qs[_0x6e17('0x2c')](_[_0x6e17('0x37')](_0x10a27b['query'],_0x5167eb[_0x6e17('0x2c')]),_0x3ef711);if(_0x10a27b[_0x6e17('0x2f')][_0x6e17('0x38')]){_0x191dc3['where']=_['merge'](_0x191dc3[_0x6e17('0x36')],{'$or':_[_0x6e17('0x24')](_0x3ef711,function(_0x20c507){if(_0x20c507[_0x6e17('0x28')]!==_0x6e17('0x39')){var _0x598104={};_0x598104[_0x20c507[_0x6e17('0x2b')]]={'$like':'%'+_0x10a27b[_0x6e17('0x2f')][_0x6e17('0x38')]+'%'};return _0x598104;}})});}_0x191dc3=_[_0x6e17('0x3a')]({},_0x191dc3,_0x10a27b['options']);var _0x25cb2a={'where':_0x191dc3[_0x6e17('0x36')]};return db[_0x6e17('0x25')][_0x6e17('0x19')](_0x25cb2a)['then'](function(_0x264b90){_0x2b9a4b[_0x6e17('0x19')]=_0x264b90;if(_0x10a27b[_0x6e17('0x2f')]['includeAll']){_0x191dc3['include']=[{'all':!![]}];}return db[_0x6e17('0x25')][_0x6e17('0x3b')](_0x191dc3);})[_0x6e17('0x1f')](function(_0x430f8c){_0x2b9a4b[_0x6e17('0x3c')]=_0x430f8c;return _0x2b9a4b;})[_0x6e17('0x1f')](respondWithFilteredResult(_0x276e73,_0x191dc3))[_0x6e17('0x3d')](handleError(_0x276e73,null));};exports[_0x6e17('0x3e')]=function(_0x33e0de,_0x2b800f){var _0x497368={'raw':!![],'where':{'id':_0x33e0de[_0x6e17('0x3f')]['id']}},_0x224090={};_0x224090[_0x6e17('0x2a')]=_[_0x6e17('0x40')](db['OpenchannelApplication']['rawAttributes']);_0x224090['query']=_[_0x6e17('0x40')](_0x33e0de[_0x6e17('0x2f')]);_0x224090['filters']=_['intersection'](_0x224090['model'],_0x224090['query']);_0x497368[_0x6e17('0x30')]=_[_0x6e17('0x2d')](_0x224090[_0x6e17('0x2a')],qs[_0x6e17('0x2e')](_0x33e0de['query'][_0x6e17('0x2e')]));_0x497368[_0x6e17('0x30')]=_0x497368[_0x6e17('0x30')]['length']?_0x497368['attributes']:_0x224090[_0x6e17('0x2a')];if(_0x33e0de[_0x6e17('0x2f')][_0x6e17('0x41')]){_0x497368['include']=[{'all':!![]}];}_0x497368=_['merge']({},_0x497368,_0x33e0de[_0x6e17('0x42')]);return db['OpenchannelApplication'][_0x6e17('0x43')](_0x497368)[_0x6e17('0x1f')](handleEntityNotFound(_0x2b800f,null))['then'](respondWithResult(_0x2b800f,null))[_0x6e17('0x3d')](handleError(_0x2b800f,null));};exports['create']=function(_0x406c15,_0x3599a4){return db[_0x6e17('0x25')]['create'](_0x406c15[_0x6e17('0x44')],{})['then'](respondWithResult(_0x3599a4,0xc9))[_0x6e17('0x3d')](handleError(_0x3599a4,null));};exports[_0x6e17('0x45')]=function(_0x3ad89d,_0x24b45f){if(_0x3ad89d[_0x6e17('0x44')]['id']){delete _0x3ad89d[_0x6e17('0x44')]['id'];}return db[_0x6e17('0x25')][_0x6e17('0x43')]({'where':{'id':_0x3ad89d[_0x6e17('0x3f')]['id']}})[_0x6e17('0x1f')](handleEntityNotFound(_0x24b45f,null))[_0x6e17('0x1f')](saveUpdates(_0x3ad89d[_0x6e17('0x44')],null))[_0x6e17('0x1f')](respondWithResult(_0x24b45f,null))[_0x6e17('0x3d')](handleError(_0x24b45f,null));};exports[_0x6e17('0x20')]=function(_0x1ff0ec,_0xf524b4){return db[_0x6e17('0x25')][_0x6e17('0x43')]({'where':{'id':_0x1ff0ec[_0x6e17('0x3f')]['id']}})[_0x6e17('0x1f')](handleEntityNotFound(_0xf524b4,null))[_0x6e17('0x1f')](removeEntity(_0xf524b4,null))[_0x6e17('0x3d')](handleError(_0xf524b4,null));}; \ No newline at end of file +var _0x62b4=['status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','OpenchannelApplication','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','count','includeAll','include','findAll','rows','catch','show','params','create','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0x2b423b,_0x1dfc2a){var _0x433dbd=function(_0x5ae8f5){while(--_0x5ae8f5){_0x2b423b['push'](_0x2b423b['shift']());}};_0x433dbd(++_0x1dfc2a);}(_0x62b4,0xc4));var _0x462b=function(_0x17c938,_0x557096){_0x17c938=_0x17c938-0x0;var _0x2d22b2=_0x62b4[_0x17c938];return _0x2d22b2;};'use strict';var pdf=require(_0x462b('0x0'));var emlformat=require(_0x462b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x462b('0x2'));var jsonpatch=require(_0x462b('0x3'));var rp=require('request-promise');var moment=require(_0x462b('0x4'));var BPromise=require(_0x462b('0x5'));var Mustache=require(_0x462b('0x6'));var util=require('util');var path=require(_0x462b('0x7'));var sox=require(_0x462b('0x8'));var csv=require(_0x462b('0x9'));var ejs=require(_0x462b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x462b('0xb'));var crypto=require(_0x462b('0xc'));var jsforce=require(_0x462b('0xd'));var deskjs=require(_0x462b('0xe'));var toCsv=require(_0x462b('0x9'));var querystring=require(_0x462b('0xf'));var Papa=require(_0x462b('0x10'));var Redis=require(_0x462b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x462b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x462b('0x13'));var db=require(_0x462b('0x14'))['db'];function respondWithStatusCode(_0x51089b,_0x413f7d){_0x413f7d=_0x413f7d||0xcc;return function(_0x4c069c){if(_0x4c069c){return _0x51089b[_0x462b('0x15')](_0x413f7d);}return _0x51089b['status'](_0x413f7d)[_0x462b('0x16')]();};}function respondWithResult(_0x3141b9,_0x515969){_0x515969=_0x515969||0xc8;return function(_0x2002fb){if(_0x2002fb){return _0x3141b9[_0x462b('0x17')](_0x515969)[_0x462b('0x18')](_0x2002fb);}};}function respondWithFilteredResult(_0x3cdd4a,_0x53c7f8){return function(_0xc556fd){if(_0xc556fd){var _0x2be708=_0xc556fd['count'],_0x27da04=_0x53c7f8[_0x462b('0x19')],_0x2b256e=_0x53c7f8[_0x462b('0x19')]+_0x53c7f8[_0x462b('0x1a')],_0x5d00c1;if(_0x2b256e>=_0x2be708){_0x2b256e=_0x2be708;_0x5d00c1=0xc8;}else{_0x5d00c1=0xce;}_0x3cdd4a['status'](_0x5d00c1);return _0x3cdd4a[_0x462b('0x1b')](_0x462b('0x1c'),_0x27da04+'-'+_0x2b256e+'/'+_0x2be708)['json'](_0xc556fd);}return null;};}function patchUpdates(_0x586845){return function(_0xfcf771){try{jsonpatch[_0x462b('0x1d')](_0xfcf771,_0x586845,!![]);}catch(_0x132ad6){return BPromise[_0x462b('0x1e')](_0x132ad6);}return _0xfcf771[_0x462b('0x1f')]();};}function saveUpdates(_0x91a0f7,_0x1365d4){return function(_0x7fa9b1){if(_0x7fa9b1){return _0x7fa9b1[_0x462b('0x20')](_0x91a0f7)[_0x462b('0x21')](function(_0x19c1fd){return _0x19c1fd;});}return null;};}function removeEntity(_0x39ff02,_0xf7a877){return function(_0xe45fa8){if(_0xe45fa8){return _0xe45fa8[_0x462b('0x22')]()['then'](function(){_0x39ff02[_0x462b('0x17')](0xcc)[_0x462b('0x16')]();});}};}function handleEntityNotFound(_0x39ea90,_0x53e892){return function(_0x38d324){if(!_0x38d324){_0x39ea90[_0x462b('0x15')](0x194);}return _0x38d324;};}function handleError(_0x12e2a1,_0x17dfc6){_0x17dfc6=_0x17dfc6||0x1f4;return function(_0x2bace3){logger[_0x462b('0x23')](_0x2bace3[_0x462b('0x24')]);if(_0x2bace3['name']){delete _0x2bace3['name'];}_0x12e2a1[_0x462b('0x17')](_0x17dfc6)[_0x462b('0x25')](_0x2bace3);};}exports[_0x462b('0x26')]=function(_0x296b6b,_0x5f1480){var _0x314cad={},_0x3a0b37={},_0x4b1297={'count':0x0,'rows':[]};var _0x5663bd=_['map'](db[_0x462b('0x27')][_0x462b('0x28')],function(_0x2f2e0d){return{'name':_0x2f2e0d['fieldName'],'type':_0x2f2e0d['type'][_0x462b('0x29')]};});_0x3a0b37[_0x462b('0x2a')]=_[_0x462b('0x2b')](_0x5663bd,'name');_0x3a0b37[_0x462b('0x2c')]=_[_0x462b('0x2d')](_0x296b6b[_0x462b('0x2c')]);_0x3a0b37[_0x462b('0x2e')]=_[_0x462b('0x2f')](_0x3a0b37[_0x462b('0x2a')],_0x3a0b37['query']);_0x314cad[_0x462b('0x30')]=_['intersection'](_0x3a0b37['model'],qs[_0x462b('0x31')](_0x296b6b[_0x462b('0x2c')][_0x462b('0x31')]));_0x314cad[_0x462b('0x30')]=_0x314cad[_0x462b('0x30')][_0x462b('0x32')]?_0x314cad['attributes']:_0x3a0b37[_0x462b('0x2a')];if(!_0x296b6b[_0x462b('0x2c')][_0x462b('0x33')](_0x462b('0x34'))){_0x314cad['limit']=qs['limit'](_0x296b6b[_0x462b('0x2c')][_0x462b('0x1a')]);_0x314cad[_0x462b('0x19')]=qs[_0x462b('0x19')](_0x296b6b[_0x462b('0x2c')]['offset']);}_0x314cad[_0x462b('0x35')]=qs[_0x462b('0x36')](_0x296b6b[_0x462b('0x2c')][_0x462b('0x36')]);_0x314cad[_0x462b('0x37')]=qs[_0x462b('0x2e')](_[_0x462b('0x38')](_0x296b6b[_0x462b('0x2c')],_0x3a0b37['filters']),_0x5663bd);if(_0x296b6b[_0x462b('0x2c')][_0x462b('0x39')]){_0x314cad[_0x462b('0x37')]=_[_0x462b('0x3a')](_0x314cad[_0x462b('0x37')],{'$or':_[_0x462b('0x2b')](_0x5663bd,function(_0x2c2a4a){if(_0x2c2a4a['type']!==_0x462b('0x3b')){var _0x194ba8={};_0x194ba8[_0x2c2a4a[_0x462b('0x3c')]]={'$like':'%'+_0x296b6b['query'][_0x462b('0x39')]+'%'};return _0x194ba8;}})});}_0x314cad=_['merge']({},_0x314cad,_0x296b6b[_0x462b('0x3d')]);var _0x27dc92={'where':_0x314cad[_0x462b('0x37')]};return db['OpenchannelApplication'][_0x462b('0x3e')](_0x27dc92)[_0x462b('0x21')](function(_0x4539d7){_0x4b1297[_0x462b('0x3e')]=_0x4539d7;if(_0x296b6b[_0x462b('0x2c')][_0x462b('0x3f')]){_0x314cad[_0x462b('0x40')]=[{'all':!![]}];}return db[_0x462b('0x27')][_0x462b('0x41')](_0x314cad);})[_0x462b('0x21')](function(_0x2f5f7a){_0x4b1297[_0x462b('0x42')]=_0x2f5f7a;return _0x4b1297;})[_0x462b('0x21')](respondWithFilteredResult(_0x5f1480,_0x314cad))[_0x462b('0x43')](handleError(_0x5f1480,null));};exports[_0x462b('0x44')]=function(_0x528f6e,_0x329ad2){var _0x5ecc82={'raw':!![],'where':{'id':_0x528f6e[_0x462b('0x45')]['id']}},_0x5e9de7={};_0x5e9de7['model']=_[_0x462b('0x2d')](db[_0x462b('0x27')][_0x462b('0x28')]);_0x5e9de7['query']=_[_0x462b('0x2d')](_0x528f6e[_0x462b('0x2c')]);_0x5e9de7[_0x462b('0x2e')]=_[_0x462b('0x2f')](_0x5e9de7[_0x462b('0x2a')],_0x5e9de7['query']);_0x5ecc82[_0x462b('0x30')]=_[_0x462b('0x2f')](_0x5e9de7[_0x462b('0x2a')],qs[_0x462b('0x31')](_0x528f6e[_0x462b('0x2c')][_0x462b('0x31')]));_0x5ecc82[_0x462b('0x30')]=_0x5ecc82[_0x462b('0x30')]['length']?_0x5ecc82[_0x462b('0x30')]:_0x5e9de7[_0x462b('0x2a')];if(_0x528f6e[_0x462b('0x2c')][_0x462b('0x3f')]){_0x5ecc82[_0x462b('0x40')]=[{'all':!![]}];}_0x5ecc82=_[_0x462b('0x3a')]({},_0x5ecc82,_0x528f6e[_0x462b('0x3d')]);return db[_0x462b('0x27')]['find'](_0x5ecc82)[_0x462b('0x21')](handleEntityNotFound(_0x329ad2,null))[_0x462b('0x21')](respondWithResult(_0x329ad2,null))[_0x462b('0x43')](handleError(_0x329ad2,null));};exports[_0x462b('0x46')]=function(_0x5445b7,_0x4ad311){return db[_0x462b('0x27')][_0x462b('0x46')](_0x5445b7[_0x462b('0x47')],{})[_0x462b('0x21')](respondWithResult(_0x4ad311,0xc9))[_0x462b('0x43')](handleError(_0x4ad311,null));};exports['update']=function(_0x40bf1e,_0x22d44f){if(_0x40bf1e['body']['id']){delete _0x40bf1e[_0x462b('0x47')]['id'];}return db[_0x462b('0x27')][_0x462b('0x48')]({'where':{'id':_0x40bf1e[_0x462b('0x45')]['id']}})[_0x462b('0x21')](handleEntityNotFound(_0x22d44f,null))[_0x462b('0x21')](saveUpdates(_0x40bf1e[_0x462b('0x47')],null))['then'](respondWithResult(_0x22d44f,null))[_0x462b('0x43')](handleError(_0x22d44f,null));};exports[_0x462b('0x22')]=function(_0x4aadf4,_0x1b7b04){return db[_0x462b('0x27')]['find']({'where':{'id':_0x4aadf4[_0x462b('0x45')]['id']}})[_0x462b('0x21')](handleEntityNotFound(_0x1b7b04,null))[_0x462b('0x21')](removeEntity(_0x1b7b04,null))['catch'](handleError(_0x1b7b04,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 077b10e..3db3580 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 _0xee44=['path','rimraf','../../config/environment','exports','define','openchannel_applications','utf8mb4','lodash','util','request-promise'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0xee44,0x89));var _0x4ee4=function(_0x37c765,_0x4d1755){_0x37c765=_0x37c765-0x0;var _0x2ebef7=_0xee44[_0x37c765];return _0x2ebef7;};'use strict';var _=require(_0x4ee4('0x0'));var util=require(_0x4ee4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4ee4('0x2'));var fs=require('fs');var path=require(_0x4ee4('0x3'));var rimraf=require(_0x4ee4('0x4'));var config=require(_0x4ee4('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0x4ee4('0x6')]=function(_0x15c91f,_0x585e04){return _0x15c91f[_0x4ee4('0x7')]('OpenchannelApplication',attributes,{'tableName':_0x4ee4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4ee4('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x98a3=['bluebird','rimraf','exports','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment'];(function(_0x3e04f0,_0xd984fd){var _0x3a7064=function(_0x5010ae){while(--_0x5010ae){_0x3e04f0['push'](_0x3e04f0['shift']());}};_0x3a7064(++_0xd984fd);}(_0x98a3,0x18a));var _0x398a=function(_0x1469d6,_0x4eed8e){_0x1469d6=_0x1469d6-0x0;var _0x131924=_0x98a3[_0x1469d6];return _0x131924;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x398a('0x0'))('api');var moment=require(_0x398a('0x1'));var BPromise=require(_0x398a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x398a('0x3'));var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0x398a('0x4')]=function(_0x4fd5dc,_0x55b0fc){return _0x4fd5dc['define'](_0x398a('0x5'),attributes,{'tableName':_0x398a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x398a('0x7'),'collate':_0x398a('0x8')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index da5883b..68cdde4 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 _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2c5a00,_0x488b92){var _0x37b973=function(_0x4660e4){while(--_0x4660e4){_0x2c5a00['push'](_0x2c5a00['shift']());}};_0x37b973(++_0x488b92);}(_0xb10b,0x12a));var _0xbb10=function(_0x2dcc48,_0x59027c){_0x2dcc48=_0x2dcc48-0x0;var _0x292bc8=_0xb10b[_0x2dcc48];return _0x292bc8;};'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?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x510ca9,_0x5371dc){var _0x2323ec=function(_0x9a5a72){while(--_0x9a5a72){_0x510ca9['push'](_0x510ca9['shift']());}};_0x2323ec(++_0x5371dc);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c568e,_0xc5e4b0){_0x5c568e=_0x5c568e-0x0;var _0x5aff74=_0xb10b[_0x5c568e];return _0x5aff74;};'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?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index b60851a..c44bb0c 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 _0x056b=['post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','update','delete','destroy','removeTags','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/describe','describe','get','/:id','show','/:id/messages','download'];(function(_0x3646e3,_0x1703c8){var _0x247596=function(_0x58c235){while(--_0x58c235){_0x3646e3['push'](_0x3646e3['shift']());}};_0x247596(++_0x1703c8);}(_0x056b,0x179));var _0xb056=function(_0x2fa8b5,_0x2b4ca8){_0x2fa8b5=_0x2fa8b5-0x0;var _0x3007c4=_0x056b[_0x2fa8b5];return _0x3007c4;};'use strict';var multer=require(_0xb056('0x0'));var util=require(_0xb056('0x1'));var path=require(_0xb056('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb056('0x3')]();var auth=require(_0xb056('0x4'));var interaction=require(_0xb056('0x5'));var config=require(_0xb056('0x6'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0xb056('0x7')](),controller['index']);router['get'](_0xb056('0x8'),auth[_0xb056('0x7')](),controller[_0xb056('0x9')]);router[_0xb056('0xa')](_0xb056('0xb'),auth[_0xb056('0x7')](),controller[_0xb056('0xc')]);router[_0xb056('0xa')](_0xb056('0xd'),auth[_0xb056('0x7')](),controller['getMessages']);router[_0xb056('0xa')]('/:id/download',auth[_0xb056('0x7')](),controller[_0xb056('0xe')]);router[_0xb056('0xf')]('/',auth[_0xb056('0x7')](),controller[_0xb056('0x10')]);router['post']('/:id/messages',auth[_0xb056('0x7')](),controller[_0xb056('0x11')]);router[_0xb056('0xf')](_0xb056('0x12'),auth[_0xb056('0x7')](),interaction[_0xb056('0x13')](_0xb056('0x14'),_0xb056('0x15')),controller[_0xb056('0x16')]);router['put']('/:id',auth[_0xb056('0x7')](),interaction[_0xb056('0x13')](_0xb056('0x14'),'openchannelinteraction:update'),controller[_0xb056('0x17')]);router[_0xb056('0x18')]('/:id',auth[_0xb056('0x7')](),interaction[_0xb056('0x13')](_0xb056('0x14'),'openchannelinteraction:destroy'),controller[_0xb056('0x19')]);router['delete']('/:id/tags',auth[_0xb056('0x7')](),controller[_0xb056('0x1a')]);module[_0xb056('0x1b')]=router; \ No newline at end of file +var _0xb9b8=['/describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','openchannelinteraction:addtags','addTags','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index'];(function(_0x4aadbc,_0x4afc4d){var _0x372f33=function(_0xc50454){while(--_0xc50454){_0x4aadbc['push'](_0x4aadbc['shift']());}};_0x372f33(++_0x4afc4d);}(_0xb9b8,0x72));var _0x8b9b=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0xb9b8[_0x246148];return _0x453d94;};'use strict';var multer=require(_0x8b9b('0x0'));var util=require('util');var path=require(_0x8b9b('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b9b('0x2'));var router=express['Router']();var auth=require(_0x8b9b('0x3'));var interaction=require(_0x8b9b('0x4'));var config=require(_0x8b9b('0x5'));var controller=require(_0x8b9b('0x6'));router[_0x8b9b('0x7')]('/',auth[_0x8b9b('0x8')](),controller[_0x8b9b('0x9')]);router[_0x8b9b('0x7')](_0x8b9b('0xa'),auth[_0x8b9b('0x8')](),controller['describe']);router['get'](_0x8b9b('0xb'),auth[_0x8b9b('0x8')](),controller[_0x8b9b('0xc')]);router[_0x8b9b('0x7')](_0x8b9b('0xd'),auth['isAuthenticated'](),controller[_0x8b9b('0xe')]);router[_0x8b9b('0x7')]('/:id/download',auth['isAuthenticated'](),controller[_0x8b9b('0xf')]);router[_0x8b9b('0x10')]('/',auth[_0x8b9b('0x8')](),controller[_0x8b9b('0x11')]);router['post'](_0x8b9b('0xd'),auth[_0x8b9b('0x8')](),controller[_0x8b9b('0x12')]);router[_0x8b9b('0x10')](_0x8b9b('0x13'),auth[_0x8b9b('0x8')](),interaction[_0x8b9b('0x14')]('openchannel',_0x8b9b('0x15')),controller[_0x8b9b('0x16')]);router['put']('/:id',auth[_0x8b9b('0x8')](),interaction[_0x8b9b('0x14')](_0x8b9b('0x17'),_0x8b9b('0x18')),controller[_0x8b9b('0x19')]);router[_0x8b9b('0x1a')](_0x8b9b('0xb'),auth[_0x8b9b('0x8')](),interaction['tracked'](_0x8b9b('0x17'),_0x8b9b('0x1b')),controller[_0x8b9b('0x1c')]);router[_0x8b9b('0x1a')](_0x8b9b('0x13'),auth[_0x8b9b('0x8')](),controller[_0x8b9b('0x1d')]);module[_0x8b9b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 2811d99..44e86f3 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 _0xfa9c=['ENUM','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x4e4e9f,_0x39d7af){var _0x545a3b=function(_0x2a1c64){while(--_0x2a1c64){_0x4e4e9f['push'](_0x4e4e9f['shift']());}};_0x545a3b(++_0x39d7af);}(_0xfa9c,0x145));var _0xcfa9=function(_0x38ffba,_0x107617){_0x38ffba=_0x38ffba-0x0;var _0x1f28db=_0xfa9c[_0x38ffba];return _0x1f28db;};'use strict';var Sequelize=require(_0xcfa9('0x0'));module[_0xcfa9('0x1')]={'closed':{'type':Sequelize[_0xcfa9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xcfa9('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xcfa9('0x4')]},'threadId':{'type':Sequelize[_0xcfa9('0x3')]},'externalUrl':{'type':Sequelize[_0xcfa9('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcfa9('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4466=['BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4466,0x172));var _0x6446=function(_0x65e216,_0x568bd5){_0x65e216=_0x65e216-0x0;var _0x4e3e06=_0x4466[_0x65e216];return _0x4e3e06;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x6446('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6446('0x1')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6446('0x2')]},'read1stAt':{'type':Sequelize[_0x6446('0x1')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6446('0x3')]('in',_0x6446('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6446('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 91f38a3..13b8604 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 _0x82a2=['length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','UserId','buildExpression','body','text','some','compact','isEmpty','forEach','OpenchannelAccountId','where','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','include','create','update','params','destroy','describe','addMessage','OpenchannelMessage','omit','getMessages','hasOwnProperty','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','addTags','setTags','ids','spread','emit','removeTags','unix','join','server','root','files','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','firstName','Attachment','direction','OpenchannelAccount','Account','Owner','get','mkdirSync','10px','40px','\x0a\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\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','YYYY-MM-DD','N.A.','closed','closedAt','threadId','Private','Messages','basename','createReadStream','pipe','createWriteStream','out','lastName','secret','views','downloadInteraction.html','toFile','transcript-','.pdf','download','log','unlinkSync','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','then','error','stack','name','Users','map','fullname','TagIds','Tags','split','catch','index','OpenchannelInteraction','rawAttributes','type','model','query','keys','intersection','attributes','fields','nolimit','order','sort','filters','pick','select','field','color','tools_tags','u.id','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','openchannel_interactions','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions'];(function(_0x121737,_0x37e36b){var _0x5f4d4b=function(_0x14182a){while(--_0x14182a){_0x121737['push'](_0x121737['shift']());}};_0x5f4d4b(++_0x37e36b);}(_0x82a2,0x196));var _0x282a=function(_0x13a47b,_0x100264){_0x13a47b=_0x13a47b-0x0;var _0x24e58e=_0x82a2[_0x13a47b];return _0x24e58e;};'use strict';var pdf=require(_0x282a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x282a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x282a('0x2'));var moment=require(_0x282a('0x3'));var BPromise=require(_0x282a('0x4'));var Mustache=require(_0x282a('0x5'));var util=require(_0x282a('0x6'));var path=require(_0x282a('0x7'));var sox=require(_0x282a('0x8'));var csv=require(_0x282a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x282a('0xa'));var crypto=require(_0x282a('0xb'));var jsforce=require(_0x282a('0xc'));var deskjs=require(_0x282a('0xd'));var toCsv=require(_0x282a('0x9'));var querystring=require(_0x282a('0xe'));var Papa=require('papaparse');var Redis=require(_0x282a('0xf'));var authService=require(_0x282a('0x10'));var qs=require(_0x282a('0x11'));var as=require(_0x282a('0x12'));var hardwareService=require(_0x282a('0x13'));var logger=require(_0x282a('0x14'))('api');var utils=require(_0x282a('0x15'));var config=require('../../config/environment');var db=require(_0x282a('0x16'))['db'];config[_0x282a('0x17')]=_[_0x282a('0x18')](config['redis'],{'host':_0x282a('0x19'),'port':0x18eb});var socket=require(_0x282a('0x1a'))(new Redis(config[_0x282a('0x17')]));require(_0x282a('0x1b'))[_0x282a('0x1c')](socket);function respondWithStatusCode(_0x17cdd8,_0x4c5fb7){_0x4c5fb7=_0x4c5fb7||0xcc;return function(_0x5105bf){if(_0x5105bf){return _0x17cdd8[_0x282a('0x1d')](_0x4c5fb7);}return _0x17cdd8[_0x282a('0x1e')](_0x4c5fb7)[_0x282a('0x1f')]();};}function respondWithResult(_0x11fff5,_0x16540e){_0x16540e=_0x16540e||0xc8;return function(_0x2db97d){if(_0x2db97d){return _0x11fff5[_0x282a('0x1e')](_0x16540e)[_0x282a('0x20')](_0x2db97d);}};}function respondWithFilteredResult(_0x7339f5,_0x139e4a){return function(_0x36f551){if(_0x36f551){var _0x3f5682=_0x36f551[_0x282a('0x21')],_0x1c1093=_0x139e4a[_0x282a('0x22')],_0x26e558=_0x139e4a[_0x282a('0x22')]+_0x139e4a[_0x282a('0x23')],_0x3f576a;if(_0x26e558>=_0x3f5682){_0x26e558=_0x3f5682;_0x3f576a=0xc8;}else{_0x3f576a=0xce;}_0x7339f5[_0x282a('0x1e')](_0x3f576a);return _0x7339f5['set'](_0x282a('0x24'),_0x1c1093+'-'+_0x26e558+'/'+_0x3f5682)[_0x282a('0x20')](_0x36f551);}return null;};}function patchUpdates(_0x2f996b){return function(_0x557830){try{jsonpatch['apply'](_0x557830,_0x2f996b,!![]);}catch(_0x3f0535){return BPromise[_0x282a('0x25')](_0x3f0535);}return _0x557830[_0x282a('0x26')]();};}function saveUpdates(_0x3fbe5b,_0x22ff56){return function(_0x294b3c){if(_0x294b3c){return _0x294b3c['update'](_0x3fbe5b)['then'](function(_0x2a3891){return _0x2a3891;});}return null;};}function removeEntity(_0x30a623,_0x4e7782){return function(_0x5012f5){if(_0x5012f5){return _0x5012f5['destroy']()[_0x282a('0x27')](function(){_0x30a623[_0x282a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2163dd,_0x1b288e){return function(_0xf7c393){if(!_0xf7c393){_0x2163dd['sendStatus'](0x194);}return _0xf7c393;};}function handleError(_0x5d47f3,_0x114607){_0x114607=_0x114607||0x1f4;return function(_0x4e0f1d){logger[_0x282a('0x28')](_0x4e0f1d[_0x282a('0x29')]);if(_0x4e0f1d['name']){delete _0x4e0f1d[_0x282a('0x2a')];}_0x5d47f3[_0x282a('0x1e')](_0x114607)['send'](_0x4e0f1d);};}function getInteractionUsers(_0x48afcb,_0x3e5228){return new BPromise(function(_0x466d74,_0x2dbf0f){try{if(_0x3e5228[_0x48afcb['id']]){_0x48afcb[_0x282a('0x2b')]=_[_0x282a('0x2c')](_0x3e5228[_0x48afcb['id']],function(_0x479006){return{'id':_0x479006['id'],'fullname':_0x479006[_0x282a('0x2d')]};});}}catch(_0x2efa2a){_0x2dbf0f(_0x2efa2a);}_0x466d74(_0x48afcb);});}function getInteractionTags(_0x49871a,_0x58cfae){return new BPromise(function(_0x2b4452,_0x437a81){try{if(_0x49871a[_0x282a('0x2e')]){_0x49871a[_0x282a('0x2f')]=[];_0x49871a[_0x282a('0x2e')][_0x282a('0x30')](',')['forEach'](function(_0x6d933b){_0x49871a[_0x282a('0x2f')]['push'](_0x58cfae[_0x6d933b]);});}delete _0x49871a[_0x282a('0x2e')];}catch(_0xa69e00){_0x437a81(_0xa69e00);}_0x2b4452(_0x49871a);});}function updateOpenchannelInteraction(_0x30abec,_0x1b8063,_0x37a7fe){return new BPromise(function(_0x160638,_0xa2c8f1){return getInteractionUsers(_0x30abec,_0x37a7fe)[_0x282a('0x27')](function(_0x5c1f6f){return getInteractionTags(_0x5c1f6f,_0x1b8063);})[_0x282a('0x27')](function(_0x402eb3){_0x160638(_0x402eb3);})[_0x282a('0x31')](function(_0x5b038a){_0xa2c8f1(_0x5b038a);});});}exports[_0x282a('0x32')]=function(_0x5183cc,_0x1a8cc4){var _0x32a9b1={},_0x30dd5a={},_0x193e17={'count':0x0,'rows':[]};var _0x4f78c9=_[_0x282a('0x2c')](db[_0x282a('0x33')][_0x282a('0x34')],function(_0x5522ad){return{'name':_0x5522ad['fieldName'],'type':_0x5522ad[_0x282a('0x35')]['key']};});_0x30dd5a[_0x282a('0x36')]=_[_0x282a('0x2c')](_0x4f78c9,_0x282a('0x2a'));_0x30dd5a[_0x282a('0x37')]=_[_0x282a('0x38')](_0x5183cc['query']);_0x30dd5a['filters']=_[_0x282a('0x39')](_0x30dd5a[_0x282a('0x36')],_0x30dd5a[_0x282a('0x37')]);_0x32a9b1[_0x282a('0x3a')]=_[_0x282a('0x39')](_0x30dd5a[_0x282a('0x36')],qs[_0x282a('0x3b')](_0x5183cc[_0x282a('0x37')]['fields']));_0x32a9b1['attributes']=_0x32a9b1['attributes']['length']?_0x32a9b1[_0x282a('0x3a')]:_0x30dd5a['model'];if(!_0x5183cc[_0x282a('0x37')]['hasOwnProperty'](_0x282a('0x3c'))){_0x32a9b1[_0x282a('0x23')]=qs[_0x282a('0x23')](_0x5183cc[_0x282a('0x37')][_0x282a('0x23')]);_0x32a9b1['offset']=qs['offset'](_0x5183cc[_0x282a('0x37')]['offset']);}_0x32a9b1[_0x282a('0x3d')]=qs[_0x282a('0x3e')](_0x5183cc[_0x282a('0x37')][_0x282a('0x3e')]);_0x32a9b1['where']=qs[_0x282a('0x3f')](_[_0x282a('0x40')](_0x5183cc['query'],_0x30dd5a[_0x282a('0x3f')]),_0x4f78c9);var _0x8c00c6=[];var _0x2694d2=squel[_0x282a('0x41')]()[_0x282a('0x42')]('id')[_0x282a('0x42')](_0x282a('0x2a'))[_0x282a('0x42')](_0x282a('0x43'))['from'](_0x282a('0x44'));var _0x25aa60=squel[_0x282a('0x41')]()[_0x282a('0x42')](_0x282a('0x45'))['field']('u.fullname')['field'](_0x282a('0x46'))[_0x282a('0x47')](_0x282a('0x48'),'ui')[_0x282a('0x49')](_0x282a('0x4a'),'u','u.id\x20=\x20ui.UserId');var _0x301479=squel['select']()[_0x282a('0x47')](_0x282a('0x4b'),'i')[_0x282a('0x49')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x282a('0x49')](_0x282a('0x4a'),'o','o.id\x20=\x20i.UserId')['left_join']('openchannel_accounts','a',_0x282a('0x4c'))[_0x282a('0x49')](_0x282a('0x4d'),'me',_0x282a('0x4e'))[_0x282a('0x49')](_0x282a('0x4f'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0x282a('0x44'),'t',_0x282a('0x50'));var _0x1c208d=squel[_0x282a('0x51')]();var _0x4e7a3f=[];var _0x106718=squel[_0x282a('0x51')]();var _0x48f794;if(_0x5183cc['query'][_0x282a('0x52')]){_0x48f794=as[_0x282a('0x53')](_0x5183cc[_0x282a('0x37')][_0x282a('0x52')]);var _0x50354c=_0x48f794[_0x282a('0x54')];for(var _0x554b1d=0x0;_0x554b1d<_0x48f794[_0x282a('0x55')][_0x282a('0x56')];_0x554b1d++){var _0x4cb9fa=_0x48f794[_0x282a('0x55')][_0x554b1d];var _0x1b9064='i';var _0x42ac85=_[_0x282a('0x57')](_0x4f78c9,['name',_0x4cb9fa[_0x282a('0x42')]]);if(!_0x42ac85){switch(_0x4cb9fa['field']){case _0x282a('0x58'):if(_0x4cb9fa[_0x282a('0x59')]==0x1){_0x301479[_0x282a('0x5a')]('`'+_0x4cb9fa[_0x282a('0x42')]+_0x282a('0x5b'));}else{_0x301479[_0x282a('0x5a')]('`'+_0x4cb9fa[_0x282a('0x42')]+_0x282a('0x5c'));}break;case'Contact':if(_0x4cb9fa['operator']===_0x282a('0x5d')){if(_0x4cb9fa[_0x282a('0x59')][_0x282a('0x30')]('\x20')[_0x282a('0x56')]>0x1){_0x1c208d[_0x50354c](_0x282a('0x5e'),qs[_0x282a('0x5f')](_0x4cb9fa['value']),null);}else{var _0xda8e04='%'+_0x4cb9fa[_0x282a('0x59')]+'%';_0x1c208d[_0x50354c](_0x282a('0x60'),_0xda8e04,_0xda8e04,_0xda8e04);}}else{_0x42ac85=_[_0x282a('0x57')](_0x4f78c9,[_0x282a('0x2a'),_0x282a('0x61')]);_0x4cb9fa['field']='ContactId';_0x22636a=as['buildExpression'](_0x1b9064,_0x42ac85['type'],_0x4cb9fa);_0x1c208d[_0x50354c](_0x22636a['text'],_0x22636a[_0x282a('0x59')][_0x282a('0x62')],_0x22636a[_0x282a('0x59')][_0x282a('0x1f')]);}break;case _0x282a('0x63'):var _0x33a7b8=_0x4cb9fa[_0x282a('0x59')][_0x282a('0x30')](',')[_0x282a('0x2c')](function(_0x1dfff2){return Number(_0x1dfff2);});_0x33a7b8['forEach'](function(_0x25f6c4){_0x106718['or'](_0x282a('0x64'),'%,'+_0x25f6c4+',%');});_0x4e7a3f=_[_0x282a('0x65')](_0x4e7a3f,_0x33a7b8);break;case'User':if(_0x4cb9fa[_0x282a('0x66')]==='$substring'){_0x1c208d[_0x50354c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4cb9fa['value']+'%',null);}else{_0x42ac85=_[_0x282a('0x57')](_0x4f78c9,[_0x282a('0x2a'),_0x282a('0x67')]);_0x4cb9fa[_0x282a('0x42')]=_0x282a('0x67');_0x22636a=as[_0x282a('0x68')](_0x1b9064,_0x42ac85['type'],_0x4cb9fa);_0x1c208d[_0x50354c](_0x22636a['text'],_0x22636a[_0x282a('0x59')]['start'],_0x22636a[_0x282a('0x59')]['end']);}break;case _0x282a('0x69'):_0x22636a=as['buildExpression']('me',null,_0x4cb9fa);_0x1c208d[_0x50354c](_0x22636a[_0x282a('0x6a')],_0x22636a[_0x282a('0x59')]['start'],_0x22636a[_0x282a('0x59')]['end']);break;}}else{var _0x22636a=as['buildExpression'](_0x1b9064,_0x42ac85[_0x282a('0x35')],_0x4cb9fa);_0x1c208d[_0x50354c](_0x22636a[_0x282a('0x6a')],_0x22636a[_0x282a('0x59')][_0x282a('0x62')],_0x22636a[_0x282a('0x59')][_0x282a('0x1f')]);}}}else{var _0x1baf40=_(_0x5183cc[_0x282a('0x37')])[_0x282a('0x38')]()['map'](function(_0x448a4b){return _[_0x282a('0x6b')](_0x4f78c9,['name',_0x448a4b])?_0x448a4b:undefined;})[_0x282a('0x6c')]()['value']();if(!_[_0x282a('0x6d')](_0x1baf40)){_0x1baf40[_0x282a('0x6e')](function(_0x4b2e0b){if(_0x4b2e0b===_0x282a('0x6f')){_0x301479[_0x282a('0x70')](_0x282a('0x71'),[][_0x282a('0x72')](_0x5183cc[_0x282a('0x37')][_0x4b2e0b]));}else if(_0x4b2e0b===_0x282a('0x73')){var _0x681353=JSON[_0x282a('0x74')](_0x5183cc[_0x282a('0x37')][_0x4b2e0b])['$gte'];var _0x4aeb54=JSON[_0x282a('0x74')](_0x5183cc[_0x282a('0x37')][_0x4b2e0b])[_0x282a('0x75')];_0x301479[_0x282a('0x70')](_0x282a('0x76'),_0x681353,_0x4aeb54);}else{if(_0x5183cc['query'][_0x4b2e0b]===_0x282a('0x77')){_0x301479[_0x282a('0x70')]('i.'+_0x4b2e0b+_0x282a('0x78'));}else{_0x301479['where']('i.'+_0x4b2e0b+_0x282a('0x79'),_0x5183cc[_0x282a('0x37')][_0x4b2e0b]);}}});}if(_0x5183cc[_0x282a('0x37')][_0x282a('0x7a')]){if(_0x5183cc[_0x282a('0x37')]['read']==0x1){_0x301479['having']('`unreadMessages`\x20=\x200');}else{_0x301479['having'](_0x282a('0x7b'));}}if(_0x5183cc[_0x282a('0x37')][_0x282a('0x7c')]){_0x4e7a3f=_[_0x282a('0x7d')](_0x5183cc[_0x282a('0x37')][_0x282a('0x7c')])?_0x5183cc[_0x282a('0x37')][_0x282a('0x7c')]:new Array(_0x5183cc[_0x282a('0x37')]['tag']);_0x4e7a3f[_0x282a('0x6e')](function(_0x1e3906){_0x106718['or'](_0x282a('0x64'),'%,'+_0x1e3906+',%');});}if(_0x5183cc[_0x282a('0x37')][_0x282a('0x7e')]){var _0x5d85b0=_0x5183cc[_0x282a('0x37')][_0x282a('0x7e')][_0x282a('0x7f')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x282a('0x80'));if(qs[_0x282a('0x81')](_0x5d85b0)){_0x1c208d['or'](_0x282a('0x82'),_0x5d85b0+'%');}else{_0x1c208d['or'](_0x282a('0x83'),qs[_0x282a('0x5f')](_0x5d85b0))['or'](_0x282a('0x84'),_0x5d85b0+'%')['or'](_0x282a('0x85'),_0x5d85b0+'%');}}}_0x301479[_0x282a('0x70')](_0x1c208d);_0x301479[_0x282a('0x86')](_0x282a('0x87'));var _0x394a7c={'type':db[_0x282a('0x88')][_0x282a('0x89')][_0x282a('0x8a')],'raw':!![]};var _0x4ed00a=_0x301479[_0x282a('0x8b')]();_0x4ed00a[_0x282a('0x42')](_0x282a('0x87'));_0x4ed00a[_0x282a('0x42')](_0x282a('0x8c'),_0x282a('0x58'));if(_0x32a9b1[_0x282a('0x3d')]){_0x32a9b1['order'][_0x282a('0x6e')](function(_0x14c5d4){_0x301479[_0x282a('0x3d')]('i.'+_0x14c5d4[0x0],_0x14c5d4[0x1]===_0x282a('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x4e7a3f)){_0x301479['having'](_0x106718);_0x4ed00a[_0x282a('0x70')](_0x282a('0x8e'),_0x4e7a3f);}BPromise[_0x282a('0x8f')]()[_0x282a('0x27')](function(){if(!_0x48f794){if(_0x5183cc['query'][_0x282a('0x6f')]||_0x5183cc[_0x282a('0x37')][_0x282a('0x90')])return;_0x4ed00a[_0x282a('0x70')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x301479['where'](_0x282a('0x91'));return;}return _0x5183cc[_0x282a('0x92')][_0x282a('0x93')]({'attributes':['id'],'raw':!![]})[_0x282a('0x27')](function(_0x122adf){if(_['isEmpty'](_0x122adf)){_0x4ed00a['where'](_0x282a('0x94'));_0x301479[_0x282a('0x70')](_0x282a('0x94'));}else{_0x4ed00a[_0x282a('0x70')](_0x282a('0x71'),_[_0x282a('0x2c')](_0x122adf,'id'));_0x301479['where']('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x122adf,'id'));}});})[_0x282a('0x27')](function(){db[_0x282a('0x95')][_0x282a('0x37')](_0x4ed00a['toString'](),_0x394a7c)[_0x282a('0x27')](function(_0x2639ef){_0x193e17[_0x282a('0x21')]=_0x2639ef[_0x282a('0x56')];if(_0x193e17['count']===0x0)return[];return db[_0x282a('0x95')][_0x282a('0x37')](_0x2694d2['toString'](),_0x394a7c)['then'](function(_0x3386c5){_0x8c00c6=_[_0x282a('0x96')](_0x3386c5,'id');_0x394a7c=_[_0x282a('0x97')](_0x394a7c,{'model':db[_0x282a('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5183cc[_0x282a('0x37')][_0x282a('0x3b')]){_0x32a9b1['attributes'][_0x282a('0x6e')](function(_0x52bba7){_0x301479[_0x282a('0x42')]('i.'+_0x52bba7);});}else{_0x301479[_0x282a('0x42')](_0x282a('0x8c'),_0x282a('0x58'));_0x301479[_0x282a('0x42')](_0x282a('0x98'),_0x282a('0x99'));_0x301479[_0x282a('0x42')](_0x282a('0x9a'),_0x282a('0x9b'));_0x301479['field'](_0x282a('0x9c'));_0x301479[_0x282a('0x42')](_0x282a('0x9d'),'Contact.firstName');_0x301479[_0x282a('0x42')](_0x282a('0x9e'),_0x282a('0x9f'));_0x301479[_0x282a('0x42')](_0x282a('0xa0'),_0x282a('0xa1'));_0x301479['field'](_0x282a('0xa2'),'Contact.phone');_0x301479[_0x282a('0x42')](_0x282a('0xa3'),_0x282a('0xa4'));_0x301479[_0x282a('0x42')](_0x282a('0xa5'),'Contact.fax');_0x301479[_0x282a('0x42')]('o.fullname',_0x282a('0xa6'));_0x301479['field'](_0x282a('0xa7'),_0x282a('0xa8'));_0x301479[_0x282a('0x42')](_0x282a('0xa9'),_0x282a('0x2e'));}if(_0x32a9b1[_0x282a('0x23')])_0x301479[_0x282a('0x23')](_0x32a9b1[_0x282a('0x23')]);if(_0x32a9b1['offset'])_0x301479[_0x282a('0x22')](_0x32a9b1[_0x282a('0x22')]);return db[_0x282a('0x95')][_0x282a('0x37')](_0x301479[_0x282a('0xaa')](),_0x394a7c);})[_0x282a('0x27')](function(_0x130d4a){_0x25aa60[_0x282a('0x70')](_0x282a('0xab'),_['map'](_0x130d4a,'id'));return db[_0x282a('0x95')][_0x282a('0x37')](_0x25aa60[_0x282a('0xaa')](),_0x394a7c)[_0x282a('0x27')](function(_0x5b1340){var _0x84d87c=_[_0x282a('0xac')](_0x5b1340,_0x282a('0xad'));var _0x394725=[];_0x130d4a[_0x282a('0x6e')](function(_0x295ab6){_0x394725['push'](updateOpenchannelInteraction(_0x295ab6,_0x8c00c6,_0x84d87c));});return BPromise[_0x282a('0xae')](_0x394725);});});})[_0x282a('0x27')](function(_0x545b5b){_0x193e17[_0x282a('0xaf')]=_0x545b5b;return _0x193e17;})[_0x282a('0x27')](respondWithFilteredResult(_0x1a8cc4,_0x32a9b1));})[_0x282a('0x31')](handleError(_0x1a8cc4,null));};exports['show']=function(_0x243331,_0xb7860){var _0x18e0ec={'raw':![],'where':{'id':_0x243331['params']['id']}},_0x22ab8f={};_0x22ab8f[_0x282a('0x36')]=_[_0x282a('0x38')](db[_0x282a('0x33')][_0x282a('0x34')]);_0x22ab8f[_0x282a('0x37')]=_[_0x282a('0x38')](_0x243331['query']);_0x22ab8f['filters']=_[_0x282a('0x39')](_0x22ab8f[_0x282a('0x36')],_0x22ab8f[_0x282a('0x37')]);_0x18e0ec[_0x282a('0x3a')]=_[_0x282a('0x39')](_0x22ab8f[_0x282a('0x36')],qs[_0x282a('0x3b')](_0x243331[_0x282a('0x37')][_0x282a('0x3b')]));_0x18e0ec[_0x282a('0x3a')]=_0x18e0ec[_0x282a('0x3a')][_0x282a('0x56')]?_0x18e0ec['attributes']:_0x22ab8f[_0x282a('0x36')];if(_0x243331[_0x282a('0x37')]['includeAll']){_0x18e0ec[_0x282a('0xb0')]=[{'all':!![]}];}_0x18e0ec=_['merge']({},_0x18e0ec,_0x243331['options']);return db[_0x282a('0x33')][_0x282a('0x57')](_0x18e0ec)[_0x282a('0x27')](handleEntityNotFound(_0xb7860,null))['then'](respondWithResult(_0xb7860,null))['catch'](handleError(_0xb7860,null));};exports[_0x282a('0xb1')]=function(_0xb19d41,_0x3c908b){return db[_0x282a('0x33')]['create'](_0xb19d41[_0x282a('0x69')],{})['then'](respondWithResult(_0x3c908b,0xc9))['catch'](handleError(_0x3c908b,null));};exports[_0x282a('0xb2')]=function(_0x1baad7,_0x513178){if(_0x1baad7['body']['id']){delete _0x1baad7[_0x282a('0x69')]['id'];}return db[_0x282a('0x33')][_0x282a('0x57')]({'where':{'id':_0x1baad7[_0x282a('0xb3')]['id']}})[_0x282a('0x27')](handleEntityNotFound(_0x513178,null))[_0x282a('0x27')](saveUpdates(_0x1baad7[_0x282a('0x69')],null))[_0x282a('0x27')](respondWithResult(_0x513178,null))['catch'](handleError(_0x513178,null));};exports[_0x282a('0xb4')]=function(_0x1e0d88,_0x1e1559){return db[_0x282a('0x33')]['find']({'where':{'id':_0x1e0d88[_0x282a('0xb3')]['id']}})[_0x282a('0x27')](handleEntityNotFound(_0x1e1559,null))['then'](removeEntity(_0x1e1559,null))[_0x282a('0x31')](handleError(_0x1e1559,null));};exports['describe']=function(_0x491dd5,_0x10c6fc){return db['OpenchannelInteraction'][_0x282a('0xb5')]()[_0x282a('0x27')](respondWithResult(_0x10c6fc,null))[_0x282a('0x31')](handleError(_0x10c6fc,null));};exports[_0x282a('0xb6')]=function(_0x592224,_0x585747,_0x27d80d){return db[_0x282a('0xb7')][_0x282a('0x57')]({'where':{'id':_0x592224['params']['id']}})['then'](handleEntityNotFound(_0x585747,null))[_0x282a('0x27')](function(_0x44c586){if(_0x44c586){return _0x44c586[_0x282a('0xb6')](_0x592224[_0x282a('0x69')]['ids'],_[_0x282a('0xb8')](_0x592224[_0x282a('0x69')],['ids','id'])||{});}})[_0x282a('0x27')](respondWithResult(_0x585747,null))[_0x282a('0x31')](handleError(_0x585747,null));};exports[_0x282a('0xb9')]=function(_0x5abefa,_0x34a9ce,_0x578500){var _0x2fc054={'raw':![],'where':{}};var _0x168445={};var _0x1f18a2={'count':0x0,'rows':[]};return db[_0x282a('0x33')]['findOne']({'where':{'id':_0x5abefa['params']['id']}})[_0x282a('0x27')](handleEntityNotFound(_0x34a9ce,null))['then'](function(_0xd00f2b){if(_0xd00f2b){_0x168445[_0x282a('0x36')]=_[_0x282a('0x38')](db[_0x282a('0xb7')][_0x282a('0x34')]);_0x168445['query']=_[_0x282a('0x38')](_0x5abefa['query']);_0x168445[_0x282a('0x3f')]=_['intersection'](_0x168445[_0x282a('0x36')],_0x168445[_0x282a('0x37')]);_0x2fc054['attributes']=_[_0x282a('0x39')](_0x168445[_0x282a('0x36')],qs[_0x282a('0x3b')](_0x5abefa[_0x282a('0x37')]['fields']));_0x2fc054[_0x282a('0x3a')]=_0x2fc054[_0x282a('0x3a')]['length']?_0x2fc054[_0x282a('0x3a')]:_0x168445[_0x282a('0x36')];if(!_0x5abefa['query'][_0x282a('0xba')](_0x282a('0x3c'))){_0x2fc054[_0x282a('0x23')]=qs[_0x282a('0x23')](_0x5abefa['query']['limit']);_0x2fc054[_0x282a('0x22')]=qs[_0x282a('0x22')](_0x5abefa[_0x282a('0x37')][_0x282a('0x22')]);}_0x2fc054[_0x282a('0x3d')]=qs[_0x282a('0x3e')](_0x5abefa[_0x282a('0x37')]['sort']);_0x2fc054[_0x282a('0x70')]=qs['filters'](_[_0x282a('0x40')](_0x5abefa[_0x282a('0x37')],_0x168445[_0x282a('0x3f')]));_0x2fc054[_0x282a('0x70')][_0x282a('0xad')]=_0xd00f2b['id'];if(_0x5abefa[_0x282a('0x37')][_0x282a('0x7e')]){_0x2fc054[_0x282a('0x70')]=_['merge'](_0x2fc054[_0x282a('0x70')],{'$or':_[_0x282a('0x2c')](_0x2fc054['attributes'],function(_0x62083e){var _0x2b55e4={};_0x2b55e4[_0x62083e]={'$like':'%'+_0x5abefa[_0x282a('0x37')][_0x282a('0x7e')]+'%'};return _0x2b55e4;})});}if(_0x5abefa[_0x282a('0x37')][_0x282a('0xbb')]){var _0x48058a=_0x5abefa[_0x282a('0x37')][_0x282a('0xbb')][_0x282a('0x30')](',');var _0x2fec22={};_0x2fec22[_0x48058a[0x0]]={'$gte':moment(_0x48058a[0x1])[_0x282a('0xbc')](_0x282a('0xbd'))};_0x2fc054[_0x282a('0x70')]=_['merge'](_0x2fc054[_0x282a('0x70')],_0x2fec22);}_0x2fc054=_[_0x282a('0x97')]({},_0x2fc054,_0x5abefa[_0x282a('0xbe')]);return db[_0x282a('0xb7')]['count']({'where':_0x2fc054[_0x282a('0x70')]})[_0x282a('0x27')](function(_0x4506b2){_0x1f18a2[_0x282a('0x21')]=_0x4506b2;if(_0x5abefa[_0x282a('0x37')][_0x282a('0xbf')]){_0x2fc054[_0x282a('0xb0')]=[{'all':!![]}];}return db[_0x282a('0xb7')][_0x282a('0xc0')](_0x2fc054);})[_0x282a('0x27')](function(_0x2e32e6){_0x1f18a2[_0x282a('0xaf')]=_0x2e32e6;return _0x1f18a2;});}})[_0x282a('0x27')](respondWithFilteredResult(_0x34a9ce,_0x2fc054))[_0x282a('0x31')](handleError(_0x34a9ce,null));};exports[_0x282a('0xc1')]=function(_0x20329f,_0x37c7f3,_0x5b4c6b){return db[_0x282a('0x33')][_0x282a('0x57')]({'where':{'id':_0x20329f[_0x282a('0xb3')]['id']}})[_0x282a('0x27')](handleEntityNotFound(_0x37c7f3,null))[_0x282a('0x27')](function(_0x342757){if(_0x342757){return _0x342757[_0x282a('0xc2')](_0x20329f[_0x282a('0x69')]['ids'],_[_0x282a('0xb8')](_0x20329f['body'],[_0x282a('0xc3'),'id'])||{})[_0x282a('0xc4')](function(){return db[_0x282a('0x63')][_0x282a('0xc0')]({'attributes':['id','name',_0x282a('0x43')],'where':{'id':_0x20329f[_0x282a('0x69')][_0x282a('0xc3')]}});})[_0x282a('0x27')](function(_0x28eb10){socket[_0x282a('0xc5')]('openchannelInteractionTags:save',{'id':Number(_0x20329f[_0x282a('0xb3')]['id']),'tags':_0x28eb10||[]});return{'id':Number(_0x20329f[_0x282a('0xb3')]['id']),'tags':_0x28eb10||[]};});}})[_0x282a('0x27')](respondWithResult(_0x37c7f3,null))[_0x282a('0x31')](handleError(_0x37c7f3,null));};exports['removeTags']=function(_0x2af079,_0x102c36,_0x40ee7b){return db[_0x282a('0x33')][_0x282a('0x57')]({'where':{'id':_0x2af079[_0x282a('0xb3')]['id']}})['then'](handleEntityNotFound(_0x102c36,null))[_0x282a('0x27')](function(_0x381ac7){if(_0x381ac7){return _0x381ac7[_0x282a('0xc6')](_0x2af079[_0x282a('0x37')][_0x282a('0xc3')]);}})['then'](respondWithStatusCode(_0x102c36,null))[_0x282a('0x31')](handleError(_0x102c36,null));};exports['download']=function(_0x44c87f,_0x2da789){var _0x392a2e=moment()[_0x282a('0xc7')]()[_0x282a('0xaa')]();var _0x5bf316=path[_0x282a('0xc8')](config['root'],_0x282a('0xc9'),'files','tmp');var _0xf80cc1=path[_0x282a('0xc8')](config[_0x282a('0xca')],'server',_0x282a('0xcb'),_0x282a('0xcc'));var _0xd68563=path[_0x282a('0xc8')](_0x5bf316,_0x392a2e);var _0x1fd236=util[_0x282a('0xbc')](_0x282a('0xcd'),_0x44c87f['params']['id'],_0x392a2e);var _0x594d0e=path[_0x282a('0xc8')](_0x5bf316,_0x1fd236);var _0x3f592d=[];_0x3f592d[_0x282a('0xce')]({'model':db[_0x282a('0xcf')],'as':_0x282a('0xcf'),'attributes':['id','fullname'],'raw':!![]});_0x3f592d[_0x282a('0xce')]({'model':db[_0x282a('0xd0')],'as':_0x282a('0xd1'),'attributes':['id',_0x282a('0xd2'),'lastName'],'raw':!![]});if(_0x44c87f[_0x282a('0x37')][_0x282a('0xcc')]){_0x3f592d[_0x282a('0xce')]({'model':db[_0x282a('0xd3')],'as':_0x282a('0xd3'),'raw':!![]});}var _0x34b019=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id','body','createdAt',_0x282a('0xd4'),'secret',_0x282a('0x7a')],'include':_0x3f592d}];_0x34b019[_0x282a('0xce')]({'model':db[_0x282a('0xd5')],'as':_0x282a('0xd6'),'attributes':['id',_0x282a('0x2a')]});_0x34b019[_0x282a('0xce')]({'model':db[_0x282a('0xcf')],'as':_0x282a('0xd7'),'attributes':['id',_0x282a('0x2d')]});return db['OpenchannelInteraction'][_0x282a('0x57')]({'where':{'id':_0x44c87f[_0x282a('0xb3')]['id']},'include':_0x34b019})[_0x282a('0x27')](handleEntityNotFound(_0x2da789,null))['then'](function(_0x5bf750){if(_0x5bf750){var _0x5d872c=_0x5bf750[_0x282a('0xd8')]({'plain':!![]});fs[_0x282a('0xd9')](_0xd68563);var _0x21f7f8={'format':'A4','border':_0x282a('0xda'),'header':{'height':_0x282a('0xdb'),'contents':{'first':_0x282a('0xdc')}},'footer':{'height':'30px','contents':{'default':util['format'](_0x282a('0xdd'),util[_0x282a('0xbc')](_0x282a('0xde'),_0x282a('0xdf'),_0x5d872c['id']),moment()[_0x282a('0xbc')](_0x282a('0xe0'))[_0x282a('0xaa')]())}}};var _0x5e524e={'channel':_0x282a('0xdf'),'account':_0x5d872c['Account']['name'],'agent':_0x5d872c[_0x282a('0xd7')]?_0x5d872c[_0x282a('0xd7')][_0x282a('0x2d')]:_0x282a('0xe1'),'createdAt':moment(_0x5d872c[_0x282a('0x73')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x282a('0xaa')](),'closedAt':_0x5d872c[_0x282a('0xe2')]?moment(_0x5d872c[_0x282a('0xe3')])[_0x282a('0xbc')](_0x282a('0xbd'))['toString']():'','disposition':_0x5d872c['disposition'],'visibility':_0x5d872c[_0x282a('0xe4')]?'Public':_0x282a('0xe5'),'messages':_(_0x5d872c[_0x282a('0xe6')])['filter']({'secret':![]})[_0x282a('0x2c')](function(_0x2555f6){if(_0x2555f6['Attachment']){var _0x25050b=path[_0x282a('0xc8')](_0xf80cc1,_0x2555f6[_0x282a('0xd3')][_0x282a('0xe7')]);if(fs['existsSync'](_0x25050b)){fs[_0x282a('0xe8')](_0x25050b)[_0x282a('0xe9')](fs[_0x282a('0xea')](path[_0x282a('0xc8')](_0xd68563,_0x2555f6[_0x282a('0xd3')][_0x282a('0xe7')])));}}return{'date':moment(_0x2555f6['createdAt'])['format'](_0x282a('0xbd'))[_0x282a('0xaa')](),'sender':_0x2555f6['direction']===_0x282a('0xeb')?_0x2555f6['User']?_0x2555f6['User']['fullname']:'System':_0x2555f6[_0x282a('0xd1')]['firstName']+(_0x2555f6[_0x282a('0xd1')][_0x282a('0xec')]?'\x20'+_0x2555f6[_0x282a('0xd1')][_0x282a('0xec')]:''),'body':_0x2555f6[_0x282a('0xd3')]?_0x2555f6[_0x282a('0xd3')][_0x282a('0xe7')]:_0x2555f6[_0x282a('0x69')],'direction':_0x2555f6[_0x282a('0xd4')]===_0x282a('0xeb')?'A':'C','secret':_0x2555f6[_0x282a('0xed')],'read':_0x2555f6[_0x282a('0x7a')],'attachment':_0x2555f6[_0x282a('0xd3')]};})[_0x282a('0x59')]()};return ejs['renderFile'](path['join'](config[_0x282a('0xca')],'server',_0x282a('0xee'),_0x282a('0xef')),{'interaction':_0x5e524e})[_0x282a('0x27')](function(_0x2dcc48){return new BPromise(function(_0x5e619e,_0x1932df){pdf[_0x282a('0xb1')](_0x2dcc48,_0x21f7f8)[_0x282a('0xf0')](path['join'](_0xd68563,_0x282a('0xf1')+_0x5d872c['id']+'-'+_0x392a2e+_0x282a('0xf2')),function(_0x2acc19,_0x464e77){if(_0x2acc19)return _0x1932df(_0x2acc19);_0x5e619e(_0x464e77);});});})[_0x282a('0x27')](function(){return new BPromise(function(_0x65cabe,_0x4f5377){zipdir(_0xd68563,{'saveTo':_0x594d0e},function(_0x7163c,_0x46da41){if(_0x7163c)return _0x4f5377(_0x7163c);return _0x65cabe(_0x46da41);});})[_0x282a('0x27')](function(){return new BPromise(function(_0x12b075,_0x44b61e){rimraf(_0xd68563,function(_0x3c7064){if(_0x3c7064)_0x44b61e(_0x3c7064);return _0x12b075();});});})['then'](function(){return _0x2da789[_0x282a('0xf3')](_0x594d0e,_0x1fd236,function(_0x5571f1){if(_0x5571f1){console[_0x282a('0xf4')]('err',_0x5571f1);}else{fs[_0x282a('0xf5')](_0x594d0e);}});});});}else{return _0x2da789[_0x282a('0x1d')](0xc8);}})[_0x282a('0x31')](handleError(_0x2da789,null));}; \ No newline at end of file +var _0xfc2f=['\x20=\x20?','read','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','journey','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','count','sequelize','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','all','params','include','options','create','update','describe','addMessage','ids','omit','getMessages','findOne','OpenchannelMessage','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','setTags','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Owner','mkdirSync','10px','40px','\x0a\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\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Openchannel','Account','N.A.','closed','closedAt','disposition','Public','existsSync','createReadStream','pipe','out','System','firstName','lastName','basename','views','downloadInteraction.html','toFile','transcript-','download','log','eml-format','rimraf','zip-dir','request-promise','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','Users','fullname','Tags','split','forEach','TagIds','catch','index','map','OpenchannelInteraction','rawAttributes','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','limit','sort','where','pick','field','color','tools_tags','select','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','some','isEmpty','OpenchannelAccountId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL'];(function(_0x256f75,_0x3cf929){var _0x531104=function(_0x17f2b9){while(--_0x17f2b9){_0x256f75['push'](_0x256f75['shift']());}};_0x531104(++_0x3cf929);}(_0xfc2f,0x164));var _0xffc2=function(_0x45253c,_0x1aa2bb){_0x45253c=_0x45253c-0x0;var _0x473e06=_0xfc2f[_0x45253c];return _0x473e06;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xffc2('0x0'));var rimraf=require(_0xffc2('0x1'));var zipdir=require(_0xffc2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xffc2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xffc2('0x4'));var csv=require(_0xffc2('0x5'));var ejs=require(_0xffc2('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xffc2('0x7'));var crypto=require(_0xffc2('0x8'));var jsforce=require(_0xffc2('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xffc2('0xa'));var Redis=require(_0xffc2('0xb'));var authService=require(_0xffc2('0xc'));var qs=require(_0xffc2('0xd'));var as=require(_0xffc2('0xe'));var hardwareService=require(_0xffc2('0xf'));var logger=require('../../config/logger')(_0xffc2('0x10'));var utils=require(_0xffc2('0x11'));var config=require('../../config/environment');var db=require(_0xffc2('0x12'))['db'];config[_0xffc2('0x13')]=_[_0xffc2('0x14')](config['redis'],{'host':_0xffc2('0x15'),'port':0x18eb});var socket=require(_0xffc2('0x16'))(new Redis(config[_0xffc2('0x13')]));require(_0xffc2('0x17'))[_0xffc2('0x18')](socket);function respondWithStatusCode(_0x3c22b4,_0xd46315){_0xd46315=_0xd46315||0xcc;return function(_0x2f215b){if(_0x2f215b){return _0x3c22b4[_0xffc2('0x19')](_0xd46315);}return _0x3c22b4[_0xffc2('0x1a')](_0xd46315)[_0xffc2('0x1b')]();};}function respondWithResult(_0x133145,_0x5c63b2){_0x5c63b2=_0x5c63b2||0xc8;return function(_0x23ab7b){if(_0x23ab7b){return _0x133145[_0xffc2('0x1a')](_0x5c63b2)[_0xffc2('0x1c')](_0x23ab7b);}};}function respondWithFilteredResult(_0x1e4a97,_0xa16c87){return function(_0x57d558){if(_0x57d558){var _0x200c69=_0x57d558['count'],_0x451918=_0xa16c87['offset'],_0x5e0fa1=_0xa16c87[_0xffc2('0x1d')]+_0xa16c87['limit'],_0x230469;if(_0x5e0fa1>=_0x200c69){_0x5e0fa1=_0x200c69;_0x230469=0xc8;}else{_0x230469=0xce;}_0x1e4a97[_0xffc2('0x1a')](_0x230469);return _0x1e4a97['set'](_0xffc2('0x1e'),_0x451918+'-'+_0x5e0fa1+'/'+_0x200c69)[_0xffc2('0x1c')](_0x57d558);}return null;};}function patchUpdates(_0xb97ad5){return function(_0x2a8061){try{jsonpatch[_0xffc2('0x1f')](_0x2a8061,_0xb97ad5,!![]);}catch(_0x3a1ea7){return BPromise[_0xffc2('0x20')](_0x3a1ea7);}return _0x2a8061[_0xffc2('0x21')]();};}function saveUpdates(_0xff58f0,_0x30024e){return function(_0x2820d1){if(_0x2820d1){return _0x2820d1['update'](_0xff58f0)[_0xffc2('0x22')](function(_0x568b38){return _0x568b38;});}return null;};}function removeEntity(_0xc8b8a2,_0x4883df){return function(_0xdda656){if(_0xdda656){return _0xdda656[_0xffc2('0x23')]()[_0xffc2('0x22')](function(){_0xc8b8a2[_0xffc2('0x1a')](0xcc)[_0xffc2('0x1b')]();});}};}function handleEntityNotFound(_0x409a06,_0x57eae5){return function(_0x548966){if(!_0x548966){_0x409a06[_0xffc2('0x19')](0x194);}return _0x548966;};}function handleError(_0x5979c6,_0x23014e){_0x23014e=_0x23014e||0x1f4;return function(_0x146bf4){logger[_0xffc2('0x24')](_0x146bf4[_0xffc2('0x25')]);if(_0x146bf4[_0xffc2('0x26')]){delete _0x146bf4[_0xffc2('0x26')];}_0x5979c6[_0xffc2('0x1a')](_0x23014e)[_0xffc2('0x27')](_0x146bf4);};}function getInteractionUsers(_0x538f55,_0xfdbc45){return new BPromise(function(_0xc1d52c,_0x36759e){try{if(_0xfdbc45[_0x538f55['id']]){_0x538f55[_0xffc2('0x28')]=_['map'](_0xfdbc45[_0x538f55['id']],function(_0x255866){return{'id':_0x255866['id'],'fullname':_0x255866[_0xffc2('0x29')]};});}}catch(_0xcfa3b8){_0x36759e(_0xcfa3b8);}_0xc1d52c(_0x538f55);});}function getInteractionTags(_0x5b02f3,_0x43ef27){return new BPromise(function(_0x55ec2b,_0x235630){try{if(_0x5b02f3['TagIds']){_0x5b02f3[_0xffc2('0x2a')]=[];_0x5b02f3['TagIds'][_0xffc2('0x2b')](',')[_0xffc2('0x2c')](function(_0x5dbca7){_0x5b02f3['Tags']['push'](_0x43ef27[_0x5dbca7]);});}delete _0x5b02f3[_0xffc2('0x2d')];}catch(_0x408d3f){_0x235630(_0x408d3f);}_0x55ec2b(_0x5b02f3);});}function updateOpenchannelInteraction(_0x43d107,_0x1bb511,_0x18f6fa){return new BPromise(function(_0x258a4f,_0x19d9c8){return getInteractionUsers(_0x43d107,_0x18f6fa)[_0xffc2('0x22')](function(_0x2773f7){return getInteractionTags(_0x2773f7,_0x1bb511);})[_0xffc2('0x22')](function(_0x37b652){_0x258a4f(_0x37b652);})[_0xffc2('0x2e')](function(_0x377d98){_0x19d9c8(_0x377d98);});});}exports[_0xffc2('0x2f')]=function(_0x241913,_0x917a91){var _0x510ae3={},_0xf31d6d={},_0x2d588e={'count':0x0,'rows':[]};var _0x4b8419=_[_0xffc2('0x30')](db[_0xffc2('0x31')][_0xffc2('0x32')],function(_0x11f6db){return{'name':_0x11f6db['fieldName'],'type':_0x11f6db[_0xffc2('0x33')][_0xffc2('0x34')]};});_0xf31d6d[_0xffc2('0x35')]=_[_0xffc2('0x30')](_0x4b8419,_0xffc2('0x26'));_0xf31d6d['query']=_[_0xffc2('0x36')](_0x241913['query']);_0xf31d6d[_0xffc2('0x37')]=_[_0xffc2('0x38')](_0xf31d6d[_0xffc2('0x35')],_0xf31d6d['query']);_0x510ae3[_0xffc2('0x39')]=_['intersection'](_0xf31d6d['model'],qs[_0xffc2('0x3a')](_0x241913[_0xffc2('0x3b')][_0xffc2('0x3a')]));_0x510ae3[_0xffc2('0x39')]=_0x510ae3[_0xffc2('0x39')][_0xffc2('0x3c')]?_0x510ae3['attributes']:_0xf31d6d[_0xffc2('0x35')];if(!_0x241913['query'][_0xffc2('0x3d')](_0xffc2('0x3e'))){_0x510ae3[_0xffc2('0x3f')]=qs['limit'](_0x241913[_0xffc2('0x3b')][_0xffc2('0x3f')]);_0x510ae3[_0xffc2('0x1d')]=qs['offset'](_0x241913[_0xffc2('0x3b')]['offset']);}_0x510ae3['order']=qs[_0xffc2('0x40')](_0x241913[_0xffc2('0x3b')]['sort']);_0x510ae3[_0xffc2('0x41')]=qs[_0xffc2('0x37')](_[_0xffc2('0x42')](_0x241913[_0xffc2('0x3b')],_0xf31d6d[_0xffc2('0x37')]),_0x4b8419);var _0x4a41f2=[];var _0x5e4d1f=squel['select']()[_0xffc2('0x43')]('id')[_0xffc2('0x43')]('name')[_0xffc2('0x43')](_0xffc2('0x44'))['from'](_0xffc2('0x45'));var _0x12a842=squel[_0xffc2('0x46')]()[_0xffc2('0x43')](_0xffc2('0x47'))[_0xffc2('0x43')](_0xffc2('0x48'))[_0xffc2('0x43')](_0xffc2('0x49'))[_0xffc2('0x4a')](_0xffc2('0x4b'),'ui')[_0xffc2('0x4c')](_0xffc2('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x2d711d=squel[_0xffc2('0x46')]()['from'](_0xffc2('0x4e'),'i')[_0xffc2('0x4c')](_0xffc2('0x4f'),'c',_0xffc2('0x50'))[_0xffc2('0x4c')](_0xffc2('0x4d'),'o',_0xffc2('0x51'))[_0xffc2('0x4c')]('openchannel_accounts','a',_0xffc2('0x52'))[_0xffc2('0x4c')](_0xffc2('0x53'),'me',_0xffc2('0x54'))[_0xffc2('0x4c')](_0xffc2('0x55'),'it',_0xffc2('0x56'))[_0xffc2('0x4c')](_0xffc2('0x45'),'t',_0xffc2('0x57'));var _0x252436=squel[_0xffc2('0x58')]();var _0x59b400=[];var _0x2e027f=squel['expr']();var _0x4713fa;if(_0x241913[_0xffc2('0x3b')][_0xffc2('0x59')]){_0x4713fa=as[_0xffc2('0x5a')](_0x241913[_0xffc2('0x3b')][_0xffc2('0x59')]);var _0x2174a0=_0x4713fa[_0xffc2('0x5b')];for(var _0x459da0=0x0;_0x459da0<_0x4713fa['conditions'][_0xffc2('0x3c')];_0x459da0++){var _0x4f0830=_0x4713fa[_0xffc2('0x5c')][_0x459da0];var _0x449b6d='i';var _0xd7b0b7=_[_0xffc2('0x5d')](_0x4b8419,['name',_0x4f0830['field']]);if(!_0xd7b0b7){switch(_0x4f0830[_0xffc2('0x43')]){case _0xffc2('0x5e'):if(_0x4f0830['value']==0x1){_0x2d711d[_0xffc2('0x5f')]('`'+_0x4f0830[_0xffc2('0x43')]+_0xffc2('0x60'));}else{_0x2d711d['having']('`'+_0x4f0830[_0xffc2('0x43')]+_0xffc2('0x61'));}break;case _0xffc2('0x62'):if(_0x4f0830[_0xffc2('0x63')]===_0xffc2('0x64')){if(_0x4f0830[_0xffc2('0x65')]['split']('\x20')[_0xffc2('0x3c')]>0x1){_0x252436[_0x2174a0]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4f0830[_0xffc2('0x65')]),null);}else{var _0x560e15='%'+_0x4f0830[_0xffc2('0x65')]+'%';_0x252436[_0x2174a0]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x560e15,_0x560e15,_0x560e15);}}else{_0xd7b0b7=_[_0xffc2('0x5d')](_0x4b8419,[_0xffc2('0x26'),_0xffc2('0x66')]);_0x4f0830[_0xffc2('0x43')]=_0xffc2('0x66');_0x5e6005=as['buildExpression'](_0x449b6d,_0xd7b0b7[_0xffc2('0x33')],_0x4f0830);_0x252436[_0x2174a0](_0x5e6005[_0xffc2('0x67')],_0x5e6005[_0xffc2('0x65')][_0xffc2('0x68')],_0x5e6005['value'][_0xffc2('0x1b')]);}break;case _0xffc2('0x69'):var _0x12a7c3=_0x4f0830[_0xffc2('0x65')]['split'](',')['map'](function(_0x4c0f9f){return Number(_0x4c0f9f);});_0x12a7c3[_0xffc2('0x2c')](function(_0x5332de){_0x2e027f['or'](_0xffc2('0x6a'),'%,'+_0x5332de+',%');});_0x59b400=_['union'](_0x59b400,_0x12a7c3);break;case _0xffc2('0x6b'):if(_0x4f0830[_0xffc2('0x63')]===_0xffc2('0x64')){_0x252436[_0x2174a0](_0xffc2('0x6c'),'%'+_0x4f0830['value']+'%',null);}else{_0xd7b0b7=_[_0xffc2('0x5d')](_0x4b8419,[_0xffc2('0x26'),_0xffc2('0x6d')]);_0x4f0830[_0xffc2('0x43')]=_0xffc2('0x6d');_0x5e6005=as[_0xffc2('0x6e')](_0x449b6d,_0xd7b0b7[_0xffc2('0x33')],_0x4f0830);_0x252436[_0x2174a0](_0x5e6005[_0xffc2('0x67')],_0x5e6005[_0xffc2('0x65')][_0xffc2('0x68')],_0x5e6005['value'][_0xffc2('0x1b')]);}break;case _0xffc2('0x6f'):_0x5e6005=as[_0xffc2('0x6e')]('me',null,_0x4f0830);_0x252436[_0x2174a0](_0x5e6005['text'],_0x5e6005[_0xffc2('0x65')][_0xffc2('0x68')],_0x5e6005[_0xffc2('0x65')][_0xffc2('0x1b')]);break;}}else{var _0x5e6005=as[_0xffc2('0x6e')](_0x449b6d,_0xd7b0b7['type'],_0x4f0830);_0x252436[_0x2174a0](_0x5e6005['text'],_0x5e6005[_0xffc2('0x65')][_0xffc2('0x68')],_0x5e6005[_0xffc2('0x65')][_0xffc2('0x1b')]);}}}else{var _0xca8d0d=_(_0x241913['query'])['keys']()['map'](function(_0x1a9a77){return _[_0xffc2('0x70')](_0x4b8419,[_0xffc2('0x26'),_0x1a9a77])?_0x1a9a77:undefined;})['compact']()['value']();if(!_[_0xffc2('0x71')](_0xca8d0d)){_0xca8d0d[_0xffc2('0x2c')](function(_0x148f15){if(_0x148f15===_0xffc2('0x72')){_0x2d711d[_0xffc2('0x41')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xffc2('0x73')](_0x241913[_0xffc2('0x3b')][_0x148f15]));}else if(_0x148f15==='createdAt'){var _0x57d7b6=JSON[_0xffc2('0x74')](_0x241913[_0xffc2('0x3b')][_0x148f15])[_0xffc2('0x75')];var _0x29392e=JSON[_0xffc2('0x74')](_0x241913['query'][_0x148f15])[_0xffc2('0x76')];_0x2d711d[_0xffc2('0x41')](_0xffc2('0x77'),_0x57d7b6,_0x29392e);}else{if(_0x241913['query'][_0x148f15]===_0xffc2('0x78')){_0x2d711d[_0xffc2('0x41')]('i.'+_0x148f15+_0xffc2('0x79'));}else{_0x2d711d[_0xffc2('0x41')]('i.'+_0x148f15+_0xffc2('0x7a'),_0x241913[_0xffc2('0x3b')][_0x148f15]);}}});}if(_0x241913['query'][_0xffc2('0x7b')]){if(_0x241913['query']['read']==0x1){_0x2d711d[_0xffc2('0x5f')]('`unreadMessages`\x20=\x200');}else{_0x2d711d['having']('`unreadMessages`\x20>\x200');}}if(_0x241913[_0xffc2('0x3b')]['tag']){_0x59b400=_[_0xffc2('0x7c')](_0x241913[_0xffc2('0x3b')]['tag'])?_0x241913['query'][_0xffc2('0x7d')]:new Array(_0x241913[_0xffc2('0x3b')][_0xffc2('0x7d')]);_0x59b400[_0xffc2('0x2c')](function(_0x1b82de){_0x2e027f['or'](_0xffc2('0x6a'),'%,'+_0x1b82de+',%');});}if(_0x241913[_0xffc2('0x3b')][_0xffc2('0x7e')]){var _0x2ea77d=_0x241913[_0xffc2('0x3b')][_0xffc2('0x7e')]['replace']('\x5c','\x5c\x5c')[_0xffc2('0x7f')]('\x27\x27',_0xffc2('0x80'));if(qs[_0xffc2('0x81')](_0x2ea77d)){_0x252436['or'](_0xffc2('0x82'),_0x2ea77d+'%');}else{_0x252436['or'](_0xffc2('0x83'),qs[_0xffc2('0x84')](_0x2ea77d))['or'](_0xffc2('0x85'),_0x2ea77d+'%')['or'](_0xffc2('0x86'),_0x2ea77d+'%');}}}_0x2d711d[_0xffc2('0x41')](_0x252436);_0x2d711d['group']('i.id');var _0x33cb8f={'type':db[_0xffc2('0x87')][_0xffc2('0x88')][_0xffc2('0x89')],'raw':!![]};var _0x16eae6=_0x2d711d[_0xffc2('0x8a')]();_0x16eae6['field'](_0xffc2('0x8b'));_0x16eae6[_0xffc2('0x43')](_0xffc2('0x8c'),_0xffc2('0x5e'));if(_0x510ae3[_0xffc2('0x8d')]){_0x510ae3['order'][_0xffc2('0x2c')](function(_0x50090f){_0x2d711d[_0xffc2('0x8d')]('i.'+_0x50090f[0x0],_0x50090f[0x1]===_0xffc2('0x8e')?![]:!![]);});}if(!_[_0xffc2('0x71')](_0x59b400)){_0x2d711d[_0xffc2('0x5f')](_0x2e027f);_0x16eae6[_0xffc2('0x41')]('t.id\x20IN\x20?',_0x59b400);}BPromise['resolve']()[_0xffc2('0x22')](function(){if(!_0x4713fa){if(_0x241913['query'][_0xffc2('0x72')]||_0x241913['query'][_0xffc2('0x8f')])return;_0x16eae6[_0xffc2('0x41')](_0xffc2('0x90'));_0x2d711d['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}return _0x241913['user'][_0xffc2('0x91')]({'attributes':['id'],'raw':!![]})[_0xffc2('0x22')](function(_0x243566){if(_[_0xffc2('0x71')](_0x243566)){_0x16eae6['where'](_0xffc2('0x92'));_0x2d711d['where'](_0xffc2('0x92'));}else{_0x16eae6[_0xffc2('0x41')](_0xffc2('0x93'),_[_0xffc2('0x30')](_0x243566,'id'));_0x2d711d[_0xffc2('0x41')](_0xffc2('0x93'),_[_0xffc2('0x30')](_0x243566,'id'));}});})[_0xffc2('0x22')](function(){db['sequelize']['query'](_0x16eae6[_0xffc2('0x94')](),_0x33cb8f)[_0xffc2('0x22')](function(_0x1694c9){_0x2d588e[_0xffc2('0x95')]=_0x1694c9[_0xffc2('0x3c')];if(_0x2d588e[_0xffc2('0x95')]===0x0)return[];return db[_0xffc2('0x96')][_0xffc2('0x3b')](_0x5e4d1f[_0xffc2('0x94')](),_0x33cb8f)[_0xffc2('0x22')](function(_0x42e1ed){_0x4a41f2=_['keyBy'](_0x42e1ed,'id');_0x33cb8f=_[_0xffc2('0x97')](_0x33cb8f,{'model':db[_0xffc2('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x241913['query']['fields']){_0x510ae3[_0xffc2('0x39')][_0xffc2('0x2c')](function(_0x326bd3){_0x2d711d['field']('i.'+_0x326bd3);});}else{_0x2d711d[_0xffc2('0x43')](_0xffc2('0x8c'),_0xffc2('0x5e'));_0x2d711d[_0xffc2('0x43')](_0xffc2('0x98'),_0xffc2('0x99'));_0x2d711d[_0xffc2('0x43')](_0xffc2('0x9a'),_0xffc2('0x9b'));_0x2d711d['field'](_0xffc2('0x9c'));_0x2d711d[_0xffc2('0x43')](_0xffc2('0x9d'),_0xffc2('0x9e'));_0x2d711d['field'](_0xffc2('0x9f'),'Contact.lastName');_0x2d711d[_0xffc2('0x43')](_0xffc2('0xa0'),_0xffc2('0xa1'));_0x2d711d[_0xffc2('0x43')]('c.phone',_0xffc2('0xa2'));_0x2d711d[_0xffc2('0x43')](_0xffc2('0xa3'),_0xffc2('0xa4'));_0x2d711d[_0xffc2('0x43')](_0xffc2('0xa5'),_0xffc2('0xa6'));_0x2d711d['field'](_0xffc2('0xa7'),'Owner.fullname');_0x2d711d['field'](_0xffc2('0xa8'),_0xffc2('0xa9'));_0x2d711d[_0xffc2('0x43')](_0xffc2('0xaa'),_0xffc2('0x2d'));}if(_0x510ae3[_0xffc2('0x3f')])_0x2d711d[_0xffc2('0x3f')](_0x510ae3[_0xffc2('0x3f')]);if(_0x510ae3['offset'])_0x2d711d['offset'](_0x510ae3[_0xffc2('0x1d')]);return db[_0xffc2('0x96')][_0xffc2('0x3b')](_0x2d711d[_0xffc2('0x94')](),_0x33cb8f);})[_0xffc2('0x22')](function(_0x5c995f){_0x12a842[_0xffc2('0x41')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xffc2('0x30')](_0x5c995f,'id'));return db[_0xffc2('0x96')][_0xffc2('0x3b')](_0x12a842[_0xffc2('0x94')](),_0x33cb8f)['then'](function(_0x4daecb){var _0xab7673=_[_0xffc2('0xab')](_0x4daecb,'OpenchannelInteractionId');var _0x57366a=[];_0x5c995f['forEach'](function(_0x111ad4){_0x57366a[_0xffc2('0xac')](updateOpenchannelInteraction(_0x111ad4,_0x4a41f2,_0xab7673));});return BPromise[_0xffc2('0xad')](_0x57366a);});});})[_0xffc2('0x22')](function(_0x445a7d){_0x2d588e['rows']=_0x445a7d;return _0x2d588e;})[_0xffc2('0x22')](respondWithFilteredResult(_0x917a91,_0x510ae3));})['catch'](handleError(_0x917a91,null));};exports['show']=function(_0x5d4635,_0x223806){var _0x440aba={'raw':![],'where':{'id':_0x5d4635[_0xffc2('0xae')]['id']}},_0x2e4932={};_0x2e4932[_0xffc2('0x35')]=_[_0xffc2('0x36')](db[_0xffc2('0x31')]['rawAttributes']);_0x2e4932[_0xffc2('0x3b')]=_['keys'](_0x5d4635[_0xffc2('0x3b')]);_0x2e4932[_0xffc2('0x37')]=_['intersection'](_0x2e4932['model'],_0x2e4932['query']);_0x440aba[_0xffc2('0x39')]=_[_0xffc2('0x38')](_0x2e4932[_0xffc2('0x35')],qs['fields'](_0x5d4635[_0xffc2('0x3b')][_0xffc2('0x3a')]));_0x440aba[_0xffc2('0x39')]=_0x440aba[_0xffc2('0x39')][_0xffc2('0x3c')]?_0x440aba[_0xffc2('0x39')]:_0x2e4932[_0xffc2('0x35')];if(_0x5d4635[_0xffc2('0x3b')]['includeAll']){_0x440aba[_0xffc2('0xaf')]=[{'all':!![]}];}_0x440aba=_[_0xffc2('0x97')]({},_0x440aba,_0x5d4635[_0xffc2('0xb0')]);return db[_0xffc2('0x31')][_0xffc2('0x5d')](_0x440aba)[_0xffc2('0x22')](handleEntityNotFound(_0x223806,null))[_0xffc2('0x22')](respondWithResult(_0x223806,null))[_0xffc2('0x2e')](handleError(_0x223806,null));};exports[_0xffc2('0xb1')]=function(_0x5568c3,_0x2f335b){return db['OpenchannelInteraction'][_0xffc2('0xb1')](_0x5568c3[_0xffc2('0x6f')],{})['then'](respondWithResult(_0x2f335b,0xc9))['catch'](handleError(_0x2f335b,null));};exports[_0xffc2('0xb2')]=function(_0x3bb47f,_0x54a80c){if(_0x3bb47f[_0xffc2('0x6f')]['id']){delete _0x3bb47f[_0xffc2('0x6f')]['id'];}return db[_0xffc2('0x31')][_0xffc2('0x5d')]({'where':{'id':_0x3bb47f[_0xffc2('0xae')]['id']}})[_0xffc2('0x22')](handleEntityNotFound(_0x54a80c,null))[_0xffc2('0x22')](saveUpdates(_0x3bb47f['body'],null))[_0xffc2('0x22')](respondWithResult(_0x54a80c,null))[_0xffc2('0x2e')](handleError(_0x54a80c,null));};exports['destroy']=function(_0x21e75a,_0x192bc9){return db['OpenchannelInteraction'][_0xffc2('0x5d')]({'where':{'id':_0x21e75a[_0xffc2('0xae')]['id']}})[_0xffc2('0x22')](handleEntityNotFound(_0x192bc9,null))[_0xffc2('0x22')](removeEntity(_0x192bc9,null))[_0xffc2('0x2e')](handleError(_0x192bc9,null));};exports[_0xffc2('0xb3')]=function(_0x1f1021,_0x47df06){return db[_0xffc2('0x31')][_0xffc2('0xb3')]()[_0xffc2('0x22')](respondWithResult(_0x47df06,null))[_0xffc2('0x2e')](handleError(_0x47df06,null));};exports[_0xffc2('0xb4')]=function(_0x3c7a9d,_0x364a79,_0x31d178){return db['OpenchannelMessage'][_0xffc2('0x5d')]({'where':{'id':_0x3c7a9d[_0xffc2('0xae')]['id']}})[_0xffc2('0x22')](handleEntityNotFound(_0x364a79,null))[_0xffc2('0x22')](function(_0x7a0e75){if(_0x7a0e75){return _0x7a0e75[_0xffc2('0xb4')](_0x3c7a9d[_0xffc2('0x6f')][_0xffc2('0xb5')],_[_0xffc2('0xb6')](_0x3c7a9d[_0xffc2('0x6f')],[_0xffc2('0xb5'),'id'])||{});}})['then'](respondWithResult(_0x364a79,null))['catch'](handleError(_0x364a79,null));};exports[_0xffc2('0xb7')]=function(_0x4056e8,_0x583544,_0x4fb1d4){var _0x5f9bf1={'raw':![],'where':{}};var _0x2829a4={};var _0x3e8ce8={'count':0x0,'rows':[]};return db[_0xffc2('0x31')][_0xffc2('0xb8')]({'where':{'id':_0x4056e8[_0xffc2('0xae')]['id']}})[_0xffc2('0x22')](handleEntityNotFound(_0x583544,null))[_0xffc2('0x22')](function(_0x3843d7){if(_0x3843d7){_0x2829a4[_0xffc2('0x35')]=_['keys'](db[_0xffc2('0xb9')][_0xffc2('0x32')]);_0x2829a4[_0xffc2('0x3b')]=_[_0xffc2('0x36')](_0x4056e8[_0xffc2('0x3b')]);_0x2829a4[_0xffc2('0x37')]=_['intersection'](_0x2829a4['model'],_0x2829a4[_0xffc2('0x3b')]);_0x5f9bf1[_0xffc2('0x39')]=_[_0xffc2('0x38')](_0x2829a4[_0xffc2('0x35')],qs['fields'](_0x4056e8[_0xffc2('0x3b')][_0xffc2('0x3a')]));_0x5f9bf1[_0xffc2('0x39')]=_0x5f9bf1[_0xffc2('0x39')][_0xffc2('0x3c')]?_0x5f9bf1[_0xffc2('0x39')]:_0x2829a4[_0xffc2('0x35')];if(!_0x4056e8[_0xffc2('0x3b')][_0xffc2('0x3d')](_0xffc2('0x3e'))){_0x5f9bf1[_0xffc2('0x3f')]=qs[_0xffc2('0x3f')](_0x4056e8['query'][_0xffc2('0x3f')]);_0x5f9bf1['offset']=qs[_0xffc2('0x1d')](_0x4056e8[_0xffc2('0x3b')]['offset']);}_0x5f9bf1[_0xffc2('0x8d')]=qs[_0xffc2('0x40')](_0x4056e8[_0xffc2('0x3b')][_0xffc2('0x40')]);_0x5f9bf1[_0xffc2('0x41')]=qs[_0xffc2('0x37')](_[_0xffc2('0x42')](_0x4056e8[_0xffc2('0x3b')],_0x2829a4[_0xffc2('0x37')]));_0x5f9bf1[_0xffc2('0x41')][_0xffc2('0xba')]=_0x3843d7['id'];if(_0x4056e8[_0xffc2('0x3b')][_0xffc2('0x7e')]){_0x5f9bf1[_0xffc2('0x41')]=_[_0xffc2('0x97')](_0x5f9bf1[_0xffc2('0x41')],{'$or':_[_0xffc2('0x30')](_0x5f9bf1[_0xffc2('0x39')],function(_0x18b454){var _0x51823d={};_0x51823d[_0x18b454]={'$like':'%'+_0x4056e8[_0xffc2('0x3b')][_0xffc2('0x7e')]+'%'};return _0x51823d;})});}if(_0x4056e8['query']['$gte']){var _0x2145c3=_0x4056e8['query'][_0xffc2('0x75')][_0xffc2('0x2b')](',');var _0x344a97={};_0x344a97[_0x2145c3[0x0]]={'$gte':moment(_0x2145c3[0x1])[_0xffc2('0xbb')](_0xffc2('0xbc'))};_0x5f9bf1[_0xffc2('0x41')]=_['merge'](_0x5f9bf1[_0xffc2('0x41')],_0x344a97);}_0x5f9bf1=_[_0xffc2('0x97')]({},_0x5f9bf1,_0x4056e8[_0xffc2('0xb0')]);return db[_0xffc2('0xb9')]['count']({'where':_0x5f9bf1['where']})[_0xffc2('0x22')](function(_0x12027d){_0x3e8ce8[_0xffc2('0x95')]=_0x12027d;if(_0x4056e8[_0xffc2('0x3b')][_0xffc2('0xbd')]){_0x5f9bf1[_0xffc2('0xaf')]=[{'all':!![]}];}return db[_0xffc2('0xb9')][_0xffc2('0xbe')](_0x5f9bf1);})[_0xffc2('0x22')](function(_0x1a65c8){_0x3e8ce8[_0xffc2('0xbf')]=_0x1a65c8;return _0x3e8ce8;});}})[_0xffc2('0x22')](respondWithFilteredResult(_0x583544,_0x5f9bf1))[_0xffc2('0x2e')](handleError(_0x583544,null));};exports['addTags']=function(_0x47e743,_0x5cb45f,_0x370918){return db['OpenchannelInteraction'][_0xffc2('0x5d')]({'where':{'id':_0x47e743[_0xffc2('0xae')]['id']}})[_0xffc2('0x22')](handleEntityNotFound(_0x5cb45f,null))['then'](function(_0x1d777f){if(_0x1d777f){return _0x1d777f[_0xffc2('0xc0')](_0x47e743[_0xffc2('0x6f')][_0xffc2('0xb5')],_[_0xffc2('0xb6')](_0x47e743[_0xffc2('0x6f')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0xffc2('0xbe')]({'attributes':['id','name','color'],'where':{'id':_0x47e743[_0xffc2('0x6f')][_0xffc2('0xb5')]}});})['then'](function(_0x5b1228){socket[_0xffc2('0xc1')](_0xffc2('0xc2'),{'id':Number(_0x47e743[_0xffc2('0xae')]['id']),'tags':_0x5b1228||[]});return{'id':Number(_0x47e743['params']['id']),'tags':_0x5b1228||[]};});}})[_0xffc2('0x22')](respondWithResult(_0x5cb45f,null))[_0xffc2('0x2e')](handleError(_0x5cb45f,null));};exports[_0xffc2('0xc3')]=function(_0x26c11a,_0x1bd4bb,_0x519758){return db[_0xffc2('0x31')]['find']({'where':{'id':_0x26c11a[_0xffc2('0xae')]['id']}})[_0xffc2('0x22')](handleEntityNotFound(_0x1bd4bb,null))[_0xffc2('0x22')](function(_0x2b6bd5){if(_0x2b6bd5){return _0x2b6bd5['removeTags'](_0x26c11a[_0xffc2('0x3b')][_0xffc2('0xb5')]);}})[_0xffc2('0x22')](respondWithStatusCode(_0x1bd4bb,null))['catch'](handleError(_0x1bd4bb,null));};exports['download']=function(_0x510ce6,_0x38e88a){var _0x59a742=moment()[_0xffc2('0xc4')]()['toString']();var _0x51a5d9=path[_0xffc2('0xc5')](config[_0xffc2('0xc6')],_0xffc2('0xc7'),_0xffc2('0xc8'),_0xffc2('0xc9'));var _0xfc8082=path[_0xffc2('0xc5')](config['root'],_0xffc2('0xc7'),_0xffc2('0xc8'),_0xffc2('0xca'));var _0x2291a6=path[_0xffc2('0xc5')](_0x51a5d9,_0x59a742);var _0x2ec97b=util['format'](_0xffc2('0xcb'),_0x510ce6[_0xffc2('0xae')]['id'],_0x59a742);var _0x3fe70e=path[_0xffc2('0xc5')](_0x51a5d9,_0x2ec97b);var _0x272842=[];_0x272842[_0xffc2('0xac')]({'model':db['User'],'as':_0xffc2('0x6b'),'attributes':['id',_0xffc2('0x29')],'raw':!![]});_0x272842[_0xffc2('0xac')]({'model':db[_0xffc2('0xcc')],'as':_0xffc2('0x62'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0x510ce6[_0xffc2('0x3b')][_0xffc2('0xca')]){_0x272842['push']({'model':db[_0xffc2('0xcd')],'as':_0xffc2('0xcd'),'raw':!![]});}var _0x90712a=[{'model':db[_0xffc2('0xb9')],'as':_0xffc2('0xce'),'attributes':['id','body',_0xffc2('0xcf'),_0xffc2('0xd0'),_0xffc2('0xd1'),_0xffc2('0x7b')],'include':_0x272842}];_0x90712a['push']({'model':db[_0xffc2('0xd2')],'as':'Account','attributes':['id','name']});_0x90712a['push']({'model':db['User'],'as':_0xffc2('0xd3'),'attributes':['id','fullname']});return db[_0xffc2('0x31')][_0xffc2('0x5d')]({'where':{'id':_0x510ce6['params']['id']},'include':_0x90712a})[_0xffc2('0x22')](handleEntityNotFound(_0x38e88a,null))[_0xffc2('0x22')](function(_0x12c1a1){if(_0x12c1a1){var _0xd81d29=_0x12c1a1['get']({'plain':!![]});fs[_0xffc2('0xd4')](_0x2291a6);var _0x553c53={'format':'A4','border':_0xffc2('0xd5'),'header':{'height':_0xffc2('0xd6'),'contents':{'first':_0xffc2('0xd7')}},'footer':{'height':'30px','contents':{'default':util[_0xffc2('0xbb')](_0xffc2('0xd8'),util[_0xffc2('0xbb')](_0xffc2('0xd9'),_0xffc2('0xda'),_0xd81d29['id']),moment()[_0xffc2('0xbb')]('YYYY-MM-DD')[_0xffc2('0x94')]())}}};var _0x10fc62={'channel':'Openchannel','account':_0xd81d29[_0xffc2('0xdb')][_0xffc2('0x26')],'agent':_0xd81d29[_0xffc2('0xd3')]?_0xd81d29['Owner']['fullname']:_0xffc2('0xdc'),'createdAt':moment(_0xd81d29[_0xffc2('0xcf')])[_0xffc2('0xbb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xffc2('0x94')](),'closedAt':_0xd81d29[_0xffc2('0xdd')]?moment(_0xd81d29[_0xffc2('0xde')])['format'](_0xffc2('0xbc'))['toString']():'','disposition':_0xd81d29[_0xffc2('0xdf')],'visibility':_0xd81d29['threadId']?_0xffc2('0xe0'):'Private','messages':_(_0xd81d29[_0xffc2('0xce')])[_0xffc2('0x7e')]({'secret':![]})[_0xffc2('0x30')](function(_0x5ee1d7){if(_0x5ee1d7[_0xffc2('0xcd')]){var _0x3c42a1=path[_0xffc2('0xc5')](_0xfc8082,_0x5ee1d7[_0xffc2('0xcd')]['basename']);if(fs[_0xffc2('0xe1')](_0x3c42a1)){fs[_0xffc2('0xe2')](_0x3c42a1)[_0xffc2('0xe3')](fs['createWriteStream'](path[_0xffc2('0xc5')](_0x2291a6,_0x5ee1d7[_0xffc2('0xcd')]['basename'])));}}return{'date':moment(_0x5ee1d7[_0xffc2('0xcf')])['format'](_0xffc2('0xbc'))[_0xffc2('0x94')](),'sender':_0x5ee1d7[_0xffc2('0xd0')]===_0xffc2('0xe4')?_0x5ee1d7[_0xffc2('0x6b')]?_0x5ee1d7['User'][_0xffc2('0x29')]:_0xffc2('0xe5'):_0x5ee1d7[_0xffc2('0x62')][_0xffc2('0xe6')]+(_0x5ee1d7[_0xffc2('0x62')][_0xffc2('0xe7')]?'\x20'+_0x5ee1d7[_0xffc2('0x62')][_0xffc2('0xe7')]:''),'body':_0x5ee1d7[_0xffc2('0xcd')]?_0x5ee1d7['Attachment'][_0xffc2('0xe8')]:_0x5ee1d7[_0xffc2('0x6f')],'direction':_0x5ee1d7[_0xffc2('0xd0')]==='out'?'A':'C','secret':_0x5ee1d7[_0xffc2('0xd1')],'read':_0x5ee1d7[_0xffc2('0x7b')],'attachment':_0x5ee1d7[_0xffc2('0xcd')]};})[_0xffc2('0x65')]()};return ejs['renderFile'](path['join'](config[_0xffc2('0xc6')],_0xffc2('0xc7'),_0xffc2('0xe9'),_0xffc2('0xea')),{'interaction':_0x10fc62})[_0xffc2('0x22')](function(_0xe2d9f9){return new BPromise(function(_0x3a2d9f,_0x366ed5){pdf[_0xffc2('0xb1')](_0xe2d9f9,_0x553c53)[_0xffc2('0xeb')](path[_0xffc2('0xc5')](_0x2291a6,_0xffc2('0xec')+_0xd81d29['id']+'-'+_0x59a742+'.pdf'),function(_0x17592e,_0x45b048){if(_0x17592e)return _0x366ed5(_0x17592e);_0x3a2d9f(_0x45b048);});});})[_0xffc2('0x22')](function(){return new BPromise(function(_0x186a06,_0x528e13){zipdir(_0x2291a6,{'saveTo':_0x3fe70e},function(_0x3a7fdb,_0x3d1360){if(_0x3a7fdb)return _0x528e13(_0x3a7fdb);return _0x186a06(_0x3d1360);});})[_0xffc2('0x22')](function(){return new BPromise(function(_0x3e0fbd,_0x100fee){rimraf(_0x2291a6,function(_0x60a300){if(_0x60a300)_0x100fee(_0x60a300);return _0x3e0fbd();});});})['then'](function(){return _0x38e88a[_0xffc2('0xed')](_0x3fe70e,_0x2ec97b,function(_0x20483a){if(_0x20483a){console[_0xffc2('0xee')]('err',_0x20483a);}else{fs['unlinkSync'](_0x3fe70e);}});});});}else{return _0x38e88a[_0xffc2('0x19')](0xc8);}})['catch'](handleError(_0x38e88a,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index cafa19b..a72392e 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 _0xd223=['then','map','findAll','setDataValue','length','emit','catch','hasOwnProperty','exports','events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','save','getUsers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd223,0x69));var _0x3d22=function(_0x47f9ee,_0x67b590){_0x47f9ee=_0x47f9ee-0x0;var _0x131426=_0xd223[_0x47f9ee];return _0x131426;};'use strict';var EventEmitter=require(_0x3d22('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x3d22('0x1')];var OpenchannelMessage=require(_0x3d22('0x2'))['db'][_0x3d22('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x3d22('0x4')](0x0);var events={'afterCreate':_0x3d22('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3038af){return function(_0x12ab98,_0x3e05c9,_0x4bb18e){_0x12ab98[_0x3d22('0x6')]({'attributes':['id'],'raw':!![]})[_0x3d22('0x7')](function(_0x180a0f){_0x12ab98['setDataValue']('Users',_0x180a0f[_0x3d22('0x8')](function(_0x286838){return{'id':_0x286838['id']};}));return OpenchannelMessage[_0x3d22('0x9')]({'where':{'OpenchannelInteractionId':_0x12ab98['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d22('0x7')](function(_0x19f7de){_0x12ab98[_0x3d22('0xa')]('unreadMessages',_0x19f7de[_0x3d22('0xb')]);OpenchannelInteractionEvents[_0x3d22('0xc')](_0x3038af+':'+_0x12ab98['id'],_0x12ab98);OpenchannelInteractionEvents[_0x3d22('0xc')](_0x3038af,_0x12ab98);_0x4bb18e(null);})[_0x3d22('0xd')](_0x4bb18e(null));};}for(var e in events){if(events[_0x3d22('0xe')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x3d22('0xf')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x7d06=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','then','setDataValue'];(function(_0x14242b,_0x3d294b){var _0x193297=function(_0x33d51b){while(--_0x33d51b){_0x14242b['push'](_0x14242b['shift']());}};_0x193297(++_0x3d294b);}(_0x7d06,0xa1));var _0x67d0=function(_0x2c8e53,_0x1a0942){_0x2c8e53=_0x2c8e53-0x0;var _0x476b27=_0x7d06[_0x2c8e53];return _0x476b27;};'use strict';var EventEmitter=require(_0x67d0('0x0'));var OpenchannelInteraction=require(_0x67d0('0x1'))['db'][_0x67d0('0x2')];var OpenchannelMessage=require(_0x67d0('0x1'))['db'][_0x67d0('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x67d0('0x4')](0x0);var events={'afterCreate':_0x67d0('0x5'),'afterUpdate':_0x67d0('0x6'),'afterDestroy':_0x67d0('0x7')};function emitEvent(_0x15cc87){return function(_0x235071,_0x1dd58a,_0x219abf){_0x235071['getUsers']({'attributes':['id'],'raw':!![]})[_0x67d0('0x8')](function(_0x51de49){_0x235071[_0x67d0('0x9')](_0x67d0('0xa'),_0x51de49[_0x67d0('0xb')](function(_0x56b02f){return{'id':_0x56b02f['id']};}));return OpenchannelMessage[_0x67d0('0xc')]({'where':{'OpenchannelInteractionId':_0x235071['id'],'direction':'in','read':![]},'raw':!![]});})[_0x67d0('0x8')](function(_0x3ed8b8){_0x235071[_0x67d0('0x9')](_0x67d0('0xd'),_0x3ed8b8[_0x67d0('0xe')]);OpenchannelInteractionEvents[_0x67d0('0xf')](_0x15cc87+':'+_0x235071['id'],_0x235071);OpenchannelInteractionEvents[_0x67d0('0xf')](_0x15cc87,_0x235071);_0x219abf(null);})[_0x67d0('0x10')](_0x219abf(null));};}for(var e in events){if(events[_0x67d0('0x11')](e)){var event=events[e];OpenchannelInteraction[_0x67d0('0x12')](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 c969cf7..c8222ac 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 _0x9ba0=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','OpenchannelInteraction','changed','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9ba0,0x15d));var _0x09ba=function(_0x517e18,_0xf19ce){_0x517e18=_0x517e18-0x0;var _0x3557ef=_0x9ba0[_0x517e18];return _0x3557ef;};'use strict';var _=require(_0x09ba('0x0'));var util=require(_0x09ba('0x1'));var logger=require(_0x09ba('0x2'))('api');var moment=require(_0x09ba('0x3'));var BPromise=require(_0x09ba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x09ba('0x5'));var rimraf=require(_0x09ba('0x6'));var config=require(_0x09ba('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0x09ba('0x8')]=function(_0x352483,_0xc41ba3){return _0x352483[_0x09ba('0x9')](_0x09ba('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xeee521,_0x41fdad,_0xd24d0d){if(_0xeee521[_0x09ba('0xb')]('closed')){_0xeee521['closedAt']=moment()['format'](_0x09ba('0xc'));}_0xd24d0d(null,_0xeee521);}}});}; \ No newline at end of file +var _0x3343=['./openchannelInteraction.attributes','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment'];(function(_0xa8f776,_0x420cbf){var _0x435961=function(_0x241c69){while(--_0x241c69){_0xa8f776['push'](_0xa8f776['shift']());}};_0x435961(++_0x420cbf);}(_0x3343,0xbd));var _0x3334=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x3343[_0x3fc97b];return _0x3a0c82;};'use strict';var _=require(_0x3334('0x0'));var util=require(_0x3334('0x1'));var logger=require(_0x3334('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3334('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3334('0x4'));var config=require(_0x3334('0x5'));var attributes=require(_0x3334('0x6'));module['exports']=function(_0xf72503,_0x49db21){return _0xf72503[_0x3334('0x7')](_0x3334('0x8'),attributes,{'tableName':_0x3334('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4033ab,_0x2e2696,_0x3d0c3a){if(_0x4033ab[_0x3334('0xa')](_0x3334('0xb'))){_0x4033ab[_0x3334('0xc')]=moment()[_0x3334('0xd')](_0x3334('0xe'));}_0x3d0c3a(null,_0x4033ab);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index b0c52f9..7648fb0 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 _0x09c4=['then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','body','options','raw','attributes','limit','catch','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request'];(function(_0x504d35,_0x44f153){var _0x4ac4f3=function(_0x5a670c){while(--_0x5a670c){_0x504d35['push'](_0x504d35['shift']());}};_0x4ac4f3(++_0x44f153);}(_0x09c4,0x137));var _0x409c=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x09c4[_0xf73c09];return _0xa8923c;};'use strict';var _=require('lodash');var util=require(_0x409c('0x0'));var moment=require(_0x409c('0x1'));var BPromise=require(_0x409c('0x2'));var rs=require(_0x409c('0x3'));var fs=require('fs');var Redis=require(_0x409c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x409c('0x5'));var logger=require('../../config/logger')(_0x409c('0x6'));var config=require(_0x409c('0x7'));var jayson=require(_0x409c('0x8'));var client=jayson[_0x409c('0x9')]['http']({'port':0x232a});config[_0x409c('0xa')]=_[_0x409c('0xb')](config[_0x409c('0xa')],{'host':_0x409c('0xc'),'port':0x18eb});var socket=require(_0x409c('0xd'))(new Redis(config[_0x409c('0xa')]));require(_0x409c('0xe'))[_0x409c('0xf')](socket);function respondWithRpcPromise(_0x955e74,_0x90b67a,_0x1a59b8){return new BPromise(function(_0x336ad7,_0x20b757){return client[_0x409c('0x10')](_0x955e74,_0x1a59b8)[_0x409c('0x11')](function(_0x4acedc){logger[_0x409c('0x12')](_0x409c('0x13'),_0x90b67a,_0x409c('0x14'));logger[_0x409c('0x15')](_0x409c('0x16'),_0x90b67a,_0x409c('0x14'),JSON[_0x409c('0x17')](_0x4acedc));if(_0x4acedc[_0x409c('0x18')]){if(_0x4acedc[_0x409c('0x18')]['code']===0x1f4){logger[_0x409c('0x18')](_0x409c('0x13'),_0x90b67a,_0x4acedc[_0x409c('0x18')][_0x409c('0x19')]);return _0x20b757(_0x4acedc[_0x409c('0x18')][_0x409c('0x19')]);}logger[_0x409c('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x90b67a,_0x4acedc[_0x409c('0x18')][_0x409c('0x19')]);return _0x336ad7(_0x4acedc[_0x409c('0x18')][_0x409c('0x19')]);}else{logger[_0x409c('0x12')](_0x409c('0x13'),_0x90b67a,_0x409c('0x14'));_0x336ad7(_0x4acedc[_0x409c('0x1a')][_0x409c('0x19')]);}})['catch'](function(_0x5259f6){logger['error'](_0x409c('0x13'),_0x90b67a,_0x5259f6);_0x20b757(_0x5259f6);});});}exports[_0x409c('0x1b')]=function(_0x5951cd){var _0x38cfe1=this;return new Promise(function(_0x20a9c5,_0x538d0d){return db[_0x409c('0x1c')]['update'](_0x5951cd[_0x409c('0x1d')],{'raw':_0x5951cd['options']?_0x5951cd[_0x409c('0x1e')][_0x409c('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5951cd[_0x409c('0x1e')]?_0x5951cd['options']['where']||null:null,'attributes':_0x5951cd['options']?_0x5951cd[_0x409c('0x1e')][_0x409c('0x20')]||null:null,'limit':_0x5951cd[_0x409c('0x1e')]?_0x5951cd[_0x409c('0x1e')][_0x409c('0x21')]||null:null})[_0x409c('0x11')](function(_0x7675fe){logger[_0x409c('0x12')]('UpdateOpenchannelInteraction',_0x5951cd);logger['debug'](_0x409c('0x1b'),_0x5951cd,JSON['stringify'](_0x7675fe));_0x20a9c5(_0x7675fe);})[_0x409c('0x22')](function(_0x9c1cd8){logger[_0x409c('0x18')](_0x409c('0x1b'),_0x9c1cd8['message'],_0x5951cd);_0x538d0d(_0x38cfe1[_0x409c('0x18')](0x1f4,_0x9c1cd8['message']));});});};exports[_0x409c('0x23')]=function(_0x2c2499){return new Promise(function(_0x591861,_0x2c28ec){return db[_0x409c('0x1c')]['find']({'where':_0x2c2499[_0x409c('0x1e')]?_0x2c2499['options']['where']||null:null})[_0x409c('0x11')](function(_0x48ea5b){if(_0x48ea5b){return _0x48ea5b[_0x409c('0x24')](_0x2c2499[_0x409c('0x1d')][_0x409c('0x25')],_[_0x409c('0x26')](_0x2c2499[_0x409c('0x1d')],[_0x409c('0x25'),'id'])||{});}})[_0x409c('0x27')](function(_0x5dd227){logger[_0x409c('0x12')]('AddTags',_0x2c2499);logger['debug'](_0x409c('0x28'),_0x2c2499,JSON[_0x409c('0x17')](_0x5dd227));_0x591861(_0x5dd227);})[_0x409c('0x22')](function(_0x3af1cd){logger[_0x409c('0x18')](_0x409c('0x28'),_0x3af1cd[_0x409c('0x19')],_0x2c2499);_0x2c28ec(_this[_0x409c('0x18')](0x1f4,_0x3af1cd[_0x409c('0x19')]));});});}; \ No newline at end of file +var _0x86bf=['rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','debug','catch','AddTagsToOpenchannelInteraction','find','addTags','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x86bf,0xa2));var _0xf86b=function(_0x5b2b36,_0x32a693){_0x5b2b36=_0x5b2b36-0x0;var _0x58eef4=_0x86bf[_0x5b2b36];return _0x58eef4;};'use strict';var _=require(_0xf86b('0x0'));var util=require(_0xf86b('0x1'));var moment=require('moment');var BPromise=require(_0xf86b('0x2'));var rs=require(_0xf86b('0x3'));var fs=require('fs');var Redis=require(_0xf86b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf86b('0x5'));var logger=require('../../config/logger')(_0xf86b('0x6'));var config=require(_0xf86b('0x7'));var jayson=require(_0xf86b('0x8'));var client=jayson[_0xf86b('0x9')][_0xf86b('0xa')]({'port':0x232a});config['redis']=_[_0xf86b('0xb')](config['redis'],{'host':_0xf86b('0xc'),'port':0x18eb});var socket=require(_0xf86b('0xd'))(new Redis(config[_0xf86b('0xe')]));require(_0xf86b('0xf'))[_0xf86b('0x10')](socket);function respondWithRpcPromise(_0xbdd27f,_0x51d492,_0x407b7f){return new BPromise(function(_0x26c3d8,_0x8e5f52){return client[_0xf86b('0x11')](_0xbdd27f,_0x407b7f)[_0xf86b('0x12')](function(_0xac3415){logger[_0xf86b('0x13')](_0xf86b('0x14'),_0x51d492,_0xf86b('0x15'));logger['debug'](_0xf86b('0x16'),_0x51d492,_0xf86b('0x15'),JSON[_0xf86b('0x17')](_0xac3415));if(_0xac3415[_0xf86b('0x18')]){if(_0xac3415[_0xf86b('0x18')][_0xf86b('0x19')]===0x1f4){logger[_0xf86b('0x18')]('OpenchannelInteraction,\x20%s,\x20%s',_0x51d492,_0xac3415[_0xf86b('0x18')][_0xf86b('0x1a')]);return _0x8e5f52(_0xac3415[_0xf86b('0x18')][_0xf86b('0x1a')]);}logger[_0xf86b('0x18')](_0xf86b('0x14'),_0x51d492,_0xac3415[_0xf86b('0x18')][_0xf86b('0x1a')]);return _0x26c3d8(_0xac3415['error']['message']);}else{logger[_0xf86b('0x13')](_0xf86b('0x14'),_0x51d492,_0xf86b('0x15'));_0x26c3d8(_0xac3415[_0xf86b('0x1b')]['message']);}})['catch'](function(_0xf80e8b){logger['error'](_0xf86b('0x14'),_0x51d492,_0xf80e8b);_0x8e5f52(_0xf80e8b);});});}exports[_0xf86b('0x1c')]=function(_0x112237){var _0x3cedd1=this;return new Promise(function(_0x3aa8a1,_0x4015d2){return db[_0xf86b('0x1d')][_0xf86b('0x1e')](_0x112237[_0xf86b('0x1f')],{'raw':_0x112237[_0xf86b('0x20')]?_0x112237[_0xf86b('0x20')][_0xf86b('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x112237[_0xf86b('0x20')]?_0x112237[_0xf86b('0x20')][_0xf86b('0x22')]||null:null,'attributes':_0x112237[_0xf86b('0x20')]?_0x112237[_0xf86b('0x20')]['attributes']||null:null,'limit':_0x112237[_0xf86b('0x20')]?_0x112237['options']['limit']||null:null})[_0xf86b('0x12')](function(_0x133af3){logger[_0xf86b('0x13')](_0xf86b('0x1c'),_0x112237);logger[_0xf86b('0x23')]('UpdateOpenchannelInteraction',_0x112237,JSON['stringify'](_0x133af3));_0x3aa8a1(_0x133af3);})[_0xf86b('0x24')](function(_0x450cee){logger[_0xf86b('0x18')]('UpdateOpenchannelInteraction',_0x450cee[_0xf86b('0x1a')],_0x112237);_0x4015d2(_0x3cedd1[_0xf86b('0x18')](0x1f4,_0x450cee[_0xf86b('0x1a')]));});});};exports[_0xf86b('0x25')]=function(_0x48b7a4){return new Promise(function(_0x568697,_0x43bc35){return db[_0xf86b('0x1d')][_0xf86b('0x26')]({'where':_0x48b7a4[_0xf86b('0x20')]?_0x48b7a4[_0xf86b('0x20')]['where']||null:null})[_0xf86b('0x12')](function(_0x322c5e){if(_0x322c5e){return _0x322c5e[_0xf86b('0x27')](_0x48b7a4['body']['ids'],_['omit'](_0x48b7a4[_0xf86b('0x1f')],['ids','id'])||{});}})[_0xf86b('0x28')](function(_0x44b3c0){logger['info'](_0xf86b('0x29'),_0x48b7a4);logger[_0xf86b('0x23')]('AddTags',_0x48b7a4,JSON['stringify'](_0x44b3c0));_0x568697(_0x44b3c0);})[_0xf86b('0x24')](function(_0x5a2faf){logger[_0xf86b('0x18')](_0xf86b('0x29'),_0x5a2faf[_0xf86b('0x1a')],_0x48b7a4);_0x43bc35(_this['error'](0x1f4,_0x5a2faf[_0xf86b('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 990bc5c..a2bcfce 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 _0x2370=['./openchannelInteraction.events','remove','update','removeListener','register','length'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2370,0x96));var _0x0237=function(_0x173f13,_0x4ea3cf){_0x173f13=_0x173f13-0x0;var _0x585942=_0x2370[_0x173f13];return _0x585942;};'use strict';var OpenchannelInteractionEvents=require(_0x0237('0x0'));var events=['save',_0x0237('0x1'),_0x0237('0x2')];function createListener(_0x996c7d,_0x1f2393){return function(_0x593696){_0x1f2393['emit'](_0x996c7d,_0x593696);};}function removeListener(_0x668034,_0x3da5b2){return function(){OpenchannelInteractionEvents[_0x0237('0x3')](_0x668034,_0x3da5b2);};}exports[_0x0237('0x4')]=function(_0x1b60c0){for(var _0x343836=0x0,_0x1d52ab=events[_0x0237('0x5')];_0x343836<_0x1d52ab;_0x343836++){var _0x445e2f=events[_0x343836];var _0x31e749=createListener('openchannelInteraction:'+_0x445e2f,_0x1b60c0);OpenchannelInteractionEvents['on'](_0x445e2f,_0x31e749);}}; \ No newline at end of file +var _0x7c3e=['length','openchannelInteraction:','./openchannelInteraction.events','remove','update','emit','removeListener','register'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0x7c3e,0x1da));var _0xe7c3=function(_0xb15db6,_0x388d94){_0xb15db6=_0xb15db6-0x0;var _0x1db34d=_0x7c3e[_0xb15db6];return _0x1db34d;};'use strict';var OpenchannelInteractionEvents=require(_0xe7c3('0x0'));var events=['save',_0xe7c3('0x1'),_0xe7c3('0x2')];function createListener(_0xa97949,_0x3022ac){return function(_0x41f1ed){_0x3022ac[_0xe7c3('0x3')](_0xa97949,_0x41f1ed);};}function removeListener(_0x1f15af,_0x437798){return function(){OpenchannelInteractionEvents[_0xe7c3('0x4')](_0x1f15af,_0x437798);};}exports[_0xe7c3('0x5')]=function(_0x15598e){for(var _0x50fbd3=0x0,_0x3045c4=events[_0xe7c3('0x6')];_0x50fbd3<_0x3045c4;_0x50fbd3++){var _0x4e97e2=events[_0x50fbd3];var _0x211632=createListener(_0xe7c3('0x7')+_0x4e97e2,_0x15598e);OpenchannelInteractionEvents['on'](_0x4e97e2,_0x211632);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 93a9db7..96a6e22 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 _0x0f03=['express','Router','../../components/auth/service','../../config/environment','./openchannelMessage.controller','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path'];(function(_0x40f996,_0x666ea4){var _0x296c6e=function(_0x389558){while(--_0x389558){_0x40f996['push'](_0x40f996['shift']());}};_0x296c6e(++_0x666ea4);}(_0x0f03,0x18e));var _0x30f0=function(_0xca8887,_0x956bc4){_0xca8887=_0xca8887-0x0;var _0x36f045=_0x0f03[_0xca8887];return _0x36f045;};'use strict';var multer=require('multer');var util=require(_0x30f0('0x0'));var path=require(_0x30f0('0x1'));var timeout=require('connect-timeout');var express=require(_0x30f0('0x2'));var router=express[_0x30f0('0x3')]();var auth=require(_0x30f0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x30f0('0x5'));var controller=require(_0x30f0('0x6'));router['get']('/',auth[_0x30f0('0x7')](),controller[_0x30f0('0x8')]);router[_0x30f0('0x9')]('/describe',auth[_0x30f0('0x7')](),controller[_0x30f0('0xa')]);router['get'](_0x30f0('0xb'),auth[_0x30f0('0x7')](),controller[_0x30f0('0xc')]);router[_0x30f0('0xd')]('/',auth[_0x30f0('0x7')](),interaction[_0x30f0('0xe')](_0x30f0('0xf'),'openchannelmessage:create'),controller['create']);router[_0x30f0('0x10')](_0x30f0('0xb'),auth['isAuthenticated'](),controller[_0x30f0('0x11')]);router[_0x30f0('0x10')](_0x30f0('0x12'),auth[_0x30f0('0x7')](),controller[_0x30f0('0x13')]);router[_0x30f0('0x10')](_0x30f0('0x14'),auth[_0x30f0('0x7')](),controller[_0x30f0('0x15')]);router[_0x30f0('0x16')](_0x30f0('0xb'),auth[_0x30f0('0x7')](),controller[_0x30f0('0x17')]);module[_0x30f0('0x18')]=router; \ No newline at end of file +var _0x23e8=['multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','/describe','describe','get','/:id','show','tracked','openchannel','openchannelmessage:create','create','put','update','/:id/reject','delete','exports'];(function(_0x474d97,_0x5909ce){var _0x1edf25=function(_0x2831df){while(--_0x2831df){_0x474d97['push'](_0x474d97['shift']());}};_0x1edf25(++_0x5909ce);}(_0x23e8,0x69));var _0x823e=function(_0xc3aa89,_0x521cc1){_0xc3aa89=_0xc3aa89-0x0;var _0x2f2b6c=_0x23e8[_0xc3aa89];return _0x2f2b6c;};'use strict';var multer=require(_0x823e('0x0'));var util=require(_0x823e('0x1'));var path=require('path');var timeout=require(_0x823e('0x2'));var express=require('express');var router=express[_0x823e('0x3')]();var auth=require(_0x823e('0x4'));var interaction=require(_0x823e('0x5'));var config=require('../../config/environment');var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x823e('0x6')](),controller['index']);router['get'](_0x823e('0x7'),auth[_0x823e('0x6')](),controller[_0x823e('0x8')]);router[_0x823e('0x9')](_0x823e('0xa'),auth[_0x823e('0x6')](),controller[_0x823e('0xb')]);router['post']('/',auth[_0x823e('0x6')](),interaction[_0x823e('0xc')](_0x823e('0xd'),_0x823e('0xe')),controller[_0x823e('0xf')]);router[_0x823e('0x10')](_0x823e('0xa'),auth[_0x823e('0x6')](),controller[_0x823e('0x11')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x823e('0x10')](_0x823e('0x12'),auth['isAuthenticated'](),controller['reject']);router[_0x823e('0x13')](_0x823e('0xa'),auth[_0x823e('0x6')](),controller['destroy']);module[_0x823e('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 25565d8..3d6a2b1 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 _0x31f2=['DATE','sequelize','exports','medium','BOOLEAN','ENUM','out'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x31f2,0x190));var _0x231f=function(_0xd3e871,_0xe17920){_0xd3e871=_0xd3e871-0x0;var _0x4f46d6=_0x31f2[_0xd3e871];return _0x4f46d6;};'use strict';var Sequelize=require(_0x231f('0x0'));module[_0x231f('0x1')]={'body':{'type':Sequelize['TEXT'](_0x231f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x231f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x231f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x231f('0x4')]('in',_0x231f('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x231f('0x6')]}}; \ No newline at end of file +var _0xae28=['DATE','sequelize','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x5069d7,_0x21a402){var _0x5e8a74=function(_0x43e6cb){while(--_0x43e6cb){_0x5069d7['push'](_0x5069d7['shift']());}};_0x5e8a74(++_0x21a402);}(_0xae28,0x8d));var _0x8ae2=function(_0x5d2101,_0x8f4f8a){_0x5d2101=_0x5d2101-0x0;var _0x3d43e9=_0xae28[_0x5d2101];return _0x3d43e9;};'use strict';var Sequelize=require(_0x8ae2('0x0'));module['exports']={'body':{'type':Sequelize[_0x8ae2('0x1')](_0x8ae2('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8ae2('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8ae2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8ae2('0x4')]('in','out'),'defaultValue':_0x8ae2('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8ae2('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index f515576..8546ce0 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 _0x0fc6=['params','intersection','find','create','body','describe','accept','openchannel','read','readAt','format','UserId','user','CmContact','get','OpenchannelInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelMessage,\x20%s,\x20%s','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','index','OpenchannelMessage','rawAttributes','type','model','query','keys','filters','attributes','fields','length','nolimit','sort','pick','filter','merge','where','map','VIRTUAL','options','includeAll','include','show'];(function(_0xaa6a4,_0x64b067){var _0xdc31a4=function(_0x4269d8){while(--_0x4269d8){_0xaa6a4['push'](_0xaa6a4['shift']());}};_0xdc31a4(++_0x64b067);}(_0x0fc6,0x9f));var _0x60fc=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0fc6[_0x57b54c];return _0x59cc19;};'use strict';var pdf=require(_0x60fc('0x0'));var emlformat=require(_0x60fc('0x1'));var rimraf=require(_0x60fc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x60fc('0x3'));var rp=require(_0x60fc('0x4'));var moment=require('moment');var BPromise=require(_0x60fc('0x5'));var Mustache=require('mustache');var util=require(_0x60fc('0x6'));var path=require(_0x60fc('0x7'));var sox=require(_0x60fc('0x8'));var csv=require(_0x60fc('0x9'));var ejs=require(_0x60fc('0xa'));var fs=require('fs');var _=require(_0x60fc('0xb'));var squel=require(_0x60fc('0xc'));var crypto=require('crypto');var jsforce=require(_0x60fc('0xd'));var deskjs=require(_0x60fc('0xe'));var toCsv=require(_0x60fc('0x9'));var querystring=require(_0x60fc('0xf'));var Papa=require(_0x60fc('0x10'));var Redis=require(_0x60fc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x60fc('0x12'));var as=require(_0x60fc('0x13'));var hardwareService=require(_0x60fc('0x14'));var logger=require(_0x60fc('0x15'))(_0x60fc('0x16'));var utils=require(_0x60fc('0x17'));var config=require(_0x60fc('0x18'));var db=require(_0x60fc('0x19'))['db'];config['redis']=_[_0x60fc('0x1a')](config['redis'],{'host':_0x60fc('0x1b'),'port':0x18eb});var socket=require(_0x60fc('0x1c'))(new Redis(config['redis']));require(_0x60fc('0x1d'))[_0x60fc('0x1e')](socket);var jayson=require(_0x60fc('0x1f'));var client=jayson[_0x60fc('0x20')][_0x60fc('0x21')]({'port':0x232c});var client9002=jayson[_0x60fc('0x20')][_0x60fc('0x21')]({'port':0x232a});function checkPasswordPattern(_0xa45c93,_0x5b7d68,_0x36fdf0){if(_0x36fdf0){var _0xf47a7c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xf47a7c[_0x60fc('0x22')](_0x5b7d68)){return _0xa45c93;}else{throw new db['Sequelize']['ValidationError'](_0x60fc('0x23'));}}else{return _0xa45c93;}}function respondWithRpcPromise(_0x26adaf,_0x53d2ef,_0x305ba9,_0x47df51){return new BPromise(function(_0x356140,_0xca7856){var _0x231161=_0x47df51||client;return _0x231161[_0x60fc('0x24')](_0x26adaf,_0x305ba9)['then'](function(_0x134c0c){logger[_0x60fc('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x53d2ef,_0x60fc('0x26'));logger[_0x60fc('0x27')](_0x60fc('0x28'),_0x53d2ef,'request\x20sent',JSON['stringify'](_0x134c0c));if(_0x134c0c[_0x60fc('0x29')]){if(_0x134c0c[_0x60fc('0x29')][_0x60fc('0x2a')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x53d2ef,_0x134c0c[_0x60fc('0x29')]['message']);return _0xca7856(_0x134c0c[_0x60fc('0x29')][_0x60fc('0x2b')]);}logger[_0x60fc('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x53d2ef,_0x134c0c[_0x60fc('0x29')][_0x60fc('0x2b')]);return _0x356140(_0x134c0c[_0x60fc('0x29')][_0x60fc('0x2b')]);}else{logger[_0x60fc('0x25')](_0x60fc('0x2c'),_0x53d2ef,_0x60fc('0x26'));_0x356140(_0x134c0c[_0x60fc('0x2d')][_0x60fc('0x2b')]);}})[_0x60fc('0x2e')](function(_0x1d5757){logger[_0x60fc('0x29')](_0x60fc('0x2c'),_0x53d2ef,_0x1d5757);_0xca7856(_0x1d5757);});});}function respondWithStatusCode(_0x129b08,_0x196dad){_0x196dad=_0x196dad||0xcc;return function(_0x155e58){if(_0x155e58){return _0x129b08['sendStatus'](_0x196dad);}return _0x129b08[_0x60fc('0x2f')](_0x196dad)[_0x60fc('0x30')]();};}function respondWithResult(_0x34a1ee,_0x549b5c){_0x549b5c=_0x549b5c||0xc8;return function(_0xd41cd){if(_0xd41cd){return _0x34a1ee['status'](_0x549b5c)[_0x60fc('0x31')](_0xd41cd);}};}function respondWithFilteredResult(_0x25c04a,_0x30fd6f){return function(_0x357488){if(_0x357488){var _0x5e82db=_0x357488[_0x60fc('0x32')],_0x2a1982=_0x30fd6f[_0x60fc('0x33')],_0x4420e7=_0x30fd6f[_0x60fc('0x33')]+_0x30fd6f[_0x60fc('0x34')],_0x1fa597;if(_0x4420e7>=_0x5e82db){_0x4420e7=_0x5e82db;_0x1fa597=0xc8;}else{_0x1fa597=0xce;}_0x25c04a[_0x60fc('0x2f')](_0x1fa597);return _0x25c04a[_0x60fc('0x35')](_0x60fc('0x36'),_0x2a1982+'-'+_0x4420e7+'/'+_0x5e82db)[_0x60fc('0x31')](_0x357488);}return null;};}function patchUpdates(_0x40d2ec){return function(_0x7b5053){try{jsonpatch[_0x60fc('0x37')](_0x7b5053,_0x40d2ec,!![]);}catch(_0x562952){return BPromise[_0x60fc('0x38')](_0x562952);}return _0x7b5053[_0x60fc('0x39')]();};}function saveUpdates(_0x5c2339,_0x51b89d){return function(_0x46eb99){if(_0x46eb99){return _0x46eb99[_0x60fc('0x3a')](_0x5c2339)[_0x60fc('0x3b')](function(_0x46eb9f){return _0x46eb9f;});}return null;};}function removeEntity(_0xed5104,_0x203638){return function(_0x474e55){if(_0x474e55){return _0x474e55['destroy']()[_0x60fc('0x3b')](function(){_0xed5104[_0x60fc('0x2f')](0xcc)[_0x60fc('0x30')]();});}};}function handleEntityNotFound(_0x480484,_0x547473){return function(_0x4da87c){if(!_0x4da87c){_0x480484['sendStatus'](0x194);}return _0x4da87c;};}function handleError(_0x2fb52e,_0x10abb7){_0x10abb7=_0x10abb7||0x1f4;return function(_0xd31b2a){logger[_0x60fc('0x29')](_0xd31b2a[_0x60fc('0x3c')]);if(_0xd31b2a[_0x60fc('0x3d')]){delete _0xd31b2a[_0x60fc('0x3d')];}_0x2fb52e['status'](_0x10abb7)['send'](_0xd31b2a);};}exports[_0x60fc('0x3e')]=function(_0x406b56,_0x404204){var _0x482063={},_0x17049e={},_0x396116={'count':0x0,'rows':[]};var _0x4a88b8=_['map'](db[_0x60fc('0x3f')][_0x60fc('0x40')],function(_0x3856b4){return{'name':_0x3856b4['fieldName'],'type':_0x3856b4[_0x60fc('0x41')]['key']};});_0x17049e[_0x60fc('0x42')]=_['map'](_0x4a88b8,_0x60fc('0x3d'));_0x17049e[_0x60fc('0x43')]=_[_0x60fc('0x44')](_0x406b56[_0x60fc('0x43')]);_0x17049e[_0x60fc('0x45')]=_['intersection'](_0x17049e[_0x60fc('0x42')],_0x17049e[_0x60fc('0x43')]);_0x482063[_0x60fc('0x46')]=_['intersection'](_0x17049e[_0x60fc('0x42')],qs[_0x60fc('0x47')](_0x406b56[_0x60fc('0x43')][_0x60fc('0x47')]));_0x482063[_0x60fc('0x46')]=_0x482063[_0x60fc('0x46')][_0x60fc('0x48')]?_0x482063[_0x60fc('0x46')]:_0x17049e[_0x60fc('0x42')];if(!_0x406b56['query']['hasOwnProperty'](_0x60fc('0x49'))){_0x482063[_0x60fc('0x34')]=qs[_0x60fc('0x34')](_0x406b56[_0x60fc('0x43')][_0x60fc('0x34')]);_0x482063[_0x60fc('0x33')]=qs[_0x60fc('0x33')](_0x406b56[_0x60fc('0x43')][_0x60fc('0x33')]);}_0x482063['order']=qs[_0x60fc('0x4a')](_0x406b56[_0x60fc('0x43')][_0x60fc('0x4a')]);_0x482063['where']=qs['filters'](_[_0x60fc('0x4b')](_0x406b56[_0x60fc('0x43')],_0x17049e['filters']),_0x4a88b8);if(_0x406b56['query'][_0x60fc('0x4c')]){_0x482063['where']=_[_0x60fc('0x4d')](_0x482063[_0x60fc('0x4e')],{'$or':_[_0x60fc('0x4f')](_0x4a88b8,function(_0x4a7083){if(_0x4a7083[_0x60fc('0x41')]!==_0x60fc('0x50')){var _0xcd202b={};_0xcd202b[_0x4a7083['name']]={'$like':'%'+_0x406b56[_0x60fc('0x43')]['filter']+'%'};return _0xcd202b;}})});}_0x482063=_[_0x60fc('0x4d')]({},_0x482063,_0x406b56[_0x60fc('0x51')]);var _0x44d97e={'where':_0x482063[_0x60fc('0x4e')]};return db[_0x60fc('0x3f')]['count'](_0x44d97e)[_0x60fc('0x3b')](function(_0x193a82){_0x396116[_0x60fc('0x32')]=_0x193a82;if(_0x406b56[_0x60fc('0x43')][_0x60fc('0x52')]){_0x482063[_0x60fc('0x53')]=[{'all':!![]}];}return db[_0x60fc('0x3f')]['findAll'](_0x482063);})[_0x60fc('0x3b')](function(_0x597cb2){_0x396116['rows']=_0x597cb2;return _0x396116;})[_0x60fc('0x3b')](respondWithFilteredResult(_0x404204,_0x482063))[_0x60fc('0x2e')](handleError(_0x404204,null));};exports[_0x60fc('0x54')]=function(_0x3d574f,_0x30245a){var _0x41b322={'raw':!![],'where':{'id':_0x3d574f[_0x60fc('0x55')]['id']}},_0x573d7b={};_0x573d7b[_0x60fc('0x42')]=_[_0x60fc('0x44')](db['OpenchannelMessage'][_0x60fc('0x40')]);_0x573d7b[_0x60fc('0x43')]=_[_0x60fc('0x44')](_0x3d574f['query']);_0x573d7b['filters']=_[_0x60fc('0x56')](_0x573d7b[_0x60fc('0x42')],_0x573d7b[_0x60fc('0x43')]);_0x41b322[_0x60fc('0x46')]=_[_0x60fc('0x56')](_0x573d7b['model'],qs[_0x60fc('0x47')](_0x3d574f[_0x60fc('0x43')][_0x60fc('0x47')]));_0x41b322['attributes']=_0x41b322[_0x60fc('0x46')][_0x60fc('0x48')]?_0x41b322[_0x60fc('0x46')]:_0x573d7b[_0x60fc('0x42')];if(_0x3d574f[_0x60fc('0x43')][_0x60fc('0x52')]){_0x41b322['include']=[{'all':!![]}];}_0x41b322=_['merge']({},_0x41b322,_0x3d574f[_0x60fc('0x51')]);return db[_0x60fc('0x3f')][_0x60fc('0x57')](_0x41b322)[_0x60fc('0x3b')](handleEntityNotFound(_0x30245a,null))['then'](respondWithResult(_0x30245a,null))[_0x60fc('0x2e')](handleError(_0x30245a,null));};exports[_0x60fc('0x58')]=function(_0x152e00,_0x369e9b){return db[_0x60fc('0x3f')][_0x60fc('0x58')](_0x152e00[_0x60fc('0x59')],{})[_0x60fc('0x3b')](respondWithResult(_0x369e9b,0xc9))[_0x60fc('0x2e')](handleError(_0x369e9b,null));};exports[_0x60fc('0x3a')]=function(_0xb47fd1,_0x45a287){if(_0xb47fd1[_0x60fc('0x59')]['id']){delete _0xb47fd1[_0x60fc('0x59')]['id'];}return db[_0x60fc('0x3f')][_0x60fc('0x57')]({'where':{'id':_0xb47fd1[_0x60fc('0x55')]['id']}})['then'](handleEntityNotFound(_0x45a287,null))[_0x60fc('0x3b')](saveUpdates(_0xb47fd1['body'],null))['then'](respondWithResult(_0x45a287,null))[_0x60fc('0x2e')](handleError(_0x45a287,null));};exports['destroy']=function(_0x4cfa14,_0x219600){return db[_0x60fc('0x3f')][_0x60fc('0x57')]({'where':{'id':_0x4cfa14[_0x60fc('0x55')]['id']}})['then'](handleEntityNotFound(_0x219600,null))[_0x60fc('0x3b')](removeEntity(_0x219600,null))[_0x60fc('0x2e')](handleError(_0x219600,null));};exports[_0x60fc('0x5a')]=function(_0x414572,_0x2150fe){return db[_0x60fc('0x3f')]['describe']()[_0x60fc('0x3b')](respondWithResult(_0x2150fe,null))[_0x60fc('0x2e')](handleError(_0x2150fe,null));};var interaction_log=require(_0x60fc('0x15'))('openchannel-interactions');exports[_0x60fc('0x5b')]=function(_0x33ee31,_0x1f9100,_0x409aa1){var _0x4c5834={'channel':_0x60fc('0x5c')};if(_0x33ee31['body']['id']){delete _0x33ee31[_0x60fc('0x59')]['id'];}_0x33ee31[_0x60fc('0x59')][_0x60fc('0x5d')]=!![];_0x33ee31['body'][_0x60fc('0x5e')]=moment()[_0x60fc('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x33ee31['body'][_0x60fc('0x60')]=_0x33ee31['body'][_0x60fc('0x60')]||_0x33ee31[_0x60fc('0x61')]['id'];return db[_0x60fc('0x3f')][_0x60fc('0x57')]({'where':{'id':_0x33ee31[_0x60fc('0x55')]['id'],'UserId':null},'include':[{'model':db[_0x60fc('0x62')],'as':'Contact'}]})[_0x60fc('0x3b')](handleEntityNotFound(_0x1f9100,null))[_0x60fc('0x3b')](saveUpdates(_0x33ee31[_0x60fc('0x59')],null))['then'](function(_0x3966f2){if(_0x3966f2){_0x4c5834['message']=_0x3966f2[_0x60fc('0x63')]({'plain':!![]});return db[_0x60fc('0x64')][_0x60fc('0x57')]({'where':{'id':_0x3966f2['OpenchannelInteractionId']}});}return null;})[_0x60fc('0x3b')](handleEntityNotFound(_0x1f9100,null))[_0x60fc('0x3b')](function(_0xd6385c){if(_0xd6385c){return _0xd6385c[_0x60fc('0x3a')]({'UserId':_0x33ee31[_0x60fc('0x59')][_0x60fc('0x60')],'read1stAt':_['isNil'](_0xd6385c[_0x60fc('0x65')])?moment()[_0x60fc('0x5f')](_0x60fc('0x66')):undefined});}return null;})[_0x60fc('0x3b')](function(_0x2bcc69){if(_0x2bcc69){_0x4c5834['interaction']=_0x2bcc69[_0x60fc('0x63')]({'plain':!![]});interaction_log['info'](_0x60fc('0x67'),_0x33ee31['user']['id'],_0x33ee31[_0x60fc('0x61')][_0x60fc('0x3d')],_0x33ee31['user'][_0x60fc('0x68')],_0x4c5834[_0x60fc('0x69')]['id'],_0x33ee31[_0x60fc('0x59')]?JSON['stringify'](_0x33ee31[_0x60fc('0x59')]):_0x60fc('0x6a'));return respondWithRpcPromise(_0x60fc('0x6b'),_0x60fc('0x6c'),_0x4c5834);}return null;})['then'](function(_0x2d2761){if(_0x2d2761){if(_0x33ee31[_0x60fc('0x59')][_0x60fc('0x6d')]){_0x4c5834[_0x60fc('0x2b')][_0x60fc('0x6e')]=util[_0x60fc('0x5f')](_0x60fc('0x6f'),_0x33ee31[_0x60fc('0x61')][_0x60fc('0x3d')]);_0x4c5834[_0x60fc('0x2b')][_0x60fc('0x70')]=_0x4c5834[_0x60fc('0x70')];_0x4c5834[_0x60fc('0x2b')][_0x60fc('0x71')]=_0x60fc('0x5b');return respondWithRpcPromise(_0x60fc('0x72'),'EventManager',{'event':_0x60fc('0x73'),'message':_0x4c5834[_0x60fc('0x2b')]},client9002)[_0x60fc('0x3b')](function(){return _0x4c5834;});}return _0x4c5834;}return null;})[_0x60fc('0x3b')](respondWithResult(_0x1f9100,null))[_0x60fc('0x2e')](handleError(_0x1f9100,null));};var interaction_log=require(_0x60fc('0x15'))('openchannel-interactions');exports[_0x60fc('0x38')]=function(_0x380532,_0x4d9717,_0x551813){var _0x372275={'agent':{},'channel':'openchannel'};if(_0x380532[_0x60fc('0x59')]['id']){delete _0x380532['body']['id'];}_0x380532[_0x60fc('0x59')][_0x60fc('0x60')]=_0x380532[_0x60fc('0x59')]['UserId']||_0x380532['user']['id'];_0x372275[_0x60fc('0x74')]['id']=_0x380532['body'][_0x60fc('0x60')];return db['OpenchannelMessage'][_0x60fc('0x57')]({'where':{'id':_0x380532[_0x60fc('0x55')]['id'],'UserId':null}})[_0x60fc('0x3b')](handleEntityNotFound(_0x4d9717,null))[_0x60fc('0x3b')](function(_0xdd6278){if(_0xdd6278){_0x372275[_0x60fc('0x2b')]=_0xdd6278[_0x60fc('0x63')]({'plain':!![]});return db[_0x60fc('0x64')][_0x60fc('0x57')]({'where':{'id':_0xdd6278['OpenchannelInteractionId']}});}return null;})[_0x60fc('0x3b')](handleEntityNotFound(_0x4d9717,null))[_0x60fc('0x3b')](function(_0x49019b){if(_0x49019b){_0x372275[_0x60fc('0x69')]=_0x49019b[_0x60fc('0x63')]({'plain':!![]});interaction_log[_0x60fc('0x25')](_0x60fc('0x75'),_0x380532[_0x60fc('0x61')]['id'],_0x380532[_0x60fc('0x61')][_0x60fc('0x3d')],_0x380532[_0x60fc('0x61')]['role'],_0x372275[_0x60fc('0x69')]['id'],_0x380532[_0x60fc('0x59')]?JSON[_0x60fc('0x76')](_0x380532[_0x60fc('0x59')]):'null');return respondWithRpcPromise(_0x60fc('0x77'),_0x60fc('0x78'),_0x372275);}return null;})['then'](function(_0x537a6e){if(_0x537a6e){_0x537a6e['message'][_0x60fc('0x6e')]=util[_0x60fc('0x5f')](_0x60fc('0x6f'),_0x380532['user']['name']);_0x537a6e[_0x60fc('0x2b')]['channel']=_0x372275[_0x60fc('0x70')];_0x537a6e['message'][_0x60fc('0x71')]='reject';respondWithRpcPromise(_0x60fc('0x72'),'EventManager',{'event':_0x60fc('0x79'),'message':_0x537a6e['message']},client9002);return _0x372275;}return null;})['then'](respondWithResult(_0x4d9717,null))[_0x60fc('0x2e')](handleError(_0x4d9717,null));}; \ No newline at end of file +var _0x1812=['http','client','test','Sequelize','ValidationError','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','update','destroy','stack','send','index','map','fieldName','type','model','query','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','name','filter','options','OpenchannelMessage','includeAll','findAll','rows','show','params','keys','rawAttributes','attributes','find','create','body','describe','openchannel-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','OpenchannelInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','manual','interface','channel','EventManager','acceptmessage','reject','OpenchannelInteraction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','rejectmessage','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise'];(function(_0x143cfd,_0x1a336e){var _0x2cb5f5=function(_0x1523fa){while(--_0x1523fa){_0x143cfd['push'](_0x143cfd['shift']());}};_0x2cb5f5(++_0x1a336e);}(_0x1812,0x155));var _0x2181=function(_0x7874a,_0x25c19a){_0x7874a=_0x7874a-0x0;var _0x287438=_0x1812[_0x7874a];return _0x287438;};'use strict';var pdf=require(_0x2181('0x0'));var emlformat=require(_0x2181('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2181('0x2'));var jsonpatch=require(_0x2181('0x3'));var rp=require(_0x2181('0x4'));var moment=require(_0x2181('0x5'));var BPromise=require(_0x2181('0x6'));var Mustache=require(_0x2181('0x7'));var util=require(_0x2181('0x8'));var path=require(_0x2181('0x9'));var sox=require(_0x2181('0xa'));var csv=require(_0x2181('0xb'));var ejs=require(_0x2181('0xc'));var fs=require('fs');var _=require(_0x2181('0xd'));var squel=require(_0x2181('0xe'));var crypto=require(_0x2181('0xf'));var jsforce=require(_0x2181('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x2181('0xb'));var querystring=require('querystring');var Papa=require(_0x2181('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2181('0x12'));var as=require(_0x2181('0x13'));var hardwareService=require(_0x2181('0x14'));var logger=require(_0x2181('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x2181('0x16'));var db=require(_0x2181('0x17'))['db'];config[_0x2181('0x18')]=_[_0x2181('0x19')](config[_0x2181('0x18')],{'host':_0x2181('0x1a'),'port':0x18eb});var socket=require(_0x2181('0x1b'))(new Redis(config[_0x2181('0x18')]));require(_0x2181('0x1c'))[_0x2181('0x1d')](socket);var jayson=require(_0x2181('0x1e'));var client=jayson['client'][_0x2181('0x1f')]({'port':0x232c});var client9002=jayson[_0x2181('0x20')][_0x2181('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x7b3b33,_0x38f2f4,_0x3ba249){if(_0x3ba249){var _0x4941db=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4941db[_0x2181('0x21')](_0x38f2f4)){return _0x7b3b33;}else{throw new db[(_0x2181('0x22'))][(_0x2181('0x23'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x7b3b33;}}function respondWithRpcPromise(_0x1322e3,_0x246062,_0x59dd9c,_0x53b592){return new BPromise(function(_0x11129a,_0x3c02e6){var _0x45f9ae=_0x53b592||client;return _0x45f9ae[_0x2181('0x24')](_0x1322e3,_0x59dd9c)[_0x2181('0x25')](function(_0x1e9171){logger[_0x2181('0x26')](_0x2181('0x27'),_0x246062,_0x2181('0x28'));logger[_0x2181('0x29')](_0x2181('0x2a'),_0x246062,_0x2181('0x28'),JSON[_0x2181('0x2b')](_0x1e9171));if(_0x1e9171[_0x2181('0x2c')]){if(_0x1e9171['error'][_0x2181('0x2d')]===0x1f4){logger[_0x2181('0x2c')]('OpenchannelMessage,\x20%s,\x20%s',_0x246062,_0x1e9171[_0x2181('0x2c')][_0x2181('0x2e')]);return _0x3c02e6(_0x1e9171[_0x2181('0x2c')][_0x2181('0x2e')]);}logger[_0x2181('0x2c')]('OpenchannelMessage,\x20%s,\x20%s',_0x246062,_0x1e9171[_0x2181('0x2c')][_0x2181('0x2e')]);return _0x11129a(_0x1e9171['error'][_0x2181('0x2e')]);}else{logger[_0x2181('0x26')](_0x2181('0x27'),_0x246062,_0x2181('0x28'));_0x11129a(_0x1e9171[_0x2181('0x2f')]['message']);}})[_0x2181('0x30')](function(_0x54a522){logger[_0x2181('0x2c')](_0x2181('0x27'),_0x246062,_0x54a522);_0x3c02e6(_0x54a522);});});}function respondWithStatusCode(_0x5c439c,_0x1e32aa){_0x1e32aa=_0x1e32aa||0xcc;return function(_0x89e606){if(_0x89e606){return _0x5c439c[_0x2181('0x31')](_0x1e32aa);}return _0x5c439c[_0x2181('0x32')](_0x1e32aa)[_0x2181('0x33')]();};}function respondWithResult(_0x165b99,_0x39e36d){_0x39e36d=_0x39e36d||0xc8;return function(_0x190c68){if(_0x190c68){return _0x165b99[_0x2181('0x32')](_0x39e36d)['json'](_0x190c68);}};}function respondWithFilteredResult(_0x355592,_0x20141f){return function(_0x2f75ab){if(_0x2f75ab){var _0x715e7d=_0x2f75ab[_0x2181('0x34')],_0x305741=_0x20141f[_0x2181('0x35')],_0x30c006=_0x20141f[_0x2181('0x35')]+_0x20141f[_0x2181('0x36')],_0x59d670;if(_0x30c006>=_0x715e7d){_0x30c006=_0x715e7d;_0x59d670=0xc8;}else{_0x59d670=0xce;}_0x355592[_0x2181('0x32')](_0x59d670);return _0x355592[_0x2181('0x37')](_0x2181('0x38'),_0x305741+'-'+_0x30c006+'/'+_0x715e7d)['json'](_0x2f75ab);}return null;};}function patchUpdates(_0x5a79e7){return function(_0x22142d){try{jsonpatch[_0x2181('0x39')](_0x22142d,_0x5a79e7,!![]);}catch(_0xecbb4d){return BPromise['reject'](_0xecbb4d);}return _0x22142d['save']();};}function saveUpdates(_0x260593,_0x3eb640){return function(_0x5d7b64){if(_0x5d7b64){return _0x5d7b64[_0x2181('0x3a')](_0x260593)[_0x2181('0x25')](function(_0x5196b8){return _0x5196b8;});}return null;};}function removeEntity(_0x5950fc,_0x1c9680){return function(_0x17eaf0){if(_0x17eaf0){return _0x17eaf0[_0x2181('0x3b')]()[_0x2181('0x25')](function(){_0x5950fc[_0x2181('0x32')](0xcc)[_0x2181('0x33')]();});}};}function handleEntityNotFound(_0x2d535d,_0x555148){return function(_0xc33ae9){if(!_0xc33ae9){_0x2d535d[_0x2181('0x31')](0x194);}return _0xc33ae9;};}function handleError(_0x5a48b4,_0x5394e1){_0x5394e1=_0x5394e1||0x1f4;return function(_0x1a829c){logger[_0x2181('0x2c')](_0x1a829c[_0x2181('0x3c')]);if(_0x1a829c['name']){delete _0x1a829c['name'];}_0x5a48b4[_0x2181('0x32')](_0x5394e1)[_0x2181('0x3d')](_0x1a829c);};}exports[_0x2181('0x3e')]=function(_0x20108b,_0x2a6777){var _0x142cb3={},_0x40d1f1={},_0x30c49c={'count':0x0,'rows':[]};var _0x52787a=_[_0x2181('0x3f')](db['OpenchannelMessage']['rawAttributes'],function(_0xdc09aa){return{'name':_0xdc09aa[_0x2181('0x40')],'type':_0xdc09aa[_0x2181('0x41')]['key']};});_0x40d1f1[_0x2181('0x42')]=_['map'](_0x52787a,'name');_0x40d1f1['query']=_['keys'](_0x20108b[_0x2181('0x43')]);_0x40d1f1['filters']=_[_0x2181('0x44')](_0x40d1f1[_0x2181('0x42')],_0x40d1f1['query']);_0x142cb3['attributes']=_[_0x2181('0x44')](_0x40d1f1[_0x2181('0x42')],qs[_0x2181('0x45')](_0x20108b[_0x2181('0x43')]['fields']));_0x142cb3['attributes']=_0x142cb3['attributes'][_0x2181('0x46')]?_0x142cb3['attributes']:_0x40d1f1['model'];if(!_0x20108b[_0x2181('0x43')][_0x2181('0x47')](_0x2181('0x48'))){_0x142cb3[_0x2181('0x36')]=qs[_0x2181('0x36')](_0x20108b[_0x2181('0x43')][_0x2181('0x36')]);_0x142cb3[_0x2181('0x35')]=qs[_0x2181('0x35')](_0x20108b[_0x2181('0x43')][_0x2181('0x35')]);}_0x142cb3['order']=qs[_0x2181('0x49')](_0x20108b['query']['sort']);_0x142cb3[_0x2181('0x4a')]=qs[_0x2181('0x4b')](_[_0x2181('0x4c')](_0x20108b['query'],_0x40d1f1[_0x2181('0x4b')]),_0x52787a);if(_0x20108b['query']['filter']){_0x142cb3['where']=_[_0x2181('0x4d')](_0x142cb3[_0x2181('0x4a')],{'$or':_[_0x2181('0x3f')](_0x52787a,function(_0x3f0bdf){if(_0x3f0bdf['type']!=='VIRTUAL'){var _0xe7185b={};_0xe7185b[_0x3f0bdf[_0x2181('0x4e')]]={'$like':'%'+_0x20108b[_0x2181('0x43')][_0x2181('0x4f')]+'%'};return _0xe7185b;}})});}_0x142cb3=_[_0x2181('0x4d')]({},_0x142cb3,_0x20108b[_0x2181('0x50')]);var _0x147fae={'where':_0x142cb3['where']};return db[_0x2181('0x51')][_0x2181('0x34')](_0x147fae)['then'](function(_0x32235a){_0x30c49c[_0x2181('0x34')]=_0x32235a;if(_0x20108b[_0x2181('0x43')][_0x2181('0x52')]){_0x142cb3['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x2181('0x53')](_0x142cb3);})[_0x2181('0x25')](function(_0x26be4b){_0x30c49c[_0x2181('0x54')]=_0x26be4b;return _0x30c49c;})[_0x2181('0x25')](respondWithFilteredResult(_0x2a6777,_0x142cb3))[_0x2181('0x30')](handleError(_0x2a6777,null));};exports[_0x2181('0x55')]=function(_0x498eb6,_0x40b91e){var _0x92120={'raw':!![],'where':{'id':_0x498eb6[_0x2181('0x56')]['id']}},_0x98cf67={};_0x98cf67[_0x2181('0x42')]=_[_0x2181('0x57')](db[_0x2181('0x51')][_0x2181('0x58')]);_0x98cf67[_0x2181('0x43')]=_['keys'](_0x498eb6['query']);_0x98cf67[_0x2181('0x4b')]=_[_0x2181('0x44')](_0x98cf67[_0x2181('0x42')],_0x98cf67[_0x2181('0x43')]);_0x92120[_0x2181('0x59')]=_[_0x2181('0x44')](_0x98cf67[_0x2181('0x42')],qs['fields'](_0x498eb6['query'][_0x2181('0x45')]));_0x92120[_0x2181('0x59')]=_0x92120[_0x2181('0x59')][_0x2181('0x46')]?_0x92120[_0x2181('0x59')]:_0x98cf67['model'];if(_0x498eb6[_0x2181('0x43')]['includeAll']){_0x92120['include']=[{'all':!![]}];}_0x92120=_[_0x2181('0x4d')]({},_0x92120,_0x498eb6[_0x2181('0x50')]);return db[_0x2181('0x51')][_0x2181('0x5a')](_0x92120)['then'](handleEntityNotFound(_0x40b91e,null))[_0x2181('0x25')](respondWithResult(_0x40b91e,null))['catch'](handleError(_0x40b91e,null));};exports[_0x2181('0x5b')]=function(_0x1ecf7f,_0x1581e5){return db[_0x2181('0x51')][_0x2181('0x5b')](_0x1ecf7f[_0x2181('0x5c')],{})[_0x2181('0x25')](respondWithResult(_0x1581e5,0xc9))['catch'](handleError(_0x1581e5,null));};exports[_0x2181('0x3a')]=function(_0x20d0b6,_0x4c0782){if(_0x20d0b6[_0x2181('0x5c')]['id']){delete _0x20d0b6['body']['id'];}return db[_0x2181('0x51')][_0x2181('0x5a')]({'where':{'id':_0x20d0b6[_0x2181('0x56')]['id']}})[_0x2181('0x25')](handleEntityNotFound(_0x4c0782,null))[_0x2181('0x25')](saveUpdates(_0x20d0b6['body'],null))[_0x2181('0x25')](respondWithResult(_0x4c0782,null))[_0x2181('0x30')](handleError(_0x4c0782,null));};exports[_0x2181('0x3b')]=function(_0x4d9633,_0x5f4208){return db[_0x2181('0x51')][_0x2181('0x5a')]({'where':{'id':_0x4d9633[_0x2181('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f4208,null))[_0x2181('0x25')](removeEntity(_0x5f4208,null))[_0x2181('0x30')](handleError(_0x5f4208,null));};exports[_0x2181('0x5d')]=function(_0x23fa6b,_0x3a4029){return db[_0x2181('0x51')][_0x2181('0x5d')]()[_0x2181('0x25')](respondWithResult(_0x3a4029,null))[_0x2181('0x30')](handleError(_0x3a4029,null));};var interaction_log=require(_0x2181('0x15'))(_0x2181('0x5e'));exports[_0x2181('0x5f')]=function(_0x2430de,_0x19a34d,_0x96cfa9){var _0x3dca95={'channel':'openchannel'};if(_0x2430de[_0x2181('0x5c')]['id']){delete _0x2430de[_0x2181('0x5c')]['id'];}_0x2430de[_0x2181('0x5c')]['read']=!![];_0x2430de[_0x2181('0x5c')][_0x2181('0x60')]=moment()[_0x2181('0x61')](_0x2181('0x62'));_0x2430de['body'][_0x2181('0x63')]=_0x2430de[_0x2181('0x5c')]['UserId']||_0x2430de[_0x2181('0x64')]['id'];return db[_0x2181('0x51')][_0x2181('0x5a')]({'where':{'id':_0x2430de['params']['id'],'UserId':null},'include':[{'model':db[_0x2181('0x65')],'as':_0x2181('0x66')}]})['then'](handleEntityNotFound(_0x19a34d,null))[_0x2181('0x25')](saveUpdates(_0x2430de[_0x2181('0x5c')],null))[_0x2181('0x25')](function(_0x8c661f){if(_0x8c661f){_0x3dca95[_0x2181('0x2e')]=_0x8c661f[_0x2181('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0x2181('0x5a')]({'where':{'id':_0x8c661f[_0x2181('0x68')]}});}return null;})[_0x2181('0x25')](handleEntityNotFound(_0x19a34d,null))[_0x2181('0x25')](function(_0x2e769c){if(_0x2e769c){return _0x2e769c[_0x2181('0x3a')]({'UserId':_0x2430de[_0x2181('0x5c')][_0x2181('0x63')],'read1stAt':_[_0x2181('0x69')](_0x2e769c[_0x2181('0x6a')])?moment()[_0x2181('0x61')](_0x2181('0x62')):undefined});}return null;})[_0x2181('0x25')](function(_0x26752f){if(_0x26752f){_0x3dca95[_0x2181('0x6b')]=_0x26752f[_0x2181('0x67')]({'plain':!![]});interaction_log[_0x2181('0x26')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2430de['user']['id'],_0x2430de['user'][_0x2181('0x4e')],_0x2430de[_0x2181('0x64')][_0x2181('0x6c')],_0x3dca95[_0x2181('0x6b')]['id'],_0x2430de[_0x2181('0x5c')]?JSON[_0x2181('0x2b')](_0x2430de[_0x2181('0x5c')]):_0x2181('0x6d'));return respondWithRpcPromise(_0x2181('0x6e'),_0x2181('0x6f'),_0x3dca95);}return null;})[_0x2181('0x25')](function(_0x7b5492){if(_0x7b5492){if(_0x2430de[_0x2181('0x5c')][_0x2181('0x70')]){_0x3dca95[_0x2181('0x2e')][_0x2181('0x71')]=util[_0x2181('0x61')]('SIP/%s',_0x2430de['user'][_0x2181('0x4e')]);_0x3dca95[_0x2181('0x2e')][_0x2181('0x72')]=_0x3dca95[_0x2181('0x72')];_0x3dca95[_0x2181('0x2e')]['event']=_0x2181('0x5f');return respondWithRpcPromise(_0x2181('0x73'),_0x2181('0x73'),{'event':_0x2181('0x74'),'message':_0x3dca95['message']},client9002)[_0x2181('0x25')](function(){return _0x3dca95;});}return _0x3dca95;}return null;})[_0x2181('0x25')](respondWithResult(_0x19a34d,null))[_0x2181('0x30')](handleError(_0x19a34d,null));};var interaction_log=require(_0x2181('0x15'))(_0x2181('0x5e'));exports[_0x2181('0x75')]=function(_0x2a51f6,_0x51322a,_0x5b0847){var _0x5dd3c3={'agent':{},'channel':'openchannel'};if(_0x2a51f6[_0x2181('0x5c')]['id']){delete _0x2a51f6['body']['id'];}_0x2a51f6[_0x2181('0x5c')]['UserId']=_0x2a51f6[_0x2181('0x5c')][_0x2181('0x63')]||_0x2a51f6[_0x2181('0x64')]['id'];_0x5dd3c3['agent']['id']=_0x2a51f6[_0x2181('0x5c')][_0x2181('0x63')];return db['OpenchannelMessage'][_0x2181('0x5a')]({'where':{'id':_0x2a51f6[_0x2181('0x56')]['id'],'UserId':null}})[_0x2181('0x25')](handleEntityNotFound(_0x51322a,null))[_0x2181('0x25')](function(_0x36a07a){if(_0x36a07a){_0x5dd3c3[_0x2181('0x2e')]=_0x36a07a[_0x2181('0x67')]({'plain':!![]});return db[_0x2181('0x76')]['find']({'where':{'id':_0x36a07a[_0x2181('0x68')]}});}return null;})[_0x2181('0x25')](handleEntityNotFound(_0x51322a,null))[_0x2181('0x25')](function(_0x4f6b55){if(_0x4f6b55){_0x5dd3c3['interaction']=_0x4f6b55['get']({'plain':!![]});interaction_log['info'](_0x2181('0x77'),_0x2a51f6[_0x2181('0x64')]['id'],_0x2a51f6['user'][_0x2181('0x4e')],_0x2a51f6[_0x2181('0x64')]['role'],_0x5dd3c3[_0x2181('0x6b')]['id'],_0x2a51f6[_0x2181('0x5c')]?JSON[_0x2181('0x2b')](_0x2a51f6[_0x2181('0x5c')]):_0x2181('0x6d'));return respondWithRpcPromise(_0x2181('0x78'),_0x2181('0x79'),_0x5dd3c3);}return null;})['then'](function(_0x5c2597){if(_0x5c2597){_0x5c2597[_0x2181('0x2e')][_0x2181('0x71')]=util[_0x2181('0x61')](_0x2181('0x7a'),_0x2a51f6['user'][_0x2181('0x4e')]);_0x5c2597[_0x2181('0x2e')][_0x2181('0x72')]=_0x5dd3c3[_0x2181('0x72')];_0x5c2597['message']['event']='reject';respondWithRpcPromise('EventManager',_0x2181('0x73'),{'event':_0x2181('0x7b'),'message':_0x5c2597[_0x2181('0x2e')]},client9002);return _0x5dd3c3;}return null;})[_0x2181('0x25')](respondWithResult(_0x51322a,null))['catch'](handleError(_0x51322a,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 15c6f53..65df5a1 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 _0x0a05=['events','../../mysqldb','OpenchannelMessage','setMaxListeners','emit','hasOwnProperty','exports'];(function(_0x77d310,_0x2b2fe7){var _0x2cdce4=function(_0xbaa481){while(--_0xbaa481){_0x77d310['push'](_0x77d310['shift']());}};_0x2cdce4(++_0x2b2fe7);}(_0x0a05,0xa1));var _0x50a0=function(_0x55291a,_0x814018){_0x55291a=_0x55291a-0x0;var _0x3c870c=_0x0a05[_0x55291a];return _0x3c870c;};'use strict';var EventEmitter=require(_0x50a0('0x0'));var OpenchannelMessage=require(_0x50a0('0x1'))['db'][_0x50a0('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x50a0('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4787fc){return function(_0x454dfb,_0x24424f,_0x177fb5){OpenchannelMessageEvents[_0x50a0('0x4')](_0x4787fc+':'+_0x454dfb['id'],_0x454dfb);OpenchannelMessageEvents[_0x50a0('0x4')](_0x4787fc,_0x454dfb);_0x177fb5(null);};}for(var e in events){if(events[_0x50a0('0x5')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x50a0('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x60a6=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3de554,_0x81aa00){var _0xa9eed0=function(_0x34ab97){while(--_0x34ab97){_0x3de554['push'](_0x3de554['shift']());}};_0xa9eed0(++_0x81aa00);}(_0x60a6,0xbd));var _0x660a=function(_0xb10487,_0x26fc6a){_0xb10487=_0xb10487-0x0;var _0x289fd6=_0x60a6[_0xb10487];return _0x289fd6;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x660a('0x0'))['db'][_0x660a('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x660a('0x2')](0x0);var events={'afterCreate':_0x660a('0x3'),'afterUpdate':_0x660a('0x4'),'afterDestroy':_0x660a('0x5')};function emitEvent(_0x120f78){return function(_0x4e0d4b,_0x5096e8,_0x57734b){OpenchannelMessageEvents[_0x660a('0x6')](_0x120f78+':'+_0x4e0d4b['id'],_0x4e0d4b);OpenchannelMessageEvents[_0x660a('0x6')](_0x120f78,_0x4e0d4b);_0x57734b(null);};}for(var e in events){if(events[_0x660a('0x7')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x660a('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index ea5da71..cf8084c 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 _0x207c=['FULLTEXT','models','get','toLowerCase','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','direction','catch','out','CmContact','OpenchannelAccount','OpenchannelAccountId','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','update','error','inspect','finally','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define','OpenchannelMessage','fti_openchannel_messages','body'];(function(_0x150b66,_0x50694e){var _0x1502a1=function(_0x540eea){while(--_0x540eea){_0x150b66['push'](_0x150b66['shift']());}};_0x1502a1(++_0x50694e);}(_0x207c,0x1e8));var _0xc207=function(_0x3b0d98,_0x346f06){_0x3b0d98=_0x3b0d98-0x0;var _0x296885=_0x207c[_0x3b0d98];return _0x296885;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var logger=require(_0xc207('0x1'))(_0xc207('0x2'));var moment=require(_0xc207('0x3'));var BPromise=require(_0xc207('0x4'));var rp=require(_0xc207('0x5'));var fs=require('fs');var path=require(_0xc207('0x6'));var rimraf=require('rimraf');var config=require(_0xc207('0x7'));var attributes=require('./openchannelMessage.attributes');module['exports']=function(_0x55023e,_0xc88789){return _0x55023e[_0xc207('0x8')](_0xc207('0x9'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc207('0xa'),'fields':[_0xc207('0xb')],'type':_0xc207('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4e10e8,_0xffae6c,_0x817576){var _0x216e14=_0x55023e[_0xc207('0xd')];var _0x201162=_0x4e10e8[_0xc207('0xe')]({'plain':!![]});if(_0x201162['direction']['toLowerCase']()==='in'||_0x201162['direction'][_0xc207('0xf')]()==='out'&&!_0x201162[_0xc207('0x10')]&&!_[_0xc207('0x11')](_0x201162['UserId'])){_0x216e14[_0xc207('0x12')][_0xc207('0x13')]({'where':{'id':_0x201162[_0xc207('0x14')]}})[_0xc207('0x15')](function(_0xe993a0){if(_0xe993a0){_0xe993a0['update']({'lastMsgAt':_0x201162[_0xc207('0x16')],'lastMsgDirection':_0x201162[_0xc207('0x17')][_0xc207('0xf')]()});}})[_0xc207('0x18')](function(_0x4ef6c4){console['error'](_0x4ef6c4);});}if(_0x201162['direction']===_0xc207('0x19')&&!_0x201162[_0xc207('0x10')]){var _0x3d9c7b;_0x216e14[_0xc207('0x1a')]['describe']()[_0xc207('0x15')](function(_0x282595){return _0x216e14[_0xc207('0x1b')]['find']({'where':{'id':_0x201162[_0xc207('0x1c')]},'include':[{'model':_0x216e14['OpenchannelInteraction'],'as':_0xc207('0x1d'),'where':{'id':_0x201162[_0xc207('0x14')]},'limit':0x1,'include':[{'model':_0x216e14[_0xc207('0x1a')],'as':_0xc207('0x1e'),'attributes':_[_0xc207('0x1f')](_0x282595)}]}]});})[_0xc207('0x15')](function(_0x35c0b0){_0x3d9c7b=_0x35c0b0[_0xc207('0xe')]({'plain':!![]});if(_0x3d9c7b&&_0x3d9c7b[_0xc207('0x20')]){logger[_0xc207('0x21')](_0xc207('0x22'),_0xc207('0x23'),util[_0xc207('0x24')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x201162['id'],_0x3d9c7b[_0xc207('0x20')]));if(_0x3d9c7b['Interactions']&&_0x3d9c7b[_0xc207('0x1d')][_0xc207('0x25')]){_0x201162[_0xc207('0x26')]=_[_0xc207('0x27')](_0x3d9c7b[_0xc207('0x1d')][0x0],_0xc207('0x1e'));_0x201162[_0xc207('0x1e')]=_0x3d9c7b[_0xc207('0x1d')][0x0][_0xc207('0x1e')];}var _0xffae6c={'method':_0xc207('0x28'),'uri':encodeURI(_0x3d9c7b[_0xc207('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xffae6c[_0xc207('0x29')]){case _0xc207('0x2a'):_0xffae6c['qs']=_0x201162;break;case _0xc207('0x28'):_0xffae6c['body']=_0x201162;break;}return rp(_0xffae6c)[_0xc207('0x15')](function(_0x5e0bd1){logger['info'](_0xc207('0x22'),_0xc207('0x23'),util[_0xc207('0x24')](_0xc207('0x2b'),_0x201162['id'],_0x3d9c7b[_0xc207('0x20')]));if(_0x5e0bd1['body'][_0xc207('0x2c')]&&_0x5e0bd1[_0xc207('0xb')][_0xc207('0x2c')]!=_0x201162[_0xc207('0x26')][_0xc207('0x2c')]){return _0x216e14[_0xc207('0x12')][_0xc207('0x2d')]({'threadId':_0x5e0bd1[_0xc207('0xb')][_0xc207('0x2c')]},{'logging':!![],'where':{'id':_0x201162[_0xc207('0x26')]['id']}});}else{return;}})[_0xc207('0x15')](function(){return _0x4e10e8[_0xc207('0x2d')]({'read':!![]});})[_0xc207('0x18')](function(_0x5824e5){logger[_0xc207('0x2e')](_0xc207('0x22'),_0xc207('0x23'),util[_0xc207('0x2f')](_0x5824e5,{'showHidden':![],'depth':null}));_0x817576();});}else{_0x817576();}})[_0xc207('0x30')](function(){_0x817576();});}else{_0x817576();}}},'charset':_0xc207('0x31'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb7a8=['OpenchannelAccount','OpenchannelAccountId','Contact','keys','replyUri','info','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','error','inspect','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','update','createdAt','out','CmContact','then'];(function(_0x3f52ee,_0x468aab){var _0x4f7924=function(_0x405846){while(--_0x405846){_0x3f52ee['push'](_0x3f52ee['shift']());}};_0x4f7924(++_0x468aab);}(_0xb7a8,0xec));var _0x8b7a=function(_0x2081b7,_0xc372c){_0x2081b7=_0x2081b7-0x0;var _0x52ecc4=_0xb7a8[_0x2081b7];return _0x52ecc4;};'use strict';var _=require('lodash');var util=require(_0x8b7a('0x0'));var logger=require(_0x8b7a('0x1'))('api');var moment=require(_0x8b7a('0x2'));var BPromise=require(_0x8b7a('0x3'));var rp=require(_0x8b7a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b7a('0x5'));var config=require(_0x8b7a('0x6'));var attributes=require(_0x8b7a('0x7'));module[_0x8b7a('0x8')]=function(_0x1d61f3,_0x42e4c1){return _0x1d61f3[_0x8b7a('0x9')](_0x8b7a('0xa'),attributes,{'tableName':_0x8b7a('0xb'),'paranoid':![],'indexes':[{'name':_0x8b7a('0xc'),'fields':[_0x8b7a('0xd')],'type':_0x8b7a('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x517818,_0x138031,_0x55f130){var _0x456ae9=_0x1d61f3[_0x8b7a('0xf')];var _0x4796b6=_0x517818[_0x8b7a('0x10')]({'plain':!![]});if(_0x4796b6[_0x8b7a('0x11')][_0x8b7a('0x12')]()==='in'||_0x4796b6['direction'][_0x8b7a('0x12')]()==='out'&&!_0x4796b6[_0x8b7a('0x13')]&&!_[_0x8b7a('0x14')](_0x4796b6[_0x8b7a('0x15')])){_0x456ae9[_0x8b7a('0x16')]['findOne']({'where':{'id':_0x4796b6[_0x8b7a('0x17')]}})['then'](function(_0x39c91f){if(_0x39c91f){_0x39c91f[_0x8b7a('0x18')]({'lastMsgAt':_0x4796b6[_0x8b7a('0x19')],'lastMsgDirection':_0x4796b6['direction']['toLowerCase']()});}})['catch'](function(_0x2bee4c){console['error'](_0x2bee4c);});}if(_0x4796b6[_0x8b7a('0x11')]===_0x8b7a('0x1a')&&!_0x4796b6[_0x8b7a('0x13')]){var _0x21a0be;_0x456ae9[_0x8b7a('0x1b')]['describe']()[_0x8b7a('0x1c')](function(_0x1d0031){return _0x456ae9[_0x8b7a('0x1d')]['find']({'where':{'id':_0x4796b6[_0x8b7a('0x1e')]},'include':[{'model':_0x456ae9[_0x8b7a('0x16')],'as':'Interactions','where':{'id':_0x4796b6['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x456ae9['CmContact'],'as':_0x8b7a('0x1f'),'attributes':_[_0x8b7a('0x20')](_0x1d0031)}]}]});})[_0x8b7a('0x1c')](function(_0x2da603){_0x21a0be=_0x2da603[_0x8b7a('0x10')]({'plain':!![]});if(_0x21a0be&&_0x21a0be[_0x8b7a('0x21')]){logger[_0x8b7a('0x22')]('OpenchannelMessage,\x20%s,\x20%s',_0x8b7a('0x23'),util[_0x8b7a('0x24')](_0x8b7a('0x25'),_0x4796b6['id'],_0x21a0be[_0x8b7a('0x21')]));if(_0x21a0be[_0x8b7a('0x26')]&&_0x21a0be['Interactions'][_0x8b7a('0x27')]){_0x4796b6[_0x8b7a('0x28')]=_[_0x8b7a('0x29')](_0x21a0be[_0x8b7a('0x26')][0x0],_0x8b7a('0x1f'));_0x4796b6[_0x8b7a('0x1f')]=_0x21a0be[_0x8b7a('0x26')][0x0][_0x8b7a('0x1f')];}var _0x138031={'method':_0x8b7a('0x2a'),'uri':encodeURI(_0x21a0be['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x138031[_0x8b7a('0x2b')]){case _0x8b7a('0x2c'):_0x138031['qs']=_0x4796b6;break;case'POST':_0x138031[_0x8b7a('0xd')]=_0x4796b6;break;}return rp(_0x138031)[_0x8b7a('0x1c')](function(_0x49f9c7){logger['info'](_0x8b7a('0x2d'),_0x8b7a('0x23'),util[_0x8b7a('0x24')](_0x8b7a('0x2e'),_0x4796b6['id'],_0x21a0be[_0x8b7a('0x21')]));if(_0x49f9c7[_0x8b7a('0xd')][_0x8b7a('0x2f')]&&_0x49f9c7['body'][_0x8b7a('0x2f')]!=_0x4796b6[_0x8b7a('0x28')][_0x8b7a('0x2f')]){return _0x456ae9['OpenchannelInteraction'][_0x8b7a('0x18')]({'threadId':_0x49f9c7[_0x8b7a('0xd')][_0x8b7a('0x2f')]},{'logging':!![],'where':{'id':_0x4796b6['Interaction']['id']}});}else{return;}})[_0x8b7a('0x1c')](function(){return _0x517818[_0x8b7a('0x18')]({'read':!![]});})[_0x8b7a('0x30')](function(_0x5b0b86){logger[_0x8b7a('0x31')](_0x8b7a('0x2d'),_0x8b7a('0x23'),util[_0x8b7a('0x32')](_0x5b0b86,{'showHidden':![],'depth':null}));_0x55f130();});}else{_0x55f130();}})['finally'](function(){_0x55f130();});}else{_0x55f130();}}},'charset':_0x8b7a('0x33'),'collate':_0x8b7a('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 19e0602..dfa146a 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 _0xf78f=['client','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','OpenchannelMessage','body','options','raw','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1baa84,_0x3c938e){var _0x18523b=function(_0x120137){while(--_0x120137){_0x1baa84['push'](_0x1baa84['shift']());}};_0x18523b(++_0x3c938e);}(_0xf78f,0x72));var _0xff78=function(_0x3375d0,_0x41d358){_0x3375d0=_0x3375d0-0x0;var _0xd53529=_0xf78f[_0x3375d0];return _0xd53529;};'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});config[_0xff78('0x7')]=_[_0xff78('0x8')](config[_0xff78('0x7')],{'host':_0xff78('0x9'),'port':0x18eb});var socket=require(_0xff78('0xa'))(new Redis(config[_0xff78('0x7')]));require(_0xff78('0xb'))[_0xff78('0xc')](socket);function respondWithRpcPromise(_0x4f9abd,_0x4eaba5,_0x36dfa4){return new BPromise(function(_0xa55092,_0x1ea7d4){return client[_0xff78('0xd')](_0x4f9abd,_0x36dfa4)[_0xff78('0xe')](function(_0x2e22e3){logger[_0xff78('0xf')](_0xff78('0x10'),_0x4eaba5,'request\x20sent');logger[_0xff78('0x11')](_0xff78('0x12'),_0x4eaba5,'request\x20sent',JSON[_0xff78('0x13')](_0x2e22e3));if(_0x2e22e3['error']){if(_0x2e22e3[_0xff78('0x14')]['code']===0x1f4){logger[_0xff78('0x14')](_0xff78('0x10'),_0x4eaba5,_0x2e22e3[_0xff78('0x14')][_0xff78('0x15')]);return _0x1ea7d4(_0x2e22e3['error'][_0xff78('0x15')]);}logger[_0xff78('0x14')](_0xff78('0x10'),_0x4eaba5,_0x2e22e3[_0xff78('0x14')][_0xff78('0x15')]);return _0xa55092(_0x2e22e3[_0xff78('0x14')][_0xff78('0x15')]);}else{logger['info'](_0xff78('0x10'),_0x4eaba5,_0xff78('0x16'));_0xa55092(_0x2e22e3[_0xff78('0x17')][_0xff78('0x15')]);}})[_0xff78('0x18')](function(_0x41a06e){logger[_0xff78('0x14')](_0xff78('0x10'),_0x4eaba5,_0x41a06e);_0x1ea7d4(_0x41a06e);});});}exports['CreateOpenchannelMessage']=function(_0x279494){var _0x126f6c=this;return new Promise(function(_0x198452,_0x4dd9fa){return db[_0xff78('0x19')]['create'](_0x279494[_0xff78('0x1a')],{'raw':_0x279494[_0xff78('0x1b')]?_0x279494[_0xff78('0x1b')][_0xff78('0x1c')]===undefined?!![]:![]:!![]})[_0xff78('0xe')](function(_0x4ebf5e){logger['info'](_0xff78('0x1d'),_0x279494);logger[_0xff78('0x11')](_0xff78('0x1d'),_0x279494,JSON[_0xff78('0x13')](_0x4ebf5e));_0x198452(_0x4ebf5e);})[_0xff78('0x18')](function(_0x2161b6){logger[_0xff78('0x14')](_0xff78('0x1d'),_0x2161b6['message'],_0x279494);_0x4dd9fa(_0x126f6c[_0xff78('0x14')](0x1f4,_0x2161b6[_0xff78('0x15')]));});});}; \ No newline at end of file +var _0x9e54=['info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','OpenchannelMessage,\x20%s,\x20%s','result','catch','create','body','options','raw','CreateOpenchannelMessage','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','defaults','localhost','socket.io-emitter','redis','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9e54,0x88));var _0x49e5=function(_0x3bffe9,_0x1f4453){_0x3bffe9=_0x3bffe9-0x0;var _0x499f82=_0x9e54[_0x3bffe9];return _0x499f82;};'use strict';var _=require(_0x49e5('0x0'));var util=require(_0x49e5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49e5('0x2'));var db=require(_0x49e5('0x3'))['db'];var utils=require(_0x49e5('0x4'));var logger=require('../../config/logger')(_0x49e5('0x5'));var config=require(_0x49e5('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49e5('0x7')]['http']({'port':0x232a});config['redis']=_[_0x49e5('0x8')](config['redis'],{'host':_0x49e5('0x9'),'port':0x18eb});var socket=require(_0x49e5('0xa'))(new Redis(config[_0x49e5('0xb')]));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3cee11,_0x5e0dfa,_0x45c7cd){return new BPromise(function(_0x22aec5,_0x134034){return client[_0x49e5('0xc')](_0x3cee11,_0x45c7cd)[_0x49e5('0xd')](function(_0x51cf9b){logger[_0x49e5('0xe')]('OpenchannelMessage,\x20%s,\x20%s',_0x5e0dfa,_0x49e5('0xf'));logger[_0x49e5('0x10')](_0x49e5('0x11'),_0x5e0dfa,_0x49e5('0xf'),JSON[_0x49e5('0x12')](_0x51cf9b));if(_0x51cf9b['error']){if(_0x51cf9b['error'][_0x49e5('0x13')]===0x1f4){logger[_0x49e5('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x5e0dfa,_0x51cf9b['error'][_0x49e5('0x15')]);return _0x134034(_0x51cf9b['error'][_0x49e5('0x15')]);}logger['error'](_0x49e5('0x16'),_0x5e0dfa,_0x51cf9b[_0x49e5('0x14')][_0x49e5('0x15')]);return _0x22aec5(_0x51cf9b['error'][_0x49e5('0x15')]);}else{logger[_0x49e5('0xe')](_0x49e5('0x16'),_0x5e0dfa,_0x49e5('0xf'));_0x22aec5(_0x51cf9b[_0x49e5('0x17')][_0x49e5('0x15')]);}})[_0x49e5('0x18')](function(_0x4dca4f){logger[_0x49e5('0x14')](_0x49e5('0x16'),_0x5e0dfa,_0x4dca4f);_0x134034(_0x4dca4f);});});}exports['CreateOpenchannelMessage']=function(_0x2370ad){var _0x5b13ed=this;return new Promise(function(_0x305b4c,_0x2b1bbe){return db['OpenchannelMessage'][_0x49e5('0x19')](_0x2370ad[_0x49e5('0x1a')],{'raw':_0x2370ad[_0x49e5('0x1b')]?_0x2370ad[_0x49e5('0x1b')][_0x49e5('0x1c')]===undefined?!![]:![]:!![]})[_0x49e5('0xd')](function(_0x5e8569){logger[_0x49e5('0xe')]('CreateOpenchannelMessage',_0x2370ad);logger[_0x49e5('0x10')](_0x49e5('0x1d'),_0x2370ad,JSON[_0x49e5('0x12')](_0x5e8569));_0x305b4c(_0x5e8569);})[_0x49e5('0x18')](function(_0x25ecb9){logger[_0x49e5('0x14')]('CreateOpenchannelMessage',_0x25ecb9['message'],_0x2370ad);_0x2b1bbe(_0x5b13ed[_0x49e5('0x14')](0x1f4,_0x25ecb9[_0x49e5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 89779c1..90f86e5 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 _0xb43b=['./openchannelMessage.events','save','update','emit','removeListener','length','openchannelMessage:'];(function(_0x3804da,_0x4b1678){var _0x1038e3=function(_0x46dbaf){while(--_0x46dbaf){_0x3804da['push'](_0x3804da['shift']());}};_0x1038e3(++_0x4b1678);}(_0xb43b,0x1b2));var _0xbb43=function(_0x38f6d1,_0xd5f8b9){_0x38f6d1=_0x38f6d1-0x0;var _0x2ecab5=_0xb43b[_0x38f6d1];return _0x2ecab5;};'use strict';var OpenchannelMessageEvents=require(_0xbb43('0x0'));var events=[_0xbb43('0x1'),'remove',_0xbb43('0x2')];function createListener(_0x1995f8,_0x22bc86){return function(_0x4cf605){_0x22bc86[_0xbb43('0x3')](_0x1995f8,_0x4cf605);};}function removeListener(_0x41aff6,_0x351254){return function(){OpenchannelMessageEvents[_0xbb43('0x4')](_0x41aff6,_0x351254);};}exports['register']=function(_0x491fb9){for(var _0x378df5=0x0,_0x553520=events[_0xbb43('0x5')];_0x378df5<_0x553520;_0x378df5++){var _0x1ccd49=events[_0x378df5];var _0x2a2f11=createListener(_0xbb43('0x6')+_0x1ccd49,_0x491fb9);OpenchannelMessageEvents['on'](_0x1ccd49,_0x2a2f11);}}; \ No newline at end of file +var _0xf4eb=['removeListener','register','./openchannelMessage.events'];(function(_0x229522,_0x8ba349){var _0x27e326=function(_0x4b12af){while(--_0x4b12af){_0x229522['push'](_0x229522['shift']());}};_0x27e326(++_0x8ba349);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2ea20a,_0x27ceff){_0x2ea20a=_0x2ea20a-0x0;var _0x52b51e=_0xf4eb[_0x2ea20a];return _0x52b51e;};'use strict';var OpenchannelMessageEvents=require(_0xbf4e('0x0'));var events=['save','remove','update'];function createListener(_0x5ed5b9,_0xbbbf01){return function(_0x49d80e){_0xbbbf01['emit'](_0x5ed5b9,_0x49d80e);};}function removeListener(_0x2e3070,_0x1c7606){return function(){OpenchannelMessageEvents[_0xbf4e('0x1')](_0x2e3070,_0x1c7606);};}exports[_0xbf4e('0x2')]=function(_0xa4dcf5){for(var _0x2fcfed=0x0,_0x15b99f=events['length'];_0x2fcfed<_0x15b99f;_0x2fcfed++){var _0x449d55=events[_0x2fcfed];var _0x5013c2=createListener('openchannelMessage:'+_0x449d55,_0xa4dcf5);OpenchannelMessageEvents['on'](_0x449d55,_0x5013c2);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index fafb25f..83162bd 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 _0x2159=['./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','post','addAgents','delete','destroy','/:id/teams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x282072,_0x19ef05){var _0x52bd3b=function(_0x25f9e3){while(--_0x25f9e3){_0x282072['push'](_0x282072['shift']());}};_0x52bd3b(++_0x19ef05);}(_0x2159,0x17f));var _0x9215=function(_0x2d5818,_0xc9aa8b){_0x2d5818=_0x2d5818-0x0;var _0x1d1e9d=_0x2159[_0x2d5818];return _0x1d1e9d;};'use strict';var multer=require(_0x9215('0x0'));var util=require(_0x9215('0x1'));var path=require(_0x9215('0x2'));var timeout=require(_0x9215('0x3'));var express=require('express');var router=express[_0x9215('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9215('0x5'));var config=require(_0x9215('0x6'));var controller=require(_0x9215('0x7'));router[_0x9215('0x8')]('/',auth[_0x9215('0x9')](),controller[_0x9215('0xa')]);router[_0x9215('0x8')](_0x9215('0xb'),auth['isAuthenticated'](),controller[_0x9215('0xc')]);router[_0x9215('0x8')](_0x9215('0xd'),auth[_0x9215('0x9')](),controller[_0x9215('0xe')]);router['get'](_0x9215('0xf'),auth[_0x9215('0x9')](),controller[_0x9215('0x10')]);router[_0x9215('0x8')]('/:id/teams',auth[_0x9215('0x9')](),controller[_0x9215('0x11')]);router['get'](_0x9215('0x12'),auth[_0x9215('0x9')](),controller['getAgents']);router[_0x9215('0x13')]('/',auth[_0x9215('0x9')](),controller['create']);router[_0x9215('0x13')]('/:id/teams',auth[_0x9215('0x9')](),controller['addTeams']);router[_0x9215('0x13')](_0x9215('0x12'),auth[_0x9215('0x9')](),controller[_0x9215('0x14')]);router['put'](_0x9215('0xd'),auth[_0x9215('0x9')](),controller['update']);router[_0x9215('0x15')](_0x9215('0xd'),auth[_0x9215('0x9')](),controller[_0x9215('0x16')]);router[_0x9215('0x15')](_0x9215('0x17'),auth[_0x9215('0x9')](),controller['removeTeams']);router[_0x9215('0x15')](_0x9215('0x12'),auth[_0x9215('0x9')](),controller[_0x9215('0x18')]);module[_0x9215('0x19')]=router; \ No newline at end of file +var _0xa647=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','delete','removeAgents','multer','util','path','connect-timeout','express','Router'];(function(_0x4b6830,_0x2bf6fb){var _0x239e4a=function(_0x364735){while(--_0x364735){_0x4b6830['push'](_0x4b6830['shift']());}};_0x239e4a(++_0x2bf6fb);}(_0xa647,0x81));var _0x7a64=function(_0x45c1cf,_0x36f5cc){_0x45c1cf=_0x45c1cf-0x0;var _0x54fe02=_0xa647[_0x45c1cf];return _0x54fe02;};'use strict';var multer=require(_0x7a64('0x0'));var util=require(_0x7a64('0x1'));var path=require(_0x7a64('0x2'));var timeout=require(_0x7a64('0x3'));var express=require(_0x7a64('0x4'));var router=express[_0x7a64('0x5')]();var auth=require(_0x7a64('0x6'));var interaction=require(_0x7a64('0x7'));var config=require(_0x7a64('0x8'));var controller=require(_0x7a64('0x9'));router[_0x7a64('0xa')]('/',auth[_0x7a64('0xb')](),controller['index']);router[_0x7a64('0xa')](_0x7a64('0xc'),auth['isAuthenticated'](),controller[_0x7a64('0xd')]);router[_0x7a64('0xa')](_0x7a64('0xe'),auth[_0x7a64('0xb')](),controller[_0x7a64('0xf')]);router[_0x7a64('0xa')](_0x7a64('0x10'),auth[_0x7a64('0xb')](),controller[_0x7a64('0x11')]);router[_0x7a64('0xa')](_0x7a64('0x12'),auth[_0x7a64('0xb')](),controller[_0x7a64('0x13')]);router['get'](_0x7a64('0x14'),auth[_0x7a64('0xb')](),controller['getAgents']);router[_0x7a64('0x15')]('/',auth[_0x7a64('0xb')](),controller[_0x7a64('0x16')]);router['post'](_0x7a64('0x12'),auth[_0x7a64('0xb')](),controller[_0x7a64('0x17')]);router[_0x7a64('0x15')](_0x7a64('0x14'),auth[_0x7a64('0xb')](),controller[_0x7a64('0x18')]);router['put'](_0x7a64('0xe'),auth[_0x7a64('0xb')](),controller['update']);router[_0x7a64('0x19')](_0x7a64('0xe'),auth[_0x7a64('0xb')](),controller['destroy']);router[_0x7a64('0x19')]('/:id/teams',auth[_0x7a64('0xb')](),controller['removeTeams']);router[_0x7a64('0x19')]('/:id/users',auth[_0x7a64('0xb')](),controller[_0x7a64('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index d983a75..97f7c27 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 _0x9627=['name','INTEGER','rrmemory','sequelize','STRING'];(function(_0x1d214f,_0x1d1a3d){var _0x651ef=function(_0x9a032e){while(--_0x9a032e){_0x1d214f['push'](_0x1d214f['shift']());}};_0x651ef(++_0x1d1a3d);}(_0x9627,0x8a));var _0x7962=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9627[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x7962('0x0'));module['exports']={'name':{'type':Sequelize[_0x7962('0x1')],'unique':_0x7962('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7962('0x1')]},'timeout':{'type':Sequelize[_0x7962('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7962('0x4'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x5532=['rrmemory','beepall','sequelize','exports','STRING','ENUM'];(function(_0xa7a246,_0x2bdd15){var _0x264612=function(_0x5e52fa){while(--_0x5e52fa){_0xa7a246['push'](_0xa7a246['shift']());}};_0x264612(++_0x2bdd15);}(_0x5532,0x19a));var _0x2553=function(_0x2ca912,_0xf32139){_0x2ca912=_0x2ca912-0x0;var _0x41340f=_0x5532[_0x2ca912];return _0x41340f;};'use strict';var Sequelize=require(_0x2553('0x0'));module[_0x2553('0x1')]={'name':{'type':Sequelize[_0x2553('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2553('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2553('0x3')](_0x2553('0x4'),_0x2553('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index eba4154..005fdf7 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 _0x2337=['filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','params','find','create','body','user','get','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','clone','toString','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','spread','userOpenchannelQueue:save','isArray','getAgents','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','path','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','key','model','map','query','keys'];(function(_0x123450,_0x491c01){var _0x23b29d=function(_0x2c23cb){while(--_0x2c23cb){_0x123450['push'](_0x123450['shift']());}};_0x23b29d(++_0x491c01);}(_0x2337,0x15c));var _0x7233=function(_0x5ef108,_0x5e23ba){_0x5ef108=_0x5ef108-0x0;var _0xef5d96=_0x2337[_0x5ef108];return _0xef5d96;};'use strict';var pdf=require(_0x7233('0x0'));var emlformat=require(_0x7233('0x1'));var rimraf=require(_0x7233('0x2'));var zipdir=require(_0x7233('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7233('0x4'));var moment=require(_0x7233('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7233('0x6'));var sox=require('sox');var csv=require(_0x7233('0x7'));var ejs=require(_0x7233('0x8'));var fs=require('fs');var _=require(_0x7233('0x9'));var squel=require('squel');var crypto=require(_0x7233('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7233('0xb'));var toCsv=require(_0x7233('0x7'));var querystring=require('querystring');var Papa=require(_0x7233('0xc'));var Redis=require(_0x7233('0xd'));var authService=require(_0x7233('0xe'));var qs=require(_0x7233('0xf'));var as=require(_0x7233('0x10'));var hardwareService=require(_0x7233('0x11'));var logger=require(_0x7233('0x12'))(_0x7233('0x13'));var utils=require('../../config/utils');var config=require(_0x7233('0x14'));var db=require('../../mysqldb')['db'];config[_0x7233('0x15')]=_[_0x7233('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7233('0x17'))(new Redis(config['redis']));require(_0x7233('0x18'))[_0x7233('0x19')](socket);function respondWithStatusCode(_0x526a8f,_0xb155ee){_0xb155ee=_0xb155ee||0xcc;return function(_0x483eae){if(_0x483eae){return _0x526a8f[_0x7233('0x1a')](_0xb155ee);}return _0x526a8f[_0x7233('0x1b')](_0xb155ee)[_0x7233('0x1c')]();};}function respondWithResult(_0x47422d,_0x14fad7){_0x14fad7=_0x14fad7||0xc8;return function(_0x2663a1){if(_0x2663a1){return _0x47422d['status'](_0x14fad7)[_0x7233('0x1d')](_0x2663a1);}};}function respondWithFilteredResult(_0x37d73b,_0x193755){return function(_0x3bf3a0){if(_0x3bf3a0){var _0x49b3be=_0x3bf3a0[_0x7233('0x1e')],_0x2340c7=_0x193755[_0x7233('0x1f')],_0x3cb7fd=_0x193755[_0x7233('0x1f')]+_0x193755[_0x7233('0x20')],_0x224799;if(_0x3cb7fd>=_0x49b3be){_0x3cb7fd=_0x49b3be;_0x224799=0xc8;}else{_0x224799=0xce;}_0x37d73b['status'](_0x224799);return _0x37d73b[_0x7233('0x21')]('Content-Range',_0x2340c7+'-'+_0x3cb7fd+'/'+_0x49b3be)[_0x7233('0x1d')](_0x3bf3a0);}return null;};}function patchUpdates(_0xac785e){return function(_0x59f6df){try{jsonpatch[_0x7233('0x22')](_0x59f6df,_0xac785e,!![]);}catch(_0x263903){return BPromise['reject'](_0x263903);}return _0x59f6df[_0x7233('0x23')]();};}function saveUpdates(_0x32badd,_0x1074e5){return function(_0x4c5c77){if(_0x4c5c77){return _0x4c5c77[_0x7233('0x24')](_0x32badd)[_0x7233('0x25')](function(_0x18a104){return _0x18a104;});}return null;};}function removeEntity(_0x39b806,_0x5caa04){return function(_0x11277d){if(_0x11277d){return _0x11277d[_0x7233('0x26')]()['then'](function(){var _0x2ca1da=_0x11277d['get']({'plain':!![]});var _0x1fdcc6=_0x7233('0x27');return db[_0x7233('0x28')]['destroy']({'where':{'type':_0x1fdcc6,'resourceId':_0x2ca1da['id']}})[_0x7233('0x25')](function(){return _0x11277d;});})['then'](function(){_0x39b806[_0x7233('0x1b')](0xcc)[_0x7233('0x1c')]();});}};}function handleEntityNotFound(_0x2ea9b0,_0x2b75d5){return function(_0x309681){if(!_0x309681){_0x2ea9b0[_0x7233('0x1a')](0x194);}return _0x309681;};}function handleError(_0x3a35cc,_0x239d82){_0x239d82=_0x239d82||0x1f4;return function(_0x13e7ba){logger[_0x7233('0x29')](_0x13e7ba['stack']);if(_0x13e7ba[_0x7233('0x2a')]){delete _0x13e7ba[_0x7233('0x2a')];}_0x3a35cc[_0x7233('0x1b')](_0x239d82)[_0x7233('0x2b')](_0x13e7ba);};}exports[_0x7233('0x2c')]=function(_0xf32776,_0x1774c3){var _0x104296={},_0x10c068={},_0x61e6ed={'count':0x0,'rows':[]};var _0x1c6adf=_['map'](db[_0x7233('0x2d')][_0x7233('0x2e')],function(_0x370656){return{'name':_0x370656[_0x7233('0x2f')],'type':_0x370656[_0x7233('0x30')][_0x7233('0x31')]};});_0x10c068[_0x7233('0x32')]=_[_0x7233('0x33')](_0x1c6adf,_0x7233('0x2a'));_0x10c068[_0x7233('0x34')]=_[_0x7233('0x35')](_0xf32776[_0x7233('0x34')]);_0x10c068[_0x7233('0x36')]=_[_0x7233('0x37')](_0x10c068['model'],_0x10c068[_0x7233('0x34')]);_0x104296[_0x7233('0x38')]=_['intersection'](_0x10c068[_0x7233('0x32')],qs[_0x7233('0x39')](_0xf32776[_0x7233('0x34')][_0x7233('0x39')]));_0x104296[_0x7233('0x38')]=_0x104296['attributes'][_0x7233('0x3a')]?_0x104296['attributes']:_0x10c068[_0x7233('0x32')];if(!_0xf32776[_0x7233('0x34')]['hasOwnProperty']('nolimit')){_0x104296[_0x7233('0x20')]=qs[_0x7233('0x20')](_0xf32776[_0x7233('0x34')][_0x7233('0x20')]);_0x104296[_0x7233('0x1f')]=qs[_0x7233('0x1f')](_0xf32776[_0x7233('0x34')][_0x7233('0x1f')]);}_0x104296[_0x7233('0x3b')]=qs['sort'](_0xf32776[_0x7233('0x34')][_0x7233('0x3c')]);_0x104296[_0x7233('0x3d')]=qs['filters'](_[_0x7233('0x3e')](_0xf32776['query'],_0x10c068[_0x7233('0x36')]),_0x1c6adf);if(_0xf32776[_0x7233('0x34')][_0x7233('0x3f')]){_0x104296[_0x7233('0x3d')]=_['merge'](_0x104296['where'],{'$or':_[_0x7233('0x33')](_0x1c6adf,function(_0x3bdc98){if(_0x3bdc98[_0x7233('0x30')]!=='VIRTUAL'){var _0x4a08c7={};_0x4a08c7[_0x3bdc98[_0x7233('0x2a')]]={'$like':'%'+_0xf32776[_0x7233('0x34')]['filter']+'%'};return _0x4a08c7;}})});}_0x104296=_[_0x7233('0x40')]({},_0x104296,_0xf32776[_0x7233('0x41')]);var _0xc43604={'where':_0x104296[_0x7233('0x3d')]};return db[_0x7233('0x2d')][_0x7233('0x1e')](_0xc43604)[_0x7233('0x25')](function(_0x2269b2){_0x61e6ed[_0x7233('0x1e')]=_0x2269b2;if(_0xf32776[_0x7233('0x34')]['includeAll']){_0x104296[_0x7233('0x42')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x7233('0x43')](_0x104296);})[_0x7233('0x25')](function(_0x52285f){_0x61e6ed[_0x7233('0x44')]=_0x52285f;return _0x61e6ed;})[_0x7233('0x25')](respondWithFilteredResult(_0x1774c3,_0x104296))[_0x7233('0x45')](handleError(_0x1774c3,null));};exports['show']=function(_0x4fdcd1,_0x3ea7bf){var _0x2486b9={'raw':!![],'where':{'id':_0x4fdcd1[_0x7233('0x46')]['id']}},_0x41491c={};_0x41491c[_0x7233('0x32')]=_[_0x7233('0x35')](db[_0x7233('0x2d')][_0x7233('0x2e')]);_0x41491c[_0x7233('0x34')]=_[_0x7233('0x35')](_0x4fdcd1[_0x7233('0x34')]);_0x41491c[_0x7233('0x36')]=_[_0x7233('0x37')](_0x41491c[_0x7233('0x32')],_0x41491c[_0x7233('0x34')]);_0x2486b9[_0x7233('0x38')]=_[_0x7233('0x37')](_0x41491c['model'],qs[_0x7233('0x39')](_0x4fdcd1[_0x7233('0x34')]['fields']));_0x2486b9[_0x7233('0x38')]=_0x2486b9[_0x7233('0x38')][_0x7233('0x3a')]?_0x2486b9['attributes']:_0x41491c['model'];if(_0x4fdcd1[_0x7233('0x34')]['includeAll']){_0x2486b9[_0x7233('0x42')]=[{'all':!![]}];}_0x2486b9=_['merge']({},_0x2486b9,_0x4fdcd1[_0x7233('0x41')]);return db[_0x7233('0x2d')][_0x7233('0x47')](_0x2486b9)['then'](handleEntityNotFound(_0x3ea7bf,null))[_0x7233('0x25')](respondWithResult(_0x3ea7bf,null))['catch'](handleError(_0x3ea7bf,null));};exports['create']=function(_0x53ff58,_0x3b3e2e){return db[_0x7233('0x2d')][_0x7233('0x48')](_0x53ff58[_0x7233('0x49')],{})['then'](function(_0x34caa9){var _0x41372f=_0x53ff58[_0x7233('0x4a')][_0x7233('0x4b')]({'plain':!![]});if(!_0x41372f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41372f[_0x7233('0x4c')]===_0x7233('0x4a')){var _0x517e44=_0x34caa9[_0x7233('0x4b')]({'plain':!![]});var _0x2a3a1d=_0x7233('0x27');return db[_0x7233('0x4d')][_0x7233('0x47')]({'where':{'name':_0x2a3a1d,'userProfileId':_0x41372f['userProfileId']},'raw':!![]})['then'](function(_0x249080){if(_0x249080&&_0x249080[_0x7233('0x4e')]===0x0){return db[_0x7233('0x28')][_0x7233('0x48')]({'name':_0x517e44[_0x7233('0x2a')],'resourceId':_0x517e44['id'],'type':_0x249080[_0x7233('0x2a')],'sectionId':_0x249080['id']},{})['then'](function(){return _0x34caa9;});}else{return _0x34caa9;}})[_0x7233('0x45')](function(_0x5e8613){logger['error'](_0x7233('0x4f'),_0x5e8613);throw _0x5e8613;});}return _0x34caa9;})['then'](respondWithResult(_0x3b3e2e,0xc9))[_0x7233('0x45')](handleError(_0x3b3e2e,null));};exports[_0x7233('0x24')]=function(_0x133f3b,_0x5dd611){if(_0x133f3b[_0x7233('0x49')]['id']){delete _0x133f3b[_0x7233('0x49')]['id'];}return db[_0x7233('0x2d')]['find']({'where':{'id':_0x133f3b[_0x7233('0x46')]['id']}})[_0x7233('0x25')](handleEntityNotFound(_0x5dd611,null))[_0x7233('0x25')](saveUpdates(_0x133f3b[_0x7233('0x49')],null))[_0x7233('0x25')](respondWithResult(_0x5dd611,null))[_0x7233('0x45')](handleError(_0x5dd611,null));};exports['destroy']=function(_0x1eb4b6,_0x1c19b7){return db['OpenchannelQueue'][_0x7233('0x47')]({'where':{'id':_0x1eb4b6[_0x7233('0x46')]['id']}})[_0x7233('0x25')](handleEntityNotFound(_0x1c19b7,null))[_0x7233('0x25')](removeEntity(_0x1c19b7,null))[_0x7233('0x45')](handleError(_0x1c19b7,null));};exports['describe']=function(_0x5e7601,_0x1280ae){return db[_0x7233('0x2d')][_0x7233('0x50')]()[_0x7233('0x25')](respondWithResult(_0x1280ae,null))[_0x7233('0x45')](handleError(_0x1280ae,null));};exports[_0x7233('0x51')]=function(_0x153901,_0x10be6d,_0x5ed8b3){var _0x1b8340={'raw':!![],'where':{}},_0x57b94c={},_0x234b97;return db[_0x7233('0x2d')][_0x7233('0x52')]({'where':{'id':_0x153901[_0x7233('0x46')]['id']}})[_0x7233('0x25')](handleEntityNotFound(_0x10be6d,null))['then'](function(_0xbfcfc6){if(_0xbfcfc6){_0x234b97=_0xbfcfc6[_0x7233('0x4b')]({'plain':!![]});_0x57b94c[_0x7233('0x32')]=_[_0x7233('0x35')](db[_0x7233('0x53')][_0x7233('0x2e')]);_0x57b94c[_0x7233('0x34')]=_['keys'](_0x153901[_0x7233('0x34')]);_0x57b94c[_0x7233('0x36')]=_[_0x7233('0x37')](_0x57b94c[_0x7233('0x32')],_0x57b94c[_0x7233('0x34')]);_0x1b8340[_0x7233('0x38')]=_[_0x7233('0x37')](_0x57b94c[_0x7233('0x32')],qs[_0x7233('0x39')](_0x153901['query'][_0x7233('0x39')]));_0x1b8340[_0x7233('0x38')]=_0x1b8340['attributes']['length']?_0x1b8340['attributes']:_0x57b94c['model'];if(!_0x153901[_0x7233('0x34')]['hasOwnProperty'](_0x7233('0x54'))){_0x1b8340[_0x7233('0x20')]=qs['limit'](_0x153901['query']['limit']);_0x1b8340['offset']=qs[_0x7233('0x1f')](_0x153901[_0x7233('0x34')][_0x7233('0x1f')]);}_0x1b8340[_0x7233('0x3b')]=qs[_0x7233('0x3c')](_0x153901[_0x7233('0x34')][_0x7233('0x3c')]);_0x1b8340[_0x7233('0x3d')]=qs[_0x7233('0x36')](_[_0x7233('0x3e')](_0x153901[_0x7233('0x34')],_0x57b94c[_0x7233('0x36')]));_0x1b8340[_0x7233('0x3d')][_0x7233('0x55')]=_0xbfcfc6['id'];if(_0x153901[_0x7233('0x34')][_0x7233('0x3f')]){_0x1b8340[_0x7233('0x3d')]=_['merge'](_0x1b8340[_0x7233('0x3d')],{'$or':_['map'](_0x1b8340['attributes'],function(_0x26860a){var _0x42b296={};_0x42b296[_0x26860a]={'$like':'%'+_0x153901[_0x7233('0x34')][_0x7233('0x3f')]+'%'};return _0x42b296;})});}_0x1b8340=_[_0x7233('0x40')]({},_0x1b8340,_0x153901[_0x7233('0x41')]);return db[_0x7233('0x53')][_0x7233('0x43')](_0x1b8340);}})[_0x7233('0x25')](function(_0x25a814){if(_0x25a814){return db[_0x7233('0x56')][_0x7233('0x57')]({'where':{'id':_[_0x7233('0x33')](_0x25a814,_0x7233('0x58')),'role':'agent'},'attributes':['id',_0x7233('0x2a'),_0x7233('0x59'),_0x7233('0x5a'),_0x7233('0x5b')]});}})[_0x7233('0x25')](function(_0x27e73e){if(_0x27e73e){return{'count':_0x27e73e[_0x7233('0x1e')],'rows':_[_0x7233('0x33')](_0x27e73e[_0x7233('0x44')],function(_0x1639ca){return{'membername':_0x1639ca[_0x7233('0x2a')],'UserId':_0x1639ca['id'],'queue_name':_0x234b97[_0x7233('0x2a')],'OpenchannelQueueId':_0x234b97['id'],'interface':util[_0x7233('0x5c')](_0x7233('0x5d'),_0x7233('0x5e'),_0x1639ca[_0x7233('0x2a')]),'penalty':0x0,'paused':_0x1639ca[_0x7233('0x59')],'createdAt':_0x1639ca[_0x7233('0x5b')],'updatedAt':_0x1639ca['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7233('0x25')](respondWithFilteredResult(_0x10be6d,_0x1b8340))['catch'](handleError(_0x10be6d,null));};exports['getTeams']=function(_0x255523,_0x54a24b,_0x535322){var _0x4a5873={};var _0x18699d={};var _0x4eca01;var _0x20f67c;return db[_0x7233('0x2d')][_0x7233('0x52')]({'where':{'id':_0x255523[_0x7233('0x46')]['id']}})['then'](handleEntityNotFound(_0x54a24b,null))[_0x7233('0x25')](function(_0x4cc471){if(_0x4cc471){_0x4eca01=_0x4cc471;_0x18699d[_0x7233('0x32')]=_['keys'](db[_0x7233('0x5f')][_0x7233('0x2e')]);_0x18699d[_0x7233('0x34')]=_[_0x7233('0x35')](_0x255523[_0x7233('0x34')]);_0x18699d[_0x7233('0x36')]=_[_0x7233('0x37')](_0x18699d[_0x7233('0x32')],_0x18699d[_0x7233('0x34')]);_0x4a5873['attributes']=_[_0x7233('0x37')](_0x18699d[_0x7233('0x32')],qs[_0x7233('0x39')](_0x255523['query'][_0x7233('0x39')]));_0x4a5873['attributes']=_0x4a5873[_0x7233('0x38')]['length']?_0x4a5873[_0x7233('0x38')]:_0x18699d['model'];_0x4a5873[_0x7233('0x3b')]=qs['sort'](_0x255523[_0x7233('0x34')][_0x7233('0x3c')]);_0x4a5873['where']=qs['filters'](_[_0x7233('0x3e')](_0x255523[_0x7233('0x34')],_0x18699d['filters']));if(_0x255523['query'][_0x7233('0x3f')]){_0x4a5873['where']=_[_0x7233('0x40')](_0x4a5873[_0x7233('0x3d')],{'$or':_['map'](_0x4a5873[_0x7233('0x38')],function(_0x5ed626){var _0x3a0bfd={};_0x3a0bfd[_0x5ed626]={'$like':'%'+_0x255523[_0x7233('0x34')][_0x7233('0x3f')]+'%'};return _0x3a0bfd;})});}_0x4a5873=_[_0x7233('0x40')]({},_0x4a5873,_0x255523[_0x7233('0x41')]);return _0x4eca01['getTeams'](_0x4a5873);}})[_0x7233('0x25')](function(_0x500a3e){if(_0x500a3e){_0x20f67c=_0x500a3e[_0x7233('0x3a')];if(!_0x255523[_0x7233('0x34')]['hasOwnProperty']('nolimit')){_0x4a5873[_0x7233('0x20')]=qs[_0x7233('0x20')](_0x255523[_0x7233('0x34')]['limit']);_0x4a5873[_0x7233('0x1f')]=qs[_0x7233('0x1f')](_0x255523[_0x7233('0x34')][_0x7233('0x1f')]);}return _0x4eca01[_0x7233('0x60')](_0x4a5873);}})[_0x7233('0x25')](function(_0x26c387){if(_0x26c387){return _0x26c387?{'count':_0x20f67c,'rows':_0x26c387}:null;}})[_0x7233('0x25')](respondWithResult(_0x54a24b,null))['catch'](handleError(_0x54a24b,null));};exports[_0x7233('0x61')]=function(_0x1d3b55,_0x3a102f,_0x349b77){var _0x131eb6=_0x1d3b55['body'][_0x7233('0x62')];return db[_0x7233('0x5f')][_0x7233('0x43')]({'where':{'id':_0x131eb6},'attributes':['id'],'include':[{'model':db['User'],'as':_0x7233('0x63'),'attributes':['id',_0x7233('0x2a'),_0x7233('0x64'),_0x7233('0x65'),_0x7233('0x66')],'raw':!![]}]})[_0x7233('0x25')](function(_0x562ed3){if(_0x562ed3){var _0x4de912=_[_0x7233('0x67')](_0x562ed3,function(_0x4e4b99){var _0x780aa6=_0x4e4b99['get']({'plain':!![]});return _0x780aa6[_0x7233('0x63')];});return db[_0x7233('0x2d')][_0x7233('0x47')]({'where':{'id':_0x1d3b55[_0x7233('0x46')]['id']}})['then'](function(_0xd69622){return db[_0x7233('0x68')][_0x7233('0x69')](function(_0x357132){return _0xd69622[_0x7233('0x61')](_0x131eb6,{'transaction':_0x357132})['then'](function(){return BPromise[_0x7233('0x6a')](_0x4de912,function(_0x4b4e68){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x4b4e68['id'],'OpenchannelQueueId':_0x1d3b55[_0x7233('0x46')]['id']},'transaction':_0x357132});});})[_0x7233('0x25')](function(){_0x4de912[_0x7233('0x6b')](function(_0x38fcc7){socket[_0x7233('0x6c')]('userOpenchannelQueue:save',{'UserId':_0x38fcc7['id'],'OpenchannelQueueId':_0xd69622['id']});});});});});}})['then'](respondWithStatusCode(_0x3a102f,null))[_0x7233('0x45')](handleError(_0x3a102f,null));};exports[_0x7233('0x6d')]=function(_0x426af2,_0x298b6b,_0x4345e7){return db[_0x7233('0x5f')][_0x7233('0x43')]({'where':{'id':_0x426af2[_0x7233('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0x7233('0x56')],'as':_0x7233('0x63'),'attributes':['id'],'raw':!![]}]})[_0x7233('0x25')](handleEntityNotFound(_0x298b6b,null))[_0x7233('0x25')](function(_0x277007){var _0x2e7b6f=_[_0x7233('0x33')](_0x277007,'id');var _0x1b415b=[];var _0x3743d4=[];var _0x4db016=squel[_0x7233('0x6e')]();_0x4db016[_0x7233('0x6f')](_0x7233('0x70'))['from'](_0x7233('0x71'),'tq')[_0x7233('0x72')](_0x7233('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('OpenchannelQueueId\x20=\x20?',_0x426af2[_0x7233('0x46')]['id']);for(var _0x2afd9b=0x0;_0x2afd9b<_0x277007[_0x7233('0x3a')];_0x2afd9b+=0x1){let _0x2ccfaf=_0x277007[_0x2afd9b];for(var _0x528759=0x0;_0x528759<_0x2ccfaf[_0x7233('0x63')][_0x7233('0x3a')];_0x528759+=0x1){let _0x42e839=_0x2ccfaf[_0x7233('0x63')][_0x528759];var _0x3af751=_0x4db016[_0x7233('0x74')]();_0x3af751[_0x7233('0x3d')]('ut.UserId\x20=\x20?',_0x42e839['id']);_0x3743d4['push'](db['sequelize']['query'](_0x3af751[_0x7233('0x75')](),{'type':db[_0x7233('0x68')][_0x7233('0x76')]['SELECT']})[_0x7233('0x25')](function(_0x24fb70){if(_0x24fb70[_0x7233('0x3a')]===0x1){return _0x42e839['id'];}else{var _0x29b720=_[_0x7233('0x77')](_['map'](_0x24fb70,_0x7233('0x78')),function(_0x36ed2a){return _[_0x7233('0x79')](_0x2e7b6f,_0x36ed2a);});if(_0x29b720){return _0x42e839['id'];}}}));}}return BPromise[_0x7233('0x7a')](_0x3743d4)[_0x7233('0x25')](function(_0xf5eda4){_0x1b415b=_(_0x1b415b)[_0x7233('0x7b')](_0xf5eda4)['compact']()[_0x7233('0x7c')]();return db[_0x7233('0x2d')][_0x7233('0x47')]({'where':{'id':_0x426af2['params']['id']}})['then'](function(_0x52d5db){return db['sequelize']['transaction'](function(_0x4174a9){return _0x52d5db[_0x7233('0x6d')](_0x426af2[_0x7233('0x34')][_0x7233('0x62')],{'transaction':_0x4174a9})[_0x7233('0x25')](function(){if(!_[_0x7233('0x7d')](_0x1b415b)){return _0x52d5db[_0x7233('0x7e')](_0x1b415b,{'transaction':_0x4174a9});}})[_0x7233('0x25')](function(){_0x1b415b[_0x7233('0x6b')](function(_0x8d1ddf){socket[_0x7233('0x6c')](_0x7233('0x7f'),{'UserId':_0x8d1ddf,'OpenchannelQueueId':_0x52d5db['id']});});});});});});})[_0x7233('0x25')](respondWithStatusCode(_0x298b6b,null))[_0x7233('0x45')](handleError(_0x298b6b,null));};exports[_0x7233('0x80')]=function(_0x25a3e1,_0x2c66d7,_0x3b4248){return db[_0x7233('0x2d')][_0x7233('0x47')]({'where':{'id':_0x25a3e1['params']['id']}})[_0x7233('0x25')](handleEntityNotFound(_0x2c66d7,null))[_0x7233('0x25')](function(_0x41b18c){if(_0x41b18c){return _0x41b18c['addAgents'](_0x25a3e1['body']['ids'],_['omit'](_0x25a3e1['body'],[_0x7233('0x62'),'id'])||{})[_0x7233('0x81')](function(_0x5d79fe){for(var _0x4f8cce=0x0;_0x4f8cce<_0x25a3e1[_0x7233('0x49')][_0x7233('0x62')][_0x7233('0x3a')];_0x4f8cce+=0x1){socket[_0x7233('0x6c')](_0x7233('0x82'),{'UserId':_0x25a3e1[_0x7233('0x49')][_0x7233('0x62')][_0x4f8cce],'OpenchannelQueueId':_0x25a3e1[_0x7233('0x46')]['id']});}return _0x5d79fe;});}})['then'](respondWithResult(_0x2c66d7,null))[_0x7233('0x45')](handleError(_0x2c66d7,null));};exports['removeAgents']=function(_0x49d29d,_0x2e70a8,_0x1df5de){return db['OpenchannelQueue'][_0x7233('0x47')]({'where':{'id':_0x49d29d['params']['id']}})[_0x7233('0x25')](handleEntityNotFound(_0x2e70a8,null))[_0x7233('0x25')](function(_0x377476){if(_0x377476){return _0x377476['removeAgents'](_0x49d29d[_0x7233('0x34')][_0x7233('0x62')])[_0x7233('0x25')](function(){if(_[_0x7233('0x83')](_0x49d29d[_0x7233('0x34')]['ids'])){for(var _0x46a5d1=0x0;_0x46a5d1<_0x49d29d[_0x7233('0x34')][_0x7233('0x62')][_0x7233('0x3a')];_0x46a5d1+=0x1){socket[_0x7233('0x6c')](_0x7233('0x7f'),{'UserId':Number(_0x49d29d[_0x7233('0x34')][_0x7233('0x62')][_0x46a5d1]),'OpenchannelQueueId':Number(_0x49d29d[_0x7233('0x46')]['id'])});}}else{socket[_0x7233('0x6c')](_0x7233('0x7f'),{'UserId':Number(_0x49d29d['query'][_0x7233('0x62')]),'OpenchannelQueueId':Number(_0x49d29d['params']['id'])});}});}})[_0x7233('0x25')](respondWithStatusCode(_0x2e70a8,null))[_0x7233('0x45')](handleError(_0x2e70a8,null));};exports[_0x7233('0x84')]=function(_0x10e376,_0x5cbd1b,_0x4efb65){var _0x1b9f07={};var _0x191da6={};var _0x382d73;var _0x18c16b;return db['OpenchannelQueue'][_0x7233('0x52')]({'where':{'id':_0x10e376[_0x7233('0x46')]['id']}})[_0x7233('0x25')](handleEntityNotFound(_0x5cbd1b,null))[_0x7233('0x25')](function(_0x2ddb7c){if(_0x2ddb7c){_0x382d73=_0x2ddb7c;_0x191da6['model']=_[_0x7233('0x35')](db[_0x7233('0x56')][_0x7233('0x2e')]);_0x191da6[_0x7233('0x34')]=_[_0x7233('0x35')](_0x10e376[_0x7233('0x34')]);_0x191da6[_0x7233('0x36')]=_[_0x7233('0x37')](_0x191da6[_0x7233('0x32')],_0x191da6[_0x7233('0x34')]);_0x1b9f07['attributes']=_[_0x7233('0x37')](_0x191da6[_0x7233('0x32')],qs[_0x7233('0x39')](_0x10e376['query'][_0x7233('0x39')]));_0x1b9f07[_0x7233('0x38')]=_0x1b9f07[_0x7233('0x38')][_0x7233('0x3a')]?_0x1b9f07[_0x7233('0x38')]:_0x191da6[_0x7233('0x32')];_0x1b9f07[_0x7233('0x3b')]=qs[_0x7233('0x3c')](_0x10e376[_0x7233('0x34')][_0x7233('0x3c')]);_0x1b9f07[_0x7233('0x3d')]=qs[_0x7233('0x36')](_[_0x7233('0x3e')](_0x10e376[_0x7233('0x34')],_0x191da6[_0x7233('0x36')]));if(_0x10e376[_0x7233('0x34')]['filter']){_0x1b9f07['where']=_['merge'](_0x1b9f07[_0x7233('0x3d')],{'$or':_[_0x7233('0x33')](_0x1b9f07['attributes'],function(_0x5ab9ab){var _0x5b0255={};_0x5b0255[_0x5ab9ab]={'$like':'%'+_0x10e376['query'][_0x7233('0x3f')]+'%'};return _0x5b0255;})});}_0x1b9f07=_[_0x7233('0x40')]({},_0x1b9f07,_0x10e376[_0x7233('0x41')]);return _0x382d73['getAgents'](_0x1b9f07);}})[_0x7233('0x25')](function(_0x2c6ca2){if(_0x2c6ca2){_0x18c16b=_0x2c6ca2[_0x7233('0x3a')];if(!_0x10e376['query'][_0x7233('0x85')](_0x7233('0x54'))){_0x1b9f07[_0x7233('0x20')]=qs[_0x7233('0x20')](_0x10e376[_0x7233('0x34')]['limit']);_0x1b9f07[_0x7233('0x1f')]=qs['offset'](_0x10e376['query'][_0x7233('0x1f')]);}return _0x382d73[_0x7233('0x84')](_0x1b9f07);}})[_0x7233('0x25')](function(_0x3f635c){if(_0x3f635c){return _0x3f635c?{'count':_0x18c16b,'rows':_0x3f635c}:null;}})[_0x7233('0x25')](respondWithResult(_0x5cbd1b,null))[_0x7233('0x45')](handleError(_0x5cbd1b,null));}; \ No newline at end of file +var _0xdc21=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','user','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','nolimit','OpenchannelQueueId','map','UserOpenchannelQueue','User','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','ids','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','SELECT','every','TeamId','all','union','compact','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','OpenchannelQueues','end','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','type','key','model'];(function(_0x534b5a,_0x2ed076){var _0x311184=function(_0x1b95f3){while(--_0x1b95f3){_0x534b5a['push'](_0x534b5a['shift']());}};_0x311184(++_0x2ed076);}(_0xdc21,0x162));var _0x1dc2=function(_0x421bf0,_0x423ba1){_0x421bf0=_0x421bf0-0x0;var _0x19a8f6=_0xdc21[_0x421bf0];return _0x19a8f6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1dc2('0x0'));var rimraf=require(_0x1dc2('0x1'));var zipdir=require(_0x1dc2('0x2'));var jsonpatch=require(_0x1dc2('0x3'));var rp=require(_0x1dc2('0x4'));var moment=require(_0x1dc2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1dc2('0x6'));var util=require(_0x1dc2('0x7'));var path=require(_0x1dc2('0x8'));var sox=require(_0x1dc2('0x9'));var csv=require(_0x1dc2('0xa'));var ejs=require(_0x1dc2('0xb'));var fs=require('fs');var _=require(_0x1dc2('0xc'));var squel=require(_0x1dc2('0xd'));var crypto=require(_0x1dc2('0xe'));var jsforce=require(_0x1dc2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1dc2('0xa'));var querystring=require(_0x1dc2('0x10'));var Papa=require(_0x1dc2('0x11'));var Redis=require(_0x1dc2('0x12'));var authService=require(_0x1dc2('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1dc2('0x14'));var logger=require(_0x1dc2('0x15'))(_0x1dc2('0x16'));var utils=require(_0x1dc2('0x17'));var config=require(_0x1dc2('0x18'));var db=require(_0x1dc2('0x19'))['db'];config[_0x1dc2('0x1a')]=_[_0x1dc2('0x1b')](config[_0x1dc2('0x1a')],{'host':_0x1dc2('0x1c'),'port':0x18eb});var socket=require(_0x1dc2('0x1d'))(new Redis(config['redis']));require(_0x1dc2('0x1e'))['register'](socket);function respondWithStatusCode(_0x8ebc1,_0x11aff4){_0x11aff4=_0x11aff4||0xcc;return function(_0x1142ed){if(_0x1142ed){return _0x8ebc1[_0x1dc2('0x1f')](_0x11aff4);}return _0x8ebc1['status'](_0x11aff4)['end']();};}function respondWithResult(_0x9327ff,_0x5cb107){_0x5cb107=_0x5cb107||0xc8;return function(_0x2d9e35){if(_0x2d9e35){return _0x9327ff[_0x1dc2('0x20')](_0x5cb107)[_0x1dc2('0x21')](_0x2d9e35);}};}function respondWithFilteredResult(_0xdbfe86,_0x38250f){return function(_0x1edb7d){if(_0x1edb7d){var _0x20df34=_0x1edb7d[_0x1dc2('0x22')],_0x10d981=_0x38250f[_0x1dc2('0x23')],_0x459b0a=_0x38250f[_0x1dc2('0x23')]+_0x38250f[_0x1dc2('0x24')],_0x4c6a81;if(_0x459b0a>=_0x20df34){_0x459b0a=_0x20df34;_0x4c6a81=0xc8;}else{_0x4c6a81=0xce;}_0xdbfe86[_0x1dc2('0x20')](_0x4c6a81);return _0xdbfe86['set'](_0x1dc2('0x25'),_0x10d981+'-'+_0x459b0a+'/'+_0x20df34)[_0x1dc2('0x21')](_0x1edb7d);}return null;};}function patchUpdates(_0x23b0d3){return function(_0x1f70d5){try{jsonpatch[_0x1dc2('0x26')](_0x1f70d5,_0x23b0d3,!![]);}catch(_0x144ef4){return BPromise['reject'](_0x144ef4);}return _0x1f70d5[_0x1dc2('0x27')]();};}function saveUpdates(_0x48492e,_0xddaf5c){return function(_0x432782){if(_0x432782){return _0x432782[_0x1dc2('0x28')](_0x48492e)[_0x1dc2('0x29')](function(_0x15930d){return _0x15930d;});}return null;};}function removeEntity(_0x274658,_0x5283cc){return function(_0x23365c){if(_0x23365c){return _0x23365c[_0x1dc2('0x2a')]()[_0x1dc2('0x29')](function(){var _0x4a2d3a=_0x23365c[_0x1dc2('0x2b')]({'plain':!![]});var _0x152c29=_0x1dc2('0x2c');return db['UserProfileResource'][_0x1dc2('0x2a')]({'where':{'type':_0x152c29,'resourceId':_0x4a2d3a['id']}})[_0x1dc2('0x29')](function(){return _0x23365c;});})[_0x1dc2('0x29')](function(){_0x274658['status'](0xcc)[_0x1dc2('0x2d')]();});}};}function handleEntityNotFound(_0x1f90a6,_0x2be1ed){return function(_0x4b8462){if(!_0x4b8462){_0x1f90a6[_0x1dc2('0x1f')](0x194);}return _0x4b8462;};}function handleError(_0x59f481,_0x4e7522){_0x4e7522=_0x4e7522||0x1f4;return function(_0x1b1ebb){logger[_0x1dc2('0x2e')](_0x1b1ebb[_0x1dc2('0x2f')]);if(_0x1b1ebb['name']){delete _0x1b1ebb[_0x1dc2('0x30')];}_0x59f481[_0x1dc2('0x20')](_0x4e7522)[_0x1dc2('0x31')](_0x1b1ebb);};}exports[_0x1dc2('0x32')]=function(_0x23ea6b,_0x15c753){var _0xe65271={},_0x2388f3={},_0x27726b={'count':0x0,'rows':[]};var _0x4e054a=_['map'](db[_0x1dc2('0x33')][_0x1dc2('0x34')],function(_0x13b528){return{'name':_0x13b528[_0x1dc2('0x35')],'type':_0x13b528[_0x1dc2('0x36')][_0x1dc2('0x37')]};});_0x2388f3[_0x1dc2('0x38')]=_['map'](_0x4e054a,'name');_0x2388f3[_0x1dc2('0x39')]=_[_0x1dc2('0x3a')](_0x23ea6b[_0x1dc2('0x39')]);_0x2388f3[_0x1dc2('0x3b')]=_[_0x1dc2('0x3c')](_0x2388f3[_0x1dc2('0x38')],_0x2388f3[_0x1dc2('0x39')]);_0xe65271[_0x1dc2('0x3d')]=_[_0x1dc2('0x3c')](_0x2388f3['model'],qs[_0x1dc2('0x3e')](_0x23ea6b[_0x1dc2('0x39')][_0x1dc2('0x3e')]));_0xe65271[_0x1dc2('0x3d')]=_0xe65271['attributes'][_0x1dc2('0x3f')]?_0xe65271['attributes']:_0x2388f3[_0x1dc2('0x38')];if(!_0x23ea6b[_0x1dc2('0x39')][_0x1dc2('0x40')]('nolimit')){_0xe65271['limit']=qs[_0x1dc2('0x24')](_0x23ea6b[_0x1dc2('0x39')][_0x1dc2('0x24')]);_0xe65271['offset']=qs['offset'](_0x23ea6b['query'][_0x1dc2('0x23')]);}_0xe65271[_0x1dc2('0x41')]=qs[_0x1dc2('0x42')](_0x23ea6b[_0x1dc2('0x39')]['sort']);_0xe65271[_0x1dc2('0x43')]=qs['filters'](_[_0x1dc2('0x44')](_0x23ea6b[_0x1dc2('0x39')],_0x2388f3['filters']),_0x4e054a);if(_0x23ea6b[_0x1dc2('0x39')][_0x1dc2('0x45')]){_0xe65271[_0x1dc2('0x43')]=_[_0x1dc2('0x46')](_0xe65271[_0x1dc2('0x43')],{'$or':_['map'](_0x4e054a,function(_0x23ade4){if(_0x23ade4['type']!==_0x1dc2('0x47')){var _0x347641={};_0x347641[_0x23ade4[_0x1dc2('0x30')]]={'$like':'%'+_0x23ea6b[_0x1dc2('0x39')][_0x1dc2('0x45')]+'%'};return _0x347641;}})});}_0xe65271=_[_0x1dc2('0x46')]({},_0xe65271,_0x23ea6b[_0x1dc2('0x48')]);var _0x19edc0={'where':_0xe65271[_0x1dc2('0x43')]};return db[_0x1dc2('0x33')][_0x1dc2('0x22')](_0x19edc0)[_0x1dc2('0x29')](function(_0x3996c4){_0x27726b['count']=_0x3996c4;if(_0x23ea6b[_0x1dc2('0x39')][_0x1dc2('0x49')]){_0xe65271[_0x1dc2('0x4a')]=[{'all':!![]}];}return db[_0x1dc2('0x33')][_0x1dc2('0x4b')](_0xe65271);})[_0x1dc2('0x29')](function(_0x474f13){_0x27726b[_0x1dc2('0x4c')]=_0x474f13;return _0x27726b;})['then'](respondWithFilteredResult(_0x15c753,_0xe65271))[_0x1dc2('0x4d')](handleError(_0x15c753,null));};exports[_0x1dc2('0x4e')]=function(_0x41891d,_0x835aeb){var _0x56f659={'raw':!![],'where':{'id':_0x41891d['params']['id']}},_0x2631f1={};_0x2631f1[_0x1dc2('0x38')]=_[_0x1dc2('0x3a')](db['OpenchannelQueue'][_0x1dc2('0x34')]);_0x2631f1['query']=_[_0x1dc2('0x3a')](_0x41891d[_0x1dc2('0x39')]);_0x2631f1[_0x1dc2('0x3b')]=_['intersection'](_0x2631f1[_0x1dc2('0x38')],_0x2631f1[_0x1dc2('0x39')]);_0x56f659['attributes']=_[_0x1dc2('0x3c')](_0x2631f1[_0x1dc2('0x38')],qs[_0x1dc2('0x3e')](_0x41891d[_0x1dc2('0x39')][_0x1dc2('0x3e')]));_0x56f659[_0x1dc2('0x3d')]=_0x56f659[_0x1dc2('0x3d')]['length']?_0x56f659[_0x1dc2('0x3d')]:_0x2631f1[_0x1dc2('0x38')];if(_0x41891d[_0x1dc2('0x39')]['includeAll']){_0x56f659[_0x1dc2('0x4a')]=[{'all':!![]}];}_0x56f659=_[_0x1dc2('0x46')]({},_0x56f659,_0x41891d['options']);return db['OpenchannelQueue']['find'](_0x56f659)[_0x1dc2('0x29')](handleEntityNotFound(_0x835aeb,null))[_0x1dc2('0x29')](respondWithResult(_0x835aeb,null))[_0x1dc2('0x4d')](handleError(_0x835aeb,null));};exports[_0x1dc2('0x4f')]=function(_0x479413,_0x19872f){return db[_0x1dc2('0x33')][_0x1dc2('0x4f')](_0x479413[_0x1dc2('0x50')],{})[_0x1dc2('0x29')](function(_0x4c0b5c){var _0x4e7c7a=_0x479413[_0x1dc2('0x51')][_0x1dc2('0x2b')]({'plain':!![]});if(!_0x4e7c7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e7c7a['role']==='user'){var _0x842665=_0x4c0b5c[_0x1dc2('0x2b')]({'plain':!![]});var _0x2f3f80=_0x1dc2('0x2c');return db[_0x1dc2('0x52')][_0x1dc2('0x53')]({'where':{'name':_0x2f3f80,'userProfileId':_0x4e7c7a['userProfileId']},'raw':!![]})['then'](function(_0x41d0e8){if(_0x41d0e8&&_0x41d0e8[_0x1dc2('0x54')]===0x0){return db[_0x1dc2('0x55')]['create']({'name':_0x842665[_0x1dc2('0x30')],'resourceId':_0x842665['id'],'type':_0x41d0e8[_0x1dc2('0x30')],'sectionId':_0x41d0e8['id']},{})[_0x1dc2('0x29')](function(){return _0x4c0b5c;});}else{return _0x4c0b5c;}})[_0x1dc2('0x4d')](function(_0x3e1294){logger[_0x1dc2('0x2e')](_0x1dc2('0x56'),_0x3e1294);throw _0x3e1294;});}return _0x4c0b5c;})[_0x1dc2('0x29')](respondWithResult(_0x19872f,0xc9))[_0x1dc2('0x4d')](handleError(_0x19872f,null));};exports[_0x1dc2('0x28')]=function(_0x135fb7,_0x1856e1){if(_0x135fb7[_0x1dc2('0x50')]['id']){delete _0x135fb7[_0x1dc2('0x50')]['id'];}return db[_0x1dc2('0x33')][_0x1dc2('0x53')]({'where':{'id':_0x135fb7[_0x1dc2('0x57')]['id']}})['then'](handleEntityNotFound(_0x1856e1,null))[_0x1dc2('0x29')](saveUpdates(_0x135fb7[_0x1dc2('0x50')],null))['then'](respondWithResult(_0x1856e1,null))[_0x1dc2('0x4d')](handleError(_0x1856e1,null));};exports[_0x1dc2('0x2a')]=function(_0x295b1f,_0x88f53){return db[_0x1dc2('0x33')][_0x1dc2('0x53')]({'where':{'id':_0x295b1f[_0x1dc2('0x57')]['id']}})[_0x1dc2('0x29')](handleEntityNotFound(_0x88f53,null))[_0x1dc2('0x29')](removeEntity(_0x88f53,null))[_0x1dc2('0x4d')](handleError(_0x88f53,null));};exports[_0x1dc2('0x58')]=function(_0x4b3ebd,_0x54b44d){return db[_0x1dc2('0x33')][_0x1dc2('0x58')]()[_0x1dc2('0x29')](respondWithResult(_0x54b44d,null))[_0x1dc2('0x4d')](handleError(_0x54b44d,null));};exports[_0x1dc2('0x59')]=function(_0x11e08f,_0x1d0af4,_0x260233){var _0xd60906={'raw':!![],'where':{}},_0x48ef33={},_0x361afa;return db['OpenchannelQueue'][_0x1dc2('0x5a')]({'where':{'id':_0x11e08f['params']['id']}})[_0x1dc2('0x29')](handleEntityNotFound(_0x1d0af4,null))[_0x1dc2('0x29')](function(_0x386b56){if(_0x386b56){_0x361afa=_0x386b56[_0x1dc2('0x2b')]({'plain':!![]});_0x48ef33[_0x1dc2('0x38')]=_[_0x1dc2('0x3a')](db['UserOpenchannelQueue'][_0x1dc2('0x34')]);_0x48ef33['query']=_[_0x1dc2('0x3a')](_0x11e08f[_0x1dc2('0x39')]);_0x48ef33[_0x1dc2('0x3b')]=_[_0x1dc2('0x3c')](_0x48ef33['model'],_0x48ef33['query']);_0xd60906[_0x1dc2('0x3d')]=_[_0x1dc2('0x3c')](_0x48ef33[_0x1dc2('0x38')],qs['fields'](_0x11e08f[_0x1dc2('0x39')][_0x1dc2('0x3e')]));_0xd60906[_0x1dc2('0x3d')]=_0xd60906[_0x1dc2('0x3d')][_0x1dc2('0x3f')]?_0xd60906[_0x1dc2('0x3d')]:_0x48ef33[_0x1dc2('0x38')];if(!_0x11e08f['query']['hasOwnProperty'](_0x1dc2('0x5b'))){_0xd60906[_0x1dc2('0x24')]=qs[_0x1dc2('0x24')](_0x11e08f[_0x1dc2('0x39')][_0x1dc2('0x24')]);_0xd60906[_0x1dc2('0x23')]=qs['offset'](_0x11e08f['query']['offset']);}_0xd60906[_0x1dc2('0x41')]=qs[_0x1dc2('0x42')](_0x11e08f[_0x1dc2('0x39')][_0x1dc2('0x42')]);_0xd60906['where']=qs[_0x1dc2('0x3b')](_[_0x1dc2('0x44')](_0x11e08f['query'],_0x48ef33['filters']));_0xd60906[_0x1dc2('0x43')][_0x1dc2('0x5c')]=_0x386b56['id'];if(_0x11e08f[_0x1dc2('0x39')][_0x1dc2('0x45')]){_0xd60906[_0x1dc2('0x43')]=_[_0x1dc2('0x46')](_0xd60906['where'],{'$or':_[_0x1dc2('0x5d')](_0xd60906[_0x1dc2('0x3d')],function(_0x446c13){var _0x10f340={};_0x10f340[_0x446c13]={'$like':'%'+_0x11e08f[_0x1dc2('0x39')][_0x1dc2('0x45')]+'%'};return _0x10f340;})});}_0xd60906=_[_0x1dc2('0x46')]({},_0xd60906,_0x11e08f[_0x1dc2('0x48')]);return db[_0x1dc2('0x5e')][_0x1dc2('0x4b')](_0xd60906);}})['then'](function(_0x1e0e45){if(_0x1e0e45){return db[_0x1dc2('0x5f')]['findAndCountAll']({'where':{'id':_['map'](_0x1e0e45,'UserId'),'role':'agent'},'attributes':['id',_0x1dc2('0x30'),_0x1dc2('0x60'),'updatedAt',_0x1dc2('0x61')]});}})['then'](function(_0x301ced){if(_0x301ced){return{'count':_0x301ced[_0x1dc2('0x22')],'rows':_[_0x1dc2('0x5d')](_0x301ced[_0x1dc2('0x4c')],function(_0x17bd6a){return{'membername':_0x17bd6a['name'],'UserId':_0x17bd6a['id'],'queue_name':_0x361afa[_0x1dc2('0x30')],'OpenchannelQueueId':_0x361afa['id'],'interface':util[_0x1dc2('0x62')](_0x1dc2('0x63'),_0x1dc2('0x64'),_0x17bd6a[_0x1dc2('0x30')]),'penalty':0x0,'paused':_0x17bd6a[_0x1dc2('0x60')],'createdAt':_0x17bd6a[_0x1dc2('0x61')],'updatedAt':_0x17bd6a[_0x1dc2('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1dc2('0x29')](respondWithFilteredResult(_0x1d0af4,_0xd60906))[_0x1dc2('0x4d')](handleError(_0x1d0af4,null));};exports[_0x1dc2('0x66')]=function(_0x407195,_0x540443,_0x15305f){var _0x2631da={};var _0x592d17={};var _0x4c44d5;var _0x4a333f;return db['OpenchannelQueue'][_0x1dc2('0x5a')]({'where':{'id':_0x407195[_0x1dc2('0x57')]['id']}})[_0x1dc2('0x29')](handleEntityNotFound(_0x540443,null))[_0x1dc2('0x29')](function(_0x4a32ba){if(_0x4a32ba){_0x4c44d5=_0x4a32ba;_0x592d17[_0x1dc2('0x38')]=_[_0x1dc2('0x3a')](db[_0x1dc2('0x67')][_0x1dc2('0x34')]);_0x592d17[_0x1dc2('0x39')]=_['keys'](_0x407195['query']);_0x592d17[_0x1dc2('0x3b')]=_[_0x1dc2('0x3c')](_0x592d17['model'],_0x592d17[_0x1dc2('0x39')]);_0x2631da[_0x1dc2('0x3d')]=_[_0x1dc2('0x3c')](_0x592d17[_0x1dc2('0x38')],qs[_0x1dc2('0x3e')](_0x407195[_0x1dc2('0x39')][_0x1dc2('0x3e')]));_0x2631da[_0x1dc2('0x3d')]=_0x2631da['attributes']['length']?_0x2631da[_0x1dc2('0x3d')]:_0x592d17[_0x1dc2('0x38')];_0x2631da[_0x1dc2('0x41')]=qs['sort'](_0x407195[_0x1dc2('0x39')]['sort']);_0x2631da['where']=qs[_0x1dc2('0x3b')](_[_0x1dc2('0x44')](_0x407195['query'],_0x592d17[_0x1dc2('0x3b')]));if(_0x407195['query'][_0x1dc2('0x45')]){_0x2631da[_0x1dc2('0x43')]=_[_0x1dc2('0x46')](_0x2631da[_0x1dc2('0x43')],{'$or':_[_0x1dc2('0x5d')](_0x2631da[_0x1dc2('0x3d')],function(_0x207f85){var _0x242e3f={};_0x242e3f[_0x207f85]={'$like':'%'+_0x407195['query'][_0x1dc2('0x45')]+'%'};return _0x242e3f;})});}_0x2631da=_[_0x1dc2('0x46')]({},_0x2631da,_0x407195[_0x1dc2('0x48')]);return _0x4c44d5[_0x1dc2('0x66')](_0x2631da);}})[_0x1dc2('0x29')](function(_0x4f3a46){if(_0x4f3a46){_0x4a333f=_0x4f3a46[_0x1dc2('0x3f')];if(!_0x407195[_0x1dc2('0x39')][_0x1dc2('0x40')](_0x1dc2('0x5b'))){_0x2631da['limit']=qs[_0x1dc2('0x24')](_0x407195[_0x1dc2('0x39')]['limit']);_0x2631da[_0x1dc2('0x23')]=qs['offset'](_0x407195[_0x1dc2('0x39')]['offset']);}return _0x4c44d5[_0x1dc2('0x66')](_0x2631da);}})[_0x1dc2('0x29')](function(_0x5f9ca2){if(_0x5f9ca2){return _0x5f9ca2?{'count':_0x4a333f,'rows':_0x5f9ca2}:null;}})[_0x1dc2('0x29')](respondWithResult(_0x540443,null))[_0x1dc2('0x4d')](handleError(_0x540443,null));};exports['addTeams']=function(_0x5f5c52,_0x95e8f3,_0x198b7b){var _0xf34eb7=_0x5f5c52['body'][_0x1dc2('0x68')];return db[_0x1dc2('0x67')][_0x1dc2('0x4b')]({'where':{'id':_0xf34eb7},'attributes':['id'],'include':[{'model':db[_0x1dc2('0x5f')],'as':_0x1dc2('0x69'),'attributes':['id',_0x1dc2('0x30'),_0x1dc2('0x6a'),'voicePause',_0x1dc2('0x6b')],'raw':!![]}]})['then'](function(_0x16cbaa){if(_0x16cbaa){var _0x2716d=_[_0x1dc2('0x6c')](_0x16cbaa,function(_0x25ed26){var _0x52fbdf=_0x25ed26[_0x1dc2('0x2b')]({'plain':!![]});return _0x52fbdf[_0x1dc2('0x69')];});return db[_0x1dc2('0x33')][_0x1dc2('0x53')]({'where':{'id':_0x5f5c52[_0x1dc2('0x57')]['id']}})['then'](function(_0x4f1327){return db[_0x1dc2('0x6d')][_0x1dc2('0x6e')](function(_0x575f72){return _0x4f1327[_0x1dc2('0x6f')](_0xf34eb7,{'transaction':_0x575f72})[_0x1dc2('0x29')](function(){return BPromise[_0x1dc2('0x70')](_0x2716d,function(_0x4b3a29){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x4b3a29['id'],'OpenchannelQueueId':_0x5f5c52[_0x1dc2('0x57')]['id']},'transaction':_0x575f72});});})[_0x1dc2('0x29')](function(){_0x2716d[_0x1dc2('0x71')](function(_0x18c3a5){socket[_0x1dc2('0x72')](_0x1dc2('0x73'),{'UserId':_0x18c3a5['id'],'OpenchannelQueueId':_0x4f1327['id']});});});});});}})[_0x1dc2('0x29')](respondWithStatusCode(_0x95e8f3,null))[_0x1dc2('0x4d')](handleError(_0x95e8f3,null));};exports[_0x1dc2('0x74')]=function(_0x3b5ab1,_0x7208dc,_0x46ea52){return db[_0x1dc2('0x67')]['findAll']({'where':{'id':_0x3b5ab1['query'][_0x1dc2('0x68')]},'attributes':['id'],'include':[{'model':db[_0x1dc2('0x5f')],'as':_0x1dc2('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x7208dc,null))[_0x1dc2('0x29')](function(_0x39fa9f){var _0x2ac74b=_[_0x1dc2('0x5d')](_0x39fa9f,'id');var _0x539cca=[];var _0x12e85c=[];var _0x2443e0=squel[_0x1dc2('0x75')]();_0x2443e0['field'](_0x1dc2('0x76'))['from'](_0x1dc2('0x77'),'tq')['join'](_0x1dc2('0x78'),'ut',_0x1dc2('0x79'))[_0x1dc2('0x43')]('OpenchannelQueueId\x20=\x20?',_0x3b5ab1[_0x1dc2('0x57')]['id']);for(var _0x5be502=0x0;_0x5be502<_0x39fa9f[_0x1dc2('0x3f')];_0x5be502+=0x1){let _0x384ac7=_0x39fa9f[_0x5be502];for(var _0x1a60b3=0x0;_0x1a60b3<_0x384ac7[_0x1dc2('0x69')][_0x1dc2('0x3f')];_0x1a60b3+=0x1){let _0x3ded06=_0x384ac7[_0x1dc2('0x69')][_0x1a60b3];var _0x1fe317=_0x2443e0[_0x1dc2('0x7a')]();_0x1fe317[_0x1dc2('0x43')](_0x1dc2('0x7b'),_0x3ded06['id']);_0x12e85c[_0x1dc2('0x7c')](db[_0x1dc2('0x6d')][_0x1dc2('0x39')](_0x1fe317['toString'](),{'type':db['sequelize']['QueryTypes'][_0x1dc2('0x7d')]})[_0x1dc2('0x29')](function(_0x5524a4){if(_0x5524a4[_0x1dc2('0x3f')]===0x1){return _0x3ded06['id'];}else{var _0x3da0e2=_[_0x1dc2('0x7e')](_['map'](_0x5524a4,_0x1dc2('0x7f')),function(_0x2b5a54){return _['includes'](_0x2ac74b,_0x2b5a54);});if(_0x3da0e2){return _0x3ded06['id'];}}}));}}return BPromise[_0x1dc2('0x80')](_0x12e85c)['then'](function(_0x147bf9){_0x539cca=_(_0x539cca)[_0x1dc2('0x81')](_0x147bf9)[_0x1dc2('0x82')]()['value']();return db['OpenchannelQueue']['find']({'where':{'id':_0x3b5ab1[_0x1dc2('0x57')]['id']}})[_0x1dc2('0x29')](function(_0x397ad3){return db['sequelize'][_0x1dc2('0x6e')](function(_0x142c22){return _0x397ad3[_0x1dc2('0x74')](_0x3b5ab1[_0x1dc2('0x39')][_0x1dc2('0x68')],{'transaction':_0x142c22})[_0x1dc2('0x29')](function(){if(!_['isEmpty'](_0x539cca)){return _0x397ad3[_0x1dc2('0x83')](_0x539cca,{'transaction':_0x142c22});}})[_0x1dc2('0x29')](function(){_0x539cca[_0x1dc2('0x71')](function(_0x4cd0a6){socket[_0x1dc2('0x72')](_0x1dc2('0x84'),{'UserId':_0x4cd0a6,'OpenchannelQueueId':_0x397ad3['id']});});});});});});})[_0x1dc2('0x29')](respondWithStatusCode(_0x7208dc,null))[_0x1dc2('0x4d')](handleError(_0x7208dc,null));};exports[_0x1dc2('0x85')]=function(_0x3c8a19,_0x593352,_0x35c6c1){return db[_0x1dc2('0x33')]['find']({'where':{'id':_0x3c8a19[_0x1dc2('0x57')]['id']}})[_0x1dc2('0x29')](handleEntityNotFound(_0x593352,null))[_0x1dc2('0x29')](function(_0x19d288){if(_0x19d288){return _0x19d288[_0x1dc2('0x85')](_0x3c8a19[_0x1dc2('0x50')][_0x1dc2('0x68')],_[_0x1dc2('0x86')](_0x3c8a19[_0x1dc2('0x50')],[_0x1dc2('0x68'),'id'])||{})[_0x1dc2('0x87')](function(_0x1b8fe5){for(var _0x5d5d18=0x0;_0x5d5d18<_0x3c8a19[_0x1dc2('0x50')]['ids'][_0x1dc2('0x3f')];_0x5d5d18+=0x1){socket[_0x1dc2('0x72')]('userOpenchannelQueue:save',{'UserId':_0x3c8a19[_0x1dc2('0x50')]['ids'][_0x5d5d18],'OpenchannelQueueId':_0x3c8a19[_0x1dc2('0x57')]['id']});}return _0x1b8fe5;});}})['then'](respondWithResult(_0x593352,null))['catch'](handleError(_0x593352,null));};exports[_0x1dc2('0x83')]=function(_0x31b772,_0x4a41a8,_0x5dd603){return db[_0x1dc2('0x33')]['find']({'where':{'id':_0x31b772['params']['id']}})[_0x1dc2('0x29')](handleEntityNotFound(_0x4a41a8,null))[_0x1dc2('0x29')](function(_0x3565a2){if(_0x3565a2){return _0x3565a2[_0x1dc2('0x83')](_0x31b772['query'][_0x1dc2('0x68')])[_0x1dc2('0x29')](function(){if(_['isArray'](_0x31b772[_0x1dc2('0x39')][_0x1dc2('0x68')])){for(var _0x325368=0x0;_0x325368<_0x31b772['query'][_0x1dc2('0x68')][_0x1dc2('0x3f')];_0x325368+=0x1){socket['emit'](_0x1dc2('0x84'),{'UserId':Number(_0x31b772['query'][_0x1dc2('0x68')][_0x325368]),'OpenchannelQueueId':Number(_0x31b772['params']['id'])});}}else{socket[_0x1dc2('0x72')](_0x1dc2('0x84'),{'UserId':Number(_0x31b772['query'][_0x1dc2('0x68')]),'OpenchannelQueueId':Number(_0x31b772['params']['id'])});}});}})[_0x1dc2('0x29')](respondWithStatusCode(_0x4a41a8,null))[_0x1dc2('0x4d')](handleError(_0x4a41a8,null));};exports[_0x1dc2('0x88')]=function(_0x29ea96,_0x508aab,_0xc486ad){var _0x399637={};var _0x5774a8={};var _0x448858;var _0x1747d4;return db[_0x1dc2('0x33')][_0x1dc2('0x5a')]({'where':{'id':_0x29ea96[_0x1dc2('0x57')]['id']}})[_0x1dc2('0x29')](handleEntityNotFound(_0x508aab,null))['then'](function(_0x383c63){if(_0x383c63){_0x448858=_0x383c63;_0x5774a8[_0x1dc2('0x38')]=_[_0x1dc2('0x3a')](db['User'][_0x1dc2('0x34')]);_0x5774a8['query']=_[_0x1dc2('0x3a')](_0x29ea96['query']);_0x5774a8[_0x1dc2('0x3b')]=_[_0x1dc2('0x3c')](_0x5774a8[_0x1dc2('0x38')],_0x5774a8['query']);_0x399637[_0x1dc2('0x3d')]=_['intersection'](_0x5774a8[_0x1dc2('0x38')],qs[_0x1dc2('0x3e')](_0x29ea96[_0x1dc2('0x39')]['fields']));_0x399637[_0x1dc2('0x3d')]=_0x399637[_0x1dc2('0x3d')][_0x1dc2('0x3f')]?_0x399637[_0x1dc2('0x3d')]:_0x5774a8['model'];_0x399637[_0x1dc2('0x41')]=qs['sort'](_0x29ea96[_0x1dc2('0x39')][_0x1dc2('0x42')]);_0x399637['where']=qs['filters'](_[_0x1dc2('0x44')](_0x29ea96['query'],_0x5774a8['filters']));if(_0x29ea96[_0x1dc2('0x39')]['filter']){_0x399637[_0x1dc2('0x43')]=_[_0x1dc2('0x46')](_0x399637[_0x1dc2('0x43')],{'$or':_[_0x1dc2('0x5d')](_0x399637[_0x1dc2('0x3d')],function(_0x483179){var _0x385178={};_0x385178[_0x483179]={'$like':'%'+_0x29ea96[_0x1dc2('0x39')][_0x1dc2('0x45')]+'%'};return _0x385178;})});}_0x399637=_['merge']({},_0x399637,_0x29ea96['options']);return _0x448858[_0x1dc2('0x88')](_0x399637);}})[_0x1dc2('0x29')](function(_0x2db89d){if(_0x2db89d){_0x1747d4=_0x2db89d[_0x1dc2('0x3f')];if(!_0x29ea96[_0x1dc2('0x39')][_0x1dc2('0x40')](_0x1dc2('0x5b'))){_0x399637[_0x1dc2('0x24')]=qs[_0x1dc2('0x24')](_0x29ea96['query'][_0x1dc2('0x24')]);_0x399637[_0x1dc2('0x23')]=qs[_0x1dc2('0x23')](_0x29ea96[_0x1dc2('0x39')][_0x1dc2('0x23')]);}return _0x448858['getAgents'](_0x399637);}})[_0x1dc2('0x29')](function(_0x170faf){if(_0x170faf){return _0x170faf?{'count':_0x1747d4,'rows':_0x170faf}:null;}})[_0x1dc2('0x29')](respondWithResult(_0x508aab,null))[_0x1dc2('0x4d')](handleError(_0x508aab,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 0a602b4..77e907a 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 _0xcf98=['exports','OpenchannelQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x428add,_0x54b606){var _0x250f53=function(_0x31116d){while(--_0x31116d){_0x428add['push'](_0x428add['shift']());}};_0x250f53(++_0x54b606);}(_0xcf98,0x7f));var _0x8cf9=function(_0x4d46cc,_0x265f74){_0x4d46cc=_0x4d46cc-0x0;var _0x8165f2=_0xcf98[_0x4d46cc];return _0x8165f2;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0x8cf9('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x8cf9('0x1')](0x0);var events={'afterCreate':_0x8cf9('0x2'),'afterUpdate':_0x8cf9('0x3'),'afterDestroy':_0x8cf9('0x4')};function emitEvent(_0x544049){return function(_0x5827d3,_0x1b0b57,_0x465f8e){OpenchannelQueueEvents[_0x8cf9('0x5')](_0x544049+':'+_0x5827d3['id'],_0x5827d3);OpenchannelQueueEvents['emit'](_0x544049,_0x5827d3);_0x465f8e(null);};}for(var e in events){if(events[_0x8cf9('0x6')](e)){var event=events[e];OpenchannelQueue[_0x8cf9('0x7')](e,emitEvent(event));}}module[_0x8cf9('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xcd15=['emit','hook','events','../../mysqldb','OpenchannelQueue','setMaxListeners'];(function(_0x5a5083,_0x1f786d){var _0x474f36=function(_0x375ba6){while(--_0x375ba6){_0x5a5083['push'](_0x5a5083['shift']());}};_0x474f36(++_0x1f786d);}(_0xcd15,0x1c4));var _0x5cd1=function(_0x4fb1b8,_0x32d98d){_0x4fb1b8=_0x4fb1b8-0x0;var _0x146c71=_0xcd15[_0x4fb1b8];return _0x146c71;};'use strict';var EventEmitter=require(_0x5cd1('0x0'));var OpenchannelQueue=require(_0x5cd1('0x1'))['db'][_0x5cd1('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x5cd1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x34d9fb){return function(_0x3a9dd0,_0x184582,_0x556f4f){OpenchannelQueueEvents[_0x5cd1('0x4')](_0x34d9fb+':'+_0x3a9dd0['id'],_0x3a9dd0);OpenchannelQueueEvents['emit'](_0x34d9fb,_0x3a9dd0);_0x556f4f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x5cd1('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 79ac0d3..feb3b06 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 _0x8acf=['exports','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelQueue.attributes'];(function(_0x5d8d5f,_0x1adf93){var _0x10be5c=function(_0x6866bb){while(--_0x6866bb){_0x5d8d5f['push'](_0x5d8d5f['shift']());}};_0x10be5c(++_0x1adf93);}(_0x8acf,0xba));var _0xf8ac=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x8acf[_0x1b6186];return _0x186121;};'use strict';var _=require(_0xf8ac('0x0'));var util=require(_0xf8ac('0x1'));var logger=require(_0xf8ac('0x2'))(_0xf8ac('0x3'));var moment=require('moment');var BPromise=require(_0xf8ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8ac('0x5'));var rimraf=require(_0xf8ac('0x6'));var config=require(_0xf8ac('0x7'));var attributes=require(_0xf8ac('0x8'));module[_0xf8ac('0x9')]=function(_0x37f5b3,_0x365ac0){return _0x37f5b3[_0xf8ac('0xa')](_0xf8ac('0xb'),attributes,{'tableName':_0xf8ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b2b=['openchannel_queues','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1b2b,0x141));var _0xb1b2=function(_0x4dbdda,_0x11f07c){_0x4dbdda=_0x4dbdda-0x0;var _0x1acbf1=_0x1b2b[_0x4dbdda];return _0x1acbf1;};'use strict';var _=require(_0xb1b2('0x0'));var util=require('util');var logger=require(_0xb1b2('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb1b2('0x2'));var fs=require('fs');var path=require(_0xb1b2('0x3'));var rimraf=require(_0xb1b2('0x4'));var config=require(_0xb1b2('0x5'));var attributes=require(_0xb1b2('0x6'));module[_0xb1b2('0x7')]=function(_0x26b434,_0x1ef36d){return _0x26b434['define'](_0xb1b2('0x8'),attributes,{'tableName':_0xb1b2('0x9'),'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 d1f0a4f..e5284e3 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 _0xd9e6=['raw','where','attributes','limit','map','include','model','ShowOpenchannelQueue','OpenchannelQueue','find','stringify','catch','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result','GetOpenchannelQueue','findAll','options'];(function(_0x16fbb1,_0x205919){var _0x2139c5=function(_0x147895){while(--_0x147895){_0x16fbb1['push'](_0x16fbb1['shift']());}};_0x2139c5(++_0x205919);}(_0xd9e6,0x81));var _0x6d9e=function(_0xb43cda,_0x2b21a6){_0xb43cda=_0xb43cda-0x0;var _0x18d100=_0xd9e6[_0xb43cda];return _0x18d100;};'use strict';var _=require('lodash');var util=require(_0x6d9e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6d9e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6d9e('0x2'));var logger=require(_0x6d9e('0x3'))(_0x6d9e('0x4'));var config=require(_0x6d9e('0x5'));var jayson=require(_0x6d9e('0x6'));var client=jayson[_0x6d9e('0x7')][_0x6d9e('0x8')]({'port':0x232a});config['redis']=_[_0x6d9e('0x9')](config[_0x6d9e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d9e('0xb'))(new Redis(config[_0x6d9e('0xa')]));require(_0x6d9e('0xc'))[_0x6d9e('0xd')](socket);function respondWithRpcPromise(_0x262192,_0x1f0949,_0x40e4d1){return new BPromise(function(_0x4f8f3a,_0x3f742d){return client[_0x6d9e('0xe')](_0x262192,_0x40e4d1)[_0x6d9e('0xf')](function(_0x58e338){logger[_0x6d9e('0x10')](_0x6d9e('0x11'),_0x1f0949,_0x6d9e('0x12'));logger[_0x6d9e('0x13')](_0x6d9e('0x14'),_0x1f0949,_0x6d9e('0x12'),JSON['stringify'](_0x58e338));if(_0x58e338[_0x6d9e('0x15')]){if(_0x58e338[_0x6d9e('0x15')]['code']===0x1f4){logger[_0x6d9e('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x1f0949,_0x58e338[_0x6d9e('0x15')]['message']);return _0x3f742d(_0x58e338[_0x6d9e('0x15')][_0x6d9e('0x16')]);}logger[_0x6d9e('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x1f0949,_0x58e338['error'][_0x6d9e('0x16')]);return _0x4f8f3a(_0x58e338[_0x6d9e('0x15')][_0x6d9e('0x16')]);}else{logger[_0x6d9e('0x10')](_0x6d9e('0x11'),_0x1f0949,_0x6d9e('0x12'));_0x4f8f3a(_0x58e338[_0x6d9e('0x17')]['message']);}})['catch'](function(_0x98d24f){logger[_0x6d9e('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x1f0949,_0x98d24f);_0x3f742d(_0x98d24f);});});}exports[_0x6d9e('0x18')]=function(_0x23ac56){var _0x52680d=this;return new Promise(function(_0x2418a9,_0x47c5fb){return db['OpenchannelQueue'][_0x6d9e('0x19')]({'raw':_0x23ac56[_0x6d9e('0x1a')]?_0x23ac56[_0x6d9e('0x1a')][_0x6d9e('0x1b')]===undefined?!![]:![]:!![],'where':_0x23ac56[_0x6d9e('0x1a')]?_0x23ac56[_0x6d9e('0x1a')][_0x6d9e('0x1c')]||null:null,'attributes':_0x23ac56['options']?_0x23ac56['options'][_0x6d9e('0x1d')]||null:null,'limit':_0x23ac56['options']?_0x23ac56[_0x6d9e('0x1a')][_0x6d9e('0x1e')]||null:null,'include':_0x23ac56[_0x6d9e('0x1a')]?_0x23ac56[_0x6d9e('0x1a')]['include']?_[_0x6d9e('0x1f')](_0x23ac56[_0x6d9e('0x1a')][_0x6d9e('0x20')],function(_0x501101){return{'model':db[_0x501101['model']],'as':_0x501101['as'],'attributes':_0x501101[_0x6d9e('0x1d')],'include':_0x501101[_0x6d9e('0x20')]?_[_0x6d9e('0x1f')](_0x501101[_0x6d9e('0x20')],function(_0x206338){return{'model':db[_0x206338[_0x6d9e('0x21')]],'as':_0x206338['as'],'attributes':_0x206338[_0x6d9e('0x1d')],'include':_0x206338[_0x6d9e('0x20')]?_[_0x6d9e('0x1f')](_0x206338['include'],function(_0x4dba57){return{'model':db[_0x4dba57[_0x6d9e('0x21')]],'as':_0x4dba57['as'],'attributes':_0x4dba57[_0x6d9e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6d9e('0xf')](function(_0x2f3ab4){logger[_0x6d9e('0x10')](_0x6d9e('0x18'),_0x23ac56);logger[_0x6d9e('0x13')](_0x6d9e('0x18'),_0x23ac56,JSON['stringify'](_0x2f3ab4));_0x2418a9(_0x2f3ab4);})['catch'](function(_0x37b2ed){logger[_0x6d9e('0x15')]('GetOpenchannelQueue',_0x37b2ed['message'],_0x23ac56);_0x47c5fb(_0x52680d[_0x6d9e('0x15')](0x1f4,_0x37b2ed[_0x6d9e('0x16')]));});});};exports[_0x6d9e('0x22')]=function(_0x3e39e3){var _0x5587e0=this;return new Promise(function(_0x4aa7b2,_0xcd29c1){return db[_0x6d9e('0x23')][_0x6d9e('0x24')]({'raw':_0x3e39e3['options']?_0x3e39e3['options']['raw']===undefined?!![]:![]:!![],'where':_0x3e39e3['options']?_0x3e39e3[_0x6d9e('0x1a')][_0x6d9e('0x1c')]||null:null,'attributes':_0x3e39e3['options']?_0x3e39e3[_0x6d9e('0x1a')][_0x6d9e('0x1d')]||null:null,'include':_0x3e39e3[_0x6d9e('0x1a')]?_0x3e39e3[_0x6d9e('0x1a')][_0x6d9e('0x20')]?_[_0x6d9e('0x1f')](_0x3e39e3[_0x6d9e('0x1a')]['include'],function(_0x2201d8){return{'model':db[_0x2201d8[_0x6d9e('0x21')]],'as':_0x2201d8['as'],'attributes':_0x2201d8[_0x6d9e('0x1d')],'include':_0x2201d8[_0x6d9e('0x20')]?_['map'](_0x2201d8[_0x6d9e('0x20')],function(_0x1da10b){return{'model':db[_0x1da10b[_0x6d9e('0x21')]],'as':_0x1da10b['as'],'attributes':_0x1da10b[_0x6d9e('0x1d')],'include':_0x1da10b[_0x6d9e('0x20')]?_['map'](_0x1da10b[_0x6d9e('0x20')],function(_0x5480f9){return{'model':db[_0x5480f9[_0x6d9e('0x21')]],'as':_0x5480f9['as'],'attributes':_0x5480f9[_0x6d9e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x6d9e('0xf')](function(_0x51273a){logger[_0x6d9e('0x10')](_0x6d9e('0x22'),_0x3e39e3);logger[_0x6d9e('0x13')](_0x6d9e('0x22'),_0x3e39e3,JSON[_0x6d9e('0x25')](_0x51273a));_0x4aa7b2(_0x51273a);})[_0x6d9e('0x26')](function(_0x222742){logger[_0x6d9e('0x15')](_0x6d9e('0x22'),_0x222742[_0x6d9e('0x16')],_0x3e39e3);_0xcd29c1(_0x5587e0[_0x6d9e('0x15')](0x1f4,_0x222742[_0x6d9e('0x16')]));});});}; \ No newline at end of file +var _0x317f=['jayson/promise','client','http','redis','defaults','localhost','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','include','map','model','then','catch','find','where','ShowOpenchannelQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x208edb,_0x3715b3){var _0x193148=function(_0x480dbc){while(--_0x480dbc){_0x208edb['push'](_0x208edb['shift']());}};_0x193148(++_0x3715b3);}(_0x317f,0x148));var _0xf317=function(_0x37fadb,_0x5dbce1){_0x37fadb=_0x37fadb-0x0;var _0x3d33e0=_0x317f[_0x37fadb];return _0x3d33e0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf317('0x0'));var BPromise=require(_0xf317('0x1'));var rs=require(_0xf317('0x2'));var fs=require('fs');var Redis=require(_0xf317('0x3'));var db=require(_0xf317('0x4'))['db'];var utils=require(_0xf317('0x5'));var logger=require(_0xf317('0x6'))(_0xf317('0x7'));var config=require('../../config/environment');var jayson=require(_0xf317('0x8'));var client=jayson[_0xf317('0x9')][_0xf317('0xa')]({'port':0x232a});config[_0xf317('0xb')]=_[_0xf317('0xc')](config[_0xf317('0xb')],{'host':_0xf317('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf317('0xb')]));require(_0xf317('0xe'))[_0xf317('0xf')](socket);function respondWithRpcPromise(_0x51a295,_0x385815,_0x1d56a5){return new BPromise(function(_0x22a84a,_0x499300){return client[_0xf317('0x10')](_0x51a295,_0x1d56a5)['then'](function(_0x366bb2){logger['info'](_0xf317('0x11'),_0x385815,_0xf317('0x12'));logger[_0xf317('0x13')](_0xf317('0x14'),_0x385815,'request\x20sent',JSON[_0xf317('0x15')](_0x366bb2));if(_0x366bb2[_0xf317('0x16')]){if(_0x366bb2['error'][_0xf317('0x17')]===0x1f4){logger[_0xf317('0x16')](_0xf317('0x11'),_0x385815,_0x366bb2['error'][_0xf317('0x18')]);return _0x499300(_0x366bb2[_0xf317('0x16')][_0xf317('0x18')]);}logger[_0xf317('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x385815,_0x366bb2[_0xf317('0x16')]['message']);return _0x22a84a(_0x366bb2['error'][_0xf317('0x18')]);}else{logger[_0xf317('0x19')](_0xf317('0x11'),_0x385815,'request\x20sent');_0x22a84a(_0x366bb2[_0xf317('0x1a')][_0xf317('0x18')]);}})['catch'](function(_0x283df6){logger[_0xf317('0x16')](_0xf317('0x11'),_0x385815,_0x283df6);_0x499300(_0x283df6);});});}exports[_0xf317('0x1b')]=function(_0xa730aa){var _0x5eb43d=this;return new Promise(function(_0x4e2e48,_0x86bb02){return db[_0xf317('0x1c')][_0xf317('0x1d')]({'raw':_0xa730aa[_0xf317('0x1e')]?_0xa730aa[_0xf317('0x1e')][_0xf317('0x1f')]===undefined?!![]:![]:!![],'where':_0xa730aa['options']?_0xa730aa['options']['where']||null:null,'attributes':_0xa730aa[_0xf317('0x1e')]?_0xa730aa[_0xf317('0x1e')][_0xf317('0x20')]||null:null,'limit':_0xa730aa[_0xf317('0x1e')]?_0xa730aa[_0xf317('0x1e')][_0xf317('0x21')]||null:null,'include':_0xa730aa[_0xf317('0x1e')]?_0xa730aa[_0xf317('0x1e')][_0xf317('0x22')]?_[_0xf317('0x23')](_0xa730aa[_0xf317('0x1e')]['include'],function(_0x15d474){return{'model':db[_0x15d474[_0xf317('0x24')]],'as':_0x15d474['as'],'attributes':_0x15d474['attributes'],'include':_0x15d474[_0xf317('0x22')]?_['map'](_0x15d474[_0xf317('0x22')],function(_0x12f3b7){return{'model':db[_0x12f3b7[_0xf317('0x24')]],'as':_0x12f3b7['as'],'attributes':_0x12f3b7[_0xf317('0x20')],'include':_0x12f3b7['include']?_['map'](_0x12f3b7[_0xf317('0x22')],function(_0x1ff334){return{'model':db[_0x1ff334[_0xf317('0x24')]],'as':_0x1ff334['as'],'attributes':_0x1ff334[_0xf317('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf317('0x25')](function(_0x42221f){logger[_0xf317('0x19')](_0xf317('0x1b'),_0xa730aa);logger[_0xf317('0x13')](_0xf317('0x1b'),_0xa730aa,JSON['stringify'](_0x42221f));_0x4e2e48(_0x42221f);})[_0xf317('0x26')](function(_0x4e09ec){logger[_0xf317('0x16')](_0xf317('0x1b'),_0x4e09ec['message'],_0xa730aa);_0x86bb02(_0x5eb43d[_0xf317('0x16')](0x1f4,_0x4e09ec[_0xf317('0x18')]));});});};exports['ShowOpenchannelQueue']=function(_0x14d6e6){var _0x3835c9=this;return new Promise(function(_0x107504,_0x4657ec){return db[_0xf317('0x1c')][_0xf317('0x27')]({'raw':_0x14d6e6[_0xf317('0x1e')]?_0x14d6e6[_0xf317('0x1e')][_0xf317('0x1f')]===undefined?!![]:![]:!![],'where':_0x14d6e6[_0xf317('0x1e')]?_0x14d6e6[_0xf317('0x1e')][_0xf317('0x28')]||null:null,'attributes':_0x14d6e6[_0xf317('0x1e')]?_0x14d6e6[_0xf317('0x1e')][_0xf317('0x20')]||null:null,'include':_0x14d6e6[_0xf317('0x1e')]?_0x14d6e6[_0xf317('0x1e')][_0xf317('0x22')]?_[_0xf317('0x23')](_0x14d6e6[_0xf317('0x1e')][_0xf317('0x22')],function(_0x3d6608){return{'model':db[_0x3d6608[_0xf317('0x24')]],'as':_0x3d6608['as'],'attributes':_0x3d6608[_0xf317('0x20')],'include':_0x3d6608[_0xf317('0x22')]?_[_0xf317('0x23')](_0x3d6608[_0xf317('0x22')],function(_0x335d84){return{'model':db[_0x335d84[_0xf317('0x24')]],'as':_0x335d84['as'],'attributes':_0x335d84['attributes'],'include':_0x335d84[_0xf317('0x22')]?_[_0xf317('0x23')](_0x335d84[_0xf317('0x22')],function(_0x26edfa){return{'model':db[_0x26edfa['model']],'as':_0x26edfa['as'],'attributes':_0x26edfa[_0xf317('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf317('0x25')](function(_0x37a417){logger[_0xf317('0x19')](_0xf317('0x29'),_0x14d6e6);logger[_0xf317('0x13')](_0xf317('0x29'),_0x14d6e6,JSON[_0xf317('0x15')](_0x37a417));_0x107504(_0x37a417);})[_0xf317('0x26')](function(_0x10f60a){logger[_0xf317('0x16')](_0xf317('0x29'),_0x10f60a[_0xf317('0x18')],_0x14d6e6);_0x4657ec(_0x3835c9[_0xf317('0x16')](0x1f4,_0x10f60a[_0xf317('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 92a4f81..3bf2d1d 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 _0x4d1b=['./openchannelQueue.events','save','remove','update','emit','register','length','openchannelQueue:'];(function(_0x41c94c,_0x40d116){var _0x31ea6d=function(_0x28539b){while(--_0x28539b){_0x41c94c['push'](_0x41c94c['shift']());}};_0x31ea6d(++_0x40d116);}(_0x4d1b,0xd8));var _0xb4d1=function(_0x31ced5,_0x5d5415){_0x31ced5=_0x31ced5-0x0;var _0x10d9e5=_0x4d1b[_0x31ced5];return _0x10d9e5;};'use strict';var OpenchannelQueueEvents=require(_0xb4d1('0x0'));var events=[_0xb4d1('0x1'),_0xb4d1('0x2'),_0xb4d1('0x3')];function createListener(_0x4e2463,_0x420a3d){return function(_0x4f0bf0){_0x420a3d[_0xb4d1('0x4')](_0x4e2463,_0x4f0bf0);};}function removeListener(_0x2994cb,_0x56381a){return function(){OpenchannelQueueEvents['removeListener'](_0x2994cb,_0x56381a);};}exports[_0xb4d1('0x5')]=function(_0x1d7cb4){for(var _0x5c59a0=0x0,_0x3debda=events[_0xb4d1('0x6')];_0x5c59a0<_0x3debda;_0x5c59a0++){var _0x37ef93=events[_0x5c59a0];var _0x4df8f1=createListener(_0xb4d1('0x7')+_0x37ef93,_0x1d7cb4);OpenchannelQueueEvents['on'](_0x37ef93,_0x4df8f1);}}; \ No newline at end of file +var _0xcebe=['remove','update','emit','removeListener','length','./openchannelQueue.events','save'];(function(_0x3cc5fd,_0x569445){var _0x31c92e=function(_0x24f665){while(--_0x24f665){_0x3cc5fd['push'](_0x3cc5fd['shift']());}};_0x31c92e(++_0x569445);}(_0xcebe,0x124));var _0xeceb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xcebe[_0x397e5f];return _0x5302b8;};'use strict';var OpenchannelQueueEvents=require(_0xeceb('0x0'));var events=[_0xeceb('0x1'),_0xeceb('0x2'),_0xeceb('0x3')];function createListener(_0x79cb00,_0x10e7cf){return function(_0x376770){_0x10e7cf[_0xeceb('0x4')](_0x79cb00,_0x376770);};}function removeListener(_0x38ee3e,_0x267965){return function(){OpenchannelQueueEvents[_0xeceb('0x5')](_0x38ee3e,_0x267965);};}exports['register']=function(_0x58fc82){for(var _0x59cc82=0x0,_0x45b8e1=events[_0xeceb('0x6')];_0x59cc82<_0x45b8e1;_0x59cc82++){var _0x4bc228=events[_0x59cc82];var _0x5f110b=createListener('openchannelQueue:'+_0x4bc228,_0x58fc82);OpenchannelQueueEvents['on'](_0x4bc228,_0x5f110b);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index f7b5971..c4c06e5 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 _0x97e9=['delete','destroy','exports','util','express','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','put','/:id'];(function(_0x376b86,_0x27599b){var _0x421244=function(_0x322ac2){while(--_0x322ac2){_0x376b86['push'](_0x376b86['shift']());}};_0x421244(++_0x27599b);}(_0x97e9,0x1a3));var _0x997e=function(_0x5af55b,_0x9b8fd5){_0x5af55b=_0x5af55b-0x0;var _0x522c0b=_0x97e9[_0x5af55b];return _0x522c0b;};'use strict';var multer=require('multer');var util=require(_0x997e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x997e('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x997e('0x2'));var config=require(_0x997e('0x3'));var controller=require(_0x997e('0x4'));router[_0x997e('0x5')]('/',auth[_0x997e('0x6')](),controller[_0x997e('0x7')]);router[_0x997e('0x5')]('/describe',auth[_0x997e('0x6')](),controller['describe']);router[_0x997e('0x5')]('/:id',auth[_0x997e('0x6')](),controller['show']);router['post']('/',auth[_0x997e('0x6')](),controller['create']);router[_0x997e('0x8')](_0x997e('0x9'),auth[_0x997e('0x6')](),controller['update']);router[_0x997e('0xa')](_0x997e('0x9'),auth['isAuthenticated'](),controller[_0x997e('0xb')]);module[_0x997e('0xc')]=router; \ No newline at end of file +var _0x87c9=['../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','update','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x87c9,0x176));var _0x987c=function(_0x601612,_0x36dccf){_0x601612=_0x601612-0x0;var _0x4053a8=_0x87c9[_0x601612];return _0x4053a8;};'use strict';var multer=require('multer');var util=require(_0x987c('0x0'));var path=require(_0x987c('0x1'));var timeout=require(_0x987c('0x2'));var express=require('express');var router=express[_0x987c('0x3')]();var auth=require(_0x987c('0x4'));var interaction=require(_0x987c('0x5'));var config=require('../../config/environment');var controller=require(_0x987c('0x6'));router[_0x987c('0x7')]('/',auth[_0x987c('0x8')](),controller[_0x987c('0x9')]);router[_0x987c('0x7')](_0x987c('0xa'),auth[_0x987c('0x8')](),controller[_0x987c('0xb')]);router[_0x987c('0x7')](_0x987c('0xc'),auth[_0x987c('0x8')](),controller['show']);router[_0x987c('0xd')]('/',auth[_0x987c('0x8')](),controller['create']);router['put'](_0x987c('0xc'),auth[_0x987c('0x8')](),controller[_0x987c('0xe')]);router[_0x987c('0xf')](_0x987c('0xc'),auth['isAuthenticated'](),controller[_0x987c('0x10')]);module[_0x987c('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 6da1c6e..04001de 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 _0x4df5=['exports','STRING','DATE','moment'];(function(_0x525af9,_0x4edd23){var _0x129fbf=function(_0x4f44fe){while(--_0x4f44fe){_0x525af9['push'](_0x525af9['shift']());}};_0x129fbf(++_0x4edd23);}(_0x4df5,0x163));var _0x54df=function(_0x38eddd,_0x15a3d0){_0x38eddd=_0x38eddd-0x0;var _0x14a76d=_0x4df5[_0x38eddd];return _0x14a76d;};'use strict';var moment=require(_0x54df('0x0'));var Sequelize=require('sequelize');module[_0x54df('0x1')]={'uniqueid':{'type':Sequelize[_0x54df('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x54df('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x54df('0x3')]},'acceptAt':{'type':Sequelize[_0x54df('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x54df('0x2')]}}; \ No newline at end of file +var _0x0016=['STRING','DATE','moment','sequelize','exports'];(function(_0x4ddb4e,_0x38c020){var _0x1c2f4c=function(_0x4cf0cb){while(--_0x4cf0cb){_0x4ddb4e['push'](_0x4ddb4e['shift']());}};_0x1c2f4c(++_0x38c020);}(_0x0016,0xfc));var _0x6001=function(_0x57f8c0,_0x136cf6){_0x57f8c0=_0x57f8c0-0x0;var _0x117f08=_0x0016[_0x57f8c0];return _0x117f08;};'use strict';var moment=require(_0x6001('0x0'));var Sequelize=require(_0x6001('0x1'));module[_0x6001('0x2')]={'uniqueid':{'type':Sequelize[_0x6001('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x6001('0x3')]},'joinAt':{'type':Sequelize[_0x6001('0x4')]},'leaveAt':{'type':Sequelize[_0x6001('0x4')]},'acceptAt':{'type':Sequelize[_0x6001('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 3ed8a88..2705464 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 _0x7c93=['send','index','map','OpenchannelQueueReport','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','count','includeAll','include','findAll','rows','show','rawAttributes','options','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','api','../../config/utils','../../mysqldb','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name'];(function(_0x471c28,_0x34bb66){var _0x5f3c9c=function(_0xc90138){while(--_0xc90138){_0x471c28['push'](_0x471c28['shift']());}};_0x5f3c9c(++_0x34bb66);}(_0x7c93,0xc4));var _0x37c9=function(_0x33f173,_0x29f1dc){_0x33f173=_0x33f173-0x0;var _0x301f70=_0x7c93[_0x33f173];return _0x301f70;};'use strict';var pdf=require(_0x37c9('0x0'));var emlformat=require(_0x37c9('0x1'));var rimraf=require(_0x37c9('0x2'));var zipdir=require(_0x37c9('0x3'));var jsonpatch=require(_0x37c9('0x4'));var rp=require(_0x37c9('0x5'));var moment=require(_0x37c9('0x6'));var BPromise=require(_0x37c9('0x7'));var Mustache=require(_0x37c9('0x8'));var util=require(_0x37c9('0x9'));var path=require(_0x37c9('0xa'));var sox=require(_0x37c9('0xb'));var csv=require(_0x37c9('0xc'));var ejs=require(_0x37c9('0xd'));var fs=require('fs');var _=require(_0x37c9('0xe'));var squel=require(_0x37c9('0xf'));var crypto=require('crypto');var jsforce=require(_0x37c9('0x10'));var deskjs=require(_0x37c9('0x11'));var toCsv=require(_0x37c9('0xc'));var querystring=require(_0x37c9('0x12'));var Papa=require(_0x37c9('0x13'));var Redis=require(_0x37c9('0x14'));var authService=require(_0x37c9('0x15'));var qs=require(_0x37c9('0x16'));var as=require(_0x37c9('0x17'));var hardwareService=require(_0x37c9('0x18'));var logger=require(_0x37c9('0x19'))(_0x37c9('0x1a'));var utils=require(_0x37c9('0x1b'));var config=require('../../config/environment');var db=require(_0x37c9('0x1c'))['db'];function respondWithStatusCode(_0x1415aa,_0xe73696){_0xe73696=_0xe73696||0xcc;return function(_0x3ce3c5){if(_0x3ce3c5){return _0x1415aa['sendStatus'](_0xe73696);}return _0x1415aa[_0x37c9('0x1d')](_0xe73696)['end']();};}function respondWithResult(_0x98e543,_0x446caf){_0x446caf=_0x446caf||0xc8;return function(_0x3ae00c){if(_0x3ae00c){return _0x98e543['status'](_0x446caf)[_0x37c9('0x1e')](_0x3ae00c);}};}function respondWithFilteredResult(_0x25622a,_0x48f1ca){return function(_0xa091e5){if(_0xa091e5){var _0x5592e4=_0xa091e5['count'],_0x34e2b8=_0x48f1ca[_0x37c9('0x1f')],_0x3a3ba1=_0x48f1ca[_0x37c9('0x1f')]+_0x48f1ca[_0x37c9('0x20')],_0x9a2cf;if(_0x3a3ba1>=_0x5592e4){_0x3a3ba1=_0x5592e4;_0x9a2cf=0xc8;}else{_0x9a2cf=0xce;}_0x25622a[_0x37c9('0x1d')](_0x9a2cf);return _0x25622a[_0x37c9('0x21')](_0x37c9('0x22'),_0x34e2b8+'-'+_0x3a3ba1+'/'+_0x5592e4)[_0x37c9('0x1e')](_0xa091e5);}return null;};}function patchUpdates(_0x51df0f){return function(_0x5a6905){try{jsonpatch['apply'](_0x5a6905,_0x51df0f,!![]);}catch(_0xd4c455){return BPromise[_0x37c9('0x23')](_0xd4c455);}return _0x5a6905[_0x37c9('0x24')]();};}function saveUpdates(_0x515d4f,_0x594d59){return function(_0x4064d5){if(_0x4064d5){return _0x4064d5[_0x37c9('0x25')](_0x515d4f)['then'](function(_0x4ecd98){return _0x4ecd98;});}return null;};}function removeEntity(_0x585093,_0x544add){return function(_0x4f0cbc){if(_0x4f0cbc){return _0x4f0cbc[_0x37c9('0x26')]()[_0x37c9('0x27')](function(){_0x585093[_0x37c9('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcccf30,_0x5274c3){return function(_0x304eba){if(!_0x304eba){_0xcccf30[_0x37c9('0x28')](0x194);}return _0x304eba;};}function handleError(_0x404d46,_0x4fc183){_0x4fc183=_0x4fc183||0x1f4;return function(_0x10783a){logger[_0x37c9('0x29')](_0x10783a[_0x37c9('0x2a')]);if(_0x10783a['name']){delete _0x10783a[_0x37c9('0x2b')];}_0x404d46[_0x37c9('0x1d')](_0x4fc183)[_0x37c9('0x2c')](_0x10783a);};}exports[_0x37c9('0x2d')]=function(_0x4dd0c0,_0x5d752a){var _0x1c2237={},_0x2978ae={},_0x2463ce={'count':0x0,'rows':[]};var _0x3d93a7=_[_0x37c9('0x2e')](db[_0x37c9('0x2f')]['rawAttributes'],function(_0x1cf8f3){return{'name':_0x1cf8f3['fieldName'],'type':_0x1cf8f3['type'][_0x37c9('0x30')]};});_0x2978ae['model']=_['map'](_0x3d93a7,'name');_0x2978ae[_0x37c9('0x31')]=_[_0x37c9('0x32')](_0x4dd0c0[_0x37c9('0x31')]);_0x2978ae[_0x37c9('0x33')]=_[_0x37c9('0x34')](_0x2978ae[_0x37c9('0x35')],_0x2978ae[_0x37c9('0x31')]);_0x1c2237['attributes']=_[_0x37c9('0x34')](_0x2978ae[_0x37c9('0x35')],qs[_0x37c9('0x36')](_0x4dd0c0[_0x37c9('0x31')]['fields']));_0x1c2237['attributes']=_0x1c2237[_0x37c9('0x37')]['length']?_0x1c2237[_0x37c9('0x37')]:_0x2978ae[_0x37c9('0x35')];if(!_0x4dd0c0['query'][_0x37c9('0x38')](_0x37c9('0x39'))){_0x1c2237[_0x37c9('0x20')]=qs[_0x37c9('0x20')](_0x4dd0c0[_0x37c9('0x31')][_0x37c9('0x20')]);_0x1c2237[_0x37c9('0x1f')]=qs[_0x37c9('0x1f')](_0x4dd0c0[_0x37c9('0x31')][_0x37c9('0x1f')]);}_0x1c2237[_0x37c9('0x3a')]=qs[_0x37c9('0x3b')](_0x4dd0c0[_0x37c9('0x31')]['sort']);_0x1c2237[_0x37c9('0x3c')]=qs[_0x37c9('0x33')](_[_0x37c9('0x3d')](_0x4dd0c0['query'],_0x2978ae['filters']),_0x3d93a7);if(_0x4dd0c0[_0x37c9('0x31')]['filter']){_0x1c2237['where']=_[_0x37c9('0x3e')](_0x1c2237[_0x37c9('0x3c')],{'$or':_[_0x37c9('0x2e')](_0x3d93a7,function(_0x4bf4eb){if(_0x4bf4eb[_0x37c9('0x3f')]!==_0x37c9('0x40')){var _0x30290b={};_0x30290b[_0x4bf4eb[_0x37c9('0x2b')]]={'$like':'%'+_0x4dd0c0['query'][_0x37c9('0x41')]+'%'};return _0x30290b;}})});}_0x1c2237=_[_0x37c9('0x3e')]({},_0x1c2237,_0x4dd0c0['options']);var _0x73a526={'where':_0x1c2237['where']};return db[_0x37c9('0x2f')]['count'](_0x73a526)[_0x37c9('0x27')](function(_0xf64762){_0x2463ce[_0x37c9('0x42')]=_0xf64762;if(_0x4dd0c0[_0x37c9('0x31')][_0x37c9('0x43')]){_0x1c2237[_0x37c9('0x44')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x37c9('0x45')](_0x1c2237);})['then'](function(_0x1db6ae){_0x2463ce[_0x37c9('0x46')]=_0x1db6ae;return _0x2463ce;})[_0x37c9('0x27')](respondWithFilteredResult(_0x5d752a,_0x1c2237))['catch'](handleError(_0x5d752a,null));};exports[_0x37c9('0x47')]=function(_0x1167c1,_0x5cd3b2){var _0x539db7={'raw':!![],'where':{'id':_0x1167c1['params']['id']}},_0x53120f={};_0x53120f[_0x37c9('0x35')]=_[_0x37c9('0x32')](db['OpenchannelQueueReport'][_0x37c9('0x48')]);_0x53120f[_0x37c9('0x31')]=_[_0x37c9('0x32')](_0x1167c1[_0x37c9('0x31')]);_0x53120f[_0x37c9('0x33')]=_[_0x37c9('0x34')](_0x53120f[_0x37c9('0x35')],_0x53120f[_0x37c9('0x31')]);_0x539db7[_0x37c9('0x37')]=_[_0x37c9('0x34')](_0x53120f[_0x37c9('0x35')],qs[_0x37c9('0x36')](_0x1167c1['query'][_0x37c9('0x36')]));_0x539db7[_0x37c9('0x37')]=_0x539db7[_0x37c9('0x37')]['length']?_0x539db7[_0x37c9('0x37')]:_0x53120f['model'];if(_0x1167c1['query'][_0x37c9('0x43')]){_0x539db7['include']=[{'all':!![]}];}_0x539db7=_[_0x37c9('0x3e')]({},_0x539db7,_0x1167c1[_0x37c9('0x49')]);return db[_0x37c9('0x2f')][_0x37c9('0x4a')](_0x539db7)[_0x37c9('0x27')](handleEntityNotFound(_0x5cd3b2,null))['then'](respondWithResult(_0x5cd3b2,null))[_0x37c9('0x4b')](handleError(_0x5cd3b2,null));};exports[_0x37c9('0x4c')]=function(_0x2d8713,_0x1b4df7){return db['OpenchannelQueueReport']['create'](_0x2d8713['body'],{})[_0x37c9('0x27')](respondWithResult(_0x1b4df7,0xc9))['catch'](handleError(_0x1b4df7,null));};exports[_0x37c9('0x25')]=function(_0xf88f6,_0x4c7a5e){if(_0xf88f6[_0x37c9('0x4d')]['id']){delete _0xf88f6['body']['id'];}return db[_0x37c9('0x2f')]['find']({'where':{'id':_0xf88f6[_0x37c9('0x4e')]['id']}})[_0x37c9('0x27')](handleEntityNotFound(_0x4c7a5e,null))[_0x37c9('0x27')](saveUpdates(_0xf88f6[_0x37c9('0x4d')],null))[_0x37c9('0x27')](respondWithResult(_0x4c7a5e,null))[_0x37c9('0x4b')](handleError(_0x4c7a5e,null));};exports[_0x37c9('0x26')]=function(_0x52392f,_0x52778a){return db[_0x37c9('0x2f')]['find']({'where':{'id':_0x52392f[_0x37c9('0x4e')]['id']}})['then'](handleEntityNotFound(_0x52778a,null))[_0x37c9('0x27')](removeEntity(_0x52778a,null))[_0x37c9('0x4b')](handleError(_0x52778a,null));};exports[_0x37c9('0x4f')]=function(_0x5be544,_0x443ebc){return db[_0x37c9('0x2f')][_0x37c9('0x4f')]()[_0x37c9('0x27')](respondWithResult(_0x443ebc,null))[_0x37c9('0x4b')](handleError(_0x443ebc,null));}; \ No newline at end of file +var _0x5776=['show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','map','OpenchannelQueueReport','rawAttributes','type','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x5776,0x17d));var _0x6577=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5776[_0x46e363];return _0x3fb059;};'use strict';var pdf=require(_0x6577('0x0'));var emlformat=require(_0x6577('0x1'));var rimraf=require(_0x6577('0x2'));var zipdir=require(_0x6577('0x3'));var jsonpatch=require(_0x6577('0x4'));var rp=require(_0x6577('0x5'));var moment=require(_0x6577('0x6'));var BPromise=require(_0x6577('0x7'));var Mustache=require(_0x6577('0x8'));var util=require(_0x6577('0x9'));var path=require(_0x6577('0xa'));var sox=require('sox');var csv=require(_0x6577('0xb'));var ejs=require(_0x6577('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6577('0xd'));var crypto=require(_0x6577('0xe'));var jsforce=require(_0x6577('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x6577('0xb'));var querystring=require(_0x6577('0x10'));var Papa=require(_0x6577('0x11'));var Redis=require(_0x6577('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6577('0x13'));var as=require(_0x6577('0x14'));var hardwareService=require(_0x6577('0x15'));var logger=require(_0x6577('0x16'))(_0x6577('0x17'));var utils=require(_0x6577('0x18'));var config=require(_0x6577('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ca1cd,_0x48becd){_0x48becd=_0x48becd||0xcc;return function(_0x555a3f){if(_0x555a3f){return _0x1ca1cd[_0x6577('0x1a')](_0x48becd);}return _0x1ca1cd[_0x6577('0x1b')](_0x48becd)[_0x6577('0x1c')]();};}function respondWithResult(_0x48125b,_0x33fcda){_0x33fcda=_0x33fcda||0xc8;return function(_0x5a9ee0){if(_0x5a9ee0){return _0x48125b[_0x6577('0x1b')](_0x33fcda)[_0x6577('0x1d')](_0x5a9ee0);}};}function respondWithFilteredResult(_0x3a94c3,_0x2d09bc){return function(_0x47d0a5){if(_0x47d0a5){var _0xd107e7=_0x47d0a5[_0x6577('0x1e')],_0x63f7ba=_0x2d09bc['offset'],_0x2b296c=_0x2d09bc[_0x6577('0x1f')]+_0x2d09bc[_0x6577('0x20')],_0x4eddc3;if(_0x2b296c>=_0xd107e7){_0x2b296c=_0xd107e7;_0x4eddc3=0xc8;}else{_0x4eddc3=0xce;}_0x3a94c3[_0x6577('0x1b')](_0x4eddc3);return _0x3a94c3['set'](_0x6577('0x21'),_0x63f7ba+'-'+_0x2b296c+'/'+_0xd107e7)[_0x6577('0x1d')](_0x47d0a5);}return null;};}function patchUpdates(_0x4d4065){return function(_0x449b26){try{jsonpatch['apply'](_0x449b26,_0x4d4065,!![]);}catch(_0x25f540){return BPromise[_0x6577('0x22')](_0x25f540);}return _0x449b26[_0x6577('0x23')]();};}function saveUpdates(_0x34f43a,_0x44905a){return function(_0x1b3507){if(_0x1b3507){return _0x1b3507[_0x6577('0x24')](_0x34f43a)[_0x6577('0x25')](function(_0x433e49){return _0x433e49;});}return null;};}function removeEntity(_0x35c498,_0x47379a){return function(_0x11351e){if(_0x11351e){return _0x11351e[_0x6577('0x26')]()[_0x6577('0x25')](function(){_0x35c498[_0x6577('0x1b')](0xcc)[_0x6577('0x1c')]();});}};}function handleEntityNotFound(_0x38d84b,_0xb0bc85){return function(_0x3071ea){if(!_0x3071ea){_0x38d84b[_0x6577('0x1a')](0x194);}return _0x3071ea;};}function handleError(_0x5c4f71,_0x160a51){_0x160a51=_0x160a51||0x1f4;return function(_0x1607fe){logger[_0x6577('0x27')](_0x1607fe['stack']);if(_0x1607fe['name']){delete _0x1607fe['name'];}_0x5c4f71[_0x6577('0x1b')](_0x160a51)['send'](_0x1607fe);};}exports['index']=function(_0x4b864d,_0x541f7b){var _0x57ed93={},_0x312486={},_0x3a6772={'count':0x0,'rows':[]};var _0x42d8a3=_[_0x6577('0x28')](db[_0x6577('0x29')][_0x6577('0x2a')],function(_0x524f82){return{'name':_0x524f82['fieldName'],'type':_0x524f82[_0x6577('0x2b')][_0x6577('0x2c')]};});_0x312486['model']=_[_0x6577('0x28')](_0x42d8a3,_0x6577('0x2d'));_0x312486[_0x6577('0x2e')]=_[_0x6577('0x2f')](_0x4b864d[_0x6577('0x2e')]);_0x312486[_0x6577('0x30')]=_['intersection'](_0x312486[_0x6577('0x31')],_0x312486[_0x6577('0x2e')]);_0x57ed93[_0x6577('0x32')]=_[_0x6577('0x33')](_0x312486['model'],qs['fields'](_0x4b864d[_0x6577('0x2e')][_0x6577('0x34')]));_0x57ed93[_0x6577('0x32')]=_0x57ed93[_0x6577('0x32')][_0x6577('0x35')]?_0x57ed93[_0x6577('0x32')]:_0x312486[_0x6577('0x31')];if(!_0x4b864d[_0x6577('0x2e')][_0x6577('0x36')](_0x6577('0x37'))){_0x57ed93[_0x6577('0x20')]=qs['limit'](_0x4b864d[_0x6577('0x2e')][_0x6577('0x20')]);_0x57ed93['offset']=qs['offset'](_0x4b864d[_0x6577('0x2e')][_0x6577('0x1f')]);}_0x57ed93[_0x6577('0x38')]=qs['sort'](_0x4b864d['query'][_0x6577('0x39')]);_0x57ed93[_0x6577('0x3a')]=qs['filters'](_[_0x6577('0x3b')](_0x4b864d['query'],_0x312486[_0x6577('0x30')]),_0x42d8a3);if(_0x4b864d[_0x6577('0x2e')][_0x6577('0x3c')]){_0x57ed93[_0x6577('0x3a')]=_[_0x6577('0x3d')](_0x57ed93[_0x6577('0x3a')],{'$or':_[_0x6577('0x28')](_0x42d8a3,function(_0x1cc6ff){if(_0x1cc6ff['type']!==_0x6577('0x3e')){var _0x14891a={};_0x14891a[_0x1cc6ff['name']]={'$like':'%'+_0x4b864d[_0x6577('0x2e')][_0x6577('0x3c')]+'%'};return _0x14891a;}})});}_0x57ed93=_[_0x6577('0x3d')]({},_0x57ed93,_0x4b864d[_0x6577('0x3f')]);var _0x39673f={'where':_0x57ed93[_0x6577('0x3a')]};return db[_0x6577('0x29')]['count'](_0x39673f)['then'](function(_0xa354d){_0x3a6772['count']=_0xa354d;if(_0x4b864d[_0x6577('0x2e')][_0x6577('0x40')]){_0x57ed93[_0x6577('0x41')]=[{'all':!![]}];}return db[_0x6577('0x29')][_0x6577('0x42')](_0x57ed93);})['then'](function(_0x7805f7){_0x3a6772[_0x6577('0x43')]=_0x7805f7;return _0x3a6772;})[_0x6577('0x25')](respondWithFilteredResult(_0x541f7b,_0x57ed93))[_0x6577('0x44')](handleError(_0x541f7b,null));};exports[_0x6577('0x45')]=function(_0x33557e,_0xc984f){var _0xd26ec5={'raw':!![],'where':{'id':_0x33557e[_0x6577('0x46')]['id']}},_0x60ea91={};_0x60ea91[_0x6577('0x31')]=_[_0x6577('0x2f')](db[_0x6577('0x29')][_0x6577('0x2a')]);_0x60ea91[_0x6577('0x2e')]=_[_0x6577('0x2f')](_0x33557e[_0x6577('0x2e')]);_0x60ea91[_0x6577('0x30')]=_[_0x6577('0x33')](_0x60ea91['model'],_0x60ea91[_0x6577('0x2e')]);_0xd26ec5[_0x6577('0x32')]=_[_0x6577('0x33')](_0x60ea91['model'],qs[_0x6577('0x34')](_0x33557e[_0x6577('0x2e')][_0x6577('0x34')]));_0xd26ec5[_0x6577('0x32')]=_0xd26ec5[_0x6577('0x32')][_0x6577('0x35')]?_0xd26ec5['attributes']:_0x60ea91[_0x6577('0x31')];if(_0x33557e[_0x6577('0x2e')][_0x6577('0x40')]){_0xd26ec5['include']=[{'all':!![]}];}_0xd26ec5=_['merge']({},_0xd26ec5,_0x33557e['options']);return db[_0x6577('0x29')][_0x6577('0x47')](_0xd26ec5)[_0x6577('0x25')](handleEntityNotFound(_0xc984f,null))['then'](respondWithResult(_0xc984f,null))[_0x6577('0x44')](handleError(_0xc984f,null));};exports[_0x6577('0x48')]=function(_0x8b7028,_0x5a6df9){return db[_0x6577('0x29')]['create'](_0x8b7028[_0x6577('0x49')],{})[_0x6577('0x25')](respondWithResult(_0x5a6df9,0xc9))[_0x6577('0x44')](handleError(_0x5a6df9,null));};exports[_0x6577('0x24')]=function(_0xa073f7,_0x41b1ba){if(_0xa073f7['body']['id']){delete _0xa073f7[_0x6577('0x49')]['id'];}return db['OpenchannelQueueReport'][_0x6577('0x47')]({'where':{'id':_0xa073f7[_0x6577('0x46')]['id']}})['then'](handleEntityNotFound(_0x41b1ba,null))[_0x6577('0x25')](saveUpdates(_0xa073f7[_0x6577('0x49')],null))[_0x6577('0x25')](respondWithResult(_0x41b1ba,null))['catch'](handleError(_0x41b1ba,null));};exports[_0x6577('0x26')]=function(_0x306f6c,_0x44021c){return db[_0x6577('0x29')]['find']({'where':{'id':_0x306f6c[_0x6577('0x46')]['id']}})[_0x6577('0x25')](handleEntityNotFound(_0x44021c,null))[_0x6577('0x25')](removeEntity(_0x44021c,null))[_0x6577('0x44')](handleError(_0x44021c,null));};exports[_0x6577('0x4a')]=function(_0x3ac4a9,_0x281590){return db['OpenchannelQueueReport'][_0x6577('0x4a')]()['then'](respondWithResult(_0x281590,null))['catch'](handleError(_0x281590,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 14abc55..a4058f7 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 _0x0e12=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','report_openchannel_queue','uniqueid','lodash'];(function(_0x1c1172,_0x27c3c4){var _0x300943=function(_0x3f8b89){while(--_0x3f8b89){_0x1c1172['push'](_0x1c1172['shift']());}};_0x300943(++_0x27c3c4);}(_0x0e12,0x77));var _0x20e1=function(_0x35a274,_0x98b399){_0x35a274=_0x35a274-0x0;var _0x40d905=_0x0e12[_0x35a274];return _0x40d905;};'use strict';var _=require(_0x20e1('0x0'));var util=require(_0x20e1('0x1'));var logger=require('../../config/logger')(_0x20e1('0x2'));var moment=require(_0x20e1('0x3'));var BPromise=require(_0x20e1('0x4'));var rp=require(_0x20e1('0x5'));var fs=require('fs');var path=require(_0x20e1('0x6'));var rimraf=require('rimraf');var config=require(_0x20e1('0x7'));var attributes=require(_0x20e1('0x8'));module[_0x20e1('0x9')]=function(_0x23da65,_0x3fdb7b){return _0x23da65['define']('OpenchannelQueueReport',attributes,{'tableName':_0x20e1('0xa'),'paranoid':![],'indexes':[{'name':_0x20e1('0xb'),'fields':[_0x20e1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf485=['../../config/environment','define','OpenchannelQueueReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3fb415,_0x4c01ba){var _0xc757de=function(_0x254fd5){while(--_0x254fd5){_0x3fb415['push'](_0x3fb415['shift']());}};_0xc757de(++_0x4c01ba);}(_0xf485,0x9e));var _0x5f48=function(_0x5b26d8,_0x5250ca){_0x5b26d8=_0x5b26d8-0x0;var _0x409de5=_0xf485[_0x5b26d8];return _0x409de5;};'use strict';var _=require(_0x5f48('0x0'));var util=require(_0x5f48('0x1'));var logger=require(_0x5f48('0x2'))('api');var moment=require(_0x5f48('0x3'));var BPromise=require(_0x5f48('0x4'));var rp=require(_0x5f48('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5f48('0x6'));var config=require(_0x5f48('0x7'));var attributes=require('./openchannelQueueReport.attributes');module['exports']=function(_0xed2795,_0x1430c0){return _0xed2795[_0x5f48('0x8')](_0x5f48('0x9'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0x5f48('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index f1a15c1..b34b962 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 _0x7046=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','create','body','options','raw','then','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2a14d4,_0xd6240f){var _0xa94c72=function(_0x5da13){while(--_0x5da13){_0x2a14d4['push'](_0x2a14d4['shift']());}};_0xa94c72(++_0xd6240f);}(_0x7046,0x144));var _0x6704=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7046[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var moment=require(_0x6704('0x2'));var BPromise=require(_0x6704('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6704('0x4'));var db=require(_0x6704('0x5'))['db'];var utils=require(_0x6704('0x6'));var logger=require('../../config/logger')(_0x6704('0x7'));var config=require(_0x6704('0x8'));var jayson=require(_0x6704('0x9'));var client=jayson[_0x6704('0xa')][_0x6704('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4badf8,_0x5ced8,_0x49b8b6){return new BPromise(function(_0x56b1ff,_0x390ace){return client['request'](_0x4badf8,_0x49b8b6)['then'](function(_0x3ca599){logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,_0x6704('0xe'));logger[_0x6704('0xf')](_0x6704('0x10'),_0x5ced8,_0x6704('0xe'),JSON[_0x6704('0x11')](_0x3ca599));if(_0x3ca599['error']){if(_0x3ca599[_0x6704('0x12')][_0x6704('0x13')]===0x1f4){logger['error'](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x390ace(_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);}logger[_0x6704('0x12')](_0x6704('0xd'),_0x5ced8,_0x3ca599[_0x6704('0x12')][_0x6704('0x14')]);return _0x56b1ff(_0x3ca599['error'][_0x6704('0x14')]);}else{logger[_0x6704('0xc')](_0x6704('0xd'),_0x5ced8,'request\x20sent');_0x56b1ff(_0x3ca599[_0x6704('0x15')][_0x6704('0x14')]);}})[_0x6704('0x16')](function(_0x29fa46){logger[_0x6704('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x5ced8,_0x29fa46);_0x390ace(_0x29fa46);});});}exports[_0x6704('0x17')]=function(_0x31d732){var _0x135f4b=this;return new Promise(function(_0xe49450,_0x344ed9){return db['OpenchannelQueueReport'][_0x6704('0x18')](_0x31d732[_0x6704('0x19')],{'raw':_0x31d732[_0x6704('0x1a')]?_0x31d732[_0x6704('0x1a')][_0x6704('0x1b')]===undefined?!![]:![]:!![]})[_0x6704('0x1c')](function(_0x42b27f){logger['info'](_0x6704('0x17'),_0x31d732);logger[_0x6704('0xf')](_0x6704('0x17'),_0x31d732,JSON['stringify'](_0x42b27f));_0xe49450(_0x42b27f);})['catch'](function(_0x48d829){logger[_0x6704('0x12')](_0x6704('0x17'),_0x48d829[_0x6704('0x14')],_0x31d732);_0x344ed9(_0x135f4b[_0x6704('0x12')](0x1f4,_0x48d829['message']));});});};exports[_0x6704('0x1d')]=function(_0xabb97a){var _0x3931b8=this;return new Promise(function(_0x348fcb,_0x16b6b9){return db[_0x6704('0x1e')][_0x6704('0x1f')](_0xabb97a[_0x6704('0x19')],{'raw':_0xabb97a[_0x6704('0x1a')]?_0xabb97a[_0x6704('0x1a')][_0x6704('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xabb97a[_0x6704('0x1a')]?_0xabb97a[_0x6704('0x1a')]['where']||null:null,'attributes':_0xabb97a['options']?_0xabb97a[_0x6704('0x1a')][_0x6704('0x20')]||null:null,'limit':_0xabb97a[_0x6704('0x1a')]?_0xabb97a[_0x6704('0x1a')]['limit']||null:null})[_0x6704('0x1c')](function(_0x18cd98){logger['info']('UpdateOpenchannelQueueReport',_0xabb97a);logger[_0x6704('0xf')]('UpdateOpenchannelQueueReport',_0xabb97a,JSON[_0x6704('0x11')](_0x18cd98));_0x348fcb(_0x18cd98);})['catch'](function(_0x53b2af){logger[_0x6704('0x12')](_0x6704('0x1d'),_0x53b2af[_0x6704('0x14')],_0xabb97a);_0x16b6b9(_0x3931b8['error'](0x1f4,_0x53b2af[_0x6704('0x14')]));});});}; \ No newline at end of file +var _0x82d8=['client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','create','body','options','raw','CreateOpenchannelQueueReport','stringify','OpenchannelQueueReport','attributes','UpdateOpenchannelQueueReport','lodash','moment','ioredis','../../config/utils','../../config/environment','jayson/promise'];(function(_0x3a1842,_0x27be26){var _0x5a7762=function(_0x153865){while(--_0x153865){_0x3a1842['push'](_0x3a1842['shift']());}};_0x5a7762(++_0x27be26);}(_0x82d8,0xff));var _0x882d=function(_0x8279fc,_0x365e78){_0x8279fc=_0x8279fc-0x0;var _0x197504=_0x82d8[_0x8279fc];return _0x197504;};'use strict';var _=require(_0x882d('0x0'));var util=require('util');var moment=require(_0x882d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x882d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x882d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x882d('0x4'));var jayson=require(_0x882d('0x5'));var client=jayson[_0x882d('0x6')][_0x882d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb7539b,_0x3c8b67,_0x4067a9){return new BPromise(function(_0x4ea710,_0x4035ba){return client[_0x882d('0x8')](_0xb7539b,_0x4067a9)[_0x882d('0x9')](function(_0x4da4aa){logger[_0x882d('0xa')](_0x882d('0xb'),_0x3c8b67,'request\x20sent');logger[_0x882d('0xc')](_0x882d('0xd'),_0x3c8b67,_0x882d('0xe'),JSON['stringify'](_0x4da4aa));if(_0x4da4aa[_0x882d('0xf')]){if(_0x4da4aa[_0x882d('0xf')][_0x882d('0x10')]===0x1f4){logger[_0x882d('0xf')](_0x882d('0xb'),_0x3c8b67,_0x4da4aa[_0x882d('0xf')][_0x882d('0x11')]);return _0x4035ba(_0x4da4aa['error']['message']);}logger[_0x882d('0xf')](_0x882d('0xb'),_0x3c8b67,_0x4da4aa[_0x882d('0xf')][_0x882d('0x11')]);return _0x4ea710(_0x4da4aa[_0x882d('0xf')]['message']);}else{logger[_0x882d('0xa')](_0x882d('0xb'),_0x3c8b67,_0x882d('0xe'));_0x4ea710(_0x4da4aa[_0x882d('0x12')][_0x882d('0x11')]);}})[_0x882d('0x13')](function(_0x46cfcc){logger[_0x882d('0xf')](_0x882d('0xb'),_0x3c8b67,_0x46cfcc);_0x4035ba(_0x46cfcc);});});}exports['CreateOpenchannelQueueReport']=function(_0x556b9b){var _0x33556b=this;return new Promise(function(_0x59aaec,_0x3e4cf5){return db['OpenchannelQueueReport'][_0x882d('0x14')](_0x556b9b[_0x882d('0x15')],{'raw':_0x556b9b[_0x882d('0x16')]?_0x556b9b['options'][_0x882d('0x17')]===undefined?!![]:![]:!![]})[_0x882d('0x9')](function(_0x14d709){logger['info'](_0x882d('0x18'),_0x556b9b);logger[_0x882d('0xc')](_0x882d('0x18'),_0x556b9b,JSON[_0x882d('0x19')](_0x14d709));_0x59aaec(_0x14d709);})[_0x882d('0x13')](function(_0x1a4a84){logger[_0x882d('0xf')](_0x882d('0x18'),_0x1a4a84[_0x882d('0x11')],_0x556b9b);_0x3e4cf5(_0x33556b['error'](0x1f4,_0x1a4a84[_0x882d('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x17ce48){var _0xb58bce=this;return new Promise(function(_0x233294,_0x217742){return db[_0x882d('0x1a')]['update'](_0x17ce48[_0x882d('0x15')],{'raw':_0x17ce48['options']?_0x17ce48[_0x882d('0x16')][_0x882d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17ce48['options']?_0x17ce48['options']['where']||null:null,'attributes':_0x17ce48['options']?_0x17ce48[_0x882d('0x16')][_0x882d('0x1b')]||null:null,'limit':_0x17ce48[_0x882d('0x16')]?_0x17ce48[_0x882d('0x16')]['limit']||null:null})[_0x882d('0x9')](function(_0x18ece4){logger[_0x882d('0xa')](_0x882d('0x1c'),_0x17ce48);logger[_0x882d('0xc')]('UpdateOpenchannelQueueReport',_0x17ce48,JSON['stringify'](_0x18ece4));_0x233294(_0x18ece4);})['catch'](function(_0x40fea6){logger[_0x882d('0xf')](_0x882d('0x1c'),_0x40fea6['message'],_0x17ce48);_0x217742(_0xb58bce[_0x882d('0xf')](0x1f4,_0x40fea6[_0x882d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 0dc4f85..148d0a2 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 _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x590851,_0x496bee){var _0x3b0115=function(_0x5140cc){while(--_0x5140cc){_0x590851['push'](_0x590851['shift']());}};_0x3b0115(++_0x496bee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 5abcfb4..e18eccc 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 _0xb3db=['ENUM','agent','queue','moment','exports'];(function(_0x412e27,_0x20a978){var _0x53da42=function(_0x43cae5){while(--_0x43cae5){_0x412e27['push'](_0x412e27['shift']());}};_0x53da42(++_0x20a978);}(_0xb3db,0x184));var _0xbb3d=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0xb3db[_0x210603];return _0x1bcb7d;};'use strict';var moment=require(_0xbb3d('0x0'));var Sequelize=require('sequelize');module[_0xbb3d('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xbb3d('0x2')]('account',_0xbb3d('0x3'),_0xbb3d('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xc40f=['sequelize','exports','STRING','account','queue','DATE','NOW','moment'];(function(_0x1109ae,_0x4817d6){var _0x3c8b36=function(_0x26ea2b){while(--_0x26ea2b){_0x1109ae['push'](_0x1109ae['shift']());}};_0x3c8b36(++_0x4817d6);}(_0xc40f,0x137));var _0xfc40=function(_0x20ceec,_0x5d61e6){_0x20ceec=_0x20ceec-0x0;var _0x567ceb=_0xc40f[_0x20ceec];return _0x567ceb;};'use strict';var moment=require(_0xfc40('0x0'));var Sequelize=require(_0xfc40('0x1'));module[_0xfc40('0x2')]={'uniqueid':{'type':Sequelize[_0xfc40('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xfc40('0x4'),'agent','queue'),'allowNull':![],'defaultValue':_0xfc40('0x5')},'transferredAt':{'type':Sequelize[_0xfc40('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xfc40('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 71f0870..53a8d64 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 _0xd9c5=['key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','count','findAll','rows','catch','show','length','include','find','create','body','params','describe','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName'];(function(_0x33b68d,_0x1bfd42){var _0x5d1f0d=function(_0x248422){while(--_0x248422){_0x33b68d['push'](_0x33b68d['shift']());}};_0x5d1f0d(++_0x1bfd42);}(_0xd9c5,0x19b));var _0x5d9c=function(_0x42abe0,_0xb99a10){_0x42abe0=_0x42abe0-0x0;var _0x130ea8=_0xd9c5[_0x42abe0];return _0x130ea8;};'use strict';var pdf=require(_0x5d9c('0x0'));var emlformat=require(_0x5d9c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5d9c('0x2'));var rp=require('request-promise');var moment=require(_0x5d9c('0x3'));var BPromise=require(_0x5d9c('0x4'));var Mustache=require(_0x5d9c('0x5'));var util=require(_0x5d9c('0x6'));var path=require(_0x5d9c('0x7'));var sox=require(_0x5d9c('0x8'));var csv=require('to-csv');var ejs=require(_0x5d9c('0x9'));var fs=require('fs');var _=require(_0x5d9c('0xa'));var squel=require(_0x5d9c('0xb'));var crypto=require(_0x5d9c('0xc'));var jsforce=require(_0x5d9c('0xd'));var deskjs=require(_0x5d9c('0xe'));var toCsv=require(_0x5d9c('0xf'));var querystring=require('querystring');var Papa=require(_0x5d9c('0x10'));var Redis=require('ioredis');var authService=require(_0x5d9c('0x11'));var qs=require(_0x5d9c('0x12'));var as=require(_0x5d9c('0x13'));var hardwareService=require(_0x5d9c('0x14'));var logger=require('../../config/logger')(_0x5d9c('0x15'));var utils=require('../../config/utils');var config=require(_0x5d9c('0x16'));var db=require(_0x5d9c('0x17'))['db'];function respondWithStatusCode(_0x3336fe,_0x17da30){_0x17da30=_0x17da30||0xcc;return function(_0x310137){if(_0x310137){return _0x3336fe[_0x5d9c('0x18')](_0x17da30);}return _0x3336fe[_0x5d9c('0x19')](_0x17da30)[_0x5d9c('0x1a')]();};}function respondWithResult(_0x4bb0e3,_0x6d28cb){_0x6d28cb=_0x6d28cb||0xc8;return function(_0x1291dc){if(_0x1291dc){return _0x4bb0e3[_0x5d9c('0x19')](_0x6d28cb)[_0x5d9c('0x1b')](_0x1291dc);}};}function respondWithFilteredResult(_0x1e46b9,_0x18c1c5){return function(_0x5b2ff4){if(_0x5b2ff4){var _0x174f2c=_0x5b2ff4['count'],_0x339da0=_0x18c1c5[_0x5d9c('0x1c')],_0x1c1f59=_0x18c1c5['offset']+_0x18c1c5['limit'],_0x143bc1;if(_0x1c1f59>=_0x174f2c){_0x1c1f59=_0x174f2c;_0x143bc1=0xc8;}else{_0x143bc1=0xce;}_0x1e46b9[_0x5d9c('0x19')](_0x143bc1);return _0x1e46b9[_0x5d9c('0x1d')](_0x5d9c('0x1e'),_0x339da0+'-'+_0x1c1f59+'/'+_0x174f2c)['json'](_0x5b2ff4);}return null;};}function patchUpdates(_0x4eb40d){return function(_0x25271d){try{jsonpatch[_0x5d9c('0x1f')](_0x25271d,_0x4eb40d,!![]);}catch(_0xa125ad){return BPromise[_0x5d9c('0x20')](_0xa125ad);}return _0x25271d[_0x5d9c('0x21')]();};}function saveUpdates(_0x33049d,_0x2fd8cb){return function(_0x233d1e){if(_0x233d1e){return _0x233d1e['update'](_0x33049d)[_0x5d9c('0x22')](function(_0x2b5594){return _0x2b5594;});}return null;};}function removeEntity(_0x291b16,_0x526090){return function(_0x33e21a){if(_0x33e21a){return _0x33e21a[_0x5d9c('0x23')]()['then'](function(){_0x291b16[_0x5d9c('0x19')](0xcc)[_0x5d9c('0x1a')]();});}};}function handleEntityNotFound(_0x1f9195,_0x2e3100){return function(_0x3eed2a){if(!_0x3eed2a){_0x1f9195[_0x5d9c('0x18')](0x194);}return _0x3eed2a;};}function handleError(_0x1a37fd,_0x5c23f7){_0x5c23f7=_0x5c23f7||0x1f4;return function(_0x5c02bf){logger[_0x5d9c('0x24')](_0x5c02bf[_0x5d9c('0x25')]);if(_0x5c02bf['name']){delete _0x5c02bf[_0x5d9c('0x26')];}_0x1a37fd[_0x5d9c('0x19')](_0x5c23f7)[_0x5d9c('0x27')](_0x5c02bf);};}exports[_0x5d9c('0x28')]=function(_0x5d5d2e,_0x24f2f4){var _0x558bbe={},_0x59cbd3={},_0xfc2c67={'count':0x0,'rows':[]};var _0xb02f8d=_[_0x5d9c('0x29')](db[_0x5d9c('0x2a')][_0x5d9c('0x2b')],function(_0x416cf5){return{'name':_0x416cf5[_0x5d9c('0x2c')],'type':_0x416cf5['type'][_0x5d9c('0x2d')]};});_0x59cbd3[_0x5d9c('0x2e')]=_[_0x5d9c('0x29')](_0xb02f8d,'name');_0x59cbd3[_0x5d9c('0x2f')]=_[_0x5d9c('0x30')](_0x5d5d2e[_0x5d9c('0x2f')]);_0x59cbd3['filters']=_[_0x5d9c('0x31')](_0x59cbd3[_0x5d9c('0x2e')],_0x59cbd3[_0x5d9c('0x2f')]);_0x558bbe[_0x5d9c('0x32')]=_['intersection'](_0x59cbd3['model'],qs[_0x5d9c('0x33')](_0x5d5d2e[_0x5d9c('0x2f')][_0x5d9c('0x33')]));_0x558bbe[_0x5d9c('0x32')]=_0x558bbe[_0x5d9c('0x32')]['length']?_0x558bbe[_0x5d9c('0x32')]:_0x59cbd3[_0x5d9c('0x2e')];if(!_0x5d5d2e['query']['hasOwnProperty'](_0x5d9c('0x34'))){_0x558bbe['limit']=qs['limit'](_0x5d5d2e[_0x5d9c('0x2f')][_0x5d9c('0x35')]);_0x558bbe[_0x5d9c('0x1c')]=qs['offset'](_0x5d5d2e[_0x5d9c('0x2f')][_0x5d9c('0x1c')]);}_0x558bbe[_0x5d9c('0x36')]=qs[_0x5d9c('0x37')](_0x5d5d2e[_0x5d9c('0x2f')][_0x5d9c('0x37')]);_0x558bbe[_0x5d9c('0x38')]=qs['filters'](_[_0x5d9c('0x39')](_0x5d5d2e['query'],_0x59cbd3[_0x5d9c('0x3a')]),_0xb02f8d);if(_0x5d5d2e[_0x5d9c('0x2f')][_0x5d9c('0x3b')]){_0x558bbe[_0x5d9c('0x38')]=_[_0x5d9c('0x3c')](_0x558bbe[_0x5d9c('0x38')],{'$or':_[_0x5d9c('0x29')](_0xb02f8d,function(_0x30f0b4){if(_0x30f0b4[_0x5d9c('0x3d')]!==_0x5d9c('0x3e')){var _0x54f47e={};_0x54f47e[_0x30f0b4[_0x5d9c('0x26')]]={'$like':'%'+_0x5d5d2e[_0x5d9c('0x2f')]['filter']+'%'};return _0x54f47e;}})});}_0x558bbe=_[_0x5d9c('0x3c')]({},_0x558bbe,_0x5d5d2e[_0x5d9c('0x3f')]);var _0x38548c={'where':_0x558bbe[_0x5d9c('0x38')]};return db['OpenchannelTransferReport']['count'](_0x38548c)[_0x5d9c('0x22')](function(_0x54fbb7){_0xfc2c67[_0x5d9c('0x40')]=_0x54fbb7;if(_0x5d5d2e[_0x5d9c('0x2f')]['includeAll']){_0x558bbe['include']=[{'all':!![]}];}return db[_0x5d9c('0x2a')][_0x5d9c('0x41')](_0x558bbe);})[_0x5d9c('0x22')](function(_0x528ad3){_0xfc2c67[_0x5d9c('0x42')]=_0x528ad3;return _0xfc2c67;})[_0x5d9c('0x22')](respondWithFilteredResult(_0x24f2f4,_0x558bbe))[_0x5d9c('0x43')](handleError(_0x24f2f4,null));};exports[_0x5d9c('0x44')]=function(_0x153230,_0x2682aa){var _0x24279b={'raw':!![],'where':{'id':_0x153230['params']['id']}},_0x43862f={};_0x43862f[_0x5d9c('0x2e')]=_[_0x5d9c('0x30')](db[_0x5d9c('0x2a')][_0x5d9c('0x2b')]);_0x43862f['query']=_['keys'](_0x153230[_0x5d9c('0x2f')]);_0x43862f[_0x5d9c('0x3a')]=_[_0x5d9c('0x31')](_0x43862f[_0x5d9c('0x2e')],_0x43862f[_0x5d9c('0x2f')]);_0x24279b['attributes']=_[_0x5d9c('0x31')](_0x43862f[_0x5d9c('0x2e')],qs[_0x5d9c('0x33')](_0x153230[_0x5d9c('0x2f')][_0x5d9c('0x33')]));_0x24279b[_0x5d9c('0x32')]=_0x24279b[_0x5d9c('0x32')][_0x5d9c('0x45')]?_0x24279b[_0x5d9c('0x32')]:_0x43862f['model'];if(_0x153230[_0x5d9c('0x2f')]['includeAll']){_0x24279b[_0x5d9c('0x46')]=[{'all':!![]}];}_0x24279b=_[_0x5d9c('0x3c')]({},_0x24279b,_0x153230['options']);return db['OpenchannelTransferReport'][_0x5d9c('0x47')](_0x24279b)[_0x5d9c('0x22')](handleEntityNotFound(_0x2682aa,null))['then'](respondWithResult(_0x2682aa,null))['catch'](handleError(_0x2682aa,null));};exports[_0x5d9c('0x48')]=function(_0x4a9d8d,_0x19aba5){return db[_0x5d9c('0x2a')][_0x5d9c('0x48')](_0x4a9d8d[_0x5d9c('0x49')],{})['then'](respondWithResult(_0x19aba5,0xc9))[_0x5d9c('0x43')](handleError(_0x19aba5,null));};exports['update']=function(_0x533b2f,_0x2fd6ed){if(_0x533b2f['body']['id']){delete _0x533b2f[_0x5d9c('0x49')]['id'];}return db[_0x5d9c('0x2a')][_0x5d9c('0x47')]({'where':{'id':_0x533b2f[_0x5d9c('0x4a')]['id']}})[_0x5d9c('0x22')](handleEntityNotFound(_0x2fd6ed,null))['then'](saveUpdates(_0x533b2f[_0x5d9c('0x49')],null))[_0x5d9c('0x22')](respondWithResult(_0x2fd6ed,null))[_0x5d9c('0x43')](handleError(_0x2fd6ed,null));};exports[_0x5d9c('0x23')]=function(_0x46c98d,_0x2539f1){return db[_0x5d9c('0x2a')][_0x5d9c('0x47')]({'where':{'id':_0x46c98d[_0x5d9c('0x4a')]['id']}})[_0x5d9c('0x22')](handleEntityNotFound(_0x2539f1,null))[_0x5d9c('0x22')](removeEntity(_0x2539f1,null))[_0x5d9c('0x43')](handleError(_0x2539f1,null));};exports['describe']=function(_0x97c4b4,_0x4423bb){return db[_0x5d9c('0x2a')][_0x5d9c('0x4b')]()[_0x5d9c('0x22')](respondWithResult(_0x4423bb,null))[_0x5d9c('0x43')](handleError(_0x4423bb,null));}; \ No newline at end of file +var _0x3051=['apply','reject','save','update','then','destroy','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','params','intersection','length','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','desk.js','querystring','papaparse','../../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','Content-Range','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3051,0x144));var _0x1305=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3051[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x1305('0x0'));var emlformat=require(_0x1305('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1305('0x2'));var jsonpatch=require(_0x1305('0x3'));var rp=require(_0x1305('0x4'));var moment=require(_0x1305('0x5'));var BPromise=require(_0x1305('0x6'));var Mustache=require(_0x1305('0x7'));var util=require('util');var path=require(_0x1305('0x8'));var sox=require(_0x1305('0x9'));var csv=require(_0x1305('0xa'));var ejs=require(_0x1305('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1305('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1305('0xd'));var Papa=require(_0x1305('0xe'));var Redis=require('ioredis');var authService=require(_0x1305('0xf'));var qs=require(_0x1305('0x10'));var as=require(_0x1305('0x11'));var hardwareService=require(_0x1305('0x12'));var logger=require(_0x1305('0x13'))(_0x1305('0x14'));var utils=require(_0x1305('0x15'));var config=require(_0x1305('0x16'));var db=require(_0x1305('0x17'))['db'];function respondWithStatusCode(_0x4a09f1,_0x127f1f){_0x127f1f=_0x127f1f||0xcc;return function(_0x13d70e){if(_0x13d70e){return _0x4a09f1[_0x1305('0x18')](_0x127f1f);}return _0x4a09f1[_0x1305('0x19')](_0x127f1f)[_0x1305('0x1a')]();};}function respondWithResult(_0x53dec5,_0x16d408){_0x16d408=_0x16d408||0xc8;return function(_0x511ed3){if(_0x511ed3){return _0x53dec5[_0x1305('0x19')](_0x16d408)['json'](_0x511ed3);}};}function respondWithFilteredResult(_0xb7371b,_0x285184){return function(_0x2abd18){if(_0x2abd18){var _0x3a9e42=_0x2abd18['count'],_0x588db7=_0x285184[_0x1305('0x1b')],_0x2989e7=_0x285184[_0x1305('0x1b')]+_0x285184[_0x1305('0x1c')],_0x2385d9;if(_0x2989e7>=_0x3a9e42){_0x2989e7=_0x3a9e42;_0x2385d9=0xc8;}else{_0x2385d9=0xce;}_0xb7371b[_0x1305('0x19')](_0x2385d9);return _0xb7371b['set'](_0x1305('0x1d'),_0x588db7+'-'+_0x2989e7+'/'+_0x3a9e42)[_0x1305('0x1e')](_0x2abd18);}return null;};}function patchUpdates(_0x4c55bd){return function(_0x1f3835){try{jsonpatch[_0x1305('0x1f')](_0x1f3835,_0x4c55bd,!![]);}catch(_0xe65b8c){return BPromise[_0x1305('0x20')](_0xe65b8c);}return _0x1f3835[_0x1305('0x21')]();};}function saveUpdates(_0x1967fe,_0x50c2ef){return function(_0x201be4){if(_0x201be4){return _0x201be4[_0x1305('0x22')](_0x1967fe)[_0x1305('0x23')](function(_0xaa31d1){return _0xaa31d1;});}return null;};}function removeEntity(_0x3bfb88,_0x517564){return function(_0x21e910){if(_0x21e910){return _0x21e910[_0x1305('0x24')]()[_0x1305('0x23')](function(){_0x3bfb88[_0x1305('0x19')](0xcc)[_0x1305('0x1a')]();});}};}function handleEntityNotFound(_0x5d497c,_0x28de0f){return function(_0x9851c5){if(!_0x9851c5){_0x5d497c[_0x1305('0x18')](0x194);}return _0x9851c5;};}function handleError(_0x207f23,_0x55bf34){_0x55bf34=_0x55bf34||0x1f4;return function(_0x5ecc94){logger[_0x1305('0x25')](_0x5ecc94[_0x1305('0x26')]);if(_0x5ecc94[_0x1305('0x27')]){delete _0x5ecc94[_0x1305('0x27')];}_0x207f23['status'](_0x55bf34)['send'](_0x5ecc94);};}exports[_0x1305('0x28')]=function(_0x34f71b,_0x1dcb45){var _0x42ef4d={},_0x112287={},_0x254214={'count':0x0,'rows':[]};var _0x475cc0=_[_0x1305('0x29')](db[_0x1305('0x2a')][_0x1305('0x2b')],function(_0x22804f){return{'name':_0x22804f['fieldName'],'type':_0x22804f['type']['key']};});_0x112287[_0x1305('0x2c')]=_[_0x1305('0x29')](_0x475cc0,'name');_0x112287[_0x1305('0x2d')]=_[_0x1305('0x2e')](_0x34f71b[_0x1305('0x2d')]);_0x112287[_0x1305('0x2f')]=_['intersection'](_0x112287['model'],_0x112287[_0x1305('0x2d')]);_0x42ef4d[_0x1305('0x30')]=_['intersection'](_0x112287[_0x1305('0x2c')],qs[_0x1305('0x31')](_0x34f71b[_0x1305('0x2d')][_0x1305('0x31')]));_0x42ef4d[_0x1305('0x30')]=_0x42ef4d[_0x1305('0x30')]['length']?_0x42ef4d[_0x1305('0x30')]:_0x112287['model'];if(!_0x34f71b['query'][_0x1305('0x32')](_0x1305('0x33'))){_0x42ef4d[_0x1305('0x1c')]=qs[_0x1305('0x1c')](_0x34f71b[_0x1305('0x2d')][_0x1305('0x1c')]);_0x42ef4d[_0x1305('0x1b')]=qs[_0x1305('0x1b')](_0x34f71b[_0x1305('0x2d')]['offset']);}_0x42ef4d['order']=qs['sort'](_0x34f71b[_0x1305('0x2d')][_0x1305('0x34')]);_0x42ef4d['where']=qs[_0x1305('0x2f')](_[_0x1305('0x35')](_0x34f71b[_0x1305('0x2d')],_0x112287[_0x1305('0x2f')]),_0x475cc0);if(_0x34f71b[_0x1305('0x2d')][_0x1305('0x36')]){_0x42ef4d[_0x1305('0x37')]=_[_0x1305('0x38')](_0x42ef4d[_0x1305('0x37')],{'$or':_['map'](_0x475cc0,function(_0x3dee69){if(_0x3dee69['type']!==_0x1305('0x39')){var _0x945cd5={};_0x945cd5[_0x3dee69[_0x1305('0x27')]]={'$like':'%'+_0x34f71b['query'][_0x1305('0x36')]+'%'};return _0x945cd5;}})});}_0x42ef4d=_[_0x1305('0x38')]({},_0x42ef4d,_0x34f71b[_0x1305('0x3a')]);var _0x26e4a1={'where':_0x42ef4d[_0x1305('0x37')]};return db[_0x1305('0x2a')][_0x1305('0x3b')](_0x26e4a1)['then'](function(_0x18aebe){_0x254214['count']=_0x18aebe;if(_0x34f71b['query'][_0x1305('0x3c')]){_0x42ef4d['include']=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x1305('0x3d')](_0x42ef4d);})[_0x1305('0x23')](function(_0x41f8d9){_0x254214[_0x1305('0x3e')]=_0x41f8d9;return _0x254214;})[_0x1305('0x23')](respondWithFilteredResult(_0x1dcb45,_0x42ef4d))[_0x1305('0x3f')](handleError(_0x1dcb45,null));};exports['show']=function(_0x4eeda0,_0x54cc4d){var _0x25a7df={'raw':!![],'where':{'id':_0x4eeda0[_0x1305('0x40')]['id']}},_0x45db05={};_0x45db05['model']=_['keys'](db[_0x1305('0x2a')][_0x1305('0x2b')]);_0x45db05[_0x1305('0x2d')]=_[_0x1305('0x2e')](_0x4eeda0['query']);_0x45db05[_0x1305('0x2f')]=_[_0x1305('0x41')](_0x45db05[_0x1305('0x2c')],_0x45db05[_0x1305('0x2d')]);_0x25a7df[_0x1305('0x30')]=_['intersection'](_0x45db05[_0x1305('0x2c')],qs['fields'](_0x4eeda0['query'][_0x1305('0x31')]));_0x25a7df[_0x1305('0x30')]=_0x25a7df['attributes'][_0x1305('0x42')]?_0x25a7df[_0x1305('0x30')]:_0x45db05[_0x1305('0x2c')];if(_0x4eeda0[_0x1305('0x2d')]['includeAll']){_0x25a7df['include']=[{'all':!![]}];}_0x25a7df=_[_0x1305('0x38')]({},_0x25a7df,_0x4eeda0[_0x1305('0x3a')]);return db['OpenchannelTransferReport']['find'](_0x25a7df)[_0x1305('0x23')](handleEntityNotFound(_0x54cc4d,null))[_0x1305('0x23')](respondWithResult(_0x54cc4d,null))[_0x1305('0x3f')](handleError(_0x54cc4d,null));};exports[_0x1305('0x43')]=function(_0x2c4e6f,_0x1ce2a5){return db[_0x1305('0x2a')][_0x1305('0x43')](_0x2c4e6f['body'],{})[_0x1305('0x23')](respondWithResult(_0x1ce2a5,0xc9))['catch'](handleError(_0x1ce2a5,null));};exports[_0x1305('0x22')]=function(_0x9c3022,_0x256971){if(_0x9c3022[_0x1305('0x44')]['id']){delete _0x9c3022['body']['id'];}return db[_0x1305('0x2a')][_0x1305('0x45')]({'where':{'id':_0x9c3022[_0x1305('0x40')]['id']}})[_0x1305('0x23')](handleEntityNotFound(_0x256971,null))[_0x1305('0x23')](saveUpdates(_0x9c3022['body'],null))[_0x1305('0x23')](respondWithResult(_0x256971,null))[_0x1305('0x3f')](handleError(_0x256971,null));};exports[_0x1305('0x24')]=function(_0x6064ff,_0x29222b){return db['OpenchannelTransferReport'][_0x1305('0x45')]({'where':{'id':_0x6064ff[_0x1305('0x40')]['id']}})['then'](handleEntityNotFound(_0x29222b,null))[_0x1305('0x23')](removeEntity(_0x29222b,null))[_0x1305('0x3f')](handleError(_0x29222b,null));};exports[_0x1305('0x46')]=function(_0x564d42,_0x38f489){return db[_0x1305('0x2a')]['describe']()[_0x1305('0x23')](respondWithResult(_0x38f489,null))[_0x1305('0x3f')](handleError(_0x38f489,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 0422c22..a2eb138 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 _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','api'];(function(_0x18a737,_0x4a4471){var _0x400a3b=function(_0x2a77d0){while(--_0x2a77d0){_0x18a737['push'](_0x18a737['shift']());}};_0x400a3b(++_0x4a4471);}(_0x5fab,0x177));var _0xb5fa=function(_0x538406,_0x25c40b){_0x538406=_0x538406-0x0;var _0x18f8fd=_0x5fab[_0x538406];return _0x18f8fd;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbd18=['lodash','util','../../config/logger','moment','rimraf','../../config/environment','define','OpenchannelTransferReport','uniqueid'];(function(_0x54ea73,_0x570c2c){var _0x26e9c2=function(_0x42bafd){while(--_0x42bafd){_0x54ea73['push'](_0x54ea73['shift']());}};_0x26e9c2(++_0x570c2c);}(_0xbd18,0x195));var _0x8bd1=function(_0x24b0b4,_0x35c41d){_0x24b0b4=_0x24b0b4-0x0;var _0x21e282=_0xbd18[_0x24b0b4];return _0x21e282;};'use strict';var _=require(_0x8bd1('0x0'));var util=require(_0x8bd1('0x1'));var logger=require(_0x8bd1('0x2'))('api');var moment=require(_0x8bd1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8bd1('0x4'));var config=require(_0x8bd1('0x5'));var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x205c76,_0x136254){return _0x205c76[_0x8bd1('0x6')](_0x8bd1('0x7'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x8bd1('0x8'),'fields':[_0x8bd1('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index c1c1416..26c9711 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 _0x30ea=['client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x52c7ab,_0x1b3634){var _0x2bb7e2=function(_0x25bfbb){while(--_0x25bfbb){_0x52c7ab['push'](_0x52c7ab['shift']());}};_0x2bb7e2(++_0x1b3634);}(_0x30ea,0x13a));var _0xa30e=function(_0xb2893d,_0x158ec5){_0xb2893d=_0xb2893d-0x0;var _0x1968b4=_0x30ea[_0xb2893d];return _0x1968b4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa30e('0x0'));var BPromise=require(_0xa30e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa30e('0x2'));var db=require(_0xa30e('0x3'))['db'];var utils=require(_0xa30e('0x4'));var logger=require('../../config/logger')(_0xa30e('0x5'));var config=require(_0xa30e('0x6'));var jayson=require(_0xa30e('0x7'));var client=jayson[_0xa30e('0x8')][_0xa30e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x68172e,_0x37cf20,_0x1e6c67){return new BPromise(function(_0x5496aa,_0x5cbf14){return client[_0xa30e('0xa')](_0x68172e,_0x1e6c67)[_0xa30e('0xb')](function(_0x496e46){logger[_0xa30e('0xc')](_0xa30e('0xd'),_0x37cf20,_0xa30e('0xe'));logger[_0xa30e('0xf')](_0xa30e('0x10'),_0x37cf20,_0xa30e('0xe'),JSON[_0xa30e('0x11')](_0x496e46));if(_0x496e46[_0xa30e('0x12')]){if(_0x496e46[_0xa30e('0x12')][_0xa30e('0x13')]===0x1f4){logger[_0xa30e('0x12')](_0xa30e('0xd'),_0x37cf20,_0x496e46['error'][_0xa30e('0x14')]);return _0x5cbf14(_0x496e46[_0xa30e('0x12')]['message']);}logger[_0xa30e('0x12')](_0xa30e('0xd'),_0x37cf20,_0x496e46[_0xa30e('0x12')][_0xa30e('0x14')]);return _0x5496aa(_0x496e46[_0xa30e('0x12')][_0xa30e('0x14')]);}else{logger['info'](_0xa30e('0xd'),_0x37cf20,_0xa30e('0xe'));_0x5496aa(_0x496e46[_0xa30e('0x15')][_0xa30e('0x14')]);}})[_0xa30e('0x16')](function(_0x4ca320){logger[_0xa30e('0x12')](_0xa30e('0xd'),_0x37cf20,_0x4ca320);_0x5cbf14(_0x4ca320);});});} \ No newline at end of file +var _0x6182=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x39ef9,_0x28437a){var _0x35784d=function(_0x42a42d){while(--_0x42a42d){_0x39ef9['push'](_0x39ef9['shift']());}};_0x35784d(++_0x28437a);}(_0x6182,0xc2));var _0x2618=function(_0x7b9c91,_0x3e5e9b){_0x7b9c91=_0x7b9c91-0x0;var _0x209bf1=_0x6182[_0x7b9c91];return _0x209bf1;};'use strict';var _=require(_0x2618('0x0'));var util=require('util');var moment=require(_0x2618('0x1'));var BPromise=require(_0x2618('0x2'));var rs=require(_0x2618('0x3'));var fs=require('fs');var Redis=require(_0x2618('0x4'));var db=require(_0x2618('0x5'))['db'];var utils=require(_0x2618('0x6'));var logger=require('../../config/logger')(_0x2618('0x7'));var config=require(_0x2618('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2618('0x9')][_0x2618('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e943c,_0x681b45,_0xd9a267){return new BPromise(function(_0x318da3,_0x3b49ce){return client[_0x2618('0xb')](_0x4e943c,_0xd9a267)['then'](function(_0x221495){logger[_0x2618('0xc')](_0x2618('0xd'),_0x681b45,_0x2618('0xe'));logger[_0x2618('0xf')](_0x2618('0x10'),_0x681b45,_0x2618('0xe'),JSON['stringify'](_0x221495));if(_0x221495['error']){if(_0x221495[_0x2618('0x11')]['code']===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x681b45,_0x221495[_0x2618('0x11')][_0x2618('0x12')]);return _0x3b49ce(_0x221495[_0x2618('0x11')][_0x2618('0x12')]);}logger[_0x2618('0x11')](_0x2618('0xd'),_0x681b45,_0x221495['error'][_0x2618('0x12')]);return _0x318da3(_0x221495[_0x2618('0x11')][_0x2618('0x12')]);}else{logger[_0x2618('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x681b45,_0x2618('0xe'));_0x318da3(_0x221495[_0x2618('0x13')]['message']);}})[_0x2618('0x14')](function(_0x4d7d8f){logger[_0x2618('0x11')](_0x2618('0xd'),_0x681b45,_0x4d7d8f);_0x3b49ce(_0x4d7d8f);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 7e1e6c1..6591dda 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 _0x5bbb=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5bbb,0x1d9));var _0xb5bb=function(_0x32ed53,_0x465491){_0x32ed53=_0x32ed53-0x0;var _0x37e4a4=_0x5bbb[_0x32ed53];return _0x37e4a4;};'use strict';var multer=require(_0xb5bb('0x0'));var util=require(_0xb5bb('0x1'));var path=require(_0xb5bb('0x2'));var timeout=require(_0xb5bb('0x3'));var express=require('express');var router=express[_0xb5bb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb5bb('0x5'));var config=require(_0xb5bb('0x6'));var controller=require(_0xb5bb('0x7'));router[_0xb5bb('0x8')]('/',auth[_0xb5bb('0x9')](),controller[_0xb5bb('0xa')]);router[_0xb5bb('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb5bb('0xb')]);router[_0xb5bb('0xc')]('/',auth['isAuthenticated'](),controller[_0xb5bb('0xd')]);router[_0xb5bb('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xb5bb('0xf')]);router[_0xb5bb('0x10')](_0xb5bb('0x11'),auth[_0xb5bb('0x9')](),controller['destroy']);module[_0xb5bb('0x12')]=router; \ No newline at end of file +var _0xbf4b=['/:id','show','post','create','put','isAuthenticated','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x6d0c3e,_0xbc2aed){var _0x2895ce=function(_0x5ec18a){while(--_0x5ec18a){_0x6d0c3e['push'](_0x6d0c3e['shift']());}};_0x2895ce(++_0xbc2aed);}(_0xbf4b,0x6f));var _0xbbf4=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0xbf4b[_0x38fb0d];return _0x30a5d6;};'use strict';var multer=require(_0xbbf4('0x0'));var util=require(_0xbbf4('0x1'));var path=require(_0xbbf4('0x2'));var timeout=require('connect-timeout');var express=require(_0xbbf4('0x3'));var router=express[_0xbbf4('0x4')]();var auth=require(_0xbbf4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbbf4('0x6'));var controller=require('./pause.controller');router[_0xbbf4('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbbf4('0x7')](_0xbbf4('0x8'),auth['isAuthenticated'](),controller[_0xbbf4('0x9')]);router[_0xbbf4('0xa')]('/',auth['isAuthenticated'](),controller[_0xbbf4('0xb')]);router[_0xbbf4('0xc')]('/:id',auth[_0xbbf4('0xd')](),controller[_0xbbf4('0xe')]);router['delete'](_0xbbf4('0x8'),auth[_0xbbf4('0xd')](),controller[_0xbbf4('0xf')]);module[_0xbbf4('0x10')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 9a1342c..f98f85d 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 _0x26aa=['STRING','sequelize','exports','name'];(function(_0x2b9c17,_0xc8ac81){var _0x28711d=function(_0x135903){while(--_0x135903){_0x2b9c17['push'](_0x2b9c17['shift']());}};_0x28711d(++_0xc8ac81);}(_0x26aa,0xed));var _0xa26a=function(_0x2641ff,_0x21905b){_0x2641ff=_0x2641ff-0x0;var _0x2d30cd=_0x26aa[_0x2641ff];return _0x2d30cd;};'use strict';var Sequelize=require(_0xa26a('0x0'));module[_0xa26a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa26a('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xa26a('0x3')]}}; \ No newline at end of file +var _0x2d63=['name','exports','STRING'];(function(_0xe807f7,_0x209b33){var _0x5e6c74=function(_0x33715b){while(--_0x33715b){_0xe807f7['push'](_0xe807f7['shift']());}};_0x5e6c74(++_0x209b33);}(_0x2d63,0x79));var _0x32d6=function(_0x20538a,_0x2006bc){_0x20538a=_0x20538a-0x0;var _0x37bcb3=_0x2d63[_0x20538a];return _0x37bcb3;};'use strict';var Sequelize=require('sequelize');module[_0x32d6('0x0')]={'name':{'type':Sequelize[_0x32d6('0x1')],'unique':_0x32d6('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x32d6('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 78898ee..3d02195 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 _0x715c=['merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Pauses','status','error','name','send','map','Pause','rawAttributes','fieldName','type','key','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','where'];(function(_0x537372,_0x716c11){var _0x4496e5=function(_0x8ebc2a){while(--_0x8ebc2a){_0x537372['push'](_0x537372['shift']());}};_0x4496e5(++_0x716c11);}(_0x715c,0x168));var _0xc715=function(_0x1c6872,_0x460103){_0x1c6872=_0x1c6872-0x0;var _0x40103c=_0x715c[_0x1c6872];return _0x40103c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc715('0x0'));var rimraf=require(_0xc715('0x1'));var zipdir=require(_0xc715('0x2'));var jsonpatch=require(_0xc715('0x3'));var rp=require(_0xc715('0x4'));var moment=require(_0xc715('0x5'));var BPromise=require(_0xc715('0x6'));var Mustache=require(_0xc715('0x7'));var util=require('util');var path=require(_0xc715('0x8'));var sox=require(_0xc715('0x9'));var csv=require(_0xc715('0xa'));var ejs=require(_0xc715('0xb'));var fs=require('fs');var _=require(_0xc715('0xc'));var squel=require(_0xc715('0xd'));var crypto=require(_0xc715('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc715('0xf'));var toCsv=require(_0xc715('0xa'));var querystring=require(_0xc715('0x10'));var Papa=require(_0xc715('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc715('0x12'));var as=require(_0xc715('0x13'));var hardwareService=require(_0xc715('0x14'));var logger=require(_0xc715('0x15'))(_0xc715('0x16'));var utils=require(_0xc715('0x17'));var config=require(_0xc715('0x18'));var db=require(_0xc715('0x19'))['db'];function respondWithStatusCode(_0x4c0a77,_0x211b34){_0x211b34=_0x211b34||0xcc;return function(_0x12d2bd){if(_0x12d2bd){return _0x4c0a77[_0xc715('0x1a')](_0x211b34);}return _0x4c0a77['status'](_0x211b34)[_0xc715('0x1b')]();};}function respondWithResult(_0x15089b,_0x2fa019){_0x2fa019=_0x2fa019||0xc8;return function(_0x4b70e2){if(_0x4b70e2){return _0x15089b['status'](_0x2fa019)[_0xc715('0x1c')](_0x4b70e2);}};}function respondWithFilteredResult(_0x1862fb,_0x23e51a){return function(_0xfa84a6){if(_0xfa84a6){var _0x3671ec=_0xfa84a6[_0xc715('0x1d')],_0x5155fb=_0x23e51a[_0xc715('0x1e')],_0x5a243f=_0x23e51a[_0xc715('0x1e')]+_0x23e51a['limit'],_0x454697;if(_0x5a243f>=_0x3671ec){_0x5a243f=_0x3671ec;_0x454697=0xc8;}else{_0x454697=0xce;}_0x1862fb['status'](_0x454697);return _0x1862fb[_0xc715('0x1f')](_0xc715('0x20'),_0x5155fb+'-'+_0x5a243f+'/'+_0x3671ec)[_0xc715('0x1c')](_0xfa84a6);}return null;};}function patchUpdates(_0x470672){return function(_0x2d04d8){try{jsonpatch['apply'](_0x2d04d8,_0x470672,!![]);}catch(_0x3afda7){return BPromise[_0xc715('0x21')](_0x3afda7);}return _0x2d04d8[_0xc715('0x22')]();};}function saveUpdates(_0x514c5d,_0x477045){return function(_0xa765e3){if(_0xa765e3){return _0xa765e3[_0xc715('0x23')](_0x514c5d)[_0xc715('0x24')](function(_0x4a0224){return _0x4a0224;});}return null;};}function removeEntity(_0x3d5df2,_0x57ada1){return function(_0x376110){if(_0x376110){return _0x376110[_0xc715('0x25')]()['then'](function(){var _0x2be78f=_0x376110[_0xc715('0x26')]({'plain':!![]});var _0x29d0f7=_0xc715('0x27');return db['UserProfileResource'][_0xc715('0x25')]({'where':{'type':_0x29d0f7,'resourceId':_0x2be78f['id']}})['then'](function(){return _0x376110;});})[_0xc715('0x24')](function(){_0x3d5df2[_0xc715('0x28')](0xcc)[_0xc715('0x1b')]();});}};}function handleEntityNotFound(_0x3f2174,_0x43ac26){return function(_0x13379f){if(!_0x13379f){_0x3f2174[_0xc715('0x1a')](0x194);}return _0x13379f;};}function handleError(_0x86ff76,_0x2f3e5c){_0x2f3e5c=_0x2f3e5c||0x1f4;return function(_0x4dcc3a){logger[_0xc715('0x29')](_0x4dcc3a['stack']);if(_0x4dcc3a[_0xc715('0x2a')]){delete _0x4dcc3a[_0xc715('0x2a')];}_0x86ff76['status'](_0x2f3e5c)[_0xc715('0x2b')](_0x4dcc3a);};}exports['index']=function(_0x11cd09,_0x2ed148){var _0x15b38c={},_0x41509c={},_0x40df68={'count':0x0,'rows':[]};var _0x565c34=_[_0xc715('0x2c')](db[_0xc715('0x2d')][_0xc715('0x2e')],function(_0x523bdb){return{'name':_0x523bdb[_0xc715('0x2f')],'type':_0x523bdb[_0xc715('0x30')][_0xc715('0x31')]};});_0x41509c[_0xc715('0x32')]=_['map'](_0x565c34,_0xc715('0x2a'));_0x41509c['query']=_[_0xc715('0x33')](_0x11cd09['query']);_0x41509c[_0xc715('0x34')]=_['intersection'](_0x41509c[_0xc715('0x32')],_0x41509c[_0xc715('0x35')]);_0x15b38c['attributes']=_[_0xc715('0x36')](_0x41509c['model'],qs[_0xc715('0x37')](_0x11cd09['query'][_0xc715('0x37')]));_0x15b38c[_0xc715('0x38')]=_0x15b38c[_0xc715('0x38')][_0xc715('0x39')]?_0x15b38c[_0xc715('0x38')]:_0x41509c[_0xc715('0x32')];if(!_0x11cd09[_0xc715('0x35')][_0xc715('0x3a')](_0xc715('0x3b'))){_0x15b38c[_0xc715('0x3c')]=qs[_0xc715('0x3c')](_0x11cd09[_0xc715('0x35')][_0xc715('0x3c')]);_0x15b38c['offset']=qs[_0xc715('0x1e')](_0x11cd09[_0xc715('0x35')][_0xc715('0x1e')]);}_0x15b38c[_0xc715('0x3d')]=qs[_0xc715('0x3e')](_0x11cd09[_0xc715('0x35')][_0xc715('0x3e')]);_0x15b38c['where']=qs[_0xc715('0x34')](_[_0xc715('0x3f')](_0x11cd09[_0xc715('0x35')],_0x41509c[_0xc715('0x34')]),_0x565c34);if(_0x11cd09[_0xc715('0x35')]['filter']){_0x15b38c[_0xc715('0x40')]=_[_0xc715('0x41')](_0x15b38c['where'],{'$or':_[_0xc715('0x2c')](_0x565c34,function(_0x23d85a){if(_0x23d85a[_0xc715('0x30')]!==_0xc715('0x42')){var _0x1707f2={};_0x1707f2[_0x23d85a['name']]={'$like':'%'+_0x11cd09[_0xc715('0x35')][_0xc715('0x43')]+'%'};return _0x1707f2;}})});}_0x15b38c=_[_0xc715('0x41')]({},_0x15b38c,_0x11cd09[_0xc715('0x44')]);var _0x37831b={'where':_0x15b38c[_0xc715('0x40')]};return db[_0xc715('0x2d')][_0xc715('0x1d')](_0x37831b)['then'](function(_0x4ac61f){_0x40df68['count']=_0x4ac61f;if(_0x11cd09[_0xc715('0x35')][_0xc715('0x45')]){_0x15b38c[_0xc715('0x46')]=[{'all':!![]}];}return db['Pause'][_0xc715('0x47')](_0x15b38c);})[_0xc715('0x24')](function(_0x2586cd){_0x40df68[_0xc715('0x48')]=_0x2586cd;return _0x40df68;})[_0xc715('0x24')](respondWithFilteredResult(_0x2ed148,_0x15b38c))[_0xc715('0x49')](handleError(_0x2ed148,null));};exports[_0xc715('0x4a')]=function(_0x7da56d,_0x2608ff){var _0x5883b3={'raw':!![],'where':{'id':_0x7da56d[_0xc715('0x4b')]['id']}},_0x121839={};_0x121839[_0xc715('0x32')]=_[_0xc715('0x33')](db[_0xc715('0x2d')]['rawAttributes']);_0x121839[_0xc715('0x35')]=_['keys'](_0x7da56d[_0xc715('0x35')]);_0x121839[_0xc715('0x34')]=_[_0xc715('0x36')](_0x121839[_0xc715('0x32')],_0x121839['query']);_0x5883b3[_0xc715('0x38')]=_['intersection'](_0x121839['model'],qs['fields'](_0x7da56d['query']['fields']));_0x5883b3[_0xc715('0x38')]=_0x5883b3[_0xc715('0x38')]['length']?_0x5883b3['attributes']:_0x121839[_0xc715('0x32')];if(_0x7da56d[_0xc715('0x35')]['includeAll']){_0x5883b3[_0xc715('0x46')]=[{'all':!![]}];}_0x5883b3=_[_0xc715('0x41')]({},_0x5883b3,_0x7da56d[_0xc715('0x44')]);return db[_0xc715('0x2d')][_0xc715('0x4c')](_0x5883b3)[_0xc715('0x24')](handleEntityNotFound(_0x2608ff,null))['then'](respondWithResult(_0x2608ff,null))[_0xc715('0x49')](handleError(_0x2608ff,null));};exports[_0xc715('0x4d')]=function(_0x2781f1,_0x11cd7b){return db[_0xc715('0x2d')][_0xc715('0x4d')](_0x2781f1[_0xc715('0x4e')],{})[_0xc715('0x24')](function(_0x3de369){var _0x44419f=_0x2781f1[_0xc715('0x4f')]['get']({'plain':!![]});if(!_0x44419f)throw new Error(_0xc715('0x50'));if(_0x44419f[_0xc715('0x51')]==='user'){var _0x440c74=_0x3de369[_0xc715('0x26')]({'plain':!![]});var _0x4e5f3d=_0xc715('0x27');return db['UserProfileSection'][_0xc715('0x4c')]({'where':{'name':_0x4e5f3d,'userProfileId':_0x44419f[_0xc715('0x52')]},'raw':!![]})['then'](function(_0x461942){if(_0x461942&&_0x461942['autoAssociation']===0x0){return db[_0xc715('0x53')]['create']({'name':_0x440c74['name'],'resourceId':_0x440c74['id'],'type':_0x461942[_0xc715('0x2a')],'sectionId':_0x461942['id']},{})[_0xc715('0x24')](function(){return _0x3de369;});}else{return _0x3de369;}})[_0xc715('0x49')](function(_0x944c63){logger['error'](_0xc715('0x54'),_0x944c63);throw _0x944c63;});}return _0x3de369;})[_0xc715('0x24')](respondWithResult(_0x11cd7b,0xc9))['catch'](handleError(_0x11cd7b,null));};exports[_0xc715('0x23')]=function(_0x1c5515,_0x18717b){if(_0x1c5515[_0xc715('0x4e')]['id']){delete _0x1c5515[_0xc715('0x4e')]['id'];}return db[_0xc715('0x2d')][_0xc715('0x4c')]({'where':{'id':_0x1c5515['params']['id']}})[_0xc715('0x24')](handleEntityNotFound(_0x18717b,null))[_0xc715('0x24')](saveUpdates(_0x1c5515[_0xc715('0x4e')],null))['then'](respondWithResult(_0x18717b,null))[_0xc715('0x49')](handleError(_0x18717b,null));};exports[_0xc715('0x25')]=function(_0x548a45,_0x166969){return db[_0xc715('0x2d')]['find']({'where':{'id':_0x548a45['params']['id']}})[_0xc715('0x24')](handleEntityNotFound(_0x166969,null))[_0xc715('0x24')](removeEntity(_0x166969,null))[_0xc715('0x49')](handleError(_0x166969,null));}; \ No newline at end of file +var _0xfbe3=['name','index','map','Pause','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','rawAttributes','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','find','userProfileId','autoAssociation','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','then','get','UserProfileResource','error'];(function(_0x92713a,_0x68f8b0){var _0x1893e1=function(_0xe49768){while(--_0xe49768){_0x92713a['push'](_0x92713a['shift']());}};_0x1893e1(++_0x68f8b0);}(_0xfbe3,0x117));var _0x3fbe=function(_0x1ff6d1,_0x52f903){_0x1ff6d1=_0x1ff6d1-0x0;var _0x1554cd=_0xfbe3[_0x1ff6d1];return _0x1554cd;};'use strict';var pdf=require(_0x3fbe('0x0'));var emlformat=require(_0x3fbe('0x1'));var rimraf=require(_0x3fbe('0x2'));var zipdir=require(_0x3fbe('0x3'));var jsonpatch=require(_0x3fbe('0x4'));var rp=require('request-promise');var moment=require(_0x3fbe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3fbe('0x6'));var util=require(_0x3fbe('0x7'));var path=require(_0x3fbe('0x8'));var sox=require(_0x3fbe('0x9'));var csv=require(_0x3fbe('0xa'));var ejs=require(_0x3fbe('0xb'));var fs=require('fs');var _=require(_0x3fbe('0xc'));var squel=require('squel');var crypto=require(_0x3fbe('0xd'));var jsforce=require(_0x3fbe('0xe'));var deskjs=require(_0x3fbe('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3fbe('0x10'));var Papa=require(_0x3fbe('0x11'));var Redis=require(_0x3fbe('0x12'));var authService=require(_0x3fbe('0x13'));var qs=require(_0x3fbe('0x14'));var as=require(_0x3fbe('0x15'));var hardwareService=require(_0x3fbe('0x16'));var logger=require('../../config/logger')(_0x3fbe('0x17'));var utils=require('../../config/utils');var config=require(_0x3fbe('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf409d9,_0xb7560d){_0xb7560d=_0xb7560d||0xcc;return function(_0x10ff20){if(_0x10ff20){return _0xf409d9[_0x3fbe('0x19')](_0xb7560d);}return _0xf409d9[_0x3fbe('0x1a')](_0xb7560d)[_0x3fbe('0x1b')]();};}function respondWithResult(_0x116f2a,_0x5149c8){_0x5149c8=_0x5149c8||0xc8;return function(_0x3e1ee6){if(_0x3e1ee6){return _0x116f2a[_0x3fbe('0x1a')](_0x5149c8)[_0x3fbe('0x1c')](_0x3e1ee6);}};}function respondWithFilteredResult(_0x315f75,_0x2dafe7){return function(_0x3d419e){if(_0x3d419e){var _0x4e5ee1=_0x3d419e[_0x3fbe('0x1d')],_0x612064=_0x2dafe7[_0x3fbe('0x1e')],_0x57603a=_0x2dafe7[_0x3fbe('0x1e')]+_0x2dafe7[_0x3fbe('0x1f')],_0x486593;if(_0x57603a>=_0x4e5ee1){_0x57603a=_0x4e5ee1;_0x486593=0xc8;}else{_0x486593=0xce;}_0x315f75[_0x3fbe('0x1a')](_0x486593);return _0x315f75['set']('Content-Range',_0x612064+'-'+_0x57603a+'/'+_0x4e5ee1)[_0x3fbe('0x1c')](_0x3d419e);}return null;};}function patchUpdates(_0xc4ab5e){return function(_0xacc713){try{jsonpatch[_0x3fbe('0x20')](_0xacc713,_0xc4ab5e,!![]);}catch(_0xafd0ae){return BPromise[_0x3fbe('0x21')](_0xafd0ae);}return _0xacc713[_0x3fbe('0x22')]();};}function saveUpdates(_0x3eb5a0,_0x12e9a1){return function(_0x41ff82){if(_0x41ff82){return _0x41ff82[_0x3fbe('0x23')](_0x3eb5a0)['then'](function(_0xbffe6c){return _0xbffe6c;});}return null;};}function removeEntity(_0xea5edd,_0x2fa6fd){return function(_0x470225){if(_0x470225){return _0x470225[_0x3fbe('0x24')]()[_0x3fbe('0x25')](function(){var _0x3e7b41=_0x470225[_0x3fbe('0x26')]({'plain':!![]});var _0x1777b6='Pauses';return db[_0x3fbe('0x27')][_0x3fbe('0x24')]({'where':{'type':_0x1777b6,'resourceId':_0x3e7b41['id']}})[_0x3fbe('0x25')](function(){return _0x470225;});})[_0x3fbe('0x25')](function(){_0xea5edd[_0x3fbe('0x1a')](0xcc)[_0x3fbe('0x1b')]();});}};}function handleEntityNotFound(_0x3f0620,_0x2d8197){return function(_0x53117e){if(!_0x53117e){_0x3f0620[_0x3fbe('0x19')](0x194);}return _0x53117e;};}function handleError(_0x1b69db,_0x11446a){_0x11446a=_0x11446a||0x1f4;return function(_0xc1e7ee){logger[_0x3fbe('0x28')](_0xc1e7ee['stack']);if(_0xc1e7ee[_0x3fbe('0x29')]){delete _0xc1e7ee['name'];}_0x1b69db[_0x3fbe('0x1a')](_0x11446a)['send'](_0xc1e7ee);};}exports[_0x3fbe('0x2a')]=function(_0x184810,_0x383228){var _0x11ff6c={},_0x42f1ea={},_0x1429d5={'count':0x0,'rows':[]};var _0x5d9e88=_[_0x3fbe('0x2b')](db[_0x3fbe('0x2c')]['rawAttributes'],function(_0x10d1b0){return{'name':_0x10d1b0[_0x3fbe('0x2d')],'type':_0x10d1b0[_0x3fbe('0x2e')][_0x3fbe('0x2f')]};});_0x42f1ea[_0x3fbe('0x30')]=_[_0x3fbe('0x2b')](_0x5d9e88,_0x3fbe('0x29'));_0x42f1ea[_0x3fbe('0x31')]=_[_0x3fbe('0x32')](_0x184810['query']);_0x42f1ea[_0x3fbe('0x33')]=_['intersection'](_0x42f1ea[_0x3fbe('0x30')],_0x42f1ea[_0x3fbe('0x31')]);_0x11ff6c[_0x3fbe('0x34')]=_[_0x3fbe('0x35')](_0x42f1ea[_0x3fbe('0x30')],qs[_0x3fbe('0x36')](_0x184810[_0x3fbe('0x31')][_0x3fbe('0x36')]));_0x11ff6c[_0x3fbe('0x34')]=_0x11ff6c[_0x3fbe('0x34')][_0x3fbe('0x37')]?_0x11ff6c[_0x3fbe('0x34')]:_0x42f1ea['model'];if(!_0x184810[_0x3fbe('0x31')]['hasOwnProperty'](_0x3fbe('0x38'))){_0x11ff6c[_0x3fbe('0x1f')]=qs[_0x3fbe('0x1f')](_0x184810['query'][_0x3fbe('0x1f')]);_0x11ff6c[_0x3fbe('0x1e')]=qs[_0x3fbe('0x1e')](_0x184810['query'][_0x3fbe('0x1e')]);}_0x11ff6c['order']=qs[_0x3fbe('0x39')](_0x184810['query'][_0x3fbe('0x39')]);_0x11ff6c[_0x3fbe('0x3a')]=qs[_0x3fbe('0x33')](_[_0x3fbe('0x3b')](_0x184810[_0x3fbe('0x31')],_0x42f1ea[_0x3fbe('0x33')]),_0x5d9e88);if(_0x184810[_0x3fbe('0x31')][_0x3fbe('0x3c')]){_0x11ff6c[_0x3fbe('0x3a')]=_[_0x3fbe('0x3d')](_0x11ff6c[_0x3fbe('0x3a')],{'$or':_['map'](_0x5d9e88,function(_0x4bcce6){if(_0x4bcce6['type']!==_0x3fbe('0x3e')){var _0x107c53={};_0x107c53[_0x4bcce6[_0x3fbe('0x29')]]={'$like':'%'+_0x184810[_0x3fbe('0x31')]['filter']+'%'};return _0x107c53;}})});}_0x11ff6c=_['merge']({},_0x11ff6c,_0x184810['options']);var _0x1069db={'where':_0x11ff6c[_0x3fbe('0x3a')]};return db['Pause'][_0x3fbe('0x1d')](_0x1069db)[_0x3fbe('0x25')](function(_0x2bf8d9){_0x1429d5['count']=_0x2bf8d9;if(_0x184810[_0x3fbe('0x31')][_0x3fbe('0x3f')]){_0x11ff6c[_0x3fbe('0x40')]=[{'all':!![]}];}return db[_0x3fbe('0x2c')][_0x3fbe('0x41')](_0x11ff6c);})[_0x3fbe('0x25')](function(_0x3c302d){_0x1429d5['rows']=_0x3c302d;return _0x1429d5;})[_0x3fbe('0x25')](respondWithFilteredResult(_0x383228,_0x11ff6c))['catch'](handleError(_0x383228,null));};exports[_0x3fbe('0x42')]=function(_0x1ed939,_0x349b20){var _0x22dae2={'raw':!![],'where':{'id':_0x1ed939['params']['id']}},_0x50a5d2={};_0x50a5d2[_0x3fbe('0x30')]=_[_0x3fbe('0x32')](db[_0x3fbe('0x2c')][_0x3fbe('0x43')]);_0x50a5d2[_0x3fbe('0x31')]=_[_0x3fbe('0x32')](_0x1ed939['query']);_0x50a5d2[_0x3fbe('0x33')]=_[_0x3fbe('0x35')](_0x50a5d2[_0x3fbe('0x30')],_0x50a5d2[_0x3fbe('0x31')]);_0x22dae2[_0x3fbe('0x34')]=_[_0x3fbe('0x35')](_0x50a5d2[_0x3fbe('0x30')],qs[_0x3fbe('0x36')](_0x1ed939[_0x3fbe('0x31')][_0x3fbe('0x36')]));_0x22dae2['attributes']=_0x22dae2[_0x3fbe('0x34')][_0x3fbe('0x37')]?_0x22dae2[_0x3fbe('0x34')]:_0x50a5d2['model'];if(_0x1ed939[_0x3fbe('0x31')][_0x3fbe('0x3f')]){_0x22dae2[_0x3fbe('0x40')]=[{'all':!![]}];}_0x22dae2=_[_0x3fbe('0x3d')]({},_0x22dae2,_0x1ed939['options']);return db[_0x3fbe('0x2c')]['find'](_0x22dae2)[_0x3fbe('0x25')](handleEntityNotFound(_0x349b20,null))[_0x3fbe('0x25')](respondWithResult(_0x349b20,null))[_0x3fbe('0x44')](handleError(_0x349b20,null));};exports[_0x3fbe('0x45')]=function(_0x30fe8f,_0x31850d){return db[_0x3fbe('0x2c')][_0x3fbe('0x45')](_0x30fe8f['body'],{})['then'](function(_0x3ffbb2){var _0x12b5e7=_0x30fe8f[_0x3fbe('0x46')][_0x3fbe('0x26')]({'plain':!![]});if(!_0x12b5e7)throw new Error(_0x3fbe('0x47'));if(_0x12b5e7[_0x3fbe('0x48')]===_0x3fbe('0x46')){var _0xdb14f=_0x3ffbb2[_0x3fbe('0x26')]({'plain':!![]});var _0x22b2c8=_0x3fbe('0x49');return db[_0x3fbe('0x4a')][_0x3fbe('0x4b')]({'where':{'name':_0x22b2c8,'userProfileId':_0x12b5e7[_0x3fbe('0x4c')]},'raw':!![]})[_0x3fbe('0x25')](function(_0x402c32){if(_0x402c32&&_0x402c32[_0x3fbe('0x4d')]===0x0){return db[_0x3fbe('0x27')]['create']({'name':_0xdb14f[_0x3fbe('0x29')],'resourceId':_0xdb14f['id'],'type':_0x402c32[_0x3fbe('0x29')],'sectionId':_0x402c32['id']},{})['then'](function(){return _0x3ffbb2;});}else{return _0x3ffbb2;}})[_0x3fbe('0x44')](function(_0x3494b9){logger[_0x3fbe('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3494b9);throw _0x3494b9;});}return _0x3ffbb2;})[_0x3fbe('0x25')](respondWithResult(_0x31850d,0xc9))[_0x3fbe('0x44')](handleError(_0x31850d,null));};exports[_0x3fbe('0x23')]=function(_0x2f977d,_0x55ce10){if(_0x2f977d[_0x3fbe('0x4e')]['id']){delete _0x2f977d[_0x3fbe('0x4e')]['id'];}return db[_0x3fbe('0x2c')][_0x3fbe('0x4b')]({'where':{'id':_0x2f977d[_0x3fbe('0x4f')]['id']}})[_0x3fbe('0x25')](handleEntityNotFound(_0x55ce10,null))[_0x3fbe('0x25')](saveUpdates(_0x2f977d[_0x3fbe('0x4e')],null))[_0x3fbe('0x25')](respondWithResult(_0x55ce10,null))[_0x3fbe('0x44')](handleError(_0x55ce10,null));};exports[_0x3fbe('0x24')]=function(_0x1eb6b8,_0x1b9958){return db['Pause'][_0x3fbe('0x4b')]({'where':{'id':_0x1eb6b8[_0x3fbe('0x4f')]['id']}})[_0x3fbe('0x25')](handleEntityNotFound(_0x1b9958,null))['then'](removeEntity(_0x1b9958,null))[_0x3fbe('0x44')](handleError(_0x1b9958,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 6b0c01a..ca92f3c 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 _0x08cc=['define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports'];(function(_0xeeea52,_0x1526f6){var _0xc9b48=function(_0x331839){while(--_0x331839){_0xeeea52['push'](_0xeeea52['shift']());}};_0xc9b48(++_0x1526f6);}(_0x08cc,0x137));var _0xc08c=function(_0x2fe18e,_0x4c9bc2){_0x2fe18e=_0x2fe18e-0x0;var _0x20bbc6=_0x08cc[_0x2fe18e];return _0x20bbc6;};'use strict';var _=require(_0xc08c('0x0'));var util=require(_0xc08c('0x1'));var logger=require(_0xc08c('0x2'))(_0xc08c('0x3'));var moment=require(_0xc08c('0x4'));var BPromise=require(_0xc08c('0x5'));var rp=require(_0xc08c('0x6'));var fs=require('fs');var path=require(_0xc08c('0x7'));var rimraf=require('rimraf');var config=require(_0xc08c('0x8'));var attributes=require(_0xc08c('0x9'));module[_0xc08c('0xa')]=function(_0x18b6eb,_0x357f94){return _0x18b6eb[_0xc08c('0xb')](_0xc08c('0xc'),attributes,{'tableName':_0xc08c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xccb9=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./pause.attributes','exports','define','Pause','tools_pauses'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xccb9,0x1e0));var _0x9ccb=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xccb9[_0x1f9f37];return _0x21c080;};'use strict';var _=require('lodash');var util=require(_0x9ccb('0x0'));var logger=require(_0x9ccb('0x1'))('api');var moment=require(_0x9ccb('0x2'));var BPromise=require(_0x9ccb('0x3'));var rp=require(_0x9ccb('0x4'));var fs=require('fs');var path=require(_0x9ccb('0x5'));var rimraf=require(_0x9ccb('0x6'));var config=require('../../config/environment');var attributes=require(_0x9ccb('0x7'));module[_0x9ccb('0x8')]=function(_0x359378,_0xbb7559){return _0x359378[_0x9ccb('0x9')](_0x9ccb('0xa'),attributes,{'tableName':_0x9ccb('0xb'),'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 8a93035..87cb933 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 _0x98fc=['http','request','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','find','options','raw','include','map','model','attributes','then','ShowPause','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x7dbd65,_0x18da49){var _0x33d551=function(_0x7ce789){while(--_0x7ce789){_0x7dbd65['push'](_0x7dbd65['shift']());}};_0x33d551(++_0x18da49);}(_0x98fc,0x156));var _0xc98f=function(_0x49fcfb,_0x504dec){_0x49fcfb=_0x49fcfb-0x0;var _0x964926=_0x98fc[_0x49fcfb];return _0x964926;};'use strict';var _=require(_0xc98f('0x0'));var util=require(_0xc98f('0x1'));var moment=require(_0xc98f('0x2'));var BPromise=require(_0xc98f('0x3'));var rs=require(_0xc98f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc98f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc98f('0x6'))('rpc');var config=require(_0xc98f('0x7'));var jayson=require(_0xc98f('0x8'));var client=jayson[_0xc98f('0x9')][_0xc98f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3237e1,_0x1a8812,_0x28f276){return new BPromise(function(_0x191b3f,_0x12bdba){return client[_0xc98f('0xb')](_0x3237e1,_0x28f276)['then'](function(_0xb21d1a){logger['info'](_0xc98f('0xc'),_0x1a8812,_0xc98f('0xd'));logger[_0xc98f('0xe')](_0xc98f('0xf'),_0x1a8812,_0xc98f('0xd'),JSON['stringify'](_0xb21d1a));if(_0xb21d1a['error']){if(_0xb21d1a[_0xc98f('0x10')][_0xc98f('0x11')]===0x1f4){logger[_0xc98f('0x10')](_0xc98f('0xc'),_0x1a8812,_0xb21d1a[_0xc98f('0x10')]['message']);return _0x12bdba(_0xb21d1a[_0xc98f('0x10')][_0xc98f('0x12')]);}logger['error'](_0xc98f('0xc'),_0x1a8812,_0xb21d1a[_0xc98f('0x10')][_0xc98f('0x12')]);return _0x191b3f(_0xb21d1a[_0xc98f('0x10')][_0xc98f('0x12')]);}else{logger[_0xc98f('0x13')]('Pause,\x20%s,\x20%s',_0x1a8812,_0xc98f('0xd'));_0x191b3f(_0xb21d1a[_0xc98f('0x14')]['message']);}})[_0xc98f('0x15')](function(_0x5ef39c){logger[_0xc98f('0x10')](_0xc98f('0xc'),_0x1a8812,_0x5ef39c);_0x12bdba(_0x5ef39c);});});}exports['ShowPause']=function(_0xbed285){var _0x838572=this;return new Promise(function(_0x19e873,_0x53b2e5){return db['Pause'][_0xc98f('0x16')]({'raw':_0xbed285[_0xc98f('0x17')]?_0xbed285[_0xc98f('0x17')][_0xc98f('0x18')]===undefined?!![]:![]:!![],'where':_0xbed285[_0xc98f('0x17')]?_0xbed285[_0xc98f('0x17')]['where']||null:null,'attributes':_0xbed285[_0xc98f('0x17')]?_0xbed285[_0xc98f('0x17')]['attributes']||null:null,'include':_0xbed285[_0xc98f('0x17')]?_0xbed285[_0xc98f('0x17')][_0xc98f('0x19')]?_[_0xc98f('0x1a')](_0xbed285[_0xc98f('0x17')]['include'],function(_0x12aa70){return{'model':db[_0x12aa70[_0xc98f('0x1b')]],'as':_0x12aa70['as'],'attributes':_0x12aa70[_0xc98f('0x1c')],'include':_0x12aa70[_0xc98f('0x19')]?_[_0xc98f('0x1a')](_0x12aa70[_0xc98f('0x19')],function(_0x357fe4){return{'model':db[_0x357fe4[_0xc98f('0x1b')]],'as':_0x357fe4['as'],'attributes':_0x357fe4[_0xc98f('0x1c')],'include':_0x357fe4[_0xc98f('0x19')]?_[_0xc98f('0x1a')](_0x357fe4['include'],function(_0x42846b){return{'model':db[_0x42846b[_0xc98f('0x1b')]],'as':_0x42846b['as'],'attributes':_0x42846b[_0xc98f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xc98f('0x1d')](function(_0x3a8150){logger[_0xc98f('0x13')](_0xc98f('0x1e'),_0xbed285);logger[_0xc98f('0xe')]('ShowPause',_0xbed285,JSON[_0xc98f('0x1f')](_0x3a8150));_0x19e873(_0x3a8150);})[_0xc98f('0x15')](function(_0x2ffd33){logger['error'](_0xc98f('0x1e'),_0x2ffd33[_0xc98f('0x12')],_0xbed285);_0x53b2e5(_0x838572[_0xc98f('0x10')](0x1f4,_0x2ffd33[_0xc98f('0x12')]));});});}; \ No newline at end of file +var _0xe349=['error','code','Pause,\x20%s,\x20%s','message','catch','ShowPause','Pause','find','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify'];(function(_0x1ffd9e,_0x5756e6){var _0xd377a0=function(_0x295d7d){while(--_0x295d7d){_0x1ffd9e['push'](_0x1ffd9e['shift']());}};_0xd377a0(++_0x5756e6);}(_0xe349,0x107));var _0x9e34=function(_0x4ec13d,_0x358a8f){_0x4ec13d=_0x4ec13d-0x0;var _0x3c3fa7=_0xe349[_0x4ec13d];return _0x3c3fa7;};'use strict';var _=require(_0x9e34('0x0'));var util=require(_0x9e34('0x1'));var moment=require('moment');var BPromise=require(_0x9e34('0x2'));var rs=require(_0x9e34('0x3'));var fs=require('fs');var Redis=require(_0x9e34('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9e34('0x5'));var logger=require(_0x9e34('0x6'))(_0x9e34('0x7'));var config=require(_0x9e34('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9e34('0x9')][_0x9e34('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51377d,_0x12f696,_0x340b80){return new BPromise(function(_0x51ccce,_0x31c32d){return client[_0x9e34('0xb')](_0x51377d,_0x340b80)[_0x9e34('0xc')](function(_0x517836){logger[_0x9e34('0xd')]('Pause,\x20%s,\x20%s',_0x12f696,_0x9e34('0xe'));logger['debug']('Pause,\x20%s,\x20%s,\x20%s',_0x12f696,_0x9e34('0xe'),JSON[_0x9e34('0xf')](_0x517836));if(_0x517836[_0x9e34('0x10')]){if(_0x517836['error'][_0x9e34('0x11')]===0x1f4){logger[_0x9e34('0x10')](_0x9e34('0x12'),_0x12f696,_0x517836[_0x9e34('0x10')][_0x9e34('0x13')]);return _0x31c32d(_0x517836[_0x9e34('0x10')][_0x9e34('0x13')]);}logger[_0x9e34('0x10')](_0x9e34('0x12'),_0x12f696,_0x517836[_0x9e34('0x10')]['message']);return _0x51ccce(_0x517836[_0x9e34('0x10')][_0x9e34('0x13')]);}else{logger[_0x9e34('0xd')](_0x9e34('0x12'),_0x12f696,'request\x20sent');_0x51ccce(_0x517836['result'][_0x9e34('0x13')]);}})[_0x9e34('0x14')](function(_0x2fdd63){logger[_0x9e34('0x10')](_0x9e34('0x12'),_0x12f696,_0x2fdd63);_0x31c32d(_0x2fdd63);});});}exports[_0x9e34('0x15')]=function(_0x7304){var _0x53dd0b=this;return new Promise(function(_0x217b69,_0x1f37da){return db[_0x9e34('0x16')][_0x9e34('0x17')]({'raw':_0x7304[_0x9e34('0x18')]?_0x7304[_0x9e34('0x18')][_0x9e34('0x19')]===undefined?!![]:![]:!![],'where':_0x7304['options']?_0x7304[_0x9e34('0x18')][_0x9e34('0x1a')]||null:null,'attributes':_0x7304[_0x9e34('0x18')]?_0x7304[_0x9e34('0x18')][_0x9e34('0x1b')]||null:null,'include':_0x7304[_0x9e34('0x18')]?_0x7304[_0x9e34('0x18')][_0x9e34('0x1c')]?_[_0x9e34('0x1d')](_0x7304['options'][_0x9e34('0x1c')],function(_0x53c696){return{'model':db[_0x53c696['model']],'as':_0x53c696['as'],'attributes':_0x53c696[_0x9e34('0x1b')],'include':_0x53c696['include']?_[_0x9e34('0x1d')](_0x53c696[_0x9e34('0x1c')],function(_0x19799a){return{'model':db[_0x19799a[_0x9e34('0x1e')]],'as':_0x19799a['as'],'attributes':_0x19799a[_0x9e34('0x1b')],'include':_0x19799a['include']?_['map'](_0x19799a[_0x9e34('0x1c')],function(_0x495922){return{'model':db[_0x495922[_0x9e34('0x1e')]],'as':_0x495922['as'],'attributes':_0x495922[_0x9e34('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9e34('0xc')](function(_0x3c9c61){logger['info'](_0x9e34('0x15'),_0x7304);logger['debug'](_0x9e34('0x15'),_0x7304,JSON['stringify'](_0x3c9c61));_0x217b69(_0x3c9c61);})[_0x9e34('0x14')](function(_0x5b9c16){logger[_0x9e34('0x10')](_0x9e34('0x15'),_0x5b9c16[_0x9e34('0x13')],_0x7304);_0x1f37da(_0x53dd0b[_0x9e34('0x10')](0x1f4,_0x5b9c16['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index bab1edd..25b959d 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 _0x0ce4=['get','index','/webhook','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','format','%s-%s%s','basename','extname','post','upload','webhookPost','put','update','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x20622a,_0x56bee8){var _0x169994=function(_0x1d0f7e){while(--_0x1d0f7e){_0x20622a['push'](_0x20622a['shift']());}};_0x169994(++_0x56bee8);}(_0x0ce4,0x8a));var _0x40ce=function(_0x15ca6b,_0x5c28b0){_0x15ca6b=_0x15ca6b-0x0;var _0x3fe560=_0x0ce4[_0x15ca6b];return _0x3fe560;};'use strict';var multer=require(_0x40ce('0x0'));var util=require(_0x40ce('0x1'));var path=require(_0x40ce('0x2'));var timeout=require('connect-timeout');var express=require(_0x40ce('0x3'));var router=express[_0x40ce('0x4')]();var auth=require(_0x40ce('0x5'));var interaction=require(_0x40ce('0x6'));var config=require('../../config/environment');var controller=require('./plugin.controller');router[_0x40ce('0x7')]('/',auth['isAuthenticated'](),controller[_0x40ce('0x8')]);router[_0x40ce('0x7')](_0x40ce('0x9'),controller['webhookGet']);router[_0x40ce('0x7')](_0x40ce('0xa'),auth[_0x40ce('0xb')](),controller[_0x40ce('0xc')]);router['get'](_0x40ce('0xd'),auth[_0x40ce('0xb')](),controller[_0x40ce('0xe')]);var upload=multer({'storage':multer[_0x40ce('0xf')]({'destination':function(_0x6a014b,_0xe5c609,_0x1bae84){_0x1bae84(null,path[_0x40ce('0x10')](config[_0x40ce('0x11')],_0x40ce('0x12')));},'filename':function(_0xa733c7,_0x22ad0d,_0x599adf){_0x22ad0d[_0x40ce('0x13')]=_0x22ad0d[_0x40ce('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x599adf(null,util[_0x40ce('0x14')](_0x40ce('0x15'),path[_0x40ce('0x16')](_0x22ad0d['originalname'],path[_0x40ce('0x17')](_0x22ad0d[_0x40ce('0x13')])),Date['now'](),path['extname'](_0x22ad0d[_0x40ce('0x13')])));}})});router[_0x40ce('0x18')]('/',upload['single']('file'),controller[_0x40ce('0x19')]);router['post'](_0x40ce('0x9'),controller[_0x40ce('0x1a')]);router[_0x40ce('0x1b')]('/:id',auth[_0x40ce('0xb')](),controller[_0x40ce('0x1c')]);router['delete'](_0x40ce('0xa'),auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x1c72=['/:id','isAuthenticated','/:id/download','join','root','originalname','replace','format','basename','now','extname','post','single','file','upload','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','webhookGet'];(function(_0x5ce8ac,_0x361020){var _0x2e4424=function(_0x267f06){while(--_0x267f06){_0x5ce8ac['push'](_0x5ce8ac['shift']());}};_0x2e4424(++_0x361020);}(_0x1c72,0x117));var _0x21c7=function(_0x35ca77,_0x323374){_0x35ca77=_0x35ca77-0x0;var _0x3e4eb2=_0x1c72[_0x35ca77];return _0x3e4eb2;};'use strict';var multer=require(_0x21c7('0x0'));var util=require('util');var path=require(_0x21c7('0x1'));var timeout=require(_0x21c7('0x2'));var express=require(_0x21c7('0x3'));var router=express[_0x21c7('0x4')]();var auth=require(_0x21c7('0x5'));var interaction=require(_0x21c7('0x6'));var config=require(_0x21c7('0x7'));var controller=require('./plugin.controller');router[_0x21c7('0x8')]('/',auth['isAuthenticated'](),controller[_0x21c7('0x9')]);router[_0x21c7('0x8')]('/webhook',controller[_0x21c7('0xa')]);router[_0x21c7('0x8')](_0x21c7('0xb'),auth[_0x21c7('0xc')](),controller['show']);router[_0x21c7('0x8')](_0x21c7('0xd'),auth[_0x21c7('0xc')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c1067,_0x3dec51,_0x77600){_0x77600(null,path[_0x21c7('0xe')](config[_0x21c7('0xf')],'server/files/plugins'));},'filename':function(_0x23523d,_0x448c71,_0x241706){_0x448c71[_0x21c7('0x10')]=_0x448c71['originalname'][_0x21c7('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x241706(null,util[_0x21c7('0x12')]('%s-%s%s',path[_0x21c7('0x13')](_0x448c71[_0x21c7('0x10')],path['extname'](_0x448c71[_0x21c7('0x10')])),Date[_0x21c7('0x14')](),path[_0x21c7('0x15')](_0x448c71[_0x21c7('0x10')])));}})});router[_0x21c7('0x16')]('/',upload[_0x21c7('0x17')](_0x21c7('0x18')),controller[_0x21c7('0x19')]);router[_0x21c7('0x16')]('/webhook',controller['webhookPost']);router['put'](_0x21c7('0xb'),auth[_0x21c7('0xc')](),controller[_0x21c7('0x1a')]);router[_0x21c7('0x1b')]('/:id',auth[_0x21c7('0xc')](),controller[_0x21c7('0x1b')]);module[_0x21c7('0x1c')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index d7d93a8..3875bee 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 _0x02ca=['STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x3293a3,_0x48c381){var _0x5edaa8=function(_0x529bce){while(--_0x529bce){_0x3293a3['push'](_0x3293a3['shift']());}};_0x5edaa8(++_0x48c381);}(_0x02ca,0xdf));var _0xa02c=function(_0x59327f,_0x41ea33){_0x59327f=_0x59327f-0x0;var _0x57e891=_0x02ca[_0x59327f];return _0x57e891;};'use strict';var Sequelize=require(_0xa02c('0x0'));module[_0xa02c('0x1')]={'name':{'type':Sequelize[_0xa02c('0x2')]},'type':{'type':Sequelize[_0xa02c('0x3')](_0xa02c('0x4'),_0xa02c('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xa02c('0x6')]},'path':{'type':Sequelize[_0xa02c('0x2')],'comment':_0xa02c('0x7')},'active':{'type':Sequelize[_0xa02c('0x8')],'defaultValue':0x0,'comment':_0xa02c('0x9')},'sidebar':{'type':Sequelize[_0xa02c('0x3')](_0xa02c('0xa'),_0xa02c('0xb'),_0xa02c('0xc'),_0xa02c('0xd')),'defaultValue':_0xa02c('0xc'),'comment':_0xa02c('0xe')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xa02c('0x2')]},'agentUrl':{'type':Sequelize[_0xa02c('0x2')]},'scriptName':{'type':Sequelize[_0xa02c('0x2')]},'scriptPath':{'type':Sequelize[_0xa02c('0x2')]}}; \ No newline at end of file +var _0x4163=['STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x57f921,_0x4fc8bb){var _0x2660ef=function(_0x45ba84){while(--_0x45ba84){_0x57f921['push'](_0x57f921['shift']());}};_0x2660ef(++_0x4fc8bb);}(_0x4163,0x1ed));var _0x3416=function(_0x3744c4,_0x4bdca9){_0x3744c4=_0x3744c4-0x0;var _0x167b7f=_0x4163[_0x3744c4];return _0x167b7f;};'use strict';var Sequelize=require(_0x3416('0x0'));module['exports']={'name':{'type':Sequelize[_0x3416('0x1')]},'type':{'type':Sequelize[_0x3416('0x2')](_0x3416('0x3'),_0x3416('0x4'))},'description':{'type':Sequelize[_0x3416('0x5')]},'version':{'type':Sequelize[_0x3416('0x5')]},'path':{'type':Sequelize['STRING'],'comment':_0x3416('0x6')},'active':{'type':Sequelize[_0x3416('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x3416('0x2')](_0x3416('0x8'),_0x3416('0x9'),'always',_0x3416('0xa')),'defaultValue':_0x3416('0xb'),'comment':_0x3416('0xc')},'icon':{'type':Sequelize[_0x3416('0x1')]},'adminUrl':{'type':Sequelize[_0x3416('0x1')]},'agentUrl':{'type':Sequelize[_0x3416('0x1')]},'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 bde7fac..0b8e091 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 _0x56ed=['includeAll','Plugin','findAll','rows','show','params','length','include','options','download','join','format','%s.zip','basename','createWriteStream','zip','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','root','server/files/plugins','dirname','node_modules/**/*','finalize','close','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','catch','upload','file','extname','filename','Plugin\x20upload\x20filepath:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','undefined','Invalid\x20manifest:\x20type\x20missing','version','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','scriptPath','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','delete','find','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','port','http://localhost:','json','encoding','method','headers','content-type','endsWith','statusCode','webhookPost','resolve','%s%s','content-length','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','register','sendStatus','status','count','limit','set','reject','save','then','Plugins','destroy','end','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge'];(function(_0x30994d,_0x2cc269){var _0x4554df=function(_0x125125){while(--_0x125125){_0x30994d['push'](_0x30994d['shift']());}};_0x4554df(++_0x2cc269);}(_0x56ed,0x1b1));var _0xd56e=function(_0x3a3d20,_0x244316){_0x3a3d20=_0x3a3d20-0x0;var _0x33bc94=_0x56ed[_0x3a3d20];return _0x33bc94;};'use strict';var pdf=require(_0xd56e('0x0'));var emlformat=require(_0xd56e('0x1'));var rimraf=require(_0xd56e('0x2'));var zipdir=require(_0xd56e('0x3'));var jsonpatch=require(_0xd56e('0x4'));var rp=require(_0xd56e('0x5'));var moment=require(_0xd56e('0x6'));var BPromise=require(_0xd56e('0x7'));var Mustache=require('mustache');var util=require(_0xd56e('0x8'));var path=require(_0xd56e('0x9'));var sox=require(_0xd56e('0xa'));var csv=require(_0xd56e('0xb'));var ejs=require(_0xd56e('0xc'));var fs=require('fs');var _=require(_0xd56e('0xd'));var squel=require(_0xd56e('0xe'));var crypto=require('crypto');var jsforce=require(_0xd56e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd56e('0xb'));var querystring=require(_0xd56e('0x10'));var Papa=require(_0xd56e('0x11'));var extract=require(_0xd56e('0x12'));var rimraf=require(_0xd56e('0x2'));var archiver=require(_0xd56e('0x13'));var Redis=require(_0xd56e('0x14'));var authService=require(_0xd56e('0x15'));var qs=require(_0xd56e('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd56e('0x17'));var logger=require(_0xd56e('0x18'))(_0xd56e('0x19'));var utils=require('../../config/utils');var config=require(_0xd56e('0x1a'));var db=require('../../mysqldb')['db'];config[_0xd56e('0x1b')]=_[_0xd56e('0x1c')](config[_0xd56e('0x1b')],{'host':_0xd56e('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd56e('0x1b')]));require('./plugin.socket')[_0xd56e('0x1e')](socket);function respondWithStatusCode(_0xadd860,_0xc2cd52){_0xc2cd52=_0xc2cd52||0xcc;return function(_0x240094){if(_0x240094){return _0xadd860[_0xd56e('0x1f')](_0xc2cd52);}return _0xadd860[_0xd56e('0x20')](_0xc2cd52)['end']();};}function respondWithResult(_0x2ffa1e,_0x2fe161){_0x2fe161=_0x2fe161||0xc8;return function(_0x1b53ae){if(_0x1b53ae){return _0x2ffa1e[_0xd56e('0x20')](_0x2fe161)['json'](_0x1b53ae);}};}function respondWithFilteredResult(_0x52286,_0x43235e){return function(_0x4df3c7){if(_0x4df3c7){var _0x37e6ff=_0x4df3c7[_0xd56e('0x21')],_0x5a2a1d=_0x43235e['offset'],_0x39a51e=_0x43235e['offset']+_0x43235e[_0xd56e('0x22')],_0x42f5dd;if(_0x39a51e>=_0x37e6ff){_0x39a51e=_0x37e6ff;_0x42f5dd=0xc8;}else{_0x42f5dd=0xce;}_0x52286[_0xd56e('0x20')](_0x42f5dd);return _0x52286[_0xd56e('0x23')]('Content-Range',_0x5a2a1d+'-'+_0x39a51e+'/'+_0x37e6ff)['json'](_0x4df3c7);}return null;};}function patchUpdates(_0x1708c9){return function(_0x2e918f){try{jsonpatch['apply'](_0x2e918f,_0x1708c9,!![]);}catch(_0x410e35){return BPromise[_0xd56e('0x24')](_0x410e35);}return _0x2e918f[_0xd56e('0x25')]();};}function saveUpdates(_0xf63976,_0x4702f4){return function(_0x2ee4a7){if(_0x2ee4a7){return _0x2ee4a7['update'](_0xf63976)[_0xd56e('0x26')](function(_0x339bc7){return _0x339bc7;});}return null;};}function removeEntity(_0x15a78c,_0x221669){return function(_0x2f67f4){if(_0x2f67f4){return _0x2f67f4['destroy']()['then'](function(){var _0x57e36d=_0x2f67f4['get']({'plain':!![]});var _0x534842=_0xd56e('0x27');return db['UserProfileResource'][_0xd56e('0x28')]({'where':{'type':_0x534842,'resourceId':_0x57e36d['id']}})['then'](function(){return _0x2f67f4;});})[_0xd56e('0x26')](function(){_0x15a78c[_0xd56e('0x20')](0xcc)[_0xd56e('0x29')]();});}};}function handleEntityNotFound(_0x109d74,_0x45328e){return function(_0x38261c){if(!_0x38261c){_0x109d74['sendStatus'](0x194);}return _0x38261c;};}function handleError(_0x4dee8f,_0x206603){_0x206603=_0x206603||0x1f4;return function(_0x6b9512){logger[_0xd56e('0x2a')](_0x6b9512[_0xd56e('0x2b')]);if(_0x6b9512[_0xd56e('0x2c')]){delete _0x6b9512['name'];}_0x4dee8f[_0xd56e('0x20')](_0x206603)[_0xd56e('0x2d')](_0x6b9512);};}exports['index']=function(_0x54b5b0,_0x20a267){var _0x38cd5f={},_0x754d4={},_0x4e65af={'count':0x0,'rows':[]};var _0x2589cb=_['map'](db['Plugin'][_0xd56e('0x2e')],function(_0x2c8418){return{'name':_0x2c8418[_0xd56e('0x2f')],'type':_0x2c8418[_0xd56e('0x30')]['key']};});_0x754d4[_0xd56e('0x31')]=_[_0xd56e('0x32')](_0x2589cb,_0xd56e('0x2c'));_0x754d4[_0xd56e('0x33')]=_[_0xd56e('0x34')](_0x54b5b0[_0xd56e('0x33')]);_0x754d4[_0xd56e('0x35')]=_['intersection'](_0x754d4[_0xd56e('0x31')],_0x754d4[_0xd56e('0x33')]);_0x38cd5f[_0xd56e('0x36')]=_[_0xd56e('0x37')](_0x754d4['model'],qs[_0xd56e('0x38')](_0x54b5b0['query'][_0xd56e('0x38')]));_0x38cd5f[_0xd56e('0x36')]=_0x38cd5f[_0xd56e('0x36')]['length']?_0x38cd5f[_0xd56e('0x36')]:_0x754d4[_0xd56e('0x31')];if(!_0x54b5b0[_0xd56e('0x33')][_0xd56e('0x39')]('nolimit')){_0x38cd5f[_0xd56e('0x22')]=qs['limit'](_0x54b5b0[_0xd56e('0x33')][_0xd56e('0x22')]);_0x38cd5f[_0xd56e('0x3a')]=qs[_0xd56e('0x3a')](_0x54b5b0[_0xd56e('0x33')]['offset']);}_0x38cd5f[_0xd56e('0x3b')]=qs['sort'](_0x54b5b0[_0xd56e('0x33')][_0xd56e('0x3c')]);_0x38cd5f[_0xd56e('0x3d')]=qs[_0xd56e('0x35')](_[_0xd56e('0x3e')](_0x54b5b0[_0xd56e('0x33')],_0x754d4[_0xd56e('0x35')]),_0x2589cb);if(_0x54b5b0['query'][_0xd56e('0x3f')]){_0x38cd5f[_0xd56e('0x3d')]=_[_0xd56e('0x40')](_0x38cd5f[_0xd56e('0x3d')],{'$or':_[_0xd56e('0x32')](_0x2589cb,function(_0x2778ab){if(_0x2778ab['type']!=='VIRTUAL'){var _0x22d61d={};_0x22d61d[_0x2778ab['name']]={'$like':'%'+_0x54b5b0[_0xd56e('0x33')][_0xd56e('0x3f')]+'%'};return _0x22d61d;}})});}_0x38cd5f=_[_0xd56e('0x40')]({},_0x38cd5f,_0x54b5b0['options']);var _0x595986={'where':_0x38cd5f[_0xd56e('0x3d')]};return db['Plugin'][_0xd56e('0x21')](_0x595986)[_0xd56e('0x26')](function(_0x55115f){_0x4e65af[_0xd56e('0x21')]=_0x55115f;if(_0x54b5b0[_0xd56e('0x33')][_0xd56e('0x41')]){_0x38cd5f['include']=[{'all':!![]}];}return db[_0xd56e('0x42')][_0xd56e('0x43')](_0x38cd5f);})[_0xd56e('0x26')](function(_0x19b12a){_0x4e65af[_0xd56e('0x44')]=_0x19b12a;return _0x4e65af;})[_0xd56e('0x26')](respondWithFilteredResult(_0x20a267,_0x38cd5f))['catch'](handleError(_0x20a267,null));};exports[_0xd56e('0x45')]=function(_0x483dde,_0x40d008){var _0x32a2c1={'raw':!![],'where':{'id':_0x483dde[_0xd56e('0x46')]['id']}},_0x3dec78={};_0x3dec78[_0xd56e('0x31')]=_[_0xd56e('0x34')](db[_0xd56e('0x42')]['rawAttributes']);_0x3dec78[_0xd56e('0x33')]=_[_0xd56e('0x34')](_0x483dde[_0xd56e('0x33')]);_0x3dec78['filters']=_['intersection'](_0x3dec78[_0xd56e('0x31')],_0x3dec78[_0xd56e('0x33')]);_0x32a2c1[_0xd56e('0x36')]=_['intersection'](_0x3dec78[_0xd56e('0x31')],qs['fields'](_0x483dde['query']['fields']));_0x32a2c1[_0xd56e('0x36')]=_0x32a2c1['attributes'][_0xd56e('0x47')]?_0x32a2c1[_0xd56e('0x36')]:_0x3dec78[_0xd56e('0x31')];if(_0x483dde['query']['includeAll']){_0x32a2c1[_0xd56e('0x48')]=[{'all':!![]}];}_0x32a2c1=_[_0xd56e('0x40')]({},_0x32a2c1,_0x483dde[_0xd56e('0x49')]);return db[_0xd56e('0x42')]['find'](_0x32a2c1)['then'](handleEntityNotFound(_0x40d008,null))[_0xd56e('0x26')](respondWithResult(_0x40d008,null))['catch'](handleError(_0x40d008,null));};exports[_0xd56e('0x4a')]=function(_0xfe0276,_0x1e5f9d,_0x2206af){return db[_0xd56e('0x42')]['find']({'where':{'id':_0xfe0276['params']['id']},'attributes':[_0xd56e('0x2c'),_0xd56e('0x9')],'raw':!![]})[_0xd56e('0x26')](handleEntityNotFound(_0x1e5f9d,null))[_0xd56e('0x26')](function(_0x79bcae){if(_0x79bcae){var _0x425d03=path[_0xd56e('0x4b')](config['root'],'server/files/plugins',util[_0xd56e('0x4c')](_0xd56e('0x4d'),path[_0xd56e('0x4e')](_0x79bcae[_0xd56e('0x9')])));var _0x11582c=fs[_0xd56e('0x4f')](_0x425d03);var _0x367874=archiver(_0xd56e('0x50'),{'zlib':{'level':0x9}});_0x367874['on']('warning',function(_0x109eab){if(_0x109eab['code']===_0xd56e('0x51')){logger[_0xd56e('0x2a')](_0x109eab);}else{throw new db[(_0xd56e('0x52'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x367874['on']('error',function(_0x138b44){throw new db[(_0xd56e('0x52'))][(_0xd56e('0x53'))](_0xd56e('0x54'));});_0x367874[_0xd56e('0x55')](_0x11582c);_0x367874['glob']('**/*',{'cwd':path[_0xd56e('0x4b')](config[_0xd56e('0x56')],_0xd56e('0x57'),path[_0xd56e('0x58')](_0x79bcae[_0xd56e('0x9')])),'ignore':[path[_0xd56e('0x4b')](path['basename'](_0x79bcae[_0xd56e('0x9')]),_0xd56e('0x59')),path[_0xd56e('0x4b')](path[_0xd56e('0x4e')](_0x79bcae[_0xd56e('0x9')]),'attachments/**/*')],'nodir':!![]})[_0xd56e('0x5a')]();_0x11582c['on'](_0xd56e('0x5b'),function(){if(!fs['existsSync'](_0x425d03)){throw new db['Sequelize'][(_0xd56e('0x53'))]('Plugin\x20not\x20found');}return _0x1e5f9d[_0xd56e('0x4a')](_0x425d03,util[_0xd56e('0x4c')](_0xd56e('0x4d'),path['basename'](_0x79bcae[_0xd56e('0x9')])),function(_0x3a176d){if(_0x3a176d){throw new db[(_0xd56e('0x52'))][(_0xd56e('0x53'))](_0xd56e('0x5c'));}fs['unlinkSync'](_0x425d03);logger[_0xd56e('0x5d')](_0xd56e('0x5e'));logger[_0xd56e('0x5d')](_0xd56e('0x5f'));});});}return null;})[_0xd56e('0x60')](handleError(_0x1e5f9d,null));};exports[_0xd56e('0x61')]=function(_0x24e544,_0xaee335,_0x41af75){var _0x1c174b=path['basename'](_0x24e544[_0xd56e('0x62')]['filename'],path[_0xd56e('0x63')](_0x24e544[_0xd56e('0x62')]['filename']));var _0x55cdd2=path[_0xd56e('0x4b')](config['root'],_0xd56e('0x57'),_0x24e544[_0xd56e('0x62')][_0xd56e('0x64')]);var _0x1e0a23=path['join'](config[_0xd56e('0x56')],'server/files/plugins',_0x1c174b);logger[_0xd56e('0x5d')](_0xd56e('0x65'),_0x55cdd2);logger[_0xd56e('0x5d')]('Plugin\x20upload\x20destination:\x20%s',_0x1e0a23);try{fs['chmodSync'](_0x55cdd2,parseInt(_0xd56e('0x66'),0x8));extract(_0x55cdd2,{'dir':_0x1e0a23},function(_0x22663a){if(_0x22663a){logger[_0xd56e('0x2a')](_0x22663a);handleError(_0x22663a,!![]);};var _0x30030e=fs['readdirSync'](_0x1e0a23);if(_0x30030e[_0xd56e('0x47')]>0x1){removeReferences(_0x55cdd2,_0x1e0a23);logger[_0xd56e('0x2a')]('Invalid\x20plugin\x20structure');return _0x41af75(new Error(_0xd56e('0x67')));}var _0x15e8c4=fs[_0xd56e('0x68')](path[_0xd56e('0x4b')](_0x1e0a23,_0x30030e[0x0]));if(_0x15e8c4[_0xd56e('0x69')]()){removeReferences(_0x55cdd2,_0x1e0a23);logger[_0xd56e('0x2a')](_0xd56e('0x67'));return _0x41af75(new Error(_0xd56e('0x67')));}if(_0x15e8c4[_0xd56e('0x6a')]()){var _0x189a40=fs[_0xd56e('0x6b')](path['join'](_0x1e0a23,_0x30030e[0x0]));if(_0x189a40[_0xd56e('0x47')]===0x0){removeReferences(_0x55cdd2,_0x1e0a23);logger[_0xd56e('0x2a')](_0xd56e('0x67'));return _0x41af75(new Error(_0xd56e('0x67')));}var _0x1e6963=_0x189a40[_0xd56e('0x6c')](function(_0x2c9837){return _0x2c9837===_0xd56e('0x6d');});if(!_0x1e6963){return _0x41af75(new Error(_0xd56e('0x6e')));}var _0x441801=fs[_0xd56e('0x6f')](path[_0xd56e('0x4b')](_0x1e0a23,_0x30030e[0x0],_0xd56e('0x6d')));var _0x1b680c=JSON[_0xd56e('0x70')](_0x441801);if('undefined'==typeof _0x1b680c[_0xd56e('0x2c')]){return _0x41af75(new Error(_0xd56e('0x71')));}if(_0xd56e('0x72')==typeof _0x1b680c[_0xd56e('0x30')]){return _0x41af75(new Error(_0xd56e('0x73')));}if('undefined'==typeof _0x1b680c[_0xd56e('0x74')]){return _0x41af75(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0xd56e('0x72')==typeof _0x1b680c[_0xd56e('0x75')]){return _0x41af75(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x1b680c[_0xd56e('0x30')]===_0xd56e('0x76')){if(_0xd56e('0x72')==typeof _0x1b680c[_0xd56e('0x75')]['views']){return _0x41af75(new Error(_0xd56e('0x77')));}if('undefined'==typeof _0x1b680c['parameters'][_0xd56e('0x78')][_0xd56e('0x79')]&&_0xd56e('0x72')==typeof _0x1b680c[_0xd56e('0x75')]['views'][_0xd56e('0x7a')]){return _0x41af75(new Error(_0xd56e('0x7b')));}}else if(_0x1b680c[_0xd56e('0x30')]==='script'){if(_0xd56e('0x72')==typeof _0x1b680c[_0xd56e('0x75')]['scriptName']){return _0x41af75(new Error(_0xd56e('0x7c')));}if(_0xd56e('0x72')==typeof _0x1b680c[_0xd56e('0x75')]['scriptPath']){return _0x41af75(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x41af75(new Error(_0xd56e('0x7d')));}var _0x422e7c=_0x1b680c[_0xd56e('0x2c')];var _0x37a02b=_0x1b680c[_0xd56e('0x7e')];var _0x32f60=_0x1b680c[_0xd56e('0x30')];var _0x43e127=_0x1b680c[_0xd56e('0x7f')]?_0x1b680c[_0xd56e('0x7f')]:'always';var _0x19f62d=_0x1b680c['icon']?_0x1b680c[_0xd56e('0x80')]:'icon-apps';var _0x2a6ea1='';var _0x5597bd='';var _0xb6943f='';var _0x282a96='';var _0x190579=_0x1b680c[_0xd56e('0x74')];if(_0x32f60===_0xd56e('0x76')){if(_0xd56e('0x72')!=typeof _0x1b680c['parameters'][_0xd56e('0x78')][_0xd56e('0x79')]){var _0x1250bf=_0x1b680c[_0xd56e('0x75')][_0xd56e('0x78')][_0xd56e('0x79')];if(!/^(f|ht)tps?:\/\//i[_0xd56e('0x81')](_0x1250bf)){_0x2a6ea1=path[_0xd56e('0x4b')](_0xd56e('0x82'),_0x1c174b,_0x30030e[0x0],_0x1250bf);}else{_0x2a6ea1=_0x1250bf;}}else{logger[_0xd56e('0x5d')](_0xd56e('0x83'));}if(_0xd56e('0x72')!=typeof _0x1b680c[_0xd56e('0x75')][_0xd56e('0x78')][_0xd56e('0x7a')]){var _0x4b67d5=_0x1b680c[_0xd56e('0x75')][_0xd56e('0x78')][_0xd56e('0x7a')];if(!/^(f|ht)tps?:\/\//i[_0xd56e('0x81')](_0x4b67d5)){_0x5597bd=path[_0xd56e('0x4b')](_0xd56e('0x82'),_0x1c174b,_0x30030e[0x0],_0x4b67d5);}else{_0x5597bd=_0x4b67d5;}}else{logger[_0xd56e('0x5d')](_0xd56e('0x84'));}}else if(_0x32f60===_0xd56e('0x85')){_0xb6943f=_0x1b680c[_0xd56e('0x75')][_0xd56e('0x86')];_0x282a96=_0x1b680c[_0xd56e('0x75')][_0xd56e('0x87')];if(_0xd56e('0x72')!=typeof _0x1b680c[_0xd56e('0x75')]['views']){if(_0xd56e('0x72')!=typeof _0x1b680c['parameters'][_0xd56e('0x78')][_0xd56e('0x79')]){var _0x1250bf=_0x1b680c[_0xd56e('0x75')]['views'][_0xd56e('0x79')];if(!/^(f|ht)tps?:\/\//i[_0xd56e('0x81')](_0x1250bf)){_0x2a6ea1=path[_0xd56e('0x4b')](_0xd56e('0x82'),_0x1c174b,_0x30030e[0x0],_0x1250bf);}else{_0x2a6ea1=_0x1250bf;}}if('undefined'!=typeof _0x1b680c['parameters']['views']['agent']){var _0x4b67d5=_0x1b680c[_0xd56e('0x75')][_0xd56e('0x78')][_0xd56e('0x7a')];if(!/^(f|ht)tps?:\/\//i['test'](_0x4b67d5)){_0x5597bd=path[_0xd56e('0x4b')]('plugins',_0x1c174b,_0x30030e[0x0],_0x4b67d5);}else{_0x5597bd=_0x4b67d5;}}}}var _0x11b47b={'name':_0x422e7c,'description':_0x37a02b,'path':path[_0xd56e('0x4b')](_0x1c174b,_0x30030e[0x0]),'type':_0x32f60,'sidebar':_0x43e127,'icon':_0x19f62d,'adminUrl':_0x2a6ea1,'agentUrl':_0x5597bd,'scriptName':_0xb6943f,'scriptPath':_0x282a96,'version':_0x190579};removeReferences(_0x55cdd2,null);return db['Plugin'][_0xd56e('0x88')](_0x11b47b)[_0xd56e('0x26')](function(_0x1d1acf){var _0x1926d9={'role':_0x24e544[_0xd56e('0x89')]['role'],'userProfileId':_0x24e544['body'][_0xd56e('0x8a')]};if(!_0x1926d9)throw new Error(_0xd56e('0x8b'));if(_0x1926d9[_0xd56e('0x8c')]===_0xd56e('0x8d')){var _0x4ab38b=_0x1d1acf['get']({'plain':!![]});return db[_0xd56e('0x8e')]['find']({'where':{'name':_0xd56e('0x27'),'userProfileId':_0x1926d9[_0xd56e('0x8a')]},'raw':!![]})[_0xd56e('0x26')](function(_0x3c1e1c){if(_0x3c1e1c&&_0x3c1e1c['autoAssociation']===0x0){return db[_0xd56e('0x8f')][_0xd56e('0x88')]({'name':_0x4ab38b[_0xd56e('0x2c')],'resourceId':_0x4ab38b['id'],'type':_0x3c1e1c[_0xd56e('0x2c')],'sectionId':_0x3c1e1c['id']},{})['then'](function(){return _0x1d1acf;});}else{return _0x1d1acf;}})[_0xd56e('0x60')](function(_0x475428){logger[_0xd56e('0x2a')](_0xd56e('0x90'),_0x475428);throw _0x475428;});}return _0x1d1acf;})[_0xd56e('0x26')](respondWithResult(_0xaee335,null))[_0xd56e('0x60')](handleError(_0xaee335,null));}});}catch(_0x26ad49){_0xaee335[_0xd56e('0x20')](0x1f4)[_0xd56e('0x2d')](_0x26ad49);}};function removeReferences(_0x122243,_0x56d196){try{if(_0x122243){fs[_0xd56e('0x91')](_0x122243);logger[_0xd56e('0x5d')](_0xd56e('0x92'));}if(_0x56d196){rimraf(_0x56d196,function(){});logger[_0xd56e('0x5d')]('Extracted\x20folder\x20removed');}}catch(_0x45743a){logger[_0xd56e('0x2a')](_0x45743a);}}exports['update']=function(_0x18fd86,_0x336d20,_0x4f228e){return db[_0xd56e('0x42')]['find']({'where':{'id':_0x18fd86[_0xd56e('0x46')]['id']}})[_0xd56e('0x26')](handleEntityNotFound(_0x336d20,null))[_0xd56e('0x26')](saveUpdates(_0x18fd86[_0xd56e('0x89')],null))[_0xd56e('0x26')](respondWithResult(_0x336d20,null))['catch'](handleError(_0x336d20,null));};exports[_0xd56e('0x93')]=function(_0x44eb27,_0x594793,_0x4e7c1f){return db[_0xd56e('0x42')][_0xd56e('0x94')]({'where':{'id':_0x44eb27[_0xd56e('0x46')]['id']}})[_0xd56e('0x26')](function(_0x42ac0d){if(_0x42ac0d){return _0x42ac0d['destroy']();}})[_0xd56e('0x26')](function(_0x56cb91){rimraf(path['join'](config[_0xd56e('0x56')],_0xd56e('0x57'),path['dirname'](_0x56cb91[_0xd56e('0x9')])),function(){});return _0x56cb91;})['then'](handleEntityNotFound(_0x594793,null))[_0xd56e('0x26')](respondWithStatusCode(_0x594793,null))[_0xd56e('0x60')](handleError(_0x594793,null));};exports[_0xd56e('0x95')]=function(_0x3345e1,_0x5afdd3,_0x2dfa9d){return BPromise['resolve']()['then'](function(){if(!_0x3345e1['query'][_0xd56e('0x9')]){throw new Error(_0xd56e('0x96'));}if(!_0x3345e1[_0xd56e('0x33')]['port']){throw new Error(_0xd56e('0x97'));}var _0x4e719f=_0x3345e1[_0xd56e('0x33')][_0xd56e('0x98')]?_0x3345e1['query']['hostname']+':'+_0x3345e1[_0xd56e('0x33')][_0xd56e('0x99')]:_0xd56e('0x9a')+_0x3345e1['query'][_0xd56e('0x99')];var _0x763ea2=_0x3345e1['query']['json']?_0x3345e1[_0xd56e('0x33')][_0xd56e('0x9b')]:!![];var _0x1831e3=_0x3345e1['query']['encoding']?_0x3345e1[_0xd56e('0x33')][_0xd56e('0x9c')]:null;var _0xd3bd6c={'method':_0x3345e1[_0xd56e('0x9d')],'uri':util[_0xd56e('0x4c')]('%s%s',_0x4e719f,_0x3345e1[_0xd56e('0x33')][_0xd56e('0x9')]),'json':_0x763ea2,'resolveWithFullResponse':!![],'encoding':_0x1831e3,'qs':_0x3345e1[_0xd56e('0x33')]};if(_0x3345e1[_0xd56e('0x9e')]){_0xd3bd6c[_0xd56e('0x9e')]=_0x3345e1[_0xd56e('0x9e')];if(_0xd3bd6c[_0xd56e('0x9e')]['content-length']){delete _0xd3bd6c[_0xd56e('0x9e')]['content-length'];}}if(_0xd3bd6c[_0xd56e('0x9e')]['content-type']){delete _0xd3bd6c[_0xd56e('0x9e')][_0xd56e('0x9f')];}return rp(_0xd3bd6c);})['then'](function(_0x35dd6e){if(_0x35dd6e){_0x5afdd3['set'](_0x35dd6e[_0xd56e('0x9e')]);logger[_0xd56e('0x5d')](_0x35dd6e[_0xd56e('0x89')]);if(_[_0xd56e('0xa0')](_0x3345e1[_0xd56e('0x33')][_0xd56e('0x9')],_0xd56e('0x4a'))&&_0x35dd6e['statusCode']==0x1f4){return _0x5afdd3[_0xd56e('0x1f')](_0x35dd6e[_0xd56e('0xa1')]);}else{return _0x5afdd3[_0xd56e('0x20')](_0x35dd6e[_0xd56e('0xa1')])[_0xd56e('0x2d')](_0x35dd6e[_0xd56e('0x89')]);}}else{return _0x5afdd3[_0xd56e('0x1f')](0xc8);}})[_0xd56e('0x60')](handleError(_0x5afdd3,null));};exports[_0xd56e('0xa2')]=function(_0x506dcc,_0x24250c,_0x40646f){return BPromise[_0xd56e('0xa3')]()[_0xd56e('0x26')](function(){if(!_0x506dcc[_0xd56e('0x33')][_0xd56e('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x506dcc[_0xd56e('0x33')][_0xd56e('0x99')]){throw new Error(_0xd56e('0x97'));}var _0x31b06b=_0x506dcc[_0xd56e('0x33')][_0xd56e('0x98')]?_0x506dcc[_0xd56e('0x33')][_0xd56e('0x98')]+':'+_0x506dcc[_0xd56e('0x33')][_0xd56e('0x99')]:_0xd56e('0x9a')+_0x506dcc[_0xd56e('0x33')][_0xd56e('0x99')];var _0x4fd8aa=_0x506dcc[_0xd56e('0x33')][_0xd56e('0x9b')]?_0x506dcc['query'][_0xd56e('0x9b')]:!![];var _0x43cb16=_0x506dcc['query'][_0xd56e('0x9c')]?_0x506dcc[_0xd56e('0x33')][_0xd56e('0x9c')]:null;var _0x3940c3={'method':_0x506dcc[_0xd56e('0x9d')],'uri':util['format'](_0xd56e('0xa4'),_0x31b06b,_0x506dcc[_0xd56e('0x33')][_0xd56e('0x9')]),'json':_0x4fd8aa,'resolveWithFullResponse':!![],'encoding':_0x43cb16,'body':_0x506dcc[_0xd56e('0x89')]};if(_0x506dcc[_0xd56e('0x9e')]){_0x3940c3['headers']=_0x506dcc['headers'];if(_0x3940c3[_0xd56e('0x9e')][_0xd56e('0xa5')]){delete _0x3940c3[_0xd56e('0x9e')]['content-length'];}}if(_0x3940c3[_0xd56e('0x9e')]['content-type']){delete _0x3940c3[_0xd56e('0x9e')]['content-type'];}return rp(_0x3940c3);})[_0xd56e('0x26')](function(_0x27335e){if(_0x27335e){_0x24250c[_0xd56e('0x23')](_0x27335e[_0xd56e('0x9e')]);logger[_0xd56e('0x5d')](_0x27335e[_0xd56e('0x89')]);return _0x24250c[_0xd56e('0x20')](_0x27335e['statusCode'])[_0xd56e('0x2d')](_0x27335e['body']);}else{return _0x24250c['sendStatus'](0xc8);}})[_0xd56e('0x60')](handleError(_0x24250c,null));}; \ No newline at end of file +var _0xa413=['send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','method','set','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','count','offset','json','save','update','destroy','then','get','UserProfileResource','error','stack','name','index','Plugin','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','download','join','root','format','%s.zip','basename','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','node_modules/**/*','finalize','close','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','server/files/plugins','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','readFileSync','parse','undefined','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','agent','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','Warning:\x20agent\x20view\x20not\x20specified','plugins','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Plugins','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x3bedc6,_0x37fee0){var _0x25d351=function(_0x528864){while(--_0x528864){_0x3bedc6['push'](_0x3bedc6['shift']());}};_0x25d351(++_0x37fee0);}(_0xa413,0xc2));var _0x3a41=function(_0x5a0e87,_0x1bf7a7){_0x5a0e87=_0x5a0e87-0x0;var _0x440270=_0xa413[_0x5a0e87];return _0x440270;};'use strict';var pdf=require(_0x3a41('0x0'));var emlformat=require(_0x3a41('0x1'));var rimraf=require(_0x3a41('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3a41('0x3'));var rp=require(_0x3a41('0x4'));var moment=require(_0x3a41('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3a41('0x6'));var util=require(_0x3a41('0x7'));var path=require(_0x3a41('0x8'));var sox=require(_0x3a41('0x9'));var csv=require(_0x3a41('0xa'));var ejs=require(_0x3a41('0xb'));var fs=require('fs');var _=require(_0x3a41('0xc'));var squel=require(_0x3a41('0xd'));var crypto=require(_0x3a41('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3a41('0xf'));var toCsv=require(_0x3a41('0xa'));var querystring=require(_0x3a41('0x10'));var Papa=require(_0x3a41('0x11'));var extract=require(_0x3a41('0x12'));var rimraf=require('rimraf');var archiver=require(_0x3a41('0x13'));var Redis=require(_0x3a41('0x14'));var authService=require(_0x3a41('0x15'));var qs=require(_0x3a41('0x16'));var as=require(_0x3a41('0x17'));var hardwareService=require(_0x3a41('0x18'));var logger=require(_0x3a41('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x3a41('0x1a'));var db=require(_0x3a41('0x1b'))['db'];config['redis']=_[_0x3a41('0x1c')](config[_0x3a41('0x1d')],{'host':_0x3a41('0x1e'),'port':0x18eb});var socket=require(_0x3a41('0x1f'))(new Redis(config[_0x3a41('0x1d')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x56598c,_0x51ba3d){_0x51ba3d=_0x51ba3d||0xcc;return function(_0x3f2809){if(_0x3f2809){return _0x56598c[_0x3a41('0x20')](_0x51ba3d);}return _0x56598c[_0x3a41('0x21')](_0x51ba3d)[_0x3a41('0x22')]();};}function respondWithResult(_0x5ab76c,_0x2e4772){_0x2e4772=_0x2e4772||0xc8;return function(_0x1bbced){if(_0x1bbced){return _0x5ab76c[_0x3a41('0x21')](_0x2e4772)['json'](_0x1bbced);}};}function respondWithFilteredResult(_0x5d78f2,_0x148388){return function(_0x25ad55){if(_0x25ad55){var _0x32bcd2=_0x25ad55[_0x3a41('0x23')],_0x2a53a4=_0x148388['offset'],_0x361434=_0x148388[_0x3a41('0x24')]+_0x148388['limit'],_0x4bcb47;if(_0x361434>=_0x32bcd2){_0x361434=_0x32bcd2;_0x4bcb47=0xc8;}else{_0x4bcb47=0xce;}_0x5d78f2[_0x3a41('0x21')](_0x4bcb47);return _0x5d78f2['set']('Content-Range',_0x2a53a4+'-'+_0x361434+'/'+_0x32bcd2)[_0x3a41('0x25')](_0x25ad55);}return null;};}function patchUpdates(_0x408fe8){return function(_0x24a9f5){try{jsonpatch['apply'](_0x24a9f5,_0x408fe8,!![]);}catch(_0x293554){return BPromise['reject'](_0x293554);}return _0x24a9f5[_0x3a41('0x26')]();};}function saveUpdates(_0x4c6205,_0x3598e5){return function(_0x5db74a){if(_0x5db74a){return _0x5db74a[_0x3a41('0x27')](_0x4c6205)['then'](function(_0x2185ae){return _0x2185ae;});}return null;};}function removeEntity(_0x1a9ab8,_0x117a35){return function(_0x22f8d){if(_0x22f8d){return _0x22f8d[_0x3a41('0x28')]()[_0x3a41('0x29')](function(){var _0x57752a=_0x22f8d[_0x3a41('0x2a')]({'plain':!![]});var _0x23baa6='Plugins';return db[_0x3a41('0x2b')][_0x3a41('0x28')]({'where':{'type':_0x23baa6,'resourceId':_0x57752a['id']}})[_0x3a41('0x29')](function(){return _0x22f8d;});})['then'](function(){_0x1a9ab8[_0x3a41('0x21')](0xcc)[_0x3a41('0x22')]();});}};}function handleEntityNotFound(_0x30fa7d,_0x367e97){return function(_0x4263b7){if(!_0x4263b7){_0x30fa7d[_0x3a41('0x20')](0x194);}return _0x4263b7;};}function handleError(_0x4d864a,_0x308846){_0x308846=_0x308846||0x1f4;return function(_0x474d71){logger[_0x3a41('0x2c')](_0x474d71[_0x3a41('0x2d')]);if(_0x474d71[_0x3a41('0x2e')]){delete _0x474d71['name'];}_0x4d864a[_0x3a41('0x21')](_0x308846)['send'](_0x474d71);};}exports[_0x3a41('0x2f')]=function(_0x3473ed,_0x400ee7){var _0x3d7412={},_0x4e92cb={},_0x5a3f91={'count':0x0,'rows':[]};var _0x381962=_['map'](db[_0x3a41('0x30')][_0x3a41('0x31')],function(_0x46945d){return{'name':_0x46945d[_0x3a41('0x32')],'type':_0x46945d[_0x3a41('0x33')][_0x3a41('0x34')]};});_0x4e92cb[_0x3a41('0x35')]=_[_0x3a41('0x36')](_0x381962,_0x3a41('0x2e'));_0x4e92cb['query']=_['keys'](_0x3473ed[_0x3a41('0x37')]);_0x4e92cb[_0x3a41('0x38')]=_[_0x3a41('0x39')](_0x4e92cb[_0x3a41('0x35')],_0x4e92cb[_0x3a41('0x37')]);_0x3d7412[_0x3a41('0x3a')]=_['intersection'](_0x4e92cb['model'],qs[_0x3a41('0x3b')](_0x3473ed[_0x3a41('0x37')][_0x3a41('0x3b')]));_0x3d7412[_0x3a41('0x3a')]=_0x3d7412['attributes']['length']?_0x3d7412['attributes']:_0x4e92cb[_0x3a41('0x35')];if(!_0x3473ed[_0x3a41('0x37')][_0x3a41('0x3c')](_0x3a41('0x3d'))){_0x3d7412['limit']=qs[_0x3a41('0x3e')](_0x3473ed[_0x3a41('0x37')]['limit']);_0x3d7412[_0x3a41('0x24')]=qs[_0x3a41('0x24')](_0x3473ed[_0x3a41('0x37')][_0x3a41('0x24')]);}_0x3d7412[_0x3a41('0x3f')]=qs['sort'](_0x3473ed[_0x3a41('0x37')][_0x3a41('0x40')]);_0x3d7412['where']=qs[_0x3a41('0x38')](_[_0x3a41('0x41')](_0x3473ed['query'],_0x4e92cb[_0x3a41('0x38')]),_0x381962);if(_0x3473ed[_0x3a41('0x37')][_0x3a41('0x42')]){_0x3d7412[_0x3a41('0x43')]=_[_0x3a41('0x44')](_0x3d7412[_0x3a41('0x43')],{'$or':_[_0x3a41('0x36')](_0x381962,function(_0x15c583){if(_0x15c583[_0x3a41('0x33')]!==_0x3a41('0x45')){var _0x42958c={};_0x42958c[_0x15c583[_0x3a41('0x2e')]]={'$like':'%'+_0x3473ed['query'][_0x3a41('0x42')]+'%'};return _0x42958c;}})});}_0x3d7412=_['merge']({},_0x3d7412,_0x3473ed[_0x3a41('0x46')]);var _0x3363b5={'where':_0x3d7412[_0x3a41('0x43')]};return db[_0x3a41('0x30')][_0x3a41('0x23')](_0x3363b5)['then'](function(_0x35ca79){_0x5a3f91[_0x3a41('0x23')]=_0x35ca79;if(_0x3473ed[_0x3a41('0x37')][_0x3a41('0x47')]){_0x3d7412[_0x3a41('0x48')]=[{'all':!![]}];}return db['Plugin'][_0x3a41('0x49')](_0x3d7412);})[_0x3a41('0x29')](function(_0x43d818){_0x5a3f91[_0x3a41('0x4a')]=_0x43d818;return _0x5a3f91;})[_0x3a41('0x29')](respondWithFilteredResult(_0x400ee7,_0x3d7412))[_0x3a41('0x4b')](handleError(_0x400ee7,null));};exports[_0x3a41('0x4c')]=function(_0x54bd3d,_0x23f3b4){var _0x16cbc3={'raw':!![],'where':{'id':_0x54bd3d[_0x3a41('0x4d')]['id']}},_0x1e47c8={};_0x1e47c8[_0x3a41('0x35')]=_[_0x3a41('0x4e')](db[_0x3a41('0x30')][_0x3a41('0x31')]);_0x1e47c8[_0x3a41('0x37')]=_[_0x3a41('0x4e')](_0x54bd3d[_0x3a41('0x37')]);_0x1e47c8[_0x3a41('0x38')]=_['intersection'](_0x1e47c8[_0x3a41('0x35')],_0x1e47c8[_0x3a41('0x37')]);_0x16cbc3[_0x3a41('0x3a')]=_[_0x3a41('0x39')](_0x1e47c8['model'],qs[_0x3a41('0x3b')](_0x54bd3d['query']['fields']));_0x16cbc3[_0x3a41('0x3a')]=_0x16cbc3[_0x3a41('0x3a')][_0x3a41('0x4f')]?_0x16cbc3[_0x3a41('0x3a')]:_0x1e47c8[_0x3a41('0x35')];if(_0x54bd3d[_0x3a41('0x37')][_0x3a41('0x47')]){_0x16cbc3[_0x3a41('0x48')]=[{'all':!![]}];}_0x16cbc3=_[_0x3a41('0x44')]({},_0x16cbc3,_0x54bd3d[_0x3a41('0x46')]);return db[_0x3a41('0x30')][_0x3a41('0x50')](_0x16cbc3)[_0x3a41('0x29')](handleEntityNotFound(_0x23f3b4,null))[_0x3a41('0x29')](respondWithResult(_0x23f3b4,null))[_0x3a41('0x4b')](handleError(_0x23f3b4,null));};exports[_0x3a41('0x51')]=function(_0x261c14,_0x114033,_0xe97ce6){return db[_0x3a41('0x30')][_0x3a41('0x50')]({'where':{'id':_0x261c14['params']['id']},'attributes':[_0x3a41('0x2e'),'path'],'raw':!![]})[_0x3a41('0x29')](handleEntityNotFound(_0x114033,null))[_0x3a41('0x29')](function(_0x5489da){if(_0x5489da){var _0x559be4=path[_0x3a41('0x52')](config[_0x3a41('0x53')],'server/files/plugins',util[_0x3a41('0x54')](_0x3a41('0x55'),path[_0x3a41('0x56')](_0x5489da[_0x3a41('0x8')])));var _0x12ccc5=fs[_0x3a41('0x57')](_0x559be4);var _0x28b866=archiver(_0x3a41('0x58'),{'zlib':{'level':0x9}});_0x28b866['on'](_0x3a41('0x59'),function(_0x41cc53){if(_0x41cc53[_0x3a41('0x5a')]==='ENOENT'){logger[_0x3a41('0x2c')](_0x41cc53);}else{throw new db[(_0x3a41('0x5b'))][(_0x3a41('0x5c'))](_0x3a41('0x5d'));}});_0x28b866['on'](_0x3a41('0x2c'),function(_0x254fb1){throw new db[(_0x3a41('0x5b'))][(_0x3a41('0x5c'))](_0x3a41('0x5d'));});_0x28b866[_0x3a41('0x5e')](_0x12ccc5);_0x28b866[_0x3a41('0x5f')]('**/*',{'cwd':path[_0x3a41('0x52')](config['root'],'server/files/plugins',path[_0x3a41('0x60')](_0x5489da[_0x3a41('0x8')])),'ignore':[path['join'](path[_0x3a41('0x56')](_0x5489da[_0x3a41('0x8')]),_0x3a41('0x61')),path[_0x3a41('0x52')](path['basename'](_0x5489da[_0x3a41('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x3a41('0x62')]();_0x12ccc5['on'](_0x3a41('0x63'),function(){if(!fs['existsSync'](_0x559be4)){throw new db[(_0x3a41('0x5b'))][(_0x3a41('0x5c'))]('Plugin\x20not\x20found');}return _0x114033[_0x3a41('0x51')](_0x559be4,util[_0x3a41('0x54')](_0x3a41('0x55'),path[_0x3a41('0x56')](_0x5489da['path'])),function(_0xa3da51){if(_0xa3da51){throw new db[(_0x3a41('0x5b'))][(_0x3a41('0x5c'))](_0x3a41('0x64'));}fs[_0x3a41('0x65')](_0x559be4);logger[_0x3a41('0x66')]('Download\x20completed');logger[_0x3a41('0x66')](_0x3a41('0x67'));});});}return null;})['catch'](handleError(_0x114033,null));};exports[_0x3a41('0x68')]=function(_0x44fea6,_0x255714,_0x22c1c9){var _0xc59776=path['basename'](_0x44fea6[_0x3a41('0x69')][_0x3a41('0x6a')],path['extname'](_0x44fea6[_0x3a41('0x69')][_0x3a41('0x6a')]));var _0x52ff06=path['join'](config[_0x3a41('0x53')],_0x3a41('0x6b'),_0x44fea6[_0x3a41('0x69')]['filename']);var _0x1ae7e7=path[_0x3a41('0x52')](config[_0x3a41('0x53')],_0x3a41('0x6b'),_0xc59776);logger[_0x3a41('0x66')]('Plugin\x20upload\x20filepath:\x20%s',_0x52ff06);logger[_0x3a41('0x66')](_0x3a41('0x6c'),_0x1ae7e7);try{fs[_0x3a41('0x6d')](_0x52ff06,parseInt(_0x3a41('0x6e'),0x8));extract(_0x52ff06,{'dir':_0x1ae7e7},function(_0x11a2da){if(_0x11a2da){logger[_0x3a41('0x2c')](_0x11a2da);handleError(_0x11a2da,!![]);};var _0x127185=fs[_0x3a41('0x6f')](_0x1ae7e7);if(_0x127185[_0x3a41('0x4f')]>0x1){removeReferences(_0x52ff06,_0x1ae7e7);logger[_0x3a41('0x2c')]('Invalid\x20plugin\x20structure');return _0x22c1c9(new Error(_0x3a41('0x70')));}var _0x42460f=fs[_0x3a41('0x71')](path[_0x3a41('0x52')](_0x1ae7e7,_0x127185[0x0]));if(_0x42460f[_0x3a41('0x72')]()){removeReferences(_0x52ff06,_0x1ae7e7);logger[_0x3a41('0x2c')](_0x3a41('0x70'));return _0x22c1c9(new Error(_0x3a41('0x70')));}if(_0x42460f[_0x3a41('0x73')]()){var _0x4887ec=fs[_0x3a41('0x6f')](path[_0x3a41('0x52')](_0x1ae7e7,_0x127185[0x0]));if(_0x4887ec[_0x3a41('0x4f')]===0x0){removeReferences(_0x52ff06,_0x1ae7e7);logger[_0x3a41('0x2c')]('Invalid\x20plugin\x20structure');return _0x22c1c9(new Error(_0x3a41('0x70')));}var _0x54512=_0x4887ec[_0x3a41('0x74')](function(_0x5cf3e0){return _0x5cf3e0===_0x3a41('0x75');});if(!_0x54512){return _0x22c1c9(new Error('Plugin\x20manifest\x20missing'));}var _0x23bb7b=fs[_0x3a41('0x76')](path[_0x3a41('0x52')](_0x1ae7e7,_0x127185[0x0],_0x3a41('0x75')));var _0x33bb88=JSON[_0x3a41('0x77')](_0x23bb7b);if(_0x3a41('0x78')==typeof _0x33bb88[_0x3a41('0x2e')]){return _0x22c1c9(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x3a41('0x78')==typeof _0x33bb88[_0x3a41('0x33')]){return _0x22c1c9(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x3a41('0x78')==typeof _0x33bb88[_0x3a41('0x79')]){return _0x22c1c9(new Error(_0x3a41('0x7a')));}if('undefined'==typeof _0x33bb88[_0x3a41('0x7b')]){return _0x22c1c9(new Error(_0x3a41('0x7c')));}if(_0x33bb88[_0x3a41('0x33')]===_0x3a41('0x7d')){if('undefined'==typeof _0x33bb88[_0x3a41('0x7b')]['views']){return _0x22c1c9(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x3a41('0x78')==typeof _0x33bb88['parameters'][_0x3a41('0x7e')]['admin']&&_0x3a41('0x78')==typeof _0x33bb88[_0x3a41('0x7b')][_0x3a41('0x7e')][_0x3a41('0x7f')]){return _0x22c1c9(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x33bb88['type']===_0x3a41('0x80')){if('undefined'==typeof _0x33bb88[_0x3a41('0x7b')][_0x3a41('0x81')]){return _0x22c1c9(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x3a41('0x78')==typeof _0x33bb88[_0x3a41('0x7b')][_0x3a41('0x82')]){return _0x22c1c9(new Error(_0x3a41('0x83')));}}else{return _0x22c1c9(new Error(_0x3a41('0x84')));}var _0x49953c=_0x33bb88[_0x3a41('0x2e')];var _0x50f5b1=_0x33bb88[_0x3a41('0x85')];var _0x59cc7d=_0x33bb88['type'];var _0x610e75=_0x33bb88['sidebar']?_0x33bb88[_0x3a41('0x86')]:_0x3a41('0x87');var _0x27d7ff=_0x33bb88[_0x3a41('0x88')]?_0x33bb88['icon']:_0x3a41('0x89');var _0x4c3bb5='';var _0x1806d6='';var _0x359fb4='';var _0x418396='';var _0x52b329=_0x33bb88[_0x3a41('0x79')];if(_0x59cc7d==='html'){if(_0x3a41('0x78')!=typeof _0x33bb88[_0x3a41('0x7b')][_0x3a41('0x7e')]['admin']){var _0x4994f1=_0x33bb88['parameters'][_0x3a41('0x7e')][_0x3a41('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x3a41('0x8b')](_0x4994f1)){_0x4c3bb5=path[_0x3a41('0x52')]('plugins',_0xc59776,_0x127185[0x0],_0x4994f1);}else{_0x4c3bb5=_0x4994f1;}}else{logger[_0x3a41('0x66')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x3a41('0x78')!=typeof _0x33bb88['parameters'][_0x3a41('0x7e')][_0x3a41('0x7f')]){var _0x17225b=_0x33bb88[_0x3a41('0x7b')][_0x3a41('0x7e')][_0x3a41('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x3a41('0x8b')](_0x17225b)){_0x1806d6=path[_0x3a41('0x52')]('plugins',_0xc59776,_0x127185[0x0],_0x17225b);}else{_0x1806d6=_0x17225b;}}else{logger[_0x3a41('0x66')](_0x3a41('0x8c'));}}else if(_0x59cc7d===_0x3a41('0x80')){_0x359fb4=_0x33bb88[_0x3a41('0x7b')][_0x3a41('0x81')];_0x418396=_0x33bb88[_0x3a41('0x7b')][_0x3a41('0x82')];if(_0x3a41('0x78')!=typeof _0x33bb88[_0x3a41('0x7b')][_0x3a41('0x7e')]){if(_0x3a41('0x78')!=typeof _0x33bb88[_0x3a41('0x7b')][_0x3a41('0x7e')][_0x3a41('0x8a')]){var _0x4994f1=_0x33bb88['parameters'][_0x3a41('0x7e')][_0x3a41('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x3a41('0x8b')](_0x4994f1)){_0x4c3bb5=path[_0x3a41('0x52')]('plugins',_0xc59776,_0x127185[0x0],_0x4994f1);}else{_0x4c3bb5=_0x4994f1;}}if(_0x3a41('0x78')!=typeof _0x33bb88[_0x3a41('0x7b')]['views'][_0x3a41('0x7f')]){var _0x17225b=_0x33bb88[_0x3a41('0x7b')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x3a41('0x8b')](_0x17225b)){_0x1806d6=path[_0x3a41('0x52')](_0x3a41('0x8d'),_0xc59776,_0x127185[0x0],_0x17225b);}else{_0x1806d6=_0x17225b;}}}}var _0x21e80f={'name':_0x49953c,'description':_0x50f5b1,'path':path['join'](_0xc59776,_0x127185[0x0]),'type':_0x59cc7d,'sidebar':_0x610e75,'icon':_0x27d7ff,'adminUrl':_0x4c3bb5,'agentUrl':_0x1806d6,'scriptName':_0x359fb4,'scriptPath':_0x418396,'version':_0x52b329};removeReferences(_0x52ff06,null);return db[_0x3a41('0x30')]['create'](_0x21e80f)[_0x3a41('0x29')](function(_0x11ef8e){var _0x29096a={'role':_0x44fea6[_0x3a41('0x8e')]['role'],'userProfileId':_0x44fea6[_0x3a41('0x8e')]['userProfileId']};if(!_0x29096a)throw new Error(_0x3a41('0x8f'));if(_0x29096a[_0x3a41('0x90')]===_0x3a41('0x91')){var _0x326f0c=_0x11ef8e[_0x3a41('0x2a')]({'plain':!![]});return db[_0x3a41('0x92')][_0x3a41('0x50')]({'where':{'name':_0x3a41('0x93'),'userProfileId':_0x29096a[_0x3a41('0x94')]},'raw':!![]})[_0x3a41('0x29')](function(_0x42b008){if(_0x42b008&&_0x42b008[_0x3a41('0x95')]===0x0){return db[_0x3a41('0x2b')][_0x3a41('0x96')]({'name':_0x326f0c[_0x3a41('0x2e')],'resourceId':_0x326f0c['id'],'type':_0x42b008[_0x3a41('0x2e')],'sectionId':_0x42b008['id']},{})['then'](function(){return _0x11ef8e;});}else{return _0x11ef8e;}})[_0x3a41('0x4b')](function(_0x506646){logger[_0x3a41('0x2c')](_0x3a41('0x97'),_0x506646);throw _0x506646;});}return _0x11ef8e;})[_0x3a41('0x29')](respondWithResult(_0x255714,null))[_0x3a41('0x4b')](handleError(_0x255714,null));}});}catch(_0x60e340){_0x255714[_0x3a41('0x21')](0x1f4)[_0x3a41('0x98')](_0x60e340);}};function removeReferences(_0x1f52fd,_0x3e28e0){try{if(_0x1f52fd){fs['unlinkSync'](_0x1f52fd);logger[_0x3a41('0x66')](_0x3a41('0x99'));}if(_0x3e28e0){rimraf(_0x3e28e0,function(){});logger[_0x3a41('0x66')](_0x3a41('0x9a'));}}catch(_0x5f1a24){logger[_0x3a41('0x2c')](_0x5f1a24);}}exports[_0x3a41('0x27')]=function(_0x66186c,_0x2c7bf7,_0x30c15c){return db[_0x3a41('0x30')][_0x3a41('0x50')]({'where':{'id':_0x66186c[_0x3a41('0x4d')]['id']}})[_0x3a41('0x29')](handleEntityNotFound(_0x2c7bf7,null))[_0x3a41('0x29')](saveUpdates(_0x66186c['body'],null))[_0x3a41('0x29')](respondWithResult(_0x2c7bf7,null))[_0x3a41('0x4b')](handleError(_0x2c7bf7,null));};exports[_0x3a41('0x9b')]=function(_0x3a9293,_0x54fd6e,_0xb1bdd2){return db[_0x3a41('0x30')][_0x3a41('0x50')]({'where':{'id':_0x3a9293['params']['id']}})[_0x3a41('0x29')](function(_0x18eba9){if(_0x18eba9){return _0x18eba9[_0x3a41('0x28')]();}})[_0x3a41('0x29')](function(_0x117921){rimraf(path[_0x3a41('0x52')](config['root'],'server/files/plugins',path['dirname'](_0x117921[_0x3a41('0x8')])),function(){});return _0x117921;})[_0x3a41('0x29')](handleEntityNotFound(_0x54fd6e,null))[_0x3a41('0x29')](respondWithStatusCode(_0x54fd6e,null))[_0x3a41('0x4b')](handleError(_0x54fd6e,null));};exports[_0x3a41('0x9c')]=function(_0x231da4,_0x431ab,_0x103f94){return BPromise[_0x3a41('0x9d')]()[_0x3a41('0x29')](function(){if(!_0x231da4[_0x3a41('0x37')][_0x3a41('0x8')]){throw new Error(_0x3a41('0x9e'));}if(!_0x231da4['query'][_0x3a41('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x197cf2=_0x231da4[_0x3a41('0x37')][_0x3a41('0xa0')]?_0x231da4[_0x3a41('0x37')][_0x3a41('0xa0')]+':'+_0x231da4[_0x3a41('0x37')][_0x3a41('0x9f')]:_0x3a41('0xa1')+_0x231da4['query'][_0x3a41('0x9f')];var _0x24b783=_0x231da4[_0x3a41('0x37')][_0x3a41('0x25')]?_0x231da4[_0x3a41('0x37')][_0x3a41('0x25')]:!![];var _0x7b0a04=_0x231da4['query'][_0x3a41('0xa2')]?_0x231da4[_0x3a41('0x37')][_0x3a41('0xa2')]:null;var _0x57c4dd={'method':_0x231da4['method'],'uri':util[_0x3a41('0x54')](_0x3a41('0xa3'),_0x197cf2,_0x231da4['query'][_0x3a41('0x8')]),'json':_0x24b783,'resolveWithFullResponse':!![],'encoding':_0x7b0a04,'qs':_0x231da4['query']};if(_0x231da4['headers']){_0x57c4dd[_0x3a41('0xa4')]=_0x231da4['headers'];if(_0x57c4dd[_0x3a41('0xa4')][_0x3a41('0xa5')]){delete _0x57c4dd[_0x3a41('0xa4')]['content-length'];}}if(_0x57c4dd[_0x3a41('0xa4')][_0x3a41('0xa6')]){delete _0x57c4dd[_0x3a41('0xa4')][_0x3a41('0xa6')];}return rp(_0x57c4dd);})[_0x3a41('0x29')](function(_0x2954fc){if(_0x2954fc){_0x431ab['set'](_0x2954fc['headers']);logger['info'](_0x2954fc['body']);if(_[_0x3a41('0xa7')](_0x231da4[_0x3a41('0x37')][_0x3a41('0x8')],'download')&&_0x2954fc[_0x3a41('0xa8')]==0x1f4){return _0x431ab[_0x3a41('0x20')](_0x2954fc[_0x3a41('0xa8')]);}else{return _0x431ab[_0x3a41('0x21')](_0x2954fc['statusCode'])['send'](_0x2954fc['body']);}}else{return _0x431ab[_0x3a41('0x20')](0xc8);}})[_0x3a41('0x4b')](handleError(_0x431ab,null));};exports[_0x3a41('0xa9')]=function(_0x19b242,_0x2ade75,_0x13695e){return BPromise[_0x3a41('0x9d')]()[_0x3a41('0x29')](function(){if(!_0x19b242['query'][_0x3a41('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x19b242['query']['port']){throw new Error(_0x3a41('0xaa'));}var _0x2441d7=_0x19b242[_0x3a41('0x37')][_0x3a41('0xa0')]?_0x19b242[_0x3a41('0x37')][_0x3a41('0xa0')]+':'+_0x19b242[_0x3a41('0x37')][_0x3a41('0x9f')]:_0x3a41('0xa1')+_0x19b242['query'][_0x3a41('0x9f')];var _0xb90c5c=_0x19b242['query'][_0x3a41('0x25')]?_0x19b242[_0x3a41('0x37')][_0x3a41('0x25')]:!![];var _0x1b49f9=_0x19b242[_0x3a41('0x37')][_0x3a41('0xa2')]?_0x19b242[_0x3a41('0x37')][_0x3a41('0xa2')]:null;var _0x39a83a={'method':_0x19b242[_0x3a41('0xab')],'uri':util[_0x3a41('0x54')]('%s%s',_0x2441d7,_0x19b242['query'][_0x3a41('0x8')]),'json':_0xb90c5c,'resolveWithFullResponse':!![],'encoding':_0x1b49f9,'body':_0x19b242[_0x3a41('0x8e')]};if(_0x19b242[_0x3a41('0xa4')]){_0x39a83a[_0x3a41('0xa4')]=_0x19b242[_0x3a41('0xa4')];if(_0x39a83a[_0x3a41('0xa4')][_0x3a41('0xa5')]){delete _0x39a83a[_0x3a41('0xa4')][_0x3a41('0xa5')];}}if(_0x39a83a[_0x3a41('0xa4')][_0x3a41('0xa6')]){delete _0x39a83a[_0x3a41('0xa4')][_0x3a41('0xa6')];}return rp(_0x39a83a);})['then'](function(_0x16f518){if(_0x16f518){_0x2ade75[_0x3a41('0xac')](_0x16f518[_0x3a41('0xa4')]);logger[_0x3a41('0x66')](_0x16f518[_0x3a41('0x8e')]);return _0x2ade75['status'](_0x16f518['statusCode'])[_0x3a41('0x98')](_0x16f518[_0x3a41('0x8e')]);}else{return _0x2ade75['sendStatus'](0xc8);}})[_0x3a41('0x4b')](handleError(_0x2ade75,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 2764272..2f49b9d 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 _0x4325=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4325,0x1da));var _0x5432=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4325[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x5432('0x0'));var Plugin=require(_0x5432('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x5432('0x2')](0x0);var events={'afterCreate':_0x5432('0x3'),'afterUpdate':_0x5432('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4fc4e9){return function(_0x20f704,_0x36ce53,_0xad26e9){PluginEvents['emit'](_0x4fc4e9+':'+_0x20f704['id'],_0x20f704);PluginEvents[_0x5432('0x5')](_0x4fc4e9,_0x20f704);_0xad26e9(null);};}for(var e in events){if(events[_0x5432('0x6')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x5432('0x7')]=PluginEvents; \ No newline at end of file +var _0x524e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','Plugin'];(function(_0x45d63e,_0x505901){var _0x13117c=function(_0xd0d7ff){while(--_0xd0d7ff){_0x45d63e['push'](_0x45d63e['shift']());}};_0x13117c(++_0x505901);}(_0x524e,0x15e));var _0xe524=function(_0x26c99a,_0x146530){_0x26c99a=_0x26c99a-0x0;var _0x1430c7=_0x524e[_0x26c99a];return _0x1430c7;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0xe524('0x0')];var PluginEvents=new EventEmitter();PluginEvents[_0xe524('0x1')](0x0);var events={'afterCreate':_0xe524('0x2'),'afterUpdate':_0xe524('0x3'),'afterDestroy':_0xe524('0x4')};function emitEvent(_0x379eb1){return function(_0xabd694,_0x32c90b,_0x10d37a){PluginEvents[_0xe524('0x5')](_0x379eb1+':'+_0xabd694['id'],_0xabd694);PluginEvents['emit'](_0x379eb1,_0xabd694);_0x10d37a(null);};}for(var e in events){if(events[_0xe524('0x6')](e)){var event=events[e];Plugin[_0xe524('0x7')](e,emitEvent(event));}}module[_0xe524('0x8')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index b74fd8a..61031c4 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 _0x150a=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./plugin.attributes','exports','define','plugins','util','../../config/logger'];(function(_0x5e39ea,_0x54c56a){var _0x224783=function(_0x2dcad1){while(--_0x2dcad1){_0x5e39ea['push'](_0x5e39ea['shift']());}};_0x224783(++_0x54c56a);}(_0x150a,0x142));var _0xa150=function(_0x352168,_0xc37f48){_0x352168=_0x352168-0x0;var _0x3e9333=_0x150a[_0x352168];return _0x3e9333;};'use strict';var _=require('lodash');var util=require(_0xa150('0x0'));var logger=require(_0xa150('0x1'))(_0xa150('0x2'));var moment=require(_0xa150('0x3'));var BPromise=require(_0xa150('0x4'));var rp=require(_0xa150('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa150('0x6'));var config=require(_0xa150('0x7'));var attributes=require(_0xa150('0x8'));module[_0xa150('0x9')]=function(_0x4ec4f2,_0x1db572){return _0x4ec4f2[_0xa150('0xa')]('Plugin',attributes,{'tableName':_0xa150('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c10=['path','rimraf','./plugin.attributes','define','lodash','util','../../config/logger','api'];(function(_0x1e0349,_0x133b95){var _0x15ec71=function(_0x127a5d){while(--_0x127a5d){_0x1e0349['push'](_0x1e0349['shift']());}};_0x15ec71(++_0x133b95);}(_0x4c10,0x1d4));var _0x04c1=function(_0x41e573,_0x46eb1d){_0x41e573=_0x41e573-0x0;var _0x2389ec=_0x4c10[_0x41e573];return _0x2389ec;};'use strict';var _=require(_0x04c1('0x0'));var util=require(_0x04c1('0x1'));var logger=require(_0x04c1('0x2'))(_0x04c1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x04c1('0x4'));var rimraf=require(_0x04c1('0x5'));var config=require('../../config/environment');var attributes=require(_0x04c1('0x6'));module['exports']=function(_0x5e9eaf,_0xf19ac9){return _0x5e9eaf[_0x04c1('0x7')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 7fa0e4d..073bf42 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 _0xf1cb=['Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2e092e,_0x1bbef3){var _0x4d4f52=function(_0x260843){while(--_0x260843){_0x2e092e['push'](_0x2e092e['shift']());}};_0x4d4f52(++_0x1bbef3);}(_0xf1cb,0x157));var _0xbf1c=function(_0x2cbc48,_0x316303){_0x2cbc48=_0x2cbc48-0x0;var _0x30f314=_0xf1cb[_0x2cbc48];return _0x30f314;};'use strict';var _=require(_0xbf1c('0x0'));var util=require('util');var moment=require(_0xbf1c('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf1c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbf1c('0x3'))['db'];var utils=require(_0xbf1c('0x4'));var logger=require('../../config/logger')(_0xbf1c('0x5'));var config=require(_0xbf1c('0x6'));var jayson=require(_0xbf1c('0x7'));var client=jayson[_0xbf1c('0x8')][_0xbf1c('0x9')]({'port':0x232a});config[_0xbf1c('0xa')]=_['defaults'](config['redis'],{'host':_0xbf1c('0xb'),'port':0x18eb});var socket=require(_0xbf1c('0xc'))(new Redis(config['redis']));require(_0xbf1c('0xd'))['register'](socket);function respondWithRpcPromise(_0x4da933,_0x32b11e,_0x2faac4){return new BPromise(function(_0x445004,_0x1472f9){return client[_0xbf1c('0xe')](_0x4da933,_0x2faac4)[_0xbf1c('0xf')](function(_0x2337c0){logger[_0xbf1c('0x10')](_0xbf1c('0x11'),_0x32b11e,_0xbf1c('0x12'));logger[_0xbf1c('0x13')](_0xbf1c('0x14'),_0x32b11e,_0xbf1c('0x12'),JSON[_0xbf1c('0x15')](_0x2337c0));if(_0x2337c0[_0xbf1c('0x16')]){if(_0x2337c0['error'][_0xbf1c('0x17')]===0x1f4){logger[_0xbf1c('0x16')](_0xbf1c('0x11'),_0x32b11e,_0x2337c0[_0xbf1c('0x16')][_0xbf1c('0x18')]);return _0x1472f9(_0x2337c0[_0xbf1c('0x16')][_0xbf1c('0x18')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x32b11e,_0x2337c0[_0xbf1c('0x16')][_0xbf1c('0x18')]);return _0x445004(_0x2337c0[_0xbf1c('0x16')]['message']);}else{logger[_0xbf1c('0x10')](_0xbf1c('0x11'),_0x32b11e,_0xbf1c('0x12'));_0x445004(_0x2337c0[_0xbf1c('0x19')][_0xbf1c('0x18')]);}})[_0xbf1c('0x1a')](function(_0x172617){logger[_0xbf1c('0x16')]('Plugin,\x20%s,\x20%s',_0x32b11e,_0x172617);_0x1472f9(_0x172617);});});}exports[_0xbf1c('0x1b')]=function(_0xafbd0){var _0x14c4fd=this;return new Promise(function(_0x4301a7,_0xf9bb77){return db[_0xbf1c('0x1c')][_0xbf1c('0x1d')](_0xafbd0[_0xbf1c('0x1e')],{'raw':_0xafbd0[_0xbf1c('0x1f')]?_0xafbd0[_0xbf1c('0x1f')][_0xbf1c('0x20')]===undefined?!![]:![]:!![]})[_0xbf1c('0xf')](function(_0xbf5b87){logger[_0xbf1c('0x10')](_0xbf1c('0x1b'),_0xafbd0);logger[_0xbf1c('0x13')](_0xbf1c('0x1b'),_0xafbd0,JSON[_0xbf1c('0x15')](_0xbf5b87));_0x4301a7(_0xbf5b87);})[_0xbf1c('0x1a')](function(_0xc5cbb2){logger['error'](_0xbf1c('0x1b'),_0xc5cbb2['message'],_0xafbd0);_0xf9bb77(_0x14c4fd[_0xbf1c('0x16')](0x1f4,_0xc5cbb2[_0xbf1c('0x18')]));});});}; \ No newline at end of file +var _0x9b4b=['body','options','raw','CreatePlugin','debug','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','request','then','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x58008c,_0x165ac3){var _0x267dd7=function(_0x42946d){while(--_0x42946d){_0x58008c['push'](_0x58008c['shift']());}};_0x267dd7(++_0x165ac3);}(_0x9b4b,0xe5));var _0xb9b4=function(_0x1c7b4c,_0x5b85b2){_0x1c7b4c=_0x1c7b4c-0x0;var _0x18daf6=_0x9b4b[_0x1c7b4c];return _0x18daf6;};'use strict';var _=require(_0xb9b4('0x0'));var util=require(_0xb9b4('0x1'));var moment=require(_0xb9b4('0x2'));var BPromise=require('bluebird');var rs=require(_0xb9b4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9b4('0x4'))['db'];var utils=require(_0xb9b4('0x5'));var logger=require(_0xb9b4('0x6'))('rpc');var config=require(_0xb9b4('0x7'));var jayson=require(_0xb9b4('0x8'));var client=jayson[_0xb9b4('0x9')][_0xb9b4('0xa')]({'port':0x232a});config['redis']=_[_0xb9b4('0xb')](config[_0xb9b4('0xc')],{'host':_0xb9b4('0xd'),'port':0x18eb});var socket=require(_0xb9b4('0xe'))(new Redis(config[_0xb9b4('0xc')]));require(_0xb9b4('0xf'))['register'](socket);function respondWithRpcPromise(_0x533c67,_0x5a6f6b,_0x1f5ffc){return new BPromise(function(_0x246f48,_0x546c64){return client[_0xb9b4('0x10')](_0x533c67,_0x1f5ffc)[_0xb9b4('0x11')](function(_0x6eecb2){logger['info'](_0xb9b4('0x12'),_0x5a6f6b,_0xb9b4('0x13'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x5a6f6b,_0xb9b4('0x13'),JSON[_0xb9b4('0x14')](_0x6eecb2));if(_0x6eecb2[_0xb9b4('0x15')]){if(_0x6eecb2['error'][_0xb9b4('0x16')]===0x1f4){logger[_0xb9b4('0x15')](_0xb9b4('0x12'),_0x5a6f6b,_0x6eecb2[_0xb9b4('0x15')]['message']);return _0x546c64(_0x6eecb2[_0xb9b4('0x15')][_0xb9b4('0x17')]);}logger[_0xb9b4('0x15')](_0xb9b4('0x12'),_0x5a6f6b,_0x6eecb2[_0xb9b4('0x15')][_0xb9b4('0x17')]);return _0x246f48(_0x6eecb2[_0xb9b4('0x15')]['message']);}else{logger[_0xb9b4('0x18')](_0xb9b4('0x12'),_0x5a6f6b,_0xb9b4('0x13'));_0x246f48(_0x6eecb2[_0xb9b4('0x19')]['message']);}})[_0xb9b4('0x1a')](function(_0x5525dc){logger['error'](_0xb9b4('0x12'),_0x5a6f6b,_0x5525dc);_0x546c64(_0x5525dc);});});}exports['CreatePlugin']=function(_0x17eca2){var _0x3552a0=this;return new Promise(function(_0x117772,_0x5e0fff){return db['Plugin']['create'](_0x17eca2[_0xb9b4('0x1b')],{'raw':_0x17eca2['options']?_0x17eca2[_0xb9b4('0x1c')][_0xb9b4('0x1d')]===undefined?!![]:![]:!![]})[_0xb9b4('0x11')](function(_0x436bcc){logger['info'](_0xb9b4('0x1e'),_0x17eca2);logger[_0xb9b4('0x1f')](_0xb9b4('0x1e'),_0x17eca2,JSON[_0xb9b4('0x14')](_0x436bcc));_0x117772(_0x436bcc);})[_0xb9b4('0x1a')](function(_0x14cd36){logger[_0xb9b4('0x15')]('CreatePlugin',_0x14cd36[_0xb9b4('0x17')],_0x17eca2);_0x5e0fff(_0x3552a0[_0xb9b4('0x15')](0x1f4,_0x14cd36[_0xb9b4('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 447c58d..6d7ade4 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 _0x6c9c=['removeListener','register','length','plugin:','./plugin.events','save','update'];(function(_0x271091,_0x18c045){var _0x572730=function(_0x4a2f2c){while(--_0x4a2f2c){_0x271091['push'](_0x271091['shift']());}};_0x572730(++_0x18c045);}(_0x6c9c,0x12a));var _0xc6c9=function(_0x40c536,_0x527b57){_0x40c536=_0x40c536-0x0;var _0x5df7d3=_0x6c9c[_0x40c536];return _0x5df7d3;};'use strict';var PluginEvents=require(_0xc6c9('0x0'));var events=[_0xc6c9('0x1'),'remove',_0xc6c9('0x2')];function createListener(_0x332be5,_0x282692){return function(_0x2505c5){_0x282692['emit'](_0x332be5,_0x2505c5);};}function removeListener(_0x3257fa,_0x459e90){return function(){PluginEvents[_0xc6c9('0x3')](_0x3257fa,_0x459e90);};}exports[_0xc6c9('0x4')]=function(_0x422195){for(var _0x84b96e=0x0,_0xf9e43e=events[_0xc6c9('0x5')];_0x84b96e<_0xf9e43e;_0x84b96e++){var _0x30db53=events[_0x84b96e];var _0x15cf6e=createListener(_0xc6c9('0x6')+_0x30db53,_0x422195);PluginEvents['on'](_0x30db53,_0x15cf6e);}}; \ No newline at end of file +var _0x7257=['register','length','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x1b3048,_0x45a9b6){var _0x5d0231=function(_0x584f46){while(--_0x584f46){_0x1b3048['push'](_0x1b3048['shift']());}};_0x5d0231(++_0x45a9b6);}(_0x7257,0x7b));var _0x7725=function(_0x163d42,_0x3cabea){_0x163d42=_0x163d42-0x0;var _0x59186c=_0x7257[_0x163d42];return _0x59186c;};'use strict';var PluginEvents=require(_0x7725('0x0'));var events=[_0x7725('0x1'),_0x7725('0x2'),_0x7725('0x3')];function createListener(_0x3b0871,_0x3d34ff){return function(_0x3aba37){_0x3d34ff[_0x7725('0x4')](_0x3b0871,_0x3aba37);};}function removeListener(_0x20e8a5,_0x337e76){return function(){PluginEvents['removeListener'](_0x20e8a5,_0x337e76);};}exports[_0x7725('0x5')]=function(_0x190618){for(var _0x67dd44=0x0,_0x2e2ded=events[_0x7725('0x6')];_0x67dd44<_0x2e2ded;_0x67dd44++){var _0xf3e5f3=events[_0x67dd44];var _0x4666b8=createListener(_0x7725('0x7')+_0xf3e5f3,_0x190618);PluginEvents['on'](_0xf3e5f3,_0x4666b8);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index f06371a..a208088 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 _0x4f1c=['post','create','/:id','update','express','Router','../../components/auth/service','./pm2.controller','isAuthenticated','index','show'];(function(_0x1f06c1,_0x399459){var _0x529c4f=function(_0x41ffa2){while(--_0x41ffa2){_0x1f06c1['push'](_0x1f06c1['shift']());}};_0x529c4f(++_0x399459);}(_0x4f1c,0x1dd));var _0xc4f1=function(_0x45c990,_0x5b4548){_0x45c990=_0x45c990-0x0;var _0x258676=_0x4f1c[_0x45c990];return _0x258676;};'use strict';var express=require(_0xc4f1('0x0'));var router=express[_0xc4f1('0x1')]();var auth=require(_0xc4f1('0x2'));var controller=require(_0xc4f1('0x3'));router['get']('/',auth[_0xc4f1('0x4')](),controller[_0xc4f1('0x5')]);router['get']('/:id',auth[_0xc4f1('0x4')](),controller[_0xc4f1('0x6')]);router[_0xc4f1('0x7')]('/',auth['isAuthenticated'](),controller[_0xc4f1('0x8')]);router['put'](_0xc4f1('0x9'),auth['isAuthenticated'](),controller[_0xc4f1('0xa')]);router['delete']('/:id',auth[_0xc4f1('0x4')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5051=['Router','../../components/auth/service','./pm2.controller','get','isAuthenticated','/:id','show','post','update','delete','destroy','express'];(function(_0x542d80,_0x150561){var _0x1f4492=function(_0x542215){while(--_0x542215){_0x542d80['push'](_0x542d80['shift']());}};_0x1f4492(++_0x150561);}(_0x5051,0x14f));var _0x1505=function(_0x22071f,_0x1eae09){_0x22071f=_0x22071f-0x0;var _0x52ae30=_0x5051[_0x22071f];return _0x52ae30;};'use strict';var express=require(_0x1505('0x0'));var router=express[_0x1505('0x1')]();var auth=require(_0x1505('0x2'));var controller=require(_0x1505('0x3'));router[_0x1505('0x4')]('/',auth[_0x1505('0x5')](),controller['index']);router[_0x1505('0x4')](_0x1505('0x6'),auth[_0x1505('0x5')](),controller[_0x1505('0x7')]);router[_0x1505('0x8')]('/',auth[_0x1505('0x5')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1505('0x9')]);router[_0x1505('0xa')]('/:id',auth[_0x1505('0x5')](),controller[_0x1505('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 07cb63c..fd96c49 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 _0xe801=['reject','express','motion2','describe','params','catch','create','body','script','../../files/plugins','cwd','chdir','dirname','dump','send','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','destroy','delete','Unknown\x20id','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','name','npm\x20install','info','error','list','then'];(function(_0x3eb017,_0x145f85){var _0x54f041=function(_0x1a65bf){while(--_0x1a65bf){_0x3eb017['push'](_0x3eb017['shift']());}};_0x54f041(++_0x145f85);}(_0xe801,0x13e));var _0x1e80=function(_0x526188,_0x1c04ee){_0x526188=_0x526188-0x0;var _0x3e8b71=_0xe801[_0x526188];return _0x3e8b71;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x1e80('0x0'))(_0x1e80('0x1'));var path=require(_0x1e80('0x2'));var exec=require(_0x1e80('0x3'))[_0x1e80('0x4')];var BPromise=require(_0x1e80('0x5'));function handleEntityNotFound(_0x32b017,_0x48448a){return function(_0x17ee99){if(!_0x17ee99){_0x32b017[_0x1e80('0x6')](0x194);;}return _0x17ee99;};}function respondWithResult(_0x88aff2,_0x1394d3){_0x1394d3=_0x1394d3||0xc8;return function(_0xc37c35){if(_0xc37c35){return _0x88aff2[_0x1e80('0x7')](_0x1394d3)[_0x1e80('0x8')](_0xc37c35);}return null;};}function handleError(_0x12e804,_0x24bb67){_0x24bb67=_0x24bb67||0x1f4;return function(_0x4a075e){logger['error'](_0x4a075e['stack']);if(_0x4a075e[_0x1e80('0x9')]){delete _0x4a075e[_0x1e80('0x9')];}_0x12e804[_0x1e80('0x7')](_0x24bb67)['send'](_0x4a075e);};}function execChildProcess(){return new BPromise(function(_0x213b12,_0x4724d6){exec(_0x1e80('0xa'),function(_0x3be6a2,_0x3e7fd1,_0x254294){logger[_0x1e80('0xb')](_0x3e7fd1);logger[_0x1e80('0xb')](_0x254294);if(_0x3be6a2){logger[_0x1e80('0xc')](_0x3be6a2);return _0x4724d6(_0x3be6a2);}return _0x213b12(_0x3e7fd1);});});}exports['index']=function(_0x28108c,_0x1e09bc){return pm2[_0x1e80('0xd')]()[_0x1e80('0xe')](function(_0x24e6ab){if(_0x24e6ab){var _0x24c191=_[_0x1e80('0xf')](_0x24e6ab,function(_0x379a8b){return _0x379a8b[_0x1e80('0x9')]===_0x1e80('0x10')||_0x379a8b[_0x1e80('0x9')]===_0x1e80('0x11');});return{'rows':_0x24c191,'count':_0x24c191['length']};}return null;})['then'](respondWithResult(_0x1e09bc,null))['catch'](handleError(_0x1e09bc,null));};exports['show']=function(_0x190e6f,_0x137be0){return pm2[_0x1e80('0x12')](_0x190e6f[_0x1e80('0x13')]['id'])[_0x1e80('0xe')](respondWithResult(_0x137be0,null))[_0x1e80('0xe')](handleEntityNotFound(_0x137be0,null))[_0x1e80('0x14')](handleError(_0x137be0,null));};exports[_0x1e80('0x15')]=function(_0x4ec90e,_0x437b0f){if(_0x4ec90e[_0x1e80('0x16')][_0x1e80('0x9')]&&_0x4ec90e[_0x1e80('0x16')][_0x1e80('0x17')]){var _0x13cd7f=path['join'](__dirname,_0x1e80('0x18'),_0x4ec90e[_0x1e80('0x16')][_0x1e80('0x17')]);var _0x572d90=process[_0x1e80('0x19')]();process[_0x1e80('0x1a')](path[_0x1e80('0x1b')](_0x13cd7f));return execChildProcess()['then'](function(_0x12770f){process['chdir'](_0x572d90);return pm2['start']({'name':_0x4ec90e[_0x1e80('0x16')][_0x1e80('0x9')],'script':_0x13cd7f});})[_0x1e80('0xe')](function(_0x20db10){pm2[_0x1e80('0x1c')]();return _0x20db10[0x0];})[_0x1e80('0xe')](respondWithResult(_0x437b0f,0xc9))[_0x1e80('0x14')](handleError(_0x437b0f,null));}else{return _0x437b0f[_0x1e80('0x7')](0x1f4)[_0x1e80('0x1d')]({'message':_0x1e80('0x1e')});}};exports['update']=function(_0x32b63a,_0x119df0){if(_0x32b63a[_0x1e80('0x16')]['id']){delete _0x32b63a[_0x1e80('0x16')]['id'];}var _0x5657a9={'online':_0x1e80('0x1f'),'stopped':_0x1e80('0x20')};if(_0x5657a9[_0x1e80('0x21')](_0x32b63a['body']['status'])){return pm2[_0x5657a9[_0x32b63a[_0x1e80('0x16')][_0x1e80('0x7')]]](_0x32b63a[_0x1e80('0x13')]['id'])[_0x1e80('0xe')](respondWithResult(_0x119df0,0xc8))[_0x1e80('0x14')](handleError(_0x119df0,null));}else{return _0x119df0['status'](0x1f4)['send']({'message':'Unknown\x20status'});}};exports[_0x1e80('0x22')]=function(_0x449dc8,_0x268cc1){if(_0x449dc8['body']['id']){delete _0x449dc8[_0x1e80('0x16')]['id'];}if(_0x449dc8[_0x1e80('0x13')]['id']){return pm2[_0x1e80('0x23')](_0x449dc8[_0x1e80('0x13')]['id'])[_0x1e80('0xe')](function(_0x42cf54){pm2[_0x1e80('0x1c')]();return _0x42cf54[0x0];})['then'](respondWithResult(_0x268cc1,null))[_0x1e80('0x14')](handleError(_0x268cc1,null));}else{return _0x268cc1['status'](0x1f4)[_0x1e80('0x1d')]({'message':_0x1e80('0x24')});}}; \ No newline at end of file +var _0xe1e1=['name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','catch','show','params','create','body','script','join','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','exec','bluebird','sendStatus','status','json','error'];(function(_0x558e0c,_0x5e5a4c){var _0x5b9897=function(_0x351fa0){while(--_0x351fa0){_0x558e0c['push'](_0x558e0c['shift']());}};_0x5b9897(++_0x5e5a4c);}(_0xe1e1,0x122));var _0x1e1e=function(_0x5847d2,_0xc7c579){_0x5847d2=_0x5847d2-0x0;var _0x34a264=_0xe1e1[_0x5847d2];return _0x34a264;};'use strict';var _=require(_0x1e1e('0x0'));var pm2=require(_0x1e1e('0x1'));var logger=require(_0x1e1e('0x2'))(_0x1e1e('0x3'));var path=require(_0x1e1e('0x4'));var exec=require('child_process')[_0x1e1e('0x5')];var BPromise=require(_0x1e1e('0x6'));function handleEntityNotFound(_0x27718d,_0x361d4e){return function(_0x2e0015){if(!_0x2e0015){_0x27718d[_0x1e1e('0x7')](0x194);;}return _0x2e0015;};}function respondWithResult(_0x304e08,_0x1c2447){_0x1c2447=_0x1c2447||0xc8;return function(_0x5c33dc){if(_0x5c33dc){return _0x304e08[_0x1e1e('0x8')](_0x1c2447)[_0x1e1e('0x9')](_0x5c33dc);}return null;};}function handleError(_0x513b8d,_0x155eeb){_0x155eeb=_0x155eeb||0x1f4;return function(_0x10cf9a){logger[_0x1e1e('0xa')](_0x10cf9a['stack']);if(_0x10cf9a[_0x1e1e('0xb')]){delete _0x10cf9a['name'];}_0x513b8d[_0x1e1e('0x8')](_0x155eeb)[_0x1e1e('0xc')](_0x10cf9a);};}function execChildProcess(){return new BPromise(function(_0x426b93,_0x52e0a3){exec(_0x1e1e('0xd'),function(_0x2b6121,_0x64d0e2,_0x5966d5){logger[_0x1e1e('0xe')](_0x64d0e2);logger[_0x1e1e('0xe')](_0x5966d5);if(_0x2b6121){logger[_0x1e1e('0xa')](_0x2b6121);return _0x52e0a3(_0x2b6121);}return _0x426b93(_0x64d0e2);});});}exports[_0x1e1e('0xf')]=function(_0x2842b,_0x3897d4){return pm2[_0x1e1e('0x10')]()[_0x1e1e('0x11')](function(_0x5e31c1){if(_0x5e31c1){var _0x3531d6=_[_0x1e1e('0x12')](_0x5e31c1,function(_0x27dad6){return _0x27dad6['name']===_0x1e1e('0x13')||_0x27dad6[_0x1e1e('0xb')]===_0x1e1e('0x14');});return{'rows':_0x3531d6,'count':_0x3531d6[_0x1e1e('0x15')]};}return null;})[_0x1e1e('0x11')](respondWithResult(_0x3897d4,null))[_0x1e1e('0x16')](handleError(_0x3897d4,null));};exports[_0x1e1e('0x17')]=function(_0x21336d,_0xf2dec4){return pm2['describe'](_0x21336d[_0x1e1e('0x18')]['id'])[_0x1e1e('0x11')](respondWithResult(_0xf2dec4,null))[_0x1e1e('0x11')](handleEntityNotFound(_0xf2dec4,null))[_0x1e1e('0x16')](handleError(_0xf2dec4,null));};exports[_0x1e1e('0x19')]=function(_0x5433ac,_0x3ec69c){if(_0x5433ac['body']['name']&&_0x5433ac[_0x1e1e('0x1a')][_0x1e1e('0x1b')]){var _0x1711de=path[_0x1e1e('0x1c')](__dirname,'../../files/plugins',_0x5433ac[_0x1e1e('0x1a')][_0x1e1e('0x1b')]);var _0x224ed0=process[_0x1e1e('0x1d')]();process[_0x1e1e('0x1e')](path[_0x1e1e('0x1f')](_0x1711de));return execChildProcess()[_0x1e1e('0x11')](function(_0x515f08){process[_0x1e1e('0x1e')](_0x224ed0);return pm2[_0x1e1e('0x20')]({'name':_0x5433ac[_0x1e1e('0x1a')][_0x1e1e('0xb')],'script':_0x1711de});})[_0x1e1e('0x11')](function(_0x2a1bb1){pm2[_0x1e1e('0x21')]();return _0x2a1bb1[0x0];})[_0x1e1e('0x11')](respondWithResult(_0x3ec69c,0xc9))[_0x1e1e('0x16')](handleError(_0x3ec69c,null));}else{return _0x3ec69c[_0x1e1e('0x8')](0x1f4)[_0x1e1e('0xc')]({'message':_0x1e1e('0x22')});}};exports[_0x1e1e('0x23')]=function(_0x5bd477,_0x570e32){if(_0x5bd477[_0x1e1e('0x1a')]['id']){delete _0x5bd477[_0x1e1e('0x1a')]['id'];}var _0x4c58a9={'online':_0x1e1e('0x24'),'stopped':_0x1e1e('0x25')};if(_0x4c58a9[_0x1e1e('0x26')](_0x5bd477[_0x1e1e('0x1a')]['status'])){return pm2[_0x4c58a9[_0x5bd477[_0x1e1e('0x1a')]['status']]](_0x5bd477[_0x1e1e('0x18')]['id'])[_0x1e1e('0x11')](respondWithResult(_0x570e32,0xc8))[_0x1e1e('0x16')](handleError(_0x570e32,null));}else{return _0x570e32[_0x1e1e('0x8')](0x1f4)[_0x1e1e('0xc')]({'message':_0x1e1e('0x27')});}};exports[_0x1e1e('0x28')]=function(_0x1a315d,_0x5c0fb4){if(_0x1a315d[_0x1e1e('0x1a')]['id']){delete _0x1a315d[_0x1e1e('0x1a')]['id'];}if(_0x1a315d[_0x1e1e('0x18')]['id']){return pm2[_0x1e1e('0x29')](_0x1a315d[_0x1e1e('0x18')]['id'])['then'](function(_0x4c207d){pm2[_0x1e1e('0x21')]();return _0x4c207d[0x0];})['then'](respondWithResult(_0x5c0fb4,null))[_0x1e1e('0x16')](handleError(_0x5c0fb4,null));}else{return _0x5c0fb4['status'](0x1f4)[_0x1e1e('0xc')]({'message':_0x1e1e('0x2a')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 6f2f609..e8d305f 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 _0xeae4=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express'];(function(_0x5a7d93,_0x17504b){var _0x3b6c54=function(_0x3e23df){while(--_0x3e23df){_0x5a7d93['push'](_0x5a7d93['shift']());}};_0x3b6c54(++_0x17504b);}(_0xeae4,0x1c6));var _0x4eae=function(_0x23ed98,_0x12d174){_0x23ed98=_0x23ed98-0x0;var _0x466670=_0xeae4[_0x23ed98];return _0x466670;};'use strict';var multer=require(_0x4eae('0x0'));var util=require(_0x4eae('0x1'));var path=require(_0x4eae('0x2'));var timeout=require(_0x4eae('0x3'));var express=require(_0x4eae('0x4'));var router=express['Router']();var auth=require(_0x4eae('0x5'));var interaction=require(_0x4eae('0x6'));var config=require(_0x4eae('0x7'));module[_0x4eae('0x8')]=router; \ No newline at end of file +var _0x3d8a=['Router','../../components/auth/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x3d8a,0x16c));var _0xa3d8=function(_0x3c48fc,_0x594c84){_0x3c48fc=_0x3c48fc-0x0;var _0x5bfeb4=_0x3d8a[_0x3c48fc];return _0x5bfeb4;};'use strict';var multer=require(_0xa3d8('0x0'));var util=require(_0xa3d8('0x1'));var path=require(_0xa3d8('0x2'));var timeout=require(_0xa3d8('0x3'));var express=require('express');var router=express[_0xa3d8('0x4')]();var auth=require(_0xa3d8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa3d8('0x6'));module[_0xa3d8('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 25cbddf..a118b8e 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 _0x52ee=['STRING','DATE','exports','INTEGER'];(function(_0x1f962a,_0x441dd5){var _0x487814=function(_0x488f96){while(--_0x488f96){_0x1f962a['push'](_0x1f962a['shift']());}};_0x487814(++_0x441dd5);}(_0x52ee,0x1f2));var _0xe52e=function(_0x4cd4e4,_0x1857a2){_0x4cd4e4=_0x4cd4e4-0x0;var _0x18cf3b=_0x52ee[_0x4cd4e4];return _0x18cf3b;};'use strict';var Sequelize=require('sequelize');module[_0xe52e('0x0')]={'state':{'type':Sequelize[_0xe52e('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xe52e('0x2')]},'scheduledat':{'type':Sequelize[_0xe52e('0x3')]},'uniqueid':{'type':Sequelize[_0xe52e('0x2')]},'starttime':{'type':Sequelize[_0xe52e('0x3')]},'responsetime':{'type':Sequelize[_0xe52e('0x3')]},'ringtime':{'type':Sequelize[_0xe52e('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe52e('0x2')]},'membername':{'type':Sequelize[_0xe52e('0x2')]}}; \ No newline at end of file +var _0xf7af=['INTEGER','sequelize','STRING','DATE'];(function(_0x59da31,_0x402952){var _0x543803=function(_0x2fe1db){while(--_0x2fe1db){_0x59da31['push'](_0x59da31['shift']());}};_0x543803(++_0x402952);}(_0xf7af,0x7d));var _0xff7a=function(_0x23eff4,_0x472902){_0x23eff4=_0x23eff4-0x0;var _0x2269bc=_0xf7af[_0x23eff4];return _0x2269bc;};'use strict';var Sequelize=require(_0xff7a('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0xff7a('0x1')]},'starttime':{'type':Sequelize[_0xff7a('0x2')]},'responsetime':{'type':Sequelize[_0xff7a('0x2')]},'ringtime':{'type':Sequelize[_0xff7a('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xff7a('0x1')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index ed3c6ca..c1f3d0c 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 _0x1602=['./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x1602,0x101));var _0x2160=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1602[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x2160('0x0'));var util=require('util');var logger=require(_0x2160('0x1'))(_0x2160('0x2'));var moment=require('moment');var BPromise=require(_0x2160('0x3'));var rp=require(_0x2160('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2160('0x5'));var config=require(_0x2160('0x6'));var attributes=require(_0x2160('0x7'));module[_0x2160('0x8')]=function(_0x5af3e4,_0x1848a9){return _0x5af3e4['define'](_0x2160('0x9'),attributes,{'tableName':_0x2160('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa64d=['ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x13c8cf,_0x3bbe9a){var _0xa4c30e=function(_0x4886ae){while(--_0x4886ae){_0x13c8cf['push'](_0x13c8cf['shift']());}};_0xa4c30e(++_0x3bbe9a);}(_0xa64d,0x13a));var _0xda64=function(_0x460ce1,_0x4f8666){_0x460ce1=_0x460ce1-0x0;var _0x590b95=_0xa64d[_0x460ce1];return _0x590b95;};'use strict';var _=require(_0xda64('0x0'));var util=require(_0xda64('0x1'));var logger=require(_0xda64('0x2'))(_0xda64('0x3'));var moment=require(_0xda64('0x4'));var BPromise=require(_0xda64('0x5'));var rp=require(_0xda64('0x6'));var fs=require('fs');var path=require(_0xda64('0x7'));var rimraf=require('rimraf');var config=require(_0xda64('0x8'));var attributes=require('./reportAgentPreview.attributes');module[_0xda64('0x9')]=function(_0x49980d,_0x5eaefc){return _0x49980d[_0xda64('0xa')](_0xda64('0xb'),attributes,{'tableName':_0xda64('0xc'),'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 f1c32b5..7a118fd 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 _0x3d78=['../../config/environment','client','http','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateReportAgentPreview','create','body','options','then','stringify','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x491118,_0x3a3622){var _0x58e388=function(_0x57486a){while(--_0x57486a){_0x491118['push'](_0x491118['shift']());}};_0x58e388(++_0x3a3622);}(_0x3d78,0x19c));var _0x83d7=function(_0x203eaf,_0x5a06d4){_0x203eaf=_0x203eaf-0x0;var _0x23c782=_0x3d78[_0x203eaf];return _0x23c782;};'use strict';var _=require('lodash');var util=require(_0x83d7('0x0'));var moment=require('moment');var BPromise=require(_0x83d7('0x1'));var rs=require(_0x83d7('0x2'));var fs=require('fs');var Redis=require(_0x83d7('0x3'));var db=require(_0x83d7('0x4'))['db'];var utils=require(_0x83d7('0x5'));var logger=require(_0x83d7('0x6'))(_0x83d7('0x7'));var config=require(_0x83d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x83d7('0x9')][_0x83d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26838e,_0x3e49ac,_0x41b681){return new BPromise(function(_0x302012,_0x5ce2e0){return client[_0x83d7('0xb')](_0x26838e,_0x41b681)['then'](function(_0x1c49cc){logger[_0x83d7('0xc')](_0x83d7('0xd'),_0x3e49ac,_0x83d7('0xe'));logger[_0x83d7('0xf')](_0x83d7('0x10'),_0x3e49ac,_0x83d7('0xe'),JSON['stringify'](_0x1c49cc));if(_0x1c49cc[_0x83d7('0x11')]){if(_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x12')]===0x1f4){logger['error'](_0x83d7('0xd'),_0x3e49ac,_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x13')]);return _0x5ce2e0(_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x13')]);}logger[_0x83d7('0x11')](_0x83d7('0xd'),_0x3e49ac,_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x13')]);return _0x302012(_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x13')]);}else{logger[_0x83d7('0xc')](_0x83d7('0xd'),_0x3e49ac,_0x83d7('0xe'));_0x302012(_0x1c49cc[_0x83d7('0x14')][_0x83d7('0x13')]);}})['catch'](function(_0x4152f3){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x3e49ac,_0x4152f3);_0x5ce2e0(_0x4152f3);});});}exports[_0x83d7('0x15')]=function(_0x2b2b92){var _0x573b4c=this;return new Promise(function(_0x15b6e1,_0x5e415a){return db['ReportAgentPreview'][_0x83d7('0x16')](_0x2b2b92[_0x83d7('0x17')],{'raw':_0x2b2b92[_0x83d7('0x18')]?_0x2b2b92[_0x83d7('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x83d7('0x19')](function(_0x5b35b2){logger['info'](_0x83d7('0x15'),_0x2b2b92);logger[_0x83d7('0xf')]('CreateReportAgentPreview',_0x2b2b92,JSON[_0x83d7('0x1a')](_0x5b35b2));_0x15b6e1(_0x5b35b2);})[_0x83d7('0x1b')](function(_0x3ba37f){logger[_0x83d7('0x11')](_0x83d7('0x15'),_0x3ba37f['message'],_0x2b2b92);_0x5e415a(_0x573b4c[_0x83d7('0x11')](0x1f4,_0x3ba37f[_0x83d7('0x13')]));});});}; \ No newline at end of file +var _0x771a=['then','info','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','CreateReportAgentPreview','body','options','raw','stringify','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client'];(function(_0x4c15be,_0x2561f7){var _0x450c10=function(_0x575f2a){while(--_0x575f2a){_0x4c15be['push'](_0x4c15be['shift']());}};_0x450c10(++_0x2561f7);}(_0x771a,0xb1));var _0xa771=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x771a[_0x1573ea];return _0x51c0e2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa771('0x0'));var BPromise=require(_0xa771('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa771('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xa771('0x3'));var logger=require('../../config/logger')(_0xa771('0x4'));var config=require('../../config/environment');var jayson=require(_0xa771('0x5'));var client=jayson[_0xa771('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e3c73,_0xa5532d,_0x28231f){return new BPromise(function(_0x40900f,_0x45760d){return client['request'](_0x3e3c73,_0x28231f)[_0xa771('0x7')](function(_0x45581a){logger[_0xa771('0x8')]('ReportAgentPreview,\x20%s,\x20%s',_0xa5532d,'request\x20sent');logger[_0xa771('0x9')](_0xa771('0xa'),_0xa5532d,_0xa771('0xb'),JSON['stringify'](_0x45581a));if(_0x45581a['error']){if(_0x45581a[_0xa771('0xc')][_0xa771('0xd')]===0x1f4){logger[_0xa771('0xc')](_0xa771('0xe'),_0xa5532d,_0x45581a[_0xa771('0xc')][_0xa771('0xf')]);return _0x45760d(_0x45581a['error'][_0xa771('0xf')]);}logger[_0xa771('0xc')](_0xa771('0xe'),_0xa5532d,_0x45581a[_0xa771('0xc')][_0xa771('0xf')]);return _0x40900f(_0x45581a[_0xa771('0xc')]['message']);}else{logger[_0xa771('0x8')](_0xa771('0xe'),_0xa5532d,'request\x20sent');_0x40900f(_0x45581a[_0xa771('0x10')][_0xa771('0xf')]);}})[_0xa771('0x11')](function(_0x2db46a){logger[_0xa771('0xc')](_0xa771('0xe'),_0xa5532d,_0x2db46a);_0x45760d(_0x2db46a);});});}exports[_0xa771('0x12')]=function(_0x309b31){var _0x5b8c3a=this;return new Promise(function(_0x172680,_0x1ae5c4){return db['ReportAgentPreview']['create'](_0x309b31[_0xa771('0x13')],{'raw':_0x309b31[_0xa771('0x14')]?_0x309b31[_0xa771('0x14')][_0xa771('0x15')]===undefined?!![]:![]:!![]})[_0xa771('0x7')](function(_0x4c42f2){logger[_0xa771('0x8')](_0xa771('0x12'),_0x309b31);logger[_0xa771('0x9')]('CreateReportAgentPreview',_0x309b31,JSON[_0xa771('0x16')](_0x4c42f2));_0x172680(_0x4c42f2);})[_0xa771('0x11')](function(_0x40ee82){logger[_0xa771('0xc')]('CreateReportAgentPreview',_0x40ee82['message'],_0x309b31);_0x1ae5c4(_0x5b8c3a[_0xa771('0xc')](0x1f4,_0x40ee82[_0xa771('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 1f49c7d..f1fa648 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 _0x15c1=['voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','/outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','whatsapp','/sms/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','path','express','Router','../../components/auth/service','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor'];(function(_0x3174dd,_0x3bb507){var _0x4f146c=function(_0x4fac84){while(--_0x4fac84){_0x3174dd['push'](_0x3174dd['shift']());}};_0x4f146c(++_0x3bb507);}(_0x15c1,0x1b8));var _0x115c=function(_0x28dbc1,_0xd95070){_0x28dbc1=_0x28dbc1-0x0;var _0x11c187=_0x15c1[_0x28dbc1];return _0x11c187;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x115c('0x0'));var express=require(_0x115c('0x1'));var router=express[_0x115c('0x2')]();var auth=require(_0x115c('0x3'));var controller=require('./rpc.controller');router['get']('/voice/channels',auth[_0x115c('0x4')](),controller[_0x115c('0x5')]);router['get'](_0x115c('0x6'),auth[_0x115c('0x4')](),controller[_0x115c('0x7')]);router[_0x115c('0x8')](_0x115c('0x9'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x115c('0x8')]('/voice/queues',auth['isAuthenticated'](),controller[_0x115c('0xa')]);router['get'](_0x115c('0xb'),auth[_0x115c('0x4')](),controller[_0x115c('0xc')]);router[_0x115c('0x8')](_0x115c('0xd'),auth[_0x115c('0x4')](),controller[_0x115c('0xe')]);router['get'](_0x115c('0xf'),auth['isAuthenticated'](),controller[_0x115c('0x10')]);router[_0x115c('0x8')](_0x115c('0x11'),auth[_0x115c('0x4')](),controller[_0x115c('0x12')]);router['get']('/sms/queues',auth['isAuthenticated'](),controller[_0x115c('0x13')]);router[_0x115c('0x8')](_0x115c('0x14'),auth[_0x115c('0x4')](),controller['whatsappQueues']);router['get'](_0x115c('0x15'),auth[_0x115c('0x4')](),controller[_0x115c('0x16')]);router[_0x115c('0x8')](_0x115c('0x17'),auth[_0x115c('0x4')](),controller[_0x115c('0x18')]);router[_0x115c('0x8')](_0x115c('0x19'),auth[_0x115c('0x4')](),controller[_0x115c('0x1a')]);router[_0x115c('0x8')](_0x115c('0x1b'),auth[_0x115c('0x4')](),controller['voiceQueuesChannel']);router[_0x115c('0x8')](_0x115c('0x1c'),auth[_0x115c('0x4')](),controller[_0x115c('0x1d')]);router['get'](_0x115c('0x1e'),auth[_0x115c('0x4')](),controller['voiceQueuesChannelRedirect']);router[_0x115c('0x8')](_0x115c('0x1f'),auth[_0x115c('0x4')](),controller[_0x115c('0x20')]);router[_0x115c('0x8')](_0x115c('0x21'),auth[_0x115c('0x4')](),controller['outbound']);router[_0x115c('0x8')](_0x115c('0x22'),auth[_0x115c('0x4')](),controller[_0x115c('0x23')]);router[_0x115c('0x8')]('/agents',auth['isAuthenticated'](),controller[_0x115c('0x24')]);router['put'](_0x115c('0x25'),auth[_0x115c('0x4')](),controller[_0x115c('0x26')]);router[_0x115c('0x8')](_0x115c('0x27'),auth[_0x115c('0x4')](),controller['telephones']);router[_0x115c('0x8')](_0x115c('0x28'),auth[_0x115c('0x4')](),controller[_0x115c('0x29')]);router[_0x115c('0x8')]('/campaigns',auth[_0x115c('0x4')](),controller[_0x115c('0x2a')]);router[_0x115c('0x8')](_0x115c('0x2b'),auth[_0x115c('0x4')](),controller[_0x115c('0x2c')]);router['get'](_0x115c('0x2d'),auth['isAuthenticated'](),controller[_0x115c('0x2e')]);router[_0x115c('0x8')](_0x115c('0x2f'),auth[_0x115c('0x4')](),controller[_0x115c('0x30')]);router['get'](_0x115c('0x31'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0x115c('0x8')](_0x115c('0x32'),auth[_0x115c('0x4')](),controller[_0x115c('0x33')]);router[_0x115c('0x8')](_0x115c('0x34'),auth[_0x115c('0x4')](),controller[_0x115c('0x35')]);router[_0x115c('0x8')](_0x115c('0x36'),auth[_0x115c('0x4')](),controller['faxQueuesWaitingInteractions']);router[_0x115c('0x37')]('/mail/queues/:id/notify',auth[_0x115c('0x4')](),controller['queueNotify']('mail'));router['get'](_0x115c('0x38'),auth['isAuthenticated'](),controller[_0x115c('0x39')]);router[_0x115c('0x37')](_0x115c('0x3a'),auth['isAuthenticated'](),controller[_0x115c('0x3b')]('chat'));router[_0x115c('0x8')](_0x115c('0x3c'),auth[_0x115c('0x4')](),controller[_0x115c('0x3d')]);router[_0x115c('0x37')](_0x115c('0x3e'),auth[_0x115c('0x4')](),controller[_0x115c('0x3b')]('fax'));router[_0x115c('0x8')]('/fax/queues/:id',auth[_0x115c('0x4')](),controller[_0x115c('0x3f')]);router[_0x115c('0x37')](_0x115c('0x40'),auth[_0x115c('0x4')](),controller[_0x115c('0x3b')](_0x115c('0x41')));router['get'](_0x115c('0x42'),auth[_0x115c('0x4')](),controller[_0x115c('0x43')]);router[_0x115c('0x37')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x115c('0x3b')](_0x115c('0x44')));router['post']('/whatsapp/queues/:id/notify',auth['isAuthenticated'](),controller[_0x115c('0x3b')](_0x115c('0x45')));router[_0x115c('0x8')](_0x115c('0x46'),auth[_0x115c('0x4')](),controller['showSmsQueues']);router['get']('/whatsapp/queues/:id',auth['isAuthenticated'](),controller[_0x115c('0x47')]);router[_0x115c('0x37')](_0x115c('0x48'),auth[_0x115c('0x4')](),controller[_0x115c('0x49')]);module[_0x115c('0x4a')]=router; \ No newline at end of file +var _0x7330=['voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','showVoiceQueues','/outbound/channels','agents','put','telephones','trunks','/campaigns','/fax/accounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','/mail/queues/:id/notify','mail','/mail/queues/:id','post','queueNotify','showChatQueues','/fax/queues/:id/notify','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','util','path','express','Router','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesChannels'];(function(_0x449d4b,_0x2025a0){var _0xa4f7ef=function(_0x47f7cc){while(--_0x47f7cc){_0x449d4b['push'](_0x449d4b['shift']());}};_0xa4f7ef(++_0x2025a0);}(_0x7330,0xe9));var _0x0733=function(_0x10ef0b,_0x3b98a3){_0x10ef0b=_0x10ef0b-0x0;var _0x2df559=_0x7330[_0x10ef0b];return _0x2df559;};'use strict';var multer=require('multer');var util=require(_0x0733('0x0'));var path=require(_0x0733('0x1'));var express=require(_0x0733('0x2'));var router=express[_0x0733('0x3')]();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x0733('0x4')](_0x0733('0x5'),auth[_0x0733('0x6')](),controller['voiceChannels']);router[_0x0733('0x4')](_0x0733('0x7'),auth[_0x0733('0x6')](),controller[_0x0733('0x8')]);router['get'](_0x0733('0x9'),auth[_0x0733('0x6')](),controller[_0x0733('0xa')]);router['get'](_0x0733('0xb'),auth[_0x0733('0x6')](),controller[_0x0733('0xc')]);router['get'](_0x0733('0xd'),auth[_0x0733('0x6')](),controller[_0x0733('0xe')]);router[_0x0733('0x4')](_0x0733('0xf'),auth[_0x0733('0x6')](),controller['mailQueues']);router[_0x0733('0x4')]('/mail/accounts',auth[_0x0733('0x6')](),controller[_0x0733('0x10')]);router['get'](_0x0733('0x11'),auth[_0x0733('0x6')](),controller[_0x0733('0x12')]);router['get']('/sms/queues',auth[_0x0733('0x6')](),controller[_0x0733('0x13')]);router[_0x0733('0x4')]('/whatsapp/queues',auth['isAuthenticated'](),controller['whatsappQueues']);router[_0x0733('0x4')](_0x0733('0x14'),auth[_0x0733('0x6')](),controller['faxQueues']);router['get'](_0x0733('0x15'),auth[_0x0733('0x6')](),controller['voiceQueuesPreview']);router[_0x0733('0x4')]('/voice/queues/channels',auth[_0x0733('0x6')](),controller[_0x0733('0x16')]);router[_0x0733('0x4')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x0733('0x17')]);router['get']('/voice/queues/channels/:uniqueid/hangup',auth[_0x0733('0x6')](),controller[_0x0733('0x18')]);router[_0x0733('0x4')](_0x0733('0x19'),auth[_0x0733('0x6')](),controller['voiceQueuesChannelRedirect']);router['get']('/voice/queues/:id',auth[_0x0733('0x6')](),controller[_0x0733('0x1a')]);router['get']('/outbound',auth['isAuthenticated'](),controller['outbound']);router[_0x0733('0x4')](_0x0733('0x1b'),auth[_0x0733('0x6')](),controller['outboundChannels']);router[_0x0733('0x4')]('/agents',auth['isAuthenticated'](),controller[_0x0733('0x1c')]);router[_0x0733('0x1d')]('/agents/:id/capacity',auth[_0x0733('0x6')](),controller['agentCapacity']);router[_0x0733('0x4')]('/telephones',auth[_0x0733('0x6')](),controller[_0x0733('0x1e')]);router['get']('/trunks',auth['isAuthenticated'](),controller[_0x0733('0x1f')]);router[_0x0733('0x4')](_0x0733('0x20'),auth[_0x0733('0x6')](),controller['campaigns']);router[_0x0733('0x4')](_0x0733('0x21'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x0733('0x4')]('/chat/queues/waitinginteractions',auth[_0x0733('0x6')](),controller[_0x0733('0x22')]);router[_0x0733('0x4')](_0x0733('0x23'),auth['isAuthenticated'](),controller[_0x0733('0x24')]);router[_0x0733('0x4')](_0x0733('0x25'),auth['isAuthenticated'](),controller[_0x0733('0x26')]);router[_0x0733('0x4')](_0x0733('0x27'),auth['isAuthenticated'](),controller[_0x0733('0x28')]);router[_0x0733('0x4')](_0x0733('0x29'),auth[_0x0733('0x6')](),controller[_0x0733('0x2a')]);router[_0x0733('0x4')](_0x0733('0x2b'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router['post'](_0x0733('0x2c'),auth['isAuthenticated'](),controller['queueNotify'](_0x0733('0x2d')));router[_0x0733('0x4')](_0x0733('0x2e'),auth[_0x0733('0x6')](),controller['showMailQueues']);router[_0x0733('0x2f')]('/chat/queues/:id/notify',auth[_0x0733('0x6')](),controller[_0x0733('0x30')]('chat'));router['get']('/chat/queues/:id',auth[_0x0733('0x6')](),controller[_0x0733('0x31')]);router['post'](_0x0733('0x32'),auth[_0x0733('0x6')](),controller[_0x0733('0x30')]('fax'));router['get']('/fax/queues/:id',auth[_0x0733('0x6')](),controller[_0x0733('0x33')]);router['post'](_0x0733('0x34'),auth[_0x0733('0x6')](),controller[_0x0733('0x30')]('openchannel'));router[_0x0733('0x4')](_0x0733('0x35'),auth[_0x0733('0x6')](),controller[_0x0733('0x36')]);router[_0x0733('0x2f')](_0x0733('0x37'),auth['isAuthenticated'](),controller[_0x0733('0x30')]('sms'));router['post'](_0x0733('0x38'),auth[_0x0733('0x6')](),controller['queueNotify']('whatsapp'));router[_0x0733('0x4')](_0x0733('0x39'),auth[_0x0733('0x6')](),controller[_0x0733('0x3a')]);router[_0x0733('0x4')](_0x0733('0x3b'),auth[_0x0733('0x6')](),controller[_0x0733('0x3c')]);router['post'](_0x0733('0x3d'),auth[_0x0733('0x6')](),controller[_0x0733('0x3e')]);module[_0x0733('0x3f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 9e6942a..03ab855 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 _0x0738=['lodash','../../config/logger','api','jayson/promise','client','http','then','error','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','body','interaction','user','MemberReport','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','Trunks','campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','Agent\x20not\x20found','agentTransferTimeout','bluebird','moment'];(function(_0x52ef18,_0x1dea3c){var _0x2998b2=function(_0x23d7dc){while(--_0x23d7dc){_0x52ef18['push'](_0x52ef18['shift']());}};_0x2998b2(++_0x1dea3c);}(_0x0738,0x1d2));var _0x8073=function(_0x24693e,_0x2ba888){_0x24693e=_0x24693e-0x0;var _0x53e672=_0x0738[_0x24693e];return _0x53e672;};'use strict';var BPromise=require(_0x8073('0x0'));var moment=require(_0x8073('0x1'));var _=require(_0x8073('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x8073('0x3'))(_0x8073('0x4'));var jayson=require(_0x8073('0x5'));var amiClient=jayson[_0x8073('0x6')][_0x8073('0x7')]({'port':0x232a});var mailClient=jayson[_0x8073('0x6')][_0x8073('0x7')]({'port':0x232b});var routingClient=jayson[_0x8073('0x6')][_0x8073('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x129331,_0xe6b2bf,_0x475d00){return new BPromise(function(_0x75e4c3,_0x13d5d5){var _0x5c1359=_0x475d00?_0x475d00:amiClient;return _0x5c1359['request'](_0x129331,_0xe6b2bf)[_0x8073('0x8')](function(_0x89b4df){if(_0x89b4df[_0x8073('0x9')]){if(_0x89b4df[_0x8073('0x9')]['code']===0x1f4){return _0x13d5d5(_0x89b4df[_0x8073('0x9')][_0x8073('0xa')]);}return _0x75e4c3(_0x89b4df[_0x8073('0x9')][_0x8073('0xa')]);}else{_0x75e4c3(_0x89b4df[_0x8073('0xb')]);}})[_0x8073('0xc')](function(_0x3c062a){_0x13d5d5(_0x3c062a);});});}function respondWithResult(_0x3e792,_0x3c8f0a){_0x3c8f0a=_0x3c8f0a||0xc8;return function(_0x5bde3f){if(_0x5bde3f){return _0x3e792[_0x8073('0xd')](_0x3c8f0a)[_0x8073('0xe')](_0x5bde3f);}return _0x3e792[_0x8073('0xf')](0x194);};}function handleError(_0x3859a8,_0x26d9b8){_0x26d9b8=_0x26d9b8||0x1f4;return function(_0x293351){logger[_0x8073('0x9')](_0x293351[_0x8073('0x10')]);if(_0x293351[_0x8073('0x11')]){delete _0x293351[_0x8073('0x11')];}_0x3859a8['status'](_0x26d9b8)[_0x8073('0x12')](_0x293351);};}function findById(_0x1ee280){return function(_0x3e8b1b){if(!_[_0x8073('0x13')](_0x1ee280)&&!_[_0x8073('0x13')](_0x3e8b1b)&&!_[_0x8073('0x13')](_0x3e8b1b[_0x8073('0x14')])){return _[_0x8073('0x15')](_0x3e8b1b['rows'],function(_0x16ba69){return _0x16ba69['id']==_0x1ee280;});}return null;};}exports[_0x8073('0x16')]=function(_0x5df93e,_0x35ba13){return respondWithRpcPromise(_0x8073('0x17'),_0x5df93e[_0x8073('0x18')])['then'](respondWithResult(_0x35ba13,null))['catch'](handleError(_0x35ba13,null));};exports[_0x8073('0x19')]=function(_0x49c546,_0x4a8499){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x8073('0x1a')](_0x49c546[_0x8073('0x18')],_0x49c546[_0x8073('0x1b')]))['then'](respondWithResult(_0x4a8499,null))[_0x8073('0xc')](handleError(_0x4a8499,null));};exports['voiceChannelStopMixMonitor']=function(_0x500fed,_0x4ee079){return respondWithRpcPromise(_0x8073('0x1c'),_[_0x8073('0x1a')](_0x500fed[_0x8073('0x18')],_0x500fed[_0x8073('0x1b')]))[_0x8073('0x8')](respondWithResult(_0x4ee079,null))[_0x8073('0xc')](handleError(_0x4ee079,null));};exports[_0x8073('0x1d')]=function(_0x106a11,_0xfa3790){return respondWithRpcPromise(_0x8073('0x1e'),_0x106a11['query'])[_0x8073('0x8')](respondWithResult(_0xfa3790,null))[_0x8073('0xc')](handleError(_0xfa3790,null));};exports['showVoiceQueues']=function(_0xebaaf,_0x6e3526){return respondWithRpcPromise(_0x8073('0x1e'),_0xebaaf[_0x8073('0x18')])[_0x8073('0x8')](findById(_0xebaaf[_0x8073('0x1b')]['id']))['then'](respondWithResult(_0x6e3526,null))[_0x8073('0xc')](handleError(_0x6e3526,null));};exports[_0x8073('0x1f')]=function(_0x2f1387,_0x285bce){return respondWithRpcPromise(_0x8073('0x20'),_['merge'](_0x2f1387[_0x8073('0x18')],_0x2f1387[_0x8073('0x1b')]))['then'](respondWithResult(_0x285bce,null))[_0x8073('0xc')](handleError(_0x285bce,null));};exports[_0x8073('0x21')]=function(_0x74f541,_0x241cac){return respondWithRpcPromise('VoiceQueuesChannels',_0x74f541['query'])['then'](respondWithResult(_0x241cac,null))[_0x8073('0xc')](handleError(_0x241cac,null));};exports[_0x8073('0x22')]=function(_0x45bd0c,_0x1e8767){return respondWithRpcPromise(_0x8073('0x23'),_['merge'](_0x45bd0c[_0x8073('0x18')],_0x45bd0c['params']))[_0x8073('0x8')](respondWithResult(_0x1e8767,null))[_0x8073('0xc')](handleError(_0x1e8767,null));};exports[_0x8073('0x24')]=function(_0x383a93,_0x5c8251){return respondWithRpcPromise(_0x8073('0x25'),_[_0x8073('0x1a')](_0x383a93[_0x8073('0x18')],_0x383a93[_0x8073('0x1b')]))[_0x8073('0x8')](respondWithResult(_0x5c8251,null))[_0x8073('0xc')](handleError(_0x5c8251,null));};exports[_0x8073('0x26')]=function(_0x25d11b,_0x19561c){return respondWithRpcPromise(_0x8073('0x27'),_[_0x8073('0x1a')](_0x25d11b[_0x8073('0x18')],_0x25d11b[_0x8073('0x1b')]))[_0x8073('0x8')](respondWithResult(_0x19561c,null))[_0x8073('0xc')](handleError(_0x19561c,null));};exports['outbound']=function(_0x37da73,_0x1b51ab){return respondWithRpcPromise(_0x8073('0x28'),_0x37da73['query'])[_0x8073('0x8')](respondWithResult(_0x1b51ab,null))['catch'](handleError(_0x1b51ab,null));};exports[_0x8073('0x29')]=function(_0x331236,_0x41c695){return respondWithRpcPromise(_0x8073('0x2a'),_0x331236[_0x8073('0x18')])[_0x8073('0x8')](respondWithResult(_0x41c695,null))[_0x8073('0xc')](handleError(_0x41c695,null));};exports[_0x8073('0x2b')]=function(_0x2ce326,_0x308be0){var _0xdcc3db;return respondWithRpcPromise('Agents',_0x2ce326[_0x8073('0x18')])[_0x8073('0x8')](function(_0x337dd1){_0xdcc3db=_0x337dd1;return respondWithRpcPromise(_0x8073('0x2c'),_0x2ce326[_0x8073('0x18')],routingClient);})['then'](function(_0x4c9d2e){return _[_0x8073('0x1a')]({},_0x4c9d2e,_0xdcc3db);})[_0x8073('0x8')](respondWithResult(_0x308be0,null))[_0x8073('0xc')](handleError(_0x308be0,null));};exports['agentCapacity']=function(_0x437bd1,_0x3505b1){if(_0x437bd1[_0x8073('0x2d')]&&_0x437bd1[_0x8073('0x2d')][_0x8073('0x2e')]&&_0x437bd1['user']&&_0x437bd1[_0x8073('0x2f')][_0x8073('0x11')]){for(var _0x28aea in _0x437bd1[_0x8073('0x2d')][_0x8073('0x2e')]){if(_0x437bd1[_0x8073('0x2d')][_0x8073('0x2e')]['hasOwnProperty'](_0x28aea)){db[_0x8073('0x30')]['findAll']({'where':{'channel':_0x28aea,'membername':_0x437bd1[_0x8073('0x2f')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x437bd1[_0x8073('0x2d')]['interaction'][_0x28aea]&&_0x437bd1[_0x8073('0x2d')]['interaction'][_0x28aea]['length']?{'$notIn':_0x437bd1[_0x8073('0x2d')][_0x8073('0x2e')][_0x28aea]}:{'$ne':null}}})[_0x8073('0x8')](function(_0x4ca131){var _0x1dc7a1=moment()['format'](_0x8073('0x31'));for(var _0x3aceaf=0x0,_0x90f1d5=_0x4ca131[_0x8073('0x32')];_0x3aceaf<_0x90f1d5;_0x3aceaf+=0x1){_0x4ca131[_0x3aceaf][_0x8073('0x33')]({'exitAt':_0x1dc7a1});}});for(var _0xd84f66=0x0;_0xd84f66<_0x437bd1[_0x8073('0x2d')]['interaction'][_0x28aea]['length'];_0xd84f66+=0x1){db[_0x8073('0x30')][_0x8073('0x34')]({'where':{'channel':_0x28aea,'membername':_0x437bd1[_0x8073('0x2f')][_0x8073('0x11')],'type':_0x8073('0x35'),'uniqueid':_0x437bd1[_0x8073('0x2d')][_0x8073('0x2e')][_0x28aea][_0xd84f66],'exitAt':null},'defaults':{'channel':_0x28aea,'membername':_0x437bd1[_0x8073('0x2f')][_0x8073('0x11')],'interface':_[_0x8073('0x13')](_0x437bd1[_0x8073('0x2f')][_0x8073('0x36')])?util['format'](_0x8073('0x37'),_0x437bd1[_0x8073('0x2f')][_0x8073('0x11')]):_0x437bd1[_0x8073('0x2f')][_0x8073('0x36')],'type':_0x8073('0x35'),'enterAt':moment()['format'](_0x8073('0x31')),'role':_0x8073('0x38'),'internal':_0x437bd1['user'][_0x8073('0x39')],'uniqueid':_0x437bd1['body']['interaction'][_0x28aea][_0xd84f66]}});}}}}return respondWithRpcPromise(_0x8073('0x3a'),{'id':_0x437bd1['params']['id'],'capacity':_0x437bd1[_0x8073('0x2d')][_0x8073('0x3b')]},routingClient)[_0x8073('0x8')](respondWithResult(_0x3505b1,null))[_0x8073('0xc')](handleError(_0x3505b1,null));};exports[_0x8073('0x3c')]=function(_0x34a9e1,_0x374c8f){return respondWithRpcPromise(_0x8073('0x3d'),_0x34a9e1['query'])[_0x8073('0x8')](respondWithResult(_0x374c8f,null))['catch'](handleError(_0x374c8f,null));};exports['trunks']=function(_0x2cafb1,_0x283f94){return respondWithRpcPromise(_0x8073('0x3e'),_0x2cafb1[_0x8073('0x18')])['then'](respondWithResult(_0x283f94,null))[_0x8073('0xc')](handleError(_0x283f94,null));};exports[_0x8073('0x3f')]=function(_0x2651ed,_0xf17d14){return respondWithRpcPromise('Campaigns',_0x2651ed[_0x8073('0x18')])[_0x8073('0x8')](respondWithResult(_0xf17d14,null))[_0x8073('0xc')](handleError(_0xf17d14,null));};exports[_0x8073('0x40')]=function(_0x9d2312,_0x5e1433){return respondWithRpcPromise(_0x8073('0x41'),_0x9d2312[_0x8073('0x18')],routingClient)[_0x8073('0x8')](respondWithResult(_0x5e1433,null))[_0x8073('0xc')](handleError(_0x5e1433,null));};exports[_0x8073('0x42')]=function(_0x5453df,_0x52b03d){return respondWithRpcPromise('ChatQueues',_0x5453df[_0x8073('0x18')],routingClient)[_0x8073('0x8')](findById(_0x5453df[_0x8073('0x1b')]['id']))[_0x8073('0x8')](respondWithResult(_0x52b03d,null))[_0x8073('0xc')](handleError(_0x52b03d,null));};exports['mailQueues']=function(_0x594dd5,_0x4a7c3f){return respondWithRpcPromise(_0x8073('0x43'),_0x594dd5[_0x8073('0x18')],routingClient)[_0x8073('0x8')](respondWithResult(_0x4a7c3f,null))[_0x8073('0xc')](handleError(_0x4a7c3f,null));};exports[_0x8073('0x44')]=function(_0xdc9719,_0x288a8e){return respondWithRpcPromise(_0x8073('0x43'),_0xdc9719[_0x8073('0x18')],routingClient)['then'](findById(_0xdc9719['params']['id']))['then'](respondWithResult(_0x288a8e,null))[_0x8073('0xc')](handleError(_0x288a8e,null));};exports[_0x8073('0x45')]=function(_0x24cd23,_0x5651cd){return respondWithRpcPromise(_0x8073('0x46'),_0x24cd23[_0x8073('0x18')],mailClient)['then'](respondWithResult(_0x5651cd,null))['catch'](handleError(_0x5651cd,null));};exports[_0x8073('0x47')]=function(_0x4f4de7,_0x47bff0){return respondWithRpcPromise(_0x8073('0x48'),_0x4f4de7[_0x8073('0x18')],routingClient)['then'](respondWithResult(_0x47bff0,null))['catch'](handleError(_0x47bff0,null));};exports[_0x8073('0x49')]=function(_0xa0b34e,_0x4b2b33){return respondWithRpcPromise(_0x8073('0x48'),_0xa0b34e[_0x8073('0x18')],routingClient)[_0x8073('0x8')](findById(_0xa0b34e[_0x8073('0x1b')]['id']))[_0x8073('0x8')](respondWithResult(_0x4b2b33,null))[_0x8073('0xc')](handleError(_0x4b2b33,null));};exports['smsQueues']=function(_0xa3f6e,_0xf85787){return respondWithRpcPromise(_0x8073('0x4a'),_0xa3f6e[_0x8073('0x18')],routingClient)[_0x8073('0x8')](respondWithResult(_0xf85787,null))[_0x8073('0xc')](handleError(_0xf85787,null));};exports[_0x8073('0x4b')]=function(_0x1866a3,_0x3ddd6e){return respondWithRpcPromise('SmsQueues',_0x1866a3['query'],routingClient)['then'](findById(_0x1866a3[_0x8073('0x1b')]['id']))[_0x8073('0x8')](respondWithResult(_0x3ddd6e,null))[_0x8073('0xc')](handleError(_0x3ddd6e,null));};exports['whatsappQueues']=function(_0x204f91,_0x43ebec){return respondWithRpcPromise('WhatsappQueues',_0x204f91[_0x8073('0x18')],routingClient)[_0x8073('0x8')](respondWithResult(_0x43ebec,null))[_0x8073('0xc')](handleError(_0x43ebec,null));};exports[_0x8073('0x4c')]=function(_0xd28e6c,_0x31f93e){return respondWithRpcPromise(_0x8073('0x4d'),_0xd28e6c[_0x8073('0x18')],routingClient)[_0x8073('0x8')](findById(_0xd28e6c[_0x8073('0x1b')]['id']))[_0x8073('0x8')](respondWithResult(_0x31f93e,null))[_0x8073('0xc')](handleError(_0x31f93e,null));};exports[_0x8073('0x4e')]=function(_0x335757,_0x3d1a8){return respondWithRpcPromise(_0x8073('0x4f'),_0x335757[_0x8073('0x18')],routingClient)[_0x8073('0x8')](respondWithResult(_0x3d1a8,null))[_0x8073('0xc')](handleError(_0x3d1a8,null));};exports[_0x8073('0x50')]=function(_0x1bf11f,_0x741170){return respondWithRpcPromise(_0x8073('0x4f'),_0x1bf11f[_0x8073('0x18')],routingClient)[_0x8073('0x8')](findById(_0x1bf11f['params']['id']))[_0x8073('0x8')](respondWithResult(_0x741170,null))[_0x8073('0xc')](handleError(_0x741170,null));};exports[_0x8073('0x51')]=function(_0x43dff8,_0x4b59d9){return respondWithRpcPromise(_0x8073('0x52'),_0x43dff8[_0x8073('0x18')])[_0x8073('0x8')](respondWithResult(_0x4b59d9,null))[_0x8073('0xc')](handleError(_0x4b59d9,null));};exports[_0x8073('0x53')]=function(_0x5401d6,_0x1bbe09){return respondWithRpcPromise(_0x8073('0x54'),_0x5401d6[_0x8073('0x18')],routingClient)[_0x8073('0x8')](respondWithResult(_0x1bbe09,null))[_0x8073('0xc')](handleError(_0x1bbe09,null));};exports[_0x8073('0x55')]=function(_0x4a69c7,_0x3694d6){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x4a69c7['query'],routingClient)[_0x8073('0x8')](respondWithResult(_0x3694d6,null))[_0x8073('0xc')](handleError(_0x3694d6,null));};exports[_0x8073('0x56')]=function(_0x15fac4,_0x5d04b7){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x15fac4[_0x8073('0x18')],routingClient)[_0x8073('0x8')](respondWithResult(_0x5d04b7,null))['catch'](handleError(_0x5d04b7,null));};exports[_0x8073('0x57')]=function(_0x471ea7,_0x178af6){return respondWithRpcPromise(_0x8073('0x58'),_0x471ea7[_0x8073('0x18')],routingClient)[_0x8073('0x8')](respondWithResult(_0x178af6,null))[_0x8073('0xc')](handleError(_0x178af6,null));};exports[_0x8073('0x59')]=function(_0x1e115d,_0x238288){return respondWithRpcPromise('WhatsappQueuesWaitingInteractions',_0x1e115d['query'],routingClient)['then'](respondWithResult(_0x238288,null))['catch'](handleError(_0x238288,null));};exports[_0x8073('0x5a')]=function(_0x9542ca,_0x4a1e63){return respondWithRpcPromise(_0x8073('0x5b'),_0x9542ca[_0x8073('0x18')],routingClient)[_0x8073('0x8')](respondWithResult(_0x4a1e63,null))[_0x8073('0xc')](handleError(_0x4a1e63,null));};exports['queueNotify']=function(_0x41d3b4){return function(_0x3adca3,_0x596cd4){var _0x507de0,_0x12ff46;var _0x522636=_[_0x8073('0x5c')](_0x41d3b4);var _0x402253=_0x41d3b4==='chat'?'Website':_0x8073('0x5d');return db[_0x522636+_0x8073('0x5e')]['findOne']({'raw':!![],'where':{'id':_0x3adca3['params']['id']}})['then'](function(_0x7cdf61){if(_[_0x8073('0x13')](_0x7cdf61)){throw new Error(_0x522636+_0x8073('0x5f'));}_0x507de0=_0x7cdf61;return db[_0x522636+_0x8073('0x60')][_0x8073('0x61')]({'where':{'id':_0x3adca3[_0x8073('0x2d')][_0x8073('0x62')]},'include':[{'model':db[_0x522636+_0x8073('0x63')],'as':_0x8073('0x63')},{'model':db[_0x522636+_0x402253],'as':_0x8073('0x5d')}]});})['then'](function(_0x1b9db6){if(_['isNil'](_0x1b9db6)){throw new Error(_0x522636+_0x8073('0x64'));}_0x12ff46=_0x1b9db6;return _0x1b9db6[_0x8073('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8073('0x8')](function(){var _0x21b593={'uniqueid':_0x41d3b4+'.'+_0x12ff46['id']+'.'+_0x12ff46['Interaction']['id'],'FromUserId':_0x3adca3['user']['id'],'type':_0x8073('0x66')};_0x21b593[_0x522636+_0x8073('0x67')]=_0x12ff46['id'];_0x21b593[_0x522636+_0x8073('0x68')]=_0x12ff46[_0x8073('0x63')]['id'];_0x21b593[_0x8073('0x69')+_0x522636+_0x402253+'Id']=_0x12ff46[_0x8073('0x5d')]['id'];_0x21b593['To'+_0x522636+'QueueId']=_0x507de0['id'];return db[_0x522636+_0x8073('0x6a')][_0x8073('0x6b')](_0x21b593);})[_0x8073('0x8')](function(){return respondWithRpcPromise(_0x8073('0x6c'),{'channel':_0x41d3b4,'interaction':_0x12ff46[_0x8073('0x63')],'message':_0x12ff46,'account':_0x12ff46['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x8073('0x66'),'appdata':_0x507de0[_0x8073('0x11')]+','+(_0x12ff46[_0x8073('0x5d')][_0x8073('0x6d')]||0x12c),'interval':_0x8073('0x6e')}]},routingClient);})['then'](respondWithResult(_0x596cd4,null))[_0x8073('0xc')](handleError(_0x596cd4,null));};};exports[_0x8073('0x6f')]=function(_0x4e75a4,_0xa88406){var _0x4a1f37,_0x3a02a1;if(_[_0x8073('0x13')](_0x4e75a4[_0x8073('0x2d')]['channel'])){throw new Error(_0x8073('0x70'));}var _0x4a2b69=_0x4e75a4[_0x8073('0x2d')][_0x8073('0x71')];var _0x3f9fb0=_['capitalize'](_0x4a2b69);var _0x20b920=_0x4a2b69===_0x8073('0x72')?'Website':'Account';return db['User'][_0x8073('0x61')]({'raw':!![],'where':{'id':_0x4e75a4['params']['id'],'role':_0x8073('0x38')}})[_0x8073('0x8')](function(_0x5f6021){if(_[_0x8073('0x13')](_0x5f6021)){throw new Error(_0x8073('0x73'));}_0x4a1f37=_0x5f6021;return db[_0x3f9fb0+_0x8073('0x60')][_0x8073('0x61')]({'where':{'id':_0x4e75a4[_0x8073('0x2d')][_0x8073('0x62')]},'include':[{'model':db[_0x3f9fb0+_0x8073('0x63')],'as':_0x8073('0x63')},{'model':db[_0x3f9fb0+_0x20b920],'as':_0x8073('0x5d')}]});})[_0x8073('0x8')](function(_0x51e3d6){if(_[_0x8073('0x13')](_0x51e3d6)){throw new Error(_0x3f9fb0+'\x20Message\x20not\x20found');}_0x3a02a1=_0x51e3d6;return _0x51e3d6[_0x8073('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8073('0x8')](function(){var _0x2d8dd2={'uniqueid':_0x4a2b69+'.'+_0x3a02a1['id']+'.'+_0x3a02a1[_0x8073('0x63')]['id'],'FromUserId':_0x4e75a4['user']['id'],'type':_0x8073('0x66'),'ToUserId':_0x4a1f37['id']};_0x2d8dd2[_0x3f9fb0+_0x8073('0x67')]=_0x3a02a1['id'];_0x2d8dd2[_0x3f9fb0+'InteractionId']=_0x3a02a1[_0x8073('0x63')]['id'];_0x2d8dd2[_0x8073('0x69')+_0x3f9fb0+_0x20b920+'Id']=_0x3a02a1[_0x8073('0x5d')]['id'];return db[_0x3f9fb0+_0x8073('0x6a')][_0x8073('0x6b')](_0x2d8dd2);})[_0x8073('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x4a2b69,'interaction':_0x3a02a1['Interaction'],'message':_0x3a02a1,'account':_0x3a02a1[_0x8073('0x5d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8073('0x38'),'appdata':_0x4a1f37['name']+','+(_0x3a02a1['Account'][_0x8073('0x74')]||0x12c),'interval':_0x8073('0x6e')}]},routingClient);})[_0x8073('0x8')](respondWithResult(_0xa88406,null))['catch'](handleError(_0xa88406,null));}; \ No newline at end of file +var _0x4588=['showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','capitalize','chat','Website','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','QueueId','TransferReport','create','Account','queueTransferTimeout','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','Message','MessageId','From','Start','agentTransferTimeout','*,*,*,*','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','status','json','stack','send','isNil','find','rows','voiceChannels','VoiceChannels','query','catch','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','body','interaction','user','name','hasOwnProperty','findAll','length','updateAttributes','MemberReport','findOrCreate','interface','format','YYYY-MM-DD\x20HH:mm:ss','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','showChatQueues','ChatQueues','mailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','WhatsappQueues'];(function(_0x4dea10,_0x4594f5){var _0x4c19d2=function(_0x295993){while(--_0x295993){_0x4dea10['push'](_0x4dea10['shift']());}};_0x4c19d2(++_0x4594f5);}(_0x4588,0x113));var _0x8458=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0x4588[_0x1d04b5];return _0x161342;};'use strict';var BPromise=require(_0x8458('0x0'));var moment=require(_0x8458('0x1'));var _=require(_0x8458('0x2'));var util=require(_0x8458('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x8458('0x4'))(_0x8458('0x5'));var jayson=require(_0x8458('0x6'));var amiClient=jayson[_0x8458('0x7')][_0x8458('0x8')]({'port':0x232a});var mailClient=jayson['client'][_0x8458('0x8')]({'port':0x232b});var routingClient=jayson[_0x8458('0x7')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4dca67,_0x497ae5,_0x3f90c4){return new BPromise(function(_0x243931,_0x8e95cc){var _0xd26f18=_0x3f90c4?_0x3f90c4:amiClient;return _0xd26f18[_0x8458('0x9')](_0x4dca67,_0x497ae5)[_0x8458('0xa')](function(_0xf18673){if(_0xf18673[_0x8458('0xb')]){if(_0xf18673[_0x8458('0xb')][_0x8458('0xc')]===0x1f4){return _0x8e95cc(_0xf18673['error'][_0x8458('0xd')]);}return _0x243931(_0xf18673[_0x8458('0xb')][_0x8458('0xd')]);}else{_0x243931(_0xf18673[_0x8458('0xe')]);}})['catch'](function(_0x139bf6){_0x8e95cc(_0x139bf6);});});}function respondWithResult(_0x41532d,_0x7cac45){_0x7cac45=_0x7cac45||0xc8;return function(_0x2459e8){if(_0x2459e8){return _0x41532d[_0x8458('0xf')](_0x7cac45)[_0x8458('0x10')](_0x2459e8);}return _0x41532d['sendStatus'](0x194);};}function handleError(_0x35b65b,_0x1ef455){_0x1ef455=_0x1ef455||0x1f4;return function(_0x2129d4){logger[_0x8458('0xb')](_0x2129d4[_0x8458('0x11')]);if(_0x2129d4['name']){delete _0x2129d4['name'];}_0x35b65b[_0x8458('0xf')](_0x1ef455)[_0x8458('0x12')](_0x2129d4);};}function findById(_0x4a4722){return function(_0x41529e){if(!_['isNil'](_0x4a4722)&&!_[_0x8458('0x13')](_0x41529e)&&!_[_0x8458('0x13')](_0x41529e['rows'])){return _[_0x8458('0x14')](_0x41529e[_0x8458('0x15')],function(_0x392014){return _0x392014['id']==_0x4a4722;});}return null;};}exports[_0x8458('0x16')]=function(_0x55ca6b,_0x3d60d6){return respondWithRpcPromise(_0x8458('0x17'),_0x55ca6b[_0x8458('0x18')])[_0x8458('0xa')](respondWithResult(_0x3d60d6,null))[_0x8458('0x19')](handleError(_0x3d60d6,null));};exports[_0x8458('0x1a')]=function(_0x50f093,_0x240c8e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x8458('0x1b')](_0x50f093[_0x8458('0x18')],_0x50f093[_0x8458('0x1c')]))[_0x8458('0xa')](respondWithResult(_0x240c8e,null))[_0x8458('0x19')](handleError(_0x240c8e,null));};exports['voiceChannelStopMixMonitor']=function(_0x237bdf,_0x1a29e7){return respondWithRpcPromise(_0x8458('0x1d'),_['merge'](_0x237bdf[_0x8458('0x18')],_0x237bdf['params']))[_0x8458('0xa')](respondWithResult(_0x1a29e7,null))[_0x8458('0x19')](handleError(_0x1a29e7,null));};exports[_0x8458('0x1e')]=function(_0x2e246c,_0x5c7ec2){return respondWithRpcPromise(_0x8458('0x1f'),_0x2e246c[_0x8458('0x18')])[_0x8458('0xa')](respondWithResult(_0x5c7ec2,null))['catch'](handleError(_0x5c7ec2,null));};exports[_0x8458('0x20')]=function(_0x3432ee,_0x3e5cdc){return respondWithRpcPromise(_0x8458('0x1f'),_0x3432ee[_0x8458('0x18')])['then'](findById(_0x3432ee[_0x8458('0x1c')]['id']))[_0x8458('0xa')](respondWithResult(_0x3e5cdc,null))['catch'](handleError(_0x3e5cdc,null));};exports[_0x8458('0x21')]=function(_0x5dd2ea,_0x20c0b2){return respondWithRpcPromise(_0x8458('0x22'),_['merge'](_0x5dd2ea[_0x8458('0x18')],_0x5dd2ea[_0x8458('0x1c')]))['then'](respondWithResult(_0x20c0b2,null))['catch'](handleError(_0x20c0b2,null));};exports['voiceQueuesChannels']=function(_0x2d4595,_0x58bd24){return respondWithRpcPromise(_0x8458('0x23'),_0x2d4595[_0x8458('0x18')])[_0x8458('0xa')](respondWithResult(_0x58bd24,null))[_0x8458('0x19')](handleError(_0x58bd24,null));};exports[_0x8458('0x24')]=function(_0x1ec9c1,_0x472296){return respondWithRpcPromise(_0x8458('0x25'),_[_0x8458('0x1b')](_0x1ec9c1[_0x8458('0x18')],_0x1ec9c1[_0x8458('0x1c')]))['then'](respondWithResult(_0x472296,null))[_0x8458('0x19')](handleError(_0x472296,null));};exports[_0x8458('0x26')]=function(_0x5031c6,_0x142367){return respondWithRpcPromise(_0x8458('0x27'),_[_0x8458('0x1b')](_0x5031c6['query'],_0x5031c6['params']))[_0x8458('0xa')](respondWithResult(_0x142367,null))['catch'](handleError(_0x142367,null));};exports[_0x8458('0x28')]=function(_0x32a20e,_0x661de){return respondWithRpcPromise(_0x8458('0x29'),_[_0x8458('0x1b')](_0x32a20e['query'],_0x32a20e[_0x8458('0x1c')]))[_0x8458('0xa')](respondWithResult(_0x661de,null))[_0x8458('0x19')](handleError(_0x661de,null));};exports[_0x8458('0x2a')]=function(_0x249b3d,_0x4897e0){return respondWithRpcPromise(_0x8458('0x2b'),_0x249b3d['query'])[_0x8458('0xa')](respondWithResult(_0x4897e0,null))['catch'](handleError(_0x4897e0,null));};exports[_0x8458('0x2c')]=function(_0x192f16,_0xe3f24f){return respondWithRpcPromise(_0x8458('0x2d'),_0x192f16['query'])['then'](respondWithResult(_0xe3f24f,null))['catch'](handleError(_0xe3f24f,null));};exports['agents']=function(_0x46d256,_0x1d0366){var _0x31d285;return respondWithRpcPromise(_0x8458('0x2e'),_0x46d256[_0x8458('0x18')])['then'](function(_0x311e9f){_0x31d285=_0x311e9f;return respondWithRpcPromise(_0x8458('0x2e'),_0x46d256[_0x8458('0x18')],routingClient);})['then'](function(_0x1900a2){return _[_0x8458('0x1b')]({},_0x1900a2,_0x31d285);})[_0x8458('0xa')](respondWithResult(_0x1d0366,null))[_0x8458('0x19')](handleError(_0x1d0366,null));};exports[_0x8458('0x2f')]=function(_0x3285fb,_0x2cd600){if(_0x3285fb[_0x8458('0x30')]&&_0x3285fb[_0x8458('0x30')][_0x8458('0x31')]&&_0x3285fb[_0x8458('0x32')]&&_0x3285fb[_0x8458('0x32')][_0x8458('0x33')]){for(var _0x3e8c3a in _0x3285fb[_0x8458('0x30')]['interaction']){if(_0x3285fb[_0x8458('0x30')][_0x8458('0x31')][_0x8458('0x34')](_0x3e8c3a)){db['MemberReport'][_0x8458('0x35')]({'where':{'channel':_0x3e8c3a,'membername':_0x3285fb['user'][_0x8458('0x33')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x3285fb[_0x8458('0x30')][_0x8458('0x31')][_0x3e8c3a]&&_0x3285fb[_0x8458('0x30')][_0x8458('0x31')][_0x3e8c3a][_0x8458('0x36')]?{'$notIn':_0x3285fb['body'][_0x8458('0x31')][_0x3e8c3a]}:{'$ne':null}}})[_0x8458('0xa')](function(_0x2f382b){var _0x3ea88b=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0xdcaf6c=0x0,_0x5ccad1=_0x2f382b[_0x8458('0x36')];_0xdcaf6c<_0x5ccad1;_0xdcaf6c+=0x1){_0x2f382b[_0xdcaf6c][_0x8458('0x37')]({'exitAt':_0x3ea88b});}});for(var _0x5f191d=0x0;_0x5f191d<_0x3285fb[_0x8458('0x30')][_0x8458('0x31')][_0x3e8c3a][_0x8458('0x36')];_0x5f191d+=0x1){db[_0x8458('0x38')][_0x8458('0x39')]({'where':{'channel':_0x3e8c3a,'membername':_0x3285fb[_0x8458('0x32')][_0x8458('0x33')],'type':'INTERACTION','uniqueid':_0x3285fb[_0x8458('0x30')][_0x8458('0x31')][_0x3e8c3a][_0x5f191d],'exitAt':null},'defaults':{'channel':_0x3e8c3a,'membername':_0x3285fb[_0x8458('0x32')][_0x8458('0x33')],'interface':_[_0x8458('0x13')](_0x3285fb[_0x8458('0x32')][_0x8458('0x3a')])?util[_0x8458('0x3b')]('SIP/%s',_0x3285fb[_0x8458('0x32')][_0x8458('0x33')]):_0x3285fb[_0x8458('0x32')][_0x8458('0x3a')],'type':'INTERACTION','enterAt':moment()[_0x8458('0x3b')](_0x8458('0x3c')),'role':_0x8458('0x3d'),'internal':_0x3285fb[_0x8458('0x32')][_0x8458('0x3e')],'uniqueid':_0x3285fb[_0x8458('0x30')][_0x8458('0x31')][_0x3e8c3a][_0x5f191d]}});}}}}return respondWithRpcPromise(_0x8458('0x3f'),{'id':_0x3285fb[_0x8458('0x1c')]['id'],'capacity':_0x3285fb['body']['capacity']},routingClient)[_0x8458('0xa')](respondWithResult(_0x2cd600,null))[_0x8458('0x19')](handleError(_0x2cd600,null));};exports[_0x8458('0x40')]=function(_0x25a22d,_0x15a990){return respondWithRpcPromise(_0x8458('0x41'),_0x25a22d[_0x8458('0x18')])['then'](respondWithResult(_0x15a990,null))[_0x8458('0x19')](handleError(_0x15a990,null));};exports[_0x8458('0x42')]=function(_0xf09b67,_0x251142){return respondWithRpcPromise(_0x8458('0x43'),_0xf09b67[_0x8458('0x18')])[_0x8458('0xa')](respondWithResult(_0x251142,null))[_0x8458('0x19')](handleError(_0x251142,null));};exports[_0x8458('0x44')]=function(_0x3f58b1,_0x37cc3c){return respondWithRpcPromise(_0x8458('0x45'),_0x3f58b1[_0x8458('0x18')])[_0x8458('0xa')](respondWithResult(_0x37cc3c,null))[_0x8458('0x19')](handleError(_0x37cc3c,null));};exports['chatQueues']=function(_0x340b1d,_0x2124c3){return respondWithRpcPromise('ChatQueues',_0x340b1d[_0x8458('0x18')],routingClient)[_0x8458('0xa')](respondWithResult(_0x2124c3,null))[_0x8458('0x19')](handleError(_0x2124c3,null));};exports[_0x8458('0x46')]=function(_0x39d8f0,_0x1488a4){return respondWithRpcPromise(_0x8458('0x47'),_0x39d8f0[_0x8458('0x18')],routingClient)['then'](findById(_0x39d8f0['params']['id']))[_0x8458('0xa')](respondWithResult(_0x1488a4,null))[_0x8458('0x19')](handleError(_0x1488a4,null));};exports[_0x8458('0x48')]=function(_0x385927,_0x37a64a){return respondWithRpcPromise('MailQueues',_0x385927[_0x8458('0x18')],routingClient)[_0x8458('0xa')](respondWithResult(_0x37a64a,null))['catch'](handleError(_0x37a64a,null));};exports[_0x8458('0x49')]=function(_0x52ddb2,_0xd445b0){return respondWithRpcPromise('MailQueues',_0x52ddb2[_0x8458('0x18')],routingClient)[_0x8458('0xa')](findById(_0x52ddb2[_0x8458('0x1c')]['id']))[_0x8458('0xa')](respondWithResult(_0xd445b0,null))['catch'](handleError(_0xd445b0,null));};exports[_0x8458('0x4a')]=function(_0x5d452d,_0x345fda){return respondWithRpcPromise(_0x8458('0x4b'),_0x5d452d[_0x8458('0x18')],mailClient)[_0x8458('0xa')](respondWithResult(_0x345fda,null))[_0x8458('0x19')](handleError(_0x345fda,null));};exports[_0x8458('0x4c')]=function(_0x3db25b,_0x29589f){return respondWithRpcPromise(_0x8458('0x4d'),_0x3db25b[_0x8458('0x18')],routingClient)['then'](respondWithResult(_0x29589f,null))['catch'](handleError(_0x29589f,null));};exports['showOpenchannelQueues']=function(_0x4ff4cf,_0x366fb0){return respondWithRpcPromise(_0x8458('0x4d'),_0x4ff4cf[_0x8458('0x18')],routingClient)[_0x8458('0xa')](findById(_0x4ff4cf['params']['id']))['then'](respondWithResult(_0x366fb0,null))[_0x8458('0x19')](handleError(_0x366fb0,null));};exports[_0x8458('0x4e')]=function(_0x3cd6c8,_0x41e210){return respondWithRpcPromise(_0x8458('0x4f'),_0x3cd6c8[_0x8458('0x18')],routingClient)[_0x8458('0xa')](respondWithResult(_0x41e210,null))[_0x8458('0x19')](handleError(_0x41e210,null));};exports['showSmsQueues']=function(_0x431954,_0x4cc5d8){return respondWithRpcPromise(_0x8458('0x4f'),_0x431954['query'],routingClient)['then'](findById(_0x431954[_0x8458('0x1c')]['id']))['then'](respondWithResult(_0x4cc5d8,null))['catch'](handleError(_0x4cc5d8,null));};exports[_0x8458('0x50')]=function(_0x43b826,_0x183297){return respondWithRpcPromise(_0x8458('0x51'),_0x43b826[_0x8458('0x18')],routingClient)[_0x8458('0xa')](respondWithResult(_0x183297,null))[_0x8458('0x19')](handleError(_0x183297,null));};exports['showWhatsappQueues']=function(_0x1a7463,_0x56b1aa){return respondWithRpcPromise(_0x8458('0x51'),_0x1a7463[_0x8458('0x18')],routingClient)[_0x8458('0xa')](findById(_0x1a7463[_0x8458('0x1c')]['id']))[_0x8458('0xa')](respondWithResult(_0x56b1aa,null))[_0x8458('0x19')](handleError(_0x56b1aa,null));};exports['faxQueues']=function(_0xd97c54,_0x40a51a){return respondWithRpcPromise('FaxQueues',_0xd97c54[_0x8458('0x18')],routingClient)['then'](respondWithResult(_0x40a51a,null))[_0x8458('0x19')](handleError(_0x40a51a,null));};exports[_0x8458('0x52')]=function(_0x217371,_0x3a465a){return respondWithRpcPromise('FaxQueues',_0x217371[_0x8458('0x18')],routingClient)[_0x8458('0xa')](findById(_0x217371[_0x8458('0x1c')]['id']))['then'](respondWithResult(_0x3a465a,null))[_0x8458('0x19')](handleError(_0x3a465a,null));};exports[_0x8458('0x53')]=function(_0x579a42,_0x95fabe){return respondWithRpcPromise(_0x8458('0x54'),_0x579a42[_0x8458('0x18')])[_0x8458('0xa')](respondWithResult(_0x95fabe,null))[_0x8458('0x19')](handleError(_0x95fabe,null));};exports[_0x8458('0x55')]=function(_0x21eada,_0x2340d0){return respondWithRpcPromise(_0x8458('0x56'),_0x21eada['query'],routingClient)['then'](respondWithResult(_0x2340d0,null))[_0x8458('0x19')](handleError(_0x2340d0,null));};exports['mailQueuesWaitingInteractions']=function(_0xe6a4b8,_0x3e951d){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0xe6a4b8['query'],routingClient)[_0x8458('0xa')](respondWithResult(_0x3e951d,null))['catch'](handleError(_0x3e951d,null));};exports[_0x8458('0x57')]=function(_0x5b7f92,_0x1c5bae){return respondWithRpcPromise(_0x8458('0x58'),_0x5b7f92['query'],routingClient)[_0x8458('0xa')](respondWithResult(_0x1c5bae,null))[_0x8458('0x19')](handleError(_0x1c5bae,null));};exports[_0x8458('0x59')]=function(_0x10acc9,_0x239452){return respondWithRpcPromise(_0x8458('0x5a'),_0x10acc9[_0x8458('0x18')],routingClient)[_0x8458('0xa')](respondWithResult(_0x239452,null))[_0x8458('0x19')](handleError(_0x239452,null));};exports[_0x8458('0x5b')]=function(_0x4e4f05,_0x183498){return respondWithRpcPromise(_0x8458('0x5c'),_0x4e4f05['query'],routingClient)[_0x8458('0xa')](respondWithResult(_0x183498,null))[_0x8458('0x19')](handleError(_0x183498,null));};exports['faxQueuesWaitingInteractions']=function(_0x3a3922,_0x30ac0b){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x3a3922[_0x8458('0x18')],routingClient)['then'](respondWithResult(_0x30ac0b,null))[_0x8458('0x19')](handleError(_0x30ac0b,null));};exports['queueNotify']=function(_0x2aed36){return function(_0x573cbe,_0x28b267){var _0x2f1e39,_0x3f9bd3;var _0x311a=_[_0x8458('0x5d')](_0x2aed36);var _0xf2529b=_0x2aed36===_0x8458('0x5e')?_0x8458('0x5f'):'Account';return db[_0x311a+'Queue']['findOne']({'raw':!![],'where':{'id':_0x573cbe['params']['id']}})['then'](function(_0x3f4e3e){if(_[_0x8458('0x13')](_0x3f4e3e)){throw new Error(_0x311a+'\x20Queue\x20not\x20found');}_0x2f1e39=_0x3f4e3e;return db[_0x311a+'Message'][_0x8458('0x60')]({'where':{'id':_0x573cbe[_0x8458('0x30')][_0x8458('0x61')]},'include':[{'model':db[_0x311a+_0x8458('0x62')],'as':_0x8458('0x62')},{'model':db[_0x311a+_0xf2529b],'as':'Account'}]});})[_0x8458('0xa')](function(_0x453b14){if(_[_0x8458('0x13')](_0x453b14)){throw new Error(_0x311a+_0x8458('0x63'));}_0x3f9bd3=_0x453b14;return _0x453b14[_0x8458('0x64')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8458('0xa')](function(){var _0x51cf32={'uniqueid':_0x2aed36+'.'+_0x3f9bd3['id']+'.'+_0x3f9bd3['Interaction']['id'],'FromUserId':_0x573cbe[_0x8458('0x32')]['id'],'type':_0x8458('0x65')};_0x51cf32[_0x311a+'MessageId']=_0x3f9bd3['id'];_0x51cf32[_0x311a+_0x8458('0x66')]=_0x3f9bd3['Interaction']['id'];_0x51cf32['From'+_0x311a+_0xf2529b+'Id']=_0x3f9bd3['Account']['id'];_0x51cf32['To'+_0x311a+_0x8458('0x67')]=_0x2f1e39['id'];return db[_0x311a+_0x8458('0x68')][_0x8458('0x69')](_0x51cf32);})[_0x8458('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x2aed36,'interaction':_0x3f9bd3['Interaction'],'message':_0x3f9bd3,'account':_0x3f9bd3[_0x8458('0x6a')],'applications':[{'id':0x0,'priority':0x1,'app':_0x8458('0x65'),'appdata':_0x2f1e39[_0x8458('0x33')]+','+(_0x3f9bd3[_0x8458('0x6a')][_0x8458('0x6b')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x8458('0xa')](respondWithResult(_0x28b267,null))[_0x8458('0x19')](handleError(_0x28b267,null));};};exports[_0x8458('0x6c')]=function(_0x3fc3eb,_0x3ed8f3){var _0x47b5d7,_0x3d0298;if(_[_0x8458('0x13')](_0x3fc3eb[_0x8458('0x30')][_0x8458('0x6d')])){throw new Error(_0x8458('0x6e'));}var _0xbc065f=_0x3fc3eb[_0x8458('0x30')][_0x8458('0x6d')];var _0x3cdd24=_[_0x8458('0x5d')](_0xbc065f);var _0x15b340=_0xbc065f===_0x8458('0x5e')?'Website':_0x8458('0x6a');return db[_0x8458('0x6f')]['findOne']({'raw':!![],'where':{'id':_0x3fc3eb[_0x8458('0x1c')]['id'],'role':'agent'}})[_0x8458('0xa')](function(_0x15a92f){if(_['isNil'](_0x15a92f)){throw new Error(_0x8458('0x70'));}_0x47b5d7=_0x15a92f;return db[_0x3cdd24+_0x8458('0x71')][_0x8458('0x60')]({'where':{'id':_0x3fc3eb['body'][_0x8458('0x61')]},'include':[{'model':db[_0x3cdd24+_0x8458('0x62')],'as':_0x8458('0x62')},{'model':db[_0x3cdd24+_0x15b340],'as':_0x8458('0x6a')}]});})[_0x8458('0xa')](function(_0x6e6e71){if(_[_0x8458('0x13')](_0x6e6e71)){throw new Error(_0x3cdd24+_0x8458('0x63'));}_0x3d0298=_0x6e6e71;return _0x6e6e71[_0x8458('0x64')]({'read':0x0,'readAt':null,'UserId':null});})[_0x8458('0xa')](function(){var _0xef856={'uniqueid':_0xbc065f+'.'+_0x3d0298['id']+'.'+_0x3d0298[_0x8458('0x62')]['id'],'FromUserId':_0x3fc3eb['user']['id'],'type':_0x8458('0x65'),'ToUserId':_0x47b5d7['id']};_0xef856[_0x3cdd24+_0x8458('0x72')]=_0x3d0298['id'];_0xef856[_0x3cdd24+'InteractionId']=_0x3d0298[_0x8458('0x62')]['id'];_0xef856[_0x8458('0x73')+_0x3cdd24+_0x15b340+'Id']=_0x3d0298[_0x8458('0x6a')]['id'];return db[_0x3cdd24+_0x8458('0x68')][_0x8458('0x69')](_0xef856);})['then'](function(){return respondWithRpcPromise(_0x8458('0x74'),{'channel':_0xbc065f,'interaction':_0x3d0298[_0x8458('0x62')],'message':_0x3d0298,'account':_0x3d0298['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x8458('0x3d'),'appdata':_0x47b5d7['name']+','+(_0x3d0298[_0x8458('0x6a')][_0x8458('0x75')]||0x12c),'interval':_0x8458('0x76')}]},routingClient);})[_0x8458('0xa')](respondWithResult(_0x3ed8f3,null))[_0x8458('0x19')](handleError(_0x3ed8f3,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 8103c5c..bc3b2dd 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 _0xfbfc=['../../components/auth/service','../../config/environment','./schedule.controller','get','index','isAuthenticated','show','/:id/run','run','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout'];(function(_0x520591,_0x16f54c){var _0x4867bf=function(_0x12c9bf){while(--_0x12c9bf){_0x520591['push'](_0x520591['shift']());}};_0x4867bf(++_0x16f54c);}(_0xfbfc,0xce));var _0xcfbf=function(_0x1fd8f4,_0x529857){_0x1fd8f4=_0x1fd8f4-0x0;var _0x5075ed=_0xfbfc[_0x1fd8f4];return _0x5075ed;};'use strict';var multer=require(_0xcfbf('0x0'));var util=require(_0xcfbf('0x1'));var path=require('path');var timeout=require(_0xcfbf('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xcfbf('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xcfbf('0x4'));var controller=require(_0xcfbf('0x5'));router[_0xcfbf('0x6')]('/',auth['isAuthenticated'](),controller[_0xcfbf('0x7')]);router[_0xcfbf('0x6')]('/:id',auth[_0xcfbf('0x8')](),controller[_0xcfbf('0x9')]);router['get'](_0xcfbf('0xa'),auth['isAuthenticated'](),controller[_0xcfbf('0xb')]);router[_0xcfbf('0xc')]('/',auth[_0xcfbf('0x8')](),controller[_0xcfbf('0xd')]);router[_0xcfbf('0xe')](_0xcfbf('0xf'),auth['isAuthenticated'](),controller[_0xcfbf('0x10')]);router[_0xcfbf('0x11')](_0xcfbf('0xf'),auth['isAuthenticated'](),controller[_0xcfbf('0x12')]);module['exports']=router; \ No newline at end of file +var _0x9549=['Router','../../components/auth/service','../../config/environment','./schedule.controller','get','index','/:id','show','/:id/run','isAuthenticated','run','post','put','update','delete','exports','util','connect-timeout','express'];(function(_0x4b0eb4,_0x3b4a8b){var _0x2ca991=function(_0x3e8a56){while(--_0x3e8a56){_0x4b0eb4['push'](_0x4b0eb4['shift']());}};_0x2ca991(++_0x3b4a8b);}(_0x9549,0x1b2));var _0x9954=function(_0x4c1176,_0xf999e9){_0x4c1176=_0x4c1176-0x0;var _0x2aca97=_0x9549[_0x4c1176];return _0x2aca97;};'use strict';var multer=require('multer');var util=require(_0x9954('0x0'));var path=require('path');var timeout=require(_0x9954('0x1'));var express=require(_0x9954('0x2'));var router=express[_0x9954('0x3')]();var auth=require(_0x9954('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9954('0x5'));var controller=require(_0x9954('0x6'));router[_0x9954('0x7')]('/',auth['isAuthenticated'](),controller[_0x9954('0x8')]);router[_0x9954('0x7')](_0x9954('0x9'),auth['isAuthenticated'](),controller[_0x9954('0xa')]);router['get'](_0x9954('0xb'),auth[_0x9954('0xc')](),controller[_0x9954('0xd')]);router[_0x9954('0xe')]('/',auth[_0x9954('0xc')](),controller['create']);router[_0x9954('0xf')](_0x9954('0x9'),auth['isAuthenticated'](),controller[_0x9954('0x10')]);router[_0x9954('0x11')]('/:id',auth[_0x9954('0xc')](),controller['destroy']);module[_0x9954('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 805b7ce..bc77c82 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 _0x4074=['default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','days','minutes','csv','custom'];(function(_0x4b6aa3,_0x3e95b4){var _0x4ff0c3=function(_0xb27ebf){while(--_0xb27ebf){_0x4b6aa3['push'](_0x4b6aa3['shift']());}};_0x4ff0c3(++_0x3e95b4);}(_0x4074,0xf0));var _0x4407=function(_0x2fecc9,_0x4a4069){_0x2fecc9=_0x2fecc9-0x0;var _0x38ac05=_0x4074[_0x2fecc9];return _0x38ac05;};'use strict';var Sequelize=require(_0x4407('0x0'));module[_0x4407('0x1')]={'name':{'type':Sequelize[_0x4407('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x4407('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x4407('0x2')],'allowNull':![],'defaultValue':_0x4407('0x4')},'startAt':{'type':Sequelize[_0x4407('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x4407('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x4407('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x4407('0x7')](_0x4407('0x8'),_0x4407('0x9'),_0x4407('0xa'),'weeks',_0x4407('0xb'),'hours',_0x4407('0xc')),'allowNull':![],'defaultValue':_0x4407('0xb')},'output':{'type':Sequelize[_0x4407('0x7')]('csv','pdf','xlsx'),'allowNull':![],'defaultValue':_0x4407('0xd')},'type':{'type':Sequelize[_0x4407('0x7')](_0x4407('0xe'),_0x4407('0xf')),'allowNull':![],'defaultValue':_0x4407('0xe')},'sendMail':{'type':Sequelize[_0x4407('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x4407('0x2')]},'cc':{'type':Sequelize[_0x4407('0x10')]},'bcc':{'type':Sequelize[_0x4407('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x4407('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x7046=['sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','days','pdf','xlsx','csv','custom','default','BOOLEAN','TEXT'];(function(_0xd7f314,_0x176c1a){var _0x41c0ca=function(_0x37298f){while(--_0x37298f){_0xd7f314['push'](_0xd7f314['shift']());}};_0x41c0ca(++_0x176c1a);}(_0x7046,0x144));var _0x6704=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x7046[_0x199572];return _0x13cfa3;};'use strict';var Sequelize=require(_0x6704('0x0'));module[_0x6704('0x1')]={'name':{'type':Sequelize[_0x6704('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6704('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x6704('0x2')],'allowNull':![],'defaultValue':_0x6704('0x3')},'startAt':{'type':Sequelize[_0x6704('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x6704('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x6704('0x6')](_0x6704('0x7'),_0x6704('0x8'),_0x6704('0x9'),'weeks',_0x6704('0xa'),'hours','minutes'),'allowNull':![],'defaultValue':_0x6704('0xa')},'output':{'type':Sequelize['ENUM']('csv',_0x6704('0xb'),_0x6704('0xc')),'allowNull':![],'defaultValue':_0x6704('0xd')},'type':{'type':Sequelize[_0x6704('0x6')](_0x6704('0xe'),_0x6704('0xf')),'allowNull':![],'defaultValue':_0x6704('0xe')},'sendMail':{'type':Sequelize[_0x6704('0x10')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6704('0x11')]},'bcc':{'type':Sequelize[_0x6704('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 7b8e45b..74e0c7c 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 _0xa632=['index','map','Schedule','rawAttributes','fieldName','type','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','include','rows','show','params','keys','includeAll','find','create','role','user','Scheduler','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','run','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','then','get','UserProfileResource','destroy','error','stack','name','send'];(function(_0x686d81,_0x34e656){var _0x65c75f=function(_0x3ee4c9){while(--_0x3ee4c9){_0x686d81['push'](_0x686d81['shift']());}};_0x65c75f(++_0x34e656);}(_0xa632,0x12c));var _0x2a63=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0xa632[_0x58afd5];return _0x3e503b;};'use strict';var pdf=require(_0x2a63('0x0'));var emlformat=require(_0x2a63('0x1'));var rimraf=require(_0x2a63('0x2'));var zipdir=require(_0x2a63('0x3'));var jsonpatch=require(_0x2a63('0x4'));var rp=require(_0x2a63('0x5'));var moment=require(_0x2a63('0x6'));var BPromise=require(_0x2a63('0x7'));var Mustache=require(_0x2a63('0x8'));var util=require(_0x2a63('0x9'));var path=require(_0x2a63('0xa'));var sox=require(_0x2a63('0xb'));var csv=require(_0x2a63('0xc'));var ejs=require(_0x2a63('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2a63('0xe'));var crypto=require(_0x2a63('0xf'));var jsforce=require(_0x2a63('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2a63('0x11'));var Redis=require(_0x2a63('0x12'));var authService=require(_0x2a63('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a63('0x14'));var logger=require(_0x2a63('0x15'))(_0x2a63('0x16'));var utils=require('../../config/utils');var config=require(_0x2a63('0x17'));var db=require(_0x2a63('0x18'))['db'];function respondWithStatusCode(_0x3c00c0,_0x272247){_0x272247=_0x272247||0xcc;return function(_0x18b629){if(_0x18b629){return _0x3c00c0[_0x2a63('0x19')](_0x272247);}return _0x3c00c0['status'](_0x272247)[_0x2a63('0x1a')]();};}function respondWithResult(_0x59af69,_0x5a7c8c){_0x5a7c8c=_0x5a7c8c||0xc8;return function(_0x58b6e6){if(_0x58b6e6){return _0x59af69[_0x2a63('0x1b')](_0x5a7c8c)[_0x2a63('0x1c')](_0x58b6e6);}};}function respondWithFilteredResult(_0x5d630c,_0x519dd0){return function(_0x1fc52b){if(_0x1fc52b){var _0x520f63=_0x1fc52b[_0x2a63('0x1d')],_0xefee2=_0x519dd0['offset'],_0x4751b2=_0x519dd0[_0x2a63('0x1e')]+_0x519dd0['limit'],_0x2fdc0f;if(_0x4751b2>=_0x520f63){_0x4751b2=_0x520f63;_0x2fdc0f=0xc8;}else{_0x2fdc0f=0xce;}_0x5d630c['status'](_0x2fdc0f);return _0x5d630c[_0x2a63('0x1f')](_0x2a63('0x20'),_0xefee2+'-'+_0x4751b2+'/'+_0x520f63)['json'](_0x1fc52b);}return null;};}function patchUpdates(_0x2d01b9){return function(_0x17f9d4){try{jsonpatch[_0x2a63('0x21')](_0x17f9d4,_0x2d01b9,!![]);}catch(_0x5241cc){return BPromise[_0x2a63('0x22')](_0x5241cc);}return _0x17f9d4[_0x2a63('0x23')]();};}function saveUpdates(_0x58c926,_0x5e8835){return function(_0x26e486){if(_0x26e486){return _0x26e486['update'](_0x58c926)[_0x2a63('0x24')](function(_0x45626a){return _0x45626a;});}return null;};}function removeEntity(_0x27d8cb,_0x117d61){return function(_0x505972){if(_0x505972){return _0x505972['destroy']()[_0x2a63('0x24')](function(){var _0xf8a56e=_0x505972[_0x2a63('0x25')]({'plain':!![]});var _0x40e322='Scheduler';return db[_0x2a63('0x26')][_0x2a63('0x27')]({'where':{'type':_0x40e322,'resourceId':_0xf8a56e['id']}})[_0x2a63('0x24')](function(){return _0x505972;});})['then'](function(){_0x27d8cb[_0x2a63('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e5211,_0x3bfdf7){return function(_0x4e1642){if(!_0x4e1642){_0x1e5211[_0x2a63('0x19')](0x194);}return _0x4e1642;};}function handleError(_0x48d970,_0x27c80b){_0x27c80b=_0x27c80b||0x1f4;return function(_0x487d5a){logger[_0x2a63('0x28')](_0x487d5a[_0x2a63('0x29')]);if(_0x487d5a[_0x2a63('0x2a')]){delete _0x487d5a[_0x2a63('0x2a')];}_0x48d970[_0x2a63('0x1b')](_0x27c80b)[_0x2a63('0x2b')](_0x487d5a);};}exports[_0x2a63('0x2c')]=function(_0x1a293a,_0x2227ba){var _0x435b58={},_0x5bddd0={},_0xeca97={'count':0x0,'rows':[]};var _0x204cc2=_[_0x2a63('0x2d')](db[_0x2a63('0x2e')][_0x2a63('0x2f')],function(_0x4e71d1){return{'name':_0x4e71d1[_0x2a63('0x30')],'type':_0x4e71d1[_0x2a63('0x31')][_0x2a63('0x32')]};});_0x5bddd0[_0x2a63('0x33')]=_[_0x2a63('0x2d')](_0x204cc2,_0x2a63('0x2a'));_0x5bddd0['query']=_['keys'](_0x1a293a['query']);_0x5bddd0[_0x2a63('0x34')]=_['intersection'](_0x5bddd0[_0x2a63('0x33')],_0x5bddd0[_0x2a63('0x35')]);_0x435b58[_0x2a63('0x36')]=_[_0x2a63('0x37')](_0x5bddd0['model'],qs['fields'](_0x1a293a['query'][_0x2a63('0x38')]));_0x435b58[_0x2a63('0x36')]=_0x435b58[_0x2a63('0x36')][_0x2a63('0x39')]?_0x435b58['attributes']:_0x5bddd0[_0x2a63('0x33')];if(!_0x1a293a[_0x2a63('0x35')][_0x2a63('0x3a')]('nolimit')){_0x435b58[_0x2a63('0x3b')]=qs['limit'](_0x1a293a[_0x2a63('0x35')][_0x2a63('0x3b')]);_0x435b58[_0x2a63('0x1e')]=qs['offset'](_0x1a293a['query'][_0x2a63('0x1e')]);}_0x435b58[_0x2a63('0x3c')]=qs[_0x2a63('0x3d')](_0x1a293a[_0x2a63('0x35')][_0x2a63('0x3d')]);_0x435b58[_0x2a63('0x3e')]=qs[_0x2a63('0x34')](_[_0x2a63('0x3f')](_0x1a293a[_0x2a63('0x35')],_0x5bddd0[_0x2a63('0x34')]),_0x204cc2);if(_0x1a293a[_0x2a63('0x35')][_0x2a63('0x40')]){_0x435b58['where']=_['merge'](_0x435b58[_0x2a63('0x3e')],{'$or':_[_0x2a63('0x2d')](_0x204cc2,function(_0x5c1b8c){if(_0x5c1b8c['type']!=='VIRTUAL'){var _0x5a4c29={};_0x5a4c29[_0x5c1b8c['name']]={'$like':'%'+_0x1a293a[_0x2a63('0x35')]['filter']+'%'};return _0x5a4c29;}})});}_0x435b58=_[_0x2a63('0x41')]({},_0x435b58,_0x1a293a[_0x2a63('0x42')]);var _0x56e96c={'where':_0x435b58[_0x2a63('0x3e')]};return db[_0x2a63('0x2e')][_0x2a63('0x1d')](_0x56e96c)[_0x2a63('0x24')](function(_0x2e302e){_0xeca97['count']=_0x2e302e;if(_0x1a293a[_0x2a63('0x35')]['includeAll']){_0x435b58[_0x2a63('0x43')]=[{'all':!![]}];}return db[_0x2a63('0x2e')]['findAll'](_0x435b58);})[_0x2a63('0x24')](function(_0x5dcf97){_0xeca97[_0x2a63('0x44')]=_0x5dcf97;return _0xeca97;})[_0x2a63('0x24')](respondWithFilteredResult(_0x2227ba,_0x435b58))['catch'](handleError(_0x2227ba,null));};exports[_0x2a63('0x45')]=function(_0x52009f,_0x170180){var _0x1e7c00={'raw':![],'where':{'id':_0x52009f[_0x2a63('0x46')]['id']}},_0x26e51={};_0x26e51[_0x2a63('0x33')]=_[_0x2a63('0x47')](db['Schedule'][_0x2a63('0x2f')]);_0x26e51[_0x2a63('0x35')]=_['keys'](_0x52009f['query']);_0x26e51[_0x2a63('0x34')]=_['intersection'](_0x26e51[_0x2a63('0x33')],_0x26e51[_0x2a63('0x35')]);_0x1e7c00[_0x2a63('0x36')]=_[_0x2a63('0x37')](_0x26e51[_0x2a63('0x33')],qs[_0x2a63('0x38')](_0x52009f['query'][_0x2a63('0x38')]));_0x1e7c00[_0x2a63('0x36')]=_0x1e7c00[_0x2a63('0x36')][_0x2a63('0x39')]?_0x1e7c00[_0x2a63('0x36')]:_0x26e51[_0x2a63('0x33')];if(_0x52009f['query'][_0x2a63('0x48')]){_0x1e7c00[_0x2a63('0x43')]=[{'all':!![]}];}_0x1e7c00=_['merge']({},_0x1e7c00,_0x52009f[_0x2a63('0x42')]);return db[_0x2a63('0x2e')][_0x2a63('0x49')](_0x1e7c00)[_0x2a63('0x24')](handleEntityNotFound(_0x170180,null))['then'](respondWithResult(_0x170180,null))['catch'](handleError(_0x170180,null));};exports[_0x2a63('0x4a')]=function(_0x174fe6,_0x5d9175){return db[_0x2a63('0x2e')][_0x2a63('0x4a')](_0x174fe6['body'],{})[_0x2a63('0x24')](function(_0x417a89){var _0x4ae089=_0x174fe6['user'][_0x2a63('0x25')]({'plain':!![]});if(!_0x4ae089)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ae089[_0x2a63('0x4b')]===_0x2a63('0x4c')){var _0x2182db=_0x417a89['get']({'plain':!![]});var _0x272a2b=_0x2a63('0x4d');return db[_0x2a63('0x4e')][_0x2a63('0x49')]({'where':{'name':_0x272a2b,'userProfileId':_0x4ae089[_0x2a63('0x4f')]},'raw':!![]})[_0x2a63('0x24')](function(_0x1d8b42){if(_0x1d8b42&&_0x1d8b42[_0x2a63('0x50')]===0x0){return db['UserProfileResource'][_0x2a63('0x4a')]({'name':_0x2182db['name'],'resourceId':_0x2182db['id'],'type':_0x1d8b42[_0x2a63('0x2a')],'sectionId':_0x1d8b42['id']},{})[_0x2a63('0x24')](function(){return _0x417a89;});}else{return _0x417a89;}})[_0x2a63('0x51')](function(_0x28e70d){logger[_0x2a63('0x28')](_0x2a63('0x52'),_0x28e70d);throw _0x28e70d;});}return _0x417a89;})[_0x2a63('0x24')](respondWithResult(_0x5d9175,0xc9))['catch'](handleError(_0x5d9175,null));};exports[_0x2a63('0x53')]=function(_0x4821cc,_0x3c4310){if(_0x4821cc[_0x2a63('0x54')]['id']){delete _0x4821cc['body']['id'];}return db[_0x2a63('0x2e')][_0x2a63('0x49')]({'where':{'id':_0x4821cc[_0x2a63('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c4310,null))['then'](saveUpdates(_0x4821cc[_0x2a63('0x54')],null))[_0x2a63('0x24')](respondWithResult(_0x3c4310,null))['catch'](handleError(_0x3c4310,null));};exports[_0x2a63('0x27')]=function(_0x21cb3d,_0x32a43c){return db[_0x2a63('0x2e')][_0x2a63('0x49')]({'where':{'id':_0x21cb3d[_0x2a63('0x46')]['id']}})[_0x2a63('0x24')](handleEntityNotFound(_0x32a43c,null))[_0x2a63('0x24')](removeEntity(_0x32a43c,null))['catch'](handleError(_0x32a43c,null));};exports[_0x2a63('0x55')]=function(_0x6b5086,_0x1fc0db,_0x28c715){var _0x39dd50=require('../../config/schedule');return db[_0x2a63('0x2e')]['find']({'where':{'id':_0x6b5086[_0x2a63('0x46')]['id']},'raw':!![]})[_0x2a63('0x24')](handleEntityNotFound(_0x1fc0db,null))['then'](function(){_0x39dd50['run'](_0x6b5086['params']['id']);})[_0x2a63('0x24')](respondWithStatusCode(_0x1fc0db,null))[_0x2a63('0x51')](handleError(_0x1fc0db,null));}; \ No newline at end of file +var _0x352b=['sort','where','pick','filter','merge','name','options','includeAll','catch','length','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','html-pdf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','json','apply','reject','save','update','destroy','then','get','Scheduler','UserProfileResource','sendStatus','stack','send','index','map','Schedule','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','nolimit','order'];(function(_0x130706,_0x403dd3){var _0x3252c8=function(_0xd4e359){while(--_0xd4e359){_0x130706['push'](_0x130706['shift']());}};_0x3252c8(++_0x403dd3);}(_0x352b,0xf6));var _0xb352=function(_0x727249,_0x5d00d7){_0x727249=_0x727249-0x0;var _0x38709f=_0x352b[_0x727249];return _0x38709f;};'use strict';var pdf=require(_0xb352('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb352('0x1'));var jsonpatch=require(_0xb352('0x2'));var rp=require(_0xb352('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb352('0x4'));var util=require(_0xb352('0x5'));var path=require(_0xb352('0x6'));var sox=require(_0xb352('0x7'));var csv=require('to-csv');var ejs=require(_0xb352('0x8'));var fs=require('fs');var _=require(_0xb352('0x9'));var squel=require(_0xb352('0xa'));var crypto=require(_0xb352('0xb'));var jsforce=require(_0xb352('0xc'));var deskjs=require(_0xb352('0xd'));var toCsv=require(_0xb352('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb352('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb352('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb352('0x11'));var config=require(_0xb352('0x12'));var db=require(_0xb352('0x13'))['db'];function respondWithStatusCode(_0x22edca,_0x194daf){_0x194daf=_0x194daf||0xcc;return function(_0x2ee08b){if(_0x2ee08b){return _0x22edca['sendStatus'](_0x194daf);}return _0x22edca[_0xb352('0x14')](_0x194daf)[_0xb352('0x15')]();};}function respondWithResult(_0x510b1e,_0x2c8906){_0x2c8906=_0x2c8906||0xc8;return function(_0x58dc80){if(_0x58dc80){return _0x510b1e[_0xb352('0x14')](_0x2c8906)['json'](_0x58dc80);}};}function respondWithFilteredResult(_0x4e1fd8,_0x133e71){return function(_0x253531){if(_0x253531){var _0xa7afc8=_0x253531[_0xb352('0x16')],_0x56595e=_0x133e71[_0xb352('0x17')],_0x491e81=_0x133e71[_0xb352('0x17')]+_0x133e71[_0xb352('0x18')],_0x1a1d85;if(_0x491e81>=_0xa7afc8){_0x491e81=_0xa7afc8;_0x1a1d85=0xc8;}else{_0x1a1d85=0xce;}_0x4e1fd8[_0xb352('0x14')](_0x1a1d85);return _0x4e1fd8['set']('Content-Range',_0x56595e+'-'+_0x491e81+'/'+_0xa7afc8)[_0xb352('0x19')](_0x253531);}return null;};}function patchUpdates(_0x551ed7){return function(_0x1b6ec6){try{jsonpatch[_0xb352('0x1a')](_0x1b6ec6,_0x551ed7,!![]);}catch(_0x279e8f){return BPromise[_0xb352('0x1b')](_0x279e8f);}return _0x1b6ec6[_0xb352('0x1c')]();};}function saveUpdates(_0x2c7b54,_0x27d519){return function(_0x3678dd){if(_0x3678dd){return _0x3678dd[_0xb352('0x1d')](_0x2c7b54)['then'](function(_0x567fb7){return _0x567fb7;});}return null;};}function removeEntity(_0x3a397f,_0x4bdfa9){return function(_0x45e8e8){if(_0x45e8e8){return _0x45e8e8[_0xb352('0x1e')]()[_0xb352('0x1f')](function(){var _0x16f0fb=_0x45e8e8[_0xb352('0x20')]({'plain':!![]});var _0x15ac43=_0xb352('0x21');return db[_0xb352('0x22')][_0xb352('0x1e')]({'where':{'type':_0x15ac43,'resourceId':_0x16f0fb['id']}})[_0xb352('0x1f')](function(){return _0x45e8e8;});})[_0xb352('0x1f')](function(){_0x3a397f[_0xb352('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ba21f,_0x1d6e43){return function(_0x453a05){if(!_0x453a05){_0x5ba21f[_0xb352('0x23')](0x194);}return _0x453a05;};}function handleError(_0x530cda,_0x594ad2){_0x594ad2=_0x594ad2||0x1f4;return function(_0x3ce35b){logger['error'](_0x3ce35b[_0xb352('0x24')]);if(_0x3ce35b['name']){delete _0x3ce35b['name'];}_0x530cda[_0xb352('0x14')](_0x594ad2)[_0xb352('0x25')](_0x3ce35b);};}exports[_0xb352('0x26')]=function(_0x5494e2,_0x4fff8b){var _0x32e57f={},_0x4e18ea={},_0x6b60b8={'count':0x0,'rows':[]};var _0x5f4d1b=_[_0xb352('0x27')](db[_0xb352('0x28')][_0xb352('0x29')],function(_0x4a967e){return{'name':_0x4a967e[_0xb352('0x2a')],'type':_0x4a967e[_0xb352('0x2b')][_0xb352('0x2c')]};});_0x4e18ea['model']=_[_0xb352('0x27')](_0x5f4d1b,'name');_0x4e18ea[_0xb352('0x2d')]=_[_0xb352('0x2e')](_0x5494e2[_0xb352('0x2d')]);_0x4e18ea[_0xb352('0x2f')]=_[_0xb352('0x30')](_0x4e18ea[_0xb352('0x31')],_0x4e18ea[_0xb352('0x2d')]);_0x32e57f['attributes']=_[_0xb352('0x30')](_0x4e18ea[_0xb352('0x31')],qs[_0xb352('0x32')](_0x5494e2[_0xb352('0x2d')][_0xb352('0x32')]));_0x32e57f[_0xb352('0x33')]=_0x32e57f['attributes']['length']?_0x32e57f['attributes']:_0x4e18ea[_0xb352('0x31')];if(!_0x5494e2[_0xb352('0x2d')]['hasOwnProperty'](_0xb352('0x34'))){_0x32e57f[_0xb352('0x18')]=qs[_0xb352('0x18')](_0x5494e2['query'][_0xb352('0x18')]);_0x32e57f[_0xb352('0x17')]=qs[_0xb352('0x17')](_0x5494e2['query'][_0xb352('0x17')]);}_0x32e57f[_0xb352('0x35')]=qs['sort'](_0x5494e2['query'][_0xb352('0x36')]);_0x32e57f[_0xb352('0x37')]=qs['filters'](_[_0xb352('0x38')](_0x5494e2[_0xb352('0x2d')],_0x4e18ea[_0xb352('0x2f')]),_0x5f4d1b);if(_0x5494e2[_0xb352('0x2d')][_0xb352('0x39')]){_0x32e57f[_0xb352('0x37')]=_[_0xb352('0x3a')](_0x32e57f[_0xb352('0x37')],{'$or':_['map'](_0x5f4d1b,function(_0x1c9826){if(_0x1c9826[_0xb352('0x2b')]!=='VIRTUAL'){var _0x562b57={};_0x562b57[_0x1c9826[_0xb352('0x3b')]]={'$like':'%'+_0x5494e2['query'][_0xb352('0x39')]+'%'};return _0x562b57;}})});}_0x32e57f=_['merge']({},_0x32e57f,_0x5494e2[_0xb352('0x3c')]);var _0x694a93={'where':_0x32e57f[_0xb352('0x37')]};return db[_0xb352('0x28')]['count'](_0x694a93)['then'](function(_0x444dc5){_0x6b60b8['count']=_0x444dc5;if(_0x5494e2['query'][_0xb352('0x3d')]){_0x32e57f['include']=[{'all':!![]}];}return db[_0xb352('0x28')]['findAll'](_0x32e57f);})[_0xb352('0x1f')](function(_0x21c547){_0x6b60b8['rows']=_0x21c547;return _0x6b60b8;})['then'](respondWithFilteredResult(_0x4fff8b,_0x32e57f))[_0xb352('0x3e')](handleError(_0x4fff8b,null));};exports['show']=function(_0x51131b,_0x10e5f1){var _0xc86396={'raw':![],'where':{'id':_0x51131b['params']['id']}},_0x294ea9={};_0x294ea9[_0xb352('0x31')]=_[_0xb352('0x2e')](db[_0xb352('0x28')]['rawAttributes']);_0x294ea9[_0xb352('0x2d')]=_['keys'](_0x51131b[_0xb352('0x2d')]);_0x294ea9['filters']=_[_0xb352('0x30')](_0x294ea9[_0xb352('0x31')],_0x294ea9['query']);_0xc86396[_0xb352('0x33')]=_[_0xb352('0x30')](_0x294ea9['model'],qs[_0xb352('0x32')](_0x51131b[_0xb352('0x2d')][_0xb352('0x32')]));_0xc86396[_0xb352('0x33')]=_0xc86396[_0xb352('0x33')][_0xb352('0x3f')]?_0xc86396[_0xb352('0x33')]:_0x294ea9[_0xb352('0x31')];if(_0x51131b[_0xb352('0x2d')][_0xb352('0x3d')]){_0xc86396[_0xb352('0x40')]=[{'all':!![]}];}_0xc86396=_[_0xb352('0x3a')]({},_0xc86396,_0x51131b[_0xb352('0x3c')]);return db['Schedule'][_0xb352('0x41')](_0xc86396)[_0xb352('0x1f')](handleEntityNotFound(_0x10e5f1,null))[_0xb352('0x1f')](respondWithResult(_0x10e5f1,null))[_0xb352('0x3e')](handleError(_0x10e5f1,null));};exports[_0xb352('0x42')]=function(_0x462385,_0x43354b){return db[_0xb352('0x28')]['create'](_0x462385['body'],{})[_0xb352('0x1f')](function(_0x2f5007){var _0x33d635=_0x462385[_0xb352('0x43')]['get']({'plain':!![]});if(!_0x33d635)throw new Error(_0xb352('0x44'));if(_0x33d635['role']===_0xb352('0x43')){var _0x3b1022=_0x2f5007[_0xb352('0x20')]({'plain':!![]});var _0x31c1a4=_0xb352('0x21');return db[_0xb352('0x45')][_0xb352('0x41')]({'where':{'name':_0x31c1a4,'userProfileId':_0x33d635['userProfileId']},'raw':!![]})['then'](function(_0x4f2ecc){if(_0x4f2ecc&&_0x4f2ecc[_0xb352('0x46')]===0x0){return db[_0xb352('0x22')][_0xb352('0x42')]({'name':_0x3b1022[_0xb352('0x3b')],'resourceId':_0x3b1022['id'],'type':_0x4f2ecc[_0xb352('0x3b')],'sectionId':_0x4f2ecc['id']},{})[_0xb352('0x1f')](function(){return _0x2f5007;});}else{return _0x2f5007;}})[_0xb352('0x3e')](function(_0x17f226){logger['error'](_0xb352('0x47'),_0x17f226);throw _0x17f226;});}return _0x2f5007;})[_0xb352('0x1f')](respondWithResult(_0x43354b,0xc9))[_0xb352('0x3e')](handleError(_0x43354b,null));};exports['update']=function(_0x298922,_0x7ae6fb){if(_0x298922['body']['id']){delete _0x298922[_0xb352('0x48')]['id'];}return db['Schedule'][_0xb352('0x41')]({'where':{'id':_0x298922['params']['id']}})[_0xb352('0x1f')](handleEntityNotFound(_0x7ae6fb,null))[_0xb352('0x1f')](saveUpdates(_0x298922[_0xb352('0x48')],null))[_0xb352('0x1f')](respondWithResult(_0x7ae6fb,null))[_0xb352('0x3e')](handleError(_0x7ae6fb,null));};exports[_0xb352('0x1e')]=function(_0x47aaed,_0x28e56a){return db[_0xb352('0x28')][_0xb352('0x41')]({'where':{'id':_0x47aaed[_0xb352('0x49')]['id']}})[_0xb352('0x1f')](handleEntityNotFound(_0x28e56a,null))[_0xb352('0x1f')](removeEntity(_0x28e56a,null))[_0xb352('0x3e')](handleError(_0x28e56a,null));};exports[_0xb352('0x4a')]=function(_0x31c746,_0x4b3ac1,_0x198340){var _0x1e310f=require('../../config/schedule');return db[_0xb352('0x28')][_0xb352('0x41')]({'where':{'id':_0x31c746['params']['id']},'raw':!![]})[_0xb352('0x1f')](handleEntityNotFound(_0x4b3ac1,null))[_0xb352('0x1f')](function(){_0x1e310f[_0xb352('0x4a')](_0x31c746[_0xb352('0x49')]['id']);})[_0xb352('0x1f')](respondWithStatusCode(_0x4b3ac1,null))[_0xb352('0x3e')](handleError(_0x4b3ac1,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 8df3f6e..87fe599 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 _0x6211=['moment','bluebird','request-promise','path','rimraf','./schedule.attributes','exports','define','lodash','../../config/logger','api'];(function(_0x564a77,_0x49939d){var _0x16b00a=function(_0x34d429){while(--_0x34d429){_0x564a77['push'](_0x564a77['shift']());}};_0x16b00a(++_0x49939d);}(_0x6211,0x1aa));var _0x1621=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6211[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1621('0x0'));var util=require('util');var logger=require(_0x1621('0x1'))(_0x1621('0x2'));var moment=require(_0x1621('0x3'));var BPromise=require(_0x1621('0x4'));var rp=require(_0x1621('0x5'));var fs=require('fs');var path=require(_0x1621('0x6'));var rimraf=require(_0x1621('0x7'));var config=require('../../config/environment');var attributes=require(_0x1621('0x8'));module[_0x1621('0x9')]=function(_0x4a4688,_0x5df172){return _0x4a4688[_0x1621('0xa')]('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb8fb=['path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash','util','../../config/logger','api','moment'];(function(_0x421b5e,_0x53fefe){var _0x3dbeeb=function(_0x2f18e6){while(--_0x2f18e6){_0x421b5e['push'](_0x421b5e['shift']());}};_0x3dbeeb(++_0x53fefe);}(_0xb8fb,0xeb));var _0xbb8f=function(_0x22f481,_0x53b402){_0x22f481=_0x22f481-0x0;var _0x4d3470=_0xb8fb[_0x22f481];return _0x4d3470;};'use strict';var _=require(_0xbb8f('0x0'));var util=require(_0xbb8f('0x1'));var logger=require(_0xbb8f('0x2'))(_0xbb8f('0x3'));var moment=require(_0xbb8f('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb8f('0x5'));var rimraf=require(_0xbb8f('0x6'));var config=require(_0xbb8f('0x7'));var attributes=require(_0xbb8f('0x8'));module[_0xbb8f('0x9')]=function(_0x610c1e,_0x1accb8){return _0x610c1e[_0xbb8f('0xa')](_0xbb8f('0xb'),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 d20a339..a82c11d 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 _0xb802=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x388fba,_0x2b1369){var _0x4523ce=function(_0x23a1d4){while(--_0x23a1d4){_0x388fba['push'](_0x388fba['shift']());}};_0x4523ce(++_0x2b1369);}(_0xb802,0x18d));var _0x2b80=function(_0x1429bd,_0x562cd3){_0x1429bd=_0x1429bd-0x0;var _0x31f1b7=_0xb802[_0x1429bd];return _0x31f1b7;};'use strict';var _=require(_0x2b80('0x0'));var util=require(_0x2b80('0x1'));var moment=require('moment');var BPromise=require(_0x2b80('0x2'));var rs=require(_0x2b80('0x3'));var fs=require('fs');var Redis=require(_0x2b80('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b80('0x5'));var logger=require('../../config/logger')(_0x2b80('0x6'));var config=require(_0x2b80('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2b80('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55b40f,_0x4e1128,_0xf76899){return new BPromise(function(_0x148016,_0x13522c){return client[_0x2b80('0x9')](_0x55b40f,_0xf76899)[_0x2b80('0xa')](function(_0x51587b){logger[_0x2b80('0xb')](_0x2b80('0xc'),_0x4e1128,_0x2b80('0xd'));logger[_0x2b80('0xe')]('Schedule,\x20%s,\x20%s,\x20%s',_0x4e1128,_0x2b80('0xd'),JSON[_0x2b80('0xf')](_0x51587b));if(_0x51587b[_0x2b80('0x10')]){if(_0x51587b[_0x2b80('0x10')][_0x2b80('0x11')]===0x1f4){logger[_0x2b80('0x10')](_0x2b80('0xc'),_0x4e1128,_0x51587b[_0x2b80('0x10')][_0x2b80('0x12')]);return _0x13522c(_0x51587b[_0x2b80('0x10')][_0x2b80('0x12')]);}logger[_0x2b80('0x10')]('Schedule,\x20%s,\x20%s',_0x4e1128,_0x51587b[_0x2b80('0x10')]['message']);return _0x148016(_0x51587b[_0x2b80('0x10')][_0x2b80('0x12')]);}else{logger[_0x2b80('0xb')]('Schedule,\x20%s,\x20%s',_0x4e1128,'request\x20sent');_0x148016(_0x51587b[_0x2b80('0x13')][_0x2b80('0x12')]);}})[_0x2b80('0x14')](function(_0x7260c1){logger[_0x2b80('0x10')](_0x2b80('0xc'),_0x4e1128,_0x7260c1);_0x13522c(_0x7260c1);});});} \ No newline at end of file +var _0xedb4=['then','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','code','error','message','Schedule,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xedb4,0xe8));var _0x4edb=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0xedb4[_0x1f8053];return _0x174fd8;};'use strict';var _=require(_0x4edb('0x0'));var util=require(_0x4edb('0x1'));var moment=require(_0x4edb('0x2'));var BPromise=require(_0x4edb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4edb('0x4'));var db=require(_0x4edb('0x5'))['db'];var utils=require(_0x4edb('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4edb('0x7'));var client=jayson['client'][_0x4edb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xecd172,_0x306cd8,_0x51d8db){return new BPromise(function(_0x479915,_0x1a4ad3){return client[_0x4edb('0x9')](_0xecd172,_0x51d8db)[_0x4edb('0xa')](function(_0x10bc7e){logger['info']('Schedule,\x20%s,\x20%s',_0x306cd8,_0x4edb('0xb'));logger[_0x4edb('0xc')](_0x4edb('0xd'),_0x306cd8,_0x4edb('0xb'),JSON[_0x4edb('0xe')](_0x10bc7e));if(_0x10bc7e['error']){if(_0x10bc7e['error'][_0x4edb('0xf')]===0x1f4){logger[_0x4edb('0x10')]('Schedule,\x20%s,\x20%s',_0x306cd8,_0x10bc7e['error'][_0x4edb('0x11')]);return _0x1a4ad3(_0x10bc7e['error'][_0x4edb('0x11')]);}logger['error'](_0x4edb('0x12'),_0x306cd8,_0x10bc7e['error'][_0x4edb('0x11')]);return _0x479915(_0x10bc7e[_0x4edb('0x10')][_0x4edb('0x11')]);}else{logger[_0x4edb('0x13')]('Schedule,\x20%s,\x20%s',_0x306cd8,_0x4edb('0xb'));_0x479915(_0x10bc7e[_0x4edb('0x14')][_0x4edb('0x11')]);}})[_0x4edb('0x15')](function(_0x34ecbb){logger[_0x4edb('0x10')]('Schedule,\x20%s,\x20%s',_0x306cd8,_0x34ecbb);_0x1a4ad3(_0x34ecbb);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index b4aa57a..b73bde7 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 _0x33dc=['../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','describe','/:id','show','/:id/download','download','post','create','put','update','exports','util','path','express','Router','../../components/auth/service'];(function(_0x16801b,_0x346f2b){var _0x527ebe=function(_0x2e0341){while(--_0x2e0341){_0x16801b['push'](_0x16801b['shift']());}};_0x527ebe(++_0x346f2b);}(_0x33dc,0x1ef));var _0xc33d=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0x33dc[_0x29bf80];return _0x932096;};'use strict';var multer=require('multer');var util=require(_0xc33d('0x0'));var path=require(_0xc33d('0x1'));var timeout=require('connect-timeout');var express=require(_0xc33d('0x2'));var router=express[_0xc33d('0x3')]();var auth=require(_0xc33d('0x4'));var interaction=require(_0xc33d('0x5'));var config=require(_0xc33d('0x6'));var controller=require(_0xc33d('0x7'));router[_0xc33d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc33d('0x8')]('/describe',auth[_0xc33d('0x9')](),controller[_0xc33d('0xa')]);router['get'](_0xc33d('0xb'),auth['isAuthenticated'](),controller[_0xc33d('0xc')]);router[_0xc33d('0x8')](_0xc33d('0xd'),auth[_0xc33d('0x9')](),controller[_0xc33d('0xe')]);router[_0xc33d('0xf')]('/',auth[_0xc33d('0x9')](),controller[_0xc33d('0x10')]);router[_0xc33d('0x11')](_0xc33d('0xb'),auth['isAuthenticated'](),controller[_0xc33d('0x12')]);router['delete'](_0xc33d('0xb'),auth[_0xc33d('0x9')](),controller['destroy']);module[_0xc33d('0x13')]=router; \ No newline at end of file +var _0xd04c=['delete','destroy','exports','util','express','Router','../../components/interaction/service','../../config/environment','./screenRecording.controller','/describe','isAuthenticated','get','/:id','show','/:id/download','post'];(function(_0x58a183,_0x4fbc2b){var _0x322e63=function(_0x175164){while(--_0x175164){_0x58a183['push'](_0x58a183['shift']());}};_0x322e63(++_0x4fbc2b);}(_0xd04c,0x133));var _0xcd04=function(_0x471fb4,_0x452a5c){_0x471fb4=_0x471fb4-0x0;var _0x430c84=_0xd04c[_0x471fb4];return _0x430c84;};'use strict';var multer=require('multer');var util=require(_0xcd04('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcd04('0x1'));var router=express[_0xcd04('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xcd04('0x3'));var config=require(_0xcd04('0x4'));var controller=require(_0xcd04('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xcd04('0x6'),auth[_0xcd04('0x7')](),controller['describe']);router[_0xcd04('0x8')](_0xcd04('0x9'),auth[_0xcd04('0x7')](),controller[_0xcd04('0xa')]);router[_0xcd04('0x8')](_0xcd04('0xb'),auth[_0xcd04('0x7')](),controller['download']);router[_0xcd04('0xc')]('/',auth[_0xcd04('0x7')](),controller['create']);router['put'](_0xcd04('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xcd04('0xd')](_0xcd04('0x9'),auth['isAuthenticated'](),controller[_0xcd04('0xe')]);module[_0xcd04('0xf')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 2473e79..c8402ed 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 _0x8d0e=['INTEGER','startedAt','subtract','duration','DATE','format','toString','closedAt','createdAt','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue'];(function(_0x4e2f70,_0x3f34fb){var _0x4b9478=function(_0x21e5bc){while(--_0x21e5bc){_0x4e2f70['push'](_0x4e2f70['shift']());}};_0x4b9478(++_0x3f34fb);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1541b4,_0x36375a){_0x1541b4=_0x1541b4-0x0;var _0x396cc9=_0x8d0e[_0x1541b4];return _0x396cc9;};'use strict';var Sequelize=require(_0xe8d0('0x0'));var moment=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var config=require(_0xe8d0('0x3'));module[_0xe8d0('0x4')]={'format':{'type':Sequelize[_0xe8d0('0x5')],'get':function(){return this[_0xe8d0('0x6')](_0xe8d0('0x7'))?path[_0xe8d0('0x8')](this['getDataValue'](_0xe8d0('0x7'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xe8d0('0x9')],'set':function(_0x92483d){var _0x469d37=_0x92483d[_0xe8d0('0xa')](/\\/g,'/');this[_0xe8d0('0xb')](_0xe8d0('0x7'),_0x469d37);}},'rating':{'type':Sequelize[_0xe8d0('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xe8d0('0xc')],'set':function(_0x5605a0){this[_0xe8d0('0xb')](_0xe8d0('0xd'),moment()[_0xe8d0('0xe')](_0x5605a0,'ms'));this['setDataValue']('closedAt',moment());this[_0xe8d0('0xb')](_0xe8d0('0xf'),_0x5605a0);}},'startedAt':{'type':Sequelize[_0xe8d0('0x10')],'get':function(){return moment(this[_0xe8d0('0x6')](_0xe8d0('0xd')))[_0xe8d0('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xe8d0('0x12')]();}},'closedAt':{'type':Sequelize[_0xe8d0('0x10')],'get':function(){return moment(this['getDataValue'](_0xe8d0('0x13')))['format']('MM-DD-YYYY\x20HH:mm')[_0xe8d0('0x12')]();}},'createdAt':{'type':Sequelize[_0xe8d0('0x10')],'get':function(){return moment(this[_0xe8d0('0x6')](_0xe8d0('0x14')))[_0xe8d0('0x11')](_0xe8d0('0x15'))['toString']();}},'updatedAt':{'type':Sequelize[_0xe8d0('0x10')],'get':function(){return moment(this['getDataValue'](_0xe8d0('0x16')))[_0xe8d0('0x11')](_0xe8d0('0x15'))['toString']();}}}; \ No newline at end of file +var _0xed1f=['duration','format','toString','closedAt','createdAt','MM-DD-YYYY\x20HH:mm','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt'];(function(_0x3a3d01,_0x3751ef){var _0x39e5ac=function(_0x134224){while(--_0x134224){_0x3a3d01['push'](_0x3a3d01['shift']());}};_0x39e5ac(++_0x3751ef);}(_0xed1f,0x6a));var _0xfed1=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xed1f[_0x12f688];return _0x59c3de;};'use strict';var Sequelize=require(_0xfed1('0x0'));var moment=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var config=require(_0xfed1('0x3'));module[_0xfed1('0x4')]={'format':{'type':Sequelize[_0xfed1('0x5')],'get':function(){return this[_0xfed1('0x6')](_0xfed1('0x7'))?path[_0xfed1('0x8')](this[_0xfed1('0x6')](_0xfed1('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xfed1('0x9')]},'channel':{'type':Sequelize[_0xfed1('0x9')]},'value':{'type':Sequelize[_0xfed1('0x9')],'set':function(_0x380e18){var _0x612b38=_0x380e18[_0xfed1('0xa')](/\\/g,'/');this[_0xfed1('0xb')]('value',_0x612b38);}},'rating':{'type':Sequelize[_0xfed1('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xfed1('0xc')],'set':function(_0x48862d){this[_0xfed1('0xb')](_0xfed1('0xd'),moment()['subtract'](_0x48862d,'ms'));this[_0xfed1('0xb')]('closedAt',moment());this[_0xfed1('0xb')](_0xfed1('0xe'),_0x48862d);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xfed1('0xd')))[_0xfed1('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xfed1('0x10')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xfed1('0x11')))[_0xfed1('0xf')]('MM-DD-YYYY\x20HH:mm')[_0xfed1('0x10')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xfed1('0x12')))[_0xfed1('0xf')](_0xfed1('0x13'))[_0xfed1('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xfed1('0x6')]('updatedAt'))[_0xfed1('0xf')](_0xfed1('0x13'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index f73ff02..0ad8ffb 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 _0x7f3f=['type','key','model','format','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','offset','sort','where','merge','options','includeAll','findAll','catch','show','keys','ScreenRecording','length','include','find','body','duration','createdAt','closedAt','params','describe','download','../../components/encryptor','join','root','server/files/screen_recordings','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','sendStatus','status','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x4566db,_0x5da9a1){_0x4566db=_0x4566db-0x0;var _0x3167e6=_0x7f3f[_0x4566db];return _0x3167e6;};'use strict';var pdf=require(_0xf7f3('0x0'));var emlformat=require(_0xf7f3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf7f3('0x2'));var jsonpatch=require(_0xf7f3('0x3'));var rp=require(_0xf7f3('0x4'));var moment=require(_0xf7f3('0x5'));var BPromise=require(_0xf7f3('0x6'));var Mustache=require('mustache');var util=require(_0xf7f3('0x7'));var path=require(_0xf7f3('0x8'));var sox=require('sox');var csv=require(_0xf7f3('0x9'));var ejs=require(_0xf7f3('0xa'));var fs=require('fs');var _=require(_0xf7f3('0xb'));var squel=require(_0xf7f3('0xc'));var crypto=require(_0xf7f3('0xd'));var jsforce=require(_0xf7f3('0xe'));var deskjs=require(_0xf7f3('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf7f3('0x10'));var Papa=require(_0xf7f3('0x11'));var Redis=require(_0xf7f3('0x12'));var authService=require(_0xf7f3('0x13'));var qs=require(_0xf7f3('0x14'));var as=require(_0xf7f3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf7f3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x152f24,_0x1517e9){_0x1517e9=_0x1517e9||0xcc;return function(_0x3a6dd6){if(_0x3a6dd6){return _0x152f24[_0xf7f3('0x17')](_0x1517e9);}return _0x152f24[_0xf7f3('0x18')](_0x1517e9)['end']();};}function respondWithResult(_0x110ac1,_0xf0ff50){_0xf0ff50=_0xf0ff50||0xc8;return function(_0x54bdcd){if(_0x54bdcd){return _0x110ac1['status'](_0xf0ff50)['json'](_0x54bdcd);}};}function respondWithFilteredResult(_0x5092a7,_0x56284c){return function(_0x3527d7){if(_0x3527d7){var _0x152553=_0x3527d7[_0xf7f3('0x19')],_0x4fdbba=_0x56284c['offset'],_0x18ff20=_0x56284c['offset']+_0x56284c[_0xf7f3('0x1a')],_0x1e6296;if(_0x18ff20>=_0x152553){_0x18ff20=_0x152553;_0x1e6296=0xc8;}else{_0x1e6296=0xce;}_0x5092a7[_0xf7f3('0x18')](_0x1e6296);return _0x5092a7[_0xf7f3('0x1b')](_0xf7f3('0x1c'),_0x4fdbba+'-'+_0x18ff20+'/'+_0x152553)[_0xf7f3('0x1d')](_0x3527d7);}return null;};}function patchUpdates(_0x21308e){return function(_0x54743f){try{jsonpatch[_0xf7f3('0x1e')](_0x54743f,_0x21308e,!![]);}catch(_0x5f3a51){return BPromise[_0xf7f3('0x1f')](_0x5f3a51);}return _0x54743f[_0xf7f3('0x20')]();};}function saveUpdates(_0x1a1780,_0x27be37){return function(_0x3ee508){if(_0x3ee508){return _0x3ee508[_0xf7f3('0x21')](_0x1a1780)[_0xf7f3('0x22')](function(_0x1ee3d7){return _0x1ee3d7;});}return null;};}function removeEntity(_0x51316c,_0x100871){return function(_0x22a1a1){if(_0x22a1a1){return _0x22a1a1[_0xf7f3('0x23')]()[_0xf7f3('0x22')](function(){_0x51316c[_0xf7f3('0x18')](0xcc)[_0xf7f3('0x24')]();});}};}function handleEntityNotFound(_0x3509b2,_0x27fb56){return function(_0x1c3069){if(!_0x1c3069){_0x3509b2[_0xf7f3('0x17')](0x194);}return _0x1c3069;};}function handleError(_0x935eb0,_0x26ea2e){_0x26ea2e=_0x26ea2e||0x1f4;return function(_0x3c7ba8){logger['error'](_0x3c7ba8[_0xf7f3('0x25')]);if(_0x3c7ba8[_0xf7f3('0x26')]){delete _0x3c7ba8[_0xf7f3('0x26')];}_0x935eb0[_0xf7f3('0x18')](_0x26ea2e)[_0xf7f3('0x27')](_0x3c7ba8);};}exports[_0xf7f3('0x28')]=function(_0x1c17d6,_0x4bb381){var _0x33d333={},_0x8c2161={},_0x4a176d={'count':0x0,'rows':[]};var _0x55507d=_[_0xf7f3('0x29')](db['ScreenRecording'][_0xf7f3('0x2a')],function(_0x3e1f8e){return{'name':_0x3e1f8e[_0xf7f3('0x2b')],'type':_0x3e1f8e[_0xf7f3('0x2c')][_0xf7f3('0x2d')]};});_0x8c2161[_0xf7f3('0x2e')]=_['differenceBy'](_[_0xf7f3('0x29')](_0x55507d,_0xf7f3('0x26')),[_0xf7f3('0x2f')]);_0x8c2161['query']=_['keys'](_0x1c17d6['query']);_0x8c2161[_0xf7f3('0x30')]=_[_0xf7f3('0x31')](_0x8c2161[_0xf7f3('0x2e')],_0x8c2161[_0xf7f3('0x32')]);_0x33d333['attributes']=_['intersection'](_0x8c2161['model'],qs[_0xf7f3('0x33')](_0x1c17d6[_0xf7f3('0x32')]['fields']));_0x33d333[_0xf7f3('0x34')]=_0x33d333['attributes']['length']?_0x33d333[_0xf7f3('0x34')]:_0x8c2161[_0xf7f3('0x2e')];if(!_0x1c17d6[_0xf7f3('0x32')][_0xf7f3('0x35')](_0xf7f3('0x36'))){_0x33d333[_0xf7f3('0x1a')]=qs[_0xf7f3('0x1a')](_0x1c17d6['query'][_0xf7f3('0x1a')]);_0x33d333[_0xf7f3('0x37')]=qs['offset'](_0x1c17d6[_0xf7f3('0x32')]['offset']);}_0x33d333['order']=qs[_0xf7f3('0x38')](_0x1c17d6['query']['sort']);_0x33d333['where']=qs[_0xf7f3('0x30')](_['pick'](_0x1c17d6['query'],_0x8c2161[_0xf7f3('0x30')]),_0x55507d);if(_0x1c17d6[_0xf7f3('0x32')]['filter']){_0x33d333[_0xf7f3('0x39')]=_[_0xf7f3('0x3a')](_0x33d333[_0xf7f3('0x39')],{'$or':_[_0xf7f3('0x29')](_0x55507d,function(_0x4502bb){if(_0x4502bb[_0xf7f3('0x2c')]!=='VIRTUAL'){var _0x1b41ce={};_0x1b41ce[_0x4502bb['name']]={'$like':'%'+_0x1c17d6[_0xf7f3('0x32')]['filter']+'%'};return _0x1b41ce;}})});}_0x33d333=_[_0xf7f3('0x3a')]({},_0x33d333,_0x1c17d6[_0xf7f3('0x3b')]);var _0x325bb2={'where':_0x33d333[_0xf7f3('0x39')]};return db['ScreenRecording'][_0xf7f3('0x19')](_0x325bb2)[_0xf7f3('0x22')](function(_0x39dee0){_0x4a176d[_0xf7f3('0x19')]=_0x39dee0;if(_0x1c17d6[_0xf7f3('0x32')][_0xf7f3('0x3c')]){_0x33d333['include']=[{'all':!![]}];}return db['ScreenRecording'][_0xf7f3('0x3d')](_0x33d333);})['then'](function(_0x2b391f){_0x4a176d['rows']=_0x2b391f;return _0x4a176d;})['then'](respondWithFilteredResult(_0x4bb381,_0x33d333))[_0xf7f3('0x3e')](handleError(_0x4bb381,null));};exports[_0xf7f3('0x3f')]=function(_0x5d7c72,_0x14b2da){var _0x3bd337={'raw':![],'where':{'id':_0x5d7c72['params']['id']}},_0x291401={};_0x291401[_0xf7f3('0x2e')]=_[_0xf7f3('0x40')](db[_0xf7f3('0x41')][_0xf7f3('0x2a')]);_0x291401[_0xf7f3('0x32')]=_[_0xf7f3('0x40')](_0x5d7c72[_0xf7f3('0x32')]);_0x291401['filters']=_['intersection'](_0x291401['model'],_0x291401[_0xf7f3('0x32')]);_0x3bd337[_0xf7f3('0x34')]=_[_0xf7f3('0x31')](_0x291401[_0xf7f3('0x2e')],qs[_0xf7f3('0x33')](_0x5d7c72['query'][_0xf7f3('0x33')]));_0x3bd337[_0xf7f3('0x34')]=_0x3bd337[_0xf7f3('0x34')][_0xf7f3('0x42')]?_0x3bd337['attributes']:_0x291401[_0xf7f3('0x2e')];if(_0x5d7c72[_0xf7f3('0x32')][_0xf7f3('0x3c')]){_0x3bd337[_0xf7f3('0x43')]=[{'all':!![]}];}_0x3bd337=_['merge']({},_0x3bd337,_0x5d7c72['options']);return db[_0xf7f3('0x41')][_0xf7f3('0x44')](_0x3bd337)[_0xf7f3('0x22')](handleEntityNotFound(_0x14b2da,null))['then'](respondWithResult(_0x14b2da,null))['catch'](handleError(_0x14b2da,null));};exports['create']=function(_0x4a13ab,_0x2342f3){return db['ScreenRecording']['create'](_0x4a13ab[_0xf7f3('0x45')],{})['then'](respondWithResult(_0x2342f3,0xc9))['catch'](handleError(_0x2342f3,null));};exports['update']=function(_0x32e024,_0x4b31a5){if(_0x32e024[_0xf7f3('0x45')]['id']){delete _0x32e024['body']['id'];}delete _0x32e024[_0xf7f3('0x45')][_0xf7f3('0x46')];delete _0x32e024[_0xf7f3('0x45')][_0xf7f3('0x47')];delete _0x32e024[_0xf7f3('0x45')][_0xf7f3('0x48')];delete _0x32e024[_0xf7f3('0x45')]['value'];return db[_0xf7f3('0x41')]['find']({'where':{'id':_0x32e024[_0xf7f3('0x49')]['id']}})['then'](handleEntityNotFound(_0x4b31a5,null))[_0xf7f3('0x22')](saveUpdates(_0x32e024[_0xf7f3('0x45')],null))[_0xf7f3('0x22')](respondWithResult(_0x4b31a5,null))[_0xf7f3('0x3e')](handleError(_0x4b31a5,null));};exports[_0xf7f3('0x4a')]=function(_0x24af10,_0x6eac67){return db[_0xf7f3('0x41')][_0xf7f3('0x4a')]()['then'](respondWithResult(_0x6eac67,null))['catch'](handleError(_0x6eac67,null));};exports[_0xf7f3('0x4b')]=function(_0x32c159,_0x4e4d9f,_0x476f7f){var _0x4871fe=require(_0xf7f3('0x4c'));var _0x3bf99b=![];var _0x4493b4={};if(_0x32c159[_0xf7f3('0x32')][_0xf7f3('0x2c')]&&_0x32c159[_0xf7f3('0x32')][_0xf7f3('0x2c')]==='uniqueid'){_0x4493b4['uniqueid']=_0x32c159[_0xf7f3('0x49')]['id'];}else{_0x4493b4['id']=_0x32c159[_0xf7f3('0x49')]['id'];}return db[_0xf7f3('0x41')][_0xf7f3('0x44')]({'where':_0x4493b4,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x4e4d9f,null))[_0xf7f3('0x22')](function(_0x32f145){if(_0x32f145){var _0x4ea88f=path[_0xf7f3('0x4d')](config[_0xf7f3('0x4e')],_0xf7f3('0x4f'),_0x32f145[_0xf7f3('0x50')]);var _0x137bb0=util[_0xf7f3('0x2f')](_0xf7f3('0x51'),_0x4ea88f);if(fs[_0xf7f3('0x52')](_0x137bb0)){_0x3bf99b=!![];return _0x4871fe[_0xf7f3('0x53')](_0x137bb0,_0x4ea88f,config[_0xf7f3('0x54')][_0xf7f3('0x55')])[_0xf7f3('0x22')](function(){return _0x32f145;});}return _0x32f145;}})[_0xf7f3('0x22')](function(_0x548412){if(_0x548412){var _0x19be2b=path[_0xf7f3('0x4d')](config[_0xf7f3('0x4e')],_0xf7f3('0x4f'),_0x548412['value']);if(!fs[_0xf7f3('0x52')](_0x19be2b)){throw new db[(_0xf7f3('0x56'))]['ValidationError'](_0xf7f3('0x57'));}if(_0x548412[_0xf7f3('0x58')]){return _0x4e4d9f[_0xf7f3('0x4b')](_0x19be2b,_0x548412['filename']+path[_0xf7f3('0x59')](_0x19be2b),function(){if(_0x3bf99b){fs[_0xf7f3('0x5a')](_0x19be2b);}});}else{return _0x4e4d9f[_0xf7f3('0x4b')](_0x19be2b,function(_0x224ca5){if(_0x3bf99b){fs['unlink'](_0x19be2b);}});}}})[_0xf7f3('0x3e')](function(_0x44280b){if(_0x44280b[_0xf7f3('0x5b')]===_0xf7f3('0x57')){_0x4e4d9f[_0xf7f3('0x18')](0x194)['send'](_0xf7f3('0x5c'));}else{return handleError(_0x4e4d9f,null);}});};exports[_0xf7f3('0x23')]=function(_0x5b1e35,_0x3eca4e){return db[_0xf7f3('0x41')][_0xf7f3('0x44')]({'where':{'id':_0x5b1e35[_0xf7f3('0x49')]['id']}})[_0xf7f3('0x22')](function(_0x5d2f90){if(!_0x5d2f90)throw new ReferenceError(_0xf7f3('0x5d'));return _0x5d2f90;})[_0xf7f3('0x22')](function(_0x3bbd80){var _0x44d28b=path[_0xf7f3('0x4d')](config['root'],_0xf7f3('0x4f'),_0x3bbd80[_0xf7f3('0x50')]);logger[_0xf7f3('0x5e')]('cancellazione\x20fisica\x20documento\x20%s',_0x44d28b);if(!_[_0xf7f3('0x5f')](_0x3bbd80[_0xf7f3('0x50')])&&fs['existsSync'](_0x44d28b)){logger[_0xf7f3('0x5e')](_0xf7f3('0x60')+_0x44d28b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xf7f3('0x61')](_0x44d28b);}_0x44d28b=_0x44d28b+_0xf7f3('0x62');if(!_[_0xf7f3('0x5f')](_0x3bbd80['value'])&&fs[_0xf7f3('0x52')](_0x44d28b)){logger[_0xf7f3('0x5e')](_0xf7f3('0x60')+_0x44d28b+_0xf7f3('0x63'));fs[_0xf7f3('0x61')](_0x44d28b);}return _0x3bbd80;})['then'](function(_0x2c65e0){if(!_0x2c65e0)throw new InternalError();return _0x2c65e0[_0xf7f3('0x23')]();})[_0xf7f3('0x22')](function(){_0x3eca4e[_0xf7f3('0x18')](0xcc)['end']();})['catch'](handleError(_0x3eca4e,null));}; \ No newline at end of file +var _0x50e8=['../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','filename','extname','unlink','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','.cypher','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','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','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','show','params','options','find','catch','create','body','duration','createdAt','closedAt','describe','download'];(function(_0x1d714b,_0x42e8e5){var _0x873388=function(_0x43c460){while(--_0x43c460){_0x1d714b['push'](_0x1d714b['shift']());}};_0x873388(++_0x42e8e5);}(_0x50e8,0x147));var _0x850e=function(_0x5401ae,_0x5e58ac){_0x5401ae=_0x5401ae-0x0;var _0x286068=_0x50e8[_0x5401ae];return _0x286068;};'use strict';var pdf=require(_0x850e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x850e('0x1'));var zipdir=require(_0x850e('0x2'));var jsonpatch=require(_0x850e('0x3'));var rp=require('request-promise');var moment=require(_0x850e('0x4'));var BPromise=require(_0x850e('0x5'));var Mustache=require(_0x850e('0x6'));var util=require(_0x850e('0x7'));var path=require('path');var sox=require(_0x850e('0x8'));var csv=require(_0x850e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x850e('0xa'));var squel=require(_0x850e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x850e('0xc'));var toCsv=require(_0x850e('0x9'));var querystring=require(_0x850e('0xd'));var Papa=require(_0x850e('0xe'));var Redis=require(_0x850e('0xf'));var authService=require(_0x850e('0x10'));var qs=require(_0x850e('0x11'));var as=require(_0x850e('0x12'));var hardwareService=require(_0x850e('0x13'));var logger=require(_0x850e('0x14'))(_0x850e('0x15'));var utils=require(_0x850e('0x16'));var config=require('../../config/environment');var db=require(_0x850e('0x17'))['db'];function respondWithStatusCode(_0x534526,_0x22d9dc){_0x22d9dc=_0x22d9dc||0xcc;return function(_0x11f046){if(_0x11f046){return _0x534526[_0x850e('0x18')](_0x22d9dc);}return _0x534526[_0x850e('0x19')](_0x22d9dc)[_0x850e('0x1a')]();};}function respondWithResult(_0x4d7a0d,_0x2e46c6){_0x2e46c6=_0x2e46c6||0xc8;return function(_0x2faf90){if(_0x2faf90){return _0x4d7a0d['status'](_0x2e46c6)[_0x850e('0x1b')](_0x2faf90);}};}function respondWithFilteredResult(_0x29d336,_0x425a42){return function(_0x139915){if(_0x139915){var _0x36a199=_0x139915['count'],_0x17f30d=_0x425a42[_0x850e('0x1c')],_0x4fde5c=_0x425a42[_0x850e('0x1c')]+_0x425a42['limit'],_0x8bc23d;if(_0x4fde5c>=_0x36a199){_0x4fde5c=_0x36a199;_0x8bc23d=0xc8;}else{_0x8bc23d=0xce;}_0x29d336[_0x850e('0x19')](_0x8bc23d);return _0x29d336[_0x850e('0x1d')](_0x850e('0x1e'),_0x17f30d+'-'+_0x4fde5c+'/'+_0x36a199)[_0x850e('0x1b')](_0x139915);}return null;};}function patchUpdates(_0x272a12){return function(_0x30b91c){try{jsonpatch[_0x850e('0x1f')](_0x30b91c,_0x272a12,!![]);}catch(_0x13c43f){return BPromise[_0x850e('0x20')](_0x13c43f);}return _0x30b91c[_0x850e('0x21')]();};}function saveUpdates(_0x968c02,_0x3240a3){return function(_0x494655){if(_0x494655){return _0x494655[_0x850e('0x22')](_0x968c02)[_0x850e('0x23')](function(_0x154082){return _0x154082;});}return null;};}function removeEntity(_0x59ffe4,_0x1ec809){return function(_0x5621bc){if(_0x5621bc){return _0x5621bc[_0x850e('0x24')]()[_0x850e('0x23')](function(){_0x59ffe4[_0x850e('0x19')](0xcc)[_0x850e('0x1a')]();});}};}function handleEntityNotFound(_0x3e0222,_0x286dea){return function(_0xce0a96){if(!_0xce0a96){_0x3e0222['sendStatus'](0x194);}return _0xce0a96;};}function handleError(_0x363b20,_0x37757e){_0x37757e=_0x37757e||0x1f4;return function(_0x3e9ea4){logger[_0x850e('0x25')](_0x3e9ea4[_0x850e('0x26')]);if(_0x3e9ea4[_0x850e('0x27')]){delete _0x3e9ea4[_0x850e('0x27')];}_0x363b20['status'](_0x37757e)[_0x850e('0x28')](_0x3e9ea4);};}exports['index']=function(_0x1b4187,_0x402d12){var _0x209d58={},_0x24a4f0={},_0x37a03e={'count':0x0,'rows':[]};var _0x8aad4c=_[_0x850e('0x29')](db[_0x850e('0x2a')][_0x850e('0x2b')],function(_0x479cde){return{'name':_0x479cde[_0x850e('0x2c')],'type':_0x479cde[_0x850e('0x2d')][_0x850e('0x2e')]};});_0x24a4f0[_0x850e('0x2f')]=_[_0x850e('0x30')](_['map'](_0x8aad4c,_0x850e('0x27')),[_0x850e('0x31')]);_0x24a4f0[_0x850e('0x32')]=_[_0x850e('0x33')](_0x1b4187['query']);_0x24a4f0[_0x850e('0x34')]=_[_0x850e('0x35')](_0x24a4f0[_0x850e('0x2f')],_0x24a4f0[_0x850e('0x32')]);_0x209d58[_0x850e('0x36')]=_[_0x850e('0x35')](_0x24a4f0[_0x850e('0x2f')],qs['fields'](_0x1b4187['query'][_0x850e('0x37')]));_0x209d58[_0x850e('0x36')]=_0x209d58[_0x850e('0x36')]['length']?_0x209d58[_0x850e('0x36')]:_0x24a4f0['model'];if(!_0x1b4187[_0x850e('0x32')]['hasOwnProperty'](_0x850e('0x38'))){_0x209d58[_0x850e('0x39')]=qs[_0x850e('0x39')](_0x1b4187[_0x850e('0x32')]['limit']);_0x209d58[_0x850e('0x1c')]=qs[_0x850e('0x1c')](_0x1b4187[_0x850e('0x32')][_0x850e('0x1c')]);}_0x209d58[_0x850e('0x3a')]=qs[_0x850e('0x3b')](_0x1b4187[_0x850e('0x32')][_0x850e('0x3b')]);_0x209d58[_0x850e('0x3c')]=qs[_0x850e('0x34')](_[_0x850e('0x3d')](_0x1b4187['query'],_0x24a4f0[_0x850e('0x34')]),_0x8aad4c);if(_0x1b4187['query'][_0x850e('0x3e')]){_0x209d58['where']=_[_0x850e('0x3f')](_0x209d58[_0x850e('0x3c')],{'$or':_['map'](_0x8aad4c,function(_0x5234e2){if(_0x5234e2[_0x850e('0x2d')]!==_0x850e('0x40')){var _0x4f99d2={};_0x4f99d2[_0x5234e2['name']]={'$like':'%'+_0x1b4187[_0x850e('0x32')]['filter']+'%'};return _0x4f99d2;}})});}_0x209d58=_[_0x850e('0x3f')]({},_0x209d58,_0x1b4187['options']);var _0x2be051={'where':_0x209d58[_0x850e('0x3c')]};return db['ScreenRecording'][_0x850e('0x41')](_0x2be051)[_0x850e('0x23')](function(_0xebcc5){_0x37a03e[_0x850e('0x41')]=_0xebcc5;if(_0x1b4187[_0x850e('0x32')]['includeAll']){_0x209d58[_0x850e('0x42')]=[{'all':!![]}];}return db[_0x850e('0x2a')][_0x850e('0x43')](_0x209d58);})['then'](function(_0x3068f4){_0x37a03e[_0x850e('0x44')]=_0x3068f4;return _0x37a03e;})[_0x850e('0x23')](respondWithFilteredResult(_0x402d12,_0x209d58))['catch'](handleError(_0x402d12,null));};exports[_0x850e('0x45')]=function(_0x4fbe84,_0x402370){var _0xded9ee={'raw':![],'where':{'id':_0x4fbe84[_0x850e('0x46')]['id']}},_0x5b7846={};_0x5b7846['model']=_['keys'](db[_0x850e('0x2a')][_0x850e('0x2b')]);_0x5b7846[_0x850e('0x32')]=_[_0x850e('0x33')](_0x4fbe84[_0x850e('0x32')]);_0x5b7846[_0x850e('0x34')]=_['intersection'](_0x5b7846[_0x850e('0x2f')],_0x5b7846[_0x850e('0x32')]);_0xded9ee[_0x850e('0x36')]=_[_0x850e('0x35')](_0x5b7846[_0x850e('0x2f')],qs['fields'](_0x4fbe84[_0x850e('0x32')][_0x850e('0x37')]));_0xded9ee[_0x850e('0x36')]=_0xded9ee[_0x850e('0x36')]['length']?_0xded9ee[_0x850e('0x36')]:_0x5b7846[_0x850e('0x2f')];if(_0x4fbe84[_0x850e('0x32')]['includeAll']){_0xded9ee[_0x850e('0x42')]=[{'all':!![]}];}_0xded9ee=_['merge']({},_0xded9ee,_0x4fbe84[_0x850e('0x47')]);return db[_0x850e('0x2a')][_0x850e('0x48')](_0xded9ee)['then'](handleEntityNotFound(_0x402370,null))[_0x850e('0x23')](respondWithResult(_0x402370,null))[_0x850e('0x49')](handleError(_0x402370,null));};exports[_0x850e('0x4a')]=function(_0x3549a2,_0x1af2c0){return db['ScreenRecording'][_0x850e('0x4a')](_0x3549a2['body'],{})[_0x850e('0x23')](respondWithResult(_0x1af2c0,0xc9))[_0x850e('0x49')](handleError(_0x1af2c0,null));};exports[_0x850e('0x22')]=function(_0x276d9d,_0x544af7){if(_0x276d9d[_0x850e('0x4b')]['id']){delete _0x276d9d['body']['id'];}delete _0x276d9d['body'][_0x850e('0x4c')];delete _0x276d9d['body'][_0x850e('0x4d')];delete _0x276d9d[_0x850e('0x4b')][_0x850e('0x4e')];delete _0x276d9d[_0x850e('0x4b')]['value'];return db[_0x850e('0x2a')][_0x850e('0x48')]({'where':{'id':_0x276d9d['params']['id']}})['then'](handleEntityNotFound(_0x544af7,null))[_0x850e('0x23')](saveUpdates(_0x276d9d[_0x850e('0x4b')],null))[_0x850e('0x23')](respondWithResult(_0x544af7,null))['catch'](handleError(_0x544af7,null));};exports[_0x850e('0x4f')]=function(_0x4e10e4,_0x45ef98){return db[_0x850e('0x2a')][_0x850e('0x4f')]()[_0x850e('0x23')](respondWithResult(_0x45ef98,null))[_0x850e('0x49')](handleError(_0x45ef98,null));};exports[_0x850e('0x50')]=function(_0x4292b7,_0x4e38f3,_0x266a7e){var _0xeccf9f=require(_0x850e('0x51'));var _0x24f6e6=![];var _0x5d4530={};if(_0x4292b7[_0x850e('0x32')][_0x850e('0x2d')]&&_0x4292b7[_0x850e('0x32')][_0x850e('0x2d')]===_0x850e('0x52')){_0x5d4530[_0x850e('0x52')]=_0x4292b7[_0x850e('0x46')]['id'];}else{_0x5d4530['id']=_0x4292b7[_0x850e('0x46')]['id'];}return db[_0x850e('0x2a')][_0x850e('0x48')]({'where':_0x5d4530,'attributes':['id',_0x850e('0x53')],'raw':!![]})[_0x850e('0x23')](handleEntityNotFound(_0x4e38f3,null))[_0x850e('0x23')](function(_0x365535){if(_0x365535){var _0x52c0af=path[_0x850e('0x54')](config[_0x850e('0x55')],_0x850e('0x56'),_0x365535[_0x850e('0x53')]);var _0x464b8f=util[_0x850e('0x31')]('%s.cypher',_0x52c0af);if(fs['existsSync'](_0x464b8f)){_0x24f6e6=!![];return _0xeccf9f[_0x850e('0x57')](_0x464b8f,_0x52c0af,config[_0x850e('0x58')][_0x850e('0x59')])[_0x850e('0x23')](function(){return _0x365535;});}return _0x365535;}})[_0x850e('0x23')](function(_0x3bb8c2){if(_0x3bb8c2){var _0xb059c6=path['join'](config['root'],'server/files/screen_recordings',_0x3bb8c2[_0x850e('0x53')]);if(!fs[_0x850e('0x5a')](_0xb059c6)){throw new db[(_0x850e('0x5b'))][(_0x850e('0x5c'))]('ScreenRecording\x20not\x20found');}if(_0x3bb8c2['filename']){return _0x4e38f3['download'](_0xb059c6,_0x3bb8c2[_0x850e('0x5d')]+path[_0x850e('0x5e')](_0xb059c6),function(){if(_0x24f6e6){fs[_0x850e('0x5f')](_0xb059c6);}});}else{return _0x4e38f3[_0x850e('0x50')](_0xb059c6,function(_0xc8fdf2){if(_0x24f6e6){fs[_0x850e('0x5f')](_0xb059c6);}});}}})[_0x850e('0x49')](function(_0x2d512f){if(_0x2d512f['message']==='ScreenRecording\x20not\x20found'){_0x4e38f3['status'](0x194)[_0x850e('0x28')](_0x850e('0x60'));}else{return handleError(_0x4e38f3,null);}});};exports['destroy']=function(_0x453b68,_0x44a0d7){return db[_0x850e('0x2a')][_0x850e('0x48')]({'where':{'id':_0x453b68['params']['id']}})['then'](function(_0x5c9a44){if(!_0x5c9a44)throw new ReferenceError(_0x850e('0x61'));return _0x5c9a44;})[_0x850e('0x23')](function(_0x287c58){var _0x7ef1a3=path['join'](config[_0x850e('0x55')],'server/files/screen_recordings',_0x287c58['value']);logger['info'](_0x850e('0x62'),_0x7ef1a3);if(!_[_0x850e('0x63')](_0x287c58[_0x850e('0x53')])&&fs[_0x850e('0x5a')](_0x7ef1a3)){logger['info'](_0x850e('0x64')+_0x7ef1a3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x7ef1a3);}_0x7ef1a3=_0x7ef1a3+_0x850e('0x65');if(!_['isNil'](_0x287c58[_0x850e('0x53')])&&fs[_0x850e('0x5a')](_0x7ef1a3)){logger['info'](_0x850e('0x64')+_0x7ef1a3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x7ef1a3);}return _0x287c58;})[_0x850e('0x23')](function(_0x4145ac){if(!_0x4145ac)throw new InternalError();return _0x4145ac[_0x850e('0x24')]();})[_0x850e('0x23')](function(){_0x44a0d7[_0x850e('0x19')](0xcc)[_0x850e('0x1a')]();})[_0x850e('0x49')](handleError(_0x44a0d7,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 159ed1b..7a937b7 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 _0x011a=['interactionid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','screen_recordings'];(function(_0x5acdf4,_0x30f73f){var _0x373e3d=function(_0x140d8b){while(--_0x140d8b){_0x5acdf4['push'](_0x5acdf4['shift']());}};_0x373e3d(++_0x30f73f);}(_0x011a,0x1c8));var _0xa011=function(_0x58c053,_0x51c43f){_0x58c053=_0x58c053-0x0;var _0xe1079=_0x011a[_0x58c053];return _0xe1079;};'use strict';var _=require(_0xa011('0x0'));var util=require(_0xa011('0x1'));var logger=require(_0xa011('0x2'))(_0xa011('0x3'));var moment=require('moment');var BPromise=require(_0xa011('0x4'));var rp=require(_0xa011('0x5'));var fs=require('fs');var path=require(_0xa011('0x6'));var rimraf=require(_0xa011('0x7'));var config=require(_0xa011('0x8'));var attributes=require(_0xa011('0x9'));module[_0xa011('0xa')]=function(_0x4446f1,_0x5bddda){return _0x4446f1['define']('ScreenRecording',attributes,{'tableName':_0xa011('0xb'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xa011('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd57b=['../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','bluebird','request-promise','path'];(function(_0x596705,_0x1bfa14){var _0x4de4f5=function(_0x2b4ed6){while(--_0x2b4ed6){_0x596705['push'](_0x596705['shift']());}};_0x4de4f5(++_0x1bfa14);}(_0xd57b,0x1be));var _0xbd57=function(_0x3e8d78,_0xef4524){_0x3e8d78=_0x3e8d78-0x0;var _0x50532d=_0xd57b[_0x3e8d78];return _0x50532d;};'use strict';var _=require(_0xbd57('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbd57('0x1'));var rp=require(_0xbd57('0x2'));var fs=require('fs');var path=require(_0xbd57('0x3'));var rimraf=require('rimraf');var config=require(_0xbd57('0x4'));var attributes=require('./screenRecording.attributes');module[_0xbd57('0x5')]=function(_0x49f435,_0x3f92b8){return _0x49f435[_0xbd57('0x6')](_0xbd57('0x7'),attributes,{'tableName':_0xbd57('0x8'),'paranoid':![],'indexes':[{'name':_0xbd57('0x9'),'fields':[_0xbd57('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index f6bcb16..a8a66b8 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 _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\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(_0x4c8ead,_0x4fcae3){var _0x52a8c6=function(_0x2ce4a8){while(--_0x2ce4a8){_0x4c8ead['push'](_0x4c8ead['shift']());}};_0x52a8c6(++_0x4fcae3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'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','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\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(_0x49bde2,_0x57441c){var _0x442033=function(_0x4626c7){while(--_0x4626c7){_0x49bde2['push'](_0x49bde2['shift']());}};_0x442033(++_0x57441c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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/setting/index.js b/server/api/setting/index.js index 0d9dc48..099e1ed 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 _0x66c1=['favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','getPreferred','/:id/favicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','/:id/logo','join','logologin','single','addLogoLogin','/:id/preferred','file'];(function(_0x370f46,_0x374580){var _0xc013da=function(_0xf811f2){while(--_0xf811f2){_0x370f46['push'](_0x370f46['shift']());}};_0xc013da(++_0x374580);}(_0x66c1,0x195));var _0x166c=function(_0xb4b6c7,_0x3e65e6){_0xb4b6c7=_0xb4b6c7-0x0;var _0x302c2f=_0x66c1[_0xb4b6c7];return _0x302c2f;};'use strict';var multer=require(_0x166c('0x0'));var util=require(_0x166c('0x1'));var path=require(_0x166c('0x2'));var timeout=require(_0x166c('0x3'));var express=require(_0x166c('0x4'));var router=express[_0x166c('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x166c('0x6'));var controller=require(_0x166c('0x7'));router[_0x166c('0x8')]('/',auth[_0x166c('0x9')](),controller[_0x166c('0xa')]);router['get'](_0x166c('0xb'),controller[_0x166c('0xc')]);router[_0x166c('0x8')]('/:id/logo',controller[_0x166c('0xd')]);router[_0x166c('0x8')](_0x166c('0xe'),controller[_0x166c('0xf')]);router['get'](_0x166c('0x10'),controller['gdpr']);router[_0x166c('0x8')]('/:id/preferred',controller[_0x166c('0x11')]);router[_0x166c('0x8')](_0x166c('0x12'),controller['getFavicon']);var upload=multer({'storage':multer[_0x166c('0x13')]({'destination':function(_0x1d7215,_0x34fdda,_0x1d566a){_0x1d566a(null,path['join'](config[_0x166c('0x14')],_0x166c('0x15')));},'filename':function(_0x5d0671,_0x45b738,_0x12ec46){_0x12ec46(null,util[_0x166c('0x16')](_0x166c('0x17'),_0x166c('0x18'),path[_0x166c('0x19')](_0x45b738[_0x166c('0x1a')])));}})});router[_0x166c('0x1b')](_0x166c('0x1c'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x166c('0x13')]({'destination':function(_0x571f43,_0x2c5bd6,_0x29ac9e){_0x29ac9e(null,path[_0x166c('0x1d')](config[_0x166c('0x14')],_0x166c('0x15')));},'filename':function(_0x49b1ce,_0xad6c03,_0x5db57d){_0x5db57d(null,util[_0x166c('0x16')]('%s%s',_0x166c('0x1e'),path[_0x166c('0x19')](_0xad6c03[_0x166c('0x1a')])));}})});router[_0x166c('0x1b')](_0x166c('0xe'),upload[_0x166c('0x1f')]('file'),controller[_0x166c('0x20')]);var upload=multer({'storage':multer[_0x166c('0x13')]({'destination':function(_0x2d3851,_0x27dc64,_0x3d1ae4){_0x3d1ae4(null,path[_0x166c('0x1d')](config['root'],_0x166c('0x15')));},'filename':function(_0x10a034,_0x46f90a,_0x21fc81){_0x21fc81(null,util['format'](_0x166c('0x17'),'preferred',path[_0x166c('0x19')](_0x46f90a[_0x166c('0x1a')])));}})});router[_0x166c('0x1b')](_0x166c('0x21'),upload[_0x166c('0x1f')](_0x166c('0x22')),controller['addPreferred']);var upload=multer({'storage':multer[_0x166c('0x13')]({'destination':function(_0x47f7a6,_0x2617fd,_0x2dcc0e){_0x2dcc0e(null,path[_0x166c('0x1d')](config[_0x166c('0x14')],'server/files/images/logos/'));},'filename':function(_0x5f1956,_0xcb6136,_0xe98323){_0xe98323(null,util[_0x166c('0x16')]('%s%s',_0x166c('0x23'),path[_0x166c('0x19')](_0xcb6136['originalname'])));}})});router[_0x166c('0x1b')](_0x166c('0x12'),upload[_0x166c('0x1f')](_0x166c('0x22')),controller[_0x166c('0x24')]);router[_0x166c('0x25')]('/:id',auth[_0x166c('0x9')](),controller[_0x166c('0x26')]);module[_0x166c('0x27')]=router; \ No newline at end of file +var _0x2689=['/:id','show','get','/:id/logo','getLogo','/:id/logo_login','gdpr','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','extname','post','file','originalname','single','addLogoLogin','/:id/preferred','favicon','addFavicon','put','isAuthenticated','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x36b904,_0x36bfff){var _0x5e9249=function(_0x1efbb6){while(--_0x1efbb6){_0x36b904['push'](_0x36b904['shift']());}};_0x5e9249(++_0x36bfff);}(_0x2689,0x1f0));var _0x9268=function(_0x2e91ac,_0x336261){_0x2e91ac=_0x2e91ac-0x0;var _0x17c84e=_0x2689[_0x2e91ac];return _0x17c84e;};'use strict';var multer=require(_0x9268('0x0'));var util=require(_0x9268('0x1'));var path=require(_0x9268('0x2'));var timeout=require(_0x9268('0x3'));var express=require(_0x9268('0x4'));var router=express[_0x9268('0x5')]();var auth=require(_0x9268('0x6'));var interaction=require(_0x9268('0x7'));var config=require('../../config/environment');var controller=require('./setting.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9268('0x8'),controller[_0x9268('0x9')]);router[_0x9268('0xa')](_0x9268('0xb'),controller[_0x9268('0xc')]);router[_0x9268('0xa')](_0x9268('0xd'),controller['getLogoLogin']);router['get']('/:id/gdpr',controller[_0x9268('0xe')]);router[_0x9268('0xa')]('/:id/preferred',controller[_0x9268('0xf')]);router[_0x9268('0xa')](_0x9268('0x10'),controller[_0x9268('0x11')]);var upload=multer({'storage':multer[_0x9268('0x12')]({'destination':function(_0x1a37e0,_0x27cdce,_0xd556e9){_0xd556e9(null,path[_0x9268('0x13')](config[_0x9268('0x14')],_0x9268('0x15')));},'filename':function(_0x31ff4e,_0x22bc33,_0x55dece){_0x55dece(null,util[_0x9268('0x16')](_0x9268('0x17'),'logo',path[_0x9268('0x18')](_0x22bc33['originalname'])));}})});router[_0x9268('0x19')]('/:id/logo',upload['single'](_0x9268('0x1a')),controller['addLogo']);var upload=multer({'storage':multer[_0x9268('0x12')]({'destination':function(_0x1e5111,_0x226a85,_0xf5b0ff){_0xf5b0ff(null,path[_0x9268('0x13')](config['root'],_0x9268('0x15')));},'filename':function(_0x1602c7,_0x129f87,_0x463217){_0x463217(null,util[_0x9268('0x16')]('%s%s','logologin',path[_0x9268('0x18')](_0x129f87[_0x9268('0x1b')])));}})});router['post']('/:id/logo_login',upload[_0x9268('0x1c')](_0x9268('0x1a')),controller[_0x9268('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1e2e3c,_0x50cd7b,_0x5cd763){_0x5cd763(null,path['join'](config[_0x9268('0x14')],_0x9268('0x15')));},'filename':function(_0x5a2bf1,_0x338862,_0x4acc91){_0x4acc91(null,util[_0x9268('0x16')](_0x9268('0x17'),'preferred',path['extname'](_0x338862[_0x9268('0x1b')])));}})});router[_0x9268('0x19')](_0x9268('0x1e'),upload[_0x9268('0x1c')](_0x9268('0x1a')),controller['addPreferred']);var upload=multer({'storage':multer[_0x9268('0x12')]({'destination':function(_0x17e40d,_0x250500,_0x43d4db){_0x43d4db(null,path[_0x9268('0x13')](config[_0x9268('0x14')],_0x9268('0x15')));},'filename':function(_0xb6aca6,_0x393d53,_0x281c9b){_0x281c9b(null,util[_0x9268('0x16')]('%s%s',_0x9268('0x1f'),path[_0x9268('0x18')](_0x393d53['originalname'])));}})});router[_0x9268('0x19')](_0x9268('0x10'),upload[_0x9268('0x1c')]('file'),controller[_0x9268('0x20')]);router[_0x9268('0x21')](_0x9268('0x8'),auth[_0x9268('0x22')](),controller['update']);module[_0x9268('0x23')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 2075925..d2a93a4 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 _0x3c6f=['STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','sequelize','exports','INTEGER','min_mailbox','/var/opt/motion2/server/files/sounds/converted'];(function(_0x32682d,_0x5a8779){var _0x33841a=function(_0x4bbf62){while(--_0x4bbf62){_0x32682d['push'](_0x32682d['shift']());}};_0x33841a(++_0x5a8779);}(_0x3c6f,0x10b));var _0xf3c6=function(_0x2b9cec,_0x184709){_0x2b9cec=_0x2b9cec-0x0;var _0x4d6a41=_0x3c6f[_0x2b9cec];return _0x4d6a41;};'use strict';var Sequelize=require(_0xf3c6('0x0'));module[_0xf3c6('0x1')]={'min_internal':{'type':Sequelize[_0xf3c6('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf3c6('0x2')](0xb),'unique':_0xf3c6('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf3c6('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0xf3c6('0x4')},'logo':{'type':Sequelize[_0xf3c6('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf3c6('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf3c6('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf3c6('0x5')]},'turnaddr':{'type':Sequelize[_0xf3c6('0x5')]},'turnusername':{'type':Sequelize[_0xf3c6('0x5')]},'turnpassword':{'type':Sequelize[_0xf3c6('0x5')]},'pageTitle':{'type':Sequelize[_0xf3c6('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xf3c6('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xf3c6('0x7')},'enableEmailPreview':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf3c6('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf3c6('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0xf3c6('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xf3c6('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf3c6('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf3c6('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf3c6('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf3c6('0x2')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf3c6('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize[_0xf3c6('0x5')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xf3c6('0x5')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc41d=['sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x51acf7,_0x132802){var _0x55c17b=function(_0x51a0b9){while(--_0x51a0b9){_0x51acf7['push'](_0x51acf7['shift']());}};_0x55c17b(++_0x132802);}(_0xc41d,0xc6));var _0xdc41=function(_0x5bd45d,_0x20a9b4){_0x5bd45d=_0x5bd45d-0x0;var _0x537c64=_0xc41d[_0x5bd45d];return _0x537c64;};'use strict';var Sequelize=require(_0xdc41('0x0'));module[_0xdc41('0x1')]={'min_internal':{'type':Sequelize[_0xdc41('0x2')](0xb),'unique':_0xdc41('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0xdc41('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xdc41('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xdc41('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0xdc41('0x5')]},'turnpassword':{'type':Sequelize[_0xdc41('0x5')]},'pageTitle':{'type':Sequelize[_0xdc41('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xdc41('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xdc41('0x5')],'defaultValue':_0xdc41('0x7')},'enableEmailPreview':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xdc41('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xdc41('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xdc41('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xdc41('0x5')],'defaultValue':_0xdc41('0x8')},'chatTimeout':{'type':Sequelize[_0xdc41('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xdc41('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xdc41('0x5')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xdc41('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xdc41('0x5')]},'defaultFavicon':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xdc41('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xdc41('0x2')]},'transcribeRegion':{'type':Sequelize['STRING']},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize['INTEGER']},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0xdc41('0x5')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 8018e22..3bfcad6 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 _0x607c=['merge','VIRTUAL','options','include','findAll','show','params','rawAttributes','includeAll','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','getLicense','logo','preferred','favicon','defaultLoginLogo','defaultPreferred','join','root','toLower','default_logo.svg','default','custom','existsSync','upperFirst','\x20not\x20found','getLogoLogin','server/files/images/logos','defaultLogo','defaultFavicon','default_loginLogo.svg','gdpr','securePassword','addPreferred','../../config/license/util','getPreferred','default_preferred.png','download','addFavicon','getFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','save','update','destroy','then','stack','name','send','index','map','Setting','fieldName','type','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x607c,0xac));var _0xc607=function(_0x34a848,_0xc2f756){_0x34a848=_0x34a848-0x0;var _0x5eb4d1=_0x607c[_0x34a848];return _0x5eb4d1;};'use strict';var pdf=require(_0xc607('0x0'));var emlformat=require(_0xc607('0x1'));var rimraf=require(_0xc607('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc607('0x3'));var rp=require(_0xc607('0x4'));var moment=require('moment');var BPromise=require(_0xc607('0x5'));var Mustache=require(_0xc607('0x6'));var util=require(_0xc607('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc607('0x8'));var ejs=require(_0xc607('0x9'));var fs=require('fs');var _=require(_0xc607('0xa'));var squel=require(_0xc607('0xb'));var crypto=require(_0xc607('0xc'));var jsforce=require(_0xc607('0xd'));var deskjs=require(_0xc607('0xe'));var toCsv=require(_0xc607('0x8'));var querystring=require(_0xc607('0xf'));var Papa=require(_0xc607('0x10'));var Redis=require(_0xc607('0x11'));var authService=require(_0xc607('0x12'));var qs=require(_0xc607('0x13'));var as=require(_0xc607('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc607('0x15'))(_0xc607('0x16'));var utils=require('../../config/utils');var config=require(_0xc607('0x17'));var db=require(_0xc607('0x18'))['db'];var jayson=require(_0xc607('0x19'));var client=jayson[_0xc607('0x1a')][_0xc607('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x53598c,_0x1052ce,_0x578eb5){if(_0x578eb5){var _0x451707=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x451707['test'](_0x1052ce)){return _0x53598c;}else{throw new db[(_0xc607('0x1c'))][(_0xc607('0x1d'))](_0xc607('0x1e'));}}else{return _0x53598c;}}function respondWithRpcPromise(_0x3304dd,_0x808b0d,_0x30fcd0,_0x32bf98){return new BPromise(function(_0x286eb4,_0x59bf22){var _0x13371e=_0x32bf98||client;return _0x13371e[_0xc607('0x1f')](_0x3304dd,_0x30fcd0)['then'](function(_0x3281d1){logger[_0xc607('0x20')](_0xc607('0x21'),_0x808b0d,_0xc607('0x22'));logger[_0xc607('0x23')](_0xc607('0x24'),_0x808b0d,'request\x20sent',JSON[_0xc607('0x25')](_0x3281d1));if(_0x3281d1['error']){if(_0x3281d1['error'][_0xc607('0x26')]===0x1f4){logger[_0xc607('0x27')]('Setting,\x20%s,\x20%s',_0x808b0d,_0x3281d1[_0xc607('0x27')][_0xc607('0x28')]);return _0x59bf22(_0x3281d1['error']['message']);}logger[_0xc607('0x27')](_0xc607('0x21'),_0x808b0d,_0x3281d1['error'][_0xc607('0x28')]);return _0x286eb4(_0x3281d1['error']['message']);}else{logger[_0xc607('0x20')](_0xc607('0x21'),_0x808b0d,_0xc607('0x22'));_0x286eb4(_0x3281d1[_0xc607('0x29')][_0xc607('0x28')]);}})[_0xc607('0x2a')](function(_0x10862c){logger['error'](_0xc607('0x21'),_0x808b0d,_0x10862c);_0x59bf22(_0x10862c);});});}function respondWithStatusCode(_0x26040f,_0x42707f){_0x42707f=_0x42707f||0xcc;return function(_0x3d1cd8){if(_0x3d1cd8){return _0x26040f[_0xc607('0x2b')](_0x42707f);}return _0x26040f[_0xc607('0x2c')](_0x42707f)[_0xc607('0x2d')]();};}function respondWithResult(_0x39e503,_0x1af538){_0x1af538=_0x1af538||0xc8;return function(_0x41c8b5){if(_0x41c8b5){return _0x39e503['status'](_0x1af538)['json'](_0x41c8b5);}};}function respondWithFilteredResult(_0x2eb944,_0x5260c2){return function(_0x39809b){if(_0x39809b){var _0x58cbc7=_0x39809b[_0xc607('0x2e')],_0x2fcc89=_0x5260c2[_0xc607('0x2f')],_0x285416=_0x5260c2[_0xc607('0x2f')]+_0x5260c2['limit'],_0x159bb7;if(_0x285416>=_0x58cbc7){_0x285416=_0x58cbc7;_0x159bb7=0xc8;}else{_0x159bb7=0xce;}_0x2eb944[_0xc607('0x2c')](_0x159bb7);return _0x2eb944[_0xc607('0x30')](_0xc607('0x31'),_0x2fcc89+'-'+_0x285416+'/'+_0x58cbc7)[_0xc607('0x32')](_0x39809b);}return null;};}function patchUpdates(_0x59e724){return function(_0x55f616){try{jsonpatch['apply'](_0x55f616,_0x59e724,!![]);}catch(_0x531931){return BPromise['reject'](_0x531931);}return _0x55f616[_0xc607('0x33')]();};}function saveUpdates(_0xed8640,_0x4d8c28){return function(_0x2f9975){if(_0x2f9975){return _0x2f9975[_0xc607('0x34')](_0xed8640)['then'](function(_0x4cb41e){return _0x4cb41e;});}return null;};}function removeEntity(_0x1dd728,_0x4624d2){return function(_0x380e8b){if(_0x380e8b){return _0x380e8b[_0xc607('0x35')]()[_0xc607('0x36')](function(){_0x1dd728['status'](0xcc)[_0xc607('0x2d')]();});}};}function handleEntityNotFound(_0x20dea0,_0x1b57bb){return function(_0x4524f1){if(!_0x4524f1){_0x20dea0['sendStatus'](0x194);}return _0x4524f1;};}function handleError(_0x49eced,_0x13e82b){_0x13e82b=_0x13e82b||0x1f4;return function(_0x458d67){logger[_0xc607('0x27')](_0x458d67[_0xc607('0x37')]);if(_0x458d67[_0xc607('0x38')]){delete _0x458d67[_0xc607('0x38')];}_0x49eced[_0xc607('0x2c')](_0x13e82b)[_0xc607('0x39')](_0x458d67);};}exports[_0xc607('0x3a')]=function(_0x3b3df2,_0x1db90c){var _0x462816={},_0x357911={},_0x4ccf8b={'count':0x0,'rows':[]};var _0x472d00=_[_0xc607('0x3b')](db[_0xc607('0x3c')]['rawAttributes'],function(_0x308842){return{'name':_0x308842[_0xc607('0x3d')],'type':_0x308842[_0xc607('0x3e')]['key']};});_0x357911['model']=_[_0xc607('0x3b')](_0x472d00,_0xc607('0x38'));_0x357911['query']=_[_0xc607('0x3f')](_0x3b3df2[_0xc607('0x40')]);_0x357911['filters']=_['intersection'](_0x357911[_0xc607('0x41')],_0x357911['query']);_0x462816[_0xc607('0x42')]=_[_0xc607('0x43')](_0x357911[_0xc607('0x41')],qs[_0xc607('0x44')](_0x3b3df2['query']['fields']));_0x462816[_0xc607('0x42')]=_0x462816[_0xc607('0x42')][_0xc607('0x45')]?_0x462816[_0xc607('0x42')]:_0x357911[_0xc607('0x41')];if(!_0x3b3df2['query'][_0xc607('0x46')](_0xc607('0x47'))){_0x462816[_0xc607('0x48')]=qs[_0xc607('0x48')](_0x3b3df2[_0xc607('0x40')]['limit']);_0x462816['offset']=qs[_0xc607('0x2f')](_0x3b3df2['query'][_0xc607('0x2f')]);}_0x462816[_0xc607('0x49')]=qs[_0xc607('0x4a')](_0x3b3df2[_0xc607('0x40')]['sort']);_0x462816[_0xc607('0x4b')]=qs['filters'](_['pick'](_0x3b3df2[_0xc607('0x40')],_0x357911[_0xc607('0x4c')]),_0x472d00);if(_0x3b3df2[_0xc607('0x40')][_0xc607('0x4d')]){_0x462816[_0xc607('0x4b')]=_[_0xc607('0x4e')](_0x462816['where'],{'$or':_[_0xc607('0x3b')](_0x472d00,function(_0xcb478b){if(_0xcb478b['type']!==_0xc607('0x4f')){var _0x170042={};_0x170042[_0xcb478b[_0xc607('0x38')]]={'$like':'%'+_0x3b3df2[_0xc607('0x40')]['filter']+'%'};return _0x170042;}})});}_0x462816=_['merge']({},_0x462816,_0x3b3df2[_0xc607('0x50')]);var _0x15c700={'where':_0x462816[_0xc607('0x4b')]};return db['Setting'][_0xc607('0x2e')](_0x15c700)[_0xc607('0x36')](function(_0x51463f){_0x4ccf8b['count']=_0x51463f;if(_0x3b3df2['query']['includeAll']){_0x462816[_0xc607('0x51')]=[{'all':!![]}];}return db[_0xc607('0x3c')][_0xc607('0x52')](_0x462816);})[_0xc607('0x36')](function(_0x1a6f1d){_0x4ccf8b['rows']=_0x1a6f1d;return _0x4ccf8b;})[_0xc607('0x36')](respondWithFilteredResult(_0x1db90c,_0x462816))[_0xc607('0x2a')](handleError(_0x1db90c,null));};exports[_0xc607('0x53')]=function(_0xc559b6,_0x32601c){var _0x42d278={'raw':![],'where':{'id':_0xc559b6[_0xc607('0x54')]['id']}},_0x56d297={};_0x56d297[_0xc607('0x41')]=_[_0xc607('0x3f')](db[_0xc607('0x3c')][_0xc607('0x55')]);_0x56d297[_0xc607('0x40')]=_['keys'](_0xc559b6[_0xc607('0x40')]);_0x56d297[_0xc607('0x4c')]=_['intersection'](_0x56d297[_0xc607('0x41')],_0x56d297[_0xc607('0x40')]);_0x42d278[_0xc607('0x42')]=_[_0xc607('0x43')](_0x56d297[_0xc607('0x41')],qs[_0xc607('0x44')](_0xc559b6['query'][_0xc607('0x44')]));_0x42d278['attributes']=_0x42d278[_0xc607('0x42')]['length']?_0x42d278[_0xc607('0x42')]:_0x56d297['model'];if(_0xc559b6[_0xc607('0x40')][_0xc607('0x56')]){_0x42d278[_0xc607('0x51')]=[{'all':!![]}];}_0x42d278=_[_0xc607('0x4e')]({},_0x42d278,_0xc559b6[_0xc607('0x50')]);return db['Setting'][_0xc607('0x57')](_0x42d278)[_0xc607('0x36')](handleEntityNotFound(_0x32601c,null))[_0xc607('0x36')](respondWithResult(_0x32601c,null))[_0xc607('0x2a')](handleError(_0x32601c,null));};exports[_0xc607('0x34')]=function(_0x5b1457,_0xd8a3d7){if(_0x5b1457[_0xc607('0x58')]['id']){delete _0x5b1457[_0xc607('0x58')]['id'];}return db['Setting'][_0xc607('0x57')]({'where':{'id':_0x5b1457[_0xc607('0x54')]['id']}})[_0xc607('0x36')](handleEntityNotFound(_0xd8a3d7,null))[_0xc607('0x36')](saveUpdates(_0x5b1457['body'],null))[_0xc607('0x36')](respondWithResult(_0xd8a3d7,null))[_0xc607('0x2a')](handleError(_0xd8a3d7,null));};exports[_0xc607('0x59')]=function(_0x41e467,_0x17c1bb,_0x570f1e){if(_0x41e467[_0xc607('0x5a')]&&_0x41e467[_0xc607('0x5a')][_0xc607('0x5b')]){_0x41e467[_0xc607('0x58')]['logo']=_0x41e467['file'][_0xc607('0x5b')];}return db[_0xc607('0x3c')][_0xc607('0x57')]({'where':{'id':_0x41e467[_0xc607('0x54')]['id']}})[_0xc607('0x36')](handleEntityNotFound(_0x17c1bb,null))[_0xc607('0x36')](saveUpdates(_0x41e467['body'],null))['then'](respondWithResult(_0x17c1bb,null))['catch'](handleError(_0x17c1bb,null));};exports[_0xc607('0x5c')]=function(_0x2dc0eb,_0xb8f380,_0x1c56ee){if(_0x2dc0eb[_0xc607('0x5a')]&&_0x2dc0eb[_0xc607('0x5a')][_0xc607('0x5b')]){_0x2dc0eb[_0xc607('0x58')][_0xc607('0x5d')]=_0x2dc0eb['file'][_0xc607('0x5b')];}return db[_0xc607('0x3c')][_0xc607('0x57')]({'where':{'id':_0x2dc0eb[_0xc607('0x54')]['id']}})[_0xc607('0x36')](handleEntityNotFound(_0xb8f380,null))[_0xc607('0x36')](saveUpdates(_0x2dc0eb[_0xc607('0x58')],null))[_0xc607('0x36')](respondWithResult(_0xb8f380,null))['catch'](handleError(_0xb8f380,null));};var utilLicense=require('../../config/license/util');exports[_0xc607('0x5e')]=function(_0x1d84f8,_0x13e5b7,_0xb50bb2){var _0x5c6857='server/files/images/logos';var _0x716e67={'custom':![]};return utilLicense[_0xc607('0x5f')]()[_0xc607('0x36')](function(_0x4c424b){if(_0x4c424b){_0x716e67=_0x4c424b;}return db['Setting'][_0xc607('0x57')]({'where':{'id':_0x1d84f8[_0xc607('0x54')]['id']},'attributes':[_0xc607('0x60'),'loginLogo',_0xc607('0x61'),_0xc607('0x62'),'defaultLogo',_0xc607('0x63'),_0xc607('0x64'),'defaultFavicon'],'raw':!![]});})[_0xc607('0x36')](handleEntityNotFound(_0x13e5b7,null))[_0xc607('0x36')](function(_0x4e5390){if(_0x4e5390){var _0x58d367=_0x4e5390[_0xc607('0x60')]&&fs['existsSync'](path[_0xc607('0x65')](config[_0xc607('0x66')],_0x5c6857,_[_0xc607('0x67')](_0x4e5390[_0xc607('0x60')])))?path[_0xc607('0x65')](config[_0xc607('0x66')],_0x5c6857,_[_0xc607('0x67')](_0x4e5390['logo'])):path[_0xc607('0x65')](config[_0xc607('0x66')],_0x5c6857,_[_0xc607('0x67')](_0xc607('0x68')));var _0x183588=_0xc607('0x69')+_['upperFirst'](_0xc607('0x60'));if(_0x4e5390[_0x183588]||!_0x716e67[_0xc607('0x6a')]){_0x58d367=path[_0xc607('0x65')](config[_0xc607('0x66')],_0x5c6857,_[_0xc607('0x67')]('default_logo.svg'));}if(!fs[_0xc607('0x6b')](_0x58d367)){throw new db[(_0xc607('0x1c'))][(_0xc607('0x1d'))](_[_0xc607('0x6c')](_0xc607('0x60'))+_0xc607('0x6d'));}return _0x13e5b7['download'](_0x58d367);}})['catch'](handleError(_0x13e5b7,null));};var utilLicense=require('../../config/license/util');exports[_0xc607('0x6e')]=function(_0x284120,_0x27d65e,_0x249b7e){var _0x3d49d0=_0xc607('0x6f');var _0x299562={'custom':![]};return utilLicense[_0xc607('0x5f')]()['then'](function(_0xf7bab5){if(_0xf7bab5){_0x299562=_0xf7bab5;}return db[_0xc607('0x3c')][_0xc607('0x57')]({'where':{'id':_0x284120[_0xc607('0x54')]['id']},'attributes':[_0xc607('0x60'),_0xc607('0x5d'),_0xc607('0x61'),_0xc607('0x62'),_0xc607('0x70'),_0xc607('0x63'),_0xc607('0x64'),_0xc607('0x71')],'raw':!![]});})[_0xc607('0x36')](handleEntityNotFound(_0x27d65e,null))[_0xc607('0x36')](function(_0x81c78){if(_0x81c78){var _0x43d324=_0x81c78[_0xc607('0x5d')]&&fs[_0xc607('0x6b')](path[_0xc607('0x65')](config['root'],_0x3d49d0,_[_0xc607('0x67')](_0x81c78[_0xc607('0x5d')])))?path[_0xc607('0x65')](config[_0xc607('0x66')],_0x3d49d0,_[_0xc607('0x67')](_0x81c78[_0xc607('0x5d')])):path['join'](config['root'],_0x3d49d0,_[_0xc607('0x67')](_0xc607('0x72')));var _0x590ef9=_0xc607('0x69')+_[_0xc607('0x6c')](_0xc607('0x5d'));if(_0x81c78[_0x590ef9]||!_0x299562[_0xc607('0x6a')]){_0x43d324=path[_0xc607('0x65')](config[_0xc607('0x66')],_0x3d49d0,_[_0xc607('0x67')](_0xc607('0x72')));}if(!fs[_0xc607('0x6b')](_0x43d324)){throw new db[(_0xc607('0x1c'))][(_0xc607('0x1d'))](_[_0xc607('0x6c')](_0xc607('0x5d'))+'\x20not\x20found');}return _0x27d65e['download'](_0x43d324);}})['catch'](handleError(_0x27d65e,null));};exports[_0xc607('0x73')]=function(_0x36fd87,_0x2e9b69){return db['Setting'][_0xc607('0x57')]({'where':{'id':_0x36fd87['params']['id']},'attributes':[_0xc607('0x74')]})[_0xc607('0x36')](respondWithResult(_0x2e9b69,null))[_0xc607('0x2a')](handleError(_0x2e9b69,null));};exports[_0xc607('0x75')]=function(_0x393a1b,_0x261593,_0x160445){if(_0x393a1b[_0xc607('0x5a')]&&_0x393a1b[_0xc607('0x5a')][_0xc607('0x5b')]){_0x393a1b[_0xc607('0x58')][_0xc607('0x61')]=_0x393a1b[_0xc607('0x5a')][_0xc607('0x5b')];}return db['Setting'][_0xc607('0x57')]({'where':{'id':_0x393a1b['params']['id']}})[_0xc607('0x36')](handleEntityNotFound(_0x261593,null))[_0xc607('0x36')](saveUpdates(_0x393a1b[_0xc607('0x58')],null))['then'](respondWithResult(_0x261593,null))[_0xc607('0x2a')](handleError(_0x261593,null));};var utilLicense=require(_0xc607('0x76'));exports[_0xc607('0x77')]=function(_0x56af83,_0x2336ad,_0x2e00ff){var _0x11f282='server/files/images/logos';var _0x6783ef={'custom':![]};return utilLicense[_0xc607('0x5f')]()[_0xc607('0x36')](function(_0x2a2a70){if(_0x2a2a70){_0x6783ef=_0x2a2a70;}return db[_0xc607('0x3c')][_0xc607('0x57')]({'where':{'id':_0x56af83[_0xc607('0x54')]['id']},'attributes':[_0xc607('0x60'),'loginLogo',_0xc607('0x61'),_0xc607('0x62'),_0xc607('0x70'),_0xc607('0x63'),_0xc607('0x64'),_0xc607('0x71')],'raw':!![]});})[_0xc607('0x36')](handleEntityNotFound(_0x2336ad,null))['then'](function(_0x3af303){if(_0x3af303){var _0x58c07d=_0x3af303[_0xc607('0x61')]&&fs['existsSync'](path[_0xc607('0x65')](config[_0xc607('0x66')],_0x11f282,_[_0xc607('0x67')](_0x3af303[_0xc607('0x61')])))?path[_0xc607('0x65')](config[_0xc607('0x66')],_0x11f282,_[_0xc607('0x67')](_0x3af303['preferred'])):path['join'](config[_0xc607('0x66')],_0x11f282,_[_0xc607('0x67')](_0xc607('0x78')));var _0x103c4d='default'+_[_0xc607('0x6c')]('preferred');if(_0x3af303[_0x103c4d]||!_0x6783ef['custom']||!_0x6783ef['preferred']){_0x58c07d=path[_0xc607('0x65')](config['root'],_0x11f282,_['toLower']('default_preferred.png'));}if(!fs[_0xc607('0x6b')](_0x58c07d)){throw new db['Sequelize'][(_0xc607('0x1d'))](_['upperFirst'](_0xc607('0x61'))+'\x20not\x20found');}return _0x2336ad[_0xc607('0x79')](_0x58c07d);}})[_0xc607('0x2a')](handleError(_0x2336ad,null));};exports[_0xc607('0x7a')]=function(_0x29a2f6,_0x151d88,_0x574d34){if(_0x29a2f6[_0xc607('0x5a')]&&_0x29a2f6[_0xc607('0x5a')]['filename']){_0x29a2f6[_0xc607('0x58')][_0xc607('0x62')]=_0x29a2f6[_0xc607('0x5a')][_0xc607('0x5b')];}return db[_0xc607('0x3c')]['find']({'where':{'id':_0x29a2f6[_0xc607('0x54')]['id']}})[_0xc607('0x36')](handleEntityNotFound(_0x151d88,null))[_0xc607('0x36')](saveUpdates(_0x29a2f6[_0xc607('0x58')],null))[_0xc607('0x36')](respondWithResult(_0x151d88,null))['catch'](handleError(_0x151d88,null));};var utilLicense=require(_0xc607('0x76'));exports[_0xc607('0x7b')]=function(_0x24f971,_0x39d3ba,_0x4d1309){var _0xd16204=_0xc607('0x6f');var _0x81aee6={'custom':![]};return utilLicense['getLicense']()[_0xc607('0x36')](function(_0x55dc46){if(_0x55dc46){_0x81aee6=_0x55dc46;}return db['Setting'][_0xc607('0x57')]({'where':{'id':_0x24f971[_0xc607('0x54')]['id']},'attributes':[_0xc607('0x60'),_0xc607('0x5d'),_0xc607('0x61'),_0xc607('0x62'),'defaultLogo',_0xc607('0x63'),_0xc607('0x64'),_0xc607('0x71')],'raw':!![]});})['then'](handleEntityNotFound(_0x39d3ba,null))[_0xc607('0x36')](function(_0x5ecc8d){if(_0x5ecc8d){var _0x205872=_0x5ecc8d[_0xc607('0x62')]&&fs[_0xc607('0x6b')](path[_0xc607('0x65')](config[_0xc607('0x66')],_0xd16204,_[_0xc607('0x67')](_0x5ecc8d[_0xc607('0x62')])))?path[_0xc607('0x65')](config[_0xc607('0x66')],_0xd16204,_[_0xc607('0x67')](_0x5ecc8d[_0xc607('0x62')])):path[_0xc607('0x65')](config[_0xc607('0x66')],_0xd16204,_[_0xc607('0x67')]('default_favicon.ico'));var _0x4f110b=_0xc607('0x69')+_['upperFirst']('favicon');if(_0x5ecc8d[_0x4f110b]||!_0x81aee6['custom']){_0x205872=path['join'](config['root'],_0xd16204,_[_0xc607('0x67')](_0xc607('0x7c')));}if(!fs[_0xc607('0x6b')](_0x205872)){throw new db['Sequelize'][(_0xc607('0x1d'))](_[_0xc607('0x6c')](_0xc607('0x62'))+_0xc607('0x6d'));}return _0x39d3ba[_0xc607('0x79')](_0x205872);}})[_0xc607('0x2a')](handleError(_0x39d3ba,null));}; \ No newline at end of file +var _0x4f98=['getFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','name','send','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','order','sort','pick','filters','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','fields','body','find','file','filename','logo','loginLogo','../../config/license/util','server/files/images/logos','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','root','join','toLower','default','upperFirst','custom','default_logo.svg','getLogoLogin','getLicense','defaultLoginLogo','default_loginLogo.svg','download','securePassword','getPreferred','default_preferred.png','ValidationError','\x20not\x20found','addFavicon'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x4f98,0x1d6));var _0x84f9=function(_0x813d0a,_0x4fd3d7){_0x813d0a=_0x813d0a-0x0;var _0x241352=_0x4f98[_0x813d0a];return _0x241352;};'use strict';var pdf=require(_0x84f9('0x0'));var emlformat=require(_0x84f9('0x1'));var rimraf=require(_0x84f9('0x2'));var zipdir=require(_0x84f9('0x3'));var jsonpatch=require(_0x84f9('0x4'));var rp=require(_0x84f9('0x5'));var moment=require(_0x84f9('0x6'));var BPromise=require(_0x84f9('0x7'));var Mustache=require('mustache');var util=require(_0x84f9('0x8'));var path=require(_0x84f9('0x9'));var sox=require(_0x84f9('0xa'));var csv=require(_0x84f9('0xb'));var ejs=require(_0x84f9('0xc'));var fs=require('fs');var _=require(_0x84f9('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x84f9('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x84f9('0xb'));var querystring=require(_0x84f9('0xf'));var Papa=require(_0x84f9('0x10'));var Redis=require(_0x84f9('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x84f9('0x12'));var hardwareService=require(_0x84f9('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x84f9('0x14'));var config=require(_0x84f9('0x15'));var db=require(_0x84f9('0x16'))['db'];var jayson=require(_0x84f9('0x17'));var client=jayson[_0x84f9('0x18')][_0x84f9('0x19')]({'port':0x232a});function checkPasswordPattern(_0x441bab,_0x46c488,_0x33d339){if(_0x33d339){var _0x4254a1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4254a1[_0x84f9('0x1a')](_0x46c488)){return _0x441bab;}else{throw new db[(_0x84f9('0x1b'))]['ValidationError'](_0x84f9('0x1c'));}}else{return _0x441bab;}}function respondWithRpcPromise(_0xd7c31f,_0x1fa31e,_0x17deda,_0xfe1361){return new BPromise(function(_0x1e0ab1,_0x4bf7e1){var _0x4c7a8c=_0xfe1361||client;return _0x4c7a8c[_0x84f9('0x1d')](_0xd7c31f,_0x17deda)['then'](function(_0x435f69){logger[_0x84f9('0x1e')](_0x84f9('0x1f'),_0x1fa31e,_0x84f9('0x20'));logger[_0x84f9('0x21')](_0x84f9('0x22'),_0x1fa31e,_0x84f9('0x20'),JSON['stringify'](_0x435f69));if(_0x435f69[_0x84f9('0x23')]){if(_0x435f69['error']['code']===0x1f4){logger['error'](_0x84f9('0x1f'),_0x1fa31e,_0x435f69[_0x84f9('0x23')][_0x84f9('0x24')]);return _0x4bf7e1(_0x435f69[_0x84f9('0x23')]['message']);}logger[_0x84f9('0x23')](_0x84f9('0x1f'),_0x1fa31e,_0x435f69[_0x84f9('0x23')]['message']);return _0x1e0ab1(_0x435f69[_0x84f9('0x23')][_0x84f9('0x24')]);}else{logger[_0x84f9('0x1e')]('Setting,\x20%s,\x20%s',_0x1fa31e,_0x84f9('0x20'));_0x1e0ab1(_0x435f69[_0x84f9('0x25')]['message']);}})[_0x84f9('0x26')](function(_0x38bbda){logger['error'](_0x84f9('0x1f'),_0x1fa31e,_0x38bbda);_0x4bf7e1(_0x38bbda);});});}function respondWithStatusCode(_0x52203c,_0x496aac){_0x496aac=_0x496aac||0xcc;return function(_0x2a40b0){if(_0x2a40b0){return _0x52203c[_0x84f9('0x27')](_0x496aac);}return _0x52203c[_0x84f9('0x28')](_0x496aac)[_0x84f9('0x29')]();};}function respondWithResult(_0x363090,_0x1060fe){_0x1060fe=_0x1060fe||0xc8;return function(_0x1e1e39){if(_0x1e1e39){return _0x363090[_0x84f9('0x28')](_0x1060fe)[_0x84f9('0x2a')](_0x1e1e39);}};}function respondWithFilteredResult(_0xa53042,_0x4be16f){return function(_0x36756d){if(_0x36756d){var _0x20a599=_0x36756d[_0x84f9('0x2b')],_0x18f5a4=_0x4be16f[_0x84f9('0x2c')],_0x246f76=_0x4be16f['offset']+_0x4be16f[_0x84f9('0x2d')],_0x26555d;if(_0x246f76>=_0x20a599){_0x246f76=_0x20a599;_0x26555d=0xc8;}else{_0x26555d=0xce;}_0xa53042[_0x84f9('0x28')](_0x26555d);return _0xa53042['set'](_0x84f9('0x2e'),_0x18f5a4+'-'+_0x246f76+'/'+_0x20a599)[_0x84f9('0x2a')](_0x36756d);}return null;};}function patchUpdates(_0x44f2c8){return function(_0x135e0c){try{jsonpatch[_0x84f9('0x2f')](_0x135e0c,_0x44f2c8,!![]);}catch(_0x248ff1){return BPromise[_0x84f9('0x30')](_0x248ff1);}return _0x135e0c['save']();};}function saveUpdates(_0x5ea8d8,_0x205bbe){return function(_0x3b18a6){if(_0x3b18a6){return _0x3b18a6[_0x84f9('0x31')](_0x5ea8d8)[_0x84f9('0x32')](function(_0x369726){return _0x369726;});}return null;};}function removeEntity(_0x57865d,_0x5f3ba9){return function(_0x41a358){if(_0x41a358){return _0x41a358[_0x84f9('0x33')]()['then'](function(){_0x57865d[_0x84f9('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a8a1b,_0x5d6dce){return function(_0x250495){if(!_0x250495){_0x6a8a1b[_0x84f9('0x27')](0x194);}return _0x250495;};}function handleError(_0x50dfee,_0x26ea8a){_0x26ea8a=_0x26ea8a||0x1f4;return function(_0xa67a75){logger[_0x84f9('0x23')](_0xa67a75['stack']);if(_0xa67a75['name']){delete _0xa67a75[_0x84f9('0x34')];}_0x50dfee[_0x84f9('0x28')](_0x26ea8a)[_0x84f9('0x35')](_0xa67a75);};}exports[_0x84f9('0x36')]=function(_0x8bb486,_0x636069){var _0x3fc3c2={},_0x2eac1d={},_0x430492={'count':0x0,'rows':[]};var _0x2fba4f=_[_0x84f9('0x37')](db[_0x84f9('0x38')][_0x84f9('0x39')],function(_0x1328d7){return{'name':_0x1328d7[_0x84f9('0x3a')],'type':_0x1328d7[_0x84f9('0x3b')][_0x84f9('0x3c')]};});_0x2eac1d[_0x84f9('0x3d')]=_['map'](_0x2fba4f,_0x84f9('0x34'));_0x2eac1d[_0x84f9('0x3e')]=_[_0x84f9('0x3f')](_0x8bb486[_0x84f9('0x3e')]);_0x2eac1d['filters']=_[_0x84f9('0x40')](_0x2eac1d[_0x84f9('0x3d')],_0x2eac1d[_0x84f9('0x3e')]);_0x3fc3c2[_0x84f9('0x41')]=_[_0x84f9('0x40')](_0x2eac1d['model'],qs['fields'](_0x8bb486[_0x84f9('0x3e')]['fields']));_0x3fc3c2[_0x84f9('0x41')]=_0x3fc3c2[_0x84f9('0x41')][_0x84f9('0x42')]?_0x3fc3c2[_0x84f9('0x41')]:_0x2eac1d['model'];if(!_0x8bb486['query']['hasOwnProperty']('nolimit')){_0x3fc3c2['limit']=qs[_0x84f9('0x2d')](_0x8bb486[_0x84f9('0x3e')][_0x84f9('0x2d')]);_0x3fc3c2['offset']=qs[_0x84f9('0x2c')](_0x8bb486[_0x84f9('0x3e')][_0x84f9('0x2c')]);}_0x3fc3c2[_0x84f9('0x43')]=qs[_0x84f9('0x44')](_0x8bb486[_0x84f9('0x3e')][_0x84f9('0x44')]);_0x3fc3c2['where']=qs['filters'](_[_0x84f9('0x45')](_0x8bb486[_0x84f9('0x3e')],_0x2eac1d[_0x84f9('0x46')]),_0x2fba4f);if(_0x8bb486[_0x84f9('0x3e')]['filter']){_0x3fc3c2['where']=_['merge'](_0x3fc3c2[_0x84f9('0x47')],{'$or':_[_0x84f9('0x37')](_0x2fba4f,function(_0x1ed746){if(_0x1ed746['type']!==_0x84f9('0x48')){var _0x1f85c3={};_0x1f85c3[_0x1ed746[_0x84f9('0x34')]]={'$like':'%'+_0x8bb486['query'][_0x84f9('0x49')]+'%'};return _0x1f85c3;}})});}_0x3fc3c2=_[_0x84f9('0x4a')]({},_0x3fc3c2,_0x8bb486[_0x84f9('0x4b')]);var _0x469d7a={'where':_0x3fc3c2[_0x84f9('0x47')]};return db[_0x84f9('0x38')][_0x84f9('0x2b')](_0x469d7a)[_0x84f9('0x32')](function(_0x45147e){_0x430492['count']=_0x45147e;if(_0x8bb486['query'][_0x84f9('0x4c')]){_0x3fc3c2[_0x84f9('0x4d')]=[{'all':!![]}];}return db[_0x84f9('0x38')][_0x84f9('0x4e')](_0x3fc3c2);})[_0x84f9('0x32')](function(_0x476e46){_0x430492[_0x84f9('0x4f')]=_0x476e46;return _0x430492;})[_0x84f9('0x32')](respondWithFilteredResult(_0x636069,_0x3fc3c2))[_0x84f9('0x26')](handleError(_0x636069,null));};exports[_0x84f9('0x50')]=function(_0x24593c,_0x2520ff){var _0x4362c8={'raw':![],'where':{'id':_0x24593c[_0x84f9('0x51')]['id']}},_0x3b752b={};_0x3b752b[_0x84f9('0x3d')]=_[_0x84f9('0x3f')](db[_0x84f9('0x38')]['rawAttributes']);_0x3b752b[_0x84f9('0x3e')]=_[_0x84f9('0x3f')](_0x24593c[_0x84f9('0x3e')]);_0x3b752b[_0x84f9('0x46')]=_[_0x84f9('0x40')](_0x3b752b[_0x84f9('0x3d')],_0x3b752b[_0x84f9('0x3e')]);_0x4362c8[_0x84f9('0x41')]=_[_0x84f9('0x40')](_0x3b752b['model'],qs[_0x84f9('0x52')](_0x24593c['query'][_0x84f9('0x52')]));_0x4362c8[_0x84f9('0x41')]=_0x4362c8[_0x84f9('0x41')]['length']?_0x4362c8['attributes']:_0x3b752b[_0x84f9('0x3d')];if(_0x24593c[_0x84f9('0x3e')][_0x84f9('0x4c')]){_0x4362c8['include']=[{'all':!![]}];}_0x4362c8=_[_0x84f9('0x4a')]({},_0x4362c8,_0x24593c[_0x84f9('0x4b')]);return db[_0x84f9('0x38')]['find'](_0x4362c8)[_0x84f9('0x32')](handleEntityNotFound(_0x2520ff,null))['then'](respondWithResult(_0x2520ff,null))[_0x84f9('0x26')](handleError(_0x2520ff,null));};exports[_0x84f9('0x31')]=function(_0x215dfb,_0x280662){if(_0x215dfb[_0x84f9('0x53')]['id']){delete _0x215dfb[_0x84f9('0x53')]['id'];}return db[_0x84f9('0x38')][_0x84f9('0x54')]({'where':{'id':_0x215dfb[_0x84f9('0x51')]['id']}})[_0x84f9('0x32')](handleEntityNotFound(_0x280662,null))[_0x84f9('0x32')](saveUpdates(_0x215dfb[_0x84f9('0x53')],null))[_0x84f9('0x32')](respondWithResult(_0x280662,null))['catch'](handleError(_0x280662,null));};exports['addLogo']=function(_0x512a76,_0x5738e2,_0x28d3b8){if(_0x512a76['file']&&_0x512a76[_0x84f9('0x55')][_0x84f9('0x56')]){_0x512a76['body'][_0x84f9('0x57')]=_0x512a76[_0x84f9('0x55')][_0x84f9('0x56')];}return db[_0x84f9('0x38')][_0x84f9('0x54')]({'where':{'id':_0x512a76[_0x84f9('0x51')]['id']}})[_0x84f9('0x32')](handleEntityNotFound(_0x5738e2,null))[_0x84f9('0x32')](saveUpdates(_0x512a76[_0x84f9('0x53')],null))['then'](respondWithResult(_0x5738e2,null))[_0x84f9('0x26')](handleError(_0x5738e2,null));};exports['addLogoLogin']=function(_0x46e45c,_0x5e6e17,_0x52349b){if(_0x46e45c['file']&&_0x46e45c[_0x84f9('0x55')][_0x84f9('0x56')]){_0x46e45c[_0x84f9('0x53')][_0x84f9('0x58')]=_0x46e45c[_0x84f9('0x55')][_0x84f9('0x56')];}return db[_0x84f9('0x38')][_0x84f9('0x54')]({'where':{'id':_0x46e45c['params']['id']}})[_0x84f9('0x32')](handleEntityNotFound(_0x5e6e17,null))[_0x84f9('0x32')](saveUpdates(_0x46e45c[_0x84f9('0x53')],null))['then'](respondWithResult(_0x5e6e17,null))['catch'](handleError(_0x5e6e17,null));};var utilLicense=require(_0x84f9('0x59'));exports['getLogo']=function(_0x4958ea,_0x2d473f,_0x5b70d8){var _0x7179b1=_0x84f9('0x5a');var _0x2506d8={'custom':![]};return utilLicense['getLicense']()[_0x84f9('0x32')](function(_0x124f3b){if(_0x124f3b){_0x2506d8=_0x124f3b;}return db['Setting']['find']({'where':{'id':_0x4958ea[_0x84f9('0x51')]['id']},'attributes':[_0x84f9('0x57'),_0x84f9('0x58'),_0x84f9('0x5b'),_0x84f9('0x5c'),_0x84f9('0x5d'),'defaultLoginLogo',_0x84f9('0x5e'),_0x84f9('0x5f')],'raw':!![]});})[_0x84f9('0x32')](handleEntityNotFound(_0x2d473f,null))[_0x84f9('0x32')](function(_0x4873b1){if(_0x4873b1){var _0x1894ea=_0x4873b1[_0x84f9('0x57')]&&fs[_0x84f9('0x60')](path['join'](config[_0x84f9('0x61')],_0x7179b1,_['toLower'](_0x4873b1[_0x84f9('0x57')])))?path[_0x84f9('0x62')](config[_0x84f9('0x61')],_0x7179b1,_[_0x84f9('0x63')](_0x4873b1[_0x84f9('0x57')])):path[_0x84f9('0x62')](config[_0x84f9('0x61')],_0x7179b1,_[_0x84f9('0x63')]('default_logo.svg'));var _0x509d49=_0x84f9('0x64')+_[_0x84f9('0x65')](_0x84f9('0x57'));if(_0x4873b1[_0x509d49]||!_0x2506d8[_0x84f9('0x66')]){_0x1894ea=path[_0x84f9('0x62')](config['root'],_0x7179b1,_[_0x84f9('0x63')](_0x84f9('0x67')));}if(!fs['existsSync'](_0x1894ea)){throw new db[(_0x84f9('0x1b'))]['ValidationError'](_[_0x84f9('0x65')]('logo')+'\x20not\x20found');}return _0x2d473f['download'](_0x1894ea);}})[_0x84f9('0x26')](handleError(_0x2d473f,null));};var utilLicense=require(_0x84f9('0x59'));exports[_0x84f9('0x68')]=function(_0x22ad0f,_0x301864,_0x23b034){var _0x4a5d1b=_0x84f9('0x5a');var _0x41c941={'custom':![]};return utilLicense[_0x84f9('0x69')]()[_0x84f9('0x32')](function(_0x52ce2b){if(_0x52ce2b){_0x41c941=_0x52ce2b;}return db['Setting']['find']({'where':{'id':_0x22ad0f['params']['id']},'attributes':['logo','loginLogo',_0x84f9('0x5b'),'favicon',_0x84f9('0x5d'),_0x84f9('0x6a'),_0x84f9('0x5e'),_0x84f9('0x5f')],'raw':!![]});})[_0x84f9('0x32')](handleEntityNotFound(_0x301864,null))[_0x84f9('0x32')](function(_0x3c4e41){if(_0x3c4e41){var _0x1f1338=_0x3c4e41[_0x84f9('0x58')]&&fs[_0x84f9('0x60')](path[_0x84f9('0x62')](config['root'],_0x4a5d1b,_[_0x84f9('0x63')](_0x3c4e41[_0x84f9('0x58')])))?path[_0x84f9('0x62')](config[_0x84f9('0x61')],_0x4a5d1b,_[_0x84f9('0x63')](_0x3c4e41['loginLogo'])):path['join'](config['root'],_0x4a5d1b,_[_0x84f9('0x63')](_0x84f9('0x6b')));var _0x57555b='default'+_[_0x84f9('0x65')](_0x84f9('0x58'));if(_0x3c4e41[_0x57555b]||!_0x41c941['custom']){_0x1f1338=path['join'](config[_0x84f9('0x61')],_0x4a5d1b,_['toLower'](_0x84f9('0x6b')));}if(!fs[_0x84f9('0x60')](_0x1f1338)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x84f9('0x58'))+'\x20not\x20found');}return _0x301864[_0x84f9('0x6c')](_0x1f1338);}})[_0x84f9('0x26')](handleError(_0x301864,null));};exports['gdpr']=function(_0x3bc728,_0x7adc85){return db[_0x84f9('0x38')][_0x84f9('0x54')]({'where':{'id':_0x3bc728[_0x84f9('0x51')]['id']},'attributes':[_0x84f9('0x6d')]})[_0x84f9('0x32')](respondWithResult(_0x7adc85,null))['catch'](handleError(_0x7adc85,null));};exports['addPreferred']=function(_0x596c24,_0x4c6d5b,_0x555c80){if(_0x596c24['file']&&_0x596c24[_0x84f9('0x55')][_0x84f9('0x56')]){_0x596c24[_0x84f9('0x53')][_0x84f9('0x5b')]=_0x596c24[_0x84f9('0x55')][_0x84f9('0x56')];}return db[_0x84f9('0x38')][_0x84f9('0x54')]({'where':{'id':_0x596c24[_0x84f9('0x51')]['id']}})[_0x84f9('0x32')](handleEntityNotFound(_0x4c6d5b,null))[_0x84f9('0x32')](saveUpdates(_0x596c24[_0x84f9('0x53')],null))[_0x84f9('0x32')](respondWithResult(_0x4c6d5b,null))[_0x84f9('0x26')](handleError(_0x4c6d5b,null));};var utilLicense=require(_0x84f9('0x59'));exports[_0x84f9('0x6e')]=function(_0x494405,_0x1e9dea,_0x1d3b74){var _0xfebc2c=_0x84f9('0x5a');var _0x4b70e3={'custom':![]};return utilLicense[_0x84f9('0x69')]()['then'](function(_0x45bb14){if(_0x45bb14){_0x4b70e3=_0x45bb14;}return db[_0x84f9('0x38')][_0x84f9('0x54')]({'where':{'id':_0x494405[_0x84f9('0x51')]['id']},'attributes':[_0x84f9('0x57'),_0x84f9('0x58'),_0x84f9('0x5b'),_0x84f9('0x5c'),_0x84f9('0x5d'),'defaultLoginLogo',_0x84f9('0x5e'),'defaultFavicon'],'raw':!![]});})[_0x84f9('0x32')](handleEntityNotFound(_0x1e9dea,null))[_0x84f9('0x32')](function(_0x28fe5b){if(_0x28fe5b){var _0x2f822d=_0x28fe5b['preferred']&&fs[_0x84f9('0x60')](path[_0x84f9('0x62')](config[_0x84f9('0x61')],_0xfebc2c,_[_0x84f9('0x63')](_0x28fe5b[_0x84f9('0x5b')])))?path[_0x84f9('0x62')](config['root'],_0xfebc2c,_[_0x84f9('0x63')](_0x28fe5b['preferred'])):path[_0x84f9('0x62')](config['root'],_0xfebc2c,_[_0x84f9('0x63')](_0x84f9('0x6f')));var _0x4b893b=_0x84f9('0x64')+_[_0x84f9('0x65')]('preferred');if(_0x28fe5b[_0x4b893b]||!_0x4b70e3[_0x84f9('0x66')]||!_0x4b70e3[_0x84f9('0x5b')]){_0x2f822d=path[_0x84f9('0x62')](config[_0x84f9('0x61')],_0xfebc2c,_[_0x84f9('0x63')](_0x84f9('0x6f')));}if(!fs[_0x84f9('0x60')](_0x2f822d)){throw new db[(_0x84f9('0x1b'))][(_0x84f9('0x70'))](_[_0x84f9('0x65')](_0x84f9('0x5b'))+_0x84f9('0x71'));}return _0x1e9dea[_0x84f9('0x6c')](_0x2f822d);}})[_0x84f9('0x26')](handleError(_0x1e9dea,null));};exports[_0x84f9('0x72')]=function(_0x5638ca,_0x319ab4,_0x116618){if(_0x5638ca[_0x84f9('0x55')]&&_0x5638ca[_0x84f9('0x55')][_0x84f9('0x56')]){_0x5638ca[_0x84f9('0x53')][_0x84f9('0x5c')]=_0x5638ca['file'][_0x84f9('0x56')];}return db['Setting']['find']({'where':{'id':_0x5638ca[_0x84f9('0x51')]['id']}})[_0x84f9('0x32')](handleEntityNotFound(_0x319ab4,null))[_0x84f9('0x32')](saveUpdates(_0x5638ca[_0x84f9('0x53')],null))[_0x84f9('0x32')](respondWithResult(_0x319ab4,null))[_0x84f9('0x26')](handleError(_0x319ab4,null));};var utilLicense=require(_0x84f9('0x59'));exports[_0x84f9('0x73')]=function(_0x37d891,_0x540c27,_0x3faab3){var _0x1e777b=_0x84f9('0x5a');var _0x352d22={'custom':![]};return utilLicense['getLicense']()[_0x84f9('0x32')](function(_0x308ebf){if(_0x308ebf){_0x352d22=_0x308ebf;}return db[_0x84f9('0x38')][_0x84f9('0x54')]({'where':{'id':_0x37d891[_0x84f9('0x51')]['id']},'attributes':[_0x84f9('0x57'),_0x84f9('0x58'),_0x84f9('0x5b'),'favicon',_0x84f9('0x5d'),_0x84f9('0x6a'),_0x84f9('0x5e'),_0x84f9('0x5f')],'raw':!![]});})[_0x84f9('0x32')](handleEntityNotFound(_0x540c27,null))['then'](function(_0x4df553){if(_0x4df553){var _0x3a2c32=_0x4df553['favicon']&&fs[_0x84f9('0x60')](path[_0x84f9('0x62')](config[_0x84f9('0x61')],_0x1e777b,_[_0x84f9('0x63')](_0x4df553[_0x84f9('0x5c')])))?path['join'](config[_0x84f9('0x61')],_0x1e777b,_[_0x84f9('0x63')](_0x4df553[_0x84f9('0x5c')])):path[_0x84f9('0x62')](config[_0x84f9('0x61')],_0x1e777b,_[_0x84f9('0x63')](_0x84f9('0x74')));var _0x2548d1=_0x84f9('0x64')+_[_0x84f9('0x65')](_0x84f9('0x5c'));if(_0x4df553[_0x2548d1]||!_0x352d22['custom']){_0x3a2c32=path['join'](config[_0x84f9('0x61')],_0x1e777b,_[_0x84f9('0x63')](_0x84f9('0x74')));}if(!fs['existsSync'](_0x3a2c32)){throw new db['Sequelize'][(_0x84f9('0x70'))](_[_0x84f9('0x65')](_0x84f9('0x5c'))+'\x20not\x20found');}return _0x540c27[_0x84f9('0x6c')](_0x3a2c32);}})[_0x84f9('0x26')](handleError(_0x540c27,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index f95196e..c0e295e 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 _0x17bb=['exports','settings','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x17bb,0x1ec));var _0xb17b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x17bb[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0xb17b('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb17b('0x1'));var BPromise=require(_0xb17b('0x2'));var rp=require(_0xb17b('0x3'));var fs=require('fs');var path=require(_0xb17b('0x4'));var rimraf=require(_0xb17b('0x5'));var config=require(_0xb17b('0x6'));var attributes=require(_0xb17b('0x7'));module[_0xb17b('0x8')]=function(_0x51104a,_0x3c676d){return _0x51104a['define']('Setting',attributes,{'tableName':_0xb17b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x31c9=['request-promise','rimraf','exports','Setting','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5705e8,_0x2f353c){var _0x536be3=function(_0x56dc23){while(--_0x56dc23){_0x5705e8['push'](_0x5705e8['shift']());}};_0x536be3(++_0x2f353c);}(_0x31c9,0x1a8));var _0x931c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x31c9[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x931c('0x0'));var util=require(_0x931c('0x1'));var logger=require(_0x931c('0x2'))(_0x931c('0x3'));var moment=require(_0x931c('0x4'));var BPromise=require(_0x931c('0x5'));var rp=require(_0x931c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x931c('0x7'));var config=require('../../config/environment');var attributes=require('./setting.attributes');module[_0x931c('0x8')]=function(_0xe3048f,_0x5e1340){return _0xe3048f['define'](_0x931c('0x9'),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 0bbe3e1..8b833d6 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 _0xb45b=['request\x20sent','stringify','error','code','message','info','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x361b45,_0x4a5109){var _0xc639cc=function(_0x3b603d){while(--_0x3b603d){_0x361b45['push'](_0x361b45['shift']());}};_0xc639cc(++_0x4a5109);}(_0xb45b,0x15c));var _0xbb45=function(_0x3dc538,_0x4f7702){_0x3dc538=_0x3dc538-0x0;var _0x72c2fd=_0xb45b[_0x3dc538];return _0x72c2fd;};'use strict';var _=require('lodash');var util=require(_0xbb45('0x0'));var moment=require('moment');var BPromise=require(_0xbb45('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb45('0x2'))['db'];var utils=require(_0xbb45('0x3'));var logger=require(_0xbb45('0x4'))(_0xbb45('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbb45('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3c8d11,_0x3cf5d1,_0x5720d5){return new BPromise(function(_0x48e6c8,_0xf5eca2){return client[_0xbb45('0x7')](_0x3c8d11,_0x5720d5)[_0xbb45('0x8')](function(_0x54a4c7){logger['info'](_0xbb45('0x9'),_0x3cf5d1,'request\x20sent');logger[_0xbb45('0xa')](_0xbb45('0xb'),_0x3cf5d1,_0xbb45('0xc'),JSON[_0xbb45('0xd')](_0x54a4c7));if(_0x54a4c7[_0xbb45('0xe')]){if(_0x54a4c7[_0xbb45('0xe')][_0xbb45('0xf')]===0x1f4){logger[_0xbb45('0xe')](_0xbb45('0x9'),_0x3cf5d1,_0x54a4c7[_0xbb45('0xe')]['message']);return _0xf5eca2(_0x54a4c7[_0xbb45('0xe')][_0xbb45('0x10')]);}logger[_0xbb45('0xe')]('Setting,\x20%s,\x20%s',_0x3cf5d1,_0x54a4c7[_0xbb45('0xe')][_0xbb45('0x10')]);return _0x48e6c8(_0x54a4c7[_0xbb45('0xe')]['message']);}else{logger[_0xbb45('0x11')](_0xbb45('0x9'),_0x3cf5d1,_0xbb45('0xc'));_0x48e6c8(_0x54a4c7['result']['message']);}})['catch'](function(_0xbe4781){logger[_0xbb45('0xe')]('Setting,\x20%s,\x20%s',_0x3cf5d1,_0xbe4781);_0xf5eca2(_0xbe4781);});});} \ No newline at end of file +var _0x12a6=['info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request'];(function(_0x3a5ee9,_0x5b2103){var _0x5af0da=function(_0x525fb4){while(--_0x525fb4){_0x3a5ee9['push'](_0x3a5ee9['shift']());}};_0x5af0da(++_0x5b2103);}(_0x12a6,0x116));var _0x612a=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0x12a6[_0xe1a3a5];return _0x362646;};'use strict';var _=require(_0x612a('0x0'));var util=require('util');var moment=require(_0x612a('0x1'));var BPromise=require(_0x612a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x612a('0x3'));var db=require(_0x612a('0x4'))['db'];var utils=require(_0x612a('0x5'));var logger=require('../../config/logger')(_0x612a('0x6'));var config=require(_0x612a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x612a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x31db9a,_0x1df063,_0xaeb2f){return new BPromise(function(_0x4e58e0,_0x1cb5da){return client[_0x612a('0x9')](_0x31db9a,_0xaeb2f)['then'](function(_0x5aa7a6){logger[_0x612a('0xa')](_0x612a('0xb'),_0x1df063,_0x612a('0xc'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x1df063,'request\x20sent',JSON[_0x612a('0xd')](_0x5aa7a6));if(_0x5aa7a6['error']){if(_0x5aa7a6[_0x612a('0xe')]['code']===0x1f4){logger[_0x612a('0xe')](_0x612a('0xb'),_0x1df063,_0x5aa7a6['error'][_0x612a('0xf')]);return _0x1cb5da(_0x5aa7a6['error']['message']);}logger['error'](_0x612a('0xb'),_0x1df063,_0x5aa7a6[_0x612a('0xe')]['message']);return _0x4e58e0(_0x5aa7a6[_0x612a('0xe')][_0x612a('0xf')]);}else{logger[_0x612a('0xa')](_0x612a('0xb'),_0x1df063,_0x612a('0xc'));_0x4e58e0(_0x5aa7a6[_0x612a('0x10')][_0x612a('0xf')]);}})[_0x612a('0x11')](function(_0x5190a9){logger[_0x612a('0xe')]('Setting,\x20%s,\x20%s',_0x1df063,_0x5190a9);_0x1cb5da(_0x5190a9);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 84e5af3..761b946 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 _0x0871=['notify','addApplications','send','status','put','update','/:id','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','index','/describe','describe','isAuthenticated','show','/:id/dispositions','getAnswers','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer'];(function(_0xf3e6f9,_0x1e6e04){var _0x4550d8=function(_0x388ce0){while(--_0x388ce0){_0xf3e6f9['push'](_0xf3e6f9['shift']());}};_0x4550d8(++_0x1e6e04);}(_0x0871,0xd9));var _0x1087=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0871[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x1087('0x0'));var util=require(_0x1087('0x1'));var path=require(_0x1087('0x2'));var timeout=require(_0x1087('0x3'));var express=require(_0x1087('0x4'));var router=express[_0x1087('0x5')]();var auth=require(_0x1087('0x6'));var interaction=require(_0x1087('0x7'));var config=require(_0x1087('0x8'));var controller=require(_0x1087('0x9'));router[_0x1087('0xa')]('/',auth['isAuthenticated'](),controller[_0x1087('0xb')]);router[_0x1087('0xa')](_0x1087('0xc'),auth['isAuthenticated'](),controller[_0x1087('0xd')]);router[_0x1087('0xa')]('/:id',auth[_0x1087('0xe')](),controller[_0x1087('0xf')]);router[_0x1087('0xa')](_0x1087('0x10'),auth[_0x1087('0xe')](),controller['getDispositions']);router[_0x1087('0xa')]('/:id/canned_answers',auth[_0x1087('0xe')](),controller[_0x1087('0x11')]);router[_0x1087('0xa')]('/:id/applications',auth[_0x1087('0xe')](),controller['getApplications']);router[_0x1087('0xa')](_0x1087('0x12'),auth[_0x1087('0xe')](),controller[_0x1087('0x13')]);router['get'](_0x1087('0x14'),controller[_0x1087('0x15')]);router['get'](_0x1087('0x16'),auth['isAuthenticated'](),controller[_0x1087('0x17')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1087('0x18')]);router[_0x1087('0x19')](_0x1087('0x10'),auth[_0x1087('0xe')](),controller[_0x1087('0x1a')]);router['post'](_0x1087('0x1b'),auth[_0x1087('0xe')](),controller[_0x1087('0x1c')]);router[_0x1087('0x19')]('/:id/notify',controller[_0x1087('0x1d')]);router[_0x1087('0x19')]('/:id/applications',auth[_0x1087('0xe')](),controller[_0x1087('0x1e')]);router[_0x1087('0x19')]('/:id/send',auth[_0x1087('0xe')](),controller[_0x1087('0x1f')]);router['post'](_0x1087('0x14'),controller[_0x1087('0x20')]);router[_0x1087('0x19')]('/:id/users',auth[_0x1087('0xe')](),controller['addAgents']);router[_0x1087('0x21')]('/:id',auth[_0x1087('0xe')](),controller[_0x1087('0x22')]);router['delete'](_0x1087('0x23'),auth[_0x1087('0xe')](),controller['destroy']);router[_0x1087('0x24')](_0x1087('0x10'),auth[_0x1087('0xe')](),controller[_0x1087('0x25')]);router['delete'](_0x1087('0x1b'),auth[_0x1087('0xe')](),controller[_0x1087('0x26')]);router[_0x1087('0x24')](_0x1087('0x16'),auth[_0x1087('0xe')](),controller[_0x1087('0x27')]);module[_0x1087('0x28')]=router; \ No newline at end of file +var _0xcf29=['/:id/dispositions','getDispositions','getAnswers','/:id/applications','getInteractions','/:id/status','statusGet','getAgents','post','create','addDisposition','/:id/canned_answers','/:id/notify','notify','addApplications','send','status','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','../../components/auth/service','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x11f202,_0x5578b9){var _0x505b5d=function(_0x4d53bc){while(--_0x4d53bc){_0x11f202['push'](_0x11f202['shift']());}};_0x505b5d(++_0x5578b9);}(_0xcf29,0x14a));var _0x9cf2=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0xcf29[_0x59f0dc];return _0x5b5445;};'use strict';var multer=require(_0x9cf2('0x0'));var util=require(_0x9cf2('0x1'));var path=require(_0x9cf2('0x2'));var timeout=require(_0x9cf2('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x9cf2('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsAccount.controller');router[_0x9cf2('0x5')]('/',auth['isAuthenticated'](),controller[_0x9cf2('0x6')]);router['get'](_0x9cf2('0x7'),auth[_0x9cf2('0x8')](),controller[_0x9cf2('0x9')]);router[_0x9cf2('0x5')](_0x9cf2('0xa'),auth['isAuthenticated'](),controller[_0x9cf2('0xb')]);router[_0x9cf2('0x5')](_0x9cf2('0xc'),auth[_0x9cf2('0x8')](),controller[_0x9cf2('0xd')]);router[_0x9cf2('0x5')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x9cf2('0xe')]);router[_0x9cf2('0x5')](_0x9cf2('0xf'),auth[_0x9cf2('0x8')](),controller['getApplications']);router['get']('/:id/interactions',auth[_0x9cf2('0x8')](),controller[_0x9cf2('0x10')]);router[_0x9cf2('0x5')](_0x9cf2('0x11'),controller[_0x9cf2('0x12')]);router[_0x9cf2('0x5')]('/:id/users',auth[_0x9cf2('0x8')](),controller[_0x9cf2('0x13')]);router[_0x9cf2('0x14')]('/',auth[_0x9cf2('0x8')](),controller[_0x9cf2('0x15')]);router['post']('/:id/dispositions',auth[_0x9cf2('0x8')](),controller[_0x9cf2('0x16')]);router[_0x9cf2('0x14')](_0x9cf2('0x17'),auth[_0x9cf2('0x8')](),controller['addAnswer']);router[_0x9cf2('0x14')](_0x9cf2('0x18'),controller[_0x9cf2('0x19')]);router[_0x9cf2('0x14')](_0x9cf2('0xf'),auth[_0x9cf2('0x8')](),controller[_0x9cf2('0x1a')]);router['post']('/:id/send',auth[_0x9cf2('0x8')](),controller[_0x9cf2('0x1b')]);router[_0x9cf2('0x14')](_0x9cf2('0x11'),controller[_0x9cf2('0x1c')]);router['post'](_0x9cf2('0x1d'),auth[_0x9cf2('0x8')](),controller[_0x9cf2('0x1e')]);router[_0x9cf2('0x1f')](_0x9cf2('0xa'),auth[_0x9cf2('0x8')](),controller[_0x9cf2('0x20')]);router[_0x9cf2('0x21')]('/:id',auth[_0x9cf2('0x8')](),controller[_0x9cf2('0x22')]);router[_0x9cf2('0x21')](_0x9cf2('0xc'),auth['isAuthenticated'](),controller[_0x9cf2('0x23')]);router[_0x9cf2('0x21')](_0x9cf2('0x17'),auth[_0x9cf2('0x8')](),controller['removeAnswers']);router[_0x9cf2('0x21')](_0x9cf2('0x1d'),auth[_0x9cf2('0x8')](),controller[_0x9cf2('0x24')]);module[_0x9cf2('0x25')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 2b196fe..6dad70c 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 _0xfa3a=['exports','STRING','generate','ENUM','twilio','connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring'];(function(_0x4c5a42,_0x5ac0a8){var _0x3ba011=function(_0xb03169){while(--_0xb03169){_0x4c5a42['push'](_0x4c5a42['shift']());}};_0x3ba011(++_0x5ac0a8);}(_0xfa3a,0x1b6));var _0xafa3=function(_0xfecbad,_0x5915f8){_0xfecbad=_0xfecbad-0x0;var _0x5e1806=_0xfa3a[_0xfecbad];return _0x5e1806;};'use strict';var Sequelize=require(_0xafa3('0x0'));var rs=require(_0xafa3('0x1'));module[_0xafa3('0x2')]={'name':{'type':Sequelize[_0xafa3('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xafa3('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xafa3('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xafa3('0x4')]();}},'phone':{'type':Sequelize[_0xafa3('0x3')]},'type':{'type':Sequelize[_0xafa3('0x5')](_0xafa3('0x6'),'skebby',_0xafa3('0x7'),_0xafa3('0x8'),_0xafa3('0x9'),_0xafa3('0xa'),_0xafa3('0xb'),_0xafa3('0xc'),_0xafa3('0xd'))},'accountSid':{'type':Sequelize[_0xafa3('0x3')]},'authId':{'type':Sequelize[_0xafa3('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xafa3('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xafa3('0x3')]},'apiKey':{'type':Sequelize[_0xafa3('0x3')]},'senderString':{'type':Sequelize[_0xafa3('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xafa3('0x3')]},'notificationTemplate':{'type':Sequelize[_0xafa3('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xafa3('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xafa3('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xafa3('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xafa3('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xafa3('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xafa3('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xafa3('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xafa3('0x10')],'comment':_0xafa3('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xafa3('0xf')],'defaultValue':![],'comment':_0xafa3('0x12'),'set':function(_0x47a7dc){if(!_0x47a7dc)this[_0xafa3('0x13')](_0xafa3('0x14'),null);this[_0xafa3('0x13')](_0xafa3('0x15'),_0x47a7dc);}}}; \ No newline at end of file +var _0x5e4c=['STRING','generate','ENUM','twilio','clicksend','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','randomstring','exports','name'];(function(_0x5ad794,_0x330eb1){var _0x58d45e=function(_0x28c899){while(--_0x28c899){_0x5ad794['push'](_0x5ad794['shift']());}};_0x58d45e(++_0x330eb1);}(_0x5e4c,0x95));var _0xc5e4=function(_0x3f9b6e,_0x2c7a8a){_0x3f9b6e=_0x3f9b6e-0x0;var _0x586848=_0x5e4c[_0x3f9b6e];return _0x586848;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc5e4('0x0'));module[_0xc5e4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc5e4('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xc5e4('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xc5e4('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xc5e4('0x3')],'defaultValue':function(){return rs[_0xc5e4('0x4')]();}},'phone':{'type':Sequelize[_0xc5e4('0x3')]},'type':{'type':Sequelize[_0xc5e4('0x5')](_0xc5e4('0x6'),'skebby','connectel',_0xc5e4('0x7'),_0xc5e4('0x8'),_0xc5e4('0x9'),_0xc5e4('0xa'),_0xc5e4('0xb'),_0xc5e4('0xc'))},'accountSid':{'type':Sequelize[_0xc5e4('0x3')]},'authId':{'type':Sequelize[_0xc5e4('0x3')]},'authToken':{'type':Sequelize[_0xc5e4('0x3')]},'smsMethod':{'type':Sequelize[_0xc5e4('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc5e4('0x3')]},'apiKey':{'type':Sequelize[_0xc5e4('0x3')]},'senderString':{'type':Sequelize[_0xc5e4('0x3')]},'deliveryReport':{'type':Sequelize[_0xc5e4('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xc5e4('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc5e4('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc5e4('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc5e4('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc5e4('0xf')],'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[_0xc5e4('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc5e4('0xf')],'comment':_0xc5e4('0x10')},'mandatoryDisposition':{'type':Sequelize[_0xc5e4('0xd')],'defaultValue':![],'comment':_0xc5e4('0x11'),'set':function(_0x2ddaa8){if(!_0x2ddaa8)this['setDataValue'](_0xc5e4('0x12'),null);this['setDataValue']('mandatoryDisposition',_0x2ddaa8);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 1a73d8b..1258954 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 _0x9957=['show','params','fields','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','nolimit','sort','pick','rows','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','notify','sms','account','applications','orderBy','Applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','list','omit','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','entity\x20found','stringify','Content-Type','text/xml','addApplications','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','DESC','dataValues','Messages','log','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','intelepeer','DELIVERED','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','test','ValidationError','then','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','apply','save','destroy','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','limit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x59c2cb,_0x671ebb){var _0x4d2910=function(_0x50c769){while(--_0x50c769){_0x59c2cb['push'](_0x59c2cb['shift']());}};_0x4d2910(++_0x671ebb);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 db=require(_0x7995('0x19'))['db'];config[_0x7995('0x1a')]=_[_0x7995('0x1b')](config[_0x7995('0x1a')],{'host':_0x7995('0x1c'),'port':0x18eb});var socket=require(_0x7995('0x1d'))(new Redis(config[_0x7995('0x1a')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x7995('0x1e'));var client=jayson[_0x7995('0x1f')][_0x7995('0x20')]({'port':0x232c});function checkPasswordPattern(_0x321ae8,_0x3f1d3e,_0x1a5310){if(_0x1a5310){var _0x2202ce=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2202ce[_0x7995('0x21')](_0x3f1d3e)){return _0x321ae8;}else{throw new db['Sequelize'][(_0x7995('0x22'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x321ae8;}}function respondWithRpcPromise(_0x2f832e,_0x37f297,_0x43d4b8,_0x291317){return new BPromise(function(_0x1e1415,_0x37a7d4){var _0x4faa60=_0x291317||client;return _0x4faa60['request'](_0x2f832e,_0x43d4b8)[_0x7995('0x23')](function(_0x5e6f90){logger['info'](_0x7995('0x24'),_0x37f297,_0x7995('0x25'));logger['debug'](_0x7995('0x26'),_0x37f297,'request\x20sent',JSON['stringify'](_0x5e6f90));if(_0x5e6f90[_0x7995('0x27')]){if(_0x5e6f90[_0x7995('0x27')][_0x7995('0x28')]===0x1f4){logger[_0x7995('0x27')](_0x7995('0x24'),_0x37f297,_0x5e6f90[_0x7995('0x27')]['message']);return _0x37a7d4(_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);}logger[_0x7995('0x27')](_0x7995('0x24'),_0x37f297,_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);return _0x1e1415(_0x5e6f90[_0x7995('0x27')][_0x7995('0x29')]);}else{logger['info'](_0x7995('0x24'),_0x37f297,_0x7995('0x25'));_0x1e1415(_0x5e6f90[_0x7995('0x2a')][_0x7995('0x29')]);}})[_0x7995('0x2b')](function(_0x2a307e){logger['error'](_0x7995('0x24'),_0x37f297,_0x2a307e);_0x37a7d4(_0x2a307e);});});}function respondWithStatusCode(_0x5911c3,_0x229742){_0x229742=_0x229742||0xcc;return function(_0x49bc7e){if(_0x49bc7e){return _0x5911c3[_0x7995('0x2c')](_0x229742);}return _0x5911c3[_0x7995('0x2d')](_0x229742)[_0x7995('0x2e')]();};}function respondWithResult(_0x4b6f99,_0x9b2a15){_0x9b2a15=_0x9b2a15||0xc8;return function(_0x514445){if(_0x514445){return _0x4b6f99[_0x7995('0x2d')](_0x9b2a15)[_0x7995('0x2f')](_0x514445);}};}function respondWithFilteredResult(_0x4253e5,_0x574574){return function(_0x530611){if(_0x530611){var _0x48e573=_0x530611[_0x7995('0x30')],_0x3573be=_0x574574[_0x7995('0x31')],_0xe6b0b3=_0x574574[_0x7995('0x31')]+_0x574574['limit'],_0x327a81;if(_0xe6b0b3>=_0x48e573){_0xe6b0b3=_0x48e573;_0x327a81=0xc8;}else{_0x327a81=0xce;}_0x4253e5['status'](_0x327a81);return _0x4253e5[_0x7995('0x32')]('Content-Range',_0x3573be+'-'+_0xe6b0b3+'/'+_0x48e573)[_0x7995('0x2f')](_0x530611);}return null;};}function patchUpdates(_0x3eb566){return function(_0x29fac5){try{jsonpatch[_0x7995('0x33')](_0x29fac5,_0x3eb566,!![]);}catch(_0x1f7d27){return BPromise['reject'](_0x1f7d27);}return _0x29fac5[_0x7995('0x34')]();};}function saveUpdates(_0x33e24e,_0x5dd802){return function(_0x48db25){if(_0x48db25){return _0x48db25['update'](_0x33e24e)[_0x7995('0x23')](function(_0x3acfc3){return _0x3acfc3;});}return null;};}function removeEntity(_0x4a176f,_0x3e7020){return function(_0x51b95d){if(_0x51b95d){return _0x51b95d[_0x7995('0x35')]()[_0x7995('0x23')](function(){var _0x177cb4=_0x51b95d['get']({'plain':!![]});var _0x52d76d=_0x7995('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x52d76d,'resourceId':_0x177cb4['id']}})[_0x7995('0x23')](function(){return _0x51b95d;});})[_0x7995('0x23')](function(){_0x4a176f['status'](0xcc)[_0x7995('0x2e')]();});}};}function handleEntityNotFound(_0x1922b4,_0x2b772f){return function(_0x18667c){if(!_0x18667c){_0x1922b4[_0x7995('0x2c')](0x194);}return _0x18667c;};}function handleError(_0x53002a,_0x2d4285){_0x2d4285=_0x2d4285||0x1f4;return function(_0x242713){logger[_0x7995('0x27')](_0x242713[_0x7995('0x37')]);if(_0x242713['name']){delete _0x242713[_0x7995('0x38')];}_0x53002a[_0x7995('0x2d')](_0x2d4285)[_0x7995('0x39')](_0x242713);};}exports[_0x7995('0x3a')]=function(_0x1f5bee,_0x1035dc){var _0x5688a1={'include':[{'model':db[_0x7995('0x3b')],'as':_0x7995('0x3c')}]},_0x183a68={},_0x3be298={'count':0x0,'rows':[]};var _0x2e04cd=_[_0x7995('0x3d')](db[_0x7995('0x3e')][_0x7995('0x3f')],function(_0x1234e1){return{'name':_0x1234e1[_0x7995('0x40')],'type':_0x1234e1[_0x7995('0x41')][_0x7995('0x42')]};});_0x183a68[_0x7995('0x43')]=_['map'](_0x2e04cd,'name');_0x183a68[_0x7995('0x44')]=_[_0x7995('0x45')](_0x1f5bee['query']);_0x183a68['filters']=_[_0x7995('0x46')](_0x183a68['model'],_0x183a68['query']);_0x5688a1[_0x7995('0x47')]=_[_0x7995('0x46')](_0x183a68[_0x7995('0x43')],qs['fields'](_0x1f5bee[_0x7995('0x44')]['fields']));_0x5688a1[_0x7995('0x47')]=_0x5688a1['attributes']['length']?_0x5688a1[_0x7995('0x47')]:_0x183a68[_0x7995('0x43')];if(!_0x1f5bee[_0x7995('0x44')][_0x7995('0x48')]('nolimit')){_0x5688a1[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x1f5bee[_0x7995('0x44')][_0x7995('0x49')]);_0x5688a1['offset']=qs['offset'](_0x1f5bee[_0x7995('0x44')]['offset']);}_0x5688a1[_0x7995('0x4a')]=qs['sort'](_0x1f5bee[_0x7995('0x44')]['sort']);_0x5688a1[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_['pick'](_0x1f5bee[_0x7995('0x44')],_0x183a68[_0x7995('0x4c')]),_0x2e04cd);if(_0x1f5bee[_0x7995('0x44')][_0x7995('0x4d')]){_0x5688a1['where']=_[_0x7995('0x4e')](_0x5688a1[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x2e04cd,function(_0x491184){if(_0x491184[_0x7995('0x41')]!==_0x7995('0x4f')){var _0x511567={};_0x511567[_0x491184[_0x7995('0x38')]]={'$like':'%'+_0x1f5bee[_0x7995('0x44')]['filter']+'%'};return _0x511567;}})});}_0x5688a1=_[_0x7995('0x4e')]({},_0x5688a1,_0x1f5bee[_0x7995('0x50')]);var _0x5921b9={'where':_0x5688a1[_0x7995('0x4b')]};return db['SmsAccount'][_0x7995('0x30')](_0x5921b9)[_0x7995('0x23')](function(_0x1afab4){_0x3be298[_0x7995('0x30')]=_0x1afab4;if(_0x1f5bee[_0x7995('0x44')][_0x7995('0x51')]){_0x5688a1[_0x7995('0x52')]=[{'all':!![]}];}return db['SmsAccount'][_0x7995('0x53')](_0x5688a1);})[_0x7995('0x23')](function(_0x418eb9){_0x3be298['rows']=_0x418eb9;return _0x3be298;})[_0x7995('0x23')](respondWithFilteredResult(_0x1035dc,_0x5688a1))[_0x7995('0x2b')](handleError(_0x1035dc,null));};exports[_0x7995('0x54')]=function(_0x47d1d8,_0x4ec548){var _0x5a592e={'raw':![],'where':{'id':_0x47d1d8[_0x7995('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x7995('0x3c')}]},_0xb70620={};_0xb70620[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0x3e')][_0x7995('0x3f')]);_0xb70620['query']=_[_0x7995('0x45')](_0x47d1d8['query']);_0xb70620[_0x7995('0x4c')]=_[_0x7995('0x46')](_0xb70620[_0x7995('0x43')],_0xb70620['query']);_0x5a592e['attributes']=_['intersection'](_0xb70620['model'],qs[_0x7995('0x56')](_0x47d1d8[_0x7995('0x44')][_0x7995('0x56')]));_0x5a592e[_0x7995('0x47')]=_0x5a592e[_0x7995('0x47')][_0x7995('0x57')]?_0x5a592e[_0x7995('0x47')]:_0xb70620[_0x7995('0x43')];if(_0x47d1d8[_0x7995('0x44')][_0x7995('0x51')]){_0x5a592e[_0x7995('0x52')]=[{'all':!![]}];}_0x5a592e=_[_0x7995('0x4e')]({},_0x5a592e,_0x47d1d8[_0x7995('0x50')]);return db[_0x7995('0x3e')][_0x7995('0x58')](_0x5a592e)[_0x7995('0x23')](handleEntityNotFound(_0x4ec548,null))[_0x7995('0x23')](respondWithResult(_0x4ec548,null))[_0x7995('0x2b')](handleError(_0x4ec548,null));};exports[_0x7995('0x59')]=function(_0x50b7c2,_0x56a374){return db[_0x7995('0x3e')][_0x7995('0x59')](_0x50b7c2[_0x7995('0x5a')],{})['then'](function(_0x53125a){var _0x402fa0=_0x50b7c2[_0x7995('0x5b')][_0x7995('0x5c')]({'plain':!![]});if(!_0x402fa0)throw new Error(_0x7995('0x5d'));if(_0x402fa0['role']===_0x7995('0x5b')){var _0x74ff38=_0x53125a[_0x7995('0x5c')]({'plain':!![]});var _0x33c49c='SmsAccounts';return db['UserProfileSection'][_0x7995('0x58')]({'where':{'name':_0x33c49c,'userProfileId':_0x402fa0[_0x7995('0x5e')]},'raw':!![]})[_0x7995('0x23')](function(_0x1d69ce){if(_0x1d69ce&&_0x1d69ce[_0x7995('0x5f')]===0x0){return db[_0x7995('0x60')][_0x7995('0x59')]({'name':_0x74ff38[_0x7995('0x38')],'resourceId':_0x74ff38['id'],'type':_0x1d69ce[_0x7995('0x38')],'sectionId':_0x1d69ce['id']},{})['then'](function(){return _0x53125a;});}else{return _0x53125a;}})[_0x7995('0x2b')](function(_0x3ec5a8){logger[_0x7995('0x27')](_0x7995('0x61'),_0x3ec5a8);throw _0x3ec5a8;});}return _0x53125a;})['then'](respondWithResult(_0x56a374,0xc9))['catch'](handleError(_0x56a374,null));};exports[_0x7995('0x62')]=function(_0xebb5c8,_0x47d5d7){if(_0xebb5c8[_0x7995('0x5a')]['id']){delete _0xebb5c8[_0x7995('0x5a')]['id'];}return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0xebb5c8[_0x7995('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x7995('0x3c')}]})['then'](handleEntityNotFound(_0x47d5d7,null))[_0x7995('0x23')](saveUpdates(_0xebb5c8[_0x7995('0x5a')],null))[_0x7995('0x23')](respondWithResult(_0x47d5d7,null))[_0x7995('0x2b')](handleError(_0x47d5d7,null));};exports[_0x7995('0x35')]=function(_0xeb8920,_0x2b3c1d){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0xeb8920[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x2b3c1d,null))[_0x7995('0x23')](removeEntity(_0x2b3c1d,null))['catch'](handleError(_0x2b3c1d,null));};exports[_0x7995('0x63')]=function(_0x23bbc1,_0x293480){return db[_0x7995('0x3e')][_0x7995('0x63')]()['then'](respondWithResult(_0x293480,null))['catch'](handleError(_0x293480,null));};exports[_0x7995('0x64')]=function(_0x87e38d,_0x221542,_0xae6166){if(_0x87e38d['body']['id']){delete _0x87e38d[_0x7995('0x5a')]['id'];}return db['SmsAccount']['find']({'where':{'id':_0x87e38d[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x221542,null))[_0x7995('0x23')](function(_0x44bf2b){if(_0x44bf2b){_0x87e38d[_0x7995('0x5a')][_0x7995('0x65')]=_0x44bf2b['id'];return db[_0x7995('0x66')][_0x7995('0x59')](_0x87e38d[_0x7995('0x5a')]);}})[_0x7995('0x23')](respondWithResult(_0x221542,null))['catch'](handleError(_0x221542,null));};exports[_0x7995('0x67')]=function(_0x8908cd,_0x3c5802,_0x4cc247){var _0x1fe1cb={'raw':![],'where':{}};var _0x1d2f9d={};var _0x705f0={'count':0x0,'rows':[]};return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x8908cd[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x3c5802,null))[_0x7995('0x23')](function(_0x2f94c4){if(_0x2f94c4){_0x1d2f9d[_0x7995('0x43')]=_[_0x7995('0x45')](db['Disposition']['rawAttributes']);_0x1d2f9d[_0x7995('0x44')]=_[_0x7995('0x45')](_0x8908cd[_0x7995('0x44')]);_0x1d2f9d[_0x7995('0x4c')]=_['intersection'](_0x1d2f9d[_0x7995('0x43')],_0x1d2f9d[_0x7995('0x44')]);_0x1fe1cb['attributes']=_['intersection'](_0x1d2f9d[_0x7995('0x43')],qs[_0x7995('0x56')](_0x8908cd['query'][_0x7995('0x56')]));_0x1fe1cb['attributes']=_0x1fe1cb[_0x7995('0x47')][_0x7995('0x57')]?_0x1fe1cb['attributes']:_0x1d2f9d['model'];if(!_0x8908cd[_0x7995('0x44')]['hasOwnProperty'](_0x7995('0x69'))){_0x1fe1cb[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x8908cd[_0x7995('0x44')][_0x7995('0x49')]);_0x1fe1cb[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x8908cd[_0x7995('0x44')][_0x7995('0x31')]);}_0x1fe1cb[_0x7995('0x4a')]=qs[_0x7995('0x6a')](_0x8908cd[_0x7995('0x44')][_0x7995('0x6a')]);_0x1fe1cb[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x8908cd[_0x7995('0x44')],_0x1d2f9d[_0x7995('0x4c')]));_0x1fe1cb[_0x7995('0x4b')][_0x7995('0x65')]=_0x2f94c4['id'];if(_0x8908cd[_0x7995('0x44')][_0x7995('0x4d')]){_0x1fe1cb[_0x7995('0x4b')]=_[_0x7995('0x4e')](_0x1fe1cb[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x1fe1cb[_0x7995('0x47')],function(_0x34724d){var _0x59efff={};_0x59efff[_0x34724d]={'$like':'%'+_0x8908cd[_0x7995('0x44')][_0x7995('0x4d')]+'%'};return _0x59efff;})});}_0x1fe1cb=_['merge']({},_0x1fe1cb,_0x8908cd['options']);return db[_0x7995('0x66')][_0x7995('0x30')]({'where':_0x1fe1cb[_0x7995('0x4b')]})[_0x7995('0x23')](function(_0xe1ce4){_0x705f0[_0x7995('0x30')]=_0xe1ce4;if(_0x8908cd['query'][_0x7995('0x51')]){_0x1fe1cb[_0x7995('0x52')]=[{'all':!![]}];}return db[_0x7995('0x66')][_0x7995('0x53')](_0x1fe1cb);})[_0x7995('0x23')](function(_0x3f0bff){_0x705f0[_0x7995('0x6c')]=_0x3f0bff;return _0x705f0;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x3c5802,_0x1fe1cb))['catch'](handleError(_0x3c5802,null));};exports[_0x7995('0x6d')]=function(_0x2b8217,_0x5c04c9,_0x479271){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x2b8217[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x5c04c9,null))[_0x7995('0x23')](function(_0x4a02ea){if(_0x4a02ea){return _0x4a02ea[_0x7995('0x6d')](_0x2b8217[_0x7995('0x44')]['ids']);}})[_0x7995('0x23')](respondWithStatusCode(_0x5c04c9,null))[_0x7995('0x2b')](handleError(_0x5c04c9,null));};exports['addAnswer']=function(_0x1535a3,_0x4a5bc5,_0x135191){if(_0x1535a3[_0x7995('0x5a')]['id']){delete _0x1535a3[_0x7995('0x5a')]['id'];}return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x1535a3['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x4a5bc5,null))[_0x7995('0x23')](function(_0x38b37f){if(_0x38b37f){_0x1535a3['body'][_0x7995('0x65')]=_0x38b37f['id'];return db[_0x7995('0x6e')][_0x7995('0x59')](_0x1535a3[_0x7995('0x5a')]);}})['then'](respondWithResult(_0x4a5bc5,null))[_0x7995('0x2b')](handleError(_0x4a5bc5,null));};exports[_0x7995('0x6f')]=function(_0x3a5f5e,_0x4aafa3,_0x5358d4){var _0x3fc10={'raw':![],'where':{}};var _0x333379={};var _0x4800a8={'count':0x0,'rows':[]};return db['SmsAccount'][_0x7995('0x68')]({'where':{'id':_0x3a5f5e[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x4aafa3,null))[_0x7995('0x23')](function(_0x2ba606){if(_0x2ba606){_0x333379['model']=_['keys'](db[_0x7995('0x6e')]['rawAttributes']);_0x333379['query']=_[_0x7995('0x45')](_0x3a5f5e[_0x7995('0x44')]);_0x333379[_0x7995('0x4c')]=_['intersection'](_0x333379[_0x7995('0x43')],_0x333379[_0x7995('0x44')]);_0x3fc10[_0x7995('0x47')]=_[_0x7995('0x46')](_0x333379[_0x7995('0x43')],qs['fields'](_0x3a5f5e[_0x7995('0x44')][_0x7995('0x56')]));_0x3fc10[_0x7995('0x47')]=_0x3fc10[_0x7995('0x47')]['length']?_0x3fc10[_0x7995('0x47')]:_0x333379[_0x7995('0x43')];if(!_0x3a5f5e['query'][_0x7995('0x48')](_0x7995('0x69'))){_0x3fc10['limit']=qs[_0x7995('0x49')](_0x3a5f5e['query'][_0x7995('0x49')]);_0x3fc10['offset']=qs[_0x7995('0x31')](_0x3a5f5e['query'][_0x7995('0x31')]);}_0x3fc10[_0x7995('0x4a')]=qs['sort'](_0x3a5f5e[_0x7995('0x44')]['sort']);_0x3fc10['where']=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x3a5f5e[_0x7995('0x44')],_0x333379[_0x7995('0x4c')]));_0x3fc10['where'][_0x7995('0x65')]=_0x2ba606['id'];if(_0x3a5f5e[_0x7995('0x44')]['filter']){_0x3fc10['where']=_[_0x7995('0x4e')](_0x3fc10['where'],{'$or':_[_0x7995('0x3d')](_0x3fc10[_0x7995('0x47')],function(_0xfb4479){var _0x5b42be={};_0x5b42be[_0xfb4479]={'$like':'%'+_0x3a5f5e['query'][_0x7995('0x4d')]+'%'};return _0x5b42be;})});}_0x3fc10=_['merge']({},_0x3fc10,_0x3a5f5e[_0x7995('0x50')]);return db[_0x7995('0x6e')][_0x7995('0x30')]({'where':_0x3fc10[_0x7995('0x4b')]})['then'](function(_0x52d102){_0x4800a8['count']=_0x52d102;if(_0x3a5f5e[_0x7995('0x44')][_0x7995('0x51')]){_0x3fc10[_0x7995('0x52')]=[{'all':!![]}];}return db[_0x7995('0x6e')][_0x7995('0x53')](_0x3fc10);})[_0x7995('0x23')](function(_0x59a793){_0x4800a8['rows']=_0x59a793;return _0x4800a8;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x4aafa3,_0x3fc10))['catch'](handleError(_0x4aafa3,null));};exports['removeAnswers']=function(_0x17d00f,_0x5e95c0,_0x57a164){return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x17d00f[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x5e95c0,null))[_0x7995('0x23')](function(_0xf604d9){if(_0xf604d9){return _0xf604d9[_0x7995('0x70')](_0x17d00f[_0x7995('0x44')][_0x7995('0x71')]);}})[_0x7995('0x23')](respondWithStatusCode(_0x5e95c0,null))[_0x7995('0x2b')](handleError(_0x5e95c0,null));};exports[_0x7995('0x72')]=function(_0x19d746,_0x570b71,_0x3eb3fa){var _0x87a539={'channel':_0x7995('0x73')};var _0x2056da=[];var _0x2a01d4=[];var _0x5a4695={};return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x19d746[_0x7995('0x55')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x17f7d6){_0x87a539[_0x7995('0x74')]=_0x17f7d6;_0x87a539[_0x7995('0x75')]=_[_0x7995('0x76')](_0x17f7d6[_0x7995('0x77')],['priority'],[_0x7995('0x78')]);if(_0x87a539['account'][_0x7995('0x77')]){delete _0x87a539[_0x7995('0x74')][_0x7995('0x77')];}return db[_0x7995('0x79')][_0x7995('0x63')]();})[_0x7995('0x23')](function(_0x4f929b){if(!_0x4f929b){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x7b'));}_0x2056da=_[_0x7995('0x7c')](_['keys'](_0x4f929b),[_0x7995('0x7d'),'updatedAt']);_0x2a01d4=_[_0x7995('0x7c')](_[_0x7995('0x45')](_0x4f929b),['createdAt','updatedAt',_0x7995('0x7e'),_0x7995('0x7f')]);_0x87a539[_0x7995('0x5a')]={'mapKey':_0x7995('0x80')};if(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]){switch(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]){case _0x7995('0x81'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['From'];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x83')];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746['body'][_0x7995('0x85')];break;case _0x7995('0x86'):_0x87a539['body'][_0x7995('0x82')]='+'+_0x19d746['body'][_0x7995('0x87')];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746['body'][_0x7995('0x88')];break;case _0x7995('0x89'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')]['body']=_0x19d746['body']['message'];break;case _0x7995('0x8a'):_0x87a539[_0x7995('0x5a')]['from']=_0x19d746['body'][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')]['body']=_0x19d746['body']['body'];_0x87a539['body'][_0x7995('0x84')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x8b')];break;case _0x7995('0x8c'):_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['From'];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')]['Text'];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746['body'][_0x7995('0x8d')];break;case _0x7995('0x8e'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]='+'+_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x82')];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x88')];_0x87a539[_0x7995('0x5a')]['messageId']=_0x19d746[_0x7995('0x5a')][_0x7995('0x8f')][0x0][_0x7995('0x84')];break;case _0x7995('0x90'):_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x91')];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x92')][_0x7995('0x29')];break;case _0x7995('0x93'):_0x87a539[_0x7995('0x5a')][_0x7995('0x82')]=_0x19d746['body'][_0x7995('0x94')];_0x87a539['body'][_0x7995('0x5a')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x88')];_0x87a539['body'][_0x7995('0x84')]=_0x19d746['body']['replyMessageId'];break;case'intelepeer':_0x87a539['body'][_0x7995('0x82')]=_0x19d746[_0x7995('0x5a')]['from'];_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]=_0x19d746['body'][_0x7995('0x29')];_0x87a539[_0x7995('0x5a')][_0x7995('0x84')]=_0x19d746[_0x7995('0x5a')][_0x7995('0x95')];break;}}if(_0x87a539['body']['id']){delete _0x87a539[_0x7995('0x5a')]['id'];}if(_[_0x7995('0x96')](_0x87a539[_0x7995('0x5a')][_0x7995('0x82')])){throw new db['Sequelize'][(_0x7995('0x22'))](_0x7995('0x97'));}if(_[_0x7995('0x96')](_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')])||_0x87a539[_0x7995('0x5a')][_0x7995('0x5a')]===''){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x98'));}if(_['isNil'](_0x87a539[_0x7995('0x5a')]['mapKey'])){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0x99')+_0x2a01d4);}if(!_['includes'](_0x2a01d4,_0x87a539['body'][_0x7995('0x9a')])){throw new db[(_0x7995('0x7a'))]['ValidationError'](_0x7995('0x9b')+_0x2a01d4);}_0x5a4695[_0x87a539['body'][_0x7995('0x9a')]]=_0x87a539[_0x7995('0x5a')][_0x7995('0x82')];return db[_0x7995('0x9c')]['find']({'where':{'id':_0x87a539['account'][_0x7995('0x7f')]},'include':[{'model':db[_0x7995('0x79')],'as':_0x7995('0x9d'),'where':_0x5a4695,'limit':0x1,'order':[[_0x7995('0x9e'),'DESC']]}]});})[_0x7995('0x23')](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x8b820b){if(_0x8b820b){_0x87a539[_0x7995('0x9f')]=_[_0x7995('0xa0')](_0x8b820b,['Contacts']);if(_0x8b820b['Contacts']['length']){return _0x8b820b[_0x7995('0x9d')][0x0];}var _0x24a3cf=_['defaults'](_0x87a539[_0x7995('0x5a')],{'firstName':_0x87a539['body'][_0x7995('0x82')],'ListId':_0x8b820b['id']});_0x24a3cf[_0x87a539[_0x7995('0x5a')][_0x7995('0x9a')]]=_0x87a539[_0x7995('0x5a')]['from'];return db[_0x7995('0x79')][_0x7995('0x59')](_0x24a3cf,{'fields':_0x2056da,'raw':!![]});}})[_0x7995('0x23')](handleEntityNotFound(_0x570b71,null))[_0x7995('0x23')](function(_0x2023a7){if(_0x2023a7){_0x87a539[_0x7995('0xa1')]=_0x2023a7;var _0x1d200d={'ContactId':_0x2023a7['id'],'phone':_0x87a539[_0x7995('0x5a')][_0x7995('0x82')],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id']};var _0x30893a={'ContactId':_0x2023a7['id'],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id'],'closed':![]};return db[_0x7995('0xa2')][_0x7995('0x58')]({'where':_0x30893a})['then'](function(_0x764245){if(_0x764245){return[_0x764245,![]];}return db['SmsInteraction'][_0x7995('0x59')](_0x1d200d)[_0x7995('0x23')](function(_0x5cf7b2){return[_0x5cf7b2,!![]];});});}})[_0x7995('0xa3')](function(_0x55dc6c,_0x17c3f9){_0x87a539[_0x7995('0xa4')]=_0x55dc6c['get']({'plain':!![]});_0x87a539['interaction']['created']=![];if(_0x17c3f9){if(_0x87a539[_0x7995('0x74')][_0x7995('0xa5')]){_0x87a539[_0x7995('0x75')][_0x7995('0xa6')]({'id':0x0,'priority':_0x87a539['applications'][_0x7995('0x57')]+0x1,'app':_0x7995('0xa7'),'appdata':_0x7995('0xa8'),'interval':_0x7995('0xa9')});}_0x87a539[_0x7995('0xa4')][_0x7995('0xaa')]=!![];}return db[_0x7995('0xab')][_0x7995('0x59')]({'phone':_0x87a539['body'][_0x7995('0x82')],'messageId':_0x87a539[_0x7995('0x5a')][_0x7995('0x84')],'body':_0x87a539[_0x7995('0x5a')]['body'],'SmsAccountId':_0x19d746[_0x7995('0x55')]['id'],'SmsInteractionId':_0x55dc6c['id'],'direction':'in','ContactId':_0x55dc6c[_0x7995('0xac')],'AttachmentId':_0x87a539[_0x7995('0x5a')][_0x7995('0xad')]});})[_0x7995('0x23')](function(_0x2e7416){_0x87a539['message']=_0x2e7416;if(_0x87a539[_0x7995('0xa4')][_0x7995('0xae')]){return db[_0x7995('0xaf')][_0x7995('0x58')]({'attributes':['id',_0x7995('0x38')],'where':{'id':_0x87a539[_0x7995('0xa4')][_0x7995('0xae')]}})[_0x7995('0x23')](function(_0xf76f46){if(_0xf76f46){_0x87a539[_0x7995('0x75')][_0x7995('0xb0')]({'id':0x0,'priority':0x0,'app':_0x7995('0xb1'),'appdata':_0xf76f46[_0x7995('0x38')]+','+(_0x87a539[_0x7995('0x74')][_0x7995('0xb2')]||0xa),'interval':_0x7995('0xa9')});}return respondWithRpcPromise(_0x7995('0xb3'),_0x7995('0xb4'),_0x87a539);});}return respondWithRpcPromise(_0x7995('0xb3'),_0x7995('0xb4'),_0x87a539);})[_0x7995('0x23')](function(_0x51f854){if(_0x51f854){var _0x4cf7f1=0xc8;var _0x1a980b=_0x7995('0xb5');logger['info'](_0x7995('0x26'),_0x1a980b,_0x4cf7f1,'entity\x20found');logger[_0x7995('0xb6')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x1a980b,_0x4cf7f1,_0x7995('0xb7'),JSON[_0x7995('0xb8')](_0x51f854));if(_0x87a539[_0x7995('0x74')][_0x7995('0x41')]===_0x7995('0x81')){return _0x570b71[_0x7995('0x2d')](_0x4cf7f1)[_0x7995('0x32')](_0x7995('0xb9'),_0x7995('0xba'))[_0x7995('0x39')]('\x0a');}else{return _0x570b71[_0x7995('0x2d')](_0x4cf7f1)[_0x7995('0x2f')](_0x51f854);}}})[_0x7995('0x2b')](handleError(_0x570b71,null));};exports[_0x7995('0xbb')]=function(_0x54b803,_0x408c22,_0x1d2afe){return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x54b803['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x408c22,null))[_0x7995('0x23')](function(_0x31d0e9){if(_0x31d0e9){return db[_0x7995('0xbc')][_0x7995('0xbd')](function(_0x13dda4){return db[_0x7995('0xbe')][_0x7995('0x35')]({'where':{'SmsAccountId':_0x54b803[_0x7995('0x55')]['id']},'transaction':_0x13dda4})['then'](function(_0x3c81cc){var _0x5f5496=_[_0x7995('0x3d')](_0x54b803[_0x7995('0x5a')],function(_0x35b217){_0x35b217[_0x7995('0x65')]=_0x54b803['params']['id'];return _0x35b217;});return db[_0x7995('0xbe')][_0x7995('0xbf')](_0x5f5496,{'transaction':_0x13dda4});});})[_0x7995('0x23')](function(){return db[_0x7995('0xbe')][_0x7995('0xc0')]({'where':{'SmsAccountId':_0x54b803[_0x7995('0x55')]['id']},'order':_0x7995('0xc1')});});}})[_0x7995('0x23')](respondWithResult(_0x408c22,null))[_0x7995('0x2b')](handleError(_0x408c22,null));};exports[_0x7995('0xc2')]=function(_0x45f389,_0x44d6a8,_0x7d14e2){var _0x405711={};var _0x54e341={};var _0x5cb30e;var _0xdfc11d;return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x45f389['params']['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x44d6a8,null))[_0x7995('0x23')](function(_0x610b81){if(_0x610b81){_0x5cb30e=_0x610b81;_0x54e341['model']=_[_0x7995('0x45')](db[_0x7995('0xbe')][_0x7995('0x3f')]);_0x54e341[_0x7995('0x44')]=_[_0x7995('0x45')](_0x45f389[_0x7995('0x44')]);_0x54e341[_0x7995('0x4c')]=_[_0x7995('0x46')](_0x54e341[_0x7995('0x43')],_0x54e341[_0x7995('0x44')]);_0x405711[_0x7995('0x47')]=_['intersection'](_0x54e341['model'],qs[_0x7995('0x56')](_0x45f389['query'][_0x7995('0x56')]));_0x405711[_0x7995('0x47')]=_0x405711[_0x7995('0x47')][_0x7995('0x57')]?_0x405711[_0x7995('0x47')]:_0x54e341['model'];_0x405711['order']=qs[_0x7995('0x6a')](_0x45f389[_0x7995('0x44')][_0x7995('0x6a')]);_0x405711[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_[_0x7995('0x6b')](_0x45f389[_0x7995('0x44')],_0x54e341[_0x7995('0x4c')]));if(_0x45f389[_0x7995('0x44')][_0x7995('0x4d')]){_0x405711['where']=_[_0x7995('0x4e')](_0x405711[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x405711[_0x7995('0x47')],function(_0x511cf8){var _0x4d6da0={};_0x4d6da0[_0x511cf8]={'$like':'%'+_0x45f389['query']['filter']+'%'};return _0x4d6da0;})});}_0x405711=_['merge']({},_0x405711,_0x45f389[_0x7995('0x50')]);return _0x5cb30e['getApplications'](_0x405711);}})['then'](function(_0x32f19d){if(_0x32f19d){_0xdfc11d=_0x32f19d[_0x7995('0x57')];if(!_0x45f389[_0x7995('0x44')]['hasOwnProperty'](_0x7995('0x69'))){_0x405711['limit']=qs[_0x7995('0x49')](_0x45f389[_0x7995('0x44')][_0x7995('0x49')]);_0x405711['offset']=qs[_0x7995('0x31')](_0x45f389[_0x7995('0x44')][_0x7995('0x31')]);}return _0x5cb30e['getApplications'](_0x405711);}})[_0x7995('0x23')](function(_0x15cfd3){if(_0x15cfd3){return _0x15cfd3?{'count':_0xdfc11d,'rows':_0x15cfd3}:null;}})[_0x7995('0x23')](respondWithResult(_0x44d6a8,null))[_0x7995('0x2b')](handleError(_0x44d6a8,null));};exports[_0x7995('0xc3')]=function(_0x574e2a,_0x1761e1,_0x2a4991){var _0xc8bbb4={'raw':![],'where':{}};var _0x484b6c={};var _0x20852c={'count':0x0,'rows':[]};return db[_0x7995('0x3e')][_0x7995('0x68')]({'where':{'id':_0x574e2a[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1761e1,null))['then'](function(_0x2995a3){if(_0x2995a3){_0x484b6c[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0xa2')][_0x7995('0x3f')]);_0x484b6c[_0x7995('0x44')]=_[_0x7995('0x45')](_0x574e2a['query']);_0x484b6c['filters']=_[_0x7995('0x46')](_0x484b6c[_0x7995('0x43')],_0x484b6c['query']);_0xc8bbb4['attributes']=_[_0x7995('0x46')](_0x484b6c[_0x7995('0x43')],qs[_0x7995('0x56')](_0x574e2a[_0x7995('0x44')][_0x7995('0x56')]));_0xc8bbb4[_0x7995('0x47')]=_0xc8bbb4[_0x7995('0x47')]['length']?_0xc8bbb4[_0x7995('0x47')]:_0x484b6c[_0x7995('0x43')];if(!_0x574e2a[_0x7995('0x44')][_0x7995('0x48')](_0x7995('0x69'))){_0xc8bbb4[_0x7995('0x49')]=qs['limit'](_0x574e2a[_0x7995('0x44')][_0x7995('0x49')]);_0xc8bbb4[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x574e2a[_0x7995('0x44')][_0x7995('0x31')]);}_0xc8bbb4[_0x7995('0x4a')]=qs['sort'](_0x574e2a[_0x7995('0x44')][_0x7995('0x6a')]);_0xc8bbb4[_0x7995('0x4b')]=qs[_0x7995('0x4c')](_['pick'](_0x574e2a[_0x7995('0x44')],_0x484b6c['filters']));_0xc8bbb4[_0x7995('0x4b')][_0x7995('0x65')]=_0x2995a3['id'];if(_0x574e2a['query']['filter']){_0xc8bbb4['where']=_[_0x7995('0x4e')](_0xc8bbb4[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0xc8bbb4[_0x7995('0x47')],function(_0x503b32){var _0x2da21e={};_0x2da21e[_0x503b32]={'$like':'%'+_0x574e2a[_0x7995('0x44')][_0x7995('0x4d')]+'%'};return _0x2da21e;})});}_0xc8bbb4=_[_0x7995('0x4e')]({},_0xc8bbb4,_0x574e2a[_0x7995('0x50')]);return db[_0x7995('0xa2')][_0x7995('0x30')]({'where':_0xc8bbb4['where']})['then'](function(_0x2695eb){_0x20852c['count']=_0x2695eb;if(_0x574e2a['query'][_0x7995('0x51')]){_0xc8bbb4[_0x7995('0x52')]=[{'model':db[_0x7995('0x79')],'as':_0x7995('0xc4'),'required':![]},{'model':db[_0x7995('0xaf')],'as':_0x7995('0xc5'),'attributes':[_0x7995('0x38'),_0x7995('0xc6'),_0x7995('0xc7')],'required':![]},{'model':db[_0x7995('0xc8')],'as':_0x7995('0xc9'),'attributes':['id',_0x7995('0x38'),'color'],'where':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]?{'id':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]}:undefined,'required':_0x574e2a[_0x7995('0x44')][_0x7995('0xca')]?!![]:![]}];}return db[_0x7995('0xa2')]['findAll'](_0xc8bbb4);})[_0x7995('0x23')](function(_0x234832){_0x20852c[_0x7995('0x6c')]=_0x234832;return _0x20852c;});}})[_0x7995('0x23')](respondWithFilteredResult(_0x1761e1,_0xc8bbb4))[_0x7995('0x2b')](handleError(_0x1761e1,null));};exports['send']=function(_0x2d1c14,_0x5e7fde,_0x156b65){var _0x12f4c5,_0x221be8,_0x5150aa;if(_[_0x7995('0x96')](_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')])||_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')]===''){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x2d1c14[_0x7995('0x5a')]['to'])){throw new db[(_0x7995('0x7a'))][(_0x7995('0x22'))](_0x7995('0xcb'));}_0x12f4c5=_0x2d1c14[_0x7995('0x5a')]['to'];return db[_0x7995('0x3e')]['find']({'where':{'id':_0x2d1c14[_0x7995('0x55')]['id']},'include':[{'model':db[_0x7995('0x9c')],'as':_0x7995('0xcc'),'include':[{'model':db[_0x7995('0x79')],'as':'Contacts','where':{'mobile':_0x12f4c5},'limit':0x1,'order':[['updatedAt',_0x7995('0xcd')]]}]}]})[_0x7995('0x23')](handleEntityNotFound(_0x5e7fde,null))['then'](function(_0x3130f2){if(_0x3130f2&&_0x3130f2[_0x7995('0xcc')]){_0x221be8=_0x3130f2['get']({'plain':!![]});if(_0x221be8[_0x7995('0xcc')]&&_0x221be8[_0x7995('0xcc')][_0x7995('0x9d')][_0x7995('0x57')]){return _0x221be8[_0x7995('0xcc')]['Contacts'][0x0];}return db['CmContact'][_0x7995('0x59')](_[_0x7995('0x1b')](_0x2d1c14[_0x7995('0x5a')],{'firstName':_0x12f4c5,'mobile':_0x12f4c5,'phone':_0x12f4c5,'ListId':_0x221be8[_0x7995('0x7f')]}));}})[_0x7995('0x23')](handleEntityNotFound(_0x5e7fde,null))['then'](function(_0xd0da6e){if(_0xd0da6e){_0x5150aa=_0xd0da6e;return db[_0x7995('0xa2')][_0x7995('0x58')]({'where':{'ContactId':_0x5150aa['id'],'closed':![],'SmsAccountId':_0x221be8['id']}})[_0x7995('0x23')](function(_0x1949f5){if(_0x1949f5){return[_0x1949f5,![]];}return db['SmsInteraction']['create']({'UserId':_0x2d1c14['user']['id'],'ContactId':_0x5150aa['id'],'SmsAccountId':_0x221be8['id'],'phone':_0x12f4c5,'firstMsgDirection':'out','Messages':[_[_0x7995('0x4e')](_0x2d1c14[_0x7995('0x5a')],{'read':![],'body':_0x2d1c14['body'][_0x7995('0x5a')],'phone':_0x12f4c5,'SmsAccountId':_0x221be8['id'],'UserId':_0x2d1c14[_0x7995('0x5b')]['id'],'ContactId':_0x5150aa['id']})]},{'include':[{'model':db['SmsMessage'],'as':'Messages'}]})[_0x7995('0x23')](function(_0x3ee80c){return[_0x3ee80c,!![]];});});}})[_0x7995('0xa3')](function(_0x8bd55,_0x20a056){if(_0x20a056){return _0x8bd55;}return db[_0x7995('0xab')][_0x7995('0x59')](_['merge'](_0x2d1c14['body'],{'read':![],'body':_0x2d1c14[_0x7995('0x5a')][_0x7995('0x5a')],'phone':_0x12f4c5,'SmsAccountId':_0x221be8['id'],'SmsInteractionId':_0x8bd55['id'],'UserId':_0x2d1c14[_0x7995('0x5b')]['id'],'ContactId':_0x5150aa['id']}))['then'](function(_0x2f96fd){_0x8bd55[_0x7995('0xce')][_0x7995('0xcf')]=[];_0x8bd55[_0x7995('0xce')][_0x7995('0xcf')][_0x7995('0xa6')](_0x2f96fd[_0x7995('0xce')]);return _0x8bd55;});})[_0x7995('0x23')](respondWithResult(_0x5e7fde,null))[_0x7995('0x2b')](handleError(_0x5e7fde,null));};exports['status']=function(_0x5136f5,_0x1161f2,_0x4bd222){if(_0x5136f5[_0x7995('0x5a')]['id']){delete _0x5136f5['body']['id'];}console[_0x7995('0xd0')](_0x7995('0xd1'),_0x5136f5[_0x7995('0x5a')]);var _0x4a75d2,_0x4c810d,_0x1401b4;return db[_0x7995('0x3e')][_0x7995('0x58')]({'where':{'id':_0x5136f5[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1161f2,null))[_0x7995('0x23')](function(_0xb0164a){if(_0xb0164a){_0x1401b4=_0xb0164a;logger[_0x7995('0xb6')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0xd2'),_0xb0164a['type'],util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));switch(_0xb0164a[_0x7995('0x41')]){case _0x7995('0x86'):if(_0x5136f5[_0x7995('0x5a')]['skebby_dispatch_id']&&_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0xd4')]}});}break;case _0x7995('0x89'):if(_0x5136f5['body']['requestid']&&_0x5136f5[_0x7995('0x5a')][_0x7995('0xd5')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0xd5')];return db[_0x7995('0xab')]['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0xd6')]}});}break;case _0x7995('0x8a'):if(_0x5136f5[_0x7995('0x5a')][_0x7995('0x8b')]&&_0x5136f5[_0x7995('0x5a')][_0x7995('0xd7')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0xd7')];return db['SmsMessage']['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0x8b')]}});}break;case _0x7995('0x8e'):var _0x296643=_0x5136f5[_0x7995('0x5a')][_0x7995('0x8f')][0x0];if(_0x296643[_0x7995('0x84')]&&_0x296643[_0x7995('0x2d')]['groupName']==='DELIVERED'){_0x4c810d=_0x296643[_0x7995('0x2d')][_0x7995('0xd8')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x296643['messageId']}});}break;case'clickatell':if(_0x5136f5[_0x7995('0x5a')][_0x7995('0x84')]&&_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x5136f5[_0x7995('0x5a')][_0x7995('0x84')]}});}break;case _0x7995('0xd9'):if(_0x5136f5[_0x7995('0x5a')]['redif']&&_0x5136f5['body'][_0x7995('0x2d')]){_0x4c810d=_0x5136f5[_0x7995('0x5a')][_0x7995('0x2d')];return db[_0x7995('0xab')]['find']({'where':{'messageId':_0x5136f5[_0x7995('0x5a')]['redif']}});}break;}}})[_0x7995('0x23')](handleEntityNotFound(_0x1161f2,null))[_0x7995('0x23')](function(_0x308d0e){if(_0x308d0e){_0x4a75d2=_0x308d0e;switch(_0x1401b4[_0x7995('0x41')]){case _0x7995('0x86'):if(_0x4c810d===_0x7995('0xda')){return _0x4a75d2['update']({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x86'),util['inspect'](_0x5136f5['body'],{'showHidden':![],'depth':null}));}break;case _0x7995('0x89'):if(_0x4c810d==='1'){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),'status',_0x7995('0x86'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x5136f5[_0x7995('0x5a')][_0x7995('0xdb')]&&_0x4c810d>=0xc8&&_0x4c810d<=0xce){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger['error'](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x8a'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x7995('0x8e'):var _0x1f6c3e=_0x5136f5[_0x7995('0x5a')][_0x7995('0x8f')][0x0];if(_0x1f6c3e['status'][_0x7995('0xd8')]===_0x7995('0xda')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7995('0x2d'),_0x7995('0x8e'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x4c810d==_0x7995('0xdc')||_0x4c810d==_0x7995('0xdd')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),_0x7995('0x2d'),_0x7995('0x93'),util['inspect'](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x7995('0xd9'):if(_0x4c810d===_0x7995('0xde')||_0x4c810d===_0x7995('0xdf')){return _0x4a75d2[_0x7995('0x62')]({'read':!![]});}else{logger['error'](_0x7995('0x26'),'status',_0x7995('0xd9'),util[_0x7995('0xd3')](_0x5136f5[_0x7995('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x4a75d2;}})['then'](respondWithResult(_0x1161f2,null))['catch'](handleError(_0x1161f2,null));};exports['statusGet']=function(_0x21ff84,_0x1763aa,_0x32e443){var _0x35b6f9,_0x17fab0,_0x4da0e8;return db['SmsAccount'][_0x7995('0x58')]({'where':{'id':_0x21ff84[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x1763aa,null))[_0x7995('0x23')](function(_0x5bc1b4){if(_0x5bc1b4){_0x4da0e8=_0x5bc1b4;logger[_0x7995('0xb6')](_0x7995('0x26'),'status',_0x7995('0xd2'),_0x5bc1b4['type'],util[_0x7995('0xd3')](_0x21ff84[_0x7995('0x44')],{'showHidden':![],'depth':null}));switch(_0x5bc1b4[_0x7995('0x41')]){case'csc':if(_0x21ff84['query'][_0x7995('0xe0')]&&_0x21ff84[_0x7995('0x44')][_0x7995('0xe1')]){_0x17fab0=_0x21ff84[_0x7995('0x44')][_0x7995('0xe1')];return db[_0x7995('0xab')][_0x7995('0x58')]({'where':{'messageId':_0x21ff84[_0x7995('0x44')][_0x7995('0xe0')]}});}break;}}})[_0x7995('0x23')](handleEntityNotFound(_0x1763aa,null))[_0x7995('0x23')](function(_0x48c9fc){if(_0x48c9fc){_0x35b6f9=_0x48c9fc;switch(_0x4da0e8['type']){case _0x7995('0x90'):if(_0x17fab0==='2'||_0x17fab0==='6'){return _0x35b6f9[_0x7995('0x62')]({'read':!![]});}else{logger[_0x7995('0x27')](_0x7995('0x26'),'status','csc',util[_0x7995('0xd3')](_0x21ff84[_0x7995('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x35b6f9;}})['then'](respondWithResult(_0x1763aa,null))['catch'](handleError(_0x1763aa,null));};exports[_0x7995('0xe2')]=function(_0x469cd6,_0x3ad24,_0x17c27b){return db[_0x7995('0x3e')]['find']({'where':{'id':_0x469cd6[_0x7995('0x55')]['id']}})[_0x7995('0x23')](handleEntityNotFound(_0x3ad24,null))['then'](function(_0xf9859c){if(_0xf9859c){return _0xf9859c[_0x7995('0xe2')](_0x469cd6[_0x7995('0x5a')]['ids'],_[_0x7995('0xa0')](_0x469cd6[_0x7995('0x5a')],[_0x7995('0x71'),'id'])||{})[_0x7995('0xa3')](function(_0x113e03){for(var _0x5348b1=0x0;_0x5348b1<_0x469cd6['body'][_0x7995('0x71')]['length'];_0x5348b1+=0x1){socket[_0x7995('0xe3')]('userSmsAccount:save',{'UserId':_0x469cd6[_0x7995('0x5a')][_0x7995('0x71')][_0x5348b1],'SmsAccountId':_0x469cd6[_0x7995('0x55')]['id']});}return _0x113e03;});}})['then'](respondWithResult(_0x3ad24,null))['catch'](handleError(_0x3ad24,null));};exports['removeAgents']=function(_0x362580,_0x1da57f,_0x270ef3){return db['SmsAccount'][_0x7995('0x58')]({'where':{'id':_0x362580[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x1da57f,null))[_0x7995('0x23')](function(_0x39449e){if(_0x39449e){return _0x39449e[_0x7995('0xe4')](_0x362580[_0x7995('0x44')][_0x7995('0x71')])['then'](function(){if(_['isArray'](_0x362580[_0x7995('0x44')][_0x7995('0x71')])){for(var _0x134da2=0x0;_0x134da2<_0x362580[_0x7995('0x44')][_0x7995('0x71')][_0x7995('0x57')];_0x134da2+=0x1){socket[_0x7995('0xe3')](_0x7995('0xe5'),{'UserId':Number(_0x362580[_0x7995('0x44')][_0x7995('0x71')][_0x134da2]),'SmsAccountId':Number(_0x362580['params']['id'])});}}else{socket[_0x7995('0xe3')](_0x7995('0xe5'),{'UserId':Number(_0x362580[_0x7995('0x44')][_0x7995('0x71')]),'SmsAccountId':Number(_0x362580[_0x7995('0x55')]['id'])});}});}})[_0x7995('0x23')](respondWithStatusCode(_0x1da57f,null))[_0x7995('0x2b')](handleError(_0x1da57f,null));};exports['getAgents']=function(_0x5d0fe6,_0x43a8a4,_0x2aec8d){var _0x12df49={};var _0x1f4efc={};var _0x55ce63;var _0x572c53;return db['SmsAccount'][_0x7995('0x68')]({'where':{'id':_0x5d0fe6[_0x7995('0x55')]['id']}})['then'](handleEntityNotFound(_0x43a8a4,null))[_0x7995('0x23')](function(_0x2265cf){if(_0x2265cf){_0x55ce63=_0x2265cf;_0x1f4efc[_0x7995('0x43')]=_[_0x7995('0x45')](db[_0x7995('0xaf')][_0x7995('0x3f')]);_0x1f4efc[_0x7995('0x44')]=_[_0x7995('0x45')](_0x5d0fe6['query']);_0x1f4efc[_0x7995('0x4c')]=_[_0x7995('0x46')](_0x1f4efc[_0x7995('0x43')],_0x1f4efc['query']);_0x12df49[_0x7995('0x47')]=_['intersection'](_0x1f4efc['model'],qs['fields'](_0x5d0fe6['query'][_0x7995('0x56')]));_0x12df49['attributes']=_0x12df49[_0x7995('0x47')][_0x7995('0x57')]?_0x12df49['attributes']:_0x1f4efc[_0x7995('0x43')];_0x12df49[_0x7995('0x4a')]=qs[_0x7995('0x6a')](_0x5d0fe6[_0x7995('0x44')]['sort']);_0x12df49[_0x7995('0x4b')]=qs['filters'](_[_0x7995('0x6b')](_0x5d0fe6[_0x7995('0x44')],_0x1f4efc[_0x7995('0x4c')]));if(_0x5d0fe6[_0x7995('0x44')][_0x7995('0x4d')]){_0x12df49[_0x7995('0x4b')]=_[_0x7995('0x4e')](_0x12df49[_0x7995('0x4b')],{'$or':_[_0x7995('0x3d')](_0x12df49[_0x7995('0x47')],function(_0x4aa202){var _0x8c9b6f={};_0x8c9b6f[_0x4aa202]={'$like':'%'+_0x5d0fe6[_0x7995('0x44')]['filter']+'%'};return _0x8c9b6f;})});}_0x12df49=_[_0x7995('0x4e')]({},_0x12df49,_0x5d0fe6[_0x7995('0x50')]);return _0x55ce63[_0x7995('0xe6')](_0x12df49);}})[_0x7995('0x23')](function(_0x1a6f42){if(_0x1a6f42){_0x572c53=_0x1a6f42[_0x7995('0x57')];if(!_0x5d0fe6['query'][_0x7995('0x48')]('nolimit')){_0x12df49[_0x7995('0x49')]=qs[_0x7995('0x49')](_0x5d0fe6[_0x7995('0x44')][_0x7995('0x49')]);_0x12df49[_0x7995('0x31')]=qs[_0x7995('0x31')](_0x5d0fe6['query'][_0x7995('0x31')]);}return _0x55ce63[_0x7995('0xe6')](_0x12df49);}})[_0x7995('0x23')](function(_0x4c2faf){if(_0x4c2faf){return _0x4c2faf?{'count':_0x572c53,'rows':_0x4c2faf}:null;}})[_0x7995('0x23')](respondWithResult(_0x43a8a4,null))[_0x7995('0x2b')](handleError(_0x43a8a4,null));}; \ No newline at end of file +var _0x7a54=['findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','DESC','List','out','Messages','spread','dataValues','push','log','skebby_dispatch_id','statusInt','requestid','clicksend','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','limit','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','SmsAccount','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','mandatoryDispositionPause','rawAttributes','length','find','create','user','role','SmsAccounts','UserProfileSection','autoAssociation','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','notify','SmsApplication','Applications','account','priority','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','From','Body','messageId','skebby','from','connectel','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','intelepeer','isNil','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','contact','SmsInteraction','interaction','applications','close','unmanaged','SmsMessage','ContactId','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','\x0a','addApplications','sequelize','bulkCreate'];(function(_0x407101,_0x4dd7d7){var _0x26dcb7=function(_0x2a9e73){while(--_0x2a9e73){_0x407101['push'](_0x407101['shift']());}};_0x26dcb7(++_0x4dd7d7);}(_0x7a54,0x106));var _0x47a5=function(_0x241c7b,_0x27c2c4){_0x241c7b=_0x241c7b-0x0;var _0x6c5c1d=_0x7a54[_0x241c7b];return _0x6c5c1d;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);var jayson=require(_0x47a5('0x1a'));var client=jayson[_0x47a5('0x1b')][_0x47a5('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x190faa,_0x4e99a8,_0x362359){if(_0x362359){var _0x11faf5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11faf5[_0x47a5('0x1d')](_0x4e99a8)){return _0x190faa;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x190faa;}}function respondWithRpcPromise(_0x549de3,_0x138bc0,_0x4b966e,_0x5247fd){return new BPromise(function(_0x423a81,_0xaf70a6){var _0x2ce454=_0x5247fd||client;return _0x2ce454[_0x47a5('0x20')](_0x549de3,_0x4b966e)[_0x47a5('0x21')](function(_0x12b98e){logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,_0x47a5('0x24'));logger['debug'](_0x47a5('0x25'),_0x138bc0,_0x47a5('0x24'),JSON['stringify'](_0x12b98e));if(_0x12b98e[_0x47a5('0x26')]){if(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x27')]===0x1f4){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);return _0xaf70a6(_0x12b98e[_0x47a5('0x26')]['message']);}logger[_0x47a5('0x26')](_0x47a5('0x23'),_0x138bc0,_0x12b98e['error'][_0x47a5('0x28')]);return _0x423a81(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);}else{logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,'request\x20sent');_0x423a81(_0x12b98e['result'][_0x47a5('0x28')]);}})['catch'](function(_0x1ea9c8){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x1ea9c8);_0xaf70a6(_0x1ea9c8);});});}function respondWithStatusCode(_0x378208,_0x36ad34){_0x36ad34=_0x36ad34||0xcc;return function(_0x1dac65){if(_0x1dac65){return _0x378208[_0x47a5('0x29')](_0x36ad34);}return _0x378208[_0x47a5('0x2a')](_0x36ad34)[_0x47a5('0x2b')]();};}function respondWithResult(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0xc8;return function(_0x361bfa){if(_0x361bfa){return _0x136b14[_0x47a5('0x2a')](_0x16631f)[_0x47a5('0x2c')](_0x361bfa);}};}function respondWithFilteredResult(_0x3ad507,_0x528582){return function(_0x243210){if(_0x243210){var _0x51833b=_0x243210['count'],_0x2ef875=_0x528582[_0x47a5('0x2d')],_0x9ac908=_0x528582[_0x47a5('0x2d')]+_0x528582[_0x47a5('0x2e')],_0x16901f;if(_0x9ac908>=_0x51833b){_0x9ac908=_0x51833b;_0x16901f=0xc8;}else{_0x16901f=0xce;}_0x3ad507[_0x47a5('0x2a')](_0x16901f);return _0x3ad507['set']('Content-Range',_0x2ef875+'-'+_0x9ac908+'/'+_0x51833b)[_0x47a5('0x2c')](_0x243210);}return null;};}function patchUpdates(_0xfb5ddb){return function(_0x5bd7eb){try{jsonpatch['apply'](_0x5bd7eb,_0xfb5ddb,!![]);}catch(_0x836303){return BPromise[_0x47a5('0x2f')](_0x836303);}return _0x5bd7eb['save']();};}function saveUpdates(_0x42f70c,_0x53119b){return function(_0x122ed6){if(_0x122ed6){return _0x122ed6[_0x47a5('0x30')](_0x42f70c)['then'](function(_0x4843c0){return _0x4843c0;});}return null;};}function removeEntity(_0x274e34,_0x5910bb){return function(_0x403028){if(_0x403028){return _0x403028[_0x47a5('0x31')]()[_0x47a5('0x21')](function(){var _0x52749b=_0x403028[_0x47a5('0x32')]({'plain':!![]});var _0x50c086='SmsAccounts';return db[_0x47a5('0x33')]['destroy']({'where':{'type':_0x50c086,'resourceId':_0x52749b['id']}})[_0x47a5('0x21')](function(){return _0x403028;});})['then'](function(){_0x274e34[_0x47a5('0x2a')](0xcc)[_0x47a5('0x2b')]();});}};}function handleEntityNotFound(_0x38c8d4,_0x199698){return function(_0x36add5){if(!_0x36add5){_0x38c8d4[_0x47a5('0x29')](0x194);}return _0x36add5;};}function handleError(_0xee582c,_0x452be5){_0x452be5=_0x452be5||0x1f4;return function(_0x1a0d23){logger['error'](_0x1a0d23[_0x47a5('0x34')]);if(_0x1a0d23[_0x47a5('0x35')]){delete _0x1a0d23['name'];}_0xee582c[_0x47a5('0x2a')](_0x452be5)[_0x47a5('0x36')](_0x1a0d23);};}exports[_0x47a5('0x37')]=function(_0x49c4b5,_0x101f70){var _0x10f660={'include':[{'model':db[_0x47a5('0x38')],'as':'mandatoryDispositionPause'}]},_0x596097={},_0x2ebba0={'count':0x0,'rows':[]};var _0x55c5eb=_['map'](db[_0x47a5('0x39')]['rawAttributes'],function(_0x9b5eaf){return{'name':_0x9b5eaf[_0x47a5('0x3a')],'type':_0x9b5eaf[_0x47a5('0x3b')][_0x47a5('0x3c')]};});_0x596097[_0x47a5('0x3d')]=_[_0x47a5('0x3e')](_0x55c5eb,_0x47a5('0x35'));_0x596097[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x49c4b5[_0x47a5('0x3f')]);_0x596097[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],_0x596097['query']);_0x10f660[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x596097[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x49c4b5['query'][_0x47a5('0x44')]));_0x10f660['attributes']=_0x10f660['attributes']['length']?_0x10f660['attributes']:_0x596097[_0x47a5('0x3d')];if(!_0x49c4b5['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x10f660[_0x47a5('0x2e')]=qs['limit'](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x10f660['offset']=qs['offset'](_0x49c4b5[_0x47a5('0x3f')]['offset']);}_0x10f660[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x10f660[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x49c4b5[_0x47a5('0x3f')],_0x596097[_0x47a5('0x41')]),_0x55c5eb);if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x4b')]){_0x10f660[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x10f660[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x55c5eb,function(_0x3a2b38){if(_0x3a2b38['type']!==_0x47a5('0x4d')){var _0x23bb04={};_0x23bb04[_0x3a2b38['name']]={'$like':'%'+_0x49c4b5['query'][_0x47a5('0x4b')]+'%'};return _0x23bb04;}})});}_0x10f660=_['merge']({},_0x10f660,_0x49c4b5[_0x47a5('0x4e')]);var _0xd93e37={'where':_0x10f660['where']};return db['SmsAccount'][_0x47a5('0x4f')](_0xd93e37)['then'](function(_0x2d147c){_0x2ebba0[_0x47a5('0x4f')]=_0x2d147c;if(_0x49c4b5[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x10f660[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x39')][_0x47a5('0x52')](_0x10f660);})['then'](function(_0x48a0ef){_0x2ebba0[_0x47a5('0x53')]=_0x48a0ef;return _0x2ebba0;})[_0x47a5('0x21')](respondWithFilteredResult(_0x101f70,_0x10f660))[_0x47a5('0x54')](handleError(_0x101f70,null));};exports[_0x47a5('0x55')]=function(_0x2c7020,_0x2c0c86){var _0x249de5={'raw':![],'where':{'id':_0x2c7020[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]},_0x492cf7={};_0x492cf7['model']=_[_0x47a5('0x40')](db['SmsAccount'][_0x47a5('0x58')]);_0x492cf7[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x2c7020[_0x47a5('0x3f')]);_0x492cf7['filters']=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],_0x492cf7[_0x47a5('0x3f')]);_0x249de5[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x492cf7[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x2c7020['query'][_0x47a5('0x44')]));_0x249de5[_0x47a5('0x43')]=_0x249de5[_0x47a5('0x43')][_0x47a5('0x59')]?_0x249de5[_0x47a5('0x43')]:_0x492cf7[_0x47a5('0x3d')];if(_0x2c7020['query'][_0x47a5('0x50')]){_0x249de5[_0x47a5('0x51')]=[{'all':!![]}];}_0x249de5=_[_0x47a5('0x4c')]({},_0x249de5,_0x2c7020['options']);return db[_0x47a5('0x39')][_0x47a5('0x5a')](_0x249de5)[_0x47a5('0x21')](handleEntityNotFound(_0x2c0c86,null))['then'](respondWithResult(_0x2c0c86,null))['catch'](handleError(_0x2c0c86,null));};exports[_0x47a5('0x5b')]=function(_0x376e1d,_0x4fa1da){return db['SmsAccount'][_0x47a5('0x5b')](_0x376e1d['body'],{})[_0x47a5('0x21')](function(_0x5d383d){var _0x482de6=_0x376e1d[_0x47a5('0x5c')][_0x47a5('0x32')]({'plain':!![]});if(!_0x482de6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x482de6[_0x47a5('0x5d')]===_0x47a5('0x5c')){var _0x4b706a=_0x5d383d['get']({'plain':!![]});var _0x16b4fd=_0x47a5('0x5e');return db[_0x47a5('0x5f')][_0x47a5('0x5a')]({'where':{'name':_0x16b4fd,'userProfileId':_0x482de6['userProfileId']},'raw':!![]})[_0x47a5('0x21')](function(_0x2b4255){if(_0x2b4255&&_0x2b4255[_0x47a5('0x60')]===0x0){return db['UserProfileResource'][_0x47a5('0x5b')]({'name':_0x4b706a['name'],'resourceId':_0x4b706a['id'],'type':_0x2b4255[_0x47a5('0x35')],'sectionId':_0x2b4255['id']},{})[_0x47a5('0x21')](function(){return _0x5d383d;});}else{return _0x5d383d;}})[_0x47a5('0x54')](function(_0x1c485b){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c485b);throw _0x1c485b;});}return _0x5d383d;})[_0x47a5('0x21')](respondWithResult(_0x4fa1da,0xc9))['catch'](handleError(_0x4fa1da,null));};exports['update']=function(_0x5eb150,_0x4f8564){if(_0x5eb150[_0x47a5('0x61')]['id']){delete _0x5eb150[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')]['find']({'where':{'id':_0x5eb150['params']['id']},'include':[{'model':db[_0x47a5('0x38')],'as':_0x47a5('0x57')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x4f8564,null))[_0x47a5('0x21')](saveUpdates(_0x5eb150[_0x47a5('0x61')],null))['then'](respondWithResult(_0x4f8564,null))[_0x47a5('0x54')](handleError(_0x4f8564,null));};exports['destroy']=function(_0x22c886,_0x274d31){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x22c886[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x274d31,null))[_0x47a5('0x21')](removeEntity(_0x274d31,null))[_0x47a5('0x54')](handleError(_0x274d31,null));};exports[_0x47a5('0x62')]=function(_0x35cca8,_0x3ac38c){return db['SmsAccount'][_0x47a5('0x62')]()[_0x47a5('0x21')](respondWithResult(_0x3ac38c,null))[_0x47a5('0x54')](handleError(_0x3ac38c,null));};exports[_0x47a5('0x63')]=function(_0x396cb0,_0x4bbe14,_0xbec033){if(_0x396cb0[_0x47a5('0x61')]['id']){delete _0x396cb0[_0x47a5('0x61')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x396cb0[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4bbe14,null))[_0x47a5('0x21')](function(_0x350af8){if(_0x350af8){_0x396cb0[_0x47a5('0x61')][_0x47a5('0x64')]=_0x350af8['id'];return db[_0x47a5('0x65')][_0x47a5('0x5b')](_0x396cb0[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x4bbe14,null))['catch'](handleError(_0x4bbe14,null));};exports[_0x47a5('0x66')]=function(_0x284fb8,_0x30504e,_0x4b42f3){var _0x37ac59={'raw':![],'where':{}};var _0x2e46af={};var _0x36c67={'count':0x0,'rows':[]};return db[_0x47a5('0x39')]['findOne']({'where':{'id':_0x284fb8[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x30504e,null))[_0x47a5('0x21')](function(_0x487e21){if(_0x487e21){_0x2e46af[_0x47a5('0x3d')]=_['keys'](db[_0x47a5('0x65')][_0x47a5('0x58')]);_0x2e46af[_0x47a5('0x3f')]=_['keys'](_0x284fb8['query']);_0x2e46af['filters']=_[_0x47a5('0x42')](_0x2e46af[_0x47a5('0x3d')],_0x2e46af[_0x47a5('0x3f')]);_0x37ac59[_0x47a5('0x43')]=_['intersection'](_0x2e46af[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x37ac59[_0x47a5('0x43')]=_0x37ac59[_0x47a5('0x43')][_0x47a5('0x59')]?_0x37ac59[_0x47a5('0x43')]:_0x2e46af[_0x47a5('0x3d')];if(!_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x45')](_0x47a5('0x46'))){_0x37ac59['limit']=qs[_0x47a5('0x2e')](_0x284fb8['query'][_0x47a5('0x2e')]);_0x37ac59[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x37ac59[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x37ac59[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x284fb8[_0x47a5('0x3f')],_0x2e46af[_0x47a5('0x41')]));_0x37ac59[_0x47a5('0x49')]['SmsAccountId']=_0x487e21['id'];if(_0x284fb8['query']['filter']){_0x37ac59['where']=_[_0x47a5('0x4c')](_0x37ac59[_0x47a5('0x49')],{'$or':_['map'](_0x37ac59[_0x47a5('0x43')],function(_0x44dda2){var _0x1baa5a={};_0x1baa5a[_0x44dda2]={'$like':'%'+_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1baa5a;})});}_0x37ac59=_[_0x47a5('0x4c')]({},_0x37ac59,_0x284fb8[_0x47a5('0x4e')]);return db[_0x47a5('0x65')][_0x47a5('0x4f')]({'where':_0x37ac59[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x5e5f16){_0x36c67[_0x47a5('0x4f')]=_0x5e5f16;if(_0x284fb8[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x37ac59['include']=[{'all':!![]}];}return db[_0x47a5('0x65')][_0x47a5('0x52')](_0x37ac59);})[_0x47a5('0x21')](function(_0x5d41d8){_0x36c67[_0x47a5('0x53')]=_0x5d41d8;return _0x36c67;});}})['then'](respondWithFilteredResult(_0x30504e,_0x37ac59))['catch'](handleError(_0x30504e,null));};exports[_0x47a5('0x67')]=function(_0x292d9c,_0x277486,_0x27333e){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x292d9c['params']['id']}})['then'](handleEntityNotFound(_0x277486,null))[_0x47a5('0x21')](function(_0x4f2361){if(_0x4f2361){return _0x4f2361[_0x47a5('0x67')](_0x292d9c[_0x47a5('0x3f')][_0x47a5('0x68')]);}})[_0x47a5('0x21')](respondWithStatusCode(_0x277486,null))['catch'](handleError(_0x277486,null));};exports[_0x47a5('0x69')]=function(_0x550bde,_0x5f3a04,_0x139c79){if(_0x550bde[_0x47a5('0x61')]['id']){delete _0x550bde['body']['id'];}return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x550bde[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f3a04,null))[_0x47a5('0x21')](function(_0x578e27){if(_0x578e27){_0x550bde[_0x47a5('0x61')][_0x47a5('0x64')]=_0x578e27['id'];return db[_0x47a5('0x6a')]['create'](_0x550bde[_0x47a5('0x61')]);}})[_0x47a5('0x21')](respondWithResult(_0x5f3a04,null))[_0x47a5('0x54')](handleError(_0x5f3a04,null));};exports['getAnswers']=function(_0x3525e7,_0x4f2fbb,_0x3c012b){var _0x491bb4={'raw':![],'where':{}};var _0x135d2e={};var _0x20d8bd={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x3525e7['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4f2fbb,null))[_0x47a5('0x21')](function(_0x23c393){if(_0x23c393){_0x135d2e[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db['CannedAnswer']['rawAttributes']);_0x135d2e[_0x47a5('0x3f')]=_['keys'](_0x3525e7[_0x47a5('0x3f')]);_0x135d2e[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x135d2e['model'],_0x135d2e[_0x47a5('0x3f')]);_0x491bb4[_0x47a5('0x43')]=_['intersection'](_0x135d2e[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x491bb4['attributes']=_0x491bb4['attributes'][_0x47a5('0x59')]?_0x491bb4[_0x47a5('0x43')]:_0x135d2e['model'];if(!_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x45')]('nolimit')){_0x491bb4[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x3525e7[_0x47a5('0x3f')]['limit']);_0x491bb4[_0x47a5('0x2d')]=qs['offset'](_0x3525e7[_0x47a5('0x3f')]['offset']);}_0x491bb4[_0x47a5('0x47')]=qs[_0x47a5('0x48')](_0x3525e7['query'][_0x47a5('0x48')]);_0x491bb4['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x3525e7[_0x47a5('0x3f')],_0x135d2e[_0x47a5('0x41')]));_0x491bb4['where'][_0x47a5('0x64')]=_0x23c393['id'];if(_0x3525e7['query']['filter']){_0x491bb4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x491bb4[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x491bb4[_0x47a5('0x43')],function(_0x5b1f5e){var _0x1522a6={};_0x1522a6[_0x5b1f5e]={'$like':'%'+_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1522a6;})});}_0x491bb4=_[_0x47a5('0x4c')]({},_0x491bb4,_0x3525e7['options']);return db[_0x47a5('0x6a')]['count']({'where':_0x491bb4[_0x47a5('0x49')]})[_0x47a5('0x21')](function(_0x3f93f0){_0x20d8bd[_0x47a5('0x4f')]=_0x3f93f0;if(_0x3525e7[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x491bb4[_0x47a5('0x51')]=[{'all':!![]}];}return db[_0x47a5('0x6a')][_0x47a5('0x52')](_0x491bb4);})['then'](function(_0x36796e){_0x20d8bd[_0x47a5('0x53')]=_0x36796e;return _0x20d8bd;});}})['then'](respondWithFilteredResult(_0x4f2fbb,_0x491bb4))[_0x47a5('0x54')](handleError(_0x4f2fbb,null));};exports[_0x47a5('0x6c')]=function(_0x6d6a5,_0x5b85cd,_0x4bf1f5){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x6d6a5['params']['id']}})['then'](handleEntityNotFound(_0x5b85cd,null))[_0x47a5('0x21')](function(_0x17f82d){if(_0x17f82d){return _0x17f82d['removeAnswers'](_0x6d6a5[_0x47a5('0x3f')][_0x47a5('0x68')]);}})['then'](respondWithStatusCode(_0x5b85cd,null))[_0x47a5('0x54')](handleError(_0x5b85cd,null));};exports[_0x47a5('0x6d')]=function(_0x109805,_0x70c8a6,_0x364bb0){var _0x1371e4={'channel':'sms'};var _0x4c9894=[];var _0x5bd86e=[];var _0x133b7a={};return db[_0x47a5('0x39')]['find']({'where':{'id':_0x109805[_0x47a5('0x56')]['id']},'include':[{'model':db[_0x47a5('0x6e')],'as':_0x47a5('0x6f')}]})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x5084d6){_0x1371e4[_0x47a5('0x70')]=_0x5084d6;_0x1371e4['applications']=_['orderBy'](_0x5084d6['Applications'],[_0x47a5('0x71')],['asc']);if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x6f')]){delete _0x1371e4[_0x47a5('0x70')]['Applications'];}return db[_0x47a5('0x72')][_0x47a5('0x62')]();})[_0x47a5('0x21')](function(_0x121750){if(!_0x121750){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x73'));}_0x4c9894=_[_0x47a5('0x74')](_['keys'](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76')]);_0x5bd86e=_[_0x47a5('0x74')](_[_0x47a5('0x40')](_0x121750),[_0x47a5('0x75'),_0x47a5('0x76'),'CompanyId',_0x47a5('0x77')]);_0x1371e4[_0x47a5('0x61')]={'mapKey':'mobile'};if(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){switch(_0x1371e4[_0x47a5('0x70')][_0x47a5('0x3b')]){case'twilio':_0x1371e4['body']['from']=_0x109805['body'][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x79')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['MessageSid'];break;case _0x47a5('0x7b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['sender'];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body']['text'];break;case _0x47a5('0x7d'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805[_0x47a5('0x61')][_0x47a5('0x28')];break;case'clicksend':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x61')];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x7e')];break;case _0x47a5('0x7f'):_0x1371e4['body'][_0x47a5('0x7c')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x78')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x80')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x81')];break;case _0x47a5('0x82'):_0x1371e4['body'][_0x47a5('0x7c')]='+'+_0x109805[_0x47a5('0x61')]['results'][0x0][_0x47a5('0x7c')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0]['text'];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x83')][0x0][_0x47a5('0x7a')];break;case _0x47a5('0x84'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805['body'][_0x47a5('0x85')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805['body'][_0x47a5('0x86')][_0x47a5('0x28')];break;case _0x47a5('0x87'):_0x1371e4[_0x47a5('0x61')]['from']=_0x109805[_0x47a5('0x61')][_0x47a5('0x88')];_0x1371e4[_0x47a5('0x61')]['body']=_0x109805['body'][_0x47a5('0x89')];_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')][_0x47a5('0x8a')];break;case _0x47a5('0x8b'):_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')]=_0x109805['body'][_0x47a5('0x7c')];_0x1371e4['body'][_0x47a5('0x61')]=_0x109805[_0x47a5('0x61')]['message'];_0x1371e4['body'][_0x47a5('0x7a')]=_0x109805[_0x47a5('0x61')]['refid'];break;}}if(_0x1371e4[_0x47a5('0x61')]['id']){delete _0x1371e4[_0x47a5('0x61')]['id'];}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')]['from'])){throw new db[(_0x47a5('0x1e'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x1371e4[_0x47a5('0x61')]['body'])||_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8d'));}if(_[_0x47a5('0x8c')](_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8f')+_0x5bd86e);}if(!_[_0x47a5('0x90')](_0x5bd86e,_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x91')+_0x5bd86e);}_0x133b7a[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db[_0x47a5('0x92')]['find']({'where':{'id':_0x1371e4[_0x47a5('0x70')]['ListId']},'include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':_0x133b7a,'limit':0x1,'order':[[_0x47a5('0x76'),'DESC']]}]});})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x14771b){if(_0x14771b){_0x1371e4['list']=_['omit'](_0x14771b,[_0x47a5('0x93')]);if(_0x14771b[_0x47a5('0x93')][_0x47a5('0x59')]){return _0x14771b[_0x47a5('0x93')][0x0];}var _0x204bd6=_['defaults'](_0x1371e4[_0x47a5('0x61')],{'firstName':_0x1371e4['body'][_0x47a5('0x7c')],'ListId':_0x14771b['id']});_0x204bd6[_0x1371e4[_0x47a5('0x61')][_0x47a5('0x8e')]]=_0x1371e4[_0x47a5('0x61')]['from'];return db['CmContact'][_0x47a5('0x5b')](_0x204bd6,{'fields':_0x4c9894,'raw':!![]});}})[_0x47a5('0x21')](handleEntityNotFound(_0x70c8a6,null))[_0x47a5('0x21')](function(_0x4339d4){if(_0x4339d4){_0x1371e4[_0x47a5('0x94')]=_0x4339d4;var _0x36a44c={'ContactId':_0x4339d4['id'],'phone':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7c')],'SmsAccountId':_0x109805[_0x47a5('0x56')]['id']};var _0x481bc3={'ContactId':_0x4339d4['id'],'SmsAccountId':_0x109805['params']['id'],'closed':![]};return db[_0x47a5('0x95')]['find']({'where':_0x481bc3})[_0x47a5('0x21')](function(_0x2d0b67){if(_0x2d0b67){return[_0x2d0b67,![]];}return db[_0x47a5('0x95')]['create'](_0x36a44c)[_0x47a5('0x21')](function(_0x26d629){return[_0x26d629,!![]];});});}})['spread'](function(_0xcb6714,_0x51f6cf){_0x1371e4[_0x47a5('0x96')]=_0xcb6714[_0x47a5('0x32')]({'plain':!![]});_0x1371e4[_0x47a5('0x96')]['created']=![];if(_0x51f6cf){if(_0x1371e4['account']['autoclose']){_0x1371e4['applications']['push']({'id':0x0,'priority':_0x1371e4[_0x47a5('0x97')]['length']+0x1,'app':_0x47a5('0x98'),'appdata':_0x47a5('0x99'),'interval':'*,*,*,*'});}_0x1371e4['interaction']['created']=!![];}return db[_0x47a5('0x9a')]['create']({'phone':_0x1371e4['body']['from'],'messageId':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x7a')],'body':_0x1371e4[_0x47a5('0x61')][_0x47a5('0x61')],'SmsAccountId':_0x109805['params']['id'],'SmsInteractionId':_0xcb6714['id'],'direction':'in','ContactId':_0xcb6714[_0x47a5('0x9b')],'AttachmentId':_0x1371e4['body'][_0x47a5('0x9c')]});})['then'](function(_0x2de924){_0x1371e4[_0x47a5('0x28')]=_0x2de924;if(_0x1371e4[_0x47a5('0x96')]['UserId']){return db[_0x47a5('0x9d')][_0x47a5('0x5a')]({'attributes':['id',_0x47a5('0x35')],'where':{'id':_0x1371e4[_0x47a5('0x96')]['UserId']}})[_0x47a5('0x21')](function(_0x9a7edc){if(_0x9a7edc){_0x1371e4[_0x47a5('0x97')][_0x47a5('0x9e')]({'id':0x0,'priority':0x0,'app':_0x47a5('0x9f'),'appdata':_0x9a7edc[_0x47a5('0x35')]+','+(_0x1371e4['account'][_0x47a5('0xa0')]||0xa),'interval':_0x47a5('0xa1')});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);});}return respondWithRpcPromise(_0x47a5('0xa2'),_0x47a5('0xa3'),_0x1371e4);})[_0x47a5('0x21')](function(_0x2697df){if(_0x2697df){var _0x408887=0xc8;var _0x34fde3=_0x47a5('0xa4');logger[_0x47a5('0x22')](_0x47a5('0x25'),_0x34fde3,_0x408887,_0x47a5('0xa5'));logger[_0x47a5('0xa6')](_0x47a5('0xa7'),_0x34fde3,_0x408887,_0x47a5('0xa5'),JSON['stringify'](_0x2697df));if(_0x1371e4[_0x47a5('0x70')]['type']==='twilio'){return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0xa8')](_0x47a5('0xa9'),'text/xml')[_0x47a5('0x36')](_0x47a5('0xaa'));}else{return _0x70c8a6[_0x47a5('0x2a')](_0x408887)[_0x47a5('0x2c')](_0x2697df);}}})[_0x47a5('0x54')](handleError(_0x70c8a6,null));};exports[_0x47a5('0xab')]=function(_0x1b1f86,_0x46cb3a,_0x176e71){return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1b1f86[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x46cb3a,null))['then'](function(_0x4aad5f){if(_0x4aad5f){return db[_0x47a5('0xac')]['transaction'](function(_0x249339){return db[_0x47a5('0x6e')][_0x47a5('0x31')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'transaction':_0x249339})[_0x47a5('0x21')](function(_0x3708ea){var _0x583b37=_[_0x47a5('0x3e')](_0x1b1f86[_0x47a5('0x61')],function(_0x380eca){_0x380eca['SmsAccountId']=_0x1b1f86[_0x47a5('0x56')]['id'];return _0x380eca;});return db[_0x47a5('0x6e')][_0x47a5('0xad')](_0x583b37,{'transaction':_0x249339});});})[_0x47a5('0x21')](function(){return db[_0x47a5('0x6e')][_0x47a5('0xae')]({'where':{'SmsAccountId':_0x1b1f86[_0x47a5('0x56')]['id']},'order':_0x47a5('0x71')});});}})[_0x47a5('0x21')](respondWithResult(_0x46cb3a,null))[_0x47a5('0x54')](handleError(_0x46cb3a,null));};exports[_0x47a5('0xaf')]=function(_0x40b7a5,_0x28e998,_0x2ac386){var _0x578983={};var _0x3f7fdc={};var _0x272cd0;var _0x150cff;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x40b7a5[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x28e998,null))['then'](function(_0x185104){if(_0x185104){_0x272cd0=_0x185104;_0x3f7fdc['model']=_[_0x47a5('0x40')](db[_0x47a5('0x6e')][_0x47a5('0x58')]);_0x3f7fdc[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x40b7a5[_0x47a5('0x3f')]);_0x3f7fdc[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],_0x3f7fdc[_0x47a5('0x3f')]);_0x578983[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x3f7fdc['model'],qs[_0x47a5('0x44')](_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x578983[_0x47a5('0x43')]=_0x578983['attributes'][_0x47a5('0x59')]?_0x578983[_0x47a5('0x43')]:_0x3f7fdc[_0x47a5('0x3d')];_0x578983[_0x47a5('0x47')]=qs['sort'](_0x40b7a5[_0x47a5('0x3f')]['sort']);_0x578983['where']=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x40b7a5[_0x47a5('0x3f')],_0x3f7fdc[_0x47a5('0x41')]));if(_0x40b7a5['query'][_0x47a5('0x4b')]){_0x578983[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x578983[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x578983[_0x47a5('0x43')],function(_0x5eae8d){var _0x1da268={};_0x1da268[_0x5eae8d]={'$like':'%'+_0x40b7a5[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x1da268;})});}_0x578983=_[_0x47a5('0x4c')]({},_0x578983,_0x40b7a5[_0x47a5('0x4e')]);return _0x272cd0['getApplications'](_0x578983);}})[_0x47a5('0x21')](function(_0x4c7627){if(_0x4c7627){_0x150cff=_0x4c7627[_0x47a5('0x59')];if(!_0x40b7a5['query'][_0x47a5('0x45')]('nolimit')){_0x578983['limit']=qs[_0x47a5('0x2e')](_0x40b7a5[_0x47a5('0x3f')]['limit']);_0x578983[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x40b7a5['query'][_0x47a5('0x2d')]);}return _0x272cd0[_0x47a5('0xaf')](_0x578983);}})[_0x47a5('0x21')](function(_0x508622){if(_0x508622){return _0x508622?{'count':_0x150cff,'rows':_0x508622}:null;}})[_0x47a5('0x21')](respondWithResult(_0x28e998,null))[_0x47a5('0x54')](handleError(_0x28e998,null));};exports[_0x47a5('0xb0')]=function(_0x30b0f9,_0x37721c,_0x53cc9e){var _0x5973d4={'raw':![],'where':{}};var _0x2678cb={};var _0x56808d={'count':0x0,'rows':[]};return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x30b0f9['params']['id']}})['then'](handleEntityNotFound(_0x37721c,null))[_0x47a5('0x21')](function(_0x4997bc){if(_0x4997bc){_0x2678cb[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x95')][_0x47a5('0x58')]);_0x2678cb[_0x47a5('0x3f')]=_[_0x47a5('0x40')](_0x30b0f9[_0x47a5('0x3f')]);_0x2678cb['filters']=_[_0x47a5('0x42')](_0x2678cb['model'],_0x2678cb[_0x47a5('0x3f')]);_0x5973d4[_0x47a5('0x43')]=_[_0x47a5('0x42')](_0x2678cb[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x5973d4[_0x47a5('0x43')]=_0x5973d4[_0x47a5('0x43')][_0x47a5('0x59')]?_0x5973d4[_0x47a5('0x43')]:_0x2678cb[_0x47a5('0x3d')];if(!_0x30b0f9['query'][_0x47a5('0x45')](_0x47a5('0x46'))){_0x5973d4[_0x47a5('0x2e')]=qs['limit'](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x5973d4[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x2d')]);}_0x5973d4['order']=qs[_0x47a5('0x48')](_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x5973d4[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x30b0f9[_0x47a5('0x3f')],_0x2678cb[_0x47a5('0x41')]));_0x5973d4[_0x47a5('0x49')][_0x47a5('0x64')]=_0x4997bc['id'];if(_0x30b0f9['query']['filter']){_0x5973d4[_0x47a5('0x49')]=_[_0x47a5('0x4c')](_0x5973d4[_0x47a5('0x49')],{'$or':_['map'](_0x5973d4[_0x47a5('0x43')],function(_0x50b7fc){var _0x522345={};_0x522345[_0x50b7fc]={'$like':'%'+_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x522345;})});}_0x5973d4=_[_0x47a5('0x4c')]({},_0x5973d4,_0x30b0f9[_0x47a5('0x4e')]);return db['SmsInteraction'][_0x47a5('0x4f')]({'where':_0x5973d4[_0x47a5('0x49')]})['then'](function(_0x59ba59){_0x56808d['count']=_0x59ba59;if(_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0x50')]){_0x5973d4[_0x47a5('0x51')]=[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0xb1'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x47a5('0x35'),_0x47a5('0xb2'),_0x47a5('0xb3')],'required':![]},{'model':db[_0x47a5('0xb4')],'as':'Tags','attributes':['id',_0x47a5('0x35'),_0x47a5('0xb5')],'where':_0x30b0f9[_0x47a5('0x3f')][_0x47a5('0xb6')]?{'id':_0x30b0f9['query']['tag']}:undefined,'required':_0x30b0f9['query'][_0x47a5('0xb6')]?!![]:![]}];}return db[_0x47a5('0x95')][_0x47a5('0x52')](_0x5973d4);})[_0x47a5('0x21')](function(_0x242006){_0x56808d[_0x47a5('0x53')]=_0x242006;return _0x56808d;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x37721c,_0x5973d4))[_0x47a5('0x54')](handleError(_0x37721c,null));};exports[_0x47a5('0x36')]=function(_0x5b48d0,_0x40fe75,_0x7b5348){var _0x50b482,_0x34ff37,_0x2bbf95;if(_[_0x47a5('0x8c')](_0x5b48d0[_0x47a5('0x61')]['body'])||_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')]===''){throw new db[(_0x47a5('0x1e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x47a5('0x8c')](_0x5b48d0['body']['to'])){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0xb7'));}_0x50b482=_0x5b48d0[_0x47a5('0x61')]['to'];return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x5b48d0[_0x47a5('0x56')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x47a5('0x72')],'as':_0x47a5('0x93'),'where':{'mobile':_0x50b482},'limit':0x1,'order':[[_0x47a5('0x76'),_0x47a5('0xb8')]]}]}]})['then'](handleEntityNotFound(_0x40fe75,null))['then'](function(_0x3222e4){if(_0x3222e4&&_0x3222e4['List']){_0x34ff37=_0x3222e4[_0x47a5('0x32')]({'plain':!![]});if(_0x34ff37['List']&&_0x34ff37[_0x47a5('0xb9')]['Contacts'][_0x47a5('0x59')]){return _0x34ff37[_0x47a5('0xb9')][_0x47a5('0x93')][0x0];}return db[_0x47a5('0x72')][_0x47a5('0x5b')](_[_0x47a5('0x16')](_0x5b48d0[_0x47a5('0x61')],{'firstName':_0x50b482,'mobile':_0x50b482,'phone':_0x50b482,'ListId':_0x34ff37[_0x47a5('0x77')]}));}})['then'](handleEntityNotFound(_0x40fe75,null))[_0x47a5('0x21')](function(_0x4394f0){if(_0x4394f0){_0x2bbf95=_0x4394f0;return db['SmsInteraction'][_0x47a5('0x5a')]({'where':{'ContactId':_0x2bbf95['id'],'closed':![],'SmsAccountId':_0x34ff37['id']}})[_0x47a5('0x21')](function(_0x54f283){if(_0x54f283){return[_0x54f283,![]];}return db['SmsInteraction'][_0x47a5('0x5b')]({'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id'],'SmsAccountId':_0x34ff37['id'],'phone':_0x50b482,'firstMsgDirection':_0x47a5('0xba'),'Messages':[_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0['body'][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'UserId':_0x5b48d0[_0x47a5('0x5c')]['id'],'ContactId':_0x2bbf95['id']})]},{'include':[{'model':db[_0x47a5('0x9a')],'as':_0x47a5('0xbb')}]})[_0x47a5('0x21')](function(_0x454609){return[_0x454609,!![]];});});}})[_0x47a5('0xbc')](function(_0x5c4301,_0x2bc0d8){if(_0x2bc0d8){return _0x5c4301;}return db[_0x47a5('0x9a')][_0x47a5('0x5b')](_[_0x47a5('0x4c')](_0x5b48d0[_0x47a5('0x61')],{'read':![],'body':_0x5b48d0[_0x47a5('0x61')][_0x47a5('0x61')],'phone':_0x50b482,'SmsAccountId':_0x34ff37['id'],'SmsInteractionId':_0x5c4301['id'],'UserId':_0x5b48d0['user']['id'],'ContactId':_0x2bbf95['id']}))['then'](function(_0x11d87b){_0x5c4301[_0x47a5('0xbd')][_0x47a5('0xbb')]=[];_0x5c4301['dataValues']['Messages'][_0x47a5('0xbe')](_0x11d87b[_0x47a5('0xbd')]);return _0x5c4301;});})[_0x47a5('0x21')](respondWithResult(_0x40fe75,null))[_0x47a5('0x54')](handleError(_0x40fe75,null));};exports[_0x47a5('0x2a')]=function(_0x4121c1,_0x2e0add,_0x58e85b){if(_0x4121c1[_0x47a5('0x61')]['id']){delete _0x4121c1[_0x47a5('0x61')]['id'];}console[_0x47a5('0xbf')]('endpoint\x20/status\x20POST\x20/',_0x4121c1[_0x47a5('0x61')]);var _0x611b40,_0x144bc9,_0x278b42;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x4121c1[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x9ced85){if(_0x9ced85){_0x278b42=_0x9ced85;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),'received\x20delivery\x20report\x20from',_0x9ced85[_0x47a5('0x3b')],util['inspect'](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));switch(_0x9ced85['type']){case _0x47a5('0x7b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc0')]&&_0x4121c1['body'][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1['body'][_0x47a5('0x2a')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['skebby_dispatch_id']}});}break;case _0x47a5('0x7d'):if(_0x4121c1['body']['requestid']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc2')]}});}break;case _0x47a5('0xc3'):if(_0x4121c1['body']['message_id']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc4')];return db[_0x47a5('0x9a')]['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')][_0x47a5('0x7e')]}});}break;case _0x47a5('0x82'):var _0x50ff41=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x50ff41[_0x47a5('0x7a')]&&_0x50ff41['status'][_0x47a5('0xc5')]===_0x47a5('0xc6')){_0x144bc9=_0x50ff41[_0x47a5('0x2a')]['groupName'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x50ff41[_0x47a5('0x7a')]}});}break;case _0x47a5('0x87'):if(_0x4121c1[_0x47a5('0x61')]['messageId']&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['messageId']}});}break;case _0x47a5('0x8b'):if(_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc7')]&&_0x4121c1[_0x47a5('0x61')][_0x47a5('0x2a')]){_0x144bc9=_0x4121c1[_0x47a5('0x61')]['status'];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x4121c1[_0x47a5('0x61')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x2e0add,null))[_0x47a5('0x21')](function(_0x4ebe30){if(_0x4ebe30){_0x611b40=_0x4ebe30;switch(_0x278b42[_0x47a5('0x3b')]){case _0x47a5('0x7b'):if(_0x144bc9===_0x47a5('0xc6')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x7d'):if(_0x144bc9==='1'){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0x7b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x4121c1[_0x47a5('0x61')][_0x47a5('0xc9')]&&_0x144bc9>=0xc8&&_0x144bc9<=0xce){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xc3'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x82'):var _0x2cc493=_0x4121c1['body'][_0x47a5('0x83')][0x0];if(_0x2cc493[_0x47a5('0x2a')][_0x47a5('0xc5')]===_0x47a5('0xc6')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),'infobip',util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x144bc9==_0x47a5('0xca')||_0x144bc9==_0x47a5('0xcb')){return _0x611b40[_0x47a5('0x30')]({'read':!![]});}else{logger['error'](_0x47a5('0x25'),'status',_0x47a5('0x87'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;case _0x47a5('0x8b'):if(_0x144bc9===_0x47a5('0xcc')||_0x144bc9===_0x47a5('0xcd')){return _0x611b40['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47a5('0x2a'),_0x47a5('0x8b'),util[_0x47a5('0xc8')](_0x4121c1[_0x47a5('0x61')],{'showHidden':![],'depth':null}));}break;}return _0x611b40;}})[_0x47a5('0x21')](respondWithResult(_0x2e0add,null))[_0x47a5('0x54')](handleError(_0x2e0add,null));};exports[_0x47a5('0xce')]=function(_0x138b92,_0x232c36,_0x25954e){var _0x277061,_0x3917e0,_0x1c7695;return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x138b92[_0x47a5('0x56')]['id']}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x46b82a){if(_0x46b82a){_0x1c7695=_0x46b82a;logger[_0x47a5('0xa6')](_0x47a5('0x25'),_0x47a5('0x2a'),_0x47a5('0xcf'),_0x46b82a[_0x47a5('0x3b')],util[_0x47a5('0xc8')](_0x138b92['query'],{'showHidden':![],'depth':null}));switch(_0x46b82a[_0x47a5('0x3b')]){case'csc':if(_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]&&_0x138b92['query'][_0x47a5('0xd1')]){_0x3917e0=_0x138b92['query'][_0x47a5('0xd1')];return db[_0x47a5('0x9a')][_0x47a5('0x5a')]({'where':{'messageId':_0x138b92[_0x47a5('0x3f')][_0x47a5('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x232c36,null))[_0x47a5('0x21')](function(_0x9a2f87){if(_0x9a2f87){_0x277061=_0x9a2f87;switch(_0x1c7695[_0x47a5('0x3b')]){case'csc':if(_0x3917e0==='2'||_0x3917e0==='6'){return _0x277061['update']({'read':!![]});}else{logger[_0x47a5('0x26')](_0x47a5('0x25'),_0x47a5('0x2a'),'csc',util[_0x47a5('0xc8')](_0x138b92[_0x47a5('0x3f')],{'showHidden':![],'depth':null}));};break;}return _0x277061;}})[_0x47a5('0x21')](respondWithResult(_0x232c36,null))['catch'](handleError(_0x232c36,null));};exports[_0x47a5('0xd2')]=function(_0x3136f9,_0x3ecc43,_0xf4b1df){return db['SmsAccount'][_0x47a5('0x5a')]({'where':{'id':_0x3136f9['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x3ecc43,null))[_0x47a5('0x21')](function(_0xdc5eac){if(_0xdc5eac){return _0xdc5eac[_0x47a5('0xd2')](_0x3136f9['body'][_0x47a5('0x68')],_[_0x47a5('0xd3')](_0x3136f9[_0x47a5('0x61')],[_0x47a5('0x68'),'id'])||{})[_0x47a5('0xbc')](function(_0x4c2b0c){for(var _0xbe3a38=0x0;_0xbe3a38<_0x3136f9[_0x47a5('0x61')][_0x47a5('0x68')][_0x47a5('0x59')];_0xbe3a38+=0x1){socket[_0x47a5('0xd4')](_0x47a5('0xd5'),{'UserId':_0x3136f9['body'][_0x47a5('0x68')][_0xbe3a38],'SmsAccountId':_0x3136f9[_0x47a5('0x56')]['id']});}return _0x4c2b0c;});}})['then'](respondWithResult(_0x3ecc43,null))['catch'](handleError(_0x3ecc43,null));};exports[_0x47a5('0xd6')]=function(_0x32d299,_0x20d99b,_0x3964f8){return db[_0x47a5('0x39')][_0x47a5('0x5a')]({'where':{'id':_0x32d299['params']['id']}})['then'](handleEntityNotFound(_0x20d99b,null))[_0x47a5('0x21')](function(_0xa3a516){if(_0xa3a516){return _0xa3a516['removeAgents'](_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')])['then'](function(){if(_[_0x47a5('0xd7')](_0x32d299['query']['ids'])){for(var _0x4aeaff=0x0;_0x4aeaff<_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')][_0x47a5('0x59')];_0x4aeaff+=0x1){socket['emit'](_0x47a5('0xd8'),{'UserId':Number(_0x32d299['query'][_0x47a5('0x68')][_0x4aeaff]),'SmsAccountId':Number(_0x32d299['params']['id'])});}}else{socket[_0x47a5('0xd4')](_0x47a5('0xd8'),{'UserId':Number(_0x32d299[_0x47a5('0x3f')][_0x47a5('0x68')]),'SmsAccountId':Number(_0x32d299[_0x47a5('0x56')]['id'])});}});}})[_0x47a5('0x21')](respondWithStatusCode(_0x20d99b,null))[_0x47a5('0x54')](handleError(_0x20d99b,null));};exports[_0x47a5('0xd9')]=function(_0x1396c2,_0x5c9091,_0x4f1e24){var _0x24c88e={};var _0xa859a={};var _0x5270cc;var _0x2a0f45;return db[_0x47a5('0x39')][_0x47a5('0x6b')]({'where':{'id':_0x1396c2[_0x47a5('0x56')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x5c9091,null))[_0x47a5('0x21')](function(_0x969d4b){if(_0x969d4b){_0x5270cc=_0x969d4b;_0xa859a[_0x47a5('0x3d')]=_[_0x47a5('0x40')](db[_0x47a5('0x9d')]['rawAttributes']);_0xa859a['query']=_['keys'](_0x1396c2['query']);_0xa859a[_0x47a5('0x41')]=_['intersection'](_0xa859a[_0x47a5('0x3d')],_0xa859a[_0x47a5('0x3f')]);_0x24c88e['attributes']=_[_0x47a5('0x42')](_0xa859a[_0x47a5('0x3d')],qs[_0x47a5('0x44')](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x44')]));_0x24c88e[_0x47a5('0x43')]=_0x24c88e['attributes'][_0x47a5('0x59')]?_0x24c88e[_0x47a5('0x43')]:_0xa859a['model'];_0x24c88e[_0x47a5('0x47')]=qs['sort'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x48')]);_0x24c88e[_0x47a5('0x49')]=qs[_0x47a5('0x41')](_[_0x47a5('0x4a')](_0x1396c2[_0x47a5('0x3f')],_0xa859a[_0x47a5('0x41')]));if(_0x1396c2['query'][_0x47a5('0x4b')]){_0x24c88e[_0x47a5('0x49')]=_['merge'](_0x24c88e[_0x47a5('0x49')],{'$or':_[_0x47a5('0x3e')](_0x24c88e['attributes'],function(_0x14c968){var _0x5a7920={};_0x5a7920[_0x14c968]={'$like':'%'+_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x4b')]+'%'};return _0x5a7920;})});}_0x24c88e=_[_0x47a5('0x4c')]({},_0x24c88e,_0x1396c2[_0x47a5('0x4e')]);return _0x5270cc[_0x47a5('0xd9')](_0x24c88e);}})['then'](function(_0x4b8b65){if(_0x4b8b65){_0x2a0f45=_0x4b8b65[_0x47a5('0x59')];if(!_0x1396c2['query']['hasOwnProperty']('nolimit')){_0x24c88e[_0x47a5('0x2e')]=qs['limit'](_0x1396c2[_0x47a5('0x3f')][_0x47a5('0x2e')]);_0x24c88e[_0x47a5('0x2d')]=qs['offset'](_0x1396c2['query'][_0x47a5('0x2d')]);}return _0x5270cc['getAgents'](_0x24c88e);}})['then'](function(_0xe87e6e){if(_0xe87e6e){return _0xe87e6e?{'count':_0x2a0f45,'rows':_0xe87e6e}:null;}})['then'](respondWithResult(_0x5c9091,null))['catch'](handleError(_0x5c9091,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 1aa8e2a..9f1e233 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 _0x1a1b=['hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','remove','emit'];(function(_0x159179,_0x269526){var _0x47d557=function(_0x23ee61){while(--_0x23ee61){_0x159179['push'](_0x159179['shift']());}};_0x47d557(++_0x269526);}(_0x1a1b,0xa4));var _0xb1a1=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0x1a1b[_0x139a3c];return _0x2b375b;};'use strict';var EventEmitter=require(_0xb1a1('0x0'));var SmsAccount=require(_0xb1a1('0x1'))['db'][_0xb1a1('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xb1a1('0x3')](0x0);var events={'afterCreate':_0xb1a1('0x4'),'afterUpdate':'update','afterDestroy':_0xb1a1('0x5')};function emitEvent(_0xe544ef){return function(_0x27ff6e,_0x3cdb03,_0x44b434){SmsAccountEvents[_0xb1a1('0x6')](_0xe544ef+':'+_0x27ff6e['id'],_0x27ff6e);SmsAccountEvents[_0xb1a1('0x6')](_0xe544ef,_0x27ff6e);_0x44b434(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xb1a1('0x7')](e,emitEvent(event));}}module[_0xb1a1('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0xe821=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount'];(function(_0x2ec7e4,_0x142bc9){var _0x42a88e=function(_0x3fbb3e){while(--_0x3fbb3e){_0x2ec7e4['push'](_0x2ec7e4['shift']());}};_0x42a88e(++_0x142bc9);}(_0xe821,0x1c8));var _0x1e82=function(_0x1a4294,_0x1947f3){_0x1a4294=_0x1a4294-0x0;var _0x434335=_0xe821[_0x1a4294];return _0x434335;};'use strict';var EventEmitter=require(_0x1e82('0x0'));var SmsAccount=require(_0x1e82('0x1'))['db'][_0x1e82('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1e82('0x3')](0x0);var events={'afterCreate':_0x1e82('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x26f64d){return function(_0x566610,_0x12c853,_0x35d0cb){SmsAccountEvents[_0x1e82('0x5')](_0x26f64d+':'+_0x566610['id'],_0x566610);SmsAccountEvents[_0x1e82('0x5')](_0x26f64d,_0x566610);_0x35d0cb(null);};}for(var e in events){if(events[_0x1e82('0x6')](e)){var event=events[e];SmsAccount[_0x1e82('0x7')](e,emitEvent(event));}}module[_0x1e82('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 7203dc2..37cdeca 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 _0xa9e0=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3218c1,_0x13c041){var _0x542132=function(_0x19b606){while(--_0x19b606){_0x3218c1['push'](_0x3218c1['shift']());}};_0x542132(++_0x13c041);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x40e190,_0x3ac19a){var _0x27a867=function(_0x5b898e){while(--_0x5b898e){_0x40e190['push'](_0x40e190['shift']());}};_0x27a867(++_0x3ac19a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 4ac4eae..a0c100f 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 _0x8fe0=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsAccount','find','options','raw','where','attributes','include','map','model','ShowSmsAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x8fe0,0x1d7));var _0x08fe=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8fe0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x08fe('0x0'));var util=require(_0x08fe('0x1'));var moment=require(_0x08fe('0x2'));var BPromise=require(_0x08fe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x08fe('0x4'));var db=require(_0x08fe('0x5'))['db'];var utils=require(_0x08fe('0x6'));var logger=require(_0x08fe('0x7'))(_0x08fe('0x8'));var config=require(_0x08fe('0x9'));var jayson=require(_0x08fe('0xa'));var client=jayson[_0x08fe('0xb')][_0x08fe('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x08fe('0xd')],{'host':_0x08fe('0xe'),'port':0x18eb});var socket=require(_0x08fe('0xf'))(new Redis(config['redis']));require(_0x08fe('0x10'))['register'](socket);function respondWithRpcPromise(_0x108c81,_0x46612f,_0x160dc1){return new BPromise(function(_0x4094c2,_0x6113df){return client[_0x08fe('0x11')](_0x108c81,_0x160dc1)[_0x08fe('0x12')](function(_0x670abf){logger[_0x08fe('0x13')](_0x08fe('0x14'),_0x46612f,_0x08fe('0x15'));logger[_0x08fe('0x16')](_0x08fe('0x17'),_0x46612f,_0x08fe('0x15'),JSON[_0x08fe('0x18')](_0x670abf));if(_0x670abf[_0x08fe('0x19')]){if(_0x670abf['error'][_0x08fe('0x1a')]===0x1f4){logger[_0x08fe('0x19')](_0x08fe('0x14'),_0x46612f,_0x670abf[_0x08fe('0x19')][_0x08fe('0x1b')]);return _0x6113df(_0x670abf['error'][_0x08fe('0x1b')]);}logger[_0x08fe('0x19')]('SmsAccount,\x20%s,\x20%s',_0x46612f,_0x670abf[_0x08fe('0x19')][_0x08fe('0x1b')]);return _0x4094c2(_0x670abf[_0x08fe('0x19')][_0x08fe('0x1b')]);}else{logger[_0x08fe('0x13')]('SmsAccount,\x20%s,\x20%s',_0x46612f,_0x08fe('0x15'));_0x4094c2(_0x670abf[_0x08fe('0x1c')][_0x08fe('0x1b')]);}})[_0x08fe('0x1d')](function(_0x43e2b3){logger[_0x08fe('0x19')]('SmsAccount,\x20%s,\x20%s',_0x46612f,_0x43e2b3);_0x6113df(_0x43e2b3);});});}exports['ShowSmsAccount']=function(_0x2fc458){var _0x2ba345=this;return new Promise(function(_0x2d048e,_0x45320a){return db[_0x08fe('0x1e')][_0x08fe('0x1f')]({'raw':_0x2fc458[_0x08fe('0x20')]?_0x2fc458[_0x08fe('0x20')][_0x08fe('0x21')]===undefined?!![]:![]:!![],'where':_0x2fc458[_0x08fe('0x20')]?_0x2fc458[_0x08fe('0x20')][_0x08fe('0x22')]||null:null,'attributes':_0x2fc458[_0x08fe('0x20')]?_0x2fc458[_0x08fe('0x20')][_0x08fe('0x23')]||null:null,'include':_0x2fc458[_0x08fe('0x20')]?_0x2fc458['options'][_0x08fe('0x24')]?_[_0x08fe('0x25')](_0x2fc458[_0x08fe('0x20')][_0x08fe('0x24')],function(_0x3f096a){return{'model':db[_0x3f096a[_0x08fe('0x26')]],'as':_0x3f096a['as'],'attributes':_0x3f096a['attributes'],'include':_0x3f096a[_0x08fe('0x24')]?_['map'](_0x3f096a[_0x08fe('0x24')],function(_0x492472){return{'model':db[_0x492472['model']],'as':_0x492472['as'],'attributes':_0x492472[_0x08fe('0x23')],'include':_0x492472['include']?_[_0x08fe('0x25')](_0x492472[_0x08fe('0x24')],function(_0xcf2c6a){return{'model':db[_0xcf2c6a['model']],'as':_0xcf2c6a['as'],'attributes':_0xcf2c6a[_0x08fe('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd4ae12){logger[_0x08fe('0x13')](_0x08fe('0x27'),_0x2fc458);logger[_0x08fe('0x16')]('ShowSmsAccount',_0x2fc458,JSON[_0x08fe('0x18')](_0xd4ae12));_0x2d048e(_0xd4ae12);})['catch'](function(_0x166a09){logger[_0x08fe('0x19')](_0x08fe('0x27'),_0x166a09['message'],_0x2fc458);_0x45320a(_0x2ba345['error'](0x1f4,_0x166a09[_0x08fe('0x1b')]));});});}; \ No newline at end of file +var _0x1f69=['debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','message','info','result','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','SmsAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x2fe49d,_0x11cf71){var _0x534d4c=function(_0x51cc34){while(--_0x51cc34){_0x2fe49d['push'](_0x2fe49d['shift']());}};_0x534d4c(++_0x11cf71);}(_0x1f69,0x197));var _0x91f6=function(_0x4eaf4f,_0x5072e9){_0x4eaf4f=_0x4eaf4f-0x0;var _0x16a3c4=_0x1f69[_0x4eaf4f];return _0x16a3c4;};'use strict';var _=require(_0x91f6('0x0'));var util=require(_0x91f6('0x1'));var moment=require(_0x91f6('0x2'));var BPromise=require('bluebird');var rs=require(_0x91f6('0x3'));var fs=require('fs');var Redis=require(_0x91f6('0x4'));var db=require(_0x91f6('0x5'))['db'];var utils=require(_0x91f6('0x6'));var logger=require(_0x91f6('0x7'))(_0x91f6('0x8'));var config=require(_0x91f6('0x9'));var jayson=require(_0x91f6('0xa'));var client=jayson[_0x91f6('0xb')][_0x91f6('0xc')]({'port':0x232a});config[_0x91f6('0xd')]=_[_0x91f6('0xe')](config[_0x91f6('0xd')],{'host':_0x91f6('0xf'),'port':0x18eb});var socket=require(_0x91f6('0x10'))(new Redis(config[_0x91f6('0xd')]));require(_0x91f6('0x11'))[_0x91f6('0x12')](socket);function respondWithRpcPromise(_0x1e8800,_0x22a5b9,_0x3a0267){return new BPromise(function(_0x350559,_0x3e6452){return client[_0x91f6('0x13')](_0x1e8800,_0x3a0267)['then'](function(_0x24acdf){logger['info'](_0x91f6('0x14'),_0x22a5b9,_0x91f6('0x15'));logger[_0x91f6('0x16')](_0x91f6('0x17'),_0x22a5b9,_0x91f6('0x15'),JSON['stringify'](_0x24acdf));if(_0x24acdf['error']){if(_0x24acdf[_0x91f6('0x18')]['code']===0x1f4){logger[_0x91f6('0x18')](_0x91f6('0x14'),_0x22a5b9,_0x24acdf[_0x91f6('0x18')][_0x91f6('0x19')]);return _0x3e6452(_0x24acdf[_0x91f6('0x18')][_0x91f6('0x19')]);}logger[_0x91f6('0x18')](_0x91f6('0x14'),_0x22a5b9,_0x24acdf[_0x91f6('0x18')][_0x91f6('0x19')]);return _0x350559(_0x24acdf[_0x91f6('0x18')][_0x91f6('0x19')]);}else{logger[_0x91f6('0x1a')](_0x91f6('0x14'),_0x22a5b9,_0x91f6('0x15'));_0x350559(_0x24acdf[_0x91f6('0x1b')][_0x91f6('0x19')]);}})['catch'](function(_0x2cc7c3){logger[_0x91f6('0x18')](_0x91f6('0x14'),_0x22a5b9,_0x2cc7c3);_0x3e6452(_0x2cc7c3);});});}exports[_0x91f6('0x1c')]=function(_0x59dad5){var _0x1102c6=this;return new Promise(function(_0xd33dd7,_0x552ed9){return db[_0x91f6('0x1d')][_0x91f6('0x1e')]({'raw':_0x59dad5['options']?_0x59dad5[_0x91f6('0x1f')][_0x91f6('0x20')]===undefined?!![]:![]:!![],'where':_0x59dad5[_0x91f6('0x1f')]?_0x59dad5[_0x91f6('0x1f')][_0x91f6('0x21')]||null:null,'attributes':_0x59dad5['options']?_0x59dad5[_0x91f6('0x1f')][_0x91f6('0x22')]||null:null,'include':_0x59dad5[_0x91f6('0x1f')]?_0x59dad5[_0x91f6('0x1f')][_0x91f6('0x23')]?_[_0x91f6('0x24')](_0x59dad5[_0x91f6('0x1f')]['include'],function(_0x41c55a){return{'model':db[_0x41c55a['model']],'as':_0x41c55a['as'],'attributes':_0x41c55a[_0x91f6('0x22')],'include':_0x41c55a[_0x91f6('0x23')]?_['map'](_0x41c55a['include'],function(_0x44d573){return{'model':db[_0x44d573['model']],'as':_0x44d573['as'],'attributes':_0x44d573[_0x91f6('0x22')],'include':_0x44d573['include']?_[_0x91f6('0x24')](_0x44d573[_0x91f6('0x23')],function(_0x8cc6b5){return{'model':db[_0x8cc6b5['model']],'as':_0x8cc6b5['as'],'attributes':_0x8cc6b5[_0x91f6('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8d82bc){logger[_0x91f6('0x1a')]('ShowSmsAccount',_0x59dad5);logger['debug']('ShowSmsAccount',_0x59dad5,JSON[_0x91f6('0x25')](_0x8d82bc));_0xd33dd7(_0x8d82bc);})[_0x91f6('0x26')](function(_0x1bc0f7){logger[_0x91f6('0x18')](_0x91f6('0x1c'),_0x1bc0f7[_0x91f6('0x19')],_0x59dad5);_0x552ed9(_0x1102c6['error'](0x1f4,_0x1bc0f7['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 8534a06..ab12542 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 _0x0d18=['update','emit','register','length','./smsAccount.events','save','remove'];(function(_0xd0a290,_0x55cb33){var _0x377b3d=function(_0x56d2e0){while(--_0x56d2e0){_0xd0a290['push'](_0xd0a290['shift']());}};_0x377b3d(++_0x55cb33);}(_0x0d18,0x1d2));var _0x80d1=function(_0x29b5b8,_0x5d1406){_0x29b5b8=_0x29b5b8-0x0;var _0x678c3c=_0x0d18[_0x29b5b8];return _0x678c3c;};'use strict';var SmsAccountEvents=require(_0x80d1('0x0'));var events=[_0x80d1('0x1'),_0x80d1('0x2'),_0x80d1('0x3')];function createListener(_0x46e385,_0x4e4107){return function(_0x477374){_0x4e4107[_0x80d1('0x4')](_0x46e385,_0x477374);};}function removeListener(_0x2099e1,_0x56c25b){return function(){SmsAccountEvents['removeListener'](_0x2099e1,_0x56c25b);};}exports[_0x80d1('0x5')]=function(_0x434f6a){for(var _0x2f6be3=0x0,_0x295ec3=events[_0x80d1('0x6')];_0x2f6be3<_0x295ec3;_0x2f6be3++){var _0x1bf67d=events[_0x2f6be3];var _0x163de3=createListener('smsAccount:'+_0x1bf67d,_0x434f6a);SmsAccountEvents['on'](_0x1bf67d,_0x163de3);}}; \ No newline at end of file +var _0x8aaf=['./smsAccount.events','save','update','removeListener','register','length','smsAccount:'];(function(_0x3e3064,_0x3dd6f5){var _0x4547e1=function(_0x785d07){while(--_0x785d07){_0x3e3064['push'](_0x3e3064['shift']());}};_0x4547e1(++_0x3dd6f5);}(_0x8aaf,0x93));var _0xf8aa=function(_0x253b14,_0x267f87){_0x253b14=_0x253b14-0x0;var _0x5b4ad3=_0x8aaf[_0x253b14];return _0x5b4ad3;};'use strict';var SmsAccountEvents=require(_0xf8aa('0x0'));var events=[_0xf8aa('0x1'),'remove',_0xf8aa('0x2')];function createListener(_0xf2c0b4,_0x5c47ac){return function(_0x12eb91){_0x5c47ac['emit'](_0xf2c0b4,_0x12eb91);};}function removeListener(_0x196636,_0x16aa76){return function(){SmsAccountEvents[_0xf8aa('0x3')](_0x196636,_0x16aa76);};}exports[_0xf8aa('0x4')]=function(_0x380d6e){for(var _0x17e813=0x0,_0x533f72=events[_0xf8aa('0x5')];_0x17e813<_0x533f72;_0x17e813++){var _0x484178=events[_0x17e813];var _0x3f7539=createListener(_0xf8aa('0x6')+_0x484178,_0x380d6e);SmsAccountEvents['on'](_0x484178,_0x3f7539);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 4eef770..e0acb14 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 _0x7cb1=['./smsApplication.controller','get','isAuthenticated','index','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x116e95,_0x1d5a65){var _0x554d3f=function(_0xff0143){while(--_0xff0143){_0x116e95['push'](_0x116e95['shift']());}};_0x554d3f(++_0x1d5a65);}(_0x7cb1,0x14d));var _0x17cb=function(_0x578fa9,_0x3138e1){_0x578fa9=_0x578fa9-0x0;var _0xdb4080=_0x7cb1[_0x578fa9];return _0xdb4080;};'use strict';var multer=require(_0x17cb('0x0'));var util=require(_0x17cb('0x1'));var path=require(_0x17cb('0x2'));var timeout=require(_0x17cb('0x3'));var express=require(_0x17cb('0x4'));var router=express[_0x17cb('0x5')]();var auth=require(_0x17cb('0x6'));var interaction=require(_0x17cb('0x7'));var config=require(_0x17cb('0x8'));var controller=require(_0x17cb('0x9'));router[_0x17cb('0xa')]('/',auth[_0x17cb('0xb')](),controller[_0x17cb('0xc')]);router[_0x17cb('0xa')](_0x17cb('0xd'),auth[_0x17cb('0xb')](),controller[_0x17cb('0xe')]);router['post']('/',auth[_0x17cb('0xb')](),controller['create']);router[_0x17cb('0xf')](_0x17cb('0xd'),auth[_0x17cb('0xb')](),controller[_0x17cb('0x10')]);router['delete'](_0x17cb('0xd'),auth[_0x17cb('0xb')](),controller[_0x17cb('0x11')]);module[_0x17cb('0x12')]=router; \ No newline at end of file +var _0xc5df=['delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x38c6df,_0x31b514){var _0x1148a8=function(_0x196ad6){while(--_0x196ad6){_0x38c6df['push'](_0x38c6df['shift']());}};_0x1148a8(++_0x31b514);}(_0xc5df,0xc8));var _0xfc5d=function(_0x16c3f3,_0x8ce147){_0x16c3f3=_0x16c3f3-0x0;var _0x1cc955=_0xc5df[_0x16c3f3];return _0x1cc955;};'use strict';var multer=require(_0xfc5d('0x0'));var util=require(_0xfc5d('0x1'));var path=require(_0xfc5d('0x2'));var timeout=require('connect-timeout');var express=require(_0xfc5d('0x3'));var router=express[_0xfc5d('0x4')]();var auth=require(_0xfc5d('0x5'));var interaction=require(_0xfc5d('0x6'));var config=require(_0xfc5d('0x7'));var controller=require('./smsApplication.controller');router[_0xfc5d('0x8')]('/',auth[_0xfc5d('0x9')](),controller[_0xfc5d('0xa')]);router[_0xfc5d('0x8')](_0xfc5d('0xb'),auth[_0xfc5d('0x9')](),controller[_0xfc5d('0xc')]);router[_0xfc5d('0xd')]('/',auth[_0xfc5d('0x9')](),controller[_0xfc5d('0xe')]);router['put'](_0xfc5d('0xb'),auth[_0xfc5d('0x9')](),controller[_0xfc5d('0xf')]);router[_0xfc5d('0x10')](_0xfc5d('0xb'),auth[_0xfc5d('0x9')](),controller['destroy']);module[_0xfc5d('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index ee63d1e..ead9ed2 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 _0x6b79=['sequelize','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x526281,_0x43d678){var _0xd5e681=function(_0x65699e){while(--_0x65699e){_0x526281['push'](_0x526281['shift']());}};_0xd5e681(++_0x43d678);}(_0x6b79,0x96));var _0x96b7=function(_0x1fe4f2,_0x4adf7c){_0x1fe4f2=_0x1fe4f2-0x0;var _0x57e639=_0x6b79[_0x1fe4f2];return _0x57e639;};'use strict';var Sequelize=require(_0x96b7('0x0'));module['exports']={'priority':{'type':Sequelize[_0x96b7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x96b7('0x2')],'allowNull':![],'defaultValue':_0x96b7('0x3')},'appdata':{'type':Sequelize[_0x96b7('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x96b7('0x2')],'defaultValue':_0x96b7('0x5')}}; \ No newline at end of file +var _0xd9de=['noop','*,*,*,*','exports','INTEGER','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd9de,0x1e7));var _0xed9d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd9de[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require('sequelize');module[_0xed9d('0x0')]={'priority':{'type':Sequelize[_0xed9d('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xed9d('0x2')],'allowNull':![],'defaultValue':_0xed9d('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xed9d('0x2')],'defaultValue':_0xed9d('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index cecb3c1..159f5ce 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 _0xcf2f=['model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','SmsApplication','count','includeAll','include','rows','catch','show','params','length','options','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','offset','limit','set','Content-Range','json','reject','update','then','error','stack','name','send','index','map','fieldName','type'];(function(_0x117f4c,_0x36a9b1){var _0x2b24e9=function(_0x31761b){while(--_0x31761b){_0x117f4c['push'](_0x117f4c['shift']());}};_0x2b24e9(++_0x36a9b1);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x53ffc6,_0x86f150){_0x53ffc6=_0x53ffc6-0x0;var _0x751e2f=_0xcf2f[_0x53ffc6];return _0x751e2f;};'use strict';var pdf=require(_0xfcf2('0x0'));var emlformat=require(_0xfcf2('0x1'));var rimraf=require(_0xfcf2('0x2'));var zipdir=require(_0xfcf2('0x3'));var jsonpatch=require(_0xfcf2('0x4'));var rp=require('request-promise');var moment=require(_0xfcf2('0x5'));var BPromise=require(_0xfcf2('0x6'));var Mustache=require(_0xfcf2('0x7'));var util=require(_0xfcf2('0x8'));var path=require(_0xfcf2('0x9'));var sox=require(_0xfcf2('0xa'));var csv=require(_0xfcf2('0xb'));var ejs=require(_0xfcf2('0xc'));var fs=require('fs');var _=require(_0xfcf2('0xd'));var squel=require(_0xfcf2('0xe'));var crypto=require(_0xfcf2('0xf'));var jsforce=require(_0xfcf2('0x10'));var deskjs=require(_0xfcf2('0x11'));var toCsv=require(_0xfcf2('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfcf2('0x12'));var qs=require(_0xfcf2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcf2('0x14'));var logger=require(_0xfcf2('0x15'))(_0xfcf2('0x16'));var utils=require(_0xfcf2('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec301d,_0x1ba610){_0x1ba610=_0x1ba610||0xcc;return function(_0x175ac9){if(_0x175ac9){return _0xec301d[_0xfcf2('0x18')](_0x1ba610);}return _0xec301d['status'](_0x1ba610)[_0xfcf2('0x19')]();};}function respondWithResult(_0x51ec8d,_0x5b414a){_0x5b414a=_0x5b414a||0xc8;return function(_0x5dc04b){if(_0x5dc04b){return _0x51ec8d[_0xfcf2('0x1a')](_0x5b414a)['json'](_0x5dc04b);}};}function respondWithFilteredResult(_0x3aa6c0,_0x1febf8){return function(_0x245f9a){if(_0x245f9a){var _0x21f7d1=_0x245f9a['count'],_0x315b2f=_0x1febf8[_0xfcf2('0x1b')],_0x44320d=_0x1febf8[_0xfcf2('0x1b')]+_0x1febf8[_0xfcf2('0x1c')],_0x1de1e5;if(_0x44320d>=_0x21f7d1){_0x44320d=_0x21f7d1;_0x1de1e5=0xc8;}else{_0x1de1e5=0xce;}_0x3aa6c0['status'](_0x1de1e5);return _0x3aa6c0[_0xfcf2('0x1d')](_0xfcf2('0x1e'),_0x315b2f+'-'+_0x44320d+'/'+_0x21f7d1)[_0xfcf2('0x1f')](_0x245f9a);}return null;};}function patchUpdates(_0x1cc67e){return function(_0x329f1a){try{jsonpatch['apply'](_0x329f1a,_0x1cc67e,!![]);}catch(_0x203301){return BPromise[_0xfcf2('0x20')](_0x203301);}return _0x329f1a['save']();};}function saveUpdates(_0x9a1d9f,_0x23c079){return function(_0x206738){if(_0x206738){return _0x206738[_0xfcf2('0x21')](_0x9a1d9f)[_0xfcf2('0x22')](function(_0x78dc2e){return _0x78dc2e;});}return null;};}function removeEntity(_0x122e4f,_0x422c5a){return function(_0x1eeebd){if(_0x1eeebd){return _0x1eeebd['destroy']()[_0xfcf2('0x22')](function(){_0x122e4f[_0xfcf2('0x1a')](0xcc)[_0xfcf2('0x19')]();});}};}function handleEntityNotFound(_0x584e76,_0x26641a){return function(_0x151aa8){if(!_0x151aa8){_0x584e76['sendStatus'](0x194);}return _0x151aa8;};}function handleError(_0x3c3774,_0xbc8722){_0xbc8722=_0xbc8722||0x1f4;return function(_0x53042f){logger[_0xfcf2('0x23')](_0x53042f[_0xfcf2('0x24')]);if(_0x53042f[_0xfcf2('0x25')]){delete _0x53042f[_0xfcf2('0x25')];}_0x3c3774['status'](_0xbc8722)[_0xfcf2('0x26')](_0x53042f);};}exports[_0xfcf2('0x27')]=function(_0x2a9d64,_0x3779ee){var _0x17c994={},_0x2b1d60={},_0x315f1a={'count':0x0,'rows':[]};var _0x1c8f38=_[_0xfcf2('0x28')](db['SmsApplication']['rawAttributes'],function(_0x695f31){return{'name':_0x695f31[_0xfcf2('0x29')],'type':_0x695f31[_0xfcf2('0x2a')]['key']};});_0x2b1d60[_0xfcf2('0x2b')]=_['map'](_0x1c8f38,_0xfcf2('0x25'));_0x2b1d60[_0xfcf2('0x2c')]=_[_0xfcf2('0x2d')](_0x2a9d64[_0xfcf2('0x2c')]);_0x2b1d60[_0xfcf2('0x2e')]=_[_0xfcf2('0x2f')](_0x2b1d60[_0xfcf2('0x2b')],_0x2b1d60['query']);_0x17c994['attributes']=_[_0xfcf2('0x2f')](_0x2b1d60[_0xfcf2('0x2b')],qs[_0xfcf2('0x30')](_0x2a9d64[_0xfcf2('0x2c')]['fields']));_0x17c994['attributes']=_0x17c994[_0xfcf2('0x31')]['length']?_0x17c994[_0xfcf2('0x31')]:_0x2b1d60[_0xfcf2('0x2b')];if(!_0x2a9d64['query'][_0xfcf2('0x32')](_0xfcf2('0x33'))){_0x17c994[_0xfcf2('0x1c')]=qs[_0xfcf2('0x1c')](_0x2a9d64[_0xfcf2('0x2c')][_0xfcf2('0x1c')]);_0x17c994[_0xfcf2('0x1b')]=qs['offset'](_0x2a9d64[_0xfcf2('0x2c')][_0xfcf2('0x1b')]);}_0x17c994['order']=qs[_0xfcf2('0x34')](_0x2a9d64[_0xfcf2('0x2c')]['sort']);_0x17c994[_0xfcf2('0x35')]=qs[_0xfcf2('0x2e')](_['pick'](_0x2a9d64[_0xfcf2('0x2c')],_0x2b1d60[_0xfcf2('0x2e')]),_0x1c8f38);if(_0x2a9d64[_0xfcf2('0x2c')][_0xfcf2('0x36')]){_0x17c994['where']=_[_0xfcf2('0x37')](_0x17c994[_0xfcf2('0x35')],{'$or':_[_0xfcf2('0x28')](_0x1c8f38,function(_0x10448a){if(_0x10448a[_0xfcf2('0x2a')]!=='VIRTUAL'){var _0x135475={};_0x135475[_0x10448a[_0xfcf2('0x25')]]={'$like':'%'+_0x2a9d64[_0xfcf2('0x2c')][_0xfcf2('0x36')]+'%'};return _0x135475;}})});}_0x17c994=_[_0xfcf2('0x37')]({},_0x17c994,_0x2a9d64['options']);var _0xc38622={'where':_0x17c994['where']};return db[_0xfcf2('0x38')][_0xfcf2('0x39')](_0xc38622)[_0xfcf2('0x22')](function(_0x3a1284){_0x315f1a[_0xfcf2('0x39')]=_0x3a1284;if(_0x2a9d64['query'][_0xfcf2('0x3a')]){_0x17c994[_0xfcf2('0x3b')]=[{'all':!![]}];}return db[_0xfcf2('0x38')]['findAll'](_0x17c994);})[_0xfcf2('0x22')](function(_0x4532e6){_0x315f1a[_0xfcf2('0x3c')]=_0x4532e6;return _0x315f1a;})[_0xfcf2('0x22')](respondWithFilteredResult(_0x3779ee,_0x17c994))[_0xfcf2('0x3d')](handleError(_0x3779ee,null));};exports[_0xfcf2('0x3e')]=function(_0x526513,_0x5ab500){var _0x526c42={'raw':!![],'where':{'id':_0x526513[_0xfcf2('0x3f')]['id']}},_0x9027bb={};_0x9027bb[_0xfcf2('0x2b')]=_['keys'](db['SmsApplication']['rawAttributes']);_0x9027bb[_0xfcf2('0x2c')]=_[_0xfcf2('0x2d')](_0x526513[_0xfcf2('0x2c')]);_0x9027bb[_0xfcf2('0x2e')]=_[_0xfcf2('0x2f')](_0x9027bb[_0xfcf2('0x2b')],_0x9027bb[_0xfcf2('0x2c')]);_0x526c42[_0xfcf2('0x31')]=_[_0xfcf2('0x2f')](_0x9027bb[_0xfcf2('0x2b')],qs[_0xfcf2('0x30')](_0x526513['query']['fields']));_0x526c42[_0xfcf2('0x31')]=_0x526c42[_0xfcf2('0x31')][_0xfcf2('0x40')]?_0x526c42[_0xfcf2('0x31')]:_0x9027bb[_0xfcf2('0x2b')];if(_0x526513[_0xfcf2('0x2c')][_0xfcf2('0x3a')]){_0x526c42[_0xfcf2('0x3b')]=[{'all':!![]}];}_0x526c42=_[_0xfcf2('0x37')]({},_0x526c42,_0x526513[_0xfcf2('0x41')]);return db[_0xfcf2('0x38')][_0xfcf2('0x42')](_0x526c42)[_0xfcf2('0x22')](handleEntityNotFound(_0x5ab500,null))[_0xfcf2('0x22')](respondWithResult(_0x5ab500,null))[_0xfcf2('0x3d')](handleError(_0x5ab500,null));};exports[_0xfcf2('0x43')]=function(_0xbfe692,_0x52cd60){return db[_0xfcf2('0x38')][_0xfcf2('0x43')](_0xbfe692['body'],{})[_0xfcf2('0x22')](respondWithResult(_0x52cd60,0xc9))['catch'](handleError(_0x52cd60,null));};exports[_0xfcf2('0x21')]=function(_0xe85e89,_0x3f7103){if(_0xe85e89[_0xfcf2('0x44')]['id']){delete _0xe85e89['body']['id'];}return db['SmsApplication']['find']({'where':{'id':_0xe85e89[_0xfcf2('0x3f')]['id']}})[_0xfcf2('0x22')](handleEntityNotFound(_0x3f7103,null))[_0xfcf2('0x22')](saveUpdates(_0xe85e89[_0xfcf2('0x44')],null))['then'](respondWithResult(_0x3f7103,null))[_0xfcf2('0x3d')](handleError(_0x3f7103,null));};exports[_0xfcf2('0x45')]=function(_0x3b981c,_0x548c6c){return db[_0xfcf2('0x38')][_0xfcf2('0x42')]({'where':{'id':_0x3b981c[_0xfcf2('0x3f')]['id']}})[_0xfcf2('0x22')](handleEntityNotFound(_0x548c6c,null))[_0xfcf2('0x22')](removeEntity(_0x548c6c,null))['catch'](handleError(_0x548c6c,null));}; \ No newline at end of file +var _0x32b6=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','apply','reject','save','then','stack','name','index','map','SmsApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','params','rawAttributes','find','catch','create','update','body','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/advancedSearch'];(function(_0x3a6e76,_0x2a1bc3){var _0x58ec47=function(_0x58efc9){while(--_0x58efc9){_0x3a6e76['push'](_0x3a6e76['shift']());}};_0x58ec47(++_0x2a1bc3);}(_0x32b6,0x1d1));var _0x632b=function(_0x36eeae,_0x15be3a){_0x36eeae=_0x36eeae-0x0;var _0x349241=_0x32b6[_0x36eeae];return _0x349241;};'use strict';var pdf=require(_0x632b('0x0'));var emlformat=require(_0x632b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x632b('0x2'));var jsonpatch=require(_0x632b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x632b('0x4'));var Mustache=require(_0x632b('0x5'));var util=require(_0x632b('0x6'));var path=require(_0x632b('0x7'));var sox=require(_0x632b('0x8'));var csv=require(_0x632b('0x9'));var ejs=require(_0x632b('0xa'));var fs=require('fs');var _=require(_0x632b('0xb'));var squel=require(_0x632b('0xc'));var crypto=require(_0x632b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x632b('0xe'));var toCsv=require(_0x632b('0x9'));var querystring=require(_0x632b('0xf'));var Papa=require(_0x632b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x632b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x632b('0x12'))(_0x632b('0x13'));var utils=require(_0x632b('0x14'));var config=require(_0x632b('0x15'));var db=require(_0x632b('0x16'))['db'];function respondWithStatusCode(_0x2e1dbc,_0xe81378){_0xe81378=_0xe81378||0xcc;return function(_0x3d8bed){if(_0x3d8bed){return _0x2e1dbc[_0x632b('0x17')](_0xe81378);}return _0x2e1dbc['status'](_0xe81378)[_0x632b('0x18')]();};}function respondWithResult(_0x286f75,_0x9246a6){_0x9246a6=_0x9246a6||0xc8;return function(_0x5a97da){if(_0x5a97da){return _0x286f75[_0x632b('0x19')](_0x9246a6)[_0x632b('0x1a')](_0x5a97da);}};}function respondWithFilteredResult(_0x108249,_0x17ff9b){return function(_0x40d410){if(_0x40d410){var _0x21cdd3=_0x40d410['count'],_0x4efe39=_0x17ff9b[_0x632b('0x1b')],_0x17ddc5=_0x17ff9b['offset']+_0x17ff9b[_0x632b('0x1c')],_0x52f353;if(_0x17ddc5>=_0x21cdd3){_0x17ddc5=_0x21cdd3;_0x52f353=0xc8;}else{_0x52f353=0xce;}_0x108249[_0x632b('0x19')](_0x52f353);return _0x108249[_0x632b('0x1d')]('Content-Range',_0x4efe39+'-'+_0x17ddc5+'/'+_0x21cdd3)[_0x632b('0x1a')](_0x40d410);}return null;};}function patchUpdates(_0x32ca1){return function(_0x366028){try{jsonpatch[_0x632b('0x1e')](_0x366028,_0x32ca1,!![]);}catch(_0x5baa04){return BPromise[_0x632b('0x1f')](_0x5baa04);}return _0x366028[_0x632b('0x20')]();};}function saveUpdates(_0x4f377f,_0x116f62){return function(_0x50b930){if(_0x50b930){return _0x50b930['update'](_0x4f377f)[_0x632b('0x21')](function(_0x5ce3fa){return _0x5ce3fa;});}return null;};}function removeEntity(_0xc9d237,_0x1c4530){return function(_0x2a6833){if(_0x2a6833){return _0x2a6833['destroy']()[_0x632b('0x21')](function(){_0xc9d237[_0x632b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1db8f5,_0x379dc2){return function(_0x30ffb9){if(!_0x30ffb9){_0x1db8f5[_0x632b('0x17')](0x194);}return _0x30ffb9;};}function handleError(_0x45d017,_0x183c5c){_0x183c5c=_0x183c5c||0x1f4;return function(_0x5ec5ea){logger['error'](_0x5ec5ea[_0x632b('0x22')]);if(_0x5ec5ea['name']){delete _0x5ec5ea[_0x632b('0x23')];}_0x45d017[_0x632b('0x19')](_0x183c5c)['send'](_0x5ec5ea);};}exports[_0x632b('0x24')]=function(_0x3f4eab,_0x29d9aa){var _0x18dc8c={},_0x4728a8={},_0x515d74={'count':0x0,'rows':[]};var _0xe9d530=_[_0x632b('0x25')](db[_0x632b('0x26')]['rawAttributes'],function(_0x1bb484){return{'name':_0x1bb484[_0x632b('0x27')],'type':_0x1bb484[_0x632b('0x28')][_0x632b('0x29')]};});_0x4728a8[_0x632b('0x2a')]=_[_0x632b('0x25')](_0xe9d530,_0x632b('0x23'));_0x4728a8[_0x632b('0x2b')]=_[_0x632b('0x2c')](_0x3f4eab[_0x632b('0x2b')]);_0x4728a8[_0x632b('0x2d')]=_[_0x632b('0x2e')](_0x4728a8[_0x632b('0x2a')],_0x4728a8[_0x632b('0x2b')]);_0x18dc8c[_0x632b('0x2f')]=_[_0x632b('0x2e')](_0x4728a8[_0x632b('0x2a')],qs[_0x632b('0x30')](_0x3f4eab[_0x632b('0x2b')][_0x632b('0x30')]));_0x18dc8c['attributes']=_0x18dc8c[_0x632b('0x2f')][_0x632b('0x31')]?_0x18dc8c[_0x632b('0x2f')]:_0x4728a8[_0x632b('0x2a')];if(!_0x3f4eab['query'][_0x632b('0x32')]('nolimit')){_0x18dc8c[_0x632b('0x1c')]=qs[_0x632b('0x1c')](_0x3f4eab['query'][_0x632b('0x1c')]);_0x18dc8c[_0x632b('0x1b')]=qs[_0x632b('0x1b')](_0x3f4eab[_0x632b('0x2b')][_0x632b('0x1b')]);}_0x18dc8c[_0x632b('0x33')]=qs[_0x632b('0x34')](_0x3f4eab[_0x632b('0x2b')]['sort']);_0x18dc8c['where']=qs[_0x632b('0x2d')](_[_0x632b('0x35')](_0x3f4eab[_0x632b('0x2b')],_0x4728a8[_0x632b('0x2d')]),_0xe9d530);if(_0x3f4eab[_0x632b('0x2b')][_0x632b('0x36')]){_0x18dc8c[_0x632b('0x37')]=_[_0x632b('0x38')](_0x18dc8c['where'],{'$or':_['map'](_0xe9d530,function(_0x3a0311){if(_0x3a0311['type']!==_0x632b('0x39')){var _0x31f7bb={};_0x31f7bb[_0x3a0311[_0x632b('0x23')]]={'$like':'%'+_0x3f4eab[_0x632b('0x2b')][_0x632b('0x36')]+'%'};return _0x31f7bb;}})});}_0x18dc8c=_[_0x632b('0x38')]({},_0x18dc8c,_0x3f4eab[_0x632b('0x3a')]);var _0x2d37ac={'where':_0x18dc8c[_0x632b('0x37')]};return db[_0x632b('0x26')][_0x632b('0x3b')](_0x2d37ac)[_0x632b('0x21')](function(_0x381eaa){_0x515d74[_0x632b('0x3b')]=_0x381eaa;if(_0x3f4eab[_0x632b('0x2b')][_0x632b('0x3c')]){_0x18dc8c[_0x632b('0x3d')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x18dc8c);})['then'](function(_0x588b90){_0x515d74['rows']=_0x588b90;return _0x515d74;})[_0x632b('0x21')](respondWithFilteredResult(_0x29d9aa,_0x18dc8c))['catch'](handleError(_0x29d9aa,null));};exports['show']=function(_0x55b5f6,_0x472a4f){var _0x4490d4={'raw':!![],'where':{'id':_0x55b5f6[_0x632b('0x3e')]['id']}},_0x417a30={};_0x417a30['model']=_[_0x632b('0x2c')](db[_0x632b('0x26')][_0x632b('0x3f')]);_0x417a30['query']=_[_0x632b('0x2c')](_0x55b5f6[_0x632b('0x2b')]);_0x417a30[_0x632b('0x2d')]=_[_0x632b('0x2e')](_0x417a30[_0x632b('0x2a')],_0x417a30[_0x632b('0x2b')]);_0x4490d4['attributes']=_[_0x632b('0x2e')](_0x417a30[_0x632b('0x2a')],qs[_0x632b('0x30')](_0x55b5f6[_0x632b('0x2b')]['fields']));_0x4490d4['attributes']=_0x4490d4[_0x632b('0x2f')][_0x632b('0x31')]?_0x4490d4[_0x632b('0x2f')]:_0x417a30[_0x632b('0x2a')];if(_0x55b5f6[_0x632b('0x2b')][_0x632b('0x3c')]){_0x4490d4['include']=[{'all':!![]}];}_0x4490d4=_[_0x632b('0x38')]({},_0x4490d4,_0x55b5f6[_0x632b('0x3a')]);return db[_0x632b('0x26')][_0x632b('0x40')](_0x4490d4)[_0x632b('0x21')](handleEntityNotFound(_0x472a4f,null))[_0x632b('0x21')](respondWithResult(_0x472a4f,null))[_0x632b('0x41')](handleError(_0x472a4f,null));};exports[_0x632b('0x42')]=function(_0x53f7f3,_0x876a33){return db['SmsApplication'][_0x632b('0x42')](_0x53f7f3['body'],{})[_0x632b('0x21')](respondWithResult(_0x876a33,0xc9))[_0x632b('0x41')](handleError(_0x876a33,null));};exports[_0x632b('0x43')]=function(_0x2c4561,_0x3924db){if(_0x2c4561['body']['id']){delete _0x2c4561[_0x632b('0x44')]['id'];}return db[_0x632b('0x26')][_0x632b('0x40')]({'where':{'id':_0x2c4561['params']['id']}})[_0x632b('0x21')](handleEntityNotFound(_0x3924db,null))[_0x632b('0x21')](saveUpdates(_0x2c4561[_0x632b('0x44')],null))[_0x632b('0x21')](respondWithResult(_0x3924db,null))[_0x632b('0x41')](handleError(_0x3924db,null));};exports['destroy']=function(_0xe51b4f,_0x50adc4){return db[_0x632b('0x26')][_0x632b('0x40')]({'where':{'id':_0xe51b4f[_0x632b('0x3e')]['id']}})[_0x632b('0x21')](handleEntityNotFound(_0x50adc4,null))[_0x632b('0x21')](removeEntity(_0x50adc4,null))['catch'](handleError(_0x50adc4,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 269b408..c6259db 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 _0x98ce=['../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x112339,_0x23f4d9){var _0x113f74=function(_0x23fd67){while(--_0x23fd67){_0x112339['push'](_0x112339['shift']());}};_0x113f74(++_0x23f4d9);}(_0x98ce,0x69));var _0xe98c=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x98ce[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xe98c('0x0'));var util=require(_0xe98c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe98c('0x2'));var BPromise=require(_0xe98c('0x3'));var rp=require(_0xe98c('0x4'));var fs=require('fs');var path=require(_0xe98c('0x5'));var rimraf=require(_0xe98c('0x6'));var config=require(_0xe98c('0x7'));var attributes=require(_0xe98c('0x8'));module['exports']=function(_0x5d90bb,_0x1cc3a5){return _0x5d90bb[_0xe98c('0x9')](_0xe98c('0xa'),attributes,{'tableName':_0xe98c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe98c('0xc'),'collate':_0xe98c('0xd')});}; \ No newline at end of file +var _0x1e6f=['define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','bluebird','request-promise','rimraf','../../config/environment','./smsApplication.attributes'];(function(_0x30b6b7,_0x276fd5){var _0x269874=function(_0x406170){while(--_0x406170){_0x30b6b7['push'](_0x30b6b7['shift']());}};_0x269874(++_0x276fd5);}(_0x1e6f,0x1e5));var _0xf1e6=function(_0x481b3d,_0x5828bd){_0x481b3d=_0x481b3d-0x0;var _0x49a275=_0x1e6f[_0x481b3d];return _0x49a275;};'use strict';var _=require(_0xf1e6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf1e6('0x1'));var moment=require('moment');var BPromise=require(_0xf1e6('0x2'));var rp=require(_0xf1e6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1e6('0x4'));var config=require(_0xf1e6('0x5'));var attributes=require(_0xf1e6('0x6'));module['exports']=function(_0x40452c,_0xaaf38f){return _0x40452c[_0xf1e6('0x7')](_0xf1e6('0x8'),attributes,{'tableName':_0xf1e6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf1e6('0xa'),'collate':_0xf1e6('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index ccd6c54..21b9bee 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 _0x6c32=['request','info','request\x20sent','debug','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x2065f5,_0x598754){var _0x8dd8e3=function(_0x2711d3){while(--_0x2711d3){_0x2065f5['push'](_0x2065f5['shift']());}};_0x8dd8e3(++_0x598754);}(_0x6c32,0xb5));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x26c3('0x0'));var util=require('util');var moment=require(_0x26c3('0x1'));var BPromise=require('bluebird');var rs=require(_0x26c3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x26c3('0x3'))['db'];var utils=require(_0x26c3('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x26c3('0x5'));var jayson=require(_0x26c3('0x6'));var client=jayson[_0x26c3('0x7')][_0x26c3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17bc12,_0x2756e5,_0x438a89){return new BPromise(function(_0x11ed3d,_0x2134b8){return client[_0x26c3('0x9')](_0x17bc12,_0x438a89)['then'](function(_0x561496){logger[_0x26c3('0xa')]('SmsApplication,\x20%s,\x20%s',_0x2756e5,_0x26c3('0xb'));logger[_0x26c3('0xc')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x2756e5,_0x26c3('0xb'),JSON[_0x26c3('0xd')](_0x561496));if(_0x561496[_0x26c3('0xe')]){if(_0x561496[_0x26c3('0xe')][_0x26c3('0xf')]===0x1f4){logger['error'](_0x26c3('0x10'),_0x2756e5,_0x561496[_0x26c3('0xe')][_0x26c3('0x11')]);return _0x2134b8(_0x561496[_0x26c3('0xe')][_0x26c3('0x11')]);}logger[_0x26c3('0xe')](_0x26c3('0x10'),_0x2756e5,_0x561496[_0x26c3('0xe')]['message']);return _0x11ed3d(_0x561496['error'][_0x26c3('0x11')]);}else{logger[_0x26c3('0xa')](_0x26c3('0x10'),_0x2756e5,_0x26c3('0xb'));_0x11ed3d(_0x561496[_0x26c3('0x12')][_0x26c3('0x11')]);}})['catch'](function(_0x2edaca){logger[_0x26c3('0xe')]('SmsApplication,\x20%s,\x20%s',_0x2756e5,_0x2edaca);_0x2134b8(_0x2edaca);});});} \ No newline at end of file +var _0x98a7=['http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x2906e6,_0x5ccd59){var _0x12517a=function(_0x36d576){while(--_0x36d576){_0x2906e6['push'](_0x2906e6['shift']());}};_0x12517a(++_0x5ccd59);}(_0x98a7,0x9e));var _0x798a=function(_0xce587,_0x4d0609){_0xce587=_0xce587-0x0;var _0x5baf43=_0x98a7[_0xce587];return _0x5baf43;};'use strict';var _=require(_0x798a('0x0'));var util=require(_0x798a('0x1'));var moment=require(_0x798a('0x2'));var BPromise=require(_0x798a('0x3'));var rs=require(_0x798a('0x4'));var fs=require('fs');var Redis=require(_0x798a('0x5'));var db=require(_0x798a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x798a('0x7'))(_0x798a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x798a('0x9')][_0x798a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9645e3,_0x3f17e2,_0x2a5393){return new BPromise(function(_0x8e1e29,_0x3be3d4){return client[_0x798a('0xb')](_0x9645e3,_0x2a5393)['then'](function(_0x1d2225){logger[_0x798a('0xc')](_0x798a('0xd'),_0x3f17e2,_0x798a('0xe'));logger['debug'](_0x798a('0xf'),_0x3f17e2,_0x798a('0xe'),JSON[_0x798a('0x10')](_0x1d2225));if(_0x1d2225[_0x798a('0x11')]){if(_0x1d2225[_0x798a('0x11')][_0x798a('0x12')]===0x1f4){logger['error'](_0x798a('0xd'),_0x3f17e2,_0x1d2225[_0x798a('0x11')][_0x798a('0x13')]);return _0x3be3d4(_0x1d2225[_0x798a('0x11')]['message']);}logger[_0x798a('0x11')](_0x798a('0xd'),_0x3f17e2,_0x1d2225['error'][_0x798a('0x13')]);return _0x8e1e29(_0x1d2225['error'][_0x798a('0x13')]);}else{logger[_0x798a('0xc')](_0x798a('0xd'),_0x3f17e2,_0x798a('0xe'));_0x8e1e29(_0x1d2225['result'][_0x798a('0x13')]);}})[_0x798a('0x14')](function(_0x536617){logger[_0x798a('0x11')](_0x798a('0xd'),_0x3f17e2,_0x536617);_0x3be3d4(_0x536617);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 32e050e..dc2b64a 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 _0xc6d7=['/describe','describe','/:id','getMessages','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index'];(function(_0x346f62,_0x5079bc){var _0x1783a8=function(_0x3dca5e){while(--_0x3dca5e){_0x346f62['push'](_0x346f62['shift']());}};_0x1783a8(++_0x5079bc);}(_0xc6d7,0x71));var _0x7c6d=function(_0x2aef17,_0x2726f1){_0x2aef17=_0x2aef17-0x0;var _0x1859e3=_0xc6d7[_0x2aef17];return _0x1859e3;};'use strict';var multer=require(_0x7c6d('0x0'));var util=require(_0x7c6d('0x1'));var path=require(_0x7c6d('0x2'));var timeout=require(_0x7c6d('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x7c6d('0x4'));var interaction=require(_0x7c6d('0x5'));var config=require(_0x7c6d('0x6'));var controller=require(_0x7c6d('0x7'));router[_0x7c6d('0x8')]('/',auth[_0x7c6d('0x9')](),controller[_0x7c6d('0xa')]);router[_0x7c6d('0x8')](_0x7c6d('0xb'),auth[_0x7c6d('0x9')](),controller[_0x7c6d('0xc')]);router[_0x7c6d('0x8')](_0x7c6d('0xd'),auth[_0x7c6d('0x9')](),controller['show']);router[_0x7c6d('0x8')]('/:id/messages',auth[_0x7c6d('0x9')](),controller[_0x7c6d('0xe')]);router[_0x7c6d('0x8')](_0x7c6d('0xf'),auth['isAuthenticated'](),controller[_0x7c6d('0x10')]);router[_0x7c6d('0x11')]('/',auth[_0x7c6d('0x9')](),controller[_0x7c6d('0x12')]);router[_0x7c6d('0x11')](_0x7c6d('0x13'),auth[_0x7c6d('0x9')](),controller['addMessage']);router[_0x7c6d('0x11')](_0x7c6d('0x14'),auth[_0x7c6d('0x9')](),interaction[_0x7c6d('0x15')](_0x7c6d('0x16'),_0x7c6d('0x17')),controller[_0x7c6d('0x18')]);router[_0x7c6d('0x19')](_0x7c6d('0xd'),auth['isAuthenticated'](),interaction[_0x7c6d('0x15')](_0x7c6d('0x16'),'smsinteraction:update'),controller[_0x7c6d('0x1a')]);router[_0x7c6d('0x1b')](_0x7c6d('0xd'),auth[_0x7c6d('0x9')](),interaction[_0x7c6d('0x15')](_0x7c6d('0x16'),_0x7c6d('0x1c')),controller[_0x7c6d('0x1d')]);router[_0x7c6d('0x1b')]('/:id/tags',auth[_0x7c6d('0x9')](),controller['removeTags']);module[_0x7c6d('0x1e')]=router; \ No newline at end of file +var _0x0a48=['post','create','addMessage','/:id/tags','tracked','sms','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/messages','getMessages'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0x0a48,0x95));var _0x80a4=function(_0xc9783b,_0x7d3db2){_0xc9783b=_0xc9783b-0x0;var _0x57b576=_0x0a48[_0xc9783b];return _0x57b576;};'use strict';var multer=require(_0x80a4('0x0'));var util=require(_0x80a4('0x1'));var path=require('path');var timeout=require(_0x80a4('0x2'));var express=require(_0x80a4('0x3'));var router=express[_0x80a4('0x4')]();var auth=require(_0x80a4('0x5'));var interaction=require(_0x80a4('0x6'));var config=require('../../config/environment');var controller=require('./smsInteraction.controller');router[_0x80a4('0x7')]('/',auth[_0x80a4('0x8')](),controller[_0x80a4('0x9')]);router[_0x80a4('0x7')]('/describe',auth[_0x80a4('0x8')](),controller['describe']);router[_0x80a4('0x7')](_0x80a4('0xa'),auth[_0x80a4('0x8')](),controller['show']);router['get'](_0x80a4('0xb'),auth[_0x80a4('0x8')](),controller[_0x80a4('0xc')]);router[_0x80a4('0x7')]('/:id/download',auth[_0x80a4('0x8')](),controller['download']);router[_0x80a4('0xd')]('/',auth['isAuthenticated'](),controller[_0x80a4('0xe')]);router[_0x80a4('0xd')]('/:id/messages',auth[_0x80a4('0x8')](),controller[_0x80a4('0xf')]);router[_0x80a4('0xd')](_0x80a4('0x10'),auth[_0x80a4('0x8')](),interaction[_0x80a4('0x11')](_0x80a4('0x12'),'smsinteraction:addtags'),controller['addTags']);router[_0x80a4('0x13')](_0x80a4('0xa'),auth[_0x80a4('0x8')](),interaction[_0x80a4('0x11')]('sms',_0x80a4('0x14')),controller[_0x80a4('0x15')]);router[_0x80a4('0x16')](_0x80a4('0xa'),auth[_0x80a4('0x8')](),interaction[_0x80a4('0x11')](_0x80a4('0x12'),_0x80a4('0x17')),controller[_0x80a4('0x18')]);router[_0x80a4('0x16')](_0x80a4('0x10'),auth[_0x80a4('0x8')](),controller[_0x80a4('0x19')]);module[_0x80a4('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 61b91b7..ce7b736 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 _0xe706=['ENUM','out','sequelize','moment','exports','DATE','STRING'];(function(_0x1be240,_0x34ee07){var _0xd727eb=function(_0x3df629){while(--_0x3df629){_0x1be240['push'](_0x1be240['shift']());}};_0xd727eb(++_0x34ee07);}(_0xe706,0xa3));var _0x6e70=function(_0x163d42,_0x3cabea){_0x163d42=_0x163d42-0x0;var _0x59186c=_0xe706[_0x163d42];return _0x59186c;};'use strict';var Sequelize=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6e70('0x3')]},'disposition':{'type':Sequelize[_0x6e70('0x4')]},'note':{'type':Sequelize[_0x6e70('0x4')]},'phone':{'type':Sequelize[_0x6e70('0x4')]},'read1stAt':{'type':Sequelize[_0x6e70('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6e70('0x5')]('in',_0x6e70('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6e70('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x6e70('0x5')]('in',_0x6e70('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xd8b0=['moment','STRING','DATE','ENUM','out','sequelize'];(function(_0x1f1641,_0x42ad9d){var _0x9660b4=function(_0x545ff2){while(--_0x545ff2){_0x1f1641['push'](_0x1f1641['shift']());}};_0x9660b4(++_0x42ad9d);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0d8b('0x2')]},'note':{'type':Sequelize[_0x0d8b('0x2')]},'phone':{'type':Sequelize[_0x0d8b('0x2')]},'read1stAt':{'type':Sequelize[_0x0d8b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in',_0x0d8b('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index d4e52f7..71ac40f 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 _0xb332=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','sendStatus','status','json','count','offset','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','Users','map','fullname','TagIds','Tags','push','catch','index','SmsInteraction','type','key','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filters','field','color','from','tools_tags','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','find','UserId','start','body','keys','some','compact','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','resolve','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','i.SmsAccountId\x20IS\x20NULL','sequelize','keyBy','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','show','params','include','options','create','describe','SmsMessage','addMessage','omit','ids','getMessages','findOne','rawAttributes','hasOwnProperty','merge','$gte','format','includeAll','findAll','rows','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','download','root','server','tmp','join','files','attachments','CmContact','lastName','Messages','direction','read','SmsAccount','Account','Owner','get','mkdirSync','\x0a\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\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20','30px','Sms','YYYY-MM-DD','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','out','System','firstName','secret','renderFile','views','downloadInteraction.html','transcript-','.pdf','log','err','html-pdf','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','lodash','jsforce'];(function(_0x1b2bde,_0x32ea63){var _0x1743b9=function(_0x1202ca){while(--_0x1202ca){_0x1b2bde['push'](_0x1b2bde['shift']());}};_0x1743b9(++_0x32ea63);}(_0xb332,0xd9));var _0x2b33=function(_0x8b631b,_0x386724){_0x8b631b=_0x8b631b-0x0;var _0x3e6832=_0xb332[_0x8b631b];return _0x3e6832;};'use strict';var pdf=require(_0x2b33('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2b33('0x1'));var zipdir=require(_0x2b33('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b33('0x3'));var moment=require('moment');var BPromise=require(_0x2b33('0x4'));var Mustache=require('mustache');var util=require(_0x2b33('0x5'));var path=require('path');var sox=require(_0x2b33('0x6'));var csv=require(_0x2b33('0x7'));var ejs=require(_0x2b33('0x8'));var fs=require('fs');var _=require(_0x2b33('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2b33('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x2b33('0x7'));var querystring=require(_0x2b33('0xb'));var Papa=require(_0x2b33('0xc'));var Redis=require(_0x2b33('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2b33('0xe'));var as=require(_0x2b33('0xf'));var hardwareService=require(_0x2b33('0x10'));var logger=require(_0x2b33('0x11'))(_0x2b33('0x12'));var utils=require(_0x2b33('0x13'));var config=require(_0x2b33('0x14'));var db=require(_0x2b33('0x15'))['db'];config[_0x2b33('0x16')]=_[_0x2b33('0x17')](config[_0x2b33('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x2b33('0x18'))(new Redis(config[_0x2b33('0x16')]));require(_0x2b33('0x19'))['register'](socket);function respondWithStatusCode(_0x173c75,_0x4d39db){_0x4d39db=_0x4d39db||0xcc;return function(_0x3fcf4e){if(_0x3fcf4e){return _0x173c75[_0x2b33('0x1a')](_0x4d39db);}return _0x173c75[_0x2b33('0x1b')](_0x4d39db)['end']();};}function respondWithResult(_0x52693f,_0x1d8e75){_0x1d8e75=_0x1d8e75||0xc8;return function(_0x1d50d0){if(_0x1d50d0){return _0x52693f[_0x2b33('0x1b')](_0x1d8e75)[_0x2b33('0x1c')](_0x1d50d0);}};}function respondWithFilteredResult(_0xf8af33,_0x4d69d0){return function(_0x554ab3){if(_0x554ab3){var _0x59f0b6=_0x554ab3[_0x2b33('0x1d')],_0x4041bd=_0x4d69d0[_0x2b33('0x1e')],_0x4f10c4=_0x4d69d0[_0x2b33('0x1e')]+_0x4d69d0['limit'],_0x543d52;if(_0x4f10c4>=_0x59f0b6){_0x4f10c4=_0x59f0b6;_0x543d52=0xc8;}else{_0x543d52=0xce;}_0xf8af33[_0x2b33('0x1b')](_0x543d52);return _0xf8af33['set'](_0x2b33('0x1f'),_0x4041bd+'-'+_0x4f10c4+'/'+_0x59f0b6)[_0x2b33('0x1c')](_0x554ab3);}return null;};}function patchUpdates(_0x8c8dc2){return function(_0x2998dd){try{jsonpatch[_0x2b33('0x20')](_0x2998dd,_0x8c8dc2,!![]);}catch(_0x6d20b){return BPromise[_0x2b33('0x21')](_0x6d20b);}return _0x2998dd['save']();};}function saveUpdates(_0x23024c,_0x1d9c98){return function(_0x100c8d){if(_0x100c8d){return _0x100c8d[_0x2b33('0x22')](_0x23024c)[_0x2b33('0x23')](function(_0x1c27d4){return _0x1c27d4;});}return null;};}function removeEntity(_0x27f1b8,_0x2605e6){return function(_0x5e1cba){if(_0x5e1cba){return _0x5e1cba[_0x2b33('0x24')]()[_0x2b33('0x23')](function(){_0x27f1b8[_0x2b33('0x1b')](0xcc)[_0x2b33('0x25')]();});}};}function handleEntityNotFound(_0x4df3d4,_0x2ec9db){return function(_0x530098){if(!_0x530098){_0x4df3d4[_0x2b33('0x1a')](0x194);}return _0x530098;};}function handleError(_0x483cf4,_0x2e74d0){_0x2e74d0=_0x2e74d0||0x1f4;return function(_0x341e0e){logger['error'](_0x341e0e[_0x2b33('0x26')]);if(_0x341e0e['name']){delete _0x341e0e[_0x2b33('0x27')];}_0x483cf4['status'](_0x2e74d0)[_0x2b33('0x28')](_0x341e0e);};}function getInteractionUsers(_0xa109f4,_0x9482a){return new BPromise(function(_0x268c1d,_0xaa6643){try{if(_0x9482a[_0xa109f4['id']]){_0xa109f4[_0x2b33('0x29')]=_[_0x2b33('0x2a')](_0x9482a[_0xa109f4['id']],function(_0x1fadc5){return{'id':_0x1fadc5['id'],'fullname':_0x1fadc5[_0x2b33('0x2b')]};});}}catch(_0x203c43){_0xaa6643(_0x203c43);}_0x268c1d(_0xa109f4);});}function getInteractionTags(_0x4cf72f,_0x5b6527){return new BPromise(function(_0x106ea0,_0x2a081c){try{if(_0x4cf72f[_0x2b33('0x2c')]){_0x4cf72f[_0x2b33('0x2d')]=[];_0x4cf72f[_0x2b33('0x2c')]['split'](',')['forEach'](function(_0x311ddd){_0x4cf72f[_0x2b33('0x2d')][_0x2b33('0x2e')](_0x5b6527[_0x311ddd]);});}delete _0x4cf72f[_0x2b33('0x2c')];}catch(_0xadee18){_0x2a081c(_0xadee18);}_0x106ea0(_0x4cf72f);});}function updateSmsInteraction(_0x3e8f43,_0x4d874c,_0x275df9){return new BPromise(function(_0x4da2dd,_0x370faf){return getInteractionUsers(_0x3e8f43,_0x275df9)[_0x2b33('0x23')](function(_0x38c020){return getInteractionTags(_0x38c020,_0x4d874c);})[_0x2b33('0x23')](function(_0x594d66){_0x4da2dd(_0x594d66);})[_0x2b33('0x2f')](function(_0x2bfdda){_0x370faf(_0x2bfdda);});});}exports[_0x2b33('0x30')]=function(_0x1de983,_0x2b9af8){var _0x782a64={},_0x281d2a={},_0xe415f4={'count':0x0,'rows':[]};var _0x19e351=_[_0x2b33('0x2a')](db[_0x2b33('0x31')]['rawAttributes'],function(_0x52a229){return{'name':_0x52a229['fieldName'],'type':_0x52a229[_0x2b33('0x32')][_0x2b33('0x33')]};});_0x281d2a[_0x2b33('0x34')]=_[_0x2b33('0x2a')](_0x19e351,_0x2b33('0x27'));_0x281d2a['query']=_['keys'](_0x1de983[_0x2b33('0x35')]);_0x281d2a['filters']=_[_0x2b33('0x36')](_0x281d2a[_0x2b33('0x34')],_0x281d2a[_0x2b33('0x35')]);_0x782a64[_0x2b33('0x37')]=_[_0x2b33('0x36')](_0x281d2a[_0x2b33('0x34')],qs[_0x2b33('0x38')](_0x1de983[_0x2b33('0x35')][_0x2b33('0x38')]));_0x782a64[_0x2b33('0x37')]=_0x782a64['attributes'][_0x2b33('0x39')]?_0x782a64[_0x2b33('0x37')]:_0x281d2a[_0x2b33('0x34')];if(!_0x1de983['query']['hasOwnProperty'](_0x2b33('0x3a'))){_0x782a64['limit']=qs[_0x2b33('0x3b')](_0x1de983[_0x2b33('0x35')]['limit']);_0x782a64[_0x2b33('0x1e')]=qs[_0x2b33('0x1e')](_0x1de983['query'][_0x2b33('0x1e')]);}_0x782a64[_0x2b33('0x3c')]=qs['sort'](_0x1de983[_0x2b33('0x35')][_0x2b33('0x3d')]);_0x782a64[_0x2b33('0x3e')]=qs['filters'](_[_0x2b33('0x3f')](_0x1de983[_0x2b33('0x35')],_0x281d2a[_0x2b33('0x40')]),_0x19e351);var _0x22f321=[];var _0x22ce0c=squel['select']()[_0x2b33('0x41')]('id')[_0x2b33('0x41')](_0x2b33('0x27'))['field'](_0x2b33('0x42'))[_0x2b33('0x43')](_0x2b33('0x44'));var _0xac1dad=squel['select']()[_0x2b33('0x41')](_0x2b33('0x45'))['field']('u.fullname')['field'](_0x2b33('0x46'))['from'](_0x2b33('0x47'),'ui')[_0x2b33('0x48')](_0x2b33('0x49'),'u',_0x2b33('0x4a'));var _0x16e415=squel[_0x2b33('0x4b')]()[_0x2b33('0x43')](_0x2b33('0x4c'),'i')['left_join'](_0x2b33('0x4d'),'c',_0x2b33('0x4e'))[_0x2b33('0x48')](_0x2b33('0x49'),'o',_0x2b33('0x4f'))[_0x2b33('0x48')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')['left_join']('sms_messages','me',_0x2b33('0x50'))['left_join'](_0x2b33('0x51'),'it','it.SmsInteractionId\x20=\x20i.id')['left_join'](_0x2b33('0x44'),'t',_0x2b33('0x52'));var _0x357724=squel['expr']();var _0xa8f425=[];var _0x484b51=squel[_0x2b33('0x53')]();var _0x27d3b6;if(_0x1de983[_0x2b33('0x35')][_0x2b33('0x54')]){_0x27d3b6=as[_0x2b33('0x55')](_0x1de983[_0x2b33('0x35')]['search']);var _0x1ca3d5=_0x27d3b6[_0x2b33('0x56')];for(var _0xc3fd2e=0x0;_0xc3fd2e<_0x27d3b6['conditions'][_0x2b33('0x39')];_0xc3fd2e++){var _0x2084a4=_0x27d3b6[_0x2b33('0x57')][_0xc3fd2e];var _0x569ba6='i';var _0xc1f23a=_['find'](_0x19e351,['name',_0x2084a4[_0x2b33('0x41')]]);if(!_0xc1f23a){switch(_0x2084a4[_0x2b33('0x41')]){case _0x2b33('0x58'):if(_0x2084a4[_0x2b33('0x59')]==0x1){_0x16e415[_0x2b33('0x5a')]('`'+_0x2084a4[_0x2b33('0x41')]+_0x2b33('0x5b'));}else{_0x16e415[_0x2b33('0x5a')]('`'+_0x2084a4['field']+_0x2b33('0x5c'));}break;case _0x2b33('0x5d'):if(_0x2084a4['operator']===_0x2b33('0x5e')){if(_0x2084a4[_0x2b33('0x59')]['split']('\x20')[_0x2b33('0x39')]>0x1){_0x357724[_0x1ca3d5](_0x2b33('0x5f'),qs[_0x2b33('0x60')](_0x2084a4[_0x2b33('0x59')]),null);}else{var _0x5892fe='%'+_0x2084a4[_0x2b33('0x59')]+'%';_0x357724[_0x1ca3d5](_0x2b33('0x61'),_0x5892fe,_0x5892fe,_0x5892fe);}}else{_0xc1f23a=_['find'](_0x19e351,[_0x2b33('0x27'),_0x2b33('0x62')]);_0x2084a4[_0x2b33('0x41')]=_0x2b33('0x62');_0x5c8246=as[_0x2b33('0x63')](_0x569ba6,_0xc1f23a[_0x2b33('0x32')],_0x2084a4);_0x357724[_0x1ca3d5](_0x5c8246[_0x2b33('0x64')],_0x5c8246['value']['start'],_0x5c8246[_0x2b33('0x59')][_0x2b33('0x25')]);}break;case'Tag':var _0x3ba2c6=_0x2084a4[_0x2b33('0x59')][_0x2b33('0x65')](',')['map'](function(_0x185c3e){return Number(_0x185c3e);});_0x3ba2c6[_0x2b33('0x66')](function(_0x59aca5){_0x484b51['or'](_0x2b33('0x67'),'%,'+_0x59aca5+',%');});_0xa8f425=_[_0x2b33('0x68')](_0xa8f425,_0x3ba2c6);break;case _0x2b33('0x69'):if(_0x2084a4[_0x2b33('0x6a')]===_0x2b33('0x5e')){_0x357724[_0x1ca3d5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2084a4['value']+'%',null);}else{_0xc1f23a=_[_0x2b33('0x6b')](_0x19e351,[_0x2b33('0x27'),_0x2b33('0x6c')]);_0x2084a4[_0x2b33('0x41')]=_0x2b33('0x6c');_0x5c8246=as[_0x2b33('0x63')](_0x569ba6,_0xc1f23a['type'],_0x2084a4);_0x357724[_0x1ca3d5](_0x5c8246[_0x2b33('0x64')],_0x5c8246[_0x2b33('0x59')][_0x2b33('0x6d')],_0x5c8246[_0x2b33('0x59')][_0x2b33('0x25')]);}break;case _0x2b33('0x6e'):_0x5c8246=as['buildExpression']('me',null,_0x2084a4);_0x357724[_0x1ca3d5](_0x5c8246[_0x2b33('0x64')],_0x5c8246[_0x2b33('0x59')][_0x2b33('0x6d')],_0x5c8246[_0x2b33('0x59')][_0x2b33('0x25')]);break;}}else{var _0x5c8246=as[_0x2b33('0x63')](_0x569ba6,_0xc1f23a[_0x2b33('0x32')],_0x2084a4);_0x357724[_0x1ca3d5](_0x5c8246[_0x2b33('0x64')],_0x5c8246[_0x2b33('0x59')]['start'],_0x5c8246[_0x2b33('0x59')]['end']);}}}else{var _0x1388ed=_(_0x1de983[_0x2b33('0x35')])[_0x2b33('0x6f')]()[_0x2b33('0x2a')](function(_0x2904ab){return _[_0x2b33('0x70')](_0x19e351,[_0x2b33('0x27'),_0x2904ab])?_0x2904ab:undefined;})[_0x2b33('0x71')]()['value']();if(!_[_0x2b33('0x72')](_0x1388ed)){_0x1388ed[_0x2b33('0x66')](function(_0x42fddc){if(_0x42fddc===_0x2b33('0x73')){_0x16e415[_0x2b33('0x3e')](_0x2b33('0x74'),[][_0x2b33('0x75')](_0x1de983[_0x2b33('0x35')][_0x42fddc]));}else if(_0x42fddc===_0x2b33('0x76')){var _0x2474d3=JSON[_0x2b33('0x77')](_0x1de983[_0x2b33('0x35')][_0x42fddc])['$gte'];var _0x452cca=JSON['parse'](_0x1de983['query'][_0x42fddc])[_0x2b33('0x78')];_0x16e415[_0x2b33('0x3e')](_0x2b33('0x79'),_0x2474d3,_0x452cca);}else{if(_0x1de983['query'][_0x42fddc]===_0x2b33('0x7a')){_0x16e415[_0x2b33('0x3e')]('i.'+_0x42fddc+_0x2b33('0x7b'));}else{_0x16e415[_0x2b33('0x3e')]('i.'+_0x42fddc+'\x20=\x20?',_0x1de983['query'][_0x42fddc]);}}});}if(_0x1de983['query']['read']){if(_0x1de983['query']['read']==0x1){_0x16e415['having'](_0x2b33('0x7c'));}else{_0x16e415[_0x2b33('0x5a')](_0x2b33('0x7d'));}}if(_0x1de983['query'][_0x2b33('0x7e')]){_0xa8f425=_[_0x2b33('0x7f')](_0x1de983[_0x2b33('0x35')][_0x2b33('0x7e')])?_0x1de983[_0x2b33('0x35')][_0x2b33('0x7e')]:new Array(_0x1de983['query']['tag']);_0xa8f425['forEach'](function(_0x594f75){_0x484b51['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x594f75+',%');});}if(_0x1de983['query'][_0x2b33('0x80')]){var _0x456c4b=_0x1de983['query'][_0x2b33('0x80')][_0x2b33('0x81')]('\x5c','\x5c\x5c')[_0x2b33('0x81')]('\x27\x27',_0x2b33('0x82'));if(qs[_0x2b33('0x83')](_0x456c4b)){_0x357724['or'](_0x2b33('0x84'),_0x456c4b+'%')['or'](_0x2b33('0x85'),_0x456c4b+'%');}else{_0x357724['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x456c4b))['or'](_0x2b33('0x86'),_0x456c4b+'%');}}}_0x16e415[_0x2b33('0x3e')](_0x357724);_0x16e415[_0x2b33('0x87')](_0x2b33('0x88'));var _0x2d02cc={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x30a108=_0x16e415[_0x2b33('0x89')]();_0x30a108[_0x2b33('0x41')]('i.id');_0x30a108['field'](_0x2b33('0x8a'),_0x2b33('0x58'));if(_0x782a64['order']){_0x782a64[_0x2b33('0x3c')][_0x2b33('0x66')](function(_0xd20141){_0x16e415['order']('i.'+_0xd20141[0x0],_0xd20141[0x1]===_0x2b33('0x8b')?![]:!![]);});}if(!_[_0x2b33('0x72')](_0xa8f425)){_0x16e415[_0x2b33('0x5a')](_0x484b51);_0x30a108[_0x2b33('0x3e')]('t.id\x20IN\x20?',_0xa8f425);}BPromise[_0x2b33('0x8c')]()['then'](function(){if(!_0x27d3b6){if(_0x1de983[_0x2b33('0x35')][_0x2b33('0x73')]||_0x1de983[_0x2b33('0x35')][_0x2b33('0x8d')])return;_0x30a108[_0x2b33('0x3e')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x16e415['where'](_0x2b33('0x8e'));return;}return _0x1de983['user']['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x2b33('0x23')](function(_0x342b8f){if(_[_0x2b33('0x72')](_0x342b8f)){_0x30a108[_0x2b33('0x3e')](_0x2b33('0x8f'));_0x16e415[_0x2b33('0x3e')](_0x2b33('0x8f'));}else{_0x30a108[_0x2b33('0x3e')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x342b8f,'id'));_0x16e415['where'](_0x2b33('0x74'),_[_0x2b33('0x2a')](_0x342b8f,'id'));}});})['then'](function(){db[_0x2b33('0x90')][_0x2b33('0x35')](_0x30a108['toString'](),_0x2d02cc)[_0x2b33('0x23')](function(_0x546602){_0xe415f4[_0x2b33('0x1d')]=_0x546602[_0x2b33('0x39')];if(_0xe415f4['count']===0x0)return[];return db[_0x2b33('0x90')][_0x2b33('0x35')](_0x22ce0c['toString'](),_0x2d02cc)[_0x2b33('0x23')](function(_0x56acea){_0x22f321=_[_0x2b33('0x91')](_0x56acea,'id');_0x2d02cc=_['merge'](_0x2d02cc,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1de983['query'][_0x2b33('0x38')]){_0x782a64['attributes'][_0x2b33('0x66')](function(_0xdd6652){_0x16e415[_0x2b33('0x41')]('i.'+_0xdd6652);});}else{_0x16e415[_0x2b33('0x41')](_0x2b33('0x8a'),_0x2b33('0x58'));_0x16e415[_0x2b33('0x41')](_0x2b33('0x92'),_0x2b33('0x93'));_0x16e415[_0x2b33('0x41')](_0x2b33('0x94'),'Account.mandatoryDisposition');_0x16e415[_0x2b33('0x41')](_0x2b33('0x95'));_0x16e415['field'](_0x2b33('0x96'),'Contact.firstName');_0x16e415[_0x2b33('0x41')]('c.lastName',_0x2b33('0x97'));_0x16e415['field'](_0x2b33('0x98'),_0x2b33('0x99'));_0x16e415[_0x2b33('0x41')](_0x2b33('0x9a'),'Contact.phone');_0x16e415[_0x2b33('0x41')](_0x2b33('0x9b'),'Contact.mobile');_0x16e415[_0x2b33('0x41')](_0x2b33('0x9c'),_0x2b33('0x9d'));_0x16e415[_0x2b33('0x41')]('o.fullname',_0x2b33('0x9e'));_0x16e415[_0x2b33('0x41')](_0x2b33('0x9f'),_0x2b33('0xa0'));_0x16e415['field'](_0x2b33('0xa1'),'TagIds');}if(_0x782a64[_0x2b33('0x3b')])_0x16e415[_0x2b33('0x3b')](_0x782a64[_0x2b33('0x3b')]);if(_0x782a64[_0x2b33('0x1e')])_0x16e415['offset'](_0x782a64[_0x2b33('0x1e')]);return db[_0x2b33('0x90')][_0x2b33('0x35')](_0x16e415[_0x2b33('0xa2')](),_0x2d02cc);})[_0x2b33('0x23')](function(_0x52e791){_0xac1dad[_0x2b33('0x3e')](_0x2b33('0xa3'),_[_0x2b33('0x2a')](_0x52e791,'id'));return db[_0x2b33('0x90')][_0x2b33('0x35')](_0xac1dad['toString'](),_0x2d02cc)[_0x2b33('0x23')](function(_0x24713a){var _0x2a6b3a=_['groupBy'](_0x24713a,_0x2b33('0xa4'));var _0x5d9298=[];_0x52e791[_0x2b33('0x66')](function(_0x36be69){_0x5d9298['push'](updateSmsInteraction(_0x36be69,_0x22f321,_0x2a6b3a));});return BPromise[_0x2b33('0xa5')](_0x5d9298);});});})[_0x2b33('0x23')](function(_0x58de85){_0xe415f4['rows']=_0x58de85;return _0xe415f4;})[_0x2b33('0x23')](respondWithFilteredResult(_0x2b9af8,_0x782a64));})['catch'](handleError(_0x2b9af8,null));};exports[_0x2b33('0xa6')]=function(_0x32134f,_0x5861ed){var _0x4cdd20={'raw':![],'where':{'id':_0x32134f[_0x2b33('0xa7')]['id']}},_0x5a219b={};_0x5a219b[_0x2b33('0x34')]=_[_0x2b33('0x6f')](db['SmsInteraction']['rawAttributes']);_0x5a219b[_0x2b33('0x35')]=_[_0x2b33('0x6f')](_0x32134f[_0x2b33('0x35')]);_0x5a219b[_0x2b33('0x40')]=_[_0x2b33('0x36')](_0x5a219b[_0x2b33('0x34')],_0x5a219b['query']);_0x4cdd20[_0x2b33('0x37')]=_[_0x2b33('0x36')](_0x5a219b[_0x2b33('0x34')],qs[_0x2b33('0x38')](_0x32134f[_0x2b33('0x35')]['fields']));_0x4cdd20[_0x2b33('0x37')]=_0x4cdd20[_0x2b33('0x37')]['length']?_0x4cdd20[_0x2b33('0x37')]:_0x5a219b[_0x2b33('0x34')];if(_0x32134f[_0x2b33('0x35')]['includeAll']){_0x4cdd20[_0x2b33('0xa8')]=[{'all':!![]}];}_0x4cdd20=_['merge']({},_0x4cdd20,_0x32134f[_0x2b33('0xa9')]);return db['SmsInteraction'][_0x2b33('0x6b')](_0x4cdd20)['then'](handleEntityNotFound(_0x5861ed,null))['then'](respondWithResult(_0x5861ed,null))[_0x2b33('0x2f')](handleError(_0x5861ed,null));};exports[_0x2b33('0xaa')]=function(_0x11a138,_0x973be7){return db['SmsInteraction'][_0x2b33('0xaa')](_0x11a138['body'],{})['then'](respondWithResult(_0x973be7,0xc9))[_0x2b33('0x2f')](handleError(_0x973be7,null));};exports[_0x2b33('0x22')]=function(_0x515981,_0x5b698f){if(_0x515981[_0x2b33('0x6e')]['id']){delete _0x515981[_0x2b33('0x6e')]['id'];}return db[_0x2b33('0x31')]['find']({'where':{'id':_0x515981[_0x2b33('0xa7')]['id']}})[_0x2b33('0x23')](handleEntityNotFound(_0x5b698f,null))['then'](saveUpdates(_0x515981['body'],null))['then'](respondWithResult(_0x5b698f,null))['catch'](handleError(_0x5b698f,null));};exports[_0x2b33('0x24')]=function(_0x187df0,_0x783d34){return db[_0x2b33('0x31')][_0x2b33('0x6b')]({'where':{'id':_0x187df0[_0x2b33('0xa7')]['id']}})[_0x2b33('0x23')](handleEntityNotFound(_0x783d34,null))[_0x2b33('0x23')](removeEntity(_0x783d34,null))[_0x2b33('0x2f')](handleError(_0x783d34,null));};exports[_0x2b33('0xab')]=function(_0x3a0f22,_0x4b5fcc){return db[_0x2b33('0x31')]['describe']()[_0x2b33('0x23')](respondWithResult(_0x4b5fcc,null))['catch'](handleError(_0x4b5fcc,null));};exports['addMessage']=function(_0x317023,_0x2c4444,_0x16e384){return db[_0x2b33('0xac')]['find']({'where':{'id':_0x317023[_0x2b33('0xa7')]['id']}})[_0x2b33('0x23')](handleEntityNotFound(_0x2c4444,null))[_0x2b33('0x23')](function(_0x815cdb){if(_0x815cdb){return _0x815cdb[_0x2b33('0xad')](_0x317023[_0x2b33('0x6e')]['ids'],_[_0x2b33('0xae')](_0x317023[_0x2b33('0x6e')],[_0x2b33('0xaf'),'id'])||{});}})['then'](respondWithResult(_0x2c4444,null))['catch'](handleError(_0x2c4444,null));};exports[_0x2b33('0xb0')]=function(_0x140850,_0x55a183,_0x441187){var _0x546843={'raw':![],'where':{}};var _0x533b95={};var _0x4875b4={'count':0x0,'rows':[]};return db[_0x2b33('0x31')][_0x2b33('0xb1')]({'where':{'id':_0x140850[_0x2b33('0xa7')]['id']}})['then'](handleEntityNotFound(_0x55a183,null))['then'](function(_0x32425a){if(_0x32425a){_0x533b95[_0x2b33('0x34')]=_[_0x2b33('0x6f')](db['SmsMessage'][_0x2b33('0xb2')]);_0x533b95[_0x2b33('0x35')]=_[_0x2b33('0x6f')](_0x140850[_0x2b33('0x35')]);_0x533b95['filters']=_[_0x2b33('0x36')](_0x533b95[_0x2b33('0x34')],_0x533b95[_0x2b33('0x35')]);_0x546843[_0x2b33('0x37')]=_['intersection'](_0x533b95[_0x2b33('0x34')],qs[_0x2b33('0x38')](_0x140850[_0x2b33('0x35')][_0x2b33('0x38')]));_0x546843[_0x2b33('0x37')]=_0x546843[_0x2b33('0x37')][_0x2b33('0x39')]?_0x546843[_0x2b33('0x37')]:_0x533b95[_0x2b33('0x34')];if(!_0x140850[_0x2b33('0x35')][_0x2b33('0xb3')](_0x2b33('0x3a'))){_0x546843['limit']=qs['limit'](_0x140850[_0x2b33('0x35')][_0x2b33('0x3b')]);_0x546843[_0x2b33('0x1e')]=qs[_0x2b33('0x1e')](_0x140850['query'][_0x2b33('0x1e')]);}_0x546843['order']=qs[_0x2b33('0x3d')](_0x140850['query'][_0x2b33('0x3d')]);_0x546843['where']=qs[_0x2b33('0x40')](_[_0x2b33('0x3f')](_0x140850[_0x2b33('0x35')],_0x533b95[_0x2b33('0x40')]));_0x546843[_0x2b33('0x3e')][_0x2b33('0xa4')]=_0x32425a['id'];if(_0x140850[_0x2b33('0x35')]['filter']){_0x546843[_0x2b33('0x3e')]=_[_0x2b33('0xb4')](_0x546843['where'],{'$or':_[_0x2b33('0x2a')](_0x546843[_0x2b33('0x37')],function(_0x467109){var _0x4f62b8={};_0x4f62b8[_0x467109]={'$like':'%'+_0x140850['query'][_0x2b33('0x80')]+'%'};return _0x4f62b8;})});}if(_0x140850[_0x2b33('0x35')]['$gte']){var _0x26fff2=_0x140850[_0x2b33('0x35')][_0x2b33('0xb5')]['split'](',');var _0x488fbd={};_0x488fbd[_0x26fff2[0x0]]={'$gte':moment(_0x26fff2[0x1])[_0x2b33('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')};_0x546843['where']=_['merge'](_0x546843[_0x2b33('0x3e')],_0x488fbd);}_0x546843=_['merge']({},_0x546843,_0x140850[_0x2b33('0xa9')]);return db[_0x2b33('0xac')]['count']({'where':_0x546843['where']})['then'](function(_0x27fef8){_0x4875b4['count']=_0x27fef8;if(_0x140850['query'][_0x2b33('0xb7')]){_0x546843[_0x2b33('0xa8')]=[{'all':!![]}];}return db['SmsMessage'][_0x2b33('0xb8')](_0x546843);})[_0x2b33('0x23')](function(_0x8a3a68){_0x4875b4[_0x2b33('0xb9')]=_0x8a3a68;return _0x4875b4;});}})[_0x2b33('0x23')](respondWithFilteredResult(_0x55a183,_0x546843))[_0x2b33('0x2f')](handleError(_0x55a183,null));};exports[_0x2b33('0xba')]=function(_0xbc9b9e,_0x718809,_0x4aeea9){return db['SmsInteraction']['find']({'where':{'id':_0xbc9b9e[_0x2b33('0xa7')]['id']}})[_0x2b33('0x23')](handleEntityNotFound(_0x718809,null))[_0x2b33('0x23')](function(_0x30e7ed){if(_0x30e7ed){return _0x30e7ed[_0x2b33('0xbb')](_0xbc9b9e[_0x2b33('0x6e')][_0x2b33('0xaf')],_[_0x2b33('0xae')](_0xbc9b9e[_0x2b33('0x6e')],[_0x2b33('0xaf'),'id'])||{})[_0x2b33('0xbc')](function(){return db[_0x2b33('0xbd')][_0x2b33('0xb8')]({'attributes':['id',_0x2b33('0x27'),'color'],'where':{'id':_0xbc9b9e['body'][_0x2b33('0xaf')]}});})['then'](function(_0xb6bc72){socket[_0x2b33('0xbe')](_0x2b33('0xbf'),{'id':Number(_0xbc9b9e['params']['id']),'tags':_0xb6bc72||[]});return{'id':Number(_0xbc9b9e[_0x2b33('0xa7')]['id']),'tags':_0xb6bc72||[]};});}})[_0x2b33('0x23')](respondWithResult(_0x718809,null))[_0x2b33('0x2f')](handleError(_0x718809,null));};exports['removeTags']=function(_0xfffe46,_0x3f3258,_0xf01791){return db[_0x2b33('0x31')][_0x2b33('0x6b')]({'where':{'id':_0xfffe46[_0x2b33('0xa7')]['id']}})[_0x2b33('0x23')](handleEntityNotFound(_0x3f3258,null))[_0x2b33('0x23')](function(_0x5c802e){if(_0x5c802e){return _0x5c802e['removeTags'](_0xfffe46['query'][_0x2b33('0xaf')]);}})['then'](respondWithStatusCode(_0x3f3258,null))[_0x2b33('0x2f')](handleError(_0x3f3258,null));};exports[_0x2b33('0xc0')]=function(_0x27f6c3,_0x5d7cea){var _0xd94770=moment()['unix']()[_0x2b33('0xa2')]();var _0x3d95b5=path['join'](config[_0x2b33('0xc1')],_0x2b33('0xc2'),'files',_0x2b33('0xc3'));var _0x23096f=path[_0x2b33('0xc4')](config[_0x2b33('0xc1')],_0x2b33('0xc2'),_0x2b33('0xc5'),_0x2b33('0xc6'));var _0x5107dd=path[_0x2b33('0xc4')](_0x3d95b5,_0xd94770);var _0x152ccf=util[_0x2b33('0xb6')]('transcript-%d-%s.zip',_0x27f6c3[_0x2b33('0xa7')]['id'],_0xd94770);var _0x33dc6d=path[_0x2b33('0xc4')](_0x3d95b5,_0x152ccf);var _0xef6831=[];_0xef6831['push']({'model':db[_0x2b33('0x69')],'as':_0x2b33('0x69'),'attributes':['id',_0x2b33('0x2b')],'raw':!![]});_0xef6831[_0x2b33('0x2e')]({'model':db[_0x2b33('0xc7')],'as':_0x2b33('0x5d'),'attributes':['id','firstName',_0x2b33('0xc8')],'raw':!![]});var _0x1ee542=[{'model':db[_0x2b33('0xac')],'as':_0x2b33('0xc9'),'attributes':['id',_0x2b33('0x6e'),_0x2b33('0x76'),_0x2b33('0xca'),'secret',_0x2b33('0xcb')],'include':_0xef6831}];_0x1ee542[_0x2b33('0x2e')]({'model':db[_0x2b33('0xcc')],'as':_0x2b33('0xcd'),'attributes':['id',_0x2b33('0x27')]});_0x1ee542[_0x2b33('0x2e')]({'model':db[_0x2b33('0x69')],'as':_0x2b33('0xce'),'attributes':['id',_0x2b33('0x2b')]});return db['SmsInteraction']['find']({'where':{'id':_0x27f6c3[_0x2b33('0xa7')]['id']},'include':_0x1ee542})[_0x2b33('0x23')](handleEntityNotFound(_0x5d7cea,null))['then'](function(_0x346919){if(_0x346919){var _0x578483=_0x346919[_0x2b33('0xcf')]({'plain':!![]});fs[_0x2b33('0xd0')](_0x5107dd);var _0xbfd0dd={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':_0x2b33('0xd1')}},'footer':{'height':_0x2b33('0xd2'),'contents':{'default':util[_0x2b33('0xb6')]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util['format']('%s\x20#%d',_0x2b33('0xd3'),_0x578483['id']),moment()['format'](_0x2b33('0xd4'))[_0x2b33('0xa2')]())}}};var _0x2e3cf9={'channel':_0x2b33('0xd3'),'account':_0x578483['Account'][_0x2b33('0x27')],'agent':_0x578483[_0x2b33('0xce')]?_0x578483['Owner'][_0x2b33('0x2b')]:_0x2b33('0xd5'),'createdAt':moment(_0x578483[_0x2b33('0x76')])[_0x2b33('0xb6')](_0x2b33('0xd6'))[_0x2b33('0xa2')](),'closedAt':_0x578483[_0x2b33('0xd7')]?moment(_0x578483[_0x2b33('0xd8')])[_0x2b33('0xb6')](_0x2b33('0xd6'))[_0x2b33('0xa2')]():'','disposition':_0x578483['disposition'],'messages':_(_0x578483['Messages'])[_0x2b33('0x80')]({'secret':![]})[_0x2b33('0x2a')](function(_0x57ca1c){return{'date':moment(_0x57ca1c[_0x2b33('0x76')])[_0x2b33('0xb6')](_0x2b33('0xd6'))[_0x2b33('0xa2')](),'sender':_0x57ca1c[_0x2b33('0xca')]===_0x2b33('0xd9')?_0x57ca1c[_0x2b33('0x69')]?_0x57ca1c[_0x2b33('0x69')][_0x2b33('0x2b')]:_0x2b33('0xda'):_0x57ca1c[_0x2b33('0x5d')][_0x2b33('0xdb')]+(_0x57ca1c[_0x2b33('0x5d')]['lastName']?'\x20'+_0x57ca1c[_0x2b33('0x5d')][_0x2b33('0xc8')]:''),'body':_0x57ca1c[_0x2b33('0x6e')],'direction':_0x57ca1c[_0x2b33('0xca')]===_0x2b33('0xd9')?'A':'C','secret':_0x57ca1c[_0x2b33('0xdc')],'read':_0x57ca1c[_0x2b33('0xcb')]};})[_0x2b33('0x59')]()};return ejs[_0x2b33('0xdd')](path[_0x2b33('0xc4')](config['root'],_0x2b33('0xc2'),_0x2b33('0xde'),_0x2b33('0xdf')),{'interaction':_0x2e3cf9})['then'](function(_0xc7a19b){return new BPromise(function(_0x546f2e,_0x342b7d){pdf['create'](_0xc7a19b,_0xbfd0dd)['toFile'](path[_0x2b33('0xc4')](_0x5107dd,_0x2b33('0xe0')+_0x578483['id']+'-'+_0xd94770+_0x2b33('0xe1')),function(_0x3ed8b3,_0x34c7b3){if(_0x3ed8b3)return _0x342b7d(_0x3ed8b3);_0x546f2e(_0x34c7b3);});});})[_0x2b33('0x23')](function(){return new BPromise(function(_0x3bb912,_0x67c2d9){zipdir(_0x5107dd,{'saveTo':_0x33dc6d},function(_0x29af23,_0x5b8fc7){if(_0x29af23)return _0x67c2d9(_0x29af23);return _0x3bb912(_0x5b8fc7);});})[_0x2b33('0x23')](function(){return new BPromise(function(_0x5b07dd,_0xb6b68c){rimraf(_0x5107dd,function(_0x2983b3){if(_0x2983b3)_0xb6b68c(_0x2983b3);return _0x5b07dd();});});})['then'](function(){return _0x5d7cea[_0x2b33('0xc0')](_0x33dc6d,_0x152ccf,function(_0x6d43ad){if(_0x6d43ad){console[_0x2b33('0xe2')](_0x2b33('0xe3'),_0x6d43ad);}else{fs['unlinkSync'](_0x33dc6d);}});});});}else{return _0x5d7cea[_0x2b33('0x1a')](0xc8);}})[_0x2b33('0x2f')](handleError(_0x5d7cea,null));}; \ No newline at end of file +var _0x57f8=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','find','UserId','body','some','isEmpty','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SmsInteraction','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','show','rawAttributes','includeAll','create','params','describe','SmsMessage','addMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','rows','setTags','spread','color','emit','smsInteractionTags:save','removeTags','unix','join','root','server','tmp','files','firstName','lastName','Messages','direction','SmsAccount','Owner','get','mkdirSync','10px','\x0a\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\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','N.A.','createdAt','closed','closedAt','disposition','out','System','renderFile','views','downloadInteraction.html','toFile','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','error','name','send','Users','map','fullname','TagIds','Tags','forEach','push','catch'];(function(_0x336e22,_0x3c666f){var _0x28d8ff=function(_0x154a66){while(--_0x154a66){_0x336e22['push'](_0x336e22['shift']());}};_0x28d8ff(++_0x3c666f);}(_0x57f8,0x198));var _0x857f=function(_0x40632e,_0x1f7f8f){_0x40632e=_0x40632e-0x0;var _0x3708c4=_0x57f8[_0x40632e];return _0x3708c4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x857f('0x0'));var rimraf=require(_0x857f('0x1'));var zipdir=require(_0x857f('0x2'));var jsonpatch=require(_0x857f('0x3'));var rp=require(_0x857f('0x4'));var moment=require(_0x857f('0x5'));var BPromise=require(_0x857f('0x6'));var Mustache=require(_0x857f('0x7'));var util=require(_0x857f('0x8'));var path=require(_0x857f('0x9'));var sox=require(_0x857f('0xa'));var csv=require(_0x857f('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x857f('0xc'));var squel=require(_0x857f('0xd'));var crypto=require(_0x857f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0xb'));var querystring=require(_0x857f('0x10'));var Papa=require('papaparse');var Redis=require(_0x857f('0x11'));var authService=require(_0x857f('0x12'));var qs=require(_0x857f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x857f('0x14'));var logger=require(_0x857f('0x15'))(_0x857f('0x16'));var utils=require(_0x857f('0x17'));var config=require(_0x857f('0x18'));var db=require(_0x857f('0x19'))['db'];config[_0x857f('0x1a')]=_['defaults'](config[_0x857f('0x1a')],{'host':_0x857f('0x1b'),'port':0x18eb});var socket=require(_0x857f('0x1c'))(new Redis(config[_0x857f('0x1a')]));require(_0x857f('0x1d'))['register'](socket);function respondWithStatusCode(_0x4bc590,_0x3b09d9){_0x3b09d9=_0x3b09d9||0xcc;return function(_0x5f27b2){if(_0x5f27b2){return _0x4bc590[_0x857f('0x1e')](_0x3b09d9);}return _0x4bc590['status'](_0x3b09d9)[_0x857f('0x1f')]();};}function respondWithResult(_0x134a4f,_0x5c3a69){_0x5c3a69=_0x5c3a69||0xc8;return function(_0x27e8f1){if(_0x27e8f1){return _0x134a4f[_0x857f('0x20')](_0x5c3a69)[_0x857f('0x21')](_0x27e8f1);}};}function respondWithFilteredResult(_0x10b547,_0x279e74){return function(_0x38a3c2){if(_0x38a3c2){var _0x1a9ef8=_0x38a3c2[_0x857f('0x22')],_0x429e23=_0x279e74['offset'],_0x1014ca=_0x279e74[_0x857f('0x23')]+_0x279e74[_0x857f('0x24')],_0x38a242;if(_0x1014ca>=_0x1a9ef8){_0x1014ca=_0x1a9ef8;_0x38a242=0xc8;}else{_0x38a242=0xce;}_0x10b547['status'](_0x38a242);return _0x10b547[_0x857f('0x25')](_0x857f('0x26'),_0x429e23+'-'+_0x1014ca+'/'+_0x1a9ef8)[_0x857f('0x21')](_0x38a3c2);}return null;};}function patchUpdates(_0x484035){return function(_0x57fa8b){try{jsonpatch[_0x857f('0x27')](_0x57fa8b,_0x484035,!![]);}catch(_0x8f278){return BPromise[_0x857f('0x28')](_0x8f278);}return _0x57fa8b['save']();};}function saveUpdates(_0x118237,_0x17a98e){return function(_0xdf8ac3){if(_0xdf8ac3){return _0xdf8ac3['update'](_0x118237)[_0x857f('0x29')](function(_0x14a8ce){return _0x14a8ce;});}return null;};}function removeEntity(_0x50bfb7,_0x3bc543){return function(_0x1a651f){if(_0x1a651f){return _0x1a651f[_0x857f('0x2a')]()[_0x857f('0x29')](function(){_0x50bfb7[_0x857f('0x20')](0xcc)[_0x857f('0x1f')]();});}};}function handleEntityNotFound(_0x233a68,_0x2a89ba){return function(_0x181a9e){if(!_0x181a9e){_0x233a68[_0x857f('0x1e')](0x194);}return _0x181a9e;};}function handleError(_0x72f0aa,_0x4782ab){_0x4782ab=_0x4782ab||0x1f4;return function(_0x250731){logger[_0x857f('0x2b')](_0x250731['stack']);if(_0x250731[_0x857f('0x2c')]){delete _0x250731[_0x857f('0x2c')];}_0x72f0aa[_0x857f('0x20')](_0x4782ab)[_0x857f('0x2d')](_0x250731);};}function getInteractionUsers(_0x58c2de,_0x40c306){return new BPromise(function(_0x57ceaa,_0x1b405a){try{if(_0x40c306[_0x58c2de['id']]){_0x58c2de[_0x857f('0x2e')]=_[_0x857f('0x2f')](_0x40c306[_0x58c2de['id']],function(_0x2ab814){return{'id':_0x2ab814['id'],'fullname':_0x2ab814[_0x857f('0x30')]};});}}catch(_0x464e8f){_0x1b405a(_0x464e8f);}_0x57ceaa(_0x58c2de);});}function getInteractionTags(_0x1c4fff,_0xe79241){return new BPromise(function(_0x17e7b6,_0x41f832){try{if(_0x1c4fff[_0x857f('0x31')]){_0x1c4fff[_0x857f('0x32')]=[];_0x1c4fff[_0x857f('0x31')]['split'](',')[_0x857f('0x33')](function(_0x24d370){_0x1c4fff['Tags'][_0x857f('0x34')](_0xe79241[_0x24d370]);});}delete _0x1c4fff[_0x857f('0x31')];}catch(_0x537ba1){_0x41f832(_0x537ba1);}_0x17e7b6(_0x1c4fff);});}function updateSmsInteraction(_0x2262c6,_0x3ee1f7,_0x4c9157){return new BPromise(function(_0x109f76,_0x3c9c75){return getInteractionUsers(_0x2262c6,_0x4c9157)[_0x857f('0x29')](function(_0x2cc74e){return getInteractionTags(_0x2cc74e,_0x3ee1f7);})['then'](function(_0x596b2f){_0x109f76(_0x596b2f);})[_0x857f('0x35')](function(_0x385d7b){_0x3c9c75(_0x385d7b);});});}exports['index']=function(_0x26d2b5,_0x4d3a87){var _0x1ff000={},_0x365bc2={},_0x677deb={'count':0x0,'rows':[]};var _0x438ff1=_[_0x857f('0x2f')](db['SmsInteraction']['rawAttributes'],function(_0x10f99d){return{'name':_0x10f99d['fieldName'],'type':_0x10f99d[_0x857f('0x36')][_0x857f('0x37')]};});_0x365bc2[_0x857f('0x38')]=_['map'](_0x438ff1,_0x857f('0x2c'));_0x365bc2[_0x857f('0x39')]=_[_0x857f('0x3a')](_0x26d2b5[_0x857f('0x39')]);_0x365bc2[_0x857f('0x3b')]=_[_0x857f('0x3c')](_0x365bc2[_0x857f('0x38')],_0x365bc2['query']);_0x1ff000[_0x857f('0x3d')]=_[_0x857f('0x3c')](_0x365bc2[_0x857f('0x38')],qs[_0x857f('0x3e')](_0x26d2b5[_0x857f('0x39')][_0x857f('0x3e')]));_0x1ff000[_0x857f('0x3d')]=_0x1ff000['attributes'][_0x857f('0x3f')]?_0x1ff000[_0x857f('0x3d')]:_0x365bc2[_0x857f('0x38')];if(!_0x26d2b5[_0x857f('0x39')][_0x857f('0x40')](_0x857f('0x41'))){_0x1ff000['limit']=qs[_0x857f('0x24')](_0x26d2b5[_0x857f('0x39')][_0x857f('0x24')]);_0x1ff000[_0x857f('0x23')]=qs[_0x857f('0x23')](_0x26d2b5[_0x857f('0x39')][_0x857f('0x23')]);}_0x1ff000[_0x857f('0x42')]=qs['sort'](_0x26d2b5[_0x857f('0x39')][_0x857f('0x43')]);_0x1ff000[_0x857f('0x44')]=qs[_0x857f('0x3b')](_[_0x857f('0x45')](_0x26d2b5[_0x857f('0x39')],_0x365bc2[_0x857f('0x3b')]),_0x438ff1);var _0x42d922=[];var _0xb4d7c2=squel[_0x857f('0x46')]()[_0x857f('0x47')]('id')[_0x857f('0x47')](_0x857f('0x2c'))[_0x857f('0x47')]('color')[_0x857f('0x48')]('tools_tags');var _0x2ce1c0=squel[_0x857f('0x46')]()[_0x857f('0x47')](_0x857f('0x49'))[_0x857f('0x47')](_0x857f('0x4a'))[_0x857f('0x47')](_0x857f('0x4b'))[_0x857f('0x48')](_0x857f('0x4c'),'ui')[_0x857f('0x4d')]('users','u','u.id\x20=\x20ui.UserId');var _0x865fc2=squel['select']()[_0x857f('0x48')]('sms_interactions','i')[_0x857f('0x4d')](_0x857f('0x4e'),'c',_0x857f('0x4f'))[_0x857f('0x4d')](_0x857f('0x50'),'o',_0x857f('0x51'))[_0x857f('0x4d')](_0x857f('0x52'),'a','a.id\x20=\x20i.SmsAccountId')[_0x857f('0x4d')](_0x857f('0x53'),'me',_0x857f('0x54'))[_0x857f('0x4d')]('sms_interaction_has_tags','it',_0x857f('0x55'))[_0x857f('0x4d')](_0x857f('0x56'),'t',_0x857f('0x57'));var _0x67563=squel['expr']();var _0x3d28d9=[];var _0x3c1b39=squel['expr']();var _0xfd1679;if(_0x26d2b5[_0x857f('0x39')]['search']){_0xfd1679=as[_0x857f('0x58')](_0x26d2b5['query'][_0x857f('0x59')]);var _0x12b62c=_0xfd1679[_0x857f('0x5a')];for(var _0x2008d5=0x0;_0x2008d5<_0xfd1679[_0x857f('0x5b')][_0x857f('0x3f')];_0x2008d5++){var _0x256347=_0xfd1679[_0x857f('0x5b')][_0x2008d5];var _0x1ac191='i';var _0x6e39f4=_['find'](_0x438ff1,[_0x857f('0x2c'),_0x256347[_0x857f('0x47')]]);if(!_0x6e39f4){switch(_0x256347[_0x857f('0x47')]){case _0x857f('0x5c'):if(_0x256347[_0x857f('0x5d')]==0x1){_0x865fc2[_0x857f('0x5e')]('`'+_0x256347[_0x857f('0x47')]+'`\x20=\x200');}else{_0x865fc2[_0x857f('0x5e')]('`'+_0x256347[_0x857f('0x47')]+_0x857f('0x5f'));}break;case _0x857f('0x60'):if(_0x256347[_0x857f('0x61')]===_0x857f('0x62')){if(_0x256347['value'][_0x857f('0x63')]('\x20')[_0x857f('0x3f')]>0x1){_0x67563[_0x12b62c](_0x857f('0x64'),qs[_0x857f('0x65')](_0x256347[_0x857f('0x5d')]),null);}else{var _0x658eb0='%'+_0x256347[_0x857f('0x5d')]+'%';_0x67563[_0x12b62c](_0x857f('0x66'),_0x658eb0,_0x658eb0,_0x658eb0);}}else{_0x6e39f4=_['find'](_0x438ff1,['name',_0x857f('0x67')]);_0x256347[_0x857f('0x47')]=_0x857f('0x67');_0x36d746=as[_0x857f('0x68')](_0x1ac191,_0x6e39f4[_0x857f('0x36')],_0x256347);_0x67563[_0x12b62c](_0x36d746[_0x857f('0x69')],_0x36d746['value'][_0x857f('0x6a')],_0x36d746[_0x857f('0x5d')]['end']);}break;case _0x857f('0x6b'):var _0x5e3759=_0x256347[_0x857f('0x5d')][_0x857f('0x63')](',')['map'](function(_0x3f5a6e){return Number(_0x3f5a6e);});_0x5e3759[_0x857f('0x33')](function(_0x3520d3){_0x3c1b39['or'](_0x857f('0x6c'),'%,'+_0x3520d3+',%');});_0x3d28d9=_[_0x857f('0x6d')](_0x3d28d9,_0x5e3759);break;case _0x857f('0x6e'):if(_0x256347[_0x857f('0x61')]===_0x857f('0x62')){_0x67563[_0x12b62c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x256347[_0x857f('0x5d')]+'%',null);}else{_0x6e39f4=_[_0x857f('0x6f')](_0x438ff1,[_0x857f('0x2c'),_0x857f('0x70')]);_0x256347[_0x857f('0x47')]=_0x857f('0x70');_0x36d746=as[_0x857f('0x68')](_0x1ac191,_0x6e39f4[_0x857f('0x36')],_0x256347);_0x67563[_0x12b62c](_0x36d746[_0x857f('0x69')],_0x36d746[_0x857f('0x5d')][_0x857f('0x6a')],_0x36d746['value'][_0x857f('0x1f')]);}break;case _0x857f('0x71'):_0x36d746=as[_0x857f('0x68')]('me',null,_0x256347);_0x67563[_0x12b62c](_0x36d746[_0x857f('0x69')],_0x36d746['value'][_0x857f('0x6a')],_0x36d746['value'][_0x857f('0x1f')]);break;}}else{var _0x36d746=as[_0x857f('0x68')](_0x1ac191,_0x6e39f4[_0x857f('0x36')],_0x256347);_0x67563[_0x12b62c](_0x36d746['text'],_0x36d746['value'][_0x857f('0x6a')],_0x36d746[_0x857f('0x5d')][_0x857f('0x1f')]);}}}else{var _0x49e7df=_(_0x26d2b5[_0x857f('0x39')])['keys']()[_0x857f('0x2f')](function(_0x1d6c1c){return _[_0x857f('0x72')](_0x438ff1,['name',_0x1d6c1c])?_0x1d6c1c:undefined;})['compact']()[_0x857f('0x5d')]();if(!_[_0x857f('0x73')](_0x49e7df)){_0x49e7df[_0x857f('0x33')](function(_0x570e3a){if(_0x570e3a===_0x857f('0x74')){_0x865fc2[_0x857f('0x44')](_0x857f('0x75'),[][_0x857f('0x76')](_0x26d2b5['query'][_0x570e3a]));}else if(_0x570e3a==='createdAt'){var _0x38c86b=JSON[_0x857f('0x77')](_0x26d2b5[_0x857f('0x39')][_0x570e3a])[_0x857f('0x78')];var _0x43ca9b=JSON[_0x857f('0x77')](_0x26d2b5['query'][_0x570e3a])[_0x857f('0x79')];_0x865fc2[_0x857f('0x44')](_0x857f('0x7a'),_0x38c86b,_0x43ca9b);}else{if(_0x26d2b5[_0x857f('0x39')][_0x570e3a]===_0x857f('0x7b')){_0x865fc2[_0x857f('0x44')]('i.'+_0x570e3a+_0x857f('0x7c'));}else{_0x865fc2[_0x857f('0x44')]('i.'+_0x570e3a+_0x857f('0x7d'),_0x26d2b5[_0x857f('0x39')][_0x570e3a]);}}});}if(_0x26d2b5['query'][_0x857f('0x7e')]){if(_0x26d2b5['query']['read']==0x1){_0x865fc2[_0x857f('0x5e')]('`unreadMessages`\x20=\x200');}else{_0x865fc2['having'](_0x857f('0x7f'));}}if(_0x26d2b5['query'][_0x857f('0x80')]){_0x3d28d9=_['isArray'](_0x26d2b5[_0x857f('0x39')][_0x857f('0x80')])?_0x26d2b5[_0x857f('0x39')][_0x857f('0x80')]:new Array(_0x26d2b5['query'][_0x857f('0x80')]);_0x3d28d9[_0x857f('0x33')](function(_0x3100aa){_0x3c1b39['or'](_0x857f('0x6c'),'%,'+_0x3100aa+',%');});}if(_0x26d2b5[_0x857f('0x39')][_0x857f('0x81')]){var _0x195760=_0x26d2b5['query']['filter'][_0x857f('0x82')]('\x5c','\x5c\x5c')[_0x857f('0x82')]('\x27\x27',_0x857f('0x83'));if(qs[_0x857f('0x84')](_0x195760)){_0x67563['or'](_0x857f('0x85'),_0x195760+'%')['or'](_0x857f('0x86'),_0x195760+'%');}else{_0x67563['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x857f('0x65')](_0x195760))['or'](_0x857f('0x87'),_0x195760+'%');}}}_0x865fc2[_0x857f('0x44')](_0x67563);_0x865fc2['group']('i.id');var _0x27f85b={'type':db['Sequelize']['QueryTypes'][_0x857f('0x88')],'raw':!![]};var _0x112dc4=_0x865fc2['clone']();_0x112dc4[_0x857f('0x47')](_0x857f('0x89'));_0x112dc4['field'](_0x857f('0x8a'),_0x857f('0x5c'));if(_0x1ff000[_0x857f('0x42')]){_0x1ff000[_0x857f('0x42')][_0x857f('0x33')](function(_0x180898){_0x865fc2[_0x857f('0x42')]('i.'+_0x180898[0x0],_0x180898[0x1]===_0x857f('0x8b')?![]:!![]);});}if(!_[_0x857f('0x73')](_0x3d28d9)){_0x865fc2[_0x857f('0x5e')](_0x3c1b39);_0x112dc4[_0x857f('0x44')](_0x857f('0x8c'),_0x3d28d9);}BPromise['resolve']()['then'](function(){if(!_0xfd1679){if(_0x26d2b5['query'][_0x857f('0x74')]||_0x26d2b5[_0x857f('0x39')][_0x857f('0x8d')])return;_0x112dc4[_0x857f('0x44')](_0x857f('0x8e'));_0x865fc2[_0x857f('0x44')](_0x857f('0x8e'));return;}return _0x26d2b5['user'][_0x857f('0x8f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e5235){if(_['isEmpty'](_0x3e5235)){_0x112dc4['where'](_0x857f('0x90'));_0x865fc2['where'](_0x857f('0x90'));}else{_0x112dc4[_0x857f('0x44')](_0x857f('0x75'),_['map'](_0x3e5235,'id'));_0x865fc2[_0x857f('0x44')](_0x857f('0x75'),_[_0x857f('0x2f')](_0x3e5235,'id'));}});})[_0x857f('0x29')](function(){db[_0x857f('0x91')][_0x857f('0x39')](_0x112dc4[_0x857f('0x92')](),_0x27f85b)[_0x857f('0x29')](function(_0x3e7cc1){_0x677deb['count']=_0x3e7cc1[_0x857f('0x3f')];if(_0x677deb[_0x857f('0x22')]===0x0)return[];return db[_0x857f('0x91')][_0x857f('0x39')](_0xb4d7c2['toString'](),_0x27f85b)[_0x857f('0x29')](function(_0x59cdfb){_0x42d922=_[_0x857f('0x93')](_0x59cdfb,'id');_0x27f85b=_[_0x857f('0x94')](_0x27f85b,{'model':db[_0x857f('0x95')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x26d2b5[_0x857f('0x39')]['fields']){_0x1ff000[_0x857f('0x3d')]['forEach'](function(_0x56f7a4){_0x865fc2[_0x857f('0x47')]('i.'+_0x56f7a4);});}else{_0x865fc2[_0x857f('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x865fc2[_0x857f('0x47')](_0x857f('0x96'),_0x857f('0x97'));_0x865fc2[_0x857f('0x47')]('a.mandatoryDisposition',_0x857f('0x98'));_0x865fc2[_0x857f('0x47')](_0x857f('0x99'));_0x865fc2[_0x857f('0x47')](_0x857f('0x9a'),'Contact.firstName');_0x865fc2['field'](_0x857f('0x9b'),'Contact.lastName');_0x865fc2['field'](_0x857f('0x9c'),_0x857f('0x9d'));_0x865fc2[_0x857f('0x47')](_0x857f('0x9e'),_0x857f('0x9f'));_0x865fc2[_0x857f('0x47')](_0x857f('0xa0'),_0x857f('0xa1'));_0x865fc2[_0x857f('0x47')](_0x857f('0xa2'),_0x857f('0xa3'));_0x865fc2[_0x857f('0x47')](_0x857f('0xa4'),_0x857f('0xa5'));_0x865fc2[_0x857f('0x47')](_0x857f('0xa6'),_0x857f('0xa7'));_0x865fc2[_0x857f('0x47')](_0x857f('0xa8'),_0x857f('0x31'));}if(_0x1ff000[_0x857f('0x24')])_0x865fc2[_0x857f('0x24')](_0x1ff000['limit']);if(_0x1ff000['offset'])_0x865fc2['offset'](_0x1ff000[_0x857f('0x23')]);return db[_0x857f('0x91')]['query'](_0x865fc2[_0x857f('0x92')](),_0x27f85b);})[_0x857f('0x29')](function(_0x5226f1){_0x2ce1c0[_0x857f('0x44')]('ui.SmsInteractionId\x20IN\x20?',_[_0x857f('0x2f')](_0x5226f1,'id'));return db['sequelize'][_0x857f('0x39')](_0x2ce1c0[_0x857f('0x92')](),_0x27f85b)[_0x857f('0x29')](function(_0x202741){var _0x31a3a1=_[_0x857f('0xa9')](_0x202741,_0x857f('0xaa'));var _0x18a010=[];_0x5226f1[_0x857f('0x33')](function(_0x5594ac){_0x18a010[_0x857f('0x34')](updateSmsInteraction(_0x5594ac,_0x42d922,_0x31a3a1));});return BPromise['all'](_0x18a010);});});})[_0x857f('0x29')](function(_0x3a2cfe){_0x677deb['rows']=_0x3a2cfe;return _0x677deb;})['then'](respondWithFilteredResult(_0x4d3a87,_0x1ff000));})['catch'](handleError(_0x4d3a87,null));};exports[_0x857f('0xab')]=function(_0x3347ec,_0x6ae65){var _0x4afcfe={'raw':![],'where':{'id':_0x3347ec['params']['id']}},_0x340636={};_0x340636[_0x857f('0x38')]=_[_0x857f('0x3a')](db[_0x857f('0x95')][_0x857f('0xac')]);_0x340636['query']=_[_0x857f('0x3a')](_0x3347ec[_0x857f('0x39')]);_0x340636['filters']=_[_0x857f('0x3c')](_0x340636['model'],_0x340636[_0x857f('0x39')]);_0x4afcfe[_0x857f('0x3d')]=_[_0x857f('0x3c')](_0x340636[_0x857f('0x38')],qs[_0x857f('0x3e')](_0x3347ec[_0x857f('0x39')][_0x857f('0x3e')]));_0x4afcfe[_0x857f('0x3d')]=_0x4afcfe[_0x857f('0x3d')]['length']?_0x4afcfe[_0x857f('0x3d')]:_0x340636[_0x857f('0x38')];if(_0x3347ec['query'][_0x857f('0xad')]){_0x4afcfe['include']=[{'all':!![]}];}_0x4afcfe=_[_0x857f('0x94')]({},_0x4afcfe,_0x3347ec['options']);return db[_0x857f('0x95')]['find'](_0x4afcfe)[_0x857f('0x29')](handleEntityNotFound(_0x6ae65,null))[_0x857f('0x29')](respondWithResult(_0x6ae65,null))[_0x857f('0x35')](handleError(_0x6ae65,null));};exports[_0x857f('0xae')]=function(_0x3e5064,_0x269033){return db['SmsInteraction'][_0x857f('0xae')](_0x3e5064['body'],{})[_0x857f('0x29')](respondWithResult(_0x269033,0xc9))[_0x857f('0x35')](handleError(_0x269033,null));};exports['update']=function(_0xf05de5,_0x132316){if(_0xf05de5[_0x857f('0x71')]['id']){delete _0xf05de5['body']['id'];}return db[_0x857f('0x95')]['find']({'where':{'id':_0xf05de5[_0x857f('0xaf')]['id']}})[_0x857f('0x29')](handleEntityNotFound(_0x132316,null))['then'](saveUpdates(_0xf05de5[_0x857f('0x71')],null))['then'](respondWithResult(_0x132316,null))[_0x857f('0x35')](handleError(_0x132316,null));};exports[_0x857f('0x2a')]=function(_0x5deae3,_0x1d8711){return db[_0x857f('0x95')][_0x857f('0x6f')]({'where':{'id':_0x5deae3['params']['id']}})[_0x857f('0x29')](handleEntityNotFound(_0x1d8711,null))[_0x857f('0x29')](removeEntity(_0x1d8711,null))[_0x857f('0x35')](handleError(_0x1d8711,null));};exports[_0x857f('0xb0')]=function(_0x52d9b0,_0x108383){return db[_0x857f('0x95')][_0x857f('0xb0')]()[_0x857f('0x29')](respondWithResult(_0x108383,null))[_0x857f('0x35')](handleError(_0x108383,null));};exports['addMessage']=function(_0x5394a9,_0x237d82,_0x3e888e){return db[_0x857f('0xb1')][_0x857f('0x6f')]({'where':{'id':_0x5394a9[_0x857f('0xaf')]['id']}})['then'](handleEntityNotFound(_0x237d82,null))['then'](function(_0x3fed74){if(_0x3fed74){return _0x3fed74[_0x857f('0xb2')](_0x5394a9[_0x857f('0x71')][_0x857f('0xb3')],_[_0x857f('0xb4')](_0x5394a9[_0x857f('0x71')],[_0x857f('0xb3'),'id'])||{});}})['then'](respondWithResult(_0x237d82,null))[_0x857f('0x35')](handleError(_0x237d82,null));};exports[_0x857f('0xb5')]=function(_0x540d89,_0xf69474,_0x1d04e7){var _0x548a34={'raw':![],'where':{}};var _0x12fa30={};var _0x49494e={'count':0x0,'rows':[]};return db[_0x857f('0x95')][_0x857f('0xb6')]({'where':{'id':_0x540d89[_0x857f('0xaf')]['id']}})[_0x857f('0x29')](handleEntityNotFound(_0xf69474,null))[_0x857f('0x29')](function(_0x5b5733){if(_0x5b5733){_0x12fa30[_0x857f('0x38')]=_[_0x857f('0x3a')](db[_0x857f('0xb1')]['rawAttributes']);_0x12fa30['query']=_[_0x857f('0x3a')](_0x540d89[_0x857f('0x39')]);_0x12fa30[_0x857f('0x3b')]=_[_0x857f('0x3c')](_0x12fa30[_0x857f('0x38')],_0x12fa30[_0x857f('0x39')]);_0x548a34['attributes']=_['intersection'](_0x12fa30['model'],qs['fields'](_0x540d89[_0x857f('0x39')][_0x857f('0x3e')]));_0x548a34[_0x857f('0x3d')]=_0x548a34[_0x857f('0x3d')][_0x857f('0x3f')]?_0x548a34[_0x857f('0x3d')]:_0x12fa30[_0x857f('0x38')];if(!_0x540d89['query'][_0x857f('0x40')](_0x857f('0x41'))){_0x548a34[_0x857f('0x24')]=qs[_0x857f('0x24')](_0x540d89['query'][_0x857f('0x24')]);_0x548a34[_0x857f('0x23')]=qs[_0x857f('0x23')](_0x540d89[_0x857f('0x39')][_0x857f('0x23')]);}_0x548a34[_0x857f('0x42')]=qs[_0x857f('0x43')](_0x540d89[_0x857f('0x39')]['sort']);_0x548a34[_0x857f('0x44')]=qs[_0x857f('0x3b')](_[_0x857f('0x45')](_0x540d89['query'],_0x12fa30[_0x857f('0x3b')]));_0x548a34[_0x857f('0x44')][_0x857f('0xaa')]=_0x5b5733['id'];if(_0x540d89[_0x857f('0x39')][_0x857f('0x81')]){_0x548a34[_0x857f('0x44')]=_[_0x857f('0x94')](_0x548a34[_0x857f('0x44')],{'$or':_['map'](_0x548a34[_0x857f('0x3d')],function(_0x3a8df3){var _0x4c9070={};_0x4c9070[_0x3a8df3]={'$like':'%'+_0x540d89['query']['filter']+'%'};return _0x4c9070;})});}if(_0x540d89[_0x857f('0x39')][_0x857f('0x78')]){var _0x1731ce=_0x540d89['query'][_0x857f('0x78')]['split'](',');var _0xe4e5ef={};_0xe4e5ef[_0x1731ce[0x0]]={'$gte':moment(_0x1731ce[0x1])[_0x857f('0xb7')](_0x857f('0xb8'))};_0x548a34[_0x857f('0x44')]=_[_0x857f('0x94')](_0x548a34[_0x857f('0x44')],_0xe4e5ef);}_0x548a34=_['merge']({},_0x548a34,_0x540d89[_0x857f('0xb9')]);return db[_0x857f('0xb1')][_0x857f('0x22')]({'where':_0x548a34[_0x857f('0x44')]})[_0x857f('0x29')](function(_0x4f01ee){_0x49494e[_0x857f('0x22')]=_0x4f01ee;if(_0x540d89['query'][_0x857f('0xad')]){_0x548a34[_0x857f('0xba')]=[{'all':!![]}];}return db[_0x857f('0xb1')][_0x857f('0xbb')](_0x548a34);})[_0x857f('0x29')](function(_0x11a59b){_0x49494e[_0x857f('0xbc')]=_0x11a59b;return _0x49494e;});}})[_0x857f('0x29')](respondWithFilteredResult(_0xf69474,_0x548a34))[_0x857f('0x35')](handleError(_0xf69474,null));};exports['addTags']=function(_0x238041,_0x26f6a8,_0x315467){return db[_0x857f('0x95')][_0x857f('0x6f')]({'where':{'id':_0x238041['params']['id']}})[_0x857f('0x29')](handleEntityNotFound(_0x26f6a8,null))[_0x857f('0x29')](function(_0x1da520){if(_0x1da520){return _0x1da520[_0x857f('0xbd')](_0x238041['body'][_0x857f('0xb3')],_[_0x857f('0xb4')](_0x238041[_0x857f('0x71')],['ids','id'])||{})[_0x857f('0xbe')](function(){return db[_0x857f('0x6b')][_0x857f('0xbb')]({'attributes':['id',_0x857f('0x2c'),_0x857f('0xbf')],'where':{'id':_0x238041[_0x857f('0x71')][_0x857f('0xb3')]}});})['then'](function(_0x1e1f28){socket[_0x857f('0xc0')](_0x857f('0xc1'),{'id':Number(_0x238041[_0x857f('0xaf')]['id']),'tags':_0x1e1f28||[]});return{'id':Number(_0x238041['params']['id']),'tags':_0x1e1f28||[]};});}})['then'](respondWithResult(_0x26f6a8,null))[_0x857f('0x35')](handleError(_0x26f6a8,null));};exports[_0x857f('0xc2')]=function(_0x2409b5,_0x17d29f,_0x4f2745){return db[_0x857f('0x95')][_0x857f('0x6f')]({'where':{'id':_0x2409b5[_0x857f('0xaf')]['id']}})[_0x857f('0x29')](handleEntityNotFound(_0x17d29f,null))[_0x857f('0x29')](function(_0x56aca1){if(_0x56aca1){return _0x56aca1['removeTags'](_0x2409b5['query'][_0x857f('0xb3')]);}})['then'](respondWithStatusCode(_0x17d29f,null))[_0x857f('0x35')](handleError(_0x17d29f,null));};exports['download']=function(_0x4b8b41,_0x18bf9e){var _0x29461a=moment()[_0x857f('0xc3')]()[_0x857f('0x92')]();var _0x16a2ae=path[_0x857f('0xc4')](config[_0x857f('0xc5')],_0x857f('0xc6'),'files',_0x857f('0xc7'));var _0x39a738=path[_0x857f('0xc4')](config[_0x857f('0xc5')],'server',_0x857f('0xc8'),'attachments');var _0x38f34d=path[_0x857f('0xc4')](_0x16a2ae,_0x29461a);var _0x2547cd=util[_0x857f('0xb7')]('transcript-%d-%s.zip',_0x4b8b41[_0x857f('0xaf')]['id'],_0x29461a);var _0xf9ccef=path[_0x857f('0xc4')](_0x16a2ae,_0x2547cd);var _0x2b28ac=[];_0x2b28ac[_0x857f('0x34')]({'model':db['User'],'as':'User','attributes':['id',_0x857f('0x30')],'raw':!![]});_0x2b28ac[_0x857f('0x34')]({'model':db['CmContact'],'as':_0x857f('0x60'),'attributes':['id',_0x857f('0xc9'),_0x857f('0xca')],'raw':!![]});var _0x41deb9=[{'model':db[_0x857f('0xb1')],'as':_0x857f('0xcb'),'attributes':['id','body','createdAt',_0x857f('0xcc'),'secret','read'],'include':_0x2b28ac}];_0x41deb9['push']({'model':db[_0x857f('0xcd')],'as':'Account','attributes':['id',_0x857f('0x2c')]});_0x41deb9[_0x857f('0x34')]({'model':db[_0x857f('0x6e')],'as':_0x857f('0xce'),'attributes':['id',_0x857f('0x30')]});return db[_0x857f('0x95')][_0x857f('0x6f')]({'where':{'id':_0x4b8b41[_0x857f('0xaf')]['id']},'include':_0x41deb9})[_0x857f('0x29')](handleEntityNotFound(_0x18bf9e,null))['then'](function(_0x50d4d5){if(_0x50d4d5){var _0x820e55=_0x50d4d5[_0x857f('0xcf')]({'plain':!![]});fs[_0x857f('0xd0')](_0x38f34d);var _0x188bb9={'format':'A4','border':_0x857f('0xd1'),'header':{'height':'40px','contents':{'first':_0x857f('0xd2')}},'footer':{'height':_0x857f('0xd3'),'contents':{'default':util['format'](_0x857f('0xd4'),util['format'](_0x857f('0xd5'),_0x857f('0xd6'),_0x820e55['id']),moment()['format'](_0x857f('0xd7'))[_0x857f('0x92')]())}}};var _0x4e3bd5={'channel':_0x857f('0xd6'),'account':_0x820e55['Account'][_0x857f('0x2c')],'agent':_0x820e55['Owner']?_0x820e55['Owner']['fullname']:_0x857f('0xd8'),'createdAt':moment(_0x820e55[_0x857f('0xd9')])[_0x857f('0xb7')](_0x857f('0xb8'))[_0x857f('0x92')](),'closedAt':_0x820e55[_0x857f('0xda')]?moment(_0x820e55[_0x857f('0xdb')])['format'](_0x857f('0xb8'))[_0x857f('0x92')]():'','disposition':_0x820e55[_0x857f('0xdc')],'messages':_(_0x820e55[_0x857f('0xcb')])['filter']({'secret':![]})['map'](function(_0x361022){return{'date':moment(_0x361022[_0x857f('0xd9')])[_0x857f('0xb7')](_0x857f('0xb8'))[_0x857f('0x92')](),'sender':_0x361022[_0x857f('0xcc')]===_0x857f('0xdd')?_0x361022[_0x857f('0x6e')]?_0x361022[_0x857f('0x6e')][_0x857f('0x30')]:_0x857f('0xde'):_0x361022[_0x857f('0x60')][_0x857f('0xc9')]+(_0x361022[_0x857f('0x60')][_0x857f('0xca')]?'\x20'+_0x361022['Contact'][_0x857f('0xca')]:''),'body':_0x361022[_0x857f('0x71')],'direction':_0x361022[_0x857f('0xcc')]==='out'?'A':'C','secret':_0x361022['secret'],'read':_0x361022[_0x857f('0x7e')]};})[_0x857f('0x5d')]()};return ejs[_0x857f('0xdf')](path['join'](config[_0x857f('0xc5')],_0x857f('0xc6'),_0x857f('0xe0'),_0x857f('0xe1')),{'interaction':_0x4e3bd5})[_0x857f('0x29')](function(_0x567a17){return new BPromise(function(_0x55839b,_0x114639){pdf['create'](_0x567a17,_0x188bb9)[_0x857f('0xe2')](path[_0x857f('0xc4')](_0x38f34d,'transcript-'+_0x820e55['id']+'-'+_0x29461a+'.pdf'),function(_0x197564,_0x5a1cc8){if(_0x197564)return _0x114639(_0x197564);_0x55839b(_0x5a1cc8);});});})[_0x857f('0x29')](function(){return new BPromise(function(_0x3e0d8c,_0x287ad7){zipdir(_0x38f34d,{'saveTo':_0xf9ccef},function(_0x12800a,_0x1d711b){if(_0x12800a)return _0x287ad7(_0x12800a);return _0x3e0d8c(_0x1d711b);});})[_0x857f('0x29')](function(){return new BPromise(function(_0x452220,_0x56b1ea){rimraf(_0x38f34d,function(_0x55e621){if(_0x55e621)_0x56b1ea(_0x55e621);return _0x452220();});});})[_0x857f('0x29')](function(){return _0x18bf9e[_0x857f('0xe3')](_0xf9ccef,_0x2547cd,function(_0x53e9a6){if(_0x53e9a6){console[_0x857f('0xe4')](_0x857f('0xe5'),_0x53e9a6);}else{fs[_0x857f('0xe6')](_0xf9ccef);}});});});}else{return _0x18bf9e[_0x857f('0x1e')](0xc8);}})['catch'](handleError(_0x18bf9e,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 656eba0..743d0de 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 _0x3c17=['Users','findAll','then','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','SmsInteraction','SmsMessage','setMaxListeners','save','remove','getUsers','setDataValue'];(function(_0x322ee0,_0x2e2f29){var _0x4f519a=function(_0x64d2d2){while(--_0x64d2d2){_0x322ee0['push'](_0x322ee0['shift']());}};_0x4f519a(++_0x2e2f29);}(_0x3c17,0x1a1));var _0x73c1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3c17[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require(_0x73c1('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x73c1('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x73c1('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x73c1('0x3')](0x0);var events={'afterCreate':_0x73c1('0x4'),'afterUpdate':'update','afterDestroy':_0x73c1('0x5')};function emitEvent(_0xcbe17a){return function(_0x6b289e,_0x64f862,_0x48c943){_0x6b289e[_0x73c1('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4433e0){_0x6b289e[_0x73c1('0x7')](_0x73c1('0x8'),_0x4433e0['map'](function(_0x4921f0){return{'id':_0x4921f0['id']};}));return SmsMessage[_0x73c1('0x9')]({'where':{'SmsInteractionId':_0x6b289e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x73c1('0xa')](function(_0x400875){_0x6b289e[_0x73c1('0x7')](_0x73c1('0xb'),_0x400875[_0x73c1('0xc')]);SmsInteractionEvents[_0x73c1('0xd')](_0xcbe17a+':'+_0x6b289e['id'],_0x6b289e);SmsInteractionEvents['emit'](_0xcbe17a,_0x6b289e);_0x48c943(null);})['catch'](_0x48c943(null));};}for(var e in events){if(events[_0x73c1('0xe')](e)){var event=events[e];SmsInteraction[_0x73c1('0xf')](e,emitEvent(event));}}module[_0x73c1('0x10')]=SmsInteractionEvents; \ No newline at end of file +var _0x9221=['catch','hook','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','then','length','emit'];(function(_0x459ed2,_0x4bd42e){var _0x3d379a=function(_0x86133){while(--_0x86133){_0x459ed2['push'](_0x459ed2['shift']());}};_0x3d379a(++_0x4bd42e);}(_0x9221,0x64));var _0x1922=function(_0x56f6c0,_0x37c097){_0x56f6c0=_0x56f6c0-0x0;var _0x249342=_0x9221[_0x56f6c0];return _0x249342;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x1922('0x0'))['db'][_0x1922('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x1922('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1922('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1922('0x4'),'afterDestroy':_0x1922('0x5')};function emitEvent(_0x459eee){return function(_0xa19ed6,_0x263f7f,_0x1944a5){_0xa19ed6[_0x1922('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x116227){_0xa19ed6[_0x1922('0x7')](_0x1922('0x8'),_0x116227['map'](function(_0x4632ac){return{'id':_0x4632ac['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0xa19ed6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1922('0x9')](function(_0xc1ae7){_0xa19ed6[_0x1922('0x7')]('unreadMessages',_0xc1ae7[_0x1922('0xa')]);SmsInteractionEvents[_0x1922('0xb')](_0x459eee+':'+_0xa19ed6['id'],_0xa19ed6);SmsInteractionEvents['emit'](_0x459eee,_0xa19ed6);_0x1944a5(null);})[_0x1922('0xc')](_0x1944a5(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x1922('0xd')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index cde5048..62a50ea 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 _0x0825=['../../config/environment','./smsInteraction.attributes','exports','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','bluebird','path','rimraf'];(function(_0x49e741,_0x5f5836){var _0x6c78c3=function(_0x78274e){while(--_0x78274e){_0x49e741['push'](_0x49e741['shift']());}};_0x6c78c3(++_0x5f5836);}(_0x0825,0x1e4));var _0x5082=function(_0x1d4545,_0x461101){_0x1d4545=_0x1d4545-0x0;var _0x51e32b=_0x0825[_0x1d4545];return _0x51e32b;};'use strict';var _=require(_0x5082('0x0'));var util=require(_0x5082('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5082('0x2'));var BPromise=require(_0x5082('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5082('0x4'));var rimraf=require(_0x5082('0x5'));var config=require(_0x5082('0x6'));var attributes=require(_0x5082('0x7'));module[_0x5082('0x8')]=function(_0x297cda,_0x5a119b){return _0x297cda['define']('SmsInteraction',attributes,{'tableName':_0x5082('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe95fce,_0xa2f3c0,_0x1334df){if(_0xe95fce[_0x5082('0xa')]('closed')){_0xe95fce[_0x5082('0xb')]=moment()[_0x5082('0xc')](_0x5082('0xd'));}_0x1334df(null,_0xe95fce);}}});}; \ No newline at end of file +var _0xa726=['./smsInteraction.attributes','exports','define','sms_interactions','closedAt','format','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x12f3cc,_0x311d25){var _0x38ff8d=function(_0x3b145f){while(--_0x3b145f){_0x12f3cc['push'](_0x12f3cc['shift']());}};_0x38ff8d(++_0x311d25);}(_0xa726,0x148));var _0x6a72=function(_0x1fc122,_0x5e2c17){_0x1fc122=_0x1fc122-0x0;var _0xa2cb13=_0xa726[_0x1fc122];return _0xa2cb13;};'use strict';var _=require(_0x6a72('0x0'));var util=require(_0x6a72('0x1'));var logger=require('../../config/logger')(_0x6a72('0x2'));var moment=require('moment');var BPromise=require(_0x6a72('0x3'));var rp=require(_0x6a72('0x4'));var fs=require('fs');var path=require(_0x6a72('0x5'));var rimraf=require(_0x6a72('0x6'));var config=require(_0x6a72('0x7'));var attributes=require(_0x6a72('0x8'));module[_0x6a72('0x9')]=function(_0x5a8535,_0x570947){return _0x5a8535[_0x6a72('0xa')]('SmsInteraction',attributes,{'tableName':_0x6a72('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4cae88,_0x513b34,_0x3c4374){if(_0x4cae88['changed']('closed')){_0x4cae88[_0x6a72('0xc')]=moment()[_0x6a72('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3c4374(null,_0x4cae88);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index bfcaf5f..0da5552 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 _0x8073=['spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','debug','AddTagsToSmsInteraction','find','addTags','ids','omit'];(function(_0xbcd0e,_0x1c1990){var _0x2588ff=function(_0x4381bb){while(--_0x4381bb){_0xbcd0e['push'](_0xbcd0e['shift']());}};_0x2588ff(++_0x1c1990);}(_0x8073,0x16a));var _0x3807=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x8073[_0x565c49];return _0x20ca34;};'use strict';var _=require(_0x3807('0x0'));var util=require(_0x3807('0x1'));var moment=require(_0x3807('0x2'));var BPromise=require(_0x3807('0x3'));var rs=require(_0x3807('0x4'));var fs=require('fs');var Redis=require(_0x3807('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3807('0x6'))('rpc');var config=require(_0x3807('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3807('0x8')][_0x3807('0x9')]({'port':0x232a});config[_0x3807('0xa')]=_[_0x3807('0xb')](config[_0x3807('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3807('0xc'))(new Redis(config[_0x3807('0xa')]));require(_0x3807('0xd'))[_0x3807('0xe')](socket);function respondWithRpcPromise(_0x179e30,_0x183a20,_0x477fcc){return new BPromise(function(_0x1bba4a,_0x163027){return client['request'](_0x179e30,_0x477fcc)[_0x3807('0xf')](function(_0x4b4ddf){logger[_0x3807('0x10')](_0x3807('0x11'),_0x183a20,_0x3807('0x12'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x183a20,_0x3807('0x12'),JSON[_0x3807('0x13')](_0x4b4ddf));if(_0x4b4ddf[_0x3807('0x14')]){if(_0x4b4ddf[_0x3807('0x14')][_0x3807('0x15')]===0x1f4){logger['error'](_0x3807('0x11'),_0x183a20,_0x4b4ddf[_0x3807('0x14')][_0x3807('0x16')]);return _0x163027(_0x4b4ddf[_0x3807('0x14')]['message']);}logger[_0x3807('0x14')](_0x3807('0x11'),_0x183a20,_0x4b4ddf[_0x3807('0x14')][_0x3807('0x16')]);return _0x1bba4a(_0x4b4ddf[_0x3807('0x14')][_0x3807('0x16')]);}else{logger[_0x3807('0x10')](_0x3807('0x11'),_0x183a20,_0x3807('0x12'));_0x1bba4a(_0x4b4ddf['result'][_0x3807('0x16')]);}})[_0x3807('0x17')](function(_0x209326){logger[_0x3807('0x14')](_0x3807('0x11'),_0x183a20,_0x209326);_0x163027(_0x209326);});});}exports[_0x3807('0x18')]=function(_0x5a6b24){var _0x12bb4b=this;return new Promise(function(_0x5622e1,_0x3d489d){return db[_0x3807('0x19')][_0x3807('0x1a')](_0x5a6b24[_0x3807('0x1b')],{'raw':_0x5a6b24[_0x3807('0x1c')]?_0x5a6b24[_0x3807('0x1c')][_0x3807('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a6b24['options']?_0x5a6b24[_0x3807('0x1c')][_0x3807('0x1e')]||null:null,'attributes':_0x5a6b24['options']?_0x5a6b24['options']['attributes']||null:null,'limit':_0x5a6b24['options']?_0x5a6b24['options'][_0x3807('0x1f')]||null:null})[_0x3807('0xf')](function(_0x3d628a){logger['info']('UpdateSmsInteraction',_0x5a6b24);logger[_0x3807('0x20')](_0x3807('0x18'),_0x5a6b24,JSON['stringify'](_0x3d628a));_0x5622e1(_0x3d628a);})['catch'](function(_0x528a1a){logger['error']('UpdateSmsInteraction',_0x528a1a[_0x3807('0x16')],_0x5a6b24);_0x3d489d(_0x12bb4b[_0x3807('0x14')](0x1f4,_0x528a1a[_0x3807('0x16')]));});});};exports[_0x3807('0x21')]=function(_0x53e653){return new Promise(function(_0x313a4f,_0x1a6ab7){return db['SmsInteraction'][_0x3807('0x22')]({'where':_0x53e653['options']?_0x53e653['options'][_0x3807('0x1e')]||null:null})[_0x3807('0xf')](function(_0x55a3a2){if(_0x55a3a2){return _0x55a3a2[_0x3807('0x23')](_0x53e653[_0x3807('0x1b')][_0x3807('0x24')],_[_0x3807('0x25')](_0x53e653['body'],['ids','id'])||{});}})[_0x3807('0x26')](function(_0x3dcdd0){logger[_0x3807('0x10')](_0x3807('0x27'),_0x53e653);logger[_0x3807('0x20')](_0x3807('0x27'),_0x53e653,JSON[_0x3807('0x13')](_0x3dcdd0));_0x313a4f(_0x3dcdd0);})[_0x3807('0x17')](function(_0x3aea4b){logger[_0x3807('0x14')](_0x3807('0x27'),_0x3aea4b[_0x3807('0x16')],_0x53e653);_0x1a6ab7(_this[_0x3807('0x14')](0x1f4,_0x3aea4b[_0x3807('0x16')]));});});}; \ No newline at end of file +var _0x9ff1=['UpdateSmsInteraction','debug','AddTagsToSmsInteraction','SmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','update','body','options','raw','where','attributes','limit','then'];(function(_0x58c7b0,_0x4cb178){var _0x22a17d=function(_0xdb4bc){while(--_0xdb4bc){_0x58c7b0['push'](_0x58c7b0['shift']());}};_0x22a17d(++_0x4cb178);}(_0x9ff1,0x85));var _0x19ff=function(_0x4daab8,_0x1ff7d4){_0x4daab8=_0x4daab8-0x0;var _0x4833c4=_0x9ff1[_0x4daab8];return _0x4833c4;};'use strict';var _=require(_0x19ff('0x0'));var util=require('util');var moment=require(_0x19ff('0x1'));var BPromise=require(_0x19ff('0x2'));var rs=require(_0x19ff('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x19ff('0x4'))(_0x19ff('0x5'));var config=require(_0x19ff('0x6'));var jayson=require(_0x19ff('0x7'));var client=jayson[_0x19ff('0x8')][_0x19ff('0x9')]({'port':0x232a});config[_0x19ff('0xa')]=_[_0x19ff('0xb')](config[_0x19ff('0xa')],{'host':_0x19ff('0xc'),'port':0x18eb});var socket=require(_0x19ff('0xd'))(new Redis(config[_0x19ff('0xa')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x489353,_0x405a5b,_0x260132){return new BPromise(function(_0x5137dc,_0x2bba9e){return client[_0x19ff('0xe')](_0x489353,_0x260132)['then'](function(_0x293d4b){logger[_0x19ff('0xf')](_0x19ff('0x10'),_0x405a5b,_0x19ff('0x11'));logger['debug'](_0x19ff('0x12'),_0x405a5b,_0x19ff('0x11'),JSON[_0x19ff('0x13')](_0x293d4b));if(_0x293d4b['error']){if(_0x293d4b[_0x19ff('0x14')]['code']===0x1f4){logger[_0x19ff('0x14')]('SmsInteraction,\x20%s,\x20%s',_0x405a5b,_0x293d4b[_0x19ff('0x14')][_0x19ff('0x15')]);return _0x2bba9e(_0x293d4b[_0x19ff('0x14')][_0x19ff('0x15')]);}logger[_0x19ff('0x14')](_0x19ff('0x10'),_0x405a5b,_0x293d4b[_0x19ff('0x14')][_0x19ff('0x15')]);return _0x5137dc(_0x293d4b['error'][_0x19ff('0x15')]);}else{logger['info'](_0x19ff('0x10'),_0x405a5b,_0x19ff('0x11'));_0x5137dc(_0x293d4b['result'][_0x19ff('0x15')]);}})[_0x19ff('0x16')](function(_0x5b05e6){logger[_0x19ff('0x14')](_0x19ff('0x10'),_0x405a5b,_0x5b05e6);_0x2bba9e(_0x5b05e6);});});}exports['UpdateSmsInteraction']=function(_0xab0778){var _0x2a9ee8=this;return new Promise(function(_0x139685,_0x448e28){return db['SmsInteraction'][_0x19ff('0x17')](_0xab0778[_0x19ff('0x18')],{'raw':_0xab0778[_0x19ff('0x19')]?_0xab0778['options'][_0x19ff('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xab0778[_0x19ff('0x19')]?_0xab0778[_0x19ff('0x19')][_0x19ff('0x1b')]||null:null,'attributes':_0xab0778[_0x19ff('0x19')]?_0xab0778[_0x19ff('0x19')][_0x19ff('0x1c')]||null:null,'limit':_0xab0778[_0x19ff('0x19')]?_0xab0778[_0x19ff('0x19')][_0x19ff('0x1d')]||null:null})[_0x19ff('0x1e')](function(_0x1f421a){logger[_0x19ff('0xf')](_0x19ff('0x1f'),_0xab0778);logger[_0x19ff('0x20')]('UpdateSmsInteraction',_0xab0778,JSON[_0x19ff('0x13')](_0x1f421a));_0x139685(_0x1f421a);})[_0x19ff('0x16')](function(_0x5536ae){logger[_0x19ff('0x14')](_0x19ff('0x1f'),_0x5536ae[_0x19ff('0x15')],_0xab0778);_0x448e28(_0x2a9ee8['error'](0x1f4,_0x5536ae[_0x19ff('0x15')]));});});};exports[_0x19ff('0x21')]=function(_0x3acf7c){return new Promise(function(_0x553a69,_0x11df6a){return db[_0x19ff('0x22')][_0x19ff('0x23')]({'where':_0x3acf7c['options']?_0x3acf7c[_0x19ff('0x19')][_0x19ff('0x1b')]||null:null})[_0x19ff('0x1e')](function(_0x3d49b8){if(_0x3d49b8){return _0x3d49b8[_0x19ff('0x24')](_0x3acf7c['body'][_0x19ff('0x25')],_[_0x19ff('0x26')](_0x3acf7c[_0x19ff('0x18')],[_0x19ff('0x25'),'id'])||{});}})[_0x19ff('0x27')](function(_0x2ac042){logger[_0x19ff('0xf')](_0x19ff('0x28'),_0x3acf7c);logger[_0x19ff('0x20')](_0x19ff('0x28'),_0x3acf7c,JSON[_0x19ff('0x13')](_0x2ac042));_0x553a69(_0x2ac042);})['catch'](function(_0x5aa73e){logger[_0x19ff('0x14')](_0x19ff('0x28'),_0x5aa73e[_0x19ff('0x15')],_0x3acf7c);_0x11df6a(_this[_0x19ff('0x14')](0x1f4,_0x5aa73e[_0x19ff('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index ff1b9bb..e09bf68 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 _0xbaf0=['removeListener','register','length','smsInteraction:','save','remove','update'];(function(_0x58c7ef,_0x2d7b53){var _0x32d98b=function(_0x356399){while(--_0x356399){_0x58c7ef['push'](_0x58c7ef['shift']());}};_0x32d98b(++_0x2d7b53);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x0baf('0x0'),_0x0baf('0x1'),_0x0baf('0x2')];function createListener(_0x263f79,_0x1688bc){return function(_0x4d2e72){_0x1688bc['emit'](_0x263f79,_0x4d2e72);};}function removeListener(_0x232cc7,_0x1c383e){return function(){SmsInteractionEvents[_0x0baf('0x3')](_0x232cc7,_0x1c383e);};}exports[_0x0baf('0x4')]=function(_0xe4c3c4){for(var _0x335e24=0x0,_0x1a10b1=events[_0x0baf('0x5')];_0x335e24<_0x1a10b1;_0x335e24++){var _0x1d0a0d=events[_0x335e24];var _0x5f5030=createListener(_0x0baf('0x6')+_0x1d0a0d,_0xe4c3c4);SmsInteractionEvents['on'](_0x1d0a0d,_0x5f5030);}}; \ No newline at end of file +var _0x757a=['save','remove','emit','removeListener','register','smsInteraction:'];(function(_0xc76ebe,_0x4670de){var _0x53f3ce=function(_0xe3df28){while(--_0xe3df28){_0xc76ebe['push'](_0xc76ebe['shift']());}};_0x53f3ce(++_0x4670de);}(_0x757a,0xde));var _0xa757=function(_0x4f730a,_0x253723){_0x4f730a=_0x4f730a-0x0;var _0x1dba11=_0x757a[_0x4f730a];return _0x1dba11;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xa757('0x0'),_0xa757('0x1'),'update'];function createListener(_0x5c03c3,_0x5709ed){return function(_0x32be3b){_0x5709ed[_0xa757('0x2')](_0x5c03c3,_0x32be3b);};}function removeListener(_0x1c2932,_0x453d07){return function(){SmsInteractionEvents[_0xa757('0x3')](_0x1c2932,_0x453d07);};}exports[_0xa757('0x4')]=function(_0x5edca8){for(var _0xae0e7c=0x0,_0x4343b6=events['length'];_0xae0e7c<_0x4343b6;_0xae0e7c++){var _0x2930fa=events[_0xae0e7c];var _0x2f7793=createListener(_0xa757('0x5')+_0x2930fa,_0x5edca8);SmsInteractionEvents['on'](_0x2930fa,_0x2f7793);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index d08d63b..65a7480 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 _0x8ec3=['isAuthenticated','describe','get','/:id','show','post','tracked','/:id/status','status','put','update','/:id/accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe'];(function(_0x3876ef,_0x655a40){var _0xbd4412=function(_0x534dee){while(--_0x534dee){_0x3876ef['push'](_0x3876ef['shift']());}};_0xbd4412(++_0x655a40);}(_0x8ec3,0xe8));var _0x38ec=function(_0x2207d0,_0x1e1984){_0x2207d0=_0x2207d0-0x0;var _0x3c0cb5=_0x8ec3[_0x2207d0];return _0x3c0cb5;};'use strict';var multer=require(_0x38ec('0x0'));var util=require(_0x38ec('0x1'));var path=require(_0x38ec('0x2'));var timeout=require(_0x38ec('0x3'));var express=require(_0x38ec('0x4'));var router=express[_0x38ec('0x5')]();var auth=require(_0x38ec('0x6'));var interaction=require(_0x38ec('0x7'));var config=require(_0x38ec('0x8'));var controller=require('./smsMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x38ec('0x9')]);router['get'](_0x38ec('0xa'),auth[_0x38ec('0xb')](),controller[_0x38ec('0xc')]);router[_0x38ec('0xd')](_0x38ec('0xe'),auth[_0x38ec('0xb')](),controller[_0x38ec('0xf')]);router[_0x38ec('0x10')]('/',auth['isAuthenticated'](),interaction[_0x38ec('0x11')]('sms','smsmessage:create'),controller['create']);router[_0x38ec('0x10')](_0x38ec('0x12'),controller[_0x38ec('0x13')]);router[_0x38ec('0x14')](_0x38ec('0xe'),auth[_0x38ec('0xb')](),controller[_0x38ec('0x15')]);router[_0x38ec('0x14')](_0x38ec('0x16'),auth[_0x38ec('0xb')](),controller['accept']);router[_0x38ec('0x14')]('/:id/reject',auth[_0x38ec('0xb')](),controller[_0x38ec('0x17')]);router[_0x38ec('0x18')](_0x38ec('0xe'),auth[_0x38ec('0xb')](),controller[_0x38ec('0x19')]);module[_0x38ec('0x1a')]=router; \ No newline at end of file +var _0xc829=['post','tracked','sms','smsmessage:create','status','put','update','/:id/accept','reject','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','isAuthenticated','index','get','describe','/:id','show'];(function(_0x40b2fd,_0x4d0621){var _0x291f8d=function(_0x39e990){while(--_0x39e990){_0x40b2fd['push'](_0x40b2fd['shift']());}};_0x291f8d(++_0x4d0621);}(_0xc829,0x1e0));var _0x9c82=function(_0x58dd3f,_0x1afa32){_0x58dd3f=_0x58dd3f-0x0;var _0x1c1c49=_0xc829[_0x58dd3f];return _0x1c1c49;};'use strict';var multer=require('multer');var util=require(_0x9c82('0x0'));var path=require('path');var timeout=require(_0x9c82('0x1'));var express=require(_0x9c82('0x2'));var router=express[_0x9c82('0x3')]();var auth=require(_0x9c82('0x4'));var interaction=require(_0x9c82('0x5'));var config=require(_0x9c82('0x6'));var controller=require(_0x9c82('0x7'));router['get']('/',auth[_0x9c82('0x8')](),controller[_0x9c82('0x9')]);router[_0x9c82('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x9c82('0xb')]);router[_0x9c82('0xa')](_0x9c82('0xc'),auth[_0x9c82('0x8')](),controller[_0x9c82('0xd')]);router[_0x9c82('0xe')]('/',auth[_0x9c82('0x8')](),interaction[_0x9c82('0xf')](_0x9c82('0x10'),_0x9c82('0x11')),controller['create']);router[_0x9c82('0xe')]('/:id/status',controller[_0x9c82('0x12')]);router[_0x9c82('0x13')](_0x9c82('0xc'),auth[_0x9c82('0x8')](),controller[_0x9c82('0x14')]);router[_0x9c82('0x13')](_0x9c82('0x15'),auth[_0x9c82('0x8')](),controller['accept']);router[_0x9c82('0x13')]('/:id/reject',auth[_0x9c82('0x8')](),controller[_0x9c82('0x16')]);router[_0x9c82('0x17')](_0x9c82('0xc'),auth[_0x9c82('0x8')](),controller[_0x9c82('0x18')]);module[_0x9c82('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index dd33092..942b645 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 _0xa3bc=['sequelize','medium','ENUM','out','STRING','DATE','BOOLEAN'];(function(_0x1c0aaf,_0x1f21da){var _0xc759a4=function(_0x18c2a3){while(--_0x18c2a3){_0x1c0aaf['push'](_0x1c0aaf['shift']());}};_0xc759a4(++_0x1f21da);}(_0xa3bc,0xe7));var _0xca3b=function(_0x197aa2,_0x16d576){_0x197aa2=_0x197aa2-0x0;var _0x257098=_0xa3bc[_0x197aa2];return _0x257098;};'use strict';var Sequelize=require(_0xca3b('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xca3b('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xca3b('0x2')]('in','out'),'defaultValue':_0xca3b('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xca3b('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xca3b('0x5')]},'secret':{'type':Sequelize[_0xca3b('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xca99=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x5a78ff,_0x837252){var _0xb72576=function(_0xa667ec){while(--_0xa667ec){_0x5a78ff['push'](_0x5a78ff['shift']());}};_0xb72576(++_0x837252);}(_0xca99,0x1c6));var _0x9ca9=function(_0x5d4364,_0x4a6c71){_0x5d4364=_0x5d4364-0x0;var _0x460809=_0xca99[_0x5d4364];return _0x460809;};'use strict';var Sequelize=require(_0x9ca9('0x0'));module[_0x9ca9('0x1')]={'body':{'type':Sequelize[_0x9ca9('0x2')](_0x9ca9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9ca9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9ca9('0x5')]('in','out'),'defaultValue':_0x9ca9('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9ca9('0x7')](0xbe)},'phone':{'type':Sequelize[_0x9ca9('0x7')]},'readAt':{'type':Sequelize[_0x9ca9('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 5395763..9e2adcf 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 _0xbdb7=['Contact','get','SmsInteraction','SmsInteractionId','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','manual','interface','channel','EventManager','acceptmessage','sms','rejectMessage','event','rejectmessage','SmsAccount','SmsAccountId','debug','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','./smsMessage.socket','register','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','apply','reject','save','stack','name','send','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','SmsMessage','count','include','params','length','includeAll','find','create','body','update','destroy','describe','sms-interactions','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x12a020,_0x85b476){_0x12a020=_0x12a020-0x0;var _0x63cddd=_0xbdb7[_0x12a020];return _0x63cddd;};'use strict';var pdf=require(_0x7bdb('0x0'));var emlformat=require(_0x7bdb('0x1'));var rimraf=require(_0x7bdb('0x2'));var zipdir=require(_0x7bdb('0x3'));var jsonpatch=require(_0x7bdb('0x4'));var rp=require(_0x7bdb('0x5'));var moment=require(_0x7bdb('0x6'));var BPromise=require(_0x7bdb('0x7'));var Mustache=require(_0x7bdb('0x8'));var util=require('util');var path=require(_0x7bdb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7bdb('0xa'));var fs=require('fs');var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7bdb('0x16')]=_[_0x7bdb('0x17')](config['redis'],{'host':_0x7bdb('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7bdb('0x19'))[_0x7bdb('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x7bdb('0x1b')][_0x7bdb('0x1c')]({'port':0x232a});function checkPasswordPattern(_0xe9919f,_0x25d417,_0x31c909){if(_0x31c909){var _0xbde12a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xbde12a[_0x7bdb('0x1d')](_0x25d417)){return _0xe9919f;}else{throw new db[(_0x7bdb('0x1e'))]['ValidationError'](_0x7bdb('0x1f'));}}else{return _0xe9919f;}}function respondWithRpcPromise(_0x43f352,_0x5723f4,_0x2aff6a,_0x4ffd4b){return new BPromise(function(_0x41f540,_0x23e9eb){var _0x5b8481=_0x4ffd4b||client;return _0x5b8481[_0x7bdb('0x20')](_0x43f352,_0x2aff6a)[_0x7bdb('0x21')](function(_0x9143e8){logger[_0x7bdb('0x22')](_0x7bdb('0x23'),_0x5723f4,'request\x20sent');logger['debug'](_0x7bdb('0x24'),_0x5723f4,_0x7bdb('0x25'),JSON['stringify'](_0x9143e8));if(_0x9143e8[_0x7bdb('0x26')]){if(_0x9143e8[_0x7bdb('0x26')][_0x7bdb('0x27')]===0x1f4){logger[_0x7bdb('0x26')](_0x7bdb('0x23'),_0x5723f4,_0x9143e8['error'][_0x7bdb('0x28')]);return _0x23e9eb(_0x9143e8[_0x7bdb('0x26')][_0x7bdb('0x28')]);}logger[_0x7bdb('0x26')]('SmsMessage,\x20%s,\x20%s',_0x5723f4,_0x9143e8['error'][_0x7bdb('0x28')]);return _0x41f540(_0x9143e8['error']['message']);}else{logger['info'](_0x7bdb('0x23'),_0x5723f4,'request\x20sent');_0x41f540(_0x9143e8[_0x7bdb('0x29')][_0x7bdb('0x28')]);}})[_0x7bdb('0x2a')](function(_0x7c09cf){logger[_0x7bdb('0x26')]('SmsMessage,\x20%s,\x20%s',_0x5723f4,_0x7c09cf);_0x23e9eb(_0x7c09cf);});});}function respondWithStatusCode(_0x10e818,_0x32242d){_0x32242d=_0x32242d||0xcc;return function(_0x399b62){if(_0x399b62){return _0x10e818[_0x7bdb('0x2b')](_0x32242d);}return _0x10e818[_0x7bdb('0x2c')](_0x32242d)[_0x7bdb('0x2d')]();};}function respondWithResult(_0x1e9996,_0xd2d7be){_0xd2d7be=_0xd2d7be||0xc8;return function(_0x25a1fe){if(_0x25a1fe){return _0x1e9996[_0x7bdb('0x2c')](_0xd2d7be)[_0x7bdb('0x2e')](_0x25a1fe);}};}function respondWithFilteredResult(_0x81ca6f,_0x5b386d){return function(_0x388a45){if(_0x388a45){var _0x23fc3a=_0x388a45['count'],_0x8f7672=_0x5b386d[_0x7bdb('0x2f')],_0x9f5c1=_0x5b386d[_0x7bdb('0x2f')]+_0x5b386d[_0x7bdb('0x30')],_0x29eac5;if(_0x9f5c1>=_0x23fc3a){_0x9f5c1=_0x23fc3a;_0x29eac5=0xc8;}else{_0x29eac5=0xce;}_0x81ca6f[_0x7bdb('0x2c')](_0x29eac5);return _0x81ca6f['set']('Content-Range',_0x8f7672+'-'+_0x9f5c1+'/'+_0x23fc3a)['json'](_0x388a45);}return null;};}function patchUpdates(_0x2304b1){return function(_0x56def2){try{jsonpatch[_0x7bdb('0x31')](_0x56def2,_0x2304b1,!![]);}catch(_0x4cfb77){return BPromise[_0x7bdb('0x32')](_0x4cfb77);}return _0x56def2[_0x7bdb('0x33')]();};}function saveUpdates(_0x1cf75a,_0x4b40a3){return function(_0x2ffdb5){if(_0x2ffdb5){return _0x2ffdb5['update'](_0x1cf75a)['then'](function(_0x136a02){return _0x136a02;});}return null;};}function removeEntity(_0x5611f5,_0x208cc9){return function(_0x4e36a5){if(_0x4e36a5){return _0x4e36a5['destroy']()[_0x7bdb('0x21')](function(){_0x5611f5[_0x7bdb('0x2c')](0xcc)[_0x7bdb('0x2d')]();});}};}function handleEntityNotFound(_0x62e562,_0x3c2bb8){return function(_0x2bb28a){if(!_0x2bb28a){_0x62e562['sendStatus'](0x194);}return _0x2bb28a;};}function handleError(_0x46aa93,_0x464fde){_0x464fde=_0x464fde||0x1f4;return function(_0x329ecf){logger[_0x7bdb('0x26')](_0x329ecf[_0x7bdb('0x34')]);if(_0x329ecf[_0x7bdb('0x35')]){delete _0x329ecf[_0x7bdb('0x35')];}_0x46aa93[_0x7bdb('0x2c')](_0x464fde)[_0x7bdb('0x36')](_0x329ecf);};}exports['index']=function(_0x5024e1,_0x19c237){var _0x31af6f={},_0x2de3c1={},_0x395699={'count':0x0,'rows':[]};var _0x3732b2=_['map'](db['SmsMessage'][_0x7bdb('0x37')],function(_0x5d7c1f){return{'name':_0x5d7c1f[_0x7bdb('0x38')],'type':_0x5d7c1f['type'][_0x7bdb('0x39')]};});_0x2de3c1['model']=_['map'](_0x3732b2,_0x7bdb('0x35'));_0x2de3c1[_0x7bdb('0x3a')]=_[_0x7bdb('0x3b')](_0x5024e1[_0x7bdb('0x3a')]);_0x2de3c1[_0x7bdb('0x3c')]=_[_0x7bdb('0x3d')](_0x2de3c1[_0x7bdb('0x3e')],_0x2de3c1['query']);_0x31af6f['attributes']=_[_0x7bdb('0x3d')](_0x2de3c1[_0x7bdb('0x3e')],qs[_0x7bdb('0x3f')](_0x5024e1[_0x7bdb('0x3a')][_0x7bdb('0x3f')]));_0x31af6f[_0x7bdb('0x40')]=_0x31af6f[_0x7bdb('0x40')]['length']?_0x31af6f['attributes']:_0x2de3c1[_0x7bdb('0x3e')];if(!_0x5024e1[_0x7bdb('0x3a')][_0x7bdb('0x41')](_0x7bdb('0x42'))){_0x31af6f['limit']=qs[_0x7bdb('0x30')](_0x5024e1['query'][_0x7bdb('0x30')]);_0x31af6f[_0x7bdb('0x2f')]=qs[_0x7bdb('0x2f')](_0x5024e1[_0x7bdb('0x3a')][_0x7bdb('0x2f')]);}_0x31af6f[_0x7bdb('0x43')]=qs[_0x7bdb('0x44')](_0x5024e1[_0x7bdb('0x3a')][_0x7bdb('0x44')]);_0x31af6f['where']=qs[_0x7bdb('0x3c')](_[_0x7bdb('0x45')](_0x5024e1['query'],_0x2de3c1[_0x7bdb('0x3c')]),_0x3732b2);if(_0x5024e1['query'][_0x7bdb('0x46')]){_0x31af6f[_0x7bdb('0x47')]=_[_0x7bdb('0x48')](_0x31af6f[_0x7bdb('0x47')],{'$or':_[_0x7bdb('0x49')](_0x3732b2,function(_0x5a25f5){if(_0x5a25f5[_0x7bdb('0x4a')]!==_0x7bdb('0x4b')){var _0x12d889={};_0x12d889[_0x5a25f5[_0x7bdb('0x35')]]={'$like':'%'+_0x5024e1[_0x7bdb('0x3a')]['filter']+'%'};return _0x12d889;}})});}_0x31af6f=_[_0x7bdb('0x48')]({},_0x31af6f,_0x5024e1[_0x7bdb('0x4c')]);var _0x1fdf82={'where':_0x31af6f[_0x7bdb('0x47')]};return db[_0x7bdb('0x4d')][_0x7bdb('0x4e')](_0x1fdf82)[_0x7bdb('0x21')](function(_0x176508){_0x395699[_0x7bdb('0x4e')]=_0x176508;if(_0x5024e1[_0x7bdb('0x3a')]['includeAll']){_0x31af6f[_0x7bdb('0x4f')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x31af6f);})[_0x7bdb('0x21')](function(_0x451f90){_0x395699['rows']=_0x451f90;return _0x395699;})[_0x7bdb('0x21')](respondWithFilteredResult(_0x19c237,_0x31af6f))[_0x7bdb('0x2a')](handleError(_0x19c237,null));};exports['show']=function(_0x54ac12,_0x4edd0d){var _0x21b7a9={'raw':!![],'where':{'id':_0x54ac12[_0x7bdb('0x50')]['id']}},_0x11e73b={};_0x11e73b[_0x7bdb('0x3e')]=_[_0x7bdb('0x3b')](db[_0x7bdb('0x4d')][_0x7bdb('0x37')]);_0x11e73b[_0x7bdb('0x3a')]=_[_0x7bdb('0x3b')](_0x54ac12[_0x7bdb('0x3a')]);_0x11e73b['filters']=_[_0x7bdb('0x3d')](_0x11e73b['model'],_0x11e73b[_0x7bdb('0x3a')]);_0x21b7a9[_0x7bdb('0x40')]=_[_0x7bdb('0x3d')](_0x11e73b[_0x7bdb('0x3e')],qs['fields'](_0x54ac12[_0x7bdb('0x3a')]['fields']));_0x21b7a9['attributes']=_0x21b7a9[_0x7bdb('0x40')][_0x7bdb('0x51')]?_0x21b7a9['attributes']:_0x11e73b['model'];if(_0x54ac12['query'][_0x7bdb('0x52')]){_0x21b7a9['include']=[{'all':!![]}];}_0x21b7a9=_['merge']({},_0x21b7a9,_0x54ac12[_0x7bdb('0x4c')]);return db[_0x7bdb('0x4d')][_0x7bdb('0x53')](_0x21b7a9)[_0x7bdb('0x21')](handleEntityNotFound(_0x4edd0d,null))['then'](respondWithResult(_0x4edd0d,null))[_0x7bdb('0x2a')](handleError(_0x4edd0d,null));};exports['create']=function(_0x35d594,_0x7f2d89){return db[_0x7bdb('0x4d')][_0x7bdb('0x54')](_0x35d594[_0x7bdb('0x55')],{})[_0x7bdb('0x21')](respondWithResult(_0x7f2d89,0xc9))['catch'](handleError(_0x7f2d89,null));};exports[_0x7bdb('0x56')]=function(_0x3022ee,_0x377d58){if(_0x3022ee['body']['id']){delete _0x3022ee[_0x7bdb('0x55')]['id'];}return db[_0x7bdb('0x4d')]['find']({'where':{'id':_0x3022ee[_0x7bdb('0x50')]['id']}})['then'](handleEntityNotFound(_0x377d58,null))[_0x7bdb('0x21')](saveUpdates(_0x3022ee[_0x7bdb('0x55')],null))['then'](respondWithResult(_0x377d58,null))['catch'](handleError(_0x377d58,null));};exports[_0x7bdb('0x57')]=function(_0x2a6c5b,_0x560f54){return db[_0x7bdb('0x4d')]['find']({'where':{'id':_0x2a6c5b[_0x7bdb('0x50')]['id']}})['then'](handleEntityNotFound(_0x560f54,null))['then'](removeEntity(_0x560f54,null))[_0x7bdb('0x2a')](handleError(_0x560f54,null));};exports[_0x7bdb('0x58')]=function(_0x19bb3f,_0x26f1f5){return db[_0x7bdb('0x4d')][_0x7bdb('0x58')]()[_0x7bdb('0x21')](respondWithResult(_0x26f1f5,null))[_0x7bdb('0x2a')](handleError(_0x26f1f5,null));};var interaction_log=require(_0x7bdb('0x14'))(_0x7bdb('0x59'));exports[_0x7bdb('0x5a')]=function(_0x3f786c,_0x4b9970,_0x3e0a08){var _0x2d6234={'channel':'sms'};if(_0x3f786c[_0x7bdb('0x55')]['id']){delete _0x3f786c[_0x7bdb('0x55')]['id'];}_0x3f786c[_0x7bdb('0x55')][_0x7bdb('0x5b')]=!![];_0x3f786c[_0x7bdb('0x55')]['readAt']=moment()[_0x7bdb('0x5c')](_0x7bdb('0x5d'));_0x3f786c[_0x7bdb('0x55')]['UserId']=_0x3f786c[_0x7bdb('0x55')][_0x7bdb('0x5e')]||_0x3f786c[_0x7bdb('0x5f')]['id'];return db[_0x7bdb('0x4d')][_0x7bdb('0x53')]({'where':{'id':_0x3f786c[_0x7bdb('0x50')]['id'],'UserId':null},'include':[{'model':db[_0x7bdb('0x60')],'as':_0x7bdb('0x61')}]})[_0x7bdb('0x21')](handleEntityNotFound(_0x4b9970,null))['then'](saveUpdates(_0x3f786c[_0x7bdb('0x55')],null))[_0x7bdb('0x21')](function(_0x1cf8b1){if(_0x1cf8b1){_0x2d6234[_0x7bdb('0x28')]=_0x1cf8b1[_0x7bdb('0x62')]({'plain':!![]});return db[_0x7bdb('0x63')][_0x7bdb('0x53')]({'where':{'id':_0x1cf8b1[_0x7bdb('0x64')]}});}return null;})[_0x7bdb('0x21')](handleEntityNotFound(_0x4b9970,null))[_0x7bdb('0x21')](function(_0x29f5af){if(_0x29f5af){return _0x29f5af[_0x7bdb('0x56')]({'UserId':_0x3f786c[_0x7bdb('0x55')]['UserId'],'read1stAt':_[_0x7bdb('0x65')](_0x29f5af['read1stAt'])?moment()[_0x7bdb('0x5c')](_0x7bdb('0x5d')):undefined});}return null;})[_0x7bdb('0x21')](function(_0x52ffb5){if(_0x52ffb5){_0x2d6234[_0x7bdb('0x66')]=_0x52ffb5[_0x7bdb('0x62')]({'plain':!![]});interaction_log['info'](_0x7bdb('0x67'),_0x3f786c[_0x7bdb('0x5f')]['id'],_0x3f786c['user'][_0x7bdb('0x35')],_0x3f786c[_0x7bdb('0x5f')]['role'],_0x2d6234[_0x7bdb('0x66')]['id'],_0x3f786c[_0x7bdb('0x55')]?JSON['stringify'](_0x3f786c[_0x7bdb('0x55')]):_0x7bdb('0x68'));return respondWithRpcPromise('AcceptMessage',_0x7bdb('0x69'),_0x2d6234);}return null;})['then'](function(_0x2935d6){if(_0x2935d6){if(_0x3f786c[_0x7bdb('0x55')][_0x7bdb('0x6a')]){_0x2d6234[_0x7bdb('0x28')][_0x7bdb('0x6b')]=util['format']('SIP/%s',_0x3f786c['user'][_0x7bdb('0x35')]);_0x2d6234['message'][_0x7bdb('0x6c')]=_0x2d6234[_0x7bdb('0x6c')];_0x2d6234[_0x7bdb('0x28')]['event']='accept';return respondWithRpcPromise(_0x7bdb('0x6d'),_0x7bdb('0x6d'),{'event':_0x7bdb('0x6e'),'message':_0x2d6234[_0x7bdb('0x28')]},client9002)['then'](function(){return _0x2d6234;});}return _0x2d6234;}return null;})[_0x7bdb('0x21')](respondWithResult(_0x4b9970,null))[_0x7bdb('0x2a')](handleError(_0x4b9970,null));};var interaction_log=require(_0x7bdb('0x14'))(_0x7bdb('0x59'));exports[_0x7bdb('0x32')]=function(_0x381326,_0x504298,_0x2de47c){var _0x552a8a={'agent':{},'channel':_0x7bdb('0x6f')};if(_0x381326['body']['id']){delete _0x381326[_0x7bdb('0x55')]['id'];}_0x381326[_0x7bdb('0x55')][_0x7bdb('0x5e')]=_0x381326[_0x7bdb('0x55')][_0x7bdb('0x5e')]||_0x381326['user']['id'];_0x552a8a['agent']['id']=_0x381326[_0x7bdb('0x55')][_0x7bdb('0x5e')];return db['SmsMessage'][_0x7bdb('0x53')]({'where':{'id':_0x381326[_0x7bdb('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x504298,null))[_0x7bdb('0x21')](function(_0xe1b637){if(_0xe1b637){_0x552a8a['message']=_0xe1b637[_0x7bdb('0x62')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0xe1b637[_0x7bdb('0x64')]}});}return null;})[_0x7bdb('0x21')](handleEntityNotFound(_0x504298,null))['then'](function(_0x517982){if(_0x517982){_0x552a8a[_0x7bdb('0x66')]=_0x517982['get']({'plain':!![]});interaction_log[_0x7bdb('0x22')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x381326[_0x7bdb('0x5f')]['id'],_0x381326[_0x7bdb('0x5f')][_0x7bdb('0x35')],_0x381326[_0x7bdb('0x5f')]['role'],_0x552a8a[_0x7bdb('0x66')]['id'],_0x381326[_0x7bdb('0x55')]?JSON['stringify'](_0x381326[_0x7bdb('0x55')]):_0x7bdb('0x68'));return respondWithRpcPromise('RejectMessage',_0x7bdb('0x70'),_0x552a8a);}return null;})[_0x7bdb('0x21')](function(_0x400915){if(_0x400915){_0x400915[_0x7bdb('0x28')]['interface']=util[_0x7bdb('0x5c')]('SIP/%s',_0x381326[_0x7bdb('0x5f')][_0x7bdb('0x35')]);_0x400915[_0x7bdb('0x28')]['channel']=_0x552a8a[_0x7bdb('0x6c')];_0x400915[_0x7bdb('0x28')][_0x7bdb('0x71')]=_0x7bdb('0x32');respondWithRpcPromise(_0x7bdb('0x6d'),_0x7bdb('0x6d'),{'event':_0x7bdb('0x72'),'message':_0x400915[_0x7bdb('0x28')]},client9002);return _0x552a8a;}return null;})[_0x7bdb('0x21')](respondWithResult(_0x504298,null))[_0x7bdb('0x2a')](handleError(_0x504298,null));};exports[_0x7bdb('0x2c')]=function(_0x3b2731,_0x2c2b94,_0x20e383){if(_0x3b2731[_0x7bdb('0x55')]['id']){delete _0x3b2731[_0x7bdb('0x55')]['id'];}var _0x24fdef;return db[_0x7bdb('0x4d')]['find']({'where':{'id':_0x3b2731[_0x7bdb('0x50')]['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x2c2b94,null))[_0x7bdb('0x21')](function(_0x2fd00c){if(_0x2fd00c){_0x24fdef=_0x2fd00c;return db[_0x7bdb('0x73')][_0x7bdb('0x53')]({'where':{'id':_0x2fd00c[_0x7bdb('0x74')]}});}})[_0x7bdb('0x21')](handleEntityNotFound(_0x2c2b94,null))[_0x7bdb('0x21')](function(_0x472026){if(_0x472026){logger[_0x7bdb('0x75')]('SmsMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x472026[_0x7bdb('0x4a')],util[_0x7bdb('0x76')](_0x3b2731['body'],{'showHidden':![],'depth':null}));switch(_0x472026[_0x7bdb('0x4a')]){case _0x7bdb('0x77'):if(_0x3b2731['body']['MessageSid']&&_0x3b2731['body'][_0x7bdb('0x78')]===_0x24fdef['messageId']){return _0x24fdef['update']({'read':!![]});}else{logger['error'](_0x7bdb('0x79'),_0x7bdb('0x2c'),_0x7bdb('0x77'),util['inspect'](_0x3b2731[_0x7bdb('0x55')],{'showHidden':![],'depth':null}));}break;case _0x7bdb('0x7a'):if(_0x3b2731[_0x7bdb('0x55')][_0x7bdb('0x7b')]&&_0x3b2731['body'][_0x7bdb('0x7b')]===_0x24fdef['messageId']&&_[_0x7bdb('0x7c')]([_0x7bdb('0x7d'),_0x7bdb('0x7e')],_0x3b2731['body'][_0x7bdb('0x7f')])>=0x0){return _0x24fdef[_0x7bdb('0x56')]({'read':!![]});}else{logger[_0x7bdb('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7bdb('0x2c'),_0x7bdb('0x80'),util['inspect'](_0x3b2731[_0x7bdb('0x55')],{'showHidden':![],'depth':null}));}break;case _0x7bdb('0x81'):var _0x4e2aae=_0x3b2731[_0x7bdb('0x55')][_0x7bdb('0x82')][0x0];if(_0x4e2aae[_0x7bdb('0x2c')][_0x7bdb('0x83')]===_0x7bdb('0x84')){return _0x24fdef['update']({'read':!![]});}else{logger[_0x7bdb('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x7bdb('0x2c'),_0x7bdb('0x81'),util[_0x7bdb('0x76')](_0x3b2731['body'],{'showHidden':![],'depth':null}));}break;}return _0x24fdef;}})[_0x7bdb('0x21')](respondWithResult(_0x2c2b94,null))['catch'](handleError(_0x2c2b94,null));}; \ No newline at end of file +var _0xd353=['ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','redis','socket.io-emitter','./smsMessage.socket','register','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','name','send','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','map','type','VIRTUAL','SmsMessage','includeAll','include','findAll','rows','catch','params','options','find','create','body','describe','../../config/logger','sms-interactions','accept','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','manual','interface','format','SIP/%s','channel','event','EventManager','reject','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','RejectMessage','rejectmessage','SmsAccount','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','inspect','plivo','MessageUUID','messageId','indexOf','delivered','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','results','groupName','DELIVERED','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv'];(function(_0xfff265,_0x41f693){var _0x55442d=function(_0x4f68c6){while(--_0x4f68c6){_0xfff265['push'](_0xfff265['shift']());}};_0x55442d(++_0x41f693);}(_0xd353,0x7e));var _0x3d35=function(_0x3a9e4a,_0x4fb6b8){_0x3a9e4a=_0x3a9e4a-0x0;var _0x3202ec=_0xd353[_0x3a9e4a];return _0x3202ec;};'use strict';var pdf=require(_0x3d35('0x0'));var emlformat=require(_0x3d35('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3d35('0x2'));var jsonpatch=require(_0x3d35('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d35('0x4'));var Mustache=require('mustache');var util=require(_0x3d35('0x5'));var path=require(_0x3d35('0x6'));var sox=require(_0x3d35('0x7'));var csv=require(_0x3d35('0x8'));var ejs=require(_0x3d35('0x9'));var fs=require('fs');var _=require(_0x3d35('0xa'));var squel=require(_0x3d35('0xb'));var crypto=require('crypto');var jsforce=require(_0x3d35('0xc'));var deskjs=require(_0x3d35('0xd'));var toCsv=require(_0x3d35('0x8'));var querystring=require(_0x3d35('0xe'));var Papa=require(_0x3d35('0xf'));var Redis=require(_0x3d35('0x10'));var authService=require(_0x3d35('0x11'));var qs=require(_0x3d35('0x12'));var as=require(_0x3d35('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3d35('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x3d35('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x3d35('0x16'))(new Redis(config[_0x3d35('0x15')]));require(_0x3d35('0x17'))[_0x3d35('0x18')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3d35('0x19')][_0x3d35('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0x3d35('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1ec3db,_0x5c59a0,_0x2c5e9a){if(_0x2c5e9a){var _0x2f3dfa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2f3dfa[_0x3d35('0x1b')](_0x5c59a0)){return _0x1ec3db;}else{throw new db[(_0x3d35('0x1c'))][(_0x3d35('0x1d'))](_0x3d35('0x1e'));}}else{return _0x1ec3db;}}function respondWithRpcPromise(_0x57444d,_0x4685ce,_0x1f06dc,_0x206cd3){return new BPromise(function(_0x3c452a,_0x4ffcf5){var _0x59b3e9=_0x206cd3||client;return _0x59b3e9[_0x3d35('0x1f')](_0x57444d,_0x1f06dc)['then'](function(_0x572199){logger[_0x3d35('0x20')](_0x3d35('0x21'),_0x4685ce,_0x3d35('0x22'));logger[_0x3d35('0x23')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4685ce,_0x3d35('0x22'),JSON['stringify'](_0x572199));if(_0x572199[_0x3d35('0x24')]){if(_0x572199[_0x3d35('0x24')][_0x3d35('0x25')]===0x1f4){logger[_0x3d35('0x24')](_0x3d35('0x21'),_0x4685ce,_0x572199[_0x3d35('0x24')][_0x3d35('0x26')]);return _0x4ffcf5(_0x572199[_0x3d35('0x24')][_0x3d35('0x26')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x4685ce,_0x572199['error'][_0x3d35('0x26')]);return _0x3c452a(_0x572199[_0x3d35('0x24')][_0x3d35('0x26')]);}else{logger['info'](_0x3d35('0x21'),_0x4685ce,'request\x20sent');_0x3c452a(_0x572199['result']['message']);}})['catch'](function(_0x5004e2){logger[_0x3d35('0x24')](_0x3d35('0x21'),_0x4685ce,_0x5004e2);_0x4ffcf5(_0x5004e2);});});}function respondWithStatusCode(_0x4fb07f,_0x5e44be){_0x5e44be=_0x5e44be||0xcc;return function(_0x5720f8){if(_0x5720f8){return _0x4fb07f[_0x3d35('0x27')](_0x5e44be);}return _0x4fb07f[_0x3d35('0x28')](_0x5e44be)[_0x3d35('0x29')]();};}function respondWithResult(_0x46a63d,_0x23c62a){_0x23c62a=_0x23c62a||0xc8;return function(_0x5c6cfe){if(_0x5c6cfe){return _0x46a63d[_0x3d35('0x28')](_0x23c62a)[_0x3d35('0x2a')](_0x5c6cfe);}};}function respondWithFilteredResult(_0x526761,_0x4f3ded){return function(_0x12d74c){if(_0x12d74c){var _0x11c30b=_0x12d74c[_0x3d35('0x2b')],_0x34e33f=_0x4f3ded[_0x3d35('0x2c')],_0x576ffc=_0x4f3ded[_0x3d35('0x2c')]+_0x4f3ded[_0x3d35('0x2d')],_0x5d952d;if(_0x576ffc>=_0x11c30b){_0x576ffc=_0x11c30b;_0x5d952d=0xc8;}else{_0x5d952d=0xce;}_0x526761[_0x3d35('0x28')](_0x5d952d);return _0x526761[_0x3d35('0x2e')](_0x3d35('0x2f'),_0x34e33f+'-'+_0x576ffc+'/'+_0x11c30b)[_0x3d35('0x2a')](_0x12d74c);}return null;};}function patchUpdates(_0x2a2d44){return function(_0x4ce664){try{jsonpatch[_0x3d35('0x30')](_0x4ce664,_0x2a2d44,!![]);}catch(_0x5f121b){return BPromise['reject'](_0x5f121b);}return _0x4ce664['save']();};}function saveUpdates(_0xfd9634,_0x35bec6){return function(_0x1eb55b){if(_0x1eb55b){return _0x1eb55b[_0x3d35('0x31')](_0xfd9634)[_0x3d35('0x32')](function(_0x4bbd7e){return _0x4bbd7e;});}return null;};}function removeEntity(_0x293d05,_0x54c826){return function(_0x40cb92){if(_0x40cb92){return _0x40cb92[_0x3d35('0x33')]()[_0x3d35('0x32')](function(){_0x293d05[_0x3d35('0x28')](0xcc)[_0x3d35('0x29')]();});}};}function handleEntityNotFound(_0x330053,_0x40347a){return function(_0x429056){if(!_0x429056){_0x330053[_0x3d35('0x27')](0x194);}return _0x429056;};}function handleError(_0x2b8eba,_0x3c33e5){_0x3c33e5=_0x3c33e5||0x1f4;return function(_0x10e764){logger[_0x3d35('0x24')](_0x10e764['stack']);if(_0x10e764[_0x3d35('0x34')]){delete _0x10e764['name'];}_0x2b8eba[_0x3d35('0x28')](_0x3c33e5)[_0x3d35('0x35')](_0x10e764);};}exports['index']=function(_0x3529e8,_0x5c6b70){var _0x41e158={},_0x48c7dd={},_0xb6a87c={'count':0x0,'rows':[]};var _0x30d4e9=_['map'](db['SmsMessage'][_0x3d35('0x36')],function(_0x1376f4){return{'name':_0x1376f4[_0x3d35('0x37')],'type':_0x1376f4['type'][_0x3d35('0x38')]};});_0x48c7dd[_0x3d35('0x39')]=_['map'](_0x30d4e9,_0x3d35('0x34'));_0x48c7dd[_0x3d35('0x3a')]=_[_0x3d35('0x3b')](_0x3529e8['query']);_0x48c7dd[_0x3d35('0x3c')]=_[_0x3d35('0x3d')](_0x48c7dd[_0x3d35('0x39')],_0x48c7dd[_0x3d35('0x3a')]);_0x41e158[_0x3d35('0x3e')]=_[_0x3d35('0x3d')](_0x48c7dd['model'],qs[_0x3d35('0x3f')](_0x3529e8['query'][_0x3d35('0x3f')]));_0x41e158[_0x3d35('0x3e')]=_0x41e158[_0x3d35('0x3e')][_0x3d35('0x40')]?_0x41e158[_0x3d35('0x3e')]:_0x48c7dd[_0x3d35('0x39')];if(!_0x3529e8[_0x3d35('0x3a')][_0x3d35('0x41')](_0x3d35('0x42'))){_0x41e158[_0x3d35('0x2d')]=qs[_0x3d35('0x2d')](_0x3529e8[_0x3d35('0x3a')][_0x3d35('0x2d')]);_0x41e158[_0x3d35('0x2c')]=qs['offset'](_0x3529e8[_0x3d35('0x3a')][_0x3d35('0x2c')]);}_0x41e158[_0x3d35('0x43')]=qs['sort'](_0x3529e8[_0x3d35('0x3a')]['sort']);_0x41e158[_0x3d35('0x44')]=qs[_0x3d35('0x3c')](_['pick'](_0x3529e8[_0x3d35('0x3a')],_0x48c7dd[_0x3d35('0x3c')]),_0x30d4e9);if(_0x3529e8['query'][_0x3d35('0x45')]){_0x41e158[_0x3d35('0x44')]=_[_0x3d35('0x46')](_0x41e158['where'],{'$or':_[_0x3d35('0x47')](_0x30d4e9,function(_0x19c7f6){if(_0x19c7f6[_0x3d35('0x48')]!==_0x3d35('0x49')){var _0x1100ce={};_0x1100ce[_0x19c7f6[_0x3d35('0x34')]]={'$like':'%'+_0x3529e8[_0x3d35('0x3a')]['filter']+'%'};return _0x1100ce;}})});}_0x41e158=_[_0x3d35('0x46')]({},_0x41e158,_0x3529e8['options']);var _0x376edd={'where':_0x41e158['where']};return db[_0x3d35('0x4a')][_0x3d35('0x2b')](_0x376edd)[_0x3d35('0x32')](function(_0x129cb1){_0xb6a87c[_0x3d35('0x2b')]=_0x129cb1;if(_0x3529e8[_0x3d35('0x3a')][_0x3d35('0x4b')]){_0x41e158[_0x3d35('0x4c')]=[{'all':!![]}];}return db[_0x3d35('0x4a')][_0x3d35('0x4d')](_0x41e158);})[_0x3d35('0x32')](function(_0x2bf2e0){_0xb6a87c[_0x3d35('0x4e')]=_0x2bf2e0;return _0xb6a87c;})['then'](respondWithFilteredResult(_0x5c6b70,_0x41e158))[_0x3d35('0x4f')](handleError(_0x5c6b70,null));};exports['show']=function(_0x476574,_0x23c905){var _0x1ea30b={'raw':!![],'where':{'id':_0x476574[_0x3d35('0x50')]['id']}},_0x548ea4={};_0x548ea4[_0x3d35('0x39')]=_['keys'](db[_0x3d35('0x4a')][_0x3d35('0x36')]);_0x548ea4['query']=_['keys'](_0x476574[_0x3d35('0x3a')]);_0x548ea4['filters']=_[_0x3d35('0x3d')](_0x548ea4['model'],_0x548ea4[_0x3d35('0x3a')]);_0x1ea30b[_0x3d35('0x3e')]=_[_0x3d35('0x3d')](_0x548ea4['model'],qs[_0x3d35('0x3f')](_0x476574[_0x3d35('0x3a')][_0x3d35('0x3f')]));_0x1ea30b['attributes']=_0x1ea30b[_0x3d35('0x3e')][_0x3d35('0x40')]?_0x1ea30b[_0x3d35('0x3e')]:_0x548ea4['model'];if(_0x476574[_0x3d35('0x3a')][_0x3d35('0x4b')]){_0x1ea30b[_0x3d35('0x4c')]=[{'all':!![]}];}_0x1ea30b=_['merge']({},_0x1ea30b,_0x476574[_0x3d35('0x51')]);return db['SmsMessage'][_0x3d35('0x52')](_0x1ea30b)[_0x3d35('0x32')](handleEntityNotFound(_0x23c905,null))['then'](respondWithResult(_0x23c905,null))[_0x3d35('0x4f')](handleError(_0x23c905,null));};exports[_0x3d35('0x53')]=function(_0x3ed79e,_0x1d1264){return db[_0x3d35('0x4a')][_0x3d35('0x53')](_0x3ed79e['body'],{})[_0x3d35('0x32')](respondWithResult(_0x1d1264,0xc9))[_0x3d35('0x4f')](handleError(_0x1d1264,null));};exports[_0x3d35('0x31')]=function(_0xf465e9,_0x47e6fc){if(_0xf465e9[_0x3d35('0x54')]['id']){delete _0xf465e9['body']['id'];}return db[_0x3d35('0x4a')]['find']({'where':{'id':_0xf465e9[_0x3d35('0x50')]['id']}})[_0x3d35('0x32')](handleEntityNotFound(_0x47e6fc,null))[_0x3d35('0x32')](saveUpdates(_0xf465e9[_0x3d35('0x54')],null))[_0x3d35('0x32')](respondWithResult(_0x47e6fc,null))[_0x3d35('0x4f')](handleError(_0x47e6fc,null));};exports[_0x3d35('0x33')]=function(_0x4ba637,_0x318027){return db[_0x3d35('0x4a')]['find']({'where':{'id':_0x4ba637[_0x3d35('0x50')]['id']}})[_0x3d35('0x32')](handleEntityNotFound(_0x318027,null))[_0x3d35('0x32')](removeEntity(_0x318027,null))[_0x3d35('0x4f')](handleError(_0x318027,null));};exports[_0x3d35('0x55')]=function(_0x926bd,_0x2c8b93){return db['SmsMessage'][_0x3d35('0x55')]()[_0x3d35('0x32')](respondWithResult(_0x2c8b93,null))[_0x3d35('0x4f')](handleError(_0x2c8b93,null));};var interaction_log=require(_0x3d35('0x56'))(_0x3d35('0x57'));exports[_0x3d35('0x58')]=function(_0x329c2c,_0x3ed2ea,_0x4eb9e3){var _0x215c0a={'channel':_0x3d35('0x59')};if(_0x329c2c[_0x3d35('0x54')]['id']){delete _0x329c2c[_0x3d35('0x54')]['id'];}_0x329c2c[_0x3d35('0x54')]['read']=!![];_0x329c2c[_0x3d35('0x54')][_0x3d35('0x5a')]=moment()['format'](_0x3d35('0x5b'));_0x329c2c[_0x3d35('0x54')]['UserId']=_0x329c2c[_0x3d35('0x54')][_0x3d35('0x5c')]||_0x329c2c[_0x3d35('0x5d')]['id'];return db[_0x3d35('0x4a')][_0x3d35('0x52')]({'where':{'id':_0x329c2c['params']['id'],'UserId':null},'include':[{'model':db[_0x3d35('0x5e')],'as':_0x3d35('0x5f')}]})['then'](handleEntityNotFound(_0x3ed2ea,null))[_0x3d35('0x32')](saveUpdates(_0x329c2c[_0x3d35('0x54')],null))['then'](function(_0x68aad6){if(_0x68aad6){_0x215c0a[_0x3d35('0x26')]=_0x68aad6[_0x3d35('0x60')]({'plain':!![]});return db[_0x3d35('0x61')][_0x3d35('0x52')]({'where':{'id':_0x68aad6[_0x3d35('0x62')]}});}return null;})['then'](handleEntityNotFound(_0x3ed2ea,null))[_0x3d35('0x32')](function(_0x26cc70){if(_0x26cc70){return _0x26cc70[_0x3d35('0x31')]({'UserId':_0x329c2c['body']['UserId'],'read1stAt':_[_0x3d35('0x63')](_0x26cc70[_0x3d35('0x64')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x568d6c){if(_0x568d6c){_0x215c0a[_0x3d35('0x65')]=_0x568d6c['get']({'plain':!![]});interaction_log[_0x3d35('0x20')](_0x3d35('0x66'),_0x329c2c['user']['id'],_0x329c2c[_0x3d35('0x5d')]['name'],_0x329c2c[_0x3d35('0x5d')]['role'],_0x215c0a[_0x3d35('0x65')]['id'],_0x329c2c['body']?JSON['stringify'](_0x329c2c[_0x3d35('0x54')]):'null');return respondWithRpcPromise(_0x3d35('0x67'),_0x3d35('0x68'),_0x215c0a);}return null;})['then'](function(_0x52e9cd){if(_0x52e9cd){if(_0x329c2c[_0x3d35('0x54')][_0x3d35('0x69')]){_0x215c0a[_0x3d35('0x26')][_0x3d35('0x6a')]=util[_0x3d35('0x6b')](_0x3d35('0x6c'),_0x329c2c[_0x3d35('0x5d')][_0x3d35('0x34')]);_0x215c0a[_0x3d35('0x26')][_0x3d35('0x6d')]=_0x215c0a[_0x3d35('0x6d')];_0x215c0a[_0x3d35('0x26')][_0x3d35('0x6e')]=_0x3d35('0x58');return respondWithRpcPromise(_0x3d35('0x6f'),_0x3d35('0x6f'),{'event':'acceptmessage','message':_0x215c0a[_0x3d35('0x26')]},client9002)['then'](function(){return _0x215c0a;});}return _0x215c0a;}return null;})[_0x3d35('0x32')](respondWithResult(_0x3ed2ea,null))[_0x3d35('0x4f')](handleError(_0x3ed2ea,null));};var interaction_log=require(_0x3d35('0x56'))(_0x3d35('0x57'));exports[_0x3d35('0x70')]=function(_0x49de1c,_0x539196,_0x1c7cef){var _0x5e089d={'agent':{},'channel':_0x3d35('0x59')};if(_0x49de1c[_0x3d35('0x54')]['id']){delete _0x49de1c['body']['id'];}_0x49de1c[_0x3d35('0x54')]['UserId']=_0x49de1c['body'][_0x3d35('0x5c')]||_0x49de1c[_0x3d35('0x5d')]['id'];_0x5e089d[_0x3d35('0x71')]['id']=_0x49de1c[_0x3d35('0x54')][_0x3d35('0x5c')];return db[_0x3d35('0x4a')]['find']({'where':{'id':_0x49de1c[_0x3d35('0x50')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x539196,null))[_0x3d35('0x32')](function(_0x113a54){if(_0x113a54){_0x5e089d[_0x3d35('0x26')]=_0x113a54['get']({'plain':!![]});return db[_0x3d35('0x61')][_0x3d35('0x52')]({'where':{'id':_0x113a54['SmsInteractionId']}});}return null;})[_0x3d35('0x32')](handleEntityNotFound(_0x539196,null))['then'](function(_0x1c7802){if(_0x1c7802){_0x5e089d[_0x3d35('0x65')]=_0x1c7802[_0x3d35('0x60')]({'plain':!![]});interaction_log['info'](_0x3d35('0x72'),_0x49de1c[_0x3d35('0x5d')]['id'],_0x49de1c[_0x3d35('0x5d')][_0x3d35('0x34')],_0x49de1c[_0x3d35('0x5d')]['role'],_0x5e089d[_0x3d35('0x65')]['id'],_0x49de1c[_0x3d35('0x54')]?JSON[_0x3d35('0x73')](_0x49de1c[_0x3d35('0x54')]):_0x3d35('0x74'));return respondWithRpcPromise(_0x3d35('0x75'),'rejectMessage',_0x5e089d);}return null;})[_0x3d35('0x32')](function(_0x155b61){if(_0x155b61){_0x155b61['message'][_0x3d35('0x6a')]=util[_0x3d35('0x6b')](_0x3d35('0x6c'),_0x49de1c[_0x3d35('0x5d')][_0x3d35('0x34')]);_0x155b61['message']['channel']=_0x5e089d[_0x3d35('0x6d')];_0x155b61[_0x3d35('0x26')][_0x3d35('0x6e')]='reject';respondWithRpcPromise(_0x3d35('0x6f'),_0x3d35('0x6f'),{'event':_0x3d35('0x76'),'message':_0x155b61['message']},client9002);return _0x5e089d;}return null;})['then'](respondWithResult(_0x539196,null))[_0x3d35('0x4f')](handleError(_0x539196,null));};exports['status']=function(_0x42d51d,_0x11437e,_0x510725){if(_0x42d51d[_0x3d35('0x54')]['id']){delete _0x42d51d[_0x3d35('0x54')]['id'];}var _0x55ba32;return db[_0x3d35('0x4a')][_0x3d35('0x52')]({'where':{'id':_0x42d51d[_0x3d35('0x50')]['id']}})[_0x3d35('0x32')](handleEntityNotFound(_0x11437e,null))[_0x3d35('0x32')](function(_0x50d760){if(_0x50d760){_0x55ba32=_0x50d760;return db[_0x3d35('0x77')][_0x3d35('0x52')]({'where':{'id':_0x50d760['SmsAccountId']}});}})[_0x3d35('0x32')](handleEntityNotFound(_0x11437e,null))['then'](function(_0x24a0da){if(_0x24a0da){logger[_0x3d35('0x23')](_0x3d35('0x78'),_0x3d35('0x28'),_0x3d35('0x79'),_0x24a0da[_0x3d35('0x48')],util['inspect'](_0x42d51d['body'],{'showHidden':![],'depth':null}));switch(_0x24a0da[_0x3d35('0x48')]){case _0x3d35('0x7a'):if(_0x42d51d[_0x3d35('0x54')][_0x3d35('0x7b')]&&_0x42d51d['body'][_0x3d35('0x7b')]===_0x55ba32['messageId']){return _0x55ba32[_0x3d35('0x31')]({'read':!![]});}else{logger[_0x3d35('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','twilio',util[_0x3d35('0x7c')](_0x42d51d[_0x3d35('0x54')],{'showHidden':![],'depth':null}));}break;case _0x3d35('0x7d'):if(_0x42d51d[_0x3d35('0x54')][_0x3d35('0x7e')]&&_0x42d51d[_0x3d35('0x54')]['MessageUUID']===_0x55ba32[_0x3d35('0x7f')]&&_[_0x3d35('0x80')](['sent',_0x3d35('0x81')],_0x42d51d[_0x3d35('0x54')]['Status'])>=0x0){return _0x55ba32[_0x3d35('0x31')]({'read':!![]});}else{logger['error'](_0x3d35('0x82'),_0x3d35('0x28'),'plivio',util[_0x3d35('0x7c')](_0x42d51d[_0x3d35('0x54')],{'showHidden':![],'depth':null}));}break;case _0x3d35('0x83'):var _0x580367=_0x42d51d[_0x3d35('0x54')][_0x3d35('0x84')][0x0];if(_0x580367[_0x3d35('0x28')][_0x3d35('0x85')]===_0x3d35('0x86')){return _0x55ba32[_0x3d35('0x31')]({'read':!![]});}else{logger[_0x3d35('0x24')](_0x3d35('0x82'),'status',_0x3d35('0x83'),util[_0x3d35('0x7c')](_0x42d51d[_0x3d35('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x55ba32;}})[_0x3d35('0x32')](respondWithResult(_0x11437e,null))['catch'](handleError(_0x11437e,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index d522648..6f3dbea 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 _0x87fb=['../../mysqldb','SmsMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x87fb,0xe5));var _0xb87f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x87fb[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0xb87f('0x0'));var SmsMessage=require(_0xb87f('0x1'))['db'][_0xb87f('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb87f('0x3'),'afterUpdate':_0xb87f('0x4'),'afterDestroy':_0xb87f('0x5')};function emitEvent(_0xb152b){return function(_0x3c06e4,_0xa0a040,_0x81fa86){SmsMessageEvents['emit'](_0xb152b+':'+_0x3c06e4['id'],_0x3c06e4);SmsMessageEvents[_0xb87f('0x6')](_0xb152b,_0x3c06e4);_0x81fa86(null);};}for(var e in events){if(events[_0xb87f('0x7')](e)){var event=events[e];SmsMessage[_0xb87f('0x8')](e,emitEvent(event));}}module[_0xb87f('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xd413=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xd413,0xf9));var _0x3d41=function(_0x2f2360,_0x151089){_0x2f2360=_0x2f2360-0x0;var _0x1cc8d3=_0xd413[_0x2f2360];return _0x1cc8d3;};'use strict';var EventEmitter=require(_0x3d41('0x0'));var SmsMessage=require(_0x3d41('0x1'))['db'][_0x3d41('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x3d41('0x3')](0x0);var events={'afterCreate':_0x3d41('0x4'),'afterUpdate':_0x3d41('0x5'),'afterDestroy':_0x3d41('0x6')};function emitEvent(_0x275a0b){return function(_0xbb7f16,_0xa824ba,_0x448a04){SmsMessageEvents[_0x3d41('0x7')](_0x275a0b+':'+_0xbb7f16['id'],_0xbb7f16);SmsMessageEvents[_0x3d41('0x7')](_0x275a0b,_0xbb7f16);_0x448a04(null);};}for(var e in events){if(events[_0x3d41('0x8')](e)){var event=events[e];SmsMessage[_0x3d41('0x9')](e,emitEvent(event));}}module[_0x3d41('0xa')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 81b3c9e..a7bd1c5 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 _0x9c78=['define','sms_messages','messageId','body','FULLTEXT','get','toLowerCase','direction','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','phone','authToken','messages','/api/sms/messages/','/status?token=','token','sid','catch','afterCreate','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','login?username=','username','&password=','GET','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','base64','http_code','data','queued_count','head','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','toString','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','remote','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','keys','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','intelepeer','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports'];(function(_0x2b3be5,_0x59181d){var _0x3c4282=function(_0x4e86b5){while(--_0x4e86b5){_0x2b3be5['push'](_0x2b3be5['shift']());}};_0x3c4282(++_0x59181d);}(_0x9c78,0x1e1));var _0x89c7=function(_0x298940,_0x503d82){_0x298940=_0x298940-0x0;var _0x47e6cb=_0x9c78[_0x298940];return _0x47e6cb;};'use strict';var _=require(_0x89c7('0x0'));var util=require(_0x89c7('0x1'));var logger=require(_0x89c7('0x2'))('api');var moment=require(_0x89c7('0x3'));var BPromise=require(_0x89c7('0x4'));var rp=require(_0x89c7('0x5'));var fs=require('fs');var path=require(_0x89c7('0x6'));var rimraf=require(_0x89c7('0x7'));var config=require(_0x89c7('0x8'));var attributes=require(_0x89c7('0x9'));module[_0x89c7('0xa')]=function(_0x383ac5,_0x25d575){return _0x383ac5[_0x89c7('0xb')]('SmsMessage',attributes,{'tableName':_0x89c7('0xc'),'paranoid':![],'indexes':[{'name':_0x89c7('0xd'),'fields':['messageId']},{'name':'fti_sms_messages','fields':[_0x89c7('0xe')],'type':_0x89c7('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3573a9,_0x216174,_0x33e2c0){var _0x57b79c=_0x383ac5['models'];var _0x319bf1=_0x3573a9[_0x89c7('0x10')]({'plain':!![]});if(_0x319bf1['direction'][_0x89c7('0x11')]()==='in'||_0x319bf1[_0x89c7('0x12')][_0x89c7('0x11')]()===_0x89c7('0x13')&&!_0x319bf1[_0x89c7('0x14')]&&!_[_0x89c7('0x15')](_0x319bf1[_0x89c7('0x16')])){_0x57b79c[_0x89c7('0x17')][_0x89c7('0x18')]({'where':{'id':_0x319bf1[_0x89c7('0x19')]}})[_0x89c7('0x1a')](function(_0xb7ed14){if(_0xb7ed14){_0xb7ed14[_0x89c7('0x1b')]({'lastMsgAt':_0x319bf1[_0x89c7('0x1c')],'lastMsgDirection':_0x319bf1[_0x89c7('0x12')][_0x89c7('0x11')]()});}})['catch'](function(_0x26eb97){console[_0x89c7('0x1d')](_0x26eb97);});}if(_0x319bf1['direction']===_0x89c7('0x13')&&!_0x319bf1[_0x89c7('0x14')]){var _0x21daa0;_0x57b79c[_0x89c7('0x1e')][_0x89c7('0x1f')]({'where':{'id':_0x319bf1[_0x89c7('0x20')]},'raw':!![]})[_0x89c7('0x1a')](function(_0x2f2a07){_0x21daa0=_0x2f2a07;if(_0x21daa0&&_0x21daa0[_0x89c7('0x21')]){switch(_0x21daa0[_0x89c7('0x21')]){case _0x89c7('0x22'):var _0x4b7d7c=require(_0x89c7('0x22'));if(_0x21daa0[_0x89c7('0x23')]&&_0x21daa0['authToken']&&_0x21daa0[_0x89c7('0x24')]){var _0x3b317b=new _0x4b7d7c(_0x21daa0[_0x89c7('0x23')],_0x21daa0[_0x89c7('0x25')]);_0x3b317b[_0x89c7('0x26')]['create']({'body':_0x319bf1[_0x89c7('0xe')],'to':_0x319bf1[_0x89c7('0x24')],'from':_0x21daa0['phone'],'statusCallback':_0x21daa0['remote']+_0x89c7('0x27')+_0x319bf1['id']+_0x89c7('0x28')+_0x21daa0[_0x89c7('0x29')]})['then'](function(_0x51de49){if(_0x51de49[_0x89c7('0x2a')]){return _0x3573a9['update']({'messageId':_0x51de49['sid']});}})[_0x89c7('0x2b')](function(_0x10a88b){logger[_0x89c7('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x89c7('0x2c'),'twilio',util['inspect'](_0x10a88b,{'showHidden':![],'depth':null}));});}else{logger[_0x89c7('0x1d')](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x89c7('0x2e'):var _0x2148d0=_0x89c7('0x2f');if(_0x21daa0['username']&&_0x21daa0[_0x89c7('0x30')]){var _0x2b01c0={'recipient':[_0x319bf1[_0x89c7('0x24')]],'message':_0x319bf1[_0x89c7('0xe')],'message_type':_0x21daa0['smsMethod']};if(_0x21daa0['smsMethod']&&_0x21daa0[_0x89c7('0x31')]!=='SI'){_0x2b01c0[_0x89c7('0x32')]=_0x21daa0[_0x89c7('0x24')];}var _0x4c1417={'url':_0x2148d0+_0x89c7('0x33')+_0x21daa0[_0x89c7('0x34')]+_0x89c7('0x35')+_0x21daa0[_0x89c7('0x30')],'method':_0x89c7('0x36')};rp(_0x4c1417)[_0x89c7('0x1a')](function(_0x336c0b){var _0x30261a=_0x336c0b['split'](';');var _0x517798={'user_key':_0x30261a[0x0],'session_key':_0x30261a[0x1]};_0x4c1417={'url':_0x2148d0+_0x89c7('0x37'),'method':_0x89c7('0x38'),'headers':{'user_key':_0x517798[_0x89c7('0x39')],'Session_key':_0x517798['session_key']},'json':!![],'body':_0x2b01c0};return rp(_0x4c1417);})[_0x89c7('0x1a')](function(_0x2b5cf7){if(_0x2b5cf7[_0x89c7('0x3a')]>=0x1){var _0x19f9bb={'messageId':_0x2b5cf7[_0x89c7('0x3b')]};if(_0x21daa0['smsMethod']!=='GP'||!_0x21daa0[_0x89c7('0x3c')]){_0x19f9bb[_0x89c7('0x3d')]=!![];}return _0x3573a9[_0x89c7('0x1b')](_0x19f9bb);}else{return logger[_0x89c7('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x89c7('0x2c'),_0x89c7('0x2e'),util[_0x89c7('0x3e')](_0x2b5cf7,{'showHidden':![],'depth':null}));}})[_0x89c7('0x2b')](function(_0x3ca9b1){return logger[_0x89c7('0x1d')](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x2e'),util[_0x89c7('0x3e')](_0x3ca9b1,{'showHidden':![],'depth':null}));});}else{logger[_0x89c7('0x1d')](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x2e'),_0x89c7('0x3f'));}break;case _0x89c7('0x40'):if(_0x21daa0['authToken']){var _0x28ad9e={'recipient':_0x319bf1[_0x89c7('0x24')],'message':_0x319bf1[_0x89c7('0xe')],'sender':_0x21daa0[_0x89c7('0x41')]||_0x21daa0[_0x89c7('0x24')],'authorization':_0x21daa0[_0x89c7('0x25')]};var _0x216174={'method':_0x89c7('0x38'),'uri':_0x89c7('0x42'),'body':_0x28ad9e,'json':!![]};rp(_0x216174)[_0x89c7('0x1a')](function(_0x432200){var _0x1d2019={'messageId':_0x432200[_0x89c7('0x43')]};if(!_0x21daa0[_0x89c7('0x3c')]){_0x1d2019[_0x89c7('0x3d')]=!![];}return _0x3573a9[_0x89c7('0x1b')](_0x1d2019);})['catch'](function(_0x5d3163){logger['error'](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x40'),util[_0x89c7('0x3e')](_0x5d3163,{'showHidden':![],'depth':null}));});}else{logger[_0x89c7('0x1d')](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x40'),_0x89c7('0x44'));}break;case _0x89c7('0x45'):if(_0x21daa0[_0x89c7('0x34')]&&_0x21daa0[_0x89c7('0x30')]){var _0x28ad9e={'messages':[{'source':_0x89c7('0x46'),'to':_0x319bf1['phone'],'body':_0x319bf1['body'],'from':_0x21daa0[_0x89c7('0x41')]||_0x21daa0[_0x89c7('0x24')]}]};var _0x5865ea=util[_0x89c7('0x47')](_0x89c7('0x48'),_0x21daa0[_0x89c7('0x34')],_0x21daa0['password']);var _0x216174={'method':_0x89c7('0x38'),'uri':_0x89c7('0x49'),'body':_0x28ad9e,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x5865ea)['toString'](_0x89c7('0x4a')))},'json':!![]};rp(_0x216174)[_0x89c7('0x1a')](function(_0x2285d3){if(_0x2285d3[_0x89c7('0x4b')]>=0xc8&&_0x2285d3[_0x89c7('0x4b')]<=0xce){if(_0x2285d3[_0x89c7('0x4c')]&&_0x2285d3['data'][_0x89c7('0x4d')]>0x0){var _0xca1239=_[_0x89c7('0x4e')](_0x2285d3['data']['messages']);var _0x31d1fc={'messageId':_0xca1239['message_id']};if(!_0x21daa0['deliveryReport']){_0x31d1fc['read']=!![];}return _0x3573a9[_0x89c7('0x1b')](_0x31d1fc);}else{logger[_0x89c7('0x1d')](_0x89c7('0x2d'),'afterCreate','clickSend',util[_0x89c7('0x3e')](_0x2285d3,{'showHidden':![],'depth':null}));}}else{logger[_0x89c7('0x1d')](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x4f'),util[_0x89c7('0x3e')](_0x2285d3,{'showHidden':![],'depth':null}));}})[_0x89c7('0x2b')](function(_0x35d232){logger[_0x89c7('0x1d')](_0x89c7('0x2d'),_0x89c7('0x2c'),'clickSend',util[_0x89c7('0x3e')](_0x35d232,{'showHidden':![],'depth':null}));});}else{logger[_0x89c7('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x89c7('0x2c'),_0x89c7('0x4f'),_0x89c7('0x3f'));}break;case _0x89c7('0x50'):if(_0x21daa0[_0x89c7('0x51')]&&_0x21daa0[_0x89c7('0x25')]){var _0x28ad9e={'dst':_0x319bf1['phone'],'text':_0x319bf1[_0x89c7('0xe')],'src':_0x21daa0[_0x89c7('0x41')]||_0x21daa0[_0x89c7('0x24')],'url':_0x21daa0['remote']+_0x89c7('0x27')+_0x319bf1['id']+'/status?token='+_0x21daa0[_0x89c7('0x29')]};var _0x5865ea=util[_0x89c7('0x47')]('%s:%s',_0x21daa0[_0x89c7('0x51')],_0x21daa0[_0x89c7('0x25')]);var _0x216174={'method':_0x89c7('0x38'),'uri':util[_0x89c7('0x47')](_0x89c7('0x52'),_0x21daa0[_0x89c7('0x51')]),'body':_0x28ad9e,'headers':{'Authorization':util[_0x89c7('0x47')](_0x89c7('0x53'),new Buffer(_0x5865ea)[_0x89c7('0x54')](_0x89c7('0x4a')))},'json':!![]};rp(_0x216174)['then'](function(_0x234cce){var _0x6c244={'messageId':_0x234cce['message_uuid'][0x0]};return _0x3573a9['update'](_0x6c244);})[_0x89c7('0x2b')](function(_0x3c4c55){logger[_0x89c7('0x1d')](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x50'),util['inspect'](_0x3c4c55,{'showHidden':![],'depth':null}));});}else{logger[_0x89c7('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x89c7('0x2c'),'plivo',_0x89c7('0x55'));}break;case _0x89c7('0x56'):if(_0x21daa0[_0x89c7('0x34')]&&_0x21daa0[_0x89c7('0x30')]){if(_0x21daa0[_0x89c7('0x57')]){var _0xcde2a6={'method':_0x89c7('0x38'),'uri':_0x21daa0[_0x89c7('0x57')]+_0x89c7('0x58'),'body':{'username':_0x21daa0[_0x89c7('0x34')],'password':_0x21daa0[_0x89c7('0x30')]},'json':!![]};return rp(_0xcde2a6)[_0x89c7('0x1a')](function(_0x510d4d){var _0x1152fd={'method':_0x89c7('0x38'),'uri':_0x21daa0['baseUrl']+_0x89c7('0x59'),'body':{'messages':[{'from':_0x21daa0[_0x89c7('0x24')],'destinations':[{'to':_0x319bf1[_0x89c7('0x24')]}],'text':_0x319bf1[_0x89c7('0xe')],'notifyUrl':_0x21daa0[_0x89c7('0x5a')]+_0x89c7('0x27')+_0x319bf1['id']+'/status?token='+_0x21daa0[_0x89c7('0x29')],'notifyContentType':_0x89c7('0x5b'),'callbackData':_0x21daa0[_0x89c7('0x24')]+';'+_0x319bf1['body']}]},'headers':{'Authorization':_0x89c7('0x5c')+_0x510d4d[_0x89c7('0x29')]},'json':!![]};return rp(_0x1152fd)[_0x89c7('0x1a')](function(_0x3384bd){if(_0x3384bd[_0x89c7('0x26')]){var _0x19ad71={'messageId':_0x3384bd[_0x89c7('0x26')][0x0][_0x89c7('0xd')]};if(!_0x21daa0[_0x89c7('0x3c')]){_0x19ad71[_0x89c7('0x3d')]=!![];}return _0x3573a9[_0x89c7('0x1b')](_0x19ad71);}else{return logger[_0x89c7('0x1d')](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x56'),util[_0x89c7('0x3e')](_0x3384bd,{'showHidden':![],'depth':null}));}});})[_0x89c7('0x2b')](function(_0x7282dc){return logger[_0x89c7('0x1d')](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x56'),util[_0x89c7('0x3e')](_0x7282dc,{'showHidden':![],'depth':null}));});}else{logger[_0x89c7('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x89c7('0x2c'),_0x89c7('0x56'),_0x89c7('0x5d'));}}else{logger[_0x89c7('0x1d')](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x56'),_0x89c7('0x3f'));}break;case _0x89c7('0x5e'):var _0x3eecb9=require(_0x89c7('0x5f'));if(_0x21daa0[_0x89c7('0x60')]){var _0x40bf02={};_0x40bf02[_0x89c7('0x61')]=_0x21daa0['username'];_0x40bf02['phone']=_0x319bf1[_0x89c7('0x24')];_0x40bf02['sender']=_0x21daa0[_0x89c7('0x24')];_0x40bf02['text']=_0x319bf1[_0x89c7('0xe')];_0x40bf02[_0x89c7('0x62')]=+new Date();var _0x49921d='';var _0x4fd2fa='';var _0x5b5e82=Object[_0x89c7('0x63')](_0x40bf02);_0x5b5e82['sort']();for(var _0x10ab93=0x0;_0x10ab93<_0x5b5e82[_0x89c7('0x64')];_0x10ab93++){if(_0x49921d!=''){_0x49921d+='&';}_0x49921d+=_0x5b5e82[_0x10ab93]+'='+encodeURIComponent(_0x40bf02[_0x5b5e82[_0x10ab93]]);_0x4fd2fa+=_0x40bf02[_0x5b5e82[_0x10ab93]];}_0x4fd2fa+=_0x21daa0['apiKey'];_0x4fd2fa=_0x3eecb9[_0x89c7('0x65')](_0x89c7('0x66'))[_0x89c7('0x1b')](_0x4fd2fa)[_0x89c7('0x67')](_0x89c7('0x68'));if(_0x49921d!==''){_0x49921d+='&';}_0x49921d+=_0x89c7('0x69')+_0x4fd2fa;var _0x4c1417={'method':_0x89c7('0x36'),'uri':_0x21daa0[_0x89c7('0x57')]+_0x89c7('0x6a')+_0x49921d,'json':!![]};return rp(_0x4c1417)[_0x89c7('0x1a')](function(_0x189ce2){var _0x1497a1=Object['keys'](_0x189ce2);if(_0x189ce2[_0x1497a1[0x0]]['error']&&parseInt(_0x189ce2[_0x1497a1[0x0]]['error'])===0x0){var _0x11ad84={'messageId':_0x189ce2[_0x1497a1[0x0]]['id_sms']};if(!_0x21daa0['deliveryReport']){_0x11ad84['read']=!![];}return _0x3573a9[_0x89c7('0x1b')](_0x11ad84);}else{return logger[_0x89c7('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x89c7('0x2c'),'csc',util['inspect'](_0x189ce2['error'],{'showHidden':![],'depth':null}));}})[_0x89c7('0x2b')](function(_0x370734){return logger[_0x89c7('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x89c7('0x2c'),_0x89c7('0x5e'),util[_0x89c7('0x3e')](_0x370734,{'showHidden':![],'depth':null}));});}else{logger[_0x89c7('0x1d')](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x5e'),_0x89c7('0x6b'));}break;case'clickatell':if(_0x21daa0[_0x89c7('0x60')]){var _0x5e0575={'method':_0x89c7('0x38'),'uri':_0x89c7('0x6c'),'headers':{'Authorization':_0x21daa0['apiKey']},'body':{'content':_0x319bf1[_0x89c7('0xe')],'to':[_0x319bf1[_0x89c7('0x24')]],'from':_0x21daa0[_0x89c7('0x24')],'binary':![],'clientMessageId':'uuid','charset':_0x89c7('0x6d')},'json':!![]};rp(_0x5e0575)[_0x89c7('0x1a')](function(_0x385308){if(!_0x385308[_0x89c7('0x1d')]){var _0x49743e={'messageId':_0x385308[_0x89c7('0x26')][0x0][_0x89c7('0x6e')]};if(!_0x21daa0[_0x89c7('0x3c')]){_0x49743e[_0x89c7('0x3d')]=!![];}return _0x3573a9[_0x89c7('0x1b')](_0x49743e);}else{return logger['error'](_0x89c7('0x2d'),_0x89c7('0x2c'),'clickatell',util[_0x89c7('0x3e')](_0x385308[_0x89c7('0x1d')],{'showHidden':![],'depth':null}));}})[_0x89c7('0x2b')](function(_0x495003){return logger[_0x89c7('0x1d')](_0x89c7('0x2d'),'afterCreate',_0x89c7('0x6f'),util[_0x89c7('0x3e')](_0x495003,{'showHidden':![],'depth':null}));});}else{logger[_0x89c7('0x1d')](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x6f'),_0x89c7('0x6b'));}break;case _0x89c7('0x70'):if(_0x21daa0[_0x89c7('0x60')]){var _0x21ae5e={};var _0x4c1417={'method':_0x89c7('0x38'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x89c7('0x71')+_0x21daa0[_0x89c7('0x60')],'Content-Type':'application/json'},'body':{'from':_0x21daa0['phone'],'to':_0x319bf1['phone'],'text':_0x319bf1[_0x89c7('0xe')]},'json':!![]};return rp(_0x4c1417)[_0x89c7('0x1a')](function(_0x51d435){if(_0x51d435[_0x89c7('0x72')]==0xca){_0x21ae5e[_0x89c7('0x73')]=_0x51d435;var _0x1c8ed2={'method':_0x89c7('0x38'),'uri':_0x89c7('0x74'),'headers':{'Authorization':'Bearer\x20'+_0x21daa0['apiKey'],'Content-Type':'application/json'},'body':{'refid':_0x21ae5e['message'][_0x89c7('0x75')]},'json':!![]};return rp(_0x1c8ed2)[_0x89c7('0x1a')](function(_0x1d1ed1){_0x21ae5e[_0x89c7('0x76')]=_0x1d1ed1;var _0x14bce1={'messageId':_0x21ae5e['message'][_0x89c7('0x75')],'read':!![]};return _0x3573a9['update'](_0x14bce1);});}else{return logger['error'](_0x89c7('0x2d'),_0x89c7('0x2c'),_0x89c7('0x70'),util[_0x89c7('0x3e')](_0x51d435,{'showHidden':![],'depth':null}));}})[_0x89c7('0x2b')](function(_0x1f2e7a){return logger['error'](_0x89c7('0x2d'),_0x89c7('0x2c'),'intelepeer',util[_0x89c7('0x3e')](_0x1f2e7a,{'showHidden':![],'depth':null}));});}else{return logger[_0x89c7('0x1d')](_0x89c7('0x2d'),'afterCreate',_0x89c7('0x70'),_0x89c7('0x77'));}break;}}})[_0x89c7('0x78')](function(){_0x33e2c0();});}else{_0x33e2c0();}}},'charset':_0x89c7('0x79'),'collate':_0x89c7('0x7a')});}; \ No newline at end of file +var _0x001c=['split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','toString','http_code','queued_count','head','data','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','Missing\x20parameters:\x20base_url','csc','apiKey','text','timestamp','keys','sort','length','createHash','md5','hex','signature=','/external/get/send.php?','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','intelepeer','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','direction','out','isNil','UserId','SmsInteraction','SmsInteractionId','then','update','toLowerCase','catch','SmsAccount','find','SmsAccountId','type','twilio','authToken','messages','create','phone','remote','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','username','password','smsMethod','sender','login?username=','&password=','GET'];(function(_0x335c2d,_0x1a26f6){var _0x11afee=function(_0x5e4553){while(--_0x5e4553){_0x335c2d['push'](_0x335c2d['shift']());}};_0x11afee(++_0x1a26f6);}(_0x001c,0x12c));var _0xc001=function(_0x50f724,_0x5aa22b){_0x50f724=_0x50f724-0x0;var _0x1a9cf2=_0x001c[_0x50f724];return _0x1a9cf2;};'use strict';var _=require(_0xc001('0x0'));var util=require(_0xc001('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc001('0x2'));var BPromise=require(_0xc001('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc001('0x4'));var rimraf=require(_0xc001('0x5'));var config=require(_0xc001('0x6'));var attributes=require(_0xc001('0x7'));module[_0xc001('0x8')]=function(_0x2c6470,_0x3b5d1c){return _0x2c6470[_0xc001('0x9')](_0xc001('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0xc001('0xb')]},{'name':_0xc001('0xc'),'fields':[_0xc001('0xd')],'type':_0xc001('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51ae52,_0xa07f75,_0x1f212a){var _0x15f0a7=_0x2c6470[_0xc001('0xf')];var _0x139805=_0x51ae52['get']({'plain':!![]});if(_0x139805[_0xc001('0x10')]['toLowerCase']()==='in'||_0x139805['direction']['toLowerCase']()===_0xc001('0x11')&&!_0x139805['secret']&&!_[_0xc001('0x12')](_0x139805[_0xc001('0x13')])){_0x15f0a7[_0xc001('0x14')]['findOne']({'where':{'id':_0x139805[_0xc001('0x15')]}})[_0xc001('0x16')](function(_0x5bc88a){if(_0x5bc88a){_0x5bc88a[_0xc001('0x17')]({'lastMsgAt':_0x139805['createdAt'],'lastMsgDirection':_0x139805[_0xc001('0x10')][_0xc001('0x18')]()});}})[_0xc001('0x19')](function(_0x4c6e08){console['error'](_0x4c6e08);});}if(_0x139805[_0xc001('0x10')]==='out'&&!_0x139805['secret']){var _0x2b220f;_0x15f0a7[_0xc001('0x1a')][_0xc001('0x1b')]({'where':{'id':_0x139805[_0xc001('0x1c')]},'raw':!![]})[_0xc001('0x16')](function(_0x5a2e79){_0x2b220f=_0x5a2e79;if(_0x2b220f&&_0x2b220f[_0xc001('0x1d')]){switch(_0x2b220f[_0xc001('0x1d')]){case _0xc001('0x1e'):var _0xcc7c5d=require('twilio');if(_0x2b220f['accountSid']&&_0x2b220f[_0xc001('0x1f')]&&_0x2b220f['phone']){var _0x3e39bc=new _0xcc7c5d(_0x2b220f['accountSid'],_0x2b220f[_0xc001('0x1f')]);_0x3e39bc[_0xc001('0x20')][_0xc001('0x21')]({'body':_0x139805[_0xc001('0xd')],'to':_0x139805['phone'],'from':_0x2b220f[_0xc001('0x22')],'statusCallback':_0x2b220f[_0xc001('0x23')]+_0xc001('0x24')+_0x139805['id']+_0xc001('0x25')+_0x2b220f[_0xc001('0x26')]})['then'](function(_0x337696){if(_0x337696[_0xc001('0x27')]){return _0x51ae52['update']({'messageId':_0x337696[_0xc001('0x27')]});}})[_0xc001('0x19')](function(_0x16b281){logger[_0xc001('0x28')](_0xc001('0x29'),_0xc001('0x2a'),'twilio',util['inspect'](_0x16b281,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc001('0x29'),_0xc001('0x2a'),_0xc001('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xc001('0x2b'):var _0x38e54e='https://api.skebby.it/API/v1.0/REST/';if(_0x2b220f[_0xc001('0x2c')]&&_0x2b220f[_0xc001('0x2d')]){var _0x592d03={'recipient':[_0x139805[_0xc001('0x22')]],'message':_0x139805[_0xc001('0xd')],'message_type':_0x2b220f[_0xc001('0x2e')]};if(_0x2b220f[_0xc001('0x2e')]&&_0x2b220f['smsMethod']!=='SI'){_0x592d03[_0xc001('0x2f')]=_0x2b220f[_0xc001('0x22')];}var _0x57f9ad={'url':_0x38e54e+_0xc001('0x30')+_0x2b220f['username']+_0xc001('0x31')+_0x2b220f[_0xc001('0x2d')],'method':_0xc001('0x32')};rp(_0x57f9ad)['then'](function(_0x491511){var _0x3471dd=_0x491511[_0xc001('0x33')](';');var _0x2f440f={'user_key':_0x3471dd[0x0],'session_key':_0x3471dd[0x1]};_0x57f9ad={'url':_0x38e54e+_0xc001('0x34'),'method':_0xc001('0x35'),'headers':{'user_key':_0x2f440f[_0xc001('0x36')],'Session_key':_0x2f440f[_0xc001('0x37')]},'json':!![],'body':_0x592d03};return rp(_0x57f9ad);})[_0xc001('0x16')](function(_0x4fb3e7){if(_0x4fb3e7[_0xc001('0x38')]>=0x1){var _0x575e48={'messageId':_0x4fb3e7[_0xc001('0x39')]};if(_0x2b220f[_0xc001('0x2e')]!=='GP'||!_0x2b220f[_0xc001('0x3a')]){_0x575e48[_0xc001('0x3b')]=!![];}return _0x51ae52[_0xc001('0x17')](_0x575e48);}else{return logger[_0xc001('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc001('0x2a'),_0xc001('0x2b'),util['inspect'](_0x4fb3e7,{'showHidden':![],'depth':null}));}})[_0xc001('0x19')](function(_0x544dc2){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc001('0x2a'),_0xc001('0x2b'),util[_0xc001('0x3c')](_0x544dc2,{'showHidden':![],'depth':null}));});}else{logger[_0xc001('0x28')](_0xc001('0x29'),_0xc001('0x2a'),_0xc001('0x2b'),_0xc001('0x3d'));}break;case _0xc001('0x3e'):if(_0x2b220f[_0xc001('0x1f')]){var _0x36dd83={'recipient':_0x139805[_0xc001('0x22')],'message':_0x139805['body'],'sender':_0x2b220f[_0xc001('0x3f')]||_0x2b220f[_0xc001('0x22')],'authorization':_0x2b220f[_0xc001('0x1f')]};var _0xa07f75={'method':_0xc001('0x35'),'uri':_0xc001('0x40'),'body':_0x36dd83,'json':!![]};rp(_0xa07f75)['then'](function(_0x4b1ccb){var _0x4e675c={'messageId':_0x4b1ccb['requestid']};if(!_0x2b220f[_0xc001('0x3a')]){_0x4e675c[_0xc001('0x3b')]=!![];}return _0x51ae52[_0xc001('0x17')](_0x4e675c);})['catch'](function(_0x10b4ea){logger['error'](_0xc001('0x29'),_0xc001('0x2a'),_0xc001('0x3e'),util[_0xc001('0x3c')](_0x10b4ea,{'showHidden':![],'depth':null}));});}else{logger[_0xc001('0x28')](_0xc001('0x29'),_0xc001('0x2a'),_0xc001('0x3e'),_0xc001('0x41'));}break;case _0xc001('0x42'):if(_0x2b220f[_0xc001('0x2c')]&&_0x2b220f[_0xc001('0x2d')]){var _0x36dd83={'messages':[{'source':_0xc001('0x43'),'to':_0x139805['phone'],'body':_0x139805[_0xc001('0xd')],'from':_0x2b220f['senderString']||_0x2b220f[_0xc001('0x22')]}]};var _0x5e07af=util[_0xc001('0x44')](_0xc001('0x45'),_0x2b220f[_0xc001('0x2c')],_0x2b220f[_0xc001('0x2d')]);var _0xa07f75={'method':_0xc001('0x35'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x36dd83,'headers':{'Authorization':util[_0xc001('0x44')](_0xc001('0x46'),new Buffer(_0x5e07af)[_0xc001('0x47')]('base64'))},'json':!![]};rp(_0xa07f75)['then'](function(_0x5588ed){if(_0x5588ed[_0xc001('0x48')]>=0xc8&&_0x5588ed[_0xc001('0x48')]<=0xce){if(_0x5588ed['data']&&_0x5588ed['data'][_0xc001('0x49')]>0x0){var _0x4561eb=_[_0xc001('0x4a')](_0x5588ed[_0xc001('0x4b')][_0xc001('0x20')]);var _0x44698d={'messageId':_0x4561eb[_0xc001('0x4c')]};if(!_0x2b220f[_0xc001('0x3a')]){_0x44698d[_0xc001('0x3b')]=!![];}return _0x51ae52[_0xc001('0x17')](_0x44698d);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc001('0x2a'),'clickSend',util[_0xc001('0x3c')](_0x5588ed,{'showHidden':![],'depth':null}));}}else{logger[_0xc001('0x28')](_0xc001('0x29'),_0xc001('0x2a'),'clickSend',util[_0xc001('0x3c')](_0x5588ed,{'showHidden':![],'depth':null}));}})[_0xc001('0x19')](function(_0x3d8d3e){logger[_0xc001('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc001('0x2a'),_0xc001('0x4d'),util[_0xc001('0x3c')](_0x3d8d3e,{'showHidden':![],'depth':null}));});}else{logger[_0xc001('0x28')](_0xc001('0x29'),'afterCreate',_0xc001('0x4d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xc001('0x4e'):if(_0x2b220f[_0xc001('0x4f')]&&_0x2b220f['authToken']){var _0x36dd83={'dst':_0x139805[_0xc001('0x22')],'text':_0x139805[_0xc001('0xd')],'src':_0x2b220f[_0xc001('0x3f')]||_0x2b220f[_0xc001('0x22')],'url':_0x2b220f[_0xc001('0x23')]+'/api/sms/messages/'+_0x139805['id']+_0xc001('0x25')+_0x2b220f[_0xc001('0x26')]};var _0x5e07af=util['format'](_0xc001('0x45'),_0x2b220f[_0xc001('0x4f')],_0x2b220f['authToken']);var _0xa07f75={'method':_0xc001('0x35'),'uri':util['format'](_0xc001('0x50'),_0x2b220f[_0xc001('0x4f')]),'body':_0x36dd83,'headers':{'Authorization':util['format'](_0xc001('0x46'),new Buffer(_0x5e07af)['toString'](_0xc001('0x51')))},'json':!![]};rp(_0xa07f75)[_0xc001('0x16')](function(_0x5edbff){var _0x50d31c={'messageId':_0x5edbff[_0xc001('0x52')][0x0]};return _0x51ae52[_0xc001('0x17')](_0x50d31c);})[_0xc001('0x19')](function(_0xeb28cb){logger[_0xc001('0x28')](_0xc001('0x29'),_0xc001('0x2a'),_0xc001('0x4e'),util[_0xc001('0x3c')](_0xeb28cb,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc001('0x29'),'afterCreate','plivo',_0xc001('0x53'));}break;case _0xc001('0x54'):if(_0x2b220f['username']&&_0x2b220f[_0xc001('0x2d')]){if(_0x2b220f['baseUrl']){var _0x5a40d6={'method':_0xc001('0x35'),'uri':_0x2b220f[_0xc001('0x55')]+_0xc001('0x56'),'body':{'username':_0x2b220f[_0xc001('0x2c')],'password':_0x2b220f['password']},'json':!![]};return rp(_0x5a40d6)[_0xc001('0x16')](function(_0x477a9c){var _0x9d4ed7={'method':_0xc001('0x35'),'uri':_0x2b220f[_0xc001('0x55')]+_0xc001('0x57'),'body':{'messages':[{'from':_0x2b220f[_0xc001('0x22')],'destinations':[{'to':_0x139805[_0xc001('0x22')]}],'text':_0x139805[_0xc001('0xd')],'notifyUrl':_0x2b220f[_0xc001('0x23')]+_0xc001('0x24')+_0x139805['id']+_0xc001('0x25')+_0x2b220f[_0xc001('0x26')],'notifyContentType':_0xc001('0x58'),'callbackData':_0x2b220f['phone']+';'+_0x139805[_0xc001('0xd')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x477a9c[_0xc001('0x26')]},'json':!![]};return rp(_0x9d4ed7)[_0xc001('0x16')](function(_0x355d23){if(_0x355d23[_0xc001('0x20')]){var _0x59c78a={'messageId':_0x355d23[_0xc001('0x20')][0x0][_0xc001('0xb')]};if(!_0x2b220f[_0xc001('0x3a')]){_0x59c78a[_0xc001('0x3b')]=!![];}return _0x51ae52[_0xc001('0x17')](_0x59c78a);}else{return logger[_0xc001('0x28')](_0xc001('0x29'),_0xc001('0x2a'),_0xc001('0x54'),util['inspect'](_0x355d23,{'showHidden':![],'depth':null}));}});})[_0xc001('0x19')](function(_0x49fc07){return logger[_0xc001('0x28')](_0xc001('0x29'),_0xc001('0x2a'),'infobip',util['inspect'](_0x49fc07,{'showHidden':![],'depth':null}));});}else{logger[_0xc001('0x28')](_0xc001('0x29'),'afterCreate',_0xc001('0x54'),_0xc001('0x59'));}}else{logger[_0xc001('0x28')](_0xc001('0x29'),_0xc001('0x2a'),'infobip',_0xc001('0x3d'));}break;case _0xc001('0x5a'):var _0x1a47d5=require('crypto');if(_0x2b220f[_0xc001('0x5b')]){var _0x40bdc2={};_0x40bdc2['login']=_0x2b220f[_0xc001('0x2c')];_0x40bdc2[_0xc001('0x22')]=_0x139805[_0xc001('0x22')];_0x40bdc2[_0xc001('0x2f')]=_0x2b220f[_0xc001('0x22')];_0x40bdc2[_0xc001('0x5c')]=_0x139805[_0xc001('0xd')];_0x40bdc2[_0xc001('0x5d')]=+new Date();var _0x3d0eaa='';var _0xfa3a26='';var _0x46d26e=Object[_0xc001('0x5e')](_0x40bdc2);_0x46d26e[_0xc001('0x5f')]();for(var _0x48ef70=0x0;_0x48ef70<_0x46d26e[_0xc001('0x60')];_0x48ef70++){if(_0x3d0eaa!=''){_0x3d0eaa+='&';}_0x3d0eaa+=_0x46d26e[_0x48ef70]+'='+encodeURIComponent(_0x40bdc2[_0x46d26e[_0x48ef70]]);_0xfa3a26+=_0x40bdc2[_0x46d26e[_0x48ef70]];}_0xfa3a26+=_0x2b220f[_0xc001('0x5b')];_0xfa3a26=_0x1a47d5[_0xc001('0x61')](_0xc001('0x62'))[_0xc001('0x17')](_0xfa3a26)['digest'](_0xc001('0x63'));if(_0x3d0eaa!==''){_0x3d0eaa+='&';}_0x3d0eaa+=_0xc001('0x64')+_0xfa3a26;var _0x57f9ad={'method':_0xc001('0x32'),'uri':_0x2b220f[_0xc001('0x55')]+_0xc001('0x65')+_0x3d0eaa,'json':!![]};return rp(_0x57f9ad)[_0xc001('0x16')](function(_0x3e69e4){var _0xd04a9e=Object[_0xc001('0x5e')](_0x3e69e4);if(_0x3e69e4[_0xd04a9e[0x0]][_0xc001('0x28')]&&parseInt(_0x3e69e4[_0xd04a9e[0x0]][_0xc001('0x28')])===0x0){var _0x4349aa={'messageId':_0x3e69e4[_0xd04a9e[0x0]]['id_sms']};if(!_0x2b220f[_0xc001('0x3a')]){_0x4349aa[_0xc001('0x3b')]=!![];}return _0x51ae52['update'](_0x4349aa);}else{return logger[_0xc001('0x28')](_0xc001('0x29'),_0xc001('0x2a'),_0xc001('0x5a'),util[_0xc001('0x3c')](_0x3e69e4['error'],{'showHidden':![],'depth':null}));}})[_0xc001('0x19')](function(_0x428624){return logger['error'](_0xc001('0x29'),_0xc001('0x2a'),_0xc001('0x5a'),util[_0xc001('0x3c')](_0x428624,{'showHidden':![],'depth':null}));});}else{logger[_0xc001('0x28')](_0xc001('0x29'),_0xc001('0x2a'),_0xc001('0x5a'),_0xc001('0x66'));}break;case'clickatell':if(_0x2b220f[_0xc001('0x5b')]){var _0x4d2105={'method':_0xc001('0x35'),'uri':_0xc001('0x67'),'headers':{'Authorization':_0x2b220f[_0xc001('0x5b')]},'body':{'content':_0x139805[_0xc001('0xd')],'to':[_0x139805[_0xc001('0x22')]],'from':_0x2b220f[_0xc001('0x22')],'binary':![],'clientMessageId':_0xc001('0x68'),'charset':_0xc001('0x69')},'json':!![]};rp(_0x4d2105)['then'](function(_0x347a9a){if(!_0x347a9a[_0xc001('0x28')]){var _0x4ea03b={'messageId':_0x347a9a[_0xc001('0x20')][0x0][_0xc001('0x6a')]};if(!_0x2b220f[_0xc001('0x3a')]){_0x4ea03b[_0xc001('0x3b')]=!![];}return _0x51ae52[_0xc001('0x17')](_0x4ea03b);}else{return logger[_0xc001('0x28')](_0xc001('0x29'),'afterCreate',_0xc001('0x6b'),util[_0xc001('0x3c')](_0x347a9a[_0xc001('0x28')],{'showHidden':![],'depth':null}));}})[_0xc001('0x19')](function(_0x5b7893){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc001('0x6b'),util[_0xc001('0x3c')](_0x5b7893,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xc001('0x29'),_0xc001('0x2a'),_0xc001('0x6b'),'Missing\x20parameters:\x20apiKey');}break;case _0xc001('0x6c'):if(_0x2b220f[_0xc001('0x5b')]){var _0x4a70ac={};var _0x57f9ad={'method':_0xc001('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xc001('0x6d')+_0x2b220f['apiKey'],'Content-Type':_0xc001('0x58')},'body':{'from':_0x2b220f[_0xc001('0x22')],'to':_0x139805[_0xc001('0x22')],'text':_0x139805[_0xc001('0xd')]},'json':!![]};return rp(_0x57f9ad)['then'](function(_0x5e7d21){if(_0x5e7d21['code']==0xca){_0x4a70ac[_0xc001('0x6e')]=_0x5e7d21;var _0x47c9f0={'method':_0xc001('0x35'),'uri':_0xc001('0x6f'),'headers':{'Authorization':_0xc001('0x6d')+_0x2b220f['apiKey'],'Content-Type':_0xc001('0x58')},'body':{'refid':_0x4a70ac[_0xc001('0x6e')][_0xc001('0x70')]},'json':!![]};return rp(_0x47c9f0)['then'](function(_0x332ad3){_0x4a70ac[_0xc001('0x71')]=_0x332ad3;var _0x41d216={'messageId':_0x4a70ac[_0xc001('0x6e')]['refid'],'read':!![]};return _0x51ae52[_0xc001('0x17')](_0x41d216);});}else{return logger[_0xc001('0x28')](_0xc001('0x29'),'afterCreate',_0xc001('0x6c'),util[_0xc001('0x3c')](_0x5e7d21,{'showHidden':![],'depth':null}));}})[_0xc001('0x19')](function(_0xe6b2da){return logger[_0xc001('0x28')](_0xc001('0x29'),_0xc001('0x2a'),_0xc001('0x6c'),util['inspect'](_0xe6b2da,{'showHidden':![],'depth':null}));});}else{return logger[_0xc001('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc001('0x2a'),_0xc001('0x6c'),'Token\x20not\x20received');}break;}}})[_0xc001('0x72')](function(){_0x1f212a();});}else{_0x1f212a();}}},'charset':_0xc001('0x73'),'collate':_0xc001('0x74')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 142dd72..3f3db59 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 _0x5eb8=['client','http','defaults','redis','localhost','register','request','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','SmsMessage,\x20%s,\x20%s','message','result','catch','options','raw','then','stringify','CreateSmsMessage','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x325e10,_0x49c40b){var _0xfd198=function(_0x1e1603){while(--_0x1e1603){_0x325e10['push'](_0x325e10['shift']());}};_0xfd198(++_0x49c40b);}(_0x5eb8,0xb0));var _0x85eb=function(_0x151334,_0x1e11ac){_0x151334=_0x151334-0x0;var _0x3d03da=_0x5eb8[_0x151334];return _0x3d03da;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});config['redis']=_[_0x85eb('0xc')](config[_0x85eb('0xd')],{'host':_0x85eb('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85eb('0xd')]));require('./smsMessage.socket')[_0x85eb('0xf')](socket);function respondWithRpcPromise(_0x40d6b6,_0x673228,_0x29030b){return new BPromise(function(_0x1dacf2,_0x73e6d0){return client[_0x85eb('0x10')](_0x40d6b6,_0x29030b)['then'](function(_0x163f32){logger[_0x85eb('0x11')]('SmsMessage,\x20%s,\x20%s',_0x673228,_0x85eb('0x12'));logger[_0x85eb('0x13')](_0x85eb('0x14'),_0x673228,_0x85eb('0x12'),JSON['stringify'](_0x163f32));if(_0x163f32['error']){if(_0x163f32[_0x85eb('0x15')]['code']===0x1f4){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x73e6d0(_0x163f32[_0x85eb('0x15')]['message']);}logger[_0x85eb('0x15')]('SmsMessage,\x20%s,\x20%s',_0x673228,_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);return _0x1dacf2(_0x163f32[_0x85eb('0x15')][_0x85eb('0x17')]);}else{logger['info']('SmsMessage,\x20%s,\x20%s',_0x673228,'request\x20sent');_0x1dacf2(_0x163f32[_0x85eb('0x18')][_0x85eb('0x17')]);}})[_0x85eb('0x19')](function(_0x2e986c){logger[_0x85eb('0x15')](_0x85eb('0x16'),_0x673228,_0x2e986c);_0x73e6d0(_0x2e986c);});});}exports['CreateSmsMessage']=function(_0x24cf28){var _0x7244fc=this;return new Promise(function(_0xd9f06d,_0x4e8041){return db['SmsMessage']['create'](_0x24cf28['body'],{'raw':_0x24cf28[_0x85eb('0x1a')]?_0x24cf28[_0x85eb('0x1a')][_0x85eb('0x1b')]===undefined?!![]:![]:!![]})[_0x85eb('0x1c')](function(_0x465c74){logger[_0x85eb('0x11')]('CreateSmsMessage',_0x24cf28);logger['debug']('CreateSmsMessage',_0x24cf28,JSON[_0x85eb('0x1d')](_0x465c74));_0xd9f06d(_0x465c74);})[_0x85eb('0x19')](function(_0x3f7a4d){logger[_0x85eb('0x15')](_0x85eb('0x1e'),_0x3f7a4d[_0x85eb('0x17')],_0x24cf28);_0x4e8041(_0x7244fc['error'](0x1f4,_0x3f7a4d[_0x85eb('0x17')]));});});}; \ No newline at end of file +var _0xdb28=['then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSmsMessage','SmsMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request'];(function(_0x13f257,_0x3c3d67){var _0x455f37=function(_0x3471eb){while(--_0x3471eb){_0x13f257['push'](_0x13f257['shift']());}};_0x455f37(++_0x3c3d67);}(_0xdb28,0x106));var _0x8db2=function(_0x33287d,_0x22e9de){_0x33287d=_0x33287d-0x0;var _0x49cde4=_0xdb28[_0x33287d];return _0x49cde4;};'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});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('SmsMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateSmsMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateSmsMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 34d1748..7ac0146 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 _0xff2e=['removeListener','register','length','smsMessage:','save','remove','emit'];(function(_0x92a418,_0xb7558a){var _0x3eb3f1=function(_0x58e2a8){while(--_0x58e2a8){_0x92a418['push'](_0x92a418['shift']());}};_0x3eb3f1(++_0xb7558a);}(_0xff2e,0x6d));var _0xeff2=function(_0x5844d6,_0x43bb2b){_0x5844d6=_0x5844d6-0x0;var _0x2f1216=_0xff2e[_0x5844d6];return _0x2f1216;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xeff2('0x0'),_0xeff2('0x1'),'update'];function createListener(_0x3ed74b,_0xa05235){return function(_0x41dd78){_0xa05235[_0xeff2('0x2')](_0x3ed74b,_0x41dd78);};}function removeListener(_0x5b33de,_0x2234ba){return function(){SmsMessageEvents[_0xeff2('0x3')](_0x5b33de,_0x2234ba);};}exports[_0xeff2('0x4')]=function(_0x142dc6){for(var _0x402d8e=0x0,_0x547044=events[_0xeff2('0x5')];_0x402d8e<_0x547044;_0x402d8e++){var _0x555586=events[_0x402d8e];var _0xaf7af5=createListener(_0xeff2('0x6')+_0x555586,_0x142dc6);SmsMessageEvents['on'](_0x555586,_0xaf7af5);}}; \ No newline at end of file +var _0x4a9b=['register','length','smsMessage:','update','emit'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x4a9b,0x107));var _0xb4a9=function(_0x1f8349,_0x55db28){_0x1f8349=_0x1f8349-0x0;var _0x3d80ea=_0x4a9b[_0x1f8349];return _0x3d80ea;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save','remove',_0xb4a9('0x0')];function createListener(_0x58ee9a,_0x2b0ccb){return function(_0x5555b4){_0x2b0ccb[_0xb4a9('0x1')](_0x58ee9a,_0x5555b4);};}function removeListener(_0x3bbe36,_0xfe8bb2){return function(){SmsMessageEvents['removeListener'](_0x3bbe36,_0xfe8bb2);};}exports[_0xb4a9('0x2')]=function(_0x3f3c82){for(var _0x150242=0x0,_0x316b56=events[_0xb4a9('0x3')];_0x150242<_0x316b56;_0x150242++){var _0x3fa262=events[_0x150242];var _0x4cbac8=createListener(_0xb4a9('0x4')+_0x3fa262,_0x3f3c82);SmsMessageEvents['on'](_0x3fa262,_0x4cbac8);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 3b6a37a..3d5ad74 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 _0xc4aa=['index','/describe','describe','show','getMembers','getAgents','post','create','/:id/teams','addTeams','/:id/users','addAgents','put','/:id','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','./smsQueue.controller','get','isAuthenticated'];(function(_0x3d944c,_0x19cbab){var _0x4e5d59=function(_0x179492){while(--_0x179492){_0x3d944c['push'](_0x3d944c['shift']());}};_0x4e5d59(++_0x19cbab);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac4a('0x6'));router[_0xac4a('0x7')]('/',auth[_0xac4a('0x8')](),controller[_0xac4a('0x9')]);router[_0xac4a('0x7')](_0xac4a('0xa'),auth[_0xac4a('0x8')](),controller[_0xac4a('0xb')]);router['get']('/:id',auth[_0xac4a('0x8')](),controller[_0xac4a('0xc')]);router[_0xac4a('0x7')]('/:id/members',auth[_0xac4a('0x8')](),controller[_0xac4a('0xd')]);router[_0xac4a('0x7')]('/:id/teams',auth[_0xac4a('0x8')](),controller['getTeams']);router[_0xac4a('0x7')]('/:id/users',auth[_0xac4a('0x8')](),controller[_0xac4a('0xe')]);router[_0xac4a('0xf')]('/',auth['isAuthenticated'](),controller[_0xac4a('0x10')]);router[_0xac4a('0xf')](_0xac4a('0x11'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x12')]);router[_0xac4a('0xf')](_0xac4a('0x13'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x14')]);router[_0xac4a('0x15')](_0xac4a('0x16'),auth[_0xac4a('0x8')](),controller['update']);router[_0xac4a('0x17')](_0xac4a('0x16'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x18')]);router[_0xac4a('0x17')](_0xac4a('0x11'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x19')]);router['delete']('/:id/users',auth[_0xac4a('0x8')](),controller[_0xac4a('0x1a')]);module[_0xac4a('0x1b')]=router; \ No newline at end of file +var _0x6eed=['delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x6eed,0xff));var _0xd6ee=function(_0x3b8fd2,_0x144c2b){_0x3b8fd2=_0x3b8fd2-0x0;var _0x327780=_0x6eed[_0x3b8fd2];return _0x327780;};'use strict';var multer=require(_0xd6ee('0x0'));var util=require(_0xd6ee('0x1'));var path=require(_0xd6ee('0x2'));var timeout=require(_0xd6ee('0x3'));var express=require(_0xd6ee('0x4'));var router=express['Router']();var auth=require(_0xd6ee('0x5'));var interaction=require(_0xd6ee('0x6'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0xd6ee('0x7')]('/',auth[_0xd6ee('0x8')](),controller[_0xd6ee('0x9')]);router[_0xd6ee('0x7')](_0xd6ee('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xd6ee('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xd6ee('0x7')](_0xd6ee('0xb'),auth['isAuthenticated'](),controller[_0xd6ee('0xc')]);router[_0xd6ee('0x7')](_0xd6ee('0xd'),auth[_0xd6ee('0x8')](),controller['getTeams']);router[_0xd6ee('0x7')](_0xd6ee('0xe'),auth[_0xd6ee('0x8')](),controller[_0xd6ee('0xf')]);router[_0xd6ee('0x10')]('/',auth[_0xd6ee('0x8')](),controller['create']);router[_0xd6ee('0x10')](_0xd6ee('0xd'),auth['isAuthenticated'](),controller[_0xd6ee('0x11')]);router[_0xd6ee('0x10')](_0xd6ee('0xe'),auth[_0xd6ee('0x8')](),controller[_0xd6ee('0x12')]);router[_0xd6ee('0x13')]('/:id',auth[_0xd6ee('0x8')](),controller[_0xd6ee('0x14')]);router[_0xd6ee('0x15')]('/:id',auth[_0xd6ee('0x8')](),controller['destroy']);router[_0xd6ee('0x15')](_0xd6ee('0xd'),auth[_0xd6ee('0x8')](),controller['removeTeams']);router[_0xd6ee('0x15')]('/:id/users',auth[_0xd6ee('0x8')](),controller['removeAgents']);module[_0xd6ee('0x16')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 51f6b75..ac37d7c 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 _0x2045=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x32858f,_0x1fa5eb){var _0x456750=function(_0x18c25f){while(--_0x18c25f){_0x32858f['push'](_0x32858f['shift']());}};_0x456750(++_0x1fa5eb);}(_0x2045,0x175));var _0x5204=function(_0x5fe69a,_0x5484f5){_0x5fe69a=_0x5fe69a-0x0;var _0x3f1aee=_0x2045[_0x5fe69a];return _0x3f1aee;};'use strict';var Sequelize=require(_0x5204('0x0'));module[_0x5204('0x1')]={'name':{'type':Sequelize[_0x5204('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5204('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x5204('0x4')](_0x5204('0x5'),_0x5204('0x6'),_0x5204('0x7'))}}; \ No newline at end of file +var _0x7507=['INTEGER','roundrobin','sequelize','exports','STRING','name'];(function(_0x3bb350,_0x28fab0){var _0x3c793b=function(_0x2b566c){while(--_0x2b566c){_0x3bb350['push'](_0x3bb350['shift']());}};_0x3c793b(++_0x28fab0);}(_0x7507,0x128));var _0x7750=function(_0x58abce,_0x5488ee){_0x58abce=_0x58abce-0x0;var _0xfb015e=_0x7507[_0x58abce];return _0xfb015e;};'use strict';var Sequelize=require(_0x7750('0x0'));module[_0x7750('0x1')]={'name':{'type':Sequelize[_0x7750('0x2')],'unique':_0x7750('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7750('0x2')]},'timeout':{'type':Sequelize[_0x7750('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0x7750('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index c80494e..cb7f501 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 _0x49a5=['VIRTUAL','filter','options','includeAll','include','findAll','rows','params','find','catch','create','body','user','get','role','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','keys','UserSmsQueue','order','SmsQueueId','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','ids','Team','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','findOrCreate','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','sequelize','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','SmsQueues','UserProfileResource','stack','name','index','SmsQueue','rawAttributes','fieldName','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','type'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x49a5,0xd4));var _0x549a=function(_0x351283,_0x461c1b){_0x351283=_0x351283-0x0;var _0x320462=_0x49a5[_0x351283];return _0x320462;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x549a('0x0'));var rimraf=require(_0x549a('0x1'));var zipdir=require(_0x549a('0x2'));var jsonpatch=require(_0x549a('0x3'));var rp=require(_0x549a('0x4'));var moment=require(_0x549a('0x5'));var BPromise=require(_0x549a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x549a('0x7'));var sox=require('sox');var csv=require(_0x549a('0x8'));var ejs=require(_0x549a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x549a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x549a('0x8'));var querystring=require(_0x549a('0xb'));var Papa=require(_0x549a('0xc'));var Redis=require(_0x549a('0xd'));var authService=require(_0x549a('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x549a('0xf'));var hardwareService=require(_0x549a('0x10'));var logger=require(_0x549a('0x11'))(_0x549a('0x12'));var utils=require(_0x549a('0x13'));var config=require('../../config/environment');var db=require(_0x549a('0x14'))['db'];config['redis']=_[_0x549a('0x15')](config[_0x549a('0x16')],{'host':_0x549a('0x17'),'port':0x18eb});var socket=require(_0x549a('0x18'))(new Redis(config[_0x549a('0x16')]));require(_0x549a('0x19'))[_0x549a('0x1a')](socket);function respondWithStatusCode(_0x2103db,_0x2ee13d){_0x2ee13d=_0x2ee13d||0xcc;return function(_0x5157fb){if(_0x5157fb){return _0x2103db[_0x549a('0x1b')](_0x2ee13d);}return _0x2103db[_0x549a('0x1c')](_0x2ee13d)[_0x549a('0x1d')]();};}function respondWithResult(_0x41098b,_0x4f0a60){_0x4f0a60=_0x4f0a60||0xc8;return function(_0x3a947d){if(_0x3a947d){return _0x41098b['status'](_0x4f0a60)[_0x549a('0x1e')](_0x3a947d);}};}function respondWithFilteredResult(_0x3843d6,_0x3a6010){return function(_0x3b61e1){if(_0x3b61e1){var _0x1e9a4f=_0x3b61e1[_0x549a('0x1f')],_0x4a1413=_0x3a6010['offset'],_0x281a6e=_0x3a6010[_0x549a('0x20')]+_0x3a6010[_0x549a('0x21')],_0x295682;if(_0x281a6e>=_0x1e9a4f){_0x281a6e=_0x1e9a4f;_0x295682=0xc8;}else{_0x295682=0xce;}_0x3843d6[_0x549a('0x1c')](_0x295682);return _0x3843d6[_0x549a('0x22')](_0x549a('0x23'),_0x4a1413+'-'+_0x281a6e+'/'+_0x1e9a4f)['json'](_0x3b61e1);}return null;};}function patchUpdates(_0x3f522a){return function(_0x28d9bc){try{jsonpatch[_0x549a('0x24')](_0x28d9bc,_0x3f522a,!![]);}catch(_0x4c0e1f){return BPromise[_0x549a('0x25')](_0x4c0e1f);}return _0x28d9bc[_0x549a('0x26')]();};}function saveUpdates(_0x1cc344,_0x476538){return function(_0x2d4365){if(_0x2d4365){return _0x2d4365[_0x549a('0x27')](_0x1cc344)[_0x549a('0x28')](function(_0x9e0d56){return _0x9e0d56;});}return null;};}function removeEntity(_0x50f92d,_0x4d2acc){return function(_0x3059ab){if(_0x3059ab){return _0x3059ab[_0x549a('0x29')]()[_0x549a('0x28')](function(){var _0x92a86b=_0x3059ab['get']({'plain':!![]});var _0xfb543e=_0x549a('0x2a');return db[_0x549a('0x2b')][_0x549a('0x29')]({'where':{'type':_0xfb543e,'resourceId':_0x92a86b['id']}})['then'](function(){return _0x3059ab;});})[_0x549a('0x28')](function(){_0x50f92d['status'](0xcc)[_0x549a('0x1d')]();});}};}function handleEntityNotFound(_0x407c2c,_0x5a06cd){return function(_0x2f698e){if(!_0x2f698e){_0x407c2c[_0x549a('0x1b')](0x194);}return _0x2f698e;};}function handleError(_0x7fba59,_0x3a9e10){_0x3a9e10=_0x3a9e10||0x1f4;return function(_0x3b4375){logger['error'](_0x3b4375[_0x549a('0x2c')]);if(_0x3b4375[_0x549a('0x2d')]){delete _0x3b4375[_0x549a('0x2d')];}_0x7fba59[_0x549a('0x1c')](_0x3a9e10)['send'](_0x3b4375);};}exports[_0x549a('0x2e')]=function(_0x293704,_0x18b6c7){var _0x2de8eb={},_0x156f86={},_0x1aec38={'count':0x0,'rows':[]};var _0xf96644=_['map'](db[_0x549a('0x2f')][_0x549a('0x30')],function(_0x178bfa){return{'name':_0x178bfa[_0x549a('0x31')],'type':_0x178bfa['type'][_0x549a('0x32')]};});_0x156f86['model']=_[_0x549a('0x33')](_0xf96644,_0x549a('0x2d'));_0x156f86[_0x549a('0x34')]=_['keys'](_0x293704['query']);_0x156f86['filters']=_[_0x549a('0x35')](_0x156f86[_0x549a('0x36')],_0x156f86['query']);_0x2de8eb['attributes']=_[_0x549a('0x35')](_0x156f86[_0x549a('0x36')],qs[_0x549a('0x37')](_0x293704[_0x549a('0x34')][_0x549a('0x37')]));_0x2de8eb['attributes']=_0x2de8eb[_0x549a('0x38')][_0x549a('0x39')]?_0x2de8eb['attributes']:_0x156f86[_0x549a('0x36')];if(!_0x293704[_0x549a('0x34')][_0x549a('0x3a')](_0x549a('0x3b'))){_0x2de8eb[_0x549a('0x21')]=qs[_0x549a('0x21')](_0x293704[_0x549a('0x34')][_0x549a('0x21')]);_0x2de8eb[_0x549a('0x20')]=qs[_0x549a('0x20')](_0x293704[_0x549a('0x34')][_0x549a('0x20')]);}_0x2de8eb['order']=qs[_0x549a('0x3c')](_0x293704['query'][_0x549a('0x3c')]);_0x2de8eb[_0x549a('0x3d')]=qs[_0x549a('0x3e')](_[_0x549a('0x3f')](_0x293704[_0x549a('0x34')],_0x156f86[_0x549a('0x3e')]),_0xf96644);if(_0x293704['query']['filter']){_0x2de8eb[_0x549a('0x3d')]=_[_0x549a('0x40')](_0x2de8eb[_0x549a('0x3d')],{'$or':_[_0x549a('0x33')](_0xf96644,function(_0x2691b6){if(_0x2691b6[_0x549a('0x41')]!==_0x549a('0x42')){var _0x381e66={};_0x381e66[_0x2691b6['name']]={'$like':'%'+_0x293704['query'][_0x549a('0x43')]+'%'};return _0x381e66;}})});}_0x2de8eb=_[_0x549a('0x40')]({},_0x2de8eb,_0x293704[_0x549a('0x44')]);var _0x290491={'where':_0x2de8eb['where']};return db[_0x549a('0x2f')][_0x549a('0x1f')](_0x290491)[_0x549a('0x28')](function(_0x2d8657){_0x1aec38[_0x549a('0x1f')]=_0x2d8657;if(_0x293704[_0x549a('0x34')][_0x549a('0x45')]){_0x2de8eb[_0x549a('0x46')]=[{'all':!![]}];}return db[_0x549a('0x2f')][_0x549a('0x47')](_0x2de8eb);})[_0x549a('0x28')](function(_0x355e78){_0x1aec38[_0x549a('0x48')]=_0x355e78;return _0x1aec38;})[_0x549a('0x28')](respondWithFilteredResult(_0x18b6c7,_0x2de8eb))['catch'](handleError(_0x18b6c7,null));};exports['show']=function(_0x3855e8,_0x36a7d6){var _0x1c675e={'raw':!![],'where':{'id':_0x3855e8[_0x549a('0x49')]['id']}},_0xffa8f={};_0xffa8f[_0x549a('0x36')]=_['keys'](db['SmsQueue'][_0x549a('0x30')]);_0xffa8f[_0x549a('0x34')]=_['keys'](_0x3855e8['query']);_0xffa8f[_0x549a('0x3e')]=_['intersection'](_0xffa8f['model'],_0xffa8f[_0x549a('0x34')]);_0x1c675e[_0x549a('0x38')]=_[_0x549a('0x35')](_0xffa8f[_0x549a('0x36')],qs[_0x549a('0x37')](_0x3855e8[_0x549a('0x34')]['fields']));_0x1c675e[_0x549a('0x38')]=_0x1c675e[_0x549a('0x38')][_0x549a('0x39')]?_0x1c675e[_0x549a('0x38')]:_0xffa8f[_0x549a('0x36')];if(_0x3855e8[_0x549a('0x34')][_0x549a('0x45')]){_0x1c675e['include']=[{'all':!![]}];}_0x1c675e=_[_0x549a('0x40')]({},_0x1c675e,_0x3855e8[_0x549a('0x44')]);return db[_0x549a('0x2f')][_0x549a('0x4a')](_0x1c675e)[_0x549a('0x28')](handleEntityNotFound(_0x36a7d6,null))[_0x549a('0x28')](respondWithResult(_0x36a7d6,null))[_0x549a('0x4b')](handleError(_0x36a7d6,null));};exports[_0x549a('0x4c')]=function(_0x14b66f,_0x202099){return db[_0x549a('0x2f')][_0x549a('0x4c')](_0x14b66f[_0x549a('0x4d')],{})[_0x549a('0x28')](function(_0x552220){var _0x1b545f=_0x14b66f[_0x549a('0x4e')][_0x549a('0x4f')]({'plain':!![]});if(!_0x1b545f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b545f[_0x549a('0x50')]===_0x549a('0x4e')){var _0x39ed17=_0x552220[_0x549a('0x4f')]({'plain':!![]});var _0x46b139='SmsQueues';return db['UserProfileSection'][_0x549a('0x4a')]({'where':{'name':_0x46b139,'userProfileId':_0x1b545f['userProfileId']},'raw':!![]})[_0x549a('0x28')](function(_0x3219fb){if(_0x3219fb&&_0x3219fb[_0x549a('0x51')]===0x0){return db[_0x549a('0x2b')][_0x549a('0x4c')]({'name':_0x39ed17['name'],'resourceId':_0x39ed17['id'],'type':_0x3219fb['name'],'sectionId':_0x3219fb['id']},{})[_0x549a('0x28')](function(){return _0x552220;});}else{return _0x552220;}})['catch'](function(_0x5c9056){logger[_0x549a('0x52')](_0x549a('0x53'),_0x5c9056);throw _0x5c9056;});}return _0x552220;})[_0x549a('0x28')](respondWithResult(_0x202099,0xc9))[_0x549a('0x4b')](handleError(_0x202099,null));};exports[_0x549a('0x27')]=function(_0x4e64bb,_0x4305d8){if(_0x4e64bb[_0x549a('0x4d')]['id']){delete _0x4e64bb['body']['id'];}return db['SmsQueue'][_0x549a('0x4a')]({'where':{'id':_0x4e64bb[_0x549a('0x49')]['id']}})['then'](handleEntityNotFound(_0x4305d8,null))['then'](saveUpdates(_0x4e64bb[_0x549a('0x4d')],null))[_0x549a('0x28')](respondWithResult(_0x4305d8,null))[_0x549a('0x4b')](handleError(_0x4305d8,null));};exports[_0x549a('0x29')]=function(_0x45a411,_0x519bc6){return db[_0x549a('0x2f')][_0x549a('0x4a')]({'where':{'id':_0x45a411[_0x549a('0x49')]['id']}})['then'](handleEntityNotFound(_0x519bc6,null))[_0x549a('0x28')](removeEntity(_0x519bc6,null))[_0x549a('0x4b')](handleError(_0x519bc6,null));};exports['describe']=function(_0x33ca28,_0x4f9a55){return db['SmsQueue']['describe']()['then'](respondWithResult(_0x4f9a55,null))['catch'](handleError(_0x4f9a55,null));};exports['getMembers']=function(_0x69c440,_0x13ab46,_0xa330ea){var _0x5013b2={'raw':!![],'where':{}},_0x3619bf={},_0x4a48bf;return db['SmsQueue']['findOne']({'where':{'id':_0x69c440['params']['id']}})[_0x549a('0x28')](handleEntityNotFound(_0x13ab46,null))[_0x549a('0x28')](function(_0x2eb2d4){if(_0x2eb2d4){_0x4a48bf=_0x2eb2d4[_0x549a('0x4f')]({'plain':!![]});_0x3619bf[_0x549a('0x36')]=_[_0x549a('0x54')](db[_0x549a('0x55')][_0x549a('0x30')]);_0x3619bf['query']=_['keys'](_0x69c440[_0x549a('0x34')]);_0x3619bf[_0x549a('0x3e')]=_[_0x549a('0x35')](_0x3619bf[_0x549a('0x36')],_0x3619bf[_0x549a('0x34')]);_0x5013b2[_0x549a('0x38')]=_[_0x549a('0x35')](_0x3619bf[_0x549a('0x36')],qs[_0x549a('0x37')](_0x69c440[_0x549a('0x34')][_0x549a('0x37')]));_0x5013b2[_0x549a('0x38')]=_0x5013b2['attributes'][_0x549a('0x39')]?_0x5013b2[_0x549a('0x38')]:_0x3619bf[_0x549a('0x36')];if(!_0x69c440['query'][_0x549a('0x3a')]('nolimit')){_0x5013b2[_0x549a('0x21')]=qs[_0x549a('0x21')](_0x69c440['query'][_0x549a('0x21')]);_0x5013b2[_0x549a('0x20')]=qs['offset'](_0x69c440[_0x549a('0x34')]['offset']);}_0x5013b2[_0x549a('0x56')]=qs[_0x549a('0x3c')](_0x69c440['query'][_0x549a('0x3c')]);_0x5013b2['where']=qs[_0x549a('0x3e')](_[_0x549a('0x3f')](_0x69c440[_0x549a('0x34')],_0x3619bf['filters']));_0x5013b2[_0x549a('0x3d')][_0x549a('0x57')]=_0x2eb2d4['id'];if(_0x69c440[_0x549a('0x34')][_0x549a('0x43')]){_0x5013b2[_0x549a('0x3d')]=_[_0x549a('0x40')](_0x5013b2[_0x549a('0x3d')],{'$or':_[_0x549a('0x33')](_0x5013b2[_0x549a('0x38')],function(_0x564008){var _0x156500={};_0x156500[_0x564008]={'$like':'%'+_0x69c440[_0x549a('0x34')][_0x549a('0x43')]+'%'};return _0x156500;})});}_0x5013b2=_[_0x549a('0x40')]({},_0x5013b2,_0x69c440['options']);return db[_0x549a('0x55')]['findAll'](_0x5013b2);}})['then'](function(_0x44232c){if(_0x44232c){return db[_0x549a('0x58')][_0x549a('0x59')]({'where':{'id':_[_0x549a('0x33')](_0x44232c,_0x549a('0x5a')),'role':'agent'},'attributes':['id','name',_0x549a('0x5b'),_0x549a('0x5c'),_0x549a('0x5d')]});}})[_0x549a('0x28')](function(_0x4e0234){if(_0x4e0234){return{'count':_0x4e0234[_0x549a('0x1f')],'rows':_['map'](_0x4e0234[_0x549a('0x48')],function(_0x840e82){return{'membername':_0x840e82[_0x549a('0x2d')],'UserId':_0x840e82['id'],'queue_name':_0x4a48bf['name'],'SmsQueueId':_0x4a48bf['id'],'interface':util[_0x549a('0x5e')](_0x549a('0x5f'),_0x549a('0x60'),_0x840e82[_0x549a('0x2d')]),'penalty':0x0,'paused':_0x840e82[_0x549a('0x5b')],'createdAt':_0x840e82[_0x549a('0x5d')],'updatedAt':_0x840e82['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x549a('0x28')](respondWithFilteredResult(_0x13ab46,_0x5013b2))[_0x549a('0x4b')](handleError(_0x13ab46,null));};exports['getTeams']=function(_0x5c4cb6,_0x1747f8,_0x129085){var _0x3181d4={};var _0x453152={};var _0x348449;var _0x53bd3e;return db['SmsQueue'][_0x549a('0x61')]({'where':{'id':_0x5c4cb6['params']['id']}})[_0x549a('0x28')](handleEntityNotFound(_0x1747f8,null))[_0x549a('0x28')](function(_0x195c44){if(_0x195c44){_0x348449=_0x195c44;_0x453152[_0x549a('0x36')]=_['keys'](db['Team'][_0x549a('0x30')]);_0x453152[_0x549a('0x34')]=_[_0x549a('0x54')](_0x5c4cb6[_0x549a('0x34')]);_0x453152[_0x549a('0x3e')]=_[_0x549a('0x35')](_0x453152['model'],_0x453152[_0x549a('0x34')]);_0x3181d4[_0x549a('0x38')]=_['intersection'](_0x453152['model'],qs[_0x549a('0x37')](_0x5c4cb6[_0x549a('0x34')][_0x549a('0x37')]));_0x3181d4[_0x549a('0x38')]=_0x3181d4[_0x549a('0x38')][_0x549a('0x39')]?_0x3181d4[_0x549a('0x38')]:_0x453152[_0x549a('0x36')];_0x3181d4[_0x549a('0x56')]=qs[_0x549a('0x3c')](_0x5c4cb6[_0x549a('0x34')][_0x549a('0x3c')]);_0x3181d4[_0x549a('0x3d')]=qs[_0x549a('0x3e')](_[_0x549a('0x3f')](_0x5c4cb6[_0x549a('0x34')],_0x453152[_0x549a('0x3e')]));if(_0x5c4cb6[_0x549a('0x34')]['filter']){_0x3181d4['where']=_[_0x549a('0x40')](_0x3181d4[_0x549a('0x3d')],{'$or':_[_0x549a('0x33')](_0x3181d4[_0x549a('0x38')],function(_0x22eb98){var _0x1b976b={};_0x1b976b[_0x22eb98]={'$like':'%'+_0x5c4cb6[_0x549a('0x34')]['filter']+'%'};return _0x1b976b;})});}_0x3181d4=_[_0x549a('0x40')]({},_0x3181d4,_0x5c4cb6['options']);return _0x348449['getTeams'](_0x3181d4);}})[_0x549a('0x28')](function(_0x30003d){if(_0x30003d){_0x53bd3e=_0x30003d[_0x549a('0x39')];if(!_0x5c4cb6[_0x549a('0x34')][_0x549a('0x3a')](_0x549a('0x3b'))){_0x3181d4[_0x549a('0x21')]=qs[_0x549a('0x21')](_0x5c4cb6[_0x549a('0x34')][_0x549a('0x21')]);_0x3181d4['offset']=qs[_0x549a('0x20')](_0x5c4cb6[_0x549a('0x34')][_0x549a('0x20')]);}return _0x348449['getTeams'](_0x3181d4);}})[_0x549a('0x28')](function(_0x2c6ad3){if(_0x2c6ad3){return _0x2c6ad3?{'count':_0x53bd3e,'rows':_0x2c6ad3}:null;}})['then'](respondWithResult(_0x1747f8,null))['catch'](handleError(_0x1747f8,null));};exports['addTeams']=function(_0x1e84ea,_0x13aded,_0x5d087c){var _0x456488=_0x1e84ea[_0x549a('0x4d')][_0x549a('0x62')];return db[_0x549a('0x63')][_0x549a('0x47')]({'where':{'id':_0x456488},'attributes':['id'],'include':[{'model':db[_0x549a('0x58')],'as':_0x549a('0x64'),'attributes':['id',_0x549a('0x2d'),_0x549a('0x65'),_0x549a('0x66'),_0x549a('0x67')],'raw':!![]}]})[_0x549a('0x28')](function(_0x1d8e6a){if(_0x1d8e6a){var _0xa869a3=_[_0x549a('0x68')](_0x1d8e6a,function(_0xd6c8d0){var _0x50804f=_0xd6c8d0[_0x549a('0x4f')]({'plain':!![]});return _0x50804f[_0x549a('0x64')];});return db[_0x549a('0x2f')][_0x549a('0x4a')]({'where':{'id':_0x1e84ea['params']['id']}})[_0x549a('0x28')](function(_0x15a215){return db['sequelize'][_0x549a('0x69')](function(_0x2cdc5b){return _0x15a215[_0x549a('0x6a')](_0x456488,{'transaction':_0x2cdc5b})[_0x549a('0x28')](function(){return BPromise[_0x549a('0x6b')](_0xa869a3,function(_0x2bb66a){return db['UserSmsQueue'][_0x549a('0x6c')]({'where':{'UserId':_0x2bb66a['id'],'SmsQueueId':_0x1e84ea['params']['id']},'transaction':_0x2cdc5b});});})[_0x549a('0x28')](function(){_0xa869a3['forEach'](function(_0x1de735){socket[_0x549a('0x6d')](_0x549a('0x6e'),{'UserId':_0x1de735['id'],'SmsQueueId':_0x15a215['id']});});});});});}})[_0x549a('0x28')](respondWithStatusCode(_0x13aded,null))['catch'](handleError(_0x13aded,null));};exports[_0x549a('0x6f')]=function(_0x331fed,_0x461c2e,_0x44b201){return db[_0x549a('0x63')]['findAll']({'where':{'id':_0x331fed[_0x549a('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0x549a('0x58')],'as':_0x549a('0x64'),'attributes':['id'],'raw':!![]}]})[_0x549a('0x28')](handleEntityNotFound(_0x461c2e,null))['then'](function(_0x47d011){var _0x35365b=_[_0x549a('0x33')](_0x47d011,'id');var _0x31473f=[];var _0x47272b=[];var _0x1987ee=squel[_0x549a('0x70')]();_0x1987ee[_0x549a('0x71')](_0x549a('0x72'))[_0x549a('0x73')](_0x549a('0x74'),'tq')['join'](_0x549a('0x75'),'ut',_0x549a('0x76'))[_0x549a('0x3d')](_0x549a('0x77'),_0x331fed[_0x549a('0x49')]['id']);for(var _0x550cfc=0x0;_0x550cfc<_0x47d011[_0x549a('0x39')];_0x550cfc+=0x1){let _0x8e5f7=_0x47d011[_0x550cfc];for(var _0xbc21da=0x0;_0xbc21da<_0x8e5f7[_0x549a('0x64')][_0x549a('0x39')];_0xbc21da+=0x1){let _0x362caa=_0x8e5f7[_0x549a('0x64')][_0xbc21da];var _0x30a52e=_0x1987ee[_0x549a('0x78')]();_0x30a52e[_0x549a('0x3d')]('ut.UserId\x20=\x20?',_0x362caa['id']);_0x47272b[_0x549a('0x79')](db['sequelize']['query'](_0x30a52e[_0x549a('0x7a')](),{'type':db[_0x549a('0x7b')]['QueryTypes'][_0x549a('0x7c')]})[_0x549a('0x28')](function(_0x4fb9f0){if(_0x4fb9f0[_0x549a('0x39')]===0x1){return _0x362caa['id'];}else{var _0xa1d34a=_[_0x549a('0x7d')](_['map'](_0x4fb9f0,_0x549a('0x7e')),function(_0x4f364e){return _[_0x549a('0x7f')](_0x35365b,_0x4f364e);});if(_0xa1d34a){return _0x362caa['id'];}}}));}}return BPromise[_0x549a('0x80')](_0x47272b)['then'](function(_0x596e37){_0x31473f=_(_0x31473f)[_0x549a('0x81')](_0x596e37)[_0x549a('0x82')]()[_0x549a('0x83')]();return db[_0x549a('0x2f')][_0x549a('0x4a')]({'where':{'id':_0x331fed[_0x549a('0x49')]['id']}})['then'](function(_0x2f5ddd){return db[_0x549a('0x7b')][_0x549a('0x69')](function(_0x2f4598){return _0x2f5ddd['removeTeams'](_0x331fed[_0x549a('0x34')][_0x549a('0x62')],{'transaction':_0x2f4598})['then'](function(){if(!_['isEmpty'](_0x31473f)){return _0x2f5ddd[_0x549a('0x84')](_0x31473f,{'transaction':_0x2f4598});}})[_0x549a('0x28')](function(){_0x31473f[_0x549a('0x85')](function(_0x38d36e){socket[_0x549a('0x6d')](_0x549a('0x86'),{'UserId':_0x38d36e,'SmsQueueId':_0x2f5ddd['id']});});});});});});})['then'](respondWithStatusCode(_0x461c2e,null))[_0x549a('0x4b')](handleError(_0x461c2e,null));};exports['addAgents']=function(_0x4e759f,_0x25ba1d,_0x34f43b){return db[_0x549a('0x2f')]['find']({'where':{'id':_0x4e759f[_0x549a('0x49')]['id']}})[_0x549a('0x28')](handleEntityNotFound(_0x25ba1d,null))[_0x549a('0x28')](function(_0x590e60){if(_0x590e60){return _0x590e60[_0x549a('0x87')](_0x4e759f[_0x549a('0x4d')][_0x549a('0x62')],_[_0x549a('0x88')](_0x4e759f[_0x549a('0x4d')],[_0x549a('0x62'),'id'])||{})[_0x549a('0x89')](function(_0x5eaaf3){for(var _0x189b68=0x0;_0x189b68<_0x4e759f['body'][_0x549a('0x62')][_0x549a('0x39')];_0x189b68+=0x1){socket[_0x549a('0x6d')](_0x549a('0x6e'),{'UserId':_0x4e759f[_0x549a('0x4d')][_0x549a('0x62')][_0x189b68],'SmsQueueId':_0x4e759f[_0x549a('0x49')]['id']});}return _0x5eaaf3;});}})[_0x549a('0x28')](respondWithResult(_0x25ba1d,null))[_0x549a('0x4b')](handleError(_0x25ba1d,null));};exports['removeAgents']=function(_0x437896,_0x3ce6af,_0x40a9f6){return db[_0x549a('0x2f')][_0x549a('0x4a')]({'where':{'id':_0x437896['params']['id']}})[_0x549a('0x28')](handleEntityNotFound(_0x3ce6af,null))[_0x549a('0x28')](function(_0x43e716){if(_0x43e716){return _0x43e716[_0x549a('0x84')](_0x437896[_0x549a('0x34')][_0x549a('0x62')])[_0x549a('0x28')](function(){if(_['isArray'](_0x437896['query'][_0x549a('0x62')])){for(var _0x4fd109=0x0;_0x4fd109<_0x437896[_0x549a('0x34')][_0x549a('0x62')][_0x549a('0x39')];_0x4fd109+=0x1){socket[_0x549a('0x6d')](_0x549a('0x86'),{'UserId':Number(_0x437896[_0x549a('0x34')][_0x549a('0x62')][_0x4fd109]),'SmsQueueId':Number(_0x437896[_0x549a('0x49')]['id'])});}}else{socket[_0x549a('0x6d')](_0x549a('0x86'),{'UserId':Number(_0x437896[_0x549a('0x34')][_0x549a('0x62')]),'SmsQueueId':Number(_0x437896[_0x549a('0x49')]['id'])});}});}})[_0x549a('0x28')](respondWithStatusCode(_0x3ce6af,null))[_0x549a('0x4b')](handleError(_0x3ce6af,null));};exports['getAgents']=function(_0xd0976b,_0x4fdd7d,_0xcc3787){var _0xb20cf2={};var _0x5701cd={};var _0x153804;var _0x4631b4;return db['SmsQueue'][_0x549a('0x61')]({'where':{'id':_0xd0976b[_0x549a('0x49')]['id']}})['then'](handleEntityNotFound(_0x4fdd7d,null))[_0x549a('0x28')](function(_0x3a2959){if(_0x3a2959){_0x153804=_0x3a2959;_0x5701cd[_0x549a('0x36')]=_[_0x549a('0x54')](db['User']['rawAttributes']);_0x5701cd[_0x549a('0x34')]=_[_0x549a('0x54')](_0xd0976b[_0x549a('0x34')]);_0x5701cd[_0x549a('0x3e')]=_['intersection'](_0x5701cd[_0x549a('0x36')],_0x5701cd['query']);_0xb20cf2['attributes']=_[_0x549a('0x35')](_0x5701cd['model'],qs[_0x549a('0x37')](_0xd0976b[_0x549a('0x34')][_0x549a('0x37')]));_0xb20cf2['attributes']=_0xb20cf2[_0x549a('0x38')][_0x549a('0x39')]?_0xb20cf2['attributes']:_0x5701cd[_0x549a('0x36')];_0xb20cf2[_0x549a('0x56')]=qs[_0x549a('0x3c')](_0xd0976b[_0x549a('0x34')][_0x549a('0x3c')]);_0xb20cf2[_0x549a('0x3d')]=qs[_0x549a('0x3e')](_[_0x549a('0x3f')](_0xd0976b[_0x549a('0x34')],_0x5701cd['filters']));if(_0xd0976b[_0x549a('0x34')][_0x549a('0x43')]){_0xb20cf2[_0x549a('0x3d')]=_[_0x549a('0x40')](_0xb20cf2[_0x549a('0x3d')],{'$or':_[_0x549a('0x33')](_0xb20cf2[_0x549a('0x38')],function(_0x3993e3){var _0x9d17fb={};_0x9d17fb[_0x3993e3]={'$like':'%'+_0xd0976b['query'][_0x549a('0x43')]+'%'};return _0x9d17fb;})});}_0xb20cf2=_[_0x549a('0x40')]({},_0xb20cf2,_0xd0976b['options']);return _0x153804[_0x549a('0x8a')](_0xb20cf2);}})[_0x549a('0x28')](function(_0x29002d){if(_0x29002d){_0x4631b4=_0x29002d[_0x549a('0x39')];if(!_0xd0976b['query']['hasOwnProperty'](_0x549a('0x3b'))){_0xb20cf2[_0x549a('0x21')]=qs['limit'](_0xd0976b[_0x549a('0x34')][_0x549a('0x21')]);_0xb20cf2[_0x549a('0x20')]=qs[_0x549a('0x20')](_0xd0976b[_0x549a('0x34')][_0x549a('0x20')]);}return _0x153804[_0x549a('0x8a')](_0xb20cf2);}})[_0x549a('0x28')](function(_0x49e226){if(_0x49e226){return _0x49e226?{'count':_0x4631b4,'rows':_0x49e226}:null;}})['then'](respondWithResult(_0x4fdd7d,null))['catch'](handleError(_0x4fdd7d,null));}; \ No newline at end of file +var _0xcd8d=['../../mysqldb','redis','localhost','./smsQueue.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','SmsQueues','UserProfileResource','error','stack','name','send','map','SmsQueue','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','getMembers','UserSmsQueue','SmsQueueId','findAndCountAll','smsPause','updatedAt','createdAt','format','SIP','findOne','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','sequelize','each','forEach','userSmsQueue:save','removeTeams','User','field','tq.TeamId','from','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','union','compact','value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x120e72,_0x5a0548){var _0x56e1a2=function(_0x4fc16a){while(--_0x4fc16a){_0x120e72['push'](_0x120e72['shift']());}};_0x56e1a2(++_0x5a0548);}(_0xcd8d,0xf9));var _0xdcd8=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xcd8d[_0x2b45b5];return _0x1d9c06;};'use strict';var pdf=require(_0xdcd8('0x0'));var emlformat=require(_0xdcd8('0x1'));var rimraf=require(_0xdcd8('0x2'));var zipdir=require(_0xdcd8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdcd8('0x4'));var moment=require(_0xdcd8('0x5'));var BPromise=require(_0xdcd8('0x6'));var Mustache=require(_0xdcd8('0x7'));var util=require(_0xdcd8('0x8'));var path=require(_0xdcd8('0x9'));var sox=require(_0xdcd8('0xa'));var csv=require(_0xdcd8('0xb'));var ejs=require(_0xdcd8('0xc'));var fs=require('fs');var _=require(_0xdcd8('0xd'));var squel=require(_0xdcd8('0xe'));var crypto=require('crypto');var jsforce=require(_0xdcd8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xdcd8('0xb'));var querystring=require(_0xdcd8('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdcd8('0x11'));var qs=require(_0xdcd8('0x12'));var as=require(_0xdcd8('0x13'));var hardwareService=require(_0xdcd8('0x14'));var logger=require('../../config/logger')(_0xdcd8('0x15'));var utils=require('../../config/utils');var config=require(_0xdcd8('0x16'));var db=require(_0xdcd8('0x17'))['db'];config[_0xdcd8('0x18')]=_['defaults'](config['redis'],{'host':_0xdcd8('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdcd8('0x1a'))['register'](socket);function respondWithStatusCode(_0x4925be,_0xf09c0e){_0xf09c0e=_0xf09c0e||0xcc;return function(_0x525662){if(_0x525662){return _0x4925be[_0xdcd8('0x1b')](_0xf09c0e);}return _0x4925be[_0xdcd8('0x1c')](_0xf09c0e)[_0xdcd8('0x1d')]();};}function respondWithResult(_0xa5f553,_0x2ec539){_0x2ec539=_0x2ec539||0xc8;return function(_0x1b4eff){if(_0x1b4eff){return _0xa5f553[_0xdcd8('0x1c')](_0x2ec539)[_0xdcd8('0x1e')](_0x1b4eff);}};}function respondWithFilteredResult(_0x1af246,_0x44eb66){return function(_0x3e3b47){if(_0x3e3b47){var _0x5b26df=_0x3e3b47[_0xdcd8('0x1f')],_0x91efed=_0x44eb66[_0xdcd8('0x20')],_0x11f54d=_0x44eb66[_0xdcd8('0x20')]+_0x44eb66[_0xdcd8('0x21')],_0x4487c3;if(_0x11f54d>=_0x5b26df){_0x11f54d=_0x5b26df;_0x4487c3=0xc8;}else{_0x4487c3=0xce;}_0x1af246[_0xdcd8('0x1c')](_0x4487c3);return _0x1af246[_0xdcd8('0x22')](_0xdcd8('0x23'),_0x91efed+'-'+_0x11f54d+'/'+_0x5b26df)[_0xdcd8('0x1e')](_0x3e3b47);}return null;};}function patchUpdates(_0x19870f){return function(_0x5e9b72){try{jsonpatch[_0xdcd8('0x24')](_0x5e9b72,_0x19870f,!![]);}catch(_0x17d3f1){return BPromise[_0xdcd8('0x25')](_0x17d3f1);}return _0x5e9b72[_0xdcd8('0x26')]();};}function saveUpdates(_0x4ffd96,_0x346d76){return function(_0x2efb6c){if(_0x2efb6c){return _0x2efb6c['update'](_0x4ffd96)[_0xdcd8('0x27')](function(_0x22e60d){return _0x22e60d;});}return null;};}function removeEntity(_0x1fcfde,_0x491587){return function(_0x407b60){if(_0x407b60){return _0x407b60['destroy']()[_0xdcd8('0x27')](function(){var _0x4351da=_0x407b60[_0xdcd8('0x28')]({'plain':!![]});var _0x499d72=_0xdcd8('0x29');return db[_0xdcd8('0x2a')]['destroy']({'where':{'type':_0x499d72,'resourceId':_0x4351da['id']}})[_0xdcd8('0x27')](function(){return _0x407b60;});})[_0xdcd8('0x27')](function(){_0x1fcfde[_0xdcd8('0x1c')](0xcc)[_0xdcd8('0x1d')]();});}};}function handleEntityNotFound(_0x1a20ee,_0x1c80fa){return function(_0x1aa005){if(!_0x1aa005){_0x1a20ee[_0xdcd8('0x1b')](0x194);}return _0x1aa005;};}function handleError(_0x5359c7,_0x477eb5){_0x477eb5=_0x477eb5||0x1f4;return function(_0x3263a4){logger[_0xdcd8('0x2b')](_0x3263a4[_0xdcd8('0x2c')]);if(_0x3263a4['name']){delete _0x3263a4[_0xdcd8('0x2d')];}_0x5359c7[_0xdcd8('0x1c')](_0x477eb5)[_0xdcd8('0x2e')](_0x3263a4);};}exports['index']=function(_0x1d2892,_0x49e4e1){var _0x218dcf={},_0x54414f={},_0x5b7cf5={'count':0x0,'rows':[]};var _0x54d7cd=_[_0xdcd8('0x2f')](db[_0xdcd8('0x30')][_0xdcd8('0x31')],function(_0x403cc6){return{'name':_0x403cc6['fieldName'],'type':_0x403cc6[_0xdcd8('0x32')]['key']};});_0x54414f[_0xdcd8('0x33')]=_[_0xdcd8('0x2f')](_0x54d7cd,'name');_0x54414f[_0xdcd8('0x34')]=_[_0xdcd8('0x35')](_0x1d2892['query']);_0x54414f[_0xdcd8('0x36')]=_[_0xdcd8('0x37')](_0x54414f['model'],_0x54414f['query']);_0x218dcf[_0xdcd8('0x38')]=_[_0xdcd8('0x37')](_0x54414f[_0xdcd8('0x33')],qs[_0xdcd8('0x39')](_0x1d2892['query'][_0xdcd8('0x39')]));_0x218dcf['attributes']=_0x218dcf[_0xdcd8('0x38')]['length']?_0x218dcf[_0xdcd8('0x38')]:_0x54414f[_0xdcd8('0x33')];if(!_0x1d2892['query'][_0xdcd8('0x3a')](_0xdcd8('0x3b'))){_0x218dcf[_0xdcd8('0x21')]=qs[_0xdcd8('0x21')](_0x1d2892[_0xdcd8('0x34')]['limit']);_0x218dcf[_0xdcd8('0x20')]=qs[_0xdcd8('0x20')](_0x1d2892[_0xdcd8('0x34')]['offset']);}_0x218dcf[_0xdcd8('0x3c')]=qs[_0xdcd8('0x3d')](_0x1d2892['query'][_0xdcd8('0x3d')]);_0x218dcf[_0xdcd8('0x3e')]=qs[_0xdcd8('0x36')](_[_0xdcd8('0x3f')](_0x1d2892['query'],_0x54414f[_0xdcd8('0x36')]),_0x54d7cd);if(_0x1d2892['query'][_0xdcd8('0x40')]){_0x218dcf['where']=_[_0xdcd8('0x41')](_0x218dcf[_0xdcd8('0x3e')],{'$or':_[_0xdcd8('0x2f')](_0x54d7cd,function(_0x368eac){if(_0x368eac[_0xdcd8('0x32')]!==_0xdcd8('0x42')){var _0x45380={};_0x45380[_0x368eac[_0xdcd8('0x2d')]]={'$like':'%'+_0x1d2892['query'][_0xdcd8('0x40')]+'%'};return _0x45380;}})});}_0x218dcf=_[_0xdcd8('0x41')]({},_0x218dcf,_0x1d2892[_0xdcd8('0x43')]);var _0x18d9d3={'where':_0x218dcf['where']};return db[_0xdcd8('0x30')][_0xdcd8('0x1f')](_0x18d9d3)[_0xdcd8('0x27')](function(_0x51172b){_0x5b7cf5[_0xdcd8('0x1f')]=_0x51172b;if(_0x1d2892[_0xdcd8('0x34')][_0xdcd8('0x44')]){_0x218dcf[_0xdcd8('0x45')]=[{'all':!![]}];}return db[_0xdcd8('0x30')][_0xdcd8('0x46')](_0x218dcf);})[_0xdcd8('0x27')](function(_0x117be3){_0x5b7cf5[_0xdcd8('0x47')]=_0x117be3;return _0x5b7cf5;})['then'](respondWithFilteredResult(_0x49e4e1,_0x218dcf))[_0xdcd8('0x48')](handleError(_0x49e4e1,null));};exports[_0xdcd8('0x49')]=function(_0xef9425,_0x3afb70){var _0x5b42eb={'raw':!![],'where':{'id':_0xef9425[_0xdcd8('0x4a')]['id']}},_0x562f0e={};_0x562f0e[_0xdcd8('0x33')]=_[_0xdcd8('0x35')](db[_0xdcd8('0x30')][_0xdcd8('0x31')]);_0x562f0e[_0xdcd8('0x34')]=_[_0xdcd8('0x35')](_0xef9425[_0xdcd8('0x34')]);_0x562f0e['filters']=_[_0xdcd8('0x37')](_0x562f0e[_0xdcd8('0x33')],_0x562f0e['query']);_0x5b42eb[_0xdcd8('0x38')]=_['intersection'](_0x562f0e['model'],qs[_0xdcd8('0x39')](_0xef9425['query'][_0xdcd8('0x39')]));_0x5b42eb[_0xdcd8('0x38')]=_0x5b42eb['attributes'][_0xdcd8('0x4b')]?_0x5b42eb[_0xdcd8('0x38')]:_0x562f0e[_0xdcd8('0x33')];if(_0xef9425[_0xdcd8('0x34')][_0xdcd8('0x44')]){_0x5b42eb['include']=[{'all':!![]}];}_0x5b42eb=_[_0xdcd8('0x41')]({},_0x5b42eb,_0xef9425[_0xdcd8('0x43')]);return db[_0xdcd8('0x30')][_0xdcd8('0x4c')](_0x5b42eb)['then'](handleEntityNotFound(_0x3afb70,null))[_0xdcd8('0x27')](respondWithResult(_0x3afb70,null))[_0xdcd8('0x48')](handleError(_0x3afb70,null));};exports[_0xdcd8('0x4d')]=function(_0x1a622c,_0x50e7e1){return db['SmsQueue']['create'](_0x1a622c[_0xdcd8('0x4e')],{})['then'](function(_0xadc1c3){var _0x826365=_0x1a622c[_0xdcd8('0x4f')][_0xdcd8('0x28')]({'plain':!![]});if(!_0x826365)throw new Error(_0xdcd8('0x50'));if(_0x826365[_0xdcd8('0x51')]==='user'){var _0x3a2d5c=_0xadc1c3[_0xdcd8('0x28')]({'plain':!![]});var _0x54f19d=_0xdcd8('0x29');return db[_0xdcd8('0x52')][_0xdcd8('0x4c')]({'where':{'name':_0x54f19d,'userProfileId':_0x826365['userProfileId']},'raw':!![]})[_0xdcd8('0x27')](function(_0x18c47f){if(_0x18c47f&&_0x18c47f[_0xdcd8('0x53')]===0x0){return db['UserProfileResource'][_0xdcd8('0x4d')]({'name':_0x3a2d5c[_0xdcd8('0x2d')],'resourceId':_0x3a2d5c['id'],'type':_0x18c47f[_0xdcd8('0x2d')],'sectionId':_0x18c47f['id']},{})[_0xdcd8('0x27')](function(){return _0xadc1c3;});}else{return _0xadc1c3;}})[_0xdcd8('0x48')](function(_0x15d40f){logger[_0xdcd8('0x2b')](_0xdcd8('0x54'),_0x15d40f);throw _0x15d40f;});}return _0xadc1c3;})[_0xdcd8('0x27')](respondWithResult(_0x50e7e1,0xc9))['catch'](handleError(_0x50e7e1,null));};exports[_0xdcd8('0x55')]=function(_0x3d8389,_0x3f6ec0){if(_0x3d8389['body']['id']){delete _0x3d8389['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x3d8389['params']['id']}})[_0xdcd8('0x27')](handleEntityNotFound(_0x3f6ec0,null))[_0xdcd8('0x27')](saveUpdates(_0x3d8389['body'],null))[_0xdcd8('0x27')](respondWithResult(_0x3f6ec0,null))['catch'](handleError(_0x3f6ec0,null));};exports[_0xdcd8('0x56')]=function(_0x52911c,_0x331fef){return db[_0xdcd8('0x30')][_0xdcd8('0x4c')]({'where':{'id':_0x52911c[_0xdcd8('0x4a')]['id']}})[_0xdcd8('0x27')](handleEntityNotFound(_0x331fef,null))['then'](removeEntity(_0x331fef,null))[_0xdcd8('0x48')](handleError(_0x331fef,null));};exports[_0xdcd8('0x57')]=function(_0x3ae562,_0x32d8d2){return db[_0xdcd8('0x30')]['describe']()[_0xdcd8('0x27')](respondWithResult(_0x32d8d2,null))[_0xdcd8('0x48')](handleError(_0x32d8d2,null));};exports[_0xdcd8('0x58')]=function(_0x4dc650,_0x29cc0a,_0x41bb68){var _0x492f0e={'raw':!![],'where':{}},_0x41beb9={},_0x32e94f;return db[_0xdcd8('0x30')]['findOne']({'where':{'id':_0x4dc650['params']['id']}})[_0xdcd8('0x27')](handleEntityNotFound(_0x29cc0a,null))[_0xdcd8('0x27')](function(_0x2f6502){if(_0x2f6502){_0x32e94f=_0x2f6502[_0xdcd8('0x28')]({'plain':!![]});_0x41beb9['model']=_[_0xdcd8('0x35')](db[_0xdcd8('0x59')]['rawAttributes']);_0x41beb9[_0xdcd8('0x34')]=_[_0xdcd8('0x35')](_0x4dc650[_0xdcd8('0x34')]);_0x41beb9[_0xdcd8('0x36')]=_[_0xdcd8('0x37')](_0x41beb9[_0xdcd8('0x33')],_0x41beb9[_0xdcd8('0x34')]);_0x492f0e['attributes']=_['intersection'](_0x41beb9[_0xdcd8('0x33')],qs[_0xdcd8('0x39')](_0x4dc650[_0xdcd8('0x34')][_0xdcd8('0x39')]));_0x492f0e[_0xdcd8('0x38')]=_0x492f0e['attributes'][_0xdcd8('0x4b')]?_0x492f0e['attributes']:_0x41beb9[_0xdcd8('0x33')];if(!_0x4dc650['query'][_0xdcd8('0x3a')]('nolimit')){_0x492f0e[_0xdcd8('0x21')]=qs[_0xdcd8('0x21')](_0x4dc650[_0xdcd8('0x34')][_0xdcd8('0x21')]);_0x492f0e[_0xdcd8('0x20')]=qs[_0xdcd8('0x20')](_0x4dc650[_0xdcd8('0x34')][_0xdcd8('0x20')]);}_0x492f0e[_0xdcd8('0x3c')]=qs['sort'](_0x4dc650[_0xdcd8('0x34')][_0xdcd8('0x3d')]);_0x492f0e['where']=qs['filters'](_[_0xdcd8('0x3f')](_0x4dc650['query'],_0x41beb9['filters']));_0x492f0e[_0xdcd8('0x3e')][_0xdcd8('0x5a')]=_0x2f6502['id'];if(_0x4dc650[_0xdcd8('0x34')]['filter']){_0x492f0e['where']=_[_0xdcd8('0x41')](_0x492f0e[_0xdcd8('0x3e')],{'$or':_[_0xdcd8('0x2f')](_0x492f0e['attributes'],function(_0x348ea2){var _0x335efc={};_0x335efc[_0x348ea2]={'$like':'%'+_0x4dc650[_0xdcd8('0x34')][_0xdcd8('0x40')]+'%'};return _0x335efc;})});}_0x492f0e=_[_0xdcd8('0x41')]({},_0x492f0e,_0x4dc650[_0xdcd8('0x43')]);return db['UserSmsQueue'][_0xdcd8('0x46')](_0x492f0e);}})['then'](function(_0x4184ed){if(_0x4184ed){return db['User'][_0xdcd8('0x5b')]({'where':{'id':_[_0xdcd8('0x2f')](_0x4184ed,'UserId'),'role':'agent'},'attributes':['id',_0xdcd8('0x2d'),_0xdcd8('0x5c'),_0xdcd8('0x5d'),_0xdcd8('0x5e')]});}})[_0xdcd8('0x27')](function(_0x1cf9ef){if(_0x1cf9ef){return{'count':_0x1cf9ef['count'],'rows':_[_0xdcd8('0x2f')](_0x1cf9ef[_0xdcd8('0x47')],function(_0x45fef6){return{'membername':_0x45fef6['name'],'UserId':_0x45fef6['id'],'queue_name':_0x32e94f['name'],'SmsQueueId':_0x32e94f['id'],'interface':util[_0xdcd8('0x5f')]('%s/%s',_0xdcd8('0x60'),_0x45fef6[_0xdcd8('0x2d')]),'penalty':0x0,'paused':_0x45fef6[_0xdcd8('0x5c')],'createdAt':_0x45fef6[_0xdcd8('0x5e')],'updatedAt':_0x45fef6[_0xdcd8('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x29cc0a,_0x492f0e))['catch'](handleError(_0x29cc0a,null));};exports['getTeams']=function(_0x59a068,_0x1d1a5d,_0x5723e9){var _0x3509cc={};var _0x31dafc={};var _0x23e8d0;var _0x10fd08;return db['SmsQueue'][_0xdcd8('0x61')]({'where':{'id':_0x59a068[_0xdcd8('0x4a')]['id']}})[_0xdcd8('0x27')](handleEntityNotFound(_0x1d1a5d,null))[_0xdcd8('0x27')](function(_0x21430d){if(_0x21430d){_0x23e8d0=_0x21430d;_0x31dafc[_0xdcd8('0x33')]=_[_0xdcd8('0x35')](db[_0xdcd8('0x62')][_0xdcd8('0x31')]);_0x31dafc[_0xdcd8('0x34')]=_[_0xdcd8('0x35')](_0x59a068[_0xdcd8('0x34')]);_0x31dafc['filters']=_[_0xdcd8('0x37')](_0x31dafc[_0xdcd8('0x33')],_0x31dafc[_0xdcd8('0x34')]);_0x3509cc[_0xdcd8('0x38')]=_[_0xdcd8('0x37')](_0x31dafc['model'],qs[_0xdcd8('0x39')](_0x59a068[_0xdcd8('0x34')][_0xdcd8('0x39')]));_0x3509cc[_0xdcd8('0x38')]=_0x3509cc[_0xdcd8('0x38')]['length']?_0x3509cc[_0xdcd8('0x38')]:_0x31dafc['model'];_0x3509cc[_0xdcd8('0x3c')]=qs[_0xdcd8('0x3d')](_0x59a068[_0xdcd8('0x34')][_0xdcd8('0x3d')]);_0x3509cc[_0xdcd8('0x3e')]=qs[_0xdcd8('0x36')](_[_0xdcd8('0x3f')](_0x59a068['query'],_0x31dafc['filters']));if(_0x59a068[_0xdcd8('0x34')][_0xdcd8('0x40')]){_0x3509cc[_0xdcd8('0x3e')]=_[_0xdcd8('0x41')](_0x3509cc[_0xdcd8('0x3e')],{'$or':_[_0xdcd8('0x2f')](_0x3509cc[_0xdcd8('0x38')],function(_0x48c147){var _0x1172b8={};_0x1172b8[_0x48c147]={'$like':'%'+_0x59a068[_0xdcd8('0x34')][_0xdcd8('0x40')]+'%'};return _0x1172b8;})});}_0x3509cc=_['merge']({},_0x3509cc,_0x59a068['options']);return _0x23e8d0[_0xdcd8('0x63')](_0x3509cc);}})[_0xdcd8('0x27')](function(_0x5dbc3b){if(_0x5dbc3b){_0x10fd08=_0x5dbc3b[_0xdcd8('0x4b')];if(!_0x59a068[_0xdcd8('0x34')][_0xdcd8('0x3a')](_0xdcd8('0x3b'))){_0x3509cc[_0xdcd8('0x21')]=qs['limit'](_0x59a068[_0xdcd8('0x34')][_0xdcd8('0x21')]);_0x3509cc[_0xdcd8('0x20')]=qs[_0xdcd8('0x20')](_0x59a068[_0xdcd8('0x34')][_0xdcd8('0x20')]);}return _0x23e8d0[_0xdcd8('0x63')](_0x3509cc);}})['then'](function(_0x2cc5fb){if(_0x2cc5fb){return _0x2cc5fb?{'count':_0x10fd08,'rows':_0x2cc5fb}:null;}})['then'](respondWithResult(_0x1d1a5d,null))[_0xdcd8('0x48')](handleError(_0x1d1a5d,null));};exports[_0xdcd8('0x64')]=function(_0x2a3221,_0x55cc24,_0x4d65bd){var _0xf3d132=_0x2a3221['body'][_0xdcd8('0x65')];return db[_0xdcd8('0x62')][_0xdcd8('0x46')]({'where':{'id':_0xf3d132},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdcd8('0x66'),'attributes':['id',_0xdcd8('0x2d'),_0xdcd8('0x67'),_0xdcd8('0x68'),_0xdcd8('0x69')],'raw':!![]}]})[_0xdcd8('0x27')](function(_0x57a455){if(_0x57a455){var _0x132b7a=_['flatMap'](_0x57a455,function(_0x536e4a){var _0x437d16=_0x536e4a[_0xdcd8('0x28')]({'plain':!![]});return _0x437d16[_0xdcd8('0x66')];});return db[_0xdcd8('0x30')][_0xdcd8('0x4c')]({'where':{'id':_0x2a3221['params']['id']}})[_0xdcd8('0x27')](function(_0x1c9e50){return db[_0xdcd8('0x6a')]['transaction'](function(_0x2f09ed){return _0x1c9e50[_0xdcd8('0x64')](_0xf3d132,{'transaction':_0x2f09ed})['then'](function(){return BPromise[_0xdcd8('0x6b')](_0x132b7a,function(_0x54ea4a){return db[_0xdcd8('0x59')]['findOrCreate']({'where':{'UserId':_0x54ea4a['id'],'SmsQueueId':_0x2a3221['params']['id']},'transaction':_0x2f09ed});});})[_0xdcd8('0x27')](function(){_0x132b7a[_0xdcd8('0x6c')](function(_0x56188c){socket['emit'](_0xdcd8('0x6d'),{'UserId':_0x56188c['id'],'SmsQueueId':_0x1c9e50['id']});});});});});}})[_0xdcd8('0x27')](respondWithStatusCode(_0x55cc24,null))[_0xdcd8('0x48')](handleError(_0x55cc24,null));};exports[_0xdcd8('0x6e')]=function(_0x3c9d21,_0x229b27,_0x339ed6){return db['Team'][_0xdcd8('0x46')]({'where':{'id':_0x3c9d21[_0xdcd8('0x34')][_0xdcd8('0x65')]},'attributes':['id'],'include':[{'model':db[_0xdcd8('0x6f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xdcd8('0x27')](handleEntityNotFound(_0x229b27,null))['then'](function(_0x4093d8){var _0x5b10e8=_[_0xdcd8('0x2f')](_0x4093d8,'id');var _0x1d3ea0=[];var _0x26365e=[];var _0x1c9750=squel['select']();_0x1c9750[_0xdcd8('0x70')](_0xdcd8('0x71'))[_0xdcd8('0x72')]('team_has_sms_queues','tq')['join'](_0xdcd8('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xdcd8('0x74'),_0x3c9d21['params']['id']);for(var _0x4844db=0x0;_0x4844db<_0x4093d8[_0xdcd8('0x4b')];_0x4844db+=0x1){let _0x30250c=_0x4093d8[_0x4844db];for(var _0x29a72d=0x0;_0x29a72d<_0x30250c[_0xdcd8('0x66')][_0xdcd8('0x4b')];_0x29a72d+=0x1){let _0x4fd227=_0x30250c[_0xdcd8('0x66')][_0x29a72d];var _0x439d42=_0x1c9750[_0xdcd8('0x75')]();_0x439d42[_0xdcd8('0x3e')](_0xdcd8('0x76'),_0x4fd227['id']);_0x26365e[_0xdcd8('0x77')](db[_0xdcd8('0x6a')][_0xdcd8('0x34')](_0x439d42[_0xdcd8('0x78')](),{'type':db[_0xdcd8('0x6a')][_0xdcd8('0x79')]['SELECT']})[_0xdcd8('0x27')](function(_0x2f4bfa){if(_0x2f4bfa[_0xdcd8('0x4b')]===0x1){return _0x4fd227['id'];}else{var _0x205a7d=_[_0xdcd8('0x7a')](_['map'](_0x2f4bfa,'TeamId'),function(_0x5f1812){return _[_0xdcd8('0x7b')](_0x5b10e8,_0x5f1812);});if(_0x205a7d){return _0x4fd227['id'];}}}));}}return BPromise['all'](_0x26365e)['then'](function(_0x4c540b){_0x1d3ea0=_(_0x1d3ea0)[_0xdcd8('0x7c')](_0x4c540b)[_0xdcd8('0x7d')]()[_0xdcd8('0x7e')]();return db[_0xdcd8('0x30')][_0xdcd8('0x4c')]({'where':{'id':_0x3c9d21['params']['id']}})[_0xdcd8('0x27')](function(_0x5cb5dc){return db[_0xdcd8('0x6a')]['transaction'](function(_0x219a84){return _0x5cb5dc[_0xdcd8('0x6e')](_0x3c9d21['query']['ids'],{'transaction':_0x219a84})[_0xdcd8('0x27')](function(){if(!_[_0xdcd8('0x7f')](_0x1d3ea0)){return _0x5cb5dc[_0xdcd8('0x80')](_0x1d3ea0,{'transaction':_0x219a84});}})[_0xdcd8('0x27')](function(){_0x1d3ea0[_0xdcd8('0x6c')](function(_0x18fdd2){socket[_0xdcd8('0x81')]('userSmsQueue:remove',{'UserId':_0x18fdd2,'SmsQueueId':_0x5cb5dc['id']});});});});});});})[_0xdcd8('0x27')](respondWithStatusCode(_0x229b27,null))[_0xdcd8('0x48')](handleError(_0x229b27,null));};exports[_0xdcd8('0x82')]=function(_0x51fee1,_0x40554c,_0x5d0108){return db[_0xdcd8('0x30')][_0xdcd8('0x4c')]({'where':{'id':_0x51fee1['params']['id']}})[_0xdcd8('0x27')](handleEntityNotFound(_0x40554c,null))['then'](function(_0x50e0cb){if(_0x50e0cb){return _0x50e0cb[_0xdcd8('0x82')](_0x51fee1[_0xdcd8('0x4e')][_0xdcd8('0x65')],_[_0xdcd8('0x83')](_0x51fee1[_0xdcd8('0x4e')],[_0xdcd8('0x65'),'id'])||{})[_0xdcd8('0x84')](function(_0x7ec41d){for(var _0x19ddbd=0x0;_0x19ddbd<_0x51fee1['body'][_0xdcd8('0x65')][_0xdcd8('0x4b')];_0x19ddbd+=0x1){socket[_0xdcd8('0x81')]('userSmsQueue:save',{'UserId':_0x51fee1[_0xdcd8('0x4e')]['ids'][_0x19ddbd],'SmsQueueId':_0x51fee1['params']['id']});}return _0x7ec41d;});}})[_0xdcd8('0x27')](respondWithResult(_0x40554c,null))[_0xdcd8('0x48')](handleError(_0x40554c,null));};exports['removeAgents']=function(_0x4e68a3,_0x365781,_0x14cc83){return db[_0xdcd8('0x30')][_0xdcd8('0x4c')]({'where':{'id':_0x4e68a3[_0xdcd8('0x4a')]['id']}})[_0xdcd8('0x27')](handleEntityNotFound(_0x365781,null))['then'](function(_0x341968){if(_0x341968){return _0x341968[_0xdcd8('0x80')](_0x4e68a3[_0xdcd8('0x34')]['ids'])[_0xdcd8('0x27')](function(){if(_[_0xdcd8('0x85')](_0x4e68a3[_0xdcd8('0x34')]['ids'])){for(var _0x4b5ce8=0x0;_0x4b5ce8<_0x4e68a3[_0xdcd8('0x34')][_0xdcd8('0x65')][_0xdcd8('0x4b')];_0x4b5ce8+=0x1){socket[_0xdcd8('0x81')]('userSmsQueue:remove',{'UserId':Number(_0x4e68a3['query'][_0xdcd8('0x65')][_0x4b5ce8]),'SmsQueueId':Number(_0x4e68a3['params']['id'])});}}else{socket['emit'](_0xdcd8('0x86'),{'UserId':Number(_0x4e68a3[_0xdcd8('0x34')][_0xdcd8('0x65')]),'SmsQueueId':Number(_0x4e68a3[_0xdcd8('0x4a')]['id'])});}});}})[_0xdcd8('0x27')](respondWithStatusCode(_0x365781,null))[_0xdcd8('0x48')](handleError(_0x365781,null));};exports[_0xdcd8('0x87')]=function(_0x1d412c,_0x2259bc,_0x187496){var _0x54e220={};var _0x28eeec={};var _0x42e01c;var _0x360bfe;return db[_0xdcd8('0x30')]['findOne']({'where':{'id':_0x1d412c[_0xdcd8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2259bc,null))[_0xdcd8('0x27')](function(_0x256b6b){if(_0x256b6b){_0x42e01c=_0x256b6b;_0x28eeec[_0xdcd8('0x33')]=_[_0xdcd8('0x35')](db['User'][_0xdcd8('0x31')]);_0x28eeec[_0xdcd8('0x34')]=_[_0xdcd8('0x35')](_0x1d412c[_0xdcd8('0x34')]);_0x28eeec[_0xdcd8('0x36')]=_['intersection'](_0x28eeec['model'],_0x28eeec[_0xdcd8('0x34')]);_0x54e220[_0xdcd8('0x38')]=_[_0xdcd8('0x37')](_0x28eeec[_0xdcd8('0x33')],qs[_0xdcd8('0x39')](_0x1d412c[_0xdcd8('0x34')][_0xdcd8('0x39')]));_0x54e220[_0xdcd8('0x38')]=_0x54e220[_0xdcd8('0x38')][_0xdcd8('0x4b')]?_0x54e220[_0xdcd8('0x38')]:_0x28eeec[_0xdcd8('0x33')];_0x54e220[_0xdcd8('0x3c')]=qs[_0xdcd8('0x3d')](_0x1d412c[_0xdcd8('0x34')][_0xdcd8('0x3d')]);_0x54e220[_0xdcd8('0x3e')]=qs[_0xdcd8('0x36')](_[_0xdcd8('0x3f')](_0x1d412c[_0xdcd8('0x34')],_0x28eeec['filters']));if(_0x1d412c['query'][_0xdcd8('0x40')]){_0x54e220['where']=_[_0xdcd8('0x41')](_0x54e220['where'],{'$or':_['map'](_0x54e220[_0xdcd8('0x38')],function(_0x367dda){var _0x480203={};_0x480203[_0x367dda]={'$like':'%'+_0x1d412c[_0xdcd8('0x34')]['filter']+'%'};return _0x480203;})});}_0x54e220=_[_0xdcd8('0x41')]({},_0x54e220,_0x1d412c[_0xdcd8('0x43')]);return _0x42e01c[_0xdcd8('0x87')](_0x54e220);}})['then'](function(_0x8f2b7f){if(_0x8f2b7f){_0x360bfe=_0x8f2b7f['length'];if(!_0x1d412c['query'][_0xdcd8('0x3a')](_0xdcd8('0x3b'))){_0x54e220[_0xdcd8('0x21')]=qs[_0xdcd8('0x21')](_0x1d412c['query']['limit']);_0x54e220[_0xdcd8('0x20')]=qs['offset'](_0x1d412c[_0xdcd8('0x34')][_0xdcd8('0x20')]);}return _0x42e01c[_0xdcd8('0x87')](_0x54e220);}})['then'](function(_0x5bd44f){if(_0x5bd44f){return _0x5bd44f?{'count':_0x360bfe,'rows':_0x5bd44f}:null;}})[_0xdcd8('0x27')](respondWithResult(_0x2259bc,null))[_0xdcd8('0x48')](handleError(_0x2259bc,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index c6a865a..c3e0b55 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 _0x918c=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x35fcb7,_0x3734c0){var _0x30f28a=function(_0x1da8bd){while(--_0x1da8bd){_0x35fcb7['push'](_0x35fcb7['shift']());}};_0x30f28a(++_0x3734c0);}(_0x918c,0x1b6));var _0xc918=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x918c[_0x11c573];return _0x6b72de;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xc918('0x0'))['db'][_0xc918('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc918('0x2')](0x0);var events={'afterCreate':_0xc918('0x3'),'afterUpdate':_0xc918('0x4'),'afterDestroy':_0xc918('0x5')};function emitEvent(_0x57bd3c){return function(_0x39e2ed,_0x1f81d8,_0x2f1102){SmsQueueEvents[_0xc918('0x6')](_0x57bd3c+':'+_0x39e2ed['id'],_0x39e2ed);SmsQueueEvents[_0xc918('0x6')](_0x57bd3c,_0x39e2ed);_0x2f1102(null);};}for(var e in events){if(events[_0xc918('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0xc918('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0xb65b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','SmsQueue'];(function(_0xe1d1fc,_0x4eb88c){var _0x2ae9c0=function(_0x27cc9f){while(--_0x27cc9f){_0xe1d1fc['push'](_0xe1d1fc['shift']());}};_0x2ae9c0(++_0x4eb88c);}(_0xb65b,0x139));var _0xbb65=function(_0x55e885,_0x57349f){_0x55e885=_0x55e885-0x0;var _0x375036=_0xb65b[_0x55e885];return _0x375036;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xbb65('0x0'))['db'][_0xbb65('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xbb65('0x2')](0x0);var events={'afterCreate':_0xbb65('0x3'),'afterUpdate':_0xbb65('0x4'),'afterDestroy':_0xbb65('0x5')};function emitEvent(_0x35c5f4){return function(_0x425d79,_0x20d524,_0x43dfb1){SmsQueueEvents[_0xbb65('0x6')](_0x35c5f4+':'+_0x425d79['id'],_0x425d79);SmsQueueEvents[_0xbb65('0x6')](_0x35c5f4,_0x425d79);_0x43dfb1(null);};}for(var e in events){if(events[_0xbb65('0x7')](e)){var event=events[e];SmsQueue[_0xbb65('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b962d74..fe2814f 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 _0xece0=['lodash','util','api','moment','request-promise','path','rimraf','exports','define','SmsQueue','sms_queues'];(function(_0x248249,_0x592c44){var _0x568cd6=function(_0x15ceba){while(--_0x15ceba){_0x248249['push'](_0x248249['shift']());}};_0x568cd6(++_0x592c44);}(_0xece0,0xa5));var _0x0ece=function(_0x1e5303,_0x36c0f0){_0x1e5303=_0x1e5303-0x0;var _0xd1556b=_0xece0[_0x1e5303];return _0xd1556b;};'use strict';var _=require(_0x0ece('0x0'));var util=require(_0x0ece('0x1'));var logger=require('../../config/logger')(_0x0ece('0x2'));var moment=require(_0x0ece('0x3'));var BPromise=require('bluebird');var rp=require(_0x0ece('0x4'));var fs=require('fs');var path=require(_0x0ece('0x5'));var rimraf=require(_0x0ece('0x6'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x0ece('0x7')]=function(_0x3a107d,_0xb736f9){return _0x3a107d[_0x0ece('0x8')](_0x0ece('0x9'),attributes,{'tableName':_0x0ece('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb377=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x4e63f1,_0x34a2db){var _0xdbd910=function(_0x40261f){while(--_0x40261f){_0x4e63f1['push'](_0x4e63f1['shift']());}};_0xdbd910(++_0x34a2db);}(_0xb377,0x1b6));var _0x7b37=function(_0x2f4c18,_0x5894ac){_0x2f4c18=_0x2f4c18-0x0;var _0x2cf7e0=_0xb377[_0x2f4c18];return _0x2cf7e0;};'use strict';var _=require(_0x7b37('0x0'));var util=require(_0x7b37('0x1'));var logger=require(_0x7b37('0x2'))(_0x7b37('0x3'));var moment=require(_0x7b37('0x4'));var BPromise=require(_0x7b37('0x5'));var rp=require(_0x7b37('0x6'));var fs=require('fs');var path=require(_0x7b37('0x7'));var rimraf=require(_0x7b37('0x8'));var config=require(_0x7b37('0x9'));var attributes=require(_0x7b37('0xa'));module[_0x7b37('0xb')]=function(_0x58edf9,_0x516b62){return _0x58edf9[_0x7b37('0xc')]('SmsQueue',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 00685f2..c9ff90d 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 _0x4534=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetSmsQueue','findAll','options','where','attributes','include','map','model','ShowSmsQueue','SmsQueue','find','lodash','util','bluebird','randomstring'];(function(_0x28fe92,_0x403572){var _0x3ff255=function(_0x3c2635){while(--_0x3c2635){_0x28fe92['push'](_0x28fe92['shift']());}};_0x3ff255(++_0x403572);}(_0x4534,0x16e));var _0x4453=function(_0x47e79f,_0x54ca1d){_0x47e79f=_0x47e79f-0x0;var _0x155671=_0x4534[_0x47e79f];return _0x155671;};'use strict';var _=require(_0x4453('0x0'));var util=require(_0x4453('0x1'));var moment=require('moment');var BPromise=require(_0x4453('0x2'));var rs=require(_0x4453('0x3'));var fs=require('fs');var Redis=require(_0x4453('0x4'));var db=require(_0x4453('0x5'))['db'];var utils=require(_0x4453('0x6'));var logger=require(_0x4453('0x7'))(_0x4453('0x8'));var config=require(_0x4453('0x9'));var jayson=require(_0x4453('0xa'));var client=jayson[_0x4453('0xb')][_0x4453('0xc')]({'port':0x232a});config[_0x4453('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4453('0xd')]));require(_0x4453('0xe'))[_0x4453('0xf')](socket);function respondWithRpcPromise(_0x3a355d,_0x436fc8,_0x3d3673){return new BPromise(function(_0x58ed5f,_0x272f03){return client['request'](_0x3a355d,_0x3d3673)[_0x4453('0x10')](function(_0xfb1b57){logger[_0x4453('0x11')](_0x4453('0x12'),_0x436fc8,_0x4453('0x13'));logger[_0x4453('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x436fc8,_0x4453('0x13'),JSON[_0x4453('0x15')](_0xfb1b57));if(_0xfb1b57[_0x4453('0x16')]){if(_0xfb1b57[_0x4453('0x16')][_0x4453('0x17')]===0x1f4){logger[_0x4453('0x16')](_0x4453('0x12'),_0x436fc8,_0xfb1b57['error'][_0x4453('0x18')]);return _0x272f03(_0xfb1b57[_0x4453('0x16')][_0x4453('0x18')]);}logger[_0x4453('0x16')](_0x4453('0x12'),_0x436fc8,_0xfb1b57[_0x4453('0x16')][_0x4453('0x18')]);return _0x58ed5f(_0xfb1b57[_0x4453('0x16')][_0x4453('0x18')]);}else{logger[_0x4453('0x11')]('SmsQueue,\x20%s,\x20%s',_0x436fc8,_0x4453('0x13'));_0x58ed5f(_0xfb1b57['result'][_0x4453('0x18')]);}})[_0x4453('0x19')](function(_0x145be7){logger[_0x4453('0x16')](_0x4453('0x12'),_0x436fc8,_0x145be7);_0x272f03(_0x145be7);});});}exports[_0x4453('0x1a')]=function(_0x43ee33){var _0x55141d=this;return new Promise(function(_0x158e0c,_0x37c270){return db['SmsQueue'][_0x4453('0x1b')]({'raw':_0x43ee33[_0x4453('0x1c')]?_0x43ee33['options']['raw']===undefined?!![]:![]:!![],'where':_0x43ee33[_0x4453('0x1c')]?_0x43ee33[_0x4453('0x1c')][_0x4453('0x1d')]||null:null,'attributes':_0x43ee33[_0x4453('0x1c')]?_0x43ee33[_0x4453('0x1c')][_0x4453('0x1e')]||null:null,'limit':_0x43ee33[_0x4453('0x1c')]?_0x43ee33[_0x4453('0x1c')]['limit']||null:null,'include':_0x43ee33[_0x4453('0x1c')]?_0x43ee33[_0x4453('0x1c')][_0x4453('0x1f')]?_[_0x4453('0x20')](_0x43ee33[_0x4453('0x1c')]['include'],function(_0x1e6d5c){return{'model':db[_0x1e6d5c[_0x4453('0x21')]],'as':_0x1e6d5c['as'],'attributes':_0x1e6d5c[_0x4453('0x1e')],'include':_0x1e6d5c[_0x4453('0x1f')]?_['map'](_0x1e6d5c[_0x4453('0x1f')],function(_0x707d43){return{'model':db[_0x707d43[_0x4453('0x21')]],'as':_0x707d43['as'],'attributes':_0x707d43['attributes'],'include':_0x707d43[_0x4453('0x1f')]?_['map'](_0x707d43['include'],function(_0x61f5a7){return{'model':db[_0x61f5a7[_0x4453('0x21')]],'as':_0x61f5a7['as'],'attributes':_0x61f5a7['attributes']};}):[]};}):[]};}):[]:[]})[_0x4453('0x10')](function(_0x177b3f){logger[_0x4453('0x11')](_0x4453('0x1a'),_0x43ee33);logger[_0x4453('0x14')](_0x4453('0x1a'),_0x43ee33,JSON[_0x4453('0x15')](_0x177b3f));_0x158e0c(_0x177b3f);})[_0x4453('0x19')](function(_0x1ce981){logger['error'](_0x4453('0x1a'),_0x1ce981[_0x4453('0x18')],_0x43ee33);_0x37c270(_0x55141d['error'](0x1f4,_0x1ce981[_0x4453('0x18')]));});});};exports[_0x4453('0x22')]=function(_0x39fed7){var _0x103730=this;return new Promise(function(_0x1693c0,_0x2d6eee){return db[_0x4453('0x23')][_0x4453('0x24')]({'raw':_0x39fed7['options']?_0x39fed7[_0x4453('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x39fed7[_0x4453('0x1c')]?_0x39fed7[_0x4453('0x1c')][_0x4453('0x1d')]||null:null,'attributes':_0x39fed7[_0x4453('0x1c')]?_0x39fed7[_0x4453('0x1c')][_0x4453('0x1e')]||null:null,'include':_0x39fed7['options']?_0x39fed7[_0x4453('0x1c')][_0x4453('0x1f')]?_[_0x4453('0x20')](_0x39fed7[_0x4453('0x1c')][_0x4453('0x1f')],function(_0x1fd504){return{'model':db[_0x1fd504[_0x4453('0x21')]],'as':_0x1fd504['as'],'attributes':_0x1fd504[_0x4453('0x1e')],'include':_0x1fd504[_0x4453('0x1f')]?_[_0x4453('0x20')](_0x1fd504[_0x4453('0x1f')],function(_0x4fd0b7){return{'model':db[_0x4fd0b7[_0x4453('0x21')]],'as':_0x4fd0b7['as'],'attributes':_0x4fd0b7[_0x4453('0x1e')],'include':_0x4fd0b7['include']?_[_0x4453('0x20')](_0x4fd0b7[_0x4453('0x1f')],function(_0x104245){return{'model':db[_0x104245[_0x4453('0x21')]],'as':_0x104245['as'],'attributes':_0x104245[_0x4453('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4453('0x10')](function(_0x3a0b63){logger['info'](_0x4453('0x22'),_0x39fed7);logger[_0x4453('0x14')]('ShowSmsQueue',_0x39fed7,JSON[_0x4453('0x15')](_0x3a0b63));_0x1693c0(_0x3a0b63);})[_0x4453('0x19')](function(_0x319f8d){logger[_0x4453('0x16')]('ShowSmsQueue',_0x319f8d[_0x4453('0x18')],_0x39fed7);_0x2d6eee(_0x103730['error'](0x1f4,_0x319f8d[_0x4453('0x18')]));});});}; \ No newline at end of file +var _0x0b51=['catch','raw','options','where','limit','include','map','model','attributes','GetSmsQueue','ShowSmsQueue','SmsQueue','find','then','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x10791d,_0x2562b6){var _0x1b4f9c=function(_0x3b2815){while(--_0x3b2815){_0x10791d['push'](_0x10791d['shift']());}};_0x1b4f9c(++_0x2562b6);}(_0x0b51,0x11f));var _0x10b5=function(_0x33929f,_0x3f17b1){_0x33929f=_0x33929f-0x0;var _0x11e881=_0x0b51[_0x33929f];return _0x11e881;};'use strict';var _=require(_0x10b5('0x0'));var util=require(_0x10b5('0x1'));var moment=require(_0x10b5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10b5('0x3'))['db'];var utils=require(_0x10b5('0x4'));var logger=require(_0x10b5('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x10b5('0x6')][_0x10b5('0x7')]({'port':0x232a});config[_0x10b5('0x8')]=_[_0x10b5('0x9')](config[_0x10b5('0x8')],{'host':_0x10b5('0xa'),'port':0x18eb});var socket=require(_0x10b5('0xb'))(new Redis(config[_0x10b5('0x8')]));require(_0x10b5('0xc'))[_0x10b5('0xd')](socket);function respondWithRpcPromise(_0x22bb4f,_0x1124b2,_0x33b90f){return new BPromise(function(_0xd3b1cd,_0x34d8d5){return client[_0x10b5('0xe')](_0x22bb4f,_0x33b90f)['then'](function(_0x5d30e0){logger[_0x10b5('0xf')](_0x10b5('0x10'),_0x1124b2,'request\x20sent');logger[_0x10b5('0x11')](_0x10b5('0x12'),_0x1124b2,_0x10b5('0x13'),JSON[_0x10b5('0x14')](_0x5d30e0));if(_0x5d30e0[_0x10b5('0x15')]){if(_0x5d30e0['error'][_0x10b5('0x16')]===0x1f4){logger[_0x10b5('0x15')](_0x10b5('0x10'),_0x1124b2,_0x5d30e0[_0x10b5('0x15')]['message']);return _0x34d8d5(_0x5d30e0[_0x10b5('0x15')]['message']);}logger[_0x10b5('0x15')](_0x10b5('0x10'),_0x1124b2,_0x5d30e0['error'][_0x10b5('0x17')]);return _0xd3b1cd(_0x5d30e0[_0x10b5('0x15')][_0x10b5('0x17')]);}else{logger[_0x10b5('0xf')](_0x10b5('0x10'),_0x1124b2,_0x10b5('0x13'));_0xd3b1cd(_0x5d30e0[_0x10b5('0x18')][_0x10b5('0x17')]);}})[_0x10b5('0x19')](function(_0x477afc){logger[_0x10b5('0x15')](_0x10b5('0x10'),_0x1124b2,_0x477afc);_0x34d8d5(_0x477afc);});});}exports['GetSmsQueue']=function(_0x2fa52c){var _0x162c25=this;return new Promise(function(_0x30ca5a,_0x44733e){return db['SmsQueue']['findAll']({'raw':_0x2fa52c['options']?_0x2fa52c['options'][_0x10b5('0x1a')]===undefined?!![]:![]:!![],'where':_0x2fa52c['options']?_0x2fa52c[_0x10b5('0x1b')][_0x10b5('0x1c')]||null:null,'attributes':_0x2fa52c[_0x10b5('0x1b')]?_0x2fa52c[_0x10b5('0x1b')]['attributes']||null:null,'limit':_0x2fa52c[_0x10b5('0x1b')]?_0x2fa52c['options'][_0x10b5('0x1d')]||null:null,'include':_0x2fa52c['options']?_0x2fa52c['options'][_0x10b5('0x1e')]?_[_0x10b5('0x1f')](_0x2fa52c[_0x10b5('0x1b')]['include'],function(_0x2813ae){return{'model':db[_0x2813ae[_0x10b5('0x20')]],'as':_0x2813ae['as'],'attributes':_0x2813ae[_0x10b5('0x21')],'include':_0x2813ae[_0x10b5('0x1e')]?_[_0x10b5('0x1f')](_0x2813ae[_0x10b5('0x1e')],function(_0x31a891){return{'model':db[_0x31a891[_0x10b5('0x20')]],'as':_0x31a891['as'],'attributes':_0x31a891[_0x10b5('0x21')],'include':_0x31a891['include']?_[_0x10b5('0x1f')](_0x31a891[_0x10b5('0x1e')],function(_0x5235be){return{'model':db[_0x5235be[_0x10b5('0x20')]],'as':_0x5235be['as'],'attributes':_0x5235be[_0x10b5('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2a93d4){logger[_0x10b5('0xf')](_0x10b5('0x22'),_0x2fa52c);logger[_0x10b5('0x11')](_0x10b5('0x22'),_0x2fa52c,JSON[_0x10b5('0x14')](_0x2a93d4));_0x30ca5a(_0x2a93d4);})[_0x10b5('0x19')](function(_0x283bc3){logger[_0x10b5('0x15')](_0x10b5('0x22'),_0x283bc3['message'],_0x2fa52c);_0x44733e(_0x162c25['error'](0x1f4,_0x283bc3[_0x10b5('0x17')]));});});};exports[_0x10b5('0x23')]=function(_0x2d9dd6){var _0x3d4591=this;return new Promise(function(_0x42d628,_0x41311b){return db[_0x10b5('0x24')][_0x10b5('0x25')]({'raw':_0x2d9dd6[_0x10b5('0x1b')]?_0x2d9dd6[_0x10b5('0x1b')][_0x10b5('0x1a')]===undefined?!![]:![]:!![],'where':_0x2d9dd6['options']?_0x2d9dd6['options'][_0x10b5('0x1c')]||null:null,'attributes':_0x2d9dd6[_0x10b5('0x1b')]?_0x2d9dd6['options'][_0x10b5('0x21')]||null:null,'include':_0x2d9dd6[_0x10b5('0x1b')]?_0x2d9dd6[_0x10b5('0x1b')]['include']?_[_0x10b5('0x1f')](_0x2d9dd6[_0x10b5('0x1b')][_0x10b5('0x1e')],function(_0x5d3c4a){return{'model':db[_0x5d3c4a[_0x10b5('0x20')]],'as':_0x5d3c4a['as'],'attributes':_0x5d3c4a[_0x10b5('0x21')],'include':_0x5d3c4a[_0x10b5('0x1e')]?_[_0x10b5('0x1f')](_0x5d3c4a['include'],function(_0x4420e3){return{'model':db[_0x4420e3[_0x10b5('0x20')]],'as':_0x4420e3['as'],'attributes':_0x4420e3[_0x10b5('0x21')],'include':_0x4420e3[_0x10b5('0x1e')]?_[_0x10b5('0x1f')](_0x4420e3[_0x10b5('0x1e')],function(_0xfb9f5){return{'model':db[_0xfb9f5[_0x10b5('0x20')]],'as':_0xfb9f5['as'],'attributes':_0xfb9f5['attributes']};}):[]};}):[]};}):[]:[]})[_0x10b5('0x26')](function(_0xff0bae){logger[_0x10b5('0xf')](_0x10b5('0x23'),_0x2d9dd6);logger[_0x10b5('0x11')](_0x10b5('0x23'),_0x2d9dd6,JSON[_0x10b5('0x14')](_0xff0bae));_0x42d628(_0xff0bae);})[_0x10b5('0x19')](function(_0x53bcc2){logger[_0x10b5('0x15')](_0x10b5('0x23'),_0x53bcc2['message'],_0x2d9dd6);_0x41311b(_0x3d4591[_0x10b5('0x15')](0x1f4,_0x53bcc2[_0x10b5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index b526773..62f660e 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 _0xb1f5=['register','smsQueue:','./smsQueue.events','save','remove','emit','removeListener'];(function(_0x1ebb10,_0x156b3e){var _0x20d709=function(_0x4cc093){while(--_0x4cc093){_0x1ebb10['push'](_0x1ebb10['shift']());}};_0x20d709(++_0x156b3e);}(_0xb1f5,0x1f3));var _0x5b1f=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb1f5[_0x42cae2];return _0x5f256f;};'use strict';var SmsQueueEvents=require(_0x5b1f('0x0'));var events=[_0x5b1f('0x1'),_0x5b1f('0x2'),'update'];function createListener(_0x407e74,_0x2cb6ed){return function(_0xb86ea4){_0x2cb6ed[_0x5b1f('0x3')](_0x407e74,_0xb86ea4);};}function removeListener(_0x39ec03,_0x266897){return function(){SmsQueueEvents[_0x5b1f('0x4')](_0x39ec03,_0x266897);};}exports[_0x5b1f('0x5')]=function(_0x104d17){for(var _0x2104fa=0x0,_0x1285ff=events['length'];_0x2104fa<_0x1285ff;_0x2104fa++){var _0x4fcc0a=events[_0x2104fa];var _0x4bdcc3=createListener(_0x5b1f('0x6')+_0x4fcc0a,_0x104d17);SmsQueueEvents['on'](_0x4fcc0a,_0x4bdcc3);}}; \ No newline at end of file +var _0x33d2=['./smsQueue.events','save','remove','update','emit','removeListener','register','length','smsQueue:'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x33d2,0x7e));var _0x233d=function(_0x5b086e,_0x5eb6c0){_0x5b086e=_0x5b086e-0x0;var _0x3e2c2c=_0x33d2[_0x5b086e];return _0x3e2c2c;};'use strict';var SmsQueueEvents=require(_0x233d('0x0'));var events=[_0x233d('0x1'),_0x233d('0x2'),_0x233d('0x3')];function createListener(_0x4e8eb7,_0x3f63f1){return function(_0xc2b30e){_0x3f63f1[_0x233d('0x4')](_0x4e8eb7,_0xc2b30e);};}function removeListener(_0x149753,_0x4b2df2){return function(){SmsQueueEvents[_0x233d('0x5')](_0x149753,_0x4b2df2);};}exports[_0x233d('0x6')]=function(_0x34531a){for(var _0x202b6d=0x0,_0x5819d4=events[_0x233d('0x7')];_0x202b6d<_0x5819d4;_0x202b6d++){var _0x399069=events[_0x202b6d];var _0x23dd94=createListener(_0x233d('0x8')+_0x399069,_0x34531a);SmsQueueEvents['on'](_0x399069,_0x23dd94);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 545cdfb..4f18306 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 _0xb3bb=['index','/describe','describe','isAuthenticated','show','post','put','update','delete','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get'];(function(_0x2ed6f9,_0x563330){var _0x5d9ad9=function(_0x2440c8){while(--_0x2440c8){_0x2ed6f9['push'](_0x2ed6f9['shift']());}};_0x5d9ad9(++_0x563330);}(_0xb3bb,0x15d));var _0xbb3b=function(_0x50a29b,_0x29e2f9){_0x50a29b=_0x50a29b-0x0;var _0x96f536=_0xb3bb[_0x50a29b];return _0x96f536;};'use strict';var multer=require('multer');var util=require(_0xbb3b('0x0'));var path=require(_0xbb3b('0x1'));var timeout=require('connect-timeout');var express=require(_0xbb3b('0x2'));var router=express[_0xbb3b('0x3')]();var auth=require(_0xbb3b('0x4'));var interaction=require(_0xbb3b('0x5'));var config=require('../../config/environment');var controller=require(_0xbb3b('0x6'));router[_0xbb3b('0x7')]('/',auth['isAuthenticated'](),controller[_0xbb3b('0x8')]);router[_0xbb3b('0x7')](_0xbb3b('0x9'),auth['isAuthenticated'](),controller[_0xbb3b('0xa')]);router['get']('/:id',auth[_0xbb3b('0xb')](),controller[_0xbb3b('0xc')]);router[_0xbb3b('0xd')]('/',auth[_0xbb3b('0xb')](),controller['create']);router[_0xbb3b('0xe')]('/:id',auth[_0xbb3b('0xb')](),controller[_0xbb3b('0xf')]);router[_0xbb3b('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2fed=['../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x55ac52,_0x566bcf){var _0x5a8201=function(_0x25f166){while(--_0x25f166){_0x55ac52['push'](_0x55ac52['shift']());}};_0x5a8201(++_0x566bcf);}(_0x2fed,0x177));var _0xd2fe=function(_0x231c8e,_0x26b8b2){_0x231c8e=_0x231c8e-0x0;var _0x1e0b76=_0x2fed[_0x231c8e];return _0x1e0b76;};'use strict';var multer=require(_0xd2fe('0x0'));var util=require(_0xd2fe('0x1'));var path=require(_0xd2fe('0x2'));var timeout=require(_0xd2fe('0x3'));var express=require(_0xd2fe('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd2fe('0x5'));var config=require(_0xd2fe('0x6'));var controller=require(_0xd2fe('0x7'));router[_0xd2fe('0x8')]('/',auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xa')]);router[_0xd2fe('0x8')](_0xd2fe('0xb'),auth['isAuthenticated'](),controller[_0xd2fe('0xc')]);router[_0xd2fe('0x8')](_0xd2fe('0xd'),auth[_0xd2fe('0x9')](),controller[_0xd2fe('0xe')]);router[_0xd2fe('0xf')]('/',auth[_0xd2fe('0x9')](),controller[_0xd2fe('0x10')]);router[_0xd2fe('0x11')](_0xd2fe('0xd'),auth[_0xd2fe('0x9')](),controller['update']);router[_0xd2fe('0x12')]('/:id',auth[_0xd2fe('0x9')](),controller['destroy']);module[_0xd2fe('0x13')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index a2fbc4f..40adba0 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 _0x8da4=['DATE','moment','exports','STRING'];(function(_0x41290b,_0x29deea){var _0x4bf1d7=function(_0x3ba754){while(--_0x3ba754){_0x41290b['push'](_0x41290b['shift']());}};_0x4bf1d7(++_0x29deea);}(_0x8da4,0x1f1));var _0x48da=function(_0x4974b0,_0x4da078){_0x4974b0=_0x4974b0-0x0;var _0x1f14d6=_0x8da4[_0x4974b0];return _0x1f14d6;};'use strict';var moment=require(_0x48da('0x0'));var Sequelize=require('sequelize');module[_0x48da('0x1')]={'uniqueid':{'type':Sequelize[_0x48da('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x48da('0x3')]},'leaveAt':{'type':Sequelize[_0x48da('0x3')]},'acceptAt':{'type':Sequelize[_0x48da('0x3')]},'exitAt':{'type':Sequelize[_0x48da('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9a31=['STRING','DATE','moment','sequelize','exports'];(function(_0x1e7a76,_0x2ca412){var _0x9edfe5=function(_0x28e4c6){while(--_0x28e4c6){_0x1e7a76['push'](_0x1e7a76['shift']());}};_0x9edfe5(++_0x2ca412);}(_0x9a31,0x115));var _0x19a3=function(_0xad57ee,_0x2823a6){_0xad57ee=_0xad57ee-0x0;var _0x3eaea9=_0x9a31[_0xad57ee];return _0x3eaea9;};'use strict';var moment=require(_0x19a3('0x0'));var Sequelize=require(_0x19a3('0x1'));module[_0x19a3('0x2')]={'uniqueid':{'type':Sequelize[_0x19a3('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x19a3('0x4')]},'leaveAt':{'type':Sequelize[_0x19a3('0x4')]},'acceptAt':{'type':Sequelize[_0x19a3('0x4')]},'exitAt':{'type':Sequelize[_0x19a3('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 65d23c5..b42525f 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 _0xc4aa=['request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xc4aa[_0x5c2e3e];return _0x53f64a;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];function respondWithStatusCode(_0x2a0776,_0x24291d){_0x24291d=_0x24291d||0xcc;return function(_0x5e16aa){if(_0x5e16aa){return _0x2a0776[_0xac4a('0x16')](_0x24291d);}return _0x2a0776[_0xac4a('0x17')](_0x24291d)[_0xac4a('0x18')]();};}function respondWithResult(_0x6e00d4,_0x1b4313){_0x1b4313=_0x1b4313||0xc8;return function(_0x3b71c0){if(_0x3b71c0){return _0x6e00d4[_0xac4a('0x17')](_0x1b4313)[_0xac4a('0x19')](_0x3b71c0);}};}function respondWithFilteredResult(_0x190418,_0x42c7fc){return function(_0x11e101){if(_0x11e101){var _0x26dbb8=_0x11e101[_0xac4a('0x1a')],_0x4a2119=_0x42c7fc[_0xac4a('0x1b')],_0x402fff=_0x42c7fc[_0xac4a('0x1b')]+_0x42c7fc[_0xac4a('0x1c')],_0x34d797;if(_0x402fff>=_0x26dbb8){_0x402fff=_0x26dbb8;_0x34d797=0xc8;}else{_0x34d797=0xce;}_0x190418[_0xac4a('0x17')](_0x34d797);return _0x190418[_0xac4a('0x1d')]('Content-Range',_0x4a2119+'-'+_0x402fff+'/'+_0x26dbb8)['json'](_0x11e101);}return null;};}function patchUpdates(_0x21a729){return function(_0x13c8eb){try{jsonpatch[_0xac4a('0x1e')](_0x13c8eb,_0x21a729,!![]);}catch(_0x4d837c){return BPromise[_0xac4a('0x1f')](_0x4d837c);}return _0x13c8eb[_0xac4a('0x20')]();};}function saveUpdates(_0x3752e4,_0x3a3cdb){return function(_0x123694){if(_0x123694){return _0x123694[_0xac4a('0x21')](_0x3752e4)[_0xac4a('0x22')](function(_0x3ca790){return _0x3ca790;});}return null;};}function removeEntity(_0x534092,_0x3d8f0a){return function(_0x3204ad){if(_0x3204ad){return _0x3204ad['destroy']()[_0xac4a('0x22')](function(){_0x534092[_0xac4a('0x17')](0xcc)[_0xac4a('0x18')]();});}};}function handleEntityNotFound(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(!_0x1b7998){_0x947d8e[_0xac4a('0x16')](0x194);}return _0x1b7998;};}function handleError(_0x15435c,_0x412494){_0x412494=_0x412494||0x1f4;return function(_0x594f36){logger[_0xac4a('0x23')](_0x594f36[_0xac4a('0x24')]);if(_0x594f36[_0xac4a('0x25')]){delete _0x594f36[_0xac4a('0x25')];}_0x15435c[_0xac4a('0x17')](_0x412494)[_0xac4a('0x26')](_0x594f36);};}exports[_0xac4a('0x27')]=function(_0x14832b,_0x472c57){var _0x1c13dc={},_0x20202c={},_0x4e17ce={'count':0x0,'rows':[]};var _0x23b061=_[_0xac4a('0x28')](db[_0xac4a('0x29')][_0xac4a('0x2a')],function(_0x116700){return{'name':_0x116700['fieldName'],'type':_0x116700['type'][_0xac4a('0x2b')]};});_0x20202c[_0xac4a('0x2c')]=_[_0xac4a('0x28')](_0x23b061,'name');_0x20202c['query']=_[_0xac4a('0x2d')](_0x14832b[_0xac4a('0x2e')]);_0x20202c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x20202c[_0xac4a('0x2c')],_0x20202c['query']);_0x1c13dc[_0xac4a('0x31')]=_['intersection'](_0x20202c[_0xac4a('0x2c')],qs['fields'](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x1c13dc[_0xac4a('0x31')]=_0x1c13dc[_0xac4a('0x31')][_0xac4a('0x33')]?_0x1c13dc[_0xac4a('0x31')]:_0x20202c[_0xac4a('0x2c')];if(!_0x14832b[_0xac4a('0x2e')][_0xac4a('0x34')](_0xac4a('0x35'))){_0x1c13dc[_0xac4a('0x1c')]=qs[_0xac4a('0x1c')](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x1c')]);_0x1c13dc['offset']=qs[_0xac4a('0x1b')](_0x14832b[_0xac4a('0x2e')]['offset']);}_0x1c13dc[_0xac4a('0x36')]=qs[_0xac4a('0x37')](_0x14832b['query']['sort']);_0x1c13dc[_0xac4a('0x38')]=qs[_0xac4a('0x2f')](_[_0xac4a('0x39')](_0x14832b[_0xac4a('0x2e')],_0x20202c['filters']),_0x23b061);if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]){_0x1c13dc['where']=_[_0xac4a('0x3b')](_0x1c13dc[_0xac4a('0x38')],{'$or':_[_0xac4a('0x28')](_0x23b061,function(_0x5f0eb8){if(_0x5f0eb8[_0xac4a('0x3c')]!==_0xac4a('0x3d')){var _0x1b5427={};_0x1b5427[_0x5f0eb8['name']]={'$like':'%'+_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]+'%'};return _0x1b5427;}})});}_0x1c13dc=_['merge']({},_0x1c13dc,_0x14832b['options']);var _0x4319a1={'where':_0x1c13dc['where']};return db['SmsQueueReport']['count'](_0x4319a1)['then'](function(_0x41b757){_0x4e17ce[_0xac4a('0x1a')]=_0x41b757;if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1c13dc[_0xac4a('0x3f')]=[{'all':!![]}];}return db[_0xac4a('0x29')][_0xac4a('0x40')](_0x1c13dc);})[_0xac4a('0x22')](function(_0x28292c){_0x4e17ce[_0xac4a('0x41')]=_0x28292c;return _0x4e17ce;})[_0xac4a('0x22')](respondWithFilteredResult(_0x472c57,_0x1c13dc))[_0xac4a('0x42')](handleError(_0x472c57,null));};exports['show']=function(_0x5086ff,_0x5cd24f){var _0x1e1cc5={'raw':!![],'where':{'id':_0x5086ff[_0xac4a('0x43')]['id']}},_0x5c46a={};_0x5c46a[_0xac4a('0x2c')]=_[_0xac4a('0x2d')](db[_0xac4a('0x29')][_0xac4a('0x2a')]);_0x5c46a[_0xac4a('0x2e')]=_[_0xac4a('0x2d')](_0x5086ff[_0xac4a('0x2e')]);_0x5c46a['filters']=_[_0xac4a('0x30')](_0x5c46a[_0xac4a('0x2c')],_0x5c46a[_0xac4a('0x2e')]);_0x1e1cc5[_0xac4a('0x31')]=_[_0xac4a('0x30')](_0x5c46a['model'],qs[_0xac4a('0x32')](_0x5086ff[_0xac4a('0x2e')]['fields']));_0x1e1cc5[_0xac4a('0x31')]=_0x1e1cc5['attributes'][_0xac4a('0x33')]?_0x1e1cc5[_0xac4a('0x31')]:_0x5c46a[_0xac4a('0x2c')];if(_0x5086ff[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1e1cc5[_0xac4a('0x3f')]=[{'all':!![]}];}_0x1e1cc5=_[_0xac4a('0x3b')]({},_0x1e1cc5,_0x5086ff[_0xac4a('0x44')]);return db[_0xac4a('0x29')][_0xac4a('0x45')](_0x1e1cc5)[_0xac4a('0x22')](handleEntityNotFound(_0x5cd24f,null))[_0xac4a('0x22')](respondWithResult(_0x5cd24f,null))['catch'](handleError(_0x5cd24f,null));};exports[_0xac4a('0x46')]=function(_0x41d11d,_0xeca4e9){return db['SmsQueueReport'][_0xac4a('0x46')](_0x41d11d[_0xac4a('0x47')],{})['then'](respondWithResult(_0xeca4e9,0xc9))[_0xac4a('0x42')](handleError(_0xeca4e9,null));};exports['update']=function(_0x244950,_0xe620f6){if(_0x244950[_0xac4a('0x47')]['id']){delete _0x244950['body']['id'];}return db['SmsQueueReport'][_0xac4a('0x45')]({'where':{'id':_0x244950['params']['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0xe620f6,null))['then'](saveUpdates(_0x244950[_0xac4a('0x47')],null))['then'](respondWithResult(_0xe620f6,null))[_0xac4a('0x42')](handleError(_0xe620f6,null));};exports[_0xac4a('0x48')]=function(_0x424f9b,_0x1c8c39){return db['SmsQueueReport'][_0xac4a('0x45')]({'where':{'id':_0x424f9b[_0xac4a('0x43')]['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0x1c8c39,null))[_0xac4a('0x22')](removeEntity(_0x1c8c39,null))[_0xac4a('0x42')](handleError(_0x1c8c39,null));};exports[_0xac4a('0x49')]=function(_0x187306,_0x4e6e19){return db[_0xac4a('0x29')][_0xac4a('0x49')]()['then'](respondWithResult(_0x4e6e19,null))[_0xac4a('0x42')](handleError(_0x4e6e19,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','pick','filter','where','merge','VIRTUAL','options','SmsQueueReport','count','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','html-pdf'];(function(_0x4a4b2c,_0x5a8c71){var _0x458f8f=function(_0x521f7a){while(--_0x521f7a){_0x4a4b2c['push'](_0x4a4b2c['shift']());}};_0x458f8f(++_0x5a8c71);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=_[_0x7995('0x2a')](db['SmsQueueReport'][_0x7995('0x2b')],function(_0x514445){return{'name':_0x514445[_0x7995('0x2c')],'type':_0x514445[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x49bc7e['model']=_['map'](_0x132a42,'name');_0x49bc7e[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x47625f[_0x7995('0x2f')]);_0x49bc7e[_0x7995('0x31')]=_[_0x7995('0x32')](_0x49bc7e[_0x7995('0x33')],_0x49bc7e['query']);_0x229742['attributes']=_[_0x7995('0x32')](_0x49bc7e['model'],qs[_0x7995('0x34')](_0x47625f[_0x7995('0x2f')][_0x7995('0x34')]));_0x229742[_0x7995('0x35')]=_0x229742[_0x7995('0x35')]['length']?_0x229742[_0x7995('0x35')]:_0x49bc7e[_0x7995('0x33')];if(!_0x47625f['query']['hasOwnProperty']('nolimit')){_0x229742[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x47625f['query'][_0x7995('0x1f')]);_0x229742['offset']=qs[_0x7995('0x1e')](_0x47625f[_0x7995('0x2f')][_0x7995('0x1e')]);}_0x229742['order']=qs['sort'](_0x47625f[_0x7995('0x2f')]['sort']);_0x229742['where']=qs[_0x7995('0x31')](_[_0x7995('0x36')](_0x47625f['query'],_0x49bc7e[_0x7995('0x31')]),_0x132a42);if(_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]){_0x229742[_0x7995('0x38')]=_[_0x7995('0x39')](_0x229742['where'],{'$or':_[_0x7995('0x2a')](_0x132a42,function(_0x242713){if(_0x242713[_0x7995('0x2d')]!==_0x7995('0x3a')){var _0x4b1541={};_0x4b1541[_0x242713[_0x7995('0x28')]]={'$like':'%'+_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]+'%'};return _0x4b1541;}})});}_0x229742=_[_0x7995('0x39')]({},_0x229742,_0x47625f[_0x7995('0x3b')]);var _0x1035dc={'where':_0x229742['where']};return db[_0x7995('0x3c')][_0x7995('0x3d')](_0x1035dc)[_0x7995('0x24')](function(_0x2ea47f){_0xf16cc2[_0x7995('0x3d')]=_0x2ea47f;if(_0x47625f[_0x7995('0x2f')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x3c')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x270d52){_0xf16cc2[_0x7995('0x41')]=_0x270d52;return _0xf16cc2;})['then'](respondWithFilteredResult(_0x5911c3,_0x229742))['catch'](handleError(_0x5911c3,null));};exports[_0x7995('0x42')]=function(_0x7325e8,_0x58523e){var _0x4b0855={'raw':!![],'where':{'id':_0x7325e8['params']['id']}},_0x3f8522={};_0x3f8522['model']=_[_0x7995('0x30')](db[_0x7995('0x3c')][_0x7995('0x2b')]);_0x3f8522['query']=_[_0x7995('0x30')](_0x7325e8['query']);_0x3f8522[_0x7995('0x31')]=_['intersection'](_0x3f8522['model'],_0x3f8522[_0x7995('0x2f')]);_0x4b0855[_0x7995('0x35')]=_[_0x7995('0x32')](_0x3f8522[_0x7995('0x33')],qs['fields'](_0x7325e8[_0x7995('0x2f')][_0x7995('0x34')]));_0x4b0855[_0x7995('0x35')]=_0x4b0855[_0x7995('0x35')]['length']?_0x4b0855['attributes']:_0x3f8522[_0x7995('0x33')];if(_0x7325e8['query'][_0x7995('0x3e')]){_0x4b0855['include']=[{'all':!![]}];}_0x4b0855=_[_0x7995('0x39')]({},_0x4b0855,_0x7325e8['options']);return db[_0x7995('0x3c')][_0x7995('0x43')](_0x4b0855)['then'](handleEntityNotFound(_0x58523e,null))[_0x7995('0x24')](respondWithResult(_0x58523e,null))[_0x7995('0x44')](handleError(_0x58523e,null));};exports[_0x7995('0x45')]=function(_0xb70a51,_0x4c6837){return db[_0x7995('0x3c')][_0x7995('0x45')](_0xb70a51[_0x7995('0x46')],{})['then'](respondWithResult(_0x4c6837,0xc9))[_0x7995('0x44')](handleError(_0x4c6837,null));};exports[_0x7995('0x47')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x46')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3c')][_0x7995('0x43')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x46')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x44')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3c')]['find']({'where':{'id':_0xddf537[_0x7995('0x48')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x49')]=function(_0x1fe77e,_0x12d4b8){return db['SmsQueueReport']['describe']()['then'](respondWithResult(_0x12d4b8,null))[_0x7995('0x44')](handleError(_0x12d4b8,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 9e1eaa9..c55b2de 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 _0x0911=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SmsQueueReport','uniqueid','util','../../config/logger','api'];(function(_0x4defbc,_0x61768e){var _0x5b266e=function(_0x3cafd4){while(--_0x3cafd4){_0x4defbc['push'](_0x4defbc['shift']());}};_0x5b266e(++_0x61768e);}(_0x0911,0x189));var _0x1091=function(_0x151381,_0x97b314){_0x151381=_0x151381-0x0;var _0x2afab6=_0x0911[_0x151381];return _0x2afab6;};'use strict';var _=require('lodash');var util=require(_0x1091('0x0'));var logger=require(_0x1091('0x1'))(_0x1091('0x2'));var moment=require(_0x1091('0x3'));var BPromise=require(_0x1091('0x4'));var rp=require(_0x1091('0x5'));var fs=require('fs');var path=require(_0x1091('0x6'));var rimraf=require(_0x1091('0x7'));var config=require(_0x1091('0x8'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x5091a0,_0x53fe82){return _0x5091a0[_0x1091('0x9')](_0x1091('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x1091('0xb'),'fields':[_0x1091('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e8e=['./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x57e05f,_0x318b8d){var _0x435e54=function(_0x5de9eb){while(--_0x5de9eb){_0x57e05f['push'](_0x57e05f['shift']());}};_0x435e54(++_0x318b8d);}(_0x8e8e,0x6f));var _0xe8e8=function(_0x2706dc,_0x1d54d6){_0x2706dc=_0x2706dc-0x0;var _0x1de4cb=_0x8e8e[_0x2706dc];return _0x1de4cb;};'use strict';var _=require(_0xe8e8('0x0'));var util=require(_0xe8e8('0x1'));var logger=require(_0xe8e8('0x2'))('api');var moment=require(_0xe8e8('0x3'));var BPromise=require(_0xe8e8('0x4'));var rp=require(_0xe8e8('0x5'));var fs=require('fs');var path=require(_0xe8e8('0x6'));var rimraf=require(_0xe8e8('0x7'));var config=require(_0xe8e8('0x8'));var attributes=require(_0xe8e8('0x9'));module[_0xe8e8('0xa')]=function(_0x5e26b6,_0x1db7af){return _0x5e26b6[_0xe8e8('0xb')](_0xe8e8('0xc'),attributes,{'tableName':_0xe8e8('0xd'),'paranoid':![],'indexes':[{'name':_0xe8e8('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 79e690a..2c662ff 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 _0x12f9=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','where','attributes','then','UpdateSmsQueueReport','lodash','util','moment','bluebird','ioredis'];(function(_0x4feee9,_0x2dc91f){var _0x3b7d27=function(_0xefb5ca){while(--_0xefb5ca){_0x4feee9['push'](_0x4feee9['shift']());}};_0x3b7d27(++_0x2dc91f);}(_0x12f9,0x15b));var _0x912f=function(_0x5604d1,_0x3805d9){_0x5604d1=_0x5604d1-0x0;var _0x27b343=_0x12f9[_0x5604d1];return _0x27b343;};'use strict';var _=require(_0x912f('0x0'));var util=require(_0x912f('0x1'));var moment=require(_0x912f('0x2'));var BPromise=require(_0x912f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x912f('0x4'));var db=require(_0x912f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x912f('0x6'))(_0x912f('0x7'));var config=require(_0x912f('0x8'));var jayson=require(_0x912f('0x9'));var client=jayson[_0x912f('0xa')][_0x912f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfc85e1,_0x56e28a,_0x47bd48){return new BPromise(function(_0x4e6c95,_0xaa7e10){return client['request'](_0xfc85e1,_0x47bd48)['then'](function(_0x5467d3){logger[_0x912f('0xc')](_0x912f('0xd'),_0x56e28a,'request\x20sent');logger['debug'](_0x912f('0xe'),_0x56e28a,_0x912f('0xf'),JSON[_0x912f('0x10')](_0x5467d3));if(_0x5467d3[_0x912f('0x11')]){if(_0x5467d3['error'][_0x912f('0x12')]===0x1f4){logger[_0x912f('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x56e28a,_0x5467d3[_0x912f('0x11')][_0x912f('0x13')]);return _0xaa7e10(_0x5467d3[_0x912f('0x11')][_0x912f('0x13')]);}logger[_0x912f('0x11')](_0x912f('0xd'),_0x56e28a,_0x5467d3[_0x912f('0x11')][_0x912f('0x13')]);return _0x4e6c95(_0x5467d3[_0x912f('0x11')][_0x912f('0x13')]);}else{logger[_0x912f('0xc')](_0x912f('0xd'),_0x56e28a,_0x912f('0xf'));_0x4e6c95(_0x5467d3[_0x912f('0x14')][_0x912f('0x13')]);}})[_0x912f('0x15')](function(_0x237446){logger[_0x912f('0x11')](_0x912f('0xd'),_0x56e28a,_0x237446);_0xaa7e10(_0x237446);});});}exports[_0x912f('0x16')]=function(_0x596bca){var _0x456168=this;return new Promise(function(_0x23f5c8,_0x45b917){return db[_0x912f('0x17')][_0x912f('0x18')](_0x596bca[_0x912f('0x19')],{'raw':_0x596bca['options']?_0x596bca[_0x912f('0x1a')][_0x912f('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x47b05a){logger[_0x912f('0xc')](_0x912f('0x16'),_0x596bca);logger['debug'](_0x912f('0x16'),_0x596bca,JSON['stringify'](_0x47b05a));_0x23f5c8(_0x47b05a);})[_0x912f('0x15')](function(_0x465fc3){logger[_0x912f('0x11')](_0x912f('0x16'),_0x465fc3[_0x912f('0x13')],_0x596bca);_0x45b917(_0x456168[_0x912f('0x11')](0x1f4,_0x465fc3['message']));});});};exports['UpdateSmsQueueReport']=function(_0x287683){var _0x247ed4=this;return new Promise(function(_0x512caf,_0x1f7072){return db[_0x912f('0x17')]['update'](_0x287683[_0x912f('0x19')],{'raw':_0x287683[_0x912f('0x1a')]?_0x287683['options'][_0x912f('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287683['options']?_0x287683[_0x912f('0x1a')][_0x912f('0x1c')]||null:null,'attributes':_0x287683[_0x912f('0x1a')]?_0x287683[_0x912f('0x1a')][_0x912f('0x1d')]||null:null,'limit':_0x287683[_0x912f('0x1a')]?_0x287683[_0x912f('0x1a')]['limit']||null:null})[_0x912f('0x1e')](function(_0x952aa8){logger[_0x912f('0xc')]('UpdateSmsQueueReport',_0x287683);logger['debug'](_0x912f('0x1f'),_0x287683,JSON[_0x912f('0x10')](_0x952aa8));_0x512caf(_0x952aa8);})[_0x912f('0x15')](function(_0x28a5f9){logger[_0x912f('0x11')](_0x912f('0x1f'),_0x28a5f9['message'],_0x287683);_0x1f7072(_0x247ed4[_0x912f('0x11')](0x1f4,_0x28a5f9[_0x912f('0x13')]));});});}; \ No newline at end of file +var _0x9486=['then','catch','UpdateSmsQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','SmsQueueReport,\x20%s,\x20%s','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw'];(function(_0x87a255,_0x21f06f){var _0x39d226=function(_0x1f7f61){while(--_0x1f7f61){_0x87a255['push'](_0x87a255['shift']());}};_0x39d226(++_0x21f06f);}(_0x9486,0x11f));var _0x6948=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9486[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6948('0x0'));var util=require(_0x6948('0x1'));var moment=require(_0x6948('0x2'));var BPromise=require(_0x6948('0x3'));var rs=require(_0x6948('0x4'));var fs=require('fs');var Redis=require(_0x6948('0x5'));var db=require(_0x6948('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6948('0x7'))(_0x6948('0x8'));var config=require(_0x6948('0x9'));var jayson=require(_0x6948('0xa'));var client=jayson[_0x6948('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1691b5,_0x83932e,_0x7ea35){return new BPromise(function(_0xb1d933,_0x494fa6){return client[_0x6948('0xc')](_0x1691b5,_0x7ea35)['then'](function(_0xbe1068){logger[_0x6948('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x83932e,_0x6948('0xe'));logger[_0x6948('0xf')](_0x6948('0x10'),_0x83932e,'request\x20sent',JSON[_0x6948('0x11')](_0xbe1068));if(_0xbe1068[_0x6948('0x12')]){if(_0xbe1068[_0x6948('0x12')]['code']===0x1f4){logger[_0x6948('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x83932e,_0xbe1068[_0x6948('0x12')][_0x6948('0x13')]);return _0x494fa6(_0xbe1068[_0x6948('0x12')][_0x6948('0x13')]);}logger[_0x6948('0x12')](_0x6948('0x14'),_0x83932e,_0xbe1068[_0x6948('0x12')][_0x6948('0x13')]);return _0xb1d933(_0xbe1068['error']['message']);}else{logger['info'](_0x6948('0x14'),_0x83932e,_0x6948('0xe'));_0xb1d933(_0xbe1068[_0x6948('0x15')][_0x6948('0x13')]);}})['catch'](function(_0x2e5ac8){logger[_0x6948('0x12')](_0x6948('0x14'),_0x83932e,_0x2e5ac8);_0x494fa6(_0x2e5ac8);});});}exports[_0x6948('0x16')]=function(_0x548fcd){var _0x3ae5aa=this;return new Promise(function(_0x2a26e9,_0x35decc){return db[_0x6948('0x17')][_0x6948('0x18')](_0x548fcd[_0x6948('0x19')],{'raw':_0x548fcd[_0x6948('0x1a')]?_0x548fcd[_0x6948('0x1a')][_0x6948('0x1b')]===undefined?!![]:![]:!![]})[_0x6948('0x1c')](function(_0x2705ec){logger[_0x6948('0xd')]('CreateSmsQueueReport',_0x548fcd);logger[_0x6948('0xf')]('CreateSmsQueueReport',_0x548fcd,JSON['stringify'](_0x2705ec));_0x2a26e9(_0x2705ec);})[_0x6948('0x1d')](function(_0x1bfced){logger[_0x6948('0x12')](_0x6948('0x16'),_0x1bfced[_0x6948('0x13')],_0x548fcd);_0x35decc(_0x3ae5aa[_0x6948('0x12')](0x1f4,_0x1bfced[_0x6948('0x13')]));});});};exports[_0x6948('0x1e')]=function(_0xe7387b){var _0x52fb19=this;return new Promise(function(_0x434bd7,_0x21a915){return db[_0x6948('0x17')][_0x6948('0x1f')](_0xe7387b[_0x6948('0x19')],{'raw':_0xe7387b[_0x6948('0x1a')]?_0xe7387b[_0x6948('0x1a')][_0x6948('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe7387b[_0x6948('0x1a')]?_0xe7387b[_0x6948('0x1a')][_0x6948('0x20')]||null:null,'attributes':_0xe7387b[_0x6948('0x1a')]?_0xe7387b[_0x6948('0x1a')][_0x6948('0x21')]||null:null,'limit':_0xe7387b[_0x6948('0x1a')]?_0xe7387b[_0x6948('0x1a')][_0x6948('0x22')]||null:null})['then'](function(_0x32c44a){logger[_0x6948('0xd')]('UpdateSmsQueueReport',_0xe7387b);logger[_0x6948('0xf')](_0x6948('0x1e'),_0xe7387b,JSON[_0x6948('0x11')](_0x32c44a));_0x434bd7(_0x32c44a);})[_0x6948('0x1d')](function(_0x14718a){logger[_0x6948('0x12')](_0x6948('0x1e'),_0x14718a[_0x6948('0x13')],_0xe7387b);_0x21a915(_0x52fb19[_0x6948('0x12')](0x1f4,_0x14718a[_0x6948('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index aa8a1ee..3e57a4e 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 _0xf7b4=['update','delete','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf7b4,0x152));var _0x4f7b=function(_0x126d77,_0x2b217d){_0x126d77=_0x126d77-0x0;var _0x36266a=_0xf7b4[_0x126d77];return _0x36266a;};'use strict';var multer=require(_0x4f7b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4f7b('0x1'));var express=require(_0x4f7b('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4f7b('0x3'));var config=require(_0x4f7b('0x4'));var controller=require(_0x4f7b('0x5'));router[_0x4f7b('0x6')]('/',auth[_0x4f7b('0x7')](),controller[_0x4f7b('0x8')]);router[_0x4f7b('0x6')](_0x4f7b('0x9'),auth[_0x4f7b('0x7')](),controller[_0x4f7b('0xa')]);router[_0x4f7b('0x6')](_0x4f7b('0xb'),auth[_0x4f7b('0x7')](),controller['show']);router[_0x4f7b('0xc')]('/',auth[_0x4f7b('0x7')](),controller['create']);router[_0x4f7b('0xd')](_0x4f7b('0xb'),auth[_0x4f7b('0x7')](),controller[_0x4f7b('0xe')]);router[_0x4f7b('0xf')]('/:id',auth[_0x4f7b('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb58b=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x74ece5,_0x143ad3){var _0x245611=function(_0x1d003c){while(--_0x1d003c){_0x74ece5['push'](_0x74ece5['shift']());}};_0x245611(++_0x143ad3);}(_0xb58b,0x1f1));var _0xbb58=function(_0x4c2f2c,_0xeb0996){_0x4c2f2c=_0x4c2f2c-0x0;var _0x1699cb=_0xb58b[_0x4c2f2c];return _0x1699cb;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var auth=require(_0xbb58('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbb58('0x5'));var controller=require('./smsTransferReport.controller');router[_0xbb58('0x6')]('/',auth[_0xbb58('0x7')](),controller[_0xbb58('0x8')]);router['get'](_0xbb58('0x9'),auth[_0xbb58('0x7')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x6')](_0xbb58('0xb'),auth[_0xbb58('0x7')](),controller[_0xbb58('0xc')]);router[_0xbb58('0xd')]('/',auth[_0xbb58('0x7')](),controller[_0xbb58('0xe')]);router[_0xbb58('0xf')]('/:id',auth[_0xbb58('0x7')](),controller['update']);router[_0xbb58('0x10')](_0xbb58('0xb'),auth[_0xbb58('0x7')](),controller[_0xbb58('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 3643f56..e812d8c 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 _0x1864=['STRING','ENUM','account','agent','queue','DATE','NOW','moment','sequelize'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1864,0xc4));var _0x4186=function(_0x422b22,_0x55b2ed){_0x422b22=_0x422b22-0x0;var _0x570dd8=_0x1864[_0x422b22];return _0x570dd8;};'use strict';var moment=require(_0x4186('0x0'));var Sequelize=require(_0x4186('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x4186('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4186('0x3')](_0x4186('0x4'),_0x4186('0x5'),'queue'),'allowNull':![],'defaultValue':_0x4186('0x6')},'transferredAt':{'type':Sequelize[_0x4186('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x4186('0x8')]}}; \ No newline at end of file +var _0x564b=['sequelize','STRING','ENUM','account','queue','NOW','moment'];(function(_0x2f3848,_0x48564d){var _0x102668=function(_0x5e32ab){while(--_0x5e32ab){_0x2f3848['push'](_0x2f3848['shift']());}};_0x102668(++_0x48564d);}(_0x564b,0xa7));var _0xb564=function(_0x1d32e0,_0x1a1e32){_0x1d32e0=_0x1d32e0-0x0;var _0x4eec21=_0x564b[_0x1d32e0];return _0x4eec21;};'use strict';var moment=require(_0xb564('0x0'));var Sequelize=require(_0xb564('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xb564('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb564('0x3')](_0xb564('0x4'),'agent','queue'),'allowNull':![],'defaultValue':_0xb564('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xb564('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 96c9e2a..e568a43 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 _0x0713=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','findAll','catch','show','params','includeAll','include','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x8e7958,_0x579780){var _0x34299c=function(_0x4ac551){while(--_0x4ac551){_0x8e7958['push'](_0x8e7958['shift']());}};_0x34299c(++_0x579780);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];function respondWithStatusCode(_0xa0c1,_0x4a8cc7){_0x4a8cc7=_0x4a8cc7||0xcc;return function(_0x5330a8){if(_0x5330a8){return _0xa0c1[_0x3071('0x1a')](_0x4a8cc7);}return _0xa0c1['status'](_0x4a8cc7)[_0x3071('0x1b')]();};}function respondWithResult(_0x44fbae,_0x5d4883){_0x5d4883=_0x5d4883||0xc8;return function(_0x104e73){if(_0x104e73){return _0x44fbae['status'](_0x5d4883)[_0x3071('0x1c')](_0x104e73);}};}function respondWithFilteredResult(_0x45c93b,_0x1271d0){return function(_0x1f14e1){if(_0x1f14e1){var _0x1caa5d=_0x1f14e1[_0x3071('0x1d')],_0x2a6a4b=_0x1271d0[_0x3071('0x1e')],_0x157a47=_0x1271d0['offset']+_0x1271d0[_0x3071('0x1f')],_0x11bdc9;if(_0x157a47>=_0x1caa5d){_0x157a47=_0x1caa5d;_0x11bdc9=0xc8;}else{_0x11bdc9=0xce;}_0x45c93b[_0x3071('0x20')](_0x11bdc9);return _0x45c93b[_0x3071('0x21')](_0x3071('0x22'),_0x2a6a4b+'-'+_0x157a47+'/'+_0x1caa5d)[_0x3071('0x1c')](_0x1f14e1);}return null;};}function patchUpdates(_0x17aee2){return function(_0x105bbb){try{jsonpatch[_0x3071('0x23')](_0x105bbb,_0x17aee2,!![]);}catch(_0x502a16){return BPromise[_0x3071('0x24')](_0x502a16);}return _0x105bbb[_0x3071('0x25')]();};}function saveUpdates(_0xd3e23d,_0x56c267){return function(_0xb8f4e3){if(_0xb8f4e3){return _0xb8f4e3['update'](_0xd3e23d)[_0x3071('0x26')](function(_0x43128c){return _0x43128c;});}return null;};}function removeEntity(_0x3762d8,_0x457b57){return function(_0x33090c){if(_0x33090c){return _0x33090c[_0x3071('0x27')]()[_0x3071('0x26')](function(){_0x3762d8[_0x3071('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(!_0xb05b1d){_0x481a51[_0x3071('0x1a')](0x194);}return _0xb05b1d;};}function handleError(_0x13df9f,_0x2793ef){_0x2793ef=_0x2793ef||0x1f4;return function(_0x44b45f){logger[_0x3071('0x28')](_0x44b45f[_0x3071('0x29')]);if(_0x44b45f[_0x3071('0x2a')]){delete _0x44b45f['name'];}_0x13df9f[_0x3071('0x20')](_0x2793ef)[_0x3071('0x2b')](_0x44b45f);};}exports[_0x3071('0x2c')]=function(_0x4d5c4b,_0x4fb1ca){var _0x28792d={},_0x163604={},_0x950fde={'count':0x0,'rows':[]};var _0x3fa3b8=_[_0x3071('0x2d')](db[_0x3071('0x2e')][_0x3071('0x2f')],function(_0x32f1b4){return{'name':_0x32f1b4[_0x3071('0x30')],'type':_0x32f1b4[_0x3071('0x31')]['key']};});_0x163604['model']=_[_0x3071('0x2d')](_0x3fa3b8,_0x3071('0x2a'));_0x163604[_0x3071('0x32')]=_[_0x3071('0x33')](_0x4d5c4b[_0x3071('0x32')]);_0x163604[_0x3071('0x34')]=_[_0x3071('0x35')](_0x163604[_0x3071('0x36')],_0x163604['query']);_0x28792d['attributes']=_['intersection'](_0x163604[_0x3071('0x36')],qs[_0x3071('0x37')](_0x4d5c4b['query'][_0x3071('0x37')]));_0x28792d[_0x3071('0x38')]=_0x28792d[_0x3071('0x38')][_0x3071('0x39')]?_0x28792d['attributes']:_0x163604[_0x3071('0x36')];if(!_0x4d5c4b[_0x3071('0x32')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x28792d[_0x3071('0x1f')]=qs[_0x3071('0x1f')](_0x4d5c4b[_0x3071('0x32')][_0x3071('0x1f')]);_0x28792d['offset']=qs[_0x3071('0x1e')](_0x4d5c4b['query']['offset']);}_0x28792d[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x4d5c4b['query'][_0x3071('0x3d')]);_0x28792d[_0x3071('0x3e')]=qs[_0x3071('0x34')](_[_0x3071('0x3f')](_0x4d5c4b[_0x3071('0x32')],_0x163604[_0x3071('0x34')]),_0x3fa3b8);if(_0x4d5c4b['query'][_0x3071('0x40')]){_0x28792d[_0x3071('0x3e')]=_['merge'](_0x28792d[_0x3071('0x3e')],{'$or':_['map'](_0x3fa3b8,function(_0x28f855){if(_0x28f855[_0x3071('0x31')]!=='VIRTUAL'){var _0x593c99={};_0x593c99[_0x28f855[_0x3071('0x2a')]]={'$like':'%'+_0x4d5c4b[_0x3071('0x32')][_0x3071('0x40')]+'%'};return _0x593c99;}})});}_0x28792d=_['merge']({},_0x28792d,_0x4d5c4b[_0x3071('0x41')]);var _0x534a77={'where':_0x28792d[_0x3071('0x3e')]};return db['SmsTransferReport'][_0x3071('0x1d')](_0x534a77)[_0x3071('0x26')](function(_0x1fcc52){_0x950fde[_0x3071('0x1d')]=_0x1fcc52;if(_0x4d5c4b[_0x3071('0x32')]['includeAll']){_0x28792d['include']=[{'all':!![]}];}return db[_0x3071('0x2e')][_0x3071('0x42')](_0x28792d);})[_0x3071('0x26')](function(_0x1f69a6){_0x950fde['rows']=_0x1f69a6;return _0x950fde;})[_0x3071('0x26')](respondWithFilteredResult(_0x4fb1ca,_0x28792d))[_0x3071('0x43')](handleError(_0x4fb1ca,null));};exports[_0x3071('0x44')]=function(_0x25c29f,_0x277104){var _0xb9a4b8={'raw':!![],'where':{'id':_0x25c29f[_0x3071('0x45')]['id']}},_0x56a9d8={};_0x56a9d8['model']=_['keys'](db['SmsTransferReport']['rawAttributes']);_0x56a9d8[_0x3071('0x32')]=_[_0x3071('0x33')](_0x25c29f[_0x3071('0x32')]);_0x56a9d8[_0x3071('0x34')]=_[_0x3071('0x35')](_0x56a9d8[_0x3071('0x36')],_0x56a9d8[_0x3071('0x32')]);_0xb9a4b8[_0x3071('0x38')]=_['intersection'](_0x56a9d8[_0x3071('0x36')],qs[_0x3071('0x37')](_0x25c29f[_0x3071('0x32')][_0x3071('0x37')]));_0xb9a4b8[_0x3071('0x38')]=_0xb9a4b8['attributes']['length']?_0xb9a4b8[_0x3071('0x38')]:_0x56a9d8[_0x3071('0x36')];if(_0x25c29f[_0x3071('0x32')][_0x3071('0x46')]){_0xb9a4b8[_0x3071('0x47')]=[{'all':!![]}];}_0xb9a4b8=_['merge']({},_0xb9a4b8,_0x25c29f[_0x3071('0x41')]);return db['SmsTransferReport'][_0x3071('0x48')](_0xb9a4b8)['then'](handleEntityNotFound(_0x277104,null))['then'](respondWithResult(_0x277104,null))[_0x3071('0x43')](handleError(_0x277104,null));};exports['create']=function(_0x1862ea,_0x5a0a69){return db[_0x3071('0x2e')][_0x3071('0x49')](_0x1862ea[_0x3071('0x4a')],{})[_0x3071('0x26')](respondWithResult(_0x5a0a69,0xc9))['catch'](handleError(_0x5a0a69,null));};exports[_0x3071('0x4b')]=function(_0x575c12,_0xd273ec){if(_0x575c12['body']['id']){delete _0x575c12[_0x3071('0x4a')]['id'];}return db[_0x3071('0x2e')]['find']({'where':{'id':_0x575c12[_0x3071('0x45')]['id']}})[_0x3071('0x26')](handleEntityNotFound(_0xd273ec,null))[_0x3071('0x26')](saveUpdates(_0x575c12[_0x3071('0x4a')],null))[_0x3071('0x26')](respondWithResult(_0xd273ec,null))[_0x3071('0x43')](handleError(_0xd273ec,null));};exports[_0x3071('0x27')]=function(_0x577060,_0x2c6e4c){return db[_0x3071('0x2e')][_0x3071('0x48')]({'where':{'id':_0x577060[_0x3071('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c6e4c,null))[_0x3071('0x26')](removeEntity(_0x2c6e4c,null))[_0x3071('0x43')](handleError(_0x2c6e4c,null));};exports[_0x3071('0x4c')]=function(_0x2307dd,_0x22aade){return db[_0x3071('0x2e')][_0x3071('0x4c')]()[_0x3071('0x26')](respondWithResult(_0x22aade,null))[_0x3071('0x43')](handleError(_0x22aade,null));}; \ No newline at end of file +var _0x70e0=['attributes','intersection','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','name','merge','options','count','includeAll','findAll','rows','catch','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','status','set','Content-Range','apply','reject','update','then','destroy','end','stack','send','index','map','SmsTransferReport','rawAttributes','fieldName','key','model','keys','query','filters'];(function(_0x127a3c,_0xd22972){var _0x5a999b=function(_0x48b243){while(--_0x48b243){_0x127a3c['push'](_0x127a3c['shift']());}};_0x5a999b(++_0xd22972);}(_0x70e0,0x17b));var _0x070e=function(_0x1344fb,_0x2a33a2){_0x1344fb=_0x1344fb-0x0;var _0x52f2a3=_0x70e0[_0x1344fb];return _0x52f2a3;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];function respondWithStatusCode(_0x1baa12,_0x39d2b9){_0x39d2b9=_0x39d2b9||0xcc;return function(_0x5bf079){if(_0x5bf079){return _0x1baa12[_0x070e('0x16')](_0x39d2b9);}return _0x1baa12['status'](_0x39d2b9)['end']();};}function respondWithResult(_0x24baba,_0x56c7ba){_0x56c7ba=_0x56c7ba||0xc8;return function(_0x4a33d2){if(_0x4a33d2){return _0x24baba['status'](_0x56c7ba)[_0x070e('0x17')](_0x4a33d2);}};}function respondWithFilteredResult(_0x14c3fd,_0x51d14d){return function(_0x5d3a38){if(_0x5d3a38){var _0x373d86=_0x5d3a38['count'],_0xeae1a5=_0x51d14d['offset'],_0x180897=_0x51d14d[_0x070e('0x18')]+_0x51d14d[_0x070e('0x19')],_0x19d9da;if(_0x180897>=_0x373d86){_0x180897=_0x373d86;_0x19d9da=0xc8;}else{_0x19d9da=0xce;}_0x14c3fd[_0x070e('0x1a')](_0x19d9da);return _0x14c3fd[_0x070e('0x1b')](_0x070e('0x1c'),_0xeae1a5+'-'+_0x180897+'/'+_0x373d86)['json'](_0x5d3a38);}return null;};}function patchUpdates(_0x3938b5){return function(_0x168dc6){try{jsonpatch[_0x070e('0x1d')](_0x168dc6,_0x3938b5,!![]);}catch(_0x3ea105){return BPromise[_0x070e('0x1e')](_0x3ea105);}return _0x168dc6['save']();};}function saveUpdates(_0x5b2f48,_0x4e958f){return function(_0x9907cf){if(_0x9907cf){return _0x9907cf[_0x070e('0x1f')](_0x5b2f48)[_0x070e('0x20')](function(_0x4be0d7){return _0x4be0d7;});}return null;};}function removeEntity(_0x5b184,_0x5dc5d2){return function(_0xf8dd5d){if(_0xf8dd5d){return _0xf8dd5d[_0x070e('0x21')]()[_0x070e('0x20')](function(){_0x5b184[_0x070e('0x1a')](0xcc)[_0x070e('0x22')]();});}};}function handleEntityNotFound(_0xa86797,_0xe405e){return function(_0x164cdf){if(!_0x164cdf){_0xa86797['sendStatus'](0x194);}return _0x164cdf;};}function handleError(_0x2f8055,_0x270061){_0x270061=_0x270061||0x1f4;return function(_0x4790eb){logger['error'](_0x4790eb[_0x070e('0x23')]);if(_0x4790eb['name']){delete _0x4790eb['name'];}_0x2f8055[_0x070e('0x1a')](_0x270061)[_0x070e('0x24')](_0x4790eb);};}exports[_0x070e('0x25')]=function(_0x1743cc,_0x4763c6){var _0x497f58={},_0x374c54={},_0x219e48={'count':0x0,'rows':[]};var _0x1d72d6=_[_0x070e('0x26')](db[_0x070e('0x27')][_0x070e('0x28')],function(_0x1a1892){return{'name':_0x1a1892[_0x070e('0x29')],'type':_0x1a1892['type'][_0x070e('0x2a')]};});_0x374c54[_0x070e('0x2b')]=_[_0x070e('0x26')](_0x1d72d6,'name');_0x374c54['query']=_[_0x070e('0x2c')](_0x1743cc[_0x070e('0x2d')]);_0x374c54[_0x070e('0x2e')]=_['intersection'](_0x374c54[_0x070e('0x2b')],_0x374c54[_0x070e('0x2d')]);_0x497f58[_0x070e('0x2f')]=_[_0x070e('0x30')](_0x374c54['model'],qs['fields'](_0x1743cc['query']['fields']));_0x497f58[_0x070e('0x2f')]=_0x497f58['attributes'][_0x070e('0x31')]?_0x497f58[_0x070e('0x2f')]:_0x374c54['model'];if(!_0x1743cc['query'][_0x070e('0x32')](_0x070e('0x33'))){_0x497f58['limit']=qs['limit'](_0x1743cc[_0x070e('0x2d')][_0x070e('0x19')]);_0x497f58[_0x070e('0x18')]=qs[_0x070e('0x18')](_0x1743cc[_0x070e('0x2d')]['offset']);}_0x497f58['order']=qs[_0x070e('0x34')](_0x1743cc[_0x070e('0x2d')][_0x070e('0x34')]);_0x497f58[_0x070e('0x35')]=qs[_0x070e('0x2e')](_['pick'](_0x1743cc[_0x070e('0x2d')],_0x374c54[_0x070e('0x2e')]),_0x1d72d6);if(_0x1743cc['query'][_0x070e('0x36')]){_0x497f58[_0x070e('0x35')]=_['merge'](_0x497f58['where'],{'$or':_['map'](_0x1d72d6,function(_0x363bff){if(_0x363bff[_0x070e('0x37')]!==_0x070e('0x38')){var _0x334733={};_0x334733[_0x363bff[_0x070e('0x39')]]={'$like':'%'+_0x1743cc['query'][_0x070e('0x36')]+'%'};return _0x334733;}})});}_0x497f58=_[_0x070e('0x3a')]({},_0x497f58,_0x1743cc[_0x070e('0x3b')]);var _0x487276={'where':_0x497f58[_0x070e('0x35')]};return db[_0x070e('0x27')][_0x070e('0x3c')](_0x487276)['then'](function(_0x13982f){_0x219e48[_0x070e('0x3c')]=_0x13982f;if(_0x1743cc['query'][_0x070e('0x3d')]){_0x497f58['include']=[{'all':!![]}];}return db[_0x070e('0x27')][_0x070e('0x3e')](_0x497f58);})[_0x070e('0x20')](function(_0x30319c){_0x219e48[_0x070e('0x3f')]=_0x30319c;return _0x219e48;})['then'](respondWithFilteredResult(_0x4763c6,_0x497f58))[_0x070e('0x40')](handleError(_0x4763c6,null));};exports['show']=function(_0x5bd39a,_0x398168){var _0x42c448={'raw':!![],'where':{'id':_0x5bd39a['params']['id']}},_0x38879f={};_0x38879f[_0x070e('0x2b')]=_[_0x070e('0x2c')](db[_0x070e('0x27')][_0x070e('0x28')]);_0x38879f['query']=_[_0x070e('0x2c')](_0x5bd39a['query']);_0x38879f['filters']=_['intersection'](_0x38879f[_0x070e('0x2b')],_0x38879f[_0x070e('0x2d')]);_0x42c448[_0x070e('0x2f')]=_[_0x070e('0x30')](_0x38879f[_0x070e('0x2b')],qs['fields'](_0x5bd39a[_0x070e('0x2d')]['fields']));_0x42c448[_0x070e('0x2f')]=_0x42c448[_0x070e('0x2f')][_0x070e('0x31')]?_0x42c448['attributes']:_0x38879f['model'];if(_0x5bd39a[_0x070e('0x2d')]['includeAll']){_0x42c448[_0x070e('0x41')]=[{'all':!![]}];}_0x42c448=_[_0x070e('0x3a')]({},_0x42c448,_0x5bd39a[_0x070e('0x3b')]);return db['SmsTransferReport'][_0x070e('0x42')](_0x42c448)[_0x070e('0x20')](handleEntityNotFound(_0x398168,null))['then'](respondWithResult(_0x398168,null))['catch'](handleError(_0x398168,null));};exports[_0x070e('0x43')]=function(_0x945901,_0x2d43ce){return db[_0x070e('0x27')][_0x070e('0x43')](_0x945901['body'],{})[_0x070e('0x20')](respondWithResult(_0x2d43ce,0xc9))[_0x070e('0x40')](handleError(_0x2d43ce,null));};exports[_0x070e('0x1f')]=function(_0x391dee,_0x79eaa0){if(_0x391dee[_0x070e('0x44')]['id']){delete _0x391dee[_0x070e('0x44')]['id'];}return db[_0x070e('0x27')][_0x070e('0x42')]({'where':{'id':_0x391dee[_0x070e('0x45')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x79eaa0,null))[_0x070e('0x20')](saveUpdates(_0x391dee[_0x070e('0x44')],null))[_0x070e('0x20')](respondWithResult(_0x79eaa0,null))[_0x070e('0x40')](handleError(_0x79eaa0,null));};exports['destroy']=function(_0x171621,_0xa7a41b){return db[_0x070e('0x27')][_0x070e('0x42')]({'where':{'id':_0x171621[_0x070e('0x45')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0xa7a41b,null))[_0x070e('0x20')](removeEntity(_0xa7a41b,null))[_0x070e('0x40')](handleError(_0xa7a41b,null));};exports[_0x070e('0x46')]=function(_0x5744c5,_0x251696){return db['SmsTransferReport'][_0x070e('0x46')]()[_0x070e('0x20')](respondWithResult(_0x251696,null))['catch'](handleError(_0x251696,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 35bf12c..d4bf262 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 _0x443c=['path','rimraf','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','lodash','util','api','bluebird','request-promise'];(function(_0x39a80f,_0x99ff6d){var _0x4d84aa=function(_0x33a9a){while(--_0x33a9a){_0x39a80f['push'](_0x39a80f['shift']());}};_0x4d84aa(++_0x99ff6d);}(_0x443c,0xf7));var _0xc443=function(_0xf9b7a3,_0x2a66f4){_0xf9b7a3=_0xf9b7a3-0x0;var _0x25f0a2=_0x443c[_0xf9b7a3];return _0x25f0a2;};'use strict';var _=require(_0xc443('0x0'));var util=require(_0xc443('0x1'));var logger=require('../../config/logger')(_0xc443('0x2'));var moment=require('moment');var BPromise=require(_0xc443('0x3'));var rp=require(_0xc443('0x4'));var fs=require('fs');var path=require(_0xc443('0x5'));var rimraf=require(_0xc443('0x6'));var config=require('../../config/environment');var attributes=require(_0xc443('0x7'));module[_0xc443('0x8')]=function(_0x30a2d5,_0x43a7c3){return _0x30a2d5[_0xc443('0x9')](_0xc443('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xc443('0xb'),'fields':[_0xc443('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x68ca=['SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x68ca,0x6f));var _0xa68c=function(_0x771ca3,_0x5a090e){_0x771ca3=_0x771ca3-0x0;var _0x41dc6a=_0x68ca[_0x771ca3];return _0x41dc6a;};'use strict';var _=require(_0xa68c('0x0'));var util=require(_0xa68c('0x1'));var logger=require(_0xa68c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xa68c('0x3'));var rp=require(_0xa68c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa68c('0x5'));var config=require(_0xa68c('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0xa68c('0x7')]=function(_0x300255,_0x18d5e8){return _0x300255[_0xa68c('0x8')](_0xa68c('0x9'),attributes,{'tableName':_0xa68c('0xa'),'paranoid':![],'indexes':[{'name':_0xa68c('0xb'),'fields':[_0xa68c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index d38a550..9bdfc24 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 _0x0ddc=['../../config/utils','rpc','jayson/promise','client','http','request','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s','request\x20sent','result','catch','lodash','util','randomstring'];(function(_0x190255,_0x5e255b){var _0x42822a=function(_0x1c664e){while(--_0x1c664e){_0x190255['push'](_0x190255['shift']());}};_0x42822a(++_0x5e255b);}(_0x0ddc,0xc3));var _0xc0dd=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x0ddc[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0xc0dd('0x0'));var util=require(_0xc0dd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc0dd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc0dd('0x3'));var logger=require('../../config/logger')(_0xc0dd('0x4'));var config=require('../../config/environment');var jayson=require(_0xc0dd('0x5'));var client=jayson[_0xc0dd('0x6')][_0xc0dd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c9069,_0x1ebc1b,_0x314982){return new BPromise(function(_0x40155f,_0x47a13a){return client[_0xc0dd('0x8')](_0x1c9069,_0x314982)['then'](function(_0x417525){logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x1ebc1b,'request\x20sent');logger['debug'](_0xc0dd('0x9'),_0x1ebc1b,'request\x20sent',JSON[_0xc0dd('0xa')](_0x417525));if(_0x417525[_0xc0dd('0xb')]){if(_0x417525[_0xc0dd('0xb')][_0xc0dd('0xc')]===0x1f4){logger[_0xc0dd('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x1ebc1b,_0x417525['error'][_0xc0dd('0xd')]);return _0x47a13a(_0x417525['error'][_0xc0dd('0xd')]);}logger[_0xc0dd('0xb')](_0xc0dd('0xe'),_0x1ebc1b,_0x417525[_0xc0dd('0xb')][_0xc0dd('0xd')]);return _0x40155f(_0x417525[_0xc0dd('0xb')][_0xc0dd('0xd')]);}else{logger['info'](_0xc0dd('0xe'),_0x1ebc1b,_0xc0dd('0xf'));_0x40155f(_0x417525[_0xc0dd('0x10')][_0xc0dd('0xd')]);}})[_0xc0dd('0x11')](function(_0x168123){logger[_0xc0dd('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x1ebc1b,_0x168123);_0x47a13a(_0x168123);});});} \ No newline at end of file +var _0xadb7=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x156a89,_0x2c4677){var _0x153fd4=function(_0x131487){while(--_0x131487){_0x156a89['push'](_0x156a89['shift']());}};_0x153fd4(++_0x2c4677);}(_0xadb7,0xf7));var _0x7adb=function(_0x1f81b1,_0x494e22){_0x1f81b1=_0x1f81b1-0x0;var _0x2d924b=_0xadb7[_0x1f81b1];return _0x2d924b;};'use strict';var _=require(_0x7adb('0x0'));var util=require(_0x7adb('0x1'));var moment=require('moment');var BPromise=require(_0x7adb('0x2'));var rs=require(_0x7adb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7adb('0x4'))['db'];var utils=require(_0x7adb('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7adb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7adb('0x7')][_0x7adb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x11dc50,_0x3b9037,_0x21aa96){return new BPromise(function(_0x49f703,_0x229b28){return client['request'](_0x11dc50,_0x21aa96)[_0x7adb('0x9')](function(_0xd4bbbf){logger[_0x7adb('0xa')](_0x7adb('0xb'),_0x3b9037,_0x7adb('0xc'));logger[_0x7adb('0xd')](_0x7adb('0xe'),_0x3b9037,_0x7adb('0xc'),JSON[_0x7adb('0xf')](_0xd4bbbf));if(_0xd4bbbf[_0x7adb('0x10')]){if(_0xd4bbbf[_0x7adb('0x10')][_0x7adb('0x11')]===0x1f4){logger[_0x7adb('0x10')](_0x7adb('0xb'),_0x3b9037,_0xd4bbbf['error'][_0x7adb('0x12')]);return _0x229b28(_0xd4bbbf['error']['message']);}logger[_0x7adb('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x3b9037,_0xd4bbbf[_0x7adb('0x10')][_0x7adb('0x12')]);return _0x49f703(_0xd4bbbf[_0x7adb('0x10')]['message']);}else{logger[_0x7adb('0xa')]('SmsTransferReport,\x20%s,\x20%s',_0x3b9037,_0x7adb('0xc'));_0x49f703(_0xd4bbbf['result']['message']);}})[_0x7adb('0x13')](function(_0x217111){logger[_0x7adb('0x10')](_0x7adb('0xb'),_0x3b9037,_0x217111);_0x229b28(_0x217111);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 9607941..a8b5382 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 _0xed4b=['index','/:id','isAuthenticated','show','join','root','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','update','delete','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xed4b,0xda));var _0xbed4=function(_0x73a911,_0x4c089e){_0x73a911=_0x73a911-0x0;var _0x523141=_0xed4b[_0x73a911];return _0x523141;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbed4('0x0'));var timeout=require(_0xbed4('0x1'));var express=require('express');var router=express[_0xbed4('0x2')]();var auth=require(_0xbed4('0x3'));var interaction=require(_0xbed4('0x4'));var config=require(_0xbed4('0x5'));var controller=require('./sound.controller');router[_0xbed4('0x6')]('/',auth['isAuthenticated'](),controller[_0xbed4('0x7')]);router[_0xbed4('0x6')](_0xbed4('0x8'),auth[_0xbed4('0x9')](),controller[_0xbed4('0xa')]);router[_0xbed4('0x6')]('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1649c9,_0x5b55fe,_0x4ca591){_0x4ca591(null,path[_0xbed4('0xb')](config[_0xbed4('0xc')],'server/files/sounds/original/'));},'filename':function(_0x55c60c,_0x3a8c12,_0x44ea21){_0x3a8c12['originalname']=_0x3a8c12[_0xbed4('0xd')][_0xbed4('0xe')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x44ea21(null,util[_0xbed4('0xf')](_0xbed4('0x10'),path[_0xbed4('0x11')](_0x3a8c12['originalname'],path[_0xbed4('0x12')](_0x3a8c12[_0xbed4('0xd')])),Date[_0xbed4('0x13')](),path[_0xbed4('0x12')](_0x3a8c12[_0xbed4('0xd')])));}})});router[_0xbed4('0x14')]('/',upload[_0xbed4('0x15')](_0xbed4('0x16')),controller['create']);router['put']('/:id',auth[_0xbed4('0x9')](),controller[_0xbed4('0x17')]);router[_0xbed4('0x18')](_0xbed4('0x8'),auth[_0xbed4('0x9')](),controller[_0xbed4('0x18')]);module['exports']=router; \ No newline at end of file +var _0xff42=['update','delete','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','single','create','put','/:id'];(function(_0x71e875,_0x135f75){var _0x50ad00=function(_0x33a317){while(--_0x33a317){_0x71e875['push'](_0x71e875['shift']());}};_0x50ad00(++_0x135f75);}(_0xff42,0x120));var _0x2ff4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xff42[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x2ff4('0x0'));var path=require('path');var timeout=require(_0x2ff4('0x1'));var express=require(_0x2ff4('0x2'));var router=express['Router']();var auth=require(_0x2ff4('0x3'));var interaction=require(_0x2ff4('0x4'));var config=require(_0x2ff4('0x5'));var controller=require('./sound.controller');router[_0x2ff4('0x6')]('/',auth[_0x2ff4('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2ff4('0x8')]);router[_0x2ff4('0x6')](_0x2ff4('0x9'),auth[_0x2ff4('0x7')](),controller[_0x2ff4('0xa')]);var upload=multer({'storage':multer[_0x2ff4('0xb')]({'destination':function(_0x37365c,_0x2c4f9,_0x2678f9){_0x2678f9(null,path['join'](config[_0x2ff4('0xc')],_0x2ff4('0xd')));},'filename':function(_0x397e1b,_0x5c5ecf,_0x9c13ca){_0x5c5ecf[_0x2ff4('0xe')]=_0x5c5ecf[_0x2ff4('0xe')][_0x2ff4('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x9c13ca(null,util[_0x2ff4('0x10')](_0x2ff4('0x11'),path['basename'](_0x5c5ecf[_0x2ff4('0xe')],path[_0x2ff4('0x12')](_0x5c5ecf[_0x2ff4('0xe')])),Date[_0x2ff4('0x13')](),path['extname'](_0x5c5ecf[_0x2ff4('0xe')])));}})});router['post']('/',upload[_0x2ff4('0x14')]('file'),controller[_0x2ff4('0x15')]);router[_0x2ff4('0x16')](_0x2ff4('0x17'),auth[_0x2ff4('0x7')](),controller[_0x2ff4('0x18')]);router[_0x2ff4('0x19')](_0x2ff4('0x17'),auth[_0x2ff4('0x7')](),controller[_0x2ff4('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 6e0495f..5f26dc0 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 _0x52b6=['STRING','name','FLOAT','BIGINT','INTEGER','exports'];(function(_0x52b930,_0x46d07d){var _0x59734f=function(_0x2c114d){while(--_0x2c114d){_0x52b930['push'](_0x52b930['shift']());}};_0x59734f(++_0x46d07d);}(_0x52b6,0x1d9));var _0x652b=function(_0x3c36a6,_0x594d9e){_0x3c36a6=_0x3c36a6-0x0;var _0x267290=_0x52b6[_0x3c36a6];return _0x267290;};'use strict';var Sequelize=require('sequelize');module[_0x652b('0x0')]={'name':{'type':Sequelize[_0x652b('0x1')],'unique':_0x652b('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x652b('0x1')]},'display_name':{'type':Sequelize[_0x652b('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x652b('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x652b('0x3')]},'original_sampleCount':{'type':Sequelize[_0x652b('0x4')]},'original_channelCount':{'type':Sequelize[_0x652b('0x5')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x652b('0x5')]},'converted_format':{'type':Sequelize[_0x652b('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x652b('0x4')]},'converted_channelCount':{'type':Sequelize[_0x652b('0x5')]},'converted_bitRate':{'type':Sequelize[_0x652b('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8df5=['INTEGER','sequelize','exports','name','STRING','FLOAT','BIGINT'];(function(_0x5018f4,_0x10ac45){var _0x20e779=function(_0x1be00e){while(--_0x1be00e){_0x5018f4['push'](_0x5018f4['shift']());}};_0x20e779(++_0x10ac45);}(_0x8df5,0x1eb));var _0x58df=function(_0x220ceb,_0x146d84){_0x220ceb=_0x220ceb-0x0;var _0x47ec04=_0x8df5[_0x220ceb];return _0x47ec04;};'use strict';var Sequelize=require(_0x58df('0x0'));module[_0x58df('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x58df('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x58df('0x3')]},'display_name':{'type':Sequelize[_0x58df('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0x58df('0x3')]},'original_format':{'type':Sequelize[_0x58df('0x3')]},'original_duration':{'type':Sequelize[_0x58df('0x4')]},'original_sampleCount':{'type':Sequelize[_0x58df('0x5')]},'original_channelCount':{'type':Sequelize[_0x58df('0x6')]},'original_bitRate':{'type':Sequelize[_0x58df('0x5')]},'original_sampleRate':{'type':Sequelize[_0x58df('0x6')]},'converted_format':{'type':Sequelize[_0x58df('0x3')]},'converted_duration':{'type':Sequelize[_0x58df('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x58df('0x5')]},'converted_channelCount':{'type':Sequelize[_0x58df('0x6')]},'converted_bitRate':{'type':Sequelize[_0x58df('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x58df('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 18889b8..e908f63 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 _0x825d=['offset','limit','apply','reject','save','update','destroy','then','get','UserProfileResource','error','name','send','Sound','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','params','keys','find','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','download','format','%s.%s','save_name','create','basename','file','originalname','extname','substring','wav','server/files/sounds/original','filename','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','src','original_duration','duration','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Sounds','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','unlinkSync','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x825d,0xd1));var _0xd825=function(_0xb94ba9,_0x3c06a5){_0xb94ba9=_0xb94ba9-0x0;var _0x4e252b=_0x825d[_0xb94ba9];return _0x4e252b;};'use strict';var pdf=require(_0xd825('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd825('0x1'));var jsonpatch=require(_0xd825('0x2'));var rp=require(_0xd825('0x3'));var moment=require('moment');var BPromise=require(_0xd825('0x4'));var Mustache=require(_0xd825('0x5'));var util=require(_0xd825('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd825('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd825('0x8'));var crypto=require(_0xd825('0x9'));var jsforce=require(_0xd825('0xa'));var deskjs=require(_0xd825('0xb'));var toCsv=require(_0xd825('0x7'));var querystring=require('querystring');var Papa=require(_0xd825('0xc'));var Redis=require(_0xd825('0xd'));var authService=require(_0xd825('0xe'));var qs=require(_0xd825('0xf'));var as=require(_0xd825('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd825('0x11'))(_0xd825('0x12'));var utils=require('../../config/utils');var config=require(_0xd825('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x320a9a,_0x234fb5){_0x234fb5=_0x234fb5||0xcc;return function(_0x415712){if(_0x415712){return _0x320a9a[_0xd825('0x14')](_0x234fb5);}return _0x320a9a[_0xd825('0x15')](_0x234fb5)[_0xd825('0x16')]();};}function respondWithResult(_0x481120,_0x30c5c9){_0x30c5c9=_0x30c5c9||0xc8;return function(_0x5e58d4){if(_0x5e58d4){return _0x481120['status'](_0x30c5c9)['json'](_0x5e58d4);}};}function respondWithFilteredResult(_0x3fdbeb,_0x5defaa){return function(_0x59538a){if(_0x59538a){var _0x25d518=_0x59538a['count'],_0xa83d79=_0x5defaa[_0xd825('0x17')],_0x34c594=_0x5defaa[_0xd825('0x17')]+_0x5defaa[_0xd825('0x18')],_0x3c67e9;if(_0x34c594>=_0x25d518){_0x34c594=_0x25d518;_0x3c67e9=0xc8;}else{_0x3c67e9=0xce;}_0x3fdbeb[_0xd825('0x15')](_0x3c67e9);return _0x3fdbeb['set']('Content-Range',_0xa83d79+'-'+_0x34c594+'/'+_0x25d518)['json'](_0x59538a);}return null;};}function patchUpdates(_0x1bd37a){return function(_0x21209c){try{jsonpatch[_0xd825('0x19')](_0x21209c,_0x1bd37a,!![]);}catch(_0x11c9a8){return BPromise[_0xd825('0x1a')](_0x11c9a8);}return _0x21209c[_0xd825('0x1b')]();};}function saveUpdates(_0x20dae5,_0x5e6fe0){return function(_0x2b7d7d){if(_0x2b7d7d){return _0x2b7d7d[_0xd825('0x1c')](_0x20dae5)['then'](function(_0x551d5d){return _0x551d5d;});}return null;};}function removeEntity(_0x53b113,_0x3b966b){return function(_0x166524){if(_0x166524){return _0x166524[_0xd825('0x1d')]()[_0xd825('0x1e')](function(){var _0x477b54=_0x166524[_0xd825('0x1f')]({'plain':!![]});var _0x1ff2c5='Sounds';return db[_0xd825('0x20')][_0xd825('0x1d')]({'where':{'type':_0x1ff2c5,'resourceId':_0x477b54['id']}})[_0xd825('0x1e')](function(){return _0x166524;});})[_0xd825('0x1e')](function(){_0x53b113[_0xd825('0x15')](0xcc)[_0xd825('0x16')]();});}};}function handleEntityNotFound(_0x27316c,_0x30cd24){return function(_0xb2d410){if(!_0xb2d410){_0x27316c[_0xd825('0x14')](0x194);}return _0xb2d410;};}function handleError(_0x2b31d4,_0x549ae1){_0x549ae1=_0x549ae1||0x1f4;return function(_0x9a004f){logger[_0xd825('0x21')](_0x9a004f['stack']);if(_0x9a004f[_0xd825('0x22')]){delete _0x9a004f[_0xd825('0x22')];}_0x2b31d4[_0xd825('0x15')](_0x549ae1)[_0xd825('0x23')](_0x9a004f);};}exports['index']=function(_0xa3d2e9,_0x1fc5ac){var _0x3ed7fd={},_0x5d7513={},_0x11ac8f={'count':0x0,'rows':[]};var _0x4c7362=_['map'](db[_0xd825('0x24')]['rawAttributes'],function(_0x24f5cf){return{'name':_0x24f5cf[_0xd825('0x25')],'type':_0x24f5cf[_0xd825('0x26')][_0xd825('0x27')]};});_0x5d7513[_0xd825('0x28')]=_[_0xd825('0x29')](_0x4c7362,_0xd825('0x22'));_0x5d7513[_0xd825('0x2a')]=_['keys'](_0xa3d2e9['query']);_0x5d7513['filters']=_[_0xd825('0x2b')](_0x5d7513[_0xd825('0x28')],_0x5d7513[_0xd825('0x2a')]);_0x3ed7fd[_0xd825('0x2c')]=_[_0xd825('0x2b')](_0x5d7513[_0xd825('0x28')],qs[_0xd825('0x2d')](_0xa3d2e9[_0xd825('0x2a')]['fields']));_0x3ed7fd[_0xd825('0x2c')]=_0x3ed7fd[_0xd825('0x2c')][_0xd825('0x2e')]?_0x3ed7fd['attributes']:_0x5d7513['model'];if(!_0xa3d2e9[_0xd825('0x2a')][_0xd825('0x2f')](_0xd825('0x30'))){_0x3ed7fd['limit']=qs[_0xd825('0x18')](_0xa3d2e9[_0xd825('0x2a')]['limit']);_0x3ed7fd['offset']=qs[_0xd825('0x17')](_0xa3d2e9[_0xd825('0x2a')]['offset']);}_0x3ed7fd[_0xd825('0x31')]=qs['sort'](_0xa3d2e9['query'][_0xd825('0x32')]);_0x3ed7fd[_0xd825('0x33')]=qs[_0xd825('0x34')](_[_0xd825('0x35')](_0xa3d2e9[_0xd825('0x2a')],_0x5d7513[_0xd825('0x34')]),_0x4c7362);if(_0xa3d2e9[_0xd825('0x2a')][_0xd825('0x36')]){_0x3ed7fd['where']=_['merge'](_0x3ed7fd[_0xd825('0x33')],{'$or':_[_0xd825('0x29')](_0x4c7362,function(_0x3394e2){if(_0x3394e2[_0xd825('0x26')]!==_0xd825('0x37')){var _0x398d32={};_0x398d32[_0x3394e2[_0xd825('0x22')]]={'$like':'%'+_0xa3d2e9[_0xd825('0x2a')][_0xd825('0x36')]+'%'};return _0x398d32;}})});}_0x3ed7fd=_[_0xd825('0x38')]({},_0x3ed7fd,_0xa3d2e9[_0xd825('0x39')]);var _0x5430eb={'where':_0x3ed7fd[_0xd825('0x33')]};return db[_0xd825('0x24')][_0xd825('0x3a')](_0x5430eb)[_0xd825('0x1e')](function(_0x3d3e5d){_0x11ac8f['count']=_0x3d3e5d;if(_0xa3d2e9[_0xd825('0x2a')][_0xd825('0x3b')]){_0x3ed7fd['include']=[{'all':!![]}];}return db[_0xd825('0x24')][_0xd825('0x3c')](_0x3ed7fd);})[_0xd825('0x1e')](function(_0x308cf9){_0x11ac8f[_0xd825('0x3d')]=_0x308cf9;return _0x11ac8f;})[_0xd825('0x1e')](respondWithFilteredResult(_0x1fc5ac,_0x3ed7fd))[_0xd825('0x3e')](handleError(_0x1fc5ac,null));};exports['show']=function(_0x106dc9,_0x7b8e4c){var _0x24eb9d={'raw':!![],'where':{'id':_0x106dc9[_0xd825('0x3f')]['id']}},_0x4fdc16={};_0x4fdc16['model']=_['keys'](db[_0xd825('0x24')]['rawAttributes']);_0x4fdc16[_0xd825('0x2a')]=_[_0xd825('0x40')](_0x106dc9['query']);_0x4fdc16['filters']=_[_0xd825('0x2b')](_0x4fdc16['model'],_0x4fdc16[_0xd825('0x2a')]);_0x24eb9d[_0xd825('0x2c')]=_[_0xd825('0x2b')](_0x4fdc16['model'],qs[_0xd825('0x2d')](_0x106dc9['query'][_0xd825('0x2d')]));_0x24eb9d[_0xd825('0x2c')]=_0x24eb9d[_0xd825('0x2c')][_0xd825('0x2e')]?_0x24eb9d[_0xd825('0x2c')]:_0x4fdc16[_0xd825('0x28')];if(_0x106dc9[_0xd825('0x2a')][_0xd825('0x3b')]){_0x24eb9d['include']=[{'all':!![]}];}_0x24eb9d=_[_0xd825('0x38')]({},_0x24eb9d,_0x106dc9[_0xd825('0x39')]);return db[_0xd825('0x24')][_0xd825('0x41')](_0x24eb9d)['then'](handleEntityNotFound(_0x7b8e4c,null))[_0xd825('0x1e')](respondWithResult(_0x7b8e4c,null))['catch'](handleError(_0x7b8e4c,null));};exports['download']=function(_0xa21bcd,_0x2c9558,_0x5346ca){return db['Sound'][_0xd825('0x41')]({'where':{'id':_0xa21bcd[_0xd825('0x3f')]['id']},'attributes':['name','save_name',_0xd825('0x42')],'raw':!![]})[_0xd825('0x1e')](handleEntityNotFound(_0x2c9558,null))[_0xd825('0x1e')](function(_0x259fb5){if(_0x259fb5){if(!fs[_0xd825('0x43')](path[_0xd825('0x44')](config[_0xd825('0x45')],_0xd825('0x46'),_0x259fb5['save_name']+'.'+_0x259fb5[_0xd825('0x42')]))){throw new db[(_0xd825('0x47'))][(_0xd825('0x48'))]('Sound\x20not\x20found');}return _0x2c9558[_0xd825('0x49')](path[_0xd825('0x44')](config[_0xd825('0x45')],'server/files/sounds/converted',util[_0xd825('0x4a')](_0xd825('0x4b'),_0x259fb5[_0xd825('0x4c')],_0x259fb5[_0xd825('0x42')])),util[_0xd825('0x4a')](_0xd825('0x4b'),_0x259fb5[_0xd825('0x22')],_0x259fb5[_0xd825('0x42')]));}return null;})[_0xd825('0x3e')](handleError(_0x2c9558,null));};exports[_0xd825('0x4d')]=function(_0x404b77,_0x25c3fd,_0x251014){var _0x4bff47={'name':path[_0xd825('0x4e')](_0x404b77[_0xd825('0x4f')][_0xd825('0x50')],path[_0xd825('0x51')](_0x404b77['file']['originalname'])),'save_name':path[_0xd825('0x4e')](_0x404b77['file']['filename'],path['extname'](_0x404b77[_0xd825('0x4f')]['filename'])),'original_format':path[_0xd825('0x51')](_0x404b77['file'][_0xd825('0x50')])[_0xd825('0x52')](0x1),'converted_format':_0xd825('0x53')};var _0x50b2d3=path[_0xd825('0x44')](config['root'],_0xd825('0x54'),_0x404b77['file']['filename']);var _0x549ee1=path[_0xd825('0x44')](config[_0xd825('0x45')],_0xd825('0x46'),util[_0xd825('0x4a')](_0xd825('0x4b'),path['basename'](_0x404b77[_0xd825('0x4f')][_0xd825('0x55')],path[_0xd825('0x51')](_0x404b77[_0xd825('0x4f')][_0xd825('0x55')])),_0x4bff47[_0xd825('0x42')]));logger[_0xd825('0x56')]('Sound\x20upload\x20filepath:\x20%s',_0x50b2d3);logger[_0xd825('0x56')](_0xd825('0x57'),_0x549ee1);try{fs[_0xd825('0x58')](_0x50b2d3,parseInt(_0xd825('0x59'),0x8));var _0x221948=sox[_0xd825('0x5a')](_0x50b2d3,_0x549ee1,{'sampleRate':0x1f40,'format':_0xd825('0x53'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x221948['on'](_0xd825('0x21'),function(_0x3a1baa){fs['unlinkSync'](_0x50b2d3);_0x25c3fd[_0xd825('0x15')](0x1f4)['send'](_0x3a1baa);});_0x221948['on'](_0xd825('0x5b'),function(_0x1d3ae9){_0x4bff47[_0xd825('0x5c')]=isNaN(_0x1d3ae9[_0xd825('0x5d')])?null:_0x1d3ae9[_0xd825('0x5d')]*0x3e8;_0x4bff47['original_sampleCount']=isNaN(_0x1d3ae9['sampleCount'])?null:_0x1d3ae9[_0xd825('0x5e')];_0x4bff47[_0xd825('0x5f')]=isNaN(_0x1d3ae9['channelCount'])?null:_0x1d3ae9[_0xd825('0x60')];_0x4bff47[_0xd825('0x61')]=isNaN(_0x1d3ae9['bitRate'])?null:_0x1d3ae9[_0xd825('0x62')];_0x4bff47[_0xd825('0x63')]=isNaN(_0x1d3ae9['sampleRate'])?null:_0x1d3ae9[_0xd825('0x64')];});_0x221948['on'](_0xd825('0x65'),function(_0x4488b7){_0x4bff47[_0xd825('0x66')]=isNaN(_0x4488b7['duration'])?null:_0x4488b7[_0xd825('0x5d')]*0x3e8;_0x4bff47[_0xd825('0x67')]=isNaN(_0x4488b7['sampleCount'])?null:_0x4488b7[_0xd825('0x5e')];_0x4bff47['converted_channelCount']=isNaN(_0x4488b7[_0xd825('0x60')])?null:_0x4488b7['channelCount'];_0x4bff47[_0xd825('0x68')]=isNaN(_0x4488b7[_0xd825('0x62')])?null:_0x4488b7[_0xd825('0x62')];_0x4bff47['converted_sampleRate']=isNaN(_0x4488b7['sampleRate'])?null:_0x4488b7[_0xd825('0x64')];});_0x221948['on'](_0xd825('0x16'),function(){fs[_0xd825('0x58')](_0x549ee1,parseInt(_0xd825('0x59'),0x8));return db[_0xd825('0x24')]['create'](_0x4bff47)[_0xd825('0x1e')](function(_0x3e5612){var _0x5492da={'role':_0x404b77[_0xd825('0x69')][_0xd825('0x6a')],'userProfileId':_0x404b77['body']['userProfileId']};if(!_0x5492da)throw new Error(_0xd825('0x6b'));if(_0x5492da[_0xd825('0x6a')]==='user'){var _0x56d9b5=_0x3e5612[_0xd825('0x1f')]({'plain':!![]});return db[_0xd825('0x6c')]['find']({'where':{'name':_0xd825('0x6d'),'userProfileId':_0x5492da['userProfileId']},'raw':!![]})[_0xd825('0x1e')](function(_0x55d556){if(_0x55d556&&_0x55d556['autoAssociation']===0x0){return db['UserProfileResource'][_0xd825('0x4d')]({'name':_0x56d9b5[_0xd825('0x22')],'resourceId':_0x56d9b5['id'],'type':_0x55d556[_0xd825('0x22')],'sectionId':_0x55d556['id']},{})['then'](function(){return _0x3e5612;});}else{return _0x3e5612;}})[_0xd825('0x3e')](function(_0x14bc22){logger[_0xd825('0x21')](_0xd825('0x6e'),_0x14bc22);throw _0x14bc22;});}return _0x3e5612;})['then'](respondWithResult(_0x25c3fd,null))[_0xd825('0x3e')](handleError(_0x25c3fd,null));});_0x221948[_0xd825('0x6f')]();}catch(_0x17ee36){_0x25c3fd['status'](0x1f4)[_0xd825('0x23')](_0x17ee36);}};exports['update']=function(_0x5bfc79,_0x38693b,_0x42efbc){return db[_0xd825('0x24')][_0xd825('0x41')]({'where':{'id':_0x5bfc79[_0xd825('0x3f')]['id']}})['then'](handleEntityNotFound(_0x38693b,null))[_0xd825('0x1e')](saveUpdates(_[_0xd825('0x35')](_0x5bfc79[_0xd825('0x69')],[_0xd825('0x22'),_0xd825('0x70')]),null))[_0xd825('0x1e')](respondWithResult(_0x38693b,null))[_0xd825('0x3e')](handleError(_0x38693b,null));};exports[_0xd825('0x71')]=function(_0x1514c9,_0x212356,_0x2333c4){return db[_0xd825('0x24')]['find']({'where':{'id':_0x1514c9['params']['id']}})['then'](function(_0x5cfd18){if(_0x5cfd18){return _0x5cfd18[_0xd825('0x1d')]();}})[_0xd825('0x1e')](function(_0xab5758){var _0x3e521f=path[_0xd825('0x44')](config[_0xd825('0x45')],_0xd825('0x54'),util[_0xd825('0x4a')](_0xd825('0x4b'),_0xab5758[_0xd825('0x4c')],_0xab5758[_0xd825('0x72')]));var _0x3c3c74=path[_0xd825('0x44')](config['root'],_0xd825('0x46'),util['format'](_0xd825('0x4b'),_0xab5758[_0xd825('0x4c')],_0xab5758['converted_format']));fs[_0xd825('0x73')](_0x3e521f);fs[_0xd825('0x73')](_0x3c3c74);return _0xab5758;})[_0xd825('0x1e')](function(_0x411054){if(_0x411054){return _0x212356[_0xd825('0x15')](0xcc)['end']();}})[_0xd825('0x1e')](handleEntityNotFound(_0x212356,null))[_0xd825('0x3e')](handleError(_0x212356,null));}; \ No newline at end of file +var _0xe74a=['0777','send','src','original_duration','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','body','userProfileId','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','delete','server/files/sounds/original','original_format','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','get','Sounds','UserProfileResource','sendStatus','stack','map','Sound','rawAttributes','fieldName','key','model','name','filters','intersection','query','attributes','fields','length','order','sort','where','merge','type','VIRTUAL','filter','options','count','findAll','rows','show','include','catch','download','converted_format','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','chmodSync'];(function(_0x372cde,_0x2f9c49){var _0x5f044c=function(_0xfc891b){while(--_0xfc891b){_0x372cde['push'](_0x372cde['shift']());}};_0x5f044c(++_0x2f9c49);}(_0xe74a,0x177));var _0xae74=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe74a[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0xae74('0x0'));var emlformat=require(_0xae74('0x1'));var rimraf=require(_0xae74('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xae74('0x3'));var rp=require(_0xae74('0x4'));var moment=require(_0xae74('0x5'));var BPromise=require(_0xae74('0x6'));var Mustache=require(_0xae74('0x7'));var util=require(_0xae74('0x8'));var path=require(_0xae74('0x9'));var sox=require(_0xae74('0xa'));var csv=require(_0xae74('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xae74('0xc'));var crypto=require('crypto');var jsforce=require(_0xae74('0xd'));var deskjs=require(_0xae74('0xe'));var toCsv=require(_0xae74('0xb'));var querystring=require('querystring');var Papa=require(_0xae74('0xf'));var Redis=require(_0xae74('0x10'));var authService=require(_0xae74('0x11'));var qs=require(_0xae74('0x12'));var as=require(_0xae74('0x13'));var hardwareService=require(_0xae74('0x14'));var logger=require(_0xae74('0x15'))(_0xae74('0x16'));var utils=require(_0xae74('0x17'));var config=require(_0xae74('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3894bd,_0x21c9b2){_0x21c9b2=_0x21c9b2||0xcc;return function(_0x5e66d7){if(_0x5e66d7){return _0x3894bd['sendStatus'](_0x21c9b2);}return _0x3894bd[_0xae74('0x19')](_0x21c9b2)[_0xae74('0x1a')]();};}function respondWithResult(_0x3d2607,_0x344d2d){_0x344d2d=_0x344d2d||0xc8;return function(_0x573bb3){if(_0x573bb3){return _0x3d2607[_0xae74('0x19')](_0x344d2d)[_0xae74('0x1b')](_0x573bb3);}};}function respondWithFilteredResult(_0x32e871,_0x720771){return function(_0x159512){if(_0x159512){var _0x22be08=_0x159512['count'],_0x3219ef=_0x720771[_0xae74('0x1c')],_0x4571e2=_0x720771[_0xae74('0x1c')]+_0x720771[_0xae74('0x1d')],_0x2f2e46;if(_0x4571e2>=_0x22be08){_0x4571e2=_0x22be08;_0x2f2e46=0xc8;}else{_0x2f2e46=0xce;}_0x32e871['status'](_0x2f2e46);return _0x32e871[_0xae74('0x1e')]('Content-Range',_0x3219ef+'-'+_0x4571e2+'/'+_0x22be08)[_0xae74('0x1b')](_0x159512);}return null;};}function patchUpdates(_0x217327){return function(_0x414c2d){try{jsonpatch[_0xae74('0x1f')](_0x414c2d,_0x217327,!![]);}catch(_0x329f65){return BPromise[_0xae74('0x20')](_0x329f65);}return _0x414c2d[_0xae74('0x21')]();};}function saveUpdates(_0x11c160,_0xc7ebf4){return function(_0x17b87b){if(_0x17b87b){return _0x17b87b[_0xae74('0x22')](_0x11c160)[_0xae74('0x23')](function(_0x226fe2){return _0x226fe2;});}return null;};}function removeEntity(_0x3569c3,_0x485397){return function(_0x338045){if(_0x338045){return _0x338045[_0xae74('0x24')]()['then'](function(){var _0x514228=_0x338045[_0xae74('0x25')]({'plain':!![]});var _0x43ad79=_0xae74('0x26');return db[_0xae74('0x27')][_0xae74('0x24')]({'where':{'type':_0x43ad79,'resourceId':_0x514228['id']}})[_0xae74('0x23')](function(){return _0x338045;});})[_0xae74('0x23')](function(){_0x3569c3[_0xae74('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35e9ef,_0x1cad09){return function(_0x337cf1){if(!_0x337cf1){_0x35e9ef[_0xae74('0x28')](0x194);}return _0x337cf1;};}function handleError(_0x36dc83,_0x170d57){_0x170d57=_0x170d57||0x1f4;return function(_0x2ba279){logger['error'](_0x2ba279[_0xae74('0x29')]);if(_0x2ba279['name']){delete _0x2ba279['name'];}_0x36dc83[_0xae74('0x19')](_0x170d57)['send'](_0x2ba279);};}exports['index']=function(_0x37e51c,_0x5d3a8b){var _0x4b8b77={},_0x17b4f1={},_0x26441e={'count':0x0,'rows':[]};var _0x2680bb=_[_0xae74('0x2a')](db[_0xae74('0x2b')][_0xae74('0x2c')],function(_0x467a28){return{'name':_0x467a28[_0xae74('0x2d')],'type':_0x467a28['type'][_0xae74('0x2e')]};});_0x17b4f1[_0xae74('0x2f')]=_[_0xae74('0x2a')](_0x2680bb,_0xae74('0x30'));_0x17b4f1['query']=_['keys'](_0x37e51c['query']);_0x17b4f1[_0xae74('0x31')]=_[_0xae74('0x32')](_0x17b4f1[_0xae74('0x2f')],_0x17b4f1[_0xae74('0x33')]);_0x4b8b77[_0xae74('0x34')]=_[_0xae74('0x32')](_0x17b4f1[_0xae74('0x2f')],qs[_0xae74('0x35')](_0x37e51c['query'][_0xae74('0x35')]));_0x4b8b77[_0xae74('0x34')]=_0x4b8b77[_0xae74('0x34')][_0xae74('0x36')]?_0x4b8b77[_0xae74('0x34')]:_0x17b4f1['model'];if(!_0x37e51c[_0xae74('0x33')]['hasOwnProperty']('nolimit')){_0x4b8b77[_0xae74('0x1d')]=qs[_0xae74('0x1d')](_0x37e51c[_0xae74('0x33')][_0xae74('0x1d')]);_0x4b8b77[_0xae74('0x1c')]=qs[_0xae74('0x1c')](_0x37e51c[_0xae74('0x33')]['offset']);}_0x4b8b77[_0xae74('0x37')]=qs['sort'](_0x37e51c[_0xae74('0x33')][_0xae74('0x38')]);_0x4b8b77['where']=qs[_0xae74('0x31')](_['pick'](_0x37e51c['query'],_0x17b4f1['filters']),_0x2680bb);if(_0x37e51c[_0xae74('0x33')]['filter']){_0x4b8b77[_0xae74('0x39')]=_[_0xae74('0x3a')](_0x4b8b77[_0xae74('0x39')],{'$or':_[_0xae74('0x2a')](_0x2680bb,function(_0x227416){if(_0x227416[_0xae74('0x3b')]!==_0xae74('0x3c')){var _0x3db151={};_0x3db151[_0x227416[_0xae74('0x30')]]={'$like':'%'+_0x37e51c['query'][_0xae74('0x3d')]+'%'};return _0x3db151;}})});}_0x4b8b77=_[_0xae74('0x3a')]({},_0x4b8b77,_0x37e51c[_0xae74('0x3e')]);var _0x4320a6={'where':_0x4b8b77[_0xae74('0x39')]};return db['Sound'][_0xae74('0x3f')](_0x4320a6)[_0xae74('0x23')](function(_0x1a6364){_0x26441e['count']=_0x1a6364;if(_0x37e51c['query']['includeAll']){_0x4b8b77['include']=[{'all':!![]}];}return db[_0xae74('0x2b')][_0xae74('0x40')](_0x4b8b77);})[_0xae74('0x23')](function(_0x4e3ab7){_0x26441e[_0xae74('0x41')]=_0x4e3ab7;return _0x26441e;})['then'](respondWithFilteredResult(_0x5d3a8b,_0x4b8b77))['catch'](handleError(_0x5d3a8b,null));};exports[_0xae74('0x42')]=function(_0x1be0da,_0x5b6387){var _0x4e14a1={'raw':!![],'where':{'id':_0x1be0da['params']['id']}},_0x3018ed={};_0x3018ed['model']=_['keys'](db[_0xae74('0x2b')][_0xae74('0x2c')]);_0x3018ed[_0xae74('0x33')]=_['keys'](_0x1be0da[_0xae74('0x33')]);_0x3018ed[_0xae74('0x31')]=_[_0xae74('0x32')](_0x3018ed['model'],_0x3018ed[_0xae74('0x33')]);_0x4e14a1[_0xae74('0x34')]=_[_0xae74('0x32')](_0x3018ed[_0xae74('0x2f')],qs['fields'](_0x1be0da[_0xae74('0x33')]['fields']));_0x4e14a1['attributes']=_0x4e14a1['attributes'][_0xae74('0x36')]?_0x4e14a1[_0xae74('0x34')]:_0x3018ed[_0xae74('0x2f')];if(_0x1be0da[_0xae74('0x33')]['includeAll']){_0x4e14a1[_0xae74('0x43')]=[{'all':!![]}];}_0x4e14a1=_[_0xae74('0x3a')]({},_0x4e14a1,_0x1be0da[_0xae74('0x3e')]);return db[_0xae74('0x2b')]['find'](_0x4e14a1)[_0xae74('0x23')](handleEntityNotFound(_0x5b6387,null))[_0xae74('0x23')](respondWithResult(_0x5b6387,null))[_0xae74('0x44')](handleError(_0x5b6387,null));};exports[_0xae74('0x45')]=function(_0x356ce3,_0x108c8e,_0x243a99){return db[_0xae74('0x2b')]['find']({'where':{'id':_0x356ce3['params']['id']},'attributes':[_0xae74('0x30'),'save_name',_0xae74('0x46')],'raw':!![]})['then'](handleEntityNotFound(_0x108c8e,null))[_0xae74('0x23')](function(_0x13dda6){if(_0x13dda6){if(!fs['existsSync'](path[_0xae74('0x47')](config[_0xae74('0x48')],_0xae74('0x49'),_0x13dda6[_0xae74('0x4a')]+'.'+_0x13dda6['converted_format']))){throw new db[(_0xae74('0x4b'))][(_0xae74('0x4c'))](_0xae74('0x4d'));}return _0x108c8e[_0xae74('0x45')](path[_0xae74('0x47')](config[_0xae74('0x48')],'server/files/sounds/converted',util[_0xae74('0x4e')](_0xae74('0x4f'),_0x13dda6['save_name'],_0x13dda6[_0xae74('0x46')])),util['format'](_0xae74('0x4f'),_0x13dda6[_0xae74('0x30')],_0x13dda6[_0xae74('0x46')]));}return null;})['catch'](handleError(_0x108c8e,null));};exports[_0xae74('0x50')]=function(_0x68ffee,_0x5d9f00,_0x1c347e){var _0x1ee32d={'name':path[_0xae74('0x51')](_0x68ffee[_0xae74('0x52')][_0xae74('0x53')],path[_0xae74('0x54')](_0x68ffee['file'][_0xae74('0x53')])),'save_name':path[_0xae74('0x51')](_0x68ffee[_0xae74('0x52')][_0xae74('0x55')],path[_0xae74('0x54')](_0x68ffee[_0xae74('0x52')]['filename'])),'original_format':path['extname'](_0x68ffee[_0xae74('0x52')][_0xae74('0x53')])[_0xae74('0x56')](0x1),'converted_format':_0xae74('0x57')};var _0x50d2e8=path[_0xae74('0x47')](config[_0xae74('0x48')],'server/files/sounds/original',_0x68ffee['file'][_0xae74('0x55')]);var _0x288b05=path['join'](config[_0xae74('0x48')],_0xae74('0x49'),util[_0xae74('0x4e')]('%s.%s',path[_0xae74('0x51')](_0x68ffee[_0xae74('0x52')][_0xae74('0x55')],path[_0xae74('0x54')](_0x68ffee[_0xae74('0x52')][_0xae74('0x55')])),_0x1ee32d[_0xae74('0x46')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x50d2e8);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x288b05);try{fs[_0xae74('0x58')](_0x50d2e8,parseInt(_0xae74('0x59'),0x8));var _0x5b2968=sox['transcode'](_0x50d2e8,_0x288b05,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5b2968['on']('error',function(_0x3718ae){fs['unlinkSync'](_0x50d2e8);_0x5d9f00[_0xae74('0x19')](0x1f4)[_0xae74('0x5a')](_0x3718ae);});_0x5b2968['on'](_0xae74('0x5b'),function(_0x34756b){_0x1ee32d[_0xae74('0x5c')]=isNaN(_0x34756b[_0xae74('0x5d')])?null:_0x34756b['duration']*0x3e8;_0x1ee32d[_0xae74('0x5e')]=isNaN(_0x34756b[_0xae74('0x5f')])?null:_0x34756b['sampleCount'];_0x1ee32d['original_channelCount']=isNaN(_0x34756b[_0xae74('0x60')])?null:_0x34756b[_0xae74('0x60')];_0x1ee32d[_0xae74('0x61')]=isNaN(_0x34756b[_0xae74('0x62')])?null:_0x34756b[_0xae74('0x62')];_0x1ee32d['original_sampleRate']=isNaN(_0x34756b['sampleRate'])?null:_0x34756b[_0xae74('0x63')];});_0x5b2968['on'](_0xae74('0x64'),function(_0x180b11){_0x1ee32d[_0xae74('0x65')]=isNaN(_0x180b11[_0xae74('0x5d')])?null:_0x180b11[_0xae74('0x5d')]*0x3e8;_0x1ee32d[_0xae74('0x66')]=isNaN(_0x180b11['sampleCount'])?null:_0x180b11[_0xae74('0x5f')];_0x1ee32d['converted_channelCount']=isNaN(_0x180b11[_0xae74('0x60')])?null:_0x180b11[_0xae74('0x60')];_0x1ee32d[_0xae74('0x67')]=isNaN(_0x180b11[_0xae74('0x62')])?null:_0x180b11[_0xae74('0x62')];_0x1ee32d[_0xae74('0x68')]=isNaN(_0x180b11[_0xae74('0x63')])?null:_0x180b11['sampleRate'];});_0x5b2968['on'](_0xae74('0x1a'),function(){fs['chmodSync'](_0x288b05,parseInt(_0xae74('0x59'),0x8));return db['Sound'][_0xae74('0x50')](_0x1ee32d)['then'](function(_0x337835){var _0x5d8ece={'role':_0x68ffee[_0xae74('0x69')]['role'],'userProfileId':_0x68ffee[_0xae74('0x69')][_0xae74('0x6a')]};if(!_0x5d8ece)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d8ece[_0xae74('0x6b')]==='user'){var _0x46dd48=_0x337835[_0xae74('0x25')]({'plain':!![]});return db[_0xae74('0x6c')][_0xae74('0x6d')]({'where':{'name':_0xae74('0x26'),'userProfileId':_0x5d8ece['userProfileId']},'raw':!![]})[_0xae74('0x23')](function(_0xf31e5f){if(_0xf31e5f&&_0xf31e5f[_0xae74('0x6e')]===0x0){return db[_0xae74('0x27')][_0xae74('0x50')]({'name':_0x46dd48[_0xae74('0x30')],'resourceId':_0x46dd48['id'],'type':_0xf31e5f[_0xae74('0x30')],'sectionId':_0xf31e5f['id']},{})[_0xae74('0x23')](function(){return _0x337835;});}else{return _0x337835;}})[_0xae74('0x44')](function(_0x39eabc){logger['error'](_0xae74('0x6f'),_0x39eabc);throw _0x39eabc;});}return _0x337835;})[_0xae74('0x23')](respondWithResult(_0x5d9f00,null))[_0xae74('0x44')](handleError(_0x5d9f00,null));});_0x5b2968['start']();}catch(_0x1c32d2){_0x5d9f00[_0xae74('0x19')](0x1f4)[_0xae74('0x5a')](_0x1c32d2);}};exports[_0xae74('0x22')]=function(_0x49772c,_0x5d0686,_0x15736c){return db[_0xae74('0x2b')][_0xae74('0x6d')]({'where':{'id':_0x49772c['params']['id']}})[_0xae74('0x23')](handleEntityNotFound(_0x5d0686,null))[_0xae74('0x23')](saveUpdates(_['pick'](_0x49772c[_0xae74('0x69')],['name','description']),null))[_0xae74('0x23')](respondWithResult(_0x5d0686,null))[_0xae74('0x44')](handleError(_0x5d0686,null));};exports[_0xae74('0x70')]=function(_0x1598cf,_0x389e3d,_0x3a82c1){return db[_0xae74('0x2b')][_0xae74('0x6d')]({'where':{'id':_0x1598cf['params']['id']}})[_0xae74('0x23')](function(_0x46cb31){if(_0x46cb31){return _0x46cb31['destroy']();}})['then'](function(_0xa6690b){var _0x5bed64=path[_0xae74('0x47')](config['root'],_0xae74('0x71'),util[_0xae74('0x4e')](_0xae74('0x4f'),_0xa6690b[_0xae74('0x4a')],_0xa6690b[_0xae74('0x72')]));var _0x3a0c88=path[_0xae74('0x47')](config[_0xae74('0x48')],_0xae74('0x49'),util[_0xae74('0x4e')](_0xae74('0x4f'),_0xa6690b[_0xae74('0x4a')],_0xa6690b[_0xae74('0x46')]));fs[_0xae74('0x73')](_0x5bed64);fs[_0xae74('0x73')](_0x3a0c88);return _0xa6690b;})['then'](function(_0x54fa45){if(_0x54fa45){return _0x389e3d['status'](0xcc)[_0xae74('0x1a')]();}})[_0xae74('0x23')](handleEntityNotFound(_0x389e3d,null))['catch'](handleError(_0x389e3d,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 429d5b6..03154f2 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 _0x5f07=['../../config/environment','./sound.attributes','define','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1bc17a,_0x18310e){var _0x1f5d21=function(_0x4abe1a){while(--_0x4abe1a){_0x1bc17a['push'](_0x1bc17a['shift']());}};_0x1f5d21(++_0x18310e);}(_0x5f07,0x1cb));var _0x75f0=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x5f07[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0x75f0('0x0'));var util=require(_0x75f0('0x1'));var logger=require(_0x75f0('0x2'))(_0x75f0('0x3'));var moment=require(_0x75f0('0x4'));var BPromise=require(_0x75f0('0x5'));var rp=require(_0x75f0('0x6'));var fs=require('fs');var path=require(_0x75f0('0x7'));var rimraf=require(_0x75f0('0x8'));var config=require(_0x75f0('0x9'));var attributes=require(_0x75f0('0xa'));module['exports']=function(_0x3e499b,_0x5c60ec){return _0x3e499b[_0x75f0('0xb')]('Sound',attributes,{'tableName':_0x75f0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x901c=['Sound','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./sound.attributes','define'];(function(_0xd32a43,_0xdf721b){var _0x4ec16c=function(_0x3a2092){while(--_0x3a2092){_0xd32a43['push'](_0xd32a43['shift']());}};_0x4ec16c(++_0xdf721b);}(_0x901c,0xd3));var _0xc901=function(_0x4511b7,_0x2afad0){_0x4511b7=_0x4511b7-0x0;var _0x3865db=_0x901c[_0x4511b7];return _0x3865db;};'use strict';var _=require(_0xc901('0x0'));var util=require(_0xc901('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc901('0x2'));var BPromise=require(_0xc901('0x3'));var rp=require(_0xc901('0x4'));var fs=require('fs');var path=require(_0xc901('0x5'));var rimraf=require('rimraf');var config=require(_0xc901('0x6'));var attributes=require(_0xc901('0x7'));module['exports']=function(_0x4459e6,_0x36a1a4){return _0x4459e6[_0xc901('0x8')](_0xc901('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 0d907d8..aa2e2fa 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 _0x78dd=['stringify','error','code','message','ShowSound','Sound','find','options','raw','attributes','map','model','include','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x78dd,0x16d));var _0xd78d=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0x78dd[_0x4bcf38];return _0x4a89be;};'use strict';var _=require(_0xd78d('0x0'));var util=require(_0xd78d('0x1'));var moment=require(_0xd78d('0x2'));var BPromise=require(_0xd78d('0x3'));var rs=require(_0xd78d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd78d('0x5'))['db'];var utils=require(_0xd78d('0x6'));var logger=require(_0xd78d('0x7'))('rpc');var config=require(_0xd78d('0x8'));var jayson=require(_0xd78d('0x9'));var client=jayson[_0xd78d('0xa')][_0xd78d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a65c5,_0x4ecfe2,_0x3be937){return new BPromise(function(_0x207ffd,_0x2e76f1){return client[_0xd78d('0xc')](_0x5a65c5,_0x3be937)[_0xd78d('0xd')](function(_0x1289db){logger[_0xd78d('0xe')](_0xd78d('0xf'),_0x4ecfe2,'request\x20sent');logger[_0xd78d('0x10')](_0xd78d('0x11'),_0x4ecfe2,_0xd78d('0x12'),JSON[_0xd78d('0x13')](_0x1289db));if(_0x1289db[_0xd78d('0x14')]){if(_0x1289db[_0xd78d('0x14')][_0xd78d('0x15')]===0x1f4){logger[_0xd78d('0x14')](_0xd78d('0xf'),_0x4ecfe2,_0x1289db[_0xd78d('0x14')][_0xd78d('0x16')]);return _0x2e76f1(_0x1289db[_0xd78d('0x14')]['message']);}logger[_0xd78d('0x14')](_0xd78d('0xf'),_0x4ecfe2,_0x1289db[_0xd78d('0x14')][_0xd78d('0x16')]);return _0x207ffd(_0x1289db[_0xd78d('0x14')][_0xd78d('0x16')]);}else{logger[_0xd78d('0xe')](_0xd78d('0xf'),_0x4ecfe2,_0xd78d('0x12'));_0x207ffd(_0x1289db['result'][_0xd78d('0x16')]);}})['catch'](function(_0x3cc982){logger[_0xd78d('0x14')](_0xd78d('0xf'),_0x4ecfe2,_0x3cc982);_0x2e76f1(_0x3cc982);});});}exports[_0xd78d('0x17')]=function(_0x1431f7){var _0x162188=this;return new Promise(function(_0x25cfde,_0xb8b410){return db[_0xd78d('0x18')][_0xd78d('0x19')]({'raw':_0x1431f7[_0xd78d('0x1a')]?_0x1431f7[_0xd78d('0x1a')][_0xd78d('0x1b')]===undefined?!![]:![]:!![],'where':_0x1431f7[_0xd78d('0x1a')]?_0x1431f7[_0xd78d('0x1a')]['where']||null:null,'attributes':_0x1431f7[_0xd78d('0x1a')]?_0x1431f7['options'][_0xd78d('0x1c')]||null:null,'include':_0x1431f7[_0xd78d('0x1a')]?_0x1431f7['options']['include']?_[_0xd78d('0x1d')](_0x1431f7['options']['include'],function(_0x280b1d){return{'model':db[_0x280b1d[_0xd78d('0x1e')]],'as':_0x280b1d['as'],'attributes':_0x280b1d[_0xd78d('0x1c')],'include':_0x280b1d[_0xd78d('0x1f')]?_['map'](_0x280b1d[_0xd78d('0x1f')],function(_0x9e1507){return{'model':db[_0x9e1507['model']],'as':_0x9e1507['as'],'attributes':_0x9e1507[_0xd78d('0x1c')],'include':_0x9e1507['include']?_[_0xd78d('0x1d')](_0x9e1507['include'],function(_0x373207){return{'model':db[_0x373207[_0xd78d('0x1e')]],'as':_0x373207['as'],'attributes':_0x373207[_0xd78d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd78d('0xd')](function(_0x147b5a){logger['info'](_0xd78d('0x17'),_0x1431f7);logger['debug'](_0xd78d('0x17'),_0x1431f7,JSON[_0xd78d('0x13')](_0x147b5a));_0x25cfde(_0x147b5a);})['catch'](function(_0x24f678){logger[_0xd78d('0x14')](_0xd78d('0x17'),_0x24f678[_0xd78d('0x16')],_0x1431f7);_0xb8b410(_0x162188[_0xd78d('0x14')](0x1f4,_0x24f678[_0xd78d('0x16')]));});});}; \ No newline at end of file +var _0xd03f=['../../config/environment','client','http','request','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','ShowSound','Sound','find','raw','options','where','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x39ff31,_0x5ef90d){var _0x2fa089=function(_0x137fdb){while(--_0x137fdb){_0x39ff31['push'](_0x39ff31['shift']());}};_0x2fa089(++_0x5ef90d);}(_0xd03f,0x137));var _0xfd03=function(_0x5ad202,_0x32dd2f){_0x5ad202=_0x5ad202-0x0;var _0x285799=_0xd03f[_0x5ad202];return _0x285799;};'use strict';var _=require(_0xfd03('0x0'));var util=require(_0xfd03('0x1'));var moment=require(_0xfd03('0x2'));var BPromise=require(_0xfd03('0x3'));var rs=require(_0xfd03('0x4'));var fs=require('fs');var Redis=require(_0xfd03('0x5'));var db=require(_0xfd03('0x6'))['db'];var utils=require(_0xfd03('0x7'));var logger=require(_0xfd03('0x8'))('rpc');var config=require(_0xfd03('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfd03('0xa')][_0xfd03('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54979e,_0x5bb11c,_0x44384d){return new BPromise(function(_0xc24dd9,_0x5bd604){return client[_0xfd03('0xc')](_0x54979e,_0x44384d)['then'](function(_0x86d3fe){logger[_0xfd03('0xd')](_0xfd03('0xe'),_0x5bb11c,_0xfd03('0xf'));logger[_0xfd03('0x10')](_0xfd03('0x11'),_0x5bb11c,_0xfd03('0xf'),JSON[_0xfd03('0x12')](_0x86d3fe));if(_0x86d3fe[_0xfd03('0x13')]){if(_0x86d3fe[_0xfd03('0x13')]['code']===0x1f4){logger[_0xfd03('0x13')](_0xfd03('0xe'),_0x5bb11c,_0x86d3fe[_0xfd03('0x13')]['message']);return _0x5bd604(_0x86d3fe['error']['message']);}logger[_0xfd03('0x13')]('Sound,\x20%s,\x20%s',_0x5bb11c,_0x86d3fe[_0xfd03('0x13')][_0xfd03('0x14')]);return _0xc24dd9(_0x86d3fe[_0xfd03('0x13')][_0xfd03('0x14')]);}else{logger[_0xfd03('0xd')](_0xfd03('0xe'),_0x5bb11c,_0xfd03('0xf'));_0xc24dd9(_0x86d3fe['result']['message']);}})[_0xfd03('0x15')](function(_0x96a3e4){logger[_0xfd03('0x13')]('Sound,\x20%s,\x20%s',_0x5bb11c,_0x96a3e4);_0x5bd604(_0x96a3e4);});});}exports[_0xfd03('0x16')]=function(_0xbac344){var _0x742434=this;return new Promise(function(_0x5f04fa,_0x18b3d6){return db[_0xfd03('0x17')][_0xfd03('0x18')]({'raw':_0xbac344['options']?_0xbac344['options'][_0xfd03('0x19')]===undefined?!![]:![]:!![],'where':_0xbac344[_0xfd03('0x1a')]?_0xbac344[_0xfd03('0x1a')][_0xfd03('0x1b')]||null:null,'attributes':_0xbac344[_0xfd03('0x1a')]?_0xbac344[_0xfd03('0x1a')][_0xfd03('0x1c')]||null:null,'include':_0xbac344['options']?_0xbac344[_0xfd03('0x1a')][_0xfd03('0x1d')]?_['map'](_0xbac344['options'][_0xfd03('0x1d')],function(_0x2f6830){return{'model':db[_0x2f6830[_0xfd03('0x1e')]],'as':_0x2f6830['as'],'attributes':_0x2f6830[_0xfd03('0x1c')],'include':_0x2f6830[_0xfd03('0x1d')]?_[_0xfd03('0x1f')](_0x2f6830[_0xfd03('0x1d')],function(_0x1be9ac){return{'model':db[_0x1be9ac[_0xfd03('0x1e')]],'as':_0x1be9ac['as'],'attributes':_0x1be9ac['attributes'],'include':_0x1be9ac[_0xfd03('0x1d')]?_[_0xfd03('0x1f')](_0x1be9ac['include'],function(_0x4fff77){return{'model':db[_0x4fff77[_0xfd03('0x1e')]],'as':_0x4fff77['as'],'attributes':_0x4fff77[_0xfd03('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x774f71){logger['info']('ShowSound',_0xbac344);logger[_0xfd03('0x10')](_0xfd03('0x16'),_0xbac344,JSON[_0xfd03('0x12')](_0x774f71));_0x5f04fa(_0x774f71);})['catch'](function(_0x5346d2){logger[_0xfd03('0x13')](_0xfd03('0x16'),_0x5346d2[_0xfd03('0x14')],_0xbac344);_0x18b3d6(_0x742434[_0xfd03('0x13')](0x1f4,_0x5346d2[_0xfd03('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 2ae56f9..40641e4 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 _0x7bcd=['../../config/environment','./squareMessage.controller','get','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x4cfd4a,_0x340a41){var _0x42a03c=function(_0x3f3833){while(--_0x3f3833){_0x4cfd4a['push'](_0x4cfd4a['shift']());}};_0x42a03c(++_0x340a41);}(_0x7bcd,0x162));var _0xd7bc=function(_0x1030ce,_0xbe3f74){_0x1030ce=_0x1030ce-0x0;var _0x3367fd=_0x7bcd[_0x1030ce];return _0x3367fd;};'use strict';var multer=require('multer');var util=require(_0xd7bc('0x0'));var path=require(_0xd7bc('0x1'));var timeout=require(_0xd7bc('0x2'));var express=require('express');var router=express[_0xd7bc('0x3')]();var auth=require(_0xd7bc('0x4'));var interaction=require(_0xd7bc('0x5'));var config=require(_0xd7bc('0x6'));var controller=require(_0xd7bc('0x7'));router[_0xd7bc('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd7bc('0x8')](_0xd7bc('0x9'),auth[_0xd7bc('0xa')](),controller[_0xd7bc('0xb')]);router[_0xd7bc('0xc')]('/',auth[_0xd7bc('0xa')](),controller[_0xd7bc('0xd')]);router[_0xd7bc('0xe')](_0xd7bc('0x9'),auth['isAuthenticated'](),controller[_0xd7bc('0xf')]);router['delete'](_0xd7bc('0x9'),auth[_0xd7bc('0xa')](),controller[_0xd7bc('0x10')]);module[_0xd7bc('0x11')]=router; \ No newline at end of file +var _0x34a3=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5a09d0,_0x1d7b6f){var _0x1c49a4=function(_0x5c9b39){while(--_0x5c9b39){_0x5a09d0['push'](_0x5a09d0['shift']());}};_0x1c49a4(++_0x1d7b6f);}(_0x34a3,0xe2));var _0x334a=function(_0x2d2949,_0x397ca6){_0x2d2949=_0x2d2949-0x0;var _0x2eab93=_0x34a3[_0x2d2949];return _0x2eab93;};'use strict';var multer=require(_0x334a('0x0'));var util=require(_0x334a('0x1'));var path=require(_0x334a('0x2'));var timeout=require('connect-timeout');var express=require(_0x334a('0x3'));var router=express[_0x334a('0x4')]();var auth=require(_0x334a('0x5'));var interaction=require(_0x334a('0x6'));var config=require(_0x334a('0x7'));var controller=require(_0x334a('0x8'));router[_0x334a('0x9')]('/',auth[_0x334a('0xa')](),controller[_0x334a('0xb')]);router[_0x334a('0x9')](_0x334a('0xc'),auth[_0x334a('0xa')](),controller[_0x334a('0xd')]);router['post']('/',auth[_0x334a('0xa')](),controller[_0x334a('0xe')]);router[_0x334a('0xf')](_0x334a('0xc'),auth[_0x334a('0xa')](),controller[_0x334a('0x10')]);router[_0x334a('0x11')]('/:id',auth[_0x334a('0xa')](),controller[_0x334a('0x12')]);module[_0x334a('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index db62e54..2fa8503 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 _0x5bf5=['medium','out','sequelize','exports','STRING','TEXT'];(function(_0x29e932,_0x511caa){var _0x55c403=function(_0x4c0221){while(--_0x4c0221){_0x29e932['push'](_0x29e932['shift']());}};_0x55c403(++_0x511caa);}(_0x5bf5,0x1ca));var _0x55bf=function(_0x1a1684,_0x182cba){_0x1a1684=_0x1a1684-0x0;var _0x32e760=_0x5bf5[_0x1a1684];return _0x32e760;};'use strict';var Sequelize=require(_0x55bf('0x0'));module[_0x55bf('0x1')]={'uniqueid':{'type':Sequelize[_0x55bf('0x2')]},'body':{'type':Sequelize[_0x55bf('0x3')](_0x55bf('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x55bf('0x5')),'defaultValue':_0x55bf('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x22c2=['STRING','TEXT','medium','out','sequelize','exports'];(function(_0x1fe9d0,_0x2c27f2){var _0x396ff4=function(_0x26c0dd){while(--_0x26c0dd){_0x1fe9d0['push'](_0x1fe9d0['shift']());}};_0x396ff4(++_0x2c27f2);}(_0x22c2,0x82));var _0x222c=function(_0x2adac1,_0x34450d){_0x2adac1=_0x2adac1-0x0;var _0x4fbe2e=_0x22c2[_0x2adac1];return _0x4fbe2e;};'use strict';var Sequelize=require(_0x222c('0x0'));module[_0x222c('0x1')]={'uniqueid':{'type':Sequelize[_0x222c('0x2')]},'body':{'type':Sequelize[_0x222c('0x3')](_0x222c('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x222c('0x5')),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 8817d0d..f1764b4 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 _0xf54a=['findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','json','reject','save','update','then','destroy','error','stack','name','send','index','SquareMessage','type','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x3b2b88,_0x1ffbde){var _0x1eed8c=function(_0x41a663){while(--_0x41a663){_0x3b2b88['push'](_0x3b2b88['shift']());}};_0x1eed8c(++_0x1ffbde);}(_0xf54a,0xe4));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaf54('0x0'));var rimraf=require(_0xaf54('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf54('0x2'));var rp=require(_0xaf54('0x3'));var moment=require(_0xaf54('0x4'));var BPromise=require(_0xaf54('0x5'));var Mustache=require(_0xaf54('0x6'));var util=require(_0xaf54('0x7'));var path=require(_0xaf54('0x8'));var sox=require(_0xaf54('0x9'));var csv=require(_0xaf54('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaf54('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xaf54('0xc'));var toCsv=require(_0xaf54('0xa'));var querystring=require('querystring');var Papa=require(_0xaf54('0xd'));var Redis=require(_0xaf54('0xe'));var authService=require(_0xaf54('0xf'));var qs=require(_0xaf54('0x10'));var as=require(_0xaf54('0x11'));var hardwareService=require(_0xaf54('0x12'));var logger=require(_0xaf54('0x13'))(_0xaf54('0x14'));var utils=require(_0xaf54('0x15'));var config=require(_0xaf54('0x16'));var db=require(_0xaf54('0x17'))['db'];function respondWithStatusCode(_0x5b8c17,_0x5bbba9){_0x5bbba9=_0x5bbba9||0xcc;return function(_0x370813){if(_0x370813){return _0x5b8c17[_0xaf54('0x18')](_0x5bbba9);}return _0x5b8c17[_0xaf54('0x19')](_0x5bbba9)[_0xaf54('0x1a')]();};}function respondWithResult(_0x5834a6,_0x32dfbd){_0x32dfbd=_0x32dfbd||0xc8;return function(_0xf54d7e){if(_0xf54d7e){return _0x5834a6['status'](_0x32dfbd)['json'](_0xf54d7e);}};}function respondWithFilteredResult(_0x4e14d2,_0x196134){return function(_0x40b2b3){if(_0x40b2b3){var _0x575729=_0x40b2b3[_0xaf54('0x1b')],_0x549fc7=_0x196134['offset'],_0x3bf898=_0x196134['offset']+_0x196134[_0xaf54('0x1c')],_0x229524;if(_0x3bf898>=_0x575729){_0x3bf898=_0x575729;_0x229524=0xc8;}else{_0x229524=0xce;}_0x4e14d2['status'](_0x229524);return _0x4e14d2[_0xaf54('0x1d')]('Content-Range',_0x549fc7+'-'+_0x3bf898+'/'+_0x575729)[_0xaf54('0x1e')](_0x40b2b3);}return null;};}function patchUpdates(_0x5a33f3){return function(_0x153dd8){try{jsonpatch['apply'](_0x153dd8,_0x5a33f3,!![]);}catch(_0x19bf05){return BPromise[_0xaf54('0x1f')](_0x19bf05);}return _0x153dd8[_0xaf54('0x20')]();};}function saveUpdates(_0x30e87f,_0x173e95){return function(_0x3edb06){if(_0x3edb06){return _0x3edb06[_0xaf54('0x21')](_0x30e87f)[_0xaf54('0x22')](function(_0x49d74e){return _0x49d74e;});}return null;};}function removeEntity(_0x20fa97,_0x5ca183){return function(_0x260c56){if(_0x260c56){return _0x260c56[_0xaf54('0x23')]()['then'](function(){_0x20fa97[_0xaf54('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35bc9c,_0x6dbff){return function(_0x505259){if(!_0x505259){_0x35bc9c[_0xaf54('0x18')](0x194);}return _0x505259;};}function handleError(_0x257f12,_0x34b06e){_0x34b06e=_0x34b06e||0x1f4;return function(_0x4f8801){logger[_0xaf54('0x24')](_0x4f8801[_0xaf54('0x25')]);if(_0x4f8801['name']){delete _0x4f8801[_0xaf54('0x26')];}_0x257f12['status'](_0x34b06e)[_0xaf54('0x27')](_0x4f8801);};}exports[_0xaf54('0x28')]=function(_0x5603e0,_0x54a7b5){var _0x13bdb5={},_0x3125f3={},_0x5a6823={'count':0x0,'rows':[]};var _0x2edb08=_['map'](db[_0xaf54('0x29')]['rawAttributes'],function(_0x34d9c1){return{'name':_0x34d9c1['fieldName'],'type':_0x34d9c1[_0xaf54('0x2a')]['key']};});_0x3125f3[_0xaf54('0x2b')]=_[_0xaf54('0x2c')](_0x2edb08,_0xaf54('0x26'));_0x3125f3[_0xaf54('0x2d')]=_[_0xaf54('0x2e')](_0x5603e0[_0xaf54('0x2d')]);_0x3125f3[_0xaf54('0x2f')]=_['intersection'](_0x3125f3['model'],_0x3125f3[_0xaf54('0x2d')]);_0x13bdb5[_0xaf54('0x30')]=_[_0xaf54('0x31')](_0x3125f3['model'],qs['fields'](_0x5603e0[_0xaf54('0x2d')][_0xaf54('0x32')]));_0x13bdb5['attributes']=_0x13bdb5[_0xaf54('0x30')][_0xaf54('0x33')]?_0x13bdb5[_0xaf54('0x30')]:_0x3125f3[_0xaf54('0x2b')];if(!_0x5603e0[_0xaf54('0x2d')]['hasOwnProperty'](_0xaf54('0x34'))){_0x13bdb5[_0xaf54('0x1c')]=qs[_0xaf54('0x1c')](_0x5603e0['query'][_0xaf54('0x1c')]);_0x13bdb5[_0xaf54('0x35')]=qs[_0xaf54('0x35')](_0x5603e0[_0xaf54('0x2d')][_0xaf54('0x35')]);}_0x13bdb5[_0xaf54('0x36')]=qs[_0xaf54('0x37')](_0x5603e0[_0xaf54('0x2d')]['sort']);_0x13bdb5[_0xaf54('0x38')]=qs[_0xaf54('0x2f')](_[_0xaf54('0x39')](_0x5603e0[_0xaf54('0x2d')],_0x3125f3['filters']),_0x2edb08);if(_0x5603e0[_0xaf54('0x2d')][_0xaf54('0x3a')]){_0x13bdb5[_0xaf54('0x38')]=_[_0xaf54('0x3b')](_0x13bdb5[_0xaf54('0x38')],{'$or':_['map'](_0x2edb08,function(_0x5de1d7){if(_0x5de1d7[_0xaf54('0x2a')]!==_0xaf54('0x3c')){var _0x4b52ae={};_0x4b52ae[_0x5de1d7[_0xaf54('0x26')]]={'$like':'%'+_0x5603e0[_0xaf54('0x2d')][_0xaf54('0x3a')]+'%'};return _0x4b52ae;}})});}_0x13bdb5=_[_0xaf54('0x3b')]({},_0x13bdb5,_0x5603e0[_0xaf54('0x3d')]);var _0x17d7cb={'where':_0x13bdb5[_0xaf54('0x38')]};return db[_0xaf54('0x29')]['count'](_0x17d7cb)[_0xaf54('0x22')](function(_0x36e6a6){_0x5a6823[_0xaf54('0x1b')]=_0x36e6a6;if(_0x5603e0[_0xaf54('0x2d')][_0xaf54('0x3e')]){_0x13bdb5[_0xaf54('0x3f')]=[{'all':!![]}];}return db[_0xaf54('0x29')][_0xaf54('0x40')](_0x13bdb5);})[_0xaf54('0x22')](function(_0x365d10){_0x5a6823[_0xaf54('0x41')]=_0x365d10;return _0x5a6823;})[_0xaf54('0x22')](respondWithFilteredResult(_0x54a7b5,_0x13bdb5))[_0xaf54('0x42')](handleError(_0x54a7b5,null));};exports[_0xaf54('0x43')]=function(_0x296451,_0x3a72aa){var _0x46e94a={'raw':!![],'where':{'id':_0x296451[_0xaf54('0x44')]['id']}},_0x9d4c90={};_0x9d4c90[_0xaf54('0x2b')]=_[_0xaf54('0x2e')](db[_0xaf54('0x29')][_0xaf54('0x45')]);_0x9d4c90[_0xaf54('0x2d')]=_[_0xaf54('0x2e')](_0x296451[_0xaf54('0x2d')]);_0x9d4c90[_0xaf54('0x2f')]=_[_0xaf54('0x31')](_0x9d4c90['model'],_0x9d4c90[_0xaf54('0x2d')]);_0x46e94a[_0xaf54('0x30')]=_[_0xaf54('0x31')](_0x9d4c90['model'],qs[_0xaf54('0x32')](_0x296451[_0xaf54('0x2d')][_0xaf54('0x32')]));_0x46e94a[_0xaf54('0x30')]=_0x46e94a[_0xaf54('0x30')][_0xaf54('0x33')]?_0x46e94a[_0xaf54('0x30')]:_0x9d4c90[_0xaf54('0x2b')];if(_0x296451[_0xaf54('0x2d')][_0xaf54('0x3e')]){_0x46e94a['include']=[{'all':!![]}];}_0x46e94a=_[_0xaf54('0x3b')]({},_0x46e94a,_0x296451[_0xaf54('0x3d')]);return db[_0xaf54('0x29')][_0xaf54('0x46')](_0x46e94a)[_0xaf54('0x22')](handleEntityNotFound(_0x3a72aa,null))[_0xaf54('0x22')](respondWithResult(_0x3a72aa,null))['catch'](handleError(_0x3a72aa,null));};exports[_0xaf54('0x47')]=function(_0x50bc5d,_0x206f34){return db[_0xaf54('0x29')]['create'](_0x50bc5d[_0xaf54('0x48')],{})[_0xaf54('0x22')](respondWithResult(_0x206f34,0xc9))[_0xaf54('0x42')](handleError(_0x206f34,null));};exports['update']=function(_0x2102a6,_0x32c6fe){if(_0x2102a6['body']['id']){delete _0x2102a6['body']['id'];}return db[_0xaf54('0x29')][_0xaf54('0x46')]({'where':{'id':_0x2102a6[_0xaf54('0x44')]['id']}})[_0xaf54('0x22')](handleEntityNotFound(_0x32c6fe,null))['then'](saveUpdates(_0x2102a6['body'],null))['then'](respondWithResult(_0x32c6fe,null))[_0xaf54('0x42')](handleError(_0x32c6fe,null));};exports[_0xaf54('0x23')]=function(_0x3a8973,_0x2a0ddb){return db[_0xaf54('0x29')][_0xaf54('0x46')]({'where':{'id':_0x3a8973['params']['id']}})[_0xaf54('0x22')](handleEntityNotFound(_0x2a0ddb,null))[_0xaf54('0x22')](removeEntity(_0x2a0ddb,null))[_0xaf54('0x42')](handleError(_0x2a0ddb,null));}; \ No newline at end of file +var _0x3efe=['sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','stack','name','send','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','order','pick','filter','where','merge','map','type','VIRTUAL','includeAll','include','SquareMessage','findAll','catch','show','find','create','body','params','html-pdf','fast-json-patch','moment','bluebird','util','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','../../config/utils','../../config/environment'];(function(_0x29c82a,_0x2596af){var _0x458eea=function(_0x1a2a3e){while(--_0x1a2a3e){_0x29c82a['push'](_0x29c82a['shift']());}};_0x458eea(++_0x2596af);}(_0x3efe,0xf9));var _0xe3ef=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3efe[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require(_0xe3ef('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe3ef('0x1'));var rp=require('request-promise');var moment=require(_0xe3ef('0x2'));var BPromise=require(_0xe3ef('0x3'));var Mustache=require('mustache');var util=require(_0xe3ef('0x4'));var path=require(_0xe3ef('0x5'));var sox=require(_0xe3ef('0x6'));var csv=require(_0xe3ef('0x7'));var ejs=require(_0xe3ef('0x8'));var fs=require('fs');var _=require(_0xe3ef('0x9'));var squel=require(_0xe3ef('0xa'));var crypto=require(_0xe3ef('0xb'));var jsforce=require(_0xe3ef('0xc'));var deskjs=require(_0xe3ef('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe3ef('0xe'));var Papa=require(_0xe3ef('0xf'));var Redis=require('ioredis');var authService=require(_0xe3ef('0x10'));var qs=require(_0xe3ef('0x11'));var as=require(_0xe3ef('0x12'));var hardwareService=require(_0xe3ef('0x13'));var logger=require(_0xe3ef('0x14'))('api');var utils=require(_0xe3ef('0x15'));var config=require(_0xe3ef('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40ca2c,_0x296abc){_0x296abc=_0x296abc||0xcc;return function(_0x2418da){if(_0x2418da){return _0x40ca2c[_0xe3ef('0x17')](_0x296abc);}return _0x40ca2c[_0xe3ef('0x18')](_0x296abc)[_0xe3ef('0x19')]();};}function respondWithResult(_0x32a340,_0x2e44ea){_0x2e44ea=_0x2e44ea||0xc8;return function(_0x5cb3e4){if(_0x5cb3e4){return _0x32a340[_0xe3ef('0x18')](_0x2e44ea)[_0xe3ef('0x1a')](_0x5cb3e4);}};}function respondWithFilteredResult(_0x49cb76,_0x4a5ded){return function(_0x5565c2){if(_0x5565c2){var _0x575293=_0x5565c2[_0xe3ef('0x1b')],_0x29a4c5=_0x4a5ded[_0xe3ef('0x1c')],_0x51c56c=_0x4a5ded['offset']+_0x4a5ded[_0xe3ef('0x1d')],_0xeab15f;if(_0x51c56c>=_0x575293){_0x51c56c=_0x575293;_0xeab15f=0xc8;}else{_0xeab15f=0xce;}_0x49cb76[_0xe3ef('0x18')](_0xeab15f);return _0x49cb76['set'](_0xe3ef('0x1e'),_0x29a4c5+'-'+_0x51c56c+'/'+_0x575293)[_0xe3ef('0x1a')](_0x5565c2);}return null;};}function patchUpdates(_0x4ce83c){return function(_0x548e9d){try{jsonpatch[_0xe3ef('0x1f')](_0x548e9d,_0x4ce83c,!![]);}catch(_0x4d573e){return BPromise[_0xe3ef('0x20')](_0x4d573e);}return _0x548e9d['save']();};}function saveUpdates(_0x3829e7,_0xd2636d){return function(_0xd02177){if(_0xd02177){return _0xd02177[_0xe3ef('0x21')](_0x3829e7)['then'](function(_0x236649){return _0x236649;});}return null;};}function removeEntity(_0x1751cd,_0xcc736f){return function(_0x1778a9){if(_0x1778a9){return _0x1778a9[_0xe3ef('0x22')]()[_0xe3ef('0x23')](function(){_0x1751cd[_0xe3ef('0x18')](0xcc)[_0xe3ef('0x19')]();});}};}function handleEntityNotFound(_0x16d2e8,_0x220d03){return function(_0x80939){if(!_0x80939){_0x16d2e8[_0xe3ef('0x17')](0x194);}return _0x80939;};}function handleError(_0xc07c94,_0x4b47d4){_0x4b47d4=_0x4b47d4||0x1f4;return function(_0x58c575){logger['error'](_0x58c575[_0xe3ef('0x24')]);if(_0x58c575[_0xe3ef('0x25')]){delete _0x58c575[_0xe3ef('0x25')];}_0xc07c94[_0xe3ef('0x18')](_0x4b47d4)[_0xe3ef('0x26')](_0x58c575);};}exports[_0xe3ef('0x27')]=function(_0x2c0bc3,_0x4a17c6){var _0x1c904e={},_0x176222={},_0x2ec9bb={'count':0x0,'rows':[]};var _0x193dc8=_['map'](db['SquareMessage'][_0xe3ef('0x28')],function(_0x2fbed6){return{'name':_0x2fbed6['fieldName'],'type':_0x2fbed6['type'][_0xe3ef('0x29')]};});_0x176222[_0xe3ef('0x2a')]=_['map'](_0x193dc8,_0xe3ef('0x25'));_0x176222[_0xe3ef('0x2b')]=_[_0xe3ef('0x2c')](_0x2c0bc3[_0xe3ef('0x2b')]);_0x176222[_0xe3ef('0x2d')]=_[_0xe3ef('0x2e')](_0x176222[_0xe3ef('0x2a')],_0x176222['query']);_0x1c904e[_0xe3ef('0x2f')]=_[_0xe3ef('0x2e')](_0x176222[_0xe3ef('0x2a')],qs[_0xe3ef('0x30')](_0x2c0bc3[_0xe3ef('0x2b')][_0xe3ef('0x30')]));_0x1c904e[_0xe3ef('0x2f')]=_0x1c904e[_0xe3ef('0x2f')][_0xe3ef('0x31')]?_0x1c904e[_0xe3ef('0x2f')]:_0x176222['model'];if(!_0x2c0bc3[_0xe3ef('0x2b')]['hasOwnProperty']('nolimit')){_0x1c904e[_0xe3ef('0x1d')]=qs[_0xe3ef('0x1d')](_0x2c0bc3[_0xe3ef('0x2b')]['limit']);_0x1c904e[_0xe3ef('0x1c')]=qs[_0xe3ef('0x1c')](_0x2c0bc3[_0xe3ef('0x2b')]['offset']);}_0x1c904e[_0xe3ef('0x32')]=qs['sort'](_0x2c0bc3['query']['sort']);_0x1c904e['where']=qs[_0xe3ef('0x2d')](_[_0xe3ef('0x33')](_0x2c0bc3[_0xe3ef('0x2b')],_0x176222['filters']),_0x193dc8);if(_0x2c0bc3[_0xe3ef('0x2b')][_0xe3ef('0x34')]){_0x1c904e[_0xe3ef('0x35')]=_[_0xe3ef('0x36')](_0x1c904e['where'],{'$or':_[_0xe3ef('0x37')](_0x193dc8,function(_0x136762){if(_0x136762[_0xe3ef('0x38')]!==_0xe3ef('0x39')){var _0x21c69a={};_0x21c69a[_0x136762[_0xe3ef('0x25')]]={'$like':'%'+_0x2c0bc3[_0xe3ef('0x2b')][_0xe3ef('0x34')]+'%'};return _0x21c69a;}})});}_0x1c904e=_[_0xe3ef('0x36')]({},_0x1c904e,_0x2c0bc3['options']);var _0x537560={'where':_0x1c904e[_0xe3ef('0x35')]};return db['SquareMessage'][_0xe3ef('0x1b')](_0x537560)[_0xe3ef('0x23')](function(_0x50a38f){_0x2ec9bb['count']=_0x50a38f;if(_0x2c0bc3[_0xe3ef('0x2b')][_0xe3ef('0x3a')]){_0x1c904e[_0xe3ef('0x3b')]=[{'all':!![]}];}return db[_0xe3ef('0x3c')][_0xe3ef('0x3d')](_0x1c904e);})[_0xe3ef('0x23')](function(_0x255c41){_0x2ec9bb['rows']=_0x255c41;return _0x2ec9bb;})[_0xe3ef('0x23')](respondWithFilteredResult(_0x4a17c6,_0x1c904e))[_0xe3ef('0x3e')](handleError(_0x4a17c6,null));};exports[_0xe3ef('0x3f')]=function(_0x2b0e30,_0x4769d5){var _0x2c1156={'raw':!![],'where':{'id':_0x2b0e30['params']['id']}},_0x2e3e83={};_0x2e3e83[_0xe3ef('0x2a')]=_[_0xe3ef('0x2c')](db[_0xe3ef('0x3c')][_0xe3ef('0x28')]);_0x2e3e83[_0xe3ef('0x2b')]=_[_0xe3ef('0x2c')](_0x2b0e30[_0xe3ef('0x2b')]);_0x2e3e83[_0xe3ef('0x2d')]=_['intersection'](_0x2e3e83[_0xe3ef('0x2a')],_0x2e3e83[_0xe3ef('0x2b')]);_0x2c1156[_0xe3ef('0x2f')]=_[_0xe3ef('0x2e')](_0x2e3e83[_0xe3ef('0x2a')],qs['fields'](_0x2b0e30[_0xe3ef('0x2b')][_0xe3ef('0x30')]));_0x2c1156[_0xe3ef('0x2f')]=_0x2c1156['attributes']['length']?_0x2c1156[_0xe3ef('0x2f')]:_0x2e3e83[_0xe3ef('0x2a')];if(_0x2b0e30[_0xe3ef('0x2b')][_0xe3ef('0x3a')]){_0x2c1156['include']=[{'all':!![]}];}_0x2c1156=_[_0xe3ef('0x36')]({},_0x2c1156,_0x2b0e30['options']);return db[_0xe3ef('0x3c')][_0xe3ef('0x40')](_0x2c1156)[_0xe3ef('0x23')](handleEntityNotFound(_0x4769d5,null))[_0xe3ef('0x23')](respondWithResult(_0x4769d5,null))[_0xe3ef('0x3e')](handleError(_0x4769d5,null));};exports[_0xe3ef('0x41')]=function(_0x3ef0f5,_0x4bd2f1){return db[_0xe3ef('0x3c')][_0xe3ef('0x41')](_0x3ef0f5['body'],{})[_0xe3ef('0x23')](respondWithResult(_0x4bd2f1,0xc9))[_0xe3ef('0x3e')](handleError(_0x4bd2f1,null));};exports[_0xe3ef('0x21')]=function(_0x1cdedf,_0xa695e){if(_0x1cdedf['body']['id']){delete _0x1cdedf[_0xe3ef('0x42')]['id'];}return db[_0xe3ef('0x3c')]['find']({'where':{'id':_0x1cdedf[_0xe3ef('0x43')]['id']}})[_0xe3ef('0x23')](handleEntityNotFound(_0xa695e,null))['then'](saveUpdates(_0x1cdedf[_0xe3ef('0x42')],null))['then'](respondWithResult(_0xa695e,null))[_0xe3ef('0x3e')](handleError(_0xa695e,null));};exports[_0xe3ef('0x22')]=function(_0x572e88,_0x3a7eb6){return db['SquareMessage']['find']({'where':{'id':_0x572e88['params']['id']}})[_0xe3ef('0x23')](handleEntityNotFound(_0x3a7eb6,null))['then'](removeEntity(_0x3a7eb6,null))[_0xe3ef('0x3e')](handleError(_0x3a7eb6,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 57226a1..330dce8 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 _0x187d=['define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes'];(function(_0x329852,_0x5e65f2){var _0x1859e3=function(_0x40d656){while(--_0x40d656){_0x329852['push'](_0x329852['shift']());}};_0x1859e3(++_0x5e65f2);}(_0x187d,0x93));var _0xd187=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x187d[_0x33032e];return _0x13316b;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 570be5c..0c7cb0d 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 _0x7b84=['options','raw','CreateSquareMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x40eda3,_0x4ebdd3){var _0x51fa0a=function(_0x36ac0d){while(--_0x36ac0d){_0x40eda3['push'](_0x40eda3['shift']());}};_0x51fa0a(++_0x4ebdd3);}(_0x7b84,0x17c));var _0x47b8=function(_0x5e63e9,_0x20f55b){_0x5e63e9=_0x5e63e9-0x0;var _0x66348e=_0x7b84[_0x5e63e9];return _0x66348e;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('SquareMessage,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});}exports['CreateSquareMessage']=function(_0x4f7317){var _0x299195=this;return new Promise(function(_0x36faf1,_0x2797ac){return db['SquareMessage']['create'](_0x4f7317['body'],{'raw':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317['options'][_0x47b8('0x1b')]===undefined?!![]:![]:!![]})[_0x47b8('0xe')](function(_0x303f19){logger[_0x47b8('0xf')]('CreateSquareMessage',_0x4f7317);logger[_0x47b8('0x12')](_0x47b8('0x1c'),_0x4f7317,JSON[_0x47b8('0x14')](_0x303f19));_0x36faf1(_0x303f19);})[_0x47b8('0x19')](function(_0x168cde){logger[_0x47b8('0x15')]('CreateSquareMessage',_0x168cde[_0x47b8('0x17')],_0x4f7317);_0x2797ac(_0x299195[_0x47b8('0x15')](0x1f4,_0x168cde['message']));});});}; \ No newline at end of file +var _0x3e0c=['SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','info'];(function(_0xaeca6b,_0x107e6a){var _0xb14136=function(_0x13c1d8){while(--_0x13c1d8){_0xaeca6b['push'](_0xaeca6b['shift']());}};_0xb14136(++_0x107e6a);}(_0x3e0c,0x16d));var _0xc3e0=function(_0x19c452,_0x4dbaab){_0x19c452=_0x19c452-0x0;var _0x99698c=_0x3e0c[_0x19c452];return _0x99698c;};'use strict';var _=require(_0xc3e0('0x0'));var util=require(_0xc3e0('0x1'));var moment=require(_0xc3e0('0x2'));var BPromise=require('bluebird');var rs=require(_0xc3e0('0x3'));var fs=require('fs');var Redis=require(_0xc3e0('0x4'));var db=require(_0xc3e0('0x5'))['db'];var utils=require(_0xc3e0('0x6'));var logger=require(_0xc3e0('0x7'))('rpc');var config=require(_0xc3e0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x553e6d,_0x6db846,_0x32976c){return new BPromise(function(_0x1cfcf5,_0x4ad1bd){return client['request'](_0x553e6d,_0x32976c)['then'](function(_0x5a2630){logger[_0xc3e0('0x9')](_0xc3e0('0xa'),_0x6db846,_0xc3e0('0xb'));logger[_0xc3e0('0xc')](_0xc3e0('0xd'),_0x6db846,_0xc3e0('0xb'),JSON[_0xc3e0('0xe')](_0x5a2630));if(_0x5a2630['error']){if(_0x5a2630[_0xc3e0('0xf')]['code']===0x1f4){logger[_0xc3e0('0xf')](_0xc3e0('0xa'),_0x6db846,_0x5a2630['error'][_0xc3e0('0x10')]);return _0x4ad1bd(_0x5a2630['error'][_0xc3e0('0x10')]);}logger[_0xc3e0('0xf')](_0xc3e0('0xa'),_0x6db846,_0x5a2630[_0xc3e0('0xf')][_0xc3e0('0x10')]);return _0x1cfcf5(_0x5a2630[_0xc3e0('0xf')][_0xc3e0('0x10')]);}else{logger['info'](_0xc3e0('0xa'),_0x6db846,_0xc3e0('0xb'));_0x1cfcf5(_0x5a2630['result'][_0xc3e0('0x10')]);}})[_0xc3e0('0x11')](function(_0x25891a){logger[_0xc3e0('0xf')](_0xc3e0('0xa'),_0x6db846,_0x25891a);_0x4ad1bd(_0x25891a);});});}exports[_0xc3e0('0x12')]=function(_0x2e98d5){var _0xb64df8=this;return new Promise(function(_0x3207c6,_0x36445c){return db[_0xc3e0('0x13')][_0xc3e0('0x14')](_0x2e98d5[_0xc3e0('0x15')],{'raw':_0x2e98d5['options']?_0x2e98d5[_0xc3e0('0x16')][_0xc3e0('0x17')]===undefined?!![]:![]:!![]})[_0xc3e0('0x18')](function(_0x1c73d1){logger[_0xc3e0('0x9')]('CreateSquareMessage',_0x2e98d5);logger[_0xc3e0('0xc')]('CreateSquareMessage',_0x2e98d5,JSON[_0xc3e0('0xe')](_0x1c73d1));_0x3207c6(_0x1c73d1);})[_0xc3e0('0x11')](function(_0x1ff14b){logger['error']('CreateSquareMessage',_0x1ff14b[_0xc3e0('0x10')],_0x2e98d5);_0x36445c(_0xb64df8['error'](0x1f4,_0x1ff14b[_0xc3e0('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 63bb5fe..231d15f 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 _0x43ee=['../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','test','create','put','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x3038c1,_0x1ea3a7){var _0x305853=function(_0x1996d1){while(--_0x1996d1){_0x3038c1['push'](_0x3038c1['shift']());}};_0x305853(++_0x1ea3a7);}(_0x43ee,0x112));var _0xe43e=function(_0x2298f0,_0x3bbf4f){_0x2298f0=_0x2298f0-0x0;var _0x39b136=_0x43ee[_0x2298f0];return _0x39b136;};'use strict';var multer=require(_0xe43e('0x0'));var util=require(_0xe43e('0x1'));var path=require(_0xe43e('0x2'));var timeout=require(_0xe43e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xe43e('0x4'));var interaction=require(_0xe43e('0x5'));var config=require(_0xe43e('0x6'));var controller=require(_0xe43e('0x7'));router[_0xe43e('0x8')]('/',auth[_0xe43e('0x9')](),controller[_0xe43e('0xa')]);router[_0xe43e('0x8')](_0xe43e('0xb'),auth[_0xe43e('0x9')](),controller[_0xe43e('0xc')]);router['get'](_0xe43e('0xd'),auth[_0xe43e('0x9')](),timeout('15s'),controller[_0xe43e('0xe')]);router['post']('/',auth[_0xe43e('0x9')](),controller[_0xe43e('0xf')]);router[_0xe43e('0x10')](_0xe43e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xe43e('0x11')]('/:id',auth[_0xe43e('0x9')](),controller[_0xe43e('0x12')]);module[_0xe43e('0x13')]=router; \ No newline at end of file +var _0x692e=['post','update','delete','util','Router','../../components/interaction/service','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x692e,0x6c));var _0xe692=function(_0x58b403,_0x11d828){_0x58b403=_0x58b403-0x0;var _0x1a478f=_0x692e[_0x58b403];return _0x1a478f;};'use strict';var multer=require('multer');var util=require(_0xe692('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe692('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xe692('0x2'));var config=require('../../config/environment');var controller=require(_0xe692('0x3'));router[_0xe692('0x4')]('/',auth[_0xe692('0x5')](),controller[_0xe692('0x6')]);router[_0xe692('0x4')](_0xe692('0x7'),auth['isAuthenticated'](),controller[_0xe692('0x8')]);router[_0xe692('0x4')](_0xe692('0x9'),auth[_0xe692('0x5')](),timeout(_0xe692('0xa')),controller[_0xe692('0xb')]);router[_0xe692('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe692('0x7'),auth[_0xe692('0x5')](),controller[_0xe692('0xd')]);router[_0xe692('0xe')](_0xe692('0x7'),auth[_0xe692('0x5')](),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 0820805..ce96491 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 _0x6cdb=['exports','STRING','name','sequelize'];(function(_0xc2343c,_0x2c3d6b){var _0x549070=function(_0xa8be64){while(--_0xa8be64){_0xc2343c['push'](_0xc2343c['shift']());}};_0x549070(++_0x2c3d6b);}(_0x6cdb,0xbf));var _0xb6cd=function(_0x28a362,_0x42fb5a){_0x28a362=_0x28a362-0x0;var _0x3841c0=_0x6cdb[_0x28a362];return _0x3841c0;};'use strict';var Sequelize=require(_0xb6cd('0x0'));module[_0xb6cd('0x1')]={'name':{'type':Sequelize[_0xb6cd('0x2')],'unique':_0xb6cd('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb6cd('0x2')]}}; \ No newline at end of file +var _0xef6c=['exports','STRING','name','sequelize'];(function(_0x499e00,_0x120bca){var _0x541899=function(_0x29387b){while(--_0x29387b){_0x499e00['push'](_0x499e00['shift']());}};_0x541899(++_0x120bca);}(_0xef6c,0x1cf));var _0xcef6=function(_0xd4636c,_0x34dbf6){_0xd4636c=_0xd4636c-0x0;var _0x5ee17d=_0xef6c[_0xd4636c];return _0x5ee17d;};'use strict';var Sequelize=require(_0xcef6('0x0'));module[_0xcef6('0x1')]={'name':{'type':Sequelize[_0xcef6('0x2')],'unique':_0xcef6('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xcef6('0x2')]},'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 d19e503..2e9ab9c 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 _0x87e0=['destroy','get','error','name','send','index','map','SquareOdbc','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','show','rawAttributes','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ODBC','userProfileId','params','dsn','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','save','update','then'];(function(_0x2b2848,_0x5076b9){var _0x417a93=function(_0x50998e){while(--_0x50998e){_0x2b2848['push'](_0x2b2848['shift']());}};_0x417a93(++_0x5076b9);}(_0x87e0,0xc6));var _0x087e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x87e0[_0x3b380d];return _0x54502b;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x087e('0x0'));var zipdir=require(_0x087e('0x1'));var jsonpatch=require(_0x087e('0x2'));var rp=require(_0x087e('0x3'));var moment=require(_0x087e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x087e('0x5'));var util=require(_0x087e('0x6'));var path=require('path');var sox=require(_0x087e('0x7'));var csv=require(_0x087e('0x8'));var ejs=require(_0x087e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x087e('0xa'));var crypto=require(_0x087e('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x087e('0x8'));var querystring=require(_0x087e('0xc'));var Papa=require(_0x087e('0xd'));var Redis=require(_0x087e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x087e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x087e('0x10'));var utils=require(_0x087e('0x11'));var config=require(_0x087e('0x12'));var db=require(_0x087e('0x13'))['db'];function respondWithStatusCode(_0x29e4d4,_0x49f7c0){_0x49f7c0=_0x49f7c0||0xcc;return function(_0x3a21f6){if(_0x3a21f6){return _0x29e4d4[_0x087e('0x14')](_0x49f7c0);}return _0x29e4d4['status'](_0x49f7c0)[_0x087e('0x15')]();};}function respondWithResult(_0x38b373,_0xea4ec8){_0xea4ec8=_0xea4ec8||0xc8;return function(_0x16df8b){if(_0x16df8b){return _0x38b373[_0x087e('0x16')](_0xea4ec8)['json'](_0x16df8b);}};}function respondWithFilteredResult(_0x2429f4,_0x3b9151){return function(_0x17a8e7){if(_0x17a8e7){var _0x3bd27f=_0x17a8e7[_0x087e('0x17')],_0x22e914=_0x3b9151['offset'],_0x44e959=_0x3b9151[_0x087e('0x18')]+_0x3b9151[_0x087e('0x19')],_0x2439e7;if(_0x44e959>=_0x3bd27f){_0x44e959=_0x3bd27f;_0x2439e7=0xc8;}else{_0x2439e7=0xce;}_0x2429f4[_0x087e('0x16')](_0x2439e7);return _0x2429f4[_0x087e('0x1a')](_0x087e('0x1b'),_0x22e914+'-'+_0x44e959+'/'+_0x3bd27f)[_0x087e('0x1c')](_0x17a8e7);}return null;};}function patchUpdates(_0x4cf7c8){return function(_0x356734){try{jsonpatch[_0x087e('0x1d')](_0x356734,_0x4cf7c8,!![]);}catch(_0x132aa1){return BPromise['reject'](_0x132aa1);}return _0x356734[_0x087e('0x1e')]();};}function saveUpdates(_0x2d151a,_0x5b1895){return function(_0x545308){if(_0x545308){return _0x545308[_0x087e('0x1f')](_0x2d151a)[_0x087e('0x20')](function(_0x159fad){return _0x159fad;});}return null;};}function removeEntity(_0x666350,_0x4f14ad){return function(_0x4599de){if(_0x4599de){return _0x4599de[_0x087e('0x21')]()['then'](function(){var _0x1be669=_0x4599de[_0x087e('0x22')]({'plain':!![]});var _0x22fdff='ODBC';return db['UserProfileResource']['destroy']({'where':{'type':_0x22fdff,'resourceId':_0x1be669['id']}})[_0x087e('0x20')](function(){return _0x4599de;});})[_0x087e('0x20')](function(){_0x666350[_0x087e('0x16')](0xcc)[_0x087e('0x15')]();});}};}function handleEntityNotFound(_0x4f6609,_0x234143){return function(_0x245639){if(!_0x245639){_0x4f6609['sendStatus'](0x194);}return _0x245639;};}function handleError(_0xe5c262,_0x33de42){_0x33de42=_0x33de42||0x1f4;return function(_0x41767e){logger[_0x087e('0x23')](_0x41767e['stack']);if(_0x41767e[_0x087e('0x24')]){delete _0x41767e[_0x087e('0x24')];}_0xe5c262[_0x087e('0x16')](_0x33de42)[_0x087e('0x25')](_0x41767e);};}exports[_0x087e('0x26')]=function(_0x18fd95,_0x3197e8){var _0x12db5a={},_0xd22de3={},_0x5eb367={'count':0x0,'rows':[]};var _0x3b7133=_[_0x087e('0x27')](db[_0x087e('0x28')]['rawAttributes'],function(_0x320a0f){return{'name':_0x320a0f[_0x087e('0x29')],'type':_0x320a0f['type']['key']};});_0xd22de3[_0x087e('0x2a')]=_['map'](_0x3b7133,_0x087e('0x24'));_0xd22de3[_0x087e('0x2b')]=_[_0x087e('0x2c')](_0x18fd95['query']);_0xd22de3[_0x087e('0x2d')]=_[_0x087e('0x2e')](_0xd22de3[_0x087e('0x2a')],_0xd22de3[_0x087e('0x2b')]);_0x12db5a['attributes']=_[_0x087e('0x2e')](_0xd22de3[_0x087e('0x2a')],qs[_0x087e('0x2f')](_0x18fd95[_0x087e('0x2b')][_0x087e('0x2f')]));_0x12db5a[_0x087e('0x30')]=_0x12db5a[_0x087e('0x30')][_0x087e('0x31')]?_0x12db5a['attributes']:_0xd22de3[_0x087e('0x2a')];if(!_0x18fd95[_0x087e('0x2b')][_0x087e('0x32')](_0x087e('0x33'))){_0x12db5a[_0x087e('0x19')]=qs[_0x087e('0x19')](_0x18fd95[_0x087e('0x2b')][_0x087e('0x19')]);_0x12db5a[_0x087e('0x18')]=qs[_0x087e('0x18')](_0x18fd95[_0x087e('0x2b')][_0x087e('0x18')]);}_0x12db5a[_0x087e('0x34')]=qs[_0x087e('0x35')](_0x18fd95[_0x087e('0x2b')]['sort']);_0x12db5a[_0x087e('0x36')]=qs[_0x087e('0x2d')](_[_0x087e('0x37')](_0x18fd95[_0x087e('0x2b')],_0xd22de3[_0x087e('0x2d')]),_0x3b7133);if(_0x18fd95[_0x087e('0x2b')]['filter']){_0x12db5a[_0x087e('0x36')]=_[_0x087e('0x38')](_0x12db5a[_0x087e('0x36')],{'$or':_[_0x087e('0x27')](_0x3b7133,function(_0x311067){if(_0x311067[_0x087e('0x39')]!==_0x087e('0x3a')){var _0x492ff9={};_0x492ff9[_0x311067[_0x087e('0x24')]]={'$like':'%'+_0x18fd95['query'][_0x087e('0x3b')]+'%'};return _0x492ff9;}})});}_0x12db5a=_[_0x087e('0x38')]({},_0x12db5a,_0x18fd95[_0x087e('0x3c')]);var _0x407a29={'where':_0x12db5a[_0x087e('0x36')]};return db[_0x087e('0x28')][_0x087e('0x17')](_0x407a29)[_0x087e('0x20')](function(_0x1bc8d9){_0x5eb367[_0x087e('0x17')]=_0x1bc8d9;if(_0x18fd95[_0x087e('0x2b')][_0x087e('0x3d')]){_0x12db5a[_0x087e('0x3e')]=[{'all':!![]}];}return db[_0x087e('0x28')]['findAll'](_0x12db5a);})['then'](function(_0x15cb27){_0x5eb367[_0x087e('0x3f')]=_0x15cb27;return _0x5eb367;})[_0x087e('0x20')](respondWithFilteredResult(_0x3197e8,_0x12db5a))['catch'](handleError(_0x3197e8,null));};exports[_0x087e('0x40')]=function(_0x43d79a,_0x1c74de){var _0x1afe80={'raw':!![],'where':{'id':_0x43d79a['params']['id']}},_0x21f2ea={};_0x21f2ea['model']=_[_0x087e('0x2c')](db[_0x087e('0x28')][_0x087e('0x41')]);_0x21f2ea[_0x087e('0x2b')]=_[_0x087e('0x2c')](_0x43d79a['query']);_0x21f2ea['filters']=_[_0x087e('0x2e')](_0x21f2ea[_0x087e('0x2a')],_0x21f2ea[_0x087e('0x2b')]);_0x1afe80['attributes']=_['intersection'](_0x21f2ea[_0x087e('0x2a')],qs[_0x087e('0x2f')](_0x43d79a[_0x087e('0x2b')][_0x087e('0x2f')]));_0x1afe80[_0x087e('0x30')]=_0x1afe80[_0x087e('0x30')]['length']?_0x1afe80[_0x087e('0x30')]:_0x21f2ea[_0x087e('0x2a')];if(_0x43d79a['query']['includeAll']){_0x1afe80[_0x087e('0x3e')]=[{'all':!![]}];}_0x1afe80=_[_0x087e('0x38')]({},_0x1afe80,_0x43d79a[_0x087e('0x3c')]);return db[_0x087e('0x28')][_0x087e('0x42')](_0x1afe80)[_0x087e('0x20')](handleEntityNotFound(_0x1c74de,null))['then'](respondWithResult(_0x1c74de,null))[_0x087e('0x43')](handleError(_0x1c74de,null));};exports[_0x087e('0x44')]=function(_0x1b9514,_0x277e6d){return db[_0x087e('0x28')][_0x087e('0x44')](_0x1b9514[_0x087e('0x45')],{})['then'](function(_0x3d9c58){var _0xc67310=_0x1b9514['user']['get']({'plain':!![]});if(!_0xc67310)throw new Error(_0x087e('0x46'));if(_0xc67310['role']===_0x087e('0x47')){var _0x27fe94=_0x3d9c58[_0x087e('0x22')]({'plain':!![]});var _0x1e02ce=_0x087e('0x48');return db['UserProfileSection'][_0x087e('0x42')]({'where':{'name':_0x1e02ce,'userProfileId':_0xc67310[_0x087e('0x49')]},'raw':!![]})['then'](function(_0x21777d){if(_0x21777d&&_0x21777d['autoAssociation']===0x0){return db['UserProfileResource'][_0x087e('0x44')]({'name':_0x27fe94['name'],'resourceId':_0x27fe94['id'],'type':_0x21777d[_0x087e('0x24')],'sectionId':_0x21777d['id']},{})[_0x087e('0x20')](function(){return _0x3d9c58;});}else{return _0x3d9c58;}})[_0x087e('0x43')](function(_0x47c954){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47c954);throw _0x47c954;});}return _0x3d9c58;})[_0x087e('0x20')](respondWithResult(_0x277e6d,0xc9))[_0x087e('0x43')](handleError(_0x277e6d,null));};exports[_0x087e('0x1f')]=function(_0x241ffa,_0x169e36){if(_0x241ffa['body']['id']){delete _0x241ffa[_0x087e('0x45')]['id'];}return db[_0x087e('0x28')][_0x087e('0x42')]({'where':{'id':_0x241ffa[_0x087e('0x4a')]['id']}})[_0x087e('0x20')](handleEntityNotFound(_0x169e36,null))['then'](saveUpdates(_0x241ffa[_0x087e('0x45')],null))[_0x087e('0x20')](respondWithResult(_0x169e36,null))[_0x087e('0x43')](handleError(_0x169e36,null));};exports['destroy']=function(_0x3fa447,_0xe33489){return db['SquareOdbc'][_0x087e('0x42')]({'where':{'id':_0x3fa447[_0x087e('0x4a')]['id']}})[_0x087e('0x20')](handleEntityNotFound(_0xe33489,null))[_0x087e('0x20')](removeEntity(_0xe33489,null))['catch'](handleError(_0xe33489,null));};exports['test']=function(_0x5d9f03,_0x2488ca,_0x2e1dfb){var _0x58e96a;return db[_0x087e('0x28')][_0x087e('0x42')]({'where':{'id':_0x5d9f03[_0x087e('0x4a')]['id']},'attributes':['id',_0x087e('0x4b')]})[_0x087e('0x20')](handleEntityNotFound(_0x2488ca,null))[_0x087e('0x20')](function(_0x32dc9f){if(_0x32dc9f){var _0x1041f5=require('odbc')();_0x1041f5['openSync'](_0x32dc9f['dsn']);_0x1041f5[_0x087e('0x4c')]();return _0x32dc9f;}})[_0x087e('0x20')](respondWithResult(_0x2488ca,null))[_0x087e('0x43')](handleError(_0x2488ca,null));}; \ No newline at end of file +var _0x8d24=['SquareOdbc','type','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','rawAttributes','includeAll','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','ODBC','UserProfileResource','error','name','send','index'];(function(_0x5deb6e,_0x3993ce){var _0x348ad5=function(_0x42292b){while(--_0x42292b){_0x5deb6e['push'](_0x5deb6e['shift']());}};_0x348ad5(++_0x3993ce);}(_0x8d24,0x1a7));var _0x48d2=function(_0x34c6a3,_0x3e1a91){_0x34c6a3=_0x34c6a3-0x0;var _0x58fcda=_0x8d24[_0x34c6a3];return _0x58fcda;};'use strict';var pdf=require(_0x48d2('0x0'));var emlformat=require(_0x48d2('0x1'));var rimraf=require(_0x48d2('0x2'));var zipdir=require(_0x48d2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x48d2('0x4'));var Mustache=require(_0x48d2('0x5'));var util=require(_0x48d2('0x6'));var path=require(_0x48d2('0x7'));var sox=require(_0x48d2('0x8'));var csv=require(_0x48d2('0x9'));var ejs=require(_0x48d2('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x48d2('0xb'));var deskjs=require(_0x48d2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x48d2('0xd'));var Papa=require(_0x48d2('0xe'));var Redis=require(_0x48d2('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48d2('0x10'));var logger=require('../../config/logger')(_0x48d2('0x11'));var utils=require('../../config/utils');var config=require(_0x48d2('0x12'));var db=require(_0x48d2('0x13'))['db'];function respondWithStatusCode(_0xf4589,_0x44c8b3){_0x44c8b3=_0x44c8b3||0xcc;return function(_0x141835){if(_0x141835){return _0xf4589[_0x48d2('0x14')](_0x44c8b3);}return _0xf4589[_0x48d2('0x15')](_0x44c8b3)[_0x48d2('0x16')]();};}function respondWithResult(_0x4c85dc,_0x5692ea){_0x5692ea=_0x5692ea||0xc8;return function(_0x2d9c5e){if(_0x2d9c5e){return _0x4c85dc[_0x48d2('0x15')](_0x5692ea)['json'](_0x2d9c5e);}};}function respondWithFilteredResult(_0x5ffa9e,_0x2fd477){return function(_0x146de2){if(_0x146de2){var _0x44b1da=_0x146de2[_0x48d2('0x17')],_0x55656f=_0x2fd477[_0x48d2('0x18')],_0x349d24=_0x2fd477['offset']+_0x2fd477[_0x48d2('0x19')],_0xb42f96;if(_0x349d24>=_0x44b1da){_0x349d24=_0x44b1da;_0xb42f96=0xc8;}else{_0xb42f96=0xce;}_0x5ffa9e[_0x48d2('0x15')](_0xb42f96);return _0x5ffa9e[_0x48d2('0x1a')](_0x48d2('0x1b'),_0x55656f+'-'+_0x349d24+'/'+_0x44b1da)['json'](_0x146de2);}return null;};}function patchUpdates(_0x3467aa){return function(_0x430bf4){try{jsonpatch[_0x48d2('0x1c')](_0x430bf4,_0x3467aa,!![]);}catch(_0x477680){return BPromise[_0x48d2('0x1d')](_0x477680);}return _0x430bf4['save']();};}function saveUpdates(_0x530a13,_0x499253){return function(_0x45233a){if(_0x45233a){return _0x45233a[_0x48d2('0x1e')](_0x530a13)[_0x48d2('0x1f')](function(_0xf5aa8b){return _0xf5aa8b;});}return null;};}function removeEntity(_0x168176,_0x450fed){return function(_0x4a7cf3){if(_0x4a7cf3){return _0x4a7cf3[_0x48d2('0x20')]()[_0x48d2('0x1f')](function(){var _0x357d9f=_0x4a7cf3['get']({'plain':!![]});var _0x496a51=_0x48d2('0x21');return db[_0x48d2('0x22')][_0x48d2('0x20')]({'where':{'type':_0x496a51,'resourceId':_0x357d9f['id']}})[_0x48d2('0x1f')](function(){return _0x4a7cf3;});})[_0x48d2('0x1f')](function(){_0x168176[_0x48d2('0x15')](0xcc)[_0x48d2('0x16')]();});}};}function handleEntityNotFound(_0x175b89,_0x2d538b){return function(_0x4dc0c3){if(!_0x4dc0c3){_0x175b89[_0x48d2('0x14')](0x194);}return _0x4dc0c3;};}function handleError(_0x3cbda1,_0x60c8b3){_0x60c8b3=_0x60c8b3||0x1f4;return function(_0x1f9938){logger[_0x48d2('0x23')](_0x1f9938['stack']);if(_0x1f9938[_0x48d2('0x24')]){delete _0x1f9938[_0x48d2('0x24')];}_0x3cbda1[_0x48d2('0x15')](_0x60c8b3)[_0x48d2('0x25')](_0x1f9938);};}exports[_0x48d2('0x26')]=function(_0x43e56a,_0x3185b1){var _0x5c55fd={},_0x409872={},_0x5e07a5={'count':0x0,'rows':[]};var _0x31dbce=_['map'](db[_0x48d2('0x27')]['rawAttributes'],function(_0x4beb55){return{'name':_0x4beb55['fieldName'],'type':_0x4beb55[_0x48d2('0x28')]['key']};});_0x409872[_0x48d2('0x29')]=_[_0x48d2('0x2a')](_0x31dbce,_0x48d2('0x24'));_0x409872[_0x48d2('0x2b')]=_['keys'](_0x43e56a[_0x48d2('0x2b')]);_0x409872[_0x48d2('0x2c')]=_[_0x48d2('0x2d')](_0x409872[_0x48d2('0x29')],_0x409872[_0x48d2('0x2b')]);_0x5c55fd[_0x48d2('0x2e')]=_[_0x48d2('0x2d')](_0x409872['model'],qs[_0x48d2('0x2f')](_0x43e56a['query']['fields']));_0x5c55fd[_0x48d2('0x2e')]=_0x5c55fd['attributes'][_0x48d2('0x30')]?_0x5c55fd['attributes']:_0x409872['model'];if(!_0x43e56a['query']['hasOwnProperty'](_0x48d2('0x31'))){_0x5c55fd[_0x48d2('0x19')]=qs[_0x48d2('0x19')](_0x43e56a[_0x48d2('0x2b')][_0x48d2('0x19')]);_0x5c55fd['offset']=qs[_0x48d2('0x18')](_0x43e56a[_0x48d2('0x2b')][_0x48d2('0x18')]);}_0x5c55fd[_0x48d2('0x32')]=qs[_0x48d2('0x33')](_0x43e56a[_0x48d2('0x2b')]['sort']);_0x5c55fd[_0x48d2('0x34')]=qs[_0x48d2('0x2c')](_[_0x48d2('0x35')](_0x43e56a[_0x48d2('0x2b')],_0x409872['filters']),_0x31dbce);if(_0x43e56a[_0x48d2('0x2b')][_0x48d2('0x36')]){_0x5c55fd[_0x48d2('0x34')]=_[_0x48d2('0x37')](_0x5c55fd[_0x48d2('0x34')],{'$or':_['map'](_0x31dbce,function(_0x51f339){if(_0x51f339[_0x48d2('0x28')]!==_0x48d2('0x38')){var _0x1c9c5d={};_0x1c9c5d[_0x51f339[_0x48d2('0x24')]]={'$like':'%'+_0x43e56a[_0x48d2('0x2b')][_0x48d2('0x36')]+'%'};return _0x1c9c5d;}})});}_0x5c55fd=_[_0x48d2('0x37')]({},_0x5c55fd,_0x43e56a[_0x48d2('0x39')]);var _0x49912f={'where':_0x5c55fd[_0x48d2('0x34')]};return db[_0x48d2('0x27')][_0x48d2('0x17')](_0x49912f)['then'](function(_0x5c44c7){_0x5e07a5[_0x48d2('0x17')]=_0x5c44c7;if(_0x43e56a[_0x48d2('0x2b')]['includeAll']){_0x5c55fd[_0x48d2('0x3a')]=[{'all':!![]}];}return db[_0x48d2('0x27')][_0x48d2('0x3b')](_0x5c55fd);})['then'](function(_0x3096f3){_0x5e07a5['rows']=_0x3096f3;return _0x5e07a5;})[_0x48d2('0x1f')](respondWithFilteredResult(_0x3185b1,_0x5c55fd))[_0x48d2('0x3c')](handleError(_0x3185b1,null));};exports[_0x48d2('0x3d')]=function(_0x419fbd,_0xb3d403){var _0x3f45ca={'raw':!![],'where':{'id':_0x419fbd[_0x48d2('0x3e')]['id']}},_0x27c085={};_0x27c085[_0x48d2('0x29')]=_[_0x48d2('0x3f')](db['SquareOdbc'][_0x48d2('0x40')]);_0x27c085['query']=_[_0x48d2('0x3f')](_0x419fbd[_0x48d2('0x2b')]);_0x27c085[_0x48d2('0x2c')]=_['intersection'](_0x27c085['model'],_0x27c085[_0x48d2('0x2b')]);_0x3f45ca[_0x48d2('0x2e')]=_[_0x48d2('0x2d')](_0x27c085[_0x48d2('0x29')],qs[_0x48d2('0x2f')](_0x419fbd[_0x48d2('0x2b')]['fields']));_0x3f45ca[_0x48d2('0x2e')]=_0x3f45ca[_0x48d2('0x2e')][_0x48d2('0x30')]?_0x3f45ca['attributes']:_0x27c085[_0x48d2('0x29')];if(_0x419fbd[_0x48d2('0x2b')][_0x48d2('0x41')]){_0x3f45ca[_0x48d2('0x3a')]=[{'all':!![]}];}_0x3f45ca=_[_0x48d2('0x37')]({},_0x3f45ca,_0x419fbd['options']);return db[_0x48d2('0x27')][_0x48d2('0x42')](_0x3f45ca)['then'](handleEntityNotFound(_0xb3d403,null))[_0x48d2('0x1f')](respondWithResult(_0xb3d403,null))['catch'](handleError(_0xb3d403,null));};exports['create']=function(_0x7b2ad7,_0x462560){return db[_0x48d2('0x27')]['create'](_0x7b2ad7[_0x48d2('0x43')],{})[_0x48d2('0x1f')](function(_0x22981b){var _0x3dfc41=_0x7b2ad7['user']['get']({'plain':!![]});if(!_0x3dfc41)throw new Error(_0x48d2('0x44'));if(_0x3dfc41['role']==='user'){var _0x11375c=_0x22981b[_0x48d2('0x45')]({'plain':!![]});var _0x145f89='ODBC';return db['UserProfileSection'][_0x48d2('0x42')]({'where':{'name':_0x145f89,'userProfileId':_0x3dfc41[_0x48d2('0x46')]},'raw':!![]})[_0x48d2('0x1f')](function(_0x3a339b){if(_0x3a339b&&_0x3a339b[_0x48d2('0x47')]===0x0){return db[_0x48d2('0x22')][_0x48d2('0x48')]({'name':_0x11375c[_0x48d2('0x24')],'resourceId':_0x11375c['id'],'type':_0x3a339b['name'],'sectionId':_0x3a339b['id']},{})[_0x48d2('0x1f')](function(){return _0x22981b;});}else{return _0x22981b;}})[_0x48d2('0x3c')](function(_0x44f6ee){logger[_0x48d2('0x23')](_0x48d2('0x49'),_0x44f6ee);throw _0x44f6ee;});}return _0x22981b;})[_0x48d2('0x1f')](respondWithResult(_0x462560,0xc9))[_0x48d2('0x3c')](handleError(_0x462560,null));};exports[_0x48d2('0x1e')]=function(_0xa605a4,_0x747ead){if(_0xa605a4[_0x48d2('0x43')]['id']){delete _0xa605a4[_0x48d2('0x43')]['id'];}return db[_0x48d2('0x27')]['find']({'where':{'id':_0xa605a4['params']['id']}})[_0x48d2('0x1f')](handleEntityNotFound(_0x747ead,null))[_0x48d2('0x1f')](saveUpdates(_0xa605a4[_0x48d2('0x43')],null))[_0x48d2('0x1f')](respondWithResult(_0x747ead,null))[_0x48d2('0x3c')](handleError(_0x747ead,null));};exports['destroy']=function(_0x2ba9bd,_0x1bc555){return db[_0x48d2('0x27')][_0x48d2('0x42')]({'where':{'id':_0x2ba9bd[_0x48d2('0x3e')]['id']}})[_0x48d2('0x1f')](handleEntityNotFound(_0x1bc555,null))[_0x48d2('0x1f')](removeEntity(_0x1bc555,null))[_0x48d2('0x3c')](handleError(_0x1bc555,null));};exports[_0x48d2('0x4a')]=function(_0x191cdb,_0x1c382a,_0x9cb5cc){var _0x3b0474;return db[_0x48d2('0x27')]['find']({'where':{'id':_0x191cdb[_0x48d2('0x3e')]['id']},'attributes':['id',_0x48d2('0x4b')]})[_0x48d2('0x1f')](handleEntityNotFound(_0x1c382a,null))[_0x48d2('0x1f')](function(_0x23a4ab){if(_0x23a4ab){var _0x2780e7=require('odbc')();_0x2780e7[_0x48d2('0x4c')](_0x23a4ab['dsn']);_0x2780e7['closeSync']();return _0x23a4ab;}})[_0x48d2('0x1f')](respondWithResult(_0x1c382a,null))['catch'](handleError(_0x1c382a,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index f7c2876..863d669 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 _0x5cd2=['exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./squareOdbc.attributes'];(function(_0x54fbff,_0x53470e){var _0x5cf619=function(_0x28765b){while(--_0x28765b){_0x54fbff['push'](_0x54fbff['shift']());}};_0x5cf619(++_0x53470e);}(_0x5cd2,0xee));var _0x25cd=function(_0x33fec0,_0x4afb00){_0x33fec0=_0x33fec0-0x0;var _0xd8ac56=_0x5cd2[_0x33fec0];return _0xd8ac56;};'use strict';var _=require(_0x25cd('0x0'));var util=require(_0x25cd('0x1'));var logger=require(_0x25cd('0x2'))(_0x25cd('0x3'));var moment=require('moment');var BPromise=require(_0x25cd('0x4'));var rp=require(_0x25cd('0x5'));var fs=require('fs');var path=require(_0x25cd('0x6'));var rimraf=require(_0x25cd('0x7'));var config=require('../../config/environment');var attributes=require(_0x25cd('0x8'));module[_0x25cd('0x9')]=function(_0x414dd9,_0x259f5c){return _0x414dd9[_0x25cd('0xa')](_0x25cd('0xb'),attributes,{'tableName':_0x25cd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f14=['SquareOdbc','square_odbc','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./squareOdbc.attributes','exports','define'];(function(_0xfbdbd0,_0x210d39){var _0x461624=function(_0x159698){while(--_0x159698){_0xfbdbd0['push'](_0xfbdbd0['shift']());}};_0x461624(++_0x210d39);}(_0x2f14,0x199));var _0x42f1=function(_0x3b58b8,_0x3abe85){_0x3b58b8=_0x3b58b8-0x0;var _0x337e3c=_0x2f14[_0x3b58b8];return _0x337e3c;};'use strict';var _=require('lodash');var util=require(_0x42f1('0x0'));var logger=require(_0x42f1('0x1'))('api');var moment=require(_0x42f1('0x2'));var BPromise=require('bluebird');var rp=require(_0x42f1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x42f1('0x4'));var config=require(_0x42f1('0x5'));var attributes=require(_0x42f1('0x6'));module[_0x42f1('0x7')]=function(_0x210043,_0xd7e996){return _0x210043[_0x42f1('0x8')](_0x42f1('0x9'),attributes,{'tableName':_0x42f1('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 3393809..1872363 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 _0x814b=['model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSquareOdbc','options','where','include','map','attributes'];(function(_0x4db548,_0x2c56c3){var _0x34064a=function(_0x5b4687){while(--_0x5b4687){_0x4db548['push'](_0x4db548['shift']());}};_0x34064a(++_0x2c56c3);}(_0x814b,0x1a2));var _0xb814=function(_0x169e53,_0x46be55){_0x169e53=_0x169e53-0x0;var _0x252bb3=_0x814b[_0x169e53];return _0x252bb3;};'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')]('SquareOdbc,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});}exports[_0xb814('0x18')]=function(_0x55ba16){var _0x270598=this;return new Promise(function(_0xfac75b,_0x4c3007){return db['SquareOdbc']['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')]('ShowSquareOdbc',_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 _0x008c=['stringify','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareOdbc,\x20%s,\x20%s','message','catch','find','options','include','map','attributes','model','then'];(function(_0x437bf5,_0x12de66){var _0x3a963c=function(_0x201758){while(--_0x201758){_0x437bf5['push'](_0x437bf5['shift']());}};_0x3a963c(++_0x12de66);}(_0x008c,0x188));var _0xc008=function(_0x549443,_0x2e04c8){_0x549443=_0x549443-0x0;var _0x372ed3=_0x008c[_0x549443];return _0x372ed3;};'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')]('SquareOdbc,\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')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});}exports['ShowSquareOdbc']=function(_0x540e45){var _0x5c2668=this;return new Promise(function(_0x46042b,_0x462af5){return db['SquareOdbc'][_0xc008('0x15')]({'raw':_0x540e45['options']?_0x540e45['options']['raw']===undefined?!![]:![]:!![],'where':_0x540e45['options']?_0x540e45[_0xc008('0x16')]['where']||null:null,'attributes':_0x540e45['options']?_0x540e45['options']['attributes']||null:null,'include':_0x540e45['options']?_0x540e45[_0xc008('0x16')][_0xc008('0x17')]?_[_0xc008('0x18')](_0x540e45[_0xc008('0x16')][_0xc008('0x17')],function(_0x110128){return{'model':db[_0x110128['model']],'as':_0x110128['as'],'attributes':_0x110128[_0xc008('0x19')],'include':_0x110128['include']?_['map'](_0x110128[_0xc008('0x17')],function(_0x36f358){return{'model':db[_0x36f358[_0xc008('0x1a')]],'as':_0x36f358['as'],'attributes':_0x36f358[_0xc008('0x19')],'include':_0x36f358['include']?_['map'](_0x36f358['include'],function(_0x3f7b07){return{'model':db[_0x3f7b07[_0xc008('0x1a')]],'as':_0x3f7b07['as'],'attributes':_0x3f7b07[_0xc008('0x19')]};}):[]};}):[]};}):[]:[]})[_0xc008('0x1b')](function(_0x5bebd9){logger['info']('ShowSquareOdbc',_0x540e45);logger['debug']('ShowSquareOdbc',_0x540e45,JSON[_0xc008('0x1c')](_0x5bebd9));_0x46042b(_0x5bebd9);})[_0xc008('0x14')](function(_0x25eae4){logger['error'](_0xc008('0x1d'),_0x25eae4[_0xc008('0x13')],_0x540e45);_0x462af5(_0x5c2668[_0xc008('0x10')](0x1f4,_0x25eae4[_0xc008('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 3c7ea2c..2dcb51f 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 _0xeffd=['./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','addUsers','put','update','delete','removeUsers','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x517c2e,_0x3d4bf3){var _0x5d4029=function(_0x150245){while(--_0x150245){_0x517c2e['push'](_0x517c2e['shift']());}};_0x5d4029(++_0x3d4bf3);}(_0xeffd,0x6b));var _0xdeff=function(_0x479676,_0x2de234){_0x479676=_0x479676-0x0;var _0x4004c7=_0xeffd[_0x479676];return _0x4004c7;};'use strict';var multer=require(_0xdeff('0x0'));var util=require('util');var path=require(_0xdeff('0x1'));var timeout=require(_0xdeff('0x2'));var express=require(_0xdeff('0x3'));var router=express[_0xdeff('0x4')]();var auth=require(_0xdeff('0x5'));var interaction=require(_0xdeff('0x6'));var config=require(_0xdeff('0x7'));var controller=require(_0xdeff('0x8'));router[_0xdeff('0x9')]('/',auth[_0xdeff('0xa')](),controller[_0xdeff('0xb')]);router[_0xdeff('0x9')](_0xdeff('0xc'),auth[_0xdeff('0xa')](),controller[_0xdeff('0xd')]);router[_0xdeff('0x9')](_0xdeff('0xe'),auth['isAuthenticated'](),controller[_0xdeff('0xf')]);router[_0xdeff('0x10')]('/',auth[_0xdeff('0xa')](),controller['create']);router[_0xdeff('0x10')](_0xdeff('0xe'),auth[_0xdeff('0xa')](),controller[_0xdeff('0x11')]);router[_0xdeff('0x12')](_0xdeff('0xc'),auth[_0xdeff('0xa')](),controller[_0xdeff('0x13')]);router['delete'](_0xdeff('0xc'),auth[_0xdeff('0xa')](),controller['destroy']);router[_0xdeff('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0xdeff('0x15')]);module[_0xdeff('0x16')]=router; \ No newline at end of file +var _0xf45e=['isAuthenticated','index','/:id','show','/:id/users','getUsers','post','addUsers','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x5f269d,_0x55a4ef){var _0x1b2755=function(_0xde38b4){while(--_0xde38b4){_0x5f269d['push'](_0x5f269d['shift']());}};_0x1b2755(++_0x55a4ef);}(_0xf45e,0x115));var _0xef45=function(_0x4cb734,_0x2f1f3c){_0x4cb734=_0x4cb734-0x0;var _0x152dad=_0xf45e[_0x4cb734];return _0x152dad;};'use strict';var multer=require(_0xef45('0x0'));var util=require('util');var path=require(_0xef45('0x1'));var timeout=require('connect-timeout');var express=require(_0xef45('0x2'));var router=express[_0xef45('0x3')]();var auth=require(_0xef45('0x4'));var interaction=require(_0xef45('0x5'));var config=require(_0xef45('0x6'));var controller=require(_0xef45('0x7'));router[_0xef45('0x8')]('/',auth[_0xef45('0x9')](),controller[_0xef45('0xa')]);router[_0xef45('0x8')](_0xef45('0xb'),auth[_0xef45('0x9')](),controller[_0xef45('0xc')]);router[_0xef45('0x8')](_0xef45('0xd'),auth[_0xef45('0x9')](),controller[_0xef45('0xe')]);router[_0xef45('0xf')]('/',auth[_0xef45('0x9')](),controller['create']);router[_0xef45('0xf')](_0xef45('0xd'),auth[_0xef45('0x9')](),controller[_0xef45('0x10')]);router[_0xef45('0x11')](_0xef45('0xb'),auth['isAuthenticated'](),controller[_0xef45('0x12')]);router[_0xef45('0x13')](_0xef45('0xb'),auth[_0xef45('0x9')](),controller[_0xef45('0x14')]);router['delete']('/:id/users',auth[_0xef45('0x9')](),controller['removeUsers']);module[_0xef45('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 12684c7..9f8b350 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 _0x5416=['getDataValue','toString','production','sequelize','exports','STRING','name','TEXT','BLOB','long'];(function(_0x3e961c,_0x5747e7){var _0x474f9c=function(_0x33f8ea){while(--_0x33f8ea){_0x3e961c['push'](_0x3e961c['shift']());}};_0x474f9c(++_0x5747e7);}(_0x5416,0x99));var _0x6541=function(_0x5a2845,_0x4c58f1){_0x5a2845=_0x5a2845-0x0;var _0x41ffd2=_0x5416[_0x5a2845];return _0x41ffd2;};'use strict';var Sequelize=require(_0x6541('0x0'));module[_0x6541('0x1')]={'name':{'type':Sequelize[_0x6541('0x2')],'unique':_0x6541('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x6541('0x4')]},'preproduction':{'type':Sequelize[_0x6541('0x5')](_0x6541('0x6')),'get':function(){if(this[_0x6541('0x7')]('preproduction')){return this[_0x6541('0x7')]('preproduction')[_0x6541('0x8')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0x6541('0x6')),'get':function(){if(this[_0x6541('0x7')](_0x6541('0x9'))){return this[_0x6541('0x7')](_0x6541('0x9'))[_0x6541('0x8')]('utf8');}}}}; \ No newline at end of file +var _0xcf3c=['TEXT','BLOB','long','getDataValue','preproduction','toString','production','utf8','sequelize','exports','STRING','name'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0xcf3c,0x1d0));var _0xccf3=function(_0x4f18b0,_0x2b4844){_0x4f18b0=_0x4f18b0-0x0;var _0x15be20=_0xcf3c[_0x4f18b0];return _0x15be20;};'use strict';var Sequelize=require(_0xccf3('0x0'));module[_0xccf3('0x1')]={'name':{'type':Sequelize[_0xccf3('0x2')],'unique':_0xccf3('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xccf3('0x2')]},'notes':{'type':Sequelize[_0xccf3('0x4')]},'preproduction':{'type':Sequelize[_0xccf3('0x5')](_0xccf3('0x6')),'get':function(){if(this[_0xccf3('0x7')](_0xccf3('0x8'))){return this[_0xccf3('0x7')]('preproduction')[_0xccf3('0x9')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0xccf3('0x6')),'get':function(){if(this[_0xccf3('0x7')](_0xccf3('0xa'))){return this[_0xccf3('0x7')](_0xccf3('0xa'))[_0xccf3('0x9')](_0xccf3('0xb'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 4710d58..aab3cff 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 _0x5687=['keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','create','update','body','find','addUsers','ids','removeUsers','userSquareProject:remove','emit','User','getUsers','hasOwnProperty','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./squareProject.socket','register','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','get','SquareProjects','UserProfileResource','sendStatus','error','stack','name','index','map','SquareProject','rawAttributes','key','model','query'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0x5687,0x1a0));var _0x7568=function(_0x4b8cbd,_0x47b5fc){_0x4b8cbd=_0x4b8cbd-0x0;var _0x122336=_0x5687[_0x4b8cbd];return _0x122336;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7568('0x0'));var rimraf=require(_0x7568('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7568('0x2'));var moment=require('moment');var BPromise=require(_0x7568('0x3'));var Mustache=require(_0x7568('0x4'));var util=require(_0x7568('0x5'));var path=require(_0x7568('0x6'));var sox=require('sox');var csv=require(_0x7568('0x7'));var ejs=require(_0x7568('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7568('0x9'));var crypto=require(_0x7568('0xa'));var jsforce=require(_0x7568('0xb'));var deskjs=require(_0x7568('0xc'));var toCsv=require(_0x7568('0x7'));var querystring=require(_0x7568('0xd'));var Papa=require(_0x7568('0xe'));var Redis=require('ioredis');var authService=require(_0x7568('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7568('0x10'));var hardwareService=require(_0x7568('0x11'));var logger=require(_0x7568('0x12'))(_0x7568('0x13'));var utils=require(_0x7568('0x14'));var config=require(_0x7568('0x15'));var db=require(_0x7568('0x16'))['db'];config[_0x7568('0x17')]=_[_0x7568('0x18')](config[_0x7568('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x7568('0x19'))(new Redis(config[_0x7568('0x17')]));require(_0x7568('0x1a'))[_0x7568('0x1b')](socket);function respondWithStatusCode(_0x2c68ba,_0x3f0094){_0x3f0094=_0x3f0094||0xcc;return function(_0x44c154){if(_0x44c154){return _0x2c68ba['sendStatus'](_0x3f0094);}return _0x2c68ba[_0x7568('0x1c')](_0x3f0094)[_0x7568('0x1d')]();};}function respondWithResult(_0x4060b1,_0x36ca51){_0x36ca51=_0x36ca51||0xc8;return function(_0x50d845){if(_0x50d845){return _0x4060b1[_0x7568('0x1c')](_0x36ca51)['json'](_0x50d845);}};}function respondWithFilteredResult(_0x3d6697,_0x5d8055){return function(_0x1d56eb){if(_0x1d56eb){var _0x1a2e20=_0x1d56eb[_0x7568('0x1e')],_0x168bc5=_0x5d8055[_0x7568('0x1f')],_0x257e70=_0x5d8055[_0x7568('0x1f')]+_0x5d8055[_0x7568('0x20')],_0x523b5d;if(_0x257e70>=_0x1a2e20){_0x257e70=_0x1a2e20;_0x523b5d=0xc8;}else{_0x523b5d=0xce;}_0x3d6697['status'](_0x523b5d);return _0x3d6697[_0x7568('0x21')](_0x7568('0x22'),_0x168bc5+'-'+_0x257e70+'/'+_0x1a2e20)[_0x7568('0x23')](_0x1d56eb);}return null;};}function patchUpdates(_0x4faa14){return function(_0x79a04f){try{jsonpatch[_0x7568('0x24')](_0x79a04f,_0x4faa14,!![]);}catch(_0x58b260){return BPromise[_0x7568('0x25')](_0x58b260);}return _0x79a04f['save']();};}function saveUpdates(_0x524ba4,_0x514eb8){return function(_0x456980){if(_0x456980){return _0x456980['update'](_0x524ba4)[_0x7568('0x26')](function(_0x25d441){return _0x25d441;});}return null;};}function removeEntity(_0x5c4772,_0x3bc32a){return function(_0x44324d){if(_0x44324d){return _0x44324d[_0x7568('0x27')]()[_0x7568('0x26')](function(){var _0x2d528e=_0x44324d[_0x7568('0x28')]({'plain':!![]});var _0x4a5d87=_0x7568('0x29');return db[_0x7568('0x2a')][_0x7568('0x27')]({'where':{'type':_0x4a5d87,'resourceId':_0x2d528e['id']}})[_0x7568('0x26')](function(){return _0x44324d;});})[_0x7568('0x26')](function(){_0x5c4772[_0x7568('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26d329,_0x3ffd75){return function(_0x3dd5bc){if(!_0x3dd5bc){_0x26d329[_0x7568('0x2b')](0x194);}return _0x3dd5bc;};}function handleError(_0x1a2d5b,_0x1f37c0){_0x1f37c0=_0x1f37c0||0x1f4;return function(_0x4da6ab){logger[_0x7568('0x2c')](_0x4da6ab[_0x7568('0x2d')]);if(_0x4da6ab[_0x7568('0x2e')]){delete _0x4da6ab[_0x7568('0x2e')];}_0x1a2d5b['status'](_0x1f37c0)['send'](_0x4da6ab);};}exports[_0x7568('0x2f')]=function(_0x2eff57,_0x19b534){var _0x9bae6d={},_0x2ef473={},_0x296978={'count':0x0,'rows':[]};var _0x5d4558=_[_0x7568('0x30')](db[_0x7568('0x31')][_0x7568('0x32')],function(_0x190589){return{'name':_0x190589['fieldName'],'type':_0x190589['type'][_0x7568('0x33')]};});_0x2ef473[_0x7568('0x34')]=_[_0x7568('0x30')](_0x5d4558,_0x7568('0x2e'));_0x2ef473[_0x7568('0x35')]=_[_0x7568('0x36')](_0x2eff57['query']);_0x2ef473[_0x7568('0x37')]=_[_0x7568('0x38')](_0x2ef473[_0x7568('0x34')],_0x2ef473[_0x7568('0x35')]);_0x9bae6d[_0x7568('0x39')]=_[_0x7568('0x38')](_0x2ef473['model'],qs[_0x7568('0x3a')](_0x2eff57[_0x7568('0x35')][_0x7568('0x3a')]));_0x9bae6d['attributes']=_0x9bae6d['attributes'][_0x7568('0x3b')]?_0x9bae6d[_0x7568('0x39')]:_0x2ef473['model'];if(!_0x2eff57[_0x7568('0x35')]['hasOwnProperty'](_0x7568('0x3c'))){_0x9bae6d[_0x7568('0x20')]=qs[_0x7568('0x20')](_0x2eff57[_0x7568('0x35')]['limit']);_0x9bae6d[_0x7568('0x1f')]=qs[_0x7568('0x1f')](_0x2eff57[_0x7568('0x35')][_0x7568('0x1f')]);}_0x9bae6d[_0x7568('0x3d')]=qs[_0x7568('0x3e')](_0x2eff57['query']['sort']);_0x9bae6d[_0x7568('0x3f')]=qs[_0x7568('0x37')](_[_0x7568('0x40')](_0x2eff57[_0x7568('0x35')],_0x2ef473[_0x7568('0x37')]),_0x5d4558);if(_0x2eff57[_0x7568('0x35')][_0x7568('0x41')]){_0x9bae6d[_0x7568('0x3f')]=_['merge'](_0x9bae6d[_0x7568('0x3f')],{'$or':_[_0x7568('0x30')](_0x5d4558,function(_0x7d0cbf){if(_0x7d0cbf[_0x7568('0x42')]!==_0x7568('0x43')){var _0x46383a={};_0x46383a[_0x7d0cbf[_0x7568('0x2e')]]={'$like':'%'+_0x2eff57[_0x7568('0x35')][_0x7568('0x41')]+'%'};return _0x46383a;}})});}_0x9bae6d=_[_0x7568('0x44')]({},_0x9bae6d,_0x2eff57[_0x7568('0x45')]);var _0x43be00={'where':_0x9bae6d[_0x7568('0x3f')]};return db[_0x7568('0x31')][_0x7568('0x1e')](_0x43be00)[_0x7568('0x26')](function(_0x451426){_0x296978[_0x7568('0x1e')]=_0x451426;if(_0x2eff57[_0x7568('0x35')][_0x7568('0x46')]){_0x9bae6d[_0x7568('0x47')]=[{'all':!![]}];}return db[_0x7568('0x31')]['findAll'](_0x9bae6d);})[_0x7568('0x26')](function(_0x3ac586){_0x296978[_0x7568('0x48')]=_0x3ac586;return _0x296978;})[_0x7568('0x26')](respondWithFilteredResult(_0x19b534,_0x9bae6d))[_0x7568('0x49')](handleError(_0x19b534,null));};exports[_0x7568('0x4a')]=function(_0x236d1a,_0x124ed8){var _0x578108={'raw':![],'where':{'id':_0x236d1a[_0x7568('0x4b')]['id']}},_0x11ea46={};_0x11ea46[_0x7568('0x34')]=_[_0x7568('0x36')](db[_0x7568('0x31')][_0x7568('0x32')]);_0x11ea46[_0x7568('0x35')]=_[_0x7568('0x36')](_0x236d1a[_0x7568('0x35')]);_0x11ea46[_0x7568('0x37')]=_['intersection'](_0x11ea46[_0x7568('0x34')],_0x11ea46[_0x7568('0x35')]);_0x578108[_0x7568('0x39')]=_[_0x7568('0x38')](_0x11ea46['model'],qs[_0x7568('0x3a')](_0x236d1a[_0x7568('0x35')]['fields']));_0x578108[_0x7568('0x39')]=_0x578108[_0x7568('0x39')][_0x7568('0x3b')]?_0x578108[_0x7568('0x39')]:_0x11ea46[_0x7568('0x34')];if(_0x236d1a['query'][_0x7568('0x46')]){_0x578108[_0x7568('0x47')]=[{'all':!![]}];}_0x578108=_[_0x7568('0x44')]({},_0x578108,_0x236d1a[_0x7568('0x45')]);return db[_0x7568('0x31')]['find'](_0x578108)['then'](handleEntityNotFound(_0x124ed8,null))[_0x7568('0x26')](respondWithResult(_0x124ed8,null))[_0x7568('0x49')](handleError(_0x124ed8,null));};exports['create']=function(_0x2f770e,_0x20353b){return db[_0x7568('0x31')]['create'](_0x2f770e['body'],{})[_0x7568('0x26')](function(_0x111b38){var _0x5d7e5f=_0x2f770e['user'][_0x7568('0x28')]({'plain':!![]});if(!_0x5d7e5f)throw new Error(_0x7568('0x4c'));if(_0x5d7e5f[_0x7568('0x4d')]===_0x7568('0x4e')){var _0x53d2b8=_0x111b38[_0x7568('0x28')]({'plain':!![]});var _0x136c5c=_0x7568('0x29');return db[_0x7568('0x4f')]['find']({'where':{'name':_0x136c5c,'userProfileId':_0x5d7e5f[_0x7568('0x50')]},'raw':!![]})['then'](function(_0x306970){if(_0x306970&&_0x306970[_0x7568('0x51')]===0x0){return db[_0x7568('0x2a')][_0x7568('0x52')]({'name':_0x53d2b8[_0x7568('0x2e')],'resourceId':_0x53d2b8['id'],'type':_0x306970['name'],'sectionId':_0x306970['id']},{})['then'](function(){return _0x111b38;});}else{return _0x111b38;}})[_0x7568('0x49')](function(_0x181b67){logger[_0x7568('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x181b67);throw _0x181b67;});}return _0x111b38;})['then'](respondWithResult(_0x20353b,0xc9))[_0x7568('0x49')](handleError(_0x20353b,null));};exports[_0x7568('0x53')]=function(_0x491ee6,_0xd7ce14){if(_0x491ee6[_0x7568('0x54')]['id']){delete _0x491ee6['body']['id'];}return db[_0x7568('0x31')][_0x7568('0x55')]({'where':{'id':_0x491ee6[_0x7568('0x4b')]['id']}})[_0x7568('0x26')](handleEntityNotFound(_0xd7ce14,null))['then'](saveUpdates(_0x491ee6['body'],null))['then'](respondWithResult(_0xd7ce14,null))[_0x7568('0x49')](handleError(_0xd7ce14,null));};exports[_0x7568('0x27')]=function(_0x2de022,_0xcd0d59){return db['SquareProject'][_0x7568('0x55')]({'where':{'id':_0x2de022['params']['id']}})[_0x7568('0x26')](handleEntityNotFound(_0xcd0d59,null))[_0x7568('0x26')](removeEntity(_0xcd0d59,null))[_0x7568('0x49')](handleError(_0xcd0d59,null));};exports[_0x7568('0x56')]=function(_0x43b934,_0xf3341,_0x102bc5){return db[_0x7568('0x31')][_0x7568('0x55')]({'where':{'id':_0x43b934[_0x7568('0x4b')]['id']}})[_0x7568('0x26')](handleEntityNotFound(_0xf3341,null))['then'](function(_0x831dee){if(_0x831dee){return _0x831dee[_0x7568('0x56')](_0x43b934[_0x7568('0x54')]['ids'],_['omit'](_0x43b934[_0x7568('0x54')],[_0x7568('0x57'),'id'])||{});}})['then'](respondWithResult(_0xf3341,null))[_0x7568('0x49')](handleError(_0xf3341,null));};exports[_0x7568('0x58')]=function(_0x27570f,_0x549e69,_0x2042d5){return db[_0x7568('0x31')][_0x7568('0x55')]({'where':{'id':_0x27570f[_0x7568('0x4b')]['id']}})[_0x7568('0x26')](handleEntityNotFound(_0x549e69,null))[_0x7568('0x26')](function(_0x1bebbe){if(_0x1bebbe){return _0x1bebbe['removeUsers'](_0x27570f['query']['ids'])[_0x7568('0x26')](function(){if(_['isArray'](_0x27570f[_0x7568('0x35')][_0x7568('0x57')])){for(var _0x41f532=0x0;_0x41f532<_0x27570f['query'][_0x7568('0x57')][_0x7568('0x3b')];_0x41f532+=0x1){socket['emit'](_0x7568('0x59'),{'UserId':Number(_0x27570f['query'][_0x7568('0x57')][_0x41f532]),'SquareProjectId':Number(_0x27570f[_0x7568('0x4b')]['id'])});}}else{socket[_0x7568('0x5a')](_0x7568('0x59'),{'UserId':Number(_0x27570f[_0x7568('0x35')][_0x7568('0x57')]),'SquareProjectId':Number(_0x27570f[_0x7568('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x549e69,null))[_0x7568('0x49')](handleError(_0x549e69,null));};exports['getUsers']=function(_0xd6669b,_0x137e86,_0x5de2eb){var _0x28a9fa={};var _0x93501f={};var _0x4bd020;var _0x4d62b1;return db[_0x7568('0x31')]['findOne']({'where':{'id':_0xd6669b['params']['id']}})[_0x7568('0x26')](handleEntityNotFound(_0x137e86,null))['then'](function(_0x2149ef){if(_0x2149ef){_0x4bd020=_0x2149ef;_0x93501f[_0x7568('0x34')]=_[_0x7568('0x36')](db[_0x7568('0x5b')][_0x7568('0x32')]);_0x93501f[_0x7568('0x35')]=_[_0x7568('0x36')](_0xd6669b[_0x7568('0x35')]);_0x93501f['filters']=_[_0x7568('0x38')](_0x93501f['model'],_0x93501f[_0x7568('0x35')]);_0x28a9fa['attributes']=_[_0x7568('0x38')](_0x93501f['model'],qs['fields'](_0xd6669b[_0x7568('0x35')][_0x7568('0x3a')]));_0x28a9fa['attributes']=_0x28a9fa[_0x7568('0x39')][_0x7568('0x3b')]?_0x28a9fa['attributes']:_0x93501f['model'];_0x28a9fa['order']=qs[_0x7568('0x3e')](_0xd6669b[_0x7568('0x35')][_0x7568('0x3e')]);_0x28a9fa[_0x7568('0x3f')]=qs[_0x7568('0x37')](_[_0x7568('0x40')](_0xd6669b[_0x7568('0x35')],_0x93501f['filters']));if(_0xd6669b[_0x7568('0x35')][_0x7568('0x41')]){_0x28a9fa['where']=_[_0x7568('0x44')](_0x28a9fa['where'],{'$or':_[_0x7568('0x30')](_0x28a9fa[_0x7568('0x39')],function(_0x4299ae){var _0xddcfec={};_0xddcfec[_0x4299ae]={'$like':'%'+_0xd6669b[_0x7568('0x35')][_0x7568('0x41')]+'%'};return _0xddcfec;})});}_0x28a9fa=_[_0x7568('0x44')]({},_0x28a9fa,_0xd6669b['options']);return _0x4bd020[_0x7568('0x5c')](_0x28a9fa);}})[_0x7568('0x26')](function(_0x1bbbf4){if(_0x1bbbf4){_0x4d62b1=_0x1bbbf4['length'];if(!_0xd6669b[_0x7568('0x35')][_0x7568('0x5d')]('nolimit')){_0x28a9fa['limit']=qs['limit'](_0xd6669b[_0x7568('0x35')][_0x7568('0x20')]);_0x28a9fa[_0x7568('0x1f')]=qs[_0x7568('0x1f')](_0xd6669b[_0x7568('0x35')][_0x7568('0x1f')]);}return _0x4bd020[_0x7568('0x5c')](_0x28a9fa);}})[_0x7568('0x26')](function(_0x191411){if(_0x191411){return _0x191411?{'count':_0x4d62b1,'rows':_0x191411}:null;}})['then'](respondWithResult(_0x137e86,null))['catch'](handleError(_0x137e86,null));}; \ No newline at end of file +var _0xf4e6=['localhost','./squareProject.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','include','SquareProject','findAll','rows','catch','show','params','length','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','getUsers','findOne','User','pick','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis'];(function(_0x1abfd1,_0x345284){var _0x311ae2=function(_0x2e11cc){while(--_0x2e11cc){_0x1abfd1['push'](_0x1abfd1['shift']());}};_0x311ae2(++_0x345284);}(_0xf4e6,0x15d));var _0x6f4e=function(_0x3816c2,_0xb221e1){_0x3816c2=_0x3816c2-0x0;var _0x144669=_0xf4e6[_0x3816c2];return _0x144669;};'use strict';var pdf=require(_0x6f4e('0x0'));var emlformat=require(_0x6f4e('0x1'));var rimraf=require(_0x6f4e('0x2'));var zipdir=require(_0x6f4e('0x3'));var jsonpatch=require(_0x6f4e('0x4'));var rp=require(_0x6f4e('0x5'));var moment=require('moment');var BPromise=require(_0x6f4e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6f4e('0x7'));var sox=require(_0x6f4e('0x8'));var csv=require(_0x6f4e('0x9'));var ejs=require(_0x6f4e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6f4e('0xb'));var crypto=require(_0x6f4e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f4e('0x9'));var querystring=require(_0x6f4e('0xd'));var Papa=require(_0x6f4e('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6f4e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f4e('0x10'));var logger=require(_0x6f4e('0x11'))(_0x6f4e('0x12'));var utils=require(_0x6f4e('0x13'));var config=require(_0x6f4e('0x14'));var db=require(_0x6f4e('0x15'))['db'];config[_0x6f4e('0x16')]=_['defaults'](config[_0x6f4e('0x16')],{'host':_0x6f4e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6f4e('0x16')]));require(_0x6f4e('0x18'))[_0x6f4e('0x19')](socket);function respondWithStatusCode(_0x36d967,_0x5ac865){_0x5ac865=_0x5ac865||0xcc;return function(_0x18b63e){if(_0x18b63e){return _0x36d967[_0x6f4e('0x1a')](_0x5ac865);}return _0x36d967[_0x6f4e('0x1b')](_0x5ac865)[_0x6f4e('0x1c')]();};}function respondWithResult(_0x5eeaf4,_0x4e44fd){_0x4e44fd=_0x4e44fd||0xc8;return function(_0x2dd54c){if(_0x2dd54c){return _0x5eeaf4[_0x6f4e('0x1b')](_0x4e44fd)[_0x6f4e('0x1d')](_0x2dd54c);}};}function respondWithFilteredResult(_0x1b56f5,_0x12be8f){return function(_0x260e54){if(_0x260e54){var _0x1646d3=_0x260e54[_0x6f4e('0x1e')],_0x5ee5b7=_0x12be8f[_0x6f4e('0x1f')],_0x9ad1f3=_0x12be8f['offset']+_0x12be8f[_0x6f4e('0x20')],_0x4a736a;if(_0x9ad1f3>=_0x1646d3){_0x9ad1f3=_0x1646d3;_0x4a736a=0xc8;}else{_0x4a736a=0xce;}_0x1b56f5[_0x6f4e('0x1b')](_0x4a736a);return _0x1b56f5['set'](_0x6f4e('0x21'),_0x5ee5b7+'-'+_0x9ad1f3+'/'+_0x1646d3)['json'](_0x260e54);}return null;};}function patchUpdates(_0x23a45f){return function(_0x4e0422){try{jsonpatch['apply'](_0x4e0422,_0x23a45f,!![]);}catch(_0x4887a2){return BPromise[_0x6f4e('0x22')](_0x4887a2);}return _0x4e0422[_0x6f4e('0x23')]();};}function saveUpdates(_0x452ab8,_0x1acfc4){return function(_0x3686e2){if(_0x3686e2){return _0x3686e2[_0x6f4e('0x24')](_0x452ab8)[_0x6f4e('0x25')](function(_0x2f692c){return _0x2f692c;});}return null;};}function removeEntity(_0x25bb3f,_0x289d1f){return function(_0x188f3b){if(_0x188f3b){return _0x188f3b[_0x6f4e('0x26')]()[_0x6f4e('0x25')](function(){var _0x5de582=_0x188f3b[_0x6f4e('0x27')]({'plain':!![]});var _0x16698b=_0x6f4e('0x28');return db[_0x6f4e('0x29')][_0x6f4e('0x26')]({'where':{'type':_0x16698b,'resourceId':_0x5de582['id']}})['then'](function(){return _0x188f3b;});})['then'](function(){_0x25bb3f['status'](0xcc)[_0x6f4e('0x1c')]();});}};}function handleEntityNotFound(_0x263269,_0x4d8bcb){return function(_0x2e921b){if(!_0x2e921b){_0x263269[_0x6f4e('0x1a')](0x194);}return _0x2e921b;};}function handleError(_0x334bdb,_0x321511){_0x321511=_0x321511||0x1f4;return function(_0x21660a){logger[_0x6f4e('0x2a')](_0x21660a['stack']);if(_0x21660a[_0x6f4e('0x2b')]){delete _0x21660a['name'];}_0x334bdb[_0x6f4e('0x1b')](_0x321511)[_0x6f4e('0x2c')](_0x21660a);};}exports[_0x6f4e('0x2d')]=function(_0x5483c9,_0x2c7aae){var _0x14ed8c={},_0xc980bf={},_0xe3ac17={'count':0x0,'rows':[]};var _0x360846=_[_0x6f4e('0x2e')](db['SquareProject'][_0x6f4e('0x2f')],function(_0x5df96c){return{'name':_0x5df96c[_0x6f4e('0x30')],'type':_0x5df96c[_0x6f4e('0x31')][_0x6f4e('0x32')]};});_0xc980bf['model']=_['map'](_0x360846,_0x6f4e('0x2b'));_0xc980bf[_0x6f4e('0x33')]=_[_0x6f4e('0x34')](_0x5483c9[_0x6f4e('0x33')]);_0xc980bf[_0x6f4e('0x35')]=_[_0x6f4e('0x36')](_0xc980bf[_0x6f4e('0x37')],_0xc980bf[_0x6f4e('0x33')]);_0x14ed8c[_0x6f4e('0x38')]=_[_0x6f4e('0x36')](_0xc980bf['model'],qs[_0x6f4e('0x39')](_0x5483c9[_0x6f4e('0x33')]['fields']));_0x14ed8c[_0x6f4e('0x38')]=_0x14ed8c[_0x6f4e('0x38')]['length']?_0x14ed8c['attributes']:_0xc980bf[_0x6f4e('0x37')];if(!_0x5483c9[_0x6f4e('0x33')]['hasOwnProperty'](_0x6f4e('0x3a'))){_0x14ed8c['limit']=qs['limit'](_0x5483c9[_0x6f4e('0x33')]['limit']);_0x14ed8c[_0x6f4e('0x1f')]=qs[_0x6f4e('0x1f')](_0x5483c9[_0x6f4e('0x33')][_0x6f4e('0x1f')]);}_0x14ed8c[_0x6f4e('0x3b')]=qs[_0x6f4e('0x3c')](_0x5483c9['query'][_0x6f4e('0x3c')]);_0x14ed8c[_0x6f4e('0x3d')]=qs['filters'](_['pick'](_0x5483c9[_0x6f4e('0x33')],_0xc980bf[_0x6f4e('0x35')]),_0x360846);if(_0x5483c9[_0x6f4e('0x33')][_0x6f4e('0x3e')]){_0x14ed8c[_0x6f4e('0x3d')]=_[_0x6f4e('0x3f')](_0x14ed8c['where'],{'$or':_[_0x6f4e('0x2e')](_0x360846,function(_0x4d58a7){if(_0x4d58a7['type']!==_0x6f4e('0x40')){var _0xa2256={};_0xa2256[_0x4d58a7[_0x6f4e('0x2b')]]={'$like':'%'+_0x5483c9[_0x6f4e('0x33')][_0x6f4e('0x3e')]+'%'};return _0xa2256;}})});}_0x14ed8c=_[_0x6f4e('0x3f')]({},_0x14ed8c,_0x5483c9['options']);var _0x1e9152={'where':_0x14ed8c[_0x6f4e('0x3d')]};return db['SquareProject'][_0x6f4e('0x1e')](_0x1e9152)[_0x6f4e('0x25')](function(_0x128e82){_0xe3ac17['count']=_0x128e82;if(_0x5483c9['query']['includeAll']){_0x14ed8c[_0x6f4e('0x41')]=[{'all':!![]}];}return db[_0x6f4e('0x42')][_0x6f4e('0x43')](_0x14ed8c);})[_0x6f4e('0x25')](function(_0x4d874a){_0xe3ac17[_0x6f4e('0x44')]=_0x4d874a;return _0xe3ac17;})['then'](respondWithFilteredResult(_0x2c7aae,_0x14ed8c))[_0x6f4e('0x45')](handleError(_0x2c7aae,null));};exports[_0x6f4e('0x46')]=function(_0x1c3190,_0x4c8a3e){var _0x26639e={'raw':![],'where':{'id':_0x1c3190[_0x6f4e('0x47')]['id']}},_0x1bfc8b={};_0x1bfc8b[_0x6f4e('0x37')]=_['keys'](db[_0x6f4e('0x42')][_0x6f4e('0x2f')]);_0x1bfc8b['query']=_['keys'](_0x1c3190[_0x6f4e('0x33')]);_0x1bfc8b['filters']=_[_0x6f4e('0x36')](_0x1bfc8b[_0x6f4e('0x37')],_0x1bfc8b[_0x6f4e('0x33')]);_0x26639e[_0x6f4e('0x38')]=_[_0x6f4e('0x36')](_0x1bfc8b['model'],qs['fields'](_0x1c3190['query'][_0x6f4e('0x39')]));_0x26639e[_0x6f4e('0x38')]=_0x26639e[_0x6f4e('0x38')][_0x6f4e('0x48')]?_0x26639e['attributes']:_0x1bfc8b[_0x6f4e('0x37')];if(_0x1c3190[_0x6f4e('0x33')]['includeAll']){_0x26639e[_0x6f4e('0x41')]=[{'all':!![]}];}_0x26639e=_['merge']({},_0x26639e,_0x1c3190[_0x6f4e('0x49')]);return db[_0x6f4e('0x42')]['find'](_0x26639e)['then'](handleEntityNotFound(_0x4c8a3e,null))[_0x6f4e('0x25')](respondWithResult(_0x4c8a3e,null))['catch'](handleError(_0x4c8a3e,null));};exports[_0x6f4e('0x4a')]=function(_0x3cb490,_0xa010eb){return db['SquareProject'][_0x6f4e('0x4a')](_0x3cb490[_0x6f4e('0x4b')],{})[_0x6f4e('0x25')](function(_0x645300){var _0x179850=_0x3cb490['user'][_0x6f4e('0x27')]({'plain':!![]});if(!_0x179850)throw new Error(_0x6f4e('0x4c'));if(_0x179850['role']===_0x6f4e('0x4d')){var _0x17aa25=_0x645300[_0x6f4e('0x27')]({'plain':!![]});var _0x33a849=_0x6f4e('0x28');return db[_0x6f4e('0x4e')][_0x6f4e('0x4f')]({'where':{'name':_0x33a849,'userProfileId':_0x179850[_0x6f4e('0x50')]},'raw':!![]})[_0x6f4e('0x25')](function(_0x100c58){if(_0x100c58&&_0x100c58['autoAssociation']===0x0){return db[_0x6f4e('0x29')][_0x6f4e('0x4a')]({'name':_0x17aa25['name'],'resourceId':_0x17aa25['id'],'type':_0x100c58[_0x6f4e('0x2b')],'sectionId':_0x100c58['id']},{})[_0x6f4e('0x25')](function(){return _0x645300;});}else{return _0x645300;}})['catch'](function(_0x40abc8){logger['error'](_0x6f4e('0x51'),_0x40abc8);throw _0x40abc8;});}return _0x645300;})['then'](respondWithResult(_0xa010eb,0xc9))[_0x6f4e('0x45')](handleError(_0xa010eb,null));};exports['update']=function(_0x357b8c,_0x4f59b2){if(_0x357b8c['body']['id']){delete _0x357b8c[_0x6f4e('0x4b')]['id'];}return db[_0x6f4e('0x42')][_0x6f4e('0x4f')]({'where':{'id':_0x357b8c['params']['id']}})[_0x6f4e('0x25')](handleEntityNotFound(_0x4f59b2,null))[_0x6f4e('0x25')](saveUpdates(_0x357b8c['body'],null))[_0x6f4e('0x25')](respondWithResult(_0x4f59b2,null))[_0x6f4e('0x45')](handleError(_0x4f59b2,null));};exports['destroy']=function(_0x5a1330,_0x3f43be){return db['SquareProject'][_0x6f4e('0x4f')]({'where':{'id':_0x5a1330[_0x6f4e('0x47')]['id']}})[_0x6f4e('0x25')](handleEntityNotFound(_0x3f43be,null))['then'](removeEntity(_0x3f43be,null))['catch'](handleError(_0x3f43be,null));};exports[_0x6f4e('0x52')]=function(_0x409798,_0x3745d8,_0x2e796d){return db[_0x6f4e('0x42')][_0x6f4e('0x4f')]({'where':{'id':_0x409798['params']['id']}})[_0x6f4e('0x25')](handleEntityNotFound(_0x3745d8,null))[_0x6f4e('0x25')](function(_0x145b5d){if(_0x145b5d){return _0x145b5d[_0x6f4e('0x52')](_0x409798[_0x6f4e('0x4b')][_0x6f4e('0x53')],_[_0x6f4e('0x54')](_0x409798[_0x6f4e('0x4b')],[_0x6f4e('0x53'),'id'])||{});}})[_0x6f4e('0x25')](respondWithResult(_0x3745d8,null))[_0x6f4e('0x45')](handleError(_0x3745d8,null));};exports[_0x6f4e('0x55')]=function(_0x4ea7d7,_0x605235,_0x2c7384){return db[_0x6f4e('0x42')]['find']({'where':{'id':_0x4ea7d7[_0x6f4e('0x47')]['id']}})['then'](handleEntityNotFound(_0x605235,null))['then'](function(_0x15c9be){if(_0x15c9be){return _0x15c9be[_0x6f4e('0x55')](_0x4ea7d7[_0x6f4e('0x33')]['ids'])['then'](function(){if(_[_0x6f4e('0x56')](_0x4ea7d7['query'][_0x6f4e('0x53')])){for(var _0x4f9f30=0x0;_0x4f9f30<_0x4ea7d7['query']['ids']['length'];_0x4f9f30+=0x1){socket[_0x6f4e('0x57')]('userSquareProject:remove',{'UserId':Number(_0x4ea7d7[_0x6f4e('0x33')]['ids'][_0x4f9f30]),'SquareProjectId':Number(_0x4ea7d7[_0x6f4e('0x47')]['id'])});}}else{socket[_0x6f4e('0x57')]('userSquareProject:remove',{'UserId':Number(_0x4ea7d7['query'][_0x6f4e('0x53')]),'SquareProjectId':Number(_0x4ea7d7[_0x6f4e('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x605235,null))[_0x6f4e('0x45')](handleError(_0x605235,null));};exports[_0x6f4e('0x58')]=function(_0x599b95,_0x28d11a,_0x9241d2){var _0x18a7a5={};var _0x151b16={};var _0x306f11;var _0x5e5467;return db[_0x6f4e('0x42')][_0x6f4e('0x59')]({'where':{'id':_0x599b95[_0x6f4e('0x47')]['id']}})[_0x6f4e('0x25')](handleEntityNotFound(_0x28d11a,null))[_0x6f4e('0x25')](function(_0x114215){if(_0x114215){_0x306f11=_0x114215;_0x151b16[_0x6f4e('0x37')]=_[_0x6f4e('0x34')](db[_0x6f4e('0x5a')][_0x6f4e('0x2f')]);_0x151b16[_0x6f4e('0x33')]=_[_0x6f4e('0x34')](_0x599b95[_0x6f4e('0x33')]);_0x151b16[_0x6f4e('0x35')]=_[_0x6f4e('0x36')](_0x151b16['model'],_0x151b16[_0x6f4e('0x33')]);_0x18a7a5[_0x6f4e('0x38')]=_['intersection'](_0x151b16[_0x6f4e('0x37')],qs[_0x6f4e('0x39')](_0x599b95[_0x6f4e('0x33')][_0x6f4e('0x39')]));_0x18a7a5['attributes']=_0x18a7a5[_0x6f4e('0x38')][_0x6f4e('0x48')]?_0x18a7a5[_0x6f4e('0x38')]:_0x151b16[_0x6f4e('0x37')];_0x18a7a5['order']=qs[_0x6f4e('0x3c')](_0x599b95[_0x6f4e('0x33')][_0x6f4e('0x3c')]);_0x18a7a5[_0x6f4e('0x3d')]=qs[_0x6f4e('0x35')](_[_0x6f4e('0x5b')](_0x599b95[_0x6f4e('0x33')],_0x151b16['filters']));if(_0x599b95[_0x6f4e('0x33')][_0x6f4e('0x3e')]){_0x18a7a5[_0x6f4e('0x3d')]=_['merge'](_0x18a7a5[_0x6f4e('0x3d')],{'$or':_[_0x6f4e('0x2e')](_0x18a7a5['attributes'],function(_0xd8ec7){var _0x13918d={};_0x13918d[_0xd8ec7]={'$like':'%'+_0x599b95[_0x6f4e('0x33')]['filter']+'%'};return _0x13918d;})});}_0x18a7a5=_[_0x6f4e('0x3f')]({},_0x18a7a5,_0x599b95[_0x6f4e('0x49')]);return _0x306f11[_0x6f4e('0x58')](_0x18a7a5);}})[_0x6f4e('0x25')](function(_0x5da9d4){if(_0x5da9d4){_0x5e5467=_0x5da9d4[_0x6f4e('0x48')];if(!_0x599b95[_0x6f4e('0x33')][_0x6f4e('0x5c')](_0x6f4e('0x3a'))){_0x18a7a5[_0x6f4e('0x20')]=qs[_0x6f4e('0x20')](_0x599b95[_0x6f4e('0x33')][_0x6f4e('0x20')]);_0x18a7a5[_0x6f4e('0x1f')]=qs[_0x6f4e('0x1f')](_0x599b95[_0x6f4e('0x33')]['offset']);}return _0x306f11['getUsers'](_0x18a7a5);}})[_0x6f4e('0x25')](function(_0x571c9e){if(_0x571c9e){return _0x571c9e?{'count':_0x5e5467,'rows':_0x571c9e}:null;}})[_0x6f4e('0x25')](respondWithResult(_0x28d11a,null))[_0x6f4e('0x45')](handleError(_0x28d11a,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 59d0cf1..5755074 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 _0x3512=['SquareProject','setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x31084e,_0x5c9477){var _0x4aaa42=function(_0x46c8d2){while(--_0x46c8d2){_0x31084e['push'](_0x31084e['shift']());}};_0x4aaa42(++_0x5c9477);}(_0x3512,0x9e));var _0x2351=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3512[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x2351('0x0'));var SquareProject=require(_0x2351('0x1'))['db'][_0x2351('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x2351('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2351('0x4')};function emitEvent(_0x4776e6){return function(_0x36125f,_0xed56ef,_0x2b56fc){SquareProjectEvents[_0x2351('0x5')](_0x4776e6+':'+_0x36125f['id'],_0x36125f);SquareProjectEvents[_0x2351('0x5')](_0x4776e6,_0x36125f);_0x2b56fc(null);};}for(var e in events){if(events[_0x2351('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x2351('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0xacd1=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x2cf50a,_0x36d487){var _0x4dd5ce=function(_0x34ba7c){while(--_0x34ba7c){_0x2cf50a['push'](_0x2cf50a['shift']());}};_0x4dd5ce(++_0x36d487);}(_0xacd1,0x1a0));var _0x1acd=function(_0x5ce079,_0x461973){_0x5ce079=_0x5ce079-0x0;var _0x586193=_0xacd1[_0x5ce079];return _0x586193;};'use strict';var EventEmitter=require(_0x1acd('0x0'));var SquareProject=require(_0x1acd('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1acd('0x2')](0x0);var events={'afterCreate':_0x1acd('0x3'),'afterUpdate':_0x1acd('0x4'),'afterDestroy':_0x1acd('0x5')};function emitEvent(_0x269556){return function(_0x46f34f,_0x599474,_0x3b03b9){SquareProjectEvents[_0x1acd('0x6')](_0x269556+':'+_0x46f34f['id'],_0x46f34f);SquareProjectEvents[_0x1acd('0x6')](_0x269556,_0x46f34f);_0x3b03b9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x1acd('0x7')](e,emitEvent(event));}}module[_0x1acd('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 646f8ea..219c479 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 _0x1967=['path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x33c8cb,_0x56cff2){var _0x2d28bb=function(_0x1fcc9b){while(--_0x1fcc9b){_0x33c8cb['push'](_0x33c8cb['shift']());}};_0x2d28bb(++_0x56cff2);}(_0x1967,0x173));var _0x7196=function(_0x3bbe43,_0x558408){_0x3bbe43=_0x3bbe43-0x0;var _0x1d3e39=_0x1967[_0x3bbe43];return _0x1d3e39;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var logger=require(_0x7196('0x1'))(_0x7196('0x2'));var moment=require(_0x7196('0x3'));var BPromise=require(_0x7196('0x4'));var rp=require(_0x7196('0x5'));var fs=require('fs');var path=require(_0x7196('0x6'));var rimraf=require(_0x7196('0x7'));var config=require(_0x7196('0x8'));var attributes=require(_0x7196('0x9'));module['exports']=function(_0x36b01e,_0x186175){return _0x36b01e[_0x7196('0xa')](_0x7196('0xb'),attributes,{'tableName':_0x7196('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadb5=['bluebird','path','rimraf','../../config/environment','exports','define','SquareProject','square_projects','util','api','moment'];(function(_0x1d826a,_0x2946f7){var _0x3a8048=function(_0x32c72f){while(--_0x32c72f){_0x1d826a['push'](_0x1d826a['shift']());}};_0x3a8048(++_0x2946f7);}(_0xadb5,0xad));var _0x5adb=function(_0x409624,_0x25c832){_0x409624=_0x409624-0x0;var _0x3ca48c=_0xadb5[_0x409624];return _0x3ca48c;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./squareProject.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index c8f5c73..4ec9738 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 _0x7e07=['redis','localhost','socket.io-emitter','./squareProject.socket','register','request','then','info','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareProject,\x20%s,\x20%s','result','catch','ShowSquareProject','SquareProject','options','raw','where','include','map','model','attributes','debug','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x177ffc,_0x2281cf){var _0x178541=function(_0x429c6d){while(--_0x429c6d){_0x177ffc['push'](_0x177ffc['shift']());}};_0x178541(++_0x2281cf);}(_0x7e07,0xfd));var _0x77e0=function(_0x3773c9,_0x128f7a){_0x3773c9=_0x3773c9-0x0;var _0x5b3775=_0x7e07[_0x3773c9];return _0x5b3775;};'use strict';var _=require(_0x77e0('0x0'));var util=require(_0x77e0('0x1'));var moment=require(_0x77e0('0x2'));var BPromise=require(_0x77e0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77e0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x77e0('0x5'));var logger=require(_0x77e0('0x6'))(_0x77e0('0x7'));var config=require(_0x77e0('0x8'));var jayson=require(_0x77e0('0x9'));var client=jayson[_0x77e0('0xa')][_0x77e0('0xb')]({'port':0x232a});config['redis']=_[_0x77e0('0xc')](config[_0x77e0('0xd')],{'host':_0x77e0('0xe'),'port':0x18eb});var socket=require(_0x77e0('0xf'))(new Redis(config[_0x77e0('0xd')]));require(_0x77e0('0x10'))[_0x77e0('0x11')](socket);function respondWithRpcPromise(_0x1f99d9,_0x46f260,_0x2e91c0){return new BPromise(function(_0x398dac,_0x3508d4){return client[_0x77e0('0x12')](_0x1f99d9,_0x2e91c0)[_0x77e0('0x13')](function(_0x2803ce){logger[_0x77e0('0x14')]('SquareProject,\x20%s,\x20%s',_0x46f260,'request\x20sent');logger['debug'](_0x77e0('0x15'),_0x46f260,'request\x20sent',JSON[_0x77e0('0x16')](_0x2803ce));if(_0x2803ce[_0x77e0('0x17')]){if(_0x2803ce['error']['code']===0x1f4){logger['error']('SquareProject,\x20%s,\x20%s',_0x46f260,_0x2803ce['error'][_0x77e0('0x18')]);return _0x3508d4(_0x2803ce['error'][_0x77e0('0x18')]);}logger[_0x77e0('0x17')](_0x77e0('0x19'),_0x46f260,_0x2803ce[_0x77e0('0x17')][_0x77e0('0x18')]);return _0x398dac(_0x2803ce[_0x77e0('0x17')][_0x77e0('0x18')]);}else{logger[_0x77e0('0x14')](_0x77e0('0x19'),_0x46f260,'request\x20sent');_0x398dac(_0x2803ce[_0x77e0('0x1a')][_0x77e0('0x18')]);}})[_0x77e0('0x1b')](function(_0xa5a66c){logger[_0x77e0('0x17')](_0x77e0('0x19'),_0x46f260,_0xa5a66c);_0x3508d4(_0xa5a66c);});});}exports[_0x77e0('0x1c')]=function(_0x5dfddd){var _0xa63449=this;return new Promise(function(_0x2fe23c,_0x391f30){return db[_0x77e0('0x1d')]['find']({'raw':_0x5dfddd[_0x77e0('0x1e')]?_0x5dfddd[_0x77e0('0x1e')][_0x77e0('0x1f')]===undefined?!![]:![]:!![],'where':_0x5dfddd[_0x77e0('0x1e')]?_0x5dfddd[_0x77e0('0x1e')][_0x77e0('0x20')]||null:null,'attributes':_0x5dfddd[_0x77e0('0x1e')]?_0x5dfddd[_0x77e0('0x1e')]['attributes']||null:null,'include':_0x5dfddd[_0x77e0('0x1e')]?_0x5dfddd[_0x77e0('0x1e')][_0x77e0('0x21')]?_[_0x77e0('0x22')](_0x5dfddd[_0x77e0('0x1e')][_0x77e0('0x21')],function(_0x50613d){return{'model':db[_0x50613d[_0x77e0('0x23')]],'as':_0x50613d['as'],'attributes':_0x50613d[_0x77e0('0x24')],'include':_0x50613d[_0x77e0('0x21')]?_[_0x77e0('0x22')](_0x50613d[_0x77e0('0x21')],function(_0x318137){return{'model':db[_0x318137['model']],'as':_0x318137['as'],'attributes':_0x318137[_0x77e0('0x24')],'include':_0x318137['include']?_[_0x77e0('0x22')](_0x318137['include'],function(_0x4a2751){return{'model':db[_0x4a2751['model']],'as':_0x4a2751['as'],'attributes':_0x4a2751[_0x77e0('0x24')]};}):[]};}):[]};}):[]:[]})[_0x77e0('0x13')](function(_0x13eb76){logger[_0x77e0('0x14')](_0x77e0('0x1c'),_0x5dfddd);logger[_0x77e0('0x25')]('ShowSquareProject',_0x5dfddd,JSON[_0x77e0('0x16')](_0x13eb76));_0x2fe23c(_0x13eb76);})['catch'](function(_0x5543b3){logger[_0x77e0('0x17')](_0x77e0('0x1c'),_0x5543b3[_0x77e0('0x18')],_0x5dfddd);_0x391f30(_0xa63449[_0x77e0('0x17')](0x1f4,_0x5543b3[_0x77e0('0x18')]));});});}; \ No newline at end of file +var _0xea5c=['stringify','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','./squareProject.socket','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSquareProject','SquareProject','find','options','include','map','attributes','model'];(function(_0x1f1fc4,_0x1b321f){var _0x3399ff=function(_0x533999){while(--_0x533999){_0x1f1fc4['push'](_0x1f1fc4['shift']());}};_0x3399ff(++_0x1b321f);}(_0xea5c,0x1d2));var _0xcea5=function(_0x52ab53,_0x16906e){_0x52ab53=_0x52ab53-0x0;var _0x42daaf=_0xea5c[_0x52ab53];return _0x42daaf;};'use strict';var _=require('lodash');var util=require(_0xcea5('0x0'));var moment=require('moment');var BPromise=require(_0xcea5('0x1'));var rs=require(_0xcea5('0x2'));var fs=require('fs');var Redis=require(_0xcea5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcea5('0x4'));var logger=require(_0xcea5('0x5'))('rpc');var config=require(_0xcea5('0x6'));var jayson=require(_0xcea5('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xcea5('0x8')]=_[_0xcea5('0x9')](config[_0xcea5('0x8')],{'host':_0xcea5('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcea5('0x8')]));require(_0xcea5('0xb'))['register'](socket);function respondWithRpcPromise(_0x56e136,_0x10474d,_0x3709a5){return new BPromise(function(_0x193050,_0x5f3e33){return client['request'](_0x56e136,_0x3709a5)[_0xcea5('0xc')](function(_0x29d9d0){logger[_0xcea5('0xd')](_0xcea5('0xe'),_0x10474d,_0xcea5('0xf'));logger[_0xcea5('0x10')](_0xcea5('0x11'),_0x10474d,'request\x20sent',JSON['stringify'](_0x29d9d0));if(_0x29d9d0['error']){if(_0x29d9d0[_0xcea5('0x12')]['code']===0x1f4){logger[_0xcea5('0x12')](_0xcea5('0xe'),_0x10474d,_0x29d9d0[_0xcea5('0x12')]['message']);return _0x5f3e33(_0x29d9d0[_0xcea5('0x12')][_0xcea5('0x13')]);}logger[_0xcea5('0x12')](_0xcea5('0xe'),_0x10474d,_0x29d9d0[_0xcea5('0x12')]['message']);return _0x193050(_0x29d9d0[_0xcea5('0x12')]['message']);}else{logger[_0xcea5('0xd')](_0xcea5('0xe'),_0x10474d,_0xcea5('0xf'));_0x193050(_0x29d9d0[_0xcea5('0x14')][_0xcea5('0x13')]);}})[_0xcea5('0x15')](function(_0xeb82b3){logger[_0xcea5('0x12')](_0xcea5('0xe'),_0x10474d,_0xeb82b3);_0x5f3e33(_0xeb82b3);});});}exports[_0xcea5('0x16')]=function(_0x1323df){var _0x2b6238=this;return new Promise(function(_0x4c64a8,_0xff78f8){return db[_0xcea5('0x17')][_0xcea5('0x18')]({'raw':_0x1323df['options']?_0x1323df[_0xcea5('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1323df['options']?_0x1323df[_0xcea5('0x19')]['where']||null:null,'attributes':_0x1323df[_0xcea5('0x19')]?_0x1323df['options']['attributes']||null:null,'include':_0x1323df[_0xcea5('0x19')]?_0x1323df[_0xcea5('0x19')][_0xcea5('0x1a')]?_[_0xcea5('0x1b')](_0x1323df[_0xcea5('0x19')]['include'],function(_0x451dbd){return{'model':db[_0x451dbd['model']],'as':_0x451dbd['as'],'attributes':_0x451dbd[_0xcea5('0x1c')],'include':_0x451dbd['include']?_['map'](_0x451dbd[_0xcea5('0x1a')],function(_0x52c610){return{'model':db[_0x52c610['model']],'as':_0x52c610['as'],'attributes':_0x52c610[_0xcea5('0x1c')],'include':_0x52c610['include']?_['map'](_0x52c610[_0xcea5('0x1a')],function(_0x426e68){return{'model':db[_0x426e68[_0xcea5('0x1d')]],'as':_0x426e68['as'],'attributes':_0x426e68[_0xcea5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcea5('0xc')](function(_0x249838){logger[_0xcea5('0xd')]('ShowSquareProject',_0x1323df);logger['debug'](_0xcea5('0x16'),_0x1323df,JSON[_0xcea5('0x1e')](_0x249838));_0x4c64a8(_0x249838);})[_0xcea5('0x15')](function(_0x3c92db){logger[_0xcea5('0x12')]('ShowSquareProject',_0x3c92db[_0xcea5('0x13')],_0x1323df);_0xff78f8(_0x2b6238['error'](0x1f4,_0x3c92db['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index feb9c84..cdea6b5 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 _0x2542=['squareProject:','./squareProject.events','save','remove','update','emit','removeListener','register','length'];(function(_0x12410c,_0x4d5d6b){var _0x3e3320=function(_0x494107){while(--_0x494107){_0x12410c['push'](_0x12410c['shift']());}};_0x3e3320(++_0x4d5d6b);}(_0x2542,0x169));var _0x2254=function(_0x3a5ce5,_0x501ad8){_0x3a5ce5=_0x3a5ce5-0x0;var _0x45ab6c=_0x2542[_0x3a5ce5];return _0x45ab6c;};'use strict';var SquareProjectEvents=require(_0x2254('0x0'));var events=[_0x2254('0x1'),_0x2254('0x2'),_0x2254('0x3')];function createListener(_0x578407,_0x105910){return function(_0x47b1da){_0x105910[_0x2254('0x4')](_0x578407,_0x47b1da);};}function removeListener(_0x3b3dcb,_0x27f5c9){return function(){SquareProjectEvents[_0x2254('0x5')](_0x3b3dcb,_0x27f5c9);};}exports[_0x2254('0x6')]=function(_0x508183){for(var _0x19ad3c=0x0,_0xe8ca50=events[_0x2254('0x7')];_0x19ad3c<_0xe8ca50;_0x19ad3c++){var _0x3c45ec=events[_0x19ad3c];var _0x1637ad=createListener(_0x2254('0x8')+_0x3c45ec,_0x508183);SquareProjectEvents['on'](_0x3c45ec,_0x1637ad);}}; \ No newline at end of file +var _0xafc4=['register','length','squareProject:','./squareProject.events','remove','emit'];(function(_0x413727,_0x17adb1){var _0x5f46d7=function(_0xbb668e){while(--_0xbb668e){_0x413727['push'](_0x413727['shift']());}};_0x5f46d7(++_0x17adb1);}(_0xafc4,0x69));var _0x4afc=function(_0x3ea030,_0x155acb){_0x3ea030=_0x3ea030-0x0;var _0x5832b8=_0xafc4[_0x3ea030];return _0x5832b8;};'use strict';var SquareProjectEvents=require(_0x4afc('0x0'));var events=['save',_0x4afc('0x1'),'update'];function createListener(_0x10aede,_0x11789f){return function(_0x20e443){_0x11789f[_0x4afc('0x2')](_0x10aede,_0x20e443);};}function removeListener(_0x4d9dbd,_0x49f417){return function(){SquareProjectEvents['removeListener'](_0x4d9dbd,_0x49f417);};}exports[_0x4afc('0x3')]=function(_0x471d45){for(var _0x16953b=0x0,_0x1bb281=events[_0x4afc('0x4')];_0x16953b<_0x1bb281;_0x16953b++){var _0xaf053d=events[_0x16953b];var _0x5e1e29=createListener(_0x4afc('0x5')+_0xaf053d,_0x471d45);SquareProjectEvents['on'](_0xaf053d,_0x5e1e29);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index a080002..84a0efe 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 _0x963f=['update','delete','destroy','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/download','download','post','put','/:id'];(function(_0x4a7e98,_0x250137){var _0x27d10d=function(_0x378768){while(--_0x378768){_0x4a7e98['push'](_0x4a7e98['shift']());}};_0x27d10d(++_0x250137);}(_0x963f,0x113));var _0xf963=function(_0x2506e9,_0x20d792){_0x2506e9=_0x2506e9-0x0;var _0x4311e8=_0x963f[_0x2506e9];return _0x4311e8;};'use strict';var multer=require('multer');var util=require(_0xf963('0x0'));var path=require(_0xf963('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf963('0x2')]();var auth=require(_0xf963('0x3'));var interaction=require(_0xf963('0x4'));var config=require(_0xf963('0x5'));var controller=require('./squareRecording.controller');router[_0xf963('0x6')]('/',auth[_0xf963('0x7')](),controller[_0xf963('0x8')]);router[_0xf963('0x6')]('/:id',auth[_0xf963('0x7')](),controller['show']);router[_0xf963('0x6')](_0xf963('0x9'),auth[_0xf963('0x7')](),controller[_0xf963('0xa')]);router[_0xf963('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf963('0xc')](_0xf963('0xd'),auth[_0xf963('0x7')](),controller[_0xf963('0xe')]);router[_0xf963('0xf')]('/:id/delete',auth[_0xf963('0x7')](),controller[_0xf963('0x10')]);module['exports']=router; \ No newline at end of file +var _0x152d=['./squareRecording.controller','get','isAuthenticated','index','/:id','download','post','create','update','delete','destroy','exports','path','express','../../components/auth/service','../../config/environment'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x152d,0x16c));var _0xd152=function(_0x3bfcb3,_0x126ca7){_0x3bfcb3=_0x3bfcb3-0x0;var _0x5ba9de=_0x152d[_0x3bfcb3];return _0x5ba9de;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd152('0x0'));var timeout=require('connect-timeout');var express=require(_0xd152('0x1'));var router=express['Router']();var auth=require(_0xd152('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xd152('0x3'));var controller=require(_0xd152('0x4'));router[_0xd152('0x5')]('/',auth[_0xd152('0x6')](),controller[_0xd152('0x7')]);router['get'](_0xd152('0x8'),auth[_0xd152('0x6')](),controller['show']);router['get']('/:id/download',auth[_0xd152('0x6')](),controller[_0xd152('0x9')]);router[_0xd152('0xa')]('/',auth[_0xd152('0x6')](),controller[_0xd152('0xb')]);router['put'](_0xd152('0x8'),auth[_0xd152('0x6')](),controller[_0xd152('0xc')]);router[_0xd152('0xd')]('/:id/delete',auth['isAuthenticated'](),controller[_0xd152('0xe')]);module[_0xd152('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index ed2bc38..4ccbd3e 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 _0xba0d=['getDataValue','substring','sequelize','STRING','VIRTUAL'];(function(_0x5ce00e,_0x5be1b1){var _0x2f825b=function(_0xe8ed6){while(--_0xe8ed6){_0x5ce00e['push'](_0x5ce00e['shift']());}};_0x2f825b(++_0x5be1b1);}(_0xba0d,0x8e));var _0xdba0=function(_0x256341,_0x2169e8){_0x256341=_0x256341-0x0;var _0x377b74=_0xba0d[_0x256341];return _0x377b74;};'use strict';var Sequelize=require(_0xdba0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xdba0('0x1')]},'callerid':{'type':Sequelize[_0xdba0('0x1')]},'calleridname':{'type':Sequelize[_0xdba0('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xdba0('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdba0('0x1')]},'dnid':{'type':Sequelize[_0xdba0('0x1')]},'projectName':{'type':Sequelize[_0xdba0('0x1')]},'saveName':{'type':Sequelize[_0xdba0('0x1')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xdba0('0x2')],'get':function(){var _0x3ab016='';var _0x423097=this[_0xdba0('0x3')]('savePath');if(_0x423097){_0x3ab016=_0x423097[_0xdba0('0x4')](_0x423097['lastIndexOf']('.'));}return _0x3ab016;}}}; \ No newline at end of file +var _0x1b81=['STRING','savePath','sequelize'];(function(_0x3b5210,_0x176318){var _0x1fdaf8=function(_0x1a6099){while(--_0x1a6099){_0x3b5210['push'](_0x3b5210['shift']());}};_0x1fdaf8(++_0x176318);}(_0x1b81,0x107));var _0x11b8=function(_0x3eb6f5,_0x4a3db6){_0x3eb6f5=_0x3eb6f5-0x0;var _0x48f2cb=_0x1b81[_0x3eb6f5];return _0x48f2cb;};'use strict';var Sequelize=require(_0x11b8('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x11b8('0x1')]},'calleridname':{'type':Sequelize[_0x11b8('0x1')]},'context':{'type':Sequelize[_0x11b8('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x11b8('0x1')]},'accountcode':{'type':Sequelize[_0x11b8('0x1')]},'dnid':{'type':Sequelize[_0x11b8('0x1')]},'projectName':{'type':Sequelize[_0x11b8('0x1')]},'saveName':{'type':Sequelize[_0x11b8('0x1')]},'filename':{'type':Sequelize[_0x11b8('0x1')]},'savePath':{'type':Sequelize[_0x11b8('0x1')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x24460f='';var _0x43675c=this['getDataValue'](_0x11b8('0x2'));if(_0x43675c){_0x24460f=_0x43675c['substring'](_0x43675c['lastIndexOf']('.'));}return _0x24460f;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index db0c6c3..99e81a4 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 _0xdf7e=['%s.cypher','existsSync','Sequelize','SquareRecording\x20not\x20found','download','unlink','message','Not\x20found','destroy','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','then','end','error','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','VIRTUAL','count','includeAll','include','rows','show','params','SquareRecording','find','catch','create','body','../../components/encryptor','uniqueid','savePath','filename','format'];(function(_0x63abf6,_0x2b619f){var _0x362b14=function(_0x2616c9){while(--_0x2616c9){_0x63abf6['push'](_0x63abf6['shift']());}};_0x362b14(++_0x2b619f);}(_0xdf7e,0x6e));var _0xedf7=function(_0x3d1b6e,_0x4c283e){_0x3d1b6e=_0x3d1b6e-0x0;var _0x4cedd0=_0xdf7e[_0x3d1b6e];return _0x4cedd0;};'use strict';var pdf=require(_0xedf7('0x0'));var emlformat=require(_0xedf7('0x1'));var rimraf=require(_0xedf7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xedf7('0x3'));var rp=require(_0xedf7('0x4'));var moment=require(_0xedf7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xedf7('0x6'));var util=require(_0xedf7('0x7'));var path=require(_0xedf7('0x8'));var sox=require(_0xedf7('0x9'));var csv=require('to-csv');var ejs=require(_0xedf7('0xa'));var fs=require('fs');var _=require(_0xedf7('0xb'));var squel=require('squel');var crypto=require(_0xedf7('0xc'));var jsforce=require(_0xedf7('0xd'));var deskjs=require(_0xedf7('0xe'));var toCsv=require(_0xedf7('0xf'));var querystring=require(_0xedf7('0x10'));var Papa=require('papaparse');var Redis=require(_0xedf7('0x11'));var authService=require(_0xedf7('0x12'));var qs=require(_0xedf7('0x13'));var as=require(_0xedf7('0x14'));var hardwareService=require(_0xedf7('0x15'));var logger=require('../../config/logger')(_0xedf7('0x16'));var utils=require(_0xedf7('0x17'));var config=require(_0xedf7('0x18'));var db=require(_0xedf7('0x19'))['db'];function respondWithStatusCode(_0x41124b,_0x43a18c){_0x43a18c=_0x43a18c||0xcc;return function(_0x475e68){if(_0x475e68){return _0x41124b[_0xedf7('0x1a')](_0x43a18c);}return _0x41124b[_0xedf7('0x1b')](_0x43a18c)['end']();};}function respondWithResult(_0x2fb32e,_0x14e208){_0x14e208=_0x14e208||0xc8;return function(_0x2d6c82){if(_0x2d6c82){return _0x2fb32e[_0xedf7('0x1b')](_0x14e208)[_0xedf7('0x1c')](_0x2d6c82);}};}function respondWithFilteredResult(_0x415b21,_0x5dce24){return function(_0x2e3fdb){if(_0x2e3fdb){var _0x318d81=_0x2e3fdb['count'],_0x438d75=_0x5dce24[_0xedf7('0x1d')],_0x420dee=_0x5dce24['offset']+_0x5dce24[_0xedf7('0x1e')],_0xfb5d5b;if(_0x420dee>=_0x318d81){_0x420dee=_0x318d81;_0xfb5d5b=0xc8;}else{_0xfb5d5b=0xce;}_0x415b21[_0xedf7('0x1b')](_0xfb5d5b);return _0x415b21['set'](_0xedf7('0x1f'),_0x438d75+'-'+_0x420dee+'/'+_0x318d81)[_0xedf7('0x1c')](_0x2e3fdb);}return null;};}function patchUpdates(_0x17398f){return function(_0x39cf18){try{jsonpatch[_0xedf7('0x20')](_0x39cf18,_0x17398f,!![]);}catch(_0x3f1a36){return BPromise[_0xedf7('0x21')](_0x3f1a36);}return _0x39cf18[_0xedf7('0x22')]();};}function saveUpdates(_0x3bf5c3,_0x336b14){return function(_0x488ef9){if(_0x488ef9){return _0x488ef9[_0xedf7('0x23')](_0x3bf5c3)[_0xedf7('0x24')](function(_0x43b96a){return _0x43b96a;});}return null;};}function removeEntity(_0x48b1c5,_0x2c1735){return function(_0x244ed9){if(_0x244ed9){return _0x244ed9['destroy']()[_0xedf7('0x24')](function(){_0x48b1c5[_0xedf7('0x1b')](0xcc)[_0xedf7('0x25')]();});}};}function handleEntityNotFound(_0x26fd49,_0x2eeb90){return function(_0x31ffb5){if(!_0x31ffb5){_0x26fd49['sendStatus'](0x194);}return _0x31ffb5;};}function handleError(_0x433154,_0x10d8bd){_0x10d8bd=_0x10d8bd||0x1f4;return function(_0x4bfff9){logger[_0xedf7('0x26')](_0x4bfff9['stack']);if(_0x4bfff9['name']){delete _0x4bfff9['name'];}_0x433154['status'](_0x10d8bd)[_0xedf7('0x27')](_0x4bfff9);};}exports[_0xedf7('0x28')]=function(_0x34273c,_0x3d6270){var _0x52405a={},_0x384bd2={},_0x50148f={'count':0x0,'rows':[]};var _0x3774f7=_[_0xedf7('0x29')](db['SquareRecording'][_0xedf7('0x2a')],function(_0xba7b71){return{'name':_0xba7b71[_0xedf7('0x2b')],'type':_0xba7b71[_0xedf7('0x2c')][_0xedf7('0x2d')]};});_0x384bd2[_0xedf7('0x2e')]=_['map'](_0x3774f7,_0xedf7('0x2f'));_0x384bd2[_0xedf7('0x30')]=_[_0xedf7('0x31')](_0x34273c[_0xedf7('0x30')]);_0x384bd2['filters']=_[_0xedf7('0x32')](_0x384bd2[_0xedf7('0x2e')],_0x384bd2['query']);_0x52405a[_0xedf7('0x33')]=_[_0xedf7('0x32')](_0x384bd2['model'],qs[_0xedf7('0x34')](_0x34273c[_0xedf7('0x30')][_0xedf7('0x34')]));_0x52405a[_0xedf7('0x33')]=_0x52405a[_0xedf7('0x33')][_0xedf7('0x35')]?_0x52405a[_0xedf7('0x33')]:_0x384bd2[_0xedf7('0x2e')];if(!_0x34273c['query'][_0xedf7('0x36')]('nolimit')){_0x52405a[_0xedf7('0x1e')]=qs[_0xedf7('0x1e')](_0x34273c['query'][_0xedf7('0x1e')]);_0x52405a[_0xedf7('0x1d')]=qs[_0xedf7('0x1d')](_0x34273c[_0xedf7('0x30')]['offset']);}_0x52405a[_0xedf7('0x37')]=qs[_0xedf7('0x38')](_0x34273c[_0xedf7('0x30')][_0xedf7('0x38')]);_0x52405a[_0xedf7('0x39')]=qs['filters'](_[_0xedf7('0x3a')](_0x34273c[_0xedf7('0x30')],_0x384bd2[_0xedf7('0x3b')]),_0x3774f7);if(_0x34273c[_0xedf7('0x30')][_0xedf7('0x3c')]){_0x52405a[_0xedf7('0x39')]=_['merge'](_0x52405a['where'],{'$or':_[_0xedf7('0x29')](_0x3774f7,function(_0xfbcd1b){if(_0xfbcd1b['type']!==_0xedf7('0x3d')){var _0x1f3ad5={};_0x1f3ad5[_0xfbcd1b[_0xedf7('0x2f')]]={'$like':'%'+_0x34273c[_0xedf7('0x30')]['filter']+'%'};return _0x1f3ad5;}})});}_0x52405a=_['merge']({},_0x52405a,_0x34273c['options']);var _0x278199={'where':_0x52405a[_0xedf7('0x39')]};return db['SquareRecording'][_0xedf7('0x3e')](_0x278199)[_0xedf7('0x24')](function(_0x36c0d8){_0x50148f['count']=_0x36c0d8;if(_0x34273c[_0xedf7('0x30')][_0xedf7('0x3f')]){_0x52405a[_0xedf7('0x40')]=[{'all':!![]}];}return db['SquareRecording']['findAll'](_0x52405a);})[_0xedf7('0x24')](function(_0x486ee8){_0x50148f[_0xedf7('0x41')]=_0x486ee8;return _0x50148f;})['then'](respondWithFilteredResult(_0x3d6270,_0x52405a))['catch'](handleError(_0x3d6270,null));};exports[_0xedf7('0x42')]=function(_0x4b9859,_0x1d780c){var _0x6257b0={'raw':!![],'where':{'id':_0x4b9859[_0xedf7('0x43')]['id']}},_0x167ca4={};_0x167ca4[_0xedf7('0x2e')]=_[_0xedf7('0x31')](db['SquareRecording'][_0xedf7('0x2a')]);_0x167ca4['query']=_[_0xedf7('0x31')](_0x4b9859[_0xedf7('0x30')]);_0x167ca4['filters']=_[_0xedf7('0x32')](_0x167ca4[_0xedf7('0x2e')],_0x167ca4[_0xedf7('0x30')]);_0x6257b0[_0xedf7('0x33')]=_['intersection'](_0x167ca4[_0xedf7('0x2e')],qs[_0xedf7('0x34')](_0x4b9859[_0xedf7('0x30')]['fields']));_0x6257b0['attributes']=_0x6257b0['attributes'][_0xedf7('0x35')]?_0x6257b0[_0xedf7('0x33')]:_0x167ca4[_0xedf7('0x2e')];if(_0x4b9859[_0xedf7('0x30')][_0xedf7('0x3f')]){_0x6257b0[_0xedf7('0x40')]=[{'all':!![]}];}_0x6257b0=_['merge']({},_0x6257b0,_0x4b9859['options']);return db[_0xedf7('0x44')][_0xedf7('0x45')](_0x6257b0)['then'](handleEntityNotFound(_0x1d780c,null))['then'](respondWithResult(_0x1d780c,null))[_0xedf7('0x46')](handleError(_0x1d780c,null));};exports['create']=function(_0xdc4ef5,_0xdc7ac6){return db[_0xedf7('0x44')][_0xedf7('0x47')](_0xdc4ef5['body'],{})[_0xedf7('0x24')](respondWithResult(_0xdc7ac6,0xc9))[_0xedf7('0x46')](handleError(_0xdc7ac6,null));};exports['update']=function(_0x199618,_0x2a143d){if(_0x199618[_0xedf7('0x48')]['id']){delete _0x199618['body']['id'];}return db[_0xedf7('0x44')][_0xedf7('0x45')]({'where':{'id':_0x199618['params']['id']}})[_0xedf7('0x24')](handleEntityNotFound(_0x2a143d,null))[_0xedf7('0x24')](saveUpdates(_0x199618[_0xedf7('0x48')],null))[_0xedf7('0x24')](respondWithResult(_0x2a143d,null))[_0xedf7('0x46')](handleError(_0x2a143d,null));};exports['download']=function(_0xfeeba7,_0x216cce,_0x11a66f){var _0x272f9c=require(_0xedf7('0x49'));var _0x1d0605=![];var _0x45ac9a={};if(_0xfeeba7[_0xedf7('0x30')][_0xedf7('0x2c')]&&_0xfeeba7[_0xedf7('0x30')][_0xedf7('0x2c')]===_0xedf7('0x4a')){_0x45ac9a[_0xedf7('0x4a')]=_0xfeeba7[_0xedf7('0x43')]['id'];}else{_0x45ac9a['id']=_0xfeeba7['params']['id'];}return db[_0xedf7('0x44')][_0xedf7('0x45')]({'where':_0x45ac9a,'attributes':['id',_0xedf7('0x4b'),_0xedf7('0x4c')],'raw':!![]})[_0xedf7('0x24')](handleEntityNotFound(_0x216cce,null))[_0xedf7('0x24')](function(_0x21475b){if(_0x21475b){var _0x3e9840=_0x21475b[_0xedf7('0x4b')];var _0x186b90=util[_0xedf7('0x4d')](_0xedf7('0x4e'),_0x3e9840);if(fs[_0xedf7('0x4f')](_0x186b90)){_0x1d0605=!![];return _0x272f9c['decryptFile'](_0x186b90,_0x3e9840,config['secrets']['recording'])[_0xedf7('0x24')](function(){return _0x21475b;});}return _0x21475b;}})[_0xedf7('0x24')](function(_0x4316fb){if(_0x4316fb){var _0x222e6e=_0x4316fb[_0xedf7('0x4b')];if(!fs['existsSync'](_0x222e6e)){throw new db[(_0xedf7('0x50'))]['ValidationError'](_0xedf7('0x51'));}if(_0x4316fb['filename']){return _0x216cce[_0xedf7('0x52')](_0x222e6e,_0x4316fb[_0xedf7('0x4c')]+path['extname'](_0x222e6e),function(){if(_0x1d0605){fs['unlink'](_0x222e6e);}});}else{return _0x216cce[_0xedf7('0x52')](_0x222e6e,function(_0x551c47){if(_0x1d0605){fs[_0xedf7('0x53')](_0x222e6e);}});}}})[_0xedf7('0x46')](function(_0x5b65a0){if(_0x5b65a0[_0xedf7('0x54')]==='SquareRecording\x20not\x20found'){_0x216cce[_0xedf7('0x1b')](0x194)[_0xedf7('0x27')](_0xedf7('0x55'));}else{return handleError(_0x216cce,null);}});};exports[_0xedf7('0x56')]=function(_0x1a7d4e,_0x25f227){return db['SquareRecording'][_0xedf7('0x45')]({'where':{'id':_0x1a7d4e[_0xedf7('0x43')]['id']}})[_0xedf7('0x24')](function(_0x1c1c14){if(!_0x1c1c14)throw new ReferenceError('Entity\x20not\x20found');return _0x1c1c14;})[_0xedf7('0x24')](function(_0x1f04c8){var _0x51e850=_0x1f04c8[_0xedf7('0x4b')];logger[_0xedf7('0x57')](_0xedf7('0x58'),_0x51e850);if(!_[_0xedf7('0x59')](_0x1f04c8[_0xedf7('0x4b')])&&fs[_0xedf7('0x4f')](_0x51e850)){logger[_0xedf7('0x57')](_0xedf7('0x5a')+_0x51e850+_0xedf7('0x5b'));fs[_0xedf7('0x5c')](_0x51e850);}_0x51e850=_0x51e850+_0xedf7('0x5d');if(!_[_0xedf7('0x59')](_0x1f04c8['savePath'])&&fs[_0xedf7('0x4f')](_0x51e850)){logger['info'](_0xedf7('0x5a')+_0x51e850+_0xedf7('0x5b'));fs[_0xedf7('0x5c')](_0x51e850);}return _0x1f04c8;})[_0xedf7('0x24')](function(_0x792e26){if(!_0x792e26)throw new InternalError();return _0x792e26['destroy']();})[_0xedf7('0x24')](function(){_0x25f227[_0xedf7('0x1b')](0xcc)[_0xedf7('0x25')]();})[_0xedf7('0x46')](handleError(_0x25f227,null));}; \ No newline at end of file +var _0x6630=['filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','catch','show','params','include','find','create','body','download','../../components/encryptor','uniqueid','filename','format','%s.cypher','existsSync','decryptFile','savePath','Sequelize','ValidationError','extname','unlink','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','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','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','model','query','keys'];(function(_0x2ce3da,_0x1bf35c){var _0x109744=function(_0x462974){while(--_0x462974){_0x2ce3da['push'](_0x2ce3da['shift']());}};_0x109744(++_0x1bf35c);}(_0x6630,0x1b1));var _0x0663=function(_0x143b8e,_0x40416c){_0x143b8e=_0x143b8e-0x0;var _0xf3f9ed=_0x6630[_0x143b8e];return _0xf3f9ed;};'use strict';var pdf=require(_0x0663('0x0'));var emlformat=require(_0x0663('0x1'));var rimraf=require(_0x0663('0x2'));var zipdir=require(_0x0663('0x3'));var jsonpatch=require(_0x0663('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0663('0x5'));var Mustache=require(_0x0663('0x6'));var util=require(_0x0663('0x7'));var path=require(_0x0663('0x8'));var sox=require(_0x0663('0x9'));var csv=require(_0x0663('0xa'));var ejs=require(_0x0663('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x0663('0xc'));var jsforce=require(_0x0663('0xd'));var deskjs=require(_0x0663('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0663('0xf'));var Papa=require(_0x0663('0x10'));var Redis=require(_0x0663('0x11'));var authService=require(_0x0663('0x12'));var qs=require(_0x0663('0x13'));var as=require(_0x0663('0x14'));var hardwareService=require(_0x0663('0x15'));var logger=require(_0x0663('0x16'))(_0x0663('0x17'));var utils=require(_0x0663('0x18'));var config=require(_0x0663('0x19'));var db=require(_0x0663('0x1a'))['db'];function respondWithStatusCode(_0x8cec97,_0x418287){_0x418287=_0x418287||0xcc;return function(_0x8ba18c){if(_0x8ba18c){return _0x8cec97['sendStatus'](_0x418287);}return _0x8cec97[_0x0663('0x1b')](_0x418287)[_0x0663('0x1c')]();};}function respondWithResult(_0x21c402,_0x25d428){_0x25d428=_0x25d428||0xc8;return function(_0x2050b1){if(_0x2050b1){return _0x21c402[_0x0663('0x1b')](_0x25d428)[_0x0663('0x1d')](_0x2050b1);}};}function respondWithFilteredResult(_0x12fc14,_0x4e62e4){return function(_0x1495a3){if(_0x1495a3){var _0x286060=_0x1495a3[_0x0663('0x1e')],_0x407b54=_0x4e62e4[_0x0663('0x1f')],_0x430d34=_0x4e62e4[_0x0663('0x1f')]+_0x4e62e4[_0x0663('0x20')],_0xdaff1b;if(_0x430d34>=_0x286060){_0x430d34=_0x286060;_0xdaff1b=0xc8;}else{_0xdaff1b=0xce;}_0x12fc14[_0x0663('0x1b')](_0xdaff1b);return _0x12fc14['set'](_0x0663('0x21'),_0x407b54+'-'+_0x430d34+'/'+_0x286060)[_0x0663('0x1d')](_0x1495a3);}return null;};}function patchUpdates(_0x2f14a9){return function(_0x3a6d0c){try{jsonpatch[_0x0663('0x22')](_0x3a6d0c,_0x2f14a9,!![]);}catch(_0x536aa8){return BPromise[_0x0663('0x23')](_0x536aa8);}return _0x3a6d0c[_0x0663('0x24')]();};}function saveUpdates(_0x1226df,_0x87da18){return function(_0x17862c){if(_0x17862c){return _0x17862c[_0x0663('0x25')](_0x1226df)[_0x0663('0x26')](function(_0xdc4929){return _0xdc4929;});}return null;};}function removeEntity(_0xa26f91,_0x734149){return function(_0x397ab5){if(_0x397ab5){return _0x397ab5[_0x0663('0x27')]()[_0x0663('0x26')](function(){_0xa26f91[_0x0663('0x1b')](0xcc)[_0x0663('0x1c')]();});}};}function handleEntityNotFound(_0x36b844,_0x323217){return function(_0x2cd429){if(!_0x2cd429){_0x36b844['sendStatus'](0x194);}return _0x2cd429;};}function handleError(_0x572223,_0x2e1308){_0x2e1308=_0x2e1308||0x1f4;return function(_0x2e9263){logger[_0x0663('0x28')](_0x2e9263[_0x0663('0x29')]);if(_0x2e9263[_0x0663('0x2a')]){delete _0x2e9263[_0x0663('0x2a')];}_0x572223['status'](_0x2e1308)[_0x0663('0x2b')](_0x2e9263);};}exports[_0x0663('0x2c')]=function(_0x5207ab,_0xebbe3a){var _0x2de888={},_0x27dcff={},_0x24dea2={'count':0x0,'rows':[]};var _0x585139=_[_0x0663('0x2d')](db[_0x0663('0x2e')][_0x0663('0x2f')],function(_0x124724){return{'name':_0x124724['fieldName'],'type':_0x124724[_0x0663('0x30')]['key']};});_0x27dcff[_0x0663('0x31')]=_['map'](_0x585139,'name');_0x27dcff[_0x0663('0x32')]=_[_0x0663('0x33')](_0x5207ab['query']);_0x27dcff[_0x0663('0x34')]=_[_0x0663('0x35')](_0x27dcff[_0x0663('0x31')],_0x27dcff[_0x0663('0x32')]);_0x2de888['attributes']=_[_0x0663('0x35')](_0x27dcff[_0x0663('0x31')],qs['fields'](_0x5207ab[_0x0663('0x32')][_0x0663('0x36')]));_0x2de888[_0x0663('0x37')]=_0x2de888[_0x0663('0x37')][_0x0663('0x38')]?_0x2de888[_0x0663('0x37')]:_0x27dcff['model'];if(!_0x5207ab[_0x0663('0x32')]['hasOwnProperty'](_0x0663('0x39'))){_0x2de888[_0x0663('0x20')]=qs['limit'](_0x5207ab[_0x0663('0x32')][_0x0663('0x20')]);_0x2de888[_0x0663('0x1f')]=qs['offset'](_0x5207ab['query'][_0x0663('0x1f')]);}_0x2de888[_0x0663('0x3a')]=qs[_0x0663('0x3b')](_0x5207ab[_0x0663('0x32')][_0x0663('0x3b')]);_0x2de888[_0x0663('0x3c')]=qs[_0x0663('0x34')](_[_0x0663('0x3d')](_0x5207ab[_0x0663('0x32')],_0x27dcff[_0x0663('0x34')]),_0x585139);if(_0x5207ab['query'][_0x0663('0x3e')]){_0x2de888['where']=_['merge'](_0x2de888['where'],{'$or':_[_0x0663('0x2d')](_0x585139,function(_0xbb3cc6){if(_0xbb3cc6[_0x0663('0x30')]!=='VIRTUAL'){var _0x423182={};_0x423182[_0xbb3cc6[_0x0663('0x2a')]]={'$like':'%'+_0x5207ab[_0x0663('0x32')]['filter']+'%'};return _0x423182;}})});}_0x2de888=_[_0x0663('0x3f')]({},_0x2de888,_0x5207ab[_0x0663('0x40')]);var _0x3dda47={'where':_0x2de888[_0x0663('0x3c')]};return db['SquareRecording']['count'](_0x3dda47)[_0x0663('0x26')](function(_0x5c71ef){_0x24dea2['count']=_0x5c71ef;if(_0x5207ab['query'][_0x0663('0x41')]){_0x2de888['include']=[{'all':!![]}];}return db[_0x0663('0x2e')][_0x0663('0x42')](_0x2de888);})[_0x0663('0x26')](function(_0x525028){_0x24dea2['rows']=_0x525028;return _0x24dea2;})[_0x0663('0x26')](respondWithFilteredResult(_0xebbe3a,_0x2de888))[_0x0663('0x43')](handleError(_0xebbe3a,null));};exports[_0x0663('0x44')]=function(_0x2edda9,_0x878196){var _0x2609f0={'raw':!![],'where':{'id':_0x2edda9[_0x0663('0x45')]['id']}},_0xc34b26={};_0xc34b26[_0x0663('0x31')]=_[_0x0663('0x33')](db[_0x0663('0x2e')]['rawAttributes']);_0xc34b26['query']=_[_0x0663('0x33')](_0x2edda9['query']);_0xc34b26['filters']=_['intersection'](_0xc34b26[_0x0663('0x31')],_0xc34b26[_0x0663('0x32')]);_0x2609f0[_0x0663('0x37')]=_[_0x0663('0x35')](_0xc34b26[_0x0663('0x31')],qs[_0x0663('0x36')](_0x2edda9[_0x0663('0x32')][_0x0663('0x36')]));_0x2609f0[_0x0663('0x37')]=_0x2609f0['attributes']['length']?_0x2609f0['attributes']:_0xc34b26[_0x0663('0x31')];if(_0x2edda9['query']['includeAll']){_0x2609f0[_0x0663('0x46')]=[{'all':!![]}];}_0x2609f0=_[_0x0663('0x3f')]({},_0x2609f0,_0x2edda9[_0x0663('0x40')]);return db[_0x0663('0x2e')][_0x0663('0x47')](_0x2609f0)[_0x0663('0x26')](handleEntityNotFound(_0x878196,null))[_0x0663('0x26')](respondWithResult(_0x878196,null))[_0x0663('0x43')](handleError(_0x878196,null));};exports[_0x0663('0x48')]=function(_0x3606e2,_0x311e24){return db[_0x0663('0x2e')]['create'](_0x3606e2[_0x0663('0x49')],{})[_0x0663('0x26')](respondWithResult(_0x311e24,0xc9))['catch'](handleError(_0x311e24,null));};exports['update']=function(_0x5ccef7,_0x469307){if(_0x5ccef7[_0x0663('0x49')]['id']){delete _0x5ccef7['body']['id'];}return db['SquareRecording']['find']({'where':{'id':_0x5ccef7[_0x0663('0x45')]['id']}})[_0x0663('0x26')](handleEntityNotFound(_0x469307,null))[_0x0663('0x26')](saveUpdates(_0x5ccef7[_0x0663('0x49')],null))[_0x0663('0x26')](respondWithResult(_0x469307,null))[_0x0663('0x43')](handleError(_0x469307,null));};exports[_0x0663('0x4a')]=function(_0x2c3f63,_0xa15a2d,_0x4ff4f4){var _0x1f8b45=require(_0x0663('0x4b'));var _0x1fdd94=![];var _0x5a6572={};if(_0x2c3f63[_0x0663('0x32')][_0x0663('0x30')]&&_0x2c3f63[_0x0663('0x32')][_0x0663('0x30')]===_0x0663('0x4c')){_0x5a6572[_0x0663('0x4c')]=_0x2c3f63[_0x0663('0x45')]['id'];}else{_0x5a6572['id']=_0x2c3f63[_0x0663('0x45')]['id'];}return db['SquareRecording'][_0x0663('0x47')]({'where':_0x5a6572,'attributes':['id','savePath',_0x0663('0x4d')],'raw':!![]})[_0x0663('0x26')](handleEntityNotFound(_0xa15a2d,null))[_0x0663('0x26')](function(_0x386b5b){if(_0x386b5b){var _0x2de2ad=_0x386b5b['savePath'];var _0x20299e=util[_0x0663('0x4e')](_0x0663('0x4f'),_0x2de2ad);if(fs[_0x0663('0x50')](_0x20299e)){_0x1fdd94=!![];return _0x1f8b45[_0x0663('0x51')](_0x20299e,_0x2de2ad,config['secrets']['recording'])[_0x0663('0x26')](function(){return _0x386b5b;});}return _0x386b5b;}})['then'](function(_0x4e5e4f){if(_0x4e5e4f){var _0x4a3268=_0x4e5e4f[_0x0663('0x52')];if(!fs[_0x0663('0x50')](_0x4a3268)){throw new db[(_0x0663('0x53'))][(_0x0663('0x54'))]('SquareRecording\x20not\x20found');}if(_0x4e5e4f[_0x0663('0x4d')]){return _0xa15a2d['download'](_0x4a3268,_0x4e5e4f[_0x0663('0x4d')]+path[_0x0663('0x55')](_0x4a3268),function(){if(_0x1fdd94){fs[_0x0663('0x56')](_0x4a3268);}});}else{return _0xa15a2d[_0x0663('0x4a')](_0x4a3268,function(_0x45cfe7){if(_0x1fdd94){fs[_0x0663('0x56')](_0x4a3268);}});}}})[_0x0663('0x43')](function(_0x3c05ef){if(_0x3c05ef[_0x0663('0x57')]==='SquareRecording\x20not\x20found'){_0xa15a2d[_0x0663('0x1b')](0x194)[_0x0663('0x2b')](_0x0663('0x58'));}else{return handleError(_0xa15a2d,null);}});};exports[_0x0663('0x27')]=function(_0x1a398a,_0x15edf9){return db[_0x0663('0x2e')][_0x0663('0x47')]({'where':{'id':_0x1a398a[_0x0663('0x45')]['id']}})['then'](function(_0x4fe7a1){if(!_0x4fe7a1)throw new ReferenceError(_0x0663('0x59'));return _0x4fe7a1;})[_0x0663('0x26')](function(_0x47d4cb){var _0x48fcf9=_0x47d4cb[_0x0663('0x52')];logger['info'](_0x0663('0x5a'),_0x48fcf9);if(!_[_0x0663('0x5b')](_0x47d4cb[_0x0663('0x52')])&&fs[_0x0663('0x50')](_0x48fcf9)){logger[_0x0663('0x5c')](_0x0663('0x5d')+_0x48fcf9+_0x0663('0x5e'));fs[_0x0663('0x5f')](_0x48fcf9);}_0x48fcf9=_0x48fcf9+_0x0663('0x60');if(!_['isNil'](_0x47d4cb['savePath'])&&fs['existsSync'](_0x48fcf9)){logger[_0x0663('0x5c')](_0x0663('0x5d')+_0x48fcf9+_0x0663('0x5e'));fs[_0x0663('0x5f')](_0x48fcf9);}return _0x47d4cb;})[_0x0663('0x26')](function(_0x382b34){if(!_0x382b34)throw new InternalError();return _0x382b34['destroy']();})[_0x0663('0x26')](function(){_0x15edf9['status'](0xcc)[_0x0663('0x1c')]();})[_0x0663('0x43')](handleError(_0x15edf9,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index e3f7dea..7ab7ff5 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 _0x5592=['../../config/logger','api','moment','request-promise','path','../../config/environment','./squareRecording.attributes','define','SquareRecording','lodash','util'];(function(_0x237315,_0x806ce6){var _0x575e42=function(_0x55ecbb){while(--_0x55ecbb){_0x237315['push'](_0x237315['shift']());}};_0x575e42(++_0x806ce6);}(_0x5592,0x1c1));var _0x2559=function(_0xb4fe2c,_0x3d2be6){_0xb4fe2c=_0xb4fe2c-0x0;var _0x460a1a=_0x5592[_0xb4fe2c];return _0x460a1a;};'use strict';var _=require(_0x2559('0x0'));var util=require(_0x2559('0x1'));var logger=require(_0x2559('0x2'))(_0x2559('0x3'));var moment=require(_0x2559('0x4'));var BPromise=require('bluebird');var rp=require(_0x2559('0x5'));var fs=require('fs');var path=require(_0x2559('0x6'));var rimraf=require('rimraf');var config=require(_0x2559('0x7'));var attributes=require(_0x2559('0x8'));module['exports']=function(_0x42e54a,_0x59a45f){return _0x42e54a[_0x2559('0x9')](_0x2559('0xa'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2664=['exports','SquareRecording','square_recordings','lodash','util','api','bluebird','./squareRecording.attributes'];(function(_0x3f73b2,_0x57c771){var _0x202dd8=function(_0x57e329){while(--_0x57e329){_0x3f73b2['push'](_0x3f73b2['shift']());}};_0x202dd8(++_0x57c771);}(_0x2664,0xa3));var _0x4266=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2664[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x4266('0x0'));var util=require(_0x4266('0x1'));var logger=require('../../config/logger')(_0x4266('0x2'));var moment=require('moment');var BPromise=require(_0x4266('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(_0x4266('0x4'));module[_0x4266('0x5')]=function(_0x5c4572,_0x3f57ef){return _0x5c4572['define'](_0x4266('0x6'),attributes,{'tableName':_0x4266('0x7'),'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 177a790..f07288a 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 _0xe687=['message','result','SquareRecording','create','body','options','raw','CreateSquareRecording','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0xe687,0x1d9));var _0x7e68=function(_0x3ce565,_0x202a94){_0x3ce565=_0x3ce565-0x0;var _0x462df6=_0xe687[_0x3ce565];return _0x462df6;};'use strict';var _=require(_0x7e68('0x0'));var util=require(_0x7e68('0x1'));var moment=require(_0x7e68('0x2'));var BPromise=require(_0x7e68('0x3'));var rs=require(_0x7e68('0x4'));var fs=require('fs');var Redis=require(_0x7e68('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7e68('0x6'));var logger=require('../../config/logger')(_0x7e68('0x7'));var config=require(_0x7e68('0x8'));var jayson=require(_0x7e68('0x9'));var client=jayson[_0x7e68('0xa')][_0x7e68('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c4159,_0x2acc29,_0x40fa43){return new BPromise(function(_0x523452,_0x1d94e3){return client[_0x7e68('0xc')](_0x4c4159,_0x40fa43)[_0x7e68('0xd')](function(_0xc2d3c7){logger[_0x7e68('0xe')](_0x7e68('0xf'),_0x2acc29,_0x7e68('0x10'));logger['debug'](_0x7e68('0x11'),_0x2acc29,_0x7e68('0x10'),JSON[_0x7e68('0x12')](_0xc2d3c7));if(_0xc2d3c7['error']){if(_0xc2d3c7['error']['code']===0x1f4){logger[_0x7e68('0x13')](_0x7e68('0xf'),_0x2acc29,_0xc2d3c7[_0x7e68('0x13')]['message']);return _0x1d94e3(_0xc2d3c7['error'][_0x7e68('0x14')]);}logger[_0x7e68('0x13')](_0x7e68('0xf'),_0x2acc29,_0xc2d3c7[_0x7e68('0x13')][_0x7e68('0x14')]);return _0x523452(_0xc2d3c7[_0x7e68('0x13')]['message']);}else{logger[_0x7e68('0xe')]('SquareRecording,\x20%s,\x20%s',_0x2acc29,_0x7e68('0x10'));_0x523452(_0xc2d3c7[_0x7e68('0x15')][_0x7e68('0x14')]);}})['catch'](function(_0x254be3){logger[_0x7e68('0x13')](_0x7e68('0xf'),_0x2acc29,_0x254be3);_0x1d94e3(_0x254be3);});});}exports['CreateSquareRecording']=function(_0x251225){var _0x32c66f=this;return new Promise(function(_0x19271f,_0x5ea21f){return db[_0x7e68('0x16')][_0x7e68('0x17')](_0x251225[_0x7e68('0x18')],{'raw':_0x251225[_0x7e68('0x19')]?_0x251225[_0x7e68('0x19')][_0x7e68('0x1a')]===undefined?!![]:![]:!![]})[_0x7e68('0xd')](function(_0x326528){logger[_0x7e68('0xe')](_0x7e68('0x1b'),_0x251225);logger[_0x7e68('0x1c')]('CreateSquareRecording',_0x251225,JSON['stringify'](_0x326528));_0x19271f(_0x326528);})['catch'](function(_0x2c74e4){logger['error'](_0x7e68('0x1b'),_0x2c74e4[_0x7e68('0x14')],_0x251225);_0x5ea21f(_0x32c66f[_0x7e68('0x13')](0x1f4,_0x2c74e4['message']));});});}; \ No newline at end of file +var _0x546e=['catch','SquareRecording','create','body','options','raw','CreateSquareRecording','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','result'];(function(_0x5d2abe,_0x160143){var _0x5a0cea=function(_0x41ce69){while(--_0x41ce69){_0x5d2abe['push'](_0x5d2abe['shift']());}};_0x5a0cea(++_0x160143);}(_0x546e,0x1ab));var _0xe546=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x546e[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xe546('0x0'));var util=require(_0xe546('0x1'));var moment=require(_0xe546('0x2'));var BPromise=require('bluebird');var rs=require(_0xe546('0x3'));var fs=require('fs');var Redis=require(_0xe546('0x4'));var db=require(_0xe546('0x5'))['db'];var utils=require(_0xe546('0x6'));var logger=require(_0xe546('0x7'))(_0xe546('0x8'));var config=require(_0xe546('0x9'));var jayson=require(_0xe546('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19ea2a,_0x20d68f,_0xff2b29){return new BPromise(function(_0x2a0a25,_0x3578a3){return client[_0xe546('0xb')](_0x19ea2a,_0xff2b29)[_0xe546('0xc')](function(_0x2f2f73){logger[_0xe546('0xd')]('SquareRecording,\x20%s,\x20%s',_0x20d68f,_0xe546('0xe'));logger[_0xe546('0xf')](_0xe546('0x10'),_0x20d68f,_0xe546('0xe'),JSON[_0xe546('0x11')](_0x2f2f73));if(_0x2f2f73[_0xe546('0x12')]){if(_0x2f2f73['error'][_0xe546('0x13')]===0x1f4){logger[_0xe546('0x12')](_0xe546('0x14'),_0x20d68f,_0x2f2f73[_0xe546('0x12')][_0xe546('0x15')]);return _0x3578a3(_0x2f2f73[_0xe546('0x12')][_0xe546('0x15')]);}logger[_0xe546('0x12')](_0xe546('0x14'),_0x20d68f,_0x2f2f73['error'][_0xe546('0x15')]);return _0x2a0a25(_0x2f2f73[_0xe546('0x12')][_0xe546('0x15')]);}else{logger['info'](_0xe546('0x14'),_0x20d68f,_0xe546('0xe'));_0x2a0a25(_0x2f2f73[_0xe546('0x16')]['message']);}})[_0xe546('0x17')](function(_0x2d86d9){logger[_0xe546('0x12')](_0xe546('0x14'),_0x20d68f,_0x2d86d9);_0x3578a3(_0x2d86d9);});});}exports['CreateSquareRecording']=function(_0x5606ca){var _0x50240b=this;return new Promise(function(_0xb9f42e,_0xb26703){return db[_0xe546('0x18')][_0xe546('0x19')](_0x5606ca[_0xe546('0x1a')],{'raw':_0x5606ca[_0xe546('0x1b')]?_0x5606ca[_0xe546('0x1b')][_0xe546('0x1c')]===undefined?!![]:![]:!![]})[_0xe546('0xc')](function(_0xefb00e){logger[_0xe546('0xd')]('CreateSquareRecording',_0x5606ca);logger[_0xe546('0xf')]('CreateSquareRecording',_0x5606ca,JSON['stringify'](_0xefb00e));_0xb9f42e(_0xefb00e);})[_0xe546('0x17')](function(_0x1afb6b){logger[_0xe546('0x12')](_0xe546('0x1d'),_0x1afb6b['message'],_0x5606ca);_0xb26703(_0x50240b[_0xe546('0x12')](0x1f4,_0x1afb6b[_0xe546('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index adaa847..5499809 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 _0x2c48=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','update','destroy','multer','util','path','connect-timeout'];(function(_0x3b453a,_0x112c93){var _0x2642ea=function(_0x40ff5b){while(--_0x40ff5b){_0x3b453a['push'](_0x3b453a['shift']());}};_0x2642ea(++_0x112c93);}(_0x2c48,0x114));var _0x82c4=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0x2c48[_0x1ee9a1];return _0x21270f;};'use strict';var multer=require(_0x82c4('0x0'));var util=require(_0x82c4('0x1'));var path=require(_0x82c4('0x2'));var timeout=require(_0x82c4('0x3'));var express=require('express');var router=express[_0x82c4('0x4')]();var auth=require(_0x82c4('0x5'));var interaction=require(_0x82c4('0x6'));var config=require(_0x82c4('0x7'));var controller=require(_0x82c4('0x8'));router['get']('/',auth[_0x82c4('0x9')](),controller[_0x82c4('0xa')]);router[_0x82c4('0xb')](_0x82c4('0xc'),auth['isAuthenticated'](),controller[_0x82c4('0xd')]);router['get'](_0x82c4('0xe'),auth[_0x82c4('0x9')](),controller[_0x82c4('0xf')]);router[_0x82c4('0x10')]('/',auth[_0x82c4('0x9')](),controller[_0x82c4('0x11')]);router['put']('/:id',auth[_0x82c4('0x9')](),controller[_0x82c4('0x12')]);router['delete']('/:id',auth[_0x82c4('0x9')](),controller[_0x82c4('0x13')]);module['exports']=router; \ No newline at end of file +var _0xcb37=['delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./squareReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create'];(function(_0x28a2fd,_0x1a153a){var _0x37e8a8=function(_0x286c40){while(--_0x286c40){_0x28a2fd['push'](_0x28a2fd['shift']());}};_0x37e8a8(++_0x1a153a);}(_0xcb37,0x179));var _0x7cb3=function(_0x553f0e,_0x4938e1){_0x553f0e=_0x553f0e-0x0;var _0x138c13=_0xcb37[_0x553f0e];return _0x138c13;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7cb3('0x0'));var timeout=require(_0x7cb3('0x1'));var express=require(_0x7cb3('0x2'));var router=express['Router']();var auth=require(_0x7cb3('0x3'));var interaction=require(_0x7cb3('0x4'));var config=require('../../config/environment');var controller=require(_0x7cb3('0x5'));router[_0x7cb3('0x6')]('/',auth[_0x7cb3('0x7')](),controller[_0x7cb3('0x8')]);router[_0x7cb3('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x7cb3('0x9')]);router[_0x7cb3('0x6')](_0x7cb3('0xa'),auth[_0x7cb3('0x7')](),controller[_0x7cb3('0xb')]);router[_0x7cb3('0xc')]('/',auth['isAuthenticated'](),controller[_0x7cb3('0xd')]);router['put'](_0x7cb3('0xa'),auth[_0x7cb3('0x7')](),controller['update']);router[_0x7cb3('0xe')](_0x7cb3('0xa'),auth[_0x7cb3('0x7')](),controller[_0x7cb3('0xf')]);module[_0x7cb3('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index c6b9a82..3cd876a 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 _0x1252=['STRING','DATE','BOOLEAN','sequelize'];(function(_0x41ffd7,_0x51c117){var _0x2c3bfd=function(_0x471ce2){while(--_0x471ce2){_0x41ffd7['push'](_0x41ffd7['shift']());}};_0x2c3bfd(++_0x51c117);}(_0x1252,0x1d3));var _0x2125=function(_0x2903dd,_0x2202b1){_0x2903dd=_0x2903dd-0x0;var _0x4703fd=_0x1252[_0x2903dd];return _0x4703fd;};'use strict';var Sequelize=require(_0x2125('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x2125('0x1')]},'request':{'type':Sequelize[_0x2125('0x1')]},'channel':{'type':Sequelize[_0x2125('0x1')]},'language':{'type':Sequelize[_0x2125('0x1')]},'type':{'type':Sequelize[_0x2125('0x1')]},'uniqueid':{'type':Sequelize[_0x2125('0x1')]},'version':{'type':Sequelize[_0x2125('0x1')]},'callerid':{'type':Sequelize[_0x2125('0x1')]},'calleridname':{'type':Sequelize[_0x2125('0x1')]},'callingpres':{'type':Sequelize[_0x2125('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x2125('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x2125('0x1')]},'rdnis':{'type':Sequelize[_0x2125('0x1')]},'context':{'type':Sequelize[_0x2125('0x1')]},'extension':{'type':Sequelize[_0x2125('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x2125('0x1')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x2125('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x2125('0x2')]},'bot':{'type':Sequelize[_0x2125('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xee19=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x2b97ef,_0x5e817d){var _0x4e273f=function(_0x279eb8){while(--_0x279eb8){_0x2b97ef['push'](_0x2b97ef['shift']());}};_0x4e273f(++_0x5e817d);}(_0xee19,0x14a));var _0x9ee1=function(_0x519a00,_0x184278){_0x519a00=_0x519a00-0x0;var _0xd2971f=_0xee19[_0x519a00];return _0xd2971f;};'use strict';var Sequelize=require(_0x9ee1('0x0'));module[_0x9ee1('0x1')]={'network':{'type':Sequelize[_0x9ee1('0x2')]},'network_script':{'type':Sequelize[_0x9ee1('0x2')]},'request':{'type':Sequelize[_0x9ee1('0x2')]},'channel':{'type':Sequelize[_0x9ee1('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9ee1('0x2')]},'uniqueid':{'type':Sequelize[_0x9ee1('0x2')]},'version':{'type':Sequelize[_0x9ee1('0x2')]},'callerid':{'type':Sequelize[_0x9ee1('0x2')]},'calleridname':{'type':Sequelize[_0x9ee1('0x2')]},'callingpres':{'type':Sequelize[_0x9ee1('0x2')]},'callingani2':{'type':Sequelize[_0x9ee1('0x2')]},'callington':{'type':Sequelize[_0x9ee1('0x2')]},'callingtns':{'type':Sequelize[_0x9ee1('0x2')]},'dnid':{'type':Sequelize[_0x9ee1('0x2')]},'rdnis':{'type':Sequelize[_0x9ee1('0x2')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x9ee1('0x2')]},'priority':{'type':Sequelize[_0x9ee1('0x2')]},'enhanced':{'type':Sequelize[_0x9ee1('0x2')]},'accountcode':{'type':Sequelize[_0x9ee1('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x9ee1('0x2')]},'joinAt':{'type':Sequelize[_0x9ee1('0x3')]},'leaveAt':{'type':Sequelize[_0x9ee1('0x3')]},'bot':{'type':Sequelize[_0x9ee1('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index c10e474..ea567a3 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 _0x14a5=['bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','Content-Range','apply','then','destroy','error','send','index','map','SquareReport','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','count','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','update','body','describe','html-pdf','eml-format','rimraf','moment'];(function(_0x2b1147,_0x43df7c){var _0x5a0348=function(_0x122ceb){while(--_0x122ceb){_0x2b1147['push'](_0x2b1147['shift']());}};_0x5a0348(++_0x43df7c);}(_0x14a5,0x1e6));var _0x514a=function(_0x117c0e,_0x34e772){_0x117c0e=_0x117c0e-0x0;var _0x2ecd06=_0x14a5[_0x117c0e];return _0x2ecd06;};'use strict';var pdf=require(_0x514a('0x0'));var emlformat=require(_0x514a('0x1'));var rimraf=require(_0x514a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x514a('0x3'));var BPromise=require(_0x514a('0x4'));var Mustache=require(_0x514a('0x5'));var util=require(_0x514a('0x6'));var path=require(_0x514a('0x7'));var sox=require('sox');var csv=require(_0x514a('0x8'));var ejs=require(_0x514a('0x9'));var fs=require('fs');var _=require(_0x514a('0xa'));var squel=require(_0x514a('0xb'));var crypto=require(_0x514a('0xc'));var jsforce=require(_0x514a('0xd'));var deskjs=require(_0x514a('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x514a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x514a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x514a('0x11'));var logger=require(_0x514a('0x12'))('api');var utils=require(_0x514a('0x13'));var config=require(_0x514a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a41eb,_0x55fd67){_0x55fd67=_0x55fd67||0xcc;return function(_0x162843){if(_0x162843){return _0x3a41eb[_0x514a('0x15')](_0x55fd67);}return _0x3a41eb[_0x514a('0x16')](_0x55fd67)[_0x514a('0x17')]();};}function respondWithResult(_0x4cb42f,_0x163135){_0x163135=_0x163135||0xc8;return function(_0x4494ba){if(_0x4494ba){return _0x4cb42f[_0x514a('0x16')](_0x163135)[_0x514a('0x18')](_0x4494ba);}};}function respondWithFilteredResult(_0xbe6ed4,_0x46c25b){return function(_0x4461e8){if(_0x4461e8){var _0x518ff5=_0x4461e8['count'],_0x2a8239=_0x46c25b[_0x514a('0x19')],_0x37cefc=_0x46c25b[_0x514a('0x19')]+_0x46c25b[_0x514a('0x1a')],_0x92597e;if(_0x37cefc>=_0x518ff5){_0x37cefc=_0x518ff5;_0x92597e=0xc8;}else{_0x92597e=0xce;}_0xbe6ed4[_0x514a('0x16')](_0x92597e);return _0xbe6ed4['set'](_0x514a('0x1b'),_0x2a8239+'-'+_0x37cefc+'/'+_0x518ff5)['json'](_0x4461e8);}return null;};}function patchUpdates(_0x52641b){return function(_0x3b164d){try{jsonpatch[_0x514a('0x1c')](_0x3b164d,_0x52641b,!![]);}catch(_0x2f2a0d){return BPromise['reject'](_0x2f2a0d);}return _0x3b164d['save']();};}function saveUpdates(_0x52c6dc,_0x4b72c5){return function(_0x1fd1ab){if(_0x1fd1ab){return _0x1fd1ab['update'](_0x52c6dc)[_0x514a('0x1d')](function(_0x1f387a){return _0x1f387a;});}return null;};}function removeEntity(_0x583ccb,_0x427471){return function(_0x5c125d){if(_0x5c125d){return _0x5c125d[_0x514a('0x1e')]()[_0x514a('0x1d')](function(){_0x583ccb[_0x514a('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x515923,_0x5cd06a){return function(_0x56425d){if(!_0x56425d){_0x515923['sendStatus'](0x194);}return _0x56425d;};}function handleError(_0x364bc6,_0x407d7d){_0x407d7d=_0x407d7d||0x1f4;return function(_0x1d07ab){logger[_0x514a('0x1f')](_0x1d07ab['stack']);if(_0x1d07ab['name']){delete _0x1d07ab['name'];}_0x364bc6[_0x514a('0x16')](_0x407d7d)[_0x514a('0x20')](_0x1d07ab);};}exports[_0x514a('0x21')]=function(_0x41cbb7,_0x46d58b){var _0x214ee5={},_0x1e673a={},_0x1337f4={'count':0x0,'rows':[]};var _0x444bc2=_[_0x514a('0x22')](db[_0x514a('0x23')]['rawAttributes'],function(_0x580177){return{'name':_0x580177[_0x514a('0x24')],'type':_0x580177[_0x514a('0x25')][_0x514a('0x26')]};});_0x1e673a[_0x514a('0x27')]=_[_0x514a('0x22')](_0x444bc2,_0x514a('0x28'));_0x1e673a[_0x514a('0x29')]=_[_0x514a('0x2a')](_0x41cbb7[_0x514a('0x29')]);_0x1e673a['filters']=_[_0x514a('0x2b')](_0x1e673a[_0x514a('0x27')],_0x1e673a['query']);_0x214ee5[_0x514a('0x2c')]=_[_0x514a('0x2b')](_0x1e673a[_0x514a('0x27')],qs[_0x514a('0x2d')](_0x41cbb7[_0x514a('0x29')][_0x514a('0x2d')]));_0x214ee5[_0x514a('0x2c')]=_0x214ee5[_0x514a('0x2c')][_0x514a('0x2e')]?_0x214ee5[_0x514a('0x2c')]:_0x1e673a[_0x514a('0x27')];if(!_0x41cbb7['query'][_0x514a('0x2f')]('nolimit')){_0x214ee5[_0x514a('0x1a')]=qs[_0x514a('0x1a')](_0x41cbb7[_0x514a('0x29')][_0x514a('0x1a')]);_0x214ee5[_0x514a('0x19')]=qs['offset'](_0x41cbb7[_0x514a('0x29')][_0x514a('0x19')]);}_0x214ee5[_0x514a('0x30')]=qs[_0x514a('0x31')](_0x41cbb7[_0x514a('0x29')][_0x514a('0x31')]);_0x214ee5[_0x514a('0x32')]=qs[_0x514a('0x33')](_[_0x514a('0x34')](_0x41cbb7[_0x514a('0x29')],_0x1e673a['filters']),_0x444bc2);if(_0x41cbb7[_0x514a('0x29')]['filter']){_0x214ee5[_0x514a('0x32')]=_['merge'](_0x214ee5[_0x514a('0x32')],{'$or':_[_0x514a('0x22')](_0x444bc2,function(_0x2e4c1c){if(_0x2e4c1c[_0x514a('0x25')]!==_0x514a('0x35')){var _0x3b1193={};_0x3b1193[_0x2e4c1c[_0x514a('0x28')]]={'$like':'%'+_0x41cbb7[_0x514a('0x29')][_0x514a('0x36')]+'%'};return _0x3b1193;}})});}_0x214ee5=_[_0x514a('0x37')]({},_0x214ee5,_0x41cbb7[_0x514a('0x38')]);var _0x5aee2d={'where':_0x214ee5['where']};return db['SquareReport'][_0x514a('0x39')](_0x5aee2d)[_0x514a('0x1d')](function(_0xddf3da){_0x1337f4[_0x514a('0x39')]=_0xddf3da;if(_0x41cbb7[_0x514a('0x29')][_0x514a('0x3a')]){_0x214ee5[_0x514a('0x3b')]=[{'all':!![]}];}return db[_0x514a('0x23')][_0x514a('0x3c')](_0x214ee5);})[_0x514a('0x1d')](function(_0x4c9baf){_0x1337f4[_0x514a('0x3d')]=_0x4c9baf;return _0x1337f4;})[_0x514a('0x1d')](respondWithFilteredResult(_0x46d58b,_0x214ee5))['catch'](handleError(_0x46d58b,null));};exports['show']=function(_0x413f75,_0x29839a){var _0x152df8={'raw':!![],'where':{'id':_0x413f75[_0x514a('0x3e')]['id']}},_0x2dd45d={};_0x2dd45d[_0x514a('0x27')]=_[_0x514a('0x2a')](db['SquareReport'][_0x514a('0x3f')]);_0x2dd45d[_0x514a('0x29')]=_[_0x514a('0x2a')](_0x413f75[_0x514a('0x29')]);_0x2dd45d['filters']=_[_0x514a('0x2b')](_0x2dd45d['model'],_0x2dd45d[_0x514a('0x29')]);_0x152df8[_0x514a('0x2c')]=_['intersection'](_0x2dd45d[_0x514a('0x27')],qs[_0x514a('0x2d')](_0x413f75[_0x514a('0x29')][_0x514a('0x2d')]));_0x152df8['attributes']=_0x152df8[_0x514a('0x2c')]['length']?_0x152df8[_0x514a('0x2c')]:_0x2dd45d[_0x514a('0x27')];if(_0x413f75[_0x514a('0x29')][_0x514a('0x3a')]){_0x152df8[_0x514a('0x3b')]=[{'all':!![]}];}_0x152df8=_[_0x514a('0x37')]({},_0x152df8,_0x413f75['options']);return db['SquareReport'][_0x514a('0x40')](_0x152df8)[_0x514a('0x1d')](handleEntityNotFound(_0x29839a,null))['then'](respondWithResult(_0x29839a,null))[_0x514a('0x41')](handleError(_0x29839a,null));};exports['create']=function(_0x3b1c9c,_0x559cf5){return db[_0x514a('0x23')][_0x514a('0x42')](_0x3b1c9c['body'],{})[_0x514a('0x1d')](respondWithResult(_0x559cf5,0xc9))[_0x514a('0x41')](handleError(_0x559cf5,null));};exports[_0x514a('0x43')]=function(_0x31ece3,_0x5c06c1){if(_0x31ece3['body']['id']){delete _0x31ece3[_0x514a('0x44')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x31ece3[_0x514a('0x3e')]['id']}})[_0x514a('0x1d')](handleEntityNotFound(_0x5c06c1,null))[_0x514a('0x1d')](saveUpdates(_0x31ece3[_0x514a('0x44')],null))['then'](respondWithResult(_0x5c06c1,null))[_0x514a('0x41')](handleError(_0x5c06c1,null));};exports[_0x514a('0x1e')]=function(_0x4b0700,_0x12bb7a){return db[_0x514a('0x23')]['find']({'where':{'id':_0x4b0700[_0x514a('0x3e')]['id']}})[_0x514a('0x1d')](handleEntityNotFound(_0x12bb7a,null))[_0x514a('0x1d')](removeEntity(_0x12bb7a,null))[_0x514a('0x41')](handleError(_0x12bb7a,null));};exports[_0x514a('0x45')]=function(_0xdc625e,_0x3323ec){return db[_0x514a('0x23')][_0x514a('0x45')]()[_0x514a('0x1d')](respondWithResult(_0x3323ec,null))['catch'](handleError(_0x3323ec,null));}; \ No newline at end of file +var _0xd11d=['create','body','find','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','index','map','SquareReport','rawAttributes','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','show','keys'];(function(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_0xd11d,0x17c));var _0xdd11=function(_0xbccb8e,_0x160d61){_0xbccb8e=_0xbccb8e-0x0;var _0x35103e=_0xd11d[_0xbccb8e];return _0x35103e;};'use strict';var pdf=require(_0xdd11('0x0'));var emlformat=require(_0xdd11('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdd11('0x2'));var jsonpatch=require(_0xdd11('0x3'));var rp=require(_0xdd11('0x4'));var moment=require(_0xdd11('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdd11('0x6'));var util=require(_0xdd11('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdd11('0x8'));var ejs=require(_0xdd11('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdd11('0xa'));var crypto=require('crypto');var jsforce=require(_0xdd11('0xb'));var deskjs=require(_0xdd11('0xc'));var toCsv=require(_0xdd11('0x8'));var querystring=require(_0xdd11('0xd'));var Papa=require(_0xdd11('0xe'));var Redis=require(_0xdd11('0xf'));var authService=require(_0xdd11('0x10'));var qs=require(_0xdd11('0x11'));var as=require(_0xdd11('0x12'));var hardwareService=require(_0xdd11('0x13'));var logger=require(_0xdd11('0x14'))(_0xdd11('0x15'));var utils=require(_0xdd11('0x16'));var config=require(_0xdd11('0x17'));var db=require(_0xdd11('0x18'))['db'];function respondWithStatusCode(_0x4ac31e,_0x4dd5e8){_0x4dd5e8=_0x4dd5e8||0xcc;return function(_0x224572){if(_0x224572){return _0x4ac31e[_0xdd11('0x19')](_0x4dd5e8);}return _0x4ac31e[_0xdd11('0x1a')](_0x4dd5e8)[_0xdd11('0x1b')]();};}function respondWithResult(_0x3969df,_0x48505b){_0x48505b=_0x48505b||0xc8;return function(_0x4d77dc){if(_0x4d77dc){return _0x3969df['status'](_0x48505b)[_0xdd11('0x1c')](_0x4d77dc);}};}function respondWithFilteredResult(_0x16850a,_0x156c64){return function(_0x439957){if(_0x439957){var _0x4fa007=_0x439957['count'],_0x2a5f3b=_0x156c64['offset'],_0x541f26=_0x156c64[_0xdd11('0x1d')]+_0x156c64[_0xdd11('0x1e')],_0x1cecfd;if(_0x541f26>=_0x4fa007){_0x541f26=_0x4fa007;_0x1cecfd=0xc8;}else{_0x1cecfd=0xce;}_0x16850a[_0xdd11('0x1a')](_0x1cecfd);return _0x16850a[_0xdd11('0x1f')](_0xdd11('0x20'),_0x2a5f3b+'-'+_0x541f26+'/'+_0x4fa007)[_0xdd11('0x1c')](_0x439957);}return null;};}function patchUpdates(_0x2e46cc){return function(_0x1625ce){try{jsonpatch['apply'](_0x1625ce,_0x2e46cc,!![]);}catch(_0x74c4cf){return BPromise[_0xdd11('0x21')](_0x74c4cf);}return _0x1625ce['save']();};}function saveUpdates(_0x274bf8,_0x466e85){return function(_0x1b484f){if(_0x1b484f){return _0x1b484f[_0xdd11('0x22')](_0x274bf8)[_0xdd11('0x23')](function(_0x3c0453){return _0x3c0453;});}return null;};}function removeEntity(_0x132e23,_0x4cba53){return function(_0x4fba13){if(_0x4fba13){return _0x4fba13[_0xdd11('0x24')]()[_0xdd11('0x23')](function(){_0x132e23[_0xdd11('0x1a')](0xcc)[_0xdd11('0x1b')]();});}};}function handleEntityNotFound(_0x423227,_0x517a03){return function(_0x3e930b){if(!_0x3e930b){_0x423227[_0xdd11('0x19')](0x194);}return _0x3e930b;};}function handleError(_0x4b2bff,_0x1fc76a){_0x1fc76a=_0x1fc76a||0x1f4;return function(_0xe1d111){logger['error'](_0xe1d111[_0xdd11('0x25')]);if(_0xe1d111[_0xdd11('0x26')]){delete _0xe1d111[_0xdd11('0x26')];}_0x4b2bff[_0xdd11('0x1a')](_0x1fc76a)[_0xdd11('0x27')](_0xe1d111);};}exports[_0xdd11('0x28')]=function(_0x51998e,_0x2d03bb){var _0x3135e4={},_0x169009={},_0x310f74={'count':0x0,'rows':[]};var _0x45114c=_[_0xdd11('0x29')](db[_0xdd11('0x2a')][_0xdd11('0x2b')],function(_0x500be2){return{'name':_0x500be2['fieldName'],'type':_0x500be2['type'][_0xdd11('0x2c')]};});_0x169009['model']=_[_0xdd11('0x29')](_0x45114c,_0xdd11('0x26'));_0x169009[_0xdd11('0x2d')]=_['keys'](_0x51998e[_0xdd11('0x2d')]);_0x169009[_0xdd11('0x2e')]=_[_0xdd11('0x2f')](_0x169009[_0xdd11('0x30')],_0x169009[_0xdd11('0x2d')]);_0x3135e4[_0xdd11('0x31')]=_[_0xdd11('0x2f')](_0x169009[_0xdd11('0x30')],qs[_0xdd11('0x32')](_0x51998e['query'][_0xdd11('0x32')]));_0x3135e4[_0xdd11('0x31')]=_0x3135e4[_0xdd11('0x31')][_0xdd11('0x33')]?_0x3135e4[_0xdd11('0x31')]:_0x169009['model'];if(!_0x51998e[_0xdd11('0x2d')][_0xdd11('0x34')](_0xdd11('0x35'))){_0x3135e4[_0xdd11('0x1e')]=qs[_0xdd11('0x1e')](_0x51998e['query']['limit']);_0x3135e4['offset']=qs[_0xdd11('0x1d')](_0x51998e[_0xdd11('0x2d')][_0xdd11('0x1d')]);}_0x3135e4[_0xdd11('0x36')]=qs[_0xdd11('0x37')](_0x51998e['query']['sort']);_0x3135e4[_0xdd11('0x38')]=qs['filters'](_[_0xdd11('0x39')](_0x51998e['query'],_0x169009[_0xdd11('0x2e')]),_0x45114c);if(_0x51998e[_0xdd11('0x2d')][_0xdd11('0x3a')]){_0x3135e4[_0xdd11('0x38')]=_[_0xdd11('0x3b')](_0x3135e4[_0xdd11('0x38')],{'$or':_['map'](_0x45114c,function(_0xef62ae){if(_0xef62ae[_0xdd11('0x3c')]!==_0xdd11('0x3d')){var _0x2ff345={};_0x2ff345[_0xef62ae[_0xdd11('0x26')]]={'$like':'%'+_0x51998e[_0xdd11('0x2d')][_0xdd11('0x3a')]+'%'};return _0x2ff345;}})});}_0x3135e4=_[_0xdd11('0x3b')]({},_0x3135e4,_0x51998e[_0xdd11('0x3e')]);var _0x2f8779={'where':_0x3135e4['where']};return db[_0xdd11('0x2a')][_0xdd11('0x3f')](_0x2f8779)[_0xdd11('0x23')](function(_0xaa35dd){_0x310f74[_0xdd11('0x3f')]=_0xaa35dd;if(_0x51998e[_0xdd11('0x2d')][_0xdd11('0x40')]){_0x3135e4[_0xdd11('0x41')]=[{'all':!![]}];}return db[_0xdd11('0x2a')]['findAll'](_0x3135e4);})[_0xdd11('0x23')](function(_0x228796){_0x310f74[_0xdd11('0x42')]=_0x228796;return _0x310f74;})[_0xdd11('0x23')](respondWithFilteredResult(_0x2d03bb,_0x3135e4))[_0xdd11('0x43')](handleError(_0x2d03bb,null));};exports[_0xdd11('0x44')]=function(_0x288e07,_0x37948b){var _0xcc920d={'raw':!![],'where':{'id':_0x288e07['params']['id']}},_0x5ee770={};_0x5ee770['model']=_['keys'](db[_0xdd11('0x2a')][_0xdd11('0x2b')]);_0x5ee770[_0xdd11('0x2d')]=_[_0xdd11('0x45')](_0x288e07[_0xdd11('0x2d')]);_0x5ee770[_0xdd11('0x2e')]=_[_0xdd11('0x2f')](_0x5ee770[_0xdd11('0x30')],_0x5ee770[_0xdd11('0x2d')]);_0xcc920d[_0xdd11('0x31')]=_[_0xdd11('0x2f')](_0x5ee770[_0xdd11('0x30')],qs[_0xdd11('0x32')](_0x288e07[_0xdd11('0x2d')][_0xdd11('0x32')]));_0xcc920d[_0xdd11('0x31')]=_0xcc920d['attributes']['length']?_0xcc920d[_0xdd11('0x31')]:_0x5ee770[_0xdd11('0x30')];if(_0x288e07[_0xdd11('0x2d')][_0xdd11('0x40')]){_0xcc920d[_0xdd11('0x41')]=[{'all':!![]}];}_0xcc920d=_[_0xdd11('0x3b')]({},_0xcc920d,_0x288e07[_0xdd11('0x3e')]);return db[_0xdd11('0x2a')]['find'](_0xcc920d)['then'](handleEntityNotFound(_0x37948b,null))['then'](respondWithResult(_0x37948b,null))[_0xdd11('0x43')](handleError(_0x37948b,null));};exports[_0xdd11('0x46')]=function(_0x2afb4e,_0x38bd5d){return db[_0xdd11('0x2a')][_0xdd11('0x46')](_0x2afb4e['body'],{})['then'](respondWithResult(_0x38bd5d,0xc9))[_0xdd11('0x43')](handleError(_0x38bd5d,null));};exports['update']=function(_0x574387,_0x85d48f){if(_0x574387['body']['id']){delete _0x574387[_0xdd11('0x47')]['id'];}return db[_0xdd11('0x2a')][_0xdd11('0x48')]({'where':{'id':_0x574387[_0xdd11('0x49')]['id']}})[_0xdd11('0x23')](handleEntityNotFound(_0x85d48f,null))['then'](saveUpdates(_0x574387[_0xdd11('0x47')],null))[_0xdd11('0x23')](respondWithResult(_0x85d48f,null))[_0xdd11('0x43')](handleError(_0x85d48f,null));};exports['destroy']=function(_0x513645,_0x35445f){return db[_0xdd11('0x2a')][_0xdd11('0x48')]({'where':{'id':_0x513645[_0xdd11('0x49')]['id']}})['then'](handleEntityNotFound(_0x35445f,null))[_0xdd11('0x23')](removeEntity(_0x35445f,null))[_0xdd11('0x43')](handleError(_0x35445f,null));};exports[_0xdd11('0x4a')]=function(_0x57c329,_0x4182ec){return db[_0xdd11('0x2a')][_0xdd11('0x4a')]()['then'](respondWithResult(_0x4182ec,null))[_0xdd11('0x43')](handleError(_0x4182ec,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 18ea7fd..2463b14 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 _0x2976=['moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport','report_square','uid_pname','project_name','leaveAt','lodash','../../config/logger','api'];(function(_0x11e1ab,_0x4bb093){var _0x530ca0=function(_0x329d8b){while(--_0x329d8b){_0x11e1ab['push'](_0x11e1ab['shift']());}};_0x530ca0(++_0x4bb093);}(_0x2976,0xb1));var _0x6297=function(_0x4c500f,_0x1f381e){_0x4c500f=_0x4c500f-0x0;var _0x5b35a0=_0x2976[_0x4c500f];return _0x5b35a0;};'use strict';var _=require(_0x6297('0x0'));var util=require('util');var logger=require(_0x6297('0x1'))(_0x6297('0x2'));var moment=require(_0x6297('0x3'));var BPromise=require(_0x6297('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6297('0x5'));var rimraf=require(_0x6297('0x6'));var config=require(_0x6297('0x7'));var attributes=require(_0x6297('0x8'));module['exports']=function(_0x29e78d,_0x5e87cd){return _0x29e78d[_0x6297('0x9')](_0x6297('0xa'),attributes,{'tableName':_0x6297('0xb'),'paranoid':![],'indexes':[{'name':_0x6297('0xc'),'fields':['uniqueid',_0x6297('0xd')]},{'name':_0x6297('0xe'),'fields':[_0x6297('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa79e=['api','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger'];(function(_0x2eae44,_0x4ef939){var _0x842cfd=function(_0x46e898){while(--_0x46e898){_0x2eae44['push'](_0x2eae44['shift']());}};_0x842cfd(++_0x4ef939);}(_0xa79e,0x14d));var _0xea79=function(_0x2e6dbf,_0x57dd06){_0x2e6dbf=_0x2e6dbf-0x0;var _0x2680e5=_0xa79e[_0x2e6dbf];return _0x2680e5;};'use strict';var _=require(_0xea79('0x0'));var util=require(_0xea79('0x1'));var logger=require(_0xea79('0x2'))(_0xea79('0x3'));var moment=require('moment');var BPromise=require(_0xea79('0x4'));var rp=require(_0xea79('0x5'));var fs=require('fs');var path=require(_0xea79('0x6'));var rimraf=require(_0xea79('0x7'));var config=require('../../config/environment');var attributes=require(_0xea79('0x8'));module[_0xea79('0x9')]=function(_0x4d7cd4,_0x4320be){return _0x4d7cd4[_0xea79('0xa')]('SquareReport',attributes,{'tableName':_0xea79('0xb'),'paranoid':![],'indexes':[{'name':_0xea79('0xc'),'fields':[_0xea79('0xd'),_0xea79('0xe')]},{'name':'leaveAt','fields':[_0xea79('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 7ad5acc..6a18e45 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 _0xb184=['options','raw','UpdateSquareReport','update','where','limit','util','moment','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateSquareReport','SquareReport','body'];(function(_0x4fe649,_0x177b95){var _0x19cebe=function(_0x24490f){while(--_0x24490f){_0x4fe649['push'](_0x4fe649['shift']());}};_0x19cebe(++_0x177b95);}(_0xb184,0x128));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4b18('0x0'));var moment=require(_0x4b18('0x1'));var BPromise=require(_0x4b18('0x2'));var rs=require(_0x4b18('0x3'));var fs=require('fs');var Redis=require(_0x4b18('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4b18('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4b18('0x6'));var client=jayson[_0x4b18('0x7')][_0x4b18('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2acdc2,_0x3c5499,_0x174527){return new BPromise(function(_0x4306f7,_0x566e7d){return client['request'](_0x2acdc2,_0x174527)[_0x4b18('0x9')](function(_0x5330b6){logger['info'](_0x4b18('0xa'),_0x3c5499,_0x4b18('0xb'));logger[_0x4b18('0xc')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x3c5499,_0x4b18('0xb'),JSON[_0x4b18('0xd')](_0x5330b6));if(_0x5330b6[_0x4b18('0xe')]){if(_0x5330b6[_0x4b18('0xe')][_0x4b18('0xf')]===0x1f4){logger[_0x4b18('0xe')](_0x4b18('0xa'),_0x3c5499,_0x5330b6[_0x4b18('0xe')]['message']);return _0x566e7d(_0x5330b6[_0x4b18('0xe')][_0x4b18('0x10')]);}logger[_0x4b18('0xe')]('SquareReport,\x20%s,\x20%s',_0x3c5499,_0x5330b6[_0x4b18('0xe')]['message']);return _0x4306f7(_0x5330b6[_0x4b18('0xe')][_0x4b18('0x10')]);}else{logger[_0x4b18('0x11')](_0x4b18('0xa'),_0x3c5499,'request\x20sent');_0x4306f7(_0x5330b6[_0x4b18('0x12')][_0x4b18('0x10')]);}})[_0x4b18('0x13')](function(_0x57c4de){logger[_0x4b18('0xe')](_0x4b18('0xa'),_0x3c5499,_0x57c4de);_0x566e7d(_0x57c4de);});});}exports[_0x4b18('0x14')]=function(_0x5dd77b){var _0x1ca0bf=this;return new Promise(function(_0x2bcc89,_0x173ea1){return db[_0x4b18('0x15')]['create'](_0x5dd77b[_0x4b18('0x16')],{'raw':_0x5dd77b[_0x4b18('0x17')]?_0x5dd77b[_0x4b18('0x17')][_0x4b18('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x5a2ed0){logger[_0x4b18('0x11')]('CreateSquareReport',_0x5dd77b);logger[_0x4b18('0xc')]('CreateSquareReport',_0x5dd77b,JSON['stringify'](_0x5a2ed0));_0x2bcc89(_0x5a2ed0);})[_0x4b18('0x13')](function(_0x4e6225){logger[_0x4b18('0xe')](_0x4b18('0x14'),_0x4e6225[_0x4b18('0x10')],_0x5dd77b);_0x173ea1(_0x1ca0bf[_0x4b18('0xe')](0x1f4,_0x4e6225[_0x4b18('0x10')]));});});};exports[_0x4b18('0x19')]=function(_0x5a7253){var _0xb74651=this;return new Promise(function(_0x3a0b16,_0x41ab00){return db[_0x4b18('0x15')][_0x4b18('0x1a')](_0x5a7253[_0x4b18('0x16')],{'raw':_0x5a7253['options']?_0x5a7253['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a7253[_0x4b18('0x17')]?_0x5a7253[_0x4b18('0x17')][_0x4b18('0x1b')]||null:null,'attributes':_0x5a7253[_0x4b18('0x17')]?_0x5a7253[_0x4b18('0x17')]['attributes']||null:null,'limit':_0x5a7253['options']?_0x5a7253[_0x4b18('0x17')][_0x4b18('0x1c')]||null:null})[_0x4b18('0x9')](function(_0x30fc6a){logger[_0x4b18('0x11')](_0x4b18('0x19'),_0x5a7253);logger['debug'](_0x4b18('0x19'),_0x5a7253,JSON[_0x4b18('0xd')](_0x30fc6a));_0x3a0b16(_0x30fc6a);})[_0x4b18('0x13')](function(_0x1cd28d){logger[_0x4b18('0xe')](_0x4b18('0x19'),_0x1cd28d[_0x4b18('0x10')],_0x5a7253);_0x41ab00(_0xb74651['error'](0x1f4,_0x1cd28d[_0x4b18('0x10')]));});});}; \ No newline at end of file +var _0x401d=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','UpdateSquareReport','update','where','lodash','util','moment','bluebird','randomstring'];(function(_0x52cfc6,_0x520620){var _0x1076c1=function(_0x4bf46f){while(--_0x4bf46f){_0x52cfc6['push'](_0x52cfc6['shift']());}};_0x1076c1(++_0x520620);}(_0x401d,0x1c9));var _0xd401=function(_0x3920fe,_0x241aa5){_0x3920fe=_0x3920fe-0x0;var _0x2d9783=_0x401d[_0x3920fe];return _0x2d9783;};'use strict';var _=require(_0xd401('0x0'));var util=require(_0xd401('0x1'));var moment=require(_0xd401('0x2'));var BPromise=require(_0xd401('0x3'));var rs=require(_0xd401('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd401('0x5'))['db'];var utils=require(_0xd401('0x6'));var logger=require(_0xd401('0x7'))(_0xd401('0x8'));var config=require(_0xd401('0x9'));var jayson=require(_0xd401('0xa'));var client=jayson['client'][_0xd401('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e6e1b,_0x594bab,_0xdfbe03){return new BPromise(function(_0x7160f4,_0x483aac){return client['request'](_0x2e6e1b,_0xdfbe03)[_0xd401('0xc')](function(_0x323dac){logger['info'](_0xd401('0xd'),_0x594bab,_0xd401('0xe'));logger[_0xd401('0xf')](_0xd401('0x10'),_0x594bab,_0xd401('0xe'),JSON[_0xd401('0x11')](_0x323dac));if(_0x323dac[_0xd401('0x12')]){if(_0x323dac[_0xd401('0x12')][_0xd401('0x13')]===0x1f4){logger['error']('SquareReport,\x20%s,\x20%s',_0x594bab,_0x323dac[_0xd401('0x12')]['message']);return _0x483aac(_0x323dac[_0xd401('0x12')]['message']);}logger[_0xd401('0x12')]('SquareReport,\x20%s,\x20%s',_0x594bab,_0x323dac[_0xd401('0x12')][_0xd401('0x14')]);return _0x7160f4(_0x323dac['error']['message']);}else{logger[_0xd401('0x15')](_0xd401('0xd'),_0x594bab,_0xd401('0xe'));_0x7160f4(_0x323dac[_0xd401('0x16')][_0xd401('0x14')]);}})[_0xd401('0x17')](function(_0x3071b2){logger['error'](_0xd401('0xd'),_0x594bab,_0x3071b2);_0x483aac(_0x3071b2);});});}exports[_0xd401('0x18')]=function(_0x14ad4b){var _0x364acd=this;return new Promise(function(_0x3ee2d3,_0x5778cd){return db[_0xd401('0x19')][_0xd401('0x1a')](_0x14ad4b[_0xd401('0x1b')],{'raw':_0x14ad4b[_0xd401('0x1c')]?_0x14ad4b[_0xd401('0x1c')][_0xd401('0x1d')]===undefined?!![]:![]:!![]})[_0xd401('0xc')](function(_0x3aa243){logger['info']('CreateSquareReport',_0x14ad4b);logger[_0xd401('0xf')](_0xd401('0x18'),_0x14ad4b,JSON[_0xd401('0x11')](_0x3aa243));_0x3ee2d3(_0x3aa243);})[_0xd401('0x17')](function(_0x9eca71){logger[_0xd401('0x12')](_0xd401('0x18'),_0x9eca71[_0xd401('0x14')],_0x14ad4b);_0x5778cd(_0x364acd['error'](0x1f4,_0x9eca71[_0xd401('0x14')]));});});};exports[_0xd401('0x1e')]=function(_0x1b5237){var _0x36d6ca=this;return new Promise(function(_0x3bb62a,_0x24ccc3){return db[_0xd401('0x19')][_0xd401('0x1f')](_0x1b5237[_0xd401('0x1b')],{'raw':_0x1b5237['options']?_0x1b5237['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5237['options']?_0x1b5237[_0xd401('0x1c')][_0xd401('0x20')]||null:null,'attributes':_0x1b5237[_0xd401('0x1c')]?_0x1b5237[_0xd401('0x1c')]['attributes']||null:null,'limit':_0x1b5237[_0xd401('0x1c')]?_0x1b5237[_0xd401('0x1c')]['limit']||null:null})[_0xd401('0xc')](function(_0x4372b6){logger[_0xd401('0x15')](_0xd401('0x1e'),_0x1b5237);logger[_0xd401('0xf')](_0xd401('0x1e'),_0x1b5237,JSON[_0xd401('0x11')](_0x4372b6));_0x3bb62a(_0x4372b6);})['catch'](function(_0x2e05d7){logger['error'](_0xd401('0x1e'),_0x2e05d7[_0xd401('0x14')],_0x1b5237);_0x24ccc3(_0x36d6ca[_0xd401('0x12')](0x1f4,_0x2e05d7['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 4cbfbc2..f505cc0 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 _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x108cfa,_0x543231){var _0x2f231b=function(_0x39d28f){while(--_0x39d28f){_0x108cfa['push'](_0x108cfa['shift']());}};_0x2f231b(++_0x543231);}(_0x7a54,0x106));var _0x47a5=function(_0x571901,_0x4e9b46){_0x571901=_0x571901-0x0;var _0x4d830e=_0x7a54[_0x571901];return _0x4d830e;};'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 auth=require('../../components/auth/service');var interaction=require(_0x47a5('0x5'));var config=require(_0x47a5('0x6'));var controller=require(_0x47a5('0x7'));router[_0x47a5('0x8')]('/',auth[_0x47a5('0x9')](),controller['index']);router[_0x47a5('0x8')]('/describe',auth[_0x47a5('0x9')](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file +var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x466f3a,_0x28916e){var _0x3e4109=function(_0x88810){while(--_0x88810){_0x466f3a['push'](_0x466f3a['shift']());}};_0x3e4109(++_0x28916e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x8ebc5a,_0x3b01c2){_0x8ebc5a=_0x8ebc5a-0x0;var _0x20d39f=_0x5f2f[_0x8ebc5a];return _0x20d39f;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 8e93f08..782c839 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 _0xe529=['STRING','TEXT','sequelize','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe529,0xe6));var _0x9e52=function(_0x246af2,_0x734858){_0x246af2=_0x246af2-0x0;var _0x1f6574=_0xe529[_0x246af2];return _0x1f6574;};'use strict';var Sequelize=require(_0x9e52('0x0'));module[_0x9e52('0x1')]={'uniqueid':{'type':Sequelize[_0x9e52('0x2')]},'node':{'type':Sequelize[_0x9e52('0x2')]},'application':{'type':Sequelize[_0x9e52('0x2')]},'data':{'type':Sequelize[_0x9e52('0x3')]},'project_name':{'type':Sequelize[_0x9e52('0x2')]},'callerid':{'type':Sequelize[_0x9e52('0x2')]}}; \ No newline at end of file +var _0x9026=['STRING','exports'];(function(_0x13d0ca,_0x13e4a7){var _0x366dc5=function(_0x334810){while(--_0x334810){_0x13d0ca['push'](_0x13d0ca['shift']());}};_0x366dc5(++_0x13e4a7);}(_0x9026,0x105));var _0x6902=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x9026[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require('sequelize');module[_0x6902('0x0')]={'uniqueid':{'type':Sequelize[_0x6902('0x1')]},'node':{'type':Sequelize[_0x6902('0x1')]},'application':{'type':Sequelize[_0x6902('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x6902('0x1')]},'callerid':{'type':Sequelize[_0x6902('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 12c69e0..5ecc434 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 _0xbc5b=['to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','error','stack','send','index','map','SquareDetailsReport','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','then','include','rows','show','rawAttributes','includeAll','find','catch','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xbc5b,0x8e));var _0xbbc5=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbc5b[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require(_0xbbc5('0x0'));var emlformat=require(_0xbbc5('0x1'));var rimraf=require(_0xbbc5('0x2'));var zipdir=require(_0xbbc5('0x3'));var jsonpatch=require(_0xbbc5('0x4'));var rp=require(_0xbbc5('0x5'));var moment=require(_0xbbc5('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xbbc5('0x7'));var util=require('util');var path=require(_0xbbc5('0x8'));var sox=require(_0xbbc5('0x9'));var csv=require(_0xbbc5('0xa'));var ejs=require(_0xbbc5('0xb'));var fs=require('fs');var _=require(_0xbbc5('0xc'));var squel=require(_0xbbc5('0xd'));var crypto=require('crypto');var jsforce=require(_0xbbc5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbbc5('0xa'));var querystring=require(_0xbbc5('0xf'));var Papa=require(_0xbbc5('0x10'));var Redis=require(_0xbbc5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbbc5('0x12'));var as=require(_0xbbc5('0x13'));var hardwareService=require(_0xbbc5('0x14'));var logger=require(_0xbbc5('0x15'))(_0xbbc5('0x16'));var utils=require(_0xbbc5('0x17'));var config=require(_0xbbc5('0x18'));var db=require(_0xbbc5('0x19'))['db'];function respondWithStatusCode(_0x51e7fa,_0x327f35){_0x327f35=_0x327f35||0xcc;return function(_0x5f8a9b){if(_0x5f8a9b){return _0x51e7fa[_0xbbc5('0x1a')](_0x327f35);}return _0x51e7fa['status'](_0x327f35)[_0xbbc5('0x1b')]();};}function respondWithResult(_0x186a15,_0xed9ebe){_0xed9ebe=_0xed9ebe||0xc8;return function(_0x179c25){if(_0x179c25){return _0x186a15[_0xbbc5('0x1c')](_0xed9ebe)['json'](_0x179c25);}};}function respondWithFilteredResult(_0xa8e223,_0x4accbb){return function(_0xb06d74){if(_0xb06d74){var _0x2fd03b=_0xb06d74[_0xbbc5('0x1d')],_0x508625=_0x4accbb[_0xbbc5('0x1e')],_0x507f96=_0x4accbb[_0xbbc5('0x1e')]+_0x4accbb[_0xbbc5('0x1f')],_0x3bcb3e;if(_0x507f96>=_0x2fd03b){_0x507f96=_0x2fd03b;_0x3bcb3e=0xc8;}else{_0x3bcb3e=0xce;}_0xa8e223[_0xbbc5('0x1c')](_0x3bcb3e);return _0xa8e223[_0xbbc5('0x20')](_0xbbc5('0x21'),_0x508625+'-'+_0x507f96+'/'+_0x2fd03b)[_0xbbc5('0x22')](_0xb06d74);}return null;};}function patchUpdates(_0x42a757){return function(_0x4618a0){try{jsonpatch['apply'](_0x4618a0,_0x42a757,!![]);}catch(_0x4a4d20){return BPromise[_0xbbc5('0x23')](_0x4a4d20);}return _0x4618a0[_0xbbc5('0x24')]();};}function saveUpdates(_0x5189a4,_0x4f2b6b){return function(_0x57f893){if(_0x57f893){return _0x57f893[_0xbbc5('0x25')](_0x5189a4)['then'](function(_0x26c7f3){return _0x26c7f3;});}return null;};}function removeEntity(_0xb43e0b,_0x40b0b1){return function(_0x9e08ce){if(_0x9e08ce){return _0x9e08ce[_0xbbc5('0x26')]()['then'](function(){_0xb43e0b[_0xbbc5('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c2e5c,_0x2a460d){return function(_0x551034){if(!_0x551034){_0x1c2e5c['sendStatus'](0x194);}return _0x551034;};}function handleError(_0x186979,_0x5d761f){_0x5d761f=_0x5d761f||0x1f4;return function(_0x829179){logger[_0xbbc5('0x27')](_0x829179[_0xbbc5('0x28')]);if(_0x829179['name']){delete _0x829179['name'];}_0x186979['status'](_0x5d761f)[_0xbbc5('0x29')](_0x829179);};}exports[_0xbbc5('0x2a')]=function(_0x441f54,_0xb60db1){var _0x368ca2={},_0x57e782={},_0x40e0de={'count':0x0,'rows':[]};var _0x350ea4=_[_0xbbc5('0x2b')](db[_0xbbc5('0x2c')]['rawAttributes'],function(_0x24758e){return{'name':_0x24758e[_0xbbc5('0x2d')],'type':_0x24758e[_0xbbc5('0x2e')][_0xbbc5('0x2f')]};});_0x57e782[_0xbbc5('0x30')]=_[_0xbbc5('0x2b')](_0x350ea4,_0xbbc5('0x31'));_0x57e782[_0xbbc5('0x32')]=_[_0xbbc5('0x33')](_0x441f54[_0xbbc5('0x32')]);_0x57e782['filters']=_[_0xbbc5('0x34')](_0x57e782[_0xbbc5('0x30')],_0x57e782[_0xbbc5('0x32')]);_0x368ca2[_0xbbc5('0x35')]=_[_0xbbc5('0x34')](_0x57e782[_0xbbc5('0x30')],qs['fields'](_0x441f54[_0xbbc5('0x32')][_0xbbc5('0x36')]));_0x368ca2[_0xbbc5('0x35')]=_0x368ca2[_0xbbc5('0x35')][_0xbbc5('0x37')]?_0x368ca2[_0xbbc5('0x35')]:_0x57e782[_0xbbc5('0x30')];if(!_0x441f54[_0xbbc5('0x32')][_0xbbc5('0x38')](_0xbbc5('0x39'))){_0x368ca2[_0xbbc5('0x1f')]=qs['limit'](_0x441f54[_0xbbc5('0x32')][_0xbbc5('0x1f')]);_0x368ca2[_0xbbc5('0x1e')]=qs[_0xbbc5('0x1e')](_0x441f54[_0xbbc5('0x32')]['offset']);}_0x368ca2['order']=qs[_0xbbc5('0x3a')](_0x441f54[_0xbbc5('0x32')][_0xbbc5('0x3a')]);_0x368ca2[_0xbbc5('0x3b')]=qs['filters'](_[_0xbbc5('0x3c')](_0x441f54[_0xbbc5('0x32')],_0x57e782[_0xbbc5('0x3d')]),_0x350ea4);if(_0x441f54['query'][_0xbbc5('0x3e')]){_0x368ca2[_0xbbc5('0x3b')]=_[_0xbbc5('0x3f')](_0x368ca2['where'],{'$or':_[_0xbbc5('0x2b')](_0x350ea4,function(_0x10b7d3){if(_0x10b7d3[_0xbbc5('0x2e')]!=='VIRTUAL'){var _0xdf2eb7={};_0xdf2eb7[_0x10b7d3['name']]={'$like':'%'+_0x441f54[_0xbbc5('0x32')][_0xbbc5('0x3e')]+'%'};return _0xdf2eb7;}})});}_0x368ca2=_[_0xbbc5('0x3f')]({},_0x368ca2,_0x441f54['options']);var _0x2d27a6={'where':_0x368ca2[_0xbbc5('0x3b')]};return db[_0xbbc5('0x2c')][_0xbbc5('0x1d')](_0x2d27a6)[_0xbbc5('0x40')](function(_0x2cc4c9){_0x40e0de[_0xbbc5('0x1d')]=_0x2cc4c9;if(_0x441f54['query']['includeAll']){_0x368ca2[_0xbbc5('0x41')]=[{'all':!![]}];}return db[_0xbbc5('0x2c')]['findAll'](_0x368ca2);})[_0xbbc5('0x40')](function(_0x53265a){_0x40e0de[_0xbbc5('0x42')]=_0x53265a;return _0x40e0de;})[_0xbbc5('0x40')](respondWithFilteredResult(_0xb60db1,_0x368ca2))['catch'](handleError(_0xb60db1,null));};exports[_0xbbc5('0x43')]=function(_0x5dbb92,_0x35d61b){var _0xa60246={'raw':!![],'where':{'id':_0x5dbb92['params']['id']}},_0x546d93={};_0x546d93[_0xbbc5('0x30')]=_[_0xbbc5('0x33')](db[_0xbbc5('0x2c')][_0xbbc5('0x44')]);_0x546d93[_0xbbc5('0x32')]=_[_0xbbc5('0x33')](_0x5dbb92[_0xbbc5('0x32')]);_0x546d93[_0xbbc5('0x3d')]=_['intersection'](_0x546d93['model'],_0x546d93[_0xbbc5('0x32')]);_0xa60246[_0xbbc5('0x35')]=_['intersection'](_0x546d93['model'],qs['fields'](_0x5dbb92['query']['fields']));_0xa60246[_0xbbc5('0x35')]=_0xa60246[_0xbbc5('0x35')][_0xbbc5('0x37')]?_0xa60246[_0xbbc5('0x35')]:_0x546d93[_0xbbc5('0x30')];if(_0x5dbb92['query'][_0xbbc5('0x45')]){_0xa60246['include']=[{'all':!![]}];}_0xa60246=_[_0xbbc5('0x3f')]({},_0xa60246,_0x5dbb92['options']);return db[_0xbbc5('0x2c')][_0xbbc5('0x46')](_0xa60246)['then'](handleEntityNotFound(_0x35d61b,null))[_0xbbc5('0x40')](respondWithResult(_0x35d61b,null))[_0xbbc5('0x47')](handleError(_0x35d61b,null));};exports[_0xbbc5('0x48')]=function(_0x5596d8,_0x1c04b7){return db[_0xbbc5('0x2c')][_0xbbc5('0x48')](_0x5596d8[_0xbbc5('0x49')],{})[_0xbbc5('0x40')](respondWithResult(_0x1c04b7,0xc9))[_0xbbc5('0x47')](handleError(_0x1c04b7,null));};exports[_0xbbc5('0x25')]=function(_0x397b98,_0x3d191d){if(_0x397b98[_0xbbc5('0x49')]['id']){delete _0x397b98[_0xbbc5('0x49')]['id'];}return db[_0xbbc5('0x2c')]['find']({'where':{'id':_0x397b98[_0xbbc5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3d191d,null))['then'](saveUpdates(_0x397b98[_0xbbc5('0x49')],null))[_0xbbc5('0x40')](respondWithResult(_0x3d191d,null))[_0xbbc5('0x47')](handleError(_0x3d191d,null));};exports[_0xbbc5('0x26')]=function(_0x154136,_0x26d4b4){return db[_0xbbc5('0x2c')][_0xbbc5('0x46')]({'where':{'id':_0x154136[_0xbbc5('0x4a')]['id']}})[_0xbbc5('0x40')](handleEntityNotFound(_0x26d4b4,null))['then'](removeEntity(_0x26d4b4,null))[_0xbbc5('0x47')](handleError(_0x26d4b4,null));};exports['describe']=function(_0x25b8d4,_0x4888c3){return db['SquareDetailsReport'][_0xbbc5('0x4b')]()[_0xbbc5('0x40')](respondWithResult(_0x4888c3,null))['catch'](handleError(_0x4888c3,null));}; \ No newline at end of file +var _0x8a33=['rawAttributes','includeAll','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then','end','stack','name','send','index','map','SquareDetailsReport','fieldName','key','query','filters','intersection','model','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','catch','params','keys'];(function(_0x7d02b7,_0x375680){var _0x435628=function(_0x45cd19){while(--_0x45cd19){_0x7d02b7['push'](_0x7d02b7['shift']());}};_0x435628(++_0x375680);}(_0x8a33,0x1c3));var _0x38a3=function(_0x146beb,_0x57b1f4){_0x146beb=_0x146beb-0x0;var _0x404c81=_0x8a33[_0x146beb];return _0x404c81;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x38a3('0x0'));var rimraf=require(_0x38a3('0x1'));var zipdir=require(_0x38a3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38a3('0x3'));var moment=require(_0x38a3('0x4'));var BPromise=require(_0x38a3('0x5'));var Mustache=require(_0x38a3('0x6'));var util=require(_0x38a3('0x7'));var path=require(_0x38a3('0x8'));var sox=require(_0x38a3('0x9'));var csv=require('to-csv');var ejs=require(_0x38a3('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x38a3('0xb'));var crypto=require('crypto');var jsforce=require(_0x38a3('0xc'));var deskjs=require(_0x38a3('0xd'));var toCsv=require(_0x38a3('0xe'));var querystring=require(_0x38a3('0xf'));var Papa=require('papaparse');var Redis=require(_0x38a3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x38a3('0x11'));var as=require(_0x38a3('0x12'));var hardwareService=require(_0x38a3('0x13'));var logger=require(_0x38a3('0x14'))(_0x38a3('0x15'));var utils=require(_0x38a3('0x16'));var config=require(_0x38a3('0x17'));var db=require(_0x38a3('0x18'))['db'];function respondWithStatusCode(_0x35b837,_0x593bb3){_0x593bb3=_0x593bb3||0xcc;return function(_0x1b5eed){if(_0x1b5eed){return _0x35b837[_0x38a3('0x19')](_0x593bb3);}return _0x35b837[_0x38a3('0x1a')](_0x593bb3)['end']();};}function respondWithResult(_0x2d6924,_0x245697){_0x245697=_0x245697||0xc8;return function(_0x1539f5){if(_0x1539f5){return _0x2d6924[_0x38a3('0x1a')](_0x245697)[_0x38a3('0x1b')](_0x1539f5);}};}function respondWithFilteredResult(_0x27bcc3,_0x2adb47){return function(_0x1db439){if(_0x1db439){var _0x322c47=_0x1db439['count'],_0x4a8b87=_0x2adb47[_0x38a3('0x1c')],_0x130d95=_0x2adb47[_0x38a3('0x1c')]+_0x2adb47[_0x38a3('0x1d')],_0x31e887;if(_0x130d95>=_0x322c47){_0x130d95=_0x322c47;_0x31e887=0xc8;}else{_0x31e887=0xce;}_0x27bcc3[_0x38a3('0x1a')](_0x31e887);return _0x27bcc3[_0x38a3('0x1e')]('Content-Range',_0x4a8b87+'-'+_0x130d95+'/'+_0x322c47)[_0x38a3('0x1b')](_0x1db439);}return null;};}function patchUpdates(_0x238384){return function(_0x37e892){try{jsonpatch[_0x38a3('0x1f')](_0x37e892,_0x238384,!![]);}catch(_0x39a3d9){return BPromise[_0x38a3('0x20')](_0x39a3d9);}return _0x37e892[_0x38a3('0x21')]();};}function saveUpdates(_0x12e5f5,_0x3eeba2){return function(_0xd26844){if(_0xd26844){return _0xd26844[_0x38a3('0x22')](_0x12e5f5)['then'](function(_0xe4d332){return _0xe4d332;});}return null;};}function removeEntity(_0x3db638,_0x18da63){return function(_0x40d5f1){if(_0x40d5f1){return _0x40d5f1['destroy']()[_0x38a3('0x23')](function(){_0x3db638[_0x38a3('0x1a')](0xcc)[_0x38a3('0x24')]();});}};}function handleEntityNotFound(_0xe2e789,_0x415779){return function(_0x12b55b){if(!_0x12b55b){_0xe2e789['sendStatus'](0x194);}return _0x12b55b;};}function handleError(_0x12a77d,_0x4a1388){_0x4a1388=_0x4a1388||0x1f4;return function(_0x2fd361){logger['error'](_0x2fd361[_0x38a3('0x25')]);if(_0x2fd361['name']){delete _0x2fd361[_0x38a3('0x26')];}_0x12a77d[_0x38a3('0x1a')](_0x4a1388)[_0x38a3('0x27')](_0x2fd361);};}exports[_0x38a3('0x28')]=function(_0x3c4852,_0x54cf2b){var _0x1c9527={},_0x14d78d={},_0x36170e={'count':0x0,'rows':[]};var _0x2a1a34=_[_0x38a3('0x29')](db[_0x38a3('0x2a')]['rawAttributes'],function(_0x3d9a60){return{'name':_0x3d9a60[_0x38a3('0x2b')],'type':_0x3d9a60['type'][_0x38a3('0x2c')]};});_0x14d78d['model']=_[_0x38a3('0x29')](_0x2a1a34,_0x38a3('0x26'));_0x14d78d[_0x38a3('0x2d')]=_['keys'](_0x3c4852[_0x38a3('0x2d')]);_0x14d78d[_0x38a3('0x2e')]=_[_0x38a3('0x2f')](_0x14d78d[_0x38a3('0x30')],_0x14d78d[_0x38a3('0x2d')]);_0x1c9527[_0x38a3('0x31')]=_['intersection'](_0x14d78d['model'],qs['fields'](_0x3c4852[_0x38a3('0x2d')]['fields']));_0x1c9527[_0x38a3('0x31')]=_0x1c9527[_0x38a3('0x31')][_0x38a3('0x32')]?_0x1c9527[_0x38a3('0x31')]:_0x14d78d[_0x38a3('0x30')];if(!_0x3c4852[_0x38a3('0x2d')][_0x38a3('0x33')]('nolimit')){_0x1c9527['limit']=qs['limit'](_0x3c4852[_0x38a3('0x2d')][_0x38a3('0x1d')]);_0x1c9527[_0x38a3('0x1c')]=qs[_0x38a3('0x1c')](_0x3c4852[_0x38a3('0x2d')][_0x38a3('0x1c')]);}_0x1c9527[_0x38a3('0x34')]=qs[_0x38a3('0x35')](_0x3c4852['query'][_0x38a3('0x35')]);_0x1c9527[_0x38a3('0x36')]=qs[_0x38a3('0x2e')](_[_0x38a3('0x37')](_0x3c4852[_0x38a3('0x2d')],_0x14d78d[_0x38a3('0x2e')]),_0x2a1a34);if(_0x3c4852['query'][_0x38a3('0x38')]){_0x1c9527[_0x38a3('0x36')]=_[_0x38a3('0x39')](_0x1c9527[_0x38a3('0x36')],{'$or':_[_0x38a3('0x29')](_0x2a1a34,function(_0x2990c2){if(_0x2990c2[_0x38a3('0x3a')]!==_0x38a3('0x3b')){var _0x156fa4={};_0x156fa4[_0x2990c2[_0x38a3('0x26')]]={'$like':'%'+_0x3c4852[_0x38a3('0x2d')]['filter']+'%'};return _0x156fa4;}})});}_0x1c9527=_[_0x38a3('0x39')]({},_0x1c9527,_0x3c4852[_0x38a3('0x3c')]);var _0x5873b2={'where':_0x1c9527[_0x38a3('0x36')]};return db[_0x38a3('0x2a')][_0x38a3('0x3d')](_0x5873b2)[_0x38a3('0x23')](function(_0x375d3e){_0x36170e['count']=_0x375d3e;if(_0x3c4852[_0x38a3('0x2d')]['includeAll']){_0x1c9527[_0x38a3('0x3e')]=[{'all':!![]}];}return db[_0x38a3('0x2a')][_0x38a3('0x3f')](_0x1c9527);})['then'](function(_0x4aa65b){_0x36170e['rows']=_0x4aa65b;return _0x36170e;})[_0x38a3('0x23')](respondWithFilteredResult(_0x54cf2b,_0x1c9527))[_0x38a3('0x40')](handleError(_0x54cf2b,null));};exports['show']=function(_0x1c71a1,_0x2d0774){var _0x34f78f={'raw':!![],'where':{'id':_0x1c71a1[_0x38a3('0x41')]['id']}},_0x5e680a={};_0x5e680a[_0x38a3('0x30')]=_[_0x38a3('0x42')](db['SquareDetailsReport'][_0x38a3('0x43')]);_0x5e680a[_0x38a3('0x2d')]=_[_0x38a3('0x42')](_0x1c71a1[_0x38a3('0x2d')]);_0x5e680a['filters']=_['intersection'](_0x5e680a[_0x38a3('0x30')],_0x5e680a['query']);_0x34f78f['attributes']=_[_0x38a3('0x2f')](_0x5e680a['model'],qs['fields'](_0x1c71a1[_0x38a3('0x2d')]['fields']));_0x34f78f[_0x38a3('0x31')]=_0x34f78f['attributes'][_0x38a3('0x32')]?_0x34f78f[_0x38a3('0x31')]:_0x5e680a[_0x38a3('0x30')];if(_0x1c71a1[_0x38a3('0x2d')][_0x38a3('0x44')]){_0x34f78f['include']=[{'all':!![]}];}_0x34f78f=_[_0x38a3('0x39')]({},_0x34f78f,_0x1c71a1['options']);return db['SquareDetailsReport'][_0x38a3('0x45')](_0x34f78f)[_0x38a3('0x23')](handleEntityNotFound(_0x2d0774,null))[_0x38a3('0x23')](respondWithResult(_0x2d0774,null))['catch'](handleError(_0x2d0774,null));};exports[_0x38a3('0x46')]=function(_0x156552,_0x56e256){return db[_0x38a3('0x2a')][_0x38a3('0x46')](_0x156552[_0x38a3('0x47')],{})[_0x38a3('0x23')](respondWithResult(_0x56e256,0xc9))[_0x38a3('0x40')](handleError(_0x56e256,null));};exports['update']=function(_0x148627,_0x17006a){if(_0x148627['body']['id']){delete _0x148627[_0x38a3('0x47')]['id'];}return db[_0x38a3('0x2a')][_0x38a3('0x45')]({'where':{'id':_0x148627[_0x38a3('0x41')]['id']}})[_0x38a3('0x23')](handleEntityNotFound(_0x17006a,null))[_0x38a3('0x23')](saveUpdates(_0x148627[_0x38a3('0x47')],null))[_0x38a3('0x23')](respondWithResult(_0x17006a,null))[_0x38a3('0x40')](handleError(_0x17006a,null));};exports[_0x38a3('0x48')]=function(_0x451c87,_0x4f885f){return db[_0x38a3('0x2a')]['find']({'where':{'id':_0x451c87[_0x38a3('0x41')]['id']}})['then'](handleEntityNotFound(_0x4f885f,null))['then'](removeEntity(_0x4f885f,null))['catch'](handleError(_0x4f885f,null));};exports[_0x38a3('0x49')]=function(_0x3bfd2e,_0x3f0616){return db[_0x38a3('0x2a')]['describe']()[_0x38a3('0x23')](respondWithResult(_0x3f0616,null))['catch'](handleError(_0x3f0616,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 04d31f2..1a35b41 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 _0x9a5c=['util','../../config/logger','api','moment','request-promise','exports','define','SquareDetailsReport','report_square_details'];(function(_0x19e81b,_0x3279cb){var _0x1654dd=function(_0x40c0da){while(--_0x40c0da){_0x19e81b['push'](_0x19e81b['shift']());}};_0x1654dd(++_0x3279cb);}(_0x9a5c,0x129));var _0xc9a5=function(_0x49c9fe,_0x1fa007){_0x49c9fe=_0x49c9fe-0x0;var _0x1df35d=_0x9a5c[_0x49c9fe];return _0x1df35d;};'use strict';var _=require('lodash');var util=require(_0xc9a5('0x0'));var logger=require(_0xc9a5('0x1'))(_0xc9a5('0x2'));var moment=require(_0xc9a5('0x3'));var BPromise=require('bluebird');var rp=require(_0xc9a5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0xc9a5('0x5')]=function(_0x8e121f,_0x2a59c2){return _0x8e121f[_0xc9a5('0x6')](_0xc9a5('0x7'),attributes,{'tableName':_0xc9a5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4826=['SquareDetailsReport','report_square_details','lodash','../../config/logger','api','moment','path','../../config/environment','exports'];(function(_0xb8fd40,_0x23030a){var _0x46fcde=function(_0x1a22ff){while(--_0x1a22ff){_0xb8fd40['push'](_0xb8fd40['shift']());}};_0x46fcde(++_0x23030a);}(_0x4826,0x1e8));var _0x6482=function(_0xfcd299,_0x4adcc0){_0xfcd299=_0xfcd299-0x0;var _0x3e5c4d=_0x4826[_0xfcd299];return _0x3e5c4d;};'use strict';var _=require(_0x6482('0x0'));var util=require('util');var logger=require(_0x6482('0x1'))(_0x6482('0x2'));var moment=require(_0x6482('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6482('0x4'));var rimraf=require('rimraf');var config=require(_0x6482('0x5'));var attributes=require('./squareReportDetail.attributes');module[_0x6482('0x6')]=function(_0x455fae,_0x4bfec9){return _0x455fae['define'](_0x6482('0x7'),attributes,{'tableName':_0x6482('0x8'),'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 174b15f..ac209a0 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 _0x032c=['info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','create','body','options','raw','lodash','moment','randomstring','../../config/utils','../../config/logger','http','request','then'];(function(_0x4a34e0,_0x29ff2f){var _0xb5ce1d=function(_0x225c39){while(--_0x225c39){_0x4a34e0['push'](_0x4a34e0['shift']());}};_0xb5ce1d(++_0x29ff2f);}(_0x032c,0x190));var _0xc032=function(_0x45e09b,_0x37cc8d){_0x45e09b=_0x45e09b-0x0;var _0x178707=_0x032c[_0x45e09b];return _0x178707;};'use strict';var _=require(_0xc032('0x0'));var util=require('util');var moment=require(_0xc032('0x1'));var BPromise=require('bluebird');var rs=require(_0xc032('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc032('0x3'));var logger=require(_0xc032('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc032('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x3b5b15,_0x4ffd1b,_0x36e35e){return new BPromise(function(_0x360104,_0x4ad650){return client[_0xc032('0x6')](_0x3b5b15,_0x36e35e)[_0xc032('0x7')](function(_0x5b3a0d){logger[_0xc032('0x8')](_0xc032('0x9'),_0x4ffd1b,_0xc032('0xa'));logger[_0xc032('0xb')](_0xc032('0xc'),_0x4ffd1b,_0xc032('0xa'),JSON[_0xc032('0xd')](_0x5b3a0d));if(_0x5b3a0d[_0xc032('0xe')]){if(_0x5b3a0d[_0xc032('0xe')][_0xc032('0xf')]===0x1f4){logger[_0xc032('0xe')](_0xc032('0x9'),_0x4ffd1b,_0x5b3a0d['error']['message']);return _0x4ad650(_0x5b3a0d[_0xc032('0xe')]['message']);}logger[_0xc032('0xe')](_0xc032('0x9'),_0x4ffd1b,_0x5b3a0d[_0xc032('0xe')][_0xc032('0x10')]);return _0x360104(_0x5b3a0d[_0xc032('0xe')]['message']);}else{logger[_0xc032('0x8')](_0xc032('0x9'),_0x4ffd1b,_0xc032('0xa'));_0x360104(_0x5b3a0d[_0xc032('0x11')]['message']);}})[_0xc032('0x12')](function(_0x241d98){logger[_0xc032('0xe')](_0xc032('0x9'),_0x4ffd1b,_0x241d98);_0x4ad650(_0x241d98);});});}exports[_0xc032('0x13')]=function(_0x47682f){var _0x347754=this;return new Promise(function(_0x5863f1,_0x75f40){return db['SquareDetailsReport'][_0xc032('0x14')](_0x47682f[_0xc032('0x15')],{'raw':_0x47682f[_0xc032('0x16')]?_0x47682f[_0xc032('0x16')][_0xc032('0x17')]===undefined?!![]:![]:!![]})[_0xc032('0x7')](function(_0x179d29){logger[_0xc032('0x8')](_0xc032('0x13'),_0x47682f);logger[_0xc032('0xb')](_0xc032('0x13'),_0x47682f,JSON[_0xc032('0xd')](_0x179d29));_0x5863f1(_0x179d29);})[_0xc032('0x12')](function(_0x2d0e75){logger[_0xc032('0xe')](_0xc032('0x13'),_0x2d0e75[_0xc032('0x10')],_0x47682f);_0x75f40(_0x347754[_0xc032('0xe')](0x1f4,_0x2d0e75[_0xc032('0x10')]));});});}; \ No newline at end of file +var _0x6ea5=['client','http','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4664ce,_0x23a6b2){var _0x2e0097=function(_0x2e430a){while(--_0x2e430a){_0x4664ce['push'](_0x4664ce['shift']());}};_0x2e0097(++_0x23a6b2);}(_0x6ea5,0x99));var _0x56ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ea5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x56ea('0x0'));var util=require(_0x56ea('0x1'));var moment=require(_0x56ea('0x2'));var BPromise=require('bluebird');var rs=require(_0x56ea('0x3'));var fs=require('fs');var Redis=require(_0x56ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x56ea('0x5'));var logger=require(_0x56ea('0x6'))('rpc');var config=require(_0x56ea('0x7'));var jayson=require(_0x56ea('0x8'));var client=jayson[_0x56ea('0x9')][_0x56ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55023a,_0x3b6329,_0x4b95cc){return new BPromise(function(_0x338847,_0x3c94cb){return client['request'](_0x55023a,_0x4b95cc)[_0x56ea('0xb')](function(_0xe4c4d4){logger[_0x56ea('0xc')](_0x56ea('0xd'),_0x3b6329,'request\x20sent');logger[_0x56ea('0xe')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x3b6329,'request\x20sent',JSON[_0x56ea('0xf')](_0xe4c4d4));if(_0xe4c4d4[_0x56ea('0x10')]){if(_0xe4c4d4['error']['code']===0x1f4){logger[_0x56ea('0x10')](_0x56ea('0xd'),_0x3b6329,_0xe4c4d4['error']['message']);return _0x3c94cb(_0xe4c4d4[_0x56ea('0x10')]['message']);}logger['error'](_0x56ea('0xd'),_0x3b6329,_0xe4c4d4[_0x56ea('0x10')][_0x56ea('0x11')]);return _0x338847(_0xe4c4d4[_0x56ea('0x10')][_0x56ea('0x11')]);}else{logger['info'](_0x56ea('0xd'),_0x3b6329,_0x56ea('0x12'));_0x338847(_0xe4c4d4[_0x56ea('0x13')][_0x56ea('0x11')]);}})['catch'](function(_0x4be38a){logger[_0x56ea('0x10')](_0x56ea('0xd'),_0x3b6329,_0x4be38a);_0x3c94cb(_0x4be38a);});});}exports[_0x56ea('0x14')]=function(_0x951f4a){var _0x165501=this;return new Promise(function(_0x383463,_0x50a287){return db[_0x56ea('0x15')][_0x56ea('0x16')](_0x951f4a[_0x56ea('0x17')],{'raw':_0x951f4a['options']?_0x951f4a[_0x56ea('0x18')][_0x56ea('0x19')]===undefined?!![]:![]:!![]})[_0x56ea('0xb')](function(_0x2a93f5){logger[_0x56ea('0xc')](_0x56ea('0x14'),_0x951f4a);logger['debug'](_0x56ea('0x14'),_0x951f4a,JSON[_0x56ea('0xf')](_0x2a93f5));_0x383463(_0x2a93f5);})[_0x56ea('0x1a')](function(_0x537e44){logger['error'](_0x56ea('0x14'),_0x537e44[_0x56ea('0x11')],_0x951f4a);_0x50a287(_0x165501['error'](0x1f4,_0x537e44[_0x56ea('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 6fcd5c0..6c0e9a8 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 _0x2baf=['get','isAuthenticated','killProcess','exports','Router','../../components/auth/service','./system.controller'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x2baf,0xc8));var _0xf2ba=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0x2baf[_0xf9a6cf];return _0x59e2bc;};'use strict';var express=require('express');var router=express[_0xf2ba('0x0')]();var auth=require(_0xf2ba('0x1'));var controller=require(_0xf2ba('0x2'));router[_0xf2ba('0x3')]('/',auth[_0xf2ba('0x4')](),controller['index']);router[_0xf2ba('0x3')]('/process/:pid/kill',auth['isAuthenticated'](),controller[_0xf2ba('0x5')]);module[_0xf2ba('0x6')]=router; \ No newline at end of file +var _0x6202=['exports','../../components/auth/service','get','isAuthenticated','/process/:pid/kill','killProcess'];(function(_0x22008b,_0x4f1ccb){var _0xaecfb0=function(_0x1ab24f){while(--_0x1ab24f){_0x22008b['push'](_0x22008b['shift']());}};_0xaecfb0(++_0x4f1ccb);}(_0x6202,0x1bd));var _0x2620=function(_0x390a19,_0x5dd137){_0x390a19=_0x390a19-0x0;var _0x5d8230=_0x6202[_0x390a19];return _0x5d8230;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x2620('0x0'));var controller=require('./system.controller');router[_0x2620('0x1')]('/',auth[_0x2620('0x2')](),controller['index']);router[_0x2620('0x1')](_0x2620('0x3'),auth[_0x2620('0x2')](),controller[_0x2620('0x4')]);module[_0x2620('0x5')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 26a7525..d62ec04 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 _0x9bb8=['kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9bb8,0x160));var _0x89bb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9bb8[_0x3dd15e];return _0x231fd0;};'use strict';var info=require(_0x89bb('0x0'));var exec=require('child_process')[_0x89bb('0x1')];var logger=require(_0x89bb('0x2'))(_0x89bb('0x3'));var util=require(_0x89bb('0x4'));var BPromise=require(_0x89bb('0x5'));var _=require(_0x89bb('0x6'));function handleError(_0x20adb9,_0x3aa11e,_0x2cf1cd){_0x3aa11e=_0x3aa11e||0x1f4;return function(_0x58ed44){logger[_0x89bb('0x7')](_0x89bb('0x8'),_0x2cf1cd,_0x3aa11e,util[_0x89bb('0x9')](_0x58ed44,{'showHidden':![],'depth':null}));delete _0x58ed44[_0x89bb('0xa')];_0x20adb9[_0x89bb('0xb')](_0x3aa11e)['send'](_0x58ed44);};}exports[_0x89bb('0xc')]=function(_0x276243,_0x2d0401){return info['getAllData']()['then'](function(_0x1fa98f){return _0x2d0401[_0x89bb('0xb')](0xc8)[_0x89bb('0xd')](_0x1fa98f);})[_0x89bb('0xe')](function(_0x4844e8){return _0x2d0401[_0x89bb('0xb')](0x1f4)[_0x89bb('0xd')](_0x4844e8);});};exports['killProcess']=function(_0x4ade79,_0x5a4028){var _0x11618f=[_0x89bb('0xf')];return new BPromise(function(_0x29fd37,_0x121418){return exec(util[_0x89bb('0x10')](_0x89bb('0x11'),_0x4ade79[_0x89bb('0x12')][_0x89bb('0x13')]),function(_0x232e0b,_0x2741e0,_0x206a76){if(_0x232e0b){return _0x121418(_0x232e0b);}return _0x29fd37(_0x2741e0);});})[_0x89bb('0x14')](function(_0x264734){var _0x2d231f=![];var _0x389a4a=_0x264734[_0x89bb('0x15')](/\n/);for(var _0x368199=0x0,_0x4cc3b6=_0x11618f[_0x89bb('0x16')];_0x368199<_0x4cc3b6,_0x2d231f===![];_0x368199+=0x1){if(_0x264734[_0x89bb('0x17')](_0x11618f[_0x368199])>=0x0){_0x2d231f=!![];}}if(!_0x2d231f){throw new Error(util[_0x89bb('0x10')](_0x89bb('0x18'),_0x4ade79['params'][_0x89bb('0x13')]));}process[_0x89bb('0x19')](_0x4ade79[_0x89bb('0x12')][_0x89bb('0x13')],_0x89bb('0x1a'));return _0x5a4028[_0x89bb('0xb')](0xc8)[_0x89bb('0xd')]({'message':util[_0x89bb('0x10')](_0x89bb('0x1b'),_0x4ade79[_0x89bb('0x12')][_0x89bb('0x13')])});})[_0x89bb('0xe')](handleError(_0x5a4028,null,_0x89bb('0x1c')));}; \ No newline at end of file +var _0xaf1b=['api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','send','getAllData','status','catch','json','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','split','length','kill','SIGINT','systeminformation','child_process','exec','../../config/logger'];(function(_0x10fa43,_0x1f735b){var _0x256f4f=function(_0x3816f0){while(--_0x3816f0){_0x10fa43['push'](_0x10fa43['shift']());}};_0x256f4f(++_0x1f735b);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x15f7f5,_0x2254d3){_0x15f7f5=_0x15f7f5-0x0;var _0x2887d0=_0xaf1b[_0x15f7f5];return _0x2887d0;};'use strict';var info=require(_0xbaf1('0x0'));var exec=require(_0xbaf1('0x1'))[_0xbaf1('0x2')];var logger=require(_0xbaf1('0x3'))(_0xbaf1('0x4'));var util=require(_0xbaf1('0x5'));var BPromise=require(_0xbaf1('0x6'));var _=require(_0xbaf1('0x7'));function handleError(_0x461ffb,_0x3fe8f0,_0x156a67){_0x3fe8f0=_0x3fe8f0||0x1f4;return function(_0x97aab){logger[_0xbaf1('0x8')](_0xbaf1('0x9'),_0x156a67,_0x3fe8f0,util['inspect'](_0x97aab,{'showHidden':![],'depth':null}));delete _0x97aab[_0xbaf1('0xa')];_0x461ffb['status'](_0x3fe8f0)[_0xbaf1('0xb')](_0x97aab);};}exports['index']=function(_0x2052c8,_0x3723ae){return info[_0xbaf1('0xc')]()['then'](function(_0x222756){return _0x3723ae[_0xbaf1('0xd')](0xc8)['json'](_0x222756);})[_0xbaf1('0xe')](function(_0x578f20){return _0x3723ae[_0xbaf1('0xd')](0x1f4)[_0xbaf1('0xf')](_0x578f20);});};exports[_0xbaf1('0x10')]=function(_0x1c1891,_0x2a9ebf){var _0x36ec1c=['components/import/cm'];return new BPromise(function(_0x493f3f,_0x322058){return exec(util[_0xbaf1('0x11')](_0xbaf1('0x12'),_0x1c1891[_0xbaf1('0x13')][_0xbaf1('0x14')]),function(_0x1097d6,_0x177599,_0x4c31a3){if(_0x1097d6){return _0x322058(_0x1097d6);}return _0x493f3f(_0x177599);});})[_0xbaf1('0x15')](function(_0x173cb6){var _0xb9ac72=![];var _0x342c11=_0x173cb6[_0xbaf1('0x16')](/\n/);for(var _0x25458f=0x0,_0x199252=_0x36ec1c[_0xbaf1('0x17')];_0x25458f<_0x199252,_0xb9ac72===![];_0x25458f+=0x1){if(_0x173cb6['indexOf'](_0x36ec1c[_0x25458f])>=0x0){_0xb9ac72=!![];}}if(!_0xb9ac72){throw new Error(util[_0xbaf1('0x11')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1c1891[_0xbaf1('0x13')][_0xbaf1('0x14')]));}process[_0xbaf1('0x18')](_0x1c1891[_0xbaf1('0x13')]['pid'],_0xbaf1('0x19'));return _0x2a9ebf['status'](0xc8)[_0xbaf1('0xf')]({'message':util[_0xbaf1('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x1c1891[_0xbaf1('0x13')][_0xbaf1('0x14')])});})[_0xbaf1('0xe')](handleError(_0x2a9ebf,null,_0xbaf1('0x10')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 477b86b..71a7454 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 _0xcb91=['post','create','update','delete','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xcb91[_0x3e2fcf];return _0x497db7;};'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 auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./tag.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0xa')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0xb')]);router['put']('/:id',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xc')]);router[_0x1cb9('0xd')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller['destroy']);module[_0x1cb9('0xe')]=router; \ No newline at end of file +var _0xda55=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xda55,0x6d));var _0x5da5=function(_0x1b90e0,_0x128583){_0x1b90e0=_0x1b90e0-0x0;var _0x2a26c4=_0xda55[_0x1b90e0];return _0x2a26c4;};'use strict';var multer=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5da5('0x2'));var router=express[_0x5da5('0x3')]();var auth=require(_0x5da5('0x4'));var interaction=require(_0x5da5('0x5'));var config=require(_0x5da5('0x6'));var controller=require('./tag.controller');router[_0x5da5('0x7')]('/',auth['isAuthenticated'](),controller[_0x5da5('0x8')]);router['get'](_0x5da5('0x9'),auth[_0x5da5('0xa')](),controller[_0x5da5('0xb')]);router[_0x5da5('0xc')]('/',auth[_0x5da5('0xa')](),controller[_0x5da5('0xd')]);router[_0x5da5('0xe')](_0x5da5('0x9'),auth['isAuthenticated'](),controller[_0x5da5('0xf')]);router[_0x5da5('0x10')](_0x5da5('0x9'),auth[_0x5da5('0xa')](),controller[_0x5da5('0x11')]);module[_0x5da5('0x12')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index acca944..193145d 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 _0xb688=['STRING','name','#0091EA','exports'];(function(_0x42012b,_0x1ee8df){var _0xd95067=function(_0x2b918b){while(--_0x2b918b){_0x42012b['push'](_0x42012b['shift']());}};_0xd95067(++_0x1ee8df);}(_0xb688,0xcf));var _0x8b68=function(_0x496c39,_0x2744b3){_0x496c39=_0x496c39-0x0;var _0x262ad7=_0xb688[_0x496c39];return _0x262ad7;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'name':{'type':Sequelize[_0x8b68('0x1')],'unique':_0x8b68('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x8b68('0x1')],'defaultValue':_0x8b68('0x3')},'description':{'type':Sequelize[_0x8b68('0x1')]}}; \ No newline at end of file +var _0x2032=['#0091EA','exports','STRING','name'];(function(_0x36adf0,_0x25bf38){var _0x25c109=function(_0x5ddae5){while(--_0x5ddae5){_0x36adf0['push'](_0x36adf0['shift']());}};_0x25c109(++_0x25bf38);}(_0x2032,0xd9));var _0x2203=function(_0xa8f68,_0x5bad5c){_0xa8f68=_0xa8f68-0x0;var _0x5580a3=_0x2032[_0xa8f68];return _0x5580a3;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'unique':_0x2203('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x2203('0x3')},'description':{'type':Sequelize[_0x2203('0x1')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index f6efb4e..7d49d11 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 _0x58e6=['send','index','Tag','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','catch','error','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','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','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','then','destroy','Tags','UserProfileResource','name'];(function(_0x2f5a3d,_0xae08ef){var _0xa236bd=function(_0x1a6157){while(--_0x1a6157){_0x2f5a3d['push'](_0x2f5a3d['shift']());}};_0xa236bd(++_0xae08ef);}(_0x58e6,0x7f));var _0x658e=function(_0x1fe8b2,_0x5c4988){_0x1fe8b2=_0x1fe8b2-0x0;var _0x49dea4=_0x58e6[_0x1fe8b2];return _0x49dea4;};'use strict';var pdf=require(_0x658e('0x0'));var emlformat=require(_0x658e('0x1'));var rimraf=require(_0x658e('0x2'));var zipdir=require(_0x658e('0x3'));var jsonpatch=require(_0x658e('0x4'));var rp=require(_0x658e('0x5'));var moment=require(_0x658e('0x6'));var BPromise=require(_0x658e('0x7'));var Mustache=require(_0x658e('0x8'));var util=require(_0x658e('0x9'));var path=require(_0x658e('0xa'));var sox=require(_0x658e('0xb'));var csv=require('to-csv');var ejs=require(_0x658e('0xc'));var fs=require('fs');var _=require(_0x658e('0xd'));var squel=require(_0x658e('0xe'));var crypto=require(_0x658e('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x658e('0x10'));var toCsv=require(_0x658e('0x11'));var querystring=require(_0x658e('0x12'));var Papa=require(_0x658e('0x13'));var Redis=require(_0x658e('0x14'));var authService=require(_0x658e('0x15'));var qs=require(_0x658e('0x16'));var as=require(_0x658e('0x17'));var hardwareService=require(_0x658e('0x18'));var logger=require(_0x658e('0x19'))(_0x658e('0x1a'));var utils=require(_0x658e('0x1b'));var config=require(_0x658e('0x1c'));var db=require(_0x658e('0x1d'))['db'];function respondWithStatusCode(_0x5bf82b,_0x5d8e81){_0x5d8e81=_0x5d8e81||0xcc;return function(_0x5722d5){if(_0x5722d5){return _0x5bf82b[_0x658e('0x1e')](_0x5d8e81);}return _0x5bf82b[_0x658e('0x1f')](_0x5d8e81)[_0x658e('0x20')]();};}function respondWithResult(_0x3aaaa7,_0x5b1b6e){_0x5b1b6e=_0x5b1b6e||0xc8;return function(_0x3a6a9f){if(_0x3a6a9f){return _0x3aaaa7[_0x658e('0x1f')](_0x5b1b6e)[_0x658e('0x21')](_0x3a6a9f);}};}function respondWithFilteredResult(_0x55b9a4,_0x173b92){return function(_0x5d3251){if(_0x5d3251){var _0x5c8557=_0x5d3251[_0x658e('0x22')],_0x3a89b7=_0x173b92['offset'],_0x3ae438=_0x173b92[_0x658e('0x23')]+_0x173b92[_0x658e('0x24')],_0x24568e;if(_0x3ae438>=_0x5c8557){_0x3ae438=_0x5c8557;_0x24568e=0xc8;}else{_0x24568e=0xce;}_0x55b9a4['status'](_0x24568e);return _0x55b9a4[_0x658e('0x25')](_0x658e('0x26'),_0x3a89b7+'-'+_0x3ae438+'/'+_0x5c8557)[_0x658e('0x21')](_0x5d3251);}return null;};}function patchUpdates(_0x5a4e63){return function(_0x324314){try{jsonpatch['apply'](_0x324314,_0x5a4e63,!![]);}catch(_0xc4924){return BPromise[_0x658e('0x27')](_0xc4924);}return _0x324314['save']();};}function saveUpdates(_0x3181c6,_0x2f3fb7){return function(_0x105f31){if(_0x105f31){return _0x105f31['update'](_0x3181c6)[_0x658e('0x28')](function(_0xf116f8){return _0xf116f8;});}return null;};}function removeEntity(_0x92bb10,_0x452254){return function(_0x4dc3a1){if(_0x4dc3a1){return _0x4dc3a1[_0x658e('0x29')]()[_0x658e('0x28')](function(){var _0x1ff84e=_0x4dc3a1['get']({'plain':!![]});var _0x3b0d81=_0x658e('0x2a');return db[_0x658e('0x2b')][_0x658e('0x29')]({'where':{'type':_0x3b0d81,'resourceId':_0x1ff84e['id']}})['then'](function(){return _0x4dc3a1;});})[_0x658e('0x28')](function(){_0x92bb10[_0x658e('0x1f')](0xcc)[_0x658e('0x20')]();});}};}function handleEntityNotFound(_0x5de09e,_0x14e0c2){return function(_0x2a1c1d){if(!_0x2a1c1d){_0x5de09e['sendStatus'](0x194);}return _0x2a1c1d;};}function handleError(_0x4aa030,_0x4e7784){_0x4e7784=_0x4e7784||0x1f4;return function(_0x1d96a9){logger['error'](_0x1d96a9['stack']);if(_0x1d96a9[_0x658e('0x2c')]){delete _0x1d96a9[_0x658e('0x2c')];}_0x4aa030['status'](_0x4e7784)[_0x658e('0x2d')](_0x1d96a9);};}exports[_0x658e('0x2e')]=function(_0x488464,_0x420a5d){var _0x6f537e={},_0x41c9fd={},_0x35350d={'count':0x0,'rows':[]};var _0x32bebd=_['map'](db[_0x658e('0x2f')][_0x658e('0x30')],function(_0x275a86){return{'name':_0x275a86[_0x658e('0x31')],'type':_0x275a86[_0x658e('0x32')][_0x658e('0x33')]};});_0x41c9fd[_0x658e('0x34')]=_[_0x658e('0x35')](_0x32bebd,_0x658e('0x2c'));_0x41c9fd[_0x658e('0x36')]=_['keys'](_0x488464['query']);_0x41c9fd[_0x658e('0x37')]=_[_0x658e('0x38')](_0x41c9fd['model'],_0x41c9fd['query']);_0x6f537e['attributes']=_[_0x658e('0x38')](_0x41c9fd[_0x658e('0x34')],qs['fields'](_0x488464['query']['fields']));_0x6f537e[_0x658e('0x39')]=_0x6f537e[_0x658e('0x39')][_0x658e('0x3a')]?_0x6f537e[_0x658e('0x39')]:_0x41c9fd[_0x658e('0x34')];if(!_0x488464[_0x658e('0x36')][_0x658e('0x3b')](_0x658e('0x3c'))){_0x6f537e[_0x658e('0x24')]=qs[_0x658e('0x24')](_0x488464[_0x658e('0x36')]['limit']);_0x6f537e[_0x658e('0x23')]=qs['offset'](_0x488464[_0x658e('0x36')][_0x658e('0x23')]);}_0x6f537e['order']=qs[_0x658e('0x3d')](_0x488464[_0x658e('0x36')]['sort']);_0x6f537e[_0x658e('0x3e')]=qs[_0x658e('0x37')](_['pick'](_0x488464[_0x658e('0x36')],_0x41c9fd[_0x658e('0x37')]),_0x32bebd);if(_0x488464[_0x658e('0x36')][_0x658e('0x3f')]){_0x6f537e['where']=_[_0x658e('0x40')](_0x6f537e[_0x658e('0x3e')],{'$or':_[_0x658e('0x35')](_0x32bebd,function(_0x4f0204){if(_0x4f0204[_0x658e('0x32')]!==_0x658e('0x41')){var _0x3b8d0f={};_0x3b8d0f[_0x4f0204[_0x658e('0x2c')]]={'$like':'%'+_0x488464[_0x658e('0x36')]['filter']+'%'};return _0x3b8d0f;}})});}_0x6f537e=_[_0x658e('0x40')]({},_0x6f537e,_0x488464[_0x658e('0x42')]);var _0x4ff326={'where':_0x6f537e[_0x658e('0x3e')]};return db[_0x658e('0x2f')][_0x658e('0x22')](_0x4ff326)[_0x658e('0x28')](function(_0xb3bf8c){_0x35350d[_0x658e('0x22')]=_0xb3bf8c;if(_0x488464['query'][_0x658e('0x43')]){_0x6f537e[_0x658e('0x44')]=[{'all':!![]}];}return db[_0x658e('0x2f')][_0x658e('0x45')](_0x6f537e);})['then'](function(_0x1357c8){_0x35350d[_0x658e('0x46')]=_0x1357c8;return _0x35350d;})['then'](respondWithFilteredResult(_0x420a5d,_0x6f537e))['catch'](handleError(_0x420a5d,null));};exports[_0x658e('0x47')]=function(_0x2d8710,_0x5c6763){var _0x342041={'raw':!![],'where':{'id':_0x2d8710[_0x658e('0x48')]['id']}},_0x47eeb0={};_0x47eeb0['model']=_[_0x658e('0x49')](db[_0x658e('0x2f')][_0x658e('0x30')]);_0x47eeb0[_0x658e('0x36')]=_[_0x658e('0x49')](_0x2d8710[_0x658e('0x36')]);_0x47eeb0['filters']=_[_0x658e('0x38')](_0x47eeb0[_0x658e('0x34')],_0x47eeb0['query']);_0x342041['attributes']=_[_0x658e('0x38')](_0x47eeb0[_0x658e('0x34')],qs[_0x658e('0x4a')](_0x2d8710[_0x658e('0x36')][_0x658e('0x4a')]));_0x342041['attributes']=_0x342041['attributes'][_0x658e('0x3a')]?_0x342041['attributes']:_0x47eeb0[_0x658e('0x34')];if(_0x2d8710[_0x658e('0x36')]['includeAll']){_0x342041[_0x658e('0x44')]=[{'all':!![]}];}_0x342041=_[_0x658e('0x40')]({},_0x342041,_0x2d8710['options']);return db[_0x658e('0x2f')]['find'](_0x342041)['then'](handleEntityNotFound(_0x5c6763,null))[_0x658e('0x28')](respondWithResult(_0x5c6763,null))['catch'](handleError(_0x5c6763,null));};exports[_0x658e('0x4b')]=function(_0x8ec9af,_0x49b0aa){return db[_0x658e('0x2f')][_0x658e('0x4b')](_0x8ec9af[_0x658e('0x4c')],{})['then'](function(_0xea7ac8){var _0x3755bd=_0x8ec9af[_0x658e('0x4d')]['get']({'plain':!![]});if(!_0x3755bd)throw new Error(_0x658e('0x4e'));if(_0x3755bd['role']==='user'){var _0x43fb66=_0xea7ac8[_0x658e('0x4f')]({'plain':!![]});var _0x5b7aec=_0x658e('0x2a');return db[_0x658e('0x50')][_0x658e('0x51')]({'where':{'name':_0x5b7aec,'userProfileId':_0x3755bd[_0x658e('0x52')]},'raw':!![]})[_0x658e('0x28')](function(_0x14f1e5){if(_0x14f1e5&&_0x14f1e5[_0x658e('0x53')]===0x0){return db['UserProfileResource'][_0x658e('0x4b')]({'name':_0x43fb66[_0x658e('0x2c')],'resourceId':_0x43fb66['id'],'type':_0x14f1e5[_0x658e('0x2c')],'sectionId':_0x14f1e5['id']},{})[_0x658e('0x28')](function(){return _0xea7ac8;});}else{return _0xea7ac8;}})[_0x658e('0x54')](function(_0x1809f7){logger[_0x658e('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1809f7);throw _0x1809f7;});}return _0xea7ac8;})[_0x658e('0x28')](respondWithResult(_0x49b0aa,0xc9))[_0x658e('0x54')](handleError(_0x49b0aa,null));};exports['update']=function(_0x38be4f,_0x3344ad){if(_0x38be4f['body']['id']){delete _0x38be4f[_0x658e('0x4c')]['id'];}return db[_0x658e('0x2f')]['find']({'where':{'id':_0x38be4f[_0x658e('0x48')]['id']}})[_0x658e('0x28')](handleEntityNotFound(_0x3344ad,null))[_0x658e('0x28')](saveUpdates(_0x38be4f['body'],null))[_0x658e('0x28')](respondWithResult(_0x3344ad,null))[_0x658e('0x54')](handleError(_0x3344ad,null));};exports['destroy']=function(_0x59722e,_0x2fc124){return db[_0x658e('0x2f')]['find']({'where':{'id':_0x59722e[_0x658e('0x48')]['id']}})[_0x658e('0x28')](handleEntityNotFound(_0x2fc124,null))['then'](removeEntity(_0x2fc124,null))[_0x658e('0x54')](handleError(_0x2fc124,null));}; \ No newline at end of file +var _0xdbe0=['json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','params','length','create','get','role','user','UserProfileSection','find','userProfileId','autoAssociation','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdbe0,0x19a));var _0x0dbe=function(_0x422f87,_0x53de11){_0x422f87=_0x422f87-0x0;var _0x4e21db=_0xdbe0[_0x422f87];return _0x4e21db;};'use strict';var pdf=require(_0x0dbe('0x0'));var emlformat=require(_0x0dbe('0x1'));var rimraf=require(_0x0dbe('0x2'));var zipdir=require(_0x0dbe('0x3'));var jsonpatch=require(_0x0dbe('0x4'));var rp=require(_0x0dbe('0x5'));var moment=require(_0x0dbe('0x6'));var BPromise=require(_0x0dbe('0x7'));var Mustache=require(_0x0dbe('0x8'));var util=require(_0x0dbe('0x9'));var path=require(_0x0dbe('0xa'));var sox=require('sox');var csv=require(_0x0dbe('0xb'));var ejs=require(_0x0dbe('0xc'));var fs=require('fs');var _=require(_0x0dbe('0xd'));var squel=require(_0x0dbe('0xe'));var crypto=require('crypto');var jsforce=require(_0x0dbe('0xf'));var deskjs=require(_0x0dbe('0x10'));var toCsv=require(_0x0dbe('0xb'));var querystring=require(_0x0dbe('0x11'));var Papa=require(_0x0dbe('0x12'));var Redis=require(_0x0dbe('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0dbe('0x14'));var as=require(_0x0dbe('0x15'));var hardwareService=require(_0x0dbe('0x16'));var logger=require(_0x0dbe('0x17'))(_0x0dbe('0x18'));var utils=require(_0x0dbe('0x19'));var config=require(_0x0dbe('0x1a'));var db=require(_0x0dbe('0x1b'))['db'];function respondWithStatusCode(_0xbafe98,_0x1bd2c6){_0x1bd2c6=_0x1bd2c6||0xcc;return function(_0x24ecec){if(_0x24ecec){return _0xbafe98['sendStatus'](_0x1bd2c6);}return _0xbafe98[_0x0dbe('0x1c')](_0x1bd2c6)[_0x0dbe('0x1d')]();};}function respondWithResult(_0x5a2736,_0x7ef5b9){_0x7ef5b9=_0x7ef5b9||0xc8;return function(_0x1f407b){if(_0x1f407b){return _0x5a2736['status'](_0x7ef5b9)[_0x0dbe('0x1e')](_0x1f407b);}};}function respondWithFilteredResult(_0x467dda,_0x684978){return function(_0xbd1da7){if(_0xbd1da7){var _0x32e736=_0xbd1da7['count'],_0x1cc9ec=_0x684978[_0x0dbe('0x1f')],_0x7107a3=_0x684978[_0x0dbe('0x1f')]+_0x684978[_0x0dbe('0x20')],_0x452463;if(_0x7107a3>=_0x32e736){_0x7107a3=_0x32e736;_0x452463=0xc8;}else{_0x452463=0xce;}_0x467dda[_0x0dbe('0x1c')](_0x452463);return _0x467dda[_0x0dbe('0x21')](_0x0dbe('0x22'),_0x1cc9ec+'-'+_0x7107a3+'/'+_0x32e736)[_0x0dbe('0x1e')](_0xbd1da7);}return null;};}function patchUpdates(_0x4022ca){return function(_0x33e1fe){try{jsonpatch[_0x0dbe('0x23')](_0x33e1fe,_0x4022ca,!![]);}catch(_0x349eb9){return BPromise[_0x0dbe('0x24')](_0x349eb9);}return _0x33e1fe[_0x0dbe('0x25')]();};}function saveUpdates(_0x2bb029,_0x530e72){return function(_0x330819){if(_0x330819){return _0x330819[_0x0dbe('0x26')](_0x2bb029)[_0x0dbe('0x27')](function(_0xbe11fb){return _0xbe11fb;});}return null;};}function removeEntity(_0x4b1aee,_0x4d9eee){return function(_0xb5fe85){if(_0xb5fe85){return _0xb5fe85[_0x0dbe('0x28')]()[_0x0dbe('0x27')](function(){var _0x77f7cf=_0xb5fe85['get']({'plain':!![]});var _0x4208f5=_0x0dbe('0x29');return db[_0x0dbe('0x2a')][_0x0dbe('0x28')]({'where':{'type':_0x4208f5,'resourceId':_0x77f7cf['id']}})[_0x0dbe('0x27')](function(){return _0xb5fe85;});})[_0x0dbe('0x27')](function(){_0x4b1aee[_0x0dbe('0x1c')](0xcc)[_0x0dbe('0x1d')]();});}};}function handleEntityNotFound(_0x156721,_0x3394a3){return function(_0x510782){if(!_0x510782){_0x156721['sendStatus'](0x194);}return _0x510782;};}function handleError(_0x2c717c,_0x505f99){_0x505f99=_0x505f99||0x1f4;return function(_0x5c9da4){logger[_0x0dbe('0x2b')](_0x5c9da4[_0x0dbe('0x2c')]);if(_0x5c9da4[_0x0dbe('0x2d')]){delete _0x5c9da4['name'];}_0x2c717c['status'](_0x505f99)[_0x0dbe('0x2e')](_0x5c9da4);};}exports[_0x0dbe('0x2f')]=function(_0x142624,_0x309293){var _0x15c6f7={},_0x4cf0db={},_0x513e2e={'count':0x0,'rows':[]};var _0x51cbb9=_[_0x0dbe('0x30')](db[_0x0dbe('0x31')][_0x0dbe('0x32')],function(_0x573441){return{'name':_0x573441[_0x0dbe('0x33')],'type':_0x573441[_0x0dbe('0x34')][_0x0dbe('0x35')]};});_0x4cf0db[_0x0dbe('0x36')]=_[_0x0dbe('0x30')](_0x51cbb9,_0x0dbe('0x2d'));_0x4cf0db[_0x0dbe('0x37')]=_[_0x0dbe('0x38')](_0x142624[_0x0dbe('0x37')]);_0x4cf0db[_0x0dbe('0x39')]=_[_0x0dbe('0x3a')](_0x4cf0db['model'],_0x4cf0db[_0x0dbe('0x37')]);_0x15c6f7['attributes']=_[_0x0dbe('0x3a')](_0x4cf0db[_0x0dbe('0x36')],qs['fields'](_0x142624[_0x0dbe('0x37')][_0x0dbe('0x3b')]));_0x15c6f7['attributes']=_0x15c6f7['attributes']['length']?_0x15c6f7[_0x0dbe('0x3c')]:_0x4cf0db[_0x0dbe('0x36')];if(!_0x142624[_0x0dbe('0x37')][_0x0dbe('0x3d')](_0x0dbe('0x3e'))){_0x15c6f7[_0x0dbe('0x20')]=qs[_0x0dbe('0x20')](_0x142624['query']['limit']);_0x15c6f7[_0x0dbe('0x1f')]=qs[_0x0dbe('0x1f')](_0x142624[_0x0dbe('0x37')]['offset']);}_0x15c6f7[_0x0dbe('0x3f')]=qs['sort'](_0x142624[_0x0dbe('0x37')][_0x0dbe('0x40')]);_0x15c6f7['where']=qs['filters'](_[_0x0dbe('0x41')](_0x142624[_0x0dbe('0x37')],_0x4cf0db[_0x0dbe('0x39')]),_0x51cbb9);if(_0x142624[_0x0dbe('0x37')][_0x0dbe('0x42')]){_0x15c6f7[_0x0dbe('0x43')]=_['merge'](_0x15c6f7[_0x0dbe('0x43')],{'$or':_[_0x0dbe('0x30')](_0x51cbb9,function(_0x50d91c){if(_0x50d91c[_0x0dbe('0x34')]!==_0x0dbe('0x44')){var _0x1c8f2f={};_0x1c8f2f[_0x50d91c[_0x0dbe('0x2d')]]={'$like':'%'+_0x142624[_0x0dbe('0x37')][_0x0dbe('0x42')]+'%'};return _0x1c8f2f;}})});}_0x15c6f7=_[_0x0dbe('0x45')]({},_0x15c6f7,_0x142624[_0x0dbe('0x46')]);var _0x3d5899={'where':_0x15c6f7[_0x0dbe('0x43')]};return db[_0x0dbe('0x31')][_0x0dbe('0x47')](_0x3d5899)[_0x0dbe('0x27')](function(_0x4b76e9){_0x513e2e[_0x0dbe('0x47')]=_0x4b76e9;if(_0x142624['query'][_0x0dbe('0x48')]){_0x15c6f7[_0x0dbe('0x49')]=[{'all':!![]}];}return db[_0x0dbe('0x31')][_0x0dbe('0x4a')](_0x15c6f7);})[_0x0dbe('0x27')](function(_0x5029ff){_0x513e2e['rows']=_0x5029ff;return _0x513e2e;})[_0x0dbe('0x27')](respondWithFilteredResult(_0x309293,_0x15c6f7))[_0x0dbe('0x4b')](handleError(_0x309293,null));};exports[_0x0dbe('0x4c')]=function(_0x2bc661,_0x884e58){var _0x346695={'raw':!![],'where':{'id':_0x2bc661[_0x0dbe('0x4d')]['id']}},_0x295b83={};_0x295b83[_0x0dbe('0x36')]=_['keys'](db[_0x0dbe('0x31')]['rawAttributes']);_0x295b83[_0x0dbe('0x37')]=_[_0x0dbe('0x38')](_0x2bc661[_0x0dbe('0x37')]);_0x295b83[_0x0dbe('0x39')]=_[_0x0dbe('0x3a')](_0x295b83[_0x0dbe('0x36')],_0x295b83[_0x0dbe('0x37')]);_0x346695[_0x0dbe('0x3c')]=_[_0x0dbe('0x3a')](_0x295b83['model'],qs[_0x0dbe('0x3b')](_0x2bc661['query'][_0x0dbe('0x3b')]));_0x346695[_0x0dbe('0x3c')]=_0x346695[_0x0dbe('0x3c')][_0x0dbe('0x4e')]?_0x346695[_0x0dbe('0x3c')]:_0x295b83[_0x0dbe('0x36')];if(_0x2bc661[_0x0dbe('0x37')][_0x0dbe('0x48')]){_0x346695[_0x0dbe('0x49')]=[{'all':!![]}];}_0x346695=_[_0x0dbe('0x45')]({},_0x346695,_0x2bc661[_0x0dbe('0x46')]);return db[_0x0dbe('0x31')]['find'](_0x346695)[_0x0dbe('0x27')](handleEntityNotFound(_0x884e58,null))[_0x0dbe('0x27')](respondWithResult(_0x884e58,null))[_0x0dbe('0x4b')](handleError(_0x884e58,null));};exports['create']=function(_0x5ba360,_0x5ac255){return db[_0x0dbe('0x31')][_0x0dbe('0x4f')](_0x5ba360['body'],{})['then'](function(_0x3372e3){var _0x11d019=_0x5ba360['user'][_0x0dbe('0x50')]({'plain':!![]});if(!_0x11d019)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11d019[_0x0dbe('0x51')]===_0x0dbe('0x52')){var _0x94cf84=_0x3372e3[_0x0dbe('0x50')]({'plain':!![]});var _0x3b510f=_0x0dbe('0x29');return db[_0x0dbe('0x53')][_0x0dbe('0x54')]({'where':{'name':_0x3b510f,'userProfileId':_0x11d019[_0x0dbe('0x55')]},'raw':!![]})[_0x0dbe('0x27')](function(_0x3d4a5f){if(_0x3d4a5f&&_0x3d4a5f[_0x0dbe('0x56')]===0x0){return db[_0x0dbe('0x2a')]['create']({'name':_0x94cf84[_0x0dbe('0x2d')],'resourceId':_0x94cf84['id'],'type':_0x3d4a5f[_0x0dbe('0x2d')],'sectionId':_0x3d4a5f['id']},{})[_0x0dbe('0x27')](function(){return _0x3372e3;});}else{return _0x3372e3;}})[_0x0dbe('0x4b')](function(_0x307b99){logger[_0x0dbe('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x307b99);throw _0x307b99;});}return _0x3372e3;})[_0x0dbe('0x27')](respondWithResult(_0x5ac255,0xc9))['catch'](handleError(_0x5ac255,null));};exports[_0x0dbe('0x26')]=function(_0x3473d1,_0x1362f8){if(_0x3473d1[_0x0dbe('0x57')]['id']){delete _0x3473d1[_0x0dbe('0x57')]['id'];}return db['Tag'][_0x0dbe('0x54')]({'where':{'id':_0x3473d1[_0x0dbe('0x4d')]['id']}})[_0x0dbe('0x27')](handleEntityNotFound(_0x1362f8,null))[_0x0dbe('0x27')](saveUpdates(_0x3473d1['body'],null))[_0x0dbe('0x27')](respondWithResult(_0x1362f8,null))[_0x0dbe('0x4b')](handleError(_0x1362f8,null));};exports['destroy']=function(_0x1c9b42,_0x99cf4e){return db[_0x0dbe('0x31')][_0x0dbe('0x54')]({'where':{'id':_0x1c9b42[_0x0dbe('0x4d')]['id']}})[_0x0dbe('0x27')](handleEntityNotFound(_0x99cf4e,null))[_0x0dbe('0x27')](removeEntity(_0x99cf4e,null))['catch'](handleError(_0x99cf4e,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index f0354b9..b08060d 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 _0x687f=['bluebird','request-promise','path','../../config/environment','./tag.attributes','define','Tag','tools_tags','util','../../config/logger','api','moment'];(function(_0x2ef8f1,_0x1280a3){var _0x17498d=function(_0xd20876){while(--_0xd20876){_0x2ef8f1['push'](_0x2ef8f1['shift']());}};_0x17498d(++_0x1280a3);}(_0x687f,0xa4));var _0xf687=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0x687f[_0x919445];return _0x511b3e;};'use strict';var _=require('lodash');var util=require(_0xf687('0x0'));var logger=require(_0xf687('0x1'))(_0xf687('0x2'));var moment=require(_0xf687('0x3'));var BPromise=require(_0xf687('0x4'));var rp=require(_0xf687('0x5'));var fs=require('fs');var path=require(_0xf687('0x6'));var rimraf=require('rimraf');var config=require(_0xf687('0x7'));var attributes=require(_0xf687('0x8'));module['exports']=function(_0x439a41,_0x1f8a6e){return _0x439a41[_0xf687('0x9')](_0xf687('0xa'),attributes,{'tableName':_0xf687('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f6d=['util','../../config/logger','api','moment','bluebird','path','./tag.attributes','exports','define','Tag','tools_tags'];(function(_0x311437,_0x384ca1){var _0x1b1a8=function(_0x1fa4e1){while(--_0x1fa4e1){_0x311437['push'](_0x311437['shift']());}};_0x1b1a8(++_0x384ca1);}(_0x3f6d,0x155));var _0xd3f6=function(_0x43b22b,_0xea722c){_0x43b22b=_0x43b22b-0x0;var _0xd4e124=_0x3f6d[_0x43b22b];return _0xd4e124;};'use strict';var _=require('lodash');var util=require(_0xd3f6('0x0'));var logger=require(_0xd3f6('0x1'))(_0xd3f6('0x2'));var moment=require(_0xd3f6('0x3'));var BPromise=require(_0xd3f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3f6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd3f6('0x6'));module[_0xd3f6('0x7')]=function(_0x4aa0dd,_0x4801d4){return _0x4aa0dd[_0xd3f6('0x8')](_0xd3f6('0x9'),attributes,{'tableName':_0xd3f6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index c4d6c6c..ea950a7 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x390e6c,_0x4d7d42){var _0x596b05=function(_0xe6d4aa){while(--_0xe6d4aa){_0x390e6c['push'](_0x390e6c['shift']());}};_0x596b05(++_0x4d7d42);}(_0xaa88,0x137));var _0x8aa8=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0xaa88[_0x489b87];return _0x1823b6;};'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')]('Tag,\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')]('Tag,\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')]('Tag,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0xc788=['request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','message','Tag,\x20%s,\x20%s','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x31b9cf,_0x1a809b){var _0x357b8a=function(_0x50a273){while(--_0x50a273){_0x31b9cf['push'](_0x31b9cf['shift']());}};_0x357b8a(++_0x1a809b);}(_0xc788,0xc4));var _0x8c78=function(_0x1d8468,_0x524250){_0x1d8468=_0x1d8468-0x0;var _0x3c7e0a=_0xc788[_0x1d8468];return _0x3c7e0a;};'use strict';var _=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var moment=require(_0x8c78('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c78('0x3'));var db=require(_0x8c78('0x4'))['db'];var utils=require(_0x8c78('0x5'));var logger=require(_0x8c78('0x6'))(_0x8c78('0x7'));var config=require('../../config/environment');var jayson=require(_0x8c78('0x8'));var client=jayson[_0x8c78('0x9')][_0x8c78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ac27f,_0x205cc1,_0x4d54a5){return new BPromise(function(_0x247188,_0x299d9d){return client[_0x8c78('0xb')](_0x1ac27f,_0x4d54a5)[_0x8c78('0xc')](function(_0xdb0c17){logger[_0x8c78('0xd')]('Tag,\x20%s,\x20%s',_0x205cc1,_0x8c78('0xe'));logger['debug'](_0x8c78('0xf'),_0x205cc1,_0x8c78('0xe'),JSON['stringify'](_0xdb0c17));if(_0xdb0c17[_0x8c78('0x10')]){if(_0xdb0c17[_0x8c78('0x10')]['code']===0x1f4){logger[_0x8c78('0x10')]('Tag,\x20%s,\x20%s',_0x205cc1,_0xdb0c17['error'][_0x8c78('0x11')]);return _0x299d9d(_0xdb0c17[_0x8c78('0x10')][_0x8c78('0x11')]);}logger[_0x8c78('0x10')](_0x8c78('0x12'),_0x205cc1,_0xdb0c17[_0x8c78('0x10')][_0x8c78('0x11')]);return _0x247188(_0xdb0c17[_0x8c78('0x10')][_0x8c78('0x11')]);}else{logger[_0x8c78('0xd')]('Tag,\x20%s,\x20%s',_0x205cc1,_0x8c78('0xe'));_0x247188(_0xdb0c17[_0x8c78('0x13')]['message']);}})[_0x8c78('0x14')](function(_0x554464){logger[_0x8c78('0x10')](_0x8c78('0x12'),_0x205cc1,_0x554464);_0x299d9d(_0x554464);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 604bc0b..f2603e3 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 _0xb9de=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','isAuthenticated','show','/:id/queues','getQueues','getAgents','post','create','addQueues','/:id/users','addAgents','put','update','delete','destroy','removeQueues','removeAgents','exports'];(function(_0x216c2f,_0xaf2d0e){var _0x1b6b9a=function(_0x3871be){while(--_0x3871be){_0x216c2f['push'](_0x216c2f['shift']());}};_0x1b6b9a(++_0xaf2d0e);}(_0xb9de,0x144));var _0xeb9d=function(_0x411706,_0x839659){_0x411706=_0x411706-0x0;var _0x4d44d6=_0xb9de[_0x411706];return _0x4d44d6;};'use strict';var multer=require('multer');var util=require(_0xeb9d('0x0'));var path=require(_0xeb9d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xeb9d('0x2')]();var auth=require(_0xeb9d('0x3'));var interaction=require(_0xeb9d('0x4'));var config=require(_0xeb9d('0x5'));var controller=require(_0xeb9d('0x6'));router[_0xeb9d('0x7')]('/',auth['isAuthenticated'](),controller[_0xeb9d('0x8')]);router[_0xeb9d('0x7')](_0xeb9d('0x9'),auth[_0xeb9d('0xa')](),controller[_0xeb9d('0xb')]);router[_0xeb9d('0x7')](_0xeb9d('0xc'),auth[_0xeb9d('0xa')](),controller[_0xeb9d('0xd')]);router[_0xeb9d('0x7')]('/:id/users',auth[_0xeb9d('0xa')](),controller[_0xeb9d('0xe')]);router[_0xeb9d('0xf')]('/',auth[_0xeb9d('0xa')](),controller[_0xeb9d('0x10')]);router[_0xeb9d('0xf')](_0xeb9d('0xc'),auth['isAuthenticated'](),controller[_0xeb9d('0x11')]);router['post'](_0xeb9d('0x12'),auth['isAuthenticated'](),controller[_0xeb9d('0x13')]);router[_0xeb9d('0x14')]('/:id',auth[_0xeb9d('0xa')](),controller[_0xeb9d('0x15')]);router[_0xeb9d('0x16')](_0xeb9d('0x9'),auth[_0xeb9d('0xa')](),controller[_0xeb9d('0x17')]);router[_0xeb9d('0x16')]('/:id/queues',auth[_0xeb9d('0xa')](),controller[_0xeb9d('0x18')]);router[_0xeb9d('0x16')](_0xeb9d('0x12'),auth[_0xeb9d('0xa')](),controller[_0xeb9d('0x19')]);module[_0xeb9d('0x1a')]=router; \ No newline at end of file +var _0xbedf=['removeAgents','exports','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','isAuthenticated','index','get','/:id','show','/:id/users','getAgents','create','post','/:id/queues','addQueues','addAgents','put','delete','removeQueues'];(function(_0x184b98,_0x29ee2c){var _0x586389=function(_0x56977a){while(--_0x56977a){_0x184b98['push'](_0x184b98['shift']());}};_0x586389(++_0x29ee2c);}(_0xbedf,0x122));var _0xfbed=function(_0x527824,_0xc824a9){_0x527824=_0x527824-0x0;var _0xc8b8ed=_0xbedf[_0x527824];return _0xc8b8ed;};'use strict';var multer=require('multer');var util=require(_0xfbed('0x0'));var path=require(_0xfbed('0x1'));var timeout=require(_0xfbed('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xfbed('0x3'));var interaction=require(_0xfbed('0x4'));var config=require(_0xfbed('0x5'));var controller=require(_0xfbed('0x6'));router['get']('/',auth[_0xfbed('0x7')](),controller[_0xfbed('0x8')]);router[_0xfbed('0x9')](_0xfbed('0xa'),auth[_0xfbed('0x7')](),controller[_0xfbed('0xb')]);router[_0xfbed('0x9')]('/:id/queues',auth['isAuthenticated'](),controller['getQueues']);router[_0xfbed('0x9')](_0xfbed('0xc'),auth[_0xfbed('0x7')](),controller[_0xfbed('0xd')]);router['post']('/',auth[_0xfbed('0x7')](),controller[_0xfbed('0xe')]);router[_0xfbed('0xf')](_0xfbed('0x10'),auth[_0xfbed('0x7')](),controller[_0xfbed('0x11')]);router[_0xfbed('0xf')]('/:id/users',auth[_0xfbed('0x7')](),controller[_0xfbed('0x12')]);router[_0xfbed('0x13')](_0xfbed('0xa'),auth[_0xfbed('0x7')](),controller['update']);router['delete']('/:id',auth[_0xfbed('0x7')](),controller['destroy']);router[_0xfbed('0x14')](_0xfbed('0x10'),auth[_0xfbed('0x7')](),controller[_0xfbed('0x15')]);router[_0xfbed('0x14')]('/:id/users',auth[_0xfbed('0x7')](),controller[_0xfbed('0x16')]);module[_0xfbed('0x17')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index e26a1e3..4041db2 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 _0xc372=['STRING','sequelize','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc372,0x179));var _0x2c37=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc372[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x2c37('0x0'));module[_0x2c37('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2c37('0x2')},'description':{'type':Sequelize[_0x2c37('0x3')]}}; \ No newline at end of file +var _0xd473=['exports','STRING','name','sequelize'];(function(_0x148879,_0x5b4c11){var _0x4f7027=function(_0xad056b){while(--_0xad056b){_0x148879['push'](_0x148879['shift']());}};_0x4f7027(++_0x5b4c11);}(_0xd473,0xe7));var _0x3d47=function(_0x425c47,_0x283fb5){_0x425c47=_0x425c47-0x0;var _0x5906e1=_0xd473[_0x425c47];return _0x5906e1;};'use strict';var Sequelize=require(_0x3d47('0x0'));module[_0x3d47('0x1')]={'name':{'type':Sequelize[_0x3d47('0x2')],'allowNull':![],'unique':_0x3d47('0x3')},'description':{'type':Sequelize[_0x3d47('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index cb3d8e2..46babc4 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 _0x5ad6=['VIRTUAL','options','count','includeAll','include','rows','catch','params','fields','find','create','role','get','UserProfileSection','autoAssociation','error','body','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','capitalize','Queue','order','pick','merge','toLowerCase','Queues','addQueues','ids','remove','addAgents','Chat','Mail','Sms','Fax','Whatsapp','each','Voice','User','online','interface','upsert','isNil','SIP/%s','spread','emit','userTeam:save','removeAgents','voice','chat','mail','sms','fax','openchannel','whatsapp','UserVoiceQueueRt','destroy','isArray','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./team.socket','sendStatus','end','status','json','offset','limit','set','apply','reject','update','then','Teams','UserProfileResource','stack','name','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','sort','filter','where'];(function(_0x38eb22,_0x458a8c){var _0x49553e=function(_0x2879fd){while(--_0x2879fd){_0x38eb22['push'](_0x38eb22['shift']());}};_0x49553e(++_0x458a8c);}(_0x5ad6,0xba));var _0x65ad=function(_0x1633e9,_0x50a939){_0x1633e9=_0x1633e9-0x0;var _0x549ace=_0x5ad6[_0x1633e9];return _0x549ace;};'use strict';var pdf=require(_0x65ad('0x0'));var emlformat=require(_0x65ad('0x1'));var rimraf=require(_0x65ad('0x2'));var zipdir=require(_0x65ad('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ad('0x4'));var moment=require(_0x65ad('0x5'));var BPromise=require(_0x65ad('0x6'));var Mustache=require(_0x65ad('0x7'));var util=require('util');var path=require(_0x65ad('0x8'));var sox=require('sox');var csv=require(_0x65ad('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x65ad('0xa'));var squel=require(_0x65ad('0xb'));var crypto=require(_0x65ad('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x65ad('0xd'));var toCsv=require(_0x65ad('0x9'));var querystring=require('querystring');var Papa=require(_0x65ad('0xe'));var Redis=require(_0x65ad('0xf'));var authService=require(_0x65ad('0x10'));var qs=require(_0x65ad('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x65ad('0x12'))(_0x65ad('0x13'));var utils=require(_0x65ad('0x14'));var config=require(_0x65ad('0x15'));var db=require(_0x65ad('0x16'))['db'];config[_0x65ad('0x17')]=_[_0x65ad('0x18')](config['redis'],{'host':_0x65ad('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65ad('0x17')]));require(_0x65ad('0x1a'))['register'](socket);function respondWithStatusCode(_0xe51ee2,_0x2ae0d3){_0x2ae0d3=_0x2ae0d3||0xcc;return function(_0xcb75){if(_0xcb75){return _0xe51ee2[_0x65ad('0x1b')](_0x2ae0d3);}return _0xe51ee2['status'](_0x2ae0d3)[_0x65ad('0x1c')]();};}function respondWithResult(_0x285f23,_0x234bce){_0x234bce=_0x234bce||0xc8;return function(_0x27e3db){if(_0x27e3db){return _0x285f23[_0x65ad('0x1d')](_0x234bce)[_0x65ad('0x1e')](_0x27e3db);}};}function respondWithFilteredResult(_0x10f521,_0x27c373){return function(_0x154470){if(_0x154470){var _0x3243a1=_0x154470['count'],_0x1503e4=_0x27c373['offset'],_0x38758f=_0x27c373[_0x65ad('0x1f')]+_0x27c373[_0x65ad('0x20')],_0x284edb;if(_0x38758f>=_0x3243a1){_0x38758f=_0x3243a1;_0x284edb=0xc8;}else{_0x284edb=0xce;}_0x10f521[_0x65ad('0x1d')](_0x284edb);return _0x10f521[_0x65ad('0x21')]('Content-Range',_0x1503e4+'-'+_0x38758f+'/'+_0x3243a1)[_0x65ad('0x1e')](_0x154470);}return null;};}function patchUpdates(_0x3e2b8b){return function(_0x272884){try{jsonpatch[_0x65ad('0x22')](_0x272884,_0x3e2b8b,!![]);}catch(_0x217f9d){return BPromise[_0x65ad('0x23')](_0x217f9d);}return _0x272884['save']();};}function saveUpdates(_0x5d03f1,_0x1826c2){return function(_0x52866a){if(_0x52866a){return _0x52866a[_0x65ad('0x24')](_0x5d03f1)['then'](function(_0x101943){return _0x101943;});}return null;};}function removeEntity(_0x68c0d0,_0x52b4cf){return function(_0x3946dd){if(_0x3946dd){return _0x3946dd['destroy']()[_0x65ad('0x25')](function(){var _0x1673e2=_0x3946dd['get']({'plain':!![]});var _0x1b34ff=_0x65ad('0x26');return db[_0x65ad('0x27')]['destroy']({'where':{'type':_0x1b34ff,'resourceId':_0x1673e2['id']}})['then'](function(){return _0x3946dd;});})[_0x65ad('0x25')](function(){_0x68c0d0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x213c40,_0x17cd15){return function(_0x1c977d){if(!_0x1c977d){_0x213c40[_0x65ad('0x1b')](0x194);}return _0x1c977d;};}function handleError(_0x551998,_0x42ce4e){_0x42ce4e=_0x42ce4e||0x1f4;return function(_0x20df09){logger['error'](_0x20df09[_0x65ad('0x28')]);if(_0x20df09[_0x65ad('0x29')]){delete _0x20df09['name'];}_0x551998['status'](_0x42ce4e)['send'](_0x20df09);};}exports['index']=function(_0x590d5d,_0x2e95ad){var _0x2700e9={},_0x52478d={},_0x1fa194={'count':0x0,'rows':[]};var _0x106d64=_[_0x65ad('0x2a')](db[_0x65ad('0x2b')][_0x65ad('0x2c')],function(_0x182ecd){return{'name':_0x182ecd[_0x65ad('0x2d')],'type':_0x182ecd[_0x65ad('0x2e')][_0x65ad('0x2f')]};});_0x52478d[_0x65ad('0x30')]=_[_0x65ad('0x2a')](_0x106d64,_0x65ad('0x29'));_0x52478d[_0x65ad('0x31')]=_[_0x65ad('0x32')](_0x590d5d['query']);_0x52478d[_0x65ad('0x33')]=_[_0x65ad('0x34')](_0x52478d['model'],_0x52478d[_0x65ad('0x31')]);_0x2700e9['attributes']=_[_0x65ad('0x34')](_0x52478d[_0x65ad('0x30')],qs['fields'](_0x590d5d[_0x65ad('0x31')]['fields']));_0x2700e9[_0x65ad('0x35')]=_0x2700e9[_0x65ad('0x35')][_0x65ad('0x36')]?_0x2700e9['attributes']:_0x52478d[_0x65ad('0x30')];if(!_0x590d5d[_0x65ad('0x31')]['hasOwnProperty']('nolimit')){_0x2700e9[_0x65ad('0x20')]=qs[_0x65ad('0x20')](_0x590d5d['query']['limit']);_0x2700e9[_0x65ad('0x1f')]=qs['offset'](_0x590d5d['query'][_0x65ad('0x1f')]);}_0x2700e9['order']=qs['sort'](_0x590d5d[_0x65ad('0x31')][_0x65ad('0x37')]);_0x2700e9['where']=qs[_0x65ad('0x33')](_['pick'](_0x590d5d['query'],_0x52478d[_0x65ad('0x33')]),_0x106d64);if(_0x590d5d[_0x65ad('0x31')][_0x65ad('0x38')]){_0x2700e9[_0x65ad('0x39')]=_['merge'](_0x2700e9[_0x65ad('0x39')],{'$or':_[_0x65ad('0x2a')](_0x106d64,function(_0x2dbc5f){if(_0x2dbc5f[_0x65ad('0x2e')]!==_0x65ad('0x3a')){var _0x1403b4={};_0x1403b4[_0x2dbc5f[_0x65ad('0x29')]]={'$like':'%'+_0x590d5d[_0x65ad('0x31')][_0x65ad('0x38')]+'%'};return _0x1403b4;}})});}_0x2700e9=_['merge']({},_0x2700e9,_0x590d5d[_0x65ad('0x3b')]);var _0x43321c={'where':_0x2700e9[_0x65ad('0x39')]};return db[_0x65ad('0x2b')][_0x65ad('0x3c')](_0x43321c)[_0x65ad('0x25')](function(_0x4ee6b3){_0x1fa194[_0x65ad('0x3c')]=_0x4ee6b3;if(_0x590d5d[_0x65ad('0x31')][_0x65ad('0x3d')]){_0x2700e9[_0x65ad('0x3e')]=[{'all':!![]}];}return db[_0x65ad('0x2b')]['findAll'](_0x2700e9);})[_0x65ad('0x25')](function(_0x37d16d){_0x1fa194[_0x65ad('0x3f')]=_0x37d16d;return _0x1fa194;})[_0x65ad('0x25')](respondWithFilteredResult(_0x2e95ad,_0x2700e9))[_0x65ad('0x40')](handleError(_0x2e95ad,null));};exports['show']=function(_0x433793,_0x433583){var _0x117439={'raw':![],'where':{'id':_0x433793[_0x65ad('0x41')]['id']}},_0x29ba22={};_0x29ba22[_0x65ad('0x30')]=_[_0x65ad('0x32')](db['Team'][_0x65ad('0x2c')]);_0x29ba22[_0x65ad('0x31')]=_[_0x65ad('0x32')](_0x433793[_0x65ad('0x31')]);_0x29ba22[_0x65ad('0x33')]=_[_0x65ad('0x34')](_0x29ba22[_0x65ad('0x30')],_0x29ba22[_0x65ad('0x31')]);_0x117439['attributes']=_[_0x65ad('0x34')](_0x29ba22['model'],qs[_0x65ad('0x42')](_0x433793[_0x65ad('0x31')][_0x65ad('0x42')]));_0x117439[_0x65ad('0x35')]=_0x117439[_0x65ad('0x35')]['length']?_0x117439[_0x65ad('0x35')]:_0x29ba22[_0x65ad('0x30')];if(_0x433793[_0x65ad('0x31')][_0x65ad('0x3d')]){_0x117439[_0x65ad('0x3e')]=[{'all':!![]}];}_0x117439=_['merge']({},_0x117439,_0x433793[_0x65ad('0x3b')]);return db[_0x65ad('0x2b')][_0x65ad('0x43')](_0x117439)[_0x65ad('0x25')](handleEntityNotFound(_0x433583,null))[_0x65ad('0x25')](respondWithResult(_0x433583,null))['catch'](handleError(_0x433583,null));};exports[_0x65ad('0x44')]=function(_0xcfc48,_0x4698e5){return db[_0x65ad('0x2b')][_0x65ad('0x44')](_0xcfc48['body'],{})[_0x65ad('0x25')](function(_0xaca88d){var _0x1b5ff0=_0xcfc48['user']['get']({'plain':!![]});if(!_0x1b5ff0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b5ff0[_0x65ad('0x45')]==='user'){var _0x30df00=_0xaca88d[_0x65ad('0x46')]({'plain':!![]});var _0x2b3b05='Teams';return db[_0x65ad('0x47')][_0x65ad('0x43')]({'where':{'name':_0x2b3b05,'userProfileId':_0x1b5ff0['userProfileId']},'raw':!![]})[_0x65ad('0x25')](function(_0x2c3a01){if(_0x2c3a01&&_0x2c3a01[_0x65ad('0x48')]===0x0){return db[_0x65ad('0x27')][_0x65ad('0x44')]({'name':_0x30df00[_0x65ad('0x29')],'resourceId':_0x30df00['id'],'type':_0x2c3a01['name'],'sectionId':_0x2c3a01['id']},{})[_0x65ad('0x25')](function(){return _0xaca88d;});}else{return _0xaca88d;}})[_0x65ad('0x40')](function(_0x363916){logger[_0x65ad('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x363916);throw _0x363916;});}return _0xaca88d;})[_0x65ad('0x25')](respondWithResult(_0x4698e5,0xc9))[_0x65ad('0x40')](handleError(_0x4698e5,null));};exports['update']=function(_0x3dbc05,_0x3e9ccc){if(_0x3dbc05[_0x65ad('0x4a')]['id']){delete _0x3dbc05[_0x65ad('0x4a')]['id'];}return db[_0x65ad('0x2b')][_0x65ad('0x43')]({'where':{'id':_0x3dbc05['params']['id']}})['then'](handleEntityNotFound(_0x3e9ccc,null))[_0x65ad('0x25')](saveUpdates(_0x3dbc05[_0x65ad('0x4a')],null))[_0x65ad('0x25')](respondWithResult(_0x3e9ccc,null))[_0x65ad('0x40')](handleError(_0x3e9ccc,null));};exports['destroy']=function(_0x102d14,_0x45a1a2){return db[_0x65ad('0x2b')][_0x65ad('0x43')]({'where':{'id':_0x102d14[_0x65ad('0x41')]['id']}})[_0x65ad('0x25')](handleEntityNotFound(_0x45a1a2,null))['then'](removeEntity(_0x45a1a2,null))[_0x65ad('0x40')](handleError(_0x45a1a2,null));};exports[_0x65ad('0x4b')]=function(_0x106e69,_0x30eade,_0x21c203){return db[_0x65ad('0x2b')][_0x65ad('0x4c')]({'where':{'id':_0x106e69[_0x65ad('0x41')]['id']}})[_0x65ad('0x25')](handleEntityNotFound(_0x30eade,null))[_0x65ad('0x25')](function(_0x46fcab){if(!_0x106e69[_0x65ad('0x31')][_0x65ad('0x4d')]||!utils[_0x65ad('0x4e')](_0x106e69[_0x65ad('0x31')][_0x65ad('0x4d')])){throw new db[(_0x65ad('0x4f'))][(_0x65ad('0x50'))](_0x65ad('0x51'));}var _0x31a9b5={};var _0xa36552={};_0xa36552['model']=_[_0x65ad('0x32')](db[_[_0x65ad('0x52')](_0x106e69['query'][_0x65ad('0x4d')]['toLowerCase']())+_0x65ad('0x53')][_0x65ad('0x2c')]);_0xa36552['query']=_[_0x65ad('0x32')](_0x106e69[_0x65ad('0x31')]);_0xa36552[_0x65ad('0x33')]=_[_0x65ad('0x34')](_0xa36552['model'],_0xa36552[_0x65ad('0x31')]);_0x31a9b5['attributes']=_[_0x65ad('0x34')](_0xa36552[_0x65ad('0x30')],qs[_0x65ad('0x42')](_0x106e69[_0x65ad('0x31')]['fields']));_0x31a9b5[_0x65ad('0x35')]=_0x31a9b5['attributes'][_0x65ad('0x36')]?_0x31a9b5[_0x65ad('0x35')]:_0xa36552[_0x65ad('0x30')];_0x31a9b5[_0x65ad('0x20')]=qs[_0x65ad('0x20')](_0x106e69[_0x65ad('0x31')]['limit']);_0x31a9b5[_0x65ad('0x1f')]=qs[_0x65ad('0x1f')](_0x106e69[_0x65ad('0x31')][_0x65ad('0x1f')]);_0x31a9b5[_0x65ad('0x54')]=qs[_0x65ad('0x37')](_0x106e69[_0x65ad('0x31')][_0x65ad('0x37')]);_0x31a9b5[_0x65ad('0x39')]=qs[_0x65ad('0x33')](_[_0x65ad('0x55')](_0x106e69['query'],_0xa36552[_0x65ad('0x33')]));_0x31a9b5=_[_0x65ad('0x56')]({},_0x31a9b5,_0x106e69[_0x65ad('0x3b')]);return _0x46fcab[_0x65ad('0x46')+_[_0x65ad('0x52')](_0x106e69[_0x65ad('0x31')][_0x65ad('0x4d')][_0x65ad('0x57')]())+_0x65ad('0x58')](_0x31a9b5);})[_0x65ad('0x25')](respondWithResult(_0x30eade,null))['catch'](handleError(_0x30eade,null));};exports[_0x65ad('0x59')]=function(_0x283879,_0x194c5b,_0x351ea6){return db[_0x65ad('0x2b')][_0x65ad('0x4c')]({'where':{'id':_0x283879[_0x65ad('0x41')]['id']}})[_0x65ad('0x25')](function(_0xe71bc){if(_0xe71bc){if(!_0x283879['body']['channel']||!utils[_0x65ad('0x4e')](_0x283879['body'][_0x65ad('0x4d')])){throw new db['Sequelize'][(_0x65ad('0x50'))](_0x65ad('0x51'));}return _0xe71bc['add'+_['capitalize'](_0x283879['body'][_0x65ad('0x4d')][_0x65ad('0x57')]())+_0x65ad('0x58')](_0x283879[_0x65ad('0x4a')][_0x65ad('0x5a')]);}return null;})['then'](handleEntityNotFound(_0x194c5b,null))[_0x65ad('0x25')](respondWithStatusCode(_0x194c5b,null))[_0x65ad('0x40')](handleError(_0x194c5b,null));};exports['removeQueues']=function(_0x258a3e,_0x4532b0,_0x507433){return db[_0x65ad('0x2b')][_0x65ad('0x4c')]({'where':{'id':_0x258a3e['params']['id']}})['then'](function(_0x251112){if(_0x251112){if(!_0x258a3e[_0x65ad('0x31')][_0x65ad('0x4d')]||!utils[_0x65ad('0x4e')](_0x258a3e['query'][_0x65ad('0x4d')])){throw new db[(_0x65ad('0x4f'))][(_0x65ad('0x50'))](_0x65ad('0x51'));}return _0x251112[_0x65ad('0x5b')+_[_0x65ad('0x52')](_0x258a3e[_0x65ad('0x31')]['channel'][_0x65ad('0x57')]())+'Queues'](_0x258a3e['query'][_0x65ad('0x5a')]);}return null;})[_0x65ad('0x25')](handleEntityNotFound(_0x4532b0,null))[_0x65ad('0x25')](respondWithStatusCode(_0x4532b0,null))[_0x65ad('0x40')](handleError(_0x4532b0,null));};exports[_0x65ad('0x5c')]=function(_0x34010c,_0x4c5a57,_0x19031c){return db['Team']['find']({'where':{'id':_0x34010c[_0x65ad('0x41')]['id']}})[_0x65ad('0x25')](handleEntityNotFound(_0x4c5a57,null))['then'](function(_0x8a4f35){if(_0x8a4f35){var _0x50ac7b=['Voice',_0x65ad('0x5d'),_0x65ad('0x5e'),_0x65ad('0x5f'),_0x65ad('0x60'),'Openchannel',_0x65ad('0x61')];return BPromise[_0x65ad('0x62')](_0x50ac7b,function(_0x4ef138){return _0x8a4f35[_0x65ad('0x46')+_0x4ef138+_0x65ad('0x58')]({'attributes':['id','name']})[_0x65ad('0x25')](function(_0x489197){return BPromise[_0x65ad('0x62')](_0x489197,function(_0x14dbb8){return _0x14dbb8[_0x65ad('0x5c')](_0x34010c[_0x65ad('0x4a')]['ids'])[_0x65ad('0x25')](function(){if(_0x4ef138===_0x65ad('0x63')){return db[_0x65ad('0x64')]['findAll']({'where':{'id':_0x34010c[_0x65ad('0x4a')][_0x65ad('0x5a')]},'attributes':['id',_0x65ad('0x29'),_0x65ad('0x65'),'voicePause',_0x65ad('0x66')],'raw':!![]})[_0x65ad('0x25')](function(_0xf02793){return BPromise['each'](_[_0x65ad('0x38')](_0xf02793,{'online':0x1}),function(_0x109995){return db['UserVoiceQueueRt'][_0x65ad('0x67')]({'membername':_0x109995[_0x65ad('0x29')],'UserId':_0x109995['id'],'queue_name':_0x14dbb8[_0x65ad('0x29')],'VoiceQueueId':_0x14dbb8['id'],'interface':_[_0x65ad('0x68')](_0x109995[_0x65ad('0x66')])?util['format'](_0x65ad('0x69'),_0x109995['name']):_0x109995[_0x65ad('0x66')],'paused':_0x109995['voicePause']||![],'penalty':0x0});});});}});});})[_0x65ad('0x25')](function(){return _0x8a4f35;});})[_0x65ad('0x25')](function(){return _0x8a4f35;});}})[_0x65ad('0x25')](function(_0x10dcba){if(_0x10dcba){return _0x10dcba[_0x65ad('0x5c')](_0x34010c[_0x65ad('0x4a')][_0x65ad('0x5a')],_['omit'](_0x34010c[_0x65ad('0x4a')],[_0x65ad('0x5a'),'id'])||{})[_0x65ad('0x6a')](function(_0x11c94c){for(var _0x57904d=0x0;_0x57904d<_0x34010c[_0x65ad('0x4a')][_0x65ad('0x5a')][_0x65ad('0x36')];_0x57904d+=0x1){socket[_0x65ad('0x6b')](_0x65ad('0x6c'),{'UserId':_0x34010c[_0x65ad('0x4a')]['ids'][_0x57904d],'TeamId':_0x34010c['params']['id']});}return _0x11c94c;});}})[_0x65ad('0x25')](respondWithResult(_0x4c5a57,null))['catch'](handleError(_0x4c5a57,null));};exports[_0x65ad('0x6d')]=function(_0x392318,_0x2f4b9c,_0x299559){return db['Team'][_0x65ad('0x43')]({'where':{'id':_0x392318[_0x65ad('0x41')]['id']}})['then'](handleEntityNotFound(_0x2f4b9c,null))[_0x65ad('0x25')](function(_0x7168cd){if(_0x7168cd){return BPromise[_0x65ad('0x62')]([_0x65ad('0x6e'),_0x65ad('0x6f'),_0x65ad('0x70'),_0x65ad('0x71'),_0x65ad('0x72'),_0x65ad('0x73'),_0x65ad('0x74')],function(_0x3e75bf){return _0x7168cd[_0x65ad('0x46')+_['capitalize'](_0x3e75bf)+_0x65ad('0x58')]({'attributes':['id',_0x65ad('0x29')]})[_0x65ad('0x25')](function(_0x43cb92){return BPromise[_0x65ad('0x62')](_0x43cb92,function(_0xe1be0a){return _0xe1be0a[_0x65ad('0x6d')](_0x392318['query'][_0x65ad('0x5a')])[_0x65ad('0x25')](function(){if(_0x3e75bf===_0x65ad('0x6e')){return db[_0x65ad('0x75')][_0x65ad('0x76')]({'where':{'VoiceQueueId':_0xe1be0a['id'],'UserId':_0x392318[_0x65ad('0x31')][_0x65ad('0x5a')]}});}});});})[_0x65ad('0x25')](function(){return _0x7168cd;});})[_0x65ad('0x25')](function(){return _0x7168cd;});}})[_0x65ad('0x25')](function(_0x56a526){if(_0x56a526){return _0x56a526[_0x65ad('0x6d')](_0x392318['query'][_0x65ad('0x5a')])[_0x65ad('0x25')](function(){if(_[_0x65ad('0x77')](_0x392318[_0x65ad('0x31')][_0x65ad('0x5a')])){for(var _0x2cff99=0x0;_0x2cff99<_0x392318['query'][_0x65ad('0x5a')][_0x65ad('0x36')];_0x2cff99+=0x1){socket[_0x65ad('0x6b')](_0x65ad('0x78'),{'UserId':Number(_0x392318[_0x65ad('0x31')][_0x65ad('0x5a')][_0x2cff99]),'TeamId':Number(_0x392318['params']['id'])});}}else{socket[_0x65ad('0x6b')](_0x65ad('0x78'),{'UserId':Number(_0x392318[_0x65ad('0x31')]['ids']),'TeamId':Number(_0x392318['params']['id'])});}});}})[_0x65ad('0x25')](respondWithStatusCode(_0x2f4b9c,null))[_0x65ad('0x40')](handleError(_0x2f4b9c,null));};exports[_0x65ad('0x79')]=function(_0x423431,_0x4318ef,_0x3f97ec){var _0x36f116={};var _0x236e37={};var _0x2a38c2;var _0x528347;return db[_0x65ad('0x2b')]['findOne']({'where':{'id':_0x423431[_0x65ad('0x41')]['id']}})[_0x65ad('0x25')](handleEntityNotFound(_0x4318ef,null))[_0x65ad('0x25')](function(_0x2fdcb3){if(_0x2fdcb3){_0x2a38c2=_0x2fdcb3;_0x236e37['model']=_['keys'](db['User'][_0x65ad('0x2c')]);_0x236e37[_0x65ad('0x31')]=_[_0x65ad('0x32')](_0x423431[_0x65ad('0x31')]);_0x236e37[_0x65ad('0x33')]=_[_0x65ad('0x34')](_0x236e37['model'],_0x236e37[_0x65ad('0x31')]);_0x36f116['attributes']=_[_0x65ad('0x34')](_0x236e37[_0x65ad('0x30')],qs['fields'](_0x423431[_0x65ad('0x31')][_0x65ad('0x42')]));_0x36f116[_0x65ad('0x35')]=_0x36f116['attributes']['length']?_0x36f116[_0x65ad('0x35')]:_0x236e37[_0x65ad('0x30')];_0x36f116[_0x65ad('0x54')]=qs['sort'](_0x423431[_0x65ad('0x31')][_0x65ad('0x37')]);_0x36f116[_0x65ad('0x39')]=qs['filters'](_[_0x65ad('0x55')](_0x423431[_0x65ad('0x31')],_0x236e37[_0x65ad('0x33')]));if(_0x423431['query'][_0x65ad('0x38')]){_0x36f116[_0x65ad('0x39')]=_[_0x65ad('0x56')](_0x36f116[_0x65ad('0x39')],{'$or':_[_0x65ad('0x2a')](_0x36f116[_0x65ad('0x35')],function(_0x1b6690){var _0x581fbf={};_0x581fbf[_0x1b6690]={'$like':'%'+_0x423431[_0x65ad('0x31')]['filter']+'%'};return _0x581fbf;})});}_0x36f116=_['merge']({},_0x36f116,_0x423431[_0x65ad('0x3b')]);return _0x2a38c2[_0x65ad('0x79')](_0x36f116);}})[_0x65ad('0x25')](function(_0x291ea7){if(_0x291ea7){_0x528347=_0x291ea7[_0x65ad('0x36')];if(!_0x423431[_0x65ad('0x31')]['hasOwnProperty']('nolimit')){_0x36f116[_0x65ad('0x20')]=qs['limit'](_0x423431[_0x65ad('0x31')]['limit']);_0x36f116[_0x65ad('0x1f')]=qs[_0x65ad('0x1f')](_0x423431['query'][_0x65ad('0x1f')]);}return _0x2a38c2['getAgents'](_0x36f116);}})[_0x65ad('0x25')](function(_0x217f4a){if(_0x217f4a){return _0x217f4a?{'count':_0x528347,'rows':_0x217f4a}:null;}})[_0x65ad('0x25')](respondWithResult(_0x4318ef,null))[_0x65ad('0x40')](handleError(_0x4318ef,null));}; \ No newline at end of file +var _0xcf8c=['lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./team.socket','register','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','Teams','sendStatus','error','stack','name','index','map','Team','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','get','role','UserProfileSection','find','autoAssociation','body','getQueues','findOne','channel','isValidChannel','Sequelize','Unknown\x20channel','capitalize','toLowerCase','Queue','Queues','addQueues','ValidationError','add','ids','remove','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','each','User','voicePause','interface','upsert','isNil','SIP/%s','emit','voice','chat','mail','sms','fax','whatsapp','removeAgents','isArray','length','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xcf8c,0xf0));var _0xccf8=function(_0x3c26fc,_0x5026e4){_0x3c26fc=_0x3c26fc-0x0;var _0x4b36d3=_0xcf8c[_0x3c26fc];return _0x4b36d3;};'use strict';var pdf=require(_0xccf8('0x0'));var emlformat=require(_0xccf8('0x1'));var rimraf=require(_0xccf8('0x2'));var zipdir=require(_0xccf8('0x3'));var jsonpatch=require(_0xccf8('0x4'));var rp=require(_0xccf8('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xccf8('0x6'));var util=require(_0xccf8('0x7'));var path=require(_0xccf8('0x8'));var sox=require(_0xccf8('0x9'));var csv=require(_0xccf8('0xa'));var ejs=require(_0xccf8('0xb'));var fs=require('fs');var _=require(_0xccf8('0xc'));var squel=require(_0xccf8('0xd'));var crypto=require(_0xccf8('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xccf8('0xa'));var querystring=require(_0xccf8('0xf'));var Papa=require(_0xccf8('0x10'));var Redis=require(_0xccf8('0x11'));var authService=require(_0xccf8('0x12'));var qs=require(_0xccf8('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xccf8('0x14'))('api');var utils=require(_0xccf8('0x15'));var config=require(_0xccf8('0x16'));var db=require('../../mysqldb')['db'];config[_0xccf8('0x17')]=_['defaults'](config['redis'],{'host':_0xccf8('0x18'),'port':0x18eb});var socket=require(_0xccf8('0x19'))(new Redis(config[_0xccf8('0x17')]));require(_0xccf8('0x1a'))[_0xccf8('0x1b')](socket);function respondWithStatusCode(_0x499099,_0x3347aa){_0x3347aa=_0x3347aa||0xcc;return function(_0x4c99d3){if(_0x4c99d3){return _0x499099['sendStatus'](_0x3347aa);}return _0x499099[_0xccf8('0x1c')](_0x3347aa)[_0xccf8('0x1d')]();};}function respondWithResult(_0x1b80f0,_0x3fcc88){_0x3fcc88=_0x3fcc88||0xc8;return function(_0xbb6770){if(_0xbb6770){return _0x1b80f0[_0xccf8('0x1c')](_0x3fcc88)[_0xccf8('0x1e')](_0xbb6770);}};}function respondWithFilteredResult(_0x393267,_0x340c64){return function(_0x5a4b4e){if(_0x5a4b4e){var _0x569322=_0x5a4b4e[_0xccf8('0x1f')],_0xcc595a=_0x340c64[_0xccf8('0x20')],_0x40a9af=_0x340c64[_0xccf8('0x20')]+_0x340c64['limit'],_0x1ebb7e;if(_0x40a9af>=_0x569322){_0x40a9af=_0x569322;_0x1ebb7e=0xc8;}else{_0x1ebb7e=0xce;}_0x393267['status'](_0x1ebb7e);return _0x393267[_0xccf8('0x21')](_0xccf8('0x22'),_0xcc595a+'-'+_0x40a9af+'/'+_0x569322)[_0xccf8('0x1e')](_0x5a4b4e);}return null;};}function patchUpdates(_0x28d48f){return function(_0x548437){try{jsonpatch[_0xccf8('0x23')](_0x548437,_0x28d48f,!![]);}catch(_0xe03a49){return BPromise[_0xccf8('0x24')](_0xe03a49);}return _0x548437[_0xccf8('0x25')]();};}function saveUpdates(_0x498537,_0xc38a8d){return function(_0x72262b){if(_0x72262b){return _0x72262b[_0xccf8('0x26')](_0x498537)['then'](function(_0x364d38){return _0x364d38;});}return null;};}function removeEntity(_0x4905aa,_0x4e3dc9){return function(_0x40bebe){if(_0x40bebe){return _0x40bebe[_0xccf8('0x27')]()[_0xccf8('0x28')](function(){var _0x33681b=_0x40bebe['get']({'plain':!![]});var _0x21c478=_0xccf8('0x29');return db['UserProfileResource'][_0xccf8('0x27')]({'where':{'type':_0x21c478,'resourceId':_0x33681b['id']}})[_0xccf8('0x28')](function(){return _0x40bebe;});})['then'](function(){_0x4905aa[_0xccf8('0x1c')](0xcc)[_0xccf8('0x1d')]();});}};}function handleEntityNotFound(_0x47fbeb,_0x8f3e4e){return function(_0x86efa5){if(!_0x86efa5){_0x47fbeb[_0xccf8('0x2a')](0x194);}return _0x86efa5;};}function handleError(_0x2d8ef9,_0x3023b7){_0x3023b7=_0x3023b7||0x1f4;return function(_0x347ae9){logger[_0xccf8('0x2b')](_0x347ae9[_0xccf8('0x2c')]);if(_0x347ae9[_0xccf8('0x2d')]){delete _0x347ae9[_0xccf8('0x2d')];}_0x2d8ef9[_0xccf8('0x1c')](_0x3023b7)['send'](_0x347ae9);};}exports[_0xccf8('0x2e')]=function(_0x3d0824,_0x34bc68){var _0x1a225b={},_0x7fd6a9={},_0x331191={'count':0x0,'rows':[]};var _0x3af597=_[_0xccf8('0x2f')](db[_0xccf8('0x30')][_0xccf8('0x31')],function(_0x219329){return{'name':_0x219329[_0xccf8('0x32')],'type':_0x219329['type'][_0xccf8('0x33')]};});_0x7fd6a9[_0xccf8('0x34')]=_[_0xccf8('0x2f')](_0x3af597,_0xccf8('0x2d'));_0x7fd6a9[_0xccf8('0x35')]=_[_0xccf8('0x36')](_0x3d0824[_0xccf8('0x35')]);_0x7fd6a9[_0xccf8('0x37')]=_[_0xccf8('0x38')](_0x7fd6a9[_0xccf8('0x34')],_0x7fd6a9['query']);_0x1a225b[_0xccf8('0x39')]=_['intersection'](_0x7fd6a9[_0xccf8('0x34')],qs[_0xccf8('0x3a')](_0x3d0824['query'][_0xccf8('0x3a')]));_0x1a225b['attributes']=_0x1a225b[_0xccf8('0x39')]['length']?_0x1a225b[_0xccf8('0x39')]:_0x7fd6a9[_0xccf8('0x34')];if(!_0x3d0824[_0xccf8('0x35')][_0xccf8('0x3b')](_0xccf8('0x3c'))){_0x1a225b['limit']=qs[_0xccf8('0x3d')](_0x3d0824[_0xccf8('0x35')]['limit']);_0x1a225b[_0xccf8('0x20')]=qs[_0xccf8('0x20')](_0x3d0824['query']['offset']);}_0x1a225b[_0xccf8('0x3e')]=qs[_0xccf8('0x3f')](_0x3d0824['query'][_0xccf8('0x3f')]);_0x1a225b[_0xccf8('0x40')]=qs['filters'](_[_0xccf8('0x41')](_0x3d0824[_0xccf8('0x35')],_0x7fd6a9[_0xccf8('0x37')]),_0x3af597);if(_0x3d0824['query'][_0xccf8('0x42')]){_0x1a225b[_0xccf8('0x40')]=_[_0xccf8('0x43')](_0x1a225b[_0xccf8('0x40')],{'$or':_['map'](_0x3af597,function(_0x89e1ea){if(_0x89e1ea[_0xccf8('0x44')]!==_0xccf8('0x45')){var _0x2dc4a6={};_0x2dc4a6[_0x89e1ea[_0xccf8('0x2d')]]={'$like':'%'+_0x3d0824[_0xccf8('0x35')]['filter']+'%'};return _0x2dc4a6;}})});}_0x1a225b=_[_0xccf8('0x43')]({},_0x1a225b,_0x3d0824[_0xccf8('0x46')]);var _0x484ac1={'where':_0x1a225b[_0xccf8('0x40')]};return db[_0xccf8('0x30')]['count'](_0x484ac1)[_0xccf8('0x28')](function(_0x344919){_0x331191[_0xccf8('0x1f')]=_0x344919;if(_0x3d0824[_0xccf8('0x35')][_0xccf8('0x47')]){_0x1a225b[_0xccf8('0x48')]=[{'all':!![]}];}return db['Team'][_0xccf8('0x49')](_0x1a225b);})[_0xccf8('0x28')](function(_0x2cab88){_0x331191[_0xccf8('0x4a')]=_0x2cab88;return _0x331191;})[_0xccf8('0x28')](respondWithFilteredResult(_0x34bc68,_0x1a225b))['catch'](handleError(_0x34bc68,null));};exports[_0xccf8('0x4b')]=function(_0x1314ed,_0x37fa6e){var _0x53cdca={'raw':![],'where':{'id':_0x1314ed[_0xccf8('0x4c')]['id']}},_0x2e5565={};_0x2e5565[_0xccf8('0x34')]=_[_0xccf8('0x36')](db[_0xccf8('0x30')][_0xccf8('0x31')]);_0x2e5565[_0xccf8('0x35')]=_[_0xccf8('0x36')](_0x1314ed[_0xccf8('0x35')]);_0x2e5565[_0xccf8('0x37')]=_[_0xccf8('0x38')](_0x2e5565[_0xccf8('0x34')],_0x2e5565[_0xccf8('0x35')]);_0x53cdca['attributes']=_[_0xccf8('0x38')](_0x2e5565[_0xccf8('0x34')],qs[_0xccf8('0x3a')](_0x1314ed['query'][_0xccf8('0x3a')]));_0x53cdca['attributes']=_0x53cdca[_0xccf8('0x39')]['length']?_0x53cdca[_0xccf8('0x39')]:_0x2e5565[_0xccf8('0x34')];if(_0x1314ed[_0xccf8('0x35')][_0xccf8('0x47')]){_0x53cdca['include']=[{'all':!![]}];}_0x53cdca=_['merge']({},_0x53cdca,_0x1314ed[_0xccf8('0x46')]);return db['Team']['find'](_0x53cdca)[_0xccf8('0x28')](handleEntityNotFound(_0x37fa6e,null))[_0xccf8('0x28')](respondWithResult(_0x37fa6e,null))[_0xccf8('0x4d')](handleError(_0x37fa6e,null));};exports[_0xccf8('0x4e')]=function(_0x463db9,_0xdf752f){return db[_0xccf8('0x30')][_0xccf8('0x4e')](_0x463db9['body'],{})[_0xccf8('0x28')](function(_0x24d2db){var _0x414cd0=_0x463db9['user'][_0xccf8('0x4f')]({'plain':!![]});if(!_0x414cd0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x414cd0[_0xccf8('0x50')]==='user'){var _0x275199=_0x24d2db[_0xccf8('0x4f')]({'plain':!![]});var _0x5f520a=_0xccf8('0x29');return db[_0xccf8('0x51')][_0xccf8('0x52')]({'where':{'name':_0x5f520a,'userProfileId':_0x414cd0['userProfileId']},'raw':!![]})[_0xccf8('0x28')](function(_0x386b8d){if(_0x386b8d&&_0x386b8d[_0xccf8('0x53')]===0x0){return db['UserProfileResource'][_0xccf8('0x4e')]({'name':_0x275199[_0xccf8('0x2d')],'resourceId':_0x275199['id'],'type':_0x386b8d[_0xccf8('0x2d')],'sectionId':_0x386b8d['id']},{})['then'](function(){return _0x24d2db;});}else{return _0x24d2db;}})['catch'](function(_0x394e06){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x394e06);throw _0x394e06;});}return _0x24d2db;})['then'](respondWithResult(_0xdf752f,0xc9))[_0xccf8('0x4d')](handleError(_0xdf752f,null));};exports[_0xccf8('0x26')]=function(_0xb23349,_0x1b3475){if(_0xb23349[_0xccf8('0x54')]['id']){delete _0xb23349[_0xccf8('0x54')]['id'];}return db[_0xccf8('0x30')][_0xccf8('0x52')]({'where':{'id':_0xb23349['params']['id']}})['then'](handleEntityNotFound(_0x1b3475,null))[_0xccf8('0x28')](saveUpdates(_0xb23349[_0xccf8('0x54')],null))[_0xccf8('0x28')](respondWithResult(_0x1b3475,null))[_0xccf8('0x4d')](handleError(_0x1b3475,null));};exports[_0xccf8('0x27')]=function(_0x100bcd,_0x17b4b2){return db[_0xccf8('0x30')][_0xccf8('0x52')]({'where':{'id':_0x100bcd[_0xccf8('0x4c')]['id']}})[_0xccf8('0x28')](handleEntityNotFound(_0x17b4b2,null))['then'](removeEntity(_0x17b4b2,null))[_0xccf8('0x4d')](handleError(_0x17b4b2,null));};exports[_0xccf8('0x55')]=function(_0x5e646a,_0x1c675c,_0xf827e8){return db['Team'][_0xccf8('0x56')]({'where':{'id':_0x5e646a[_0xccf8('0x4c')]['id']}})[_0xccf8('0x28')](handleEntityNotFound(_0x1c675c,null))['then'](function(_0x20df50){if(!_0x5e646a['query'][_0xccf8('0x57')]||!utils[_0xccf8('0x58')](_0x5e646a[_0xccf8('0x35')][_0xccf8('0x57')])){throw new db[(_0xccf8('0x59'))]['ValidationError'](_0xccf8('0x5a'));}var _0x591c65={};var _0xc455c2={};_0xc455c2['model']=_[_0xccf8('0x36')](db[_[_0xccf8('0x5b')](_0x5e646a['query'][_0xccf8('0x57')][_0xccf8('0x5c')]())+_0xccf8('0x5d')][_0xccf8('0x31')]);_0xc455c2[_0xccf8('0x35')]=_[_0xccf8('0x36')](_0x5e646a['query']);_0xc455c2[_0xccf8('0x37')]=_[_0xccf8('0x38')](_0xc455c2[_0xccf8('0x34')],_0xc455c2['query']);_0x591c65['attributes']=_['intersection'](_0xc455c2['model'],qs[_0xccf8('0x3a')](_0x5e646a[_0xccf8('0x35')][_0xccf8('0x3a')]));_0x591c65[_0xccf8('0x39')]=_0x591c65[_0xccf8('0x39')]['length']?_0x591c65[_0xccf8('0x39')]:_0xc455c2[_0xccf8('0x34')];_0x591c65[_0xccf8('0x3d')]=qs[_0xccf8('0x3d')](_0x5e646a[_0xccf8('0x35')]['limit']);_0x591c65[_0xccf8('0x20')]=qs['offset'](_0x5e646a[_0xccf8('0x35')][_0xccf8('0x20')]);_0x591c65[_0xccf8('0x3e')]=qs['sort'](_0x5e646a['query']['sort']);_0x591c65[_0xccf8('0x40')]=qs[_0xccf8('0x37')](_['pick'](_0x5e646a['query'],_0xc455c2[_0xccf8('0x37')]));_0x591c65=_['merge']({},_0x591c65,_0x5e646a[_0xccf8('0x46')]);return _0x20df50[_0xccf8('0x4f')+_['capitalize'](_0x5e646a[_0xccf8('0x35')][_0xccf8('0x57')][_0xccf8('0x5c')]())+_0xccf8('0x5e')](_0x591c65);})[_0xccf8('0x28')](respondWithResult(_0x1c675c,null))['catch'](handleError(_0x1c675c,null));};exports[_0xccf8('0x5f')]=function(_0x10a829,_0x4d722b,_0x2ae602){return db[_0xccf8('0x30')]['findOne']({'where':{'id':_0x10a829[_0xccf8('0x4c')]['id']}})['then'](function(_0x5b4c25){if(_0x5b4c25){if(!_0x10a829[_0xccf8('0x54')][_0xccf8('0x57')]||!utils[_0xccf8('0x58')](_0x10a829['body'][_0xccf8('0x57')])){throw new db[(_0xccf8('0x59'))][(_0xccf8('0x60'))]('Unknown\x20channel');}return _0x5b4c25[_0xccf8('0x61')+_[_0xccf8('0x5b')](_0x10a829[_0xccf8('0x54')]['channel']['toLowerCase']())+_0xccf8('0x5e')](_0x10a829[_0xccf8('0x54')][_0xccf8('0x62')]);}return null;})['then'](handleEntityNotFound(_0x4d722b,null))[_0xccf8('0x28')](respondWithStatusCode(_0x4d722b,null))[_0xccf8('0x4d')](handleError(_0x4d722b,null));};exports['removeQueues']=function(_0x5f2065,_0x7471ef,_0x326ba3){return db[_0xccf8('0x30')][_0xccf8('0x56')]({'where':{'id':_0x5f2065[_0xccf8('0x4c')]['id']}})[_0xccf8('0x28')](function(_0x32302f){if(_0x32302f){if(!_0x5f2065[_0xccf8('0x35')][_0xccf8('0x57')]||!utils[_0xccf8('0x58')](_0x5f2065[_0xccf8('0x35')][_0xccf8('0x57')])){throw new db['Sequelize'][(_0xccf8('0x60'))](_0xccf8('0x5a'));}return _0x32302f[_0xccf8('0x63')+_[_0xccf8('0x5b')](_0x5f2065['query'][_0xccf8('0x57')]['toLowerCase']())+_0xccf8('0x5e')](_0x5f2065[_0xccf8('0x35')][_0xccf8('0x62')]);}return null;})[_0xccf8('0x28')](handleEntityNotFound(_0x7471ef,null))[_0xccf8('0x28')](respondWithStatusCode(_0x7471ef,null))[_0xccf8('0x4d')](handleError(_0x7471ef,null));};exports[_0xccf8('0x64')]=function(_0x3e7cb2,_0x50707d,_0x306f96){return db['Team']['find']({'where':{'id':_0x3e7cb2[_0xccf8('0x4c')]['id']}})[_0xccf8('0x28')](handleEntityNotFound(_0x50707d,null))[_0xccf8('0x28')](function(_0x28615f){if(_0x28615f){var _0x593a67=[_0xccf8('0x65'),_0xccf8('0x66'),_0xccf8('0x67'),_0xccf8('0x68'),_0xccf8('0x69'),_0xccf8('0x6a'),'Whatsapp'];return BPromise[_0xccf8('0x6b')](_0x593a67,function(_0x4d63f7){return _0x28615f[_0xccf8('0x4f')+_0x4d63f7+_0xccf8('0x5e')]({'attributes':['id',_0xccf8('0x2d')]})[_0xccf8('0x28')](function(_0x12fc4c){return BPromise[_0xccf8('0x6b')](_0x12fc4c,function(_0x20e562){return _0x20e562['addAgents'](_0x3e7cb2[_0xccf8('0x54')][_0xccf8('0x62')])[_0xccf8('0x28')](function(){if(_0x4d63f7===_0xccf8('0x65')){return db[_0xccf8('0x6c')]['findAll']({'where':{'id':_0x3e7cb2[_0xccf8('0x54')][_0xccf8('0x62')]},'attributes':['id','name','online',_0xccf8('0x6d'),_0xccf8('0x6e')],'raw':!![]})[_0xccf8('0x28')](function(_0x7555e2){return BPromise[_0xccf8('0x6b')](_[_0xccf8('0x42')](_0x7555e2,{'online':0x1}),function(_0x1f5d5a){return db['UserVoiceQueueRt'][_0xccf8('0x6f')]({'membername':_0x1f5d5a[_0xccf8('0x2d')],'UserId':_0x1f5d5a['id'],'queue_name':_0x20e562['name'],'VoiceQueueId':_0x20e562['id'],'interface':_[_0xccf8('0x70')](_0x1f5d5a[_0xccf8('0x6e')])?util['format'](_0xccf8('0x71'),_0x1f5d5a[_0xccf8('0x2d')]):_0x1f5d5a[_0xccf8('0x6e')],'paused':_0x1f5d5a[_0xccf8('0x6d')]||![],'penalty':0x0});});});}});});})['then'](function(){return _0x28615f;});})[_0xccf8('0x28')](function(){return _0x28615f;});}})[_0xccf8('0x28')](function(_0x50c2fd){if(_0x50c2fd){return _0x50c2fd['addAgents'](_0x3e7cb2[_0xccf8('0x54')]['ids'],_['omit'](_0x3e7cb2[_0xccf8('0x54')],[_0xccf8('0x62'),'id'])||{})['spread'](function(_0x48a62e){for(var _0x183b08=0x0;_0x183b08<_0x3e7cb2[_0xccf8('0x54')][_0xccf8('0x62')]['length'];_0x183b08+=0x1){socket[_0xccf8('0x72')]('userTeam:save',{'UserId':_0x3e7cb2[_0xccf8('0x54')][_0xccf8('0x62')][_0x183b08],'TeamId':_0x3e7cb2[_0xccf8('0x4c')]['id']});}return _0x48a62e;});}})[_0xccf8('0x28')](respondWithResult(_0x50707d,null))[_0xccf8('0x4d')](handleError(_0x50707d,null));};exports['removeAgents']=function(_0x5a93e6,_0x5bf550,_0x1a6797){return db['Team'][_0xccf8('0x52')]({'where':{'id':_0x5a93e6[_0xccf8('0x4c')]['id']}})[_0xccf8('0x28')](handleEntityNotFound(_0x5bf550,null))[_0xccf8('0x28')](function(_0x2d36da){if(_0x2d36da){return BPromise[_0xccf8('0x6b')]([_0xccf8('0x73'),_0xccf8('0x74'),_0xccf8('0x75'),_0xccf8('0x76'),_0xccf8('0x77'),'openchannel',_0xccf8('0x78')],function(_0x5e0071){return _0x2d36da[_0xccf8('0x4f')+_[_0xccf8('0x5b')](_0x5e0071)+'Queues']({'attributes':['id',_0xccf8('0x2d')]})['then'](function(_0x1e8884){return BPromise[_0xccf8('0x6b')](_0x1e8884,function(_0x436da2){return _0x436da2['removeAgents'](_0x5a93e6['query'][_0xccf8('0x62')])[_0xccf8('0x28')](function(){if(_0x5e0071===_0xccf8('0x73')){return db['UserVoiceQueueRt'][_0xccf8('0x27')]({'where':{'VoiceQueueId':_0x436da2['id'],'UserId':_0x5a93e6[_0xccf8('0x35')]['ids']}});}});});})[_0xccf8('0x28')](function(){return _0x2d36da;});})[_0xccf8('0x28')](function(){return _0x2d36da;});}})[_0xccf8('0x28')](function(_0x5f52eb){if(_0x5f52eb){return _0x5f52eb[_0xccf8('0x79')](_0x5a93e6[_0xccf8('0x35')][_0xccf8('0x62')])['then'](function(){if(_[_0xccf8('0x7a')](_0x5a93e6[_0xccf8('0x35')][_0xccf8('0x62')])){for(var _0x36f5ac=0x0;_0x36f5ac<_0x5a93e6[_0xccf8('0x35')]['ids'][_0xccf8('0x7b')];_0x36f5ac+=0x1){socket[_0xccf8('0x72')](_0xccf8('0x7c'),{'UserId':Number(_0x5a93e6[_0xccf8('0x35')]['ids'][_0x36f5ac]),'TeamId':Number(_0x5a93e6['params']['id'])});}}else{socket[_0xccf8('0x72')](_0xccf8('0x7c'),{'UserId':Number(_0x5a93e6['query'][_0xccf8('0x62')]),'TeamId':Number(_0x5a93e6[_0xccf8('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x5bf550,null))[_0xccf8('0x4d')](handleError(_0x5bf550,null));};exports[_0xccf8('0x7d')]=function(_0x32930b,_0x2642c8,_0x2ebe30){var _0x3cdfe9={};var _0x3c7e8a={};var _0x14bdba;var _0x1bdefc;return db[_0xccf8('0x30')][_0xccf8('0x56')]({'where':{'id':_0x32930b['params']['id']}})[_0xccf8('0x28')](handleEntityNotFound(_0x2642c8,null))[_0xccf8('0x28')](function(_0x316e3f){if(_0x316e3f){_0x14bdba=_0x316e3f;_0x3c7e8a['model']=_[_0xccf8('0x36')](db[_0xccf8('0x6c')][_0xccf8('0x31')]);_0x3c7e8a['query']=_[_0xccf8('0x36')](_0x32930b[_0xccf8('0x35')]);_0x3c7e8a[_0xccf8('0x37')]=_[_0xccf8('0x38')](_0x3c7e8a[_0xccf8('0x34')],_0x3c7e8a[_0xccf8('0x35')]);_0x3cdfe9['attributes']=_['intersection'](_0x3c7e8a[_0xccf8('0x34')],qs[_0xccf8('0x3a')](_0x32930b[_0xccf8('0x35')][_0xccf8('0x3a')]));_0x3cdfe9[_0xccf8('0x39')]=_0x3cdfe9[_0xccf8('0x39')][_0xccf8('0x7b')]?_0x3cdfe9[_0xccf8('0x39')]:_0x3c7e8a['model'];_0x3cdfe9[_0xccf8('0x3e')]=qs[_0xccf8('0x3f')](_0x32930b[_0xccf8('0x35')]['sort']);_0x3cdfe9['where']=qs[_0xccf8('0x37')](_[_0xccf8('0x41')](_0x32930b['query'],_0x3c7e8a[_0xccf8('0x37')]));if(_0x32930b[_0xccf8('0x35')][_0xccf8('0x42')]){_0x3cdfe9[_0xccf8('0x40')]=_['merge'](_0x3cdfe9[_0xccf8('0x40')],{'$or':_[_0xccf8('0x2f')](_0x3cdfe9[_0xccf8('0x39')],function(_0x157daa){var _0x3ff7f1={};_0x3ff7f1[_0x157daa]={'$like':'%'+_0x32930b[_0xccf8('0x35')][_0xccf8('0x42')]+'%'};return _0x3ff7f1;})});}_0x3cdfe9=_[_0xccf8('0x43')]({},_0x3cdfe9,_0x32930b['options']);return _0x14bdba[_0xccf8('0x7d')](_0x3cdfe9);}})['then'](function(_0x2d5bf7){if(_0x2d5bf7){_0x1bdefc=_0x2d5bf7[_0xccf8('0x7b')];if(!_0x32930b[_0xccf8('0x35')]['hasOwnProperty'](_0xccf8('0x3c'))){_0x3cdfe9[_0xccf8('0x3d')]=qs['limit'](_0x32930b[_0xccf8('0x35')][_0xccf8('0x3d')]);_0x3cdfe9[_0xccf8('0x20')]=qs['offset'](_0x32930b[_0xccf8('0x35')][_0xccf8('0x20')]);}return _0x14bdba[_0xccf8('0x7d')](_0x3cdfe9);}})['then'](function(_0x35831d){if(_0x35831d){return _0x35831d?{'count':_0x1bdefc,'rows':_0x35831d}:null;}})[_0xccf8('0x28')](respondWithResult(_0x2642c8,null))['catch'](handleError(_0x2642c8,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 716329b..4dda64a 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 _0x4348=['../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3d9e94,_0x48136c){var _0x45f76e=function(_0x3fb608){while(--_0x3fb608){_0x3d9e94['push'](_0x3d9e94['shift']());}};_0x45f76e(++_0x48136c);}(_0x4348,0x118));var _0x8434=function(_0x4dcb1e,_0x3399dd){_0x4dcb1e=_0x4dcb1e-0x0;var _0x3b2d78=_0x4348[_0x4dcb1e];return _0x3b2d78;};'use strict';var EventEmitter=require('events');var Team=require(_0x8434('0x0'))['db'][_0x8434('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x8434('0x2')](0x0);var events={'afterCreate':_0x8434('0x3'),'afterUpdate':_0x8434('0x4'),'afterDestroy':_0x8434('0x5')};function emitEvent(_0x23df60){return function(_0x3a903e,_0x14144a,_0x45eee6){TeamEvents[_0x8434('0x6')](_0x23df60+':'+_0x3a903e['id'],_0x3a903e);TeamEvents['emit'](_0x23df60,_0x3a903e);_0x45eee6(null);};}for(var e in events){if(events[_0x8434('0x7')](e)){var event=events[e];Team[_0x8434('0x8')](e,emitEvent(event));}}module[_0x8434('0x9')]=TeamEvents; \ No newline at end of file +var _0x1e09=['Team','setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x20947e,_0x2cc039){var _0x13c9fb=function(_0x1b1865){while(--_0x1b1865){_0x20947e['push'](_0x20947e['shift']());}};_0x13c9fb(++_0x2cc039);}(_0x1e09,0x6f));var _0x91e0=function(_0x53355e,_0x27c5aa){_0x53355e=_0x53355e-0x0;var _0x176e5c=_0x1e09[_0x53355e];return _0x176e5c;};'use strict';var EventEmitter=require('events');var Team=require(_0x91e0('0x0'))['db'][_0x91e0('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x91e0('0x2')](0x0);var events={'afterCreate':_0x91e0('0x3'),'afterUpdate':_0x91e0('0x4'),'afterDestroy':_0x91e0('0x5')};function emitEvent(_0x21607f){return function(_0x29ab89,_0x5f6c93,_0x12a4f3){TeamEvents[_0x91e0('0x6')](_0x21607f+':'+_0x29ab89['id'],_0x29ab89);TeamEvents[_0x91e0('0x6')](_0x21607f,_0x29ab89);_0x12a4f3(null);};}for(var e in events){if(events[_0x91e0('0x7')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index a69a5a1..883dae2 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 _0x7e59=['path','../../config/environment','exports','define','teams','lodash','../../config/logger','api','moment'];(function(_0x51a663,_0x4d49b4){var _0x9b5d80=function(_0x147414){while(--_0x147414){_0x51a663['push'](_0x51a663['shift']());}};_0x9b5d80(++_0x4d49b4);}(_0x7e59,0x83));var _0x97e5=function(_0x31cda4,_0x447cec){_0x31cda4=_0x31cda4-0x0;var _0x2ac9de=_0x7e59[_0x31cda4];return _0x2ac9de;};'use strict';var _=require(_0x97e5('0x0'));var util=require('util');var logger=require(_0x97e5('0x1'))(_0x97e5('0x2'));var moment=require(_0x97e5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x97e5('0x4'));var rimraf=require('rimraf');var config=require(_0x97e5('0x5'));var attributes=require('./team.attributes');module[_0x97e5('0x6')]=function(_0x48d4ee,_0x3a0f78){return _0x48d4ee[_0x97e5('0x7')]('Team',attributes,{'tableName':_0x97e5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67f2=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Team','teams'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x67f2,0x1ce));var _0x267f=function(_0x443e44,_0x20510b){_0x443e44=_0x443e44-0x0;var _0x3d2cad=_0x67f2[_0x443e44];return _0x3d2cad;};'use strict';var _=require(_0x267f('0x0'));var util=require(_0x267f('0x1'));var logger=require(_0x267f('0x2'))(_0x267f('0x3'));var moment=require(_0x267f('0x4'));var BPromise=require(_0x267f('0x5'));var rp=require(_0x267f('0x6'));var fs=require('fs');var path=require(_0x267f('0x7'));var rimraf=require(_0x267f('0x8'));var config=require(_0x267f('0x9'));var attributes=require('./team.attributes');module[_0x267f('0xa')]=function(_0x1869db,_0x7a32f6){return _0x1869db[_0x267f('0xb')](_0x267f('0xc'),attributes,{'tableName':_0x267f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 6134f6e..895a5ed 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 _0xf2fb=['http','redis','defaults','socket.io-emitter','register','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3a5815,_0x2369d8){var _0x535e3a=function(_0x433b3c){while(--_0x433b3c){_0x3a5815['push'](_0x3a5815['shift']());}};_0x535e3a(++_0x2369d8);}(_0xf2fb,0x74));var _0xbf2f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf2fb[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xbf2f('0x0'));var util=require(_0xbf2f('0x1'));var moment=require('moment');var BPromise=require(_0xbf2f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbf2f('0x3'));var logger=require(_0xbf2f('0x4'))(_0xbf2f('0x5'));var config=require(_0xbf2f('0x6'));var jayson=require(_0xbf2f('0x7'));var client=jayson[_0xbf2f('0x8')][_0xbf2f('0x9')]({'port':0x232a});config[_0xbf2f('0xa')]=_[_0xbf2f('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbf2f('0xc'))(new Redis(config[_0xbf2f('0xa')]));require('./team.socket')[_0xbf2f('0xd')](socket);function respondWithRpcPromise(_0xa33383,_0x58e82a,_0x398691){return new BPromise(function(_0x5bfac2,_0x4b8303){return client['request'](_0xa33383,_0x398691)[_0xbf2f('0xe')](function(_0x358a1b){logger[_0xbf2f('0xf')](_0xbf2f('0x10'),_0x58e82a,'request\x20sent');logger[_0xbf2f('0x11')](_0xbf2f('0x12'),_0x58e82a,_0xbf2f('0x13'),JSON[_0xbf2f('0x14')](_0x358a1b));if(_0x358a1b[_0xbf2f('0x15')]){if(_0x358a1b[_0xbf2f('0x15')][_0xbf2f('0x16')]===0x1f4){logger[_0xbf2f('0x15')](_0xbf2f('0x10'),_0x58e82a,_0x358a1b[_0xbf2f('0x15')][_0xbf2f('0x17')]);return _0x4b8303(_0x358a1b[_0xbf2f('0x15')]['message']);}logger[_0xbf2f('0x15')]('Team,\x20%s,\x20%s',_0x58e82a,_0x358a1b[_0xbf2f('0x15')][_0xbf2f('0x17')]);return _0x5bfac2(_0x358a1b[_0xbf2f('0x15')][_0xbf2f('0x17')]);}else{logger[_0xbf2f('0xf')]('Team,\x20%s,\x20%s',_0x58e82a,'request\x20sent');_0x5bfac2(_0x358a1b[_0xbf2f('0x18')][_0xbf2f('0x17')]);}})['catch'](function(_0x3c2549){logger[_0xbf2f('0x15')](_0xbf2f('0x10'),_0x58e82a,_0x3c2549);_0x4b8303(_0x3c2549);});});} \ No newline at end of file +var _0x7a85=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x4f4d19,_0x574245){var _0x27a258=function(_0x38da3e){while(--_0x38da3e){_0x4f4d19['push'](_0x4f4d19['shift']());}};_0x27a258(++_0x574245);}(_0x7a85,0x11b));var _0x57a8=function(_0x5adaea,_0x5337fb){_0x5adaea=_0x5adaea-0x0;var _0x31b0a4=_0x7a85[_0x5adaea];return _0x31b0a4;};'use strict';var _=require(_0x57a8('0x0'));var util=require(_0x57a8('0x1'));var moment=require(_0x57a8('0x2'));var BPromise=require(_0x57a8('0x3'));var rs=require(_0x57a8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x57a8('0x5'));var logger=require(_0x57a8('0x6'))(_0x57a8('0x7'));var config=require(_0x57a8('0x8'));var jayson=require(_0x57a8('0x9'));var client=jayson[_0x57a8('0xa')][_0x57a8('0xb')]({'port':0x232a});config[_0x57a8('0xc')]=_['defaults'](config[_0x57a8('0xc')],{'host':_0x57a8('0xd'),'port':0x18eb});var socket=require(_0x57a8('0xe'))(new Redis(config[_0x57a8('0xc')]));require(_0x57a8('0xf'))[_0x57a8('0x10')](socket);function respondWithRpcPromise(_0x53311a,_0x4f3944,_0x2cb30a){return new BPromise(function(_0x52fbf0,_0x1227ae){return client[_0x57a8('0x11')](_0x53311a,_0x2cb30a)[_0x57a8('0x12')](function(_0x57230f){logger['info'](_0x57a8('0x13'),_0x4f3944,_0x57a8('0x14'));logger[_0x57a8('0x15')](_0x57a8('0x16'),_0x4f3944,_0x57a8('0x14'),JSON[_0x57a8('0x17')](_0x57230f));if(_0x57230f[_0x57a8('0x18')]){if(_0x57230f[_0x57a8('0x18')]['code']===0x1f4){logger[_0x57a8('0x18')](_0x57a8('0x13'),_0x4f3944,_0x57230f[_0x57a8('0x18')][_0x57a8('0x19')]);return _0x1227ae(_0x57230f[_0x57a8('0x18')][_0x57a8('0x19')]);}logger[_0x57a8('0x18')](_0x57a8('0x13'),_0x4f3944,_0x57230f[_0x57a8('0x18')][_0x57a8('0x19')]);return _0x52fbf0(_0x57230f[_0x57a8('0x18')][_0x57a8('0x19')]);}else{logger[_0x57a8('0x1a')](_0x57a8('0x13'),_0x4f3944,_0x57a8('0x14'));_0x52fbf0(_0x57230f[_0x57a8('0x1b')][_0x57a8('0x19')]);}})[_0x57a8('0x1c')](function(_0x8616d0){logger[_0x57a8('0x18')]('Team,\x20%s,\x20%s',_0x4f3944,_0x8616d0);_0x1227ae(_0x8616d0);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 2e5a1bc..0a68a52 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 _0x6209=['remove','update','removeListener','length','team:','./team.events','save'];(function(_0x562eea,_0x1f9ea7){var _0x39caf9=function(_0x14f022){while(--_0x14f022){_0x562eea['push'](_0x562eea['shift']());}};_0x39caf9(++_0x1f9ea7);}(_0x6209,0x1e8));var _0x9620=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x6209[_0x1ac595];return _0x455fff;};'use strict';var TeamEvents=require(_0x9620('0x0'));var events=[_0x9620('0x1'),_0x9620('0x2'),_0x9620('0x3')];function createListener(_0x21f61a,_0xd5842f){return function(_0x27ec47){_0xd5842f['emit'](_0x21f61a,_0x27ec47);};}function removeListener(_0x2869e2,_0x17dc92){return function(){TeamEvents[_0x9620('0x4')](_0x2869e2,_0x17dc92);};}exports['register']=function(_0x30c6e7){for(var _0x26302a=0x0,_0x2bdb4e=events[_0x9620('0x5')];_0x26302a<_0x2bdb4e;_0x26302a++){var _0x488d59=events[_0x26302a];var _0x4e9082=createListener(_0x9620('0x6')+_0x488d59,_0x30c6e7);TeamEvents['on'](_0x488d59,_0x4e9082);}}; \ No newline at end of file +var _0x9962=['update','register','length','team:','./team.events','remove'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x9962,0xb8));var _0x2996=function(_0x2c55c3,_0x3eff51){_0x2c55c3=_0x2c55c3-0x0;var _0x5e2639=_0x9962[_0x2c55c3];return _0x5e2639;};'use strict';var TeamEvents=require(_0x2996('0x0'));var events=['save',_0x2996('0x1'),_0x2996('0x2')];function createListener(_0x189a1f,_0x5e1ca3){return function(_0x2a9e9a){_0x5e1ca3['emit'](_0x189a1f,_0x2a9e9a);};}function removeListener(_0x4221bb,_0x96baaa){return function(){TeamEvents['removeListener'](_0x4221bb,_0x96baaa);};}exports[_0x2996('0x3')]=function(_0x196d1e){for(var _0x5609bc=0x0,_0xca00e4=events[_0x2996('0x4')];_0x5609bc<_0xca00e4;_0x5609bc++){var _0x2f385d=events[_0x5609bc];var _0x871918=createListener(_0x2996('0x5')+_0x2f385d,_0x196d1e);TeamEvents['on'](_0x2f385d,_0x871918);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 02abe36..2c1553c 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 _0xffab=['index','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xffab,0x170));var _0xbffa=function(_0x2d80af,_0xfdfd5b){_0x2d80af=_0x2d80af-0x0;var _0x4917c6=_0xffab[_0x2d80af];return _0x4917c6;};'use strict';var multer=require(_0xbffa('0x0'));var util=require(_0xbffa('0x1'));var path=require(_0xbffa('0x2'));var timeout=require(_0xbffa('0x3'));var express=require(_0xbffa('0x4'));var router=express[_0xbffa('0x5')]();var auth=require(_0xbffa('0x6'));var interaction=require(_0xbffa('0x7'));var config=require(_0xbffa('0x8'));var controller=require(_0xbffa('0x9'));router[_0xbffa('0xa')]('/',auth[_0xbffa('0xb')](),controller[_0xbffa('0xc')]);router[_0xbffa('0xa')](_0xbffa('0xd'),auth[_0xbffa('0xb')](),controller['show']);router[_0xbffa('0xe')]('/',auth[_0xbffa('0xb')](),controller[_0xbffa('0xf')]);router[_0xbffa('0x10')](_0xbffa('0xd'),auth[_0xbffa('0xb')](),controller[_0xbffa('0x11')]);router[_0xbffa('0x12')](_0xbffa('0xd'),auth['isAuthenticated'](),controller[_0xbffa('0x13')]);module['exports']=router; \ No newline at end of file +var _0x21ae=['show','post','isAuthenticated','put','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service','./template.controller','get','index','/:id'];(function(_0x1b1e76,_0x31695b){var _0x3d743a=function(_0x4ae27b){while(--_0x4ae27b){_0x1b1e76['push'](_0x1b1e76['shift']());}};_0x3d743a(++_0x31695b);}(_0x21ae,0x18e));var _0xe21a=function(_0x3eb767,_0x558de3){_0x3eb767=_0x3eb767-0x0;var _0x2ba44b=_0x21ae[_0x3eb767];return _0x2ba44b;};'use strict';var multer=require(_0xe21a('0x0'));var util=require(_0xe21a('0x1'));var path=require(_0xe21a('0x2'));var timeout=require('connect-timeout');var express=require(_0xe21a('0x3'));var router=express[_0xe21a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe21a('0x5'));var config=require('../../config/environment');var controller=require(_0xe21a('0x6'));router[_0xe21a('0x7')]('/',auth['isAuthenticated'](),controller[_0xe21a('0x8')]);router['get'](_0xe21a('0x9'),auth['isAuthenticated'](),controller[_0xe21a('0xa')]);router[_0xe21a('0xb')]('/',auth[_0xe21a('0xc')](),controller['create']);router[_0xe21a('0xd')](_0xe21a('0x9'),auth['isAuthenticated'](),controller[_0xe21a('0xe')]);router[_0xe21a('0xf')]('/:id',auth[_0xe21a('0xc')](),controller['destroy']);module[_0xe21a('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 0ea6281..636a53b 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 _0xe543=['STRING','TEXT','sequelize','exports'];(function(_0x192772,_0x100b16){var _0x2b50bd=function(_0x3cbf90){while(--_0x3cbf90){_0x192772['push'](_0x192772['shift']());}};_0x2b50bd(++_0x100b16);}(_0xe543,0x1ee));var _0x3e54=function(_0x24c477,_0x2e2003){_0x24c477=_0x24c477-0x0;var _0xb95cb3=_0xe543[_0x24c477];return _0xb95cb3;};'use strict';var Sequelize=require(_0x3e54('0x0'));module[_0x3e54('0x1')]={'name':{'type':Sequelize[_0x3e54('0x2')]},'description':{'type':Sequelize[_0x3e54('0x2')]},'html':{'type':Sequelize[_0x3e54('0x3')]}}; \ No newline at end of file +var _0xf330=['sequelize','exports','STRING','TEXT'];(function(_0x23a959,_0x5c39dd){var _0x2b73dd=function(_0x2ced19){while(--_0x2ced19){_0x23a959['push'](_0x23a959['shift']());}};_0x2b73dd(++_0x5c39dd);}(_0xf330,0x160));var _0x0f33=function(_0x2b0a8c,_0x2be865){_0x2b0a8c=_0x2b0a8c-0x0;var _0x1d1354=_0xf330[_0x2b0a8c];return _0x1d1354;};'use strict';var Sequelize=require(_0x0f33('0x0'));module[_0x0f33('0x1')]={'name':{'type':Sequelize[_0x0f33('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x0f33('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index ab58142..512f6b5 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 _0x40d0=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','length','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','Template','count','includeAll','include','findAll','rows','show','params','fields','find','catch','create','user','role','Templates','UserProfileSection','userProfileId','body','destroy','eml-format'];(function(_0x10745e,_0x4cd185){var _0x5bded5=function(_0x52b406){while(--_0x52b406){_0x10745e['push'](_0x10745e['shift']());}};_0x5bded5(++_0x4cd185);}(_0x40d0,0x194));var _0x040d=function(_0x519d59,_0xd829df){_0x519d59=_0x519d59-0x0;var _0x2ab241=_0x40d0[_0x519d59];return _0x2ab241;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x040d('0x0'));var rimraf=require(_0x040d('0x1'));var zipdir=require(_0x040d('0x2'));var jsonpatch=require(_0x040d('0x3'));var rp=require(_0x040d('0x4'));var moment=require(_0x040d('0x5'));var BPromise=require(_0x040d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x040d('0x7'));var sox=require('sox');var csv=require(_0x040d('0x8'));var ejs=require(_0x040d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x040d('0xa'));var crypto=require(_0x040d('0xb'));var jsforce=require(_0x040d('0xc'));var deskjs=require(_0x040d('0xd'));var toCsv=require(_0x040d('0x8'));var querystring=require(_0x040d('0xe'));var Papa=require('papaparse');var Redis=require(_0x040d('0xf'));var authService=require(_0x040d('0x10'));var qs=require(_0x040d('0x11'));var as=require(_0x040d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x040d('0x13'))('api');var utils=require(_0x040d('0x14'));var config=require(_0x040d('0x15'));var db=require(_0x040d('0x16'))['db'];function respondWithStatusCode(_0x5947c8,_0xc17300){_0xc17300=_0xc17300||0xcc;return function(_0x5c9a57){if(_0x5c9a57){return _0x5947c8[_0x040d('0x17')](_0xc17300);}return _0x5947c8[_0x040d('0x18')](_0xc17300)[_0x040d('0x19')]();};}function respondWithResult(_0x9b78c2,_0x122480){_0x122480=_0x122480||0xc8;return function(_0x14ca95){if(_0x14ca95){return _0x9b78c2[_0x040d('0x18')](_0x122480)[_0x040d('0x1a')](_0x14ca95);}};}function respondWithFilteredResult(_0x4e21b2,_0x483601){return function(_0x2b1b0e){if(_0x2b1b0e){var _0x59bb73=_0x2b1b0e['count'],_0x20fbc0=_0x483601[_0x040d('0x1b')],_0x37224c=_0x483601[_0x040d('0x1b')]+_0x483601[_0x040d('0x1c')],_0x516b29;if(_0x37224c>=_0x59bb73){_0x37224c=_0x59bb73;_0x516b29=0xc8;}else{_0x516b29=0xce;}_0x4e21b2[_0x040d('0x18')](_0x516b29);return _0x4e21b2[_0x040d('0x1d')](_0x040d('0x1e'),_0x20fbc0+'-'+_0x37224c+'/'+_0x59bb73)['json'](_0x2b1b0e);}return null;};}function patchUpdates(_0x3979eb){return function(_0x44429e){try{jsonpatch[_0x040d('0x1f')](_0x44429e,_0x3979eb,!![]);}catch(_0x2190c1){return BPromise[_0x040d('0x20')](_0x2190c1);}return _0x44429e[_0x040d('0x21')]();};}function saveUpdates(_0x3b6bcb,_0x3ed10b){return function(_0x41c000){if(_0x41c000){return _0x41c000[_0x040d('0x22')](_0x3b6bcb)[_0x040d('0x23')](function(_0x20cc67){return _0x20cc67;});}return null;};}function removeEntity(_0x57cb06,_0x481181){return function(_0x1a2bba){if(_0x1a2bba){return _0x1a2bba['destroy']()[_0x040d('0x23')](function(){var _0x18c297=_0x1a2bba[_0x040d('0x24')]({'plain':!![]});var _0xf51755='Templates';return db[_0x040d('0x25')]['destroy']({'where':{'type':_0xf51755,'resourceId':_0x18c297['id']}})[_0x040d('0x23')](function(){return _0x1a2bba;});})['then'](function(){_0x57cb06[_0x040d('0x18')](0xcc)[_0x040d('0x19')]();});}};}function handleEntityNotFound(_0x13753c,_0x10aace){return function(_0xe3a355){if(!_0xe3a355){_0x13753c[_0x040d('0x17')](0x194);}return _0xe3a355;};}function handleError(_0x26b9d0,_0x211df0){_0x211df0=_0x211df0||0x1f4;return function(_0x29c66d){logger[_0x040d('0x26')](_0x29c66d[_0x040d('0x27')]);if(_0x29c66d[_0x040d('0x28')]){delete _0x29c66d[_0x040d('0x28')];}_0x26b9d0[_0x040d('0x18')](_0x211df0)[_0x040d('0x29')](_0x29c66d);};}exports[_0x040d('0x2a')]=function(_0x52da7a,_0x784422){var _0xdb501d={},_0x10f181={},_0x43ab80={'count':0x0,'rows':[]};var _0x5708cb=_[_0x040d('0x2b')](db['Template'][_0x040d('0x2c')],function(_0x50c1ec){return{'name':_0x50c1ec[_0x040d('0x2d')],'type':_0x50c1ec[_0x040d('0x2e')]['key']};});_0x10f181['model']=_['map'](_0x5708cb,_0x040d('0x28'));_0x10f181['query']=_[_0x040d('0x2f')](_0x52da7a[_0x040d('0x30')]);_0x10f181['filters']=_[_0x040d('0x31')](_0x10f181[_0x040d('0x32')],_0x10f181['query']);_0xdb501d['attributes']=_[_0x040d('0x31')](_0x10f181[_0x040d('0x32')],qs['fields'](_0x52da7a['query']['fields']));_0xdb501d[_0x040d('0x33')]=_0xdb501d[_0x040d('0x33')][_0x040d('0x34')]?_0xdb501d['attributes']:_0x10f181[_0x040d('0x32')];if(!_0x52da7a[_0x040d('0x30')]['hasOwnProperty'](_0x040d('0x35'))){_0xdb501d[_0x040d('0x1c')]=qs['limit'](_0x52da7a[_0x040d('0x30')][_0x040d('0x1c')]);_0xdb501d[_0x040d('0x1b')]=qs[_0x040d('0x1b')](_0x52da7a[_0x040d('0x30')]['offset']);}_0xdb501d['order']=qs[_0x040d('0x36')](_0x52da7a['query']['sort']);_0xdb501d[_0x040d('0x37')]=qs['filters'](_[_0x040d('0x38')](_0x52da7a[_0x040d('0x30')],_0x10f181[_0x040d('0x39')]),_0x5708cb);if(_0x52da7a[_0x040d('0x30')][_0x040d('0x3a')]){_0xdb501d['where']=_[_0x040d('0x3b')](_0xdb501d[_0x040d('0x37')],{'$or':_['map'](_0x5708cb,function(_0x4f01c0){if(_0x4f01c0[_0x040d('0x2e')]!==_0x040d('0x3c')){var _0x1a97e2={};_0x1a97e2[_0x4f01c0[_0x040d('0x28')]]={'$like':'%'+_0x52da7a['query'][_0x040d('0x3a')]+'%'};return _0x1a97e2;}})});}_0xdb501d=_['merge']({},_0xdb501d,_0x52da7a[_0x040d('0x3d')]);var _0x2dc186={'where':_0xdb501d[_0x040d('0x37')]};return db[_0x040d('0x3e')][_0x040d('0x3f')](_0x2dc186)[_0x040d('0x23')](function(_0x37196c){_0x43ab80[_0x040d('0x3f')]=_0x37196c;if(_0x52da7a[_0x040d('0x30')][_0x040d('0x40')]){_0xdb501d[_0x040d('0x41')]=[{'all':!![]}];}return db[_0x040d('0x3e')][_0x040d('0x42')](_0xdb501d);})[_0x040d('0x23')](function(_0x34da0d){_0x43ab80[_0x040d('0x43')]=_0x34da0d;return _0x43ab80;})[_0x040d('0x23')](respondWithFilteredResult(_0x784422,_0xdb501d))['catch'](handleError(_0x784422,null));};exports[_0x040d('0x44')]=function(_0x4da2ef,_0x2a5794){var _0x177cdb={'raw':!![],'where':{'id':_0x4da2ef[_0x040d('0x45')]['id']}},_0x541cf7={};_0x541cf7['model']=_[_0x040d('0x2f')](db[_0x040d('0x3e')]['rawAttributes']);_0x541cf7[_0x040d('0x30')]=_['keys'](_0x4da2ef['query']);_0x541cf7[_0x040d('0x39')]=_[_0x040d('0x31')](_0x541cf7[_0x040d('0x32')],_0x541cf7['query']);_0x177cdb['attributes']=_[_0x040d('0x31')](_0x541cf7['model'],qs[_0x040d('0x46')](_0x4da2ef[_0x040d('0x30')][_0x040d('0x46')]));_0x177cdb[_0x040d('0x33')]=_0x177cdb[_0x040d('0x33')][_0x040d('0x34')]?_0x177cdb[_0x040d('0x33')]:_0x541cf7[_0x040d('0x32')];if(_0x4da2ef['query']['includeAll']){_0x177cdb[_0x040d('0x41')]=[{'all':!![]}];}_0x177cdb=_[_0x040d('0x3b')]({},_0x177cdb,_0x4da2ef[_0x040d('0x3d')]);return db[_0x040d('0x3e')][_0x040d('0x47')](_0x177cdb)[_0x040d('0x23')](handleEntityNotFound(_0x2a5794,null))[_0x040d('0x23')](respondWithResult(_0x2a5794,null))[_0x040d('0x48')](handleError(_0x2a5794,null));};exports[_0x040d('0x49')]=function(_0x25878e,_0x4b9c2c){return db[_0x040d('0x3e')]['create'](_0x25878e['body'],{})[_0x040d('0x23')](function(_0x2eb36a){var _0x5cfd8e=_0x25878e[_0x040d('0x4a')][_0x040d('0x24')]({'plain':!![]});if(!_0x5cfd8e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5cfd8e[_0x040d('0x4b')]===_0x040d('0x4a')){var _0x23ac14=_0x2eb36a[_0x040d('0x24')]({'plain':!![]});var _0x3eaeb6=_0x040d('0x4c');return db[_0x040d('0x4d')]['find']({'where':{'name':_0x3eaeb6,'userProfileId':_0x5cfd8e[_0x040d('0x4e')]},'raw':!![]})['then'](function(_0x4c4b14){if(_0x4c4b14&&_0x4c4b14['autoAssociation']===0x0){return db[_0x040d('0x25')]['create']({'name':_0x23ac14['name'],'resourceId':_0x23ac14['id'],'type':_0x4c4b14['name'],'sectionId':_0x4c4b14['id']},{})[_0x040d('0x23')](function(){return _0x2eb36a;});}else{return _0x2eb36a;}})[_0x040d('0x48')](function(_0x39e812){logger[_0x040d('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x39e812);throw _0x39e812;});}return _0x2eb36a;})[_0x040d('0x23')](respondWithResult(_0x4b9c2c,0xc9))[_0x040d('0x48')](handleError(_0x4b9c2c,null));};exports[_0x040d('0x22')]=function(_0x473ed6,_0x3b5fc4){if(_0x473ed6[_0x040d('0x4f')]['id']){delete _0x473ed6[_0x040d('0x4f')]['id'];}return db[_0x040d('0x3e')][_0x040d('0x47')]({'where':{'id':_0x473ed6[_0x040d('0x45')]['id']}})[_0x040d('0x23')](handleEntityNotFound(_0x3b5fc4,null))[_0x040d('0x23')](saveUpdates(_0x473ed6['body'],null))[_0x040d('0x23')](respondWithResult(_0x3b5fc4,null))['catch'](handleError(_0x3b5fc4,null));};exports[_0x040d('0x50')]=function(_0x5bb8f6,_0x414894){return db['Template'][_0x040d('0x47')]({'where':{'id':_0x5bb8f6[_0x040d('0x45')]['id']}})[_0x040d('0x23')](handleEntityNotFound(_0x414894,null))['then'](removeEntity(_0x414894,null))[_0x040d('0x48')](handleError(_0x414894,null));}; \ No newline at end of file +var _0x5595=['UserProfileResource','sendStatus','error','stack','name','index','Template','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','save','update','then','get','Templates'];(function(_0x28c31c,_0x5cdf05){var _0x4d3e37=function(_0x9225d6){while(--_0x9225d6){_0x28c31c['push'](_0x28c31c['shift']());}};_0x4d3e37(++_0x5cdf05);}(_0x5595,0xc5));var _0x5559=function(_0x1e8ac0,_0x33e3eb){_0x1e8ac0=_0x1e8ac0-0x0;var _0x4f1e3d=_0x5595[_0x1e8ac0];return _0x4f1e3d;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5559('0x0'));var jsonpatch=require(_0x5559('0x1'));var rp=require(_0x5559('0x2'));var moment=require(_0x5559('0x3'));var BPromise=require(_0x5559('0x4'));var Mustache=require(_0x5559('0x5'));var util=require(_0x5559('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5559('0x7'));var ejs=require(_0x5559('0x8'));var fs=require('fs');var _=require(_0x5559('0x9'));var squel=require('squel');var crypto=require(_0x5559('0xa'));var jsforce=require(_0x5559('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5559('0xc'));var Papa=require('papaparse');var Redis=require(_0x5559('0xd'));var authService=require(_0x5559('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5559('0xf'));var hardwareService=require(_0x5559('0x10'));var logger=require(_0x5559('0x11'))('api');var utils=require(_0x5559('0x12'));var config=require(_0x5559('0x13'));var db=require(_0x5559('0x14'))['db'];function respondWithStatusCode(_0x181613,_0x16261a){_0x16261a=_0x16261a||0xcc;return function(_0x4c2303){if(_0x4c2303){return _0x181613['sendStatus'](_0x16261a);}return _0x181613[_0x5559('0x15')](_0x16261a)[_0x5559('0x16')]();};}function respondWithResult(_0x53b388,_0x5a119d){_0x5a119d=_0x5a119d||0xc8;return function(_0x3c12a5){if(_0x3c12a5){return _0x53b388[_0x5559('0x15')](_0x5a119d)[_0x5559('0x17')](_0x3c12a5);}};}function respondWithFilteredResult(_0x395b04,_0x399621){return function(_0x5e96c1){if(_0x5e96c1){var _0x420dc5=_0x5e96c1[_0x5559('0x18')],_0x20da54=_0x399621[_0x5559('0x19')],_0x4c3420=_0x399621[_0x5559('0x19')]+_0x399621[_0x5559('0x1a')],_0x19ad95;if(_0x4c3420>=_0x420dc5){_0x4c3420=_0x420dc5;_0x19ad95=0xc8;}else{_0x19ad95=0xce;}_0x395b04['status'](_0x19ad95);return _0x395b04[_0x5559('0x1b')](_0x5559('0x1c'),_0x20da54+'-'+_0x4c3420+'/'+_0x420dc5)[_0x5559('0x17')](_0x5e96c1);}return null;};}function patchUpdates(_0x29f640){return function(_0x588533){try{jsonpatch['apply'](_0x588533,_0x29f640,!![]);}catch(_0x897817){return BPromise['reject'](_0x897817);}return _0x588533[_0x5559('0x1d')]();};}function saveUpdates(_0x3f6358,_0x52e4d6){return function(_0x4edc2c){if(_0x4edc2c){return _0x4edc2c[_0x5559('0x1e')](_0x3f6358)['then'](function(_0x58dc3e){return _0x58dc3e;});}return null;};}function removeEntity(_0x23f4a5,_0xad37ce){return function(_0x2936fc){if(_0x2936fc){return _0x2936fc['destroy']()[_0x5559('0x1f')](function(){var _0x5d5084=_0x2936fc[_0x5559('0x20')]({'plain':!![]});var _0x515a31=_0x5559('0x21');return db[_0x5559('0x22')]['destroy']({'where':{'type':_0x515a31,'resourceId':_0x5d5084['id']}})[_0x5559('0x1f')](function(){return _0x2936fc;});})[_0x5559('0x1f')](function(){_0x23f4a5[_0x5559('0x15')](0xcc)[_0x5559('0x16')]();});}};}function handleEntityNotFound(_0xd67096,_0x583471){return function(_0x4fc135){if(!_0x4fc135){_0xd67096[_0x5559('0x23')](0x194);}return _0x4fc135;};}function handleError(_0x27b611,_0x23c552){_0x23c552=_0x23c552||0x1f4;return function(_0x13f6dd){logger[_0x5559('0x24')](_0x13f6dd[_0x5559('0x25')]);if(_0x13f6dd[_0x5559('0x26')]){delete _0x13f6dd[_0x5559('0x26')];}_0x27b611[_0x5559('0x15')](_0x23c552)['send'](_0x13f6dd);};}exports[_0x5559('0x27')]=function(_0x648a4e,_0x1c0cbe){var _0x570357={},_0x61dcc4={},_0x3765c3={'count':0x0,'rows':[]};var _0x3b9dc9=_['map'](db[_0x5559('0x28')][_0x5559('0x29')],function(_0x46fe22){return{'name':_0x46fe22[_0x5559('0x2a')],'type':_0x46fe22[_0x5559('0x2b')][_0x5559('0x2c')]};});_0x61dcc4[_0x5559('0x2d')]=_[_0x5559('0x2e')](_0x3b9dc9,_0x5559('0x26'));_0x61dcc4[_0x5559('0x2f')]=_[_0x5559('0x30')](_0x648a4e[_0x5559('0x2f')]);_0x61dcc4[_0x5559('0x31')]=_['intersection'](_0x61dcc4[_0x5559('0x2d')],_0x61dcc4['query']);_0x570357[_0x5559('0x32')]=_['intersection'](_0x61dcc4[_0x5559('0x2d')],qs['fields'](_0x648a4e[_0x5559('0x2f')][_0x5559('0x33')]));_0x570357[_0x5559('0x32')]=_0x570357[_0x5559('0x32')][_0x5559('0x34')]?_0x570357['attributes']:_0x61dcc4[_0x5559('0x2d')];if(!_0x648a4e['query'][_0x5559('0x35')]('nolimit')){_0x570357[_0x5559('0x1a')]=qs[_0x5559('0x1a')](_0x648a4e['query'][_0x5559('0x1a')]);_0x570357['offset']=qs[_0x5559('0x19')](_0x648a4e[_0x5559('0x2f')][_0x5559('0x19')]);}_0x570357[_0x5559('0x36')]=qs[_0x5559('0x37')](_0x648a4e[_0x5559('0x2f')][_0x5559('0x37')]);_0x570357[_0x5559('0x38')]=qs[_0x5559('0x31')](_[_0x5559('0x39')](_0x648a4e[_0x5559('0x2f')],_0x61dcc4['filters']),_0x3b9dc9);if(_0x648a4e[_0x5559('0x2f')][_0x5559('0x3a')]){_0x570357[_0x5559('0x38')]=_[_0x5559('0x3b')](_0x570357[_0x5559('0x38')],{'$or':_['map'](_0x3b9dc9,function(_0x6d960f){if(_0x6d960f[_0x5559('0x2b')]!==_0x5559('0x3c')){var _0x560e3a={};_0x560e3a[_0x6d960f[_0x5559('0x26')]]={'$like':'%'+_0x648a4e[_0x5559('0x2f')][_0x5559('0x3a')]+'%'};return _0x560e3a;}})});}_0x570357=_['merge']({},_0x570357,_0x648a4e[_0x5559('0x3d')]);var _0x3541c5={'where':_0x570357[_0x5559('0x38')]};return db[_0x5559('0x28')][_0x5559('0x18')](_0x3541c5)['then'](function(_0x3c8c43){_0x3765c3[_0x5559('0x18')]=_0x3c8c43;if(_0x648a4e['query'][_0x5559('0x3e')]){_0x570357[_0x5559('0x3f')]=[{'all':!![]}];}return db['Template'][_0x5559('0x40')](_0x570357);})[_0x5559('0x1f')](function(_0x459721){_0x3765c3['rows']=_0x459721;return _0x3765c3;})['then'](respondWithFilteredResult(_0x1c0cbe,_0x570357))[_0x5559('0x41')](handleError(_0x1c0cbe,null));};exports[_0x5559('0x42')]=function(_0x65cf80,_0x36c5df){var _0x184997={'raw':!![],'where':{'id':_0x65cf80[_0x5559('0x43')]['id']}},_0x2a413b={};_0x2a413b[_0x5559('0x2d')]=_[_0x5559('0x30')](db[_0x5559('0x28')]['rawAttributes']);_0x2a413b[_0x5559('0x2f')]=_[_0x5559('0x30')](_0x65cf80[_0x5559('0x2f')]);_0x2a413b[_0x5559('0x31')]=_['intersection'](_0x2a413b[_0x5559('0x2d')],_0x2a413b['query']);_0x184997[_0x5559('0x32')]=_['intersection'](_0x2a413b['model'],qs[_0x5559('0x33')](_0x65cf80['query']['fields']));_0x184997[_0x5559('0x32')]=_0x184997['attributes'][_0x5559('0x34')]?_0x184997['attributes']:_0x2a413b[_0x5559('0x2d')];if(_0x65cf80['query'][_0x5559('0x3e')]){_0x184997[_0x5559('0x3f')]=[{'all':!![]}];}_0x184997=_[_0x5559('0x3b')]({},_0x184997,_0x65cf80[_0x5559('0x3d')]);return db[_0x5559('0x28')][_0x5559('0x44')](_0x184997)[_0x5559('0x1f')](handleEntityNotFound(_0x36c5df,null))[_0x5559('0x1f')](respondWithResult(_0x36c5df,null))['catch'](handleError(_0x36c5df,null));};exports[_0x5559('0x45')]=function(_0x418d69,_0x58a48d){return db[_0x5559('0x28')][_0x5559('0x45')](_0x418d69['body'],{})[_0x5559('0x1f')](function(_0x30306b){var _0x5b8425=_0x418d69['user']['get']({'plain':!![]});if(!_0x5b8425)throw new Error(_0x5559('0x46'));if(_0x5b8425[_0x5559('0x47')]===_0x5559('0x48')){var _0x5d4702=_0x30306b[_0x5559('0x20')]({'plain':!![]});var _0x3551ab='Templates';return db['UserProfileSection']['find']({'where':{'name':_0x3551ab,'userProfileId':_0x5b8425[_0x5559('0x49')]},'raw':!![]})[_0x5559('0x1f')](function(_0x37eae8){if(_0x37eae8&&_0x37eae8[_0x5559('0x4a')]===0x0){return db[_0x5559('0x22')]['create']({'name':_0x5d4702[_0x5559('0x26')],'resourceId':_0x5d4702['id'],'type':_0x37eae8[_0x5559('0x26')],'sectionId':_0x37eae8['id']},{})[_0x5559('0x1f')](function(){return _0x30306b;});}else{return _0x30306b;}})['catch'](function(_0xcf5a18){logger[_0x5559('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcf5a18);throw _0xcf5a18;});}return _0x30306b;})[_0x5559('0x1f')](respondWithResult(_0x58a48d,0xc9))[_0x5559('0x41')](handleError(_0x58a48d,null));};exports[_0x5559('0x1e')]=function(_0x1c874a,_0x26e491){if(_0x1c874a[_0x5559('0x4b')]['id']){delete _0x1c874a[_0x5559('0x4b')]['id'];}return db[_0x5559('0x28')][_0x5559('0x44')]({'where':{'id':_0x1c874a[_0x5559('0x43')]['id']}})[_0x5559('0x1f')](handleEntityNotFound(_0x26e491,null))[_0x5559('0x1f')](saveUpdates(_0x1c874a['body'],null))[_0x5559('0x1f')](respondWithResult(_0x26e491,null))[_0x5559('0x41')](handleError(_0x26e491,null));};exports[_0x5559('0x4c')]=function(_0x3186a1,_0x5556e9){return db[_0x5559('0x28')][_0x5559('0x44')]({'where':{'id':_0x3186a1[_0x5559('0x43')]['id']}})['then'](handleEntityNotFound(_0x5556e9,null))[_0x5559('0x1f')](removeEntity(_0x5556e9,null))['catch'](handleError(_0x5556e9,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 64156a2..111c930 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 _0x3d9d=['request-promise','rimraf','../../config/environment','./template.attributes','Template','tools_templates','util','../../config/logger','api','bluebird'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0x3d9d,0xc4));var _0xd3d9=function(_0x31c351,_0x2c7bc1){_0x31c351=_0x31c351-0x0;var _0x1a1c6d=_0x3d9d[_0x31c351];return _0x1a1c6d;};'use strict';var _=require('lodash');var util=require(_0xd3d9('0x0'));var logger=require(_0xd3d9('0x1'))(_0xd3d9('0x2'));var moment=require('moment');var BPromise=require(_0xd3d9('0x3'));var rp=require(_0xd3d9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3d9('0x5'));var config=require(_0xd3d9('0x6'));var attributes=require(_0xd3d9('0x7'));module['exports']=function(_0x3a89d3,_0x37370f){return _0x3a89d3['define'](_0xd3d9('0x8'),attributes,{'tableName':_0xd3d9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3471=['Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./template.attributes','exports','define'];(function(_0x2ce08c,_0x58ce90){var _0x3db6bd=function(_0x24c3a5){while(--_0x24c3a5){_0x2ce08c['push'](_0x2ce08c['shift']());}};_0x3db6bd(++_0x58ce90);}(_0x3471,0x106));var _0x1347=function(_0x56038e,_0x124577){_0x56038e=_0x56038e-0x0;var _0x576574=_0x3471[_0x56038e];return _0x576574;};'use strict';var _=require(_0x1347('0x0'));var util=require('util');var logger=require(_0x1347('0x1'))(_0x1347('0x2'));var moment=require(_0x1347('0x3'));var BPromise=require(_0x1347('0x4'));var rp=require(_0x1347('0x5'));var fs=require('fs');var path=require(_0x1347('0x6'));var rimraf=require(_0x1347('0x7'));var config=require('../../config/environment');var attributes=require(_0x1347('0x8'));module[_0x1347('0x9')]=function(_0x586abb,_0x5474d5){return _0x586abb[_0x1347('0xa')](_0x1347('0xb'),attributes,{'tableName':_0x1347('0xc'),'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 3dab528..74c7a52 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 _0xa4fd=['message','result','catch','GetTemplate','Template','options','where','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xa4fd,0x160));var _0xda4f=function(_0x55f3fd,_0x394a44){_0x55f3fd=_0x55f3fd-0x0;var _0x9f4a2e=_0xa4fd[_0x55f3fd];return _0x9f4a2e;};'use strict';var _=require(_0xda4f('0x0'));var util=require(_0xda4f('0x1'));var moment=require(_0xda4f('0x2'));var BPromise=require(_0xda4f('0x3'));var rs=require(_0xda4f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda4f('0x5'))['db'];var utils=require(_0xda4f('0x6'));var logger=require(_0xda4f('0x7'))(_0xda4f('0x8'));var config=require(_0xda4f('0x9'));var jayson=require(_0xda4f('0xa'));var client=jayson[_0xda4f('0xb')][_0xda4f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x154125,_0xdf380f,_0x313e1a){return new BPromise(function(_0x397a9c,_0xb23fe){return client[_0xda4f('0xd')](_0x154125,_0x313e1a)[_0xda4f('0xe')](function(_0x14ed41){logger[_0xda4f('0xf')](_0xda4f('0x10'),_0xdf380f,_0xda4f('0x11'));logger[_0xda4f('0x12')](_0xda4f('0x13'),_0xdf380f,_0xda4f('0x11'),JSON[_0xda4f('0x14')](_0x14ed41));if(_0x14ed41['error']){if(_0x14ed41['error']['code']===0x1f4){logger[_0xda4f('0x15')](_0xda4f('0x10'),_0xdf380f,_0x14ed41[_0xda4f('0x15')]['message']);return _0xb23fe(_0x14ed41['error'][_0xda4f('0x16')]);}logger['error'](_0xda4f('0x10'),_0xdf380f,_0x14ed41['error']['message']);return _0x397a9c(_0x14ed41['error'][_0xda4f('0x16')]);}else{logger[_0xda4f('0xf')](_0xda4f('0x10'),_0xdf380f,_0xda4f('0x11'));_0x397a9c(_0x14ed41[_0xda4f('0x17')][_0xda4f('0x16')]);}})[_0xda4f('0x18')](function(_0x34e574){logger[_0xda4f('0x15')](_0xda4f('0x10'),_0xdf380f,_0x34e574);_0xb23fe(_0x34e574);});});}exports[_0xda4f('0x19')]=function(_0x288c78){var _0x4684f4=this;return new Promise(function(_0x35ef72,_0x40c80b){return db[_0xda4f('0x1a')]['findAll']({'raw':_0x288c78[_0xda4f('0x1b')]?_0x288c78[_0xda4f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x288c78[_0xda4f('0x1b')]?_0x288c78[_0xda4f('0x1b')][_0xda4f('0x1c')]||null:null,'attributes':_0x288c78[_0xda4f('0x1b')]?_0x288c78[_0xda4f('0x1b')][_0xda4f('0x1d')]||null:null,'limit':_0x288c78[_0xda4f('0x1b')]?_0x288c78[_0xda4f('0x1b')][_0xda4f('0x1e')]||null:null,'include':_0x288c78[_0xda4f('0x1b')]?_0x288c78[_0xda4f('0x1b')][_0xda4f('0x1f')]?_[_0xda4f('0x20')](_0x288c78['options'][_0xda4f('0x1f')],function(_0x2528ab){return{'model':db[_0x2528ab[_0xda4f('0x21')]],'as':_0x2528ab['as'],'attributes':_0x2528ab[_0xda4f('0x1d')],'include':_0x2528ab[_0xda4f('0x1f')]?_['map'](_0x2528ab[_0xda4f('0x1f')],function(_0x222f3d){return{'model':db[_0x222f3d[_0xda4f('0x21')]],'as':_0x222f3d['as'],'attributes':_0x222f3d[_0xda4f('0x1d')],'include':_0x222f3d[_0xda4f('0x1f')]?_[_0xda4f('0x20')](_0x222f3d[_0xda4f('0x1f')],function(_0x595f5c){return{'model':db[_0x595f5c['model']],'as':_0x595f5c['as'],'attributes':_0x595f5c[_0xda4f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xda4f('0xe')](function(_0x1fb9dc){logger[_0xda4f('0xf')](_0xda4f('0x19'),_0x288c78);logger[_0xda4f('0x12')](_0xda4f('0x19'),_0x288c78,JSON[_0xda4f('0x14')](_0x1fb9dc));_0x35ef72(_0x1fb9dc);})['catch'](function(_0x50aae1){logger[_0xda4f('0x15')]('GetTemplate',_0x50aae1[_0xda4f('0x16')],_0x288c78);_0x40c80b(_0x4684f4[_0xda4f('0x15')](0x1f4,_0x50aae1[_0xda4f('0x16')]));});});}; \ No newline at end of file +var _0x6508=['Template,\x20%s,\x20%s','message','result','catch','GetTemplate','findAll','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x6508,0x183));var _0x8650=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0x6508[_0x3bd52b];return _0x1e5b89;};'use strict';var _=require(_0x8650('0x0'));var util=require(_0x8650('0x1'));var moment=require('moment');var BPromise=require(_0x8650('0x2'));var rs=require(_0x8650('0x3'));var fs=require('fs');var Redis=require(_0x8650('0x4'));var db=require(_0x8650('0x5'))['db'];var utils=require(_0x8650('0x6'));var logger=require('../../config/logger')(_0x8650('0x7'));var config=require(_0x8650('0x8'));var jayson=require(_0x8650('0x9'));var client=jayson[_0x8650('0xa')][_0x8650('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53a029,_0xe8e31b,_0x5c485f){return new BPromise(function(_0x54d7ce,_0x447c17){return client[_0x8650('0xc')](_0x53a029,_0x5c485f)[_0x8650('0xd')](function(_0x47ada7){logger[_0x8650('0xe')]('Template,\x20%s,\x20%s',_0xe8e31b,_0x8650('0xf'));logger[_0x8650('0x10')](_0x8650('0x11'),_0xe8e31b,_0x8650('0xf'),JSON[_0x8650('0x12')](_0x47ada7));if(_0x47ada7[_0x8650('0x13')]){if(_0x47ada7[_0x8650('0x13')][_0x8650('0x14')]===0x1f4){logger['error'](_0x8650('0x15'),_0xe8e31b,_0x47ada7[_0x8650('0x13')]['message']);return _0x447c17(_0x47ada7[_0x8650('0x13')][_0x8650('0x16')]);}logger[_0x8650('0x13')]('Template,\x20%s,\x20%s',_0xe8e31b,_0x47ada7[_0x8650('0x13')][_0x8650('0x16')]);return _0x54d7ce(_0x47ada7['error'][_0x8650('0x16')]);}else{logger[_0x8650('0xe')]('Template,\x20%s,\x20%s',_0xe8e31b,_0x8650('0xf'));_0x54d7ce(_0x47ada7[_0x8650('0x17')][_0x8650('0x16')]);}})[_0x8650('0x18')](function(_0x3016ea){logger[_0x8650('0x13')]('Template,\x20%s,\x20%s',_0xe8e31b,_0x3016ea);_0x447c17(_0x3016ea);});});}exports[_0x8650('0x19')]=function(_0x5d2565){var _0x4ac136=this;return new Promise(function(_0x15e459,_0x26dfe8){return db['Template'][_0x8650('0x1a')]({'raw':_0x5d2565[_0x8650('0x1b')]?_0x5d2565[_0x8650('0x1b')][_0x8650('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d2565[_0x8650('0x1b')]?_0x5d2565[_0x8650('0x1b')][_0x8650('0x1d')]||null:null,'attributes':_0x5d2565[_0x8650('0x1b')]?_0x5d2565[_0x8650('0x1b')][_0x8650('0x1e')]||null:null,'limit':_0x5d2565['options']?_0x5d2565['options']['limit']||null:null,'include':_0x5d2565[_0x8650('0x1b')]?_0x5d2565[_0x8650('0x1b')][_0x8650('0x1f')]?_[_0x8650('0x20')](_0x5d2565[_0x8650('0x1b')][_0x8650('0x1f')],function(_0x1ee9fd){return{'model':db[_0x1ee9fd[_0x8650('0x21')]],'as':_0x1ee9fd['as'],'attributes':_0x1ee9fd[_0x8650('0x1e')],'include':_0x1ee9fd['include']?_['map'](_0x1ee9fd[_0x8650('0x1f')],function(_0x47f106){return{'model':db[_0x47f106[_0x8650('0x21')]],'as':_0x47f106['as'],'attributes':_0x47f106[_0x8650('0x1e')],'include':_0x47f106[_0x8650('0x1f')]?_['map'](_0x47f106[_0x8650('0x1f')],function(_0x2ee679){return{'model':db[_0x2ee679[_0x8650('0x21')]],'as':_0x2ee679['as'],'attributes':_0x2ee679[_0x8650('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8650('0xd')](function(_0x13d711){logger[_0x8650('0xe')](_0x8650('0x19'),_0x5d2565);logger['debug']('GetTemplate',_0x5d2565,JSON[_0x8650('0x12')](_0x13d711));_0x15e459(_0x13d711);})[_0x8650('0x18')](function(_0x1b7da7){logger[_0x8650('0x13')]('GetTemplate',_0x1b7da7[_0x8650('0x16')],_0x5d2565);_0x26dfe8(_0x4ac136[_0x8650('0x13')](0x1f4,_0x1b7da7['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index ad3fc5b..57e6dfd 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 _0x2474=['post','create','addAllCondition','addAction','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions'];(function(_0x40f59c,_0x3e57b7){var _0x2202c9=function(_0xcb458){while(--_0xcb458){_0x40f59c['push'](_0x40f59c['shift']());}};_0x2202c9(++_0x3e57b7);}(_0x2474,0x1c8));var _0x4247=function(_0x5a252f,_0x9b355d){_0x5a252f=_0x5a252f-0x0;var _0x246e5e=_0x2474[_0x5a252f];return _0x246e5e;};'use strict';var multer=require('multer');var util=require(_0x4247('0x0'));var path=require(_0x4247('0x1'));var timeout=require(_0x4247('0x2'));var express=require(_0x4247('0x3'));var router=express[_0x4247('0x4')]();var auth=require(_0x4247('0x5'));var interaction=require(_0x4247('0x6'));var config=require(_0x4247('0x7'));var controller=require(_0x4247('0x8'));router[_0x4247('0x9')]('/',auth[_0x4247('0xa')](),controller[_0x4247('0xb')]);router[_0x4247('0x9')](_0x4247('0xc'),auth[_0x4247('0xa')](),controller[_0x4247('0xd')]);router[_0x4247('0x9')](_0x4247('0xe'),auth['isAuthenticated'](),controller[_0x4247('0xf')]);router[_0x4247('0x9')](_0x4247('0x10'),auth[_0x4247('0xa')](),controller[_0x4247('0x11')]);router[_0x4247('0x9')](_0x4247('0x12'),auth[_0x4247('0xa')](),controller[_0x4247('0x13')]);router[_0x4247('0x14')]('/',auth[_0x4247('0xa')](),controller[_0x4247('0x15')]);router[_0x4247('0x14')](_0x4247('0xe'),auth[_0x4247('0xa')](),controller[_0x4247('0x16')]);router[_0x4247('0x14')]('/:id/any_conditions',auth[_0x4247('0xa')](),controller['addAnyCondition']);router['post'](_0x4247('0x12'),auth[_0x4247('0xa')](),controller[_0x4247('0x17')]);router[_0x4247('0x18')](_0x4247('0xc'),auth[_0x4247('0xa')](),controller['update']);router[_0x4247('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x4247('0x1a')]);module[_0x4247('0x1b')]=router; \ No newline at end of file +var _0xb208=['post','create','addAction','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb208,0xc6));var _0x8b20=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xb208[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require('multer');var util=require(_0x8b20('0x0'));var path=require('path');var timeout=require(_0x8b20('0x1'));var express=require(_0x8b20('0x2'));var router=express[_0x8b20('0x3')]();var auth=require(_0x8b20('0x4'));var interaction=require(_0x8b20('0x5'));var config=require(_0x8b20('0x6'));var controller=require('./trigger.controller');router['get']('/',auth[_0x8b20('0x7')](),controller[_0x8b20('0x8')]);router[_0x8b20('0x9')](_0x8b20('0xa'),auth[_0x8b20('0x7')](),controller[_0x8b20('0xb')]);router['get'](_0x8b20('0xc'),auth[_0x8b20('0x7')](),controller[_0x8b20('0xd')]);router['get'](_0x8b20('0xe'),auth['isAuthenticated'](),controller[_0x8b20('0xf')]);router['get'](_0x8b20('0x10'),auth[_0x8b20('0x7')](),controller[_0x8b20('0x11')]);router[_0x8b20('0x12')]('/',auth[_0x8b20('0x7')](),controller[_0x8b20('0x13')]);router[_0x8b20('0x12')](_0x8b20('0xc'),auth[_0x8b20('0x7')](),controller['addAllCondition']);router[_0x8b20('0x12')](_0x8b20('0xe'),auth[_0x8b20('0x7')](),controller['addAnyCondition']);router[_0x8b20('0x12')]('/:id/actions',auth['isAuthenticated'](),controller[_0x8b20('0x14')]);router['put']('/:id',auth[_0x8b20('0x7')](),controller['update']);router[_0x8b20('0x15')](_0x8b20('0xa'),auth[_0x8b20('0x7')](),controller[_0x8b20('0x16')]);module[_0x8b20('0x17')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index d616c86..77381b1 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 _0xc572=['exports','STRING','BOOLEAN'];(function(_0x500697,_0x469037){var _0x3df905=function(_0x2dd254){while(--_0x2dd254){_0x500697['push'](_0x500697['shift']());}};_0x3df905(++_0x469037);}(_0xc572,0x156));var _0x2c57=function(_0x4c2fad,_0x1eb609){_0x4c2fad=_0x4c2fad-0x0;var _0x1a4825=_0xc572[_0x4c2fad];return _0x1a4825;};'use strict';var Sequelize=require('sequelize');module[_0x2c57('0x0')]={'name':{'type':Sequelize[_0x2c57('0x1')]},'channel':{'type':Sequelize[_0x2c57('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x2c57('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xccc2=['STRING','BOOLEAN','sequelize'];(function(_0x4bab8e,_0x3e973b){var _0x3778a4=function(_0x110bca){while(--_0x110bca){_0x4bab8e['push'](_0x4bab8e['shift']());}};_0x3778a4(++_0x3e973b);}(_0xccc2,0x1c4));var _0x2ccc=function(_0x427d22,_0x358ab6){_0x427d22=_0x427d22-0x0;var _0x3217af=_0xccc2[_0x427d22];return _0x3217af;};'use strict';var Sequelize=require(_0x2ccc('0x0'));module['exports']={'name':{'type':Sequelize[_0x2ccc('0x1')]},'channel':{'type':Sequelize[_0x2ccc('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x2ccc('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 e4948db..4280c02 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 _0x712b=['getAnyConditions','Action','getActions','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','Content-Range','apply','reject','save','then','get','Triggers','UserProfileResource','destroy','end','error','name','send','index','map','Trigger','query','keys','intersection','model','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','merge','includeAll','findAll','rows','catch','show','rawAttributes','fields','length','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','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','filter'];(function(_0x3cb882,_0x12f180){var _0x5d0bdb=function(_0x41780c){while(--_0x41780c){_0x3cb882['push'](_0x3cb882['shift']());}};_0x5d0bdb(++_0x12f180);}(_0x712b,0xaf));var _0xb712=function(_0xc098a7,_0x46ee3d){_0xc098a7=_0xc098a7-0x0;var _0x29323c=_0x712b[_0xc098a7];return _0x29323c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb712('0x0'));var zipdir=require(_0xb712('0x1'));var jsonpatch=require(_0xb712('0x2'));var rp=require('request-promise');var moment=require(_0xb712('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xb712('0x4'));var sox=require(_0xb712('0x5'));var csv=require(_0xb712('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb712('0x7'));var crypto=require(_0xb712('0x8'));var jsforce=require(_0xb712('0x9'));var deskjs=require(_0xb712('0xa'));var toCsv=require(_0xb712('0x6'));var querystring=require(_0xb712('0xb'));var Papa=require(_0xb712('0xc'));var Redis=require(_0xb712('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xb712('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb712('0xf'));var logger=require('../../config/logger')(_0xb712('0x10'));var utils=require(_0xb712('0x11'));var config=require(_0xb712('0x12'));var db=require(_0xb712('0x13'))['db'];function respondWithStatusCode(_0x2e52d2,_0x3bb63e){_0x3bb63e=_0x3bb63e||0xcc;return function(_0x1c33a7){if(_0x1c33a7){return _0x2e52d2[_0xb712('0x14')](_0x3bb63e);}return _0x2e52d2['status'](_0x3bb63e)['end']();};}function respondWithResult(_0x28a8ff,_0x688460){_0x688460=_0x688460||0xc8;return function(_0x48a193){if(_0x48a193){return _0x28a8ff[_0xb712('0x15')](_0x688460)[_0xb712('0x16')](_0x48a193);}};}function respondWithFilteredResult(_0x1b489b,_0x52b928){return function(_0x1e9b89){if(_0x1e9b89){var _0x3cd307=_0x1e9b89[_0xb712('0x17')],_0xbda08f=_0x52b928['offset'],_0x33e95e=_0x52b928['offset']+_0x52b928[_0xb712('0x18')],_0x2d5a7;if(_0x33e95e>=_0x3cd307){_0x33e95e=_0x3cd307;_0x2d5a7=0xc8;}else{_0x2d5a7=0xce;}_0x1b489b[_0xb712('0x15')](_0x2d5a7);return _0x1b489b['set'](_0xb712('0x19'),_0xbda08f+'-'+_0x33e95e+'/'+_0x3cd307)[_0xb712('0x16')](_0x1e9b89);}return null;};}function patchUpdates(_0x1810f0){return function(_0x5d2acc){try{jsonpatch[_0xb712('0x1a')](_0x5d2acc,_0x1810f0,!![]);}catch(_0x3edc4b){return BPromise[_0xb712('0x1b')](_0x3edc4b);}return _0x5d2acc[_0xb712('0x1c')]();};}function saveUpdates(_0x29c7a4,_0x1187f4){return function(_0x3f6257){if(_0x3f6257){return _0x3f6257['update'](_0x29c7a4)[_0xb712('0x1d')](function(_0x18d0cd){return _0x18d0cd;});}return null;};}function removeEntity(_0x255b9d,_0x5018d3){return function(_0x2168b4){if(_0x2168b4){return _0x2168b4['destroy']()[_0xb712('0x1d')](function(){var _0x40883a=_0x2168b4[_0xb712('0x1e')]({'plain':!![]});var _0x6bb1de=_0xb712('0x1f');return db[_0xb712('0x20')][_0xb712('0x21')]({'where':{'type':_0x6bb1de,'resourceId':_0x40883a['id']}})[_0xb712('0x1d')](function(){return _0x2168b4;});})[_0xb712('0x1d')](function(){_0x255b9d[_0xb712('0x15')](0xcc)[_0xb712('0x22')]();});}};}function handleEntityNotFound(_0x145d73,_0x13c743){return function(_0x1035d6){if(!_0x1035d6){_0x145d73[_0xb712('0x14')](0x194);}return _0x1035d6;};}function handleError(_0x9f1b8a,_0x1d3c2d){_0x1d3c2d=_0x1d3c2d||0x1f4;return function(_0x2d9aad){logger[_0xb712('0x23')](_0x2d9aad['stack']);if(_0x2d9aad[_0xb712('0x24')]){delete _0x2d9aad[_0xb712('0x24')];}_0x9f1b8a[_0xb712('0x15')](_0x1d3c2d)[_0xb712('0x25')](_0x2d9aad);};}exports[_0xb712('0x26')]=function(_0x3ffd30,_0x4d1e2a){var _0x19bde4={},_0x28b390={},_0x4f39ae={'count':0x0,'rows':[]};var _0x2e1fd0=_[_0xb712('0x27')](db[_0xb712('0x28')]['rawAttributes'],function(_0x7d2435){return{'name':_0x7d2435['fieldName'],'type':_0x7d2435['type']['key']};});_0x28b390['model']=_[_0xb712('0x27')](_0x2e1fd0,_0xb712('0x24'));_0x28b390[_0xb712('0x29')]=_[_0xb712('0x2a')](_0x3ffd30['query']);_0x28b390['filters']=_[_0xb712('0x2b')](_0x28b390[_0xb712('0x2c')],_0x28b390[_0xb712('0x29')]);_0x19bde4['attributes']=_[_0xb712('0x2b')](_0x28b390[_0xb712('0x2c')],qs['fields'](_0x3ffd30[_0xb712('0x29')]['fields']));_0x19bde4['attributes']=_0x19bde4[_0xb712('0x2d')]['length']?_0x19bde4[_0xb712('0x2d')]:_0x28b390[_0xb712('0x2c')];if(!_0x3ffd30[_0xb712('0x29')][_0xb712('0x2e')](_0xb712('0x2f'))){_0x19bde4[_0xb712('0x18')]=qs['limit'](_0x3ffd30['query'][_0xb712('0x18')]);_0x19bde4[_0xb712('0x30')]=qs[_0xb712('0x30')](_0x3ffd30[_0xb712('0x29')][_0xb712('0x30')]);}_0x19bde4[_0xb712('0x31')]=qs[_0xb712('0x32')](_0x3ffd30[_0xb712('0x29')][_0xb712('0x32')]);_0x19bde4[_0xb712('0x33')]=qs['filters'](_[_0xb712('0x34')](_0x3ffd30[_0xb712('0x29')],_0x28b390[_0xb712('0x35')]),_0x2e1fd0);if(_0x3ffd30[_0xb712('0x29')]['filter']){_0x19bde4[_0xb712('0x33')]=_[_0xb712('0x36')](_0x19bde4[_0xb712('0x33')],{'$or':_['map'](_0x2e1fd0,function(_0x46f3c3){if(_0x46f3c3['type']!=='VIRTUAL'){var _0x2e7999={};_0x2e7999[_0x46f3c3[_0xb712('0x24')]]={'$like':'%'+_0x3ffd30['query']['filter']+'%'};return _0x2e7999;}})});}_0x19bde4=_['merge']({},_0x19bde4,_0x3ffd30['options']);var _0x3dc188={'where':_0x19bde4['where']};return db[_0xb712('0x28')][_0xb712('0x17')](_0x3dc188)['then'](function(_0x54cee1){_0x4f39ae[_0xb712('0x17')]=_0x54cee1;if(_0x3ffd30[_0xb712('0x29')][_0xb712('0x37')]){_0x19bde4['include']=[{'all':!![]}];}return db[_0xb712('0x28')][_0xb712('0x38')](_0x19bde4);})['then'](function(_0x2a311f){_0x4f39ae[_0xb712('0x39')]=_0x2a311f;return _0x4f39ae;})[_0xb712('0x1d')](respondWithFilteredResult(_0x4d1e2a,_0x19bde4))[_0xb712('0x3a')](handleError(_0x4d1e2a,null));};exports[_0xb712('0x3b')]=function(_0x16a067,_0x5210a6){var _0x13847a={'raw':![],'where':{'id':_0x16a067['params']['id']}},_0x244c21={};_0x244c21['model']=_[_0xb712('0x2a')](db[_0xb712('0x28')][_0xb712('0x3c')]);_0x244c21['query']=_['keys'](_0x16a067[_0xb712('0x29')]);_0x244c21['filters']=_[_0xb712('0x2b')](_0x244c21[_0xb712('0x2c')],_0x244c21[_0xb712('0x29')]);_0x13847a[_0xb712('0x2d')]=_[_0xb712('0x2b')](_0x244c21[_0xb712('0x2c')],qs[_0xb712('0x3d')](_0x16a067[_0xb712('0x29')][_0xb712('0x3d')]));_0x13847a[_0xb712('0x2d')]=_0x13847a[_0xb712('0x2d')][_0xb712('0x3e')]?_0x13847a['attributes']:_0x244c21[_0xb712('0x2c')];if(_0x16a067[_0xb712('0x29')][_0xb712('0x37')]){_0x13847a['include']=[{'all':!![]}];}_0x13847a=_[_0xb712('0x36')]({},_0x13847a,_0x16a067[_0xb712('0x3f')]);return db[_0xb712('0x28')][_0xb712('0x40')](_0x13847a)[_0xb712('0x1d')](handleEntityNotFound(_0x5210a6,null))[_0xb712('0x1d')](respondWithResult(_0x5210a6,null))['catch'](handleError(_0x5210a6,null));};exports[_0xb712('0x41')]=function(_0x42e658,_0x2f3056){return db[_0xb712('0x28')]['create'](_0x42e658[_0xb712('0x42')],{})[_0xb712('0x1d')](function(_0x55eb0a){var _0x253913=_0x42e658[_0xb712('0x43')][_0xb712('0x1e')]({'plain':!![]});if(!_0x253913)throw new Error(_0xb712('0x44'));if(_0x253913['role']===_0xb712('0x43')){var _0x37907b=_0x55eb0a[_0xb712('0x1e')]({'plain':!![]});var _0x3240e7=_0xb712('0x1f');return db[_0xb712('0x45')]['find']({'where':{'name':_0x3240e7,'userProfileId':_0x253913[_0xb712('0x46')]},'raw':!![]})[_0xb712('0x1d')](function(_0x3899b0){if(_0x3899b0&&_0x3899b0[_0xb712('0x47')]===0x0){return db[_0xb712('0x20')][_0xb712('0x41')]({'name':_0x37907b[_0xb712('0x24')],'resourceId':_0x37907b['id'],'type':_0x3899b0[_0xb712('0x24')],'sectionId':_0x3899b0['id']},{})[_0xb712('0x1d')](function(){return _0x55eb0a;});}else{return _0x55eb0a;}})[_0xb712('0x3a')](function(_0x145a07){logger[_0xb712('0x23')](_0xb712('0x48'),_0x145a07);throw _0x145a07;});}return _0x55eb0a;})[_0xb712('0x1d')](respondWithResult(_0x2f3056,0xc9))['catch'](handleError(_0x2f3056,null));};exports[_0xb712('0x49')]=function(_0x264cf1,_0x49838e){if(_0x264cf1[_0xb712('0x42')]['id']){delete _0x264cf1[_0xb712('0x42')]['id'];}return db[_0xb712('0x28')][_0xb712('0x40')]({'where':{'id':_0x264cf1[_0xb712('0x4a')]['id']}})[_0xb712('0x1d')](handleEntityNotFound(_0x49838e,null))[_0xb712('0x1d')](saveUpdates(_0x264cf1['body'],null))[_0xb712('0x1d')](respondWithResult(_0x49838e,null))[_0xb712('0x3a')](handleError(_0x49838e,null));};exports[_0xb712('0x21')]=function(_0x396b95,_0x549e3d){return db[_0xb712('0x28')][_0xb712('0x40')]({'where':{'id':_0x396b95[_0xb712('0x4a')]['id']}})['then'](handleEntityNotFound(_0x549e3d,null))[_0xb712('0x1d')](removeEntity(_0x549e3d,null))[_0xb712('0x3a')](handleError(_0x549e3d,null));};exports[_0xb712('0x4b')]=function(_0x9066d6,_0x573927,_0x52ca00){if(_0x9066d6['body']['id']){delete _0x9066d6[_0xb712('0x42')]['id'];}return db['Trigger']['find']({'where':{'id':_0x9066d6['params']['id']}})[_0xb712('0x1d')](handleEntityNotFound(_0x573927,null))[_0xb712('0x1d')](function(_0x2466aa){if(_0x2466aa){_0x9066d6[_0xb712('0x42')][_0xb712('0x4c')]=_0x2466aa['id'];return db[_0xb712('0x4d')][_0xb712('0x41')](_0x9066d6['body']);}})['then'](respondWithResult(_0x573927,null))[_0xb712('0x3a')](handleError(_0x573927,null));};exports[_0xb712('0x4e')]=function(_0x44d802,_0x1c5472,_0x5d279d){if(_0x44d802[_0xb712('0x42')]['id']){delete _0x44d802[_0xb712('0x42')]['id'];}return db[_0xb712('0x28')]['find']({'where':{'id':_0x44d802[_0xb712('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1c5472,null))[_0xb712('0x1d')](function(_0x406943){if(_0x406943){_0x44d802['body'][_0xb712('0x4f')]=_0x406943['id'];return db[_0xb712('0x4d')][_0xb712('0x41')](_0x44d802[_0xb712('0x42')]);}})[_0xb712('0x1d')](respondWithResult(_0x1c5472,null))[_0xb712('0x3a')](handleError(_0x1c5472,null));};exports[_0xb712('0x50')]=function(_0x14c6d0,_0xd84a,_0x1dd47b){var _0x421c4b={};var _0x547e9a={};var _0x5c5562;var _0x1e4582;return db[_0xb712('0x28')][_0xb712('0x51')]({'where':{'id':_0x14c6d0[_0xb712('0x4a')]['id']}})[_0xb712('0x1d')](handleEntityNotFound(_0xd84a,null))['then'](function(_0xd2e5b9){if(_0xd2e5b9){_0x5c5562=_0xd2e5b9;_0x547e9a[_0xb712('0x2c')]=_[_0xb712('0x2a')](db[_0xb712('0x4d')][_0xb712('0x3c')]);_0x547e9a['query']=_[_0xb712('0x2a')](_0x14c6d0['query']);_0x547e9a[_0xb712('0x35')]=_[_0xb712('0x2b')](_0x547e9a[_0xb712('0x2c')],_0x547e9a[_0xb712('0x29')]);_0x421c4b[_0xb712('0x2d')]=_[_0xb712('0x2b')](_0x547e9a[_0xb712('0x2c')],qs['fields'](_0x14c6d0[_0xb712('0x29')][_0xb712('0x3d')]));_0x421c4b[_0xb712('0x2d')]=_0x421c4b[_0xb712('0x2d')]['length']?_0x421c4b[_0xb712('0x2d')]:_0x547e9a[_0xb712('0x2c')];_0x421c4b[_0xb712('0x31')]=qs[_0xb712('0x32')](_0x14c6d0['query'][_0xb712('0x32')]);_0x421c4b[_0xb712('0x33')]=qs[_0xb712('0x35')](_[_0xb712('0x34')](_0x14c6d0['query'],_0x547e9a[_0xb712('0x35')]));if(_0x14c6d0[_0xb712('0x29')]['filter']){_0x421c4b[_0xb712('0x33')]=_[_0xb712('0x36')](_0x421c4b[_0xb712('0x33')],{'$or':_[_0xb712('0x27')](_0x421c4b[_0xb712('0x2d')],function(_0x202015){var _0x420b5b={};_0x420b5b[_0x202015]={'$like':'%'+_0x14c6d0[_0xb712('0x29')][_0xb712('0x52')]+'%'};return _0x420b5b;})});}_0x421c4b=_[_0xb712('0x36')]({},_0x421c4b,_0x14c6d0['options']);return _0x5c5562[_0xb712('0x50')](_0x421c4b);}})['then'](function(_0x5529b7){if(_0x5529b7){_0x1e4582=_0x5529b7[_0xb712('0x3e')];if(!_0x14c6d0[_0xb712('0x29')][_0xb712('0x2e')](_0xb712('0x2f'))){_0x421c4b[_0xb712('0x18')]=qs['limit'](_0x14c6d0['query'][_0xb712('0x18')]);_0x421c4b['offset']=qs[_0xb712('0x30')](_0x14c6d0[_0xb712('0x29')][_0xb712('0x30')]);}return _0x5c5562[_0xb712('0x50')](_0x421c4b);}})[_0xb712('0x1d')](function(_0x4b717b){if(_0x4b717b){return _0x4b717b?{'count':_0x1e4582,'rows':_0x4b717b}:null;}})[_0xb712('0x1d')](respondWithResult(_0xd84a,null))['catch'](handleError(_0xd84a,null));};exports[_0xb712('0x53')]=function(_0x3c66b8,_0x290fc6,_0x3121e7){var _0x55aaf7={};var _0x28c6fb={};var _0x3b3c38;var _0x33b881;return db[_0xb712('0x28')]['findOne']({'where':{'id':_0x3c66b8['params']['id']}})[_0xb712('0x1d')](handleEntityNotFound(_0x290fc6,null))[_0xb712('0x1d')](function(_0x3bcaff){if(_0x3bcaff){_0x3b3c38=_0x3bcaff;_0x28c6fb[_0xb712('0x2c')]=_[_0xb712('0x2a')](db[_0xb712('0x4d')][_0xb712('0x3c')]);_0x28c6fb[_0xb712('0x29')]=_[_0xb712('0x2a')](_0x3c66b8[_0xb712('0x29')]);_0x28c6fb['filters']=_[_0xb712('0x2b')](_0x28c6fb['model'],_0x28c6fb[_0xb712('0x29')]);_0x55aaf7[_0xb712('0x2d')]=_[_0xb712('0x2b')](_0x28c6fb['model'],qs[_0xb712('0x3d')](_0x3c66b8[_0xb712('0x29')][_0xb712('0x3d')]));_0x55aaf7[_0xb712('0x2d')]=_0x55aaf7[_0xb712('0x2d')]['length']?_0x55aaf7[_0xb712('0x2d')]:_0x28c6fb['model'];_0x55aaf7['order']=qs[_0xb712('0x32')](_0x3c66b8['query'][_0xb712('0x32')]);_0x55aaf7[_0xb712('0x33')]=qs[_0xb712('0x35')](_[_0xb712('0x34')](_0x3c66b8[_0xb712('0x29')],_0x28c6fb[_0xb712('0x35')]));if(_0x3c66b8['query']['filter']){_0x55aaf7[_0xb712('0x33')]=_[_0xb712('0x36')](_0x55aaf7[_0xb712('0x33')],{'$or':_[_0xb712('0x27')](_0x55aaf7['attributes'],function(_0x165b1d){var _0x3e1416={};_0x3e1416[_0x165b1d]={'$like':'%'+_0x3c66b8[_0xb712('0x29')]['filter']+'%'};return _0x3e1416;})});}_0x55aaf7=_['merge']({},_0x55aaf7,_0x3c66b8[_0xb712('0x3f')]);return _0x3b3c38[_0xb712('0x53')](_0x55aaf7);}})[_0xb712('0x1d')](function(_0x29bdf7){if(_0x29bdf7){_0x33b881=_0x29bdf7[_0xb712('0x3e')];if(!_0x3c66b8[_0xb712('0x29')][_0xb712('0x2e')](_0xb712('0x2f'))){_0x55aaf7[_0xb712('0x18')]=qs[_0xb712('0x18')](_0x3c66b8[_0xb712('0x29')][_0xb712('0x18')]);_0x55aaf7[_0xb712('0x30')]=qs['offset'](_0x3c66b8[_0xb712('0x29')][_0xb712('0x30')]);}return _0x3b3c38[_0xb712('0x53')](_0x55aaf7);}})[_0xb712('0x1d')](function(_0x92aebb){if(_0x92aebb){return _0x92aebb?{'count':_0x33b881,'rows':_0x92aebb}:null;}})[_0xb712('0x1d')](respondWithResult(_0x290fc6,null))[_0xb712('0x3a')](handleError(_0x290fc6,null));};exports['addAction']=function(_0x5c99b8,_0x147f4c,_0x5595aa){if(_0x5c99b8['body']['id']){delete _0x5c99b8[_0xb712('0x42')]['id'];}return db[_0xb712('0x28')][_0xb712('0x40')]({'where':{'id':_0x5c99b8[_0xb712('0x4a')]['id']}})[_0xb712('0x1d')](handleEntityNotFound(_0x147f4c,null))[_0xb712('0x1d')](function(_0x2bd73a){if(_0x2bd73a){_0x5c99b8[_0xb712('0x42')]['TriggerId']=_0x2bd73a['id'];return db[_0xb712('0x54')]['create'](_0x5c99b8[_0xb712('0x42')]);}})[_0xb712('0x1d')](respondWithResult(_0x147f4c,null))[_0xb712('0x3a')](handleError(_0x147f4c,null));};exports[_0xb712('0x55')]=function(_0xa8e881,_0x55887a,_0x2f26a6){var _0x12aac9={};var _0x26bfb6={};var _0x1d1a07;var _0x58f1ed;return db[_0xb712('0x28')]['findOne']({'where':{'id':_0xa8e881['params']['id']}})[_0xb712('0x1d')](handleEntityNotFound(_0x55887a,null))[_0xb712('0x1d')](function(_0x2c6eb2){if(_0x2c6eb2){_0x1d1a07=_0x2c6eb2;_0x26bfb6['model']=_[_0xb712('0x2a')](db[_0xb712('0x54')][_0xb712('0x3c')]);_0x26bfb6[_0xb712('0x29')]=_[_0xb712('0x2a')](_0xa8e881[_0xb712('0x29')]);_0x26bfb6['filters']=_['intersection'](_0x26bfb6[_0xb712('0x2c')],_0x26bfb6['query']);_0x12aac9[_0xb712('0x2d')]=_[_0xb712('0x2b')](_0x26bfb6['model'],qs['fields'](_0xa8e881['query']['fields']));_0x12aac9[_0xb712('0x2d')]=_0x12aac9[_0xb712('0x2d')]['length']?_0x12aac9['attributes']:_0x26bfb6[_0xb712('0x2c')];_0x12aac9[_0xb712('0x31')]=qs[_0xb712('0x32')](_0xa8e881[_0xb712('0x29')]['sort']);_0x12aac9[_0xb712('0x33')]=qs[_0xb712('0x35')](_[_0xb712('0x34')](_0xa8e881['query'],_0x26bfb6[_0xb712('0x35')]));if(_0xa8e881[_0xb712('0x29')][_0xb712('0x52')]){_0x12aac9[_0xb712('0x33')]=_[_0xb712('0x36')](_0x12aac9[_0xb712('0x33')],{'$or':_[_0xb712('0x27')](_0x12aac9[_0xb712('0x2d')],function(_0x4f24d9){var _0x4ecdba={};_0x4ecdba[_0x4f24d9]={'$like':'%'+_0xa8e881[_0xb712('0x29')]['filter']+'%'};return _0x4ecdba;})});}_0x12aac9=_[_0xb712('0x36')]({},_0x12aac9,_0xa8e881[_0xb712('0x3f')]);return _0x1d1a07[_0xb712('0x55')](_0x12aac9);}})['then'](function(_0x127e1f){if(_0x127e1f){_0x58f1ed=_0x127e1f[_0xb712('0x3e')];if(!_0xa8e881[_0xb712('0x29')][_0xb712('0x2e')](_0xb712('0x2f'))){_0x12aac9['limit']=qs[_0xb712('0x18')](_0xa8e881[_0xb712('0x29')][_0xb712('0x18')]);_0x12aac9[_0xb712('0x30')]=qs['offset'](_0xa8e881['query'][_0xb712('0x30')]);}return _0x1d1a07['getActions'](_0x12aac9);}})['then'](function(_0xe81bcb){if(_0xe81bcb){return _0xe81bcb?{'count':_0x58f1ed,'rows':_0xe81bcb}:null;}})[_0xb712('0x1d')](respondWithResult(_0x55887a,null))[_0xb712('0x3a')](handleError(_0x55887a,null));}; \ No newline at end of file +var _0x7cb8=['offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','end','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','autoAssociation','error','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','pick','nolimit','order','getAnyConditions','addAction','TriggerId','getActions','Action','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count'];(function(_0x11b1b3,_0xf3cc69){var _0x437029=function(_0x40499a){while(--_0x40499a){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x437029(++_0xf3cc69);}(_0x7cb8,0x160));var _0x87cb=function(_0x8a3568,_0xa6cab1){_0x8a3568=_0x8a3568-0x0;var _0x4c370d=_0x7cb8[_0x8a3568];return _0x4c370d;};'use strict';var pdf=require(_0x87cb('0x0'));var emlformat=require(_0x87cb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x87cb('0x2'));var rp=require(_0x87cb('0x3'));var moment=require(_0x87cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x87cb('0x5'));var util=require(_0x87cb('0x6'));var path=require(_0x87cb('0x7'));var sox=require(_0x87cb('0x8'));var csv=require(_0x87cb('0x9'));var ejs=require(_0x87cb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x87cb('0xb'));var crypto=require(_0x87cb('0xc'));var jsforce=require(_0x87cb('0xd'));var deskjs=require(_0x87cb('0xe'));var toCsv=require(_0x87cb('0x9'));var querystring=require('querystring');var Papa=require(_0x87cb('0xf'));var Redis=require(_0x87cb('0x10'));var authService=require(_0x87cb('0x11'));var qs=require(_0x87cb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87cb('0x13'));var logger=require(_0x87cb('0x14'))(_0x87cb('0x15'));var utils=require('../../config/utils');var config=require(_0x87cb('0x16'));var db=require(_0x87cb('0x17'))['db'];function respondWithStatusCode(_0x113f20,_0x3787a6){_0x3787a6=_0x3787a6||0xcc;return function(_0x43f55d){if(_0x43f55d){return _0x113f20[_0x87cb('0x18')](_0x3787a6);}return _0x113f20[_0x87cb('0x19')](_0x3787a6)['end']();};}function respondWithResult(_0x5692bd,_0x26e52a){_0x26e52a=_0x26e52a||0xc8;return function(_0x19ca95){if(_0x19ca95){return _0x5692bd[_0x87cb('0x19')](_0x26e52a)[_0x87cb('0x1a')](_0x19ca95);}};}function respondWithFilteredResult(_0x1fc48f,_0x37ade2){return function(_0x420770){if(_0x420770){var _0x35e1b3=_0x420770[_0x87cb('0x1b')],_0x273558=_0x37ade2[_0x87cb('0x1c')],_0x546738=_0x37ade2[_0x87cb('0x1c')]+_0x37ade2[_0x87cb('0x1d')],_0x3ff843;if(_0x546738>=_0x35e1b3){_0x546738=_0x35e1b3;_0x3ff843=0xc8;}else{_0x3ff843=0xce;}_0x1fc48f[_0x87cb('0x19')](_0x3ff843);return _0x1fc48f[_0x87cb('0x1e')](_0x87cb('0x1f'),_0x273558+'-'+_0x546738+'/'+_0x35e1b3)[_0x87cb('0x1a')](_0x420770);}return null;};}function patchUpdates(_0x1b516d){return function(_0x5e8858){try{jsonpatch[_0x87cb('0x20')](_0x5e8858,_0x1b516d,!![]);}catch(_0x2bc28d){return BPromise[_0x87cb('0x21')](_0x2bc28d);}return _0x5e8858[_0x87cb('0x22')]();};}function saveUpdates(_0xd18132,_0x2c3208){return function(_0x5d277d){if(_0x5d277d){return _0x5d277d[_0x87cb('0x23')](_0xd18132)['then'](function(_0x5b857c){return _0x5b857c;});}return null;};}function removeEntity(_0x4fb5de,_0x5a54a5){return function(_0x30131e){if(_0x30131e){return _0x30131e[_0x87cb('0x24')]()[_0x87cb('0x25')](function(){var _0x3b0cc2=_0x30131e['get']({'plain':!![]});var _0x1dc11d='Triggers';return db[_0x87cb('0x26')]['destroy']({'where':{'type':_0x1dc11d,'resourceId':_0x3b0cc2['id']}})['then'](function(){return _0x30131e;});})[_0x87cb('0x25')](function(){_0x4fb5de['status'](0xcc)[_0x87cb('0x27')]();});}};}function handleEntityNotFound(_0xd46250,_0xd51fbd){return function(_0x3e5b49){if(!_0x3e5b49){_0xd46250[_0x87cb('0x18')](0x194);}return _0x3e5b49;};}function handleError(_0x2ab053,_0x114327){_0x114327=_0x114327||0x1f4;return function(_0x2039e5){logger['error'](_0x2039e5[_0x87cb('0x28')]);if(_0x2039e5[_0x87cb('0x29')]){delete _0x2039e5[_0x87cb('0x29')];}_0x2ab053[_0x87cb('0x19')](_0x114327)[_0x87cb('0x2a')](_0x2039e5);};}exports[_0x87cb('0x2b')]=function(_0x1fa88a,_0xc340d9){var _0x3337e9={},_0x556db8={},_0x55b6ec={'count':0x0,'rows':[]};var _0x447f1d=_[_0x87cb('0x2c')](db[_0x87cb('0x2d')][_0x87cb('0x2e')],function(_0x3c3763){return{'name':_0x3c3763[_0x87cb('0x2f')],'type':_0x3c3763[_0x87cb('0x30')]['key']};});_0x556db8[_0x87cb('0x31')]=_[_0x87cb('0x2c')](_0x447f1d,_0x87cb('0x29'));_0x556db8[_0x87cb('0x32')]=_[_0x87cb('0x33')](_0x1fa88a['query']);_0x556db8[_0x87cb('0x34')]=_[_0x87cb('0x35')](_0x556db8['model'],_0x556db8['query']);_0x3337e9[_0x87cb('0x36')]=_[_0x87cb('0x35')](_0x556db8[_0x87cb('0x31')],qs[_0x87cb('0x37')](_0x1fa88a[_0x87cb('0x32')]['fields']));_0x3337e9['attributes']=_0x3337e9['attributes'][_0x87cb('0x38')]?_0x3337e9['attributes']:_0x556db8[_0x87cb('0x31')];if(!_0x1fa88a[_0x87cb('0x32')][_0x87cb('0x39')]('nolimit')){_0x3337e9['limit']=qs['limit'](_0x1fa88a[_0x87cb('0x32')]['limit']);_0x3337e9['offset']=qs[_0x87cb('0x1c')](_0x1fa88a[_0x87cb('0x32')]['offset']);}_0x3337e9['order']=qs[_0x87cb('0x3a')](_0x1fa88a[_0x87cb('0x32')][_0x87cb('0x3a')]);_0x3337e9[_0x87cb('0x3b')]=qs[_0x87cb('0x34')](_['pick'](_0x1fa88a['query'],_0x556db8['filters']),_0x447f1d);if(_0x1fa88a[_0x87cb('0x32')][_0x87cb('0x3c')]){_0x3337e9[_0x87cb('0x3b')]=_[_0x87cb('0x3d')](_0x3337e9['where'],{'$or':_[_0x87cb('0x2c')](_0x447f1d,function(_0x34b52b){if(_0x34b52b[_0x87cb('0x30')]!==_0x87cb('0x3e')){var _0x1d3f7c={};_0x1d3f7c[_0x34b52b['name']]={'$like':'%'+_0x1fa88a[_0x87cb('0x32')]['filter']+'%'};return _0x1d3f7c;}})});}_0x3337e9=_[_0x87cb('0x3d')]({},_0x3337e9,_0x1fa88a['options']);var _0x58fb2d={'where':_0x3337e9[_0x87cb('0x3b')]};return db[_0x87cb('0x2d')][_0x87cb('0x1b')](_0x58fb2d)[_0x87cb('0x25')](function(_0x59c0a8){_0x55b6ec['count']=_0x59c0a8;if(_0x1fa88a[_0x87cb('0x32')][_0x87cb('0x3f')]){_0x3337e9[_0x87cb('0x40')]=[{'all':!![]}];}return db[_0x87cb('0x2d')]['findAll'](_0x3337e9);})['then'](function(_0x2da474){_0x55b6ec[_0x87cb('0x41')]=_0x2da474;return _0x55b6ec;})[_0x87cb('0x25')](respondWithFilteredResult(_0xc340d9,_0x3337e9))[_0x87cb('0x42')](handleError(_0xc340d9,null));};exports[_0x87cb('0x43')]=function(_0x42c79a,_0x514385){var _0x47301c={'raw':![],'where':{'id':_0x42c79a[_0x87cb('0x44')]['id']}},_0x4026de={};_0x4026de[_0x87cb('0x31')]=_['keys'](db['Trigger'][_0x87cb('0x2e')]);_0x4026de[_0x87cb('0x32')]=_[_0x87cb('0x33')](_0x42c79a['query']);_0x4026de[_0x87cb('0x34')]=_[_0x87cb('0x35')](_0x4026de['model'],_0x4026de[_0x87cb('0x32')]);_0x47301c[_0x87cb('0x36')]=_[_0x87cb('0x35')](_0x4026de[_0x87cb('0x31')],qs['fields'](_0x42c79a[_0x87cb('0x32')][_0x87cb('0x37')]));_0x47301c[_0x87cb('0x36')]=_0x47301c[_0x87cb('0x36')]['length']?_0x47301c[_0x87cb('0x36')]:_0x4026de[_0x87cb('0x31')];if(_0x42c79a[_0x87cb('0x32')][_0x87cb('0x3f')]){_0x47301c[_0x87cb('0x40')]=[{'all':!![]}];}_0x47301c=_[_0x87cb('0x3d')]({},_0x47301c,_0x42c79a[_0x87cb('0x45')]);return db[_0x87cb('0x2d')][_0x87cb('0x46')](_0x47301c)[_0x87cb('0x25')](handleEntityNotFound(_0x514385,null))[_0x87cb('0x25')](respondWithResult(_0x514385,null))[_0x87cb('0x42')](handleError(_0x514385,null));};exports['create']=function(_0x41ec44,_0x642a42){return db['Trigger'][_0x87cb('0x47')](_0x41ec44[_0x87cb('0x48')],{})[_0x87cb('0x25')](function(_0x2f1aa1){var _0x592b8a=_0x41ec44[_0x87cb('0x49')][_0x87cb('0x4a')]({'plain':!![]});if(!_0x592b8a)throw new Error(_0x87cb('0x4b'));if(_0x592b8a[_0x87cb('0x4c')]===_0x87cb('0x49')){var _0x1b06e1=_0x2f1aa1[_0x87cb('0x4a')]({'plain':!![]});var _0x397503=_0x87cb('0x4d');return db[_0x87cb('0x4e')][_0x87cb('0x46')]({'where':{'name':_0x397503,'userProfileId':_0x592b8a[_0x87cb('0x4f')]},'raw':!![]})[_0x87cb('0x25')](function(_0x390c92){if(_0x390c92&&_0x390c92[_0x87cb('0x50')]===0x0){return db[_0x87cb('0x26')][_0x87cb('0x47')]({'name':_0x1b06e1[_0x87cb('0x29')],'resourceId':_0x1b06e1['id'],'type':_0x390c92[_0x87cb('0x29')],'sectionId':_0x390c92['id']},{})[_0x87cb('0x25')](function(){return _0x2f1aa1;});}else{return _0x2f1aa1;}})[_0x87cb('0x42')](function(_0x1f675d){logger[_0x87cb('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f675d);throw _0x1f675d;});}return _0x2f1aa1;})[_0x87cb('0x25')](respondWithResult(_0x642a42,0xc9))[_0x87cb('0x42')](handleError(_0x642a42,null));};exports[_0x87cb('0x23')]=function(_0xe46e63,_0x2c06a2){if(_0xe46e63[_0x87cb('0x48')]['id']){delete _0xe46e63[_0x87cb('0x48')]['id'];}return db[_0x87cb('0x2d')][_0x87cb('0x46')]({'where':{'id':_0xe46e63[_0x87cb('0x44')]['id']}})[_0x87cb('0x25')](handleEntityNotFound(_0x2c06a2,null))[_0x87cb('0x25')](saveUpdates(_0xe46e63[_0x87cb('0x48')],null))['then'](respondWithResult(_0x2c06a2,null))['catch'](handleError(_0x2c06a2,null));};exports['destroy']=function(_0x168c5a,_0x1cabf7){return db[_0x87cb('0x2d')][_0x87cb('0x46')]({'where':{'id':_0x168c5a[_0x87cb('0x44')]['id']}})[_0x87cb('0x25')](handleEntityNotFound(_0x1cabf7,null))[_0x87cb('0x25')](removeEntity(_0x1cabf7,null))[_0x87cb('0x42')](handleError(_0x1cabf7,null));};exports['addAllCondition']=function(_0x24eb66,_0x53dc14,_0x151719){if(_0x24eb66[_0x87cb('0x48')]['id']){delete _0x24eb66[_0x87cb('0x48')]['id'];}return db[_0x87cb('0x2d')][_0x87cb('0x46')]({'where':{'id':_0x24eb66['params']['id']}})[_0x87cb('0x25')](handleEntityNotFound(_0x53dc14,null))['then'](function(_0x40d95b){if(_0x40d95b){_0x24eb66[_0x87cb('0x48')]['TriggerAllId']=_0x40d95b['id'];return db[_0x87cb('0x52')]['create'](_0x24eb66[_0x87cb('0x48')]);}})['then'](respondWithResult(_0x53dc14,null))[_0x87cb('0x42')](handleError(_0x53dc14,null));};exports[_0x87cb('0x53')]=function(_0x2a5dfc,_0x5db6e1,_0x23f974){if(_0x2a5dfc[_0x87cb('0x48')]['id']){delete _0x2a5dfc[_0x87cb('0x48')]['id'];}return db[_0x87cb('0x2d')][_0x87cb('0x46')]({'where':{'id':_0x2a5dfc[_0x87cb('0x44')]['id']}})[_0x87cb('0x25')](handleEntityNotFound(_0x5db6e1,null))['then'](function(_0x4c24ec){if(_0x4c24ec){_0x2a5dfc[_0x87cb('0x48')][_0x87cb('0x54')]=_0x4c24ec['id'];return db[_0x87cb('0x52')][_0x87cb('0x47')](_0x2a5dfc[_0x87cb('0x48')]);}})[_0x87cb('0x25')](respondWithResult(_0x5db6e1,null))[_0x87cb('0x42')](handleError(_0x5db6e1,null));};exports[_0x87cb('0x55')]=function(_0x56ae31,_0x403fc3,_0x570a03){var _0x3e7647={};var _0x440d61={};var _0x1c5d15;var _0x54aec9;return db[_0x87cb('0x2d')][_0x87cb('0x56')]({'where':{'id':_0x56ae31[_0x87cb('0x44')]['id']}})['then'](handleEntityNotFound(_0x403fc3,null))[_0x87cb('0x25')](function(_0x7e0860){if(_0x7e0860){_0x1c5d15=_0x7e0860;_0x440d61['model']=_[_0x87cb('0x33')](db['Condition']['rawAttributes']);_0x440d61[_0x87cb('0x32')]=_[_0x87cb('0x33')](_0x56ae31[_0x87cb('0x32')]);_0x440d61[_0x87cb('0x34')]=_['intersection'](_0x440d61[_0x87cb('0x31')],_0x440d61[_0x87cb('0x32')]);_0x3e7647[_0x87cb('0x36')]=_[_0x87cb('0x35')](_0x440d61['model'],qs['fields'](_0x56ae31[_0x87cb('0x32')][_0x87cb('0x37')]));_0x3e7647[_0x87cb('0x36')]=_0x3e7647['attributes'][_0x87cb('0x38')]?_0x3e7647[_0x87cb('0x36')]:_0x440d61[_0x87cb('0x31')];_0x3e7647['order']=qs[_0x87cb('0x3a')](_0x56ae31[_0x87cb('0x32')][_0x87cb('0x3a')]);_0x3e7647[_0x87cb('0x3b')]=qs['filters'](_[_0x87cb('0x57')](_0x56ae31[_0x87cb('0x32')],_0x440d61['filters']));if(_0x56ae31[_0x87cb('0x32')][_0x87cb('0x3c')]){_0x3e7647[_0x87cb('0x3b')]=_[_0x87cb('0x3d')](_0x3e7647[_0x87cb('0x3b')],{'$or':_[_0x87cb('0x2c')](_0x3e7647['attributes'],function(_0x542b2c){var _0x35d7c9={};_0x35d7c9[_0x542b2c]={'$like':'%'+_0x56ae31[_0x87cb('0x32')]['filter']+'%'};return _0x35d7c9;})});}_0x3e7647=_[_0x87cb('0x3d')]({},_0x3e7647,_0x56ae31['options']);return _0x1c5d15[_0x87cb('0x55')](_0x3e7647);}})[_0x87cb('0x25')](function(_0x11dc82){if(_0x11dc82){_0x54aec9=_0x11dc82[_0x87cb('0x38')];if(!_0x56ae31['query'][_0x87cb('0x39')](_0x87cb('0x58'))){_0x3e7647[_0x87cb('0x1d')]=qs[_0x87cb('0x1d')](_0x56ae31[_0x87cb('0x32')][_0x87cb('0x1d')]);_0x3e7647[_0x87cb('0x1c')]=qs['offset'](_0x56ae31[_0x87cb('0x32')][_0x87cb('0x1c')]);}return _0x1c5d15['getAllConditions'](_0x3e7647);}})[_0x87cb('0x25')](function(_0xf4096d){if(_0xf4096d){return _0xf4096d?{'count':_0x54aec9,'rows':_0xf4096d}:null;}})[_0x87cb('0x25')](respondWithResult(_0x403fc3,null))['catch'](handleError(_0x403fc3,null));};exports['getAnyConditions']=function(_0x4605ae,_0x56d57c,_0x442885){var _0x2e411e={};var _0x1a592d={};var _0x462ceb;var _0x14defa;return db['Trigger'][_0x87cb('0x56')]({'where':{'id':_0x4605ae[_0x87cb('0x44')]['id']}})[_0x87cb('0x25')](handleEntityNotFound(_0x56d57c,null))['then'](function(_0x52ef27){if(_0x52ef27){_0x462ceb=_0x52ef27;_0x1a592d[_0x87cb('0x31')]=_['keys'](db[_0x87cb('0x52')][_0x87cb('0x2e')]);_0x1a592d[_0x87cb('0x32')]=_[_0x87cb('0x33')](_0x4605ae[_0x87cb('0x32')]);_0x1a592d['filters']=_[_0x87cb('0x35')](_0x1a592d[_0x87cb('0x31')],_0x1a592d[_0x87cb('0x32')]);_0x2e411e[_0x87cb('0x36')]=_[_0x87cb('0x35')](_0x1a592d['model'],qs[_0x87cb('0x37')](_0x4605ae[_0x87cb('0x32')][_0x87cb('0x37')]));_0x2e411e[_0x87cb('0x36')]=_0x2e411e[_0x87cb('0x36')][_0x87cb('0x38')]?_0x2e411e[_0x87cb('0x36')]:_0x1a592d[_0x87cb('0x31')];_0x2e411e[_0x87cb('0x59')]=qs[_0x87cb('0x3a')](_0x4605ae[_0x87cb('0x32')]['sort']);_0x2e411e['where']=qs[_0x87cb('0x34')](_[_0x87cb('0x57')](_0x4605ae[_0x87cb('0x32')],_0x1a592d[_0x87cb('0x34')]));if(_0x4605ae[_0x87cb('0x32')][_0x87cb('0x3c')]){_0x2e411e[_0x87cb('0x3b')]=_[_0x87cb('0x3d')](_0x2e411e[_0x87cb('0x3b')],{'$or':_[_0x87cb('0x2c')](_0x2e411e[_0x87cb('0x36')],function(_0x4c4585){var _0x4584ef={};_0x4584ef[_0x4c4585]={'$like':'%'+_0x4605ae[_0x87cb('0x32')][_0x87cb('0x3c')]+'%'};return _0x4584ef;})});}_0x2e411e=_[_0x87cb('0x3d')]({},_0x2e411e,_0x4605ae[_0x87cb('0x45')]);return _0x462ceb[_0x87cb('0x5a')](_0x2e411e);}})[_0x87cb('0x25')](function(_0x29ee16){if(_0x29ee16){_0x14defa=_0x29ee16[_0x87cb('0x38')];if(!_0x4605ae[_0x87cb('0x32')]['hasOwnProperty']('nolimit')){_0x2e411e[_0x87cb('0x1d')]=qs[_0x87cb('0x1d')](_0x4605ae[_0x87cb('0x32')][_0x87cb('0x1d')]);_0x2e411e[_0x87cb('0x1c')]=qs[_0x87cb('0x1c')](_0x4605ae[_0x87cb('0x32')][_0x87cb('0x1c')]);}return _0x462ceb[_0x87cb('0x5a')](_0x2e411e);}})[_0x87cb('0x25')](function(_0x3e96ad){if(_0x3e96ad){return _0x3e96ad?{'count':_0x14defa,'rows':_0x3e96ad}:null;}})[_0x87cb('0x25')](respondWithResult(_0x56d57c,null))[_0x87cb('0x42')](handleError(_0x56d57c,null));};exports[_0x87cb('0x5b')]=function(_0x3aaea4,_0x2dbcb3,_0x2c4f78){if(_0x3aaea4[_0x87cb('0x48')]['id']){delete _0x3aaea4[_0x87cb('0x48')]['id'];}return db[_0x87cb('0x2d')][_0x87cb('0x46')]({'where':{'id':_0x3aaea4[_0x87cb('0x44')]['id']}})[_0x87cb('0x25')](handleEntityNotFound(_0x2dbcb3,null))[_0x87cb('0x25')](function(_0x11e035){if(_0x11e035){_0x3aaea4['body'][_0x87cb('0x5c')]=_0x11e035['id'];return db['Action'][_0x87cb('0x47')](_0x3aaea4[_0x87cb('0x48')]);}})['then'](respondWithResult(_0x2dbcb3,null))[_0x87cb('0x42')](handleError(_0x2dbcb3,null));};exports[_0x87cb('0x5d')]=function(_0x4d76a2,_0x46cf24,_0x56c5d8){var _0x43cc31={};var _0x43686b={};var _0x5557e0;var _0x1a1c89;return db[_0x87cb('0x2d')][_0x87cb('0x56')]({'where':{'id':_0x4d76a2['params']['id']}})[_0x87cb('0x25')](handleEntityNotFound(_0x46cf24,null))[_0x87cb('0x25')](function(_0x11fad2){if(_0x11fad2){_0x5557e0=_0x11fad2;_0x43686b[_0x87cb('0x31')]=_[_0x87cb('0x33')](db[_0x87cb('0x5e')][_0x87cb('0x2e')]);_0x43686b[_0x87cb('0x32')]=_[_0x87cb('0x33')](_0x4d76a2['query']);_0x43686b['filters']=_[_0x87cb('0x35')](_0x43686b['model'],_0x43686b['query']);_0x43cc31[_0x87cb('0x36')]=_[_0x87cb('0x35')](_0x43686b[_0x87cb('0x31')],qs[_0x87cb('0x37')](_0x4d76a2[_0x87cb('0x32')][_0x87cb('0x37')]));_0x43cc31[_0x87cb('0x36')]=_0x43cc31['attributes']['length']?_0x43cc31[_0x87cb('0x36')]:_0x43686b[_0x87cb('0x31')];_0x43cc31[_0x87cb('0x59')]=qs[_0x87cb('0x3a')](_0x4d76a2[_0x87cb('0x32')][_0x87cb('0x3a')]);_0x43cc31[_0x87cb('0x3b')]=qs[_0x87cb('0x34')](_[_0x87cb('0x57')](_0x4d76a2['query'],_0x43686b[_0x87cb('0x34')]));if(_0x4d76a2[_0x87cb('0x32')][_0x87cb('0x3c')]){_0x43cc31['where']=_[_0x87cb('0x3d')](_0x43cc31[_0x87cb('0x3b')],{'$or':_['map'](_0x43cc31[_0x87cb('0x36')],function(_0x57fd25){var _0x92171f={};_0x92171f[_0x57fd25]={'$like':'%'+_0x4d76a2[_0x87cb('0x32')][_0x87cb('0x3c')]+'%'};return _0x92171f;})});}_0x43cc31=_[_0x87cb('0x3d')]({},_0x43cc31,_0x4d76a2[_0x87cb('0x45')]);return _0x5557e0['getActions'](_0x43cc31);}})[_0x87cb('0x25')](function(_0x2b21f1){if(_0x2b21f1){_0x1a1c89=_0x2b21f1[_0x87cb('0x38')];if(!_0x4d76a2['query'][_0x87cb('0x39')]('nolimit')){_0x43cc31[_0x87cb('0x1d')]=qs['limit'](_0x4d76a2[_0x87cb('0x32')][_0x87cb('0x1d')]);_0x43cc31[_0x87cb('0x1c')]=qs[_0x87cb('0x1c')](_0x4d76a2['query']['offset']);}return _0x5557e0['getActions'](_0x43cc31);}})[_0x87cb('0x25')](function(_0x13480c){if(_0x13480c){return _0x13480c?{'count':_0x1a1c89,'rows':_0x13480c}:null;}})[_0x87cb('0x25')](respondWithResult(_0x46cf24,null))[_0x87cb('0x42')](handleError(_0x46cf24,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index ea46db3..b94f3fe 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 _0x2ef3=['exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./trigger.attributes'];(function(_0x476cb3,_0x271335){var _0x1c65cf=function(_0x2d1ee5){while(--_0x2d1ee5){_0x476cb3['push'](_0x476cb3['shift']());}};_0x1c65cf(++_0x271335);}(_0x2ef3,0xba));var _0x32ef=function(_0x1fd343,_0x46c58f){_0x1fd343=_0x1fd343-0x0;var _0x25af6c=_0x2ef3[_0x1fd343];return _0x25af6c;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','tools_triggers'];(function(_0x422196,_0xf870f0){var _0x1c98d5=function(_0x34582d){while(--_0x34582d){_0x422196['push'](_0x422196['shift']());}};_0x1c98d5(++_0xf870f0);}(_0x1261,0x144));var _0x1126=function(_0x55e28f,_0x20cedb){_0x55e28f=_0x55e28f-0x0;var _0xee48e9=_0x1261[_0x55e28f];return _0xee48e9;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('Trigger',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 812bb64..4326127 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 _0x0972=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetTrigger','Trigger','findAll','options','raw','attributes','limit','include','map','model','catch','find','where','ShowTrigger','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x520af5,_0x260bf7){var _0x49fc6f=function(_0x4dc448){while(--_0x4dc448){_0x520af5['push'](_0x520af5['shift']());}};_0x49fc6f(++_0x260bf7);}(_0x0972,0x64));var _0x2097=function(_0x2be6ff,_0xec91b6){_0x2be6ff=_0x2be6ff-0x0;var _0x2f0bbb=_0x0972[_0x2be6ff];return _0x2f0bbb;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var moment=require('moment');var BPromise=require(_0x2097('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2097('0x2'));var db=require(_0x2097('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2097('0x4'))(_0x2097('0x5'));var config=require(_0x2097('0x6'));var jayson=require(_0x2097('0x7'));var client=jayson[_0x2097('0x8')][_0x2097('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4f21,_0x59739f,_0x332aac){return new BPromise(function(_0x1e661a,_0x11d263){return client[_0x2097('0xa')](_0x2b4f21,_0x332aac)[_0x2097('0xb')](function(_0x59d947){logger[_0x2097('0xc')](_0x2097('0xd'),_0x59739f,_0x2097('0xe'));logger[_0x2097('0xf')](_0x2097('0x10'),_0x59739f,_0x2097('0xe'),JSON[_0x2097('0x11')](_0x59d947));if(_0x59d947[_0x2097('0x12')]){if(_0x59d947[_0x2097('0x12')][_0x2097('0x13')]===0x1f4){logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);return _0x11d263(_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);}logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x59d947[_0x2097('0x12')][_0x2097('0x14')]);return _0x1e661a(_0x59d947['error'][_0x2097('0x14')]);}else{logger[_0x2097('0xc')]('Trigger,\x20%s,\x20%s',_0x59739f,'request\x20sent');_0x1e661a(_0x59d947['result'][_0x2097('0x14')]);}})['catch'](function(_0x28c35c){logger[_0x2097('0x12')](_0x2097('0xd'),_0x59739f,_0x28c35c);_0x11d263(_0x28c35c);});});}exports[_0x2097('0x15')]=function(_0x44c584){var _0x53e2b4=this;return new Promise(function(_0x324652,_0x140094){return db[_0x2097('0x16')][_0x2097('0x17')]({'raw':_0x44c584[_0x2097('0x18')]?_0x44c584[_0x2097('0x18')][_0x2097('0x19')]===undefined?!![]:![]:!![],'where':_0x44c584[_0x2097('0x18')]?_0x44c584['options']['where']||null:null,'attributes':_0x44c584[_0x2097('0x18')]?_0x44c584['options'][_0x2097('0x1a')]||null:null,'limit':_0x44c584[_0x2097('0x18')]?_0x44c584['options'][_0x2097('0x1b')]||null:null,'include':_0x44c584['options']?_0x44c584[_0x2097('0x18')][_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x44c584[_0x2097('0x18')][_0x2097('0x1c')],function(_0x35047b){return{'model':db[_0x35047b['model']],'as':_0x35047b['as'],'attributes':_0x35047b[_0x2097('0x1a')],'include':_0x35047b['include']?_[_0x2097('0x1d')](_0x35047b[_0x2097('0x1c')],function(_0x345875){return{'model':db[_0x345875[_0x2097('0x1e')]],'as':_0x345875['as'],'attributes':_0x345875['attributes'],'include':_0x345875[_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x345875['include'],function(_0x1229fc){return{'model':db[_0x1229fc['model']],'as':_0x1229fc['as'],'attributes':_0x1229fc[_0x2097('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbc0339){logger[_0x2097('0xc')](_0x2097('0x15'),_0x44c584);logger[_0x2097('0xf')](_0x2097('0x15'),_0x44c584,JSON[_0x2097('0x11')](_0xbc0339));_0x324652(_0xbc0339);})[_0x2097('0x1f')](function(_0x4b443d){logger[_0x2097('0x12')](_0x2097('0x15'),_0x4b443d['message'],_0x44c584);_0x140094(_0x53e2b4[_0x2097('0x12')](0x1f4,_0x4b443d[_0x2097('0x14')]));});});};exports['ShowTrigger']=function(_0x4d0916){var _0x312c77=this;return new Promise(function(_0x11b051,_0x1649c8){return db[_0x2097('0x16')][_0x2097('0x20')]({'raw':_0x4d0916[_0x2097('0x18')]?_0x4d0916['options'][_0x2097('0x19')]===undefined?!![]:![]:!![],'where':_0x4d0916['options']?_0x4d0916[_0x2097('0x18')][_0x2097('0x21')]||null:null,'attributes':_0x4d0916[_0x2097('0x18')]?_0x4d0916[_0x2097('0x18')][_0x2097('0x1a')]||null:null,'include':_0x4d0916[_0x2097('0x18')]?_0x4d0916[_0x2097('0x18')][_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x4d0916['options'][_0x2097('0x1c')],function(_0x40baed){return{'model':db[_0x40baed[_0x2097('0x1e')]],'as':_0x40baed['as'],'attributes':_0x40baed['attributes'],'include':_0x40baed[_0x2097('0x1c')]?_[_0x2097('0x1d')](_0x40baed[_0x2097('0x1c')],function(_0x396162){return{'model':db[_0x396162['model']],'as':_0x396162['as'],'attributes':_0x396162['attributes'],'include':_0x396162['include']?_[_0x2097('0x1d')](_0x396162[_0x2097('0x1c')],function(_0x4123b7){return{'model':db[_0x4123b7[_0x2097('0x1e')]],'as':_0x4123b7['as'],'attributes':_0x4123b7[_0x2097('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2097('0xb')](function(_0x49b724){logger[_0x2097('0xc')](_0x2097('0x22'),_0x4d0916);logger[_0x2097('0xf')](_0x2097('0x22'),_0x4d0916,JSON[_0x2097('0x11')](_0x49b724));_0x11b051(_0x49b724);})[_0x2097('0x1f')](function(_0x52b937){logger[_0x2097('0x12')](_0x2097('0x22'),_0x52b937[_0x2097('0x14')],_0x4d0916);_0x1649c8(_0x312c77['error'](0x1f4,_0x52b937['message']));});});}; \ No newline at end of file +var _0xd7d1=['code','message','result','catch','GetTrigger','findAll','options','raw','attributes','limit','include','map','model','debug','Trigger','find','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4666a1,_0x494c01){var _0x2a8cc8=function(_0x8e46ea){while(--_0x8e46ea){_0x4666a1['push'](_0x4666a1['shift']());}};_0x2a8cc8(++_0x494c01);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0xda8da6,_0x286535){_0xda8da6=_0xda8da6-0x0;var _0x56513d=_0xd7d1[_0xda8da6];return _0x56513d;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var moment=require(_0x1d7d('0x2'));var BPromise=require(_0x1d7d('0x3'));var rs=require(_0x1d7d('0x4'));var fs=require('fs');var Redis=require(_0x1d7d('0x5'));var db=require(_0x1d7d('0x6'))['db'];var utils=require(_0x1d7d('0x7'));var logger=require(_0x1d7d('0x8'))(_0x1d7d('0x9'));var config=require(_0x1d7d('0xa'));var jayson=require(_0x1d7d('0xb'));var client=jayson[_0x1d7d('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462ef8,_0x1aa456,_0x14dbf6){return new BPromise(function(_0x3675a2,_0xd6189e){return client[_0x1d7d('0xd')](_0x462ef8,_0x14dbf6)[_0x1d7d('0xe')](function(_0xa44223){logger[_0x1d7d('0xf')](_0x1d7d('0x10'),_0x1aa456,_0x1d7d('0x11'));logger['debug'](_0x1d7d('0x12'),_0x1aa456,'request\x20sent',JSON[_0x1d7d('0x13')](_0xa44223));if(_0xa44223[_0x1d7d('0x14')]){if(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x15')]===0x1f4){logger['error'](_0x1d7d('0x10'),_0x1aa456,_0xa44223['error']['message']);return _0xd6189e(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x1aa456,_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);return _0x3675a2(_0xa44223[_0x1d7d('0x14')][_0x1d7d('0x16')]);}else{logger[_0x1d7d('0xf')]('Trigger,\x20%s,\x20%s',_0x1aa456,_0x1d7d('0x11'));_0x3675a2(_0xa44223[_0x1d7d('0x17')]['message']);}})[_0x1d7d('0x18')](function(_0x162c3a){logger[_0x1d7d('0x14')](_0x1d7d('0x10'),_0x1aa456,_0x162c3a);_0xd6189e(_0x162c3a);});});}exports[_0x1d7d('0x19')]=function(_0x4db4f2){var _0x664e3f=this;return new Promise(function(_0x191024,_0x5cbb8f){return db['Trigger'][_0x1d7d('0x1a')]({'raw':_0x4db4f2[_0x1d7d('0x1b')]?_0x4db4f2[_0x1d7d('0x1b')][_0x1d7d('0x1c')]===undefined?!![]:![]:!![],'where':_0x4db4f2[_0x1d7d('0x1b')]?_0x4db4f2[_0x1d7d('0x1b')]['where']||null:null,'attributes':_0x4db4f2[_0x1d7d('0x1b')]?_0x4db4f2[_0x1d7d('0x1b')][_0x1d7d('0x1d')]||null:null,'limit':_0x4db4f2['options']?_0x4db4f2[_0x1d7d('0x1b')][_0x1d7d('0x1e')]||null:null,'include':_0x4db4f2['options']?_0x4db4f2['options'][_0x1d7d('0x1f')]?_[_0x1d7d('0x20')](_0x4db4f2[_0x1d7d('0x1b')]['include'],function(_0x377653){return{'model':db[_0x377653[_0x1d7d('0x21')]],'as':_0x377653['as'],'attributes':_0x377653[_0x1d7d('0x1d')],'include':_0x377653[_0x1d7d('0x1f')]?_['map'](_0x377653[_0x1d7d('0x1f')],function(_0x151198){return{'model':db[_0x151198['model']],'as':_0x151198['as'],'attributes':_0x151198['attributes'],'include':_0x151198[_0x1d7d('0x1f')]?_['map'](_0x151198[_0x1d7d('0x1f')],function(_0x2d4de4){return{'model':db[_0x2d4de4[_0x1d7d('0x21')]],'as':_0x2d4de4['as'],'attributes':_0x2d4de4[_0x1d7d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d7d('0xe')](function(_0x59f827){logger[_0x1d7d('0xf')](_0x1d7d('0x19'),_0x4db4f2);logger[_0x1d7d('0x22')]('GetTrigger',_0x4db4f2,JSON[_0x1d7d('0x13')](_0x59f827));_0x191024(_0x59f827);})[_0x1d7d('0x18')](function(_0x23ad85){logger['error']('GetTrigger',_0x23ad85['message'],_0x4db4f2);_0x5cbb8f(_0x664e3f[_0x1d7d('0x14')](0x1f4,_0x23ad85[_0x1d7d('0x16')]));});});};exports['ShowTrigger']=function(_0x1ebcbc){var _0x3e4136=this;return new Promise(function(_0x16a81d,_0x3336ab){return db[_0x1d7d('0x23')][_0x1d7d('0x24')]({'raw':_0x1ebcbc[_0x1d7d('0x1b')]?_0x1ebcbc[_0x1d7d('0x1b')][_0x1d7d('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ebcbc[_0x1d7d('0x1b')]?_0x1ebcbc['options']['where']||null:null,'attributes':_0x1ebcbc[_0x1d7d('0x1b')]?_0x1ebcbc[_0x1d7d('0x1b')][_0x1d7d('0x1d')]||null:null,'include':_0x1ebcbc[_0x1d7d('0x1b')]?_0x1ebcbc[_0x1d7d('0x1b')][_0x1d7d('0x1f')]?_[_0x1d7d('0x20')](_0x1ebcbc[_0x1d7d('0x1b')][_0x1d7d('0x1f')],function(_0x47b6b2){return{'model':db[_0x47b6b2[_0x1d7d('0x21')]],'as':_0x47b6b2['as'],'attributes':_0x47b6b2[_0x1d7d('0x1d')],'include':_0x47b6b2[_0x1d7d('0x1f')]?_[_0x1d7d('0x20')](_0x47b6b2['include'],function(_0x4ee17f){return{'model':db[_0x4ee17f[_0x1d7d('0x21')]],'as':_0x4ee17f['as'],'attributes':_0x4ee17f[_0x1d7d('0x1d')],'include':_0x4ee17f['include']?_[_0x1d7d('0x20')](_0x4ee17f[_0x1d7d('0x1f')],function(_0x568092){return{'model':db[_0x568092['model']],'as':_0x568092['as'],'attributes':_0x568092[_0x1d7d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1d7d('0xe')](function(_0x406f57){logger[_0x1d7d('0xf')](_0x1d7d('0x25'),_0x1ebcbc);logger[_0x1d7d('0x22')](_0x1d7d('0x25'),_0x1ebcbc,JSON[_0x1d7d('0x13')](_0x406f57));_0x16a81d(_0x406f57);})[_0x1d7d('0x18')](function(_0x318b9a){logger['error']('ShowTrigger',_0x318b9a['message'],_0x1ebcbc);_0x3336ab(_0x3e4136['error'](0x1f4,_0x318b9a[_0x1d7d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index e0a2453..f5f8995 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 _0x24ca=['put','update','delete','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','/:id/clone','clone','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x24ca,0x1bc));var _0xa24c=function(_0x1a595a,_0x263824){_0x1a595a=_0x1a595a-0x0;var _0x33f008=_0x24ca[_0x1a595a];return _0x33f008;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require(_0xa24c('0x1'));var timeout=require(_0xa24c('0x2'));var express=require(_0xa24c('0x3'));var router=express['Router']();var auth=require(_0xa24c('0x4'));var interaction=require(_0xa24c('0x5'));var config=require(_0xa24c('0x6'));var controller=require(_0xa24c('0x7'));router[_0xa24c('0x8')]('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xa')]);router[_0xa24c('0x8')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xc')]);router['post'](_0xa24c('0xd'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xe')]);router['post']('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x11')]);router[_0xa24c('0x12')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller['destroy']);module[_0xa24c('0x13')]=router; \ No newline at end of file +var _0x4c4e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','/:id/clone','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x4c4e,0x152));var _0xe4c4=function(_0xf6dc0c,_0x122286){_0xf6dc0c=_0xf6dc0c-0x0;var _0x5d6ea5=_0x4c4e[_0xf6dc0c];return _0x5d6ea5;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var auth=require(_0xe4c4('0x4'));var interaction=require(_0xe4c4('0x5'));var config=require(_0xe4c4('0x6'));var controller=require('./trunk.controller');router[_0xe4c4('0x7')]('/',auth['isAuthenticated'](),controller[_0xe4c4('0x8')]);router[_0xe4c4('0x7')](_0xe4c4('0x9'),auth[_0xe4c4('0xa')](),controller[_0xe4c4('0xb')]);router[_0xe4c4('0xc')](_0xe4c4('0xd'),auth[_0xe4c4('0xa')](),controller['clone']);router['post']('/',auth[_0xe4c4('0xa')](),controller[_0xe4c4('0xe')]);router[_0xe4c4('0xf')](_0xe4c4('0x9'),auth[_0xe4c4('0xa')](),controller[_0xe4c4('0x10')]);router['delete'](_0xe4c4('0x9'),auth[_0xe4c4('0xa')](),controller[_0xe4c4('0x11')]);module[_0xe4c4('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index f2f0661..c9d31c5 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 _0x35bd=['allow','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','never','\x22\x22\x20<>','INTEGER','always','originate','uac','uas','pai','certificate','active','passive','actpass','dynamic','update','update,nonat','BOOLEAN','exports','name','peer','friend','STRING','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm'];(function(_0xcfd89f,_0x106e8f){var _0x59acd4=function(_0x2e187c){while(--_0x2e187c){_0xcfd89f['push'](_0xcfd89f['shift']());}};_0x59acd4(++_0x106e8f);}(_0x35bd,0x1e0));var _0xd35b=function(_0x341e07,_0x5a7aa3){_0x341e07=_0x341e07-0x0;var _0x5ecb26=_0x35bd[_0x341e07];return _0x5ecb26;};'use strict';var Sequelize=require('sequelize');module[_0xd35b('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd35b('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend','user',_0xd35b('0x2')),'allowNull':![],'defaultValue':_0xd35b('0x3')},'context':{'type':Sequelize[_0xd35b('0x4')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x6'),_0xd35b('0x7'),'ALLOWED_FAILED_SCREEN',_0xd35b('0x8'),_0xd35b('0x9'),_0xd35b('0xa'),_0xd35b('0xb'),_0xd35b('0xc'))},'deny':{'type':Sequelize[_0xd35b('0x4')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xd35b('0x4')]},'md5secret':{'type':Sequelize[_0xd35b('0x4')]},'remotesecret':{'type':Sequelize[_0xd35b('0x4')]},'transport':{'type':Sequelize[_0xd35b('0x4')],'defaultValue':'udp','set':function(_0x1fca95){this[_0xd35b('0xd')](_0xd35b('0xe'),_0x1fca95?_0x1fca95['join'](','):null);},'get':function(){return this['getDataValue'](_0xd35b('0xe'))?this[_0xd35b('0xf')](_0xd35b('0xe'))[_0xd35b('0x10')](','):null;},'comment':_0xd35b('0x11')},'dtmfmode':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x12'),_0xd35b('0x13'),_0xd35b('0x14'),_0xd35b('0x15'),_0xd35b('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no',_0xd35b('0x18'),'update',_0xd35b('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0xd35b('0x4')]},'nat':{'type':Sequelize[_0xd35b('0x4')],'defaultValue':'force_rport,comedia','set':function(_0xbf9f93){this['setDataValue']('nat',_0xbf9f93?_0xbf9f93['join'](','):null);},'get':function(){return this['getDataValue'](_0xd35b('0x1a'))?this[_0xd35b('0xf')](_0xd35b('0x1a'))[_0xd35b('0x10')](','):null;},'comment':_0xd35b('0x1b')},'callgroup':{'type':Sequelize[_0xd35b('0x4')]},'namedcallgroup':{'type':Sequelize[_0xd35b('0x4')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xd35b('0x4')]},'language':{'type':Sequelize[_0xd35b('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd35b('0x4')],'defaultValue':_0xd35b('0x1c')},'allow':{'type':Sequelize[_0xd35b('0x4')],'allowNull':![],'defaultValue':_0xd35b('0x1d'),'set':function(_0x9b4b87){this[_0xd35b('0xd')](_0xd35b('0x1e'),_0x9b4b87?_0x9b4b87[_0xd35b('0x1f')](';'):_0xd35b('0x1d'));},'get':function(){return this[_0xd35b('0xf')](_0xd35b('0x1e'))?this[_0xd35b('0xf')]('allow')[_0xd35b('0x10')](';'):null;},'comment':_0xd35b('0x20')},'autoframing':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no')},'insecure':{'type':Sequelize[_0xd35b('0x4')],'defaultValue':_0xd35b('0x21'),'set':function(_0x36aeb3){this[_0xd35b('0xd')]('insecure',_0x36aeb3?_0x36aeb3[_0xd35b('0x1f')](','):null);},'get':function(){return this['getDataValue'](_0xd35b('0x22'))?this[_0xd35b('0xf')](_0xd35b('0x22'))[_0xd35b('0x10')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xd35b('0x5')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd35b('0x5')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xd35b('0x17'),'no',_0xd35b('0x23'))},'promiscredir':{'type':Sequelize[_0xd35b('0x5')]('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0xd35b('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xd35b('0x4')],'defaultValue':_0xd35b('0x24')},'amaflags':{'type':Sequelize[_0xd35b('0x4')]},'callcounter':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no'),'defaultValue':_0xd35b('0x17')},'busylevel':{'type':Sequelize[_0xd35b('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0xd35b('0x5')]('yes','no')},'allowtransfer':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0xd35b('0x5')]('yes','no')},'subscribecontext':{'type':Sequelize[_0xd35b('0x4')]},'template':{'type':Sequelize[_0xd35b('0x4')]},'videosupport':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no',_0xd35b('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd35b('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no')},'mailbox':{'type':Sequelize[_0xd35b('0x4')]},'session_timers':{'type':Sequelize[_0xd35b('0x5')]('accept','refuse',_0xd35b('0x27'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xd35b('0x25')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xd35b('0x28'),_0xd35b('0x29')),'defaultValue':_0xd35b('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0xd35b('0x4')]},'regexten':{'type':Sequelize[_0xd35b('0x4')]},'fromdomain':{'type':Sequelize[_0xd35b('0x4')]},'fromuser':{'type':Sequelize[_0xd35b('0x4')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no'),'defaultValue':_0xd35b('0x17')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xd35b('0x4')]},'defaultuser':{'type':Sequelize[_0xd35b('0x4')]},'rtptimeout':{'type':Sequelize[_0xd35b('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd35b('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xd35b('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no',_0xd35b('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd35b('0x4')]},'callbackextension':{'type':Sequelize[_0xd35b('0x4')]},'timert1':{'type':Sequelize[_0xd35b('0x25')](0xb)},'timerb':{'type':Sequelize[_0xd35b('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xd35b('0x4')]},'contactdeny':{'type':Sequelize[_0xd35b('0x4')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xd35b('0x4')]},'use_q850_reason':{'type':Sequelize[_0xd35b('0x4')]},'maxforwards':{'type':Sequelize[_0xd35b('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd35b('0x5')]('yes','no')},'force_avp':{'type':Sequelize['ENUM'](_0xd35b('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xd35b('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no','fingerprint',_0xd35b('0x2b'))},'dtlsrekey':{'type':Sequelize[_0xd35b('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd35b('0x4')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xd35b('0x4')]},'dtlscafile':{'type':Sequelize[_0xd35b('0x4')]},'dtlscapath':{'type':Sequelize[_0xd35b('0x4')]},'dtlssetup':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x2c'),_0xd35b('0x2d'),_0xd35b('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd35b('0x4')]},'usereqphone':{'type':Sequelize[_0xd35b('0x5')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd35b('0x4')]},'recordofffeature':{'type':Sequelize[_0xd35b('0x4')]},'call_limit':{'type':Sequelize[_0xd35b('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no')},'vmexten':{'type':Sequelize[_0xd35b('0x4')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xd35b('0x4')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xd35b('0x2f')},'canreinvite':{'type':Sequelize[_0xd35b('0x5')](_0xd35b('0x17'),'no','nonat',_0xd35b('0x30'),_0xd35b('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xd35b('0x4')]},'active':{'type':Sequelize[_0xd35b('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x7fc6=['INTEGER','\x22\x22\x20<>','always','uac','uas','pai','active','passive','actpass','update,nonat','BOOLEAN','exports','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','nonat','update','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'];(function(_0xf912a,_0x533423){var _0x348f59=function(_0x2c1aa4){while(--_0x2c1aa4){_0xf912a['push'](_0xf912a['shift']());}};_0x348f59(++_0x533423);}(_0x7fc6,0xbf));var _0x67fc=function(_0x3b6761,_0x2623b4){_0x3b6761=_0x3b6761-0x0;var _0x2c6e13=_0x7fc6[_0x3b6761];return _0x2c6e13;};'use strict';var Sequelize=require('sequelize');module[_0x67fc('0x0')]={'name':{'type':Sequelize[_0x67fc('0x1')],'allowNull':![],'unique':_0x67fc('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x4'),'user',_0x67fc('0x5')),'allowNull':![],'defaultValue':_0x67fc('0x4')},'context':{'type':Sequelize[_0x67fc('0x1')],'allowNull':![],'defaultValue':_0x67fc('0x6')},'callingpres':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x7'),_0x67fc('0x8'),_0x67fc('0x9'),'ALLOWED',_0x67fc('0xa'),_0x67fc('0xb'),'PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0x67fc('0x1')]},'permit':{'type':Sequelize[_0x67fc('0x1')]},'secret':{'type':Sequelize[_0x67fc('0x1')]},'md5secret':{'type':Sequelize[_0x67fc('0x1')]},'remotesecret':{'type':Sequelize[_0x67fc('0x1')]},'transport':{'type':Sequelize[_0x67fc('0x1')],'defaultValue':_0x67fc('0xc'),'set':function(_0x54ef35){this[_0x67fc('0xd')]('transport',_0x54ef35?_0x54ef35[_0x67fc('0xe')](','):null);},'get':function(){return this[_0x67fc('0xf')]('transport')?this['getDataValue'](_0x67fc('0x10'))[_0x67fc('0x11')](','):null;},'comment':_0x67fc('0x12')},'dtmfmode':{'type':Sequelize[_0x67fc('0x3')]('rfc2833',_0x67fc('0x13'),_0x67fc('0x14'),_0x67fc('0x15'),'auto'),'defaultValue':_0x67fc('0x16')},'directmedia':{'type':Sequelize[_0x67fc('0x3')]('yes','no',_0x67fc('0x17'),_0x67fc('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x67fc('0x1')]},'nat':{'type':Sequelize[_0x67fc('0x1')],'defaultValue':_0x67fc('0x1a'),'set':function(_0x9bd293){this[_0x67fc('0xd')](_0x67fc('0x1b'),_0x9bd293?_0x9bd293['join'](','):null);},'get':function(){return this[_0x67fc('0xf')](_0x67fc('0x1b'))?this[_0x67fc('0xf')]('nat')[_0x67fc('0x11')](','):null;},'comment':_0x67fc('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x67fc('0x1')]},'pickupgroup':{'type':Sequelize[_0x67fc('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x67fc('0x1')]},'language':{'type':Sequelize[_0x67fc('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':'all'},'allow':{'type':Sequelize[_0x67fc('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1ba312){this['setDataValue'](_0x67fc('0x1d'),_0x1ba312?_0x1ba312[_0x67fc('0xe')](';'):_0x67fc('0x1e'));},'get':function(){return this['getDataValue']('allow')?this['getDataValue']('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no')},'insecure':{'type':Sequelize[_0x67fc('0x1')],'defaultValue':_0x67fc('0x1f'),'set':function(_0xe4e532){this[_0x67fc('0xd')](_0x67fc('0x20'),_0xe4e532?_0xe4e532[_0x67fc('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x67fc('0x20'))?this['getDataValue'](_0x67fc('0x20'))[_0x67fc('0x11')](','):null;},'comment':_0x67fc('0x21')},'trustrpid':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x67fc('0x19'),'no','never')},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x67fc('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0x67fc('0x22')](0xb)},'setvar':{'type':Sequelize[_0x67fc('0x1')]},'callerid':{'type':Sequelize[_0x67fc('0x1')],'defaultValue':_0x67fc('0x23')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no'),'defaultValue':_0x67fc('0x19')},'busylevel':{'type':Sequelize[_0x67fc('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0x67fc('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x67fc('0x1')]},'template':{'type':Sequelize[_0x67fc('0x1')]},'videosupport':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no',_0x67fc('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x67fc('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no')},'mailbox':{'type':Sequelize[_0x67fc('0x1')]},'session_timers':{'type':Sequelize[_0x67fc('0x3')]('accept','refuse','originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x67fc('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x25'),_0x67fc('0x26')),'defaultValue':_0x67fc('0x26')},'t38pt_usertpsource':{'type':Sequelize[_0x67fc('0x1')]},'regexten':{'type':Sequelize[_0x67fc('0x1')]},'fromdomain':{'type':Sequelize[_0x67fc('0x1')]},'fromuser':{'type':Sequelize[_0x67fc('0x1')]},'port':{'type':Sequelize[_0x67fc('0x22')](0x5)},'qualify':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x67fc('0x1')]},'defaultuser':{'type':Sequelize[_0x67fc('0x1')]},'rtptimeout':{'type':Sequelize[_0x67fc('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x67fc('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x67fc('0x19'),'no',_0x67fc('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x67fc('0x1')]},'timert1':{'type':Sequelize[_0x67fc('0x22')](0xb)},'timerb':{'type':Sequelize[_0x67fc('0x22')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x67fc('0x1')]},'contactdeny':{'type':Sequelize[_0x67fc('0x1')]},'contactacl':{'type':Sequelize[_0x67fc('0x1')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x67fc('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no')},'force_avp':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x67fc('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0x67fc('0x3')]('yes','no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0x67fc('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x67fc('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x67fc('0x1')]},'dtlscipher':{'type':Sequelize[_0x67fc('0x1')]},'dtlscafile':{'type':Sequelize[_0x67fc('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x28'),_0x67fc('0x29'),_0x67fc('0x2a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x67fc('0x1')]},'usereqphone':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x67fc('0x1')]},'recordofffeature':{'type':Sequelize[_0x67fc('0x1')]},'call_limit':{'type':Sequelize[_0x67fc('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x67fc('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0x67fc('0x3')](_0x67fc('0x19'),'no')},'vmexten':{'type':Sequelize[_0x67fc('0x1')]},'mohinterpret':{'type':Sequelize[_0x67fc('0x1')]},'mohsuggest':{'type':Sequelize[_0x67fc('0x1')]},'parkinglot':{'type':Sequelize[_0x67fc('0x1')]},'description':{'type':Sequelize[_0x67fc('0x1')]},'host':{'type':Sequelize[_0x67fc('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x67fc('0x3')]('yes','no',_0x67fc('0x17'),_0x67fc('0x18'),_0x67fc('0x2b')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x67fc('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x67fc('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x67fc('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index ab1d638..6896bfe 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 _0x1123=['index','Trunk','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','filter','count','includeAll','include','findAll','rows','catch','rawAttributes','length','options','clone','params','find','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','update','/etc/asterisk/sip_xcally_trunks.conf','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','ValidationError','request','info','request\x20sent','debug','stringify','error','code','Trunk,\x20%s,\x20%s','message','sendStatus','status','offset','limit','set','Content-Range','json','reject','save','then','destroy','Trunks','UserProfileResource','stack','name','send'];(function(_0x3afaf6,_0x3336a7){var _0x49d92c=function(_0x388064){while(--_0x388064){_0x3afaf6['push'](_0x3afaf6['shift']());}};_0x49d92c(++_0x3336a7);}(_0x1123,0x118));var _0x3112=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1123[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3112('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3112('0x1'));var rp=require(_0x3112('0x2'));var moment=require(_0x3112('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3112('0x4'));var path=require(_0x3112('0x5'));var sox=require(_0x3112('0x6'));var csv=require(_0x3112('0x7'));var ejs=require(_0x3112('0x8'));var fs=require('fs');var _=require(_0x3112('0x9'));var squel=require(_0x3112('0xa'));var crypto=require(_0x3112('0xb'));var jsforce=require(_0x3112('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3112('0x7'));var querystring=require(_0x3112('0xd'));var Papa=require(_0x3112('0xe'));var Redis=require(_0x3112('0xf'));var authService=require(_0x3112('0x10'));var qs=require(_0x3112('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3112('0x12'))(_0x3112('0x13'));var utils=require(_0x3112('0x14'));var config=require(_0x3112('0x15'));var db=require(_0x3112('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x3112('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x5f2e90,_0x410b6d,_0x1c82e0){if(_0x1c82e0){var _0x3e8e15=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e8e15['test'](_0x410b6d)){return _0x5f2e90;}else{throw new db['Sequelize'][(_0x3112('0x18'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5f2e90;}}function respondWithRpcPromise(_0x466d32,_0x576cde,_0x56b594,_0x43a554){return new BPromise(function(_0x868e4b,_0x5a6255){var _0x2351de=_0x43a554||client;return _0x2351de[_0x3112('0x19')](_0x466d32,_0x56b594)['then'](function(_0x51e6b0){logger[_0x3112('0x1a')]('Trunk,\x20%s,\x20%s',_0x576cde,_0x3112('0x1b'));logger[_0x3112('0x1c')]('Trunk,\x20%s,\x20%s,\x20%s',_0x576cde,'request\x20sent',JSON[_0x3112('0x1d')](_0x51e6b0));if(_0x51e6b0[_0x3112('0x1e')]){if(_0x51e6b0[_0x3112('0x1e')][_0x3112('0x1f')]===0x1f4){logger[_0x3112('0x1e')](_0x3112('0x20'),_0x576cde,_0x51e6b0['error'][_0x3112('0x21')]);return _0x5a6255(_0x51e6b0['error'][_0x3112('0x21')]);}logger[_0x3112('0x1e')](_0x3112('0x20'),_0x576cde,_0x51e6b0[_0x3112('0x1e')][_0x3112('0x21')]);return _0x868e4b(_0x51e6b0['error'][_0x3112('0x21')]);}else{logger['info'](_0x3112('0x20'),_0x576cde,'request\x20sent');_0x868e4b(_0x51e6b0['result'][_0x3112('0x21')]);}})['catch'](function(_0x9f194f){logger[_0x3112('0x1e')](_0x3112('0x20'),_0x576cde,_0x9f194f);_0x5a6255(_0x9f194f);});});}function respondWithStatusCode(_0x4d898d,_0x32d8f4){_0x32d8f4=_0x32d8f4||0xcc;return function(_0x41233d){if(_0x41233d){return _0x4d898d[_0x3112('0x22')](_0x32d8f4);}return _0x4d898d[_0x3112('0x23')](_0x32d8f4)['end']();};}function respondWithResult(_0x34ca6d,_0x1a8d96){_0x1a8d96=_0x1a8d96||0xc8;return function(_0x4b8fab){if(_0x4b8fab){return _0x34ca6d[_0x3112('0x23')](_0x1a8d96)['json'](_0x4b8fab);}};}function respondWithFilteredResult(_0x327a65,_0x143f23){return function(_0x44ef62){if(_0x44ef62){var _0x1dc056=_0x44ef62['count'],_0x20f457=_0x143f23[_0x3112('0x24')],_0x58e291=_0x143f23['offset']+_0x143f23[_0x3112('0x25')],_0x1d1e4a;if(_0x58e291>=_0x1dc056){_0x58e291=_0x1dc056;_0x1d1e4a=0xc8;}else{_0x1d1e4a=0xce;}_0x327a65[_0x3112('0x23')](_0x1d1e4a);return _0x327a65[_0x3112('0x26')](_0x3112('0x27'),_0x20f457+'-'+_0x58e291+'/'+_0x1dc056)[_0x3112('0x28')](_0x44ef62);}return null;};}function patchUpdates(_0x22b722){return function(_0x4f0086){try{jsonpatch['apply'](_0x4f0086,_0x22b722,!![]);}catch(_0x1915fc){return BPromise[_0x3112('0x29')](_0x1915fc);}return _0x4f0086[_0x3112('0x2a')]();};}function saveUpdates(_0x3c3f37,_0x8ef6d9){return function(_0x1e0c49){if(_0x1e0c49){return _0x1e0c49['update'](_0x3c3f37)[_0x3112('0x2b')](function(_0x447748){return _0x447748;});}return null;};}function removeEntity(_0x8c9c88,_0x54d6c2){return function(_0x56d58d){if(_0x56d58d){return _0x56d58d[_0x3112('0x2c')]()[_0x3112('0x2b')](function(){var _0x1e16d7=_0x56d58d['get']({'plain':!![]});var _0x35fb32=_0x3112('0x2d');return db[_0x3112('0x2e')]['destroy']({'where':{'type':_0x35fb32,'resourceId':_0x1e16d7['id']}})[_0x3112('0x2b')](function(){return _0x56d58d;});})[_0x3112('0x2b')](function(){_0x8c9c88['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c2b25,_0x1bcf55){return function(_0x4295c6){if(!_0x4295c6){_0x2c2b25['sendStatus'](0x194);}return _0x4295c6;};}function handleError(_0x157829,_0x321c6b){_0x321c6b=_0x321c6b||0x1f4;return function(_0xedfa82){logger[_0x3112('0x1e')](_0xedfa82[_0x3112('0x2f')]);if(_0xedfa82[_0x3112('0x30')]){delete _0xedfa82[_0x3112('0x30')];}_0x157829[_0x3112('0x23')](_0x321c6b)[_0x3112('0x31')](_0xedfa82);};}exports[_0x3112('0x32')]=function(_0x19f18c,_0x3a8f1b){var _0x47aa48={},_0x26e3bf={},_0x6b9d73={'count':0x0,'rows':[]};var _0x32764c=_['map'](db[_0x3112('0x33')]['rawAttributes'],function(_0x289b4c){return{'name':_0x289b4c[_0x3112('0x34')],'type':_0x289b4c[_0x3112('0x35')][_0x3112('0x36')]};});_0x26e3bf['model']=_[_0x3112('0x37')](_0x32764c,'name');_0x26e3bf[_0x3112('0x38')]=_[_0x3112('0x39')](_0x19f18c[_0x3112('0x38')]);_0x26e3bf['filters']=_[_0x3112('0x3a')](_0x26e3bf[_0x3112('0x3b')],_0x26e3bf[_0x3112('0x38')]);_0x47aa48['attributes']=_[_0x3112('0x3a')](_0x26e3bf[_0x3112('0x3b')],qs[_0x3112('0x3c')](_0x19f18c[_0x3112('0x38')][_0x3112('0x3c')]));_0x47aa48[_0x3112('0x3d')]=_0x47aa48[_0x3112('0x3d')]['length']?_0x47aa48[_0x3112('0x3d')]:_0x26e3bf[_0x3112('0x3b')];if(!_0x19f18c[_0x3112('0x38')][_0x3112('0x3e')](_0x3112('0x3f'))){_0x47aa48[_0x3112('0x25')]=qs['limit'](_0x19f18c['query'][_0x3112('0x25')]);_0x47aa48[_0x3112('0x24')]=qs[_0x3112('0x24')](_0x19f18c[_0x3112('0x38')][_0x3112('0x24')]);}_0x47aa48[_0x3112('0x40')]=qs['sort'](_0x19f18c[_0x3112('0x38')][_0x3112('0x41')]);_0x47aa48[_0x3112('0x42')]=qs[_0x3112('0x43')](_[_0x3112('0x44')](_0x19f18c[_0x3112('0x38')],_0x26e3bf[_0x3112('0x43')]),_0x32764c);if(_0x19f18c[_0x3112('0x38')]['filter']){_0x47aa48[_0x3112('0x42')]=_[_0x3112('0x45')](_0x47aa48['where'],{'$or':_[_0x3112('0x37')](_0x32764c,function(_0x5661ba){if(_0x5661ba[_0x3112('0x35')]!=='VIRTUAL'){var _0x56fde0={};_0x56fde0[_0x5661ba[_0x3112('0x30')]]={'$like':'%'+_0x19f18c['query'][_0x3112('0x46')]+'%'};return _0x56fde0;}})});}_0x47aa48=_[_0x3112('0x45')]({},_0x47aa48,_0x19f18c['options']);var _0x169133={'where':_0x47aa48[_0x3112('0x42')]};return db['Trunk']['count'](_0x169133)[_0x3112('0x2b')](function(_0x5cd27d){_0x6b9d73[_0x3112('0x47')]=_0x5cd27d;if(_0x19f18c['query'][_0x3112('0x48')]){_0x47aa48[_0x3112('0x49')]=[{'all':!![]}];}return db['Trunk'][_0x3112('0x4a')](_0x47aa48);})['then'](function(_0x2f8d76){_0x6b9d73[_0x3112('0x4b')]=_0x2f8d76;return _0x6b9d73;})[_0x3112('0x2b')](respondWithFilteredResult(_0x3a8f1b,_0x47aa48))[_0x3112('0x4c')](handleError(_0x3a8f1b,null));};exports['show']=function(_0x51a4d0,_0x2d9b90){var _0xf4e795={'raw':![],'where':{'id':_0x51a4d0['params']['id']}},_0x1bd697={};_0x1bd697[_0x3112('0x3b')]=_[_0x3112('0x39')](db[_0x3112('0x33')][_0x3112('0x4d')]);_0x1bd697['query']=_[_0x3112('0x39')](_0x51a4d0[_0x3112('0x38')]);_0x1bd697[_0x3112('0x43')]=_[_0x3112('0x3a')](_0x1bd697[_0x3112('0x3b')],_0x1bd697[_0x3112('0x38')]);_0xf4e795[_0x3112('0x3d')]=_[_0x3112('0x3a')](_0x1bd697['model'],qs[_0x3112('0x3c')](_0x51a4d0[_0x3112('0x38')]['fields']));_0xf4e795[_0x3112('0x3d')]=_0xf4e795[_0x3112('0x3d')][_0x3112('0x4e')]?_0xf4e795[_0x3112('0x3d')]:_0x1bd697['model'];if(_0x51a4d0['query'][_0x3112('0x48')]){_0xf4e795[_0x3112('0x49')]=[{'all':!![]}];}_0xf4e795=_[_0x3112('0x45')]({},_0xf4e795,_0x51a4d0[_0x3112('0x4f')]);return db[_0x3112('0x33')]['find'](_0xf4e795)[_0x3112('0x2b')](handleEntityNotFound(_0x2d9b90,null))[_0x3112('0x2b')](respondWithResult(_0x2d9b90,null))[_0x3112('0x4c')](handleError(_0x2d9b90,null));};exports[_0x3112('0x50')]=function(_0x43be25,_0x3a65e7){var _0x5897ff={'where':{'id':_0x43be25[_0x3112('0x51')]['id']}},_0x595c9c={};_0x595c9c[_0x3112('0x3b')]=_[_0x3112('0x39')](db[_0x3112('0x33')]['rawAttributes']);_0x5897ff[_0x3112('0x3d')]=_[_0x3112('0x3a')](_0x595c9c[_0x3112('0x3b')],qs['fields'](_0x43be25['query'][_0x3112('0x3c')]));_0x5897ff['attributes']=_0x5897ff[_0x3112('0x3d')]['length']?_0x5897ff[_0x3112('0x3d')]:_0x595c9c[_0x3112('0x3b')];if(_0x43be25['query'][_0x3112('0x48')]){_0x5897ff[_0x3112('0x49')]=[{'all':!![]}];}_0x5897ff=_[_0x3112('0x45')]({},_0x5897ff,_0x43be25['options']);return db['Trunk'][_0x3112('0x52')](_0x5897ff)['then'](handleEntityNotFound(_0x3a65e7,null))[_0x3112('0x2b')](function(_0x3498ac){if(_0x3498ac){var _0x1c1a4a=_0x3498ac['get']({'plain':!![]});_0x1c1a4a=qs[_0x3112('0x53')](_0x1c1a4a,['id',_0x3112('0x54'),_0x3112('0x55')]);_0x43be25['body']=_[_0x3112('0x53')](_0x43be25[_0x3112('0x56')],['id',_0x3112('0x54'),'updatedAt']);return db[_0x3112('0x33')][_0x3112('0x57')](_[_0x3112('0x45')](_0x1c1a4a,_0x43be25[_0x3112('0x56')]),{'include':_0x43be25[_0x3112('0x38')][_0x3112('0x48')]?[{'all':!![]}]:undefined})[_0x3112('0x2b')](function(_0x4349df){var _0x3e63d8=_0x43be25[_0x3112('0x58')]['get']({'plain':!![]});if(!_0x3e63d8)throw new Error(_0x3112('0x59'));if(_0x3e63d8[_0x3112('0x5a')]===_0x3112('0x58')){var _0x1b88e8=_0x4349df[_0x3112('0x5b')]({'plain':!![]});var _0x4b413e=_0x3112('0x2d');return db['UserProfileSection']['find']({'where':{'name':_0x4b413e,'userProfileId':_0x3e63d8[_0x3112('0x5c')]},'raw':!![]})[_0x3112('0x2b')](function(_0x3c89ee){if(_0x3c89ee&&_0x3c89ee[_0x3112('0x5d')]===0x0){return db[_0x3112('0x2e')][_0x3112('0x57')]({'name':_0x1b88e8['name'],'resourceId':_0x1b88e8['id'],'type':_0x3c89ee[_0x3112('0x30')],'sectionId':_0x3c89ee['id']},{})[_0x3112('0x2b')](function(){return _0x4349df;});}else{return _0x4349df;}})[_0x3112('0x4c')](function(_0x902a04){logger[_0x3112('0x1e')](_0x3112('0x5e'),_0x902a04);throw _0x902a04;});}return _0x4349df;});}})[_0x3112('0x2b')](respondWithResult(_0x3a65e7,0xc9))['catch'](handleError(_0x3a65e7,null));};exports[_0x3112('0x57')]=function(_0x13efb2,_0x3b6c6c,_0x1758d0){var _0x250670;return db['Trunk'][_0x3112('0x57')](_0x13efb2[_0x3112('0x56')],{'raw':!![]})['then'](function(_0x3483a1){_0x250670=_0x3483a1;return db[_0x3112('0x33')][_0x3112('0x4a')]({'raw':!![]});})[_0x3112('0x2b')](function(_0x2fcf98){var _0x441a62=fs['readFileSync'](path[_0x3112('0x5f')](config[_0x3112('0x60')],_0x3112('0x61')),'utf8');var _0x6a60d2=fs[_0x3112('0x62')](path[_0x3112('0x5f')](config['root'],_0x3112('0x63')),_0x3112('0x64'));var _0x2cc06f=ejs[_0x3112('0x65')](_0x441a62,{'trunks':_0x2fcf98||[]});fs[_0x3112('0x66')]('/etc/asterisk/sip_xcally_trunks.conf',_0x2cc06f);if(_0x250670[_0x3112('0x67')]){var _0x5037b6=ejs[_0x3112('0x65')](_0x6a60d2,{'trunks':_0x2fcf98||[]});fs['writeFileSync'](_0x3112('0x68'),_0x5037b6);}})['then'](function(){return respondWithRpcPromise(_0x3112('0x69'),'create',{'module':_0x3112('0x6a')});})['then'](function(){var _0x174576=_0x13efb2[_0x3112('0x58')][_0x3112('0x5b')]({'plain':!![]});if(!_0x174576)throw new Error(_0x3112('0x59'));if(_0x174576['role']===_0x3112('0x58')){var _0x454fec=_0x250670['get']({'plain':!![]});return db[_0x3112('0x6b')][_0x3112('0x52')]({'where':{'name':'Trunks','userProfileId':_0x174576[_0x3112('0x5c')]},'raw':!![]})['then'](function(_0x104d09){if(_0x104d09&&_0x104d09[_0x3112('0x5d')]===0x0){return db[_0x3112('0x2e')][_0x3112('0x57')]({'name':_0x454fec['name'],'resourceId':_0x454fec['id'],'type':_0x104d09['name'],'sectionId':_0x104d09['id']},{})['then'](function(){return _0x250670;});}else{return _0x250670;}})['catch'](function(_0x3d1e19){logger[_0x3112('0x1e')](_0x3112('0x5e'),_0x3d1e19);throw _0x3d1e19;});}return _0x250670;})[_0x3112('0x2b')](respondWithResult(_0x3b6c6c,0xc9))[_0x3112('0x4c')](handleError(_0x3b6c6c,null));};exports[_0x3112('0x6c')]=function(_0x33a4a6,_0x30f552,_0x48474a){var _0x1c3c3e;return db['Trunk'][_0x3112('0x52')]({'where':{'id':_0x33a4a6[_0x3112('0x51')]['id']}})['then'](handleEntityNotFound(_0x30f552,null))[_0x3112('0x2b')](saveUpdates(_0x33a4a6[_0x3112('0x56')],null))[_0x3112('0x2b')](function(_0x2aca76){if(_0x2aca76){_0x1c3c3e=_0x2aca76;return db[_0x3112('0x33')][_0x3112('0x4a')]({'raw':!![]});}})[_0x3112('0x2b')](function(_0x175d73){if(_0x175d73){var _0x4dfa60=fs[_0x3112('0x62')](path[_0x3112('0x5f')](config[_0x3112('0x60')],_0x3112('0x61')),_0x3112('0x64'));var _0x4ed0d5=fs[_0x3112('0x62')](path[_0x3112('0x5f')](config[_0x3112('0x60')],_0x3112('0x63')),_0x3112('0x64'));var _0x2a1652=ejs[_0x3112('0x65')](_0x4dfa60,{'trunks':_0x175d73||[]});fs[_0x3112('0x66')](_0x3112('0x6d'),_0x2a1652);var _0x15c9b6=ejs[_0x3112('0x65')](_0x4ed0d5,{'trunks':_0x175d73||[]});fs[_0x3112('0x66')](_0x3112('0x68'),_0x15c9b6);return respondWithRpcPromise('Reload',_0x3112('0x6c'),{'module':_0x3112('0x6a')});}return null;})['then'](function(_0x60094c){if(_0x60094c){return _0x1c3c3e;}})[_0x3112('0x2b')](respondWithResult(_0x30f552,null))[_0x3112('0x4c')](handleError(_0x30f552,null));};exports[_0x3112('0x2c')]=function(_0x2daaa2,_0x23acf2,_0x1dc5d2){var _0x151496;return db['Trunk'][_0x3112('0x52')]({'where':{'id':_0x2daaa2[_0x3112('0x51')]['id']}})[_0x3112('0x2b')](handleEntityNotFound(_0x23acf2,null))[_0x3112('0x2b')](removeEntity(_0x23acf2,null))[_0x3112('0x2b')](function(){return db[_0x3112('0x33')][_0x3112('0x4a')]({'raw':!![]});})[_0x3112('0x2b')](function(_0x3016d3){var _0xa4d03b=fs[_0x3112('0x62')](path[_0x3112('0x5f')](config[_0x3112('0x60')],_0x3112('0x61')),'utf8');var _0x481755=fs[_0x3112('0x62')](path[_0x3112('0x5f')](config[_0x3112('0x60')],_0x3112('0x63')),_0x3112('0x64'));var _0x117eb5=ejs[_0x3112('0x65')](_0xa4d03b,{'trunks':_0x3016d3});var _0x431ae6=ejs[_0x3112('0x65')](_0x481755,{'trunks':_0x3016d3});fs['writeFileSync'](_0x3112('0x6d'),_0x117eb5);fs['writeFileSync'](_0x3112('0x68'),_0x431ae6);return respondWithRpcPromise(_0x3112('0x69'),'destroy',{'module':_0x3112('0x6a')});})[_0x3112('0x4c')](handleError(_0x23acf2,null));}; \ No newline at end of file +var _0x37e9=['merge','find','get','createdAt','updatedAt','body','omit','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','jayson/promise','client','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~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Trunk,\x20%s,\x20%s','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','Trunks','UserProfileResource','destroy','stack','name','index','Trunk','rawAttributes','fieldName','type','key','map','keys','filters','intersection','query','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','includeAll','include','findAll','rows','params','options','clone'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x37e9,0x1e7));var _0x937e=function(_0x424a64,_0x25d88b){_0x424a64=_0x424a64-0x0;var _0x1c8408=_0x37e9[_0x424a64];return _0x1c8408;};'use strict';var pdf=require(_0x937e('0x0'));var emlformat=require(_0x937e('0x1'));var rimraf=require(_0x937e('0x2'));var zipdir=require(_0x937e('0x3'));var jsonpatch=require(_0x937e('0x4'));var rp=require(_0x937e('0x5'));var moment=require(_0x937e('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x937e('0x7'));var util=require(_0x937e('0x8'));var path=require(_0x937e('0x9'));var sox=require(_0x937e('0xa'));var csv=require(_0x937e('0xb'));var ejs=require(_0x937e('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x937e('0xd'));var crypto=require(_0x937e('0xe'));var jsforce=require(_0x937e('0xf'));var deskjs=require(_0x937e('0x10'));var toCsv=require(_0x937e('0xb'));var querystring=require(_0x937e('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x937e('0x12'));var qs=require(_0x937e('0x13'));var as=require(_0x937e('0x14'));var hardwareService=require(_0x937e('0x15'));var logger=require(_0x937e('0x16'))(_0x937e('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x937e('0x18'));var client=jayson[_0x937e('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x216c24,_0x31f851,_0x99e9bc){if(_0x99e9bc){var _0x1a0dc9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a0dc9['test'](_0x31f851)){return _0x216c24;}else{throw new db[(_0x937e('0x1a'))][(_0x937e('0x1b'))](_0x937e('0x1c'));}}else{return _0x216c24;}}function respondWithRpcPromise(_0x363b22,_0x5ab042,_0x2ebfdd,_0x3b09ff){return new BPromise(function(_0x4499a2,_0xb22a10){var _0x2f542a=_0x3b09ff||client;return _0x2f542a[_0x937e('0x1d')](_0x363b22,_0x2ebfdd)[_0x937e('0x1e')](function(_0x16682c){logger['info']('Trunk,\x20%s,\x20%s',_0x5ab042,_0x937e('0x1f'));logger[_0x937e('0x20')](_0x937e('0x21'),_0x5ab042,_0x937e('0x1f'),JSON[_0x937e('0x22')](_0x16682c));if(_0x16682c[_0x937e('0x23')]){if(_0x16682c[_0x937e('0x23')][_0x937e('0x24')]===0x1f4){logger[_0x937e('0x23')]('Trunk,\x20%s,\x20%s',_0x5ab042,_0x16682c[_0x937e('0x23')][_0x937e('0x25')]);return _0xb22a10(_0x16682c['error']['message']);}logger[_0x937e('0x23')](_0x937e('0x26'),_0x5ab042,_0x16682c['error'][_0x937e('0x25')]);return _0x4499a2(_0x16682c['error'][_0x937e('0x25')]);}else{logger[_0x937e('0x27')](_0x937e('0x26'),_0x5ab042,_0x937e('0x1f'));_0x4499a2(_0x16682c[_0x937e('0x28')]['message']);}})[_0x937e('0x29')](function(_0x1d5514){logger[_0x937e('0x23')](_0x937e('0x26'),_0x5ab042,_0x1d5514);_0xb22a10(_0x1d5514);});});}function respondWithStatusCode(_0x41ab49,_0x42d4da){_0x42d4da=_0x42d4da||0xcc;return function(_0x486eaa){if(_0x486eaa){return _0x41ab49[_0x937e('0x2a')](_0x42d4da);}return _0x41ab49[_0x937e('0x2b')](_0x42d4da)[_0x937e('0x2c')]();};}function respondWithResult(_0x41ea93,_0x5297b1){_0x5297b1=_0x5297b1||0xc8;return function(_0x181759){if(_0x181759){return _0x41ea93[_0x937e('0x2b')](_0x5297b1)[_0x937e('0x2d')](_0x181759);}};}function respondWithFilteredResult(_0x3db336,_0x303776){return function(_0x4a3cd2){if(_0x4a3cd2){var _0x222078=_0x4a3cd2[_0x937e('0x2e')],_0x380999=_0x303776[_0x937e('0x2f')],_0x518ebd=_0x303776['offset']+_0x303776[_0x937e('0x30')],_0x8ec885;if(_0x518ebd>=_0x222078){_0x518ebd=_0x222078;_0x8ec885=0xc8;}else{_0x8ec885=0xce;}_0x3db336[_0x937e('0x2b')](_0x8ec885);return _0x3db336[_0x937e('0x31')](_0x937e('0x32'),_0x380999+'-'+_0x518ebd+'/'+_0x222078)[_0x937e('0x2d')](_0x4a3cd2);}return null;};}function patchUpdates(_0x1ee0a4){return function(_0x26d930){try{jsonpatch[_0x937e('0x33')](_0x26d930,_0x1ee0a4,!![]);}catch(_0x2441a8){return BPromise[_0x937e('0x34')](_0x2441a8);}return _0x26d930[_0x937e('0x35')]();};}function saveUpdates(_0x137518,_0x3f6c30){return function(_0x3a9755){if(_0x3a9755){return _0x3a9755[_0x937e('0x36')](_0x137518)[_0x937e('0x1e')](function(_0x5edde4){return _0x5edde4;});}return null;};}function removeEntity(_0x35f1e4,_0x405605){return function(_0x4813a9){if(_0x4813a9){return _0x4813a9['destroy']()[_0x937e('0x1e')](function(){var _0x28ccbe=_0x4813a9['get']({'plain':!![]});var _0x5add88=_0x937e('0x37');return db[_0x937e('0x38')][_0x937e('0x39')]({'where':{'type':_0x5add88,'resourceId':_0x28ccbe['id']}})[_0x937e('0x1e')](function(){return _0x4813a9;});})[_0x937e('0x1e')](function(){_0x35f1e4[_0x937e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3056f7,_0x1745be){return function(_0x5b404d){if(!_0x5b404d){_0x3056f7[_0x937e('0x2a')](0x194);}return _0x5b404d;};}function handleError(_0x1c1b5e,_0x3c9e47){_0x3c9e47=_0x3c9e47||0x1f4;return function(_0x1dec89){logger[_0x937e('0x23')](_0x1dec89[_0x937e('0x3a')]);if(_0x1dec89['name']){delete _0x1dec89[_0x937e('0x3b')];}_0x1c1b5e[_0x937e('0x2b')](_0x3c9e47)['send'](_0x1dec89);};}exports[_0x937e('0x3c')]=function(_0x23b96f,_0x1fdc67){var _0x424097={},_0x306cb2={},_0x22f577={'count':0x0,'rows':[]};var _0x87ba22=_['map'](db[_0x937e('0x3d')][_0x937e('0x3e')],function(_0x442c76){return{'name':_0x442c76[_0x937e('0x3f')],'type':_0x442c76[_0x937e('0x40')][_0x937e('0x41')]};});_0x306cb2['model']=_[_0x937e('0x42')](_0x87ba22,_0x937e('0x3b'));_0x306cb2['query']=_[_0x937e('0x43')](_0x23b96f['query']);_0x306cb2[_0x937e('0x44')]=_[_0x937e('0x45')](_0x306cb2['model'],_0x306cb2[_0x937e('0x46')]);_0x424097[_0x937e('0x47')]=_['intersection'](_0x306cb2['model'],qs[_0x937e('0x48')](_0x23b96f[_0x937e('0x46')][_0x937e('0x48')]));_0x424097['attributes']=_0x424097[_0x937e('0x47')][_0x937e('0x49')]?_0x424097[_0x937e('0x47')]:_0x306cb2[_0x937e('0x4a')];if(!_0x23b96f[_0x937e('0x46')][_0x937e('0x4b')](_0x937e('0x4c'))){_0x424097[_0x937e('0x30')]=qs['limit'](_0x23b96f[_0x937e('0x46')][_0x937e('0x30')]);_0x424097[_0x937e('0x2f')]=qs[_0x937e('0x2f')](_0x23b96f[_0x937e('0x46')][_0x937e('0x2f')]);}_0x424097['order']=qs[_0x937e('0x4d')](_0x23b96f[_0x937e('0x46')]['sort']);_0x424097[_0x937e('0x4e')]=qs[_0x937e('0x44')](_[_0x937e('0x4f')](_0x23b96f[_0x937e('0x46')],_0x306cb2['filters']),_0x87ba22);if(_0x23b96f[_0x937e('0x46')][_0x937e('0x50')]){_0x424097[_0x937e('0x4e')]=_['merge'](_0x424097[_0x937e('0x4e')],{'$or':_['map'](_0x87ba22,function(_0x2505c5){if(_0x2505c5[_0x937e('0x40')]!=='VIRTUAL'){var _0xa17812={};_0xa17812[_0x2505c5[_0x937e('0x3b')]]={'$like':'%'+_0x23b96f[_0x937e('0x46')][_0x937e('0x50')]+'%'};return _0xa17812;}})});}_0x424097=_['merge']({},_0x424097,_0x23b96f['options']);var _0x5bb8f3={'where':_0x424097['where']};return db[_0x937e('0x3d')][_0x937e('0x2e')](_0x5bb8f3)[_0x937e('0x1e')](function(_0x36ab78){_0x22f577['count']=_0x36ab78;if(_0x23b96f[_0x937e('0x46')][_0x937e('0x51')]){_0x424097[_0x937e('0x52')]=[{'all':!![]}];}return db[_0x937e('0x3d')][_0x937e('0x53')](_0x424097);})[_0x937e('0x1e')](function(_0x274003){_0x22f577[_0x937e('0x54')]=_0x274003;return _0x22f577;})[_0x937e('0x1e')](respondWithFilteredResult(_0x1fdc67,_0x424097))[_0x937e('0x29')](handleError(_0x1fdc67,null));};exports['show']=function(_0x1c22aa,_0x570afb){var _0x131b1a={'raw':![],'where':{'id':_0x1c22aa[_0x937e('0x55')]['id']}},_0x1c1f5c={};_0x1c1f5c[_0x937e('0x4a')]=_['keys'](db['Trunk']['rawAttributes']);_0x1c1f5c[_0x937e('0x46')]=_[_0x937e('0x43')](_0x1c22aa[_0x937e('0x46')]);_0x1c1f5c[_0x937e('0x44')]=_[_0x937e('0x45')](_0x1c1f5c[_0x937e('0x4a')],_0x1c1f5c[_0x937e('0x46')]);_0x131b1a[_0x937e('0x47')]=_[_0x937e('0x45')](_0x1c1f5c[_0x937e('0x4a')],qs[_0x937e('0x48')](_0x1c22aa[_0x937e('0x46')]['fields']));_0x131b1a['attributes']=_0x131b1a[_0x937e('0x47')]['length']?_0x131b1a[_0x937e('0x47')]:_0x1c1f5c[_0x937e('0x4a')];if(_0x1c22aa[_0x937e('0x46')]['includeAll']){_0x131b1a[_0x937e('0x52')]=[{'all':!![]}];}_0x131b1a=_['merge']({},_0x131b1a,_0x1c22aa[_0x937e('0x56')]);return db[_0x937e('0x3d')]['find'](_0x131b1a)[_0x937e('0x1e')](handleEntityNotFound(_0x570afb,null))[_0x937e('0x1e')](respondWithResult(_0x570afb,null))[_0x937e('0x29')](handleError(_0x570afb,null));};exports[_0x937e('0x57')]=function(_0x1d6056,_0x3cbfd0){var _0x580824={'where':{'id':_0x1d6056['params']['id']}},_0x201620={};_0x201620[_0x937e('0x4a')]=_[_0x937e('0x43')](db[_0x937e('0x3d')][_0x937e('0x3e')]);_0x580824[_0x937e('0x47')]=_[_0x937e('0x45')](_0x201620[_0x937e('0x4a')],qs[_0x937e('0x48')](_0x1d6056[_0x937e('0x46')]['fields']));_0x580824[_0x937e('0x47')]=_0x580824[_0x937e('0x47')][_0x937e('0x49')]?_0x580824['attributes']:_0x201620[_0x937e('0x4a')];if(_0x1d6056[_0x937e('0x46')][_0x937e('0x51')]){_0x580824[_0x937e('0x52')]=[{'all':!![]}];}_0x580824=_[_0x937e('0x58')]({},_0x580824,_0x1d6056[_0x937e('0x56')]);return db[_0x937e('0x3d')][_0x937e('0x59')](_0x580824)[_0x937e('0x1e')](handleEntityNotFound(_0x3cbfd0,null))[_0x937e('0x1e')](function(_0x41b5d8){if(_0x41b5d8){var _0x4699a2=_0x41b5d8[_0x937e('0x5a')]({'plain':!![]});_0x4699a2=qs['omit'](_0x4699a2,['id',_0x937e('0x5b'),_0x937e('0x5c')]);_0x1d6056[_0x937e('0x5d')]=_[_0x937e('0x5e')](_0x1d6056[_0x937e('0x5d')],['id',_0x937e('0x5b'),_0x937e('0x5c')]);return db['Trunk'][_0x937e('0x5f')](_[_0x937e('0x58')](_0x4699a2,_0x1d6056[_0x937e('0x5d')]),{'include':_0x1d6056[_0x937e('0x46')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x42e3b6){var _0x3f9f6b=_0x1d6056[_0x937e('0x60')]['get']({'plain':!![]});if(!_0x3f9f6b)throw new Error(_0x937e('0x61'));if(_0x3f9f6b[_0x937e('0x62')]===_0x937e('0x60')){var _0x5a3db0=_0x42e3b6[_0x937e('0x5a')]({'plain':!![]});var _0x49fd54=_0x937e('0x37');return db[_0x937e('0x63')][_0x937e('0x59')]({'where':{'name':_0x49fd54,'userProfileId':_0x3f9f6b[_0x937e('0x64')]},'raw':!![]})['then'](function(_0x24e6de){if(_0x24e6de&&_0x24e6de[_0x937e('0x65')]===0x0){return db[_0x937e('0x38')][_0x937e('0x5f')]({'name':_0x5a3db0['name'],'resourceId':_0x5a3db0['id'],'type':_0x24e6de[_0x937e('0x3b')],'sectionId':_0x24e6de['id']},{})[_0x937e('0x1e')](function(){return _0x42e3b6;});}else{return _0x42e3b6;}})[_0x937e('0x29')](function(_0x23a874){logger[_0x937e('0x23')](_0x937e('0x66'),_0x23a874);throw _0x23a874;});}return _0x42e3b6;});}})['then'](respondWithResult(_0x3cbfd0,0xc9))[_0x937e('0x29')](handleError(_0x3cbfd0,null));};exports['create']=function(_0x2b0b42,_0x2031d3,_0x50f615){var _0xf957fe;return db[_0x937e('0x3d')]['create'](_0x2b0b42[_0x937e('0x5d')],{'raw':!![]})[_0x937e('0x1e')](function(_0x55f85e){_0xf957fe=_0x55f85e;return db[_0x937e('0x3d')][_0x937e('0x53')]({'raw':!![]});})[_0x937e('0x1e')](function(_0x38710d){var _0x244c0b=fs[_0x937e('0x67')](path[_0x937e('0x68')](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x333951=fs[_0x937e('0x67')](path[_0x937e('0x68')](config[_0x937e('0x69')],'server/files/templates/registry.ejs'),'utf8');var _0x1da6a5=ejs[_0x937e('0x6a')](_0x244c0b,{'trunks':_0x38710d||[]});fs[_0x937e('0x6b')](_0x937e('0x6c'),_0x1da6a5);if(_0xf957fe['registry']){var _0x4f9e11=ejs['render'](_0x333951,{'trunks':_0x38710d||[]});fs[_0x937e('0x6b')](_0x937e('0x6d'),_0x4f9e11);}})[_0x937e('0x1e')](function(){return respondWithRpcPromise(_0x937e('0x6e'),'create',{'module':_0x937e('0x6f')});})[_0x937e('0x1e')](function(){var _0x45108d=_0x2b0b42[_0x937e('0x60')][_0x937e('0x5a')]({'plain':!![]});if(!_0x45108d)throw new Error(_0x937e('0x61'));if(_0x45108d[_0x937e('0x62')]===_0x937e('0x60')){var _0x49b0aa=_0xf957fe['get']({'plain':!![]});return db[_0x937e('0x63')][_0x937e('0x59')]({'where':{'name':_0x937e('0x37'),'userProfileId':_0x45108d[_0x937e('0x64')]},'raw':!![]})[_0x937e('0x1e')](function(_0x36eccb){if(_0x36eccb&&_0x36eccb[_0x937e('0x65')]===0x0){return db[_0x937e('0x38')][_0x937e('0x5f')]({'name':_0x49b0aa[_0x937e('0x3b')],'resourceId':_0x49b0aa['id'],'type':_0x36eccb['name'],'sectionId':_0x36eccb['id']},{})['then'](function(){return _0xf957fe;});}else{return _0xf957fe;}})['catch'](function(_0x2455d7){logger['error'](_0x937e('0x66'),_0x2455d7);throw _0x2455d7;});}return _0xf957fe;})[_0x937e('0x1e')](respondWithResult(_0x2031d3,0xc9))['catch'](handleError(_0x2031d3,null));};exports['update']=function(_0x20c64a,_0x3d21fd,_0xe36b29){var _0x208a6a;return db[_0x937e('0x3d')][_0x937e('0x59')]({'where':{'id':_0x20c64a[_0x937e('0x55')]['id']}})[_0x937e('0x1e')](handleEntityNotFound(_0x3d21fd,null))[_0x937e('0x1e')](saveUpdates(_0x20c64a[_0x937e('0x5d')],null))[_0x937e('0x1e')](function(_0x35b4b6){if(_0x35b4b6){_0x208a6a=_0x35b4b6;return db['Trunk']['findAll']({'raw':!![]});}})[_0x937e('0x1e')](function(_0xa87b1b){if(_0xa87b1b){var _0x53778d=fs['readFileSync'](path[_0x937e('0x68')](config['root'],_0x937e('0x70')),_0x937e('0x71'));var _0xd1e414=fs['readFileSync'](path[_0x937e('0x68')](config[_0x937e('0x69')],_0x937e('0x72')),'utf8');var _0x10c8c4=ejs[_0x937e('0x6a')](_0x53778d,{'trunks':_0xa87b1b||[]});fs[_0x937e('0x6b')](_0x937e('0x6c'),_0x10c8c4);var _0x1d133c=ejs[_0x937e('0x6a')](_0xd1e414,{'trunks':_0xa87b1b||[]});fs['writeFileSync'](_0x937e('0x6d'),_0x1d133c);return respondWithRpcPromise('Reload',_0x937e('0x36'),{'module':_0x937e('0x6f')});}return null;})[_0x937e('0x1e')](function(_0xf94d5a){if(_0xf94d5a){return _0x208a6a;}})['then'](respondWithResult(_0x3d21fd,null))[_0x937e('0x29')](handleError(_0x3d21fd,null));};exports[_0x937e('0x39')]=function(_0x191792,_0x41163e,_0x184e0b){var _0x2f60cd;return db[_0x937e('0x3d')][_0x937e('0x59')]({'where':{'id':_0x191792[_0x937e('0x55')]['id']}})[_0x937e('0x1e')](handleEntityNotFound(_0x41163e,null))['then'](removeEntity(_0x41163e,null))[_0x937e('0x1e')](function(){return db['Trunk'][_0x937e('0x53')]({'raw':!![]});})[_0x937e('0x1e')](function(_0x278656){var _0x2d7c0a=fs['readFileSync'](path[_0x937e('0x68')](config[_0x937e('0x69')],_0x937e('0x70')),_0x937e('0x71'));var _0x503065=fs[_0x937e('0x67')](path[_0x937e('0x68')](config[_0x937e('0x69')],'server/files/templates/registry.ejs'),_0x937e('0x71'));var _0xec848e=ejs[_0x937e('0x6a')](_0x2d7c0a,{'trunks':_0x278656});var _0x4dd2b8=ejs[_0x937e('0x6a')](_0x503065,{'trunks':_0x278656});fs[_0x937e('0x6b')](_0x937e('0x6c'),_0xec848e);fs[_0x937e('0x6b')](_0x937e('0x6d'),_0x4dd2b8);return respondWithRpcPromise('Reload',_0x937e('0x39'),{'module':_0x937e('0x6f')});})[_0x937e('0x29')](handleError(_0x41163e,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index eb766ae..08287ad 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 _0x9ef3=['request-promise','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','api','moment','bluebird'];(function(_0x401609,_0x5eb61d){var _0x35fd57=function(_0x5dcddd){while(--_0x5dcddd){_0x401609['push'](_0x401609['shift']());}};_0x35fd57(++_0x5eb61d);}(_0x9ef3,0x1dc));var _0x39ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ef3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x39ef('0x0'));var util=require(_0x39ef('0x1'));var logger=require('../../config/logger')(_0x39ef('0x2'));var moment=require(_0x39ef('0x3'));var BPromise=require(_0x39ef('0x4'));var rp=require(_0x39ef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39ef('0x6'));var config=require(_0x39ef('0x7'));var attributes=require(_0x39ef('0x8'));module[_0x39ef('0x9')]=function(_0x480405,_0x1b6f08){return _0x480405[_0x39ef('0xa')](_0x39ef('0xb'),attributes,{'tableName':_0x39ef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4eca=['moment','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger'];(function(_0x4aa4e6,_0x278c45){var _0x322588=function(_0x19279d){while(--_0x19279d){_0x4aa4e6['push'](_0x4aa4e6['shift']());}};_0x322588(++_0x278c45);}(_0x4eca,0x1b9));var _0xa4ec=function(_0x398da7,_0x3f9f81){_0x398da7=_0x398da7-0x0;var _0x2ddf51=_0x4eca[_0x398da7];return _0x2ddf51;};'use strict';var _=require(_0xa4ec('0x0'));var util=require(_0xa4ec('0x1'));var logger=require(_0xa4ec('0x2'))('api');var moment=require(_0xa4ec('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa4ec('0x4'));var rimraf=require(_0xa4ec('0x5'));var config=require(_0xa4ec('0x6'));var attributes=require(_0xa4ec('0x7'));module[_0xa4ec('0x8')]=function(_0xfa3881,_0x23590c){return _0xfa3881[_0xa4ec('0x9')](_0xa4ec('0xa'),attributes,{'tableName':_0xa4ec('0xb'),'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 5b261b2..6d65d5d 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 _0x757a=['stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','ShowTrunk','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x19351b,_0x3b413b){var _0x3aec1c=function(_0xb8a71e){while(--_0xb8a71e){_0x19351b['push'](_0x19351b['shift']());}};_0x3aec1c(++_0x3b413b);}(_0x757a,0xde));var _0xa757=function(_0x5601fe,_0x5a65a0){_0x5601fe=_0x5601fe-0x0;var _0x30d000=_0x757a[_0x5601fe];return _0x30d000;};'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']('Trunk,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('Trunk,\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']('GetTrunk',_0x4d9f58);logger['debug']('GetTrunk',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetTrunk',_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 _0xbaf0=['Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','model','map','ShowTrunk','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('Trunk,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetTrunk',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowTrunk',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 0af64c6..d9647d2 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 _0x35f1=['delete','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','/:id/sms_interactions','removeSmsInteractions','removeWhatsappInteractions','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','describe','/whoami','/:id','show','/:id/avatar','getAvatar','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getApiKey','/create_many','bulkCreate','post','addContacts','addQueues','diskStorage','join','root','server/files/images/','%s-%s','now','originalname','file','addAvatar','/:id/login','logout','/:id/pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','update','changePassword'];(function(_0x2ead7f,_0x3b4b1d){var _0x15c771=function(_0x293d0f){while(--_0x293d0f){_0x2ead7f['push'](_0x2ead7f['shift']());}};_0x15c771(++_0x3b4b1d);}(_0x35f1,0xe5));var _0x135f=function(_0x3e3221,_0x392851){_0x3e3221=_0x3e3221-0x0;var _0x190da4=_0x35f1[_0x3e3221];return _0x190da4;};'use strict';var multer=require(_0x135f('0x0'));var util=require(_0x135f('0x1'));var path=require('path');var timeout=require(_0x135f('0x2'));var express=require(_0x135f('0x3'));var router=express[_0x135f('0x4')]();var auth=require(_0x135f('0x5'));var interaction=require(_0x135f('0x6'));var config=require(_0x135f('0x7'));var controller=require(_0x135f('0x8'));router['get']('/',auth[_0x135f('0x9')](),controller[_0x135f('0xa')]);router[_0x135f('0xb')]('/describe',auth[_0x135f('0x9')](),controller[_0x135f('0xc')]);router[_0x135f('0xb')](_0x135f('0xd'),auth['isAuthenticated'](),controller['whoami']);router['get'](_0x135f('0xe'),auth[_0x135f('0x9')](),controller[_0x135f('0xf')]);router[_0x135f('0xb')](_0x135f('0x10'),controller[_0x135f('0x11')]);router[_0x135f('0xb')](_0x135f('0x12'),auth[_0x135f('0x9')](),controller['getContacts']);router[_0x135f('0xb')](_0x135f('0x13'),auth['isAuthenticated'](),controller[_0x135f('0x14')]);router[_0x135f('0xb')](_0x135f('0x15'),auth[_0x135f('0x9')](),controller[_0x135f('0x16')]);router[_0x135f('0xb')]('/:id/groups',auth[_0x135f('0x9')](),controller[_0x135f('0x17')]);router['get'](_0x135f('0x18'),auth[_0x135f('0x9')](),controller['getRecordings']);router[_0x135f('0xb')](_0x135f('0x19'),auth[_0x135f('0x9')](),controller[_0x135f('0x1a')]);router[_0x135f('0xb')]('/:id/chat/interactions',auth[_0x135f('0x9')](),controller['getChatInteractions']);router[_0x135f('0xb')]('/:id/openchannel/interactions',auth[_0x135f('0x9')](),controller[_0x135f('0x1b')]);router[_0x135f('0xb')](_0x135f('0x1c'),auth[_0x135f('0x9')](),controller[_0x135f('0x1d')]);router['get']('/:id/sms/interactions',auth[_0x135f('0x9')](),controller[_0x135f('0x1e')]);router[_0x135f('0xb')](_0x135f('0x1f'),auth[_0x135f('0x9')](),controller[_0x135f('0x20')]);router['get'](_0x135f('0x21'),auth[_0x135f('0x9')](),controller['getWhatsappInteractions']);router[_0x135f('0xb')](_0x135f('0x22'),auth[_0x135f('0x9')](),controller[_0x135f('0x23')]);router[_0x135f('0xb')](_0x135f('0x24'),auth['isAuthenticated'](),controller[_0x135f('0x25')]);router[_0x135f('0xb')](_0x135f('0x26'),auth[_0x135f('0x9')](),controller['getAgents']);router[_0x135f('0xb')](_0x135f('0x27'),auth[_0x135f('0x9')](),controller[_0x135f('0x28')]);router[_0x135f('0xb')](_0x135f('0x29'),auth[_0x135f('0x9')](),controller[_0x135f('0x2a')]);router[_0x135f('0xb')](_0x135f('0x2b'),auth[_0x135f('0x9')](),controller['getMailAccounts']);router['get'](_0x135f('0x2c'),auth[_0x135f('0x9')](),controller[_0x135f('0x2d')]);router['get'](_0x135f('0x2e'),auth[_0x135f('0x9')](),controller[_0x135f('0x2f')]);router['get']('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x135f('0x30')]);router[_0x135f('0xb')](_0x135f('0x31'),auth[_0x135f('0x9')](),controller[_0x135f('0x32')]);router[_0x135f('0xb')](_0x135f('0x33'),auth[_0x135f('0x9')](),controller[_0x135f('0x34')]);router[_0x135f('0xb')](_0x135f('0x35'),auth['isAuthenticated'](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth[_0x135f('0x9')](),controller[_0x135f('0x36')]);router['post'](_0x135f('0x37'),auth[_0x135f('0x9')](),controller[_0x135f('0x38')]);router[_0x135f('0x39')](_0x135f('0x12'),auth[_0x135f('0x9')](),controller[_0x135f('0x3a')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x135f('0x39')]('/:id/queues',auth[_0x135f('0x9')](),controller[_0x135f('0x3b')]);var upload=multer({'storage':multer[_0x135f('0x3c')]({'destination':function(_0x5722aa,_0x58f6ab,_0x590040){_0x590040(null,path[_0x135f('0x3d')](config[_0x135f('0x3e')],_0x135f('0x3f')));},'filename':function(_0x1609b1,_0x2d96b6,_0x47c615){_0x47c615(null,util['format'](_0x135f('0x40'),Date[_0x135f('0x41')](),_0x2d96b6[_0x135f('0x42')]));}})});router[_0x135f('0x39')](_0x135f('0x10'),upload['single'](_0x135f('0x43')),controller[_0x135f('0x44')]);router[_0x135f('0x39')](_0x135f('0x45'),auth[_0x135f('0x9')](),controller['login']);router[_0x135f('0x39')]('/:id/logout',auth[_0x135f('0x9')](),controller[_0x135f('0x46')]);router[_0x135f('0x39')](_0x135f('0x47'),auth[_0x135f('0x9')](),controller['pause']);router[_0x135f('0x39')](_0x135f('0x48'),auth[_0x135f('0x9')](),controller[_0x135f('0x49')]);router[_0x135f('0x39')](_0x135f('0x22'),auth['isAuthenticated'](),controller[_0x135f('0x4a')]);router[_0x135f('0x39')](_0x135f('0x4b'),auth[_0x135f('0x9')](),controller['addChatInteractions']);router[_0x135f('0x39')]('/:id/mail_interactions',auth[_0x135f('0x9')](),controller[_0x135f('0x4c')]);router[_0x135f('0x39')](_0x135f('0x4d'),auth['isAuthenticated'](),controller[_0x135f('0x4e')]);router[_0x135f('0x39')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x135f('0x4f')]);router[_0x135f('0x39')](_0x135f('0x50'),auth[_0x135f('0x9')](),controller[_0x135f('0x51')]);router[_0x135f('0x39')](_0x135f('0x52'),auth[_0x135f('0x9')](),controller['addWhatsappInteractions']);router[_0x135f('0x39')]('/:id/fax_accounts',auth[_0x135f('0x9')](),controller[_0x135f('0x53')]);router[_0x135f('0x39')](_0x135f('0x2b'),auth[_0x135f('0x9')](),controller[_0x135f('0x54')]);router[_0x135f('0x39')](_0x135f('0x2c'),auth[_0x135f('0x9')](),controller[_0x135f('0x55')]);router[_0x135f('0x39')](_0x135f('0x2e'),auth[_0x135f('0x9')](),controller[_0x135f('0x56')]);router['post'](_0x135f('0x57'),auth['isAuthenticated'](),controller[_0x135f('0x58')]);router[_0x135f('0x39')](_0x135f('0x31'),auth[_0x135f('0x9')](),controller['addWhatsappAccounts']);router['post']('/:id/square_projects',auth[_0x135f('0x9')](),controller[_0x135f('0x59')]);router['post'](_0x135f('0x5a'),auth[_0x135f('0x9')](),controller[_0x135f('0x5b')]);router[_0x135f('0x5c')]('/:id',auth['isAuthenticated'](),controller[_0x135f('0x5d')]);router[_0x135f('0x5c')]('/:id/password',auth['isAuthenticated'](),controller[_0x135f('0x5e')]);router['delete'](_0x135f('0x13'),auth[_0x135f('0x9')](),controller['removeQueues']);router['delete'](_0x135f('0x22'),auth[_0x135f('0x9')](),controller['removeTeams']);router[_0x135f('0x5f')](_0x135f('0xe'),auth[_0x135f('0x9')](),controller[_0x135f('0x60')]);router[_0x135f('0x5f')](_0x135f('0x4b'),auth[_0x135f('0x9')](),controller[_0x135f('0x61')]);router['delete'](_0x135f('0x62'),auth[_0x135f('0x9')](),controller[_0x135f('0x63')]);router[_0x135f('0x5f')](_0x135f('0x4d'),auth[_0x135f('0x9')](),controller['removeFaxInteractions']);router['delete'](_0x135f('0x64'),auth['isAuthenticated'](),controller[_0x135f('0x65')]);router[_0x135f('0x5f')](_0x135f('0x50'),auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router[_0x135f('0x5f')](_0x135f('0x52'),auth[_0x135f('0x9')](),controller[_0x135f('0x66')]);router[_0x135f('0x5f')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['removeFaxAccounts']);router['delete']('/:id/mail_accounts',auth[_0x135f('0x9')](),controller['removeMailAccounts']);router['delete']('/:id/openchannel_accounts',auth[_0x135f('0x9')](),controller['removeOpenchannelAccounts']);router[_0x135f('0x5f')](_0x135f('0x2e'),auth['isAuthenticated'](),controller[_0x135f('0x67')]);router[_0x135f('0x5f')]('/:id/chat_websites',auth[_0x135f('0x9')](),controller[_0x135f('0x68')]);router[_0x135f('0x5f')]('/:id/whatsapp_accounts',auth[_0x135f('0x9')](),controller[_0x135f('0x69')]);router[_0x135f('0x5f')](_0x135f('0x33'),auth[_0x135f('0x9')](),controller[_0x135f('0x6a')]);router[_0x135f('0x5f')]('/:id/api_key',auth[_0x135f('0x9')](),controller[_0x135f('0x6b')]);module['exports']=router; \ No newline at end of file +var _0x5487=['post','/:id/contacts','create','addQueues','join','root','server/files/images/','%s-%s','now','single','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','/:id/whatsapp_interactions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','/:id','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','describe','/whoami','whoami','show','/:id/avatar','getAvatar','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey'];(function(_0x2d625e,_0x30954f){var _0x5adc87=function(_0x56cf23){while(--_0x56cf23){_0x2d625e['push'](_0x2d625e['shift']());}};_0x5adc87(++_0x30954f);}(_0x5487,0x19f));var _0x7548=function(_0x373a31,_0x506e31){_0x373a31=_0x373a31-0x0;var _0x141311=_0x5487[_0x373a31];return _0x141311;};'use strict';var multer=require(_0x7548('0x0'));var util=require(_0x7548('0x1'));var path=require(_0x7548('0x2'));var timeout=require(_0x7548('0x3'));var express=require(_0x7548('0x4'));var router=express[_0x7548('0x5')]();var auth=require(_0x7548('0x6'));var interaction=require(_0x7548('0x7'));var config=require(_0x7548('0x8'));var controller=require(_0x7548('0x9'));router[_0x7548('0xa')]('/',auth['isAuthenticated'](),controller[_0x7548('0xb')]);router[_0x7548('0xa')](_0x7548('0xc'),auth[_0x7548('0xd')](),controller[_0x7548('0xe')]);router[_0x7548('0xa')](_0x7548('0xf'),auth['isAuthenticated'](),controller[_0x7548('0x10')]);router['get']('/:id',auth[_0x7548('0xd')](),controller[_0x7548('0x11')]);router[_0x7548('0xa')](_0x7548('0x12'),controller[_0x7548('0x13')]);router['get']('/:id/contacts',auth['isAuthenticated'](),controller[_0x7548('0x14')]);router[_0x7548('0xa')](_0x7548('0x15'),auth[_0x7548('0xd')](),controller[_0x7548('0x16')]);router[_0x7548('0xa')](_0x7548('0x17'),auth[_0x7548('0xd')](),controller[_0x7548('0x18')]);router['get']('/:id/groups',auth[_0x7548('0xd')](),controller[_0x7548('0x19')]);router[_0x7548('0xa')]('/:id/recordings',auth[_0x7548('0xd')](),controller[_0x7548('0x1a')]);router[_0x7548('0xa')](_0x7548('0x1b'),auth[_0x7548('0xd')](),controller[_0x7548('0x1c')]);router[_0x7548('0xa')]('/:id/chat/interactions',auth[_0x7548('0xd')](),controller[_0x7548('0x1d')]);router[_0x7548('0xa')](_0x7548('0x1e'),auth['isAuthenticated'](),controller[_0x7548('0x1f')]);router[_0x7548('0xa')](_0x7548('0x20'),auth[_0x7548('0xd')](),controller[_0x7548('0x21')]);router[_0x7548('0xa')](_0x7548('0x22'),auth[_0x7548('0xd')](),controller[_0x7548('0x23')]);router[_0x7548('0xa')](_0x7548('0x24'),auth[_0x7548('0xd')](),controller[_0x7548('0x25')]);router[_0x7548('0xa')](_0x7548('0x26'),auth['isAuthenticated'](),controller[_0x7548('0x27')]);router[_0x7548('0xa')](_0x7548('0x28'),auth[_0x7548('0xd')](),controller[_0x7548('0x29')]);router['get'](_0x7548('0x2a'),auth[_0x7548('0xd')](),controller[_0x7548('0x2b')]);router[_0x7548('0xa')](_0x7548('0x2c'),auth[_0x7548('0xd')](),controller[_0x7548('0x2d')]);router['get']('/:id/prefixes',auth[_0x7548('0xd')](),controller[_0x7548('0x2e')]);router['get']('/:id/fax_accounts',auth[_0x7548('0xd')](),controller[_0x7548('0x2f')]);router[_0x7548('0xa')](_0x7548('0x30'),auth[_0x7548('0xd')](),controller[_0x7548('0x31')]);router[_0x7548('0xa')]('/:id/openchannel_accounts',auth[_0x7548('0xd')](),controller[_0x7548('0x32')]);router[_0x7548('0xa')](_0x7548('0x33'),auth[_0x7548('0xd')](),controller['getSmsAccounts']);router['get'](_0x7548('0x34'),auth[_0x7548('0xd')](),controller[_0x7548('0x35')]);router[_0x7548('0xa')](_0x7548('0x36'),auth[_0x7548('0xd')](),controller[_0x7548('0x37')]);router[_0x7548('0xa')](_0x7548('0x38'),auth['isAuthenticated'](),controller[_0x7548('0x39')]);router[_0x7548('0xa')](_0x7548('0x3a'),auth[_0x7548('0xd')](),controller['getScheduledCalls']);router[_0x7548('0xa')](_0x7548('0x3b'),auth[_0x7548('0xd')](),controller[_0x7548('0x3c')]);router['post']('/create_many',auth[_0x7548('0xd')](),controller['bulkCreate']);router[_0x7548('0x3d')](_0x7548('0x3e'),auth[_0x7548('0xd')](),controller['addContacts']);router[_0x7548('0x3d')]('/',auth[_0x7548('0xd')](),controller[_0x7548('0x3f')]);router[_0x7548('0x3d')](_0x7548('0x15'),auth[_0x7548('0xd')](),controller[_0x7548('0x40')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x45852b,_0x4e171c,_0x2e1e09){_0x2e1e09(null,path[_0x7548('0x41')](config[_0x7548('0x42')],_0x7548('0x43')));},'filename':function(_0x215e4e,_0x17b50a,_0x380d3c){_0x380d3c(null,util['format'](_0x7548('0x44'),Date[_0x7548('0x45')](),_0x17b50a['originalname']));}})});router[_0x7548('0x3d')](_0x7548('0x12'),upload[_0x7548('0x46')](_0x7548('0x47')),controller[_0x7548('0x48')]);router['post'](_0x7548('0x49'),auth[_0x7548('0xd')](),controller[_0x7548('0x4a')]);router[_0x7548('0x3d')](_0x7548('0x4b'),auth[_0x7548('0xd')](),controller['logout']);router[_0x7548('0x3d')](_0x7548('0x4c'),auth[_0x7548('0xd')](),controller[_0x7548('0x4d')]);router[_0x7548('0x3d')](_0x7548('0x4e'),auth[_0x7548('0xd')](),controller['unpause']);router[_0x7548('0x3d')](_0x7548('0x28'),auth[_0x7548('0xd')](),controller[_0x7548('0x4f')]);router['post'](_0x7548('0x50'),auth[_0x7548('0xd')](),controller[_0x7548('0x51')]);router['post']('/:id/mail_interactions',auth[_0x7548('0xd')](),controller[_0x7548('0x52')]);router['post']('/:id/fax_interactions',auth[_0x7548('0xd')](),controller[_0x7548('0x53')]);router[_0x7548('0x3d')](_0x7548('0x54'),auth[_0x7548('0xd')](),controller['addSmsInteractions']);router[_0x7548('0x3d')](_0x7548('0x55'),auth[_0x7548('0xd')](),controller['addOpenchannelInteractions']);router[_0x7548('0x3d')](_0x7548('0x56'),auth[_0x7548('0xd')](),controller['addWhatsappInteractions']);router['post'](_0x7548('0x57'),auth[_0x7548('0xd')](),controller[_0x7548('0x58')]);router[_0x7548('0x3d')]('/:id/mail_accounts',auth[_0x7548('0xd')](),controller[_0x7548('0x59')]);router[_0x7548('0x3d')](_0x7548('0x5a'),auth['isAuthenticated'](),controller['addOpenchannelAccounts']);router['post'](_0x7548('0x33'),auth[_0x7548('0xd')](),controller[_0x7548('0x5b')]);router[_0x7548('0x3d')](_0x7548('0x34'),auth[_0x7548('0xd')](),controller[_0x7548('0x5c')]);router['post'](_0x7548('0x36'),auth['isAuthenticated'](),controller[_0x7548('0x5d')]);router[_0x7548('0x3d')]('/:id/square_projects',auth[_0x7548('0xd')](),controller['addSquareProjects']);router[_0x7548('0x3d')](_0x7548('0x3b'),auth[_0x7548('0xd')](),controller[_0x7548('0x5e')]);router[_0x7548('0x5f')]('/:id',auth[_0x7548('0xd')](),controller[_0x7548('0x60')]);router[_0x7548('0x5f')]('/:id/password',auth[_0x7548('0xd')](),controller[_0x7548('0x61')]);router[_0x7548('0x62')](_0x7548('0x15'),auth[_0x7548('0xd')](),controller[_0x7548('0x63')]);router[_0x7548('0x62')](_0x7548('0x28'),auth[_0x7548('0xd')](),controller[_0x7548('0x64')]);router['delete'](_0x7548('0x65'),auth[_0x7548('0xd')](),controller[_0x7548('0x66')]);router[_0x7548('0x62')](_0x7548('0x50'),auth[_0x7548('0xd')](),controller[_0x7548('0x67')]);router[_0x7548('0x62')](_0x7548('0x68'),auth[_0x7548('0xd')](),controller[_0x7548('0x69')]);router[_0x7548('0x62')](_0x7548('0x6a'),auth[_0x7548('0xd')](),controller[_0x7548('0x6b')]);router[_0x7548('0x62')](_0x7548('0x54'),auth[_0x7548('0xd')](),controller[_0x7548('0x6c')]);router[_0x7548('0x62')]('/:id/openchannel_interactions',auth[_0x7548('0xd')](),controller[_0x7548('0x6d')]);router[_0x7548('0x62')](_0x7548('0x56'),auth[_0x7548('0xd')](),controller[_0x7548('0x6e')]);router['delete'](_0x7548('0x57'),auth[_0x7548('0xd')](),controller[_0x7548('0x6f')]);router[_0x7548('0x62')](_0x7548('0x30'),auth[_0x7548('0xd')](),controller['removeMailAccounts']);router['delete']('/:id/openchannel_accounts',auth[_0x7548('0xd')](),controller[_0x7548('0x70')]);router[_0x7548('0x62')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x7548('0x71')]);router[_0x7548('0x62')](_0x7548('0x34'),auth['isAuthenticated'](),controller[_0x7548('0x72')]);router['delete']('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x7548('0x73')]);router['delete'](_0x7548('0x38'),auth['isAuthenticated'](),controller[_0x7548('0x74')]);router['delete'](_0x7548('0x3b'),auth[_0x7548('0xd')](),controller[_0x7548('0x75')]);module[_0x7548('0x76')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 091701f..6d9453a 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 _0x1104=['icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','avpf','dtlscertfile','TEXT','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','screenrecording','blocked','blockedAt','loginAttempts','sequelize','util','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','admin','agent','telephone','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','ENUM','friend','user','peer','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','udp','join','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','nonat','outgoing','force_rport,comedia','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','accept','refuse','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','showWebBar','get','isArray','wss','encryption'];(function(_0x2341b9,_0x57d1d0){var _0x592fe0=function(_0x13c7c9){while(--_0x13c7c9){_0x2341b9['push'](_0x2341b9['shift']());}};_0x592fe0(++_0x57d1d0);}(_0x1104,0xbd));var _0x4110=function(_0x3d4e6f,_0x1c208c){_0x3d4e6f=_0x3d4e6f-0x0;var _0x429ae3=_0x1104[_0x3d4e6f];return _0x429ae3;};'use strict';var Sequelize=require(_0x4110('0x0'));var moment=require('moment');var util=require(_0x4110('0x1'));var _=require(_0x4110('0x2'));module[_0x4110('0x3')]={'name':{'type':Sequelize[_0x4110('0x4')],'allowNull':![],'unique':_0x4110('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x58312f){this[_0x4110('0x6')]('name',_0x58312f);this[_0x4110('0x6')](_0x4110('0x7'),_0x58312f);},'comment':_0x4110('0x8')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x264ea7){this['setDataValue'](_0x4110('0x9'),_0x264ea7);this['setDataValue'](_0x4110('0xa'),util[_0x4110('0xb')](_0x4110('0xc'),_0x264ea7,this[_0x4110('0xd')](_0x4110('0xe'))));}},'alias':{'type':Sequelize[_0x4110('0x4')]},'email':{'type':Sequelize[_0x4110('0x4')],'allowNull':![],'unique':_0x4110('0xf'),'validate':{'isEmail':!![]},'set':function(_0x1c446d){if(_0x1c446d){this[_0x4110('0x6')](_0x4110('0xf'),_0x1c446d[_0x4110('0x10')]());}}},'role':{'type':Sequelize['ENUM'](_0x4110('0x11'),'user',_0x4110('0x12'),_0x4110('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x4110('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x4110('0xe'),'set':function(_0x3f2d63){this[_0x4110('0x6')](_0x4110('0xe'),_0x3f2d63);this[_0x4110('0x6')](_0x4110('0x14'),_0x3f2d63);this['setDataValue'](_0x4110('0xa'),util['format'](_0x4110('0xc'),this['getDataValue'](_0x4110('0x9')),_0x3f2d63));}},'salt':{'type':Sequelize[_0x4110('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x4110('0x4')]},'address':{'type':Sequelize[_0x4110('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x4110('0x4')]},'city':{'type':Sequelize[_0x4110('0x4')]},'country':{'type':Sequelize[_0x4110('0x4')]},'online':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x4110('0x4')],'defaultValue':_0x4110('0x16')},'lastPauseAt':{'type':Sequelize[_0x4110('0x17')]},'chatCapacity':{'type':Sequelize[_0x4110('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x4110('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x4110('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x4110('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x4110('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x4110('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x4110('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x4110('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x4110('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x1a'),_0x4110('0x1b'),_0x4110('0x1c')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x4110('0x1d'),'ALLOWED',_0x4110('0x1e'),_0x4110('0x1f'),'PROHIB_FAILED_SCREEN','PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x4110('0x20'),'set':function(_0x379731){this[_0x4110('0x6')]('transport',_0x379731?_0x379731[_0x4110('0x21')](','):null);},'get':function(){return this['getDataValue'](_0x4110('0x22'))?this[_0x4110('0xd')](_0x4110('0x22'))['split'](','):null;},'comment':_0x4110('0x23')},'dtmfmode':{'type':Sequelize[_0x4110('0x19')]('rfc2833',_0x4110('0x24'),_0x4110('0x25'),_0x4110('0x26'),_0x4110('0x27')),'allowNull':!![],'defaultValue':_0x4110('0x28')},'directmedia':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no',_0x4110('0x2a'),'update',_0x4110('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x4110('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![],'defaultValue':_0x4110('0x2c'),'set':function(_0x3dc9f1){this[_0x4110('0x6')](_0x4110('0x2d'),_0x3dc9f1?_0x3dc9f1['join'](','):null);},'get':function(){return this[_0x4110('0xd')](_0x4110('0x2d'))?this['getDataValue'](_0x4110('0x2d'))[_0x4110('0x2e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x4110('0x4')]},'namedcallgroup':{'type':Sequelize[_0x4110('0x4')]},'pickupgroup':{'type':Sequelize[_0x4110('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x4110('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4110('0x4')]},'disallow':{'type':Sequelize[_0x4110('0x4')],'allowNull':![],'defaultValue':_0x4110('0x2f')},'allow':{'type':Sequelize[_0x4110('0x4')],'allowNull':![],'defaultValue':_0x4110('0x30'),'set':function(_0x51afc0){this[_0x4110('0x6')](_0x4110('0x31'),_0x51afc0?_0x51afc0['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x4110('0xd')](_0x4110('0x31'))?this[_0x4110('0xd')](_0x4110('0x31'))['split'](';'):null;},'comment':_0x4110('0x32')},'autoframing':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![],'set':function(_0x11301f){this[_0x4110('0x6')](_0x4110('0x33'),_0x11301f?_0x11301f[_0x4110('0x21')](','):null);},'get':function(){return this['getDataValue'](_0x4110('0x33'))?this['getDataValue'](_0x4110('0x33'))[_0x4110('0x2e')](','):null;},'comment':_0x4110('0x34')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x4110('0x29'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x4110('0x19')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x4110('0x35')},'amaflags':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x4110('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x4110('0x19')]('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x4110('0x36'),_0x4110('0x37'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x38'),_0x4110('0x39')),'allowNull':!![],'defaultValue':_0x4110('0x39')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x4110('0x19')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x4110('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x4110('0x19')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x4110('0x19')]('yes','no',_0x4110('0x3a'),_0x4110('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x4110('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x3c'),_0x4110('0x3d'),_0x4110('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x4110('0x19')](_0x4110('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x4110('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x4110('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x4110('0x19')]('yes','no','nonat','update',_0x4110('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x4110('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x4110('0x17')]},'showWebBar':{'type':Sequelize[_0x4110('0x18')],'defaultValue':0x0,'set':function(_0x56ca03){this['setDataValue'](_0x4110('0x40'),_0x56ca03);var _0x3f5854=this[_0x4110('0x41')]({'plain':!![]});switch(_0x56ca03){case 0x0:case 0x1:var _0x532306=_0x3f5854[_0x4110('0x22')]?_[_0x4110('0x42')](_0x3f5854['transport'])?_0x3f5854[_0x4110('0x22')][_0x4110('0x21')]():_0x3f5854['transport']:_0x4110('0x20');if(_0x532306===_0x4110('0x43')){_0x532306=_0x4110('0x20');}this[_0x4110('0x6')](_0x4110('0x22'),_0x532306);this[_0x4110('0x6')](_0x4110('0x44'),'no');this['setDataValue']('avpf',null);this[_0x4110('0x6')]('force_avp',null);this[_0x4110('0x6')](_0x4110('0x45'),null);this[_0x4110('0x6')](_0x4110('0x46'),null);this[_0x4110('0x6')](_0x4110('0x47'),null);this['setDataValue'](_0x4110('0x48'),null);this[_0x4110('0x6')]('dtlscertfile',null);this[_0x4110('0x6')](_0x4110('0x49'),null);this['setDataValue'](_0x4110('0x4a'),'no');break;case 0x2:this[_0x4110('0x6')](_0x4110('0x22'),_0x4110('0x43'));this['setDataValue'](_0x4110('0x44'),_0x4110('0x29'));this['setDataValue'](_0x4110('0x4b'),_0x4110('0x29'));this[_0x4110('0x6')]('force_avp',_0x4110('0x29'));this['setDataValue'](_0x4110('0x45'),'yes');this[_0x4110('0x6')](_0x4110('0x46'),'yes');this[_0x4110('0x6')](_0x4110('0x47'),'no');this[_0x4110('0x6')](_0x4110('0x48'),_0x4110('0x3e'));this[_0x4110('0x6')](_0x4110('0x4c'),_0x3f5854[_0x4110('0x4c')]||'/etc/pki/tls/certs/motion.crt');this['setDataValue'](_0x4110('0x49'),_0x3f5854[_0x4110('0x49')]||'/etc/pki/tls/private/motion.key');this[_0x4110('0x6')](_0x4110('0x4a'),_0x4110('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0x4110('0x4d')],'set':function(_0x55bf52){this['setDataValue'](_0x4110('0x4e'),_0x55bf52?_0x55bf52[_0x4110('0x21')](','):[]);},'get':function(){return this[_0x4110('0xd')]('permissions')?_['map'](this[_0x4110('0xd')](_0x4110('0x4e'))[_0x4110('0x2e')](','),function(_0x3c9ef4){return parseInt(_0x3c9ef4,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x4110('0x4')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x4110('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x4110('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x4110('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x4110('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x4110('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x4110('0x19')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x4110('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x4110('0x4')]},'passwordResetAt':{'type':Sequelize[_0x4110('0x17')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x4110('0x4f')],'get':function(){return this[_0x4110('0xd')](_0x4110('0x50'))?this[_0x4110('0xd')](_0x4110('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x4110('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x5f75d7){if(typeof _0x5f75d7==='string'){var _0x80594d=_0x5f75d7==='1'?!![]:_0x5f75d7==='0'?![]:_0x5f75d7===_0x4110('0x51')?!![]:_0x5f75d7==='false'?![]:![];this['setDataValue'](_0x4110('0x52'),_0x80594d);}else{this[_0x4110('0x6')](_0x4110('0x52'),_0x5f75d7);}}},'blocked':{'type':Sequelize[_0x4110('0x15')],'defaultValue':![],'set':function(_0x244147){this[_0x4110('0x6')](_0x4110('0x53'),_0x244147);if(_0x244147===!![]){this['setDataValue'](_0x4110('0x54'),moment());this[_0x4110('0x6')](_0x4110('0x55'),0x0);}else{this[_0x4110('0x6')](_0x4110('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x4110('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x4110('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8deb=['getDataValue','internal','email','admin','user','telephone','local','INTEGER','accountcode','callerid','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','nonat','update','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','refuse','uas','fingerprint','certificate','active','passive','update,nonat','showWebBar','get','isArray','encryption','force_avp','dtlsenable','dtlsverify','dtlscertfile','dtlsprivatekey','rtcp_mux','wss','avpf','dtlssetup','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','TEXT','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blocked','blockedAt','sequelize','util','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>'];(function(_0x4c2ca2,_0x26f7c7){var _0x4e8cda=function(_0x91ddb9){while(--_0x91ddb9){_0x4c2ca2['push'](_0x4c2ca2['shift']());}};_0x4e8cda(++_0x26f7c7);}(_0x8deb,0x15d));var _0xb8de=function(_0x52711f,_0x4cf48b){_0x52711f=_0x52711f-0x0;var _0x736442=_0x8deb[_0x52711f];return _0x736442;};'use strict';var Sequelize=require(_0xb8de('0x0'));var moment=require('moment');var util=require(_0xb8de('0x1'));var _=require('lodash');module[_0xb8de('0x2')]={'name':{'type':Sequelize[_0xb8de('0x3')],'allowNull':![],'unique':_0xb8de('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x2ba223){this['setDataValue'](_0xb8de('0x4'),_0x2ba223);this[_0xb8de('0x5')](_0xb8de('0x6'),_0x2ba223);},'comment':_0xb8de('0x7')},'fullname':{'type':Sequelize[_0xb8de('0x3')],'allowNull':![],'set':function(_0x1e44c5){this['setDataValue'](_0xb8de('0x8'),_0x1e44c5);this['setDataValue']('callerid',util[_0xb8de('0x9')](_0xb8de('0xa'),_0x1e44c5,this[_0xb8de('0xb')](_0xb8de('0xc'))));}},'alias':{'type':Sequelize[_0xb8de('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb8de('0xd'),'validate':{'isEmail':!![]},'set':function(_0x384291){if(_0x384291){this['setDataValue'](_0xb8de('0xd'),_0x384291['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0xb8de('0xe'),_0xb8de('0xf'),'agent',_0xb8de('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0xb8de('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xb8de('0x3')],'defaultValue':_0xb8de('0x11')},'internal':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':![],'unique':_0xb8de('0xc'),'set':function(_0x57c80a){this[_0xb8de('0x5')]('internal',_0x57c80a);this[_0xb8de('0x5')](_0xb8de('0x13'),_0x57c80a);this[_0xb8de('0x5')](_0xb8de('0x14'),util[_0xb8de('0x9')](_0xb8de('0xa'),this[_0xb8de('0xb')](_0xb8de('0x8')),_0x57c80a));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xb8de('0x3')]},'mobile':{'type':Sequelize[_0xb8de('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0xb8de('0x3')]},'userpic':{'type':Sequelize[_0xb8de('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xb8de('0x3')]},'online':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xb8de('0x16')]},'voicePause':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xb8de('0x3')],'defaultValue':_0xb8de('0x17')},'lastPauseAt':{'type':Sequelize[_0xb8de('0x16')]},'chatCapacity':{'type':Sequelize[_0xb8de('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xb8de('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xb8de('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xb8de('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xb8de('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0xb8de('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x19'),_0xb8de('0xf'),_0xb8de('0x1a')),'allowNull':!![],'defaultValue':_0xb8de('0x19')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xb8de('0x1b')},'callingpres':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x1c'),_0xb8de('0x1d'),'ALLOWED_FAILED_SCREEN',_0xb8de('0x1e'),_0xb8de('0x1f'),_0xb8de('0x20'),_0xb8de('0x21'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xb8de('0x22'),'set':function(_0x4dd5e5){this[_0xb8de('0x5')](_0xb8de('0x23'),_0x4dd5e5?_0x4dd5e5['join'](','):null);},'get':function(){return this[_0xb8de('0xb')](_0xb8de('0x23'))?this[_0xb8de('0xb')](_0xb8de('0x23'))[_0xb8de('0x24')](','):null;},'comment':_0xb8de('0x25')},'dtmfmode':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x26'),'info',_0xb8de('0x27'),_0xb8de('0x28'),_0xb8de('0x29')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no',_0xb8de('0x2b'),_0xb8de('0x2c'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![],'defaultValue':_0xb8de('0x2d'),'set':function(_0x436db2){this[_0xb8de('0x5')](_0xb8de('0x2e'),_0x436db2?_0x436db2[_0xb8de('0x2f')](','):null);},'get':function(){return this[_0xb8de('0xb')](_0xb8de('0x2e'))?this[_0xb8de('0xb')](_0xb8de('0x2e'))[_0xb8de('0x24')](','):null;},'comment':_0xb8de('0x30')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xb8de('0x3')]},'pickupgroup':{'type':Sequelize[_0xb8de('0x3')]},'namedpickupgroup':{'type':Sequelize[_0xb8de('0x3')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xb8de('0x3')]},'disallow':{'type':Sequelize[_0xb8de('0x3')],'allowNull':![],'defaultValue':_0xb8de('0x31')},'allow':{'type':Sequelize[_0xb8de('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3927d9){this[_0xb8de('0x5')](_0xb8de('0x32'),_0x3927d9?_0x3927d9[_0xb8de('0x2f')](';'):_0xb8de('0x33'));},'get':function(){return this['getDataValue'](_0xb8de('0x32'))?this[_0xb8de('0xb')](_0xb8de('0x32'))['split'](';'):null;},'comment':_0xb8de('0x34')},'autoframing':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![],'set':function(_0x493d2e){this[_0xb8de('0x5')](_0xb8de('0x35'),_0x493d2e?_0x493d2e[_0xb8de('0x2f')](','):null);},'get':function(){return this[_0xb8de('0xb')](_0xb8de('0x35'))?this['getDataValue']('insecure')[_0xb8de('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xb8de('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no',_0xb8de('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![],'defaultValue':_0xb8de('0x37')},'amaflags':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xb8de('0x18')]('yes','no'),'allowNull':!![],'defaultValue':_0xb8de('0x2a')},'busylevel':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xb8de('0x18')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0xb8de('0x2a'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xb8de('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM']('uac','uas'),'allowNull':!![],'defaultValue':_0xb8de('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xb8de('0x2a')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no',_0xb8de('0x3a'),_0xb8de('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x3c'),_0xb8de('0x3d'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xb8de('0x18')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xb8de('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no','nonat',_0xb8de('0x2c'),_0xb8de('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xb8de('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0xb8de('0x16')]},'showWebBar':{'type':Sequelize[_0xb8de('0x12')],'defaultValue':0x0,'set':function(_0x4b5e07){this[_0xb8de('0x5')](_0xb8de('0x3f'),_0x4b5e07);var _0x3c7ef8=this[_0xb8de('0x40')]({'plain':!![]});switch(_0x4b5e07){case 0x0:case 0x1:var _0x1d714b=_0x3c7ef8[_0xb8de('0x23')]?_[_0xb8de('0x41')](_0x3c7ef8[_0xb8de('0x23')])?_0x3c7ef8[_0xb8de('0x23')][_0xb8de('0x2f')]():_0x3c7ef8[_0xb8de('0x23')]:'udp';if(_0x1d714b==='wss'){_0x1d714b=_0xb8de('0x22');}this[_0xb8de('0x5')](_0xb8de('0x23'),_0x1d714b);this[_0xb8de('0x5')](_0xb8de('0x42'),'no');this['setDataValue']('avpf',null);this[_0xb8de('0x5')](_0xb8de('0x43'),null);this[_0xb8de('0x5')]('icesupport',null);this[_0xb8de('0x5')](_0xb8de('0x44'),null);this[_0xb8de('0x5')](_0xb8de('0x45'),null);this[_0xb8de('0x5')]('dtlssetup',null);this[_0xb8de('0x5')](_0xb8de('0x46'),null);this[_0xb8de('0x5')](_0xb8de('0x47'),null);this[_0xb8de('0x5')](_0xb8de('0x48'),'no');break;case 0x2:this['setDataValue'](_0xb8de('0x23'),_0xb8de('0x49'));this[_0xb8de('0x5')](_0xb8de('0x42'),'yes');this[_0xb8de('0x5')](_0xb8de('0x4a'),'yes');this[_0xb8de('0x5')](_0xb8de('0x43'),_0xb8de('0x2a'));this[_0xb8de('0x5')]('icesupport','yes');this['setDataValue'](_0xb8de('0x44'),_0xb8de('0x2a'));this[_0xb8de('0x5')](_0xb8de('0x45'),'no');this[_0xb8de('0x5')](_0xb8de('0x4b'),_0xb8de('0x4c'));this['setDataValue']('dtlscertfile',_0x3c7ef8[_0xb8de('0x46')]||_0xb8de('0x4d'));this[_0xb8de('0x5')](_0xb8de('0x47'),_0x3c7ef8[_0xb8de('0x47')]||_0xb8de('0x4e'));this[_0xb8de('0x5')](_0xb8de('0x48'),_0xb8de('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xb8de('0x4f')],'set':function(_0x45b709){this[_0xb8de('0x5')](_0xb8de('0x50'),_0x45b709?_0x45b709[_0xb8de('0x2f')](','):[]);},'get':function(){return this[_0xb8de('0xb')](_0xb8de('0x50'))?_[_0xb8de('0x51')](this['getDataValue'](_0xb8de('0x50'))[_0xb8de('0x24')](','),function(_0x215ca1){return parseInt(_0x215ca1,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xb8de('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xb8de('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xb8de('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xb8de('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xb8de('0x18')](_0xb8de('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xb8de('0x3')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xb8de('0x52')],'get':function(){return this['getDataValue'](_0xb8de('0x53'))?this[_0xb8de('0xb')](_0xb8de('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0xb8de('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xb8de('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![],'set':function(_0x107c94){if(typeof _0x107c94===_0xb8de('0x54')){var _0x1bf841=_0x107c94==='1'?!![]:_0x107c94==='0'?![]:_0x107c94===_0xb8de('0x55')?!![]:_0x107c94===_0xb8de('0x56')?![]:![];this[_0xb8de('0x5')](_0xb8de('0x57'),_0x1bf841);}else{this[_0xb8de('0x5')](_0xb8de('0x57'),_0x107c94);}}},'blocked':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![],'set':function(_0x16595a){this[_0xb8de('0x5')](_0xb8de('0x58'),_0x16595a);if(_0x16595a===!![]){this['setDataValue'](_0xb8de('0x59'),moment());this['setDataValue']('loginAttempts',0x0);}else{this['setDataValue'](_0xb8de('0x59'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xb8de('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index e26e254..2fe236a 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 _0x1047=['lastPauseAt','unpause','manual','mail','chat','fax','sms','whatsapp','openchannel','all','getTeams','Team','setDataValue','getChatQueues','Chat','getMailQueues','Mail','getSmsQueues','getWhatsappQueues','getFaxQueues','Fax','Openchannel','flatten','addAgent','getDataValue','Voice','removeTeams','Sms','getOpenchannelQueues','transaction','removeAgent','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','isArray','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','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','$and','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','CmHopper','firstName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','./user.socket','register','jayson/promise','client','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','destroy','get','Users','Agents','agent','telephone','filter','ignore','map','value','includes','find','stack','name','send','index','User','rawAttributes','fieldName','type','key','model','differenceBy','password','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','VIRTUAL','sequelize','lower','merge','options','includeAll','include','findAll','rows','show','salt','length','bulkCreate','body','update','role','params','describe','addContacts','ids','omit','agent\x20role','admin','user','telephones','isNil','format','count\x20%s:\x20%s','internal','Setting','securePassword','max','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)','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','110','104','106','108','109','100','114','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','Telephones','autoAssociation','UserProfileResource','changePassword','findOne','oldPassword','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','addQueues','channel','online','loginInPause','interface','add','capitalize','toLowerCase','Queues','penalty','spread','QueueId','emit','Queue:save','voice','VoiceQueue','SIP/%s','voicePause','each','UserVoiceQueueRt','removeQueues','isValidChannel','Unknown\x20channel','remove','Queue:remove','addAvatar','file','filename','getAvatar','download','existsSync','join','root','server/files/images/','userpic','getContacts','CmContact','pick','CmList','List','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','push','upsert','MemberReport','forEach','getChannels','LOGIN','device','PAUSE','concat','YYYY-MM-DD\x20HH:mm:ss','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','faxPause','openchannelPause','smsPause','whatsapppause','pauseType'];(function(_0x293e7f,_0x43181f){var _0x51e718=function(_0x2d79e2){while(--_0x2d79e2){_0x293e7f['push'](_0x293e7f['shift']());}};_0x51e718(++_0x43181f);}(_0x1047,0x79));var _0x7104=function(_0x382056,_0x54738a){_0x382056=_0x382056-0x0;var _0x8499d2=_0x1047[_0x382056];return _0x8499d2;};'use strict';var pdf=require(_0x7104('0x0'));var emlformat=require(_0x7104('0x1'));var rimraf=require(_0x7104('0x2'));var zipdir=require(_0x7104('0x3'));var jsonpatch=require(_0x7104('0x4'));var rp=require(_0x7104('0x5'));var moment=require(_0x7104('0x6'));var BPromise=require(_0x7104('0x7'));var Mustache=require(_0x7104('0x8'));var util=require(_0x7104('0x9'));var path=require(_0x7104('0xa'));var sox=require(_0x7104('0xb'));var csv=require(_0x7104('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7104('0xd'));var crypto=require(_0x7104('0xe'));var jsforce=require(_0x7104('0xf'));var deskjs=require(_0x7104('0x10'));var toCsv=require(_0x7104('0xc'));var querystring=require(_0x7104('0x11'));var Papa=require(_0x7104('0x12'));var Redis=require(_0x7104('0x13'));var authService=require(_0x7104('0x14'));var qs=require(_0x7104('0x15'));var as=require(_0x7104('0x16'));var hardwareService=require(_0x7104('0x17'));var logger=require(_0x7104('0x18'))(_0x7104('0x19'));var utils=require(_0x7104('0x1a'));var config=require(_0x7104('0x1b'));var db=require('../../mysqldb')['db'];config[_0x7104('0x1c')]=_[_0x7104('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7104('0x1e'))[_0x7104('0x1f')](socket);var jayson=require(_0x7104('0x20'));var client=jayson[_0x7104('0x21')]['http']({'port':0x232a});function checkPasswordPattern(_0xf1bb4d,_0x44bf3a,_0x91d2f9){if(_0x91d2f9){var _0x4c500a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4c500a['test'](_0x44bf3a)){return _0xf1bb4d;}else{throw new db[(_0x7104('0x22'))]['ValidationError'](_0x7104('0x23'));}}else{return _0xf1bb4d;}}function respondWithRpcPromise(_0x24d008,_0x484238,_0x16d74a,_0x9ca85){return new BPromise(function(_0x21b1c3,_0x3dd285){var _0x366fd3=_0x9ca85||client;return _0x366fd3[_0x7104('0x24')](_0x24d008,_0x16d74a)[_0x7104('0x25')](function(_0x4c422b){logger[_0x7104('0x26')](_0x7104('0x27'),_0x484238,_0x7104('0x28'));logger[_0x7104('0x29')]('User,\x20%s,\x20%s,\x20%s',_0x484238,'request\x20sent',JSON['stringify'](_0x4c422b));if(_0x4c422b[_0x7104('0x2a')]){if(_0x4c422b[_0x7104('0x2a')]['code']===0x1f4){logger[_0x7104('0x2a')](_0x7104('0x27'),_0x484238,_0x4c422b[_0x7104('0x2a')][_0x7104('0x2b')]);return _0x3dd285(_0x4c422b[_0x7104('0x2a')][_0x7104('0x2b')]);}logger[_0x7104('0x2a')](_0x7104('0x27'),_0x484238,_0x4c422b['error'][_0x7104('0x2b')]);return _0x21b1c3(_0x4c422b[_0x7104('0x2a')][_0x7104('0x2b')]);}else{logger['info'](_0x7104('0x27'),_0x484238,_0x7104('0x28'));_0x21b1c3(_0x4c422b['result']['message']);}})[_0x7104('0x2c')](function(_0x523905){logger[_0x7104('0x2a')]('User,\x20%s,\x20%s',_0x484238,_0x523905);_0x3dd285(_0x523905);});});}function respondWithStatusCode(_0x332663,_0x34f5f1){_0x34f5f1=_0x34f5f1||0xcc;return function(_0x169205){if(_0x169205){return _0x332663[_0x7104('0x2d')](_0x34f5f1);}return _0x332663[_0x7104('0x2e')](_0x34f5f1)[_0x7104('0x2f')]();};}function respondWithResult(_0x2ee2fb,_0x451e22){_0x451e22=_0x451e22||0xc8;return function(_0x5d5c90){if(_0x5d5c90){return _0x2ee2fb[_0x7104('0x2e')](_0x451e22)[_0x7104('0x30')](_0x5d5c90);}};}function respondWithFilteredResult(_0x1ab562,_0x23c3df){return function(_0x3decc2){if(_0x3decc2){var _0x4fc29d=_0x3decc2[_0x7104('0x31')],_0x18a977=_0x23c3df['offset'],_0x3a9756=_0x23c3df[_0x7104('0x32')]+_0x23c3df[_0x7104('0x33')],_0x3e2e8d;if(_0x3a9756>=_0x4fc29d){_0x3a9756=_0x4fc29d;_0x3e2e8d=0xc8;}else{_0x3e2e8d=0xce;}_0x1ab562[_0x7104('0x2e')](_0x3e2e8d);return _0x1ab562[_0x7104('0x34')](_0x7104('0x35'),_0x18a977+'-'+_0x3a9756+'/'+_0x4fc29d)['json'](_0x3decc2);}return null;};}function patchUpdates(_0xc44ab0){return function(_0x2c9b7a){try{jsonpatch[_0x7104('0x36')](_0x2c9b7a,_0xc44ab0,!![]);}catch(_0x4c66ac){return BPromise[_0x7104('0x37')](_0x4c66ac);}return _0x2c9b7a['save']();};}function saveUpdates(_0x30d1f8,_0xdc39bc){return function(_0xcf3d77){if(_0xcf3d77){return _0xcf3d77['update'](_0x30d1f8)[_0x7104('0x25')](function(_0x51c829){return _0x51c829;});}return null;};}function removeEntity(_0x435f85,_0x19ceed){return function(_0x44c890){if(_0x44c890){return _0x44c890[_0x7104('0x38')]()[_0x7104('0x25')](function(){var _0x3dfb69=_0x44c890[_0x7104('0x39')]({'plain':!![]});var _0x175ce6=[{'name':_0x7104('0x3a'),'value':'user','ignore':!![]},{'name':_0x7104('0x3b'),'value':_0x7104('0x3c'),'ignore':![]},{'name':'Telephones','value':_0x7104('0x3d'),'ignore':![]}];var _0xe60acd=_(_0x175ce6)[_0x7104('0x3e')](_0x7104('0x3f'))[_0x7104('0x40')](_0x7104('0x41'))['value']();if(_[_0x7104('0x42')](_0xe60acd,_0x3dfb69['role'])){return;}var _0x36d1d0=_[_0x7104('0x43')](_0x175ce6,[_0x7104('0x41'),_0x3dfb69['role']])['name'];return db['UserProfileResource'][_0x7104('0x38')]({'where':{'type':_0x36d1d0,'resourceId':_0x3dfb69['id']}})[_0x7104('0x25')](function(){return _0x44c890;});})[_0x7104('0x25')](function(){_0x435f85[_0x7104('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x110d53,_0x503b2f){return function(_0x182187){if(!_0x182187){_0x110d53[_0x7104('0x2d')](0x194);}return _0x182187;};}function handleError(_0x5497a7,_0x273805){_0x273805=_0x273805||0x1f4;return function(_0x190b3d){logger[_0x7104('0x2a')](_0x190b3d[_0x7104('0x44')]);if(_0x190b3d[_0x7104('0x45')]){delete _0x190b3d[_0x7104('0x45')];}_0x5497a7[_0x7104('0x2e')](_0x273805)[_0x7104('0x46')](_0x190b3d);};}exports[_0x7104('0x47')]=function(_0x416372,_0x4599e1){var _0xed5015={},_0x34011f={},_0x5b438e={'count':0x0,'rows':[]};var _0x5b9499=_[_0x7104('0x40')](db[_0x7104('0x48')][_0x7104('0x49')],function(_0x10ee1d){return{'name':_0x10ee1d[_0x7104('0x4a')],'type':_0x10ee1d[_0x7104('0x4b')][_0x7104('0x4c')]};});_0x34011f[_0x7104('0x4d')]=_[_0x7104('0x4e')](_[_0x7104('0x40')](_0x5b9499,_0x7104('0x45')),[_0x7104('0x4f'),'salt']);_0x34011f[_0x7104('0x50')]=_[_0x7104('0x51')](_0x416372['query']);_0x34011f[_0x7104('0x52')]=_[_0x7104('0x53')](_0x34011f[_0x7104('0x4d')],_0x34011f[_0x7104('0x50')]);_0xed5015['attributes']=_['intersection'](_0x34011f['model'],qs[_0x7104('0x54')](_0x416372[_0x7104('0x50')]['fields']));_0xed5015['attributes']=_0xed5015['attributes']['length']?_0xed5015[_0x7104('0x55')]:_0x34011f[_0x7104('0x4d')];if(!_0x416372['query'][_0x7104('0x56')]('nolimit')){_0xed5015[_0x7104('0x33')]=qs[_0x7104('0x33')](_0x416372[_0x7104('0x50')][_0x7104('0x33')]);_0xed5015['offset']=qs[_0x7104('0x32')](_0x416372[_0x7104('0x50')][_0x7104('0x32')]);}_0xed5015[_0x7104('0x57')]=qs[_0x7104('0x58')](_0x416372[_0x7104('0x50')][_0x7104('0x58')]);_0xed5015['where']=qs[_0x7104('0x52')](_['pick'](_0x416372[_0x7104('0x50')],_0x34011f[_0x7104('0x52')]),_0x5b9499);if(_0x416372['query'][_0x7104('0x3e')]){_0xed5015[_0x7104('0x59')]=_['merge'](_0xed5015[_0x7104('0x59')],{'$or':_[_0x7104('0x40')](_0x5b9499,function(_0x28c78c){if(_0x28c78c[_0x7104('0x4b')]!==_0x7104('0x5a')){return db[_0x7104('0x5b')][_0x7104('0x59')](db[_0x7104('0x5b')]['fn']('lower',db[_0x7104('0x5b')]['col'](_0x28c78c[_0x7104('0x45')])),{'$like':db[_0x7104('0x5b')]['fn'](_0x7104('0x5c'),'%'+_0x416372['query'][_0x7104('0x3e')]+'%')});}})});}_0xed5015=_[_0x7104('0x5d')]({},_0xed5015,_0x416372[_0x7104('0x5e')]);var _0x4f378d={'where':_0xed5015[_0x7104('0x59')]};return db['User'][_0x7104('0x31')](_0x4f378d)[_0x7104('0x25')](function(_0x3fc59e){_0x5b438e[_0x7104('0x31')]=_0x3fc59e;if(_0x416372['query'][_0x7104('0x5f')]){_0xed5015[_0x7104('0x60')]=[{'all':!![]}];}return db[_0x7104('0x48')][_0x7104('0x61')](_0xed5015);})[_0x7104('0x25')](function(_0x2fabea){_0x5b438e[_0x7104('0x62')]=_0x2fabea;return _0x5b438e;})[_0x7104('0x25')](respondWithFilteredResult(_0x4599e1,_0xed5015))[_0x7104('0x2c')](handleError(_0x4599e1,null));};exports[_0x7104('0x63')]=function(_0x374445,_0x4b45aa){var _0x41fd73={'raw':![],'where':{'id':_0x374445['params']['id']}},_0x20a032={};_0x20a032[_0x7104('0x4d')]=_[_0x7104('0x4e')](_[_0x7104('0x51')](db['User'][_0x7104('0x49')]),[_0x7104('0x4f'),_0x7104('0x64')]);_0x20a032[_0x7104('0x50')]=_[_0x7104('0x51')](_0x374445['query']);_0x20a032[_0x7104('0x52')]=_['intersection'](_0x20a032[_0x7104('0x4d')],_0x20a032['query']);_0x41fd73[_0x7104('0x55')]=_[_0x7104('0x53')](_0x20a032[_0x7104('0x4d')],qs[_0x7104('0x54')](_0x374445[_0x7104('0x50')][_0x7104('0x54')]));_0x41fd73[_0x7104('0x55')]=_0x41fd73[_0x7104('0x55')][_0x7104('0x65')]?_0x41fd73['attributes']:_0x20a032[_0x7104('0x4d')];if(_0x374445['query'][_0x7104('0x5f')]){_0x41fd73[_0x7104('0x60')]=[{'all':!![]}];}_0x41fd73=_[_0x7104('0x5d')]({},_0x41fd73,_0x374445[_0x7104('0x5e')]);return db[_0x7104('0x48')][_0x7104('0x43')](_0x41fd73)[_0x7104('0x25')](handleEntityNotFound(_0x4b45aa,null))[_0x7104('0x25')](respondWithResult(_0x4b45aa,null))[_0x7104('0x2c')](handleError(_0x4b45aa,null));};exports[_0x7104('0x66')]=function(_0xc22b6c,_0x18ab72){return db[_0x7104('0x48')]['bulkCreate'](_0xc22b6c[_0x7104('0x67')],{'raw':![],'individualHooks':!![]})[_0x7104('0x25')](respondWithResult(_0x18ab72,0xc9))[_0x7104('0x2c')](handleError(_0x18ab72,null));};exports[_0x7104('0x68')]=function(_0x7bdabe,_0x3ba7b8){if(_0x7bdabe['body']['id']){delete _0x7bdabe['body']['id'];}delete _0x7bdabe['body'][_0x7104('0x69')];return db['User'][_0x7104('0x43')]({'where':{'id':_0x7bdabe[_0x7104('0x6a')]['id']}})[_0x7104('0x25')](handleEntityNotFound(_0x3ba7b8,null))[_0x7104('0x25')](saveUpdates(_0x7bdabe['body'],null))['then'](respondWithResult(_0x3ba7b8,null))[_0x7104('0x2c')](handleError(_0x3ba7b8,null));};exports[_0x7104('0x6b')]=function(_0x5ace4a,_0x1d4e9e){return db[_0x7104('0x48')][_0x7104('0x6b')]()['then'](respondWithResult(_0x1d4e9e,null))[_0x7104('0x2c')](handleError(_0x1d4e9e,null));};exports[_0x7104('0x6c')]=function(_0x1bd2f5,_0x55997a,_0x1c1633){return db['User'][_0x7104('0x43')]({'where':{'id':_0x1bd2f5['params']['id']}})['then'](handleEntityNotFound(_0x55997a,null))[_0x7104('0x25')](function(_0x17342f){if(_0x17342f){return _0x17342f[_0x7104('0x6c')](_0x1bd2f5['body'][_0x7104('0x6d')],_[_0x7104('0x6e')](_0x1bd2f5[_0x7104('0x67')],[_0x7104('0x6d'),'id'])||{});}})[_0x7104('0x25')](respondWithResult(_0x55997a,null))[_0x7104('0x2c')](handleError(_0x55997a,null));};var getLicense=function(_0x569c93){return new BPromise(function(_0x17700b,_0x274e0d){var _0x2bd259=0x0;_0x569c93[_0x7104('0x67')][_0x7104('0x69')]===_0x7104('0x3c')&&_0x17700b(_0x7104('0x6f'));return db[_0x7104('0x48')][_0x7104('0x31')]({'where':{'$or':[{'role':_0x569c93[_0x7104('0x67')]['role']===_0x7104('0x3d')?'telephone':[_0x7104('0x70'),_0x7104('0x71')]}]}})[_0x7104('0x25')](function(_0x1ad7d4){_0x2bd259=_0x1ad7d4;return require('../../config/license/util')['getLicense']();})[_0x7104('0x25')](function(_0x33b41d){var _0x46aa31=_0x569c93['body']['role']===_0x7104('0x3d')?_0x7104('0x72'):'users';if(!_[_0x7104('0x73')](_0x33b41d[_0x46aa31])&&_0x2bd259>=_0x33b41d[_0x46aa31]){return _0x274e0d({'message':'License\x20limit\x20reached'});}return _0x17700b(util[_0x7104('0x74')](_0x7104('0x75'),_0x46aa31,_0x2bd259));})[_0x7104('0x2c')](function(_0x6cd68d){return _0x274e0d(_0x6cd68d);});});};exports['create']=function(_0x885c0e,_0x5c0080){return getLicense(_0x885c0e)[_0x7104('0x25')](function(_0x2dcda3){if(!_0x885c0e['body'][_0x7104('0x76')]){var _0x37aa0c;return db[_0x7104('0x77')]['findById'](0x1)[_0x7104('0x25')](function(_0x22ebc3){return checkPasswordPattern(_0x22ebc3,_0x885c0e['body']['password'],_0x22ebc3[_0x7104('0x78')]);})[_0x7104('0x25')](function(_0x1edb03){_0x37aa0c=_0x1edb03['min_internal'];return db[_0x7104('0x48')][_0x7104('0x79')](_0x7104('0x76'));})['then'](function(_0x830dbb){if(_[_0x7104('0x73')](_0x830dbb)){if(_0x37aa0c){_0x885c0e[_0x7104('0x67')][_0x7104('0x76')]=_0x37aa0c;}else{_0x885c0e['body']['internal']=0x1;}}else{if(_[_0x7104('0x73')](_0x37aa0c)||_0x37aa0c==_0x830dbb){_0x885c0e['body'][_0x7104('0x76')]=_0x830dbb+0x1;}else if(_0x37aa0c>_0x830dbb){_0x885c0e['body']['internal']=_0x37aa0c;}else{return db[_0x7104('0x5b')][_0x7104('0x50')](_0x7104('0x7a'),{'type':db[_0x7104('0x5b')]['QueryTypes'][_0x7104('0x7b')]})[_0x7104('0x25')](function(_0x5b7166){if(_0x5b7166&&_0x5b7166[_0x7104('0x65')]){for(var _0x5ad300=0x0,_0x756406=_0x5b7166['length'];_0x5ad300<_0x756406&&_[_0x7104('0x73')](_0x885c0e[_0x7104('0x67')]['internal']);_0x5ad300++){if(_0x37aa0c<=_0x5b7166[_0x5ad300]['from']){_0x885c0e[_0x7104('0x67')]['internal']=_0x5b7166[_0x5ad300][_0x7104('0x7c')];}else if(_0x37aa0c>_0x5b7166[_0x5ad300][_0x7104('0x7c')]&&_0x37aa0c<=_0x5b7166[_0x5ad300]['to']){_0x885c0e[_0x7104('0x67')]['internal']=_0x37aa0c;}}}if(_[_0x7104('0x73')](_0x885c0e[_0x7104('0x67')][_0x7104('0x76')])){_0x885c0e[_0x7104('0x67')][_0x7104('0x76')]=_0x830dbb+0x1;}});}}});}})['then'](function(){if(_0x885c0e[_0x7104('0x67')][_0x7104('0x7d')]){_0x885c0e[_0x7104('0x67')][_0x7104('0x7e')]=_0x885c0e['body']['internal'];_0x885c0e[_0x7104('0x67')][_0x7104('0x7f')]={'mailbox':_0x885c0e[_0x7104('0x67')][_0x7104('0x76')],'password':_0x885c0e[_0x7104('0x67')][_0x7104('0x4f')],'fullname':_0x885c0e['body'][_0x7104('0x80')],'email':_0x885c0e[_0x7104('0x67')][_0x7104('0x81')]};}if(_0x885c0e[_0x7104('0x67')]&&_0x885c0e[_0x7104('0x67')][_0x7104('0x69')]===_0x7104('0x3c')){if(!_0x885c0e[_0x7104('0x67')][_0x7104('0x82')]){_0x885c0e[_0x7104('0x67')][_0x7104('0x82')]=[_0x7104('0x83'),_0x7104('0x84'),_0x7104('0x85'),_0x7104('0x86'),_0x7104('0x87'),_0x7104('0x88'),'105',_0x7104('0x89'),'107',_0x7104('0x8a'),_0x7104('0x8b'),_0x7104('0x8c'),'111',_0x7104('0x8d')];}}return db[_0x7104('0x48')][_0x7104('0x8e')](_0x885c0e['body'],{'include':[{'model':db[_0x7104('0x7f')],'as':_0x7104('0x7f')}]});})[_0x7104('0x25')](function(_0x55446a){if(_0x885c0e[_0x7104('0x67')][_0x7104('0x69')]===_0x7104('0x71'))return _0x55446a;var _0x2bcf35=_0x885c0e[_0x7104('0x71')][_0x7104('0x39')]({'plain':!![]});if(!_0x2bcf35)throw new Error(_0x7104('0x8f'));if(_0x2bcf35[_0x7104('0x69')]===_0x7104('0x71')){var _0x22c224=_0x55446a[_0x7104('0x39')]({'plain':!![]});var _0x3b3bde=[{'name':_0x7104('0x3b'),'value':_0x7104('0x3c')},{'name':_0x7104('0x90'),'value':_0x7104('0x3d')}];var _0x197966=_[_0x7104('0x43')](_0x3b3bde,[_0x7104('0x41'),_0x22c224[_0x7104('0x69')]])[_0x7104('0x45')];return db['UserProfileSection']['find']({'where':{'name':_0x197966,'userProfileId':_0x2bcf35['userProfileId']},'raw':!![]})[_0x7104('0x25')](function(_0x42b230){if(_0x42b230&&_0x42b230[_0x7104('0x91')]===0x0){return db[_0x7104('0x92')]['create']({'name':_0x22c224[_0x7104('0x45')],'resourceId':_0x22c224['id'],'type':_0x42b230['name'],'sectionId':_0x42b230['id']},{})['then'](function(){return _0x55446a;});}else{return _0x55446a;}})[_0x7104('0x2c')](function(_0x457454){logger[_0x7104('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x457454);throw _0x457454;});}return _0x55446a;})[_0x7104('0x25')](respondWithResult(_0x5c0080,0xc9))[_0x7104('0x2c')](handleError(_0x5c0080,null));};exports[_0x7104('0x93')]=function(_0x3b11f1,_0x285a35,_0x189511){var _0x29cf3a=![];if(_0x3b11f1[_0x7104('0x67')]['id']){delete _0x3b11f1[_0x7104('0x67')]['id'];}return db[_0x7104('0x77')][_0x7104('0x94')]({'attributes':['id',_0x7104('0x78')]})['then'](function(_0x8b6024){_0x29cf3a=_0x8b6024['securePassword'];return db[_0x7104('0x48')]['find']({'where':{'id':_0x3b11f1[_0x7104('0x6a')]['id']}});})[_0x7104('0x25')](function(_0x4e25f0){if(_0x4e25f0){if(_0x4e25f0['id']==_0x3b11f1[_0x7104('0x71')]['id']){if(!_0x3b11f1[_0x7104('0x67')][_0x7104('0x95')]||!_0x3b11f1['body'][_0x7104('0x96')]){throw new db[(_0x7104('0x22'))]['ValidationError'](_0x7104('0x97'));}if(!_0x4e25f0[_0x7104('0x98')](_0x3b11f1[_0x7104('0x67')][_0x7104('0x95')])){throw new db[(_0x7104('0x22'))][(_0x7104('0x99'))]('Wrong\x20credentials');}if(_0x3b11f1[_0x7104('0x67')][_0x7104('0x95')]==_0x3b11f1['body']['newPassword']){throw new db[(_0x7104('0x22'))]['ValidationError'](_0x7104('0x9a'));}return _0x4e25f0;}else if(_0x3b11f1[_0x7104('0x71')][_0x7104('0x69')]==_0x7104('0x70')){if(!_0x3b11f1['body'][_0x7104('0x96')]){throw new db[(_0x7104('0x22'))][(_0x7104('0x99'))](_0x7104('0x9b'));}return _0x4e25f0;}else if(_0x3b11f1[_0x7104('0x71')][_0x7104('0x69')]==_0x7104('0x71')){if(!_0x3b11f1['body']['newPassword']){throw new db[(_0x7104('0x22'))][(_0x7104('0x99'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x4e25f0[_0x7104('0x69')]!='agent'){throw new db['Sequelize'][(_0x7104('0x99'))]('Unauthorized');}return _0x4e25f0;}else{throw new db[(_0x7104('0x22'))]['ValidationError'](_0x7104('0x9c'));}}return null;})['then'](handleEntityNotFound(_0x285a35,null))['then'](function(_0x474301){return checkPasswordPattern(_0x474301,_0x3b11f1[_0x7104('0x67')][_0x7104('0x96')],_0x29cf3a);})[_0x7104('0x25')](saveUpdates({'password':_0x3b11f1[_0x7104('0x67')][_0x7104('0x96')],'passwordResetAt':_0x3b11f1[_0x7104('0x71')]['id']==_0x3b11f1[_0x7104('0x6a')]['id']?moment():null},null))[_0x7104('0x25')](respondWithResult(_0x285a35,null))[_0x7104('0x2c')](handleError(_0x285a35,null));};exports[_0x7104('0x9d')]=function(_0x5982ed,_0x5bb0c5,_0x53b3a7){var _0x159ced=_0x5982ed[_0x7104('0x67')][_0x7104('0x9e')];return db['User'][_0x7104('0x43')]({'where':{'id':_0x5982ed[_0x7104('0x6a')]['id']},'attributes':['id',_0x7104('0x45'),'role',_0x7104('0x9f'),_0x7104('0xa0'),'voicePause',_0x7104('0xa1')]})['then'](handleEntityNotFound(_0x5bb0c5,null))['then'](function(_0x35e8f4){if(_0x35e8f4){if(!utils['isValidChannel'](_0x159ced)){throw new db['Sequelize'][(_0x7104('0x99'))]('Unknown\x20channel');}return _0x35e8f4[_0x7104('0xa2')+_[_0x7104('0xa3')](_0x159ced[_0x7104('0xa4')]())+_0x7104('0xa5')](_0x5982ed[_0x7104('0x67')][_0x7104('0x6d')],{'penalty':_0x5982ed[_0x7104('0x67')][_0x7104('0xa6')]||0x0})[_0x7104('0xa7')](function(_0x6f4c35){for(var _0x801ae=0x0;_0x801ae<_0x5982ed[_0x7104('0x67')]['ids'][_0x7104('0x65')];_0x801ae+=0x1){var _0x302563={'UserId':_0x5982ed[_0x7104('0x6a')]['id']};_0x302563[_[_0x7104('0xa3')](_0x159ced[_0x7104('0xa4')]())+_0x7104('0xa8')]=_0x5982ed['body']['ids'][_0x801ae];socket[_0x7104('0xa9')](_0x7104('0x71')+_[_0x7104('0xa3')](_0x159ced[_0x7104('0xa4')]())+_0x7104('0xaa'),_0x302563);}return _0x6f4c35;})[_0x7104('0x25')](function(){if(_0x159ced===_0x7104('0xab')){return db[_0x7104('0xac')][_0x7104('0x61')]({'where':{'id':_0x5982ed[_0x7104('0x67')][_0x7104('0x6d')]||[]},'raw':!![],'attributes':['id',_0x7104('0x45')]});}})['then'](function(_0x28e711){var _0x2a4b7e=_0x35e8f4[_0x7104('0x39')]({'plain':!![]});var _0x444e6a=[];if(_0x159ced===_0x7104('0xab')&&_0x2a4b7e[_0x7104('0x69')]===_0x7104('0x3c')&&_0x2a4b7e[_0x7104('0x9f')]){for(var _0x235116=0x0;_0x235116<_0x28e711[_0x7104('0x65')];_0x235116+=0x1){_0x444e6a['push']({'membername':_0x2a4b7e[_0x7104('0x45')],'UserId':_0x2a4b7e['id'],'queue_name':_0x28e711[_0x235116]['name'],'VoiceQueueId':_0x28e711[_0x235116]['id'],'interface':_[_0x7104('0x73')](_0x2a4b7e[_0x7104('0xa1')])?util[_0x7104('0x74')](_0x7104('0xad'),_0x2a4b7e['name']):_0x2a4b7e['interface'],'paused':_0x2a4b7e[_0x7104('0xae')]||![],'penalty':_0x5982ed['body'][_0x7104('0xa6')]||0x0});}return BPromise[_0x7104('0xaf')](_0x444e6a,function(_0x53bed1){return db[_0x7104('0xb0')]['upsert'](_0x53bed1);});}return _0x35e8f4;});}})[_0x7104('0x25')](respondWithStatusCode(_0x5bb0c5,null))[_0x7104('0x2c')](handleError(_0x5bb0c5,null));};exports[_0x7104('0xb1')]=function(_0x1e1b84,_0x31534a,_0x484c73){var _0x4edeb2;return db[_0x7104('0x48')][_0x7104('0x43')]({'where':{'id':_0x1e1b84[_0x7104('0x6a')]['id']},'attributes':['id',_0x7104('0x45'),_0x7104('0x69')]})['then'](handleEntityNotFound(_0x31534a,null))[_0x7104('0x25')](function(_0x183490){if(_0x183490){_0x4edeb2=_0x183490;if(!_0x1e1b84[_0x7104('0x50')]['channel']||!utils[_0x7104('0xb2')](_0x1e1b84['query'][_0x7104('0x9e')])){throw new db[(_0x7104('0x22'))]['ValidationError'](_0x7104('0xb3'));}return _0x183490[_0x7104('0xb4')+_['capitalize'](_0x1e1b84[_0x7104('0x50')]['channel']['toLowerCase']())+_0x7104('0xa5')](_0x1e1b84[_0x7104('0x50')][_0x7104('0x6d')]);}})[_0x7104('0x25')](function(_0x5e674c){for(var _0x446fe4=0x0;_0x446fe4<_0x1e1b84[_0x7104('0x50')][_0x7104('0x6d')][_0x7104('0x65')];_0x446fe4+=0x1){var _0x14ee45={'UserId':_0x1e1b84[_0x7104('0x6a')]['id']};_0x14ee45[_[_0x7104('0xa3')](_0x1e1b84[_0x7104('0x50')][_0x7104('0x9e')]['toLowerCase']())+_0x7104('0xa8')]=_0x1e1b84[_0x7104('0x50')][_0x7104('0x6d')][_0x446fe4];socket['emit'](_0x7104('0x71')+_['capitalize'](_0x1e1b84[_0x7104('0x50')][_0x7104('0x9e')][_0x7104('0xa4')]())+_0x7104('0xb5'),_0x14ee45);}return _0x5e674c;})[_0x7104('0x25')](function(){if(_0x1e1b84[_0x7104('0x50')]['channel']===_0x7104('0xab')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x1e1b84[_0x7104('0x6a')]['id'],'VoiceQueueId':_0x1e1b84['query'][_0x7104('0x6d')]},'individualHooks':!![]})[_0x7104('0x25')](function(){return _0x4edeb2;});}return _0x4edeb2;})[_0x7104('0x25')](respondWithStatusCode(_0x31534a,null))[_0x7104('0x2c')](handleError(_0x31534a,null));};exports[_0x7104('0xb6')]=function(_0x47cf4f,_0x52e840,_0x22d5af){_0x47cf4f[_0x7104('0x67')]['userpic']=_0x47cf4f[_0x7104('0xb7')][_0x7104('0xb8')];return db[_0x7104('0x48')][_0x7104('0x43')]({'where':{'id':_0x47cf4f[_0x7104('0x6a')]['id']}})[_0x7104('0x25')](handleEntityNotFound(_0x52e840,null))[_0x7104('0x25')](saveUpdates(_0x47cf4f[_0x7104('0x67')],null))[_0x7104('0x25')](respondWithResult(_0x52e840,null))[_0x7104('0x2c')](handleError(_0x52e840,null));};exports[_0x7104('0xb9')]=function(_0x1eb7c6,_0x1f844e,_0x8f4ca4){var _0x186125=path['join'](config['root'],'server/files/images/logos/default_profile.png');return db[_0x7104('0x48')]['find']({'where':{'id':_0x1eb7c6[_0x7104('0x6a')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0x7104('0x25')](handleEntityNotFound(_0x1f844e,null))[_0x7104('0x25')](function(_0x759f7a){if(_0x759f7a){if(_[_0x7104('0x73')](_0x759f7a['userpic'])){return _0x1f844e[_0x7104('0xba')](_0x186125);}else{if(!fs[_0x7104('0xbb')](path[_0x7104('0xbc')](config[_0x7104('0xbd')],_0x7104('0xbe'),_0x759f7a[_0x7104('0xbf')]))){return _0x1f844e[_0x7104('0xba')](_0x186125);}return _0x1f844e[_0x7104('0xba')](path[_0x7104('0xbc')](config[_0x7104('0xbd')],_0x7104('0xbe'),_0x759f7a[_0x7104('0xbf')]));}}})[_0x7104('0x2c')](handleError(_0x1f844e,null));};exports[_0x7104('0xc0')]=function(_0x45383a,_0x1c9439,_0x374029){var _0x2a4eae={};var _0x5644cd={};var _0x6c6600;var _0x33600a;return db[_0x7104('0x48')][_0x7104('0x94')]({'where':{'id':_0x45383a[_0x7104('0x6a')]['id']}})['then'](handleEntityNotFound(_0x1c9439,null))[_0x7104('0x25')](function(_0x14c772){if(_0x14c772){_0x6c6600=_0x14c772;_0x5644cd['model']=_[_0x7104('0x51')](db[_0x7104('0xc1')][_0x7104('0x49')]);_0x5644cd[_0x7104('0x50')]=_[_0x7104('0x51')](_0x45383a[_0x7104('0x50')]);_0x5644cd['filters']=_[_0x7104('0x53')](_0x5644cd['model'],_0x5644cd[_0x7104('0x50')]);_0x2a4eae[_0x7104('0x55')]=_[_0x7104('0x53')](_0x5644cd['model'],qs['fields'](_0x45383a['query'][_0x7104('0x54')]));_0x2a4eae[_0x7104('0x55')]=_0x2a4eae[_0x7104('0x55')][_0x7104('0x65')]?_0x2a4eae[_0x7104('0x55')]:_0x5644cd['model'];_0x2a4eae[_0x7104('0x57')]=qs[_0x7104('0x58')](_0x45383a[_0x7104('0x50')]['sort']);_0x2a4eae['where']=qs[_0x7104('0x52')](_[_0x7104('0xc2')](_0x45383a['query'],_0x5644cd[_0x7104('0x52')]));if(_0x45383a['query']['filter']){_0x2a4eae[_0x7104('0x59')]=_[_0x7104('0x5d')](_0x2a4eae[_0x7104('0x59')],{'$or':_[_0x7104('0x40')](_0x2a4eae[_0x7104('0x55')],function(_0x2b2424){var _0x293d07={};_0x293d07[_0x2b2424]={'$like':'%'+_0x45383a[_0x7104('0x50')][_0x7104('0x3e')]+'%'};return _0x293d07;})});}_0x2a4eae=_[_0x7104('0x5d')]({},_0x2a4eae,_0x45383a[_0x7104('0x5e')]);return _0x6c6600[_0x7104('0xc0')](_0x2a4eae);}})[_0x7104('0x25')](function(_0x9a6f9a){if(_0x9a6f9a){_0x33600a=_0x9a6f9a[_0x7104('0x65')];if(_0x45383a[_0x7104('0x50')][_0x7104('0x56')](_0x7104('0x5f'))){_0x2a4eae['include']=[{'model':db[_0x7104('0xc3')],'as':_0x7104('0xc4'),'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x7104('0x45'),_0x7104('0xc5')],'where':_0x45383a[_0x7104('0x50')][_0x7104('0xc6')]?{'id':_0x45383a[_0x7104('0x50')][_0x7104('0xc6')]}:undefined,'required':_0x45383a['query'][_0x7104('0xc6')]?!![]:![]}];}if(!_0x45383a[_0x7104('0x50')][_0x7104('0x56')](_0x7104('0xc7'))){_0x2a4eae[_0x7104('0x33')]=qs[_0x7104('0x33')](_0x45383a[_0x7104('0x50')][_0x7104('0x33')]);_0x2a4eae[_0x7104('0x32')]=qs['offset'](_0x45383a[_0x7104('0x50')][_0x7104('0x32')]);}return _0x6c6600[_0x7104('0xc0')](_0x2a4eae);}})[_0x7104('0x25')](function(_0x433a1d){if(_0x433a1d){return _0x433a1d?{'count':_0x33600a,'rows':_0x433a1d}:null;}})['then'](respondWithResult(_0x1c9439,null))['catch'](handleError(_0x1c9439,null));};exports[_0x7104('0xc8')]=function(_0x1d2629,_0xbe78c0,_0x5933b8){var _0x8dfb09;var _0x5b69bc;var _0x47db95={};var _0x4c8391;return db['User']['findOne']({'where':{'id':_0x1d2629['params']['id']},'attributes':['id',_0x7104('0x45'),_0x7104('0x69')]})[_0x7104('0x25')](handleEntityNotFound(_0xbe78c0,null))[_0x7104('0x25')](function(_0x1586f0){if(!utils['isValidChannel'](_0x1d2629[_0x7104('0x50')]['channel'])){throw new db[(_0x7104('0x22'))]['ValidationError']('Unknown\x20channel');}_0x8dfb09=_0x1586f0;var _0x20dda6={};_0x20dda6['model']=_[_0x7104('0x51')](db[_[_0x7104('0xa3')](_0x1d2629['query']['channel'])+_0x7104('0xc9')][_0x7104('0x49')]);_0x20dda6['query']=_[_0x7104('0x51')](_0x1d2629[_0x7104('0x50')]);_0x20dda6[_0x7104('0x52')]=_[_0x7104('0x53')](_0x20dda6[_0x7104('0x4d')],_0x20dda6[_0x7104('0x50')]);_0x47db95['attributes']=_[_0x7104('0x53')](_0x20dda6['model'],qs[_0x7104('0x54')](_0x1d2629[_0x7104('0x50')][_0x7104('0x54')]));_0x47db95[_0x7104('0x55')]=_0x47db95[_0x7104('0x55')][_0x7104('0x65')]?_0x47db95['attributes']:_0x20dda6[_0x7104('0x4d')];_0x47db95[_0x7104('0x57')]=qs['sort'](_0x1d2629[_0x7104('0x50')][_0x7104('0x58')]);_0x47db95[_0x7104('0x59')]=qs[_0x7104('0x52')](_[_0x7104('0xc2')](_0x1d2629[_0x7104('0x50')],_0x20dda6[_0x7104('0x52')]));if(_0x1d2629[_0x7104('0x50')]['filter']){_0x47db95[_0x7104('0x59')]=_[_0x7104('0x5d')](_0x47db95[_0x7104('0x59')],{'$or':_[_0x7104('0x40')](_0x47db95[_0x7104('0x55')],function(_0x44fa39){var _0x11d795={};_0x11d795[_0x44fa39]={'$like':'%'+_0x1d2629[_0x7104('0x50')][_0x7104('0x3e')]+'%'};return _0x11d795;})});}_0x47db95=_['merge']({},_0x47db95,_0x1d2629[_0x7104('0x5e')]);switch(_0x8dfb09[_0x7104('0x69')]){case _0x7104('0x70'):return db[_['capitalize'](_0x1d2629[_0x7104('0x50')][_0x7104('0x9e')])+_0x7104('0xc9')][_0x7104('0x61')](_0x47db95);case _0x7104('0x71'):case _0x7104('0x3c'):return _0x8dfb09[_0x7104('0x39')+_['capitalize'](_0x1d2629[_0x7104('0x50')][_0x7104('0x9e')])+_0x7104('0xa5')](_0x47db95);default:throw new db[(_0x7104('0x22'))][(_0x7104('0x99'))](_0x7104('0xca'));}})[_0x7104('0x25')](function(_0x273ff1){_0x4c8391=_0x273ff1[_0x7104('0x65')];if(!_0x1d2629['query'][_0x7104('0x56')](_0x7104('0xc7'))){_0x47db95['limit']=qs['limit'](_0x1d2629[_0x7104('0x50')][_0x7104('0x33')]);_0x47db95[_0x7104('0x32')]=qs[_0x7104('0x32')](_0x1d2629[_0x7104('0x50')][_0x7104('0x32')]);}switch(_0x8dfb09[_0x7104('0x69')]){case _0x7104('0x70'):return db[_[_0x7104('0xa3')](_0x1d2629[_0x7104('0x50')][_0x7104('0x9e')])+'Queue'][_0x7104('0x61')](_0x47db95);case _0x7104('0x71'):case _0x7104('0x3c'):return _0x8dfb09[_0x7104('0x39')+_[_0x7104('0xa3')](_0x1d2629[_0x7104('0x50')][_0x7104('0x9e')])+_0x7104('0xa5')](_0x47db95);}})[_0x7104('0x25')](function(_0x4c8db0){return{'count':_0x4c8391,'rows':_0x4c8db0};})[_0x7104('0x25')](respondWithResult(_0xbe78c0,null))[_0x7104('0x2c')](handleError(_0xbe78c0,null));};exports[_0x7104('0xcb')]=function(_0x32f11f,_0x59d0a8,_0x2e578e){var _0x1541d3={};var _0x782c68={};var _0x3982fb;var _0x263e6d;return db[_0x7104('0x48')]['findOne']({'where':{'id':_0x32f11f[_0x7104('0x6a')]['id']}})['then'](handleEntityNotFound(_0x59d0a8,null))[_0x7104('0x25')](function(_0x404bf7){if(_0x404bf7){_0x3982fb=_0x404bf7;_0x782c68[_0x7104('0x4d')]=_['keys'](db[_0x7104('0xb0')][_0x7104('0x49')]);_0x782c68[_0x7104('0x50')]=_[_0x7104('0x51')](_0x32f11f[_0x7104('0x50')]);_0x782c68['filters']=_[_0x7104('0x53')](_0x782c68[_0x7104('0x4d')],_0x782c68[_0x7104('0x50')]);_0x1541d3[_0x7104('0x55')]=_[_0x7104('0x53')](_0x782c68[_0x7104('0x4d')],qs[_0x7104('0x54')](_0x32f11f[_0x7104('0x50')]['fields']));_0x1541d3[_0x7104('0x55')]=_0x1541d3[_0x7104('0x55')][_0x7104('0x65')]?_0x1541d3[_0x7104('0x55')]:_0x782c68[_0x7104('0x4d')];_0x1541d3['order']=qs[_0x7104('0x58')](_0x32f11f[_0x7104('0x50')][_0x7104('0x58')]);_0x1541d3['where']=qs[_0x7104('0x52')](_[_0x7104('0xc2')](_0x32f11f['query'],_0x782c68[_0x7104('0x52')]));if(_0x32f11f[_0x7104('0x50')][_0x7104('0x3e')]){_0x1541d3[_0x7104('0x59')]=_[_0x7104('0x5d')](_0x1541d3[_0x7104('0x59')],{'$or':_[_0x7104('0x40')](_0x1541d3['attributes'],function(_0x5c0edf){var _0x5e8e63={};_0x5e8e63[_0x5c0edf]={'$like':'%'+_0x32f11f[_0x7104('0x50')][_0x7104('0x3e')]+'%'};return _0x5e8e63;})});}_0x1541d3=_[_0x7104('0x5d')]({},_0x1541d3,_0x32f11f[_0x7104('0x5e')]);return _0x3982fb[_0x7104('0xcb')](_0x1541d3);}})[_0x7104('0x25')](function(_0x99b489){if(_0x99b489){_0x263e6d=_0x99b489['length'];if(!_0x32f11f[_0x7104('0x50')][_0x7104('0x56')]('nolimit')){_0x1541d3[_0x7104('0x33')]=qs['limit'](_0x32f11f[_0x7104('0x50')][_0x7104('0x33')]);_0x1541d3[_0x7104('0x32')]=qs['offset'](_0x32f11f['query']['offset']);}return _0x3982fb[_0x7104('0xcb')](_0x1541d3);}})[_0x7104('0x25')](function(_0x361934){if(_0x361934){return _0x361934?{'count':_0x263e6d,'rows':_0x361934}:null;}})[_0x7104('0x25')](respondWithResult(_0x59d0a8,null))[_0x7104('0x2c')](handleError(_0x59d0a8,null));};exports[_0x7104('0xcc')]=function(_0x101ebb,_0x23df85,_0x154368){var _0x58ac31={};var _0xafa408={};var _0x47ceac;var _0x24ffe0;return db['User'][_0x7104('0x94')]({'where':{'id':_0x101ebb[_0x7104('0x6a')]['id']}})['then'](handleEntityNotFound(_0x23df85,null))[_0x7104('0x25')](function(_0x2b3011){if(_0x2b3011){_0x47ceac=_0x2b3011;_0xafa408[_0x7104('0x4d')]=_[_0x7104('0x51')](db['ChatGroup']['rawAttributes']);_0xafa408[_0x7104('0x50')]=_['keys'](_0x101ebb['query']);_0xafa408[_0x7104('0x52')]=_[_0x7104('0x53')](_0xafa408[_0x7104('0x4d')],_0xafa408[_0x7104('0x50')]);_0x58ac31['attributes']=_[_0x7104('0x53')](_0xafa408[_0x7104('0x4d')],qs[_0x7104('0x54')](_0x101ebb['query'][_0x7104('0x54')]));_0x58ac31[_0x7104('0x55')]=_0x58ac31['attributes'][_0x7104('0x65')]?_0x58ac31[_0x7104('0x55')]:_0xafa408[_0x7104('0x4d')];_0x58ac31[_0x7104('0x57')]=qs[_0x7104('0x58')](_0x101ebb['query'][_0x7104('0x58')]);_0x58ac31[_0x7104('0x59')]=qs[_0x7104('0x52')](_[_0x7104('0xc2')](_0x101ebb['query'],_0xafa408[_0x7104('0x52')]));if(_0x101ebb[_0x7104('0x50')]['filter']){_0x58ac31['where']=_['merge'](_0x58ac31[_0x7104('0x59')],{'$or':_['map'](_0x58ac31['attributes'],function(_0x19c9a9){var _0xfc478a={};_0xfc478a[_0x19c9a9]={'$like':'%'+_0x101ebb[_0x7104('0x50')][_0x7104('0x3e')]+'%'};return _0xfc478a;})});}_0x58ac31=_[_0x7104('0x5d')]({},_0x58ac31,_0x101ebb[_0x7104('0x5e')]);return _0x47ceac[_0x7104('0xcc')](_0x58ac31);}})[_0x7104('0x25')](function(_0x2f2c2e){if(_0x2f2c2e){_0x24ffe0=_0x2f2c2e[_0x7104('0x65')];if(!_0x101ebb[_0x7104('0x50')][_0x7104('0x56')](_0x7104('0xc7'))){_0x58ac31['limit']=qs[_0x7104('0x33')](_0x101ebb[_0x7104('0x50')][_0x7104('0x33')]);_0x58ac31[_0x7104('0x32')]=qs['offset'](_0x101ebb[_0x7104('0x50')][_0x7104('0x32')]);}return _0x47ceac[_0x7104('0xcc')](_0x58ac31);}})[_0x7104('0x25')](function(_0x35f6b4){if(_0x35f6b4){return _0x35f6b4?{'count':_0x24ffe0,'rows':_0x35f6b4}:null;}})[_0x7104('0x25')](respondWithResult(_0x23df85,null))[_0x7104('0x2c')](handleError(_0x23df85,null));};exports[_0x7104('0xcd')]=function(_0x595241,_0x2afb94,_0x4fd538){var _0x3305ff={'raw':!![],'where':{}};var _0x18cde9={};var _0x385016={'count':0x0,'rows':[]};return db[_0x7104('0x48')][_0x7104('0x94')]({'where':{'id':_0x595241[_0x7104('0x6a')]['id']}})[_0x7104('0x25')](handleEntityNotFound(_0x2afb94,null))[_0x7104('0x25')](function(_0x2cf68b){if(_0x2cf68b){_0x18cde9[_0x7104('0x4d')]=_[_0x7104('0x51')](db[_0x7104('0xce')][_0x7104('0x49')]);_0x18cde9[_0x7104('0x50')]=_[_0x7104('0x51')](_0x595241['query']);_0x18cde9['filters']=_[_0x7104('0x53')](_0x18cde9[_0x7104('0x4d')],_0x18cde9[_0x7104('0x50')]);_0x3305ff[_0x7104('0x55')]=_[_0x7104('0x53')](_0x18cde9[_0x7104('0x4d')],qs['fields'](_0x595241[_0x7104('0x50')][_0x7104('0x54')]));_0x3305ff[_0x7104('0x55')]=_0x3305ff[_0x7104('0x55')]['length']?_0x3305ff['attributes']:_0x18cde9[_0x7104('0x4d')];if(!_0x595241[_0x7104('0x50')][_0x7104('0x56')](_0x7104('0xc7'))){_0x3305ff[_0x7104('0x33')]=qs[_0x7104('0x33')](_0x595241['query'][_0x7104('0x33')]);_0x3305ff[_0x7104('0x32')]=qs[_0x7104('0x32')](_0x595241[_0x7104('0x50')]['offset']);}_0x3305ff['order']=qs[_0x7104('0x58')](_0x595241[_0x7104('0x50')][_0x7104('0x58')]);_0x3305ff[_0x7104('0x59')]=qs['filters'](_[_0x7104('0xc2')](_0x595241['query'],_0x18cde9[_0x7104('0x52')]));_0x3305ff[_0x7104('0x59')][_0x7104('0xcf')]=_0x2cf68b['id'];if(_0x595241[_0x7104('0x50')][_0x7104('0x3e')]){_0x3305ff[_0x7104('0x59')]=_['merge'](_0x3305ff[_0x7104('0x59')],{'$or':_[_0x7104('0x40')](_0x3305ff['attributes'],function(_0xb5ab9a){var _0xce230c={};_0xce230c[_0xb5ab9a]={'$like':'%'+_0x595241[_0x7104('0x50')][_0x7104('0x3e')]+'%'};return _0xce230c;})});}_0x3305ff=_[_0x7104('0x5d')]({},_0x3305ff,_0x595241[_0x7104('0x5e')]);return db['VoiceRecording'][_0x7104('0x31')]({'where':_0x3305ff[_0x7104('0x59')]})[_0x7104('0x25')](function(_0x2bffff){_0x385016[_0x7104('0x31')]=_0x2bffff;if(_0x595241[_0x7104('0x50')][_0x7104('0x5f')]){_0x3305ff['include']=[{'all':!![]}];}return db['VoiceRecording'][_0x7104('0x61')](_0x3305ff);})[_0x7104('0x25')](function(_0xc6c481){_0x385016[_0x7104('0x62')]=_0xc6c481;return _0x385016;});}})[_0x7104('0x25')](respondWithFilteredResult(_0x2afb94,_0x3305ff))[_0x7104('0x2c')](handleError(_0x2afb94,null));};exports[_0x7104('0xd0')]=function(_0x58236f,_0xd65704,_0x30a830){var _0x222f14={'raw':!![],'where':{}};var _0x517282={};var _0x2da9de={'count':0x0,'rows':[]};return db[_0x7104('0x48')]['findOne']({'where':{'id':_0x58236f[_0x7104('0x6a')]['id']}})[_0x7104('0x25')](handleEntityNotFound(_0xd65704,null))[_0x7104('0x25')](function(_0x12ebb6){if(_0x12ebb6){_0x517282[_0x7104('0x4d')]=_['keys'](db['ScreenRecording'][_0x7104('0x49')]);_0x517282[_0x7104('0x50')]=_[_0x7104('0x51')](_0x58236f[_0x7104('0x50')]);_0x517282[_0x7104('0x52')]=_['intersection'](_0x517282[_0x7104('0x4d')],_0x517282[_0x7104('0x50')]);_0x222f14['attributes']=_[_0x7104('0x53')](_0x517282[_0x7104('0x4d')],qs['fields'](_0x58236f[_0x7104('0x50')]['fields']));_0x222f14[_0x7104('0x55')]=_0x222f14[_0x7104('0x55')][_0x7104('0x65')]?_0x222f14['attributes']:_0x517282['model'];if(!_0x58236f['query'][_0x7104('0x56')]('nolimit')){_0x222f14[_0x7104('0x33')]=qs[_0x7104('0x33')](_0x58236f[_0x7104('0x50')][_0x7104('0x33')]);_0x222f14[_0x7104('0x32')]=qs['offset'](_0x58236f[_0x7104('0x50')][_0x7104('0x32')]);}_0x222f14[_0x7104('0x57')]=qs[_0x7104('0x58')](_0x58236f[_0x7104('0x50')]['sort']);_0x222f14['where']=qs[_0x7104('0x52')](_[_0x7104('0xc2')](_0x58236f[_0x7104('0x50')],_0x517282['filters']));_0x222f14[_0x7104('0x59')][_0x7104('0xcf')]=_0x12ebb6['id'];if(_0x58236f[_0x7104('0x50')][_0x7104('0x3e')]){_0x222f14['where']=_[_0x7104('0x5d')](_0x222f14['where'],{'$or':_[_0x7104('0x40')](_0x222f14['attributes'],function(_0x53603d){var _0x526e99={};_0x526e99[_0x53603d]={'$like':'%'+_0x58236f[_0x7104('0x50')][_0x7104('0x3e')]+'%'};return _0x526e99;})});}_0x222f14=_[_0x7104('0x5d')]({},_0x222f14,_0x58236f[_0x7104('0x5e')]);return db[_0x7104('0xd1')][_0x7104('0x31')]({'where':_0x222f14['where']})[_0x7104('0x25')](function(_0x5124ea){_0x2da9de[_0x7104('0x31')]=_0x5124ea;if(_0x58236f[_0x7104('0x50')][_0x7104('0x5f')]){_0x222f14[_0x7104('0x60')]=[{'all':!![]}];}return db[_0x7104('0xd1')][_0x7104('0x61')](_0x222f14);})[_0x7104('0x25')](function(_0x21a256){_0x2da9de[_0x7104('0x62')]=_0x21a256;return _0x2da9de;});}})[_0x7104('0x25')](respondWithFilteredResult(_0xd65704,_0x222f14))[_0x7104('0x2c')](handleError(_0xd65704,null));};exports[_0x7104('0xd2')]=function(_0x2d8135,_0x3ee9d7,_0x5cada7){var _0xa1df35={};var _0x5c6ffa={};var _0x52ab67;var _0x3c1225;return db['User'][_0x7104('0x94')]({'where':{'id':_0x2d8135[_0x7104('0x6a')]['id']}})['then'](handleEntityNotFound(_0x3ee9d7,null))[_0x7104('0x25')](function(_0x589364){if(_0x589364){_0x52ab67=_0x589364;_0x5c6ffa[_0x7104('0x4d')]=_['keys'](db[_0x7104('0xd3')]['rawAttributes']);_0x5c6ffa[_0x7104('0x50')]=_[_0x7104('0x51')](_0x2d8135[_0x7104('0x50')]);_0x5c6ffa[_0x7104('0x52')]=_[_0x7104('0x53')](_0x5c6ffa[_0x7104('0x4d')],_0x5c6ffa[_0x7104('0x50')]);_0xa1df35[_0x7104('0x55')]=_[_0x7104('0x53')](_0x5c6ffa[_0x7104('0x4d')],qs['fields'](_0x2d8135[_0x7104('0x50')]['fields']));_0xa1df35[_0x7104('0x55')]=_0xa1df35[_0x7104('0x55')]['length']?_0xa1df35['attributes']:_0x5c6ffa[_0x7104('0x4d')];_0xa1df35[_0x7104('0x57')]=qs[_0x7104('0x58')](_0x2d8135[_0x7104('0x50')][_0x7104('0x58')]);_0xa1df35['where']=qs[_0x7104('0x52')](_['pick'](_0x2d8135['query'],_0x5c6ffa['filters']));if(_0x2d8135[_0x7104('0x50')]['filter']){_0xa1df35['where']=_[_0x7104('0x5d')](_0xa1df35[_0x7104('0x59')],{'$or':_[_0x7104('0x40')](_0xa1df35[_0x7104('0x55')],function(_0x460923){var _0x5197c4={};_0x5197c4[_0x460923]={'$like':'%'+_0x2d8135['query'][_0x7104('0x3e')]+'%'};return _0x5197c4;})});}_0xa1df35=_['merge']({},_0xa1df35,_0x2d8135[_0x7104('0x5e')]);return _0x52ab67[_0x7104('0xd2')](_0xa1df35);}})[_0x7104('0x25')](function(_0x26a082){if(_0x26a082){_0x3c1225=_0x26a082[_0x7104('0x65')];if(!_0x2d8135[_0x7104('0x50')][_0x7104('0x56')]('nolimit')){_0xa1df35['limit']=qs[_0x7104('0x33')](_0x2d8135[_0x7104('0x50')]['limit']);_0xa1df35['offset']=qs[_0x7104('0x32')](_0x2d8135[_0x7104('0x50')][_0x7104('0x32')]);}return _0x52ab67[_0x7104('0xd2')](_0xa1df35);}})['then'](function(_0x4ac6dd){if(_0x4ac6dd){return _0x4ac6dd?{'count':_0x3c1225,'rows':_0x4ac6dd}:null;}})[_0x7104('0x25')](respondWithResult(_0x3ee9d7,null))[_0x7104('0x2c')](handleError(_0x3ee9d7,null));};exports['getOpenchannelInteractions']=function(_0x563f4c,_0x5951ff,_0x53032d){var _0x23d557={};var _0x520bd3={};var _0x328d39;var _0x12a1fd;return db[_0x7104('0x48')][_0x7104('0x94')]({'where':{'id':_0x563f4c[_0x7104('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5951ff,null))[_0x7104('0x25')](function(_0x20a08d){if(_0x20a08d){_0x328d39=_0x20a08d;_0x520bd3[_0x7104('0x4d')]=_[_0x7104('0x51')](db[_0x7104('0xd4')]['rawAttributes']);_0x520bd3[_0x7104('0x50')]=_[_0x7104('0x51')](_0x563f4c[_0x7104('0x50')]);_0x520bd3[_0x7104('0x52')]=_[_0x7104('0x53')](_0x520bd3[_0x7104('0x4d')],_0x520bd3[_0x7104('0x50')]);_0x23d557[_0x7104('0x55')]=_['intersection'](_0x520bd3[_0x7104('0x4d')],qs[_0x7104('0x54')](_0x563f4c[_0x7104('0x50')]['fields']));_0x23d557[_0x7104('0x55')]=_0x23d557[_0x7104('0x55')][_0x7104('0x65')]?_0x23d557[_0x7104('0x55')]:_0x520bd3[_0x7104('0x4d')];_0x23d557['order']=qs[_0x7104('0x58')](_0x563f4c[_0x7104('0x50')]['sort']);_0x23d557['where']=qs['filters'](_[_0x7104('0xc2')](_0x563f4c[_0x7104('0x50')],_0x520bd3[_0x7104('0x52')]));if(_0x563f4c[_0x7104('0x50')][_0x7104('0x3e')]){_0x23d557['where']=_['merge'](_0x23d557[_0x7104('0x59')],{'$or':_[_0x7104('0x40')](_0x23d557[_0x7104('0x55')],function(_0x3f2be4){var _0xb46136={};_0xb46136[_0x3f2be4]={'$like':'%'+_0x563f4c[_0x7104('0x50')]['filter']+'%'};return _0xb46136;})});}_0x23d557=_[_0x7104('0x5d')]({},_0x23d557,_0x563f4c['options']);return _0x328d39[_0x7104('0xd5')](_0x23d557);}})[_0x7104('0x25')](function(_0x18d34b){if(_0x18d34b){_0x12a1fd=_0x18d34b[_0x7104('0x65')];if(!_0x563f4c[_0x7104('0x50')]['hasOwnProperty'](_0x7104('0xc7'))){_0x23d557[_0x7104('0x33')]=qs[_0x7104('0x33')](_0x563f4c[_0x7104('0x50')][_0x7104('0x33')]);_0x23d557['offset']=qs[_0x7104('0x32')](_0x563f4c[_0x7104('0x50')][_0x7104('0x32')]);}return _0x328d39[_0x7104('0xd5')](_0x23d557);}})[_0x7104('0x25')](function(_0x260862){if(_0x260862){return _0x260862?{'count':_0x12a1fd,'rows':_0x260862}:null;}})[_0x7104('0x25')](respondWithResult(_0x5951ff,null))[_0x7104('0x2c')](handleError(_0x5951ff,null));};exports[_0x7104('0xd6')]=function(_0x936688,_0x5816d6,_0xd3b2ee){var _0x3f356a={'raw':!![],'where':{}};var _0xf6d165={};var _0x532480={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x936688['params']['id']}})[_0x7104('0x25')](handleEntityNotFound(_0x5816d6,null))[_0x7104('0x25')](function(_0x39e514){if(_0x39e514){_0xf6d165[_0x7104('0x4d')]=_[_0x7104('0x51')](db[_0x7104('0xd7')]['rawAttributes']);_0xf6d165['query']=_[_0x7104('0x51')](_0x936688[_0x7104('0x50')]);_0xf6d165[_0x7104('0x52')]=_[_0x7104('0x53')](_0xf6d165['model'],_0xf6d165[_0x7104('0x50')]);_0x3f356a[_0x7104('0x55')]=_[_0x7104('0x53')](_0xf6d165[_0x7104('0x4d')],qs[_0x7104('0x54')](_0x936688[_0x7104('0x50')][_0x7104('0x54')]));_0x3f356a[_0x7104('0x55')]=_0x3f356a[_0x7104('0x55')][_0x7104('0x65')]?_0x3f356a[_0x7104('0x55')]:_0xf6d165['model'];if(!_0x936688[_0x7104('0x50')]['hasOwnProperty'](_0x7104('0xc7'))){_0x3f356a['limit']=qs[_0x7104('0x33')](_0x936688[_0x7104('0x50')]['limit']);_0x3f356a[_0x7104('0x32')]=qs[_0x7104('0x32')](_0x936688[_0x7104('0x50')][_0x7104('0x32')]);}_0x3f356a[_0x7104('0x57')]=qs[_0x7104('0x58')](_0x936688[_0x7104('0x50')]['sort']);_0x3f356a[_0x7104('0x59')]=qs[_0x7104('0x52')](_[_0x7104('0xc2')](_0x936688[_0x7104('0x50')],_0xf6d165[_0x7104('0x52')]));_0x3f356a['where']['UserId']=_0x39e514['id'];if(_0x936688['query'][_0x7104('0x3e')]){_0x3f356a[_0x7104('0x59')]=_['merge'](_0x3f356a[_0x7104('0x59')],{'$or':_['map'](_0x3f356a['attributes'],function(_0x25eb39){var _0x18351f={};_0x18351f[_0x25eb39]={'$like':'%'+_0x936688[_0x7104('0x50')][_0x7104('0x3e')]+'%'};return _0x18351f;})});}_0x3f356a=_[_0x7104('0x5d')]({},_0x3f356a,_0x936688[_0x7104('0x5e')]);return db['MailInteraction'][_0x7104('0x31')]({'where':_0x3f356a[_0x7104('0x59')]})[_0x7104('0x25')](function(_0x317d81){_0x532480[_0x7104('0x31')]=_0x317d81;if(_0x936688[_0x7104('0x50')][_0x7104('0x5f')]){_0x3f356a[_0x7104('0x60')]=[{'all':!![]}];}return db[_0x7104('0xd7')][_0x7104('0x61')](_0x3f356a);})[_0x7104('0x25')](function(_0x4d1d38){_0x532480['rows']=_0x4d1d38;return _0x532480;});}})[_0x7104('0x25')](respondWithFilteredResult(_0x5816d6,_0x3f356a))[_0x7104('0x2c')](handleError(_0x5816d6,null));};exports[_0x7104('0xd8')]=function(_0x5b3e07,_0x390755,_0x185b82){var _0x1397fd={};var _0x4fa481={};var _0x31c925;var _0x2aa416;return db[_0x7104('0x48')][_0x7104('0x94')]({'where':{'id':_0x5b3e07[_0x7104('0x6a')]['id']}})[_0x7104('0x25')](handleEntityNotFound(_0x390755,null))[_0x7104('0x25')](function(_0xf61cf7){if(_0xf61cf7){_0x31c925=_0xf61cf7;_0x4fa481[_0x7104('0x4d')]=_[_0x7104('0x51')](db[_0x7104('0xd9')][_0x7104('0x49')]);_0x4fa481[_0x7104('0x50')]=_['keys'](_0x5b3e07[_0x7104('0x50')]);_0x4fa481[_0x7104('0x52')]=_[_0x7104('0x53')](_0x4fa481[_0x7104('0x4d')],_0x4fa481[_0x7104('0x50')]);_0x1397fd[_0x7104('0x55')]=_['intersection'](_0x4fa481[_0x7104('0x4d')],qs[_0x7104('0x54')](_0x5b3e07[_0x7104('0x50')]['fields']));_0x1397fd[_0x7104('0x55')]=_0x1397fd['attributes']['length']?_0x1397fd['attributes']:_0x4fa481['model'];_0x1397fd[_0x7104('0x57')]=qs[_0x7104('0x58')](_0x5b3e07[_0x7104('0x50')][_0x7104('0x58')]);_0x1397fd[_0x7104('0x59')]=qs[_0x7104('0x52')](_[_0x7104('0xc2')](_0x5b3e07[_0x7104('0x50')],_0x4fa481[_0x7104('0x52')]));if(_0x5b3e07[_0x7104('0x50')][_0x7104('0x3e')]){_0x1397fd[_0x7104('0x59')]=_[_0x7104('0x5d')](_0x1397fd[_0x7104('0x59')],{'$or':_[_0x7104('0x40')](_0x1397fd[_0x7104('0x55')],function(_0x385112){var _0x487c46={};_0x487c46[_0x385112]={'$like':'%'+_0x5b3e07[_0x7104('0x50')][_0x7104('0x3e')]+'%'};return _0x487c46;})});}_0x1397fd=_[_0x7104('0x5d')]({},_0x1397fd,_0x5b3e07['options']);return _0x31c925[_0x7104('0xd8')](_0x1397fd);}})[_0x7104('0x25')](function(_0x4503d4){if(_0x4503d4){_0x2aa416=_0x4503d4['length'];if(!_0x5b3e07[_0x7104('0x50')][_0x7104('0x56')](_0x7104('0xc7'))){_0x1397fd[_0x7104('0x33')]=qs[_0x7104('0x33')](_0x5b3e07[_0x7104('0x50')]['limit']);_0x1397fd[_0x7104('0x32')]=qs[_0x7104('0x32')](_0x5b3e07[_0x7104('0x50')][_0x7104('0x32')]);}return _0x31c925['getSmsInteractions'](_0x1397fd);}})[_0x7104('0x25')](function(_0x2f2ae7){if(_0x2f2ae7){return _0x2f2ae7?{'count':_0x2aa416,'rows':_0x2f2ae7}:null;}})['then'](respondWithResult(_0x390755,null))[_0x7104('0x2c')](handleError(_0x390755,null));};exports[_0x7104('0xda')]=function(_0x5e765e,_0x29082c,_0x17fc17){var _0xa9a28b={};var _0x38e9d7={};var _0x36d1cf;var _0x565aa7;return db[_0x7104('0x48')][_0x7104('0x94')]({'where':{'id':_0x5e765e[_0x7104('0x6a')]['id']}})[_0x7104('0x25')](handleEntityNotFound(_0x29082c,null))['then'](function(_0x1d6f91){if(_0x1d6f91){_0x36d1cf=_0x1d6f91;_0x38e9d7[_0x7104('0x4d')]=_[_0x7104('0x51')](db[_0x7104('0xdb')][_0x7104('0x49')]);_0x38e9d7[_0x7104('0x50')]=_[_0x7104('0x51')](_0x5e765e['query']);_0x38e9d7[_0x7104('0x52')]=_[_0x7104('0x53')](_0x38e9d7[_0x7104('0x4d')],_0x38e9d7['query']);_0xa9a28b[_0x7104('0x55')]=_[_0x7104('0x53')](_0x38e9d7['model'],qs['fields'](_0x5e765e[_0x7104('0x50')][_0x7104('0x54')]));_0xa9a28b[_0x7104('0x55')]=_0xa9a28b['attributes'][_0x7104('0x65')]?_0xa9a28b['attributes']:_0x38e9d7[_0x7104('0x4d')];_0xa9a28b[_0x7104('0x57')]=qs['sort'](_0x5e765e[_0x7104('0x50')][_0x7104('0x58')]);_0xa9a28b['where']=qs['filters'](_['pick'](_0x5e765e[_0x7104('0x50')],_0x38e9d7['filters']));if(_0x5e765e['query'][_0x7104('0x3e')]){_0xa9a28b[_0x7104('0x59')]=_['merge'](_0xa9a28b['where'],{'$or':_[_0x7104('0x40')](_0xa9a28b['attributes'],function(_0x4c1651){var _0x5ae3ec={};_0x5ae3ec[_0x4c1651]={'$like':'%'+_0x5e765e['query'][_0x7104('0x3e')]+'%'};return _0x5ae3ec;})});}_0xa9a28b=_['merge']({},_0xa9a28b,_0x5e765e[_0x7104('0x5e')]);return _0x36d1cf[_0x7104('0xda')](_0xa9a28b);}})['then'](function(_0x44c3c2){if(_0x44c3c2){_0x565aa7=_0x44c3c2['length'];if(!_0x5e765e[_0x7104('0x50')][_0x7104('0x56')](_0x7104('0xc7'))){_0xa9a28b[_0x7104('0x33')]=qs[_0x7104('0x33')](_0x5e765e['query'][_0x7104('0x33')]);_0xa9a28b[_0x7104('0x32')]=qs[_0x7104('0x32')](_0x5e765e['query'][_0x7104('0x32')]);}return _0x36d1cf[_0x7104('0xda')](_0xa9a28b);}})[_0x7104('0x25')](function(_0x1a2764){if(_0x1a2764){return _0x1a2764?{'count':_0x565aa7,'rows':_0x1a2764}:null;}})[_0x7104('0x25')](respondWithResult(_0x29082c,null))['catch'](handleError(_0x29082c,null));};exports[_0x7104('0xdc')]=function(_0x5de25d,_0x1b4b52,_0x3747cf){var _0x54fd0d={};var _0x4cda6d={};var _0x9cb4c2;var _0x4306d3;return db[_0x7104('0x48')]['findOne']({'where':{'id':_0x5de25d[_0x7104('0x6a')]['id']}})[_0x7104('0x25')](handleEntityNotFound(_0x1b4b52,null))[_0x7104('0x25')](function(_0xa293db){if(_0xa293db){_0x9cb4c2=_0xa293db;_0x4cda6d[_0x7104('0x4d')]=_[_0x7104('0x51')](db[_0x7104('0xdd')][_0x7104('0x49')]);_0x4cda6d[_0x7104('0x50')]=_[_0x7104('0x51')](_0x5de25d[_0x7104('0x50')]);_0x4cda6d['filters']=_[_0x7104('0x53')](_0x4cda6d[_0x7104('0x4d')],_0x4cda6d[_0x7104('0x50')]);_0x54fd0d['attributes']=_[_0x7104('0x53')](_0x4cda6d['model'],qs['fields'](_0x5de25d[_0x7104('0x50')]['fields']));_0x54fd0d[_0x7104('0x55')]=_0x54fd0d[_0x7104('0x55')]['length']?_0x54fd0d[_0x7104('0x55')]:_0x4cda6d['model'];_0x54fd0d[_0x7104('0x57')]=qs['sort'](_0x5de25d['query'][_0x7104('0x58')]);_0x54fd0d[_0x7104('0x59')]=qs[_0x7104('0x52')](_[_0x7104('0xc2')](_0x5de25d[_0x7104('0x50')],_0x4cda6d[_0x7104('0x52')]));if(_0x5de25d[_0x7104('0x50')][_0x7104('0x3e')]){_0x54fd0d[_0x7104('0x59')]=_[_0x7104('0x5d')](_0x54fd0d[_0x7104('0x59')],{'$or':_[_0x7104('0x40')](_0x54fd0d['attributes'],function(_0x5454fb){var _0x13c182={};_0x13c182[_0x5454fb]={'$like':'%'+_0x5de25d[_0x7104('0x50')]['filter']+'%'};return _0x13c182;})});}_0x54fd0d=_[_0x7104('0x5d')]({},_0x54fd0d,_0x5de25d[_0x7104('0x5e')]);return _0x9cb4c2[_0x7104('0xdc')](_0x54fd0d);}})[_0x7104('0x25')](function(_0x40a33f){if(_0x40a33f){_0x4306d3=_0x40a33f[_0x7104('0x65')];if(!_0x5de25d[_0x7104('0x50')]['hasOwnProperty']('nolimit')){_0x54fd0d[_0x7104('0x33')]=qs[_0x7104('0x33')](_0x5de25d[_0x7104('0x50')][_0x7104('0x33')]);_0x54fd0d[_0x7104('0x32')]=qs[_0x7104('0x32')](_0x5de25d['query'][_0x7104('0x32')]);}return _0x9cb4c2[_0x7104('0xdc')](_0x54fd0d);}})[_0x7104('0x25')](function(_0x3e2445){if(_0x3e2445){return _0x3e2445?{'count':_0x4306d3,'rows':_0x3e2445}:null;}})['then'](respondWithResult(_0x1b4b52,null))[_0x7104('0x2c')](handleError(_0x1b4b52,null));};exports[_0x7104('0xde')]=function(_0x33e71e,_0xab3ee3,_0x15b87e){var _0x2c00a4;var _0x47629c;var _0x196bc3;var _0x445348=!_['isNil'](_0x33e71e[_0x7104('0x6a')]['id'])?_0x33e71e['params']['id']:!_[_0x7104('0x73')](_0x33e71e[_0x7104('0x71')]['id'])?_0x33e71e['user']['id']:null;return db['User']['find']({'where':{'id':_0x445348,'role':{'$or':[_0x7104('0x70'),_0x7104('0x71'),_0x7104('0x3c')]}},'attributes':['id','name',_0x7104('0xdf'),_0x7104('0xe0'),_0x7104('0x69'),_0x7104('0x76'),_0x7104('0xa0')]})[_0x7104('0x25')](function(_0x106b93){if(_0x106b93){if(_0x106b93[_0x7104('0x69')]===_0x7104('0x3c')){_0x2c00a4=_0x106b93;if(_0x33e71e[_0x7104('0x67')]['interface']){_0x196bc3=util[_0x7104('0x74')](_0x7104('0xe1'),_0x2c00a4[_0x33e71e['body'][_0x7104('0xa1')]]);}else if(_0x33e71e['body']['intrf']){_0x196bc3=util[_0x7104('0x74')]('SIP/%s',_0x33e71e['body'][_0x7104('0xe2')]);}else{_0x196bc3=util[_0x7104('0x74')](_0x7104('0xad'),_0x2c00a4[_0x7104('0x45')]);}socket['to'](util[_0x7104('0x74')](_0x7104('0xe3'),_0x2c00a4[_0x7104('0x45')]))[_0x7104('0xa9')](_0x7104('0xe4'),{'ip':_0x33e71e[_0x7104('0xe5')][_0x7104('0xe6')]||_0x33e71e['connection'][_0x7104('0xe7')]||_0x33e71e[_0x7104('0xe8')][_0x7104('0xe7')]||_0x33e71e['connection'][_0x7104('0xe8')]['remoteAddress']});return db[_0x7104('0xb0')][_0x7104('0x38')]({'where':{'membername':_0x2c00a4[_0x7104('0x45')]},'individualHooks':!![]});}}else{throw new db['Sequelize']['ValidationError'](_0x7104('0xe9'));}})[_0x7104('0x25')](function(){if(_0x2c00a4){return _0x2c00a4[_0x7104('0xea')]({'raw':!![]});}})[_0x7104('0x25')](function(_0x5daa8c){if(_0x2c00a4){var _0x463c35=[];if(_0x5daa8c){_0x47629c=_0x5daa8c;if(_0x47629c[_0x7104('0x65')]){for(var _0x56a8ad=0x0;_0x56a8ad<_0x47629c[_0x7104('0x65')];_0x56a8ad++){_0x463c35[_0x7104('0xeb')]({'membername':_0x2c00a4[_0x7104('0x45')],'UserId':_0x2c00a4['id'],'queue_name':_0x47629c[_0x56a8ad]['name'],'VoiceQueueId':_0x47629c[_0x56a8ad]['id'],'interface':_0x196bc3,'paused':_0x2c00a4[_0x7104('0xa0')]||![],'penalty':_0x47629c[_0x56a8ad]['UserVoiceQueue.penalty']||0x0});}return BPromise['each'](_0x463c35,function(_0x545587){return db[_0x7104('0xb0')][_0x7104('0xec')](_0x545587);});}}}})[_0x7104('0x25')](function(){if(_0x2c00a4){return db[_0x7104('0xed')][_0x7104('0x61')]({'where':{'membername':_0x2c00a4[_0x7104('0x45')],'exitAt':null}});}})[_0x7104('0x25')](function(_0xde43c9){if(_0x2c00a4){var _0x480b07=[];_0xde43c9[_0x7104('0xee')](function(_0x2f0733){_0x480b07[_0x7104('0xeb')](_0x2f0733[_0x7104('0x68')]({'exitAt':moment()[_0x7104('0x74')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x480b07);}})['then'](function(){if(_0x2c00a4){var _0x1f9e2a=[];var _0x308926=[];var _0x1184d2=utils[_0x7104('0xef')]();var _0x15be52={'membername':_0x2c00a4['name'],'interface':_0x196bc3,'enterAt':moment()[_0x7104('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x2c00a4[_0x7104('0x69')],'internal':_0x2c00a4[_0x7104('0x76')]};_0x1184d2[_0x7104('0xee')](function(_0x456469){_0x1f9e2a[_0x7104('0xeb')](_['merge']({'channel':_0x456469,'type':_0x7104('0xf0'),'data1':_0x33e71e[_0x7104('0x67')][_0x7104('0xf1')],'data2':_0x196bc3},_0x15be52));if(_0x2c00a4[_0x7104('0xa0')]){_0x308926[_0x7104('0xeb')](_[_0x7104('0x5d')]({'channel':_0x456469,'type':_0x7104('0xf2'),'data1':'LOGININPAUSE'},_0x15be52));}});return db[_0x7104('0xed')][_0x7104('0x66')](_0x1f9e2a[_0x7104('0xf3')](_0x308926),{'individualHooks':!![]});}})['then'](function(){if(_0x2c00a4){return _0x2c00a4[_0x7104('0x68')]({'online':!![],'lastLoginAt':moment()['format'](_0x7104('0xf4')),'voicePause':_0x2c00a4[_0x7104('0xa0')]||![],'mailPause':_0x2c00a4[_0x7104('0xa0')]||![],'chatPause':_0x2c00a4[_0x7104('0xa0')]||![],'faxPause':_0x2c00a4[_0x7104('0xa0')]||![],'smsPause':_0x2c00a4['loginInPause']||![],'openchannelPause':_0x2c00a4[_0x7104('0xa0')]||![],'whatsappPause':_0x2c00a4[_0x7104('0xa0')]||![],'pauseType':_0x2c00a4[_0x7104('0xa0')]?'LOGININPAUSE':null,'interface':_0x196bc3,'lastPauseAt':moment()[_0x7104('0x74')](_0x7104('0xf4'))});}})['then'](function(_0x4ccea5){if(_0x33e71e['isMiddleware']){return _0x15b87e();}else{return BPromise['resolve'](_0x4ccea5)['then'](respondWithResult(_0xab3ee3,null));}})[_0x7104('0x2c')](handleError(_0xab3ee3,null));};exports[_0x7104('0xf5')]=function(_0xb13bd6,_0x1c4797,_0x50ff00){var _0x58a633;return db[_0x7104('0x48')]['find']({'where':{'id':_0xb13bd6[_0x7104('0x6a')]['id'],'role':_0x7104('0x3c')},'attributes':['id',_0x7104('0x45'),_0x7104('0x69')]})[_0x7104('0x25')](handleEntityNotFound(_0x1c4797,null))[_0x7104('0x25')](function(_0x5d4bd8){if(_0x5d4bd8){_0x58a633=_0x5d4bd8;return db[_0x7104('0xb0')][_0x7104('0x38')]({'where':{'membername':_0x58a633['name']},'individualHooks':!![]});}})[_0x7104('0x25')](function(){return db['MemberReport'][_0x7104('0x61')]({'where':{'membername':_0x58a633[_0x7104('0x45')],'exitAt':null}});})[_0x7104('0x25')](function(_0x31554f){var _0x58e558=[];_0x31554f[_0x7104('0xee')](function(_0x50c2d7){_0x58e558[_0x7104('0xeb')](_0x50c2d7[_0x7104('0x68')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x58e558);})[_0x7104('0x25')](function(){return _0x58a633['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x7104('0x25')](respondWithResult(_0x1c4797,null))[_0x7104('0x2c')](handleError(_0x1c4797,null));};exports[_0x7104('0xf6')]=function(_0x4b35f1,_0x51945a,_0x5e0166){var _0x12bdb4;return db[_0x7104('0xb0')][_0x7104('0x68')]({'paused':0x1},{'where':{'UserId':_0x4b35f1[_0x7104('0x6a')]['id']},'individualHooks':!![]})[_0x7104('0x25')](function(){return db[_0x7104('0x48')][_0x7104('0x43')]({'where':{'id':_0x4b35f1[_0x7104('0x6a')]['id'],'role':_0x7104('0x3c')},'attributes':['id',_0x7104('0x45'),'role','internal',_0x7104('0xa1')]});})[_0x7104('0x25')](handleEntityNotFound(_0x51945a,null))['then'](function(_0x370063){if(_0x370063){_0x12bdb4=_0x370063;return respondWithRpcPromise(_0x7104('0xf7'),'pause',{'id':_0x12bdb4['id'],'name':_0x12bdb4['name'],'pause':!![]});}})['then'](function(){if(_0x12bdb4){return db[_0x7104('0xed')][_0x7104('0x61')]({'where':{'membername':_0x12bdb4['name'],'type':_0x7104('0xf2'),'exitAt':null}});}})[_0x7104('0x25')](function(_0x4af955){if(_0x4af955['length']){var _0x32adce=moment()[_0x7104('0x74')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x590fa9=0x0,_0x52629a=_0x4af955[_0x7104('0x65')];_0x590fa9<_0x52629a;_0x590fa9++){_0x4af955[_0x590fa9][_0x7104('0xf8')]({'exitAt':_0x32adce});}}})[_0x7104('0x25')](function(){var _0x582fff=[];var _0x2e2791=utils['getChannels']();_0x2e2791[_0x7104('0xee')](function(_0x4738d8){_0x582fff['push']({'channel':_0x4738d8,'membername':_0x12bdb4[_0x7104('0x45')],'interface':_[_0x7104('0x73')](_0x12bdb4[_0x7104('0xa1')])?util[_0x7104('0x74')](_0x7104('0xad'),_0x12bdb4[_0x7104('0x45')]):_0x12bdb4[_0x7104('0xa1')],'type':_0x7104('0xf2'),'enterAt':moment()[_0x7104('0x74')](_0x7104('0xf4')),'data1':_0x4b35f1[_0x7104('0x67')][_0x7104('0x4b')]||_0x7104('0xf9'),'role':_0x12bdb4[_0x7104('0x69')],'internal':_0x12bdb4['internal']});});return db[_0x7104('0xed')][_0x7104('0x66')](_0x582fff,{'individualHooks':!![]});})[_0x7104('0x25')](function(){return _0x12bdb4['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x4b35f1[_0x7104('0x67')][_0x7104('0x4b')]||_0x7104('0xf9'),'lastPauseAt':moment()[_0x7104('0x74')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x7104('0x25')](respondWithResult(_0x51945a,null))[_0x7104('0x2c')](handleError(_0x51945a,null));};exports['unpause']=function(_0x13db97,_0x35dab8,_0x57675c){var _0x393e21;return db[_0x7104('0x48')][_0x7104('0x43')]({'where':{'id':_0x13db97['params']['id']},'attributes':['id',_0x7104('0x45'),'role','voicePause','mailPause','chatPause',_0x7104('0xfa'),_0x7104('0xfb'),_0x7104('0xfc'),_0x7104('0xfd'),_0x7104('0xfe'),_0x7104('0xff')]})[_0x7104('0x25')](handleEntityNotFound(_0x35dab8,null))[_0x7104('0x25')](function(_0x328bc1){if(_0x328bc1){_0x393e21=_0x328bc1;if(_0x13db97['body'][_0x7104('0x9e')]&&!utils[_0x7104('0xb2')](_0x13db97[_0x7104('0x67')]['channel'])){throw new db[(_0x7104('0x22'))][(_0x7104('0x99'))](_0x7104('0xb3'));}switch(_0x13db97[_0x7104('0x67')]['channel']){case _0x7104('0xab'):return respondWithRpcPromise('QueuePause',_0x7104('0x100'),{'id':_0x393e21['id'],'name':_0x393e21[_0x7104('0x45')],'pause':![]})[_0x7104('0x25')](function(){return db[_0x7104('0xb0')]['update']({'paused':0x0},{'where':{'UserId':_0x393e21['id']},'individualHooks':!![]});})[_0x7104('0x25')](function(){return db[_0x7104('0xed')][_0x7104('0x43')]({'where':{'channel':_0x13db97[_0x7104('0x67')][_0x7104('0x9e')],'membername':_0x393e21[_0x7104('0x45')],'type':_0x7104('0xf2'),'exitAt':null}});})[_0x7104('0x25')](function(_0x72c664){if(_0x72c664){return _0x72c664[_0x7104('0x68')]({'exitAt':moment()[_0x7104('0x74')](_0x7104('0xf4')),'data2':_0x7104('0x101')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x393e21[_0x7104('0x68')]({'voicePause':![]});});case _0x7104('0x102'):case _0x7104('0x103'):case _0x7104('0x104'):case _0x7104('0x105'):case _0x7104('0x106'):case _0x7104('0x107'):return db[_0x7104('0xed')]['find']({'where':{'channel':_0x13db97[_0x7104('0x67')][_0x7104('0x9e')],'membername':_0x393e21[_0x7104('0x45')],'type':_0x7104('0xf2'),'exitAt':null}})[_0x7104('0x25')](function(_0x5641e7){if(_0x5641e7){return _0x5641e7['update']({'exitAt':moment()[_0x7104('0x74')](_0x7104('0xf4')),'data2':_0x7104('0x101')},{'individualHooks':!![]});}return null;})[_0x7104('0x25')](function(){var _0x3af7ec={};_[_0x7104('0x34')](_0x3af7ec,util['format']('%s%s',_0x13db97['body'][_0x7104('0x9e')],'Pause'),![]);return _0x393e21[_0x7104('0x68')](_0x3af7ec);});default:return respondWithRpcPromise(_0x7104('0xf7'),_0x7104('0x100'),{'id':_0x393e21['id'],'name':_0x393e21[_0x7104('0x45')],'pause':![]})[_0x7104('0x25')](function(){return db['UserVoiceQueueRt'][_0x7104('0x68')]({'paused':0x0},{'where':{'UserId':_0x393e21['id']}});})[_0x7104('0x25')](function(){return db[_0x7104('0xed')][_0x7104('0x61')]({'where':{'membername':_0x393e21['name'],'type':_0x7104('0xf2'),'exitAt':null}});})['then'](function(_0x1f4420){var _0x3c4f50=[];_0x1f4420[_0x7104('0xee')](function(_0x27a843){_0x3c4f50[_0x7104('0xeb')](_0x27a843[_0x7104('0x68')]({'exitAt':moment()['format'](_0x7104('0xf4')),'data2':_0x7104('0x101')}));});return BPromise[_0x7104('0x108')](_0x3c4f50);})[_0x7104('0x25')](function(){return _0x393e21[_0x7104('0x68')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x7104('0x25')](respondWithResult(_0x35dab8,null))[_0x7104('0x2c')](handleError(_0x35dab8,null));};exports[_0x7104('0x109')]=function(_0x1dddd0,_0xc98fb9,_0x5072c2){var _0x14ac54={};var _0x265a86={};var _0x6cd36;var _0x3a1028;return db[_0x7104('0x48')][_0x7104('0x94')]({'where':{'id':_0x1dddd0[_0x7104('0x6a')]['id']}})[_0x7104('0x25')](handleEntityNotFound(_0xc98fb9,null))['then'](function(_0x1452e2){if(_0x1452e2){_0x6cd36=_0x1452e2;_0x265a86['model']=_['keys'](db[_0x7104('0x10a')][_0x7104('0x49')]);_0x265a86[_0x7104('0x50')]=_[_0x7104('0x51')](_0x1dddd0[_0x7104('0x50')]);_0x265a86[_0x7104('0x52')]=_[_0x7104('0x53')](_0x265a86[_0x7104('0x4d')],_0x265a86[_0x7104('0x50')]);_0x14ac54[_0x7104('0x55')]=_[_0x7104('0x53')](_0x265a86[_0x7104('0x4d')],qs[_0x7104('0x54')](_0x1dddd0['query']['fields']));_0x14ac54['attributes']=_0x14ac54['attributes'][_0x7104('0x65')]?_0x14ac54[_0x7104('0x55')]:_0x265a86['model'];_0x14ac54[_0x7104('0x57')]=qs[_0x7104('0x58')](_0x1dddd0[_0x7104('0x50')][_0x7104('0x58')]);_0x14ac54[_0x7104('0x59')]=qs[_0x7104('0x52')](_[_0x7104('0xc2')](_0x1dddd0['query'],_0x265a86[_0x7104('0x52')]));if(_0x1dddd0[_0x7104('0x50')][_0x7104('0x3e')]){_0x14ac54[_0x7104('0x59')]=_['merge'](_0x14ac54[_0x7104('0x59')],{'$or':_['map'](_0x14ac54[_0x7104('0x55')],function(_0x49177b){var _0x395333={};_0x395333[_0x49177b]={'$like':'%'+_0x1dddd0[_0x7104('0x50')][_0x7104('0x3e')]+'%'};return _0x395333;})});}_0x14ac54=_[_0x7104('0x5d')]({},_0x14ac54,_0x1dddd0[_0x7104('0x5e')]);return _0x6cd36['getTeams'](_0x14ac54);}})['then'](function(_0x35adf2){if(_0x35adf2){_0x3a1028=_0x35adf2[_0x7104('0x65')];if(!_0x1dddd0['query']['hasOwnProperty'](_0x7104('0xc7'))){_0x14ac54[_0x7104('0x33')]=qs['limit'](_0x1dddd0[_0x7104('0x50')][_0x7104('0x33')]);_0x14ac54['offset']=qs['offset'](_0x1dddd0['query'][_0x7104('0x32')]);}return _0x6cd36[_0x7104('0x109')](_0x14ac54);}})[_0x7104('0x25')](function(_0x5706b7){if(_0x5706b7){return _0x5706b7?{'count':_0x3a1028,'rows':_0x5706b7}:null;}})[_0x7104('0x25')](respondWithResult(_0xc98fb9,null))[_0x7104('0x2c')](handleError(_0xc98fb9,null));};exports['addTeams']=function(_0x41a045,_0xa3d98e){return db[_0x7104('0x48')][_0x7104('0x43')]({'where':{'id':_0x41a045['params']['id']}})[_0x7104('0x25')](handleEntityNotFound(_0xa3d98e,null))[_0x7104('0x25')](function(_0x325a6d){if(_0x325a6d){var _0x32edc8=_0x325a6d[_0x7104('0x39')]({'plain':!![]});return _0x325a6d['addTeams'](_0x41a045['body'][_0x7104('0x6d')],_[_0x7104('0x6e')](_0x41a045['body'],['ids','id'])||{})[_0x7104('0x25')](function(){for(var _0x4ec897=0x0;_0x4ec897<_0x41a045['body'][_0x7104('0x6d')][_0x7104('0x65')];_0x4ec897++){var _0x18f4df=[];db[_0x7104('0x10a')][_0x7104('0x94')]({'where':{'id':_0x41a045[_0x7104('0x67')]['ids'][_0x4ec897]}})[_0x7104('0x25')](function(_0x3b3e1a){_0x18f4df['push'](_0x3b3e1a[_0x7104('0xea')]()[_0x7104('0x25')](function(_0x3e6203){for(var _0x327334=0x0;_0x327334<_0x3e6203['length'];_0x327334++){_0x3e6203[_0x327334][_0x7104('0x10b')]('channel','Voice');}return _0x3e6203;}));_0x18f4df[_0x7104('0xeb')](_0x3b3e1a[_0x7104('0x10c')]()[_0x7104('0x25')](function(_0x2c9314){for(var _0x5bdd40=0x0;_0x5bdd40<_0x2c9314[_0x7104('0x65')];_0x5bdd40++){_0x2c9314[_0x5bdd40]['setDataValue'](_0x7104('0x9e'),_0x7104('0x10d'));}return _0x2c9314;}));_0x18f4df[_0x7104('0xeb')](_0x3b3e1a[_0x7104('0x10e')]()[_0x7104('0x25')](function(_0x3c7738){for(var _0x4b3e99=0x0;_0x4b3e99<_0x3c7738['length'];_0x4b3e99++){_0x3c7738[_0x4b3e99][_0x7104('0x10b')](_0x7104('0x9e'),_0x7104('0x10f'));}return _0x3c7738;}));_0x18f4df[_0x7104('0xeb')](_0x3b3e1a[_0x7104('0x110')]()[_0x7104('0x25')](function(_0x556736){for(var _0xb59087=0x0;_0xb59087<_0x556736[_0x7104('0x65')];_0xb59087++){_0x556736[_0xb59087][_0x7104('0x10b')](_0x7104('0x9e'),'Sms');}return _0x556736;}));_0x18f4df[_0x7104('0xeb')](_0x3b3e1a[_0x7104('0x111')]()['then'](function(_0xf71ce8){for(var _0x4e707e=0x0;_0x4e707e<_0xf71ce8[_0x7104('0x65')];_0x4e707e++){_0xf71ce8[_0x4e707e][_0x7104('0x10b')](_0x7104('0x9e'),'Whatsapp');}return _0xf71ce8;}));_0x18f4df['push'](_0x3b3e1a[_0x7104('0x112')]()['then'](function(_0x25c529){for(var _0xb031f5=0x0;_0xb031f5<_0x25c529['length'];_0xb031f5++){_0x25c529[_0xb031f5][_0x7104('0x10b')](_0x7104('0x9e'),_0x7104('0x113'));}return _0x25c529;}));_0x18f4df[_0x7104('0xeb')](_0x3b3e1a['getOpenchannelQueues']()[_0x7104('0x25')](function(_0x300d5e){for(var _0x284004=0x0;_0x284004<_0x300d5e[_0x7104('0x65')];_0x284004++){_0x300d5e[_0x284004][_0x7104('0x10b')]('channel',_0x7104('0x114'));}return _0x300d5e;}));return BPromise[_0x7104('0x108')](_0x18f4df);})[_0x7104('0x25')](function(_0x28f500){var _0x1dda24=_[_0x7104('0x115')](_0x28f500);_0x18f4df=[];return db['sequelize']['transaction'](function(_0x138c9c){for(var _0x10fb97=0x0;_0x10fb97<_0x1dda24[_0x7104('0x65')];_0x10fb97++){_0x18f4df[_0x7104('0xeb')](_0x1dda24[_0x10fb97][_0x7104('0x116')](_0x32edc8['id']),{'transaction':_0x138c9c});}return BPromise[_0x7104('0x108')](_0x18f4df)[_0x7104('0x25')](function(){if(_0x32edc8[_0x7104('0x9f')]){return BPromise[_0x7104('0xaf')](_[_0x7104('0x3e')](_0x1dda24,function(_0x5c3ff5){return _0x5c3ff5[_0x7104('0x117')](_0x7104('0x9e'))===_0x7104('0x118');}),function(_0xc78d1f){return db[_0x7104('0xb0')]['upsert']({'membername':_0x32edc8[_0x7104('0x45')],'UserId':_0x32edc8['id'],'queue_name':_0xc78d1f[_0x7104('0x45')],'VoiceQueueId':_0xc78d1f['id'],'interface':_[_0x7104('0x73')](_0x32edc8['interface'])?util[_0x7104('0x74')](_0x7104('0xad'),_0x32edc8['name']):_0x32edc8[_0x7104('0xa1')],'paused':_0x32edc8['voicePause']||![],'penalty':_0x32edc8[_0x7104('0xa6')]},{'transaction':_0x138c9c});});}else{return;}})[_0x7104('0x25')](function(){for(var _0x411889=0x0;_0x411889<_0x1dda24[_0x7104('0x65')];_0x411889++){var _0x444c36=_0x1dda24[_0x411889][_0x7104('0x117')](_0x7104('0x9e'));var _0x586198=_0x444c36+_0x7104('0xa8');socket[_0x7104('0xa9')]('user'+_0x444c36+_0x7104('0xaa'),{'UserId':_0x32edc8['id'],['queueField']:_0x1dda24[_0x411889]['id']});}});});});}});}})[_0x7104('0x25')](respondWithStatusCode(_0xa3d98e,null))[_0x7104('0x2c')](handleError(_0xa3d98e,null));};exports['removeTeams']=function(_0x3ed4d8,_0x324c90){return db['User'][_0x7104('0x94')]({'where':{'id':_0x3ed4d8[_0x7104('0x6a')]['id']}})[_0x7104('0x25')](handleEntityNotFound(_0x324c90,null))[_0x7104('0x25')](function(_0x3093dc){if(_0x3093dc){var _0x18344d=_0x3093dc[_0x7104('0x39')]({'plain':!![]});var _0xe9c468=_0x3ed4d8['query'][_0x7104('0x6d')];return _0x3093dc[_0x7104('0x119')](_0xe9c468)[_0x7104('0x25')](function(){for(var _0x48c1aa=0x0;_0x48c1aa<_0xe9c468[_0x7104('0x65')];_0x48c1aa++){var _0x212ee1=[];db['Team']['findOne']({'where':{'id':_0xe9c468[_0x48c1aa]}})[_0x7104('0x25')](function(_0x4f6f16){_0x212ee1[_0x7104('0xeb')](_0x4f6f16[_0x7104('0xea')]()[_0x7104('0x25')](function(_0x58e397){for(var _0x285fde=0x0;_0x285fde<_0x58e397['length'];_0x285fde++){_0x58e397[_0x285fde][_0x7104('0x10b')](_0x7104('0x9e'),_0x7104('0x118'));}return _0x58e397;}));_0x212ee1['push'](_0x4f6f16[_0x7104('0x10c')]()['then'](function(_0x32e3ca){for(var _0x55a288=0x0;_0x55a288<_0x32e3ca[_0x7104('0x65')];_0x55a288++){_0x32e3ca[_0x55a288][_0x7104('0x10b')]('channel','Chat');}return _0x32e3ca;}));_0x212ee1[_0x7104('0xeb')](_0x4f6f16[_0x7104('0x10e')]()[_0x7104('0x25')](function(_0x3c3fa2){for(var _0x528988=0x0;_0x528988<_0x3c3fa2['length'];_0x528988++){_0x3c3fa2[_0x528988]['setDataValue'](_0x7104('0x9e'),_0x7104('0x10f'));}return _0x3c3fa2;}));_0x212ee1[_0x7104('0xeb')](_0x4f6f16[_0x7104('0x110')]()[_0x7104('0x25')](function(_0x1e179c){for(var _0x1400f4=0x0;_0x1400f4<_0x1e179c[_0x7104('0x65')];_0x1400f4++){_0x1e179c[_0x1400f4][_0x7104('0x10b')](_0x7104('0x9e'),_0x7104('0x11a'));}return _0x1e179c;}));_0x212ee1[_0x7104('0xeb')](_0x4f6f16[_0x7104('0x111')]()[_0x7104('0x25')](function(_0x3af9a8){for(var _0xfe3c27=0x0;_0xfe3c27<_0x3af9a8['length'];_0xfe3c27++){_0x3af9a8[_0xfe3c27]['setDataValue'](_0x7104('0x9e'),'Whatsapp');}return _0x3af9a8;}));_0x212ee1['push'](_0x4f6f16[_0x7104('0x112')]()[_0x7104('0x25')](function(_0x421c05){for(var _0x17bd4c=0x0;_0x17bd4c<_0x421c05[_0x7104('0x65')];_0x17bd4c++){_0x421c05[_0x17bd4c][_0x7104('0x10b')](_0x7104('0x9e'),_0x7104('0x113'));}return _0x421c05;}));_0x212ee1[_0x7104('0xeb')](_0x4f6f16[_0x7104('0x11b')]()['then'](function(_0x247c39){for(var _0x493c20=0x0;_0x493c20<_0x247c39[_0x7104('0x65')];_0x493c20++){_0x247c39[_0x493c20][_0x7104('0x10b')]('channel','Openchannel');}return _0x247c39;}));return BPromise[_0x7104('0x108')](_0x212ee1);})['then'](function(_0x1c8b85){var _0x4ec44a=_[_0x7104('0x115')](_0x1c8b85);_0x212ee1=[];return db['sequelize'][_0x7104('0x11c')](function(_0x4acabc){for(var _0x3b8505=0x0;_0x3b8505<_0x4ec44a[_0x7104('0x65')];_0x3b8505++){_0x212ee1[_0x7104('0xeb')](_0x4ec44a[_0x3b8505][_0x7104('0x11d')](_0x18344d['id']),{'transaction':_0x4acabc});}return BPromise[_0x7104('0x108')](_0x212ee1)[_0x7104('0x25')](function(){if(_0x18344d[_0x7104('0x9f')]){return BPromise[_0x7104('0xaf')](_[_0x7104('0x3e')](_0x4ec44a,function(_0x46677e){return _0x46677e[_0x7104('0x117')](_0x7104('0x9e'))===_0x7104('0x118');}),function(_0x4ea5fb){return db[_0x7104('0xb0')][_0x7104('0x38')]({'where':{'VoiceQueueId':_0x4ea5fb['id'],'UserId':_0x18344d['id']},'transaction':_0x4acabc});});}else{return;}})[_0x7104('0x25')](function(){for(var _0x41b6c2=0x0;_0x41b6c2<_0x4ec44a[_0x7104('0x65')];_0x41b6c2++){var _0x26e6d1=_0x4ec44a[_0x41b6c2][_0x7104('0x117')](_0x7104('0x9e'));var _0x57169b=_0x26e6d1+'QueueId';socket['emit'](_0x7104('0x71')+_0x26e6d1+_0x7104('0xb5'),{'UserId':_0x18344d['id'],['queueField']:_0x4ec44a[_0x41b6c2]['id']});}});});});}});}})[_0x7104('0x25')](respondWithStatusCode(_0x324c90,null))[_0x7104('0x2c')](handleError(_0x324c90,null));};exports['getLists']=function(_0x42402f,_0x10f5f9,_0xf74f){var _0xcb8c94={};var _0x7993a9={};var _0x53b904;var _0xc6674a;return db[_0x7104('0x48')][_0x7104('0x94')]({'where':{'id':_0x42402f['params']['id']}})[_0x7104('0x25')](handleEntityNotFound(_0x10f5f9,null))[_0x7104('0x25')](function(_0xb9325){if(_0xb9325){_0x53b904=_0xb9325;_0x7993a9[_0x7104('0x4d')]=_['keys'](db[_0x7104('0xc3')][_0x7104('0x49')]);_0x7993a9['query']=_[_0x7104('0x51')](_0x42402f[_0x7104('0x50')]);_0x7993a9[_0x7104('0x52')]=_[_0x7104('0x53')](_0x7993a9[_0x7104('0x4d')],_0x7993a9[_0x7104('0x50')]);_0xcb8c94['attributes']=_[_0x7104('0x53')](_0x7993a9['model'],qs[_0x7104('0x54')](_0x42402f['query'][_0x7104('0x54')]));_0xcb8c94['attributes']=_0xcb8c94[_0x7104('0x55')]['length']?_0xcb8c94[_0x7104('0x55')]:_0x7993a9[_0x7104('0x4d')];_0xcb8c94['order']=qs[_0x7104('0x58')](_0x42402f['query']['sort']);_0xcb8c94[_0x7104('0x59')]=qs['filters'](_[_0x7104('0xc2')](_0x42402f['query'],_0x7993a9[_0x7104('0x52')]));if(_0x42402f[_0x7104('0x50')][_0x7104('0x3e')]){_0xcb8c94[_0x7104('0x59')]=_[_0x7104('0x5d')](_0xcb8c94[_0x7104('0x59')],{'$or':_[_0x7104('0x40')](_0xcb8c94['attributes'],function(_0x4c889a){var _0x9db26e={};_0x9db26e[_0x4c889a]={'$like':'%'+_0x42402f[_0x7104('0x50')]['filter']+'%'};return _0x9db26e;})});}_0xcb8c94=_[_0x7104('0x5d')]({},_0xcb8c94,_0x42402f[_0x7104('0x5e')]);return _0x53b904['getLists'](_0xcb8c94);}})[_0x7104('0x25')](function(_0x179cc2){if(_0x179cc2){_0xc6674a=_0x179cc2['length'];if(!_0x42402f[_0x7104('0x50')][_0x7104('0x56')]('nolimit')){_0xcb8c94['limit']=qs[_0x7104('0x33')](_0x42402f['query'][_0x7104('0x33')]);_0xcb8c94[_0x7104('0x32')]=qs[_0x7104('0x32')](_0x42402f[_0x7104('0x50')][_0x7104('0x32')]);}return _0x53b904['getLists'](_0xcb8c94);}})[_0x7104('0x25')](function(_0x4cf3b2){if(_0x4cf3b2){return _0x4cf3b2?{'count':_0xc6674a,'rows':_0x4cf3b2}:null;}})[_0x7104('0x25')](respondWithResult(_0x10f5f9,null))[_0x7104('0x2c')](handleError(_0x10f5f9,null));};exports[_0x7104('0x11e')]=function(_0x4d9067,_0x5ae778,_0x2595d9){var _0x40c7d1={};var _0xd48da6={};var _0x266609;var _0x3437b2;return db[_0x7104('0x48')][_0x7104('0x94')]({'where':{'id':_0x4d9067[_0x7104('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5ae778,null))[_0x7104('0x25')](function(_0x53ef68){if(_0x53ef68){_0x266609=_0x53ef68;_0xd48da6['model']=_[_0x7104('0x51')](db['User'][_0x7104('0x49')]);_0xd48da6[_0x7104('0x50')]=_['keys'](_0x4d9067['query']);_0xd48da6['filters']=_[_0x7104('0x53')](_0xd48da6['model'],_0xd48da6['query']);_0x40c7d1[_0x7104('0x55')]=_[_0x7104('0x53')](_0xd48da6[_0x7104('0x4d')],qs[_0x7104('0x54')](_0x4d9067[_0x7104('0x50')][_0x7104('0x54')]));_0x40c7d1['attributes']=_0x40c7d1['attributes']['length']?_0x40c7d1[_0x7104('0x55')]:_0xd48da6[_0x7104('0x4d')];_0x40c7d1[_0x7104('0x57')]=qs['sort'](_0x4d9067[_0x7104('0x50')]['sort']);_0x40c7d1[_0x7104('0x59')]=qs[_0x7104('0x52')](_[_0x7104('0xc2')](_0x4d9067[_0x7104('0x50')],_0xd48da6[_0x7104('0x52')]));if(_0x4d9067['query'][_0x7104('0x3e')]){_0x40c7d1['where']=_['merge'](_0x40c7d1[_0x7104('0x59')],{'$or':_[_0x7104('0x40')](_0x40c7d1[_0x7104('0x55')],function(_0xe74311){var _0x156620={};_0x156620[_0xe74311]={'$like':'%'+_0x4d9067[_0x7104('0x50')]['filter']+'%'};return _0x156620;})});}_0x40c7d1['model']=db[_0x7104('0x48')];_0x40c7d1['as']=_0x7104('0x3b');_0x40c7d1=_[_0x7104('0x5d')]({},_0x40c7d1,_0x4d9067[_0x7104('0x5e')]);return _0x266609[_0x7104('0xea')]({'include':[_0x40c7d1]});}})[_0x7104('0x25')](function(_0x2ff664){if(_0x2ff664){var _0x9b4e98={},_0xea6791=[],_0x1c17cc=0x0;for(var _0x5b1722=0x0;_0x5b1722<_0x2ff664[_0x7104('0x65')];_0x5b1722+=0x1){for(var _0x575085=0x0,_0x3bf461;_0x575085<_0x2ff664[_0x5b1722]['Agents'][_0x7104('0x65')];_0x575085+=0x1){_0x3bf461=_0x2ff664[_0x5b1722][_0x7104('0x3b')][_0x575085]['get']({'plain':!![]});_0x9b4e98[_0x3bf461['id']]=_0x3bf461;}}_0x9b4e98=_[_0x7104('0x11f')](_0x9b4e98);for(var _0x4f57c9=qs[_0x7104('0x32')](_0x4d9067[_0x7104('0x50')]['offset']);_0x4f57c9<_0x9b4e98['length']&&_0xea6791[_0x7104('0x65')]=_0x5b33e3){_0x404639=_0x5b33e3;_0x3cabef=0xc8;}else{_0x3cabef=0xce;}_0x10f097[_0x7722('0x2c')](_0x3cabef);return _0x10f097[_0x7722('0x30')](_0x7722('0x31'),_0x5adbb9+'-'+_0x404639+'/'+_0x5b33e3)['json'](_0x3b8995);}return null;};}function patchUpdates(_0xef5ecf){return function(_0x5caace){try{jsonpatch['apply'](_0x5caace,_0xef5ecf,!![]);}catch(_0x5c072b){return BPromise[_0x7722('0x32')](_0x5c072b);}return _0x5caace['save']();};}function saveUpdates(_0x4ef938,_0x3123b9){return function(_0x438de7){if(_0x438de7){return _0x438de7['update'](_0x4ef938)[_0x7722('0x33')](function(_0x2c4ab0){return _0x2c4ab0;});}return null;};}function removeEntity(_0x51093f,_0x219dab){return function(_0xe1169f){if(_0xe1169f){return _0xe1169f[_0x7722('0x34')]()['then'](function(){var _0xe55bad=_0xe1169f[_0x7722('0x35')]({'plain':!![]});var _0x4697ae=[{'name':'Users','value':'user','ignore':!![]},{'name':_0x7722('0x36'),'value':'agent','ignore':![]},{'name':_0x7722('0x37'),'value':'telephone','ignore':![]}];var _0x33edbd=_(_0x4697ae)['filter'](_0x7722('0x38'))['map'](_0x7722('0x39'))[_0x7722('0x39')]();if(_['includes'](_0x33edbd,_0xe55bad[_0x7722('0x3a')])){return;}var _0x3765be=_[_0x7722('0x3b')](_0x4697ae,[_0x7722('0x39'),_0xe55bad[_0x7722('0x3a')]])['name'];return db[_0x7722('0x3c')][_0x7722('0x34')]({'where':{'type':_0x3765be,'resourceId':_0xe55bad['id']}})[_0x7722('0x33')](function(){return _0xe1169f;});})['then'](function(){_0x51093f[_0x7722('0x2c')](0xcc)[_0x7722('0x2b')]();});}};}function handleEntityNotFound(_0x4b8cb4,_0x1ca126){return function(_0x275651){if(!_0x275651){_0x4b8cb4[_0x7722('0x3d')](0x194);}return _0x275651;};}function handleError(_0xc39286,_0x25400c){_0x25400c=_0x25400c||0x1f4;return function(_0x2a252d){logger[_0x7722('0x27')](_0x2a252d[_0x7722('0x3e')]);if(_0x2a252d[_0x7722('0x3f')]){delete _0x2a252d[_0x7722('0x3f')];}_0xc39286['status'](_0x25400c)[_0x7722('0x40')](_0x2a252d);};}exports[_0x7722('0x41')]=function(_0x1fd0af,_0x115504){var _0x2b0c82={},_0x2cf6a3={},_0xcfb951={'count':0x0,'rows':[]};var _0x3a2f26=_[_0x7722('0x42')](db['User'][_0x7722('0x43')],function(_0x420b6d){return{'name':_0x420b6d[_0x7722('0x44')],'type':_0x420b6d[_0x7722('0x45')][_0x7722('0x46')]};});_0x2cf6a3[_0x7722('0x47')]=_[_0x7722('0x48')](_[_0x7722('0x42')](_0x3a2f26,_0x7722('0x3f')),[_0x7722('0x49'),_0x7722('0x4a')]);_0x2cf6a3[_0x7722('0x4b')]=_[_0x7722('0x4c')](_0x1fd0af[_0x7722('0x4b')]);_0x2cf6a3['filters']=_[_0x7722('0x4d')](_0x2cf6a3[_0x7722('0x47')],_0x2cf6a3['query']);_0x2b0c82[_0x7722('0x4e')]=_[_0x7722('0x4d')](_0x2cf6a3[_0x7722('0x47')],qs['fields'](_0x1fd0af[_0x7722('0x4b')][_0x7722('0x4f')]));_0x2b0c82[_0x7722('0x4e')]=_0x2b0c82[_0x7722('0x4e')][_0x7722('0x50')]?_0x2b0c82['attributes']:_0x2cf6a3[_0x7722('0x47')];if(!_0x1fd0af[_0x7722('0x4b')][_0x7722('0x51')]('nolimit')){_0x2b0c82[_0x7722('0x2f')]=qs[_0x7722('0x2f')](_0x1fd0af['query'][_0x7722('0x2f')]);_0x2b0c82[_0x7722('0x2e')]=qs[_0x7722('0x2e')](_0x1fd0af[_0x7722('0x4b')][_0x7722('0x2e')]);}_0x2b0c82[_0x7722('0x52')]=qs[_0x7722('0x53')](_0x1fd0af[_0x7722('0x4b')]['sort']);_0x2b0c82[_0x7722('0x54')]=qs[_0x7722('0x55')](_[_0x7722('0x56')](_0x1fd0af[_0x7722('0x4b')],_0x2cf6a3[_0x7722('0x55')]),_0x3a2f26);if(_0x1fd0af[_0x7722('0x4b')]['filter']){_0x2b0c82[_0x7722('0x54')]=_[_0x7722('0x57')](_0x2b0c82[_0x7722('0x54')],{'$or':_[_0x7722('0x42')](_0x3a2f26,function(_0x4902cb){if(_0x4902cb[_0x7722('0x45')]!==_0x7722('0x58')){return db[_0x7722('0x59')][_0x7722('0x54')](db[_0x7722('0x59')]['fn'](_0x7722('0x5a'),db['sequelize'][_0x7722('0x5b')](_0x4902cb[_0x7722('0x3f')])),{'$like':db[_0x7722('0x59')]['fn']('lower','%'+_0x1fd0af[_0x7722('0x4b')]['filter']+'%')});}})});}_0x2b0c82=_[_0x7722('0x57')]({},_0x2b0c82,_0x1fd0af[_0x7722('0x5c')]);var _0x160b05={'where':_0x2b0c82[_0x7722('0x54')]};return db['User'][_0x7722('0x5d')](_0x160b05)[_0x7722('0x33')](function(_0x465350){_0xcfb951[_0x7722('0x5d')]=_0x465350;if(_0x1fd0af[_0x7722('0x4b')][_0x7722('0x5e')]){_0x2b0c82[_0x7722('0x5f')]=[{'all':!![]}];}return db[_0x7722('0x60')][_0x7722('0x61')](_0x2b0c82);})[_0x7722('0x33')](function(_0x3d7bde){_0xcfb951[_0x7722('0x62')]=_0x3d7bde;return _0xcfb951;})['then'](respondWithFilteredResult(_0x115504,_0x2b0c82))[_0x7722('0x2a')](handleError(_0x115504,null));};exports[_0x7722('0x63')]=function(_0x11a3a2,_0x3b3705){var _0x1e3638={'raw':![],'where':{'id':_0x11a3a2[_0x7722('0x64')]['id']}},_0x250c82={};_0x250c82['model']=_[_0x7722('0x48')](_[_0x7722('0x4c')](db[_0x7722('0x60')][_0x7722('0x43')]),[_0x7722('0x49'),_0x7722('0x4a')]);_0x250c82['query']=_[_0x7722('0x4c')](_0x11a3a2[_0x7722('0x4b')]);_0x250c82[_0x7722('0x55')]=_[_0x7722('0x4d')](_0x250c82[_0x7722('0x47')],_0x250c82[_0x7722('0x4b')]);_0x1e3638['attributes']=_['intersection'](_0x250c82['model'],qs[_0x7722('0x4f')](_0x11a3a2[_0x7722('0x4b')][_0x7722('0x4f')]));_0x1e3638[_0x7722('0x4e')]=_0x1e3638[_0x7722('0x4e')]['length']?_0x1e3638[_0x7722('0x4e')]:_0x250c82['model'];if(_0x11a3a2[_0x7722('0x4b')][_0x7722('0x5e')]){_0x1e3638['include']=[{'all':!![]}];}_0x1e3638=_['merge']({},_0x1e3638,_0x11a3a2['options']);return db[_0x7722('0x60')][_0x7722('0x3b')](_0x1e3638)[_0x7722('0x33')](handleEntityNotFound(_0x3b3705,null))[_0x7722('0x33')](respondWithResult(_0x3b3705,null))['catch'](handleError(_0x3b3705,null));};exports[_0x7722('0x65')]=function(_0x2e2a17,_0x589d72){return db[_0x7722('0x60')][_0x7722('0x65')](_0x2e2a17[_0x7722('0x66')],{'raw':![],'individualHooks':!![]})[_0x7722('0x33')](respondWithResult(_0x589d72,0xc9))[_0x7722('0x2a')](handleError(_0x589d72,null));};exports[_0x7722('0x67')]=function(_0x23d9e6,_0x51119d){if(_0x23d9e6[_0x7722('0x66')]['id']){delete _0x23d9e6[_0x7722('0x66')]['id'];}delete _0x23d9e6[_0x7722('0x66')][_0x7722('0x3a')];return db[_0x7722('0x60')]['find']({'where':{'id':_0x23d9e6[_0x7722('0x64')]['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x51119d,null))['then'](saveUpdates(_0x23d9e6[_0x7722('0x66')],null))[_0x7722('0x33')](respondWithResult(_0x51119d,null))[_0x7722('0x2a')](handleError(_0x51119d,null));};exports['describe']=function(_0x1ef10f,_0x5f11c6){return db[_0x7722('0x60')]['describe']()['then'](respondWithResult(_0x5f11c6,null))[_0x7722('0x2a')](handleError(_0x5f11c6,null));};exports[_0x7722('0x68')]=function(_0x51c831,_0xdee8d1,_0x404a15){return db['User'][_0x7722('0x3b')]({'where':{'id':_0x51c831[_0x7722('0x64')]['id']}})[_0x7722('0x33')](handleEntityNotFound(_0xdee8d1,null))['then'](function(_0x19c96c){if(_0x19c96c){return _0x19c96c[_0x7722('0x68')](_0x51c831[_0x7722('0x66')][_0x7722('0x69')],_['omit'](_0x51c831[_0x7722('0x66')],[_0x7722('0x69'),'id'])||{});}})[_0x7722('0x33')](respondWithResult(_0xdee8d1,null))[_0x7722('0x2a')](handleError(_0xdee8d1,null));};var getLicense=function(_0x429e20){return new BPromise(function(_0x2cd16a,_0x13eae6){var _0x1c0168=0x0;_0x429e20[_0x7722('0x66')][_0x7722('0x3a')]===_0x7722('0x6a')&&_0x2cd16a(_0x7722('0x6b'));return db[_0x7722('0x60')]['count']({'where':{'$or':[{'role':_0x429e20[_0x7722('0x66')][_0x7722('0x3a')]==='telephone'?_0x7722('0x6c'):['admin',_0x7722('0x6d')]}]}})[_0x7722('0x33')](function(_0x2fff0e){_0x1c0168=_0x2fff0e;return require(_0x7722('0x6e'))[_0x7722('0x6f')]();})[_0x7722('0x33')](function(_0x5b2ffe){var _0x3ad8ac=_0x429e20[_0x7722('0x66')][_0x7722('0x3a')]===_0x7722('0x6c')?_0x7722('0x70'):_0x7722('0x71');if(!_[_0x7722('0x72')](_0x5b2ffe[_0x3ad8ac])&&_0x1c0168>=_0x5b2ffe[_0x3ad8ac]){return _0x13eae6({'message':_0x7722('0x73')});}return _0x2cd16a(util[_0x7722('0x74')](_0x7722('0x75'),_0x3ad8ac,_0x1c0168));})[_0x7722('0x2a')](function(_0x2eb20a){return _0x13eae6(_0x2eb20a);});});};exports[_0x7722('0x76')]=function(_0x5d99af,_0x161d97){return getLicense(_0x5d99af)['then'](function(_0x545e1f){if(!_0x5d99af[_0x7722('0x66')][_0x7722('0x77')]){var _0x1ebee9;return db['Setting'][_0x7722('0x78')](0x1)['then'](function(_0x20b531){return checkPasswordPattern(_0x20b531,_0x5d99af[_0x7722('0x66')][_0x7722('0x49')],_0x20b531[_0x7722('0x79')]);})[_0x7722('0x33')](function(_0x2c7b96){_0x1ebee9=_0x2c7b96['min_internal'];return db['User'][_0x7722('0x7a')](_0x7722('0x77'));})[_0x7722('0x33')](function(_0x5b036c){if(_[_0x7722('0x72')](_0x5b036c)){if(_0x1ebee9){_0x5d99af[_0x7722('0x66')]['internal']=_0x1ebee9;}else{_0x5d99af[_0x7722('0x66')][_0x7722('0x77')]=0x1;}}else{if(_[_0x7722('0x72')](_0x1ebee9)||_0x1ebee9==_0x5b036c){_0x5d99af[_0x7722('0x66')][_0x7722('0x77')]=_0x5b036c+0x1;}else if(_0x1ebee9>_0x5b036c){_0x5d99af[_0x7722('0x66')][_0x7722('0x77')]=_0x1ebee9;}else{return db[_0x7722('0x59')]['query'](_0x7722('0x7b'),{'type':db[_0x7722('0x59')][_0x7722('0x7c')]['SELECT']})[_0x7722('0x33')](function(_0x4e8a12){if(_0x4e8a12&&_0x4e8a12[_0x7722('0x50')]){for(var _0x1a0eec=0x0,_0x5f4946=_0x4e8a12[_0x7722('0x50')];_0x1a0eec<_0x5f4946&&_[_0x7722('0x72')](_0x5d99af['body']['internal']);_0x1a0eec++){if(_0x1ebee9<=_0x4e8a12[_0x1a0eec][_0x7722('0x7d')]){_0x5d99af['body'][_0x7722('0x77')]=_0x4e8a12[_0x1a0eec]['from'];}else if(_0x1ebee9>_0x4e8a12[_0x1a0eec][_0x7722('0x7d')]&&_0x1ebee9<=_0x4e8a12[_0x1a0eec]['to']){_0x5d99af[_0x7722('0x66')][_0x7722('0x77')]=_0x1ebee9;}}}if(_[_0x7722('0x72')](_0x5d99af['body'][_0x7722('0x77')])){_0x5d99af['body'][_0x7722('0x77')]=_0x5b036c+0x1;}});}}});}})[_0x7722('0x33')](function(){if(_0x5d99af[_0x7722('0x66')][_0x7722('0x7e')]){_0x5d99af[_0x7722('0x66')][_0x7722('0x7f')]=_0x5d99af[_0x7722('0x66')][_0x7722('0x77')];_0x5d99af[_0x7722('0x66')]['VoiceMail']={'mailbox':_0x5d99af['body']['internal'],'password':_0x5d99af[_0x7722('0x66')][_0x7722('0x49')],'fullname':_0x5d99af['body']['fullname'],'email':_0x5d99af[_0x7722('0x66')]['email']};}if(_0x5d99af['body']&&_0x5d99af[_0x7722('0x66')][_0x7722('0x3a')]==='agent'){if(!_0x5d99af[_0x7722('0x66')][_0x7722('0x80')]){_0x5d99af[_0x7722('0x66')][_0x7722('0x80')]=['101','102',_0x7722('0x81'),_0x7722('0x82'),_0x7722('0x83'),_0x7722('0x84'),_0x7722('0x85'),_0x7722('0x86'),_0x7722('0x87'),_0x7722('0x88'),_0x7722('0x89'),_0x7722('0x8a'),_0x7722('0x8b'),_0x7722('0x8c')];}}return db['User']['create'](_0x5d99af[_0x7722('0x66')],{'include':[{'model':db[_0x7722('0x8d')],'as':_0x7722('0x8d')}]});})[_0x7722('0x33')](function(_0x204546){if(_0x5d99af[_0x7722('0x66')][_0x7722('0x3a')]===_0x7722('0x6d'))return _0x204546;var _0x1787e4=_0x5d99af[_0x7722('0x6d')][_0x7722('0x35')]({'plain':!![]});if(!_0x1787e4)throw new Error(_0x7722('0x8e'));if(_0x1787e4[_0x7722('0x3a')]==='user'){var _0x1ad31e=_0x204546[_0x7722('0x35')]({'plain':!![]});var _0x269bbd=[{'name':'Agents','value':_0x7722('0x6a')},{'name':_0x7722('0x37'),'value':'telephone'}];var _0x475913=_[_0x7722('0x3b')](_0x269bbd,['value',_0x1ad31e[_0x7722('0x3a')]])['name'];return db[_0x7722('0x8f')][_0x7722('0x3b')]({'where':{'name':_0x475913,'userProfileId':_0x1787e4['userProfileId']},'raw':!![]})['then'](function(_0x15b482){if(_0x15b482&&_0x15b482[_0x7722('0x90')]===0x0){return db['UserProfileResource'][_0x7722('0x76')]({'name':_0x1ad31e[_0x7722('0x3f')],'resourceId':_0x1ad31e['id'],'type':_0x15b482[_0x7722('0x3f')],'sectionId':_0x15b482['id']},{})[_0x7722('0x33')](function(){return _0x204546;});}else{return _0x204546;}})[_0x7722('0x2a')](function(_0x300281){logger[_0x7722('0x27')](_0x7722('0x91'),_0x300281);throw _0x300281;});}return _0x204546;})[_0x7722('0x33')](respondWithResult(_0x161d97,0xc9))[_0x7722('0x2a')](handleError(_0x161d97,null));};exports[_0x7722('0x92')]=function(_0x49e083,_0x439535,_0x5047b1){var _0x4c437b=![];if(_0x49e083[_0x7722('0x66')]['id']){delete _0x49e083[_0x7722('0x66')]['id'];}return db['Setting'][_0x7722('0x93')]({'attributes':['id',_0x7722('0x79')]})['then'](function(_0x45b77a){_0x4c437b=_0x45b77a[_0x7722('0x79')];return db['User'][_0x7722('0x3b')]({'where':{'id':_0x49e083[_0x7722('0x64')]['id']}});})[_0x7722('0x33')](function(_0x55548f){if(_0x55548f){if(_0x55548f['id']==_0x49e083[_0x7722('0x6d')]['id']){if(!_0x49e083[_0x7722('0x66')][_0x7722('0x94')]||!_0x49e083['body'][_0x7722('0x95')]){throw new db[(_0x7722('0x21'))][(_0x7722('0x96'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x55548f[_0x7722('0x97')](_0x49e083[_0x7722('0x66')]['oldPassword'])){throw new db[(_0x7722('0x21'))][(_0x7722('0x96'))](_0x7722('0x98'));}if(_0x49e083[_0x7722('0x66')][_0x7722('0x94')]==_0x49e083[_0x7722('0x66')][_0x7722('0x95')]){throw new db[(_0x7722('0x21'))]['ValidationError'](_0x7722('0x99'));}return _0x55548f;}else if(_0x49e083[_0x7722('0x6d')][_0x7722('0x3a')]==_0x7722('0x9a')){if(!_0x49e083['body'][_0x7722('0x95')]){throw new db[(_0x7722('0x21'))][(_0x7722('0x96'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}return _0x55548f;}else if(_0x49e083[_0x7722('0x6d')][_0x7722('0x3a')]==_0x7722('0x6d')){if(!_0x49e083['body'][_0x7722('0x95')]){throw new db[(_0x7722('0x21'))][(_0x7722('0x96'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x55548f[_0x7722('0x3a')]!=_0x7722('0x6a')){throw new db[(_0x7722('0x21'))][(_0x7722('0x96'))](_0x7722('0x9b'));}return _0x55548f;}else{throw new db[(_0x7722('0x21'))][(_0x7722('0x96'))](_0x7722('0x9b'));}}return null;})[_0x7722('0x33')](handleEntityNotFound(_0x439535,null))[_0x7722('0x33')](function(_0x90c09b){return checkPasswordPattern(_0x90c09b,_0x49e083[_0x7722('0x66')][_0x7722('0x95')],_0x4c437b);})['then'](saveUpdates({'password':_0x49e083['body'][_0x7722('0x95')],'passwordResetAt':_0x49e083[_0x7722('0x6d')]['id']==_0x49e083['params']['id']?moment():null},null))[_0x7722('0x33')](respondWithResult(_0x439535,null))[_0x7722('0x2a')](handleError(_0x439535,null));};exports['addQueues']=function(_0x359358,_0x56c0ac,_0x33db7a){var _0x1185da=_0x359358['body'][_0x7722('0x9c')];return db['User'][_0x7722('0x3b')]({'where':{'id':_0x359358[_0x7722('0x64')]['id']},'attributes':['id',_0x7722('0x3f'),_0x7722('0x3a'),_0x7722('0x9d'),'loginInPause',_0x7722('0x9e'),_0x7722('0x9f')]})['then'](handleEntityNotFound(_0x56c0ac,null))[_0x7722('0x33')](function(_0x1cca43){if(_0x1cca43){if(!utils[_0x7722('0xa0')](_0x1185da)){throw new db[(_0x7722('0x21'))]['ValidationError'](_0x7722('0xa1'));}return _0x1cca43['add'+_[_0x7722('0xa2')](_0x1185da[_0x7722('0xa3')]())+'Queues'](_0x359358['body'][_0x7722('0x69')],{'penalty':_0x359358['body'][_0x7722('0xa4')]||0x0})[_0x7722('0xa5')](function(_0x12356f){for(var _0x2b793a=0x0;_0x2b793a<_0x359358[_0x7722('0x66')][_0x7722('0x69')][_0x7722('0x50')];_0x2b793a+=0x1){var _0x571553={'UserId':_0x359358[_0x7722('0x64')]['id']};_0x571553[_[_0x7722('0xa2')](_0x1185da[_0x7722('0xa3')]())+'QueueId']=_0x359358[_0x7722('0x66')][_0x7722('0x69')][_0x2b793a];socket[_0x7722('0xa6')](_0x7722('0x6d')+_['capitalize'](_0x1185da[_0x7722('0xa3')]())+_0x7722('0xa7'),_0x571553);}return _0x12356f;})[_0x7722('0x33')](function(){if(_0x1185da===_0x7722('0xa8')){return db[_0x7722('0xa9')][_0x7722('0x61')]({'where':{'id':_0x359358[_0x7722('0x66')][_0x7722('0x69')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x7722('0x33')](function(_0x56b0c5){var _0xb25d24=_0x1cca43[_0x7722('0x35')]({'plain':!![]});var _0x557d43=[];if(_0x1185da===_0x7722('0xa8')&&_0xb25d24[_0x7722('0x3a')]==='agent'&&_0xb25d24['online']){for(var _0x18e589=0x0;_0x18e589<_0x56b0c5[_0x7722('0x50')];_0x18e589+=0x1){_0x557d43[_0x7722('0xaa')]({'membername':_0xb25d24[_0x7722('0x3f')],'UserId':_0xb25d24['id'],'queue_name':_0x56b0c5[_0x18e589]['name'],'VoiceQueueId':_0x56b0c5[_0x18e589]['id'],'interface':_[_0x7722('0x72')](_0xb25d24[_0x7722('0x9f')])?util[_0x7722('0x74')](_0x7722('0xab'),_0xb25d24[_0x7722('0x3f')]):_0xb25d24[_0x7722('0x9f')],'paused':_0xb25d24[_0x7722('0x9e')]||![],'penalty':_0x359358[_0x7722('0x66')][_0x7722('0xa4')]||0x0});}return BPromise[_0x7722('0xac')](_0x557d43,function(_0x4daa09){return db[_0x7722('0xad')][_0x7722('0xae')](_0x4daa09);});}return _0x1cca43;});}})['then'](respondWithStatusCode(_0x56c0ac,null))[_0x7722('0x2a')](handleError(_0x56c0ac,null));};exports[_0x7722('0xaf')]=function(_0x1ccdf7,_0x4c1bc9,_0x1ff856){var _0x159197;return db[_0x7722('0x60')][_0x7722('0x3b')]({'where':{'id':_0x1ccdf7[_0x7722('0x64')]['id']},'attributes':['id',_0x7722('0x3f'),_0x7722('0x3a')]})['then'](handleEntityNotFound(_0x4c1bc9,null))[_0x7722('0x33')](function(_0xca5435){if(_0xca5435){_0x159197=_0xca5435;if(!_0x1ccdf7[_0x7722('0x4b')][_0x7722('0x9c')]||!utils['isValidChannel'](_0x1ccdf7['query']['channel'])){throw new db[(_0x7722('0x21'))][(_0x7722('0x96'))](_0x7722('0xa1'));}return _0xca5435['remove'+_['capitalize'](_0x1ccdf7[_0x7722('0x4b')][_0x7722('0x9c')][_0x7722('0xa3')]())+'Queues'](_0x1ccdf7[_0x7722('0x4b')][_0x7722('0x69')]);}})[_0x7722('0x33')](function(_0x1a8f11){for(var _0x4340ea=0x0;_0x4340ea<_0x1ccdf7['query'][_0x7722('0x69')][_0x7722('0x50')];_0x4340ea+=0x1){var _0x2ca6aa={'UserId':_0x1ccdf7[_0x7722('0x64')]['id']};_0x2ca6aa[_['capitalize'](_0x1ccdf7[_0x7722('0x4b')][_0x7722('0x9c')]['toLowerCase']())+_0x7722('0xb0')]=_0x1ccdf7[_0x7722('0x4b')][_0x7722('0x69')][_0x4340ea];socket['emit']('user'+_[_0x7722('0xa2')](_0x1ccdf7[_0x7722('0x4b')][_0x7722('0x9c')]['toLowerCase']())+'Queue:remove',_0x2ca6aa);}return _0x1a8f11;})['then'](function(){if(_0x1ccdf7['query'][_0x7722('0x9c')]===_0x7722('0xa8')){return db[_0x7722('0xad')][_0x7722('0x34')]({'where':{'UserId':_0x1ccdf7[_0x7722('0x64')]['id'],'VoiceQueueId':_0x1ccdf7[_0x7722('0x4b')][_0x7722('0x69')]},'individualHooks':!![]})[_0x7722('0x33')](function(){return _0x159197;});}return _0x159197;})[_0x7722('0x33')](respondWithStatusCode(_0x4c1bc9,null))[_0x7722('0x2a')](handleError(_0x4c1bc9,null));};exports['addAvatar']=function(_0x4e87ce,_0x5df2d3,_0x14ceab){_0x4e87ce[_0x7722('0x66')][_0x7722('0xb1')]=_0x4e87ce[_0x7722('0xb2')][_0x7722('0xb3')];return db[_0x7722('0x60')][_0x7722('0x3b')]({'where':{'id':_0x4e87ce[_0x7722('0x64')]['id']}})['then'](handleEntityNotFound(_0x5df2d3,null))[_0x7722('0x33')](saveUpdates(_0x4e87ce[_0x7722('0x66')],null))[_0x7722('0x33')](respondWithResult(_0x5df2d3,null))['catch'](handleError(_0x5df2d3,null));};exports[_0x7722('0xb4')]=function(_0x5577d7,_0x187499,_0x5de50f){var _0x584426=path['join'](config['root'],'server/files/images/logos/default_profile.png');return db['User'][_0x7722('0x3b')]({'where':{'id':_0x5577d7[_0x7722('0x64')]['id']},'attributes':['id',_0x7722('0xb1')],'raw':!![]})['then'](handleEntityNotFound(_0x187499,null))[_0x7722('0x33')](function(_0x53c8da){if(_0x53c8da){if(_[_0x7722('0x72')](_0x53c8da[_0x7722('0xb1')])){return _0x187499[_0x7722('0xb5')](_0x584426);}else{if(!fs[_0x7722('0xb6')](path[_0x7722('0xb7')](config['root'],'server/files/images/',_0x53c8da['userpic']))){return _0x187499[_0x7722('0xb5')](_0x584426);}return _0x187499[_0x7722('0xb5')](path[_0x7722('0xb7')](config[_0x7722('0xb8')],_0x7722('0xb9'),_0x53c8da[_0x7722('0xb1')]));}}})['catch'](handleError(_0x187499,null));};exports[_0x7722('0xba')]=function(_0x42f85d,_0x3b2f26,_0x8ebcf5){var _0x663540={};var _0x2e6a99={};var _0x9fdec2;var _0x2c1ef7;return db[_0x7722('0x60')][_0x7722('0x93')]({'where':{'id':_0x42f85d[_0x7722('0x64')]['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x3b2f26,null))[_0x7722('0x33')](function(_0x52cc00){if(_0x52cc00){_0x9fdec2=_0x52cc00;_0x2e6a99['model']=_[_0x7722('0x4c')](db[_0x7722('0xbb')][_0x7722('0x43')]);_0x2e6a99[_0x7722('0x4b')]=_[_0x7722('0x4c')](_0x42f85d[_0x7722('0x4b')]);_0x2e6a99[_0x7722('0x55')]=_['intersection'](_0x2e6a99[_0x7722('0x47')],_0x2e6a99[_0x7722('0x4b')]);_0x663540[_0x7722('0x4e')]=_[_0x7722('0x4d')](_0x2e6a99[_0x7722('0x47')],qs[_0x7722('0x4f')](_0x42f85d[_0x7722('0x4b')][_0x7722('0x4f')]));_0x663540['attributes']=_0x663540[_0x7722('0x4e')][_0x7722('0x50')]?_0x663540[_0x7722('0x4e')]:_0x2e6a99[_0x7722('0x47')];_0x663540['order']=qs[_0x7722('0x53')](_0x42f85d[_0x7722('0x4b')][_0x7722('0x53')]);_0x663540[_0x7722('0x54')]=qs['filters'](_[_0x7722('0x56')](_0x42f85d[_0x7722('0x4b')],_0x2e6a99['filters']));if(_0x42f85d['query'][_0x7722('0xbc')]){_0x663540['where']=_[_0x7722('0x57')](_0x663540[_0x7722('0x54')],{'$or':_['map'](_0x663540[_0x7722('0x4e')],function(_0x67f038){var _0x1cdf2d={};_0x1cdf2d[_0x67f038]={'$like':'%'+_0x42f85d['query'][_0x7722('0xbc')]+'%'};return _0x1cdf2d;})});}_0x663540=_['merge']({},_0x663540,_0x42f85d[_0x7722('0x5c')]);return _0x9fdec2[_0x7722('0xba')](_0x663540);}})[_0x7722('0x33')](function(_0x47d2d3){if(_0x47d2d3){_0x2c1ef7=_0x47d2d3[_0x7722('0x50')];if(_0x42f85d[_0x7722('0x4b')][_0x7722('0x51')]('includeAll')){_0x663540[_0x7722('0x5f')]=[{'model':db[_0x7722('0xbd')],'as':_0x7722('0xbe'),'required':![]},{'model':db['Tag'],'as':_0x7722('0xbf'),'attributes':['id',_0x7722('0x3f'),_0x7722('0xc0')],'where':_0x42f85d[_0x7722('0x4b')]['tag']?{'id':_0x42f85d[_0x7722('0x4b')][_0x7722('0xc1')]}:undefined,'required':_0x42f85d[_0x7722('0x4b')]['tag']?!![]:![]}];}if(!_0x42f85d[_0x7722('0x4b')][_0x7722('0x51')](_0x7722('0xc2'))){_0x663540[_0x7722('0x2f')]=qs['limit'](_0x42f85d['query'][_0x7722('0x2f')]);_0x663540[_0x7722('0x2e')]=qs['offset'](_0x42f85d[_0x7722('0x4b')][_0x7722('0x2e')]);}return _0x9fdec2[_0x7722('0xba')](_0x663540);}})['then'](function(_0x2428e0){if(_0x2428e0){return _0x2428e0?{'count':_0x2c1ef7,'rows':_0x2428e0}:null;}})[_0x7722('0x33')](respondWithResult(_0x3b2f26,null))[_0x7722('0x2a')](handleError(_0x3b2f26,null));};exports[_0x7722('0xc3')]=function(_0x185c8d,_0x1dcc04,_0x5af4f4){var _0x3a381f;var _0x58be2e;var _0x40981f={};var _0x3a8340;return db[_0x7722('0x60')]['findOne']({'where':{'id':_0x185c8d[_0x7722('0x64')]['id']},'attributes':['id',_0x7722('0x3f'),'role']})[_0x7722('0x33')](handleEntityNotFound(_0x1dcc04,null))[_0x7722('0x33')](function(_0x11332e){if(!utils[_0x7722('0xa0')](_0x185c8d[_0x7722('0x4b')]['channel'])){throw new db[(_0x7722('0x21'))][(_0x7722('0x96'))]('Unknown\x20channel');}_0x3a381f=_0x11332e;var _0x4f465a={};_0x4f465a[_0x7722('0x47')]=_[_0x7722('0x4c')](db[_[_0x7722('0xa2')](_0x185c8d[_0x7722('0x4b')][_0x7722('0x9c')])+_0x7722('0xc4')][_0x7722('0x43')]);_0x4f465a[_0x7722('0x4b')]=_[_0x7722('0x4c')](_0x185c8d[_0x7722('0x4b')]);_0x4f465a[_0x7722('0x55')]=_[_0x7722('0x4d')](_0x4f465a[_0x7722('0x47')],_0x4f465a[_0x7722('0x4b')]);_0x40981f[_0x7722('0x4e')]=_[_0x7722('0x4d')](_0x4f465a[_0x7722('0x47')],qs[_0x7722('0x4f')](_0x185c8d[_0x7722('0x4b')]['fields']));_0x40981f[_0x7722('0x4e')]=_0x40981f[_0x7722('0x4e')][_0x7722('0x50')]?_0x40981f['attributes']:_0x4f465a['model'];_0x40981f[_0x7722('0x52')]=qs[_0x7722('0x53')](_0x185c8d[_0x7722('0x4b')][_0x7722('0x53')]);_0x40981f[_0x7722('0x54')]=qs[_0x7722('0x55')](_[_0x7722('0x56')](_0x185c8d[_0x7722('0x4b')],_0x4f465a[_0x7722('0x55')]));if(_0x185c8d['query'][_0x7722('0xbc')]){_0x40981f[_0x7722('0x54')]=_['merge'](_0x40981f[_0x7722('0x54')],{'$or':_[_0x7722('0x42')](_0x40981f[_0x7722('0x4e')],function(_0x10e90){var _0x2f3511={};_0x2f3511[_0x10e90]={'$like':'%'+_0x185c8d[_0x7722('0x4b')][_0x7722('0xbc')]+'%'};return _0x2f3511;})});}_0x40981f=_['merge']({},_0x40981f,_0x185c8d[_0x7722('0x5c')]);switch(_0x3a381f[_0x7722('0x3a')]){case _0x7722('0x9a'):return db[_['capitalize'](_0x185c8d[_0x7722('0x4b')][_0x7722('0x9c')])+_0x7722('0xc4')][_0x7722('0x61')](_0x40981f);case'user':case _0x7722('0x6a'):return _0x3a381f['get'+_[_0x7722('0xa2')](_0x185c8d[_0x7722('0x4b')][_0x7722('0x9c')])+_0x7722('0xc5')](_0x40981f);default:throw new db[(_0x7722('0x21'))]['ValidationError']('Unknown\x20role');}})[_0x7722('0x33')](function(_0x496c8e){_0x3a8340=_0x496c8e['length'];if(!_0x185c8d[_0x7722('0x4b')][_0x7722('0x51')](_0x7722('0xc2'))){_0x40981f['limit']=qs[_0x7722('0x2f')](_0x185c8d[_0x7722('0x4b')]['limit']);_0x40981f['offset']=qs[_0x7722('0x2e')](_0x185c8d['query'][_0x7722('0x2e')]);}switch(_0x3a381f['role']){case'admin':return db[_['capitalize'](_0x185c8d['query']['channel'])+'Queue'][_0x7722('0x61')](_0x40981f);case _0x7722('0x6d'):case _0x7722('0x6a'):return _0x3a381f[_0x7722('0x35')+_['capitalize'](_0x185c8d['query']['channel'])+'Queues'](_0x40981f);}})[_0x7722('0x33')](function(_0x1bd75f){return{'count':_0x3a8340,'rows':_0x1bd75f};})['then'](respondWithResult(_0x1dcc04,null))[_0x7722('0x2a')](handleError(_0x1dcc04,null));};exports[_0x7722('0xc6')]=function(_0x3c8feb,_0x4b59f0,_0x4cfea2){var _0x528418={};var _0x70cf79={};var _0x5c9933;var _0x101536;return db['User'][_0x7722('0x93')]({'where':{'id':_0x3c8feb['params']['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x4b59f0,null))[_0x7722('0x33')](function(_0xe2545f){if(_0xe2545f){_0x5c9933=_0xe2545f;_0x70cf79[_0x7722('0x47')]=_['keys'](db[_0x7722('0xad')]['rawAttributes']);_0x70cf79['query']=_[_0x7722('0x4c')](_0x3c8feb[_0x7722('0x4b')]);_0x70cf79[_0x7722('0x55')]=_['intersection'](_0x70cf79[_0x7722('0x47')],_0x70cf79[_0x7722('0x4b')]);_0x528418['attributes']=_['intersection'](_0x70cf79['model'],qs['fields'](_0x3c8feb[_0x7722('0x4b')][_0x7722('0x4f')]));_0x528418[_0x7722('0x4e')]=_0x528418[_0x7722('0x4e')][_0x7722('0x50')]?_0x528418[_0x7722('0x4e')]:_0x70cf79[_0x7722('0x47')];_0x528418[_0x7722('0x52')]=qs['sort'](_0x3c8feb[_0x7722('0x4b')][_0x7722('0x53')]);_0x528418[_0x7722('0x54')]=qs[_0x7722('0x55')](_['pick'](_0x3c8feb[_0x7722('0x4b')],_0x70cf79[_0x7722('0x55')]));if(_0x3c8feb[_0x7722('0x4b')][_0x7722('0xbc')]){_0x528418[_0x7722('0x54')]=_['merge'](_0x528418[_0x7722('0x54')],{'$or':_['map'](_0x528418[_0x7722('0x4e')],function(_0xfc20e0){var _0x5ebe42={};_0x5ebe42[_0xfc20e0]={'$like':'%'+_0x3c8feb['query']['filter']+'%'};return _0x5ebe42;})});}_0x528418=_['merge']({},_0x528418,_0x3c8feb[_0x7722('0x5c')]);return _0x5c9933['getVoiceQueuesRt'](_0x528418);}})[_0x7722('0x33')](function(_0x20ce7e){if(_0x20ce7e){_0x101536=_0x20ce7e[_0x7722('0x50')];if(!_0x3c8feb[_0x7722('0x4b')][_0x7722('0x51')](_0x7722('0xc2'))){_0x528418[_0x7722('0x2f')]=qs[_0x7722('0x2f')](_0x3c8feb[_0x7722('0x4b')][_0x7722('0x2f')]);_0x528418[_0x7722('0x2e')]=qs[_0x7722('0x2e')](_0x3c8feb[_0x7722('0x4b')][_0x7722('0x2e')]);}return _0x5c9933[_0x7722('0xc6')](_0x528418);}})['then'](function(_0x1f95fe){if(_0x1f95fe){return _0x1f95fe?{'count':_0x101536,'rows':_0x1f95fe}:null;}})[_0x7722('0x33')](respondWithResult(_0x4b59f0,null))['catch'](handleError(_0x4b59f0,null));};exports['getGroups']=function(_0x50d4a6,_0x4a4dca,_0x523701){var _0x41659d={};var _0x2900cf={};var _0xcbbcb1;var _0x279364;return db[_0x7722('0x60')][_0x7722('0x93')]({'where':{'id':_0x50d4a6[_0x7722('0x64')]['id']}})['then'](handleEntityNotFound(_0x4a4dca,null))[_0x7722('0x33')](function(_0x4c8e0e){if(_0x4c8e0e){_0xcbbcb1=_0x4c8e0e;_0x2900cf[_0x7722('0x47')]=_[_0x7722('0x4c')](db[_0x7722('0xc7')][_0x7722('0x43')]);_0x2900cf[_0x7722('0x4b')]=_[_0x7722('0x4c')](_0x50d4a6[_0x7722('0x4b')]);_0x2900cf[_0x7722('0x55')]=_[_0x7722('0x4d')](_0x2900cf['model'],_0x2900cf[_0x7722('0x4b')]);_0x41659d[_0x7722('0x4e')]=_[_0x7722('0x4d')](_0x2900cf[_0x7722('0x47')],qs[_0x7722('0x4f')](_0x50d4a6[_0x7722('0x4b')][_0x7722('0x4f')]));_0x41659d[_0x7722('0x4e')]=_0x41659d[_0x7722('0x4e')]['length']?_0x41659d[_0x7722('0x4e')]:_0x2900cf[_0x7722('0x47')];_0x41659d[_0x7722('0x52')]=qs[_0x7722('0x53')](_0x50d4a6['query'][_0x7722('0x53')]);_0x41659d[_0x7722('0x54')]=qs[_0x7722('0x55')](_[_0x7722('0x56')](_0x50d4a6[_0x7722('0x4b')],_0x2900cf[_0x7722('0x55')]));if(_0x50d4a6[_0x7722('0x4b')][_0x7722('0xbc')]){_0x41659d[_0x7722('0x54')]=_[_0x7722('0x57')](_0x41659d[_0x7722('0x54')],{'$or':_[_0x7722('0x42')](_0x41659d['attributes'],function(_0x35fea4){var _0x307c20={};_0x307c20[_0x35fea4]={'$like':'%'+_0x50d4a6[_0x7722('0x4b')]['filter']+'%'};return _0x307c20;})});}_0x41659d=_[_0x7722('0x57')]({},_0x41659d,_0x50d4a6[_0x7722('0x5c')]);return _0xcbbcb1[_0x7722('0xc8')](_0x41659d);}})[_0x7722('0x33')](function(_0x549149){if(_0x549149){_0x279364=_0x549149['length'];if(!_0x50d4a6['query'][_0x7722('0x51')]('nolimit')){_0x41659d[_0x7722('0x2f')]=qs['limit'](_0x50d4a6['query'][_0x7722('0x2f')]);_0x41659d[_0x7722('0x2e')]=qs[_0x7722('0x2e')](_0x50d4a6['query'][_0x7722('0x2e')]);}return _0xcbbcb1[_0x7722('0xc8')](_0x41659d);}})['then'](function(_0x37f45a){if(_0x37f45a){return _0x37f45a?{'count':_0x279364,'rows':_0x37f45a}:null;}})[_0x7722('0x33')](respondWithResult(_0x4a4dca,null))['catch'](handleError(_0x4a4dca,null));};exports[_0x7722('0xc9')]=function(_0x2c11d6,_0x4040bf,_0x4621cf){var _0x574459={'raw':!![],'where':{}};var _0x37cae2={};var _0x486178={'count':0x0,'rows':[]};return db[_0x7722('0x60')]['findOne']({'where':{'id':_0x2c11d6[_0x7722('0x64')]['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x4040bf,null))[_0x7722('0x33')](function(_0x3b906a){if(_0x3b906a){_0x37cae2['model']=_['keys'](db[_0x7722('0xca')][_0x7722('0x43')]);_0x37cae2[_0x7722('0x4b')]=_[_0x7722('0x4c')](_0x2c11d6[_0x7722('0x4b')]);_0x37cae2['filters']=_[_0x7722('0x4d')](_0x37cae2['model'],_0x37cae2['query']);_0x574459[_0x7722('0x4e')]=_[_0x7722('0x4d')](_0x37cae2[_0x7722('0x47')],qs[_0x7722('0x4f')](_0x2c11d6[_0x7722('0x4b')]['fields']));_0x574459[_0x7722('0x4e')]=_0x574459[_0x7722('0x4e')][_0x7722('0x50')]?_0x574459[_0x7722('0x4e')]:_0x37cae2[_0x7722('0x47')];if(!_0x2c11d6[_0x7722('0x4b')]['hasOwnProperty'](_0x7722('0xc2'))){_0x574459[_0x7722('0x2f')]=qs[_0x7722('0x2f')](_0x2c11d6[_0x7722('0x4b')]['limit']);_0x574459[_0x7722('0x2e')]=qs[_0x7722('0x2e')](_0x2c11d6[_0x7722('0x4b')][_0x7722('0x2e')]);}_0x574459[_0x7722('0x52')]=qs[_0x7722('0x53')](_0x2c11d6['query']['sort']);_0x574459[_0x7722('0x54')]=qs[_0x7722('0x55')](_[_0x7722('0x56')](_0x2c11d6[_0x7722('0x4b')],_0x37cae2[_0x7722('0x55')]));_0x574459[_0x7722('0x54')]['UserId']=_0x3b906a['id'];if(_0x2c11d6['query'][_0x7722('0xbc')]){_0x574459[_0x7722('0x54')]=_[_0x7722('0x57')](_0x574459[_0x7722('0x54')],{'$or':_[_0x7722('0x42')](_0x574459['attributes'],function(_0x1d3e26){var _0x45fc00={};_0x45fc00[_0x1d3e26]={'$like':'%'+_0x2c11d6['query'][_0x7722('0xbc')]+'%'};return _0x45fc00;})});}_0x574459=_[_0x7722('0x57')]({},_0x574459,_0x2c11d6[_0x7722('0x5c')]);return db[_0x7722('0xca')][_0x7722('0x5d')]({'where':_0x574459['where']})[_0x7722('0x33')](function(_0x2c2854){_0x486178[_0x7722('0x5d')]=_0x2c2854;if(_0x2c11d6[_0x7722('0x4b')][_0x7722('0x5e')]){_0x574459[_0x7722('0x5f')]=[{'all':!![]}];}return db[_0x7722('0xca')][_0x7722('0x61')](_0x574459);})[_0x7722('0x33')](function(_0x11a241){_0x486178['rows']=_0x11a241;return _0x486178;});}})[_0x7722('0x33')](respondWithFilteredResult(_0x4040bf,_0x574459))[_0x7722('0x2a')](handleError(_0x4040bf,null));};exports[_0x7722('0xcb')]=function(_0x2049fe,_0x25be4d,_0x18a232){var _0x35d5b1={'raw':!![],'where':{}};var _0x4ef662={};var _0x4e5aee={'count':0x0,'rows':[]};return db[_0x7722('0x60')]['findOne']({'where':{'id':_0x2049fe[_0x7722('0x64')]['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x25be4d,null))[_0x7722('0x33')](function(_0x7729d5){if(_0x7729d5){_0x4ef662[_0x7722('0x47')]=_[_0x7722('0x4c')](db[_0x7722('0xcc')][_0x7722('0x43')]);_0x4ef662[_0x7722('0x4b')]=_[_0x7722('0x4c')](_0x2049fe[_0x7722('0x4b')]);_0x4ef662[_0x7722('0x55')]=_['intersection'](_0x4ef662['model'],_0x4ef662[_0x7722('0x4b')]);_0x35d5b1[_0x7722('0x4e')]=_['intersection'](_0x4ef662[_0x7722('0x47')],qs[_0x7722('0x4f')](_0x2049fe[_0x7722('0x4b')]['fields']));_0x35d5b1[_0x7722('0x4e')]=_0x35d5b1[_0x7722('0x4e')][_0x7722('0x50')]?_0x35d5b1[_0x7722('0x4e')]:_0x4ef662['model'];if(!_0x2049fe[_0x7722('0x4b')][_0x7722('0x51')](_0x7722('0xc2'))){_0x35d5b1[_0x7722('0x2f')]=qs['limit'](_0x2049fe['query'][_0x7722('0x2f')]);_0x35d5b1['offset']=qs[_0x7722('0x2e')](_0x2049fe[_0x7722('0x4b')][_0x7722('0x2e')]);}_0x35d5b1[_0x7722('0x52')]=qs[_0x7722('0x53')](_0x2049fe['query'][_0x7722('0x53')]);_0x35d5b1[_0x7722('0x54')]=qs[_0x7722('0x55')](_[_0x7722('0x56')](_0x2049fe['query'],_0x4ef662[_0x7722('0x55')]));_0x35d5b1[_0x7722('0x54')][_0x7722('0xcd')]=_0x7729d5['id'];if(_0x2049fe[_0x7722('0x4b')][_0x7722('0xbc')]){_0x35d5b1[_0x7722('0x54')]=_['merge'](_0x35d5b1[_0x7722('0x54')],{'$or':_[_0x7722('0x42')](_0x35d5b1[_0x7722('0x4e')],function(_0x302936){var _0x531571={};_0x531571[_0x302936]={'$like':'%'+_0x2049fe['query']['filter']+'%'};return _0x531571;})});}_0x35d5b1=_[_0x7722('0x57')]({},_0x35d5b1,_0x2049fe['options']);return db[_0x7722('0xcc')][_0x7722('0x5d')]({'where':_0x35d5b1[_0x7722('0x54')]})[_0x7722('0x33')](function(_0x2d1c51){_0x4e5aee[_0x7722('0x5d')]=_0x2d1c51;if(_0x2049fe[_0x7722('0x4b')][_0x7722('0x5e')]){_0x35d5b1[_0x7722('0x5f')]=[{'all':!![]}];}return db['ScreenRecording'][_0x7722('0x61')](_0x35d5b1);})[_0x7722('0x33')](function(_0x50051a){_0x4e5aee['rows']=_0x50051a;return _0x4e5aee;});}})[_0x7722('0x33')](respondWithFilteredResult(_0x25be4d,_0x35d5b1))['catch'](handleError(_0x25be4d,null));};exports[_0x7722('0xce')]=function(_0x3a493d,_0x5c2020,_0x5a077c){var _0x72914f={};var _0x18376b={};var _0xd6fc86;var _0x27ac1a;return db[_0x7722('0x60')]['findOne']({'where':{'id':_0x3a493d['params']['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x5c2020,null))['then'](function(_0x345cab){if(_0x345cab){_0xd6fc86=_0x345cab;_0x18376b['model']=_[_0x7722('0x4c')](db[_0x7722('0xcf')][_0x7722('0x43')]);_0x18376b['query']=_['keys'](_0x3a493d[_0x7722('0x4b')]);_0x18376b[_0x7722('0x55')]=_[_0x7722('0x4d')](_0x18376b['model'],_0x18376b[_0x7722('0x4b')]);_0x72914f[_0x7722('0x4e')]=_[_0x7722('0x4d')](_0x18376b[_0x7722('0x47')],qs[_0x7722('0x4f')](_0x3a493d['query']['fields']));_0x72914f[_0x7722('0x4e')]=_0x72914f[_0x7722('0x4e')]['length']?_0x72914f[_0x7722('0x4e')]:_0x18376b[_0x7722('0x47')];_0x72914f[_0x7722('0x52')]=qs[_0x7722('0x53')](_0x3a493d[_0x7722('0x4b')][_0x7722('0x53')]);_0x72914f[_0x7722('0x54')]=qs[_0x7722('0x55')](_[_0x7722('0x56')](_0x3a493d['query'],_0x18376b[_0x7722('0x55')]));if(_0x3a493d[_0x7722('0x4b')][_0x7722('0xbc')]){_0x72914f[_0x7722('0x54')]=_['merge'](_0x72914f['where'],{'$or':_[_0x7722('0x42')](_0x72914f['attributes'],function(_0x2eba24){var _0x4fe9e4={};_0x4fe9e4[_0x2eba24]={'$like':'%'+_0x3a493d[_0x7722('0x4b')][_0x7722('0xbc')]+'%'};return _0x4fe9e4;})});}_0x72914f=_['merge']({},_0x72914f,_0x3a493d[_0x7722('0x5c')]);return _0xd6fc86[_0x7722('0xce')](_0x72914f);}})[_0x7722('0x33')](function(_0x5eea7d){if(_0x5eea7d){_0x27ac1a=_0x5eea7d['length'];if(!_0x3a493d[_0x7722('0x4b')]['hasOwnProperty'](_0x7722('0xc2'))){_0x72914f[_0x7722('0x2f')]=qs[_0x7722('0x2f')](_0x3a493d['query'][_0x7722('0x2f')]);_0x72914f[_0x7722('0x2e')]=qs[_0x7722('0x2e')](_0x3a493d[_0x7722('0x4b')]['offset']);}return _0xd6fc86[_0x7722('0xce')](_0x72914f);}})['then'](function(_0x475a6f){if(_0x475a6f){return _0x475a6f?{'count':_0x27ac1a,'rows':_0x475a6f}:null;}})['then'](respondWithResult(_0x5c2020,null))['catch'](handleError(_0x5c2020,null));};exports[_0x7722('0xd0')]=function(_0x397d6c,_0x4450c1,_0x58c1e9){var _0xfbfdde={};var _0x59b1b9={};var _0x57f8a5;var _0x14b6d3;return db[_0x7722('0x60')][_0x7722('0x93')]({'where':{'id':_0x397d6c['params']['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x4450c1,null))[_0x7722('0x33')](function(_0x4199f6){if(_0x4199f6){_0x57f8a5=_0x4199f6;_0x59b1b9['model']=_[_0x7722('0x4c')](db[_0x7722('0xd1')][_0x7722('0x43')]);_0x59b1b9[_0x7722('0x4b')]=_['keys'](_0x397d6c[_0x7722('0x4b')]);_0x59b1b9[_0x7722('0x55')]=_['intersection'](_0x59b1b9['model'],_0x59b1b9[_0x7722('0x4b')]);_0xfbfdde['attributes']=_['intersection'](_0x59b1b9[_0x7722('0x47')],qs[_0x7722('0x4f')](_0x397d6c[_0x7722('0x4b')]['fields']));_0xfbfdde[_0x7722('0x4e')]=_0xfbfdde['attributes'][_0x7722('0x50')]?_0xfbfdde['attributes']:_0x59b1b9[_0x7722('0x47')];_0xfbfdde[_0x7722('0x52')]=qs[_0x7722('0x53')](_0x397d6c[_0x7722('0x4b')]['sort']);_0xfbfdde[_0x7722('0x54')]=qs['filters'](_[_0x7722('0x56')](_0x397d6c[_0x7722('0x4b')],_0x59b1b9[_0x7722('0x55')]));if(_0x397d6c[_0x7722('0x4b')]['filter']){_0xfbfdde[_0x7722('0x54')]=_['merge'](_0xfbfdde[_0x7722('0x54')],{'$or':_[_0x7722('0x42')](_0xfbfdde[_0x7722('0x4e')],function(_0x5113c3){var _0x2e66e0={};_0x2e66e0[_0x5113c3]={'$like':'%'+_0x397d6c[_0x7722('0x4b')][_0x7722('0xbc')]+'%'};return _0x2e66e0;})});}_0xfbfdde=_[_0x7722('0x57')]({},_0xfbfdde,_0x397d6c[_0x7722('0x5c')]);return _0x57f8a5['getOpenchannelInteractions'](_0xfbfdde);}})[_0x7722('0x33')](function(_0x4d9358){if(_0x4d9358){_0x14b6d3=_0x4d9358[_0x7722('0x50')];if(!_0x397d6c['query']['hasOwnProperty'](_0x7722('0xc2'))){_0xfbfdde[_0x7722('0x2f')]=qs['limit'](_0x397d6c['query'][_0x7722('0x2f')]);_0xfbfdde[_0x7722('0x2e')]=qs['offset'](_0x397d6c['query'][_0x7722('0x2e')]);}return _0x57f8a5['getOpenchannelInteractions'](_0xfbfdde);}})['then'](function(_0x524b79){if(_0x524b79){return _0x524b79?{'count':_0x14b6d3,'rows':_0x524b79}:null;}})[_0x7722('0x33')](respondWithResult(_0x4450c1,null))[_0x7722('0x2a')](handleError(_0x4450c1,null));};exports[_0x7722('0xd2')]=function(_0x1caf7b,_0x22b854,_0x2e0105){var _0x40415e={'raw':!![],'where':{}};var _0x2a18a4={};var _0x57e9dc={'count':0x0,'rows':[]};return db[_0x7722('0x60')][_0x7722('0x93')]({'where':{'id':_0x1caf7b[_0x7722('0x64')]['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x22b854,null))[_0x7722('0x33')](function(_0x47af27){if(_0x47af27){_0x2a18a4[_0x7722('0x47')]=_['keys'](db['MailInteraction'][_0x7722('0x43')]);_0x2a18a4['query']=_[_0x7722('0x4c')](_0x1caf7b[_0x7722('0x4b')]);_0x2a18a4[_0x7722('0x55')]=_['intersection'](_0x2a18a4[_0x7722('0x47')],_0x2a18a4[_0x7722('0x4b')]);_0x40415e[_0x7722('0x4e')]=_[_0x7722('0x4d')](_0x2a18a4[_0x7722('0x47')],qs[_0x7722('0x4f')](_0x1caf7b['query'][_0x7722('0x4f')]));_0x40415e['attributes']=_0x40415e['attributes'][_0x7722('0x50')]?_0x40415e[_0x7722('0x4e')]:_0x2a18a4[_0x7722('0x47')];if(!_0x1caf7b[_0x7722('0x4b')][_0x7722('0x51')](_0x7722('0xc2'))){_0x40415e['limit']=qs[_0x7722('0x2f')](_0x1caf7b[_0x7722('0x4b')][_0x7722('0x2f')]);_0x40415e[_0x7722('0x2e')]=qs[_0x7722('0x2e')](_0x1caf7b[_0x7722('0x4b')][_0x7722('0x2e')]);}_0x40415e['order']=qs[_0x7722('0x53')](_0x1caf7b['query'][_0x7722('0x53')]);_0x40415e[_0x7722('0x54')]=qs[_0x7722('0x55')](_[_0x7722('0x56')](_0x1caf7b['query'],_0x2a18a4[_0x7722('0x55')]));_0x40415e['where'][_0x7722('0xcd')]=_0x47af27['id'];if(_0x1caf7b[_0x7722('0x4b')][_0x7722('0xbc')]){_0x40415e[_0x7722('0x54')]=_[_0x7722('0x57')](_0x40415e[_0x7722('0x54')],{'$or':_[_0x7722('0x42')](_0x40415e[_0x7722('0x4e')],function(_0x573d60){var _0x56a2be={};_0x56a2be[_0x573d60]={'$like':'%'+_0x1caf7b['query'][_0x7722('0xbc')]+'%'};return _0x56a2be;})});}_0x40415e=_['merge']({},_0x40415e,_0x1caf7b['options']);return db[_0x7722('0xd3')][_0x7722('0x5d')]({'where':_0x40415e[_0x7722('0x54')]})[_0x7722('0x33')](function(_0x544125){_0x57e9dc['count']=_0x544125;if(_0x1caf7b[_0x7722('0x4b')][_0x7722('0x5e')]){_0x40415e[_0x7722('0x5f')]=[{'all':!![]}];}return db[_0x7722('0xd3')][_0x7722('0x61')](_0x40415e);})[_0x7722('0x33')](function(_0x435033){_0x57e9dc[_0x7722('0x62')]=_0x435033;return _0x57e9dc;});}})[_0x7722('0x33')](respondWithFilteredResult(_0x22b854,_0x40415e))[_0x7722('0x2a')](handleError(_0x22b854,null));};exports[_0x7722('0xd4')]=function(_0x46c6f3,_0xca8b35,_0x10e93a){var _0x1c6e22={};var _0x4d62b9={};var _0x577fcb;var _0x1955b2;return db[_0x7722('0x60')][_0x7722('0x93')]({'where':{'id':_0x46c6f3[_0x7722('0x64')]['id']}})[_0x7722('0x33')](handleEntityNotFound(_0xca8b35,null))[_0x7722('0x33')](function(_0x16f6b5){if(_0x16f6b5){_0x577fcb=_0x16f6b5;_0x4d62b9[_0x7722('0x47')]=_[_0x7722('0x4c')](db[_0x7722('0xd5')][_0x7722('0x43')]);_0x4d62b9[_0x7722('0x4b')]=_[_0x7722('0x4c')](_0x46c6f3[_0x7722('0x4b')]);_0x4d62b9['filters']=_['intersection'](_0x4d62b9[_0x7722('0x47')],_0x4d62b9[_0x7722('0x4b')]);_0x1c6e22[_0x7722('0x4e')]=_[_0x7722('0x4d')](_0x4d62b9['model'],qs[_0x7722('0x4f')](_0x46c6f3['query'][_0x7722('0x4f')]));_0x1c6e22[_0x7722('0x4e')]=_0x1c6e22['attributes'][_0x7722('0x50')]?_0x1c6e22[_0x7722('0x4e')]:_0x4d62b9[_0x7722('0x47')];_0x1c6e22[_0x7722('0x52')]=qs['sort'](_0x46c6f3[_0x7722('0x4b')][_0x7722('0x53')]);_0x1c6e22['where']=qs[_0x7722('0x55')](_[_0x7722('0x56')](_0x46c6f3['query'],_0x4d62b9[_0x7722('0x55')]));if(_0x46c6f3[_0x7722('0x4b')][_0x7722('0xbc')]){_0x1c6e22[_0x7722('0x54')]=_['merge'](_0x1c6e22[_0x7722('0x54')],{'$or':_[_0x7722('0x42')](_0x1c6e22['attributes'],function(_0x1c3712){var _0x1a88e4={};_0x1a88e4[_0x1c3712]={'$like':'%'+_0x46c6f3['query']['filter']+'%'};return _0x1a88e4;})});}_0x1c6e22=_[_0x7722('0x57')]({},_0x1c6e22,_0x46c6f3['options']);return _0x577fcb[_0x7722('0xd4')](_0x1c6e22);}})[_0x7722('0x33')](function(_0x13fab7){if(_0x13fab7){_0x1955b2=_0x13fab7['length'];if(!_0x46c6f3[_0x7722('0x4b')][_0x7722('0x51')](_0x7722('0xc2'))){_0x1c6e22['limit']=qs[_0x7722('0x2f')](_0x46c6f3[_0x7722('0x4b')][_0x7722('0x2f')]);_0x1c6e22[_0x7722('0x2e')]=qs['offset'](_0x46c6f3[_0x7722('0x4b')]['offset']);}return _0x577fcb['getSmsInteractions'](_0x1c6e22);}})[_0x7722('0x33')](function(_0xe2ba59){if(_0xe2ba59){return _0xe2ba59?{'count':_0x1955b2,'rows':_0xe2ba59}:null;}})['then'](respondWithResult(_0xca8b35,null))[_0x7722('0x2a')](handleError(_0xca8b35,null));};exports[_0x7722('0xd6')]=function(_0x4565f9,_0x261b74,_0x279a80){var _0x1f20a9={};var _0x5215f0={};var _0x2f3139;var _0x4d87da;return db['User'][_0x7722('0x93')]({'where':{'id':_0x4565f9['params']['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x261b74,null))[_0x7722('0x33')](function(_0x30b073){if(_0x30b073){_0x2f3139=_0x30b073;_0x5215f0[_0x7722('0x47')]=_[_0x7722('0x4c')](db[_0x7722('0xd7')][_0x7722('0x43')]);_0x5215f0[_0x7722('0x4b')]=_[_0x7722('0x4c')](_0x4565f9['query']);_0x5215f0[_0x7722('0x55')]=_['intersection'](_0x5215f0[_0x7722('0x47')],_0x5215f0[_0x7722('0x4b')]);_0x1f20a9[_0x7722('0x4e')]=_['intersection'](_0x5215f0[_0x7722('0x47')],qs['fields'](_0x4565f9[_0x7722('0x4b')][_0x7722('0x4f')]));_0x1f20a9[_0x7722('0x4e')]=_0x1f20a9[_0x7722('0x4e')][_0x7722('0x50')]?_0x1f20a9[_0x7722('0x4e')]:_0x5215f0[_0x7722('0x47')];_0x1f20a9[_0x7722('0x52')]=qs['sort'](_0x4565f9[_0x7722('0x4b')][_0x7722('0x53')]);_0x1f20a9[_0x7722('0x54')]=qs['filters'](_[_0x7722('0x56')](_0x4565f9[_0x7722('0x4b')],_0x5215f0[_0x7722('0x55')]));if(_0x4565f9[_0x7722('0x4b')][_0x7722('0xbc')]){_0x1f20a9[_0x7722('0x54')]=_[_0x7722('0x57')](_0x1f20a9[_0x7722('0x54')],{'$or':_[_0x7722('0x42')](_0x1f20a9[_0x7722('0x4e')],function(_0x2c913b){var _0x1c28dc={};_0x1c28dc[_0x2c913b]={'$like':'%'+_0x4565f9['query']['filter']+'%'};return _0x1c28dc;})});}_0x1f20a9=_[_0x7722('0x57')]({},_0x1f20a9,_0x4565f9['options']);return _0x2f3139[_0x7722('0xd6')](_0x1f20a9);}})['then'](function(_0x4a1057){if(_0x4a1057){_0x4d87da=_0x4a1057[_0x7722('0x50')];if(!_0x4565f9[_0x7722('0x4b')][_0x7722('0x51')](_0x7722('0xc2'))){_0x1f20a9[_0x7722('0x2f')]=qs[_0x7722('0x2f')](_0x4565f9[_0x7722('0x4b')][_0x7722('0x2f')]);_0x1f20a9[_0x7722('0x2e')]=qs[_0x7722('0x2e')](_0x4565f9[_0x7722('0x4b')]['offset']);}return _0x2f3139['getFaxInteractions'](_0x1f20a9);}})[_0x7722('0x33')](function(_0x17b884){if(_0x17b884){return _0x17b884?{'count':_0x4d87da,'rows':_0x17b884}:null;}})[_0x7722('0x33')](respondWithResult(_0x261b74,null))[_0x7722('0x2a')](handleError(_0x261b74,null));};exports[_0x7722('0xd8')]=function(_0x3fb473,_0xf90734,_0x5889a8){var _0x4d210f={};var _0x242130={};var _0x1bb837;var _0x5ad78f;return db['User'][_0x7722('0x93')]({'where':{'id':_0x3fb473[_0x7722('0x64')]['id']}})[_0x7722('0x33')](handleEntityNotFound(_0xf90734,null))['then'](function(_0x2a001c){if(_0x2a001c){_0x1bb837=_0x2a001c;_0x242130['model']=_[_0x7722('0x4c')](db['WhatsappInteraction'][_0x7722('0x43')]);_0x242130[_0x7722('0x4b')]=_[_0x7722('0x4c')](_0x3fb473[_0x7722('0x4b')]);_0x242130[_0x7722('0x55')]=_[_0x7722('0x4d')](_0x242130['model'],_0x242130['query']);_0x4d210f[_0x7722('0x4e')]=_['intersection'](_0x242130['model'],qs['fields'](_0x3fb473[_0x7722('0x4b')]['fields']));_0x4d210f[_0x7722('0x4e')]=_0x4d210f['attributes'][_0x7722('0x50')]?_0x4d210f[_0x7722('0x4e')]:_0x242130['model'];_0x4d210f[_0x7722('0x52')]=qs[_0x7722('0x53')](_0x3fb473[_0x7722('0x4b')]['sort']);_0x4d210f['where']=qs[_0x7722('0x55')](_['pick'](_0x3fb473[_0x7722('0x4b')],_0x242130[_0x7722('0x55')]));if(_0x3fb473[_0x7722('0x4b')][_0x7722('0xbc')]){_0x4d210f[_0x7722('0x54')]=_['merge'](_0x4d210f[_0x7722('0x54')],{'$or':_[_0x7722('0x42')](_0x4d210f['attributes'],function(_0x395123){var _0x1a30e3={};_0x1a30e3[_0x395123]={'$like':'%'+_0x3fb473['query'][_0x7722('0xbc')]+'%'};return _0x1a30e3;})});}_0x4d210f=_['merge']({},_0x4d210f,_0x3fb473[_0x7722('0x5c')]);return _0x1bb837[_0x7722('0xd8')](_0x4d210f);}})[_0x7722('0x33')](function(_0x42a5cd){if(_0x42a5cd){_0x5ad78f=_0x42a5cd[_0x7722('0x50')];if(!_0x3fb473[_0x7722('0x4b')][_0x7722('0x51')](_0x7722('0xc2'))){_0x4d210f[_0x7722('0x2f')]=qs[_0x7722('0x2f')](_0x3fb473[_0x7722('0x4b')][_0x7722('0x2f')]);_0x4d210f[_0x7722('0x2e')]=qs[_0x7722('0x2e')](_0x3fb473[_0x7722('0x4b')][_0x7722('0x2e')]);}return _0x1bb837[_0x7722('0xd8')](_0x4d210f);}})['then'](function(_0x5a6818){if(_0x5a6818){return _0x5a6818?{'count':_0x5ad78f,'rows':_0x5a6818}:null;}})[_0x7722('0x33')](respondWithResult(_0xf90734,null))[_0x7722('0x2a')](handleError(_0xf90734,null));};exports[_0x7722('0xd9')]=function(_0x2fb82e,_0x195cb6,_0x16bf50){var _0x4fba71;var _0x3e9567;var _0x17afe5;var _0x1a3790=!_['isNil'](_0x2fb82e[_0x7722('0x64')]['id'])?_0x2fb82e[_0x7722('0x64')]['id']:!_[_0x7722('0x72')](_0x2fb82e[_0x7722('0x6d')]['id'])?_0x2fb82e['user']['id']:null;return db[_0x7722('0x60')][_0x7722('0x3b')]({'where':{'id':_0x1a3790,'role':{'$or':[_0x7722('0x9a'),_0x7722('0x6d'),'agent']}},'attributes':['id',_0x7722('0x3f'),_0x7722('0xda'),'mobile',_0x7722('0x3a'),_0x7722('0x77'),_0x7722('0xdb')]})['then'](function(_0x231a5f){if(_0x231a5f){if(_0x231a5f[_0x7722('0x3a')]==='agent'){_0x4fba71=_0x231a5f;if(_0x2fb82e[_0x7722('0x66')][_0x7722('0x9f')]){_0x17afe5=util[_0x7722('0x74')](_0x7722('0xdc'),_0x4fba71[_0x2fb82e[_0x7722('0x66')][_0x7722('0x9f')]]);}else if(_0x2fb82e[_0x7722('0x66')][_0x7722('0xdd')]){_0x17afe5=util[_0x7722('0x74')](_0x7722('0xab'),_0x2fb82e['body'][_0x7722('0xdd')]);}else{_0x17afe5=util[_0x7722('0x74')]('SIP/%s',_0x4fba71[_0x7722('0x3f')]);}socket['to'](util[_0x7722('0x74')](_0x7722('0xde'),_0x4fba71[_0x7722('0x3f')]))['emit'](_0x7722('0xdf'),{'ip':_0x2fb82e[_0x7722('0xe0')][_0x7722('0xe1')]||_0x2fb82e[_0x7722('0xe2')][_0x7722('0xe3')]||_0x2fb82e['socket'][_0x7722('0xe3')]||_0x2fb82e[_0x7722('0xe2')][_0x7722('0xe4')]['remoteAddress']});return db[_0x7722('0xad')][_0x7722('0x34')]({'where':{'membername':_0x4fba71[_0x7722('0x3f')]},'individualHooks':!![]});}}else{throw new db[(_0x7722('0x21'))][(_0x7722('0x96'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x7722('0x33')](function(){if(_0x4fba71){return _0x4fba71[_0x7722('0xe5')]({'raw':!![]});}})[_0x7722('0x33')](function(_0x598422){if(_0x4fba71){var _0x55a4ae=[];if(_0x598422){_0x3e9567=_0x598422;if(_0x3e9567[_0x7722('0x50')]){for(var _0x4b6c72=0x0;_0x4b6c72<_0x3e9567[_0x7722('0x50')];_0x4b6c72++){_0x55a4ae[_0x7722('0xaa')]({'membername':_0x4fba71[_0x7722('0x3f')],'UserId':_0x4fba71['id'],'queue_name':_0x3e9567[_0x4b6c72]['name'],'VoiceQueueId':_0x3e9567[_0x4b6c72]['id'],'interface':_0x17afe5,'paused':_0x4fba71[_0x7722('0xdb')]||![],'penalty':_0x3e9567[_0x4b6c72][_0x7722('0xe6')]||0x0});}return BPromise[_0x7722('0xac')](_0x55a4ae,function(_0x406bc9){return db[_0x7722('0xad')]['upsert'](_0x406bc9);});}}}})[_0x7722('0x33')](function(){if(_0x4fba71){return db[_0x7722('0xe7')]['findAll']({'where':{'membername':_0x4fba71[_0x7722('0x3f')],'exitAt':null}});}})[_0x7722('0x33')](function(_0x548d0d){if(_0x4fba71){var _0x113597=[];_0x548d0d[_0x7722('0xe8')](function(_0x520154){_0x113597[_0x7722('0xaa')](_0x520154[_0x7722('0x67')]({'exitAt':moment()['format'](_0x7722('0xe9'))}));});return BPromise[_0x7722('0xea')](_0x113597);}})[_0x7722('0x33')](function(){if(_0x4fba71){var _0x4a5286=[];var _0x1c8ff4=[];var _0x50e457=utils[_0x7722('0xeb')]();var _0xe0c42={'membername':_0x4fba71['name'],'interface':_0x17afe5,'enterAt':moment()[_0x7722('0x74')](_0x7722('0xe9')),'role':_0x4fba71[_0x7722('0x3a')],'internal':_0x4fba71[_0x7722('0x77')]};_0x50e457['forEach'](function(_0x5b909d){_0x4a5286[_0x7722('0xaa')](_[_0x7722('0x57')]({'channel':_0x5b909d,'type':_0x7722('0xec'),'data1':_0x2fb82e[_0x7722('0x66')][_0x7722('0xed')],'data2':_0x17afe5},_0xe0c42));if(_0x4fba71[_0x7722('0xdb')]){_0x1c8ff4[_0x7722('0xaa')](_[_0x7722('0x57')]({'channel':_0x5b909d,'type':_0x7722('0xee'),'data1':_0x7722('0xef')},_0xe0c42));}});return db[_0x7722('0xe7')][_0x7722('0x65')](_0x4a5286[_0x7722('0xf0')](_0x1c8ff4),{'individualHooks':!![]});}})['then'](function(){if(_0x4fba71){return _0x4fba71[_0x7722('0x67')]({'online':!![],'lastLoginAt':moment()[_0x7722('0x74')](_0x7722('0xe9')),'voicePause':_0x4fba71['loginInPause']||![],'mailPause':_0x4fba71[_0x7722('0xdb')]||![],'chatPause':_0x4fba71[_0x7722('0xdb')]||![],'faxPause':_0x4fba71[_0x7722('0xdb')]||![],'smsPause':_0x4fba71[_0x7722('0xdb')]||![],'openchannelPause':_0x4fba71['loginInPause']||![],'whatsappPause':_0x4fba71[_0x7722('0xdb')]||![],'pauseType':_0x4fba71[_0x7722('0xdb')]?'LOGININPAUSE':null,'interface':_0x17afe5,'lastPauseAt':moment()[_0x7722('0x74')](_0x7722('0xe9'))});}})[_0x7722('0x33')](function(_0x51002f){if(_0x2fb82e[_0x7722('0xf1')]){return _0x16bf50();}else{return BPromise['resolve'](_0x51002f)[_0x7722('0x33')](respondWithResult(_0x195cb6,null));}})[_0x7722('0x2a')](handleError(_0x195cb6,null));};exports[_0x7722('0xf2')]=function(_0x1fc1ae,_0xa68a85,_0x373791){var _0x43c129;return db[_0x7722('0x60')][_0x7722('0x3b')]({'where':{'id':_0x1fc1ae[_0x7722('0x64')]['id'],'role':_0x7722('0x6a')},'attributes':['id',_0x7722('0x3f'),_0x7722('0x3a')]})[_0x7722('0x33')](handleEntityNotFound(_0xa68a85,null))['then'](function(_0x117f98){if(_0x117f98){_0x43c129=_0x117f98;return db['UserVoiceQueueRt'][_0x7722('0x34')]({'where':{'membername':_0x43c129[_0x7722('0x3f')]},'individualHooks':!![]});}})[_0x7722('0x33')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x43c129['name'],'exitAt':null}});})[_0x7722('0x33')](function(_0x5d6228){var _0x458247=[];_0x5d6228[_0x7722('0xe8')](function(_0x4c5add){_0x458247[_0x7722('0xaa')](_0x4c5add[_0x7722('0x67')]({'exitAt':moment()[_0x7722('0x74')](_0x7722('0xe9'))}));});return BPromise['all'](_0x458247);})[_0x7722('0x33')](function(){return _0x43c129['update']({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0xa68a85,null))[_0x7722('0x2a')](handleError(_0xa68a85,null));};exports[_0x7722('0xf3')]=function(_0x190ce3,_0x4e5cec,_0x484783){var _0x5d0322;return db['UserVoiceQueueRt'][_0x7722('0x67')]({'paused':0x1},{'where':{'UserId':_0x190ce3[_0x7722('0x64')]['id']},'individualHooks':!![]})[_0x7722('0x33')](function(){return db[_0x7722('0x60')][_0x7722('0x3b')]({'where':{'id':_0x190ce3[_0x7722('0x64')]['id'],'role':_0x7722('0x6a')},'attributes':['id',_0x7722('0x3f'),_0x7722('0x3a'),'internal','interface']});})['then'](handleEntityNotFound(_0x4e5cec,null))[_0x7722('0x33')](function(_0x4c15f5){if(_0x4c15f5){_0x5d0322=_0x4c15f5;return respondWithRpcPromise(_0x7722('0xf4'),_0x7722('0xf3'),{'id':_0x5d0322['id'],'name':_0x5d0322['name'],'pause':!![]});}})['then'](function(){if(_0x5d0322){return db[_0x7722('0xe7')][_0x7722('0x61')]({'where':{'membername':_0x5d0322[_0x7722('0x3f')],'type':_0x7722('0xee'),'exitAt':null}});}})[_0x7722('0x33')](function(_0x5b6c04){if(_0x5b6c04[_0x7722('0x50')]){var _0x4228cf=moment()['format'](_0x7722('0xe9'));for(var _0x5a42ed=0x0,_0x5e0574=_0x5b6c04['length'];_0x5a42ed<_0x5e0574;_0x5a42ed++){_0x5b6c04[_0x5a42ed][_0x7722('0xf5')]({'exitAt':_0x4228cf});}}})['then'](function(){var _0x36283c=[];var _0xee27d6=utils[_0x7722('0xeb')]();_0xee27d6[_0x7722('0xe8')](function(_0x5f4242){_0x36283c[_0x7722('0xaa')]({'channel':_0x5f4242,'membername':_0x5d0322[_0x7722('0x3f')],'interface':_[_0x7722('0x72')](_0x5d0322[_0x7722('0x9f')])?util[_0x7722('0x74')]('SIP/%s',_0x5d0322[_0x7722('0x3f')]):_0x5d0322[_0x7722('0x9f')],'type':_0x7722('0xee'),'enterAt':moment()[_0x7722('0x74')](_0x7722('0xe9')),'data1':_0x190ce3['body']['type']||_0x7722('0xf6'),'role':_0x5d0322[_0x7722('0x3a')],'internal':_0x5d0322[_0x7722('0x77')]});});return db[_0x7722('0xe7')][_0x7722('0x65')](_0x36283c,{'individualHooks':!![]});})[_0x7722('0x33')](function(){return _0x5d0322[_0x7722('0x67')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x190ce3['body'][_0x7722('0x45')]||_0x7722('0xf6'),'lastPauseAt':moment()[_0x7722('0x74')](_0x7722('0xe9'))});})[_0x7722('0x33')](respondWithResult(_0x4e5cec,null))[_0x7722('0x2a')](handleError(_0x4e5cec,null));};exports[_0x7722('0xf7')]=function(_0x9f261f,_0x508c6f,_0x2057dd){var _0x495b11;return db[_0x7722('0x60')][_0x7722('0x3b')]({'where':{'id':_0x9f261f[_0x7722('0x64')]['id']},'attributes':['id','name',_0x7722('0x3a'),_0x7722('0x9e'),'mailPause',_0x7722('0xf8'),_0x7722('0xf9'),'openchannelPause','smsPause',_0x7722('0xfa'),'pauseType','lastPauseAt']})[_0x7722('0x33')](handleEntityNotFound(_0x508c6f,null))[_0x7722('0x33')](function(_0x4d681d){if(_0x4d681d){_0x495b11=_0x4d681d;if(_0x9f261f['body'][_0x7722('0x9c')]&&!utils[_0x7722('0xa0')](_0x9f261f[_0x7722('0x66')][_0x7722('0x9c')])){throw new db['Sequelize'][(_0x7722('0x96'))]('Unknown\x20channel');}switch(_0x9f261f['body'][_0x7722('0x9c')]){case _0x7722('0xa8'):return respondWithRpcPromise(_0x7722('0xf4'),'unpause',{'id':_0x495b11['id'],'name':_0x495b11[_0x7722('0x3f')],'pause':![]})[_0x7722('0x33')](function(){return db[_0x7722('0xad')][_0x7722('0x67')]({'paused':0x0},{'where':{'UserId':_0x495b11['id']},'individualHooks':!![]});})['then'](function(){return db['MemberReport'][_0x7722('0x3b')]({'where':{'channel':_0x9f261f[_0x7722('0x66')][_0x7722('0x9c')],'membername':_0x495b11[_0x7722('0x3f')],'type':'PAUSE','exitAt':null}});})[_0x7722('0x33')](function(_0x3178e3){if(_0x3178e3){return _0x3178e3[_0x7722('0x67')]({'exitAt':moment()[_0x7722('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x7722('0x33')](function(){return _0x495b11[_0x7722('0x67')]({'voicePause':![]});});case _0x7722('0xfb'):case _0x7722('0xfc'):case _0x7722('0xfd'):case _0x7722('0xfe'):case _0x7722('0xff'):case _0x7722('0x100'):return db[_0x7722('0xe7')][_0x7722('0x3b')]({'where':{'channel':_0x9f261f[_0x7722('0x66')][_0x7722('0x9c')],'membername':_0x495b11[_0x7722('0x3f')],'type':_0x7722('0xee'),'exitAt':null}})[_0x7722('0x33')](function(_0x5ba186){if(_0x5ba186){return _0x5ba186['update']({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x7722('0x101')},{'individualHooks':!![]});}return null;})[_0x7722('0x33')](function(){var _0x25b2e1={};_[_0x7722('0x30')](_0x25b2e1,util[_0x7722('0x74')](_0x7722('0x102'),_0x9f261f[_0x7722('0x66')][_0x7722('0x9c')],'Pause'),![]);return _0x495b11[_0x7722('0x67')](_0x25b2e1);});default:return respondWithRpcPromise(_0x7722('0xf4'),_0x7722('0xf7'),{'id':_0x495b11['id'],'name':_0x495b11[_0x7722('0x3f')],'pause':![]})[_0x7722('0x33')](function(){return db[_0x7722('0xad')]['update']({'paused':0x0},{'where':{'UserId':_0x495b11['id']}});})[_0x7722('0x33')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x495b11[_0x7722('0x3f')],'type':_0x7722('0xee'),'exitAt':null}});})[_0x7722('0x33')](function(_0x338085){var _0x5af738=[];_0x338085[_0x7722('0xe8')](function(_0x1c7f63){_0x5af738[_0x7722('0xaa')](_0x1c7f63[_0x7722('0x67')]({'exitAt':moment()[_0x7722('0x74')](_0x7722('0xe9')),'data2':_0x7722('0x101')}));});return BPromise[_0x7722('0xea')](_0x5af738);})[_0x7722('0x33')](function(){return _0x495b11[_0x7722('0x67')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x7722('0x33')](respondWithResult(_0x508c6f,null))[_0x7722('0x2a')](handleError(_0x508c6f,null));};exports[_0x7722('0x103')]=function(_0x118293,_0x37d1e4,_0x1a9682){var _0x253ade={};var _0x863b75={};var _0x3efd64;var _0xfba7aa;return db['User'][_0x7722('0x93')]({'where':{'id':_0x118293['params']['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x37d1e4,null))['then'](function(_0x4ffe4f){if(_0x4ffe4f){_0x3efd64=_0x4ffe4f;_0x863b75[_0x7722('0x47')]=_[_0x7722('0x4c')](db['Team'][_0x7722('0x43')]);_0x863b75['query']=_[_0x7722('0x4c')](_0x118293[_0x7722('0x4b')]);_0x863b75[_0x7722('0x55')]=_[_0x7722('0x4d')](_0x863b75[_0x7722('0x47')],_0x863b75[_0x7722('0x4b')]);_0x253ade[_0x7722('0x4e')]=_['intersection'](_0x863b75[_0x7722('0x47')],qs['fields'](_0x118293[_0x7722('0x4b')][_0x7722('0x4f')]));_0x253ade[_0x7722('0x4e')]=_0x253ade[_0x7722('0x4e')][_0x7722('0x50')]?_0x253ade[_0x7722('0x4e')]:_0x863b75['model'];_0x253ade[_0x7722('0x52')]=qs[_0x7722('0x53')](_0x118293['query']['sort']);_0x253ade[_0x7722('0x54')]=qs[_0x7722('0x55')](_[_0x7722('0x56')](_0x118293[_0x7722('0x4b')],_0x863b75[_0x7722('0x55')]));if(_0x118293[_0x7722('0x4b')][_0x7722('0xbc')]){_0x253ade[_0x7722('0x54')]=_[_0x7722('0x57')](_0x253ade[_0x7722('0x54')],{'$or':_['map'](_0x253ade[_0x7722('0x4e')],function(_0x113b6e){var _0x338a7b={};_0x338a7b[_0x113b6e]={'$like':'%'+_0x118293['query']['filter']+'%'};return _0x338a7b;})});}_0x253ade=_['merge']({},_0x253ade,_0x118293[_0x7722('0x5c')]);return _0x3efd64['getTeams'](_0x253ade);}})[_0x7722('0x33')](function(_0x16f18d){if(_0x16f18d){_0xfba7aa=_0x16f18d['length'];if(!_0x118293['query'][_0x7722('0x51')](_0x7722('0xc2'))){_0x253ade[_0x7722('0x2f')]=qs[_0x7722('0x2f')](_0x118293[_0x7722('0x4b')][_0x7722('0x2f')]);_0x253ade[_0x7722('0x2e')]=qs[_0x7722('0x2e')](_0x118293[_0x7722('0x4b')][_0x7722('0x2e')]);}return _0x3efd64[_0x7722('0x103')](_0x253ade);}})[_0x7722('0x33')](function(_0x9ac135){if(_0x9ac135){return _0x9ac135?{'count':_0xfba7aa,'rows':_0x9ac135}:null;}})[_0x7722('0x33')](respondWithResult(_0x37d1e4,null))['catch'](handleError(_0x37d1e4,null));};exports[_0x7722('0x104')]=function(_0x38ea51,_0x96bb7e){return db[_0x7722('0x60')]['find']({'where':{'id':_0x38ea51[_0x7722('0x64')]['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x96bb7e,null))['then'](function(_0x1a1c5f){if(_0x1a1c5f){var _0x3c1a09=_0x1a1c5f[_0x7722('0x35')]({'plain':!![]});return _0x1a1c5f[_0x7722('0x104')](_0x38ea51[_0x7722('0x66')]['ids'],_[_0x7722('0x105')](_0x38ea51[_0x7722('0x66')],['ids','id'])||{})['then'](function(){for(var _0x124865=0x0;_0x124865<_0x38ea51[_0x7722('0x66')][_0x7722('0x69')][_0x7722('0x50')];_0x124865++){var _0x2bfc41=[];db[_0x7722('0x106')][_0x7722('0x93')]({'where':{'id':_0x38ea51['body']['ids'][_0x124865]}})[_0x7722('0x33')](function(_0x4fa9e7){_0x2bfc41[_0x7722('0xaa')](_0x4fa9e7['getVoiceQueues']()[_0x7722('0x33')](function(_0x38f514){for(var _0x2f3828=0x0;_0x2f3828<_0x38f514[_0x7722('0x50')];_0x2f3828++){_0x38f514[_0x2f3828]['setDataValue'](_0x7722('0x9c'),'Voice');}return _0x38f514;}));_0x2bfc41[_0x7722('0xaa')](_0x4fa9e7[_0x7722('0x107')]()[_0x7722('0x33')](function(_0x48f740){for(var _0xbda601=0x0;_0xbda601<_0x48f740['length'];_0xbda601++){_0x48f740[_0xbda601][_0x7722('0x108')](_0x7722('0x9c'),_0x7722('0x109'));}return _0x48f740;}));_0x2bfc41['push'](_0x4fa9e7['getMailQueues']()[_0x7722('0x33')](function(_0x18d2b4){for(var _0x3c075d=0x0;_0x3c075d<_0x18d2b4['length'];_0x3c075d++){_0x18d2b4[_0x3c075d]['setDataValue'](_0x7722('0x9c'),_0x7722('0x10a'));}return _0x18d2b4;}));_0x2bfc41[_0x7722('0xaa')](_0x4fa9e7[_0x7722('0x10b')]()[_0x7722('0x33')](function(_0x49ad7a){for(var _0x5273e2=0x0;_0x5273e2<_0x49ad7a[_0x7722('0x50')];_0x5273e2++){_0x49ad7a[_0x5273e2][_0x7722('0x108')]('channel',_0x7722('0x10c'));}return _0x49ad7a;}));_0x2bfc41[_0x7722('0xaa')](_0x4fa9e7['getWhatsappQueues']()[_0x7722('0x33')](function(_0x76b1c4){for(var _0x2dcdba=0x0;_0x2dcdba<_0x76b1c4[_0x7722('0x50')];_0x2dcdba++){_0x76b1c4[_0x2dcdba]['setDataValue']('channel','Whatsapp');}return _0x76b1c4;}));_0x2bfc41[_0x7722('0xaa')](_0x4fa9e7['getFaxQueues']()[_0x7722('0x33')](function(_0x3327bc){for(var _0x48075d=0x0;_0x48075d<_0x3327bc[_0x7722('0x50')];_0x48075d++){_0x3327bc[_0x48075d][_0x7722('0x108')](_0x7722('0x9c'),_0x7722('0x10d'));}return _0x3327bc;}));_0x2bfc41['push'](_0x4fa9e7[_0x7722('0x10e')]()[_0x7722('0x33')](function(_0x49caea){for(var _0x48ba18=0x0;_0x48ba18<_0x49caea['length'];_0x48ba18++){_0x49caea[_0x48ba18][_0x7722('0x108')](_0x7722('0x9c'),_0x7722('0x10f'));}return _0x49caea;}));return BPromise[_0x7722('0xea')](_0x2bfc41);})[_0x7722('0x33')](function(_0x4c7122){var _0x2a0801=_[_0x7722('0x110')](_0x4c7122);_0x2bfc41=[];return db[_0x7722('0x59')][_0x7722('0x111')](function(_0x561685){for(var _0xad1d70=0x0;_0xad1d70<_0x2a0801[_0x7722('0x50')];_0xad1d70++){_0x2bfc41[_0x7722('0xaa')](_0x2a0801[_0xad1d70][_0x7722('0x112')](_0x3c1a09['id']),{'transaction':_0x561685});}return BPromise['all'](_0x2bfc41)[_0x7722('0x33')](function(){if(_0x3c1a09['online']){return BPromise[_0x7722('0xac')](_[_0x7722('0xbc')](_0x2a0801,function(_0x3c05fa){return _0x3c05fa[_0x7722('0x113')]('channel')===_0x7722('0x114');}),function(_0xa31891){return db[_0x7722('0xad')][_0x7722('0xae')]({'membername':_0x3c1a09[_0x7722('0x3f')],'UserId':_0x3c1a09['id'],'queue_name':_0xa31891['name'],'VoiceQueueId':_0xa31891['id'],'interface':_[_0x7722('0x72')](_0x3c1a09['interface'])?util[_0x7722('0x74')](_0x7722('0xab'),_0x3c1a09['name']):_0x3c1a09[_0x7722('0x9f')],'paused':_0x3c1a09[_0x7722('0x9e')]||![],'penalty':_0x3c1a09[_0x7722('0xa4')]},{'transaction':_0x561685});});}else{return;}})['then'](function(){for(var _0x19be8c=0x0;_0x19be8c<_0x2a0801[_0x7722('0x50')];_0x19be8c++){var _0x2f80ca=_0x2a0801[_0x19be8c]['getDataValue'](_0x7722('0x9c'));var _0x573474=_0x2f80ca+_0x7722('0xb0');socket['emit'](_0x7722('0x6d')+_0x2f80ca+_0x7722('0xa7'),{'UserId':_0x3c1a09['id'],['queueField']:_0x2a0801[_0x19be8c]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x96bb7e,null))[_0x7722('0x2a')](handleError(_0x96bb7e,null));};exports[_0x7722('0x115')]=function(_0x214f56,_0x482426){return db[_0x7722('0x60')][_0x7722('0x93')]({'where':{'id':_0x214f56['params']['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x482426,null))[_0x7722('0x33')](function(_0x8cc3ce){if(_0x8cc3ce){var _0x15f8fa=_0x8cc3ce[_0x7722('0x35')]({'plain':!![]});var _0xc3c431=_0x214f56[_0x7722('0x4b')]['ids'];return _0x8cc3ce[_0x7722('0x115')](_0xc3c431)[_0x7722('0x33')](function(){for(var _0x34c229=0x0;_0x34c229<_0xc3c431['length'];_0x34c229++){var _0x148b6e=[];db['Team'][_0x7722('0x93')]({'where':{'id':_0xc3c431[_0x34c229]}})[_0x7722('0x33')](function(_0x363da8){_0x148b6e[_0x7722('0xaa')](_0x363da8[_0x7722('0xe5')]()[_0x7722('0x33')](function(_0x5afddc){for(var _0x11ffc4=0x0;_0x11ffc4<_0x5afddc[_0x7722('0x50')];_0x11ffc4++){_0x5afddc[_0x11ffc4][_0x7722('0x108')](_0x7722('0x9c'),_0x7722('0x114'));}return _0x5afddc;}));_0x148b6e[_0x7722('0xaa')](_0x363da8['getChatQueues']()[_0x7722('0x33')](function(_0x20e3cd){for(var _0x243c26=0x0;_0x243c26<_0x20e3cd[_0x7722('0x50')];_0x243c26++){_0x20e3cd[_0x243c26][_0x7722('0x108')](_0x7722('0x9c'),_0x7722('0x109'));}return _0x20e3cd;}));_0x148b6e[_0x7722('0xaa')](_0x363da8['getMailQueues']()['then'](function(_0xcb07ec){for(var _0x1f7045=0x0;_0x1f7045<_0xcb07ec[_0x7722('0x50')];_0x1f7045++){_0xcb07ec[_0x1f7045][_0x7722('0x108')](_0x7722('0x9c'),_0x7722('0x10a'));}return _0xcb07ec;}));_0x148b6e[_0x7722('0xaa')](_0x363da8[_0x7722('0x10b')]()['then'](function(_0x332a86){for(var _0x4a80ae=0x0;_0x4a80ae<_0x332a86[_0x7722('0x50')];_0x4a80ae++){_0x332a86[_0x4a80ae]['setDataValue'](_0x7722('0x9c'),'Sms');}return _0x332a86;}));_0x148b6e[_0x7722('0xaa')](_0x363da8['getWhatsappQueues']()[_0x7722('0x33')](function(_0x1117c2){for(var _0x4e6007=0x0;_0x4e6007<_0x1117c2[_0x7722('0x50')];_0x4e6007++){_0x1117c2[_0x4e6007][_0x7722('0x108')]('channel',_0x7722('0x116'));}return _0x1117c2;}));_0x148b6e[_0x7722('0xaa')](_0x363da8[_0x7722('0x117')]()[_0x7722('0x33')](function(_0x6fed34){for(var _0x3a0935=0x0;_0x3a0935<_0x6fed34[_0x7722('0x50')];_0x3a0935++){_0x6fed34[_0x3a0935][_0x7722('0x108')](_0x7722('0x9c'),_0x7722('0x10d'));}return _0x6fed34;}));_0x148b6e['push'](_0x363da8['getOpenchannelQueues']()['then'](function(_0x29f553){for(var _0x686328=0x0;_0x686328<_0x29f553[_0x7722('0x50')];_0x686328++){_0x29f553[_0x686328][_0x7722('0x108')](_0x7722('0x9c'),_0x7722('0x10f'));}return _0x29f553;}));return BPromise[_0x7722('0xea')](_0x148b6e);})[_0x7722('0x33')](function(_0x4b3975){var _0x20e990=_[_0x7722('0x110')](_0x4b3975);_0x148b6e=[];return db['sequelize'][_0x7722('0x111')](function(_0x3ee800){for(var _0x569400=0x0;_0x569400<_0x20e990[_0x7722('0x50')];_0x569400++){_0x148b6e[_0x7722('0xaa')](_0x20e990[_0x569400][_0x7722('0x118')](_0x15f8fa['id']),{'transaction':_0x3ee800});}return BPromise[_0x7722('0xea')](_0x148b6e)[_0x7722('0x33')](function(){if(_0x15f8fa[_0x7722('0x9d')]){return BPromise[_0x7722('0xac')](_[_0x7722('0xbc')](_0x20e990,function(_0x55e717){return _0x55e717[_0x7722('0x113')](_0x7722('0x9c'))==='Voice';}),function(_0x3e421d){return db[_0x7722('0xad')][_0x7722('0x34')]({'where':{'VoiceQueueId':_0x3e421d['id'],'UserId':_0x15f8fa['id']},'transaction':_0x3ee800});});}else{return;}})[_0x7722('0x33')](function(){for(var _0x55260c=0x0;_0x55260c<_0x20e990[_0x7722('0x50')];_0x55260c++){var _0x212c54=_0x20e990[_0x55260c][_0x7722('0x113')]('channel');var _0x24f9f0=_0x212c54+_0x7722('0xb0');socket[_0x7722('0xa6')](_0x7722('0x6d')+_0x212c54+'Queue:remove',{'UserId':_0x15f8fa['id'],['queueField']:_0x20e990[_0x55260c]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x482426,null))['catch'](handleError(_0x482426,null));};exports['getLists']=function(_0x10aa97,_0x40daec,_0x5c2b92){var _0x388f84={};var _0x4d296c={};var _0x6a5dd3;var _0x423a05;return db[_0x7722('0x60')][_0x7722('0x93')]({'where':{'id':_0x10aa97[_0x7722('0x64')]['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x40daec,null))[_0x7722('0x33')](function(_0x5ef1b9){if(_0x5ef1b9){_0x6a5dd3=_0x5ef1b9;_0x4d296c[_0x7722('0x47')]=_[_0x7722('0x4c')](db[_0x7722('0xbd')]['rawAttributes']);_0x4d296c[_0x7722('0x4b')]=_[_0x7722('0x4c')](_0x10aa97[_0x7722('0x4b')]);_0x4d296c[_0x7722('0x55')]=_[_0x7722('0x4d')](_0x4d296c[_0x7722('0x47')],_0x4d296c[_0x7722('0x4b')]);_0x388f84[_0x7722('0x4e')]=_[_0x7722('0x4d')](_0x4d296c[_0x7722('0x47')],qs['fields'](_0x10aa97['query'][_0x7722('0x4f')]));_0x388f84[_0x7722('0x4e')]=_0x388f84[_0x7722('0x4e')][_0x7722('0x50')]?_0x388f84['attributes']:_0x4d296c[_0x7722('0x47')];_0x388f84[_0x7722('0x52')]=qs['sort'](_0x10aa97[_0x7722('0x4b')]['sort']);_0x388f84[_0x7722('0x54')]=qs[_0x7722('0x55')](_[_0x7722('0x56')](_0x10aa97[_0x7722('0x4b')],_0x4d296c[_0x7722('0x55')]));if(_0x10aa97['query'][_0x7722('0xbc')]){_0x388f84[_0x7722('0x54')]=_[_0x7722('0x57')](_0x388f84['where'],{'$or':_[_0x7722('0x42')](_0x388f84[_0x7722('0x4e')],function(_0x2dc1a2){var _0xffa9fb={};_0xffa9fb[_0x2dc1a2]={'$like':'%'+_0x10aa97[_0x7722('0x4b')][_0x7722('0xbc')]+'%'};return _0xffa9fb;})});}_0x388f84=_[_0x7722('0x57')]({},_0x388f84,_0x10aa97['options']);return _0x6a5dd3['getLists'](_0x388f84);}})[_0x7722('0x33')](function(_0x36839a){if(_0x36839a){_0x423a05=_0x36839a[_0x7722('0x50')];if(!_0x10aa97[_0x7722('0x4b')]['hasOwnProperty'](_0x7722('0xc2'))){_0x388f84[_0x7722('0x2f')]=qs[_0x7722('0x2f')](_0x10aa97['query'][_0x7722('0x2f')]);_0x388f84[_0x7722('0x2e')]=qs[_0x7722('0x2e')](_0x10aa97[_0x7722('0x4b')][_0x7722('0x2e')]);}return _0x6a5dd3[_0x7722('0x119')](_0x388f84);}})[_0x7722('0x33')](function(_0x70eb4f){if(_0x70eb4f){return _0x70eb4f?{'count':_0x423a05,'rows':_0x70eb4f}:null;}})[_0x7722('0x33')](respondWithResult(_0x40daec,null))[_0x7722('0x2a')](handleError(_0x40daec,null));};exports[_0x7722('0x11a')]=function(_0x49d4b9,_0x54ac83,_0x9a8e96){var _0x472618={};var _0x34aa26={};var _0x58bdb5;var _0x17f9a2;return db[_0x7722('0x60')][_0x7722('0x93')]({'where':{'id':_0x49d4b9[_0x7722('0x64')]['id']}})[_0x7722('0x33')](handleEntityNotFound(_0x54ac83,null))['then'](function(_0x1df9b2){if(_0x1df9b2){_0x58bdb5=_0x1df9b2;_0x34aa26[_0x7722('0x47')]=_[_0x7722('0x4c')](db[_0x7722('0x60')]['rawAttributes']);_0x34aa26[_0x7722('0x4b')]=_['keys'](_0x49d4b9[_0x7722('0x4b')]);_0x34aa26[_0x7722('0x55')]=_[_0x7722('0x4d')](_0x34aa26[_0x7722('0x47')],_0x34aa26[_0x7722('0x4b')]);_0x472618[_0x7722('0x4e')]=_[_0x7722('0x4d')](_0x34aa26['model'],qs[_0x7722('0x4f')](_0x49d4b9['query'][_0x7722('0x4f')]));_0x472618[_0x7722('0x4e')]=_0x472618[_0x7722('0x4e')][_0x7722('0x50')]?_0x472618[_0x7722('0x4e')]:_0x34aa26['model'];_0x472618[_0x7722('0x52')]=qs[_0x7722('0x53')](_0x49d4b9[_0x7722('0x4b')][_0x7722('0x53')]);_0x472618[_0x7722('0x54')]=qs[_0x7722('0x55')](_[_0x7722('0x56')](_0x49d4b9[_0x7722('0x4b')],_0x34aa26[_0x7722('0x55')]));if(_0x49d4b9[_0x7722('0x4b')][_0x7722('0xbc')]){_0x472618['where']=_[_0x7722('0x57')](_0x472618[_0x7722('0x54')],{'$or':_[_0x7722('0x42')](_0x472618[_0x7722('0x4e')],function(_0x5df5d3){var _0x3b50e5={};_0x3b50e5[_0x5df5d3]={'$like':'%'+_0x49d4b9['query'][_0x7722('0xbc')]+'%'};return _0x3b50e5;})});}_0x472618[_0x7722('0x47')]=db[_0x7722('0x60')];_0x472618['as']='Agents';_0x472618=_['merge']({},_0x472618,_0x49d4b9['options']);return _0x58bdb5['getVoiceQueues']({'include':[_0x472618]});}})['then'](function(_0x770f11){if(_0x770f11){var _0x36cae0={},_0x14c152=[],_0x4ec86e=0x0;for(var _0x555deb=0x0;_0x555deb<_0x770f11[_0x7722('0x50')];_0x555deb+=0x1){for(var _0x4e5466=0x0,_0x218045;_0x4e5466<_0x770f11[_0x555deb][_0x7722('0x36')][_0x7722('0x50')];_0x4e5466+=0x1){_0x218045=_0x770f11[_0x555deb][_0x7722('0x36')][_0x4e5466][_0x7722('0x35')]({'plain':!![]});_0x36cae0[_0x218045['id']]=_0x218045;}}_0x36cae0=_[_0x7722('0x11b')](_0x36cae0);for(var _0x12e1b8=qs[_0x7722('0x2e')](_0x49d4b9['query'][_0x7722('0x2e')]);_0x12e1b8<_0x36cae0['length']&&_0x14c152[_0x7722('0x50')]=_0x3becfd[_0xfdd7('0x51')]){throw new Error(_0xfdd7('0x52'));}})[_0xfdd7('0x10')](function(){if(_0x233885){return db[_0xfdd7('0x2b')][_0xfdd7('0x49')]({'where':{'membername':_0x233885[_0xfdd7('0x28')]},'individualHooks':!![]});}})[_0xfdd7('0x10')](function(){if(_0x233885){return _0x233885['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x449de0){if(_0x233885){if(_0x449de0){var _0x314fe6=[];_0x140d85=_0x449de0;if(_0x140d85[_0xfdd7('0x2e')]){for(var _0x52fa3f=0x0;_0x52fa3f<_0x140d85[_0xfdd7('0x2e')];_0x52fa3f++){_0x314fe6[_0xfdd7('0x47')](db[_0xfdd7('0x2b')][_0xfdd7('0x53')]({'membername':_0x233885[_0xfdd7('0x28')],'UserId':_0x233885['id'],'queue_name':_0x140d85[_0x52fa3f][_0xfdd7('0x28')],'VoiceQueueId':_0x140d85[_0x52fa3f]['id'],'interface':_0xbe92c6,'paused':_0x233885[_0xfdd7('0x4d')]||![],'penalty':_0x140d85[_0x52fa3f][_0xfdd7('0x54')]||0x0}));}return BPromise[_0xfdd7('0x4a')](_0x314fe6);}}}})[_0xfdd7('0x10')](function(){if(_0x233885){return db['MemberReport'][_0xfdd7('0x1a')]({'where':{'membername':_0x233885[_0xfdd7('0x28')],'exitAt':null}});}})[_0xfdd7('0x10')](function(_0x1ee408){if(_0x233885){if(_0x1ee408&&_0x1ee408[_0xfdd7('0x2e')]){var _0x4aa8cd=[];_0x1ee408[_0xfdd7('0x32')](function(_0x3a4523){_0x4aa8cd[_0xfdd7('0x47')](_0x3a4523[_0xfdd7('0x40')]({'exitAt':moment()[_0xfdd7('0x2f')](_0xfdd7('0x30'))}));});return BPromise[_0xfdd7('0x4a')](_0x4aa8cd);}}})[_0xfdd7('0x10')](function(_0x48e0f6){if(_0x233885){var _0x114329=[];var _0x445618=[];var _0x4d5f89=utils[_0xfdd7('0x31')]();var _0x523873={'membername':_0x233885[_0xfdd7('0x28')],'interface':_0xbe92c6,'enterAt':moment()['format'](_0xfdd7('0x30')),'role':_0x233885['role'],'internal':_0x233885['internal']};_0x4d5f89[_0xfdd7('0x32')](function(_0x14c005){_0x114329[_0xfdd7('0x47')](_[_0xfdd7('0x55')]({'channel':_0x14c005,'type':_0xfdd7('0x56'),'data1':_0xfdd7('0x57'),'data2':_0xbe92c6},_0x523873));if(_0x233885['loginInPause']){_0x445618[_0xfdd7('0x47')](_[_0xfdd7('0x55')]({'channel':_0x14c005,'type':_0xfdd7('0x2d'),'data1':_0xfdd7('0x58')},_0x523873));}});return db[_0xfdd7('0x2c')]['bulkCreate'](_0x114329[_0xfdd7('0x59')](_0x445618),{'individualHooks':!![]});}})[_0xfdd7('0x10')](function(){if(_0x233885){return _0x233885[_0xfdd7('0x40')]({'online':!![],'lastLoginAt':moment()[_0xfdd7('0x2f')](_0xfdd7('0x30')),'voicePause':_0x233885['loginInPause']||![],'mailPause':_0x233885[_0xfdd7('0x4d')]||![],'chatPause':_0x233885['loginInPause']||![],'faxPause':_0x233885['loginInPause']||![],'smsPause':_0x233885[_0xfdd7('0x4d')]||![],'openchannelPause':_0x233885[_0xfdd7('0x4d')]||![],'pauseType':_0x233885[_0xfdd7('0x4d')]?_0xfdd7('0x58'):null,'lastPauseAt':moment()['format'](_0xfdd7('0x30')),'interface':_0xbe92c6});}})[_0xfdd7('0x10')](function(_0x2c89c1){_0x51e071(_0x2c89c1);})[_0xfdd7('0x18')](function(_0x35a344){_0x33ac0b(_0x528ed2[_0xfdd7('0x15')](0x1f4,_0x35a344[_0xfdd7('0x16')]));});});}; \ No newline at end of file +var _0x276f=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','User','findAll','options','raw','attributes','limit','map','include','model','GetUser','ShowUser','find','PauseUser','where','name','internal','interface','UserVoiceQueueRt','update','then','MemberReport','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','body','DEFAULT\x20PAUSE','uniqueid','bulkCreate','type','UnpauseUser','channel','isValidChannel','system','mail','chat','fax','sms','openchannel','set','%s%s','Pause','all','LogoutUser','findOne','destroy','LoginUser','role','phone','loginInPause','count','getLicense','agents','upsert','merge','LOGIN','callysquare','LOGININPAUSE','lodash'];(function(_0x35097a,_0x124c6c){var _0x252715=function(_0x1f8d8e){while(--_0x1f8d8e){_0x35097a['push'](_0x35097a['shift']());}};_0x252715(++_0x124c6c);}(_0x276f,0x1c1));var _0xf276=function(_0x713123,_0x5ba66a){_0x713123=_0x713123-0x0;var _0x2e793e=_0x276f[_0x713123];return _0x2e793e;};'use strict';var _=require(_0xf276('0x0'));var util=require(_0xf276('0x1'));var moment=require(_0xf276('0x2'));var BPromise=require(_0xf276('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf276('0x4'));var db=require(_0xf276('0x5'))['db'];var utils=require(_0xf276('0x6'));var logger=require(_0xf276('0x7'))('rpc');var config=require(_0xf276('0x8'));var jayson=require(_0xf276('0x9'));var client=jayson[_0xf276('0xa')][_0xf276('0xb')]({'port':0x232a});config['redis']=_[_0xf276('0xc')](config['redis'],{'host':_0xf276('0xd'),'port':0x18eb});var socket=require(_0xf276('0xe'))(new Redis(config[_0xf276('0xf')]));require('./user.socket')['register'](socket);function respondWithRpcPromise(_0x12880a,_0x11e87a,_0x4dde4d){return new BPromise(function(_0x4373c3,_0x4ac162){return client['request'](_0x12880a,_0x4dde4d)['then'](function(_0x58a24f){logger[_0xf276('0x10')](_0xf276('0x11'),_0x11e87a,_0xf276('0x12'));logger[_0xf276('0x13')](_0xf276('0x14'),_0x11e87a,'request\x20sent',JSON[_0xf276('0x15')](_0x58a24f));if(_0x58a24f['error']){if(_0x58a24f['error'][_0xf276('0x16')]===0x1f4){logger[_0xf276('0x17')](_0xf276('0x11'),_0x11e87a,_0x58a24f[_0xf276('0x17')]['message']);return _0x4ac162(_0x58a24f['error'][_0xf276('0x18')]);}logger[_0xf276('0x17')](_0xf276('0x11'),_0x11e87a,_0x58a24f['error']['message']);return _0x4373c3(_0x58a24f[_0xf276('0x17')][_0xf276('0x18')]);}else{logger[_0xf276('0x10')](_0xf276('0x11'),_0x11e87a,'request\x20sent');_0x4373c3(_0x58a24f['result'][_0xf276('0x18')]);}})[_0xf276('0x19')](function(_0xa8ef44){logger['error']('User,\x20%s,\x20%s',_0x11e87a,_0xa8ef44);_0x4ac162(_0xa8ef44);});});}exports['GetUser']=function(_0x396e87){var _0x40ac92=this;return new Promise(function(_0xf2f601,_0x138b4a){return db[_0xf276('0x1a')][_0xf276('0x1b')]({'raw':_0x396e87[_0xf276('0x1c')]?_0x396e87[_0xf276('0x1c')][_0xf276('0x1d')]===undefined?!![]:![]:!![],'where':_0x396e87[_0xf276('0x1c')]?_0x396e87[_0xf276('0x1c')]['where']||null:null,'attributes':_0x396e87[_0xf276('0x1c')]?_0x396e87['options'][_0xf276('0x1e')]||null:null,'limit':_0x396e87[_0xf276('0x1c')]?_0x396e87[_0xf276('0x1c')][_0xf276('0x1f')]||null:null,'include':_0x396e87[_0xf276('0x1c')]?_0x396e87[_0xf276('0x1c')]['include']?_[_0xf276('0x20')](_0x396e87[_0xf276('0x1c')][_0xf276('0x21')],function(_0x17c6bc){return{'model':db[_0x17c6bc[_0xf276('0x22')]],'as':_0x17c6bc['as'],'attributes':_0x17c6bc[_0xf276('0x1e')],'include':_0x17c6bc['include']?_[_0xf276('0x20')](_0x17c6bc[_0xf276('0x21')],function(_0x474860){return{'model':db[_0x474860['model']],'as':_0x474860['as'],'attributes':_0x474860[_0xf276('0x1e')],'include':_0x474860[_0xf276('0x21')]?_[_0xf276('0x20')](_0x474860['include'],function(_0x21dc5c){return{'model':db[_0x21dc5c['model']],'as':_0x21dc5c['as'],'attributes':_0x21dc5c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x7db56a){logger[_0xf276('0x10')](_0xf276('0x23'),_0x396e87);logger['debug'](_0xf276('0x23'),_0x396e87,JSON[_0xf276('0x15')](_0x7db56a));_0xf2f601(_0x7db56a);})[_0xf276('0x19')](function(_0x125e2e){logger[_0xf276('0x17')](_0xf276('0x23'),_0x125e2e['message'],_0x396e87);_0x138b4a(_0x40ac92[_0xf276('0x17')](0x1f4,_0x125e2e[_0xf276('0x18')]));});});};exports[_0xf276('0x24')]=function(_0x5ac2c7){var _0x56ad71=this;return new Promise(function(_0x2143fd,_0x5b17fb){return db['User'][_0xf276('0x25')]({'raw':_0x5ac2c7[_0xf276('0x1c')]?_0x5ac2c7[_0xf276('0x1c')][_0xf276('0x1d')]===undefined?!![]:![]:!![],'where':_0x5ac2c7['options']?_0x5ac2c7[_0xf276('0x1c')]['where']||null:null,'attributes':_0x5ac2c7[_0xf276('0x1c')]?_0x5ac2c7['options'][_0xf276('0x1e')]||null:null,'include':_0x5ac2c7[_0xf276('0x1c')]?_0x5ac2c7[_0xf276('0x1c')][_0xf276('0x21')]?_[_0xf276('0x20')](_0x5ac2c7[_0xf276('0x1c')][_0xf276('0x21')],function(_0x269e22){return{'model':db[_0x269e22[_0xf276('0x22')]],'as':_0x269e22['as'],'attributes':_0x269e22[_0xf276('0x1e')],'include':_0x269e22[_0xf276('0x21')]?_['map'](_0x269e22[_0xf276('0x21')],function(_0xc991cf){return{'model':db[_0xc991cf[_0xf276('0x22')]],'as':_0xc991cf['as'],'attributes':_0xc991cf[_0xf276('0x1e')],'include':_0xc991cf[_0xf276('0x21')]?_[_0xf276('0x20')](_0xc991cf[_0xf276('0x21')],function(_0x218205){return{'model':db[_0x218205[_0xf276('0x22')]],'as':_0x218205['as'],'attributes':_0x218205[_0xf276('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a816e){logger['info'](_0xf276('0x24'),_0x5ac2c7);logger[_0xf276('0x13')]('ShowUser',_0x5ac2c7,JSON[_0xf276('0x15')](_0x1a816e));_0x2143fd(_0x1a816e);})[_0xf276('0x19')](function(_0x579385){logger[_0xf276('0x17')](_0xf276('0x24'),_0x579385[_0xf276('0x18')],_0x5ac2c7);_0x5b17fb(_0x56ad71[_0xf276('0x17')](0x1f4,_0x579385[_0xf276('0x18')]));});});};exports[_0xf276('0x26')]=function(_0xab539f){var _0x47ce72=this;return new Promise(function(_0x3119d3,_0x5b5722){var _0x1bc55f;return db[_0xf276('0x1a')][_0xf276('0x25')]({'where':_0xab539f[_0xf276('0x1c')][_0xf276('0x27')]||{},'attributes':['id',_0xf276('0x28'),'role',_0xf276('0x29'),_0xf276('0x2a')]})['then'](function(_0x4b77a3){if(_0x4b77a3){_0x1bc55f=_0x4b77a3;return db[_0xf276('0x2b')][_0xf276('0x2c')]({'paused':0x1},{'where':{'UserId':_0x1bc55f['id']},'individualHooks':!![]});}})[_0xf276('0x2d')](function(){if(_0x1bc55f){return db[_0xf276('0x2e')]['findAll']({'where':{'membername':_0x1bc55f['name'],'type':_0xf276('0x2f'),'exitAt':null}});}})[_0xf276('0x2d')](function(_0x1a714c){if(_0x1bc55f){if(_0x1a714c&&_0x1a714c['length']){var _0xa773d7=moment()[_0xf276('0x30')](_0xf276('0x31'));for(var _0x23777c=0x0,_0x10239a=_0x1a714c[_0xf276('0x32')];_0x23777c<_0x10239a;_0x23777c++){_0x1a714c[_0x23777c][_0xf276('0x33')]({'exitAt':_0xa773d7});}}}})[_0xf276('0x2d')](function(){if(_0x1bc55f){var _0x12a7c6=[];var _0x3fde31=utils[_0xf276('0x34')]();_0x3fde31[_0xf276('0x35')](function(_0x18b070){_0x12a7c6[_0xf276('0x36')]({'channel':_0x18b070,'membername':_0x1bc55f[_0xf276('0x28')],'interface':_[_0xf276('0x37')](_0x1bc55f[_0xf276('0x2a')])?util[_0xf276('0x30')](_0xf276('0x38'),_0x1bc55f[_0xf276('0x28')]):_0x1bc55f['interface'],'type':_0xf276('0x2f'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0xab539f[_0xf276('0x39')]['type']||_0xf276('0x3a'),'role':_0x1bc55f['role'],'internal':_0x1bc55f['internal'],'uniqueid':_0xab539f[_0xf276('0x39')][_0xf276('0x3b')]||null});});return db[_0xf276('0x2e')][_0xf276('0x3c')](_0x12a7c6,{'individualHooks':!![]});}})['then'](function(){if(_0x1bc55f){return _0x1bc55f[_0xf276('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0xab539f[_0xf276('0x39')][_0xf276('0x3d')]||_0xf276('0x3a'),'lastPauseAt':moment()[_0xf276('0x30')](_0xf276('0x31'))});}})[_0xf276('0x2d')](function(_0x4c898a){_0x3119d3(_0x4c898a);})[_0xf276('0x19')](function(_0x49d1cd){_0x5b5722(_0x47ce72[_0xf276('0x17')](0x1f4,_0x49d1cd[_0xf276('0x18')]));});});};exports[_0xf276('0x3e')]=function(_0x41745a){var _0x26eb56=this;return new Promise(function(_0x53ef0e,_0x57f473){var _0x255f99;return db[_0xf276('0x1a')]['findOne']({'where':_0x41745a[_0xf276('0x1c')][_0xf276('0x27')]||{},'attributes':['id','name']})[_0xf276('0x2d')](function(_0x17137){if(_0x17137){_0x255f99=_0x17137;if(_0x41745a[_0xf276('0x39')][_0xf276('0x3f')]&&!utils[_0xf276('0x40')](_0x41745a[_0xf276('0x39')]['channel'])){throw new Error('Unknown\x20channel');}switch(_0x41745a[_0xf276('0x39')][_0xf276('0x3f')]){case'voice':return db[_0xf276('0x2b')]['update']({'paused':0x0},{'where':{'UserId':_0x255f99['id']}})[_0xf276('0x2d')](function(){return db['MemberReport'][_0xf276('0x25')]({'where':{'channel':_0x41745a[_0xf276('0x39')][_0xf276('0x3f')],'membername':_0x255f99[_0xf276('0x28')],'type':_0xf276('0x2f'),'exitAt':null}});})[_0xf276('0x2d')](function(_0x5461a4){if(_0x5461a4){return _0x5461a4['update']({'exitAt':moment()[_0xf276('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xf276('0x41')},{'individualHooks':!![]});}return null;})[_0xf276('0x2d')](function(){return _0x255f99[_0xf276('0x2c')]({'voicePause':![]});});case _0xf276('0x42'):case _0xf276('0x43'):case _0xf276('0x44'):case _0xf276('0x45'):case _0xf276('0x46'):return db[_0xf276('0x2e')][_0xf276('0x25')]({'where':{'channel':_0x41745a[_0xf276('0x39')][_0xf276('0x3f')],'membername':_0x255f99[_0xf276('0x28')],'type':_0xf276('0x2f'),'exitAt':null}})[_0xf276('0x2d')](function(_0x366a19){return _0x366a19[_0xf276('0x2c')]({'exitAt':moment()['format'](_0xf276('0x31')),'data2':_0xf276('0x41')},{'individualHooks':!![]});})['then'](function(){var _0x62acab={};_[_0xf276('0x47')](_0x62acab,util[_0xf276('0x30')](_0xf276('0x48'),_0x41745a[_0xf276('0x39')][_0xf276('0x3f')],_0xf276('0x49')),![]);return _0x255f99[_0xf276('0x2c')](_0x62acab);});default:return db['UserVoiceQueueRt'][_0xf276('0x2c')]({'paused':0x0},{'where':{'UserId':_0x255f99['id']}})[_0xf276('0x2d')](function(){return db['MemberReport'][_0xf276('0x1b')]({'where':{'membername':_0x255f99[_0xf276('0x28')],'type':_0xf276('0x2f'),'exitAt':null}});})['then'](function(_0x2f0d97){var _0x1f7047=[];_0x2f0d97['forEach'](function(_0x53bbba){_0x1f7047[_0xf276('0x36')](_0x53bbba[_0xf276('0x2c')]({'exitAt':moment()[_0xf276('0x30')](_0xf276('0x31')),'data2':'system'}));});return BPromise[_0xf276('0x4a')](_0x1f7047);})['then'](function(){return _0x255f99[_0xf276('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xf276('0x2d')](function(_0x545d05){_0x53ef0e(_0x545d05);})['catch'](function(_0x42b477){_0x57f473(_0x26eb56[_0xf276('0x17')](0x1f4,_0x42b477[_0xf276('0x18')]));});});};exports[_0xf276('0x4b')]=function(_0x365548){var _0x5bf4cb=this;return new Promise(function(_0x1cff7a,_0x5f046f){var _0x68388d;return db['User'][_0xf276('0x4c')]({'where':_0x365548['options'][_0xf276('0x27')]||{},'attributes':['id',_0xf276('0x28')]})[_0xf276('0x2d')](function(_0x1a601d){if(_0x1a601d){_0x68388d=_0x1a601d;return db['UserVoiceQueueRt'][_0xf276('0x4d')]({'where':{'membername':_0x68388d[_0xf276('0x28')]},'individualHooks':!![]});}})[_0xf276('0x2d')](function(){if(_0x68388d){return db[_0xf276('0x2e')][_0xf276('0x1b')]({'where':{'membername':_0x68388d['name'],'exitAt':null}});}})[_0xf276('0x2d')](function(_0x2cc143){if(_0x68388d){if(_0x2cc143&&_0x2cc143[_0xf276('0x32')]){var _0xea5d6f=[];_0x2cc143[_0xf276('0x35')](function(_0x10c634){_0xea5d6f[_0xf276('0x36')](_0x10c634[_0xf276('0x2c')]({'exitAt':moment()[_0xf276('0x30')](_0xf276('0x31'))}));});return BPromise['all'](_0xea5d6f);}}})['then'](function(){if(_0x68388d){return _0x68388d[_0xf276('0x2c')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xf276('0x2d')](function(_0x366056){_0x1cff7a(_0x366056);})[_0xf276('0x19')](function(_0x40ecf4){_0x5f046f(_0x5bf4cb[_0xf276('0x17')](0x1f4,_0x40ecf4['message']));});});};exports[_0xf276('0x4e')]=function(_0x2b0ec2){var _0x159018=this;return new Promise(function(_0xeb65f2,_0x19ea1c){var _0x2f0756;var _0x5b5eec;var _0x350ef4;var _0x5acc0d;return db[_0xf276('0x1a')]['findOne']({'where':_0x2b0ec2[_0xf276('0x1c')][_0xf276('0x27')]||{},'attributes':['id',_0xf276('0x28'),_0xf276('0x4f'),'mobile',_0xf276('0x50'),_0xf276('0x29'),_0xf276('0x51'),_0xf276('0x2a')]})[_0xf276('0x2d')](function(_0x260360){if(_0x260360){_0x2f0756=_0x260360;_0x5acc0d=_0x2b0ec2[_0xf276('0x39')][_0xf276('0x2a')]?_0x2b0ec2[_0xf276('0x39')][_0xf276('0x2a')]:util[_0xf276('0x30')](_0xf276('0x38'),_0x2f0756[_0xf276('0x28')]);return db[_0xf276('0x1a')][_0xf276('0x52')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x2f0756['id']}}});}})['then'](function(_0x4426d3){if(_0x4426d3){_0x350ef4=_0x4426d3;return require('../../config/license/util')[_0xf276('0x53')]();}})[_0xf276('0x2d')](function(_0x21bdeb){if(_0x21bdeb&&_0x21bdeb[_0xf276('0x54')]&&_0x350ef4>=_0x21bdeb[_0xf276('0x54')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xf276('0x2d')](function(){if(_0x2f0756){return db[_0xf276('0x2b')]['destroy']({'where':{'membername':_0x2f0756[_0xf276('0x28')]},'individualHooks':!![]});}})[_0xf276('0x2d')](function(){if(_0x2f0756){return _0x2f0756['getVoiceQueues']({'raw':!![]});}})[_0xf276('0x2d')](function(_0x2111f7){if(_0x2f0756){if(_0x2111f7){var _0x9b465d=[];_0x5b5eec=_0x2111f7;if(_0x5b5eec['length']){for(var _0x3bc099=0x0;_0x3bc099<_0x5b5eec['length'];_0x3bc099++){_0x9b465d['push'](db[_0xf276('0x2b')][_0xf276('0x55')]({'membername':_0x2f0756[_0xf276('0x28')],'UserId':_0x2f0756['id'],'queue_name':_0x5b5eec[_0x3bc099][_0xf276('0x28')],'VoiceQueueId':_0x5b5eec[_0x3bc099]['id'],'interface':_0x5acc0d,'paused':_0x2f0756[_0xf276('0x51')]||![],'penalty':_0x5b5eec[_0x3bc099]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xf276('0x4a')](_0x9b465d);}}}})[_0xf276('0x2d')](function(){if(_0x2f0756){return db[_0xf276('0x2e')][_0xf276('0x1b')]({'where':{'membername':_0x2f0756[_0xf276('0x28')],'exitAt':null}});}})[_0xf276('0x2d')](function(_0x4fb03e){if(_0x2f0756){if(_0x4fb03e&&_0x4fb03e['length']){var _0x4ff3b9=[];_0x4fb03e[_0xf276('0x35')](function(_0x2fc8fd){_0x4ff3b9[_0xf276('0x36')](_0x2fc8fd[_0xf276('0x2c')]({'exitAt':moment()['format'](_0xf276('0x31'))}));});return BPromise[_0xf276('0x4a')](_0x4ff3b9);}}})[_0xf276('0x2d')](function(_0x64c240){if(_0x2f0756){var _0x293fa0=[];var _0x4f7fa2=[];var _0x2925b0=utils['getChannels']();var _0x40d0c5={'membername':_0x2f0756[_0xf276('0x28')],'interface':_0x5acc0d,'enterAt':moment()[_0xf276('0x30')](_0xf276('0x31')),'role':_0x2f0756[_0xf276('0x4f')],'internal':_0x2f0756[_0xf276('0x29')]};_0x2925b0[_0xf276('0x35')](function(_0x33410b){_0x293fa0[_0xf276('0x36')](_[_0xf276('0x56')]({'channel':_0x33410b,'type':_0xf276('0x57'),'data1':_0xf276('0x58'),'data2':_0x5acc0d},_0x40d0c5));if(_0x2f0756[_0xf276('0x51')]){_0x4f7fa2[_0xf276('0x36')](_[_0xf276('0x56')]({'channel':_0x33410b,'type':'PAUSE','data1':'LOGININPAUSE'},_0x40d0c5));}});return db[_0xf276('0x2e')][_0xf276('0x3c')](_0x293fa0['concat'](_0x4f7fa2),{'individualHooks':!![]});}})[_0xf276('0x2d')](function(){if(_0x2f0756){return _0x2f0756[_0xf276('0x2c')]({'online':!![],'lastLoginAt':moment()[_0xf276('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2f0756[_0xf276('0x51')]||![],'mailPause':_0x2f0756[_0xf276('0x51')]||![],'chatPause':_0x2f0756[_0xf276('0x51')]||![],'faxPause':_0x2f0756[_0xf276('0x51')]||![],'smsPause':_0x2f0756[_0xf276('0x51')]||![],'openchannelPause':_0x2f0756['loginInPause']||![],'pauseType':_0x2f0756[_0xf276('0x51')]?_0xf276('0x59'):null,'lastPauseAt':moment()[_0xf276('0x30')](_0xf276('0x31')),'interface':_0x5acc0d});}})[_0xf276('0x2d')](function(_0x269ec6){_0xeb65f2(_0x269ec6);})['catch'](function(_0x25a15f){_0x19ea1c(_0x159018['error'](0x1f4,_0x25a15f[_0xf276('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 2a63ffb..3576195 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 _0xc24a=['./user.events','remove','update','emit','removeListener','user:'];(function(_0x432026,_0x3edb07){var _0x163663=function(_0x192b4c){while(--_0x192b4c){_0x432026['push'](_0x432026['shift']());}};_0x163663(++_0x3edb07);}(_0xc24a,0x1d4));var _0xac24=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xc24a[_0x160c73];return _0xd9302;};'use strict';var UserEvents=require(_0xac24('0x0'));var events=['save',_0xac24('0x1'),_0xac24('0x2')];function createListener(_0x4a7a4e,_0x3276b1){return function(_0x1ec594){_0x3276b1[_0xac24('0x3')](_0x4a7a4e,_0x1ec594);};}function removeListener(_0xe50147,_0x515d2d){return function(){UserEvents[_0xac24('0x4')](_0xe50147,_0x515d2d);};}exports['register']=function(_0x5b06d2){for(var _0x386b56=0x0,_0x35919f=events['length'];_0x386b56<_0x35919f;_0x386b56++){var _0x3cdd8c=events[_0x386b56];var _0x400ed9=createListener(_0xac24('0x5')+_0x3cdd8c,_0x5b06d2);UserEvents['on'](_0x3cdd8c,_0x400ed9);}}; \ No newline at end of file +var _0x3976=['length','user:','./user.events','remove','update','emit','removeListener','register'];(function(_0x3d2e1b,_0x6649aa){var _0x3b85c2=function(_0x3ea5d6){while(--_0x3ea5d6){_0x3d2e1b['push'](_0x3d2e1b['shift']());}};_0x3b85c2(++_0x6649aa);}(_0x3976,0xaa));var _0x6397=function(_0xe57a68,_0x21a065){_0xe57a68=_0xe57a68-0x0;var _0x202391=_0x3976[_0xe57a68];return _0x202391;};'use strict';var UserEvents=require(_0x6397('0x0'));var events=['save',_0x6397('0x1'),_0x6397('0x2')];function createListener(_0x508fb2,_0x538c8b){return function(_0x3451db){_0x538c8b[_0x6397('0x3')](_0x508fb2,_0x3451db);};}function removeListener(_0x20f0e3,_0x46b0e2){return function(){UserEvents[_0x6397('0x4')](_0x20f0e3,_0x46b0e2);};}exports[_0x6397('0x5')]=function(_0x48285c){for(var _0x25e59d=0x0,_0x59dfb9=events[_0x6397('0x6')];_0x25e59d<_0x59dfb9;_0x25e59d++){var _0x474324=events[_0x25e59d];var _0x5e3168=createListener(_0x6397('0x7')+_0x474324,_0x48285c);UserEvents['on'](_0x474324,_0x5e3168);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index ecd4754..0d1d40e 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 _0x317b=['path','connect-timeout','express','Router','../../components/interaction/service','multer'];(function(_0x3cd879,_0x5ce3fd){var _0x4c659e=function(_0xc0fb3){while(--_0xc0fb3){_0x3cd879['push'](_0x3cd879['shift']());}};_0x4c659e(++_0x5ce3fd);}(_0x317b,0x65));var _0xb317=function(_0x40bb02,_0x6a1b3d){_0x40bb02=_0x40bb02-0x0;var _0x278cfa=_0x317b[_0x40bb02];return _0x278cfa;};'use strict';var multer=require(_0xb317('0x0'));var util=require('util');var path=require(_0xb317('0x1'));var timeout=require(_0xb317('0x2'));var express=require(_0xb317('0x3'));var router=express[_0xb317('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb317('0x5'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x3ebc=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express'];(function(_0x4ce0e1,_0x1210d1){var _0x58fa27=function(_0x4c08ba){while(--_0x4c08ba){_0x4ce0e1['push'](_0x4ce0e1['shift']());}};_0x58fa27(++_0x1210d1);}(_0x3ebc,0x1e1));var _0xc3eb=function(_0x3234c1,_0x56168d){_0x3234c1=_0x3234c1-0x0;var _0xa3af00=_0x3ebc[_0x3234c1];return _0xa3af00;};'use strict';var multer=require(_0xc3eb('0x0'));var util=require(_0xc3eb('0x1'));var path=require(_0xc3eb('0x2'));var timeout=require(_0xc3eb('0x3'));var express=require(_0xc3eb('0x4'));var router=express['Router']();var auth=require(_0xc3eb('0x5'));var interaction=require(_0xc3eb('0x6'));var config=require(_0xc3eb('0x7'));module[_0xc3eb('0x8')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 1f77d50..3aedbdc 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 _0xbaf0=['exports','INTEGER'];(function(_0x2ff4bd,_0x4780a6){var _0x28edc6=function(_0x792380){while(--_0x792380){_0x2ff4bd['push'](_0x2ff4bd['shift']());}};_0x28edc6(++_0x4780a6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x1e5068,_0x31e9c4){var _0x2230b6=function(_0xaa2ee){while(--_0xaa2ee){_0x1e5068['push'](_0x1e5068['shift']());}};_0x2230b6(++_0x31e9c4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index efd3120..888909e 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 _0xea62=['exports','define','UserChatQueue','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x1364b8,_0x1ca76e){var _0x1d97f3=function(_0x5aaf86){while(--_0x5aaf86){_0x1364b8['push'](_0x1364b8['shift']());}};_0x1d97f3(++_0x1ca76e);}(_0xea62,0xf3));var _0x2ea6=function(_0x9bca53,_0x59b4f8){_0x9bca53=_0x9bca53-0x0;var _0x3894bc=_0xea62[_0x9bca53];return _0x3894bc;};'use strict';var _=require(_0x2ea6('0x0'));var util=require('util');var logger=require(_0x2ea6('0x1'))(_0x2ea6('0x2'));var moment=require('moment');var BPromise=require(_0x2ea6('0x3'));var rp=require(_0x2ea6('0x4'));var fs=require('fs');var path=require(_0x2ea6('0x5'));var rimraf=require(_0x2ea6('0x6'));var config=require(_0x2ea6('0x7'));var attributes=require(_0x2ea6('0x8'));module[_0x2ea6('0x9')]=function(_0xe3b2dc,_0xbdc015){return _0xe3b2dc[_0x2ea6('0xa')](_0x2ea6('0xb'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f24=['UserChatQueue','user_has_chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports'];(function(_0x3ceb54,_0x5bddfd){var _0x26d8a6=function(_0x32e484){while(--_0x32e484){_0x3ceb54['push'](_0x3ceb54['shift']());}};_0x26d8a6(++_0x5bddfd);}(_0x2f24,0x1c9));var _0x42f2=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x2f24[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x42f2('0x0'));var logger=require(_0x42f2('0x1'))(_0x42f2('0x2'));var moment=require(_0x42f2('0x3'));var BPromise=require(_0x42f2('0x4'));var rp=require(_0x42f2('0x5'));var fs=require('fs');var path=require(_0x42f2('0x6'));var rimraf=require(_0x42f2('0x7'));var config=require(_0x42f2('0x8'));var attributes=require(_0x42f2('0x9'));module[_0x42f2('0xa')]=function(_0x2d7994,_0x5eeaf6){return _0x2d7994['define'](_0x42f2('0xb'),attributes,{'tableName':_0x42f2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 000d9a6..a83af84 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 _0x8592=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserChatQueue,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring'];(function(_0x304397,_0xc2fceb){var _0x391ade=function(_0x5e3033){while(--_0x5e3033){_0x304397['push'](_0x304397['shift']());}};_0x391ade(++_0xc2fceb);}(_0x8592,0x15c));var _0x2859=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0x8592[_0x58a4ac];return _0x545810;};'use strict';var _=require(_0x2859('0x0'));var util=require(_0x2859('0x1'));var moment=require('moment');var BPromise=require(_0x2859('0x2'));var rs=require(_0x2859('0x3'));var fs=require('fs');var Redis=require(_0x2859('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2859('0x5'));var logger=require(_0x2859('0x6'))(_0x2859('0x7'));var config=require('../../config/environment');var jayson=require(_0x2859('0x8'));var client=jayson[_0x2859('0x9')][_0x2859('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x331a37,_0x5bcee2,_0x22c0f4){return new BPromise(function(_0x4a733c,_0x4073fb){return client[_0x2859('0xb')](_0x331a37,_0x22c0f4)['then'](function(_0x3a5d49){logger[_0x2859('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x5bcee2,_0x2859('0xd'));logger[_0x2859('0xe')](_0x2859('0xf'),_0x5bcee2,_0x2859('0xd'),JSON[_0x2859('0x10')](_0x3a5d49));if(_0x3a5d49[_0x2859('0x11')]){if(_0x3a5d49['error']['code']===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x5bcee2,_0x3a5d49[_0x2859('0x11')][_0x2859('0x12')]);return _0x4073fb(_0x3a5d49[_0x2859('0x11')][_0x2859('0x12')]);}logger[_0x2859('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x5bcee2,_0x3a5d49[_0x2859('0x11')][_0x2859('0x12')]);return _0x4a733c(_0x3a5d49[_0x2859('0x11')][_0x2859('0x12')]);}else{logger[_0x2859('0xc')](_0x2859('0x13'),_0x5bcee2,_0x2859('0xd'));_0x4a733c(_0x3a5d49[_0x2859('0x14')][_0x2859('0x12')]);}})[_0x2859('0x15')](function(_0x46a66e){logger[_0x2859('0x11')](_0x2859('0x13'),_0x5bcee2,_0x46a66e);_0x4073fb(_0x46a66e);});});} \ No newline at end of file +var _0x42b8=['message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s'];(function(_0x484669,_0xe4ab7f){var _0xd74669=function(_0x8445cf){while(--_0x8445cf){_0x484669['push'](_0x484669['shift']());}};_0xd74669(++_0xe4ab7f);}(_0x42b8,0x1d0));var _0x842b=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x42b8[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x842b('0x0'));var util=require(_0x842b('0x1'));var moment=require(_0x842b('0x2'));var BPromise=require(_0x842b('0x3'));var rs=require(_0x842b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x842b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x842b('0x6'))(_0x842b('0x7'));var config=require(_0x842b('0x8'));var jayson=require(_0x842b('0x9'));var client=jayson[_0x842b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e2f18,_0x120c74,_0x3fad2f){return new BPromise(function(_0x35f760,_0x19c6a6){return client[_0x842b('0xb')](_0x3e2f18,_0x3fad2f)['then'](function(_0x537dec){logger[_0x842b('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x120c74,_0x842b('0xd'));logger[_0x842b('0xe')](_0x842b('0xf'),_0x120c74,_0x842b('0xd'),JSON[_0x842b('0x10')](_0x537dec));if(_0x537dec[_0x842b('0x11')]){if(_0x537dec['error'][_0x842b('0x12')]===0x1f4){logger[_0x842b('0x11')](_0x842b('0x13'),_0x120c74,_0x537dec[_0x842b('0x11')][_0x842b('0x14')]);return _0x19c6a6(_0x537dec[_0x842b('0x11')]['message']);}logger[_0x842b('0x11')](_0x842b('0x13'),_0x120c74,_0x537dec['error'][_0x842b('0x14')]);return _0x35f760(_0x537dec['error']['message']);}else{logger[_0x842b('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x120c74,'request\x20sent');_0x35f760(_0x537dec[_0x842b('0x15')][_0x842b('0x14')]);}})['catch'](function(_0x214d26){logger['error'](_0x842b('0x13'),_0x120c74,_0x214d26);_0x19c6a6(_0x214d26);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index c6b7f8b..d762601 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 _0x1ba6=['../../components/auth/service','../../components/interaction/service','multer','util','path','connect-timeout','express','Router'];(function(_0xcd2faa,_0x3ff70d){var _0x3b6e2d=function(_0x597099){while(--_0x597099){_0xcd2faa['push'](_0xcd2faa['shift']());}};_0x3b6e2d(++_0x3ff70d);}(_0x1ba6,0x112));var _0x61ba=function(_0x476bef,_0x4cf56e){_0x476bef=_0x476bef-0x0;var _0x28f208=_0x1ba6[_0x476bef];return _0x28f208;};'use strict';var multer=require(_0x61ba('0x0'));var util=require(_0x61ba('0x1'));var path=require(_0x61ba('0x2'));var timeout=require(_0x61ba('0x3'));var express=require(_0x61ba('0x4'));var router=express[_0x61ba('0x5')]();var auth=require(_0x61ba('0x6'));var interaction=require(_0x61ba('0x7'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0x9815=['../../config/environment','exports','multer','path','../../components/interaction/service'];(function(_0x251d4e,_0x4ec54c){var _0x4d256d=function(_0x4431dc){while(--_0x4431dc){_0x251d4e['push'](_0x251d4e['shift']());}};_0x4d256d(++_0x4ec54c);}(_0x9815,0x10b));var _0x5981=function(_0x2594ef,_0x13ed3e){_0x2594ef=_0x2594ef-0x0;var _0x124d51=_0x9815[_0x2594ef];return _0x124d51;};'use strict';var multer=require(_0x5981('0x0'));var util=require('util');var path=require(_0x5981('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5981('0x2'));var config=require(_0x5981('0x3'));module[_0x5981('0x4')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index c93fdf3..c5a4b0f 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 _0xd8b0=['exports','sequelize'];(function(_0x4ce6f1,_0x55e5c4){var _0x45ec2e=function(_0x2f7e7b){while(--_0x2f7e7b){_0x4ce6f1['push'](_0x4ce6f1['shift']());}};_0x45ec2e(++_0x55e5c4);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6e6c=['exports','INTEGER','STRING','sequelize'];(function(_0x5659fe,_0x1cd7ef){var _0x184b42=function(_0x27f444){while(--_0x27f444){_0x5659fe['push'](_0x5659fe['shift']());}};_0x184b42(++_0x1cd7ef);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6e6c[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xc6e6('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xc6e6('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 5393f9c..ad45330 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 _0xd8b0=['define','user_has_fax_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1c743b,_0x115761){var _0x1a5240=function(_0x371d95){while(--_0x371d95){_0x1c743b['push'](_0x1c743b['shift']());}};_0x1a5240(++_0x115761);}(_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('./userFaxQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserFaxQueue',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','user_has_fax_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x20a263,_0x656b6f){var _0x4c9dab=function(_0x495b33){while(--_0x495b33){_0x20a263['push'](_0x20a263['shift']());}};_0x4c9dab(++_0x656b6f);}(_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('./userFaxQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserFaxQueue',attributes,{'tableName':_0x0d8b('0x8'),'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 f696cbc..9b531e3 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 _0x1918=['result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','UserFaxQueue,\x20%s,\x20%s','message','info'];(function(_0x578349,_0x5b30f7){var _0x267797=function(_0x5634f2){while(--_0x5634f2){_0x578349['push'](_0x578349['shift']());}};_0x267797(++_0x5b30f7);}(_0x1918,0x1dd));var _0x8191=function(_0x10a6fe,_0x5abc85){_0x10a6fe=_0x10a6fe-0x0;var _0x3da6e6=_0x1918[_0x10a6fe];return _0x3da6e6;};'use strict';var _=require('lodash');var util=require(_0x8191('0x0'));var moment=require(_0x8191('0x1'));var BPromise=require('bluebird');var rs=require(_0x8191('0x2'));var fs=require('fs');var Redis=require(_0x8191('0x3'));var db=require(_0x8191('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8191('0x5'))(_0x8191('0x6'));var config=require(_0x8191('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8191('0x8')][_0x8191('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d6875,_0xb13ab7,_0x327e99){return new BPromise(function(_0x43afca,_0x146176){return client['request'](_0x4d6875,_0x327e99)['then'](function(_0x2e34b9){logger['info']('UserFaxQueue,\x20%s,\x20%s',_0xb13ab7,_0x8191('0xa'));logger['debug'](_0x8191('0xb'),_0xb13ab7,'request\x20sent',JSON['stringify'](_0x2e34b9));if(_0x2e34b9['error']){if(_0x2e34b9[_0x8191('0xc')][_0x8191('0xd')]===0x1f4){logger[_0x8191('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0xb13ab7,_0x2e34b9['error']['message']);return _0x146176(_0x2e34b9[_0x8191('0xc')]['message']);}logger[_0x8191('0xc')](_0x8191('0xe'),_0xb13ab7,_0x2e34b9[_0x8191('0xc')][_0x8191('0xf')]);return _0x43afca(_0x2e34b9['error'][_0x8191('0xf')]);}else{logger[_0x8191('0x10')](_0x8191('0xe'),_0xb13ab7,_0x8191('0xa'));_0x43afca(_0x2e34b9[_0x8191('0x11')][_0x8191('0xf')]);}})[_0x8191('0x12')](function(_0x564af4){logger['error'](_0x8191('0xe'),_0xb13ab7,_0x564af4);_0x146176(_0x564af4);});});} \ No newline at end of file +var _0x9805=['message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x184b5a,_0x47a10e){var _0x4a8844=function(_0x148bb3){while(--_0x148bb3){_0x184b5a['push'](_0x184b5a['shift']());}};_0x4a8844(++_0x47a10e);}(_0x9805,0x18f));var _0x5980=function(_0x27dce9,_0x10d2f8){_0x27dce9=_0x27dce9-0x0;var _0x1fec31=_0x9805[_0x27dce9];return _0x1fec31;};'use strict';var _=require(_0x5980('0x0'));var util=require(_0x5980('0x1'));var moment=require(_0x5980('0x2'));var BPromise=require(_0x5980('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5980('0x4'))['db'];var utils=require(_0x5980('0x5'));var logger=require(_0x5980('0x6'))(_0x5980('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5980('0x8')][_0x5980('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x326b9b,_0x1d6536,_0x175728){return new BPromise(function(_0x3399a9,_0xf8b3c0){return client[_0x5980('0xa')](_0x326b9b,_0x175728)[_0x5980('0xb')](function(_0x35b0ad){logger[_0x5980('0xc')](_0x5980('0xd'),_0x1d6536,'request\x20sent');logger['debug'](_0x5980('0xe'),_0x1d6536,_0x5980('0xf'),JSON[_0x5980('0x10')](_0x35b0ad));if(_0x35b0ad[_0x5980('0x11')]){if(_0x35b0ad['error'][_0x5980('0x12')]===0x1f4){logger[_0x5980('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x1d6536,_0x35b0ad['error'][_0x5980('0x13')]);return _0xf8b3c0(_0x35b0ad[_0x5980('0x11')][_0x5980('0x13')]);}logger[_0x5980('0x11')](_0x5980('0xd'),_0x1d6536,_0x35b0ad[_0x5980('0x11')][_0x5980('0x13')]);return _0x3399a9(_0x35b0ad[_0x5980('0x11')]['message']);}else{logger[_0x5980('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x1d6536,_0x5980('0xf'));_0x3399a9(_0x35b0ad[_0x5980('0x14')][_0x5980('0x13')]);}})[_0x5980('0x15')](function(_0x183261){logger['error'](_0x5980('0xd'),_0x1d6536,_0x183261);_0xf8b3c0(_0x183261);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 4ff6db4..404a912 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 _0xe03b=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xe03b,0x14e));var _0xbe03=function(_0x46befd,_0x27712d){_0x46befd=_0x46befd-0x0;var _0x5f4243=_0xe03b[_0x46befd];return _0x5f4243;};'use strict';var multer=require(_0xbe03('0x0'));var util=require(_0xbe03('0x1'));var path=require(_0xbe03('0x2'));var timeout=require('connect-timeout');var express=require(_0xbe03('0x3'));var router=express['Router']();var auth=require(_0xbe03('0x4'));var interaction=require(_0xbe03('0x5'));var config=require(_0xbe03('0x6'));module[_0xbe03('0x7')]=router; \ No newline at end of file +var _0x5382=['connect-timeout','../../components/interaction/service','multer','util','path'];(function(_0x306646,_0xdc2e1b){var _0x40bd8d=function(_0x397d05){while(--_0x397d05){_0x306646['push'](_0x306646['shift']());}};_0x40bd8d(++_0xdc2e1b);}(_0x5382,0x11f));var _0x2538=function(_0x22351f,_0x324e19){_0x22351f=_0x22351f-0x0;var _0x5de7b6=_0x5382[_0x22351f];return _0x5de7b6;};'use strict';var multer=require(_0x2538('0x0'));var util=require(_0x2538('0x1'));var path=require(_0x2538('0x2'));var timeout=require(_0x2538('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x2538('0x4'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 27661c5..e4cd49a 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x3e1fc7,_0x61b22b){var _0x9c315=function(_0x364c2c){while(--_0x364c2c){_0x3e1fc7['push'](_0x3e1fc7['shift']());}};_0x9c315(++_0x61b22b);}(_0xe706,0xa3));var _0x6e70=function(_0x50c00a,_0x2afdb8){_0x50c00a=_0x50c00a-0x0;var _0x37e299=_0xe706[_0x50c00a];return _0x37e299;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x21a932,_0x459d54){var _0x524fab=function(_0x26a621){while(--_0x26a621){_0x21a932['push'](_0x21a932['shift']());}};_0x524fab(++_0x459d54);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'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 70c55c8..2b58a01 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 _0xa9e0=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4ab88b,_0x1ab0cf){var _0xc1e0f5=function(_0x30ba4e){while(--_0x30ba4e){_0x4ab88b['push'](_0x4ab88b['shift']());}};_0xc1e0f5(++_0x1ab0cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x316735,_0x431e5b){var _0x14da56=function(_0x5d52e1){while(--_0x5d52e1){_0x316735['push'](_0x316735['shift']());}};_0x14da56(++_0x431e5b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index fd230e6..3f56ae6 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 _0x0e76=['request\x20sent','debug','error','UserMailQueue,\x20%s,\x20%s','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0e76,0xc4));var _0x60e7=function(_0x248a82,_0x4fca3e){_0x248a82=_0x248a82-0x0;var _0x4bef56=_0x0e76[_0x248a82];return _0x4bef56;};'use strict';var _=require(_0x60e7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x60e7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60e7('0x2'));var db=require(_0x60e7('0x3'))['db'];var utils=require(_0x60e7('0x4'));var logger=require(_0x60e7('0x5'))(_0x60e7('0x6'));var config=require('../../config/environment');var jayson=require(_0x60e7('0x7'));var client=jayson[_0x60e7('0x8')][_0x60e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xba29ef,_0xa2d5cb,_0x194535){return new BPromise(function(_0x4a15f2,_0xddad15){return client[_0x60e7('0xa')](_0xba29ef,_0x194535)[_0x60e7('0xb')](function(_0x51fff8){logger[_0x60e7('0xc')]('UserMailQueue,\x20%s,\x20%s',_0xa2d5cb,_0x60e7('0xd'));logger[_0x60e7('0xe')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0xa2d5cb,_0x60e7('0xd'),JSON['stringify'](_0x51fff8));if(_0x51fff8[_0x60e7('0xf')]){if(_0x51fff8[_0x60e7('0xf')]['code']===0x1f4){logger['error'](_0x60e7('0x10'),_0xa2d5cb,_0x51fff8[_0x60e7('0xf')][_0x60e7('0x11')]);return _0xddad15(_0x51fff8[_0x60e7('0xf')]['message']);}logger[_0x60e7('0xf')]('UserMailQueue,\x20%s,\x20%s',_0xa2d5cb,_0x51fff8[_0x60e7('0xf')][_0x60e7('0x11')]);return _0x4a15f2(_0x51fff8['error'][_0x60e7('0x11')]);}else{logger['info'](_0x60e7('0x10'),_0xa2d5cb,_0x60e7('0xd'));_0x4a15f2(_0x51fff8[_0x60e7('0x12')]['message']);}})['catch'](function(_0x376fde){logger['error'](_0x60e7('0x10'),_0xa2d5cb,_0x376fde);_0xddad15(_0x376fde);});});} \ No newline at end of file +var _0xdfa0=['code','UserMailQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3f204b,_0x5a6e95){var _0x437f00=function(_0x4929f9){while(--_0x4929f9){_0x3f204b['push'](_0x3f204b['shift']());}};_0x437f00(++_0x5a6e95);}(_0xdfa0,0x69));var _0x0dfa=function(_0x25a383,_0x27951d){_0x25a383=_0x25a383-0x0;var _0x509c61=_0xdfa0[_0x25a383];return _0x509c61;};'use strict';var _=require(_0x0dfa('0x0'));var util=require('util');var moment=require(_0x0dfa('0x1'));var BPromise=require(_0x0dfa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dfa('0x3'));var db=require(_0x0dfa('0x4'))['db'];var utils=require(_0x0dfa('0x5'));var logger=require('../../config/logger')(_0x0dfa('0x6'));var config=require('../../config/environment');var jayson=require(_0x0dfa('0x7'));var client=jayson[_0x0dfa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x417f7a,_0x29ca78,_0x32280b){return new BPromise(function(_0x16070c,_0x3b6881){return client['request'](_0x417f7a,_0x32280b)[_0x0dfa('0x9')](function(_0x2f813e){logger[_0x0dfa('0xa')]('UserMailQueue,\x20%s,\x20%s',_0x29ca78,_0x0dfa('0xb'));logger['debug'](_0x0dfa('0xc'),_0x29ca78,_0x0dfa('0xb'),JSON[_0x0dfa('0xd')](_0x2f813e));if(_0x2f813e['error']){if(_0x2f813e[_0x0dfa('0xe')][_0x0dfa('0xf')]===0x1f4){logger['error'](_0x0dfa('0x10'),_0x29ca78,_0x2f813e[_0x0dfa('0xe')]['message']);return _0x3b6881(_0x2f813e[_0x0dfa('0xe')][_0x0dfa('0x11')]);}logger[_0x0dfa('0xe')](_0x0dfa('0x10'),_0x29ca78,_0x2f813e[_0x0dfa('0xe')][_0x0dfa('0x11')]);return _0x16070c(_0x2f813e['error'][_0x0dfa('0x11')]);}else{logger[_0x0dfa('0xa')](_0x0dfa('0x10'),_0x29ca78,_0x0dfa('0xb'));_0x16070c(_0x2f813e[_0x0dfa('0x12')][_0x0dfa('0x11')]);}})[_0x0dfa('0x13')](function(_0x3c79f0){logger[_0x0dfa('0xe')](_0x0dfa('0x10'),_0x29ca78,_0x3c79f0);_0x3b6881(_0x3c79f0);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index e7f29b3..4b852de 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 _0xcd9f=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x380d16,_0x1799f3){var _0x455311=function(_0x5876d6){while(--_0x5876d6){_0x380d16['push'](_0x380d16['shift']());}};_0x455311(++_0x1799f3);}(_0xcd9f,0x1b6));var _0xfcd9=function(_0x4bb1db,_0x51a434){_0x4bb1db=_0x4bb1db-0x0;var _0x38de9b=_0xcd9f[_0x4bb1db];return _0x38de9b;};'use strict';var multer=require(_0xfcd9('0x0'));var util=require(_0xfcd9('0x1'));var path=require('path');var timeout=require(_0xfcd9('0x2'));var express=require('express');var router=express[_0xfcd9('0x3')]();var auth=require(_0xfcd9('0x4'));var interaction=require(_0xfcd9('0x5'));var config=require(_0xfcd9('0x6'));module[_0xfcd9('0x7')]=router; \ No newline at end of file +var _0x5225=['multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x102275,_0x1aba4a){var _0xf8bc25=function(_0x68380d){while(--_0x68380d){_0x102275['push'](_0x102275['shift']());}};_0xf8bc25(++_0x1aba4a);}(_0x5225,0x66));var _0x5522=function(_0x473738,_0x15ea31){_0x473738=_0x473738-0x0;var _0x1df4ae=_0x5225[_0x473738];return _0x1df4ae;};'use strict';var multer=require(_0x5522('0x0'));var util=require('util');var path=require(_0x5522('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x5522('0x2'));var interaction=require(_0x5522('0x3'));var config=require(_0x5522('0x4'));module[_0x5522('0x5')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 3f3d4fc..c80fc5f 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x339a10,_0x5e18e4){var _0xd4db83=function(_0x5cd56a){while(--_0x5cd56a){_0x339a10['push'](_0x339a10['shift']());}};_0xd4db83(++_0x5e18e4);}(_0xe706,0xa3));var _0x6e70=function(_0x4e00d4,_0xdb24a3){_0x4e00d4=_0x4e00d4-0x0;var _0x335d2c=_0xe706[_0x4e00d4];return _0x335d2c;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x33ceeb,_0x58b863){var _0x5b6556=function(_0x23a6b1){while(--_0x23a6b1){_0x33ceeb['push'](_0x33ceeb['shift']());}};_0x5b6556(++_0x58b863);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xbaf0[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('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 3795246..dd0e1e3 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 _0x39da=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','request-promise','path','rimraf'];(function(_0x2ffaad,_0x17ce8d){var _0x3d16c3=function(_0x1c58a1){while(--_0x1c58a1){_0x2ffaad['push'](_0x2ffaad['shift']());}};_0x3d16c3(++_0x17ce8d);}(_0x39da,0xd2));var _0xa39d=function(_0x54a5b5,_0x1f3261){_0x54a5b5=_0x54a5b5-0x0;var _0x288531=_0x39da[_0x54a5b5];return _0x288531;};'use strict';var _=require(_0xa39d('0x0'));var util=require(_0xa39d('0x1'));var logger=require('../../config/logger')(_0xa39d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa39d('0x3'));var fs=require('fs');var path=require(_0xa39d('0x4'));var rimraf=require(_0xa39d('0x5'));var config=require(_0xa39d('0x6'));var attributes=require(_0xa39d('0x7'));module[_0xa39d('0x8')]=function(_0x543f04,_0x9e05bc){return _0x543f04[_0xa39d('0x9')](_0xa39d('0xa'),attributes,{'tableName':_0xa39d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1939=['UserOpenchannelQueue','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0x1939,0xa6));var _0x9193=function(_0x3cc6b4,_0x58b1aa){_0x3cc6b4=_0x3cc6b4-0x0;var _0x1c07b8=_0x1939[_0x3cc6b4];return _0x1c07b8;};'use strict';var _=require('lodash');var util=require(_0x9193('0x0'));var logger=require(_0x9193('0x1'))(_0x9193('0x2'));var moment=require(_0x9193('0x3'));var BPromise=require('bluebird');var rp=require(_0x9193('0x4'));var fs=require('fs');var path=require(_0x9193('0x5'));var rimraf=require(_0x9193('0x6'));var config=require(_0x9193('0x7'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x9193('0x8')]=function(_0x33d507,_0x38e322){return _0x33d507[_0x9193('0x9')](_0x9193('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 8bb6473..fc0de41 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 _0xdf4a=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','code','error','message','catch'];(function(_0x4b58c9,_0x50818f){var _0x5b785d=function(_0x18c93f){while(--_0x18c93f){_0x4b58c9['push'](_0x4b58c9['shift']());}};_0x5b785d(++_0x50818f);}(_0xdf4a,0x1e4));var _0xadf4=function(_0x2fdb7b,_0x4df14c){_0x2fdb7b=_0x2fdb7b-0x0;var _0x426fd5=_0xdf4a[_0x2fdb7b];return _0x426fd5;};'use strict';var _=require(_0xadf4('0x0'));var util=require('util');var moment=require(_0xadf4('0x1'));var BPromise=require(_0xadf4('0x2'));var rs=require(_0xadf4('0x3'));var fs=require('fs');var Redis=require(_0xadf4('0x4'));var db=require(_0xadf4('0x5'))['db'];var utils=require(_0xadf4('0x6'));var logger=require(_0xadf4('0x7'))(_0xadf4('0x8'));var config=require(_0xadf4('0x9'));var jayson=require(_0xadf4('0xa'));var client=jayson[_0xadf4('0xb')][_0xadf4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x27fd67,_0x54cd1f,_0x57b636){return new BPromise(function(_0x2c418a,_0x5646d9){return client['request'](_0x27fd67,_0x57b636)['then'](function(_0x1727cc){logger[_0xadf4('0xd')](_0xadf4('0xe'),_0x54cd1f,_0xadf4('0xf'));logger[_0xadf4('0x10')](_0xadf4('0x11'),_0x54cd1f,_0xadf4('0xf'),JSON['stringify'](_0x1727cc));if(_0x1727cc['error']){if(_0x1727cc['error'][_0xadf4('0x12')]===0x1f4){logger[_0xadf4('0x13')](_0xadf4('0xe'),_0x54cd1f,_0x1727cc['error'][_0xadf4('0x14')]);return _0x5646d9(_0x1727cc[_0xadf4('0x13')][_0xadf4('0x14')]);}logger[_0xadf4('0x13')](_0xadf4('0xe'),_0x54cd1f,_0x1727cc[_0xadf4('0x13')]['message']);return _0x2c418a(_0x1727cc[_0xadf4('0x13')][_0xadf4('0x14')]);}else{logger[_0xadf4('0xd')](_0xadf4('0xe'),_0x54cd1f,_0xadf4('0xf'));_0x2c418a(_0x1727cc['result']['message']);}})[_0xadf4('0x15')](function(_0xeda2b){logger[_0xadf4('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x54cd1f,_0xeda2b);_0x5646d9(_0xeda2b);});});} \ No newline at end of file +var _0x0bde=['rpc','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x49c065,_0x10f467){var _0x562faa=function(_0x43dc2d){while(--_0x43dc2d){_0x49c065['push'](_0x49c065['shift']());}};_0x562faa(++_0x10f467);}(_0x0bde,0x15f));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe0bd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe0bd('0x1'));var rs=require(_0xe0bd('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe0bd('0x3'))['db'];var utils=require(_0xe0bd('0x4'));var logger=require(_0xe0bd('0x5'))(_0xe0bd('0x6'));var config=require('../../config/environment');var jayson=require(_0xe0bd('0x7'));var client=jayson[_0xe0bd('0x8')][_0xe0bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x339436,_0x2f38ab,_0x553f3b){return new BPromise(function(_0x994750,_0x1673a3){return client[_0xe0bd('0xa')](_0x339436,_0x553f3b)[_0xe0bd('0xb')](function(_0x520910){logger[_0xe0bd('0xc')](_0xe0bd('0xd'),_0x2f38ab,_0xe0bd('0xe'));logger[_0xe0bd('0xf')](_0xe0bd('0x10'),_0x2f38ab,_0xe0bd('0xe'),JSON[_0xe0bd('0x11')](_0x520910));if(_0x520910[_0xe0bd('0x12')]){if(_0x520910['error'][_0xe0bd('0x13')]===0x1f4){logger['error'](_0xe0bd('0xd'),_0x2f38ab,_0x520910[_0xe0bd('0x12')][_0xe0bd('0x14')]);return _0x1673a3(_0x520910[_0xe0bd('0x12')][_0xe0bd('0x14')]);}logger[_0xe0bd('0x12')](_0xe0bd('0xd'),_0x2f38ab,_0x520910[_0xe0bd('0x12')][_0xe0bd('0x14')]);return _0x994750(_0x520910[_0xe0bd('0x12')][_0xe0bd('0x14')]);}else{logger[_0xe0bd('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2f38ab,_0xe0bd('0xe'));_0x994750(_0x520910['result']['message']);}})['catch'](function(_0x56cc82){logger[_0xe0bd('0x12')](_0xe0bd('0xd'),_0x2f38ab,_0x56cc82);_0x1673a3(_0x56cc82);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 64e9343..bfee1d8 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 _0xfd90=['get','isAuthenticated','describe','/:id/sections','getSections','getResources','create','post','/:id/clone','clone','addSections','/:id/resources','addResources','put','/:id','update','destroy','removeSections','delete','removeResources','exports','multer','util','connect-timeout','express','Router','../../config/environment','./userProfile.controller'];(function(_0x548f61,_0x3c0374){var _0x5792cf=function(_0x58fa2f){while(--_0x58fa2f){_0x548f61['push'](_0x548f61['shift']());}};_0x5792cf(++_0x3c0374);}(_0xfd90,0x165));var _0x0fd9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfd90[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0fd9('0x0'));var util=require(_0x0fd9('0x1'));var path=require('path');var timeout=require(_0x0fd9('0x2'));var express=require(_0x0fd9('0x3'));var router=express[_0x0fd9('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0fd9('0x5'));var controller=require(_0x0fd9('0x6'));router[_0x0fd9('0x7')]('/',auth[_0x0fd9('0x8')](),controller['index']);router[_0x0fd9('0x7')]('/describe',auth[_0x0fd9('0x8')](),controller[_0x0fd9('0x9')]);router['get']('/:id',auth[_0x0fd9('0x8')](),controller['show']);router[_0x0fd9('0x7')](_0x0fd9('0xa'),auth['isAuthenticated'](),controller[_0x0fd9('0xb')]);router['get']('/:id/resources',auth[_0x0fd9('0x8')](),controller[_0x0fd9('0xc')]);router['post']('/',auth[_0x0fd9('0x8')](),controller[_0x0fd9('0xd')]);router[_0x0fd9('0xe')](_0x0fd9('0xf'),auth[_0x0fd9('0x8')](),controller[_0x0fd9('0x10')]);router[_0x0fd9('0xe')](_0x0fd9('0xa'),auth['isAuthenticated'](),controller[_0x0fd9('0x11')]);router[_0x0fd9('0xe')](_0x0fd9('0x12'),auth[_0x0fd9('0x8')](),controller[_0x0fd9('0x13')]);router[_0x0fd9('0x14')](_0x0fd9('0x15'),auth[_0x0fd9('0x8')](),controller[_0x0fd9('0x16')]);router['delete']('/:id',auth[_0x0fd9('0x8')](),controller[_0x0fd9('0x17')]);router['delete'](_0x0fd9('0xa'),auth[_0x0fd9('0x8')](),controller[_0x0fd9('0x18')]);router[_0x0fd9('0x19')](_0x0fd9('0x12'),auth[_0x0fd9('0x8')](),controller[_0x0fd9('0x1a')]);module[_0x0fd9('0x1b')]=router; \ No newline at end of file +var _0x9394=['show','/:id/sections','/:id/resources','getResources','post','create','/:id/clone','clone','update','destroy','delete','removeSections','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5bbb86,_0x31386a){var _0x41f61d=function(_0x4a29d4){while(--_0x4a29d4){_0x5bbb86['push'](_0x5bbb86['shift']());}};_0x41f61d(++_0x31386a);}(_0x9394,0xed));var _0x4939=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0x9394[_0x5b34c0];return _0x242bd3;};'use strict';var multer=require(_0x4939('0x0'));var util=require(_0x4939('0x1'));var path=require(_0x4939('0x2'));var timeout=require(_0x4939('0x3'));var express=require('express');var router=express[_0x4939('0x4')]();var auth=require(_0x4939('0x5'));var interaction=require(_0x4939('0x6'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router[_0x4939('0x7')]('/',auth[_0x4939('0x8')](),controller[_0x4939('0x9')]);router[_0x4939('0x7')](_0x4939('0xa'),auth[_0x4939('0x8')](),controller[_0x4939('0xb')]);router[_0x4939('0x7')](_0x4939('0xc'),auth[_0x4939('0x8')](),controller[_0x4939('0xd')]);router[_0x4939('0x7')](_0x4939('0xe'),auth['isAuthenticated'](),controller['getSections']);router['get'](_0x4939('0xf'),auth[_0x4939('0x8')](),controller[_0x4939('0x10')]);router[_0x4939('0x11')]('/',auth[_0x4939('0x8')](),controller[_0x4939('0x12')]);router[_0x4939('0x11')](_0x4939('0x13'),auth[_0x4939('0x8')](),controller[_0x4939('0x14')]);router['post']('/:id/sections',auth[_0x4939('0x8')](),controller['addSections']);router['post'](_0x4939('0xf'),auth[_0x4939('0x8')](),controller['addResources']);router['put'](_0x4939('0xc'),auth[_0x4939('0x8')](),controller[_0x4939('0x15')]);router['delete'](_0x4939('0xc'),auth[_0x4939('0x8')](),controller[_0x4939('0x16')]);router[_0x4939('0x17')](_0x4939('0xe'),auth[_0x4939('0x8')](),controller[_0x4939('0x18')]);router[_0x4939('0x17')](_0x4939('0xf'),auth[_0x4939('0x8')](),controller['removeResources']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index e075388..a4854a4 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 _0xe306=['name','STRING','setDataValue','crudPermissions','split','sequelize','exports'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xe306,0xad));var _0x6e30=function(_0x12bcf7,_0xc11103){_0x12bcf7=_0x12bcf7-0x0;var _0x2825a=_0xe306[_0x12bcf7];return _0x2825a;};'use strict';var Sequelize=require(_0x6e30('0x0'));module[_0x6e30('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6e30('0x2')},'crudPermissions':{'type':Sequelize[_0x6e30('0x3')],'set':function(_0x3f1e74){this[_0x6e30('0x4')]('crudPermissions',_0x3f1e74?_0x3f1e74['join'](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue'](_0x6e30('0x5'))[_0x6e30('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x9e50=['STRING','name','setDataValue','join','getDataValue','crudPermissions','split','sequelize','exports'];(function(_0x23b1d5,_0x3043fa){var _0x3f5702=function(_0xc9b7eb){while(--_0xc9b7eb){_0x23b1d5['push'](_0x23b1d5['shift']());}};_0x3f5702(++_0x3043fa);}(_0x9e50,0xdf));var _0x09e5=function(_0x4a3310,_0x2ae896){_0x4a3310=_0x4a3310-0x0;var _0x58fb5f=_0x9e50[_0x4a3310];return _0x58fb5f;};'use strict';var Sequelize=require(_0x09e5('0x0'));module[_0x09e5('0x1')]={'name':{'type':Sequelize[_0x09e5('0x2')],'allowNull':![],'unique':_0x09e5('0x3')},'crudPermissions':{'type':Sequelize[_0x09e5('0x2')],'set':function(_0x1cb204){this[_0x09e5('0x4')]('crudPermissions',_0x1cb204?_0x1cb204[_0x09e5('0x5')](''):[]);},'get':function(){return this[_0x09e5('0x6')]('crudPermissions')?this['getDataValue'](_0x09e5('0x7'))[_0x09e5('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 2e04092..f9272d0 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 _0x2670=['Invalid\x20section\x20\x27','parentSections','ignore','union','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','custom','CustomReports','CmContact','Tag','color','ThroughTags','tag','value','toLowerCase','squareprojects','SquareProject','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projects','contacts','Lists','ListId','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','ChatQueue','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceContext','voicemails','VoiceMail','Agents','membername','User','role','agent','VoiceQueues','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','telephones','Users','admin','Telephones','zendeskaccounts','ZendeskAccount','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','customdashboards','intervals','Interval','Pause','Schedule','Sound','tags','templates','Template','triggers','trunks','variables','Variable','extractedreports','metrics','AnalyticMetric','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','api','../../config/utils','../../config/environment','redis','defaults','localhost','./userProfile.socket','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','UserProfile','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','body','omit','updatedAt','crudPermissions','createdAt','get','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','create','describe','transaction','push','removeSections','ids','includes','isEmpty','subsections','enabled','findOne','Dashboard','forEach','resourceId','Plugin','sequelize','bulkCreate','removeResources','getResources','section','ValidationError','Unknown\x20section','childModel','undefined'];(function(_0xba1760,_0x191969){var _0x1f3143=function(_0x5aa807){while(--_0x5aa807){_0xba1760['push'](_0xba1760['shift']());}};_0x1f3143(++_0x191969);}(_0x2670,0x71));var _0x0267=function(_0x1122b0,_0x3259ce){_0x1122b0=_0x1122b0-0x0;var _0x4dc9c9=_0x2670[_0x1122b0];return _0x4dc9c9;};'use strict';var pdf=require(_0x0267('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0267('0x1'));var jsonpatch=require(_0x0267('0x2'));var rp=require(_0x0267('0x3'));var moment=require('moment');var BPromise=require(_0x0267('0x4'));var Mustache=require(_0x0267('0x5'));var util=require(_0x0267('0x6'));var path=require(_0x0267('0x7'));var sox=require(_0x0267('0x8'));var csv=require(_0x0267('0x9'));var ejs=require(_0x0267('0xa'));var fs=require('fs');var _=require(_0x0267('0xb'));var squel=require('squel');var crypto=require(_0x0267('0xc'));var jsforce=require(_0x0267('0xd'));var deskjs=require(_0x0267('0xe'));var toCsv=require(_0x0267('0x9'));var querystring=require(_0x0267('0xf'));var Papa=require(_0x0267('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0267('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0267('0x12'));var utils=require(_0x0267('0x13'));var config=require(_0x0267('0x14'));var db=require('../../mysqldb')['db'];config[_0x0267('0x15')]=_[_0x0267('0x16')](config[_0x0267('0x15')],{'host':_0x0267('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0267('0x15')]));require(_0x0267('0x18'))['register'](socket);function respondWithStatusCode(_0x1b7088,_0x58ec81){_0x58ec81=_0x58ec81||0xcc;return function(_0x5c784b){if(_0x5c784b){return _0x1b7088[_0x0267('0x19')](_0x58ec81);}return _0x1b7088[_0x0267('0x1a')](_0x58ec81)[_0x0267('0x1b')]();};}function respondWithResult(_0x83e195,_0x3a6b5d){_0x3a6b5d=_0x3a6b5d||0xc8;return function(_0x58c712){if(_0x58c712){return _0x83e195[_0x0267('0x1a')](_0x3a6b5d)[_0x0267('0x1c')](_0x58c712);}};}function respondWithFilteredResult(_0x160f6d,_0x4fc2fa){return function(_0x344b48){if(_0x344b48){var _0x5f0cd8=_0x344b48['count'],_0x41f0de=_0x4fc2fa['offset'],_0x2150df=_0x4fc2fa[_0x0267('0x1d')]+_0x4fc2fa[_0x0267('0x1e')],_0x228006;if(_0x2150df>=_0x5f0cd8){_0x2150df=_0x5f0cd8;_0x228006=0xc8;}else{_0x228006=0xce;}_0x160f6d[_0x0267('0x1a')](_0x228006);return _0x160f6d['set'](_0x0267('0x1f'),_0x41f0de+'-'+_0x2150df+'/'+_0x5f0cd8)['json'](_0x344b48);}return null;};}function patchUpdates(_0x1cd188){return function(_0x9ddb4e){try{jsonpatch[_0x0267('0x20')](_0x9ddb4e,_0x1cd188,!![]);}catch(_0x5d78bc){return BPromise[_0x0267('0x21')](_0x5d78bc);}return _0x9ddb4e['save']();};}function saveUpdates(_0x4e6962,_0x32e16a){return function(_0xb7342){if(_0xb7342){return _0xb7342[_0x0267('0x22')](_0x4e6962)[_0x0267('0x23')](function(_0x4fa41d){return _0x4fa41d;});}return null;};}function removeEntity(_0x2c5d9f,_0x3d5374){return function(_0x4f5ec1){if(_0x4f5ec1){return _0x4f5ec1[_0x0267('0x24')]()['then'](function(){_0x2c5d9f[_0x0267('0x1a')](0xcc)[_0x0267('0x1b')]();});}};}function handleEntityNotFound(_0x1b7d2c,_0x104ea8){return function(_0x455e10){if(!_0x455e10){_0x1b7d2c[_0x0267('0x19')](0x194);}return _0x455e10;};}function handleError(_0x3c85cd,_0x10ead8){_0x10ead8=_0x10ead8||0x1f4;return function(_0x3d092e){logger[_0x0267('0x25')](_0x3d092e[_0x0267('0x26')]);if(_0x3d092e[_0x0267('0x27')]){delete _0x3d092e['name'];}_0x3c85cd['status'](_0x10ead8)[_0x0267('0x28')](_0x3d092e);};}exports[_0x0267('0x29')]=function(_0x801336,_0x150902){var _0x53d80b={},_0xf2bcfb={},_0x6c541a={'count':0x0,'rows':[]};var _0xc15c7=_[_0x0267('0x2a')](db[_0x0267('0x2b')]['rawAttributes'],function(_0x1414d3){return{'name':_0x1414d3[_0x0267('0x2c')],'type':_0x1414d3[_0x0267('0x2d')][_0x0267('0x2e')]};});_0xf2bcfb['model']=_['map'](_0xc15c7,'name');_0xf2bcfb['query']=_[_0x0267('0x2f')](_0x801336[_0x0267('0x30')]);_0xf2bcfb[_0x0267('0x31')]=_[_0x0267('0x32')](_0xf2bcfb[_0x0267('0x33')],_0xf2bcfb[_0x0267('0x30')]);_0x53d80b[_0x0267('0x34')]=_[_0x0267('0x32')](_0xf2bcfb[_0x0267('0x33')],qs['fields'](_0x801336[_0x0267('0x30')][_0x0267('0x35')]));_0x53d80b['attributes']=_0x53d80b[_0x0267('0x34')]['length']?_0x53d80b[_0x0267('0x34')]:_0xf2bcfb[_0x0267('0x33')];if(!_0x801336['query'][_0x0267('0x36')](_0x0267('0x37'))){_0x53d80b[_0x0267('0x1e')]=qs['limit'](_0x801336[_0x0267('0x30')][_0x0267('0x1e')]);_0x53d80b['offset']=qs['offset'](_0x801336[_0x0267('0x30')][_0x0267('0x1d')]);}_0x53d80b[_0x0267('0x38')]=qs[_0x0267('0x39')](_0x801336[_0x0267('0x30')]['sort']);_0x53d80b[_0x0267('0x3a')]=qs[_0x0267('0x31')](_[_0x0267('0x3b')](_0x801336[_0x0267('0x30')],_0xf2bcfb[_0x0267('0x31')]),_0xc15c7);if(_0x801336[_0x0267('0x30')][_0x0267('0x3c')]){_0x53d80b['where']=_[_0x0267('0x3d')](_0x53d80b[_0x0267('0x3a')],{'$or':_[_0x0267('0x2a')](_0xc15c7,function(_0x594e26){if(_0x594e26[_0x0267('0x2d')]!==_0x0267('0x3e')){var _0x5c912c={};_0x5c912c[_0x594e26[_0x0267('0x27')]]={'$like':'%'+_0x801336[_0x0267('0x30')][_0x0267('0x3c')]+'%'};return _0x5c912c;}})});}_0x53d80b=_['merge']({},_0x53d80b,_0x801336['options']);var _0x581837={'where':_0x53d80b[_0x0267('0x3a')]};return db[_0x0267('0x2b')][_0x0267('0x3f')](_0x581837)[_0x0267('0x23')](function(_0x5715a3){_0x6c541a[_0x0267('0x3f')]=_0x5715a3;if(_0x801336[_0x0267('0x30')][_0x0267('0x40')]){_0x53d80b[_0x0267('0x41')]=[{'all':!![]}];}return db[_0x0267('0x2b')][_0x0267('0x42')](_0x53d80b);})['then'](function(_0x5b8ed9){_0x6c541a[_0x0267('0x43')]=_0x5b8ed9;return _0x6c541a;})[_0x0267('0x23')](respondWithFilteredResult(_0x150902,_0x53d80b))[_0x0267('0x44')](handleError(_0x150902,null));};exports[_0x0267('0x45')]=function(_0x4dbdfd,_0x15ebb8){var _0x6be089={'raw':![],'where':{'id':_0x4dbdfd[_0x0267('0x46')]['id']}},_0x3a475c={};_0x3a475c['model']=_['keys'](db[_0x0267('0x2b')][_0x0267('0x47')]);_0x3a475c[_0x0267('0x30')]=_[_0x0267('0x2f')](_0x4dbdfd['query']);_0x3a475c[_0x0267('0x31')]=_[_0x0267('0x32')](_0x3a475c[_0x0267('0x33')],_0x3a475c[_0x0267('0x30')]);_0x6be089[_0x0267('0x34')]=_[_0x0267('0x32')](_0x3a475c[_0x0267('0x33')],qs[_0x0267('0x35')](_0x4dbdfd[_0x0267('0x30')]['fields']));_0x6be089[_0x0267('0x34')]=_0x6be089[_0x0267('0x34')][_0x0267('0x48')]?_0x6be089['attributes']:_0x3a475c['model'];if(_0x4dbdfd['query'][_0x0267('0x40')]){_0x6be089['include']=[{'all':!![]}];}_0x6be089=_[_0x0267('0x3d')]({},_0x6be089,_0x4dbdfd[_0x0267('0x49')]);return db['UserProfile'][_0x0267('0x4a')](_0x6be089)[_0x0267('0x23')](handleEntityNotFound(_0x15ebb8,null))[_0x0267('0x23')](respondWithResult(_0x15ebb8,null))['catch'](handleError(_0x15ebb8,null));};exports['create']=function(_0x4486b4,_0x4eeb95){return db[_0x0267('0x2b')]['create'](_0x4486b4[_0x0267('0x4b')],{})['then'](respondWithResult(_0x4eeb95,0xc9))[_0x0267('0x44')](handleError(_0x4eeb95,null));};exports['clone']=function(_0x212438,_0x30c025){var _0x1b3d0d={'where':{'id':_0x212438[_0x0267('0x46')]['id']}},_0x92cc4e={};_0x92cc4e['model']=_[_0x0267('0x2f')](db['UserProfile'][_0x0267('0x47')]);_0x1b3d0d[_0x0267('0x34')]=_[_0x0267('0x32')](_0x92cc4e[_0x0267('0x33')],qs['fields'](_0x212438[_0x0267('0x30')]['fields']));_0x1b3d0d['attributes']=_0x1b3d0d['attributes'][_0x0267('0x48')]?_0x1b3d0d[_0x0267('0x34')]:_0x92cc4e[_0x0267('0x33')];if(_0x212438[_0x0267('0x30')]['includeAll']){_0x1b3d0d[_0x0267('0x41')]=[{'all':!![]}];}_0x1b3d0d=_['merge']({},_0x1b3d0d,_0x212438[_0x0267('0x49')]);return db['UserProfile'][_0x0267('0x4a')](_0x1b3d0d)[_0x0267('0x23')](handleEntityNotFound(_0x30c025,null))[_0x0267('0x23')](function(_0x4d52c4){if(_0x4d52c4){var _0x374a16=_0x4d52c4['get']({'plain':!![]});_0x374a16=qs[_0x0267('0x4c')](_0x374a16,['id','createdAt',_0x0267('0x4d'),_0x0267('0x4e')]);_0x212438[_0x0267('0x4b')]=_['omit'](_0x212438[_0x0267('0x4b')],['id',_0x0267('0x4f'),_0x0267('0x4d')]);return db['sequelize']['transaction'](function(_0x3ff62c){return db['UserProfile']['create'](_[_0x0267('0x3d')](_0x374a16,_0x212438[_0x0267('0x4b')]),{'include':_0x212438[_0x0267('0x30')][_0x0267('0x40')]?[{'all':!![]}]:undefined,'transaction':_0x3ff62c})[_0x0267('0x23')](function(_0x512ab4){var _0x13e58b=_0x512ab4[_0x0267('0x50')]({'plain':!![]});return db[_0x0267('0x51')][_0x0267('0x42')]({'where':{'userProfileId':_0x212438[_0x0267('0x46')]['id']},'raw':!![]})['then'](function(_0x44af5b){if(_0x44af5b){return BPromise[_0x0267('0x52')](_0x44af5b,function(_0x208631){return new BPromise(function(_0x3b4941,_0x2a6e5e){if(_0x208631[_0x0267('0x53')]===null||_0x208631[_0x0267('0x53')]===0x1)_0x3b4941(null);return db[_0x0267('0x54')]['findAll']({'where':{'sectionId':_0x208631['id']},'raw':!![]})[_0x0267('0x23')](function(_0x1ffe6b){var _0x4675bc=_[_0x0267('0x2a')](_0x1ffe6b,function(_0x48f91c){return qs['omit'](_0x48f91c,['id',_0x0267('0x4f'),_0x0267('0x4d'),_0x0267('0x55')]);});_0x3b4941(_0x4675bc);})[_0x0267('0x44')](function(_0x5bd5d6){_0x2a6e5e(_0x5bd5d6);});})[_0x0267('0x23')](function(_0x3d25a0){var _0x5293d8=qs[_0x0267('0x4c')](_0x208631,['id','createdAt',_0x0267('0x4d')]);_0x5293d8[_0x0267('0x56')]=_0x13e58b['id'];if(_0x3d25a0)_0x5293d8[_0x0267('0x57')]=_0x3d25a0;return _0x5293d8;})[_0x0267('0x23')](function(_0x399dc4){return db[_0x0267('0x51')][_0x0267('0x58')](_0x399dc4,{'include':[{'model':db[_0x0267('0x54')],'as':_0x0267('0x57')}],'raw':!![],'transaction':_0x3ff62c});});})[_0x0267('0x23')](function(){return _0x13e58b;});}});});});}})[_0x0267('0x23')](respondWithResult(_0x30c025,0xc9))[_0x0267('0x44')](handleError(_0x30c025,null));};exports[_0x0267('0x22')]=function(_0x230d6e,_0x2110bf){if(_0x230d6e[_0x0267('0x4b')]['id']){delete _0x230d6e[_0x0267('0x4b')]['id'];}return db[_0x0267('0x2b')]['find']({'where':{'id':_0x230d6e[_0x0267('0x46')]['id']}})[_0x0267('0x23')](handleEntityNotFound(_0x2110bf,null))['then'](saveUpdates(_0x230d6e[_0x0267('0x4b')],null))[_0x0267('0x23')](respondWithResult(_0x2110bf,null))[_0x0267('0x44')](handleError(_0x2110bf,null));};exports[_0x0267('0x24')]=function(_0x3eb7c2,_0x10e36f){return db[_0x0267('0x2b')][_0x0267('0x4a')]({'where':{'id':_0x3eb7c2[_0x0267('0x46')]['id']}})[_0x0267('0x23')](handleEntityNotFound(_0x10e36f,null))['then'](removeEntity(_0x10e36f,null))['catch'](handleError(_0x10e36f,null));};exports['describe']=function(_0x595ca6,_0x409e0f){return db[_0x0267('0x2b')][_0x0267('0x59')]()['then'](respondWithResult(_0x409e0f,null))[_0x0267('0x44')](handleError(_0x409e0f,null));};exports['addSections']=function(_0x1a1030,_0x53b96b){var _0x32c647=_0x1a1030[_0x0267('0x4b')];return db[_0x0267('0x2b')][_0x0267('0x4a')]({'where':{'id':_0x1a1030[_0x0267('0x46')]['id']}})[_0x0267('0x23')](handleEntityNotFound(_0x53b96b,null))[_0x0267('0x23')](function(_0x4d03e5){if(_0x4d03e5){return db['sequelize'][_0x0267('0x5a')](function(_0x74eebc){return db[_0x0267('0x51')][_0x0267('0x24')]({'where':{'userProfileId':_0x1a1030['params']['id'],'sectionId':_[_0x0267('0x2a')](_0x32c647,function(_0x42e08c){return _0x42e08c['sectionId'];})},'transaction':_0x74eebc})[_0x0267('0x23')](function(){var _0x27fdbb=_['map'](_0x32c647,function(_0x2382bf){_0x2382bf[_0x0267('0x56')]=_0x1a1030['params']['id'];return _0x2382bf;});var _0x248070=[];return BPromise[_0x0267('0x52')](_0x27fdbb,function(_0x52a539){return db[_0x0267('0x51')][_0x0267('0x58')](_0x52a539,{'include':[{'model':db[_0x0267('0x54')],'as':_0x0267('0x57')}],'raw':!![],'transaction':_0x74eebc})['then'](function(_0x560a6b){_0x248070[_0x0267('0x5b')](_0x560a6b[_0x0267('0x50')]({'plain':!![]}));});})[_0x0267('0x23')](function(){return _0x248070;});});});}})[_0x0267('0x23')](function(_0x2dc1ab){return _0x2dc1ab;})['then'](respondWithResult(_0x53b96b,null))['catch'](handleError(_0x53b96b,null));};exports[_0x0267('0x5c')]=function(_0x3fbfd7,_0x450dbf){var _0x252a91;return db[_0x0267('0x2b')][_0x0267('0x4a')]({'where':{'id':_0x3fbfd7[_0x0267('0x46')]['id']},'attributes':['id',_0x0267('0x27')]})['then'](handleEntityNotFound(_0x450dbf,null))['then'](function(_0x545350){if(_0x545350){_0x252a91=_0x545350;return db[_0x0267('0x51')]['destroy']({'where':{'userProfileId':_0x3fbfd7[_0x0267('0x46')]['id'],'sectionId':_0x3fbfd7['query'][_0x0267('0x5d')]}});}})[_0x0267('0x23')](function(){return _0x252a91;})[_0x0267('0x23')](respondWithStatusCode(_0x450dbf,null))[_0x0267('0x44')](handleError(_0x450dbf,null));};exports['getSections']=function(_0x39fa27,_0x289e83){var _0x1eb03e=[];var _0x39808c=[];return db[_0x0267('0x51')]['findAll']({'where':{'userProfileId':_0x39fa27['params']['id']},'raw':!![]})[_0x0267('0x23')](function(_0x39f62b){_0x1eb03e=_[_0x0267('0x3c')](_0x39f62b,function(_0x5cd877){return _0x5cd877['enabled']===0x1||_[_0x0267('0x5e')]([0x3eb,0x709],_0x5cd877[_0x0267('0x55')]);});if(!_[_0x0267('0x5f')](_0x1eb03e)){return _['map'](_0x1eb03e,function(_0x1c97dc){return _0x1c97dc[_0x0267('0x55')];});}else{return;}})[_0x0267('0x23')](function(_0x277051){if(_0x277051)_0x39808c=_0x277051;if(_[_0x0267('0x5e')](_0x39808c,0x64)){var _0x443f7e=_['find'](_0x1eb03e,{'sectionId':0x64});return hasDefaultDashboard(_0x443f7e)[_0x0267('0x23')](function(_0x1f3d84){return _[_0x0267('0x2a')](_0x1eb03e,function(_0x11bea1){if(_0x11bea1[_0x0267('0x55')]===0x64){_0x11bea1[_0x0267('0x60')]=_0x1f3d84;}return _0x11bea1;});});}else{return;}})[_0x0267('0x23')](function(_0xff0635){if(_0xff0635)_0x1eb03e=_0xff0635;if(_[_0x0267('0x5e')](_0x39808c,0x3eb)){var _0x339a49=_[_0x0267('0x4a')](_0x1eb03e,{'sectionId':0x3eb});return getCustomDashboards(_0x339a49)[_0x0267('0x23')](function(_0x44b055){return _[_0x0267('0x2a')](_0x1eb03e,function(_0x536ec1){if(_0x339a49[_0x0267('0x61')]){if(_0x536ec1['sectionId']===0x3eb){_0x536ec1[_0x0267('0x60')]=_0x44b055;}}else{if(_0x536ec1[_0x0267('0x55')]===0x64){_0x536ec1[_0x0267('0x60')]=_0x44b055;}}return _0x536ec1;});});}else{return;}})[_0x0267('0x23')](function(_0x35315b){if(_0x35315b)_0x1eb03e=_0x35315b;if(_[_0x0267('0x5e')](_0x39808c,0x709)){var _0x368535=_[_0x0267('0x4a')](_0x1eb03e,{'sectionId':0x709});return getPlugins(_0x368535)[_0x0267('0x23')](function(_0x2b94e8){if(_0x368535[_0x0267('0x61')]){return _[_0x0267('0x2a')](_0x1eb03e,function(_0x2f09f8){if(_0x2f09f8[_0x0267('0x55')]===0x709){_0x2f09f8[_0x0267('0x60')]=_0x2b94e8;}return _0x2f09f8;});}else{var _0x49445b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x2b94e8};var _0x592c04=_[_0x0267('0x2a')](_0x1eb03e);_0x592c04[_0x0267('0x5b')](_0x49445b);return _0x592c04;}});}else{return;}})[_0x0267('0x23')](function(_0x86bdab){if(_0x86bdab)_0x1eb03e=_0x86bdab;return _[_0x0267('0x3c')](_0x1eb03e,['enabled',0x1]);})[_0x0267('0x23')](respondWithResult(_0x289e83,null))[_0x0267('0x44')](handleError(_0x289e83,null));};function hasDefaultDashboard(_0x3868e9){var _0x3b03f2=[0x65];return new BPromise(function(_0x17c5c2,_0x45febc){try{if(_0x3868e9[_0x0267('0x53')]){_0x17c5c2(_0x3b03f2);}else{return db['UserProfileResource'][_0x0267('0x62')]({'where':{'sectionId':_0x3868e9['id']},'raw':!![]})['then'](function(_0x5a5fde){_0x5a5fde?_0x17c5c2(_0x3b03f2):_0x17c5c2();});}}catch(_0x2c88c0){_0x45febc(_0x2c88c0);}});}function getCustomDashboards(_0x58bb32){var _0x5987ec=[];return new BPromise(function(_0x5afdd4,_0x4fdaa5){try{if(_0x58bb32[_0x0267('0x53')]){return db[_0x0267('0x63')][_0x0267('0x42')]({'raw':!![]})[_0x0267('0x23')](function(_0x378f3){_0x378f3[_0x0267('0x64')](function(_0x387698){_0x5987ec[_0x0267('0x5b')](_0x387698['id']+0x1869f);});_0x5afdd4(_0x5987ec);});}else{return db[_0x0267('0x54')]['findAll']({'where':{'sectionId':_0x58bb32['id']},'raw':!![]})[_0x0267('0x23')](function(_0x37f5ee){_0x37f5ee[_0x0267('0x64')](function(_0x41338e){_0x5987ec[_0x0267('0x5b')](_0x41338e[_0x0267('0x65')]+0x1869f);});_0x5afdd4(_0x5987ec);});}}catch(_0x11914b){_0x4fdaa5(_0x11914b);}});}function getPlugins(_0x2f5655){var _0x2cc02b=[];return new BPromise(function(_0x4872c0,_0x46b332){try{if(_0x2f5655[_0x0267('0x53')]){return db[_0x0267('0x66')][_0x0267('0x42')]({'raw':!![]})['then'](function(_0x95d5ed){_0x95d5ed[_0x0267('0x64')](function(_0x5c770a){_0x2cc02b[_0x0267('0x5b')](_0x5c770a['id']+0x15b38);});_0x4872c0(_0x2cc02b);});}else{return db['UserProfileResource'][_0x0267('0x42')]({'where':{'sectionId':_0x2f5655['id']},'raw':!![]})['then'](function(_0x1b21f5){_0x1b21f5[_0x0267('0x64')](function(_0x492dd1){_0x2cc02b[_0x0267('0x5b')](_0x492dd1[_0x0267('0x65')]+0x15b38);});_0x4872c0(_0x2cc02b);});}}catch(_0x174fe2){_0x46b332(_0x174fe2);}});}exports['addResources']=function(_0x138322,_0xe7cb0e){return db[_0x0267('0x2b')][_0x0267('0x4a')]({'where':{'id':_0x138322[_0x0267('0x46')]['id']}})[_0x0267('0x23')](handleEntityNotFound(_0xe7cb0e,null))[_0x0267('0x23')](function(_0x7accb9){if(_0x7accb9){return db[_0x0267('0x67')][_0x0267('0x5a')](function(_0x4e6483){return db[_0x0267('0x51')][_0x0267('0x42')]({'where':{'userProfileId':_0x138322[_0x0267('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0x0267('0x23')](function(_0x527873){if(_0x527873){return db[_0x0267('0x51')][_0x0267('0x24')]({'where':{'userProfileId':_0x138322[_0x0267('0x46')]['id'],'id':_[_0x0267('0x2a')](_0x527873,function(_0x2528be){return _0x2528be['id'];})},'transaction':_0x4e6483});}})[_0x0267('0x23')](function(_0x52e887){var _0x31a9d3=_[_0x0267('0x2a')](_0x138322['body'],function(_0x9b4f1b){_0x9b4f1b[_0x0267('0x56')]=_0x138322[_0x0267('0x46')]['id'];return _0x9b4f1b;});return db[_0x0267('0x51')][_0x0267('0x68')](_0x31a9d3,{'raw':!![],'transaction':_0x4e6483});})[_0x0267('0x23')](function(_0x1daa70){var _0x3f1e03=_[_0x0267('0x3c')](_[_0x0267('0x2a')](_0x1daa70,function(_0x588d0d){return _0x588d0d[_0x0267('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x3f1e03){return db['UserProfileSection'][_0x0267('0x42')]({'where':{'userProfileId':_0x138322[_0x0267('0x46')]['id'],'sectionId':_['map'](_0x3f1e03,function(_0x1cb8c4){return _0x1cb8c4[_0x0267('0x55')];})},'attributes':['id',_0x0267('0x55')],'raw':!![]})['then'](function(_0x5c7cec){var _0x2484ad=_[_0x0267('0x2a')](_0x138322['body'],function(_0x485722){_0x485722[_0x0267('0x56')]=_0x138322[_0x0267('0x46')]['id'];return _0x485722;});return db[_0x0267('0x54')][_0x0267('0x68')](_0x2484ad,{'raw':!![],'transaction':_0x4e6483});});}})[_0x0267('0x44')](handleError(_0xe7cb0e,null));});}})[_0x0267('0x23')](function(_0x1f75e8){var _0x44a7c6=_[_0x0267('0x2a')](_0x1f75e8,function(_0x82d1ba){return _0x82d1ba[_0x0267('0x50')]({'plain':!![]});});})[_0x0267('0x23')](respondWithResult(_0xe7cb0e,null))[_0x0267('0x44')](handleError(_0xe7cb0e,null));};exports[_0x0267('0x69')]=function(_0x6f60bc,_0xcd5cd6,_0x3f781b){return db['UserProfile'][_0x0267('0x4a')]({'where':{'id':_0x6f60bc[_0x0267('0x46')]['id']}})[_0x0267('0x23')](handleEntityNotFound(_0xcd5cd6,null))[_0x0267('0x23')](function(_0x196c0b){if(_0x196c0b){return _0x196c0b[_0x0267('0x69')](_0x6f60bc[_0x0267('0x30')][_0x0267('0x5d')]);}})[_0x0267('0x23')](respondWithStatusCode(_0xcd5cd6,null))[_0x0267('0x44')](handleError(_0xcd5cd6,null));};exports[_0x0267('0x6a')]=function(_0x28afe8,_0x55b13b){var _0x492287={'raw':![],'where':{}};var _0x304f24={};var _0x3ee3c3={'count':0x0,'rows':[]};var _0x40abc1=_0x28afe8['query'][_0x0267('0x6b')];if(typeof _0x40abc1==='undefined'){throw new db['Sequelize'][(_0x0267('0x6c'))](_0x0267('0x6d'));}var _0x1d5678=_0x28afe8[_0x0267('0x30')]['mergeResources']||![];var _0x33ce28=getQueryModels(_0x40abc1,_0x1d5678);if(typeof _0x33ce28[_0x0267('0x6e')]===_0x0267('0x6f')){throw new db['Sequelize'][(_0x0267('0x6c'))](_0x0267('0x70')+_0x40abc1+'\x27');}var _0x32816f=[];if(!_['isEmpty'](_0x33ce28[_0x0267('0x71')])){_0x32816f=_0x33ce28['parentSections'];}else{_0x32816f=[{'name':_0x40abc1}];}return db[_0x0267('0x2b')][_0x0267('0x62')]({'where':{'id':_0x28afe8[_0x0267('0x46')]['id']}})['then'](handleEntityNotFound(_0x55b13b,null))[_0x0267('0x23')](function(_0x414be4){if(_0x414be4){var _0x140703=[];for(var _0x13e5ec=0x0;_0x13e5ec<_0x32816f[_0x0267('0x48')];_0x13e5ec++){_0x140703[_0x0267('0x5b')](db[_0x0267('0x51')][_0x0267('0x62')]({'where':{'userProfileId':_0x414be4['id'],'name':_0x32816f[_0x13e5ec][_0x0267('0x27')]},'raw':!![]}));}return BPromise['all'](_0x140703);}})[_0x0267('0x23')](function(_0x5904cd){var _0x3aba2b=_[_0x0267('0x3c')](_0x5904cd,function(_0x5d6250){return _0x5d6250?_0x5d6250:undefined;});var _0x5c8056=_[_0x0267('0x3c')](_0x32816f,[_0x0267('0x72'),!![]]);var _0x555072=_[_0x0267('0x5f')](_0x3aba2b)&&_[_0x0267('0x5f')](_0x5c8056)?null:_[_0x0267('0x73')](_0x5c8056,_0x3aba2b);if(_0x555072){var _0x29ebd9=[];for(var _0x1f21cc=0x0;_0x1f21cc<_0x555072[_0x0267('0x48')];_0x1f21cc++){var _0x2b652c=_[_0x0267('0x4a')](_0x32816f,function(_0x4d20d1){return _0x555072[_0x1f21cc]?_0x4d20d1['name']===_0x555072[_0x1f21cc]['name']:null;});if(_0x2b652c){if(_0x555072[_0x1f21cc][_0x0267('0x72')]){_0x29ebd9['push'](getAllResources(_0x33ce28[_0x0267('0x6e')],_0x555072[_0x1f21cc]));}else{if(!_0x555072[_0x1f21cc]['autoAssociation']){_0x29ebd9[_0x0267('0x5b')](getAllowedResources(_0x2b652c,_0x555072[_0x1f21cc],_0x33ce28[_0x0267('0x6e')]));}else{if(_0x2b652c[_0x0267('0x33')]){_0x29ebd9[_0x0267('0x5b')](getAllFilteredResources(_0x2b652c,_0x555072[_0x1f21cc]));}}}}}return BPromise['all'](_0x29ebd9);}else{return null;}})['then'](function(_0x10208c){var _0x54601e=_0x10208c;var _0x406214=null;if(_0x54601e){_0x406214=_0x54601e['length']===0x1?_0x54601e[0x0]:null;}if(_0x406214||_0x54601e){var _0x13739f=db[_0x33ce28['childModel']][_0x0267('0x47')];_0x304f24[_0x0267('0x33')]=_['keys'](_0x13739f);_0x304f24[_0x0267('0x30')]=_['keys'](_0x28afe8[_0x0267('0x30')]);_0x304f24[_0x0267('0x31')]=_[_0x0267('0x32')](_0x304f24[_0x0267('0x33')],_0x304f24[_0x0267('0x30')]);_0x492287['attributes']=_[_0x0267('0x32')](_0x304f24[_0x0267('0x33')],qs['fields'](_0x28afe8[_0x0267('0x30')][_0x0267('0x35')]));_0x492287[_0x0267('0x34')]=_0x492287[_0x0267('0x34')][_0x0267('0x48')]?_0x492287[_0x0267('0x34')]:_0x304f24[_0x0267('0x33')];if(!_0x28afe8['query']['hasOwnProperty'](_0x0267('0x37'))){_0x492287[_0x0267('0x1e')]=qs['limit'](_0x28afe8['query'][_0x0267('0x1e')]);_0x492287['offset']=qs[_0x0267('0x1d')](_0x28afe8['query'][_0x0267('0x1d')]);}_0x492287['order']=qs[_0x0267('0x39')](_0x28afe8['query'][_0x0267('0x39')]);_0x492287[_0x0267('0x3a')]=qs[_0x0267('0x31')](_[_0x0267('0x3b')](_0x28afe8[_0x0267('0x30')],_0x304f24[_0x0267('0x31')]));if(_0x28afe8['query'][_0x0267('0x3c')]){_0x492287[_0x0267('0x3a')]=_[_0x0267('0x3d')](_0x492287[_0x0267('0x3a')],{'$or':_[_0x0267('0x2a')](_0x13739f,function(_0x3c1064){if(_0x3c1064[_0x0267('0x2d')]['key']!==_0x0267('0x3e')){var _0x591d63={};_0x591d63[_0x3c1064[_0x0267('0x74')]]={'$like':'%'+_0x28afe8[_0x0267('0x30')][_0x0267('0x3c')]+'%'};return _0x591d63;}})});}var _0x19b99d=[];if(_0x406214){var _0x4dfc64=_[_0x0267('0x4a')](_0x32816f,[_0x0267('0x27'),_0x406214[_0x0267('0x27')]]);if(_0x4dfc64[_0x0267('0x74')]){var _0x45580c={};if(_0x33ce28[_0x0267('0x6e')]===_0x0267('0x75')){_0x45580c[_0x4dfc64[_0x0267('0x76')]]=_[_0x0267('0x2a')](_0x406214[_0x0267('0x77')],'id');}else{_0x45580c[_0x4dfc64[_0x0267('0x76')]]=_0x406214[_0x0267('0x77')];}_0x19b99d['push'](_0x45580c);}else{_0x492287[_0x0267('0x3a')]['id']=_0x406214[_0x0267('0x77')];}}else{for(var _0x3b24a8=0x0;_0x3b24a8<_0x54601e[_0x0267('0x48')];_0x3b24a8++){var _0x4dfc64=_[_0x0267('0x4a')](_0x32816f,[_0x0267('0x27'),_0x54601e[_0x3b24a8][_0x0267('0x27')]]);if(_0x4dfc64[_0x0267('0x74')]){var _0x45580c={};_0x45580c[_0x4dfc64['foreignKey']]=_0x54601e[_0x3b24a8][_0x0267('0x77')];_0x19b99d['push'](_0x45580c);}else{if(!_0x492287['where']['id'])_0x492287['where']['id']=[];_0x54601e[_0x3b24a8]['associatedResources'][_0x0267('0x64')](function(_0x53b993){_0x492287[_0x0267('0x3a')]['id'][_0x0267('0x5b')](_0x53b993);});}}}if(!_['isEmpty'](_0x19b99d)){_0x492287[_0x0267('0x3a')]=_[_0x0267('0x3d')](_0x492287['where'],{'$and':{'$or':_0x19b99d}});}_0x492287=_[_0x0267('0x3d')]({},_0x492287,_0x28afe8[_0x0267('0x49')]);if(_0x406214&&!_0x406214[_0x0267('0x53')]&&_0x33ce28[_0x0267('0x6e')]==='AnalyticExtractedReport'){if(_0x28afe8[_0x0267('0x30')][_0x0267('0x40')]){_0x492287['include']=[{'all':!![]}];}return db[_0x33ce28[_0x0267('0x6e')]][_0x0267('0x42')](_0x492287)[_0x0267('0x23')](function(_0xbd2e90){var _0x2159c6=[];_0xbd2e90['forEach'](function(_0x40caa8){var _0x5d2f76;switch(_0x40caa8[_0x0267('0x78')]){case _0x0267('0x79'):_0x5d2f76=_[_0x0267('0x4a')](_0x406214[_0x0267('0x77')],function(_0xad0709){return _0xad0709['id']===_0x40caa8[_0x0267('0x7a')]&&_0xad0709[_0x0267('0x2d')]==='DefaultReports';});break;case _0x0267('0x7b'):_0x5d2f76=_[_0x0267('0x4a')](_0x406214['associatedResources'],function(_0x2581b9){return _0x2581b9['id']===_0x40caa8[_0x0267('0x7a')]&&_0x2581b9['type']===_0x0267('0x7c');});break;}if(_0x5d2f76)_0x2159c6[_0x0267('0x5b')](_0x40caa8);});_0x3ee3c3[_0x0267('0x3f')]=_0x2159c6[_0x0267('0x48')];_0x3ee3c3['rows']=_0x2159c6;return _0x3ee3c3;});}else{return db[_0x33ce28[_0x0267('0x6e')]][_0x0267('0x3f')]({'where':_0x492287[_0x0267('0x3a')]})[_0x0267('0x23')](function(_0x17868e){_0x3ee3c3[_0x0267('0x3f')]=_0x17868e;if(_0x28afe8[_0x0267('0x30')][_0x0267('0x40')]){if(_0x33ce28['childModel']===_0x0267('0x7d')){_0x492287[_0x0267('0x41')]=[{'model':db[_0x0267('0x7e')],'as':'Tags','attributes':['id',_0x0267('0x27'),_0x0267('0x7f')],'required':_0x28afe8[_0x0267('0x30')]['tag']?!![]:![]},{'model':db[_0x0267('0x7e')],'as':_0x0267('0x80'),'attributes':['id','name',_0x0267('0x7f')],'through':_0x28afe8[_0x0267('0x30')][_0x0267('0x81')]?{'attributes':[],'where':{'TagId':_0x28afe8['query'][_0x0267('0x81')]||undefined}}:{},'required':_0x28afe8['query'][_0x0267('0x81')]?!![]:![]}];}else{_0x492287['include']=[{'all':!![]}];}}return db[_0x33ce28[_0x0267('0x6e')]][_0x0267('0x42')](_0x492287);})[_0x0267('0x23')](function(_0xba041){_0x3ee3c3['rows']=_0xba041;return _0x3ee3c3;});}}else{return _0x3ee3c3;}})[_0x0267('0x23')](respondWithFilteredResult(_0x55b13b,_0x492287))['catch'](handleError(_0x55b13b,null));};function getAllResources(_0x161ff5,_0x247548){return new BPromise(function(_0x572d3e,_0x103b99){if(_0x247548){var _0x594dd6=_0x247548[_0x0267('0x3c')]?{[_0x247548[_0x0267('0x3c')]['field']]:_0x247548[_0x0267('0x3c')]['value']}:undefined;return db[_0x161ff5]['findAll']({'where':_0x594dd6,'raw':!![]})[_0x0267('0x23')](function(_0xc77f56){_0x247548[_0x0267('0x77')]=_['map'](_0xc77f56,'id');_0x572d3e(_0x247548);})[_0x0267('0x44')](function(_0x121318){_0x103b99(_0x121318);});}else{_0x572d3e(null);}});}function getAllFilteredResources(_0x17cb98,_0x4f3810){return new BPromise(function(_0x12fe04,_0x47f075){var _0x402cb2=_0x17cb98[_0x0267('0x3c')]?{[_0x17cb98[_0x0267('0x3c')][_0x0267('0x74')]]:_0x17cb98[_0x0267('0x3c')][_0x0267('0x82')]}:undefined;return db[_0x17cb98[_0x0267('0x33')]][_0x0267('0x42')]({'where':_0x402cb2,'raw':!![]})[_0x0267('0x23')](function(_0x110f27){_0x4f3810['associatedResources']=_[_0x0267('0x2a')](_0x110f27,function(_0x4dc784){return _0x4dc784[_0x0267('0x27')];});_0x12fe04(_0x4f3810);})['catch'](function(_0x11b9b9){_0x47f075(_0x11b9b9);});});}function getAllowedResources(_0x241a0f,_0xefa26b,_0x1f03a7){return new BPromise(function(_0x35db73,_0x2b1246){if(_0xefa26b){return db['UserProfileResource'][_0x0267('0x42')]({'where':{'sectionId':_0xefa26b['id']},'raw':!![]})[_0x0267('0x23')](function(_0x584d0e){if(_0x241a0f['field']&&_0x241a0f[_0x0267('0x74')]!=='id'){_0xefa26b[_0x0267('0x77')]=_[_0x0267('0x2a')](_0x584d0e,function(_0x446614){return _0x446614[_0x241a0f[_0x0267('0x74')]];});}else{if(_0x1f03a7===_0x0267('0x75')){_0xefa26b[_0x0267('0x77')]=_[_0x0267('0x2a')](_0x584d0e,function(_0x295b1d){return{'id':_0x295b1d[_0x0267('0x65')],'type':_0x295b1d[_0x0267('0x2d')]};});}else{_0xefa26b[_0x0267('0x77')]=_[_0x0267('0x2a')](_0x584d0e,function(_0x3eafe6){return _0x3eafe6[_0x0267('0x65')];});}}_0x35db73(_0xefa26b);})['catch'](function(_0x425dbf){_0x2b1246(_0x425dbf);});}else{_0x35db73(null);}});}function getQueryModels(_0x415b9a,_0x16518e){var _0x29d55e=_0x415b9a[_0x0267('0x83')]();var _0x2b9030={'childModel':undefined,'parentSections':[]};switch(_0x29d55e){case _0x0267('0x84'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0x85');break;case'odbc':_0x2b9030[_0x0267('0x6e')]=_0x0267('0x86');break;case _0x0267('0x87'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0x88');_0x2b9030[_0x0267('0x71')]=[{'name':_0x0267('0x89'),'field':'name','foreignKey':'projectName'}];break;case _0x0267('0x8a'):_0x2b9030['childModel']='JscriptyProject';break;case _0x0267('0x8b'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0x7d');_0x2b9030[_0x0267('0x71')]=[{'name':_0x0267('0x8c'),'field':'id','foreignKey':_0x0267('0x8d')}];break;case _0x0267('0x8e'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0x8f');break;case _0x0267('0x90'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0x91');break;case'globalcustomfields':_0x2b9030[_0x0267('0x6e')]=_0x0267('0x92');break;case _0x0267('0x93'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0x94');break;case'chatwebsites':_0x2b9030[_0x0267('0x6e')]='ChatWebsite';break;case'faxqueues':_0x2b9030[_0x0267('0x6e')]=_0x0267('0x95');break;case _0x0267('0x96'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0x97');break;case'inboundroutes':case _0x0267('0x98'):case _0x0267('0x99'):_0x2b9030['childModel']='VoiceExtension';break;case'contexts':_0x2b9030[_0x0267('0x6e')]=_0x0267('0x9a');break;case _0x0267('0x9b'):_0x2b9030['childModel']=_0x0267('0x9c');break;case'voicerecordings':_0x2b9030[_0x0267('0x6e')]='VoiceRecording';_0x2b9030[_0x0267('0x71')]=[{'name':_0x0267('0x9d'),'field':_0x0267('0x27'),'foreignKey':_0x0267('0x9e'),'model':_0x0267('0x9f'),'filter':{'field':_0x0267('0xa0'),'value':[_0x0267('0xa1')]}},{'name':'Telephones','field':_0x0267('0x27'),'foreignKey':_0x0267('0x9e'),'model':'User','filter':{'field':_0x0267('0xa0'),'value':['telephone']}},{'name':_0x0267('0xa2'),'field':_0x0267('0x27'),'foreignKey':_0x0267('0xa3'),'model':_0x0267('0xa4'),'filter':{'field':'type','value':['inbound']}},{'name':'QueueCampaigns','field':_0x0267('0x27'),'foreignKey':_0x0267('0xa3'),'model':'VoiceQueue','filter':{'field':_0x0267('0x2d'),'value':[_0x0267('0xa5')]}}];break;case _0x0267('0xa6'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xa7');break;case'chanspies':_0x2b9030[_0x0267('0x6e')]=_0x0267('0xa8');break;case _0x0267('0xa9'):_0x2b9030['childModel']=_0x0267('0xaa');break;case _0x0267('0xab'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xac');break;case'mailqueues':_0x2b9030[_0x0267('0x6e')]=_0x0267('0xad');break;case _0x0267('0xae'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xaf');break;case _0x0267('0xb0'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xb1');break;case _0x0267('0xb2'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xb3');break;case'openchannelaccounts':_0x2b9030[_0x0267('0x6e')]=_0x0267('0xb4');break;case _0x0267('0xb5'):_0x2b9030[_0x0267('0x6e')]='SmsQueue';break;case _0x0267('0xb6'):_0x2b9030[_0x0267('0x6e')]='SmsAccount';break;case _0x0267('0xb7'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xb8');break;case _0x0267('0xb9'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xba');break;case _0x0267('0xbb'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xbc');break;case _0x0267('0xbd'):case _0x0267('0xbe'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xa4');if(_0x16518e){_0x2b9030[_0x0267('0x71')]=[{'name':_0x0267('0xa2')},{'name':_0x0267('0xbf')}];}break;case _0x0267('0xc0'):case'agents':case _0x0267('0xc1'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0x9f');if(_0x16518e){_0x2b9030['parentSections']=[{'name':_0x0267('0xc2'),'filter':{'field':'role','value':[_0x0267('0xc3'),'user']},'ignore':!![]},{'name':_0x0267('0x9d')},{'name':_0x0267('0xc4')}];}break;case _0x0267('0xc5'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xc6');break;case'salesforceaccounts':_0x2b9030[_0x0267('0x6e')]=_0x0267('0xc7');break;case'freshdeskaccounts':_0x2b9030[_0x0267('0x6e')]=_0x0267('0xc8');break;case _0x0267('0xc9'):_0x2b9030['childModel']=_0x0267('0xca');break;case'deskaccounts':_0x2b9030[_0x0267('0x6e')]=_0x0267('0xcb');break;case _0x0267('0xcc'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xcd');break;case _0x0267('0xce'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0x9f');break;case _0x0267('0xcf'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xd0');break;case'dispositions':_0x2b9030[_0x0267('0x6e')]='Disposition';break;case _0x0267('0xd1'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0x63');break;case _0x0267('0xd2'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xd3');break;case'pauses':_0x2b9030['childModel']=_0x0267('0xd4');break;case'scheduler':_0x2b9030['childModel']=_0x0267('0xd5');break;case'sounds':_0x2b9030['childModel']=_0x0267('0xd6');break;case _0x0267('0xd7'):_0x2b9030['childModel']=_0x0267('0x7e');break;case _0x0267('0xd8'):_0x2b9030['childModel']=_0x0267('0xd9');break;case _0x0267('0xda'):_0x2b9030['childModel']='Trigger';break;case _0x0267('0xdb'):_0x2b9030[_0x0267('0x6e')]='Trunk';break;case _0x0267('0xdc'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xdd');break;case'plugins':_0x2b9030[_0x0267('0x6e')]=_0x0267('0x66');break;case _0x0267('0xde'):_0x2b9030['childModel']='AnalyticExtractedReport';_0x2b9030[_0x0267('0x71')]=[{'name':'Reports','field':'id','foreignKey':_0x0267('0x7a')}];break;case _0x0267('0xdf'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xe0');break;case _0x0267('0xb9'):_0x2b9030[_0x0267('0x6e')]=_0x0267('0xba');break;default:return _0x2b9030;}return _0x2b9030;} \ No newline at end of file +var _0x611f=['vtigeraccounts','cannedanswers','CannedAnswer','customdashboards','intervals','Pause','scheduler','sounds','Sound','templates','Template','triggers','Trigger','trunks','plugins','Reports','metrics','AnalyticMetric','WhatsappAccount','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfile','findAll','rows','catch','show','params','includeAll','create','body','clone','include','get','omit','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','createdAt','userProfileId','Resources','find','addSections','each','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','Dashboard','forEach','resourceId','Plugin','addResources','removeResources','getResources','section','undefined','Unknown\x20section','mergeResources','childModel','Sequelize','ValidationError','Invalid\x20section\x20\x27','parentSections','findOne','all','union','field','AnalyticExtractedReport','foreignKey','associatedResources','default','DefaultReports','reportId','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','voicequeues','telephones','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount'];(function(_0x2f121d,_0x19969f){var _0x5dae6f=function(_0xa2ece8){while(--_0xa2ece8){_0x2f121d['push'](_0x2f121d['shift']());}};_0x5dae6f(++_0x19969f);}(_0x611f,0xff));var _0xf611=function(_0x21bfaf,_0x32fd3e){_0x21bfaf=_0x21bfaf-0x0;var _0x1f2eef=_0x611f[_0x21bfaf];return _0x1f2eef;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf611('0x0'));var rimraf=require(_0xf611('0x1'));var zipdir=require(_0xf611('0x2'));var jsonpatch=require(_0xf611('0x3'));var rp=require('request-promise');var moment=require(_0xf611('0x4'));var BPromise=require(_0xf611('0x5'));var Mustache=require(_0xf611('0x6'));var util=require(_0xf611('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf611('0x8'));var ejs=require(_0xf611('0x9'));var fs=require('fs');var _=require(_0xf611('0xa'));var squel=require('squel');var crypto=require(_0xf611('0xb'));var jsforce=require(_0xf611('0xc'));var deskjs=require(_0xf611('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf611('0xe'));var Papa=require(_0xf611('0xf'));var Redis=require('ioredis');var authService=require(_0xf611('0x10'));var qs=require(_0xf611('0x11'));var as=require(_0xf611('0x12'));var hardwareService=require(_0xf611('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf611('0x14'));var config=require('../../config/environment');var db=require(_0xf611('0x15'))['db'];config[_0xf611('0x16')]=_[_0xf611('0x17')](config[_0xf611('0x16')],{'host':_0xf611('0x18'),'port':0x18eb});var socket=require(_0xf611('0x19'))(new Redis(config[_0xf611('0x16')]));require('./userProfile.socket')[_0xf611('0x1a')](socket);function respondWithStatusCode(_0xbca647,_0x858dda){_0x858dda=_0x858dda||0xcc;return function(_0x72a566){if(_0x72a566){return _0xbca647[_0xf611('0x1b')](_0x858dda);}return _0xbca647[_0xf611('0x1c')](_0x858dda)[_0xf611('0x1d')]();};}function respondWithResult(_0x36e14c,_0x40853f){_0x40853f=_0x40853f||0xc8;return function(_0x55a92a){if(_0x55a92a){return _0x36e14c[_0xf611('0x1c')](_0x40853f)[_0xf611('0x1e')](_0x55a92a);}};}function respondWithFilteredResult(_0x49bd08,_0x3ea15a){return function(_0x255044){if(_0x255044){var _0x1ce76b=_0x255044[_0xf611('0x1f')],_0x1146d4=_0x3ea15a[_0xf611('0x20')],_0x229fc2=_0x3ea15a[_0xf611('0x20')]+_0x3ea15a[_0xf611('0x21')],_0x5db45e;if(_0x229fc2>=_0x1ce76b){_0x229fc2=_0x1ce76b;_0x5db45e=0xc8;}else{_0x5db45e=0xce;}_0x49bd08[_0xf611('0x1c')](_0x5db45e);return _0x49bd08['set'](_0xf611('0x22'),_0x1146d4+'-'+_0x229fc2+'/'+_0x1ce76b)[_0xf611('0x1e')](_0x255044);}return null;};}function patchUpdates(_0x3cdad9){return function(_0x2db338){try{jsonpatch[_0xf611('0x23')](_0x2db338,_0x3cdad9,!![]);}catch(_0x368e09){return BPromise[_0xf611('0x24')](_0x368e09);}return _0x2db338[_0xf611('0x25')]();};}function saveUpdates(_0x4cdba1,_0x2fd47){return function(_0x2486ad){if(_0x2486ad){return _0x2486ad[_0xf611('0x26')](_0x4cdba1)[_0xf611('0x27')](function(_0x487b4e){return _0x487b4e;});}return null;};}function removeEntity(_0xd76ac6,_0x39ab0c){return function(_0x49aa44){if(_0x49aa44){return _0x49aa44[_0xf611('0x28')]()[_0xf611('0x27')](function(){_0xd76ac6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18396f,_0x3b3dba){return function(_0x5c40b9){if(!_0x5c40b9){_0x18396f[_0xf611('0x1b')](0x194);}return _0x5c40b9;};}function handleError(_0x41b58d,_0xc22f3a){_0xc22f3a=_0xc22f3a||0x1f4;return function(_0x103a53){logger[_0xf611('0x29')](_0x103a53[_0xf611('0x2a')]);if(_0x103a53[_0xf611('0x2b')]){delete _0x103a53[_0xf611('0x2b')];}_0x41b58d['status'](_0xc22f3a)[_0xf611('0x2c')](_0x103a53);};}exports[_0xf611('0x2d')]=function(_0x4b7da0,_0x172c23){var _0x29f4fd={},_0x400214={},_0x24bf30={'count':0x0,'rows':[]};var _0x38eb1c=_[_0xf611('0x2e')](db['UserProfile'][_0xf611('0x2f')],function(_0xb52699){return{'name':_0xb52699[_0xf611('0x30')],'type':_0xb52699[_0xf611('0x31')][_0xf611('0x32')]};});_0x400214[_0xf611('0x33')]=_[_0xf611('0x2e')](_0x38eb1c,_0xf611('0x2b'));_0x400214[_0xf611('0x34')]=_[_0xf611('0x35')](_0x4b7da0[_0xf611('0x34')]);_0x400214[_0xf611('0x36')]=_[_0xf611('0x37')](_0x400214[_0xf611('0x33')],_0x400214['query']);_0x29f4fd[_0xf611('0x38')]=_[_0xf611('0x37')](_0x400214[_0xf611('0x33')],qs[_0xf611('0x39')](_0x4b7da0[_0xf611('0x34')]['fields']));_0x29f4fd[_0xf611('0x38')]=_0x29f4fd['attributes'][_0xf611('0x3a')]?_0x29f4fd['attributes']:_0x400214[_0xf611('0x33')];if(!_0x4b7da0['query'][_0xf611('0x3b')](_0xf611('0x3c'))){_0x29f4fd[_0xf611('0x21')]=qs['limit'](_0x4b7da0['query']['limit']);_0x29f4fd['offset']=qs[_0xf611('0x20')](_0x4b7da0[_0xf611('0x34')]['offset']);}_0x29f4fd[_0xf611('0x3d')]=qs[_0xf611('0x3e')](_0x4b7da0[_0xf611('0x34')][_0xf611('0x3e')]);_0x29f4fd[_0xf611('0x3f')]=qs['filters'](_[_0xf611('0x40')](_0x4b7da0[_0xf611('0x34')],_0x400214[_0xf611('0x36')]),_0x38eb1c);if(_0x4b7da0[_0xf611('0x34')][_0xf611('0x41')]){_0x29f4fd[_0xf611('0x3f')]=_[_0xf611('0x42')](_0x29f4fd[_0xf611('0x3f')],{'$or':_[_0xf611('0x2e')](_0x38eb1c,function(_0x21e138){if(_0x21e138[_0xf611('0x31')]!==_0xf611('0x43')){var _0x5d0706={};_0x5d0706[_0x21e138[_0xf611('0x2b')]]={'$like':'%'+_0x4b7da0['query'][_0xf611('0x41')]+'%'};return _0x5d0706;}})});}_0x29f4fd=_[_0xf611('0x42')]({},_0x29f4fd,_0x4b7da0[_0xf611('0x44')]);var _0x576f63={'where':_0x29f4fd[_0xf611('0x3f')]};return db['UserProfile']['count'](_0x576f63)['then'](function(_0x650f17){_0x24bf30[_0xf611('0x1f')]=_0x650f17;if(_0x4b7da0[_0xf611('0x34')]['includeAll']){_0x29f4fd['include']=[{'all':!![]}];}return db[_0xf611('0x45')][_0xf611('0x46')](_0x29f4fd);})[_0xf611('0x27')](function(_0x4440b9){_0x24bf30[_0xf611('0x47')]=_0x4440b9;return _0x24bf30;})[_0xf611('0x27')](respondWithFilteredResult(_0x172c23,_0x29f4fd))[_0xf611('0x48')](handleError(_0x172c23,null));};exports[_0xf611('0x49')]=function(_0x5314b6,_0x565dd4){var _0x2d3896={'raw':![],'where':{'id':_0x5314b6[_0xf611('0x4a')]['id']}},_0x5c9616={};_0x5c9616[_0xf611('0x33')]=_[_0xf611('0x35')](db[_0xf611('0x45')][_0xf611('0x2f')]);_0x5c9616['query']=_[_0xf611('0x35')](_0x5314b6[_0xf611('0x34')]);_0x5c9616[_0xf611('0x36')]=_[_0xf611('0x37')](_0x5c9616[_0xf611('0x33')],_0x5c9616[_0xf611('0x34')]);_0x2d3896[_0xf611('0x38')]=_[_0xf611('0x37')](_0x5c9616['model'],qs[_0xf611('0x39')](_0x5314b6[_0xf611('0x34')][_0xf611('0x39')]));_0x2d3896[_0xf611('0x38')]=_0x2d3896[_0xf611('0x38')][_0xf611('0x3a')]?_0x2d3896['attributes']:_0x5c9616['model'];if(_0x5314b6[_0xf611('0x34')][_0xf611('0x4b')]){_0x2d3896['include']=[{'all':!![]}];}_0x2d3896=_[_0xf611('0x42')]({},_0x2d3896,_0x5314b6[_0xf611('0x44')]);return db[_0xf611('0x45')]['find'](_0x2d3896)[_0xf611('0x27')](handleEntityNotFound(_0x565dd4,null))[_0xf611('0x27')](respondWithResult(_0x565dd4,null))[_0xf611('0x48')](handleError(_0x565dd4,null));};exports[_0xf611('0x4c')]=function(_0x1dd6b3,_0x4c3564){return db[_0xf611('0x45')][_0xf611('0x4c')](_0x1dd6b3[_0xf611('0x4d')],{})['then'](respondWithResult(_0x4c3564,0xc9))[_0xf611('0x48')](handleError(_0x4c3564,null));};exports[_0xf611('0x4e')]=function(_0x3b4ab1,_0x11d86f){var _0xef0a6a={'where':{'id':_0x3b4ab1['params']['id']}},_0x237112={};_0x237112[_0xf611('0x33')]=_[_0xf611('0x35')](db[_0xf611('0x45')]['rawAttributes']);_0xef0a6a[_0xf611('0x38')]=_['intersection'](_0x237112['model'],qs[_0xf611('0x39')](_0x3b4ab1[_0xf611('0x34')][_0xf611('0x39')]));_0xef0a6a['attributes']=_0xef0a6a['attributes'][_0xf611('0x3a')]?_0xef0a6a[_0xf611('0x38')]:_0x237112['model'];if(_0x3b4ab1[_0xf611('0x34')][_0xf611('0x4b')]){_0xef0a6a[_0xf611('0x4f')]=[{'all':!![]}];}_0xef0a6a=_[_0xf611('0x42')]({},_0xef0a6a,_0x3b4ab1['options']);return db[_0xf611('0x45')]['find'](_0xef0a6a)[_0xf611('0x27')](handleEntityNotFound(_0x11d86f,null))[_0xf611('0x27')](function(_0x3dc403){if(_0x3dc403){var _0x16b21a=_0x3dc403[_0xf611('0x50')]({'plain':!![]});_0x16b21a=qs[_0xf611('0x51')](_0x16b21a,['id','createdAt',_0xf611('0x52'),_0xf611('0x53')]);_0x3b4ab1['body']=_[_0xf611('0x51')](_0x3b4ab1[_0xf611('0x4d')],['id','createdAt',_0xf611('0x52')]);return db[_0xf611('0x54')][_0xf611('0x55')](function(_0x46b2cf){return db[_0xf611('0x45')][_0xf611('0x4c')](_[_0xf611('0x42')](_0x16b21a,_0x3b4ab1[_0xf611('0x4d')]),{'include':_0x3b4ab1[_0xf611('0x34')][_0xf611('0x4b')]?[{'all':!![]}]:undefined,'transaction':_0x46b2cf})[_0xf611('0x27')](function(_0x43b286){var _0x454f2f=_0x43b286[_0xf611('0x50')]({'plain':!![]});return db[_0xf611('0x56')][_0xf611('0x46')]({'where':{'userProfileId':_0x3b4ab1['params']['id']},'raw':!![]})[_0xf611('0x27')](function(_0x3af839){if(_0x3af839){return BPromise['each'](_0x3af839,function(_0x1bbdda){return new BPromise(function(_0x4a0301,_0x1d9a0a){if(_0x1bbdda[_0xf611('0x57')]===null||_0x1bbdda[_0xf611('0x57')]===0x1)_0x4a0301(null);return db[_0xf611('0x58')][_0xf611('0x46')]({'where':{'sectionId':_0x1bbdda['id']},'raw':!![]})[_0xf611('0x27')](function(_0x82ce38){var _0x28f990=_[_0xf611('0x2e')](_0x82ce38,function(_0xd21ed0){return qs[_0xf611('0x51')](_0xd21ed0,['id','createdAt',_0xf611('0x52'),_0xf611('0x59')]);});_0x4a0301(_0x28f990);})[_0xf611('0x48')](function(_0x173a83){_0x1d9a0a(_0x173a83);});})[_0xf611('0x27')](function(_0x4f7774){var _0x26d251=qs[_0xf611('0x51')](_0x1bbdda,['id',_0xf611('0x5a'),'updatedAt']);_0x26d251[_0xf611('0x5b')]=_0x454f2f['id'];if(_0x4f7774)_0x26d251[_0xf611('0x5c')]=_0x4f7774;return _0x26d251;})[_0xf611('0x27')](function(_0x3e12d0){return db['UserProfileSection']['create'](_0x3e12d0,{'include':[{'model':db['UserProfileResource'],'as':_0xf611('0x5c')}],'raw':!![],'transaction':_0x46b2cf});});})['then'](function(){return _0x454f2f;});}});});});}})[_0xf611('0x27')](respondWithResult(_0x11d86f,0xc9))[_0xf611('0x48')](handleError(_0x11d86f,null));};exports[_0xf611('0x26')]=function(_0x5ec3d4,_0x2daf72){if(_0x5ec3d4[_0xf611('0x4d')]['id']){delete _0x5ec3d4[_0xf611('0x4d')]['id'];}return db['UserProfile'][_0xf611('0x5d')]({'where':{'id':_0x5ec3d4[_0xf611('0x4a')]['id']}})[_0xf611('0x27')](handleEntityNotFound(_0x2daf72,null))[_0xf611('0x27')](saveUpdates(_0x5ec3d4[_0xf611('0x4d')],null))[_0xf611('0x27')](respondWithResult(_0x2daf72,null))[_0xf611('0x48')](handleError(_0x2daf72,null));};exports['destroy']=function(_0x3812db,_0x175e5d){return db[_0xf611('0x45')][_0xf611('0x5d')]({'where':{'id':_0x3812db[_0xf611('0x4a')]['id']}})[_0xf611('0x27')](handleEntityNotFound(_0x175e5d,null))[_0xf611('0x27')](removeEntity(_0x175e5d,null))['catch'](handleError(_0x175e5d,null));};exports['describe']=function(_0x5d6faa,_0x2a4c1c){return db['UserProfile']['describe']()['then'](respondWithResult(_0x2a4c1c,null))[_0xf611('0x48')](handleError(_0x2a4c1c,null));};exports[_0xf611('0x5e')]=function(_0x4b2b52,_0xe17982){var _0x39b351=_0x4b2b52[_0xf611('0x4d')];return db[_0xf611('0x45')][_0xf611('0x5d')]({'where':{'id':_0x4b2b52['params']['id']}})['then'](handleEntityNotFound(_0xe17982,null))[_0xf611('0x27')](function(_0x11cac0){if(_0x11cac0){return db[_0xf611('0x54')][_0xf611('0x55')](function(_0x439887){return db[_0xf611('0x56')]['destroy']({'where':{'userProfileId':_0x4b2b52[_0xf611('0x4a')]['id'],'sectionId':_['map'](_0x39b351,function(_0x133c2a){return _0x133c2a[_0xf611('0x59')];})},'transaction':_0x439887})[_0xf611('0x27')](function(){var _0x732842=_[_0xf611('0x2e')](_0x39b351,function(_0x295b13){_0x295b13[_0xf611('0x5b')]=_0x4b2b52[_0xf611('0x4a')]['id'];return _0x295b13;});var _0x23d118=[];return BPromise[_0xf611('0x5f')](_0x732842,function(_0x7414a2){return db['UserProfileSection'][_0xf611('0x4c')](_0x7414a2,{'include':[{'model':db['UserProfileResource'],'as':_0xf611('0x5c')}],'raw':!![],'transaction':_0x439887})['then'](function(_0xcb261e){_0x23d118[_0xf611('0x60')](_0xcb261e[_0xf611('0x50')]({'plain':!![]}));});})[_0xf611('0x27')](function(){return _0x23d118;});});});}})[_0xf611('0x27')](function(_0x5410c1){return _0x5410c1;})[_0xf611('0x27')](respondWithResult(_0xe17982,null))['catch'](handleError(_0xe17982,null));};exports[_0xf611('0x61')]=function(_0x3e8e4c,_0x164547){var _0x5ef962;return db[_0xf611('0x45')][_0xf611('0x5d')]({'where':{'id':_0x3e8e4c['params']['id']},'attributes':['id',_0xf611('0x2b')]})[_0xf611('0x27')](handleEntityNotFound(_0x164547,null))['then'](function(_0xa0a665){if(_0xa0a665){_0x5ef962=_0xa0a665;return db[_0xf611('0x56')][_0xf611('0x28')]({'where':{'userProfileId':_0x3e8e4c[_0xf611('0x4a')]['id'],'sectionId':_0x3e8e4c[_0xf611('0x34')][_0xf611('0x62')]}});}})['then'](function(){return _0x5ef962;})[_0xf611('0x27')](respondWithStatusCode(_0x164547,null))[_0xf611('0x48')](handleError(_0x164547,null));};exports[_0xf611('0x63')]=function(_0x33bac5,_0x1f4507){var _0x1ced65=[];var _0x5b9eb7=[];return db[_0xf611('0x56')]['findAll']({'where':{'userProfileId':_0x33bac5[_0xf611('0x4a')]['id']},'raw':!![]})[_0xf611('0x27')](function(_0x45089b){_0x1ced65=_['filter'](_0x45089b,function(_0x407eff){return _0x407eff[_0xf611('0x64')]===0x1||_['includes']([0x3eb,0x709],_0x407eff[_0xf611('0x59')]);});if(!_[_0xf611('0x65')](_0x1ced65)){return _[_0xf611('0x2e')](_0x1ced65,function(_0x3fee9b){return _0x3fee9b[_0xf611('0x59')];});}else{return;}})['then'](function(_0x6e7fc3){if(_0x6e7fc3)_0x5b9eb7=_0x6e7fc3;if(_[_0xf611('0x66')](_0x5b9eb7,0x64)){var _0x3bacc2=_[_0xf611('0x5d')](_0x1ced65,{'sectionId':0x64});return hasDefaultDashboard(_0x3bacc2)[_0xf611('0x27')](function(_0x42da75){return _[_0xf611('0x2e')](_0x1ced65,function(_0x567418){if(_0x567418['sectionId']===0x64){_0x567418[_0xf611('0x67')]=_0x42da75;}return _0x567418;});});}else{return;}})[_0xf611('0x27')](function(_0x30856d){if(_0x30856d)_0x1ced65=_0x30856d;if(_[_0xf611('0x66')](_0x5b9eb7,0x3eb)){var _0x2e3ffb=_[_0xf611('0x5d')](_0x1ced65,{'sectionId':0x3eb});return getCustomDashboards(_0x2e3ffb)['then'](function(_0x2ff506){return _['map'](_0x1ced65,function(_0x131705){if(_0x2e3ffb[_0xf611('0x64')]){if(_0x131705[_0xf611('0x59')]===0x3eb){_0x131705[_0xf611('0x67')]=_0x2ff506;}}else{if(_0x131705[_0xf611('0x59')]===0x64){_0x131705[_0xf611('0x67')]=_0x2ff506;}}return _0x131705;});});}else{return;}})[_0xf611('0x27')](function(_0x372216){if(_0x372216)_0x1ced65=_0x372216;if(_[_0xf611('0x66')](_0x5b9eb7,0x709)){var _0x34348f=_[_0xf611('0x5d')](_0x1ced65,{'sectionId':0x709});return getPlugins(_0x34348f)[_0xf611('0x27')](function(_0x5d4cd7){if(_0x34348f[_0xf611('0x64')]){return _[_0xf611('0x2e')](_0x1ced65,function(_0x1267ab){if(_0x1267ab[_0xf611('0x59')]===0x709){_0x1267ab[_0xf611('0x67')]=_0x5d4cd7;}return _0x1267ab;});}else{var _0x3c32c4={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5d4cd7};var _0xacd514=_[_0xf611('0x2e')](_0x1ced65);_0xacd514['push'](_0x3c32c4);return _0xacd514;}});}else{return;}})[_0xf611('0x27')](function(_0x358941){if(_0x358941)_0x1ced65=_0x358941;return _[_0xf611('0x41')](_0x1ced65,['enabled',0x1]);})['then'](respondWithResult(_0x1f4507,null))[_0xf611('0x48')](handleError(_0x1f4507,null));};function hasDefaultDashboard(_0x4b86ef){var _0x4729b9=[0x65];return new BPromise(function(_0x4a45c2,_0xa04b99){try{if(_0x4b86ef[_0xf611('0x57')]){_0x4a45c2(_0x4729b9);}else{return db[_0xf611('0x58')]['findOne']({'where':{'sectionId':_0x4b86ef['id']},'raw':!![]})['then'](function(_0x336e0f){_0x336e0f?_0x4a45c2(_0x4729b9):_0x4a45c2();});}}catch(_0xf34d9a){_0xa04b99(_0xf34d9a);}});}function getCustomDashboards(_0x297009){var _0x354539=[];return new BPromise(function(_0x510159,_0x2f2a01){try{if(_0x297009[_0xf611('0x57')]){return db[_0xf611('0x68')][_0xf611('0x46')]({'raw':!![]})['then'](function(_0x464df3){_0x464df3[_0xf611('0x69')](function(_0x466f1a){_0x354539['push'](_0x466f1a['id']+0x1869f);});_0x510159(_0x354539);});}else{return db[_0xf611('0x58')]['findAll']({'where':{'sectionId':_0x297009['id']},'raw':!![]})[_0xf611('0x27')](function(_0x3d9636){_0x3d9636[_0xf611('0x69')](function(_0x44fe21){_0x354539['push'](_0x44fe21[_0xf611('0x6a')]+0x1869f);});_0x510159(_0x354539);});}}catch(_0x395aef){_0x2f2a01(_0x395aef);}});}function getPlugins(_0x1146be){var _0x3b0f6e=[];return new BPromise(function(_0x486979,_0x2bb62e){try{if(_0x1146be[_0xf611('0x57')]){return db[_0xf611('0x6b')][_0xf611('0x46')]({'raw':!![]})[_0xf611('0x27')](function(_0x3a7259){_0x3a7259[_0xf611('0x69')](function(_0x2bd964){_0x3b0f6e[_0xf611('0x60')](_0x2bd964['id']+0x15b38);});_0x486979(_0x3b0f6e);});}else{return db[_0xf611('0x58')][_0xf611('0x46')]({'where':{'sectionId':_0x1146be['id']},'raw':!![]})[_0xf611('0x27')](function(_0x16b170){_0x16b170[_0xf611('0x69')](function(_0x5316e7){_0x3b0f6e[_0xf611('0x60')](_0x5316e7[_0xf611('0x6a')]+0x15b38);});_0x486979(_0x3b0f6e);});}}catch(_0x218ad0){_0x2bb62e(_0x218ad0);}});}exports[_0xf611('0x6c')]=function(_0xd6dfd0,_0x341abf){return db[_0xf611('0x45')][_0xf611('0x5d')]({'where':{'id':_0xd6dfd0[_0xf611('0x4a')]['id']}})[_0xf611('0x27')](handleEntityNotFound(_0x341abf,null))[_0xf611('0x27')](function(_0x307901){if(_0x307901){return db[_0xf611('0x54')][_0xf611('0x55')](function(_0x2fc6f0){return db[_0xf611('0x56')]['findAll']({'where':{'userProfileId':_0xd6dfd0[_0xf611('0x4a')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x2a7990){if(_0x2a7990){return db['UserProfileSection'][_0xf611('0x28')]({'where':{'userProfileId':_0xd6dfd0['params']['id'],'id':_[_0xf611('0x2e')](_0x2a7990,function(_0x32169d){return _0x32169d['id'];})},'transaction':_0x2fc6f0});}})[_0xf611('0x27')](function(_0x1c5123){var _0x1eba56=_[_0xf611('0x2e')](_0xd6dfd0[_0xf611('0x4d')],function(_0x132822){_0x132822[_0xf611('0x5b')]=_0xd6dfd0[_0xf611('0x4a')]['id'];return _0x132822;});return db[_0xf611('0x56')]['bulkCreate'](_0x1eba56,{'raw':!![],'transaction':_0x2fc6f0});})[_0xf611('0x27')](function(_0x5963a6){var _0x31edc1=_['filter'](_['map'](_0x5963a6,function(_0x222034){return _0x222034[_0xf611('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x31edc1){return db[_0xf611('0x56')][_0xf611('0x46')]({'where':{'userProfileId':_0xd6dfd0[_0xf611('0x4a')]['id'],'sectionId':_[_0xf611('0x2e')](_0x31edc1,function(_0x148097){return _0x148097[_0xf611('0x59')];})},'attributes':['id',_0xf611('0x59')],'raw':!![]})[_0xf611('0x27')](function(_0x317474){var _0x40f667=_['map'](_0xd6dfd0[_0xf611('0x4d')],function(_0x527dc4){_0x527dc4[_0xf611('0x5b')]=_0xd6dfd0[_0xf611('0x4a')]['id'];return _0x527dc4;});return db[_0xf611('0x58')]['bulkCreate'](_0x40f667,{'raw':!![],'transaction':_0x2fc6f0});});}})['catch'](handleError(_0x341abf,null));});}})[_0xf611('0x27')](function(_0x1e9ba2){var _0x3715c5=_[_0xf611('0x2e')](_0x1e9ba2,function(_0x3a86e5){return _0x3a86e5[_0xf611('0x50')]({'plain':!![]});});})[_0xf611('0x27')](respondWithResult(_0x341abf,null))['catch'](handleError(_0x341abf,null));};exports[_0xf611('0x6d')]=function(_0x460462,_0x401009,_0x5bf4d5){return db[_0xf611('0x45')][_0xf611('0x5d')]({'where':{'id':_0x460462['params']['id']}})['then'](handleEntityNotFound(_0x401009,null))[_0xf611('0x27')](function(_0x487534){if(_0x487534){return _0x487534[_0xf611('0x6d')](_0x460462[_0xf611('0x34')][_0xf611('0x62')]);}})['then'](respondWithStatusCode(_0x401009,null))['catch'](handleError(_0x401009,null));};exports[_0xf611('0x6e')]=function(_0x4bb84d,_0x3179fa){var _0x1b3f0b={'raw':![],'where':{}};var _0x4e6549={};var _0x571b16={'count':0x0,'rows':[]};var _0x4e3be5=_0x4bb84d[_0xf611('0x34')][_0xf611('0x6f')];if(typeof _0x4e3be5===_0xf611('0x70')){throw new db['Sequelize']['ValidationError'](_0xf611('0x71'));}var _0xd73487=_0x4bb84d[_0xf611('0x34')][_0xf611('0x72')]||![];var _0x20e9f9=getQueryModels(_0x4e3be5,_0xd73487);if(typeof _0x20e9f9[_0xf611('0x73')]===_0xf611('0x70')){throw new db[(_0xf611('0x74'))][(_0xf611('0x75'))](_0xf611('0x76')+_0x4e3be5+'\x27');}var _0x5749ce=[];if(!_[_0xf611('0x65')](_0x20e9f9[_0xf611('0x77')])){_0x5749ce=_0x20e9f9['parentSections'];}else{_0x5749ce=[{'name':_0x4e3be5}];}return db['UserProfile'][_0xf611('0x78')]({'where':{'id':_0x4bb84d[_0xf611('0x4a')]['id']}})[_0xf611('0x27')](handleEntityNotFound(_0x3179fa,null))[_0xf611('0x27')](function(_0x190977){if(_0x190977){var _0x22767d=[];for(var _0x85a4a=0x0;_0x85a4a<_0x5749ce[_0xf611('0x3a')];_0x85a4a++){_0x22767d['push'](db[_0xf611('0x56')][_0xf611('0x78')]({'where':{'userProfileId':_0x190977['id'],'name':_0x5749ce[_0x85a4a]['name']},'raw':!![]}));}return BPromise[_0xf611('0x79')](_0x22767d);}})['then'](function(_0x281b5e){var _0x6d336a=_[_0xf611('0x41')](_0x281b5e,function(_0x270a45){return _0x270a45?_0x270a45:undefined;});var _0x2a1250=_['filter'](_0x5749ce,['ignore',!![]]);var _0x518a2f=_[_0xf611('0x65')](_0x6d336a)&&_[_0xf611('0x65')](_0x2a1250)?null:_[_0xf611('0x7a')](_0x2a1250,_0x6d336a);if(_0x518a2f){var _0x73cf6a=[];for(var _0x2a767f=0x0;_0x2a767f<_0x518a2f['length'];_0x2a767f++){var _0x115b2e=_[_0xf611('0x5d')](_0x5749ce,function(_0x277bc1){return _0x518a2f[_0x2a767f]?_0x277bc1[_0xf611('0x2b')]===_0x518a2f[_0x2a767f][_0xf611('0x2b')]:null;});if(_0x115b2e){if(_0x518a2f[_0x2a767f]['ignore']){_0x73cf6a[_0xf611('0x60')](getAllResources(_0x20e9f9[_0xf611('0x73')],_0x518a2f[_0x2a767f]));}else{if(!_0x518a2f[_0x2a767f]['autoAssociation']){_0x73cf6a['push'](getAllowedResources(_0x115b2e,_0x518a2f[_0x2a767f],_0x20e9f9[_0xf611('0x73')]));}else{if(_0x115b2e['model']){_0x73cf6a['push'](getAllFilteredResources(_0x115b2e,_0x518a2f[_0x2a767f]));}}}}}return BPromise[_0xf611('0x79')](_0x73cf6a);}else{return null;}})[_0xf611('0x27')](function(_0x318e58){var _0x3ce6d6=_0x318e58;var _0x37362f=null;if(_0x3ce6d6){_0x37362f=_0x3ce6d6[_0xf611('0x3a')]===0x1?_0x3ce6d6[0x0]:null;}if(_0x37362f||_0x3ce6d6){var _0x53825c=db[_0x20e9f9[_0xf611('0x73')]]['rawAttributes'];_0x4e6549[_0xf611('0x33')]=_['keys'](_0x53825c);_0x4e6549[_0xf611('0x34')]=_[_0xf611('0x35')](_0x4bb84d['query']);_0x4e6549[_0xf611('0x36')]=_[_0xf611('0x37')](_0x4e6549['model'],_0x4e6549[_0xf611('0x34')]);_0x1b3f0b['attributes']=_[_0xf611('0x37')](_0x4e6549[_0xf611('0x33')],qs['fields'](_0x4bb84d[_0xf611('0x34')][_0xf611('0x39')]));_0x1b3f0b[_0xf611('0x38')]=_0x1b3f0b['attributes'][_0xf611('0x3a')]?_0x1b3f0b[_0xf611('0x38')]:_0x4e6549[_0xf611('0x33')];if(!_0x4bb84d[_0xf611('0x34')][_0xf611('0x3b')](_0xf611('0x3c'))){_0x1b3f0b['limit']=qs[_0xf611('0x21')](_0x4bb84d[_0xf611('0x34')][_0xf611('0x21')]);_0x1b3f0b[_0xf611('0x20')]=qs['offset'](_0x4bb84d[_0xf611('0x34')][_0xf611('0x20')]);}_0x1b3f0b[_0xf611('0x3d')]=qs[_0xf611('0x3e')](_0x4bb84d[_0xf611('0x34')][_0xf611('0x3e')]);_0x1b3f0b['where']=qs[_0xf611('0x36')](_['pick'](_0x4bb84d[_0xf611('0x34')],_0x4e6549[_0xf611('0x36')]));if(_0x4bb84d[_0xf611('0x34')][_0xf611('0x41')]){_0x1b3f0b['where']=_[_0xf611('0x42')](_0x1b3f0b['where'],{'$or':_[_0xf611('0x2e')](_0x53825c,function(_0xa2a2e9){if(_0xa2a2e9['type'][_0xf611('0x32')]!==_0xf611('0x43')){var _0x31a541={};_0x31a541[_0xa2a2e9[_0xf611('0x7b')]]={'$like':'%'+_0x4bb84d[_0xf611('0x34')][_0xf611('0x41')]+'%'};return _0x31a541;}})});}var _0x12b8d5=[];if(_0x37362f){var _0x7556ed=_[_0xf611('0x5d')](_0x5749ce,[_0xf611('0x2b'),_0x37362f[_0xf611('0x2b')]]);if(_0x7556ed[_0xf611('0x7b')]){var _0x50fb23={};if(_0x20e9f9[_0xf611('0x73')]===_0xf611('0x7c')){_0x50fb23[_0x7556ed[_0xf611('0x7d')]]=_[_0xf611('0x2e')](_0x37362f[_0xf611('0x7e')],'id');}else{_0x50fb23[_0x7556ed[_0xf611('0x7d')]]=_0x37362f[_0xf611('0x7e')];}_0x12b8d5[_0xf611('0x60')](_0x50fb23);}else{_0x1b3f0b[_0xf611('0x3f')]['id']=_0x37362f[_0xf611('0x7e')];}}else{for(var _0x253f83=0x0;_0x253f83<_0x3ce6d6[_0xf611('0x3a')];_0x253f83++){var _0x7556ed=_[_0xf611('0x5d')](_0x5749ce,[_0xf611('0x2b'),_0x3ce6d6[_0x253f83][_0xf611('0x2b')]]);if(_0x7556ed['field']){var _0x50fb23={};_0x50fb23[_0x7556ed['foreignKey']]=_0x3ce6d6[_0x253f83][_0xf611('0x7e')];_0x12b8d5['push'](_0x50fb23);}else{if(!_0x1b3f0b['where']['id'])_0x1b3f0b[_0xf611('0x3f')]['id']=[];_0x3ce6d6[_0x253f83][_0xf611('0x7e')][_0xf611('0x69')](function(_0x53edc8){_0x1b3f0b[_0xf611('0x3f')]['id'][_0xf611('0x60')](_0x53edc8);});}}}if(!_['isEmpty'](_0x12b8d5)){_0x1b3f0b[_0xf611('0x3f')]=_[_0xf611('0x42')](_0x1b3f0b[_0xf611('0x3f')],{'$and':{'$or':_0x12b8d5}});}_0x1b3f0b=_['merge']({},_0x1b3f0b,_0x4bb84d[_0xf611('0x44')]);if(_0x37362f&&!_0x37362f['autoAssociation']&&_0x20e9f9[_0xf611('0x73')]===_0xf611('0x7c')){if(_0x4bb84d[_0xf611('0x34')][_0xf611('0x4b')]){_0x1b3f0b['include']=[{'all':!![]}];}return db[_0x20e9f9[_0xf611('0x73')]][_0xf611('0x46')](_0x1b3f0b)[_0xf611('0x27')](function(_0x3365fa){var _0x1bde94=[];_0x3365fa[_0xf611('0x69')](function(_0x49cfb0){var _0x2926bc;switch(_0x49cfb0['reportType']){case _0xf611('0x7f'):_0x2926bc=_[_0xf611('0x5d')](_0x37362f['associatedResources'],function(_0x4b00ae){return _0x4b00ae['id']===_0x49cfb0['reportId']&&_0x4b00ae[_0xf611('0x31')]===_0xf611('0x80');});break;case'custom':_0x2926bc=_[_0xf611('0x5d')](_0x37362f[_0xf611('0x7e')],function(_0x29e7b4){return _0x29e7b4['id']===_0x49cfb0[_0xf611('0x81')]&&_0x29e7b4[_0xf611('0x31')]===_0xf611('0x82');});break;}if(_0x2926bc)_0x1bde94[_0xf611('0x60')](_0x49cfb0);});_0x571b16[_0xf611('0x1f')]=_0x1bde94['length'];_0x571b16[_0xf611('0x47')]=_0x1bde94;return _0x571b16;});}else{return db[_0x20e9f9[_0xf611('0x73')]][_0xf611('0x1f')]({'where':_0x1b3f0b[_0xf611('0x3f')]})[_0xf611('0x27')](function(_0x21a5f8){_0x571b16[_0xf611('0x1f')]=_0x21a5f8;if(_0x4bb84d[_0xf611('0x34')][_0xf611('0x4b')]){if(_0x20e9f9[_0xf611('0x73')]===_0xf611('0x83')){_0x1b3f0b[_0xf611('0x4f')]=[{'model':db[_0xf611('0x84')],'as':_0xf611('0x85'),'attributes':['id',_0xf611('0x2b'),_0xf611('0x86')],'required':_0x4bb84d['query'][_0xf611('0x87')]?!![]:![]},{'model':db[_0xf611('0x84')],'as':_0xf611('0x88'),'attributes':['id',_0xf611('0x2b'),_0xf611('0x86')],'through':_0x4bb84d[_0xf611('0x34')]['tag']?{'attributes':[],'where':{'TagId':_0x4bb84d[_0xf611('0x34')]['tag']||undefined}}:{},'required':_0x4bb84d[_0xf611('0x34')]['tag']?!![]:![]}];}else{_0x1b3f0b[_0xf611('0x4f')]=[{'all':!![]}];}}return db[_0x20e9f9[_0xf611('0x73')]][_0xf611('0x46')](_0x1b3f0b);})['then'](function(_0x9792b){_0x571b16[_0xf611('0x47')]=_0x9792b;return _0x571b16;});}}else{return _0x571b16;}})[_0xf611('0x27')](respondWithFilteredResult(_0x3179fa,_0x1b3f0b))[_0xf611('0x48')](handleError(_0x3179fa,null));};function getAllResources(_0x16022e,_0x499d00){return new BPromise(function(_0x5a67e8,_0x46823f){if(_0x499d00){var _0x345f27=_0x499d00[_0xf611('0x41')]?{[_0x499d00[_0xf611('0x41')][_0xf611('0x7b')]]:_0x499d00[_0xf611('0x41')][_0xf611('0x89')]}:undefined;return db[_0x16022e]['findAll']({'where':_0x345f27,'raw':!![]})[_0xf611('0x27')](function(_0x518b89){_0x499d00[_0xf611('0x7e')]=_[_0xf611('0x2e')](_0x518b89,'id');_0x5a67e8(_0x499d00);})[_0xf611('0x48')](function(_0x1f3feb){_0x46823f(_0x1f3feb);});}else{_0x5a67e8(null);}});}function getAllFilteredResources(_0x4cf62f,_0x2b5b67){return new BPromise(function(_0xe387d1,_0x16a063){var _0x821f55=_0x4cf62f[_0xf611('0x41')]?{[_0x4cf62f['filter'][_0xf611('0x7b')]]:_0x4cf62f[_0xf611('0x41')]['value']}:undefined;return db[_0x4cf62f[_0xf611('0x33')]][_0xf611('0x46')]({'where':_0x821f55,'raw':!![]})[_0xf611('0x27')](function(_0x789ae8){_0x2b5b67[_0xf611('0x7e')]=_[_0xf611('0x2e')](_0x789ae8,function(_0x45d2ec){return _0x45d2ec[_0xf611('0x2b')];});_0xe387d1(_0x2b5b67);})['catch'](function(_0xba28bc){_0x16a063(_0xba28bc);});});}function getAllowedResources(_0x56ab88,_0x239c15,_0x4754eb){return new BPromise(function(_0x5b88e,_0x40094c){if(_0x239c15){return db['UserProfileResource'][_0xf611('0x46')]({'where':{'sectionId':_0x239c15['id']},'raw':!![]})['then'](function(_0x352e5e){if(_0x56ab88[_0xf611('0x7b')]&&_0x56ab88[_0xf611('0x7b')]!=='id'){_0x239c15[_0xf611('0x7e')]=_['map'](_0x352e5e,function(_0x114b00){return _0x114b00[_0x56ab88[_0xf611('0x7b')]];});}else{if(_0x4754eb===_0xf611('0x7c')){_0x239c15[_0xf611('0x7e')]=_['map'](_0x352e5e,function(_0x456736){return{'id':_0x456736['resourceId'],'type':_0x456736['type']};});}else{_0x239c15[_0xf611('0x7e')]=_[_0xf611('0x2e')](_0x352e5e,function(_0x5c95ea){return _0x5c95ea['resourceId'];});}}_0x5b88e(_0x239c15);})[_0xf611('0x48')](function(_0x242e4a){_0x40094c(_0x242e4a);});}else{_0x5b88e(null);}});}function getQueryModels(_0x1df263,_0x4b9095){var _0x2976ab=_0x1df263[_0xf611('0x8a')]();var _0x4e6a19={'childModel':undefined,'parentSections':[]};switch(_0x2976ab){case _0xf611('0x8b'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0x8c');break;case _0xf611('0x8d'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0x8e');break;case'squarerecordings':_0x4e6a19['childModel']=_0xf611('0x8f');_0x4e6a19[_0xf611('0x77')]=[{'name':_0xf611('0x90'),'field':_0xf611('0x2b'),'foreignKey':_0xf611('0x91')}];break;case _0xf611('0x92'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0x93');break;case _0xf611('0x94'):_0x4e6a19[_0xf611('0x73')]='CmContact';_0x4e6a19[_0xf611('0x77')]=[{'name':_0xf611('0x95'),'field':'id','foreignKey':_0xf611('0x96')}];break;case _0xf611('0x97'):_0x4e6a19[_0xf611('0x73')]='CmList';break;case _0xf611('0x98'):_0x4e6a19['childModel']='CmCompany';break;case _0xf611('0x99'):_0x4e6a19['childModel']=_0xf611('0x9a');break;case _0xf611('0x9b'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0x9c');break;case _0xf611('0x9d'):_0x4e6a19[_0xf611('0x73')]='ChatWebsite';break;case'faxqueues':_0x4e6a19['childModel']=_0xf611('0x9e');break;case _0xf611('0x9f'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xa0');break;case _0xf611('0xa1'):case _0xf611('0xa2'):case _0xf611('0xa3'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xa4');break;case _0xf611('0xa5'):_0x4e6a19[_0xf611('0x73')]='VoiceContext';break;case _0xf611('0xa6'):_0x4e6a19[_0xf611('0x73')]='VoiceMail';break;case'voicerecordings':_0x4e6a19['childModel']='VoiceRecording';_0x4e6a19[_0xf611('0x77')]=[{'name':_0xf611('0xa7'),'field':_0xf611('0x2b'),'foreignKey':_0xf611('0xa8'),'model':_0xf611('0xa9'),'filter':{'field':_0xf611('0xaa'),'value':[_0xf611('0xab')]}},{'name':_0xf611('0xac'),'field':_0xf611('0x2b'),'foreignKey':_0xf611('0xa8'),'model':_0xf611('0xa9'),'filter':{'field':_0xf611('0xaa'),'value':[_0xf611('0xad')]}},{'name':_0xf611('0xae'),'field':_0xf611('0x2b'),'foreignKey':_0xf611('0xaf'),'model':_0xf611('0xb0'),'filter':{'field':'type','value':['inbound']}},{'name':_0xf611('0xb1'),'field':'name','foreignKey':_0xf611('0xaf'),'model':'VoiceQueue','filter':{'field':_0xf611('0x31'),'value':['outbound']}}];break;case _0xf611('0xb2'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xb3');break;case _0xf611('0xb4'):_0x4e6a19[_0xf611('0x73')]='VoiceChanSpy';break;case _0xf611('0xb5'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xb6');break;case _0xf611('0xb7'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xb8');break;case _0xf611('0xb9'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xba');break;case'mailaccounts':_0x4e6a19[_0xf611('0x73')]=_0xf611('0xbb');break;case _0xf611('0xbc'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xbd');break;case _0xf611('0xbe'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xbf');break;case _0xf611('0xc0'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xc1');break;case _0xf611('0xc2'):_0x4e6a19[_0xf611('0x73')]='SmsQueue';break;case _0xf611('0xc3'):_0x4e6a19['childModel']=_0xf611('0xc4');break;case _0xf611('0xc5'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xc6');break;case _0xf611('0xc7'):_0x4e6a19[_0xf611('0x73')]='WhatsappAccount';break;case _0xf611('0xc8'):_0x4e6a19[_0xf611('0x73')]='Team';break;case _0xf611('0xc9'):case'queuecampaigns':_0x4e6a19[_0xf611('0x73')]='VoiceQueue';if(_0x4b9095){_0x4e6a19[_0xf611('0x77')]=[{'name':_0xf611('0xae')},{'name':_0xf611('0xb1')}];}break;case'users':case'agents':case _0xf611('0xca'):_0x4e6a19['childModel']=_0xf611('0xa9');if(_0x4b9095){_0x4e6a19[_0xf611('0x77')]=[{'name':'Users','filter':{'field':_0xf611('0xaa'),'value':[_0xf611('0xcb'),_0xf611('0xcc')]},'ignore':!![]},{'name':'Agents'},{'name':_0xf611('0xac')}];}break;case _0xf611('0xcd'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xce');break;case _0xf611('0xcf'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xd0');break;case _0xf611('0xd1'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xd2');break;case _0xf611('0xd3'):_0x4e6a19['childModel']=_0xf611('0xd4');break;case _0xf611('0xd5'):_0x4e6a19['childModel']=_0xf611('0xd6');break;case _0xf611('0xd7'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xd8');break;case _0xf611('0xd9'):_0x4e6a19['childModel']=_0xf611('0xa9');break;case _0xf611('0xda'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xdb');break;case'dispositions':_0x4e6a19['childModel']='Disposition';break;case _0xf611('0xdc'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0x68');break;case _0xf611('0xdd'):_0x4e6a19[_0xf611('0x73')]='Interval';break;case'pauses':_0x4e6a19['childModel']=_0xf611('0xde');break;case _0xf611('0xdf'):_0x4e6a19[_0xf611('0x73')]='Schedule';break;case _0xf611('0xe0'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xe1');break;case'tags':_0x4e6a19[_0xf611('0x73')]=_0xf611('0x84');break;case _0xf611('0xe2'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xe3');break;case _0xf611('0xe4'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xe5');break;case _0xf611('0xe6'):_0x4e6a19[_0xf611('0x73')]='Trunk';break;case'variables':_0x4e6a19[_0xf611('0x73')]='Variable';break;case _0xf611('0xe7'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0x6b');break;case'extractedreports':_0x4e6a19[_0xf611('0x73')]=_0xf611('0x7c');_0x4e6a19[_0xf611('0x77')]=[{'name':_0xf611('0xe8'),'field':'id','foreignKey':_0xf611('0x81')}];break;case _0xf611('0xe9'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xea');break;case _0xf611('0xc7'):_0x4e6a19['childModel']=_0xf611('0xeb');break;default:return _0x4e6a19;}return _0x4e6a19;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index d3a7b5a..18e7a61 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 _0x65b0=['exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hook'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0x65b0,0xfb));var _0x065b=function(_0x3649d7,_0x49e749){_0x3649d7=_0x3649d7-0x0;var _0x451c53=_0x65b0[_0x3649d7];return _0x451c53;};'use strict';var EventEmitter=require(_0x065b('0x0'));var UserProfile=require(_0x065b('0x1'))['db'][_0x065b('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x065b('0x3')](0x0);var events={'afterCreate':_0x065b('0x4'),'afterUpdate':_0x065b('0x5'),'afterDestroy':_0x065b('0x6')};function emitEvent(_0x4dc979){return function(_0x323598,_0x4b4b1b,_0x48bf4d){UserProfileEvents[_0x065b('0x7')](_0x4dc979+':'+_0x323598['id'],_0x323598);UserProfileEvents[_0x065b('0x7')](_0x4dc979,_0x323598);_0x48bf4d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0x065b('0x8')](e,emitEvent(event));}}module[_0x065b('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x6b89=['events','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x3cba27,_0x114ba2){var _0x332365=function(_0x408763){while(--_0x408763){_0x3cba27['push'](_0x3cba27['shift']());}};_0x332365(++_0x114ba2);}(_0x6b89,0x1ce));var _0x96b8=function(_0x3e4239,_0x1d4689){_0x3e4239=_0x3e4239-0x0;var _0x3ab6c0=_0x6b89[_0x3e4239];return _0x3ab6c0;};'use strict';var EventEmitter=require(_0x96b8('0x0'));var UserProfile=require('../../mysqldb')['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x96b8('0x1')](0x0);var events={'afterCreate':_0x96b8('0x2'),'afterUpdate':_0x96b8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x338774){return function(_0x20ecb1,_0x34b04e,_0xf1cb63){UserProfileEvents[_0x96b8('0x4')](_0x338774+':'+_0x20ecb1['id'],_0x20ecb1);UserProfileEvents[_0x96b8('0x4')](_0x338774,_0x20ecb1);_0xf1cb63(null);};}for(var e in events){if(events[_0x96b8('0x5')](e)){var event=events[e];UserProfile[_0x96b8('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 8a52ce1..fc043fc 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 _0x6f9f=['exports','define','UserProfile','user_profiles','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3a19d4,_0x3f19a4){var _0x5b858b=function(_0x4ddce5){while(--_0x4ddce5){_0x3a19d4['push'](_0x3a19d4['shift']());}};_0x5b858b(++_0x3f19a4);}(_0x6f9f,0x124));var _0xf6f9=function(_0xfc32e4,_0x3131d1){_0xfc32e4=_0xfc32e4-0x0;var _0x27cee6=_0x6f9f[_0xfc32e4];return _0x27cee6;};'use strict';var _=require(_0xf6f9('0x0'));var util=require(_0xf6f9('0x1'));var logger=require(_0xf6f9('0x2'))('api');var moment=require(_0xf6f9('0x3'));var BPromise=require('bluebird');var rp=require(_0xf6f9('0x4'));var fs=require('fs');var path=require(_0xf6f9('0x5'));var rimraf=require(_0xf6f9('0x6'));var config=require(_0xf6f9('0x7'));var attributes=require('./userProfile.attributes');module[_0xf6f9('0x8')]=function(_0x429e83,_0x3c79c8){return _0x429e83[_0xf6f9('0x9')](_0xf6f9('0xa'),attributes,{'tableName':_0xf6f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb10=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','UserProfile','user_profiles'];(function(_0x551565,_0x478ff7){var _0x3174bb=function(_0x264765){while(--_0x264765){_0x551565['push'](_0x551565['shift']());}};_0x3174bb(++_0x478ff7);}(_0xcb10,0x1d4));var _0x0cb1=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xcb10[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x0cb1('0x0'));var util=require('util');var logger=require(_0x0cb1('0x1'))(_0x0cb1('0x2'));var moment=require(_0x0cb1('0x3'));var BPromise=require(_0x0cb1('0x4'));var rp=require(_0x0cb1('0x5'));var fs=require('fs');var path=require(_0x0cb1('0x6'));var rimraf=require(_0x0cb1('0x7'));var config=require(_0x0cb1('0x8'));var attributes=require('./userProfile.attributes');module[_0x0cb1('0x9')]=function(_0x3e70de,_0x187f49){return _0x3e70de[_0x0cb1('0xa')](_0x0cb1('0xb'),attributes,{'tableName':_0x0cb1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 95e6a85..5b43fee 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 _0x5d17=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x2d2565,_0x4bce39){var _0x22f96b=function(_0x2360bd){while(--_0x2360bd){_0x2d2565['push'](_0x2d2565['shift']());}};_0x22f96b(++_0x4bce39);}(_0x5d17,0x114));var _0x75d1=function(_0x1392c4,_0x5a51c6){_0x1392c4=_0x1392c4-0x0;var _0x179f77=_0x5d17[_0x1392c4];return _0x179f77;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x75d1('0x2'));var fs=require('fs');var Redis=require(_0x75d1('0x3'));var db=require(_0x75d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75d1('0x5'))(_0x75d1('0x6'));var config=require(_0x75d1('0x7'));var jayson=require(_0x75d1('0x8'));var client=jayson['client'][_0x75d1('0x9')]({'port':0x232a});config[_0x75d1('0xa')]=_[_0x75d1('0xb')](config[_0x75d1('0xa')],{'host':_0x75d1('0xc'),'port':0x18eb});var socket=require(_0x75d1('0xd'))(new Redis(config[_0x75d1('0xa')]));require('./userProfile.socket')['register'](socket);function respondWithRpcPromise(_0x40df40,_0x4a3bb3,_0x57be31){return new BPromise(function(_0x120b53,_0x2b75c6){return client['request'](_0x40df40,_0x57be31)[_0x75d1('0xe')](function(_0x3d7e39){logger[_0x75d1('0xf')](_0x75d1('0x10'),_0x4a3bb3,_0x75d1('0x11'));logger[_0x75d1('0x12')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x4a3bb3,_0x75d1('0x11'),JSON[_0x75d1('0x13')](_0x3d7e39));if(_0x3d7e39[_0x75d1('0x14')]){if(_0x3d7e39[_0x75d1('0x14')]['code']===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x4a3bb3,_0x3d7e39[_0x75d1('0x14')][_0x75d1('0x15')]);return _0x2b75c6(_0x3d7e39[_0x75d1('0x14')]['message']);}logger[_0x75d1('0x14')](_0x75d1('0x10'),_0x4a3bb3,_0x3d7e39[_0x75d1('0x14')][_0x75d1('0x15')]);return _0x120b53(_0x3d7e39[_0x75d1('0x14')][_0x75d1('0x15')]);}else{logger[_0x75d1('0xf')](_0x75d1('0x10'),_0x4a3bb3,_0x75d1('0x11'));_0x120b53(_0x3d7e39[_0x75d1('0x16')][_0x75d1('0x15')]);}})['catch'](function(_0x493fff){logger[_0x75d1('0x14')](_0x75d1('0x10'),_0x4a3bb3,_0x493fff);_0x2b75c6(_0x493fff);});});} \ No newline at end of file +var _0x2675=['http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x57a6e5,_0x497687){var _0x323167=function(_0x541ef6){while(--_0x541ef6){_0x57a6e5['push'](_0x57a6e5['shift']());}};_0x323167(++_0x497687);}(_0x2675,0x75));var _0x5267=function(_0x3f618a,_0x14ece5){_0x3f618a=_0x3f618a-0x0;var _0x429a4a=_0x2675[_0x3f618a];return _0x429a4a;};'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});config[_0x5267('0x9')]=_[_0x5267('0xa')](config['redis'],{'host':_0x5267('0xb'),'port':0x18eb});var socket=require(_0x5267('0xc'))(new Redis(config['redis']));require(_0x5267('0xd'))['register'](socket);function respondWithRpcPromise(_0x3ff4e9,_0x207d47,_0x26e22b){return new BPromise(function(_0x534c2b,_0x3e6964){return client['request'](_0x3ff4e9,_0x26e22b)[_0x5267('0xe')](function(_0x5bbf00){logger[_0x5267('0xf')](_0x5267('0x10'),_0x207d47,_0x5267('0x11'));logger[_0x5267('0x12')](_0x5267('0x13'),_0x207d47,_0x5267('0x11'),JSON[_0x5267('0x14')](_0x5bbf00));if(_0x5bbf00[_0x5267('0x15')]){if(_0x5bbf00[_0x5267('0x15')][_0x5267('0x16')]===0x1f4){logger[_0x5267('0x15')](_0x5267('0x10'),_0x207d47,_0x5bbf00[_0x5267('0x15')]['message']);return _0x3e6964(_0x5bbf00['error'][_0x5267('0x17')]);}logger[_0x5267('0x15')](_0x5267('0x10'),_0x207d47,_0x5bbf00[_0x5267('0x15')][_0x5267('0x17')]);return _0x534c2b(_0x5bbf00[_0x5267('0x15')][_0x5267('0x17')]);}else{logger[_0x5267('0xf')](_0x5267('0x10'),_0x207d47,_0x5267('0x11'));_0x534c2b(_0x5bbf00[_0x5267('0x18')][_0x5267('0x17')]);}})['catch'](function(_0x18f32e){logger[_0x5267('0x15')]('UserProfile,\x20%s,\x20%s',_0x207d47,_0x18f32e);_0x3e6964(_0x18f32e);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index dca6bb3..482fcf9 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 _0x2909=['emit','removeListener','length','./userProfile.events','save','update'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x2909,0x1ad));var _0x9290=function(_0xd0883a,_0x556091){_0xd0883a=_0xd0883a-0x0;var _0x3f3876=_0x2909[_0xd0883a];return _0x3f3876;};'use strict';var UserProfileEvents=require(_0x9290('0x0'));var events=[_0x9290('0x1'),'remove',_0x9290('0x2')];function createListener(_0x32250e,_0x30e243){return function(_0x415639){_0x30e243[_0x9290('0x3')](_0x32250e,_0x415639);};}function removeListener(_0x526f11,_0x328419){return function(){UserProfileEvents[_0x9290('0x4')](_0x526f11,_0x328419);};}exports['register']=function(_0x2f9c15){for(var _0x43dd69=0x0,_0x25c455=events[_0x9290('0x5')];_0x43dd69<_0x25c455;_0x43dd69++){var _0x190c75=events[_0x43dd69];var _0x489ab9=createListener('userProfile:'+_0x190c75,_0x2f9c15);UserProfileEvents['on'](_0x190c75,_0x489ab9);}}; \ No newline at end of file +var _0xcb4f=['update','emit','length','userProfile:','./userProfile.events','save','remove'];(function(_0x204799,_0x30711d){var _0x122717=function(_0x1f0870){while(--_0x1f0870){_0x204799['push'](_0x204799['shift']());}};_0x122717(++_0x30711d);}(_0xcb4f,0xeb));var _0xfcb4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xcb4f[_0x3ab51d];return _0x29a04e;};'use strict';var UserProfileEvents=require(_0xfcb4('0x0'));var events=[_0xfcb4('0x1'),_0xfcb4('0x2'),_0xfcb4('0x3')];function createListener(_0x262f12,_0x44739d){return function(_0x6edd34){_0x44739d[_0xfcb4('0x4')](_0x262f12,_0x6edd34);};}function removeListener(_0x5daa9e,_0x5bdbbf){return function(){UserProfileEvents['removeListener'](_0x5daa9e,_0x5bdbbf);};}exports['register']=function(_0x48e6c0){for(var _0x562a25=0x0,_0x48e6ea=events[_0xfcb4('0x5')];_0x562a25<_0x48e6ea;_0x562a25++){var _0x3e0ce4=events[_0x562a25];var _0x46e2d7=createListener(_0xfcb4('0x6')+_0x3e0ce4,_0x48e6c0);UserProfileEvents['on'](_0x3e0ce4,_0x46e2d7);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index ebfc838..317775a 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 _0x758a=['connect-timeout','express','Router','./userProfileResource.controller','isAuthenticated','index','get','describe','/:id','show','post','create','update','destroy','exports','multer','util','path'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x758a,0x1d1));var _0xa758=function(_0x4fea80,_0x16175c){_0x4fea80=_0x4fea80-0x0;var _0x297753=_0x758a[_0x4fea80];return _0x297753;};'use strict';var multer=require(_0xa758('0x0'));var util=require(_0xa758('0x1'));var path=require(_0xa758('0x2'));var timeout=require(_0xa758('0x3'));var express=require(_0xa758('0x4'));var router=express[_0xa758('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa758('0x6'));router['get']('/',auth[_0xa758('0x7')](),controller[_0xa758('0x8')]);router[_0xa758('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xa758('0xa')]);router[_0xa758('0x9')](_0xa758('0xb'),auth[_0xa758('0x7')](),controller[_0xa758('0xc')]);router[_0xa758('0xd')]('/',auth['isAuthenticated'](),controller[_0xa758('0xe')]);router['put']('/:id',auth[_0xa758('0x7')](),controller[_0xa758('0xf')]);router['delete'](_0xa758('0xb'),auth[_0xa758('0x7')](),controller[_0xa758('0x10')]);module[_0xa758('0x11')]=router; \ No newline at end of file +var _0xca3a=['describe','/:id','post','create','update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xca3a,0x78));var _0xaca3=function(_0x5b8e09,_0x3a99e0){_0x5b8e09=_0x5b8e09-0x0;var _0x3f73d4=_0xca3a[_0x5b8e09];return _0x3f73d4;};'use strict';var multer=require(_0xaca3('0x0'));var util=require(_0xaca3('0x1'));var path=require(_0xaca3('0x2'));var timeout=require(_0xaca3('0x3'));var express=require(_0xaca3('0x4'));var router=express[_0xaca3('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xaca3('0x6'));var config=require(_0xaca3('0x7'));var controller=require(_0xaca3('0x8'));router[_0xaca3('0x9')]('/',auth[_0xaca3('0xa')](),controller[_0xaca3('0xb')]);router['get'](_0xaca3('0xc'),auth[_0xaca3('0xa')](),controller[_0xaca3('0xd')]);router['get'](_0xaca3('0xe'),auth[_0xaca3('0xa')](),controller['show']);router[_0xaca3('0xf')]('/',auth[_0xaca3('0xa')](),controller[_0xaca3('0x10')]);router['put']('/:id',auth[_0xaca3('0xa')](),controller[_0xaca3('0x11')]);router[_0xaca3('0x12')]('/:id',auth[_0xaca3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 0faaeb9..d175d97 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 _0x52d7=['STRING','INTEGER','exports'];(function(_0x414688,_0x4dae18){var _0x244712=function(_0x200c7a){while(--_0x200c7a){_0x414688['push'](_0x414688['shift']());}};_0x244712(++_0x4dae18);}(_0x52d7,0xe9));var _0x752d=function(_0x34d346,_0x4c6502){_0x34d346=_0x34d346-0x0;var _0x122d76=_0x52d7[_0x34d346];return _0x122d76;};'use strict';var Sequelize=require('sequelize');module[_0x752d('0x0')]={'name':{'type':Sequelize[_0x752d('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x752d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x752d('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xbea4=['INTEGER','sequelize','exports','STRING'];(function(_0x57f2b9,_0x3ded03){var _0x117c1d=function(_0x87921e){while(--_0x87921e){_0x57f2b9['push'](_0x57f2b9['shift']());}};_0x117c1d(++_0x3ded03);}(_0xbea4,0x1c1));var _0x4bea=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xbea4[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x4bea('0x0'));module[_0x4bea('0x1')]={'name':{'type':Sequelize[_0x4bea('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4bea('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x4bea('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 23851b3..964930a 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 _0x9b67=['type','key','model','map','keys','query','filters','intersection','fields','attributes','length','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','name','send','UserProfileResource','rawAttributes','fieldName'];(function(_0x5144b1,_0xccd094){var _0x526dc9=function(_0x803c1c){while(--_0x803c1c){_0x5144b1['push'](_0x5144b1['shift']());}};_0x526dc9(++_0xccd094);}(_0x9b67,0xf6));var _0x79b6=function(_0x145ef9,_0x384fac){_0x145ef9=_0x145ef9-0x0;var _0x5c74c6=_0x9b67[_0x145ef9];return _0x5c74c6;};'use strict';var pdf=require(_0x79b6('0x0'));var emlformat=require(_0x79b6('0x1'));var rimraf=require(_0x79b6('0x2'));var zipdir=require(_0x79b6('0x3'));var jsonpatch=require(_0x79b6('0x4'));var rp=require('request-promise');var moment=require(_0x79b6('0x5'));var BPromise=require(_0x79b6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x79b6('0x7'));var sox=require(_0x79b6('0x8'));var csv=require(_0x79b6('0x9'));var ejs=require(_0x79b6('0xa'));var fs=require('fs');var _=require(_0x79b6('0xb'));var squel=require(_0x79b6('0xc'));var crypto=require(_0x79b6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x79b6('0xe'));var toCsv=require(_0x79b6('0x9'));var querystring=require(_0x79b6('0xf'));var Papa=require(_0x79b6('0x10'));var Redis=require(_0x79b6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x79b6('0x12'));var as=require(_0x79b6('0x13'));var hardwareService=require(_0x79b6('0x14'));var logger=require(_0x79b6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x79b6('0x16'));var db=require(_0x79b6('0x17'))['db'];function respondWithStatusCode(_0x303cfb,_0x526727){_0x526727=_0x526727||0xcc;return function(_0xc05a77){if(_0xc05a77){return _0x303cfb[_0x79b6('0x18')](_0x526727);}return _0x303cfb[_0x79b6('0x19')](_0x526727)[_0x79b6('0x1a')]();};}function respondWithResult(_0x3b0721,_0x40478d){_0x40478d=_0x40478d||0xc8;return function(_0x19d5b2){if(_0x19d5b2){return _0x3b0721[_0x79b6('0x19')](_0x40478d)[_0x79b6('0x1b')](_0x19d5b2);}};}function respondWithFilteredResult(_0x114d8c,_0x2ac966){return function(_0x3563cc){if(_0x3563cc){var _0x1e8bf1=_0x3563cc[_0x79b6('0x1c')],_0x4cf491=_0x2ac966[_0x79b6('0x1d')],_0x207bcc=_0x2ac966[_0x79b6('0x1d')]+_0x2ac966[_0x79b6('0x1e')],_0x2a75d5;if(_0x207bcc>=_0x1e8bf1){_0x207bcc=_0x1e8bf1;_0x2a75d5=0xc8;}else{_0x2a75d5=0xce;}_0x114d8c[_0x79b6('0x19')](_0x2a75d5);return _0x114d8c[_0x79b6('0x1f')](_0x79b6('0x20'),_0x4cf491+'-'+_0x207bcc+'/'+_0x1e8bf1)[_0x79b6('0x1b')](_0x3563cc);}return null;};}function patchUpdates(_0x323376){return function(_0xa1a29a){try{jsonpatch[_0x79b6('0x21')](_0xa1a29a,_0x323376,!![]);}catch(_0x52a70f){return BPromise[_0x79b6('0x22')](_0x52a70f);}return _0xa1a29a['save']();};}function saveUpdates(_0x22a9eb,_0x532e65){return function(_0x28b9c2){if(_0x28b9c2){return _0x28b9c2[_0x79b6('0x23')](_0x22a9eb)[_0x79b6('0x24')](function(_0x56ebf4){return _0x56ebf4;});}return null;};}function removeEntity(_0x46304b,_0x30dc0b){return function(_0x53208a){if(_0x53208a){return _0x53208a['destroy']()[_0x79b6('0x24')](function(){_0x46304b[_0x79b6('0x19')](0xcc)[_0x79b6('0x1a')]();});}};}function handleEntityNotFound(_0x268826,_0x3b2a2a){return function(_0x488102){if(!_0x488102){_0x268826[_0x79b6('0x18')](0x194);}return _0x488102;};}function handleError(_0x280e04,_0x17eff4){_0x17eff4=_0x17eff4||0x1f4;return function(_0x26dd86){logger['error'](_0x26dd86['stack']);if(_0x26dd86[_0x79b6('0x25')]){delete _0x26dd86[_0x79b6('0x25')];}_0x280e04[_0x79b6('0x19')](_0x17eff4)[_0x79b6('0x26')](_0x26dd86);};}exports['index']=function(_0x6f6ca1,_0x52574b){var _0x400542={},_0x2fd9b5={},_0x302596={'count':0x0,'rows':[]};var _0xe03d2=_['map'](db[_0x79b6('0x27')][_0x79b6('0x28')],function(_0x53b463){return{'name':_0x53b463[_0x79b6('0x29')],'type':_0x53b463[_0x79b6('0x2a')][_0x79b6('0x2b')]};});_0x2fd9b5[_0x79b6('0x2c')]=_[_0x79b6('0x2d')](_0xe03d2,_0x79b6('0x25'));_0x2fd9b5['query']=_[_0x79b6('0x2e')](_0x6f6ca1[_0x79b6('0x2f')]);_0x2fd9b5[_0x79b6('0x30')]=_[_0x79b6('0x31')](_0x2fd9b5[_0x79b6('0x2c')],_0x2fd9b5[_0x79b6('0x2f')]);_0x400542['attributes']=_[_0x79b6('0x31')](_0x2fd9b5[_0x79b6('0x2c')],qs[_0x79b6('0x32')](_0x6f6ca1['query']['fields']));_0x400542[_0x79b6('0x33')]=_0x400542[_0x79b6('0x33')][_0x79b6('0x34')]?_0x400542[_0x79b6('0x33')]:_0x2fd9b5[_0x79b6('0x2c')];if(!_0x6f6ca1[_0x79b6('0x2f')]['hasOwnProperty']('nolimit')){_0x400542[_0x79b6('0x1e')]=qs['limit'](_0x6f6ca1[_0x79b6('0x2f')]['limit']);_0x400542[_0x79b6('0x1d')]=qs[_0x79b6('0x1d')](_0x6f6ca1['query'][_0x79b6('0x1d')]);}_0x400542[_0x79b6('0x35')]=qs['sort'](_0x6f6ca1[_0x79b6('0x2f')]['sort']);_0x400542[_0x79b6('0x36')]=qs[_0x79b6('0x30')](_[_0x79b6('0x37')](_0x6f6ca1[_0x79b6('0x2f')],_0x2fd9b5[_0x79b6('0x30')]),_0xe03d2);if(_0x6f6ca1[_0x79b6('0x2f')][_0x79b6('0x38')]){_0x400542[_0x79b6('0x36')]=_[_0x79b6('0x39')](_0x400542[_0x79b6('0x36')],{'$or':_['map'](_0xe03d2,function(_0x5179ec){if(_0x5179ec['type']!==_0x79b6('0x3a')){var _0x324a04={};_0x324a04[_0x5179ec['name']]={'$like':'%'+_0x6f6ca1[_0x79b6('0x2f')]['filter']+'%'};return _0x324a04;}})});}_0x400542=_[_0x79b6('0x39')]({},_0x400542,_0x6f6ca1[_0x79b6('0x3b')]);var _0x26abad={'where':_0x400542['where']};return db[_0x79b6('0x27')]['count'](_0x26abad)[_0x79b6('0x24')](function(_0x1bba0d){_0x302596[_0x79b6('0x1c')]=_0x1bba0d;if(_0x6f6ca1[_0x79b6('0x2f')][_0x79b6('0x3c')]){_0x400542['include']=[{'all':!![]}];}return db['UserProfileResource'][_0x79b6('0x3d')](_0x400542);})['then'](function(_0x4037c8){_0x302596[_0x79b6('0x3e')]=_0x4037c8;return _0x302596;})[_0x79b6('0x24')](respondWithFilteredResult(_0x52574b,_0x400542))[_0x79b6('0x3f')](handleError(_0x52574b,null));};exports[_0x79b6('0x40')]=function(_0x376eb2,_0x475c8c){var _0x4a7f90={'raw':![],'where':{'id':_0x376eb2[_0x79b6('0x41')]['id']}},_0x109514={};_0x109514[_0x79b6('0x2c')]=_[_0x79b6('0x2e')](db['UserProfileResource'][_0x79b6('0x28')]);_0x109514['query']=_['keys'](_0x376eb2[_0x79b6('0x2f')]);_0x109514[_0x79b6('0x30')]=_[_0x79b6('0x31')](_0x109514[_0x79b6('0x2c')],_0x109514[_0x79b6('0x2f')]);_0x4a7f90[_0x79b6('0x33')]=_[_0x79b6('0x31')](_0x109514[_0x79b6('0x2c')],qs['fields'](_0x376eb2[_0x79b6('0x2f')]['fields']));_0x4a7f90['attributes']=_0x4a7f90[_0x79b6('0x33')][_0x79b6('0x34')]?_0x4a7f90[_0x79b6('0x33')]:_0x109514[_0x79b6('0x2c')];if(_0x376eb2[_0x79b6('0x2f')][_0x79b6('0x3c')]){_0x4a7f90[_0x79b6('0x42')]=[{'all':!![]}];}_0x4a7f90=_[_0x79b6('0x39')]({},_0x4a7f90,_0x376eb2[_0x79b6('0x3b')]);return db['UserProfileResource'][_0x79b6('0x43')](_0x4a7f90)[_0x79b6('0x24')](handleEntityNotFound(_0x475c8c,null))[_0x79b6('0x24')](respondWithResult(_0x475c8c,null))[_0x79b6('0x3f')](handleError(_0x475c8c,null));};exports[_0x79b6('0x44')]=function(_0x4f1344,_0x3e335e){return db[_0x79b6('0x27')]['create'](_0x4f1344['body'],{})[_0x79b6('0x24')](respondWithResult(_0x3e335e,0xc9))[_0x79b6('0x3f')](handleError(_0x3e335e,null));};exports[_0x79b6('0x23')]=function(_0xa0c396,_0x37f4b1){if(_0xa0c396[_0x79b6('0x45')]['id']){delete _0xa0c396[_0x79b6('0x45')]['id'];}return db[_0x79b6('0x27')][_0x79b6('0x43')]({'where':{'id':_0xa0c396[_0x79b6('0x41')]['id']}})[_0x79b6('0x24')](handleEntityNotFound(_0x37f4b1,null))[_0x79b6('0x24')](saveUpdates(_0xa0c396[_0x79b6('0x45')],null))[_0x79b6('0x24')](respondWithResult(_0x37f4b1,null))[_0x79b6('0x3f')](handleError(_0x37f4b1,null));};exports[_0x79b6('0x46')]=function(_0x26ab29,_0x14fa5c){return db[_0x79b6('0x27')]['find']({'where':{'id':_0x26ab29['params']['id']}})['then'](handleEntityNotFound(_0x14fa5c,null))['then'](removeEntity(_0x14fa5c,null))['catch'](handleError(_0x14fa5c,null));};exports[_0x79b6('0x47')]=function(_0xdaef8c,_0x23d4eb){return db[_0x79b6('0x27')][_0x79b6('0x47')]()[_0x79b6('0x24')](respondWithResult(_0x23d4eb,null))['catch'](handleError(_0x23d4eb,null));}; \ No newline at end of file +var _0xe5b3=['moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','params','keys','length','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x5ece03,_0x324987){var _0x45c053=function(_0x5c87f0){while(--_0x5c87f0){_0x5ece03['push'](_0x5ece03['shift']());}};_0x45c053(++_0x324987);}(_0xe5b3,0x133));var _0x3e5b=function(_0x224035,_0x1f93ef){_0x224035=_0x224035-0x0;var _0x3a0c7a=_0xe5b3[_0x224035];return _0x3a0c7a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3e5b('0x0'));var rimraf=require(_0x3e5b('0x1'));var zipdir=require(_0x3e5b('0x2'));var jsonpatch=require(_0x3e5b('0x3'));var rp=require(_0x3e5b('0x4'));var moment=require(_0x3e5b('0x5'));var BPromise=require(_0x3e5b('0x6'));var Mustache=require(_0x3e5b('0x7'));var util=require(_0x3e5b('0x8'));var path=require(_0x3e5b('0x9'));var sox=require(_0x3e5b('0xa'));var csv=require('to-csv');var ejs=require(_0x3e5b('0xb'));var fs=require('fs');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('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e5b('0x11'));var authService=require(_0x3e5b('0x12'));var qs=require(_0x3e5b('0x13'));var as=require(_0x3e5b('0x14'));var hardwareService=require(_0x3e5b('0x15'));var logger=require('../../config/logger')(_0x3e5b('0x16'));var utils=require('../../config/utils');var config=require(_0x3e5b('0x17'));var db=require(_0x3e5b('0x18'))['db'];function respondWithStatusCode(_0x4d69dd,_0x374068){_0x374068=_0x374068||0xcc;return function(_0x20b97b){if(_0x20b97b){return _0x4d69dd[_0x3e5b('0x19')](_0x374068);}return _0x4d69dd[_0x3e5b('0x1a')](_0x374068)['end']();};}function respondWithResult(_0x39a2a1,_0x5f2f9c){_0x5f2f9c=_0x5f2f9c||0xc8;return function(_0x51a188){if(_0x51a188){return _0x39a2a1['status'](_0x5f2f9c)[_0x3e5b('0x1b')](_0x51a188);}};}function respondWithFilteredResult(_0x3f5368,_0x17aaa3){return function(_0x4fb471){if(_0x4fb471){var _0x1f81a7=_0x4fb471[_0x3e5b('0x1c')],_0x59ddc0=_0x17aaa3['offset'],_0x56a453=_0x17aaa3[_0x3e5b('0x1d')]+_0x17aaa3[_0x3e5b('0x1e')],_0x258d6a;if(_0x56a453>=_0x1f81a7){_0x56a453=_0x1f81a7;_0x258d6a=0xc8;}else{_0x258d6a=0xce;}_0x3f5368['status'](_0x258d6a);return _0x3f5368[_0x3e5b('0x1f')](_0x3e5b('0x20'),_0x59ddc0+'-'+_0x56a453+'/'+_0x1f81a7)['json'](_0x4fb471);}return null;};}function patchUpdates(_0x4b189d){return function(_0x144fa7){try{jsonpatch[_0x3e5b('0x21')](_0x144fa7,_0x4b189d,!![]);}catch(_0x20b549){return BPromise[_0x3e5b('0x22')](_0x20b549);}return _0x144fa7[_0x3e5b('0x23')]();};}function saveUpdates(_0x1564b5,_0x447d36){return function(_0x21fc32){if(_0x21fc32){return _0x21fc32[_0x3e5b('0x24')](_0x1564b5)[_0x3e5b('0x25')](function(_0x2b977c){return _0x2b977c;});}return null;};}function removeEntity(_0x11e5cf,_0x2d77cc){return function(_0x402873){if(_0x402873){return _0x402873['destroy']()[_0x3e5b('0x25')](function(){_0x11e5cf[_0x3e5b('0x1a')](0xcc)[_0x3e5b('0x26')]();});}};}function handleEntityNotFound(_0x150674,_0x50039b){return function(_0x1eb80f){if(!_0x1eb80f){_0x150674['sendStatus'](0x194);}return _0x1eb80f;};}function handleError(_0x2f9e42,_0x36d960){_0x36d960=_0x36d960||0x1f4;return function(_0x4d5e61){logger[_0x3e5b('0x27')](_0x4d5e61[_0x3e5b('0x28')]);if(_0x4d5e61[_0x3e5b('0x29')]){delete _0x4d5e61[_0x3e5b('0x29')];}_0x2f9e42[_0x3e5b('0x1a')](_0x36d960)[_0x3e5b('0x2a')](_0x4d5e61);};}exports[_0x3e5b('0x2b')]=function(_0x2ddf57,_0x4c4b89){var _0x1c7278={},_0x505f40={},_0xb70ab4={'count':0x0,'rows':[]};var _0x4fd64b=_[_0x3e5b('0x2c')](db[_0x3e5b('0x2d')][_0x3e5b('0x2e')],function(_0x475b39){return{'name':_0x475b39[_0x3e5b('0x2f')],'type':_0x475b39[_0x3e5b('0x30')][_0x3e5b('0x31')]};});_0x505f40[_0x3e5b('0x32')]=_[_0x3e5b('0x2c')](_0x4fd64b,_0x3e5b('0x29'));_0x505f40[_0x3e5b('0x33')]=_['keys'](_0x2ddf57[_0x3e5b('0x33')]);_0x505f40[_0x3e5b('0x34')]=_[_0x3e5b('0x35')](_0x505f40[_0x3e5b('0x32')],_0x505f40[_0x3e5b('0x33')]);_0x1c7278[_0x3e5b('0x36')]=_[_0x3e5b('0x35')](_0x505f40['model'],qs[_0x3e5b('0x37')](_0x2ddf57['query']['fields']));_0x1c7278[_0x3e5b('0x36')]=_0x1c7278[_0x3e5b('0x36')]['length']?_0x1c7278[_0x3e5b('0x36')]:_0x505f40[_0x3e5b('0x32')];if(!_0x2ddf57[_0x3e5b('0x33')][_0x3e5b('0x38')](_0x3e5b('0x39'))){_0x1c7278[_0x3e5b('0x1e')]=qs[_0x3e5b('0x1e')](_0x2ddf57[_0x3e5b('0x33')][_0x3e5b('0x1e')]);_0x1c7278[_0x3e5b('0x1d')]=qs[_0x3e5b('0x1d')](_0x2ddf57[_0x3e5b('0x33')]['offset']);}_0x1c7278[_0x3e5b('0x3a')]=qs[_0x3e5b('0x3b')](_0x2ddf57['query']['sort']);_0x1c7278[_0x3e5b('0x3c')]=qs['filters'](_[_0x3e5b('0x3d')](_0x2ddf57[_0x3e5b('0x33')],_0x505f40[_0x3e5b('0x34')]),_0x4fd64b);if(_0x2ddf57[_0x3e5b('0x33')]['filter']){_0x1c7278[_0x3e5b('0x3c')]=_['merge'](_0x1c7278[_0x3e5b('0x3c')],{'$or':_['map'](_0x4fd64b,function(_0x47f7c8){if(_0x47f7c8['type']!==_0x3e5b('0x3e')){var _0x174ebf={};_0x174ebf[_0x47f7c8[_0x3e5b('0x29')]]={'$like':'%'+_0x2ddf57[_0x3e5b('0x33')][_0x3e5b('0x3f')]+'%'};return _0x174ebf;}})});}_0x1c7278=_[_0x3e5b('0x40')]({},_0x1c7278,_0x2ddf57['options']);var _0x5d0c59={'where':_0x1c7278['where']};return db['UserProfileResource']['count'](_0x5d0c59)['then'](function(_0x5aad1d){_0xb70ab4[_0x3e5b('0x1c')]=_0x5aad1d;if(_0x2ddf57[_0x3e5b('0x33')][_0x3e5b('0x41')]){_0x1c7278[_0x3e5b('0x42')]=[{'all':!![]}];}return db[_0x3e5b('0x2d')][_0x3e5b('0x43')](_0x1c7278);})[_0x3e5b('0x25')](function(_0x423be2){_0xb70ab4[_0x3e5b('0x44')]=_0x423be2;return _0xb70ab4;})[_0x3e5b('0x25')](respondWithFilteredResult(_0x4c4b89,_0x1c7278))[_0x3e5b('0x45')](handleError(_0x4c4b89,null));};exports['show']=function(_0x28362c,_0x1d2fb4){var _0x1e8075={'raw':![],'where':{'id':_0x28362c[_0x3e5b('0x46')]['id']}},_0xae974f={};_0xae974f[_0x3e5b('0x32')]=_[_0x3e5b('0x47')](db[_0x3e5b('0x2d')][_0x3e5b('0x2e')]);_0xae974f[_0x3e5b('0x33')]=_[_0x3e5b('0x47')](_0x28362c['query']);_0xae974f['filters']=_['intersection'](_0xae974f['model'],_0xae974f[_0x3e5b('0x33')]);_0x1e8075[_0x3e5b('0x36')]=_[_0x3e5b('0x35')](_0xae974f[_0x3e5b('0x32')],qs[_0x3e5b('0x37')](_0x28362c[_0x3e5b('0x33')][_0x3e5b('0x37')]));_0x1e8075[_0x3e5b('0x36')]=_0x1e8075[_0x3e5b('0x36')][_0x3e5b('0x48')]?_0x1e8075['attributes']:_0xae974f[_0x3e5b('0x32')];if(_0x28362c[_0x3e5b('0x33')][_0x3e5b('0x41')]){_0x1e8075[_0x3e5b('0x42')]=[{'all':!![]}];}_0x1e8075=_[_0x3e5b('0x40')]({},_0x1e8075,_0x28362c['options']);return db['UserProfileResource']['find'](_0x1e8075)[_0x3e5b('0x25')](handleEntityNotFound(_0x1d2fb4,null))[_0x3e5b('0x25')](respondWithResult(_0x1d2fb4,null))[_0x3e5b('0x45')](handleError(_0x1d2fb4,null));};exports['create']=function(_0x4b604d,_0x136d34){return db[_0x3e5b('0x2d')][_0x3e5b('0x49')](_0x4b604d['body'],{})['then'](respondWithResult(_0x136d34,0xc9))[_0x3e5b('0x45')](handleError(_0x136d34,null));};exports['update']=function(_0x14b62a,_0x3379a1){if(_0x14b62a[_0x3e5b('0x4a')]['id']){delete _0x14b62a[_0x3e5b('0x4a')]['id'];}return db[_0x3e5b('0x2d')][_0x3e5b('0x4b')]({'where':{'id':_0x14b62a[_0x3e5b('0x46')]['id']}})[_0x3e5b('0x25')](handleEntityNotFound(_0x3379a1,null))[_0x3e5b('0x25')](saveUpdates(_0x14b62a['body'],null))[_0x3e5b('0x25')](respondWithResult(_0x3379a1,null))['catch'](handleError(_0x3379a1,null));};exports[_0x3e5b('0x4c')]=function(_0x2e7047,_0x26e11e){return db[_0x3e5b('0x2d')][_0x3e5b('0x4b')]({'where':{'id':_0x2e7047[_0x3e5b('0x46')]['id']}})[_0x3e5b('0x25')](handleEntityNotFound(_0x26e11e,null))[_0x3e5b('0x25')](removeEntity(_0x26e11e,null))[_0x3e5b('0x45')](handleError(_0x26e11e,null));};exports[_0x3e5b('0x4d')]=function(_0xf6ca5b,_0x18ba31){return db[_0x3e5b('0x2d')]['describe']()[_0x3e5b('0x25')](respondWithResult(_0x18ba31,null))[_0x3e5b('0x45')](handleError(_0x18ba31,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 4d9690a..f1150f5 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 _0xf109=['path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','request-promise'];(function(_0x28ecae,_0x25d192){var _0x1840b5=function(_0x180acc){while(--_0x180acc){_0x28ecae['push'](_0x28ecae['shift']());}};_0x1840b5(++_0x25d192);}(_0xf109,0xce));var _0x9f10=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xf109[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f10('0x3'));var fs=require('fs');var path=require(_0x9f10('0x4'));var rimraf=require(_0x9f10('0x5'));var config=require(_0x9f10('0x6'));var attributes=require(_0x9f10('0x7'));module[_0x9f10('0x8')]=function(_0x408fe8,_0xd3137b){return _0x408fe8[_0x9f10('0x9')](_0x9f10('0xa'),attributes,{'tableName':_0x9f10('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x9f10('0xc'),_0x9f10('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb4e6=['bluebird','request-promise','path','rimraf','./userProfileResource.attributes','exports','define','compositeIndex','lodash','../../config/logger','api','moment'];(function(_0x3f9fe8,_0x2ffba3){var _0x26eeb5=function(_0x152800){while(--_0x152800){_0x3f9fe8['push'](_0x3f9fe8['shift']());}};_0x26eeb5(++_0x2ffba3);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0xb4e6[_0x2aefb6];return _0x202772;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x6b4e('0xb'),'fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index bc46aae..d28d0fd 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 _0xed29=['ioredis','../../mysqldb','../../config/logger','rpc','client','request','then','info','UserProfileResource,\x20%s,\x20%s','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring'];(function(_0xb26161,_0x290cac){var _0x2638a7=function(_0x408ebd){while(--_0x408ebd){_0xb26161['push'](_0xb26161['shift']());}};_0x2638a7(++_0x290cac);}(_0xed29,0xc3));var _0x9ed2=function(_0x9c5512,_0x5651f1){_0x9c5512=_0x9c5512-0x0;var _0x5c4f5d=_0xed29[_0x9c5512];return _0x5c4f5d;};'use strict';var _=require(_0x9ed2('0x0'));var util=require(_0x9ed2('0x1'));var moment=require(_0x9ed2('0x2'));var BPromise=require(_0x9ed2('0x3'));var rs=require(_0x9ed2('0x4'));var fs=require('fs');var Redis=require(_0x9ed2('0x5'));var db=require(_0x9ed2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ed2('0x7'))(_0x9ed2('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9ed2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x18b1df,_0x1c7d36,_0x12688d){return new BPromise(function(_0xca6596,_0x14b4dc){return client[_0x9ed2('0xa')](_0x18b1df,_0x12688d)[_0x9ed2('0xb')](function(_0x425c09){logger[_0x9ed2('0xc')](_0x9ed2('0xd'),_0x1c7d36,'request\x20sent');logger['debug'](_0x9ed2('0xe'),_0x1c7d36,'request\x20sent',JSON['stringify'](_0x425c09));if(_0x425c09[_0x9ed2('0xf')]){if(_0x425c09[_0x9ed2('0xf')][_0x9ed2('0x10')]===0x1f4){logger[_0x9ed2('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x1c7d36,_0x425c09['error']['message']);return _0x14b4dc(_0x425c09[_0x9ed2('0xf')]['message']);}logger['error'](_0x9ed2('0xd'),_0x1c7d36,_0x425c09[_0x9ed2('0xf')][_0x9ed2('0x11')]);return _0xca6596(_0x425c09[_0x9ed2('0xf')][_0x9ed2('0x11')]);}else{logger['info']('UserProfileResource,\x20%s,\x20%s',_0x1c7d36,_0x9ed2('0x12'));_0xca6596(_0x425c09[_0x9ed2('0x13')][_0x9ed2('0x11')]);}})['catch'](function(_0x456451){logger[_0x9ed2('0xf')](_0x9ed2('0xd'),_0x1c7d36,_0x456451);_0x14b4dc(_0x456451);});});} \ No newline at end of file +var _0x8872=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash'];(function(_0x3dc1a5,_0x4f8840){var _0x447cba=function(_0x3bbe9e){while(--_0x3bbe9e){_0x3dc1a5['push'](_0x3dc1a5['shift']());}};_0x447cba(++_0x4f8840);}(_0x8872,0xe6));var _0x2887=function(_0x185a19,_0x1d3194){_0x185a19=_0x185a19-0x0;var _0x5373a4=_0x8872[_0x185a19];return _0x5373a4;};'use strict';var _=require(_0x2887('0x0'));var util=require('util');var moment=require(_0x2887('0x1'));var BPromise=require(_0x2887('0x2'));var rs=require(_0x2887('0x3'));var fs=require('fs');var Redis=require(_0x2887('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2887('0x5'));var logger=require(_0x2887('0x6'))(_0x2887('0x7'));var config=require(_0x2887('0x8'));var jayson=require(_0x2887('0x9'));var client=jayson['client'][_0x2887('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197e5e,_0x1be214,_0x150624){return new BPromise(function(_0x3454b9,_0x369196){return client['request'](_0x197e5e,_0x150624)[_0x2887('0xb')](function(_0x54e114){logger['info'](_0x2887('0xc'),_0x1be214,_0x2887('0xd'));logger[_0x2887('0xe')](_0x2887('0xf'),_0x1be214,_0x2887('0xd'),JSON['stringify'](_0x54e114));if(_0x54e114['error']){if(_0x54e114[_0x2887('0x10')][_0x2887('0x11')]===0x1f4){logger[_0x2887('0x10')](_0x2887('0xc'),_0x1be214,_0x54e114[_0x2887('0x10')][_0x2887('0x12')]);return _0x369196(_0x54e114[_0x2887('0x10')]['message']);}logger[_0x2887('0x10')](_0x2887('0xc'),_0x1be214,_0x54e114[_0x2887('0x10')][_0x2887('0x12')]);return _0x3454b9(_0x54e114[_0x2887('0x10')][_0x2887('0x12')]);}else{logger[_0x2887('0x13')](_0x2887('0xc'),_0x1be214,_0x2887('0xd'));_0x3454b9(_0x54e114[_0x2887('0x14')][_0x2887('0x12')]);}})['catch'](function(_0x4f5aaf){logger[_0x2887('0x10')](_0x2887('0xc'),_0x1be214,_0x4f5aaf);_0x369196(_0x4f5aaf);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 6f54420..35a1cc3 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 _0x11a1=['util','path','connect-timeout','express','Router','../../components/auth/service','./userProfileSection.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x349749,_0x404f46){var _0x5bbd11=function(_0x143f2f){while(--_0x143f2f){_0x349749['push'](_0x349749['shift']());}};_0x5bbd11(++_0x404f46);}(_0x11a1,0xbd));var _0x111a=function(_0x28dd68,_0x496aa2){_0x28dd68=_0x28dd68-0x0;var _0x42dad0=_0x11a1[_0x28dd68];return _0x42dad0;};'use strict';var multer=require(_0x111a('0x0'));var util=require(_0x111a('0x1'));var path=require(_0x111a('0x2'));var timeout=require(_0x111a('0x3'));var express=require(_0x111a('0x4'));var router=express[_0x111a('0x5')]();var auth=require(_0x111a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x111a('0x7'));router[_0x111a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x111a('0x9')](),controller['describe']);router['get'](_0x111a('0xa'),auth[_0x111a('0x9')](),controller[_0x111a('0xb')]);router[_0x111a('0xc')]('/',auth[_0x111a('0x9')](),controller[_0x111a('0xd')]);router[_0x111a('0xe')](_0x111a('0xa'),auth[_0x111a('0x9')](),controller[_0x111a('0xf')]);router[_0x111a('0x10')]('/:id',auth[_0x111a('0x9')](),controller[_0x111a('0x11')]);module[_0x111a('0x12')]=router; \ No newline at end of file +var _0x1f38=['Router','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1f38,0xd7));var _0x81f3=function(_0x345705,_0x2829c1){_0x345705=_0x345705-0x0;var _0x22c250=_0x1f38[_0x345705];return _0x22c250;};'use strict';var multer=require(_0x81f3('0x0'));var util=require(_0x81f3('0x1'));var path=require(_0x81f3('0x2'));var timeout=require(_0x81f3('0x3'));var express=require(_0x81f3('0x4'));var router=express[_0x81f3('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x81f3('0x6'));var config=require(_0x81f3('0x7'));var controller=require(_0x81f3('0x8'));router[_0x81f3('0x9')]('/',auth[_0x81f3('0xa')](),controller['index']);router[_0x81f3('0x9')](_0x81f3('0xb'),auth[_0x81f3('0xa')](),controller[_0x81f3('0xc')]);router[_0x81f3('0x9')](_0x81f3('0xd'),auth[_0x81f3('0xa')](),controller[_0x81f3('0xe')]);router[_0x81f3('0xf')]('/',auth[_0x81f3('0xa')](),controller[_0x81f3('0x10')]);router['put'](_0x81f3('0xd'),auth[_0x81f3('0xa')](),controller[_0x81f3('0x11')]);router[_0x81f3('0x12')](_0x81f3('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x81f3('0x13')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 36f3a7b..98b2356 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 _0xb717=['crudPermissions','join','getDataValue','split','sequelize','STRING','INTEGER','BOOLEAN','setDataValue'];(function(_0x54a770,_0x591033){var _0x31f8ab=function(_0x45ee46){while(--_0x45ee46){_0x54a770['push'](_0x54a770['shift']());}};_0x31f8ab(++_0x591033);}(_0xb717,0x1b4));var _0x7b71=function(_0x3826b0,_0xd15ad5){_0x3826b0=_0x3826b0-0x0;var _0x1b6da8=_0xb717[_0x3826b0];return _0x1b6da8;};'use strict';var Sequelize=require(_0x7b71('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b71('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x7b71('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x7b71('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x7b71('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x238319){this[_0x7b71('0x4')](_0x7b71('0x5'),_0x238319?_0x238319[_0x7b71('0x6')](''):[]);},'get':function(){return this[_0x7b71('0x7')]('crudPermissions')?this[_0x7b71('0x7')](_0x7b71('0x5'))[_0x7b71('0x8')](''):[];}}}; \ No newline at end of file +var _0x94dc=['BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','sequelize','STRING','INTEGER'];(function(_0x67b0f3,_0x5eb76c){var _0x5bb7c8=function(_0x1c36b1){while(--_0x1c36b1){_0x67b0f3['push'](_0x67b0f3['shift']());}};_0x5bb7c8(++_0x5eb76c);}(_0x94dc,0xb1));var _0xc94d=function(_0x4487d5,_0x154fc5){_0x4487d5=_0x4487d5-0x0;var _0x5a621c=_0x94dc[_0x4487d5];return _0x5a621c;};'use strict';var Sequelize=require(_0xc94d('0x0'));module['exports']={'name':{'type':Sequelize[_0xc94d('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xc94d('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xc94d('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xc94d('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x306706){this[_0xc94d('0x4')](_0xc94d('0x5'),_0x306706?_0x306706[_0xc94d('0x6')](''):[]);},'get':function(){return this[_0xc94d('0x7')](_0xc94d('0x5'))?this[_0xc94d('0x7')]('crudPermissions')[_0xc94d('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 1fb9dfb..87b07d9 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 _0xaa5f=['keys','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','merge','find','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','sendStatus','error','name','send','map','UserProfileSection','rawAttributes','fieldName','type','key','query'];(function(_0x5b7476,_0x262062){var _0xc7f721=function(_0x1df1be){while(--_0x1df1be){_0x5b7476['push'](_0x5b7476['shift']());}};_0xc7f721(++_0x262062);}(_0xaa5f,0xb3));var _0xfaa5=function(_0x36ccca,_0x530a9d){_0x36ccca=_0x36ccca-0x0;var _0x2ee517=_0xaa5f[_0x36ccca];return _0x2ee517;};'use strict';var pdf=require(_0xfaa5('0x0'));var emlformat=require(_0xfaa5('0x1'));var rimraf=require(_0xfaa5('0x2'));var zipdir=require(_0xfaa5('0x3'));var jsonpatch=require(_0xfaa5('0x4'));var rp=require(_0xfaa5('0x5'));var moment=require(_0xfaa5('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xfaa5('0x7'));var util=require(_0xfaa5('0x8'));var path=require('path');var sox=require(_0xfaa5('0x9'));var csv=require(_0xfaa5('0xa'));var ejs=require(_0xfaa5('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfaa5('0xc'));var crypto=require(_0xfaa5('0xd'));var jsforce=require(_0xfaa5('0xe'));var deskjs=require(_0xfaa5('0xf'));var toCsv=require(_0xfaa5('0xa'));var querystring=require(_0xfaa5('0x10'));var Papa=require('papaparse');var Redis=require(_0xfaa5('0x11'));var authService=require(_0xfaa5('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfaa5('0x13'));var hardwareService=require(_0xfaa5('0x14'));var logger=require(_0xfaa5('0x15'))(_0xfaa5('0x16'));var utils=require(_0xfaa5('0x17'));var config=require(_0xfaa5('0x18'));var db=require(_0xfaa5('0x19'))['db'];function respondWithStatusCode(_0x49d7d7,_0x27ceba){_0x27ceba=_0x27ceba||0xcc;return function(_0x1fd1ca){if(_0x1fd1ca){return _0x49d7d7['sendStatus'](_0x27ceba);}return _0x49d7d7[_0xfaa5('0x1a')](_0x27ceba)[_0xfaa5('0x1b')]();};}function respondWithResult(_0x461749,_0x5c2006){_0x5c2006=_0x5c2006||0xc8;return function(_0x13896b){if(_0x13896b){return _0x461749[_0xfaa5('0x1a')](_0x5c2006)[_0xfaa5('0x1c')](_0x13896b);}};}function respondWithFilteredResult(_0x1851ff,_0x146632){return function(_0x302024){if(_0x302024){var _0x4793a0=_0x302024[_0xfaa5('0x1d')],_0x5d0090=_0x146632[_0xfaa5('0x1e')],_0x217dc6=_0x146632[_0xfaa5('0x1e')]+_0x146632[_0xfaa5('0x1f')],_0x594957;if(_0x217dc6>=_0x4793a0){_0x217dc6=_0x4793a0;_0x594957=0xc8;}else{_0x594957=0xce;}_0x1851ff['status'](_0x594957);return _0x1851ff['set'](_0xfaa5('0x20'),_0x5d0090+'-'+_0x217dc6+'/'+_0x4793a0)[_0xfaa5('0x1c')](_0x302024);}return null;};}function patchUpdates(_0x4372d3){return function(_0x1a1f78){try{jsonpatch[_0xfaa5('0x21')](_0x1a1f78,_0x4372d3,!![]);}catch(_0x2f3374){return BPromise[_0xfaa5('0x22')](_0x2f3374);}return _0x1a1f78['save']();};}function saveUpdates(_0x991768,_0x3bb5a8){return function(_0x38f192){if(_0x38f192){return _0x38f192[_0xfaa5('0x23')](_0x991768)['then'](function(_0x3200b6){return _0x3200b6;});}return null;};}function removeEntity(_0x53a84b,_0xa41573){return function(_0x341321){if(_0x341321){return _0x341321[_0xfaa5('0x24')]()[_0xfaa5('0x25')](function(){_0x53a84b[_0xfaa5('0x1a')](0xcc)[_0xfaa5('0x1b')]();});}};}function handleEntityNotFound(_0x442528,_0x3c1275){return function(_0x517f4e){if(!_0x517f4e){_0x442528[_0xfaa5('0x26')](0x194);}return _0x517f4e;};}function handleError(_0x27767b,_0x3b048f){_0x3b048f=_0x3b048f||0x1f4;return function(_0x20f906){logger[_0xfaa5('0x27')](_0x20f906['stack']);if(_0x20f906[_0xfaa5('0x28')]){delete _0x20f906[_0xfaa5('0x28')];}_0x27767b[_0xfaa5('0x1a')](_0x3b048f)[_0xfaa5('0x29')](_0x20f906);};}exports['index']=function(_0x31cbaf,_0x689bb3){var _0x9bcbf1={},_0x2468f4={},_0x2ee283={'count':0x0,'rows':[]};var _0x32663d=_[_0xfaa5('0x2a')](db[_0xfaa5('0x2b')][_0xfaa5('0x2c')],function(_0x4cd6e4){return{'name':_0x4cd6e4[_0xfaa5('0x2d')],'type':_0x4cd6e4[_0xfaa5('0x2e')][_0xfaa5('0x2f')]};});_0x2468f4['model']=_[_0xfaa5('0x2a')](_0x32663d,_0xfaa5('0x28'));_0x2468f4[_0xfaa5('0x30')]=_[_0xfaa5('0x31')](_0x31cbaf[_0xfaa5('0x30')]);_0x2468f4['filters']=_['intersection'](_0x2468f4[_0xfaa5('0x32')],_0x2468f4[_0xfaa5('0x30')]);_0x9bcbf1['attributes']=_[_0xfaa5('0x33')](_0x2468f4[_0xfaa5('0x32')],qs[_0xfaa5('0x34')](_0x31cbaf[_0xfaa5('0x30')][_0xfaa5('0x34')]));_0x9bcbf1['attributes']=_0x9bcbf1[_0xfaa5('0x35')]['length']?_0x9bcbf1[_0xfaa5('0x35')]:_0x2468f4[_0xfaa5('0x32')];if(!_0x31cbaf[_0xfaa5('0x30')][_0xfaa5('0x36')](_0xfaa5('0x37'))){_0x9bcbf1[_0xfaa5('0x1f')]=qs[_0xfaa5('0x1f')](_0x31cbaf[_0xfaa5('0x30')][_0xfaa5('0x1f')]);_0x9bcbf1[_0xfaa5('0x1e')]=qs[_0xfaa5('0x1e')](_0x31cbaf['query'][_0xfaa5('0x1e')]);}_0x9bcbf1[_0xfaa5('0x38')]=qs[_0xfaa5('0x39')](_0x31cbaf[_0xfaa5('0x30')][_0xfaa5('0x39')]);_0x9bcbf1['where']=qs[_0xfaa5('0x3a')](_[_0xfaa5('0x3b')](_0x31cbaf[_0xfaa5('0x30')],_0x2468f4[_0xfaa5('0x3a')]),_0x32663d);if(_0x31cbaf['query'][_0xfaa5('0x3c')]){_0x9bcbf1[_0xfaa5('0x3d')]=_['merge'](_0x9bcbf1[_0xfaa5('0x3d')],{'$or':_[_0xfaa5('0x2a')](_0x32663d,function(_0x57ede){if(_0x57ede[_0xfaa5('0x2e')]!==_0xfaa5('0x3e')){var _0x57f8ae={};_0x57f8ae[_0x57ede['name']]={'$like':'%'+_0x31cbaf['query'][_0xfaa5('0x3c')]+'%'};return _0x57f8ae;}})});}_0x9bcbf1=_['merge']({},_0x9bcbf1,_0x31cbaf[_0xfaa5('0x3f')]);var _0x299759={'where':_0x9bcbf1[_0xfaa5('0x3d')]};return db[_0xfaa5('0x2b')]['count'](_0x299759)[_0xfaa5('0x25')](function(_0x3b38b3){_0x2ee283[_0xfaa5('0x1d')]=_0x3b38b3;if(_0x31cbaf[_0xfaa5('0x30')][_0xfaa5('0x40')]){_0x9bcbf1[_0xfaa5('0x41')]=[{'all':!![]}];}return db[_0xfaa5('0x2b')][_0xfaa5('0x42')](_0x9bcbf1);})[_0xfaa5('0x25')](function(_0x95f311){_0x2ee283[_0xfaa5('0x43')]=_0x95f311;return _0x2ee283;})[_0xfaa5('0x25')](respondWithFilteredResult(_0x689bb3,_0x9bcbf1))[_0xfaa5('0x44')](handleError(_0x689bb3,null));};exports[_0xfaa5('0x45')]=function(_0x3de5e1,_0x4b8740){var _0x3eef30={'raw':![],'where':{'id':_0x3de5e1['params']['id']}},_0x10fe2a={};_0x10fe2a[_0xfaa5('0x32')]=_[_0xfaa5('0x31')](db['UserProfileSection'][_0xfaa5('0x2c')]);_0x10fe2a[_0xfaa5('0x30')]=_[_0xfaa5('0x31')](_0x3de5e1[_0xfaa5('0x30')]);_0x10fe2a[_0xfaa5('0x3a')]=_[_0xfaa5('0x33')](_0x10fe2a[_0xfaa5('0x32')],_0x10fe2a[_0xfaa5('0x30')]);_0x3eef30[_0xfaa5('0x35')]=_[_0xfaa5('0x33')](_0x10fe2a[_0xfaa5('0x32')],qs[_0xfaa5('0x34')](_0x3de5e1[_0xfaa5('0x30')][_0xfaa5('0x34')]));_0x3eef30[_0xfaa5('0x35')]=_0x3eef30[_0xfaa5('0x35')][_0xfaa5('0x46')]?_0x3eef30[_0xfaa5('0x35')]:_0x10fe2a[_0xfaa5('0x32')];if(_0x3de5e1[_0xfaa5('0x30')][_0xfaa5('0x40')]){_0x3eef30['include']=[{'all':!![]}];}_0x3eef30=_[_0xfaa5('0x47')]({},_0x3eef30,_0x3de5e1[_0xfaa5('0x3f')]);return db[_0xfaa5('0x2b')][_0xfaa5('0x48')](_0x3eef30)[_0xfaa5('0x25')](handleEntityNotFound(_0x4b8740,null))[_0xfaa5('0x25')](respondWithResult(_0x4b8740,null))[_0xfaa5('0x44')](handleError(_0x4b8740,null));};exports['create']=function(_0x591a29,_0x222243){return db[_0xfaa5('0x2b')]['create'](_0x591a29[_0xfaa5('0x49')],{})[_0xfaa5('0x25')](respondWithResult(_0x222243,0xc9))[_0xfaa5('0x44')](handleError(_0x222243,null));};exports[_0xfaa5('0x23')]=function(_0x1f8536,_0x41ebd5){if(_0x1f8536['body']['id']){delete _0x1f8536[_0xfaa5('0x49')]['id'];}return db[_0xfaa5('0x2b')][_0xfaa5('0x48')]({'where':{'id':_0x1f8536[_0xfaa5('0x4a')]['id']}})[_0xfaa5('0x25')](handleEntityNotFound(_0x41ebd5,null))['then'](saveUpdates(_0x1f8536[_0xfaa5('0x49')],null))[_0xfaa5('0x25')](respondWithResult(_0x41ebd5,null))[_0xfaa5('0x44')](handleError(_0x41ebd5,null));};exports[_0xfaa5('0x24')]=function(_0x95f1bd,_0x503963){return db['UserProfileSection'][_0xfaa5('0x48')]({'where':{'id':_0x95f1bd[_0xfaa5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x503963,null))[_0xfaa5('0x25')](removeEntity(_0x503963,null))[_0xfaa5('0x44')](handleError(_0x503963,null));};exports[_0xfaa5('0x4b')]=function(_0x183273,_0x6e3d67){return db[_0xfaa5('0x2b')][_0xfaa5('0x4b')]()['then'](respondWithResult(_0x6e3d67,null))[_0xfaa5('0x44')](handleError(_0x6e3d67,null));}; \ No newline at end of file +var _0x66cf=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','create','body','find','params','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','to-csv'];(function(_0x6b685c,_0x110aa3){var _0x11155f=function(_0x1f535a){while(--_0x1f535a){_0x6b685c['push'](_0x6b685c['shift']());}};_0x11155f(++_0x110aa3);}(_0x66cf,0x1a2));var _0xf66c=function(_0x26bfe7,_0xe8886a){_0x26bfe7=_0x26bfe7-0x0;var _0x8d5d20=_0x66cf[_0x26bfe7];return _0x8d5d20;};'use strict';var pdf=require(_0xf66c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf66c('0x1'));var zipdir=require(_0xf66c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf66c('0x3'));var moment=require(_0xf66c('0x4'));var BPromise=require(_0xf66c('0x5'));var Mustache=require(_0xf66c('0x6'));var util=require(_0xf66c('0x7'));var path=require(_0xf66c('0x8'));var sox=require(_0xf66c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf66c('0xa'));var squel=require(_0xf66c('0xb'));var crypto=require(_0xf66c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf66c('0xd'));var querystring=require(_0xf66c('0xe'));var Papa=require('papaparse');var Redis=require(_0xf66c('0xf'));var authService=require(_0xf66c('0x10'));var qs=require(_0xf66c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf66c('0x12'))(_0xf66c('0x13'));var utils=require('../../config/utils');var config=require(_0xf66c('0x14'));var db=require(_0xf66c('0x15'))['db'];function respondWithStatusCode(_0x38a25f,_0x456cb9){_0x456cb9=_0x456cb9||0xcc;return function(_0x11d4ed){if(_0x11d4ed){return _0x38a25f[_0xf66c('0x16')](_0x456cb9);}return _0x38a25f[_0xf66c('0x17')](_0x456cb9)[_0xf66c('0x18')]();};}function respondWithResult(_0x10306d,_0x3a4bcb){_0x3a4bcb=_0x3a4bcb||0xc8;return function(_0x308fea){if(_0x308fea){return _0x10306d['status'](_0x3a4bcb)[_0xf66c('0x19')](_0x308fea);}};}function respondWithFilteredResult(_0x3c3d90,_0x480ca2){return function(_0xec645e){if(_0xec645e){var _0x2ab9b6=_0xec645e[_0xf66c('0x1a')],_0x475397=_0x480ca2['offset'],_0x18c6bb=_0x480ca2[_0xf66c('0x1b')]+_0x480ca2[_0xf66c('0x1c')],_0x3d48c9;if(_0x18c6bb>=_0x2ab9b6){_0x18c6bb=_0x2ab9b6;_0x3d48c9=0xc8;}else{_0x3d48c9=0xce;}_0x3c3d90[_0xf66c('0x17')](_0x3d48c9);return _0x3c3d90[_0xf66c('0x1d')](_0xf66c('0x1e'),_0x475397+'-'+_0x18c6bb+'/'+_0x2ab9b6)[_0xf66c('0x19')](_0xec645e);}return null;};}function patchUpdates(_0x1f45c6){return function(_0x29dfde){try{jsonpatch[_0xf66c('0x1f')](_0x29dfde,_0x1f45c6,!![]);}catch(_0x267414){return BPromise[_0xf66c('0x20')](_0x267414);}return _0x29dfde[_0xf66c('0x21')]();};}function saveUpdates(_0x11b9d9,_0xe55d7b){return function(_0x2c6c30){if(_0x2c6c30){return _0x2c6c30[_0xf66c('0x22')](_0x11b9d9)[_0xf66c('0x23')](function(_0x467dc1){return _0x467dc1;});}return null;};}function removeEntity(_0x438a87,_0x478761){return function(_0xccd389){if(_0xccd389){return _0xccd389[_0xf66c('0x24')]()[_0xf66c('0x23')](function(){_0x438a87['status'](0xcc)[_0xf66c('0x18')]();});}};}function handleEntityNotFound(_0x41852b,_0x37a16a){return function(_0xd16e48){if(!_0xd16e48){_0x41852b[_0xf66c('0x16')](0x194);}return _0xd16e48;};}function handleError(_0x1da1a2,_0x22ad16){_0x22ad16=_0x22ad16||0x1f4;return function(_0x1b956e){logger[_0xf66c('0x25')](_0x1b956e[_0xf66c('0x26')]);if(_0x1b956e[_0xf66c('0x27')]){delete _0x1b956e[_0xf66c('0x27')];}_0x1da1a2['status'](_0x22ad16)[_0xf66c('0x28')](_0x1b956e);};}exports[_0xf66c('0x29')]=function(_0x441ae7,_0x24c79e){var _0x488ce5={},_0x287681={},_0x384602={'count':0x0,'rows':[]};var _0x28ae2e=_[_0xf66c('0x2a')](db[_0xf66c('0x2b')][_0xf66c('0x2c')],function(_0x32b3b7){return{'name':_0x32b3b7['fieldName'],'type':_0x32b3b7[_0xf66c('0x2d')][_0xf66c('0x2e')]};});_0x287681[_0xf66c('0x2f')]=_[_0xf66c('0x2a')](_0x28ae2e,_0xf66c('0x27'));_0x287681[_0xf66c('0x30')]=_[_0xf66c('0x31')](_0x441ae7[_0xf66c('0x30')]);_0x287681[_0xf66c('0x32')]=_['intersection'](_0x287681[_0xf66c('0x2f')],_0x287681[_0xf66c('0x30')]);_0x488ce5[_0xf66c('0x33')]=_[_0xf66c('0x34')](_0x287681[_0xf66c('0x2f')],qs['fields'](_0x441ae7[_0xf66c('0x30')][_0xf66c('0x35')]));_0x488ce5[_0xf66c('0x33')]=_0x488ce5[_0xf66c('0x33')][_0xf66c('0x36')]?_0x488ce5['attributes']:_0x287681[_0xf66c('0x2f')];if(!_0x441ae7[_0xf66c('0x30')][_0xf66c('0x37')](_0xf66c('0x38'))){_0x488ce5[_0xf66c('0x1c')]=qs['limit'](_0x441ae7[_0xf66c('0x30')][_0xf66c('0x1c')]);_0x488ce5[_0xf66c('0x1b')]=qs[_0xf66c('0x1b')](_0x441ae7[_0xf66c('0x30')][_0xf66c('0x1b')]);}_0x488ce5['order']=qs[_0xf66c('0x39')](_0x441ae7[_0xf66c('0x30')]['sort']);_0x488ce5[_0xf66c('0x3a')]=qs['filters'](_[_0xf66c('0x3b')](_0x441ae7[_0xf66c('0x30')],_0x287681[_0xf66c('0x32')]),_0x28ae2e);if(_0x441ae7[_0xf66c('0x30')][_0xf66c('0x3c')]){_0x488ce5['where']=_[_0xf66c('0x3d')](_0x488ce5[_0xf66c('0x3a')],{'$or':_[_0xf66c('0x2a')](_0x28ae2e,function(_0xb79363){if(_0xb79363[_0xf66c('0x2d')]!==_0xf66c('0x3e')){var _0x54064f={};_0x54064f[_0xb79363[_0xf66c('0x27')]]={'$like':'%'+_0x441ae7[_0xf66c('0x30')][_0xf66c('0x3c')]+'%'};return _0x54064f;}})});}_0x488ce5=_[_0xf66c('0x3d')]({},_0x488ce5,_0x441ae7['options']);var _0xf1ee02={'where':_0x488ce5[_0xf66c('0x3a')]};return db[_0xf66c('0x2b')][_0xf66c('0x1a')](_0xf1ee02)[_0xf66c('0x23')](function(_0x18e9a0){_0x384602[_0xf66c('0x1a')]=_0x18e9a0;if(_0x441ae7['query']['includeAll']){_0x488ce5['include']=[{'all':!![]}];}return db[_0xf66c('0x2b')][_0xf66c('0x3f')](_0x488ce5);})[_0xf66c('0x23')](function(_0x55bb10){_0x384602[_0xf66c('0x40')]=_0x55bb10;return _0x384602;})[_0xf66c('0x23')](respondWithFilteredResult(_0x24c79e,_0x488ce5))[_0xf66c('0x41')](handleError(_0x24c79e,null));};exports[_0xf66c('0x42')]=function(_0x1006d3,_0x1586eb){var _0x7146e7={'raw':![],'where':{'id':_0x1006d3['params']['id']}},_0x558681={};_0x558681[_0xf66c('0x2f')]=_[_0xf66c('0x31')](db[_0xf66c('0x2b')][_0xf66c('0x2c')]);_0x558681[_0xf66c('0x30')]=_[_0xf66c('0x31')](_0x1006d3[_0xf66c('0x30')]);_0x558681[_0xf66c('0x32')]=_['intersection'](_0x558681['model'],_0x558681[_0xf66c('0x30')]);_0x7146e7[_0xf66c('0x33')]=_[_0xf66c('0x34')](_0x558681[_0xf66c('0x2f')],qs['fields'](_0x1006d3[_0xf66c('0x30')][_0xf66c('0x35')]));_0x7146e7[_0xf66c('0x33')]=_0x7146e7[_0xf66c('0x33')]['length']?_0x7146e7[_0xf66c('0x33')]:_0x558681[_0xf66c('0x2f')];if(_0x1006d3[_0xf66c('0x30')]['includeAll']){_0x7146e7['include']=[{'all':!![]}];}_0x7146e7=_[_0xf66c('0x3d')]({},_0x7146e7,_0x1006d3['options']);return db[_0xf66c('0x2b')]['find'](_0x7146e7)['then'](handleEntityNotFound(_0x1586eb,null))[_0xf66c('0x23')](respondWithResult(_0x1586eb,null))[_0xf66c('0x41')](handleError(_0x1586eb,null));};exports[_0xf66c('0x43')]=function(_0x116e98,_0xa8f1b0){return db[_0xf66c('0x2b')][_0xf66c('0x43')](_0x116e98[_0xf66c('0x44')],{})[_0xf66c('0x23')](respondWithResult(_0xa8f1b0,0xc9))['catch'](handleError(_0xa8f1b0,null));};exports['update']=function(_0x111ff9,_0x21a256){if(_0x111ff9['body']['id']){delete _0x111ff9[_0xf66c('0x44')]['id'];}return db[_0xf66c('0x2b')][_0xf66c('0x45')]({'where':{'id':_0x111ff9[_0xf66c('0x46')]['id']}})[_0xf66c('0x23')](handleEntityNotFound(_0x21a256,null))[_0xf66c('0x23')](saveUpdates(_0x111ff9['body'],null))[_0xf66c('0x23')](respondWithResult(_0x21a256,null))['catch'](handleError(_0x21a256,null));};exports[_0xf66c('0x24')]=function(_0x2ee976,_0x26d9f8){return db[_0xf66c('0x2b')][_0xf66c('0x45')]({'where':{'id':_0x2ee976[_0xf66c('0x46')]['id']}})[_0xf66c('0x23')](handleEntityNotFound(_0x26d9f8,null))[_0xf66c('0x23')](removeEntity(_0x26d9f8,null))[_0xf66c('0x41')](handleError(_0x26d9f8,null));};exports['describe']=function(_0x23176b,_0x47e208){return db[_0xf66c('0x2b')][_0xf66c('0x47')]()[_0xf66c('0x23')](respondWithResult(_0x47e208,null))[_0xf66c('0x41')](handleError(_0x47e208,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index f12a572..2566a4a 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 _0xa0d0=['./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','userProfileId','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0xa0d0,0x11a));var _0x0a0d=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xa0d0[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0x0a0d('0x0'));var util=require(_0x0a0d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0a0d('0x2'));var BPromise=require(_0x0a0d('0x3'));var rp=require(_0x0a0d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a0d('0x5'));var config=require('../../config/environment');var attributes=require(_0x0a0d('0x6'));module[_0x0a0d('0x7')]=function(_0x3ca259,_0x4906f0){return _0x3ca259[_0x0a0d('0x8')](_0x0a0d('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x0a0d('0xa'),'fields':['sectionId',_0x0a0d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc277=['api','moment','bluebird','request-promise','rimraf','./userProfileSection.attributes','exports','user_profile_has_sections','compositeIndex','sectionId','lodash','util'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc277,0x1de));var _0x7c27=function(_0x2c19da,_0xea36b1){_0x2c19da=_0x2c19da-0x0;var _0x5a43fd=_0xc277[_0x2c19da];return _0x5a43fd;};'use strict';var _=require(_0x7c27('0x0'));var util=require(_0x7c27('0x1'));var logger=require('../../config/logger')(_0x7c27('0x2'));var moment=require(_0x7c27('0x3'));var BPromise=require(_0x7c27('0x4'));var rp=require(_0x7c27('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7c27('0x6'));var config=require('../../config/environment');var attributes=require(_0x7c27('0x7'));module[_0x7c27('0x8')]=function(_0x2a9d68,_0x5a72b8){return _0x2a9d68['define']('UserProfileSection',attributes,{'tableName':_0x7c27('0x9'),'paranoid':![],'indexes':[{'name':_0x7c27('0xa'),'fields':[_0x7c27('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index ae361c5..9ca27cc 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 _0x8875=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x30a347,_0x4c8e32){var _0x301d51=function(_0x4767d7){while(--_0x4767d7){_0x30a347['push'](_0x30a347['shift']());}};_0x301d51(++_0x4c8e32);}(_0x8875,0xf3));var _0x5887=function(_0x38b958,_0x3a30af){_0x38b958=_0x38b958-0x0;var _0x3173d1=_0x8875[_0x38b958];return _0x3173d1;};'use strict';var _=require(_0x5887('0x0'));var util=require(_0x5887('0x1'));var moment=require(_0x5887('0x2'));var BPromise=require(_0x5887('0x3'));var rs=require(_0x5887('0x4'));var fs=require('fs');var Redis=require(_0x5887('0x5'));var db=require(_0x5887('0x6'))['db'];var utils=require(_0x5887('0x7'));var logger=require(_0x5887('0x8'))(_0x5887('0x9'));var config=require('../../config/environment');var jayson=require(_0x5887('0xa'));var client=jayson[_0x5887('0xb')][_0x5887('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2935f0,_0x41f73d,_0x2d96e5){return new BPromise(function(_0x534443,_0x34b5f6){return client[_0x5887('0xd')](_0x2935f0,_0x2d96e5)['then'](function(_0x2ca2f6){logger[_0x5887('0xe')](_0x5887('0xf'),_0x41f73d,_0x5887('0x10'));logger[_0x5887('0x11')](_0x5887('0x12'),_0x41f73d,'request\x20sent',JSON[_0x5887('0x13')](_0x2ca2f6));if(_0x2ca2f6['error']){if(_0x2ca2f6[_0x5887('0x14')][_0x5887('0x15')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x41f73d,_0x2ca2f6[_0x5887('0x14')][_0x5887('0x16')]);return _0x34b5f6(_0x2ca2f6[_0x5887('0x14')]['message']);}logger[_0x5887('0x14')](_0x5887('0xf'),_0x41f73d,_0x2ca2f6['error'][_0x5887('0x16')]);return _0x534443(_0x2ca2f6[_0x5887('0x14')][_0x5887('0x16')]);}else{logger[_0x5887('0xe')](_0x5887('0xf'),_0x41f73d,_0x5887('0x10'));_0x534443(_0x2ca2f6[_0x5887('0x17')][_0x5887('0x16')]);}})[_0x5887('0x18')](function(_0x27fbcb){logger[_0x5887('0x14')]('UserProfileSection,\x20%s,\x20%s',_0x41f73d,_0x27fbcb);_0x34b5f6(_0x27fbcb);});});} \ No newline at end of file +var _0x6a39=['rpc','../../config/environment','jayson/promise','http','request','then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x16068b,_0x3c2737){var _0x55fa62=function(_0x15bdc5){while(--_0x15bdc5){_0x16068b['push'](_0x16068b['shift']());}};_0x55fa62(++_0x3c2737);}(_0x6a39,0x7c));var _0x96a3=function(_0x104c7a,_0x219911){_0x104c7a=_0x104c7a-0x0;var _0x2a7492=_0x6a39[_0x104c7a];return _0x2a7492;};'use strict';var _=require(_0x96a3('0x0'));var util=require(_0x96a3('0x1'));var moment=require(_0x96a3('0x2'));var BPromise=require(_0x96a3('0x3'));var rs=require(_0x96a3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96a3('0x5'))['db'];var utils=require(_0x96a3('0x6'));var logger=require(_0x96a3('0x7'))(_0x96a3('0x8'));var config=require(_0x96a3('0x9'));var jayson=require(_0x96a3('0xa'));var client=jayson['client'][_0x96a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb0857f,_0x154512,_0x48046e){return new BPromise(function(_0x279469,_0x5b5034){return client[_0x96a3('0xc')](_0xb0857f,_0x48046e)[_0x96a3('0xd')](function(_0x20cf5c){logger['info'](_0x96a3('0xe'),_0x154512,_0x96a3('0xf'));logger[_0x96a3('0x10')](_0x96a3('0x11'),_0x154512,_0x96a3('0xf'),JSON[_0x96a3('0x12')](_0x20cf5c));if(_0x20cf5c['error']){if(_0x20cf5c[_0x96a3('0x13')][_0x96a3('0x14')]===0x1f4){logger['error'](_0x96a3('0xe'),_0x154512,_0x20cf5c['error'][_0x96a3('0x15')]);return _0x5b5034(_0x20cf5c[_0x96a3('0x13')][_0x96a3('0x15')]);}logger[_0x96a3('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x154512,_0x20cf5c[_0x96a3('0x13')][_0x96a3('0x15')]);return _0x279469(_0x20cf5c[_0x96a3('0x13')][_0x96a3('0x15')]);}else{logger['info'](_0x96a3('0xe'),_0x154512,_0x96a3('0xf'));_0x279469(_0x20cf5c['result'][_0x96a3('0x15')]);}})['catch'](function(_0x595a25){logger['error'](_0x96a3('0xe'),_0x154512,_0x595a25);_0x5b5034(_0x595a25);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 45f3859..8ca3d05 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 _0xc474=['../../config/environment','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x57fb0c,_0x565e4e){var _0x42dfdf=function(_0x3c9a67){while(--_0x3c9a67){_0x57fb0c['push'](_0x57fb0c['shift']());}};_0x42dfdf(++_0x565e4e);}(_0xc474,0x92));var _0x4c47=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc474[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x4c47('0x0'));var path=require(_0x4c47('0x1'));var timeout=require(_0x4c47('0x2'));var express=require(_0x4c47('0x3'));var router=express['Router']();var auth=require(_0x4c47('0x4'));var interaction=require(_0x4c47('0x5'));var config=require(_0x4c47('0x6'));module[_0x4c47('0x7')]=router; \ No newline at end of file +var _0xe706=['util','connect-timeout','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0x110d59,_0x50c4fb){var _0x2fce64=function(_0xc1dcd8){while(--_0xc1dcd8){_0x110d59['push'](_0x110d59['shift']());}};_0x2fce64(++_0x50c4fb);}(_0xe706,0xc6));var _0x6e70=function(_0x4824c1,_0x2657fa){_0x4824c1=_0x4824c1-0x0;var _0x7cd05a=_0xe706[_0x4824c1];return _0x7cd05a;};'use strict';var multer=require('multer');var util=require(_0x6e70('0x0'));var path=require('path');var timeout=require(_0x6e70('0x1'));var express=require('express');var router=express[_0x6e70('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));module[_0x6e70('0x5')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 8d90b1c..fcb100b 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x330a96,_0x5dd03b){var _0x3b92e1=function(_0x46ccf5){while(--_0x46ccf5){_0x330a96['push'](_0x330a96['shift']());}};_0x3b92e1(++_0x5dd03b);}(_0xe706,0xa3));var _0x6e70=function(_0x19cee7,_0x562ecb){_0x19cee7=_0x19cee7-0x0;var _0x45657b=_0xe706[_0x19cee7];return _0x45657b;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x1ec8f9,_0x22f5e7){var _0x17cd3d=function(_0x156ad2){while(--_0x156ad2){_0x1ec8f9['push'](_0x1ec8f9['shift']());}};_0x17cd3d(++_0x22f5e7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index cc4306d..1658230 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 _0x4058=['api','moment','bluebird','request-promise','path','rimraf','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x4058,0x129));var _0x8405=function(_0x133185,_0x4e339b){_0x133185=_0x133185-0x0;var _0x2cb7c2=_0x4058[_0x133185];return _0x2cb7c2;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var logger=require(_0x8405('0x2'))(_0x8405('0x3'));var moment=require(_0x8405('0x4'));var BPromise=require(_0x8405('0x5'));var rp=require(_0x8405('0x6'));var fs=require('fs');var path=require(_0x8405('0x7'));var rimraf=require(_0x8405('0x8'));var config=require('../../config/environment');var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x1db7ea,_0x257d43){return _0x1db7ea[_0x8405('0x9')](_0x8405('0xa'),attributes,{'tableName':_0x8405('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd5f=['./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment'];(function(_0x2a4c89,_0x3a9b21){var _0x33810b=function(_0x39dfa6){while(--_0x39dfa6){_0x2a4c89['push'](_0x2a4c89['shift']());}};_0x33810b(++_0x3a9b21);}(_0xbd5f,0x1c7));var _0xfbd5=function(_0x140332,_0x102a44){_0x140332=_0x140332-0x0;var _0x2d14f=_0xbd5f[_0x140332];return _0x2d14f;};'use strict';var _=require(_0xfbd5('0x0'));var util=require(_0xfbd5('0x1'));var logger=require(_0xfbd5('0x2'))('api');var moment=require(_0xfbd5('0x3'));var BPromise=require('bluebird');var rp=require(_0xfbd5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbd5('0x5'));var config=require(_0xfbd5('0x6'));var attributes=require(_0xfbd5('0x7'));module[_0xfbd5('0x8')]=function(_0x26f5ea,_0x9df06e){return _0x26f5ea[_0xfbd5('0x9')]('UserSmsQueue',attributes,{'tableName':_0xfbd5('0xa'),'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 aa83088..b394c03 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 _0x0486=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x30e1da,_0x3fd998){var _0x1533bc=function(_0x2b7668){while(--_0x2b7668){_0x30e1da['push'](_0x30e1da['shift']());}};_0x1533bc(++_0x3fd998);}(_0x0486,0x118));var _0x6048=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x0486[_0x2a0738];return _0x159679;};'use strict';var _=require(_0x6048('0x0'));var util=require(_0x6048('0x1'));var moment=require(_0x6048('0x2'));var BPromise=require(_0x6048('0x3'));var rs=require(_0x6048('0x4'));var fs=require('fs');var Redis=require(_0x6048('0x5'));var db=require(_0x6048('0x6'))['db'];var utils=require(_0x6048('0x7'));var logger=require('../../config/logger')(_0x6048('0x8'));var config=require('../../config/environment');var jayson=require(_0x6048('0x9'));var client=jayson[_0x6048('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x584320,_0x4ffbea,_0x290c51){return new BPromise(function(_0x35711b,_0x5a17e4){return client[_0x6048('0xb')](_0x584320,_0x290c51)[_0x6048('0xc')](function(_0xb3969e){logger[_0x6048('0xd')](_0x6048('0xe'),_0x4ffbea,_0x6048('0xf'));logger[_0x6048('0x10')](_0x6048('0x11'),_0x4ffbea,_0x6048('0xf'),JSON[_0x6048('0x12')](_0xb3969e));if(_0xb3969e[_0x6048('0x13')]){if(_0xb3969e[_0x6048('0x13')]['code']===0x1f4){logger[_0x6048('0x13')](_0x6048('0xe'),_0x4ffbea,_0xb3969e[_0x6048('0x13')][_0x6048('0x14')]);return _0x5a17e4(_0xb3969e['error'][_0x6048('0x14')]);}logger[_0x6048('0x13')](_0x6048('0xe'),_0x4ffbea,_0xb3969e[_0x6048('0x13')][_0x6048('0x14')]);return _0x35711b(_0xb3969e[_0x6048('0x13')][_0x6048('0x14')]);}else{logger[_0x6048('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x4ffbea,_0x6048('0xf'));_0x35711b(_0xb3969e[_0x6048('0x15')][_0x6048('0x14')]);}})['catch'](function(_0x1fdc32){logger[_0x6048('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x4ffbea,_0x1fdc32);_0x5a17e4(_0x1fdc32);});});} \ No newline at end of file +var _0x0cb1=['catch','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x386c3e,_0x44a375){var _0x4b8e13=function(_0x583c8f){while(--_0x583c8f){_0x386c3e['push'](_0x386c3e['shift']());}};_0x4b8e13(++_0x44a375);}(_0x0cb1,0x1aa));var _0x10cb=function(_0x56817e,_0x56643b){_0x56817e=_0x56817e-0x0;var _0x4fecef=_0x0cb1[_0x56817e];return _0x4fecef;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x10cb('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x10cb('0x1'))['db'];var utils=require(_0x10cb('0x2'));var logger=require(_0x10cb('0x3'))(_0x10cb('0x4'));var config=require('../../config/environment');var jayson=require(_0x10cb('0x5'));var client=jayson['client'][_0x10cb('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1a5643,_0x3b5d3d,_0x34968a){return new BPromise(function(_0x4d5464,_0x1c9143){return client['request'](_0x1a5643,_0x34968a)[_0x10cb('0x7')](function(_0xf88214){logger[_0x10cb('0x8')](_0x10cb('0x9'),_0x3b5d3d,_0x10cb('0xa'));logger[_0x10cb('0xb')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x3b5d3d,_0x10cb('0xa'),JSON[_0x10cb('0xc')](_0xf88214));if(_0xf88214[_0x10cb('0xd')]){if(_0xf88214['error']['code']===0x1f4){logger[_0x10cb('0xd')](_0x10cb('0x9'),_0x3b5d3d,_0xf88214['error']['message']);return _0x1c9143(_0xf88214[_0x10cb('0xd')][_0x10cb('0xe')]);}logger['error'](_0x10cb('0x9'),_0x3b5d3d,_0xf88214[_0x10cb('0xd')][_0x10cb('0xe')]);return _0x4d5464(_0xf88214[_0x10cb('0xd')]['message']);}else{logger[_0x10cb('0x8')](_0x10cb('0x9'),_0x3b5d3d,_0x10cb('0xa'));_0x4d5464(_0xf88214[_0x10cb('0xf')][_0x10cb('0xe')]);}})[_0x10cb('0x10')](function(_0x2a22d2){logger[_0x10cb('0xd')](_0x10cb('0x9'),_0x3b5d3d,_0x2a22d2);_0x1c9143(_0x2a22d2);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 620e93d..7660ec8 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 _0x9f96=['exports','multer','util','path','Router','../../components/auth/service','../../config/environment'];(function(_0x48926a,_0x46560d){var _0x30e9fd=function(_0x1de5a7){while(--_0x1de5a7){_0x48926a['push'](_0x48926a['shift']());}};_0x30e9fd(++_0x46560d);}(_0x9f96,0xef));var _0x69f9=function(_0x129f77,_0x26b8fe){_0x129f77=_0x129f77-0x0;var _0x2fb0f5=_0x9f96[_0x129f77];return _0x2fb0f5;};'use strict';var multer=require(_0x69f9('0x0'));var util=require(_0x69f9('0x1'));var path=require(_0x69f9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x69f9('0x3')]();var auth=require(_0x69f9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x69f9('0x5'));module[_0x69f9('0x6')]=router; \ No newline at end of file +var _0x51e2=['../../config/environment','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x51e2,0x1cd));var _0x251e=function(_0x5cfd70,_0x24b0a5){_0x5cfd70=_0x5cfd70-0x0;var _0xd18e56=_0x51e2[_0x5cfd70];return _0xd18e56;};'use strict';var multer=require(_0x251e('0x0'));var util=require(_0x251e('0x1'));var path=require(_0x251e('0x2'));var timeout=require(_0x251e('0x3'));var express=require('express');var router=express[_0x251e('0x4')]();var auth=require(_0x251e('0x5'));var interaction=require(_0x251e('0x6'));var config=require(_0x251e('0x7'));module[_0x251e('0x8')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 8a6b40f..ec63ae5 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 _0xd8b0=['exports','sequelize'];(function(_0x52195d,_0x52e4fd){var _0x522e83=function(_0x373a6c){while(--_0x373a6c){_0x52195d['push'](_0x52195d['shift']());}};_0x522e83(++_0x52e4fd);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x5b3089,_0x35c6ec){var _0x1d8fc4=function(_0xec86ce){while(--_0xec86ce){_0x5b3089['push'](_0x5b3089['shift']());}};_0x1d8fc4(++_0x35c6ec);}(_0xe706,0xa3));var _0x6e70=function(_0xd25b59,_0x217f8a){_0xd25b59=_0xd25b59-0x0;var _0x4cab47=_0xe706[_0xd25b59];return _0x4cab47;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'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 ae278c9..70116a2 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 _0xd32d=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x536c66,_0x570b6b){var _0x221d57=function(_0x34af51){while(--_0x34af51){_0x536c66['push'](_0x536c66['shift']());}};_0x221d57(++_0x570b6b);}(_0xd32d,0x10e));var _0xdd32=function(_0x242092,_0x386e4d){_0x242092=_0x242092-0x0;var _0x42f9f5=_0xd32d[_0x242092];return _0x42f9f5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdd32('0x0'))(_0xdd32('0x1'));var moment=require(_0xdd32('0x2'));var BPromise=require(_0xdd32('0x3'));var rp=require(_0xdd32('0x4'));var fs=require('fs');var path=require(_0xdd32('0x5'));var rimraf=require(_0xdd32('0x6'));var config=require(_0xdd32('0x7'));var attributes=require(_0xdd32('0x8'));module[_0xdd32('0x9')]=function(_0x2a757a,_0x241aad){return _0x2a757a[_0xdd32('0xa')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b4f=['bluebird','request-promise','path','../../config/environment','./userVoiceQueue.attributes','define','user_has_voice_queues','util','../../config/logger','api','moment'];(function(_0x508cb3,_0x56020f){var _0x46a824=function(_0x427a63){while(--_0x427a63){_0x508cb3['push'](_0x508cb3['shift']());}};_0x46a824(++_0x56020f);}(_0x8b4f,0x17d));var _0xf8b4=function(_0x51b698,_0x2fd161){_0x51b698=_0x51b698-0x0;var _0xfa0590=_0x8b4f[_0x51b698];return _0xfa0590;};'use strict';var _=require('lodash');var util=require(_0xf8b4('0x0'));var logger=require(_0xf8b4('0x1'))(_0xf8b4('0x2'));var moment=require(_0xf8b4('0x3'));var BPromise=require(_0xf8b4('0x4'));var rp=require(_0xf8b4('0x5'));var fs=require('fs');var path=require(_0xf8b4('0x6'));var rimraf=require('rimraf');var config=require(_0xf8b4('0x7'));var attributes=require(_0xf8b4('0x8'));module['exports']=function(_0x53f82c,_0x5935e9){return _0x53f82c[_0xf8b4('0x9')]('UserVoiceQueue',attributes,{'tableName':_0xf8b4('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 0094840..1679dc2 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 _0x83c5=['error','code','message','UserVoiceQueue,\x20%s,\x20%s','catch','lodash','util','moment','../../mysqldb','client','http','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x83c5,0x1f2));var _0x583c=function(_0x317489,_0x4a8108){_0x317489=_0x317489-0x0;var _0x169ab9=_0x83c5[_0x317489];return _0x169ab9;};'use strict';var _=require(_0x583c('0x0'));var util=require(_0x583c('0x1'));var moment=require(_0x583c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x583c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x583c('0x4')][_0x583c('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x3395e7,_0x197e65,_0x390a1d){return new BPromise(function(_0x5c6ac1,_0x2b87d9){return client['request'](_0x3395e7,_0x390a1d)[_0x583c('0x6')](function(_0x411d98){logger[_0x583c('0x7')]('UserVoiceQueue,\x20%s,\x20%s',_0x197e65,_0x583c('0x8'));logger[_0x583c('0x9')](_0x583c('0xa'),_0x197e65,_0x583c('0x8'),JSON[_0x583c('0xb')](_0x411d98));if(_0x411d98[_0x583c('0xc')]){if(_0x411d98['error'][_0x583c('0xd')]===0x1f4){logger[_0x583c('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x197e65,_0x411d98[_0x583c('0xc')][_0x583c('0xe')]);return _0x2b87d9(_0x411d98[_0x583c('0xc')][_0x583c('0xe')]);}logger[_0x583c('0xc')](_0x583c('0xf'),_0x197e65,_0x411d98['error'][_0x583c('0xe')]);return _0x5c6ac1(_0x411d98[_0x583c('0xc')]['message']);}else{logger['info'](_0x583c('0xf'),_0x197e65,_0x583c('0x8'));_0x5c6ac1(_0x411d98['result'][_0x583c('0xe')]);}})[_0x583c('0x10')](function(_0x4e1e91){logger[_0x583c('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x197e65,_0x4e1e91);_0x2b87d9(_0x4e1e91);});});} \ No newline at end of file +var _0x5cc1=['request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x5bd754,_0x5f1fab){var _0x445258=function(_0x4cd34c){while(--_0x4cd34c){_0x5bd754['push'](_0x5bd754['shift']());}};_0x445258(++_0x5f1fab);}(_0x5cc1,0x197));var _0x15cc=function(_0x127459,_0x5c293f){_0x127459=_0x127459-0x0;var _0x104eda=_0x5cc1[_0x127459];return _0x104eda;};'use strict';var _=require(_0x15cc('0x0'));var util=require(_0x15cc('0x1'));var moment=require('moment');var BPromise=require(_0x15cc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x15cc('0x3'))['db'];var utils=require(_0x15cc('0x4'));var logger=require(_0x15cc('0x5'))(_0x15cc('0x6'));var config=require(_0x15cc('0x7'));var jayson=require(_0x15cc('0x8'));var client=jayson['client'][_0x15cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x348db1,_0x1b194d,_0x2d9ccb){return new BPromise(function(_0x59d815,_0x29e6ea){return client[_0x15cc('0xa')](_0x348db1,_0x2d9ccb)['then'](function(_0xdff544){logger[_0x15cc('0xb')](_0x15cc('0xc'),_0x1b194d,_0x15cc('0xd'));logger[_0x15cc('0xe')](_0x15cc('0xf'),_0x1b194d,_0x15cc('0xd'),JSON[_0x15cc('0x10')](_0xdff544));if(_0xdff544['error']){if(_0xdff544[_0x15cc('0x11')][_0x15cc('0x12')]===0x1f4){logger[_0x15cc('0x11')](_0x15cc('0xc'),_0x1b194d,_0xdff544[_0x15cc('0x11')]['message']);return _0x29e6ea(_0xdff544[_0x15cc('0x11')][_0x15cc('0x13')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x1b194d,_0xdff544[_0x15cc('0x11')][_0x15cc('0x13')]);return _0x59d815(_0xdff544[_0x15cc('0x11')][_0x15cc('0x13')]);}else{logger[_0x15cc('0xb')]('UserVoiceQueue,\x20%s,\x20%s',_0x1b194d,_0x15cc('0xd'));_0x59d815(_0xdff544['result'][_0x15cc('0x13')]);}})['catch'](function(_0x245087){logger[_0x15cc('0x11')](_0x15cc('0xc'),_0x1b194d,_0x245087);_0x29e6ea(_0x245087);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 1ba20f2..dbfdfc2 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 _0x8b9f=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xd3f3cd,_0x511b4d){var _0x2a9d12=function(_0x32c074){while(--_0x32c074){_0xd3f3cd['push'](_0xd3f3cd['shift']());}};_0x2a9d12(++_0x511b4d);}(_0x8b9f,0xa1));var _0xf8b9=function(_0x21fc07,_0x16c1c4){_0x21fc07=_0x21fc07-0x0;var _0x16ead9=_0x8b9f[_0x21fc07];return _0x16ead9;};'use strict';var multer=require(_0xf8b9('0x0'));var util=require(_0xf8b9('0x1'));var path=require('path');var timeout=require(_0xf8b9('0x2'));var express=require(_0xf8b9('0x3'));var router=express[_0xf8b9('0x4')]();var auth=require(_0xf8b9('0x5'));var interaction=require(_0xf8b9('0x6'));var config=require('../../config/environment');module[_0xf8b9('0x7')]=router; \ No newline at end of file +var _0x0a38=['../../components/interaction/service','exports','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x0a38,0x18a));var _0x80a3=function(_0x193be1,_0x3d6b28){_0x193be1=_0x193be1-0x0;var _0x1b2dfd=_0x0a38[_0x193be1];return _0x1b2dfd;};'use strict';var multer=require('multer');var util=require(_0x80a3('0x0'));var path=require(_0x80a3('0x1'));var timeout=require(_0x80a3('0x2'));var express=require('express');var router=express[_0x80a3('0x3')]();var auth=require(_0x80a3('0x4'));var interaction=require(_0x80a3('0x5'));var config=require('../../config/environment');module[_0x80a3('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 131189f..39d7af8 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 _0x5988=['sequelize','INTEGER','Required\x20by\x20Asterisk','queue_interface','STRING'];(function(_0x2fbb8d,_0xb1c72e){var _0x36ee8d=function(_0x1cc9d0){while(--_0x1cc9d0){_0x2fbb8d['push'](_0x2fbb8d['shift']());}};_0x36ee8d(++_0xb1c72e);}(_0x5988,0xaa));var _0x8598=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5988[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x8598('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x8598('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x8598('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x8598('0x2')},'UserId':{'type':Sequelize[_0x8598('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8598('0x3'),'comment':_0x8598('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x8598('0x4')],'allowNull':![],'unique':_0x8598('0x3'),'comment':_0x8598('0x2')},'penalty':{'type':Sequelize[_0x8598('0x1')](0xb),'defaultValue':0x0,'comment':_0x8598('0x2')},'paused':{'type':Sequelize[_0x8598('0x1')](0xb),'defaultValue':0x0,'comment':_0x8598('0x2')}}; \ No newline at end of file +var _0x7de1=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x7de1,0x139));var _0x17de=function(_0x36c6eb,_0x4fb127){_0x36c6eb=_0x36c6eb-0x0;var _0x30675b=_0x7de1[_0x36c6eb];return _0x30675b;};'use strict';var Sequelize=require(_0x17de('0x0'));module[_0x17de('0x1')]={'uniqueid':{'type':Sequelize[_0x17de('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x17de('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x17de('0x3')},'UserId':{'type':Sequelize[_0x17de('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x17de('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x17de('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x17de('0x4')],'allowNull':![],'unique':_0x17de('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x17de('0x2')](0xb),'defaultValue':0x0,'comment':_0x17de('0x3')},'paused':{'type':Sequelize[_0x17de('0x2')](0xb),'defaultValue':0x0,'comment':_0x17de('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 701efdb..572b7a9 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 _0xa6fb=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x22c470,_0x373fcb){var _0x54f923=function(_0x1a999d){while(--_0x1a999d){_0x22c470['push'](_0x22c470['shift']());}};_0x54f923(++_0x373fcb);}(_0xa6fb,0xcf));var _0xba6f=function(_0x1eeed5,_0x555729){_0x1eeed5=_0x1eeed5-0x0;var _0x4469c4=_0xa6fb[_0x1eeed5];return _0x4469c4;};'use strict';var EventEmitter=require(_0xba6f('0x0'));var UserVoiceQueueRt=require(_0xba6f('0x1'))['db'][_0xba6f('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xba6f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xba6f('0x4'),'afterDestroy':_0xba6f('0x5')};function emitEvent(_0x463d7e){return function(_0x3b9d74,_0x2962f2,_0x400dad){UserVoiceQueueRtEvents[_0xba6f('0x6')](_0x463d7e+':'+_0x3b9d74['id'],_0x3b9d74);UserVoiceQueueRtEvents['emit'](_0x463d7e,_0x3b9d74);_0x400dad(null);};}for(var e in events){if(events[_0xba6f('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xba6f('0x8')](e,emitEvent(event));}}module[_0xba6f('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xf8ea=['setMaxListeners','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x1cc48b,_0x12a4ef){var _0x44f17b=function(_0x5712b7){while(--_0x5712b7){_0x1cc48b['push'](_0x1cc48b['shift']());}};_0x44f17b(++_0x12a4ef);}(_0xf8ea,0x1c8));var _0xaf8e=function(_0xe8ddbd,_0x5d5b53){_0xe8ddbd=_0xe8ddbd-0x0;var _0x1154a3=_0xf8ea[_0xe8ddbd];return _0x1154a3;};'use strict';var EventEmitter=require(_0xaf8e('0x0'));var UserVoiceQueueRt=require(_0xaf8e('0x1'))['db'][_0xaf8e('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xaf8e('0x3')](0x0);var events={'afterCreate':_0xaf8e('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xec70dc){return function(_0x156366,_0x2e0802,_0x28f6b3){UserVoiceQueueRtEvents[_0xaf8e('0x5')](_0xec70dc+':'+_0x156366['id'],_0x156366);UserVoiceQueueRtEvents[_0xaf8e('0x5')](_0xec70dc,_0x156366);_0x28f6b3(null);};}for(var e in events){if(events[_0xaf8e('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0xaf8e('0x7')](e,emitEvent(event));}}module[_0xaf8e('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 65d8605..906bca5 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 _0x76b7=['./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xe5b349,_0x5f06e4){var _0x26b0ad=function(_0x1a97f1){while(--_0x1a97f1){_0xe5b349['push'](_0xe5b349['shift']());}};_0x26b0ad(++_0x5f06e4);}(_0x76b7,0x15f));var _0x776b=function(_0x54bdac,_0xbf9bbd){_0x54bdac=_0x54bdac-0x0;var _0x5d1da1=_0x76b7[_0x54bdac];return _0x5d1da1;};'use strict';var _=require(_0x776b('0x0'));var util=require(_0x776b('0x1'));var logger=require(_0x776b('0x2'))(_0x776b('0x3'));var moment=require(_0x776b('0x4'));var BPromise=require(_0x776b('0x5'));var rp=require(_0x776b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x776b('0x7'));var config=require(_0x776b('0x8'));var attributes=require(_0x776b('0x9'));module[_0x776b('0xa')]=function(_0x4aa3af,_0x30be7b){return _0x4aa3af['define'](_0x776b('0xb'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa6ba=['path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','lodash','util','api'];(function(_0x468837,_0x5f0a68){var _0x7c161e=function(_0x340946){while(--_0x340946){_0x468837['push'](_0x468837['shift']());}};_0x7c161e(++_0x5f0a68);}(_0xa6ba,0x1ab));var _0xaa6b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa6ba[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xaa6b('0x0'));var util=require(_0xaa6b('0x1'));var logger=require('../../config/logger')(_0xaa6b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa6b('0x3'));var rimraf=require(_0xaa6b('0x4'));var config=require(_0xaa6b('0x5'));var attributes=require(_0xaa6b('0x6'));module[_0xaa6b('0x7')]=function(_0x3121fa,_0x5971f8){return _0x3121fa[_0xaa6b('0x8')](_0xaa6b('0x9'),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 d05d066..89b1fde 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 _0xd17b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','lodash','util','moment','bluebird'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xd17b,0x15b));var _0xbd17=function(_0x4b174a,_0x33a017){_0x4b174a=_0x4b174a-0x0;var _0x3cd7bf=_0xd17b[_0x4b174a];return _0x3cd7bf;};'use strict';var _=require(_0xbd17('0x0'));var util=require(_0xbd17('0x1'));var moment=require(_0xbd17('0x2'));var BPromise=require(_0xbd17('0x3'));var rs=require(_0xbd17('0x4'));var fs=require('fs');var Redis=require(_0xbd17('0x5'));var db=require(_0xbd17('0x6'))['db'];var utils=require(_0xbd17('0x7'));var logger=require(_0xbd17('0x8'))(_0xbd17('0x9'));var config=require('../../config/environment');var jayson=require(_0xbd17('0xa'));var client=jayson[_0xbd17('0xb')][_0xbd17('0xc')]({'port':0x232a});config[_0xbd17('0xd')]=_[_0xbd17('0xe')](config[_0xbd17('0xd')],{'host':_0xbd17('0xf'),'port':0x18eb});var socket=require(_0xbd17('0x10'))(new Redis(config[_0xbd17('0xd')]));require('./userVoiceQueueRt.socket')[_0xbd17('0x11')](socket);function respondWithRpcPromise(_0x1e5dce,_0x19df95,_0x436820){return new BPromise(function(_0x4f13ed,_0x207fee){return client[_0xbd17('0x12')](_0x1e5dce,_0x436820)[_0xbd17('0x13')](function(_0x1448f6){logger[_0xbd17('0x14')](_0xbd17('0x15'),_0x19df95,_0xbd17('0x16'));logger[_0xbd17('0x17')](_0xbd17('0x18'),_0x19df95,_0xbd17('0x16'),JSON[_0xbd17('0x19')](_0x1448f6));if(_0x1448f6[_0xbd17('0x1a')]){if(_0x1448f6[_0xbd17('0x1a')][_0xbd17('0x1b')]===0x1f4){logger['error'](_0xbd17('0x15'),_0x19df95,_0x1448f6[_0xbd17('0x1a')][_0xbd17('0x1c')]);return _0x207fee(_0x1448f6[_0xbd17('0x1a')][_0xbd17('0x1c')]);}logger[_0xbd17('0x1a')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x19df95,_0x1448f6[_0xbd17('0x1a')][_0xbd17('0x1c')]);return _0x4f13ed(_0x1448f6['error'][_0xbd17('0x1c')]);}else{logger['info'](_0xbd17('0x15'),_0x19df95,_0xbd17('0x16'));_0x4f13ed(_0x1448f6[_0xbd17('0x1d')][_0xbd17('0x1c')]);}})[_0xbd17('0x1e')](function(_0x338ee2){logger[_0xbd17('0x1a')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x19df95,_0x338ee2);_0x207fee(_0x338ee2);});});}exports[_0xbd17('0x1f')]=function(_0x516caa){var _0x465df0=this;return new Promise(function(_0x1e986f,_0x3cda7a){return db[_0xbd17('0x20')][_0xbd17('0x21')]({'raw':_0x516caa[_0xbd17('0x22')]?_0x516caa[_0xbd17('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x516caa[_0xbd17('0x22')]?_0x516caa['options'][_0xbd17('0x23')]||null:null,'attributes':[[db[_0xbd17('0x24')]['fn'](_0xbd17('0x25'),db[_0xbd17('0x24')]['fn']('IF',db[_0xbd17('0x24')][_0xbd17('0x26')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0xbd17('0x13')](function(_0x21cbb1){logger['info'](_0xbd17('0x1f'),_0x516caa);logger[_0xbd17('0x17')](_0xbd17('0x1f'),_0x516caa,JSON[_0xbd17('0x19')](_0x21cbb1));_0x1e986f(_0x21cbb1);})[_0xbd17('0x1e')](function(_0x2f3573){logger['error'](_0xbd17('0x1f'),_0x2f3573['message'],_0x516caa);_0x3cda7a(_0x465df0[_0xbd17('0x1a')](0x1f4,_0x2f3573[_0xbd17('0x1c')]));});});}; \ No newline at end of file +var _0xa51a=['sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','UserVoiceQueueRt','findAll','options','raw','where','COUNT'];(function(_0x2f23ec,_0x124e28){var _0x19812b=function(_0x3ba5c2){while(--_0x3ba5c2){_0x2f23ec['push'](_0x2f23ec['shift']());}};_0x19812b(++_0x124e28);}(_0xa51a,0x11c));var _0xaa51=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xa51a[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0xaa51('0x0'));var util=require(_0xaa51('0x1'));var moment=require(_0xaa51('0x2'));var BPromise=require(_0xaa51('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa51('0x4'))['db'];var utils=require(_0xaa51('0x5'));var logger=require(_0xaa51('0x6'))(_0xaa51('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaa51('0x8')]['http']({'port':0x232a});config[_0xaa51('0x9')]=_[_0xaa51('0xa')](config[_0xaa51('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaa51('0xb'))[_0xaa51('0xc')](socket);function respondWithRpcPromise(_0xdc86bf,_0x3ad92f,_0x3fe69b){return new BPromise(function(_0x44070e,_0x41e45d){return client['request'](_0xdc86bf,_0x3fe69b)[_0xaa51('0xd')](function(_0x414375){logger['info'](_0xaa51('0xe'),_0x3ad92f,_0xaa51('0xf'));logger[_0xaa51('0x10')](_0xaa51('0x11'),_0x3ad92f,_0xaa51('0xf'),JSON[_0xaa51('0x12')](_0x414375));if(_0x414375['error']){if(_0x414375['error'][_0xaa51('0x13')]===0x1f4){logger[_0xaa51('0x14')](_0xaa51('0xe'),_0x3ad92f,_0x414375[_0xaa51('0x14')][_0xaa51('0x15')]);return _0x41e45d(_0x414375['error'][_0xaa51('0x15')]);}logger[_0xaa51('0x14')](_0xaa51('0xe'),_0x3ad92f,_0x414375[_0xaa51('0x14')][_0xaa51('0x15')]);return _0x44070e(_0x414375[_0xaa51('0x14')][_0xaa51('0x15')]);}else{logger[_0xaa51('0x16')](_0xaa51('0xe'),_0x3ad92f,'request\x20sent');_0x44070e(_0x414375[_0xaa51('0x17')][_0xaa51('0x15')]);}})[_0xaa51('0x18')](function(_0x3766db){logger[_0xaa51('0x14')](_0xaa51('0xe'),_0x3ad92f,_0x3766db);_0x41e45d(_0x3766db);});});}exports['GetVoiceQueueRtPauses']=function(_0x29c1ba){var _0x554bb1=this;return new Promise(function(_0x53e886,_0x4c3ebf){return db[_0xaa51('0x19')][_0xaa51('0x1a')]({'raw':_0x29c1ba['options']?_0x29c1ba[_0xaa51('0x1b')][_0xaa51('0x1c')]===undefined?!![]:![]:!![],'where':_0x29c1ba['options']?_0x29c1ba[_0xaa51('0x1b')][_0xaa51('0x1d')]||null:null,'attributes':[[db['sequelize']['fn'](_0xaa51('0x1e'),db[_0xaa51('0x1f')]['fn']('IF',db[_0xaa51('0x1f')]['literal'](_0xaa51('0x20')))),_0xaa51('0x21')]]})[_0xaa51('0xd')](function(_0xf21bbc){logger[_0xaa51('0x16')](_0xaa51('0x22'),_0x29c1ba);logger[_0xaa51('0x10')](_0xaa51('0x22'),_0x29c1ba,JSON[_0xaa51('0x12')](_0xf21bbc));_0x53e886(_0xf21bbc);})['catch'](function(_0x5e8d0a){logger[_0xaa51('0x14')](_0xaa51('0x22'),_0x5e8d0a[_0xaa51('0x15')],_0x29c1ba);_0x4c3ebf(_0x554bb1[_0xaa51('0x14')](0x1f4,_0x5e8d0a[_0xaa51('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index f81991b..efd6bca 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 _0xfc85=['save','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xfc85,0x188));var _0x5fc8=function(_0xd0789d,_0x22dd07){_0xd0789d=_0xd0789d-0x0;var _0x3bdb9c=_0xfc85[_0xd0789d];return _0x3bdb9c;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x5fc8('0x0'),'remove',_0x5fc8('0x1')];function createListener(_0x5491be,_0x2fa3b0){return function(_0x4fe73a){_0x2fa3b0[_0x5fc8('0x2')](_0x5491be,_0x4fe73a);};}function removeListener(_0x4c4933,_0x41816d){return function(){UserVoiceQueueRtEvents[_0x5fc8('0x3')](_0x4c4933,_0x41816d);};}exports[_0x5fc8('0x4')]=function(_0x3ac9fd){for(var _0x5b2811=0x0,_0x1da643=events[_0x5fc8('0x5')];_0x5b2811<_0x1da643;_0x5b2811++){var _0x43d76b=events[_0x5b2811];var _0x4078d1=createListener(_0x5fc8('0x6')+_0x43d76b,_0x3ac9fd);UserVoiceQueueRtEvents['on'](_0x43d76b,_0x4078d1);}}; \ No newline at end of file +var _0x6ef7=['emit','removeListener','register','length','userVoiceQueueRt:','save','remove','update'];(function(_0x27bb7f,_0x2fc6a9){var _0x4d7360=function(_0x116dd7){while(--_0x116dd7){_0x27bb7f['push'](_0x27bb7f['shift']());}};_0x4d7360(++_0x2fc6a9);}(_0x6ef7,0x1c5));var _0x76ef=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6ef7[_0x501510];return _0x1e6ee5;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x76ef('0x0'),_0x76ef('0x1'),_0x76ef('0x2')];function createListener(_0x374fc1,_0x1d7e88){return function(_0x435569){_0x1d7e88[_0x76ef('0x3')](_0x374fc1,_0x435569);};}function removeListener(_0x4dccfd,_0x240c25){return function(){UserVoiceQueueRtEvents[_0x76ef('0x4')](_0x4dccfd,_0x240c25);};}exports[_0x76ef('0x5')]=function(_0x4ff91b){for(var _0x20470f=0x0,_0x1c4e3f=events[_0x76ef('0x6')];_0x20470f<_0x1c4e3f;_0x20470f++){var _0xc2cc7c=events[_0x20470f];var _0xedc7bf=createListener(_0x76ef('0x7')+_0xc2cc7c,_0x4ff91b);UserVoiceQueueRtEvents['on'](_0xc2cc7c,_0xedc7bf);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 7453910..d38214d 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 _0x692a=['../../config/environment','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x692a,0x160));var _0xa692=function(_0x292e95,_0x5f48f9){_0x292e95=_0x292e95-0x0;var _0x5c2f5c=_0x692a[_0x292e95];return _0x5c2f5c;};'use strict';var multer=require(_0xa692('0x0'));var util=require(_0xa692('0x1'));var path=require(_0xa692('0x2'));var timeout=require(_0xa692('0x3'));var express=require(_0xa692('0x4'));var router=express[_0xa692('0x5')]();var auth=require(_0xa692('0x6'));var interaction=require(_0xa692('0x7'));var config=require(_0xa692('0x8'));module[_0xa692('0x9')]=router; \ No newline at end of file +var _0x0c0d=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util'];(function(_0x38ba77,_0x3f4aec){var _0x551296=function(_0xf4e104){while(--_0xf4e104){_0x38ba77['push'](_0x38ba77['shift']());}};_0x551296(++_0x3f4aec);}(_0x0c0d,0x77));var _0xd0c0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0c0d[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0xd0c0('0x0'));var path=require(_0xd0c0('0x1'));var timeout=require(_0xd0c0('0x2'));var express=require('express');var router=express[_0xd0c0('0x3')]();var auth=require(_0xd0c0('0x4'));var interaction=require(_0xd0c0('0x5'));var config=require(_0xd0c0('0x6'));module[_0xd0c0('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 83ed65e..3a72fbe 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 _0xbaf0=['exports','INTEGER'];(function(_0x4da690,_0x12d136){var _0x263c53=function(_0x1832fa){while(--_0x1832fa){_0x4da690['push'](_0x4da690['shift']());}};_0x263c53(++_0x12d136);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x2ed4c9,_0x243771){var _0x237f0a=function(_0x7f100b){while(--_0x7f100b){_0x2ed4c9['push'](_0x2ed4c9['shift']());}};_0x237f0a(++_0x243771);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index c446cc7..8a53250 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 _0x6fdc=['request-promise','path','rimraf','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4e3a92,_0x409fa2){var _0x52d8b9=function(_0x2d8b12){while(--_0x2d8b12){_0x4e3a92['push'](_0x4e3a92['shift']());}};_0x52d8b9(++_0x409fa2);}(_0x6fdc,0xb5));var _0xc6fd=function(_0x79c6de,_0x10de94){_0x79c6de=_0x79c6de-0x0;var _0x321a56=_0x6fdc[_0x79c6de];return _0x321a56;};'use strict';var _=require(_0xc6fd('0x0'));var util=require(_0xc6fd('0x1'));var logger=require(_0xc6fd('0x2'))(_0xc6fd('0x3'));var moment=require(_0xc6fd('0x4'));var BPromise=require(_0xc6fd('0x5'));var rp=require(_0xc6fd('0x6'));var fs=require('fs');var path=require(_0xc6fd('0x7'));var rimraf=require(_0xc6fd('0x8'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module['exports']=function(_0x3a0060,_0xf9801c){return _0x3a0060['define'](_0xc6fd('0x9'),attributes,{'tableName':_0xc6fd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdca9=['path','../../config/environment','exports','UserWhatsappQueue','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x57de52,_0x354357){var _0x2d94a1=function(_0x898fb){while(--_0x898fb){_0x57de52['push'](_0x57de52['shift']());}};_0x2d94a1(++_0x354357);}(_0xdca9,0x19e));var _0x9dca=function(_0x4a7709,_0x4c306f){_0x4a7709=_0x4a7709-0x0;var _0x3c8716=_0xdca9[_0x4a7709];return _0x3c8716;};'use strict';var _=require(_0x9dca('0x0'));var util=require(_0x9dca('0x1'));var logger=require(_0x9dca('0x2'))(_0x9dca('0x3'));var moment=require(_0x9dca('0x4'));var BPromise=require('bluebird');var rp=require(_0x9dca('0x5'));var fs=require('fs');var path=require(_0x9dca('0x6'));var rimraf=require('rimraf');var config=require(_0x9dca('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x9dca('0x8')]=function(_0x46b66f,_0x22067b){return _0x46b66f['define'](_0x9dca('0x9'),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 7a62017..9502bf6 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 _0xa9e0=['http','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\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(_0x4bb39c,_0x203183){var _0x5778c4=function(_0x27f6e8){while(--_0x27f6e8){_0x4bb39c['push'](_0x4bb39c['shift']());}};_0x5778c4(++_0x203183);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\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(_0xb8bce7,_0x5d07d0){var _0xe1ae54=function(_0x331a9a){while(--_0x331a9a){_0xb8bce7['push'](_0xb8bce7['shift']());}};_0xe1ae54(++_0x5d07d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 8b7fa1b..c0c0a6e 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 _0x2246=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./variable.controller','isAuthenticated','index','get','show','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x2246,0x166));var _0x6224=function(_0x366545,_0xb0e092){_0x366545=_0x366545-0x0;var _0x50eee6=_0x2246[_0x366545];return _0x50eee6;};'use strict';var multer=require(_0x6224('0x0'));var util=require(_0x6224('0x1'));var path=require(_0x6224('0x2'));var timeout=require(_0x6224('0x3'));var express=require(_0x6224('0x4'));var router=express[_0x6224('0x5')]();var auth=require(_0x6224('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6224('0x7'));var controller=require(_0x6224('0x8'));router['get']('/',auth[_0x6224('0x9')](),controller[_0x6224('0xa')]);router[_0x6224('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x6224('0xc')]);router['post']('/',auth[_0x6224('0x9')](),controller[_0x6224('0xd')]);router[_0x6224('0xe')](_0x6224('0xf'),auth[_0x6224('0x9')](),controller[_0x6224('0x10')]);router[_0x6224('0x11')](_0x6224('0xf'),auth['isAuthenticated'](),controller[_0x6224('0x12')]);module[_0x6224('0x13')]=router; \ No newline at end of file +var _0x1aaa=['../../config/environment','get','index','isAuthenticated','post','create','put','/:id','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x346317,_0x27f565){var _0x18088d=function(_0x3eb8dc){while(--_0x3eb8dc){_0x346317['push'](_0x346317['shift']());}};_0x18088d(++_0x27f565);}(_0x1aaa,0x1a3));var _0xa1aa=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0x1aaa[_0x593564];return _0x211a89;};'use strict';var multer=require(_0xa1aa('0x0'));var util=require(_0xa1aa('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa1aa('0x2'));var router=express[_0xa1aa('0x3')]();var auth=require(_0xa1aa('0x4'));var interaction=require(_0xa1aa('0x5'));var config=require(_0xa1aa('0x6'));var controller=require('./variable.controller');router[_0xa1aa('0x7')]('/',auth['isAuthenticated'](),controller[_0xa1aa('0x8')]);router[_0xa1aa('0x7')]('/:id',auth[_0xa1aa('0x9')](),controller['show']);router[_0xa1aa('0xa')]('/',auth['isAuthenticated'](),controller[_0xa1aa('0xb')]);router[_0xa1aa('0xc')](_0xa1aa('0xd'),auth[_0xa1aa('0x9')](),controller['update']);router[_0xa1aa('0xe')](_0xa1aa('0xd'),auth[_0xa1aa('0x9')](),controller[_0xa1aa('0xf')]);module[_0xa1aa('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 20d92f8..a9340ca 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 _0x1a41=['exports','STRING','name'];(function(_0x5c96eb,_0x5404da){var _0x4ddbad=function(_0x5a1225){while(--_0x5a1225){_0x5c96eb['push'](_0x5c96eb['shift']());}};_0x4ddbad(++_0x5404da);}(_0x1a41,0x11d));var _0x11a4=function(_0x5ede77,_0x1342ae){_0x5ede77=_0x5ede77-0x0;var _0x29906e=_0x1a41[_0x5ede77];return _0x29906e;};'use strict';var Sequelize=require('sequelize');module[_0x11a4('0x0')]={'name':{'type':Sequelize[_0x11a4('0x1')],'unique':_0x11a4('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8dcf=['STRING','exports'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0x8dcf,0x11b));var _0xf8dc=function(_0x5d11c6,_0x4dace2){_0x5d11c6=_0x5d11c6-0x0;var _0x541469=_0x8dcf[_0x5d11c6];return _0x541469;};'use strict';var Sequelize=require('sequelize');module[_0xf8dc('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf8dc('0x1')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 8514550..9ddf87e 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 _0x9007=['end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','Variable','include','findAll','catch','show','params','find','body','user','role','Variables','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','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'];(function(_0x9010d3,_0x4abc72){var _0x53a777=function(_0x2ac1eb){while(--_0x2ac1eb){_0x9010d3['push'](_0x9010d3['shift']());}};_0x53a777(++_0x4abc72);}(_0x9007,0x1db));var _0x7900=function(_0x58ceb9,_0x5601df){_0x58ceb9=_0x58ceb9-0x0;var _0x3d0ff5=_0x9007[_0x58ceb9];return _0x3d0ff5;};'use strict';var pdf=require(_0x7900('0x0'));var emlformat=require(_0x7900('0x1'));var rimraf=require(_0x7900('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7900('0x3'));var rp=require(_0x7900('0x4'));var moment=require(_0x7900('0x5'));var BPromise=require(_0x7900('0x6'));var Mustache=require(_0x7900('0x7'));var util=require(_0x7900('0x8'));var path=require(_0x7900('0x9'));var sox=require(_0x7900('0xa'));var csv=require(_0x7900('0xb'));var ejs=require(_0x7900('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7900('0xd'));var crypto=require('crypto');var jsforce=require(_0x7900('0xe'));var deskjs=require(_0x7900('0xf'));var toCsv=require(_0x7900('0xb'));var querystring=require(_0x7900('0x10'));var Papa=require(_0x7900('0x11'));var Redis=require(_0x7900('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7900('0x13'));var as=require(_0x7900('0x14'));var hardwareService=require(_0x7900('0x15'));var logger=require(_0x7900('0x16'))(_0x7900('0x17'));var utils=require(_0x7900('0x18'));var config=require(_0x7900('0x19'));var db=require(_0x7900('0x1a'))['db'];function respondWithStatusCode(_0x2c42b1,_0x243226){_0x243226=_0x243226||0xcc;return function(_0x5f07f1){if(_0x5f07f1){return _0x2c42b1[_0x7900('0x1b')](_0x243226);}return _0x2c42b1[_0x7900('0x1c')](_0x243226)[_0x7900('0x1d')]();};}function respondWithResult(_0x4ebd1b,_0x4bbc7d){_0x4bbc7d=_0x4bbc7d||0xc8;return function(_0x105ac7){if(_0x105ac7){return _0x4ebd1b[_0x7900('0x1c')](_0x4bbc7d)[_0x7900('0x1e')](_0x105ac7);}};}function respondWithFilteredResult(_0x27cf0e,_0x3b7761){return function(_0x8bae2){if(_0x8bae2){var _0x193673=_0x8bae2[_0x7900('0x1f')],_0x395ffa=_0x3b7761[_0x7900('0x20')],_0x51e458=_0x3b7761[_0x7900('0x20')]+_0x3b7761[_0x7900('0x21')],_0x3f2b7e;if(_0x51e458>=_0x193673){_0x51e458=_0x193673;_0x3f2b7e=0xc8;}else{_0x3f2b7e=0xce;}_0x27cf0e[_0x7900('0x1c')](_0x3f2b7e);return _0x27cf0e[_0x7900('0x22')](_0x7900('0x23'),_0x395ffa+'-'+_0x51e458+'/'+_0x193673)[_0x7900('0x1e')](_0x8bae2);}return null;};}function patchUpdates(_0x4e244a){return function(_0x46ca6d){try{jsonpatch['apply'](_0x46ca6d,_0x4e244a,!![]);}catch(_0x1b8398){return BPromise[_0x7900('0x24')](_0x1b8398);}return _0x46ca6d[_0x7900('0x25')]();};}function saveUpdates(_0x4d68d2,_0x318e13){return function(_0x30e0ea){if(_0x30e0ea){return _0x30e0ea[_0x7900('0x26')](_0x4d68d2)['then'](function(_0x45a813){return _0x45a813;});}return null;};}function removeEntity(_0x2d510d,_0x9100d1){return function(_0x4795f1){if(_0x4795f1){return _0x4795f1[_0x7900('0x27')]()[_0x7900('0x28')](function(){var _0x2f137b=_0x4795f1[_0x7900('0x29')]({'plain':!![]});var _0x243bf8='Variables';return db[_0x7900('0x2a')][_0x7900('0x27')]({'where':{'type':_0x243bf8,'resourceId':_0x2f137b['id']}})[_0x7900('0x28')](function(){return _0x4795f1;});})[_0x7900('0x28')](function(){_0x2d510d[_0x7900('0x1c')](0xcc)[_0x7900('0x1d')]();});}};}function handleEntityNotFound(_0x5e3d34,_0x1ace2f){return function(_0x19626e){if(!_0x19626e){_0x5e3d34[_0x7900('0x1b')](0x194);}return _0x19626e;};}function handleError(_0x36b211,_0x5db69b){_0x5db69b=_0x5db69b||0x1f4;return function(_0x8c6adc){logger[_0x7900('0x2b')](_0x8c6adc[_0x7900('0x2c')]);if(_0x8c6adc['name']){delete _0x8c6adc[_0x7900('0x2d')];}_0x36b211[_0x7900('0x1c')](_0x5db69b)[_0x7900('0x2e')](_0x8c6adc);};}exports['index']=function(_0x11d0fd,_0x46b7c7){var _0x26ddd9={},_0x3f5364={},_0x402268={'count':0x0,'rows':[]};var _0x42d7b5=_['map'](db['Variable'][_0x7900('0x2f')],function(_0x53c81a){return{'name':_0x53c81a[_0x7900('0x30')],'type':_0x53c81a[_0x7900('0x31')][_0x7900('0x32')]};});_0x3f5364[_0x7900('0x33')]=_[_0x7900('0x34')](_0x42d7b5,_0x7900('0x2d'));_0x3f5364[_0x7900('0x35')]=_[_0x7900('0x36')](_0x11d0fd[_0x7900('0x35')]);_0x3f5364[_0x7900('0x37')]=_['intersection'](_0x3f5364[_0x7900('0x33')],_0x3f5364[_0x7900('0x35')]);_0x26ddd9[_0x7900('0x38')]=_[_0x7900('0x39')](_0x3f5364['model'],qs[_0x7900('0x3a')](_0x11d0fd[_0x7900('0x35')][_0x7900('0x3a')]));_0x26ddd9['attributes']=_0x26ddd9[_0x7900('0x38')][_0x7900('0x3b')]?_0x26ddd9[_0x7900('0x38')]:_0x3f5364['model'];if(!_0x11d0fd[_0x7900('0x35')][_0x7900('0x3c')](_0x7900('0x3d'))){_0x26ddd9[_0x7900('0x21')]=qs[_0x7900('0x21')](_0x11d0fd[_0x7900('0x35')]['limit']);_0x26ddd9[_0x7900('0x20')]=qs[_0x7900('0x20')](_0x11d0fd[_0x7900('0x35')][_0x7900('0x20')]);}_0x26ddd9[_0x7900('0x3e')]=qs[_0x7900('0x3f')](_0x11d0fd[_0x7900('0x35')][_0x7900('0x3f')]);_0x26ddd9['where']=qs[_0x7900('0x37')](_['pick'](_0x11d0fd[_0x7900('0x35')],_0x3f5364[_0x7900('0x37')]),_0x42d7b5);if(_0x11d0fd[_0x7900('0x35')][_0x7900('0x40')]){_0x26ddd9[_0x7900('0x41')]=_[_0x7900('0x42')](_0x26ddd9['where'],{'$or':_[_0x7900('0x34')](_0x42d7b5,function(_0x54afe6){if(_0x54afe6[_0x7900('0x31')]!==_0x7900('0x43')){var _0xe69c9e={};_0xe69c9e[_0x54afe6[_0x7900('0x2d')]]={'$like':'%'+_0x11d0fd[_0x7900('0x35')]['filter']+'%'};return _0xe69c9e;}})});}_0x26ddd9=_[_0x7900('0x42')]({},_0x26ddd9,_0x11d0fd[_0x7900('0x44')]);var _0x8afecc={'where':_0x26ddd9['where']};return db[_0x7900('0x45')][_0x7900('0x1f')](_0x8afecc)[_0x7900('0x28')](function(_0x33c80b){_0x402268['count']=_0x33c80b;if(_0x11d0fd['query']['includeAll']){_0x26ddd9[_0x7900('0x46')]=[{'all':!![]}];}return db[_0x7900('0x45')][_0x7900('0x47')](_0x26ddd9);})[_0x7900('0x28')](function(_0x17bf2c){_0x402268['rows']=_0x17bf2c;return _0x402268;})['then'](respondWithFilteredResult(_0x46b7c7,_0x26ddd9))[_0x7900('0x48')](handleError(_0x46b7c7,null));};exports[_0x7900('0x49')]=function(_0xc26370,_0x409218){var _0x31235c={'raw':!![],'where':{'id':_0xc26370[_0x7900('0x4a')]['id']}},_0x577e68={};_0x577e68[_0x7900('0x33')]=_[_0x7900('0x36')](db[_0x7900('0x45')][_0x7900('0x2f')]);_0x577e68['query']=_[_0x7900('0x36')](_0xc26370[_0x7900('0x35')]);_0x577e68[_0x7900('0x37')]=_['intersection'](_0x577e68[_0x7900('0x33')],_0x577e68[_0x7900('0x35')]);_0x31235c[_0x7900('0x38')]=_[_0x7900('0x39')](_0x577e68[_0x7900('0x33')],qs[_0x7900('0x3a')](_0xc26370[_0x7900('0x35')][_0x7900('0x3a')]));_0x31235c[_0x7900('0x38')]=_0x31235c[_0x7900('0x38')][_0x7900('0x3b')]?_0x31235c['attributes']:_0x577e68[_0x7900('0x33')];if(_0xc26370[_0x7900('0x35')]['includeAll']){_0x31235c['include']=[{'all':!![]}];}_0x31235c=_[_0x7900('0x42')]({},_0x31235c,_0xc26370['options']);return db[_0x7900('0x45')][_0x7900('0x4b')](_0x31235c)[_0x7900('0x28')](handleEntityNotFound(_0x409218,null))['then'](respondWithResult(_0x409218,null))[_0x7900('0x48')](handleError(_0x409218,null));};exports['create']=function(_0x19f9a1,_0x3b8f78){return db['Variable']['create'](_0x19f9a1[_0x7900('0x4c')],{})[_0x7900('0x28')](function(_0x4a6071){var _0x41af16=_0x19f9a1[_0x7900('0x4d')][_0x7900('0x29')]({'plain':!![]});if(!_0x41af16)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41af16[_0x7900('0x4e')]==='user'){var _0x340ec5=_0x4a6071[_0x7900('0x29')]({'plain':!![]});var _0x13851e=_0x7900('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x13851e,'userProfileId':_0x41af16[_0x7900('0x50')]},'raw':!![]})['then'](function(_0x49699e){if(_0x49699e&&_0x49699e[_0x7900('0x51')]===0x0){return db[_0x7900('0x2a')][_0x7900('0x52')]({'name':_0x340ec5['name'],'resourceId':_0x340ec5['id'],'type':_0x49699e['name'],'sectionId':_0x49699e['id']},{})[_0x7900('0x28')](function(){return _0x4a6071;});}else{return _0x4a6071;}})['catch'](function(_0x2f8914){logger[_0x7900('0x2b')](_0x7900('0x53'),_0x2f8914);throw _0x2f8914;});}return _0x4a6071;})[_0x7900('0x28')](respondWithResult(_0x3b8f78,0xc9))['catch'](handleError(_0x3b8f78,null));};exports['update']=function(_0x244d85,_0x4c11fa){if(_0x244d85['body']['id']){delete _0x244d85[_0x7900('0x4c')]['id'];}return db[_0x7900('0x45')]['find']({'where':{'id':_0x244d85[_0x7900('0x4a')]['id']}})[_0x7900('0x28')](handleEntityNotFound(_0x4c11fa,null))[_0x7900('0x28')](saveUpdates(_0x244d85['body'],null))['then'](respondWithResult(_0x4c11fa,null))['catch'](handleError(_0x4c11fa,null));};exports['destroy']=function(_0x103c81,_0x61b614){return db['Variable']['find']({'where':{'id':_0x103c81[_0x7900('0x4a')]['id']}})['then'](handleEntityNotFound(_0x61b614,null))[_0x7900('0x28')](removeEntity(_0x61b614,null))['catch'](handleError(_0x61b614,null));}; \ No newline at end of file +var _0x9332=['apply','reject','update','then','destroy','get','Variables','UserProfileResource','sendStatus','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','include','catch','show','params','options','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','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/environment','../../mysqldb','status','end','json','count','offset','limit'];(function(_0x47a8f4,_0x18f97e){var _0x4b584c=function(_0x51fc42){while(--_0x51fc42){_0x47a8f4['push'](_0x47a8f4['shift']());}};_0x4b584c(++_0x18f97e);}(_0x9332,0x1c5));var _0x2933=function(_0x51a07c,_0x57abf7){_0x51a07c=_0x51a07c-0x0;var _0x5e78cb=_0x9332[_0x51a07c];return _0x5e78cb;};'use strict';var pdf=require(_0x2933('0x0'));var emlformat=require(_0x2933('0x1'));var rimraf=require(_0x2933('0x2'));var zipdir=require(_0x2933('0x3'));var jsonpatch=require(_0x2933('0x4'));var rp=require('request-promise');var moment=require(_0x2933('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2933('0x6'));var util=require(_0x2933('0x7'));var path=require(_0x2933('0x8'));var sox=require(_0x2933('0x9'));var csv=require(_0x2933('0xa'));var ejs=require(_0x2933('0xb'));var fs=require('fs');var _=require(_0x2933('0xc'));var squel=require(_0x2933('0xd'));var crypto=require(_0x2933('0xe'));var jsforce=require(_0x2933('0xf'));var deskjs=require(_0x2933('0x10'));var toCsv=require('to-csv');var querystring=require(_0x2933('0x11'));var Papa=require(_0x2933('0x12'));var Redis=require('ioredis');var authService=require(_0x2933('0x13'));var qs=require(_0x2933('0x14'));var as=require(_0x2933('0x15'));var hardwareService=require(_0x2933('0x16'));var logger=require(_0x2933('0x17'))(_0x2933('0x18'));var utils=require('../../config/utils');var config=require(_0x2933('0x19'));var db=require(_0x2933('0x1a'))['db'];function respondWithStatusCode(_0x1f8f7c,_0xcf6af9){_0xcf6af9=_0xcf6af9||0xcc;return function(_0x20abf8){if(_0x20abf8){return _0x1f8f7c['sendStatus'](_0xcf6af9);}return _0x1f8f7c[_0x2933('0x1b')](_0xcf6af9)[_0x2933('0x1c')]();};}function respondWithResult(_0xf70d73,_0x2534c7){_0x2534c7=_0x2534c7||0xc8;return function(_0x525a07){if(_0x525a07){return _0xf70d73[_0x2933('0x1b')](_0x2534c7)[_0x2933('0x1d')](_0x525a07);}};}function respondWithFilteredResult(_0x5c350a,_0xf02c30){return function(_0x28f9c3){if(_0x28f9c3){var _0x47b8df=_0x28f9c3[_0x2933('0x1e')],_0x1a5f6f=_0xf02c30[_0x2933('0x1f')],_0x3572e3=_0xf02c30[_0x2933('0x1f')]+_0xf02c30[_0x2933('0x20')],_0x24494b;if(_0x3572e3>=_0x47b8df){_0x3572e3=_0x47b8df;_0x24494b=0xc8;}else{_0x24494b=0xce;}_0x5c350a[_0x2933('0x1b')](_0x24494b);return _0x5c350a['set']('Content-Range',_0x1a5f6f+'-'+_0x3572e3+'/'+_0x47b8df)['json'](_0x28f9c3);}return null;};}function patchUpdates(_0x55dbd6){return function(_0x3367f8){try{jsonpatch[_0x2933('0x21')](_0x3367f8,_0x55dbd6,!![]);}catch(_0xaadc07){return BPromise[_0x2933('0x22')](_0xaadc07);}return _0x3367f8['save']();};}function saveUpdates(_0x39be24,_0x24fd68){return function(_0x19c663){if(_0x19c663){return _0x19c663[_0x2933('0x23')](_0x39be24)[_0x2933('0x24')](function(_0x5121ce){return _0x5121ce;});}return null;};}function removeEntity(_0x17b461,_0xdcbcea){return function(_0x240249){if(_0x240249){return _0x240249[_0x2933('0x25')]()[_0x2933('0x24')](function(){var _0x4b587c=_0x240249[_0x2933('0x26')]({'plain':!![]});var _0x33feb8=_0x2933('0x27');return db[_0x2933('0x28')][_0x2933('0x25')]({'where':{'type':_0x33feb8,'resourceId':_0x4b587c['id']}})[_0x2933('0x24')](function(){return _0x240249;});})[_0x2933('0x24')](function(){_0x17b461['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x203449,_0x5bc0a6){return function(_0x47a55f){if(!_0x47a55f){_0x203449[_0x2933('0x29')](0x194);}return _0x47a55f;};}function handleError(_0x17b4b8,_0x995139){_0x995139=_0x995139||0x1f4;return function(_0x22ff29){logger[_0x2933('0x2a')](_0x22ff29[_0x2933('0x2b')]);if(_0x22ff29['name']){delete _0x22ff29[_0x2933('0x2c')];}_0x17b4b8['status'](_0x995139)[_0x2933('0x2d')](_0x22ff29);};}exports[_0x2933('0x2e')]=function(_0x4c1c7c,_0x29c3ab){var _0x265ab6={},_0x4500f4={},_0x457c87={'count':0x0,'rows':[]};var _0x4edd33=_[_0x2933('0x2f')](db[_0x2933('0x30')][_0x2933('0x31')],function(_0x29ffc2){return{'name':_0x29ffc2[_0x2933('0x32')],'type':_0x29ffc2[_0x2933('0x33')]['key']};});_0x4500f4['model']=_['map'](_0x4edd33,'name');_0x4500f4[_0x2933('0x34')]=_[_0x2933('0x35')](_0x4c1c7c[_0x2933('0x34')]);_0x4500f4[_0x2933('0x36')]=_[_0x2933('0x37')](_0x4500f4['model'],_0x4500f4[_0x2933('0x34')]);_0x265ab6[_0x2933('0x38')]=_[_0x2933('0x37')](_0x4500f4[_0x2933('0x39')],qs[_0x2933('0x3a')](_0x4c1c7c[_0x2933('0x34')][_0x2933('0x3a')]));_0x265ab6[_0x2933('0x38')]=_0x265ab6['attributes'][_0x2933('0x3b')]?_0x265ab6[_0x2933('0x38')]:_0x4500f4[_0x2933('0x39')];if(!_0x4c1c7c[_0x2933('0x34')][_0x2933('0x3c')](_0x2933('0x3d'))){_0x265ab6[_0x2933('0x20')]=qs[_0x2933('0x20')](_0x4c1c7c[_0x2933('0x34')][_0x2933('0x20')]);_0x265ab6['offset']=qs[_0x2933('0x1f')](_0x4c1c7c['query']['offset']);}_0x265ab6[_0x2933('0x3e')]=qs[_0x2933('0x3f')](_0x4c1c7c[_0x2933('0x34')][_0x2933('0x3f')]);_0x265ab6[_0x2933('0x40')]=qs[_0x2933('0x36')](_[_0x2933('0x41')](_0x4c1c7c['query'],_0x4500f4[_0x2933('0x36')]),_0x4edd33);if(_0x4c1c7c[_0x2933('0x34')]['filter']){_0x265ab6[_0x2933('0x40')]=_[_0x2933('0x42')](_0x265ab6[_0x2933('0x40')],{'$or':_[_0x2933('0x2f')](_0x4edd33,function(_0x497cff){if(_0x497cff[_0x2933('0x33')]!=='VIRTUAL'){var _0x18a9fb={};_0x18a9fb[_0x497cff[_0x2933('0x2c')]]={'$like':'%'+_0x4c1c7c[_0x2933('0x34')]['filter']+'%'};return _0x18a9fb;}})});}_0x265ab6=_[_0x2933('0x42')]({},_0x265ab6,_0x4c1c7c['options']);var _0x344c58={'where':_0x265ab6[_0x2933('0x40')]};return db[_0x2933('0x30')][_0x2933('0x1e')](_0x344c58)[_0x2933('0x24')](function(_0x4bd18a){_0x457c87[_0x2933('0x1e')]=_0x4bd18a;if(_0x4c1c7c['query'][_0x2933('0x43')]){_0x265ab6[_0x2933('0x44')]=[{'all':!![]}];}return db['Variable']['findAll'](_0x265ab6);})[_0x2933('0x24')](function(_0x4c8df8){_0x457c87['rows']=_0x4c8df8;return _0x457c87;})['then'](respondWithFilteredResult(_0x29c3ab,_0x265ab6))[_0x2933('0x45')](handleError(_0x29c3ab,null));};exports[_0x2933('0x46')]=function(_0x59c955,_0x3f8bcf){var _0x36bcb3={'raw':!![],'where':{'id':_0x59c955[_0x2933('0x47')]['id']}},_0x313362={};_0x313362[_0x2933('0x39')]=_[_0x2933('0x35')](db[_0x2933('0x30')]['rawAttributes']);_0x313362[_0x2933('0x34')]=_['keys'](_0x59c955[_0x2933('0x34')]);_0x313362['filters']=_['intersection'](_0x313362[_0x2933('0x39')],_0x313362[_0x2933('0x34')]);_0x36bcb3[_0x2933('0x38')]=_[_0x2933('0x37')](_0x313362[_0x2933('0x39')],qs['fields'](_0x59c955[_0x2933('0x34')]['fields']));_0x36bcb3[_0x2933('0x38')]=_0x36bcb3[_0x2933('0x38')]['length']?_0x36bcb3[_0x2933('0x38')]:_0x313362[_0x2933('0x39')];if(_0x59c955[_0x2933('0x34')][_0x2933('0x43')]){_0x36bcb3[_0x2933('0x44')]=[{'all':!![]}];}_0x36bcb3=_[_0x2933('0x42')]({},_0x36bcb3,_0x59c955[_0x2933('0x48')]);return db[_0x2933('0x30')][_0x2933('0x49')](_0x36bcb3)[_0x2933('0x24')](handleEntityNotFound(_0x3f8bcf,null))[_0x2933('0x24')](respondWithResult(_0x3f8bcf,null))[_0x2933('0x45')](handleError(_0x3f8bcf,null));};exports['create']=function(_0x1fe133,_0x399a96){return db[_0x2933('0x30')][_0x2933('0x4a')](_0x1fe133[_0x2933('0x4b')],{})[_0x2933('0x24')](function(_0x832621){var _0x2e30f8=_0x1fe133[_0x2933('0x4c')][_0x2933('0x26')]({'plain':!![]});if(!_0x2e30f8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e30f8[_0x2933('0x4d')]===_0x2933('0x4c')){var _0x285c96=_0x832621[_0x2933('0x26')]({'plain':!![]});var _0x34a7ed=_0x2933('0x27');return db[_0x2933('0x4e')][_0x2933('0x49')]({'where':{'name':_0x34a7ed,'userProfileId':_0x2e30f8['userProfileId']},'raw':!![]})[_0x2933('0x24')](function(_0x20628a){if(_0x20628a&&_0x20628a[_0x2933('0x4f')]===0x0){return db['UserProfileResource'][_0x2933('0x4a')]({'name':_0x285c96[_0x2933('0x2c')],'resourceId':_0x285c96['id'],'type':_0x20628a['name'],'sectionId':_0x20628a['id']},{})['then'](function(){return _0x832621;});}else{return _0x832621;}})[_0x2933('0x45')](function(_0x55f236){logger[_0x2933('0x2a')](_0x2933('0x50'),_0x55f236);throw _0x55f236;});}return _0x832621;})[_0x2933('0x24')](respondWithResult(_0x399a96,0xc9))['catch'](handleError(_0x399a96,null));};exports[_0x2933('0x23')]=function(_0x1450d5,_0x1ab88a){if(_0x1450d5[_0x2933('0x4b')]['id']){delete _0x1450d5[_0x2933('0x4b')]['id'];}return db[_0x2933('0x30')]['find']({'where':{'id':_0x1450d5[_0x2933('0x47')]['id']}})[_0x2933('0x24')](handleEntityNotFound(_0x1ab88a,null))[_0x2933('0x24')](saveUpdates(_0x1450d5[_0x2933('0x4b')],null))[_0x2933('0x24')](respondWithResult(_0x1ab88a,null))[_0x2933('0x45')](handleError(_0x1ab88a,null));};exports[_0x2933('0x25')]=function(_0x3b2023,_0x3c9430){return db[_0x2933('0x30')][_0x2933('0x49')]({'where':{'id':_0x3b2023[_0x2933('0x47')]['id']}})['then'](handleEntityNotFound(_0x3c9430,null))['then'](removeEntity(_0x3c9430,null))[_0x2933('0x45')](handleError(_0x3c9430,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index e64fa51..7c9ea0f 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 _0x0874=['request-promise','../../config/environment','./variable.attributes','exports','util','api','moment','bluebird'];(function(_0x25a92e,_0x4e8ded){var _0x5732e2=function(_0x31806a){while(--_0x31806a){_0x25a92e['push'](_0x25a92e['shift']());}};_0x5732e2(++_0x4e8ded);}(_0x0874,0x14c));var _0x4087=function(_0x26f69f,_0x1bc94a){_0x26f69f=_0x26f69f-0x0;var _0x2cee15=_0x0874[_0x26f69f];return _0x2cee15;};'use strict';var _=require('lodash');var util=require(_0x4087('0x0'));var logger=require('../../config/logger')(_0x4087('0x1'));var moment=require(_0x4087('0x2'));var BPromise=require(_0x4087('0x3'));var rp=require(_0x4087('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4087('0x5'));var attributes=require(_0x4087('0x6'));module[_0x4087('0x7')]=function(_0x440324,_0x2dad2f){return _0x440324['define']('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafc7=['./variable.attributes','exports','Variable','tools_variables','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xafc7,0x185));var _0x7afc=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xafc7[_0x5b78e8];return _0xf2c321;};'use strict';var _=require('lodash');var util=require(_0x7afc('0x0'));var logger=require(_0x7afc('0x1'))(_0x7afc('0x2'));var moment=require('moment');var BPromise=require(_0x7afc('0x3'));var rp=require(_0x7afc('0x4'));var fs=require('fs');var path=require(_0x7afc('0x5'));var rimraf=require(_0x7afc('0x6'));var config=require('../../config/environment');var attributes=require(_0x7afc('0x7'));module[_0x7afc('0x8')]=function(_0x3a6861,_0x338094){return _0x3a6861['define'](_0x7afc('0x9'),attributes,{'tableName':_0x7afc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 059f12f..14f442d 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 _0x6d14=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','options','raw','where','include','map','model','attributes','then','util','moment','randomstring'];(function(_0x38e318,_0x575a1d){var _0xf13e79=function(_0x58b885){while(--_0x58b885){_0x38e318['push'](_0x38e318['shift']());}};_0xf13e79(++_0x575a1d);}(_0x6d14,0x1dd));var _0x46d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6d14[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x46d1('0x0'));var moment=require(_0x46d1('0x1'));var BPromise=require('bluebird');var rs=require(_0x46d1('0x2'));var fs=require('fs');var Redis=require(_0x46d1('0x3'));var db=require(_0x46d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x46d1('0x5'))(_0x46d1('0x6'));var config=require(_0x46d1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x46d1('0x8')][_0x46d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xde71ea,_0x548cf5,_0x50c4b1){return new BPromise(function(_0x44cce3,_0x626357){return client[_0x46d1('0xa')](_0xde71ea,_0x50c4b1)['then'](function(_0x4ede21){logger[_0x46d1('0xb')](_0x46d1('0xc'),_0x548cf5,_0x46d1('0xd'));logger[_0x46d1('0xe')](_0x46d1('0xf'),_0x548cf5,'request\x20sent',JSON[_0x46d1('0x10')](_0x4ede21));if(_0x4ede21[_0x46d1('0x11')]){if(_0x4ede21[_0x46d1('0x11')]['code']===0x1f4){logger[_0x46d1('0x11')]('Variable,\x20%s,\x20%s',_0x548cf5,_0x4ede21[_0x46d1('0x11')][_0x46d1('0x12')]);return _0x626357(_0x4ede21[_0x46d1('0x11')][_0x46d1('0x12')]);}logger[_0x46d1('0x11')]('Variable,\x20%s,\x20%s',_0x548cf5,_0x4ede21[_0x46d1('0x11')][_0x46d1('0x12')]);return _0x44cce3(_0x4ede21[_0x46d1('0x11')][_0x46d1('0x12')]);}else{logger[_0x46d1('0xb')](_0x46d1('0xc'),_0x548cf5,_0x46d1('0xd'));_0x44cce3(_0x4ede21[_0x46d1('0x13')][_0x46d1('0x12')]);}})[_0x46d1('0x14')](function(_0x3770a3){logger[_0x46d1('0x11')]('Variable,\x20%s,\x20%s',_0x548cf5,_0x3770a3);_0x626357(_0x3770a3);});});}exports[_0x46d1('0x15')]=function(_0x3859b5){var _0xdf4c1a=this;return new Promise(function(_0x173952,_0x3e85c7){return db['Variable']['find']({'raw':_0x3859b5['options']?_0x3859b5[_0x46d1('0x16')][_0x46d1('0x17')]===undefined?!![]:![]:!![],'where':_0x3859b5[_0x46d1('0x16')]?_0x3859b5[_0x46d1('0x16')][_0x46d1('0x18')]||null:null,'attributes':_0x3859b5[_0x46d1('0x16')]?_0x3859b5[_0x46d1('0x16')]['attributes']||null:null,'include':_0x3859b5['options']?_0x3859b5[_0x46d1('0x16')][_0x46d1('0x19')]?_[_0x46d1('0x1a')](_0x3859b5[_0x46d1('0x16')][_0x46d1('0x19')],function(_0x12b68e){return{'model':db[_0x12b68e['model']],'as':_0x12b68e['as'],'attributes':_0x12b68e['attributes'],'include':_0x12b68e[_0x46d1('0x19')]?_[_0x46d1('0x1a')](_0x12b68e[_0x46d1('0x19')],function(_0x2348c8){return{'model':db[_0x2348c8[_0x46d1('0x1b')]],'as':_0x2348c8['as'],'attributes':_0x2348c8[_0x46d1('0x1c')],'include':_0x2348c8[_0x46d1('0x19')]?_[_0x46d1('0x1a')](_0x2348c8[_0x46d1('0x19')],function(_0x3f1976){return{'model':db[_0x3f1976['model']],'as':_0x3f1976['as'],'attributes':_0x3f1976[_0x46d1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x46d1('0x1d')](function(_0x3357eb){logger[_0x46d1('0xb')](_0x46d1('0x15'),_0x3859b5);logger['debug']('ShowVariable',_0x3859b5,JSON[_0x46d1('0x10')](_0x3357eb));_0x173952(_0x3357eb);})[_0x46d1('0x14')](function(_0x139425){logger[_0x46d1('0x11')](_0x46d1('0x15'),_0x139425[_0x46d1('0x12')],_0x3859b5);_0x3e85c7(_0xdf4c1a[_0x46d1('0x11')](0x1f4,_0x139425[_0x46d1('0x12')]));});});}; \ No newline at end of file +var _0xd420=['then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','Variable,\x20%s,\x20%s','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x313e34,_0x26df83){var _0x386b93=function(_0x495ea8){while(--_0x495ea8){_0x313e34['push'](_0x313e34['shift']());}};_0x386b93(++_0x26df83);}(_0xd420,0x72));var _0x0d42=function(_0x48c74e,_0x1549f0){_0x48c74e=_0x48c74e-0x0;var _0x3e14f4=_0xd420[_0x48c74e];return _0x3e14f4;};'use strict';var _=require(_0x0d42('0x0'));var util=require(_0x0d42('0x1'));var moment=require('moment');var BPromise=require(_0x0d42('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d42('0x3'));var db=require(_0x0d42('0x4'))['db'];var utils=require(_0x0d42('0x5'));var logger=require(_0x0d42('0x6'))(_0x0d42('0x7'));var config=require(_0x0d42('0x8'));var jayson=require(_0x0d42('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2dd7f9,_0x154d27,_0x2972b0){return new BPromise(function(_0x3ddd77,_0x477f75){return client['request'](_0x2dd7f9,_0x2972b0)[_0x0d42('0xa')](function(_0x1b730d){logger[_0x0d42('0xb')]('Variable,\x20%s,\x20%s',_0x154d27,_0x0d42('0xc'));logger[_0x0d42('0xd')](_0x0d42('0xe'),_0x154d27,'request\x20sent',JSON['stringify'](_0x1b730d));if(_0x1b730d[_0x0d42('0xf')]){if(_0x1b730d[_0x0d42('0xf')][_0x0d42('0x10')]===0x1f4){logger['error'](_0x0d42('0x11'),_0x154d27,_0x1b730d[_0x0d42('0xf')][_0x0d42('0x12')]);return _0x477f75(_0x1b730d[_0x0d42('0xf')][_0x0d42('0x12')]);}logger[_0x0d42('0xf')](_0x0d42('0x11'),_0x154d27,_0x1b730d[_0x0d42('0xf')]['message']);return _0x3ddd77(_0x1b730d[_0x0d42('0xf')][_0x0d42('0x12')]);}else{logger['info'](_0x0d42('0x11'),_0x154d27,'request\x20sent');_0x3ddd77(_0x1b730d[_0x0d42('0x13')]['message']);}})[_0x0d42('0x14')](function(_0x5d7ebb){logger[_0x0d42('0xf')](_0x0d42('0x11'),_0x154d27,_0x5d7ebb);_0x477f75(_0x5d7ebb);});});}exports[_0x0d42('0x15')]=function(_0x16d768){var _0x4f8918=this;return new Promise(function(_0x4f2111,_0x22225b){return db[_0x0d42('0x16')][_0x0d42('0x17')]({'raw':_0x16d768[_0x0d42('0x18')]?_0x16d768['options'][_0x0d42('0x19')]===undefined?!![]:![]:!![],'where':_0x16d768[_0x0d42('0x18')]?_0x16d768[_0x0d42('0x18')][_0x0d42('0x1a')]||null:null,'attributes':_0x16d768[_0x0d42('0x18')]?_0x16d768[_0x0d42('0x18')][_0x0d42('0x1b')]||null:null,'include':_0x16d768['options']?_0x16d768[_0x0d42('0x18')]['include']?_[_0x0d42('0x1c')](_0x16d768[_0x0d42('0x18')][_0x0d42('0x1d')],function(_0x1defb8){return{'model':db[_0x1defb8[_0x0d42('0x1e')]],'as':_0x1defb8['as'],'attributes':_0x1defb8[_0x0d42('0x1b')],'include':_0x1defb8[_0x0d42('0x1d')]?_[_0x0d42('0x1c')](_0x1defb8[_0x0d42('0x1d')],function(_0x197a2f){return{'model':db[_0x197a2f[_0x0d42('0x1e')]],'as':_0x197a2f['as'],'attributes':_0x197a2f[_0x0d42('0x1b')],'include':_0x197a2f[_0x0d42('0x1d')]?_[_0x0d42('0x1c')](_0x197a2f[_0x0d42('0x1d')],function(_0x3c65e9){return{'model':db[_0x3c65e9[_0x0d42('0x1e')]],'as':_0x3c65e9['as'],'attributes':_0x3c65e9['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d42('0xa')](function(_0x3c3abc){logger[_0x0d42('0xb')](_0x0d42('0x15'),_0x16d768);logger[_0x0d42('0xd')](_0x0d42('0x15'),_0x16d768,JSON['stringify'](_0x3c3abc));_0x4f2111(_0x3c3abc);})['catch'](function(_0xa82068){logger[_0x0d42('0xf')]('ShowVariable',_0xa82068['message'],_0x16d768);_0x22225b(_0x4f8918[_0x0d42('0xf')](0x1f4,_0xa82068['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index f13a0d1..d6a6b99 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 _0x9775=['/migrations','migrations','exports','express','../../components/auth/service','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull','/restart'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x9775,0x1f2));var _0x5977=function(_0x920cf7,_0x4dcfe3){_0x920cf7=_0x920cf7-0x0;var _0x73516=_0x9775[_0x920cf7];return _0x73516;};'use strict';var express=require(_0x5977('0x0'));var router=express['Router']();var auth=require(_0x5977('0x1'));var controller=require('./version.controller');router[_0x5977('0x2')]('/',controller[_0x5977('0x3')]);router[_0x5977('0x2')](_0x5977('0x4'),auth[_0x5977('0x5')](),auth[_0x5977('0x6')](),controller[_0x5977('0x7')]);router[_0x5977('0x2')](_0x5977('0x8'),auth[_0x5977('0x5')](),auth['canUpdate'](),controller[_0x5977('0x9')]);router['get'](_0x5977('0xa'),auth[_0x5977('0x5')](),auth[_0x5977('0x6')](),controller['pull']);router[_0x5977('0x2')](_0x5977('0xb'),auth[_0x5977('0x5')](),controller['restart']);router['get'](_0x5977('0xc'),controller[_0x5977('0xd')]);module[_0x5977('0xe')]=router; \ No newline at end of file +var _0x7732=['pull','/restart','restart','/migrations','migrations','express','Router','./version.controller','get','/fetch','canUpdate','fetch','/reset','isAuthenticated','reset','/pull'];(function(_0x1342fd,_0x292cae){var _0x5b59c1=function(_0x556835){while(--_0x556835){_0x1342fd['push'](_0x1342fd['shift']());}};_0x5b59c1(++_0x292cae);}(_0x7732,0x135));var _0x2773=function(_0x3877c1,_0x238c29){_0x3877c1=_0x3877c1-0x0;var _0x59056a=_0x7732[_0x3877c1];return _0x59056a;};'use strict';var express=require(_0x2773('0x0'));var router=express[_0x2773('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x2773('0x2'));router[_0x2773('0x3')]('/',controller['index']);router[_0x2773('0x3')](_0x2773('0x4'),auth['isAuthenticated'](),auth[_0x2773('0x5')](),controller[_0x2773('0x6')]);router[_0x2773('0x3')](_0x2773('0x7'),auth[_0x2773('0x8')](),auth['canUpdate'](),controller[_0x2773('0x9')]);router[_0x2773('0x3')](_0x2773('0xa'),auth['isAuthenticated'](),auth[_0x2773('0x5')](),controller[_0x2773('0xb')]);router['get'](_0x2773('0xc'),auth[_0x2773('0x8')](),controller[_0x2773('0xd')]);router[_0x2773('0x3')](_0x2773('0xe'),controller[_0x2773('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index fcbfc34..29b96d5 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 _0x4910=['reset','--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','length','replace','.js','push','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','join','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','Database\x20already\x20up-to-date','umzug','path','lodash','version','compare-versions','child_process','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','exports','query','fetch','tags','latest','2.0.0','status','origin','master','error','json','info','git\x20fetch','git\x20fetch\x20origin\x20master'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4910,0x1d9));var _0x0491=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4910[_0xa464c9];return _0x3d73c4;};'use strict';var Umzug=require(_0x0491('0x0'));var path=require(_0x0491('0x1'));var fs=require('fs');var _=require(_0x0491('0x2'));var pkginfo=require('pkginfo')(module,_0x0491('0x3'));var compareVersions=require(_0x0491('0x4'));var exec=require(_0x0491('0x5'))[_0x0491('0x6')];var db=require(_0x0491('0x7'))['db'];var config=require('../../config/environment');var pm2=require(_0x0491('0x8'));var logger=require(_0x0491('0x9'))(_0x0491('0xa'));var git=require(_0x0491('0xb'))(config[_0x0491('0xc')]);exports['index']=function(_0x3b7b10,_0x29c0d0){var _0xf50a53={'current':module[_0x0491('0xd')][_0x0491('0x3')],'phonebar':0x2};if(_0x3b7b10['query']&&_0x3b7b10[_0x0491('0xe')]['latest']){return git[_0x0491('0xf')]()[_0x0491('0x10')](function(_0x3ff9c6,_0x108308){_0xf50a53[_0x0491('0x11')]=(_0x3ff9c6?module[_0x0491('0xd')][_0x0491('0x3')]:_0x108308[_0x0491('0x11')])||_0x0491('0x12');return _0x29c0d0[_0x0491('0x13')](0xc8)['json'](_0xf50a53);});}else{return _0x29c0d0[_0x0491('0x13')](0xc8)['json'](_0xf50a53);}};exports[_0x0491('0xf')]=function(_0x5d32fa,_0x4bbd03){return git[_0x0491('0xf')]([_0x0491('0x14'),_0x0491('0x15')],function(_0x2f1a37){if(_0x2f1a37){logger[_0x0491('0x16')](_0x2f1a37);return _0x4bbd03[_0x0491('0x13')](0x1f4)[_0x0491('0x17')](_0x2f1a37);}logger[_0x0491('0x18')](_0x0491('0x19'));return _0x4bbd03[_0x0491('0x13')](0xc8)['json']({'output':_0x0491('0x1a')});});};exports[_0x0491('0x1b')]=function(_0x12990a,_0x31bc2c){return git[_0x0491('0x1b')]([_0x0491('0x1c'),'FETCH_HEAD'],function(_0x1a924b){if(_0x1a924b){logger[_0x0491('0x16')](_0x1a924b);return _0x31bc2c['status'](0x1f4)['json'](_0x1a924b);}logger[_0x0491('0x18')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x31bc2c[_0x0491('0x13')](0xc8)[_0x0491('0x17')]({'output':'git\x20reset\x20--hard'});});};exports[_0x0491('0x1d')]=function(_0x22776d,_0x23b9f6){exec(_0x0491('0x1e'),function(_0x56cb4a,_0x23146d,_0x358117){logger[_0x0491('0x18')](_0x23146d);logger['info'](_0x358117);if(_0x56cb4a){logger[_0x0491('0x16')](_0x56cb4a);return _0x23b9f6[_0x0491('0x13')](0x1f4)[_0x0491('0x17')](_0x56cb4a);}return _0x23b9f6[_0x0491('0x13')](0xc8)[_0x0491('0x17')]({'output':_0x23146d});});};exports[_0x0491('0x1f')]=function(_0x207ff9,_0x4ab232){return pm2[_0x0491('0x1f')](_0x0491('0x20'))[_0x0491('0x21')](function(_0x93bc14){logger[_0x0491('0x18')]('pm2\x20restart\x20motion\x20%s',_0x93bc14);return _0x4ab232[_0x0491('0x13')](0xc8)[_0x0491('0x17')]({'output':_0x0491('0x22')});})[_0x0491('0x23')](function(_0xe0e31e){logger[_0x0491('0x16')](_0xe0e31e);return _0x4ab232[_0x0491('0x13')](0x1f4)[_0x0491('0x17')](_0xe0e31e);});};exports[_0x0491('0x24')]=function(_0x15b80d,_0x5c9ee2){var _0x4fbeb8=fs['readdirSync'](path['join'](config[_0x0491('0xc')],'server',_0x0491('0x24')));var _0xb82361=[];for(var _0x3b66d0=0x0;_0x3b66d0<_0x4fbeb8[_0x0491('0x25')];_0x3b66d0++){var _0x2e3223=_0x4fbeb8[_0x3b66d0][_0x0491('0x26')](_0x0491('0x27'),'');if(compareVersions(module['exports'][_0x0491('0x3')],_0x2e3223)===-0x1){_0xb82361[_0x0491('0x28')](_0x2e3223);}}if(_0xb82361[_0x0491('0x25')]){var _0x5cb278=_0xb82361['sort'](compareVersions);var _0x57103a=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x0491('0x29')],'modelName':'Migration','columnName':_0x0491('0x3')},'migrations':{'params':[db[_0x0491('0x2a')][_0x0491('0x2b')](),db[_0x0491('0x2a')][_0x0491('0x2c')],function(){throw new Error(_0x0491('0x2d'));}],'path':path[_0x0491('0x2e')](config[_0x0491('0xc')],'server',_0x0491('0x24')),'pattern':/\.js$/}});_0x57103a['up']({'migrations':_['map'](_0x5cb278,function(_0x1f24e9){return _0x1f24e9+_0x0491('0x27');})})['then'](function(){return _0x5c9ee2[_0x0491('0x13')](0xc8)['json']({'output':_0x0491('0x2f')+module[_0x0491('0xd')][_0x0491('0x3')]+_0x0491('0x30')+_['last'](_0x5cb278),'migrations':_['join'](_0x5cb278)});})[_0x0491('0x23')](function(_0x23379f){if(_0x23379f instanceof db[_0x0491('0x2a')]['UniqueConstraintError']){return _0x5c9ee2[_0x0491('0x13')](0xc8)['json']({'output':_0x0491('0x31')});}else{return _0x5c9ee2['status'](0x1f4)[_0x0491('0x17')](_0x23379f);}});}else{return _0x5c9ee2[_0x0491('0x13')](0xc8)[_0x0491('0x17')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x1280=['length','replace','.js','sort','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','join','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','compare-versions','child_process','exec','../../config/environment','../../config/pm2','../../config/logger','update','index','query','latest','fetch','tags','exports','2.0.0','json','origin','master','error','status','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','root','migrations'];(function(_0x46c9da,_0x447273){var _0x14ff4b=function(_0x53d9b3){while(--_0x53d9b3){_0x46c9da['push'](_0x46c9da['shift']());}};_0x14ff4b(++_0x447273);}(_0x1280,0xac));var _0x0128=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1280[_0x20a584];return _0x4b41a8;};'use strict';var Umzug=require(_0x0128('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x0128('0x1'));var pkginfo=require(_0x0128('0x2'))(module,_0x0128('0x3'));var compareVersions=require(_0x0128('0x4'));var exec=require(_0x0128('0x5'))[_0x0128('0x6')];var db=require('../../mysqldb')['db'];var config=require(_0x0128('0x7'));var pm2=require(_0x0128('0x8'));var logger=require(_0x0128('0x9'))(_0x0128('0xa'));var git=require('simple-git')(config['root']);exports[_0x0128('0xb')]=function(_0x134abd,_0x2b8b86){var _0x43a105={'current':module['exports'][_0x0128('0x3')],'phonebar':0x2};if(_0x134abd[_0x0128('0xc')]&&_0x134abd['query'][_0x0128('0xd')]){return git[_0x0128('0xe')]()[_0x0128('0xf')](function(_0x55da9d,_0x515c8e){_0x43a105[_0x0128('0xd')]=(_0x55da9d?module[_0x0128('0x10')][_0x0128('0x3')]:_0x515c8e['latest'])||_0x0128('0x11');return _0x2b8b86['status'](0xc8)[_0x0128('0x12')](_0x43a105);});}else{return _0x2b8b86['status'](0xc8)[_0x0128('0x12')](_0x43a105);}};exports['fetch']=function(_0xbc843d,_0x4bad0a){return git[_0x0128('0xe')]([_0x0128('0x13'),_0x0128('0x14')],function(_0x5a42eb){if(_0x5a42eb){logger[_0x0128('0x15')](_0x5a42eb);return _0x4bad0a[_0x0128('0x16')](0x1f4)['json'](_0x5a42eb);}logger[_0x0128('0x17')](_0x0128('0x18'));return _0x4bad0a[_0x0128('0x16')](0xc8)[_0x0128('0x12')]({'output':_0x0128('0x19')});});};exports[_0x0128('0x1a')]=function(_0x5bdc3e,_0x2524b1){return git[_0x0128('0x1a')]([_0x0128('0x1b'),_0x0128('0x1c')],function(_0xe5b7d2){if(_0xe5b7d2){logger[_0x0128('0x15')](_0xe5b7d2);return _0x2524b1['status'](0x1f4)[_0x0128('0x12')](_0xe5b7d2);}logger[_0x0128('0x17')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2524b1['status'](0xc8)[_0x0128('0x12')]({'output':_0x0128('0x1d')});});};exports[_0x0128('0x1e')]=function(_0x17949a,_0x34f6c4){exec(_0x0128('0x1f'),function(_0x10b436,_0x167c33,_0x544f5c){logger['info'](_0x167c33);logger[_0x0128('0x17')](_0x544f5c);if(_0x10b436){logger['error'](_0x10b436);return _0x34f6c4[_0x0128('0x16')](0x1f4)[_0x0128('0x12')](_0x10b436);}return _0x34f6c4[_0x0128('0x16')](0xc8)['json']({'output':_0x167c33});});};exports[_0x0128('0x20')]=function(_0x54e1cc,_0x170f4b){return pm2[_0x0128('0x20')](_0x0128('0x21'))[_0x0128('0x22')](function(_0x4b0f88){logger['info'](_0x0128('0x23'),_0x4b0f88);return _0x170f4b[_0x0128('0x16')](0xc8)['json']({'output':_0x0128('0x24')});})[_0x0128('0x25')](function(_0x4ee634){logger[_0x0128('0x15')](_0x4ee634);return _0x170f4b[_0x0128('0x16')](0x1f4)[_0x0128('0x12')](_0x4ee634);});};exports['migrations']=function(_0x5b7ab2,_0x3340ac){var _0x586310=fs['readdirSync'](path['join'](config[_0x0128('0x26')],'server',_0x0128('0x27')));var _0x2b9f40=[];for(var _0x345023=0x0;_0x345023<_0x586310[_0x0128('0x28')];_0x345023++){var _0x5a021f=_0x586310[_0x345023][_0x0128('0x29')](_0x0128('0x2a'),'');if(compareVersions(module[_0x0128('0x10')][_0x0128('0x3')],_0x5a021f)===-0x1){_0x2b9f40['push'](_0x5a021f);}}if(_0x2b9f40[_0x0128('0x28')]){var _0x40b088=_0x2b9f40[_0x0128('0x2b')](compareVersions);var _0x20f35f=new Umzug({'storage':_0x0128('0x2c'),'storageOptions':{'model':db[_0x0128('0x2d')],'modelName':_0x0128('0x2d'),'columnName':'version'},'migrations':{'params':[db['sequelize']['getQueryInterface'](),db[_0x0128('0x2c')][_0x0128('0x2e')],function(){throw new Error(_0x0128('0x2f'));}],'path':path['join'](config[_0x0128('0x26')],'server',_0x0128('0x27')),'pattern':/\.js$/}});_0x20f35f['up']({'migrations':_[_0x0128('0x30')](_0x40b088,function(_0x3aaf39){return _0x3aaf39+_0x0128('0x2a');})})['then'](function(){return _0x3340ac['status'](0xc8)[_0x0128('0x12')]({'output':_0x0128('0x31')+module[_0x0128('0x10')][_0x0128('0x3')]+'\x20to\x20'+_['last'](_0x40b088),'migrations':_[_0x0128('0x32')](_0x40b088)});})[_0x0128('0x25')](function(_0x3898a5){if(_0x3898a5 instanceof db[_0x0128('0x2c')][_0x0128('0x33')]){return _0x3340ac['status'](0xc8)[_0x0128('0x12')]({'output':_0x0128('0x34')});}else{return _0x3340ac[_0x0128('0x16')](0x1f4)['json'](_0x3898a5);}});}else{return _0x3340ac['status'](0xc8)[_0x0128('0x12')]({'output':_0x0128('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index ba47c3a..5a57341 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 _0x363b=['get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1b9bfe,_0x36fdb3){var _0x4dba33=function(_0x3b4c00){while(--_0x3b4c00){_0x1b9bfe['push'](_0x1b9bfe['shift']());}};_0x4dba33(++_0x36fdb3);}(_0x363b,0x11b));var _0xb363=function(_0x5f0d96,_0x350939){_0x5f0d96=_0x5f0d96-0x0;var _0x2771b0=_0x363b[_0x5f0d96];return _0x2771b0;};'use strict';var multer=require(_0xb363('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb363('0x1'));var express=require(_0xb363('0x2'));var router=express[_0xb363('0x3')]();var auth=require(_0xb363('0x4'));var interaction=require(_0xb363('0x5'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0xb363('0x6')]('/',auth['isAuthenticated'](),controller[_0xb363('0x7')]);router[_0xb363('0x6')](_0xb363('0x8'),auth[_0xb363('0x9')](),controller['describe']);router['get'](_0xb363('0xa'),auth[_0xb363('0x9')](),controller[_0xb363('0xb')]);router[_0xb363('0xc')]('/',auth[_0xb363('0x9')](),controller[_0xb363('0xd')]);router[_0xb363('0xe')](_0xb363('0xa'),auth[_0xb363('0x9')](),controller[_0xb363('0xf')]);router[_0xb363('0x10')](_0xb363('0xa'),auth[_0xb363('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4901=['index','/describe','describe','isAuthenticated','create','put','/:id','update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get'];(function(_0x3a16d4,_0x23ecda){var _0x31ea9c=function(_0x35fea8){while(--_0x35fea8){_0x3a16d4['push'](_0x3a16d4['shift']());}};_0x31ea9c(++_0x23ecda);}(_0x4901,0x13b));var _0x1490=function(_0x360f64,_0x4c37b7){_0x360f64=_0x360f64-0x0;var _0x530e02=_0x4901[_0x360f64];return _0x530e02;};'use strict';var multer=require(_0x1490('0x0'));var util=require(_0x1490('0x1'));var path=require(_0x1490('0x2'));var timeout=require(_0x1490('0x3'));var express=require('express');var router=express[_0x1490('0x4')]();var auth=require(_0x1490('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1490('0x6'));var controller=require(_0x1490('0x7'));router[_0x1490('0x8')]('/',auth['isAuthenticated'](),controller[_0x1490('0x9')]);router[_0x1490('0x8')](_0x1490('0xa'),auth['isAuthenticated'](),controller[_0x1490('0xb')]);router[_0x1490('0x8')]('/:id',auth[_0x1490('0xc')](),controller['show']);router['post']('/',auth[_0x1490('0xc')](),controller[_0x1490('0xd')]);router[_0x1490('0xe')](_0x1490('0xf'),auth[_0x1490('0xc')](),controller[_0x1490('0x10')]);router[_0x1490('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 7af6669..3997ac2 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 _0xac9d=['DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x118f3d,_0x42b20f){var _0x4d2917=function(_0x27c171){while(--_0x27c171){_0x118f3d['push'](_0x118f3d['shift']());}};_0x4d2917(++_0x42b20f);}(_0xac9d,0x14d));var _0xdac9=function(_0x1622a0,_0x2b55a9){_0x1622a0=_0x1622a0-0x0;var _0x2a2308=_0xac9d[_0x1622a0];return _0x2a2308;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'type':{'type':Sequelize[_0xdac9('0x2')]},'uniqueid':{'type':Sequelize[_0xdac9('0x2')]},'calleridnum':{'type':Sequelize[_0xdac9('0x2')]},'calleridname':{'type':Sequelize[_0xdac9('0x2')]},'queue':{'type':Sequelize[_0xdac9('0x2')]},'interface':{'type':Sequelize[_0xdac9('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xdac9('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xdac9('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xdac9('0x3')]},'agentdumpAt':{'type':Sequelize[_0xdac9('0x3')]},'holdtime':{'type':Sequelize[_0xdac9('0x4')]},'agentcomplete':{'type':Sequelize[_0xdac9('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xdac9('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xdac9('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xdac9('0x4')]},'reason':{'type':Sequelize[_0xdac9('0x2')]},'lastevent':{'type':Sequelize[_0xdac9('0x2')]},'channel':{'type':Sequelize[_0xdac9('0x2')]},'channelstate':{'type':Sequelize[_0xdac9('0x4')]},'channelstatedesc':{'type':Sequelize[_0xdac9('0x2')]},'connectedlinenum':{'type':Sequelize[_0xdac9('0x2')]},'connectedlinename':{'type':Sequelize[_0xdac9('0x2')]},'language':{'type':Sequelize[_0xdac9('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xdac9('0x2')]},'exten':{'type':Sequelize[_0xdac9('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xdac9('0x2')]},'destchannelstate':{'type':Sequelize[_0xdac9('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xdac9('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xdac9('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdac9('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xdac9('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xdac9('0x2')]},'destexten':{'type':Sequelize[_0xdac9('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xdac9('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xdac9('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xdac9('0x2')]},'transfer':{'type':Sequelize[_0xdac9('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xdac9('0x2')],'comment':_0xdac9('0x6')},'transferexten':{'type':Sequelize[_0xdac9('0x2')]},'transferuniqueid':{'type':Sequelize[_0xdac9('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x31f0=['INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x31f0,0xb7));var _0x031f=function(_0x2aa68e,_0x5284fb){_0x2aa68e=_0x2aa68e-0x0;var _0x3ad84c=_0x31f0[_0x2aa68e];return _0x3ad84c;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'type':{'type':Sequelize[_0x031f('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x031f('0x1')]},'calleridname':{'type':Sequelize[_0x031f('0x1')]},'queue':{'type':Sequelize[_0x031f('0x1')]},'interface':{'type':Sequelize[_0x031f('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x031f('0x2')]},'agentconnectAt':{'type':Sequelize[_0x031f('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x031f('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x031f('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x031f('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x031f('0x3')]},'agentacw':{'type':Sequelize[_0x031f('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x031f('0x1')]},'lastevent':{'type':Sequelize[_0x031f('0x1')]},'channel':{'type':Sequelize[_0x031f('0x1')]},'channelstate':{'type':Sequelize[_0x031f('0x3')]},'channelstatedesc':{'type':Sequelize[_0x031f('0x1')]},'connectedlinenum':{'type':Sequelize[_0x031f('0x1')]},'connectedlinename':{'type':Sequelize[_0x031f('0x1')]},'language':{'type':Sequelize[_0x031f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x031f('0x1')]},'exten':{'type':Sequelize[_0x031f('0x1')]},'priority':{'type':Sequelize[_0x031f('0x1')]},'destchannel':{'type':Sequelize[_0x031f('0x1')]},'destchannelstate':{'type':Sequelize[_0x031f('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x031f('0x1')]},'destcalleridnum':{'type':Sequelize[_0x031f('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x031f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x031f('0x1')]},'destlanguage':{'type':Sequelize[_0x031f('0x1')]},'destaccountcode':{'type':Sequelize[_0x031f('0x1')]},'destcontext':{'type':Sequelize[_0x031f('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x031f('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x031f('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x031f('0x1')]},'transfer':{'type':Sequelize[_0x031f('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x031f('0x5')},'transferexten':{'type':Sequelize[_0x031f('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x031f('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 38ba6c7..3b15b38 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 _0x5043=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','VoiceAgentReport','key','model','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','count','includeAll','include','rows','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x5043,0xd7));var _0x3504=function(_0x4a54d5,_0xd48b57){_0x4a54d5=_0x4a54d5-0x0;var _0x14aefb=_0x5043[_0x4a54d5];return _0x14aefb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3504('0x0'));var rimraf=require(_0x3504('0x1'));var zipdir=require(_0x3504('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3504('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3504('0x4'));var util=require(_0x3504('0x5'));var path=require(_0x3504('0x6'));var sox=require(_0x3504('0x7'));var csv=require(_0x3504('0x8'));var ejs=require(_0x3504('0x9'));var fs=require('fs');var _=require(_0x3504('0xa'));var squel=require(_0x3504('0xb'));var crypto=require(_0x3504('0xc'));var jsforce=require(_0x3504('0xd'));var deskjs=require(_0x3504('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3504('0xf'));var Papa=require(_0x3504('0x10'));var Redis=require(_0x3504('0x11'));var authService=require(_0x3504('0x12'));var qs=require(_0x3504('0x13'));var as=require(_0x3504('0x14'));var hardwareService=require(_0x3504('0x15'));var logger=require(_0x3504('0x16'))(_0x3504('0x17'));var utils=require('../../config/utils');var config=require(_0x3504('0x18'));var db=require(_0x3504('0x19'))['db'];function respondWithStatusCode(_0x5cd28f,_0x242813){_0x242813=_0x242813||0xcc;return function(_0x50f5f8){if(_0x50f5f8){return _0x5cd28f['sendStatus'](_0x242813);}return _0x5cd28f[_0x3504('0x1a')](_0x242813)['end']();};}function respondWithResult(_0x145866,_0xb0e978){_0xb0e978=_0xb0e978||0xc8;return function(_0x3eb261){if(_0x3eb261){return _0x145866[_0x3504('0x1a')](_0xb0e978)[_0x3504('0x1b')](_0x3eb261);}};}function respondWithFilteredResult(_0x4c05da,_0xd53991){return function(_0x5e8ac3){if(_0x5e8ac3){var _0x48fd1a=_0x5e8ac3['count'],_0x1dc5b7=_0xd53991[_0x3504('0x1c')],_0x349154=_0xd53991[_0x3504('0x1c')]+_0xd53991['limit'],_0x223b10;if(_0x349154>=_0x48fd1a){_0x349154=_0x48fd1a;_0x223b10=0xc8;}else{_0x223b10=0xce;}_0x4c05da['status'](_0x223b10);return _0x4c05da[_0x3504('0x1d')](_0x3504('0x1e'),_0x1dc5b7+'-'+_0x349154+'/'+_0x48fd1a)[_0x3504('0x1b')](_0x5e8ac3);}return null;};}function patchUpdates(_0x49d585){return function(_0x42359c){try{jsonpatch[_0x3504('0x1f')](_0x42359c,_0x49d585,!![]);}catch(_0x3bcef9){return BPromise[_0x3504('0x20')](_0x3bcef9);}return _0x42359c[_0x3504('0x21')]();};}function saveUpdates(_0x1ddae8,_0x566169){return function(_0x5c9f2c){if(_0x5c9f2c){return _0x5c9f2c[_0x3504('0x22')](_0x1ddae8)[_0x3504('0x23')](function(_0x27befc){return _0x27befc;});}return null;};}function removeEntity(_0x525c20,_0x330907){return function(_0x441ff4){if(_0x441ff4){return _0x441ff4[_0x3504('0x24')]()[_0x3504('0x23')](function(){_0x525c20[_0x3504('0x1a')](0xcc)[_0x3504('0x25')]();});}};}function handleEntityNotFound(_0x593360,_0x248e83){return function(_0x4f28ff){if(!_0x4f28ff){_0x593360[_0x3504('0x26')](0x194);}return _0x4f28ff;};}function handleError(_0xe8cd90,_0x3a5482){_0x3a5482=_0x3a5482||0x1f4;return function(_0x546de6){logger[_0x3504('0x27')](_0x546de6[_0x3504('0x28')]);if(_0x546de6['name']){delete _0x546de6[_0x3504('0x29')];}_0xe8cd90[_0x3504('0x1a')](_0x3a5482)['send'](_0x546de6);};}exports[_0x3504('0x2a')]=function(_0xaecd39,_0x174b3e){var _0x4b8e0c={},_0x17f58f={},_0x168a31={'count':0x0,'rows':[]};var _0x337864=_[_0x3504('0x2b')](db[_0x3504('0x2c')]['rawAttributes'],function(_0x3e49b5){return{'name':_0x3e49b5['fieldName'],'type':_0x3e49b5['type'][_0x3504('0x2d')]};});_0x17f58f[_0x3504('0x2e')]=_['map'](_0x337864,_0x3504('0x29'));_0x17f58f[_0x3504('0x2f')]=_['keys'](_0xaecd39[_0x3504('0x2f')]);_0x17f58f[_0x3504('0x30')]=_['intersection'](_0x17f58f['model'],_0x17f58f[_0x3504('0x2f')]);_0x4b8e0c['attributes']=_[_0x3504('0x31')](_0x17f58f[_0x3504('0x2e')],qs['fields'](_0xaecd39[_0x3504('0x2f')][_0x3504('0x32')]));_0x4b8e0c[_0x3504('0x33')]=_0x4b8e0c[_0x3504('0x33')][_0x3504('0x34')]?_0x4b8e0c[_0x3504('0x33')]:_0x17f58f[_0x3504('0x2e')];if(!_0xaecd39[_0x3504('0x2f')]['hasOwnProperty'](_0x3504('0x35'))){_0x4b8e0c[_0x3504('0x36')]=qs[_0x3504('0x36')](_0xaecd39['query'][_0x3504('0x36')]);_0x4b8e0c[_0x3504('0x1c')]=qs['offset'](_0xaecd39[_0x3504('0x2f')][_0x3504('0x1c')]);}_0x4b8e0c[_0x3504('0x37')]=qs[_0x3504('0x38')](_0xaecd39[_0x3504('0x2f')][_0x3504('0x38')]);_0x4b8e0c['where']=qs[_0x3504('0x30')](_[_0x3504('0x39')](_0xaecd39[_0x3504('0x2f')],_0x17f58f[_0x3504('0x30')]),_0x337864);if(_0xaecd39[_0x3504('0x2f')][_0x3504('0x3a')]){_0x4b8e0c['where']=_['merge'](_0x4b8e0c[_0x3504('0x3b')],{'$or':_[_0x3504('0x2b')](_0x337864,function(_0x46b9a5){if(_0x46b9a5[_0x3504('0x3c')]!==_0x3504('0x3d')){var _0x598efc={};_0x598efc[_0x46b9a5[_0x3504('0x29')]]={'$like':'%'+_0xaecd39[_0x3504('0x2f')][_0x3504('0x3a')]+'%'};return _0x598efc;}})});}_0x4b8e0c=_[_0x3504('0x3e')]({},_0x4b8e0c,_0xaecd39[_0x3504('0x3f')]);var _0x5122ff={'where':_0x4b8e0c[_0x3504('0x3b')]};return db[_0x3504('0x2c')]['count'](_0x5122ff)[_0x3504('0x23')](function(_0x30e7e0){_0x168a31[_0x3504('0x40')]=_0x30e7e0;if(_0xaecd39[_0x3504('0x2f')][_0x3504('0x41')]){_0x4b8e0c[_0x3504('0x42')]=[{'all':!![]}];}return db[_0x3504('0x2c')]['findAll'](_0x4b8e0c);})['then'](function(_0x293b52){_0x168a31[_0x3504('0x43')]=_0x293b52;return _0x168a31;})[_0x3504('0x23')](respondWithFilteredResult(_0x174b3e,_0x4b8e0c))['catch'](handleError(_0x174b3e,null));};exports[_0x3504('0x44')]=function(_0xd3d955,_0x39e1a7){var _0x194324={'raw':![],'where':{'id':_0xd3d955[_0x3504('0x45')]['id']}},_0x41fc42={};_0x41fc42['model']=_[_0x3504('0x46')](db['VoiceAgentReport'][_0x3504('0x47')]);_0x41fc42[_0x3504('0x2f')]=_['keys'](_0xd3d955[_0x3504('0x2f')]);_0x41fc42[_0x3504('0x30')]=_['intersection'](_0x41fc42[_0x3504('0x2e')],_0x41fc42[_0x3504('0x2f')]);_0x194324[_0x3504('0x33')]=_[_0x3504('0x31')](_0x41fc42[_0x3504('0x2e')],qs[_0x3504('0x32')](_0xd3d955[_0x3504('0x2f')]['fields']));_0x194324[_0x3504('0x33')]=_0x194324[_0x3504('0x33')][_0x3504('0x34')]?_0x194324[_0x3504('0x33')]:_0x41fc42[_0x3504('0x2e')];if(_0xd3d955[_0x3504('0x2f')][_0x3504('0x41')]){_0x194324[_0x3504('0x42')]=[{'all':!![]}];}_0x194324=_[_0x3504('0x3e')]({},_0x194324,_0xd3d955[_0x3504('0x3f')]);return db[_0x3504('0x2c')][_0x3504('0x48')](_0x194324)[_0x3504('0x23')](handleEntityNotFound(_0x39e1a7,null))[_0x3504('0x23')](respondWithResult(_0x39e1a7,null))[_0x3504('0x49')](handleError(_0x39e1a7,null));};exports[_0x3504('0x4a')]=function(_0x34e606,_0x199dc7){return db[_0x3504('0x2c')][_0x3504('0x4a')](_0x34e606[_0x3504('0x4b')],{})[_0x3504('0x23')](respondWithResult(_0x199dc7,0xc9))[_0x3504('0x49')](handleError(_0x199dc7,null));};exports['update']=function(_0x536b9f,_0x154687){if(_0x536b9f[_0x3504('0x4b')]['id']){delete _0x536b9f[_0x3504('0x4b')]['id'];}return db[_0x3504('0x2c')]['find']({'where':{'id':_0x536b9f[_0x3504('0x45')]['id']}})[_0x3504('0x23')](handleEntityNotFound(_0x154687,null))[_0x3504('0x23')](saveUpdates(_0x536b9f[_0x3504('0x4b')],null))[_0x3504('0x23')](respondWithResult(_0x154687,null))[_0x3504('0x49')](handleError(_0x154687,null));};exports['destroy']=function(_0x433f47,_0x564966){return db[_0x3504('0x2c')]['find']({'where':{'id':_0x433f47[_0x3504('0x45')]['id']}})[_0x3504('0x23')](handleEntityNotFound(_0x564966,null))[_0x3504('0x23')](removeEntity(_0x564966,null))[_0x3504('0x49')](handleError(_0x564966,null));};exports[_0x3504('0x4c')]=function(_0x5cab44,_0x25832d){return db['VoiceAgentReport'][_0x3504('0x4c')]()[_0x3504('0x23')](respondWithResult(_0x25832d,null))[_0x3504('0x49')](handleError(_0x25832d,null));}; \ No newline at end of file +var _0x2292=['fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','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','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','VoiceAgentReport','rawAttributes'];(function(_0xdb61d0,_0x3a52be){var _0x5ab079=function(_0x2d902b){while(--_0x2d902b){_0xdb61d0['push'](_0xdb61d0['shift']());}};_0x5ab079(++_0x3a52be);}(_0x2292,0x19b));var _0x2229=function(_0x14f2fa,_0x2004bd){_0x14f2fa=_0x14f2fa-0x0;var _0x2b3e45=_0x2292[_0x14f2fa];return _0x2b3e45;};'use strict';var pdf=require(_0x2229('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2229('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2229('0x2'));var moment=require(_0x2229('0x3'));var BPromise=require(_0x2229('0x4'));var Mustache=require(_0x2229('0x5'));var util=require(_0x2229('0x6'));var path=require('path');var sox=require(_0x2229('0x7'));var csv=require(_0x2229('0x8'));var ejs=require(_0x2229('0x9'));var fs=require('fs');var _=require(_0x2229('0xa'));var squel=require(_0x2229('0xb'));var crypto=require('crypto');var jsforce=require(_0x2229('0xc'));var deskjs=require(_0x2229('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2229('0xe'));var Papa=require(_0x2229('0xf'));var Redis=require(_0x2229('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2229('0x11'));var as=require(_0x2229('0x12'));var hardwareService=require(_0x2229('0x13'));var logger=require(_0x2229('0x14'))(_0x2229('0x15'));var utils=require(_0x2229('0x16'));var config=require(_0x2229('0x17'));var db=require(_0x2229('0x18'))['db'];function respondWithStatusCode(_0x528c69,_0x5c1cef){_0x5c1cef=_0x5c1cef||0xcc;return function(_0x57ede1){if(_0x57ede1){return _0x528c69[_0x2229('0x19')](_0x5c1cef);}return _0x528c69[_0x2229('0x1a')](_0x5c1cef)[_0x2229('0x1b')]();};}function respondWithResult(_0x4e81fc,_0x4b6e07){_0x4b6e07=_0x4b6e07||0xc8;return function(_0x3eea24){if(_0x3eea24){return _0x4e81fc['status'](_0x4b6e07)[_0x2229('0x1c')](_0x3eea24);}};}function respondWithFilteredResult(_0x931020,_0x10c3fb){return function(_0x416e57){if(_0x416e57){var _0x5ab957=_0x416e57['count'],_0x3a95b0=_0x10c3fb['offset'],_0x5b7b69=_0x10c3fb[_0x2229('0x1d')]+_0x10c3fb[_0x2229('0x1e')],_0x444a0e;if(_0x5b7b69>=_0x5ab957){_0x5b7b69=_0x5ab957;_0x444a0e=0xc8;}else{_0x444a0e=0xce;}_0x931020['status'](_0x444a0e);return _0x931020[_0x2229('0x1f')](_0x2229('0x20'),_0x3a95b0+'-'+_0x5b7b69+'/'+_0x5ab957)[_0x2229('0x1c')](_0x416e57);}return null;};}function patchUpdates(_0x127b4d){return function(_0x139e30){try{jsonpatch[_0x2229('0x21')](_0x139e30,_0x127b4d,!![]);}catch(_0x268719){return BPromise[_0x2229('0x22')](_0x268719);}return _0x139e30[_0x2229('0x23')]();};}function saveUpdates(_0x3f8aac,_0x45d54c){return function(_0x3e9cab){if(_0x3e9cab){return _0x3e9cab[_0x2229('0x24')](_0x3f8aac)['then'](function(_0x55f86e){return _0x55f86e;});}return null;};}function removeEntity(_0x98265e,_0x3aa5b9){return function(_0x22befd){if(_0x22befd){return _0x22befd['destroy']()[_0x2229('0x25')](function(){_0x98265e[_0x2229('0x1a')](0xcc)[_0x2229('0x1b')]();});}};}function handleEntityNotFound(_0x4782a6,_0x54352d){return function(_0x3a1a81){if(!_0x3a1a81){_0x4782a6[_0x2229('0x19')](0x194);}return _0x3a1a81;};}function handleError(_0x1f7097,_0x5c903a){_0x5c903a=_0x5c903a||0x1f4;return function(_0x2170fb){logger[_0x2229('0x26')](_0x2170fb['stack']);if(_0x2170fb[_0x2229('0x27')]){delete _0x2170fb[_0x2229('0x27')];}_0x1f7097[_0x2229('0x1a')](_0x5c903a)[_0x2229('0x28')](_0x2170fb);};}exports[_0x2229('0x29')]=function(_0x3ed65e,_0x2dde21){var _0x479228={},_0x3e55e4={},_0x593c61={'count':0x0,'rows':[]};var _0x399e37=_[_0x2229('0x2a')](db[_0x2229('0x2b')][_0x2229('0x2c')],function(_0x525dc6){return{'name':_0x525dc6[_0x2229('0x2d')],'type':_0x525dc6[_0x2229('0x2e')]['key']};});_0x3e55e4[_0x2229('0x2f')]=_[_0x2229('0x2a')](_0x399e37,_0x2229('0x27'));_0x3e55e4[_0x2229('0x30')]=_[_0x2229('0x31')](_0x3ed65e[_0x2229('0x30')]);_0x3e55e4[_0x2229('0x32')]=_[_0x2229('0x33')](_0x3e55e4[_0x2229('0x2f')],_0x3e55e4[_0x2229('0x30')]);_0x479228[_0x2229('0x34')]=_[_0x2229('0x33')](_0x3e55e4[_0x2229('0x2f')],qs[_0x2229('0x35')](_0x3ed65e['query'][_0x2229('0x35')]));_0x479228[_0x2229('0x34')]=_0x479228['attributes'][_0x2229('0x36')]?_0x479228[_0x2229('0x34')]:_0x3e55e4[_0x2229('0x2f')];if(!_0x3ed65e[_0x2229('0x30')][_0x2229('0x37')](_0x2229('0x38'))){_0x479228[_0x2229('0x1e')]=qs['limit'](_0x3ed65e['query'][_0x2229('0x1e')]);_0x479228[_0x2229('0x1d')]=qs['offset'](_0x3ed65e[_0x2229('0x30')][_0x2229('0x1d')]);}_0x479228[_0x2229('0x39')]=qs['sort'](_0x3ed65e[_0x2229('0x30')]['sort']);_0x479228[_0x2229('0x3a')]=qs[_0x2229('0x32')](_[_0x2229('0x3b')](_0x3ed65e[_0x2229('0x30')],_0x3e55e4['filters']),_0x399e37);if(_0x3ed65e[_0x2229('0x30')][_0x2229('0x3c')]){_0x479228[_0x2229('0x3a')]=_[_0x2229('0x3d')](_0x479228[_0x2229('0x3a')],{'$or':_[_0x2229('0x2a')](_0x399e37,function(_0x24c561){if(_0x24c561[_0x2229('0x2e')]!==_0x2229('0x3e')){var _0x113475={};_0x113475[_0x24c561['name']]={'$like':'%'+_0x3ed65e[_0x2229('0x30')][_0x2229('0x3c')]+'%'};return _0x113475;}})});}_0x479228=_[_0x2229('0x3d')]({},_0x479228,_0x3ed65e[_0x2229('0x3f')]);var _0x582aea={'where':_0x479228['where']};return db[_0x2229('0x2b')][_0x2229('0x40')](_0x582aea)['then'](function(_0x3d7321){_0x593c61[_0x2229('0x40')]=_0x3d7321;if(_0x3ed65e[_0x2229('0x30')][_0x2229('0x41')]){_0x479228[_0x2229('0x42')]=[{'all':!![]}];}return db[_0x2229('0x2b')][_0x2229('0x43')](_0x479228);})[_0x2229('0x25')](function(_0x5bb8cf){_0x593c61[_0x2229('0x44')]=_0x5bb8cf;return _0x593c61;})[_0x2229('0x25')](respondWithFilteredResult(_0x2dde21,_0x479228))[_0x2229('0x45')](handleError(_0x2dde21,null));};exports[_0x2229('0x46')]=function(_0x4cce8f,_0x187195){var _0x1de71d={'raw':![],'where':{'id':_0x4cce8f[_0x2229('0x47')]['id']}},_0x3d6d21={};_0x3d6d21[_0x2229('0x2f')]=_[_0x2229('0x31')](db[_0x2229('0x2b')]['rawAttributes']);_0x3d6d21[_0x2229('0x30')]=_[_0x2229('0x31')](_0x4cce8f[_0x2229('0x30')]);_0x3d6d21['filters']=_[_0x2229('0x33')](_0x3d6d21[_0x2229('0x2f')],_0x3d6d21[_0x2229('0x30')]);_0x1de71d[_0x2229('0x34')]=_['intersection'](_0x3d6d21['model'],qs[_0x2229('0x35')](_0x4cce8f[_0x2229('0x30')][_0x2229('0x35')]));_0x1de71d[_0x2229('0x34')]=_0x1de71d[_0x2229('0x34')][_0x2229('0x36')]?_0x1de71d[_0x2229('0x34')]:_0x3d6d21[_0x2229('0x2f')];if(_0x4cce8f[_0x2229('0x30')][_0x2229('0x41')]){_0x1de71d[_0x2229('0x42')]=[{'all':!![]}];}_0x1de71d=_[_0x2229('0x3d')]({},_0x1de71d,_0x4cce8f[_0x2229('0x3f')]);return db[_0x2229('0x2b')][_0x2229('0x48')](_0x1de71d)[_0x2229('0x25')](handleEntityNotFound(_0x187195,null))[_0x2229('0x25')](respondWithResult(_0x187195,null))['catch'](handleError(_0x187195,null));};exports['create']=function(_0x332870,_0x3e9119){return db[_0x2229('0x2b')][_0x2229('0x49')](_0x332870[_0x2229('0x4a')],{})[_0x2229('0x25')](respondWithResult(_0x3e9119,0xc9))[_0x2229('0x45')](handleError(_0x3e9119,null));};exports[_0x2229('0x24')]=function(_0x2c811c,_0x388b2b){if(_0x2c811c[_0x2229('0x4a')]['id']){delete _0x2c811c[_0x2229('0x4a')]['id'];}return db[_0x2229('0x2b')][_0x2229('0x48')]({'where':{'id':_0x2c811c[_0x2229('0x47')]['id']}})[_0x2229('0x25')](handleEntityNotFound(_0x388b2b,null))[_0x2229('0x25')](saveUpdates(_0x2c811c['body'],null))['then'](respondWithResult(_0x388b2b,null))['catch'](handleError(_0x388b2b,null));};exports[_0x2229('0x4b')]=function(_0x3926de,_0x10f920){return db[_0x2229('0x2b')][_0x2229('0x48')]({'where':{'id':_0x3926de['params']['id']}})[_0x2229('0x25')](handleEntityNotFound(_0x10f920,null))[_0x2229('0x25')](removeEntity(_0x10f920,null))['catch'](handleError(_0x10f920,null));};exports['describe']=function(_0x389286,_0x272526){return db['VoiceAgentReport']['describe']()[_0x2229('0x25')](respondWithResult(_0x272526,null))['catch'](handleError(_0x272526,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index d2fc642..e3a32f8 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 _0x70e0=['rimraf','./voiceAgentReport.attributes','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x1e6f94,_0xea1ad){var _0x23d678=function(_0x595d3a){while(--_0x595d3a){_0x1e6f94['push'](_0x1e6f94['shift']());}};_0x23d678(++_0xea1ad);}(_0x70e0,0x17b));var _0x070e=function(_0x1c6e51,_0x18174d){_0x1c6e51=_0x1c6e51-0x0;var _0xc87c0c=_0x70e0[_0x1c6e51];return _0xc87c0c;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceAgentReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'fields':[_0x070e('0x9'),_0x070e('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x1941d7,_0x281346){var _0x1b9796=function(_0x4f9005){while(--_0x4f9005){_0x1941d7['push'](_0x1941d7['shift']());}};_0x1b9796(++_0x281346);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0xcb91[_0x1f5a63];return _0x30bb7a;};'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')]('VoiceAgentReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1cb9('0xa'),'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 d751a36..08f24e7 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 _0x4f86=['VoiceAgentReport','update','raw','where','attributes','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','VoiceAgentReport,\x20%s,\x20%s','body','options','CreateVoiceAgentReport','catch','UpdateVoiceAgentReport'];(function(_0x288de3,_0x2c5398){var _0x31b661=function(_0xbb99b4){while(--_0xbb99b4){_0x288de3['push'](_0x288de3['shift']());}};_0x31b661(++_0x2c5398);}(_0x4f86,0x1e5));var _0x64f8=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x4f86[_0x432682];return _0x463d05;};'use strict';var _=require(_0x64f8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x64f8('0x1'));var db=require(_0x64f8('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x64f8('0x3'))(_0x64f8('0x4'));var config=require(_0x64f8('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x64f8('0x6')][_0x64f8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xcc5539,_0x5ec1c4,_0x2868a9){return new BPromise(function(_0x11437b,_0x419a3d){return client[_0x64f8('0x8')](_0xcc5539,_0x2868a9)[_0x64f8('0x9')](function(_0x1c4ccf){logger[_0x64f8('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x5ec1c4,_0x64f8('0xb'));logger[_0x64f8('0xc')](_0x64f8('0xd'),_0x5ec1c4,_0x64f8('0xb'),JSON[_0x64f8('0xe')](_0x1c4ccf));if(_0x1c4ccf['error']){if(_0x1c4ccf[_0x64f8('0xf')][_0x64f8('0x10')]===0x1f4){logger[_0x64f8('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x5ec1c4,_0x1c4ccf[_0x64f8('0xf')][_0x64f8('0x11')]);return _0x419a3d(_0x1c4ccf[_0x64f8('0xf')][_0x64f8('0x11')]);}logger[_0x64f8('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x5ec1c4,_0x1c4ccf[_0x64f8('0xf')][_0x64f8('0x11')]);return _0x11437b(_0x1c4ccf[_0x64f8('0xf')]['message']);}else{logger['info']('VoiceAgentReport,\x20%s,\x20%s',_0x5ec1c4,'request\x20sent');_0x11437b(_0x1c4ccf[_0x64f8('0x12')][_0x64f8('0x11')]);}})['catch'](function(_0x9b4359){logger[_0x64f8('0xf')](_0x64f8('0x13'),_0x5ec1c4,_0x9b4359);_0x419a3d(_0x9b4359);});});}exports['CreateVoiceAgentReport']=function(_0x53fe02){var _0x49fad3=this;return new Promise(function(_0x1a91cf,_0x437c85){return db['VoiceAgentReport']['create'](_0x53fe02[_0x64f8('0x14')],{'raw':_0x53fe02[_0x64f8('0x15')]?_0x53fe02[_0x64f8('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4ae3af){logger[_0x64f8('0xa')](_0x64f8('0x16'),_0x53fe02);logger[_0x64f8('0xc')](_0x64f8('0x16'),_0x53fe02,JSON[_0x64f8('0xe')](_0x4ae3af));_0x1a91cf(_0x4ae3af);})[_0x64f8('0x17')](function(_0x1fb447){logger[_0x64f8('0xf')](_0x64f8('0x16'),_0x1fb447[_0x64f8('0x11')],_0x53fe02);_0x437c85(_0x49fad3[_0x64f8('0xf')](0x1f4,_0x1fb447[_0x64f8('0x11')]));});});};exports[_0x64f8('0x18')]=function(_0x58aab5){var _0x42e8d0=this;return new Promise(function(_0x44908a,_0x37ae90){return db[_0x64f8('0x19')][_0x64f8('0x1a')](_0x58aab5['body'],{'raw':_0x58aab5[_0x64f8('0x15')]?_0x58aab5['options'][_0x64f8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58aab5[_0x64f8('0x15')]?_0x58aab5[_0x64f8('0x15')][_0x64f8('0x1c')]||null:null,'attributes':_0x58aab5[_0x64f8('0x15')]?_0x58aab5[_0x64f8('0x15')][_0x64f8('0x1d')]||null:null,'limit':_0x58aab5[_0x64f8('0x15')]?_0x58aab5[_0x64f8('0x15')]['limit']||null:null})[_0x64f8('0x9')](function(_0x52449d){logger['info']('UpdateVoiceAgentReport',_0x58aab5);logger[_0x64f8('0xc')]('UpdateVoiceAgentReport',_0x58aab5,JSON[_0x64f8('0xe')](_0x52449d));_0x44908a(_0x52449d);})['catch'](function(_0x5b0291){logger[_0x64f8('0xf')](_0x64f8('0x18'),_0x5b0291[_0x64f8('0x11')],_0x58aab5);_0x37ae90(_0x42e8d0[_0x64f8('0xf')](0x1f4,_0x5b0291[_0x64f8('0x11')]));});});}; \ No newline at end of file +var _0xf44f=['jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','UpdateVoiceAgentReport','update','where','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x5e3c5b,_0x41ac53){var _0x426ccc=function(_0x21ddd1){while(--_0x21ddd1){_0x5e3c5b['push'](_0x5e3c5b['shift']());}};_0x426ccc(++_0x41ac53);}(_0xf44f,0xe8));var _0xff44=function(_0x1fa15a,_0x10106b){_0x1fa15a=_0x1fa15a-0x0;var _0x5b6cb2=_0xf44f[_0x1fa15a];return _0x5b6cb2;};'use strict';var _=require(_0xff44('0x0'));var util=require(_0xff44('0x1'));var moment=require(_0xff44('0x2'));var BPromise=require('bluebird');var rs=require(_0xff44('0x3'));var fs=require('fs');var Redis=require(_0xff44('0x4'));var db=require(_0xff44('0x5'))['db'];var utils=require(_0xff44('0x6'));var logger=require('../../config/logger')(_0xff44('0x7'));var config=require('../../config/environment');var jayson=require(_0xff44('0x8'));var client=jayson['client'][_0xff44('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6bdd23,_0x4f349c,_0x59721e){return new BPromise(function(_0x47f3e2,_0x5a6f15){return client[_0xff44('0xa')](_0x6bdd23,_0x59721e)[_0xff44('0xb')](function(_0x109534){logger[_0xff44('0xc')](_0xff44('0xd'),_0x4f349c,_0xff44('0xe'));logger[_0xff44('0xf')](_0xff44('0x10'),_0x4f349c,_0xff44('0xe'),JSON[_0xff44('0x11')](_0x109534));if(_0x109534['error']){if(_0x109534['error']['code']===0x1f4){logger[_0xff44('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x4f349c,_0x109534[_0xff44('0x12')][_0xff44('0x13')]);return _0x5a6f15(_0x109534[_0xff44('0x12')][_0xff44('0x13')]);}logger['error'](_0xff44('0xd'),_0x4f349c,_0x109534[_0xff44('0x12')]['message']);return _0x47f3e2(_0x109534[_0xff44('0x12')][_0xff44('0x13')]);}else{logger[_0xff44('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x4f349c,_0xff44('0xe'));_0x47f3e2(_0x109534['result'][_0xff44('0x13')]);}})[_0xff44('0x14')](function(_0x28e23d){logger[_0xff44('0x12')](_0xff44('0xd'),_0x4f349c,_0x28e23d);_0x5a6f15(_0x28e23d);});});}exports[_0xff44('0x15')]=function(_0x52fccb){var _0x40b8cd=this;return new Promise(function(_0x10d1a0,_0x2c61d4){return db[_0xff44('0x16')][_0xff44('0x17')](_0x52fccb[_0xff44('0x18')],{'raw':_0x52fccb[_0xff44('0x19')]?_0x52fccb[_0xff44('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xff44('0xb')](function(_0x4877c6){logger[_0xff44('0xc')]('CreateVoiceAgentReport',_0x52fccb);logger[_0xff44('0xf')]('CreateVoiceAgentReport',_0x52fccb,JSON[_0xff44('0x11')](_0x4877c6));_0x10d1a0(_0x4877c6);})['catch'](function(_0x44ac48){logger[_0xff44('0x12')](_0xff44('0x15'),_0x44ac48[_0xff44('0x13')],_0x52fccb);_0x2c61d4(_0x40b8cd[_0xff44('0x12')](0x1f4,_0x44ac48[_0xff44('0x13')]));});});};exports[_0xff44('0x1a')]=function(_0x4ffb8e){var _0x47be0f=this;return new Promise(function(_0x3973a1,_0x1aa5ad){return db[_0xff44('0x16')][_0xff44('0x1b')](_0x4ffb8e['body'],{'raw':_0x4ffb8e['options']?_0x4ffb8e[_0xff44('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ffb8e[_0xff44('0x19')]?_0x4ffb8e[_0xff44('0x19')][_0xff44('0x1c')]||null:null,'attributes':_0x4ffb8e[_0xff44('0x19')]?_0x4ffb8e[_0xff44('0x19')]['attributes']||null:null,'limit':_0x4ffb8e['options']?_0x4ffb8e[_0xff44('0x19')][_0xff44('0x1d')]||null:null})[_0xff44('0xb')](function(_0x2be286){logger['info']('UpdateVoiceAgentReport',_0x4ffb8e);logger[_0xff44('0xf')](_0xff44('0x1a'),_0x4ffb8e,JSON['stringify'](_0x2be286));_0x3973a1(_0x2be286);})[_0xff44('0x14')](function(_0x1b8d19){logger[_0xff44('0x12')](_0xff44('0x1a'),_0x1b8d19['message'],_0x4ffb8e);_0x1aa5ad(_0x47be0f[_0xff44('0x12')](0x1f4,_0x1b8d19[_0xff44('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index cb1c15f..513c165 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 _0xb6a7=['put','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/:id','post'];(function(_0x380a86,_0x348fb6){var _0x2aa799=function(_0xfda1a3){while(--_0xfda1a3){_0x380a86['push'](_0x380a86['shift']());}};_0x2aa799(++_0x348fb6);}(_0xb6a7,0x12e));var _0x7b6a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xb6a7[_0x4a747d];return _0x3a5b5c;};'use strict';var multer=require('multer');var util=require(_0x7b6a('0x0'));var path=require(_0x7b6a('0x1'));var timeout=require(_0x7b6a('0x2'));var express=require('express');var router=express[_0x7b6a('0x3')]();var auth=require(_0x7b6a('0x4'));var interaction=require(_0x7b6a('0x5'));var config=require(_0x7b6a('0x6'));var controller=require(_0x7b6a('0x7'));router[_0x7b6a('0x8')]('/',auth[_0x7b6a('0x9')](),controller[_0x7b6a('0xa')]);router[_0x7b6a('0x8')]('/describe',auth[_0x7b6a('0x9')](),controller['describe']);router[_0x7b6a('0x8')](_0x7b6a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7b6a('0xc')]('/',auth[_0x7b6a('0x9')](),controller['create']);router[_0x7b6a('0xd')](_0x7b6a('0xb'),auth[_0x7b6a('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7b6a('0x9')](),controller['destroy']);module[_0x7b6a('0xe')]=router; \ No newline at end of file +var _0x2036=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','post','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x2845f9,_0x19aa9d){var _0x4ddf82=function(_0x4c7272){while(--_0x4c7272){_0x2845f9['push'](_0x2845f9['shift']());}};_0x4ddf82(++_0x19aa9d);}(_0x2036,0x151));var _0x6203=function(_0x478a60,_0x43cfc5){_0x478a60=_0x478a60-0x0;var _0x4021b7=_0x2036[_0x478a60];return _0x4021b7;};'use strict';var multer=require(_0x6203('0x0'));var util=require('util');var path=require(_0x6203('0x1'));var timeout=require(_0x6203('0x2'));var express=require(_0x6203('0x3'));var router=express[_0x6203('0x4')]();var auth=require(_0x6203('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6203('0x6'));var controller=require('./voiceCallReport.controller');router[_0x6203('0x7')]('/',auth[_0x6203('0x8')](),controller[_0x6203('0x9')]);router[_0x6203('0x7')](_0x6203('0xa'),auth[_0x6203('0x8')](),controller['describe']);router[_0x6203('0x7')](_0x6203('0xb'),auth[_0x6203('0x8')](),controller['show']);router[_0x6203('0xc')]('/',auth['isAuthenticated'](),controller[_0x6203('0xd')]);router[_0x6203('0xe')]('/:id',auth[_0x6203('0x8')](),controller[_0x6203('0xf')]);router['delete'](_0x6203('0xb'),auth[_0x6203('0x8')](),controller[_0x6203('0x10')]);module[_0x6203('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 45edf18..053634e 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 _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x308ddd,_0x3a8401){var _0x3224c3=function(_0x230424){while(--_0x230424){_0x308ddd['push'](_0x308ddd['shift']());}};_0x3224c3(++_0x3a8401);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0xebb59a,_0x3e69c1){var _0x818667=function(_0x1992ce){while(--_0x1992ce){_0xebb59a['push'](_0xebb59a['shift']());}};_0x818667(++_0x3e69c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index c8fd8c3..3424960 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 _0xafb1=['stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','merge','VIRTUAL','options','VoiceCallReport','then','include','fullname','alias','User','findAll','params','includeAll','catch','body','find','describe','uniqueid','user','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','error'];(function(_0x57d41c,_0x4a16e8){var _0x5d9d9e=function(_0x4f416f){while(--_0x4f416f){_0x57d41c['push'](_0x57d41c['shift']());}};_0x5d9d9e(++_0x4a16e8);}(_0xafb1,0x1c9));var _0x1afb=function(_0x193ddf,_0x6f30bb){_0x193ddf=_0x193ddf-0x0;var _0x5bc6df=_0xafb1[_0x193ddf];return _0x5bc6df;};'use strict';var pdf=require(_0x1afb('0x0'));var emlformat=require(_0x1afb('0x1'));var rimraf=require(_0x1afb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1afb('0x3'));var rp=require(_0x1afb('0x4'));var moment=require('moment');var BPromise=require(_0x1afb('0x5'));var Mustache=require(_0x1afb('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1afb('0x7'));var ejs=require(_0x1afb('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1afb('0x9'));var toCsv=require(_0x1afb('0x7'));var querystring=require('querystring');var Papa=require(_0x1afb('0xa'));var Redis=require(_0x1afb('0xb'));var authService=require(_0x1afb('0xc'));var qs=require(_0x1afb('0xd'));var as=require(_0x1afb('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1afb('0xf'))(_0x1afb('0x10'));var utils=require(_0x1afb('0x11'));var config=require(_0x1afb('0x12'));var db=require(_0x1afb('0x13'))['db'];function respondWithStatusCode(_0x2a5d32,_0x37f532){_0x37f532=_0x37f532||0xcc;return function(_0x5904bd){if(_0x5904bd){return _0x2a5d32[_0x1afb('0x14')](_0x37f532);}return _0x2a5d32[_0x1afb('0x15')](_0x37f532)[_0x1afb('0x16')]();};}function respondWithResult(_0xaee9a5,_0x5f3871){_0x5f3871=_0x5f3871||0xc8;return function(_0x14d189){if(_0x14d189){return _0xaee9a5[_0x1afb('0x15')](_0x5f3871)[_0x1afb('0x17')](_0x14d189);}};}function respondWithFilteredResult(_0x1bbcb6,_0x312ab6){return function(_0x5b6f5a){if(_0x5b6f5a){var _0x1dc108=_0x5b6f5a[_0x1afb('0x18')],_0x1156b7=_0x312ab6['offset'],_0x3c4db4=_0x312ab6[_0x1afb('0x19')]+_0x312ab6[_0x1afb('0x1a')],_0xd66083;if(_0x3c4db4>=_0x1dc108){_0x3c4db4=_0x1dc108;_0xd66083=0xc8;}else{_0xd66083=0xce;}_0x1bbcb6[_0x1afb('0x15')](_0xd66083);return _0x1bbcb6[_0x1afb('0x1b')](_0x1afb('0x1c'),_0x1156b7+'-'+_0x3c4db4+'/'+_0x1dc108)['json'](_0x5b6f5a);}return null;};}function patchUpdates(_0x2e3222){return function(_0x4f61df){try{jsonpatch['apply'](_0x4f61df,_0x2e3222,!![]);}catch(_0x55aecb){return BPromise[_0x1afb('0x1d')](_0x55aecb);}return _0x4f61df[_0x1afb('0x1e')]();};}function saveUpdates(_0x2533e7,_0x184077){return function(_0x59e857){if(_0x59e857){return _0x59e857[_0x1afb('0x1f')](_0x2533e7)['then'](function(_0x4f1b1f){return _0x4f1b1f;});}return null;};}function removeEntity(_0x479f22,_0x287c1b){return function(_0xc81faa){if(_0xc81faa){return _0xc81faa['destroy']()['then'](function(){_0x479f22[_0x1afb('0x15')](0xcc)[_0x1afb('0x16')]();});}};}function handleEntityNotFound(_0x398638,_0x16fa58){return function(_0x5aefa7){if(!_0x5aefa7){_0x398638[_0x1afb('0x14')](0x194);}return _0x5aefa7;};}function handleError(_0x4f8447,_0x1ad6b2){_0x1ad6b2=_0x1ad6b2||0x1f4;return function(_0x1312c1){logger[_0x1afb('0x20')](_0x1312c1[_0x1afb('0x21')]);if(_0x1312c1[_0x1afb('0x22')]){delete _0x1312c1['name'];}_0x4f8447[_0x1afb('0x15')](_0x1ad6b2)[_0x1afb('0x23')](_0x1312c1);};}exports['index']=function(_0x124d42,_0x18e442){var _0x171dd7={},_0xac9811={},_0x5f08d4={'count':0x0,'rows':[]};var _0x13e9f0=_[_0x1afb('0x24')](db['VoiceCallReport'][_0x1afb('0x25')],function(_0x3351cf){return{'name':_0x3351cf[_0x1afb('0x26')],'type':_0x3351cf[_0x1afb('0x27')][_0x1afb('0x28')]};});_0xac9811['model']=_['map'](_0x13e9f0,_0x1afb('0x22'));_0xac9811[_0x1afb('0x29')]=_[_0x1afb('0x2a')](_0x124d42[_0x1afb('0x29')]);_0xac9811['filters']=_[_0x1afb('0x2b')](_0xac9811[_0x1afb('0x2c')],_0xac9811['query']);_0x171dd7['attributes']=_[_0x1afb('0x2b')](_0xac9811['model'],qs[_0x1afb('0x2d')](_0x124d42[_0x1afb('0x29')][_0x1afb('0x2d')]));_0x171dd7[_0x1afb('0x2e')]=_0x171dd7[_0x1afb('0x2e')][_0x1afb('0x2f')]?_0x171dd7['attributes']:_0xac9811[_0x1afb('0x2c')];if(!_0x124d42[_0x1afb('0x29')][_0x1afb('0x30')](_0x1afb('0x31'))){_0x171dd7[_0x1afb('0x1a')]=qs[_0x1afb('0x1a')](_0x124d42[_0x1afb('0x29')][_0x1afb('0x1a')]);_0x171dd7[_0x1afb('0x19')]=qs['offset'](_0x124d42['query'][_0x1afb('0x19')]);}_0x171dd7['order']=qs['sort'](_0x124d42[_0x1afb('0x29')]['sort']);_0x171dd7[_0x1afb('0x32')]=qs['filters'](_[_0x1afb('0x33')](_0x124d42['query'],_0xac9811['filters']),_0x13e9f0);if(_0x124d42[_0x1afb('0x29')]['filter']){_0x171dd7[_0x1afb('0x32')]=_[_0x1afb('0x34')](_0x171dd7[_0x1afb('0x32')],{'$or':_['map'](_0x13e9f0,function(_0x57188a){if(_0x57188a[_0x1afb('0x27')]!==_0x1afb('0x35')){var _0xe38e1d={};_0xe38e1d[_0x57188a[_0x1afb('0x22')]]={'$like':'%'+_0x124d42[_0x1afb('0x29')]['filter']+'%'};return _0xe38e1d;}})});}_0x171dd7=_[_0x1afb('0x34')]({},_0x171dd7,_0x124d42[_0x1afb('0x36')]);var _0x37f105={'where':_0x171dd7['where']};return db[_0x1afb('0x37')][_0x1afb('0x18')](_0x37f105)[_0x1afb('0x38')](function(_0x26c3de){_0x5f08d4[_0x1afb('0x18')]=_0x26c3de;if(_0x124d42[_0x1afb('0x29')]['includeAll']){_0x171dd7[_0x1afb('0x39')]=[{'attributes':['id',_0x1afb('0x22'),_0x1afb('0x3a'),_0x1afb('0x3b')],'model':db[_0x1afb('0x3c')],'as':'User'}];}return db[_0x1afb('0x37')][_0x1afb('0x3d')](_0x171dd7);})[_0x1afb('0x38')](function(_0x177c56){_0x5f08d4['rows']=_0x177c56;return _0x5f08d4;})[_0x1afb('0x38')](respondWithFilteredResult(_0x18e442,_0x171dd7))['catch'](handleError(_0x18e442,null));};exports['show']=function(_0x41e796,_0x327c92){var _0x2c8f07={'raw':!![],'where':{'id':_0x41e796[_0x1afb('0x3e')]['id']}},_0x535bef={};_0x535bef['model']=_[_0x1afb('0x2a')](db[_0x1afb('0x37')][_0x1afb('0x25')]);_0x535bef[_0x1afb('0x29')]=_[_0x1afb('0x2a')](_0x41e796[_0x1afb('0x29')]);_0x535bef['filters']=_[_0x1afb('0x2b')](_0x535bef[_0x1afb('0x2c')],_0x535bef[_0x1afb('0x29')]);_0x2c8f07[_0x1afb('0x2e')]=_['intersection'](_0x535bef['model'],qs[_0x1afb('0x2d')](_0x41e796['query']['fields']));_0x2c8f07[_0x1afb('0x2e')]=_0x2c8f07[_0x1afb('0x2e')][_0x1afb('0x2f')]?_0x2c8f07['attributes']:_0x535bef[_0x1afb('0x2c')];if(_0x41e796[_0x1afb('0x29')][_0x1afb('0x3f')]){_0x2c8f07[_0x1afb('0x39')]=[{'all':!![]}];}_0x2c8f07=_[_0x1afb('0x34')]({},_0x2c8f07,_0x41e796[_0x1afb('0x36')]);return db[_0x1afb('0x37')]['find'](_0x2c8f07)[_0x1afb('0x38')](handleEntityNotFound(_0x327c92,null))[_0x1afb('0x38')](respondWithResult(_0x327c92,null))[_0x1afb('0x40')](handleError(_0x327c92,null));};exports['create']=function(_0x4f8158,_0x137cac){return db[_0x1afb('0x37')]['create'](_0x4f8158[_0x1afb('0x41')],{})[_0x1afb('0x38')](respondWithResult(_0x137cac,0xc9))[_0x1afb('0x40')](handleError(_0x137cac,null));};exports['destroy']=function(_0x5a2432,_0x111d00){return db[_0x1afb('0x37')][_0x1afb('0x42')]({'where':{'id':_0x5a2432[_0x1afb('0x3e')]['id']}})[_0x1afb('0x38')](handleEntityNotFound(_0x111d00,null))[_0x1afb('0x38')](removeEntity(_0x111d00,null))[_0x1afb('0x40')](handleError(_0x111d00,null));};exports['describe']=function(_0x24bc5e,_0x57b3e5){return db[_0x1afb('0x37')][_0x1afb('0x43')]()[_0x1afb('0x38')](respondWithResult(_0x57b3e5,null))['catch'](handleError(_0x57b3e5,null));};exports['update']=function(_0x2041bc,_0x38b65a){if(_0x2041bc[_0x1afb('0x41')][_0x1afb('0x44')]){delete _0x2041bc[_0x1afb('0x41')]['uniqueid'];}return db[_0x1afb('0x37')]['find']({'where':{'uniqueid':_0x2041bc[_0x1afb('0x3e')]['id'],'UserId':{'$or':[null,_0x2041bc[_0x1afb('0x45')]['id']]}}})[_0x1afb('0x38')](handleEntityNotFound(_0x38b65a,null))[_0x1afb('0x38')](saveUpdates(_0x2041bc[_0x1afb('0x41')],null))[_0x1afb('0x38')](respondWithResult(_0x38b65a,null))[_0x1afb('0x40')](handleError(_0x38b65a,null));}; \ No newline at end of file +var _0x535c=['options','VoiceCallReport','includeAll','include','fullname','alias','User','findAll','rows','catch','show','fields','find','create','body','params','describe','uniqueid','user','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','map','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x390361,_0x3b5cc0){var _0x12c159=function(_0x4deb9d){while(--_0x4deb9d){_0x390361['push'](_0x390361['shift']());}};_0x12c159(++_0x3b5cc0);}(_0x535c,0x1c9));var _0xc535=function(_0x1e691f,_0x215f5f){_0x1e691f=_0x1e691f-0x0;var _0x5b37cb=_0x535c[_0x1e691f];return _0x5b37cb;};'use strict';var pdf=require(_0xc535('0x0'));var emlformat=require(_0xc535('0x1'));var rimraf=require(_0xc535('0x2'));var zipdir=require(_0xc535('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc535('0x4'));var moment=require(_0xc535('0x5'));var BPromise=require(_0xc535('0x6'));var Mustache=require('mustache');var util=require(_0xc535('0x7'));var path=require(_0xc535('0x8'));var sox=require(_0xc535('0x9'));var csv=require(_0xc535('0xa'));var ejs=require(_0xc535('0xb'));var fs=require('fs');var _=require(_0xc535('0xc'));var squel=require('squel');var crypto=require(_0xc535('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc535('0xa'));var querystring=require(_0xc535('0xe'));var Papa=require(_0xc535('0xf'));var Redis=require('ioredis');var authService=require(_0xc535('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc535('0x11'));var hardwareService=require(_0xc535('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc535('0x13'));var config=require(_0xc535('0x14'));var db=require(_0xc535('0x15'))['db'];function respondWithStatusCode(_0x3c5fbc,_0x20efec){_0x20efec=_0x20efec||0xcc;return function(_0x587ec7){if(_0x587ec7){return _0x3c5fbc[_0xc535('0x16')](_0x20efec);}return _0x3c5fbc[_0xc535('0x17')](_0x20efec)['end']();};}function respondWithResult(_0x398e92,_0x28a8d5){_0x28a8d5=_0x28a8d5||0xc8;return function(_0x35e8fe){if(_0x35e8fe){return _0x398e92[_0xc535('0x17')](_0x28a8d5)[_0xc535('0x18')](_0x35e8fe);}};}function respondWithFilteredResult(_0x2c793d,_0x3dd41d){return function(_0x463925){if(_0x463925){var _0x17861c=_0x463925[_0xc535('0x19')],_0x51c268=_0x3dd41d[_0xc535('0x1a')],_0x3bc362=_0x3dd41d[_0xc535('0x1a')]+_0x3dd41d[_0xc535('0x1b')],_0x259ba7;if(_0x3bc362>=_0x17861c){_0x3bc362=_0x17861c;_0x259ba7=0xc8;}else{_0x259ba7=0xce;}_0x2c793d['status'](_0x259ba7);return _0x2c793d[_0xc535('0x1c')](_0xc535('0x1d'),_0x51c268+'-'+_0x3bc362+'/'+_0x17861c)[_0xc535('0x18')](_0x463925);}return null;};}function patchUpdates(_0x3370f1){return function(_0x239040){try{jsonpatch[_0xc535('0x1e')](_0x239040,_0x3370f1,!![]);}catch(_0x5261dd){return BPromise[_0xc535('0x1f')](_0x5261dd);}return _0x239040[_0xc535('0x20')]();};}function saveUpdates(_0x3ccada,_0x58c39a){return function(_0x383705){if(_0x383705){return _0x383705[_0xc535('0x21')](_0x3ccada)[_0xc535('0x22')](function(_0x18b7e4){return _0x18b7e4;});}return null;};}function removeEntity(_0x400f7e,_0x5456d6){return function(_0x51bec8){if(_0x51bec8){return _0x51bec8[_0xc535('0x23')]()[_0xc535('0x22')](function(){_0x400f7e[_0xc535('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x424e0c,_0x4adb14){return function(_0x43d958){if(!_0x43d958){_0x424e0c['sendStatus'](0x194);}return _0x43d958;};}function handleError(_0x136e2c,_0x552322){_0x552322=_0x552322||0x1f4;return function(_0x1af8fb){logger[_0xc535('0x24')](_0x1af8fb['stack']);if(_0x1af8fb[_0xc535('0x25')]){delete _0x1af8fb[_0xc535('0x25')];}_0x136e2c[_0xc535('0x17')](_0x552322)['send'](_0x1af8fb);};}exports['index']=function(_0x456f08,_0x2514d5){var _0x5a06d9={},_0x362d0c={},_0x365cda={'count':0x0,'rows':[]};var _0x3f766a=_[_0xc535('0x26')](db['VoiceCallReport']['rawAttributes'],function(_0x398ce2){return{'name':_0x398ce2['fieldName'],'type':_0x398ce2['type'][_0xc535('0x27')]};});_0x362d0c[_0xc535('0x28')]=_[_0xc535('0x26')](_0x3f766a,_0xc535('0x25'));_0x362d0c['query']=_[_0xc535('0x29')](_0x456f08['query']);_0x362d0c[_0xc535('0x2a')]=_[_0xc535('0x2b')](_0x362d0c[_0xc535('0x28')],_0x362d0c[_0xc535('0x2c')]);_0x5a06d9[_0xc535('0x2d')]=_[_0xc535('0x2b')](_0x362d0c[_0xc535('0x28')],qs['fields'](_0x456f08[_0xc535('0x2c')]['fields']));_0x5a06d9[_0xc535('0x2d')]=_0x5a06d9[_0xc535('0x2d')][_0xc535('0x2e')]?_0x5a06d9[_0xc535('0x2d')]:_0x362d0c[_0xc535('0x28')];if(!_0x456f08[_0xc535('0x2c')][_0xc535('0x2f')]('nolimit')){_0x5a06d9[_0xc535('0x1b')]=qs[_0xc535('0x1b')](_0x456f08[_0xc535('0x2c')][_0xc535('0x1b')]);_0x5a06d9[_0xc535('0x1a')]=qs[_0xc535('0x1a')](_0x456f08[_0xc535('0x2c')][_0xc535('0x1a')]);}_0x5a06d9['order']=qs[_0xc535('0x30')](_0x456f08[_0xc535('0x2c')][_0xc535('0x30')]);_0x5a06d9[_0xc535('0x31')]=qs['filters'](_[_0xc535('0x32')](_0x456f08[_0xc535('0x2c')],_0x362d0c[_0xc535('0x2a')]),_0x3f766a);if(_0x456f08[_0xc535('0x2c')][_0xc535('0x33')]){_0x5a06d9[_0xc535('0x31')]=_['merge'](_0x5a06d9[_0xc535('0x31')],{'$or':_[_0xc535('0x26')](_0x3f766a,function(_0x524ace){if(_0x524ace['type']!==_0xc535('0x34')){var _0x4d35e4={};_0x4d35e4[_0x524ace[_0xc535('0x25')]]={'$like':'%'+_0x456f08['query'][_0xc535('0x33')]+'%'};return _0x4d35e4;}})});}_0x5a06d9=_[_0xc535('0x35')]({},_0x5a06d9,_0x456f08[_0xc535('0x36')]);var _0x37cde1={'where':_0x5a06d9[_0xc535('0x31')]};return db[_0xc535('0x37')][_0xc535('0x19')](_0x37cde1)[_0xc535('0x22')](function(_0x4b9f3b){_0x365cda[_0xc535('0x19')]=_0x4b9f3b;if(_0x456f08['query'][_0xc535('0x38')]){_0x5a06d9[_0xc535('0x39')]=[{'attributes':['id',_0xc535('0x25'),_0xc535('0x3a'),_0xc535('0x3b')],'model':db[_0xc535('0x3c')],'as':_0xc535('0x3c')}];}return db[_0xc535('0x37')][_0xc535('0x3d')](_0x5a06d9);})[_0xc535('0x22')](function(_0x1f9c5e){_0x365cda[_0xc535('0x3e')]=_0x1f9c5e;return _0x365cda;})[_0xc535('0x22')](respondWithFilteredResult(_0x2514d5,_0x5a06d9))[_0xc535('0x3f')](handleError(_0x2514d5,null));};exports[_0xc535('0x40')]=function(_0x5cbcb3,_0x461e27){var _0x1a5899={'raw':!![],'where':{'id':_0x5cbcb3['params']['id']}},_0x422b65={};_0x422b65[_0xc535('0x28')]=_[_0xc535('0x29')](db[_0xc535('0x37')]['rawAttributes']);_0x422b65[_0xc535('0x2c')]=_['keys'](_0x5cbcb3['query']);_0x422b65[_0xc535('0x2a')]=_[_0xc535('0x2b')](_0x422b65[_0xc535('0x28')],_0x422b65[_0xc535('0x2c')]);_0x1a5899['attributes']=_[_0xc535('0x2b')](_0x422b65[_0xc535('0x28')],qs[_0xc535('0x41')](_0x5cbcb3[_0xc535('0x2c')]['fields']));_0x1a5899[_0xc535('0x2d')]=_0x1a5899['attributes']['length']?_0x1a5899[_0xc535('0x2d')]:_0x422b65[_0xc535('0x28')];if(_0x5cbcb3['query'][_0xc535('0x38')]){_0x1a5899[_0xc535('0x39')]=[{'all':!![]}];}_0x1a5899=_['merge']({},_0x1a5899,_0x5cbcb3[_0xc535('0x36')]);return db[_0xc535('0x37')][_0xc535('0x42')](_0x1a5899)[_0xc535('0x22')](handleEntityNotFound(_0x461e27,null))[_0xc535('0x22')](respondWithResult(_0x461e27,null))['catch'](handleError(_0x461e27,null));};exports[_0xc535('0x43')]=function(_0xfd2b5a,_0x54110d){return db['VoiceCallReport'][_0xc535('0x43')](_0xfd2b5a[_0xc535('0x44')],{})[_0xc535('0x22')](respondWithResult(_0x54110d,0xc9))['catch'](handleError(_0x54110d,null));};exports['destroy']=function(_0x3ea76b,_0x445070){return db[_0xc535('0x37')][_0xc535('0x42')]({'where':{'id':_0x3ea76b[_0xc535('0x45')]['id']}})[_0xc535('0x22')](handleEntityNotFound(_0x445070,null))['then'](removeEntity(_0x445070,null))['catch'](handleError(_0x445070,null));};exports['describe']=function(_0x24a35c,_0x13c5fa){return db[_0xc535('0x37')][_0xc535('0x46')]()[_0xc535('0x22')](respondWithResult(_0x13c5fa,null))[_0xc535('0x3f')](handleError(_0x13c5fa,null));};exports['update']=function(_0x2eff89,_0x581923){if(_0x2eff89[_0xc535('0x44')][_0xc535('0x47')]){delete _0x2eff89[_0xc535('0x44')][_0xc535('0x47')];}return db[_0xc535('0x37')]['find']({'where':{'uniqueid':_0x2eff89[_0xc535('0x45')]['id'],'UserId':{'$or':[null,_0x2eff89[_0xc535('0x48')]['id']]}}})[_0xc535('0x22')](handleEntityNotFound(_0x581923,null))['then'](saveUpdates(_0x2eff89[_0xc535('0x44')],null))[_0xc535('0x22')](respondWithResult(_0x581923,null))[_0xc535('0x3f')](handleError(_0x581923,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 36fac47..6fe1f1b 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 _0x45a3=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','VoiceCallReport','report_call','lodash'];(function(_0xc54de9,_0x257d16){var _0xcd1568=function(_0xf904f2){while(--_0xf904f2){_0xc54de9['push'](_0xc54de9['shift']());}};_0xcd1568(++_0x257d16);}(_0x45a3,0x113));var _0x345a=function(_0xecfdd4,_0x1442f6){_0xecfdd4=_0xecfdd4-0x0;var _0x2eddb2=_0x45a3[_0xecfdd4];return _0x2eddb2;};'use strict';var _=require(_0x345a('0x0'));var util=require(_0x345a('0x1'));var logger=require(_0x345a('0x2'))(_0x345a('0x3'));var moment=require(_0x345a('0x4'));var BPromise=require('bluebird');var rp=require(_0x345a('0x5'));var fs=require('fs');var path=require(_0x345a('0x6'));var rimraf=require(_0x345a('0x7'));var config=require(_0x345a('0x8'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x5549d1,_0x57fc85){return _0x5549d1[_0x345a('0x9')](_0x345a('0xa'),attributes,{'tableName':_0x345a('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe8b8=['request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x507172,_0x52f3ce){var _0x2e3ef5=function(_0x52a31f){while(--_0x52a31f){_0x507172['push'](_0x507172['shift']());}};_0x2e3ef5(++_0x52f3ce);}(_0xe8b8,0xdc));var _0x8e8b=function(_0x3c96f9,_0x2e834a){_0x3c96f9=_0x3c96f9-0x0;var _0x1dd61f=_0xe8b8[_0x3c96f9];return _0x1dd61f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8e8b('0x0'))(_0x8e8b('0x1'));var moment=require(_0x8e8b('0x2'));var BPromise=require(_0x8e8b('0x3'));var rp=require(_0x8e8b('0x4'));var fs=require('fs');var path=require(_0x8e8b('0x5'));var rimraf=require(_0x8e8b('0x6'));var config=require(_0x8e8b('0x7'));var attributes=require(_0x8e8b('0x8'));module[_0x8e8b('0x9')]=function(_0x12cfd5,_0x59da09){return _0x12cfd5[_0x8e8b('0xa')](_0x8e8b('0xb'),attributes,{'tableName':_0x8e8b('0xc'),'paranoid':![],'indexes':[{'fields':[_0x8e8b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 6ace9c3..32cc2fd 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 _0x2392=['UpdateVoiceCallReport','update','body','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','limit','include','map','model','attributes','then','GetVoiceCallReport','CreateVoiceCallReport'];(function(_0x51e9aa,_0x56417a){var _0x3ef785=function(_0x33a842){while(--_0x33a842){_0x51e9aa['push'](_0x51e9aa['shift']());}};_0x3ef785(++_0x56417a);}(_0x2392,0x16c));var _0x2239=function(_0x76b51f,_0x5141e7){_0x76b51f=_0x76b51f-0x0;var _0x1947b1=_0x2392[_0x76b51f];return _0x1947b1;};'use strict';var _=require('lodash');var util=require(_0x2239('0x0'));var moment=require(_0x2239('0x1'));var BPromise=require(_0x2239('0x2'));var rs=require(_0x2239('0x3'));var fs=require('fs');var Redis=require(_0x2239('0x4'));var db=require(_0x2239('0x5'))['db'];var utils=require(_0x2239('0x6'));var logger=require(_0x2239('0x7'))(_0x2239('0x8'));var config=require(_0x2239('0x9'));var jayson=require(_0x2239('0xa'));var client=jayson[_0x2239('0xb')][_0x2239('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e2230,_0x1765c9,_0x54a1e3){return new BPromise(function(_0x199703,_0x26fa3f){return client[_0x2239('0xd')](_0x3e2230,_0x54a1e3)['then'](function(_0x2698fe){logger[_0x2239('0xe')](_0x2239('0xf'),_0x1765c9,_0x2239('0x10'));logger[_0x2239('0x11')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x1765c9,_0x2239('0x10'),JSON[_0x2239('0x12')](_0x2698fe));if(_0x2698fe[_0x2239('0x13')]){if(_0x2698fe[_0x2239('0x13')][_0x2239('0x14')]===0x1f4){logger['error'](_0x2239('0xf'),_0x1765c9,_0x2698fe['error'][_0x2239('0x15')]);return _0x26fa3f(_0x2698fe[_0x2239('0x13')][_0x2239('0x15')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x1765c9,_0x2698fe[_0x2239('0x13')][_0x2239('0x15')]);return _0x199703(_0x2698fe[_0x2239('0x13')]['message']);}else{logger['info'](_0x2239('0xf'),_0x1765c9,_0x2239('0x10'));_0x199703(_0x2698fe[_0x2239('0x16')][_0x2239('0x15')]);}})[_0x2239('0x17')](function(_0x43eb10){logger[_0x2239('0x13')](_0x2239('0xf'),_0x1765c9,_0x43eb10);_0x26fa3f(_0x43eb10);});});}exports['GetVoiceCallReport']=function(_0x435e20){var _0x7e1387=this;return new Promise(function(_0xfc4552,_0x30ef46){return db[_0x2239('0x18')][_0x2239('0x19')]({'raw':_0x435e20[_0x2239('0x1a')]?_0x435e20['options'][_0x2239('0x1b')]===undefined?!![]:![]:!![],'where':_0x435e20['options']?_0x435e20['options']['where']||null:null,'attributes':_0x435e20[_0x2239('0x1a')]?_0x435e20[_0x2239('0x1a')]['attributes']||null:null,'limit':_0x435e20['options']?_0x435e20[_0x2239('0x1a')][_0x2239('0x1c')]||null:null,'include':_0x435e20[_0x2239('0x1a')]?_0x435e20[_0x2239('0x1a')][_0x2239('0x1d')]?_[_0x2239('0x1e')](_0x435e20[_0x2239('0x1a')][_0x2239('0x1d')],function(_0x15dbb6){return{'model':db[_0x15dbb6[_0x2239('0x1f')]],'as':_0x15dbb6['as'],'attributes':_0x15dbb6[_0x2239('0x20')],'include':_0x15dbb6[_0x2239('0x1d')]?_[_0x2239('0x1e')](_0x15dbb6[_0x2239('0x1d')],function(_0x1bfd56){return{'model':db[_0x1bfd56[_0x2239('0x1f')]],'as':_0x1bfd56['as'],'attributes':_0x1bfd56[_0x2239('0x20')],'include':_0x1bfd56['include']?_['map'](_0x1bfd56[_0x2239('0x1d')],function(_0x160782){return{'model':db[_0x160782[_0x2239('0x1f')]],'as':_0x160782['as'],'attributes':_0x160782['attributes']};}):[]};}):[]};}):[]:[]})[_0x2239('0x21')](function(_0x1e3a77){logger[_0x2239('0xe')](_0x2239('0x22'),_0x435e20);logger[_0x2239('0x11')]('GetVoiceCallReport',_0x435e20,JSON[_0x2239('0x12')](_0x1e3a77));_0xfc4552(_0x1e3a77);})[_0x2239('0x17')](function(_0xadae28){logger['error'](_0x2239('0x22'),_0xadae28[_0x2239('0x15')],_0x435e20);_0x30ef46(_0x7e1387['error'](0x1f4,_0xadae28[_0x2239('0x15')]));});});};exports['CreateVoiceCallReport']=function(_0x436725){var _0x42882a=this;return new Promise(function(_0x3e9871,_0x32bc65){return db[_0x2239('0x18')]['create'](_0x436725['body'],{'raw':_0x436725[_0x2239('0x1a')]?_0x436725[_0x2239('0x1a')][_0x2239('0x1b')]===undefined?!![]:![]:!![]})[_0x2239('0x21')](function(_0x198d9f){logger[_0x2239('0xe')]('CreateVoiceCallReport',_0x436725);logger[_0x2239('0x11')](_0x2239('0x23'),_0x436725,JSON[_0x2239('0x12')](_0x198d9f));_0x3e9871(_0x198d9f);})['catch'](function(_0x4e4569){logger[_0x2239('0x13')]('CreateVoiceCallReport',_0x4e4569['message'],_0x436725);_0x32bc65(_0x42882a[_0x2239('0x13')](0x1f4,_0x4e4569[_0x2239('0x15')]));});});};exports[_0x2239('0x24')]=function(_0x328743){var _0x24f57b=this;return new Promise(function(_0x4d77c7,_0x3a0a6c){return db['VoiceCallReport'][_0x2239('0x25')](_0x328743[_0x2239('0x26')],{'raw':_0x328743[_0x2239('0x1a')]?_0x328743[_0x2239('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x328743[_0x2239('0x1a')]?_0x328743['options'][_0x2239('0x27')]||null:null,'attributes':_0x328743[_0x2239('0x1a')]?_0x328743['options']['attributes']||null:null,'limit':_0x328743[_0x2239('0x1a')]?_0x328743[_0x2239('0x1a')][_0x2239('0x1c')]||null:null})[_0x2239('0x21')](function(_0x4482d3){logger[_0x2239('0xe')]('UpdateVoiceCallReport',_0x328743);logger[_0x2239('0x11')](_0x2239('0x24'),_0x328743,JSON[_0x2239('0x12')](_0x4482d3));_0x4d77c7(_0x4482d3);})[_0x2239('0x17')](function(_0x165aa9){logger['error'](_0x2239('0x24'),_0x165aa9[_0x2239('0x15')],_0x328743);_0x3a0a6c(_0x24f57b[_0x2239('0x13')](0x1f4,_0x165aa9['message']));});});}; \ No newline at end of file +var _0xf754=['VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','findAll','options','raw','attributes','include','map','model','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','VoiceCallReport','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xf754,0x19c));var _0x4f75=function(_0x255670,_0x885e){_0x255670=_0x255670-0x0;var _0x40c523=_0xf754[_0x255670];return _0x40c523;};'use strict';var _=require(_0x4f75('0x0'));var util=require(_0x4f75('0x1'));var moment=require(_0x4f75('0x2'));var BPromise=require(_0x4f75('0x3'));var rs=require(_0x4f75('0x4'));var fs=require('fs');var Redis=require(_0x4f75('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4f75('0x6'));var logger=require(_0x4f75('0x7'))(_0x4f75('0x8'));var config=require(_0x4f75('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4f75('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b3491,_0x53a127,_0x4a8be4){return new BPromise(function(_0x11cf21,_0x1ea80e){return client[_0x4f75('0xb')](_0x1b3491,_0x4a8be4)[_0x4f75('0xc')](function(_0x155c4e){logger[_0x4f75('0xd')](_0x4f75('0xe'),_0x53a127,_0x4f75('0xf'));logger[_0x4f75('0x10')](_0x4f75('0x11'),_0x53a127,_0x4f75('0xf'),JSON[_0x4f75('0x12')](_0x155c4e));if(_0x155c4e[_0x4f75('0x13')]){if(_0x155c4e[_0x4f75('0x13')][_0x4f75('0x14')]===0x1f4){logger[_0x4f75('0x13')](_0x4f75('0xe'),_0x53a127,_0x155c4e[_0x4f75('0x13')]['message']);return _0x1ea80e(_0x155c4e[_0x4f75('0x13')][_0x4f75('0x15')]);}logger[_0x4f75('0x13')](_0x4f75('0xe'),_0x53a127,_0x155c4e[_0x4f75('0x13')][_0x4f75('0x15')]);return _0x11cf21(_0x155c4e[_0x4f75('0x13')][_0x4f75('0x15')]);}else{logger[_0x4f75('0xd')](_0x4f75('0xe'),_0x53a127,_0x4f75('0xf'));_0x11cf21(_0x155c4e[_0x4f75('0x16')]['message']);}})[_0x4f75('0x17')](function(_0x497e8f){logger[_0x4f75('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x53a127,_0x497e8f);_0x1ea80e(_0x497e8f);});});}exports[_0x4f75('0x18')]=function(_0x2389a6){var _0x153ad1=this;return new Promise(function(_0x2a8cc2,_0x5b6405){return db['VoiceCallReport'][_0x4f75('0x19')]({'raw':_0x2389a6[_0x4f75('0x1a')]?_0x2389a6[_0x4f75('0x1a')][_0x4f75('0x1b')]===undefined?!![]:![]:!![],'where':_0x2389a6['options']?_0x2389a6[_0x4f75('0x1a')]['where']||null:null,'attributes':_0x2389a6[_0x4f75('0x1a')]?_0x2389a6['options'][_0x4f75('0x1c')]||null:null,'limit':_0x2389a6[_0x4f75('0x1a')]?_0x2389a6[_0x4f75('0x1a')]['limit']||null:null,'include':_0x2389a6['options']?_0x2389a6[_0x4f75('0x1a')][_0x4f75('0x1d')]?_[_0x4f75('0x1e')](_0x2389a6[_0x4f75('0x1a')]['include'],function(_0xa61f55){return{'model':db[_0xa61f55[_0x4f75('0x1f')]],'as':_0xa61f55['as'],'attributes':_0xa61f55[_0x4f75('0x1c')],'include':_0xa61f55['include']?_['map'](_0xa61f55[_0x4f75('0x1d')],function(_0x550f3d){return{'model':db[_0x550f3d[_0x4f75('0x1f')]],'as':_0x550f3d['as'],'attributes':_0x550f3d[_0x4f75('0x1c')],'include':_0x550f3d['include']?_[_0x4f75('0x1e')](_0x550f3d[_0x4f75('0x1d')],function(_0x58226c){return{'model':db[_0x58226c[_0x4f75('0x1f')]],'as':_0x58226c['as'],'attributes':_0x58226c[_0x4f75('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x4f75('0xc')](function(_0x3ce761){logger['info'](_0x4f75('0x18'),_0x2389a6);logger['debug'](_0x4f75('0x18'),_0x2389a6,JSON[_0x4f75('0x12')](_0x3ce761));_0x2a8cc2(_0x3ce761);})['catch'](function(_0x57eaff){logger['error']('GetVoiceCallReport',_0x57eaff['message'],_0x2389a6);_0x5b6405(_0x153ad1[_0x4f75('0x13')](0x1f4,_0x57eaff[_0x4f75('0x15')]));});});};exports[_0x4f75('0x20')]=function(_0x31c75f){var _0x4e25c2=this;return new Promise(function(_0x2c37b8,_0x25dd3a){return db['VoiceCallReport'][_0x4f75('0x21')](_0x31c75f[_0x4f75('0x22')],{'raw':_0x31c75f[_0x4f75('0x1a')]?_0x31c75f[_0x4f75('0x1a')][_0x4f75('0x1b')]===undefined?!![]:![]:!![]})[_0x4f75('0xc')](function(_0x15114e){logger['info'](_0x4f75('0x20'),_0x31c75f);logger['debug'](_0x4f75('0x20'),_0x31c75f,JSON['stringify'](_0x15114e));_0x2c37b8(_0x15114e);})[_0x4f75('0x17')](function(_0xa5764d){logger[_0x4f75('0x13')]('CreateVoiceCallReport',_0xa5764d[_0x4f75('0x15')],_0x31c75f);_0x25dd3a(_0x4e25c2['error'](0x1f4,_0xa5764d[_0x4f75('0x15')]));});});};exports[_0x4f75('0x23')]=function(_0xa2ec50){var _0x24f498=this;return new Promise(function(_0x4c5dcb,_0x8d55c){return db[_0x4f75('0x24')]['update'](_0xa2ec50['body'],{'raw':_0xa2ec50[_0x4f75('0x1a')]?_0xa2ec50[_0x4f75('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa2ec50[_0x4f75('0x1a')]?_0xa2ec50['options'][_0x4f75('0x25')]||null:null,'attributes':_0xa2ec50['options']?_0xa2ec50['options'][_0x4f75('0x1c')]||null:null,'limit':_0xa2ec50[_0x4f75('0x1a')]?_0xa2ec50[_0x4f75('0x1a')][_0x4f75('0x26')]||null:null})[_0x4f75('0xc')](function(_0xa98d4b){logger[_0x4f75('0xd')](_0x4f75('0x23'),_0xa2ec50);logger[_0x4f75('0x10')](_0x4f75('0x23'),_0xa2ec50,JSON[_0x4f75('0x12')](_0xa98d4b));_0x4c5dcb(_0xa98d4b);})[_0x4f75('0x17')](function(_0x26e54e){logger[_0x4f75('0x13')](_0x4f75('0x23'),_0x26e54e[_0x4f75('0x15')],_0xa2ec50);_0x8d55c(_0x24f498['error'](0x1f4,_0x26e54e[_0x4f75('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index a7fb308..1272f1d 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 _0xab9c=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0xab9c,0x122));var _0xcab9=function(_0xd2357c,_0x208a5e){_0xd2357c=_0xd2357c-0x0;var _0x544fee=_0xab9c[_0xd2357c];return _0x544fee;};'use strict';var multer=require(_0xcab9('0x0'));var util=require('util');var path=require(_0xcab9('0x1'));var timeout=require(_0xcab9('0x2'));var express=require(_0xcab9('0x3'));var router=express[_0xcab9('0x4')]();var auth=require(_0xcab9('0x5'));var interaction=require(_0xcab9('0x6'));var config=require(_0xcab9('0x7'));var controller=require(_0xcab9('0x8'));router[_0xcab9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcab9('0x9')](_0xcab9('0xa'),auth[_0xcab9('0xb')](),controller[_0xcab9('0xc')]);router[_0xcab9('0xd')]('/',auth['isAuthenticated'](),controller[_0xcab9('0xe')]);router[_0xcab9('0xf')](_0xcab9('0xa'),auth[_0xcab9('0xb')](),controller[_0xcab9('0x10')]);router[_0xcab9('0x11')](_0xcab9('0xa'),auth[_0xcab9('0xb')](),controller[_0xcab9('0x12')]);module[_0xcab9('0x13')]=router; \ No newline at end of file +var _0x9269=['./voiceChanSpy.controller','get','isAuthenticated','index','show','post','create','/:id','update','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9269,0x1e9));var _0x9926=function(_0x47c0c1,_0x2fd98f){_0x47c0c1=_0x47c0c1-0x0;var _0x48e551=_0x9269[_0x47c0c1];return _0x48e551;};'use strict';var multer=require('multer');var util=require(_0x9926('0x0'));var path=require(_0x9926('0x1'));var timeout=require('connect-timeout');var express=require(_0x9926('0x2'));var router=express['Router']();var auth=require(_0x9926('0x3'));var interaction=require(_0x9926('0x4'));var config=require(_0x9926('0x5'));var controller=require(_0x9926('0x6'));router[_0x9926('0x7')]('/',auth[_0x9926('0x8')](),controller[_0x9926('0x9')]);router[_0x9926('0x7')]('/:id',auth[_0x9926('0x8')](),controller[_0x9926('0xa')]);router[_0x9926('0xb')]('/',auth[_0x9926('0x8')](),controller[_0x9926('0xc')]);router['put'](_0x9926('0xd'),auth['isAuthenticated'](),controller[_0x9926('0xe')]);router['delete']('/:id',auth[_0x9926('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 7649a49..cf4254e 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 _0x4785=['getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue','options','join'];(function(_0x435b1f,_0x5bfcfa){var _0x21817a=function(_0x2cdc59){while(--_0x2cdc59){_0x435b1f['push'](_0x435b1f['shift']());}};_0x21817a(++_0x5bfcfa);}(_0x4785,0xb7));var _0x5478=function(_0x389fee,_0x18baf5){_0x389fee=_0x389fee-0x0;var _0x1511f6=_0x4785[_0x389fee];return _0x1511f6;};'use strict';var Sequelize=require('sequelize');module[_0x5478('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x5478('0x1')],'unique':_0x5478('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x5478('0x1')],'set':function(_0x3355a9){this[_0x5478('0x3')](_0x5478('0x4'),_0x3355a9?_0x3355a9[_0x5478('0x5')](''):[]);},'get':function(){return this[_0x5478('0x6')](_0x5478('0x4'))?this[_0x5478('0x6')](_0x5478('0x4'))[_0x5478('0x7')](''):[];}},'auth':{'type':Sequelize[_0x5478('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x5478('0x1')]},'record':{'type':Sequelize[_0x5478('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x5478('0x1')]},'description':{'type':Sequelize[_0x5478('0x1')]}}; \ No newline at end of file +var _0xc08c=['options','join','split','BOOLEAN','sequelize','exports','STRING','setDataValue'];(function(_0x4bf597,_0x2f2d25){var _0x29a4be=function(_0x17dde5){while(--_0x17dde5){_0x4bf597['push'](_0x4bf597['shift']());}};_0x29a4be(++_0x2f2d25);}(_0xc08c,0x1c4));var _0xcc08=function(_0x5db636,_0x341000){_0x5db636=_0x5db636-0x0;var _0x6a5131=_0xc08c[_0x5db636];return _0x6a5131;};'use strict';var Sequelize=require(_0xcc08('0x0'));module[_0xcc08('0x1')]={'name':{'type':Sequelize[_0xcc08('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x7eaccb){this[_0xcc08('0x3')](_0xcc08('0x4'),_0x7eaccb?_0x7eaccb[_0xcc08('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0xcc08('0x4'))?this['getDataValue'](_0xcc08('0x4'))[_0xcc08('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xcc08('0x2')]},'record':{'type':Sequelize[_0xcc08('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xcc08('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 30cb7e2..071e367 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 _0x5709=['offset','order','sort','filters','filter','where','merge','VIRTUAL','options','VoiceChanSpy','includeAll','include','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','sendStatus','status','end','count','limit','Content-Range','json','apply','reject','then','destroy','get','ChanSpies','UserProfileResource','error','send','index','map','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x4b164d,_0x1a4eb6){var _0x8b591b=function(_0x40ee3c){while(--_0x40ee3c){_0x4b164d['push'](_0x4b164d['shift']());}};_0x8b591b(++_0x1a4eb6);}(_0x5709,0x67));var _0x9570=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5709[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x9570('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9570('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9570('0x2'));var rp=require(_0x9570('0x3'));var moment=require(_0x9570('0x4'));var BPromise=require(_0x9570('0x5'));var Mustache=require('mustache');var util=require(_0x9570('0x6'));var path=require(_0x9570('0x7'));var sox=require('sox');var csv=require(_0x9570('0x8'));var ejs=require(_0x9570('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9570('0xa'));var crypto=require(_0x9570('0xb'));var jsforce=require(_0x9570('0xc'));var deskjs=require(_0x9570('0xd'));var toCsv=require(_0x9570('0x8'));var querystring=require(_0x9570('0xe'));var Papa=require('papaparse');var Redis=require(_0x9570('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9570('0x10'));var as=require(_0x9570('0x11'));var hardwareService=require(_0x9570('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x9570('0x13'));var config=require(_0x9570('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x178f80,_0x299d66){_0x299d66=_0x299d66||0xcc;return function(_0xcd65ce){if(_0xcd65ce){return _0x178f80[_0x9570('0x15')](_0x299d66);}return _0x178f80[_0x9570('0x16')](_0x299d66)[_0x9570('0x17')]();};}function respondWithResult(_0xb932c0,_0x61bad8){_0x61bad8=_0x61bad8||0xc8;return function(_0x33789b){if(_0x33789b){return _0xb932c0[_0x9570('0x16')](_0x61bad8)['json'](_0x33789b);}};}function respondWithFilteredResult(_0x4d7588,_0x413abe){return function(_0x1c2ace){if(_0x1c2ace){var _0x386ec7=_0x1c2ace[_0x9570('0x18')],_0x24fcb9=_0x413abe['offset'],_0x5d9abb=_0x413abe['offset']+_0x413abe[_0x9570('0x19')],_0x544a29;if(_0x5d9abb>=_0x386ec7){_0x5d9abb=_0x386ec7;_0x544a29=0xc8;}else{_0x544a29=0xce;}_0x4d7588['status'](_0x544a29);return _0x4d7588['set'](_0x9570('0x1a'),_0x24fcb9+'-'+_0x5d9abb+'/'+_0x386ec7)[_0x9570('0x1b')](_0x1c2ace);}return null;};}function patchUpdates(_0x22e78b){return function(_0x33a955){try{jsonpatch[_0x9570('0x1c')](_0x33a955,_0x22e78b,!![]);}catch(_0x20b903){return BPromise[_0x9570('0x1d')](_0x20b903);}return _0x33a955['save']();};}function saveUpdates(_0x1b4f83,_0x389a2a){return function(_0x28bf52){if(_0x28bf52){return _0x28bf52['update'](_0x1b4f83)[_0x9570('0x1e')](function(_0x16a56d){return _0x16a56d;});}return null;};}function removeEntity(_0x53012d,_0x121cdf){return function(_0x4f5882){if(_0x4f5882){return _0x4f5882[_0x9570('0x1f')]()['then'](function(){var _0x131fe5=_0x4f5882[_0x9570('0x20')]({'plain':!![]});var _0xf48b3d=_0x9570('0x21');return db[_0x9570('0x22')]['destroy']({'where':{'type':_0xf48b3d,'resourceId':_0x131fe5['id']}})['then'](function(){return _0x4f5882;});})['then'](function(){_0x53012d[_0x9570('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xeef5ed,_0x43977a){return function(_0x16bb2a){if(!_0x16bb2a){_0xeef5ed[_0x9570('0x15')](0x194);}return _0x16bb2a;};}function handleError(_0x1bc745,_0x303293){_0x303293=_0x303293||0x1f4;return function(_0x11fd0e){logger[_0x9570('0x23')](_0x11fd0e['stack']);if(_0x11fd0e['name']){delete _0x11fd0e['name'];}_0x1bc745[_0x9570('0x16')](_0x303293)[_0x9570('0x24')](_0x11fd0e);};}exports[_0x9570('0x25')]=function(_0x372f3a,_0x5e6bac){var _0x95837d={},_0x30a138={},_0x546fdc={'count':0x0,'rows':[]};var _0x41dda3=_[_0x9570('0x26')](db['VoiceChanSpy']['rawAttributes'],function(_0x44b9b3){return{'name':_0x44b9b3[_0x9570('0x27')],'type':_0x44b9b3[_0x9570('0x28')][_0x9570('0x29')]};});_0x30a138[_0x9570('0x2a')]=_['map'](_0x41dda3,_0x9570('0x2b'));_0x30a138[_0x9570('0x2c')]=_[_0x9570('0x2d')](_0x372f3a[_0x9570('0x2c')]);_0x30a138['filters']=_[_0x9570('0x2e')](_0x30a138[_0x9570('0x2a')],_0x30a138[_0x9570('0x2c')]);_0x95837d[_0x9570('0x2f')]=_[_0x9570('0x2e')](_0x30a138[_0x9570('0x2a')],qs[_0x9570('0x30')](_0x372f3a[_0x9570('0x2c')][_0x9570('0x30')]));_0x95837d[_0x9570('0x2f')]=_0x95837d[_0x9570('0x2f')][_0x9570('0x31')]?_0x95837d[_0x9570('0x2f')]:_0x30a138[_0x9570('0x2a')];if(!_0x372f3a[_0x9570('0x2c')][_0x9570('0x32')]('nolimit')){_0x95837d[_0x9570('0x19')]=qs[_0x9570('0x19')](_0x372f3a[_0x9570('0x2c')][_0x9570('0x19')]);_0x95837d[_0x9570('0x33')]=qs['offset'](_0x372f3a[_0x9570('0x2c')][_0x9570('0x33')]);}_0x95837d[_0x9570('0x34')]=qs[_0x9570('0x35')](_0x372f3a[_0x9570('0x2c')][_0x9570('0x35')]);_0x95837d['where']=qs['filters'](_['pick'](_0x372f3a[_0x9570('0x2c')],_0x30a138[_0x9570('0x36')]),_0x41dda3);if(_0x372f3a[_0x9570('0x2c')][_0x9570('0x37')]){_0x95837d[_0x9570('0x38')]=_[_0x9570('0x39')](_0x95837d[_0x9570('0x38')],{'$or':_['map'](_0x41dda3,function(_0x33efb2){if(_0x33efb2[_0x9570('0x28')]!==_0x9570('0x3a')){var _0x3556eb={};_0x3556eb[_0x33efb2[_0x9570('0x2b')]]={'$like':'%'+_0x372f3a['query'][_0x9570('0x37')]+'%'};return _0x3556eb;}})});}_0x95837d=_[_0x9570('0x39')]({},_0x95837d,_0x372f3a[_0x9570('0x3b')]);var _0x9ae2a9={'where':_0x95837d['where']};return db[_0x9570('0x3c')][_0x9570('0x18')](_0x9ae2a9)[_0x9570('0x1e')](function(_0x5af6d5){_0x546fdc['count']=_0x5af6d5;if(_0x372f3a['query'][_0x9570('0x3d')]){_0x95837d[_0x9570('0x3e')]=[{'all':!![]}];}return db[_0x9570('0x3c')]['findAll'](_0x95837d);})[_0x9570('0x1e')](function(_0x4decfe){_0x546fdc[_0x9570('0x3f')]=_0x4decfe;return _0x546fdc;})[_0x9570('0x1e')](respondWithFilteredResult(_0x5e6bac,_0x95837d))[_0x9570('0x40')](handleError(_0x5e6bac,null));};exports[_0x9570('0x41')]=function(_0x229ae6,_0x1e6392){var _0x1fb929={'raw':![],'where':{'id':_0x229ae6[_0x9570('0x42')]['id']}},_0xac1fb7={};_0xac1fb7[_0x9570('0x2a')]=_['keys'](db[_0x9570('0x3c')]['rawAttributes']);_0xac1fb7[_0x9570('0x2c')]=_[_0x9570('0x2d')](_0x229ae6[_0x9570('0x2c')]);_0xac1fb7['filters']=_[_0x9570('0x2e')](_0xac1fb7[_0x9570('0x2a')],_0xac1fb7[_0x9570('0x2c')]);_0x1fb929['attributes']=_[_0x9570('0x2e')](_0xac1fb7[_0x9570('0x2a')],qs[_0x9570('0x30')](_0x229ae6['query'][_0x9570('0x30')]));_0x1fb929[_0x9570('0x2f')]=_0x1fb929['attributes'][_0x9570('0x31')]?_0x1fb929['attributes']:_0xac1fb7['model'];if(_0x229ae6[_0x9570('0x2c')]['includeAll']){_0x1fb929[_0x9570('0x3e')]=[{'all':!![]}];}_0x1fb929=_[_0x9570('0x39')]({},_0x1fb929,_0x229ae6[_0x9570('0x3b')]);return db['VoiceChanSpy']['find'](_0x1fb929)['then'](handleEntityNotFound(_0x1e6392,null))[_0x9570('0x1e')](respondWithResult(_0x1e6392,null))[_0x9570('0x40')](handleError(_0x1e6392,null));};exports[_0x9570('0x43')]=function(_0xceb46c,_0x16dff1){return db[_0x9570('0x3c')][_0x9570('0x43')](_0xceb46c[_0x9570('0x44')],{})['then'](function(_0x59ace9){var _0x55ec61=_0xceb46c[_0x9570('0x45')][_0x9570('0x20')]({'plain':!![]});if(!_0x55ec61)throw new Error(_0x9570('0x46'));if(_0x55ec61[_0x9570('0x47')]===_0x9570('0x45')){var _0x32787b=_0x59ace9[_0x9570('0x20')]({'plain':!![]});var _0x294f45='ChanSpies';return db[_0x9570('0x48')][_0x9570('0x49')]({'where':{'name':_0x294f45,'userProfileId':_0x55ec61['userProfileId']},'raw':!![]})[_0x9570('0x1e')](function(_0x473a3e){if(_0x473a3e&&_0x473a3e[_0x9570('0x4a')]===0x0){return db[_0x9570('0x22')][_0x9570('0x43')]({'name':_0x32787b[_0x9570('0x2b')],'resourceId':_0x32787b['id'],'type':_0x473a3e[_0x9570('0x2b')],'sectionId':_0x473a3e['id']},{})[_0x9570('0x1e')](function(){return _0x59ace9;});}else{return _0x59ace9;}})['catch'](function(_0x1d662c){logger[_0x9570('0x23')](_0x9570('0x4b'),_0x1d662c);throw _0x1d662c;});}return _0x59ace9;})[_0x9570('0x1e')](respondWithResult(_0x16dff1,0xc9))['catch'](handleError(_0x16dff1,null));};exports[_0x9570('0x4c')]=function(_0x3204ee,_0x39408f){if(_0x3204ee[_0x9570('0x44')]['id']){delete _0x3204ee[_0x9570('0x44')]['id'];}return db[_0x9570('0x3c')][_0x9570('0x49')]({'where':{'id':_0x3204ee[_0x9570('0x42')]['id']}})['then'](handleEntityNotFound(_0x39408f,null))[_0x9570('0x1e')](saveUpdates(_0x3204ee[_0x9570('0x44')],null))[_0x9570('0x1e')](respondWithResult(_0x39408f,null))[_0x9570('0x40')](handleError(_0x39408f,null));};exports['destroy']=function(_0x1cf5ab,_0x22434f){return db[_0x9570('0x3c')][_0x9570('0x49')]({'where':{'id':_0x1cf5ab[_0x9570('0x42')]['id']}})[_0x9570('0x1e')](handleEntityNotFound(_0x22434f,null))[_0x9570('0x1e')](removeEntity(_0x22434f,null))[_0x9570('0x40')](handleError(_0x22434f,null));}; \ No newline at end of file +var _0x8575=['sort','where','pick','filter','merge','map','options','VoiceChanSpy','include','rows','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','catch','error','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','name','send','index','fieldName','type','key','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order'];(function(_0x3645d6,_0x23f40e){var _0x5ed657=function(_0x289937){while(--_0x289937){_0x3645d6['push'](_0x3645d6['shift']());}};_0x5ed657(++_0x23f40e);}(_0x8575,0x1df));var _0x5857=function(_0xa0c607,_0x43142a){_0xa0c607=_0xa0c607-0x0;var _0x368e77=_0x8575[_0xa0c607];return _0x368e77;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5857('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5857('0x1'));var jsonpatch=require(_0x5857('0x2'));var rp=require('request-promise');var moment=require(_0x5857('0x3'));var BPromise=require(_0x5857('0x4'));var Mustache=require('mustache');var util=require(_0x5857('0x5'));var path=require(_0x5857('0x6'));var sox=require(_0x5857('0x7'));var csv=require(_0x5857('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5857('0x9'));var squel=require('squel');var crypto=require(_0x5857('0xa'));var jsforce=require(_0x5857('0xb'));var deskjs=require(_0x5857('0xc'));var toCsv=require(_0x5857('0x8'));var querystring=require(_0x5857('0xd'));var Papa=require(_0x5857('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5857('0xf'))(_0x5857('0x10'));var utils=require(_0x5857('0x11'));var config=require(_0x5857('0x12'));var db=require(_0x5857('0x13'))['db'];function respondWithStatusCode(_0x3d0ee5,_0x2344ff){_0x2344ff=_0x2344ff||0xcc;return function(_0x30a6ed){if(_0x30a6ed){return _0x3d0ee5[_0x5857('0x14')](_0x2344ff);}return _0x3d0ee5[_0x5857('0x15')](_0x2344ff)[_0x5857('0x16')]();};}function respondWithResult(_0x198e5c,_0x5a6dad){_0x5a6dad=_0x5a6dad||0xc8;return function(_0x301276){if(_0x301276){return _0x198e5c[_0x5857('0x15')](_0x5a6dad)[_0x5857('0x17')](_0x301276);}};}function respondWithFilteredResult(_0x1d963e,_0x4381b8){return function(_0x14f0b6){if(_0x14f0b6){var _0x5e8b9a=_0x14f0b6[_0x5857('0x18')],_0x2aaacb=_0x4381b8[_0x5857('0x19')],_0x2d136b=_0x4381b8[_0x5857('0x19')]+_0x4381b8[_0x5857('0x1a')],_0x382a17;if(_0x2d136b>=_0x5e8b9a){_0x2d136b=_0x5e8b9a;_0x382a17=0xc8;}else{_0x382a17=0xce;}_0x1d963e[_0x5857('0x15')](_0x382a17);return _0x1d963e['set'](_0x5857('0x1b'),_0x2aaacb+'-'+_0x2d136b+'/'+_0x5e8b9a)[_0x5857('0x17')](_0x14f0b6);}return null;};}function patchUpdates(_0x29413e){return function(_0x42c20f){try{jsonpatch[_0x5857('0x1c')](_0x42c20f,_0x29413e,!![]);}catch(_0x38a326){return BPromise[_0x5857('0x1d')](_0x38a326);}return _0x42c20f[_0x5857('0x1e')]();};}function saveUpdates(_0x4e3937,_0x1b378b){return function(_0x2f5114){if(_0x2f5114){return _0x2f5114[_0x5857('0x1f')](_0x4e3937)[_0x5857('0x20')](function(_0x337127){return _0x337127;});}return null;};}function removeEntity(_0xfe794e,_0x28eb32){return function(_0x22afa6){if(_0x22afa6){return _0x22afa6[_0x5857('0x21')]()['then'](function(){var _0x4f9c5d=_0x22afa6[_0x5857('0x22')]({'plain':!![]});var _0x4bd985='ChanSpies';return db[_0x5857('0x23')]['destroy']({'where':{'type':_0x4bd985,'resourceId':_0x4f9c5d['id']}})['then'](function(){return _0x22afa6;});})[_0x5857('0x20')](function(){_0xfe794e[_0x5857('0x15')](0xcc)[_0x5857('0x16')]();});}};}function handleEntityNotFound(_0x3d510c,_0xbe577c){return function(_0x434531){if(!_0x434531){_0x3d510c[_0x5857('0x14')](0x194);}return _0x434531;};}function handleError(_0x5500fa,_0x52e476){_0x52e476=_0x52e476||0x1f4;return function(_0x2c33e6){logger['error'](_0x2c33e6['stack']);if(_0x2c33e6[_0x5857('0x24')]){delete _0x2c33e6[_0x5857('0x24')];}_0x5500fa[_0x5857('0x15')](_0x52e476)[_0x5857('0x25')](_0x2c33e6);};}exports[_0x5857('0x26')]=function(_0x284499,_0x48ab06){var _0x284739={},_0x49435e={},_0x1a7213={'count':0x0,'rows':[]};var _0x6f762c=_['map'](db['VoiceChanSpy']['rawAttributes'],function(_0x7fe88){return{'name':_0x7fe88[_0x5857('0x27')],'type':_0x7fe88[_0x5857('0x28')][_0x5857('0x29')]};});_0x49435e['model']=_['map'](_0x6f762c,_0x5857('0x24'));_0x49435e['query']=_[_0x5857('0x2a')](_0x284499[_0x5857('0x2b')]);_0x49435e[_0x5857('0x2c')]=_[_0x5857('0x2d')](_0x49435e['model'],_0x49435e[_0x5857('0x2b')]);_0x284739[_0x5857('0x2e')]=_[_0x5857('0x2d')](_0x49435e['model'],qs[_0x5857('0x2f')](_0x284499['query'][_0x5857('0x2f')]));_0x284739[_0x5857('0x2e')]=_0x284739['attributes'][_0x5857('0x30')]?_0x284739['attributes']:_0x49435e[_0x5857('0x31')];if(!_0x284499[_0x5857('0x2b')][_0x5857('0x32')](_0x5857('0x33'))){_0x284739[_0x5857('0x1a')]=qs[_0x5857('0x1a')](_0x284499[_0x5857('0x2b')]['limit']);_0x284739[_0x5857('0x19')]=qs['offset'](_0x284499[_0x5857('0x2b')][_0x5857('0x19')]);}_0x284739[_0x5857('0x34')]=qs['sort'](_0x284499[_0x5857('0x2b')][_0x5857('0x35')]);_0x284739[_0x5857('0x36')]=qs[_0x5857('0x2c')](_[_0x5857('0x37')](_0x284499[_0x5857('0x2b')],_0x49435e[_0x5857('0x2c')]),_0x6f762c);if(_0x284499[_0x5857('0x2b')][_0x5857('0x38')]){_0x284739[_0x5857('0x36')]=_[_0x5857('0x39')](_0x284739[_0x5857('0x36')],{'$or':_[_0x5857('0x3a')](_0x6f762c,function(_0x1ae6e6){if(_0x1ae6e6[_0x5857('0x28')]!=='VIRTUAL'){var _0x393085={};_0x393085[_0x1ae6e6[_0x5857('0x24')]]={'$like':'%'+_0x284499['query']['filter']+'%'};return _0x393085;}})});}_0x284739=_[_0x5857('0x39')]({},_0x284739,_0x284499[_0x5857('0x3b')]);var _0x443d6d={'where':_0x284739[_0x5857('0x36')]};return db[_0x5857('0x3c')][_0x5857('0x18')](_0x443d6d)[_0x5857('0x20')](function(_0x545f64){_0x1a7213[_0x5857('0x18')]=_0x545f64;if(_0x284499['query']['includeAll']){_0x284739[_0x5857('0x3d')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x284739);})[_0x5857('0x20')](function(_0xc3c581){_0x1a7213[_0x5857('0x3e')]=_0xc3c581;return _0x1a7213;})['then'](respondWithFilteredResult(_0x48ab06,_0x284739))['catch'](handleError(_0x48ab06,null));};exports[_0x5857('0x3f')]=function(_0x417232,_0x230662){var _0x5b0aa4={'raw':![],'where':{'id':_0x417232[_0x5857('0x40')]['id']}},_0x3ffe24={};_0x3ffe24['model']=_['keys'](db[_0x5857('0x3c')]['rawAttributes']);_0x3ffe24[_0x5857('0x2b')]=_[_0x5857('0x2a')](_0x417232[_0x5857('0x2b')]);_0x3ffe24['filters']=_[_0x5857('0x2d')](_0x3ffe24[_0x5857('0x31')],_0x3ffe24['query']);_0x5b0aa4[_0x5857('0x2e')]=_['intersection'](_0x3ffe24[_0x5857('0x31')],qs[_0x5857('0x2f')](_0x417232[_0x5857('0x2b')]['fields']));_0x5b0aa4[_0x5857('0x2e')]=_0x5b0aa4[_0x5857('0x2e')][_0x5857('0x30')]?_0x5b0aa4[_0x5857('0x2e')]:_0x3ffe24['model'];if(_0x417232[_0x5857('0x2b')][_0x5857('0x41')]){_0x5b0aa4[_0x5857('0x3d')]=[{'all':!![]}];}_0x5b0aa4=_[_0x5857('0x39')]({},_0x5b0aa4,_0x417232[_0x5857('0x3b')]);return db[_0x5857('0x3c')][_0x5857('0x42')](_0x5b0aa4)[_0x5857('0x20')](handleEntityNotFound(_0x230662,null))[_0x5857('0x20')](respondWithResult(_0x230662,null))['catch'](handleError(_0x230662,null));};exports['create']=function(_0x41512d,_0x3c9683){return db[_0x5857('0x3c')][_0x5857('0x43')](_0x41512d[_0x5857('0x44')],{})['then'](function(_0xb57150){var _0x14446f=_0x41512d['user']['get']({'plain':!![]});if(!_0x14446f)throw new Error(_0x5857('0x45'));if(_0x14446f[_0x5857('0x46')]===_0x5857('0x47')){var _0x39465d=_0xb57150[_0x5857('0x22')]({'plain':!![]});var _0x44421e='ChanSpies';return db['UserProfileSection'][_0x5857('0x42')]({'where':{'name':_0x44421e,'userProfileId':_0x14446f[_0x5857('0x48')]},'raw':!![]})[_0x5857('0x20')](function(_0x1c321b){if(_0x1c321b&&_0x1c321b[_0x5857('0x49')]===0x0){return db['UserProfileResource'][_0x5857('0x43')]({'name':_0x39465d[_0x5857('0x24')],'resourceId':_0x39465d['id'],'type':_0x1c321b['name'],'sectionId':_0x1c321b['id']},{})['then'](function(){return _0xb57150;});}else{return _0xb57150;}})[_0x5857('0x4a')](function(_0x141a61){logger[_0x5857('0x4b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x141a61);throw _0x141a61;});}return _0xb57150;})[_0x5857('0x20')](respondWithResult(_0x3c9683,0xc9))[_0x5857('0x4a')](handleError(_0x3c9683,null));};exports[_0x5857('0x1f')]=function(_0x3e7659,_0x44ae71){if(_0x3e7659[_0x5857('0x44')]['id']){delete _0x3e7659['body']['id'];}return db[_0x5857('0x3c')][_0x5857('0x42')]({'where':{'id':_0x3e7659['params']['id']}})[_0x5857('0x20')](handleEntityNotFound(_0x44ae71,null))[_0x5857('0x20')](saveUpdates(_0x3e7659['body'],null))[_0x5857('0x20')](respondWithResult(_0x44ae71,null))['catch'](handleError(_0x44ae71,null));};exports[_0x5857('0x21')]=function(_0x2fb8d9,_0x1d26d8){return db[_0x5857('0x3c')]['find']({'where':{'id':_0x2fb8d9['params']['id']}})[_0x5857('0x20')](handleEntityNotFound(_0x1d26d8,null))['then'](removeEntity(_0x1d26d8,null))[_0x5857('0x4a')](handleError(_0x1d26d8,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 69b7b1a..fb4c1e6 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 _0x9efb=['SIP/%s,%s','options','StopMixMonitor','length','internal','concat','name','User','findAll','agent','catch','exports','models','VoiceChanSpy','then','bulkCreate','VoiceExtension','util','bluebird','context','from-sip','format','%s%s','push','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy'];(function(_0x466f03,_0xe3f71d){var _0x1132db=function(_0x338d4b){while(--_0x338d4b){_0x466f03['push'](_0x466f03['shift']());}};_0x1132db(++_0xe3f71d);}(_0x9efb,0x143));var _0xb9ef=function(_0x419e8b,_0xb0e337){_0x419e8b=_0x419e8b-0x0;var _0x4dc318=_0x9efb[_0x419e8b];return _0x4dc318;};'use strict';var _=require('lodash');var util=require(_0xb9ef('0x0'));var BPromise=require(_0xb9ef('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x22984e,_0x267320,_0x510c60){var _0x9e47ee=0x1;var _0x1e1eeb=[];var _0x33ef5b={'context':_0x267320[_0xb9ef('0x2')]||_0xb9ef('0x3'),'exten':util[_0xb9ef('0x4')](_0xb9ef('0x5'),_0x22984e['prefix'],_0x510c60),'type':'system','isApp':![],'ChanSpyId':_0x22984e['id'],'UserId':_0x267320['id']};_0x1e1eeb[_0xb9ef('0x6')](_['merge']({'app':'Set','appdata':util[_0xb9ef('0x4')](_0xb9ef('0x7'),_0xb9ef('0x8')),'priority':_0x9e47ee++},_0x33ef5b));if(_0x22984e[_0xb9ef('0x9')]){_0x1e1eeb['push'](_[_0xb9ef('0xa')]({'app':_0xb9ef('0xb'),'appdata':util[_0xb9ef('0x4')](_0xb9ef('0xc'),_0x22984e['recordingFormat']),'priority':_0x9e47ee++},_0x33ef5b));}if(_0x22984e[_0xb9ef('0xd')]){_0x1e1eeb[_0xb9ef('0x6')](_[_0xb9ef('0xa')]({'app':_0xb9ef('0xe'),'appdata':_0x22984e[_0xb9ef('0xf')],'priority':_0x9e47ee++},_0x33ef5b));}_0x1e1eeb[_0xb9ef('0x6')](_[_0xb9ef('0xa')]({'app':_0xb9ef('0x10'),'appdata':util[_0xb9ef('0x4')](_0xb9ef('0x11'),_0x267320['name'],_0x22984e[_0xb9ef('0x12')]?_0x22984e[_0xb9ef('0x12')]['join'](''):''),'priority':_0x9e47ee++},_0x33ef5b));if(_0x22984e['record']){_0x1e1eeb[_0xb9ef('0x6')](_[_0xb9ef('0xa')]({'app':_0xb9ef('0x13'),'priority':_0x9e47ee++},_0x33ef5b));}return _0x1e1eeb;};var getChanSpyApplications=function(_0x11fb09,_0x51c9fa){var _0x4bdafc=[];for(var _0x56ef9b=0x0,_0xf155f0=0x1;_0x56ef9b<_0x51c9fa[_0xb9ef('0x14')];_0x56ef9b++,_0xf155f0=0x1){_0x4bdafc=_0x4bdafc['concat'](getUserApplications(_0x11fb09,_0x51c9fa[_0x56ef9b],_0x51c9fa[_0x56ef9b][_0xb9ef('0x15')]));if(_0x51c9fa[_0x56ef9b][_0xb9ef('0x15')]!=_0x51c9fa[_0x56ef9b]['name']){_0x4bdafc=_0x4bdafc[_0xb9ef('0x16')](getUserApplications(_0x11fb09,_0x51c9fa[_0x56ef9b],_0x51c9fa[_0x56ef9b][_0xb9ef('0x17')]));}}return _0x4bdafc;};var getChanSpyPromise=function(_0x294e78,_0x3c4e5c){return new BPromise(function(_0x389602,_0x38def8){return _0x294e78[_0xb9ef('0x18')][_0xb9ef('0x19')]({'attributes':['id','name',_0xb9ef('0x15')],'where':{'role':_0xb9ef('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x42b88f){if(_0x42b88f){return _0x389602(getChanSpyApplications(_0x3c4e5c,_0x42b88f));}return _0x389602([]);})[_0xb9ef('0x1b')](function(_0x2aa80d){_0x38def8(_0x2aa80d);});});};module[_0xb9ef('0x1c')]=function(_0x56162c,_0x9a6690){var _0x258db1=_0x56162c[_0xb9ef('0x1d')];return _0x56162c['define'](_0xb9ef('0x1e'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5c5622,_0x545173,_0x3fd6e0){return getChanSpyPromise(_0x258db1,_0x5c5622)[_0xb9ef('0x1f')](function(_0x1cb2a9){if(_0x1cb2a9&&_0x1cb2a9[_0xb9ef('0x14')]){return _0x258db1['VoiceExtension'][_0xb9ef('0x20')](_0x1cb2a9);}})[_0xb9ef('0x1f')](function(){_0x3fd6e0();})['catch'](function(_0x43b6d7){_0x3fd6e0(_0x43b6d7);});},'afterUpdate':function(_0x11d58f,_0x256f49,_0x27e654){return _0x258db1[_0xb9ef('0x21')]['destroy']({'where':{'ChanSpyId':_0x11d58f['id']}})['then'](function(){return getChanSpyPromise(_0x258db1,_0x11d58f);})[_0xb9ef('0x1f')](function(_0x1fc456){if(_0x1fc456&&_0x1fc456[_0xb9ef('0x14')]){return _0x258db1[_0xb9ef('0x21')][_0xb9ef('0x20')](_0x1fc456);}})[_0xb9ef('0x1f')](function(){_0x27e654();})[_0xb9ef('0x1b')](function(_0x124f4f){_0x27e654(_0x124f4f);});},'afterDestroy':function(_0x4d8055,_0x2853ae,_0x43e4eb){return _0x258db1[_0xb9ef('0x21')]['destroy']({'where':{'ChanSpyId':_0x4d8055['id']}})['then'](function(){_0x43e4eb();})[_0xb9ef('0x1b')](function(_0x55dcc6){_0x43e4eb(_0x55dcc6);});}}});}; \ No newline at end of file +var _0x418f=['format','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','SIP/%s,%s','options','join','StopMixMonitor','concat','internal','name','findAll','agent','catch','exports','models','voice_chanspy','length','bulkCreate','then','destroy','VoiceExtension','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','push','merge','Set'];(function(_0x4659c9,_0x2e1ac3){var _0x163057=function(_0x1e7963){while(--_0x1e7963){_0x4659c9['push'](_0x4659c9['shift']());}};_0x163057(++_0x2e1ac3);}(_0x418f,0xdf));var _0xf418=function(_0x4ac496,_0x57e5d2){_0x4ac496=_0x4ac496-0x0;var _0xed90c3=_0x418f[_0x4ac496];return _0xed90c3;};'use strict';var _=require(_0xf418('0x0'));var util=require(_0xf418('0x1'));var BPromise=require(_0xf418('0x2'));var attributes=require(_0xf418('0x3'));var getUserApplications=function(_0x3f42db,_0x5613fd,_0x2951e8){var _0x5f92ac=0x1;var _0x415d64=[];var _0x411e32={'context':_0x5613fd['context']||_0xf418('0x4'),'exten':util['format']('%s%s',_0x3f42db['prefix'],_0x2951e8),'type':'system','isApp':![],'ChanSpyId':_0x3f42db['id'],'UserId':_0x5613fd['id']};_0x415d64[_0xf418('0x5')](_[_0xf418('0x6')]({'app':_0xf418('0x7'),'appdata':util[_0xf418('0x8')](_0xf418('0x9'),'chanspy'),'priority':_0x5f92ac++},_0x411e32));if(_0x3f42db[_0xf418('0xa')]){_0x415d64[_0xf418('0x5')](_[_0xf418('0x6')]({'app':_0xf418('0xb'),'appdata':util[_0xf418('0x8')](_0xf418('0xc'),_0x3f42db['recordingFormat']),'priority':_0x5f92ac++},_0x411e32));}if(_0x3f42db[_0xf418('0xd')]){_0x415d64[_0xf418('0x5')](_['merge']({'app':_0xf418('0xe'),'appdata':_0x3f42db['password'],'priority':_0x5f92ac++},_0x411e32));}_0x415d64[_0xf418('0x5')](_['merge']({'app':'ChanSpy','appdata':util[_0xf418('0x8')](_0xf418('0xf'),_0x5613fd['name'],_0x3f42db[_0xf418('0x10')]?_0x3f42db[_0xf418('0x10')][_0xf418('0x11')](''):''),'priority':_0x5f92ac++},_0x411e32));if(_0x3f42db[_0xf418('0xa')]){_0x415d64[_0xf418('0x5')](_['merge']({'app':_0xf418('0x12'),'priority':_0x5f92ac++},_0x411e32));}return _0x415d64;};var getChanSpyApplications=function(_0x2bad82,_0x4a7a62){var _0x42bf0d=[];for(var _0x1d50f3=0x0,_0x3f9ee1=0x1;_0x1d50f3<_0x4a7a62['length'];_0x1d50f3++,_0x3f9ee1=0x1){_0x42bf0d=_0x42bf0d[_0xf418('0x13')](getUserApplications(_0x2bad82,_0x4a7a62[_0x1d50f3],_0x4a7a62[_0x1d50f3][_0xf418('0x14')]));if(_0x4a7a62[_0x1d50f3][_0xf418('0x14')]!=_0x4a7a62[_0x1d50f3][_0xf418('0x15')]){_0x42bf0d=_0x42bf0d[_0xf418('0x13')](getUserApplications(_0x2bad82,_0x4a7a62[_0x1d50f3],_0x4a7a62[_0x1d50f3][_0xf418('0x15')]));}}return _0x42bf0d;};var getChanSpyPromise=function(_0x49e284,_0x49781a){return new BPromise(function(_0x45c9b9,_0x3ab008){return _0x49e284['User'][_0xf418('0x16')]({'attributes':['id',_0xf418('0x15'),_0xf418('0x14')],'where':{'role':_0xf418('0x17'),'chanspy':!![]},'raw':!![]})['then'](function(_0x5162af){if(_0x5162af){return _0x45c9b9(getChanSpyApplications(_0x49781a,_0x5162af));}return _0x45c9b9([]);})[_0xf418('0x18')](function(_0x4f7caf){_0x3ab008(_0x4f7caf);});});};module[_0xf418('0x19')]=function(_0x29afa0,_0x5919bb){var _0x2811dc=_0x29afa0[_0xf418('0x1a')];return _0x29afa0['define']('VoiceChanSpy',attributes,{'tableName':_0xf418('0x1b'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x434a95,_0x37053c,_0x2dbcae){return getChanSpyPromise(_0x2811dc,_0x434a95)['then'](function(_0xc57810){if(_0xc57810&&_0xc57810[_0xf418('0x1c')]){return _0x2811dc['VoiceExtension'][_0xf418('0x1d')](_0xc57810);}})[_0xf418('0x1e')](function(){_0x2dbcae();})['catch'](function(_0x2487e8){_0x2dbcae(_0x2487e8);});},'afterUpdate':function(_0x4c844d,_0x2eec6b,_0x5e160a){return _0x2811dc['VoiceExtension'][_0xf418('0x1f')]({'where':{'ChanSpyId':_0x4c844d['id']}})[_0xf418('0x1e')](function(){return getChanSpyPromise(_0x2811dc,_0x4c844d);})[_0xf418('0x1e')](function(_0x49ef18){if(_0x49ef18&&_0x49ef18[_0xf418('0x1c')]){return _0x2811dc[_0xf418('0x20')][_0xf418('0x1d')](_0x49ef18);}})[_0xf418('0x1e')](function(){_0x5e160a();})['catch'](function(_0x2a6990){_0x5e160a(_0x2a6990);});},'afterDestroy':function(_0x5469a9,_0x2df419,_0x2bf573){return _0x2811dc['VoiceExtension'][_0xf418('0x1f')]({'where':{'ChanSpyId':_0x5469a9['id']}})[_0xf418('0x1e')](function(){_0x2bf573();})[_0xf418('0x18')](function(_0x540dcd){_0x2bf573(_0x540dcd);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index b7656a5..9e0be3f 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 _0x99da=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','util'];(function(_0xe483c1,_0x4a2781){var _0x3ccace=function(_0x35a96f){while(--_0x35a96f){_0xe483c1['push'](_0xe483c1['shift']());}};_0x3ccace(++_0x4a2781);}(_0x99da,0x8f));var _0xa99d=function(_0x20c757,_0xf1f53b){_0x20c757=_0x20c757-0x0;var _0x2720f3=_0x99da[_0x20c757];return _0x2720f3;};'use strict';var _=require('lodash');var util=require(_0xa99d('0x0'));var moment=require(_0xa99d('0x1'));var BPromise=require(_0xa99d('0x2'));var rs=require(_0xa99d('0x3'));var fs=require('fs');var Redis=require(_0xa99d('0x4'));var db=require(_0xa99d('0x5'))['db'];var utils=require(_0xa99d('0x6'));var logger=require(_0xa99d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa99d('0x8'));var client=jayson[_0xa99d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dab8f,_0x46fa9a,_0x11deeb){return new BPromise(function(_0x1cf30c,_0x4f23a8){return client[_0xa99d('0xa')](_0x4dab8f,_0x11deeb)['then'](function(_0x48490c){logger['info'](_0xa99d('0xb'),_0x46fa9a,_0xa99d('0xc'));logger[_0xa99d('0xd')](_0xa99d('0xe'),_0x46fa9a,_0xa99d('0xc'),JSON[_0xa99d('0xf')](_0x48490c));if(_0x48490c[_0xa99d('0x10')]){if(_0x48490c[_0xa99d('0x10')]['code']===0x1f4){logger[_0xa99d('0x10')](_0xa99d('0xb'),_0x46fa9a,_0x48490c[_0xa99d('0x10')][_0xa99d('0x11')]);return _0x4f23a8(_0x48490c['error']['message']);}logger['error'](_0xa99d('0xb'),_0x46fa9a,_0x48490c[_0xa99d('0x10')]['message']);return _0x1cf30c(_0x48490c[_0xa99d('0x10')][_0xa99d('0x11')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x46fa9a,_0xa99d('0xc'));_0x1cf30c(_0x48490c['result'][_0xa99d('0x11')]);}})['catch'](function(_0x3ea0fd){logger[_0xa99d('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x46fa9a,_0x3ea0fd);_0x4f23a8(_0x3ea0fd);});});} \ No newline at end of file +var _0x53fd=['../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x566667,_0x3f99c2){var _0x277136=function(_0x129ea0){while(--_0x129ea0){_0x566667['push'](_0x566667['shift']());}};_0x277136(++_0x3f99c2);}(_0x53fd,0xa2));var _0xd53f=function(_0x4bccb4,_0x765452){_0x4bccb4=_0x4bccb4-0x0;var _0x3b056e=_0x53fd[_0x4bccb4];return _0x3b056e;};'use strict';var _=require(_0xd53f('0x0'));var util=require(_0xd53f('0x1'));var moment=require(_0xd53f('0x2'));var BPromise=require(_0xd53f('0x3'));var rs=require(_0xd53f('0x4'));var fs=require('fs');var Redis=require(_0xd53f('0x5'));var db=require(_0xd53f('0x6'))['db'];var utils=require(_0xd53f('0x7'));var logger=require(_0xd53f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd53f('0x9')][_0xd53f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24762a,_0x515ca3,_0x7b162f){return new BPromise(function(_0x1ea432,_0x30b3fa){return client[_0xd53f('0xb')](_0x24762a,_0x7b162f)[_0xd53f('0xc')](function(_0x57e0a1){logger[_0xd53f('0xd')](_0xd53f('0xe'),_0x515ca3,_0xd53f('0xf'));logger[_0xd53f('0x10')](_0xd53f('0x11'),_0x515ca3,_0xd53f('0xf'),JSON[_0xd53f('0x12')](_0x57e0a1));if(_0x57e0a1['error']){if(_0x57e0a1[_0xd53f('0x13')][_0xd53f('0x14')]===0x1f4){logger[_0xd53f('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x515ca3,_0x57e0a1[_0xd53f('0x13')]['message']);return _0x30b3fa(_0x57e0a1[_0xd53f('0x13')][_0xd53f('0x15')]);}logger['error'](_0xd53f('0xe'),_0x515ca3,_0x57e0a1[_0xd53f('0x13')][_0xd53f('0x15')]);return _0x1ea432(_0x57e0a1[_0xd53f('0x13')][_0xd53f('0x15')]);}else{logger[_0xd53f('0xd')](_0xd53f('0xe'),_0x515ca3,_0xd53f('0xf'));_0x1ea432(_0x57e0a1[_0xd53f('0x16')]['message']);}})[_0xd53f('0x17')](function(_0x42e3b0){logger[_0xd53f('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x515ca3,_0x42e3b0);_0x30b3fa(_0x42e3b0);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 5e8284f..ef93bb4 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 _0xd749=['isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xd749,0x12a));var _0x9d74=function(_0x4a0be1,_0x8a79d3){_0x4a0be1=_0x4a0be1-0x0;var _0x292b72=_0xd749[_0x4a0be1];return _0x292b72;};'use strict';var multer=require(_0x9d74('0x0'));var util=require(_0x9d74('0x1'));var path=require(_0x9d74('0x2'));var timeout=require('connect-timeout');var express=require(_0x9d74('0x3'));var router=express[_0x9d74('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9d74('0x5'));var config=require(_0x9d74('0x6'));var controller=require('./voiceContext.controller');router[_0x9d74('0x7')]('/',auth[_0x9d74('0x8')](),controller[_0x9d74('0x9')]);router[_0x9d74('0x7')](_0x9d74('0xa'),auth['isAuthenticated'](),controller[_0x9d74('0xb')]);router['post']('/',auth[_0x9d74('0x8')](),controller[_0x9d74('0xc')]);router[_0x9d74('0xd')](_0x9d74('0xa'),auth[_0x9d74('0x8')](),controller[_0x9d74('0xe')]);router[_0x9d74('0xf')]('/:id',auth[_0x9d74('0x8')](),controller[_0x9d74('0x10')]);module[_0x9d74('0x11')]=router; \ No newline at end of file +var _0x8b50=['put','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x8b50,0x1d1));var _0x08b5=function(_0x4ebd66,_0x21fb69){_0x4ebd66=_0x4ebd66-0x0;var _0x1d746f=_0x8b50[_0x4ebd66];return _0x1d746f;};'use strict';var multer=require(_0x08b5('0x0'));var util=require(_0x08b5('0x1'));var path=require('path');var timeout=require(_0x08b5('0x2'));var express=require('express');var router=express[_0x08b5('0x3')]();var auth=require(_0x08b5('0x4'));var interaction=require(_0x08b5('0x5'));var config=require(_0x08b5('0x6'));var controller=require(_0x08b5('0x7'));router['get']('/',auth[_0x08b5('0x8')](),controller[_0x08b5('0x9')]);router[_0x08b5('0xa')](_0x08b5('0xb'),auth[_0x08b5('0x8')](),controller[_0x08b5('0xc')]);router[_0x08b5('0xd')]('/',auth['isAuthenticated'](),controller[_0x08b5('0xe')]);router[_0x08b5('0xf')](_0x08b5('0xb'),auth[_0x08b5('0x8')](),controller[_0x08b5('0x10')]);router[_0x08b5('0x11')](_0x08b5('0xb'),auth[_0x08b5('0x8')](),controller[_0x08b5('0x12')]);module[_0x08b5('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index e9fb3c5..9b0c74e 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 _0x34e8=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x3c7730,_0x44e0ff){var _0xcc295c=function(_0x1ae219){while(--_0x1ae219){_0x3c7730['push'](_0x3c7730['shift']());}};_0xcc295c(++_0x44e0ff);}(_0x34e8,0x12c));var _0x834e=function(_0x446e79,_0x423f19){_0x446e79=_0x446e79-0x0;var _0x150be6=_0x34e8[_0x446e79];return _0x150be6;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'unique':_0x834e('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x834e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe14b=['exports','STRING','BOOLEAN','sequelize'];(function(_0x412f27,_0x116765){var _0x45a1e8=function(_0x360637){while(--_0x360637){_0x412f27['push'](_0x412f27['shift']());}};_0x45a1e8(++_0x116765);}(_0xe14b,0x93));var _0xbe14=function(_0x22260f,_0x17c79c){_0x22260f=_0x22260f-0x0;var _0x17d221=_0xe14b[_0x22260f];return _0x17d221;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xbe14('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xbe14('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 8e892e1..7776225 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 _0x3e74=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','get','Contexts','UserProfileResource','destroy','stack','name','send','map','VoiceContext','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filter','merge','where','VIRTUAL','includeAll','findAll','show','params','include','find','create','join','root','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','readFileSync','server/files/templates/context.ejs','chan_sip.so','render','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','request','then'];(function(_0x47d248,_0x13b87e){var _0x464f88=function(_0x528060){while(--_0x528060){_0x47d248['push'](_0x47d248['shift']());}};_0x464f88(++_0x13b87e);}(_0x3e74,0x175));var _0x43e7=function(_0x508724,_0x156fe5){_0x508724=_0x508724-0x0;var _0x4a518f=_0x3e74[_0x508724];return _0x4a518f;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x8'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var db=require('../../mysqldb')['db'];var jayson=require(_0x43e7('0x14'));var client=jayson[_0x43e7('0x15')][_0x43e7('0x16')]({'port':0x232a});function checkPasswordPattern(_0x3bb83f,_0x4e008c,_0x583d85){if(_0x583d85){var _0x2fcb36=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2fcb36[_0x43e7('0x17')](_0x4e008c)){return _0x3bb83f;}else{throw new db[(_0x43e7('0x18'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0x3bb83f;}}function respondWithRpcPromise(_0x16849c,_0x14c146,_0x203378,_0x328445){return new BPromise(function(_0x4de324,_0x5c4eaa){var _0xdf16c=_0x328445||client;return _0xdf16c[_0x43e7('0x19')](_0x16849c,_0x203378)[_0x43e7('0x1a')](function(_0x5d346f){logger['info'](_0x43e7('0x1b'),_0x14c146,_0x43e7('0x1c'));logger[_0x43e7('0x1d')](_0x43e7('0x1e'),_0x14c146,_0x43e7('0x1c'),JSON[_0x43e7('0x1f')](_0x5d346f));if(_0x5d346f[_0x43e7('0x20')]){if(_0x5d346f[_0x43e7('0x20')][_0x43e7('0x21')]===0x1f4){logger[_0x43e7('0x20')](_0x43e7('0x1b'),_0x14c146,_0x5d346f[_0x43e7('0x20')]['message']);return _0x5c4eaa(_0x5d346f[_0x43e7('0x20')][_0x43e7('0x22')]);}logger['error'](_0x43e7('0x1b'),_0x14c146,_0x5d346f[_0x43e7('0x20')][_0x43e7('0x22')]);return _0x4de324(_0x5d346f[_0x43e7('0x20')][_0x43e7('0x22')]);}else{logger[_0x43e7('0x23')]('VoiceContext,\x20%s,\x20%s',_0x14c146,_0x43e7('0x1c'));_0x4de324(_0x5d346f['result']['message']);}})[_0x43e7('0x24')](function(_0x43f4ff){logger['error'](_0x43e7('0x1b'),_0x14c146,_0x43f4ff);_0x5c4eaa(_0x43f4ff);});});}function respondWithStatusCode(_0x4ca5cf,_0x326dab){_0x326dab=_0x326dab||0xcc;return function(_0x5c5e67){if(_0x5c5e67){return _0x4ca5cf[_0x43e7('0x25')](_0x326dab);}return _0x4ca5cf[_0x43e7('0x26')](_0x326dab)[_0x43e7('0x27')]();};}function respondWithResult(_0x405f85,_0x51f4d7){_0x51f4d7=_0x51f4d7||0xc8;return function(_0x52b7b3){if(_0x52b7b3){return _0x405f85[_0x43e7('0x26')](_0x51f4d7)['json'](_0x52b7b3);}};}function respondWithFilteredResult(_0x2dd5f,_0x40dc8f){return function(_0x3565cf){if(_0x3565cf){var _0xb1fc63=_0x3565cf[_0x43e7('0x28')],_0x5087d7=_0x40dc8f[_0x43e7('0x29')],_0x33a1a5=_0x40dc8f[_0x43e7('0x29')]+_0x40dc8f[_0x43e7('0x2a')],_0x4690a6;if(_0x33a1a5>=_0xb1fc63){_0x33a1a5=_0xb1fc63;_0x4690a6=0xc8;}else{_0x4690a6=0xce;}_0x2dd5f[_0x43e7('0x26')](_0x4690a6);return _0x2dd5f[_0x43e7('0x2b')](_0x43e7('0x2c'),_0x5087d7+'-'+_0x33a1a5+'/'+_0xb1fc63)[_0x43e7('0x2d')](_0x3565cf);}return null;};}function patchUpdates(_0x17df44){return function(_0x19725a){try{jsonpatch[_0x43e7('0x2e')](_0x19725a,_0x17df44,!![]);}catch(_0x208706){return BPromise['reject'](_0x208706);}return _0x19725a[_0x43e7('0x2f')]();};}function saveUpdates(_0x44f6b0,_0x3b8f78){return function(_0x183c81){if(_0x183c81){return _0x183c81[_0x43e7('0x30')](_0x44f6b0)['then'](function(_0x1eba65){return _0x1eba65;});}return null;};}function removeEntity(_0x49b83d,_0x30d47e){return function(_0x3f280d){if(_0x3f280d){return _0x3f280d['destroy']()['then'](function(){var _0x5e203f=_0x3f280d[_0x43e7('0x31')]({'plain':!![]});var _0xbe6e28=_0x43e7('0x32');return db[_0x43e7('0x33')][_0x43e7('0x34')]({'where':{'type':_0xbe6e28,'resourceId':_0x5e203f['id']}})[_0x43e7('0x1a')](function(){return _0x3f280d;});})['then'](function(){_0x49b83d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x59e5b2,_0x4e8e86){return function(_0x564f0e){if(!_0x564f0e){_0x59e5b2['sendStatus'](0x194);}return _0x564f0e;};}function handleError(_0x14d888,_0x49cda6){_0x49cda6=_0x49cda6||0x1f4;return function(_0x2b4bfd){logger[_0x43e7('0x20')](_0x2b4bfd[_0x43e7('0x35')]);if(_0x2b4bfd[_0x43e7('0x36')]){delete _0x2b4bfd[_0x43e7('0x36')];}_0x14d888[_0x43e7('0x26')](_0x49cda6)[_0x43e7('0x37')](_0x2b4bfd);};}exports['index']=function(_0x5332d9,_0x5d84f4){var _0xfa0474={},_0xfe70e9={},_0x199ff6={'count':0x0,'rows':[]};var _0x16cdba=_[_0x43e7('0x38')](db[_0x43e7('0x39')][_0x43e7('0x3a')],function(_0x2ffd43){return{'name':_0x2ffd43['fieldName'],'type':_0x2ffd43[_0x43e7('0x3b')][_0x43e7('0x3c')]};});_0xfe70e9['model']=_[_0x43e7('0x38')](_0x16cdba,'name');_0xfe70e9[_0x43e7('0x3d')]=_[_0x43e7('0x3e')](_0x5332d9[_0x43e7('0x3d')]);_0xfe70e9[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0xfe70e9[_0x43e7('0x41')],_0xfe70e9['query']);_0xfa0474['attributes']=_[_0x43e7('0x40')](_0xfe70e9[_0x43e7('0x41')],qs[_0x43e7('0x42')](_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x42')]));_0xfa0474['attributes']=_0xfa0474[_0x43e7('0x43')][_0x43e7('0x44')]?_0xfa0474['attributes']:_0xfe70e9[_0x43e7('0x41')];if(!_0x5332d9['query'][_0x43e7('0x45')]('nolimit')){_0xfa0474[_0x43e7('0x2a')]=qs[_0x43e7('0x2a')](_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x2a')]);_0xfa0474['offset']=qs['offset'](_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x29')]);}_0xfa0474[_0x43e7('0x46')]=qs[_0x43e7('0x47')](_0x5332d9['query']['sort']);_0xfa0474['where']=qs[_0x43e7('0x3f')](_['pick'](_0x5332d9[_0x43e7('0x3d')],_0xfe70e9['filters']),_0x16cdba);if(_0x5332d9['query'][_0x43e7('0x48')]){_0xfa0474['where']=_[_0x43e7('0x49')](_0xfa0474[_0x43e7('0x4a')],{'$or':_[_0x43e7('0x38')](_0x16cdba,function(_0x99b9e1){if(_0x99b9e1['type']!==_0x43e7('0x4b')){var _0x2b9046={};_0x2b9046[_0x99b9e1[_0x43e7('0x36')]]={'$like':'%'+_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x48')]+'%'};return _0x2b9046;}})});}_0xfa0474=_[_0x43e7('0x49')]({},_0xfa0474,_0x5332d9['options']);var _0x4930a2={'where':_0xfa0474[_0x43e7('0x4a')]};return db[_0x43e7('0x39')][_0x43e7('0x28')](_0x4930a2)['then'](function(_0x5c1c18){_0x199ff6['count']=_0x5c1c18;if(_0x5332d9[_0x43e7('0x3d')][_0x43e7('0x4c')]){_0xfa0474['include']=[{'all':!![]}];}return db[_0x43e7('0x39')][_0x43e7('0x4d')](_0xfa0474);})[_0x43e7('0x1a')](function(_0x560329){_0x199ff6['rows']=_0x560329;return _0x199ff6;})['then'](respondWithFilteredResult(_0x5d84f4,_0xfa0474))['catch'](handleError(_0x5d84f4,null));};exports[_0x43e7('0x4e')]=function(_0xe955fc,_0x52fea5){var _0x23e7cb={'raw':![],'where':{'id':_0xe955fc[_0x43e7('0x4f')]['id']}},_0x82d32f={};_0x82d32f[_0x43e7('0x41')]=_['keys'](db[_0x43e7('0x39')]['rawAttributes']);_0x82d32f['query']=_[_0x43e7('0x3e')](_0xe955fc[_0x43e7('0x3d')]);_0x82d32f[_0x43e7('0x3f')]=_[_0x43e7('0x40')](_0x82d32f[_0x43e7('0x41')],_0x82d32f[_0x43e7('0x3d')]);_0x23e7cb[_0x43e7('0x43')]=_[_0x43e7('0x40')](_0x82d32f[_0x43e7('0x41')],qs[_0x43e7('0x42')](_0xe955fc['query'][_0x43e7('0x42')]));_0x23e7cb[_0x43e7('0x43')]=_0x23e7cb['attributes'][_0x43e7('0x44')]?_0x23e7cb['attributes']:_0x82d32f[_0x43e7('0x41')];if(_0xe955fc[_0x43e7('0x3d')][_0x43e7('0x4c')]){_0x23e7cb[_0x43e7('0x50')]=[{'all':!![]}];}_0x23e7cb=_[_0x43e7('0x49')]({},_0x23e7cb,_0xe955fc['options']);return db['VoiceContext'][_0x43e7('0x51')](_0x23e7cb)[_0x43e7('0x1a')](handleEntityNotFound(_0x52fea5,null))[_0x43e7('0x1a')](respondWithResult(_0x52fea5,null))[_0x43e7('0x24')](handleError(_0x52fea5,null));};exports[_0x43e7('0x52')]=function(_0x25bb44,_0xa47464,_0x44f8a0){var _0x26d86c;return db[_0x43e7('0x39')][_0x43e7('0x52')](_0x25bb44['body'],{'raw':!![]})[_0x43e7('0x1a')](function(_0x2da2f3){_0x26d86c=_0x2da2f3;return db['VoiceContext'][_0x43e7('0x4d')]({'raw':!![]});})[_0x43e7('0x1a')](function(_0x2d0052){var _0x558d54=fs['readFileSync'](path[_0x43e7('0x53')](config[_0x43e7('0x54')],'server/files/templates/context.ejs'),_0x43e7('0x55'));var _0x54506d=ejs['render'](_0x558d54,{'contexts':_0x2d0052||[]});fs[_0x43e7('0x56')](_0x43e7('0x57'),_0x54506d);})[_0x43e7('0x1a')](function(){return respondWithRpcPromise(_0x43e7('0x58'),_0x43e7('0x52'),{'module':'chan_sip.so'});})[_0x43e7('0x1a')](function(){var _0xdb9fbe=_0x25bb44['user'][_0x43e7('0x31')]({'plain':!![]});if(!_0xdb9fbe)throw new Error(_0x43e7('0x59'));if(_0xdb9fbe[_0x43e7('0x5a')]==='user'){var _0x5a4c95=_0x26d86c['get']({'plain':!![]});return db[_0x43e7('0x5b')][_0x43e7('0x51')]({'where':{'name':_0x43e7('0x32'),'userProfileId':_0xdb9fbe[_0x43e7('0x5c')]},'raw':!![]})['then'](function(_0x5a50fc){if(_0x5a50fc&&_0x5a50fc[_0x43e7('0x5d')]===0x0){return db[_0x43e7('0x33')][_0x43e7('0x52')]({'name':_0x5a4c95[_0x43e7('0x36')],'resourceId':_0x5a4c95['id'],'type':_0x5a50fc['name'],'sectionId':_0x5a50fc['id']},{})[_0x43e7('0x1a')](function(){return _0x26d86c;});}else{return _0x26d86c;}})[_0x43e7('0x24')](function(_0x23595c){logger[_0x43e7('0x20')](_0x43e7('0x5e'),_0x23595c);throw _0x23595c;});}return _0x26d86c;})[_0x43e7('0x1a')](respondWithResult(_0xa47464,0xc9))[_0x43e7('0x24')](handleError(_0xa47464,null));};exports[_0x43e7('0x30')]=function(_0x406155,_0x381208,_0x252f00){var _0x57fdfe;return db['VoiceContext'][_0x43e7('0x51')]({'where':{'id':_0x406155['params']['id']}})['then'](handleEntityNotFound(_0x381208,null))['then'](saveUpdates(_0x406155[_0x43e7('0x5f')],null))[_0x43e7('0x1a')](function(_0x5d7b37){if(_0x5d7b37){_0x57fdfe=_0x5d7b37;return db[_0x43e7('0x39')][_0x43e7('0x4d')]({'raw':!![]});}})[_0x43e7('0x1a')](function(_0x537a53){var _0x2b7406=fs[_0x43e7('0x60')](path[_0x43e7('0x53')](config[_0x43e7('0x54')],_0x43e7('0x61')),_0x43e7('0x55'));var _0x1e02fa=ejs['render'](_0x2b7406,{'contexts':_0x537a53||[]});fs[_0x43e7('0x56')](_0x43e7('0x57'),_0x1e02fa);})[_0x43e7('0x1a')](function(){return respondWithRpcPromise('Reload','update',{'module':_0x43e7('0x62')});})['then'](function(){return _0x57fdfe;})['then'](respondWithResult(_0x381208,null))[_0x43e7('0x24')](handleError(_0x381208,null));};exports[_0x43e7('0x34')]=function(_0x5b5833,_0x88c7f,_0x28b21d){var _0x1e2fed;return db[_0x43e7('0x39')][_0x43e7('0x51')]({'where':{'id':_0x5b5833[_0x43e7('0x4f')]['id']}})[_0x43e7('0x1a')](handleEntityNotFound(_0x88c7f,null))['then'](removeEntity(_0x88c7f,null))[_0x43e7('0x1a')](function(){return db[_0x43e7('0x39')]['findAll']({'raw':!![]});})[_0x43e7('0x1a')](function(_0x5c2c5f){var _0x26ee52=fs[_0x43e7('0x60')](path[_0x43e7('0x53')](config[_0x43e7('0x54')],'server/files/templates/context.ejs'),_0x43e7('0x55'));var _0x2646c2=ejs[_0x43e7('0x63')](_0x26ee52,{'contexts':_0x5c2c5f});fs['writeFileSync'](_0x43e7('0x57'),_0x2646c2);return respondWithRpcPromise(_0x43e7('0x58'),_0x43e7('0x34'),{'module':_0x43e7('0x62')});})[_0x43e7('0x24')](handleError(_0x88c7f,null));}; \ No newline at end of file +var _0x7217=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','destroy','then','get','Contexts','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceContext','includeAll','include','findAll','show','params','length','options','find','create','body','join','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','role','user','UserProfileSection','userProfileId','autoAssociation','readFileSync','root','server/files/templates/context.ejs','utf8','chan_sip.so','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x14a862,_0x2b559d){var _0x245eb5=function(_0x6e014c){while(--_0x6e014c){_0x14a862['push'](_0x14a862['shift']());}};_0x245eb5(++_0x2b559d);}(_0x7217,0x19e));var _0x7721=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x7217[_0x4dbaad];return _0x226c72;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];var jayson=require(_0x7721('0x1b'));var client=jayson['client'][_0x7721('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x199930,_0x57ff6d,_0x109900){if(_0x109900){var _0x30da54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30da54[_0x7721('0x1d')](_0x57ff6d)){return _0x199930;}else{throw new db[(_0x7721('0x1e'))]['ValidationError'](_0x7721('0x1f'));}}else{return _0x199930;}}function respondWithRpcPromise(_0x25b1c0,_0x534f1b,_0x4e199a,_0x4b183e){return new BPromise(function(_0x5ed54,_0x25a628){var _0x3cc909=_0x4b183e||client;return _0x3cc909[_0x7721('0x20')](_0x25b1c0,_0x4e199a)['then'](function(_0x20f669){logger['info'](_0x7721('0x21'),_0x534f1b,'request\x20sent');logger[_0x7721('0x22')](_0x7721('0x23'),_0x534f1b,_0x7721('0x24'),JSON[_0x7721('0x25')](_0x20f669));if(_0x20f669[_0x7721('0x26')]){if(_0x20f669[_0x7721('0x26')][_0x7721('0x27')]===0x1f4){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669[_0x7721('0x26')]['message']);return _0x25a628(_0x20f669[_0x7721('0x26')][_0x7721('0x28')]);}logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669['error'][_0x7721('0x28')]);return _0x5ed54(_0x20f669['error'][_0x7721('0x28')]);}else{logger[_0x7721('0x29')](_0x7721('0x21'),_0x534f1b,_0x7721('0x24'));_0x5ed54(_0x20f669[_0x7721('0x2a')][_0x7721('0x28')]);}})[_0x7721('0x2b')](function(_0x5b4d74){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x5b4d74);_0x25a628(_0x5b4d74);});});}function respondWithStatusCode(_0x125564,_0x1f67c7){_0x1f67c7=_0x1f67c7||0xcc;return function(_0x40d550){if(_0x40d550){return _0x125564[_0x7721('0x2c')](_0x1f67c7);}return _0x125564[_0x7721('0x2d')](_0x1f67c7)[_0x7721('0x2e')]();};}function respondWithResult(_0x40f367,_0x52316e){_0x52316e=_0x52316e||0xc8;return function(_0x258ddf){if(_0x258ddf){return _0x40f367['status'](_0x52316e)['json'](_0x258ddf);}};}function respondWithFilteredResult(_0x315202,_0x343c19){return function(_0x53c904){if(_0x53c904){var _0x158d98=_0x53c904[_0x7721('0x2f')],_0x1ea4d=_0x343c19['offset'],_0x37b9f0=_0x343c19[_0x7721('0x30')]+_0x343c19[_0x7721('0x31')],_0xd7d703;if(_0x37b9f0>=_0x158d98){_0x37b9f0=_0x158d98;_0xd7d703=0xc8;}else{_0xd7d703=0xce;}_0x315202['status'](_0xd7d703);return _0x315202['set'](_0x7721('0x32'),_0x1ea4d+'-'+_0x37b9f0+'/'+_0x158d98)[_0x7721('0x33')](_0x53c904);}return null;};}function patchUpdates(_0x48f329){return function(_0x46f772){try{jsonpatch[_0x7721('0x34')](_0x46f772,_0x48f329,!![]);}catch(_0x382821){return BPromise['reject'](_0x382821);}return _0x46f772[_0x7721('0x35')]();};}function saveUpdates(_0x1ff31b,_0x1492d4){return function(_0x3f15e2){if(_0x3f15e2){return _0x3f15e2[_0x7721('0x36')](_0x1ff31b)['then'](function(_0x195ffb){return _0x195ffb;});}return null;};}function removeEntity(_0x3e4e56,_0xb2386d){return function(_0x5c5b33){if(_0x5c5b33){return _0x5c5b33[_0x7721('0x37')]()[_0x7721('0x38')](function(){var _0x498654=_0x5c5b33[_0x7721('0x39')]({'plain':!![]});var _0x5ce026=_0x7721('0x3a');return db[_0x7721('0x3b')][_0x7721('0x37')]({'where':{'type':_0x5ce026,'resourceId':_0x498654['id']}})[_0x7721('0x38')](function(){return _0x5c5b33;});})[_0x7721('0x38')](function(){_0x3e4e56[_0x7721('0x2d')](0xcc)[_0x7721('0x2e')]();});}};}function handleEntityNotFound(_0x15545a,_0x25bdd9){return function(_0x3a2eb7){if(!_0x3a2eb7){_0x15545a[_0x7721('0x2c')](0x194);}return _0x3a2eb7;};}function handleError(_0x5c806d,_0xd1df68){_0xd1df68=_0xd1df68||0x1f4;return function(_0x5e6663){logger[_0x7721('0x26')](_0x5e6663[_0x7721('0x3c')]);if(_0x5e6663[_0x7721('0x3d')]){delete _0x5e6663[_0x7721('0x3d')];}_0x5c806d[_0x7721('0x2d')](_0xd1df68)[_0x7721('0x3e')](_0x5e6663);};}exports['index']=function(_0x557c34,_0x4cadef){var _0x539560={},_0x18001c={},_0x1b3f8d={'count':0x0,'rows':[]};var _0x1acc72=_[_0x7721('0x3f')](db['VoiceContext'][_0x7721('0x40')],function(_0x4cf659){return{'name':_0x4cf659[_0x7721('0x41')],'type':_0x4cf659[_0x7721('0x42')]['key']};});_0x18001c[_0x7721('0x43')]=_[_0x7721('0x3f')](_0x1acc72,'name');_0x18001c['query']=_[_0x7721('0x44')](_0x557c34[_0x7721('0x45')]);_0x18001c[_0x7721('0x46')]=_[_0x7721('0x47')](_0x18001c['model'],_0x18001c[_0x7721('0x45')]);_0x539560[_0x7721('0x48')]=_[_0x7721('0x47')](_0x18001c[_0x7721('0x43')],qs[_0x7721('0x49')](_0x557c34['query'][_0x7721('0x49')]));_0x539560['attributes']=_0x539560[_0x7721('0x48')]['length']?_0x539560[_0x7721('0x48')]:_0x18001c[_0x7721('0x43')];if(!_0x557c34[_0x7721('0x45')]['hasOwnProperty'](_0x7721('0x4a'))){_0x539560[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x557c34['query'][_0x7721('0x31')]);_0x539560[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x557c34[_0x7721('0x45')][_0x7721('0x30')]);}_0x539560[_0x7721('0x4b')]=qs[_0x7721('0x4c')](_0x557c34['query']['sort']);_0x539560[_0x7721('0x4d')]=qs[_0x7721('0x46')](_[_0x7721('0x4e')](_0x557c34[_0x7721('0x45')],_0x18001c[_0x7721('0x46')]),_0x1acc72);if(_0x557c34[_0x7721('0x45')][_0x7721('0x4f')]){_0x539560[_0x7721('0x4d')]=_[_0x7721('0x50')](_0x539560[_0x7721('0x4d')],{'$or':_['map'](_0x1acc72,function(_0x578867){if(_0x578867[_0x7721('0x42')]!==_0x7721('0x51')){var _0x151f69={};_0x151f69[_0x578867[_0x7721('0x3d')]]={'$like':'%'+_0x557c34['query'][_0x7721('0x4f')]+'%'};return _0x151f69;}})});}_0x539560=_[_0x7721('0x50')]({},_0x539560,_0x557c34['options']);var _0x330fac={'where':_0x539560['where']};return db[_0x7721('0x52')]['count'](_0x330fac)[_0x7721('0x38')](function(_0x196be4){_0x1b3f8d[_0x7721('0x2f')]=_0x196be4;if(_0x557c34['query'][_0x7721('0x53')]){_0x539560[_0x7721('0x54')]=[{'all':!![]}];}return db['VoiceContext'][_0x7721('0x55')](_0x539560);})[_0x7721('0x38')](function(_0xf88e8c){_0x1b3f8d['rows']=_0xf88e8c;return _0x1b3f8d;})[_0x7721('0x38')](respondWithFilteredResult(_0x4cadef,_0x539560))['catch'](handleError(_0x4cadef,null));};exports[_0x7721('0x56')]=function(_0x310549,_0x4738ef){var _0x443503={'raw':![],'where':{'id':_0x310549[_0x7721('0x57')]['id']}},_0x1c95d8={};_0x1c95d8[_0x7721('0x43')]=_[_0x7721('0x44')](db[_0x7721('0x52')][_0x7721('0x40')]);_0x1c95d8[_0x7721('0x45')]=_[_0x7721('0x44')](_0x310549[_0x7721('0x45')]);_0x1c95d8[_0x7721('0x46')]=_[_0x7721('0x47')](_0x1c95d8['model'],_0x1c95d8[_0x7721('0x45')]);_0x443503[_0x7721('0x48')]=_[_0x7721('0x47')](_0x1c95d8[_0x7721('0x43')],qs[_0x7721('0x49')](_0x310549[_0x7721('0x45')][_0x7721('0x49')]));_0x443503['attributes']=_0x443503[_0x7721('0x48')][_0x7721('0x58')]?_0x443503[_0x7721('0x48')]:_0x1c95d8[_0x7721('0x43')];if(_0x310549[_0x7721('0x45')][_0x7721('0x53')]){_0x443503[_0x7721('0x54')]=[{'all':!![]}];}_0x443503=_[_0x7721('0x50')]({},_0x443503,_0x310549[_0x7721('0x59')]);return db[_0x7721('0x52')][_0x7721('0x5a')](_0x443503)['then'](handleEntityNotFound(_0x4738ef,null))[_0x7721('0x38')](respondWithResult(_0x4738ef,null))[_0x7721('0x2b')](handleError(_0x4738ef,null));};exports[_0x7721('0x5b')]=function(_0x2ee3c0,_0x15ed3b,_0x3e7918){var _0x41644f;return db[_0x7721('0x52')][_0x7721('0x5b')](_0x2ee3c0[_0x7721('0x5c')],{'raw':!![]})[_0x7721('0x38')](function(_0x2e5c28){_0x41644f=_0x2e5c28;return db[_0x7721('0x52')][_0x7721('0x55')]({'raw':!![]});})[_0x7721('0x38')](function(_0x577f47){var _0x50e9e9=fs['readFileSync'](path[_0x7721('0x5d')](config['root'],'server/files/templates/context.ejs'),'utf8');var _0x5d7036=ejs[_0x7721('0x5e')](_0x50e9e9,{'contexts':_0x577f47||[]});fs[_0x7721('0x5f')](_0x7721('0x60'),_0x5d7036);})['then'](function(){return respondWithRpcPromise(_0x7721('0x61'),'create',{'module':'chan_sip.so'});})['then'](function(){var _0x24d1dc=_0x2ee3c0['user']['get']({'plain':!![]});if(!_0x24d1dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24d1dc[_0x7721('0x62')]===_0x7721('0x63')){var _0x1ff090=_0x41644f['get']({'plain':!![]});return db[_0x7721('0x64')][_0x7721('0x5a')]({'where':{'name':_0x7721('0x3a'),'userProfileId':_0x24d1dc[_0x7721('0x65')]},'raw':!![]})[_0x7721('0x38')](function(_0x16e80b){if(_0x16e80b&&_0x16e80b[_0x7721('0x66')]===0x0){return db[_0x7721('0x3b')][_0x7721('0x5b')]({'name':_0x1ff090[_0x7721('0x3d')],'resourceId':_0x1ff090['id'],'type':_0x16e80b[_0x7721('0x3d')],'sectionId':_0x16e80b['id']},{})[_0x7721('0x38')](function(){return _0x41644f;});}else{return _0x41644f;}})[_0x7721('0x2b')](function(_0x211d27){logger[_0x7721('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x211d27);throw _0x211d27;});}return _0x41644f;})[_0x7721('0x38')](respondWithResult(_0x15ed3b,0xc9))[_0x7721('0x2b')](handleError(_0x15ed3b,null));};exports[_0x7721('0x36')]=function(_0xb6db23,_0x542e30,_0x103009){var _0x104f05;return db['VoiceContext'][_0x7721('0x5a')]({'where':{'id':_0xb6db23['params']['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x542e30,null))[_0x7721('0x38')](saveUpdates(_0xb6db23[_0x7721('0x5c')],null))[_0x7721('0x38')](function(_0x3d2b7d){if(_0x3d2b7d){_0x104f05=_0x3d2b7d;return db[_0x7721('0x52')][_0x7721('0x55')]({'raw':!![]});}})[_0x7721('0x38')](function(_0x4727b0){var _0x57759a=fs[_0x7721('0x67')](path[_0x7721('0x5d')](config[_0x7721('0x68')],_0x7721('0x69')),_0x7721('0x6a'));var _0x3ed425=ejs[_0x7721('0x5e')](_0x57759a,{'contexts':_0x4727b0||[]});fs['writeFileSync'](_0x7721('0x60'),_0x3ed425);})[_0x7721('0x38')](function(){return respondWithRpcPromise('Reload',_0x7721('0x36'),{'module':'chan_sip.so'});})[_0x7721('0x38')](function(){return _0x104f05;})[_0x7721('0x38')](respondWithResult(_0x542e30,null))[_0x7721('0x2b')](handleError(_0x542e30,null));};exports[_0x7721('0x37')]=function(_0x1e2436,_0x2bab14,_0x258c57){var _0x5dca04;return db[_0x7721('0x52')][_0x7721('0x5a')]({'where':{'id':_0x1e2436[_0x7721('0x57')]['id']}})['then'](handleEntityNotFound(_0x2bab14,null))['then'](removeEntity(_0x2bab14,null))['then'](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0x7721('0x38')](function(_0x2645dd){var _0x580473=fs[_0x7721('0x67')](path[_0x7721('0x5d')](config[_0x7721('0x68')],_0x7721('0x69')),'utf8');var _0x275b25=ejs[_0x7721('0x5e')](_0x580473,{'contexts':_0x2645dd});fs[_0x7721('0x5f')](_0x7721('0x60'),_0x275b25);return respondWithRpcPromise(_0x7721('0x61'),'destroy',{'module':_0x7721('0x6b')});})[_0x7721('0x2b')](handleError(_0x2bab14,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 4cb7f5e..f876c91 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 _0x9957=['exports','define','VoiceContext','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceContext.attributes'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','VoiceContext','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceContext.attributes'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 404cba2..b7a28a1 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 _0x54ce=['debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','VoiceContext,\x20%s,\x20%s','request\x20sent'];(function(_0x31991b,_0xaf75d2){var _0x307304=function(_0x2f36c5){while(--_0x2f36c5){_0x31991b['push'](_0x31991b['shift']());}};_0x307304(++_0xaf75d2);}(_0x54ce,0xe1));var _0xe54c=function(_0x1bf2a9,_0x1d3b16){_0x1bf2a9=_0x1bf2a9-0x0;var _0x1a379f=_0x54ce[_0x1bf2a9];return _0x1a379f;};'use strict';var _=require(_0xe54c('0x0'));var util=require('util');var moment=require(_0xe54c('0x1'));var BPromise=require(_0xe54c('0x2'));var rs=require(_0xe54c('0x3'));var fs=require('fs');var Redis=require(_0xe54c('0x4'));var db=require(_0xe54c('0x5'))['db'];var utils=require(_0xe54c('0x6'));var logger=require(_0xe54c('0x7'))(_0xe54c('0x8'));var config=require(_0xe54c('0x9'));var jayson=require(_0xe54c('0xa'));var client=jayson['client'][_0xe54c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe2b07,_0x5e1a43,_0x417a3d){return new BPromise(function(_0x1cdb3c,_0x27e913){return client['request'](_0xe2b07,_0x417a3d)[_0xe54c('0xc')](function(_0x256632){logger['info'](_0xe54c('0xd'),_0x5e1a43,_0xe54c('0xe'));logger[_0xe54c('0xf')](_0xe54c('0x10'),_0x5e1a43,_0xe54c('0xe'),JSON[_0xe54c('0x11')](_0x256632));if(_0x256632[_0xe54c('0x12')]){if(_0x256632['error'][_0xe54c('0x13')]===0x1f4){logger[_0xe54c('0x12')](_0xe54c('0xd'),_0x5e1a43,_0x256632['error'][_0xe54c('0x14')]);return _0x27e913(_0x256632[_0xe54c('0x12')]['message']);}logger[_0xe54c('0x12')](_0xe54c('0xd'),_0x5e1a43,_0x256632[_0xe54c('0x12')][_0xe54c('0x14')]);return _0x1cdb3c(_0x256632[_0xe54c('0x12')][_0xe54c('0x14')]);}else{logger[_0xe54c('0x15')](_0xe54c('0xd'),_0x5e1a43,_0xe54c('0xe'));_0x1cdb3c(_0x256632[_0xe54c('0x16')][_0xe54c('0x14')]);}})[_0xe54c('0x17')](function(_0xf784de){logger['error'](_0xe54c('0xd'),_0x5e1a43,_0xf784de);_0x27e913(_0xf784de);});});} \ No newline at end of file +var _0xa3c9=['../../config/utils','../../config/logger','rpc','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x58791f,_0x368df3){var _0x1255d6=function(_0x1bc5cf){while(--_0x1bc5cf){_0x58791f['push'](_0x58791f['shift']());}};_0x1255d6(++_0x368df3);}(_0xa3c9,0x198));var _0x9a3c=function(_0x1c7137,_0x4c7c26){_0x1c7137=_0x1c7137-0x0;var _0xeb4432=_0xa3c9[_0x1c7137];return _0xeb4432;};'use strict';var _=require('lodash');var util=require(_0x9a3c('0x0'));var moment=require(_0x9a3c('0x1'));var BPromise=require(_0x9a3c('0x2'));var rs=require(_0x9a3c('0x3'));var fs=require('fs');var Redis=require(_0x9a3c('0x4'));var db=require(_0x9a3c('0x5'))['db'];var utils=require(_0x9a3c('0x6'));var logger=require(_0x9a3c('0x7'))(_0x9a3c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9a3c('0x9')][_0x9a3c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19455b,_0x221e28,_0x4755f0){return new BPromise(function(_0x3f6be1,_0x538654){return client[_0x9a3c('0xb')](_0x19455b,_0x4755f0)[_0x9a3c('0xc')](function(_0x2297e8){logger[_0x9a3c('0xd')](_0x9a3c('0xe'),_0x221e28,_0x9a3c('0xf'));logger['debug'](_0x9a3c('0x10'),_0x221e28,_0x9a3c('0xf'),JSON[_0x9a3c('0x11')](_0x2297e8));if(_0x2297e8[_0x9a3c('0x12')]){if(_0x2297e8[_0x9a3c('0x12')][_0x9a3c('0x13')]===0x1f4){logger[_0x9a3c('0x12')](_0x9a3c('0xe'),_0x221e28,_0x2297e8[_0x9a3c('0x12')][_0x9a3c('0x14')]);return _0x538654(_0x2297e8['error'][_0x9a3c('0x14')]);}logger[_0x9a3c('0x12')](_0x9a3c('0xe'),_0x221e28,_0x2297e8[_0x9a3c('0x12')][_0x9a3c('0x14')]);return _0x3f6be1(_0x2297e8['error'][_0x9a3c('0x14')]);}else{logger[_0x9a3c('0xd')](_0x9a3c('0xe'),_0x221e28,_0x9a3c('0xf'));_0x3f6be1(_0x2297e8[_0x9a3c('0x15')]['message']);}})[_0x9a3c('0x16')](function(_0x168364){logger[_0x9a3c('0x12')]('VoiceContext,\x20%s,\x20%s',_0x221e28,_0x168364);_0x538654(_0x168364);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index b69ac23..df65896 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 _0x91c9=['put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get','/describe','/:id','show','create'];(function(_0x1d745e,_0x32578b){var _0x3d7dba=function(_0x37ff85){while(--_0x37ff85){_0x1d745e['push'](_0x1d745e['shift']());}};_0x3d7dba(++_0x32578b);}(_0x91c9,0x193));var _0x991c=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x91c9[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x991c('0x0'));var util=require(_0x991c('0x1'));var path=require(_0x991c('0x2'));var timeout=require(_0x991c('0x3'));var express=require('express');var router=express[_0x991c('0x4')]();var auth=require(_0x991c('0x5'));var interaction=require(_0x991c('0x6'));var config=require('../../config/environment');var controller=require(_0x991c('0x7'));router['get']('/',auth[_0x991c('0x8')](),controller[_0x991c('0x9')]);router[_0x991c('0xa')](_0x991c('0xb'),auth[_0x991c('0x8')](),controller['describe']);router[_0x991c('0xa')](_0x991c('0xc'),auth[_0x991c('0x8')](),controller[_0x991c('0xd')]);router['post']('/',auth[_0x991c('0x8')](),controller[_0x991c('0xe')]);router[_0x991c('0xf')](_0x991c('0xc'),auth['isAuthenticated'](),controller[_0x991c('0x10')]);router['delete'](_0x991c('0xc'),auth[_0x991c('0x8')](),controller[_0x991c('0x11')]);module[_0x991c('0x12')]=router; \ No newline at end of file +var _0xa6f4=['/describe','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../config/environment','./voiceDialReport.controller','get'];(function(_0x39fd11,_0x5d7883){var _0x302799=function(_0x4a0615){while(--_0x4a0615){_0x39fd11['push'](_0x39fd11['shift']());}};_0x302799(++_0x5d7883);}(_0xa6f4,0x70));var _0x4a6f=function(_0x1c0158,_0x4c5bd1){_0x1c0158=_0x1c0158-0x0;var _0x2f88e2=_0xa6f4[_0x1c0158];return _0x2f88e2;};'use strict';var multer=require(_0x4a6f('0x0'));var util=require(_0x4a6f('0x1'));var path=require('path');var timeout=require(_0x4a6f('0x2'));var express=require(_0x4a6f('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4a6f('0x4'));var controller=require(_0x4a6f('0x5'));router[_0x4a6f('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4a6f('0x6')](_0x4a6f('0x7'),auth[_0x4a6f('0x8')](),controller['describe']);router[_0x4a6f('0x6')](_0x4a6f('0x9'),auth[_0x4a6f('0x8')](),controller[_0x4a6f('0xa')]);router[_0x4a6f('0xb')]('/',auth[_0x4a6f('0x8')](),controller['create']);router[_0x4a6f('0xc')](_0x4a6f('0x9'),auth[_0x4a6f('0x8')](),controller[_0x4a6f('0xd')]);router[_0x4a6f('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x4a6f('0xf')]);module[_0x4a6f('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 384c7e7..dbe5bfc 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 _0x64ea=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x64ea,0x18b));var _0xa64e=function(_0x9aaca8,_0x222c1a){_0x9aaca8=_0x9aaca8-0x0;var _0x1a77bd=_0x64ea[_0x9aaca8];return _0x1a77bd;};'use strict';var Sequelize=require('sequelize');module[_0xa64e('0x0')]={'privilege':{'type':Sequelize[_0xa64e('0x1')]},'channel':{'type':Sequelize[_0xa64e('0x1')]},'channelstate':{'type':Sequelize[_0xa64e('0x2')]},'channelstatedesc':{'type':Sequelize[_0xa64e('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa64e('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xa64e('0x1')]},'accountcode':{'type':Sequelize[_0xa64e('0x1')]},'context':{'type':Sequelize[_0xa64e('0x1')]},'exten':{'type':Sequelize[_0xa64e('0x1')]},'priority':{'type':Sequelize[_0xa64e('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xa64e('0x1')]},'destchannel':{'type':Sequelize[_0xa64e('0x1')]},'destchannelstate':{'type':Sequelize[_0xa64e('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xa64e('0x1')]},'destcalleridnum':{'type':Sequelize[_0xa64e('0x1')]},'destcalleridname':{'type':Sequelize[_0xa64e('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xa64e('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa64e('0x1')]},'destlanguage':{'type':Sequelize[_0xa64e('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xa64e('0x1')]},'destexten':{'type':Sequelize[_0xa64e('0x1')]},'destpriority':{'type':Sequelize[_0xa64e('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0xa64e('0x1')]},'dialstring':{'type':Sequelize[_0xa64e('0x1')]},'dialstatus':{'type':Sequelize[_0xa64e('0x1')]},'starttime':{'type':Sequelize[_0xa64e('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xa64e('0x3')]},'lastevent':{'type':Sequelize[_0xa64e('0x1')],'comment':_0xa64e('0x4')},'routeId':{'type':Sequelize[_0xa64e('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xa64e('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xcc56=['STRING','INTEGER','DATE','sequelize','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xcc56,0x80));var _0x6cc5=function(_0x4e9b5f,_0xbfb45b){_0x4e9b5f=_0x4e9b5f-0x0;var _0x23a694=_0xcc56[_0x4e9b5f];return _0x23a694;};'use strict';var Sequelize=require(_0x6cc5('0x0'));module[_0x6cc5('0x1')]={'privilege':{'type':Sequelize[_0x6cc5('0x2')]},'channel':{'type':Sequelize[_0x6cc5('0x2')]},'channelstate':{'type':Sequelize[_0x6cc5('0x3')]},'channelstatedesc':{'type':Sequelize[_0x6cc5('0x2')]},'calleridnum':{'type':Sequelize[_0x6cc5('0x2')]},'calleridname':{'type':Sequelize[_0x6cc5('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x6cc5('0x2')]},'language':{'type':Sequelize[_0x6cc5('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6cc5('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6cc5('0x3')]},'uniqueid':{'type':Sequelize[_0x6cc5('0x2')]},'linkedid':{'type':Sequelize[_0x6cc5('0x2')]},'destchannel':{'type':Sequelize[_0x6cc5('0x2')]},'destchannelstate':{'type':Sequelize[_0x6cc5('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6cc5('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x6cc5('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x6cc5('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x6cc5('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x6cc5('0x2')]},'destcontext':{'type':Sequelize[_0x6cc5('0x2')]},'destexten':{'type':Sequelize[_0x6cc5('0x2')]},'destpriority':{'type':Sequelize[_0x6cc5('0x3')]},'destuniqueid':{'type':Sequelize[_0x6cc5('0x2')]},'destlinkedid':{'type':Sequelize[_0x6cc5('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x6cc5('0x2')]},'starttime':{'type':Sequelize[_0x6cc5('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x6cc5('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x6cc5('0x3')]},'duration':{'type':Sequelize[_0x6cc5('0x3')]},'holdtime':{'type':Sequelize[_0x6cc5('0x3')]},'billableseconds':{'type':Sequelize[_0x6cc5('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 46264a1..4170ff2 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 _0xff2a=['update','find','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','VoiceDialReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','create','body','catch'];(function(_0x4b2693,_0x29f874){var _0x1957d7=function(_0x57a294){while(--_0x57a294){_0x4b2693['push'](_0x4b2693['shift']());}};_0x1957d7(++_0x29f874);}(_0xff2a,0x93));var _0xaff2=function(_0x2de753,_0x4a544d){_0x2de753=_0x2de753-0x0;var _0x8e70a5=_0xff2a[_0x2de753];return _0x8e70a5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaff2('0x0'));var rimraf=require(_0xaff2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaff2('0x2'));var rp=require(_0xaff2('0x3'));var moment=require('moment');var BPromise=require(_0xaff2('0x4'));var Mustache=require('mustache');var util=require(_0xaff2('0x5'));var path=require(_0xaff2('0x6'));var sox=require('sox');var csv=require(_0xaff2('0x7'));var ejs=require(_0xaff2('0x8'));var fs=require('fs');var _=require(_0xaff2('0x9'));var squel=require(_0xaff2('0xa'));var crypto=require(_0xaff2('0xb'));var jsforce=require(_0xaff2('0xc'));var deskjs=require(_0xaff2('0xd'));var toCsv=require(_0xaff2('0x7'));var querystring=require(_0xaff2('0xe'));var Papa=require(_0xaff2('0xf'));var Redis=require('ioredis');var authService=require(_0xaff2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaff2('0x11'));var logger=require(_0xaff2('0x12'))(_0xaff2('0x13'));var utils=require(_0xaff2('0x14'));var config=require(_0xaff2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7edf53,_0x175f2c){_0x175f2c=_0x175f2c||0xcc;return function(_0x18e9bf){if(_0x18e9bf){return _0x7edf53['sendStatus'](_0x175f2c);}return _0x7edf53[_0xaff2('0x16')](_0x175f2c)[_0xaff2('0x17')]();};}function respondWithResult(_0x5db6a7,_0x3388d0){_0x3388d0=_0x3388d0||0xc8;return function(_0x56b2d7){if(_0x56b2d7){return _0x5db6a7[_0xaff2('0x16')](_0x3388d0)['json'](_0x56b2d7);}};}function respondWithFilteredResult(_0x4e358b,_0x32ec13){return function(_0x5186d4){if(_0x5186d4){var _0x423844=_0x5186d4[_0xaff2('0x18')],_0x19029b=_0x32ec13['offset'],_0x3d4d8c=_0x32ec13[_0xaff2('0x19')]+_0x32ec13[_0xaff2('0x1a')],_0x155e64;if(_0x3d4d8c>=_0x423844){_0x3d4d8c=_0x423844;_0x155e64=0xc8;}else{_0x155e64=0xce;}_0x4e358b[_0xaff2('0x16')](_0x155e64);return _0x4e358b[_0xaff2('0x1b')](_0xaff2('0x1c'),_0x19029b+'-'+_0x3d4d8c+'/'+_0x423844)[_0xaff2('0x1d')](_0x5186d4);}return null;};}function patchUpdates(_0x227720){return function(_0x4e097d){try{jsonpatch[_0xaff2('0x1e')](_0x4e097d,_0x227720,!![]);}catch(_0x585432){return BPromise[_0xaff2('0x1f')](_0x585432);}return _0x4e097d['save']();};}function saveUpdates(_0x528b15,_0x353ed0){return function(_0x4e1d46){if(_0x4e1d46){return _0x4e1d46['update'](_0x528b15)[_0xaff2('0x20')](function(_0xa635aa){return _0xa635aa;});}return null;};}function removeEntity(_0x1259cd,_0x2d1be8){return function(_0x3e2e81){if(_0x3e2e81){return _0x3e2e81[_0xaff2('0x21')]()['then'](function(){_0x1259cd['status'](0xcc)[_0xaff2('0x17')]();});}};}function handleEntityNotFound(_0x211cd7,_0x545e23){return function(_0x50d111){if(!_0x50d111){_0x211cd7[_0xaff2('0x22')](0x194);}return _0x50d111;};}function handleError(_0xf357ae,_0x2582de){_0x2582de=_0x2582de||0x1f4;return function(_0x537038){logger[_0xaff2('0x23')](_0x537038[_0xaff2('0x24')]);if(_0x537038[_0xaff2('0x25')]){delete _0x537038[_0xaff2('0x25')];}_0xf357ae[_0xaff2('0x16')](_0x2582de)[_0xaff2('0x26')](_0x537038);};}exports[_0xaff2('0x27')]=function(_0x3dc2c8,_0x173365){var _0x29ad98={},_0x195164={},_0x24147e={'count':0x0,'rows':[]};var _0x44d04a=_['map'](db[_0xaff2('0x28')][_0xaff2('0x29')],function(_0x58e572){return{'name':_0x58e572[_0xaff2('0x2a')],'type':_0x58e572[_0xaff2('0x2b')]['key']};});_0x195164[_0xaff2('0x2c')]=_[_0xaff2('0x2d')](_0x44d04a,_0xaff2('0x25'));_0x195164[_0xaff2('0x2e')]=_[_0xaff2('0x2f')](_0x3dc2c8[_0xaff2('0x2e')]);_0x195164[_0xaff2('0x30')]=_[_0xaff2('0x31')](_0x195164[_0xaff2('0x2c')],_0x195164[_0xaff2('0x2e')]);_0x29ad98['attributes']=_['intersection'](_0x195164['model'],qs[_0xaff2('0x32')](_0x3dc2c8[_0xaff2('0x2e')]['fields']));_0x29ad98['attributes']=_0x29ad98[_0xaff2('0x33')][_0xaff2('0x34')]?_0x29ad98[_0xaff2('0x33')]:_0x195164[_0xaff2('0x2c')];if(!_0x3dc2c8[_0xaff2('0x2e')][_0xaff2('0x35')]('nolimit')){_0x29ad98[_0xaff2('0x1a')]=qs[_0xaff2('0x1a')](_0x3dc2c8[_0xaff2('0x2e')][_0xaff2('0x1a')]);_0x29ad98[_0xaff2('0x19')]=qs[_0xaff2('0x19')](_0x3dc2c8[_0xaff2('0x2e')][_0xaff2('0x19')]);}_0x29ad98[_0xaff2('0x36')]=qs['sort'](_0x3dc2c8['query'][_0xaff2('0x37')]);_0x29ad98[_0xaff2('0x38')]=qs[_0xaff2('0x30')](_[_0xaff2('0x39')](_0x3dc2c8[_0xaff2('0x2e')],_0x195164[_0xaff2('0x30')]),_0x44d04a);if(_0x3dc2c8[_0xaff2('0x2e')][_0xaff2('0x3a')]){_0x29ad98['where']=_[_0xaff2('0x3b')](_0x29ad98['where'],{'$or':_[_0xaff2('0x2d')](_0x44d04a,function(_0x55c15f){if(_0x55c15f['type']!=='VIRTUAL'){var _0x3e4713={};_0x3e4713[_0x55c15f['name']]={'$like':'%'+_0x3dc2c8[_0xaff2('0x2e')]['filter']+'%'};return _0x3e4713;}})});}_0x29ad98=_[_0xaff2('0x3b')]({},_0x29ad98,_0x3dc2c8[_0xaff2('0x3c')]);var _0x49f378={'where':_0x29ad98[_0xaff2('0x38')]};return db[_0xaff2('0x28')]['count'](_0x49f378)[_0xaff2('0x20')](function(_0xcf0c6d){_0x24147e[_0xaff2('0x18')]=_0xcf0c6d;if(_0x3dc2c8[_0xaff2('0x2e')][_0xaff2('0x3d')]){_0x29ad98[_0xaff2('0x3e')]=[{'all':!![]}];}return db[_0xaff2('0x28')][_0xaff2('0x3f')](_0x29ad98);})[_0xaff2('0x20')](function(_0x303b93){_0x24147e[_0xaff2('0x40')]=_0x303b93;return _0x24147e;})[_0xaff2('0x20')](respondWithFilteredResult(_0x173365,_0x29ad98))['catch'](handleError(_0x173365,null));};exports['show']=function(_0x25f0c3,_0x36de6d){var _0x4a1d6f={'raw':!![],'where':{'id':_0x25f0c3[_0xaff2('0x41')]['id']}},_0x21fe4f={};_0x21fe4f[_0xaff2('0x2c')]=_[_0xaff2('0x2f')](db['VoiceDialReport']['rawAttributes']);_0x21fe4f[_0xaff2('0x2e')]=_[_0xaff2('0x2f')](_0x25f0c3[_0xaff2('0x2e')]);_0x21fe4f[_0xaff2('0x30')]=_['intersection'](_0x21fe4f['model'],_0x21fe4f[_0xaff2('0x2e')]);_0x4a1d6f['attributes']=_[_0xaff2('0x31')](_0x21fe4f[_0xaff2('0x2c')],qs[_0xaff2('0x32')](_0x25f0c3['query'][_0xaff2('0x32')]));_0x4a1d6f[_0xaff2('0x33')]=_0x4a1d6f[_0xaff2('0x33')]['length']?_0x4a1d6f[_0xaff2('0x33')]:_0x21fe4f[_0xaff2('0x2c')];if(_0x25f0c3[_0xaff2('0x2e')][_0xaff2('0x3d')]){_0x4a1d6f['include']=[{'all':!![]}];}_0x4a1d6f=_['merge']({},_0x4a1d6f,_0x25f0c3[_0xaff2('0x3c')]);return db[_0xaff2('0x28')]['find'](_0x4a1d6f)[_0xaff2('0x20')](handleEntityNotFound(_0x36de6d,null))['then'](respondWithResult(_0x36de6d,null))['catch'](handleError(_0x36de6d,null));};exports[_0xaff2('0x42')]=function(_0x5dd771,_0x55eae1){return db[_0xaff2('0x28')][_0xaff2('0x42')](_0x5dd771[_0xaff2('0x43')],{})[_0xaff2('0x20')](respondWithResult(_0x55eae1,0xc9))[_0xaff2('0x44')](handleError(_0x55eae1,null));};exports[_0xaff2('0x45')]=function(_0x4cdcf7,_0x4d1fb3){if(_0x4cdcf7[_0xaff2('0x43')]['id']){delete _0x4cdcf7[_0xaff2('0x43')]['id'];}return db[_0xaff2('0x28')][_0xaff2('0x46')]({'where':{'id':_0x4cdcf7['params']['id']}})[_0xaff2('0x20')](handleEntityNotFound(_0x4d1fb3,null))[_0xaff2('0x20')](saveUpdates(_0x4cdcf7[_0xaff2('0x43')],null))[_0xaff2('0x20')](respondWithResult(_0x4d1fb3,null))['catch'](handleError(_0x4d1fb3,null));};exports[_0xaff2('0x21')]=function(_0x3a76f9,_0x40f4c3){return db[_0xaff2('0x28')][_0xaff2('0x46')]({'where':{'id':_0x3a76f9[_0xaff2('0x41')]['id']}})[_0xaff2('0x20')](handleEntityNotFound(_0x40f4c3,null))['then'](removeEntity(_0x40f4c3,null))[_0xaff2('0x44')](handleError(_0x40f4c3,null));};exports[_0xaff2('0x47')]=function(_0x738157,_0x1f1f39){return db[_0xaff2('0x28')][_0xaff2('0x47')]()['then'](respondWithResult(_0x1f1f39,null))[_0xaff2('0x44')](handleError(_0x1f1f39,null));}; \ No newline at end of file +var _0x649b=['VIRTUAL','VoiceDialReport','includeAll','include','findAll','catch','show','options','create','body','find','params','describe','rimraf','zip-dir','moment','mustache','util','path','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge'];(function(_0x5e6b84,_0x4c8f00){var _0x4b1b7e=function(_0x9fef3d){while(--_0x9fef3d){_0x5e6b84['push'](_0x5e6b84['shift']());}};_0x4b1b7e(++_0x4c8f00);}(_0x649b,0x166));var _0xb649=function(_0x4075bc,_0x3d0d69){_0x4075bc=_0x4075bc-0x0;var _0x54e45f=_0x649b[_0x4075bc];return _0x54e45f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb649('0x0'));var zipdir=require(_0xb649('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb649('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb649('0x3'));var util=require(_0xb649('0x4'));var path=require(_0xb649('0x5'));var sox=require('sox');var csv=require(_0xb649('0x6'));var ejs=require(_0xb649('0x7'));var fs=require('fs');var _=require(_0xb649('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb649('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xb649('0x6'));var querystring=require(_0xb649('0xa'));var Papa=require(_0xb649('0xb'));var Redis=require(_0xb649('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xb649('0xd'));var as=require(_0xb649('0xe'));var hardwareService=require(_0xb649('0xf'));var logger=require(_0xb649('0x10'))('api');var utils=require(_0xb649('0x11'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47aff2,_0x18264e){_0x18264e=_0x18264e||0xcc;return function(_0x196132){if(_0x196132){return _0x47aff2[_0xb649('0x12')](_0x18264e);}return _0x47aff2[_0xb649('0x13')](_0x18264e)['end']();};}function respondWithResult(_0xf89f44,_0x25d4d5){_0x25d4d5=_0x25d4d5||0xc8;return function(_0x41c953){if(_0x41c953){return _0xf89f44['status'](_0x25d4d5)[_0xb649('0x14')](_0x41c953);}};}function respondWithFilteredResult(_0x3a4eb0,_0x297255){return function(_0x2cc196){if(_0x2cc196){var _0x2f0135=_0x2cc196[_0xb649('0x15')],_0x51083d=_0x297255['offset'],_0x121e43=_0x297255[_0xb649('0x16')]+_0x297255[_0xb649('0x17')],_0x4da88c;if(_0x121e43>=_0x2f0135){_0x121e43=_0x2f0135;_0x4da88c=0xc8;}else{_0x4da88c=0xce;}_0x3a4eb0[_0xb649('0x13')](_0x4da88c);return _0x3a4eb0[_0xb649('0x18')](_0xb649('0x19'),_0x51083d+'-'+_0x121e43+'/'+_0x2f0135)['json'](_0x2cc196);}return null;};}function patchUpdates(_0x57b094){return function(_0x3c28e6){try{jsonpatch[_0xb649('0x1a')](_0x3c28e6,_0x57b094,!![]);}catch(_0x15c49a){return BPromise[_0xb649('0x1b')](_0x15c49a);}return _0x3c28e6[_0xb649('0x1c')]();};}function saveUpdates(_0xe87d92,_0x2ef81e){return function(_0x1098da){if(_0x1098da){return _0x1098da[_0xb649('0x1d')](_0xe87d92)[_0xb649('0x1e')](function(_0x51edeb){return _0x51edeb;});}return null;};}function removeEntity(_0x58d9fb,_0x2a05eb){return function(_0x249b6a){if(_0x249b6a){return _0x249b6a[_0xb649('0x1f')]()[_0xb649('0x1e')](function(){_0x58d9fb['status'](0xcc)[_0xb649('0x20')]();});}};}function handleEntityNotFound(_0x3fcc13,_0x56c7d3){return function(_0x2b80f9){if(!_0x2b80f9){_0x3fcc13[_0xb649('0x12')](0x194);}return _0x2b80f9;};}function handleError(_0x457bc6,_0x3e9aa4){_0x3e9aa4=_0x3e9aa4||0x1f4;return function(_0x51025d){logger[_0xb649('0x21')](_0x51025d['stack']);if(_0x51025d['name']){delete _0x51025d[_0xb649('0x22')];}_0x457bc6[_0xb649('0x13')](_0x3e9aa4)[_0xb649('0x23')](_0x51025d);};}exports[_0xb649('0x24')]=function(_0x54ceab,_0x2f95fb){var _0x16b263={},_0x1017ee={},_0x148db3={'count':0x0,'rows':[]};var _0x4185c6=_[_0xb649('0x25')](db['VoiceDialReport'][_0xb649('0x26')],function(_0xa0d564){return{'name':_0xa0d564[_0xb649('0x27')],'type':_0xa0d564[_0xb649('0x28')]['key']};});_0x1017ee[_0xb649('0x29')]=_['map'](_0x4185c6,_0xb649('0x22'));_0x1017ee['query']=_[_0xb649('0x2a')](_0x54ceab[_0xb649('0x2b')]);_0x1017ee[_0xb649('0x2c')]=_[_0xb649('0x2d')](_0x1017ee[_0xb649('0x29')],_0x1017ee[_0xb649('0x2b')]);_0x16b263[_0xb649('0x2e')]=_[_0xb649('0x2d')](_0x1017ee[_0xb649('0x29')],qs[_0xb649('0x2f')](_0x54ceab[_0xb649('0x2b')][_0xb649('0x2f')]));_0x16b263[_0xb649('0x2e')]=_0x16b263['attributes'][_0xb649('0x30')]?_0x16b263['attributes']:_0x1017ee[_0xb649('0x29')];if(!_0x54ceab[_0xb649('0x2b')][_0xb649('0x31')]('nolimit')){_0x16b263[_0xb649('0x17')]=qs[_0xb649('0x17')](_0x54ceab['query'][_0xb649('0x17')]);_0x16b263[_0xb649('0x16')]=qs[_0xb649('0x16')](_0x54ceab[_0xb649('0x2b')][_0xb649('0x16')]);}_0x16b263[_0xb649('0x32')]=qs['sort'](_0x54ceab[_0xb649('0x2b')][_0xb649('0x33')]);_0x16b263['where']=qs[_0xb649('0x2c')](_[_0xb649('0x34')](_0x54ceab[_0xb649('0x2b')],_0x1017ee['filters']),_0x4185c6);if(_0x54ceab[_0xb649('0x2b')][_0xb649('0x35')]){_0x16b263[_0xb649('0x36')]=_[_0xb649('0x37')](_0x16b263[_0xb649('0x36')],{'$or':_[_0xb649('0x25')](_0x4185c6,function(_0x211390){if(_0x211390[_0xb649('0x28')]!==_0xb649('0x38')){var _0x2d6b91={};_0x2d6b91[_0x211390[_0xb649('0x22')]]={'$like':'%'+_0x54ceab[_0xb649('0x2b')][_0xb649('0x35')]+'%'};return _0x2d6b91;}})});}_0x16b263=_[_0xb649('0x37')]({},_0x16b263,_0x54ceab['options']);var _0x34b41e={'where':_0x16b263[_0xb649('0x36')]};return db[_0xb649('0x39')]['count'](_0x34b41e)[_0xb649('0x1e')](function(_0x1673a3){_0x148db3['count']=_0x1673a3;if(_0x54ceab[_0xb649('0x2b')][_0xb649('0x3a')]){_0x16b263[_0xb649('0x3b')]=[{'all':!![]}];}return db[_0xb649('0x39')][_0xb649('0x3c')](_0x16b263);})['then'](function(_0x491812){_0x148db3['rows']=_0x491812;return _0x148db3;})[_0xb649('0x1e')](respondWithFilteredResult(_0x2f95fb,_0x16b263))[_0xb649('0x3d')](handleError(_0x2f95fb,null));};exports[_0xb649('0x3e')]=function(_0x17285a,_0x4ee127){var _0x3d689e={'raw':!![],'where':{'id':_0x17285a['params']['id']}},_0x2e1294={};_0x2e1294[_0xb649('0x29')]=_[_0xb649('0x2a')](db[_0xb649('0x39')][_0xb649('0x26')]);_0x2e1294[_0xb649('0x2b')]=_[_0xb649('0x2a')](_0x17285a[_0xb649('0x2b')]);_0x2e1294[_0xb649('0x2c')]=_[_0xb649('0x2d')](_0x2e1294['model'],_0x2e1294[_0xb649('0x2b')]);_0x3d689e['attributes']=_[_0xb649('0x2d')](_0x2e1294[_0xb649('0x29')],qs['fields'](_0x17285a[_0xb649('0x2b')][_0xb649('0x2f')]));_0x3d689e[_0xb649('0x2e')]=_0x3d689e[_0xb649('0x2e')][_0xb649('0x30')]?_0x3d689e[_0xb649('0x2e')]:_0x2e1294[_0xb649('0x29')];if(_0x17285a['query'][_0xb649('0x3a')]){_0x3d689e[_0xb649('0x3b')]=[{'all':!![]}];}_0x3d689e=_[_0xb649('0x37')]({},_0x3d689e,_0x17285a[_0xb649('0x3f')]);return db[_0xb649('0x39')]['find'](_0x3d689e)[_0xb649('0x1e')](handleEntityNotFound(_0x4ee127,null))['then'](respondWithResult(_0x4ee127,null))['catch'](handleError(_0x4ee127,null));};exports[_0xb649('0x40')]=function(_0x40d7a3,_0x1a5ec6){return db[_0xb649('0x39')][_0xb649('0x40')](_0x40d7a3['body'],{})[_0xb649('0x1e')](respondWithResult(_0x1a5ec6,0xc9))[_0xb649('0x3d')](handleError(_0x1a5ec6,null));};exports[_0xb649('0x1d')]=function(_0x3441bd,_0x4ba61c){if(_0x3441bd['body']['id']){delete _0x3441bd[_0xb649('0x41')]['id'];}return db['VoiceDialReport'][_0xb649('0x42')]({'where':{'id':_0x3441bd[_0xb649('0x43')]['id']}})[_0xb649('0x1e')](handleEntityNotFound(_0x4ba61c,null))[_0xb649('0x1e')](saveUpdates(_0x3441bd['body'],null))[_0xb649('0x1e')](respondWithResult(_0x4ba61c,null))['catch'](handleError(_0x4ba61c,null));};exports['destroy']=function(_0x4cf6aa,_0x37d9ca){return db[_0xb649('0x39')][_0xb649('0x42')]({'where':{'id':_0x4cf6aa['params']['id']}})[_0xb649('0x1e')](handleEntityNotFound(_0x37d9ca,null))[_0xb649('0x1e')](removeEntity(_0x37d9ca,null))[_0xb649('0x3d')](handleError(_0x37d9ca,null));};exports[_0xb649('0x44')]=function(_0x2f1190,_0xde1206){return db[_0xb649('0x39')][_0xb649('0x44')]()[_0xb649('0x1e')](respondWithResult(_0xde1206,null))[_0xb649('0x3d')](handleError(_0xde1206,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index f39619b..573a260 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 _0xe4e2=['report_dial','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','VoiceDialReport'];(function(_0x5dbd4b,_0x2fb8fe){var _0x5d2723=function(_0x373d4a){while(--_0x373d4a){_0x5dbd4b['push'](_0x5dbd4b['shift']());}};_0x5d2723(++_0x2fb8fe);}(_0xe4e2,0xdf));var _0x2e4e=function(_0x35731c,_0x5ab1d1){_0x35731c=_0x35731c-0x0;var _0x2f2957=_0xe4e2[_0x35731c];return _0x2f2957;};'use strict';var _=require('lodash');var util=require(_0x2e4e('0x0'));var logger=require(_0x2e4e('0x1'))(_0x2e4e('0x2'));var moment=require(_0x2e4e('0x3'));var BPromise=require(_0x2e4e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e4e('0x5'));var rimraf=require(_0x2e4e('0x6'));var config=require(_0x2e4e('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0x2e4e('0x8')]=function(_0x46f575,_0x3712c1){return _0x46f575[_0x2e4e('0x9')](_0x2e4e('0xa'),attributes,{'tableName':_0x2e4e('0xb'),'paranoid':![],'indexes':[{'fields':[_0x2e4e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8dd6=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','VoiceDialReport','lodash'];(function(_0x2126df,_0x275e37){var _0x358c5c=function(_0x506bba){while(--_0x506bba){_0x2126df['push'](_0x2126df['shift']());}};_0x358c5c(++_0x275e37);}(_0x8dd6,0x11d));var _0x68dd=function(_0x54cc62,_0x1404c2){_0x54cc62=_0x54cc62-0x0;var _0x136795=_0x8dd6[_0x54cc62];return _0x136795;};'use strict';var _=require(_0x68dd('0x0'));var util=require(_0x68dd('0x1'));var logger=require(_0x68dd('0x2'))(_0x68dd('0x3'));var moment=require('moment');var BPromise=require(_0x68dd('0x4'));var rp=require(_0x68dd('0x5'));var fs=require('fs');var path=require(_0x68dd('0x6'));var rimraf=require(_0x68dd('0x7'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0x68dd('0x8')]=function(_0x155b96,_0x124faa){return _0x155b96[_0x68dd('0x9')](_0x68dd('0xa'),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 8818a27..27d9fbf 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 _0x5455=['debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateVoiceDialReport','options','raw','VoiceDialReport','update','body','attributes','limit','UpdateVoiceDialReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent'];(function(_0x197bcb,_0x14ff35){var _0x3d471e=function(_0x336977){while(--_0x336977){_0x197bcb['push'](_0x197bcb['shift']());}};_0x3d471e(++_0x14ff35);}(_0x5455,0x197));var _0x5545=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x5455[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x5545('0x0'));var moment=require(_0x5545('0x1'));var BPromise=require(_0x5545('0x2'));var rs=require(_0x5545('0x3'));var fs=require('fs');var Redis=require(_0x5545('0x4'));var db=require(_0x5545('0x5'))['db'];var utils=require(_0x5545('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5545('0x7'));var jayson=require(_0x5545('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ea57f,_0x5d69d3,_0x5c2476){return new BPromise(function(_0x9cbb0d,_0x36f3b9){return client['request'](_0x2ea57f,_0x5c2476)[_0x5545('0x9')](function(_0xbf37f){logger[_0x5545('0xa')](_0x5545('0xb'),_0x5d69d3,_0x5545('0xc'));logger[_0x5545('0xd')](_0x5545('0xe'),_0x5d69d3,_0x5545('0xc'),JSON[_0x5545('0xf')](_0xbf37f));if(_0xbf37f['error']){if(_0xbf37f['error'][_0x5545('0x10')]===0x1f4){logger[_0x5545('0x11')](_0x5545('0xb'),_0x5d69d3,_0xbf37f[_0x5545('0x11')]['message']);return _0x36f3b9(_0xbf37f[_0x5545('0x11')][_0x5545('0x12')]);}logger['error'](_0x5545('0xb'),_0x5d69d3,_0xbf37f[_0x5545('0x11')][_0x5545('0x12')]);return _0x9cbb0d(_0xbf37f[_0x5545('0x11')]['message']);}else{logger[_0x5545('0xa')](_0x5545('0xb'),_0x5d69d3,_0x5545('0xc'));_0x9cbb0d(_0xbf37f[_0x5545('0x13')][_0x5545('0x12')]);}})[_0x5545('0x14')](function(_0xf9256c){logger[_0x5545('0x11')](_0x5545('0xb'),_0x5d69d3,_0xf9256c);_0x36f3b9(_0xf9256c);});});}exports[_0x5545('0x15')]=function(_0x3a012e){var _0x373f92=this;return new Promise(function(_0x5f0e6f,_0x3a288d){return db['VoiceDialReport']['create'](_0x3a012e['body'],{'raw':_0x3a012e['options']?_0x3a012e[_0x5545('0x16')][_0x5545('0x17')]===undefined?!![]:![]:!![]})[_0x5545('0x9')](function(_0x58d53d){logger[_0x5545('0xa')](_0x5545('0x15'),_0x3a012e);logger[_0x5545('0xd')](_0x5545('0x15'),_0x3a012e,JSON['stringify'](_0x58d53d));_0x5f0e6f(_0x58d53d);})[_0x5545('0x14')](function(_0x2c2d9e){logger['error']('CreateVoiceDialReport',_0x2c2d9e[_0x5545('0x12')],_0x3a012e);_0x3a288d(_0x373f92[_0x5545('0x11')](0x1f4,_0x2c2d9e[_0x5545('0x12')]));});});};exports['UpdateVoiceDialReport']=function(_0xf3e8f4){var _0x458791=this;return new Promise(function(_0x3ae9f1,_0x4a2420){return db[_0x5545('0x18')][_0x5545('0x19')](_0xf3e8f4[_0x5545('0x1a')],{'raw':_0xf3e8f4['options']?_0xf3e8f4['options'][_0x5545('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf3e8f4[_0x5545('0x16')]?_0xf3e8f4[_0x5545('0x16')]['where']||null:null,'attributes':_0xf3e8f4[_0x5545('0x16')]?_0xf3e8f4['options'][_0x5545('0x1b')]||null:null,'limit':_0xf3e8f4[_0x5545('0x16')]?_0xf3e8f4[_0x5545('0x16')][_0x5545('0x1c')]||null:null})['then'](function(_0x198667){logger[_0x5545('0xa')](_0x5545('0x1d'),_0xf3e8f4);logger[_0x5545('0xd')](_0x5545('0x1d'),_0xf3e8f4,JSON['stringify'](_0x198667));_0x3ae9f1(_0x198667);})[_0x5545('0x14')](function(_0x196be4){logger['error'](_0x5545('0x1d'),_0x196be4[_0x5545('0x12')],_0xf3e8f4);_0x4a2420(_0x458791[_0x5545('0x11')](0x1f4,_0x196be4[_0x5545('0x12')]));});});}; \ No newline at end of file +var _0x1c4d=['VoiceDialReport','create','body','options','raw','update','where','attributes','UpdateVoiceDialReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','result','catch','CreateVoiceDialReport'];(function(_0x122224,_0x3d9354){var _0x3aac81=function(_0x318e71){while(--_0x318e71){_0x122224['push'](_0x122224['shift']());}};_0x3aac81(++_0x3d9354);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x20f6f8,_0xf7ee88){_0x20f6f8=_0x20f6f8-0x0;var _0x41c024=_0x1c4d[_0x20f6f8];return _0x41c024;};'use strict';var _=require('lodash');var util=require(_0xd1c4('0x0'));var moment=require(_0xd1c4('0x1'));var BPromise=require(_0xd1c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1c4('0x3'));var db=require(_0xd1c4('0x4'))['db'];var utils=require(_0xd1c4('0x5'));var logger=require(_0xd1c4('0x6'))('rpc');var config=require(_0xd1c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd1c4('0x8')][_0xd1c4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41cc76,_0x35cbf5,_0x429dc6){return new BPromise(function(_0xc9284c,_0x49c2dc){return client[_0xd1c4('0xa')](_0x41cc76,_0x429dc6)[_0xd1c4('0xb')](function(_0x5443f3){logger[_0xd1c4('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x35cbf5,_0xd1c4('0xd'));logger[_0xd1c4('0xe')](_0xd1c4('0xf'),_0x35cbf5,_0xd1c4('0xd'),JSON[_0xd1c4('0x10')](_0x5443f3));if(_0x5443f3[_0xd1c4('0x11')]){if(_0x5443f3[_0xd1c4('0x11')][_0xd1c4('0x12')]===0x1f4){logger[_0xd1c4('0x11')](_0xd1c4('0x13'),_0x35cbf5,_0x5443f3[_0xd1c4('0x11')]['message']);return _0x49c2dc(_0x5443f3[_0xd1c4('0x11')][_0xd1c4('0x14')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x35cbf5,_0x5443f3[_0xd1c4('0x11')]['message']);return _0xc9284c(_0x5443f3[_0xd1c4('0x11')]['message']);}else{logger['info'](_0xd1c4('0x13'),_0x35cbf5,'request\x20sent');_0xc9284c(_0x5443f3[_0xd1c4('0x15')][_0xd1c4('0x14')]);}})[_0xd1c4('0x16')](function(_0x4af352){logger[_0xd1c4('0x11')](_0xd1c4('0x13'),_0x35cbf5,_0x4af352);_0x49c2dc(_0x4af352);});});}exports[_0xd1c4('0x17')]=function(_0x41c496){var _0xe25f12=this;return new Promise(function(_0x39e0bb,_0x51a465){return db[_0xd1c4('0x18')][_0xd1c4('0x19')](_0x41c496[_0xd1c4('0x1a')],{'raw':_0x41c496[_0xd1c4('0x1b')]?_0x41c496['options'][_0xd1c4('0x1c')]===undefined?!![]:![]:!![]})[_0xd1c4('0xb')](function(_0x2dbdbb){logger[_0xd1c4('0xc')](_0xd1c4('0x17'),_0x41c496);logger[_0xd1c4('0xe')]('CreateVoiceDialReport',_0x41c496,JSON[_0xd1c4('0x10')](_0x2dbdbb));_0x39e0bb(_0x2dbdbb);})[_0xd1c4('0x16')](function(_0x49f1db){logger[_0xd1c4('0x11')]('CreateVoiceDialReport',_0x49f1db[_0xd1c4('0x14')],_0x41c496);_0x51a465(_0xe25f12[_0xd1c4('0x11')](0x1f4,_0x49f1db[_0xd1c4('0x14')]));});});};exports['UpdateVoiceDialReport']=function(_0x291e66){var _0x1dfc3f=this;return new Promise(function(_0x32c43b,_0x2d187f){return db[_0xd1c4('0x18')][_0xd1c4('0x1d')](_0x291e66[_0xd1c4('0x1a')],{'raw':_0x291e66[_0xd1c4('0x1b')]?_0x291e66[_0xd1c4('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x291e66[_0xd1c4('0x1b')]?_0x291e66[_0xd1c4('0x1b')][_0xd1c4('0x1e')]||null:null,'attributes':_0x291e66[_0xd1c4('0x1b')]?_0x291e66[_0xd1c4('0x1b')][_0xd1c4('0x1f')]||null:null,'limit':_0x291e66['options']?_0x291e66[_0xd1c4('0x1b')]['limit']||null:null})[_0xd1c4('0xb')](function(_0x3b9fd4){logger[_0xd1c4('0xc')](_0xd1c4('0x20'),_0x291e66);logger[_0xd1c4('0xe')]('UpdateVoiceDialReport',_0x291e66,JSON[_0xd1c4('0x10')](_0x3b9fd4));_0x32c43b(_0x3b9fd4);})[_0xd1c4('0x16')](function(_0x5960a4){logger[_0xd1c4('0x11')](_0xd1c4('0x20'),_0x5960a4[_0xd1c4('0x14')],_0x291e66);_0x2d187f(_0x1dfc3f[_0xd1c4('0x11')](0x1f4,_0x5960a4['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 6f3cdb8..988c454 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 _0x2c43=['update','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','create','post','put'];(function(_0xab3673,_0x1cf9c8){var _0xd71bc0=function(_0x3b63b7){while(--_0x3b63b7){_0xab3673['push'](_0xab3673['shift']());}};_0xd71bc0(++_0x1cf9c8);}(_0x2c43,0xfa));var _0x32c4=function(_0x406c81,_0x54a7c4){_0x406c81=_0x406c81-0x0;var _0x3fcff6=_0x2c43[_0x406c81];return _0x3fcff6;};'use strict';var multer=require('multer');var util=require(_0x32c4('0x0'));var path=require('path');var timeout=require(_0x32c4('0x1'));var express=require(_0x32c4('0x2'));var router=express[_0x32c4('0x3')]();var auth=require(_0x32c4('0x4'));var interaction=require(_0x32c4('0x5'));var config=require(_0x32c4('0x6'));var controller=require(_0x32c4('0x7'));router[_0x32c4('0x8')]('/',auth[_0x32c4('0x9')](),controller[_0x32c4('0xa')]);router['get'](_0x32c4('0xb'),auth[_0x32c4('0x9')](),controller[_0x32c4('0xc')]);router['post']('/',auth[_0x32c4('0x9')](),controller[_0x32c4('0xd')]);router[_0x32c4('0xe')]('/:id/applications',auth[_0x32c4('0x9')](),controller['addApplications']);router[_0x32c4('0xf')](_0x32c4('0xb'),auth[_0x32c4('0x9')](),controller[_0x32c4('0x10')]);router['delete'](_0x32c4('0xb'),auth[_0x32c4('0x9')](),controller[_0x32c4('0x11')]);module[_0x32c4('0x12')]=router; \ No newline at end of file +var _0xdc3f=['addApplications','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','/:id/applications'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0xdc3f,0xaf));var _0xfdc3=function(_0x2d89eb,_0x4df7d8){_0x2d89eb=_0x2d89eb-0x0;var _0xea6c73=_0xdc3f[_0x2d89eb];return _0xea6c73;};'use strict';var multer=require(_0xfdc3('0x0'));var util=require(_0xfdc3('0x1'));var path=require(_0xfdc3('0x2'));var timeout=require(_0xfdc3('0x3'));var express=require(_0xfdc3('0x4'));var router=express['Router']();var auth=require(_0xfdc3('0x5'));var interaction=require(_0xfdc3('0x6'));var config=require(_0xfdc3('0x7'));var controller=require('./voiceExtension.controller');router[_0xfdc3('0x8')]('/',auth[_0xfdc3('0x9')](),controller[_0xfdc3('0xa')]);router[_0xfdc3('0x8')](_0xfdc3('0xb'),auth['isAuthenticated'](),controller[_0xfdc3('0xc')]);router[_0xfdc3('0xd')]('/',auth[_0xfdc3('0x9')](),controller['create']);router[_0xfdc3('0xd')](_0xfdc3('0xe'),auth['isAuthenticated'](),controller[_0xfdc3('0xf')]);router['put'](_0xfdc3('0xb'),auth[_0xfdc3('0x9')](),controller[_0xfdc3('0x10')]);router[_0xfdc3('0x11')](_0xfdc3('0xb'),auth[_0xfdc3('0x9')](),controller[_0xfdc3('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 e5d92f4..05ef187 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 _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x5b4f0f,_0x18e653){var _0xb1a86=function(_0x236ba8){while(--_0x236ba8){_0x5b4f0f['push'](_0x5b4f0f['shift']());}};_0xb1a86(++_0x18e653);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x555163,_0x4a5f0b){var _0x15816a=function(_0x44188f){while(--_0x44188f){_0x555163['push'](_0x555163['shift']());}};_0x15816a(++_0x4a5f0b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 3aabbeb..f807edb 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 _0x2542=['includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceExtension','rawAttributes','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','create','body','startsWith','exten','role','user','OutboundRoutes','InternalRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','cutdigits','mandatoryDisposition','sequelize','transaction','bulkCreate','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','destroy','then','get','InboundRoutes','outbound','internal','filter','ignore','map','value'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x2542,0x169));var _0x2254=function(_0x593fea,_0x4a6181){_0x593fea=_0x593fea-0x0;var _0x5cdacb=_0x2542[_0x593fea];return _0x5cdacb;};'use strict';var pdf=require(_0x2254('0x0'));var emlformat=require(_0x2254('0x1'));var rimraf=require(_0x2254('0x2'));var zipdir=require(_0x2254('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2254('0x4'));var moment=require('moment');var BPromise=require(_0x2254('0x5'));var Mustache=require(_0x2254('0x6'));var util=require(_0x2254('0x7'));var path=require(_0x2254('0x8'));var sox=require(_0x2254('0x9'));var csv=require('to-csv');var ejs=require(_0x2254('0xa'));var fs=require('fs');var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x10'));var querystring=require(_0x2254('0x11'));var Papa=require(_0x2254('0x12'));var Redis=require(_0x2254('0x13'));var authService=require(_0x2254('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x15'));var hardwareService=require(_0x2254('0x16'));var logger=require(_0x2254('0x17'))(_0x2254('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2254('0x19'))['db'];config[_0x2254('0x1a')]=_[_0x2254('0x1b')](config[_0x2254('0x1a')],{'host':_0x2254('0x1c'),'port':0x18eb});var socket=require(_0x2254('0x1d'))(new Redis(config['redis']));require(_0x2254('0x1e'))[_0x2254('0x1f')](socket);function respondWithStatusCode(_0x504749,_0x2f4de){_0x2f4de=_0x2f4de||0xcc;return function(_0x1e582d){if(_0x1e582d){return _0x504749[_0x2254('0x20')](_0x2f4de);}return _0x504749[_0x2254('0x21')](_0x2f4de)[_0x2254('0x22')]();};}function respondWithResult(_0xbc5548,_0x50f137){_0x50f137=_0x50f137||0xc8;return function(_0x18baf4){if(_0x18baf4){return _0xbc5548['status'](_0x50f137)[_0x2254('0x23')](_0x18baf4);}};}function respondWithFilteredResult(_0x2a2470,_0x170ffa){return function(_0x25f8b2){if(_0x25f8b2){var _0x1ae11e=_0x25f8b2['count'],_0x34f90e=_0x170ffa[_0x2254('0x24')],_0x497724=_0x170ffa[_0x2254('0x24')]+_0x170ffa[_0x2254('0x25')],_0x51b395;if(_0x497724>=_0x1ae11e){_0x497724=_0x1ae11e;_0x51b395=0xc8;}else{_0x51b395=0xce;}_0x2a2470[_0x2254('0x21')](_0x51b395);return _0x2a2470[_0x2254('0x26')](_0x2254('0x27'),_0x34f90e+'-'+_0x497724+'/'+_0x1ae11e)['json'](_0x25f8b2);}return null;};}function patchUpdates(_0x28381e){return function(_0x16148d){try{jsonpatch[_0x2254('0x28')](_0x16148d,_0x28381e,!![]);}catch(_0x576369){return BPromise['reject'](_0x576369);}return _0x16148d['save']();};}function saveUpdates(_0x1e8a98,_0x559af4){return function(_0xf88b56){if(_0xf88b56){return _0xf88b56['update'](_0x1e8a98)['then'](function(_0x4d8faf){return _0x4d8faf;});}return null;};}function removeEntity(_0x540020,_0x5e5edb){return function(_0x4f797d){if(_0x4f797d){return _0x4f797d[_0x2254('0x29')]()[_0x2254('0x2a')](function(){var _0x2f3037=_0x4f797d[_0x2254('0x2b')]({'plain':!![]});var _0x13522d=[{'name':_0x2254('0x2c'),'value':'inbound','ignore':![]},{'name':'OutboundRoutes','value':_0x2254('0x2d'),'ignore':![]},{'name':'InternalRoutes','value':_0x2254('0x2e'),'ignore':![]}];var _0x141dc5=_(_0x13522d)[_0x2254('0x2f')](_0x2254('0x30'))[_0x2254('0x31')]('value')[_0x2254('0x32')]();if(_[_0x2254('0x33')](_0x141dc5,_0x2f3037[_0x2254('0x34')])){return;}var _0x37af8b=_[_0x2254('0x35')](_0x13522d,[_0x2254('0x32'),_0x2f3037[_0x2254('0x34')]])[_0x2254('0x36')];return db[_0x2254('0x37')][_0x2254('0x29')]({'where':{'type':_0x37af8b,'resourceId':_0x2f3037['id']}})[_0x2254('0x2a')](function(){return _0x4f797d;});})[_0x2254('0x2a')](function(){_0x540020[_0x2254('0x21')](0xcc)[_0x2254('0x22')]();});}};}function handleEntityNotFound(_0x4577f4,_0x1b16c8){return function(_0x2c929f){if(!_0x2c929f){_0x4577f4[_0x2254('0x20')](0x194);}return _0x2c929f;};}function handleError(_0x2f32f8,_0x4e3658){_0x4e3658=_0x4e3658||0x1f4;return function(_0xe29526){logger[_0x2254('0x38')](_0xe29526[_0x2254('0x39')]);if(_0xe29526[_0x2254('0x36')]){delete _0xe29526[_0x2254('0x36')];}_0x2f32f8[_0x2254('0x21')](_0x4e3658)[_0x2254('0x3a')](_0xe29526);};}exports[_0x2254('0x3b')]=function(_0x5b84ce,_0x59c6c9){var _0x835a0e={},_0x3aa0bb={},_0x503540={'count':0x0,'rows':[]};var _0x240d4e=_[_0x2254('0x31')](db[_0x2254('0x3c')][_0x2254('0x3d')],function(_0x538e7b){return{'name':_0x538e7b['fieldName'],'type':_0x538e7b[_0x2254('0x34')]['key']};});_0x3aa0bb[_0x2254('0x3e')]=_[_0x2254('0x31')](_0x240d4e,_0x2254('0x36'));_0x3aa0bb[_0x2254('0x3f')]=_[_0x2254('0x40')](_0x5b84ce[_0x2254('0x3f')]);_0x3aa0bb[_0x2254('0x41')]=_['intersection'](_0x3aa0bb[_0x2254('0x3e')],_0x3aa0bb[_0x2254('0x3f')]);_0x835a0e[_0x2254('0x42')]=_[_0x2254('0x43')](_0x3aa0bb[_0x2254('0x3e')],qs[_0x2254('0x44')](_0x5b84ce[_0x2254('0x3f')][_0x2254('0x44')]));_0x835a0e[_0x2254('0x42')]=_0x835a0e[_0x2254('0x42')]['length']?_0x835a0e[_0x2254('0x42')]:_0x3aa0bb[_0x2254('0x3e')];if(!_0x5b84ce[_0x2254('0x3f')][_0x2254('0x45')]('nolimit')){_0x835a0e[_0x2254('0x25')]=qs[_0x2254('0x25')](_0x5b84ce[_0x2254('0x3f')][_0x2254('0x25')]);_0x835a0e[_0x2254('0x24')]=qs[_0x2254('0x24')](_0x5b84ce[_0x2254('0x3f')][_0x2254('0x24')]);}_0x835a0e['order']=qs[_0x2254('0x46')](_0x5b84ce['query'][_0x2254('0x46')]);_0x835a0e[_0x2254('0x47')]=qs[_0x2254('0x41')](_[_0x2254('0x48')](_0x5b84ce[_0x2254('0x3f')],_0x3aa0bb[_0x2254('0x41')]),_0x240d4e);if(_0x5b84ce[_0x2254('0x3f')]['filter']){_0x835a0e[_0x2254('0x47')]=_[_0x2254('0x49')](_0x835a0e[_0x2254('0x47')],{'$or':_[_0x2254('0x31')](_0x240d4e,function(_0x40d4da){if(_0x40d4da['type']!==_0x2254('0x4a')){var _0x1dec43={};_0x1dec43[_0x40d4da[_0x2254('0x36')]]={'$like':'%'+_0x5b84ce[_0x2254('0x3f')][_0x2254('0x2f')]+'%'};return _0x1dec43;}})});}_0x835a0e=_['merge']({},_0x835a0e,_0x5b84ce[_0x2254('0x4b')]);var _0x47c933={'where':_0x835a0e[_0x2254('0x47')]};return db[_0x2254('0x3c')][_0x2254('0x4c')](_0x47c933)[_0x2254('0x2a')](function(_0x362562){_0x503540[_0x2254('0x4c')]=_0x362562;if(_0x5b84ce[_0x2254('0x3f')][_0x2254('0x4d')]){_0x835a0e[_0x2254('0x4e')]=[{'all':!![]}];}return db[_0x2254('0x3c')][_0x2254('0x4f')](_0x835a0e);})[_0x2254('0x2a')](function(_0x83f44b){_0x503540['rows']=_0x83f44b;return _0x503540;})[_0x2254('0x2a')](respondWithFilteredResult(_0x59c6c9,_0x835a0e))[_0x2254('0x50')](handleError(_0x59c6c9,null));};exports[_0x2254('0x51')]=function(_0x5cc8fc,_0x94f5be){var _0x1c087b={'raw':![],'where':{'id':_0x5cc8fc[_0x2254('0x52')]['id']}},_0x400bb3={};_0x400bb3[_0x2254('0x3e')]=_[_0x2254('0x40')](db[_0x2254('0x3c')][_0x2254('0x3d')]);_0x400bb3[_0x2254('0x3f')]=_['keys'](_0x5cc8fc[_0x2254('0x3f')]);_0x400bb3[_0x2254('0x41')]=_[_0x2254('0x43')](_0x400bb3[_0x2254('0x3e')],_0x400bb3[_0x2254('0x3f')]);_0x1c087b[_0x2254('0x42')]=_[_0x2254('0x43')](_0x400bb3[_0x2254('0x3e')],qs[_0x2254('0x44')](_0x5cc8fc[_0x2254('0x3f')]['fields']));_0x1c087b[_0x2254('0x42')]=_0x1c087b[_0x2254('0x42')]['length']?_0x1c087b[_0x2254('0x42')]:_0x400bb3[_0x2254('0x3e')];if(_0x5cc8fc[_0x2254('0x3f')][_0x2254('0x4d')]){_0x1c087b['include']=[{'all':!![]}];}_0x1c087b=_[_0x2254('0x49')]({},_0x1c087b,_0x5cc8fc[_0x2254('0x4b')]);return db['VoiceExtension'][_0x2254('0x35')](_0x1c087b)[_0x2254('0x2a')](handleEntityNotFound(_0x94f5be,null))[_0x2254('0x2a')](respondWithResult(_0x94f5be,null))[_0x2254('0x50')](handleError(_0x94f5be,null));};exports['destroy']=function(_0x166d56,_0x106282){return db[_0x2254('0x3c')]['find']({'where':{'id':_0x166d56['params']['id']}})[_0x2254('0x2a')](handleEntityNotFound(_0x106282,null))[_0x2254('0x2a')](removeEntity(_0x106282,null))['catch'](handleError(_0x106282,null));};exports[_0x2254('0x53')]=function(_0x5bc29a,_0x4addb0){if(_0x5bc29a[_0x2254('0x54')][_0x2254('0x34')]===_0x2254('0x2d')&&!_[_0x2254('0x55')](_0x5bc29a[_0x2254('0x54')]['exten'],'_')){_0x5bc29a['body'][_0x2254('0x56')]='_'['concat'](_0x5bc29a[_0x2254('0x54')][_0x2254('0x56')]);}return db[_0x2254('0x3c')][_0x2254('0x53')](_0x5bc29a['body'],{'raw':![]})[_0x2254('0x2a')](function(_0x240716){var _0x49fe68=_0x5bc29a['user'][_0x2254('0x2b')]({'plain':!![]});if(!_0x49fe68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x49fe68[_0x2254('0x57')]===_0x2254('0x58')){var _0x2ef4a0=_0x240716[_0x2254('0x2b')]({'plain':!![]});var _0x301a12=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x2254('0x59'),'value':'outbound'},{'name':_0x2254('0x5a'),'value':'internal'}];var _0x4da493=_['find'](_0x301a12,[_0x2254('0x32'),_0x2ef4a0[_0x2254('0x34')]])[_0x2254('0x36')];return db[_0x2254('0x5b')][_0x2254('0x35')]({'where':{'name':_0x4da493,'userProfileId':_0x49fe68[_0x2254('0x5c')]},'raw':!![]})[_0x2254('0x2a')](function(_0x25137c){if(_0x25137c&&_0x25137c[_0x2254('0x5d')]===0x0){return db[_0x2254('0x37')][_0x2254('0x53')]({'name':_0x2ef4a0[_0x2254('0x36')],'resourceId':_0x2ef4a0['id'],'type':_0x25137c[_0x2254('0x36')],'sectionId':_0x25137c['id']},{})[_0x2254('0x2a')](function(){return _0x240716;});}else{return _0x240716;}})[_0x2254('0x50')](function(_0x3b81bb){logger[_0x2254('0x38')](_0x2254('0x5e'),_0x3b81bb);throw _0x3b81bb;});}return _0x240716;})[_0x2254('0x2a')](respondWithResult(_0x4addb0,0xc9))['catch'](handleError(_0x4addb0,null));};exports[_0x2254('0x5f')]=function(_0xae171c,_0x3b1aae){if(_0xae171c[_0x2254('0x54')]['id']){delete _0xae171c['body']['id'];}return db['VoiceExtension'][_0x2254('0x35')]({'where':{'id':_0xae171c[_0x2254('0x52')]['id']}})[_0x2254('0x2a')](handleEntityNotFound(_0x3b1aae,null))[_0x2254('0x2a')](function(_0x1021b2){if(_0x1021b2){return db['VoiceExtension'][_0x2254('0x5f')](_[_0x2254('0x48')](_0xae171c[_0x2254('0x54')],['exten','context',_0x2254('0x60'),'recordingFormat',_0x2254('0x61'),_0x2254('0x62')]),{'where':{'context':_0x1021b2['context'],'exten':_0x1021b2[_0x2254('0x56')]},'individualHooks':!![]})[_0x2254('0x2a')](function(_0x4d30a5){return _0x4d30a5;});}return null;})[_0x2254('0x2a')](respondWithStatusCode(_0x3b1aae,null))[_0x2254('0x50')](handleError(_0x3b1aae,null));};exports['addApplications']=function(_0x5cc6bd,_0xde4e7,_0xa159a4){return db['VoiceExtension']['findOne']({'where':{'id':_0x5cc6bd[_0x2254('0x52')]['id']}})['then'](handleEntityNotFound(_0xde4e7,null))[_0x2254('0x2a')](function(_0x5d0229){if(_0x5d0229){return db[_0x2254('0x63')][_0x2254('0x64')](function(_0xaa9767){return db[_0x2254('0x3c')]['destroy']({'where':{'VoiceExtensionId':_0x5cc6bd[_0x2254('0x52')]['id']},'transaction':_0xaa9767})['then'](function(_0x1c2158){var _0x33cab6=_['map'](_0x5cc6bd[_0x2254('0x54')],function(_0x23a889){_0x23a889['VoiceExtensionId']=_0x5cc6bd[_0x2254('0x52')]['id'];return _0x23a889;});return db[_0x2254('0x3c')][_0x2254('0x65')](_0x33cab6,{'transaction':_0xaa9767});});})[_0x2254('0x2a')](function(){return db['VoiceExtension'][_0x2254('0x66')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5cc6bd[_0x2254('0x52')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x2254('0x2a')](respondWithResult(_0xde4e7,null))[_0x2254('0x50')](handleError(_0xde4e7,null));}; \ No newline at end of file +var _0x66fa=['Content-Range','apply','reject','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','error','name','index','VoiceExtension','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','params','body','outbound','startsWith','exten','concat','create','user','role','UserProfileSection','autoAssociation','UserProfileResource','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','./voiceExtension.socket','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x11d506,_0x5eebc5){var _0x5ccb84=function(_0x184441){while(--_0x184441){_0x11d506['push'](_0x11d506['shift']());}};_0x5ccb84(++_0x5eebc5);}(_0x66fa,0x117));var _0xa66f=function(_0x3affea,_0x2586b0){_0x3affea=_0x3affea-0x0;var _0x3eefe2=_0x66fa[_0x3affea];return _0x3eefe2;};'use strict';var pdf=require(_0xa66f('0x0'));var emlformat=require(_0xa66f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa66f('0x2'));var jsonpatch=require(_0xa66f('0x3'));var rp=require(_0xa66f('0x4'));var moment=require(_0xa66f('0x5'));var BPromise=require(_0xa66f('0x6'));var Mustache=require(_0xa66f('0x7'));var util=require(_0xa66f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa66f('0x9'));var ejs=require(_0xa66f('0xa'));var fs=require('fs');var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var db=require(_0xa66f('0x14'))['db'];config['redis']=_[_0xa66f('0x15')](config[_0xa66f('0x16')],{'host':_0xa66f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa66f('0x18'))['register'](socket);function respondWithStatusCode(_0x528427,_0x5a7b16){_0x5a7b16=_0x5a7b16||0xcc;return function(_0x3ac0ac){if(_0x3ac0ac){return _0x528427[_0xa66f('0x19')](_0x5a7b16);}return _0x528427[_0xa66f('0x1a')](_0x5a7b16)[_0xa66f('0x1b')]();};}function respondWithResult(_0xd348f9,_0x567d4f){_0x567d4f=_0x567d4f||0xc8;return function(_0x5510dc){if(_0x5510dc){return _0xd348f9[_0xa66f('0x1a')](_0x567d4f)[_0xa66f('0x1c')](_0x5510dc);}};}function respondWithFilteredResult(_0x295acf,_0x403f4d){return function(_0x5c67f5){if(_0x5c67f5){var _0x1cbe64=_0x5c67f5[_0xa66f('0x1d')],_0x55b59d=_0x403f4d[_0xa66f('0x1e')],_0x4a28d4=_0x403f4d[_0xa66f('0x1e')]+_0x403f4d[_0xa66f('0x1f')],_0x2f9da2;if(_0x4a28d4>=_0x1cbe64){_0x4a28d4=_0x1cbe64;_0x2f9da2=0xc8;}else{_0x2f9da2=0xce;}_0x295acf[_0xa66f('0x1a')](_0x2f9da2);return _0x295acf[_0xa66f('0x20')](_0xa66f('0x21'),_0x55b59d+'-'+_0x4a28d4+'/'+_0x1cbe64)[_0xa66f('0x1c')](_0x5c67f5);}return null;};}function patchUpdates(_0x2d9602){return function(_0x235b61){try{jsonpatch[_0xa66f('0x22')](_0x235b61,_0x2d9602,!![]);}catch(_0x3c4eb1){return BPromise[_0xa66f('0x23')](_0x3c4eb1);}return _0x235b61[_0xa66f('0x24')]();};}function saveUpdates(_0x5cd613,_0x27f570){return function(_0xc5c82e){if(_0xc5c82e){return _0xc5c82e[_0xa66f('0x25')](_0x5cd613)[_0xa66f('0x26')](function(_0x5cbd82){return _0x5cbd82;});}return null;};}function removeEntity(_0x337602,_0x473822){return function(_0x209f4d){if(_0x209f4d){return _0x209f4d[_0xa66f('0x27')]()['then'](function(){var _0x5e9639=_0x209f4d[_0xa66f('0x28')]({'plain':!![]});var _0x598942=[{'name':_0xa66f('0x29'),'value':_0xa66f('0x2a'),'ignore':![]},{'name':_0xa66f('0x2b'),'value':'outbound','ignore':![]},{'name':_0xa66f('0x2c'),'value':_0xa66f('0x2d'),'ignore':![]}];var _0x13495f=_(_0x598942)[_0xa66f('0x2e')](_0xa66f('0x2f'))[_0xa66f('0x30')](_0xa66f('0x31'))[_0xa66f('0x31')]();if(_[_0xa66f('0x32')](_0x13495f,_0x5e9639[_0xa66f('0x33')])){return;}var _0x45f71c=_[_0xa66f('0x34')](_0x598942,[_0xa66f('0x31'),_0x5e9639[_0xa66f('0x33')]])['name'];return db['UserProfileResource'][_0xa66f('0x27')]({'where':{'type':_0x45f71c,'resourceId':_0x5e9639['id']}})[_0xa66f('0x26')](function(){return _0x209f4d;});})['then'](function(){_0x337602[_0xa66f('0x1a')](0xcc)[_0xa66f('0x1b')]();});}};}function handleEntityNotFound(_0x4cd7f2,_0x332e86){return function(_0x15b946){if(!_0x15b946){_0x4cd7f2[_0xa66f('0x19')](0x194);}return _0x15b946;};}function handleError(_0x2c2ace,_0x395623){_0x395623=_0x395623||0x1f4;return function(_0x548add){logger[_0xa66f('0x35')](_0x548add['stack']);if(_0x548add[_0xa66f('0x36')]){delete _0x548add[_0xa66f('0x36')];}_0x2c2ace[_0xa66f('0x1a')](_0x395623)['send'](_0x548add);};}exports[_0xa66f('0x37')]=function(_0xadc17d,_0x4f1668){var _0x1a5d4a={},_0x35a847={},_0xba9457={'count':0x0,'rows':[]};var _0x3e7ac5=_[_0xa66f('0x30')](db[_0xa66f('0x38')][_0xa66f('0x39')],function(_0x41303c){return{'name':_0x41303c[_0xa66f('0x3a')],'type':_0x41303c[_0xa66f('0x33')]['key']};});_0x35a847[_0xa66f('0x3b')]=_['map'](_0x3e7ac5,_0xa66f('0x36'));_0x35a847[_0xa66f('0x3c')]=_[_0xa66f('0x3d')](_0xadc17d[_0xa66f('0x3c')]);_0x35a847[_0xa66f('0x3e')]=_[_0xa66f('0x3f')](_0x35a847[_0xa66f('0x3b')],_0x35a847[_0xa66f('0x3c')]);_0x1a5d4a['attributes']=_[_0xa66f('0x3f')](_0x35a847['model'],qs[_0xa66f('0x40')](_0xadc17d[_0xa66f('0x3c')][_0xa66f('0x40')]));_0x1a5d4a['attributes']=_0x1a5d4a['attributes'][_0xa66f('0x41')]?_0x1a5d4a[_0xa66f('0x42')]:_0x35a847[_0xa66f('0x3b')];if(!_0xadc17d[_0xa66f('0x3c')][_0xa66f('0x43')]('nolimit')){_0x1a5d4a['limit']=qs['limit'](_0xadc17d[_0xa66f('0x3c')]['limit']);_0x1a5d4a['offset']=qs['offset'](_0xadc17d[_0xa66f('0x3c')]['offset']);}_0x1a5d4a[_0xa66f('0x44')]=qs[_0xa66f('0x45')](_0xadc17d[_0xa66f('0x3c')][_0xa66f('0x45')]);_0x1a5d4a[_0xa66f('0x46')]=qs[_0xa66f('0x3e')](_[_0xa66f('0x47')](_0xadc17d[_0xa66f('0x3c')],_0x35a847[_0xa66f('0x3e')]),_0x3e7ac5);if(_0xadc17d[_0xa66f('0x3c')][_0xa66f('0x2e')]){_0x1a5d4a[_0xa66f('0x46')]=_[_0xa66f('0x48')](_0x1a5d4a[_0xa66f('0x46')],{'$or':_['map'](_0x3e7ac5,function(_0x36037c){if(_0x36037c[_0xa66f('0x33')]!=='VIRTUAL'){var _0x248587={};_0x248587[_0x36037c['name']]={'$like':'%'+_0xadc17d[_0xa66f('0x3c')][_0xa66f('0x2e')]+'%'};return _0x248587;}})});}_0x1a5d4a=_['merge']({},_0x1a5d4a,_0xadc17d[_0xa66f('0x49')]);var _0xa42041={'where':_0x1a5d4a[_0xa66f('0x46')]};return db['VoiceExtension'][_0xa66f('0x1d')](_0xa42041)['then'](function(_0x276cd5){_0xba9457[_0xa66f('0x1d')]=_0x276cd5;if(_0xadc17d[_0xa66f('0x3c')][_0xa66f('0x4a')]){_0x1a5d4a[_0xa66f('0x4b')]=[{'all':!![]}];}return db[_0xa66f('0x38')][_0xa66f('0x4c')](_0x1a5d4a);})['then'](function(_0x3e84dd){_0xba9457[_0xa66f('0x4d')]=_0x3e84dd;return _0xba9457;})[_0xa66f('0x26')](respondWithFilteredResult(_0x4f1668,_0x1a5d4a))[_0xa66f('0x4e')](handleError(_0x4f1668,null));};exports[_0xa66f('0x4f')]=function(_0x50a5ac,_0x547e29){var _0x2e619b={'raw':![],'where':{'id':_0x50a5ac[_0xa66f('0x50')]['id']}},_0x356b7c={};_0x356b7c[_0xa66f('0x3b')]=_[_0xa66f('0x3d')](db[_0xa66f('0x38')]['rawAttributes']);_0x356b7c[_0xa66f('0x3c')]=_[_0xa66f('0x3d')](_0x50a5ac[_0xa66f('0x3c')]);_0x356b7c['filters']=_['intersection'](_0x356b7c[_0xa66f('0x3b')],_0x356b7c[_0xa66f('0x3c')]);_0x2e619b[_0xa66f('0x42')]=_['intersection'](_0x356b7c['model'],qs['fields'](_0x50a5ac[_0xa66f('0x3c')][_0xa66f('0x40')]));_0x2e619b[_0xa66f('0x42')]=_0x2e619b[_0xa66f('0x42')][_0xa66f('0x41')]?_0x2e619b[_0xa66f('0x42')]:_0x356b7c[_0xa66f('0x3b')];if(_0x50a5ac[_0xa66f('0x3c')]['includeAll']){_0x2e619b[_0xa66f('0x4b')]=[{'all':!![]}];}_0x2e619b=_[_0xa66f('0x48')]({},_0x2e619b,_0x50a5ac[_0xa66f('0x49')]);return db[_0xa66f('0x38')][_0xa66f('0x34')](_0x2e619b)[_0xa66f('0x26')](handleEntityNotFound(_0x547e29,null))['then'](respondWithResult(_0x547e29,null))[_0xa66f('0x4e')](handleError(_0x547e29,null));};exports[_0xa66f('0x27')]=function(_0x174766,_0x13848d){return db[_0xa66f('0x38')]['find']({'where':{'id':_0x174766[_0xa66f('0x50')]['id']}})['then'](handleEntityNotFound(_0x13848d,null))[_0xa66f('0x26')](removeEntity(_0x13848d,null))['catch'](handleError(_0x13848d,null));};exports['create']=function(_0x58ce1b,_0x31233b){if(_0x58ce1b[_0xa66f('0x51')][_0xa66f('0x33')]===_0xa66f('0x52')&&!_[_0xa66f('0x53')](_0x58ce1b['body'][_0xa66f('0x54')],'_')){_0x58ce1b[_0xa66f('0x51')][_0xa66f('0x54')]='_'[_0xa66f('0x55')](_0x58ce1b['body'][_0xa66f('0x54')]);}return db['VoiceExtension'][_0xa66f('0x56')](_0x58ce1b[_0xa66f('0x51')],{'raw':![]})[_0xa66f('0x26')](function(_0x157cd2){var _0x167015=_0x58ce1b[_0xa66f('0x57')][_0xa66f('0x28')]({'plain':!![]});if(!_0x167015)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x167015[_0xa66f('0x58')]===_0xa66f('0x57')){var _0xc31ff0=_0x157cd2[_0xa66f('0x28')]({'plain':!![]});var _0x38decb=[{'name':_0xa66f('0x29'),'value':_0xa66f('0x2a')},{'name':_0xa66f('0x2b'),'value':_0xa66f('0x52')},{'name':'InternalRoutes','value':'internal'}];var _0x392092=_[_0xa66f('0x34')](_0x38decb,[_0xa66f('0x31'),_0xc31ff0[_0xa66f('0x33')]])[_0xa66f('0x36')];return db[_0xa66f('0x59')][_0xa66f('0x34')]({'where':{'name':_0x392092,'userProfileId':_0x167015['userProfileId']},'raw':!![]})[_0xa66f('0x26')](function(_0x11c89e){if(_0x11c89e&&_0x11c89e[_0xa66f('0x5a')]===0x0){return db[_0xa66f('0x5b')]['create']({'name':_0xc31ff0[_0xa66f('0x36')],'resourceId':_0xc31ff0['id'],'type':_0x11c89e[_0xa66f('0x36')],'sectionId':_0x11c89e['id']},{})[_0xa66f('0x26')](function(){return _0x157cd2;});}else{return _0x157cd2;}})[_0xa66f('0x4e')](function(_0x19f4b5){logger[_0xa66f('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19f4b5);throw _0x19f4b5;});}return _0x157cd2;})['then'](respondWithResult(_0x31233b,0xc9))[_0xa66f('0x4e')](handleError(_0x31233b,null));};exports[_0xa66f('0x25')]=function(_0x174aad,_0x52edb3){if(_0x174aad[_0xa66f('0x51')]['id']){delete _0x174aad[_0xa66f('0x51')]['id'];}return db[_0xa66f('0x38')][_0xa66f('0x34')]({'where':{'id':_0x174aad[_0xa66f('0x50')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x52edb3,null))[_0xa66f('0x26')](function(_0x33d684){if(_0x33d684){return db[_0xa66f('0x38')]['update'](_[_0xa66f('0x47')](_0x174aad[_0xa66f('0x51')],[_0xa66f('0x54'),_0xa66f('0x5c'),_0xa66f('0x5d'),_0xa66f('0x5e'),_0xa66f('0x5f'),_0xa66f('0x60')]),{'where':{'context':_0x33d684['context'],'exten':_0x33d684['exten']},'individualHooks':!![]})[_0xa66f('0x26')](function(_0x196283){return _0x196283;});}return null;})[_0xa66f('0x26')](respondWithStatusCode(_0x52edb3,null))[_0xa66f('0x4e')](handleError(_0x52edb3,null));};exports[_0xa66f('0x61')]=function(_0x508e73,_0x44525a,_0x4c2b68){return db[_0xa66f('0x38')][_0xa66f('0x62')]({'where':{'id':_0x508e73[_0xa66f('0x50')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x44525a,null))['then'](function(_0x25c6ff){if(_0x25c6ff){return db[_0xa66f('0x63')][_0xa66f('0x64')](function(_0x46ea11){return db[_0xa66f('0x38')][_0xa66f('0x27')]({'where':{'VoiceExtensionId':_0x508e73[_0xa66f('0x50')]['id']},'transaction':_0x46ea11})[_0xa66f('0x26')](function(_0xb9e1b7){var _0x36b92f=_[_0xa66f('0x30')](_0x508e73[_0xa66f('0x51')],function(_0x55dfb6){_0x55dfb6[_0xa66f('0x65')]=_0x508e73[_0xa66f('0x50')]['id'];return _0x55dfb6;});return db[_0xa66f('0x38')][_0xa66f('0x66')](_0x36b92f,{'transaction':_0x46ea11});});})[_0xa66f('0x26')](function(){return db[_0xa66f('0x38')][_0xa66f('0x67')]({'where':{'isApp':!![],'VoiceExtensionId':_0x508e73[_0xa66f('0x50')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0xa66f('0x26')](respondWithResult(_0x44525a,null))[_0xa66f('0x4e')](handleError(_0x44525a,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 2e9141e..0e46d05 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 _0xf1ba=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update'];(function(_0x4e8063,_0x47bf7d){var _0x1f9fae=function(_0x3cd77f){while(--_0x3cd77f){_0x4e8063['push'](_0x4e8063['shift']());}};_0x1f9fae(++_0x47bf7d);}(_0xf1ba,0x144));var _0xaf1b=function(_0x3640c4,_0x4ad8cc){_0x3640c4=_0x3640c4-0x0;var _0x3f5630=_0xf1ba[_0x3640c4];return _0x3f5630;};'use strict';var EventEmitter=require(_0xaf1b('0x0'));var VoiceExtension=require(_0xaf1b('0x1'))['db'][_0xaf1b('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xaf1b('0x3')](0x0);var events={'afterCreate':_0xaf1b('0x4'),'afterUpdate':_0xaf1b('0x5'),'afterDestroy':_0xaf1b('0x6')};function emitEvent(_0x19bef1){return function(_0xfa9406,_0x46aaab,_0x22eb61){VoiceExtensionEvents['emit'](_0x19bef1+':'+_0xfa9406['id'],_0xfa9406);VoiceExtensionEvents['emit'](_0x19bef1,_0xfa9406);_0x22eb61(null);};}for(var e in events){if(events[_0xaf1b('0x7')](e)){var event=events[e];VoiceExtension[_0xaf1b('0x8')](e,emitEvent(event));}}module[_0xaf1b('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x49a1=['hook','events','../../mysqldb','VoiceExtension','setMaxListeners','save','emit'];(function(_0xa5810d,_0x5ddddc){var _0x60cdf4=function(_0x2f3ae3){while(--_0x2f3ae3){_0xa5810d['push'](_0xa5810d['shift']());}};_0x60cdf4(++_0x5ddddc);}(_0x49a1,0x190));var _0x149a=function(_0x551261,_0x4a1f1e){_0x551261=_0x551261-0x0;var _0xa4c112=_0x49a1[_0x551261];return _0xa4c112;};'use strict';var EventEmitter=require(_0x149a('0x0'));var VoiceExtension=require(_0x149a('0x1'))['db'][_0x149a('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x149a('0x3')](0x0);var events={'afterCreate':_0x149a('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x49a483){return function(_0x3f7895,_0x13623b,_0x51b039){VoiceExtensionEvents[_0x149a('0x5')](_0x49a483+':'+_0x3f7895['id'],_0x3f7895);VoiceExtensionEvents[_0x149a('0x5')](_0x49a483,_0x3f7895);_0x51b039(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x149a('0x6')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index e238d68..900a746 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 _0xadb5=['bluebird','path','rimraf','../../config/environment','exports','define','VoiceExtension','voice_extensions','util','api','moment'];(function(_0x3c5229,_0xee1e3e){var _0x3525b6=function(_0x223424){while(--_0x223424){_0x3c5229['push'](_0x3c5229['shift']());}};_0x3525b6(++_0xee1e3e);}(_0xadb5,0xad));var _0x5adb=function(_0x167cc1,_0x207c87){_0x167cc1=_0x167cc1-0x0;var _0x2f0bf2=_0xadb5[_0x167cc1];return _0x2f0bf2;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./voiceExtension.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb28=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceExtension','voice_extensions','lodash','util'];(function(_0x59a83f,_0x39dd32){var _0x5c46a4=function(_0x58903f){while(--_0x58903f){_0x59a83f['push'](_0x59a83f['shift']());}};_0x5c46a4(++_0x39dd32);}(_0xdb28,0x106));var _0x8db2=function(_0x3d88d3,_0x6f2f3e){_0x3d88d3=_0x3d88d3-0x0;var _0x2f9f7d=_0xdb28[_0x3d88d3];return _0x2f9f7d;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./voiceExtension.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 6da791e..419668f 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 _0x606e=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','where','attributes','limit','map','model','include','GetVoiceExtension','debug','lodash','util','moment'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x606e,0x1d1));var _0xe606=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x606e[_0x29b609];return _0x54c952;};'use strict';var _=require(_0xe606('0x0'));var util=require(_0xe606('0x1'));var moment=require(_0xe606('0x2'));var BPromise=require(_0xe606('0x3'));var rs=require(_0xe606('0x4'));var fs=require('fs');var Redis=require(_0xe606('0x5'));var db=require(_0xe606('0x6'))['db'];var utils=require(_0xe606('0x7'));var logger=require(_0xe606('0x8'))(_0xe606('0x9'));var config=require(_0xe606('0xa'));var jayson=require(_0xe606('0xb'));var client=jayson[_0xe606('0xc')]['http']({'port':0x232a});config[_0xe606('0xd')]=_[_0xe606('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe606('0xf'))(new Redis(config['redis']));require(_0xe606('0x10'))[_0xe606('0x11')](socket);function respondWithRpcPromise(_0xd45b53,_0xf44db0,_0x46862f){return new BPromise(function(_0x58174f,_0x24a440){return client[_0xe606('0x12')](_0xd45b53,_0x46862f)[_0xe606('0x13')](function(_0x1e5b41){logger[_0xe606('0x14')](_0xe606('0x15'),_0xf44db0,_0xe606('0x16'));logger['debug'](_0xe606('0x17'),_0xf44db0,_0xe606('0x16'),JSON[_0xe606('0x18')](_0x1e5b41));if(_0x1e5b41[_0xe606('0x19')]){if(_0x1e5b41['error']['code']===0x1f4){logger[_0xe606('0x19')]('VoiceExtension,\x20%s,\x20%s',_0xf44db0,_0x1e5b41[_0xe606('0x19')][_0xe606('0x1a')]);return _0x24a440(_0x1e5b41[_0xe606('0x19')][_0xe606('0x1a')]);}logger[_0xe606('0x19')](_0xe606('0x15'),_0xf44db0,_0x1e5b41[_0xe606('0x19')][_0xe606('0x1a')]);return _0x58174f(_0x1e5b41[_0xe606('0x19')][_0xe606('0x1a')]);}else{logger[_0xe606('0x14')](_0xe606('0x15'),_0xf44db0,_0xe606('0x16'));_0x58174f(_0x1e5b41[_0xe606('0x1b')][_0xe606('0x1a')]);}})[_0xe606('0x1c')](function(_0x391a5b){logger[_0xe606('0x19')](_0xe606('0x15'),_0xf44db0,_0x391a5b);_0x24a440(_0x391a5b);});});}exports['GetVoiceExtension']=function(_0x154396){var _0x4524cb=this;return new Promise(function(_0x31c041,_0x68afef){return db['VoiceExtension'][_0xe606('0x1d')]({'raw':_0x154396[_0xe606('0x1e')]?_0x154396[_0xe606('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x154396['options']?_0x154396['options'][_0xe606('0x1f')]||null:null,'attributes':_0x154396[_0xe606('0x1e')]?_0x154396['options'][_0xe606('0x20')]||null:null,'limit':_0x154396['options']?_0x154396[_0xe606('0x1e')][_0xe606('0x21')]||null:null,'include':_0x154396[_0xe606('0x1e')]?_0x154396[_0xe606('0x1e')]['include']?_[_0xe606('0x22')](_0x154396[_0xe606('0x1e')]['include'],function(_0x431764){return{'model':db[_0x431764[_0xe606('0x23')]],'as':_0x431764['as'],'attributes':_0x431764[_0xe606('0x20')],'include':_0x431764['include']?_['map'](_0x431764['include'],function(_0x556c5d){return{'model':db[_0x556c5d['model']],'as':_0x556c5d['as'],'attributes':_0x556c5d['attributes'],'include':_0x556c5d[_0xe606('0x24')]?_['map'](_0x556c5d['include'],function(_0x1bf54e){return{'model':db[_0x1bf54e[_0xe606('0x23')]],'as':_0x1bf54e['as'],'attributes':_0x1bf54e[_0xe606('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe606('0x13')](function(_0x4bf4ab){logger[_0xe606('0x14')](_0xe606('0x25'),_0x154396);logger[_0xe606('0x26')]('GetVoiceExtension',_0x154396,JSON[_0xe606('0x18')](_0x4bf4ab));_0x31c041(_0x4bf4ab);})[_0xe606('0x1c')](function(_0x407195){logger[_0xe606('0x19')](_0xe606('0x25'),_0x407195[_0xe606('0x1a')],_0x154396);_0x68afef(_0x4524cb['error'](0x1f4,_0x407195[_0xe606('0x1a')]));});});}; \ No newline at end of file +var _0x01ca=['VoiceExtension','options','raw','attributes','limit','include','map','model','then','GetVoiceExtension','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result'];(function(_0x56d8ab,_0x4a8fb0){var _0x4d1401=function(_0x5acca2){while(--_0x5acca2){_0x56d8ab['push'](_0x56d8ab['shift']());}};_0x4d1401(++_0x4a8fb0);}(_0x01ca,0x116));var _0xa01c=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x01ca[_0x556927];return _0x5f1235;};'use strict';var _=require(_0xa01c('0x0'));var util=require(_0xa01c('0x1'));var moment=require(_0xa01c('0x2'));var BPromise=require('bluebird');var rs=require(_0xa01c('0x3'));var fs=require('fs');var Redis=require(_0xa01c('0x4'));var db=require(_0xa01c('0x5'))['db'];var utils=require(_0xa01c('0x6'));var logger=require(_0xa01c('0x7'))(_0xa01c('0x8'));var config=require('../../config/environment');var jayson=require(_0xa01c('0x9'));var client=jayson[_0xa01c('0xa')][_0xa01c('0xb')]({'port':0x232a});config[_0xa01c('0xc')]=_[_0xa01c('0xd')](config[_0xa01c('0xc')],{'host':_0xa01c('0xe'),'port':0x18eb});var socket=require(_0xa01c('0xf'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0xa01c('0x10')](socket);function respondWithRpcPromise(_0x1e6359,_0x58b632,_0x577bdc){return new BPromise(function(_0x2b6183,_0xf92a10){return client['request'](_0x1e6359,_0x577bdc)['then'](function(_0x38985f){logger[_0xa01c('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x58b632,_0xa01c('0x12'));logger['debug'](_0xa01c('0x13'),_0x58b632,_0xa01c('0x12'),JSON[_0xa01c('0x14')](_0x38985f));if(_0x38985f['error']){if(_0x38985f[_0xa01c('0x15')][_0xa01c('0x16')]===0x1f4){logger['error'](_0xa01c('0x17'),_0x58b632,_0x38985f[_0xa01c('0x15')]['message']);return _0xf92a10(_0x38985f[_0xa01c('0x15')][_0xa01c('0x18')]);}logger[_0xa01c('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x58b632,_0x38985f[_0xa01c('0x15')][_0xa01c('0x18')]);return _0x2b6183(_0x38985f['error']['message']);}else{logger['info'](_0xa01c('0x17'),_0x58b632,_0xa01c('0x12'));_0x2b6183(_0x38985f[_0xa01c('0x19')][_0xa01c('0x18')]);}})['catch'](function(_0x2bf8a8){logger[_0xa01c('0x15')](_0xa01c('0x17'),_0x58b632,_0x2bf8a8);_0xf92a10(_0x2bf8a8);});});}exports['GetVoiceExtension']=function(_0x32aaa8){var _0x1a313b=this;return new Promise(function(_0x231891,_0x298356){return db[_0xa01c('0x1a')]['findAll']({'raw':_0x32aaa8[_0xa01c('0x1b')]?_0x32aaa8['options'][_0xa01c('0x1c')]===undefined?!![]:![]:!![],'where':_0x32aaa8[_0xa01c('0x1b')]?_0x32aaa8[_0xa01c('0x1b')]['where']||null:null,'attributes':_0x32aaa8['options']?_0x32aaa8['options'][_0xa01c('0x1d')]||null:null,'limit':_0x32aaa8['options']?_0x32aaa8[_0xa01c('0x1b')][_0xa01c('0x1e')]||null:null,'include':_0x32aaa8[_0xa01c('0x1b')]?_0x32aaa8[_0xa01c('0x1b')][_0xa01c('0x1f')]?_[_0xa01c('0x20')](_0x32aaa8['options'][_0xa01c('0x1f')],function(_0x47fbfe){return{'model':db[_0x47fbfe['model']],'as':_0x47fbfe['as'],'attributes':_0x47fbfe[_0xa01c('0x1d')],'include':_0x47fbfe[_0xa01c('0x1f')]?_[_0xa01c('0x20')](_0x47fbfe[_0xa01c('0x1f')],function(_0x5c099c){return{'model':db[_0x5c099c[_0xa01c('0x21')]],'as':_0x5c099c['as'],'attributes':_0x5c099c[_0xa01c('0x1d')],'include':_0x5c099c['include']?_['map'](_0x5c099c[_0xa01c('0x1f')],function(_0x17c51c){return{'model':db[_0x17c51c[_0xa01c('0x21')]],'as':_0x17c51c['as'],'attributes':_0x17c51c[_0xa01c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa01c('0x22')](function(_0x569a2d){logger[_0xa01c('0x11')](_0xa01c('0x23'),_0x32aaa8);logger[_0xa01c('0x24')]('GetVoiceExtension',_0x32aaa8,JSON[_0xa01c('0x14')](_0x569a2d));_0x231891(_0x569a2d);})[_0xa01c('0x25')](function(_0x46fef0){logger['error'](_0xa01c('0x23'),_0x46fef0[_0xa01c('0x18')],_0x32aaa8);_0x298356(_0x1a313b[_0xa01c('0x15')](0x1f4,_0x46fef0[_0xa01c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 29733aa..93cbc24 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 _0xd0ea=['emit','register','length','voiceExtension:','save','remove','update'];(function(_0x11ba33,_0xc8f8d){var _0x49f898=function(_0x222d34){while(--_0x222d34){_0x11ba33['push'](_0x11ba33['shift']());}};_0x49f898(++_0xc8f8d);}(_0xd0ea,0x185));var _0xad0e=function(_0x266dab,_0x211142){_0x266dab=_0x266dab-0x0;var _0x2acc69=_0xd0ea[_0x266dab];return _0x2acc69;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0xad0e('0x0'),_0xad0e('0x1'),_0xad0e('0x2')];function createListener(_0x56aa0f,_0x29237f){return function(_0x1fb80d){_0x29237f[_0xad0e('0x3')](_0x56aa0f,_0x1fb80d);};}function removeListener(_0x8ec97a,_0x184956){return function(){VoiceExtensionEvents['removeListener'](_0x8ec97a,_0x184956);};}exports[_0xad0e('0x4')]=function(_0x40b28d){for(var _0x23aebf=0x0,_0x4db40a=events[_0xad0e('0x5')];_0x23aebf<_0x4db40a;_0x23aebf++){var _0x31cc5d=events[_0x23aebf];var _0x102996=createListener(_0xad0e('0x6')+_0x31cc5d,_0x40b28d);VoiceExtensionEvents['on'](_0x31cc5d,_0x102996);}}; \ No newline at end of file +var _0xcd69=['emit','removeListener','register','length','voiceExtension:','save','update'];(function(_0x4b6182,_0xa98fdd){var _0x582892=function(_0x60c498){while(--_0x60c498){_0x4b6182['push'](_0x4b6182['shift']());}};_0x582892(++_0xa98fdd);}(_0xcd69,0x8a));var _0x9cd6=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xcd69[_0x4e9d3c];return _0x2d0825;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x9cd6('0x0'),'remove',_0x9cd6('0x1')];function createListener(_0x44213d,_0x3a5b23){return function(_0x4f3b67){_0x3a5b23[_0x9cd6('0x2')](_0x44213d,_0x4f3b67);};}function removeListener(_0x22e1cd,_0x2024cd){return function(){VoiceExtensionEvents[_0x9cd6('0x3')](_0x22e1cd,_0x2024cd);};}exports[_0x9cd6('0x4')]=function(_0x4411b0){for(var _0x808603=0x0,_0x406bf9=events[_0x9cd6('0x5')];_0x808603<_0x406bf9;_0x808603++){var _0x49fc52=events[_0x808603];var _0x42f870=createListener(_0x9cd6('0x6')+_0x49fc52,_0x4411b0);VoiceExtensionEvents['on'](_0x49fc52,_0x42f870);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 230b723..c69b462 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 _0x722b=['path','connect-timeout','Router','../../components/auth/service','./voiceMail.controller','get','isAuthenticated','show','/:id/messages','getMessages','post','create','update','delete','/:id','destroy','exports','multer','util'];(function(_0x56dda5,_0x40d426){var _0x12574f=function(_0x27934c){while(--_0x27934c){_0x56dda5['push'](_0x56dda5['shift']());}};_0x12574f(++_0x40d426);}(_0x722b,0xbc));var _0xb722=function(_0x33d498,_0xceb7cf){_0x33d498=_0x33d498-0x0;var _0x338d8c=_0x722b[_0x33d498];return _0x338d8c;};'use strict';var multer=require(_0xb722('0x0'));var util=require(_0xb722('0x1'));var path=require(_0xb722('0x2'));var timeout=require(_0xb722('0x3'));var express=require('express');var router=express[_0xb722('0x4')]();var auth=require(_0xb722('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb722('0x6'));router[_0xb722('0x7')]('/',auth[_0xb722('0x8')](),controller['index']);router[_0xb722('0x7')]('/:id',auth[_0xb722('0x8')](),controller[_0xb722('0x9')]);router[_0xb722('0x7')](_0xb722('0xa'),auth[_0xb722('0x8')](),controller[_0xb722('0xb')]);router[_0xb722('0xc')]('/',auth['isAuthenticated'](),controller[_0xb722('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xb722('0xe')]);router[_0xb722('0xf')](_0xb722('0x10'),auth[_0xb722('0x8')](),controller[_0xb722('0x11')]);module[_0xb722('0x12')]=router; \ No newline at end of file +var _0x0864=['/:id','/:id/messages','getMessages','post','put','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0864,0x1ca));var _0x4086=function(_0x211d27,_0x4fe034){_0x211d27=_0x211d27-0x0;var _0x129791=_0x0864[_0x211d27];return _0x129791;};'use strict';var multer=require(_0x4086('0x0'));var util=require('util');var path=require(_0x4086('0x1'));var timeout=require(_0x4086('0x2'));var express=require('express');var router=express[_0x4086('0x3')]();var auth=require(_0x4086('0x4'));var interaction=require(_0x4086('0x5'));var config=require(_0x4086('0x6'));var controller=require('./voiceMail.controller');router[_0x4086('0x7')]('/',auth[_0x4086('0x8')](),controller[_0x4086('0x9')]);router[_0x4086('0x7')](_0x4086('0xa'),auth[_0x4086('0x8')](),controller['show']);router['get'](_0x4086('0xb'),auth['isAuthenticated'](),controller[_0x4086('0xc')]);router[_0x4086('0xd')]('/',auth[_0x4086('0x8')](),controller['create']);router[_0x4086('0xe')](_0x4086('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x4086('0xf')]('/:id',auth[_0x4086('0x8')](),controller[_0x4086('0x10')]);module[_0x4086('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 6fef816..19cd933 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 _0x8603=['exports','STRING','contest_mailbox','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0x8603,0x190));var _0x3860=function(_0x556980,_0x12f938){_0x556980=_0x556980-0x0;var _0x1fe209=_0x8603[_0x556980];return _0x1fe209;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'customer_id':{'type':Sequelize[_0x3860('0x1')]},'context':{'type':Sequelize[_0x3860('0x1')],'defaultValue':'from-voicemail','unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x3860('0x1')],'defaultValue':'','allowNull':![],'unique':_0x3860('0x2')},'password':{'type':Sequelize[_0x3860('0x1')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3860('0x1')],'validate':{'isEmail':!![]},'set':function(_0x56f8c5){this[_0x3860('0x3')](_0x3860('0x4'),typeof _0x56f8c5===_0x3860('0x5')&&_0x56f8c5[_0x3860('0x6')]()?_0x56f8c5[_0x3860('0x6')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x3860('0x1')]},'callback':{'type':Sequelize[_0x3860('0x1')]},'review':{'type':Sequelize['ENUM'](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3860('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3860('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x3860('0x7')]('yes','no'),'defaultValue':_0x3860('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x3860('0x7')](_0x3860('0x8'),'no'),'defaultValue':_0x3860('0x8'),'allowNull':![]},'stamp':{'type':_0x3860('0xa')},'emailsubject':{'type':Sequelize[_0x3860('0x1')]},'emailbody':{'type':Sequelize[_0x3860('0x1')]},'maxsecs':{'type':Sequelize[_0x3860('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3860('0xc')](_0x3860('0xd'))+_0x3860('0xe')+this['getDataValue'](_0x3860('0xf'));}}}; \ No newline at end of file +var _0x1339=['contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','fullname','\x20-\x20','mailbox','STRING','from-voicemail'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1339,0x1ed));var _0x9133=function(_0x4316a3,_0x275ab2){_0x4316a3=_0x4316a3-0x0;var _0x47e776=_0x1339[_0x4316a3];return _0x47e776;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x9133('0x0')]},'context':{'type':Sequelize[_0x9133('0x0')],'defaultValue':_0x9133('0x1'),'unique':_0x9133('0x2')},'mailbox':{'type':Sequelize[_0x9133('0x0')],'defaultValue':'','allowNull':![],'unique':_0x9133('0x2')},'password':{'type':Sequelize[_0x9133('0x0')]},'fullname':{'type':Sequelize[_0x9133('0x0')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x578643){this[_0x9133('0x3')](_0x9133('0x4'),typeof _0x578643==='string'&&_0x578643[_0x9133('0x5')]()?_0x578643[_0x9133('0x5')]():null);}},'pager':{'type':Sequelize[_0x9133('0x0')]},'tz':{'type':Sequelize[_0x9133('0x0')],'defaultValue':_0x9133('0x6')},'attach':{'type':Sequelize[_0x9133('0x7')](_0x9133('0x8'),'no'),'defaultValue':_0x9133('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x9133('0x7')](_0x9133('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x9133('0x0')]},'callback':{'type':Sequelize[_0x9133('0x0')]},'review':{'type':Sequelize[_0x9133('0x7')](_0x9133('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x9133('0x7')](_0x9133('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x9133('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x9133('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x9133('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x9133('0x7')](_0x9133('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x9133('0x7')](_0x9133('0x8'),'no'),'defaultValue':_0x9133('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0x9133('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x9133('0x7')](_0x9133('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x9133('0x8'),'no'),'defaultValue':_0x9133('0x8'),'allowNull':![]},'stamp':{'type':_0x9133('0x9')},'emailsubject':{'type':Sequelize[_0x9133('0x0')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x9133('0xa')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x9133('0xb')],'get':function(){return this['getDataValue'](_0x9133('0xc'))+_0x9133('0xd')+this['getDataValue'](_0x9133('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 0b41ce1..d251acf 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 _0xe859=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','order','mailbox','VoiceMailMessage','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','sendStatus','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','filters','include','create','body','user','role','UserProfileSection','find','autoAssociation'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xe859,0xb4));var _0x9e85=function(_0x57bfbd,_0x417539){_0x57bfbd=_0x57bfbd-0x0;var _0x3f6776=_0xe859[_0x57bfbd];return _0x3f6776;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9e85('0x0'));var zipdir=require(_0x9e85('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9e85('0x2'));var BPromise=require(_0x9e85('0x3'));var Mustache=require(_0x9e85('0x4'));var util=require(_0x9e85('0x5'));var path=require(_0x9e85('0x6'));var sox=require(_0x9e85('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9e85('0x8'));var squel=require(_0x9e85('0x9'));var crypto=require(_0x9e85('0xa'));var jsforce=require(_0x9e85('0xb'));var deskjs=require(_0x9e85('0xc'));var toCsv=require(_0x9e85('0xd'));var querystring=require(_0x9e85('0xe'));var Papa=require(_0x9e85('0xf'));var Redis=require(_0x9e85('0x10'));var authService=require(_0x9e85('0x11'));var qs=require(_0x9e85('0x12'));var as=require(_0x9e85('0x13'));var hardwareService=require(_0x9e85('0x14'));var logger=require(_0x9e85('0x15'))('api');var utils=require(_0x9e85('0x16'));var config=require('../../config/environment');var db=require(_0x9e85('0x17'))['db'];function respondWithStatusCode(_0x220cd6,_0x461c1d){_0x461c1d=_0x461c1d||0xcc;return function(_0x23fe41){if(_0x23fe41){return _0x220cd6['sendStatus'](_0x461c1d);}return _0x220cd6[_0x9e85('0x18')](_0x461c1d)['end']();};}function respondWithResult(_0x18ffb5,_0x210cca){_0x210cca=_0x210cca||0xc8;return function(_0x2e8288){if(_0x2e8288){return _0x18ffb5[_0x9e85('0x18')](_0x210cca)[_0x9e85('0x19')](_0x2e8288);}};}function respondWithFilteredResult(_0x42812a,_0x16ece6){return function(_0x2932f1){if(_0x2932f1){var _0x1e3b69=_0x2932f1[_0x9e85('0x1a')],_0x4a802c=_0x16ece6[_0x9e85('0x1b')],_0x54899e=_0x16ece6[_0x9e85('0x1b')]+_0x16ece6['limit'],_0x1fe49a;if(_0x54899e>=_0x1e3b69){_0x54899e=_0x1e3b69;_0x1fe49a=0xc8;}else{_0x1fe49a=0xce;}_0x42812a[_0x9e85('0x18')](_0x1fe49a);return _0x42812a[_0x9e85('0x1c')](_0x9e85('0x1d'),_0x4a802c+'-'+_0x54899e+'/'+_0x1e3b69)['json'](_0x2932f1);}return null;};}function patchUpdates(_0x32f3d8){return function(_0x2e4803){try{jsonpatch[_0x9e85('0x1e')](_0x2e4803,_0x32f3d8,!![]);}catch(_0x25b0de){return BPromise[_0x9e85('0x1f')](_0x25b0de);}return _0x2e4803[_0x9e85('0x20')]();};}function saveUpdates(_0x33c52b,_0x26c74a){return function(_0x2358cb){if(_0x2358cb){return _0x2358cb[_0x9e85('0x21')](_0x33c52b)[_0x9e85('0x22')](function(_0x2f5552){return _0x2f5552;});}return null;};}function removeEntity(_0x4f37e9,_0x26827a){return function(_0x408520){if(_0x408520){return _0x408520[_0x9e85('0x23')]()[_0x9e85('0x22')](function(){var _0x34ea47=_0x408520[_0x9e85('0x24')]({'plain':!![]});var _0x52ed1b=_0x9e85('0x25');return db[_0x9e85('0x26')][_0x9e85('0x23')]({'where':{'type':_0x52ed1b,'resourceId':_0x34ea47['id']}})[_0x9e85('0x22')](function(){return _0x408520;});})[_0x9e85('0x22')](function(){_0x4f37e9['status'](0xcc)[_0x9e85('0x27')]();});}};}function handleEntityNotFound(_0x4bd6cd,_0x5c8ad7){return function(_0x284fab){if(!_0x284fab){_0x4bd6cd[_0x9e85('0x28')](0x194);}return _0x284fab;};}function handleError(_0x506933,_0x3e7cc6){_0x3e7cc6=_0x3e7cc6||0x1f4;return function(_0x2896de){logger['error'](_0x2896de['stack']);if(_0x2896de[_0x9e85('0x29')]){delete _0x2896de[_0x9e85('0x29')];}_0x506933['status'](_0x3e7cc6)[_0x9e85('0x2a')](_0x2896de);};}exports[_0x9e85('0x2b')]=function(_0x5a5665,_0xd3646){var _0x4b7ac5={},_0x589a4b={},_0x3cb930={'count':0x0,'rows':[]};var _0x487af9=_[_0x9e85('0x2c')](db[_0x9e85('0x2d')][_0x9e85('0x2e')],function(_0x20b328){return{'name':_0x20b328[_0x9e85('0x2f')],'type':_0x20b328[_0x9e85('0x30')]['key']};});_0x589a4b[_0x9e85('0x31')]=_[_0x9e85('0x2c')](_0x487af9,_0x9e85('0x29'));_0x589a4b[_0x9e85('0x32')]=_[_0x9e85('0x33')](_0x5a5665[_0x9e85('0x32')]);_0x589a4b['filters']=_[_0x9e85('0x34')](_0x589a4b[_0x9e85('0x31')],_0x589a4b['query']);_0x4b7ac5[_0x9e85('0x35')]=_[_0x9e85('0x34')](_0x589a4b[_0x9e85('0x31')],qs[_0x9e85('0x36')](_0x5a5665[_0x9e85('0x32')][_0x9e85('0x36')]));_0x4b7ac5[_0x9e85('0x35')]=_0x4b7ac5['attributes'][_0x9e85('0x37')]?_0x4b7ac5['attributes']:_0x589a4b['model'];if(!_0x5a5665[_0x9e85('0x32')][_0x9e85('0x38')](_0x9e85('0x39'))){_0x4b7ac5[_0x9e85('0x3a')]=qs[_0x9e85('0x3a')](_0x5a5665[_0x9e85('0x32')][_0x9e85('0x3a')]);_0x4b7ac5[_0x9e85('0x1b')]=qs[_0x9e85('0x1b')](_0x5a5665[_0x9e85('0x32')]['offset']);}_0x4b7ac5['order']=qs[_0x9e85('0x3b')](_0x5a5665['query']['sort']);_0x4b7ac5['where']=qs['filters'](_[_0x9e85('0x3c')](_0x5a5665['query'],_0x589a4b['filters']),_0x487af9);if(_0x5a5665[_0x9e85('0x32')]['filter']){_0x4b7ac5[_0x9e85('0x3d')]=_[_0x9e85('0x3e')](_0x4b7ac5[_0x9e85('0x3d')],{'$or':_[_0x9e85('0x2c')](_0x487af9,function(_0x5cbead){if(_0x5cbead['type']!==_0x9e85('0x3f')){var _0x2fc346={};_0x2fc346[_0x5cbead[_0x9e85('0x29')]]={'$like':'%'+_0x5a5665[_0x9e85('0x32')][_0x9e85('0x40')]+'%'};return _0x2fc346;}})});}_0x4b7ac5=_[_0x9e85('0x3e')]({},_0x4b7ac5,_0x5a5665[_0x9e85('0x41')]);var _0x3eb844={'where':_0x4b7ac5[_0x9e85('0x3d')]};return db[_0x9e85('0x2d')][_0x9e85('0x1a')](_0x3eb844)['then'](function(_0x11efe5){_0x3cb930[_0x9e85('0x1a')]=_0x11efe5;if(_0x5a5665[_0x9e85('0x32')][_0x9e85('0x42')]){_0x4b7ac5['include']=[{'all':!![]}];}return db[_0x9e85('0x2d')][_0x9e85('0x43')](_0x4b7ac5);})[_0x9e85('0x22')](function(_0x3ed4f8){_0x3cb930[_0x9e85('0x44')]=_0x3ed4f8;return _0x3cb930;})['then'](respondWithFilteredResult(_0xd3646,_0x4b7ac5))[_0x9e85('0x45')](handleError(_0xd3646,null));};exports[_0x9e85('0x46')]=function(_0xa3a054,_0x438446){var _0x2fcae6={'raw':!![],'where':{'id':_0xa3a054[_0x9e85('0x47')]['id']}},_0x333f84={};_0x333f84[_0x9e85('0x31')]=_[_0x9e85('0x33')](db[_0x9e85('0x2d')][_0x9e85('0x2e')]);_0x333f84[_0x9e85('0x32')]=_[_0x9e85('0x33')](_0xa3a054[_0x9e85('0x32')]);_0x333f84[_0x9e85('0x48')]=_['intersection'](_0x333f84['model'],_0x333f84[_0x9e85('0x32')]);_0x2fcae6[_0x9e85('0x35')]=_[_0x9e85('0x34')](_0x333f84[_0x9e85('0x31')],qs[_0x9e85('0x36')](_0xa3a054[_0x9e85('0x32')]['fields']));_0x2fcae6['attributes']=_0x2fcae6[_0x9e85('0x35')][_0x9e85('0x37')]?_0x2fcae6[_0x9e85('0x35')]:_0x333f84['model'];if(_0xa3a054[_0x9e85('0x32')][_0x9e85('0x42')]){_0x2fcae6[_0x9e85('0x49')]=[{'all':!![]}];}_0x2fcae6=_[_0x9e85('0x3e')]({},_0x2fcae6,_0xa3a054[_0x9e85('0x41')]);return db[_0x9e85('0x2d')]['find'](_0x2fcae6)[_0x9e85('0x22')](handleEntityNotFound(_0x438446,null))[_0x9e85('0x22')](respondWithResult(_0x438446,null))[_0x9e85('0x45')](handleError(_0x438446,null));};exports[_0x9e85('0x4a')]=function(_0x33fb6d,_0x52c540){return db[_0x9e85('0x2d')][_0x9e85('0x4a')](_0x33fb6d[_0x9e85('0x4b')],{})['then'](function(_0x1db0bb){var _0xd36f29=_0x33fb6d[_0x9e85('0x4c')][_0x9e85('0x24')]({'plain':!![]});if(!_0xd36f29)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd36f29[_0x9e85('0x4d')]===_0x9e85('0x4c')){var _0xa75ef7=_0x1db0bb[_0x9e85('0x24')]({'plain':!![]});var _0x177833=_0x9e85('0x25');return db[_0x9e85('0x4e')][_0x9e85('0x4f')]({'where':{'name':_0x177833,'userProfileId':_0xd36f29['userProfileId']},'raw':!![]})[_0x9e85('0x22')](function(_0x239906){if(_0x239906&&_0x239906[_0x9e85('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0xa75ef7[_0x9e85('0x29')],'resourceId':_0xa75ef7['id'],'type':_0x239906[_0x9e85('0x29')],'sectionId':_0x239906['id']},{})[_0x9e85('0x22')](function(){return _0x1db0bb;});}else{return _0x1db0bb;}})['catch'](function(_0x195534){logger[_0x9e85('0x51')](_0x9e85('0x52'),_0x195534);throw _0x195534;});}return _0x1db0bb;})[_0x9e85('0x22')](respondWithResult(_0x52c540,0xc9))[_0x9e85('0x45')](handleError(_0x52c540,null));};exports[_0x9e85('0x21')]=function(_0x24c63b,_0xb1496){if(_0x24c63b['body']['id']){delete _0x24c63b[_0x9e85('0x4b')]['id'];}return db[_0x9e85('0x2d')][_0x9e85('0x4f')]({'where':{'id':_0x24c63b[_0x9e85('0x47')]['id']}})[_0x9e85('0x22')](handleEntityNotFound(_0xb1496,null))[_0x9e85('0x22')](saveUpdates(_0x24c63b[_0x9e85('0x4b')],null))[_0x9e85('0x22')](respondWithResult(_0xb1496,null))[_0x9e85('0x45')](handleError(_0xb1496,null));};exports['destroy']=function(_0x4687e4,_0x17a687){return db[_0x9e85('0x2d')][_0x9e85('0x4f')]({'where':{'id':_0x4687e4['params']['id']}})['then'](handleEntityNotFound(_0x17a687,null))['then'](removeEntity(_0x17a687,null))['catch'](handleError(_0x17a687,null));};exports['getMessages']=function(_0x5c8784,_0x32f077,_0x549a99){return db[_0x9e85('0x2d')][_0x9e85('0x53')]({'where':{'id':_0x5c8784['params']['id']}})[_0x9e85('0x22')](handleEntityNotFound(_0x32f077,null))[_0x9e85('0x22')](function(_0x52a1a2){var _0x414008;var _0x34d5a3={},_0x2fc868={};_0x2fc868[_0x9e85('0x31')]=_[_0x9e85('0x33')](db['VoiceMailMessage'][_0x9e85('0x2e')]);_0x2fc868[_0x9e85('0x32')]=_[_0x9e85('0x33')](_0x5c8784[_0x9e85('0x32')]);_0x2fc868['filters']=_[_0x9e85('0x34')](_0x2fc868['model'],_0x2fc868[_0x9e85('0x32')]);_0x34d5a3[_0x9e85('0x35')]=_[_0x9e85('0x34')](_0x2fc868['model'],qs[_0x9e85('0x36')](_0x5c8784[_0x9e85('0x32')][_0x9e85('0x36')]));_0x34d5a3[_0x9e85('0x35')]=_0x34d5a3['attributes']['length']?_0x34d5a3['attributes']:_0x2fc868[_0x9e85('0x31')];if(!_0x5c8784['query'][_0x9e85('0x38')](_0x9e85('0x39'))){_0x34d5a3[_0x9e85('0x3a')]=qs['limit'](_0x5c8784[_0x9e85('0x32')][_0x9e85('0x3a')]);_0x34d5a3[_0x9e85('0x1b')]=qs['offset'](_0x5c8784[_0x9e85('0x32')][_0x9e85('0x1b')]);}_0x34d5a3[_0x9e85('0x54')]=qs['sort'](_0x5c8784['query']['sort']);_0x34d5a3[_0x9e85('0x3d')]=qs[_0x9e85('0x48')](_['pick'](_0x5c8784['query'],_0x2fc868[_0x9e85('0x48')]));if(_0x5c8784[_0x9e85('0x32')][_0x9e85('0x40')]){_0x34d5a3[_0x9e85('0x3d')]=_[_0x9e85('0x3e')](_0x34d5a3[_0x9e85('0x3d')],{'$or':_['map'](_0x34d5a3['attributes'],function(_0x4e69e4){var _0x240ec1={};_0x240ec1[_0x4e69e4]={'$like':'%'+_0x5c8784[_0x9e85('0x32')]['filter']+'%'};return _0x240ec1;})});}_0x34d5a3[_0x9e85('0x3d')]=_[_0x9e85('0x3e')](_0x34d5a3[_0x9e85('0x3d')],{'mailboxuser':_0x52a1a2[_0x9e85('0x55')]});_0x34d5a3=_['merge']({},_0x34d5a3,_0x5c8784[_0x9e85('0x41')]);return db[_0x9e85('0x56')]['findAndCountAll'](_0x34d5a3)[_0x9e85('0x22')](respondWithFilteredResult(_0x32f077,_0x34d5a3));})['catch'](handleError(_0x32f077,null));}; \ No newline at end of file +var _0x6125=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage','mailbox','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','limit','set','Content-Range','reject','save','update','destroy','get','Voicemails','UserProfileResource','then','sendStatus','error','stack','name','send','map','VoiceMail','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','rawAttributes','length','find','create','body'];(function(_0x419608,_0x188b7f){var _0x5e8e92=function(_0x4e9e93){while(--_0x4e9e93){_0x419608['push'](_0x419608['shift']());}};_0x5e8e92(++_0x188b7f);}(_0x6125,0x1d3));var _0x5612=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6125[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x5612('0x0'));var emlformat=require(_0x5612('0x1'));var rimraf=require(_0x5612('0x2'));var zipdir=require(_0x5612('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5612('0x4'));var moment=require(_0x5612('0x5'));var BPromise=require(_0x5612('0x6'));var Mustache=require(_0x5612('0x7'));var util=require(_0x5612('0x8'));var path=require(_0x5612('0x9'));var sox=require(_0x5612('0xa'));var csv=require(_0x5612('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5612('0xc'));var squel=require(_0x5612('0xd'));var crypto=require(_0x5612('0xe'));var jsforce=require(_0x5612('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5612('0x10'));var Papa=require('papaparse');var Redis=require(_0x5612('0x11'));var authService=require(_0x5612('0x12'));var qs=require(_0x5612('0x13'));var as=require(_0x5612('0x14'));var hardwareService=require(_0x5612('0x15'));var logger=require(_0x5612('0x16'))(_0x5612('0x17'));var utils=require(_0x5612('0x18'));var config=require(_0x5612('0x19'));var db=require(_0x5612('0x1a'))['db'];function respondWithStatusCode(_0x46d8e2,_0x2c0d57){_0x2c0d57=_0x2c0d57||0xcc;return function(_0x5b02cf){if(_0x5b02cf){return _0x46d8e2['sendStatus'](_0x2c0d57);}return _0x46d8e2['status'](_0x2c0d57)[_0x5612('0x1b')]();};}function respondWithResult(_0x3303b8,_0x5af4e9){_0x5af4e9=_0x5af4e9||0xc8;return function(_0x1a646f){if(_0x1a646f){return _0x3303b8[_0x5612('0x1c')](_0x5af4e9)[_0x5612('0x1d')](_0x1a646f);}};}function respondWithFilteredResult(_0x13838e,_0x57afc7){return function(_0x31417a){if(_0x31417a){var _0x24e12d=_0x31417a[_0x5612('0x1e')],_0x6c6892=_0x57afc7['offset'],_0x4b2879=_0x57afc7['offset']+_0x57afc7[_0x5612('0x1f')],_0x26b7da;if(_0x4b2879>=_0x24e12d){_0x4b2879=_0x24e12d;_0x26b7da=0xc8;}else{_0x26b7da=0xce;}_0x13838e[_0x5612('0x1c')](_0x26b7da);return _0x13838e[_0x5612('0x20')](_0x5612('0x21'),_0x6c6892+'-'+_0x4b2879+'/'+_0x24e12d)[_0x5612('0x1d')](_0x31417a);}return null;};}function patchUpdates(_0x473929){return function(_0x1f3c85){try{jsonpatch['apply'](_0x1f3c85,_0x473929,!![]);}catch(_0x2d81f8){return BPromise[_0x5612('0x22')](_0x2d81f8);}return _0x1f3c85[_0x5612('0x23')]();};}function saveUpdates(_0x38ed40,_0x502a07){return function(_0x5caff2){if(_0x5caff2){return _0x5caff2[_0x5612('0x24')](_0x38ed40)['then'](function(_0x49f3ce){return _0x49f3ce;});}return null;};}function removeEntity(_0x83b17c,_0xe4d94a){return function(_0x3b94d5){if(_0x3b94d5){return _0x3b94d5[_0x5612('0x25')]()['then'](function(){var _0xf04b6b=_0x3b94d5[_0x5612('0x26')]({'plain':!![]});var _0x4114ca=_0x5612('0x27');return db[_0x5612('0x28')][_0x5612('0x25')]({'where':{'type':_0x4114ca,'resourceId':_0xf04b6b['id']}})[_0x5612('0x29')](function(){return _0x3b94d5;});})[_0x5612('0x29')](function(){_0x83b17c[_0x5612('0x1c')](0xcc)[_0x5612('0x1b')]();});}};}function handleEntityNotFound(_0xcb2085,_0xbec390){return function(_0x293601){if(!_0x293601){_0xcb2085[_0x5612('0x2a')](0x194);}return _0x293601;};}function handleError(_0x4ab86f,_0x7ec2a8){_0x7ec2a8=_0x7ec2a8||0x1f4;return function(_0x340c8f){logger[_0x5612('0x2b')](_0x340c8f[_0x5612('0x2c')]);if(_0x340c8f['name']){delete _0x340c8f[_0x5612('0x2d')];}_0x4ab86f[_0x5612('0x1c')](_0x7ec2a8)[_0x5612('0x2e')](_0x340c8f);};}exports['index']=function(_0x3edb73,_0x700352){var _0x48f4b6={},_0x56014d={},_0x1beee1={'count':0x0,'rows':[]};var _0x184aa4=_[_0x5612('0x2f')](db[_0x5612('0x30')]['rawAttributes'],function(_0x5acf16){return{'name':_0x5acf16[_0x5612('0x31')],'type':_0x5acf16[_0x5612('0x32')]['key']};});_0x56014d[_0x5612('0x33')]=_[_0x5612('0x2f')](_0x184aa4,'name');_0x56014d[_0x5612('0x34')]=_[_0x5612('0x35')](_0x3edb73[_0x5612('0x34')]);_0x56014d[_0x5612('0x36')]=_[_0x5612('0x37')](_0x56014d[_0x5612('0x33')],_0x56014d[_0x5612('0x34')]);_0x48f4b6[_0x5612('0x38')]=_[_0x5612('0x37')](_0x56014d[_0x5612('0x33')],qs['fields'](_0x3edb73['query'][_0x5612('0x39')]));_0x48f4b6[_0x5612('0x38')]=_0x48f4b6[_0x5612('0x38')]['length']?_0x48f4b6[_0x5612('0x38')]:_0x56014d[_0x5612('0x33')];if(!_0x3edb73[_0x5612('0x34')][_0x5612('0x3a')](_0x5612('0x3b'))){_0x48f4b6[_0x5612('0x1f')]=qs['limit'](_0x3edb73[_0x5612('0x34')][_0x5612('0x1f')]);_0x48f4b6[_0x5612('0x3c')]=qs[_0x5612('0x3c')](_0x3edb73[_0x5612('0x34')][_0x5612('0x3c')]);}_0x48f4b6[_0x5612('0x3d')]=qs[_0x5612('0x3e')](_0x3edb73[_0x5612('0x34')][_0x5612('0x3e')]);_0x48f4b6[_0x5612('0x3f')]=qs[_0x5612('0x36')](_[_0x5612('0x40')](_0x3edb73[_0x5612('0x34')],_0x56014d['filters']),_0x184aa4);if(_0x3edb73[_0x5612('0x34')][_0x5612('0x41')]){_0x48f4b6[_0x5612('0x3f')]=_[_0x5612('0x42')](_0x48f4b6[_0x5612('0x3f')],{'$or':_[_0x5612('0x2f')](_0x184aa4,function(_0x4dfeec){if(_0x4dfeec[_0x5612('0x32')]!==_0x5612('0x43')){var _0x5c5587={};_0x5c5587[_0x4dfeec['name']]={'$like':'%'+_0x3edb73[_0x5612('0x34')][_0x5612('0x41')]+'%'};return _0x5c5587;}})});}_0x48f4b6=_[_0x5612('0x42')]({},_0x48f4b6,_0x3edb73[_0x5612('0x44')]);var _0x438cd9={'where':_0x48f4b6['where']};return db[_0x5612('0x30')][_0x5612('0x1e')](_0x438cd9)[_0x5612('0x29')](function(_0x53a941){_0x1beee1['count']=_0x53a941;if(_0x3edb73[_0x5612('0x34')][_0x5612('0x45')]){_0x48f4b6[_0x5612('0x46')]=[{'all':!![]}];}return db[_0x5612('0x30')]['findAll'](_0x48f4b6);})[_0x5612('0x29')](function(_0x30f97a){_0x1beee1[_0x5612('0x47')]=_0x30f97a;return _0x1beee1;})['then'](respondWithFilteredResult(_0x700352,_0x48f4b6))[_0x5612('0x48')](handleError(_0x700352,null));};exports['show']=function(_0x369fba,_0xe1c2a0){var _0x10b115={'raw':!![],'where':{'id':_0x369fba[_0x5612('0x49')]['id']}},_0x4396b6={};_0x4396b6[_0x5612('0x33')]=_[_0x5612('0x35')](db[_0x5612('0x30')][_0x5612('0x4a')]);_0x4396b6[_0x5612('0x34')]=_[_0x5612('0x35')](_0x369fba['query']);_0x4396b6[_0x5612('0x36')]=_[_0x5612('0x37')](_0x4396b6[_0x5612('0x33')],_0x4396b6['query']);_0x10b115[_0x5612('0x38')]=_[_0x5612('0x37')](_0x4396b6[_0x5612('0x33')],qs[_0x5612('0x39')](_0x369fba['query'][_0x5612('0x39')]));_0x10b115['attributes']=_0x10b115[_0x5612('0x38')][_0x5612('0x4b')]?_0x10b115[_0x5612('0x38')]:_0x4396b6[_0x5612('0x33')];if(_0x369fba[_0x5612('0x34')][_0x5612('0x45')]){_0x10b115[_0x5612('0x46')]=[{'all':!![]}];}_0x10b115=_[_0x5612('0x42')]({},_0x10b115,_0x369fba['options']);return db['VoiceMail'][_0x5612('0x4c')](_0x10b115)['then'](handleEntityNotFound(_0xe1c2a0,null))[_0x5612('0x29')](respondWithResult(_0xe1c2a0,null))[_0x5612('0x48')](handleError(_0xe1c2a0,null));};exports[_0x5612('0x4d')]=function(_0x46382a,_0x3e82b1){return db[_0x5612('0x30')][_0x5612('0x4d')](_0x46382a[_0x5612('0x4e')],{})[_0x5612('0x29')](function(_0x92d041){var _0x2a0b95=_0x46382a[_0x5612('0x4f')][_0x5612('0x26')]({'plain':!![]});if(!_0x2a0b95)throw new Error(_0x5612('0x50'));if(_0x2a0b95[_0x5612('0x51')]==='user'){var _0x298e7f=_0x92d041[_0x5612('0x26')]({'plain':!![]});var _0x3cae52=_0x5612('0x27');return db[_0x5612('0x52')][_0x5612('0x4c')]({'where':{'name':_0x3cae52,'userProfileId':_0x2a0b95[_0x5612('0x53')]},'raw':!![]})['then'](function(_0x5b260a){if(_0x5b260a&&_0x5b260a[_0x5612('0x54')]===0x0){return db[_0x5612('0x28')][_0x5612('0x4d')]({'name':_0x298e7f['name'],'resourceId':_0x298e7f['id'],'type':_0x5b260a[_0x5612('0x2d')],'sectionId':_0x5b260a['id']},{})[_0x5612('0x29')](function(){return _0x92d041;});}else{return _0x92d041;}})[_0x5612('0x48')](function(_0x269182){logger[_0x5612('0x2b')](_0x5612('0x55'),_0x269182);throw _0x269182;});}return _0x92d041;})[_0x5612('0x29')](respondWithResult(_0x3e82b1,0xc9))[_0x5612('0x48')](handleError(_0x3e82b1,null));};exports[_0x5612('0x24')]=function(_0x4c30b8,_0xb8b927){if(_0x4c30b8[_0x5612('0x4e')]['id']){delete _0x4c30b8[_0x5612('0x4e')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x4c30b8[_0x5612('0x49')]['id']}})[_0x5612('0x29')](handleEntityNotFound(_0xb8b927,null))[_0x5612('0x29')](saveUpdates(_0x4c30b8['body'],null))['then'](respondWithResult(_0xb8b927,null))[_0x5612('0x48')](handleError(_0xb8b927,null));};exports['destroy']=function(_0x169fc3,_0x372c30){return db[_0x5612('0x30')]['find']({'where':{'id':_0x169fc3[_0x5612('0x49')]['id']}})[_0x5612('0x29')](handleEntityNotFound(_0x372c30,null))[_0x5612('0x29')](removeEntity(_0x372c30,null))[_0x5612('0x48')](handleError(_0x372c30,null));};exports[_0x5612('0x56')]=function(_0x26edd0,_0x47dd2e,_0x25fe03){return db['VoiceMail'][_0x5612('0x57')]({'where':{'id':_0x26edd0[_0x5612('0x49')]['id']}})[_0x5612('0x29')](handleEntityNotFound(_0x47dd2e,null))[_0x5612('0x29')](function(_0xedaf56){var _0x44e4fb;var _0x5b19dc={},_0x575a93={};_0x575a93[_0x5612('0x33')]=_[_0x5612('0x35')](db[_0x5612('0x58')][_0x5612('0x4a')]);_0x575a93['query']=_['keys'](_0x26edd0[_0x5612('0x34')]);_0x575a93[_0x5612('0x36')]=_[_0x5612('0x37')](_0x575a93[_0x5612('0x33')],_0x575a93['query']);_0x5b19dc[_0x5612('0x38')]=_['intersection'](_0x575a93['model'],qs[_0x5612('0x39')](_0x26edd0[_0x5612('0x34')]['fields']));_0x5b19dc[_0x5612('0x38')]=_0x5b19dc[_0x5612('0x38')][_0x5612('0x4b')]?_0x5b19dc[_0x5612('0x38')]:_0x575a93['model'];if(!_0x26edd0[_0x5612('0x34')][_0x5612('0x3a')](_0x5612('0x3b'))){_0x5b19dc[_0x5612('0x1f')]=qs[_0x5612('0x1f')](_0x26edd0[_0x5612('0x34')][_0x5612('0x1f')]);_0x5b19dc[_0x5612('0x3c')]=qs[_0x5612('0x3c')](_0x26edd0['query'][_0x5612('0x3c')]);}_0x5b19dc[_0x5612('0x3d')]=qs['sort'](_0x26edd0[_0x5612('0x34')]['sort']);_0x5b19dc[_0x5612('0x3f')]=qs['filters'](_[_0x5612('0x40')](_0x26edd0[_0x5612('0x34')],_0x575a93['filters']));if(_0x26edd0[_0x5612('0x34')][_0x5612('0x41')]){_0x5b19dc['where']=_[_0x5612('0x42')](_0x5b19dc[_0x5612('0x3f')],{'$or':_[_0x5612('0x2f')](_0x5b19dc[_0x5612('0x38')],function(_0x4d51e7){var _0x181028={};_0x181028[_0x4d51e7]={'$like':'%'+_0x26edd0['query'][_0x5612('0x41')]+'%'};return _0x181028;})});}_0x5b19dc['where']=_['merge'](_0x5b19dc[_0x5612('0x3f')],{'mailboxuser':_0xedaf56[_0x5612('0x59')]});_0x5b19dc=_[_0x5612('0x42')]({},_0x5b19dc,_0x26edd0[_0x5612('0x44')]);return db['VoiceMailMessage'][_0x5612('0x5a')](_0x5b19dc)['then'](respondWithFilteredResult(_0x47dd2e,_0x5b19dc));})[_0x5612('0x48')](handleError(_0x47dd2e,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 1d1311a..fdac791 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 _0xa45e=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash'];(function(_0x1782a1,_0x53be4e){var _0x55ee4e=function(_0x1417f5){while(--_0x1417f5){_0x1782a1['push'](_0x1782a1['shift']());}};_0x55ee4e(++_0x53be4e);}(_0xa45e,0x16f));var _0xea45=function(_0x5926e9,_0x3ca4ad){_0x5926e9=_0x5926e9-0x0;var _0x389c90=_0xa45e[_0x5926e9];return _0x389c90;};'use strict';var _=require(_0xea45('0x0'));var util=require(_0xea45('0x1'));var logger=require('../../config/logger')(_0xea45('0x2'));var moment=require(_0xea45('0x3'));var BPromise=require(_0xea45('0x4'));var rp=require(_0xea45('0x5'));var fs=require('fs');var path=require(_0xea45('0x6'));var rimraf=require(_0xea45('0x7'));var config=require(_0xea45('0x8'));var attributes=require(_0xea45('0x9'));module['exports']=function(_0x586787,_0x188e68){return _0x586787[_0xea45('0xa')](_0xea45('0xb'),attributes,{'tableName':_0xea45('0xc'),'paranoid':![],'indexes':[{'name':_0xea45('0xd'),'fields':[_0xea45('0xe'),_0xea45('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd58=['exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes'];(function(_0x770f7,_0x3af003){var _0xe797c6=function(_0x47d92a){while(--_0x47d92a){_0x770f7['push'](_0x770f7['shift']());}};_0xe797c6(++_0x3af003);}(_0xfd58,0x1a7));var _0x8fd5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd58[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x8fd5('0x0'));var logger=require(_0x8fd5('0x1'))('api');var moment=require(_0x8fd5('0x2'));var BPromise=require(_0x8fd5('0x3'));var rp=require(_0x8fd5('0x4'));var fs=require('fs');var path=require(_0x8fd5('0x5'));var rimraf=require(_0x8fd5('0x6'));var config=require(_0x8fd5('0x7'));var attributes=require(_0x8fd5('0x8'));module[_0x8fd5('0x9')]=function(_0x62e88d,_0x47628e){return _0x62e88d[_0x8fd5('0xa')](_0x8fd5('0xb'),attributes,{'tableName':_0x8fd5('0xc'),'paranoid':![],'indexes':[{'name':_0x8fd5('0xd'),'fields':[_0x8fd5('0xe'),_0x8fd5('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 01d1f7e..9ecdf67 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 _0xbb5c=['VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb5c,0x86));var _0xcbb5=function(_0x14885a,_0x330f55){_0x14885a=_0x14885a-0x0;var _0x408cd5=_0xbb5c[_0x14885a];return _0x408cd5;};'use strict';var _=require(_0xcbb5('0x0'));var util=require('util');var moment=require(_0xcbb5('0x1'));var BPromise=require(_0xcbb5('0x2'));var rs=require(_0xcbb5('0x3'));var fs=require('fs');var Redis=require(_0xcbb5('0x4'));var db=require(_0xcbb5('0x5'))['db'];var utils=require(_0xcbb5('0x6'));var logger=require('../../config/logger')(_0xcbb5('0x7'));var config=require(_0xcbb5('0x8'));var jayson=require(_0xcbb5('0x9'));var client=jayson[_0xcbb5('0xa')][_0xcbb5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32a310,_0x43d3a4,_0x367fc1){return new BPromise(function(_0x5e5e24,_0xb8dfd9){return client['request'](_0x32a310,_0x367fc1)['then'](function(_0x3b209d){logger[_0xcbb5('0xc')](_0xcbb5('0xd'),_0x43d3a4,_0xcbb5('0xe'));logger[_0xcbb5('0xf')](_0xcbb5('0x10'),_0x43d3a4,_0xcbb5('0xe'),JSON['stringify'](_0x3b209d));if(_0x3b209d[_0xcbb5('0x11')]){if(_0x3b209d[_0xcbb5('0x11')][_0xcbb5('0x12')]===0x1f4){logger[_0xcbb5('0x11')]('VoiceMail,\x20%s,\x20%s',_0x43d3a4,_0x3b209d[_0xcbb5('0x11')]['message']);return _0xb8dfd9(_0x3b209d[_0xcbb5('0x11')][_0xcbb5('0x13')]);}logger[_0xcbb5('0x11')](_0xcbb5('0xd'),_0x43d3a4,_0x3b209d[_0xcbb5('0x11')][_0xcbb5('0x13')]);return _0x5e5e24(_0x3b209d[_0xcbb5('0x11')]['message']);}else{logger[_0xcbb5('0xc')]('VoiceMail,\x20%s,\x20%s',_0x43d3a4,_0xcbb5('0xe'));_0x5e5e24(_0x3b209d['result'][_0xcbb5('0x13')]);}})[_0xcbb5('0x14')](function(_0x1297eb){logger[_0xcbb5('0x11')](_0xcbb5('0xd'),_0x43d3a4,_0x1297eb);_0xb8dfd9(_0x1297eb);});});} \ No newline at end of file +var _0x3954=['error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5e4b85,_0x6cf965){var _0x5cd3cb=function(_0x589c9e){while(--_0x589c9e){_0x5e4b85['push'](_0x5e4b85['shift']());}};_0x5cd3cb(++_0x6cf965);}(_0x3954,0x17b));var _0x4395=function(_0x463fe4,_0x535451){_0x463fe4=_0x463fe4-0x0;var _0x5d2348=_0x3954[_0x463fe4];return _0x5d2348;};'use strict';var _=require(_0x4395('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4395('0x1'));var rs=require(_0x4395('0x2'));var fs=require('fs');var Redis=require(_0x4395('0x3'));var db=require(_0x4395('0x4'))['db'];var utils=require(_0x4395('0x5'));var logger=require(_0x4395('0x6'))(_0x4395('0x7'));var config=require(_0x4395('0x8'));var jayson=require(_0x4395('0x9'));var client=jayson['client'][_0x4395('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2751c3,_0x198401,_0xcb94aa){return new BPromise(function(_0x336757,_0xb07e0e){return client[_0x4395('0xb')](_0x2751c3,_0xcb94aa)['then'](function(_0x1f920a){logger[_0x4395('0xc')](_0x4395('0xd'),_0x198401,_0x4395('0xe'));logger['debug'](_0x4395('0xf'),_0x198401,_0x4395('0xe'),JSON[_0x4395('0x10')](_0x1f920a));if(_0x1f920a[_0x4395('0x11')]){if(_0x1f920a[_0x4395('0x11')][_0x4395('0x12')]===0x1f4){logger['error'](_0x4395('0xd'),_0x198401,_0x1f920a['error']['message']);return _0xb07e0e(_0x1f920a[_0x4395('0x11')]['message']);}logger['error']('VoiceMail,\x20%s,\x20%s',_0x198401,_0x1f920a['error'][_0x4395('0x13')]);return _0x336757(_0x1f920a[_0x4395('0x11')][_0x4395('0x13')]);}else{logger[_0x4395('0xc')](_0x4395('0xd'),_0x198401,_0x4395('0xe'));_0x336757(_0x1f920a[_0x4395('0x14')]['message']);}})[_0x4395('0x15')](function(_0x5d08e9){logger[_0x4395('0x11')](_0x4395('0xd'),_0x198401,_0x5d08e9);_0xb07e0e(_0x5d08e9);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index e2f449e..627a2ac 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 _0x31f0=['get','/:id','show','/:id/download','isAuthenticated','post','create','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller'];(function(_0x595ceb,_0x55b798){var _0xc20254=function(_0x18463b){while(--_0x18463b){_0x595ceb['push'](_0x595ceb['shift']());}};_0xc20254(++_0x55b798);}(_0x31f0,0xb7));var _0x031f=function(_0x59fa67,_0x291e77){_0x59fa67=_0x59fa67-0x0;var _0x2ee0fe=_0x31f0[_0x59fa67];return _0x2ee0fe;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var auth=require(_0x031f('0x4'));var interaction=require(_0x031f('0x5'));var config=require('../../config/environment');var controller=require(_0x031f('0x6'));router[_0x031f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x031f('0x8'),auth['isAuthenticated'](),controller[_0x031f('0x9')]);router[_0x031f('0x7')](_0x031f('0xa'),auth[_0x031f('0xb')](),controller['download']);router[_0x031f('0xc')]('/',auth[_0x031f('0xb')](),controller[_0x031f('0xd')]);router[_0x031f('0xe')](_0x031f('0x8'),auth[_0x031f('0xb')](),controller[_0x031f('0xf')]);router[_0x031f('0x10')]('/:id',auth[_0x031f('0xb')](),controller[_0x031f('0x11')]);module[_0x031f('0x12')]=router; \ No newline at end of file +var _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','destroy','exports','multer','util'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x814b,0x1a2));var _0xb814=function(_0x134192,_0x36adc5){_0x134192=_0x134192-0x0;var _0x3cd080=_0x814b[_0x134192];return _0x3cd080;};'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 auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 6643112..a0794b7 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 _0xe550=['BLOB','long','TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe550,0x163));var _0x0e55=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe550[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x0e55('0x0')]={'name':{'type':Sequelize[_0x0e55('0x1')],'get':function(_0x457e53){return this[_0x0e55('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x0e55('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x0e55('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x0e55('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x0e55('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x0e55('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x0e55('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x0e55('0x5')](_0x0e55('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x0e55('0x4')],'defaultValue':''},'stamp':{'type':_0x0e55('0x7'),'allowNull':![]}}; \ No newline at end of file +var _0x7224=['sequelize','VIRTUAL','INTEGER','STRING','BLOB','TIMESTAMP'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7224,0x1da));var _0x4722=function(_0x11b36c,_0x4caf31){_0x11b36c=_0x11b36c-0x0;var _0x560cc2=_0x7224[_0x11b36c];return _0x560cc2;};'use strict';var Sequelize=require(_0x4722('0x0'));module['exports']={'name':{'type':Sequelize[_0x4722('0x1')],'get':function(_0xccedb2){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x4722('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x4722('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x4722('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x4722('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x4722('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x4722('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4722('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x4722('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x4722('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 0d224ac..e239829 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 _0x26f9=['destroy','error','stack','name','send','VoiceMailMessage','rawAttributes','type','key','differenceBy','map','query','keys','intersection','model','fields','attributes','length','nolimit','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','params','includeAll','find','create','body','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','html-pdf','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','reject','update','then'];(function(_0x16e5da,_0x2e40f7){var _0x1f2881=function(_0x37b33b){while(--_0x37b33b){_0x16e5da['push'](_0x16e5da['shift']());}};_0x1f2881(++_0x2e40f7);}(_0x26f9,0x16f));var _0x926f=function(_0xe3b7bb,_0x263836){_0xe3b7bb=_0xe3b7bb-0x0;var _0x2df486=_0x26f9[_0xe3b7bb];return _0x2df486;};'use strict';var pdf=require(_0x926f('0x0'));var emlformat=require(_0x926f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x926f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x926f('0x3'));var BPromise=require(_0x926f('0x4'));var Mustache=require('mustache');var util=require(_0x926f('0x5'));var path=require(_0x926f('0x6'));var sox=require(_0x926f('0x7'));var csv=require(_0x926f('0x8'));var ejs=require(_0x926f('0x9'));var fs=require('fs');var _=require(_0x926f('0xa'));var squel=require(_0x926f('0xb'));var crypto=require(_0x926f('0xc'));var jsforce=require(_0x926f('0xd'));var deskjs=require(_0x926f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x926f('0xf'));var Papa=require('papaparse');var Redis=require(_0x926f('0x10'));var authService=require(_0x926f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x926f('0x12'));var hardwareService=require(_0x926f('0x13'));var logger=require(_0x926f('0x14'))(_0x926f('0x15'));var utils=require(_0x926f('0x16'));var config=require('../../config/environment');var db=require(_0x926f('0x17'))['db'];function respondWithStatusCode(_0x291c62,_0x14f316){_0x14f316=_0x14f316||0xcc;return function(_0x1ac8ab){if(_0x1ac8ab){return _0x291c62[_0x926f('0x18')](_0x14f316);}return _0x291c62[_0x926f('0x19')](_0x14f316)[_0x926f('0x1a')]();};}function respondWithResult(_0x539e5d,_0x48ee07){_0x48ee07=_0x48ee07||0xc8;return function(_0x5e6fb1){if(_0x5e6fb1){return _0x539e5d[_0x926f('0x19')](_0x48ee07)[_0x926f('0x1b')](_0x5e6fb1);}};}function respondWithFilteredResult(_0x170ac4,_0x280759){return function(_0x57c87f){if(_0x57c87f){var _0x37035c=_0x57c87f['count'],_0x385fad=_0x280759[_0x926f('0x1c')],_0x5812cb=_0x280759['offset']+_0x280759['limit'],_0x20307b;if(_0x5812cb>=_0x37035c){_0x5812cb=_0x37035c;_0x20307b=0xc8;}else{_0x20307b=0xce;}_0x170ac4[_0x926f('0x19')](_0x20307b);return _0x170ac4[_0x926f('0x1d')]('Content-Range',_0x385fad+'-'+_0x5812cb+'/'+_0x37035c)[_0x926f('0x1b')](_0x57c87f);}return null;};}function patchUpdates(_0x386498){return function(_0x2c0399){try{jsonpatch['apply'](_0x2c0399,_0x386498,!![]);}catch(_0x19a134){return BPromise[_0x926f('0x1e')](_0x19a134);}return _0x2c0399['save']();};}function saveUpdates(_0x2faf7d,_0x4241ac){return function(_0x56fef1){if(_0x56fef1){return _0x56fef1[_0x926f('0x1f')](_0x2faf7d)[_0x926f('0x20')](function(_0x1561ae){return _0x1561ae;});}return null;};}function removeEntity(_0x43a1f1,_0x150430){return function(_0x3b7179){if(_0x3b7179){return _0x3b7179[_0x926f('0x21')]()[_0x926f('0x20')](function(){_0x43a1f1[_0x926f('0x19')](0xcc)[_0x926f('0x1a')]();});}};}function handleEntityNotFound(_0x2be66b,_0x4a93a4){return function(_0x2d76eb){if(!_0x2d76eb){_0x2be66b[_0x926f('0x18')](0x194);}return _0x2d76eb;};}function handleError(_0x53f10c,_0x640fe0){_0x640fe0=_0x640fe0||0x1f4;return function(_0x84bccd){logger[_0x926f('0x22')](_0x84bccd[_0x926f('0x23')]);if(_0x84bccd[_0x926f('0x24')]){delete _0x84bccd[_0x926f('0x24')];}_0x53f10c['status'](_0x640fe0)[_0x926f('0x25')](_0x84bccd);};}exports['index']=function(_0x17e071,_0x37230f){var _0x2a8fff={},_0x3fdfdd={},_0x5def30={'count':0x0,'rows':[]};var _0x367749=_['map'](db[_0x926f('0x26')][_0x926f('0x27')],function(_0x518a47){return{'name':_0x518a47['fieldName'],'type':_0x518a47[_0x926f('0x28')][_0x926f('0x29')]};});_0x3fdfdd['model']=_[_0x926f('0x2a')](_[_0x926f('0x2b')](_0x367749,'name'),['name']);_0x3fdfdd[_0x926f('0x2c')]=_[_0x926f('0x2d')](_0x17e071[_0x926f('0x2c')]);_0x3fdfdd['filters']=_[_0x926f('0x2e')](_0x3fdfdd[_0x926f('0x2f')],_0x3fdfdd[_0x926f('0x2c')]);_0x2a8fff['attributes']=_[_0x926f('0x2e')](_0x3fdfdd[_0x926f('0x2f')],qs[_0x926f('0x30')](_0x17e071[_0x926f('0x2c')][_0x926f('0x30')]));_0x2a8fff[_0x926f('0x31')]=_0x2a8fff['attributes'][_0x926f('0x32')]?_0x2a8fff[_0x926f('0x31')]:_0x3fdfdd[_0x926f('0x2f')];if(!_0x17e071[_0x926f('0x2c')]['hasOwnProperty'](_0x926f('0x33'))){_0x2a8fff[_0x926f('0x34')]=qs[_0x926f('0x34')](_0x17e071[_0x926f('0x2c')][_0x926f('0x34')]);_0x2a8fff[_0x926f('0x1c')]=qs[_0x926f('0x1c')](_0x17e071[_0x926f('0x2c')][_0x926f('0x1c')]);}_0x2a8fff[_0x926f('0x35')]=qs[_0x926f('0x36')](_0x17e071['query'][_0x926f('0x36')]);_0x2a8fff[_0x926f('0x37')]=qs['filters'](_[_0x926f('0x38')](_0x17e071[_0x926f('0x2c')],_0x3fdfdd[_0x926f('0x39')]),_0x367749);if(_0x17e071[_0x926f('0x2c')][_0x926f('0x3a')]){_0x2a8fff[_0x926f('0x37')]=_[_0x926f('0x3b')](_0x2a8fff[_0x926f('0x37')],{'$or':_['map'](_0x367749,function(_0x1ab190){if(_0x1ab190['type']!==_0x926f('0x3c')){var _0x2a19dd={};_0x2a19dd[_0x1ab190[_0x926f('0x24')]]={'$like':'%'+_0x17e071[_0x926f('0x2c')][_0x926f('0x3a')]+'%'};return _0x2a19dd;}})});}_0x2a8fff=_[_0x926f('0x3b')]({},_0x2a8fff,_0x17e071[_0x926f('0x3d')]);var _0x3476a2={'where':_0x2a8fff[_0x926f('0x37')]};return db[_0x926f('0x26')][_0x926f('0x3e')](_0x3476a2)[_0x926f('0x20')](function(_0x15b298){_0x5def30[_0x926f('0x3e')]=_0x15b298;if(_0x17e071[_0x926f('0x2c')]['includeAll']){_0x2a8fff[_0x926f('0x3f')]=[{'all':!![]}];}return db[_0x926f('0x26')][_0x926f('0x40')](_0x2a8fff);})[_0x926f('0x20')](function(_0xf6a0d5){_0x5def30[_0x926f('0x41')]=_0xf6a0d5;return _0x5def30;})[_0x926f('0x20')](respondWithFilteredResult(_0x37230f,_0x2a8fff))[_0x926f('0x42')](handleError(_0x37230f,null));};exports['show']=function(_0x45a726,_0x16a7c9){var _0x2d6cfd={'raw':!![],'where':{'id':_0x45a726[_0x926f('0x43')]['id']}},_0xa1a04c={};_0xa1a04c['model']=_[_0x926f('0x2d')](db[_0x926f('0x26')][_0x926f('0x27')]);_0xa1a04c[_0x926f('0x2c')]=_[_0x926f('0x2d')](_0x45a726['query']);_0xa1a04c[_0x926f('0x39')]=_[_0x926f('0x2e')](_0xa1a04c[_0x926f('0x2f')],_0xa1a04c[_0x926f('0x2c')]);_0x2d6cfd[_0x926f('0x31')]=_['intersection'](_0xa1a04c[_0x926f('0x2f')],qs['fields'](_0x45a726[_0x926f('0x2c')][_0x926f('0x30')]));_0x2d6cfd[_0x926f('0x31')]=_0x2d6cfd[_0x926f('0x31')][_0x926f('0x32')]?_0x2d6cfd[_0x926f('0x31')]:_0xa1a04c[_0x926f('0x2f')];if(_0x45a726['query'][_0x926f('0x44')]){_0x2d6cfd[_0x926f('0x3f')]=[{'all':!![]}];}_0x2d6cfd=_[_0x926f('0x3b')]({},_0x2d6cfd,_0x45a726[_0x926f('0x3d')]);return db[_0x926f('0x26')][_0x926f('0x45')](_0x2d6cfd)[_0x926f('0x20')](handleEntityNotFound(_0x16a7c9,null))[_0x926f('0x20')](respondWithResult(_0x16a7c9,null))[_0x926f('0x42')](handleError(_0x16a7c9,null));};exports[_0x926f('0x46')]=function(_0x5b6f99,_0x351ac6){return db['VoiceMailMessage'][_0x926f('0x46')](_0x5b6f99[_0x926f('0x47')],{})[_0x926f('0x20')](respondWithResult(_0x351ac6,0xc9))[_0x926f('0x42')](handleError(_0x351ac6,null));};exports[_0x926f('0x1f')]=function(_0x5d00aa,_0x1814a1){if(_0x5d00aa[_0x926f('0x47')]['id']){delete _0x5d00aa[_0x926f('0x47')]['id'];}return db[_0x926f('0x26')][_0x926f('0x45')]({'where':{'id':_0x5d00aa['params']['id']}})[_0x926f('0x20')](handleEntityNotFound(_0x1814a1,null))[_0x926f('0x20')](saveUpdates(_0x5d00aa[_0x926f('0x47')],null))[_0x926f('0x20')](respondWithResult(_0x1814a1,null))[_0x926f('0x42')](handleError(_0x1814a1,null));};exports[_0x926f('0x21')]=function(_0x47d007,_0x462fc4){return db['VoiceMailMessage']['find']({'where':{'id':_0x47d007[_0x926f('0x43')]['id']}})[_0x926f('0x20')](handleEntityNotFound(_0x462fc4,null))[_0x926f('0x20')](removeEntity(_0x462fc4,null))[_0x926f('0x42')](handleError(_0x462fc4,null));};exports[_0x926f('0x48')]=function(_0x4b3263,_0x27cc4d,_0x405dd1){return db[_0x926f('0x26')]['find']({'where':{'id':_0x4b3263[_0x926f('0x43')]['id']},'attributes':['id',_0x926f('0x49'),_0x926f('0x4a')]})[_0x926f('0x20')](handleEntityNotFound(_0x27cc4d,null))['then'](function(_0x110f8b){if(_0x110f8b){if(!_0x110f8b['recording']){throw new db[(_0x926f('0x4b'))]['ValidationError'](_0x926f('0x4c'));}var _0x3728ea={'Content-Type':'audio/wav','Content-Disposition':_0x926f('0x4d')};if(_0x110f8b[_0x926f('0x4a')]){_0x3728ea[_0x926f('0x4e')]=_0x926f('0x4f')+_0x110f8b[_0x926f('0x4a')]+'.wav\x22';}_0x27cc4d[_0x926f('0x1d')](_0x3728ea);return _0x27cc4d[_0x926f('0x25')](new Buffer(_0x110f8b[_0x926f('0x49')]));}})[_0x926f('0x42')](handleError(_0x27cc4d,null));}; \ No newline at end of file +var _0x0647=['stack','name','send','index','map','rawAttributes','type','key','model','differenceBy','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','VoiceMailMessage','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','download','msg_id','recording','attachment','Content-Disposition','attachment;\x20filename=\x22','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error'];(function(_0x4e7f7e,_0xef5c04){var _0x1b45af=function(_0x323541){while(--_0x323541){_0x4e7f7e['push'](_0x4e7f7e['shift']());}};_0x1b45af(++_0xef5c04);}(_0x0647,0xd0));var _0x7064=function(_0x16771d,_0x224c60){_0x16771d=_0x16771d-0x0;var _0x386f11=_0x0647[_0x16771d];return _0x386f11;};'use strict';var pdf=require(_0x7064('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7064('0x1'));var zipdir=require(_0x7064('0x2'));var jsonpatch=require(_0x7064('0x3'));var rp=require(_0x7064('0x4'));var moment=require(_0x7064('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7064('0x6'));var path=require(_0x7064('0x7'));var sox=require(_0x7064('0x8'));var csv=require(_0x7064('0x9'));var ejs=require(_0x7064('0xa'));var fs=require('fs');var _=require(_0x7064('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7064('0xc'));var deskjs=require(_0x7064('0xd'));var toCsv=require(_0x7064('0x9'));var querystring=require('querystring');var Papa=require(_0x7064('0xe'));var Redis=require(_0x7064('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7064('0x10'));var as=require(_0x7064('0x11'));var hardwareService=require(_0x7064('0x12'));var logger=require('../../config/logger')(_0x7064('0x13'));var utils=require(_0x7064('0x14'));var config=require(_0x7064('0x15'));var db=require(_0x7064('0x16'))['db'];function respondWithStatusCode(_0x549684,_0x303dcd){_0x303dcd=_0x303dcd||0xcc;return function(_0x4151b6){if(_0x4151b6){return _0x549684[_0x7064('0x17')](_0x303dcd);}return _0x549684[_0x7064('0x18')](_0x303dcd)[_0x7064('0x19')]();};}function respondWithResult(_0x6ad467,_0x265aa6){_0x265aa6=_0x265aa6||0xc8;return function(_0x3badc8){if(_0x3badc8){return _0x6ad467['status'](_0x265aa6)['json'](_0x3badc8);}};}function respondWithFilteredResult(_0x58b369,_0x39f83b){return function(_0x15a1c0){if(_0x15a1c0){var _0x36378c=_0x15a1c0['count'],_0x4b39db=_0x39f83b[_0x7064('0x1a')],_0x22cd86=_0x39f83b[_0x7064('0x1a')]+_0x39f83b[_0x7064('0x1b')],_0x13552d;if(_0x22cd86>=_0x36378c){_0x22cd86=_0x36378c;_0x13552d=0xc8;}else{_0x13552d=0xce;}_0x58b369[_0x7064('0x18')](_0x13552d);return _0x58b369[_0x7064('0x1c')](_0x7064('0x1d'),_0x4b39db+'-'+_0x22cd86+'/'+_0x36378c)[_0x7064('0x1e')](_0x15a1c0);}return null;};}function patchUpdates(_0x3e8d73){return function(_0x2779fd){try{jsonpatch[_0x7064('0x1f')](_0x2779fd,_0x3e8d73,!![]);}catch(_0x3b6ace){return BPromise[_0x7064('0x20')](_0x3b6ace);}return _0x2779fd[_0x7064('0x21')]();};}function saveUpdates(_0x5c9de8,_0x431fac){return function(_0x141983){if(_0x141983){return _0x141983[_0x7064('0x22')](_0x5c9de8)[_0x7064('0x23')](function(_0x5919bd){return _0x5919bd;});}return null;};}function removeEntity(_0x174225,_0x51ae69){return function(_0x446730){if(_0x446730){return _0x446730[_0x7064('0x24')]()['then'](function(){_0x174225[_0x7064('0x18')](0xcc)[_0x7064('0x19')]();});}};}function handleEntityNotFound(_0x1a62a2,_0x464e8a){return function(_0x167149){if(!_0x167149){_0x1a62a2['sendStatus'](0x194);}return _0x167149;};}function handleError(_0x4dbf02,_0x33f470){_0x33f470=_0x33f470||0x1f4;return function(_0x4d424c){logger[_0x7064('0x25')](_0x4d424c[_0x7064('0x26')]);if(_0x4d424c[_0x7064('0x27')]){delete _0x4d424c['name'];}_0x4dbf02[_0x7064('0x18')](_0x33f470)[_0x7064('0x28')](_0x4d424c);};}exports[_0x7064('0x29')]=function(_0x99fa4b,_0x358e67){var _0x57039f={},_0x561186={},_0x4f7313={'count':0x0,'rows':[]};var _0x5e2a06=_[_0x7064('0x2a')](db['VoiceMailMessage'][_0x7064('0x2b')],function(_0x411c32){return{'name':_0x411c32['fieldName'],'type':_0x411c32[_0x7064('0x2c')][_0x7064('0x2d')]};});_0x561186[_0x7064('0x2e')]=_[_0x7064('0x2f')](_[_0x7064('0x2a')](_0x5e2a06,'name'),[_0x7064('0x27')]);_0x561186[_0x7064('0x30')]=_[_0x7064('0x31')](_0x99fa4b[_0x7064('0x30')]);_0x561186['filters']=_['intersection'](_0x561186['model'],_0x561186[_0x7064('0x30')]);_0x57039f['attributes']=_[_0x7064('0x32')](_0x561186[_0x7064('0x2e')],qs['fields'](_0x99fa4b[_0x7064('0x30')][_0x7064('0x33')]));_0x57039f[_0x7064('0x34')]=_0x57039f[_0x7064('0x34')]['length']?_0x57039f['attributes']:_0x561186[_0x7064('0x2e')];if(!_0x99fa4b['query'][_0x7064('0x35')](_0x7064('0x36'))){_0x57039f[_0x7064('0x1b')]=qs['limit'](_0x99fa4b[_0x7064('0x30')][_0x7064('0x1b')]);_0x57039f[_0x7064('0x1a')]=qs[_0x7064('0x1a')](_0x99fa4b['query']['offset']);}_0x57039f[_0x7064('0x37')]=qs[_0x7064('0x38')](_0x99fa4b['query'][_0x7064('0x38')]);_0x57039f[_0x7064('0x39')]=qs[_0x7064('0x3a')](_[_0x7064('0x3b')](_0x99fa4b[_0x7064('0x30')],_0x561186[_0x7064('0x3a')]),_0x5e2a06);if(_0x99fa4b[_0x7064('0x30')][_0x7064('0x3c')]){_0x57039f[_0x7064('0x39')]=_[_0x7064('0x3d')](_0x57039f[_0x7064('0x39')],{'$or':_['map'](_0x5e2a06,function(_0x42082f){if(_0x42082f[_0x7064('0x2c')]!==_0x7064('0x3e')){var _0x1f3def={};_0x1f3def[_0x42082f[_0x7064('0x27')]]={'$like':'%'+_0x99fa4b['query'][_0x7064('0x3c')]+'%'};return _0x1f3def;}})});}_0x57039f=_[_0x7064('0x3d')]({},_0x57039f,_0x99fa4b[_0x7064('0x3f')]);var _0x32a75a={'where':_0x57039f[_0x7064('0x39')]};return db[_0x7064('0x40')]['count'](_0x32a75a)[_0x7064('0x23')](function(_0xa0eef2){_0x4f7313['count']=_0xa0eef2;if(_0x99fa4b[_0x7064('0x30')][_0x7064('0x41')]){_0x57039f[_0x7064('0x42')]=[{'all':!![]}];}return db[_0x7064('0x40')][_0x7064('0x43')](_0x57039f);})[_0x7064('0x23')](function(_0x73d2c0){_0x4f7313[_0x7064('0x44')]=_0x73d2c0;return _0x4f7313;})[_0x7064('0x23')](respondWithFilteredResult(_0x358e67,_0x57039f))[_0x7064('0x45')](handleError(_0x358e67,null));};exports[_0x7064('0x46')]=function(_0x329dfa,_0x243991){var _0x5cb238={'raw':!![],'where':{'id':_0x329dfa[_0x7064('0x47')]['id']}},_0x20e465={};_0x20e465['model']=_[_0x7064('0x31')](db[_0x7064('0x40')][_0x7064('0x2b')]);_0x20e465[_0x7064('0x30')]=_[_0x7064('0x31')](_0x329dfa[_0x7064('0x30')]);_0x20e465['filters']=_['intersection'](_0x20e465[_0x7064('0x2e')],_0x20e465[_0x7064('0x30')]);_0x5cb238['attributes']=_[_0x7064('0x32')](_0x20e465[_0x7064('0x2e')],qs['fields'](_0x329dfa[_0x7064('0x30')]['fields']));_0x5cb238['attributes']=_0x5cb238['attributes'][_0x7064('0x48')]?_0x5cb238[_0x7064('0x34')]:_0x20e465['model'];if(_0x329dfa[_0x7064('0x30')][_0x7064('0x41')]){_0x5cb238['include']=[{'all':!![]}];}_0x5cb238=_[_0x7064('0x3d')]({},_0x5cb238,_0x329dfa[_0x7064('0x3f')]);return db['VoiceMailMessage'][_0x7064('0x49')](_0x5cb238)[_0x7064('0x23')](handleEntityNotFound(_0x243991,null))[_0x7064('0x23')](respondWithResult(_0x243991,null))['catch'](handleError(_0x243991,null));};exports['create']=function(_0x41c8a9,_0x33c00f){return db[_0x7064('0x40')][_0x7064('0x4a')](_0x41c8a9[_0x7064('0x4b')],{})[_0x7064('0x23')](respondWithResult(_0x33c00f,0xc9))[_0x7064('0x45')](handleError(_0x33c00f,null));};exports['update']=function(_0x5b3754,_0x10da37){if(_0x5b3754[_0x7064('0x4b')]['id']){delete _0x5b3754[_0x7064('0x4b')]['id'];}return db[_0x7064('0x40')][_0x7064('0x49')]({'where':{'id':_0x5b3754[_0x7064('0x47')]['id']}})[_0x7064('0x23')](handleEntityNotFound(_0x10da37,null))['then'](saveUpdates(_0x5b3754['body'],null))['then'](respondWithResult(_0x10da37,null))['catch'](handleError(_0x10da37,null));};exports['destroy']=function(_0x4c3b41,_0x4e4759){return db[_0x7064('0x40')]['find']({'where':{'id':_0x4c3b41[_0x7064('0x47')]['id']}})[_0x7064('0x23')](handleEntityNotFound(_0x4e4759,null))[_0x7064('0x23')](removeEntity(_0x4e4759,null))[_0x7064('0x45')](handleError(_0x4e4759,null));};exports[_0x7064('0x4c')]=function(_0x2a51b9,_0x4b43fc,_0x50518f){return db['VoiceMailMessage'][_0x7064('0x49')]({'where':{'id':_0x2a51b9[_0x7064('0x47')]['id']},'attributes':['id','recording',_0x7064('0x4d')]})[_0x7064('0x23')](handleEntityNotFound(_0x4b43fc,null))[_0x7064('0x23')](function(_0x425e31){if(_0x425e31){if(!_0x425e31[_0x7064('0x4e')]){throw new db['Sequelize']['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x339f18={'Content-Type':'audio/wav','Content-Disposition':_0x7064('0x4f')};if(_0x425e31[_0x7064('0x4d')]){_0x339f18[_0x7064('0x50')]=_0x7064('0x51')+_0x425e31[_0x7064('0x4d')]+'.wav\x22';}_0x4b43fc['set'](_0x339f18);return _0x4b43fc[_0x7064('0x28')](new Buffer(_0x425e31['recording']));}})[_0x7064('0x45')](handleError(_0x4b43fc,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index bd80185..7f161c4 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 _0xb98e=['define','voice_voicemail_messages','dir','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMailMessage.attributes'];(function(_0x9d91a,_0x932e7a){var _0x534915=function(_0x18e4f5){while(--_0x18e4f5){_0x9d91a['push'](_0x9d91a['shift']());}};_0x534915(++_0x932e7a);}(_0xb98e,0x184));var _0xeb98=function(_0x2d67b3,_0x117772){_0x2d67b3=_0x2d67b3-0x0;var _0x924080=_0xb98e[_0x2d67b3];return _0x924080;};'use strict';var _=require(_0xeb98('0x0'));var util=require(_0xeb98('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeb98('0x2'));var BPromise=require(_0xeb98('0x3'));var rp=require(_0xeb98('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb98('0x5'));var config=require(_0xeb98('0x6'));var attributes=require(_0xeb98('0x7'));module['exports']=function(_0x33a16e,_0x5d12df){return _0x33a16e[_0xeb98('0x8')]('VoiceMailMessage',attributes,{'tableName':_0xeb98('0x9'),'paranoid':![],'indexes':[{'name':_0xeb98('0xa'),'fields':[_0xeb98('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xd48a=['bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment'];(function(_0x414810,_0x5e924d){var _0x2d4df5=function(_0x390860){while(--_0x390860){_0x414810['push'](_0x414810['shift']());}};_0x2d4df5(++_0x5e924d);}(_0xd48a,0x96));var _0xad48=function(_0x46a837,_0x3ff850){_0x46a837=_0x46a837-0x0;var _0x4f20d5=_0xd48a[_0x46a837];return _0x4f20d5;};'use strict';var _=require(_0xad48('0x0'));var util=require('util');var logger=require(_0xad48('0x1'))(_0xad48('0x2'));var moment=require(_0xad48('0x3'));var BPromise=require(_0xad48('0x4'));var rp=require(_0xad48('0x5'));var fs=require('fs');var path=require(_0xad48('0x6'));var rimraf=require('rimraf');var config=require(_0xad48('0x7'));var attributes=require(_0xad48('0x8'));module['exports']=function(_0x143780,_0x584cf0){return _0x143780['define']('VoiceMailMessage',attributes,{'tableName':_0xad48('0x9'),'paranoid':![],'indexes':[{'name':_0xad48('0xa'),'fields':[_0xad48('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 0f16e0d..852933c 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 _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x3e664a,_0x503dc0){var _0x57d5f4=function(_0x110f62){while(--_0x110f62){_0x3e664a['push'](_0x3e664a['shift']());}};_0x57d5f4(++_0x503dc0);}(_0x14a0,0x8e));var _0x014a=function(_0x14417f,_0x5f0beb){_0x14417f=_0x14417f-0x0;var _0x10c26d=_0x14a0[_0x14417f];return _0x10c26d;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','VoiceMailMessage,\x20%s,\x20%s','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x598f9c,_0x2527a9){var _0x593fdd=function(_0x432fb8){while(--_0x432fb8){_0x598f9c['push'](_0x598f9c['shift']());}};_0x593fdd(++_0x2527a9);}(_0x2ef3,0xba));var _0x32ef=function(_0x2e4114,_0xd95263){_0x2e4114=_0x2e4114-0x0;var _0xa46b9c=_0x2ef3[_0x2e4114];return _0xa46b9c;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 2fac0c8..a9d4035 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 _0x71b4=['destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','show','post','create','/:id/sounds','addSound','put','/:id'];(function(_0x58b6c7,_0x3bf35e){var _0x5f50d0=function(_0x532e10){while(--_0x532e10){_0x58b6c7['push'](_0x58b6c7['shift']());}};_0x5f50d0(++_0x3bf35e);}(_0x71b4,0x1a9));var _0x471b=function(_0x8744bf,_0x454070){_0x8744bf=_0x8744bf-0x0;var _0x21d688=_0x71b4[_0x8744bf];return _0x21d688;};'use strict';var multer=require(_0x471b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x471b('0x1'));var router=express[_0x471b('0x2')]();var auth=require(_0x471b('0x3'));var interaction=require(_0x471b('0x4'));var config=require(_0x471b('0x5'));var controller=require(_0x471b('0x6'));router[_0x471b('0x7')]('/',auth[_0x471b('0x8')](),controller['index']);router[_0x471b('0x7')]('/:id',auth[_0x471b('0x8')](),controller[_0x471b('0x9')]);router[_0x471b('0x7')]('/:id/sounds',auth[_0x471b('0x8')](),controller['getSounds']);router[_0x471b('0xa')]('/',auth[_0x471b('0x8')](),controller[_0x471b('0xb')]);router[_0x471b('0xa')](_0x471b('0xc'),auth['isAuthenticated'](),controller[_0x471b('0xd')]);router[_0x471b('0xe')]('/:id',auth[_0x471b('0x8')](),controller['update']);router['delete'](_0x471b('0xf'),auth[_0x471b('0x8')](),controller[_0x471b('0x10')]);router[_0x471b('0x11')](_0x471b('0x12'),auth['isAuthenticated'](),controller[_0x471b('0x13')]);module[_0x471b('0x14')]=router; \ No newline at end of file +var _0xe503=['../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','/:id/sounds','getSounds','post','create','addSound','put','update','delete','/:id/sounds/:id2','removeSound','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x2657fa,_0x12be80){var _0x1962b7=function(_0xcccd5a){while(--_0xcccd5a){_0x2657fa['push'](_0x2657fa['shift']());}};_0x1962b7(++_0x12be80);}(_0xe503,0x179));var _0x3e50=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xe503[_0x39d544];return _0x5a5ff2;};'use strict';var multer=require(_0x3e50('0x0'));var util=require(_0x3e50('0x1'));var path=require(_0x3e50('0x2'));var timeout=require(_0x3e50('0x3'));var express=require(_0x3e50('0x4'));var router=express[_0x3e50('0x5')]();var auth=require(_0x3e50('0x6'));var interaction=require(_0x3e50('0x7'));var config=require(_0x3e50('0x8'));var controller=require(_0x3e50('0x9'));router['get']('/',auth[_0x3e50('0xa')](),controller[_0x3e50('0xb')]);router[_0x3e50('0xc')](_0x3e50('0xd'),auth[_0x3e50('0xa')](),controller['show']);router[_0x3e50('0xc')](_0x3e50('0xe'),auth[_0x3e50('0xa')](),controller[_0x3e50('0xf')]);router[_0x3e50('0x10')]('/',auth[_0x3e50('0xa')](),controller[_0x3e50('0x11')]);router['post']('/:id/sounds',auth['isAuthenticated'](),controller[_0x3e50('0x12')]);router[_0x3e50('0x13')]('/:id',auth[_0x3e50('0xa')](),controller[_0x3e50('0x14')]);router[_0x3e50('0x15')](_0x3e50('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x3e50('0x15')](_0x3e50('0x16'),auth[_0x3e50('0xa')](),controller[_0x3e50('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 44530dd..9c8a69d 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 _0x9956=['STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name','ENUM','custom','files','quietmp3nb','quietmp3','mp3'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9956,0x1b1));var _0x6995=function(_0x1cccc2,_0x39b863){_0x1cccc2=_0x1cccc2-0x0;var _0x3f295e=_0x9956[_0x1cccc2];return _0x3f295e;};'use strict';var Sequelize=require(_0x6995('0x0'));module[_0x6995('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6995('0x2')},'mode':{'type':Sequelize[_0x6995('0x3')](_0x6995('0x4'),_0x6995('0x5'),'mp3nb',_0x6995('0x6'),_0x6995('0x7'),_0x6995('0x8')),'allowNull':!![],'defaultValue':_0x6995('0x5')},'directory':{'type':Sequelize[_0x6995('0x9')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x6995('0x9')],'allowNull':!![],'defaultValue':_0x6995('0xa')},'format':{'type':Sequelize[_0x6995('0x9')],'allowNull':!![]},'stamp':{'type':_0x6995('0xb')},'defaultEntry':{'type':Sequelize[_0x6995('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0d79=['mp3nb','quietmp3nb','quietmp3','alpha','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM','custom','files'];(function(_0x3dcbe5,_0xf148be){var _0xb24d5d=function(_0x54d13a){while(--_0x54d13a){_0x3dcbe5['push'](_0x3dcbe5['shift']());}};_0xb24d5d(++_0xf148be);}(_0x0d79,0x7e));var _0x90d7=function(_0x128a40,_0x546c18){_0x128a40=_0x128a40-0x0;var _0x1359d4=_0x0d79[_0x128a40];return _0x1359d4;};'use strict';var Sequelize=require(_0x90d7('0x0'));module['exports']={'name':{'type':Sequelize[_0x90d7('0x1')],'allowNull':![],'unique':_0x90d7('0x2')},'mode':{'type':Sequelize[_0x90d7('0x3')](_0x90d7('0x4'),_0x90d7('0x5'),_0x90d7('0x6'),_0x90d7('0x7'),_0x90d7('0x8'),'mp3'),'allowNull':!![],'defaultValue':_0x90d7('0x5')},'directory':{'type':Sequelize[_0x90d7('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x90d7('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x90d7('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x90d7('0x1')],'allowNull':!![],'defaultValue':_0x90d7('0x9')},'format':{'type':Sequelize[_0x90d7('0x1')],'allowNull':!![]},'stamp':{'type':_0x90d7('0xa')},'defaultEntry':{'type':Sequelize[_0x90d7('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 41160e3..f650b3d 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 _0xb10b=['stack','name','send','VoiceMusicOnHold','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','findOne','converted_format','createdAt','server/files/sounds/converted','format','basename','save_name','extname','%s.%s','Sequelize','removeSound','Sound','getSounds','rawAttributes','pick','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','error'];(function(_0x17a4b8,_0x2dda92){var _0x401821=function(_0x42bfd0){while(--_0x42bfd0){_0x17a4b8['push'](_0x17a4b8['shift']());}};_0x401821(++_0x2dda92);}(_0xb10b,0x12a));var _0xbb10=function(_0x152a03,_0x41a4fe){_0x152a03=_0x152a03-0x0;var _0x3ccbd0=_0xb10b[_0x152a03];return _0x3ccbd0;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){var _0x317da4=_0x8e2b97[_0xbb10('0x25')]({'plain':!![]});var _0x1824b7=_0xbb10('0x26');return db[_0xbb10('0x27')][_0xbb10('0x24')]({'where':{'type':_0x1824b7,'resourceId':_0x317da4['id']}})[_0xbb10('0x23')](function(){return _0x8e2b97;});})[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(!_0xc93a04){_0x4fedac[_0xbb10('0x18')](0x194);}return _0xc93a04;};}function handleError(_0x2c89b9,_0x4e25ff){_0x4e25ff=_0x4e25ff||0x1f4;return function(_0x2fdde9){logger[_0xbb10('0x28')](_0x2fdde9[_0xbb10('0x29')]);if(_0x2fdde9[_0xbb10('0x2a')]){delete _0x2fdde9[_0xbb10('0x2a')];}_0x2c89b9[_0xbb10('0x19')](_0x4e25ff)[_0xbb10('0x2b')](_0x2fdde9);};}exports['index']=function(_0x3796c7,_0x21ac54){var _0xfc3595={},_0x2e0249={},_0x1d30aa={'count':0x0,'rows':[]};var _0x2ff4c1=_['map'](db[_0xbb10('0x2c')]['rawAttributes'],function(_0x448d5c){return{'name':_0x448d5c['fieldName'],'type':_0x448d5c[_0xbb10('0x2d')][_0xbb10('0x2e')]};});_0x2e0249[_0xbb10('0x2f')]=_['map'](_0x2ff4c1,'name');_0x2e0249[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x3796c7['query']);_0x2e0249[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],_0x2e0249[_0xbb10('0x30')]);_0xfc3595[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],qs['fields'](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x35')]));_0xfc3595[_0xbb10('0x34')]=_0xfc3595[_0xbb10('0x34')][_0xbb10('0x36')]?_0xfc3595[_0xbb10('0x34')]:_0x2e0249[_0xbb10('0x2f')];if(!_0x3796c7[_0xbb10('0x30')][_0xbb10('0x37')]('nolimit')){_0xfc3595[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x1e')]);_0xfc3595['offset']=qs[_0xbb10('0x1d')](_0x3796c7['query']['offset']);}_0xfc3595[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x39')]);_0xfc3595[_0xbb10('0x3a')]=qs[_0xbb10('0x32')](_['pick'](_0x3796c7[_0xbb10('0x30')],_0x2e0249[_0xbb10('0x32')]),_0x2ff4c1);if(_0x3796c7['query']['filter']){_0xfc3595['where']=_[_0xbb10('0x3b')](_0xfc3595[_0xbb10('0x3a')],{'$or':_[_0xbb10('0x3c')](_0x2ff4c1,function(_0x4d5a9b){if(_0x4d5a9b[_0xbb10('0x2d')]!==_0xbb10('0x3d')){var _0x4345f3={};_0x4345f3[_0x4d5a9b['name']]={'$like':'%'+_0x3796c7[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4345f3;}})});}_0xfc3595=_[_0xbb10('0x3b')]({},_0xfc3595,_0x3796c7[_0xbb10('0x3f')]);var _0x4f1cdd={'where':_0xfc3595[_0xbb10('0x3a')]};return db[_0xbb10('0x2c')]['count'](_0x4f1cdd)[_0xbb10('0x23')](function(_0x2e3214){_0x1d30aa[_0xbb10('0x1c')]=_0x2e3214;if(_0x3796c7[_0xbb10('0x30')][_0xbb10('0x40')]){_0xfc3595[_0xbb10('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xbb10('0x42')](_0xfc3595);})[_0xbb10('0x23')](function(_0x3e7b4c){_0x1d30aa[_0xbb10('0x43')]=_0x3e7b4c;return _0x1d30aa;})['then'](respondWithFilteredResult(_0x21ac54,_0xfc3595))[_0xbb10('0x44')](handleError(_0x21ac54,null));};exports[_0xbb10('0x45')]=function(_0x23dc18,_0x403beb){var _0x5e2cfa={'raw':![],'where':{'id':_0x23dc18[_0xbb10('0x46')]['id']}},_0x351484={};_0x351484['model']=_['keys'](db[_0xbb10('0x2c')]['rawAttributes']);_0x351484[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x23dc18['query']);_0x351484[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],_0x351484['query']);_0x5e2cfa[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],qs[_0xbb10('0x35')](_0x23dc18[_0xbb10('0x30')][_0xbb10('0x35')]));_0x5e2cfa[_0xbb10('0x34')]=_0x5e2cfa[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5e2cfa[_0xbb10('0x34')]:_0x351484[_0xbb10('0x2f')];if(_0x23dc18[_0xbb10('0x30')]['includeAll']){_0x5e2cfa[_0xbb10('0x41')]=[{'all':!![]}];}_0x5e2cfa=_[_0xbb10('0x3b')]({},_0x5e2cfa,_0x23dc18['options']);return db[_0xbb10('0x2c')][_0xbb10('0x47')](_0x5e2cfa)[_0xbb10('0x23')](handleEntityNotFound(_0x403beb,null))[_0xbb10('0x23')](respondWithResult(_0x403beb,null))[_0xbb10('0x44')](handleError(_0x403beb,null));};exports[_0xbb10('0x48')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x44')](handleError(_0x5be85e,null));};exports[_0xbb10('0x4a')]=function(_0x22b315,_0x2f2552,_0x460788){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x550111){if(_0x22b315['body'][_0xbb10('0x4d')]===_0xbb10('0x4e')){_0x22b315[_0xbb10('0x49')][_0xbb10('0x4f')]=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x52'),_0x22b315[_0xbb10('0x49')][_0xbb10('0x2a')]);}return db[_0xbb10('0x2c')][_0xbb10('0x4a')](_0x22b315[_0xbb10('0x49')],{'transaction':_0x550111})[_0xbb10('0x23')](function(_0x2e6fd9){if(_0x22b315[_0xbb10('0x49')]['mode']===_0xbb10('0x4e')){fs['mkdirSync'](_0x2e6fd9[_0xbb10('0x4f')],parseInt(_0xbb10('0x53'),0x8));}var _0x1ffe20=_0x22b315[_0xbb10('0x54')][_0xbb10('0x25')]({'plain':!![]});if(!_0x1ffe20)throw new Error(_0xbb10('0x55'));if(_0x1ffe20[_0xbb10('0x56')]===_0xbb10('0x54')){var _0x180400=_0x2e6fd9[_0xbb10('0x25')]({'plain':!![]});return db[_0xbb10('0x57')][_0xbb10('0x47')]({'where':{'name':_0xbb10('0x26'),'userProfileId':_0x1ffe20[_0xbb10('0x58')]},'raw':!![]})[_0xbb10('0x23')](function(_0x5de0cc){if(_0x5de0cc&&_0x5de0cc[_0xbb10('0x59')]===0x0){return db[_0xbb10('0x27')][_0xbb10('0x4a')]({'name':_0x180400[_0xbb10('0x2a')],'resourceId':_0x180400['id'],'type':_0x5de0cc[_0xbb10('0x2a')],'sectionId':_0x5de0cc['id']},{})[_0xbb10('0x23')](function(){return _0x2e6fd9;});}else{return _0x2e6fd9;}})['catch'](function(_0x120bda){logger[_0xbb10('0x28')](_0xbb10('0x5a'),_0x120bda);});}return _0x2e6fd9;});})[_0xbb10('0x23')](respondWithResult(_0x2f2552,0xc9))[_0xbb10('0x44')](handleError(_0x2f2552,null));};exports[_0xbb10('0x24')]=function(_0x175872,_0x12ec18,_0x205e01){var _0x40c4fb;return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x175872[_0xbb10('0x46')]['id']}})['then'](function(_0x4ea1a6){if(_0x4ea1a6){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x3d0cb7){return _0x4ea1a6[_0xbb10('0x24')]({'transaction':_0x3d0cb7,'raw':!![]})['then'](function(_0x506498){if(_0x506498[_0xbb10('0x4f')]){fs[_0xbb10('0x5b')](_0x506498[_0xbb10('0x4f')])[_0xbb10('0x5c')](function(_0x412f13){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x506498['directory'],_0x412f13));});fs[_0xbb10('0x5e')](_0x506498[_0xbb10('0x4f')]);}return _0x506498;});})['catch'](function(_0x5e03cb){throw new db['Sequelize'][(_0xbb10('0x5f'))](_0x5e03cb[_0xbb10('0x60')]);});}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))['then'](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['addSound']=function(_0x3ebc5f,_0x249b33,_0x45167a){return db['sequelize'][_0xbb10('0x4c')](function(_0x13131c){var _0x5a6538;return db['VoiceMusicOnHold'][_0xbb10('0x47')]({'where':{'id':_0x3ebc5f[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x5a6538=_0x237246;return _0x237246['addSound'](_0x3ebc5f[_0xbb10('0x49')]['id'],{'transaction':_0x13131c});}})[_0xbb10('0x23')](function(_0xa7179d){if(_0xa7179d){return db['Sound'][_0xbb10('0x61')]({'where':{'id':_0x3ebc5f[_0xbb10('0x49')]['id']},'attributes':['id',_0xbb10('0x2a'),'save_name',_0xbb10('0x62'),_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x37b65f){if(_0x37b65f){var _0x5e4a6e=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x64'),util[_0xbb10('0x65')]('%s.%s',path[_0xbb10('0x66')](_0x37b65f[_0xbb10('0x67')],path[_0xbb10('0x68')](_0x37b65f[_0xbb10('0x67')])),_0x37b65f[_0xbb10('0x62')]));var _0x17807e=path[_0xbb10('0x50')](config['root'],'server/files/moh',_0x5a6538['name'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x37b65f[_0xbb10('0x2a')],_0x37b65f['converted_format']));fs['symlinkSync'](_0x5e4a6e,_0x17807e);return _0x37b65f;}})[_0xbb10('0x44')](function(_0x1b11c0){throw new db[(_0xbb10('0x6a'))][(_0xbb10('0x5f'))](_0x1b11c0[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x249b33,null))['then'](respondWithResult(_0x249b33,0xc9))[_0xbb10('0x44')](handleError(_0x249b33,null));};exports[_0xbb10('0x6b')]=function(_0x270fdb,_0x14f16b,_0x2aaaa6){return db['sequelize']['transaction'](function(_0x5ad6ad){var _0x329da7;return db[_0xbb10('0x2c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](function(_0x5d942d){if(_0x5d942d){_0x329da7=_0x5d942d;return _0x5d942d[_0xbb10('0x6b')](_0x270fdb['params']['id2']);}})['then'](function(_0xdf634f){if(_0xdf634f){return db[_0xbb10('0x6c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id2']},'attributes':['id',_0xbb10('0x2a'),'save_name','converted_format',_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x29529c){if(_0x29529c){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x329da7['directory'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x29529c[_0xbb10('0x2a')],_0x29529c[_0xbb10('0x62')])));return _0x29529c;}})[_0xbb10('0x44')](function(_0x27f42f){throw new db[(_0xbb10('0x6a'))]['ValidationError'](_0x27f42f[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](respondWithStatusCode(_0x14f16b,0xcc))[_0xbb10('0x44')](handleError(_0x14f16b,null));};exports[_0xbb10('0x6d')]=function(_0x172be3,_0xa3b23,_0x312a08){var _0x5a4429={};var _0x428146={};var _0x218690;var _0x145baf;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x172be3['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0xa3b23,null))['then'](function(_0x4e3d6a){if(_0x4e3d6a){_0x218690=_0x4e3d6a;_0x428146[_0xbb10('0x2f')]=_[_0xbb10('0x31')](db[_0xbb10('0x6c')][_0xbb10('0x6e')]);_0x428146[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x172be3[_0xbb10('0x30')]);_0x428146[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x428146['model'],_0x428146[_0xbb10('0x30')]);_0x5a4429[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x428146[_0xbb10('0x2f')],qs['fields'](_0x172be3['query'][_0xbb10('0x35')]));_0x5a4429[_0xbb10('0x34')]=_0x5a4429[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5a4429['attributes']:_0x428146[_0xbb10('0x2f')];_0x5a4429[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x39')]);_0x5a4429['where']=qs['filters'](_[_0xbb10('0x6f')](_0x172be3[_0xbb10('0x30')],_0x428146[_0xbb10('0x32')]));if(_0x172be3['query'][_0xbb10('0x3e')]){_0x5a4429[_0xbb10('0x3a')]=_['merge'](_0x5a4429['where'],{'$or':_[_0xbb10('0x3c')](_0x5a4429[_0xbb10('0x34')],function(_0x177f77){var _0x4d64ff={};_0x4d64ff[_0x177f77]={'$like':'%'+_0x172be3[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4d64ff;})});}_0x5a4429=_[_0xbb10('0x3b')]({},_0x5a4429,_0x172be3[_0xbb10('0x3f')]);return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x45bd4e){if(_0x45bd4e){_0x145baf=_0x45bd4e[_0xbb10('0x36')];if(!_0x172be3[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x70'))){_0x5a4429[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x5a4429[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1d')]);}return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x2a4278){if(_0x2a4278){return _0x2a4278?{'count':_0x145baf,'rows':_0x2a4278}:null;}})['then'](respondWithResult(_0xa3b23,null))['catch'](handleError(_0xa3b23,null));}; \ No newline at end of file +var _0xb10b=['stack','name','send','VoiceMusicOnHold','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','update','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','ValidationError','message','findOne','converted_format','createdAt','server/files/sounds/converted','format','basename','save_name','extname','%s.%s','Sequelize','removeSound','Sound','getSounds','rawAttributes','pick','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','get','MusicOnHolds','UserProfileResource','error'];(function(_0x1498a7,_0x89ed62){var _0x5edaaa=function(_0x4fc380){while(--_0x4fc380){_0x1498a7['push'](_0x1498a7['shift']());}};_0x5edaaa(++_0x89ed62);}(_0xb10b,0x12a));var _0xbb10=function(_0xeb7891,_0x4771f7){_0xeb7891=_0xeb7891-0x0;var _0x11cc19=_0xb10b[_0xeb7891];return _0x11cc19;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){var _0x317da4=_0x8e2b97[_0xbb10('0x25')]({'plain':!![]});var _0x1824b7=_0xbb10('0x26');return db[_0xbb10('0x27')][_0xbb10('0x24')]({'where':{'type':_0x1824b7,'resourceId':_0x317da4['id']}})[_0xbb10('0x23')](function(){return _0x8e2b97;});})[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(!_0xc93a04){_0x4fedac[_0xbb10('0x18')](0x194);}return _0xc93a04;};}function handleError(_0x2c89b9,_0x4e25ff){_0x4e25ff=_0x4e25ff||0x1f4;return function(_0x2fdde9){logger[_0xbb10('0x28')](_0x2fdde9[_0xbb10('0x29')]);if(_0x2fdde9[_0xbb10('0x2a')]){delete _0x2fdde9[_0xbb10('0x2a')];}_0x2c89b9[_0xbb10('0x19')](_0x4e25ff)[_0xbb10('0x2b')](_0x2fdde9);};}exports['index']=function(_0x3796c7,_0x21ac54){var _0xfc3595={},_0x2e0249={},_0x1d30aa={'count':0x0,'rows':[]};var _0x2ff4c1=_['map'](db[_0xbb10('0x2c')]['rawAttributes'],function(_0x448d5c){return{'name':_0x448d5c['fieldName'],'type':_0x448d5c[_0xbb10('0x2d')][_0xbb10('0x2e')]};});_0x2e0249[_0xbb10('0x2f')]=_['map'](_0x2ff4c1,'name');_0x2e0249[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x3796c7['query']);_0x2e0249[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],_0x2e0249[_0xbb10('0x30')]);_0xfc3595[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x2e0249[_0xbb10('0x2f')],qs['fields'](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x35')]));_0xfc3595[_0xbb10('0x34')]=_0xfc3595[_0xbb10('0x34')][_0xbb10('0x36')]?_0xfc3595[_0xbb10('0x34')]:_0x2e0249[_0xbb10('0x2f')];if(!_0x3796c7[_0xbb10('0x30')][_0xbb10('0x37')]('nolimit')){_0xfc3595[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x1e')]);_0xfc3595['offset']=qs[_0xbb10('0x1d')](_0x3796c7['query']['offset']);}_0xfc3595[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x3796c7[_0xbb10('0x30')][_0xbb10('0x39')]);_0xfc3595[_0xbb10('0x3a')]=qs[_0xbb10('0x32')](_['pick'](_0x3796c7[_0xbb10('0x30')],_0x2e0249[_0xbb10('0x32')]),_0x2ff4c1);if(_0x3796c7['query']['filter']){_0xfc3595['where']=_[_0xbb10('0x3b')](_0xfc3595[_0xbb10('0x3a')],{'$or':_[_0xbb10('0x3c')](_0x2ff4c1,function(_0x4d5a9b){if(_0x4d5a9b[_0xbb10('0x2d')]!==_0xbb10('0x3d')){var _0x4345f3={};_0x4345f3[_0x4d5a9b['name']]={'$like':'%'+_0x3796c7[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4345f3;}})});}_0xfc3595=_[_0xbb10('0x3b')]({},_0xfc3595,_0x3796c7[_0xbb10('0x3f')]);var _0x4f1cdd={'where':_0xfc3595[_0xbb10('0x3a')]};return db[_0xbb10('0x2c')]['count'](_0x4f1cdd)[_0xbb10('0x23')](function(_0x2e3214){_0x1d30aa[_0xbb10('0x1c')]=_0x2e3214;if(_0x3796c7[_0xbb10('0x30')][_0xbb10('0x40')]){_0xfc3595[_0xbb10('0x41')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xbb10('0x42')](_0xfc3595);})[_0xbb10('0x23')](function(_0x3e7b4c){_0x1d30aa[_0xbb10('0x43')]=_0x3e7b4c;return _0x1d30aa;})['then'](respondWithFilteredResult(_0x21ac54,_0xfc3595))[_0xbb10('0x44')](handleError(_0x21ac54,null));};exports[_0xbb10('0x45')]=function(_0x23dc18,_0x403beb){var _0x5e2cfa={'raw':![],'where':{'id':_0x23dc18[_0xbb10('0x46')]['id']}},_0x351484={};_0x351484['model']=_['keys'](db[_0xbb10('0x2c')]['rawAttributes']);_0x351484[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x23dc18['query']);_0x351484[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],_0x351484['query']);_0x5e2cfa[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x351484[_0xbb10('0x2f')],qs[_0xbb10('0x35')](_0x23dc18[_0xbb10('0x30')][_0xbb10('0x35')]));_0x5e2cfa[_0xbb10('0x34')]=_0x5e2cfa[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5e2cfa[_0xbb10('0x34')]:_0x351484[_0xbb10('0x2f')];if(_0x23dc18[_0xbb10('0x30')]['includeAll']){_0x5e2cfa[_0xbb10('0x41')]=[{'all':!![]}];}_0x5e2cfa=_[_0xbb10('0x3b')]({},_0x5e2cfa,_0x23dc18['options']);return db[_0xbb10('0x2c')][_0xbb10('0x47')](_0x5e2cfa)[_0xbb10('0x23')](handleEntityNotFound(_0x403beb,null))[_0xbb10('0x23')](respondWithResult(_0x403beb,null))[_0xbb10('0x44')](handleError(_0x403beb,null));};exports[_0xbb10('0x48')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x49')]['id'];}return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x44')](handleError(_0x5be85e,null));};exports[_0xbb10('0x4a')]=function(_0x22b315,_0x2f2552,_0x460788){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x550111){if(_0x22b315['body'][_0xbb10('0x4d')]===_0xbb10('0x4e')){_0x22b315[_0xbb10('0x49')][_0xbb10('0x4f')]=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x52'),_0x22b315[_0xbb10('0x49')][_0xbb10('0x2a')]);}return db[_0xbb10('0x2c')][_0xbb10('0x4a')](_0x22b315[_0xbb10('0x49')],{'transaction':_0x550111})[_0xbb10('0x23')](function(_0x2e6fd9){if(_0x22b315[_0xbb10('0x49')]['mode']===_0xbb10('0x4e')){fs['mkdirSync'](_0x2e6fd9[_0xbb10('0x4f')],parseInt(_0xbb10('0x53'),0x8));}var _0x1ffe20=_0x22b315[_0xbb10('0x54')][_0xbb10('0x25')]({'plain':!![]});if(!_0x1ffe20)throw new Error(_0xbb10('0x55'));if(_0x1ffe20[_0xbb10('0x56')]===_0xbb10('0x54')){var _0x180400=_0x2e6fd9[_0xbb10('0x25')]({'plain':!![]});return db[_0xbb10('0x57')][_0xbb10('0x47')]({'where':{'name':_0xbb10('0x26'),'userProfileId':_0x1ffe20[_0xbb10('0x58')]},'raw':!![]})[_0xbb10('0x23')](function(_0x5de0cc){if(_0x5de0cc&&_0x5de0cc[_0xbb10('0x59')]===0x0){return db[_0xbb10('0x27')][_0xbb10('0x4a')]({'name':_0x180400[_0xbb10('0x2a')],'resourceId':_0x180400['id'],'type':_0x5de0cc[_0xbb10('0x2a')],'sectionId':_0x5de0cc['id']},{})[_0xbb10('0x23')](function(){return _0x2e6fd9;});}else{return _0x2e6fd9;}})['catch'](function(_0x120bda){logger[_0xbb10('0x28')](_0xbb10('0x5a'),_0x120bda);});}return _0x2e6fd9;});})[_0xbb10('0x23')](respondWithResult(_0x2f2552,0xc9))[_0xbb10('0x44')](handleError(_0x2f2552,null));};exports[_0xbb10('0x24')]=function(_0x175872,_0x12ec18,_0x205e01){var _0x40c4fb;return db[_0xbb10('0x2c')][_0xbb10('0x47')]({'where':{'id':_0x175872[_0xbb10('0x46')]['id']}})['then'](function(_0x4ea1a6){if(_0x4ea1a6){return db[_0xbb10('0x4b')][_0xbb10('0x4c')](function(_0x3d0cb7){return _0x4ea1a6[_0xbb10('0x24')]({'transaction':_0x3d0cb7,'raw':!![]})['then'](function(_0x506498){if(_0x506498[_0xbb10('0x4f')]){fs[_0xbb10('0x5b')](_0x506498[_0xbb10('0x4f')])[_0xbb10('0x5c')](function(_0x412f13){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x506498['directory'],_0x412f13));});fs[_0xbb10('0x5e')](_0x506498[_0xbb10('0x4f')]);}return _0x506498;});})['catch'](function(_0x5e03cb){throw new db['Sequelize'][(_0xbb10('0x5f'))](_0x5e03cb[_0xbb10('0x60')]);});}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))['then'](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['addSound']=function(_0x3ebc5f,_0x249b33,_0x45167a){return db['sequelize'][_0xbb10('0x4c')](function(_0x13131c){var _0x5a6538;return db['VoiceMusicOnHold'][_0xbb10('0x47')]({'where':{'id':_0x3ebc5f[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x5a6538=_0x237246;return _0x237246['addSound'](_0x3ebc5f[_0xbb10('0x49')]['id'],{'transaction':_0x13131c});}})[_0xbb10('0x23')](function(_0xa7179d){if(_0xa7179d){return db['Sound'][_0xbb10('0x61')]({'where':{'id':_0x3ebc5f[_0xbb10('0x49')]['id']},'attributes':['id',_0xbb10('0x2a'),'save_name',_0xbb10('0x62'),_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x37b65f){if(_0x37b65f){var _0x5e4a6e=path[_0xbb10('0x50')](config[_0xbb10('0x51')],_0xbb10('0x64'),util[_0xbb10('0x65')]('%s.%s',path[_0xbb10('0x66')](_0x37b65f[_0xbb10('0x67')],path[_0xbb10('0x68')](_0x37b65f[_0xbb10('0x67')])),_0x37b65f[_0xbb10('0x62')]));var _0x17807e=path[_0xbb10('0x50')](config['root'],'server/files/moh',_0x5a6538['name'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x37b65f[_0xbb10('0x2a')],_0x37b65f['converted_format']));fs['symlinkSync'](_0x5e4a6e,_0x17807e);return _0x37b65f;}})[_0xbb10('0x44')](function(_0x1b11c0){throw new db[(_0xbb10('0x6a'))][(_0xbb10('0x5f'))](_0x1b11c0[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x249b33,null))['then'](respondWithResult(_0x249b33,0xc9))[_0xbb10('0x44')](handleError(_0x249b33,null));};exports[_0xbb10('0x6b')]=function(_0x270fdb,_0x14f16b,_0x2aaaa6){return db['sequelize']['transaction'](function(_0x5ad6ad){var _0x329da7;return db[_0xbb10('0x2c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](function(_0x5d942d){if(_0x5d942d){_0x329da7=_0x5d942d;return _0x5d942d[_0xbb10('0x6b')](_0x270fdb['params']['id2']);}})['then'](function(_0xdf634f){if(_0xdf634f){return db[_0xbb10('0x6c')][_0xbb10('0x61')]({'where':{'id':_0x270fdb[_0xbb10('0x46')]['id2']},'attributes':['id',_0xbb10('0x2a'),'save_name','converted_format',_0xbb10('0x63')],'raw':!![]});}})[_0xbb10('0x23')](function(_0x29529c){if(_0x29529c){fs[_0xbb10('0x5d')](path[_0xbb10('0x50')](_0x329da7['directory'],util[_0xbb10('0x65')](_0xbb10('0x69'),_0x29529c[_0xbb10('0x2a')],_0x29529c[_0xbb10('0x62')])));return _0x29529c;}})[_0xbb10('0x44')](function(_0x27f42f){throw new db[(_0xbb10('0x6a'))]['ValidationError'](_0x27f42f[_0xbb10('0x60')]);});})[_0xbb10('0x23')](handleEntityNotFound(_0x14f16b,null))[_0xbb10('0x23')](respondWithStatusCode(_0x14f16b,0xcc))[_0xbb10('0x44')](handleError(_0x14f16b,null));};exports[_0xbb10('0x6d')]=function(_0x172be3,_0xa3b23,_0x312a08){var _0x5a4429={};var _0x428146={};var _0x218690;var _0x145baf;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x172be3['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0xa3b23,null))['then'](function(_0x4e3d6a){if(_0x4e3d6a){_0x218690=_0x4e3d6a;_0x428146[_0xbb10('0x2f')]=_[_0xbb10('0x31')](db[_0xbb10('0x6c')][_0xbb10('0x6e')]);_0x428146[_0xbb10('0x30')]=_[_0xbb10('0x31')](_0x172be3[_0xbb10('0x30')]);_0x428146[_0xbb10('0x32')]=_[_0xbb10('0x33')](_0x428146['model'],_0x428146[_0xbb10('0x30')]);_0x5a4429[_0xbb10('0x34')]=_[_0xbb10('0x33')](_0x428146[_0xbb10('0x2f')],qs['fields'](_0x172be3['query'][_0xbb10('0x35')]));_0x5a4429[_0xbb10('0x34')]=_0x5a4429[_0xbb10('0x34')][_0xbb10('0x36')]?_0x5a4429['attributes']:_0x428146[_0xbb10('0x2f')];_0x5a4429[_0xbb10('0x38')]=qs[_0xbb10('0x39')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x39')]);_0x5a4429['where']=qs['filters'](_[_0xbb10('0x6f')](_0x172be3[_0xbb10('0x30')],_0x428146[_0xbb10('0x32')]));if(_0x172be3['query'][_0xbb10('0x3e')]){_0x5a4429[_0xbb10('0x3a')]=_['merge'](_0x5a4429['where'],{'$or':_[_0xbb10('0x3c')](_0x5a4429[_0xbb10('0x34')],function(_0x177f77){var _0x4d64ff={};_0x4d64ff[_0x177f77]={'$like':'%'+_0x172be3[_0xbb10('0x30')][_0xbb10('0x3e')]+'%'};return _0x4d64ff;})});}_0x5a4429=_[_0xbb10('0x3b')]({},_0x5a4429,_0x172be3[_0xbb10('0x3f')]);return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x45bd4e){if(_0x45bd4e){_0x145baf=_0x45bd4e[_0xbb10('0x36')];if(!_0x172be3[_0xbb10('0x30')]['hasOwnProperty'](_0xbb10('0x70'))){_0x5a4429[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x5a4429[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x172be3[_0xbb10('0x30')][_0xbb10('0x1d')]);}return _0x218690[_0xbb10('0x6d')](_0x5a4429);}})[_0xbb10('0x23')](function(_0x2a4278){if(_0x2a4278){return _0x2a4278?{'count':_0x145baf,'rows':_0x2a4278}:null;}})['then'](respondWithResult(_0xa3b23,null))['catch'](handleError(_0xa3b23,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index e5e292e..c58b512 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 _0xed2c=['../../config/logger','moment','bluebird','request-promise','path','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','util'];(function(_0x145166,_0x4ca911){var _0x36dac2=function(_0x437151){while(--_0x437151){_0x145166['push'](_0x145166['shift']());}};_0x36dac2(++_0x4ca911);}(_0xed2c,0x1b6));var _0xced2=function(_0xcdc46b,_0x5007bf){_0xcdc46b=_0xcdc46b-0x0;var _0x4f46cb=_0xed2c[_0xcdc46b];return _0x4f46cb;};'use strict';var _=require(_0xced2('0x0'));var util=require(_0xced2('0x1'));var logger=require(_0xced2('0x2'))('api');var moment=require(_0xced2('0x3'));var BPromise=require(_0xced2('0x4'));var rp=require(_0xced2('0x5'));var fs=require('fs');var path=require(_0xced2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0xced2('0x7')]=function(_0x253724,_0xecfe19){return _0x253724[_0xced2('0x8')](_0xced2('0x9'),attributes,{'tableName':_0xced2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5934=['exports','define','voice_musiconhold','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x5934,0x111));var _0x4593=function(_0x22cf0f,_0x50a10b){_0x22cf0f=_0x22cf0f-0x0;var _0x577612=_0x5934[_0x22cf0f];return _0x577612;};'use strict';var _=require('lodash');var util=require(_0x4593('0x0'));var logger=require(_0x4593('0x1'))('api');var moment=require('moment');var BPromise=require(_0x4593('0x2'));var rp=require(_0x4593('0x3'));var fs=require('fs');var path=require(_0x4593('0x4'));var rimraf=require(_0x4593('0x5'));var config=require('../../config/environment');var attributes=require(_0x4593('0x6'));module[_0x4593('0x7')]=function(_0x44dfe3,_0x57a43a){return _0x44dfe3[_0x4593('0x8')]('VoiceMusicOnHold',attributes,{'tableName':_0x4593('0x9'),'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 ce3ec54..4c0d18a 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 _0xfd5f=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x3c75d6,_0xc87d8d){var _0x44bc2c=function(_0xa8cd63){while(--_0xa8cd63){_0x3c75d6['push'](_0x3c75d6['shift']());}};_0x44bc2c(++_0xc87d8d);}(_0xfd5f,0x12e));var _0xffd5=function(_0x4409b6,_0x3d6c1f){_0x4409b6=_0x4409b6-0x0;var _0x1a7f18=_0xfd5f[_0x4409b6];return _0x1a7f18;};'use strict';var _=require(_0xffd5('0x0'));var util=require(_0xffd5('0x1'));var moment=require(_0xffd5('0x2'));var BPromise=require(_0xffd5('0x3'));var rs=require(_0xffd5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xffd5('0x5'));var logger=require(_0xffd5('0x6'))(_0xffd5('0x7'));var config=require(_0xffd5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xffd5('0x9')][_0xffd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42770b,_0x1395ed,_0x4b951b){return new BPromise(function(_0xfd0391,_0x3d268f){return client[_0xffd5('0xb')](_0x42770b,_0x4b951b)[_0xffd5('0xc')](function(_0x3f1b41){logger[_0xffd5('0xd')](_0xffd5('0xe'),_0x1395ed,'request\x20sent');logger[_0xffd5('0xf')](_0xffd5('0x10'),_0x1395ed,_0xffd5('0x11'),JSON[_0xffd5('0x12')](_0x3f1b41));if(_0x3f1b41[_0xffd5('0x13')]){if(_0x3f1b41[_0xffd5('0x13')][_0xffd5('0x14')]===0x1f4){logger['error'](_0xffd5('0xe'),_0x1395ed,_0x3f1b41[_0xffd5('0x13')][_0xffd5('0x15')]);return _0x3d268f(_0x3f1b41['error'][_0xffd5('0x15')]);}logger[_0xffd5('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x1395ed,_0x3f1b41['error']['message']);return _0xfd0391(_0x3f1b41[_0xffd5('0x13')][_0xffd5('0x15')]);}else{logger[_0xffd5('0xd')](_0xffd5('0xe'),_0x1395ed,_0xffd5('0x11'));_0xfd0391(_0x3f1b41[_0xffd5('0x16')]['message']);}})[_0xffd5('0x17')](function(_0x2dd173){logger[_0xffd5('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x1395ed,_0x2dd173);_0x3d268f(_0x2dd173);});});} \ No newline at end of file +var _0xa31d=['error','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4eb6e3,_0x555008){var _0x11bd33=function(_0x572af7){while(--_0x572af7){_0x4eb6e3['push'](_0x4eb6e3['shift']());}};_0x11bd33(++_0x555008);}(_0xa31d,0xf5));var _0xda31=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0xa31d[_0x4eafed];return _0x159c85;};'use strict';var _=require(_0xda31('0x0'));var util=require('util');var moment=require(_0xda31('0x1'));var BPromise=require(_0xda31('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xda31('0x3'));var db=require(_0xda31('0x4'))['db'];var utils=require(_0xda31('0x5'));var logger=require(_0xda31('0x6'))(_0xda31('0x7'));var config=require(_0xda31('0x8'));var jayson=require(_0xda31('0x9'));var client=jayson[_0xda31('0xa')][_0xda31('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x308933,_0x2ca189,_0x4212b6){return new BPromise(function(_0x435f66,_0x17f72a){return client[_0xda31('0xc')](_0x308933,_0x4212b6)[_0xda31('0xd')](function(_0x142ef8){logger[_0xda31('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2ca189,_0xda31('0xf'));logger[_0xda31('0x10')](_0xda31('0x11'),_0x2ca189,'request\x20sent',JSON[_0xda31('0x12')](_0x142ef8));if(_0x142ef8[_0xda31('0x13')]){if(_0x142ef8[_0xda31('0x13')]['code']===0x1f4){logger[_0xda31('0x13')](_0xda31('0x14'),_0x2ca189,_0x142ef8[_0xda31('0x13')][_0xda31('0x15')]);return _0x17f72a(_0x142ef8[_0xda31('0x13')][_0xda31('0x15')]);}logger['error'](_0xda31('0x14'),_0x2ca189,_0x142ef8['error'][_0xda31('0x15')]);return _0x435f66(_0x142ef8[_0xda31('0x13')][_0xda31('0x15')]);}else{logger[_0xda31('0xe')](_0xda31('0x14'),_0x2ca189,_0xda31('0xf'));_0x435f66(_0x142ef8[_0xda31('0x16')][_0xda31('0x15')]);}})[_0xda31('0x17')](function(_0x468ac6){logger[_0xda31('0x13')](_0xda31('0x14'),_0x2ca189,_0x468ac6);_0x17f72a(_0x468ac6);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 9d1b2f0..c78f0d2 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 _0xb828=['delete','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','/describe','/:id','isAuthenticated','show','/:id/users','getAgents','post','put','update'];(function(_0x4c5d0a,_0x53480d){var _0x5be6de=function(_0x2f9c3e){while(--_0x2f9c3e){_0x4c5d0a['push'](_0x4c5d0a['shift']());}};_0x5be6de(++_0x53480d);}(_0xb828,0x120));var _0x8b82=function(_0x333fc8,_0x2b292c){_0x333fc8=_0x333fc8-0x0;var _0x432439=_0xb828[_0x333fc8];return _0x432439;};'use strict';var multer=require(_0x8b82('0x0'));var util=require(_0x8b82('0x1'));var path=require(_0x8b82('0x2'));var timeout=require(_0x8b82('0x3'));var express=require(_0x8b82('0x4'));var router=express[_0x8b82('0x5')]();var auth=require(_0x8b82('0x6'));var interaction=require(_0x8b82('0x7'));var config=require(_0x8b82('0x8'));var controller=require(_0x8b82('0x9'));router[_0x8b82('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8b82('0xa')](_0x8b82('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x8b82('0xc'),auth[_0x8b82('0xd')](),controller[_0x8b82('0xe')]);router[_0x8b82('0xa')](_0x8b82('0xf'),auth[_0x8b82('0xd')](),controller[_0x8b82('0x10')]);router[_0x8b82('0x11')]('/',auth[_0x8b82('0xd')](),controller['create']);router[_0x8b82('0x11')](_0x8b82('0xf'),auth[_0x8b82('0xd')](),controller['addAgents']);router[_0x8b82('0x12')]('/:id',auth[_0x8b82('0xd')](),controller[_0x8b82('0x13')]);router[_0x8b82('0x14')](_0x8b82('0xc'),auth[_0x8b82('0xd')](),controller['destroy']);router[_0x8b82('0x14')](_0x8b82('0xf'),auth['isAuthenticated'](),controller[_0x8b82('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9d70=['create','post','addAgents','put','/:id','delete','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','show','/:id/users'];(function(_0x6095c3,_0x447705){var _0x351076=function(_0x2e4add){while(--_0x2e4add){_0x6095c3['push'](_0x6095c3['shift']());}};_0x351076(++_0x447705);}(_0x9d70,0x10a));var _0x09d7=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x9d70[_0x22b68a];return _0x1ac67a;};'use strict';var multer=require(_0x09d7('0x0'));var util=require(_0x09d7('0x1'));var path=require('path');var timeout=require(_0x09d7('0x2'));var express=require(_0x09d7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x09d7('0x4'));var config=require(_0x09d7('0x5'));var controller=require(_0x09d7('0x6'));router['get']('/',auth[_0x09d7('0x7')](),controller[_0x09d7('0x8')]);router[_0x09d7('0x9')](_0x09d7('0xa'),auth['isAuthenticated'](),controller[_0x09d7('0xb')]);router[_0x09d7('0x9')]('/:id',auth[_0x09d7('0x7')](),controller[_0x09d7('0xc')]);router['get'](_0x09d7('0xd'),auth[_0x09d7('0x7')](),controller['getAgents']);router['post']('/',auth[_0x09d7('0x7')](),controller[_0x09d7('0xe')]);router[_0x09d7('0xf')]('/:id/users',auth[_0x09d7('0x7')](),controller[_0x09d7('0x10')]);router[_0x09d7('0x11')](_0x09d7('0x12'),auth[_0x09d7('0x7')](),controller['update']);router[_0x09d7('0x13')](_0x09d7('0x12'),auth[_0x09d7('0x7')](),controller['destroy']);router[_0x09d7('0x13')](_0x09d7('0xd'),auth[_0x09d7('0x7')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 7cabda3..85a7c34 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 _0x8804=['STRING','name','VIRTUAL','INTEGER','sequelize','exports'];(function(_0x43b279,_0x41b5e){var _0x2dc01c=function(_0x2e1c8c){while(--_0x2e1c8c){_0x43b279['push'](_0x43b279['shift']());}};_0x2dc01c(++_0x41b5e);}(_0x8804,0x160));var _0x4880=function(_0x3b9ce7,_0x579e5e){_0x3b9ce7=_0x3b9ce7-0x0;var _0x20234f=_0x8804[_0x3b9ce7];return _0x20234f;};'use strict';var Sequelize=require(_0x4880('0x0'));module[_0x4880('0x1')]={'name':{'type':Sequelize[_0x4880('0x2')],'allowNull':![],'unique':_0x4880('0x3')},'prefix':{'type':Sequelize[_0x4880('0x4')],'get':function(_0x2aa3c8){return'system-'+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize[_0x4880('0x2')]},'callerIdAll':{'type':Sequelize[_0x4880('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x4880('0x5')]}}; \ No newline at end of file +var _0x4ac0=['getDataValue','INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x1551af,_0x5223c3){var _0xd8eb82=function(_0x4b133a){while(--_0x4b133a){_0x1551af['push'](_0x1551af['shift']());}};_0xd8eb82(++_0x5223c3);}(_0x4ac0,0xb2));var _0x04ac=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x4ac0[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x04ac('0x0'));module[_0x04ac('0x1')]={'name':{'type':Sequelize[_0x04ac('0x2')],'allowNull':![],'unique':_0x04ac('0x3')},'prefix':{'type':Sequelize[_0x04ac('0x4')],'get':function(_0x43b4db){return _0x04ac('0x5')+this[_0x04ac('0x6')](_0x04ac('0x3'))+'-';}},'description':{'type':Sequelize[_0x04ac('0x2')]},'callerIdAll':{'type':Sequelize[_0x04ac('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x04ac('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 5c9d899..4e78dd4 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 _0x0eda=['offset','limit','set','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','findAll','rows','show','include','find','catch','describe','create','sequelize','body','VoiceExtensionId','user','role','userProfileId','autoAssociation','error','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','appdata','prefix','VoicePrefixId','VoiceExtension','bulkCreate','Extensions\x20creation\x20failed','push','Set','callerIdAll','PREFIX-CALLERIDALL=','NoOp','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','system-','transaction','findById','addAgents','params','ids','spread','length','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','count'];(function(_0x285b77,_0x121d96){var _0x3c4090=function(_0x45cc7d){while(--_0x45cc7d){_0x285b77['push'](_0x285b77['shift']());}};_0x3c4090(++_0x121d96);}(_0x0eda,0x1c0));var _0xa0ed=function(_0x15c32a,_0x3c4cbe){_0x15c32a=_0x15c32a-0x0;var _0x281963=_0x0eda[_0x15c32a];return _0x281963;};'use strict';var pdf=require(_0xa0ed('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa0ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0ed('0x2'));var rp=require('request-promise');var moment=require(_0xa0ed('0x3'));var BPromise=require(_0xa0ed('0x4'));var Mustache=require(_0xa0ed('0x5'));var util=require(_0xa0ed('0x6'));var path=require('path');var sox=require(_0xa0ed('0x7'));var csv=require(_0xa0ed('0x8'));var ejs=require(_0xa0ed('0x9'));var fs=require('fs');var _=require(_0xa0ed('0xa'));var squel=require('squel');var crypto=require(_0xa0ed('0xb'));var jsforce=require(_0xa0ed('0xc'));var deskjs=require(_0xa0ed('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa0ed('0xe'));var Papa=require(_0xa0ed('0xf'));var Redis=require('ioredis');var authService=require(_0xa0ed('0x10'));var qs=require(_0xa0ed('0x11'));var as=require(_0xa0ed('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa0ed('0x13'));var utils=require(_0xa0ed('0x14'));var config=require(_0xa0ed('0x15'));var db=require('../../mysqldb')['db'];config[_0xa0ed('0x16')]=_[_0xa0ed('0x17')](config[_0xa0ed('0x16')],{'host':_0xa0ed('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0ed('0x16')]));require(_0xa0ed('0x19'))[_0xa0ed('0x1a')](socket);function respondWithStatusCode(_0x142772,_0x1828b1){_0x1828b1=_0x1828b1||0xcc;return function(_0x5e1ca){if(_0x5e1ca){return _0x142772[_0xa0ed('0x1b')](_0x1828b1);}return _0x142772[_0xa0ed('0x1c')](_0x1828b1)[_0xa0ed('0x1d')]();};}function respondWithResult(_0x4d9b28,_0x4b06da){_0x4b06da=_0x4b06da||0xc8;return function(_0x755d47){if(_0x755d47){return _0x4d9b28[_0xa0ed('0x1c')](_0x4b06da)[_0xa0ed('0x1e')](_0x755d47);}};}function respondWithFilteredResult(_0x54a9eb,_0x26db3c){return function(_0x1c37ce){if(_0x1c37ce){var _0x4565cf=_0x1c37ce[_0xa0ed('0x1f')],_0x10ca14=_0x26db3c[_0xa0ed('0x20')],_0x1d4e9b=_0x26db3c[_0xa0ed('0x20')]+_0x26db3c[_0xa0ed('0x21')],_0x11b3f2;if(_0x1d4e9b>=_0x4565cf){_0x1d4e9b=_0x4565cf;_0x11b3f2=0xc8;}else{_0x11b3f2=0xce;}_0x54a9eb[_0xa0ed('0x1c')](_0x11b3f2);return _0x54a9eb[_0xa0ed('0x22')]('Content-Range',_0x10ca14+'-'+_0x1d4e9b+'/'+_0x4565cf)[_0xa0ed('0x1e')](_0x1c37ce);}return null;};}function patchUpdates(_0x16b6b7){return function(_0x145527){try{jsonpatch[_0xa0ed('0x23')](_0x145527,_0x16b6b7,!![]);}catch(_0x21b0a1){return BPromise[_0xa0ed('0x24')](_0x21b0a1);}return _0x145527['save']();};}function saveUpdates(_0x5dec64,_0x1a2a77){return function(_0x2e9e87){if(_0x2e9e87){return _0x2e9e87[_0xa0ed('0x25')](_0x5dec64)[_0xa0ed('0x26')](function(_0x32a0f7){return _0x32a0f7;});}return null;};}function removeEntity(_0x43f9c0,_0x8b9725){return function(_0x2b376c){if(_0x2b376c){return _0x2b376c[_0xa0ed('0x27')]()[_0xa0ed('0x26')](function(){var _0x19c98e=_0x2b376c[_0xa0ed('0x28')]({'plain':!![]});var _0x34d17e=_0xa0ed('0x29');return db[_0xa0ed('0x2a')][_0xa0ed('0x27')]({'where':{'type':_0x34d17e,'resourceId':_0x19c98e['id']}})[_0xa0ed('0x26')](function(){return _0x2b376c;});})[_0xa0ed('0x26')](function(){_0x43f9c0[_0xa0ed('0x1c')](0xcc)[_0xa0ed('0x1d')]();});}};}function handleEntityNotFound(_0x42401a,_0x5e6828){return function(_0x4799c7){if(!_0x4799c7){_0x42401a[_0xa0ed('0x1b')](0x194);}return _0x4799c7;};}function handleError(_0x1549b9,_0x7b2966){_0x7b2966=_0x7b2966||0x1f4;return function(_0x27200e){logger['error'](_0x27200e[_0xa0ed('0x2b')]);if(_0x27200e[_0xa0ed('0x2c')]){delete _0x27200e[_0xa0ed('0x2c')];}_0x1549b9['status'](_0x7b2966)[_0xa0ed('0x2d')](_0x27200e);};}exports[_0xa0ed('0x2e')]=function(_0x21b782,_0x32b217){var _0x525837={},_0x54ae49={},_0x104475={'count':0x0,'rows':[]};var _0x1aeac8=_[_0xa0ed('0x2f')](db[_0xa0ed('0x30')][_0xa0ed('0x31')],function(_0x6474c2){return{'name':_0x6474c2[_0xa0ed('0x32')],'type':_0x6474c2[_0xa0ed('0x33')]['key']};});_0x54ae49[_0xa0ed('0x34')]=_[_0xa0ed('0x2f')](_0x1aeac8,_0xa0ed('0x2c'));_0x54ae49[_0xa0ed('0x35')]=_[_0xa0ed('0x36')](_0x21b782['query']);_0x54ae49[_0xa0ed('0x37')]=_[_0xa0ed('0x38')](_0x54ae49[_0xa0ed('0x34')],_0x54ae49[_0xa0ed('0x35')]);_0x525837[_0xa0ed('0x39')]=_[_0xa0ed('0x38')](_0x54ae49['model'],qs[_0xa0ed('0x3a')](_0x21b782['query'][_0xa0ed('0x3a')]));_0x525837[_0xa0ed('0x39')]=_0x525837[_0xa0ed('0x39')]['length']?_0x525837[_0xa0ed('0x39')]:_0x54ae49[_0xa0ed('0x34')];if(!_0x21b782[_0xa0ed('0x35')][_0xa0ed('0x3b')](_0xa0ed('0x3c'))){_0x525837[_0xa0ed('0x21')]=qs[_0xa0ed('0x21')](_0x21b782[_0xa0ed('0x35')][_0xa0ed('0x21')]);_0x525837['offset']=qs[_0xa0ed('0x20')](_0x21b782[_0xa0ed('0x35')]['offset']);}_0x525837[_0xa0ed('0x3d')]=qs[_0xa0ed('0x3e')](_0x21b782['query'][_0xa0ed('0x3e')]);_0x525837[_0xa0ed('0x3f')]=qs[_0xa0ed('0x37')](_[_0xa0ed('0x40')](_0x21b782['query'],_0x54ae49['filters']),_0x1aeac8);if(_0x21b782[_0xa0ed('0x35')][_0xa0ed('0x41')]){_0x525837[_0xa0ed('0x3f')]=_['merge'](_0x525837[_0xa0ed('0x3f')],{'$or':_[_0xa0ed('0x2f')](_0x1aeac8,function(_0x13a1f0){if(_0x13a1f0[_0xa0ed('0x33')]!=='VIRTUAL'){var _0x4e6213={};_0x4e6213[_0x13a1f0['name']]={'$like':'%'+_0x21b782[_0xa0ed('0x35')][_0xa0ed('0x41')]+'%'};return _0x4e6213;}})});}_0x525837=_[_0xa0ed('0x42')]({},_0x525837,_0x21b782[_0xa0ed('0x43')]);var _0x286439={'where':_0x525837[_0xa0ed('0x3f')]};return db[_0xa0ed('0x30')][_0xa0ed('0x1f')](_0x286439)['then'](function(_0x58750b){_0x104475['count']=_0x58750b;if(_0x21b782['query']['includeAll']){_0x525837['include']=[{'all':!![]}];}return db['VoicePrefix'][_0xa0ed('0x44')](_0x525837);})['then'](function(_0x1068c4){_0x104475[_0xa0ed('0x45')]=_0x1068c4;return _0x104475;})[_0xa0ed('0x26')](respondWithFilteredResult(_0x32b217,_0x525837))['catch'](handleError(_0x32b217,null));};exports[_0xa0ed('0x46')]=function(_0x278b45,_0x543364){var _0x512295={'raw':![],'where':{'id':_0x278b45['params']['id']}},_0x2b08ab={};_0x2b08ab[_0xa0ed('0x34')]=_['keys'](db['VoicePrefix'][_0xa0ed('0x31')]);_0x2b08ab['query']=_[_0xa0ed('0x36')](_0x278b45[_0xa0ed('0x35')]);_0x2b08ab[_0xa0ed('0x37')]=_[_0xa0ed('0x38')](_0x2b08ab['model'],_0x2b08ab['query']);_0x512295[_0xa0ed('0x39')]=_[_0xa0ed('0x38')](_0x2b08ab[_0xa0ed('0x34')],qs[_0xa0ed('0x3a')](_0x278b45['query']['fields']));_0x512295[_0xa0ed('0x39')]=_0x512295[_0xa0ed('0x39')]['length']?_0x512295[_0xa0ed('0x39')]:_0x2b08ab[_0xa0ed('0x34')];if(_0x278b45['query']['includeAll']){_0x512295[_0xa0ed('0x47')]=[{'all':!![]}];}_0x512295=_[_0xa0ed('0x42')]({},_0x512295,_0x278b45[_0xa0ed('0x43')]);return db['VoicePrefix'][_0xa0ed('0x48')](_0x512295)[_0xa0ed('0x26')](handleEntityNotFound(_0x543364,null))[_0xa0ed('0x26')](respondWithResult(_0x543364,null))['catch'](handleError(_0x543364,null));};exports[_0xa0ed('0x27')]=function(_0x323d70,_0x1c00af){return db[_0xa0ed('0x30')]['find']({'where':{'id':_0x323d70['params']['id']}})['then'](handleEntityNotFound(_0x1c00af,null))['then'](removeEntity(_0x1c00af,null))[_0xa0ed('0x49')](handleError(_0x1c00af,null));};exports[_0xa0ed('0x4a')]=function(_0x38e9c0,_0x332b33){return db[_0xa0ed('0x30')]['describe']()[_0xa0ed('0x26')](respondWithResult(_0x332b33,null))[_0xa0ed('0x49')](handleError(_0x332b33,null));};exports[_0xa0ed('0x4b')]=function(_0x52416c,_0x7da1c){var _0x53daac;return db[_0xa0ed('0x4c')]['transaction'](function(_0x450c5a){return db['VoicePrefix']['create'](_0x52416c[_0xa0ed('0x4d')],{'transaction':_0x450c5a})[_0xa0ed('0x26')](function(_0x3037fa){_0x53daac=_0x3037fa[_0xa0ed('0x28')]({'plain':!![]});return db['VoiceExtension'][_0xa0ed('0x48')]({'where':{'id':_0x53daac[_0xa0ed('0x4e')]},'raw':!![]})[_0xa0ed('0x26')](function(_0x274e6e){return createVoicePrefixExtensions(_0x53daac,_0x274e6e,_0x450c5a);});});})[_0xa0ed('0x26')](function(){var _0x4fb9fa=_0x52416c[_0xa0ed('0x4f')]['get']({'plain':!![]});if(!_0x4fb9fa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fb9fa[_0xa0ed('0x50')]===_0xa0ed('0x4f')){var _0x59f45f=_0x53daac;return db['UserProfileSection'][_0xa0ed('0x48')]({'where':{'name':'VoicePrefixes','userProfileId':_0x4fb9fa[_0xa0ed('0x51')]},'raw':!![]})[_0xa0ed('0x26')](function(_0x8ea3b4){if(_0x8ea3b4&&_0x8ea3b4[_0xa0ed('0x52')]===0x0){return db[_0xa0ed('0x2a')]['create']({'name':_0x59f45f[_0xa0ed('0x2c')],'resourceId':_0x59f45f['id'],'type':_0x8ea3b4[_0xa0ed('0x2c')],'sectionId':_0x8ea3b4['id']},{})[_0xa0ed('0x26')](function(){return _0x53daac;});}else{return _0x53daac;}})[_0xa0ed('0x49')](function(_0x5b2669){logger[_0xa0ed('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b2669);throw _0x5b2669;});}return _0x53daac;})['then'](respondWithResult(_0x7da1c,null))[_0xa0ed('0x49')](handleError(_0x7da1c,null));};function Extension(_0x3e2038,_0x25139f,_0xf8f906,_0x306b08){this['context']=_0xa0ed('0x54');this[_0xa0ed('0x55')]=_0x3e2038;this['app']=_0xf8f906;this[_0xa0ed('0x33')]=_0xa0ed('0x56');this[_0xa0ed('0x57')]=_0xa0ed('0x58');this['priority']=_0x25139f;this[_0xa0ed('0x59')]=_0x306b08;}function createVoicePrefixExtensions(_0xb8811f,_0x46c814,_0x336891){return new BPromise(function(_0x532d0d,_0x2f2781){var _0x17b4cf=new Extension(formatPrefixName(_0xb8811f[_0xa0ed('0x5a')]),0x1,'NoOp','Voice\x20Prefix');_0x17b4cf[_0xa0ed('0x5b')]=_0xb8811f['id'];return db[_0xa0ed('0x5c')][_0xa0ed('0x4b')](_0x17b4cf,{'transaction':_0x336891})[_0xa0ed('0x26')](function(_0x1a0e9b){var _0x4b2387=_0x1a0e9b[_0xa0ed('0x28')]({'plain':!![]});var _0x5b6929=_[_0xa0ed('0x2f')](addVoicePrefixExtensions(_0xb8811f,_0x46c814),function(_0x32fbde){_0x32fbde[_0xa0ed('0x4e')]=_0x4b2387['id'];_0x32fbde[_0xa0ed('0x5b')]=_0xb8811f['id'];return _0x32fbde;});return db['VoiceExtension'][_0xa0ed('0x5d')](_0x5b6929,{'transaction':_0x336891})['then'](function(_0x454643){if(!_0x454643){return _0x2f2781(_0xa0ed('0x5e'));}else{return _0x532d0d(_0x454643);}})[_0xa0ed('0x49')](function(_0x1683ea){return _0x2f2781(_0x1683ea);});});;});};function addVoicePrefixExtensions(_0x5f4508,_0x4b66d2){var _0x124cb5=[];var _0x55c8f5=formatPrefixName(_0x5f4508[_0xa0ed('0x5a')]);_0x124cb5[_0xa0ed('0x5f')](new Extension(_0x55c8f5,0x2,_0xa0ed('0x60'),'CDR(prefix)='+_0x5f4508['name']));if(_0x5f4508[_0xa0ed('0x61')]){_0x124cb5['push'](new Extension(_0x55c8f5,0x3,_0xa0ed('0x60'),_0xa0ed('0x62')+_0x5f4508[_0xa0ed('0x61')]));}else{_0x124cb5[_0xa0ed('0x5f')](new Extension(_0x55c8f5,0x3,_0xa0ed('0x63'),_0xa0ed('0x64')));}_0x124cb5[_0xa0ed('0x5f')](new Extension(_0x55c8f5,0x4,_0xa0ed('0x65'),_0x4b66d2[_0xa0ed('0x66')]+','+_0xa0ed('0x67')+(0x8+_0x5f4508['name']['length'])+'}'+','+0x1));return _0x124cb5;}function formatPrefixName(_0x2c442a){var _0x2574dc='_';for(var _0x343bba=0x0;_0x343bba<_0x2c442a['length'];_0x343bba++){if(_0x2c442a[_0xa0ed('0x68')](_0x343bba)=='-'){_0x2574dc+=_0x2c442a[_0xa0ed('0x68')](_0x343bba);}else{_0x2574dc+='['+_0x2c442a[_0xa0ed('0x68')](_0x343bba)+']';}}_0x2574dc+='.';return _0x2574dc;}exports[_0xa0ed('0x25')]=function(_0x5c70a8,_0x422b63,_0x5cef5d){var _0x2d3527=_0x5c70a8[_0xa0ed('0x4d')];_0x2d3527[_0xa0ed('0x5a')]=_0xa0ed('0x69')+_0x2d3527[_0xa0ed('0x2c')]+'-';return db[_0xa0ed('0x4c')][_0xa0ed('0x6a')](function(_0x3f6e61){return db[_0xa0ed('0x30')]['update'](_0x2d3527,{'where':{'id':_0x2d3527['id']},'transaction':_0x3f6e61})[_0xa0ed('0x26')](function(){return db[_0xa0ed('0x5c')]['destroy']({'where':{'VoicePrefixId':_0x2d3527['id']},'transaction':_0x3f6e61})[_0xa0ed('0x26')](function(){return db['VoiceExtension'][_0xa0ed('0x48')]({'where':{'id':_0x2d3527[_0xa0ed('0x4e')]},'raw':!![]})[_0xa0ed('0x26')](function(_0x1264ba){return createVoicePrefixExtensions(_0x2d3527,_0x1264ba,_0x3f6e61);});});});})[_0xa0ed('0x26')](function(){return db[_0xa0ed('0x30')][_0xa0ed('0x6b')](_0x2d3527['id']);})[_0xa0ed('0x26')](respondWithResult(_0x422b63,null))[_0xa0ed('0x49')](handleError(_0x422b63,null));};exports[_0xa0ed('0x6c')]=function(_0x8418ad,_0x4c23a2,_0x44e60a){return db[_0xa0ed('0x30')][_0xa0ed('0x48')]({'where':{'id':_0x8418ad[_0xa0ed('0x6d')]['id']}})['then'](handleEntityNotFound(_0x4c23a2,null))['then'](function(_0x17ae57){if(_0x17ae57){return _0x17ae57[_0xa0ed('0x6c')](_0x8418ad[_0xa0ed('0x4d')][_0xa0ed('0x6e')],_['omit'](_0x8418ad[_0xa0ed('0x4d')],[_0xa0ed('0x6e'),'id'])||{})[_0xa0ed('0x6f')](function(_0x105eed){for(var _0x192286=0x0;_0x192286<_0x8418ad[_0xa0ed('0x4d')][_0xa0ed('0x6e')][_0xa0ed('0x70')];_0x192286+=0x1){socket[_0xa0ed('0x71')](_0xa0ed('0x72'),{'UserId':_0x8418ad['body']['ids'][_0x192286],'VoicePrefixId':_0x8418ad['params']['id']});}return _0x105eed;});}})[_0xa0ed('0x26')](respondWithResult(_0x4c23a2,null))[_0xa0ed('0x49')](handleError(_0x4c23a2,null));};exports[_0xa0ed('0x73')]=function(_0x4c49fd,_0x20a036,_0x4c2cd7){return db['VoicePrefix'][_0xa0ed('0x48')]({'where':{'id':_0x4c49fd[_0xa0ed('0x6d')]['id']}})[_0xa0ed('0x26')](handleEntityNotFound(_0x20a036,null))[_0xa0ed('0x26')](function(_0x4ac2cb){if(_0x4ac2cb){return _0x4ac2cb['removeAgents'](_0x4c49fd[_0xa0ed('0x35')]['ids'])['then'](function(){if(_[_0xa0ed('0x74')](_0x4c49fd['query']['ids'])){for(var _0x1e0622=0x0;_0x1e0622<_0x4c49fd['query'][_0xa0ed('0x6e')]['length'];_0x1e0622+=0x1){socket['emit'](_0xa0ed('0x75'),{'UserId':Number(_0x4c49fd[_0xa0ed('0x35')]['ids'][_0x1e0622]),'VoicePrefixId':Number(_0x4c49fd['params']['id'])});}}else{socket[_0xa0ed('0x71')]('userVoicePrefix:remove',{'UserId':Number(_0x4c49fd['query'][_0xa0ed('0x6e')]),'VoicePrefixId':Number(_0x4c49fd[_0xa0ed('0x6d')]['id'])});}});}})[_0xa0ed('0x26')](respondWithStatusCode(_0x20a036,null))[_0xa0ed('0x49')](handleError(_0x20a036,null));};exports[_0xa0ed('0x76')]=function(_0x236951,_0x138dd3,_0x28e757){var _0x298bc2={};var _0x38e3bd={};var _0x5ad7ea;var _0x5966ba;return db[_0xa0ed('0x30')][_0xa0ed('0x77')]({'where':{'id':_0x236951[_0xa0ed('0x6d')]['id']}})['then'](handleEntityNotFound(_0x138dd3,null))[_0xa0ed('0x26')](function(_0x46d1a6){if(_0x46d1a6){_0x5ad7ea=_0x46d1a6;_0x38e3bd[_0xa0ed('0x34')]=_['keys'](db['User']['rawAttributes']);_0x38e3bd[_0xa0ed('0x35')]=_[_0xa0ed('0x36')](_0x236951[_0xa0ed('0x35')]);_0x38e3bd[_0xa0ed('0x37')]=_[_0xa0ed('0x38')](_0x38e3bd[_0xa0ed('0x34')],_0x38e3bd['query']);_0x298bc2[_0xa0ed('0x39')]=_[_0xa0ed('0x38')](_0x38e3bd[_0xa0ed('0x34')],qs[_0xa0ed('0x3a')](_0x236951[_0xa0ed('0x35')][_0xa0ed('0x3a')]));_0x298bc2['attributes']=_0x298bc2['attributes'][_0xa0ed('0x70')]?_0x298bc2[_0xa0ed('0x39')]:_0x38e3bd[_0xa0ed('0x34')];_0x298bc2[_0xa0ed('0x3d')]=qs[_0xa0ed('0x3e')](_0x236951[_0xa0ed('0x35')][_0xa0ed('0x3e')]);_0x298bc2['where']=qs[_0xa0ed('0x37')](_[_0xa0ed('0x40')](_0x236951[_0xa0ed('0x35')],_0x38e3bd[_0xa0ed('0x37')]));if(_0x236951[_0xa0ed('0x35')][_0xa0ed('0x41')]){_0x298bc2[_0xa0ed('0x3f')]=_[_0xa0ed('0x42')](_0x298bc2[_0xa0ed('0x3f')],{'$or':_['map'](_0x298bc2[_0xa0ed('0x39')],function(_0x1d6b7c){var _0x5709a4={};_0x5709a4[_0x1d6b7c]={'$like':'%'+_0x236951[_0xa0ed('0x35')][_0xa0ed('0x41')]+'%'};return _0x5709a4;})});}_0x298bc2=_[_0xa0ed('0x42')]({},_0x298bc2,_0x236951[_0xa0ed('0x43')]);return _0x5ad7ea[_0xa0ed('0x76')](_0x298bc2);}})[_0xa0ed('0x26')](function(_0x34d2eb){if(_0x34d2eb){_0x5966ba=_0x34d2eb[_0xa0ed('0x70')];if(!_0x236951[_0xa0ed('0x35')]['hasOwnProperty']('nolimit')){_0x298bc2[_0xa0ed('0x21')]=qs['limit'](_0x236951['query'][_0xa0ed('0x21')]);_0x298bc2[_0xa0ed('0x20')]=qs[_0xa0ed('0x20')](_0x236951['query']['offset']);}return _0x5ad7ea[_0xa0ed('0x76')](_0x298bc2);}})[_0xa0ed('0x26')](function(_0x34806d){if(_0x34806d){return _0x34806d?{'count':_0x5966ba,'rows':_0x34806d}:null;}})[_0xa0ed('0x26')](respondWithResult(_0x138dd3,null))['catch'](handleError(_0x138dd3,null));}; \ No newline at end of file +var _0xf781=['limit','set','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','stack','name','send','index','map','VoicePrefix','fieldName','type','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','count','includeAll','include','rows','catch','show','params','rawAttributes','find','describe','create','transaction','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','NoOp','goto','context','${EXTEN:','charAt','system-','sequelize','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','offset'];(function(_0x5427c8,_0x18f384){var _0x33a129=function(_0x1940e8){while(--_0x1940e8){_0x5427c8['push'](_0x5427c8['shift']());}};_0x33a129(++_0x18f384);}(_0xf781,0x1d8));var _0x1f78=function(_0xf050a5,_0x17bc42){_0xf050a5=_0xf050a5-0x0;var _0x7a693=_0xf781[_0xf050a5];return _0x7a693;};'use strict';var pdf=require(_0x1f78('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1f78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1f78('0x2'));var rp=require(_0x1f78('0x3'));var moment=require(_0x1f78('0x4'));var BPromise=require(_0x1f78('0x5'));var Mustache=require(_0x1f78('0x6'));var util=require(_0x1f78('0x7'));var path=require(_0x1f78('0x8'));var sox=require(_0x1f78('0x9'));var csv=require(_0x1f78('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1f78('0xb'));var squel=require(_0x1f78('0xc'));var crypto=require(_0x1f78('0xd'));var jsforce=require(_0x1f78('0xe'));var deskjs=require(_0x1f78('0xf'));var toCsv=require(_0x1f78('0xa'));var querystring=require(_0x1f78('0x10'));var Papa=require(_0x1f78('0x11'));var Redis=require('ioredis');var authService=require(_0x1f78('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1f78('0x13'));var hardwareService=require(_0x1f78('0x14'));var logger=require(_0x1f78('0x15'))(_0x1f78('0x16'));var utils=require(_0x1f78('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x1f78('0x18')](config['redis'],{'host':_0x1f78('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1f78('0x1a'))[_0x1f78('0x1b')](socket);function respondWithStatusCode(_0x5b8e12,_0xce19a6){_0xce19a6=_0xce19a6||0xcc;return function(_0x19ad1f){if(_0x19ad1f){return _0x5b8e12[_0x1f78('0x1c')](_0xce19a6);}return _0x5b8e12[_0x1f78('0x1d')](_0xce19a6)[_0x1f78('0x1e')]();};}function respondWithResult(_0xfef945,_0x5f2c80){_0x5f2c80=_0x5f2c80||0xc8;return function(_0x23afcd){if(_0x23afcd){return _0xfef945[_0x1f78('0x1d')](_0x5f2c80)['json'](_0x23afcd);}};}function respondWithFilteredResult(_0x1ffb0b,_0xea439){return function(_0xa6d536){if(_0xa6d536){var _0x5b971d=_0xa6d536['count'],_0x94dd39=_0xea439[_0x1f78('0x1f')],_0xdc653c=_0xea439[_0x1f78('0x1f')]+_0xea439[_0x1f78('0x20')],_0x240d49;if(_0xdc653c>=_0x5b971d){_0xdc653c=_0x5b971d;_0x240d49=0xc8;}else{_0x240d49=0xce;}_0x1ffb0b[_0x1f78('0x1d')](_0x240d49);return _0x1ffb0b[_0x1f78('0x21')]('Content-Range',_0x94dd39+'-'+_0xdc653c+'/'+_0x5b971d)['json'](_0xa6d536);}return null;};}function patchUpdates(_0x10bfec){return function(_0x158e38){try{jsonpatch['apply'](_0x158e38,_0x10bfec,!![]);}catch(_0x19aa94){return BPromise['reject'](_0x19aa94);}return _0x158e38[_0x1f78('0x22')]();};}function saveUpdates(_0x46fb8c,_0x411fc0){return function(_0x2a85cd){if(_0x2a85cd){return _0x2a85cd[_0x1f78('0x23')](_0x46fb8c)[_0x1f78('0x24')](function(_0x34c5d6){return _0x34c5d6;});}return null;};}function removeEntity(_0x161025,_0x2cdb22){return function(_0x21f07a){if(_0x21f07a){return _0x21f07a[_0x1f78('0x25')]()[_0x1f78('0x24')](function(){var _0xed75e8=_0x21f07a[_0x1f78('0x26')]({'plain':!![]});var _0xdbd9bc=_0x1f78('0x27');return db[_0x1f78('0x28')][_0x1f78('0x25')]({'where':{'type':_0xdbd9bc,'resourceId':_0xed75e8['id']}})[_0x1f78('0x24')](function(){return _0x21f07a;});})[_0x1f78('0x24')](function(){_0x161025[_0x1f78('0x1d')](0xcc)[_0x1f78('0x1e')]();});}};}function handleEntityNotFound(_0x2d350a,_0x2aa96e){return function(_0x305740){if(!_0x305740){_0x2d350a['sendStatus'](0x194);}return _0x305740;};}function handleError(_0x2deec0,_0x1806b2){_0x1806b2=_0x1806b2||0x1f4;return function(_0x485af6){logger['error'](_0x485af6[_0x1f78('0x29')]);if(_0x485af6[_0x1f78('0x2a')]){delete _0x485af6['name'];}_0x2deec0[_0x1f78('0x1d')](_0x1806b2)[_0x1f78('0x2b')](_0x485af6);};}exports[_0x1f78('0x2c')]=function(_0x25e377,_0xeaee2b){var _0x2e801d={},_0x261eb7={},_0x2e7b0f={'count':0x0,'rows':[]};var _0x450739=_[_0x1f78('0x2d')](db[_0x1f78('0x2e')]['rawAttributes'],function(_0x31cfbc){return{'name':_0x31cfbc[_0x1f78('0x2f')],'type':_0x31cfbc[_0x1f78('0x30')]['key']};});_0x261eb7['model']=_[_0x1f78('0x2d')](_0x450739,_0x1f78('0x2a'));_0x261eb7[_0x1f78('0x31')]=_[_0x1f78('0x32')](_0x25e377[_0x1f78('0x31')]);_0x261eb7['filters']=_[_0x1f78('0x33')](_0x261eb7[_0x1f78('0x34')],_0x261eb7['query']);_0x2e801d['attributes']=_[_0x1f78('0x33')](_0x261eb7['model'],qs[_0x1f78('0x35')](_0x25e377['query'][_0x1f78('0x35')]));_0x2e801d[_0x1f78('0x36')]=_0x2e801d['attributes'][_0x1f78('0x37')]?_0x2e801d[_0x1f78('0x36')]:_0x261eb7[_0x1f78('0x34')];if(!_0x25e377['query'][_0x1f78('0x38')](_0x1f78('0x39'))){_0x2e801d['limit']=qs[_0x1f78('0x20')](_0x25e377['query'][_0x1f78('0x20')]);_0x2e801d[_0x1f78('0x1f')]=qs[_0x1f78('0x1f')](_0x25e377[_0x1f78('0x31')][_0x1f78('0x1f')]);}_0x2e801d[_0x1f78('0x3a')]=qs[_0x1f78('0x3b')](_0x25e377['query'][_0x1f78('0x3b')]);_0x2e801d[_0x1f78('0x3c')]=qs[_0x1f78('0x3d')](_[_0x1f78('0x3e')](_0x25e377[_0x1f78('0x31')],_0x261eb7[_0x1f78('0x3d')]),_0x450739);if(_0x25e377[_0x1f78('0x31')]['filter']){_0x2e801d[_0x1f78('0x3c')]=_[_0x1f78('0x3f')](_0x2e801d[_0x1f78('0x3c')],{'$or':_['map'](_0x450739,function(_0x4febea){if(_0x4febea['type']!==_0x1f78('0x40')){var _0x3329c9={};_0x3329c9[_0x4febea[_0x1f78('0x2a')]]={'$like':'%'+_0x25e377[_0x1f78('0x31')][_0x1f78('0x41')]+'%'};return _0x3329c9;}})});}_0x2e801d=_['merge']({},_0x2e801d,_0x25e377[_0x1f78('0x42')]);var _0x1dd6cd={'where':_0x2e801d[_0x1f78('0x3c')]};return db[_0x1f78('0x2e')][_0x1f78('0x43')](_0x1dd6cd)[_0x1f78('0x24')](function(_0x332247){_0x2e7b0f[_0x1f78('0x43')]=_0x332247;if(_0x25e377['query'][_0x1f78('0x44')]){_0x2e801d[_0x1f78('0x45')]=[{'all':!![]}];}return db[_0x1f78('0x2e')]['findAll'](_0x2e801d);})['then'](function(_0x4d5b36){_0x2e7b0f[_0x1f78('0x46')]=_0x4d5b36;return _0x2e7b0f;})['then'](respondWithFilteredResult(_0xeaee2b,_0x2e801d))[_0x1f78('0x47')](handleError(_0xeaee2b,null));};exports[_0x1f78('0x48')]=function(_0x39b05a,_0x1acfee){var _0x57991d={'raw':![],'where':{'id':_0x39b05a[_0x1f78('0x49')]['id']}},_0x3d709f={};_0x3d709f[_0x1f78('0x34')]=_[_0x1f78('0x32')](db['VoicePrefix'][_0x1f78('0x4a')]);_0x3d709f[_0x1f78('0x31')]=_[_0x1f78('0x32')](_0x39b05a[_0x1f78('0x31')]);_0x3d709f[_0x1f78('0x3d')]=_[_0x1f78('0x33')](_0x3d709f['model'],_0x3d709f[_0x1f78('0x31')]);_0x57991d[_0x1f78('0x36')]=_[_0x1f78('0x33')](_0x3d709f[_0x1f78('0x34')],qs['fields'](_0x39b05a[_0x1f78('0x31')][_0x1f78('0x35')]));_0x57991d[_0x1f78('0x36')]=_0x57991d[_0x1f78('0x36')][_0x1f78('0x37')]?_0x57991d[_0x1f78('0x36')]:_0x3d709f[_0x1f78('0x34')];if(_0x39b05a['query']['includeAll']){_0x57991d[_0x1f78('0x45')]=[{'all':!![]}];}_0x57991d=_[_0x1f78('0x3f')]({},_0x57991d,_0x39b05a['options']);return db['VoicePrefix'][_0x1f78('0x4b')](_0x57991d)[_0x1f78('0x24')](handleEntityNotFound(_0x1acfee,null))[_0x1f78('0x24')](respondWithResult(_0x1acfee,null))[_0x1f78('0x47')](handleError(_0x1acfee,null));};exports[_0x1f78('0x25')]=function(_0x1772ab,_0x459d12){return db['VoicePrefix']['find']({'where':{'id':_0x1772ab[_0x1f78('0x49')]['id']}})['then'](handleEntityNotFound(_0x459d12,null))['then'](removeEntity(_0x459d12,null))['catch'](handleError(_0x459d12,null));};exports[_0x1f78('0x4c')]=function(_0x33ef6d,_0x352e9c){return db[_0x1f78('0x2e')][_0x1f78('0x4c')]()[_0x1f78('0x24')](respondWithResult(_0x352e9c,null))[_0x1f78('0x47')](handleError(_0x352e9c,null));};exports[_0x1f78('0x4d')]=function(_0x130e58,_0x50a9a4){var _0x31702e;return db['sequelize'][_0x1f78('0x4e')](function(_0x599497){return db[_0x1f78('0x2e')][_0x1f78('0x4d')](_0x130e58[_0x1f78('0x4f')],{'transaction':_0x599497})['then'](function(_0x1814ae){_0x31702e=_0x1814ae['get']({'plain':!![]});return db[_0x1f78('0x50')][_0x1f78('0x4b')]({'where':{'id':_0x31702e[_0x1f78('0x51')]},'raw':!![]})['then'](function(_0x340c84){return createVoicePrefixExtensions(_0x31702e,_0x340c84,_0x599497);});});})[_0x1f78('0x24')](function(){var _0x5ad284=_0x130e58[_0x1f78('0x52')][_0x1f78('0x26')]({'plain':!![]});if(!_0x5ad284)throw new Error(_0x1f78('0x53'));if(_0x5ad284['role']===_0x1f78('0x52')){var _0x4c92c6=_0x31702e;return db[_0x1f78('0x54')][_0x1f78('0x4b')]({'where':{'name':_0x1f78('0x27'),'userProfileId':_0x5ad284[_0x1f78('0x55')]},'raw':!![]})[_0x1f78('0x24')](function(_0x226a90){if(_0x226a90&&_0x226a90[_0x1f78('0x56')]===0x0){return db[_0x1f78('0x28')][_0x1f78('0x4d')]({'name':_0x4c92c6[_0x1f78('0x2a')],'resourceId':_0x4c92c6['id'],'type':_0x226a90['name'],'sectionId':_0x226a90['id']},{})[_0x1f78('0x24')](function(){return _0x31702e;});}else{return _0x31702e;}})[_0x1f78('0x47')](function(_0x92de75){logger[_0x1f78('0x57')](_0x1f78('0x58'),_0x92de75);throw _0x92de75;});}return _0x31702e;})[_0x1f78('0x24')](respondWithResult(_0x50a9a4,null))['catch'](handleError(_0x50a9a4,null));};function Extension(_0x58aec0,_0x4854bb,_0x1dbff8,_0x433752){this['context']=_0x1f78('0x59');this[_0x1f78('0x5a')]=_0x58aec0;this[_0x1f78('0x5b')]=_0x1dbff8;this[_0x1f78('0x30')]=_0x1f78('0x5c');this[_0x1f78('0x5d')]=_0x1f78('0x5e');this[_0x1f78('0x5f')]=_0x4854bb;this[_0x1f78('0x60')]=_0x433752;}function createVoicePrefixExtensions(_0x5e371a,_0x36bd3d,_0x24bc9e){return new BPromise(function(_0x3f2f36,_0x4c734f){var _0x348633=new Extension(formatPrefixName(_0x5e371a[_0x1f78('0x61')]),0x1,'NoOp',_0x1f78('0x62'));_0x348633[_0x1f78('0x63')]=_0x5e371a['id'];return db[_0x1f78('0x50')][_0x1f78('0x4d')](_0x348633,{'transaction':_0x24bc9e})['then'](function(_0x1316b2){var _0x4bd4fd=_0x1316b2['get']({'plain':!![]});var _0x2f992b=_[_0x1f78('0x2d')](addVoicePrefixExtensions(_0x5e371a,_0x36bd3d),function(_0x55f370){_0x55f370[_0x1f78('0x51')]=_0x4bd4fd['id'];_0x55f370[_0x1f78('0x63')]=_0x5e371a['id'];return _0x55f370;});return db[_0x1f78('0x50')][_0x1f78('0x64')](_0x2f992b,{'transaction':_0x24bc9e})[_0x1f78('0x24')](function(_0x435179){if(!_0x435179){return _0x4c734f(_0x1f78('0x65'));}else{return _0x3f2f36(_0x435179);}})[_0x1f78('0x47')](function(_0xc02cdc){return _0x4c734f(_0xc02cdc);});});;});};function addVoicePrefixExtensions(_0x5170bd,_0x544c95){var _0x167c76=[];var _0x5cd6dd=formatPrefixName(_0x5170bd['prefix']);_0x167c76[_0x1f78('0x66')](new Extension(_0x5cd6dd,0x2,_0x1f78('0x67'),_0x1f78('0x68')+_0x5170bd[_0x1f78('0x2a')]));if(_0x5170bd[_0x1f78('0x69')]){_0x167c76['push'](new Extension(_0x5cd6dd,0x3,'Set',_0x1f78('0x6a')+_0x5170bd[_0x1f78('0x69')]));}else{_0x167c76['push'](new Extension(_0x5cd6dd,0x3,_0x1f78('0x6b'),'No\x20callerid\x20available'));}_0x167c76['push'](new Extension(_0x5cd6dd,0x4,_0x1f78('0x6c'),_0x544c95[_0x1f78('0x6d')]+','+_0x1f78('0x6e')+(0x8+_0x5170bd['name']['length'])+'}'+','+0x1));return _0x167c76;}function formatPrefixName(_0x740d7e){var _0x2c4d3f='_';for(var _0x5e6196=0x0;_0x5e6196<_0x740d7e[_0x1f78('0x37')];_0x5e6196++){if(_0x740d7e[_0x1f78('0x6f')](_0x5e6196)=='-'){_0x2c4d3f+=_0x740d7e[_0x1f78('0x6f')](_0x5e6196);}else{_0x2c4d3f+='['+_0x740d7e[_0x1f78('0x6f')](_0x5e6196)+']';}}_0x2c4d3f+='.';return _0x2c4d3f;}exports[_0x1f78('0x23')]=function(_0x1037be,_0x511f48,_0x5dac8c){var _0x2406fe=_0x1037be['body'];_0x2406fe['prefix']=_0x1f78('0x70')+_0x2406fe['name']+'-';return db[_0x1f78('0x71')]['transaction'](function(_0x14d0f5){return db[_0x1f78('0x2e')][_0x1f78('0x23')](_0x2406fe,{'where':{'id':_0x2406fe['id']},'transaction':_0x14d0f5})[_0x1f78('0x24')](function(){return db[_0x1f78('0x50')][_0x1f78('0x25')]({'where':{'VoicePrefixId':_0x2406fe['id']},'transaction':_0x14d0f5})[_0x1f78('0x24')](function(){return db[_0x1f78('0x50')][_0x1f78('0x4b')]({'where':{'id':_0x2406fe[_0x1f78('0x51')]},'raw':!![]})['then'](function(_0x506917){return createVoicePrefixExtensions(_0x2406fe,_0x506917,_0x14d0f5);});});});})['then'](function(){return db[_0x1f78('0x2e')]['findById'](_0x2406fe['id']);})[_0x1f78('0x24')](respondWithResult(_0x511f48,null))[_0x1f78('0x47')](handleError(_0x511f48,null));};exports[_0x1f78('0x72')]=function(_0x2dc1e1,_0x235bd6,_0x12badf){return db[_0x1f78('0x2e')][_0x1f78('0x4b')]({'where':{'id':_0x2dc1e1[_0x1f78('0x49')]['id']}})[_0x1f78('0x24')](handleEntityNotFound(_0x235bd6,null))[_0x1f78('0x24')](function(_0x4f93fd){if(_0x4f93fd){return _0x4f93fd[_0x1f78('0x72')](_0x2dc1e1['body'][_0x1f78('0x73')],_[_0x1f78('0x74')](_0x2dc1e1['body'],[_0x1f78('0x73'),'id'])||{})[_0x1f78('0x75')](function(_0x12319d){for(var _0x170d5b=0x0;_0x170d5b<_0x2dc1e1[_0x1f78('0x4f')][_0x1f78('0x73')][_0x1f78('0x37')];_0x170d5b+=0x1){socket[_0x1f78('0x76')](_0x1f78('0x77'),{'UserId':_0x2dc1e1[_0x1f78('0x4f')][_0x1f78('0x73')][_0x170d5b],'VoicePrefixId':_0x2dc1e1['params']['id']});}return _0x12319d;});}})[_0x1f78('0x24')](respondWithResult(_0x235bd6,null))[_0x1f78('0x47')](handleError(_0x235bd6,null));};exports[_0x1f78('0x78')]=function(_0x3096db,_0x35cf0c,_0x7bf3d3){return db[_0x1f78('0x2e')][_0x1f78('0x4b')]({'where':{'id':_0x3096db['params']['id']}})[_0x1f78('0x24')](handleEntityNotFound(_0x35cf0c,null))['then'](function(_0x9ecc15){if(_0x9ecc15){return _0x9ecc15[_0x1f78('0x78')](_0x3096db[_0x1f78('0x31')][_0x1f78('0x73')])[_0x1f78('0x24')](function(){if(_[_0x1f78('0x79')](_0x3096db[_0x1f78('0x31')]['ids'])){for(var _0x47eddb=0x0;_0x47eddb<_0x3096db['query']['ids'][_0x1f78('0x37')];_0x47eddb+=0x1){socket[_0x1f78('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x3096db[_0x1f78('0x31')]['ids'][_0x47eddb]),'VoicePrefixId':Number(_0x3096db[_0x1f78('0x49')]['id'])});}}else{socket['emit'](_0x1f78('0x7a'),{'UserId':Number(_0x3096db['query'][_0x1f78('0x73')]),'VoicePrefixId':Number(_0x3096db['params']['id'])});}});}})[_0x1f78('0x24')](respondWithStatusCode(_0x35cf0c,null))['catch'](handleError(_0x35cf0c,null));};exports[_0x1f78('0x7b')]=function(_0x5c496a,_0x45f6ee,_0x22d1a2){var _0x17b83c={};var _0x4c0649={};var _0x318351;var _0x39cd04;return db['VoicePrefix'][_0x1f78('0x7c')]({'where':{'id':_0x5c496a[_0x1f78('0x49')]['id']}})['then'](handleEntityNotFound(_0x45f6ee,null))['then'](function(_0xbf7f55){if(_0xbf7f55){_0x318351=_0xbf7f55;_0x4c0649[_0x1f78('0x34')]=_[_0x1f78('0x32')](db[_0x1f78('0x7d')][_0x1f78('0x4a')]);_0x4c0649[_0x1f78('0x31')]=_[_0x1f78('0x32')](_0x5c496a[_0x1f78('0x31')]);_0x4c0649['filters']=_['intersection'](_0x4c0649['model'],_0x4c0649[_0x1f78('0x31')]);_0x17b83c[_0x1f78('0x36')]=_['intersection'](_0x4c0649[_0x1f78('0x34')],qs['fields'](_0x5c496a['query'][_0x1f78('0x35')]));_0x17b83c[_0x1f78('0x36')]=_0x17b83c[_0x1f78('0x36')][_0x1f78('0x37')]?_0x17b83c[_0x1f78('0x36')]:_0x4c0649[_0x1f78('0x34')];_0x17b83c['order']=qs[_0x1f78('0x3b')](_0x5c496a[_0x1f78('0x31')]['sort']);_0x17b83c['where']=qs[_0x1f78('0x3d')](_['pick'](_0x5c496a[_0x1f78('0x31')],_0x4c0649['filters']));if(_0x5c496a['query'][_0x1f78('0x41')]){_0x17b83c[_0x1f78('0x3c')]=_[_0x1f78('0x3f')](_0x17b83c[_0x1f78('0x3c')],{'$or':_[_0x1f78('0x2d')](_0x17b83c[_0x1f78('0x36')],function(_0x30fc0f){var _0x5ef7ce={};_0x5ef7ce[_0x30fc0f]={'$like':'%'+_0x5c496a[_0x1f78('0x31')][_0x1f78('0x41')]+'%'};return _0x5ef7ce;})});}_0x17b83c=_[_0x1f78('0x3f')]({},_0x17b83c,_0x5c496a[_0x1f78('0x42')]);return _0x318351[_0x1f78('0x7b')](_0x17b83c);}})[_0x1f78('0x24')](function(_0x5d2476){if(_0x5d2476){_0x39cd04=_0x5d2476['length'];if(!_0x5c496a[_0x1f78('0x31')]['hasOwnProperty'](_0x1f78('0x39'))){_0x17b83c['limit']=qs[_0x1f78('0x20')](_0x5c496a[_0x1f78('0x31')][_0x1f78('0x20')]);_0x17b83c[_0x1f78('0x1f')]=qs['offset'](_0x5c496a[_0x1f78('0x31')][_0x1f78('0x1f')]);}return _0x318351[_0x1f78('0x7b')](_0x17b83c);}})[_0x1f78('0x24')](function(_0x54ee32){if(_0x54ee32){return _0x54ee32?{'count':_0x39cd04,'rows':_0x54ee32}:null;}})['then'](respondWithResult(_0x45f6ee,null))[_0x1f78('0x47')](handleError(_0x45f6ee,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index ea92255..519fdce 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 _0xcb91=['save','update','emit','hasOwnProperty','hook','VoicePrefix','setMaxListeners'];(function(_0x2968cf,_0x3cedde){var _0x55fbe9=function(_0x16c160){while(--_0x16c160){_0x2968cf['push'](_0x2968cf['shift']());}};_0x55fbe9(++_0x3cedde);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0xcb91[_0x4b784d];return _0x2cdeaf;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x1cb9('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x1cb9('0x1')](0x0);var events={'afterCreate':_0x1cb9('0x2'),'afterUpdate':_0x1cb9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x8c392f){return function(_0x2c17b8,_0x545a34,_0x13d5fd){VoicePrefixEvents[_0x1cb9('0x4')](_0x8c392f+':'+_0x2c17b8['id'],_0x2c17b8);VoicePrefixEvents['emit'](_0x8c392f,_0x2c17b8);_0x13d5fd(null);};}for(var e in events){if(events[_0x1cb9('0x5')](e)){var event=events[e];VoicePrefix[_0x1cb9('0x6')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xedd9=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xedd9,0xfc));var _0x9edd=function(_0x13753a,_0x300278){_0x13753a=_0x13753a-0x0;var _0xd505af=_0xedd9[_0x13753a];return _0xd505af;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x9edd('0x0'))['db'][_0x9edd('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9edd('0x2')](0x0);var events={'afterCreate':_0x9edd('0x3'),'afterUpdate':_0x9edd('0x4'),'afterDestroy':_0x9edd('0x5')};function emitEvent(_0x3e6d3a){return function(_0x36b53f,_0x5943b3,_0x33679f){VoicePrefixEvents[_0x9edd('0x6')](_0x3e6d3a+':'+_0x36b53f['id'],_0x36b53f);VoicePrefixEvents[_0x9edd('0x6')](_0x3e6d3a,_0x36b53f);_0x33679f(null);};}for(var e in events){if(events[_0x9edd('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x9edd('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 71022ad..a710b34 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 _0x570c=['./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x570c,0x1a8));var _0xc570=function(_0x55f9f8,_0x33b01b){_0x55f9f8=_0x55f9f8-0x0;var _0x11a344=_0x570c[_0x55f9f8];return _0x11a344;};'use strict';var _=require(_0xc570('0x0'));var util=require(_0xc570('0x1'));var logger=require(_0xc570('0x2'))('api');var moment=require(_0xc570('0x3'));var BPromise=require(_0xc570('0x4'));var rp=require(_0xc570('0x5'));var fs=require('fs');var path=require(_0xc570('0x6'));var rimraf=require('rimraf');var config=require(_0xc570('0x7'));var attributes=require(_0xc570('0x8'));module[_0xc570('0x9')]=function(_0x1f8ba1,_0x1d20c8){return _0x1f8ba1[_0xc570('0xa')](_0xc570('0xb'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x897b=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix'];(function(_0x1eb13f,_0x2e351a){var _0x521e95=function(_0x16fa3d){while(--_0x16fa3d){_0x1eb13f['push'](_0x1eb13f['shift']());}};_0x521e95(++_0x2e351a);}(_0x897b,0x15c));var _0xb897=function(_0x5bf5f7,_0x30bf9c){_0x5bf5f7=_0x5bf5f7-0x0;var _0x5484c2=_0x897b[_0x5bf5f7];return _0x5484c2;};'use strict';var _=require(_0xb897('0x0'));var util=require('util');var logger=require(_0xb897('0x1'))(_0xb897('0x2'));var moment=require(_0xb897('0x3'));var BPromise=require('bluebird');var rp=require(_0xb897('0x4'));var fs=require('fs');var path=require(_0xb897('0x5'));var rimraf=require(_0xb897('0x6'));var config=require(_0xb897('0x7'));var attributes=require(_0xb897('0x8'));module[_0xb897('0x9')]=function(_0x25dde3,_0x1729fd){return _0x25dde3[_0xb897('0xa')](_0xb897('0xb'),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 5770d35..23299c4 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 _0x6435=['error','code','message','info','result','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s'];(function(_0x3b80ea,_0x4caa7e){var _0x325690=function(_0x1e49dc){while(--_0x1e49dc){_0x3b80ea['push'](_0x3b80ea['shift']());}};_0x325690(++_0x4caa7e);}(_0x6435,0xb4));var _0x5643=function(_0x10d314,_0x1a1541){_0x10d314=_0x10d314-0x0;var _0xf011d2=_0x6435[_0x10d314];return _0xf011d2;};'use strict';var _=require(_0x5643('0x0'));var util=require(_0x5643('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5643('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x5643('0x3'))(_0x5643('0x4'));var config=require(_0x5643('0x5'));var jayson=require(_0x5643('0x6'));var client=jayson[_0x5643('0x7')][_0x5643('0x8')]({'port':0x232a});config[_0x5643('0x9')]=_[_0x5643('0xa')](config[_0x5643('0x9')],{'host':_0x5643('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5643('0x9')]));require(_0x5643('0xc'))[_0x5643('0xd')](socket);function respondWithRpcPromise(_0x206b44,_0x6030e4,_0x3ec85e){return new BPromise(function(_0x9e8e72,_0x5ecb46){return client[_0x5643('0xe')](_0x206b44,_0x3ec85e)[_0x5643('0xf')](function(_0x55d765){logger['info'](_0x5643('0x10'),_0x6030e4,_0x5643('0x11'));logger[_0x5643('0x12')](_0x5643('0x13'),_0x6030e4,'request\x20sent',JSON['stringify'](_0x55d765));if(_0x55d765['error']){if(_0x55d765[_0x5643('0x14')][_0x5643('0x15')]===0x1f4){logger[_0x5643('0x14')](_0x5643('0x10'),_0x6030e4,_0x55d765[_0x5643('0x14')][_0x5643('0x16')]);return _0x5ecb46(_0x55d765[_0x5643('0x14')][_0x5643('0x16')]);}logger['error'](_0x5643('0x10'),_0x6030e4,_0x55d765[_0x5643('0x14')][_0x5643('0x16')]);return _0x9e8e72(_0x55d765[_0x5643('0x14')][_0x5643('0x16')]);}else{logger[_0x5643('0x17')](_0x5643('0x10'),_0x6030e4,'request\x20sent');_0x9e8e72(_0x55d765[_0x5643('0x18')]['message']);}})['catch'](function(_0x31b53b){logger['error'](_0x5643('0x10'),_0x6030e4,_0x31b53b);_0x5ecb46(_0x31b53b);});});} \ No newline at end of file +var _0x33dc=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voicePrefix.socket','info','VoicePrefix,\x20%s,\x20%s','debug','error','message','request\x20sent','result','catch','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x28badd,_0x273fde){var _0x2e6ced=function(_0x22a9bb){while(--_0x22a9bb){_0x28badd['push'](_0x28badd['shift']());}};_0x2e6ced(++_0x273fde);}(_0x33dc,0x126));var _0xc33d=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x33dc[_0x543084];return _0x306a57;};'use strict';var _=require('lodash');var util=require(_0xc33d('0x0'));var moment=require(_0xc33d('0x1'));var BPromise=require(_0xc33d('0x2'));var rs=require(_0xc33d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc33d('0x4'));var logger=require(_0xc33d('0x5'))(_0xc33d('0x6'));var config=require(_0xc33d('0x7'));var jayson=require(_0xc33d('0x8'));var client=jayson[_0xc33d('0x9')][_0xc33d('0xa')]({'port':0x232a});config[_0xc33d('0xb')]=_[_0xc33d('0xc')](config[_0xc33d('0xb')],{'host':_0xc33d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc33d('0xb')]));require(_0xc33d('0xe'))['register'](socket);function respondWithRpcPromise(_0x7a4d7e,_0xaa1add,_0x35b98c){return new BPromise(function(_0x3e8a1e,_0xb97e09){return client['request'](_0x7a4d7e,_0x35b98c)['then'](function(_0x54f4b0){logger[_0xc33d('0xf')](_0xc33d('0x10'),_0xaa1add,'request\x20sent');logger[_0xc33d('0x11')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0xaa1add,'request\x20sent',JSON['stringify'](_0x54f4b0));if(_0x54f4b0[_0xc33d('0x12')]){if(_0x54f4b0[_0xc33d('0x12')]['code']===0x1f4){logger['error']('VoicePrefix,\x20%s,\x20%s',_0xaa1add,_0x54f4b0[_0xc33d('0x12')][_0xc33d('0x13')]);return _0xb97e09(_0x54f4b0[_0xc33d('0x12')][_0xc33d('0x13')]);}logger['error'](_0xc33d('0x10'),_0xaa1add,_0x54f4b0['error'][_0xc33d('0x13')]);return _0x3e8a1e(_0x54f4b0[_0xc33d('0x12')][_0xc33d('0x13')]);}else{logger[_0xc33d('0xf')](_0xc33d('0x10'),_0xaa1add,_0xc33d('0x14'));_0x3e8a1e(_0x54f4b0[_0xc33d('0x15')][_0xc33d('0x13')]);}})[_0xc33d('0x16')](function(_0x5cf8a2){logger[_0xc33d('0x12')](_0xc33d('0x10'),_0xaa1add,_0x5cf8a2);_0xb97e09(_0x5cf8a2);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 4e85cc6..b0cefc5 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 _0xdf23=['removeListener','register','length','voicePrefix:','./voicePrefix.events','save','remove','update','emit'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xdf23,0x11b));var _0x3df2=function(_0x13e277,_0x3e2031){_0x13e277=_0x13e277-0x0;var _0x2c3ee9=_0xdf23[_0x13e277];return _0x2c3ee9;};'use strict';var VoicePrefixEvents=require(_0x3df2('0x0'));var events=[_0x3df2('0x1'),_0x3df2('0x2'),_0x3df2('0x3')];function createListener(_0x1808bb,_0x4231f3){return function(_0x556e3d){_0x4231f3[_0x3df2('0x4')](_0x1808bb,_0x556e3d);};}function removeListener(_0x42f787,_0x21a8c9){return function(){VoicePrefixEvents[_0x3df2('0x5')](_0x42f787,_0x21a8c9);};}exports[_0x3df2('0x6')]=function(_0x3c4fb4){for(var _0x5b7879=0x0,_0x2666f6=events[_0x3df2('0x7')];_0x5b7879<_0x2666f6;_0x5b7879++){var _0x48b24a=events[_0x5b7879];var _0x3c13aa=createListener(_0x3df2('0x8')+_0x48b24a,_0x3c4fb4);VoicePrefixEvents['on'](_0x48b24a,_0x3c13aa);}}; \ No newline at end of file +var _0xcca8=['voicePrefix:','./voicePrefix.events','emit','register','length'];(function(_0x135d50,_0x49fdf6){var _0x29836c=function(_0x1c43e9){while(--_0x1c43e9){_0x135d50['push'](_0x135d50['shift']());}};_0x29836c(++_0x49fdf6);}(_0xcca8,0x114));var _0x8cca=function(_0xd06a8b,_0x3ce43e){_0xd06a8b=_0xd06a8b-0x0;var _0xe9b203=_0xcca8[_0xd06a8b];return _0xe9b203;};'use strict';var VoicePrefixEvents=require(_0x8cca('0x0'));var events=['save','remove','update'];function createListener(_0x396fc0,_0x19107d){return function(_0x2b7b7a){_0x19107d[_0x8cca('0x1')](_0x396fc0,_0x2b7b7a);};}function removeListener(_0x2316fb,_0x48ef0c){return function(){VoicePrefixEvents['removeListener'](_0x2316fb,_0x48ef0c);};}exports[_0x8cca('0x2')]=function(_0x1783eb){for(var _0x43186f=0x0,_0x415498=events[_0x8cca('0x3')];_0x43186f<_0x415498;_0x43186f++){var _0x3ec7e5=events[_0x43186f];var _0x359147=createListener(_0x8cca('0x4')+_0x3ec7e5,_0x1783eb);VoicePrefixEvents['on'](_0x3ec7e5,_0x359147);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index b607a96..17b7cb4 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 _0x8f71=['isAuthenticated','index','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','create','post','/:id/clone','clone','addAgents','addBlackLists','put','update','delete','/:id','removeTeams','removeAgents','removeLists','removeBlackLists','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x8f71,0x91));var _0x18f7=function(_0x1a517b,_0x2711c6){_0x1a517b=_0x1a517b-0x0;var _0x5d7c92=_0x8f71[_0x1a517b];return _0x5d7c92;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x18f7('0x0'));var timeout=require(_0x18f7('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x18f7('0x2'));var interaction=require(_0x18f7('0x3'));var config=require(_0x18f7('0x4'));var controller=require(_0x18f7('0x5'));router[_0x18f7('0x6')]('/',auth[_0x18f7('0x7')](),controller[_0x18f7('0x8')]);router['get']('/:id',auth[_0x18f7('0x7')](),controller['show']);router[_0x18f7('0x6')](_0x18f7('0x9'),auth[_0x18f7('0x7')](),controller[_0x18f7('0xa')]);router[_0x18f7('0x6')](_0x18f7('0xb'),auth[_0x18f7('0x7')](),controller['getHopperHistories']);router[_0x18f7('0x6')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x18f7('0xc')]);router[_0x18f7('0x6')](_0x18f7('0xd'),auth[_0x18f7('0x7')](),controller[_0x18f7('0xe')]);router[_0x18f7('0x6')](_0x18f7('0xf'),auth[_0x18f7('0x7')](),controller[_0x18f7('0x10')]);router[_0x18f7('0x6')](_0x18f7('0x11'),auth[_0x18f7('0x7')](),controller[_0x18f7('0x12')]);router['get'](_0x18f7('0x13'),auth[_0x18f7('0x7')](),controller[_0x18f7('0x14')]);router[_0x18f7('0x6')](_0x18f7('0x15'),auth[_0x18f7('0x7')](),controller[_0x18f7('0x16')]);router[_0x18f7('0x6')](_0x18f7('0x17'),auth[_0x18f7('0x7')](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller[_0x18f7('0x18')]);router[_0x18f7('0x19')](_0x18f7('0x1a'),auth['isAuthenticated'](),controller[_0x18f7('0x1b')]);router[_0x18f7('0x19')](_0x18f7('0xf'),auth[_0x18f7('0x7')](),controller['addTeams']);router[_0x18f7('0x19')](_0x18f7('0x11'),auth[_0x18f7('0x7')](),controller[_0x18f7('0x1c')]);router[_0x18f7('0x19')](_0x18f7('0x15'),auth[_0x18f7('0x7')](),controller['addLists']);router[_0x18f7('0x19')](_0x18f7('0x17'),auth['isAuthenticated'](),controller[_0x18f7('0x1d')]);router[_0x18f7('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x18f7('0x1f')]);router[_0x18f7('0x20')](_0x18f7('0x21'),auth['isAuthenticated'](),controller['destroy']);router[_0x18f7('0x20')](_0x18f7('0xf'),auth[_0x18f7('0x7')](),controller[_0x18f7('0x22')]);router[_0x18f7('0x20')]('/:id/users',auth['isAuthenticated'](),controller[_0x18f7('0x23')]);router['delete'](_0x18f7('0x15'),auth[_0x18f7('0x7')](),controller[_0x18f7('0x24')]);router[_0x18f7('0x20')](_0x18f7('0x17'),auth[_0x18f7('0x7')](),controller[_0x18f7('0x25')]);module['exports']=router; \ No newline at end of file +var _0x1e63=['../../components/interaction/service','../../config/environment','./voiceQueue.controller','isAuthenticated','index','get','show','/:id/hoppers','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addAgents','addLists','put','delete','destroy','removeTeams','removeAgents','removeLists','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x45682b,_0x22ef44){var _0x28c3cd=function(_0x59047b){while(--_0x59047b){_0x45682b['push'](_0x45682b['shift']());}};_0x28c3cd(++_0x22ef44);}(_0x1e63,0x9d));var _0x31e6=function(_0x594f25,_0x529d2f){_0x594f25=_0x594f25-0x0;var _0x1507db=_0x1e63[_0x594f25];return _0x1507db;};'use strict';var multer=require(_0x31e6('0x0'));var util=require(_0x31e6('0x1'));var path=require(_0x31e6('0x2'));var timeout=require(_0x31e6('0x3'));var express=require(_0x31e6('0x4'));var router=express[_0x31e6('0x5')]();var auth=require(_0x31e6('0x6'));var interaction=require(_0x31e6('0x7'));var config=require(_0x31e6('0x8'));var controller=require(_0x31e6('0x9'));router['get']('/',auth[_0x31e6('0xa')](),controller[_0x31e6('0xb')]);router[_0x31e6('0xc')]('/:id',auth[_0x31e6('0xa')](),controller[_0x31e6('0xd')]);router['get'](_0x31e6('0xe'),auth[_0x31e6('0xa')](),controller[_0x31e6('0xf')]);router['get']('/:id/hopper_histories',auth[_0x31e6('0xa')](),controller[_0x31e6('0x10')]);router[_0x31e6('0xc')]('/:id/hopper_finals',auth['isAuthenticated'](),controller[_0x31e6('0x11')]);router[_0x31e6('0xc')](_0x31e6('0x12'),auth[_0x31e6('0xa')](),controller[_0x31e6('0x13')]);router[_0x31e6('0xc')](_0x31e6('0x14'),auth[_0x31e6('0xa')](),controller[_0x31e6('0x15')]);router[_0x31e6('0xc')](_0x31e6('0x16'),auth['isAuthenticated'](),controller[_0x31e6('0x17')]);router[_0x31e6('0xc')](_0x31e6('0x18'),auth[_0x31e6('0xa')](),controller[_0x31e6('0x19')]);router[_0x31e6('0xc')](_0x31e6('0x1a'),auth[_0x31e6('0xa')](),controller['getLists']);router[_0x31e6('0xc')](_0x31e6('0x1b'),auth[_0x31e6('0xa')](),controller[_0x31e6('0x1c')]);router['post']('/',auth['isAuthenticated'](),controller[_0x31e6('0x1d')]);router[_0x31e6('0x1e')](_0x31e6('0x1f'),auth[_0x31e6('0xa')](),controller[_0x31e6('0x20')]);router[_0x31e6('0x1e')](_0x31e6('0x14'),auth['isAuthenticated'](),controller['addTeams']);router[_0x31e6('0x1e')](_0x31e6('0x16'),auth[_0x31e6('0xa')](),controller[_0x31e6('0x21')]);router['post'](_0x31e6('0x1a'),auth[_0x31e6('0xa')](),controller[_0x31e6('0x22')]);router[_0x31e6('0x1e')](_0x31e6('0x1b'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0x31e6('0x23')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x31e6('0x24')]('/:id',auth['isAuthenticated'](),controller[_0x31e6('0x25')]);router[_0x31e6('0x24')](_0x31e6('0x14'),auth[_0x31e6('0xa')](),controller[_0x31e6('0x26')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0x31e6('0x27')]);router['delete'](_0x31e6('0x1a'),auth['isAuthenticated'](),controller[_0x31e6('0x28')]);router[_0x31e6('0x24')](_0x31e6('0x1b'),auth[_0x31e6('0xa')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 2dd830e..e95b56b 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 _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','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)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x1ebe2f,_0x523227){var _0xdeb06f=function(_0x2a6051){while(--_0x2a6051){_0x1ebe2f['push'](_0x1ebe2f['shift']());}};_0xdeb06f(++_0x523227);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','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)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x27685e,_0x845417){var _0x224a6f=function(_0x24bd2b){while(--_0x24bd2b){_0x27685e['push'](_0x27685e['shift']());}};_0x224a6f(++_0x845417);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 8084176..3e52e18 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 _0x0a01=['./voiceQueue.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update','then','destroy','VoiceQueues','ignore','map','value','type','find','name','error','stack','send','index','VoiceQueue','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','QueueCampaigns','outbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','clone','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','findOne','VoiceQueueId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','findOrCreate','UserVoiceQueueRt','format','userVoiceQueue:save','removeTeams','ids','Agents','select','field','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','emit','addAgents','spread','upsert','isNil','removeAgents','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','NOW()','ContactId','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','VoiceQueueId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x282749,_0xaa4aec){var _0x107d1e=function(_0xc6e388){while(--_0xc6e388){_0x282749['push'](_0x282749['shift']());}};_0x107d1e(++_0xaa4aec);}(_0x0a01,0x156));var _0x10a0=function(_0x3ef18f,_0x414e68){_0x3ef18f=_0x3ef18f-0x0;var _0x39bf5e=_0x0a01[_0x3ef18f];return _0x39bf5e;};'use strict';var pdf=require(_0x10a0('0x0'));var emlformat=require(_0x10a0('0x1'));var rimraf=require(_0x10a0('0x2'));var zipdir=require(_0x10a0('0x3'));var jsonpatch=require(_0x10a0('0x4'));var rp=require(_0x10a0('0x5'));var moment=require(_0x10a0('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x10a0('0x7'));var util=require(_0x10a0('0x8'));var path=require(_0x10a0('0x9'));var sox=require(_0x10a0('0xa'));var csv=require(_0x10a0('0xb'));var ejs=require(_0x10a0('0xc'));var fs=require('fs');var _=require(_0x10a0('0xd'));var squel=require('squel');var crypto=require(_0x10a0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x10a0('0xf'));var toCsv=require(_0x10a0('0xb'));var querystring=require('querystring');var Papa=require(_0x10a0('0x10'));var Redis=require(_0x10a0('0x11'));var authService=require(_0x10a0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x10a0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x10a0('0x14'))(_0x10a0('0x15'));var utils=require(_0x10a0('0x16'));var config=require(_0x10a0('0x17'));var db=require('../../mysqldb')['db'];config[_0x10a0('0x18')]=_[_0x10a0('0x19')](config['redis'],{'host':_0x10a0('0x1a'),'port':0x18eb});var socket=require(_0x10a0('0x1b'))(new Redis(config[_0x10a0('0x18')]));require(_0x10a0('0x1c'))[_0x10a0('0x1d')](socket);function respondWithStatusCode(_0x2d0317,_0x14335b){_0x14335b=_0x14335b||0xcc;return function(_0xa237e3){if(_0xa237e3){return _0x2d0317[_0x10a0('0x1e')](_0x14335b);}return _0x2d0317[_0x10a0('0x1f')](_0x14335b)[_0x10a0('0x20')]();};}function respondWithResult(_0x580eab,_0x35c976){_0x35c976=_0x35c976||0xc8;return function(_0x17f179){if(_0x17f179){return _0x580eab[_0x10a0('0x1f')](_0x35c976)[_0x10a0('0x21')](_0x17f179);}};}function respondWithFilteredResult(_0x163c2d,_0x52654a){return function(_0x198974){if(_0x198974){var _0x5ecf41=_0x198974[_0x10a0('0x22')],_0x36b286=_0x52654a[_0x10a0('0x23')],_0x1912aa=_0x52654a[_0x10a0('0x23')]+_0x52654a['limit'],_0x3e411b;if(_0x1912aa>=_0x5ecf41){_0x1912aa=_0x5ecf41;_0x3e411b=0xc8;}else{_0x3e411b=0xce;}_0x163c2d[_0x10a0('0x1f')](_0x3e411b);return _0x163c2d[_0x10a0('0x24')](_0x10a0('0x25'),_0x36b286+'-'+_0x1912aa+'/'+_0x5ecf41)[_0x10a0('0x21')](_0x198974);}return null;};}function patchUpdates(_0x196350){return function(_0x10cc01){try{jsonpatch['apply'](_0x10cc01,_0x196350,!![]);}catch(_0xfaa7d3){return BPromise[_0x10a0('0x26')](_0xfaa7d3);}return _0x10cc01['save']();};}function saveUpdates(_0xb1ce15,_0x54607d){return function(_0x1339b6){if(_0x1339b6){return _0x1339b6[_0x10a0('0x27')](_0xb1ce15)[_0x10a0('0x28')](function(_0x5c2f71){return _0x5c2f71;});}return null;};}function removeEntity(_0x559557,_0x3ae200){return function(_0x428fdc){if(_0x428fdc){return _0x428fdc[_0x10a0('0x29')]()[_0x10a0('0x28')](function(){var _0x133611=_0x428fdc['get']({'plain':!![]});var _0x1c5b4b=[{'name':_0x10a0('0x2a'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x5172e5=_(_0x1c5b4b)['filter'](_0x10a0('0x2b'))[_0x10a0('0x2c')](_0x10a0('0x2d'))[_0x10a0('0x2d')]();if(_['includes'](_0x5172e5,_0x133611[_0x10a0('0x2e')])){return;}var _0x2b76ca=_[_0x10a0('0x2f')](_0x1c5b4b,[_0x10a0('0x2d'),_0x133611[_0x10a0('0x2e')]])[_0x10a0('0x30')];return db['UserProfileResource'][_0x10a0('0x29')]({'where':{'type':_0x2b76ca,'resourceId':_0x133611['id']}})[_0x10a0('0x28')](function(){return _0x428fdc;});})[_0x10a0('0x28')](function(){_0x559557[_0x10a0('0x1f')](0xcc)[_0x10a0('0x20')]();});}};}function handleEntityNotFound(_0x5198ff,_0x34dab1){return function(_0x257988){if(!_0x257988){_0x5198ff[_0x10a0('0x1e')](0x194);}return _0x257988;};}function handleError(_0x4a9d82,_0x41ff4d){_0x41ff4d=_0x41ff4d||0x1f4;return function(_0x30b86d){logger[_0x10a0('0x31')](_0x30b86d[_0x10a0('0x32')]);if(_0x30b86d['name']){delete _0x30b86d['name'];}_0x4a9d82['status'](_0x41ff4d)[_0x10a0('0x33')](_0x30b86d);};}exports[_0x10a0('0x34')]=function(_0x4a4fa3,_0x3c49c9){var _0x44df9c={},_0x421d9a={},_0x20151f={'count':0x0,'rows':[]};var _0x2d2d9c=_[_0x10a0('0x2c')](db[_0x10a0('0x35')][_0x10a0('0x36')],function(_0x33ac83){return{'name':_0x33ac83['fieldName'],'type':_0x33ac83[_0x10a0('0x2e')][_0x10a0('0x37')]};});_0x421d9a[_0x10a0('0x38')]=_[_0x10a0('0x2c')](_0x2d2d9c,_0x10a0('0x30'));_0x421d9a[_0x10a0('0x39')]=_[_0x10a0('0x3a')](_0x4a4fa3[_0x10a0('0x39')]);_0x421d9a[_0x10a0('0x3b')]=_[_0x10a0('0x3c')](_0x421d9a[_0x10a0('0x38')],_0x421d9a['query']);_0x44df9c[_0x10a0('0x3d')]=_['intersection'](_0x421d9a['model'],qs[_0x10a0('0x3e')](_0x4a4fa3[_0x10a0('0x39')][_0x10a0('0x3e')]));_0x44df9c[_0x10a0('0x3d')]=_0x44df9c[_0x10a0('0x3d')][_0x10a0('0x3f')]?_0x44df9c[_0x10a0('0x3d')]:_0x421d9a[_0x10a0('0x38')];if(!_0x4a4fa3[_0x10a0('0x39')][_0x10a0('0x40')](_0x10a0('0x41'))){_0x44df9c[_0x10a0('0x42')]=qs[_0x10a0('0x42')](_0x4a4fa3[_0x10a0('0x39')][_0x10a0('0x42')]);_0x44df9c[_0x10a0('0x23')]=qs[_0x10a0('0x23')](_0x4a4fa3['query'][_0x10a0('0x23')]);}_0x44df9c[_0x10a0('0x43')]=qs[_0x10a0('0x44')](_0x4a4fa3['query'][_0x10a0('0x44')]);_0x44df9c[_0x10a0('0x45')]=qs['filters'](_[_0x10a0('0x46')](_0x4a4fa3[_0x10a0('0x39')],_0x421d9a[_0x10a0('0x3b')]),_0x2d2d9c);if(_0x4a4fa3[_0x10a0('0x39')][_0x10a0('0x47')]){_0x44df9c[_0x10a0('0x45')]=_[_0x10a0('0x48')](_0x44df9c[_0x10a0('0x45')],{'$or':_['map'](_0x2d2d9c,function(_0x2dc39a){if(_0x2dc39a[_0x10a0('0x2e')]!==_0x10a0('0x49')){var _0x1ac7f5={};_0x1ac7f5[_0x2dc39a['name']]={'$like':'%'+_0x4a4fa3['query'][_0x10a0('0x47')]+'%'};return _0x1ac7f5;}})});}_0x44df9c=_[_0x10a0('0x48')]({},_0x44df9c,_0x4a4fa3[_0x10a0('0x4a')]);var _0x4024be={'where':_0x44df9c[_0x10a0('0x45')]};return db[_0x10a0('0x35')]['count'](_0x4024be)['then'](function(_0x1b40e7){_0x20151f[_0x10a0('0x22')]=_0x1b40e7;if(_0x4a4fa3[_0x10a0('0x39')]['includeAll']){_0x44df9c[_0x10a0('0x4b')]=[{'all':!![]}];}return db[_0x10a0('0x35')]['findAll'](_0x44df9c);})[_0x10a0('0x28')](function(_0x559fbd){_0x20151f[_0x10a0('0x4c')]=_0x559fbd;return _0x20151f;})[_0x10a0('0x28')](respondWithFilteredResult(_0x3c49c9,_0x44df9c))[_0x10a0('0x4d')](handleError(_0x3c49c9,null));};exports[_0x10a0('0x4e')]=function(_0x2dd013,_0x11898b){var _0x2d9e85={'raw':![],'where':{'id':_0x2dd013[_0x10a0('0x4f')]['id']}},_0x19dbc1={};_0x19dbc1[_0x10a0('0x38')]=_['keys'](db[_0x10a0('0x35')][_0x10a0('0x36')]);_0x19dbc1[_0x10a0('0x39')]=_[_0x10a0('0x3a')](_0x2dd013[_0x10a0('0x39')]);_0x19dbc1[_0x10a0('0x3b')]=_['intersection'](_0x19dbc1[_0x10a0('0x38')],_0x19dbc1[_0x10a0('0x39')]);_0x2d9e85[_0x10a0('0x3d')]=_['intersection'](_0x19dbc1[_0x10a0('0x38')],qs[_0x10a0('0x3e')](_0x2dd013['query'][_0x10a0('0x3e')]));_0x2d9e85[_0x10a0('0x3d')]=_0x2d9e85['attributes'][_0x10a0('0x3f')]?_0x2d9e85[_0x10a0('0x3d')]:_0x19dbc1[_0x10a0('0x38')];if(_0x2dd013[_0x10a0('0x39')][_0x10a0('0x50')]){_0x2d9e85[_0x10a0('0x4b')]=[{'all':!![]}];}_0x2d9e85=_['merge']({},_0x2d9e85,_0x2dd013['options']);return db[_0x10a0('0x35')][_0x10a0('0x2f')](_0x2d9e85)[_0x10a0('0x28')](handleEntityNotFound(_0x11898b,null))[_0x10a0('0x28')](respondWithResult(_0x11898b,null))[_0x10a0('0x4d')](handleError(_0x11898b,null));};exports[_0x10a0('0x51')]=function(_0xe8e8c4,_0x55b7c9){return db[_0x10a0('0x35')][_0x10a0('0x51')](_0xe8e8c4['body'],{})[_0x10a0('0x28')](function(_0x3979dd){var _0x532b31=_0xe8e8c4[_0x10a0('0x52')][_0x10a0('0x53')]({'plain':!![]});if(!_0x532b31)throw new Error(_0x10a0('0x54'));if(_0x532b31[_0x10a0('0x55')]===_0x10a0('0x52')){var _0x433483=_0x3979dd[_0x10a0('0x53')]({'plain':!![]});var _0x4edb8c=[{'name':_0x10a0('0x2a'),'value':_0x10a0('0x56')},{'name':_0x10a0('0x57'),'value':_0x10a0('0x58')}];var _0x4f65ec=_['find'](_0x4edb8c,['value',_0x433483[_0x10a0('0x2e')]])[_0x10a0('0x30')];return db[_0x10a0('0x59')][_0x10a0('0x2f')]({'where':{'name':_0x4f65ec,'userProfileId':_0x532b31[_0x10a0('0x5a')]},'raw':!![]})[_0x10a0('0x28')](function(_0x367c32){if(_0x367c32&&_0x367c32[_0x10a0('0x5b')]===0x0){return db[_0x10a0('0x5c')][_0x10a0('0x51')]({'name':_0x433483['name'],'resourceId':_0x433483['id'],'type':_0x367c32[_0x10a0('0x30')],'sectionId':_0x367c32['id']},{})[_0x10a0('0x28')](function(){return _0x3979dd;});}else{return _0x3979dd;}})['catch'](function(_0x292fc0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x292fc0);throw _0x292fc0;});}return _0x3979dd;})[_0x10a0('0x28')](respondWithResult(_0x55b7c9,0xc9))[_0x10a0('0x4d')](handleError(_0x55b7c9,null));};exports[_0x10a0('0x5d')]=function(_0x4cfaf,_0x59b2c4){var _0x19863b={'where':{'id':_0x4cfaf[_0x10a0('0x4f')]['id']}},_0x59e8d6={};_0x59e8d6[_0x10a0('0x38')]=_[_0x10a0('0x3a')](db[_0x10a0('0x35')][_0x10a0('0x36')]);_0x19863b[_0x10a0('0x3d')]=_[_0x10a0('0x3c')](_0x59e8d6['model'],qs[_0x10a0('0x3e')](_0x4cfaf[_0x10a0('0x39')]['fields']));_0x19863b[_0x10a0('0x3d')]=_0x19863b['attributes'][_0x10a0('0x3f')]?_0x19863b[_0x10a0('0x3d')]:_0x59e8d6[_0x10a0('0x38')];if(_0x4cfaf[_0x10a0('0x39')][_0x10a0('0x50')]){_0x19863b[_0x10a0('0x4b')]=[{'all':!![]}];}_0x19863b=_['merge']({},_0x19863b,_0x4cfaf['options']);return db[_0x10a0('0x35')][_0x10a0('0x2f')](_0x19863b)[_0x10a0('0x28')](handleEntityNotFound(_0x59b2c4,null))[_0x10a0('0x28')](function(_0x25f95b){if(_0x25f95b){var _0x2203e7=_0x25f95b[_0x10a0('0x53')]({'plain':!![]});_0x2203e7=qs[_0x10a0('0x5e')](_0x2203e7,['id',_0x10a0('0x5f'),'updatedAt']);_0x4cfaf['body']=_[_0x10a0('0x5e')](_0x4cfaf['body'],['id',_0x10a0('0x5f'),_0x10a0('0x60')]);return db[_0x10a0('0x35')][_0x10a0('0x51')](_[_0x10a0('0x48')](_0x2203e7,_0x4cfaf[_0x10a0('0x61')]),{'include':_0x4cfaf[_0x10a0('0x39')][_0x10a0('0x50')]?[{'all':!![]}]:undefined})[_0x10a0('0x28')](function(_0x11d911){var _0x14c2eb=_0x4cfaf[_0x10a0('0x52')]['get']({'plain':!![]});if(!_0x14c2eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x14c2eb[_0x10a0('0x55')]===_0x10a0('0x52')){var _0x29c586=_0x11d911[_0x10a0('0x53')]({'plain':!![]});var _0x579c2c=[{'name':_0x10a0('0x2a'),'value':'inbound'},{'name':_0x10a0('0x57'),'value':_0x10a0('0x58')}];var _0x42cce1=_[_0x10a0('0x2f')](_0x579c2c,['value',_0x29c586['type']])[_0x10a0('0x30')];return db[_0x10a0('0x59')][_0x10a0('0x2f')]({'where':{'name':_0x42cce1,'userProfileId':_0x14c2eb[_0x10a0('0x5a')]},'raw':!![]})[_0x10a0('0x28')](function(_0x31391f){if(_0x31391f&&_0x31391f[_0x10a0('0x5b')]===0x0){return db['UserProfileResource'][_0x10a0('0x51')]({'name':_0x29c586[_0x10a0('0x30')],'resourceId':_0x29c586['id'],'type':_0x31391f['name'],'sectionId':_0x31391f['id']},{})[_0x10a0('0x28')](function(){return _0x11d911;});}else{return _0x11d911;}})[_0x10a0('0x4d')](function(_0x45d8c3){logger['error'](_0x10a0('0x62'),_0x45d8c3);throw _0x45d8c3;});}return _0x11d911;});}})['then'](respondWithResult(_0x59b2c4,0xc9))[_0x10a0('0x4d')](handleError(_0x59b2c4,null));};exports[_0x10a0('0x27')]=function(_0x5e13ab,_0x32e399){if(_0x5e13ab[_0x10a0('0x61')]['id']){delete _0x5e13ab[_0x10a0('0x61')]['id'];}return db[_0x10a0('0x35')][_0x10a0('0x2f')]({'where':{'id':_0x5e13ab['params']['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x32e399,null))[_0x10a0('0x28')](saveUpdates(_0x5e13ab[_0x10a0('0x61')],null))[_0x10a0('0x28')](respondWithResult(_0x32e399,null))[_0x10a0('0x4d')](handleError(_0x32e399,null));};exports['destroy']=function(_0x300c34,_0x4054ec){return db['VoiceQueue'][_0x10a0('0x2f')]({'where':{'id':_0x300c34[_0x10a0('0x4f')]['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x4054ec,null))[_0x10a0('0x28')](removeEntity(_0x4054ec,null))[_0x10a0('0x4d')](handleError(_0x4054ec,null));};exports[_0x10a0('0x63')]=function(_0x1240b2,_0x40ae8b,_0xb86a92){var _0xa231df={'raw':![],'where':{}};var _0x37fbbb={};var _0x1e0986={'count':0x0,'rows':[]};return db[_0x10a0('0x35')]['findOne']({'where':{'id':_0x1240b2[_0x10a0('0x4f')]['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x40ae8b,null))[_0x10a0('0x28')](function(_0x56ba80){if(_0x56ba80){_0x37fbbb[_0x10a0('0x38')]=_[_0x10a0('0x3a')](db[_0x10a0('0x64')][_0x10a0('0x36')]);_0x37fbbb['query']=_[_0x10a0('0x3a')](_0x1240b2[_0x10a0('0x39')]);_0x37fbbb[_0x10a0('0x3b')]=_[_0x10a0('0x3c')](_0x37fbbb['model'],_0x37fbbb[_0x10a0('0x39')]);_0xa231df['attributes']=_[_0x10a0('0x3c')](_0x37fbbb[_0x10a0('0x38')],qs[_0x10a0('0x3e')](_0x1240b2[_0x10a0('0x39')][_0x10a0('0x3e')]));_0xa231df[_0x10a0('0x3d')]=_0xa231df[_0x10a0('0x3d')][_0x10a0('0x3f')]?_0xa231df['attributes']:_0x37fbbb['model'];if(!_0x1240b2[_0x10a0('0x39')][_0x10a0('0x40')]('nolimit')){_0xa231df[_0x10a0('0x42')]=qs['limit'](_0x1240b2[_0x10a0('0x39')][_0x10a0('0x42')]);_0xa231df[_0x10a0('0x23')]=qs[_0x10a0('0x23')](_0x1240b2[_0x10a0('0x39')][_0x10a0('0x23')]);}_0xa231df[_0x10a0('0x43')]=qs[_0x10a0('0x44')](_0x1240b2[_0x10a0('0x39')][_0x10a0('0x44')]);_0xa231df[_0x10a0('0x45')]=qs['filters'](_[_0x10a0('0x46')](_0x1240b2[_0x10a0('0x39')],_0x37fbbb[_0x10a0('0x3b')]));_0xa231df[_0x10a0('0x45')]['VoiceQueueId']=_0x56ba80['id'];if(_0x1240b2['query']['filter']){_0xa231df['where']=_[_0x10a0('0x48')](_0xa231df[_0x10a0('0x45')],{'$or':_['map'](_0xa231df[_0x10a0('0x3d')],function(_0x355d11){var _0x3a08ab={};_0x3a08ab[_0x355d11]={'$like':'%'+_0x1240b2['query'][_0x10a0('0x47')]+'%'};return _0x3a08ab;})});}_0xa231df=_[_0x10a0('0x48')]({},_0xa231df,_0x1240b2[_0x10a0('0x4a')]);return db[_0x10a0('0x64')]['count']({'where':_0xa231df[_0x10a0('0x45')]})['then'](function(_0x131d85){_0x1e0986['count']=_0x131d85;if(_0x1240b2[_0x10a0('0x39')]['includeAll']){_0xa231df[_0x10a0('0x4b')]=[{'all':!![]}];}return db[_0x10a0('0x64')][_0x10a0('0x65')](_0xa231df);})[_0x10a0('0x28')](function(_0x530440){_0x1e0986['rows']=_0x530440;return _0x1e0986;});}})[_0x10a0('0x28')](respondWithFilteredResult(_0x40ae8b,_0xa231df))[_0x10a0('0x4d')](handleError(_0x40ae8b,null));};exports[_0x10a0('0x66')]=function(_0x36c499,_0x50a53f,_0x2496fe){var _0x40a073={'raw':!![],'where':{}};var _0x2201fc={};var _0x5ef946={'count':0x0,'rows':[]};return db[_0x10a0('0x35')]['findOne']({'where':{'id':_0x36c499[_0x10a0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x50a53f,null))['then'](function(_0x2d02aa){if(_0x2d02aa){_0x2201fc[_0x10a0('0x38')]=_[_0x10a0('0x3a')](db[_0x10a0('0x67')][_0x10a0('0x36')]);_0x2201fc['query']=_[_0x10a0('0x3a')](_0x36c499[_0x10a0('0x39')]);_0x2201fc[_0x10a0('0x3b')]=_[_0x10a0('0x3c')](_0x2201fc[_0x10a0('0x38')],_0x2201fc[_0x10a0('0x39')]);_0x40a073[_0x10a0('0x3d')]=_['intersection'](_0x2201fc['model'],qs[_0x10a0('0x3e')](_0x36c499[_0x10a0('0x39')][_0x10a0('0x3e')]));_0x40a073[_0x10a0('0x3d')]=_0x40a073['attributes'][_0x10a0('0x3f')]?_0x40a073[_0x10a0('0x3d')]:_0x2201fc[_0x10a0('0x38')];if(!_0x36c499['query']['hasOwnProperty'](_0x10a0('0x41'))){_0x40a073[_0x10a0('0x42')]=qs['limit'](_0x36c499[_0x10a0('0x39')][_0x10a0('0x42')]);_0x40a073[_0x10a0('0x23')]=qs['offset'](_0x36c499[_0x10a0('0x39')][_0x10a0('0x23')]);}_0x40a073[_0x10a0('0x43')]=qs[_0x10a0('0x44')](_0x36c499[_0x10a0('0x39')][_0x10a0('0x44')]);_0x40a073[_0x10a0('0x45')]=qs[_0x10a0('0x3b')](_[_0x10a0('0x46')](_0x36c499[_0x10a0('0x39')],_0x2201fc[_0x10a0('0x3b')]));_0x40a073['where']['VoiceQueueId']=_0x2d02aa['id'];if(_0x36c499['query'][_0x10a0('0x47')]){_0x40a073[_0x10a0('0x45')]=_[_0x10a0('0x48')](_0x40a073['where'],{'$or':_[_0x10a0('0x2c')](_0x40a073[_0x10a0('0x3d')],function(_0x4cc1fa){var _0x5f1fdb={};_0x5f1fdb[_0x4cc1fa]={'$like':'%'+_0x36c499[_0x10a0('0x39')][_0x10a0('0x47')]+'%'};return _0x5f1fdb;})});}_0x40a073=_[_0x10a0('0x48')]({},_0x40a073,_0x36c499[_0x10a0('0x4a')]);return db['CmHopperHistory'][_0x10a0('0x22')]({'where':_0x40a073[_0x10a0('0x45')]})['then'](function(_0x4421e8){_0x5ef946['count']=_0x4421e8;if(_0x36c499['query']['includeAll']){_0x40a073[_0x10a0('0x4b')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x10a0('0x65')](_0x40a073);})[_0x10a0('0x28')](function(_0x5545b7){_0x5ef946[_0x10a0('0x4c')]=_0x5545b7;return _0x5ef946;});}})[_0x10a0('0x28')](respondWithFilteredResult(_0x50a53f,_0x40a073))[_0x10a0('0x4d')](handleError(_0x50a53f,null));};exports[_0x10a0('0x68')]=function(_0x17d3bf,_0x1c7971,_0x29b380){var _0x3d9fb7={'raw':!![],'where':{}};var _0x2cbed6={};var _0x32cfd5={'count':0x0,'rows':[]};return db[_0x10a0('0x35')][_0x10a0('0x69')]({'where':{'id':_0x17d3bf[_0x10a0('0x4f')]['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x1c7971,null))['then'](function(_0x1f26ce){if(_0x1f26ce){_0x2cbed6[_0x10a0('0x38')]=_[_0x10a0('0x3a')](db['CmHopperFinal'][_0x10a0('0x36')]);_0x2cbed6[_0x10a0('0x39')]=_[_0x10a0('0x3a')](_0x17d3bf[_0x10a0('0x39')]);_0x2cbed6['filters']=_[_0x10a0('0x3c')](_0x2cbed6['model'],_0x2cbed6['query']);_0x3d9fb7[_0x10a0('0x3d')]=_['intersection'](_0x2cbed6[_0x10a0('0x38')],qs[_0x10a0('0x3e')](_0x17d3bf[_0x10a0('0x39')][_0x10a0('0x3e')]));_0x3d9fb7[_0x10a0('0x3d')]=_0x3d9fb7[_0x10a0('0x3d')][_0x10a0('0x3f')]?_0x3d9fb7['attributes']:_0x2cbed6[_0x10a0('0x38')];if(!_0x17d3bf[_0x10a0('0x39')]['hasOwnProperty']('nolimit')){_0x3d9fb7[_0x10a0('0x42')]=qs[_0x10a0('0x42')](_0x17d3bf['query'][_0x10a0('0x42')]);_0x3d9fb7['offset']=qs['offset'](_0x17d3bf[_0x10a0('0x39')]['offset']);}_0x3d9fb7[_0x10a0('0x43')]=qs[_0x10a0('0x44')](_0x17d3bf[_0x10a0('0x39')]['sort']);_0x3d9fb7[_0x10a0('0x45')]=qs[_0x10a0('0x3b')](_[_0x10a0('0x46')](_0x17d3bf['query'],_0x2cbed6['filters']));_0x3d9fb7[_0x10a0('0x45')][_0x10a0('0x6a')]=_0x1f26ce['id'];if(_0x17d3bf[_0x10a0('0x39')][_0x10a0('0x47')]){_0x3d9fb7['where']=_[_0x10a0('0x48')](_0x3d9fb7['where'],{'$or':_[_0x10a0('0x2c')](_0x3d9fb7[_0x10a0('0x3d')],function(_0x574aa1){var _0x50e98d={};_0x50e98d[_0x574aa1]={'$like':'%'+_0x17d3bf[_0x10a0('0x39')]['filter']+'%'};return _0x50e98d;})});}_0x3d9fb7=_['merge']({},_0x3d9fb7,_0x17d3bf[_0x10a0('0x4a')]);return db[_0x10a0('0x6b')][_0x10a0('0x22')]({'where':_0x3d9fb7[_0x10a0('0x45')]})[_0x10a0('0x28')](function(_0x1fbf58){_0x32cfd5[_0x10a0('0x22')]=_0x1fbf58;if(_0x17d3bf[_0x10a0('0x39')][_0x10a0('0x50')]){_0x3d9fb7['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x10a0('0x65')](_0x3d9fb7);})[_0x10a0('0x28')](function(_0x2eb8e3){_0x32cfd5[_0x10a0('0x4c')]=_0x2eb8e3;return _0x32cfd5;});}})[_0x10a0('0x28')](respondWithFilteredResult(_0x1c7971,_0x3d9fb7))[_0x10a0('0x4d')](handleError(_0x1c7971,null));};exports[_0x10a0('0x6c')]=function(_0x233a23,_0x740419,_0x2f8e7b){var _0x2f703b={'raw':!![],'where':{}};var _0xc55008={};var _0x224682={'count':0x0,'rows':[]};return db[_0x10a0('0x35')][_0x10a0('0x69')]({'where':{'id':_0x233a23[_0x10a0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x740419,null))['then'](function(_0x39fae0){if(_0x39fae0){_0xc55008[_0x10a0('0x38')]=_[_0x10a0('0x3a')](db[_0x10a0('0x6d')][_0x10a0('0x36')]);_0xc55008[_0x10a0('0x39')]=_['keys'](_0x233a23[_0x10a0('0x39')]);_0xc55008[_0x10a0('0x3b')]=_['intersection'](_0xc55008['model'],_0xc55008[_0x10a0('0x39')]);_0x2f703b[_0x10a0('0x3d')]=_[_0x10a0('0x3c')](_0xc55008['model'],qs[_0x10a0('0x3e')](_0x233a23['query']['fields']));_0x2f703b[_0x10a0('0x3d')]=_0x2f703b[_0x10a0('0x3d')][_0x10a0('0x3f')]?_0x2f703b[_0x10a0('0x3d')]:_0xc55008[_0x10a0('0x38')];if(!_0x233a23[_0x10a0('0x39')]['hasOwnProperty']('nolimit')){_0x2f703b[_0x10a0('0x42')]=qs[_0x10a0('0x42')](_0x233a23[_0x10a0('0x39')][_0x10a0('0x42')]);_0x2f703b[_0x10a0('0x23')]=qs[_0x10a0('0x23')](_0x233a23[_0x10a0('0x39')][_0x10a0('0x23')]);}_0x2f703b['order']=qs[_0x10a0('0x44')](_0x233a23[_0x10a0('0x39')][_0x10a0('0x44')]);_0x2f703b[_0x10a0('0x45')]=qs[_0x10a0('0x3b')](_[_0x10a0('0x46')](_0x233a23[_0x10a0('0x39')],_0xc55008[_0x10a0('0x3b')]));_0x2f703b[_0x10a0('0x45')][_0x10a0('0x6a')]=_0x39fae0['id'];if(_0x233a23[_0x10a0('0x39')][_0x10a0('0x47')]){_0x2f703b[_0x10a0('0x45')]=_['merge'](_0x2f703b['where'],{'$or':_[_0x10a0('0x2c')](_0x2f703b['attributes'],function(_0x59ea1d){var _0xffb23={};_0xffb23[_0x59ea1d]={'$like':'%'+_0x233a23[_0x10a0('0x39')]['filter']+'%'};return _0xffb23;})});}_0x2f703b=_['merge']({},_0x2f703b,_0x233a23[_0x10a0('0x4a')]);return db['CmHopperBlack'][_0x10a0('0x22')]({'where':_0x2f703b[_0x10a0('0x45')]})[_0x10a0('0x28')](function(_0x8600ea){_0x224682[_0x10a0('0x22')]=_0x8600ea;if(_0x233a23[_0x10a0('0x39')][_0x10a0('0x50')]){_0x2f703b[_0x10a0('0x4b')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x10a0('0x65')](_0x2f703b);})[_0x10a0('0x28')](function(_0x56731d){_0x224682['rows']=_0x56731d;return _0x224682;});}})[_0x10a0('0x28')](respondWithFilteredResult(_0x740419,_0x2f703b))[_0x10a0('0x4d')](handleError(_0x740419,null));};exports[_0x10a0('0x6e')]=function(_0x4d3a31,_0x77431b,_0x3ba2b9){var _0x2ade82={};var _0x546075={};var _0xd5b2f2;var _0x33884e;return db[_0x10a0('0x35')][_0x10a0('0x69')]({'where':{'id':_0x4d3a31['params']['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x77431b,null))[_0x10a0('0x28')](function(_0x4ec2b9){if(_0x4ec2b9){_0xd5b2f2=_0x4ec2b9;_0x546075[_0x10a0('0x38')]=_[_0x10a0('0x3a')](db[_0x10a0('0x6f')][_0x10a0('0x36')]);_0x546075[_0x10a0('0x39')]=_['keys'](_0x4d3a31[_0x10a0('0x39')]);_0x546075[_0x10a0('0x3b')]=_[_0x10a0('0x3c')](_0x546075[_0x10a0('0x38')],_0x546075[_0x10a0('0x39')]);_0x2ade82[_0x10a0('0x3d')]=_[_0x10a0('0x3c')](_0x546075[_0x10a0('0x38')],qs[_0x10a0('0x3e')](_0x4d3a31['query'][_0x10a0('0x3e')]));_0x2ade82['attributes']=_0x2ade82[_0x10a0('0x3d')][_0x10a0('0x3f')]?_0x2ade82[_0x10a0('0x3d')]:_0x546075[_0x10a0('0x38')];_0x2ade82[_0x10a0('0x43')]=qs[_0x10a0('0x44')](_0x4d3a31[_0x10a0('0x39')][_0x10a0('0x44')]);_0x2ade82[_0x10a0('0x45')]=qs['filters'](_[_0x10a0('0x46')](_0x4d3a31[_0x10a0('0x39')],_0x546075[_0x10a0('0x3b')]));if(_0x4d3a31[_0x10a0('0x39')][_0x10a0('0x47')]){_0x2ade82[_0x10a0('0x45')]=_[_0x10a0('0x48')](_0x2ade82[_0x10a0('0x45')],{'$or':_[_0x10a0('0x2c')](_0x2ade82[_0x10a0('0x3d')],function(_0x506e85){var _0x2dc04c={};_0x2dc04c[_0x506e85]={'$like':'%'+_0x4d3a31[_0x10a0('0x39')]['filter']+'%'};return _0x2dc04c;})});}_0x2ade82=_[_0x10a0('0x48')]({},_0x2ade82,_0x4d3a31['options']);return _0xd5b2f2[_0x10a0('0x6e')](_0x2ade82);}})['then'](function(_0x420e3e){if(_0x420e3e){_0x33884e=_0x420e3e[_0x10a0('0x3f')];if(!_0x4d3a31['query'][_0x10a0('0x40')]('nolimit')){_0x2ade82['limit']=qs['limit'](_0x4d3a31['query'][_0x10a0('0x42')]);_0x2ade82[_0x10a0('0x23')]=qs[_0x10a0('0x23')](_0x4d3a31[_0x10a0('0x39')][_0x10a0('0x23')]);}return _0xd5b2f2[_0x10a0('0x6e')](_0x2ade82);}})[_0x10a0('0x28')](function(_0x14bc13){if(_0x14bc13){return _0x14bc13?{'count':_0x33884e,'rows':_0x14bc13}:null;}})[_0x10a0('0x28')](respondWithResult(_0x77431b,null))[_0x10a0('0x4d')](handleError(_0x77431b,null));};exports[_0x10a0('0x70')]=function(_0x5485ff,_0xa7a1b8,_0x474830){var _0x118a41=_0x5485ff['body'][_0x10a0('0x71')];var _0xc99c68=_[_0x10a0('0x2c')](_0x118a41,'id');return db['Team'][_0x10a0('0x65')]({'where':{'id':_0xc99c68},'attributes':['id'],'include':[{'model':db[_0x10a0('0x72')],'as':'Agents','attributes':['id',_0x10a0('0x30'),_0x10a0('0x73'),_0x10a0('0x74'),_0x10a0('0x75')],'raw':!![]}]})[_0x10a0('0x28')](function(_0x1c88a1){if(_0x1c88a1){var _0x3814dd=_[_0x10a0('0x76')](_0x1c88a1,function(_0x551723){var _0x34f4a4=_0x551723['get']({'plain':!![]});_0x34f4a4['Agents'][_0x10a0('0x77')](function(_0x3d3ab2){_0x3d3ab2[_0x10a0('0x78')]=_[_0x10a0('0x2f')](_0x118a41,{'id':_0x34f4a4['id']})[_0x10a0('0x78')];});return _0x34f4a4['Agents'];});return db[_0x10a0('0x35')][_0x10a0('0x2f')]({'where':{'id':_0x5485ff['params']['id']}})['then'](function(_0x139dc5){return db[_0x10a0('0x79')][_0x10a0('0x7a')](function(_0x5924d2){return _0x139dc5['addTeams'](_0xc99c68,{'transaction':_0x5924d2})[_0x10a0('0x28')](function(){return BPromise[_0x10a0('0x7b')](_0x3814dd,function(_0x3163f7){return db['UserVoiceQueue'][_0x10a0('0x7c')]({'where':{'UserId':_0x3163f7['id'],'VoiceQueueId':_0x5485ff[_0x10a0('0x4f')]['id']},'defaults':{'penalty':_0x3163f7[_0x10a0('0x78')]},'transaction':_0x5924d2});});})[_0x10a0('0x28')](function(){return BPromise[_0x10a0('0x7b')](_[_0x10a0('0x47')](_0x3814dd,{'online':!![]}),function(_0x287e2a){return db[_0x10a0('0x7d')]['upsert']({'membername':_0x287e2a[_0x10a0('0x30')],'UserId':_0x287e2a['id'],'queue_name':_0x139dc5[_0x10a0('0x30')],'VoiceQueueId':_0x139dc5['id'],'interface':_['isNil'](_0x287e2a[_0x10a0('0x75')])?util[_0x10a0('0x7e')]('SIP/%s',_0x287e2a[_0x10a0('0x30')]):_0x287e2a[_0x10a0('0x75')],'paused':_0x287e2a['voicePause']||![],'penalty':_0x287e2a[_0x10a0('0x78')]},{'transaction':_0x5924d2});});})[_0x10a0('0x28')](function(){_0x3814dd[_0x10a0('0x77')](function(_0x1103c0){socket['emit'](_0x10a0('0x7f'),{'UserId':_0x1103c0['id'],'VoiceQueueId':_0x139dc5['id']});});});});});}})['then'](respondWithStatusCode(_0xa7a1b8,null))[_0x10a0('0x4d')](handleError(_0xa7a1b8,null));};exports[_0x10a0('0x80')]=function(_0x11dc6a,_0x274616,_0x5092b6){return db['Team']['findAll']({'where':{'id':_0x11dc6a[_0x10a0('0x39')][_0x10a0('0x81')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x10a0('0x82'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x274616,null))['then'](function(_0xaa5dcd){var _0x148d3a=_[_0x10a0('0x2c')](_0xaa5dcd,'id');var _0xa48205=[];var _0x47cdb3=[];var _0x4cdc23=squel[_0x10a0('0x83')]();_0x4cdc23[_0x10a0('0x84')](_0x10a0('0x85'))[_0x10a0('0x86')](_0x10a0('0x87'),'tq')[_0x10a0('0x88')]('user_has_teams','ut',_0x10a0('0x89'))['where']('VoiceQueueId\x20=\x20?',_0x11dc6a[_0x10a0('0x4f')]['id']);for(var _0x18b131=0x0;_0x18b131<_0xaa5dcd[_0x10a0('0x3f')];_0x18b131+=0x1){let _0x3502f3=_0xaa5dcd[_0x18b131];for(var _0x1b4874=0x0;_0x1b4874<_0x3502f3['Agents'][_0x10a0('0x3f')];_0x1b4874+=0x1){let _0x49ec4a=_0x3502f3[_0x10a0('0x82')][_0x1b4874];var _0x2e6be1=_0x4cdc23[_0x10a0('0x5d')]();_0x2e6be1['where']('ut.UserId\x20=\x20?',_0x49ec4a['id']);_0x47cdb3[_0x10a0('0x8a')](db[_0x10a0('0x79')][_0x10a0('0x39')](_0x2e6be1['toString'](),{'type':db[_0x10a0('0x79')][_0x10a0('0x8b')][_0x10a0('0x8c')]})[_0x10a0('0x28')](function(_0x31af5f){if(_0x31af5f['length']===0x1){return _0x49ec4a['id'];}else{var _0x13c0a4=_[_0x10a0('0x8d')](_[_0x10a0('0x2c')](_0x31af5f,_0x10a0('0x8e')),function(_0x1a99c6){return _[_0x10a0('0x8f')](_0x148d3a,_0x1a99c6);});if(_0x13c0a4){return _0x49ec4a['id'];}}}));}}return BPromise[_0x10a0('0x90')](_0x47cdb3)[_0x10a0('0x28')](function(_0x381cf6){_0xa48205=_(_0xa48205)[_0x10a0('0x91')](_0x381cf6)[_0x10a0('0x92')]()[_0x10a0('0x2d')]();return db['VoiceQueue'][_0x10a0('0x2f')]({'where':{'id':_0x11dc6a['params']['id']}})[_0x10a0('0x28')](function(_0x2808a1){return db[_0x10a0('0x79')]['transaction'](function(_0x18e455){return _0x2808a1[_0x10a0('0x80')](_0x11dc6a[_0x10a0('0x39')]['ids'],{'transaction':_0x18e455})[_0x10a0('0x28')](function(){if(!_['isEmpty'](_0xa48205)){return _0x2808a1['removeAgents'](_0xa48205,{'transaction':_0x18e455})[_0x10a0('0x28')](function(){return db[_0x10a0('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x11dc6a[_0x10a0('0x4f')]['id'],'UserId':_0xa48205},'transaction':_0x18e455});});}})[_0x10a0('0x28')](function(){_0xa48205['forEach'](function(_0x19be64){socket[_0x10a0('0x93')]('userVoiceQueue:remove',{'UserId':_0x19be64,'VoiceQueueId':_0x2808a1['id']});});});});});});})['then'](respondWithStatusCode(_0x274616,null))[_0x10a0('0x4d')](handleError(_0x274616,null));};exports['addAgents']=function(_0x2c8158,_0x462e29,_0x17dec9){var _0xf4c648,_0x399eb9;return db[_0x10a0('0x35')][_0x10a0('0x2f')]({'where':{'id':_0x2c8158[_0x10a0('0x4f')]['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x462e29,null))[_0x10a0('0x28')](function(_0x48a9f6){if(_0x48a9f6){_0x399eb9=_0x48a9f6;return _0x48a9f6[_0x10a0('0x94')](_0x2c8158[_0x10a0('0x61')][_0x10a0('0x81')],_[_0x10a0('0x5e')](_0x2c8158[_0x10a0('0x61')],[_0x10a0('0x81'),'id'])||{})[_0x10a0('0x95')](function(_0x204bee){for(var _0x54c99a=0x0;_0x54c99a<_0x2c8158['body'][_0x10a0('0x81')][_0x10a0('0x3f')];_0x54c99a+=0x1){socket[_0x10a0('0x93')]('userVoiceQueue:save',{'UserId':_0x2c8158[_0x10a0('0x61')][_0x10a0('0x81')][_0x54c99a],'VoiceQueueId':_0x2c8158[_0x10a0('0x4f')]['id']});}return _0x204bee;});}})[_0x10a0('0x28')](function(_0xbd4baa){_0xf4c648=_0xbd4baa||[];if(_0x399eb9){return db['User']['findAll']({'where':{'id':_0x2c8158[_0x10a0('0x61')]['ids']},'attributes':['id',_0x10a0('0x30'),_0x10a0('0x73'),_0x10a0('0x74'),_0x10a0('0x75')],'raw':!![]});}})[_0x10a0('0x28')](function(_0x220f7d){if(!_['isEmpty'](_0x220f7d)){var _0x393934=[];for(var _0x413529=0x0;_0x413529<_0x220f7d[_0x10a0('0x3f')];_0x413529++){if(_0x220f7d[_0x413529]['online']){_0x393934[_0x10a0('0x8a')](db['UserVoiceQueueRt'][_0x10a0('0x96')]({'membername':_0x220f7d[_0x413529][_0x10a0('0x30')],'UserId':_0x220f7d[_0x413529]['id'],'queue_name':_0x399eb9[_0x10a0('0x30')],'VoiceQueueId':_0x399eb9['id'],'interface':_[_0x10a0('0x97')](_0x220f7d[_0x413529][_0x10a0('0x75')])?util[_0x10a0('0x7e')]('SIP/%s',_0x220f7d[_0x413529]['name']):_0x220f7d[_0x413529]['interface'],'paused':_0x220f7d[_0x413529][_0x10a0('0x74')]||![],'penalty':_0x2c8158[_0x10a0('0x61')][_0x10a0('0x78')]||0x0}));}}return BPromise['all'](_0x393934);}})[_0x10a0('0x28')](function(){return _0xf4c648;})[_0x10a0('0x28')](respondWithResult(_0x462e29,null))[_0x10a0('0x4d')](handleError(_0x462e29,null));};exports['removeAgents']=function(_0x19d53c,_0x305865,_0x5748d6){return db[_0x10a0('0x35')][_0x10a0('0x2f')]({'where':{'id':_0x19d53c[_0x10a0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x305865,null))[_0x10a0('0x28')](function(_0x1b7084){if(_0x1b7084){return _0x1b7084[_0x10a0('0x98')](_0x19d53c[_0x10a0('0x39')][_0x10a0('0x81')])['then'](function(){if(_[_0x10a0('0x99')](_0x19d53c[_0x10a0('0x39')][_0x10a0('0x81')])){for(var _0x38c002=0x0;_0x38c002<_0x19d53c[_0x10a0('0x39')][_0x10a0('0x81')][_0x10a0('0x3f')];_0x38c002+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x19d53c['query'][_0x10a0('0x81')][_0x38c002]),'VoiceQueueId':Number(_0x19d53c[_0x10a0('0x4f')]['id'])});}}else{socket[_0x10a0('0x93')](_0x10a0('0x9a'),{'UserId':Number(_0x19d53c['query'][_0x10a0('0x81')]),'VoiceQueueId':Number(_0x19d53c['params']['id'])});}});}})['then'](function(_0x1eeab5){return db[_0x10a0('0x7d')][_0x10a0('0x29')]({'where':{'VoiceQueueId':_0x19d53c[_0x10a0('0x4f')]['id'],'UserId':_0x19d53c[_0x10a0('0x39')][_0x10a0('0x81')]}})[_0x10a0('0x28')](function(){return _0x1eeab5;});})[_0x10a0('0x28')](respondWithStatusCode(_0x305865,null))[_0x10a0('0x4d')](handleError(_0x305865,null));};exports[_0x10a0('0x9b')]=function(_0x48039b,_0x23e23c,_0x58a1b9){var _0x4e99ec={};var _0x1c7c86={};var _0xcea824;var _0x417033;return db[_0x10a0('0x35')]['findOne']({'where':{'id':_0x48039b[_0x10a0('0x4f')]['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x23e23c,null))['then'](function(_0x4bf37d){if(_0x4bf37d){_0xcea824=_0x4bf37d;_0x1c7c86[_0x10a0('0x38')]=_['keys'](db[_0x10a0('0x72')][_0x10a0('0x36')]);_0x1c7c86[_0x10a0('0x39')]=_[_0x10a0('0x3a')](_0x48039b[_0x10a0('0x39')]);_0x1c7c86[_0x10a0('0x3b')]=_[_0x10a0('0x3c')](_0x1c7c86[_0x10a0('0x38')],_0x1c7c86['query']);_0x4e99ec[_0x10a0('0x3d')]=_[_0x10a0('0x3c')](_0x1c7c86[_0x10a0('0x38')],qs[_0x10a0('0x3e')](_0x48039b[_0x10a0('0x39')][_0x10a0('0x3e')]));_0x4e99ec[_0x10a0('0x3d')]=_0x4e99ec[_0x10a0('0x3d')][_0x10a0('0x3f')]?_0x4e99ec[_0x10a0('0x3d')]:_0x1c7c86[_0x10a0('0x38')];_0x4e99ec[_0x10a0('0x43')]=qs['sort'](_0x48039b[_0x10a0('0x39')][_0x10a0('0x44')]);_0x4e99ec['where']=qs[_0x10a0('0x3b')](_[_0x10a0('0x46')](_0x48039b[_0x10a0('0x39')],_0x1c7c86[_0x10a0('0x3b')]));if(_0x48039b[_0x10a0('0x39')][_0x10a0('0x47')]){_0x4e99ec[_0x10a0('0x45')]=_[_0x10a0('0x48')](_0x4e99ec[_0x10a0('0x45')],{'$or':_['map'](_0x4e99ec[_0x10a0('0x3d')],function(_0x40ccfa){var _0x10d88c={};_0x10d88c[_0x40ccfa]={'$like':'%'+_0x48039b[_0x10a0('0x39')]['filter']+'%'};return _0x10d88c;})});}_0x4e99ec=_['merge']({},_0x4e99ec,_0x48039b[_0x10a0('0x4a')]);return _0xcea824['getAgents'](_0x4e99ec);}})[_0x10a0('0x28')](function(_0x22ddba){if(_0x22ddba){_0x417033=_0x22ddba[_0x10a0('0x3f')];if(!_0x48039b[_0x10a0('0x39')][_0x10a0('0x40')](_0x10a0('0x41'))){_0x4e99ec['limit']=qs[_0x10a0('0x42')](_0x48039b['query'][_0x10a0('0x42')]);_0x4e99ec[_0x10a0('0x23')]=qs['offset'](_0x48039b[_0x10a0('0x39')][_0x10a0('0x23')]);}return _0xcea824['getAgents'](_0x4e99ec);}})[_0x10a0('0x28')](function(_0x3cfcd1){if(_0x3cfcd1){return _0x3cfcd1?{'count':_0x417033,'rows':_0x3cfcd1}:null;}})[_0x10a0('0x28')](respondWithResult(_0x23e23c,null))[_0x10a0('0x4d')](handleError(_0x23e23c,null));};exports[_0x10a0('0x9c')]=function(_0x22c48c,_0x95207d,_0x270ba6){var _0x40f905={};var _0x520012={};var _0x3672f7;var _0x36b058;return db['VoiceQueue'][_0x10a0('0x69')]({'where':{'id':_0x22c48c['params']['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x95207d,null))[_0x10a0('0x28')](function(_0x44d8b5){if(_0x44d8b5){_0x3672f7=_0x44d8b5;_0x520012['model']=_['keys'](db[_0x10a0('0x7d')][_0x10a0('0x36')]);_0x520012['query']=_['keys'](_0x22c48c[_0x10a0('0x39')]);_0x520012[_0x10a0('0x3b')]=_[_0x10a0('0x3c')](_0x520012['model'],_0x520012[_0x10a0('0x39')]);_0x40f905[_0x10a0('0x3d')]=_[_0x10a0('0x3c')](_0x520012[_0x10a0('0x38')],qs[_0x10a0('0x3e')](_0x22c48c[_0x10a0('0x39')][_0x10a0('0x3e')]));_0x40f905[_0x10a0('0x3d')]=_0x40f905[_0x10a0('0x3d')][_0x10a0('0x3f')]?_0x40f905[_0x10a0('0x3d')]:_0x520012['model'];_0x40f905['order']=qs[_0x10a0('0x44')](_0x22c48c[_0x10a0('0x39')][_0x10a0('0x44')]);_0x40f905[_0x10a0('0x45')]=qs[_0x10a0('0x3b')](_[_0x10a0('0x46')](_0x22c48c[_0x10a0('0x39')],_0x520012[_0x10a0('0x3b')]));if(_0x22c48c['query']['filter']){_0x40f905[_0x10a0('0x45')]=_[_0x10a0('0x48')](_0x40f905['where'],{'$or':_[_0x10a0('0x2c')](_0x40f905[_0x10a0('0x3d')],function(_0x449112){var _0xe5ca4d={};_0xe5ca4d[_0x449112]={'$like':'%'+_0x22c48c['query']['filter']+'%'};return _0xe5ca4d;})});}_0x40f905=_[_0x10a0('0x48')]({},_0x40f905,_0x22c48c[_0x10a0('0x4a')]);return _0x3672f7['getMembers'](_0x40f905);}})[_0x10a0('0x28')](function(_0xec371e){if(_0xec371e){_0x36b058=_0xec371e[_0x10a0('0x3f')];if(!_0x22c48c[_0x10a0('0x39')][_0x10a0('0x40')](_0x10a0('0x41'))){_0x40f905[_0x10a0('0x42')]=qs[_0x10a0('0x42')](_0x22c48c[_0x10a0('0x39')][_0x10a0('0x42')]);_0x40f905[_0x10a0('0x23')]=qs['offset'](_0x22c48c[_0x10a0('0x39')][_0x10a0('0x23')]);}return _0x3672f7[_0x10a0('0x9c')](_0x40f905);}})['then'](function(_0xc4c563){return _0xc4c563?{'count':_0x36b058,'rows':_0xc4c563}:null;})[_0x10a0('0x28')](respondWithResult(_0x95207d,null))[_0x10a0('0x4d')](handleError(_0x95207d,null));};exports[_0x10a0('0x9d')]=function(_0x1c284d,_0x1b47a0,_0x23aa0f){var _0x8bf090={};var _0xe2033b={};var _0x1f505f;var _0x36161a;return db['VoiceQueue'][_0x10a0('0x69')]({'where':{'id':_0x1c284d[_0x10a0('0x4f')]['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x1b47a0,null))[_0x10a0('0x28')](function(_0x115c2b){if(_0x115c2b){_0x1f505f=_0x115c2b;_0xe2033b['model']=_[_0x10a0('0x3a')](db[_0x10a0('0x9e')][_0x10a0('0x36')]);_0xe2033b[_0x10a0('0x39')]=_[_0x10a0('0x3a')](_0x1c284d['query']);_0xe2033b['filters']=_[_0x10a0('0x3c')](_0xe2033b[_0x10a0('0x38')],_0xe2033b[_0x10a0('0x39')]);_0x8bf090['attributes']=_['intersection'](_0xe2033b[_0x10a0('0x38')],qs['fields'](_0x1c284d[_0x10a0('0x39')]['fields']));_0x8bf090[_0x10a0('0x3d')]=_0x8bf090[_0x10a0('0x3d')][_0x10a0('0x3f')]?_0x8bf090[_0x10a0('0x3d')]:_0xe2033b['model'];_0x8bf090[_0x10a0('0x43')]=qs['sort'](_0x1c284d[_0x10a0('0x39')][_0x10a0('0x44')]);_0x8bf090['where']=qs[_0x10a0('0x3b')](_[_0x10a0('0x46')](_0x1c284d[_0x10a0('0x39')],_0xe2033b[_0x10a0('0x3b')]));if(_0x1c284d[_0x10a0('0x39')][_0x10a0('0x47')]){_0x8bf090['where']=_[_0x10a0('0x48')](_0x8bf090[_0x10a0('0x45')],{'$or':_[_0x10a0('0x2c')](_0x8bf090[_0x10a0('0x3d')],function(_0x19f66a){var _0x2494b9={};_0x2494b9[_0x19f66a]={'$like':'%'+_0x1c284d['query'][_0x10a0('0x47')]+'%'};return _0x2494b9;})});}_0x8bf090=_[_0x10a0('0x48')]({},_0x8bf090,_0x1c284d[_0x10a0('0x4a')]);return _0x1f505f['getLists'](_0x8bf090);}})[_0x10a0('0x28')](function(_0x43529d){if(_0x43529d){_0x36161a=_0x43529d[_0x10a0('0x3f')];if(!_0x1c284d['query'][_0x10a0('0x40')](_0x10a0('0x41'))){_0x8bf090[_0x10a0('0x42')]=qs[_0x10a0('0x42')](_0x1c284d[_0x10a0('0x39')][_0x10a0('0x42')]);_0x8bf090['offset']=qs[_0x10a0('0x23')](_0x1c284d['query']['offset']);}return _0x1f505f[_0x10a0('0x9d')](_0x8bf090);}})[_0x10a0('0x28')](function(_0x4ecf40){if(_0x4ecf40){return _0x4ecf40?{'count':_0x36161a,'rows':_0x4ecf40}:null;}})[_0x10a0('0x28')](respondWithResult(_0x1b47a0,null))[_0x10a0('0x4d')](handleError(_0x1b47a0,null));};exports[_0x10a0('0x9f')]=function(_0x588b3b,_0x517fad,_0x3e3bba){var _0x47e17d,_0x44691b;return db[_0x10a0('0x35')]['find']({'where':{'id':_0x588b3b[_0x10a0('0x4f')]['id']}})['then'](handleEntityNotFound(_0x517fad,null))[_0x10a0('0x28')](function(_0x570879){if(_0x570879){_0x44691b=_0x570879;return _0x570879[_0x10a0('0x9f')](_0x588b3b['body'][_0x10a0('0x81')],_[_0x10a0('0x5e')](_0x588b3b[_0x10a0('0x61')],[_0x10a0('0x81'),'id'])||{});}return null;})['spread'](function(_0x180a06){var _0x9c693c;_0x47e17d=_0x180a06||[];var _0x2fee4b=[];if(_0x180a06){for(var _0x5df1a4=0x0;_0x5df1a4<_0x180a06[_0x10a0('0x3f')];_0x5df1a4+=0x1){var _0x4c4605=_0x180a06[_0x5df1a4][_0x10a0('0x53')]({'plain':!![]});_0x44691b[_0x10a0('0xa0')]=_0x588b3b[_0x10a0('0x61')]['dialCheckDuplicateType']?_0x588b3b[_0x10a0('0x61')]['dialCheckDuplicateType']:_0x44691b[_0x10a0('0xa0')];switch(_0x44691b[_0x10a0('0xa0')]){case'always':_0x9c693c=squel[_0x10a0('0xa1')]()[_0x10a0('0xa2')](_0x10a0('0xa3'))[_0x10a0('0xa4')]([_0x10a0('0xa5'),_0x10a0('0xa6'),'ContactId',_0x10a0('0xa7'),_0x10a0('0x6a'),_0x10a0('0x5f'),_0x10a0('0x60')],squel[_0x10a0('0x83')]()[_0x10a0('0x84')]('phone',_0x10a0('0xa5'))[_0x10a0('0x84')](_0x10a0('0xa8'),'scheduledAt')['field']('id',_0x10a0('0xa9'))[_0x10a0('0x84')](_0x4c4605[_0x10a0('0xaa')][_0x10a0('0xab')](),'ListId')['field'](_0x588b3b[_0x10a0('0x4f')]['id'][_0x10a0('0xab')](),_0x10a0('0x6a'))[_0x10a0('0x84')]('NOW()','createdAt')[_0x10a0('0x84')](_0x10a0('0xa8'),_0x10a0('0x60'))[_0x10a0('0x86')](_0x10a0('0xac'))[_0x10a0('0x45')](_0x10a0('0xad'))[_0x10a0('0x45')](_0x10a0('0xae'),_0x4c4605[_0x10a0('0xaa')][_0x10a0('0xab')]())[_0x10a0('0x45')](_0x10a0('0xaf'))[_0x10a0('0x45')](_0x10a0('0xb0'),squel[_0x10a0('0x83')]()[_0x10a0('0x84')](_0x10a0('0xb1'))[_0x10a0('0x86')]('cm_hopper_final')['where']('VoiceQueueId\x20=\x20?',_0x588b3b[_0x10a0('0x4f')]['id'][_0x10a0('0xab')]()))['where'](_0x10a0('0xb0'),squel[_0x10a0('0x83')]()['field'](_0x10a0('0xb2'))[_0x10a0('0x86')](_0x10a0('0xa3'))[_0x10a0('0x45')](_0x10a0('0xb3'),_0x588b3b['params']['id'][_0x10a0('0xab')]())))[_0x10a0('0xab')]();break;case'onlyIfOpen':_0x9c693c=squel['insert']()[_0x10a0('0xa2')](_0x10a0('0xa3'))[_0x10a0('0xa4')]([_0x10a0('0xa5'),_0x10a0('0xa6'),_0x10a0('0xa9'),'ListId',_0x10a0('0x6a'),_0x10a0('0x5f'),_0x10a0('0x60')],squel[_0x10a0('0x83')]()[_0x10a0('0x84')](_0x10a0('0xa5'),_0x10a0('0xa5'))['field']('NOW()','scheduledAt')[_0x10a0('0x84')]('id','ContactId')[_0x10a0('0x84')](_0x4c4605[_0x10a0('0xaa')][_0x10a0('0xab')](),_0x10a0('0xa7'))[_0x10a0('0x84')](_0x588b3b[_0x10a0('0x4f')]['id'][_0x10a0('0xab')](),_0x10a0('0x6a'))['field'](_0x10a0('0xa8'),_0x10a0('0x5f'))[_0x10a0('0x84')](_0x10a0('0xa8'),'updatedAt')[_0x10a0('0x86')](_0x10a0('0xac'))[_0x10a0('0x45')]('deletedAt\x20IS\x20NULL')[_0x10a0('0x45')](_0x10a0('0xae'),_0x4c4605['CmListId'][_0x10a0('0xab')]())[_0x10a0('0x45')](_0x10a0('0xaf'))[_0x10a0('0x45')]('phone\x20NOT\x20IN\x20(?)',squel[_0x10a0('0x83')]()[_0x10a0('0x84')](_0x10a0('0xb2'))[_0x10a0('0x86')](_0x10a0('0xa3'))[_0x10a0('0x45')](_0x10a0('0xb3'),_0x588b3b[_0x10a0('0x4f')]['id']['toString']())))[_0x10a0('0xab')]();break;default:_0x9c693c=squel['insert']()[_0x10a0('0xa2')]('cm_hopper')[_0x10a0('0xa4')](['phone',_0x10a0('0xa6'),'ContactId','ListId','VoiceQueueId',_0x10a0('0x5f'),_0x10a0('0x60')],squel['select']()[_0x10a0('0x84')](_0x10a0('0xa5'),'phone')[_0x10a0('0x84')](_0x10a0('0xa8'),_0x10a0('0xa6'))[_0x10a0('0x84')]('id',_0x10a0('0xa9'))[_0x10a0('0x84')](_0x4c4605[_0x10a0('0xaa')]['toString'](),_0x10a0('0xa7'))[_0x10a0('0x84')](_0x588b3b[_0x10a0('0x4f')]['id'][_0x10a0('0xab')](),_0x10a0('0x6a'))[_0x10a0('0x84')](_0x10a0('0xa8'),_0x10a0('0x5f'))[_0x10a0('0x84')](_0x10a0('0xa8'),_0x10a0('0x60'))[_0x10a0('0x86')]('cm_contacts')[_0x10a0('0x45')](_0x10a0('0xad'))[_0x10a0('0x45')](_0x10a0('0xae'),_0x4c4605[_0x10a0('0xaa')][_0x10a0('0xab')]())[_0x10a0('0x45')](_0x10a0('0xaf')))[_0x10a0('0xab')]();}_0x2fee4b[_0x10a0('0x8a')](db[_0x10a0('0x79')][_0x10a0('0x39')](_0x9c693c));}return BPromise[_0x10a0('0x90')](_0x2fee4b);}})[_0x10a0('0x28')](function(){return _0x47e17d;})[_0x10a0('0x28')](respondWithResult(_0x517fad,null))[_0x10a0('0x4d')](handleError(_0x517fad,null));};exports[_0x10a0('0xb4')]=function(_0x4e0dba,_0x5ced80,_0x2400f7){return db['VoiceQueue']['find']({'where':{'id':_0x4e0dba[_0x10a0('0x4f')]['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x5ced80,null))[_0x10a0('0x28')](function(_0x30c7b3){if(_0x30c7b3){return _0x30c7b3[_0x10a0('0xb4')](_0x4e0dba['query'][_0x10a0('0x81')]);}})[_0x10a0('0x28')](function(_0x378b96){if(_0x378b96){return db[_0x10a0('0x64')][_0x10a0('0x29')]({'where':{'ListId':_0x4e0dba[_0x10a0('0x39')][_0x10a0('0x81')],'VoiceQueueId':_0x4e0dba[_0x10a0('0x4f')]['id']}})[_0x10a0('0x28')](function(){return _0x378b96;});}})[_0x10a0('0x28')](respondWithStatusCode(_0x5ced80,null))[_0x10a0('0x4d')](handleError(_0x5ced80,null));};exports[_0x10a0('0xb5')]=function(_0x28729f,_0x5ce30c,_0x1e1804){var _0x1d9e44={};var _0x2939db={};var _0x553479;var _0x2b765c;return db['VoiceQueue'][_0x10a0('0x69')]({'where':{'id':_0x28729f[_0x10a0('0x4f')]['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x5ce30c,null))[_0x10a0('0x28')](function(_0x482644){if(_0x482644){_0x553479=_0x482644;_0x2939db[_0x10a0('0x38')]=_[_0x10a0('0x3a')](db[_0x10a0('0x9e')][_0x10a0('0x36')]);_0x2939db[_0x10a0('0x39')]=_['keys'](_0x28729f[_0x10a0('0x39')]);_0x2939db[_0x10a0('0x3b')]=_['intersection'](_0x2939db['model'],_0x2939db['query']);_0x1d9e44[_0x10a0('0x3d')]=_['intersection'](_0x2939db[_0x10a0('0x38')],qs[_0x10a0('0x3e')](_0x28729f[_0x10a0('0x39')][_0x10a0('0x3e')]));_0x1d9e44['attributes']=_0x1d9e44[_0x10a0('0x3d')]['length']?_0x1d9e44[_0x10a0('0x3d')]:_0x2939db[_0x10a0('0x38')];_0x1d9e44[_0x10a0('0x43')]=qs['sort'](_0x28729f[_0x10a0('0x39')][_0x10a0('0x44')]);_0x1d9e44[_0x10a0('0x45')]=qs[_0x10a0('0x3b')](_[_0x10a0('0x46')](_0x28729f[_0x10a0('0x39')],_0x2939db[_0x10a0('0x3b')]));if(_0x28729f['query'][_0x10a0('0x47')]){_0x1d9e44[_0x10a0('0x45')]=_[_0x10a0('0x48')](_0x1d9e44[_0x10a0('0x45')],{'$or':_[_0x10a0('0x2c')](_0x1d9e44[_0x10a0('0x3d')],function(_0x4c739e){var _0x3a8a99={};_0x3a8a99[_0x4c739e]={'$like':'%'+_0x28729f[_0x10a0('0x39')][_0x10a0('0x47')]+'%'};return _0x3a8a99;})});}_0x1d9e44=_[_0x10a0('0x48')]({},_0x1d9e44,_0x28729f['options']);return _0x553479['getBlackLists'](_0x1d9e44);}})[_0x10a0('0x28')](function(_0x52b0fa){if(_0x52b0fa){_0x2b765c=_0x52b0fa[_0x10a0('0x3f')];if(!_0x28729f[_0x10a0('0x39')][_0x10a0('0x40')](_0x10a0('0x41'))){_0x1d9e44[_0x10a0('0x42')]=qs[_0x10a0('0x42')](_0x28729f['query']['limit']);_0x1d9e44[_0x10a0('0x23')]=qs[_0x10a0('0x23')](_0x28729f['query'][_0x10a0('0x23')]);}return _0x553479['getBlackLists'](_0x1d9e44);}})[_0x10a0('0x28')](function(_0x568abd){if(_0x568abd){return _0x568abd?{'count':_0x2b765c,'rows':_0x568abd}:null;}})[_0x10a0('0x28')](respondWithResult(_0x5ce30c,null))[_0x10a0('0x4d')](handleError(_0x5ce30c,null));};exports[_0x10a0('0xb6')]=function(_0x1f433f,_0x18078b,_0x11c39c){var _0x1b3197,_0xb8d7b8;return db['VoiceQueue'][_0x10a0('0x2f')]({'where':{'id':_0x1f433f[_0x10a0('0x4f')]['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x18078b,null))[_0x10a0('0x28')](function(_0xad755a){if(_0xad755a){_0xb8d7b8=_0xad755a;return _0xad755a[_0x10a0('0xb6')](_0x1f433f['body']['ids'],_[_0x10a0('0x5e')](_0x1f433f[_0x10a0('0x61')],[_0x10a0('0x81'),'id'])||{});}return null;})[_0x10a0('0x95')](function(_0xea3799){var _0x5f5083;_0x1b3197=_0xea3799||[];var _0x3b3a68=[];if(_0xea3799){for(var _0x7e4017=0x0;_0x7e4017<_0xea3799[_0x10a0('0x3f')];_0x7e4017+=0x1){var _0x2c7141=_0xea3799[_0x7e4017][_0x10a0('0x53')]({'plain':!![]});_0x5f5083=squel['insert']()[_0x10a0('0xa2')](_0x10a0('0xb7'))[_0x10a0('0xa4')](['phone',_0x10a0('0xa9'),_0x10a0('0xa7'),_0x10a0('0x6a'),_0x10a0('0x5f'),'updatedAt'],squel[_0x10a0('0x83')]()['field'](_0x10a0('0xa5'),_0x10a0('0xa5'))[_0x10a0('0x84')]('id',_0x10a0('0xa9'))[_0x10a0('0x84')](_0x2c7141[_0x10a0('0xaa')]['toString'](),_0x10a0('0xa7'))['field'](_0x1f433f[_0x10a0('0x4f')]['id'][_0x10a0('0xab')](),'VoiceQueueId')['field']('NOW()',_0x10a0('0x5f'))[_0x10a0('0x84')](_0x10a0('0xa8'),'updatedAt')[_0x10a0('0x86')](_0x10a0('0xac'))['where'](_0x10a0('0xad'))[_0x10a0('0x45')]('ListId\x20=\x20?',_0x2c7141[_0x10a0('0xaa')][_0x10a0('0xab')]())['where'](_0x10a0('0xaf')))[_0x10a0('0xab')]();_0x3b3a68[_0x10a0('0x8a')](db['sequelize'][_0x10a0('0x39')](_0x5f5083));}return BPromise[_0x10a0('0x90')](_0x3b3a68);}})[_0x10a0('0x28')](function(){return _0x1b3197;})[_0x10a0('0x28')](respondWithResult(_0x18078b,null))[_0x10a0('0x4d')](handleError(_0x18078b,null));};exports[_0x10a0('0xb8')]=function(_0x5662c4,_0x8d1a99,_0x73074b){return db[_0x10a0('0x35')][_0x10a0('0x2f')]({'where':{'id':_0x5662c4[_0x10a0('0x4f')]['id']}})[_0x10a0('0x28')](handleEntityNotFound(_0x8d1a99,null))['then'](function(_0x2aa4e8){if(_0x2aa4e8){return _0x2aa4e8[_0x10a0('0xb8')](_0x5662c4[_0x10a0('0x39')]['ids']);}})[_0x10a0('0x28')](function(_0x4c90d2){if(_0x4c90d2){return db[_0x10a0('0x6d')][_0x10a0('0x29')]({'where':{'ListId':_0x5662c4[_0x10a0('0x39')][_0x10a0('0x81')],'VoiceQueueId':_0x5662c4[_0x10a0('0x4f')]['id']}})[_0x10a0('0x28')](function(){return _0x4c90d2;});}})['then'](respondWithStatusCode(_0x8d1a99,null))[_0x10a0('0x4d')](handleError(_0x8d1a99,null));}; \ No newline at end of file +var _0x29d6=['UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','userVoiceQueue:save','ids','select','tq.TeamId','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','SELECT','every','TeamId','includes','all','compact','removeTeams','isEmpty','removeAgents','forEach','emit','userVoiceQueue:remove','addAgents','push','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','field','NOW()','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','from','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','fromQuery','removeLists','getBlackLists','addBlackLists','cm_hopper_black','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','update','destroy','then','get','inbound','QueueCampaigns','outbound','filter','ignore','map','value','type','find','name','UserProfileResource','error','send','index','VoiceQueue','rawAttributes','fieldName','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','keys','options','create','body','user','role','userProfileId','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoiceQueues','UserProfileSection','autoAssociation','getHoppers','findOne','CmHopper','order','rows','getHopperHistories','CmHopperHistory','VoiceQueueId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','User','online','voicePause','flatMap','Agents','penalty','transaction','addTeams','each','findOrCreate'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x29d6,0xf4));var _0x629d=function(_0x56a713,_0x534195){_0x56a713=_0x56a713-0x0;var _0x1faaf6=_0x29d6[_0x56a713];return _0x1faaf6;};'use strict';var pdf=require(_0x629d('0x0'));var emlformat=require(_0x629d('0x1'));var rimraf=require(_0x629d('0x2'));var zipdir=require(_0x629d('0x3'));var jsonpatch=require(_0x629d('0x4'));var rp=require(_0x629d('0x5'));var moment=require(_0x629d('0x6'));var BPromise=require(_0x629d('0x7'));var Mustache=require(_0x629d('0x8'));var util=require(_0x629d('0x9'));var path=require('path');var sox=require(_0x629d('0xa'));var csv=require(_0x629d('0xb'));var ejs=require(_0x629d('0xc'));var fs=require('fs');var _=require(_0x629d('0xd'));var squel=require('squel');var crypto=require(_0x629d('0xe'));var jsforce=require(_0x629d('0xf'));var deskjs=require(_0x629d('0x10'));var toCsv=require(_0x629d('0xb'));var querystring=require(_0x629d('0x11'));var Papa=require(_0x629d('0x12'));var Redis=require(_0x629d('0x13'));var authService=require(_0x629d('0x14'));var qs=require(_0x629d('0x15'));var as=require(_0x629d('0x16'));var hardwareService=require(_0x629d('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x629d('0x18'));var config=require('../../config/environment');var db=require(_0x629d('0x19'))['db'];config[_0x629d('0x1a')]=_[_0x629d('0x1b')](config[_0x629d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x629d('0x1c'))(new Redis(config[_0x629d('0x1a')]));require('./voiceQueue.socket')[_0x629d('0x1d')](socket);function respondWithStatusCode(_0x2392c4,_0x344de6){_0x344de6=_0x344de6||0xcc;return function(_0x52d8ef){if(_0x52d8ef){return _0x2392c4[_0x629d('0x1e')](_0x344de6);}return _0x2392c4[_0x629d('0x1f')](_0x344de6)[_0x629d('0x20')]();};}function respondWithResult(_0x45421d,_0x14858a){_0x14858a=_0x14858a||0xc8;return function(_0x104485){if(_0x104485){return _0x45421d[_0x629d('0x1f')](_0x14858a)['json'](_0x104485);}};}function respondWithFilteredResult(_0x302bb0,_0x552b34){return function(_0x479812){if(_0x479812){var _0x4f87f4=_0x479812[_0x629d('0x21')],_0x4f3d94=_0x552b34[_0x629d('0x22')],_0x12ae63=_0x552b34[_0x629d('0x22')]+_0x552b34[_0x629d('0x23')],_0x5d3d3e;if(_0x12ae63>=_0x4f87f4){_0x12ae63=_0x4f87f4;_0x5d3d3e=0xc8;}else{_0x5d3d3e=0xce;}_0x302bb0[_0x629d('0x1f')](_0x5d3d3e);return _0x302bb0['set'](_0x629d('0x24'),_0x4f3d94+'-'+_0x12ae63+'/'+_0x4f87f4)[_0x629d('0x25')](_0x479812);}return null;};}function patchUpdates(_0x511cc3){return function(_0x2f0676){try{jsonpatch[_0x629d('0x26')](_0x2f0676,_0x511cc3,!![]);}catch(_0x172a03){return BPromise[_0x629d('0x27')](_0x172a03);}return _0x2f0676['save']();};}function saveUpdates(_0x2b17bc,_0x529c28){return function(_0x546582){if(_0x546582){return _0x546582[_0x629d('0x28')](_0x2b17bc)['then'](function(_0x38b62d){return _0x38b62d;});}return null;};}function removeEntity(_0x391122,_0x2f5a7e){return function(_0x9eeb4f){if(_0x9eeb4f){return _0x9eeb4f[_0x629d('0x29')]()[_0x629d('0x2a')](function(){var _0x217ac7=_0x9eeb4f[_0x629d('0x2b')]({'plain':!![]});var _0x47253b=[{'name':'VoiceQueues','value':_0x629d('0x2c'),'ignore':![]},{'name':_0x629d('0x2d'),'value':_0x629d('0x2e'),'ignore':![]}];var _0x586bbc=_(_0x47253b)[_0x629d('0x2f')](_0x629d('0x30'))[_0x629d('0x31')](_0x629d('0x32'))[_0x629d('0x32')]();if(_['includes'](_0x586bbc,_0x217ac7[_0x629d('0x33')])){return;}var _0x368d1e=_[_0x629d('0x34')](_0x47253b,[_0x629d('0x32'),_0x217ac7[_0x629d('0x33')]])[_0x629d('0x35')];return db[_0x629d('0x36')]['destroy']({'where':{'type':_0x368d1e,'resourceId':_0x217ac7['id']}})['then'](function(){return _0x9eeb4f;});})[_0x629d('0x2a')](function(){_0x391122[_0x629d('0x1f')](0xcc)[_0x629d('0x20')]();});}};}function handleEntityNotFound(_0x1e0bb3,_0x54bf4e){return function(_0x526db8){if(!_0x526db8){_0x1e0bb3[_0x629d('0x1e')](0x194);}return _0x526db8;};}function handleError(_0x1a940e,_0x21176b){_0x21176b=_0x21176b||0x1f4;return function(_0x28c22a){logger[_0x629d('0x37')](_0x28c22a['stack']);if(_0x28c22a[_0x629d('0x35')]){delete _0x28c22a[_0x629d('0x35')];}_0x1a940e[_0x629d('0x1f')](_0x21176b)[_0x629d('0x38')](_0x28c22a);};}exports[_0x629d('0x39')]=function(_0x405300,_0x2f9af7){var _0x5b522a={},_0x537622={},_0xffb5e={'count':0x0,'rows':[]};var _0x193121=_['map'](db[_0x629d('0x3a')][_0x629d('0x3b')],function(_0x2f9d37){return{'name':_0x2f9d37[_0x629d('0x3c')],'type':_0x2f9d37[_0x629d('0x33')]['key']};});_0x537622['model']=_[_0x629d('0x31')](_0x193121,_0x629d('0x35'));_0x537622[_0x629d('0x3d')]=_['keys'](_0x405300['query']);_0x537622[_0x629d('0x3e')]=_['intersection'](_0x537622[_0x629d('0x3f')],_0x537622[_0x629d('0x3d')]);_0x5b522a[_0x629d('0x40')]=_[_0x629d('0x41')](_0x537622[_0x629d('0x3f')],qs[_0x629d('0x42')](_0x405300[_0x629d('0x3d')][_0x629d('0x42')]));_0x5b522a[_0x629d('0x40')]=_0x5b522a[_0x629d('0x40')][_0x629d('0x43')]?_0x5b522a['attributes']:_0x537622[_0x629d('0x3f')];if(!_0x405300[_0x629d('0x3d')][_0x629d('0x44')](_0x629d('0x45'))){_0x5b522a[_0x629d('0x23')]=qs['limit'](_0x405300[_0x629d('0x3d')]['limit']);_0x5b522a['offset']=qs[_0x629d('0x22')](_0x405300[_0x629d('0x3d')][_0x629d('0x22')]);}_0x5b522a['order']=qs[_0x629d('0x46')](_0x405300['query'][_0x629d('0x46')]);_0x5b522a[_0x629d('0x47')]=qs['filters'](_[_0x629d('0x48')](_0x405300[_0x629d('0x3d')],_0x537622[_0x629d('0x3e')]),_0x193121);if(_0x405300['query'][_0x629d('0x2f')]){_0x5b522a[_0x629d('0x47')]=_[_0x629d('0x49')](_0x5b522a[_0x629d('0x47')],{'$or':_['map'](_0x193121,function(_0x4f5e78){if(_0x4f5e78[_0x629d('0x33')]!==_0x629d('0x4a')){var _0x15b803={};_0x15b803[_0x4f5e78[_0x629d('0x35')]]={'$like':'%'+_0x405300[_0x629d('0x3d')][_0x629d('0x2f')]+'%'};return _0x15b803;}})});}_0x5b522a=_[_0x629d('0x49')]({},_0x5b522a,_0x405300['options']);var _0x442d4e={'where':_0x5b522a[_0x629d('0x47')]};return db[_0x629d('0x3a')]['count'](_0x442d4e)['then'](function(_0x4266d7){_0xffb5e['count']=_0x4266d7;if(_0x405300[_0x629d('0x3d')][_0x629d('0x4b')]){_0x5b522a[_0x629d('0x4c')]=[{'all':!![]}];}return db[_0x629d('0x3a')][_0x629d('0x4d')](_0x5b522a);})[_0x629d('0x2a')](function(_0x322f9e){_0xffb5e['rows']=_0x322f9e;return _0xffb5e;})['then'](respondWithFilteredResult(_0x2f9af7,_0x5b522a))[_0x629d('0x4e')](handleError(_0x2f9af7,null));};exports[_0x629d('0x4f')]=function(_0x4faaff,_0x2b7edc){var _0x4ade1a={'raw':![],'where':{'id':_0x4faaff[_0x629d('0x50')]['id']}},_0x5673f4={};_0x5673f4[_0x629d('0x3f')]=_[_0x629d('0x51')](db[_0x629d('0x3a')]['rawAttributes']);_0x5673f4[_0x629d('0x3d')]=_['keys'](_0x4faaff[_0x629d('0x3d')]);_0x5673f4['filters']=_[_0x629d('0x41')](_0x5673f4[_0x629d('0x3f')],_0x5673f4[_0x629d('0x3d')]);_0x4ade1a[_0x629d('0x40')]=_['intersection'](_0x5673f4['model'],qs[_0x629d('0x42')](_0x4faaff[_0x629d('0x3d')][_0x629d('0x42')]));_0x4ade1a['attributes']=_0x4ade1a[_0x629d('0x40')][_0x629d('0x43')]?_0x4ade1a[_0x629d('0x40')]:_0x5673f4['model'];if(_0x4faaff[_0x629d('0x3d')]['includeAll']){_0x4ade1a[_0x629d('0x4c')]=[{'all':!![]}];}_0x4ade1a=_['merge']({},_0x4ade1a,_0x4faaff[_0x629d('0x52')]);return db[_0x629d('0x3a')][_0x629d('0x34')](_0x4ade1a)['then'](handleEntityNotFound(_0x2b7edc,null))[_0x629d('0x2a')](respondWithResult(_0x2b7edc,null))[_0x629d('0x4e')](handleError(_0x2b7edc,null));};exports[_0x629d('0x53')]=function(_0x5c1736,_0x1c91e2){return db['VoiceQueue']['create'](_0x5c1736[_0x629d('0x54')],{})['then'](function(_0x308eaa){var _0x4b0a7a=_0x5c1736[_0x629d('0x55')][_0x629d('0x2b')]({'plain':!![]});if(!_0x4b0a7a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4b0a7a[_0x629d('0x56')]===_0x629d('0x55')){var _0x1a3bd4=_0x308eaa['get']({'plain':!![]});var _0x23fbff=[{'name':'VoiceQueues','value':_0x629d('0x2c')},{'name':_0x629d('0x2d'),'value':'outbound'}];var _0x4ab230=_[_0x629d('0x34')](_0x23fbff,['value',_0x1a3bd4['type']])['name'];return db['UserProfileSection'][_0x629d('0x34')]({'where':{'name':_0x4ab230,'userProfileId':_0x4b0a7a[_0x629d('0x57')]},'raw':!![]})[_0x629d('0x2a')](function(_0x19fc46){if(_0x19fc46&&_0x19fc46['autoAssociation']===0x0){return db[_0x629d('0x36')][_0x629d('0x53')]({'name':_0x1a3bd4[_0x629d('0x35')],'resourceId':_0x1a3bd4['id'],'type':_0x19fc46[_0x629d('0x35')],'sectionId':_0x19fc46['id']},{})[_0x629d('0x2a')](function(){return _0x308eaa;});}else{return _0x308eaa;}})[_0x629d('0x4e')](function(_0x5f417f){logger[_0x629d('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f417f);throw _0x5f417f;});}return _0x308eaa;})['then'](respondWithResult(_0x1c91e2,0xc9))[_0x629d('0x4e')](handleError(_0x1c91e2,null));};exports['clone']=function(_0x216deb,_0x452b85){var _0x29d33e={'where':{'id':_0x216deb[_0x629d('0x50')]['id']}},_0x459ffe={};_0x459ffe[_0x629d('0x3f')]=_[_0x629d('0x51')](db['VoiceQueue'][_0x629d('0x3b')]);_0x29d33e[_0x629d('0x40')]=_[_0x629d('0x41')](_0x459ffe['model'],qs[_0x629d('0x42')](_0x216deb[_0x629d('0x3d')][_0x629d('0x42')]));_0x29d33e[_0x629d('0x40')]=_0x29d33e['attributes'][_0x629d('0x43')]?_0x29d33e[_0x629d('0x40')]:_0x459ffe[_0x629d('0x3f')];if(_0x216deb[_0x629d('0x3d')][_0x629d('0x4b')]){_0x29d33e['include']=[{'all':!![]}];}_0x29d33e=_['merge']({},_0x29d33e,_0x216deb[_0x629d('0x52')]);return db[_0x629d('0x3a')][_0x629d('0x34')](_0x29d33e)[_0x629d('0x2a')](handleEntityNotFound(_0x452b85,null))['then'](function(_0x3f8d80){if(_0x3f8d80){var _0x534da4=_0x3f8d80[_0x629d('0x2b')]({'plain':!![]});_0x534da4=qs[_0x629d('0x58')](_0x534da4,['id',_0x629d('0x59'),_0x629d('0x5a')]);_0x216deb[_0x629d('0x54')]=_[_0x629d('0x58')](_0x216deb[_0x629d('0x54')],['id',_0x629d('0x59'),_0x629d('0x5a')]);return db['VoiceQueue'][_0x629d('0x53')](_[_0x629d('0x49')](_0x534da4,_0x216deb['body']),{'include':_0x216deb[_0x629d('0x3d')][_0x629d('0x4b')]?[{'all':!![]}]:undefined})[_0x629d('0x2a')](function(_0x97f527){var _0xb94742=_0x216deb['user']['get']({'plain':!![]});if(!_0xb94742)throw new Error(_0x629d('0x5b'));if(_0xb94742[_0x629d('0x56')]==='user'){var _0x43fc63=_0x97f527['get']({'plain':!![]});var _0x3b6c12=[{'name':_0x629d('0x5c'),'value':_0x629d('0x2c')},{'name':_0x629d('0x2d'),'value':_0x629d('0x2e')}];var _0x243878=_[_0x629d('0x34')](_0x3b6c12,[_0x629d('0x32'),_0x43fc63[_0x629d('0x33')]])['name'];return db[_0x629d('0x5d')][_0x629d('0x34')]({'where':{'name':_0x243878,'userProfileId':_0xb94742[_0x629d('0x57')]},'raw':!![]})[_0x629d('0x2a')](function(_0x1d0e36){if(_0x1d0e36&&_0x1d0e36[_0x629d('0x5e')]===0x0){return db[_0x629d('0x36')][_0x629d('0x53')]({'name':_0x43fc63[_0x629d('0x35')],'resourceId':_0x43fc63['id'],'type':_0x1d0e36[_0x629d('0x35')],'sectionId':_0x1d0e36['id']},{})[_0x629d('0x2a')](function(){return _0x97f527;});}else{return _0x97f527;}})[_0x629d('0x4e')](function(_0x13865b){logger[_0x629d('0x37')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13865b);throw _0x13865b;});}return _0x97f527;});}})[_0x629d('0x2a')](respondWithResult(_0x452b85,0xc9))[_0x629d('0x4e')](handleError(_0x452b85,null));};exports['update']=function(_0x2c5b2c,_0x2dd915){if(_0x2c5b2c[_0x629d('0x54')]['id']){delete _0x2c5b2c[_0x629d('0x54')]['id'];}return db[_0x629d('0x3a')][_0x629d('0x34')]({'where':{'id':_0x2c5b2c['params']['id']}})[_0x629d('0x2a')](handleEntityNotFound(_0x2dd915,null))[_0x629d('0x2a')](saveUpdates(_0x2c5b2c[_0x629d('0x54')],null))[_0x629d('0x2a')](respondWithResult(_0x2dd915,null))['catch'](handleError(_0x2dd915,null));};exports[_0x629d('0x29')]=function(_0x306060,_0x51a636){return db['VoiceQueue'][_0x629d('0x34')]({'where':{'id':_0x306060[_0x629d('0x50')]['id']}})[_0x629d('0x2a')](handleEntityNotFound(_0x51a636,null))['then'](removeEntity(_0x51a636,null))[_0x629d('0x4e')](handleError(_0x51a636,null));};exports[_0x629d('0x5f')]=function(_0x19327a,_0x4be2d2,_0x1d432c){var _0x38fc8a={'raw':![],'where':{}};var _0xe1bcb1={};var _0x5bf0f5={'count':0x0,'rows':[]};return db[_0x629d('0x3a')][_0x629d('0x60')]({'where':{'id':_0x19327a[_0x629d('0x50')]['id']}})['then'](handleEntityNotFound(_0x4be2d2,null))[_0x629d('0x2a')](function(_0x198b51){if(_0x198b51){_0xe1bcb1[_0x629d('0x3f')]=_[_0x629d('0x51')](db[_0x629d('0x61')][_0x629d('0x3b')]);_0xe1bcb1['query']=_[_0x629d('0x51')](_0x19327a[_0x629d('0x3d')]);_0xe1bcb1[_0x629d('0x3e')]=_['intersection'](_0xe1bcb1[_0x629d('0x3f')],_0xe1bcb1[_0x629d('0x3d')]);_0x38fc8a[_0x629d('0x40')]=_[_0x629d('0x41')](_0xe1bcb1[_0x629d('0x3f')],qs[_0x629d('0x42')](_0x19327a[_0x629d('0x3d')]['fields']));_0x38fc8a[_0x629d('0x40')]=_0x38fc8a[_0x629d('0x40')][_0x629d('0x43')]?_0x38fc8a[_0x629d('0x40')]:_0xe1bcb1[_0x629d('0x3f')];if(!_0x19327a[_0x629d('0x3d')][_0x629d('0x44')](_0x629d('0x45'))){_0x38fc8a[_0x629d('0x23')]=qs[_0x629d('0x23')](_0x19327a['query'][_0x629d('0x23')]);_0x38fc8a[_0x629d('0x22')]=qs[_0x629d('0x22')](_0x19327a[_0x629d('0x3d')]['offset']);}_0x38fc8a[_0x629d('0x62')]=qs[_0x629d('0x46')](_0x19327a[_0x629d('0x3d')]['sort']);_0x38fc8a[_0x629d('0x47')]=qs[_0x629d('0x3e')](_['pick'](_0x19327a[_0x629d('0x3d')],_0xe1bcb1['filters']));_0x38fc8a[_0x629d('0x47')]['VoiceQueueId']=_0x198b51['id'];if(_0x19327a[_0x629d('0x3d')][_0x629d('0x2f')]){_0x38fc8a[_0x629d('0x47')]=_['merge'](_0x38fc8a[_0x629d('0x47')],{'$or':_['map'](_0x38fc8a[_0x629d('0x40')],function(_0x170957){var _0x4b9698={};_0x4b9698[_0x170957]={'$like':'%'+_0x19327a[_0x629d('0x3d')][_0x629d('0x2f')]+'%'};return _0x4b9698;})});}_0x38fc8a=_[_0x629d('0x49')]({},_0x38fc8a,_0x19327a['options']);return db['CmHopper'][_0x629d('0x21')]({'where':_0x38fc8a[_0x629d('0x47')]})[_0x629d('0x2a')](function(_0x599f83){_0x5bf0f5['count']=_0x599f83;if(_0x19327a[_0x629d('0x3d')][_0x629d('0x4b')]){_0x38fc8a[_0x629d('0x4c')]=[{'all':!![]}];}return db[_0x629d('0x61')]['findAll'](_0x38fc8a);})[_0x629d('0x2a')](function(_0x39bebc){_0x5bf0f5[_0x629d('0x63')]=_0x39bebc;return _0x5bf0f5;});}})['then'](respondWithFilteredResult(_0x4be2d2,_0x38fc8a))['catch'](handleError(_0x4be2d2,null));};exports[_0x629d('0x64')]=function(_0x4828c2,_0x3153b8,_0x57af89){var _0x175186={'raw':!![],'where':{}};var _0x3b6ed3={};var _0xcb1da3={'count':0x0,'rows':[]};return db[_0x629d('0x3a')][_0x629d('0x60')]({'where':{'id':_0x4828c2[_0x629d('0x50')]['id']}})['then'](handleEntityNotFound(_0x3153b8,null))['then'](function(_0x2119a9){if(_0x2119a9){_0x3b6ed3['model']=_[_0x629d('0x51')](db[_0x629d('0x65')][_0x629d('0x3b')]);_0x3b6ed3['query']=_[_0x629d('0x51')](_0x4828c2['query']);_0x3b6ed3[_0x629d('0x3e')]=_[_0x629d('0x41')](_0x3b6ed3[_0x629d('0x3f')],_0x3b6ed3['query']);_0x175186['attributes']=_['intersection'](_0x3b6ed3['model'],qs[_0x629d('0x42')](_0x4828c2[_0x629d('0x3d')]['fields']));_0x175186[_0x629d('0x40')]=_0x175186[_0x629d('0x40')][_0x629d('0x43')]?_0x175186['attributes']:_0x3b6ed3['model'];if(!_0x4828c2['query']['hasOwnProperty'](_0x629d('0x45'))){_0x175186['limit']=qs[_0x629d('0x23')](_0x4828c2[_0x629d('0x3d')][_0x629d('0x23')]);_0x175186[_0x629d('0x22')]=qs['offset'](_0x4828c2[_0x629d('0x3d')][_0x629d('0x22')]);}_0x175186[_0x629d('0x62')]=qs[_0x629d('0x46')](_0x4828c2[_0x629d('0x3d')][_0x629d('0x46')]);_0x175186[_0x629d('0x47')]=qs['filters'](_[_0x629d('0x48')](_0x4828c2[_0x629d('0x3d')],_0x3b6ed3[_0x629d('0x3e')]));_0x175186[_0x629d('0x47')][_0x629d('0x66')]=_0x2119a9['id'];if(_0x4828c2[_0x629d('0x3d')][_0x629d('0x2f')]){_0x175186['where']=_[_0x629d('0x49')](_0x175186[_0x629d('0x47')],{'$or':_[_0x629d('0x31')](_0x175186['attributes'],function(_0xb27285){var _0x1d3832={};_0x1d3832[_0xb27285]={'$like':'%'+_0x4828c2['query'][_0x629d('0x2f')]+'%'};return _0x1d3832;})});}_0x175186=_[_0x629d('0x49')]({},_0x175186,_0x4828c2[_0x629d('0x52')]);return db[_0x629d('0x65')][_0x629d('0x21')]({'where':_0x175186['where']})[_0x629d('0x2a')](function(_0x58d73e){_0xcb1da3[_0x629d('0x21')]=_0x58d73e;if(_0x4828c2[_0x629d('0x3d')][_0x629d('0x4b')]){_0x175186[_0x629d('0x4c')]=[{'all':!![]}];}return db[_0x629d('0x65')][_0x629d('0x4d')](_0x175186);})[_0x629d('0x2a')](function(_0x2937bb){_0xcb1da3[_0x629d('0x63')]=_0x2937bb;return _0xcb1da3;});}})[_0x629d('0x2a')](respondWithFilteredResult(_0x3153b8,_0x175186))['catch'](handleError(_0x3153b8,null));};exports['getHopperFinals']=function(_0x4cb14c,_0x492e34,_0x363850){var _0x495fab={'raw':!![],'where':{}};var _0x2bb05e={};var _0x29527b={'count':0x0,'rows':[]};return db[_0x629d('0x3a')][_0x629d('0x60')]({'where':{'id':_0x4cb14c[_0x629d('0x50')]['id']}})['then'](handleEntityNotFound(_0x492e34,null))[_0x629d('0x2a')](function(_0x472ea1){if(_0x472ea1){_0x2bb05e[_0x629d('0x3f')]=_['keys'](db['CmHopperFinal'][_0x629d('0x3b')]);_0x2bb05e['query']=_[_0x629d('0x51')](_0x4cb14c[_0x629d('0x3d')]);_0x2bb05e[_0x629d('0x3e')]=_[_0x629d('0x41')](_0x2bb05e[_0x629d('0x3f')],_0x2bb05e[_0x629d('0x3d')]);_0x495fab[_0x629d('0x40')]=_[_0x629d('0x41')](_0x2bb05e[_0x629d('0x3f')],qs[_0x629d('0x42')](_0x4cb14c[_0x629d('0x3d')][_0x629d('0x42')]));_0x495fab[_0x629d('0x40')]=_0x495fab[_0x629d('0x40')]['length']?_0x495fab[_0x629d('0x40')]:_0x2bb05e['model'];if(!_0x4cb14c['query'][_0x629d('0x44')](_0x629d('0x45'))){_0x495fab[_0x629d('0x23')]=qs[_0x629d('0x23')](_0x4cb14c[_0x629d('0x3d')][_0x629d('0x23')]);_0x495fab['offset']=qs[_0x629d('0x22')](_0x4cb14c[_0x629d('0x3d')]['offset']);}_0x495fab['order']=qs[_0x629d('0x46')](_0x4cb14c[_0x629d('0x3d')][_0x629d('0x46')]);_0x495fab[_0x629d('0x47')]=qs[_0x629d('0x3e')](_[_0x629d('0x48')](_0x4cb14c[_0x629d('0x3d')],_0x2bb05e[_0x629d('0x3e')]));_0x495fab['where'][_0x629d('0x66')]=_0x472ea1['id'];if(_0x4cb14c[_0x629d('0x3d')][_0x629d('0x2f')]){_0x495fab[_0x629d('0x47')]=_[_0x629d('0x49')](_0x495fab[_0x629d('0x47')],{'$or':_['map'](_0x495fab[_0x629d('0x40')],function(_0x1bf8f0){var _0x330e8b={};_0x330e8b[_0x1bf8f0]={'$like':'%'+_0x4cb14c[_0x629d('0x3d')][_0x629d('0x2f')]+'%'};return _0x330e8b;})});}_0x495fab=_['merge']({},_0x495fab,_0x4cb14c[_0x629d('0x52')]);return db[_0x629d('0x67')]['count']({'where':_0x495fab['where']})[_0x629d('0x2a')](function(_0x399864){_0x29527b['count']=_0x399864;if(_0x4cb14c[_0x629d('0x3d')][_0x629d('0x4b')]){_0x495fab[_0x629d('0x4c')]=[{'all':!![]}];}return db[_0x629d('0x67')][_0x629d('0x4d')](_0x495fab);})[_0x629d('0x2a')](function(_0x556c39){_0x29527b[_0x629d('0x63')]=_0x556c39;return _0x29527b;});}})[_0x629d('0x2a')](respondWithFilteredResult(_0x492e34,_0x495fab))[_0x629d('0x4e')](handleError(_0x492e34,null));};exports[_0x629d('0x68')]=function(_0x217be8,_0x507dc2,_0x4b2c88){var _0xa60b75={'raw':!![],'where':{}};var _0x5cd28a={};var _0x393293={'count':0x0,'rows':[]};return db[_0x629d('0x3a')][_0x629d('0x60')]({'where':{'id':_0x217be8[_0x629d('0x50')]['id']}})[_0x629d('0x2a')](handleEntityNotFound(_0x507dc2,null))['then'](function(_0x517e32){if(_0x517e32){_0x5cd28a[_0x629d('0x3f')]=_[_0x629d('0x51')](db[_0x629d('0x69')][_0x629d('0x3b')]);_0x5cd28a[_0x629d('0x3d')]=_[_0x629d('0x51')](_0x217be8[_0x629d('0x3d')]);_0x5cd28a[_0x629d('0x3e')]=_[_0x629d('0x41')](_0x5cd28a['model'],_0x5cd28a[_0x629d('0x3d')]);_0xa60b75['attributes']=_[_0x629d('0x41')](_0x5cd28a[_0x629d('0x3f')],qs['fields'](_0x217be8[_0x629d('0x3d')]['fields']));_0xa60b75['attributes']=_0xa60b75[_0x629d('0x40')][_0x629d('0x43')]?_0xa60b75[_0x629d('0x40')]:_0x5cd28a[_0x629d('0x3f')];if(!_0x217be8[_0x629d('0x3d')]['hasOwnProperty'](_0x629d('0x45'))){_0xa60b75['limit']=qs[_0x629d('0x23')](_0x217be8['query'][_0x629d('0x23')]);_0xa60b75[_0x629d('0x22')]=qs[_0x629d('0x22')](_0x217be8['query'][_0x629d('0x22')]);}_0xa60b75['order']=qs[_0x629d('0x46')](_0x217be8[_0x629d('0x3d')][_0x629d('0x46')]);_0xa60b75[_0x629d('0x47')]=qs[_0x629d('0x3e')](_[_0x629d('0x48')](_0x217be8['query'],_0x5cd28a['filters']));_0xa60b75[_0x629d('0x47')][_0x629d('0x66')]=_0x517e32['id'];if(_0x217be8[_0x629d('0x3d')][_0x629d('0x2f')]){_0xa60b75[_0x629d('0x47')]=_['merge'](_0xa60b75[_0x629d('0x47')],{'$or':_['map'](_0xa60b75[_0x629d('0x40')],function(_0x2378ef){var _0x1a6872={};_0x1a6872[_0x2378ef]={'$like':'%'+_0x217be8[_0x629d('0x3d')][_0x629d('0x2f')]+'%'};return _0x1a6872;})});}_0xa60b75=_[_0x629d('0x49')]({},_0xa60b75,_0x217be8[_0x629d('0x52')]);return db[_0x629d('0x69')][_0x629d('0x21')]({'where':_0xa60b75[_0x629d('0x47')]})[_0x629d('0x2a')](function(_0x30e967){_0x393293[_0x629d('0x21')]=_0x30e967;if(_0x217be8[_0x629d('0x3d')][_0x629d('0x4b')]){_0xa60b75[_0x629d('0x4c')]=[{'all':!![]}];}return db[_0x629d('0x69')]['findAll'](_0xa60b75);})[_0x629d('0x2a')](function(_0x4d226d){_0x393293[_0x629d('0x63')]=_0x4d226d;return _0x393293;});}})[_0x629d('0x2a')](respondWithFilteredResult(_0x507dc2,_0xa60b75))[_0x629d('0x4e')](handleError(_0x507dc2,null));};exports[_0x629d('0x6a')]=function(_0xb37935,_0x3d5b98,_0x3ac764){var _0x21c377={};var _0x5c19c3={};var _0x42047f;var _0xd554c2;return db['VoiceQueue'][_0x629d('0x60')]({'where':{'id':_0xb37935[_0x629d('0x50')]['id']}})['then'](handleEntityNotFound(_0x3d5b98,null))[_0x629d('0x2a')](function(_0x5365f3){if(_0x5365f3){_0x42047f=_0x5365f3;_0x5c19c3[_0x629d('0x3f')]=_[_0x629d('0x51')](db[_0x629d('0x6b')][_0x629d('0x3b')]);_0x5c19c3['query']=_[_0x629d('0x51')](_0xb37935[_0x629d('0x3d')]);_0x5c19c3['filters']=_['intersection'](_0x5c19c3['model'],_0x5c19c3[_0x629d('0x3d')]);_0x21c377['attributes']=_[_0x629d('0x41')](_0x5c19c3[_0x629d('0x3f')],qs[_0x629d('0x42')](_0xb37935[_0x629d('0x3d')][_0x629d('0x42')]));_0x21c377[_0x629d('0x40')]=_0x21c377[_0x629d('0x40')]['length']?_0x21c377['attributes']:_0x5c19c3['model'];_0x21c377[_0x629d('0x62')]=qs[_0x629d('0x46')](_0xb37935[_0x629d('0x3d')][_0x629d('0x46')]);_0x21c377[_0x629d('0x47')]=qs[_0x629d('0x3e')](_[_0x629d('0x48')](_0xb37935[_0x629d('0x3d')],_0x5c19c3[_0x629d('0x3e')]));if(_0xb37935['query']['filter']){_0x21c377[_0x629d('0x47')]=_[_0x629d('0x49')](_0x21c377[_0x629d('0x47')],{'$or':_[_0x629d('0x31')](_0x21c377[_0x629d('0x40')],function(_0x4f054b){var _0x392029={};_0x392029[_0x4f054b]={'$like':'%'+_0xb37935[_0x629d('0x3d')][_0x629d('0x2f')]+'%'};return _0x392029;})});}_0x21c377=_['merge']({},_0x21c377,_0xb37935[_0x629d('0x52')]);return _0x42047f['getTeams'](_0x21c377);}})[_0x629d('0x2a')](function(_0x1d5bab){if(_0x1d5bab){_0xd554c2=_0x1d5bab['length'];if(!_0xb37935['query'][_0x629d('0x44')]('nolimit')){_0x21c377[_0x629d('0x23')]=qs['limit'](_0xb37935['query'][_0x629d('0x23')]);_0x21c377['offset']=qs[_0x629d('0x22')](_0xb37935[_0x629d('0x3d')]['offset']);}return _0x42047f['getTeams'](_0x21c377);}})['then'](function(_0x2cd07d){if(_0x2cd07d){return _0x2cd07d?{'count':_0xd554c2,'rows':_0x2cd07d}:null;}})['then'](respondWithResult(_0x3d5b98,null))[_0x629d('0x4e')](handleError(_0x3d5b98,null));};exports['addTeams']=function(_0x584b80,_0x128b1e,_0x320e41){var _0x1fcc4f=_0x584b80[_0x629d('0x54')]['teams'];var _0x5ddd0f=_[_0x629d('0x31')](_0x1fcc4f,'id');return db['Team'][_0x629d('0x4d')]({'where':{'id':_0x5ddd0f},'attributes':['id'],'include':[{'model':db[_0x629d('0x6c')],'as':'Agents','attributes':['id','name',_0x629d('0x6d'),_0x629d('0x6e'),'interface'],'raw':!![]}]})[_0x629d('0x2a')](function(_0x551ae3){if(_0x551ae3){var _0x309eae=_[_0x629d('0x6f')](_0x551ae3,function(_0x5207f5){var _0x4e06e5=_0x5207f5[_0x629d('0x2b')]({'plain':!![]});_0x4e06e5[_0x629d('0x70')]['forEach'](function(_0x384dab){_0x384dab['penalty']=_['find'](_0x1fcc4f,{'id':_0x4e06e5['id']})[_0x629d('0x71')];});return _0x4e06e5['Agents'];});return db[_0x629d('0x3a')][_0x629d('0x34')]({'where':{'id':_0x584b80[_0x629d('0x50')]['id']}})[_0x629d('0x2a')](function(_0x3a296a){return db['sequelize'][_0x629d('0x72')](function(_0x5e84aa){return _0x3a296a[_0x629d('0x73')](_0x5ddd0f,{'transaction':_0x5e84aa})['then'](function(){return BPromise[_0x629d('0x74')](_0x309eae,function(_0x34492e){return db['UserVoiceQueue'][_0x629d('0x75')]({'where':{'UserId':_0x34492e['id'],'VoiceQueueId':_0x584b80[_0x629d('0x50')]['id']},'defaults':{'penalty':_0x34492e[_0x629d('0x71')]},'transaction':_0x5e84aa});});})[_0x629d('0x2a')](function(){return BPromise[_0x629d('0x74')](_[_0x629d('0x2f')](_0x309eae,{'online':!![]}),function(_0x2c0304){return db[_0x629d('0x76')][_0x629d('0x77')]({'membername':_0x2c0304['name'],'UserId':_0x2c0304['id'],'queue_name':_0x3a296a[_0x629d('0x35')],'VoiceQueueId':_0x3a296a['id'],'interface':_[_0x629d('0x78')](_0x2c0304[_0x629d('0x79')])?util[_0x629d('0x7a')](_0x629d('0x7b'),_0x2c0304[_0x629d('0x35')]):_0x2c0304['interface'],'paused':_0x2c0304[_0x629d('0x6e')]||![],'penalty':_0x2c0304[_0x629d('0x71')]},{'transaction':_0x5e84aa});});})['then'](function(){_0x309eae['forEach'](function(_0x4a59e6){socket['emit'](_0x629d('0x7c'),{'UserId':_0x4a59e6['id'],'VoiceQueueId':_0x3a296a['id']});});});});});}})[_0x629d('0x2a')](respondWithStatusCode(_0x128b1e,null))[_0x629d('0x4e')](handleError(_0x128b1e,null));};exports['removeTeams']=function(_0x5035be,_0x2020d0,_0x328471){return db[_0x629d('0x6b')]['findAll']({'where':{'id':_0x5035be[_0x629d('0x3d')][_0x629d('0x7d')]},'attributes':['id'],'include':[{'model':db[_0x629d('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x629d('0x2a')](handleEntityNotFound(_0x2020d0,null))['then'](function(_0x3f4487){var _0x53f3bb=_[_0x629d('0x31')](_0x3f4487,'id');var _0xa90ffc=[];var _0x2344ea=[];var _0x2a2c9c=squel[_0x629d('0x7e')]();_0x2a2c9c['field'](_0x629d('0x7f'))['from'](_0x629d('0x80'),'tq')[_0x629d('0x81')]('user_has_teams','ut',_0x629d('0x82'))[_0x629d('0x47')](_0x629d('0x83'),_0x5035be[_0x629d('0x50')]['id']);for(var _0x39214b=0x0;_0x39214b<_0x3f4487[_0x629d('0x43')];_0x39214b+=0x1){let _0x5117d4=_0x3f4487[_0x39214b];for(var _0x43ada3=0x0;_0x43ada3<_0x5117d4[_0x629d('0x70')]['length'];_0x43ada3+=0x1){let _0x3eac23=_0x5117d4[_0x629d('0x70')][_0x43ada3];var _0x2ea9ed=_0x2a2c9c['clone']();_0x2ea9ed[_0x629d('0x47')](_0x629d('0x84'),_0x3eac23['id']);_0x2344ea['push'](db[_0x629d('0x85')][_0x629d('0x3d')](_0x2ea9ed[_0x629d('0x86')](),{'type':db[_0x629d('0x85')]['QueryTypes'][_0x629d('0x87')]})[_0x629d('0x2a')](function(_0xa089c2){if(_0xa089c2[_0x629d('0x43')]===0x1){return _0x3eac23['id'];}else{var _0x26243b=_[_0x629d('0x88')](_[_0x629d('0x31')](_0xa089c2,_0x629d('0x89')),function(_0x524f94){return _[_0x629d('0x8a')](_0x53f3bb,_0x524f94);});if(_0x26243b){return _0x3eac23['id'];}}}));}}return BPromise[_0x629d('0x8b')](_0x2344ea)[_0x629d('0x2a')](function(_0x4aa317){_0xa90ffc=_(_0xa90ffc)['union'](_0x4aa317)[_0x629d('0x8c')]()[_0x629d('0x32')]();return db[_0x629d('0x3a')][_0x629d('0x34')]({'where':{'id':_0x5035be[_0x629d('0x50')]['id']}})['then'](function(_0x5e322d){return db[_0x629d('0x85')][_0x629d('0x72')](function(_0x17f18c){return _0x5e322d[_0x629d('0x8d')](_0x5035be[_0x629d('0x3d')][_0x629d('0x7d')],{'transaction':_0x17f18c})[_0x629d('0x2a')](function(){if(!_[_0x629d('0x8e')](_0xa90ffc)){return _0x5e322d[_0x629d('0x8f')](_0xa90ffc,{'transaction':_0x17f18c})[_0x629d('0x2a')](function(){return db['UserVoiceQueueRt'][_0x629d('0x29')]({'where':{'VoiceQueueId':_0x5035be[_0x629d('0x50')]['id'],'UserId':_0xa90ffc},'transaction':_0x17f18c});});}})['then'](function(){_0xa90ffc[_0x629d('0x90')](function(_0x4f7611){socket[_0x629d('0x91')](_0x629d('0x92'),{'UserId':_0x4f7611,'VoiceQueueId':_0x5e322d['id']});});});});});});})[_0x629d('0x2a')](respondWithStatusCode(_0x2020d0,null))[_0x629d('0x4e')](handleError(_0x2020d0,null));};exports['addAgents']=function(_0x33b8a9,_0x683cb7,_0x549b8c){var _0x1fa2b9,_0x206f4d;return db[_0x629d('0x3a')][_0x629d('0x34')]({'where':{'id':_0x33b8a9['params']['id']}})[_0x629d('0x2a')](handleEntityNotFound(_0x683cb7,null))[_0x629d('0x2a')](function(_0x22d258){if(_0x22d258){_0x206f4d=_0x22d258;return _0x22d258[_0x629d('0x93')](_0x33b8a9[_0x629d('0x54')]['ids'],_['omit'](_0x33b8a9[_0x629d('0x54')],[_0x629d('0x7d'),'id'])||{})['spread'](function(_0x5da4cc){for(var _0x34460e=0x0;_0x34460e<_0x33b8a9[_0x629d('0x54')][_0x629d('0x7d')][_0x629d('0x43')];_0x34460e+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':_0x33b8a9[_0x629d('0x54')]['ids'][_0x34460e],'VoiceQueueId':_0x33b8a9[_0x629d('0x50')]['id']});}return _0x5da4cc;});}})[_0x629d('0x2a')](function(_0x4ec684){_0x1fa2b9=_0x4ec684||[];if(_0x206f4d){return db[_0x629d('0x6c')][_0x629d('0x4d')]({'where':{'id':_0x33b8a9[_0x629d('0x54')]['ids']},'attributes':['id','name',_0x629d('0x6d'),_0x629d('0x6e'),_0x629d('0x79')],'raw':!![]});}})['then'](function(_0x1968a6){if(!_[_0x629d('0x8e')](_0x1968a6)){var _0x5c28e1=[];for(var _0x39ea4d=0x0;_0x39ea4d<_0x1968a6[_0x629d('0x43')];_0x39ea4d++){if(_0x1968a6[_0x39ea4d]['online']){_0x5c28e1[_0x629d('0x94')](db['UserVoiceQueueRt'][_0x629d('0x77')]({'membername':_0x1968a6[_0x39ea4d][_0x629d('0x35')],'UserId':_0x1968a6[_0x39ea4d]['id'],'queue_name':_0x206f4d[_0x629d('0x35')],'VoiceQueueId':_0x206f4d['id'],'interface':_[_0x629d('0x78')](_0x1968a6[_0x39ea4d][_0x629d('0x79')])?util[_0x629d('0x7a')](_0x629d('0x7b'),_0x1968a6[_0x39ea4d]['name']):_0x1968a6[_0x39ea4d]['interface'],'paused':_0x1968a6[_0x39ea4d]['voicePause']||![],'penalty':_0x33b8a9[_0x629d('0x54')][_0x629d('0x71')]||0x0}));}}return BPromise['all'](_0x5c28e1);}})[_0x629d('0x2a')](function(){return _0x1fa2b9;})[_0x629d('0x2a')](respondWithResult(_0x683cb7,null))[_0x629d('0x4e')](handleError(_0x683cb7,null));};exports[_0x629d('0x8f')]=function(_0x27de8d,_0x1f5432,_0xb9f299){return db[_0x629d('0x3a')][_0x629d('0x34')]({'where':{'id':_0x27de8d[_0x629d('0x50')]['id']}})[_0x629d('0x2a')](handleEntityNotFound(_0x1f5432,null))[_0x629d('0x2a')](function(_0x1c1d9e){if(_0x1c1d9e){return _0x1c1d9e['removeAgents'](_0x27de8d[_0x629d('0x3d')][_0x629d('0x7d')])[_0x629d('0x2a')](function(){if(_[_0x629d('0x95')](_0x27de8d[_0x629d('0x3d')][_0x629d('0x7d')])){for(var _0x5f2b13=0x0;_0x5f2b13<_0x27de8d['query']['ids'][_0x629d('0x43')];_0x5f2b13+=0x1){socket[_0x629d('0x91')](_0x629d('0x92'),{'UserId':Number(_0x27de8d[_0x629d('0x3d')][_0x629d('0x7d')][_0x5f2b13]),'VoiceQueueId':Number(_0x27de8d[_0x629d('0x50')]['id'])});}}else{socket[_0x629d('0x91')](_0x629d('0x92'),{'UserId':Number(_0x27de8d[_0x629d('0x3d')]['ids']),'VoiceQueueId':Number(_0x27de8d[_0x629d('0x50')]['id'])});}});}})['then'](function(_0x5d448b){return db[_0x629d('0x76')][_0x629d('0x29')]({'where':{'VoiceQueueId':_0x27de8d['params']['id'],'UserId':_0x27de8d[_0x629d('0x3d')][_0x629d('0x7d')]}})['then'](function(){return _0x5d448b;});})[_0x629d('0x2a')](respondWithStatusCode(_0x1f5432,null))[_0x629d('0x4e')](handleError(_0x1f5432,null));};exports[_0x629d('0x96')]=function(_0x4d0f1a,_0x8cb572,_0x19224f){var _0x201144={};var _0x4228ea={};var _0xcdc1b3;var _0x3d0837;return db[_0x629d('0x3a')][_0x629d('0x60')]({'where':{'id':_0x4d0f1a[_0x629d('0x50')]['id']}})[_0x629d('0x2a')](handleEntityNotFound(_0x8cb572,null))[_0x629d('0x2a')](function(_0x471ac7){if(_0x471ac7){_0xcdc1b3=_0x471ac7;_0x4228ea['model']=_['keys'](db[_0x629d('0x6c')][_0x629d('0x3b')]);_0x4228ea[_0x629d('0x3d')]=_[_0x629d('0x51')](_0x4d0f1a[_0x629d('0x3d')]);_0x4228ea['filters']=_[_0x629d('0x41')](_0x4228ea[_0x629d('0x3f')],_0x4228ea['query']);_0x201144['attributes']=_['intersection'](_0x4228ea[_0x629d('0x3f')],qs[_0x629d('0x42')](_0x4d0f1a[_0x629d('0x3d')][_0x629d('0x42')]));_0x201144['attributes']=_0x201144[_0x629d('0x40')][_0x629d('0x43')]?_0x201144['attributes']:_0x4228ea['model'];_0x201144[_0x629d('0x62')]=qs['sort'](_0x4d0f1a[_0x629d('0x3d')]['sort']);_0x201144[_0x629d('0x47')]=qs[_0x629d('0x3e')](_['pick'](_0x4d0f1a[_0x629d('0x3d')],_0x4228ea[_0x629d('0x3e')]));if(_0x4d0f1a['query'][_0x629d('0x2f')]){_0x201144[_0x629d('0x47')]=_[_0x629d('0x49')](_0x201144[_0x629d('0x47')],{'$or':_[_0x629d('0x31')](_0x201144[_0x629d('0x40')],function(_0x11dac5){var _0x36635c={};_0x36635c[_0x11dac5]={'$like':'%'+_0x4d0f1a['query'][_0x629d('0x2f')]+'%'};return _0x36635c;})});}_0x201144=_[_0x629d('0x49')]({},_0x201144,_0x4d0f1a[_0x629d('0x52')]);return _0xcdc1b3[_0x629d('0x96')](_0x201144);}})[_0x629d('0x2a')](function(_0x3de26d){if(_0x3de26d){_0x3d0837=_0x3de26d[_0x629d('0x43')];if(!_0x4d0f1a['query'][_0x629d('0x44')](_0x629d('0x45'))){_0x201144['limit']=qs[_0x629d('0x23')](_0x4d0f1a[_0x629d('0x3d')][_0x629d('0x23')]);_0x201144['offset']=qs['offset'](_0x4d0f1a[_0x629d('0x3d')][_0x629d('0x22')]);}return _0xcdc1b3[_0x629d('0x96')](_0x201144);}})['then'](function(_0x3fbb77){if(_0x3fbb77){return _0x3fbb77?{'count':_0x3d0837,'rows':_0x3fbb77}:null;}})[_0x629d('0x2a')](respondWithResult(_0x8cb572,null))[_0x629d('0x4e')](handleError(_0x8cb572,null));};exports[_0x629d('0x97')]=function(_0x235bd8,_0x36249b,_0x1ee6e8){var _0x1c75dd={};var _0x181cf0={};var _0x964b15;var _0x122471;return db[_0x629d('0x3a')][_0x629d('0x60')]({'where':{'id':_0x235bd8[_0x629d('0x50')]['id']}})[_0x629d('0x2a')](handleEntityNotFound(_0x36249b,null))[_0x629d('0x2a')](function(_0x163d03){if(_0x163d03){_0x964b15=_0x163d03;_0x181cf0[_0x629d('0x3f')]=_[_0x629d('0x51')](db['UserVoiceQueueRt']['rawAttributes']);_0x181cf0[_0x629d('0x3d')]=_['keys'](_0x235bd8['query']);_0x181cf0[_0x629d('0x3e')]=_[_0x629d('0x41')](_0x181cf0[_0x629d('0x3f')],_0x181cf0[_0x629d('0x3d')]);_0x1c75dd['attributes']=_[_0x629d('0x41')](_0x181cf0['model'],qs[_0x629d('0x42')](_0x235bd8['query'][_0x629d('0x42')]));_0x1c75dd[_0x629d('0x40')]=_0x1c75dd[_0x629d('0x40')][_0x629d('0x43')]?_0x1c75dd[_0x629d('0x40')]:_0x181cf0['model'];_0x1c75dd[_0x629d('0x62')]=qs[_0x629d('0x46')](_0x235bd8[_0x629d('0x3d')][_0x629d('0x46')]);_0x1c75dd[_0x629d('0x47')]=qs[_0x629d('0x3e')](_['pick'](_0x235bd8['query'],_0x181cf0['filters']));if(_0x235bd8[_0x629d('0x3d')][_0x629d('0x2f')]){_0x1c75dd['where']=_[_0x629d('0x49')](_0x1c75dd[_0x629d('0x47')],{'$or':_['map'](_0x1c75dd[_0x629d('0x40')],function(_0x41b75c){var _0x58d518={};_0x58d518[_0x41b75c]={'$like':'%'+_0x235bd8['query'][_0x629d('0x2f')]+'%'};return _0x58d518;})});}_0x1c75dd=_[_0x629d('0x49')]({},_0x1c75dd,_0x235bd8['options']);return _0x964b15[_0x629d('0x97')](_0x1c75dd);}})[_0x629d('0x2a')](function(_0x2c3655){if(_0x2c3655){_0x122471=_0x2c3655[_0x629d('0x43')];if(!_0x235bd8['query'][_0x629d('0x44')](_0x629d('0x45'))){_0x1c75dd[_0x629d('0x23')]=qs[_0x629d('0x23')](_0x235bd8[_0x629d('0x3d')][_0x629d('0x23')]);_0x1c75dd[_0x629d('0x22')]=qs['offset'](_0x235bd8[_0x629d('0x3d')][_0x629d('0x22')]);}return _0x964b15['getMembers'](_0x1c75dd);}})[_0x629d('0x2a')](function(_0x18de3b){return _0x18de3b?{'count':_0x122471,'rows':_0x18de3b}:null;})[_0x629d('0x2a')](respondWithResult(_0x36249b,null))[_0x629d('0x4e')](handleError(_0x36249b,null));};exports[_0x629d('0x98')]=function(_0x3de1ab,_0x445a95,_0x5f4d92){var _0x1d54fd={};var _0x3d8e3f={};var _0x491987;var _0x35ecce;return db[_0x629d('0x3a')][_0x629d('0x60')]({'where':{'id':_0x3de1ab[_0x629d('0x50')]['id']}})[_0x629d('0x2a')](handleEntityNotFound(_0x445a95,null))[_0x629d('0x2a')](function(_0xc40b50){if(_0xc40b50){_0x491987=_0xc40b50;_0x3d8e3f['model']=_[_0x629d('0x51')](db[_0x629d('0x99')][_0x629d('0x3b')]);_0x3d8e3f[_0x629d('0x3d')]=_[_0x629d('0x51')](_0x3de1ab['query']);_0x3d8e3f[_0x629d('0x3e')]=_['intersection'](_0x3d8e3f[_0x629d('0x3f')],_0x3d8e3f[_0x629d('0x3d')]);_0x1d54fd[_0x629d('0x40')]=_[_0x629d('0x41')](_0x3d8e3f[_0x629d('0x3f')],qs[_0x629d('0x42')](_0x3de1ab[_0x629d('0x3d')][_0x629d('0x42')]));_0x1d54fd['attributes']=_0x1d54fd[_0x629d('0x40')]['length']?_0x1d54fd['attributes']:_0x3d8e3f[_0x629d('0x3f')];_0x1d54fd[_0x629d('0x62')]=qs[_0x629d('0x46')](_0x3de1ab['query']['sort']);_0x1d54fd['where']=qs[_0x629d('0x3e')](_[_0x629d('0x48')](_0x3de1ab[_0x629d('0x3d')],_0x3d8e3f['filters']));if(_0x3de1ab['query'][_0x629d('0x2f')]){_0x1d54fd['where']=_[_0x629d('0x49')](_0x1d54fd['where'],{'$or':_[_0x629d('0x31')](_0x1d54fd[_0x629d('0x40')],function(_0x15f297){var _0x4396f0={};_0x4396f0[_0x15f297]={'$like':'%'+_0x3de1ab[_0x629d('0x3d')]['filter']+'%'};return _0x4396f0;})});}_0x1d54fd=_[_0x629d('0x49')]({},_0x1d54fd,_0x3de1ab[_0x629d('0x52')]);return _0x491987[_0x629d('0x98')](_0x1d54fd);}})[_0x629d('0x2a')](function(_0x514948){if(_0x514948){_0x35ecce=_0x514948[_0x629d('0x43')];if(!_0x3de1ab['query'][_0x629d('0x44')](_0x629d('0x45'))){_0x1d54fd[_0x629d('0x23')]=qs['limit'](_0x3de1ab[_0x629d('0x3d')][_0x629d('0x23')]);_0x1d54fd[_0x629d('0x22')]=qs[_0x629d('0x22')](_0x3de1ab[_0x629d('0x3d')]['offset']);}return _0x491987[_0x629d('0x98')](_0x1d54fd);}})[_0x629d('0x2a')](function(_0x537a83){if(_0x537a83){return _0x537a83?{'count':_0x35ecce,'rows':_0x537a83}:null;}})[_0x629d('0x2a')](respondWithResult(_0x445a95,null))[_0x629d('0x4e')](handleError(_0x445a95,null));};exports['addLists']=function(_0x21ab1f,_0xe15008,_0x573a54){var _0x4eb1a8,_0x3b491d;return db[_0x629d('0x3a')][_0x629d('0x34')]({'where':{'id':_0x21ab1f[_0x629d('0x50')]['id']}})[_0x629d('0x2a')](handleEntityNotFound(_0xe15008,null))[_0x629d('0x2a')](function(_0x5c7dab){if(_0x5c7dab){_0x3b491d=_0x5c7dab;return _0x5c7dab[_0x629d('0x9a')](_0x21ab1f[_0x629d('0x54')][_0x629d('0x7d')],_[_0x629d('0x58')](_0x21ab1f[_0x629d('0x54')],[_0x629d('0x7d'),'id'])||{});}return null;})['spread'](function(_0x26e6af){var _0x119eba;_0x4eb1a8=_0x26e6af||[];var _0x2dc38f=[];if(_0x26e6af){for(var _0x27df35=0x0;_0x27df35<_0x26e6af[_0x629d('0x43')];_0x27df35+=0x1){var _0x30a528=_0x26e6af[_0x27df35][_0x629d('0x2b')]({'plain':!![]});_0x3b491d[_0x629d('0x9b')]=_0x21ab1f[_0x629d('0x54')][_0x629d('0x9b')]?_0x21ab1f[_0x629d('0x54')]['dialCheckDuplicateType']:_0x3b491d['dialCheckDuplicateType'];switch(_0x3b491d[_0x629d('0x9b')]){case _0x629d('0x9c'):_0x119eba=squel[_0x629d('0x9d')]()[_0x629d('0x9e')](_0x629d('0x9f'))['fromQuery']([_0x629d('0xa0'),_0x629d('0xa1'),_0x629d('0xa2'),_0x629d('0xa3'),_0x629d('0x66'),_0x629d('0x59'),'updatedAt'],squel['select']()[_0x629d('0xa4')](_0x629d('0xa0'),_0x629d('0xa0'))['field'](_0x629d('0xa5'),_0x629d('0xa1'))[_0x629d('0xa4')]('id',_0x629d('0xa2'))[_0x629d('0xa4')](_0x30a528[_0x629d('0xa6')]['toString'](),_0x629d('0xa3'))[_0x629d('0xa4')](_0x21ab1f[_0x629d('0x50')]['id'][_0x629d('0x86')](),_0x629d('0x66'))[_0x629d('0xa4')](_0x629d('0xa5'),_0x629d('0x59'))[_0x629d('0xa4')](_0x629d('0xa5'),_0x629d('0x5a'))['from']('cm_contacts')[_0x629d('0x47')](_0x629d('0xa7'))[_0x629d('0x47')](_0x629d('0xa8'),_0x30a528[_0x629d('0xa6')][_0x629d('0x86')]())[_0x629d('0x47')](_0x629d('0xa9'))[_0x629d('0x47')](_0x629d('0xaa'),squel['select']()[_0x629d('0xa4')](_0x629d('0xab'))[_0x629d('0xac')]('cm_hopper_final')[_0x629d('0x47')](_0x629d('0x83'),_0x21ab1f[_0x629d('0x50')]['id'][_0x629d('0x86')]()))[_0x629d('0x47')](_0x629d('0xaa'),squel['select']()[_0x629d('0xa4')](_0x629d('0xad'))['from']('cm_hopper')[_0x629d('0x47')](_0x629d('0x83'),_0x21ab1f['params']['id'][_0x629d('0x86')]())))[_0x629d('0x86')]();break;case _0x629d('0xae'):_0x119eba=squel[_0x629d('0x9d')]()['into'](_0x629d('0x9f'))['fromQuery']([_0x629d('0xa0'),_0x629d('0xa1'),_0x629d('0xa2'),_0x629d('0xa3'),'VoiceQueueId',_0x629d('0x59'),'updatedAt'],squel[_0x629d('0x7e')]()[_0x629d('0xa4')](_0x629d('0xa0'),_0x629d('0xa0'))['field'](_0x629d('0xa5'),'scheduledAt')[_0x629d('0xa4')]('id',_0x629d('0xa2'))[_0x629d('0xa4')](_0x30a528['CmListId'][_0x629d('0x86')](),_0x629d('0xa3'))['field'](_0x21ab1f[_0x629d('0x50')]['id'][_0x629d('0x86')](),_0x629d('0x66'))['field']('NOW()',_0x629d('0x59'))[_0x629d('0xa4')]('NOW()','updatedAt')[_0x629d('0xac')](_0x629d('0xaf'))[_0x629d('0x47')](_0x629d('0xa7'))[_0x629d('0x47')](_0x629d('0xa8'),_0x30a528[_0x629d('0xa6')][_0x629d('0x86')]())[_0x629d('0x47')](_0x629d('0xa9'))[_0x629d('0x47')](_0x629d('0xaa'),squel['select']()[_0x629d('0xa4')]('COALESCE(phone,\x27\x27)')[_0x629d('0xac')]('cm_hopper')[_0x629d('0x47')]('VoiceQueueId\x20=\x20?',_0x21ab1f[_0x629d('0x50')]['id'][_0x629d('0x86')]())))[_0x629d('0x86')]();break;default:_0x119eba=squel[_0x629d('0x9d')]()['into'](_0x629d('0x9f'))[_0x629d('0xb0')]([_0x629d('0xa0'),'scheduledAt',_0x629d('0xa2'),_0x629d('0xa3'),'VoiceQueueId','createdAt',_0x629d('0x5a')],squel[_0x629d('0x7e')]()[_0x629d('0xa4')](_0x629d('0xa0'),_0x629d('0xa0'))[_0x629d('0xa4')](_0x629d('0xa5'),_0x629d('0xa1'))['field']('id',_0x629d('0xa2'))[_0x629d('0xa4')](_0x30a528[_0x629d('0xa6')][_0x629d('0x86')](),_0x629d('0xa3'))['field'](_0x21ab1f['params']['id'][_0x629d('0x86')](),_0x629d('0x66'))[_0x629d('0xa4')](_0x629d('0xa5'),'createdAt')[_0x629d('0xa4')](_0x629d('0xa5'),_0x629d('0x5a'))[_0x629d('0xac')](_0x629d('0xaf'))['where']('deletedAt\x20IS\x20NULL')[_0x629d('0x47')]('ListId\x20=\x20?',_0x30a528[_0x629d('0xa6')][_0x629d('0x86')]())[_0x629d('0x47')](_0x629d('0xa9')))['toString']();}_0x2dc38f[_0x629d('0x94')](db[_0x629d('0x85')]['query'](_0x119eba));}return BPromise['all'](_0x2dc38f);}})[_0x629d('0x2a')](function(){return _0x4eb1a8;})['then'](respondWithResult(_0xe15008,null))['catch'](handleError(_0xe15008,null));};exports[_0x629d('0xb1')]=function(_0x1f2617,_0x557779,_0x53b850){return db[_0x629d('0x3a')]['find']({'where':{'id':_0x1f2617['params']['id']}})['then'](handleEntityNotFound(_0x557779,null))[_0x629d('0x2a')](function(_0x21073e){if(_0x21073e){return _0x21073e['removeLists'](_0x1f2617['query'][_0x629d('0x7d')]);}})[_0x629d('0x2a')](function(_0x28f889){if(_0x28f889){return db[_0x629d('0x61')][_0x629d('0x29')]({'where':{'ListId':_0x1f2617[_0x629d('0x3d')][_0x629d('0x7d')],'VoiceQueueId':_0x1f2617[_0x629d('0x50')]['id']}})[_0x629d('0x2a')](function(){return _0x28f889;});}})[_0x629d('0x2a')](respondWithStatusCode(_0x557779,null))['catch'](handleError(_0x557779,null));};exports['getBlackLists']=function(_0x48242f,_0x414532,_0x487fec){var _0x4a46ce={};var _0x512b79={};var _0x2e68c6;var _0x162926;return db[_0x629d('0x3a')][_0x629d('0x60')]({'where':{'id':_0x48242f[_0x629d('0x50')]['id']}})['then'](handleEntityNotFound(_0x414532,null))['then'](function(_0x428158){if(_0x428158){_0x2e68c6=_0x428158;_0x512b79['model']=_['keys'](db[_0x629d('0x99')][_0x629d('0x3b')]);_0x512b79['query']=_[_0x629d('0x51')](_0x48242f[_0x629d('0x3d')]);_0x512b79[_0x629d('0x3e')]=_['intersection'](_0x512b79[_0x629d('0x3f')],_0x512b79[_0x629d('0x3d')]);_0x4a46ce[_0x629d('0x40')]=_[_0x629d('0x41')](_0x512b79[_0x629d('0x3f')],qs[_0x629d('0x42')](_0x48242f['query']['fields']));_0x4a46ce[_0x629d('0x40')]=_0x4a46ce[_0x629d('0x40')][_0x629d('0x43')]?_0x4a46ce[_0x629d('0x40')]:_0x512b79['model'];_0x4a46ce[_0x629d('0x62')]=qs[_0x629d('0x46')](_0x48242f['query'][_0x629d('0x46')]);_0x4a46ce[_0x629d('0x47')]=qs[_0x629d('0x3e')](_[_0x629d('0x48')](_0x48242f['query'],_0x512b79['filters']));if(_0x48242f[_0x629d('0x3d')][_0x629d('0x2f')]){_0x4a46ce[_0x629d('0x47')]=_[_0x629d('0x49')](_0x4a46ce[_0x629d('0x47')],{'$or':_['map'](_0x4a46ce[_0x629d('0x40')],function(_0x50a125){var _0x3b0bb8={};_0x3b0bb8[_0x50a125]={'$like':'%'+_0x48242f['query']['filter']+'%'};return _0x3b0bb8;})});}_0x4a46ce=_[_0x629d('0x49')]({},_0x4a46ce,_0x48242f[_0x629d('0x52')]);return _0x2e68c6[_0x629d('0xb2')](_0x4a46ce);}})[_0x629d('0x2a')](function(_0x286330){if(_0x286330){_0x162926=_0x286330['length'];if(!_0x48242f[_0x629d('0x3d')][_0x629d('0x44')](_0x629d('0x45'))){_0x4a46ce[_0x629d('0x23')]=qs[_0x629d('0x23')](_0x48242f['query'][_0x629d('0x23')]);_0x4a46ce[_0x629d('0x22')]=qs[_0x629d('0x22')](_0x48242f[_0x629d('0x3d')][_0x629d('0x22')]);}return _0x2e68c6[_0x629d('0xb2')](_0x4a46ce);}})[_0x629d('0x2a')](function(_0xf14542){if(_0xf14542){return _0xf14542?{'count':_0x162926,'rows':_0xf14542}:null;}})[_0x629d('0x2a')](respondWithResult(_0x414532,null))['catch'](handleError(_0x414532,null));};exports[_0x629d('0xb3')]=function(_0x3aec30,_0x41fdea,_0x50ed60){var _0x30ace3,_0xf1fe3e;return db[_0x629d('0x3a')][_0x629d('0x34')]({'where':{'id':_0x3aec30['params']['id']}})[_0x629d('0x2a')](handleEntityNotFound(_0x41fdea,null))[_0x629d('0x2a')](function(_0xe3b1e7){if(_0xe3b1e7){_0xf1fe3e=_0xe3b1e7;return _0xe3b1e7[_0x629d('0xb3')](_0x3aec30[_0x629d('0x54')][_0x629d('0x7d')],_[_0x629d('0x58')](_0x3aec30[_0x629d('0x54')],['ids','id'])||{});}return null;})['spread'](function(_0x503b30){var _0x5e48f2;_0x30ace3=_0x503b30||[];var _0x46ebe4=[];if(_0x503b30){for(var _0x2a831b=0x0;_0x2a831b<_0x503b30[_0x629d('0x43')];_0x2a831b+=0x1){var _0x770fe0=_0x503b30[_0x2a831b][_0x629d('0x2b')]({'plain':!![]});_0x5e48f2=squel[_0x629d('0x9d')]()[_0x629d('0x9e')](_0x629d('0xb4'))[_0x629d('0xb0')]([_0x629d('0xa0'),_0x629d('0xa2'),_0x629d('0xa3'),_0x629d('0x66'),_0x629d('0x59'),_0x629d('0x5a')],squel['select']()[_0x629d('0xa4')]('phone',_0x629d('0xa0'))[_0x629d('0xa4')]('id',_0x629d('0xa2'))['field'](_0x770fe0['CmListId']['toString'](),'ListId')[_0x629d('0xa4')](_0x3aec30['params']['id'][_0x629d('0x86')](),_0x629d('0x66'))[_0x629d('0xa4')](_0x629d('0xa5'),'createdAt')['field'](_0x629d('0xa5'),_0x629d('0x5a'))[_0x629d('0xac')]('cm_contacts')['where'](_0x629d('0xa7'))['where']('ListId\x20=\x20?',_0x770fe0['CmListId'][_0x629d('0x86')]())['where'](_0x629d('0xa9')))[_0x629d('0x86')]();_0x46ebe4['push'](db['sequelize'][_0x629d('0x3d')](_0x5e48f2));}return BPromise[_0x629d('0x8b')](_0x46ebe4);}})[_0x629d('0x2a')](function(){return _0x30ace3;})[_0x629d('0x2a')](respondWithResult(_0x41fdea,null))['catch'](handleError(_0x41fdea,null));};exports['removeBlackLists']=function(_0x54eb9f,_0x2d0266,_0x19b04b){return db['VoiceQueue']['find']({'where':{'id':_0x54eb9f[_0x629d('0x50')]['id']}})['then'](handleEntityNotFound(_0x2d0266,null))[_0x629d('0x2a')](function(_0x3dd56d){if(_0x3dd56d){return _0x3dd56d['removeBlackLists'](_0x54eb9f[_0x629d('0x3d')]['ids']);}})[_0x629d('0x2a')](function(_0x46ec51){if(_0x46ec51){return db[_0x629d('0x69')][_0x629d('0x29')]({'where':{'ListId':_0x54eb9f[_0x629d('0x3d')][_0x629d('0x7d')],'VoiceQueueId':_0x54eb9f['params']['id']}})['then'](function(){return _0x46ec51;});}})[_0x629d('0x2a')](respondWithStatusCode(_0x2d0266,null))[_0x629d('0x4e')](handleError(_0x2d0266,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 1d48275..1706cea 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 _0xd7bf=['remove','emit','hook','exports','events','setMaxListeners'];(function(_0x3be776,_0x49a9a6){var _0xea7b6a=function(_0x5e47f5){while(--_0x5e47f5){_0x3be776['push'](_0x3be776['shift']());}};_0xea7b6a(++_0x49a9a6);}(_0xd7bf,0x136));var _0xfd7b=function(_0x149d82,_0xbad987){_0x149d82=_0x149d82-0x0;var _0x459b94=_0xd7bf[_0x149d82];return _0x459b94;};'use strict';var EventEmitter=require(_0xfd7b('0x0'));var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xfd7b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xfd7b('0x2')};function emitEvent(_0x5f292b){return function(_0x10051a,_0x43effa,_0x791f16){VoiceQueueEvents[_0xfd7b('0x3')](_0x5f292b+':'+_0x10051a['id'],_0x10051a);VoiceQueueEvents[_0xfd7b('0x3')](_0x5f292b,_0x10051a);_0x791f16(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xfd7b('0x4')](e,emitEvent(event));}}module[_0xfd7b('0x5')]=VoiceQueueEvents; \ No newline at end of file +var _0xcc71=['VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x321976,_0x2cb745){var _0x1537f8=function(_0x2d2eb1){while(--_0x2d2eb1){_0x321976['push'](_0x321976['shift']());}};_0x1537f8(++_0x2cb745);}(_0xcc71,0xa8));var _0x1cc7=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xcc71[_0x397e5f];return _0x5302b8;};'use strict';var EventEmitter=require(_0x1cc7('0x0'));var VoiceQueue=require(_0x1cc7('0x1'))['db'][_0x1cc7('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1cc7('0x3')](0x0);var events={'afterCreate':_0x1cc7('0x4'),'afterUpdate':_0x1cc7('0x5'),'afterDestroy':_0x1cc7('0x6')};function emitEvent(_0x3e052c){return function(_0x27494a,_0x3ea747,_0x4c9af7){VoiceQueueEvents[_0x1cc7('0x7')](_0x3e052c+':'+_0x27494a['id'],_0x27494a);VoiceQueueEvents[_0x1cc7('0x7')](_0x3e052c,_0x27494a);_0x4c9af7(null);};}for(var e in events){if(events[_0x1cc7('0x8')](e)){var event=events[e];VoiceQueue[_0x1cc7('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 6dfdc03..2b7dbd8 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 _0xbf28=['path','exports','define','VoiceQueue','voice_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5c7ff5,_0x50506a){var _0x29824c=function(_0x28e05a){while(--_0x28e05a){_0x5c7ff5['push'](_0x5c7ff5['shift']());}};_0x29824c(++_0x50506a);}(_0xbf28,0x15a));var _0x8bf2=function(_0x26eb07,_0x45cc9a){_0x26eb07=_0x26eb07-0x0;var _0x154734=_0xbf28[_0x26eb07];return _0x154734;};'use strict';var _=require(_0x8bf2('0x0'));var util=require(_0x8bf2('0x1'));var logger=require(_0x8bf2('0x2'))(_0x8bf2('0x3'));var moment=require(_0x8bf2('0x4'));var BPromise=require('bluebird');var rp=require(_0x8bf2('0x5'));var fs=require('fs');var path=require(_0x8bf2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueue.attributes');module[_0x8bf2('0x7')]=function(_0x27addc,_0x22c303){return _0x27addc[_0x8bf2('0x8')](_0x8bf2('0x9'),attributes,{'tableName':_0x8bf2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe797=['../../config/logger','api','moment','bluebird','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','voice_queues','lodash','util'];(function(_0x2714d5,_0x28652c){var _0x13f2f0=function(_0x2d0bfd){while(--_0x2d0bfd){_0x2714d5['push'](_0x2714d5['shift']());}};_0x13f2f0(++_0x28652c);}(_0xe797,0x12a));var _0x7e79=function(_0x5bcab9,_0x9df373){_0x5bcab9=_0x5bcab9-0x0;var _0xea8fa=_0xe797[_0x5bcab9];return _0xea8fa;};'use strict';var _=require(_0x7e79('0x0'));var util=require(_0x7e79('0x1'));var logger=require(_0x7e79('0x2'))(_0x7e79('0x3'));var moment=require(_0x7e79('0x4'));var BPromise=require(_0x7e79('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e79('0x6'));var rimraf=require(_0x7e79('0x7'));var config=require('../../config/environment');var attributes=require(_0x7e79('0x8'));module[_0x7e79('0x9')]=function(_0x3cd4c9,_0x48a8c1){return _0x3cd4c9['define'](_0x7e79('0xa'),attributes,{'tableName':_0x7e79('0xb'),'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 a0a9e34..081c25f 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 _0xa6aa=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','register','request','info','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueue,\x20%s,\x20%s','result','catch','GetVoiceQueue','findAll','options','raw','where','include','attributes','map','model','debug','VoiceQueue','find','then','ShowVoiceQueue','lodash','util','bluebird','randomstring'];(function(_0x43a302,_0x5372ec){var _0x2b23a8=function(_0x5a038d){while(--_0x5a038d){_0x43a302['push'](_0x43a302['shift']());}};_0x2b23a8(++_0x5372ec);}(_0xa6aa,0x182));var _0xaa6a=function(_0x208961,_0x5e6cf6){_0x208961=_0x208961-0x0;var _0x4236f5=_0xa6aa[_0x208961];return _0x4236f5;};'use strict';var _=require(_0xaa6a('0x0'));var util=require(_0xaa6a('0x1'));var moment=require('moment');var BPromise=require(_0xaa6a('0x2'));var rs=require(_0xaa6a('0x3'));var fs=require('fs');var Redis=require(_0xaa6a('0x4'));var db=require(_0xaa6a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa6a('0x6'))(_0xaa6a('0x7'));var config=require(_0xaa6a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaa6a('0x9')][_0xaa6a('0xa')]({'port':0x232a});config[_0xaa6a('0xb')]=_[_0xaa6a('0xc')](config[_0xaa6a('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceQueue.socket')[_0xaa6a('0xd')](socket);function respondWithRpcPromise(_0x1ff4be,_0x559a11,_0x425473){return new BPromise(function(_0x3edacf,_0x1fac9c){return client[_0xaa6a('0xe')](_0x1ff4be,_0x425473)['then'](function(_0x5a05b0){logger[_0xaa6a('0xf')]('VoiceQueue,\x20%s,\x20%s',_0x559a11,_0xaa6a('0x10'));logger['debug'](_0xaa6a('0x11'),_0x559a11,_0xaa6a('0x10'),JSON[_0xaa6a('0x12')](_0x5a05b0));if(_0x5a05b0[_0xaa6a('0x13')]){if(_0x5a05b0[_0xaa6a('0x13')][_0xaa6a('0x14')]===0x1f4){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x559a11,_0x5a05b0['error'][_0xaa6a('0x15')]);return _0x1fac9c(_0x5a05b0['error']['message']);}logger[_0xaa6a('0x13')](_0xaa6a('0x16'),_0x559a11,_0x5a05b0['error'][_0xaa6a('0x15')]);return _0x3edacf(_0x5a05b0['error'][_0xaa6a('0x15')]);}else{logger['info'](_0xaa6a('0x16'),_0x559a11,_0xaa6a('0x10'));_0x3edacf(_0x5a05b0[_0xaa6a('0x17')]['message']);}})[_0xaa6a('0x18')](function(_0xc7ba03){logger[_0xaa6a('0x13')](_0xaa6a('0x16'),_0x559a11,_0xc7ba03);_0x1fac9c(_0xc7ba03);});});}exports[_0xaa6a('0x19')]=function(_0x45767d){var _0x1167b0=this;return new Promise(function(_0x38d425,_0x468afb){return db['VoiceQueue'][_0xaa6a('0x1a')]({'raw':_0x45767d[_0xaa6a('0x1b')]?_0x45767d[_0xaa6a('0x1b')][_0xaa6a('0x1c')]===undefined?!![]:![]:!![],'where':_0x45767d[_0xaa6a('0x1b')]?_0x45767d[_0xaa6a('0x1b')][_0xaa6a('0x1d')]||null:null,'attributes':_0x45767d[_0xaa6a('0x1b')]?_0x45767d[_0xaa6a('0x1b')]['attributes']||null:null,'limit':_0x45767d[_0xaa6a('0x1b')]?_0x45767d[_0xaa6a('0x1b')]['limit']||null:null,'include':_0x45767d['options']?_0x45767d[_0xaa6a('0x1b')]['include']?_['map'](_0x45767d['options'][_0xaa6a('0x1e')],function(_0x20d116){return{'model':db[_0x20d116['model']],'as':_0x20d116['as'],'attributes':_0x20d116[_0xaa6a('0x1f')],'include':_0x20d116[_0xaa6a('0x1e')]?_[_0xaa6a('0x20')](_0x20d116[_0xaa6a('0x1e')],function(_0x374db9){return{'model':db[_0x374db9['model']],'as':_0x374db9['as'],'attributes':_0x374db9[_0xaa6a('0x1f')],'include':_0x374db9[_0xaa6a('0x1e')]?_['map'](_0x374db9[_0xaa6a('0x1e')],function(_0x3fcffe){return{'model':db[_0x3fcffe[_0xaa6a('0x21')]],'as':_0x3fcffe['as'],'attributes':_0x3fcffe['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c33e7){logger[_0xaa6a('0xf')]('GetVoiceQueue',_0x45767d);logger[_0xaa6a('0x22')](_0xaa6a('0x19'),_0x45767d,JSON[_0xaa6a('0x12')](_0x2c33e7));_0x38d425(_0x2c33e7);})[_0xaa6a('0x18')](function(_0x313926){logger['error'](_0xaa6a('0x19'),_0x313926['message'],_0x45767d);_0x468afb(_0x1167b0[_0xaa6a('0x13')](0x1f4,_0x313926[_0xaa6a('0x15')]));});});};exports['ShowVoiceQueue']=function(_0x9b6bd7){var _0x4bd1ba=this;return new Promise(function(_0x35e0fd,_0x1c1099){return db[_0xaa6a('0x23')][_0xaa6a('0x24')]({'raw':_0x9b6bd7[_0xaa6a('0x1b')]?_0x9b6bd7[_0xaa6a('0x1b')][_0xaa6a('0x1c')]===undefined?!![]:![]:!![],'where':_0x9b6bd7[_0xaa6a('0x1b')]?_0x9b6bd7[_0xaa6a('0x1b')][_0xaa6a('0x1d')]||null:null,'attributes':_0x9b6bd7[_0xaa6a('0x1b')]?_0x9b6bd7[_0xaa6a('0x1b')][_0xaa6a('0x1f')]||null:null,'include':_0x9b6bd7[_0xaa6a('0x1b')]?_0x9b6bd7[_0xaa6a('0x1b')][_0xaa6a('0x1e')]?_[_0xaa6a('0x20')](_0x9b6bd7[_0xaa6a('0x1b')][_0xaa6a('0x1e')],function(_0x414e1c){return{'model':db[_0x414e1c[_0xaa6a('0x21')]],'as':_0x414e1c['as'],'attributes':_0x414e1c[_0xaa6a('0x1f')],'include':_0x414e1c['include']?_[_0xaa6a('0x20')](_0x414e1c[_0xaa6a('0x1e')],function(_0x556cc1){return{'model':db[_0x556cc1['model']],'as':_0x556cc1['as'],'attributes':_0x556cc1[_0xaa6a('0x1f')],'include':_0x556cc1['include']?_[_0xaa6a('0x20')](_0x556cc1[_0xaa6a('0x1e')],function(_0x43d78e){return{'model':db[_0x43d78e[_0xaa6a('0x21')]],'as':_0x43d78e['as'],'attributes':_0x43d78e[_0xaa6a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaa6a('0x25')](function(_0x341bb9){logger[_0xaa6a('0xf')](_0xaa6a('0x26'),_0x9b6bd7);logger[_0xaa6a('0x22')](_0xaa6a('0x26'),_0x9b6bd7,JSON['stringify'](_0x341bb9));_0x35e0fd(_0x341bb9);})['catch'](function(_0x1e4388){logger[_0xaa6a('0x13')]('ShowVoiceQueue',_0x1e4388['message'],_0x9b6bd7);_0x1c1099(_0x4bd1ba[_0xaa6a('0x13')](0x1f4,_0x1e4388[_0xaa6a('0x15')]));});});}; \ No newline at end of file +var _0xed8a=['rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','include','map','model','stringify','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xed8a,0x1f2));var _0xaed8=function(_0x3c3712,_0x5368b3){_0x3c3712=_0x3c3712-0x0;var _0x43944d=_0xed8a[_0x3c3712];return _0x43944d;};'use strict';var _=require(_0xaed8('0x0'));var util=require(_0xaed8('0x1'));var moment=require(_0xaed8('0x2'));var BPromise=require(_0xaed8('0x3'));var rs=require(_0xaed8('0x4'));var fs=require('fs');var Redis=require(_0xaed8('0x5'));var db=require(_0xaed8('0x6'))['db'];var utils=require(_0xaed8('0x7'));var logger=require(_0xaed8('0x8'))(_0xaed8('0x9'));var config=require(_0xaed8('0xa'));var jayson=require(_0xaed8('0xb'));var client=jayson[_0xaed8('0xc')]['http']({'port':0x232a});config['redis']=_[_0xaed8('0xd')](config[_0xaed8('0xe')],{'host':_0xaed8('0xf'),'port':0x18eb});var socket=require(_0xaed8('0x10'))(new Redis(config[_0xaed8('0xe')]));require('./voiceQueue.socket')['register'](socket);function respondWithRpcPromise(_0x168fda,_0x44d100,_0x360cb1){return new BPromise(function(_0x3bcbf7,_0x2aebf0){return client['request'](_0x168fda,_0x360cb1)[_0xaed8('0x11')](function(_0x30f08f){logger[_0xaed8('0x12')](_0xaed8('0x13'),_0x44d100,_0xaed8('0x14'));logger[_0xaed8('0x15')](_0xaed8('0x16'),_0x44d100,_0xaed8('0x14'),JSON['stringify'](_0x30f08f));if(_0x30f08f[_0xaed8('0x17')]){if(_0x30f08f['error']['code']===0x1f4){logger[_0xaed8('0x17')](_0xaed8('0x13'),_0x44d100,_0x30f08f[_0xaed8('0x17')][_0xaed8('0x18')]);return _0x2aebf0(_0x30f08f['error']['message']);}logger['error'](_0xaed8('0x13'),_0x44d100,_0x30f08f[_0xaed8('0x17')]['message']);return _0x3bcbf7(_0x30f08f[_0xaed8('0x17')][_0xaed8('0x18')]);}else{logger['info'](_0xaed8('0x13'),_0x44d100,_0xaed8('0x14'));_0x3bcbf7(_0x30f08f[_0xaed8('0x19')]['message']);}})[_0xaed8('0x1a')](function(_0x38366c){logger[_0xaed8('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x44d100,_0x38366c);_0x2aebf0(_0x38366c);});});}exports[_0xaed8('0x1b')]=function(_0x270cee){var _0x116c3a=this;return new Promise(function(_0x2f5042,_0xdc0b53){return db[_0xaed8('0x1c')]['findAll']({'raw':_0x270cee[_0xaed8('0x1d')]?_0x270cee[_0xaed8('0x1d')][_0xaed8('0x1e')]===undefined?!![]:![]:!![],'where':_0x270cee[_0xaed8('0x1d')]?_0x270cee[_0xaed8('0x1d')][_0xaed8('0x1f')]||null:null,'attributes':_0x270cee[_0xaed8('0x1d')]?_0x270cee['options'][_0xaed8('0x20')]||null:null,'limit':_0x270cee[_0xaed8('0x1d')]?_0x270cee[_0xaed8('0x1d')]['limit']||null:null,'include':_0x270cee[_0xaed8('0x1d')]?_0x270cee['options'][_0xaed8('0x21')]?_[_0xaed8('0x22')](_0x270cee[_0xaed8('0x1d')]['include'],function(_0x33b718){return{'model':db[_0x33b718[_0xaed8('0x23')]],'as':_0x33b718['as'],'attributes':_0x33b718[_0xaed8('0x20')],'include':_0x33b718['include']?_[_0xaed8('0x22')](_0x33b718['include'],function(_0x2bb980){return{'model':db[_0x2bb980[_0xaed8('0x23')]],'as':_0x2bb980['as'],'attributes':_0x2bb980[_0xaed8('0x20')],'include':_0x2bb980['include']?_[_0xaed8('0x22')](_0x2bb980[_0xaed8('0x21')],function(_0x2f5296){return{'model':db[_0x2f5296[_0xaed8('0x23')]],'as':_0x2f5296['as'],'attributes':_0x2f5296[_0xaed8('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x59e182){logger[_0xaed8('0x12')]('GetVoiceQueue',_0x270cee);logger[_0xaed8('0x15')](_0xaed8('0x1b'),_0x270cee,JSON[_0xaed8('0x24')](_0x59e182));_0x2f5042(_0x59e182);})[_0xaed8('0x1a')](function(_0x1e1e24){logger[_0xaed8('0x17')](_0xaed8('0x1b'),_0x1e1e24['message'],_0x270cee);_0xdc0b53(_0x116c3a[_0xaed8('0x17')](0x1f4,_0x1e1e24['message']));});});};exports[_0xaed8('0x25')]=function(_0x5789df){var _0x145c6a=this;return new Promise(function(_0x3916f6,_0x460639){return db[_0xaed8('0x1c')][_0xaed8('0x26')]({'raw':_0x5789df['options']?_0x5789df[_0xaed8('0x1d')][_0xaed8('0x1e')]===undefined?!![]:![]:!![],'where':_0x5789df[_0xaed8('0x1d')]?_0x5789df[_0xaed8('0x1d')][_0xaed8('0x1f')]||null:null,'attributes':_0x5789df['options']?_0x5789df[_0xaed8('0x1d')]['attributes']||null:null,'include':_0x5789df[_0xaed8('0x1d')]?_0x5789df[_0xaed8('0x1d')][_0xaed8('0x21')]?_[_0xaed8('0x22')](_0x5789df[_0xaed8('0x1d')][_0xaed8('0x21')],function(_0x323b64){return{'model':db[_0x323b64['model']],'as':_0x323b64['as'],'attributes':_0x323b64[_0xaed8('0x20')],'include':_0x323b64[_0xaed8('0x21')]?_[_0xaed8('0x22')](_0x323b64['include'],function(_0x4ada52){return{'model':db[_0x4ada52[_0xaed8('0x23')]],'as':_0x4ada52['as'],'attributes':_0x4ada52[_0xaed8('0x20')],'include':_0x4ada52[_0xaed8('0x21')]?_[_0xaed8('0x22')](_0x4ada52[_0xaed8('0x21')],function(_0x2bbeab){return{'model':db[_0x2bbeab[_0xaed8('0x23')]],'as':_0x2bbeab['as'],'attributes':_0x2bbeab['attributes']};}):[]};}):[]};}):[]:[]})[_0xaed8('0x11')](function(_0x3c313a){logger[_0xaed8('0x12')](_0xaed8('0x25'),_0x5789df);logger[_0xaed8('0x15')]('ShowVoiceQueue',_0x5789df,JSON[_0xaed8('0x24')](_0x3c313a));_0x3916f6(_0x3c313a);})[_0xaed8('0x1a')](function(_0x549ba6){logger[_0xaed8('0x17')](_0xaed8('0x25'),_0x549ba6[_0xaed8('0x18')],_0x5789df);_0x460639(_0x145c6a[_0xaed8('0x17')](0x1f4,_0x549ba6[_0xaed8('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index dd11630..60ef32a 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 _0x36f9=['voiceQueue:','./voiceQueue.events','remove','emit','removeListener','register','length'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0x36f9,0x151));var _0x936f=function(_0x33f2d0,_0x784af6){_0x33f2d0=_0x33f2d0-0x0;var _0x471f9b=_0x36f9[_0x33f2d0];return _0x471f9b;};'use strict';var VoiceQueueEvents=require(_0x936f('0x0'));var events=['save',_0x936f('0x1'),'update'];function createListener(_0x5b789a,_0x14c1bf){return function(_0x255c3c){_0x14c1bf[_0x936f('0x2')](_0x5b789a,_0x255c3c);};}function removeListener(_0x2bdd5d,_0x8dccd0){return function(){VoiceQueueEvents[_0x936f('0x3')](_0x2bdd5d,_0x8dccd0);};}exports[_0x936f('0x4')]=function(_0xb18ba3){for(var _0x1c9c87=0x0,_0x361291=events[_0x936f('0x5')];_0x1c9c87<_0x361291;_0x1c9c87++){var _0x5b3cf7=events[_0x1c9c87];var _0xdaf708=createListener(_0x936f('0x6')+_0x5b3cf7,_0xb18ba3);VoiceQueueEvents['on'](_0x5b3cf7,_0xdaf708);}}; \ No newline at end of file +var _0x4c6b=['emit','removeListener','register','length','./voiceQueue.events','save','remove','update'];(function(_0x5407e3,_0x5ac771){var _0x2de17d=function(_0x51e51a){while(--_0x51e51a){_0x5407e3['push'](_0x5407e3['shift']());}};_0x2de17d(++_0x5ac771);}(_0x4c6b,0xe4));var _0xb4c6=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x4c6b[_0x82129b];return _0x2ae5dc;};'use strict';var VoiceQueueEvents=require(_0xb4c6('0x0'));var events=[_0xb4c6('0x1'),_0xb4c6('0x2'),_0xb4c6('0x3')];function createListener(_0x3734b3,_0x1d8628){return function(_0xdafc25){_0x1d8628[_0xb4c6('0x4')](_0x3734b3,_0xdafc25);};}function removeListener(_0x1eb7c1,_0x4e702a){return function(){VoiceQueueEvents[_0xb4c6('0x5')](_0x1eb7c1,_0x4e702a);};}exports[_0xb4c6('0x6')]=function(_0x10eb3a){for(var _0x64f89d=0x0,_0x31b3f3=events[_0xb4c6('0x7')];_0x64f89d<_0x31b3f3;_0x64f89d++){var _0x56a8bf=events[_0x64f89d];var _0x3b64ba=createListener('voiceQueue:'+_0x56a8bf,_0x10eb3a);VoiceQueueEvents['on'](_0x56a8bf,_0x3b64ba);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 7176a7a..64422bc 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 _0xaa37=['/index','getVoiceQueuesReport','/:id','show','post','put','update','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xaa37,0x1d3));var _0x7aa3=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xaa37[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var path=require(_0x7aa3('0x2'));var timeout=require(_0x7aa3('0x3'));var express=require('express');var router=express[_0x7aa3('0x4')]();var auth=require(_0x7aa3('0x5'));var interaction=require(_0x7aa3('0x6'));var config=require(_0x7aa3('0x7'));var controller=require(_0x7aa3('0x8'));router[_0x7aa3('0x9')]('/',auth[_0x7aa3('0xa')](),controller['index']);router[_0x7aa3('0x9')](_0x7aa3('0xb'),auth['isAuthenticated'](),controller[_0x7aa3('0xc')]);router[_0x7aa3('0x9')](_0x7aa3('0xd'),auth['isAuthenticated'](),controller[_0x7aa3('0xe')]);router[_0x7aa3('0x9')](_0x7aa3('0xf'),auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x10')]);router[_0x7aa3('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7aa3('0x12')]('/:id',auth[_0x7aa3('0xa')](),controller[_0x7aa3('0x13')]);router['delete'](_0x7aa3('0xf'),auth[_0x7aa3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1623=['multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','post','create','put','update','delete','destroy'];(function(_0x1f6f03,_0xf63776){var _0x2ac7aa=function(_0x98febb){while(--_0x98febb){_0x1f6f03['push'](_0x1f6f03['shift']());}};_0x2ac7aa(++_0xf63776);}(_0x1623,0xab));var _0x3162=function(_0x2398e7,_0x1b7b98){_0x2398e7=_0x2398e7-0x0;var _0x5058e4=_0x1623[_0x2398e7];return _0x5058e4;};'use strict';var multer=require(_0x3162('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3162('0x1'));var express=require(_0x3162('0x2'));var router=express[_0x3162('0x3')]();var auth=require(_0x3162('0x4'));var interaction=require(_0x3162('0x5'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0x3162('0x6')]('/',auth['isAuthenticated'](),controller[_0x3162('0x7')]);router[_0x3162('0x6')]('/describe',auth[_0x3162('0x8')](),controller[_0x3162('0x9')]);router[_0x3162('0x6')](_0x3162('0xa'),auth[_0x3162('0x8')](),controller[_0x3162('0xb')]);router[_0x3162('0x6')](_0x3162('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x3162('0xd')]('/',auth[_0x3162('0x8')](),controller[_0x3162('0xe')]);router[_0x3162('0xf')](_0x3162('0xc'),auth[_0x3162('0x8')](),controller[_0x3162('0x10')]);router[_0x3162('0x11')](_0x3162('0xc'),auth['isAuthenticated'](),controller[_0x3162('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index d5e064d..a58bd3d 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 _0x18f6=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','setDataValue','INTEGER'];(function(_0x477a7e,_0x31b9fe){var _0xb4a7e1=function(_0x5302c8){while(--_0x5302c8){_0x477a7e['push'](_0x477a7e['shift']());}};_0xb4a7e1(++_0x31b9fe);}(_0x18f6,0x17f));var _0x618f=function(_0x315fb1,_0x546fd9){_0x315fb1=_0x315fb1-0x0;var _0x5bb111=_0x18f6[_0x315fb1];return _0x5bb111;};'use strict';var Sequelize=require(_0x618f('0x0'));var moment=require('moment');module[_0x618f('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x618f('0x2')]},'calleridname':{'type':Sequelize[_0x618f('0x2')]},'queue':{'type':Sequelize[_0x618f('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x618f('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x32813a){var _0x24833e=moment(_0x32813a);var _0x185e4d=moment(this[_0x618f('0x4')]('queuecallerjoinAt'))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x43ad38=_0x24833e['diff'](_0x185e4d,'seconds');this[_0x618f('0x5')]('queuecallerleaveAt',_0x32813a);this['setDataValue']('holdtime',_0x43ad38||null);}},'position':{'type':Sequelize[_0x618f('0x6')]},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x618f('0x7')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x618f('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x618f('0x3')]},'queuecallerexit':{'type':Sequelize[_0x618f('0x7')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x618f('0x2')],'comment':_0x618f('0x8')},'originalposition':{'type':Sequelize[_0x618f('0x6')]},'channel':{'type':Sequelize[_0x618f('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x618f('0x2')]},'context':{'type':Sequelize[_0x618f('0x2')]},'exten':{'type':Sequelize[_0x618f('0x2')]},'priority':{'type':Sequelize[_0x618f('0x2')]},'holdtime':{'type':Sequelize[_0x618f('0x6')]},'mohtime':{'type':Sequelize[_0x618f('0x6')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x618f('0x7')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x618f('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x618f('0x2')],'comment':_0x618f('0x9')},'transferexten':{'type':Sequelize[_0x618f('0x2')]},'transferuniqueid':{'type':Sequelize[_0x618f('0x2')]},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2626=['sequelize','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x4e5ebc,_0x5d2df7){var _0x40937a=function(_0x573d7b){while(--_0x573d7b){_0x4e5ebc['push'](_0x4e5ebc['shift']());}};_0x40937a(++_0x5d2df7);}(_0x2626,0x11e));var _0x6262=function(_0x3b6083,_0x4a7f1b){_0x3b6083=_0x3b6083-0x0;var _0x12d996=_0x2626[_0x3b6083];return _0x12d996;};'use strict';var Sequelize=require(_0x6262('0x0'));var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0x6262('0x1')]},'uniqueid':{'type':Sequelize[_0x6262('0x1')]},'calleridnum':{'type':Sequelize[_0x6262('0x1')]},'calleridname':{'type':Sequelize[_0x6262('0x1')]},'queue':{'type':Sequelize[_0x6262('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0x6262('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x6262('0x2')],'set':function(_0x690b1){var _0x456465=moment(_0x690b1);var _0x520498=moment(this[_0x6262('0x3')](_0x6262('0x4')))[_0x6262('0x5')](_0x6262('0x6'));var _0xcce261=_0x456465['diff'](_0x520498,'seconds');this[_0x6262('0x7')](_0x6262('0x8'),_0x690b1);this[_0x6262('0x7')]('holdtime',_0xcce261||null);}},'position':{'type':Sequelize[_0x6262('0x9')]},'count':{'type':Sequelize[_0x6262('0x9')]},'queuecallerabandon':{'type':Sequelize[_0x6262('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x6262('0x2')]},'queuecallercomplete':{'type':Sequelize[_0x6262('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x6262('0x2')]},'queuecallerexit':{'type':Sequelize[_0x6262('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x6262('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x6262('0x1')],'comment':_0x6262('0xb')},'originalposition':{'type':Sequelize[_0x6262('0x9')]},'channel':{'type':Sequelize[_0x6262('0x1')]},'connectedlinenum':{'type':Sequelize[_0x6262('0x1')]},'connectedlinename':{'type':Sequelize[_0x6262('0x1')]},'accountcode':{'type':Sequelize[_0x6262('0x1')]},'context':{'type':Sequelize[_0x6262('0x1')]},'exten':{'type':Sequelize[_0x6262('0x1')]},'priority':{'type':Sequelize[_0x6262('0x1')]},'holdtime':{'type':Sequelize[_0x6262('0x9')]},'mohtime':{'type':Sequelize[_0x6262('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6262('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x6262('0x1')]},'transfer':{'type':Sequelize[_0x6262('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6262('0x1')],'comment':_0x6262('0xc')},'transferexten':{'type':Sequelize[_0x6262('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x6262('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x6262('0x9')],'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 8183fff..feb32b9 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 _0x7a54=['hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','getVoiceQueuesReport','intersection','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x7a54,0x106));var _0x47a5=function(_0xf9ecaf,_0x481e9d){_0xf9ecaf=_0xf9ecaf-0x0;var _0x1403d8=_0x7a54[_0xf9ecaf];return _0x1403d8;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}exports[_0x47a5('0x2b')]=function(_0x16631f,_0x361bfa){var _0x1127f8={},_0x11a4fa={},_0x3ad507={'count':0x0,'rows':[]};var _0x528582=_[_0x47a5('0x2c')](db['VoiceQueueReport'][_0x47a5('0x2d')],function(_0x9ac908){return{'name':_0x9ac908[_0x47a5('0x2e')],'type':_0x9ac908['type'][_0x47a5('0x2f')]};});_0x11a4fa[_0x47a5('0x30')]=_[_0x47a5('0x2c')](_0x528582,_0x47a5('0x29'));_0x11a4fa['query']=_['keys'](_0x16631f[_0x47a5('0x31')]);_0x11a4fa[_0x47a5('0x32')]=_['intersection'](_0x11a4fa['model'],_0x11a4fa[_0x47a5('0x31')]);_0x1127f8[_0x47a5('0x33')]=_['intersection'](_0x11a4fa[_0x47a5('0x30')],qs['fields'](_0x16631f[_0x47a5('0x31')][_0x47a5('0x34')]));_0x1127f8['attributes']=_0x1127f8['attributes'][_0x47a5('0x35')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x30')];if(!_0x16631f[_0x47a5('0x31')][_0x47a5('0x36')]('nolimit')){_0x1127f8[_0x47a5('0x1f')]=qs['limit'](_0x16631f['query'][_0x47a5('0x1f')]);_0x1127f8['offset']=qs[_0x47a5('0x1e')](_0x16631f['query'][_0x47a5('0x1e')]);}_0x1127f8[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0x16631f[_0x47a5('0x31')][_0x47a5('0x38')]);_0x1127f8[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0x16631f[_0x47a5('0x31')],_0x11a4fa['filters']),_0x528582);if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x1127f8['where']=_[_0x47a5('0x3c')](_0x1127f8[_0x47a5('0x39')],{'$or':_[_0x47a5('0x2c')](_0x528582,function(_0x49c4b5){if(_0x49c4b5[_0x47a5('0x3d')]!==_0x47a5('0x3e')){var _0x596097={};_0x596097[_0x49c4b5[_0x47a5('0x29')]]={'$like':'%'+_0x16631f[_0x47a5('0x31')]['filter']+'%'};return _0x596097;}})});}_0x1127f8=_['merge']({},_0x1127f8,_0x16631f['options']);var _0x12d9f2={'where':_0x1127f8['where']};return db[_0x47a5('0x3f')][_0x47a5('0x1d')](_0x12d9f2)[_0x47a5('0x26')](function(_0x111f0d){_0x3ad507[_0x47a5('0x1d')]=_0x111f0d;if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x40')]){_0x1127f8[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x1127f8);})[_0x47a5('0x26')](function(_0x1658e8){_0x3ad507[_0x47a5('0x43')]=_0x1658e8;return _0x3ad507;})['then'](respondWithFilteredResult(_0x361bfa,_0x1127f8))[_0x47a5('0x44')](handleError(_0x361bfa,null));};exports[_0x47a5('0x45')]=function(_0x331474,_0x23bd8d){var _0x586f4f={'raw':![],'where':{'id':_0x331474['params']['id']}},_0x7de536={};_0x7de536['model']=_['keys'](db['VoiceQueueReport'][_0x47a5('0x2d')]);_0x7de536['query']=_[_0x47a5('0x46')](_0x331474[_0x47a5('0x31')]);_0x7de536[_0x47a5('0x32')]=_['intersection'](_0x7de536[_0x47a5('0x30')],_0x7de536[_0x47a5('0x31')]);_0x586f4f['attributes']=_['intersection'](_0x7de536[_0x47a5('0x30')],qs['fields'](_0x331474[_0x47a5('0x31')][_0x47a5('0x34')]));_0x586f4f[_0x47a5('0x33')]=_0x586f4f[_0x47a5('0x33')][_0x47a5('0x35')]?_0x586f4f[_0x47a5('0x33')]:_0x7de536[_0x47a5('0x30')];if(_0x331474[_0x47a5('0x31')][_0x47a5('0x40')]){_0x586f4f[_0x47a5('0x41')]=[{'all':!![]}];}_0x586f4f=_[_0x47a5('0x3c')]({},_0x586f4f,_0x331474[_0x47a5('0x47')]);return db[_0x47a5('0x3f')][_0x47a5('0x48')](_0x586f4f)[_0x47a5('0x26')](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x26')](respondWithResult(_0x23bd8d,null))['catch'](handleError(_0x23bd8d,null));};exports[_0x47a5('0x49')]=function(_0x23bb04,_0x49eab1){return db['VoiceQueueReport'][_0x47a5('0x49')](_0x23bb04['body'],{})[_0x47a5('0x26')](respondWithResult(_0x49eab1,0xc9))[_0x47a5('0x44')](handleError(_0x49eab1,null));};exports['update']=function(_0x4f62d3,_0x3d85cc){if(_0x4f62d3['body']['id']){delete _0x4f62d3[_0x47a5('0x4a')]['id'];}return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x4f62d3[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x26')](saveUpdates(_0x4f62d3[_0x47a5('0x4a')],null))['then'](respondWithResult(_0x3d85cc,null))['catch'](handleError(_0x3d85cc,null));};exports[_0x47a5('0x25')]=function(_0x411230,_0x1163e3){return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x411230[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x1163e3,null))['then'](removeEntity(_0x1163e3,null))[_0x47a5('0x44')](handleError(_0x1163e3,null));};exports[_0x47a5('0x4c')]=function(_0x5f6a,_0x5c3c75){return db[_0x47a5('0x3f')]['describe']()[_0x47a5('0x26')](respondWithResult(_0x5c3c75,null))[_0x47a5('0x44')](handleError(_0x5c3c75,null));};exports[_0x47a5('0x4d')]=function(_0xf03bd5,_0x588551){var _0x3adf14={},_0x1e6de3={},_0x2f66e9={'count':0x0,'rows':[]};_0x1e6de3[_0x47a5('0x30')]=_[_0x47a5('0x46')](db[_0x47a5('0x3f')][_0x47a5('0x2d')]);_0x1e6de3['query']=_[_0x47a5('0x46')](_0xf03bd5[_0x47a5('0x31')]);_0x1e6de3[_0x47a5('0x32')]=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],_0x1e6de3[_0x47a5('0x31')]);_0x3adf14['attributes']=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],qs[_0x47a5('0x34')](_0xf03bd5['query'][_0x47a5('0x34')]));_0x3adf14[_0x47a5('0x33')]=_0x3adf14[_0x47a5('0x33')]['length']?_0x3adf14['attributes']:_0x1e6de3[_0x47a5('0x30')];if(!_0xf03bd5[_0x47a5('0x31')]['hasOwnProperty']('nolimit')){_0x3adf14[_0x47a5('0x1f')]=qs['limit'](_0xf03bd5[_0x47a5('0x31')]['limit']);_0x3adf14['offset']=qs[_0x47a5('0x1e')](_0xf03bd5[_0x47a5('0x31')]['offset']);}_0x3adf14[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0xf03bd5['query']['sort']);_0x3adf14[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0xf03bd5[_0x47a5('0x31')],_0x1e6de3['filters']));if(_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x3adf14[_0x47a5('0x39')]=_['merge'](_0x3adf14[_0x47a5('0x39')],{'$or':_['map'](_0x3adf14[_0x47a5('0x33')],function(_0x470da6){var _0x943a15={};_0x943a15[_0x470da6]={'$like':'%'+_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]+'%'};return _0x943a15;})});}_0x3adf14=_['merge']({},_0x3adf14,_0xf03bd5[_0x47a5('0x47')]);var _0x5d1550={'where':_0x3adf14['where']};return db['VoiceQueueReport']['count'](_0x5d1550)[_0x47a5('0x26')](function(_0x6cd4ea){_0x2f66e9[_0x47a5('0x1d')]=_0x6cd4ea;if(_0xf03bd5['query']['includeAll']){_0x3adf14[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x3adf14);})[_0x47a5('0x26')](function(_0xc45e25){_0x2f66e9['rows']=_0xc45e25;return _0x2f66e9;})[_0x47a5('0x26')](respondWithFilteredResult(_0x588551,_0x3adf14,'getVoiceQueuesReport'))[_0x47a5('0x44')](handleError(_0x588551,null,_0x47a5('0x4d')));}; \ No newline at end of file +var _0x7a54=['hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','getVoiceQueuesReport','intersection','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7a54,0x106));var _0x47a5=function(_0x252fe0,_0x2a053e){_0x252fe0=_0x252fe0-0x0;var _0x2bd17a=_0x7a54[_0x252fe0];return _0x2bd17a;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}exports[_0x47a5('0x2b')]=function(_0x16631f,_0x361bfa){var _0x1127f8={},_0x11a4fa={},_0x3ad507={'count':0x0,'rows':[]};var _0x528582=_[_0x47a5('0x2c')](db['VoiceQueueReport'][_0x47a5('0x2d')],function(_0x9ac908){return{'name':_0x9ac908[_0x47a5('0x2e')],'type':_0x9ac908['type'][_0x47a5('0x2f')]};});_0x11a4fa[_0x47a5('0x30')]=_[_0x47a5('0x2c')](_0x528582,_0x47a5('0x29'));_0x11a4fa['query']=_['keys'](_0x16631f[_0x47a5('0x31')]);_0x11a4fa[_0x47a5('0x32')]=_['intersection'](_0x11a4fa['model'],_0x11a4fa[_0x47a5('0x31')]);_0x1127f8[_0x47a5('0x33')]=_['intersection'](_0x11a4fa[_0x47a5('0x30')],qs['fields'](_0x16631f[_0x47a5('0x31')][_0x47a5('0x34')]));_0x1127f8['attributes']=_0x1127f8['attributes'][_0x47a5('0x35')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x30')];if(!_0x16631f[_0x47a5('0x31')][_0x47a5('0x36')]('nolimit')){_0x1127f8[_0x47a5('0x1f')]=qs['limit'](_0x16631f['query'][_0x47a5('0x1f')]);_0x1127f8['offset']=qs[_0x47a5('0x1e')](_0x16631f['query'][_0x47a5('0x1e')]);}_0x1127f8[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0x16631f[_0x47a5('0x31')][_0x47a5('0x38')]);_0x1127f8[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0x16631f[_0x47a5('0x31')],_0x11a4fa['filters']),_0x528582);if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x1127f8['where']=_[_0x47a5('0x3c')](_0x1127f8[_0x47a5('0x39')],{'$or':_[_0x47a5('0x2c')](_0x528582,function(_0x49c4b5){if(_0x49c4b5[_0x47a5('0x3d')]!==_0x47a5('0x3e')){var _0x596097={};_0x596097[_0x49c4b5[_0x47a5('0x29')]]={'$like':'%'+_0x16631f[_0x47a5('0x31')]['filter']+'%'};return _0x596097;}})});}_0x1127f8=_['merge']({},_0x1127f8,_0x16631f['options']);var _0x12d9f2={'where':_0x1127f8['where']};return db[_0x47a5('0x3f')][_0x47a5('0x1d')](_0x12d9f2)[_0x47a5('0x26')](function(_0x111f0d){_0x3ad507[_0x47a5('0x1d')]=_0x111f0d;if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x40')]){_0x1127f8[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x1127f8);})[_0x47a5('0x26')](function(_0x1658e8){_0x3ad507[_0x47a5('0x43')]=_0x1658e8;return _0x3ad507;})['then'](respondWithFilteredResult(_0x361bfa,_0x1127f8))[_0x47a5('0x44')](handleError(_0x361bfa,null));};exports[_0x47a5('0x45')]=function(_0x331474,_0x23bd8d){var _0x586f4f={'raw':![],'where':{'id':_0x331474['params']['id']}},_0x7de536={};_0x7de536['model']=_['keys'](db['VoiceQueueReport'][_0x47a5('0x2d')]);_0x7de536['query']=_[_0x47a5('0x46')](_0x331474[_0x47a5('0x31')]);_0x7de536[_0x47a5('0x32')]=_['intersection'](_0x7de536[_0x47a5('0x30')],_0x7de536[_0x47a5('0x31')]);_0x586f4f['attributes']=_['intersection'](_0x7de536[_0x47a5('0x30')],qs['fields'](_0x331474[_0x47a5('0x31')][_0x47a5('0x34')]));_0x586f4f[_0x47a5('0x33')]=_0x586f4f[_0x47a5('0x33')][_0x47a5('0x35')]?_0x586f4f[_0x47a5('0x33')]:_0x7de536[_0x47a5('0x30')];if(_0x331474[_0x47a5('0x31')][_0x47a5('0x40')]){_0x586f4f[_0x47a5('0x41')]=[{'all':!![]}];}_0x586f4f=_[_0x47a5('0x3c')]({},_0x586f4f,_0x331474[_0x47a5('0x47')]);return db[_0x47a5('0x3f')][_0x47a5('0x48')](_0x586f4f)[_0x47a5('0x26')](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x26')](respondWithResult(_0x23bd8d,null))['catch'](handleError(_0x23bd8d,null));};exports[_0x47a5('0x49')]=function(_0x23bb04,_0x49eab1){return db['VoiceQueueReport'][_0x47a5('0x49')](_0x23bb04['body'],{})[_0x47a5('0x26')](respondWithResult(_0x49eab1,0xc9))[_0x47a5('0x44')](handleError(_0x49eab1,null));};exports['update']=function(_0x4f62d3,_0x3d85cc){if(_0x4f62d3['body']['id']){delete _0x4f62d3[_0x47a5('0x4a')]['id'];}return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x4f62d3[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x26')](saveUpdates(_0x4f62d3[_0x47a5('0x4a')],null))['then'](respondWithResult(_0x3d85cc,null))['catch'](handleError(_0x3d85cc,null));};exports[_0x47a5('0x25')]=function(_0x411230,_0x1163e3){return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x411230[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x1163e3,null))['then'](removeEntity(_0x1163e3,null))[_0x47a5('0x44')](handleError(_0x1163e3,null));};exports[_0x47a5('0x4c')]=function(_0x5f6a,_0x5c3c75){return db[_0x47a5('0x3f')]['describe']()[_0x47a5('0x26')](respondWithResult(_0x5c3c75,null))[_0x47a5('0x44')](handleError(_0x5c3c75,null));};exports[_0x47a5('0x4d')]=function(_0xf03bd5,_0x588551){var _0x3adf14={},_0x1e6de3={},_0x2f66e9={'count':0x0,'rows':[]};_0x1e6de3[_0x47a5('0x30')]=_[_0x47a5('0x46')](db[_0x47a5('0x3f')][_0x47a5('0x2d')]);_0x1e6de3['query']=_[_0x47a5('0x46')](_0xf03bd5[_0x47a5('0x31')]);_0x1e6de3[_0x47a5('0x32')]=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],_0x1e6de3[_0x47a5('0x31')]);_0x3adf14['attributes']=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],qs[_0x47a5('0x34')](_0xf03bd5['query'][_0x47a5('0x34')]));_0x3adf14[_0x47a5('0x33')]=_0x3adf14[_0x47a5('0x33')]['length']?_0x3adf14['attributes']:_0x1e6de3[_0x47a5('0x30')];if(!_0xf03bd5[_0x47a5('0x31')]['hasOwnProperty']('nolimit')){_0x3adf14[_0x47a5('0x1f')]=qs['limit'](_0xf03bd5[_0x47a5('0x31')]['limit']);_0x3adf14['offset']=qs[_0x47a5('0x1e')](_0xf03bd5[_0x47a5('0x31')]['offset']);}_0x3adf14[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0xf03bd5['query']['sort']);_0x3adf14[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0xf03bd5[_0x47a5('0x31')],_0x1e6de3['filters']));if(_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x3adf14[_0x47a5('0x39')]=_['merge'](_0x3adf14[_0x47a5('0x39')],{'$or':_['map'](_0x3adf14[_0x47a5('0x33')],function(_0x470da6){var _0x943a15={};_0x943a15[_0x470da6]={'$like':'%'+_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]+'%'};return _0x943a15;})});}_0x3adf14=_['merge']({},_0x3adf14,_0xf03bd5[_0x47a5('0x47')]);var _0x5d1550={'where':_0x3adf14['where']};return db['VoiceQueueReport']['count'](_0x5d1550)[_0x47a5('0x26')](function(_0x6cd4ea){_0x2f66e9[_0x47a5('0x1d')]=_0x6cd4ea;if(_0xf03bd5['query']['includeAll']){_0x3adf14[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x3adf14);})[_0x47a5('0x26')](function(_0xc45e25){_0x2f66e9['rows']=_0xc45e25;return _0x2f66e9;})[_0x47a5('0x26')](respondWithFilteredResult(_0x588551,_0x3adf14,'getVoiceQueuesReport'))[_0x47a5('0x44')](handleError(_0x588551,null,_0x47a5('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 334e3e0..014eec6 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 _0x33f3=['hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit'];(function(_0x36e057,_0x52b965){var _0x4cbac8=function(_0x125be9){while(--_0x125be9){_0x36e057['push'](_0x36e057['shift']());}};_0x4cbac8(++_0x52b965);}(_0x33f3,0x161));var _0x333f=function(_0x50ed72,_0x38c1ff){_0x50ed72=_0x50ed72-0x0;var _0x5c3af0=_0x33f3[_0x50ed72];return _0x5c3af0;};'use strict';var EventEmitter=require(_0x333f('0x0'));var VoiceQueueReport=require(_0x333f('0x1'))['db'][_0x333f('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x333f('0x3')](0x0);var events={'afterCreate':_0x333f('0x4'),'afterUpdate':_0x333f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1378d0){return function(_0x370dd1,_0x1a1ce6,_0x26bec5){VoiceQueueReportEvents['emit'](_0x1378d0+':'+_0x370dd1['id'],_0x370dd1);VoiceQueueReportEvents[_0x333f('0x6')](_0x1378d0,_0x370dd1);_0x26bec5(null);};}for(var e in events){if(events[_0x333f('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x333f('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x8bb3=['events','VoiceQueueReport','save','update','emit','hasOwnProperty','exports'];(function(_0x4c8c5d,_0x58bd86){var _0x3d4838=function(_0x110214){while(--_0x110214){_0x4c8c5d['push'](_0x4c8c5d['shift']());}};_0x3d4838(++_0x58bd86);}(_0x8bb3,0x196));var _0x38bb=function(_0x311a85,_0x31fd8b){_0x311a85=_0x311a85-0x0;var _0x5961c6=_0x8bb3[_0x311a85];return _0x5961c6;};'use strict';var EventEmitter=require(_0x38bb('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x38bb('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x38bb('0x2'),'afterUpdate':_0x38bb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x651c4f){return function(_0x1ae36a,_0x49951f,_0xc53d9){VoiceQueueReportEvents['emit'](_0x651c4f+':'+_0x1ae36a['id'],_0x1ae36a);VoiceQueueReportEvents[_0x38bb('0x4')](_0x651c4f,_0x1ae36a);_0xc53d9(null);};}for(var e in events){if(events[_0x38bb('0x5')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x38bb('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 772b667..6e5f0d0 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 _0x6944=['rimraf','../../config/environment','exports','define','VoiceQueueReport','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x6944,0x173));var _0x4694=function(_0x995cb6,_0x145e0a){_0x995cb6=_0x995cb6-0x0;var _0x11876c=_0x6944[_0x995cb6];return _0x11876c;};'use strict';var _=require(_0x4694('0x0'));var util=require(_0x4694('0x1'));var logger=require(_0x4694('0x2'))(_0x4694('0x3'));var moment=require(_0x4694('0x4'));var BPromise=require(_0x4694('0x5'));var rp=require(_0x4694('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4694('0x7'));var config=require(_0x4694('0x8'));var attributes=require('./voiceQueueReport.attributes');module[_0x4694('0x9')]=function(_0x5b9320,_0x5c1eba){return _0x5b9320[_0x4694('0xa')](_0x4694('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0x4694('0xc')]},{'fields':[_0x4694('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfbed=['moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','uniqueid','calleridnum','lodash','../../config/logger','api'];(function(_0x5a60ce,_0x48f080){var _0x393e5e=function(_0x1c58fc){while(--_0x1c58fc){_0x5a60ce['push'](_0x5a60ce['shift']());}};_0x393e5e(++_0x48f080);}(_0xfbed,0x142));var _0xdfbe=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfbed[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xdfbe('0x0'));var util=require('util');var logger=require(_0xdfbe('0x1'))(_0xdfbe('0x2'));var moment=require(_0xdfbe('0x3'));var BPromise=require('bluebird');var rp=require(_0xdfbe('0x4'));var fs=require('fs');var path=require(_0xdfbe('0x5'));var rimraf=require(_0xdfbe('0x6'));var config=require(_0xdfbe('0x7'));var attributes=require(_0xdfbe('0x8'));module[_0xdfbe('0x9')]=function(_0xf14881,_0x169792){return _0xf14881['define'](_0xdfbe('0xa'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xdfbe('0xb')]},{'fields':[_0xdfbe('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 7533ca9..eeca164 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 _0x4730=['info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','raw','options','where','attributes','limit','include','map','model','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x5848a5,_0x42a9f6){var _0xf47e9=function(_0x3195c8){while(--_0x3195c8){_0x5848a5['push'](_0x5848a5['shift']());}};_0xf47e9(++_0x42a9f6);}(_0x4730,0xec));var _0x0473=function(_0x58252d,_0x2070b3){_0x58252d=_0x58252d-0x0;var _0x55a98c=_0x4730[_0x58252d];return _0x55a98c;};'use strict';var _=require('lodash');var util=require(_0x0473('0x0'));var moment=require(_0x0473('0x1'));var BPromise=require(_0x0473('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0473('0x3'));var db=require(_0x0473('0x4'))['db'];var utils=require(_0x0473('0x5'));var logger=require('../../config/logger')(_0x0473('0x6'));var config=require(_0x0473('0x7'));var jayson=require(_0x0473('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x0473('0x9')]=_[_0x0473('0xa')](config[_0x0473('0x9')],{'host':_0x0473('0xb'),'port':0x18eb});var socket=require(_0x0473('0xc'))(new Redis(config['redis']));require('./voiceQueueReport.socket')[_0x0473('0xd')](socket);function respondWithRpcPromise(_0x19a722,_0x2c26f7,_0x1281d5){return new BPromise(function(_0x43f1a5,_0x591a15){return client[_0x0473('0xe')](_0x19a722,_0x1281d5)[_0x0473('0xf')](function(_0x29c45a){logger[_0x0473('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x2c26f7,_0x0473('0x11'));logger[_0x0473('0x12')](_0x0473('0x13'),_0x2c26f7,_0x0473('0x11'),JSON[_0x0473('0x14')](_0x29c45a));if(_0x29c45a[_0x0473('0x15')]){if(_0x29c45a[_0x0473('0x15')][_0x0473('0x16')]===0x1f4){logger[_0x0473('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x2c26f7,_0x29c45a['error'][_0x0473('0x17')]);return _0x591a15(_0x29c45a[_0x0473('0x15')]['message']);}logger[_0x0473('0x15')](_0x0473('0x18'),_0x2c26f7,_0x29c45a[_0x0473('0x15')][_0x0473('0x17')]);return _0x43f1a5(_0x29c45a['error'][_0x0473('0x17')]);}else{logger['info'](_0x0473('0x18'),_0x2c26f7,_0x0473('0x11'));_0x43f1a5(_0x29c45a[_0x0473('0x19')][_0x0473('0x17')]);}})[_0x0473('0x1a')](function(_0x2429a2){logger['error'](_0x0473('0x18'),_0x2c26f7,_0x2429a2);_0x591a15(_0x2429a2);});});}exports[_0x0473('0x1b')]=function(_0x2142b5){var _0x3896e2=this;return new Promise(function(_0x3c3d69,_0x3501b0){return db[_0x0473('0x1c')][_0x0473('0x1d')]({'raw':_0x2142b5['options']?_0x2142b5['options'][_0x0473('0x1e')]===undefined?!![]:![]:!![],'where':_0x2142b5[_0x0473('0x1f')]?_0x2142b5[_0x0473('0x1f')][_0x0473('0x20')]||null:null,'attributes':_0x2142b5['options']?_0x2142b5['options'][_0x0473('0x21')]||null:null,'limit':_0x2142b5['options']?_0x2142b5['options'][_0x0473('0x22')]||null:null,'include':_0x2142b5[_0x0473('0x1f')]?_0x2142b5[_0x0473('0x1f')][_0x0473('0x23')]?_[_0x0473('0x24')](_0x2142b5[_0x0473('0x1f')][_0x0473('0x23')],function(_0x16bb5b){return{'model':db[_0x16bb5b['model']],'as':_0x16bb5b['as'],'attributes':_0x16bb5b['attributes'],'include':_0x16bb5b['include']?_['map'](_0x16bb5b[_0x0473('0x23')],function(_0x4ceb1b){return{'model':db[_0x4ceb1b[_0x0473('0x25')]],'as':_0x4ceb1b['as'],'attributes':_0x4ceb1b[_0x0473('0x21')],'include':_0x4ceb1b['include']?_['map'](_0x4ceb1b[_0x0473('0x23')],function(_0x21166c){return{'model':db[_0x21166c[_0x0473('0x25')]],'as':_0x21166c['as'],'attributes':_0x21166c[_0x0473('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0473('0xf')](function(_0x4ce455){logger[_0x0473('0x10')](_0x0473('0x1b'),_0x2142b5);logger[_0x0473('0x12')](_0x0473('0x1b'),_0x2142b5,JSON[_0x0473('0x14')](_0x4ce455));_0x3c3d69(_0x4ce455);})['catch'](function(_0xb06a80){logger['error'](_0x0473('0x1b'),_0xb06a80[_0x0473('0x17')],_0x2142b5);_0x3501b0(_0x3896e2[_0x0473('0x15')](0x1f4,_0xb06a80[_0x0473('0x17')]));});});};exports[_0x0473('0x26')]=function(_0x3a862d){var _0xc98b5f=this;return new Promise(function(_0xc27062,_0x376b37){return db['VoiceQueueReport']['create'](_0x3a862d[_0x0473('0x27')],{'raw':_0x3a862d['options']?_0x3a862d[_0x0473('0x1f')][_0x0473('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x585537){logger[_0x0473('0x10')](_0x0473('0x26'),_0x3a862d);logger[_0x0473('0x12')](_0x0473('0x26'),_0x3a862d,JSON[_0x0473('0x14')](_0x585537));_0xc27062(_0x585537);})[_0x0473('0x1a')](function(_0x454db6){logger['error'](_0x0473('0x26'),_0x454db6[_0x0473('0x17')],_0x3a862d);_0x376b37(_0xc98b5f[_0x0473('0x15')](0x1f4,_0x454db6[_0x0473('0x17')]));});});};exports[_0x0473('0x28')]=function(_0xb4006e){var _0x3476a9=this;return new Promise(function(_0x5b6fb7,_0x2c18d6){return db[_0x0473('0x1c')][_0x0473('0x29')](_0xb4006e['body'],{'raw':_0xb4006e[_0x0473('0x1f')]?_0xb4006e[_0x0473('0x1f')][_0x0473('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb4006e[_0x0473('0x1f')]?_0xb4006e[_0x0473('0x1f')]['where']||null:null,'attributes':_0xb4006e[_0x0473('0x1f')]?_0xb4006e[_0x0473('0x1f')]['attributes']||null:null,'limit':_0xb4006e[_0x0473('0x1f')]?_0xb4006e[_0x0473('0x1f')][_0x0473('0x22')]||null:null})['then'](function(_0x3e95ec){logger[_0x0473('0x10')]('UpdateVoiceQueueReport',_0xb4006e);logger[_0x0473('0x12')](_0x0473('0x28'),_0xb4006e,JSON[_0x0473('0x14')](_0x3e95ec));_0x5b6fb7(_0x3e95ec);})[_0x0473('0x1a')](function(_0x16f842){logger[_0x0473('0x15')](_0x0473('0x28'),_0x16f842['message'],_0xb4006e);_0x2c18d6(_0x3476a9['error'](0x1f4,_0x16f842['message']));});});}; \ No newline at end of file +var _0x4985=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','VoiceQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','GetVoiceQueueReport','findAll','options','raw','limit','include','model','attributes','map','catch','CreateVoiceQueueReport','create','body','stringify','UpdateVoiceQueueReport','update','where','util'];(function(_0x13b98f,_0x5800dc){var _0x5d6daf=function(_0x531bc3){while(--_0x531bc3){_0x13b98f['push'](_0x13b98f['shift']());}};_0x5d6daf(++_0x5800dc);}(_0x4985,0xab));var _0x5498=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x4985[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require('lodash');var util=require(_0x5498('0x0'));var moment=require('moment');var BPromise=require(_0x5498('0x1'));var rs=require(_0x5498('0x2'));var fs=require('fs');var Redis=require(_0x5498('0x3'));var db=require(_0x5498('0x4'))['db'];var utils=require(_0x5498('0x5'));var logger=require(_0x5498('0x6'))(_0x5498('0x7'));var config=require(_0x5498('0x8'));var jayson=require(_0x5498('0x9'));var client=jayson[_0x5498('0xa')]['http']({'port':0x232a});config[_0x5498('0xb')]=_[_0x5498('0xc')](config[_0x5498('0xb')],{'host':_0x5498('0xd'),'port':0x18eb});var socket=require(_0x5498('0xe'))(new Redis(config[_0x5498('0xb')]));require(_0x5498('0xf'))[_0x5498('0x10')](socket);function respondWithRpcPromise(_0x304e9a,_0xea7551,_0x53cd3a){return new BPromise(function(_0x21d8e9,_0x2f3b8a){return client[_0x5498('0x11')](_0x304e9a,_0x53cd3a)[_0x5498('0x12')](function(_0x481811){logger['info'](_0x5498('0x13'),_0xea7551,'request\x20sent');logger[_0x5498('0x14')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0xea7551,_0x5498('0x15'),JSON['stringify'](_0x481811));if(_0x481811[_0x5498('0x16')]){if(_0x481811[_0x5498('0x16')][_0x5498('0x17')]===0x1f4){logger[_0x5498('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0xea7551,_0x481811[_0x5498('0x16')]['message']);return _0x2f3b8a(_0x481811[_0x5498('0x16')][_0x5498('0x18')]);}logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0xea7551,_0x481811[_0x5498('0x16')][_0x5498('0x18')]);return _0x21d8e9(_0x481811[_0x5498('0x16')][_0x5498('0x18')]);}else{logger[_0x5498('0x19')](_0x5498('0x13'),_0xea7551,'request\x20sent');_0x21d8e9(_0x481811['result'][_0x5498('0x18')]);}})['catch'](function(_0x4ae10e){logger[_0x5498('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0xea7551,_0x4ae10e);_0x2f3b8a(_0x4ae10e);});});}exports[_0x5498('0x1a')]=function(_0x1b73db){var _0x48095a=this;return new Promise(function(_0x1dcec0,_0x3fd8c8){return db['VoiceQueueReport'][_0x5498('0x1b')]({'raw':_0x1b73db[_0x5498('0x1c')]?_0x1b73db[_0x5498('0x1c')][_0x5498('0x1d')]===undefined?!![]:![]:!![],'where':_0x1b73db[_0x5498('0x1c')]?_0x1b73db[_0x5498('0x1c')]['where']||null:null,'attributes':_0x1b73db[_0x5498('0x1c')]?_0x1b73db['options']['attributes']||null:null,'limit':_0x1b73db[_0x5498('0x1c')]?_0x1b73db[_0x5498('0x1c')][_0x5498('0x1e')]||null:null,'include':_0x1b73db['options']?_0x1b73db['options'][_0x5498('0x1f')]?_['map'](_0x1b73db[_0x5498('0x1c')][_0x5498('0x1f')],function(_0x415b19){return{'model':db[_0x415b19[_0x5498('0x20')]],'as':_0x415b19['as'],'attributes':_0x415b19[_0x5498('0x21')],'include':_0x415b19['include']?_['map'](_0x415b19['include'],function(_0x374ffa){return{'model':db[_0x374ffa[_0x5498('0x20')]],'as':_0x374ffa['as'],'attributes':_0x374ffa[_0x5498('0x21')],'include':_0x374ffa['include']?_[_0x5498('0x22')](_0x374ffa['include'],function(_0x3da731){return{'model':db[_0x3da731[_0x5498('0x20')]],'as':_0x3da731['as'],'attributes':_0x3da731[_0x5498('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5498('0x12')](function(_0x181031){logger[_0x5498('0x19')](_0x5498('0x1a'),_0x1b73db);logger[_0x5498('0x14')](_0x5498('0x1a'),_0x1b73db,JSON['stringify'](_0x181031));_0x1dcec0(_0x181031);})[_0x5498('0x23')](function(_0x7f865b){logger[_0x5498('0x16')](_0x5498('0x1a'),_0x7f865b['message'],_0x1b73db);_0x3fd8c8(_0x48095a[_0x5498('0x16')](0x1f4,_0x7f865b[_0x5498('0x18')]));});});};exports[_0x5498('0x24')]=function(_0x2b0a07){var _0x501fe9=this;return new Promise(function(_0xb19a0,_0x4e35c2){return db['VoiceQueueReport'][_0x5498('0x25')](_0x2b0a07[_0x5498('0x26')],{'raw':_0x2b0a07[_0x5498('0x1c')]?_0x2b0a07['options'][_0x5498('0x1d')]===undefined?!![]:![]:!![]})[_0x5498('0x12')](function(_0x3ba7f4){logger[_0x5498('0x19')]('CreateVoiceQueueReport',_0x2b0a07);logger[_0x5498('0x14')](_0x5498('0x24'),_0x2b0a07,JSON[_0x5498('0x27')](_0x3ba7f4));_0xb19a0(_0x3ba7f4);})[_0x5498('0x23')](function(_0x224711){logger[_0x5498('0x16')](_0x5498('0x24'),_0x224711[_0x5498('0x18')],_0x2b0a07);_0x4e35c2(_0x501fe9[_0x5498('0x16')](0x1f4,_0x224711[_0x5498('0x18')]));});});};exports[_0x5498('0x28')]=function(_0x32c5f1){var _0x3ab043=this;return new Promise(function(_0x42adb9,_0x294be2){return db['VoiceQueueReport'][_0x5498('0x29')](_0x32c5f1[_0x5498('0x26')],{'raw':_0x32c5f1['options']?_0x32c5f1[_0x5498('0x1c')][_0x5498('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32c5f1[_0x5498('0x1c')]?_0x32c5f1[_0x5498('0x1c')][_0x5498('0x2a')]||null:null,'attributes':_0x32c5f1[_0x5498('0x1c')]?_0x32c5f1['options']['attributes']||null:null,'limit':_0x32c5f1[_0x5498('0x1c')]?_0x32c5f1[_0x5498('0x1c')][_0x5498('0x1e')]||null:null})['then'](function(_0xc65880){logger[_0x5498('0x19')](_0x5498('0x28'),_0x32c5f1);logger['debug'](_0x5498('0x28'),_0x32c5f1,JSON['stringify'](_0xc65880));_0x42adb9(_0xc65880);})['catch'](function(_0x33af0b){logger['error']('UpdateVoiceQueueReport',_0x33af0b['message'],_0x32c5f1);_0x294be2(_0x3ab043[_0x5498('0x16')](0x1f4,_0x33af0b['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index e3f4dc7..e53ee3a 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 _0x6968=['save','update','emit','removeListener','register','./voiceQueueReport.events'];(function(_0x4b11b9,_0x51fa2d){var _0x496b03=function(_0x35b443){while(--_0x35b443){_0x4b11b9['push'](_0x4b11b9['shift']());}};_0x496b03(++_0x51fa2d);}(_0x6968,0x7d));var _0x8696=function(_0x3ef2d5,_0x423d46){_0x3ef2d5=_0x3ef2d5-0x0;var _0x2fefb2=_0x6968[_0x3ef2d5];return _0x2fefb2;};'use strict';var VoiceQueueReportEvents=require(_0x8696('0x0'));var events=[_0x8696('0x1'),'remove',_0x8696('0x2')];function createListener(_0x4004c0,_0x42ddbc){return function(_0x5a318b){_0x42ddbc[_0x8696('0x3')](_0x4004c0,_0x5a318b);};}function removeListener(_0x59bf04,_0xbbd400){return function(){VoiceQueueReportEvents[_0x8696('0x4')](_0x59bf04,_0xbbd400);};}exports[_0x8696('0x5')]=function(_0x911f62){for(var _0x276ff5=0x0,_0x4a58d9=events['length'];_0x276ff5<_0x4a58d9;_0x276ff5++){var _0x3c5160=events[_0x276ff5];var _0x20fb0a=createListener('voiceQueueReport:'+_0x3c5160,_0x911f62);VoiceQueueReportEvents['on'](_0x3c5160,_0x20fb0a);}}; \ No newline at end of file +var _0x4b8d=['emit','register','length','voiceQueueReport:','./voiceQueueReport.events','remove','update'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x4b8d,0x1bd));var _0xd4b8=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0x4b8d[_0x4f4d19];return _0x27a258;};'use strict';var VoiceQueueReportEvents=require(_0xd4b8('0x0'));var events=['save',_0xd4b8('0x1'),_0xd4b8('0x2')];function createListener(_0xd71355,_0x403377){return function(_0x2bc742){_0x403377[_0xd4b8('0x3')](_0xd71355,_0x2bc742);};}function removeListener(_0x4155a5,_0x2a68d5){return function(){VoiceQueueReportEvents['removeListener'](_0x4155a5,_0x2a68d5);};}exports[_0xd4b8('0x4')]=function(_0x89560a){for(var _0x58642a=0x0,_0x35b681=events[_0xd4b8('0x5')];_0x58642a<_0x35b681;_0x58642a++){var _0x230709=events[_0x58642a];var _0x528abe=createListener(_0xd4b8('0x6')+_0x230709,_0x89560a);VoiceQueueReportEvents['on'](_0x230709,_0x528abe);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 9fb1004..2448f01 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 _0xb1ae=['isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','connect-timeout','express','Router','../../config/environment','get'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0xb1ae,0x1bc));var _0xeb1a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ae[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xeb1a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeb1a('0x1'));var express=require(_0xeb1a('0x2'));var router=express[_0xeb1a('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xeb1a('0x4'));var controller=require('./voiceQueuesLog.controller');router[_0xeb1a('0x5')]('/',auth[_0xeb1a('0x6')](),controller[_0xeb1a('0x7')]);router[_0xeb1a('0x5')](_0xeb1a('0x8'),auth['isAuthenticated'](),controller[_0xeb1a('0x9')]);router[_0xeb1a('0xa')]('/',auth[_0xeb1a('0x6')](),controller[_0xeb1a('0xb')]);router['put'](_0xeb1a('0x8'),auth[_0xeb1a('0x6')](),controller[_0xeb1a('0xc')]);router[_0xeb1a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xeb1a('0xe')]);module['exports']=router; \ No newline at end of file +var _0x84f7=['multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','post','put','/:id','destroy','exports'];(function(_0x211009,_0x82bdb3){var _0x5320b7=function(_0x57d114){while(--_0x57d114){_0x211009['push'](_0x211009['shift']());}};_0x5320b7(++_0x82bdb3);}(_0x84f7,0x1e0));var _0x784f=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x84f7[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x784f('0x0'));var util=require('util');var path=require(_0x784f('0x1'));var timeout=require('connect-timeout');var express=require(_0x784f('0x2'));var router=express['Router']();var auth=require(_0x784f('0x3'));var interaction=require(_0x784f('0x4'));var config=require(_0x784f('0x5'));var controller=require(_0x784f('0x6'));router[_0x784f('0x7')]('/',auth[_0x784f('0x8')](),controller[_0x784f('0x9')]);router[_0x784f('0x7')]('/:id',auth[_0x784f('0x8')](),controller['show']);router[_0x784f('0xa')]('/',auth[_0x784f('0x8')](),controller['create']);router[_0x784f('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x784f('0xc'),auth[_0x784f('0x8')](),controller[_0x784f('0xd')]);module[_0x784f('0xe')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 98bf2f1..ea0fc44 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 _0x9fa0=['moment','exports','STRING','DATE','sequelize'];(function(_0x982595,_0x250de7){var _0x259c18=function(_0x436295){while(--_0x436295){_0x982595['push'](_0x982595['shift']());}};_0x259c18(++_0x250de7);}(_0x9fa0,0xe5));var _0x09fa=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0x9fa0[_0x490be3];return _0x3f5140;};'use strict';var Sequelize=require(_0x09fa('0x0'));var moment=require(_0x09fa('0x1'));module[_0x09fa('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x09fa('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x09fa('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x09fa('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x09fa('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x09fa('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x09fa('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x09fa('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x09fa('0x4')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0x3ef3=['YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE','format'];(function(_0x1bdfc4,_0x2ab7d4){var _0x3d363b=function(_0x5d6ba7){while(--_0x5d6ba7){_0x1bdfc4['push'](_0x1bdfc4['shift']());}};_0x3d363b(++_0x2ab7d4);}(_0x3ef3,0x1ac));var _0x33ef=function(_0xc99ca1,_0x311e1b){_0xc99ca1=_0xc99ca1-0x0;var _0x2cb8b5=_0x3ef3[_0xc99ca1];return _0x2cb8b5;};'use strict';var Sequelize=require(_0x33ef('0x0'));var moment=require(_0x33ef('0x1'));module[_0x33ef('0x2')]={'time':{'type':Sequelize[_0x33ef('0x3')]},'callid':{'type':Sequelize[_0x33ef('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x33ef('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x33ef('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x33ef('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x33ef('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x33ef('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x33ef('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x33ef('0x4')],'allowNull':![],'defaultValue':moment()[_0x33ef('0x5')](_0x33ef('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 91c6d04..307569f 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 _0xb10b=['where','merge','VoiceQueuesLog','include','rows','catch','show','params','includeAll','options','find','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x25857d,_0x5dad19){var _0x409140=function(_0x3a501f){while(--_0x3a501f){_0x25857d['push'](_0x25857d['shift']());}};_0x409140(++_0x5dad19);}(_0xb10b,0x12a));var _0xbb10=function(_0x23292a,_0x1e08ea){_0x23292a=_0x23292a-0x0;var _0x4564f2=_0xb10b[_0x23292a];return _0x4564f2;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['VoiceQueuesLog'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]),_0x20d946);if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]!=='VIRTUAL'){var _0x5e3fbd={};_0x5e3fbd[_0x1e5bbd['name']]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5e3fbd;}})});}_0x6ed43b=_[_0xbb10('0x3a')]({},_0x6ed43b,_0x2fdde9['options']);var _0x3c0cd7={'where':_0x6ed43b[_0xbb10('0x39')]};return db[_0xbb10('0x3b')]['count'](_0x3c0cd7)[_0xbb10('0x23')](function(_0x12238a){_0x1acce9[_0xbb10('0x1c')]=_0x12238a;if(_0x2fdde9[_0xbb10('0x30')]['includeAll']){_0x6ed43b[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x3b')]['findAll'](_0x6ed43b);})[_0xbb10('0x23')](function(_0x2e3214){_0x1acce9[_0xbb10('0x3d')]=_0x2e3214;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x3e')](handleError(_0x24d586,null));};exports[_0xbb10('0x3f')]=function(_0x5f3d67,_0x1e8f79){var _0x1c7fae={'raw':!![],'where':{'id':_0x5f3d67[_0xbb10('0x40')]['id']}},_0x3e7b4c={};_0x3e7b4c['model']=_[_0xbb10('0x2d')](db[_0xbb10('0x3b')][_0xbb10('0x28')]);_0x3e7b4c[_0xbb10('0x30')]=_['keys'](_0x5f3d67[_0xbb10('0x30')]);_0x3e7b4c[_0xbb10('0x2e')]=_['intersection'](_0x3e7b4c['model'],_0x3e7b4c[_0xbb10('0x30')]);_0x1c7fae['attributes']=_[_0xbb10('0x2f')](_0x3e7b4c[_0xbb10('0x2c')],qs['fields'](_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x31')]));_0x1c7fae[_0xbb10('0x32')]=_0x1c7fae['attributes'][_0xbb10('0x33')]?_0x1c7fae[_0xbb10('0x32')]:_0x3e7b4c[_0xbb10('0x2c')];if(_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x41')]){_0x1c7fae[_0xbb10('0x3c')]=[{'all':!![]}];}_0x1c7fae=_[_0xbb10('0x3a')]({},_0x1c7fae,_0x5f3d67[_0xbb10('0x42')]);return db[_0xbb10('0x3b')][_0xbb10('0x43')](_0x1c7fae)[_0xbb10('0x23')](handleEntityNotFound(_0x1e8f79,null))[_0xbb10('0x23')](respondWithResult(_0x1e8f79,null))['catch'](handleError(_0x1e8f79,null));};exports[_0xbb10('0x44')]=function(_0x41bbf8,_0x4a1248){return db[_0xbb10('0x3b')][_0xbb10('0x44')](_0x41bbf8[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x4a1248,0xc9))[_0xbb10('0x3e')](handleError(_0x4a1248,null));};exports[_0xbb10('0x46')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x3e')](handleError(_0x5be85e,null));};exports[_0xbb10('0x24')]=function(_0x22b315,_0x2f2552){return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x22b315[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f2552,null))['then'](removeEntity(_0x2f2552,null))[_0xbb10('0x3e')](handleError(_0x2f2552,null));}; \ No newline at end of file +var _0xb10b=['where','merge','VoiceQueuesLog','include','rows','catch','show','params','includeAll','options','find','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter'];(function(_0x35fc81,_0x53ea5d){var _0x92cb85=function(_0x2fb36b){while(--_0x2fb36b){_0x35fc81['push'](_0x35fc81['shift']());}};_0x92cb85(++_0x53ea5d);}(_0xb10b,0x12a));var _0xbb10=function(_0x3e5608,_0x8b6979){_0x3e5608=_0x3e5608-0x0;var _0x4128d3=_0xb10b[_0x3e5608];return _0x4128d3;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fb19,_0x916a32){_0x916a32=_0x916a32||0xcc;return function(_0x285009){if(_0x285009){return _0x44fb19[_0xbb10('0x18')](_0x916a32);}return _0x44fb19[_0xbb10('0x19')](_0x916a32)[_0xbb10('0x1a')]();};}function respondWithResult(_0x58a612,_0x26e021){_0x26e021=_0x26e021||0xc8;return function(_0x42d7e4){if(_0x42d7e4){return _0x58a612[_0xbb10('0x19')](_0x26e021)[_0xbb10('0x1b')](_0x42d7e4);}};}function respondWithFilteredResult(_0x3df17b,_0x2f2ebf){return function(_0x24a57b){if(_0x24a57b){var _0x36b5e8=_0x24a57b[_0xbb10('0x1c')],_0x3e26f4=_0x2f2ebf[_0xbb10('0x1d')],_0x2b184e=_0x2f2ebf[_0xbb10('0x1d')]+_0x2f2ebf[_0xbb10('0x1e')],_0x4a2bfc;if(_0x2b184e>=_0x36b5e8){_0x2b184e=_0x36b5e8;_0x4a2bfc=0xc8;}else{_0x4a2bfc=0xce;}_0x3df17b[_0xbb10('0x19')](_0x4a2bfc);return _0x3df17b[_0xbb10('0x1f')](_0xbb10('0x20'),_0x3e26f4+'-'+_0x2b184e+'/'+_0x36b5e8)[_0xbb10('0x1b')](_0x24a57b);}return null;};}function patchUpdates(_0xbf2906){return function(_0xe1c665){try{jsonpatch['apply'](_0xe1c665,_0xbf2906,!![]);}catch(_0x5ff0cf){return BPromise[_0xbb10('0x21')](_0x5ff0cf);}return _0xe1c665[_0xbb10('0x22')]();};}function saveUpdates(_0x109908,_0xdf237d){return function(_0x44e563){if(_0x44e563){return _0x44e563['update'](_0x109908)[_0xbb10('0x23')](function(_0x12ef77){return _0x12ef77;});}return null;};}function removeEntity(_0x50aea1,_0x4c4b0d){return function(_0x8e2b97){if(_0x8e2b97){return _0x8e2b97[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x50aea1[_0xbb10('0x19')](0xcc)[_0xbb10('0x1a')]();});}};}function handleEntityNotFound(_0x1824b7,_0x407cb4){return function(_0x436104){if(!_0x436104){_0x1824b7[_0xbb10('0x18')](0x194);}return _0x436104;};}function handleError(_0x395404,_0x3ba6cd){_0x3ba6cd=_0x3ba6cd||0x1f4;return function(_0x26ad93){logger['error'](_0x26ad93['stack']);if(_0x26ad93['name']){delete _0x26ad93[_0xbb10('0x25')];}_0x395404[_0xbb10('0x19')](_0x3ba6cd)[_0xbb10('0x26')](_0x26ad93);};}exports['index']=function(_0x2fdde9,_0x24d586){var _0x6ed43b={},_0x1d5e95={},_0x1acce9={'count':0x0,'rows':[]};var _0x20d946=_[_0xbb10('0x27')](db['VoiceQueuesLog'][_0xbb10('0x28')],function(_0x21ac54){return{'name':_0x21ac54[_0xbb10('0x29')],'type':_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x2b')]};});_0x1d5e95[_0xbb10('0x2c')]=_['map'](_0x20d946,_0xbb10('0x25'));_0x1d5e95['query']=_[_0xbb10('0x2d')](_0x2fdde9['query']);_0x1d5e95[_0xbb10('0x2e')]=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],_0x1d5e95['query']);_0x6ed43b['attributes']=_[_0xbb10('0x2f')](_0x1d5e95[_0xbb10('0x2c')],qs['fields'](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x31')]));_0x6ed43b[_0xbb10('0x32')]=_0x6ed43b[_0xbb10('0x32')][_0xbb10('0x33')]?_0x6ed43b[_0xbb10('0x32')]:_0x1d5e95[_0xbb10('0x2c')];if(!_0x2fdde9['query'][_0xbb10('0x34')](_0xbb10('0x35'))){_0x6ed43b[_0xbb10('0x1e')]=qs[_0xbb10('0x1e')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x1e')]);_0x6ed43b[_0xbb10('0x1d')]=qs[_0xbb10('0x1d')](_0x2fdde9[_0xbb10('0x30')]['offset']);}_0x6ed43b[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x37')]);_0x6ed43b['where']=qs[_0xbb10('0x2e')](_['pick'](_0x2fdde9['query'],_0x1d5e95[_0xbb10('0x2e')]),_0x20d946);if(_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]){_0x6ed43b[_0xbb10('0x39')]=_[_0xbb10('0x3a')](_0x6ed43b[_0xbb10('0x39')],{'$or':_['map'](_0x20d946,function(_0x1e5bbd){if(_0x1e5bbd[_0xbb10('0x2a')]!=='VIRTUAL'){var _0x5e3fbd={};_0x5e3fbd[_0x1e5bbd['name']]={'$like':'%'+_0x2fdde9[_0xbb10('0x30')][_0xbb10('0x38')]+'%'};return _0x5e3fbd;}})});}_0x6ed43b=_[_0xbb10('0x3a')]({},_0x6ed43b,_0x2fdde9['options']);var _0x3c0cd7={'where':_0x6ed43b[_0xbb10('0x39')]};return db[_0xbb10('0x3b')]['count'](_0x3c0cd7)[_0xbb10('0x23')](function(_0x12238a){_0x1acce9[_0xbb10('0x1c')]=_0x12238a;if(_0x2fdde9[_0xbb10('0x30')]['includeAll']){_0x6ed43b[_0xbb10('0x3c')]=[{'all':!![]}];}return db[_0xbb10('0x3b')]['findAll'](_0x6ed43b);})[_0xbb10('0x23')](function(_0x2e3214){_0x1acce9[_0xbb10('0x3d')]=_0x2e3214;return _0x1acce9;})[_0xbb10('0x23')](respondWithFilteredResult(_0x24d586,_0x6ed43b))[_0xbb10('0x3e')](handleError(_0x24d586,null));};exports[_0xbb10('0x3f')]=function(_0x5f3d67,_0x1e8f79){var _0x1c7fae={'raw':!![],'where':{'id':_0x5f3d67[_0xbb10('0x40')]['id']}},_0x3e7b4c={};_0x3e7b4c['model']=_[_0xbb10('0x2d')](db[_0xbb10('0x3b')][_0xbb10('0x28')]);_0x3e7b4c[_0xbb10('0x30')]=_['keys'](_0x5f3d67[_0xbb10('0x30')]);_0x3e7b4c[_0xbb10('0x2e')]=_['intersection'](_0x3e7b4c['model'],_0x3e7b4c[_0xbb10('0x30')]);_0x1c7fae['attributes']=_[_0xbb10('0x2f')](_0x3e7b4c[_0xbb10('0x2c')],qs['fields'](_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x31')]));_0x1c7fae[_0xbb10('0x32')]=_0x1c7fae['attributes'][_0xbb10('0x33')]?_0x1c7fae[_0xbb10('0x32')]:_0x3e7b4c[_0xbb10('0x2c')];if(_0x5f3d67[_0xbb10('0x30')][_0xbb10('0x41')]){_0x1c7fae[_0xbb10('0x3c')]=[{'all':!![]}];}_0x1c7fae=_[_0xbb10('0x3a')]({},_0x1c7fae,_0x5f3d67[_0xbb10('0x42')]);return db[_0xbb10('0x3b')][_0xbb10('0x43')](_0x1c7fae)[_0xbb10('0x23')](handleEntityNotFound(_0x1e8f79,null))[_0xbb10('0x23')](respondWithResult(_0x1e8f79,null))['catch'](handleError(_0x1e8f79,null));};exports[_0xbb10('0x44')]=function(_0x41bbf8,_0x4a1248){return db[_0xbb10('0x3b')][_0xbb10('0x44')](_0x41bbf8[_0xbb10('0x45')],{})[_0xbb10('0x23')](respondWithResult(_0x4a1248,0xc9))[_0xbb10('0x3e')](handleError(_0x4a1248,null));};exports[_0xbb10('0x46')]=function(_0x3e06b0,_0x5be85e){if(_0x3e06b0['body']['id']){delete _0x3e06b0[_0xbb10('0x45')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x3e06b0['params']['id']}})['then'](handleEntityNotFound(_0x5be85e,null))[_0xbb10('0x23')](saveUpdates(_0x3e06b0[_0xbb10('0x45')],null))[_0xbb10('0x23')](respondWithResult(_0x5be85e,null))[_0xbb10('0x3e')](handleError(_0x5be85e,null));};exports[_0xbb10('0x24')]=function(_0x22b315,_0x2f2552){return db[_0xbb10('0x3b')][_0xbb10('0x43')]({'where':{'id':_0x22b315[_0xbb10('0x40')]['id']}})['then'](handleEntityNotFound(_0x2f2552,null))['then'](removeEntity(_0x2f2552,null))[_0xbb10('0x3e')](handleError(_0x2f2552,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 1283550..b3551f1 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 _0x1623=['event_dtm','event','dtm','lodash','api','moment','bluebird','request-promise','path','./voiceQueuesLog.attributes','VoiceQueuesLog','voice_queues_log'];(function(_0x32172c,_0x3dfb01){var _0x1aa882=function(_0x3b8720){while(--_0x3b8720){_0x32172c['push'](_0x32172c['shift']());}};_0x1aa882(++_0x3dfb01);}(_0x1623,0xab));var _0x3162=function(_0x473ede,_0x4b50d1){_0x473ede=_0x473ede-0x0;var _0x354cf4=_0x1623[_0x473ede];return _0x354cf4;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3162('0x1'));var moment=require(_0x3162('0x2'));var BPromise=require(_0x3162('0x3'));var rp=require(_0x3162('0x4'));var fs=require('fs');var path=require(_0x3162('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3162('0x6'));module['exports']=function(_0x1b55f2,_0x428de6){return _0x1b55f2['define'](_0x3162('0x7'),attributes,{'tableName':_0x3162('0x8'),'paranoid':![],'indexes':[{'name':_0x3162('0x9'),'fields':[_0x3162('0xa'),_0x3162('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0xf69d=['exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes'];(function(_0x4f0e62,_0x28e44f){var _0x117ab8=function(_0x1a74bb){while(--_0x1a74bb){_0x4f0e62['push'](_0x4f0e62['shift']());}};_0x117ab8(++_0x28e44f);}(_0xf69d,0xd3));var _0xdf69=function(_0x132d09,_0x575a19){_0x132d09=_0x132d09-0x0;var _0x303bb0=_0xf69d[_0x132d09];return _0x303bb0;};'use strict';var _=require(_0xdf69('0x0'));var util=require(_0xdf69('0x1'));var logger=require(_0xdf69('0x2'))(_0xdf69('0x3'));var moment=require(_0xdf69('0x4'));var BPromise=require('bluebird');var rp=require(_0xdf69('0x5'));var fs=require('fs');var path=require(_0xdf69('0x6'));var rimraf=require(_0xdf69('0x7'));var config=require(_0xdf69('0x8'));var attributes=require(_0xdf69('0x9'));module[_0xdf69('0xa')]=function(_0x2d456f,_0x465b1b){return _0x2d456f[_0xdf69('0xb')](_0xdf69('0xc'),attributes,{'tableName':_0xdf69('0xd'),'paranoid':![],'indexes':[{'name':_0xdf69('0xe'),'fields':[_0xdf69('0xf'),_0xdf69('0x10')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 6c67b1c..17cc32b 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 _0x0fd9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x22b8a3,_0x2a79a7){var _0x199a0c=function(_0x544c66){while(--_0x544c66){_0x22b8a3['push'](_0x22b8a3['shift']());}};_0x199a0c(++_0x2a79a7);}(_0x0fd9,0xa3));var _0x90fd=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x0fd9[_0x4eafed];return _0x159c85;};'use strict';var _=require('lodash');var util=require(_0x90fd('0x0'));var moment=require(_0x90fd('0x1'));var BPromise=require(_0x90fd('0x2'));var rs=require(_0x90fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x90fd('0x4'));var logger=require(_0x90fd('0x5'))(_0x90fd('0x6'));var config=require(_0x90fd('0x7'));var jayson=require(_0x90fd('0x8'));var client=jayson[_0x90fd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ff2d4,_0x128c17,_0x50c778){return new BPromise(function(_0x5a604a,_0x2acef7){return client[_0x90fd('0xa')](_0x4ff2d4,_0x50c778)['then'](function(_0x234ba9){logger[_0x90fd('0xb')](_0x90fd('0xc'),_0x128c17,_0x90fd('0xd'));logger[_0x90fd('0xe')](_0x90fd('0xf'),_0x128c17,_0x90fd('0xd'),JSON[_0x90fd('0x10')](_0x234ba9));if(_0x234ba9[_0x90fd('0x11')]){if(_0x234ba9['error'][_0x90fd('0x12')]===0x1f4){logger[_0x90fd('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x128c17,_0x234ba9[_0x90fd('0x11')][_0x90fd('0x13')]);return _0x2acef7(_0x234ba9[_0x90fd('0x11')]['message']);}logger[_0x90fd('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x128c17,_0x234ba9[_0x90fd('0x11')][_0x90fd('0x13')]);return _0x5a604a(_0x234ba9[_0x90fd('0x11')][_0x90fd('0x13')]);}else{logger[_0x90fd('0xb')](_0x90fd('0xc'),_0x128c17,_0x90fd('0xd'));_0x5a604a(_0x234ba9['result']['message']);}})[_0x90fd('0x14')](function(_0x43d804){logger['error'](_0x90fd('0xc'),_0x128c17,_0x43d804);_0x2acef7(_0x43d804);});});} \ No newline at end of file +var _0x3266=['../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x489c95,_0x53159c){var _0x10e7a7=function(_0xcb4342){while(--_0xcb4342){_0x489c95['push'](_0x489c95['shift']());}};_0x10e7a7(++_0x53159c);}(_0x3266,0x6a));var _0x6326=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x3266[_0x35af23];return _0x340506;};'use strict';var _=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var moment=require(_0x6326('0x2'));var BPromise=require(_0x6326('0x3'));var rs=require(_0x6326('0x4'));var fs=require('fs');var Redis=require(_0x6326('0x5'));var db=require(_0x6326('0x6'))['db'];var utils=require(_0x6326('0x7'));var logger=require(_0x6326('0x8'))('rpc');var config=require(_0x6326('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6326('0xa')][_0x6326('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14208e,_0x5402e5,_0x161f4e){return new BPromise(function(_0x5730e7,_0x2af571){return client[_0x6326('0xc')](_0x14208e,_0x161f4e)[_0x6326('0xd')](function(_0x1aee60){logger[_0x6326('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5402e5,_0x6326('0xf'));logger[_0x6326('0x10')](_0x6326('0x11'),_0x5402e5,_0x6326('0xf'),JSON[_0x6326('0x12')](_0x1aee60));if(_0x1aee60[_0x6326('0x13')]){if(_0x1aee60[_0x6326('0x13')][_0x6326('0x14')]===0x1f4){logger[_0x6326('0x13')](_0x6326('0x15'),_0x5402e5,_0x1aee60['error']['message']);return _0x2af571(_0x1aee60[_0x6326('0x13')][_0x6326('0x16')]);}logger['error'](_0x6326('0x15'),_0x5402e5,_0x1aee60['error'][_0x6326('0x16')]);return _0x5730e7(_0x1aee60[_0x6326('0x13')][_0x6326('0x16')]);}else{logger[_0x6326('0xe')](_0x6326('0x15'),_0x5402e5,_0x6326('0xf'));_0x5730e7(_0x1aee60['result'][_0x6326('0x16')]);}})['catch'](function(_0x5945ee){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x5402e5,_0x5945ee);_0x2af571(_0x5945ee);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 5414b12..0c97a13 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 _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x1267b0,_0x399d83){var _0x2a796e=function(_0x74d6d7){while(--_0x74d6d7){_0x1267b0['push'](_0x1267b0['shift']());}};_0x2a796e(++_0x399d83);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router; \ No newline at end of file +var _0xa9e0=['isAuthenticated','/describe','/:id','/:id/download','download','/:id/downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','put','update','delete','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get'];(function(_0x3a63fd,_0x587403){var _0x57cae3=function(_0x315d1b){while(--_0x315d1b){_0x3a63fd['push'](_0x3a63fd['shift']());}};_0x57cae3(++_0x587403);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0x7')](_0x0a9e('0xd'),controller['downloads']);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0x11'),auth['isAuthenticated'](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x15')]('/:id',auth[_0x0a9e('0x8')](),controller['destroy']);module[_0x0a9e('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index b3f8c5e..180780a 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 _0x874f=['membername','split','INTEGER','TEXT','BOOLEAN','DATE','getDataValue','createdAt','format','MM-DD-YYYY\x20HH:mm','updatedAt','moment','path','exports','extname','value','STRING','setDataValue'];(function(_0x31db21,_0x78c1d7){var _0x3360c4=function(_0x16adda){while(--_0x16adda){_0x31db21['push'](_0x31db21['shift']());}};_0x3360c4(++_0x78c1d7);}(_0x874f,0x197));var _0xf874=function(_0xc9396b,_0x734ceb){_0xc9396b=_0xc9396b-0x0;var _0x56d6ee=_0x874f[_0xc9396b];return _0x56d6ee;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf874('0x0'));var path=require(_0xf874('0x1'));module[_0xf874('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('value')?path[_0xf874('0x3')](this['getDataValue'](_0xf874('0x4'))):undefined;}},'uniqueid':{'type':Sequelize[_0xf874('0x5')]},'channel':{'type':Sequelize[_0xf874('0x5')],'set':function(_0x424c2d){if(_0x424c2d){this[_0xf874('0x6')]('channel',_0x424c2d);this[_0xf874('0x6')](_0xf874('0x7'),_0x424c2d[_0xf874('0x8')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xf874('0x5')]},'calleridnum':{'type':Sequelize[_0xf874('0x5')]},'calleridname':{'type':Sequelize[_0xf874('0x5')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xf874('0x5')]},'context':{'type':Sequelize[_0xf874('0x5')]},'exten':{'type':Sequelize[_0xf874('0x5')]},'value':{'type':Sequelize[_0xf874('0x5')]},'type':{'type':Sequelize[_0xf874('0x5')]},'rating':{'type':Sequelize[_0xf874('0x9')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xf874('0x5')]},'userDisposition':{'type':Sequelize[_0xf874('0x5')]},'location':{'type':Sequelize[_0xf874('0xa')]},'transcribeName':{'type':Sequelize['STRING']},'transcribeStatus':{'type':Sequelize[_0xf874('0x5')],'defaultValue':'NEW'},'fileUri':{'type':Sequelize[_0xf874('0xa')]},'fileText':{'type':Sequelize[_0xf874('0xa')]},'failureReason':{'type':Sequelize[_0xf874('0xa')]},'sentiment':{'type':Sequelize[_0xf874('0x5')]},'sPositive':{'type':Sequelize['FLOAT']},'sNegative':{'type':Sequelize['FLOAT']},'sNeutral':{'type':Sequelize['FLOAT']},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0xf874('0xb')],'defaultValue':![]},'createdAt':{'type':Sequelize[_0xf874('0xc')],'get':function(){return moment(this[_0xf874('0xd')](_0xf874('0xe')))[_0xf874('0xf')](_0xf874('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0xf874('0xc')],'get':function(){return moment(this[_0xf874('0xd')](_0xf874('0x11')))['format'](_0xf874('0x10'))['toString']();}}}; \ No newline at end of file +var _0x13e3=['createdAt','format','MM-DD-YYYY\x20HH:mm','DATE','updatedAt','toString','sequelize','moment','path','VIRTUAL','getDataValue','value','STRING','channel','setDataValue','membername','split','TEXT','NEW','FLOAT','BOOLEAN'];(function(_0x3ae03b,_0x3b8832){var _0x56ef3a=function(_0x40f62c){while(--_0x40f62c){_0x3ae03b['push'](_0x3ae03b['shift']());}};_0x56ef3a(++_0x3b8832);}(_0x13e3,0x117));var _0x313e=function(_0x5d5bcb,_0x25e2ea){_0x5d5bcb=_0x5d5bcb-0x0;var _0x4ea5eb=_0x13e3[_0x5d5bcb];return _0x4ea5eb;};'use strict';var Sequelize=require(_0x313e('0x0'));var moment=require(_0x313e('0x1'));var path=require(_0x313e('0x2'));module['exports']={'format':{'type':Sequelize[_0x313e('0x3')],'get':function(){return this[_0x313e('0x4')](_0x313e('0x5'))?path['extname'](this['getDataValue'](_0x313e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x313e('0x6')],'set':function(_0x5dd014){if(_0x5dd014){this['setDataValue'](_0x313e('0x7'),_0x5dd014);this[_0x313e('0x8')](_0x313e('0x9'),_0x5dd014[_0x313e('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x313e('0x6')]},'calleridnum':{'type':Sequelize[_0x313e('0x6')]},'calleridname':{'type':Sequelize[_0x313e('0x6')]},'connectedlinenum':{'type':Sequelize[_0x313e('0x6')]},'connectedlinename':{'type':Sequelize[_0x313e('0x6')]},'accountcode':{'type':Sequelize[_0x313e('0x6')]},'context':{'type':Sequelize[_0x313e('0x6')]},'exten':{'type':Sequelize[_0x313e('0x6')]},'value':{'type':Sequelize[_0x313e('0x6')]},'type':{'type':Sequelize[_0x313e('0x6')]},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x313e('0x6')]},'userDisposition':{'type':Sequelize['STRING']},'location':{'type':Sequelize[_0x313e('0xb')]},'transcribeName':{'type':Sequelize[_0x313e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x313e('0x6')],'defaultValue':_0x313e('0xc')},'fileUri':{'type':Sequelize[_0x313e('0xb')]},'fileText':{'type':Sequelize[_0x313e('0xb')]},'failureReason':{'type':Sequelize[_0x313e('0xb')]},'sentiment':{'type':Sequelize[_0x313e('0x6')]},'sPositive':{'type':Sequelize[_0x313e('0xd')]},'sNegative':{'type':Sequelize['FLOAT']},'sNeutral':{'type':Sequelize[_0x313e('0xd')]},'sMixed':{'type':Sequelize[_0x313e('0xd')]},'tempSentiment':{'type':Sequelize[_0x313e('0xe')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x313e('0x4')](_0x313e('0xf')))[_0x313e('0x10')](_0x313e('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0x313e('0x12')],'get':function(){return moment(this[_0x313e('0x4')](_0x313e('0x13')))[_0x313e('0x10')](_0x313e('0x11'))[_0x313e('0x14')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 6bc6a15..c057edd 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 _0xdaa8=['offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','VoiceRecording','rawAttributes','fieldName','type','model','format','query','keys','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','show','params','filters','find','catch','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','recording','Sequelize','ValidationError','filename','extname','unlink','VoiceRecording\x20not\x20found','downloads','sequelize','MD5','col','$and','push','secrets','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','decryptFile','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','root','.txt','Transcript\x20not\x20available','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','aws-sdk','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xdaa8,0x79));var _0x8daa=function(_0x5a1b6b,_0x320036){_0x5a1b6b=_0x5a1b6b-0x0;var _0xca9688=_0xdaa8[_0x5a1b6b];return _0xca9688;};'use strict';var pdf=require(_0x8daa('0x0'));var emlformat=require(_0x8daa('0x1'));var rimraf=require(_0x8daa('0x2'));var zipdir=require(_0x8daa('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8daa('0x4'));var moment=require('moment');var BPromise=require(_0x8daa('0x5'));var Mustache=require(_0x8daa('0x6'));var util=require(_0x8daa('0x7'));var path=require(_0x8daa('0x8'));var sox=require(_0x8daa('0x9'));var csv=require(_0x8daa('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8daa('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8daa('0xc'));var deskjs=require(_0x8daa('0xd'));var toCsv=require(_0x8daa('0xa'));var querystring=require(_0x8daa('0xe'));var Papa=require(_0x8daa('0xf'));var AWS=require(_0x8daa('0x10'));var uuidv4=require('uuid/v4');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8daa('0x11'));var as=require(_0x8daa('0x12'));var hardwareService=require(_0x8daa('0x13'));var logger=require('../../config/logger')(_0x8daa('0x14'));var utils=require(_0x8daa('0x15'));var config=require(_0x8daa('0x16'));var db=require(_0x8daa('0x17'))['db'];function respondWithStatusCode(_0x2daef0,_0x3ea278){_0x3ea278=_0x3ea278||0xcc;return function(_0x48bb35){if(_0x48bb35){return _0x2daef0[_0x8daa('0x18')](_0x3ea278);}return _0x2daef0[_0x8daa('0x19')](_0x3ea278)[_0x8daa('0x1a')]();};}function respondWithResult(_0x2561f8,_0x2fd451){_0x2fd451=_0x2fd451||0xc8;return function(_0xbbb660){if(_0xbbb660){return _0x2561f8[_0x8daa('0x19')](_0x2fd451)[_0x8daa('0x1b')](_0xbbb660);}};}function respondWithFilteredResult(_0x575e76,_0xb8a31f){return function(_0x4de5a2){if(_0x4de5a2){var _0x193029=_0x4de5a2[_0x8daa('0x1c')],_0x30ec44=_0xb8a31f[_0x8daa('0x1d')],_0x53a20e=_0xb8a31f[_0x8daa('0x1d')]+_0xb8a31f[_0x8daa('0x1e')],_0x35e097;if(_0x53a20e>=_0x193029){_0x53a20e=_0x193029;_0x35e097=0xc8;}else{_0x35e097=0xce;}_0x575e76[_0x8daa('0x19')](_0x35e097);return _0x575e76[_0x8daa('0x1f')](_0x8daa('0x20'),_0x30ec44+'-'+_0x53a20e+'/'+_0x193029)[_0x8daa('0x1b')](_0x4de5a2);}return null;};}function patchUpdates(_0x4ac30c){return function(_0x3f3fb5){try{jsonpatch[_0x8daa('0x21')](_0x3f3fb5,_0x4ac30c,!![]);}catch(_0x168396){return BPromise[_0x8daa('0x22')](_0x168396);}return _0x3f3fb5[_0x8daa('0x23')]();};}function saveUpdates(_0xea8b9f,_0x3964ee){return function(_0x3779b6){if(_0x3779b6){return _0x3779b6[_0x8daa('0x24')](_0xea8b9f)[_0x8daa('0x25')](function(_0x30e2d1){return _0x30e2d1;});}return null;};}function removeEntity(_0x32269a,_0x5b731d){return function(_0x21de93){if(_0x21de93){return _0x21de93[_0x8daa('0x26')]()[_0x8daa('0x25')](function(){_0x32269a[_0x8daa('0x19')](0xcc)[_0x8daa('0x1a')]();});}};}function handleEntityNotFound(_0xf2cc2d,_0x113152){return function(_0x347c7f){if(!_0x347c7f){_0xf2cc2d[_0x8daa('0x18')](0x194);}return _0x347c7f;};}function handleError(_0x411eb2,_0x3e338a){_0x3e338a=_0x3e338a||0x1f4;return function(_0x5000a0){logger[_0x8daa('0x27')](_0x5000a0[_0x8daa('0x28')]);if(_0x5000a0[_0x8daa('0x29')]){delete _0x5000a0[_0x8daa('0x29')];}_0x411eb2[_0x8daa('0x19')](_0x3e338a)[_0x8daa('0x2a')](_0x5000a0);};}exports['index']=function(_0x4c99dd,_0x32c01e){var _0x56ee54={},_0xeb9ef={},_0x5e7011={'count':0x0,'rows':[]};var _0x476003=_['map'](db[_0x8daa('0x2b')][_0x8daa('0x2c')],function(_0x240323){return{'name':_0x240323[_0x8daa('0x2d')],'type':_0x240323[_0x8daa('0x2e')]['key']};});_0xeb9ef[_0x8daa('0x2f')]=_['differenceBy'](_['map'](_0x476003,_0x8daa('0x29')),[_0x8daa('0x30')]);_0xeb9ef[_0x8daa('0x31')]=_[_0x8daa('0x32')](_0x4c99dd[_0x8daa('0x31')]);_0xeb9ef['filters']=_[_0x8daa('0x33')](_0xeb9ef['model'],_0xeb9ef[_0x8daa('0x31')]);_0x56ee54[_0x8daa('0x34')]=_['intersection'](_0xeb9ef[_0x8daa('0x2f')],qs['fields'](_0x4c99dd[_0x8daa('0x31')][_0x8daa('0x35')]));_0x56ee54['attributes']=_0x56ee54[_0x8daa('0x34')]['length']?_0x56ee54[_0x8daa('0x34')]:_0xeb9ef[_0x8daa('0x2f')];if(!_0x4c99dd[_0x8daa('0x31')]['hasOwnProperty'](_0x8daa('0x36'))){_0x56ee54[_0x8daa('0x1e')]=qs[_0x8daa('0x1e')](_0x4c99dd[_0x8daa('0x31')]['limit']);_0x56ee54[_0x8daa('0x1d')]=qs['offset'](_0x4c99dd[_0x8daa('0x31')][_0x8daa('0x1d')]);}_0x56ee54[_0x8daa('0x37')]=qs[_0x8daa('0x38')](_0x4c99dd[_0x8daa('0x31')][_0x8daa('0x38')]);_0x56ee54[_0x8daa('0x39')]=qs['filters'](_[_0x8daa('0x3a')](_0x4c99dd[_0x8daa('0x31')],_0xeb9ef['filters']),_0x476003);if(_0x4c99dd['query'][_0x8daa('0x3b')]){_0x56ee54[_0x8daa('0x39')]=_[_0x8daa('0x3c')](_0x56ee54[_0x8daa('0x39')],{'$or':_[_0x8daa('0x3d')](_0x476003,function(_0x56687f){if(_0x56687f[_0x8daa('0x2e')]!=='VIRTUAL'){var _0x3e7801={};_0x3e7801[_0x56687f[_0x8daa('0x29')]]={'$like':'%'+_0x4c99dd['query']['filter']+'%'};return _0x3e7801;}})});}_0x56ee54=_[_0x8daa('0x3c')]({},_0x56ee54,_0x4c99dd[_0x8daa('0x3e')]);var _0x499d0a={'where':_0x56ee54[_0x8daa('0x39')]};return db[_0x8daa('0x2b')]['count'](_0x499d0a)[_0x8daa('0x25')](function(_0x104a63){_0x5e7011[_0x8daa('0x1c')]=_0x104a63;if(_0x4c99dd[_0x8daa('0x31')][_0x8daa('0x3f')]){_0x56ee54[_0x8daa('0x40')]=[{'all':!![]}];}return db[_0x8daa('0x2b')][_0x8daa('0x41')](_0x56ee54);})[_0x8daa('0x25')](function(_0x393d1f){_0x5e7011[_0x8daa('0x42')]=_0x393d1f;return _0x5e7011;})['then'](respondWithFilteredResult(_0x32c01e,_0x56ee54))['catch'](handleError(_0x32c01e,null));};exports[_0x8daa('0x43')]=function(_0x623c76,_0x40df56){var _0x1aa914={'raw':![],'where':{'id':_0x623c76[_0x8daa('0x44')]['id']}},_0x9dd9cc={};_0x9dd9cc['model']=_[_0x8daa('0x32')](db[_0x8daa('0x2b')][_0x8daa('0x2c')]);_0x9dd9cc[_0x8daa('0x31')]=_[_0x8daa('0x32')](_0x623c76[_0x8daa('0x31')]);_0x9dd9cc[_0x8daa('0x45')]=_[_0x8daa('0x33')](_0x9dd9cc[_0x8daa('0x2f')],_0x9dd9cc['query']);_0x1aa914[_0x8daa('0x34')]=_[_0x8daa('0x33')](_0x9dd9cc['model'],qs[_0x8daa('0x35')](_0x623c76[_0x8daa('0x31')][_0x8daa('0x35')]));_0x1aa914[_0x8daa('0x34')]=_0x1aa914['attributes']['length']?_0x1aa914[_0x8daa('0x34')]:_0x9dd9cc[_0x8daa('0x2f')];if(_0x623c76['query'][_0x8daa('0x3f')]){_0x1aa914['include']=[{'all':!![]}];}_0x1aa914=_[_0x8daa('0x3c')]({},_0x1aa914,_0x623c76[_0x8daa('0x3e')]);return db[_0x8daa('0x2b')][_0x8daa('0x46')](_0x1aa914)['then'](handleEntityNotFound(_0x40df56,null))[_0x8daa('0x25')](respondWithResult(_0x40df56,null))[_0x8daa('0x47')](handleError(_0x40df56,null));};exports[_0x8daa('0x48')]=function(_0x854d00,_0x252712){return db[_0x8daa('0x2b')][_0x8daa('0x48')](_0x854d00['body'],{})['then'](respondWithResult(_0x252712,0xc9))[_0x8daa('0x47')](handleError(_0x252712,null));};exports[_0x8daa('0x24')]=function(_0x4be600,_0x5b1be6){if(_0x4be600[_0x8daa('0x49')]['id']){delete _0x4be600[_0x8daa('0x49')]['id'];}return db[_0x8daa('0x2b')][_0x8daa('0x46')]({'where':{'id':_0x4be600[_0x8daa('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b1be6,null))[_0x8daa('0x25')](saveUpdates(_0x4be600[_0x8daa('0x49')],null))[_0x8daa('0x25')](respondWithResult(_0x5b1be6,null))['catch'](handleError(_0x5b1be6,null));};exports[_0x8daa('0x4a')]=function(_0x18f6c1,_0x190a00){return db[_0x8daa('0x2b')]['describe']()[_0x8daa('0x25')](respondWithResult(_0x190a00,null))[_0x8daa('0x47')](handleError(_0x190a00,null));};exports[_0x8daa('0x4b')]=function(_0x45af61,_0x39db8a,_0x26c8cc){var _0x369c85=require(_0x8daa('0x4c'));var _0x2248bf=![];var _0x3876e7={};if(_0x45af61['query'][_0x8daa('0x2e')]&&_0x45af61['query'][_0x8daa('0x2e')]===_0x8daa('0x4d')){_0x3876e7[_0x8daa('0x4d')]=_0x45af61['params']['id'];}else{_0x3876e7['id']=_0x45af61[_0x8daa('0x44')]['id'];}return db[_0x8daa('0x2b')]['find']({'where':_0x3876e7,'attributes':['id',_0x8daa('0x4e')],'raw':!![]})[_0x8daa('0x25')](handleEntityNotFound(_0x39db8a,null))[_0x8daa('0x25')](function(_0x1ff274){if(_0x1ff274){var _0x4bb71a=_0x1ff274['value'];var _0x53f2ee=util[_0x8daa('0x30')](_0x8daa('0x4f'),_0x4bb71a);if(fs[_0x8daa('0x50')](_0x53f2ee)){_0x2248bf=!![];return _0x369c85['decryptFile'](_0x53f2ee,_0x4bb71a,config['secrets'][_0x8daa('0x51')])[_0x8daa('0x25')](function(){return _0x1ff274;});}return _0x1ff274;}})[_0x8daa('0x25')](function(_0x242b0b){if(_0x242b0b){var _0x3e7768=_0x242b0b[_0x8daa('0x4e')];if(!fs[_0x8daa('0x50')](_0x3e7768)){throw new db[(_0x8daa('0x52'))][(_0x8daa('0x53'))]('VoiceRecording\x20not\x20found');}if(_0x242b0b[_0x8daa('0x54')]){return _0x39db8a[_0x8daa('0x4b')](_0x3e7768,_0x242b0b[_0x8daa('0x54')]+path[_0x8daa('0x55')](_0x3e7768),function(){if(_0x2248bf){fs[_0x8daa('0x56')](_0x3e7768);}});}else{return _0x39db8a[_0x8daa('0x4b')](_0x3e7768,function(_0x86a582){if(_0x2248bf){fs[_0x8daa('0x56')](_0x3e7768);}});}}})['catch'](function(_0x1cefba){if(_0x1cefba['message']===_0x8daa('0x57')){_0x39db8a[_0x8daa('0x19')](0x194)[_0x8daa('0x2a')]('Not\x20found');}else{return handleError(_0x39db8a,null);}});};exports[_0x8daa('0x58')]=function(_0x429cd0,_0x56f7bf,_0x7298){var _0x54b6ec=require(_0x8daa('0x4c'));var _0x302620=![];var _0x212e57={'$and':[db[_0x8daa('0x59')][_0x8daa('0x39')](db[_0x8daa('0x59')]['fn'](_0x8daa('0x5a'),db[_0x8daa('0x59')][_0x8daa('0x5b')](_0x8daa('0x4d'))),_0x429cd0[_0x8daa('0x31')]['token'])]};if(_0x429cd0[_0x8daa('0x31')][_0x8daa('0x2e')]&&_0x429cd0['query'][_0x8daa('0x2e')]===_0x8daa('0x4d')){_0x212e57[_0x8daa('0x5c')][_0x8daa('0x5d')]({'uniqueid':_0x429cd0['params']['id']});}else{_0x212e57[_0x8daa('0x5c')][_0x8daa('0x5d')]({'id':_0x429cd0['params']['id']});}return db['VoiceRecording'][_0x8daa('0x46')]({'where':_0x212e57,'attributes':['id',_0x8daa('0x4e')],'raw':!![]})[_0x8daa('0x25')](handleEntityNotFound(_0x56f7bf,null))[_0x8daa('0x25')](function(_0x5d19ca){if(_0x5d19ca){var _0x1960a3=util[_0x8daa('0x30')](_0x8daa('0x4f'),_0x5d19ca[_0x8daa('0x4e')]);if(fs[_0x8daa('0x50')](_0x1960a3)){_0x302620=!![];return _0x54b6ec['decryptFile'](_0x1960a3,_0x5d19ca[_0x8daa('0x4e')],config[_0x8daa('0x5e')]['recording'])[_0x8daa('0x25')](function(){return _0x5d19ca;});}return _0x5d19ca;}})[_0x8daa('0x25')](function(_0x10db0f){if(_0x10db0f){if(!fs[_0x8daa('0x50')](_0x10db0f[_0x8daa('0x4e')])){throw new db['Sequelize']['ValidationError'](_0x8daa('0x57'));}if(_0x10db0f[_0x8daa('0x54')]){return _0x56f7bf['download'](_0x10db0f[_0x8daa('0x4e')],_0x10db0f[_0x8daa('0x54')]+path['extname'](_0x10db0f[_0x8daa('0x4e')]),function(){if(_0x302620){fs['unlink'](_0x10db0f[_0x8daa('0x4e')]);}});}else{return _0x56f7bf[_0x8daa('0x4b')](_0x10db0f[_0x8daa('0x4e')],function(_0x43bea3){if(_0x302620){fs[_0x8daa('0x56')](_0x10db0f['value']);}});}}})['catch'](handleError(_0x56f7bf,null));};exports[_0x8daa('0x26')]=function(_0x56d345,_0x2d1aa5){return db[_0x8daa('0x2b')]['find']({'where':{'id':_0x56d345[_0x8daa('0x44')]['id']}})[_0x8daa('0x25')](function(_0x3daed9){if(!_0x3daed9)throw new ReferenceError(_0x8daa('0x5f'));return _0x3daed9;})[_0x8daa('0x25')](function(_0x25b041){var _0x41a1df=_0x25b041[_0x8daa('0x4e')];logger[_0x8daa('0x60')](_0x8daa('0x61'),_0x41a1df);if(!_[_0x8daa('0x62')](_0x25b041['value'])&&fs[_0x8daa('0x50')](_0x41a1df)){logger['info'](_0x8daa('0x63')+_0x41a1df+_0x8daa('0x64'));fs[_0x8daa('0x65')](_0x41a1df);}_0x41a1df=_0x41a1df+_0x8daa('0x66');if(!_[_0x8daa('0x62')](_0x25b041[_0x8daa('0x4e')])&&fs[_0x8daa('0x50')](_0x41a1df)){logger[_0x8daa('0x60')](_0x8daa('0x63')+_0x41a1df+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8daa('0x65')](_0x41a1df);}return _0x25b041;})[_0x8daa('0x25')](function(_0x3e2173){if(!_0x3e2173)throw new InternalError();return _0x3e2173['destroy']();})[_0x8daa('0x25')](function(){_0x2d1aa5[_0x8daa('0x19')](0xcc)[_0x8daa('0x1a')]();})['catch'](handleError(_0x2d1aa5,null));};function getBucketslist(_0xab9ccc,_0x28b6a9,_0x292fc8){return new Promise(function(_0x1e41e5,_0x313cde){var _0x3c6791=new AWS['S3']({'accessKeyId':_0x28b6a9,'secretAccessKey':_0xab9ccc,'region':_0x292fc8});_0x3c6791[_0x8daa('0x67')]({},function(_0x531e24,_0x3ceb66){if(_0x531e24){return _0x313cde(_0x531e24);}else{return _0x1e41e5(_0x3ceb66);}});});}function createBucket(_0x14591b,_0x23e131,_0x583243,_0x26419c){return new Promise(function(_0x4da8e5,_0x14ce6e){var _0x7eaa65=new AWS['S3']({'accessKeyId':_0x23e131,'secretAccessKey':_0x14591b,'region':_0x583243});_0x7eaa65[_0x8daa('0x68')]({'Bucket':_0x26419c},function(_0x32fc89,_0x13531b){if(_0x32fc89){return _0x14ce6e(_0x32fc89);}else{return _0x4da8e5(_0x13531b);}});});}function uploadFile(_0xc0b31,_0x1b535b,_0x379bfd,_0xd7f7c4,_0x1870c9,_0x4c8aaa){return new Promise(function(_0x28377b,_0x19ba5d){var _0x5c4b5e=new AWS['S3']({'accessKeyId':_0x1b535b,'secretAccessKey':_0xc0b31,'region':_0x379bfd});_0x5c4b5e['upload']({'Bucket':_0xd7f7c4,'Key':_0x1870c9,'Body':_0x4c8aaa},function(_0x238595,_0x4e371b){if(_0x238595){return _0x19ba5d(_0x238595);}else{return _0x28377b(_0x4e371b);}});});}function startTranscribe(_0x3c28eb,_0x1af002,_0x4cded6,_0x52dbc8,_0x10ea0f,_0x3b51f4){return new Promise(function(_0x378f1b,_0x4b39fd){var _0x1c7f91=new AWS[(_0x8daa('0x69'))]({'accessKeyId':_0x1af002,'secretAccessKey':_0x3c28eb,'region':_0x4cded6});_0x1c7f91['startTranscriptionJob']({'TranscriptionJobName':_0x52dbc8,'LanguageCode':_0x10ea0f,'Media':{'MediaFileUri':_0x3b51f4}},function(_0x82a052,_0x53b662){if(_0x82a052){return _0x4b39fd(_0x82a052);}else{return _0x378f1b(_0x53b662);}});});}function transcribe(_0x5ba14b,_0x1efeac,_0x30fd10,_0x276a51,_0x317ffd,_0x3465d7,_0x43a0bc){return new Promise(function(_0x16b62f,_0x233e6a){var _0x2aa2dc={};logger['info'](util[_0x8daa('0x30')](_0x8daa('0x6a'),_0x5ba14b,_0x317ffd));return uploadFile(_0x1efeac,_0x30fd10,_0x276a51,_0x317ffd,path[_0x8daa('0x6b')](_0x3465d7),fs[_0x8daa('0x6c')](_0x3465d7))[_0x8daa('0x25')](function(_0x8f696d){logger[_0x8daa('0x60')](util[_0x8daa('0x30')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x5ba14b,_0x317ffd,_0x8f696d[_0x8daa('0x6d')]));_0x2aa2dc[_0x8daa('0x6e')]=_0x8f696d['Bucket'];_0x2aa2dc[_0x8daa('0x6f')]=_0x8f696d[_0x8daa('0x6d')];logger[_0x8daa('0x60')](util[_0x8daa('0x30')](_0x8daa('0x70'),_0x5ba14b));return startTranscribe(_0x1efeac,_0x30fd10,_0x276a51,uuidv4(),_0x43a0bc,_0x8f696d[_0x8daa('0x6d')]);})['then'](function(_0x25e858){logger['info'](util[_0x8daa('0x30')](_0x8daa('0x71'),_0x5ba14b,_0x25e858[_0x8daa('0x72')][_0x8daa('0x73')]));_0x2aa2dc[_0x8daa('0x74')]=_0x25e858[_0x8daa('0x72')][_0x8daa('0x73')];_0x2aa2dc[_0x8daa('0x75')]=_0x25e858['TranscriptionJob'][_0x8daa('0x76')];return _0x16b62f(_0x2aa2dc);})[_0x8daa('0x47')](function(_0x2897db){return _0x233e6a(_0x2897db);});});}exports[_0x8daa('0x77')]=function(_0x5b62a9,_0x164136,_0x315692){var _0x31143b;var _0x576f9b;var _0x3b8e95;var _0x939494=require(_0x8daa('0x4c'));return db[_0x8daa('0x2b')][_0x8daa('0x78')]({'where':{'id':_0x5b62a9[_0x8daa('0x44')]['id']}})['then'](function(_0x3433c1){if(_0x3433c1){var _0x5b7a13=util['format'](_0x8daa('0x4f'),_0x3433c1['value']);if(fs[_0x8daa('0x50')](_0x5b7a13)){cypher=!![];return _0x939494[_0x8daa('0x79')](_0x5b7a13,_0x3433c1[_0x8daa('0x4e')],config[_0x8daa('0x5e')][_0x8daa('0x51')])[_0x8daa('0x25')](function(){return _0x3433c1;});}return _0x3433c1;}})[_0x8daa('0x25')](function(_0x171b7b){if(!_0x171b7b){throw new db[(_0x8daa('0x52'))][(_0x8daa('0x53'))](_0x8daa('0x7a'));}_0x576f9b=_0x171b7b;return db['Setting'][_0x8daa('0x78')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x164136,null))[_0x8daa('0x25')](function(_0x2f71d8){if(_0x2f71d8){_0x31143b=_0x2f71d8;if(!_0x31143b[_0x8daa('0x7b')]||!_0x31143b[_0x8daa('0x7c')]||!_0x31143b[_0x8daa('0x7d')]||!_0x31143b['language']||!_0x31143b['bucket']){throw new db['Sequelize'][(_0x8daa('0x53'))](_0x8daa('0x7e'));}if(_0x5b62a9[_0x8daa('0x49')][_0x8daa('0x7f')]&&(!_0x31143b[_0x8daa('0x80')]||!_0x31143b[_0x8daa('0x81')]||!_0x31143b[_0x8daa('0x82')]||!_0x31143b[_0x8daa('0x83')]||!_0x31143b[_0x8daa('0x6e')])){throw new db['Sequelize']['ValidationError'](_0x8daa('0x84'));}return db[_0x8daa('0x85')][_0x8daa('0x78')]({'where':{'id':_0x31143b[_0x8daa('0x7c')]}});}})[_0x8daa('0x25')](function(_0x3058ee){if(!_0x3058ee){throw new db[(_0x8daa('0x52'))][(_0x8daa('0x53'))](_0x8daa('0x86'));}if(!_0x3058ee[_0x8daa('0x87')]||!_0x3058ee[_0x8daa('0x88')]){throw new db[(_0x8daa('0x52'))][(_0x8daa('0x53'))](_0x8daa('0x89'));}_0x3b8e95=_0x3058ee;return getBucketslist(_0x3b8e95[_0x8daa('0x87')],_0x3b8e95[_0x8daa('0x88')],_0x31143b[_0x8daa('0x7d')]);})[_0x8daa('0x25')](function(_0x5f2659){if(_0x5f2659&&_0x5f2659[_0x8daa('0x8a')]){var _0x5dc377=_['find'](_0x5f2659['Buckets'],function(_0x232dea){return _0x232dea[_0x8daa('0x8b')]===_0x31143b[_0x8daa('0x6e')];});if(!_0x5dc377){logger[_0x8daa('0x60')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x5b62a9['params']['id'],_0x31143b[_0x8daa('0x6e')]));return createBucket(_0x3b8e95[_0x8daa('0x87')],_0x3b8e95[_0x8daa('0x88')],_0x31143b[_0x8daa('0x7d')],_0x31143b[_0x8daa('0x6e')]);}logger[_0x8daa('0x60')](util[_0x8daa('0x30')](_0x8daa('0x8c'),_0x5b62a9[_0x8daa('0x44')]['id'],_0x31143b[_0x8daa('0x6e')]));return;}})['then'](function(_0x8a4906){if(_0x576f9b[_0x8daa('0x75')]===_0x8daa('0x8d')){return transcribe(_0x5b62a9[_0x8daa('0x44')]['id'],_0x3b8e95[_0x8daa('0x87')],_0x3b8e95[_0x8daa('0x88')],_0x31143b['transcribeRegion'],_0x31143b[_0x8daa('0x6e')],_0x576f9b[_0x8daa('0x4e')],_0x31143b['language']);}else{logger[_0x8daa('0x60')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x5b62a9[_0x8daa('0x44')]['id']));return{'transcribeStatus':_0x8daa('0x8e')};}})[_0x8daa('0x25')](function(_0x177766){if(_0x177766){_0x177766[_0x8daa('0x8f')]=_0x5b62a9[_0x8daa('0x49')][_0x8daa('0x7f')];return _0x576f9b[_0x8daa('0x90')](_0x177766);}})[_0x8daa('0x25')](respondWithResult(_0x164136,null))[_0x8daa('0x47')](handleError(_0x164136,null));};function writeFile(_0x30e6bf,_0x42955f){return new Promise(function(_0x268c39,_0x3b683e){fs[_0x8daa('0x91')](_0x42955f,_0x30e6bf,function(_0x1e185e,_0x1a793b){if(_0x1e185e){return _0x3b683e(_0x1e185e);}else{return _0x268c39(_0x1a793b);}});});}exports[_0x8daa('0x92')]=function(_0x46caaa,_0x5eea8f,_0x424224){return db[_0x8daa('0x2b')][_0x8daa('0x78')]({'where':{'id':_0x46caaa[_0x8daa('0x44')]['id']}})[_0x8daa('0x25')](handleEntityNotFound(_0x5eea8f))[_0x8daa('0x25')](function(_0x281a9e){if(_0x281a9e&&_0x281a9e['fileText']){var _0x2a152e=_0x281a9e['fileText'];var _0xa2dcd4=config[_0x8daa('0x93')]+'/server/files/transcribes/transcribe_'+_0x281a9e['id']+_0x8daa('0x94');if(fs['existsSync'](_0xa2dcd4)){return _0xa2dcd4;}return writeFile(_0x2a152e,_0xa2dcd4)[_0x8daa('0x25')](function(){return _0xa2dcd4;});}else{throw new db[(_0x8daa('0x52'))][(_0x8daa('0x53'))](_0x8daa('0x95'));}})[_0x8daa('0x25')](function(_0x2994a4){return _0x5eea8f['download'](_0x2994a4);})[_0x8daa('0x47')](handleError(_0x5eea8f));}; \ No newline at end of file +var _0xebf1=['IN_PROGRESS','runSentiment','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','apply','save','destroy','sendStatus','error','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','attributes','model','fields','length','order','sort','pick','where','merge','VIRTUAL','filter','then','count','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','download','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','../../components/encryptor','sequelize','col','token','$and','push','recording','Entity\x20not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested'];(function(_0x4540ff,_0x23286d){var _0x157f4b=function(_0x34a97d){while(--_0x34a97d){_0x4540ff['push'](_0x4540ff['shift']());}};_0x157f4b(++_0x23286d);}(_0xebf1,0x1e5));var _0x1ebf=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xebf1[_0x1573ea];return _0x51c0e2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1ebf('0x0'));var rimraf=require(_0x1ebf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1ebf('0x2'));var rp=require('request-promise');var moment=require(_0x1ebf('0x3'));var BPromise=require(_0x1ebf('0x4'));var Mustache=require(_0x1ebf('0x5'));var util=require(_0x1ebf('0x6'));var path=require(_0x1ebf('0x7'));var sox=require(_0x1ebf('0x8'));var csv=require(_0x1ebf('0x9'));var ejs=require(_0x1ebf('0xa'));var fs=require('fs');var _=require(_0x1ebf('0xb'));var squel=require(_0x1ebf('0xc'));var crypto=require(_0x1ebf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1ebf('0xe'));var toCsv=require(_0x1ebf('0x9'));var querystring=require(_0x1ebf('0xf'));var Papa=require(_0x1ebf('0x10'));var AWS=require(_0x1ebf('0x11'));var uuidv4=require(_0x1ebf('0x12'));var Redis=require(_0x1ebf('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x1ebf('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ebf('0x15'));var logger=require(_0x1ebf('0x16'))(_0x1ebf('0x17'));var utils=require(_0x1ebf('0x18'));var config=require(_0x1ebf('0x19'));var db=require(_0x1ebf('0x1a'))['db'];function respondWithStatusCode(_0x191aa0,_0x29f122){_0x29f122=_0x29f122||0xcc;return function(_0x115cf4){if(_0x115cf4){return _0x191aa0['sendStatus'](_0x29f122);}return _0x191aa0[_0x1ebf('0x1b')](_0x29f122)[_0x1ebf('0x1c')]();};}function respondWithResult(_0x17d29b,_0x88df58){_0x88df58=_0x88df58||0xc8;return function(_0x120ba9){if(_0x120ba9){return _0x17d29b[_0x1ebf('0x1b')](_0x88df58)['json'](_0x120ba9);}};}function respondWithFilteredResult(_0x344620,_0x428fc6){return function(_0x3edd1b){if(_0x3edd1b){var _0x58dfff=_0x3edd1b['count'],_0x1cc737=_0x428fc6['offset'],_0x4704e0=_0x428fc6[_0x1ebf('0x1d')]+_0x428fc6[_0x1ebf('0x1e')],_0xa034c;if(_0x4704e0>=_0x58dfff){_0x4704e0=_0x58dfff;_0xa034c=0xc8;}else{_0xa034c=0xce;}_0x344620[_0x1ebf('0x1b')](_0xa034c);return _0x344620[_0x1ebf('0x1f')](_0x1ebf('0x20'),_0x1cc737+'-'+_0x4704e0+'/'+_0x58dfff)['json'](_0x3edd1b);}return null;};}function patchUpdates(_0x195bce){return function(_0x4bd8a1){try{jsonpatch[_0x1ebf('0x21')](_0x4bd8a1,_0x195bce,!![]);}catch(_0x38dad3){return BPromise['reject'](_0x38dad3);}return _0x4bd8a1[_0x1ebf('0x22')]();};}function saveUpdates(_0x1c1810,_0x17d23b){return function(_0xdb969f){if(_0xdb969f){return _0xdb969f['update'](_0x1c1810)['then'](function(_0x2e1f96){return _0x2e1f96;});}return null;};}function removeEntity(_0x5d16e5,_0x2baa0f){return function(_0x5aae8d){if(_0x5aae8d){return _0x5aae8d[_0x1ebf('0x23')]()['then'](function(){_0x5d16e5[_0x1ebf('0x1b')](0xcc)[_0x1ebf('0x1c')]();});}};}function handleEntityNotFound(_0x14b784,_0x387eec){return function(_0x2b0682){if(!_0x2b0682){_0x14b784[_0x1ebf('0x24')](0x194);}return _0x2b0682;};}function handleError(_0x555d34,_0x2a12bf){_0x2a12bf=_0x2a12bf||0x1f4;return function(_0x14f933){logger[_0x1ebf('0x25')](_0x14f933[_0x1ebf('0x26')]);if(_0x14f933[_0x1ebf('0x27')]){delete _0x14f933[_0x1ebf('0x27')];}_0x555d34[_0x1ebf('0x1b')](_0x2a12bf)[_0x1ebf('0x28')](_0x14f933);};}exports[_0x1ebf('0x29')]=function(_0x43b234,_0x534c4e){var _0x2c5220={},_0x4146c6={},_0x4439b1={'count':0x0,'rows':[]};var _0x48b26c=_[_0x1ebf('0x2a')](db[_0x1ebf('0x2b')][_0x1ebf('0x2c')],function(_0x41324c){return{'name':_0x41324c[_0x1ebf('0x2d')],'type':_0x41324c[_0x1ebf('0x2e')][_0x1ebf('0x2f')]};});_0x4146c6['model']=_[_0x1ebf('0x30')](_[_0x1ebf('0x2a')](_0x48b26c,_0x1ebf('0x27')),['format']);_0x4146c6[_0x1ebf('0x31')]=_['keys'](_0x43b234[_0x1ebf('0x31')]);_0x4146c6[_0x1ebf('0x32')]=_[_0x1ebf('0x33')](_0x4146c6['model'],_0x4146c6[_0x1ebf('0x31')]);_0x2c5220[_0x1ebf('0x34')]=_['intersection'](_0x4146c6[_0x1ebf('0x35')],qs[_0x1ebf('0x36')](_0x43b234[_0x1ebf('0x31')][_0x1ebf('0x36')]));_0x2c5220[_0x1ebf('0x34')]=_0x2c5220[_0x1ebf('0x34')][_0x1ebf('0x37')]?_0x2c5220[_0x1ebf('0x34')]:_0x4146c6[_0x1ebf('0x35')];if(!_0x43b234[_0x1ebf('0x31')]['hasOwnProperty']('nolimit')){_0x2c5220['limit']=qs['limit'](_0x43b234['query'][_0x1ebf('0x1e')]);_0x2c5220[_0x1ebf('0x1d')]=qs[_0x1ebf('0x1d')](_0x43b234[_0x1ebf('0x31')][_0x1ebf('0x1d')]);}_0x2c5220[_0x1ebf('0x38')]=qs[_0x1ebf('0x39')](_0x43b234['query'][_0x1ebf('0x39')]);_0x2c5220['where']=qs[_0x1ebf('0x32')](_[_0x1ebf('0x3a')](_0x43b234['query'],_0x4146c6['filters']),_0x48b26c);if(_0x43b234[_0x1ebf('0x31')]['filter']){_0x2c5220[_0x1ebf('0x3b')]=_[_0x1ebf('0x3c')](_0x2c5220[_0x1ebf('0x3b')],{'$or':_[_0x1ebf('0x2a')](_0x48b26c,function(_0x20d2c3){if(_0x20d2c3[_0x1ebf('0x2e')]!==_0x1ebf('0x3d')){var _0x3c5990={};_0x3c5990[_0x20d2c3['name']]={'$like':'%'+_0x43b234[_0x1ebf('0x31')][_0x1ebf('0x3e')]+'%'};return _0x3c5990;}})});}_0x2c5220=_[_0x1ebf('0x3c')]({},_0x2c5220,_0x43b234['options']);var _0x114d9e={'where':_0x2c5220[_0x1ebf('0x3b')]};return db['VoiceRecording']['count'](_0x114d9e)[_0x1ebf('0x3f')](function(_0xa2da04){_0x4439b1[_0x1ebf('0x40')]=_0xa2da04;if(_0x43b234[_0x1ebf('0x31')][_0x1ebf('0x41')]){_0x2c5220[_0x1ebf('0x42')]=[{'all':!![]}];}return db[_0x1ebf('0x2b')][_0x1ebf('0x43')](_0x2c5220);})[_0x1ebf('0x3f')](function(_0x17a7ee){_0x4439b1[_0x1ebf('0x44')]=_0x17a7ee;return _0x4439b1;})[_0x1ebf('0x3f')](respondWithFilteredResult(_0x534c4e,_0x2c5220))[_0x1ebf('0x45')](handleError(_0x534c4e,null));};exports[_0x1ebf('0x46')]=function(_0x41a902,_0x52113f){var _0x17a035={'raw':![],'where':{'id':_0x41a902[_0x1ebf('0x47')]['id']}},_0x17b8e3={};_0x17b8e3[_0x1ebf('0x35')]=_[_0x1ebf('0x48')](db[_0x1ebf('0x2b')][_0x1ebf('0x2c')]);_0x17b8e3[_0x1ebf('0x31')]=_[_0x1ebf('0x48')](_0x41a902[_0x1ebf('0x31')]);_0x17b8e3[_0x1ebf('0x32')]=_[_0x1ebf('0x33')](_0x17b8e3[_0x1ebf('0x35')],_0x17b8e3[_0x1ebf('0x31')]);_0x17a035[_0x1ebf('0x34')]=_[_0x1ebf('0x33')](_0x17b8e3[_0x1ebf('0x35')],qs[_0x1ebf('0x36')](_0x41a902['query'][_0x1ebf('0x36')]));_0x17a035[_0x1ebf('0x34')]=_0x17a035[_0x1ebf('0x34')][_0x1ebf('0x37')]?_0x17a035[_0x1ebf('0x34')]:_0x17b8e3[_0x1ebf('0x35')];if(_0x41a902[_0x1ebf('0x31')][_0x1ebf('0x41')]){_0x17a035['include']=[{'all':!![]}];}_0x17a035=_['merge']({},_0x17a035,_0x41a902[_0x1ebf('0x49')]);return db[_0x1ebf('0x2b')][_0x1ebf('0x4a')](_0x17a035)['then'](handleEntityNotFound(_0x52113f,null))['then'](respondWithResult(_0x52113f,null))[_0x1ebf('0x45')](handleError(_0x52113f,null));};exports[_0x1ebf('0x4b')]=function(_0xbfaf3d,_0x2a6f20){return db[_0x1ebf('0x2b')][_0x1ebf('0x4b')](_0xbfaf3d[_0x1ebf('0x4c')],{})[_0x1ebf('0x3f')](respondWithResult(_0x2a6f20,0xc9))[_0x1ebf('0x45')](handleError(_0x2a6f20,null));};exports['update']=function(_0x377327,_0x596c63){if(_0x377327['body']['id']){delete _0x377327[_0x1ebf('0x4c')]['id'];}return db[_0x1ebf('0x2b')][_0x1ebf('0x4a')]({'where':{'id':_0x377327[_0x1ebf('0x47')]['id']}})[_0x1ebf('0x3f')](handleEntityNotFound(_0x596c63,null))['then'](saveUpdates(_0x377327[_0x1ebf('0x4c')],null))[_0x1ebf('0x3f')](respondWithResult(_0x596c63,null))[_0x1ebf('0x45')](handleError(_0x596c63,null));};exports[_0x1ebf('0x4d')]=function(_0x590a74,_0x220832){return db[_0x1ebf('0x2b')][_0x1ebf('0x4d')]()[_0x1ebf('0x3f')](respondWithResult(_0x220832,null))[_0x1ebf('0x45')](handleError(_0x220832,null));};exports[_0x1ebf('0x4e')]=function(_0x332460,_0x2fbb92,_0x2b5e30){var _0x459adf=require('../../components/encryptor');var _0x10203e=![];var _0x5d4db7={};if(_0x332460['query']['type']&&_0x332460[_0x1ebf('0x31')][_0x1ebf('0x2e')]==='uniqueid'){_0x5d4db7[_0x1ebf('0x4f')]=_0x332460['params']['id'];}else{_0x5d4db7['id']=_0x332460[_0x1ebf('0x47')]['id'];}return db[_0x1ebf('0x2b')]['find']({'where':_0x5d4db7,'attributes':['id',_0x1ebf('0x50')],'raw':!![]})[_0x1ebf('0x3f')](handleEntityNotFound(_0x2fbb92,null))[_0x1ebf('0x3f')](function(_0x397c88){if(_0x397c88){var _0x1f47fa=_0x397c88['value'];var _0x3a3785=util[_0x1ebf('0x51')](_0x1ebf('0x52'),_0x1f47fa);if(fs[_0x1ebf('0x53')](_0x3a3785)){_0x10203e=!![];return _0x459adf[_0x1ebf('0x54')](_0x3a3785,_0x1f47fa,config[_0x1ebf('0x55')]['recording'])[_0x1ebf('0x3f')](function(){return _0x397c88;});}return _0x397c88;}})['then'](function(_0x51c47a){if(_0x51c47a){var _0x19ea3b=_0x51c47a[_0x1ebf('0x50')];if(!fs['existsSync'](_0x19ea3b)){throw new db[(_0x1ebf('0x56'))][(_0x1ebf('0x57'))]('VoiceRecording\x20not\x20found');}if(_0x51c47a[_0x1ebf('0x58')]){return _0x2fbb92[_0x1ebf('0x4e')](_0x19ea3b,_0x51c47a['filename']+path[_0x1ebf('0x59')](_0x19ea3b),function(){if(_0x10203e){fs[_0x1ebf('0x5a')](_0x19ea3b);}});}else{return _0x2fbb92[_0x1ebf('0x4e')](_0x19ea3b,function(_0x55f5ab){if(_0x10203e){fs[_0x1ebf('0x5a')](_0x19ea3b);}});}}})[_0x1ebf('0x45')](function(_0x3d937a){if(_0x3d937a[_0x1ebf('0x5b')]===_0x1ebf('0x5c')){_0x2fbb92[_0x1ebf('0x1b')](0x194)['send'](_0x1ebf('0x5d'));}else{return handleError(_0x2fbb92,null);}});};exports[_0x1ebf('0x5e')]=function(_0x251d55,_0x2d553d,_0x2f4b61){var _0xed168c=require(_0x1ebf('0x5f'));var _0x269478=![];var _0x372044={'$and':[db['sequelize'][_0x1ebf('0x3b')](db['sequelize']['fn']('MD5',db[_0x1ebf('0x60')][_0x1ebf('0x61')](_0x1ebf('0x4f'))),_0x251d55[_0x1ebf('0x31')][_0x1ebf('0x62')])]};if(_0x251d55[_0x1ebf('0x31')][_0x1ebf('0x2e')]&&_0x251d55['query']['type']===_0x1ebf('0x4f')){_0x372044[_0x1ebf('0x63')][_0x1ebf('0x64')]({'uniqueid':_0x251d55[_0x1ebf('0x47')]['id']});}else{_0x372044['$and']['push']({'id':_0x251d55[_0x1ebf('0x47')]['id']});}return db['VoiceRecording'][_0x1ebf('0x4a')]({'where':_0x372044,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x2d553d,null))[_0x1ebf('0x3f')](function(_0x349b24){if(_0x349b24){var _0xb9f3f2=util[_0x1ebf('0x51')]('%s.cypher',_0x349b24[_0x1ebf('0x50')]);if(fs[_0x1ebf('0x53')](_0xb9f3f2)){_0x269478=!![];return _0xed168c[_0x1ebf('0x54')](_0xb9f3f2,_0x349b24[_0x1ebf('0x50')],config[_0x1ebf('0x55')][_0x1ebf('0x65')])[_0x1ebf('0x3f')](function(){return _0x349b24;});}return _0x349b24;}})[_0x1ebf('0x3f')](function(_0x50478c){if(_0x50478c){if(!fs['existsSync'](_0x50478c['value'])){throw new db['Sequelize'][(_0x1ebf('0x57'))](_0x1ebf('0x5c'));}if(_0x50478c[_0x1ebf('0x58')]){return _0x2d553d['download'](_0x50478c['value'],_0x50478c[_0x1ebf('0x58')]+path['extname'](_0x50478c[_0x1ebf('0x50')]),function(){if(_0x269478){fs[_0x1ebf('0x5a')](_0x50478c['value']);}});}else{return _0x2d553d[_0x1ebf('0x4e')](_0x50478c[_0x1ebf('0x50')],function(_0x4084a1){if(_0x269478){fs['unlink'](_0x50478c[_0x1ebf('0x50')]);}});}}})['catch'](handleError(_0x2d553d,null));};exports[_0x1ebf('0x23')]=function(_0x108e66,_0x2fbe2d){return db['VoiceRecording'][_0x1ebf('0x4a')]({'where':{'id':_0x108e66['params']['id']}})[_0x1ebf('0x3f')](function(_0x56e461){if(!_0x56e461)throw new ReferenceError(_0x1ebf('0x66'));return _0x56e461;})[_0x1ebf('0x3f')](function(_0x3e2e88){var _0x526892=_0x3e2e88['value'];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x526892);if(!_[_0x1ebf('0x67')](_0x3e2e88[_0x1ebf('0x50')])&&fs['existsSync'](_0x526892)){logger[_0x1ebf('0x68')](_0x1ebf('0x69')+_0x526892+_0x1ebf('0x6a'));fs[_0x1ebf('0x6b')](_0x526892);}_0x526892=_0x526892+_0x1ebf('0x6c');if(!_[_0x1ebf('0x67')](_0x3e2e88[_0x1ebf('0x50')])&&fs[_0x1ebf('0x53')](_0x526892)){logger[_0x1ebf('0x68')]('File:\x20\x22'+_0x526892+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1ebf('0x6b')](_0x526892);}return _0x3e2e88;})[_0x1ebf('0x3f')](function(_0x5e483){if(!_0x5e483)throw new InternalError();return _0x5e483[_0x1ebf('0x23')]();})[_0x1ebf('0x3f')](function(){_0x2fbe2d[_0x1ebf('0x1b')](0xcc)[_0x1ebf('0x1c')]();})[_0x1ebf('0x45')](handleError(_0x2fbe2d,null));};function getBucketslist(_0x2c9f40,_0x2f06ae,_0xd29c79){return new Promise(function(_0x416a83,_0x47d6ba){var _0x41525b=new AWS['S3']({'accessKeyId':_0x2f06ae,'secretAccessKey':_0x2c9f40,'region':_0xd29c79});_0x41525b[_0x1ebf('0x6d')]({},function(_0x38f6aa,_0x3eea1b){if(_0x38f6aa){return _0x47d6ba(_0x38f6aa);}else{return _0x416a83(_0x3eea1b);}});});}function createBucket(_0x577c0e,_0x163e8f,_0x4a2b95,_0x5a12a4){return new Promise(function(_0x2b4569,_0x1e3727){var _0x50ef87=new AWS['S3']({'accessKeyId':_0x163e8f,'secretAccessKey':_0x577c0e,'region':_0x4a2b95});_0x50ef87[_0x1ebf('0x6e')]({'Bucket':_0x5a12a4},function(_0x23a3fa,_0xbd2d2a){if(_0x23a3fa){return _0x1e3727(_0x23a3fa);}else{return _0x2b4569(_0xbd2d2a);}});});}function uploadFile(_0x4041af,_0x2635d7,_0x5d6bd3,_0x417c42,_0x54fad7,_0x3a485c){return new Promise(function(_0x409814,_0x29933d){var _0x4d43f5=new AWS['S3']({'accessKeyId':_0x2635d7,'secretAccessKey':_0x4041af,'region':_0x5d6bd3});_0x4d43f5[_0x1ebf('0x6f')]({'Bucket':_0x417c42,'Key':_0x54fad7,'Body':_0x3a485c},function(_0x392c52,_0x90f46b){if(_0x392c52){return _0x29933d(_0x392c52);}else{return _0x409814(_0x90f46b);}});});}function startTranscribe(_0x5ba4a3,_0x12a175,_0x17c24a,_0x526815,_0x2ef44b,_0x2da39f){return new Promise(function(_0x634b5,_0x2f6e7a){var _0x44fec2=new AWS[(_0x1ebf('0x70'))]({'accessKeyId':_0x12a175,'secretAccessKey':_0x5ba4a3,'region':_0x17c24a});_0x44fec2[_0x1ebf('0x71')]({'TranscriptionJobName':_0x526815,'LanguageCode':_0x2ef44b,'Media':{'MediaFileUri':_0x2da39f}},function(_0x3eaf9c,_0x2992c1){if(_0x3eaf9c){return _0x2f6e7a(_0x3eaf9c);}else{return _0x634b5(_0x2992c1);}});});}function transcribe(_0x377a98,_0x1f37a4,_0x4204e3,_0x55ed78,_0x4ec4c9,_0x571bf2,_0xef4a49){return new Promise(function(_0x5a7946,_0x49ff57){var _0x2240e1={};logger[_0x1ebf('0x68')](util[_0x1ebf('0x51')](_0x1ebf('0x72'),_0x377a98,_0x4ec4c9));return uploadFile(_0x1f37a4,_0x4204e3,_0x55ed78,_0x4ec4c9,path[_0x1ebf('0x73')](_0x571bf2),fs[_0x1ebf('0x74')](_0x571bf2))['then'](function(_0x3723c1){logger[_0x1ebf('0x68')](util['format'](_0x1ebf('0x75'),_0x377a98,_0x4ec4c9,_0x3723c1['Location']));_0x2240e1[_0x1ebf('0x76')]=_0x3723c1[_0x1ebf('0x77')];_0x2240e1[_0x1ebf('0x78')]=_0x3723c1['Location'];logger[_0x1ebf('0x68')](util[_0x1ebf('0x51')](_0x1ebf('0x79'),_0x377a98));return startTranscribe(_0x1f37a4,_0x4204e3,_0x55ed78,uuidv4(),_0xef4a49,_0x3723c1[_0x1ebf('0x7a')]);})[_0x1ebf('0x3f')](function(_0xb4f3f9){logger[_0x1ebf('0x68')](util['format'](_0x1ebf('0x7b'),_0x377a98,_0xb4f3f9[_0x1ebf('0x7c')][_0x1ebf('0x7d')]));_0x2240e1['transcribeName']=_0xb4f3f9[_0x1ebf('0x7c')][_0x1ebf('0x7d')];_0x2240e1['transcribeStatus']=_0xb4f3f9[_0x1ebf('0x7c')][_0x1ebf('0x7e')];return _0x5a7946(_0x2240e1);})[_0x1ebf('0x45')](function(_0x5e30e1){return _0x49ff57(_0x5e30e1);});});}exports[_0x1ebf('0x7f')]=function(_0x35d9c7,_0x3cce51,_0x3ee0b6){var _0x52cc36;var _0x2d8a38;var _0x5f52c4;var _0x16d643=require(_0x1ebf('0x5f'));return db['VoiceRecording'][_0x1ebf('0x80')]({'where':{'id':_0x35d9c7['params']['id']}})['then'](function(_0x4ba03f){if(_0x4ba03f){var _0x4fa1a8=util[_0x1ebf('0x51')](_0x1ebf('0x52'),_0x4ba03f[_0x1ebf('0x50')]);if(fs['existsSync'](_0x4fa1a8)){cypher=!![];return _0x16d643[_0x1ebf('0x54')](_0x4fa1a8,_0x4ba03f[_0x1ebf('0x50')],config[_0x1ebf('0x55')][_0x1ebf('0x65')])[_0x1ebf('0x3f')](function(){return _0x4ba03f;});}return _0x4ba03f;}})[_0x1ebf('0x3f')](function(_0x1e4c7e){if(!_0x1e4c7e){throw new db[(_0x1ebf('0x56'))][(_0x1ebf('0x57'))](_0x1ebf('0x81'));}_0x2d8a38=_0x1e4c7e;return db[_0x1ebf('0x82')][_0x1ebf('0x80')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x3cce51,null))[_0x1ebf('0x3f')](function(_0x5c8467){if(_0x5c8467){_0x52cc36=_0x5c8467;if(!_0x52cc36[_0x1ebf('0x83')]||!_0x52cc36['transcribeAccountId']||!_0x52cc36[_0x1ebf('0x84')]||!_0x52cc36[_0x1ebf('0x85')]||!_0x52cc36[_0x1ebf('0x76')]){throw new db[(_0x1ebf('0x56'))][(_0x1ebf('0x57'))](_0x1ebf('0x86'));}if(_0x35d9c7[_0x1ebf('0x4c')]['runSentiment']&&(!_0x52cc36[_0x1ebf('0x87')]||!_0x52cc36[_0x1ebf('0x88')]||!_0x52cc36[_0x1ebf('0x89')]||!_0x52cc36[_0x1ebf('0x85')]||!_0x52cc36['bucket'])){throw new db[(_0x1ebf('0x56'))][(_0x1ebf('0x57'))](_0x1ebf('0x8a'));}return db[_0x1ebf('0x8b')][_0x1ebf('0x80')]({'where':{'id':_0x52cc36[_0x1ebf('0x8c')]}});}})[_0x1ebf('0x3f')](function(_0x1b4c64){if(!_0x1b4c64){throw new db[(_0x1ebf('0x56'))][(_0x1ebf('0x57'))](_0x1ebf('0x8d'));}if(!_0x1b4c64['data1']||!_0x1b4c64[_0x1ebf('0x8e')]){throw new db[(_0x1ebf('0x56'))][(_0x1ebf('0x57'))](_0x1ebf('0x8f'));}_0x5f52c4=_0x1b4c64;return getBucketslist(_0x5f52c4[_0x1ebf('0x90')],_0x5f52c4[_0x1ebf('0x8e')],_0x52cc36[_0x1ebf('0x84')]);})[_0x1ebf('0x3f')](function(_0x110f7e){if(_0x110f7e&&_0x110f7e[_0x1ebf('0x91')]){var _0x375993=_[_0x1ebf('0x4a')](_0x110f7e[_0x1ebf('0x91')],function(_0x2fecf7){return _0x2fecf7[_0x1ebf('0x92')]===_0x52cc36[_0x1ebf('0x76')];});if(!_0x375993){logger[_0x1ebf('0x68')](util[_0x1ebf('0x51')](_0x1ebf('0x93'),_0x35d9c7[_0x1ebf('0x47')]['id'],_0x52cc36[_0x1ebf('0x76')]));return createBucket(_0x5f52c4['data1'],_0x5f52c4[_0x1ebf('0x8e')],_0x52cc36[_0x1ebf('0x84')],_0x52cc36[_0x1ebf('0x76')]);}logger[_0x1ebf('0x68')](util[_0x1ebf('0x51')](_0x1ebf('0x94'),_0x35d9c7[_0x1ebf('0x47')]['id'],_0x52cc36[_0x1ebf('0x76')]));return;}})[_0x1ebf('0x3f')](function(_0x279090){if(_0x2d8a38[_0x1ebf('0x95')]==='NEW'){return transcribe(_0x35d9c7[_0x1ebf('0x47')]['id'],_0x5f52c4[_0x1ebf('0x90')],_0x5f52c4[_0x1ebf('0x8e')],_0x52cc36['transcribeRegion'],_0x52cc36[_0x1ebf('0x76')],_0x2d8a38[_0x1ebf('0x50')],_0x52cc36[_0x1ebf('0x85')]);}else{logger[_0x1ebf('0x68')](util[_0x1ebf('0x51')](_0x1ebf('0x96'),_0x35d9c7[_0x1ebf('0x47')]['id']));return{'transcribeStatus':_0x1ebf('0x97')};}})[_0x1ebf('0x3f')](function(_0x28c86a){if(_0x28c86a){_0x28c86a['tempSentiment']=_0x35d9c7['body'][_0x1ebf('0x98')];return _0x2d8a38['updateAttributes'](_0x28c86a);}})[_0x1ebf('0x3f')](respondWithResult(_0x3cce51,null))['catch'](handleError(_0x3cce51,null));};function writeFile(_0x80cee0,_0x5d954a){return new Promise(function(_0x47ca19,_0x4cf852){fs[_0x1ebf('0x99')](_0x5d954a,_0x80cee0,function(_0x4a0d59,_0x1efadc){if(_0x4a0d59){return _0x4cf852(_0x4a0d59);}else{return _0x47ca19(_0x1efadc);}});});}exports[_0x1ebf('0x9a')]=function(_0x2e1dff,_0x1a9a06,_0x44e833){return db[_0x1ebf('0x2b')]['findOne']({'where':{'id':_0x2e1dff[_0x1ebf('0x47')]['id']}})[_0x1ebf('0x3f')](handleEntityNotFound(_0x1a9a06))['then'](function(_0x4ba694){if(_0x4ba694&&_0x4ba694[_0x1ebf('0x9b')]){var _0x541268=_0x4ba694['fileText'];var _0x191b59=config[_0x1ebf('0x9c')]+'/server/files/transcribes/transcribe_'+_0x4ba694['id']+_0x1ebf('0x9d');if(fs[_0x1ebf('0x53')](_0x191b59)){return _0x191b59;}return writeFile(_0x541268,_0x191b59)['then'](function(){return _0x191b59;});}else{throw new db[(_0x1ebf('0x56'))][(_0x1ebf('0x57'))](_0x1ebf('0x9e'));}})['then'](function(_0x461744){return _0x1a9a06[_0x1ebf('0x4e')](_0x461744);})[_0x1ebf('0x45')](handleError(_0x1a9a06));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index a66bd6a..418228e 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 _0xc7a3=['VoiceRecording','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x225c06,_0x41054a){var _0xc7fc20=function(_0x3fd34e){while(--_0x3fd34e){_0x225c06['push'](_0x225c06['shift']());}};_0xc7fc20(++_0x41054a);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x161b5a,_0x47244f){_0x161b5a=_0x161b5a-0x0;var _0x19709e=_0xc7a3[_0x161b5a];return _0x19709e;};'use strict';var _=require('lodash');var util=require(_0x3c7a('0x0'));var logger=require(_0x3c7a('0x1'))(_0x3c7a('0x2'));var moment=require(_0x3c7a('0x3'));var BPromise=require(_0x3c7a('0x4'));var rp=require(_0x3c7a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c7a('0x6'));var config=require(_0x3c7a('0x7'));var attributes=require('./voiceRecording.attributes');module[_0x3c7a('0x8')]=function(_0x2051ce,_0x2736c1){return _0x2051ce['define'](_0x3c7a('0x9'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x3c7a('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc838=['path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3e6e94,_0x2fa044){var _0x4365f0=function(_0x54b830){while(--_0x54b830){_0x3e6e94['push'](_0x3e6e94['shift']());}};_0x4365f0(++_0x2fa044);}(_0xc838,0xbd));var _0x8c83=function(_0x3d459f,_0x1c70cd){_0x3d459f=_0x3d459f-0x0;var _0x47e813=_0xc838[_0x3d459f];return _0x47e813;};'use strict';var _=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var logger=require(_0x8c83('0x2'))(_0x8c83('0x3'));var moment=require(_0x8c83('0x4'));var BPromise=require(_0x8c83('0x5'));var rp=require(_0x8c83('0x6'));var fs=require('fs');var path=require(_0x8c83('0x7'));var rimraf=require(_0x8c83('0x8'));var config=require(_0x8c83('0x9'));var attributes=require(_0x8c83('0xa'));module[_0x8c83('0xb')]=function(_0x115e50,_0x3aab2a){return _0x115e50[_0x8c83('0xc')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x8c83('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index ca4e9a7..38b20cb 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 _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x5ec454,_0xfcd77e){var _0x5ebf50=function(_0x29de85){while(--_0x29de85){_0x5ec454['push'](_0x5ec454['shift']());}};_0x5ebf50(++_0xfcd77e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x1f6193,_0x2de9ff){var _0x160297=function(_0x33df3b){while(--_0x33df3b){_0x1f6193['push'](_0x1f6193['shift']());}};_0x160297(++_0x2de9ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'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['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 44b88ed..0896b79 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 _0xc1c6=['show','post','put','/:id','update','delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x447029,_0x50b188){var _0x283046=function(_0x418f4e){while(--_0x418f4e){_0x447029['push'](_0x447029['shift']());}};_0x283046(++_0x50b188);}(_0xc1c6,0xf7));var _0x6c1c=function(_0xd61ad5,_0xc236be){_0xd61ad5=_0xd61ad5-0x0;var _0x4024ab=_0xc1c6[_0xd61ad5];return _0x4024ab;};'use strict';var multer=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var path=require(_0x6c1c('0x2'));var timeout=require('connect-timeout');var express=require(_0x6c1c('0x3'));var router=express['Router']();var auth=require(_0x6c1c('0x4'));var interaction=require(_0x6c1c('0x5'));var config=require(_0x6c1c('0x6'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x6c1c('0x7')](),controller['index']);router[_0x6c1c('0x8')]('/:id',auth[_0x6c1c('0x7')](),controller[_0x6c1c('0x9')]);router[_0x6c1c('0xa')]('/',auth[_0x6c1c('0x7')](),controller['create']);router[_0x6c1c('0xb')](_0x6c1c('0xc'),auth['isAuthenticated'](),controller[_0x6c1c('0xd')]);router[_0x6c1c('0xe')](_0x6c1c('0xc'),auth[_0x6c1c('0x7')](),controller['destroy']);module[_0x6c1c('0xf')]=router; \ No newline at end of file +var _0x2675=['post','put','update','delete','exports','multer','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x3a76c1,_0x129a07){var _0x47591f=function(_0x500a15){while(--_0x500a15){_0x3a76c1['push'](_0x3a76c1['shift']());}};_0x47591f(++_0x129a07);}(_0x2675,0x75));var _0x5267=function(_0x250e6c,_0x3d2ae5){_0x250e6c=_0x250e6c-0x0;var _0xa4d7b4=_0x2675[_0x250e6c];return _0xa4d7b4;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5267('0x3'));var config=require(_0x5267('0x4'));var controller=require('./voiceTransferReport.controller');router[_0x5267('0x5')]('/',auth[_0x5267('0x6')](),controller[_0x5267('0x7')]);router[_0x5267('0x5')](_0x5267('0x8'),auth[_0x5267('0x6')](),controller['show']);router[_0x5267('0x9')]('/',auth[_0x5267('0x6')](),controller['create']);router[_0x5267('0xa')]('/:id',auth[_0x5267('0x6')](),controller[_0x5267('0xb')]);router[_0x5267('0xc')]('/:id',auth[_0x5267('0x6')](),controller['destroy']);module[_0x5267('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 9119834..1288173 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 _0x4601=['Yes','sequelize','moment','ENUM','attended','STRING'];(function(_0x534762,_0x10a0d0){var _0x5e84ab=function(_0x3d3818){while(--_0x3d3818){_0x534762['push'](_0x534762['shift']());}};_0x5e84ab(++_0x10a0d0);}(_0x4601,0x145));var _0x1460=function(_0x48b249,_0xe8a8b3){_0x48b249=_0x48b249-0x0;var _0x352677=_0x4601[_0x48b249];return _0x352677;};'use strict';var Sequelize=require(_0x1460('0x0'));var moment=require(_0x1460('0x1'));module['exports']={'type':{'type':Sequelize[_0x1460('0x2')]('blind',_0x1460('0x3'))},'result':{'type':Sequelize[_0x1460('0x4')]},'transfererchannel':{'type':Sequelize[_0x1460('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x1460('0x4')]},'transferercalleridname':{'type':Sequelize[_0x1460('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1460('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x1460('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x1460('0x4')]},'transfererexten':{'type':Sequelize[_0x1460('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x1460('0x4')]},'transfereechannel':{'type':Sequelize[_0x1460('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x1460('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x1460('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1460('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x1460('0x4')]},'transfereecontext':{'type':Sequelize[_0x1460('0x4')]},'transfereeexten':{'type':Sequelize[_0x1460('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x1460('0x4')]},'isexternal':{'type':Sequelize[_0x1460('0x2')](_0x1460('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4fb6=['moment','exports','ENUM','blind','attended','STRING','Yes','sequelize'];(function(_0x1996ca,_0x8308d){var _0x2205db=function(_0x211005){while(--_0x211005){_0x1996ca['push'](_0x1996ca['shift']());}};_0x2205db(++_0x8308d);}(_0x4fb6,0xaf));var _0x64fb=function(_0x54e6f5,_0x4f4e99){_0x54e6f5=_0x54e6f5-0x0;var _0x5e8794=_0x4fb6[_0x54e6f5];return _0x5e8794;};'use strict';var Sequelize=require(_0x64fb('0x0'));var moment=require(_0x64fb('0x1'));module[_0x64fb('0x2')]={'type':{'type':Sequelize[_0x64fb('0x3')](_0x64fb('0x4'),_0x64fb('0x5'))},'result':{'type':Sequelize[_0x64fb('0x6')]},'transfererchannel':{'type':Sequelize[_0x64fb('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x64fb('0x6')]},'transferercalleridname':{'type':Sequelize[_0x64fb('0x6')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x64fb('0x6')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x64fb('0x6')]},'transfererexten':{'type':Sequelize[_0x64fb('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x64fb('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x64fb('0x6')]},'transfereecalleridname':{'type':Sequelize[_0x64fb('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x64fb('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x64fb('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x64fb('0x6')]},'transfereecontext':{'type':Sequelize[_0x64fb('0x6')]},'transfereeexten':{'type':Sequelize[_0x64fb('0x6')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x64fb('0x3')](_0x64fb('0x7'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x64fb('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index eec86f5..34b2a36 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 _0xb1b8=['then','destroy','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','include','find','catch','create','body','params','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save','update'];(function(_0x4ccb56,_0x436c61){var _0x2e66ac=function(_0x914967){while(--_0x914967){_0x4ccb56['push'](_0x4ccb56['shift']());}};_0x2e66ac(++_0x436c61);}(_0xb1b8,0x6f));var _0x8b1b=function(_0x556b28,_0x46061b){_0x556b28=_0x556b28-0x0;var _0x23bfc1=_0xb1b8[_0x556b28];return _0x23bfc1;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8b1b('0x0'));var jsonpatch=require(_0x8b1b('0x1'));var rp=require(_0x8b1b('0x2'));var moment=require('moment');var BPromise=require(_0x8b1b('0x3'));var Mustache=require(_0x8b1b('0x4'));var util=require(_0x8b1b('0x5'));var path=require(_0x8b1b('0x6'));var sox=require(_0x8b1b('0x7'));var csv=require(_0x8b1b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8b1b('0x9'));var crypto=require(_0x8b1b('0xa'));var jsforce=require(_0x8b1b('0xb'));var deskjs=require(_0x8b1b('0xc'));var toCsv=require(_0x8b1b('0x8'));var querystring=require('querystring');var Papa=require(_0x8b1b('0xd'));var Redis=require(_0x8b1b('0xe'));var authService=require(_0x8b1b('0xf'));var qs=require(_0x8b1b('0x10'));var as=require(_0x8b1b('0x11'));var hardwareService=require(_0x8b1b('0x12'));var logger=require(_0x8b1b('0x13'))('api');var utils=require(_0x8b1b('0x14'));var config=require('../../config/environment');var db=require(_0x8b1b('0x15'))['db'];function respondWithStatusCode(_0x2b7a73,_0x450c0d){_0x450c0d=_0x450c0d||0xcc;return function(_0x885029){if(_0x885029){return _0x2b7a73[_0x8b1b('0x16')](_0x450c0d);}return _0x2b7a73[_0x8b1b('0x17')](_0x450c0d)[_0x8b1b('0x18')]();};}function respondWithResult(_0x31f8f0,_0x5a0eed){_0x5a0eed=_0x5a0eed||0xc8;return function(_0xf0212a){if(_0xf0212a){return _0x31f8f0[_0x8b1b('0x17')](_0x5a0eed)[_0x8b1b('0x19')](_0xf0212a);}};}function respondWithFilteredResult(_0x471c9f,_0xfc93db){return function(_0x10d661){if(_0x10d661){var _0x153048=_0x10d661['count'],_0x3c9907=_0xfc93db['offset'],_0x493d84=_0xfc93db[_0x8b1b('0x1a')]+_0xfc93db[_0x8b1b('0x1b')],_0x5650ad;if(_0x493d84>=_0x153048){_0x493d84=_0x153048;_0x5650ad=0xc8;}else{_0x5650ad=0xce;}_0x471c9f['status'](_0x5650ad);return _0x471c9f['set'](_0x8b1b('0x1c'),_0x3c9907+'-'+_0x493d84+'/'+_0x153048)[_0x8b1b('0x19')](_0x10d661);}return null;};}function patchUpdates(_0x385be2){return function(_0x5b8162){try{jsonpatch[_0x8b1b('0x1d')](_0x5b8162,_0x385be2,!![]);}catch(_0x26aca3){return BPromise[_0x8b1b('0x1e')](_0x26aca3);}return _0x5b8162[_0x8b1b('0x1f')]();};}function saveUpdates(_0x5b8a42,_0x37c5f3){return function(_0xdf4fa3){if(_0xdf4fa3){return _0xdf4fa3[_0x8b1b('0x20')](_0x5b8a42)[_0x8b1b('0x21')](function(_0x4b7a65){return _0x4b7a65;});}return null;};}function removeEntity(_0x35b657,_0x347b55){return function(_0x24bf21){if(_0x24bf21){return _0x24bf21[_0x8b1b('0x22')]()[_0x8b1b('0x21')](function(){_0x35b657[_0x8b1b('0x17')](0xcc)[_0x8b1b('0x18')]();});}};}function handleEntityNotFound(_0x2d1e4d,_0xd3397e){return function(_0x5a1c55){if(!_0x5a1c55){_0x2d1e4d[_0x8b1b('0x16')](0x194);}return _0x5a1c55;};}function handleError(_0x53a65d,_0x520b38){_0x520b38=_0x520b38||0x1f4;return function(_0xb6c239){logger['error'](_0xb6c239[_0x8b1b('0x23')]);if(_0xb6c239[_0x8b1b('0x24')]){delete _0xb6c239['name'];}_0x53a65d[_0x8b1b('0x17')](_0x520b38)[_0x8b1b('0x25')](_0xb6c239);};}exports[_0x8b1b('0x26')]=function(_0xde90ac,_0x55f34b){var _0x55a4e1={},_0x400e9a={},_0x5b59b7={'count':0x0,'rows':[]};var _0x4922cf=_[_0x8b1b('0x27')](db[_0x8b1b('0x28')][_0x8b1b('0x29')],function(_0x179803){return{'name':_0x179803[_0x8b1b('0x2a')],'type':_0x179803[_0x8b1b('0x2b')]['key']};});_0x400e9a[_0x8b1b('0x2c')]=_[_0x8b1b('0x27')](_0x4922cf,_0x8b1b('0x24'));_0x400e9a['query']=_[_0x8b1b('0x2d')](_0xde90ac[_0x8b1b('0x2e')]);_0x400e9a['filters']=_[_0x8b1b('0x2f')](_0x400e9a[_0x8b1b('0x2c')],_0x400e9a[_0x8b1b('0x2e')]);_0x55a4e1[_0x8b1b('0x30')]=_[_0x8b1b('0x2f')](_0x400e9a['model'],qs[_0x8b1b('0x31')](_0xde90ac[_0x8b1b('0x2e')][_0x8b1b('0x31')]));_0x55a4e1[_0x8b1b('0x30')]=_0x55a4e1[_0x8b1b('0x30')][_0x8b1b('0x32')]?_0x55a4e1[_0x8b1b('0x30')]:_0x400e9a['model'];if(!_0xde90ac[_0x8b1b('0x2e')]['hasOwnProperty'](_0x8b1b('0x33'))){_0x55a4e1[_0x8b1b('0x1b')]=qs[_0x8b1b('0x1b')](_0xde90ac[_0x8b1b('0x2e')][_0x8b1b('0x1b')]);_0x55a4e1[_0x8b1b('0x1a')]=qs['offset'](_0xde90ac[_0x8b1b('0x2e')][_0x8b1b('0x1a')]);}_0x55a4e1[_0x8b1b('0x34')]=qs[_0x8b1b('0x35')](_0xde90ac['query'][_0x8b1b('0x35')]);_0x55a4e1[_0x8b1b('0x36')]=qs[_0x8b1b('0x37')](_[_0x8b1b('0x38')](_0xde90ac[_0x8b1b('0x2e')],_0x400e9a[_0x8b1b('0x37')]),_0x4922cf);if(_0xde90ac['query'][_0x8b1b('0x39')]){_0x55a4e1[_0x8b1b('0x36')]=_[_0x8b1b('0x3a')](_0x55a4e1[_0x8b1b('0x36')],{'$or':_[_0x8b1b('0x27')](_0x4922cf,function(_0x4932c7){if(_0x4932c7[_0x8b1b('0x2b')]!==_0x8b1b('0x3b')){var _0x4fd53d={};_0x4fd53d[_0x4932c7[_0x8b1b('0x24')]]={'$like':'%'+_0xde90ac[_0x8b1b('0x2e')][_0x8b1b('0x39')]+'%'};return _0x4fd53d;}})});}_0x55a4e1=_[_0x8b1b('0x3a')]({},_0x55a4e1,_0xde90ac[_0x8b1b('0x3c')]);var _0x142ee0={'where':_0x55a4e1[_0x8b1b('0x36')]};return db[_0x8b1b('0x28')][_0x8b1b('0x3d')](_0x142ee0)[_0x8b1b('0x21')](function(_0x3139a2){_0x5b59b7[_0x8b1b('0x3d')]=_0x3139a2;if(_0xde90ac['query'][_0x8b1b('0x3e')]){_0x55a4e1['include']=[{'all':!![]}];}return db[_0x8b1b('0x28')][_0x8b1b('0x3f')](_0x55a4e1);})['then'](function(_0x589a22){_0x5b59b7[_0x8b1b('0x40')]=_0x589a22;return _0x5b59b7;})['then'](respondWithFilteredResult(_0x55f34b,_0x55a4e1))['catch'](handleError(_0x55f34b,null));};exports[_0x8b1b('0x41')]=function(_0x729461,_0x1ee608){var _0x2ff9d6={'raw':!![],'where':{'id':_0x729461['params']['id']}},_0x2a7719={};_0x2a7719[_0x8b1b('0x2c')]=_['keys'](db[_0x8b1b('0x28')][_0x8b1b('0x29')]);_0x2a7719[_0x8b1b('0x2e')]=_[_0x8b1b('0x2d')](_0x729461[_0x8b1b('0x2e')]);_0x2a7719[_0x8b1b('0x37')]=_[_0x8b1b('0x2f')](_0x2a7719[_0x8b1b('0x2c')],_0x2a7719[_0x8b1b('0x2e')]);_0x2ff9d6[_0x8b1b('0x30')]=_[_0x8b1b('0x2f')](_0x2a7719['model'],qs['fields'](_0x729461['query'][_0x8b1b('0x31')]));_0x2ff9d6[_0x8b1b('0x30')]=_0x2ff9d6['attributes'][_0x8b1b('0x32')]?_0x2ff9d6[_0x8b1b('0x30')]:_0x2a7719[_0x8b1b('0x2c')];if(_0x729461[_0x8b1b('0x2e')]['includeAll']){_0x2ff9d6[_0x8b1b('0x42')]=[{'all':!![]}];}_0x2ff9d6=_[_0x8b1b('0x3a')]({},_0x2ff9d6,_0x729461['options']);return db[_0x8b1b('0x28')][_0x8b1b('0x43')](_0x2ff9d6)['then'](handleEntityNotFound(_0x1ee608,null))[_0x8b1b('0x21')](respondWithResult(_0x1ee608,null))[_0x8b1b('0x44')](handleError(_0x1ee608,null));};exports['create']=function(_0x3e4d4e,_0x1e9081){return db['VoiceTransferReport'][_0x8b1b('0x45')](_0x3e4d4e[_0x8b1b('0x46')],{})['then'](respondWithResult(_0x1e9081,0xc9))['catch'](handleError(_0x1e9081,null));};exports['update']=function(_0x2c8bea,_0x53c9fd){if(_0x2c8bea['body']['id']){delete _0x2c8bea[_0x8b1b('0x46')]['id'];}return db[_0x8b1b('0x28')][_0x8b1b('0x43')]({'where':{'id':_0x2c8bea[_0x8b1b('0x47')]['id']}})[_0x8b1b('0x21')](handleEntityNotFound(_0x53c9fd,null))['then'](saveUpdates(_0x2c8bea[_0x8b1b('0x46')],null))[_0x8b1b('0x21')](respondWithResult(_0x53c9fd,null))[_0x8b1b('0x44')](handleError(_0x53c9fd,null));};exports[_0x8b1b('0x22')]=function(_0x163c2f,_0x2bf355){return db['VoiceTransferReport'][_0x8b1b('0x43')]({'where':{'id':_0x163c2f[_0x8b1b('0x47')]['id']}})['then'](handleEntityNotFound(_0x2bf355,null))[_0x8b1b('0x21')](removeEntity(_0x2bf355,null))['catch'](handleError(_0x2bf355,null));}; \ No newline at end of file +var _0x847c=['reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VoiceTransferReport','count','include','findAll','rows','catch','show','params','keys','includeAll','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','set'];(function(_0xd24b43,_0x11caa4){var _0x2b1b44=function(_0x5b84af){while(--_0x5b84af){_0xd24b43['push'](_0xd24b43['shift']());}};_0x2b1b44(++_0x11caa4);}(_0x847c,0xb8));var _0xc847=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x847c[_0x6cf19c];return _0xce14f3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc847('0x0'));var rimraf=require(_0xc847('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc847('0x2'));var rp=require(_0xc847('0x3'));var moment=require(_0xc847('0x4'));var BPromise=require(_0xc847('0x5'));var Mustache=require(_0xc847('0x6'));var util=require(_0xc847('0x7'));var path=require(_0xc847('0x8'));var sox=require(_0xc847('0x9'));var csv=require(_0xc847('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc847('0xb'));var squel=require(_0xc847('0xc'));var crypto=require(_0xc847('0xd'));var jsforce=require(_0xc847('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc847('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc847('0xf'));var qs=require(_0xc847('0x10'));var as=require(_0xc847('0x11'));var hardwareService=require(_0xc847('0x12'));var logger=require(_0xc847('0x13'))(_0xc847('0x14'));var utils=require(_0xc847('0x15'));var config=require(_0xc847('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x281b4d,_0x18548e){_0x18548e=_0x18548e||0xcc;return function(_0x27745d){if(_0x27745d){return _0x281b4d[_0xc847('0x17')](_0x18548e);}return _0x281b4d[_0xc847('0x18')](_0x18548e)[_0xc847('0x19')]();};}function respondWithResult(_0x582de4,_0x4cfe2e){_0x4cfe2e=_0x4cfe2e||0xc8;return function(_0x4beeb8){if(_0x4beeb8){return _0x582de4[_0xc847('0x18')](_0x4cfe2e)['json'](_0x4beeb8);}};}function respondWithFilteredResult(_0x1adddf,_0x50279e){return function(_0x1c63e8){if(_0x1c63e8){var _0xb0dd9=_0x1c63e8['count'],_0x5d53b0=_0x50279e[_0xc847('0x1a')],_0x4fff22=_0x50279e['offset']+_0x50279e[_0xc847('0x1b')],_0x375db2;if(_0x4fff22>=_0xb0dd9){_0x4fff22=_0xb0dd9;_0x375db2=0xc8;}else{_0x375db2=0xce;}_0x1adddf[_0xc847('0x18')](_0x375db2);return _0x1adddf[_0xc847('0x1c')]('Content-Range',_0x5d53b0+'-'+_0x4fff22+'/'+_0xb0dd9)['json'](_0x1c63e8);}return null;};}function patchUpdates(_0x2dce2a){return function(_0x42b9e9){try{jsonpatch['apply'](_0x42b9e9,_0x2dce2a,!![]);}catch(_0x55c65d){return BPromise[_0xc847('0x1d')](_0x55c65d);}return _0x42b9e9['save']();};}function saveUpdates(_0x108e6a,_0x59359f){return function(_0x2ebd31){if(_0x2ebd31){return _0x2ebd31[_0xc847('0x1e')](_0x108e6a)[_0xc847('0x1f')](function(_0x2b8600){return _0x2b8600;});}return null;};}function removeEntity(_0x58ead0,_0x192b9c){return function(_0x160673){if(_0x160673){return _0x160673[_0xc847('0x20')]()['then'](function(){_0x58ead0[_0xc847('0x18')](0xcc)[_0xc847('0x19')]();});}};}function handleEntityNotFound(_0x1bb801,_0x119473){return function(_0xc66b4b){if(!_0xc66b4b){_0x1bb801[_0xc847('0x17')](0x194);}return _0xc66b4b;};}function handleError(_0x1485b9,_0x469927){_0x469927=_0x469927||0x1f4;return function(_0x415fd7){logger[_0xc847('0x21')](_0x415fd7[_0xc847('0x22')]);if(_0x415fd7[_0xc847('0x23')]){delete _0x415fd7['name'];}_0x1485b9[_0xc847('0x18')](_0x469927)[_0xc847('0x24')](_0x415fd7);};}exports[_0xc847('0x25')]=function(_0x4defd1,_0x1160a9){var _0x9d1ca3={},_0x36cea3={},_0x338cb9={'count':0x0,'rows':[]};var _0x417fcf=_[_0xc847('0x26')](db['VoiceTransferReport'][_0xc847('0x27')],function(_0x3abeb6){return{'name':_0x3abeb6[_0xc847('0x28')],'type':_0x3abeb6[_0xc847('0x29')]['key']};});_0x36cea3[_0xc847('0x2a')]=_[_0xc847('0x26')](_0x417fcf,_0xc847('0x23'));_0x36cea3[_0xc847('0x2b')]=_['keys'](_0x4defd1[_0xc847('0x2b')]);_0x36cea3['filters']=_[_0xc847('0x2c')](_0x36cea3[_0xc847('0x2a')],_0x36cea3[_0xc847('0x2b')]);_0x9d1ca3[_0xc847('0x2d')]=_[_0xc847('0x2c')](_0x36cea3['model'],qs[_0xc847('0x2e')](_0x4defd1[_0xc847('0x2b')][_0xc847('0x2e')]));_0x9d1ca3[_0xc847('0x2d')]=_0x9d1ca3['attributes'][_0xc847('0x2f')]?_0x9d1ca3[_0xc847('0x2d')]:_0x36cea3[_0xc847('0x2a')];if(!_0x4defd1[_0xc847('0x2b')][_0xc847('0x30')](_0xc847('0x31'))){_0x9d1ca3[_0xc847('0x1b')]=qs[_0xc847('0x1b')](_0x4defd1[_0xc847('0x2b')][_0xc847('0x1b')]);_0x9d1ca3[_0xc847('0x1a')]=qs[_0xc847('0x1a')](_0x4defd1[_0xc847('0x2b')][_0xc847('0x1a')]);}_0x9d1ca3[_0xc847('0x32')]=qs[_0xc847('0x33')](_0x4defd1[_0xc847('0x2b')][_0xc847('0x33')]);_0x9d1ca3[_0xc847('0x34')]=qs[_0xc847('0x35')](_[_0xc847('0x36')](_0x4defd1[_0xc847('0x2b')],_0x36cea3[_0xc847('0x35')]),_0x417fcf);if(_0x4defd1[_0xc847('0x2b')][_0xc847('0x37')]){_0x9d1ca3[_0xc847('0x34')]=_[_0xc847('0x38')](_0x9d1ca3[_0xc847('0x34')],{'$or':_[_0xc847('0x26')](_0x417fcf,function(_0x214972){if(_0x214972['type']!=='VIRTUAL'){var _0x14fbb7={};_0x14fbb7[_0x214972['name']]={'$like':'%'+_0x4defd1[_0xc847('0x2b')][_0xc847('0x37')]+'%'};return _0x14fbb7;}})});}_0x9d1ca3=_[_0xc847('0x38')]({},_0x9d1ca3,_0x4defd1['options']);var _0x18e393={'where':_0x9d1ca3[_0xc847('0x34')]};return db[_0xc847('0x39')]['count'](_0x18e393)[_0xc847('0x1f')](function(_0x491d80){_0x338cb9[_0xc847('0x3a')]=_0x491d80;if(_0x4defd1[_0xc847('0x2b')]['includeAll']){_0x9d1ca3[_0xc847('0x3b')]=[{'all':!![]}];}return db[_0xc847('0x39')][_0xc847('0x3c')](_0x9d1ca3);})[_0xc847('0x1f')](function(_0x82db82){_0x338cb9[_0xc847('0x3d')]=_0x82db82;return _0x338cb9;})[_0xc847('0x1f')](respondWithFilteredResult(_0x1160a9,_0x9d1ca3))[_0xc847('0x3e')](handleError(_0x1160a9,null));};exports[_0xc847('0x3f')]=function(_0x4434d8,_0x1836b8){var _0x4d682c={'raw':!![],'where':{'id':_0x4434d8[_0xc847('0x40')]['id']}},_0x584e14={};_0x584e14[_0xc847('0x2a')]=_[_0xc847('0x41')](db[_0xc847('0x39')][_0xc847('0x27')]);_0x584e14[_0xc847('0x2b')]=_['keys'](_0x4434d8[_0xc847('0x2b')]);_0x584e14[_0xc847('0x35')]=_[_0xc847('0x2c')](_0x584e14[_0xc847('0x2a')],_0x584e14[_0xc847('0x2b')]);_0x4d682c[_0xc847('0x2d')]=_[_0xc847('0x2c')](_0x584e14['model'],qs['fields'](_0x4434d8[_0xc847('0x2b')]['fields']));_0x4d682c[_0xc847('0x2d')]=_0x4d682c['attributes'][_0xc847('0x2f')]?_0x4d682c[_0xc847('0x2d')]:_0x584e14[_0xc847('0x2a')];if(_0x4434d8[_0xc847('0x2b')][_0xc847('0x42')]){_0x4d682c[_0xc847('0x3b')]=[{'all':!![]}];}_0x4d682c=_['merge']({},_0x4d682c,_0x4434d8[_0xc847('0x43')]);return db[_0xc847('0x39')][_0xc847('0x44')](_0x4d682c)[_0xc847('0x1f')](handleEntityNotFound(_0x1836b8,null))[_0xc847('0x1f')](respondWithResult(_0x1836b8,null))[_0xc847('0x3e')](handleError(_0x1836b8,null));};exports[_0xc847('0x45')]=function(_0x3aea09,_0x3b0b60){return db[_0xc847('0x39')][_0xc847('0x45')](_0x3aea09[_0xc847('0x46')],{})[_0xc847('0x1f')](respondWithResult(_0x3b0b60,0xc9))[_0xc847('0x3e')](handleError(_0x3b0b60,null));};exports[_0xc847('0x1e')]=function(_0x3daf4a,_0x50a7e2){if(_0x3daf4a[_0xc847('0x46')]['id']){delete _0x3daf4a[_0xc847('0x46')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x3daf4a[_0xc847('0x40')]['id']}})[_0xc847('0x1f')](handleEntityNotFound(_0x50a7e2,null))[_0xc847('0x1f')](saveUpdates(_0x3daf4a['body'],null))[_0xc847('0x1f')](respondWithResult(_0x50a7e2,null))[_0xc847('0x3e')](handleError(_0x50a7e2,null));};exports[_0xc847('0x20')]=function(_0x59a1de,_0x268a6e){return db[_0xc847('0x39')][_0xc847('0x44')]({'where':{'id':_0x59a1de[_0xc847('0x40')]['id']}})[_0xc847('0x1f')](handleEntityNotFound(_0x268a6e,null))[_0xc847('0x1f')](removeEntity(_0x268a6e,null))[_0xc847('0x3e')](handleError(_0x268a6e,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index a943ffb..9dfe600 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 _0xd5dc=['request-promise','path','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','api','moment','bluebird'];(function(_0x1dc708,_0x293d95){var _0x415967=function(_0x529795){while(--_0x529795){_0x1dc708['push'](_0x1dc708['shift']());}};_0x415967(++_0x293d95);}(_0xd5dc,0x187));var _0xcd5d=function(_0x56e663,_0x3852d2){_0x56e663=_0x56e663-0x0;var _0x59fa0b=_0xd5dc[_0x56e663];return _0x59fa0b;};'use strict';var _=require(_0xcd5d('0x0'));var util=require(_0xcd5d('0x1'));var logger=require('../../config/logger')(_0xcd5d('0x2'));var moment=require(_0xcd5d('0x3'));var BPromise=require(_0xcd5d('0x4'));var rp=require(_0xcd5d('0x5'));var fs=require('fs');var path=require(_0xcd5d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcd5d('0x7'));module[_0xcd5d('0x8')]=function(_0x4f928f,_0x2ecab6){return _0x4f928f[_0xcd5d('0x9')](_0xcd5d('0xa'),attributes,{'tableName':_0xcd5d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ed5=['lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./voiceTransferReport.attributes','VoiceTransferReport','report_call_transfer'];(function(_0x4f4715,_0x3cb040){var _0x471eb3=function(_0x2dc636){while(--_0x2dc636){_0x4f4715['push'](_0x4f4715['shift']());}};_0x471eb3(++_0x3cb040);}(_0x4ed5,0xe1));var _0x54ed=function(_0x41caee,_0x541d6f){_0x41caee=_0x41caee-0x0;var _0xbf33c3=_0x4ed5[_0x41caee];return _0xbf33c3;};'use strict';var _=require(_0x54ed('0x0'));var util=require(_0x54ed('0x1'));var logger=require(_0x54ed('0x2'))('api');var moment=require('moment');var BPromise=require(_0x54ed('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x54ed('0x4'));var config=require(_0x54ed('0x5'));var attributes=require(_0x54ed('0x6'));module['exports']=function(_0xde5ce,_0x25971b){return _0xde5ce['define'](_0x54ed('0x7'),attributes,{'tableName':_0x54ed('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 6038c3d..d528128 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 _0x88b5=['stringify','code','error','message','result','catch','VoiceTransferReport','create','body','options','raw','then','CreateVoiceTransferReport','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4141c8,_0x30ad1c){var _0x5e0162=function(_0x5455f3){while(--_0x5455f3){_0x4141c8['push'](_0x4141c8['shift']());}};_0x5e0162(++_0x30ad1c);}(_0x88b5,0xa3));var _0x588b=function(_0x30cabe,_0x9f7b7b){_0x30cabe=_0x30cabe-0x0;var _0xb4d909=_0x88b5[_0x30cabe];return _0xb4d909;};'use strict';var _=require('lodash');var util=require(_0x588b('0x0'));var moment=require('moment');var BPromise=require(_0x588b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x588b('0x2'));var db=require(_0x588b('0x3'))['db'];var utils=require(_0x588b('0x4'));var logger=require(_0x588b('0x5'))(_0x588b('0x6'));var config=require(_0x588b('0x7'));var jayson=require(_0x588b('0x8'));var client=jayson[_0x588b('0x9')][_0x588b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27470f,_0x5360c7,_0x4fac4c){return new BPromise(function(_0x15e349,_0x55d34b){return client[_0x588b('0xb')](_0x27470f,_0x4fac4c)['then'](function(_0x3cdff8){logger[_0x588b('0xc')](_0x588b('0xd'),_0x5360c7,_0x588b('0xe'));logger[_0x588b('0xf')](_0x588b('0x10'),_0x5360c7,_0x588b('0xe'),JSON[_0x588b('0x11')](_0x3cdff8));if(_0x3cdff8['error']){if(_0x3cdff8['error'][_0x588b('0x12')]===0x1f4){logger[_0x588b('0x13')](_0x588b('0xd'),_0x5360c7,_0x3cdff8['error'][_0x588b('0x14')]);return _0x55d34b(_0x3cdff8[_0x588b('0x13')]['message']);}logger[_0x588b('0x13')](_0x588b('0xd'),_0x5360c7,_0x3cdff8['error'][_0x588b('0x14')]);return _0x15e349(_0x3cdff8[_0x588b('0x13')]['message']);}else{logger[_0x588b('0xc')](_0x588b('0xd'),_0x5360c7,_0x588b('0xe'));_0x15e349(_0x3cdff8[_0x588b('0x15')][_0x588b('0x14')]);}})[_0x588b('0x16')](function(_0xb3fb96){logger[_0x588b('0x13')]('VoiceTransferReport,\x20%s,\x20%s',_0x5360c7,_0xb3fb96);_0x55d34b(_0xb3fb96);});});}exports['CreateVoiceTransferReport']=function(_0x1fee15){var _0x26e688=this;return new Promise(function(_0x2439cc,_0x285d8f){return db[_0x588b('0x17')][_0x588b('0x18')](_0x1fee15[_0x588b('0x19')],{'raw':_0x1fee15['options']?_0x1fee15[_0x588b('0x1a')][_0x588b('0x1b')]===undefined?!![]:![]:!![]})[_0x588b('0x1c')](function(_0xd4486e){logger[_0x588b('0xc')](_0x588b('0x1d'),_0x1fee15);logger[_0x588b('0xf')](_0x588b('0x1d'),_0x1fee15,JSON[_0x588b('0x11')](_0xd4486e));_0x2439cc(_0xd4486e);})[_0x588b('0x16')](function(_0x3e841c){logger['error'](_0x588b('0x1d'),_0x3e841c[_0x588b('0x14')],_0x1fee15);_0x285d8f(_0x26e688[_0x588b('0x13')](0x1f4,_0x3e841c[_0x588b('0x14')]));});});}; \ No newline at end of file +var _0xe167=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','VoiceTransferReport','body','options','CreateVoiceTransferReport','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3346ea,_0x396b3f){var _0x2c55b7=function(_0x9f908b){while(--_0x9f908b){_0x3346ea['push'](_0x3346ea['shift']());}};_0x2c55b7(++_0x396b3f);}(_0xe167,0x9c));var _0x7e16=function(_0x4dab96,_0x170028){_0x4dab96=_0x4dab96-0x0;var _0x2e78bf=_0xe167[_0x4dab96];return _0x2e78bf;};'use strict';var _=require(_0x7e16('0x0'));var util=require('util');var moment=require(_0x7e16('0x1'));var BPromise=require(_0x7e16('0x2'));var rs=require(_0x7e16('0x3'));var fs=require('fs');var Redis=require(_0x7e16('0x4'));var db=require(_0x7e16('0x5'))['db'];var utils=require(_0x7e16('0x6'));var logger=require(_0x7e16('0x7'))('rpc');var config=require(_0x7e16('0x8'));var jayson=require(_0x7e16('0x9'));var client=jayson['client'][_0x7e16('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x510931,_0xcdc0b,_0x34e7a7){return new BPromise(function(_0x17bf5a,_0x1703af){return client[_0x7e16('0xb')](_0x510931,_0x34e7a7)[_0x7e16('0xc')](function(_0x163082){logger[_0x7e16('0xd')](_0x7e16('0xe'),_0xcdc0b,_0x7e16('0xf'));logger[_0x7e16('0x10')](_0x7e16('0x11'),_0xcdc0b,'request\x20sent',JSON['stringify'](_0x163082));if(_0x163082[_0x7e16('0x12')]){if(_0x163082['error'][_0x7e16('0x13')]===0x1f4){logger[_0x7e16('0x12')](_0x7e16('0xe'),_0xcdc0b,_0x163082['error'][_0x7e16('0x14')]);return _0x1703af(_0x163082[_0x7e16('0x12')]['message']);}logger[_0x7e16('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0xcdc0b,_0x163082['error'][_0x7e16('0x14')]);return _0x17bf5a(_0x163082[_0x7e16('0x12')][_0x7e16('0x14')]);}else{logger[_0x7e16('0xd')](_0x7e16('0xe'),_0xcdc0b,'request\x20sent');_0x17bf5a(_0x163082[_0x7e16('0x15')]['message']);}})['catch'](function(_0x322ec1){logger[_0x7e16('0x12')](_0x7e16('0xe'),_0xcdc0b,_0x322ec1);_0x1703af(_0x322ec1);});});}exports['CreateVoiceTransferReport']=function(_0x445a81){var _0x45c66c=this;return new Promise(function(_0x1421de,_0x57b3d9){return db[_0x7e16('0x16')]['create'](_0x445a81[_0x7e16('0x17')],{'raw':_0x445a81[_0x7e16('0x18')]?_0x445a81[_0x7e16('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x7e16('0xc')](function(_0x164da2){logger[_0x7e16('0xd')]('CreateVoiceTransferReport',_0x445a81);logger[_0x7e16('0x10')](_0x7e16('0x19'),_0x445a81,JSON[_0x7e16('0x1a')](_0x164da2));_0x1421de(_0x164da2);})['catch'](function(_0x50c9ce){logger['error'](_0x7e16('0x19'),_0x50c9ce[_0x7e16('0x14')],_0x445a81);_0x57b3d9(_0x45c66c[_0x7e16('0x12')](0x1f4,_0x50c9ce[_0x7e16('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 2373e89..4209c08 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 _0x22fb=['transfer','exports','../../components/auth/service','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer','/hold','hold','/unhold','/transfer'];(function(_0x50811d,_0x17d91c){var _0x4f1582=function(_0x8450cc){while(--_0x8450cc){_0x50811d['push'](_0x50811d['shift']());}};_0x4f1582(++_0x17d91c);}(_0x22fb,0x192));var _0xb22f=function(_0x4312f4,_0x49392a){_0x4312f4=_0x4312f4-0x0;var _0x2858cf=_0x22fb[_0x4312f4];return _0x2858cf;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xb22f('0x0'));var controller=require('./webbar.controller');router[_0xb22f('0x1')](_0xb22f('0x2'),auth[_0xb22f('0x3')](),auth[_0xb22f('0x4')](),controller[_0xb22f('0x5')]);router['post'](_0xb22f('0x6'),auth[_0xb22f('0x3')](),auth[_0xb22f('0x4')](),controller[_0xb22f('0x7')]);router[_0xb22f('0x1')](_0xb22f('0x8'),auth['isAuthenticated'](),auth[_0xb22f('0x4')](),controller[_0xb22f('0x9')]);router[_0xb22f('0x1')](_0xb22f('0xa'),auth[_0xb22f('0x3')](),auth[_0xb22f('0x4')](),controller[_0xb22f('0xb')]);router[_0xb22f('0x1')](_0xb22f('0xc'),auth[_0xb22f('0x3')](),auth[_0xb22f('0x4')](),controller['unhold']);router['post']('/calls',auth[_0xb22f('0x3')](),auth['canUpdate'](),controller['calls']);router['post'](_0xb22f('0xd'),auth[_0xb22f('0x3')](),auth[_0xb22f('0x4')](),controller[_0xb22f('0xe')]);module[_0xb22f('0xf')]=router; \ No newline at end of file +var _0x37dc=['canUpdate','hangup','post','/answer','isAuthenticated','answer','/hold','hold','/unhold','unhold','calls','/transfer','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x37dc,0x1e9));var _0xc37d=function(_0x1ab2cf,_0x529fe3){_0x1ab2cf=_0x1ab2cf-0x0;var _0x1604d6=_0x37dc[_0x1ab2cf];return _0x1604d6;};'use strict';var express=require(_0xc37d('0x0'));var router=express[_0xc37d('0x1')]();var auth=require(_0xc37d('0x2'));var controller=require(_0xc37d('0x3'));router['post'](_0xc37d('0x4'),auth['isAuthenticated'](),auth[_0xc37d('0x5')](),controller['originate']);router['post']('/hangup',auth['isAuthenticated'](),auth[_0xc37d('0x5')](),controller[_0xc37d('0x6')]);router[_0xc37d('0x7')](_0xc37d('0x8'),auth[_0xc37d('0x9')](),auth[_0xc37d('0x5')](),controller[_0xc37d('0xa')]);router[_0xc37d('0x7')](_0xc37d('0xb'),auth['isAuthenticated'](),auth[_0xc37d('0x5')](),controller[_0xc37d('0xc')]);router['post'](_0xc37d('0xd'),auth[_0xc37d('0x9')](),auth['canUpdate'](),controller[_0xc37d('0xe')]);router[_0xc37d('0x7')]('/calls',auth[_0xc37d('0x9')](),auth[_0xc37d('0x5')](),controller[_0xc37d('0xf')]);router[_0xc37d('0x7')](_0xc37d('0x10'),auth[_0xc37d('0x9')](),auth[_0xc37d('0x5')](),controller[_0xc37d('0x11')]);module[_0xc37d('0x12')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index c0b777b..3e51e5e 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 _0x0a34=['http','../../config/logger','ioredis','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','transferNumber\x20is\x20required','info','emit','log','handleError:','stack','name','status','send','NotFound','then','error','code','result','catch','User','findOne','VoiceChannels','filter','rows','UserId','sessionId','length','sessionId\x20','originate','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../config/environment','util','bluebird','client'];(function(_0x2c7f9e,_0x22c786){var _0x5f37b9=function(_0x4c4e51){while(--_0x4c4e51){_0x2c7f9e['push'](_0x2c7f9e['shift']());}};_0x5f37b9(++_0x22c786);}(_0x0a34,0x12a));var _0x40a3=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x0a34[_0x3c8e9a];return _0x2d4c57;};'use strict';var path=require(_0x40a3('0x0'));var fs=require('fs');var _=require(_0x40a3('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x40a3('0x2'));var util=require(_0x40a3('0x3'));var BPromise=require(_0x40a3('0x4'));var jayson=require('jayson/promise');var amiClient=jayson[_0x40a3('0x5')][_0x40a3('0x6')]({'port':0x232a});var logger=require(_0x40a3('0x7'))('webbarapi');var Redis=require(_0x40a3('0x8'));config[_0x40a3('0x9')]=_[_0x40a3('0xa')](config[_0x40a3('0x9')],{'host':_0x40a3('0xb'),'port':0x18eb});var io=require(_0x40a3('0xc'))(new Redis(config['redis']));var Schema=require(_0x40a3('0xd'));var originateValidation=new Schema({'userId':{'type':_0x40a3('0xe'),'required':[!![],_0x40a3('0xf')]},'callNumber':{'type':_0x40a3('0x10'),'required':[!![],_0x40a3('0x11')]},'callerId':{'type':_0x40a3('0x10')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x40a3('0xe'),'required':[!![],_0x40a3('0xf')]},'sessionId':{'type':_0x40a3('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x40a3('0xf')]},'sessionId':{'type':_0x40a3('0x10'),'required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x40a3('0xf')]},'sessionId':{'type':_0x40a3('0x10'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x40a3('0x10'),'required':[!![],_0x40a3('0x12')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x40a3('0xf')]},'sessionId':{'type':_0x40a3('0x10'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x40a3('0xe'),'required':[!![],_0x40a3('0xf')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x40a3('0xe'),'required':[!![],_0x40a3('0xf')]}});function emit(_0x20d6cf,_0x54c3f4,_0x5b5227){logger[_0x40a3('0x13')](_0x20d6cf,_0x54c3f4,JSON['stringify'](_0x5b5227));io['to'](_0x20d6cf)[_0x40a3('0x14')](_0x54c3f4,_0x5b5227);}function handleError(_0x20df02){return function(_0x31aef5){console[_0x40a3('0x15')](_0x40a3('0x16'),_0x31aef5,_0x31aef5 instanceof RangeError);logger['error'](_0x31aef5[_0x40a3('0x17')]);if(_0x31aef5 instanceof RangeError){if(_0x31aef5[_0x40a3('0x18')]){delete _0x31aef5[_0x40a3('0x18')];}_0x20df02[_0x40a3('0x19')](0x194)[_0x40a3('0x1a')](_0x31aef5);}else{if(_0x31aef5[_0x40a3('0x18')]){delete _0x31aef5[_0x40a3('0x18')];}_0x20df02[_0x40a3('0x19')](0x1f4)[_0x40a3('0x1a')](_0x31aef5);}};}function checkError(){return function(_0x139241){if(!_0x139241){throw new RangeError(_0x40a3('0x1b'));}return _0x139241;};}function respondWithRpcPromise(_0x18a01d,_0x285aff){return new BPromise(function(_0x1416d2,_0x1dbc00){var _0x1daace=amiClient;return _0x1daace['request'](_0x18a01d,_0x285aff)[_0x40a3('0x1c')](function(_0x46fbbe){if(_0x46fbbe[_0x40a3('0x1d')]){if(_0x46fbbe[_0x40a3('0x1d')][_0x40a3('0x1e')]===0x1f4){return _0x1dbc00(_0x46fbbe[_0x40a3('0x1d')]['message']);}return _0x1416d2(_0x46fbbe[_0x40a3('0x1d')]['message']);}else{_0x1416d2(_0x46fbbe[_0x40a3('0x1f')]);}})[_0x40a3('0x20')](function(_0x5a9b6f){_0x1dbc00(_0x5a9b6f);});});}function getAgent(_0x12c06f){return db[_0x40a3('0x21')][_0x40a3('0x22')]({'where':{'id':_0x12c06f,'role':'agent'}})[_0x40a3('0x1c')](checkError());}function getAgentCheckSession(_0x3fc059,_0x966c){return new BPromise(function(_0x4456f1,_0x1e4946){var _0x1aca83=respondWithRpcPromise(_0x40a3('0x23'));var _0x3d50d7=getAgent(_0x3fc059);Promise['all']([_0x1aca83,_0x3d50d7])['then'](function(_0x355a8f){var _0x4a7fd8=_0x355a8f[0x0];var _0x58beaf=_0x355a8f[0x1];var _0x1098d3=_[_0x40a3('0x24')](_0x4a7fd8[_0x40a3('0x25')],function(_0x4fdf27){return _0x4fdf27[_0x40a3('0x26')]==_0x58beaf['id']&&_0x4fdf27[_0x40a3('0x27')]==_0x966c;});if(_0x1098d3[_0x40a3('0x28')]==0x1){_0x4456f1(_0x58beaf);}else{_0x1e4946(new RangeError(_0x40a3('0x29')+_0x966c+'\x20not\x20found!'));}});});}exports[_0x40a3('0x2a')]=function(_0x15f586,_0x444a43){logger[_0x40a3('0x13')](_0x40a3('0x2b'),_0x15f586[_0x40a3('0x2c')]);var _0x2e782d=originateValidation[_0x40a3('0xd')](_0x15f586[_0x40a3('0x2c')]);if(_0x2e782d[_0x40a3('0x28')]>0x0){return _0x444a43[_0x40a3('0x19')](0x190)[_0x40a3('0x2d')](_0x2e782d);}var _0xd23352=_0x15f586[_0x40a3('0x2c')][_0x40a3('0x2e')];var _0x2b53a6=_0x15f586[_0x40a3('0x2c')][_0x40a3('0x2f')];var _0x2e8154=_0x15f586[_0x40a3('0x2c')][_0x40a3('0x30')];var _0x15fa60=_0x15f586[_0x40a3('0x2c')][_0x40a3('0x31')];return getAgent(_0xd23352)['then'](function(_0x3e7fd7){logger[_0x40a3('0x13')](_0x40a3('0x32'),_0x3e7fd7[_0x40a3('0x18')]);emit(util[_0x40a3('0x33')](_0x40a3('0x34'),_0x3e7fd7[_0x40a3('0x18')]),'webbar:originate',{'callNumber':_0x2b53a6,'callerId':_0x2e8154,'callbackUrl':_0x15fa60});return _0x444a43[_0x40a3('0x19')](0xc8)[_0x40a3('0x2d')]({'error':![],'message':_0x40a3('0x35')});})['catch'](handleError(_0x444a43));};exports[_0x40a3('0x36')]=function(_0x867830,_0x1dd805){logger[_0x40a3('0x13')](_0x40a3('0x37'),_0x867830[_0x40a3('0x2c')]);var _0x20fdea=hangupValidation[_0x40a3('0xd')](_0x867830['body']);if(_0x20fdea['length']>0x0){return _0x1dd805[_0x40a3('0x19')](0x190)[_0x40a3('0x2d')](_0x20fdea);}var _0x3492fd=_0x867830[_0x40a3('0x2c')]['userId'];var _0x4353bb=_0x867830[_0x40a3('0x2c')][_0x40a3('0x27')];return getAgent(_0x3492fd)[_0x40a3('0x1c')](function(_0x19d2dc){logger[_0x40a3('0x13')](_0x40a3('0x32'),_0x19d2dc['name']);emit(util[_0x40a3('0x33')](_0x40a3('0x34'),_0x19d2dc[_0x40a3('0x18')]),_0x40a3('0x38'),{'sessionId':_0x4353bb});return _0x1dd805[_0x40a3('0x19')](0xc8)[_0x40a3('0x2d')]({'error':![],'message':_0x40a3('0x39')});})[_0x40a3('0x20')](handleError(_0x1dd805));};exports[_0x40a3('0x3a')]=function(_0x2e3136,_0x3f8ee1){logger[_0x40a3('0x13')]('answer\x20fired:',_0x2e3136[_0x40a3('0x2c')]);var _0x289989=answerValidation[_0x40a3('0xd')](_0x2e3136[_0x40a3('0x2c')]);if(_0x289989[_0x40a3('0x28')]>0x0){return _0x3f8ee1[_0x40a3('0x19')](0x190)['json'](_0x289989);}var _0x340304=_0x2e3136[_0x40a3('0x2c')]['userId'];var _0x57f2e9=_0x2e3136[_0x40a3('0x2c')][_0x40a3('0x27')];return getAgent(_0x340304)[_0x40a3('0x1c')](function(_0x170e0d){logger[_0x40a3('0x13')]('entityFound:',_0x170e0d[_0x40a3('0x18')]);emit(util['format'](_0x40a3('0x34'),_0x170e0d[_0x40a3('0x18')]),_0x40a3('0x3b'),{'sessionId':_0x57f2e9});return _0x3f8ee1[_0x40a3('0x19')](0xc8)[_0x40a3('0x2d')]({'error':![],'message':_0x40a3('0x3c')});})[_0x40a3('0x20')](handleError(_0x3f8ee1));};exports[_0x40a3('0x3d')]=function(_0x47ae75,_0x21c06b){logger[_0x40a3('0x13')](_0x40a3('0x3e'),_0x47ae75['body']);var _0x568c8f=holdValidation[_0x40a3('0xd')](_0x47ae75[_0x40a3('0x2c')]);if(_0x568c8f[_0x40a3('0x28')]>0x0){return _0x21c06b[_0x40a3('0x19')](0x190)['json'](_0x568c8f);}var _0x24798f=_0x47ae75[_0x40a3('0x2c')][_0x40a3('0x2e')];var _0x24f20d=_0x47ae75['body'][_0x40a3('0x27')];return getAgent(_0x24798f)[_0x40a3('0x1c')](function(_0x12889d){logger[_0x40a3('0x13')](_0x40a3('0x32'),_0x12889d[_0x40a3('0x18')]);emit(util[_0x40a3('0x33')]('user:%s',_0x12889d[_0x40a3('0x18')]),_0x40a3('0x3f'),{'sessionId':_0x24f20d});return _0x21c06b['status'](0xc8)[_0x40a3('0x2d')]({'error':![],'message':'hold\x20executed!'});})[_0x40a3('0x20')](handleError(_0x21c06b));};exports['unhold']=function(_0x2a9bd1,_0x3eda1b){logger['info']('unhold\x20fired:',_0x2a9bd1[_0x40a3('0x2c')]);var _0x3ccb0f=unholdValidation[_0x40a3('0xd')](_0x2a9bd1[_0x40a3('0x2c')]);if(_0x3ccb0f[_0x40a3('0x28')]>0x0){return _0x3eda1b[_0x40a3('0x19')](0x190)[_0x40a3('0x2d')](_0x3ccb0f);}var _0x377157=_0x2a9bd1[_0x40a3('0x2c')][_0x40a3('0x2e')];var _0x18c50d=_0x2a9bd1[_0x40a3('0x2c')]['sessionId'];return getAgent(_0x377157)[_0x40a3('0x1c')](function(_0x40690e){logger[_0x40a3('0x13')](_0x40a3('0x32'),_0x40690e['name']);emit(util[_0x40a3('0x33')]('user:%s',_0x40690e[_0x40a3('0x18')]),'webbar:unhold',{'sessionId':_0x18c50d});return _0x3eda1b['status'](0xc8)['json']({'error':![],'message':_0x40a3('0x40')});})[_0x40a3('0x20')](handleError(_0x3eda1b));};exports[_0x40a3('0x41')]=function(_0x3405ff,_0xe892c2){logger[_0x40a3('0x13')](_0x40a3('0x42'),_0xe892c2[_0x40a3('0x2c')]);var _0x4ed27b=callsValidation['validate'](_0x3405ff['body']);if(_0x4ed27b[_0x40a3('0x28')]>0x0){return _0xe892c2[_0x40a3('0x19')](0x190)[_0x40a3('0x2d')](_0x4ed27b);}var _0x4794f9=_0x3405ff[_0x40a3('0x2c')]['userId'];var _0x5dff9e=respondWithRpcPromise(_0x40a3('0x23'));var _0x3df7e2=getAgent(_0x4794f9);return Promise[_0x40a3('0x43')]([_0x5dff9e,_0x3df7e2])[_0x40a3('0x1c')](function(_0xfb011a){var _0x51d53f=_0xfb011a[0x0];var _0x174cea=_0xfb011a[0x1];var _0x3e4372=_[_0x40a3('0x24')](_0x51d53f[_0x40a3('0x25')],function(_0x1efc5a){return _0x1efc5a[_0x40a3('0x26')]==_0x174cea['id'];});return _0xe892c2[_0x40a3('0x19')](0xc8)[_0x40a3('0x2d')]({'count':_0x3e4372[_0x40a3('0x28')],'rows':_0x3e4372});})['catch'](handleError(_0xe892c2));};exports[_0x40a3('0x44')]=function(_0x3f9a37,_0x52cf4d){logger[_0x40a3('0x13')](_0x40a3('0x45'),_0x3f9a37['body']);var _0x328c36=conferenceValidation[_0x40a3('0xd')](_0x3f9a37[_0x40a3('0x2c')]);if(_0x328c36[_0x40a3('0x28')]>0x0){return _0x52cf4d[_0x40a3('0x19')](0x190)['json'](_0x328c36);}var _0x5a8855=_0x3f9a37[_0x40a3('0x2c')][_0x40a3('0x2e')];return getAgent(_0x5a8855)['then'](function(_0x411280){logger['info'](_0x40a3('0x32'),_0x411280[_0x40a3('0x18')]);emit(util[_0x40a3('0x33')](_0x40a3('0x34'),_0x411280[_0x40a3('0x18')]),_0x40a3('0x46'));return _0x52cf4d[_0x40a3('0x19')](0xc8)[_0x40a3('0x2d')]({'error':![],'message':_0x40a3('0x47')});})['catch'](handleError(_0x52cf4d));};exports[_0x40a3('0x48')]=function(_0x19618b,_0x2b8904){logger[_0x40a3('0x13')](_0x40a3('0x49'),_0x19618b[_0x40a3('0x2c')]);var _0x1e2249=transferValidation['validate'](_0x19618b['body']);if(_0x1e2249[_0x40a3('0x28')]>0x0){return _0x2b8904['status'](0x190)[_0x40a3('0x2d')](_0x1e2249);}var _0x16ab72=_0x19618b[_0x40a3('0x2c')][_0x40a3('0x2e')];var _0x31a342=_0x19618b['body'][_0x40a3('0x27')];var _0x4f57ef=_0x19618b[_0x40a3('0x2c')][_0x40a3('0x4a')];return getAgent(_0x16ab72)[_0x40a3('0x1c')](function(_0x30333e){logger[_0x40a3('0x13')](_0x40a3('0x32'),_0x30333e[_0x40a3('0x18')]);emit(util[_0x40a3('0x33')](_0x40a3('0x34'),_0x30333e[_0x40a3('0x18')]),_0x40a3('0x4b'),{'sessionId':_0x31a342,'transferNumber':_0x4f57ef});return _0x2b8904[_0x40a3('0x19')](0xc8)['json']({'error':![],'message':'transfer\x20executed!'});})[_0x40a3('0x20')](handleError(_0x2b8904));}; \ No newline at end of file +var _0x130d=['transferNumber\x20is\x20required','stringify','emit','log','handleError:','error','stack','status','send','name','NotFound','request','then','code','message','result','catch','User','agent','VoiceChannels','all','filter','sessionId','length','sessionId\x20','originate','info','originate\x20fired:','validate','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','unhold','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','number','string','callNumber\x20is\x20required','userId\x20is\x20required','sessionId\x20is\x20required'];(function(_0x248a1a,_0x14cd21){var _0x225074=function(_0x37609e){while(--_0x37609e){_0x248a1a['push'](_0x248a1a['shift']());}};_0x225074(++_0x14cd21);}(_0x130d,0x125));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xd130('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xd130('0x1'))['db'];var config=require('../../config/environment');var util=require(_0xd130('0x2'));var BPromise=require(_0xd130('0x3'));var jayson=require(_0xd130('0x4'));var amiClient=jayson[_0xd130('0x5')][_0xd130('0x6')]({'port':0x232a});var logger=require(_0xd130('0x7'))(_0xd130('0x8'));var Redis=require(_0xd130('0x9'));config[_0xd130('0xa')]=_[_0xd130('0xb')](config[_0xd130('0xa')],{'host':_0xd130('0xc'),'port':0x18eb});var io=require(_0xd130('0xd'))(new Redis(config[_0xd130('0xa')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xd130('0xe'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xd130('0xf'),'required':[!![],_0xd130('0x10')]},'callerId':{'type':_0xd130('0xf')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xd130('0xe'),'required':[!![],_0xd130('0x11')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd130('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xd130('0xe'),'required':[!![],_0xd130('0x11')]},'sessionId':{'type':'string','required':[!![],_0xd130('0x12')]},'transferNumber':{'type':_0xd130('0xf'),'required':[!![],_0xd130('0x13')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xd130('0xe'),'required':[!![],_0xd130('0x11')]},'sessionId':{'type':_0xd130('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xd130('0xe'),'required':[!![],_0xd130('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xd130('0x11')]}});function emit(_0x3a59de,_0x1f96e0,_0x15bcac){logger['info'](_0x3a59de,_0x1f96e0,JSON[_0xd130('0x14')](_0x15bcac));io['to'](_0x3a59de)[_0xd130('0x15')](_0x1f96e0,_0x15bcac);}function handleError(_0x320e06){return function(_0xce6d93){console[_0xd130('0x16')](_0xd130('0x17'),_0xce6d93,_0xce6d93 instanceof RangeError);logger[_0xd130('0x18')](_0xce6d93[_0xd130('0x19')]);if(_0xce6d93 instanceof RangeError){if(_0xce6d93['name']){delete _0xce6d93['name'];}_0x320e06[_0xd130('0x1a')](0x194)[_0xd130('0x1b')](_0xce6d93);}else{if(_0xce6d93[_0xd130('0x1c')]){delete _0xce6d93['name'];}_0x320e06[_0xd130('0x1a')](0x1f4)[_0xd130('0x1b')](_0xce6d93);}};}function checkError(){return function(_0x3c93d3){if(!_0x3c93d3){throw new RangeError(_0xd130('0x1d'));}return _0x3c93d3;};}function respondWithRpcPromise(_0x6e57b3,_0x21e1a4){return new BPromise(function(_0x4e5860,_0x311c3a){var _0x331b1a=amiClient;return _0x331b1a[_0xd130('0x1e')](_0x6e57b3,_0x21e1a4)[_0xd130('0x1f')](function(_0x3faa63){if(_0x3faa63[_0xd130('0x18')]){if(_0x3faa63[_0xd130('0x18')][_0xd130('0x20')]===0x1f4){return _0x311c3a(_0x3faa63[_0xd130('0x18')][_0xd130('0x21')]);}return _0x4e5860(_0x3faa63['error'][_0xd130('0x21')]);}else{_0x4e5860(_0x3faa63[_0xd130('0x22')]);}})[_0xd130('0x23')](function(_0x14bef5){_0x311c3a(_0x14bef5);});});}function getAgent(_0x26dd6a){return db[_0xd130('0x24')]['findOne']({'where':{'id':_0x26dd6a,'role':_0xd130('0x25')}})['then'](checkError());}function getAgentCheckSession(_0x149e5a,_0x4e2cb4){return new BPromise(function(_0x5d31af,_0x51a4bd){var _0x3e0be6=respondWithRpcPromise(_0xd130('0x26'));var _0x3a8218=getAgent(_0x149e5a);Promise[_0xd130('0x27')]([_0x3e0be6,_0x3a8218])['then'](function(_0x1d8d1c){var _0x154eb6=_0x1d8d1c[0x0];var _0x28127d=_0x1d8d1c[0x1];var _0x562aef=_[_0xd130('0x28')](_0x154eb6['rows'],function(_0x51d24e){return _0x51d24e['UserId']==_0x28127d['id']&&_0x51d24e[_0xd130('0x29')]==_0x4e2cb4;});if(_0x562aef[_0xd130('0x2a')]==0x1){_0x5d31af(_0x28127d);}else{_0x51a4bd(new RangeError(_0xd130('0x2b')+_0x4e2cb4+'\x20not\x20found!'));}});});}exports[_0xd130('0x2c')]=function(_0x183829,_0x36d5cf){logger[_0xd130('0x2d')](_0xd130('0x2e'),_0x183829['body']);var _0x37b8c9=originateValidation[_0xd130('0x2f')](_0x183829[_0xd130('0x30')]);if(_0x37b8c9['length']>0x0){return _0x36d5cf[_0xd130('0x1a')](0x190)[_0xd130('0x31')](_0x37b8c9);}var _0x5d28ec=_0x183829[_0xd130('0x30')][_0xd130('0x32')];var _0x597b2d=_0x183829[_0xd130('0x30')][_0xd130('0x33')];var _0x3ed8ae=_0x183829[_0xd130('0x30')][_0xd130('0x34')];var _0x472542=_0x183829['body'][_0xd130('0x35')];return getAgent(_0x5d28ec)[_0xd130('0x1f')](function(_0x2ce6e2){logger[_0xd130('0x2d')](_0xd130('0x36'),_0x2ce6e2[_0xd130('0x1c')]);emit(util[_0xd130('0x37')](_0xd130('0x38'),_0x2ce6e2[_0xd130('0x1c')]),'webbar:originate',{'callNumber':_0x597b2d,'callerId':_0x3ed8ae,'callbackUrl':_0x472542});return _0x36d5cf[_0xd130('0x1a')](0xc8)[_0xd130('0x31')]({'error':![],'message':'originate\x20executed!'});})[_0xd130('0x23')](handleError(_0x36d5cf));};exports[_0xd130('0x39')]=function(_0x269aca,_0x451474){logger[_0xd130('0x2d')]('hangup\x20fired:',_0x269aca[_0xd130('0x30')]);var _0x42a080=hangupValidation[_0xd130('0x2f')](_0x269aca['body']);if(_0x42a080[_0xd130('0x2a')]>0x0){return _0x451474[_0xd130('0x1a')](0x190)['json'](_0x42a080);}var _0x2c89f7=_0x269aca[_0xd130('0x30')][_0xd130('0x32')];var _0x576344=_0x269aca[_0xd130('0x30')][_0xd130('0x29')];return getAgent(_0x2c89f7)['then'](function(_0x4f1fd2){logger[_0xd130('0x2d')](_0xd130('0x36'),_0x4f1fd2[_0xd130('0x1c')]);emit(util['format']('user:%s',_0x4f1fd2['name']),'webbar:hangup',{'sessionId':_0x576344});return _0x451474[_0xd130('0x1a')](0xc8)[_0xd130('0x31')]({'error':![],'message':_0xd130('0x3a')});})[_0xd130('0x23')](handleError(_0x451474));};exports[_0xd130('0x3b')]=function(_0x58547c,_0x36856b){logger[_0xd130('0x2d')](_0xd130('0x3c'),_0x58547c[_0xd130('0x30')]);var _0xb1c3d9=answerValidation[_0xd130('0x2f')](_0x58547c[_0xd130('0x30')]);if(_0xb1c3d9[_0xd130('0x2a')]>0x0){return _0x36856b['status'](0x190)[_0xd130('0x31')](_0xb1c3d9);}var _0xd01349=_0x58547c['body'][_0xd130('0x32')];var _0x565006=_0x58547c[_0xd130('0x30')][_0xd130('0x29')];return getAgent(_0xd01349)['then'](function(_0x18fd41){logger['info'](_0xd130('0x36'),_0x18fd41[_0xd130('0x1c')]);emit(util[_0xd130('0x37')](_0xd130('0x38'),_0x18fd41[_0xd130('0x1c')]),_0xd130('0x3d'),{'sessionId':_0x565006});return _0x36856b[_0xd130('0x1a')](0xc8)[_0xd130('0x31')]({'error':![],'message':_0xd130('0x3e')});})[_0xd130('0x23')](handleError(_0x36856b));};exports[_0xd130('0x3f')]=function(_0x18c7c8,_0x23b587){logger[_0xd130('0x2d')]('hold\x20fired:',_0x18c7c8['body']);var _0x49f159=holdValidation['validate'](_0x18c7c8['body']);if(_0x49f159['length']>0x0){return _0x23b587['status'](0x190)[_0xd130('0x31')](_0x49f159);}var _0x5d4d42=_0x18c7c8['body'][_0xd130('0x32')];var _0x5c0e12=_0x18c7c8['body'][_0xd130('0x29')];return getAgent(_0x5d4d42)[_0xd130('0x1f')](function(_0x25f07c){logger['info'](_0xd130('0x36'),_0x25f07c[_0xd130('0x1c')]);emit(util[_0xd130('0x37')]('user:%s',_0x25f07c[_0xd130('0x1c')]),'webbar:hold',{'sessionId':_0x5c0e12});return _0x23b587[_0xd130('0x1a')](0xc8)[_0xd130('0x31')]({'error':![],'message':'hold\x20executed!'});})['catch'](handleError(_0x23b587));};exports[_0xd130('0x40')]=function(_0x2bac28,_0x3b69af){logger[_0xd130('0x2d')]('unhold\x20fired:',_0x2bac28[_0xd130('0x30')]);var _0xaa2401=unholdValidation[_0xd130('0x2f')](_0x2bac28['body']);if(_0xaa2401[_0xd130('0x2a')]>0x0){return _0x3b69af[_0xd130('0x1a')](0x190)[_0xd130('0x31')](_0xaa2401);}var _0x5ba415=_0x2bac28[_0xd130('0x30')][_0xd130('0x32')];var _0x128f4e=_0x2bac28['body'][_0xd130('0x29')];return getAgent(_0x5ba415)[_0xd130('0x1f')](function(_0x4e7187){logger['info'](_0xd130('0x36'),_0x4e7187[_0xd130('0x1c')]);emit(util[_0xd130('0x37')](_0xd130('0x38'),_0x4e7187[_0xd130('0x1c')]),_0xd130('0x41'),{'sessionId':_0x128f4e});return _0x3b69af[_0xd130('0x1a')](0xc8)['json']({'error':![],'message':_0xd130('0x42')});})['catch'](handleError(_0x3b69af));};exports[_0xd130('0x43')]=function(_0x1c3f82,_0x2c45e2){logger['info'](_0xd130('0x44'),_0x2c45e2[_0xd130('0x30')]);var _0x45dbaf=callsValidation[_0xd130('0x2f')](_0x1c3f82['body']);if(_0x45dbaf[_0xd130('0x2a')]>0x0){return _0x2c45e2[_0xd130('0x1a')](0x190)[_0xd130('0x31')](_0x45dbaf);}var _0x176f4a=_0x1c3f82[_0xd130('0x30')][_0xd130('0x32')];var _0x1967ed=respondWithRpcPromise('VoiceChannels');var _0x35ecec=getAgent(_0x176f4a);return Promise[_0xd130('0x27')]([_0x1967ed,_0x35ecec])[_0xd130('0x1f')](function(_0xde78ac){var _0x430448=_0xde78ac[0x0];var _0x1fe7f0=_0xde78ac[0x1];var _0x4d8e9d=_['filter'](_0x430448[_0xd130('0x45')],function(_0x2270e5){return _0x2270e5['UserId']==_0x1fe7f0['id'];});return _0x2c45e2[_0xd130('0x1a')](0xc8)[_0xd130('0x31')]({'count':_0x4d8e9d['length'],'rows':_0x4d8e9d});})[_0xd130('0x23')](handleError(_0x2c45e2));};exports[_0xd130('0x46')]=function(_0x30edda,_0x3d563a){logger[_0xd130('0x2d')]('conference\x20fired:',_0x30edda[_0xd130('0x30')]);var _0x2da727=conferenceValidation[_0xd130('0x2f')](_0x30edda[_0xd130('0x30')]);if(_0x2da727['length']>0x0){return _0x3d563a[_0xd130('0x1a')](0x190)[_0xd130('0x31')](_0x2da727);}var _0x3711b0=_0x30edda[_0xd130('0x30')][_0xd130('0x32')];return getAgent(_0x3711b0)[_0xd130('0x1f')](function(_0x14fd2a){logger[_0xd130('0x2d')]('entityFound:',_0x14fd2a[_0xd130('0x1c')]);emit(util[_0xd130('0x37')](_0xd130('0x38'),_0x14fd2a[_0xd130('0x1c')]),_0xd130('0x47'));return _0x3d563a[_0xd130('0x1a')](0xc8)[_0xd130('0x31')]({'error':![],'message':_0xd130('0x48')});})[_0xd130('0x23')](handleError(_0x3d563a));};exports[_0xd130('0x49')]=function(_0xffdc9d,_0x289dde){logger[_0xd130('0x2d')](_0xd130('0x4a'),_0xffdc9d[_0xd130('0x30')]);var _0x2244b2=transferValidation[_0xd130('0x2f')](_0xffdc9d['body']);if(_0x2244b2['length']>0x0){return _0x289dde[_0xd130('0x1a')](0x190)['json'](_0x2244b2);}var _0xd7dce5=_0xffdc9d[_0xd130('0x30')][_0xd130('0x32')];var _0x5797b3=_0xffdc9d['body']['sessionId'];var _0x21a2c5=_0xffdc9d['body'][_0xd130('0x4b')];return getAgent(_0xd7dce5)[_0xd130('0x1f')](function(_0x3efbed){logger[_0xd130('0x2d')](_0xd130('0x36'),_0x3efbed[_0xd130('0x1c')]);emit(util[_0xd130('0x37')](_0xd130('0x38'),_0x3efbed['name']),_0xd130('0x4c'),{'sessionId':_0x5797b3,'transferNumber':_0x21a2c5});return _0x289dde[_0xd130('0x1a')](0xc8)['json']({'error':![],'message':_0xd130('0x4d')});})[_0xd130('0x23')](handleError(_0x289dde));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index ccaf2e3..a5ecc0a 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 _0x51a3=['addAgents','/:id/notify','/:id/send','send','put','update','delete','removeAgents','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','create','/:id/dispositions','addDisposition'];(function(_0x4baf58,_0x4e6f0d){var _0x372217=function(_0x3a3981){while(--_0x3a3981){_0x4baf58['push'](_0x4baf58['shift']());}};_0x372217(++_0x4e6f0d);}(_0x51a3,0x69));var _0x351a=function(_0x3770f7,_0x42c903){_0x3770f7=_0x3770f7-0x0;var _0x3c36af=_0x51a3[_0x3770f7];return _0x3c36af;};'use strict';var multer=require(_0x351a('0x0'));var util=require(_0x351a('0x1'));var path=require('path');var timeout=require(_0x351a('0x2'));var express=require('express');var router=express[_0x351a('0x3')]();var auth=require(_0x351a('0x4'));var interaction=require(_0x351a('0x5'));var config=require('../../config/environment');var controller=require(_0x351a('0x6'));router[_0x351a('0x7')]('/',auth[_0x351a('0x8')](),controller[_0x351a('0x9')]);router[_0x351a('0x7')](_0x351a('0xa'),auth[_0x351a('0x8')](),controller['describe']);router[_0x351a('0x7')](_0x351a('0xb'),auth[_0x351a('0x8')](),controller[_0x351a('0xc')]);router[_0x351a('0x7')]('/:id/dispositions',auth[_0x351a('0x8')](),controller[_0x351a('0xd')]);router[_0x351a('0x7')](_0x351a('0xe'),auth[_0x351a('0x8')](),controller[_0x351a('0xf')]);router[_0x351a('0x7')](_0x351a('0x10'),auth['isAuthenticated'](),controller[_0x351a('0x11')]);router[_0x351a('0x7')](_0x351a('0x12'),auth[_0x351a('0x8')](),controller['getApplications']);router[_0x351a('0x13')]('/',auth['isAuthenticated'](),controller[_0x351a('0x14')]);router[_0x351a('0x13')](_0x351a('0x15'),auth[_0x351a('0x8')](),controller[_0x351a('0x16')]);router[_0x351a('0x13')](_0x351a('0xe'),auth['isAuthenticated'](),controller['addAnswer']);router['post'](_0x351a('0x10'),auth[_0x351a('0x8')](),controller[_0x351a('0x17')]);router['post'](_0x351a('0x12'),auth[_0x351a('0x8')](),controller['addApplications']);router[_0x351a('0x13')](_0x351a('0x18'),controller['notify']);router[_0x351a('0x13')](_0x351a('0x19'),auth[_0x351a('0x8')](),controller[_0x351a('0x1a')]);router[_0x351a('0x1b')](_0x351a('0xb'),auth[_0x351a('0x8')](),controller[_0x351a('0x1c')]);router[_0x351a('0x1d')](_0x351a('0xb'),auth[_0x351a('0x8')](),controller['destroy']);router['delete'](_0x351a('0x15'),auth[_0x351a('0x8')](),controller['removeDispositions']);router[_0x351a('0x1d')](_0x351a('0xe'),auth[_0x351a('0x8')](),controller['removeAnswers']);router['delete'](_0x351a('0x10'),auth['isAuthenticated'](),controller[_0x351a('0x1e')]);module[_0x351a('0x1f')]=router; \ No newline at end of file +var _0xaadb=['../../config/environment','./whatsappAccount.controller','isAuthenticated','index','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','create','post','addAnswer','addAgents','addApplications','/:id/notify','send','put','update','delete','removeDispositions','removeAgents','exports','multer','util','path','express','../../components/auth/service'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xaadb,0x1bb));var _0xbaad=function(_0x2dda27,_0x203344){_0x2dda27=_0x2dda27-0x0;var _0x38d07f=_0xaadb[_0x2dda27];return _0x38d07f;};'use strict';var multer=require(_0xbaad('0x0'));var util=require(_0xbaad('0x1'));var path=require(_0xbaad('0x2'));var timeout=require('connect-timeout');var express=require(_0xbaad('0x3'));var router=express['Router']();var auth=require(_0xbaad('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbaad('0x5'));var controller=require(_0xbaad('0x6'));router['get']('/',auth[_0xbaad('0x7')](),controller[_0xbaad('0x8')]);router[_0xbaad('0x9')]('/describe',auth[_0xbaad('0x7')](),controller['describe']);router[_0xbaad('0x9')](_0xbaad('0xa'),auth['isAuthenticated'](),controller[_0xbaad('0xb')]);router[_0xbaad('0x9')](_0xbaad('0xc'),auth[_0xbaad('0x7')](),controller[_0xbaad('0xd')]);router[_0xbaad('0x9')](_0xbaad('0xe'),auth[_0xbaad('0x7')](),controller[_0xbaad('0xf')]);router[_0xbaad('0x9')](_0xbaad('0x10'),auth[_0xbaad('0x7')](),controller[_0xbaad('0x11')]);router[_0xbaad('0x9')](_0xbaad('0x12'),auth[_0xbaad('0x7')](),controller['getApplications']);router['post']('/',auth['isAuthenticated'](),controller[_0xbaad('0x13')]);router[_0xbaad('0x14')](_0xbaad('0xc'),auth[_0xbaad('0x7')](),controller['addDisposition']);router['post'](_0xbaad('0xe'),auth[_0xbaad('0x7')](),controller[_0xbaad('0x15')]);router[_0xbaad('0x14')](_0xbaad('0x10'),auth[_0xbaad('0x7')](),controller[_0xbaad('0x16')]);router[_0xbaad('0x14')](_0xbaad('0x12'),auth[_0xbaad('0x7')](),controller[_0xbaad('0x17')]);router[_0xbaad('0x14')](_0xbaad('0x18'),controller['notify']);router[_0xbaad('0x14')]('/:id/send',auth[_0xbaad('0x7')](),controller[_0xbaad('0x19')]);router[_0xbaad('0x1a')](_0xbaad('0xa'),auth[_0xbaad('0x7')](),controller[_0xbaad('0x1b')]);router[_0xbaad('0x1c')](_0xbaad('0xa'),auth['isAuthenticated'](),controller['destroy']);router[_0xbaad('0x1c')](_0xbaad('0xc'),auth['isAuthenticated'](),controller[_0xbaad('0x1d')]);router['delete'](_0xbaad('0xe'),auth[_0xbaad('0x7')](),controller['removeAnswers']);router[_0xbaad('0x1c')](_0xbaad('0x10'),auth[_0xbaad('0x7')](),controller[_0xbaad('0x1e')]);module[_0xbaad('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 0d1a070..8a64476 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 _0x9e26=['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','sequelize','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x13e7c0,_0x375fec){var _0x161bc6=function(_0x3ccd7a){while(--_0x3ccd7a){_0x13e7c0['push'](_0x13e7c0['shift']());}};_0x161bc6(++_0x375fec);}(_0x9e26,0xa3));var _0x69e2=function(_0xc611d1,_0xd28384){_0xc611d1=_0xc611d1-0x0;var _0x56e52e=_0x9e26[_0xc611d1];return _0x56e52e;};'use strict';var Sequelize=require(_0x69e2('0x0'));var rs=require(_0x69e2('0x1'));module[_0x69e2('0x2')]={'name':{'type':Sequelize[_0x69e2('0x3')],'unique':_0x69e2('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x69e2('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x69e2('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x69e2('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x69e2('0x6')](_0x69e2('0x7'))},'accountSid':{'type':Sequelize[_0x69e2('0x3')]},'authToken':{'type':Sequelize[_0x69e2('0x3')]},'notificationTemplate':{'type':Sequelize[_0x69e2('0x8')],'defaultValue':function(){return _0x69e2('0x9');}},'notificationSound':{'type':Sequelize[_0x69e2('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x69e2('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x69e2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x69e2('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x69e2('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x69e2('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x69e2('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x69e2('0xa')],'defaultValue':![],'comment':_0x69e2('0xd'),'set':function(_0x17683b){if(!_0x17683b){this[_0x69e2('0xe')](_0x69e2('0xf'),null);}this['setDataValue'](_0x69e2('0x10'),_0x17683b);}},'description':{'type':Sequelize[_0x69e2('0x3')]}}; \ No newline at end of file +var _0xb0d1=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue'];(function(_0x370fc9,_0x4b1f71){var _0x21c87a=function(_0x2d2167){while(--_0x2d2167){_0x370fc9['push'](_0x370fc9['shift']());}};_0x21c87a(++_0x4b1f71);}(_0xb0d1,0x1f0));var _0x1b0d=function(_0x1c4c11,_0x51ecb1){_0x1c4c11=_0x1c4c11-0x0;var _0x3e0822=_0xb0d1[_0x1c4c11];return _0x3e0822;};'use strict';var Sequelize=require(_0x1b0d('0x0'));var rs=require(_0x1b0d('0x1'));module[_0x1b0d('0x2')]={'name':{'type':Sequelize[_0x1b0d('0x3')],'unique':_0x1b0d('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x1b0d('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x1b0d('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x1b0d('0x3')],'defaultValue':function(){return rs[_0x1b0d('0x5')]();}},'phone':{'type':Sequelize[_0x1b0d('0x3')]},'type':{'type':Sequelize[_0x1b0d('0x6')]('twilio')},'accountSid':{'type':Sequelize[_0x1b0d('0x3')]},'authToken':{'type':Sequelize[_0x1b0d('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1b0d('0x7')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x1b0d('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x1b0d('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1b0d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1b0d('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1b0d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1b0d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1b0d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1b0d('0x9')],'comment':_0x1b0d('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1b0d('0xb'),'set':function(_0x430f1f){if(!_0x430f1f){this['setDataValue'](_0x1b0d('0xc'),null);}this[_0x1b0d('0xd')](_0x1b0d('0xe'),_0x430f1f);}},'description':{'type':Sequelize[_0x1b0d('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 1d5c53c..0ef6bc0 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 _0x4e81=['addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','account','applications','orderBy','asc','describe','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','replace','whatsapp:','Body','MessageSid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','CmList','ListId','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','interaction','created','autoclose','push','unmanaged','*,*,*,*','WhatsappMessage','messageId','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','send','List','spread','dataValues','Messages','html-pdf','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','client','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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','status','end','json','count','offset','limit','Content-Range','save','update','destroy','WhatsappAccounts','stack','name','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','addDisposition','WhatsappAccountId','findOne','Disposition','order','sort','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addAgents','emit','removeAgents','userWhatsappAccount:remove','getAgents'];(function(_0x275ce3,_0x4033dd){var _0x137042=function(_0x22e289){while(--_0x22e289){_0x275ce3['push'](_0x275ce3['shift']());}};_0x137042(++_0x4033dd);}(_0x4e81,0x1bc));var _0x14e8=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x4e81[_0x44d9ab];return _0x31485e;};'use strict';var pdf=require(_0x14e8('0x0'));var emlformat=require(_0x14e8('0x1'));var rimraf=require(_0x14e8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x14e8('0x3'));var BPromise=require(_0x14e8('0x4'));var Mustache=require(_0x14e8('0x5'));var util=require(_0x14e8('0x6'));var path=require(_0x14e8('0x7'));var sox=require(_0x14e8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0xe'));var querystring=require(_0x14e8('0xf'));var Papa=require(_0x14e8('0x10'));var Redis=require(_0x14e8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x12'));var as=require(_0x14e8('0x13'));var hardwareService=require(_0x14e8('0x14'));var logger=require(_0x14e8('0x15'))(_0x14e8('0x16'));var utils=require(_0x14e8('0x17'));var config=require(_0x14e8('0x18'));var db=require(_0x14e8('0x19'))['db'];config['redis']=_[_0x14e8('0x1a')](config['redis'],{'host':_0x14e8('0x1b'),'port':0x18eb});var socket=require(_0x14e8('0x1c'))(new Redis(config[_0x14e8('0x1d')]));require('./whatsappAccount.socket')[_0x14e8('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x14e8('0x1f')]['http']({'port':0x232c});function checkPasswordPattern(_0x347216,_0x3761a1,_0xc6101f){if(_0xc6101f){var _0x135996=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x135996['test'](_0x3761a1)){return _0x347216;}else{throw new db[(_0x14e8('0x20'))][(_0x14e8('0x21'))](_0x14e8('0x22'));}}else{return _0x347216;}}function respondWithRpcPromise(_0x412c0a,_0xd4d6b2,_0x1f1a0d,_0x10dc8b){return new BPromise(function(_0x462259,_0x5a38c1){var _0x328c5a=_0x10dc8b||client;return _0x328c5a[_0x14e8('0x23')](_0x412c0a,_0x1f1a0d)[_0x14e8('0x24')](function(_0x7b10f2){logger[_0x14e8('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0xd4d6b2,_0x14e8('0x26'));logger[_0x14e8('0x27')](_0x14e8('0x28'),_0xd4d6b2,'request\x20sent',JSON[_0x14e8('0x29')](_0x7b10f2));if(_0x7b10f2['error']){if(_0x7b10f2[_0x14e8('0x2a')][_0x14e8('0x2b')]===0x1f4){logger[_0x14e8('0x2a')](_0x14e8('0x2c'),_0xd4d6b2,_0x7b10f2[_0x14e8('0x2a')]['message']);return _0x5a38c1(_0x7b10f2[_0x14e8('0x2a')]['message']);}logger[_0x14e8('0x2a')](_0x14e8('0x2c'),_0xd4d6b2,_0x7b10f2['error']['message']);return _0x462259(_0x7b10f2['error'][_0x14e8('0x2d')]);}else{logger[_0x14e8('0x25')](_0x14e8('0x2c'),_0xd4d6b2,_0x14e8('0x26'));_0x462259(_0x7b10f2[_0x14e8('0x2e')]['message']);}})[_0x14e8('0x2f')](function(_0x3fd96d){logger[_0x14e8('0x2a')](_0x14e8('0x2c'),_0xd4d6b2,_0x3fd96d);_0x5a38c1(_0x3fd96d);});});}function respondWithStatusCode(_0x28035a,_0xfc0545){_0xfc0545=_0xfc0545||0xcc;return function(_0x2813ae){if(_0x2813ae){return _0x28035a['sendStatus'](_0xfc0545);}return _0x28035a[_0x14e8('0x30')](_0xfc0545)[_0x14e8('0x31')]();};}function respondWithResult(_0x393ab0,_0x5f5abb){_0x5f5abb=_0x5f5abb||0xc8;return function(_0x48eed0){if(_0x48eed0){return _0x393ab0['status'](_0x5f5abb)[_0x14e8('0x32')](_0x48eed0);}};}function respondWithFilteredResult(_0x2a408d,_0x567385){return function(_0x204524){if(_0x204524){var _0x1d71ca=_0x204524[_0x14e8('0x33')],_0x176e8f=_0x567385[_0x14e8('0x34')],_0xa83433=_0x567385[_0x14e8('0x34')]+_0x567385[_0x14e8('0x35')],_0x5c2635;if(_0xa83433>=_0x1d71ca){_0xa83433=_0x1d71ca;_0x5c2635=0xc8;}else{_0x5c2635=0xce;}_0x2a408d[_0x14e8('0x30')](_0x5c2635);return _0x2a408d['set'](_0x14e8('0x36'),_0x176e8f+'-'+_0xa83433+'/'+_0x1d71ca)[_0x14e8('0x32')](_0x204524);}return null;};}function patchUpdates(_0xc398b6){return function(_0xe63f00){try{jsonpatch['apply'](_0xe63f00,_0xc398b6,!![]);}catch(_0xbb8003){return BPromise['reject'](_0xbb8003);}return _0xe63f00[_0x14e8('0x37')]();};}function saveUpdates(_0x44c6fb,_0x1f4876){return function(_0x34a7c8){if(_0x34a7c8){return _0x34a7c8[_0x14e8('0x38')](_0x44c6fb)[_0x14e8('0x24')](function(_0xbe9eab){return _0xbe9eab;});}return null;};}function removeEntity(_0x47cbe0,_0xd144b){return function(_0x2acf6a){if(_0x2acf6a){return _0x2acf6a[_0x14e8('0x39')]()[_0x14e8('0x24')](function(){var _0x54e624=_0x2acf6a['get']({'plain':!![]});var _0x4dac15=_0x14e8('0x3a');return db['UserProfileResource'][_0x14e8('0x39')]({'where':{'type':_0x4dac15,'resourceId':_0x54e624['id']}})['then'](function(){return _0x2acf6a;});})[_0x14e8('0x24')](function(){_0x47cbe0[_0x14e8('0x30')](0xcc)[_0x14e8('0x31')]();});}};}function handleEntityNotFound(_0x2fc030,_0x51a63d){return function(_0x13b44e){if(!_0x13b44e){_0x2fc030['sendStatus'](0x194);}return _0x13b44e;};}function handleError(_0x5f0ee3,_0x3ae459){_0x3ae459=_0x3ae459||0x1f4;return function(_0x74dce4){logger[_0x14e8('0x2a')](_0x74dce4[_0x14e8('0x3b')]);if(_0x74dce4[_0x14e8('0x3c')]){delete _0x74dce4['name'];}_0x5f0ee3[_0x14e8('0x30')](_0x3ae459)['send'](_0x74dce4);};}exports[_0x14e8('0x3d')]=function(_0x20f69d,_0x14b9f1){var _0x4cafe6={'include':[{'model':db['Pause'],'as':_0x14e8('0x3e')}]},_0x27d51b={},_0x12c8ff={'count':0x0,'rows':[]};var _0x38b874=_[_0x14e8('0x3f')](db[_0x14e8('0x40')][_0x14e8('0x41')],function(_0x2850a5){return{'name':_0x2850a5[_0x14e8('0x42')],'type':_0x2850a5[_0x14e8('0x43')][_0x14e8('0x44')]};});_0x27d51b[_0x14e8('0x45')]=_[_0x14e8('0x3f')](_0x38b874,_0x14e8('0x3c'));_0x27d51b[_0x14e8('0x46')]=_[_0x14e8('0x47')](_0x20f69d[_0x14e8('0x46')]);_0x27d51b['filters']=_[_0x14e8('0x48')](_0x27d51b['model'],_0x27d51b['query']);_0x4cafe6['attributes']=_[_0x14e8('0x48')](_0x27d51b['model'],qs[_0x14e8('0x49')](_0x20f69d[_0x14e8('0x46')][_0x14e8('0x49')]));_0x4cafe6[_0x14e8('0x4a')]=_0x4cafe6[_0x14e8('0x4a')][_0x14e8('0x4b')]?_0x4cafe6[_0x14e8('0x4a')]:_0x27d51b[_0x14e8('0x45')];if(!_0x20f69d[_0x14e8('0x46')][_0x14e8('0x4c')](_0x14e8('0x4d'))){_0x4cafe6['limit']=qs[_0x14e8('0x35')](_0x20f69d[_0x14e8('0x46')][_0x14e8('0x35')]);_0x4cafe6[_0x14e8('0x34')]=qs['offset'](_0x20f69d[_0x14e8('0x46')][_0x14e8('0x34')]);}_0x4cafe6['order']=qs['sort'](_0x20f69d[_0x14e8('0x46')]['sort']);_0x4cafe6['where']=qs[_0x14e8('0x4e')](_[_0x14e8('0x4f')](_0x20f69d['query'],_0x27d51b[_0x14e8('0x4e')]),_0x38b874);if(_0x20f69d[_0x14e8('0x46')]['filter']){_0x4cafe6[_0x14e8('0x50')]=_[_0x14e8('0x51')](_0x4cafe6[_0x14e8('0x50')],{'$or':_[_0x14e8('0x3f')](_0x38b874,function(_0xa73d38){if(_0xa73d38[_0x14e8('0x43')]!==_0x14e8('0x52')){var _0x2541ad={};_0x2541ad[_0xa73d38[_0x14e8('0x3c')]]={'$like':'%'+_0x20f69d[_0x14e8('0x46')][_0x14e8('0x53')]+'%'};return _0x2541ad;}})});}_0x4cafe6=_[_0x14e8('0x51')]({},_0x4cafe6,_0x20f69d[_0x14e8('0x54')]);var _0x3a51f3={'where':_0x4cafe6[_0x14e8('0x50')]};return db[_0x14e8('0x40')]['count'](_0x3a51f3)[_0x14e8('0x24')](function(_0x49324a){_0x12c8ff[_0x14e8('0x33')]=_0x49324a;if(_0x20f69d[_0x14e8('0x46')][_0x14e8('0x55')]){_0x4cafe6[_0x14e8('0x56')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x4cafe6);})['then'](function(_0x291fe2){_0x12c8ff['rows']=_0x291fe2;return _0x12c8ff;})['then'](respondWithFilteredResult(_0x14b9f1,_0x4cafe6))[_0x14e8('0x2f')](handleError(_0x14b9f1,null));};exports[_0x14e8('0x57')]=function(_0x590bcd,_0x15058e){var _0x27e319={'raw':![],'where':{'id':_0x590bcd[_0x14e8('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x7d6759={};_0x7d6759[_0x14e8('0x45')]=_[_0x14e8('0x47')](db[_0x14e8('0x40')][_0x14e8('0x41')]);_0x7d6759[_0x14e8('0x46')]=_[_0x14e8('0x47')](_0x590bcd['query']);_0x7d6759[_0x14e8('0x4e')]=_[_0x14e8('0x48')](_0x7d6759[_0x14e8('0x45')],_0x7d6759[_0x14e8('0x46')]);_0x27e319['attributes']=_[_0x14e8('0x48')](_0x7d6759[_0x14e8('0x45')],qs[_0x14e8('0x49')](_0x590bcd[_0x14e8('0x46')]['fields']));_0x27e319[_0x14e8('0x4a')]=_0x27e319[_0x14e8('0x4a')][_0x14e8('0x4b')]?_0x27e319[_0x14e8('0x4a')]:_0x7d6759[_0x14e8('0x45')];if(_0x590bcd[_0x14e8('0x46')][_0x14e8('0x55')]){_0x27e319[_0x14e8('0x56')]=[{'all':!![]}];}_0x27e319=_['merge']({},_0x27e319,_0x590bcd['options']);return db[_0x14e8('0x40')][_0x14e8('0x59')](_0x27e319)[_0x14e8('0x24')](handleEntityNotFound(_0x15058e,null))[_0x14e8('0x24')](respondWithResult(_0x15058e,null))[_0x14e8('0x2f')](handleError(_0x15058e,null));};exports['create']=function(_0x4a631a,_0x4c49e5){return db[_0x14e8('0x40')][_0x14e8('0x5a')](_0x4a631a[_0x14e8('0x5b')],{})['then'](function(_0x8c9182){var _0xbd38ae=_0x4a631a[_0x14e8('0x5c')]['get']({'plain':!![]});if(!_0xbd38ae)throw new Error(_0x14e8('0x5d'));if(_0xbd38ae[_0x14e8('0x5e')]===_0x14e8('0x5c')){var _0xb18cf1=_0x8c9182[_0x14e8('0x5f')]({'plain':!![]});var _0x12ec12=_0x14e8('0x3a');return db[_0x14e8('0x60')][_0x14e8('0x59')]({'where':{'name':_0x12ec12,'userProfileId':_0xbd38ae[_0x14e8('0x61')]},'raw':!![]})[_0x14e8('0x24')](function(_0x4c6f1d){if(_0x4c6f1d&&_0x4c6f1d[_0x14e8('0x62')]===0x0){return db[_0x14e8('0x63')][_0x14e8('0x5a')]({'name':_0xb18cf1[_0x14e8('0x3c')],'resourceId':_0xb18cf1['id'],'type':_0x4c6f1d[_0x14e8('0x3c')],'sectionId':_0x4c6f1d['id']},{})[_0x14e8('0x24')](function(){return _0x8c9182;});}else{return _0x8c9182;}})[_0x14e8('0x2f')](function(_0x12e0a8){logger[_0x14e8('0x2a')](_0x14e8('0x64'),_0x12e0a8);throw _0x12e0a8;});}return _0x8c9182;})[_0x14e8('0x24')](respondWithResult(_0x4c49e5,0xc9))[_0x14e8('0x2f')](handleError(_0x4c49e5,null));};exports['update']=function(_0xc988b8,_0x93238a){if(_0xc988b8['body']['id']){delete _0xc988b8[_0x14e8('0x5b')]['id'];}return db[_0x14e8('0x40')][_0x14e8('0x59')]({'where':{'id':_0xc988b8[_0x14e8('0x58')]['id']},'include':[{'model':db[_0x14e8('0x65')],'as':_0x14e8('0x3e')}]})[_0x14e8('0x24')](handleEntityNotFound(_0x93238a,null))['then'](saveUpdates(_0xc988b8['body'],null))['then'](respondWithResult(_0x93238a,null))[_0x14e8('0x2f')](handleError(_0x93238a,null));};exports[_0x14e8('0x39')]=function(_0x2755f7,_0x2c6d33){return db[_0x14e8('0x40')][_0x14e8('0x59')]({'where':{'id':_0x2755f7[_0x14e8('0x58')]['id']}})['then'](handleEntityNotFound(_0x2c6d33,null))[_0x14e8('0x24')](removeEntity(_0x2c6d33,null))[_0x14e8('0x2f')](handleError(_0x2c6d33,null));};exports['describe']=function(_0x27afee,_0x3a5602){return db['WhatsappAccount']['describe']()['then'](respondWithResult(_0x3a5602,null))[_0x14e8('0x2f')](handleError(_0x3a5602,null));};exports[_0x14e8('0x66')]=function(_0x1109d3,_0x29b4af,_0x4a8417){if(_0x1109d3[_0x14e8('0x5b')]['id']){delete _0x1109d3[_0x14e8('0x5b')]['id'];}return db[_0x14e8('0x40')][_0x14e8('0x59')]({'where':{'id':_0x1109d3[_0x14e8('0x58')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x29b4af,null))['then'](function(_0xf32eb7){if(_0xf32eb7){_0x1109d3[_0x14e8('0x5b')][_0x14e8('0x67')]=_0xf32eb7['id'];return db['Disposition']['create'](_0x1109d3[_0x14e8('0x5b')]);}})['then'](respondWithResult(_0x29b4af,null))[_0x14e8('0x2f')](handleError(_0x29b4af,null));};exports['getDispositions']=function(_0x13ebe6,_0x54b023,_0x28aac4){var _0x362bda={'raw':![],'where':{}};var _0x4cdb7e={};var _0x1daa74={'count':0x0,'rows':[]};return db[_0x14e8('0x40')][_0x14e8('0x68')]({'where':{'id':_0x13ebe6[_0x14e8('0x58')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x54b023,null))[_0x14e8('0x24')](function(_0x858bab){if(_0x858bab){_0x4cdb7e[_0x14e8('0x45')]=_[_0x14e8('0x47')](db[_0x14e8('0x69')][_0x14e8('0x41')]);_0x4cdb7e[_0x14e8('0x46')]=_[_0x14e8('0x47')](_0x13ebe6['query']);_0x4cdb7e['filters']=_['intersection'](_0x4cdb7e[_0x14e8('0x45')],_0x4cdb7e[_0x14e8('0x46')]);_0x362bda[_0x14e8('0x4a')]=_['intersection'](_0x4cdb7e[_0x14e8('0x45')],qs['fields'](_0x13ebe6['query']['fields']));_0x362bda[_0x14e8('0x4a')]=_0x362bda[_0x14e8('0x4a')][_0x14e8('0x4b')]?_0x362bda['attributes']:_0x4cdb7e[_0x14e8('0x45')];if(!_0x13ebe6['query'][_0x14e8('0x4c')](_0x14e8('0x4d'))){_0x362bda[_0x14e8('0x35')]=qs[_0x14e8('0x35')](_0x13ebe6[_0x14e8('0x46')][_0x14e8('0x35')]);_0x362bda[_0x14e8('0x34')]=qs[_0x14e8('0x34')](_0x13ebe6[_0x14e8('0x46')]['offset']);}_0x362bda[_0x14e8('0x6a')]=qs['sort'](_0x13ebe6[_0x14e8('0x46')][_0x14e8('0x6b')]);_0x362bda[_0x14e8('0x50')]=qs[_0x14e8('0x4e')](_[_0x14e8('0x4f')](_0x13ebe6[_0x14e8('0x46')],_0x4cdb7e[_0x14e8('0x4e')]));_0x362bda[_0x14e8('0x50')][_0x14e8('0x67')]=_0x858bab['id'];if(_0x13ebe6['query'][_0x14e8('0x53')]){_0x362bda[_0x14e8('0x50')]=_[_0x14e8('0x51')](_0x362bda[_0x14e8('0x50')],{'$or':_['map'](_0x362bda[_0x14e8('0x4a')],function(_0x21ead5){var _0x141eaa={};_0x141eaa[_0x21ead5]={'$like':'%'+_0x13ebe6[_0x14e8('0x46')]['filter']+'%'};return _0x141eaa;})});}_0x362bda=_[_0x14e8('0x51')]({},_0x362bda,_0x13ebe6['options']);return db[_0x14e8('0x69')]['count']({'where':_0x362bda['where']})[_0x14e8('0x24')](function(_0xb68079){_0x1daa74[_0x14e8('0x33')]=_0xb68079;if(_0x13ebe6[_0x14e8('0x46')][_0x14e8('0x55')]){_0x362bda[_0x14e8('0x56')]=[{'all':!![]}];}return db[_0x14e8('0x69')][_0x14e8('0x6c')](_0x362bda);})[_0x14e8('0x24')](function(_0x280a8c){_0x1daa74[_0x14e8('0x6d')]=_0x280a8c;return _0x1daa74;});}})['then'](respondWithFilteredResult(_0x54b023,_0x362bda))[_0x14e8('0x2f')](handleError(_0x54b023,null));};exports[_0x14e8('0x6e')]=function(_0xf2304c,_0x5418e0,_0x5a9e57){return db[_0x14e8('0x40')][_0x14e8('0x59')]({'where':{'id':_0xf2304c[_0x14e8('0x58')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x5418e0,null))[_0x14e8('0x24')](function(_0x468721){if(_0x468721){return _0x468721[_0x14e8('0x6e')](_0xf2304c[_0x14e8('0x46')][_0x14e8('0x6f')]);}})[_0x14e8('0x24')](respondWithStatusCode(_0x5418e0,null))[_0x14e8('0x2f')](handleError(_0x5418e0,null));};exports[_0x14e8('0x70')]=function(_0x1ea3f1,_0x13ffd2,_0x5c6fcb){if(_0x1ea3f1[_0x14e8('0x5b')]['id']){delete _0x1ea3f1['body']['id'];}return db[_0x14e8('0x40')][_0x14e8('0x59')]({'where':{'id':_0x1ea3f1[_0x14e8('0x58')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x13ffd2,null))[_0x14e8('0x24')](function(_0x281932){if(_0x281932){_0x1ea3f1['body'][_0x14e8('0x67')]=_0x281932['id'];return db[_0x14e8('0x71')]['create'](_0x1ea3f1[_0x14e8('0x5b')]);}})[_0x14e8('0x24')](respondWithResult(_0x13ffd2,null))[_0x14e8('0x2f')](handleError(_0x13ffd2,null));};exports['getAnswers']=function(_0x2f05f7,_0x3f3dab,_0x2b334d){var _0x1a0e68={'raw':![],'where':{}};var _0x2bdf32={};var _0x45a22f={'count':0x0,'rows':[]};return db[_0x14e8('0x40')][_0x14e8('0x68')]({'where':{'id':_0x2f05f7[_0x14e8('0x58')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x3f3dab,null))[_0x14e8('0x24')](function(_0x2491f9){if(_0x2491f9){_0x2bdf32['model']=_[_0x14e8('0x47')](db['CannedAnswer']['rawAttributes']);_0x2bdf32[_0x14e8('0x46')]=_['keys'](_0x2f05f7[_0x14e8('0x46')]);_0x2bdf32[_0x14e8('0x4e')]=_[_0x14e8('0x48')](_0x2bdf32[_0x14e8('0x45')],_0x2bdf32['query']);_0x1a0e68[_0x14e8('0x4a')]=_[_0x14e8('0x48')](_0x2bdf32[_0x14e8('0x45')],qs['fields'](_0x2f05f7['query'][_0x14e8('0x49')]));_0x1a0e68[_0x14e8('0x4a')]=_0x1a0e68[_0x14e8('0x4a')]['length']?_0x1a0e68[_0x14e8('0x4a')]:_0x2bdf32[_0x14e8('0x45')];if(!_0x2f05f7['query'][_0x14e8('0x4c')](_0x14e8('0x4d'))){_0x1a0e68[_0x14e8('0x35')]=qs[_0x14e8('0x35')](_0x2f05f7[_0x14e8('0x46')][_0x14e8('0x35')]);_0x1a0e68[_0x14e8('0x34')]=qs[_0x14e8('0x34')](_0x2f05f7[_0x14e8('0x46')][_0x14e8('0x34')]);}_0x1a0e68['order']=qs[_0x14e8('0x6b')](_0x2f05f7['query'][_0x14e8('0x6b')]);_0x1a0e68[_0x14e8('0x50')]=qs[_0x14e8('0x4e')](_['pick'](_0x2f05f7['query'],_0x2bdf32[_0x14e8('0x4e')]));_0x1a0e68[_0x14e8('0x50')][_0x14e8('0x67')]=_0x2491f9['id'];if(_0x2f05f7[_0x14e8('0x46')][_0x14e8('0x53')]){_0x1a0e68[_0x14e8('0x50')]=_['merge'](_0x1a0e68[_0x14e8('0x50')],{'$or':_['map'](_0x1a0e68[_0x14e8('0x4a')],function(_0x7fbf71){var _0x22b066={};_0x22b066[_0x7fbf71]={'$like':'%'+_0x2f05f7['query'][_0x14e8('0x53')]+'%'};return _0x22b066;})});}_0x1a0e68=_[_0x14e8('0x51')]({},_0x1a0e68,_0x2f05f7[_0x14e8('0x54')]);return db[_0x14e8('0x71')][_0x14e8('0x33')]({'where':_0x1a0e68['where']})[_0x14e8('0x24')](function(_0x2cb268){_0x45a22f['count']=_0x2cb268;if(_0x2f05f7['query']['includeAll']){_0x1a0e68[_0x14e8('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0x14e8('0x6c')](_0x1a0e68);})[_0x14e8('0x24')](function(_0xcfd95e){_0x45a22f[_0x14e8('0x6d')]=_0xcfd95e;return _0x45a22f;});}})[_0x14e8('0x24')](respondWithFilteredResult(_0x3f3dab,_0x1a0e68))[_0x14e8('0x2f')](handleError(_0x3f3dab,null));};exports[_0x14e8('0x72')]=function(_0x4b6a71,_0x2eb108,_0x586f7f){return db[_0x14e8('0x40')]['find']({'where':{'id':_0x4b6a71[_0x14e8('0x58')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x2eb108,null))['then'](function(_0x238154){if(_0x238154){return _0x238154['removeAnswers'](_0x4b6a71[_0x14e8('0x46')][_0x14e8('0x6f')]);}})[_0x14e8('0x24')](respondWithStatusCode(_0x2eb108,null))['catch'](handleError(_0x2eb108,null));};exports[_0x14e8('0x73')]=function(_0x4ccc18,_0xcb4d16,_0x53d846){return db['WhatsappAccount']['find']({'where':{'id':_0x4ccc18[_0x14e8('0x58')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0xcb4d16,null))[_0x14e8('0x24')](function(_0x29d121){if(_0x29d121){return _0x29d121['addAgents'](_0x4ccc18['body'][_0x14e8('0x6f')],_['omit'](_0x4ccc18[_0x14e8('0x5b')],[_0x14e8('0x6f'),'id'])||{})['spread'](function(_0x4d80d2){for(var _0x14846c=0x0;_0x14846c<_0x4ccc18[_0x14e8('0x5b')][_0x14e8('0x6f')]['length'];_0x14846c+=0x1){socket[_0x14e8('0x74')]('userWhatsappAccount:save',{'UserId':_0x4ccc18[_0x14e8('0x5b')][_0x14e8('0x6f')][_0x14846c],'WhatsappAccountId':_0x4ccc18[_0x14e8('0x58')]['id']});}return _0x4d80d2;});}})[_0x14e8('0x24')](respondWithResult(_0xcb4d16,null))[_0x14e8('0x2f')](handleError(_0xcb4d16,null));};exports[_0x14e8('0x75')]=function(_0x87e54c,_0x2b512c,_0x110a61){return db[_0x14e8('0x40')][_0x14e8('0x59')]({'where':{'id':_0x87e54c[_0x14e8('0x58')]['id']}})['then'](handleEntityNotFound(_0x2b512c,null))[_0x14e8('0x24')](function(_0x2a0198){if(_0x2a0198){return _0x2a0198[_0x14e8('0x75')](_0x87e54c[_0x14e8('0x46')]['ids'])[_0x14e8('0x24')](function(){if(_['isArray'](_0x87e54c[_0x14e8('0x46')][_0x14e8('0x6f')])){for(var _0x1262c1=0x0;_0x1262c1<_0x87e54c[_0x14e8('0x46')][_0x14e8('0x6f')][_0x14e8('0x4b')];_0x1262c1+=0x1){socket[_0x14e8('0x74')](_0x14e8('0x76'),{'UserId':Number(_0x87e54c[_0x14e8('0x46')][_0x14e8('0x6f')][_0x1262c1]),'WhatsappAccountId':Number(_0x87e54c[_0x14e8('0x58')]['id'])});}}else{socket[_0x14e8('0x74')](_0x14e8('0x76'),{'UserId':Number(_0x87e54c['query']['ids']),'WhatsappAccountId':Number(_0x87e54c[_0x14e8('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x2b512c,null))[_0x14e8('0x2f')](handleError(_0x2b512c,null));};exports[_0x14e8('0x77')]=function(_0x4f9858,_0x312ab0,_0x3cf162){var _0x11f58f={};var _0x130fcb={};var _0x2d2a21;var _0x34475c;return db['WhatsappAccount'][_0x14e8('0x68')]({'where':{'id':_0x4f9858[_0x14e8('0x58')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x312ab0,null))[_0x14e8('0x24')](function(_0x2e7cb9){if(_0x2e7cb9){_0x2d2a21=_0x2e7cb9;_0x130fcb['model']=_[_0x14e8('0x47')](db['User']['rawAttributes']);_0x130fcb[_0x14e8('0x46')]=_[_0x14e8('0x47')](_0x4f9858['query']);_0x130fcb[_0x14e8('0x4e')]=_['intersection'](_0x130fcb[_0x14e8('0x45')],_0x130fcb[_0x14e8('0x46')]);_0x11f58f['attributes']=_[_0x14e8('0x48')](_0x130fcb[_0x14e8('0x45')],qs[_0x14e8('0x49')](_0x4f9858[_0x14e8('0x46')][_0x14e8('0x49')]));_0x11f58f['attributes']=_0x11f58f[_0x14e8('0x4a')][_0x14e8('0x4b')]?_0x11f58f[_0x14e8('0x4a')]:_0x130fcb['model'];_0x11f58f['order']=qs[_0x14e8('0x6b')](_0x4f9858['query']['sort']);_0x11f58f[_0x14e8('0x50')]=qs['filters'](_['pick'](_0x4f9858[_0x14e8('0x46')],_0x130fcb[_0x14e8('0x4e')]));if(_0x4f9858[_0x14e8('0x46')]['filter']){_0x11f58f[_0x14e8('0x50')]=_['merge'](_0x11f58f['where'],{'$or':_['map'](_0x11f58f[_0x14e8('0x4a')],function(_0x23fa20){var _0x1607be={};_0x1607be[_0x23fa20]={'$like':'%'+_0x4f9858[_0x14e8('0x46')][_0x14e8('0x53')]+'%'};return _0x1607be;})});}_0x11f58f=_['merge']({},_0x11f58f,_0x4f9858[_0x14e8('0x54')]);return _0x2d2a21[_0x14e8('0x77')](_0x11f58f);}})[_0x14e8('0x24')](function(_0x348dc9){if(_0x348dc9){_0x34475c=_0x348dc9[_0x14e8('0x4b')];if(!_0x4f9858[_0x14e8('0x46')][_0x14e8('0x4c')](_0x14e8('0x4d'))){_0x11f58f[_0x14e8('0x35')]=qs[_0x14e8('0x35')](_0x4f9858[_0x14e8('0x46')][_0x14e8('0x35')]);_0x11f58f[_0x14e8('0x34')]=qs[_0x14e8('0x34')](_0x4f9858[_0x14e8('0x46')]['offset']);}return _0x2d2a21[_0x14e8('0x77')](_0x11f58f);}})[_0x14e8('0x24')](function(_0x4396fb){if(_0x4396fb){return _0x4396fb?{'count':_0x34475c,'rows':_0x4396fb}:null;}})[_0x14e8('0x24')](respondWithResult(_0x312ab0,null))['catch'](handleError(_0x312ab0,null));};exports[_0x14e8('0x78')]=function(_0x9401b7,_0x2801e9,_0x35da7f){return db['WhatsappAccount'][_0x14e8('0x68')]({'where':{'id':_0x9401b7[_0x14e8('0x58')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x2801e9,null))[_0x14e8('0x24')](function(_0x36ce45){if(_0x36ce45){return db[_0x14e8('0x79')][_0x14e8('0x7a')](function(_0x723645){return db['WhatsappApplication'][_0x14e8('0x39')]({'where':{'WhatsappAccountId':_0x9401b7[_0x14e8('0x58')]['id']},'transaction':_0x723645})[_0x14e8('0x24')](function(_0xc32225){var _0x3c7847=_[_0x14e8('0x3f')](_0x9401b7['body'],function(_0x460e8b){_0x460e8b[_0x14e8('0x67')]=_0x9401b7[_0x14e8('0x58')]['id'];return _0x460e8b;});return db[_0x14e8('0x7b')][_0x14e8('0x7c')](_0x3c7847,{'transaction':_0x723645});});})['then'](function(){return db[_0x14e8('0x7b')][_0x14e8('0x7d')]({'where':{'WhatsappAccountId':_0x9401b7[_0x14e8('0x58')]['id']},'order':_0x14e8('0x7e')});});}})[_0x14e8('0x24')](respondWithResult(_0x2801e9,null))[_0x14e8('0x2f')](handleError(_0x2801e9,null));};exports[_0x14e8('0x7f')]=function(_0x334ec7,_0x4c024d,_0x82622a){var _0x330024={};var _0x107fbc={};var _0x549f96;var _0x3e2159;return db['WhatsappAccount']['findOne']({'where':{'id':_0x334ec7[_0x14e8('0x58')]['id']}})['then'](handleEntityNotFound(_0x4c024d,null))[_0x14e8('0x24')](function(_0x3950fa){if(_0x3950fa){_0x549f96=_0x3950fa;_0x107fbc[_0x14e8('0x45')]=_[_0x14e8('0x47')](db[_0x14e8('0x7b')][_0x14e8('0x41')]);_0x107fbc[_0x14e8('0x46')]=_[_0x14e8('0x47')](_0x334ec7['query']);_0x107fbc[_0x14e8('0x4e')]=_[_0x14e8('0x48')](_0x107fbc[_0x14e8('0x45')],_0x107fbc[_0x14e8('0x46')]);_0x330024[_0x14e8('0x4a')]=_[_0x14e8('0x48')](_0x107fbc[_0x14e8('0x45')],qs['fields'](_0x334ec7['query']['fields']));_0x330024[_0x14e8('0x4a')]=_0x330024[_0x14e8('0x4a')]['length']?_0x330024[_0x14e8('0x4a')]:_0x107fbc['model'];_0x330024[_0x14e8('0x6a')]=qs[_0x14e8('0x6b')](_0x334ec7[_0x14e8('0x46')][_0x14e8('0x6b')]);_0x330024['where']=qs[_0x14e8('0x4e')](_[_0x14e8('0x4f')](_0x334ec7[_0x14e8('0x46')],_0x107fbc[_0x14e8('0x4e')]));if(_0x334ec7[_0x14e8('0x46')]['filter']){_0x330024[_0x14e8('0x50')]=_[_0x14e8('0x51')](_0x330024[_0x14e8('0x50')],{'$or':_['map'](_0x330024['attributes'],function(_0x66f44e){var _0x1d90ee={};_0x1d90ee[_0x66f44e]={'$like':'%'+_0x334ec7[_0x14e8('0x46')][_0x14e8('0x53')]+'%'};return _0x1d90ee;})});}_0x330024=_[_0x14e8('0x51')]({},_0x330024,_0x334ec7['options']);return _0x549f96['getApplications'](_0x330024);}})['then'](function(_0xeff5b6){if(_0xeff5b6){_0x3e2159=_0xeff5b6['length'];if(!_0x334ec7[_0x14e8('0x46')][_0x14e8('0x4c')]('nolimit')){_0x330024['limit']=qs[_0x14e8('0x35')](_0x334ec7[_0x14e8('0x46')]['limit']);_0x330024[_0x14e8('0x34')]=qs[_0x14e8('0x34')](_0x334ec7[_0x14e8('0x46')]['offset']);}return _0x549f96[_0x14e8('0x7f')](_0x330024);}})[_0x14e8('0x24')](function(_0x383f70){if(_0x383f70){return _0x383f70?{'count':_0x3e2159,'rows':_0x383f70}:null;}})[_0x14e8('0x24')](respondWithResult(_0x4c024d,null))['catch'](handleError(_0x4c024d,null));};exports[_0x14e8('0x80')]=function(_0x3b29a7,_0x18adca,_0x236d30){var _0x339f71={'channel':'whatsapp'};var _0x58ca59=[];var _0x4dc977=[];var _0x4611f9={};return db[_0x14e8('0x40')]['find']({'where':{'id':_0x3b29a7['params']['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x14e8('0x81')}]})[_0x14e8('0x24')](handleEntityNotFound(_0x18adca,null))[_0x14e8('0x24')](function(_0x4e11ec){_0x339f71[_0x14e8('0x82')]=_0x4e11ec;_0x339f71[_0x14e8('0x83')]=_[_0x14e8('0x84')](_0x4e11ec[_0x14e8('0x81')],[_0x14e8('0x7e')],[_0x14e8('0x85')]);if(_0x339f71[_0x14e8('0x82')][_0x14e8('0x81')]){delete _0x339f71[_0x14e8('0x82')]['Applications'];}return db['CmContact'][_0x14e8('0x86')]();})[_0x14e8('0x24')](function(_0x242ebc){if(!_0x242ebc){throw new db['Sequelize']['ValidationError'](_0x14e8('0x87'));}_0x58ca59=_[_0x14e8('0x88')](_[_0x14e8('0x47')](_0x242ebc),[_0x14e8('0x89'),_0x14e8('0x8a')]);_0x4dc977=_[_0x14e8('0x88')](_['keys'](_0x242ebc),[_0x14e8('0x89'),_0x14e8('0x8a'),_0x14e8('0x8b'),'ListId']);_0x339f71[_0x14e8('0x5b')]={'mapKey':_0x14e8('0x8c')};if(_0x339f71[_0x14e8('0x82')][_0x14e8('0x43')]&&_0x339f71[_0x14e8('0x82')][_0x14e8('0x43')]===_0x14e8('0x8d')){_0x339f71['body'][_0x14e8('0x8e')]=_0x3b29a7['body']['From'][_0x14e8('0x8f')](_0x14e8('0x90'),'');_0x339f71['body'][_0x14e8('0x5b')]=_0x3b29a7['body'][_0x14e8('0x91')];_0x339f71[_0x14e8('0x5b')]['messageId']=_0x3b29a7['body'][_0x14e8('0x92')];}if(_0x339f71[_0x14e8('0x5b')]['id']){delete _0x339f71[_0x14e8('0x5b')]['id'];}if(_[_0x14e8('0x93')](_0x339f71[_0x14e8('0x5b')][_0x14e8('0x8e')])){throw new db[(_0x14e8('0x20'))][(_0x14e8('0x21'))](_0x14e8('0x94'));}if(_[_0x14e8('0x93')](_0x339f71[_0x14e8('0x5b')]['body'])||_0x339f71[_0x14e8('0x5b')][_0x14e8('0x5b')]===''){throw new db[(_0x14e8('0x20'))]['ValidationError'](_0x14e8('0x95'));}if(_[_0x14e8('0x93')](_0x339f71[_0x14e8('0x5b')]['mapKey'])){throw new db[(_0x14e8('0x20'))][(_0x14e8('0x21'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4dc977);}if(!_[_0x14e8('0x96')](_0x4dc977,_0x339f71[_0x14e8('0x5b')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4dc977);}_0x4611f9[_0x339f71[_0x14e8('0x5b')][_0x14e8('0x97')]]=_0x339f71[_0x14e8('0x5b')]['from'];return db[_0x14e8('0x98')][_0x14e8('0x59')]({'where':{'id':_0x339f71['account'][_0x14e8('0x99')]},'include':[{'model':db[_0x14e8('0x9a')],'as':_0x14e8('0x9b'),'where':_0x4611f9,'limit':0x1,'order':[[_0x14e8('0x8a'),_0x14e8('0x9c')]]}]});})[_0x14e8('0x24')](handleEntityNotFound(_0x18adca,null))['then'](function(_0x3b76ef){if(_0x3b76ef){_0x339f71[_0x14e8('0x9d')]=_['omit'](_0x3b76ef,[_0x14e8('0x9b')]);if(_0x3b76ef[_0x14e8('0x9b')][_0x14e8('0x4b')]){return _0x3b76ef[_0x14e8('0x9b')][0x0];}var _0x2d1b6a=_[_0x14e8('0x1a')](_0x339f71['body'],{'firstName':_0x339f71[_0x14e8('0x5b')][_0x14e8('0x8e')],'ListId':_0x3b76ef['id']});_0x2d1b6a[_0x339f71['body']['mapKey']]=_0x339f71['body'][_0x14e8('0x8e')];return db[_0x14e8('0x9a')]['create'](_0x2d1b6a,{'fields':_0x58ca59,'raw':!![]});}})[_0x14e8('0x24')](handleEntityNotFound(_0x18adca,null))[_0x14e8('0x24')](function(_0x38cd69){if(_0x38cd69){_0x339f71[_0x14e8('0x9e')]=_0x38cd69;var _0x418ff2={'ContactId':_0x38cd69['id'],'phone':_0x339f71[_0x14e8('0x5b')][_0x14e8('0x8e')],'WhatsappAccountId':_0x3b29a7[_0x14e8('0x58')]['id']};var _0x24e019={'ContactId':_0x38cd69['id'],'WhatsappAccountId':_0x3b29a7['params']['id'],'closed':![]};return db[_0x14e8('0x9f')]['find']({'where':_0x24e019})[_0x14e8('0x24')](function(_0x5e9698){if(_0x5e9698){return[_0x5e9698,![]];}return db[_0x14e8('0x9f')][_0x14e8('0x5a')](_0x418ff2)[_0x14e8('0x24')](function(_0x23cfb7){return[_0x23cfb7,!![]];});});}})['spread'](function(_0x28386c,_0x2d9891){_0x339f71['interaction']=_0x28386c[_0x14e8('0x5f')]({'plain':!![]});_0x339f71[_0x14e8('0xa0')][_0x14e8('0xa1')]=![];if(_0x2d9891){if(_0x339f71[_0x14e8('0x82')][_0x14e8('0xa2')]){_0x339f71[_0x14e8('0x83')][_0x14e8('0xa3')]({'id':0x0,'priority':_0x339f71[_0x14e8('0x83')][_0x14e8('0x4b')]+0x1,'app':'close','appdata':_0x14e8('0xa4'),'interval':_0x14e8('0xa5')});}_0x339f71[_0x14e8('0xa0')][_0x14e8('0xa1')]=!![];}return db[_0x14e8('0xa6')][_0x14e8('0x5a')]({'phone':_0x339f71[_0x14e8('0x5b')]['from'],'messageId':_0x339f71[_0x14e8('0x5b')][_0x14e8('0xa7')],'body':_0x339f71[_0x14e8('0x5b')]['body'],'WhatsappAccountId':_0x3b29a7['params']['id'],'WhatsappInteractionId':_0x28386c['id'],'direction':'in','ContactId':_0x28386c[_0x14e8('0xa8')],'AttachmentId':_0x339f71[_0x14e8('0x5b')][_0x14e8('0xa9')]});})[_0x14e8('0x24')](function(_0x5b739d){_0x339f71[_0x14e8('0x2d')]=_0x5b739d;if(_0x339f71[_0x14e8('0xa0')][_0x14e8('0xaa')]){return db['User'][_0x14e8('0x59')]({'attributes':['id',_0x14e8('0x3c')],'where':{'id':_0x339f71[_0x14e8('0xa0')][_0x14e8('0xaa')]}})['then'](function(_0x2f74ab){if(_0x2f74ab){_0x339f71[_0x14e8('0x83')][_0x14e8('0xab')]({'id':0x0,'priority':0x0,'app':_0x14e8('0xac'),'appdata':_0x2f74ab[_0x14e8('0x3c')]+','+(_0x339f71[_0x14e8('0x82')][_0x14e8('0xad')]||0xa),'interval':_0x14e8('0xa5')});}return respondWithRpcPromise(_0x14e8('0xae'),'startRouting',_0x339f71);});}return respondWithRpcPromise(_0x14e8('0xae'),_0x14e8('0xaf'),_0x339f71);})[_0x14e8('0x24')](function(_0x17ce0c){if(_0x17ce0c){var _0x4c38d9=0xc8;var _0x3c6e0b=_0x14e8('0xb0');logger[_0x14e8('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3c6e0b,_0x4c38d9,_0x14e8('0xb1'));logger['debug'](_0x14e8('0xb2'),_0x3c6e0b,_0x4c38d9,'entity\x20found',JSON[_0x14e8('0x29')](_0x17ce0c));if(_0x339f71[_0x14e8('0x82')][_0x14e8('0x43')]===_0x14e8('0x8d')){return _0x18adca[_0x14e8('0x30')](_0x4c38d9)[_0x14e8('0xb3')](_0x14e8('0xb4'),_0x14e8('0xb5'))['send'](_0x14e8('0xb6'));}else{return _0x18adca[_0x14e8('0x30')](_0x4c38d9)[_0x14e8('0x32')](_0x17ce0c);}}})['catch'](handleError(_0x18adca,null));};exports[_0x14e8('0xb7')]=function(_0x22d2e8,_0x506c27,_0x1a330f){var _0x570219,_0x4484cd,_0x5ac161;if(_[_0x14e8('0x93')](_0x22d2e8[_0x14e8('0x5b')][_0x14e8('0x5b')])||_0x22d2e8[_0x14e8('0x5b')][_0x14e8('0x5b')]===''){throw new db['Sequelize']['ValidationError'](_0x14e8('0x95'));}if(_['isNil'](_0x22d2e8['body']['to'])){throw new db[(_0x14e8('0x20'))][(_0x14e8('0x21'))]('to\x20is\x20mandatory');}_0x570219=_0x22d2e8['body']['to'];return db[_0x14e8('0x40')][_0x14e8('0x59')]({'where':{'id':_0x22d2e8[_0x14e8('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0x14e8('0xb8'),'include':[{'model':db[_0x14e8('0x9a')],'as':_0x14e8('0x9b'),'where':{'mobile':_0x570219},'limit':0x1,'order':[[_0x14e8('0x8a'),_0x14e8('0x9c')]]}]}]})[_0x14e8('0x24')](handleEntityNotFound(_0x506c27,null))['then'](function(_0x48fcbc){if(_0x48fcbc&&_0x48fcbc[_0x14e8('0xb8')]){_0x4484cd=_0x48fcbc[_0x14e8('0x5f')]({'plain':!![]});if(_0x4484cd['List']&&_0x4484cd[_0x14e8('0xb8')]['Contacts'][_0x14e8('0x4b')]){return _0x4484cd[_0x14e8('0xb8')][_0x14e8('0x9b')][0x0];}return db[_0x14e8('0x9a')][_0x14e8('0x5a')](_['defaults'](_0x22d2e8[_0x14e8('0x5b')],{'firstName':_0x570219,'mobile':_0x570219,'phone':_0x570219,'ListId':_0x4484cd[_0x14e8('0x99')]}));}})[_0x14e8('0x24')](handleEntityNotFound(_0x506c27,null))[_0x14e8('0x24')](function(_0x3fe1cf){if(_0x3fe1cf){_0x5ac161=_0x3fe1cf;return db[_0x14e8('0x9f')]['find']({'where':{'ContactId':_0x5ac161['id'],'closed':![],'WhatsappAccountId':_0x4484cd['id']}})[_0x14e8('0x24')](function(_0x400b86){if(_0x400b86){return[_0x400b86,![]];}return db['WhatsappInteraction'][_0x14e8('0x5a')]({'UserId':_0x22d2e8[_0x14e8('0x5c')]['id'],'ContactId':_0x5ac161['id'],'WhatsappAccountId':_0x4484cd['id'],'phone':_0x570219,'firstMsgDirection':'out','Messages':[_[_0x14e8('0x51')](_0x22d2e8[_0x14e8('0x5b')],{'read':![],'body':_0x22d2e8[_0x14e8('0x5b')][_0x14e8('0x5b')],'phone':_0x570219,'WhatsappAccountId':_0x4484cd['id'],'UserId':_0x22d2e8[_0x14e8('0x5c')]['id'],'ContactId':_0x5ac161['id']})]},{'include':[{'model':db[_0x14e8('0xa6')],'as':'Messages'}]})[_0x14e8('0x24')](function(_0x1e3c05){return[_0x1e3c05,!![]];});});}})[_0x14e8('0xb9')](function(_0x263777,_0x247061){if(_0x247061){return _0x263777;}return db[_0x14e8('0xa6')]['create'](_[_0x14e8('0x51')](_0x22d2e8[_0x14e8('0x5b')],{'read':![],'body':_0x22d2e8[_0x14e8('0x5b')]['body'],'phone':_0x570219,'WhatsappAccountId':_0x4484cd['id'],'WhatsappInteractionId':_0x263777['id'],'UserId':_0x22d2e8[_0x14e8('0x5c')]['id'],'ContactId':_0x5ac161['id']}))[_0x14e8('0x24')](function(_0x74f292){_0x263777[_0x14e8('0xba')][_0x14e8('0xbb')]=[];_0x263777['dataValues'][_0x14e8('0xbb')][_0x14e8('0xa3')](_0x74f292[_0x14e8('0xba')]);return _0x263777;});})[_0x14e8('0x24')](respondWithResult(_0x506c27,null))[_0x14e8('0x2f')](handleError(_0x506c27,null));}; \ No newline at end of file +var _0x3f8c=['pick','removeAnswers','addAgents','omit','spread','removeAgents','isArray','emit','userWhatsappAccount:remove','User','getAgents','bulkCreate','WhatsappApplication','findAndCountAll','getApplications','notify','whatsapp','Applications','applications','orderBy','priority','asc','account','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','type','From','replace','Body','messageId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','CmList','DESC','list','Contacts','contact','WhatsappInteraction','created','autoclose','push','unmanaged','*,*,*,*','interaction','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','twilio','text/xml','\x0a','to\x20is\x20mandatory','List','CmContact','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','WhatsappAccounts','UserProfileResource','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','includeAll','findAll','rows','show','params','mandatoryDispositionPause','keys','merge','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','body','describe','WhatsappAccountId','getDispositions','findOne','Disposition','nolimit','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers'];(function(_0x24c135,_0xdb4450){var _0x290c66=function(_0x537cf8){while(--_0x537cf8){_0x24c135['push'](_0x24c135['shift']());}};_0x290c66(++_0xdb4450);}(_0x3f8c,0x104));var _0xc3f8=function(_0x4ac296,_0x3171d3){_0x4ac296=_0x4ac296-0x0;var _0x13f2ae=_0x3f8c[_0x4ac296];return _0x13f2ae;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc3f8('0x0'));var zipdir=require(_0xc3f8('0x1'));var jsonpatch=require(_0xc3f8('0x2'));var rp=require(_0xc3f8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc3f8('0x4'));var csv=require(_0xc3f8('0x5'));var ejs=require(_0xc3f8('0x6'));var fs=require('fs');var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x5'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var db=require(_0xc3f8('0x14'))['db'];config[_0xc3f8('0x15')]=_[_0xc3f8('0x16')](config[_0xc3f8('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xc3f8('0x17'))(new Redis(config[_0xc3f8('0x15')]));require(_0xc3f8('0x18'))[_0xc3f8('0x19')](socket);var jayson=require(_0xc3f8('0x1a'));var client=jayson[_0xc3f8('0x1b')][_0xc3f8('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x4731cd,_0x12b141,_0x2fd8e8){if(_0x2fd8e8){var _0x3cb28a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3cb28a[_0xc3f8('0x1d')](_0x12b141)){return _0x4731cd;}else{throw new db[(_0xc3f8('0x1e'))]['ValidationError'](_0xc3f8('0x1f'));}}else{return _0x4731cd;}}function respondWithRpcPromise(_0x4ccca7,_0x51807b,_0x3df137,_0x2e7c0f){return new BPromise(function(_0x35500f,_0xb4ab67){var _0x47a185=_0x2e7c0f||client;return _0x47a185[_0xc3f8('0x20')](_0x4ccca7,_0x3df137)[_0xc3f8('0x21')](function(_0x5df6f9){logger[_0xc3f8('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x51807b,_0xc3f8('0x23'));logger[_0xc3f8('0x24')](_0xc3f8('0x25'),_0x51807b,'request\x20sent',JSON['stringify'](_0x5df6f9));if(_0x5df6f9[_0xc3f8('0x26')]){if(_0x5df6f9[_0xc3f8('0x26')][_0xc3f8('0x27')]===0x1f4){logger[_0xc3f8('0x26')](_0xc3f8('0x28'),_0x51807b,_0x5df6f9[_0xc3f8('0x26')][_0xc3f8('0x29')]);return _0xb4ab67(_0x5df6f9[_0xc3f8('0x26')]['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x51807b,_0x5df6f9[_0xc3f8('0x26')]['message']);return _0x35500f(_0x5df6f9[_0xc3f8('0x26')][_0xc3f8('0x29')]);}else{logger['info'](_0xc3f8('0x28'),_0x51807b,_0xc3f8('0x23'));_0x35500f(_0x5df6f9[_0xc3f8('0x2a')][_0xc3f8('0x29')]);}})[_0xc3f8('0x2b')](function(_0x9d43b4){logger[_0xc3f8('0x26')](_0xc3f8('0x28'),_0x51807b,_0x9d43b4);_0xb4ab67(_0x9d43b4);});});}function respondWithStatusCode(_0x21b002,_0xbea3b8){_0xbea3b8=_0xbea3b8||0xcc;return function(_0x22c8e6){if(_0x22c8e6){return _0x21b002[_0xc3f8('0x2c')](_0xbea3b8);}return _0x21b002[_0xc3f8('0x2d')](_0xbea3b8)[_0xc3f8('0x2e')]();};}function respondWithResult(_0x59e4dd,_0x58b303){_0x58b303=_0x58b303||0xc8;return function(_0x2909f8){if(_0x2909f8){return _0x59e4dd[_0xc3f8('0x2d')](_0x58b303)['json'](_0x2909f8);}};}function respondWithFilteredResult(_0x151bba,_0x4d39a0){return function(_0x2015af){if(_0x2015af){var _0x32343e=_0x2015af[_0xc3f8('0x2f')],_0x47ab53=_0x4d39a0[_0xc3f8('0x30')],_0x48b32e=_0x4d39a0[_0xc3f8('0x30')]+_0x4d39a0[_0xc3f8('0x31')],_0x21a225;if(_0x48b32e>=_0x32343e){_0x48b32e=_0x32343e;_0x21a225=0xc8;}else{_0x21a225=0xce;}_0x151bba[_0xc3f8('0x2d')](_0x21a225);return _0x151bba[_0xc3f8('0x32')](_0xc3f8('0x33'),_0x47ab53+'-'+_0x48b32e+'/'+_0x32343e)[_0xc3f8('0x34')](_0x2015af);}return null;};}function patchUpdates(_0xb3ba8e){return function(_0x52e543){try{jsonpatch[_0xc3f8('0x35')](_0x52e543,_0xb3ba8e,!![]);}catch(_0x85704d){return BPromise[_0xc3f8('0x36')](_0x85704d);}return _0x52e543[_0xc3f8('0x37')]();};}function saveUpdates(_0x31e86,_0x579056){return function(_0x47c4ef){if(_0x47c4ef){return _0x47c4ef[_0xc3f8('0x38')](_0x31e86)[_0xc3f8('0x21')](function(_0x76ef00){return _0x76ef00;});}return null;};}function removeEntity(_0xef5b0c,_0x60e2ca){return function(_0x4e51ac){if(_0x4e51ac){return _0x4e51ac[_0xc3f8('0x39')]()[_0xc3f8('0x21')](function(){var _0x2ba6aa=_0x4e51ac['get']({'plain':!![]});var _0x213c00=_0xc3f8('0x3a');return db[_0xc3f8('0x3b')]['destroy']({'where':{'type':_0x213c00,'resourceId':_0x2ba6aa['id']}})[_0xc3f8('0x21')](function(){return _0x4e51ac;});})[_0xc3f8('0x21')](function(){_0xef5b0c['status'](0xcc)[_0xc3f8('0x2e')]();});}};}function handleEntityNotFound(_0x84d5d2,_0x3c0810){return function(_0x1cda2c){if(!_0x1cda2c){_0x84d5d2[_0xc3f8('0x2c')](0x194);}return _0x1cda2c;};}function handleError(_0x1fddc7,_0x48bc0e){_0x48bc0e=_0x48bc0e||0x1f4;return function(_0x285307){logger[_0xc3f8('0x26')](_0x285307[_0xc3f8('0x3c')]);if(_0x285307[_0xc3f8('0x3d')]){delete _0x285307[_0xc3f8('0x3d')];}_0x1fddc7['status'](_0x48bc0e)[_0xc3f8('0x3e')](_0x285307);};}exports[_0xc3f8('0x3f')]=function(_0xaa4c98,_0x4d430c){var _0x316643={'include':[{'model':db[_0xc3f8('0x40')],'as':'mandatoryDispositionPause'}]},_0x83b7ab={},_0x1e48aa={'count':0x0,'rows':[]};var _0x306182=_[_0xc3f8('0x41')](db[_0xc3f8('0x42')][_0xc3f8('0x43')],function(_0x55ae1f){return{'name':_0x55ae1f[_0xc3f8('0x44')],'type':_0x55ae1f['type']['key']};});_0x83b7ab[_0xc3f8('0x45')]=_[_0xc3f8('0x41')](_0x306182,_0xc3f8('0x3d'));_0x83b7ab[_0xc3f8('0x46')]=_['keys'](_0xaa4c98['query']);_0x83b7ab[_0xc3f8('0x47')]=_[_0xc3f8('0x48')](_0x83b7ab[_0xc3f8('0x45')],_0x83b7ab[_0xc3f8('0x46')]);_0x316643[_0xc3f8('0x49')]=_[_0xc3f8('0x48')](_0x83b7ab[_0xc3f8('0x45')],qs[_0xc3f8('0x4a')](_0xaa4c98[_0xc3f8('0x46')][_0xc3f8('0x4a')]));_0x316643[_0xc3f8('0x49')]=_0x316643['attributes'][_0xc3f8('0x4b')]?_0x316643[_0xc3f8('0x49')]:_0x83b7ab['model'];if(!_0xaa4c98[_0xc3f8('0x46')][_0xc3f8('0x4c')]('nolimit')){_0x316643[_0xc3f8('0x31')]=qs[_0xc3f8('0x31')](_0xaa4c98[_0xc3f8('0x46')][_0xc3f8('0x31')]);_0x316643[_0xc3f8('0x30')]=qs[_0xc3f8('0x30')](_0xaa4c98[_0xc3f8('0x46')][_0xc3f8('0x30')]);}_0x316643[_0xc3f8('0x4d')]=qs[_0xc3f8('0x4e')](_0xaa4c98[_0xc3f8('0x46')]['sort']);_0x316643[_0xc3f8('0x4f')]=qs[_0xc3f8('0x47')](_['pick'](_0xaa4c98[_0xc3f8('0x46')],_0x83b7ab[_0xc3f8('0x47')]),_0x306182);if(_0xaa4c98[_0xc3f8('0x46')][_0xc3f8('0x50')]){_0x316643['where']=_['merge'](_0x316643[_0xc3f8('0x4f')],{'$or':_[_0xc3f8('0x41')](_0x306182,function(_0x33b04a){if(_0x33b04a['type']!==_0xc3f8('0x51')){var _0x3a665e={};_0x3a665e[_0x33b04a[_0xc3f8('0x3d')]]={'$like':'%'+_0xaa4c98[_0xc3f8('0x46')][_0xc3f8('0x50')]+'%'};return _0x3a665e;}})});}_0x316643=_['merge']({},_0x316643,_0xaa4c98[_0xc3f8('0x52')]);var _0x873828={'where':_0x316643['where']};return db[_0xc3f8('0x42')][_0xc3f8('0x2f')](_0x873828)[_0xc3f8('0x21')](function(_0x2916c8){_0x1e48aa[_0xc3f8('0x2f')]=_0x2916c8;if(_0xaa4c98[_0xc3f8('0x46')][_0xc3f8('0x53')]){_0x316643['include']=[{'all':!![]}];}return db[_0xc3f8('0x42')][_0xc3f8('0x54')](_0x316643);})['then'](function(_0x188959){_0x1e48aa[_0xc3f8('0x55')]=_0x188959;return _0x1e48aa;})[_0xc3f8('0x21')](respondWithFilteredResult(_0x4d430c,_0x316643))[_0xc3f8('0x2b')](handleError(_0x4d430c,null));};exports[_0xc3f8('0x56')]=function(_0x41b0df,_0x46aaab){var _0x4d58b2={'raw':![],'where':{'id':_0x41b0df[_0xc3f8('0x57')]['id']},'include':[{'model':db[_0xc3f8('0x40')],'as':_0xc3f8('0x58')}]},_0x36c09a={};_0x36c09a[_0xc3f8('0x45')]=_[_0xc3f8('0x59')](db[_0xc3f8('0x42')][_0xc3f8('0x43')]);_0x36c09a['query']=_['keys'](_0x41b0df[_0xc3f8('0x46')]);_0x36c09a[_0xc3f8('0x47')]=_['intersection'](_0x36c09a['model'],_0x36c09a[_0xc3f8('0x46')]);_0x4d58b2['attributes']=_[_0xc3f8('0x48')](_0x36c09a[_0xc3f8('0x45')],qs[_0xc3f8('0x4a')](_0x41b0df['query'][_0xc3f8('0x4a')]));_0x4d58b2['attributes']=_0x4d58b2['attributes'][_0xc3f8('0x4b')]?_0x4d58b2['attributes']:_0x36c09a[_0xc3f8('0x45')];if(_0x41b0df[_0xc3f8('0x46')][_0xc3f8('0x53')]){_0x4d58b2['include']=[{'all':!![]}];}_0x4d58b2=_[_0xc3f8('0x5a')]({},_0x4d58b2,_0x41b0df[_0xc3f8('0x52')]);return db[_0xc3f8('0x42')][_0xc3f8('0x5b')](_0x4d58b2)[_0xc3f8('0x21')](handleEntityNotFound(_0x46aaab,null))['then'](respondWithResult(_0x46aaab,null))['catch'](handleError(_0x46aaab,null));};exports[_0xc3f8('0x5c')]=function(_0x326dcc,_0x2f1b68){return db[_0xc3f8('0x42')][_0xc3f8('0x5c')](_0x326dcc['body'],{})[_0xc3f8('0x21')](function(_0x496fe3){var _0x21dfc8=_0x326dcc[_0xc3f8('0x5d')][_0xc3f8('0x5e')]({'plain':!![]});if(!_0x21dfc8)throw new Error(_0xc3f8('0x5f'));if(_0x21dfc8['role']===_0xc3f8('0x5d')){var _0x591daf=_0x496fe3['get']({'plain':!![]});var _0x5f184a='WhatsappAccounts';return db[_0xc3f8('0x60')][_0xc3f8('0x5b')]({'where':{'name':_0x5f184a,'userProfileId':_0x21dfc8[_0xc3f8('0x61')]},'raw':!![]})[_0xc3f8('0x21')](function(_0x271b95){if(_0x271b95&&_0x271b95[_0xc3f8('0x62')]===0x0){return db[_0xc3f8('0x3b')][_0xc3f8('0x5c')]({'name':_0x591daf['name'],'resourceId':_0x591daf['id'],'type':_0x271b95[_0xc3f8('0x3d')],'sectionId':_0x271b95['id']},{})[_0xc3f8('0x21')](function(){return _0x496fe3;});}else{return _0x496fe3;}})[_0xc3f8('0x2b')](function(_0x202103){logger[_0xc3f8('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x202103);throw _0x202103;});}return _0x496fe3;})[_0xc3f8('0x21')](respondWithResult(_0x2f1b68,0xc9))[_0xc3f8('0x2b')](handleError(_0x2f1b68,null));};exports[_0xc3f8('0x38')]=function(_0x1aa319,_0xd353c0){if(_0x1aa319['body']['id']){delete _0x1aa319[_0xc3f8('0x63')]['id'];}return db[_0xc3f8('0x42')][_0xc3f8('0x5b')]({'where':{'id':_0x1aa319[_0xc3f8('0x57')]['id']},'include':[{'model':db[_0xc3f8('0x40')],'as':_0xc3f8('0x58')}]})['then'](handleEntityNotFound(_0xd353c0,null))[_0xc3f8('0x21')](saveUpdates(_0x1aa319[_0xc3f8('0x63')],null))[_0xc3f8('0x21')](respondWithResult(_0xd353c0,null))['catch'](handleError(_0xd353c0,null));};exports[_0xc3f8('0x39')]=function(_0x54a6b7,_0x546e3b){return db['WhatsappAccount'][_0xc3f8('0x5b')]({'where':{'id':_0x54a6b7[_0xc3f8('0x57')]['id']}})['then'](handleEntityNotFound(_0x546e3b,null))[_0xc3f8('0x21')](removeEntity(_0x546e3b,null))[_0xc3f8('0x2b')](handleError(_0x546e3b,null));};exports[_0xc3f8('0x64')]=function(_0x44e105,_0x5210b5){return db[_0xc3f8('0x42')][_0xc3f8('0x64')]()[_0xc3f8('0x21')](respondWithResult(_0x5210b5,null))['catch'](handleError(_0x5210b5,null));};exports['addDisposition']=function(_0x228920,_0x5cd8b4,_0x4a1cf5){if(_0x228920['body']['id']){delete _0x228920['body']['id'];}return db['WhatsappAccount'][_0xc3f8('0x5b')]({'where':{'id':_0x228920[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x5cd8b4,null))[_0xc3f8('0x21')](function(_0x4dd44f){if(_0x4dd44f){_0x228920[_0xc3f8('0x63')][_0xc3f8('0x65')]=_0x4dd44f['id'];return db['Disposition'][_0xc3f8('0x5c')](_0x228920[_0xc3f8('0x63')]);}})[_0xc3f8('0x21')](respondWithResult(_0x5cd8b4,null))['catch'](handleError(_0x5cd8b4,null));};exports[_0xc3f8('0x66')]=function(_0x5e3125,_0x59821b,_0x4935ae){var _0x44ecc9={'raw':![],'where':{}};var _0x1866e8={};var _0x56dd86={'count':0x0,'rows':[]};return db[_0xc3f8('0x42')][_0xc3f8('0x67')]({'where':{'id':_0x5e3125['params']['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x59821b,null))[_0xc3f8('0x21')](function(_0x4eea9e){if(_0x4eea9e){_0x1866e8[_0xc3f8('0x45')]=_['keys'](db[_0xc3f8('0x68')][_0xc3f8('0x43')]);_0x1866e8['query']=_['keys'](_0x5e3125[_0xc3f8('0x46')]);_0x1866e8[_0xc3f8('0x47')]=_['intersection'](_0x1866e8[_0xc3f8('0x45')],_0x1866e8['query']);_0x44ecc9[_0xc3f8('0x49')]=_['intersection'](_0x1866e8[_0xc3f8('0x45')],qs[_0xc3f8('0x4a')](_0x5e3125[_0xc3f8('0x46')][_0xc3f8('0x4a')]));_0x44ecc9[_0xc3f8('0x49')]=_0x44ecc9[_0xc3f8('0x49')][_0xc3f8('0x4b')]?_0x44ecc9[_0xc3f8('0x49')]:_0x1866e8[_0xc3f8('0x45')];if(!_0x5e3125['query'][_0xc3f8('0x4c')](_0xc3f8('0x69'))){_0x44ecc9[_0xc3f8('0x31')]=qs[_0xc3f8('0x31')](_0x5e3125[_0xc3f8('0x46')]['limit']);_0x44ecc9[_0xc3f8('0x30')]=qs[_0xc3f8('0x30')](_0x5e3125[_0xc3f8('0x46')][_0xc3f8('0x30')]);}_0x44ecc9[_0xc3f8('0x4d')]=qs['sort'](_0x5e3125[_0xc3f8('0x46')][_0xc3f8('0x4e')]);_0x44ecc9[_0xc3f8('0x4f')]=qs['filters'](_['pick'](_0x5e3125[_0xc3f8('0x46')],_0x1866e8[_0xc3f8('0x47')]));_0x44ecc9[_0xc3f8('0x4f')][_0xc3f8('0x65')]=_0x4eea9e['id'];if(_0x5e3125['query'][_0xc3f8('0x50')]){_0x44ecc9[_0xc3f8('0x4f')]=_[_0xc3f8('0x5a')](_0x44ecc9['where'],{'$or':_[_0xc3f8('0x41')](_0x44ecc9[_0xc3f8('0x49')],function(_0x4bb10a){var _0x478d21={};_0x478d21[_0x4bb10a]={'$like':'%'+_0x5e3125[_0xc3f8('0x46')][_0xc3f8('0x50')]+'%'};return _0x478d21;})});}_0x44ecc9=_['merge']({},_0x44ecc9,_0x5e3125[_0xc3f8('0x52')]);return db[_0xc3f8('0x68')]['count']({'where':_0x44ecc9[_0xc3f8('0x4f')]})['then'](function(_0x3d080a){_0x56dd86['count']=_0x3d080a;if(_0x5e3125[_0xc3f8('0x46')][_0xc3f8('0x53')]){_0x44ecc9[_0xc3f8('0x6a')]=[{'all':!![]}];}return db[_0xc3f8('0x68')][_0xc3f8('0x54')](_0x44ecc9);})[_0xc3f8('0x21')](function(_0x34af4a){_0x56dd86[_0xc3f8('0x55')]=_0x34af4a;return _0x56dd86;});}})[_0xc3f8('0x21')](respondWithFilteredResult(_0x59821b,_0x44ecc9))['catch'](handleError(_0x59821b,null));};exports['removeDispositions']=function(_0x2fef60,_0x49b78a,_0xa2b49d){return db[_0xc3f8('0x42')][_0xc3f8('0x5b')]({'where':{'id':_0x2fef60[_0xc3f8('0x57')]['id']}})['then'](handleEntityNotFound(_0x49b78a,null))[_0xc3f8('0x21')](function(_0x2a10ec){if(_0x2a10ec){return _0x2a10ec[_0xc3f8('0x6b')](_0x2fef60[_0xc3f8('0x46')][_0xc3f8('0x6c')]);}})[_0xc3f8('0x21')](respondWithStatusCode(_0x49b78a,null))[_0xc3f8('0x2b')](handleError(_0x49b78a,null));};exports[_0xc3f8('0x6d')]=function(_0x834a26,_0x5747f0,_0x5134cf){if(_0x834a26[_0xc3f8('0x63')]['id']){delete _0x834a26[_0xc3f8('0x63')]['id'];}return db[_0xc3f8('0x42')]['find']({'where':{'id':_0x834a26[_0xc3f8('0x57')]['id']}})['then'](handleEntityNotFound(_0x5747f0,null))[_0xc3f8('0x21')](function(_0x5ba0f5){if(_0x5ba0f5){_0x834a26[_0xc3f8('0x63')][_0xc3f8('0x65')]=_0x5ba0f5['id'];return db[_0xc3f8('0x6e')][_0xc3f8('0x5c')](_0x834a26[_0xc3f8('0x63')]);}})[_0xc3f8('0x21')](respondWithResult(_0x5747f0,null))[_0xc3f8('0x2b')](handleError(_0x5747f0,null));};exports[_0xc3f8('0x6f')]=function(_0x488c04,_0x3cd57d,_0x209748){var _0x33c670={'raw':![],'where':{}};var _0x278da2={};var _0x4536bf={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xc3f8('0x67')]({'where':{'id':_0x488c04[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x3cd57d,null))[_0xc3f8('0x21')](function(_0x5a0dab){if(_0x5a0dab){_0x278da2['model']=_[_0xc3f8('0x59')](db[_0xc3f8('0x6e')]['rawAttributes']);_0x278da2['query']=_['keys'](_0x488c04[_0xc3f8('0x46')]);_0x278da2['filters']=_[_0xc3f8('0x48')](_0x278da2[_0xc3f8('0x45')],_0x278da2[_0xc3f8('0x46')]);_0x33c670[_0xc3f8('0x49')]=_[_0xc3f8('0x48')](_0x278da2[_0xc3f8('0x45')],qs[_0xc3f8('0x4a')](_0x488c04['query']['fields']));_0x33c670['attributes']=_0x33c670['attributes'][_0xc3f8('0x4b')]?_0x33c670['attributes']:_0x278da2[_0xc3f8('0x45')];if(!_0x488c04[_0xc3f8('0x46')][_0xc3f8('0x4c')]('nolimit')){_0x33c670[_0xc3f8('0x31')]=qs[_0xc3f8('0x31')](_0x488c04['query'][_0xc3f8('0x31')]);_0x33c670[_0xc3f8('0x30')]=qs[_0xc3f8('0x30')](_0x488c04['query'][_0xc3f8('0x30')]);}_0x33c670[_0xc3f8('0x4d')]=qs[_0xc3f8('0x4e')](_0x488c04['query'][_0xc3f8('0x4e')]);_0x33c670[_0xc3f8('0x4f')]=qs[_0xc3f8('0x47')](_[_0xc3f8('0x70')](_0x488c04[_0xc3f8('0x46')],_0x278da2[_0xc3f8('0x47')]));_0x33c670['where'][_0xc3f8('0x65')]=_0x5a0dab['id'];if(_0x488c04[_0xc3f8('0x46')]['filter']){_0x33c670[_0xc3f8('0x4f')]=_[_0xc3f8('0x5a')](_0x33c670['where'],{'$or':_[_0xc3f8('0x41')](_0x33c670[_0xc3f8('0x49')],function(_0x28c1b0){var _0x50e01e={};_0x50e01e[_0x28c1b0]={'$like':'%'+_0x488c04['query'][_0xc3f8('0x50')]+'%'};return _0x50e01e;})});}_0x33c670=_['merge']({},_0x33c670,_0x488c04[_0xc3f8('0x52')]);return db[_0xc3f8('0x6e')][_0xc3f8('0x2f')]({'where':_0x33c670['where']})[_0xc3f8('0x21')](function(_0x127d94){_0x4536bf[_0xc3f8('0x2f')]=_0x127d94;if(_0x488c04[_0xc3f8('0x46')][_0xc3f8('0x53')]){_0x33c670[_0xc3f8('0x6a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xc3f8('0x54')](_0x33c670);})[_0xc3f8('0x21')](function(_0x3bc49b){_0x4536bf[_0xc3f8('0x55')]=_0x3bc49b;return _0x4536bf;});}})[_0xc3f8('0x21')](respondWithFilteredResult(_0x3cd57d,_0x33c670))['catch'](handleError(_0x3cd57d,null));};exports[_0xc3f8('0x71')]=function(_0x3129aa,_0x43deb0,_0x49d640){return db[_0xc3f8('0x42')][_0xc3f8('0x5b')]({'where':{'id':_0x3129aa[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x43deb0,null))[_0xc3f8('0x21')](function(_0x5f24e1){if(_0x5f24e1){return _0x5f24e1[_0xc3f8('0x71')](_0x3129aa[_0xc3f8('0x46')][_0xc3f8('0x6c')]);}})[_0xc3f8('0x21')](respondWithStatusCode(_0x43deb0,null))[_0xc3f8('0x2b')](handleError(_0x43deb0,null));};exports[_0xc3f8('0x72')]=function(_0x2697c7,_0x341a88,_0x147281){return db[_0xc3f8('0x42')][_0xc3f8('0x5b')]({'where':{'id':_0x2697c7['params']['id']}})['then'](handleEntityNotFound(_0x341a88,null))[_0xc3f8('0x21')](function(_0x53e794){if(_0x53e794){return _0x53e794['addAgents'](_0x2697c7[_0xc3f8('0x63')][_0xc3f8('0x6c')],_[_0xc3f8('0x73')](_0x2697c7[_0xc3f8('0x63')],['ids','id'])||{})[_0xc3f8('0x74')](function(_0x34cf54){for(var _0x49dd87=0x0;_0x49dd87<_0x2697c7[_0xc3f8('0x63')][_0xc3f8('0x6c')]['length'];_0x49dd87+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':_0x2697c7[_0xc3f8('0x63')][_0xc3f8('0x6c')][_0x49dd87],'WhatsappAccountId':_0x2697c7[_0xc3f8('0x57')]['id']});}return _0x34cf54;});}})[_0xc3f8('0x21')](respondWithResult(_0x341a88,null))[_0xc3f8('0x2b')](handleError(_0x341a88,null));};exports[_0xc3f8('0x75')]=function(_0x1c77df,_0x15e1f3,_0x1ebbe1){return db['WhatsappAccount']['find']({'where':{'id':_0x1c77df[_0xc3f8('0x57')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x15e1f3,null))[_0xc3f8('0x21')](function(_0x6147d4){if(_0x6147d4){return _0x6147d4[_0xc3f8('0x75')](_0x1c77df[_0xc3f8('0x46')][_0xc3f8('0x6c')])[_0xc3f8('0x21')](function(){if(_[_0xc3f8('0x76')](_0x1c77df['query'][_0xc3f8('0x6c')])){for(var _0x48a7cb=0x0;_0x48a7cb<_0x1c77df['query'][_0xc3f8('0x6c')][_0xc3f8('0x4b')];_0x48a7cb+=0x1){socket[_0xc3f8('0x77')](_0xc3f8('0x78'),{'UserId':Number(_0x1c77df[_0xc3f8('0x46')][_0xc3f8('0x6c')][_0x48a7cb]),'WhatsappAccountId':Number(_0x1c77df['params']['id'])});}}else{socket[_0xc3f8('0x77')](_0xc3f8('0x78'),{'UserId':Number(_0x1c77df[_0xc3f8('0x46')]['ids']),'WhatsappAccountId':Number(_0x1c77df['params']['id'])});}});}})[_0xc3f8('0x21')](respondWithStatusCode(_0x15e1f3,null))[_0xc3f8('0x2b')](handleError(_0x15e1f3,null));};exports['getAgents']=function(_0x20f1a1,_0x367d5a,_0x49f136){var _0x429a4a={};var _0xfec26={};var _0x2f6a2d;var _0xc0e1db;return db[_0xc3f8('0x42')]['findOne']({'where':{'id':_0x20f1a1[_0xc3f8('0x57')]['id']}})['then'](handleEntityNotFound(_0x367d5a,null))[_0xc3f8('0x21')](function(_0x214894){if(_0x214894){_0x2f6a2d=_0x214894;_0xfec26['model']=_[_0xc3f8('0x59')](db[_0xc3f8('0x79')][_0xc3f8('0x43')]);_0xfec26[_0xc3f8('0x46')]=_[_0xc3f8('0x59')](_0x20f1a1[_0xc3f8('0x46')]);_0xfec26[_0xc3f8('0x47')]=_[_0xc3f8('0x48')](_0xfec26[_0xc3f8('0x45')],_0xfec26[_0xc3f8('0x46')]);_0x429a4a[_0xc3f8('0x49')]=_[_0xc3f8('0x48')](_0xfec26[_0xc3f8('0x45')],qs[_0xc3f8('0x4a')](_0x20f1a1[_0xc3f8('0x46')][_0xc3f8('0x4a')]));_0x429a4a[_0xc3f8('0x49')]=_0x429a4a[_0xc3f8('0x49')][_0xc3f8('0x4b')]?_0x429a4a['attributes']:_0xfec26[_0xc3f8('0x45')];_0x429a4a[_0xc3f8('0x4d')]=qs['sort'](_0x20f1a1[_0xc3f8('0x46')]['sort']);_0x429a4a[_0xc3f8('0x4f')]=qs['filters'](_[_0xc3f8('0x70')](_0x20f1a1[_0xc3f8('0x46')],_0xfec26[_0xc3f8('0x47')]));if(_0x20f1a1['query'][_0xc3f8('0x50')]){_0x429a4a[_0xc3f8('0x4f')]=_[_0xc3f8('0x5a')](_0x429a4a[_0xc3f8('0x4f')],{'$or':_[_0xc3f8('0x41')](_0x429a4a[_0xc3f8('0x49')],function(_0x3f78e8){var _0x4af05a={};_0x4af05a[_0x3f78e8]={'$like':'%'+_0x20f1a1[_0xc3f8('0x46')][_0xc3f8('0x50')]+'%'};return _0x4af05a;})});}_0x429a4a=_[_0xc3f8('0x5a')]({},_0x429a4a,_0x20f1a1[_0xc3f8('0x52')]);return _0x2f6a2d[_0xc3f8('0x7a')](_0x429a4a);}})[_0xc3f8('0x21')](function(_0x2eab2c){if(_0x2eab2c){_0xc0e1db=_0x2eab2c[_0xc3f8('0x4b')];if(!_0x20f1a1[_0xc3f8('0x46')][_0xc3f8('0x4c')](_0xc3f8('0x69'))){_0x429a4a[_0xc3f8('0x31')]=qs[_0xc3f8('0x31')](_0x20f1a1[_0xc3f8('0x46')]['limit']);_0x429a4a[_0xc3f8('0x30')]=qs['offset'](_0x20f1a1[_0xc3f8('0x46')]['offset']);}return _0x2f6a2d['getAgents'](_0x429a4a);}})[_0xc3f8('0x21')](function(_0x20c7d7){if(_0x20c7d7){return _0x20c7d7?{'count':_0xc0e1db,'rows':_0x20c7d7}:null;}})[_0xc3f8('0x21')](respondWithResult(_0x367d5a,null))['catch'](handleError(_0x367d5a,null));};exports['addApplications']=function(_0x4664cf,_0x3ad57e,_0x3d5142){return db[_0xc3f8('0x42')][_0xc3f8('0x67')]({'where':{'id':_0x4664cf['params']['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x3ad57e,null))[_0xc3f8('0x21')](function(_0x1e5530){if(_0x1e5530){return db['sequelize']['transaction'](function(_0x3ff247){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x4664cf['params']['id']},'transaction':_0x3ff247})[_0xc3f8('0x21')](function(_0x152a24){var _0x351df2=_[_0xc3f8('0x41')](_0x4664cf['body'],function(_0x1ab09c){_0x1ab09c[_0xc3f8('0x65')]=_0x4664cf[_0xc3f8('0x57')]['id'];return _0x1ab09c;});return db['WhatsappApplication'][_0xc3f8('0x7b')](_0x351df2,{'transaction':_0x3ff247});});})[_0xc3f8('0x21')](function(){return db[_0xc3f8('0x7c')][_0xc3f8('0x7d')]({'where':{'WhatsappAccountId':_0x4664cf[_0xc3f8('0x57')]['id']},'order':'priority'});});}})[_0xc3f8('0x21')](respondWithResult(_0x3ad57e,null))[_0xc3f8('0x2b')](handleError(_0x3ad57e,null));};exports[_0xc3f8('0x7e')]=function(_0x194b4a,_0x450622,_0x21f724){var _0x488ec8={};var _0x46e5ea={};var _0x1a7a20;var _0x51fbe9;return db[_0xc3f8('0x42')][_0xc3f8('0x67')]({'where':{'id':_0x194b4a[_0xc3f8('0x57')]['id']}})['then'](handleEntityNotFound(_0x450622,null))[_0xc3f8('0x21')](function(_0x49b531){if(_0x49b531){_0x1a7a20=_0x49b531;_0x46e5ea[_0xc3f8('0x45')]=_[_0xc3f8('0x59')](db[_0xc3f8('0x7c')][_0xc3f8('0x43')]);_0x46e5ea[_0xc3f8('0x46')]=_[_0xc3f8('0x59')](_0x194b4a[_0xc3f8('0x46')]);_0x46e5ea[_0xc3f8('0x47')]=_[_0xc3f8('0x48')](_0x46e5ea[_0xc3f8('0x45')],_0x46e5ea[_0xc3f8('0x46')]);_0x488ec8[_0xc3f8('0x49')]=_[_0xc3f8('0x48')](_0x46e5ea[_0xc3f8('0x45')],qs[_0xc3f8('0x4a')](_0x194b4a[_0xc3f8('0x46')]['fields']));_0x488ec8[_0xc3f8('0x49')]=_0x488ec8[_0xc3f8('0x49')][_0xc3f8('0x4b')]?_0x488ec8[_0xc3f8('0x49')]:_0x46e5ea[_0xc3f8('0x45')];_0x488ec8['order']=qs[_0xc3f8('0x4e')](_0x194b4a[_0xc3f8('0x46')][_0xc3f8('0x4e')]);_0x488ec8[_0xc3f8('0x4f')]=qs[_0xc3f8('0x47')](_[_0xc3f8('0x70')](_0x194b4a[_0xc3f8('0x46')],_0x46e5ea['filters']));if(_0x194b4a[_0xc3f8('0x46')]['filter']){_0x488ec8['where']=_[_0xc3f8('0x5a')](_0x488ec8[_0xc3f8('0x4f')],{'$or':_[_0xc3f8('0x41')](_0x488ec8[_0xc3f8('0x49')],function(_0x3fe57b){var _0x56809e={};_0x56809e[_0x3fe57b]={'$like':'%'+_0x194b4a[_0xc3f8('0x46')]['filter']+'%'};return _0x56809e;})});}_0x488ec8=_[_0xc3f8('0x5a')]({},_0x488ec8,_0x194b4a[_0xc3f8('0x52')]);return _0x1a7a20['getApplications'](_0x488ec8);}})[_0xc3f8('0x21')](function(_0x2b6193){if(_0x2b6193){_0x51fbe9=_0x2b6193['length'];if(!_0x194b4a[_0xc3f8('0x46')][_0xc3f8('0x4c')](_0xc3f8('0x69'))){_0x488ec8[_0xc3f8('0x31')]=qs[_0xc3f8('0x31')](_0x194b4a[_0xc3f8('0x46')][_0xc3f8('0x31')]);_0x488ec8[_0xc3f8('0x30')]=qs[_0xc3f8('0x30')](_0x194b4a[_0xc3f8('0x46')][_0xc3f8('0x30')]);}return _0x1a7a20['getApplications'](_0x488ec8);}})[_0xc3f8('0x21')](function(_0x5b56b7){if(_0x5b56b7){return _0x5b56b7?{'count':_0x51fbe9,'rows':_0x5b56b7}:null;}})[_0xc3f8('0x21')](respondWithResult(_0x450622,null))['catch'](handleError(_0x450622,null));};exports[_0xc3f8('0x7f')]=function(_0x30d7cb,_0x5f2eac,_0x51a65d){var _0x4aea58={'channel':_0xc3f8('0x80')};var _0xbc517d=[];var _0x329b76=[];var _0x159604={};return db[_0xc3f8('0x42')][_0xc3f8('0x5b')]({'where':{'id':_0x30d7cb[_0xc3f8('0x57')]['id']},'include':[{'model':db[_0xc3f8('0x7c')],'as':_0xc3f8('0x81')}]})[_0xc3f8('0x21')](handleEntityNotFound(_0x5f2eac,null))[_0xc3f8('0x21')](function(_0x149355){_0x4aea58['account']=_0x149355;_0x4aea58[_0xc3f8('0x82')]=_[_0xc3f8('0x83')](_0x149355[_0xc3f8('0x81')],[_0xc3f8('0x84')],[_0xc3f8('0x85')]);if(_0x4aea58[_0xc3f8('0x86')][_0xc3f8('0x81')]){delete _0x4aea58[_0xc3f8('0x86')][_0xc3f8('0x81')];}return db['CmContact'][_0xc3f8('0x64')]();})[_0xc3f8('0x21')](function(_0x36647b){if(!_0x36647b){throw new db[(_0xc3f8('0x1e'))][(_0xc3f8('0x87'))](_0xc3f8('0x88'));}_0xbc517d=_[_0xc3f8('0x89')](_[_0xc3f8('0x59')](_0x36647b),[_0xc3f8('0x8a'),_0xc3f8('0x8b')]);_0x329b76=_[_0xc3f8('0x89')](_[_0xc3f8('0x59')](_0x36647b),[_0xc3f8('0x8a'),_0xc3f8('0x8b'),_0xc3f8('0x8c'),_0xc3f8('0x8d')]);_0x4aea58[_0xc3f8('0x63')]={'mapKey':_0xc3f8('0x8e')};if(_0x4aea58[_0xc3f8('0x86')][_0xc3f8('0x8f')]&&_0x4aea58[_0xc3f8('0x86')][_0xc3f8('0x8f')]==='twilio'){_0x4aea58['body']['from']=_0x30d7cb[_0xc3f8('0x63')][_0xc3f8('0x90')][_0xc3f8('0x91')]('whatsapp:','');_0x4aea58['body']['body']=_0x30d7cb[_0xc3f8('0x63')][_0xc3f8('0x92')];_0x4aea58[_0xc3f8('0x63')][_0xc3f8('0x93')]=_0x30d7cb[_0xc3f8('0x63')]['MessageSid'];}if(_0x4aea58['body']['id']){delete _0x4aea58[_0xc3f8('0x63')]['id'];}if(_['isNil'](_0x4aea58['body'][_0xc3f8('0x94')])){throw new db[(_0xc3f8('0x1e'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xc3f8('0x95')](_0x4aea58[_0xc3f8('0x63')][_0xc3f8('0x63')])||_0x4aea58[_0xc3f8('0x63')]['body']===''){throw new db[(_0xc3f8('0x1e'))][(_0xc3f8('0x87'))](_0xc3f8('0x96'));}if(_[_0xc3f8('0x95')](_0x4aea58[_0xc3f8('0x63')]['mapKey'])){throw new db[(_0xc3f8('0x1e'))][(_0xc3f8('0x87'))](_0xc3f8('0x97')+_0x329b76);}if(!_[_0xc3f8('0x98')](_0x329b76,_0x4aea58[_0xc3f8('0x63')]['mapKey'])){throw new db[(_0xc3f8('0x1e'))][(_0xc3f8('0x87'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x329b76);}_0x159604[_0x4aea58['body'][_0xc3f8('0x99')]]=_0x4aea58[_0xc3f8('0x63')][_0xc3f8('0x94')];return db[_0xc3f8('0x9a')][_0xc3f8('0x5b')]({'where':{'id':_0x4aea58['account'][_0xc3f8('0x8d')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x159604,'limit':0x1,'order':[[_0xc3f8('0x8b'),_0xc3f8('0x9b')]]}]});})[_0xc3f8('0x21')](handleEntityNotFound(_0x5f2eac,null))[_0xc3f8('0x21')](function(_0x2087f7){if(_0x2087f7){_0x4aea58[_0xc3f8('0x9c')]=_[_0xc3f8('0x73')](_0x2087f7,[_0xc3f8('0x9d')]);if(_0x2087f7[_0xc3f8('0x9d')]['length']){return _0x2087f7[_0xc3f8('0x9d')][0x0];}var _0x60151f=_[_0xc3f8('0x16')](_0x4aea58['body'],{'firstName':_0x4aea58[_0xc3f8('0x63')][_0xc3f8('0x94')],'ListId':_0x2087f7['id']});_0x60151f[_0x4aea58[_0xc3f8('0x63')][_0xc3f8('0x99')]]=_0x4aea58[_0xc3f8('0x63')][_0xc3f8('0x94')];return db['CmContact']['create'](_0x60151f,{'fields':_0xbc517d,'raw':!![]});}})[_0xc3f8('0x21')](handleEntityNotFound(_0x5f2eac,null))['then'](function(_0x241808){if(_0x241808){_0x4aea58[_0xc3f8('0x9e')]=_0x241808;var _0x131c87={'ContactId':_0x241808['id'],'phone':_0x4aea58['body']['from'],'WhatsappAccountId':_0x30d7cb[_0xc3f8('0x57')]['id']};var _0x11b57b={'ContactId':_0x241808['id'],'WhatsappAccountId':_0x30d7cb[_0xc3f8('0x57')]['id'],'closed':![]};return db[_0xc3f8('0x9f')][_0xc3f8('0x5b')]({'where':_0x11b57b})[_0xc3f8('0x21')](function(_0x5f3167){if(_0x5f3167){return[_0x5f3167,![]];}return db[_0xc3f8('0x9f')][_0xc3f8('0x5c')](_0x131c87)[_0xc3f8('0x21')](function(_0x4c4a38){return[_0x4c4a38,!![]];});});}})[_0xc3f8('0x74')](function(_0x31d85b,_0x56e0bc){_0x4aea58['interaction']=_0x31d85b[_0xc3f8('0x5e')]({'plain':!![]});_0x4aea58['interaction'][_0xc3f8('0xa0')]=![];if(_0x56e0bc){if(_0x4aea58['account'][_0xc3f8('0xa1')]){_0x4aea58[_0xc3f8('0x82')][_0xc3f8('0xa2')]({'id':0x0,'priority':_0x4aea58[_0xc3f8('0x82')][_0xc3f8('0x4b')]+0x1,'app':'close','appdata':_0xc3f8('0xa3'),'interval':_0xc3f8('0xa4')});}_0x4aea58[_0xc3f8('0xa5')]['created']=!![];}return db[_0xc3f8('0xa6')][_0xc3f8('0x5c')]({'phone':_0x4aea58[_0xc3f8('0x63')][_0xc3f8('0x94')],'messageId':_0x4aea58[_0xc3f8('0x63')][_0xc3f8('0x93')],'body':_0x4aea58['body']['body'],'WhatsappAccountId':_0x30d7cb[_0xc3f8('0x57')]['id'],'WhatsappInteractionId':_0x31d85b['id'],'direction':'in','ContactId':_0x31d85b[_0xc3f8('0xa7')],'AttachmentId':_0x4aea58[_0xc3f8('0x63')][_0xc3f8('0xa8')]});})['then'](function(_0x302062){_0x4aea58[_0xc3f8('0x29')]=_0x302062;if(_0x4aea58[_0xc3f8('0xa5')]['UserId']){return db[_0xc3f8('0x79')][_0xc3f8('0x5b')]({'attributes':['id',_0xc3f8('0x3d')],'where':{'id':_0x4aea58[_0xc3f8('0xa5')][_0xc3f8('0xa9')]}})[_0xc3f8('0x21')](function(_0x103abc){if(_0x103abc){_0x4aea58[_0xc3f8('0x82')][_0xc3f8('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x103abc[_0xc3f8('0x3d')]+','+(_0x4aea58[_0xc3f8('0x86')][_0xc3f8('0xab')]||0xa),'interval':_0xc3f8('0xa4')});}return respondWithRpcPromise(_0xc3f8('0xac'),_0xc3f8('0xad'),_0x4aea58);});}return respondWithRpcPromise('Start','startRouting',_0x4aea58);})[_0xc3f8('0x21')](function(_0x49fe32){if(_0x49fe32){var _0x3e4819=0xc8;var _0x932db6=_0xc3f8('0xae');logger[_0xc3f8('0x22')](_0xc3f8('0x25'),_0x932db6,_0x3e4819,'entity\x20found');logger['debug'](_0xc3f8('0xaf'),_0x932db6,_0x3e4819,_0xc3f8('0xb0'),JSON[_0xc3f8('0xb1')](_0x49fe32));if(_0x4aea58[_0xc3f8('0x86')][_0xc3f8('0x8f')]===_0xc3f8('0xb2')){return _0x5f2eac[_0xc3f8('0x2d')](_0x3e4819)[_0xc3f8('0x32')]('Content-Type',_0xc3f8('0xb3'))[_0xc3f8('0x3e')](_0xc3f8('0xb4'));}else{return _0x5f2eac[_0xc3f8('0x2d')](_0x3e4819)['json'](_0x49fe32);}}})[_0xc3f8('0x2b')](handleError(_0x5f2eac,null));};exports[_0xc3f8('0x3e')]=function(_0x522759,_0x2eeb45,_0x4da608){var _0x59c31a,_0x1c3b72,_0x5b0e13;if(_[_0xc3f8('0x95')](_0x522759[_0xc3f8('0x63')]['body'])||_0x522759['body']['body']===''){throw new db[(_0xc3f8('0x1e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc3f8('0x95')](_0x522759['body']['to'])){throw new db['Sequelize'][(_0xc3f8('0x87'))](_0xc3f8('0xb5'));}_0x59c31a=_0x522759[_0xc3f8('0x63')]['to'];return db[_0xc3f8('0x42')]['find']({'where':{'id':_0x522759[_0xc3f8('0x57')]['id']},'include':[{'model':db[_0xc3f8('0x9a')],'as':_0xc3f8('0xb6'),'include':[{'model':db[_0xc3f8('0xb7')],'as':_0xc3f8('0x9d'),'where':{'mobile':_0x59c31a},'limit':0x1,'order':[[_0xc3f8('0x8b'),_0xc3f8('0x9b')]]}]}]})[_0xc3f8('0x21')](handleEntityNotFound(_0x2eeb45,null))[_0xc3f8('0x21')](function(_0x31a511){if(_0x31a511&&_0x31a511['List']){_0x1c3b72=_0x31a511[_0xc3f8('0x5e')]({'plain':!![]});if(_0x1c3b72[_0xc3f8('0xb6')]&&_0x1c3b72[_0xc3f8('0xb6')][_0xc3f8('0x9d')][_0xc3f8('0x4b')]){return _0x1c3b72['List'][_0xc3f8('0x9d')][0x0];}return db[_0xc3f8('0xb7')][_0xc3f8('0x5c')](_['defaults'](_0x522759[_0xc3f8('0x63')],{'firstName':_0x59c31a,'mobile':_0x59c31a,'phone':_0x59c31a,'ListId':_0x1c3b72[_0xc3f8('0x8d')]}));}})['then'](handleEntityNotFound(_0x2eeb45,null))[_0xc3f8('0x21')](function(_0x3ace83){if(_0x3ace83){_0x5b0e13=_0x3ace83;return db[_0xc3f8('0x9f')][_0xc3f8('0x5b')]({'where':{'ContactId':_0x5b0e13['id'],'closed':![],'WhatsappAccountId':_0x1c3b72['id']}})[_0xc3f8('0x21')](function(_0x2f1709){if(_0x2f1709){return[_0x2f1709,![]];}return db[_0xc3f8('0x9f')][_0xc3f8('0x5c')]({'UserId':_0x522759[_0xc3f8('0x5d')]['id'],'ContactId':_0x5b0e13['id'],'WhatsappAccountId':_0x1c3b72['id'],'phone':_0x59c31a,'firstMsgDirection':'out','Messages':[_[_0xc3f8('0x5a')](_0x522759[_0xc3f8('0x63')],{'read':![],'body':_0x522759[_0xc3f8('0x63')]['body'],'phone':_0x59c31a,'WhatsappAccountId':_0x1c3b72['id'],'UserId':_0x522759['user']['id'],'ContactId':_0x5b0e13['id']})]},{'include':[{'model':db[_0xc3f8('0xa6')],'as':_0xc3f8('0xb8')}]})[_0xc3f8('0x21')](function(_0x27a34f){return[_0x27a34f,!![]];});});}})[_0xc3f8('0x74')](function(_0x4502ad,_0x1263b4){if(_0x1263b4){return _0x4502ad;}return db[_0xc3f8('0xa6')][_0xc3f8('0x5c')](_[_0xc3f8('0x5a')](_0x522759[_0xc3f8('0x63')],{'read':![],'body':_0x522759[_0xc3f8('0x63')]['body'],'phone':_0x59c31a,'WhatsappAccountId':_0x1c3b72['id'],'WhatsappInteractionId':_0x4502ad['id'],'UserId':_0x522759[_0xc3f8('0x5d')]['id'],'ContactId':_0x5b0e13['id']}))[_0xc3f8('0x21')](function(_0x257e20){_0x4502ad[_0xc3f8('0xb9')][_0xc3f8('0xb8')]=[];_0x4502ad[_0xc3f8('0xb9')][_0xc3f8('0xb8')][_0xc3f8('0xa2')](_0x257e20[_0xc3f8('0xb9')]);return _0x4502ad;});})['then'](respondWithResult(_0x2eeb45,null))['catch'](handleError(_0x2eeb45,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index f03feac..6d9e18a 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 _0x0eeb=['../../mysqldb','WhatsappAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x1badb1,_0x375ec6){var _0x260dae=function(_0x2f3bbc){while(--_0x2f3bbc){_0x1badb1['push'](_0x1badb1['shift']());}};_0x260dae(++_0x375ec6);}(_0x0eeb,0xc5));var _0xb0ee=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0eeb[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xb0ee('0x0'));var WhatsappAccount=require(_0xb0ee('0x1'))['db'][_0xb0ee('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xb0ee('0x3')](0x0);var events={'afterCreate':_0xb0ee('0x4'),'afterUpdate':_0xb0ee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5add55){return function(_0x3b94a0,_0xfbf0cc,_0x13a7ce){WhatsappAccountEvents[_0xb0ee('0x6')](_0x5add55+':'+_0x3b94a0['id'],_0x3b94a0);WhatsappAccountEvents[_0xb0ee('0x6')](_0x5add55,_0x3b94a0);_0x13a7ce(null);};}for(var e in events){if(events[_0xb0ee('0x7')](e)){var event=events[e];WhatsappAccount[_0xb0ee('0x8')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x6931=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x1dff39,_0x1cf83c){var _0x18bc86=function(_0x4971cb){while(--_0x4971cb){_0x1dff39['push'](_0x1dff39['shift']());}};_0x18bc86(++_0x1cf83c);}(_0x6931,0x1a9));var _0x1693=function(_0x5355a3,_0x47574f){_0x5355a3=_0x5355a3-0x0;var _0x18d734=_0x6931[_0x5355a3];return _0x18d734;};'use strict';var EventEmitter=require(_0x1693('0x0'));var WhatsappAccount=require(_0x1693('0x1'))['db'][_0x1693('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x1693('0x3')](0x0);var events={'afterCreate':_0x1693('0x4'),'afterUpdate':_0x1693('0x5'),'afterDestroy':_0x1693('0x6')};function emitEvent(_0x2cb142){return function(_0x59d148,_0x19ff1c,_0x2ca960){WhatsappAccountEvents[_0x1693('0x7')](_0x2cb142+':'+_0x59d148['id'],_0x59d148);WhatsappAccountEvents[_0x1693('0x7')](_0x2cb142,_0x59d148);_0x2ca960(null);};}for(var e in events){if(events[_0x1693('0x8')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x1693('0x9')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index a6dd5e1..6543227 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 _0xa67c=['moment','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','define','WhatsappAccount','api'];(function(_0x2127f2,_0xf06f32){var _0x233528=function(_0x1656cb){while(--_0x1656cb){_0x2127f2['push'](_0x2127f2['shift']());}};_0x233528(++_0xf06f32);}(_0xa67c,0x10d));var _0xca67=function(_0x573505,_0xa9962f){_0x573505=_0x573505-0x0;var _0x4658f4=_0xa67c[_0x573505];return _0x4658f4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xca67('0x0'));var moment=require(_0xca67('0x1'));var BPromise=require('bluebird');var rp=require(_0xca67('0x2'));var fs=require('fs');var path=require(_0xca67('0x3'));var rimraf=require(_0xca67('0x4'));var config=require(_0xca67('0x5'));var attributes=require(_0xca67('0x6'));module['exports']=function(_0x14f86d,_0x33a01b){return _0x14f86d[_0xca67('0x7')](_0xca67('0x8'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x150d=['path','./whatsappAccount.attributes','define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3489f2,_0x2229e8){var _0x387f26=function(_0x3f6201){while(--_0x3f6201){_0x3489f2['push'](_0x3489f2['shift']());}};_0x387f26(++_0x2229e8);}(_0x150d,0x1d9));var _0xd150=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0x150d[_0x184759];return _0xf26d5f;};'use strict';var _=require(_0xd150('0x0'));var util=require(_0xd150('0x1'));var logger=require(_0xd150('0x2'))(_0xd150('0x3'));var moment=require(_0xd150('0x4'));var BPromise=require(_0xd150('0x5'));var rp=require(_0xd150('0x6'));var fs=require('fs');var path=require(_0xd150('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd150('0x8'));module['exports']=function(_0x500061,_0x3c760a){return _0x500061[_0xd150('0x9')](_0xd150('0xa'),attributes,{'tableName':_0xd150('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 5721ff8..16158ff 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 _0x91d1=['error','code','message','result','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','model','map','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','register','then','info','WhatsappAccount,\x20%s,\x20%s','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x131fe7,_0x21fcdb){var _0x2eddf3=function(_0x1be350){while(--_0x1be350){_0x131fe7['push'](_0x131fe7['shift']());}};_0x2eddf3(++_0x21fcdb);}(_0x91d1,0x17a));var _0x191d=function(_0xff7e06,_0x507ec9){_0xff7e06=_0xff7e06-0x0;var _0x49276a=_0x91d1[_0xff7e06];return _0x49276a;};'use strict';var _=require('lodash');var util=require(_0x191d('0x0'));var moment=require(_0x191d('0x1'));var BPromise=require(_0x191d('0x2'));var rs=require(_0x191d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x191d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x191d('0x5'))(_0x191d('0x6'));var config=require('../../config/environment');var jayson=require(_0x191d('0x7'));var client=jayson[_0x191d('0x8')]['http']({'port':0x232a});config[_0x191d('0x9')]=_[_0x191d('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x191d('0xb')](socket);function respondWithRpcPromise(_0x46e2dc,_0x2329ea,_0x6e51ea){return new BPromise(function(_0x16a645,_0x538955){return client['request'](_0x46e2dc,_0x6e51ea)[_0x191d('0xc')](function(_0x428d8c){logger[_0x191d('0xd')](_0x191d('0xe'),_0x2329ea,'request\x20sent');logger['debug'](_0x191d('0xf'),_0x2329ea,_0x191d('0x10'),JSON[_0x191d('0x11')](_0x428d8c));if(_0x428d8c[_0x191d('0x12')]){if(_0x428d8c[_0x191d('0x12')][_0x191d('0x13')]===0x1f4){logger[_0x191d('0x12')]('WhatsappAccount,\x20%s,\x20%s',_0x2329ea,_0x428d8c[_0x191d('0x12')][_0x191d('0x14')]);return _0x538955(_0x428d8c['error']['message']);}logger['error'](_0x191d('0xe'),_0x2329ea,_0x428d8c[_0x191d('0x12')][_0x191d('0x14')]);return _0x16a645(_0x428d8c['error']['message']);}else{logger[_0x191d('0xd')](_0x191d('0xe'),_0x2329ea,_0x191d('0x10'));_0x16a645(_0x428d8c[_0x191d('0x15')]['message']);}})['catch'](function(_0x3bbe4a){logger[_0x191d('0x12')](_0x191d('0xe'),_0x2329ea,_0x3bbe4a);_0x538955(_0x3bbe4a);});});}exports[_0x191d('0x16')]=function(_0x21bf53){var _0x1ab948=this;return new Promise(function(_0x358cb1,_0x43eb9d){return db[_0x191d('0x17')][_0x191d('0x18')]({'raw':_0x21bf53[_0x191d('0x19')]?_0x21bf53['options'][_0x191d('0x1a')]===undefined?!![]:![]:!![],'where':_0x21bf53['options']?_0x21bf53['options'][_0x191d('0x1b')]||null:null,'attributes':_0x21bf53[_0x191d('0x19')]?_0x21bf53[_0x191d('0x19')][_0x191d('0x1c')]||null:null,'include':_0x21bf53[_0x191d('0x19')]?_0x21bf53[_0x191d('0x19')][_0x191d('0x1d')]?_['map'](_0x21bf53[_0x191d('0x19')][_0x191d('0x1d')],function(_0x39f586){return{'model':db[_0x39f586[_0x191d('0x1e')]],'as':_0x39f586['as'],'attributes':_0x39f586['attributes'],'include':_0x39f586[_0x191d('0x1d')]?_[_0x191d('0x1f')](_0x39f586['include'],function(_0x1f3ed8){return{'model':db[_0x1f3ed8[_0x191d('0x1e')]],'as':_0x1f3ed8['as'],'attributes':_0x1f3ed8[_0x191d('0x1c')],'include':_0x1f3ed8[_0x191d('0x1d')]?_[_0x191d('0x1f')](_0x1f3ed8[_0x191d('0x1d')],function(_0x121b43){return{'model':db[_0x121b43[_0x191d('0x1e')]],'as':_0x121b43['as'],'attributes':_0x121b43['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2361b1){logger[_0x191d('0xd')](_0x191d('0x16'),_0x21bf53);logger['debug'](_0x191d('0x16'),_0x21bf53,JSON[_0x191d('0x11')](_0x2361b1));_0x358cb1(_0x2361b1);})[_0x191d('0x20')](function(_0x3cba2e){logger[_0x191d('0x12')](_0x191d('0x16'),_0x3cba2e['message'],_0x21bf53);_0x43eb9d(_0x1ab948['error'](0x1f4,_0x3cba2e[_0x191d('0x14')]));});});}; \ No newline at end of file +var _0x781f=['debug','stringify','error','message','ShowWhatsappAccount','find','options','where','map','include','model','attributes','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x56c70f,_0x4e4493){var _0x3812ed=function(_0x25460f){while(--_0x25460f){_0x56c70f['push'](_0x56c70f['shift']());}};_0x3812ed(++_0x4e4493);}(_0x781f,0x13f));var _0xf781=function(_0x55d829,_0x43f06c){_0x55d829=_0x55d829-0x0;var _0x52163b=_0x781f[_0x55d829];return _0x52163b;};'use strict';var _=require(_0xf781('0x0'));var util=require(_0xf781('0x1'));var moment=require('moment');var BPromise=require(_0xf781('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf781('0x3'));var db=require(_0xf781('0x4'))['db'];var utils=require(_0xf781('0x5'));var logger=require(_0xf781('0x6'))(_0xf781('0x7'));var config=require(_0xf781('0x8'));var jayson=require(_0xf781('0x9'));var client=jayson[_0xf781('0xa')][_0xf781('0xb')]({'port':0x232a});config[_0xf781('0xc')]=_[_0xf781('0xd')](config[_0xf781('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf781('0xe'))(new Redis(config[_0xf781('0xc')]));require('./whatsappAccount.socket')[_0xf781('0xf')](socket);function respondWithRpcPromise(_0x3740ce,_0x1b7f16,_0x352560){return new BPromise(function(_0x1fbf91,_0x34a34d){return client[_0xf781('0x10')](_0x3740ce,_0x352560)[_0xf781('0x11')](function(_0x291145){logger[_0xf781('0x12')](_0xf781('0x13'),_0x1b7f16,_0xf781('0x14'));logger[_0xf781('0x15')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x1b7f16,'request\x20sent',JSON[_0xf781('0x16')](_0x291145));if(_0x291145['error']){if(_0x291145['error']['code']===0x1f4){logger[_0xf781('0x17')](_0xf781('0x13'),_0x1b7f16,_0x291145['error'][_0xf781('0x18')]);return _0x34a34d(_0x291145['error'][_0xf781('0x18')]);}logger[_0xf781('0x17')](_0xf781('0x13'),_0x1b7f16,_0x291145[_0xf781('0x17')]['message']);return _0x1fbf91(_0x291145[_0xf781('0x17')]['message']);}else{logger[_0xf781('0x12')](_0xf781('0x13'),_0x1b7f16,_0xf781('0x14'));_0x1fbf91(_0x291145['result'][_0xf781('0x18')]);}})['catch'](function(_0x477f98){logger[_0xf781('0x17')]('WhatsappAccount,\x20%s,\x20%s',_0x1b7f16,_0x477f98);_0x34a34d(_0x477f98);});});}exports[_0xf781('0x19')]=function(_0x4a3f85){var _0x4f7b18=this;return new Promise(function(_0x452943,_0x574c3c){return db['WhatsappAccount'][_0xf781('0x1a')]({'raw':_0x4a3f85[_0xf781('0x1b')]?_0x4a3f85[_0xf781('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4a3f85['options']?_0x4a3f85[_0xf781('0x1b')][_0xf781('0x1c')]||null:null,'attributes':_0x4a3f85[_0xf781('0x1b')]?_0x4a3f85['options']['attributes']||null:null,'include':_0x4a3f85['options']?_0x4a3f85[_0xf781('0x1b')]['include']?_[_0xf781('0x1d')](_0x4a3f85[_0xf781('0x1b')][_0xf781('0x1e')],function(_0x2e130a){return{'model':db[_0x2e130a[_0xf781('0x1f')]],'as':_0x2e130a['as'],'attributes':_0x2e130a['attributes'],'include':_0x2e130a[_0xf781('0x1e')]?_['map'](_0x2e130a[_0xf781('0x1e')],function(_0x39103a){return{'model':db[_0x39103a[_0xf781('0x1f')]],'as':_0x39103a['as'],'attributes':_0x39103a[_0xf781('0x20')],'include':_0x39103a[_0xf781('0x1e')]?_[_0xf781('0x1d')](_0x39103a[_0xf781('0x1e')],function(_0x110f27){return{'model':db[_0x110f27['model']],'as':_0x110f27['as'],'attributes':_0x110f27['attributes']};}):[]};}):[]};}):[]:[]})[_0xf781('0x11')](function(_0x69e0a7){logger[_0xf781('0x12')](_0xf781('0x19'),_0x4a3f85);logger[_0xf781('0x15')](_0xf781('0x19'),_0x4a3f85,JSON[_0xf781('0x16')](_0x69e0a7));_0x452943(_0x69e0a7);})[_0xf781('0x21')](function(_0x5ec1f6){logger[_0xf781('0x17')](_0xf781('0x19'),_0x5ec1f6['message'],_0x4a3f85);_0x574c3c(_0x4f7b18[_0xf781('0x17')](0x1f4,_0x5ec1f6[_0xf781('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index ee90ea5..8373cc9 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 _0xbb2a=['save','remove','update','emit','removeListener','length','whatsappAccount:'];(function(_0xcf131b,_0x45d38f){var _0x52844d=function(_0x4079e0){while(--_0x4079e0){_0xcf131b['push'](_0xcf131b['shift']());}};_0x52844d(++_0x45d38f);}(_0xbb2a,0x11f));var _0xabb2=function(_0x5442e7,_0x1a4021){_0x5442e7=_0x5442e7-0x0;var _0x583552=_0xbb2a[_0x5442e7];return _0x583552;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0xabb2('0x0'),_0xabb2('0x1'),_0xabb2('0x2')];function createListener(_0x1d2150,_0x1f52ba){return function(_0x55f513){_0x1f52ba[_0xabb2('0x3')](_0x1d2150,_0x55f513);};}function removeListener(_0x6b225c,_0x449bc9){return function(){WhatsappAccountEvents[_0xabb2('0x4')](_0x6b225c,_0x449bc9);};}exports['register']=function(_0x21ba62){for(var _0x1577e1=0x0,_0x412c10=events[_0xabb2('0x5')];_0x1577e1<_0x412c10;_0x1577e1++){var _0x283952=events[_0x1577e1];var _0x1dc5f9=createListener(_0xabb2('0x6')+_0x283952,_0x21ba62);WhatsappAccountEvents['on'](_0x283952,_0x1dc5f9);}}; \ No newline at end of file +var _0xa7b2=['remove','removeListener','register','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x881c34,_0x1caa63){var _0x5131ae=function(_0x156387){while(--_0x156387){_0x881c34['push'](_0x881c34['shift']());}};_0x5131ae(++_0x1caa63);}(_0xa7b2,0x91));var _0x2a7b=function(_0x3e54c3,_0x195509){_0x3e54c3=_0x3e54c3-0x0;var _0xda0ffe=_0xa7b2[_0x3e54c3];return _0xda0ffe;};'use strict';var WhatsappAccountEvents=require(_0x2a7b('0x0'));var events=[_0x2a7b('0x1'),_0x2a7b('0x2'),'update'];function createListener(_0x1691c8,_0x4271dd){return function(_0x22abae){_0x4271dd['emit'](_0x1691c8,_0x22abae);};}function removeListener(_0x2cfe44,_0x30bd13){return function(){WhatsappAccountEvents[_0x2a7b('0x3')](_0x2cfe44,_0x30bd13);};}exports[_0x2a7b('0x4')]=function(_0x2fba98){for(var _0x2fd2d1=0x0,_0x2cae87=events[_0x2a7b('0x5')];_0x2fd2d1<_0x2cae87;_0x2fd2d1++){var _0x29a796=events[_0x2fd2d1];var _0x5906b0=createListener(_0x2a7b('0x6')+_0x29a796,_0x2fba98);WhatsappAccountEvents['on'](_0x29a796,_0x5906b0);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index df7071e..6c4571a 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 _0x91ce=['connect-timeout','express','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','post','create','/:id','delete','multer','path'];(function(_0x3ed193,_0x1380fc){var _0x538672=function(_0x582e01){while(--_0x582e01){_0x3ed193['push'](_0x3ed193['shift']());}};_0x538672(++_0x1380fc);}(_0x91ce,0x108));var _0xe91c=function(_0x2dc53c,_0x4a29ce){_0x2dc53c=_0x2dc53c-0x0;var _0x32ea88=_0x91ce[_0x2dc53c];return _0x32ea88;};'use strict';var multer=require(_0xe91c('0x0'));var util=require('util');var path=require(_0xe91c('0x1'));var timeout=require(_0xe91c('0x2'));var express=require(_0xe91c('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe91c('0x4'));var config=require(_0xe91c('0x5'));var controller=require('./whatsappApplication.controller');router['get']('/',auth[_0xe91c('0x6')](),controller[_0xe91c('0x7')]);router[_0xe91c('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe91c('0x9')]);router[_0xe91c('0xa')]('/',auth[_0xe91c('0x6')](),controller[_0xe91c('0xb')]);router['put'](_0xe91c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xe91c('0xd')](_0xe91c('0xc'),auth[_0xe91c('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xde58=['../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','put','delete','util','path','connect-timeout','Router'];(function(_0x29715e,_0x25c734){var _0x3a582d=function(_0xeeee58){while(--_0xeeee58){_0x29715e['push'](_0x29715e['shift']());}};_0x3a582d(++_0x25c734);}(_0xde58,0x1e6));var _0x8de5=function(_0x4c90e1,_0x2bcc12){_0x4c90e1=_0x4c90e1-0x0;var _0x28d3ae=_0xde58[_0x4c90e1];return _0x28d3ae;};'use strict';var multer=require('multer');var util=require(_0x8de5('0x0'));var path=require(_0x8de5('0x1'));var timeout=require(_0x8de5('0x2'));var express=require('express');var router=express[_0x8de5('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8de5('0x4'));var config=require(_0x8de5('0x5'));var controller=require(_0x8de5('0x6'));router[_0x8de5('0x7')]('/',auth['isAuthenticated'](),controller[_0x8de5('0x8')]);router['get'](_0x8de5('0x9'),auth[_0x8de5('0xa')](),controller[_0x8de5('0xb')]);router['post']('/',auth[_0x8de5('0xa')](),controller['create']);router[_0x8de5('0xc')](_0x8de5('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x8de5('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index dd1a2c6..4266633 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 _0xb0a8=['sequelize','exports','STRING','noop'];(function(_0x5f8000,_0x4a56b1){var _0xc8f261=function(_0x53e032){while(--_0x53e032){_0x5f8000['push'](_0x5f8000['shift']());}};_0xc8f261(++_0x4a56b1);}(_0xb0a8,0x158));var _0x8b0a=function(_0x148427,_0xeb87db){_0x148427=_0x148427-0x0;var _0x501c9d=_0xb0a8[_0x148427];return _0x501c9d;};'use strict';var Sequelize=require(_0x8b0a('0x0'));module[_0x8b0a('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8b0a('0x2')],'allowNull':![],'defaultValue':_0x8b0a('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8b0a('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4312=['exports','STRING','noop','sequelize'];(function(_0x2b7248,_0x17b24e){var _0x418838=function(_0x3fc27d){while(--_0x3fc27d){_0x2b7248['push'](_0x2b7248['shift']());}};_0x418838(++_0x17b24e);}(_0x4312,0x1af));var _0x2431=function(_0x2aed3,_0x5f9c05){_0x2aed3=_0x2aed3-0x0;var _0x160e00=_0x4312[_0x2aed3];return _0x160e00;};'use strict';var Sequelize=require(_0x2431('0x0'));module[_0x2431('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2431('0x2')],'allowNull':![],'defaultValue':_0x2431('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2431('0x2')]},'interval':{'type':Sequelize[_0x2431('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 6c52f4c..2750e8d 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 _0xc0d7=['intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','set','json','apply','reject','save','then','destroy','end','stack','name','send','index','map','WhatsappApplication','rawAttributes','key','model','query'];(function(_0x1e3d9d,_0x4aaf88){var _0x1ef002=function(_0x2dbdc2){while(--_0x2dbdc2){_0x1e3d9d['push'](_0x1e3d9d['shift']());}};_0x1ef002(++_0x4aaf88);}(_0xc0d7,0x69));var _0x7c0d=function(_0x4f1376,_0x27eba1){_0x4f1376=_0x4f1376-0x0;var _0x279d5c=_0xc0d7[_0x4f1376];return _0x279d5c;};'use strict';var pdf=require(_0x7c0d('0x0'));var emlformat=require(_0x7c0d('0x1'));var rimraf=require(_0x7c0d('0x2'));var zipdir=require(_0x7c0d('0x3'));var jsonpatch=require(_0x7c0d('0x4'));var rp=require(_0x7c0d('0x5'));var moment=require(_0x7c0d('0x6'));var BPromise=require(_0x7c0d('0x7'));var Mustache=require(_0x7c0d('0x8'));var util=require(_0x7c0d('0x9'));var path=require(_0x7c0d('0xa'));var sox=require(_0x7c0d('0xb'));var csv=require(_0x7c0d('0xc'));var ejs=require(_0x7c0d('0xd'));var fs=require('fs');var _=require(_0x7c0d('0xe'));var squel=require(_0x7c0d('0xf'));var crypto=require(_0x7c0d('0x10'));var jsforce=require(_0x7c0d('0x11'));var deskjs=require(_0x7c0d('0x12'));var toCsv=require(_0x7c0d('0xc'));var querystring=require('querystring');var Papa=require(_0x7c0d('0x13'));var Redis=require(_0x7c0d('0x14'));var authService=require(_0x7c0d('0x15'));var qs=require(_0x7c0d('0x16'));var as=require(_0x7c0d('0x17'));var hardwareService=require(_0x7c0d('0x18'));var logger=require(_0x7c0d('0x19'))(_0x7c0d('0x1a'));var utils=require('../../config/utils');var config=require(_0x7c0d('0x1b'));var db=require(_0x7c0d('0x1c'))['db'];function respondWithStatusCode(_0x6854bf,_0x28a02b){_0x28a02b=_0x28a02b||0xcc;return function(_0x5d8a88){if(_0x5d8a88){return _0x6854bf[_0x7c0d('0x1d')](_0x28a02b);}return _0x6854bf[_0x7c0d('0x1e')](_0x28a02b)['end']();};}function respondWithResult(_0x531143,_0x30e0a5){_0x30e0a5=_0x30e0a5||0xc8;return function(_0x454389){if(_0x454389){return _0x531143['status'](_0x30e0a5)['json'](_0x454389);}};}function respondWithFilteredResult(_0x2fd3a1,_0xbe15d2){return function(_0x49eb12){if(_0x49eb12){var _0x542945=_0x49eb12[_0x7c0d('0x1f')],_0x3d7415=_0xbe15d2[_0x7c0d('0x20')],_0x43fe7d=_0xbe15d2['offset']+_0xbe15d2['limit'],_0x5a41b9;if(_0x43fe7d>=_0x542945){_0x43fe7d=_0x542945;_0x5a41b9=0xc8;}else{_0x5a41b9=0xce;}_0x2fd3a1[_0x7c0d('0x1e')](_0x5a41b9);return _0x2fd3a1[_0x7c0d('0x21')]('Content-Range',_0x3d7415+'-'+_0x43fe7d+'/'+_0x542945)[_0x7c0d('0x22')](_0x49eb12);}return null;};}function patchUpdates(_0x1d2ea1){return function(_0x3bbe53){try{jsonpatch[_0x7c0d('0x23')](_0x3bbe53,_0x1d2ea1,!![]);}catch(_0x13e730){return BPromise[_0x7c0d('0x24')](_0x13e730);}return _0x3bbe53[_0x7c0d('0x25')]();};}function saveUpdates(_0x3832b6,_0x3a3851){return function(_0x10fd71){if(_0x10fd71){return _0x10fd71['update'](_0x3832b6)[_0x7c0d('0x26')](function(_0x4c1368){return _0x4c1368;});}return null;};}function removeEntity(_0x344da2,_0x85b5e){return function(_0x4e88d2){if(_0x4e88d2){return _0x4e88d2[_0x7c0d('0x27')]()[_0x7c0d('0x26')](function(){_0x344da2[_0x7c0d('0x1e')](0xcc)[_0x7c0d('0x28')]();});}};}function handleEntityNotFound(_0x1d9e2e,_0x1b942f){return function(_0x48b14d){if(!_0x48b14d){_0x1d9e2e[_0x7c0d('0x1d')](0x194);}return _0x48b14d;};}function handleError(_0x175e7f,_0x731ea6){_0x731ea6=_0x731ea6||0x1f4;return function(_0x406433){logger['error'](_0x406433[_0x7c0d('0x29')]);if(_0x406433['name']){delete _0x406433[_0x7c0d('0x2a')];}_0x175e7f['status'](_0x731ea6)[_0x7c0d('0x2b')](_0x406433);};}exports[_0x7c0d('0x2c')]=function(_0x46cf7e,_0x4758db){var _0x269d82={},_0xec3bd={},_0x208538={'count':0x0,'rows':[]};var _0xea9103=_[_0x7c0d('0x2d')](db[_0x7c0d('0x2e')][_0x7c0d('0x2f')],function(_0x1ac5c4){return{'name':_0x1ac5c4['fieldName'],'type':_0x1ac5c4['type'][_0x7c0d('0x30')]};});_0xec3bd[_0x7c0d('0x31')]=_[_0x7c0d('0x2d')](_0xea9103,_0x7c0d('0x2a'));_0xec3bd[_0x7c0d('0x32')]=_['keys'](_0x46cf7e[_0x7c0d('0x32')]);_0xec3bd['filters']=_['intersection'](_0xec3bd[_0x7c0d('0x31')],_0xec3bd[_0x7c0d('0x32')]);_0x269d82['attributes']=_[_0x7c0d('0x33')](_0xec3bd[_0x7c0d('0x31')],qs[_0x7c0d('0x34')](_0x46cf7e[_0x7c0d('0x32')]['fields']));_0x269d82['attributes']=_0x269d82[_0x7c0d('0x35')]['length']?_0x269d82['attributes']:_0xec3bd['model'];if(!_0x46cf7e['query'][_0x7c0d('0x36')](_0x7c0d('0x37'))){_0x269d82['limit']=qs[_0x7c0d('0x38')](_0x46cf7e['query'][_0x7c0d('0x38')]);_0x269d82['offset']=qs[_0x7c0d('0x20')](_0x46cf7e[_0x7c0d('0x32')][_0x7c0d('0x20')]);}_0x269d82[_0x7c0d('0x39')]=qs[_0x7c0d('0x3a')](_0x46cf7e[_0x7c0d('0x32')]['sort']);_0x269d82[_0x7c0d('0x3b')]=qs[_0x7c0d('0x3c')](_[_0x7c0d('0x3d')](_0x46cf7e[_0x7c0d('0x32')],_0xec3bd['filters']),_0xea9103);if(_0x46cf7e[_0x7c0d('0x32')][_0x7c0d('0x3e')]){_0x269d82[_0x7c0d('0x3b')]=_[_0x7c0d('0x3f')](_0x269d82['where'],{'$or':_['map'](_0xea9103,function(_0x5ae467){if(_0x5ae467[_0x7c0d('0x40')]!=='VIRTUAL'){var _0xae0ada={};_0xae0ada[_0x5ae467[_0x7c0d('0x2a')]]={'$like':'%'+_0x46cf7e[_0x7c0d('0x32')]['filter']+'%'};return _0xae0ada;}})});}_0x269d82=_[_0x7c0d('0x3f')]({},_0x269d82,_0x46cf7e[_0x7c0d('0x41')]);var _0x497db6={'where':_0x269d82['where']};return db['WhatsappApplication']['count'](_0x497db6)[_0x7c0d('0x26')](function(_0x4fa1cb){_0x208538[_0x7c0d('0x1f')]=_0x4fa1cb;if(_0x46cf7e[_0x7c0d('0x32')][_0x7c0d('0x42')]){_0x269d82[_0x7c0d('0x43')]=[{'all':!![]}];}return db[_0x7c0d('0x2e')][_0x7c0d('0x44')](_0x269d82);})[_0x7c0d('0x26')](function(_0x2e5858){_0x208538[_0x7c0d('0x45')]=_0x2e5858;return _0x208538;})[_0x7c0d('0x26')](respondWithFilteredResult(_0x4758db,_0x269d82))[_0x7c0d('0x46')](handleError(_0x4758db,null));};exports['show']=function(_0xa586a0,_0x374b69){var _0x181bc8={'raw':!![],'where':{'id':_0xa586a0[_0x7c0d('0x47')]['id']}},_0x446de0={};_0x446de0[_0x7c0d('0x31')]=_['keys'](db[_0x7c0d('0x2e')][_0x7c0d('0x2f')]);_0x446de0['query']=_[_0x7c0d('0x48')](_0xa586a0[_0x7c0d('0x32')]);_0x446de0['filters']=_['intersection'](_0x446de0[_0x7c0d('0x31')],_0x446de0[_0x7c0d('0x32')]);_0x181bc8[_0x7c0d('0x35')]=_[_0x7c0d('0x33')](_0x446de0[_0x7c0d('0x31')],qs[_0x7c0d('0x34')](_0xa586a0[_0x7c0d('0x32')][_0x7c0d('0x34')]));_0x181bc8[_0x7c0d('0x35')]=_0x181bc8[_0x7c0d('0x35')][_0x7c0d('0x49')]?_0x181bc8[_0x7c0d('0x35')]:_0x446de0['model'];if(_0xa586a0[_0x7c0d('0x32')]['includeAll']){_0x181bc8[_0x7c0d('0x43')]=[{'all':!![]}];}_0x181bc8=_[_0x7c0d('0x3f')]({},_0x181bc8,_0xa586a0[_0x7c0d('0x41')]);return db[_0x7c0d('0x2e')][_0x7c0d('0x4a')](_0x181bc8)[_0x7c0d('0x26')](handleEntityNotFound(_0x374b69,null))[_0x7c0d('0x26')](respondWithResult(_0x374b69,null))['catch'](handleError(_0x374b69,null));};exports[_0x7c0d('0x4b')]=function(_0x30eabc,_0x5a2c90){return db['WhatsappApplication'][_0x7c0d('0x4b')](_0x30eabc[_0x7c0d('0x4c')],{})[_0x7c0d('0x26')](respondWithResult(_0x5a2c90,0xc9))[_0x7c0d('0x46')](handleError(_0x5a2c90,null));};exports[_0x7c0d('0x4d')]=function(_0x17c1f7,_0x3bf8f1){if(_0x17c1f7['body']['id']){delete _0x17c1f7[_0x7c0d('0x4c')]['id'];}return db[_0x7c0d('0x2e')][_0x7c0d('0x4a')]({'where':{'id':_0x17c1f7[_0x7c0d('0x47')]['id']}})[_0x7c0d('0x26')](handleEntityNotFound(_0x3bf8f1,null))['then'](saveUpdates(_0x17c1f7[_0x7c0d('0x4c')],null))['then'](respondWithResult(_0x3bf8f1,null))[_0x7c0d('0x46')](handleError(_0x3bf8f1,null));};exports[_0x7c0d('0x27')]=function(_0x573134,_0x9ffb3b){return db[_0x7c0d('0x2e')]['find']({'where':{'id':_0x573134[_0x7c0d('0x47')]['id']}})['then'](handleEntityNotFound(_0x9ffb3b,null))[_0x7c0d('0x26')](removeEntity(_0x9ffb3b,null))['catch'](handleError(_0x9ffb3b,null));}; \ No newline at end of file +var _0x0f45=['includeAll','findAll','rows','catch','params','rawAttributes','length','create','body','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','end','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','WhatsappApplication'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x0f45,0x9c));var _0x50f4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x0f45[_0x1694f5];return _0x5b4321;};'use strict';var pdf=require(_0x50f4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x50f4('0x1'));var zipdir=require(_0x50f4('0x2'));var jsonpatch=require(_0x50f4('0x3'));var rp=require(_0x50f4('0x4'));var moment=require(_0x50f4('0x5'));var BPromise=require(_0x50f4('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x50f4('0x7'));var sox=require(_0x50f4('0x8'));var csv=require(_0x50f4('0x9'));var ejs=require(_0x50f4('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x50f4('0xb'));var crypto=require('crypto');var jsforce=require(_0x50f4('0xc'));var deskjs=require(_0x50f4('0xd'));var toCsv=require(_0x50f4('0x9'));var querystring=require(_0x50f4('0xe'));var Papa=require(_0x50f4('0xf'));var Redis=require('ioredis');var authService=require(_0x50f4('0x10'));var qs=require(_0x50f4('0x11'));var as=require(_0x50f4('0x12'));var hardwareService=require(_0x50f4('0x13'));var logger=require(_0x50f4('0x14'))(_0x50f4('0x15'));var utils=require(_0x50f4('0x16'));var config=require(_0x50f4('0x17'));var db=require(_0x50f4('0x18'))['db'];function respondWithStatusCode(_0x473e2e,_0x1c6d58){_0x1c6d58=_0x1c6d58||0xcc;return function(_0x4df4fc){if(_0x4df4fc){return _0x473e2e[_0x50f4('0x19')](_0x1c6d58);}return _0x473e2e[_0x50f4('0x1a')](_0x1c6d58)['end']();};}function respondWithResult(_0x21eb5b,_0x225e64){_0x225e64=_0x225e64||0xc8;return function(_0x4d8a78){if(_0x4d8a78){return _0x21eb5b[_0x50f4('0x1a')](_0x225e64)[_0x50f4('0x1b')](_0x4d8a78);}};}function respondWithFilteredResult(_0x52b6a8,_0x691a08){return function(_0x32b890){if(_0x32b890){var _0xabfe58=_0x32b890[_0x50f4('0x1c')],_0x5bdc17=_0x691a08['offset'],_0x200a49=_0x691a08[_0x50f4('0x1d')]+_0x691a08[_0x50f4('0x1e')],_0x617394;if(_0x200a49>=_0xabfe58){_0x200a49=_0xabfe58;_0x617394=0xc8;}else{_0x617394=0xce;}_0x52b6a8['status'](_0x617394);return _0x52b6a8[_0x50f4('0x1f')](_0x50f4('0x20'),_0x5bdc17+'-'+_0x200a49+'/'+_0xabfe58)[_0x50f4('0x1b')](_0x32b890);}return null;};}function patchUpdates(_0x113fdd){return function(_0x368ce9){try{jsonpatch[_0x50f4('0x21')](_0x368ce9,_0x113fdd,!![]);}catch(_0x2394f0){return BPromise['reject'](_0x2394f0);}return _0x368ce9[_0x50f4('0x22')]();};}function saveUpdates(_0x225835,_0xd1a608){return function(_0x255ea6){if(_0x255ea6){return _0x255ea6[_0x50f4('0x23')](_0x225835)[_0x50f4('0x24')](function(_0x1503ec){return _0x1503ec;});}return null;};}function removeEntity(_0x3e0e80,_0x37ab37){return function(_0x55ac27){if(_0x55ac27){return _0x55ac27['destroy']()['then'](function(){_0x3e0e80[_0x50f4('0x1a')](0xcc)[_0x50f4('0x25')]();});}};}function handleEntityNotFound(_0x4cbeef,_0x9c6e55){return function(_0x4522fd){if(!_0x4522fd){_0x4cbeef['sendStatus'](0x194);}return _0x4522fd;};}function handleError(_0x353bc0,_0x412d75){_0x412d75=_0x412d75||0x1f4;return function(_0x46991f){logger['error'](_0x46991f[_0x50f4('0x26')]);if(_0x46991f[_0x50f4('0x27')]){delete _0x46991f[_0x50f4('0x27')];}_0x353bc0[_0x50f4('0x1a')](_0x412d75)[_0x50f4('0x28')](_0x46991f);};}exports[_0x50f4('0x29')]=function(_0x31309a,_0x2a6f53){var _0x3fb433={},_0x3c4231={},_0x3e05e4={'count':0x0,'rows':[]};var _0x4c6600=_[_0x50f4('0x2a')](db['WhatsappApplication']['rawAttributes'],function(_0xa22231){return{'name':_0xa22231[_0x50f4('0x2b')],'type':_0xa22231[_0x50f4('0x2c')]['key']};});_0x3c4231[_0x50f4('0x2d')]=_[_0x50f4('0x2a')](_0x4c6600,_0x50f4('0x27'));_0x3c4231[_0x50f4('0x2e')]=_[_0x50f4('0x2f')](_0x31309a[_0x50f4('0x2e')]);_0x3c4231[_0x50f4('0x30')]=_[_0x50f4('0x31')](_0x3c4231['model'],_0x3c4231['query']);_0x3fb433[_0x50f4('0x32')]=_[_0x50f4('0x31')](_0x3c4231['model'],qs[_0x50f4('0x33')](_0x31309a[_0x50f4('0x2e')][_0x50f4('0x33')]));_0x3fb433[_0x50f4('0x32')]=_0x3fb433['attributes']['length']?_0x3fb433[_0x50f4('0x32')]:_0x3c4231['model'];if(!_0x31309a[_0x50f4('0x2e')][_0x50f4('0x34')](_0x50f4('0x35'))){_0x3fb433[_0x50f4('0x1e')]=qs[_0x50f4('0x1e')](_0x31309a[_0x50f4('0x2e')][_0x50f4('0x1e')]);_0x3fb433[_0x50f4('0x1d')]=qs[_0x50f4('0x1d')](_0x31309a[_0x50f4('0x2e')][_0x50f4('0x1d')]);}_0x3fb433[_0x50f4('0x36')]=qs[_0x50f4('0x37')](_0x31309a[_0x50f4('0x2e')][_0x50f4('0x37')]);_0x3fb433[_0x50f4('0x38')]=qs[_0x50f4('0x30')](_[_0x50f4('0x39')](_0x31309a[_0x50f4('0x2e')],_0x3c4231[_0x50f4('0x30')]),_0x4c6600);if(_0x31309a[_0x50f4('0x2e')][_0x50f4('0x3a')]){_0x3fb433['where']=_[_0x50f4('0x3b')](_0x3fb433['where'],{'$or':_[_0x50f4('0x2a')](_0x4c6600,function(_0x48f30e){if(_0x48f30e[_0x50f4('0x2c')]!==_0x50f4('0x3c')){var _0x5293e1={};_0x5293e1[_0x48f30e['name']]={'$like':'%'+_0x31309a[_0x50f4('0x2e')]['filter']+'%'};return _0x5293e1;}})});}_0x3fb433=_[_0x50f4('0x3b')]({},_0x3fb433,_0x31309a[_0x50f4('0x3d')]);var _0x5c2654={'where':_0x3fb433[_0x50f4('0x38')]};return db[_0x50f4('0x3e')][_0x50f4('0x1c')](_0x5c2654)[_0x50f4('0x24')](function(_0xd9ea98){_0x3e05e4['count']=_0xd9ea98;if(_0x31309a['query'][_0x50f4('0x3f')]){_0x3fb433['include']=[{'all':!![]}];}return db[_0x50f4('0x3e')][_0x50f4('0x40')](_0x3fb433);})[_0x50f4('0x24')](function(_0x4137bc){_0x3e05e4[_0x50f4('0x41')]=_0x4137bc;return _0x3e05e4;})[_0x50f4('0x24')](respondWithFilteredResult(_0x2a6f53,_0x3fb433))[_0x50f4('0x42')](handleError(_0x2a6f53,null));};exports['show']=function(_0xb8e66f,_0x35aee0){var _0x20cebc={'raw':!![],'where':{'id':_0xb8e66f[_0x50f4('0x43')]['id']}},_0x1beb9c={};_0x1beb9c[_0x50f4('0x2d')]=_[_0x50f4('0x2f')](db['WhatsappApplication'][_0x50f4('0x44')]);_0x1beb9c[_0x50f4('0x2e')]=_[_0x50f4('0x2f')](_0xb8e66f[_0x50f4('0x2e')]);_0x1beb9c[_0x50f4('0x30')]=_[_0x50f4('0x31')](_0x1beb9c['model'],_0x1beb9c[_0x50f4('0x2e')]);_0x20cebc[_0x50f4('0x32')]=_[_0x50f4('0x31')](_0x1beb9c['model'],qs['fields'](_0xb8e66f[_0x50f4('0x2e')][_0x50f4('0x33')]));_0x20cebc[_0x50f4('0x32')]=_0x20cebc[_0x50f4('0x32')][_0x50f4('0x45')]?_0x20cebc[_0x50f4('0x32')]:_0x1beb9c[_0x50f4('0x2d')];if(_0xb8e66f[_0x50f4('0x2e')][_0x50f4('0x3f')]){_0x20cebc['include']=[{'all':!![]}];}_0x20cebc=_['merge']({},_0x20cebc,_0xb8e66f[_0x50f4('0x3d')]);return db[_0x50f4('0x3e')]['find'](_0x20cebc)[_0x50f4('0x24')](handleEntityNotFound(_0x35aee0,null))[_0x50f4('0x24')](respondWithResult(_0x35aee0,null))[_0x50f4('0x42')](handleError(_0x35aee0,null));};exports['create']=function(_0x568bea,_0x311ab1){return db['WhatsappApplication'][_0x50f4('0x46')](_0x568bea[_0x50f4('0x47')],{})[_0x50f4('0x24')](respondWithResult(_0x311ab1,0xc9))[_0x50f4('0x42')](handleError(_0x311ab1,null));};exports['update']=function(_0x29691b,_0x1d76b3){if(_0x29691b[_0x50f4('0x47')]['id']){delete _0x29691b[_0x50f4('0x47')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x29691b[_0x50f4('0x43')]['id']}})[_0x50f4('0x24')](handleEntityNotFound(_0x1d76b3,null))[_0x50f4('0x24')](saveUpdates(_0x29691b['body'],null))[_0x50f4('0x24')](respondWithResult(_0x1d76b3,null))[_0x50f4('0x42')](handleError(_0x1d76b3,null));};exports[_0x50f4('0x48')]=function(_0x34826b,_0x4d5c73){return db[_0x50f4('0x3e')]['find']({'where':{'id':_0x34826b[_0x50f4('0x43')]['id']}})[_0x50f4('0x24')](handleEntityNotFound(_0x4d5c73,null))[_0x50f4('0x24')](removeEntity(_0x4d5c73,null))[_0x50f4('0x42')](handleError(_0x4d5c73,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 8bca0c0..61c3d63 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 _0x81a5=['lodash','util','../../config/logger','api','moment','bluebird','path','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x28586f,_0x19383b){var _0xb81282=function(_0x4f5ead){while(--_0x4f5ead){_0x28586f['push'](_0x28586f['shift']());}};_0xb81282(++_0x19383b);}(_0x81a5,0x1c8));var _0x581a=function(_0x2e2c20,_0x11241a){_0x2e2c20=_0x2e2c20-0x0;var _0x396bb0=_0x81a5[_0x2e2c20];return _0x396bb0;};'use strict';var _=require(_0x581a('0x0'));var util=require(_0x581a('0x1'));var logger=require(_0x581a('0x2'))(_0x581a('0x3'));var moment=require(_0x581a('0x4'));var BPromise=require(_0x581a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x581a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x21fea7,_0x56065e){return _0x21fea7[_0x581a('0x7')](_0x581a('0x8'),attributes,{'tableName':_0x581a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x581a('0xa'),'collate':_0x581a('0xb')});}; \ No newline at end of file +var _0x3de3=['rimraf','./whatsappApplication.attributes','exports','WhatsappApplication','whatsapp_applications','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x99facc,_0x548cd6){var _0xd39ed0=function(_0x207e47){while(--_0x207e47){_0x99facc['push'](_0x99facc['shift']());}};_0xd39ed0(++_0x548cd6);}(_0x3de3,0x1ce));var _0x33de=function(_0x4e0034,_0x179ccb){_0x4e0034=_0x4e0034-0x0;var _0x2ed84f=_0x3de3[_0x4e0034];return _0x2ed84f;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var logger=require(_0x33de('0x1'))(_0x33de('0x2'));var moment=require('moment');var BPromise=require(_0x33de('0x3'));var rp=require(_0x33de('0x4'));var fs=require('fs');var path=require(_0x33de('0x5'));var rimraf=require(_0x33de('0x6'));var config=require('../../config/environment');var attributes=require(_0x33de('0x7'));module[_0x33de('0x8')]=function(_0x558f98,_0x142716){return _0x558f98['define'](_0x33de('0x9'),attributes,{'tableName':_0x33de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x33de('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 5a66cb2..2c5f7d1 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 _0x126e=['request','then','info','WhatsappApplication,\x20%s,\x20%s','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4962b6,_0x588abe){var _0x1d0c2a=function(_0x39bb23){while(--_0x39bb23){_0x4962b6['push'](_0x4962b6['shift']());}};_0x1d0c2a(++_0x588abe);}(_0x126e,0x108));var _0xe126=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x126e[_0x13e741];return _0x3f8bb3;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var moment=require(_0xe126('0x1'));var BPromise=require(_0xe126('0x2'));var rs=require(_0xe126('0x3'));var fs=require('fs');var Redis=require(_0xe126('0x4'));var db=require(_0xe126('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe126('0x6'))(_0xe126('0x7'));var config=require(_0xe126('0x8'));var jayson=require(_0xe126('0x9'));var client=jayson[_0xe126('0xa')][_0xe126('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10210f,_0x47ae76,_0x316be0){return new BPromise(function(_0x19f94e,_0x437fd0){return client[_0xe126('0xc')](_0x10210f,_0x316be0)[_0xe126('0xd')](function(_0x5e8c30){logger[_0xe126('0xe')](_0xe126('0xf'),_0x47ae76,'request\x20sent');logger[_0xe126('0x10')](_0xe126('0x11'),_0x47ae76,'request\x20sent',JSON[_0xe126('0x12')](_0x5e8c30));if(_0x5e8c30['error']){if(_0x5e8c30[_0xe126('0x13')]['code']===0x1f4){logger[_0xe126('0x13')](_0xe126('0xf'),_0x47ae76,_0x5e8c30[_0xe126('0x13')][_0xe126('0x14')]);return _0x437fd0(_0x5e8c30[_0xe126('0x13')][_0xe126('0x14')]);}logger[_0xe126('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x47ae76,_0x5e8c30[_0xe126('0x13')][_0xe126('0x14')]);return _0x19f94e(_0x5e8c30['error'][_0xe126('0x14')]);}else{logger[_0xe126('0xe')](_0xe126('0xf'),_0x47ae76,_0xe126('0x15'));_0x19f94e(_0x5e8c30['result'][_0xe126('0x14')]);}})[_0xe126('0x16')](function(_0x1c32fe){logger['error'](_0xe126('0xf'),_0x47ae76,_0x1c32fe);_0x437fd0(_0x1c32fe);});});} \ No newline at end of file +var _0x93bb=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0xaac192,_0x5bcb4f){var _0x5a2c53=function(_0x4a2c98){while(--_0x4a2c98){_0xaac192['push'](_0xaac192['shift']());}};_0x5a2c53(++_0x5bcb4f);}(_0x93bb,0x135));var _0xb93b=function(_0x37252a,_0x3456c8){_0x37252a=_0x37252a-0x0;var _0x45ab99=_0x93bb[_0x37252a];return _0x45ab99;};'use strict';var _=require(_0xb93b('0x0'));var util=require(_0xb93b('0x1'));var moment=require(_0xb93b('0x2'));var BPromise=require(_0xb93b('0x3'));var rs=require(_0xb93b('0x4'));var fs=require('fs');var Redis=require(_0xb93b('0x5'));var db=require(_0xb93b('0x6'))['db'];var utils=require(_0xb93b('0x7'));var logger=require(_0xb93b('0x8'))(_0xb93b('0x9'));var config=require('../../config/environment');var jayson=require(_0xb93b('0xa'));var client=jayson[_0xb93b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4dcf,_0x2c27ca,_0x516b0b){return new BPromise(function(_0x35c135,_0x455cb2){return client[_0xb93b('0xc')](_0x3c4dcf,_0x516b0b)[_0xb93b('0xd')](function(_0x1c9b11){logger[_0xb93b('0xe')](_0xb93b('0xf'),_0x2c27ca,_0xb93b('0x10'));logger[_0xb93b('0x11')](_0xb93b('0x12'),_0x2c27ca,_0xb93b('0x10'),JSON['stringify'](_0x1c9b11));if(_0x1c9b11[_0xb93b('0x13')]){if(_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x14')]===0x1f4){logger[_0xb93b('0x13')]('WhatsappApplication,\x20%s,\x20%s',_0x2c27ca,_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x15')]);return _0x455cb2(_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x15')]);}logger[_0xb93b('0x13')](_0xb93b('0xf'),_0x2c27ca,_0x1c9b11[_0xb93b('0x13')]['message']);return _0x35c135(_0x1c9b11[_0xb93b('0x13')][_0xb93b('0x15')]);}else{logger[_0xb93b('0xe')](_0xb93b('0xf'),_0x2c27ca,_0xb93b('0x10'));_0x35c135(_0x1c9b11[_0xb93b('0x16')]['message']);}})[_0xb93b('0x17')](function(_0x5ee3c4){logger[_0xb93b('0x13')](_0xb93b('0xf'),_0x2c27ca,_0x5ee3c4);_0x455cb2(_0x5ee3c4);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 1ded0f5..512a777 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 _0x83d3=['./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x40359b,_0x42a9cf){var _0x3f7a8b=function(_0x1b4260){while(--_0x1b4260){_0x40359b['push'](_0x40359b['shift']());}};_0x3f7a8b(++_0x42a9cf);}(_0x83d3,0x159));var _0x383d=function(_0x2b4d01,_0x4c6044){_0x2b4d01=_0x2b4d01-0x0;var _0x4195d7=_0x83d3[_0x2b4d01];return _0x4195d7;};'use strict';var multer=require(_0x383d('0x0'));var util=require('util');var path=require(_0x383d('0x1'));var timeout=require(_0x383d('0x2'));var express=require(_0x383d('0x3'));var router=express[_0x383d('0x4')]();var auth=require(_0x383d('0x5'));var interaction=require(_0x383d('0x6'));var config=require('../../config/environment');var controller=require(_0x383d('0x7'));router[_0x383d('0x8')]('/',auth[_0x383d('0x9')](),controller[_0x383d('0xa')]);router[_0x383d('0x8')](_0x383d('0xb'),auth['isAuthenticated'](),controller[_0x383d('0xc')]);router['get'](_0x383d('0xd'),auth[_0x383d('0x9')](),controller[_0x383d('0xe')]);router[_0x383d('0x8')](_0x383d('0xf'),auth[_0x383d('0x9')](),controller['getMessages']);router['get'](_0x383d('0x10'),auth[_0x383d('0x9')](),controller[_0x383d('0x11')]);router[_0x383d('0x12')]('/',auth['isAuthenticated'](),controller[_0x383d('0x13')]);router['post'](_0x383d('0xf'),auth[_0x383d('0x9')](),controller['addMessage']);router[_0x383d('0x12')](_0x383d('0x14'),auth[_0x383d('0x9')](),interaction[_0x383d('0x15')](_0x383d('0x16'),_0x383d('0x17')),controller[_0x383d('0x18')]);router[_0x383d('0x19')](_0x383d('0xd'),auth[_0x383d('0x9')](),interaction[_0x383d('0x15')](_0x383d('0x16'),_0x383d('0x1a')),controller['update']);router['delete'](_0x383d('0xd'),auth['isAuthenticated'](),interaction[_0x383d('0x15')](_0x383d('0x16'),_0x383d('0x1b')),controller[_0x383d('0x1c')]);router[_0x383d('0x1d')]('/:id/tags',auth['isAuthenticated'](),controller[_0x383d('0x1e')]);module[_0x383d('0x1f')]=router; \ No newline at end of file +var _0xa42e=['/:id/download','download','create','post','addMessage','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','update','whatsappinteraction:destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages'];(function(_0x31ce94,_0x246777){var _0x16ca31=function(_0x1af663){while(--_0x1af663){_0x31ce94['push'](_0x31ce94['shift']());}};_0x16ca31(++_0x246777);}(_0xa42e,0x1ae));var _0xea42=function(_0x1e028a,_0x4ae025){_0x1e028a=_0x1e028a-0x0;var _0x1d2bce=_0xa42e[_0x1e028a];return _0x1d2bce;};'use strict';var multer=require(_0xea42('0x0'));var util=require(_0xea42('0x1'));var path=require(_0xea42('0x2'));var timeout=require(_0xea42('0x3'));var express=require(_0xea42('0x4'));var router=express[_0xea42('0x5')]();var auth=require(_0xea42('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xea42('0x7'));var controller=require(_0xea42('0x8'));router[_0xea42('0x9')]('/',auth[_0xea42('0xa')](),controller[_0xea42('0xb')]);router[_0xea42('0x9')](_0xea42('0xc'),auth[_0xea42('0xa')](),controller[_0xea42('0xd')]);router[_0xea42('0x9')](_0xea42('0xe'),auth['isAuthenticated'](),controller[_0xea42('0xf')]);router[_0xea42('0x9')](_0xea42('0x10'),auth[_0xea42('0xa')](),controller[_0xea42('0x11')]);router[_0xea42('0x9')](_0xea42('0x12'),auth['isAuthenticated'](),controller[_0xea42('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xea42('0x14')]);router[_0xea42('0x15')](_0xea42('0x10'),auth[_0xea42('0xa')](),controller[_0xea42('0x16')]);router['post'](_0xea42('0x17'),auth['isAuthenticated'](),interaction[_0xea42('0x18')](_0xea42('0x19'),'whatsappinteraction:addtags'),controller[_0xea42('0x1a')]);router[_0xea42('0x1b')](_0xea42('0xe'),auth['isAuthenticated'](),interaction[_0xea42('0x18')](_0xea42('0x19'),_0xea42('0x1c')),controller[_0xea42('0x1d')]);router['delete'](_0xea42('0xe'),auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0xea42('0x1e')),controller['destroy']);router['delete'](_0xea42('0x17'),auth['isAuthenticated'](),controller['removeTags']);module[_0xea42('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index c39b9fa..89be489 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 _0x0fd1=['STRING','ENUM','DATE','out','moment','exports','BOOLEAN'];(function(_0x39ebd8,_0x44d3e3){var _0x3a432e=function(_0x19a855){while(--_0x19a855){_0x39ebd8['push'](_0x39ebd8['shift']());}};_0x3a432e(++_0x44d3e3);}(_0x0fd1,0xeb));var _0x10fd=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x0fd1[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x10fd('0x0'));module[_0x10fd('0x1')]={'closed':{'type':Sequelize[_0x10fd('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x10fd('0x3')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x10fd('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x10fd('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x10fd('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x7a1b=['out','ENUM','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x7a1b,0x182));var _0xb7a1=function(_0x3dbb51,_0x8ba791){_0x3dbb51=_0x3dbb51-0x0;var _0x5f363f=_0x7a1b[_0x3dbb51];return _0x5f363f;};'use strict';var Sequelize=require(_0xb7a1('0x0'));var moment=require(_0xb7a1('0x1'));module[_0xb7a1('0x2')]={'closed':{'type':Sequelize[_0xb7a1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb7a1('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xb7a1('0x5')]},'phone':{'type':Sequelize[_0xb7a1('0x5')]},'read1stAt':{'type':Sequelize[_0xb7a1('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xb7a1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb7a1('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xb7a1('0x7')]('in',_0xb7a1('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 09482ba..ad6b186 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 _0x814b=['index','rawAttributes','type','key','model','query','intersection','attributes','length','nolimit','limit','order','sort','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','keys','some','compact','WhatsappAccountId','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','journey','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','toString','count','sequelize','fields','a.key','Account.key','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','all','rows','show','params','WhatsappInteraction','includeAll','merge','options','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','hasOwnProperty','WhatsappInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','User','fullname','Contact','firstName','lastName','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','10px','\x0a\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\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20','%s\x20#%d','Whatsapp','YYYY-MM-DD','closedAt','disposition','existsSync','basename','out','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','map','TagIds','split','forEach','push','catch'];(function(_0x27f6b6,_0x380ea8){var _0x1627cd=function(_0x274d20){while(--_0x274d20){_0x27f6b6['push'](_0x27f6b6['shift']());}};_0x1627cd(++_0x380ea8);}(_0x814b,0x1a2));var _0xb814=function(_0x22cd0c,_0x4040b6){_0x22cd0c=_0x22cd0c-0x0;var _0x439eba=_0x814b[_0x22cd0c];return _0x439eba;};'use strict';var pdf=require(_0xb814('0x0'));var emlformat=require(_0xb814('0x1'));var rimraf=require(_0xb814('0x2'));var zipdir=require(_0xb814('0x3'));var jsonpatch=require(_0xb814('0x4'));var rp=require(_0xb814('0x5'));var moment=require('moment');var BPromise=require(_0xb814('0x6'));var Mustache=require(_0xb814('0x7'));var util=require(_0xb814('0x8'));var path=require(_0xb814('0x9'));var sox=require(_0xb814('0xa'));var csv=require(_0xb814('0xb'));var ejs=require('ejs');var fs=require('fs');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('0xb'));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 db=require(_0xb814('0x19'))['db'];config[_0xb814('0x1a')]=_[_0xb814('0x1b')](config[_0xb814('0x1a')],{'host':_0xb814('0x1c'),'port':0x18eb});var socket=require(_0xb814('0x1d'))(new Redis(config[_0xb814('0x1a')]));require(_0xb814('0x1e'))[_0xb814('0x1f')](socket);function respondWithStatusCode(_0x2ab627,_0x3f4881){_0x3f4881=_0x3f4881||0xcc;return function(_0x44fb96){if(_0x44fb96){return _0x2ab627[_0xb814('0x20')](_0x3f4881);}return _0x2ab627[_0xb814('0x21')](_0x3f4881)[_0xb814('0x22')]();};}function respondWithResult(_0x3a71d6,_0x45e0d0){_0x45e0d0=_0x45e0d0||0xc8;return function(_0x265a83){if(_0x265a83){return _0x3a71d6[_0xb814('0x21')](_0x45e0d0)[_0xb814('0x23')](_0x265a83);}};}function respondWithFilteredResult(_0x7a21ef,_0x48c9df){return function(_0x168a48){if(_0x168a48){var _0x55ba16=_0x168a48['count'],_0x270598=_0x48c9df['offset'],_0xfac75b=_0x48c9df[_0xb814('0x24')]+_0x48c9df['limit'],_0x4c3007;if(_0xfac75b>=_0x55ba16){_0xfac75b=_0x55ba16;_0x4c3007=0xc8;}else{_0x4c3007=0xce;}_0x7a21ef['status'](_0x4c3007);return _0x7a21ef[_0xb814('0x25')](_0xb814('0x26'),_0x270598+'-'+_0xfac75b+'/'+_0x55ba16)[_0xb814('0x23')](_0x168a48);}return null;};}function patchUpdates(_0x4e139e){return function(_0xf5b8aa){try{jsonpatch['apply'](_0xf5b8aa,_0x4e139e,!![]);}catch(_0x1e6393){return BPromise[_0xb814('0x27')](_0x1e6393);}return _0xf5b8aa[_0xb814('0x28')]();};}function saveUpdates(_0x470e81,_0x27352e){return function(_0x2bd039){if(_0x2bd039){return _0x2bd039[_0xb814('0x29')](_0x470e81)['then'](function(_0x2ead86){return _0x2ead86;});}return null;};}function removeEntity(_0x52b7a3,_0x3f81d0){return function(_0x457dac){if(_0x457dac){return _0x457dac[_0xb814('0x2a')]()[_0xb814('0x2b')](function(){_0x52b7a3[_0xb814('0x21')](0xcc)[_0xb814('0x22')]();});}};}function handleEntityNotFound(_0x3d836c,_0x5755ea){return function(_0x392222){if(!_0x392222){_0x3d836c[_0xb814('0x20')](0x194);}return _0x392222;};}function handleError(_0x1c2625,_0x349394){_0x349394=_0x349394||0x1f4;return function(_0x32ed56){logger[_0xb814('0x2c')](_0x32ed56[_0xb814('0x2d')]);if(_0x32ed56[_0xb814('0x2e')]){delete _0x32ed56['name'];}_0x1c2625[_0xb814('0x21')](_0x349394)[_0xb814('0x2f')](_0x32ed56);};}function getInteractionUsers(_0x52ed64,_0x9008b2){return new BPromise(function(_0x37d24d,_0x530744){try{if(_0x9008b2[_0x52ed64['id']]){_0x52ed64['Users']=_[_0xb814('0x30')](_0x9008b2[_0x52ed64['id']],function(_0x2051d0){return{'id':_0x2051d0['id'],'fullname':_0x2051d0['fullname']};});}}catch(_0x338a28){_0x530744(_0x338a28);}_0x37d24d(_0x52ed64);});}function getInteractionTags(_0x526610,_0x6efe9a){return new BPromise(function(_0x5f3e9b,_0x4cfc58){try{if(_0x526610[_0xb814('0x31')]){_0x526610['Tags']=[];_0x526610[_0xb814('0x31')][_0xb814('0x32')](',')[_0xb814('0x33')](function(_0x599f9f){_0x526610['Tags'][_0xb814('0x34')](_0x6efe9a[_0x599f9f]);});}delete _0x526610[_0xb814('0x31')];}catch(_0x523566){_0x4cfc58(_0x523566);}_0x5f3e9b(_0x526610);});}function updateWhatsappInteraction(_0x2c8943,_0xe558d5,_0x692c72){return new BPromise(function(_0x217b7e,_0x1b78de){return getInteractionUsers(_0x2c8943,_0x692c72)[_0xb814('0x2b')](function(_0x3672f3){return getInteractionTags(_0x3672f3,_0xe558d5);})['then'](function(_0x3207ec){_0x217b7e(_0x3207ec);})[_0xb814('0x35')](function(_0x30de5a){_0x1b78de(_0x30de5a);});});}exports[_0xb814('0x36')]=function(_0x14100d,_0x4ff31a){var _0x16ef82={},_0x57e6e6={},_0x43db67={'count':0x0,'rows':[]};var _0x16e21c=_[_0xb814('0x30')](db['WhatsappInteraction'][_0xb814('0x37')],function(_0xbdb3e9){return{'name':_0xbdb3e9['fieldName'],'type':_0xbdb3e9[_0xb814('0x38')][_0xb814('0x39')]};});_0x57e6e6[_0xb814('0x3a')]=_[_0xb814('0x30')](_0x16e21c,_0xb814('0x2e'));_0x57e6e6[_0xb814('0x3b')]=_['keys'](_0x14100d[_0xb814('0x3b')]);_0x57e6e6['filters']=_[_0xb814('0x3c')](_0x57e6e6['model'],_0x57e6e6[_0xb814('0x3b')]);_0x16ef82['attributes']=_[_0xb814('0x3c')](_0x57e6e6[_0xb814('0x3a')],qs['fields'](_0x14100d['query']['fields']));_0x16ef82['attributes']=_0x16ef82[_0xb814('0x3d')][_0xb814('0x3e')]?_0x16ef82[_0xb814('0x3d')]:_0x57e6e6[_0xb814('0x3a')];if(!_0x14100d['query']['hasOwnProperty'](_0xb814('0x3f'))){_0x16ef82['limit']=qs[_0xb814('0x40')](_0x14100d[_0xb814('0x3b')][_0xb814('0x40')]);_0x16ef82[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x14100d[_0xb814('0x3b')][_0xb814('0x24')]);}_0x16ef82[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x14100d['query']['sort']);_0x16ef82['where']=qs[_0xb814('0x43')](_['pick'](_0x14100d[_0xb814('0x3b')],_0x57e6e6['filters']),_0x16e21c);var _0x411723=[];var _0x44ff56=squel[_0xb814('0x44')]()[_0xb814('0x45')]('id')['field'](_0xb814('0x2e'))[_0xb814('0x45')](_0xb814('0x46'))[_0xb814('0x47')](_0xb814('0x48'));var _0x450a08=squel['select']()[_0xb814('0x45')](_0xb814('0x49'))[_0xb814('0x45')](_0xb814('0x4a'))[_0xb814('0x45')](_0xb814('0x4b'))[_0xb814('0x47')]('user_has_whatsapp_interactions','ui')['left_join'](_0xb814('0x4c'),'u',_0xb814('0x4d'));var _0x4c08d6=squel[_0xb814('0x44')]()[_0xb814('0x47')](_0xb814('0x4e'),'i')[_0xb814('0x4f')](_0xb814('0x50'),'c',_0xb814('0x51'))[_0xb814('0x4f')](_0xb814('0x4c'),'o','o.id\x20=\x20i.UserId')[_0xb814('0x4f')](_0xb814('0x52'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0xb814('0x4f')]('whatsapp_messages','me',_0xb814('0x53'))[_0xb814('0x4f')](_0xb814('0x54'),'it',_0xb814('0x55'))[_0xb814('0x4f')](_0xb814('0x48'),'t',_0xb814('0x56'));var _0x45480e=squel[_0xb814('0x57')]();var _0x2a422a=[];var _0x5e6df7=squel['expr']();var _0x32eca6;if(_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]){_0x32eca6=as[_0xb814('0x59')](_0x14100d[_0xb814('0x3b')][_0xb814('0x58')]);var _0x135208=_0x32eca6['sqlOperator'];for(var _0x26fd0b=0x0;_0x26fd0b<_0x32eca6[_0xb814('0x5a')][_0xb814('0x3e')];_0x26fd0b++){var _0x5a916d=_0x32eca6[_0xb814('0x5a')][_0x26fd0b];var _0x4e6f3c='i';var _0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),_0x5a916d[_0xb814('0x45')]]);if(!_0x252293){switch(_0x5a916d['field']){case _0xb814('0x5b'):if(_0x5a916d[_0xb814('0x5c')]==0x1){_0x4c08d6[_0xb814('0x5d')]('`'+_0x5a916d['field']+_0xb814('0x5e'));}else{_0x4c08d6['having']('`'+_0x5a916d[_0xb814('0x45')]+_0xb814('0x5f'));}break;case'Contact':if(_0x5a916d[_0xb814('0x60')]==='$substring'){if(_0x5a916d['value'][_0xb814('0x32')]('\x20')[_0xb814('0x3e')]>0x1){_0x45480e[_0x135208](_0xb814('0x61'),qs['getFullTextValue'](_0x5a916d[_0xb814('0x5c')]),null);}else{var _0x538b0f='%'+_0x5a916d[_0xb814('0x5c')]+'%';_0x45480e[_0x135208](_0xb814('0x62'),_0x538b0f,_0x538b0f,_0x538b0f);}}else{_0x252293=_['find'](_0x16e21c,[_0xb814('0x2e'),'ContactId']);_0x5a916d[_0xb814('0x45')]=_0xb814('0x63');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x67'):var _0x5441c5=_0x5a916d['value'][_0xb814('0x32')](',')[_0xb814('0x30')](function(_0x4d13db){return Number(_0x4d13db);});_0x5441c5[_0xb814('0x33')](function(_0x58b9a6){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x58b9a6+',%');});_0x2a422a=_[_0xb814('0x68')](_0x2a422a,_0x5441c5);break;case'User':if(_0x5a916d[_0xb814('0x60')]===_0xb814('0x69')){_0x45480e[_0x135208](_0xb814('0x6a'),'%'+_0x5a916d['value']+'%',null);}else{_0x252293=_[_0xb814('0x6b')](_0x16e21c,['name',_0xb814('0x6c')]);_0x5a916d[_0xb814('0x45')]=_0xb814('0x6c');_0x135e13=as[_0xb814('0x64')](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);}break;case _0xb814('0x6d'):_0x135e13=as[_0xb814('0x64')]('me',null,_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')][_0xb814('0x66')],_0x135e13[_0xb814('0x5c')]['end']);break;}}else{var _0x135e13=as['buildExpression'](_0x4e6f3c,_0x252293[_0xb814('0x38')],_0x5a916d);_0x45480e[_0x135208](_0x135e13[_0xb814('0x65')],_0x135e13[_0xb814('0x5c')]['start'],_0x135e13[_0xb814('0x5c')]['end']);}}}else{var _0x37e9c5=_(_0x14100d['query'])[_0xb814('0x6e')]()[_0xb814('0x30')](function(_0xa03cd2){return _[_0xb814('0x6f')](_0x16e21c,[_0xb814('0x2e'),_0xa03cd2])?_0xa03cd2:undefined;})[_0xb814('0x70')]()[_0xb814('0x5c')]();if(!_['isEmpty'](_0x37e9c5)){_0x37e9c5[_0xb814('0x33')](function(_0x51ca51){if(_0x51ca51===_0xb814('0x71')){_0x4c08d6[_0xb814('0x72')](_0xb814('0x73'),[][_0xb814('0x74')](_0x14100d[_0xb814('0x3b')][_0x51ca51]));}else if(_0x51ca51===_0xb814('0x75')){var _0x514dab=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])['$gte'];var _0x3bb2b4=JSON[_0xb814('0x76')](_0x14100d[_0xb814('0x3b')][_0x51ca51])[_0xb814('0x77')];_0x4c08d6[_0xb814('0x72')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x514dab,_0x3bb2b4);}else{if(_0x14100d[_0xb814('0x3b')][_0x51ca51]==='null'){_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x78'));}else{_0x4c08d6[_0xb814('0x72')]('i.'+_0x51ca51+_0xb814('0x79'),_0x14100d[_0xb814('0x3b')][_0x51ca51]);}}});}if(_0x14100d[_0xb814('0x3b')]['read']){if(_0x14100d['query']['read']==0x1){_0x4c08d6[_0xb814('0x5d')]('`unreadMessages`\x20=\x200');}else{_0x4c08d6[_0xb814('0x5d')](_0xb814('0x7a'));}}if(_0x14100d[_0xb814('0x3b')]['tag']){_0x2a422a=_[_0xb814('0x7b')](_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')])?_0x14100d['query'][_0xb814('0x7c')]:new Array(_0x14100d[_0xb814('0x3b')][_0xb814('0x7c')]);_0x2a422a[_0xb814('0x33')](function(_0x555be0){_0x5e6df7['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x555be0+',%');});}if(_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')]){var _0x39863d=_0x14100d[_0xb814('0x3b')][_0xb814('0x7d')][_0xb814('0x7e')]('\x5c','\x5c\x5c')[_0xb814('0x7e')]('\x27\x27',_0xb814('0x7f'));if(qs[_0xb814('0x80')](_0x39863d)){_0x45480e['or'](_0xb814('0x81'),_0x39863d+'%')['or'](_0xb814('0x82'),_0x39863d+'%');}else{_0x45480e['or'](_0xb814('0x83'),qs[_0xb814('0x84')](_0x39863d))['or'](_0xb814('0x85'),_0x39863d+'%');}}}_0x4c08d6[_0xb814('0x72')](_0x45480e);_0x4c08d6['group'](_0xb814('0x86'));var _0x33cfc4={'type':db[_0xb814('0x87')][_0xb814('0x88')][_0xb814('0x89')],'raw':!![]};var _0x283b0f=_0x4c08d6['clone']();_0x283b0f[_0xb814('0x45')]('i.id');_0x283b0f[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));if(_0x16ef82[_0xb814('0x41')]){_0x16ef82[_0xb814('0x41')]['forEach'](function(_0x4c44ee){_0x4c08d6[_0xb814('0x41')]('i.'+_0x4c44ee[0x0],_0x4c44ee[0x1]===_0xb814('0x8b')?![]:!![]);});}if(!_[_0xb814('0x8c')](_0x2a422a)){_0x4c08d6[_0xb814('0x5d')](_0x5e6df7);_0x283b0f['where'](_0xb814('0x8d'),_0x2a422a);}BPromise['resolve']()[_0xb814('0x2b')](function(){if(!_0x32eca6){if(_0x14100d[_0xb814('0x3b')]['WhatsappAccountId']||_0x14100d['query'][_0xb814('0x8e')])return;_0x283b0f['where'](_0xb814('0x8f'));_0x4c08d6[_0xb814('0x72')](_0xb814('0x8f'));return;}return _0x14100d[_0xb814('0x90')][_0xb814('0x91')]({'attributes':['id'],'raw':!![]})[_0xb814('0x2b')](function(_0x40fe4a){if(_['isEmpty'](_0x40fe4a)){_0x283b0f[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x283b0f[_0xb814('0x72')](_0xb814('0x73'),_['map'](_0x40fe4a,'id'));_0x4c08d6[_0xb814('0x72')]('i.WhatsappAccountId\x20IN\x20?',_[_0xb814('0x30')](_0x40fe4a,'id'));}});})[_0xb814('0x2b')](function(){db['sequelize']['query'](_0x283b0f[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x3309c5){_0x43db67[_0xb814('0x93')]=_0x3309c5[_0xb814('0x3e')];if(_0x43db67[_0xb814('0x93')]===0x0)return[];return db[_0xb814('0x94')][_0xb814('0x3b')](_0x44ff56[_0xb814('0x92')](),_0x33cfc4)[_0xb814('0x2b')](function(_0x53e705){_0x411723=_['keyBy'](_0x53e705,'id');_0x33cfc4=_['merge'](_0x33cfc4,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x14100d['query'][_0xb814('0x95')]){_0x16ef82[_0xb814('0x3d')][_0xb814('0x33')](function(_0x59f3ff){_0x4c08d6[_0xb814('0x45')]('i.'+_0x59f3ff);});}else{_0x4c08d6[_0xb814('0x45')](_0xb814('0x8a'),_0xb814('0x5b'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x96'),_0xb814('0x97'));_0x4c08d6[_0xb814('0x45')]('a.mandatoryDisposition',_0xb814('0x98'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x99'));_0x4c08d6[_0xb814('0x45')]('c.firstName',_0xb814('0x9a'));_0x4c08d6[_0xb814('0x45')](_0xb814('0x9b'),_0xb814('0x9c'));_0x4c08d6[_0xb814('0x45')]('c.email','Contact.email');_0x4c08d6[_0xb814('0x45')]('c.phone',_0xb814('0x9d'));_0x4c08d6[_0xb814('0x45')]('c.mobile',_0xb814('0x9e'));_0x4c08d6['field'](_0xb814('0x9f'),'Contact.fax');_0x4c08d6[_0xb814('0x45')](_0xb814('0xa0'),_0xb814('0xa1'));_0x4c08d6[_0xb814('0x45')](_0xb814('0xa2'),_0xb814('0xa3'));_0x4c08d6[_0xb814('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x16ef82[_0xb814('0x40')])_0x4c08d6['limit'](_0x16ef82['limit']);if(_0x16ef82[_0xb814('0x24')])_0x4c08d6[_0xb814('0x24')](_0x16ef82[_0xb814('0x24')]);return db['sequelize'][_0xb814('0x3b')](_0x4c08d6['toString'](),_0x33cfc4);})[_0xb814('0x2b')](function(_0x19d508){_0x450a08[_0xb814('0x72')](_0xb814('0xa4'),_['map'](_0x19d508,'id'));return db[_0xb814('0x94')][_0xb814('0x3b')](_0x450a08[_0xb814('0x92')](),_0x33cfc4)['then'](function(_0x1ebbf6){var _0x3fc77d=_[_0xb814('0xa5')](_0x1ebbf6,'WhatsappInteractionId');var _0x5d8626=[];_0x19d508[_0xb814('0x33')](function(_0x9dc06b){_0x5d8626[_0xb814('0x34')](updateWhatsappInteraction(_0x9dc06b,_0x411723,_0x3fc77d));});return BPromise[_0xb814('0xa6')](_0x5d8626);});});})[_0xb814('0x2b')](function(_0x37a7ab){_0x43db67[_0xb814('0xa7')]=_0x37a7ab;return _0x43db67;})[_0xb814('0x2b')](respondWithFilteredResult(_0x4ff31a,_0x16ef82));})[_0xb814('0x35')](handleError(_0x4ff31a,null));};exports[_0xb814('0xa8')]=function(_0x2569a5,_0x2a13fb){var _0x5b8d2e={'raw':![],'where':{'id':_0x2569a5[_0xb814('0xa9')]['id']}},_0x5416dc={};_0x5416dc['model']=_[_0xb814('0x6e')](db[_0xb814('0xaa')][_0xb814('0x37')]);_0x5416dc[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x2569a5[_0xb814('0x3b')]);_0x5416dc[_0xb814('0x43')]=_['intersection'](_0x5416dc['model'],_0x5416dc[_0xb814('0x3b')]);_0x5b8d2e['attributes']=_[_0xb814('0x3c')](_0x5416dc[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x2569a5['query'][_0xb814('0x95')]));_0x5b8d2e[_0xb814('0x3d')]=_0x5b8d2e[_0xb814('0x3d')][_0xb814('0x3e')]?_0x5b8d2e[_0xb814('0x3d')]:_0x5416dc['model'];if(_0x2569a5[_0xb814('0x3b')][_0xb814('0xab')]){_0x5b8d2e['include']=[{'all':!![]}];}_0x5b8d2e=_[_0xb814('0xac')]({},_0x5b8d2e,_0x2569a5[_0xb814('0xad')]);return db[_0xb814('0xaa')]['find'](_0x5b8d2e)[_0xb814('0x2b')](handleEntityNotFound(_0x2a13fb,null))[_0xb814('0x2b')](respondWithResult(_0x2a13fb,null))['catch'](handleError(_0x2a13fb,null));};exports[_0xb814('0xae')]=function(_0x171f83,_0x5b5634){return db[_0xb814('0xaa')][_0xb814('0xae')](_0x171f83[_0xb814('0x6d')],{})[_0xb814('0x2b')](respondWithResult(_0x5b5634,0xc9))[_0xb814('0x35')](handleError(_0x5b5634,null));};exports[_0xb814('0x29')]=function(_0x40ae0b,_0x336a8f){if(_0x40ae0b[_0xb814('0x6d')]['id']){delete _0x40ae0b[_0xb814('0x6d')]['id'];}return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x40ae0b['params']['id']}})['then'](handleEntityNotFound(_0x336a8f,null))[_0xb814('0x2b')](saveUpdates(_0x40ae0b['body'],null))['then'](respondWithResult(_0x336a8f,null))[_0xb814('0x35')](handleError(_0x336a8f,null));};exports['destroy']=function(_0x4f0427,_0x50cb34){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x4f0427[_0xb814('0xa9')]['id']}})['then'](handleEntityNotFound(_0x50cb34,null))[_0xb814('0x2b')](removeEntity(_0x50cb34,null))['catch'](handleError(_0x50cb34,null));};exports[_0xb814('0xaf')]=function(_0x2e6660,_0x49a8de){return db[_0xb814('0xaa')]['describe']()[_0xb814('0x2b')](respondWithResult(_0x49a8de,null))[_0xb814('0x35')](handleError(_0x49a8de,null));};exports[_0xb814('0xb0')]=function(_0x39ce17,_0x11efb8,_0xaf705d){return db[_0xb814('0xb1')][_0xb814('0x6b')]({'where':{'id':_0x39ce17[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x11efb8,null))[_0xb814('0x2b')](function(_0x3e7a9a){if(_0x3e7a9a){return _0x3e7a9a[_0xb814('0xb0')](_0x39ce17[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x39ce17[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{});}})['then'](respondWithResult(_0x11efb8,null))[_0xb814('0x35')](handleError(_0x11efb8,null));};exports[_0xb814('0xb3')]=function(_0x1868d9,_0x570191,_0x56b2aa){var _0x473b30={'raw':![],'where':{}};var _0x4af71e={};var _0x2d40e6={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xb814('0xb4')]({'where':{'id':_0x1868d9['params']['id']}})['then'](handleEntityNotFound(_0x570191,null))[_0xb814('0x2b')](function(_0x32c956){if(_0x32c956){_0x4af71e[_0xb814('0x3a')]=_[_0xb814('0x6e')](db[_0xb814('0xb1')][_0xb814('0x37')]);_0x4af71e[_0xb814('0x3b')]=_[_0xb814('0x6e')](_0x1868d9[_0xb814('0x3b')]);_0x4af71e[_0xb814('0x43')]=_[_0xb814('0x3c')](_0x4af71e['model'],_0x4af71e[_0xb814('0x3b')]);_0x473b30['attributes']=_[_0xb814('0x3c')](_0x4af71e[_0xb814('0x3a')],qs[_0xb814('0x95')](_0x1868d9['query'][_0xb814('0x95')]));_0x473b30[_0xb814('0x3d')]=_0x473b30[_0xb814('0x3d')][_0xb814('0x3e')]?_0x473b30[_0xb814('0x3d')]:_0x4af71e[_0xb814('0x3a')];if(!_0x1868d9[_0xb814('0x3b')][_0xb814('0xb5')](_0xb814('0x3f'))){_0x473b30[_0xb814('0x40')]=qs[_0xb814('0x40')](_0x1868d9[_0xb814('0x3b')][_0xb814('0x40')]);_0x473b30[_0xb814('0x24')]=qs[_0xb814('0x24')](_0x1868d9['query'][_0xb814('0x24')]);}_0x473b30[_0xb814('0x41')]=qs[_0xb814('0x42')](_0x1868d9['query']['sort']);_0x473b30[_0xb814('0x72')]=qs['filters'](_['pick'](_0x1868d9['query'],_0x4af71e['filters']));_0x473b30[_0xb814('0x72')][_0xb814('0xb6')]=_0x32c956['id'];if(_0x1868d9['query'][_0xb814('0x7d')]){_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],{'$or':_[_0xb814('0x30')](_0x473b30[_0xb814('0x3d')],function(_0x20e608){var _0x7b9948={};_0x7b9948[_0x20e608]={'$like':'%'+_0x1868d9[_0xb814('0x3b')][_0xb814('0x7d')]+'%'};return _0x7b9948;})});}if(_0x1868d9[_0xb814('0x3b')]['$gte']){var _0x2a5dff=_0x1868d9['query'][_0xb814('0xb7')][_0xb814('0x32')](',');var _0x35e8f7={};_0x35e8f7[_0x2a5dff[0x0]]={'$gte':moment(_0x2a5dff[0x1])[_0xb814('0xb8')](_0xb814('0xb9'))};_0x473b30[_0xb814('0x72')]=_[_0xb814('0xac')](_0x473b30[_0xb814('0x72')],_0x35e8f7);}_0x473b30=_['merge']({},_0x473b30,_0x1868d9['options']);return db['WhatsappMessage'][_0xb814('0x93')]({'where':_0x473b30[_0xb814('0x72')]})[_0xb814('0x2b')](function(_0x3b7bee){_0x2d40e6[_0xb814('0x93')]=_0x3b7bee;if(_0x1868d9[_0xb814('0x3b')][_0xb814('0xab')]){_0x473b30[_0xb814('0xba')]=[{'all':!![]}];}return db[_0xb814('0xb1')][_0xb814('0xbb')](_0x473b30);})['then'](function(_0x5c989a){_0x2d40e6[_0xb814('0xa7')]=_0x5c989a;return _0x2d40e6;});}})[_0xb814('0x2b')](respondWithFilteredResult(_0x570191,_0x473b30))[_0xb814('0x35')](handleError(_0x570191,null));};exports[_0xb814('0xbc')]=function(_0x3f0c9c,_0x2642ab,_0x48358c){return db[_0xb814('0xaa')]['find']({'where':{'id':_0x3f0c9c[_0xb814('0xa9')]['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x2642ab,null))[_0xb814('0x2b')](function(_0x94aa05){if(_0x94aa05){return _0x94aa05[_0xb814('0xbd')](_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')],_['omit'](_0x3f0c9c[_0xb814('0x6d')],[_0xb814('0xb2'),'id'])||{})[_0xb814('0xbe')](function(){return db[_0xb814('0x67')]['findAll']({'attributes':['id',_0xb814('0x2e'),_0xb814('0x46')],'where':{'id':_0x3f0c9c[_0xb814('0x6d')][_0xb814('0xb2')]}});})[_0xb814('0x2b')](function(_0x4a2aa5){socket[_0xb814('0xbf')](_0xb814('0xc0'),{'id':Number(_0x3f0c9c[_0xb814('0xa9')]['id']),'tags':_0x4a2aa5||[]});return{'id':Number(_0x3f0c9c['params']['id']),'tags':_0x4a2aa5||[]};});}})[_0xb814('0x2b')](respondWithResult(_0x2642ab,null))['catch'](handleError(_0x2642ab,null));};exports[_0xb814('0xc1')]=function(_0x5b4315,_0x22f6f1,_0x3467bd){return db[_0xb814('0xaa')][_0xb814('0x6b')]({'where':{'id':_0x5b4315['params']['id']}})[_0xb814('0x2b')](handleEntityNotFound(_0x22f6f1,null))[_0xb814('0x2b')](function(_0x3fda0d){if(_0x3fda0d){return _0x3fda0d[_0xb814('0xc1')](_0x5b4315[_0xb814('0x3b')][_0xb814('0xb2')]);}})[_0xb814('0x2b')](respondWithStatusCode(_0x22f6f1,null))[_0xb814('0x35')](handleError(_0x22f6f1,null));};exports[_0xb814('0xc2')]=function(_0x152260,_0x3bc03a){var _0x368696=moment()[_0xb814('0xc3')]()[_0xb814('0x92')]();var _0x8e882a=path['join'](config[_0xb814('0xc4')],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc7'));var _0x4017b6=path[_0xb814('0xc8')](config['root'],_0xb814('0xc5'),_0xb814('0xc6'),_0xb814('0xc9'));var _0x31b4f5=path['join'](_0x8e882a,_0x368696);var _0x5b5a26=util[_0xb814('0xb8')](_0xb814('0xca'),_0x152260[_0xb814('0xa9')]['id'],_0x368696);var _0x667ca1=path[_0xb814('0xc8')](_0x8e882a,_0x5b5a26);var _0x2c510a=[];_0x2c510a['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xcb'),'attributes':['id',_0xb814('0xcc')],'raw':!![]});_0x2c510a[_0xb814('0x34')]({'model':db['CmContact'],'as':_0xb814('0xcd'),'attributes':['id',_0xb814('0xce'),_0xb814('0xcf')],'raw':!![]});if(_0x152260[_0xb814('0x3b')][_0xb814('0xc9')]){_0x2c510a['push']({'model':db[_0xb814('0xd0')],'as':_0xb814('0xd0'),'raw':!![]});}var _0x371dd7=[{'model':db[_0xb814('0xb1')],'as':_0xb814('0xd1'),'attributes':['id',_0xb814('0x6d'),_0xb814('0x75'),_0xb814('0xd2'),_0xb814('0xd3'),_0xb814('0xd4')],'include':_0x2c510a}];_0x371dd7[_0xb814('0x34')]({'model':db[_0xb814('0xd5')],'as':_0xb814('0xd6'),'attributes':['id','name']});_0x371dd7['push']({'model':db[_0xb814('0xcb')],'as':_0xb814('0xd7'),'attributes':['id',_0xb814('0xcc')]});return db['WhatsappInteraction'][_0xb814('0x6b')]({'where':{'id':_0x152260[_0xb814('0xa9')]['id']},'include':_0x371dd7})[_0xb814('0x2b')](handleEntityNotFound(_0x3bc03a,null))['then'](function(_0x10537d){if(_0x10537d){var _0xa651a=_0x10537d[_0xb814('0xd8')]({'plain':!![]});fs[_0xb814('0xd9')](_0x31b4f5);var _0x6ec0f5={'format':'A4','border':_0xb814('0xda'),'header':{'height':'40px','contents':{'first':_0xb814('0xdb')}},'footer':{'height':'30px','contents':{'default':util[_0xb814('0xb8')]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0xb814('0xb8')](_0xb814('0xdc'),_0xb814('0xdd'),_0xa651a['id']),moment()['format'](_0xb814('0xde'))[_0xb814('0x92')]())}}};var _0x164304={'channel':'Whatsapp','account':_0xa651a[_0xb814('0xd6')]['name'],'agent':_0xa651a[_0xb814('0xd7')]?_0xa651a[_0xb814('0xd7')][_0xb814('0xcc')]:'N.A.','createdAt':moment(_0xa651a[_0xb814('0x75')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')](),'closedAt':_0xa651a['closed']?moment(_0xa651a[_0xb814('0xdf')])[_0xb814('0xb8')](_0xb814('0xb9'))[_0xb814('0x92')]():'','disposition':_0xa651a[_0xb814('0xe0')],'messages':_(_0xa651a[_0xb814('0xd1')])[_0xb814('0x7d')]({'secret':![]})[_0xb814('0x30')](function(_0x9a33d0){if(_0x9a33d0['Attachment']){var _0x2fe47b=path[_0xb814('0xc8')](_0x4017b6,_0x9a33d0[_0xb814('0xd0')]['basename']);if(fs[_0xb814('0xe1')](_0x2fe47b)){fs['createReadStream'](_0x2fe47b)['pipe'](fs['createWriteStream'](path[_0xb814('0xc8')](_0x31b4f5,_0x9a33d0['Attachment'][_0xb814('0xe2')])));}}return{'date':moment(_0x9a33d0[_0xb814('0x75')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xb814('0x92')](),'sender':_0x9a33d0['direction']===_0xb814('0xe3')?_0x9a33d0['User']?_0x9a33d0[_0xb814('0xcb')][_0xb814('0xcc')]:_0xb814('0xe4'):_0x9a33d0['Contact']['firstName']+(_0x9a33d0['Contact'][_0xb814('0xcf')]?'\x20'+_0x9a33d0['Contact']['lastName']:''),'body':_0x9a33d0[_0xb814('0xd0')]?_0x9a33d0['Attachment']['basename']:_0x9a33d0['body'],'direction':_0x9a33d0[_0xb814('0xd2')]===_0xb814('0xe3')?'A':'C','secret':_0x9a33d0[_0xb814('0xd3')],'read':_0x9a33d0['read'],'attachment':_0x9a33d0[_0xb814('0xd0')]};})[_0xb814('0x5c')]()};return ejs[_0xb814('0xe5')](path[_0xb814('0xc8')](config[_0xb814('0xc4')],_0xb814('0xc5'),'views',_0xb814('0xe6')),{'interaction':_0x164304})[_0xb814('0x2b')](function(_0x28b818){return new BPromise(function(_0x171845,_0x4f2db2){pdf[_0xb814('0xae')](_0x28b818,_0x6ec0f5)[_0xb814('0xe7')](path[_0xb814('0xc8')](_0x31b4f5,_0xb814('0xe8')+_0xa651a['id']+'-'+_0x368696+_0xb814('0xe9')),function(_0x2cb01d,_0x1f4540){if(_0x2cb01d)return _0x4f2db2(_0x2cb01d);_0x171845(_0x1f4540);});});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x81ebc0,_0x2e7959){zipdir(_0x31b4f5,{'saveTo':_0x667ca1},function(_0x47f054,_0x1aa70b){if(_0x47f054)return _0x2e7959(_0x47f054);return _0x81ebc0(_0x1aa70b);});})[_0xb814('0x2b')](function(){return new BPromise(function(_0x5706ad,_0x3b8438){rimraf(_0x31b4f5,function(_0x56e231){if(_0x56e231)_0x3b8438(_0x56e231);return _0x5706ad();});});})[_0xb814('0x2b')](function(){return _0x3bc03a[_0xb814('0xc2')](_0x667ca1,_0x5b5a26,function(_0x5e2273){if(_0x5e2273){console[_0xb814('0xea')]('err',_0x5e2273);}else{fs[_0xb814('0xeb')](_0x667ca1);}});});});}else{return _0x3bc03a[_0xb814('0x20')](0xc8);}})[_0xb814('0x35')](handleError(_0x3bc03a,null));}; \ No newline at end of file +var _0x7a54=['attachments','Attachment','direction','secret','WhatsappAccount','Account','Owner','mkdirSync','30px','%s\x20#%d','Whatsapp','YYYY-MM-DD','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','System','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','download','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','select','color','tools_tags','u.id','field','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','whatsapp_messages','whatsapp_interaction_has_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','buildExpression','start','body','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','forEach','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','WhatsappInteractionId','rows','show','params','includeAll','include','WhatsappInteraction','create','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','format','options','findAll','emit','removeTags','unix','root','files','tmp','server','join','transcript-%d-%s.zip','User','firstName','lastName'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x7a54,0x106));var _0x47a5=function(_0x10ad67,_0x207ce7){_0x10ad67=_0x10ad67-0x0;var _0x4a0a64=_0x7a54[_0x10ad67];return _0x4a0a64;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}function getInteractionUsers(_0x136b14,_0x16631f){return new BPromise(function(_0x361bfa,_0x1127f8){try{if(_0x16631f[_0x136b14['id']]){_0x136b14[_0x47a5('0x2b')]=_[_0x47a5('0x2c')](_0x16631f[_0x136b14['id']],function(_0x528582){return{'id':_0x528582['id'],'fullname':_0x528582[_0x47a5('0x2d')]};});}}catch(_0x51833b){_0x1127f8(_0x51833b);}_0x361bfa(_0x136b14);});}function getInteractionTags(_0x2ef875,_0x9ac908){return new BPromise(function(_0x16901f,_0x4d6b57){try{if(_0x2ef875[_0x47a5('0x2e')]){_0x2ef875[_0x47a5('0x2f')]=[];_0x2ef875[_0x47a5('0x2e')][_0x47a5('0x30')](',')['forEach'](function(_0x50d875){_0x2ef875[_0x47a5('0x2f')][_0x47a5('0x31')](_0x9ac908[_0x50d875]);});}delete _0x2ef875['TagIds'];}catch(_0x4e1006){_0x4d6b57(_0x4e1006);}_0x16901f(_0x2ef875);});}function updateWhatsappInteraction(_0x836303,_0x51544e,_0x57bff6){return new BPromise(function(_0x42f70c,_0x53119b){return getInteractionUsers(_0x836303,_0x57bff6)[_0x47a5('0x26')](function(_0xd972c){return getInteractionTags(_0xd972c,_0x51544e);})['then'](function(_0x4843c0){_0x42f70c(_0x4843c0);})[_0x47a5('0x32')](function(_0x5910bb){_0x53119b(_0x5910bb);});});}exports[_0x47a5('0x33')]=function(_0x87e4c9,_0xf269a8){var _0x52749b={},_0x18f7e9={},_0x50c086={'count':0x0,'rows':[]};var _0x53c754=_[_0x47a5('0x2c')](db['WhatsappInteraction'][_0x47a5('0x34')],function(_0x5ef577){return{'name':_0x5ef577[_0x47a5('0x35')],'type':_0x5ef577[_0x47a5('0x36')][_0x47a5('0x37')]};});_0x18f7e9[_0x47a5('0x38')]=_[_0x47a5('0x2c')](_0x53c754,_0x47a5('0x29'));_0x18f7e9[_0x47a5('0x39')]=_[_0x47a5('0x3a')](_0x87e4c9[_0x47a5('0x39')]);_0x18f7e9['filters']=_[_0x47a5('0x3b')](_0x18f7e9[_0x47a5('0x38')],_0x18f7e9['query']);_0x52749b[_0x47a5('0x3c')]=_[_0x47a5('0x3b')](_0x18f7e9[_0x47a5('0x38')],qs['fields'](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x3d')]));_0x52749b['attributes']=_0x52749b[_0x47a5('0x3c')][_0x47a5('0x3e')]?_0x52749b['attributes']:_0x18f7e9['model'];if(!_0x87e4c9['query'][_0x47a5('0x3f')]('nolimit')){_0x52749b[_0x47a5('0x1f')]=qs[_0x47a5('0x1f')](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x1f')]);_0x52749b[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x1e')]);}_0x52749b[_0x47a5('0x40')]=qs[_0x47a5('0x41')](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x41')]);_0x52749b[_0x47a5('0x42')]=qs['filters'](_[_0x47a5('0x43')](_0x87e4c9[_0x47a5('0x39')],_0x18f7e9[_0x47a5('0x44')]),_0x53c754);var _0x23bd8d=[];var _0x586f4f=squel[_0x47a5('0x45')]()['field']('id')['field']('name')['field'](_0x47a5('0x46'))['from'](_0x47a5('0x47'));var _0x3a740b=squel[_0x47a5('0x45')]()['field'](_0x47a5('0x48'))[_0x47a5('0x49')]('u.fullname')['field'](_0x47a5('0x4a'))['from'](_0x47a5('0x4b'),'ui')[_0x47a5('0x4c')](_0x47a5('0x4d'),'u',_0x47a5('0x4e'));var _0x34a9ae=squel[_0x47a5('0x45')]()[_0x47a5('0x4f')](_0x47a5('0x50'),'i')[_0x47a5('0x4c')](_0x47a5('0x51'),'c',_0x47a5('0x52'))[_0x47a5('0x4c')](_0x47a5('0x4d'),'o',_0x47a5('0x53'))[_0x47a5('0x4c')](_0x47a5('0x54'),'a','a.id\x20=\x20i.WhatsappAccountId')[_0x47a5('0x4c')](_0x47a5('0x55'),'me','me.WhatsappInteractionId\x20=\x20i.id')['left_join'](_0x47a5('0x56'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x47a5('0x4c')](_0x47a5('0x47'),'t','t.id\x20=\x20it.TagId');var _0x4f62d3=squel[_0x47a5('0x57')]();var _0x52d409=[];var _0x2d147c=squel[_0x47a5('0x57')]();var _0x3548bc;if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x58')]){_0x3548bc=as[_0x47a5('0x59')](_0x87e4c9[_0x47a5('0x39')]['search']);var _0x48a0ef=_0x3548bc[_0x47a5('0x5a')];for(var _0x411230=0x0;_0x411230<_0x3548bc[_0x47a5('0x5b')][_0x47a5('0x3e')];_0x411230++){var _0x2c7020=_0x3548bc[_0x47a5('0x5b')][_0x411230];var _0x249de5='i';var _0x492cf7=_[_0x47a5('0x5c')](_0x53c754,[_0x47a5('0x29'),_0x2c7020[_0x47a5('0x49')]]);if(!_0x492cf7){switch(_0x2c7020['field']){case _0x47a5('0x5d'):if(_0x2c7020['value']==0x1){_0x34a9ae[_0x47a5('0x5e')]('`'+_0x2c7020[_0x47a5('0x49')]+_0x47a5('0x5f'));}else{_0x34a9ae[_0x47a5('0x5e')]('`'+_0x2c7020['field']+_0x47a5('0x60'));}break;case _0x47a5('0x61'):if(_0x2c7020[_0x47a5('0x62')]===_0x47a5('0x63')){if(_0x2c7020[_0x47a5('0x64')][_0x47a5('0x30')]('\x20')[_0x47a5('0x3e')]>0x1){_0x4f62d3[_0x48a0ef]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x47a5('0x65')](_0x2c7020[_0x47a5('0x64')]),null);}else{var _0x187d7e='%'+_0x2c7020[_0x47a5('0x64')]+'%';_0x4f62d3[_0x48a0ef](_0x47a5('0x66'),_0x187d7e,_0x187d7e,_0x187d7e);}}else{_0x492cf7=_[_0x47a5('0x5c')](_0x53c754,['name',_0x47a5('0x67')]);_0x2c7020[_0x47a5('0x49')]=_0x47a5('0x67');_0x5cbe97=as['buildExpression'](_0x249de5,_0x492cf7[_0x47a5('0x36')],_0x2c7020);_0x4f62d3[_0x48a0ef](_0x5cbe97[_0x47a5('0x68')],_0x5cbe97[_0x47a5('0x64')]['start'],_0x5cbe97['value'][_0x47a5('0x1b')]);}break;case _0x47a5('0x69'):var _0x4fa1da=_0x2c7020['value'][_0x47a5('0x30')](',')['map'](function(_0x16bb8a){return Number(_0x16bb8a);});_0x4fa1da['forEach'](function(_0x482de6){_0x2d147c['or'](_0x47a5('0x6a'),'%,'+_0x482de6+',%');});_0x52d409=_[_0x47a5('0x6b')](_0x52d409,_0x4fa1da);break;case'User':if(_0x2c7020[_0x47a5('0x62')]===_0x47a5('0x63')){_0x4f62d3[_0x48a0ef]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2c7020['value']+'%',null);}else{_0x492cf7=_[_0x47a5('0x5c')](_0x53c754,[_0x47a5('0x29'),_0x47a5('0x6c')]);_0x2c7020[_0x47a5('0x49')]='UserId';_0x5cbe97=as[_0x47a5('0x6d')](_0x249de5,_0x492cf7[_0x47a5('0x36')],_0x2c7020);_0x4f62d3[_0x48a0ef](_0x5cbe97[_0x47a5('0x68')],_0x5cbe97['value'][_0x47a5('0x6e')],_0x5cbe97['value'][_0x47a5('0x1b')]);}break;case _0x47a5('0x6f'):_0x5cbe97=as[_0x47a5('0x6d')]('me',null,_0x2c7020);_0x4f62d3[_0x48a0ef](_0x5cbe97[_0x47a5('0x68')],_0x5cbe97[_0x47a5('0x64')]['start'],_0x5cbe97[_0x47a5('0x64')]['end']);break;}}else{var _0x5cbe97=as['buildExpression'](_0x249de5,_0x492cf7['type'],_0x2c7020);_0x4f62d3[_0x48a0ef](_0x5cbe97[_0x47a5('0x68')],_0x5cbe97[_0x47a5('0x64')][_0x47a5('0x6e')],_0x5cbe97['value']['end']);}}}else{var _0x139229=_(_0x87e4c9[_0x47a5('0x39')])[_0x47a5('0x3a')]()[_0x47a5('0x2c')](function(_0xc45e25){return _['some'](_0x53c754,[_0x47a5('0x29'),_0xc45e25])?_0xc45e25:undefined;})['compact']()[_0x47a5('0x64')]();if(!_[_0x47a5('0x70')](_0x139229)){_0x139229['forEach'](function(_0x32b4de){if(_0x32b4de===_0x47a5('0x71')){_0x34a9ae[_0x47a5('0x42')](_0x47a5('0x72'),[][_0x47a5('0x73')](_0x87e4c9[_0x47a5('0x39')][_0x32b4de]));}else if(_0x32b4de===_0x47a5('0x74')){var _0x3ac38c=JSON['parse'](_0x87e4c9[_0x47a5('0x39')][_0x32b4de])[_0x47a5('0x75')];var _0x3c75c6=JSON[_0x47a5('0x76')](_0x87e4c9[_0x47a5('0x39')][_0x32b4de])['$lte'];_0x34a9ae[_0x47a5('0x42')](_0x47a5('0x77'),_0x3ac38c,_0x3c75c6);}else{if(_0x87e4c9[_0x47a5('0x39')][_0x32b4de]===_0x47a5('0x78')){_0x34a9ae[_0x47a5('0x42')]('i.'+_0x32b4de+_0x47a5('0x79'));}else{_0x34a9ae[_0x47a5('0x42')]('i.'+_0x32b4de+_0x47a5('0x7a'),_0x87e4c9[_0x47a5('0x39')][_0x32b4de]);}}});}if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7b')]){if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7b')]==0x1){_0x34a9ae[_0x47a5('0x5e')](_0x47a5('0x7c'));}else{_0x34a9ae['having'](_0x47a5('0x7d'));}}if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7e')]){_0x52d409=_['isArray'](_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7e')])?_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7e')]:new Array(_0x87e4c9['query'][_0x47a5('0x7e')]);_0x52d409['forEach'](function(_0x2d5ee6){_0x2d147c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2d5ee6+',%');});}if(_0x87e4c9[_0x47a5('0x39')]['filter']){var _0x7c1190=_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x7f')]['replace']('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x47a5('0x80')](_0x7c1190)){_0x4f62d3['or'](_0x47a5('0x81'),_0x7c1190+'%')['or'](_0x47a5('0x82'),_0x7c1190+'%');}else{_0x4f62d3['or'](_0x47a5('0x83'),qs['getFullTextValue'](_0x7c1190))['or'](_0x47a5('0x84'),_0x7c1190+'%');}}}_0x34a9ae[_0x47a5('0x42')](_0x4f62d3);_0x34a9ae[_0x47a5('0x85')](_0x47a5('0x86'));var _0x308c9a={'type':db[_0x47a5('0x87')][_0x47a5('0x88')][_0x47a5('0x89')],'raw':!![]};var _0x4618a0=_0x34a9ae[_0x47a5('0x8a')]();_0x4618a0[_0x47a5('0x49')](_0x47a5('0x86'));_0x4618a0['field'](_0x47a5('0x8b'),'unreadMessages');if(_0x52749b[_0x47a5('0x40')]){_0x52749b[_0x47a5('0x40')][_0x47a5('0x8c')](function(_0x12fec9){_0x34a9ae[_0x47a5('0x40')]('i.'+_0x12fec9[0x0],_0x12fec9[0x1]===_0x47a5('0x8d')?![]:!![]);});}if(!_[_0x47a5('0x70')](_0x52d409)){_0x34a9ae[_0x47a5('0x5e')](_0x2d147c);_0x4618a0[_0x47a5('0x42')](_0x47a5('0x8e'),_0x52d409);}BPromise[_0x47a5('0x8f')]()[_0x47a5('0x26')](function(){if(!_0x3548bc){if(_0x87e4c9[_0x47a5('0x39')][_0x47a5('0x71')]||_0x87e4c9[_0x47a5('0x39')]['journey'])return;_0x4618a0['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x34a9ae['where'](_0x47a5('0x90'));return;}return _0x87e4c9[_0x47a5('0x91')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x47a5('0x26')](function(_0x44dda2){if(_[_0x47a5('0x70')](_0x44dda2)){_0x4618a0[_0x47a5('0x42')](_0x47a5('0x92'));_0x34a9ae[_0x47a5('0x42')](_0x47a5('0x92'));}else{_0x4618a0[_0x47a5('0x42')](_0x47a5('0x72'),_[_0x47a5('0x2c')](_0x44dda2,'id'));_0x34a9ae[_0x47a5('0x42')]('i.WhatsappAccountId\x20IN\x20?',_[_0x47a5('0x2c')](_0x44dda2,'id'));}});})[_0x47a5('0x26')](function(){db[_0x47a5('0x93')]['query'](_0x4618a0[_0x47a5('0x94')](),_0x308c9a)[_0x47a5('0x26')](function(_0x17b61d){_0x50c086['count']=_0x17b61d[_0x47a5('0x3e')];if(_0x50c086['count']===0x0)return[];return db['sequelize'][_0x47a5('0x39')](_0x586f4f[_0x47a5('0x94')](),_0x308c9a)[_0x47a5('0x26')](function(_0x27333e){_0x23bd8d=_[_0x47a5('0x95')](_0x27333e,'id');_0x308c9a=_[_0x47a5('0x96')](_0x308c9a,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x87e4c9['query'][_0x47a5('0x3d')]){_0x52749b['attributes'][_0x47a5('0x8c')](function(_0x3fffd1){_0x34a9ae[_0x47a5('0x49')]('i.'+_0x3fffd1);});}else{_0x34a9ae[_0x47a5('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x47a5('0x5d'));_0x34a9ae['field']('a.key',_0x47a5('0x97'));_0x34a9ae[_0x47a5('0x49')]('a.mandatoryDisposition',_0x47a5('0x98'));_0x34a9ae[_0x47a5('0x49')](_0x47a5('0x99'));_0x34a9ae['field'](_0x47a5('0x9a'),'Contact.firstName');_0x34a9ae[_0x47a5('0x49')](_0x47a5('0x9b'),_0x47a5('0x9c'));_0x34a9ae['field'](_0x47a5('0x9d'),_0x47a5('0x9e'));_0x34a9ae[_0x47a5('0x49')]('c.phone',_0x47a5('0x9f'));_0x34a9ae['field'](_0x47a5('0xa0'),'Contact.mobile');_0x34a9ae[_0x47a5('0x49')](_0x47a5('0xa1'),_0x47a5('0xa2'));_0x34a9ae[_0x47a5('0x49')]('o.fullname',_0x47a5('0xa3'));_0x34a9ae[_0x47a5('0x49')](_0x47a5('0xa4'),_0x47a5('0xa5'));_0x34a9ae[_0x47a5('0x49')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x52749b[_0x47a5('0x1f')])_0x34a9ae['limit'](_0x52749b[_0x47a5('0x1f')]);if(_0x52749b[_0x47a5('0x1e')])_0x34a9ae[_0x47a5('0x1e')](_0x52749b['offset']);return db[_0x47a5('0x93')][_0x47a5('0x39')](_0x34a9ae['toString'](),_0x308c9a);})[_0x47a5('0x26')](function(_0x8a9dea){_0x3a740b[_0x47a5('0x42')](_0x47a5('0xa6'),_['map'](_0x8a9dea,'id'));return db['sequelize'][_0x47a5('0x39')](_0x3a740b[_0x47a5('0x94')](),_0x308c9a)['then'](function(_0x27d422){var _0x23f055=_['groupBy'](_0x27d422,_0x47a5('0xa7'));var _0x2a02cd=[];_0x8a9dea[_0x47a5('0x8c')](function(_0x59f010){_0x2a02cd[_0x47a5('0x31')](updateWhatsappInteraction(_0x59f010,_0x23bd8d,_0x23f055));});return BPromise['all'](_0x2a02cd);});});})[_0x47a5('0x26')](function(_0x5e2946){_0x50c086[_0x47a5('0xa8')]=_0x5e2946;return _0x50c086;})[_0x47a5('0x26')](respondWithFilteredResult(_0xf269a8,_0x52749b));})['catch'](handleError(_0xf269a8,null));};exports[_0x47a5('0xa9')]=function(_0x597cb2,_0x1eabef){var _0x36f619={'raw':![],'where':{'id':_0x597cb2[_0x47a5('0xaa')]['id']}},_0x37e045={};_0x37e045['model']=_[_0x47a5('0x3a')](db['WhatsappInteraction']['rawAttributes']);_0x37e045[_0x47a5('0x39')]=_[_0x47a5('0x3a')](_0x597cb2[_0x47a5('0x39')]);_0x37e045[_0x47a5('0x44')]=_[_0x47a5('0x3b')](_0x37e045['model'],_0x37e045[_0x47a5('0x39')]);_0x36f619[_0x47a5('0x3c')]=_[_0x47a5('0x3b')](_0x37e045[_0x47a5('0x38')],qs['fields'](_0x597cb2[_0x47a5('0x39')]['fields']));_0x36f619[_0x47a5('0x3c')]=_0x36f619[_0x47a5('0x3c')][_0x47a5('0x3e')]?_0x36f619[_0x47a5('0x3c')]:_0x37e045[_0x47a5('0x38')];if(_0x597cb2[_0x47a5('0x39')][_0x47a5('0xab')]){_0x36f619[_0x47a5('0xac')]=[{'all':!![]}];}_0x36f619=_[_0x47a5('0x96')]({},_0x36f619,_0x597cb2['options']);return db[_0x47a5('0xad')][_0x47a5('0x5c')](_0x36f619)['then'](handleEntityNotFound(_0x1eabef,null))[_0x47a5('0x26')](respondWithResult(_0x1eabef,null))[_0x47a5('0x32')](handleError(_0x1eabef,null));};exports[_0x47a5('0xae')]=function(_0x5b85cd,_0x4bf1f5){return db[_0x47a5('0xad')][_0x47a5('0xae')](_0x5b85cd['body'],{})['then'](respondWithResult(_0x4bf1f5,0xc9))[_0x47a5('0x32')](handleError(_0x4bf1f5,null));};exports[_0x47a5('0x24')]=function(_0x54eab1,_0x29e384){if(_0x54eab1[_0x47a5('0x6f')]['id']){delete _0x54eab1['body']['id'];}return db[_0x47a5('0xad')][_0x47a5('0x5c')]({'where':{'id':_0x54eab1[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x29e384,null))[_0x47a5('0x26')](saveUpdates(_0x54eab1[_0x47a5('0x6f')],null))['then'](respondWithResult(_0x29e384,null))['catch'](handleError(_0x29e384,null));};exports['destroy']=function(_0x133b7a,_0xce5ada){return db['WhatsappInteraction'][_0x47a5('0x5c')]({'where':{'id':_0x133b7a[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0xce5ada,null))[_0x47a5('0x26')](removeEntity(_0xce5ada,null))[_0x47a5('0x32')](handleError(_0xce5ada,null));};exports['describe']=function(_0x3e7750,_0x548a06){return db['WhatsappInteraction']['describe']()[_0x47a5('0x26')](respondWithResult(_0x548a06,null))['catch'](handleError(_0x548a06,null));};exports[_0x47a5('0xaf')]=function(_0xf3edc8,_0x5a316e,_0x49f791){return db[_0x47a5('0xb0')][_0x47a5('0x5c')]({'where':{'id':_0xf3edc8[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x5a316e,null))[_0x47a5('0x26')](function(_0x581a87){if(_0x581a87){return _0x581a87[_0x47a5('0xaf')](_0xf3edc8[_0x47a5('0x6f')]['ids'],_[_0x47a5('0xb1')](_0xf3edc8[_0x47a5('0x6f')],[_0x47a5('0xb2'),'id'])||{});}})[_0x47a5('0x26')](respondWithResult(_0x5a316e,null))[_0x47a5('0x32')](handleError(_0x5a316e,null));};exports[_0x47a5('0xb3')]=function(_0x5112d7,_0x6a8174,_0x2e418d){var _0x50b236={'raw':![],'where':{}};var _0x263521={};var _0x9769b5={'count':0x0,'rows':[]};return db[_0x47a5('0xad')][_0x47a5('0xb4')]({'where':{'id':_0x5112d7['params']['id']}})['then'](handleEntityNotFound(_0x6a8174,null))['then'](function(_0x4eee99){if(_0x4eee99){_0x263521[_0x47a5('0x38')]=_[_0x47a5('0x3a')](db[_0x47a5('0xb0')][_0x47a5('0x34')]);_0x263521[_0x47a5('0x39')]=_[_0x47a5('0x3a')](_0x5112d7[_0x47a5('0x39')]);_0x263521[_0x47a5('0x44')]=_['intersection'](_0x263521[_0x47a5('0x38')],_0x263521[_0x47a5('0x39')]);_0x50b236[_0x47a5('0x3c')]=_[_0x47a5('0x3b')](_0x263521['model'],qs['fields'](_0x5112d7[_0x47a5('0x39')]['fields']));_0x50b236['attributes']=_0x50b236[_0x47a5('0x3c')][_0x47a5('0x3e')]?_0x50b236['attributes']:_0x263521[_0x47a5('0x38')];if(!_0x5112d7[_0x47a5('0x39')][_0x47a5('0x3f')]('nolimit')){_0x50b236[_0x47a5('0x1f')]=qs[_0x47a5('0x1f')](_0x5112d7['query'][_0x47a5('0x1f')]);_0x50b236[_0x47a5('0x1e')]=qs[_0x47a5('0x1e')](_0x5112d7[_0x47a5('0x39')][_0x47a5('0x1e')]);}_0x50b236[_0x47a5('0x40')]=qs['sort'](_0x5112d7[_0x47a5('0x39')]['sort']);_0x50b236[_0x47a5('0x42')]=qs[_0x47a5('0x44')](_[_0x47a5('0x43')](_0x5112d7[_0x47a5('0x39')],_0x263521['filters']));_0x50b236[_0x47a5('0x42')][_0x47a5('0xa7')]=_0x4eee99['id'];if(_0x5112d7[_0x47a5('0x39')][_0x47a5('0x7f')]){_0x50b236[_0x47a5('0x42')]=_[_0x47a5('0x96')](_0x50b236[_0x47a5('0x42')],{'$or':_[_0x47a5('0x2c')](_0x50b236[_0x47a5('0x3c')],function(_0xa2045c){var _0x109738={};_0x109738[_0xa2045c]={'$like':'%'+_0x5112d7[_0x47a5('0x39')]['filter']+'%'};return _0x109738;})});}if(_0x5112d7[_0x47a5('0x39')][_0x47a5('0x75')]){var _0x591bde=_0x5112d7[_0x47a5('0x39')][_0x47a5('0x75')][_0x47a5('0x30')](',');var _0x2ccf21={};_0x2ccf21[_0x591bde[0x0]]={'$gte':moment(_0x591bde[0x1])[_0x47a5('0xb5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x50b236[_0x47a5('0x42')]=_[_0x47a5('0x96')](_0x50b236[_0x47a5('0x42')],_0x2ccf21);}_0x50b236=_[_0x47a5('0x96')]({},_0x50b236,_0x5112d7[_0x47a5('0xb6')]);return db[_0x47a5('0xb0')][_0x47a5('0x1d')]({'where':_0x50b236['where']})['then'](function(_0xa3d578){_0x9769b5['count']=_0xa3d578;if(_0x5112d7[_0x47a5('0x39')]['includeAll']){_0x50b236[_0x47a5('0xac')]=[{'all':!![]}];}return db[_0x47a5('0xb0')][_0x47a5('0xb7')](_0x50b236);})[_0x47a5('0x26')](function(_0x49cb8c){_0x9769b5[_0x47a5('0xa8')]=_0x49cb8c;return _0x9769b5;});}})[_0x47a5('0x26')](respondWithFilteredResult(_0x6a8174,_0x50b236))[_0x47a5('0x32')](handleError(_0x6a8174,null));};exports['addTags']=function(_0x581759,_0x30375f,_0x29015a){return db[_0x47a5('0xad')][_0x47a5('0x5c')]({'where':{'id':_0x581759[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x30375f,null))[_0x47a5('0x26')](function(_0xe662d7){if(_0xe662d7){return _0xe662d7['setTags'](_0x581759[_0x47a5('0x6f')]['ids'],_[_0x47a5('0xb1')](_0x581759[_0x47a5('0x6f')],['ids','id'])||{})['spread'](function(){return db[_0x47a5('0x69')][_0x47a5('0xb7')]({'attributes':['id','name',_0x47a5('0x46')],'where':{'id':_0x581759[_0x47a5('0x6f')][_0x47a5('0xb2')]}});})[_0x47a5('0x26')](function(_0x5a7f32){socket[_0x47a5('0xb8')]('whatsappInteractionTags:save',{'id':Number(_0x581759['params']['id']),'tags':_0x5a7f32||[]});return{'id':Number(_0x581759['params']['id']),'tags':_0x5a7f32||[]};});}})[_0x47a5('0x26')](respondWithResult(_0x30375f,null))['catch'](handleError(_0x30375f,null));};exports[_0x47a5('0xb9')]=function(_0x156d51,_0x401139,_0x2005d5){return db[_0x47a5('0xad')][_0x47a5('0x5c')]({'where':{'id':_0x156d51[_0x47a5('0xaa')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x401139,null))[_0x47a5('0x26')](function(_0x2200f9){if(_0x2200f9){return _0x2200f9[_0x47a5('0xb9')](_0x156d51[_0x47a5('0x39')][_0x47a5('0xb2')]);}})[_0x47a5('0x26')](respondWithStatusCode(_0x401139,null))[_0x47a5('0x32')](handleError(_0x401139,null));};exports['download']=function(_0xdd95c8,_0x40aee5){var _0x322cee=moment()[_0x47a5('0xba')]()['toString']();var _0x367662=path['join'](config[_0x47a5('0xbb')],'server',_0x47a5('0xbc'),_0x47a5('0xbd'));var _0x3b894d=path['join'](config[_0x47a5('0xbb')],_0x47a5('0xbe'),_0x47a5('0xbc'),'attachments');var _0x52798d=path[_0x47a5('0xbf')](_0x367662,_0x322cee);var _0x1a5e07=util[_0x47a5('0xb5')](_0x47a5('0xc0'),_0xdd95c8[_0x47a5('0xaa')]['id'],_0x322cee);var _0x579e5c=path[_0x47a5('0xbf')](_0x367662,_0x1a5e07);var _0x4b3ae4=[];_0x4b3ae4[_0x47a5('0x31')]({'model':db[_0x47a5('0xc1')],'as':_0x47a5('0xc1'),'attributes':['id',_0x47a5('0x2d')],'raw':!![]});_0x4b3ae4['push']({'model':db['CmContact'],'as':_0x47a5('0x61'),'attributes':['id',_0x47a5('0xc2'),_0x47a5('0xc3')],'raw':!![]});if(_0xdd95c8[_0x47a5('0x39')][_0x47a5('0xc4')]){_0x4b3ae4[_0x47a5('0x31')]({'model':db[_0x47a5('0xc5')],'as':_0x47a5('0xc5'),'raw':!![]});}var _0x2c2245=[{'model':db['WhatsappMessage'],'as':'Messages','attributes':['id',_0x47a5('0x6f'),'createdAt',_0x47a5('0xc6'),_0x47a5('0xc7'),_0x47a5('0x7b')],'include':_0x4b3ae4}];_0x2c2245['push']({'model':db[_0x47a5('0xc8')],'as':_0x47a5('0xc9'),'attributes':['id','name']});_0x2c2245[_0x47a5('0x31')]({'model':db['User'],'as':_0x47a5('0xca'),'attributes':['id',_0x47a5('0x2d')]});return db[_0x47a5('0xad')]['find']({'where':{'id':_0xdd95c8['params']['id']},'include':_0x2c2245})['then'](handleEntityNotFound(_0x40aee5,null))['then'](function(_0x5075a6){if(_0x5075a6){var _0x1ba5b6=_0x5075a6['get']({'plain':!![]});fs[_0x47a5('0xcb')](_0x52798d);var _0x2287b0={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':'\x0a\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\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20'}},'footer':{'height':_0x47a5('0xcc'),'contents':{'default':util['format']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util['format'](_0x47a5('0xcd'),_0x47a5('0xce'),_0x1ba5b6['id']),moment()[_0x47a5('0xb5')](_0x47a5('0xcf'))['toString']())}}};var _0xdda046={'channel':'Whatsapp','account':_0x1ba5b6[_0x47a5('0xc9')]['name'],'agent':_0x1ba5b6[_0x47a5('0xca')]?_0x1ba5b6[_0x47a5('0xca')][_0x47a5('0x2d')]:'N.A.','createdAt':moment(_0x1ba5b6[_0x47a5('0x74')])[_0x47a5('0xb5')](_0x47a5('0xd0'))[_0x47a5('0x94')](),'closedAt':_0x1ba5b6['closed']?moment(_0x1ba5b6[_0x47a5('0xd1')])[_0x47a5('0xb5')](_0x47a5('0xd0'))[_0x47a5('0x94')]():'','disposition':_0x1ba5b6[_0x47a5('0xd2')],'messages':_(_0x1ba5b6[_0x47a5('0xd3')])['filter']({'secret':![]})[_0x47a5('0x2c')](function(_0xe245ca){if(_0xe245ca[_0x47a5('0xc5')]){var _0xac8d4f=path[_0x47a5('0xbf')](_0x3b894d,_0xe245ca[_0x47a5('0xc5')][_0x47a5('0xd4')]);if(fs[_0x47a5('0xd5')](_0xac8d4f)){fs[_0x47a5('0xd6')](_0xac8d4f)[_0x47a5('0xd7')](fs[_0x47a5('0xd8')](path[_0x47a5('0xbf')](_0x52798d,_0xe245ca[_0x47a5('0xc5')][_0x47a5('0xd4')])));}}return{'date':moment(_0xe245ca[_0x47a5('0x74')])[_0x47a5('0xb5')](_0x47a5('0xd0'))['toString'](),'sender':_0xe245ca[_0x47a5('0xc6')]==='out'?_0xe245ca['User']?_0xe245ca[_0x47a5('0xc1')][_0x47a5('0x2d')]:_0x47a5('0xd9'):_0xe245ca['Contact'][_0x47a5('0xc2')]+(_0xe245ca[_0x47a5('0x61')][_0x47a5('0xc3')]?'\x20'+_0xe245ca[_0x47a5('0x61')][_0x47a5('0xc3')]:''),'body':_0xe245ca[_0x47a5('0xc5')]?_0xe245ca[_0x47a5('0xc5')][_0x47a5('0xd4')]:_0xe245ca[_0x47a5('0x6f')],'direction':_0xe245ca[_0x47a5('0xc6')]===_0x47a5('0xda')?'A':'C','secret':_0xe245ca[_0x47a5('0xc7')],'read':_0xe245ca[_0x47a5('0x7b')],'attachment':_0xe245ca['Attachment']};})['value']()};return ejs[_0x47a5('0xdb')](path['join'](config[_0x47a5('0xbb')],_0x47a5('0xbe'),_0x47a5('0xdc'),_0x47a5('0xdd')),{'interaction':_0xdda046})[_0x47a5('0x26')](function(_0x3708ea){return new BPromise(function(_0x583b37,_0x2b4039){pdf[_0x47a5('0xae')](_0x3708ea,_0x2287b0)[_0x47a5('0xde')](path['join'](_0x52798d,_0x47a5('0xdf')+_0x1ba5b6['id']+'-'+_0x322cee+_0x47a5('0xe0')),function(_0x3ecc41,_0x3e4148){if(_0x3ecc41)return _0x2b4039(_0x3ecc41);_0x583b37(_0x3e4148);});});})[_0x47a5('0x26')](function(){return new BPromise(function(_0x23e649,_0x35e20f){zipdir(_0x52798d,{'saveTo':_0x579e5c},function(_0x46615a,_0xd6e255){if(_0x46615a)return _0x35e20f(_0x46615a);return _0x23e649(_0xd6e255);});})[_0x47a5('0x26')](function(){return new BPromise(function(_0x1b91ad,_0x40b7a5){rimraf(_0x52798d,function(_0x28e998){if(_0x28e998)_0x40b7a5(_0x28e998);return _0x1b91ad();});});})[_0x47a5('0x26')](function(){return _0x40aee5[_0x47a5('0xe1')](_0x579e5c,_0x1a5e07,function(_0x3f7fdc){if(_0x3f7fdc){console[_0x47a5('0xe2')](_0x47a5('0xe3'),_0x3f7fdc);}else{fs[_0x47a5('0xe4')](_0x579e5c);}});});});}else{return _0x40aee5[_0x47a5('0x1a')](0xc8);}})[_0x47a5('0x32')](handleError(_0x40aee5,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 415a6f9..8da23a3 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 _0xfca8=['setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','events','WhatsappInteraction','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','then'];(function(_0x473432,_0x11539b){var _0x1a485b=function(_0xee0ca0){while(--_0xee0ca0){_0x473432['push'](_0x473432['shift']());}};_0x1a485b(++_0x11539b);}(_0xfca8,0x14d));var _0x8fca=function(_0x58dc9d,_0x19d446){_0x58dc9d=_0x58dc9d-0x0;var _0x4d9385=_0xfca8[_0x58dc9d];return _0x4d9385;};'use strict';var EventEmitter=require(_0x8fca('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x8fca('0x1')];var WhatsappMessage=require(_0x8fca('0x2'))['db'][_0x8fca('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x8fca('0x4')](0x0);var events={'afterCreate':_0x8fca('0x5'),'afterUpdate':_0x8fca('0x6'),'afterDestroy':_0x8fca('0x7')};function emitEvent(_0x2f662e){return function(_0x43d457,_0x4069f2,_0x53de78){_0x43d457['getUsers']({'attributes':['id'],'raw':!![]})[_0x8fca('0x8')](function(_0x5852e0){_0x43d457[_0x8fca('0x9')](_0x8fca('0xa'),_0x5852e0[_0x8fca('0xb')](function(_0x2dff67){return{'id':_0x2dff67['id']};}));return WhatsappMessage[_0x8fca('0xc')]({'where':{'WhatsappInteractionId':_0x43d457['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8fca('0x8')](function(_0x114063){_0x43d457[_0x8fca('0x9')](_0x8fca('0xd'),_0x114063['length']);WhatsappInteractionEvents['emit'](_0x2f662e+':'+_0x43d457['id'],_0x43d457);WhatsappInteractionEvents[_0x8fca('0xe')](_0x2f662e,_0x43d457);_0x53de78(null);})[_0x8fca('0xf')](_0x53de78(null));};}for(var e in events){if(events[_0x8fca('0x10')](e)){var event=events[e];WhatsappInteraction[_0x8fca('0x11')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x5529=['catch','hook','events','WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit'];(function(_0x43e73e,_0x4b9c69){var _0x4449d2=function(_0x22a32a){while(--_0x22a32a){_0x43e73e['push'](_0x43e73e['shift']());}};_0x4449d2(++_0x4b9c69);}(_0x5529,0x145));var _0x9552=function(_0x199685,_0x28cf2c){_0x199685=_0x199685-0x0;var _0x5187af=_0x5529[_0x199685];return _0x5187af;};'use strict';var EventEmitter=require(_0x9552('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x9552('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x9552('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x9552('0x3')](0x0);var events={'afterCreate':_0x9552('0x4'),'afterUpdate':_0x9552('0x5'),'afterDestroy':_0x9552('0x6')};function emitEvent(_0x4a43c7){return function(_0x3a770c,_0x36f104,_0x357cec){_0x3a770c[_0x9552('0x7')]({'attributes':['id'],'raw':!![]})[_0x9552('0x8')](function(_0x429e3d){_0x3a770c[_0x9552('0x9')](_0x9552('0xa'),_0x429e3d[_0x9552('0xb')](function(_0x4598ac){return{'id':_0x4598ac['id']};}));return WhatsappMessage[_0x9552('0xc')]({'where':{'WhatsappInteractionId':_0x3a770c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9552('0x8')](function(_0x38b5e9){_0x3a770c['setDataValue'](_0x9552('0xd'),_0x38b5e9['length']);WhatsappInteractionEvents[_0x9552('0xe')](_0x4a43c7+':'+_0x3a770c['id'],_0x3a770c);WhatsappInteractionEvents[_0x9552('0xe')](_0x4a43c7,_0x3a770c);_0x357cec(null);})[_0x9552('0xf')](_0x357cec(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0x9552('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index e23b460..59b660b 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 _0xa9e0=['define','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x50da5d,_0x52e432){var _0x5096a2=function(_0x10cb89){while(--_0x10cb89){_0x50da5d['push'](_0x50da5d['shift']());}};_0x5096a2(++_0x52e432);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x503809,_0xe42b77,_0x56465b){if(_0x503809['changed'](_0x0a9e('0xb'))){_0x503809[_0x0a9e('0xc')]=moment()[_0x0a9e('0xd')](_0x0a9e('0xe'));}_0x56465b(null,_0x503809);}}});}; \ No newline at end of file +var _0xa9e0=['define','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports'];(function(_0x543775,_0x161484){var _0x2e3e00=function(_0x2f864d){while(--_0x2f864d){_0x543775['push'](_0x543775['shift']());}};_0x2e3e00(++_0x161484);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'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':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x503809,_0xe42b77,_0x56465b){if(_0x503809['changed'](_0x0a9e('0xb'))){_0x503809[_0x0a9e('0xc')]=moment()[_0x0a9e('0xd')](_0x0a9e('0xe'));}_0x56465b(null,_0x503809);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index d9b0b45..c9a54bc 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 _0x2757=['UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','where','limit','catch','find','addTags','ids','omit','body','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','register','then','info','request\x20sent','debug','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result'];(function(_0x314123,_0x3384dc){var _0x14e309=function(_0x4f9b55){while(--_0x4f9b55){_0x314123['push'](_0x314123['shift']());}};_0x14e309(++_0x3384dc);}(_0x2757,0x167));var _0x7275=function(_0x589f05,_0x1c5a16){_0x589f05=_0x589f05-0x0;var _0x3a11b4=_0x2757[_0x589f05];return _0x3a11b4;};'use strict';var _=require(_0x7275('0x0'));var util=require('util');var moment=require(_0x7275('0x1'));var BPromise=require(_0x7275('0x2'));var rs=require(_0x7275('0x3'));var fs=require('fs');var Redis=require(_0x7275('0x4'));var db=require(_0x7275('0x5'))['db'];var utils=require(_0x7275('0x6'));var logger=require(_0x7275('0x7'))(_0x7275('0x8'));var config=require(_0x7275('0x9'));var jayson=require(_0x7275('0xa'));var client=jayson[_0x7275('0xb')][_0x7275('0xc')]({'port':0x232a});config[_0x7275('0xd')]=_[_0x7275('0xe')](config[_0x7275('0xd')],{'host':_0x7275('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7275('0xd')]));require(_0x7275('0x10'))[_0x7275('0x11')](socket);function respondWithRpcPromise(_0x2cc964,_0x397b8e,_0x2cf216){return new BPromise(function(_0x4edcb0,_0x4b1718){return client['request'](_0x2cc964,_0x2cf216)[_0x7275('0x12')](function(_0x1b373f){logger[_0x7275('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x397b8e,_0x7275('0x14'));logger[_0x7275('0x15')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x397b8e,'request\x20sent',JSON[_0x7275('0x16')](_0x1b373f));if(_0x1b373f[_0x7275('0x17')]){if(_0x1b373f['error'][_0x7275('0x18')]===0x1f4){logger[_0x7275('0x17')](_0x7275('0x19'),_0x397b8e,_0x1b373f['error']['message']);return _0x4b1718(_0x1b373f[_0x7275('0x17')][_0x7275('0x1a')]);}logger[_0x7275('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x397b8e,_0x1b373f[_0x7275('0x17')][_0x7275('0x1a')]);return _0x4edcb0(_0x1b373f[_0x7275('0x17')]['message']);}else{logger[_0x7275('0x13')](_0x7275('0x19'),_0x397b8e,_0x7275('0x14'));_0x4edcb0(_0x1b373f[_0x7275('0x1b')][_0x7275('0x1a')]);}})['catch'](function(_0x31e257){logger[_0x7275('0x17')](_0x7275('0x19'),_0x397b8e,_0x31e257);_0x4b1718(_0x31e257);});});}exports[_0x7275('0x1c')]=function(_0x27ecde){var _0x7dae8a=this;return new Promise(function(_0x4cd8d2,_0x22aac7){return db[_0x7275('0x1d')][_0x7275('0x1e')](_0x27ecde['body'],{'raw':_0x27ecde[_0x7275('0x1f')]?_0x27ecde[_0x7275('0x1f')][_0x7275('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27ecde[_0x7275('0x1f')]?_0x27ecde[_0x7275('0x1f')][_0x7275('0x21')]||null:null,'attributes':_0x27ecde[_0x7275('0x1f')]?_0x27ecde[_0x7275('0x1f')]['attributes']||null:null,'limit':_0x27ecde[_0x7275('0x1f')]?_0x27ecde[_0x7275('0x1f')][_0x7275('0x22')]||null:null})['then'](function(_0xa0ef82){logger['info']('UpdateWhatsappInteraction',_0x27ecde);logger[_0x7275('0x15')](_0x7275('0x1c'),_0x27ecde,JSON[_0x7275('0x16')](_0xa0ef82));_0x4cd8d2(_0xa0ef82);})[_0x7275('0x23')](function(_0x34fd9b){logger['error'](_0x7275('0x1c'),_0x34fd9b[_0x7275('0x1a')],_0x27ecde);_0x22aac7(_0x7dae8a[_0x7275('0x17')](0x1f4,_0x34fd9b[_0x7275('0x1a')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x45cc30){return new Promise(function(_0x408c11,_0x2f1022){return db['WhatsappInteraction'][_0x7275('0x24')]({'where':_0x45cc30['options']?_0x45cc30[_0x7275('0x1f')][_0x7275('0x21')]||null:null})[_0x7275('0x12')](function(_0x14f492){if(_0x14f492){return _0x14f492[_0x7275('0x25')](_0x45cc30['body'][_0x7275('0x26')],_[_0x7275('0x27')](_0x45cc30[_0x7275('0x28')],[_0x7275('0x26'),'id'])||{});}})[_0x7275('0x29')](function(_0x14f817){logger['info'](_0x7275('0x2a'),_0x45cc30);logger[_0x7275('0x15')]('AddTags',_0x45cc30,JSON['stringify'](_0x14f817));_0x408c11(_0x14f817);})[_0x7275('0x23')](function(_0x38c84c){logger[_0x7275('0x17')]('AddTags',_0x38c84c['message'],_0x45cc30);_0x2f1022(_this[_0x7275('0x17')](0x1f4,_0x38c84c[_0x7275('0x1a')]));});});}; \ No newline at end of file +var _0xd6b1=['jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','attributes','then','catch','AddTagsToWhatsappInteraction','find','where','addTags','ids','omit','AddTags','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x2ea98c,_0x677a70){var _0x57d931=function(_0x3d903e){while(--_0x3d903e){_0x2ea98c['push'](_0x2ea98c['shift']());}};_0x57d931(++_0x677a70);}(_0xd6b1,0xb7));var _0x1d6b=function(_0x215125,_0x18cf56){_0x215125=_0x215125-0x0;var _0x16065c=_0xd6b1[_0x215125];return _0x16065c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1d6b('0x0'));var BPromise=require(_0x1d6b('0x1'));var rs=require(_0x1d6b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d6b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d6b('0x4'))(_0x1d6b('0x5'));var config=require(_0x1d6b('0x6'));var jayson=require(_0x1d6b('0x7'));var client=jayson[_0x1d6b('0x8')]['http']({'port':0x232a});config[_0x1d6b('0x9')]=_[_0x1d6b('0xa')](config[_0x1d6b('0x9')],{'host':_0x1d6b('0xb'),'port':0x18eb});var socket=require(_0x1d6b('0xc'))(new Redis(config[_0x1d6b('0x9')]));require('./whatsappInteraction.socket')[_0x1d6b('0xd')](socket);function respondWithRpcPromise(_0x120bc5,_0x4c976a,_0x7c0d3d){return new BPromise(function(_0x31077f,_0x175161){return client[_0x1d6b('0xe')](_0x120bc5,_0x7c0d3d)['then'](function(_0x4daafe){logger[_0x1d6b('0xf')](_0x1d6b('0x10'),_0x4c976a,_0x1d6b('0x11'));logger[_0x1d6b('0x12')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x4c976a,_0x1d6b('0x11'),JSON[_0x1d6b('0x13')](_0x4daafe));if(_0x4daafe[_0x1d6b('0x14')]){if(_0x4daafe[_0x1d6b('0x14')][_0x1d6b('0x15')]===0x1f4){logger[_0x1d6b('0x14')](_0x1d6b('0x10'),_0x4c976a,_0x4daafe['error'][_0x1d6b('0x16')]);return _0x175161(_0x4daafe['error'][_0x1d6b('0x16')]);}logger['error'](_0x1d6b('0x10'),_0x4c976a,_0x4daafe[_0x1d6b('0x14')][_0x1d6b('0x16')]);return _0x31077f(_0x4daafe[_0x1d6b('0x14')][_0x1d6b('0x16')]);}else{logger['info'](_0x1d6b('0x10'),_0x4c976a,_0x1d6b('0x11'));_0x31077f(_0x4daafe['result'][_0x1d6b('0x16')]);}})['catch'](function(_0x19c443){logger[_0x1d6b('0x14')](_0x1d6b('0x10'),_0x4c976a,_0x19c443);_0x175161(_0x19c443);});});}exports[_0x1d6b('0x17')]=function(_0x2b9144){var _0x27e552=this;return new Promise(function(_0x1a26e9,_0x2bd5b0){return db[_0x1d6b('0x18')]['update'](_0x2b9144[_0x1d6b('0x19')],{'raw':_0x2b9144[_0x1d6b('0x1a')]?_0x2b9144[_0x1d6b('0x1a')][_0x1d6b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b9144[_0x1d6b('0x1a')]?_0x2b9144[_0x1d6b('0x1a')]['where']||null:null,'attributes':_0x2b9144[_0x1d6b('0x1a')]?_0x2b9144['options'][_0x1d6b('0x1c')]||null:null,'limit':_0x2b9144[_0x1d6b('0x1a')]?_0x2b9144[_0x1d6b('0x1a')]['limit']||null:null})[_0x1d6b('0x1d')](function(_0x206421){logger[_0x1d6b('0xf')](_0x1d6b('0x17'),_0x2b9144);logger[_0x1d6b('0x12')](_0x1d6b('0x17'),_0x2b9144,JSON[_0x1d6b('0x13')](_0x206421));_0x1a26e9(_0x206421);})[_0x1d6b('0x1e')](function(_0x2f7242){logger[_0x1d6b('0x14')](_0x1d6b('0x17'),_0x2f7242['message'],_0x2b9144);_0x2bd5b0(_0x27e552[_0x1d6b('0x14')](0x1f4,_0x2f7242[_0x1d6b('0x16')]));});});};exports[_0x1d6b('0x1f')]=function(_0x50e7b9){return new Promise(function(_0x1ee514,_0x380a43){return db['WhatsappInteraction'][_0x1d6b('0x20')]({'where':_0x50e7b9['options']?_0x50e7b9[_0x1d6b('0x1a')][_0x1d6b('0x21')]||null:null})[_0x1d6b('0x1d')](function(_0x18274d){if(_0x18274d){return _0x18274d[_0x1d6b('0x22')](_0x50e7b9['body'][_0x1d6b('0x23')],_[_0x1d6b('0x24')](_0x50e7b9[_0x1d6b('0x19')],[_0x1d6b('0x23'),'id'])||{});}})['spread'](function(_0x34830d){logger[_0x1d6b('0xf')](_0x1d6b('0x25'),_0x50e7b9);logger[_0x1d6b('0x12')]('AddTags',_0x50e7b9,JSON[_0x1d6b('0x13')](_0x34830d));_0x1ee514(_0x34830d);})[_0x1d6b('0x1e')](function(_0x5ead8e){logger[_0x1d6b('0x14')](_0x1d6b('0x25'),_0x5ead8e[_0x1d6b('0x16')],_0x50e7b9);_0x380a43(_this[_0x1d6b('0x14')](0x1f4,_0x5ead8e['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 799ee55..5cd7315 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 _0x144a=['remove','update','emit','removeListener','register','length','save'];(function(_0x292daa,_0x4fc92a){var _0x4c96e7=function(_0x1758e5){while(--_0x1758e5){_0x292daa['push'](_0x292daa['shift']());}};_0x4c96e7(++_0x4fc92a);}(_0x144a,0x76));var _0xa144=function(_0x455c85,_0x2bda1e){_0x455c85=_0x455c85-0x0;var _0xf74db3=_0x144a[_0x455c85];return _0xf74db3;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xa144('0x0'),_0xa144('0x1'),_0xa144('0x2')];function createListener(_0x3dc0a6,_0x1b181d){return function(_0x4780a2){_0x1b181d[_0xa144('0x3')](_0x3dc0a6,_0x4780a2);};}function removeListener(_0x50dbb4,_0x14a8fd){return function(){WhatsappInteractionEvents[_0xa144('0x4')](_0x50dbb4,_0x14a8fd);};}exports[_0xa144('0x5')]=function(_0x44145a){for(var _0x20ab17=0x0,_0x291774=events[_0xa144('0x6')];_0x20ab17<_0x291774;_0x20ab17++){var _0x29584b=events[_0x20ab17];var _0x51929c=createListener('whatsappInteraction:'+_0x29584b,_0x44145a);WhatsappInteractionEvents['on'](_0x29584b,_0x51929c);}}; \ No newline at end of file +var _0xeec3=['update','emit','removeListener','length','whatsappInteraction:','./whatsappInteraction.events','save'];(function(_0x44dc4c,_0x357e6a){var _0x4e644e=function(_0x2f033e){while(--_0x2f033e){_0x44dc4c['push'](_0x44dc4c['shift']());}};_0x4e644e(++_0x357e6a);}(_0xeec3,0x1c5));var _0x3eec=function(_0x3dde9c,_0x229211){_0x3dde9c=_0x3dde9c-0x0;var _0x3cf1fe=_0xeec3[_0x3dde9c];return _0x3cf1fe;};'use strict';var WhatsappInteractionEvents=require(_0x3eec('0x0'));var events=[_0x3eec('0x1'),'remove',_0x3eec('0x2')];function createListener(_0x49e4d7,_0x4ffda4){return function(_0x5c32b5){_0x4ffda4[_0x3eec('0x3')](_0x49e4d7,_0x5c32b5);};}function removeListener(_0x54fad3,_0x1573c4){return function(){WhatsappInteractionEvents[_0x3eec('0x4')](_0x54fad3,_0x1573c4);};}exports['register']=function(_0xb448c6){for(var _0x51a3ea=0x0,_0x2654a1=events[_0x3eec('0x5')];_0x51a3ea<_0x2654a1;_0x51a3ea++){var _0x5444a8=events[_0x51a3ea];var _0x33bb8e=createListener(_0x3eec('0x6')+_0x5444a8,_0xb448c6);WhatsappInteractionEvents['on'](_0x5444a8,_0x33bb8e);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 603b8be..73a427d 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 _0x63e4=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','put','update','/:id/accept','accept','/:id/reject'];(function(_0xb7381b,_0x389201){var _0x20d917=function(_0x308f05){while(--_0x308f05){_0xb7381b['push'](_0xb7381b['shift']());}};_0x20d917(++_0x389201);}(_0x63e4,0x77));var _0x463e=function(_0x3fe4ed,_0x307a99){_0x3fe4ed=_0x3fe4ed-0x0;var _0x345075=_0x63e4[_0x3fe4ed];return _0x345075;};'use strict';var multer=require(_0x463e('0x0'));var util=require(_0x463e('0x1'));var path=require(_0x463e('0x2'));var timeout=require(_0x463e('0x3'));var express=require('express');var router=express[_0x463e('0x4')]();var auth=require(_0x463e('0x5'));var interaction=require(_0x463e('0x6'));var config=require(_0x463e('0x7'));var controller=require(_0x463e('0x8'));router['get']('/',auth[_0x463e('0x9')](),controller[_0x463e('0xa')]);router[_0x463e('0xb')](_0x463e('0xc'),auth[_0x463e('0x9')](),controller[_0x463e('0xd')]);router['get'](_0x463e('0xe'),auth[_0x463e('0x9')](),controller[_0x463e('0xf')]);router[_0x463e('0x10')]('/',auth[_0x463e('0x9')](),interaction[_0x463e('0x11')](_0x463e('0x12'),_0x463e('0x13')),controller['create']);router[_0x463e('0x10')](_0x463e('0x14'),controller['status']);router[_0x463e('0x15')](_0x463e('0xe'),auth[_0x463e('0x9')](),controller[_0x463e('0x16')]);router['put'](_0x463e('0x17'),auth[_0x463e('0x9')](),controller[_0x463e('0x18')]);router[_0x463e('0x15')](_0x463e('0x19'),auth[_0x463e('0x9')](),controller['reject']);router[_0x463e('0x1a')](_0x463e('0xe'),auth[_0x463e('0x9')](),controller[_0x463e('0x1b')]);module[_0x463e('0x1c')]=router; \ No newline at end of file +var _0xb8f2=['status','put','/:id','update','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','get','index','isAuthenticated','describe','show','tracked','whatsapp','whatsappmessage:create','create','post','/:id/status'];(function(_0xce456e,_0x3fabcf){var _0x20bf27=function(_0x59ad31){while(--_0x59ad31){_0xce456e['push'](_0xce456e['shift']());}};_0x20bf27(++_0x3fabcf);}(_0xb8f2,0x149));var _0x2b8f=function(_0x20d6b8,_0xf4c277){_0x20d6b8=_0x20d6b8-0x0;var _0x8f4d1e=_0xb8f2[_0x20d6b8];return _0x8f4d1e;};'use strict';var multer=require('multer');var util=require(_0x2b8f('0x0'));var path=require(_0x2b8f('0x1'));var timeout=require(_0x2b8f('0x2'));var express=require(_0x2b8f('0x3'));var router=express[_0x2b8f('0x4')]();var auth=require(_0x2b8f('0x5'));var interaction=require(_0x2b8f('0x6'));var config=require('../../config/environment');var controller=require(_0x2b8f('0x7'));router[_0x2b8f('0x8')]('/',auth['isAuthenticated'](),controller[_0x2b8f('0x9')]);router[_0x2b8f('0x8')]('/describe',auth[_0x2b8f('0xa')](),controller[_0x2b8f('0xb')]);router[_0x2b8f('0x8')]('/:id',auth[_0x2b8f('0xa')](),controller[_0x2b8f('0xc')]);router['post']('/',auth[_0x2b8f('0xa')](),interaction[_0x2b8f('0xd')](_0x2b8f('0xe'),_0x2b8f('0xf')),controller[_0x2b8f('0x10')]);router[_0x2b8f('0x11')](_0x2b8f('0x12'),controller[_0x2b8f('0x13')]);router[_0x2b8f('0x14')](_0x2b8f('0x15'),auth[_0x2b8f('0xa')](),controller[_0x2b8f('0x16')]);router[_0x2b8f('0x14')]('/:id/accept',auth[_0x2b8f('0xa')](),controller[_0x2b8f('0x17')]);router[_0x2b8f('0x14')](_0x2b8f('0x18'),auth[_0x2b8f('0xa')](),controller[_0x2b8f('0x19')]);router[_0x2b8f('0x1a')](_0x2b8f('0x15'),auth[_0x2b8f('0xa')](),controller[_0x2b8f('0x1b')]);module[_0x2b8f('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index e9d1f2a..6ec2092 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 _0xbfec=['medium','BOOLEAN','out','DATE','exports','TEXT'];(function(_0x104c7b,_0x789096){var _0x937283=function(_0x54e392){while(--_0x54e392){_0x104c7b['push'](_0x104c7b['shift']());}};_0x937283(++_0x789096);}(_0xbfec,0x1b4));var _0xcbfe=function(_0x30ceb8,_0x38c556){_0x30ceb8=_0x30ceb8-0x0;var _0xc96097=_0xbfec[_0x30ceb8];return _0xc96097;};'use strict';var Sequelize=require('sequelize');module[_0xcbfe('0x0')]={'body':{'type':Sequelize[_0xcbfe('0x1')](_0xcbfe('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xcbfe('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xcbfe('0x4')),'defaultValue':_0xcbfe('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xcbfe('0x5')]},'secret':{'type':Sequelize[_0xcbfe('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x1392=['medium','BOOLEAN','out','DATE','exports','TEXT'];(function(_0x37f175,_0x489a33){var _0x554365=function(_0x12e418){while(--_0x12e418){_0x37f175['push'](_0x37f175['shift']());}};_0x554365(++_0x489a33);}(_0x1392,0xe8));var _0x2139=function(_0x1e17eb,_0x2e15c5){_0x1e17eb=_0x1e17eb-0x0;var _0x4de4c7=_0x1392[_0x1e17eb];return _0x4de4c7;};'use strict';var Sequelize=require('sequelize');module[_0x2139('0x0')]={'body':{'type':Sequelize[_0x2139('0x1')](_0x2139('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2139('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2139('0x4')),'defaultValue':_0x2139('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x2139('0x5')]},'secret':{'type':Sequelize[_0x2139('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 83b875f..a19b782 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 _0xaa02=['status','end','count','offset','limit','set','Content-Range','apply','save','update','stack','name','send','map','WhatsappMessage','rawAttributes','fieldName','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','get','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','reject','agent','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','WhatsappAccount','received\x20delivery\x20report\x20from','inspect','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus'];(function(_0x383158,_0x415e43){var _0x507985=function(_0x1e498e){while(--_0x1e498e){_0x383158['push'](_0x383158['shift']());}};_0x507985(++_0x415e43);}(_0xaa02,0xe0));var _0x2aa0=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xaa02[_0x53ccf2];return _0x5a2964;};'use strict';var pdf=require(_0x2aa0('0x0'));var emlformat=require(_0x2aa0('0x1'));var rimraf=require(_0x2aa0('0x2'));var zipdir=require(_0x2aa0('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2aa0('0x4'));var BPromise=require(_0x2aa0('0x5'));var Mustache=require(_0x2aa0('0x6'));var util=require(_0x2aa0('0x7'));var path=require('path');var sox=require(_0x2aa0('0x8'));var csv=require(_0x2aa0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2aa0('0xa'));var squel=require(_0x2aa0('0xb'));var crypto=require(_0x2aa0('0xc'));var jsforce=require(_0x2aa0('0xd'));var deskjs=require(_0x2aa0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2aa0('0xf'));var Redis=require(_0x2aa0('0x10'));var authService=require(_0x2aa0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2aa0('0x12'));var hardwareService=require(_0x2aa0('0x13'));var logger=require(_0x2aa0('0x14'))(_0x2aa0('0x15'));var utils=require(_0x2aa0('0x16'));var config=require('../../config/environment');var db=require(_0x2aa0('0x17'))['db'];config[_0x2aa0('0x18')]=_[_0x2aa0('0x19')](config['redis'],{'host':_0x2aa0('0x1a'),'port':0x18eb});var socket=require(_0x2aa0('0x1b'))(new Redis(config[_0x2aa0('0x18')]));require(_0x2aa0('0x1c'))[_0x2aa0('0x1d')](socket);var jayson=require(_0x2aa0('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x2aa0('0x1f')][_0x2aa0('0x20')]({'port':0x232a});function checkPasswordPattern(_0x26ca72,_0x44a372,_0x597f4d){if(_0x597f4d){var _0x216a93=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x216a93[_0x2aa0('0x21')](_0x44a372)){return _0x26ca72;}else{throw new db[(_0x2aa0('0x22'))][(_0x2aa0('0x23'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x26ca72;}}function respondWithRpcPromise(_0x4e0d61,_0x8025f2,_0x3125a7,_0x5dc386){return new BPromise(function(_0x287f0e,_0x27121d){var _0x47d89e=_0x5dc386||client;return _0x47d89e[_0x2aa0('0x24')](_0x4e0d61,_0x3125a7)[_0x2aa0('0x25')](function(_0x1c93a5){logger['info'](_0x2aa0('0x26'),_0x8025f2,'request\x20sent');logger[_0x2aa0('0x27')](_0x2aa0('0x28'),_0x8025f2,_0x2aa0('0x29'),JSON[_0x2aa0('0x2a')](_0x1c93a5));if(_0x1c93a5['error']){if(_0x1c93a5[_0x2aa0('0x2b')][_0x2aa0('0x2c')]===0x1f4){logger['error'](_0x2aa0('0x26'),_0x8025f2,_0x1c93a5[_0x2aa0('0x2b')]['message']);return _0x27121d(_0x1c93a5['error'][_0x2aa0('0x2d')]);}logger['error'](_0x2aa0('0x26'),_0x8025f2,_0x1c93a5[_0x2aa0('0x2b')][_0x2aa0('0x2d')]);return _0x287f0e(_0x1c93a5[_0x2aa0('0x2b')][_0x2aa0('0x2d')]);}else{logger['info'](_0x2aa0('0x26'),_0x8025f2,_0x2aa0('0x29'));_0x287f0e(_0x1c93a5[_0x2aa0('0x2e')][_0x2aa0('0x2d')]);}})['catch'](function(_0x92c9e4){logger['error'](_0x2aa0('0x26'),_0x8025f2,_0x92c9e4);_0x27121d(_0x92c9e4);});});}function respondWithStatusCode(_0xcbe60e,_0x476989){_0x476989=_0x476989||0xcc;return function(_0x216453){if(_0x216453){return _0xcbe60e[_0x2aa0('0x2f')](_0x476989);}return _0xcbe60e[_0x2aa0('0x30')](_0x476989)[_0x2aa0('0x31')]();};}function respondWithResult(_0x465f6e,_0x503edc){_0x503edc=_0x503edc||0xc8;return function(_0x21b1f9){if(_0x21b1f9){return _0x465f6e[_0x2aa0('0x30')](_0x503edc)['json'](_0x21b1f9);}};}function respondWithFilteredResult(_0x1b3c14,_0x518b17){return function(_0x325e3a){if(_0x325e3a){var _0x194b54=_0x325e3a[_0x2aa0('0x32')],_0x89dd42=_0x518b17[_0x2aa0('0x33')],_0x1365b1=_0x518b17['offset']+_0x518b17[_0x2aa0('0x34')],_0xe35885;if(_0x1365b1>=_0x194b54){_0x1365b1=_0x194b54;_0xe35885=0xc8;}else{_0xe35885=0xce;}_0x1b3c14[_0x2aa0('0x30')](_0xe35885);return _0x1b3c14[_0x2aa0('0x35')](_0x2aa0('0x36'),_0x89dd42+'-'+_0x1365b1+'/'+_0x194b54)['json'](_0x325e3a);}return null;};}function patchUpdates(_0x4b410f){return function(_0x537deb){try{jsonpatch[_0x2aa0('0x37')](_0x537deb,_0x4b410f,!![]);}catch(_0x4865b3){return BPromise['reject'](_0x4865b3);}return _0x537deb[_0x2aa0('0x38')]();};}function saveUpdates(_0x339f33,_0xda6e38){return function(_0x27baf3){if(_0x27baf3){return _0x27baf3[_0x2aa0('0x39')](_0x339f33)[_0x2aa0('0x25')](function(_0x434bd3){return _0x434bd3;});}return null;};}function removeEntity(_0x4fdf4c,_0xb06238){return function(_0x4675d1){if(_0x4675d1){return _0x4675d1['destroy']()['then'](function(){_0x4fdf4c[_0x2aa0('0x30')](0xcc)[_0x2aa0('0x31')]();});}};}function handleEntityNotFound(_0x4eaf7c,_0x972827){return function(_0x4af895){if(!_0x4af895){_0x4eaf7c[_0x2aa0('0x2f')](0x194);}return _0x4af895;};}function handleError(_0x561941,_0x6c172f){_0x6c172f=_0x6c172f||0x1f4;return function(_0x22da56){logger['error'](_0x22da56[_0x2aa0('0x3a')]);if(_0x22da56[_0x2aa0('0x3b')]){delete _0x22da56[_0x2aa0('0x3b')];}_0x561941[_0x2aa0('0x30')](_0x6c172f)[_0x2aa0('0x3c')](_0x22da56);};}exports['index']=function(_0x364ba7,_0x47c5b6){var _0x3c3d0f={},_0x298edd={},_0x142208={'count':0x0,'rows':[]};var _0x559020=_[_0x2aa0('0x3d')](db[_0x2aa0('0x3e')][_0x2aa0('0x3f')],function(_0x10571a){return{'name':_0x10571a[_0x2aa0('0x40')],'type':_0x10571a[_0x2aa0('0x41')]['key']};});_0x298edd['model']=_['map'](_0x559020,'name');_0x298edd['query']=_[_0x2aa0('0x42')](_0x364ba7[_0x2aa0('0x43')]);_0x298edd[_0x2aa0('0x44')]=_[_0x2aa0('0x45')](_0x298edd['model'],_0x298edd[_0x2aa0('0x43')]);_0x3c3d0f['attributes']=_[_0x2aa0('0x45')](_0x298edd[_0x2aa0('0x46')],qs[_0x2aa0('0x47')](_0x364ba7[_0x2aa0('0x43')][_0x2aa0('0x47')]));_0x3c3d0f['attributes']=_0x3c3d0f[_0x2aa0('0x48')][_0x2aa0('0x49')]?_0x3c3d0f[_0x2aa0('0x48')]:_0x298edd[_0x2aa0('0x46')];if(!_0x364ba7[_0x2aa0('0x43')][_0x2aa0('0x4a')](_0x2aa0('0x4b'))){_0x3c3d0f[_0x2aa0('0x34')]=qs[_0x2aa0('0x34')](_0x364ba7[_0x2aa0('0x43')][_0x2aa0('0x34')]);_0x3c3d0f[_0x2aa0('0x33')]=qs[_0x2aa0('0x33')](_0x364ba7['query']['offset']);}_0x3c3d0f[_0x2aa0('0x4c')]=qs[_0x2aa0('0x4d')](_0x364ba7[_0x2aa0('0x43')][_0x2aa0('0x4d')]);_0x3c3d0f[_0x2aa0('0x4e')]=qs[_0x2aa0('0x44')](_[_0x2aa0('0x4f')](_0x364ba7['query'],_0x298edd[_0x2aa0('0x44')]),_0x559020);if(_0x364ba7[_0x2aa0('0x43')][_0x2aa0('0x50')]){_0x3c3d0f[_0x2aa0('0x4e')]=_[_0x2aa0('0x51')](_0x3c3d0f[_0x2aa0('0x4e')],{'$or':_[_0x2aa0('0x3d')](_0x559020,function(_0x4ed3f6){if(_0x4ed3f6[_0x2aa0('0x41')]!==_0x2aa0('0x52')){var _0x348720={};_0x348720[_0x4ed3f6[_0x2aa0('0x3b')]]={'$like':'%'+_0x364ba7[_0x2aa0('0x43')]['filter']+'%'};return _0x348720;}})});}_0x3c3d0f=_[_0x2aa0('0x51')]({},_0x3c3d0f,_0x364ba7[_0x2aa0('0x53')]);var _0x43a419={'where':_0x3c3d0f[_0x2aa0('0x4e')]};return db[_0x2aa0('0x3e')][_0x2aa0('0x32')](_0x43a419)[_0x2aa0('0x25')](function(_0x41d37a){_0x142208[_0x2aa0('0x32')]=_0x41d37a;if(_0x364ba7[_0x2aa0('0x43')][_0x2aa0('0x54')]){_0x3c3d0f['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0x2aa0('0x55')](_0x3c3d0f);})['then'](function(_0x37b5a7){_0x142208[_0x2aa0('0x56')]=_0x37b5a7;return _0x142208;})[_0x2aa0('0x25')](respondWithFilteredResult(_0x47c5b6,_0x3c3d0f))[_0x2aa0('0x57')](handleError(_0x47c5b6,null));};exports[_0x2aa0('0x58')]=function(_0x305e14,_0xaaf48c){var _0x461578={'raw':!![],'where':{'id':_0x305e14[_0x2aa0('0x59')]['id']}},_0x3cd8c9={};_0x3cd8c9[_0x2aa0('0x46')]=_[_0x2aa0('0x42')](db[_0x2aa0('0x3e')]['rawAttributes']);_0x3cd8c9[_0x2aa0('0x43')]=_[_0x2aa0('0x42')](_0x305e14['query']);_0x3cd8c9[_0x2aa0('0x44')]=_[_0x2aa0('0x45')](_0x3cd8c9['model'],_0x3cd8c9['query']);_0x461578[_0x2aa0('0x48')]=_['intersection'](_0x3cd8c9[_0x2aa0('0x46')],qs[_0x2aa0('0x47')](_0x305e14[_0x2aa0('0x43')][_0x2aa0('0x47')]));_0x461578[_0x2aa0('0x48')]=_0x461578[_0x2aa0('0x48')][_0x2aa0('0x49')]?_0x461578[_0x2aa0('0x48')]:_0x3cd8c9[_0x2aa0('0x46')];if(_0x305e14['query'][_0x2aa0('0x54')]){_0x461578[_0x2aa0('0x5a')]=[{'all':!![]}];}_0x461578=_['merge']({},_0x461578,_0x305e14['options']);return db[_0x2aa0('0x3e')][_0x2aa0('0x5b')](_0x461578)[_0x2aa0('0x25')](handleEntityNotFound(_0xaaf48c,null))[_0x2aa0('0x25')](respondWithResult(_0xaaf48c,null))[_0x2aa0('0x57')](handleError(_0xaaf48c,null));};exports['create']=function(_0x603ebf,_0x38e3b7){return db[_0x2aa0('0x3e')][_0x2aa0('0x5c')](_0x603ebf['body'],{})[_0x2aa0('0x25')](respondWithResult(_0x38e3b7,0xc9))[_0x2aa0('0x57')](handleError(_0x38e3b7,null));};exports['update']=function(_0x5b939b,_0x1511ae){if(_0x5b939b['body']['id']){delete _0x5b939b[_0x2aa0('0x5d')]['id'];}return db[_0x2aa0('0x3e')][_0x2aa0('0x5b')]({'where':{'id':_0x5b939b[_0x2aa0('0x59')]['id']}})[_0x2aa0('0x25')](handleEntityNotFound(_0x1511ae,null))[_0x2aa0('0x25')](saveUpdates(_0x5b939b[_0x2aa0('0x5d')],null))[_0x2aa0('0x25')](respondWithResult(_0x1511ae,null))['catch'](handleError(_0x1511ae,null));};exports[_0x2aa0('0x5e')]=function(_0x5150fd,_0x362c1a){return db['WhatsappMessage']['find']({'where':{'id':_0x5150fd['params']['id']}})[_0x2aa0('0x25')](handleEntityNotFound(_0x362c1a,null))[_0x2aa0('0x25')](removeEntity(_0x362c1a,null))[_0x2aa0('0x57')](handleError(_0x362c1a,null));};exports[_0x2aa0('0x5f')]=function(_0x596c4a,_0x1d67d5){return db[_0x2aa0('0x3e')][_0x2aa0('0x5f')]()[_0x2aa0('0x25')](respondWithResult(_0x1d67d5,null))[_0x2aa0('0x57')](handleError(_0x1d67d5,null));};var interaction_log=require('../../config/logger')(_0x2aa0('0x60'));exports[_0x2aa0('0x61')]=function(_0x49017a,_0x13a7c8,_0x28e4d9){var _0x426312={'channel':_0x2aa0('0x62')};if(_0x49017a['body']['id']){delete _0x49017a['body']['id'];}_0x49017a[_0x2aa0('0x5d')][_0x2aa0('0x63')]=!![];_0x49017a[_0x2aa0('0x5d')][_0x2aa0('0x64')]=moment()[_0x2aa0('0x65')](_0x2aa0('0x66'));_0x49017a[_0x2aa0('0x5d')][_0x2aa0('0x67')]=_0x49017a[_0x2aa0('0x5d')][_0x2aa0('0x67')]||_0x49017a['user']['id'];return db['WhatsappMessage'][_0x2aa0('0x5b')]({'where':{'id':_0x49017a['params']['id'],'UserId':null},'include':[{'model':db[_0x2aa0('0x68')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x13a7c8,null))[_0x2aa0('0x25')](saveUpdates(_0x49017a[_0x2aa0('0x5d')],null))[_0x2aa0('0x25')](function(_0x37dc30){if(_0x37dc30){_0x426312['message']=_0x37dc30['get']({'plain':!![]});return db[_0x2aa0('0x69')][_0x2aa0('0x5b')]({'where':{'id':_0x37dc30[_0x2aa0('0x6a')]}});}return null;})[_0x2aa0('0x25')](handleEntityNotFound(_0x13a7c8,null))[_0x2aa0('0x25')](function(_0x3c4c6e){if(_0x3c4c6e){return _0x3c4c6e['update']({'UserId':_0x49017a[_0x2aa0('0x5d')][_0x2aa0('0x67')],'read1stAt':_[_0x2aa0('0x6b')](_0x3c4c6e[_0x2aa0('0x6c')])?moment()['format'](_0x2aa0('0x66')):undefined});}return null;})['then'](function(_0x2dd88f){if(_0x2dd88f){_0x426312[_0x2aa0('0x6d')]=_0x2dd88f[_0x2aa0('0x6e')]({'plain':!![]});interaction_log[_0x2aa0('0x6f')](_0x2aa0('0x70'),_0x49017a[_0x2aa0('0x71')]['id'],_0x49017a[_0x2aa0('0x71')]['name'],_0x49017a[_0x2aa0('0x71')][_0x2aa0('0x72')],_0x426312[_0x2aa0('0x6d')]['id'],_0x49017a[_0x2aa0('0x5d')]?JSON[_0x2aa0('0x2a')](_0x49017a['body']):_0x2aa0('0x73'));return respondWithRpcPromise(_0x2aa0('0x74'),_0x2aa0('0x75'),_0x426312);}return null;})[_0x2aa0('0x25')](function(_0x544e15){if(_0x544e15){if(_0x49017a[_0x2aa0('0x5d')][_0x2aa0('0x76')]){_0x426312[_0x2aa0('0x2d')][_0x2aa0('0x77')]=util['format'](_0x2aa0('0x78'),_0x49017a['user']['name']);_0x426312[_0x2aa0('0x2d')][_0x2aa0('0x79')]=_0x426312[_0x2aa0('0x79')];_0x426312['message']['event']=_0x2aa0('0x61');return respondWithRpcPromise(_0x2aa0('0x7a'),_0x2aa0('0x7a'),{'event':_0x2aa0('0x7b'),'message':_0x426312['message']},client9002)[_0x2aa0('0x25')](function(){return _0x426312;});}return _0x426312;}return null;})[_0x2aa0('0x25')](respondWithResult(_0x13a7c8,null))['catch'](handleError(_0x13a7c8,null));};var interaction_log=require(_0x2aa0('0x14'))('whatsapp-interactions');exports[_0x2aa0('0x7c')]=function(_0x2c0cb6,_0x2db327,_0x14a28e){var _0x21738d={'agent':{},'channel':_0x2aa0('0x62')};if(_0x2c0cb6[_0x2aa0('0x5d')]['id']){delete _0x2c0cb6[_0x2aa0('0x5d')]['id'];}_0x2c0cb6[_0x2aa0('0x5d')]['UserId']=_0x2c0cb6[_0x2aa0('0x5d')][_0x2aa0('0x67')]||_0x2c0cb6['user']['id'];_0x21738d[_0x2aa0('0x7d')]['id']=_0x2c0cb6[_0x2aa0('0x5d')]['UserId'];return db[_0x2aa0('0x3e')][_0x2aa0('0x5b')]({'where':{'id':_0x2c0cb6['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2db327,null))[_0x2aa0('0x25')](function(_0x3323fe){if(_0x3323fe){_0x21738d[_0x2aa0('0x2d')]=_0x3323fe[_0x2aa0('0x6e')]({'plain':!![]});return db['WhatsappInteraction'][_0x2aa0('0x5b')]({'where':{'id':_0x3323fe['WhatsappInteractionId']}});}return null;})[_0x2aa0('0x25')](handleEntityNotFound(_0x2db327,null))[_0x2aa0('0x25')](function(_0x5dcd7e){if(_0x5dcd7e){_0x21738d[_0x2aa0('0x6d')]=_0x5dcd7e[_0x2aa0('0x6e')]({'plain':!![]});interaction_log[_0x2aa0('0x6f')](_0x2aa0('0x7e'),_0x2c0cb6['user']['id'],_0x2c0cb6[_0x2aa0('0x71')][_0x2aa0('0x3b')],_0x2c0cb6[_0x2aa0('0x71')][_0x2aa0('0x72')],_0x21738d['interaction']['id'],_0x2c0cb6[_0x2aa0('0x5d')]?JSON['stringify'](_0x2c0cb6[_0x2aa0('0x5d')]):'null');return respondWithRpcPromise('RejectMessage',_0x2aa0('0x7f'),_0x21738d);}return null;})['then'](function(_0x1ad170){if(_0x1ad170){_0x1ad170['message'][_0x2aa0('0x77')]=util['format']('SIP/%s',_0x2c0cb6[_0x2aa0('0x71')][_0x2aa0('0x3b')]);_0x1ad170[_0x2aa0('0x2d')][_0x2aa0('0x79')]=_0x21738d['channel'];_0x1ad170['message']['event']=_0x2aa0('0x7c');respondWithRpcPromise('EventManager','EventManager',{'event':_0x2aa0('0x80'),'message':_0x1ad170[_0x2aa0('0x2d')]},client9002);return _0x21738d;}return null;})[_0x2aa0('0x25')](respondWithResult(_0x2db327,null))[_0x2aa0('0x57')](handleError(_0x2db327,null));};exports[_0x2aa0('0x30')]=function(_0x30b477,_0x56673f,_0x16cde9){if(_0x30b477[_0x2aa0('0x5d')]['id']){delete _0x30b477['body']['id'];}var _0x496c8c;return db[_0x2aa0('0x3e')]['find']({'where':{'id':_0x30b477[_0x2aa0('0x59')]['id']}})['then'](handleEntityNotFound(_0x56673f,null))[_0x2aa0('0x25')](function(_0x54617a){if(_0x54617a){_0x496c8c=_0x54617a;return db[_0x2aa0('0x81')][_0x2aa0('0x5b')]({'where':{'id':_0x54617a['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x56673f,null))['then'](function(_0x470bfc){if(_0x470bfc){logger[_0x2aa0('0x27')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0x2aa0('0x30'),_0x2aa0('0x82'),_0x470bfc[_0x2aa0('0x41')],util[_0x2aa0('0x83')](_0x30b477['body'],{'showHidden':![],'depth':null}));switch(_0x470bfc[_0x2aa0('0x41')]){case'twilio':if(_0x30b477[_0x2aa0('0x5d')][_0x2aa0('0x84')]&&_0x30b477[_0x2aa0('0x5d')][_0x2aa0('0x84')]===_0x496c8c['messageId']&&_0x30b477[_0x2aa0('0x5d')][_0x2aa0('0x85')]&&_0x30b477['body'][_0x2aa0('0x85')]===_0x2aa0('0x63')){return _0x496c8c['update']({'read':!![]});}else{logger[_0x2aa0('0x2b')](_0x2aa0('0x86'),_0x2aa0('0x30'),_0x2aa0('0x87'),util[_0x2aa0('0x83')](_0x30b477[_0x2aa0('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x496c8c;}})[_0x2aa0('0x25')](respondWithResult(_0x56673f,null))[_0x2aa0('0x57')](handleError(_0x56673f,null));}; \ No newline at end of file +var _0xbdef=['params','describe','accept','whatsapp','read','readAt','UserId','user','CmContact','Contact','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','whatsapp-interactions','agent','get','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','type','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappMessage,\x20%s,\x20%s','info','catch','end','status','offset','limit','set','Content-Range','apply','save','destroy','sendStatus','stack','name','index','map','WhatsappMessage','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','options','count','includeAll','include','rows','show','rawAttributes','merge','find','create','body','update'];(function(_0x24e473,_0x3fdd50){var _0x3a3b78=function(_0x5d1f54){while(--_0x5d1f54){_0x24e473['push'](_0x24e473['shift']());}};_0x3a3b78(++_0x3fdd50);}(_0xbdef,0x136));var _0xfbde=function(_0x2c94cb,_0x4badfd){_0x2c94cb=_0x2c94cb-0x0;var _0x16fa09=_0xbdef[_0x2c94cb];return _0x16fa09;};'use strict';var pdf=require(_0xfbde('0x0'));var emlformat=require(_0xfbde('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfbde('0x2'));var jsonpatch=require(_0xfbde('0x3'));var rp=require(_0xfbde('0x4'));var moment=require(_0xfbde('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xfbde('0x6'));var sox=require(_0xfbde('0x7'));var csv=require(_0xfbde('0x8'));var ejs=require(_0xfbde('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfbde('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfbde('0xb'));var Redis=require(_0xfbde('0xc'));var authService=require(_0xfbde('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xfbde('0xe'));var hardwareService=require(_0xfbde('0xf'));var logger=require(_0xfbde('0x10'))(_0xfbde('0x11'));var utils=require(_0xfbde('0x12'));var config=require(_0xfbde('0x13'));var db=require(_0xfbde('0x14'))['db'];config['redis']=_['defaults'](config[_0xfbde('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xfbde('0x16'))(new Redis(config[_0xfbde('0x15')]));require(_0xfbde('0x17'))[_0xfbde('0x18')](socket);var jayson=require(_0xfbde('0x19'));var client=jayson[_0xfbde('0x1a')]['http']({'port':0x232c});var client9002=jayson['client'][_0xfbde('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x55c0f2,_0x5dbb59,_0x10c3a7){if(_0x10c3a7){var _0x5a1141=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a1141[_0xfbde('0x1c')](_0x5dbb59)){return _0x55c0f2;}else{throw new db[(_0xfbde('0x1d'))]['ValidationError'](_0xfbde('0x1e'));}}else{return _0x55c0f2;}}function respondWithRpcPromise(_0xc0e45d,_0x311048,_0x2c3ef6,_0x289d43){return new BPromise(function(_0x48d7f6,_0x2b1729){var _0x31cab3=_0x289d43||client;return _0x31cab3[_0xfbde('0x1f')](_0xc0e45d,_0x2c3ef6)[_0xfbde('0x20')](function(_0x2abbf7){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x311048,_0xfbde('0x21'));logger[_0xfbde('0x22')](_0xfbde('0x23'),_0x311048,_0xfbde('0x21'),JSON[_0xfbde('0x24')](_0x2abbf7));if(_0x2abbf7[_0xfbde('0x25')]){if(_0x2abbf7[_0xfbde('0x25')]['code']===0x1f4){logger[_0xfbde('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x311048,_0x2abbf7[_0xfbde('0x25')]['message']);return _0x2b1729(_0x2abbf7['error'][_0xfbde('0x26')]);}logger[_0xfbde('0x25')](_0xfbde('0x27'),_0x311048,_0x2abbf7['error'][_0xfbde('0x26')]);return _0x48d7f6(_0x2abbf7['error'][_0xfbde('0x26')]);}else{logger[_0xfbde('0x28')](_0xfbde('0x27'),_0x311048,'request\x20sent');_0x48d7f6(_0x2abbf7['result']['message']);}})[_0xfbde('0x29')](function(_0x27bf9f){logger['error'](_0xfbde('0x27'),_0x311048,_0x27bf9f);_0x2b1729(_0x27bf9f);});});}function respondWithStatusCode(_0x435a95,_0x594ba2){_0x594ba2=_0x594ba2||0xcc;return function(_0x352b3e){if(_0x352b3e){return _0x435a95['sendStatus'](_0x594ba2);}return _0x435a95['status'](_0x594ba2)[_0xfbde('0x2a')]();};}function respondWithResult(_0x52d096,_0x4c0233){_0x4c0233=_0x4c0233||0xc8;return function(_0x2619e0){if(_0x2619e0){return _0x52d096[_0xfbde('0x2b')](_0x4c0233)['json'](_0x2619e0);}};}function respondWithFilteredResult(_0xa8b9d3,_0xe91cf2){return function(_0xd1c97){if(_0xd1c97){var _0x9e8ae5=_0xd1c97['count'],_0x2a4b25=_0xe91cf2['offset'],_0x17c394=_0xe91cf2[_0xfbde('0x2c')]+_0xe91cf2[_0xfbde('0x2d')],_0x369112;if(_0x17c394>=_0x9e8ae5){_0x17c394=_0x9e8ae5;_0x369112=0xc8;}else{_0x369112=0xce;}_0xa8b9d3[_0xfbde('0x2b')](_0x369112);return _0xa8b9d3[_0xfbde('0x2e')](_0xfbde('0x2f'),_0x2a4b25+'-'+_0x17c394+'/'+_0x9e8ae5)['json'](_0xd1c97);}return null;};}function patchUpdates(_0x3cdcd9){return function(_0x240d2f){try{jsonpatch[_0xfbde('0x30')](_0x240d2f,_0x3cdcd9,!![]);}catch(_0x46f014){return BPromise['reject'](_0x46f014);}return _0x240d2f[_0xfbde('0x31')]();};}function saveUpdates(_0x5baabf,_0x5c8c14){return function(_0x10ba89){if(_0x10ba89){return _0x10ba89['update'](_0x5baabf)[_0xfbde('0x20')](function(_0x838dc4){return _0x838dc4;});}return null;};}function removeEntity(_0x3c6b57,_0x16f9d6){return function(_0x338e4f){if(_0x338e4f){return _0x338e4f[_0xfbde('0x32')]()[_0xfbde('0x20')](function(){_0x3c6b57['status'](0xcc)[_0xfbde('0x2a')]();});}};}function handleEntityNotFound(_0xd28635,_0x183d57){return function(_0xe90d25){if(!_0xe90d25){_0xd28635[_0xfbde('0x33')](0x194);}return _0xe90d25;};}function handleError(_0x18a67b,_0xdb512e){_0xdb512e=_0xdb512e||0x1f4;return function(_0x158809){logger[_0xfbde('0x25')](_0x158809[_0xfbde('0x34')]);if(_0x158809[_0xfbde('0x35')]){delete _0x158809[_0xfbde('0x35')];}_0x18a67b['status'](_0xdb512e)['send'](_0x158809);};}exports[_0xfbde('0x36')]=function(_0x233ed4,_0x193163){var _0x33a0bd={},_0x516781={},_0x392c04={'count':0x0,'rows':[]};var _0x43b710=_[_0xfbde('0x37')](db[_0xfbde('0x38')]['rawAttributes'],function(_0xec73ac){return{'name':_0xec73ac['fieldName'],'type':_0xec73ac['type'][_0xfbde('0x39')]};});_0x516781[_0xfbde('0x3a')]=_[_0xfbde('0x37')](_0x43b710,_0xfbde('0x35'));_0x516781['query']=_[_0xfbde('0x3b')](_0x233ed4[_0xfbde('0x3c')]);_0x516781[_0xfbde('0x3d')]=_[_0xfbde('0x3e')](_0x516781['model'],_0x516781[_0xfbde('0x3c')]);_0x33a0bd[_0xfbde('0x3f')]=_[_0xfbde('0x3e')](_0x516781['model'],qs[_0xfbde('0x40')](_0x233ed4[_0xfbde('0x3c')][_0xfbde('0x40')]));_0x33a0bd[_0xfbde('0x3f')]=_0x33a0bd[_0xfbde('0x3f')][_0xfbde('0x41')]?_0x33a0bd[_0xfbde('0x3f')]:_0x516781[_0xfbde('0x3a')];if(!_0x233ed4[_0xfbde('0x3c')][_0xfbde('0x42')](_0xfbde('0x43'))){_0x33a0bd['limit']=qs[_0xfbde('0x2d')](_0x233ed4[_0xfbde('0x3c')]['limit']);_0x33a0bd[_0xfbde('0x2c')]=qs[_0xfbde('0x2c')](_0x233ed4[_0xfbde('0x3c')][_0xfbde('0x2c')]);}_0x33a0bd[_0xfbde('0x44')]=qs[_0xfbde('0x45')](_0x233ed4[_0xfbde('0x3c')]['sort']);_0x33a0bd['where']=qs[_0xfbde('0x3d')](_[_0xfbde('0x46')](_0x233ed4[_0xfbde('0x3c')],_0x516781[_0xfbde('0x3d')]),_0x43b710);if(_0x233ed4['query']['filter']){_0x33a0bd[_0xfbde('0x47')]=_['merge'](_0x33a0bd[_0xfbde('0x47')],{'$or':_['map'](_0x43b710,function(_0x3af461){if(_0x3af461['type']!==_0xfbde('0x48')){var _0x33cbc2={};_0x33cbc2[_0x3af461[_0xfbde('0x35')]]={'$like':'%'+_0x233ed4[_0xfbde('0x3c')][_0xfbde('0x49')]+'%'};return _0x33cbc2;}})});}_0x33a0bd=_['merge']({},_0x33a0bd,_0x233ed4[_0xfbde('0x4a')]);var _0x20b0bd={'where':_0x33a0bd[_0xfbde('0x47')]};return db[_0xfbde('0x38')]['count'](_0x20b0bd)[_0xfbde('0x20')](function(_0x1986cc){_0x392c04[_0xfbde('0x4b')]=_0x1986cc;if(_0x233ed4[_0xfbde('0x3c')][_0xfbde('0x4c')]){_0x33a0bd[_0xfbde('0x4d')]=[{'all':!![]}];}return db[_0xfbde('0x38')]['findAll'](_0x33a0bd);})[_0xfbde('0x20')](function(_0x4984c7){_0x392c04[_0xfbde('0x4e')]=_0x4984c7;return _0x392c04;})[_0xfbde('0x20')](respondWithFilteredResult(_0x193163,_0x33a0bd))[_0xfbde('0x29')](handleError(_0x193163,null));};exports[_0xfbde('0x4f')]=function(_0x3171c1,_0xd5610e){var _0x3d75a3={'raw':!![],'where':{'id':_0x3171c1['params']['id']}},_0x332a8f={};_0x332a8f['model']=_[_0xfbde('0x3b')](db['WhatsappMessage'][_0xfbde('0x50')]);_0x332a8f[_0xfbde('0x3c')]=_[_0xfbde('0x3b')](_0x3171c1[_0xfbde('0x3c')]);_0x332a8f[_0xfbde('0x3d')]=_[_0xfbde('0x3e')](_0x332a8f[_0xfbde('0x3a')],_0x332a8f['query']);_0x3d75a3['attributes']=_[_0xfbde('0x3e')](_0x332a8f[_0xfbde('0x3a')],qs[_0xfbde('0x40')](_0x3171c1[_0xfbde('0x3c')][_0xfbde('0x40')]));_0x3d75a3[_0xfbde('0x3f')]=_0x3d75a3['attributes'][_0xfbde('0x41')]?_0x3d75a3[_0xfbde('0x3f')]:_0x332a8f['model'];if(_0x3171c1[_0xfbde('0x3c')]['includeAll']){_0x3d75a3[_0xfbde('0x4d')]=[{'all':!![]}];}_0x3d75a3=_[_0xfbde('0x51')]({},_0x3d75a3,_0x3171c1[_0xfbde('0x4a')]);return db['WhatsappMessage'][_0xfbde('0x52')](_0x3d75a3)['then'](handleEntityNotFound(_0xd5610e,null))['then'](respondWithResult(_0xd5610e,null))[_0xfbde('0x29')](handleError(_0xd5610e,null));};exports[_0xfbde('0x53')]=function(_0x49452a,_0x4e4a2d){return db['WhatsappMessage']['create'](_0x49452a[_0xfbde('0x54')],{})['then'](respondWithResult(_0x4e4a2d,0xc9))['catch'](handleError(_0x4e4a2d,null));};exports[_0xfbde('0x55')]=function(_0x551e71,_0x1171bc){if(_0x551e71[_0xfbde('0x54')]['id']){delete _0x551e71[_0xfbde('0x54')]['id'];}return db[_0xfbde('0x38')][_0xfbde('0x52')]({'where':{'id':_0x551e71[_0xfbde('0x56')]['id']}})[_0xfbde('0x20')](handleEntityNotFound(_0x1171bc,null))[_0xfbde('0x20')](saveUpdates(_0x551e71[_0xfbde('0x54')],null))[_0xfbde('0x20')](respondWithResult(_0x1171bc,null))[_0xfbde('0x29')](handleError(_0x1171bc,null));};exports['destroy']=function(_0x441148,_0x515779){return db[_0xfbde('0x38')]['find']({'where':{'id':_0x441148['params']['id']}})[_0xfbde('0x20')](handleEntityNotFound(_0x515779,null))[_0xfbde('0x20')](removeEntity(_0x515779,null))['catch'](handleError(_0x515779,null));};exports[_0xfbde('0x57')]=function(_0x171a2a,_0x35c34d){return db[_0xfbde('0x38')][_0xfbde('0x57')]()[_0xfbde('0x20')](respondWithResult(_0x35c34d,null))[_0xfbde('0x29')](handleError(_0x35c34d,null));};var interaction_log=require(_0xfbde('0x10'))('whatsapp-interactions');exports[_0xfbde('0x58')]=function(_0x27125b,_0x9100db,_0x97554b){var _0x1da312={'channel':_0xfbde('0x59')};if(_0x27125b['body']['id']){delete _0x27125b[_0xfbde('0x54')]['id'];}_0x27125b[_0xfbde('0x54')][_0xfbde('0x5a')]=!![];_0x27125b[_0xfbde('0x54')][_0xfbde('0x5b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x27125b['body'][_0xfbde('0x5c')]=_0x27125b[_0xfbde('0x54')][_0xfbde('0x5c')]||_0x27125b[_0xfbde('0x5d')]['id'];return db[_0xfbde('0x38')]['find']({'where':{'id':_0x27125b['params']['id'],'UserId':null},'include':[{'model':db[_0xfbde('0x5e')],'as':_0xfbde('0x5f')}]})[_0xfbde('0x20')](handleEntityNotFound(_0x9100db,null))['then'](saveUpdates(_0x27125b[_0xfbde('0x54')],null))[_0xfbde('0x20')](function(_0x25d002){if(_0x25d002){_0x1da312[_0xfbde('0x26')]=_0x25d002['get']({'plain':!![]});return db[_0xfbde('0x60')][_0xfbde('0x52')]({'where':{'id':_0x25d002[_0xfbde('0x61')]}});}return null;})[_0xfbde('0x20')](handleEntityNotFound(_0x9100db,null))[_0xfbde('0x20')](function(_0x2e6bc5){if(_0x2e6bc5){return _0x2e6bc5[_0xfbde('0x55')]({'UserId':_0x27125b[_0xfbde('0x54')][_0xfbde('0x5c')],'read1stAt':_[_0xfbde('0x62')](_0x2e6bc5[_0xfbde('0x63')])?moment()[_0xfbde('0x64')](_0xfbde('0x65')):undefined});}return null;})[_0xfbde('0x20')](function(_0x42bc51){if(_0x42bc51){_0x1da312['interaction']=_0x42bc51['get']({'plain':!![]});interaction_log[_0xfbde('0x28')](_0xfbde('0x66'),_0x27125b[_0xfbde('0x5d')]['id'],_0x27125b[_0xfbde('0x5d')][_0xfbde('0x35')],_0x27125b['user']['role'],_0x1da312[_0xfbde('0x67')]['id'],_0x27125b[_0xfbde('0x54')]?JSON['stringify'](_0x27125b['body']):_0xfbde('0x68'));return respondWithRpcPromise(_0xfbde('0x69'),_0xfbde('0x6a'),_0x1da312);}return null;})[_0xfbde('0x20')](function(_0x11f765){if(_0x11f765){if(_0x27125b[_0xfbde('0x54')]['manual']){_0x1da312[_0xfbde('0x26')][_0xfbde('0x6b')]=util[_0xfbde('0x64')](_0xfbde('0x6c'),_0x27125b[_0xfbde('0x5d')][_0xfbde('0x35')]);_0x1da312[_0xfbde('0x26')][_0xfbde('0x6d')]=_0x1da312[_0xfbde('0x6d')];_0x1da312[_0xfbde('0x26')][_0xfbde('0x6e')]='accept';return respondWithRpcPromise('EventManager',_0xfbde('0x6f'),{'event':_0xfbde('0x70'),'message':_0x1da312[_0xfbde('0x26')]},client9002)[_0xfbde('0x20')](function(){return _0x1da312;});}return _0x1da312;}return null;})[_0xfbde('0x20')](respondWithResult(_0x9100db,null))[_0xfbde('0x29')](handleError(_0x9100db,null));};var interaction_log=require(_0xfbde('0x10'))(_0xfbde('0x71'));exports['reject']=function(_0x1dcd69,_0x37f2af,_0x236db4){var _0x33400a={'agent':{},'channel':_0xfbde('0x59')};if(_0x1dcd69['body']['id']){delete _0x1dcd69[_0xfbde('0x54')]['id'];}_0x1dcd69['body']['UserId']=_0x1dcd69[_0xfbde('0x54')][_0xfbde('0x5c')]||_0x1dcd69[_0xfbde('0x5d')]['id'];_0x33400a[_0xfbde('0x72')]['id']=_0x1dcd69['body'][_0xfbde('0x5c')];return db[_0xfbde('0x38')][_0xfbde('0x52')]({'where':{'id':_0x1dcd69[_0xfbde('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x37f2af,null))[_0xfbde('0x20')](function(_0x538995){if(_0x538995){_0x33400a['message']=_0x538995[_0xfbde('0x73')]({'plain':!![]});return db['WhatsappInteraction'][_0xfbde('0x52')]({'where':{'id':_0x538995[_0xfbde('0x61')]}});}return null;})[_0xfbde('0x20')](handleEntityNotFound(_0x37f2af,null))[_0xfbde('0x20')](function(_0x218311){if(_0x218311){_0x33400a[_0xfbde('0x67')]=_0x218311[_0xfbde('0x73')]({'plain':!![]});interaction_log['info'](_0xfbde('0x74'),_0x1dcd69[_0xfbde('0x5d')]['id'],_0x1dcd69[_0xfbde('0x5d')][_0xfbde('0x35')],_0x1dcd69[_0xfbde('0x5d')][_0xfbde('0x75')],_0x33400a[_0xfbde('0x67')]['id'],_0x1dcd69[_0xfbde('0x54')]?JSON[_0xfbde('0x24')](_0x1dcd69['body']):_0xfbde('0x68'));return respondWithRpcPromise(_0xfbde('0x76'),_0xfbde('0x77'),_0x33400a);}return null;})['then'](function(_0x3bb8e9){if(_0x3bb8e9){_0x3bb8e9[_0xfbde('0x26')]['interface']=util[_0xfbde('0x64')](_0xfbde('0x6c'),_0x1dcd69['user'][_0xfbde('0x35')]);_0x3bb8e9[_0xfbde('0x26')][_0xfbde('0x6d')]=_0x33400a[_0xfbde('0x6d')];_0x3bb8e9[_0xfbde('0x26')][_0xfbde('0x6e')]='reject';respondWithRpcPromise(_0xfbde('0x6f'),_0xfbde('0x6f'),{'event':_0xfbde('0x78'),'message':_0x3bb8e9[_0xfbde('0x26')]},client9002);return _0x33400a;}return null;})['then'](respondWithResult(_0x37f2af,null))[_0xfbde('0x29')](handleError(_0x37f2af,null));};exports['status']=function(_0x43d0ee,_0x57ae23,_0x1da223){if(_0x43d0ee[_0xfbde('0x54')]['id']){delete _0x43d0ee['body']['id'];}var _0x4565dd;return db[_0xfbde('0x38')][_0xfbde('0x52')]({'where':{'id':_0x43d0ee[_0xfbde('0x56')]['id']}})['then'](handleEntityNotFound(_0x57ae23,null))[_0xfbde('0x20')](function(_0x1c6a11){if(_0x1c6a11){_0x4565dd=_0x1c6a11;return db[_0xfbde('0x79')][_0xfbde('0x52')]({'where':{'id':_0x1c6a11[_0xfbde('0x7a')]}});}})['then'](handleEntityNotFound(_0x57ae23,null))[_0xfbde('0x20')](function(_0x35e120){if(_0x35e120){logger[_0xfbde('0x22')](_0xfbde('0x7b'),_0xfbde('0x2b'),_0xfbde('0x7c'),_0x35e120[_0xfbde('0x7d')],util[_0xfbde('0x7e')](_0x43d0ee[_0xfbde('0x54')],{'showHidden':![],'depth':null}));switch(_0x35e120['type']){case _0xfbde('0x7f'):if(_0x43d0ee['body'][_0xfbde('0x80')]&&_0x43d0ee[_0xfbde('0x54')]['MessageSid']===_0x4565dd[_0xfbde('0x81')]&&_0x43d0ee['body']['MessageStatus']&&_0x43d0ee[_0xfbde('0x54')][_0xfbde('0x82')]===_0xfbde('0x5a')){return _0x4565dd[_0xfbde('0x55')]({'read':!![]});}else{logger[_0xfbde('0x25')](_0xfbde('0x83'),'status','twilio',util[_0xfbde('0x7e')](_0x43d0ee[_0xfbde('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x4565dd;}})[_0xfbde('0x20')](respondWithResult(_0x57ae23,null))[_0xfbde('0x29')](handleError(_0x57ae23,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index d86e922..643a2fc 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 _0xb10b=['hasOwnProperty','hook','events','WhatsappMessage','setMaxListeners','save','remove','emit'];(function(_0x392f51,_0xcce91e){var _0x33bd33=function(_0x48903b){while(--_0x48903b){_0x392f51['push'](_0x392f51['shift']());}};_0x33bd33(++_0xcce91e);}(_0xb10b,0x12a));var _0xbb10=function(_0x93c171,_0x2b3a4c){_0x93c171=_0x93c171-0x0;var _0x4970d9=_0xb10b[_0x93c171];return _0x4970d9;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0xbb10('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){WhatsappMessageEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);WhatsappMessageEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];WhatsappMessage[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x7a54=['WhatsappMessage','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x6e8960,_0x483148){var _0x4505f5=function(_0x2a3dc7){while(--_0x2a3dc7){_0x6e8960['push'](_0x6e8960['shift']());}};_0x4505f5(++_0x483148);}(_0x7a54,0x106));var _0x47a5=function(_0x12a00a,_0xf8076e){_0x12a00a=_0x12a00a-0x0;var _0x352955=_0x7a54[_0x12a00a];return _0x352955;};'use strict';var EventEmitter=require(_0x47a5('0x0'));var WhatsappMessage=require(_0x47a5('0x1'))['db'][_0x47a5('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x47a5('0x3'),'afterUpdate':_0x47a5('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5f7f12){return function(_0x11bf85,_0x2a1a7e,_0x3717e1){WhatsappMessageEvents[_0x47a5('0x5')](_0x5f7f12+':'+_0x11bf85['id'],_0x11bf85);WhatsappMessageEvents['emit'](_0x5f7f12,_0x11bf85);_0x3717e1(null);};}for(var e in events){if(events[_0x47a5('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x47a5('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index c143347..a0e6a47 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 _0x4d93=['token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','body','models','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','find','WhatsappAccountId','type','twilio','authToken','accountSid','messages','create','whatsapp:','phone','remote','/api/whatsapp/messages/'];(function(_0x17d606,_0x54107e){var _0x503804=function(_0x9e35d){while(--_0x9e35d){_0x17d606['push'](_0x17d606['shift']());}};_0x503804(++_0x54107e);}(_0x4d93,0xf4));var _0x34d9=function(_0x4a7645,_0x317384){_0x4a7645=_0x4a7645-0x0;var _0xf03f4b=_0x4d93[_0x4a7645];return _0xf03f4b;};'use strict';var _=require(_0x34d9('0x0'));var util=require('util');var logger=require(_0x34d9('0x1'))(_0x34d9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x34d9('0x3'));var rimraf=require(_0x34d9('0x4'));var config=require(_0x34d9('0x5'));var attributes=require(_0x34d9('0x6'));module[_0x34d9('0x7')]=function(_0x44e883,_0x115bdc){return _0x44e883[_0x34d9('0x8')](_0x34d9('0x9'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x34d9('0xa')]},{'name':'fti_whatsapp_messages','fields':[_0x34d9('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b80b3,_0x35be61,_0x45ca07){var _0x56c20c=_0x44e883[_0x34d9('0xc')];var _0x5ecffc=_0x2b80b3[_0x34d9('0xd')]({'plain':!![]});if(_0x5ecffc[_0x34d9('0xe')]['toLowerCase']()==='in'||_0x5ecffc['direction'][_0x34d9('0xf')]()===_0x34d9('0x10')&&!_0x5ecffc[_0x34d9('0x11')]&&!_['isNil'](_0x5ecffc[_0x34d9('0x12')])){_0x56c20c[_0x34d9('0x13')][_0x34d9('0x14')]({'where':{'id':_0x5ecffc[_0x34d9('0x15')]}})[_0x34d9('0x16')](function(_0x114768){if(_0x114768){_0x114768[_0x34d9('0x17')]({'lastMsgAt':_0x5ecffc[_0x34d9('0x18')],'lastMsgDirection':_0x5ecffc[_0x34d9('0xe')]['toLowerCase']()});}})[_0x34d9('0x19')](function(_0x5ce8f3){console['error'](_0x5ce8f3);});}if(_0x5ecffc['direction']===_0x34d9('0x10')&&!_0x5ecffc['secret']){var _0x4722d2;_0x56c20c['WhatsappAccount'][_0x34d9('0x1a')]({'where':{'id':_0x5ecffc[_0x34d9('0x1b')]},'raw':!![]})['then'](function(_0x446e67){_0x4722d2=_0x446e67;if(_0x4722d2&&_0x4722d2[_0x34d9('0x1c')]){switch(_0x4722d2['type']){case'twilio':var _0x5a4830=require(_0x34d9('0x1d'));if(_0x4722d2['accountSid']&&_0x4722d2[_0x34d9('0x1e')]&&_0x4722d2['phone']){var _0x5d1a73=new _0x5a4830(_0x4722d2[_0x34d9('0x1f')],_0x4722d2[_0x34d9('0x1e')]);_0x5d1a73[_0x34d9('0x20')][_0x34d9('0x21')]({'body':_0x5ecffc['body'],'to':_0x34d9('0x22')+_0x5ecffc[_0x34d9('0x23')],'from':'whatsapp:'+_0x4722d2[_0x34d9('0x23')],'statusCallback':_0x4722d2[_0x34d9('0x24')]+_0x34d9('0x25')+_0x5ecffc['id']+'/status?token='+_0x4722d2[_0x34d9('0x26')]})[_0x34d9('0x16')](function(_0x299b24){if(_0x299b24[_0x34d9('0x27')]){return _0x2b80b3['update']({'messageId':_0x299b24[_0x34d9('0x27')]});}})[_0x34d9('0x19')](function(_0x281b83){logger[_0x34d9('0x28')](_0x34d9('0x29'),_0x34d9('0x2a'),'twilio',util[_0x34d9('0x2b')](_0x281b83,{'showHidden':![],'depth':null}));});}else{logger[_0x34d9('0x28')](_0x34d9('0x29'),_0x34d9('0x2a'),'twilio','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x34d9('0x2c')](function(){_0x45ca07();});}else{_0x45ca07();}}},'charset':_0x34d9('0x2d'),'collate':_0x34d9('0x2e')});}; \ No newline at end of file +var _0xb5b3=['WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','body','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','WhatsappInteractionId','then','update','catch','error'];(function(_0x642e61,_0x51399d){var _0x5e9a6f=function(_0xeb6f5e){while(--_0xeb6f5e){_0x642e61['push'](_0x642e61['shift']());}};_0x5e9a6f(++_0x51399d);}(_0xb5b3,0xff));var _0x3b5b=function(_0x37d5b0,_0xa12629){_0x37d5b0=_0x37d5b0-0x0;var _0x3b86a1=_0xb5b3[_0x37d5b0];return _0x3b86a1;};'use strict';var _=require(_0x3b5b('0x0'));var util=require(_0x3b5b('0x1'));var logger=require('../../config/logger')(_0x3b5b('0x2'));var moment=require('moment');var BPromise=require(_0x3b5b('0x3'));var rp=require(_0x3b5b('0x4'));var fs=require('fs');var path=require(_0x3b5b('0x5'));var rimraf=require(_0x3b5b('0x6'));var config=require(_0x3b5b('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x3b5b('0x8')]=function(_0x1c31e0,_0xbdf84c){return _0x1c31e0[_0x3b5b('0x9')](_0x3b5b('0xa'),attributes,{'tableName':_0x3b5b('0xb'),'paranoid':![],'indexes':[{'name':_0x3b5b('0xc'),'fields':['messageId']},{'name':_0x3b5b('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53d491,_0x37021b,_0x2f20b0){var _0x5adddb=_0x1c31e0['models'];var _0x574dad=_0x53d491[_0x3b5b('0xe')]({'plain':!![]});if(_0x574dad[_0x3b5b('0xf')][_0x3b5b('0x10')]()==='in'||_0x574dad[_0x3b5b('0xf')][_0x3b5b('0x10')]()===_0x3b5b('0x11')&&!_0x574dad[_0x3b5b('0x12')]&&!_[_0x3b5b('0x13')](_0x574dad[_0x3b5b('0x14')])){_0x5adddb[_0x3b5b('0x15')]['findOne']({'where':{'id':_0x574dad[_0x3b5b('0x16')]}})[_0x3b5b('0x17')](function(_0x4d6a3c){if(_0x4d6a3c){_0x4d6a3c[_0x3b5b('0x18')]({'lastMsgAt':_0x574dad['createdAt'],'lastMsgDirection':_0x574dad[_0x3b5b('0xf')][_0x3b5b('0x10')]()});}})[_0x3b5b('0x19')](function(_0x487cc8){console[_0x3b5b('0x1a')](_0x487cc8);});}if(_0x574dad['direction']===_0x3b5b('0x11')&&!_0x574dad[_0x3b5b('0x12')]){var _0x692042;_0x5adddb[_0x3b5b('0x1b')][_0x3b5b('0x1c')]({'where':{'id':_0x574dad[_0x3b5b('0x1d')]},'raw':!![]})[_0x3b5b('0x17')](function(_0x42d6b0){_0x692042=_0x42d6b0;if(_0x692042&&_0x692042[_0x3b5b('0x1e')]){switch(_0x692042[_0x3b5b('0x1e')]){case _0x3b5b('0x1f'):var _0x14c746=require(_0x3b5b('0x1f'));if(_0x692042[_0x3b5b('0x20')]&&_0x692042[_0x3b5b('0x21')]&&_0x692042[_0x3b5b('0x22')]){var _0x56ccaf=new _0x14c746(_0x692042[_0x3b5b('0x20')],_0x692042['authToken']);_0x56ccaf['messages'][_0x3b5b('0x23')]({'body':_0x574dad[_0x3b5b('0x24')],'to':_0x3b5b('0x25')+_0x574dad[_0x3b5b('0x22')],'from':'whatsapp:'+_0x692042[_0x3b5b('0x22')],'statusCallback':_0x692042['remote']+_0x3b5b('0x26')+_0x574dad['id']+_0x3b5b('0x27')+_0x692042[_0x3b5b('0x28')]})['then'](function(_0x3108c6){if(_0x3108c6[_0x3b5b('0x29')]){return _0x53d491[_0x3b5b('0x18')]({'messageId':_0x3108c6[_0x3b5b('0x29')]});}})[_0x3b5b('0x19')](function(_0x278e42){logger[_0x3b5b('0x1a')](_0x3b5b('0x2a'),_0x3b5b('0x2b'),_0x3b5b('0x1f'),util['inspect'](_0x278e42,{'showHidden':![],'depth':null}));});}else{logger[_0x3b5b('0x1a')](_0x3b5b('0x2a'),'afterCreate',_0x3b5b('0x1f'),_0x3b5b('0x2c'));}break;}}})[_0x3b5b('0x2d')](function(){_0x2f20b0();});}else{_0x2f20b0();}}},'charset':'utf8mb4','collate':_0x3b5b('0x2e')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 549b23a..f150893 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 _0x015a=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','moment','bluebird','randomstring'];(function(_0x2047cd,_0x40e299){var _0xfac12e=function(_0x1e1fd7){while(--_0x1e1fd7){_0x2047cd['push'](_0x2047cd['shift']());}};_0xfac12e(++_0x40e299);}(_0x015a,0x84));var _0xa015=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x015a[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0xa015('0x0'));var util=require('util');var moment=require(_0xa015('0x1'));var BPromise=require(_0xa015('0x2'));var rs=require(_0xa015('0x3'));var fs=require('fs');var Redis=require(_0xa015('0x4'));var db=require(_0xa015('0x5'))['db'];var utils=require(_0xa015('0x6'));var logger=require('../../config/logger')(_0xa015('0x7'));var config=require(_0xa015('0x8'));var jayson=require(_0xa015('0x9'));var client=jayson[_0xa015('0xa')][_0xa015('0xb')]({'port':0x232a});config['redis']=_[_0xa015('0xc')](config[_0xa015('0xd')],{'host':_0xa015('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa015('0xd')]));require(_0xa015('0xf'))[_0xa015('0x10')](socket);function respondWithRpcPromise(_0x17b519,_0x5d49dc,_0x6529c5){return new BPromise(function(_0x48243e,_0xf6b0dd){return client['request'](_0x17b519,_0x6529c5)[_0xa015('0x11')](function(_0x52e952){logger[_0xa015('0x12')](_0xa015('0x13'),_0x5d49dc,_0xa015('0x14'));logger[_0xa015('0x15')](_0xa015('0x16'),_0x5d49dc,_0xa015('0x14'),JSON[_0xa015('0x17')](_0x52e952));if(_0x52e952[_0xa015('0x18')]){if(_0x52e952[_0xa015('0x18')][_0xa015('0x19')]===0x1f4){logger['error'](_0xa015('0x13'),_0x5d49dc,_0x52e952[_0xa015('0x18')][_0xa015('0x1a')]);return _0xf6b0dd(_0x52e952[_0xa015('0x18')][_0xa015('0x1a')]);}logger['error'](_0xa015('0x13'),_0x5d49dc,_0x52e952[_0xa015('0x18')]['message']);return _0x48243e(_0x52e952[_0xa015('0x18')][_0xa015('0x1a')]);}else{logger[_0xa015('0x12')]('WhatsappMessage,\x20%s,\x20%s',_0x5d49dc,_0xa015('0x14'));_0x48243e(_0x52e952['result'][_0xa015('0x1a')]);}})[_0xa015('0x1b')](function(_0x26f495){logger[_0xa015('0x18')](_0xa015('0x13'),_0x5d49dc,_0x26f495);_0xf6b0dd(_0x26f495);});});}exports[_0xa015('0x1c')]=function(_0x39d734){var _0x35dafe=this;return new Promise(function(_0x49215d,_0x449691){return db[_0xa015('0x1d')][_0xa015('0x1e')](_0x39d734[_0xa015('0x1f')],{'raw':_0x39d734[_0xa015('0x20')]?_0x39d734[_0xa015('0x20')][_0xa015('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x41a668){logger['info'](_0xa015('0x1c'),_0x39d734);logger[_0xa015('0x15')]('CreateWhatsappMessage',_0x39d734,JSON[_0xa015('0x17')](_0x41a668));_0x49215d(_0x41a668);})[_0xa015('0x1b')](function(_0x3929d0){logger[_0xa015('0x18')](_0xa015('0x1c'),_0x3929d0[_0xa015('0x1a')],_0x39d734);_0x449691(_0x35dafe[_0xa015('0x18')](0x1f4,_0x3929d0[_0xa015('0x1a')]));});});}; \ No newline at end of file +var _0xbe15=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','stringify'];(function(_0x5d134a,_0x4b5947){var _0x21b910=function(_0x47a02c){while(--_0x47a02c){_0x5d134a['push'](_0x5d134a['shift']());}};_0x21b910(++_0x4b5947);}(_0xbe15,0x154));var _0x5be1=function(_0x38e0d8,_0x757289){_0x38e0d8=_0x38e0d8-0x0;var _0x126771=_0xbe15[_0x38e0d8];return _0x126771;};'use strict';var _=require(_0x5be1('0x0'));var util=require(_0x5be1('0x1'));var moment=require('moment');var BPromise=require(_0x5be1('0x2'));var rs=require(_0x5be1('0x3'));var fs=require('fs');var Redis=require(_0x5be1('0x4'));var db=require(_0x5be1('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5be1('0x6'));var config=require(_0x5be1('0x7'));var jayson=require(_0x5be1('0x8'));var client=jayson[_0x5be1('0x9')][_0x5be1('0xa')]({'port':0x232a});config['redis']=_[_0x5be1('0xb')](config[_0x5be1('0xc')],{'host':_0x5be1('0xd'),'port':0x18eb});var socket=require(_0x5be1('0xe'))(new Redis(config[_0x5be1('0xc')]));require(_0x5be1('0xf'))[_0x5be1('0x10')](socket);function respondWithRpcPromise(_0x2d910e,_0x1ea304,_0x34b1d5){return new BPromise(function(_0x492ef2,_0x2f3689){return client[_0x5be1('0x11')](_0x2d910e,_0x34b1d5)[_0x5be1('0x12')](function(_0x206958){logger[_0x5be1('0x13')](_0x5be1('0x14'),_0x1ea304,_0x5be1('0x15'));logger[_0x5be1('0x16')](_0x5be1('0x17'),_0x1ea304,_0x5be1('0x15'),JSON['stringify'](_0x206958));if(_0x206958[_0x5be1('0x18')]){if(_0x206958['error'][_0x5be1('0x19')]===0x1f4){logger[_0x5be1('0x18')](_0x5be1('0x14'),_0x1ea304,_0x206958['error'][_0x5be1('0x1a')]);return _0x2f3689(_0x206958[_0x5be1('0x18')][_0x5be1('0x1a')]);}logger[_0x5be1('0x18')](_0x5be1('0x14'),_0x1ea304,_0x206958[_0x5be1('0x18')]['message']);return _0x492ef2(_0x206958['error'][_0x5be1('0x1a')]);}else{logger[_0x5be1('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x1ea304,_0x5be1('0x15'));_0x492ef2(_0x206958[_0x5be1('0x1b')][_0x5be1('0x1a')]);}})[_0x5be1('0x1c')](function(_0x5154c1){logger[_0x5be1('0x18')](_0x5be1('0x14'),_0x1ea304,_0x5154c1);_0x2f3689(_0x5154c1);});});}exports[_0x5be1('0x1d')]=function(_0x2f2a3a){var _0xe4f5c2=this;return new Promise(function(_0x194ab5,_0x177c32){return db[_0x5be1('0x1e')][_0x5be1('0x1f')](_0x2f2a3a['body'],{'raw':_0x2f2a3a[_0x5be1('0x20')]?_0x2f2a3a[_0x5be1('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x5be1('0x12')](function(_0x228a87){logger[_0x5be1('0x13')](_0x5be1('0x1d'),_0x2f2a3a);logger[_0x5be1('0x16')]('CreateWhatsappMessage',_0x2f2a3a,JSON[_0x5be1('0x21')](_0x228a87));_0x194ab5(_0x228a87);})['catch'](function(_0x410997){logger[_0x5be1('0x18')](_0x5be1('0x1d'),_0x410997[_0x5be1('0x1a')],_0x2f2a3a);_0x177c32(_0xe4f5c2['error'](0x1f4,_0x410997[_0x5be1('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index fbd4d9f..ca402d8 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 _0x67ab=['./whatsappMessage.events','save','remove','update','emit','removeListener','register','length','whatsappMessage:'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x67ab,0x90));var _0xb67a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x67ab[_0x167cc1];return _0x10bc4b;};'use strict';var WhatsappMessageEvents=require(_0xb67a('0x0'));var events=[_0xb67a('0x1'),_0xb67a('0x2'),_0xb67a('0x3')];function createListener(_0x55a1db,_0x2e2e7a){return function(_0x16b7bf){_0x2e2e7a[_0xb67a('0x4')](_0x55a1db,_0x16b7bf);};}function removeListener(_0x578954,_0x17a220){return function(){WhatsappMessageEvents[_0xb67a('0x5')](_0x578954,_0x17a220);};}exports[_0xb67a('0x6')]=function(_0x671a61){for(var _0x49fb03=0x0,_0x2b38d6=events[_0xb67a('0x7')];_0x49fb03<_0x2b38d6;_0x49fb03++){var _0x3a4e63=events[_0x49fb03];var _0x45e99f=createListener(_0xb67a('0x8')+_0x3a4e63,_0x671a61);WhatsappMessageEvents['on'](_0x3a4e63,_0x45e99f);}}; \ No newline at end of file +var _0x23d3=['remove','emit','register','whatsappMessage:','./whatsappMessage.events','save'];(function(_0xb0b922,_0x183826){var _0x5dc41e=function(_0x461183){while(--_0x461183){_0xb0b922['push'](_0xb0b922['shift']());}};_0x5dc41e(++_0x183826);}(_0x23d3,0xe8));var _0x323d=function(_0x5901dc,_0x31dba4){_0x5901dc=_0x5901dc-0x0;var _0x36d5dd=_0x23d3[_0x5901dc];return _0x36d5dd;};'use strict';var WhatsappMessageEvents=require(_0x323d('0x0'));var events=[_0x323d('0x1'),_0x323d('0x2'),'update'];function createListener(_0x2401c5,_0x106782){return function(_0x231c35){_0x106782[_0x323d('0x3')](_0x2401c5,_0x231c35);};}function removeListener(_0xeb2e57,_0x3ab786){return function(){WhatsappMessageEvents['removeListener'](_0xeb2e57,_0x3ab786);};}exports[_0x323d('0x4')]=function(_0x34f513){for(var _0x160a18=0x0,_0x1057c2=events['length'];_0x160a18<_0x1057c2;_0x160a18++){var _0xbcfbc9=events[_0x160a18];var _0x380ae6=createListener(_0x323d('0x5')+_0xbcfbc9,_0x34f513);WhatsappMessageEvents['on'](_0xbcfbc9,_0x380ae6);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 02b2c6f..b1f24b8 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 _0xade1=['post','create','/:id/teams','/:id/users','addAgents','put','update','delete','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','describe','/:id','/:id/members','getTeams','getAgents'];(function(_0x3f9949,_0x2e7864){var _0x3f6ca1=function(_0xc2b891){while(--_0xc2b891){_0x3f9949['push'](_0x3f9949['shift']());}};_0x3f6ca1(++_0x2e7864);}(_0xade1,0x1cc));var _0x1ade=function(_0x38273b,_0x59b295){_0x38273b=_0x38273b-0x0;var _0x3c932e=_0xade1[_0x38273b];return _0x3c932e;};'use strict';var multer=require(_0x1ade('0x0'));var util=require(_0x1ade('0x1'));var path=require('path');var timeout=require(_0x1ade('0x2'));var express=require(_0x1ade('0x3'));var router=express[_0x1ade('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x1ade('0x5'));var config=require(_0x1ade('0x6'));var controller=require(_0x1ade('0x7'));router[_0x1ade('0x8')]('/',auth[_0x1ade('0x9')](),controller['index']);router[_0x1ade('0x8')]('/describe',auth[_0x1ade('0x9')](),controller[_0x1ade('0xa')]);router[_0x1ade('0x8')](_0x1ade('0xb'),auth[_0x1ade('0x9')](),controller['show']);router[_0x1ade('0x8')](_0x1ade('0xc'),auth[_0x1ade('0x9')](),controller['getMembers']);router['get']('/:id/teams',auth[_0x1ade('0x9')](),controller[_0x1ade('0xd')]);router[_0x1ade('0x8')]('/:id/users',auth[_0x1ade('0x9')](),controller[_0x1ade('0xe')]);router[_0x1ade('0xf')]('/',auth[_0x1ade('0x9')](),controller[_0x1ade('0x10')]);router[_0x1ade('0xf')](_0x1ade('0x11'),auth[_0x1ade('0x9')](),controller['addTeams']);router['post'](_0x1ade('0x12'),auth[_0x1ade('0x9')](),controller[_0x1ade('0x13')]);router[_0x1ade('0x14')](_0x1ade('0xb'),auth['isAuthenticated'](),controller[_0x1ade('0x15')]);router[_0x1ade('0x16')](_0x1ade('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x1ade('0x16')](_0x1ade('0x11'),auth[_0x1ade('0x9')](),controller['removeTeams']);router[_0x1ade('0x16')](_0x1ade('0x12'),auth[_0x1ade('0x9')](),controller[_0x1ade('0x17')]);module[_0x1ade('0x18')]=router; \ No newline at end of file +var _0x5124=['/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy','exports','util','path','../../config/environment','./whatsappQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers'];(function(_0x18a211,_0x4c1d06){var _0x63e05c=function(_0x3b66e8){while(--_0x3b66e8){_0x18a211['push'](_0x18a211['shift']());}};_0x63e05c(++_0x4c1d06);}(_0x5124,0xd4));var _0x4512=function(_0xec038b,_0x398617){_0xec038b=_0xec038b-0x0;var _0x472325=_0x5124[_0xec038b];return _0x472325;};'use strict';var multer=require('multer');var util=require(_0x4512('0x0'));var path=require(_0x4512('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4512('0x2'));var controller=require(_0x4512('0x3'));router[_0x4512('0x4')]('/',auth['isAuthenticated'](),controller[_0x4512('0x5')]);router[_0x4512('0x4')](_0x4512('0x6'),auth[_0x4512('0x7')](),controller[_0x4512('0x8')]);router[_0x4512('0x4')](_0x4512('0x9'),auth[_0x4512('0x7')](),controller[_0x4512('0xa')]);router['get'](_0x4512('0xb'),auth['isAuthenticated'](),controller[_0x4512('0xc')]);router['get'](_0x4512('0xd'),auth['isAuthenticated'](),controller[_0x4512('0xe')]);router[_0x4512('0x4')](_0x4512('0xf'),auth[_0x4512('0x7')](),controller[_0x4512('0x10')]);router[_0x4512('0x11')]('/',auth[_0x4512('0x7')](),controller[_0x4512('0x12')]);router[_0x4512('0x11')]('/:id/teams',auth[_0x4512('0x7')](),controller[_0x4512('0x13')]);router[_0x4512('0x11')]('/:id/users',auth[_0x4512('0x7')](),controller[_0x4512('0x14')]);router['put'](_0x4512('0x9'),auth[_0x4512('0x7')](),controller[_0x4512('0x15')]);router[_0x4512('0x16')](_0x4512('0x9'),auth['isAuthenticated'](),controller[_0x4512('0x17')]);router[_0x4512('0x16')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x4512('0x16')]('/:id/users',auth[_0x4512('0x7')](),controller['removeAgents']);module[_0x4512('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 5807bd7..9e1e431 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 _0x5328=['STRING','sequelize','exports','name','ENUM','rrmemory','beepall'];(function(_0xf93899,_0x5e711e){var _0x7ff397=function(_0x173a22){while(--_0x173a22){_0xf93899['push'](_0xf93899['shift']());}};_0x7ff397(++_0x5e711e);}(_0x5328,0x174));var _0x8532=function(_0x3ffd28,_0x146997){_0x3ffd28=_0x3ffd28-0x0;var _0x357c22=_0x5328[_0x3ffd28];return _0x357c22;};'use strict';var Sequelize=require(_0x8532('0x0'));module[_0x8532('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8532('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8532('0x3')](_0x8532('0x4'),_0x8532('0x5'),'roundrobin')},'description':{'type':Sequelize[_0x8532('0x6')]}}; \ No newline at end of file +var _0x1c12=['beepall','roundrobin','STRING','sequelize','exports','name','INTEGER'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1c12,0xa4));var _0x21c1=function(_0xcfa1f0,_0x47158b){_0xcfa1f0=_0xcfa1f0-0x0;var _0x3434f0=_0x1c12[_0xcfa1f0];return _0x3434f0;};'use strict';var Sequelize=require(_0x21c1('0x0'));module[_0x21c1('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x21c1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x21c1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x21c1('0x4'),_0x21c1('0x5'))},'description':{'type':Sequelize[_0x21c1('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 9bd2688..bc909a9 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 _0xb344=['options','count','includeAll','include','rows','catch','show','params','intersection','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','describe','getMembers','findOne','findAll','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','transaction','findOrCreate','emit','userWhatsappQueue:save','select','field','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','every','includes','union','compact','value','removeTeams','forEach','addAgents','spread','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','status','end','json','offset','limit','set','Content-Range','save','update','then','get','WhatsappQueues','destroy','sendStatus','error','stack','name','send','index','WhatsappQueue','rawAttributes','fieldName','type','key','query','keys','filters','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL'];(function(_0x2e0ed3,_0x5cb8d8){var _0x190996=function(_0x35cc55){while(--_0x35cc55){_0x2e0ed3['push'](_0x2e0ed3['shift']());}};_0x190996(++_0x5cb8d8);}(_0xb344,0x152));var _0x4b34=function(_0x2b66ed,_0x3ece7f){_0x2b66ed=_0x2b66ed-0x0;var _0x860fe6=_0xb344[_0x2b66ed];return _0x860fe6;};'use strict';var pdf=require(_0x4b34('0x0'));var emlformat=require(_0x4b34('0x1'));var rimraf=require(_0x4b34('0x2'));var zipdir=require(_0x4b34('0x3'));var jsonpatch=require(_0x4b34('0x4'));var rp=require(_0x4b34('0x5'));var moment=require(_0x4b34('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x4b34('0x7'));var util=require(_0x4b34('0x8'));var path=require(_0x4b34('0x9'));var sox=require('sox');var csv=require(_0x4b34('0xa'));var ejs=require(_0x4b34('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4b34('0xc'));var crypto=require('crypto');var jsforce=require(_0x4b34('0xd'));var deskjs=require(_0x4b34('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4b34('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4b34('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4b34('0x11'));var config=require(_0x4b34('0x12'));var db=require(_0x4b34('0x13'))['db'];config[_0x4b34('0x14')]=_[_0x4b34('0x15')](config[_0x4b34('0x14')],{'host':_0x4b34('0x16'),'port':0x18eb});var socket=require(_0x4b34('0x17'))(new Redis(config[_0x4b34('0x14')]));require(_0x4b34('0x18'))[_0x4b34('0x19')](socket);function respondWithStatusCode(_0x4816c6,_0x13ce7c){_0x13ce7c=_0x13ce7c||0xcc;return function(_0xfb6f8c){if(_0xfb6f8c){return _0x4816c6['sendStatus'](_0x13ce7c);}return _0x4816c6[_0x4b34('0x1a')](_0x13ce7c)[_0x4b34('0x1b')]();};}function respondWithResult(_0x4a9f83,_0x4c2681){_0x4c2681=_0x4c2681||0xc8;return function(_0x7be24d){if(_0x7be24d){return _0x4a9f83[_0x4b34('0x1a')](_0x4c2681)[_0x4b34('0x1c')](_0x7be24d);}};}function respondWithFilteredResult(_0xa75657,_0x11c675){return function(_0x47fb36){if(_0x47fb36){var _0x558485=_0x47fb36['count'],_0x5d055d=_0x11c675[_0x4b34('0x1d')],_0x2dbab0=_0x11c675[_0x4b34('0x1d')]+_0x11c675[_0x4b34('0x1e')],_0xcec619;if(_0x2dbab0>=_0x558485){_0x2dbab0=_0x558485;_0xcec619=0xc8;}else{_0xcec619=0xce;}_0xa75657[_0x4b34('0x1a')](_0xcec619);return _0xa75657[_0x4b34('0x1f')](_0x4b34('0x20'),_0x5d055d+'-'+_0x2dbab0+'/'+_0x558485)[_0x4b34('0x1c')](_0x47fb36);}return null;};}function patchUpdates(_0x5202c2){return function(_0x530f33){try{jsonpatch['apply'](_0x530f33,_0x5202c2,!![]);}catch(_0x19a8d7){return BPromise['reject'](_0x19a8d7);}return _0x530f33[_0x4b34('0x21')]();};}function saveUpdates(_0x18931f,_0x5c4bb4){return function(_0xca76e2){if(_0xca76e2){return _0xca76e2[_0x4b34('0x22')](_0x18931f)[_0x4b34('0x23')](function(_0x1fb5b3){return _0x1fb5b3;});}return null;};}function removeEntity(_0x1d88b4,_0x3bcba1){return function(_0x11b32f){if(_0x11b32f){return _0x11b32f['destroy']()[_0x4b34('0x23')](function(){var _0x239a6a=_0x11b32f[_0x4b34('0x24')]({'plain':!![]});var _0x22cdf1=_0x4b34('0x25');return db['UserProfileResource'][_0x4b34('0x26')]({'where':{'type':_0x22cdf1,'resourceId':_0x239a6a['id']}})[_0x4b34('0x23')](function(){return _0x11b32f;});})[_0x4b34('0x23')](function(){_0x1d88b4[_0x4b34('0x1a')](0xcc)[_0x4b34('0x1b')]();});}};}function handleEntityNotFound(_0xc49f85,_0x2144a2){return function(_0x17a290){if(!_0x17a290){_0xc49f85[_0x4b34('0x27')](0x194);}return _0x17a290;};}function handleError(_0x3f3da0,_0x1a02aa){_0x1a02aa=_0x1a02aa||0x1f4;return function(_0x462e0a){logger[_0x4b34('0x28')](_0x462e0a[_0x4b34('0x29')]);if(_0x462e0a['name']){delete _0x462e0a[_0x4b34('0x2a')];}_0x3f3da0[_0x4b34('0x1a')](_0x1a02aa)[_0x4b34('0x2b')](_0x462e0a);};}exports[_0x4b34('0x2c')]=function(_0xa37c30,_0x155010){var _0x22c659={},_0xb875e7={},_0x473d73={'count':0x0,'rows':[]};var _0x28133b=_['map'](db[_0x4b34('0x2d')][_0x4b34('0x2e')],function(_0x496d2c){return{'name':_0x496d2c[_0x4b34('0x2f')],'type':_0x496d2c[_0x4b34('0x30')][_0x4b34('0x31')]};});_0xb875e7['model']=_['map'](_0x28133b,_0x4b34('0x2a'));_0xb875e7[_0x4b34('0x32')]=_[_0x4b34('0x33')](_0xa37c30[_0x4b34('0x32')]);_0xb875e7[_0x4b34('0x34')]=_['intersection'](_0xb875e7['model'],_0xb875e7[_0x4b34('0x32')]);_0x22c659[_0x4b34('0x35')]=_['intersection'](_0xb875e7[_0x4b34('0x36')],qs[_0x4b34('0x37')](_0xa37c30[_0x4b34('0x32')][_0x4b34('0x37')]));_0x22c659['attributes']=_0x22c659[_0x4b34('0x35')][_0x4b34('0x38')]?_0x22c659['attributes']:_0xb875e7[_0x4b34('0x36')];if(!_0xa37c30[_0x4b34('0x32')][_0x4b34('0x39')](_0x4b34('0x3a'))){_0x22c659[_0x4b34('0x1e')]=qs[_0x4b34('0x1e')](_0xa37c30[_0x4b34('0x32')][_0x4b34('0x1e')]);_0x22c659[_0x4b34('0x1d')]=qs[_0x4b34('0x1d')](_0xa37c30[_0x4b34('0x32')][_0x4b34('0x1d')]);}_0x22c659[_0x4b34('0x3b')]=qs[_0x4b34('0x3c')](_0xa37c30[_0x4b34('0x32')][_0x4b34('0x3c')]);_0x22c659[_0x4b34('0x3d')]=qs['filters'](_[_0x4b34('0x3e')](_0xa37c30[_0x4b34('0x32')],_0xb875e7[_0x4b34('0x34')]),_0x28133b);if(_0xa37c30[_0x4b34('0x32')][_0x4b34('0x3f')]){_0x22c659[_0x4b34('0x3d')]=_[_0x4b34('0x40')](_0x22c659['where'],{'$or':_[_0x4b34('0x41')](_0x28133b,function(_0x205567){if(_0x205567[_0x4b34('0x30')]!==_0x4b34('0x42')){var _0x1bc2b1={};_0x1bc2b1[_0x205567[_0x4b34('0x2a')]]={'$like':'%'+_0xa37c30[_0x4b34('0x32')][_0x4b34('0x3f')]+'%'};return _0x1bc2b1;}})});}_0x22c659=_[_0x4b34('0x40')]({},_0x22c659,_0xa37c30[_0x4b34('0x43')]);var _0x315ff5={'where':_0x22c659[_0x4b34('0x3d')]};return db[_0x4b34('0x2d')][_0x4b34('0x44')](_0x315ff5)[_0x4b34('0x23')](function(_0x50df9b){_0x473d73[_0x4b34('0x44')]=_0x50df9b;if(_0xa37c30[_0x4b34('0x32')][_0x4b34('0x45')]){_0x22c659[_0x4b34('0x46')]=[{'all':!![]}];}return db[_0x4b34('0x2d')]['findAll'](_0x22c659);})[_0x4b34('0x23')](function(_0x2f0384){_0x473d73[_0x4b34('0x47')]=_0x2f0384;return _0x473d73;})[_0x4b34('0x23')](respondWithFilteredResult(_0x155010,_0x22c659))[_0x4b34('0x48')](handleError(_0x155010,null));};exports[_0x4b34('0x49')]=function(_0x322b15,_0x3d29eb){var _0x4f9eee={'raw':!![],'where':{'id':_0x322b15[_0x4b34('0x4a')]['id']}},_0x1a9c93={};_0x1a9c93[_0x4b34('0x36')]=_[_0x4b34('0x33')](db[_0x4b34('0x2d')][_0x4b34('0x2e')]);_0x1a9c93['query']=_['keys'](_0x322b15[_0x4b34('0x32')]);_0x1a9c93['filters']=_['intersection'](_0x1a9c93[_0x4b34('0x36')],_0x1a9c93['query']);_0x4f9eee[_0x4b34('0x35')]=_[_0x4b34('0x4b')](_0x1a9c93[_0x4b34('0x36')],qs[_0x4b34('0x37')](_0x322b15['query'][_0x4b34('0x37')]));_0x4f9eee[_0x4b34('0x35')]=_0x4f9eee[_0x4b34('0x35')][_0x4b34('0x38')]?_0x4f9eee[_0x4b34('0x35')]:_0x1a9c93[_0x4b34('0x36')];if(_0x322b15[_0x4b34('0x32')][_0x4b34('0x45')]){_0x4f9eee[_0x4b34('0x46')]=[{'all':!![]}];}_0x4f9eee=_[_0x4b34('0x40')]({},_0x4f9eee,_0x322b15[_0x4b34('0x43')]);return db[_0x4b34('0x2d')][_0x4b34('0x4c')](_0x4f9eee)[_0x4b34('0x23')](handleEntityNotFound(_0x3d29eb,null))['then'](respondWithResult(_0x3d29eb,null))[_0x4b34('0x48')](handleError(_0x3d29eb,null));};exports['create']=function(_0x2367ef,_0x1879b5){return db[_0x4b34('0x2d')]['create'](_0x2367ef[_0x4b34('0x4d')],{})[_0x4b34('0x23')](function(_0x355170){var _0x26b7ba=_0x2367ef[_0x4b34('0x4e')][_0x4b34('0x24')]({'plain':!![]});if(!_0x26b7ba)throw new Error(_0x4b34('0x4f'));if(_0x26b7ba[_0x4b34('0x50')]==='user'){var _0x394851=_0x355170['get']({'plain':!![]});var _0x163f1e=_0x4b34('0x25');return db[_0x4b34('0x51')][_0x4b34('0x4c')]({'where':{'name':_0x163f1e,'userProfileId':_0x26b7ba[_0x4b34('0x52')]},'raw':!![]})[_0x4b34('0x23')](function(_0x19ca8c){if(_0x19ca8c&&_0x19ca8c[_0x4b34('0x53')]===0x0){return db[_0x4b34('0x54')][_0x4b34('0x55')]({'name':_0x394851[_0x4b34('0x2a')],'resourceId':_0x394851['id'],'type':_0x19ca8c['name'],'sectionId':_0x19ca8c['id']},{})[_0x4b34('0x23')](function(){return _0x355170;});}else{return _0x355170;}})[_0x4b34('0x48')](function(_0x3fe422){logger[_0x4b34('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fe422);throw _0x3fe422;});}return _0x355170;})[_0x4b34('0x23')](respondWithResult(_0x1879b5,0xc9))['catch'](handleError(_0x1879b5,null));};exports[_0x4b34('0x22')]=function(_0x1fc90c,_0x237030){if(_0x1fc90c[_0x4b34('0x4d')]['id']){delete _0x1fc90c[_0x4b34('0x4d')]['id'];}return db[_0x4b34('0x2d')]['find']({'where':{'id':_0x1fc90c[_0x4b34('0x4a')]['id']}})[_0x4b34('0x23')](handleEntityNotFound(_0x237030,null))[_0x4b34('0x23')](saveUpdates(_0x1fc90c[_0x4b34('0x4d')],null))[_0x4b34('0x23')](respondWithResult(_0x237030,null))['catch'](handleError(_0x237030,null));};exports['destroy']=function(_0x2ef86b,_0xdef387){return db['WhatsappQueue'][_0x4b34('0x4c')]({'where':{'id':_0x2ef86b[_0x4b34('0x4a')]['id']}})[_0x4b34('0x23')](handleEntityNotFound(_0xdef387,null))['then'](removeEntity(_0xdef387,null))[_0x4b34('0x48')](handleError(_0xdef387,null));};exports['describe']=function(_0x191173,_0x353671){return db[_0x4b34('0x2d')][_0x4b34('0x56')]()['then'](respondWithResult(_0x353671,null))[_0x4b34('0x48')](handleError(_0x353671,null));};exports[_0x4b34('0x57')]=function(_0x9ab55b,_0x17ec7a,_0x418726){var _0x5ed429={'raw':!![],'where':{}},_0x2933e8={},_0x26690a;return db[_0x4b34('0x2d')][_0x4b34('0x58')]({'where':{'id':_0x9ab55b[_0x4b34('0x4a')]['id']}})[_0x4b34('0x23')](handleEntityNotFound(_0x17ec7a,null))[_0x4b34('0x23')](function(_0x11a697){if(_0x11a697){_0x26690a=_0x11a697[_0x4b34('0x24')]({'plain':!![]});_0x2933e8[_0x4b34('0x36')]=_[_0x4b34('0x33')](db['UserWhatsappQueue'][_0x4b34('0x2e')]);_0x2933e8[_0x4b34('0x32')]=_[_0x4b34('0x33')](_0x9ab55b['query']);_0x2933e8[_0x4b34('0x34')]=_[_0x4b34('0x4b')](_0x2933e8[_0x4b34('0x36')],_0x2933e8[_0x4b34('0x32')]);_0x5ed429[_0x4b34('0x35')]=_['intersection'](_0x2933e8[_0x4b34('0x36')],qs[_0x4b34('0x37')](_0x9ab55b[_0x4b34('0x32')][_0x4b34('0x37')]));_0x5ed429[_0x4b34('0x35')]=_0x5ed429[_0x4b34('0x35')][_0x4b34('0x38')]?_0x5ed429['attributes']:_0x2933e8[_0x4b34('0x36')];if(!_0x9ab55b[_0x4b34('0x32')][_0x4b34('0x39')](_0x4b34('0x3a'))){_0x5ed429[_0x4b34('0x1e')]=qs[_0x4b34('0x1e')](_0x9ab55b['query'][_0x4b34('0x1e')]);_0x5ed429[_0x4b34('0x1d')]=qs['offset'](_0x9ab55b['query'][_0x4b34('0x1d')]);}_0x5ed429[_0x4b34('0x3b')]=qs[_0x4b34('0x3c')](_0x9ab55b[_0x4b34('0x32')][_0x4b34('0x3c')]);_0x5ed429['where']=qs[_0x4b34('0x34')](_[_0x4b34('0x3e')](_0x9ab55b[_0x4b34('0x32')],_0x2933e8[_0x4b34('0x34')]));_0x5ed429[_0x4b34('0x3d')]['WhatsappQueueId']=_0x11a697['id'];if(_0x9ab55b[_0x4b34('0x32')][_0x4b34('0x3f')]){_0x5ed429[_0x4b34('0x3d')]=_['merge'](_0x5ed429[_0x4b34('0x3d')],{'$or':_['map'](_0x5ed429[_0x4b34('0x35')],function(_0x40b802){var _0x8906af={};_0x8906af[_0x40b802]={'$like':'%'+_0x9ab55b[_0x4b34('0x32')][_0x4b34('0x3f')]+'%'};return _0x8906af;})});}_0x5ed429=_[_0x4b34('0x40')]({},_0x5ed429,_0x9ab55b[_0x4b34('0x43')]);return db['UserWhatsappQueue'][_0x4b34('0x59')](_0x5ed429);}})[_0x4b34('0x23')](function(_0x304a67){if(_0x304a67){return db[_0x4b34('0x5a')][_0x4b34('0x5b')]({'where':{'id':_[_0x4b34('0x41')](_0x304a67,_0x4b34('0x5c')),'role':_0x4b34('0x5d')},'attributes':['id',_0x4b34('0x2a'),'whatsappPause','updatedAt',_0x4b34('0x5e')]});}})[_0x4b34('0x23')](function(_0x15833b){if(_0x15833b){return{'count':_0x15833b['count'],'rows':_['map'](_0x15833b[_0x4b34('0x47')],function(_0x54fb44){return{'membername':_0x54fb44[_0x4b34('0x2a')],'UserId':_0x54fb44['id'],'queue_name':_0x26690a[_0x4b34('0x2a')],'WhatsappQueueId':_0x26690a['id'],'interface':util[_0x4b34('0x5f')](_0x4b34('0x60'),_0x4b34('0x61'),_0x54fb44[_0x4b34('0x2a')]),'penalty':0x0,'paused':_0x54fb44['whatsappPause'],'createdAt':_0x54fb44[_0x4b34('0x5e')],'updatedAt':_0x54fb44[_0x4b34('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4b34('0x23')](respondWithFilteredResult(_0x17ec7a,_0x5ed429))[_0x4b34('0x48')](handleError(_0x17ec7a,null));};exports[_0x4b34('0x63')]=function(_0x172be6,_0x5f1b6b,_0x5dd838){var _0x510fc7={};var _0x1bd54a={};var _0x148aa8;var _0x159e4d;return db['WhatsappQueue']['findOne']({'where':{'id':_0x172be6[_0x4b34('0x4a')]['id']}})[_0x4b34('0x23')](handleEntityNotFound(_0x5f1b6b,null))[_0x4b34('0x23')](function(_0x29a2d4){if(_0x29a2d4){_0x148aa8=_0x29a2d4;_0x1bd54a[_0x4b34('0x36')]=_[_0x4b34('0x33')](db['Team'][_0x4b34('0x2e')]);_0x1bd54a[_0x4b34('0x32')]=_[_0x4b34('0x33')](_0x172be6[_0x4b34('0x32')]);_0x1bd54a[_0x4b34('0x34')]=_[_0x4b34('0x4b')](_0x1bd54a[_0x4b34('0x36')],_0x1bd54a['query']);_0x510fc7['attributes']=_[_0x4b34('0x4b')](_0x1bd54a['model'],qs[_0x4b34('0x37')](_0x172be6[_0x4b34('0x32')]['fields']));_0x510fc7['attributes']=_0x510fc7[_0x4b34('0x35')]['length']?_0x510fc7[_0x4b34('0x35')]:_0x1bd54a[_0x4b34('0x36')];_0x510fc7[_0x4b34('0x3b')]=qs[_0x4b34('0x3c')](_0x172be6[_0x4b34('0x32')][_0x4b34('0x3c')]);_0x510fc7[_0x4b34('0x3d')]=qs[_0x4b34('0x34')](_['pick'](_0x172be6['query'],_0x1bd54a['filters']));if(_0x172be6[_0x4b34('0x32')][_0x4b34('0x3f')]){_0x510fc7[_0x4b34('0x3d')]=_[_0x4b34('0x40')](_0x510fc7[_0x4b34('0x3d')],{'$or':_[_0x4b34('0x41')](_0x510fc7[_0x4b34('0x35')],function(_0x28954e){var _0x31c063={};_0x31c063[_0x28954e]={'$like':'%'+_0x172be6[_0x4b34('0x32')][_0x4b34('0x3f')]+'%'};return _0x31c063;})});}_0x510fc7=_[_0x4b34('0x40')]({},_0x510fc7,_0x172be6['options']);return _0x148aa8['getTeams'](_0x510fc7);}})[_0x4b34('0x23')](function(_0x1cd6bf){if(_0x1cd6bf){_0x159e4d=_0x1cd6bf[_0x4b34('0x38')];if(!_0x172be6[_0x4b34('0x32')][_0x4b34('0x39')](_0x4b34('0x3a'))){_0x510fc7[_0x4b34('0x1e')]=qs[_0x4b34('0x1e')](_0x172be6[_0x4b34('0x32')][_0x4b34('0x1e')]);_0x510fc7['offset']=qs[_0x4b34('0x1d')](_0x172be6['query'][_0x4b34('0x1d')]);}return _0x148aa8[_0x4b34('0x63')](_0x510fc7);}})[_0x4b34('0x23')](function(_0x4e5676){if(_0x4e5676){return _0x4e5676?{'count':_0x159e4d,'rows':_0x4e5676}:null;}})[_0x4b34('0x23')](respondWithResult(_0x5f1b6b,null))[_0x4b34('0x48')](handleError(_0x5f1b6b,null));};exports[_0x4b34('0x64')]=function(_0x11b2bb,_0x1e20ab,_0x295a59){var _0x52d248=_0x11b2bb['body'][_0x4b34('0x65')];return db[_0x4b34('0x66')][_0x4b34('0x59')]({'where':{'id':_0x52d248},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4b34('0x67'),'attributes':['id',_0x4b34('0x2a'),_0x4b34('0x68'),_0x4b34('0x69'),_0x4b34('0x6a')],'raw':!![]}]})['then'](function(_0x56cc9c){if(_0x56cc9c){var _0x2e0007=_['flatMap'](_0x56cc9c,function(_0x5f5415){var _0x3f8163=_0x5f5415[_0x4b34('0x24')]({'plain':!![]});return _0x3f8163[_0x4b34('0x67')];});return db[_0x4b34('0x2d')][_0x4b34('0x4c')]({'where':{'id':_0x11b2bb[_0x4b34('0x4a')]['id']}})[_0x4b34('0x23')](function(_0x46cf83){return db['sequelize'][_0x4b34('0x6b')](function(_0x26855c){return _0x46cf83['addTeams'](_0x52d248,{'transaction':_0x26855c})[_0x4b34('0x23')](function(){return BPromise['each'](_0x2e0007,function(_0x5b362b){return db['UserWhatsappQueue'][_0x4b34('0x6c')]({'where':{'UserId':_0x5b362b['id'],'WhatsappQueueId':_0x11b2bb[_0x4b34('0x4a')]['id']},'transaction':_0x26855c});});})['then'](function(){_0x2e0007['forEach'](function(_0x22f363){socket[_0x4b34('0x6d')](_0x4b34('0x6e'),{'UserId':_0x22f363['id'],'WhatsappQueueId':_0x46cf83['id']});});});});});}})[_0x4b34('0x23')](respondWithStatusCode(_0x1e20ab,null))[_0x4b34('0x48')](handleError(_0x1e20ab,null));};exports['removeTeams']=function(_0x5f2ea4,_0x4bb7c4,_0x5a28de){return db[_0x4b34('0x66')][_0x4b34('0x59')]({'where':{'id':_0x5f2ea4[_0x4b34('0x32')]['ids']},'attributes':['id'],'include':[{'model':db[_0x4b34('0x5a')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x4b34('0x23')](handleEntityNotFound(_0x4bb7c4,null))[_0x4b34('0x23')](function(_0x367494){var _0x53c37c=_['map'](_0x367494,'id');var _0x128a06=[];var _0xe6bf8a=[];var _0x4ac0f7=squel[_0x4b34('0x6f')]();_0x4ac0f7[_0x4b34('0x70')]('tq.TeamId')[_0x4b34('0x71')](_0x4b34('0x72'),'tq')[_0x4b34('0x73')](_0x4b34('0x74'),'ut',_0x4b34('0x75'))[_0x4b34('0x3d')](_0x4b34('0x76'),_0x5f2ea4[_0x4b34('0x4a')]['id']);for(var _0x1d870c=0x0;_0x1d870c<_0x367494[_0x4b34('0x38')];_0x1d870c+=0x1){let _0x4a16d2=_0x367494[_0x1d870c];for(var _0x530c05=0x0;_0x530c05<_0x4a16d2['Agents']['length'];_0x530c05+=0x1){let _0x12f444=_0x4a16d2['Agents'][_0x530c05];var _0x3176f5=_0x4ac0f7[_0x4b34('0x77')]();_0x3176f5[_0x4b34('0x3d')](_0x4b34('0x78'),_0x12f444['id']);_0xe6bf8a[_0x4b34('0x79')](db[_0x4b34('0x7a')][_0x4b34('0x32')](_0x3176f5['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x4b34('0x23')](function(_0x316897){if(_0x316897[_0x4b34('0x38')]===0x1){return _0x12f444['id'];}else{var _0x232ec4=_[_0x4b34('0x7b')](_[_0x4b34('0x41')](_0x316897,'TeamId'),function(_0x5b9d71){return _[_0x4b34('0x7c')](_0x53c37c,_0x5b9d71);});if(_0x232ec4){return _0x12f444['id'];}}}));}}return BPromise['all'](_0xe6bf8a)[_0x4b34('0x23')](function(_0x527e2c){_0x128a06=_(_0x128a06)[_0x4b34('0x7d')](_0x527e2c)[_0x4b34('0x7e')]()[_0x4b34('0x7f')]();return db[_0x4b34('0x2d')][_0x4b34('0x4c')]({'where':{'id':_0x5f2ea4[_0x4b34('0x4a')]['id']}})[_0x4b34('0x23')](function(_0x3384d1){return db['sequelize'][_0x4b34('0x6b')](function(_0x349110){return _0x3384d1[_0x4b34('0x80')](_0x5f2ea4[_0x4b34('0x32')][_0x4b34('0x65')],{'transaction':_0x349110})['then'](function(){if(!_['isEmpty'](_0x128a06)){return _0x3384d1['removeAgents'](_0x128a06,{'transaction':_0x349110});}})[_0x4b34('0x23')](function(){_0x128a06[_0x4b34('0x81')](function(_0x4afbab){socket[_0x4b34('0x6d')]('userWhatsappQueue:remove',{'UserId':_0x4afbab,'WhatsappQueueId':_0x3384d1['id']});});});});});});})['then'](respondWithStatusCode(_0x4bb7c4,null))[_0x4b34('0x48')](handleError(_0x4bb7c4,null));};exports[_0x4b34('0x82')]=function(_0x5b1b3e,_0x9c3512,_0x3f8d77){return db[_0x4b34('0x2d')][_0x4b34('0x4c')]({'where':{'id':_0x5b1b3e['params']['id']}})[_0x4b34('0x23')](handleEntityNotFound(_0x9c3512,null))[_0x4b34('0x23')](function(_0x2eb6f4){if(_0x2eb6f4){return _0x2eb6f4[_0x4b34('0x82')](_0x5b1b3e[_0x4b34('0x4d')]['ids'],_['omit'](_0x5b1b3e['body'],[_0x4b34('0x65'),'id'])||{})[_0x4b34('0x83')](function(_0x3a7ea5){for(var _0x337674=0x0;_0x337674<_0x5b1b3e['body'][_0x4b34('0x65')]['length'];_0x337674+=0x1){socket['emit'](_0x4b34('0x6e'),{'UserId':_0x5b1b3e[_0x4b34('0x4d')][_0x4b34('0x65')][_0x337674],'WhatsappQueueId':_0x5b1b3e[_0x4b34('0x4a')]['id']});}return _0x3a7ea5;});}})['then'](respondWithResult(_0x9c3512,null))['catch'](handleError(_0x9c3512,null));};exports[_0x4b34('0x84')]=function(_0x51e5bf,_0xe509c8,_0x397342){return db[_0x4b34('0x2d')][_0x4b34('0x4c')]({'where':{'id':_0x51e5bf[_0x4b34('0x4a')]['id']}})[_0x4b34('0x23')](handleEntityNotFound(_0xe509c8,null))[_0x4b34('0x23')](function(_0x4a87e5){if(_0x4a87e5){return _0x4a87e5['removeAgents'](_0x51e5bf['query'][_0x4b34('0x65')])[_0x4b34('0x23')](function(){if(_[_0x4b34('0x85')](_0x51e5bf[_0x4b34('0x32')]['ids'])){for(var _0x37982f=0x0;_0x37982f<_0x51e5bf[_0x4b34('0x32')][_0x4b34('0x65')][_0x4b34('0x38')];_0x37982f+=0x1){socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x51e5bf[_0x4b34('0x32')][_0x4b34('0x65')][_0x37982f]),'WhatsappQueueId':Number(_0x51e5bf[_0x4b34('0x4a')]['id'])});}}else{socket[_0x4b34('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0x51e5bf[_0x4b34('0x32')][_0x4b34('0x65')]),'WhatsappQueueId':Number(_0x51e5bf['params']['id'])});}});}})[_0x4b34('0x23')](respondWithStatusCode(_0xe509c8,null))[_0x4b34('0x48')](handleError(_0xe509c8,null));};exports[_0x4b34('0x86')]=function(_0x5a8a7a,_0x749a48,_0x2f0b55){var _0xab8741={};var _0x14de52={};var _0x2b0094;var _0x2bd877;return db['WhatsappQueue'][_0x4b34('0x58')]({'where':{'id':_0x5a8a7a[_0x4b34('0x4a')]['id']}})[_0x4b34('0x23')](handleEntityNotFound(_0x749a48,null))[_0x4b34('0x23')](function(_0x13d3b0){if(_0x13d3b0){_0x2b0094=_0x13d3b0;_0x14de52[_0x4b34('0x36')]=_[_0x4b34('0x33')](db[_0x4b34('0x5a')]['rawAttributes']);_0x14de52[_0x4b34('0x32')]=_['keys'](_0x5a8a7a[_0x4b34('0x32')]);_0x14de52[_0x4b34('0x34')]=_[_0x4b34('0x4b')](_0x14de52[_0x4b34('0x36')],_0x14de52[_0x4b34('0x32')]);_0xab8741[_0x4b34('0x35')]=_[_0x4b34('0x4b')](_0x14de52['model'],qs[_0x4b34('0x37')](_0x5a8a7a[_0x4b34('0x32')][_0x4b34('0x37')]));_0xab8741[_0x4b34('0x35')]=_0xab8741[_0x4b34('0x35')][_0x4b34('0x38')]?_0xab8741[_0x4b34('0x35')]:_0x14de52[_0x4b34('0x36')];_0xab8741['order']=qs[_0x4b34('0x3c')](_0x5a8a7a[_0x4b34('0x32')][_0x4b34('0x3c')]);_0xab8741[_0x4b34('0x3d')]=qs[_0x4b34('0x34')](_[_0x4b34('0x3e')](_0x5a8a7a[_0x4b34('0x32')],_0x14de52[_0x4b34('0x34')]));if(_0x5a8a7a[_0x4b34('0x32')][_0x4b34('0x3f')]){_0xab8741[_0x4b34('0x3d')]=_[_0x4b34('0x40')](_0xab8741['where'],{'$or':_[_0x4b34('0x41')](_0xab8741[_0x4b34('0x35')],function(_0x253dd1){var _0x4c9afe={};_0x4c9afe[_0x253dd1]={'$like':'%'+_0x5a8a7a['query'][_0x4b34('0x3f')]+'%'};return _0x4c9afe;})});}_0xab8741=_[_0x4b34('0x40')]({},_0xab8741,_0x5a8a7a[_0x4b34('0x43')]);return _0x2b0094[_0x4b34('0x86')](_0xab8741);}})[_0x4b34('0x23')](function(_0x3de7a6){if(_0x3de7a6){_0x2bd877=_0x3de7a6[_0x4b34('0x38')];if(!_0x5a8a7a[_0x4b34('0x32')][_0x4b34('0x39')](_0x4b34('0x3a'))){_0xab8741[_0x4b34('0x1e')]=qs[_0x4b34('0x1e')](_0x5a8a7a['query'][_0x4b34('0x1e')]);_0xab8741['offset']=qs['offset'](_0x5a8a7a[_0x4b34('0x32')][_0x4b34('0x1d')]);}return _0x2b0094[_0x4b34('0x86')](_0xab8741);}})['then'](function(_0x2a5c68){if(_0x2a5c68){return _0x2a5c68?{'count':_0x2bd877,'rows':_0x2a5c68}:null;}})['then'](respondWithResult(_0x749a48,null))[_0x4b34('0x48')](handleError(_0x749a48,null));}; \ No newline at end of file +var _0x1be0=['key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filter','type','VIRTUAL','merge','options','WhatsappQueue','includeAll','include','findAll','catch','show','params','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','error','describe','getMembers','findOne','UserWhatsappQueue','length','order','pick','WhatsappQueueId','User','findAndCountAll','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','online','interface','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','select','field','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','name','index','map','rawAttributes','fieldName'];(function(_0x35d8ba,_0x4084db){var _0x2bc05c=function(_0x3b1725){while(--_0x3b1725){_0x35d8ba['push'](_0x35d8ba['shift']());}};_0x2bc05c(++_0x4084db);}(_0x1be0,0x16b));var _0x01be=function(_0x1700ec,_0x599437){_0x1700ec=_0x1700ec-0x0;var _0x372f2b=_0x1be0[_0x1700ec];return _0x372f2b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x01be('0x0'));var rimraf=require(_0x01be('0x1'));var zipdir=require(_0x01be('0x2'));var jsonpatch=require(_0x01be('0x3'));var rp=require('request-promise');var moment=require(_0x01be('0x4'));var BPromise=require(_0x01be('0x5'));var Mustache=require(_0x01be('0x6'));var util=require(_0x01be('0x7'));var path=require('path');var sox=require(_0x01be('0x8'));var csv=require(_0x01be('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x01be('0xa'));var crypto=require(_0x01be('0xb'));var jsforce=require(_0x01be('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x01be('0x9'));var querystring=require(_0x01be('0xd'));var Papa=require(_0x01be('0xe'));var Redis=require(_0x01be('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01be('0x10'));var logger=require(_0x01be('0x11'))(_0x01be('0x12'));var utils=require(_0x01be('0x13'));var config=require(_0x01be('0x14'));var db=require(_0x01be('0x15'))['db'];config[_0x01be('0x16')]=_[_0x01be('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x01be('0x18'))(new Redis(config[_0x01be('0x16')]));require('./whatsappQueue.socket')[_0x01be('0x19')](socket);function respondWithStatusCode(_0x4a13bc,_0x2ef2b6){_0x2ef2b6=_0x2ef2b6||0xcc;return function(_0x2cb219){if(_0x2cb219){return _0x4a13bc[_0x01be('0x1a')](_0x2ef2b6);}return _0x4a13bc[_0x01be('0x1b')](_0x2ef2b6)[_0x01be('0x1c')]();};}function respondWithResult(_0x126595,_0x138315){_0x138315=_0x138315||0xc8;return function(_0x2add7e){if(_0x2add7e){return _0x126595[_0x01be('0x1b')](_0x138315)[_0x01be('0x1d')](_0x2add7e);}};}function respondWithFilteredResult(_0x20f40c,_0x30e167){return function(_0x3b473f){if(_0x3b473f){var _0x4bb952=_0x3b473f[_0x01be('0x1e')],_0x5a95e7=_0x30e167[_0x01be('0x1f')],_0x5870b5=_0x30e167['offset']+_0x30e167['limit'],_0x33c009;if(_0x5870b5>=_0x4bb952){_0x5870b5=_0x4bb952;_0x33c009=0xc8;}else{_0x33c009=0xce;}_0x20f40c[_0x01be('0x1b')](_0x33c009);return _0x20f40c[_0x01be('0x20')](_0x01be('0x21'),_0x5a95e7+'-'+_0x5870b5+'/'+_0x4bb952)[_0x01be('0x1d')](_0x3b473f);}return null;};}function patchUpdates(_0x10e2fe){return function(_0x12e26f){try{jsonpatch[_0x01be('0x22')](_0x12e26f,_0x10e2fe,!![]);}catch(_0x40c1c6){return BPromise[_0x01be('0x23')](_0x40c1c6);}return _0x12e26f[_0x01be('0x24')]();};}function saveUpdates(_0x3ac7f1,_0x2569a3){return function(_0x7f804e){if(_0x7f804e){return _0x7f804e[_0x01be('0x25')](_0x3ac7f1)[_0x01be('0x26')](function(_0x2819cf){return _0x2819cf;});}return null;};}function removeEntity(_0x11c019,_0x1dc049){return function(_0xe6ee9b){if(_0xe6ee9b){return _0xe6ee9b[_0x01be('0x27')]()[_0x01be('0x26')](function(){var _0x3f084c=_0xe6ee9b[_0x01be('0x28')]({'plain':!![]});var _0xb6f4e1=_0x01be('0x29');return db[_0x01be('0x2a')][_0x01be('0x27')]({'where':{'type':_0xb6f4e1,'resourceId':_0x3f084c['id']}})[_0x01be('0x26')](function(){return _0xe6ee9b;});})['then'](function(){_0x11c019[_0x01be('0x1b')](0xcc)[_0x01be('0x1c')]();});}};}function handleEntityNotFound(_0x46240f,_0x1281f5){return function(_0x18556a){if(!_0x18556a){_0x46240f[_0x01be('0x1a')](0x194);}return _0x18556a;};}function handleError(_0x3ef95e,_0x2d6fef){_0x2d6fef=_0x2d6fef||0x1f4;return function(_0x25abb3){logger['error'](_0x25abb3['stack']);if(_0x25abb3[_0x01be('0x2b')]){delete _0x25abb3[_0x01be('0x2b')];}_0x3ef95e[_0x01be('0x1b')](_0x2d6fef)['send'](_0x25abb3);};}exports[_0x01be('0x2c')]=function(_0x5d4894,_0x2ba3c0){var _0x3d7488={},_0x5e6bd5={},_0x2cab67={'count':0x0,'rows':[]};var _0x2f2eed=_[_0x01be('0x2d')](db['WhatsappQueue'][_0x01be('0x2e')],function(_0x528ee9){return{'name':_0x528ee9[_0x01be('0x2f')],'type':_0x528ee9['type'][_0x01be('0x30')]};});_0x5e6bd5[_0x01be('0x31')]=_[_0x01be('0x2d')](_0x2f2eed,_0x01be('0x2b'));_0x5e6bd5[_0x01be('0x32')]=_[_0x01be('0x33')](_0x5d4894[_0x01be('0x32')]);_0x5e6bd5[_0x01be('0x34')]=_[_0x01be('0x35')](_0x5e6bd5['model'],_0x5e6bd5[_0x01be('0x32')]);_0x3d7488[_0x01be('0x36')]=_['intersection'](_0x5e6bd5[_0x01be('0x31')],qs[_0x01be('0x37')](_0x5d4894['query'][_0x01be('0x37')]));_0x3d7488[_0x01be('0x36')]=_0x3d7488[_0x01be('0x36')]['length']?_0x3d7488[_0x01be('0x36')]:_0x5e6bd5[_0x01be('0x31')];if(!_0x5d4894[_0x01be('0x32')][_0x01be('0x38')](_0x01be('0x39'))){_0x3d7488['limit']=qs[_0x01be('0x3a')](_0x5d4894[_0x01be('0x32')]['limit']);_0x3d7488[_0x01be('0x1f')]=qs[_0x01be('0x1f')](_0x5d4894[_0x01be('0x32')]['offset']);}_0x3d7488['order']=qs[_0x01be('0x3b')](_0x5d4894[_0x01be('0x32')][_0x01be('0x3b')]);_0x3d7488[_0x01be('0x3c')]=qs[_0x01be('0x34')](_['pick'](_0x5d4894[_0x01be('0x32')],_0x5e6bd5['filters']),_0x2f2eed);if(_0x5d4894['query'][_0x01be('0x3d')]){_0x3d7488[_0x01be('0x3c')]=_['merge'](_0x3d7488['where'],{'$or':_[_0x01be('0x2d')](_0x2f2eed,function(_0x489d22){if(_0x489d22[_0x01be('0x3e')]!==_0x01be('0x3f')){var _0x375ab9={};_0x375ab9[_0x489d22[_0x01be('0x2b')]]={'$like':'%'+_0x5d4894[_0x01be('0x32')][_0x01be('0x3d')]+'%'};return _0x375ab9;}})});}_0x3d7488=_[_0x01be('0x40')]({},_0x3d7488,_0x5d4894[_0x01be('0x41')]);var _0x4ebbed={'where':_0x3d7488[_0x01be('0x3c')]};return db[_0x01be('0x42')][_0x01be('0x1e')](_0x4ebbed)[_0x01be('0x26')](function(_0x1949f9){_0x2cab67['count']=_0x1949f9;if(_0x5d4894[_0x01be('0x32')][_0x01be('0x43')]){_0x3d7488[_0x01be('0x44')]=[{'all':!![]}];}return db[_0x01be('0x42')][_0x01be('0x45')](_0x3d7488);})[_0x01be('0x26')](function(_0x1cb13b){_0x2cab67['rows']=_0x1cb13b;return _0x2cab67;})['then'](respondWithFilteredResult(_0x2ba3c0,_0x3d7488))[_0x01be('0x46')](handleError(_0x2ba3c0,null));};exports[_0x01be('0x47')]=function(_0x56a6c1,_0x29160a){var _0x2c0967={'raw':!![],'where':{'id':_0x56a6c1[_0x01be('0x48')]['id']}},_0x747b02={};_0x747b02['model']=_[_0x01be('0x33')](db[_0x01be('0x42')]['rawAttributes']);_0x747b02[_0x01be('0x32')]=_['keys'](_0x56a6c1['query']);_0x747b02[_0x01be('0x34')]=_[_0x01be('0x35')](_0x747b02[_0x01be('0x31')],_0x747b02[_0x01be('0x32')]);_0x2c0967[_0x01be('0x36')]=_[_0x01be('0x35')](_0x747b02[_0x01be('0x31')],qs[_0x01be('0x37')](_0x56a6c1[_0x01be('0x32')][_0x01be('0x37')]));_0x2c0967['attributes']=_0x2c0967[_0x01be('0x36')]['length']?_0x2c0967[_0x01be('0x36')]:_0x747b02['model'];if(_0x56a6c1[_0x01be('0x32')][_0x01be('0x43')]){_0x2c0967[_0x01be('0x44')]=[{'all':!![]}];}_0x2c0967=_['merge']({},_0x2c0967,_0x56a6c1[_0x01be('0x41')]);return db[_0x01be('0x42')][_0x01be('0x49')](_0x2c0967)[_0x01be('0x26')](handleEntityNotFound(_0x29160a,null))[_0x01be('0x26')](respondWithResult(_0x29160a,null))[_0x01be('0x46')](handleError(_0x29160a,null));};exports[_0x01be('0x4a')]=function(_0x4ce697,_0x16d763){return db[_0x01be('0x42')]['create'](_0x4ce697[_0x01be('0x4b')],{})['then'](function(_0x38904b){var _0x4ff406=_0x4ce697[_0x01be('0x4c')][_0x01be('0x28')]({'plain':!![]});if(!_0x4ff406)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ff406['role']===_0x01be('0x4c')){var _0x5e136c=_0x38904b[_0x01be('0x28')]({'plain':!![]});var _0x33a4ef=_0x01be('0x29');return db[_0x01be('0x4d')][_0x01be('0x49')]({'where':{'name':_0x33a4ef,'userProfileId':_0x4ff406[_0x01be('0x4e')]},'raw':!![]})[_0x01be('0x26')](function(_0x55df3c){if(_0x55df3c&&_0x55df3c[_0x01be('0x4f')]===0x0){return db[_0x01be('0x2a')][_0x01be('0x4a')]({'name':_0x5e136c[_0x01be('0x2b')],'resourceId':_0x5e136c['id'],'type':_0x55df3c['name'],'sectionId':_0x55df3c['id']},{})['then'](function(){return _0x38904b;});}else{return _0x38904b;}})['catch'](function(_0x21760d){logger[_0x01be('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x21760d);throw _0x21760d;});}return _0x38904b;})[_0x01be('0x26')](respondWithResult(_0x16d763,0xc9))[_0x01be('0x46')](handleError(_0x16d763,null));};exports[_0x01be('0x25')]=function(_0x14d11c,_0x4158f1){if(_0x14d11c[_0x01be('0x4b')]['id']){delete _0x14d11c[_0x01be('0x4b')]['id'];}return db[_0x01be('0x42')][_0x01be('0x49')]({'where':{'id':_0x14d11c['params']['id']}})[_0x01be('0x26')](handleEntityNotFound(_0x4158f1,null))['then'](saveUpdates(_0x14d11c[_0x01be('0x4b')],null))[_0x01be('0x26')](respondWithResult(_0x4158f1,null))['catch'](handleError(_0x4158f1,null));};exports[_0x01be('0x27')]=function(_0x18acc9,_0x185c0a){return db[_0x01be('0x42')][_0x01be('0x49')]({'where':{'id':_0x18acc9[_0x01be('0x48')]['id']}})['then'](handleEntityNotFound(_0x185c0a,null))['then'](removeEntity(_0x185c0a,null))['catch'](handleError(_0x185c0a,null));};exports[_0x01be('0x51')]=function(_0x39a24a,_0x41ee95){return db['WhatsappQueue'][_0x01be('0x51')]()['then'](respondWithResult(_0x41ee95,null))['catch'](handleError(_0x41ee95,null));};exports[_0x01be('0x52')]=function(_0x1d1d75,_0x3a4965,_0xc23b06){var _0xe771c8={'raw':!![],'where':{}},_0x341bcc={},_0x46caf5;return db['WhatsappQueue'][_0x01be('0x53')]({'where':{'id':_0x1d1d75[_0x01be('0x48')]['id']}})[_0x01be('0x26')](handleEntityNotFound(_0x3a4965,null))[_0x01be('0x26')](function(_0x215b7b){if(_0x215b7b){_0x46caf5=_0x215b7b[_0x01be('0x28')]({'plain':!![]});_0x341bcc['model']=_['keys'](db[_0x01be('0x54')][_0x01be('0x2e')]);_0x341bcc[_0x01be('0x32')]=_[_0x01be('0x33')](_0x1d1d75[_0x01be('0x32')]);_0x341bcc['filters']=_[_0x01be('0x35')](_0x341bcc[_0x01be('0x31')],_0x341bcc[_0x01be('0x32')]);_0xe771c8[_0x01be('0x36')]=_[_0x01be('0x35')](_0x341bcc[_0x01be('0x31')],qs[_0x01be('0x37')](_0x1d1d75[_0x01be('0x32')][_0x01be('0x37')]));_0xe771c8['attributes']=_0xe771c8[_0x01be('0x36')][_0x01be('0x55')]?_0xe771c8['attributes']:_0x341bcc[_0x01be('0x31')];if(!_0x1d1d75['query'][_0x01be('0x38')](_0x01be('0x39'))){_0xe771c8[_0x01be('0x3a')]=qs[_0x01be('0x3a')](_0x1d1d75[_0x01be('0x32')][_0x01be('0x3a')]);_0xe771c8[_0x01be('0x1f')]=qs[_0x01be('0x1f')](_0x1d1d75['query'][_0x01be('0x1f')]);}_0xe771c8[_0x01be('0x56')]=qs[_0x01be('0x3b')](_0x1d1d75[_0x01be('0x32')][_0x01be('0x3b')]);_0xe771c8[_0x01be('0x3c')]=qs[_0x01be('0x34')](_[_0x01be('0x57')](_0x1d1d75[_0x01be('0x32')],_0x341bcc[_0x01be('0x34')]));_0xe771c8['where'][_0x01be('0x58')]=_0x215b7b['id'];if(_0x1d1d75[_0x01be('0x32')][_0x01be('0x3d')]){_0xe771c8[_0x01be('0x3c')]=_[_0x01be('0x40')](_0xe771c8[_0x01be('0x3c')],{'$or':_[_0x01be('0x2d')](_0xe771c8[_0x01be('0x36')],function(_0x79baa8){var _0x98e732={};_0x98e732[_0x79baa8]={'$like':'%'+_0x1d1d75[_0x01be('0x32')][_0x01be('0x3d')]+'%'};return _0x98e732;})});}_0xe771c8=_['merge']({},_0xe771c8,_0x1d1d75[_0x01be('0x41')]);return db[_0x01be('0x54')]['findAll'](_0xe771c8);}})[_0x01be('0x26')](function(_0x2f60ae){if(_0x2f60ae){return db[_0x01be('0x59')][_0x01be('0x5a')]({'where':{'id':_[_0x01be('0x2d')](_0x2f60ae,'UserId'),'role':'agent'},'attributes':['id',_0x01be('0x2b'),_0x01be('0x5b'),_0x01be('0x5c'),_0x01be('0x5d')]});}})[_0x01be('0x26')](function(_0x3c96e3){if(_0x3c96e3){return{'count':_0x3c96e3['count'],'rows':_[_0x01be('0x2d')](_0x3c96e3['rows'],function(_0x29b52f){return{'membername':_0x29b52f[_0x01be('0x2b')],'UserId':_0x29b52f['id'],'queue_name':_0x46caf5[_0x01be('0x2b')],'WhatsappQueueId':_0x46caf5['id'],'interface':util[_0x01be('0x5e')](_0x01be('0x5f'),_0x01be('0x60'),_0x29b52f[_0x01be('0x2b')]),'penalty':0x0,'paused':_0x29b52f[_0x01be('0x5b')],'createdAt':_0x29b52f[_0x01be('0x5d')],'updatedAt':_0x29b52f[_0x01be('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3a4965,_0xe771c8))[_0x01be('0x46')](handleError(_0x3a4965,null));};exports[_0x01be('0x61')]=function(_0x2889ca,_0x57c951,_0x4d2535){var _0x1dec71={};var _0x174ba8={};var _0xf63c49;var _0x46bbf3;return db[_0x01be('0x42')][_0x01be('0x53')]({'where':{'id':_0x2889ca['params']['id']}})['then'](handleEntityNotFound(_0x57c951,null))['then'](function(_0x4a5431){if(_0x4a5431){_0xf63c49=_0x4a5431;_0x174ba8[_0x01be('0x31')]=_[_0x01be('0x33')](db['Team'][_0x01be('0x2e')]);_0x174ba8[_0x01be('0x32')]=_['keys'](_0x2889ca['query']);_0x174ba8[_0x01be('0x34')]=_[_0x01be('0x35')](_0x174ba8[_0x01be('0x31')],_0x174ba8['query']);_0x1dec71[_0x01be('0x36')]=_['intersection'](_0x174ba8['model'],qs['fields'](_0x2889ca['query']['fields']));_0x1dec71[_0x01be('0x36')]=_0x1dec71[_0x01be('0x36')][_0x01be('0x55')]?_0x1dec71['attributes']:_0x174ba8[_0x01be('0x31')];_0x1dec71[_0x01be('0x56')]=qs[_0x01be('0x3b')](_0x2889ca['query'][_0x01be('0x3b')]);_0x1dec71[_0x01be('0x3c')]=qs[_0x01be('0x34')](_[_0x01be('0x57')](_0x2889ca['query'],_0x174ba8[_0x01be('0x34')]));if(_0x2889ca[_0x01be('0x32')]['filter']){_0x1dec71[_0x01be('0x3c')]=_[_0x01be('0x40')](_0x1dec71[_0x01be('0x3c')],{'$or':_[_0x01be('0x2d')](_0x1dec71[_0x01be('0x36')],function(_0x54d0f2){var _0x119567={};_0x119567[_0x54d0f2]={'$like':'%'+_0x2889ca[_0x01be('0x32')][_0x01be('0x3d')]+'%'};return _0x119567;})});}_0x1dec71=_[_0x01be('0x40')]({},_0x1dec71,_0x2889ca[_0x01be('0x41')]);return _0xf63c49['getTeams'](_0x1dec71);}})[_0x01be('0x26')](function(_0x2e8d52){if(_0x2e8d52){_0x46bbf3=_0x2e8d52[_0x01be('0x55')];if(!_0x2889ca[_0x01be('0x32')][_0x01be('0x38')](_0x01be('0x39'))){_0x1dec71[_0x01be('0x3a')]=qs[_0x01be('0x3a')](_0x2889ca[_0x01be('0x32')][_0x01be('0x3a')]);_0x1dec71[_0x01be('0x1f')]=qs['offset'](_0x2889ca[_0x01be('0x32')][_0x01be('0x1f')]);}return _0xf63c49[_0x01be('0x61')](_0x1dec71);}})[_0x01be('0x26')](function(_0x355b87){if(_0x355b87){return _0x355b87?{'count':_0x46bbf3,'rows':_0x355b87}:null;}})[_0x01be('0x26')](respondWithResult(_0x57c951,null))[_0x01be('0x46')](handleError(_0x57c951,null));};exports[_0x01be('0x62')]=function(_0x3f68ee,_0x312208,_0x26b48d){var _0x1af0fd=_0x3f68ee[_0x01be('0x4b')][_0x01be('0x63')];return db[_0x01be('0x64')]['findAll']({'where':{'id':_0x1af0fd},'attributes':['id'],'include':[{'model':db[_0x01be('0x59')],'as':'Agents','attributes':['id',_0x01be('0x2b'),_0x01be('0x65'),'voicePause',_0x01be('0x66')],'raw':!![]}]})[_0x01be('0x26')](function(_0x5098b0){if(_0x5098b0){var _0x582d25=_['flatMap'](_0x5098b0,function(_0x3a4146){var _0x2eaa41=_0x3a4146[_0x01be('0x28')]({'plain':!![]});return _0x2eaa41[_0x01be('0x67')];});return db[_0x01be('0x42')][_0x01be('0x49')]({'where':{'id':_0x3f68ee['params']['id']}})[_0x01be('0x26')](function(_0x593191){return db[_0x01be('0x68')][_0x01be('0x69')](function(_0x30e892){return _0x593191[_0x01be('0x62')](_0x1af0fd,{'transaction':_0x30e892})[_0x01be('0x26')](function(){return BPromise[_0x01be('0x6a')](_0x582d25,function(_0x19a1f6){return db['UserWhatsappQueue'][_0x01be('0x6b')]({'where':{'UserId':_0x19a1f6['id'],'WhatsappQueueId':_0x3f68ee[_0x01be('0x48')]['id']},'transaction':_0x30e892});});})[_0x01be('0x26')](function(){_0x582d25[_0x01be('0x6c')](function(_0x32b1d8){socket[_0x01be('0x6d')](_0x01be('0x6e'),{'UserId':_0x32b1d8['id'],'WhatsappQueueId':_0x593191['id']});});});});});}})[_0x01be('0x26')](respondWithStatusCode(_0x312208,null))[_0x01be('0x46')](handleError(_0x312208,null));};exports['removeTeams']=function(_0xb31ad5,_0x40f4b2,_0x43ee94){return db[_0x01be('0x64')]['findAll']({'where':{'id':_0xb31ad5[_0x01be('0x32')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x01be('0x67'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x40f4b2,null))[_0x01be('0x26')](function(_0x3cb8e0){var _0x12ec6a=_['map'](_0x3cb8e0,'id');var _0x178590=[];var _0x51aaff=[];var _0x55224c=squel[_0x01be('0x6f')]();_0x55224c[_0x01be('0x70')]('tq.TeamId')[_0x01be('0x71')](_0x01be('0x72'),'tq')[_0x01be('0x73')](_0x01be('0x74'),'ut',_0x01be('0x75'))['where']('WhatsappQueueId\x20=\x20?',_0xb31ad5['params']['id']);for(var _0x1f815c=0x0;_0x1f815c<_0x3cb8e0[_0x01be('0x55')];_0x1f815c+=0x1){let _0xdc3a82=_0x3cb8e0[_0x1f815c];for(var _0x32a8c2=0x0;_0x32a8c2<_0xdc3a82[_0x01be('0x67')][_0x01be('0x55')];_0x32a8c2+=0x1){let _0x180d54=_0xdc3a82[_0x01be('0x67')][_0x32a8c2];var _0x4bd7ec=_0x55224c[_0x01be('0x76')]();_0x4bd7ec['where'](_0x01be('0x77'),_0x180d54['id']);_0x51aaff['push'](db[_0x01be('0x68')]['query'](_0x4bd7ec[_0x01be('0x78')](),{'type':db[_0x01be('0x68')][_0x01be('0x79')][_0x01be('0x7a')]})[_0x01be('0x26')](function(_0x1d876b){if(_0x1d876b[_0x01be('0x55')]===0x1){return _0x180d54['id'];}else{var _0x1dd53b=_[_0x01be('0x7b')](_['map'](_0x1d876b,_0x01be('0x7c')),function(_0x332fd3){return _[_0x01be('0x7d')](_0x12ec6a,_0x332fd3);});if(_0x1dd53b){return _0x180d54['id'];}}}));}}return BPromise[_0x01be('0x7e')](_0x51aaff)[_0x01be('0x26')](function(_0x51169c){_0x178590=_(_0x178590)[_0x01be('0x7f')](_0x51169c)[_0x01be('0x80')]()[_0x01be('0x81')]();return db[_0x01be('0x42')][_0x01be('0x49')]({'where':{'id':_0xb31ad5[_0x01be('0x48')]['id']}})[_0x01be('0x26')](function(_0x2b41e0){return db[_0x01be('0x68')][_0x01be('0x69')](function(_0x524cfc){return _0x2b41e0[_0x01be('0x82')](_0xb31ad5[_0x01be('0x32')][_0x01be('0x63')],{'transaction':_0x524cfc})[_0x01be('0x26')](function(){if(!_[_0x01be('0x83')](_0x178590)){return _0x2b41e0[_0x01be('0x84')](_0x178590,{'transaction':_0x524cfc});}})[_0x01be('0x26')](function(){_0x178590['forEach'](function(_0x5b1ec5){socket[_0x01be('0x6d')]('userWhatsappQueue:remove',{'UserId':_0x5b1ec5,'WhatsappQueueId':_0x2b41e0['id']});});});});});});})[_0x01be('0x26')](respondWithStatusCode(_0x40f4b2,null))[_0x01be('0x46')](handleError(_0x40f4b2,null));};exports['addAgents']=function(_0x5e5de4,_0x15eb93,_0x5c5ac5){return db['WhatsappQueue']['find']({'where':{'id':_0x5e5de4['params']['id']}})[_0x01be('0x26')](handleEntityNotFound(_0x15eb93,null))[_0x01be('0x26')](function(_0x117a64){if(_0x117a64){return _0x117a64['addAgents'](_0x5e5de4[_0x01be('0x4b')][_0x01be('0x63')],_[_0x01be('0x85')](_0x5e5de4[_0x01be('0x4b')],['ids','id'])||{})[_0x01be('0x86')](function(_0x1b14a3){for(var _0xe185e9=0x0;_0xe185e9<_0x5e5de4[_0x01be('0x4b')][_0x01be('0x63')][_0x01be('0x55')];_0xe185e9+=0x1){socket[_0x01be('0x6d')](_0x01be('0x6e'),{'UserId':_0x5e5de4[_0x01be('0x4b')][_0x01be('0x63')][_0xe185e9],'WhatsappQueueId':_0x5e5de4[_0x01be('0x48')]['id']});}return _0x1b14a3;});}})[_0x01be('0x26')](respondWithResult(_0x15eb93,null))['catch'](handleError(_0x15eb93,null));};exports[_0x01be('0x84')]=function(_0xc1671a,_0x4aec63,_0x7407b8){return db[_0x01be('0x42')]['find']({'where':{'id':_0xc1671a['params']['id']}})[_0x01be('0x26')](handleEntityNotFound(_0x4aec63,null))[_0x01be('0x26')](function(_0x4226a9){if(_0x4226a9){return _0x4226a9['removeAgents'](_0xc1671a[_0x01be('0x32')]['ids'])[_0x01be('0x26')](function(){if(_[_0x01be('0x87')](_0xc1671a[_0x01be('0x32')][_0x01be('0x63')])){for(var _0x5b18a4=0x0;_0x5b18a4<_0xc1671a['query']['ids'][_0x01be('0x55')];_0x5b18a4+=0x1){socket[_0x01be('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0xc1671a['query'][_0x01be('0x63')][_0x5b18a4]),'WhatsappQueueId':Number(_0xc1671a[_0x01be('0x48')]['id'])});}}else{socket[_0x01be('0x6d')]('userWhatsappQueue:remove',{'UserId':Number(_0xc1671a[_0x01be('0x32')][_0x01be('0x63')]),'WhatsappQueueId':Number(_0xc1671a[_0x01be('0x48')]['id'])});}});}})[_0x01be('0x26')](respondWithStatusCode(_0x4aec63,null))[_0x01be('0x46')](handleError(_0x4aec63,null));};exports['getAgents']=function(_0x18b9d8,_0x45a469,_0x3d53a9){var _0x2b6d21={};var _0x338f51={};var _0x546f82;var _0x2408d2;return db['WhatsappQueue']['findOne']({'where':{'id':_0x18b9d8['params']['id']}})[_0x01be('0x26')](handleEntityNotFound(_0x45a469,null))[_0x01be('0x26')](function(_0x534502){if(_0x534502){_0x546f82=_0x534502;_0x338f51['model']=_[_0x01be('0x33')](db['User']['rawAttributes']);_0x338f51[_0x01be('0x32')]=_[_0x01be('0x33')](_0x18b9d8[_0x01be('0x32')]);_0x338f51['filters']=_[_0x01be('0x35')](_0x338f51[_0x01be('0x31')],_0x338f51['query']);_0x2b6d21[_0x01be('0x36')]=_['intersection'](_0x338f51[_0x01be('0x31')],qs[_0x01be('0x37')](_0x18b9d8['query'][_0x01be('0x37')]));_0x2b6d21[_0x01be('0x36')]=_0x2b6d21['attributes'][_0x01be('0x55')]?_0x2b6d21[_0x01be('0x36')]:_0x338f51['model'];_0x2b6d21['order']=qs[_0x01be('0x3b')](_0x18b9d8[_0x01be('0x32')][_0x01be('0x3b')]);_0x2b6d21[_0x01be('0x3c')]=qs[_0x01be('0x34')](_[_0x01be('0x57')](_0x18b9d8[_0x01be('0x32')],_0x338f51['filters']));if(_0x18b9d8['query'][_0x01be('0x3d')]){_0x2b6d21[_0x01be('0x3c')]=_[_0x01be('0x40')](_0x2b6d21[_0x01be('0x3c')],{'$or':_['map'](_0x2b6d21[_0x01be('0x36')],function(_0x326128){var _0x440ddb={};_0x440ddb[_0x326128]={'$like':'%'+_0x18b9d8[_0x01be('0x32')]['filter']+'%'};return _0x440ddb;})});}_0x2b6d21=_[_0x01be('0x40')]({},_0x2b6d21,_0x18b9d8[_0x01be('0x41')]);return _0x546f82[_0x01be('0x88')](_0x2b6d21);}})[_0x01be('0x26')](function(_0x25b4ad){if(_0x25b4ad){_0x2408d2=_0x25b4ad[_0x01be('0x55')];if(!_0x18b9d8[_0x01be('0x32')][_0x01be('0x38')]('nolimit')){_0x2b6d21[_0x01be('0x3a')]=qs[_0x01be('0x3a')](_0x18b9d8['query'][_0x01be('0x3a')]);_0x2b6d21['offset']=qs[_0x01be('0x1f')](_0x18b9d8[_0x01be('0x32')][_0x01be('0x1f')]);}return _0x546f82[_0x01be('0x88')](_0x2b6d21);}})[_0x01be('0x26')](function(_0x4dcf38){if(_0x4dcf38){return _0x4dcf38?{'count':_0x2408d2,'rows':_0x4dcf38}:null;}})[_0x01be('0x26')](respondWithResult(_0x45a469,null))[_0x01be('0x46')](handleError(_0x45a469,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index d15c4f6..5ab50b9 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 _0xc444=['events','../../mysqldb','WhatsappQueue','save','remove','emit','hasOwnProperty','exports'];(function(_0x426847,_0x1ecbff){var _0x32c58a=function(_0x4e6af8){while(--_0x4e6af8){_0x426847['push'](_0x426847['shift']());}};_0x32c58a(++_0x1ecbff);}(_0xc444,0x88));var _0x4c44=function(_0x59e537,_0x139c12){_0x59e537=_0x59e537-0x0;var _0x3b9cc6=_0xc444[_0x59e537];return _0x3b9cc6;};'use strict';var EventEmitter=require(_0x4c44('0x0'));var WhatsappQueue=require(_0x4c44('0x1'))['db'][_0x4c44('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4c44('0x3'),'afterUpdate':'update','afterDestroy':_0x4c44('0x4')};function emitEvent(_0x417fa1){return function(_0x5264de,_0xd0489b,_0x3d07cb){WhatsappQueueEvents[_0x4c44('0x5')](_0x417fa1+':'+_0x5264de['id'],_0x5264de);WhatsappQueueEvents[_0x4c44('0x5')](_0x417fa1,_0x5264de);_0x3d07cb(null);};}for(var e in events){if(events[_0x4c44('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x4c44('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0x02a6=['update','remove','emit','hook','exports','events','setMaxListeners'];(function(_0x478884,_0x4cf295){var _0x46f443=function(_0x318ba3){while(--_0x318ba3){_0x478884['push'](_0x478884['shift']());}};_0x46f443(++_0x4cf295);}(_0x02a6,0x10f));var _0x602a=function(_0x5aac6d,_0x5b5f50){_0x5aac6d=_0x5aac6d-0x0;var _0x45d9ff=_0x02a6[_0x5aac6d];return _0x45d9ff;};'use strict';var EventEmitter=require(_0x602a('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x602a('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x602a('0x2'),'afterDestroy':_0x602a('0x3')};function emitEvent(_0x5c5fd9){return function(_0x3edd7f,_0x39e8b8,_0x1756e0){WhatsappQueueEvents[_0x602a('0x4')](_0x5c5fd9+':'+_0x3edd7f['id'],_0x3edd7f);WhatsappQueueEvents['emit'](_0x5c5fd9,_0x3edd7f);_0x1756e0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x602a('0x5')](e,emitEvent(event));}}module[_0x602a('0x6')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 4cb5e55..ac7f791 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 _0xe535=['moment','bluebird','path','rimraf','../../config/environment','define','WhatsappQueue','util','../../config/logger','api'];(function(_0x58b019,_0x1ecddf){var _0x1decfb=function(_0x169c22){while(--_0x169c22){_0x58b019['push'](_0x58b019['shift']());}};_0x1decfb(++_0x1ecddf);}(_0xe535,0x11f));var _0x5e53=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xe535[_0x40bffc];return _0x3007e9;};'use strict';var _=require('lodash');var util=require(_0x5e53('0x0'));var logger=require(_0x5e53('0x1'))(_0x5e53('0x2'));var moment=require(_0x5e53('0x3'));var BPromise=require(_0x5e53('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e53('0x5'));var rimraf=require(_0x5e53('0x6'));var config=require(_0x5e53('0x7'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x944245,_0x5ebc6d){return _0x944245[_0x5e53('0x8')](_0x5e53('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88fb=['util','../../config/logger','api','bluebird','request-promise','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash'];(function(_0x1c0a59,_0x12ec77){var _0x34f45e=function(_0x395146){while(--_0x395146){_0x1c0a59['push'](_0x1c0a59['shift']());}};_0x34f45e(++_0x12ec77);}(_0x88fb,0x173));var _0xb88f=function(_0x50559a,_0x468abf){_0x50559a=_0x50559a-0x0;var _0x5e4018=_0x88fb[_0x50559a];return _0x5e4018;};'use strict';var _=require(_0xb88f('0x0'));var util=require(_0xb88f('0x1'));var logger=require(_0xb88f('0x2'))(_0xb88f('0x3'));var moment=require('moment');var BPromise=require(_0xb88f('0x4'));var rp=require(_0xb88f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb88f('0x6'));var config=require('../../config/environment');var attributes=require(_0xb88f('0x7'));module[_0xb88f('0x8')]=function(_0x180376,_0x397764){return _0x180376[_0xb88f('0x9')](_0xb88f('0xa'),attributes,{'tableName':_0xb88f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index 385642f..3b74273 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 _0x1596=['attributes','include','model','map','then','ShowWhatsappQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where'];(function(_0x460ece,_0x3312d3){var _0x29013c=function(_0xf1ae9e){while(--_0xf1ae9e){_0x460ece['push'](_0x460ece['shift']());}};_0x29013c(++_0x3312d3);}(_0x1596,0x16f));var _0x6159=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x1596[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x6159('0x0'));var util=require(_0x6159('0x1'));var moment=require(_0x6159('0x2'));var BPromise=require(_0x6159('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6159('0x4'));var db=require(_0x6159('0x5'))['db'];var utils=require(_0x6159('0x6'));var logger=require('../../config/logger')(_0x6159('0x7'));var config=require(_0x6159('0x8'));var jayson=require(_0x6159('0x9'));var client=jayson['client'][_0x6159('0xa')]({'port':0x232a});config[_0x6159('0xb')]=_[_0x6159('0xc')](config[_0x6159('0xb')],{'host':_0x6159('0xd'),'port':0x18eb});var socket=require(_0x6159('0xe'))(new Redis(config['redis']));require(_0x6159('0xf'))['register'](socket);function respondWithRpcPromise(_0x27f5c6,_0x31329d,_0x5139c4){return new BPromise(function(_0x421972,_0x10ad5f){return client[_0x6159('0x10')](_0x27f5c6,_0x5139c4)['then'](function(_0x5a978f){logger[_0x6159('0x11')](_0x6159('0x12'),_0x31329d,_0x6159('0x13'));logger[_0x6159('0x14')](_0x6159('0x15'),_0x31329d,_0x6159('0x13'),JSON[_0x6159('0x16')](_0x5a978f));if(_0x5a978f[_0x6159('0x17')]){if(_0x5a978f[_0x6159('0x17')][_0x6159('0x18')]===0x1f4){logger[_0x6159('0x17')](_0x6159('0x12'),_0x31329d,_0x5a978f[_0x6159('0x17')][_0x6159('0x19')]);return _0x10ad5f(_0x5a978f[_0x6159('0x17')][_0x6159('0x19')]);}logger[_0x6159('0x17')](_0x6159('0x12'),_0x31329d,_0x5a978f['error']['message']);return _0x421972(_0x5a978f[_0x6159('0x17')][_0x6159('0x19')]);}else{logger[_0x6159('0x11')]('WhatsappQueue,\x20%s,\x20%s',_0x31329d,_0x6159('0x13'));_0x421972(_0x5a978f[_0x6159('0x1a')][_0x6159('0x19')]);}})[_0x6159('0x1b')](function(_0x547685){logger[_0x6159('0x17')]('WhatsappQueue,\x20%s,\x20%s',_0x31329d,_0x547685);_0x10ad5f(_0x547685);});});}exports[_0x6159('0x1c')]=function(_0x422b28){var _0x31939a=this;return new Promise(function(_0x5a5eb9,_0x54f210){return db[_0x6159('0x1d')]['findAll']({'raw':_0x422b28[_0x6159('0x1e')]?_0x422b28[_0x6159('0x1e')][_0x6159('0x1f')]===undefined?!![]:![]:!![],'where':_0x422b28[_0x6159('0x1e')]?_0x422b28['options'][_0x6159('0x20')]||null:null,'attributes':_0x422b28[_0x6159('0x1e')]?_0x422b28[_0x6159('0x1e')][_0x6159('0x21')]||null:null,'limit':_0x422b28[_0x6159('0x1e')]?_0x422b28[_0x6159('0x1e')]['limit']||null:null,'include':_0x422b28[_0x6159('0x1e')]?_0x422b28['options'][_0x6159('0x22')]?_['map'](_0x422b28['options'][_0x6159('0x22')],function(_0x526a03){return{'model':db[_0x526a03[_0x6159('0x23')]],'as':_0x526a03['as'],'attributes':_0x526a03['attributes'],'include':_0x526a03[_0x6159('0x22')]?_[_0x6159('0x24')](_0x526a03[_0x6159('0x22')],function(_0x4059ef){return{'model':db[_0x4059ef['model']],'as':_0x4059ef['as'],'attributes':_0x4059ef[_0x6159('0x21')],'include':_0x4059ef[_0x6159('0x22')]?_[_0x6159('0x24')](_0x4059ef[_0x6159('0x22')],function(_0x4fa594){return{'model':db[_0x4fa594[_0x6159('0x23')]],'as':_0x4fa594['as'],'attributes':_0x4fa594['attributes']};}):[]};}):[]};}):[]:[]})[_0x6159('0x25')](function(_0x4f88bd){logger[_0x6159('0x11')](_0x6159('0x1c'),_0x422b28);logger[_0x6159('0x14')](_0x6159('0x1c'),_0x422b28,JSON[_0x6159('0x16')](_0x4f88bd));_0x5a5eb9(_0x4f88bd);})[_0x6159('0x1b')](function(_0x142c8c){logger[_0x6159('0x17')]('GetWhatsappQueue',_0x142c8c[_0x6159('0x19')],_0x422b28);_0x54f210(_0x31939a[_0x6159('0x17')](0x1f4,_0x142c8c[_0x6159('0x19')]));});});};exports[_0x6159('0x26')]=function(_0x5caf82){var _0x5005f7=this;return new Promise(function(_0x44e6b9,_0x228f0f){return db[_0x6159('0x1d')][_0x6159('0x27')]({'raw':_0x5caf82['options']?_0x5caf82[_0x6159('0x1e')][_0x6159('0x1f')]===undefined?!![]:![]:!![],'where':_0x5caf82[_0x6159('0x1e')]?_0x5caf82[_0x6159('0x1e')]['where']||null:null,'attributes':_0x5caf82[_0x6159('0x1e')]?_0x5caf82[_0x6159('0x1e')][_0x6159('0x21')]||null:null,'include':_0x5caf82[_0x6159('0x1e')]?_0x5caf82[_0x6159('0x1e')][_0x6159('0x22')]?_[_0x6159('0x24')](_0x5caf82[_0x6159('0x1e')][_0x6159('0x22')],function(_0x30fade){return{'model':db[_0x30fade[_0x6159('0x23')]],'as':_0x30fade['as'],'attributes':_0x30fade[_0x6159('0x21')],'include':_0x30fade[_0x6159('0x22')]?_[_0x6159('0x24')](_0x30fade[_0x6159('0x22')],function(_0x1ff939){return{'model':db[_0x1ff939['model']],'as':_0x1ff939['as'],'attributes':_0x1ff939[_0x6159('0x21')],'include':_0x1ff939[_0x6159('0x22')]?_[_0x6159('0x24')](_0x1ff939[_0x6159('0x22')],function(_0x17f782){return{'model':db[_0x17f782[_0x6159('0x23')]],'as':_0x17f782['as'],'attributes':_0x17f782[_0x6159('0x21')]};}):[]};}):[]};}):[]:[]})[_0x6159('0x25')](function(_0x3fc0b9){logger[_0x6159('0x11')]('ShowWhatsappQueue',_0x5caf82);logger[_0x6159('0x14')]('ShowWhatsappQueue',_0x5caf82,JSON['stringify'](_0x3fc0b9));_0x44e6b9(_0x3fc0b9);})[_0x6159('0x1b')](function(_0x49c7a3){logger[_0x6159('0x17')](_0x6159('0x26'),_0x49c7a3['message'],_0x5caf82);_0x228f0f(_0x5005f7[_0x6159('0x17')](0x1f4,_0x49c7a3[_0x6159('0x19')]));});});}; \ No newline at end of file +var _0xba56=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','options','where','attributes','limit','map','include','model','ShowWhatsappQueue','find','raw','lodash'];(function(_0x41189c,_0x3067bf){var _0x561927=function(_0x54020e){while(--_0x54020e){_0x41189c['push'](_0x41189c['shift']());}};_0x561927(++_0x3067bf);}(_0xba56,0x9f));var _0x6ba5=function(_0x15a634,_0x4feb86){_0x15a634=_0x15a634-0x0;var _0xf4f7a0=_0xba56[_0x15a634];return _0xf4f7a0;};'use strict';var _=require(_0x6ba5('0x0'));var util=require('util');var moment=require(_0x6ba5('0x1'));var BPromise=require(_0x6ba5('0x2'));var rs=require(_0x6ba5('0x3'));var fs=require('fs');var Redis=require(_0x6ba5('0x4'));var db=require(_0x6ba5('0x5'))['db'];var utils=require(_0x6ba5('0x6'));var logger=require('../../config/logger')(_0x6ba5('0x7'));var config=require(_0x6ba5('0x8'));var jayson=require(_0x6ba5('0x9'));var client=jayson[_0x6ba5('0xa')][_0x6ba5('0xb')]({'port':0x232a});config['redis']=_[_0x6ba5('0xc')](config[_0x6ba5('0xd')],{'host':_0x6ba5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x6ba5('0xf')](socket);function respondWithRpcPromise(_0x182dd5,_0x1011d4,_0x3e007e){return new BPromise(function(_0x3b35e1,_0x119884){return client[_0x6ba5('0x10')](_0x182dd5,_0x3e007e)[_0x6ba5('0x11')](function(_0x35e422){logger[_0x6ba5('0x12')](_0x6ba5('0x13'),_0x1011d4,_0x6ba5('0x14'));logger[_0x6ba5('0x15')](_0x6ba5('0x16'),_0x1011d4,_0x6ba5('0x14'),JSON[_0x6ba5('0x17')](_0x35e422));if(_0x35e422[_0x6ba5('0x18')]){if(_0x35e422['error'][_0x6ba5('0x19')]===0x1f4){logger[_0x6ba5('0x18')](_0x6ba5('0x13'),_0x1011d4,_0x35e422['error'][_0x6ba5('0x1a')]);return _0x119884(_0x35e422['error']['message']);}logger[_0x6ba5('0x18')](_0x6ba5('0x13'),_0x1011d4,_0x35e422[_0x6ba5('0x18')][_0x6ba5('0x1a')]);return _0x3b35e1(_0x35e422[_0x6ba5('0x18')][_0x6ba5('0x1a')]);}else{logger[_0x6ba5('0x12')](_0x6ba5('0x13'),_0x1011d4,_0x6ba5('0x14'));_0x3b35e1(_0x35e422['result'][_0x6ba5('0x1a')]);}})[_0x6ba5('0x1b')](function(_0x1cc94c){logger[_0x6ba5('0x18')](_0x6ba5('0x13'),_0x1011d4,_0x1cc94c);_0x119884(_0x1cc94c);});});}exports[_0x6ba5('0x1c')]=function(_0x4c8120){var _0x2e53c6=this;return new Promise(function(_0x1212b2,_0x57ff3b){return db[_0x6ba5('0x1d')]['findAll']({'raw':_0x4c8120[_0x6ba5('0x1e')]?_0x4c8120[_0x6ba5('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4c8120[_0x6ba5('0x1e')]?_0x4c8120[_0x6ba5('0x1e')][_0x6ba5('0x1f')]||null:null,'attributes':_0x4c8120[_0x6ba5('0x1e')]?_0x4c8120[_0x6ba5('0x1e')][_0x6ba5('0x20')]||null:null,'limit':_0x4c8120[_0x6ba5('0x1e')]?_0x4c8120[_0x6ba5('0x1e')][_0x6ba5('0x21')]||null:null,'include':_0x4c8120[_0x6ba5('0x1e')]?_0x4c8120['options']['include']?_[_0x6ba5('0x22')](_0x4c8120[_0x6ba5('0x1e')][_0x6ba5('0x23')],function(_0x150f55){return{'model':db[_0x150f55[_0x6ba5('0x24')]],'as':_0x150f55['as'],'attributes':_0x150f55[_0x6ba5('0x20')],'include':_0x150f55['include']?_[_0x6ba5('0x22')](_0x150f55[_0x6ba5('0x23')],function(_0x3689e9){return{'model':db[_0x3689e9[_0x6ba5('0x24')]],'as':_0x3689e9['as'],'attributes':_0x3689e9['attributes'],'include':_0x3689e9[_0x6ba5('0x23')]?_['map'](_0x3689e9['include'],function(_0x3b4d01){return{'model':db[_0x3b4d01[_0x6ba5('0x24')]],'as':_0x3b4d01['as'],'attributes':_0x3b4d01[_0x6ba5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6ba5('0x11')](function(_0xab15d9){logger[_0x6ba5('0x12')](_0x6ba5('0x1c'),_0x4c8120);logger['debug'](_0x6ba5('0x1c'),_0x4c8120,JSON['stringify'](_0xab15d9));_0x1212b2(_0xab15d9);})[_0x6ba5('0x1b')](function(_0x277c8a){logger[_0x6ba5('0x18')](_0x6ba5('0x1c'),_0x277c8a[_0x6ba5('0x1a')],_0x4c8120);_0x57ff3b(_0x2e53c6[_0x6ba5('0x18')](0x1f4,_0x277c8a['message']));});});};exports[_0x6ba5('0x25')]=function(_0x3e3eb8){var _0x3d4044=this;return new Promise(function(_0x40170c,_0x5bbb3a){return db[_0x6ba5('0x1d')][_0x6ba5('0x26')]({'raw':_0x3e3eb8['options']?_0x3e3eb8[_0x6ba5('0x1e')][_0x6ba5('0x27')]===undefined?!![]:![]:!![],'where':_0x3e3eb8[_0x6ba5('0x1e')]?_0x3e3eb8[_0x6ba5('0x1e')]['where']||null:null,'attributes':_0x3e3eb8['options']?_0x3e3eb8[_0x6ba5('0x1e')][_0x6ba5('0x20')]||null:null,'include':_0x3e3eb8['options']?_0x3e3eb8[_0x6ba5('0x1e')][_0x6ba5('0x23')]?_[_0x6ba5('0x22')](_0x3e3eb8[_0x6ba5('0x1e')]['include'],function(_0x116fd0){return{'model':db[_0x116fd0['model']],'as':_0x116fd0['as'],'attributes':_0x116fd0[_0x6ba5('0x20')],'include':_0x116fd0['include']?_[_0x6ba5('0x22')](_0x116fd0[_0x6ba5('0x23')],function(_0x4b51b4){return{'model':db[_0x4b51b4[_0x6ba5('0x24')]],'as':_0x4b51b4['as'],'attributes':_0x4b51b4[_0x6ba5('0x20')],'include':_0x4b51b4[_0x6ba5('0x23')]?_[_0x6ba5('0x22')](_0x4b51b4[_0x6ba5('0x23')],function(_0x560239){return{'model':db[_0x560239[_0x6ba5('0x24')]],'as':_0x560239['as'],'attributes':_0x560239[_0x6ba5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x6ba5('0x11')](function(_0x1b5f37){logger[_0x6ba5('0x12')](_0x6ba5('0x25'),_0x3e3eb8);logger[_0x6ba5('0x15')]('ShowWhatsappQueue',_0x3e3eb8,JSON[_0x6ba5('0x17')](_0x1b5f37));_0x40170c(_0x1b5f37);})[_0x6ba5('0x1b')](function(_0x3beb0f){logger[_0x6ba5('0x18')](_0x6ba5('0x25'),_0x3beb0f[_0x6ba5('0x1a')],_0x3e3eb8);_0x5bbb3a(_0x3d4044[_0x6ba5('0x18')](0x1f4,_0x3beb0f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index e981b29..e22d6c2 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 _0x4e0b=['removeListener','register','whatsappQueue:','./whatsappQueue.events','save','remove','update','emit'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x4e0b,0x133));var _0xb4e0=function(_0x2f83b5,_0x576ecf){_0x2f83b5=_0x2f83b5-0x0;var _0x2528bc=_0x4e0b[_0x2f83b5];return _0x2528bc;};'use strict';var WhatsappQueueEvents=require(_0xb4e0('0x0'));var events=[_0xb4e0('0x1'),_0xb4e0('0x2'),_0xb4e0('0x3')];function createListener(_0x4af931,_0x3ad26d){return function(_0x4db24a){_0x3ad26d[_0xb4e0('0x4')](_0x4af931,_0x4db24a);};}function removeListener(_0x3f3ca9,_0x2bacba){return function(){WhatsappQueueEvents[_0xb4e0('0x5')](_0x3f3ca9,_0x2bacba);};}exports[_0xb4e0('0x6')]=function(_0xa1f097){for(var _0x231d68=0x0,_0x21ac5f=events['length'];_0x231d68<_0x21ac5f;_0x231d68++){var _0x215a52=events[_0x231d68];var _0x116716=createListener(_0xb4e0('0x7')+_0x215a52,_0xa1f097);WhatsappQueueEvents['on'](_0x215a52,_0x116716);}}; \ No newline at end of file +var _0xd83a=['save','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0x2fc012,_0x503e5b){var _0x2891f9=function(_0x295f5e){while(--_0x295f5e){_0x2fc012['push'](_0x2fc012['shift']());}};_0x2891f9(++_0x503e5b);}(_0xd83a,0x11e));var _0xad83=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xd83a[_0x187ee1];return _0x388160;};'use strict';var WhatsappQueueEvents=require(_0xad83('0x0'));var events=[_0xad83('0x1'),'remove','update'];function createListener(_0x54d83b,_0x50c371){return function(_0x26e513){_0x50c371[_0xad83('0x2')](_0x54d83b,_0x26e513);};}function removeListener(_0x52ca8f,_0x2a1fa8){return function(){WhatsappQueueEvents[_0xad83('0x3')](_0x52ca8f,_0x2a1fa8);};}exports[_0xad83('0x4')]=function(_0x12011e){for(var _0x46524b=0x0,_0x11fa30=events[_0xad83('0x5')];_0x46524b<_0x11fa30;_0x46524b++){var _0x1a7215=events[_0x46524b];var _0x48cc3a=createListener(_0xad83('0x6')+_0x1a7215,_0x12011e);WhatsappQueueEvents['on'](_0x1a7215,_0x48cc3a);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index f177767..a15bbc0 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 _0xbbbd=['get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment'];(function(_0x4ccaba,_0x3e334f){var _0x209122=function(_0x385d64){while(--_0x385d64){_0x4ccaba['push'](_0x4ccaba['shift']());}};_0x209122(++_0x3e334f);}(_0xbbbd,0xc1));var _0xdbbb=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xbbbd[_0x11c573];return _0x6b72de;};'use strict';var multer=require(_0xdbbb('0x0'));var util=require(_0xdbbb('0x1'));var path=require(_0xdbbb('0x2'));var timeout=require(_0xdbbb('0x3'));var express=require('express');var router=express[_0xdbbb('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xdbbb('0x5'));var config=require(_0xdbbb('0x6'));var controller=require('./whatsappQueueReport.controller');router[_0xdbbb('0x7')]('/',auth[_0xdbbb('0x8')](),controller[_0xdbbb('0x9')]);router[_0xdbbb('0x7')](_0xdbbb('0xa'),auth[_0xdbbb('0x8')](),controller[_0xdbbb('0xb')]);router[_0xdbbb('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xdbbb('0xc')]);router[_0xdbbb('0xd')]('/',auth[_0xdbbb('0x8')](),controller[_0xdbbb('0xe')]);router[_0xdbbb('0xf')](_0xdbbb('0x10'),auth[_0xdbbb('0x8')](),controller[_0xdbbb('0x11')]);router[_0xdbbb('0x12')]('/:id',auth[_0xdbbb('0x8')](),controller['destroy']);module[_0xdbbb('0x13')]=router; \ No newline at end of file +var _0x5432=['../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x5432,0xc8));var _0x2543=function(_0x565a0d,_0x50bf5d){_0x565a0d=_0x565a0d-0x0;var _0x358fed=_0x5432[_0x565a0d];return _0x358fed;};'use strict';var multer=require(_0x2543('0x0'));var util=require(_0x2543('0x1'));var path=require(_0x2543('0x2'));var timeout=require(_0x2543('0x3'));var express=require(_0x2543('0x4'));var router=express[_0x2543('0x5')]();var auth=require(_0x2543('0x6'));var interaction=require(_0x2543('0x7'));var config=require(_0x2543('0x8'));var controller=require(_0x2543('0x9'));router[_0x2543('0xa')]('/',auth[_0x2543('0xb')](),controller[_0x2543('0xc')]);router['get'](_0x2543('0xd'),auth[_0x2543('0xb')](),controller[_0x2543('0xe')]);router[_0x2543('0xa')](_0x2543('0xf'),auth[_0x2543('0xb')](),controller[_0x2543('0x10')]);router[_0x2543('0x11')]('/',auth['isAuthenticated'](),controller[_0x2543('0x12')]);router[_0x2543('0x13')]('/:id',auth[_0x2543('0xb')](),controller[_0x2543('0x14')]);router['delete'](_0x2543('0xf'),auth[_0x2543('0xb')](),controller[_0x2543('0x15')]);module[_0x2543('0x16')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index a47915b..c20ac7f 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 _0x55ca=['DATE','STRING','sequelize','exports'];(function(_0x412352,_0x27dcd1){var _0x14ef0f=function(_0x54a93f){while(--_0x54a93f){_0x412352['push'](_0x412352['shift']());}};_0x14ef0f(++_0x27dcd1);}(_0x55ca,0x126));var _0xa55c=function(_0x412faa,_0x6d5ea8){_0x412faa=_0x412faa-0x0;var _0x204402=_0x55ca[_0x412faa];return _0x204402;};'use strict';var Sequelize=require(_0xa55c('0x0'));module[_0xa55c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa55c('0x2')]},'acceptAt':{'type':Sequelize[_0xa55c('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xa55c('0x3')]}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING','DATE'];(function(_0x26df9b,_0x1c31fe){var _0x1a35c9=function(_0xa93b3a){while(--_0xa93b3a){_0x26df9b['push'](_0x26df9b['shift']());}};_0x1a35c9(++_0x1c31fe);}(_0x34e8,0x12c));var _0x834e=function(_0xd37bb2,_0x105bff){_0xd37bb2=_0xd37bb2-0x0;var _0x5d9b17=_0x34e8[_0xd37bb2];return _0x5d9b17;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'uniqueid':{'type':Sequelize[_0x834e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x834e('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x834e('0x3')]},'acceptAt':{'type':Sequelize[_0x834e('0x3')]},'exitAt':{'type':Sequelize[_0x834e('0x3')]},'reason':{'type':Sequelize[_0x834e('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index e058d00..542c771 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 _0x605a=['moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','Content-Range','apply','reject','then','destroy','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x19f99f,_0xf726fe){var _0x48ae4f=function(_0x1e63ed){while(--_0x1e63ed){_0x19f99f['push'](_0x19f99f['shift']());}};_0x48ae4f(++_0xf726fe);}(_0x605a,0x126));var _0xa605=function(_0x47f6b0,_0x32486e){_0x47f6b0=_0x47f6b0-0x0;var _0x37f740=_0x605a[_0x47f6b0];return _0x37f740;};'use strict';var pdf=require(_0xa605('0x0'));var emlformat=require(_0xa605('0x1'));var rimraf=require(_0xa605('0x2'));var zipdir=require(_0xa605('0x3'));var jsonpatch=require(_0xa605('0x4'));var rp=require(_0xa605('0x5'));var moment=require(_0xa605('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xa605('0x7'));var util=require(_0xa605('0x8'));var path=require(_0xa605('0x9'));var sox=require(_0xa605('0xa'));var csv=require(_0xa605('0xb'));var ejs=require(_0xa605('0xc'));var fs=require('fs');var _=require(_0xa605('0xd'));var squel=require(_0xa605('0xe'));var crypto=require('crypto');var jsforce=require(_0xa605('0xf'));var deskjs=require(_0xa605('0x10'));var toCsv=require(_0xa605('0xb'));var querystring=require(_0xa605('0x11'));var Papa=require(_0xa605('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa605('0x13'));var as=require(_0xa605('0x14'));var hardwareService=require(_0xa605('0x15'));var logger=require(_0xa605('0x16'))(_0xa605('0x17'));var utils=require(_0xa605('0x18'));var config=require(_0xa605('0x19'));var db=require(_0xa605('0x1a'))['db'];function respondWithStatusCode(_0x2bfd62,_0x2329d6){_0x2329d6=_0x2329d6||0xcc;return function(_0x5713d0){if(_0x5713d0){return _0x2bfd62['sendStatus'](_0x2329d6);}return _0x2bfd62[_0xa605('0x1b')](_0x2329d6)[_0xa605('0x1c')]();};}function respondWithResult(_0x26dd6d,_0x316da3){_0x316da3=_0x316da3||0xc8;return function(_0x210bf5){if(_0x210bf5){return _0x26dd6d[_0xa605('0x1b')](_0x316da3)[_0xa605('0x1d')](_0x210bf5);}};}function respondWithFilteredResult(_0x410eba,_0x4c417f){return function(_0x4edb0c){if(_0x4edb0c){var _0x1103e6=_0x4edb0c[_0xa605('0x1e')],_0x24a6a3=_0x4c417f[_0xa605('0x1f')],_0x471c80=_0x4c417f[_0xa605('0x1f')]+_0x4c417f[_0xa605('0x20')],_0x364d8a;if(_0x471c80>=_0x1103e6){_0x471c80=_0x1103e6;_0x364d8a=0xc8;}else{_0x364d8a=0xce;}_0x410eba[_0xa605('0x1b')](_0x364d8a);return _0x410eba['set'](_0xa605('0x21'),_0x24a6a3+'-'+_0x471c80+'/'+_0x1103e6)[_0xa605('0x1d')](_0x4edb0c);}return null;};}function patchUpdates(_0x5a8c6c){return function(_0x409e5b){try{jsonpatch[_0xa605('0x22')](_0x409e5b,_0x5a8c6c,!![]);}catch(_0x5629f3){return BPromise[_0xa605('0x23')](_0x5629f3);}return _0x409e5b['save']();};}function saveUpdates(_0x272149,_0x39d856){return function(_0x5852c0){if(_0x5852c0){return _0x5852c0['update'](_0x272149)[_0xa605('0x24')](function(_0xe870a9){return _0xe870a9;});}return null;};}function removeEntity(_0x4dc116,_0x536a9b){return function(_0x4f43c4){if(_0x4f43c4){return _0x4f43c4[_0xa605('0x25')]()['then'](function(){_0x4dc116[_0xa605('0x1b')](0xcc)[_0xa605('0x1c')]();});}};}function handleEntityNotFound(_0x261d0d,_0x51a4a1){return function(_0x4fbae6){if(!_0x4fbae6){_0x261d0d['sendStatus'](0x194);}return _0x4fbae6;};}function handleError(_0x127956,_0x57ce87){_0x57ce87=_0x57ce87||0x1f4;return function(_0x372de2){logger['error'](_0x372de2[_0xa605('0x26')]);if(_0x372de2['name']){delete _0x372de2[_0xa605('0x27')];}_0x127956[_0xa605('0x1b')](_0x57ce87)[_0xa605('0x28')](_0x372de2);};}exports[_0xa605('0x29')]=function(_0x2a0b66,_0x326627){var _0x1a6718={},_0x5be0df={},_0x415c6a={'count':0x0,'rows':[]};var _0x7cb80d=_[_0xa605('0x2a')](db[_0xa605('0x2b')][_0xa605('0x2c')],function(_0x379438){return{'name':_0x379438[_0xa605('0x2d')],'type':_0x379438[_0xa605('0x2e')]['key']};});_0x5be0df['model']=_[_0xa605('0x2a')](_0x7cb80d,_0xa605('0x27'));_0x5be0df[_0xa605('0x2f')]=_[_0xa605('0x30')](_0x2a0b66[_0xa605('0x2f')]);_0x5be0df[_0xa605('0x31')]=_[_0xa605('0x32')](_0x5be0df[_0xa605('0x33')],_0x5be0df[_0xa605('0x2f')]);_0x1a6718[_0xa605('0x34')]=_[_0xa605('0x32')](_0x5be0df[_0xa605('0x33')],qs[_0xa605('0x35')](_0x2a0b66[_0xa605('0x2f')][_0xa605('0x35')]));_0x1a6718[_0xa605('0x34')]=_0x1a6718[_0xa605('0x34')][_0xa605('0x36')]?_0x1a6718[_0xa605('0x34')]:_0x5be0df[_0xa605('0x33')];if(!_0x2a0b66[_0xa605('0x2f')][_0xa605('0x37')](_0xa605('0x38'))){_0x1a6718[_0xa605('0x20')]=qs[_0xa605('0x20')](_0x2a0b66[_0xa605('0x2f')][_0xa605('0x20')]);_0x1a6718[_0xa605('0x1f')]=qs[_0xa605('0x1f')](_0x2a0b66['query'][_0xa605('0x1f')]);}_0x1a6718[_0xa605('0x39')]=qs[_0xa605('0x3a')](_0x2a0b66['query']['sort']);_0x1a6718[_0xa605('0x3b')]=qs[_0xa605('0x31')](_[_0xa605('0x3c')](_0x2a0b66[_0xa605('0x2f')],_0x5be0df[_0xa605('0x31')]),_0x7cb80d);if(_0x2a0b66[_0xa605('0x2f')][_0xa605('0x3d')]){_0x1a6718[_0xa605('0x3b')]=_[_0xa605('0x3e')](_0x1a6718['where'],{'$or':_[_0xa605('0x2a')](_0x7cb80d,function(_0x4163b3){if(_0x4163b3[_0xa605('0x2e')]!==_0xa605('0x3f')){var _0xc896a={};_0xc896a[_0x4163b3[_0xa605('0x27')]]={'$like':'%'+_0x2a0b66[_0xa605('0x2f')][_0xa605('0x3d')]+'%'};return _0xc896a;}})});}_0x1a6718=_[_0xa605('0x3e')]({},_0x1a6718,_0x2a0b66[_0xa605('0x40')]);var _0x5bf91d={'where':_0x1a6718['where']};return db[_0xa605('0x2b')]['count'](_0x5bf91d)[_0xa605('0x24')](function(_0x8a7ef7){_0x415c6a['count']=_0x8a7ef7;if(_0x2a0b66['query'][_0xa605('0x41')]){_0x1a6718[_0xa605('0x42')]=[{'all':!![]}];}return db[_0xa605('0x2b')][_0xa605('0x43')](_0x1a6718);})['then'](function(_0x3d2fe5){_0x415c6a[_0xa605('0x44')]=_0x3d2fe5;return _0x415c6a;})[_0xa605('0x24')](respondWithFilteredResult(_0x326627,_0x1a6718))[_0xa605('0x45')](handleError(_0x326627,null));};exports[_0xa605('0x46')]=function(_0x442b7e,_0x114dcf){var _0x2325d4={'raw':!![],'where':{'id':_0x442b7e[_0xa605('0x47')]['id']}},_0x5415eb={};_0x5415eb[_0xa605('0x33')]=_[_0xa605('0x30')](db[_0xa605('0x2b')][_0xa605('0x2c')]);_0x5415eb['query']=_[_0xa605('0x30')](_0x442b7e['query']);_0x5415eb['filters']=_[_0xa605('0x32')](_0x5415eb[_0xa605('0x33')],_0x5415eb[_0xa605('0x2f')]);_0x2325d4['attributes']=_['intersection'](_0x5415eb[_0xa605('0x33')],qs[_0xa605('0x35')](_0x442b7e[_0xa605('0x2f')]['fields']));_0x2325d4[_0xa605('0x34')]=_0x2325d4['attributes'][_0xa605('0x36')]?_0x2325d4['attributes']:_0x5415eb[_0xa605('0x33')];if(_0x442b7e[_0xa605('0x2f')][_0xa605('0x41')]){_0x2325d4[_0xa605('0x42')]=[{'all':!![]}];}_0x2325d4=_[_0xa605('0x3e')]({},_0x2325d4,_0x442b7e['options']);return db[_0xa605('0x2b')]['find'](_0x2325d4)[_0xa605('0x24')](handleEntityNotFound(_0x114dcf,null))[_0xa605('0x24')](respondWithResult(_0x114dcf,null))[_0xa605('0x45')](handleError(_0x114dcf,null));};exports['create']=function(_0x53f83e,_0x57bdb3){return db['WhatsappQueueReport']['create'](_0x53f83e[_0xa605('0x48')],{})['then'](respondWithResult(_0x57bdb3,0xc9))['catch'](handleError(_0x57bdb3,null));};exports['update']=function(_0x193d61,_0x2ce965){if(_0x193d61[_0xa605('0x48')]['id']){delete _0x193d61['body']['id'];}return db[_0xa605('0x2b')]['find']({'where':{'id':_0x193d61[_0xa605('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ce965,null))['then'](saveUpdates(_0x193d61[_0xa605('0x48')],null))[_0xa605('0x24')](respondWithResult(_0x2ce965,null))[_0xa605('0x45')](handleError(_0x2ce965,null));};exports[_0xa605('0x25')]=function(_0x157609,_0xc14fc5){return db['WhatsappQueueReport'][_0xa605('0x49')]({'where':{'id':_0x157609[_0xa605('0x47')]['id']}})[_0xa605('0x24')](handleEntityNotFound(_0xc14fc5,null))[_0xa605('0x24')](removeEntity(_0xc14fc5,null))[_0xa605('0x45')](handleError(_0xc14fc5,null));};exports[_0xa605('0x4a')]=function(_0x5b1fab,_0x478a32){return db[_0xa605('0x2b')][_0xa605('0x4a')]()['then'](respondWithResult(_0x478a32,null))[_0xa605('0x45')](handleError(_0x478a32,null));}; \ No newline at end of file +var _0x671e=['describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','reject','save','then','destroy','end','sendStatus','error','stack','name','send','map','WhatsappQueueReport','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','update','body'];(function(_0x4240d6,_0x2dab3e){var _0x9f190d=function(_0x16c821){while(--_0x16c821){_0x4240d6['push'](_0x4240d6['shift']());}};_0x9f190d(++_0x2dab3e);}(_0x671e,0xd6));var _0xe671=function(_0x49b570,_0x219cfe){_0x49b570=_0x49b570-0x0;var _0x5a1d4a=_0x671e[_0x49b570];return _0x5a1d4a;};'use strict';var pdf=require(_0xe671('0x0'));var emlformat=require(_0xe671('0x1'));var rimraf=require(_0xe671('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe671('0x3'));var rp=require(_0xe671('0x4'));var moment=require('moment');var BPromise=require(_0xe671('0x5'));var Mustache=require(_0xe671('0x6'));var util=require(_0xe671('0x7'));var path=require('path');var sox=require(_0xe671('0x8'));var csv=require(_0xe671('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe671('0xa'));var squel=require(_0xe671('0xb'));var crypto=require(_0xe671('0xc'));var jsforce=require(_0xe671('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe671('0x9'));var querystring=require(_0xe671('0xe'));var Papa=require(_0xe671('0xf'));var Redis=require(_0xe671('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe671('0x11'));var hardwareService=require(_0xe671('0x12'));var logger=require(_0xe671('0x13'))('api');var utils=require(_0xe671('0x14'));var config=require(_0xe671('0x15'));var db=require(_0xe671('0x16'))['db'];function respondWithStatusCode(_0x39c4b9,_0x57767b){_0x57767b=_0x57767b||0xcc;return function(_0x3a051e){if(_0x3a051e){return _0x39c4b9['sendStatus'](_0x57767b);}return _0x39c4b9[_0xe671('0x17')](_0x57767b)['end']();};}function respondWithResult(_0x4f62c1,_0x5222a7){_0x5222a7=_0x5222a7||0xc8;return function(_0x59688e){if(_0x59688e){return _0x4f62c1[_0xe671('0x17')](_0x5222a7)[_0xe671('0x18')](_0x59688e);}};}function respondWithFilteredResult(_0x2e59f3,_0x2d427f){return function(_0x53ceee){if(_0x53ceee){var _0x19d49c=_0x53ceee[_0xe671('0x19')],_0x6aea49=_0x2d427f['offset'],_0x297452=_0x2d427f[_0xe671('0x1a')]+_0x2d427f[_0xe671('0x1b')],_0x29cae4;if(_0x297452>=_0x19d49c){_0x297452=_0x19d49c;_0x29cae4=0xc8;}else{_0x29cae4=0xce;}_0x2e59f3[_0xe671('0x17')](_0x29cae4);return _0x2e59f3[_0xe671('0x1c')](_0xe671('0x1d'),_0x6aea49+'-'+_0x297452+'/'+_0x19d49c)[_0xe671('0x18')](_0x53ceee);}return null;};}function patchUpdates(_0x1a94be){return function(_0x18c364){try{jsonpatch['apply'](_0x18c364,_0x1a94be,!![]);}catch(_0x2c1bae){return BPromise[_0xe671('0x1e')](_0x2c1bae);}return _0x18c364[_0xe671('0x1f')]();};}function saveUpdates(_0x3332f2,_0x565623){return function(_0x1f6521){if(_0x1f6521){return _0x1f6521['update'](_0x3332f2)[_0xe671('0x20')](function(_0x267850){return _0x267850;});}return null;};}function removeEntity(_0x59c49c,_0x50bc70){return function(_0x2e9d94){if(_0x2e9d94){return _0x2e9d94[_0xe671('0x21')]()['then'](function(){_0x59c49c['status'](0xcc)[_0xe671('0x22')]();});}};}function handleEntityNotFound(_0x5ed70f,_0x1479e9){return function(_0x511ff5){if(!_0x511ff5){_0x5ed70f[_0xe671('0x23')](0x194);}return _0x511ff5;};}function handleError(_0x3cf8e1,_0x49f190){_0x49f190=_0x49f190||0x1f4;return function(_0x276da8){logger[_0xe671('0x24')](_0x276da8[_0xe671('0x25')]);if(_0x276da8[_0xe671('0x26')]){delete _0x276da8[_0xe671('0x26')];}_0x3cf8e1[_0xe671('0x17')](_0x49f190)[_0xe671('0x27')](_0x276da8);};}exports['index']=function(_0xb4d0ef,_0x2ca3d0){var _0x346991={},_0x559872={},_0x1e1d55={'count':0x0,'rows':[]};var _0x6daba5=_[_0xe671('0x28')](db[_0xe671('0x29')]['rawAttributes'],function(_0x1a20aa){return{'name':_0x1a20aa[_0xe671('0x2a')],'type':_0x1a20aa[_0xe671('0x2b')]['key']};});_0x559872[_0xe671('0x2c')]=_[_0xe671('0x28')](_0x6daba5,'name');_0x559872[_0xe671('0x2d')]=_[_0xe671('0x2e')](_0xb4d0ef[_0xe671('0x2d')]);_0x559872[_0xe671('0x2f')]=_[_0xe671('0x30')](_0x559872[_0xe671('0x2c')],_0x559872[_0xe671('0x2d')]);_0x346991['attributes']=_[_0xe671('0x30')](_0x559872['model'],qs[_0xe671('0x31')](_0xb4d0ef[_0xe671('0x2d')][_0xe671('0x31')]));_0x346991['attributes']=_0x346991[_0xe671('0x32')][_0xe671('0x33')]?_0x346991['attributes']:_0x559872['model'];if(!_0xb4d0ef['query'][_0xe671('0x34')]('nolimit')){_0x346991[_0xe671('0x1b')]=qs[_0xe671('0x1b')](_0xb4d0ef['query']['limit']);_0x346991[_0xe671('0x1a')]=qs[_0xe671('0x1a')](_0xb4d0ef[_0xe671('0x2d')][_0xe671('0x1a')]);}_0x346991['order']=qs[_0xe671('0x35')](_0xb4d0ef[_0xe671('0x2d')][_0xe671('0x35')]);_0x346991[_0xe671('0x36')]=qs['filters'](_['pick'](_0xb4d0ef[_0xe671('0x2d')],_0x559872[_0xe671('0x2f')]),_0x6daba5);if(_0xb4d0ef[_0xe671('0x2d')][_0xe671('0x37')]){_0x346991[_0xe671('0x36')]=_[_0xe671('0x38')](_0x346991[_0xe671('0x36')],{'$or':_[_0xe671('0x28')](_0x6daba5,function(_0x22a63a){if(_0x22a63a[_0xe671('0x2b')]!=='VIRTUAL'){var _0x148716={};_0x148716[_0x22a63a[_0xe671('0x26')]]={'$like':'%'+_0xb4d0ef[_0xe671('0x2d')]['filter']+'%'};return _0x148716;}})});}_0x346991=_[_0xe671('0x38')]({},_0x346991,_0xb4d0ef[_0xe671('0x39')]);var _0x3723c0={'where':_0x346991['where']};return db['WhatsappQueueReport']['count'](_0x3723c0)['then'](function(_0x260351){_0x1e1d55['count']=_0x260351;if(_0xb4d0ef[_0xe671('0x2d')][_0xe671('0x3a')]){_0x346991[_0xe671('0x3b')]=[{'all':!![]}];}return db[_0xe671('0x29')][_0xe671('0x3c')](_0x346991);})['then'](function(_0x3fbdaa){_0x1e1d55[_0xe671('0x3d')]=_0x3fbdaa;return _0x1e1d55;})[_0xe671('0x20')](respondWithFilteredResult(_0x2ca3d0,_0x346991))[_0xe671('0x3e')](handleError(_0x2ca3d0,null));};exports[_0xe671('0x3f')]=function(_0x828297,_0xd03ce2){var _0xc0e8ce={'raw':!![],'where':{'id':_0x828297[_0xe671('0x40')]['id']}},_0x39f8c6={};_0x39f8c6['model']=_[_0xe671('0x2e')](db['WhatsappQueueReport'][_0xe671('0x41')]);_0x39f8c6[_0xe671('0x2d')]=_['keys'](_0x828297['query']);_0x39f8c6[_0xe671('0x2f')]=_[_0xe671('0x30')](_0x39f8c6[_0xe671('0x2c')],_0x39f8c6[_0xe671('0x2d')]);_0xc0e8ce[_0xe671('0x32')]=_[_0xe671('0x30')](_0x39f8c6[_0xe671('0x2c')],qs['fields'](_0x828297[_0xe671('0x2d')][_0xe671('0x31')]));_0xc0e8ce[_0xe671('0x32')]=_0xc0e8ce['attributes']['length']?_0xc0e8ce[_0xe671('0x32')]:_0x39f8c6[_0xe671('0x2c')];if(_0x828297['query'][_0xe671('0x3a')]){_0xc0e8ce['include']=[{'all':!![]}];}_0xc0e8ce=_[_0xe671('0x38')]({},_0xc0e8ce,_0x828297[_0xe671('0x39')]);return db[_0xe671('0x29')][_0xe671('0x42')](_0xc0e8ce)['then'](handleEntityNotFound(_0xd03ce2,null))[_0xe671('0x20')](respondWithResult(_0xd03ce2,null))[_0xe671('0x3e')](handleError(_0xd03ce2,null));};exports['create']=function(_0x5baa20,_0x4d7134){return db[_0xe671('0x29')][_0xe671('0x43')](_0x5baa20['body'],{})[_0xe671('0x20')](respondWithResult(_0x4d7134,0xc9))[_0xe671('0x3e')](handleError(_0x4d7134,null));};exports[_0xe671('0x44')]=function(_0x564374,_0x3d216e){if(_0x564374['body']['id']){delete _0x564374[_0xe671('0x45')]['id'];}return db['WhatsappQueueReport'][_0xe671('0x42')]({'where':{'id':_0x564374[_0xe671('0x40')]['id']}})[_0xe671('0x20')](handleEntityNotFound(_0x3d216e,null))['then'](saveUpdates(_0x564374['body'],null))[_0xe671('0x20')](respondWithResult(_0x3d216e,null))[_0xe671('0x3e')](handleError(_0x3d216e,null));};exports[_0xe671('0x21')]=function(_0x755624,_0x25c708){return db[_0xe671('0x29')][_0xe671('0x42')]({'where':{'id':_0x755624[_0xe671('0x40')]['id']}})['then'](handleEntityNotFound(_0x25c708,null))[_0xe671('0x20')](removeEntity(_0x25c708,null))[_0xe671('0x3e')](handleError(_0x25c708,null));};exports[_0xe671('0x46')]=function(_0x3b0afc,_0x59e40d){return db['WhatsappQueueReport'][_0xe671('0x46')]()[_0xe671('0x20')](respondWithResult(_0x59e40d,null))['catch'](handleError(_0x59e40d,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index cb0f9f1..9512281 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 _0x3199=['../../config/logger','moment','request-promise','path','rimraf','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util'];(function(_0x42e02d,_0x23574f){var _0x466de4=function(_0x3053f5){while(--_0x3053f5){_0x42e02d['push'](_0x42e02d['shift']());}};_0x466de4(++_0x23574f);}(_0x3199,0xe2));var _0x9319=function(_0x40d3f5,_0xcf3e24){_0x40d3f5=_0x40d3f5-0x0;var _0x473a5c=_0x3199[_0x40d3f5];return _0x473a5c;};'use strict';var _=require(_0x9319('0x0'));var util=require(_0x9319('0x1'));var logger=require(_0x9319('0x2'))('api');var moment=require(_0x9319('0x3'));var BPromise=require('bluebird');var rp=require(_0x9319('0x4'));var fs=require('fs');var path=require(_0x9319('0x5'));var rimraf=require(_0x9319('0x6'));var config=require('../../config/environment');var attributes=require(_0x9319('0x7'));module['exports']=function(_0x5cc1a9,_0x51c159){return _0x5cc1a9[_0x9319('0x8')](_0x9319('0x9'),attributes,{'tableName':_0x9319('0xa'),'paranoid':![],'indexes':[{'name':_0x9319('0xb'),'fields':[_0x9319('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xef31=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util'];(function(_0x4400f7,_0xe6e042){var _0x158216=function(_0x1b7e14){while(--_0x1b7e14){_0x4400f7['push'](_0x4400f7['shift']());}};_0x158216(++_0xe6e042);}(_0xef31,0x74));var _0x1ef3=function(_0x4528f5,_0x4caa39){_0x4528f5=_0x4528f5-0x0;var _0x28b6d2=_0xef31[_0x4528f5];return _0x28b6d2;};'use strict';var _=require('lodash');var util=require(_0x1ef3('0x0'));var logger=require(_0x1ef3('0x1'))(_0x1ef3('0x2'));var moment=require(_0x1ef3('0x3'));var BPromise=require(_0x1ef3('0x4'));var rp=require(_0x1ef3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ef3('0x6'));var config=require('../../config/environment');var attributes=require(_0x1ef3('0x7'));module[_0x1ef3('0x8')]=function(_0x5d125e,_0x54d935){return _0x5d125e[_0x1ef3('0x9')](_0x1ef3('0xa'),attributes,{'tableName':_0x1ef3('0xb'),'paranoid':![],'indexes':[{'name':_0x1ef3('0xc'),'fields':[_0x1ef3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 93bdcd8..0c1a6d7 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 _0xcd52=['WhatsappQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','WhatsappQueueReport,\x20%s,\x20%s','info','result','create','options','CreateWhatsappQueueReport','stringify','catch','UpdateWhatsappQueueReport','WhatsappQueueReport','update','body','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug'];(function(_0x51b1d2,_0x1fcf2b){var _0x46a4bd=function(_0x457ec0){while(--_0x457ec0){_0x51b1d2['push'](_0x51b1d2['shift']());}};_0x46a4bd(++_0x1fcf2b);}(_0xcd52,0xa9));var _0x2cd5=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xcd52[_0x255d5b];return _0x3e141a;};'use strict';var _=require(_0x2cd5('0x0'));var util=require(_0x2cd5('0x1'));var moment=require(_0x2cd5('0x2'));var BPromise=require(_0x2cd5('0x3'));var rs=require(_0x2cd5('0x4'));var fs=require('fs');var Redis=require(_0x2cd5('0x5'));var db=require(_0x2cd5('0x6'))['db'];var utils=require(_0x2cd5('0x7'));var logger=require(_0x2cd5('0x8'))(_0x2cd5('0x9'));var config=require(_0x2cd5('0xa'));var jayson=require(_0x2cd5('0xb'));var client=jayson['client'][_0x2cd5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13d358,_0x40e22f,_0x2873bd){return new BPromise(function(_0x48b64a,_0x5e42d1){return client[_0x2cd5('0xd')](_0x13d358,_0x2873bd)[_0x2cd5('0xe')](function(_0x17f8c7){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x40e22f,'request\x20sent');logger[_0x2cd5('0xf')](_0x2cd5('0x10'),_0x40e22f,_0x2cd5('0x11'),JSON['stringify'](_0x17f8c7));if(_0x17f8c7['error']){if(_0x17f8c7[_0x2cd5('0x12')][_0x2cd5('0x13')]===0x1f4){logger[_0x2cd5('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x40e22f,_0x17f8c7[_0x2cd5('0x12')]['message']);return _0x5e42d1(_0x17f8c7['error'][_0x2cd5('0x14')]);}logger['error'](_0x2cd5('0x15'),_0x40e22f,_0x17f8c7['error']['message']);return _0x48b64a(_0x17f8c7[_0x2cd5('0x12')][_0x2cd5('0x14')]);}else{logger[_0x2cd5('0x16')](_0x2cd5('0x15'),_0x40e22f,'request\x20sent');_0x48b64a(_0x17f8c7[_0x2cd5('0x17')][_0x2cd5('0x14')]);}})['catch'](function(_0x2a54ce){logger[_0x2cd5('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x40e22f,_0x2a54ce);_0x5e42d1(_0x2a54ce);});});}exports['CreateWhatsappQueueReport']=function(_0x47e06e){var _0x3b6943=this;return new Promise(function(_0x1d8e1a,_0x33afe1){return db['WhatsappQueueReport'][_0x2cd5('0x18')](_0x47e06e['body'],{'raw':_0x47e06e[_0x2cd5('0x19')]?_0x47e06e[_0x2cd5('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e518b){logger[_0x2cd5('0x16')](_0x2cd5('0x1a'),_0x47e06e);logger[_0x2cd5('0xf')](_0x2cd5('0x1a'),_0x47e06e,JSON[_0x2cd5('0x1b')](_0x1e518b));_0x1d8e1a(_0x1e518b);})[_0x2cd5('0x1c')](function(_0x53e7ca){logger[_0x2cd5('0x12')](_0x2cd5('0x1a'),_0x53e7ca['message'],_0x47e06e);_0x33afe1(_0x3b6943[_0x2cd5('0x12')](0x1f4,_0x53e7ca[_0x2cd5('0x14')]));});});};exports[_0x2cd5('0x1d')]=function(_0x21b4b5){var _0x52bae6=this;return new Promise(function(_0x4490d,_0x220c5f){return db[_0x2cd5('0x1e')][_0x2cd5('0x1f')](_0x21b4b5[_0x2cd5('0x20')],{'raw':_0x21b4b5['options']?_0x21b4b5[_0x2cd5('0x19')][_0x2cd5('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21b4b5['options']?_0x21b4b5['options'][_0x2cd5('0x22')]||null:null,'attributes':_0x21b4b5[_0x2cd5('0x19')]?_0x21b4b5[_0x2cd5('0x19')][_0x2cd5('0x23')]||null:null,'limit':_0x21b4b5[_0x2cd5('0x19')]?_0x21b4b5['options'][_0x2cd5('0x24')]||null:null})[_0x2cd5('0xe')](function(_0x1abbae){logger[_0x2cd5('0x16')](_0x2cd5('0x1d'),_0x21b4b5);logger[_0x2cd5('0xf')]('UpdateWhatsappQueueReport',_0x21b4b5,JSON[_0x2cd5('0x1b')](_0x1abbae));_0x4490d(_0x1abbae);})[_0x2cd5('0x1c')](function(_0x32bfdd){logger['error'](_0x2cd5('0x1d'),_0x32bfdd[_0x2cd5('0x14')],_0x21b4b5);_0x220c5f(_0x52bae6['error'](0x1f4,_0x32bfdd[_0x2cd5('0x14')]));});});}; \ No newline at end of file +var _0x44d3=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','WhatsappQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','catch','WhatsappQueueReport','body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','attributes','limit','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x49a0bf,_0xe8c905){var _0x30bc35=function(_0x46cfe3){while(--_0x46cfe3){_0x49a0bf['push'](_0x49a0bf['shift']());}};_0x30bc35(++_0xe8c905);}(_0x44d3,0x1bc));var _0x344d=function(_0x4c04be,_0x2e3e1a){_0x4c04be=_0x4c04be-0x0;var _0x8263f9=_0x44d3[_0x4c04be];return _0x8263f9;};'use strict';var _=require(_0x344d('0x0'));var util=require(_0x344d('0x1'));var moment=require(_0x344d('0x2'));var BPromise=require('bluebird');var rs=require(_0x344d('0x3'));var fs=require('fs');var Redis=require(_0x344d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x344d('0x5'));var logger=require(_0x344d('0x6'))('rpc');var config=require(_0x344d('0x7'));var jayson=require(_0x344d('0x8'));var client=jayson[_0x344d('0x9')][_0x344d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da360,_0x3bd374,_0x124c23){return new BPromise(function(_0x286789,_0x2a2c05){return client[_0x344d('0xb')](_0x3da360,_0x124c23)[_0x344d('0xc')](function(_0x2e2491){logger['info'](_0x344d('0xd'),_0x3bd374,'request\x20sent');logger[_0x344d('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x3bd374,_0x344d('0xf'),JSON[_0x344d('0x10')](_0x2e2491));if(_0x2e2491[_0x344d('0x11')]){if(_0x2e2491[_0x344d('0x11')]['code']===0x1f4){logger[_0x344d('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3bd374,_0x2e2491[_0x344d('0x11')][_0x344d('0x12')]);return _0x2a2c05(_0x2e2491[_0x344d('0x11')]['message']);}logger[_0x344d('0x11')](_0x344d('0xd'),_0x3bd374,_0x2e2491['error'][_0x344d('0x12')]);return _0x286789(_0x2e2491['error'][_0x344d('0x12')]);}else{logger[_0x344d('0x13')]('WhatsappQueueReport,\x20%s,\x20%s',_0x3bd374,_0x344d('0xf'));_0x286789(_0x2e2491['result']['message']);}})[_0x344d('0x14')](function(_0xe4de0b){logger[_0x344d('0x11')](_0x344d('0xd'),_0x3bd374,_0xe4de0b);_0x2a2c05(_0xe4de0b);});});}exports['CreateWhatsappQueueReport']=function(_0x542d5b){var _0x4364a6=this;return new Promise(function(_0x486170,_0x1dbbe1){return db[_0x344d('0x15')]['create'](_0x542d5b[_0x344d('0x16')],{'raw':_0x542d5b[_0x344d('0x17')]?_0x542d5b[_0x344d('0x17')][_0x344d('0x18')]===undefined?!![]:![]:!![]})[_0x344d('0xc')](function(_0x1e20ef){logger[_0x344d('0x13')]('CreateWhatsappQueueReport',_0x542d5b);logger[_0x344d('0xe')](_0x344d('0x19'),_0x542d5b,JSON[_0x344d('0x10')](_0x1e20ef));_0x486170(_0x1e20ef);})[_0x344d('0x14')](function(_0x20f2dd){logger['error'](_0x344d('0x19'),_0x20f2dd[_0x344d('0x12')],_0x542d5b);_0x1dbbe1(_0x4364a6[_0x344d('0x11')](0x1f4,_0x20f2dd[_0x344d('0x12')]));});});};exports[_0x344d('0x1a')]=function(_0x2551a3){var _0x1e00e6=this;return new Promise(function(_0xb0e829,_0x11a652){return db[_0x344d('0x15')][_0x344d('0x1b')](_0x2551a3[_0x344d('0x16')],{'raw':_0x2551a3[_0x344d('0x17')]?_0x2551a3[_0x344d('0x17')][_0x344d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2551a3[_0x344d('0x17')]?_0x2551a3[_0x344d('0x17')]['where']||null:null,'attributes':_0x2551a3[_0x344d('0x17')]?_0x2551a3[_0x344d('0x17')][_0x344d('0x1c')]||null:null,'limit':_0x2551a3[_0x344d('0x17')]?_0x2551a3[_0x344d('0x17')][_0x344d('0x1d')]||null:null})[_0x344d('0xc')](function(_0x4320b7){logger[_0x344d('0x13')](_0x344d('0x1a'),_0x2551a3);logger['debug'](_0x344d('0x1a'),_0x2551a3,JSON[_0x344d('0x10')](_0x4320b7));_0xb0e829(_0x4320b7);})['catch'](function(_0x4f0fc9){logger[_0x344d('0x11')](_0x344d('0x1a'),_0x4f0fc9[_0x344d('0x12')],_0x2551a3);_0x11a652(_0x1e00e6[_0x344d('0x11')](0x1f4,_0x4f0fc9[_0x344d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 67699bd..9ef21a2 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 _0xed66=['/describe','describe','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index'];(function(_0x59b48e,_0x4ce021){var _0x3c28ed=function(_0x32e44f){while(--_0x32e44f){_0x59b48e['push'](_0x59b48e['shift']());}};_0x3c28ed(++_0x4ce021);}(_0xed66,0x104));var _0x6ed6=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0xed66[_0x2714ec];return _0x2608e5;};'use strict';var multer=require(_0x6ed6('0x0'));var util=require(_0x6ed6('0x1'));var path=require(_0x6ed6('0x2'));var timeout=require(_0x6ed6('0x3'));var express=require(_0x6ed6('0x4'));var router=express[_0x6ed6('0x5')]();var auth=require(_0x6ed6('0x6'));var interaction=require(_0x6ed6('0x7'));var config=require(_0x6ed6('0x8'));var controller=require(_0x6ed6('0x9'));router[_0x6ed6('0xa')]('/',auth[_0x6ed6('0xb')](),controller[_0x6ed6('0xc')]);router[_0x6ed6('0xa')](_0x6ed6('0xd'),auth[_0x6ed6('0xb')](),controller[_0x6ed6('0xe')]);router[_0x6ed6('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x6ed6('0xb')](),controller['create']);router[_0x6ed6('0xf')](_0x6ed6('0x10'),auth[_0x6ed6('0xb')](),controller[_0x6ed6('0x11')]);router[_0x6ed6('0x12')](_0x6ed6('0x10'),auth[_0x6ed6('0xb')](),controller[_0x6ed6('0x13')]);module[_0x6ed6('0x14')]=router; \ No newline at end of file +var _0x4c6a=['index','/describe','describe','get','/:id','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x13adf5,_0x1a98bf){var _0x3e6825=function(_0x27dfad){while(--_0x27dfad){_0x13adf5['push'](_0x13adf5['shift']());}};_0x3e6825(++_0x1a98bf);}(_0x4c6a,0xb4));var _0xa4c6=function(_0x513df3,_0x2390b8){_0x513df3=_0x513df3-0x0;var _0x3dab66=_0x4c6a[_0x513df3];return _0x3dab66;};'use strict';var multer=require(_0xa4c6('0x0'));var util=require(_0xa4c6('0x1'));var path=require('path');var timeout=require(_0xa4c6('0x2'));var express=require('express');var router=express[_0xa4c6('0x3')]();var auth=require(_0xa4c6('0x4'));var interaction=require(_0xa4c6('0x5'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router['get']('/',auth[_0xa4c6('0x6')](),controller[_0xa4c6('0x7')]);router['get'](_0xa4c6('0x8'),auth[_0xa4c6('0x6')](),controller[_0xa4c6('0x9')]);router[_0xa4c6('0xa')](_0xa4c6('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xa4c6('0x6')](),controller[_0xa4c6('0xc')]);router['put'](_0xa4c6('0xb'),auth['isAuthenticated'](),controller[_0xa4c6('0xd')]);router[_0xa4c6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa4c6('0xf')]);module[_0xa4c6('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index a8f4998..f1079a5 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 _0xb10b=['ENUM','account','queue','DATE','sequelize','STRING'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xb10b,0x12a));var _0xbb10=function(_0x2d1406,_0x8a575e){_0x2d1406=_0x2d1406-0x0;var _0x31a9fb=_0xb10b[_0x2d1406];return _0x31a9fb;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xbb10('0x2')](_0xbb10('0x3'),'agent',_0xbb10('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xbb10('0x5')]}}; \ No newline at end of file +var _0x0b0e=['DATE','sequelize','STRING','account','agent','queue'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0x0b0e[_0x4bcf38];return _0x4a89be;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe0b0('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xe0b0('0x5')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index ab247bd..892d996 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 _0xec29=['WhatsappTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','count','include','catch','show','params','keys','options','create','body','find','describe','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject','then','destroy','stack','name','send','map'];(function(_0x40eb61,_0x2d0ecc){var _0x1b3018=function(_0xa70c1e){while(--_0xa70c1e){_0x40eb61['push'](_0x40eb61['shift']());}};_0x1b3018(++_0x2d0ecc);}(_0xec29,0x65));var _0x9ec2=function(_0x325b01,_0x46eb6c){_0x325b01=_0x325b01-0x0;var _0x1eca18=_0xec29[_0x325b01];return _0x1eca18;};'use strict';var pdf=require(_0x9ec2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9ec2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ec2('0x2'));var rp=require(_0x9ec2('0x3'));var moment=require(_0x9ec2('0x4'));var BPromise=require(_0x9ec2('0x5'));var Mustache=require(_0x9ec2('0x6'));var util=require(_0x9ec2('0x7'));var path=require(_0x9ec2('0x8'));var sox=require('sox');var csv=require(_0x9ec2('0x9'));var ejs=require(_0x9ec2('0xa'));var fs=require('fs');var _=require(_0x9ec2('0xb'));var squel=require(_0x9ec2('0xc'));var crypto=require(_0x9ec2('0xd'));var jsforce=require(_0x9ec2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9ec2('0x9'));var querystring=require(_0x9ec2('0xf'));var Papa=require(_0x9ec2('0x10'));var Redis=require(_0x9ec2('0x11'));var authService=require(_0x9ec2('0x12'));var qs=require(_0x9ec2('0x13'));var as=require(_0x9ec2('0x14'));var hardwareService=require(_0x9ec2('0x15'));var logger=require(_0x9ec2('0x16'))(_0x9ec2('0x17'));var utils=require(_0x9ec2('0x18'));var config=require(_0x9ec2('0x19'));var db=require(_0x9ec2('0x1a'))['db'];function respondWithStatusCode(_0x2b7e71,_0x2eb1d4){_0x2eb1d4=_0x2eb1d4||0xcc;return function(_0x2c13c1){if(_0x2c13c1){return _0x2b7e71[_0x9ec2('0x1b')](_0x2eb1d4);}return _0x2b7e71['status'](_0x2eb1d4)[_0x9ec2('0x1c')]();};}function respondWithResult(_0x35866d,_0x948fec){_0x948fec=_0x948fec||0xc8;return function(_0xd8543d){if(_0xd8543d){return _0x35866d[_0x9ec2('0x1d')](_0x948fec)['json'](_0xd8543d);}};}function respondWithFilteredResult(_0x713b0b,_0x3b882e){return function(_0x8caaa){if(_0x8caaa){var _0x395367=_0x8caaa['count'],_0x3cc4e1=_0x3b882e['offset'],_0x249ceb=_0x3b882e[_0x9ec2('0x1e')]+_0x3b882e[_0x9ec2('0x1f')],_0x516600;if(_0x249ceb>=_0x395367){_0x249ceb=_0x395367;_0x516600=0xc8;}else{_0x516600=0xce;}_0x713b0b[_0x9ec2('0x1d')](_0x516600);return _0x713b0b[_0x9ec2('0x20')](_0x9ec2('0x21'),_0x3cc4e1+'-'+_0x249ceb+'/'+_0x395367)[_0x9ec2('0x22')](_0x8caaa);}return null;};}function patchUpdates(_0x4e3f0a){return function(_0x4f1ea3){try{jsonpatch[_0x9ec2('0x23')](_0x4f1ea3,_0x4e3f0a,!![]);}catch(_0x1496bd){return BPromise[_0x9ec2('0x24')](_0x1496bd);}return _0x4f1ea3['save']();};}function saveUpdates(_0x3691e5,_0x4bf8fe){return function(_0x3c08e3){if(_0x3c08e3){return _0x3c08e3['update'](_0x3691e5)[_0x9ec2('0x25')](function(_0x167878){return _0x167878;});}return null;};}function removeEntity(_0x4684b5,_0x950f7d){return function(_0x4e34df){if(_0x4e34df){return _0x4e34df[_0x9ec2('0x26')]()[_0x9ec2('0x25')](function(){_0x4684b5[_0x9ec2('0x1d')](0xcc)[_0x9ec2('0x1c')]();});}};}function handleEntityNotFound(_0x5ab186,_0x5991c1){return function(_0x180d1a){if(!_0x180d1a){_0x5ab186['sendStatus'](0x194);}return _0x180d1a;};}function handleError(_0x533c75,_0x4fb1bf){_0x4fb1bf=_0x4fb1bf||0x1f4;return function(_0xcdd703){logger['error'](_0xcdd703[_0x9ec2('0x27')]);if(_0xcdd703[_0x9ec2('0x28')]){delete _0xcdd703[_0x9ec2('0x28')];}_0x533c75[_0x9ec2('0x1d')](_0x4fb1bf)[_0x9ec2('0x29')](_0xcdd703);};}exports['index']=function(_0x1732ff,_0x436fe0){var _0x3cde12={},_0x221c18={},_0x4f7e81={'count':0x0,'rows':[]};var _0x1f3784=_[_0x9ec2('0x2a')](db[_0x9ec2('0x2b')][_0x9ec2('0x2c')],function(_0x5799ad){return{'name':_0x5799ad[_0x9ec2('0x2d')],'type':_0x5799ad[_0x9ec2('0x2e')][_0x9ec2('0x2f')]};});_0x221c18[_0x9ec2('0x30')]=_[_0x9ec2('0x2a')](_0x1f3784,_0x9ec2('0x28'));_0x221c18[_0x9ec2('0x31')]=_['keys'](_0x1732ff[_0x9ec2('0x31')]);_0x221c18[_0x9ec2('0x32')]=_[_0x9ec2('0x33')](_0x221c18['model'],_0x221c18['query']);_0x3cde12[_0x9ec2('0x34')]=_[_0x9ec2('0x33')](_0x221c18['model'],qs[_0x9ec2('0x35')](_0x1732ff[_0x9ec2('0x31')][_0x9ec2('0x35')]));_0x3cde12[_0x9ec2('0x34')]=_0x3cde12[_0x9ec2('0x34')]['length']?_0x3cde12[_0x9ec2('0x34')]:_0x221c18['model'];if(!_0x1732ff['query'][_0x9ec2('0x36')]('nolimit')){_0x3cde12[_0x9ec2('0x1f')]=qs[_0x9ec2('0x1f')](_0x1732ff[_0x9ec2('0x31')][_0x9ec2('0x1f')]);_0x3cde12['offset']=qs[_0x9ec2('0x1e')](_0x1732ff[_0x9ec2('0x31')][_0x9ec2('0x1e')]);}_0x3cde12[_0x9ec2('0x37')]=qs[_0x9ec2('0x38')](_0x1732ff[_0x9ec2('0x31')]['sort']);_0x3cde12[_0x9ec2('0x39')]=qs['filters'](_['pick'](_0x1732ff[_0x9ec2('0x31')],_0x221c18[_0x9ec2('0x32')]),_0x1f3784);if(_0x1732ff[_0x9ec2('0x31')][_0x9ec2('0x3a')]){_0x3cde12['where']=_[_0x9ec2('0x3b')](_0x3cde12['where'],{'$or':_[_0x9ec2('0x2a')](_0x1f3784,function(_0x143392){if(_0x143392[_0x9ec2('0x2e')]!==_0x9ec2('0x3c')){var _0x3cb961={};_0x3cb961[_0x143392[_0x9ec2('0x28')]]={'$like':'%'+_0x1732ff[_0x9ec2('0x31')][_0x9ec2('0x3a')]+'%'};return _0x3cb961;}})});}_0x3cde12=_[_0x9ec2('0x3b')]({},_0x3cde12,_0x1732ff['options']);var _0x6ca312={'where':_0x3cde12['where']};return db[_0x9ec2('0x2b')][_0x9ec2('0x3d')](_0x6ca312)[_0x9ec2('0x25')](function(_0x22168a){_0x4f7e81[_0x9ec2('0x3d')]=_0x22168a;if(_0x1732ff[_0x9ec2('0x31')]['includeAll']){_0x3cde12[_0x9ec2('0x3e')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x3cde12);})[_0x9ec2('0x25')](function(_0x21c961){_0x4f7e81['rows']=_0x21c961;return _0x4f7e81;})[_0x9ec2('0x25')](respondWithFilteredResult(_0x436fe0,_0x3cde12))[_0x9ec2('0x3f')](handleError(_0x436fe0,null));};exports[_0x9ec2('0x40')]=function(_0x2af4d5,_0x2283cc){var _0x30b619={'raw':!![],'where':{'id':_0x2af4d5[_0x9ec2('0x41')]['id']}},_0x5624e6={};_0x5624e6[_0x9ec2('0x30')]=_['keys'](db['WhatsappTransferReport'][_0x9ec2('0x2c')]);_0x5624e6['query']=_[_0x9ec2('0x42')](_0x2af4d5[_0x9ec2('0x31')]);_0x5624e6[_0x9ec2('0x32')]=_['intersection'](_0x5624e6[_0x9ec2('0x30')],_0x5624e6[_0x9ec2('0x31')]);_0x30b619[_0x9ec2('0x34')]=_[_0x9ec2('0x33')](_0x5624e6['model'],qs[_0x9ec2('0x35')](_0x2af4d5[_0x9ec2('0x31')][_0x9ec2('0x35')]));_0x30b619[_0x9ec2('0x34')]=_0x30b619['attributes']['length']?_0x30b619[_0x9ec2('0x34')]:_0x5624e6[_0x9ec2('0x30')];if(_0x2af4d5[_0x9ec2('0x31')]['includeAll']){_0x30b619[_0x9ec2('0x3e')]=[{'all':!![]}];}_0x30b619=_[_0x9ec2('0x3b')]({},_0x30b619,_0x2af4d5[_0x9ec2('0x43')]);return db[_0x9ec2('0x2b')]['find'](_0x30b619)[_0x9ec2('0x25')](handleEntityNotFound(_0x2283cc,null))[_0x9ec2('0x25')](respondWithResult(_0x2283cc,null))[_0x9ec2('0x3f')](handleError(_0x2283cc,null));};exports[_0x9ec2('0x44')]=function(_0x2023cf,_0x47b682){return db[_0x9ec2('0x2b')][_0x9ec2('0x44')](_0x2023cf[_0x9ec2('0x45')],{})['then'](respondWithResult(_0x47b682,0xc9))[_0x9ec2('0x3f')](handleError(_0x47b682,null));};exports['update']=function(_0x32d55e,_0x276222){if(_0x32d55e['body']['id']){delete _0x32d55e['body']['id'];}return db[_0x9ec2('0x2b')][_0x9ec2('0x46')]({'where':{'id':_0x32d55e[_0x9ec2('0x41')]['id']}})['then'](handleEntityNotFound(_0x276222,null))[_0x9ec2('0x25')](saveUpdates(_0x32d55e[_0x9ec2('0x45')],null))['then'](respondWithResult(_0x276222,null))[_0x9ec2('0x3f')](handleError(_0x276222,null));};exports['destroy']=function(_0x297a62,_0x2521d5){return db[_0x9ec2('0x2b')][_0x9ec2('0x46')]({'where':{'id':_0x297a62[_0x9ec2('0x41')]['id']}})[_0x9ec2('0x25')](handleEntityNotFound(_0x2521d5,null))[_0x9ec2('0x25')](removeEntity(_0x2521d5,null))[_0x9ec2('0x3f')](handleError(_0x2521d5,null));};exports[_0x9ec2('0x47')]=function(_0x5ba452,_0x5a3673){return db[_0x9ec2('0x2b')]['describe']()[_0x9ec2('0x25')](respondWithResult(_0x5a3673,null))[_0x9ec2('0x3f')](handleError(_0x5a3673,null));}; \ No newline at end of file +var _0x2543=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','map','WhatsappTransferReport','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','show','rawAttributes','includeAll','find','create','update','body','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring'];(function(_0x4b281a,_0x1733de){var _0x3149a7=function(_0x3a6b40){while(--_0x3a6b40){_0x4b281a['push'](_0x4b281a['shift']());}};_0x3149a7(++_0x1733de);}(_0x2543,0x110));var _0x3254=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x2543[_0xf91841];return _0x4b9c44;};'use strict';var pdf=require(_0x3254('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3254('0x1'));var zipdir=require(_0x3254('0x2'));var jsonpatch=require(_0x3254('0x3'));var rp=require('request-promise');var moment=require(_0x3254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3254('0x5'));var util=require(_0x3254('0x6'));var path=require(_0x3254('0x7'));var sox=require(_0x3254('0x8'));var csv=require(_0x3254('0x9'));var ejs=require(_0x3254('0xa'));var fs=require('fs');var _=require(_0x3254('0xb'));var squel=require(_0x3254('0xc'));var crypto=require(_0x3254('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3254('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3254('0xf'));var Papa=require(_0x3254('0x10'));var Redis=require(_0x3254('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x3254('0x12'));var as=require(_0x3254('0x13'));var hardwareService=require(_0x3254('0x14'));var logger=require(_0x3254('0x15'))('api');var utils=require(_0x3254('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57f25e,_0x27f28f){_0x27f28f=_0x27f28f||0xcc;return function(_0x308e92){if(_0x308e92){return _0x57f25e[_0x3254('0x17')](_0x27f28f);}return _0x57f25e[_0x3254('0x18')](_0x27f28f)[_0x3254('0x19')]();};}function respondWithResult(_0x2c3d7f,_0x17c136){_0x17c136=_0x17c136||0xc8;return function(_0x36cdd5){if(_0x36cdd5){return _0x2c3d7f[_0x3254('0x18')](_0x17c136)['json'](_0x36cdd5);}};}function respondWithFilteredResult(_0x180597,_0x50b354){return function(_0x1d2d7e){if(_0x1d2d7e){var _0x30d801=_0x1d2d7e[_0x3254('0x1a')],_0xbec264=_0x50b354[_0x3254('0x1b')],_0xb7367f=_0x50b354[_0x3254('0x1b')]+_0x50b354['limit'],_0x4b6f5c;if(_0xb7367f>=_0x30d801){_0xb7367f=_0x30d801;_0x4b6f5c=0xc8;}else{_0x4b6f5c=0xce;}_0x180597[_0x3254('0x18')](_0x4b6f5c);return _0x180597[_0x3254('0x1c')](_0x3254('0x1d'),_0xbec264+'-'+_0xb7367f+'/'+_0x30d801)[_0x3254('0x1e')](_0x1d2d7e);}return null;};}function patchUpdates(_0x33a8af){return function(_0x5f1d0a){try{jsonpatch[_0x3254('0x1f')](_0x5f1d0a,_0x33a8af,!![]);}catch(_0x471d69){return BPromise[_0x3254('0x20')](_0x471d69);}return _0x5f1d0a[_0x3254('0x21')]();};}function saveUpdates(_0x5ace25,_0x91cf6c){return function(_0x13d836){if(_0x13d836){return _0x13d836['update'](_0x5ace25)[_0x3254('0x22')](function(_0x2491be){return _0x2491be;});}return null;};}function removeEntity(_0x40fe36,_0x26c4a5){return function(_0x1730f7){if(_0x1730f7){return _0x1730f7[_0x3254('0x23')]()[_0x3254('0x22')](function(){_0x40fe36[_0x3254('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59f646,_0x11cabf){return function(_0x340077){if(!_0x340077){_0x59f646[_0x3254('0x17')](0x194);}return _0x340077;};}function handleError(_0xf536af,_0x14d915){_0x14d915=_0x14d915||0x1f4;return function(_0x337771){logger[_0x3254('0x24')](_0x337771[_0x3254('0x25')]);if(_0x337771[_0x3254('0x26')]){delete _0x337771[_0x3254('0x26')];}_0xf536af['status'](_0x14d915)[_0x3254('0x27')](_0x337771);};}exports['index']=function(_0x5eeb56,_0x2dacb2){var _0x5341f0={},_0x100761={},_0x5e25c4={'count':0x0,'rows':[]};var _0x4d85b9=_[_0x3254('0x28')](db[_0x3254('0x29')]['rawAttributes'],function(_0x539c11){return{'name':_0x539c11['fieldName'],'type':_0x539c11[_0x3254('0x2a')][_0x3254('0x2b')]};});_0x100761['model']=_[_0x3254('0x28')](_0x4d85b9,_0x3254('0x26'));_0x100761['query']=_[_0x3254('0x2c')](_0x5eeb56[_0x3254('0x2d')]);_0x100761[_0x3254('0x2e')]=_[_0x3254('0x2f')](_0x100761[_0x3254('0x30')],_0x100761[_0x3254('0x2d')]);_0x5341f0[_0x3254('0x31')]=_['intersection'](_0x100761[_0x3254('0x30')],qs[_0x3254('0x32')](_0x5eeb56[_0x3254('0x2d')]['fields']));_0x5341f0[_0x3254('0x31')]=_0x5341f0[_0x3254('0x31')]['length']?_0x5341f0[_0x3254('0x31')]:_0x100761['model'];if(!_0x5eeb56[_0x3254('0x2d')][_0x3254('0x33')](_0x3254('0x34'))){_0x5341f0[_0x3254('0x35')]=qs[_0x3254('0x35')](_0x5eeb56['query']['limit']);_0x5341f0[_0x3254('0x1b')]=qs['offset'](_0x5eeb56[_0x3254('0x2d')][_0x3254('0x1b')]);}_0x5341f0[_0x3254('0x36')]=qs[_0x3254('0x37')](_0x5eeb56[_0x3254('0x2d')][_0x3254('0x37')]);_0x5341f0[_0x3254('0x38')]=qs[_0x3254('0x2e')](_['pick'](_0x5eeb56[_0x3254('0x2d')],_0x100761[_0x3254('0x2e')]),_0x4d85b9);if(_0x5eeb56['query'][_0x3254('0x39')]){_0x5341f0[_0x3254('0x38')]=_[_0x3254('0x3a')](_0x5341f0['where'],{'$or':_[_0x3254('0x28')](_0x4d85b9,function(_0x4d035e){if(_0x4d035e[_0x3254('0x2a')]!==_0x3254('0x3b')){var _0x3fc377={};_0x3fc377[_0x4d035e['name']]={'$like':'%'+_0x5eeb56['query'][_0x3254('0x39')]+'%'};return _0x3fc377;}})});}_0x5341f0=_['merge']({},_0x5341f0,_0x5eeb56['options']);var _0x41d5ed={'where':_0x5341f0['where']};return db[_0x3254('0x29')][_0x3254('0x1a')](_0x41d5ed)[_0x3254('0x22')](function(_0x4d3c07){_0x5e25c4[_0x3254('0x1a')]=_0x4d3c07;if(_0x5eeb56[_0x3254('0x2d')]['includeAll']){_0x5341f0['include']=[{'all':!![]}];}return db[_0x3254('0x29')][_0x3254('0x3c')](_0x5341f0);})['then'](function(_0x475dfa){_0x5e25c4[_0x3254('0x3d')]=_0x475dfa;return _0x5e25c4;})[_0x3254('0x22')](respondWithFilteredResult(_0x2dacb2,_0x5341f0))[_0x3254('0x3e')](handleError(_0x2dacb2,null));};exports[_0x3254('0x3f')]=function(_0x56aab8,_0x3aba39){var _0x58c851={'raw':!![],'where':{'id':_0x56aab8['params']['id']}},_0x24f795={};_0x24f795['model']=_[_0x3254('0x2c')](db['WhatsappTransferReport'][_0x3254('0x40')]);_0x24f795[_0x3254('0x2d')]=_[_0x3254('0x2c')](_0x56aab8['query']);_0x24f795[_0x3254('0x2e')]=_[_0x3254('0x2f')](_0x24f795['model'],_0x24f795[_0x3254('0x2d')]);_0x58c851[_0x3254('0x31')]=_[_0x3254('0x2f')](_0x24f795[_0x3254('0x30')],qs[_0x3254('0x32')](_0x56aab8[_0x3254('0x2d')]['fields']));_0x58c851[_0x3254('0x31')]=_0x58c851[_0x3254('0x31')]['length']?_0x58c851['attributes']:_0x24f795['model'];if(_0x56aab8[_0x3254('0x2d')][_0x3254('0x41')]){_0x58c851['include']=[{'all':!![]}];}_0x58c851=_[_0x3254('0x3a')]({},_0x58c851,_0x56aab8['options']);return db[_0x3254('0x29')][_0x3254('0x42')](_0x58c851)[_0x3254('0x22')](handleEntityNotFound(_0x3aba39,null))['then'](respondWithResult(_0x3aba39,null))[_0x3254('0x3e')](handleError(_0x3aba39,null));};exports[_0x3254('0x43')]=function(_0x1410cc,_0x31d13e){return db[_0x3254('0x29')][_0x3254('0x43')](_0x1410cc['body'],{})['then'](respondWithResult(_0x31d13e,0xc9))['catch'](handleError(_0x31d13e,null));};exports[_0x3254('0x44')]=function(_0x17bc95,_0x9ca0cc){if(_0x17bc95[_0x3254('0x45')]['id']){delete _0x17bc95[_0x3254('0x45')]['id'];}return db[_0x3254('0x29')][_0x3254('0x42')]({'where':{'id':_0x17bc95[_0x3254('0x46')]['id']}})[_0x3254('0x22')](handleEntityNotFound(_0x9ca0cc,null))[_0x3254('0x22')](saveUpdates(_0x17bc95[_0x3254('0x45')],null))[_0x3254('0x22')](respondWithResult(_0x9ca0cc,null))['catch'](handleError(_0x9ca0cc,null));};exports[_0x3254('0x23')]=function(_0x460b12,_0x22e6de){return db[_0x3254('0x29')][_0x3254('0x42')]({'where':{'id':_0x460b12[_0x3254('0x46')]['id']}})[_0x3254('0x22')](handleEntityNotFound(_0x22e6de,null))[_0x3254('0x22')](removeEntity(_0x22e6de,null))[_0x3254('0x3e')](handleError(_0x22e6de,null));};exports[_0x3254('0x47')]=function(_0x34b599,_0xd8594f){return db[_0x3254('0x29')]['describe']()[_0x3254('0x22')](respondWithResult(_0xd8594f,null))[_0x3254('0x3e')](handleError(_0xd8594f,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 96ec2c4..42b83c6 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 _0x37cc=['api','moment','bluebird','request-promise','rimraf','../../config/environment','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0xfdd6b6,_0x19497a){var _0x464439=function(_0x147e70){while(--_0x147e70){_0xfdd6b6['push'](_0xfdd6b6['shift']());}};_0x464439(++_0x19497a);}(_0x37cc,0x72));var _0xc37c=function(_0x46a59e,_0x4bf9ff){_0x46a59e=_0x46a59e-0x0;var _0x35aae0=_0x37cc[_0x46a59e];return _0x35aae0;};'use strict';var _=require(_0xc37c('0x0'));var util=require(_0xc37c('0x1'));var logger=require(_0xc37c('0x2'))(_0xc37c('0x3'));var moment=require(_0xc37c('0x4'));var BPromise=require(_0xc37c('0x5'));var rp=require(_0xc37c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc37c('0x7'));var config=require(_0xc37c('0x8'));var attributes=require('./whatsappTransferReport.attributes');module['exports']=function(_0x563b5f,_0x672a83){return _0x563b5f[_0xc37c('0x9')](_0xc37c('0xa'),attributes,{'tableName':_0xc37c('0xb'),'paranoid':![],'indexes':[{'name':_0xc37c('0xc'),'fields':[_0xc37c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd74b=['exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x254bfa,_0x5628e3){var _0x32c0da=function(_0x251afa){while(--_0x251afa){_0x254bfa['push'](_0x254bfa['shift']());}};_0x32c0da(++_0x5628e3);}(_0xd74b,0x1d3));var _0xbd74=function(_0x3c8ca2,_0x517ac5){_0x3c8ca2=_0x3c8ca2-0x0;var _0x518893=_0xd74b[_0x3c8ca2];return _0x518893;};'use strict';var _=require(_0xbd74('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbd74('0x1'));var rp=require(_0xbd74('0x2'));var fs=require('fs');var path=require(_0xbd74('0x3'));var rimraf=require(_0xbd74('0x4'));var config=require(_0xbd74('0x5'));var attributes=require('./whatsappTransferReport.attributes');module[_0xbd74('0x6')]=function(_0x2af011,_0x1dbee4){return _0x2af011[_0xbd74('0x7')](_0xbd74('0x8'),attributes,{'tableName':_0xbd74('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xbd74('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 354211c..551dd10 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 _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\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(_0x156483,_0x3ae1bf){var _0x4a9edd=function(_0x37f0de){while(--_0x37f0de){_0x156483['push'](_0x156483['shift']());}};_0x4a9edd(++_0x3ae1bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\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(_0x21a218,_0x57083c){var _0x803fe6=function(_0x40c194){while(--_0x40c194){_0x21a218['push'](_0x21a218['shift']());}};_0x803fe6(++_0x57083c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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/app.js b/server/app.js index 4a0e88f..3d9420b 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fa1=['exit','lodash','./mysqldb','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','listen','then','start','info','Online\x20apps:','map','filter','online','name','join','status','None','seedDB','./config/seedDB','./config/license','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s'];(function(_0x168127,_0x59cea1){var _0x4c99ad=function(_0x4ab3f2){while(--_0x4ab3f2){_0x168127['push'](_0x168127['shift']());}};_0x4c99ad(++_0x59cea1);}(_0x3fa1,0x12d));var _0x13fa=function(_0x100795,_0xe44314){_0x100795=_0x100795-0x0;var _0x349888=_0x3fa1[_0x100795];return _0x349888;};'use strict';var _=require(_0x13fa('0x0'));var mysqldb=require(_0x13fa('0x1'));var rpc=require('./rpc');var config=require(_0x13fa('0x2'));var logger=require(_0x13fa('0x3'))(_0x13fa('0x4'));var pm2=require('./config/pm2');var pm2Config=require(_0x13fa('0x5'));var schedule=require('./config/schedule');var chat=require(_0x13fa('0x6'));var transcribe=require(_0x13fa('0x7'));function main(){return mysqldb['db'][_0x13fa('0x8')][_0x13fa('0x9')]()['then'](function(){return rpc[_0x13fa('0xa')]();})[_0x13fa('0xb')](function(_0xabe114){logger['info'](_0xabe114);return chat['start']();})['then'](function(){return schedule[_0x13fa('0xc')]();})['then'](function(){return transcribe[_0x13fa('0xc')]();})[_0x13fa('0xb')](function(_0x4dfc54){logger[_0x13fa('0xd')](_0x4dfc54);return pm2[_0x13fa('0xc')](pm2Config);})[_0x13fa('0xb')](function(_0x1788a4){logger['info'](_0x13fa('0xe'),_[_0x13fa('0xf')](_[_0x13fa('0x10')](_0x1788a4,{'status':_0x13fa('0x11')}),_0x13fa('0x12'))[_0x13fa('0x13')]());logger[_0x13fa('0xd')]('Offline\x20apps:',_[_0x13fa('0xf')](_[_0x13fa('0x10')](_0x1788a4,function(_0x7b5f38){return _0x7b5f38[_0x13fa('0x14')]!==_0x13fa('0x11');}),'name')[_0x13fa('0x13')]()||_0x13fa('0x15'));config[_0x13fa('0x16')]&&require(_0x13fa('0x17'))['default']();require(_0x13fa('0x18'))[_0x13fa('0x19')]();})[_0x13fa('0x1a')](function(_0x53913b){logger[_0x13fa('0x1b')](_0x13fa('0x1c'),_0x53913b);process[_0x13fa('0x1d')](0x1);});}main(); \ No newline at end of file +var _0x1d86=['./mysqldb','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule/chat','sequelize','then','listen','start','info','map','filter','name','join','Offline\x20apps:','status','online','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash'];(function(_0x2a99ea,_0x1bfb13){var _0x5887ae=function(_0x55dfc2){while(--_0x55dfc2){_0x2a99ea['push'](_0x2a99ea['shift']());}};_0x5887ae(++_0x1bfb13);}(_0x1d86,0x143));var _0x61d8=function(_0x41ca42,_0xcb78c6){_0x41ca42=_0x41ca42-0x0;var _0x575a24=_0x1d86[_0x41ca42];return _0x575a24;};'use strict';var _=require(_0x61d8('0x0'));var mysqldb=require(_0x61d8('0x1'));var rpc=require('./rpc');var config=require(_0x61d8('0x2'));var logger=require(_0x61d8('0x3'))('app');var pm2=require(_0x61d8('0x4'));var pm2Config=require(_0x61d8('0x5'));var schedule=require('./config/schedule');var chat=require(_0x61d8('0x6'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0x61d8('0x7')]['sync']()[_0x61d8('0x8')](function(){return rpc[_0x61d8('0x9')]();})['then'](function(_0x51fe11){logger['info'](_0x51fe11);return chat['start']();})['then'](function(){return schedule[_0x61d8('0xa')]();})[_0x61d8('0x8')](function(){return transcribe['start']();})['then'](function(_0xb324d1){logger['info'](_0xb324d1);return pm2['start'](pm2Config);})[_0x61d8('0x8')](function(_0x45991e){logger[_0x61d8('0xb')]('Online\x20apps:',_[_0x61d8('0xc')](_[_0x61d8('0xd')](_0x45991e,{'status':'online'}),_0x61d8('0xe'))[_0x61d8('0xf')]());logger[_0x61d8('0xb')](_0x61d8('0x10'),_['map'](_[_0x61d8('0xd')](_0x45991e,function(_0x3e4029){return _0x3e4029[_0x61d8('0x11')]!==_0x61d8('0x12');}),_0x61d8('0xe'))[_0x61d8('0xf')]()||_0x61d8('0x13'));config[_0x61d8('0x14')]&&require(_0x61d8('0x15'))[_0x61d8('0x16')]();require(_0x61d8('0x17'))['default']();})[_0x61d8('0x18')](function(_0x4493d8){logger[_0x61d8('0x19')](_0x61d8('0x1a'),_0x4493d8);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index f77b9b9..89c293e 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 _0x0752=['crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isAuthenticated','use','user','ChatInteraction','findOne','params','disposition','then','closed','unmanaged','json','Unmanaged.','Forbidden.','catch','authorization','startsWith','headers','Basic','User','authenticate','pass','Bearer','status','query','getUuid','apikey','sub','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','getLicense','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','secret','session','verify','toString','HS512','../../mysqldb','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','secrets','role','fullname','name','internal','email','userpic','md5secret','voicePause','chatPause','faxPause','smsPause','showWebBar','lastLoginAt','lastPauseAt'];(function(_0x420e0f,_0x425b33){var _0x28448a=function(_0x2197cb){while(--_0x2197cb){_0x420e0f['push'](_0x420e0f['shift']());}};_0x28448a(++_0x425b33);}(_0x0752,0xf5));var _0x2075=function(_0x269218,_0x1f1df3){_0x269218=_0x269218-0x0;var _0x3f96de=_0x0752[_0x269218];return _0x3f96de;};'use strict';var db=require(_0x2075('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var _=require(_0x2075('0x1'));var jwt=require(_0x2075('0x2'));var expressJwt=require('express-jwt');var compose=require(_0x2075('0x3'));var basicAuth=require(_0x2075('0x4'));var crypto=require(_0x2075('0x5'));var BPromise=require(_0x2075('0x6'));var validateJwt=expressJwt({'secret':config[_0x2075('0x7')]['session']});var userAttributes=['id',_0x2075('0x8'),_0x2075('0x9'),_0x2075('0xa'),_0x2075('0xb'),_0x2075('0xc'),_0x2075('0xd'),'permissions',_0x2075('0xe'),_0x2075('0xf'),_0x2075('0x10'),'mailPause',_0x2075('0x11'),_0x2075('0x12'),'openchannelPause','pauseType',_0x2075('0x13'),_0x2075('0x14'),_0x2075('0x15'),_0x2075('0x16'),'allowmessenger',_0x2075('0x17'),_0x2075('0x18'),_0x2075('0x19'),_0x2075('0x1a'),_0x2075('0x1b'),'phoneBarEnableRecording','phoneBarEnableDtmfTone',_0x2075('0x1c'),_0x2075('0x1d'),_0x2075('0x1e'),'phoneBarRemoteControl',_0x2075('0x1f'),_0x2075('0x20'),_0x2075('0x21'),_0x2075('0x22')];exports['isChatInteractionAuthorized']=function(){return this[_0x2075('0x23')](!![])[_0x2075('0x24')](function(_0x24bc70,_0x2ffec8,_0x40dc26){if(_0x24bc70[_0x2075('0x25')]){_0x40dc26();}else{return db[_0x2075('0x26')][_0x2075('0x27')]({'where':{'id':_0x24bc70[_0x2075('0x28')]['id']},'attributes':['id','closed',_0x2075('0x29')],'raw':!![]})[_0x2075('0x2a')](function(_0x1d03ec){if(_0x1d03ec&&_0x1d03ec[_0x2075('0x2b')]){return _0x2ffec8['status'](_0x1d03ec['disposition']===_0x2075('0x2c')?0x195:0x193)[_0x2075('0x2d')]({'message':_0x1d03ec[_0x2075('0x29')]===_0x2075('0x2c')?_0x2075('0x2e'):_0x2075('0x2f')});}else{_0x40dc26();}})[_0x2075('0x30')](function(_0x5a5cd5){_0x40dc26(_0x5a5cd5);});}});};exports[_0x2075('0x23')]=function isAuthenticated(_0x116d1d){return compose()['use'](function(_0x5d088f,_0x4d8dd3,_0x5567c3){if(_0x5d088f['headers'][_0x2075('0x31')]){if(_[_0x2075('0x32')](_0x5d088f[_0x2075('0x33')][_0x2075('0x31')],_0x2075('0x34'))){var _0x567801=basicAuth(_0x5d088f);db[_0x2075('0x35')]['find']({'where':{'name':_0x567801[_0x2075('0xa')]}})[_0x2075('0x2a')](function(_0x1b4689){if(!_0x1b4689||!_0x1b4689[_0x2075('0x36')](_0x567801[_0x2075('0x37')])){return _0x4d8dd3['status'](0x191)[_0x2075('0x2d')]({'message':'Wrong\x20credentials.'});}_0x5d088f['user']={'id':_0x1b4689['id']};_0x5567c3();})[_0x2075('0x30')](function(_0x1d8e00){_0x5567c3(_0x1d8e00);});}else if(_[_0x2075('0x32')](_0x5d088f['headers'][_0x2075('0x31')],_0x2075('0x38'))){validateJwt(_0x5d088f,_0x4d8dd3,_0x5567c3);}else{if(_0x116d1d){_0x5567c3();}else{return _0x4d8dd3[_0x2075('0x39')](0x193)[_0x2075('0x2d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5d088f[_0x2075('0x3a')]['apikey']){try{var _0x3bfd5d={'audience':hardwareConf[_0x2075('0x3b')](),'issuer':hardwareConf[_0x2075('0x3b')]()};verifyJwt(_0x5d088f['query'][_0x2075('0x3c')],_0x3bfd5d)[_0x2075('0x2a')](function(_0x74aa0b){return db[_0x2075('0x35')]['find']({'where':{'id':_0x74aa0b[_0x2075('0x3d')]}})[_0x2075('0x2a')](function(_0x3f959d){if(!_0x3f959d||!_['isEqual'](_0x3f959d[_0x2075('0x3e')],_0x74aa0b[_0x2075('0x3f')])){return _0x4d8dd3[_0x2075('0x39')](0x191)[_0x2075('0x2d')]({'message':_0x2075('0x40')});}_0x5d088f[_0x2075('0x25')]={'id':_0x3f959d['id']};_0x5567c3();});})['catch'](function(){return _0x4d8dd3[_0x2075('0x39')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x2a19a6){_0x5567c3(_0x2a19a6);}}else if(_0x116d1d){_0x5567c3();}else{return _0x4d8dd3[_0x2075('0x39')](0x193)[_0x2075('0x2d')]({'message':_0x2075('0x41')});}})[_0x2075('0x24')](function(_0x51bb77,_0x51dcaa,_0x536d15){if(_0x51bb77[_0x2075('0x25')]){db['User']['find']({'where':{'id':_0x51bb77[_0x2075('0x25')]['id']},'attributes':userAttributes})[_0x2075('0x2a')](function(_0x178b13){if(!_0x178b13){return _0x51dcaa['status'](0x194)[_0x2075('0x2d')]({'message':_0x2075('0x42')});}_0x51bb77['user']=_0x178b13;_0x536d15();})[_0x2075('0x30')](function(_0x601c03){_0x536d15(_0x601c03);});}else if(_0x116d1d){_0x536d15();}else{return _0x51dcaa[_0x2075('0x39')](0x194)[_0x2075('0x2d')]({'message':_0x2075('0x43')});}});};exports[_0x2075('0x44')]=function canUpdate(){return compose()['use'](function(_0x56bc44,_0x5ed98c,_0x536075){return require(_0x2075('0x45'))[_0x2075('0x46')]()[_0x2075('0x2a')](function(_0x101a7e){if(_0x101a7e['update']){_0x536075();}else{return _0x5ed98c[_0x2075('0x39')](0x193)['json']({'message':'Forbidden'});}})[_0x2075('0x30')](function(_0x592f42){_0x536075(_0x592f42);});});};exports[_0x2075('0x47')]=function(_0x29785f,_0x4ba28e,_0x177217){_0x29785f['isMiddleware']=!![];return _0x177217();};exports[_0x2075('0x48')]=function signToken(_0x5932fa){return signJwt(_0x5932fa);};exports[_0x2075('0x49')]=function(_0x31fb39,_0x10c911){if(!_0x31fb39[_0x2075('0x25')]){return _0x10c911[_0x2075('0x39')](0x194)[_0x2075('0x2d')]({'message':_0x2075('0x4a')});}var _0x4cb3fb={'payload':{'id':_0x31fb39[_0x2075('0x25')]['id'],'role':_0x31fb39[_0x2075('0x25')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x4cb3fb)[_0x2075('0x2a')](function(_0x12b0bd){_0x10c911['cookie'](_0x2075('0x4b'),_0x12b0bd);_0x10c911[_0x2075('0x4c')](_0x2075('0x4d'));})[_0x2075('0x30')](function(_0x1f6ca0){return _0x10c911[_0x2075('0x39')](0x1f4)['send'](_0x1f6ca0);});};exports['retrieveApiKey']=function(_0x237d35){if(_[_0x2075('0x4e')](_0x237d35[_0x2075('0x3e')])||_[_0x2075('0x4e')](_0x237d35[_0x2075('0x4f')])){return null;}else{return createJwt(_0x237d35);}};exports[_0x2075('0x50')]=function(_0x2f83a3){_0x2f83a3['apiKeyNonce']=generateNonce();_0x2f83a3['apiKeyIat']=generateIssuedAt();return createJwt(_0x2f83a3);};exports[_0x2075('0x51')]=function(_0x2e2819,_0x732ed){var _0x162d83=_0x2e2819[_0x2075('0x3a')][_0x2075('0x3c')];if(_0x162d83){var _0xce4276={'nonce':_0x732ed[_0x2075('0x3e')],'iat':_0x732ed[_0x2075('0x4f')],'audience':hardwareConf[_0x2075('0x3b')](),'issuer':hardwareConf[_0x2075('0x3b')]()};return verifyJwt(_0x162d83,_0xce4276)[_0x2075('0x2a')](function(){return generateApiKey(_0x732ed);});}else{throw{'message':_0x2075('0x52')};}};function signJwt(_0x350c7a){var _0x167eb5=BPromise[_0x2075('0x53')](jwt['sign'],{'context':jwt});var _0x2ac95e=_0x350c7a[_0x2075('0x54')]||config['secrets'][_0x2075('0x55')];return new BPromise(function(_0x4b406c,_0x44815a){_0x167eb5(_0x350c7a['payload'],_0x2ac95e,_0x350c7a['options'])[_0x2075('0x2a')](function(_0x35481e){_0x4b406c(_0x35481e);})[_0x2075('0x30')](function(_0x390e86){_0x44815a(_0x390e86);});});}function verifyJwt(_0x58c11b,_0x577808,_0x4df8c0){var _0x1fffd6=BPromise[_0x2075('0x53')](jwt[_0x2075('0x56')],{'context':jwt});var _0x31a4ff=_0x4df8c0||config[_0x2075('0x7')][_0x2075('0x55')];return new BPromise(function(_0x3983be,_0x54632f){_0x1fffd6(_0x58c11b,_0x31a4ff,_0x577808)[_0x2075('0x2a')](function(_0x414432){_0x3983be(_0x414432);})[_0x2075('0x30')](function(_0x336bd7){_0x54632f(_0x336bd7);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x2075('0x57')]('hex');}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x2075('0x57')]();}function createJwt(_0x24a343){var _0x2b535a={'payload':{'iat':_0x24a343[_0x2075('0x4f')],'nonce':_0x24a343[_0x2075('0x3e')]},'options':{'algorithm':_0x2075('0x58'),'subject':_0x24a343['id'][_0x2075('0x57')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x2075('0x3b')]()}};return signJwt(_0x2b535a)[_0x2075('0x2a')](function(_0xa7d751){return{'iat':_0x24a343[_0x2075('0x4f')],'nonce':_0x24a343['apiKeyNonce'],'token':_0xa7d751};});} \ No newline at end of file +var _0x8a3e=['../../config/license/util','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','promisify','sign','secrets','session','payload','verify','randomBytes','toString','hex','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','express-jwt','composable-middleware','crypto','bluebird','role','fullname','internal','email','userpic','md5secret','voicePause','chatPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','hotdesk','interface','isChatInteractionAuthorized','use','ChatInteraction','params','closed','disposition','then','status','json','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','Basic','find','name','authenticate','pass','user','startsWith','Bearer','Unknown\x20authorization\x20format','query','getUuid','apikey','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate'];(function(_0x249073,_0x5432bd){var _0x3b6c02=function(_0x5369fb){while(--_0x5369fb){_0x249073['push'](_0x249073['shift']());}};_0x3b6c02(++_0x5432bd);}(_0x8a3e,0x7b));var _0xe8a3=function(_0x54c258,_0x44d850){_0x54c258=_0x54c258-0x0;var _0x3c673c=_0x8a3e[_0x54c258];return _0x3c673c;};'use strict';var db=require(_0xe8a3('0x0'))['db'];var config=require(_0xe8a3('0x1'));var hardwareConf=require('../../config/license/hardware');var _=require(_0xe8a3('0x2'));var jwt=require(_0xe8a3('0x3'));var expressJwt=require(_0xe8a3('0x4'));var compose=require(_0xe8a3('0x5'));var basicAuth=require('basic-auth');var crypto=require(_0xe8a3('0x6'));var BPromise=require(_0xe8a3('0x7'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xe8a3('0x8'),_0xe8a3('0x9'),'name',_0xe8a3('0xa'),_0xe8a3('0xb'),_0xe8a3('0xc'),'permissions',_0xe8a3('0xd'),_0xe8a3('0xe'),_0xe8a3('0xf'),'mailPause',_0xe8a3('0x10'),_0xe8a3('0x11'),'openchannelPause',_0xe8a3('0x12'),_0xe8a3('0x13'),_0xe8a3('0x14'),_0xe8a3('0x15'),_0xe8a3('0x16'),_0xe8a3('0x17'),_0xe8a3('0x18'),'alias',_0xe8a3('0x19'),'phoneBarAutoAnswerDelay',_0xe8a3('0x1a'),_0xe8a3('0x1b'),_0xe8a3('0x1c'),'phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort',_0xe8a3('0x1d'),_0xe8a3('0x1e'),'userProfileId'];exports[_0xe8a3('0x1f')]=function(){return this['isAuthenticated'](!![])[_0xe8a3('0x20')](function(_0x389542,_0x459564,_0x59f013){if(_0x389542['user']){_0x59f013();}else{return db[_0xe8a3('0x21')]['findOne']({'where':{'id':_0x389542[_0xe8a3('0x22')]['id']},'attributes':['id',_0xe8a3('0x23'),_0xe8a3('0x24')],'raw':!![]})[_0xe8a3('0x25')](function(_0x555f27){if(_0x555f27&&_0x555f27['closed']){return _0x459564[_0xe8a3('0x26')](_0x555f27[_0xe8a3('0x24')]==='unmanaged'?0x195:0x193)[_0xe8a3('0x27')]({'message':_0x555f27[_0xe8a3('0x24')]===_0xe8a3('0x28')?_0xe8a3('0x29'):_0xe8a3('0x2a')});}else{_0x59f013();}})[_0xe8a3('0x2b')](function(_0x24e443){_0x59f013(_0x24e443);});}});};exports[_0xe8a3('0x2c')]=function isAuthenticated(_0x19d2f0){return compose()[_0xe8a3('0x20')](function(_0x5e29fa,_0x168b44,_0x285e2e){if(_0x5e29fa[_0xe8a3('0x2d')][_0xe8a3('0x2e')]){if(_['startsWith'](_0x5e29fa[_0xe8a3('0x2d')]['authorization'],_0xe8a3('0x2f'))){var _0x4c59d7=basicAuth(_0x5e29fa);db['User'][_0xe8a3('0x30')]({'where':{'name':_0x4c59d7[_0xe8a3('0x31')]}})[_0xe8a3('0x25')](function(_0x402c40){if(!_0x402c40||!_0x402c40[_0xe8a3('0x32')](_0x4c59d7[_0xe8a3('0x33')])){return _0x168b44[_0xe8a3('0x26')](0x191)['json']({'message':'Wrong\x20credentials.'});}_0x5e29fa[_0xe8a3('0x34')]={'id':_0x402c40['id']};_0x285e2e();})[_0xe8a3('0x2b')](function(_0x25cbec){_0x285e2e(_0x25cbec);});}else if(_[_0xe8a3('0x35')](_0x5e29fa[_0xe8a3('0x2d')]['authorization'],_0xe8a3('0x36'))){validateJwt(_0x5e29fa,_0x168b44,_0x285e2e);}else{if(_0x19d2f0){_0x285e2e();}else{return _0x168b44[_0xe8a3('0x26')](0x193)[_0xe8a3('0x27')]({'message':_0xe8a3('0x37')});}}}else if(_0x5e29fa[_0xe8a3('0x38')]['apikey']){try{var _0x42e781={'audience':hardwareConf[_0xe8a3('0x39')](),'issuer':hardwareConf[_0xe8a3('0x39')]()};verifyJwt(_0x5e29fa[_0xe8a3('0x38')][_0xe8a3('0x3a')],_0x42e781)[_0xe8a3('0x25')](function(_0x47d730){return db['User'][_0xe8a3('0x30')]({'where':{'id':_0x47d730[_0xe8a3('0x3b')]}})['then'](function(_0x39c130){if(!_0x39c130||!_[_0xe8a3('0x3c')](_0x39c130[_0xe8a3('0x3d')],_0x47d730[_0xe8a3('0x3e')])){return _0x168b44['status'](0x191)['json']({'message':_0xe8a3('0x3f')});}_0x5e29fa[_0xe8a3('0x34')]={'id':_0x39c130['id']};_0x285e2e();});})['catch'](function(){return _0x168b44[_0xe8a3('0x26')](0x191)[_0xe8a3('0x27')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x289170){_0x285e2e(_0x289170);}}else if(_0x19d2f0){_0x285e2e();}else{return _0x168b44['status'](0x193)[_0xe8a3('0x27')]({'message':_0xe8a3('0x37')});}})['use'](function(_0x183bc0,_0x310268,_0x37ab7c){if(_0x183bc0[_0xe8a3('0x34')]){db['User'][_0xe8a3('0x30')]({'where':{'id':_0x183bc0['user']['id']},'attributes':userAttributes})[_0xe8a3('0x25')](function(_0x1ba5ba){if(!_0x1ba5ba){return _0x310268['status'](0x194)['json']({'message':_0xe8a3('0x40')});}_0x183bc0['user']=_0x1ba5ba;_0x37ab7c();})[_0xe8a3('0x2b')](function(_0x5926a2){_0x37ab7c(_0x5926a2);});}else if(_0x19d2f0){_0x37ab7c();}else{return _0x310268[_0xe8a3('0x26')](0x194)[_0xe8a3('0x27')]({'message':_0xe8a3('0x41')});}});};exports[_0xe8a3('0x42')]=function canUpdate(){return compose()[_0xe8a3('0x20')](function(_0x170bc4,_0x22ce0f,_0x1eb4d2){return require(_0xe8a3('0x43'))[_0xe8a3('0x44')]()[_0xe8a3('0x25')](function(_0xc388a){if(_0xc388a[_0xe8a3('0x45')]){_0x1eb4d2();}else{return _0x22ce0f[_0xe8a3('0x26')](0x193)[_0xe8a3('0x27')]({'message':_0xe8a3('0x46')});}})[_0xe8a3('0x2b')](function(_0x5a4d42){_0x1eb4d2(_0x5a4d42);});});};exports[_0xe8a3('0x47')]=function(_0x4aeffb,_0x197b55,_0x4e6df3){_0x4aeffb[_0xe8a3('0x47')]=!![];return _0x4e6df3();};exports[_0xe8a3('0x48')]=function signToken(_0x9953e4){return signJwt(_0x9953e4);};exports[_0xe8a3('0x49')]=function(_0x2c35da,_0xecd3f0){if(!_0x2c35da['user']){return _0xecd3f0['status'](0x194)[_0xe8a3('0x27')]({'message':_0xe8a3('0x4a')});}var _0xeeafd1={'payload':{'id':_0x2c35da['user']['id'],'role':_0x2c35da[_0xe8a3('0x34')][_0xe8a3('0x8')]},'options':{'expiresIn':0x15180}};return signJwt(_0xeeafd1)[_0xe8a3('0x25')](function(_0x16fb58){_0xecd3f0[_0xe8a3('0x4b')](_0xe8a3('0x4c'),_0x16fb58);_0xecd3f0[_0xe8a3('0x4d')](_0xe8a3('0x4e'));})[_0xe8a3('0x2b')](function(_0x4494b8){return _0xecd3f0[_0xe8a3('0x26')](0x1f4)[_0xe8a3('0x4f')](_0x4494b8);});};exports[_0xe8a3('0x50')]=function(_0x28197d){if(_[_0xe8a3('0x51')](_0x28197d[_0xe8a3('0x3d')])||_[_0xe8a3('0x51')](_0x28197d[_0xe8a3('0x52')])){return null;}else{return createJwt(_0x28197d);}};exports[_0xe8a3('0x53')]=function(_0x189f42){_0x189f42['apiKeyNonce']=generateNonce();_0x189f42[_0xe8a3('0x52')]=generateIssuedAt();return createJwt(_0x189f42);};exports[_0xe8a3('0x54')]=function(_0x487269,_0xb757ac){var _0x29187e=_0x487269[_0xe8a3('0x38')][_0xe8a3('0x3a')];if(_0x29187e){var _0x2449a3={'nonce':_0xb757ac[_0xe8a3('0x3d')],'iat':_0xb757ac[_0xe8a3('0x52')],'audience':hardwareConf[_0xe8a3('0x39')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x29187e,_0x2449a3)[_0xe8a3('0x25')](function(){return generateApiKey(_0xb757ac);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};function signJwt(_0x6348cb){var _0x434315=BPromise[_0xe8a3('0x55')](jwt[_0xe8a3('0x56')],{'context':jwt});var _0x103d70=_0x6348cb['secret']||config[_0xe8a3('0x57')][_0xe8a3('0x58')];return new BPromise(function(_0x4fe42b,_0x387652){_0x434315(_0x6348cb[_0xe8a3('0x59')],_0x103d70,_0x6348cb['options'])[_0xe8a3('0x25')](function(_0x17a97d){_0x4fe42b(_0x17a97d);})[_0xe8a3('0x2b')](function(_0x410fc2){_0x387652(_0x410fc2);});});}function verifyJwt(_0x4046b4,_0x17be99,_0x392a55){var _0xdd06a5=BPromise['promisify'](jwt[_0xe8a3('0x5a')],{'context':jwt});var _0x2020f7=_0x392a55||config[_0xe8a3('0x57')][_0xe8a3('0x58')];return new BPromise(function(_0x58388e,_0x23626d){_0xdd06a5(_0x4046b4,_0x2020f7,_0x17be99)[_0xe8a3('0x25')](function(_0x1f54f4){_0x58388e(_0x1f54f4);})['catch'](function(_0x1ba5d1){_0x23626d(_0x1ba5d1);});});}function generateNonce(){return crypto[_0xe8a3('0x5b')](0x10)[_0xe8a3('0x5c')](_0xe8a3('0x5d'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0xe8a3('0x5c')]();}function createJwt(_0x1d49f1){var _0x32ce5a={'payload':{'iat':_0x1d49f1[_0xe8a3('0x52')],'nonce':_0x1d49f1['apiKeyNonce']},'options':{'algorithm':_0xe8a3('0x5e'),'subject':_0x1d49f1['id'][_0xe8a3('0x5c')](),'issuer':hardwareConf[_0xe8a3('0x39')](),'audience':hardwareConf[_0xe8a3('0x39')]()}};return signJwt(_0x32ce5a)[_0xe8a3('0x25')](function(_0x42fd6f){return{'iat':_0x1d49f1[_0xe8a3('0x52')],'nonce':_0x1d49f1[_0xe8a3('0x3d')],'token':_0x42fd6f};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 77e0de5..c6568aa 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 _0x0713=['aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','binary','write','end','final','close','decryptFile','createDecipher','update','unlink'];(function(_0x744c15,_0x3d48af){var _0x13a3d2=function(_0x557e1a){while(--_0x557e1a){_0x744c15['push'](_0x744c15['shift']());}};_0x13a3d2(++_0x3d48af);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x3071('0x0')};function combineOptions(_0x2afa91){var _0x27405a={};for(var _0x305d85 in defaultOptions){if(defaultOptions[_0x3071('0x1')](_0x305d85)){_0x27405a[_0x305d85]=defaultOptions[_0x305d85];}}if(_0x2afa91){for(var _0x52b5fb in _0x2afa91){if(_0x2afa91[_0x3071('0x1')](_0x52b5fb)){_0x27405a[_0x52b5fb]=_0x2afa91[_0x52b5fb];}}}return _0x27405a;}exports[_0x3071('0x2')]=function(_0x33a70c,_0x3137c8,_0xabd7b6,_0x41cf76){return new BPromise(function(_0x1d3dd6,_0x2f1e87){_0x41cf76=combineOptions(_0x41cf76);var _0xbd737f=new Buffer(_0xabd7b6);var _0x22274c=fs[_0x3071('0x3')](_0x33a70c);var _0x2fce7a=fs[_0x3071('0x4')](_0x3137c8);var _0x4a36ec=crypto[_0x3071('0x5')](_0x41cf76[_0x3071('0x6')],_0xbd737f);_0x22274c['on'](_0x3071('0x7'),function(_0xff9a29){var _0x1ce844=new Buffer(_0x4a36ec['update'](_0xff9a29),_0x3071('0x8'));_0x2fce7a[_0x3071('0x9')](_0x1ce844);});_0x22274c['on'](_0x3071('0xa'),function(){try{var _0x3ed4a0=new Buffer(_0x4a36ec[_0x3071('0xb')]('binary'),'binary');_0x2fce7a[_0x3071('0x9')](_0x3ed4a0);_0x2fce7a['end']();_0x2fce7a['on'](_0x3071('0xc'),function(){return _0x1d3dd6(_0x3137c8);});}catch(_0x44fbae){fs['unlink'](_0x3137c8);return _0x2f1e87(_0x44fbae);}});});};exports[_0x3071('0xd')]=function(_0x4e1219,_0x2fc15d,_0x45c93b,_0x1271d0){return new BPromise(function(_0x1f14e1,_0x1caa5d){_0x1271d0=combineOptions(_0x1271d0);var _0x2a6a4b=new Buffer(_0x45c93b);var _0x157a47=fs[_0x3071('0x3')](_0x4e1219);var _0x21aad3=fs[_0x3071('0x4')](_0x2fc15d);var _0x5f3c22=crypto[_0x3071('0xe')](_0x1271d0[_0x3071('0x6')],_0x2a6a4b);_0x157a47['on'](_0x3071('0x7'),function(_0x108a83){var _0x3acf0e=new Buffer(_0x5f3c22[_0x3071('0xf')](_0x108a83),_0x3071('0x8'));_0x21aad3[_0x3071('0x9')](_0x3acf0e);});_0x157a47['on']('end',function(){try{var _0x359e66=new Buffer(_0x5f3c22[_0x3071('0xb')](_0x3071('0x8')),'binary');_0x21aad3[_0x3071('0x9')](_0x359e66);_0x21aad3['end']();_0x21aad3['on'](_0x3071('0xc'),function(){return _0x1f14e1(_0x2fc15d);});}catch(_0x43128c){fs[_0x3071('0x10')](_0x2fc15d);return _0x1caa5d(_0x43128c);}});});}; \ No newline at end of file +var _0x70e0=['createDecipher','algorithm','data','close','unlink','crypto','bluebird','aes192','hasOwnProperty','createReadStream','createWriteStream','createCipher','update','binary','write','end','final'];(function(_0x3f5bec,_0x597c03){var _0x320885=function(_0xbe05db){while(--_0xbe05db){_0x3f5bec['push'](_0x3f5bec['shift']());}};_0x320885(++_0x597c03);}(_0x70e0,0x17b));var _0x070e=function(_0x458563,_0x254bca){_0x458563=_0x458563-0x0;var _0x37f4b7=_0x70e0[_0x458563];return _0x37f4b7;};'use strict';var crypto=require(_0x070e('0x0'));var fs=require('fs');var BPromise=require(_0x070e('0x1'));var defaultOptions={'algorithm':_0x070e('0x2')};function combineOptions(_0x4d95bb){var _0x579b83={};for(var _0x16e651 in defaultOptions){if(defaultOptions[_0x070e('0x3')](_0x16e651)){_0x579b83[_0x16e651]=defaultOptions[_0x16e651];}}if(_0x4d95bb){for(var _0x277d32 in _0x4d95bb){if(_0x4d95bb[_0x070e('0x3')](_0x277d32)){_0x579b83[_0x277d32]=_0x4d95bb[_0x277d32];}}}return _0x579b83;}exports['encryptFile']=function(_0x7bce9b,_0x579a6b,_0x46fe68,_0x4b041d){return new BPromise(function(_0x56e420,_0x5032e5){_0x4b041d=combineOptions(_0x4b041d);var _0x35ab0c=new Buffer(_0x46fe68);var _0x1e11f0=fs[_0x070e('0x4')](_0x7bce9b);var _0x2611e6=fs[_0x070e('0x5')](_0x579a6b);var _0x68a09e=crypto[_0x070e('0x6')](_0x4b041d['algorithm'],_0x35ab0c);_0x1e11f0['on']('data',function(_0x50f4eb){var _0x2e3e5e=new Buffer(_0x68a09e[_0x070e('0x7')](_0x50f4eb),_0x070e('0x8'));_0x2611e6[_0x070e('0x9')](_0x2e3e5e);});_0x1e11f0['on'](_0x070e('0xa'),function(){try{var _0x25cfe1=new Buffer(_0x68a09e[_0x070e('0xb')](_0x070e('0x8')),_0x070e('0x8'));_0x2611e6[_0x070e('0x9')](_0x25cfe1);_0x2611e6['end']();_0x2611e6['on']('close',function(){return _0x56e420(_0x579a6b);});}catch(_0x24baba){fs['unlink'](_0x579a6b);return _0x5032e5(_0x24baba);}});});};exports['decryptFile']=function(_0x5bae0f,_0x11d2ce,_0x14c3fd,_0x51d14d){return new BPromise(function(_0x5d3a38,_0x373d86){_0x51d14d=combineOptions(_0x51d14d);var _0xeae1a5=new Buffer(_0x14c3fd);var _0x180897=fs[_0x070e('0x4')](_0x5bae0f);var _0x5bc71e=fs['createWriteStream'](_0x11d2ce);var _0x17e2e4=crypto[_0x070e('0xc')](_0x51d14d[_0x070e('0xd')],_0xeae1a5);_0x180897['on'](_0x070e('0xe'),function(_0x364b3f){var _0x5037eb=new Buffer(_0x17e2e4[_0x070e('0x7')](_0x364b3f),_0x070e('0x8'));_0x5bc71e[_0x070e('0x9')](_0x5037eb);});_0x180897['on'](_0x070e('0xa'),function(){try{var _0x259893=new Buffer(_0x17e2e4['final']('binary'),'binary');_0x5bc71e[_0x070e('0x9')](_0x259893);_0x5bc71e[_0x070e('0xa')]();_0x5bc71e['on'](_0x070e('0xf'),function(){return _0x5d3a38(_0x11d2ce);});}catch(_0x4be0d7){fs[_0x070e('0x10')](_0x11d2ce);return _0x373d86(_0x4be0d7);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index fe8b2b7..9a92702 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 _0x6f0d=['rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','num','split','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','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','Failed','path','lodash','to-csv','bluebird'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x19ddc5,_0x39e89c){_0x19ddc5=_0x19ddc5-0x0;var _0x2605fa=_0x6f0d[_0x19ddc5];return _0x2605fa;};'use strict';var util=require('util');var path=require(_0xd6f0('0x0'));var _=require(_0xd6f0('0x1'));var csv=require(_0xd6f0('0x2'));var fs=require('fs');var BPromise=require(_0xd6f0('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xd6f0('0x4'));var db=require(_0xd6f0('0x5'))['db'];var dbH=require(_0xd6f0('0x5'))[_0xd6f0('0x6')];var logger=require(_0xd6f0('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xd6f0('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xd6f0('0x8')][0x4];function analyticExtractedReport(_0x1af29c,_0x8b89a9){var _0x1a48a0={'status':_0x1af29c};var _0x4c4916={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x8b89a9){_0x1a48a0['savename']=_0x8b89a9;}return db[_0xd6f0('0x9')][_0xd6f0('0xa')](_0x1a48a0,_0x4c4916);}function main(){var _0x2854cd=0x1388;var _0x382a2e;logger[_0xd6f0('0xb')](util['format'](_0xd6f0('0xc'),EXTRACTED_REPORT_ID,_0xd6f0('0xd')));return db[_0xd6f0('0xe')][_0xd6f0('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd6f0('0x10')]})[_0xd6f0('0x11')](function(_0x306aad){if(_0x306aad){_0x382a2e=_0x306aad;_0x2854cd=_0x382a2e[_0xd6f0('0x10')]||0x1388;}})[_0xd6f0('0x11')](function(){return dbH[_0xd6f0('0x12')][_0xd6f0('0x13')](util[_0xd6f0('0x14')](_0xd6f0('0x15'),QUERY),{'type':dbH['sequelize'][_0xd6f0('0x16')][_0xd6f0('0x17')]});})['then'](function(_0x419b7e){if(!_0x419b7e[0x0]['num']){return analyticExtractedReport(_0xd6f0('0x18'));}var _0x154e3e=[];var _0x41bd99=0x0;var _0x472156=!![];if(_0x419b7e&&_0x419b7e[_0xd6f0('0x19')]){var _0x61defb=_0x419b7e[0x0][_0xd6f0('0x1a')]%(_0x41bd99+_0x2854cd);if(_0x382a2e[_0xd6f0('0x1b')]){for(;_0x472156;_0x41bd99+=_0x2854cd,_0x61defb=_0x419b7e[0x0][_0xd6f0('0x1a')]%(_0x41bd99+_0x2854cd)){if(_0x61defb==0x0||_0x61defb==_0x419b7e[0x0][_0xd6f0('0x1a')]){_0x472156=![];}_0x154e3e[_0xd6f0('0x1c')](dbH[_0xd6f0('0x12')][_0xd6f0('0x13')](util[_0xd6f0('0x14')](_0xd6f0('0x1d'),QUERY,_0x2854cd,_0x41bd99),{'type':dbH[_0xd6f0('0x12')]['QueryTypes']['SELECT']}));}}else{_0x154e3e[_0xd6f0('0x1c')](dbH[_0xd6f0('0x12')][_0xd6f0('0x13')](QUERY,{'type':dbH['sequelize'][_0xd6f0('0x16')][_0xd6f0('0x17')]}));}}var _0x557c9b=path[_0xd6f0('0x1e')](PATH);var _0x515687=path[_0xd6f0('0x1f')](PATH,_0xd6f0('0x20'));var _0x5dbe1c=_0x382a2e[_0xd6f0('0x1b')]&&_0x154e3e[_0xd6f0('0x19')]>0x1;var _0x5ea2dd=[];if(!fs[_0xd6f0('0x21')](path[_0xd6f0('0x22')](_0x557c9b,_0x515687))&&_0x5dbe1c){fs[_0xd6f0('0x23')](path['join'](_0x557c9b,_0x515687));}return BPromise[_0xd6f0('0x24')](_0x154e3e,function(_0x3dc166){_0x5ea2dd['push'](_0x3dc166);})[_0xd6f0('0x11')](function(){for(var _0x551be8=0x0;_0x551be8<_0x5ea2dd[_0xd6f0('0x19')];_0x551be8+=0x1){var _0x3fb5c3;var _0x1630dc=_0x5ea2dd[_0x551be8];if(_0x5dbe1c){_0x3fb5c3=path[_0xd6f0('0x22')](_0x557c9b,_0x515687,util[_0xd6f0('0x14')](_0xd6f0('0x25'),_0x515687,_0x551be8,_0xd6f0('0x26')));}else{_0x3fb5c3=path[_0xd6f0('0x22')](_0x557c9b,util['format'](_0xd6f0('0x27'),_0x515687,_0xd6f0('0x26')));}fs['writeFileSync'](_0x3fb5c3,csv(_0x1630dc));}})[_0xd6f0('0x11')](function(){if(_0x5dbe1c){zipdir(path[_0xd6f0('0x22')](_0x557c9b,_0x515687),{'saveTo':path[_0xd6f0('0x22')](_0x557c9b,util[_0xd6f0('0x14')](_0xd6f0('0x27'),_0x515687,_0xd6f0('0x28')))},function(_0x351fda,_0x3151f8){});rimraf(path[_0xd6f0('0x22')](_0x557c9b,_0x515687),function(){});}})[_0xd6f0('0x11')](function(){logger[_0xd6f0('0xb')](util[_0xd6f0('0x14')](_0xd6f0('0x29'),EXTRACTED_REPORT_ID,_0xd6f0('0xd')));return analyticExtractedReport(_0xd6f0('0x2a'),_0x5dbe1c?util[_0xd6f0('0x14')](_0xd6f0('0x27'),_0x515687,_0x5dbe1c?_0xd6f0('0x28'):_0xd6f0('0x26')):null);});})[_0xd6f0('0x2b')](function(_0x3906ca){logger[_0xd6f0('0xb')](util['format'](_0xd6f0('0x2c'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x3906ca,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xd6f0('0x2d'));});}main(); \ No newline at end of file +var _0x4c4e=['find','split','splitSizeCsv','then','query','sequelize','QueryTypes','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','mkdirSync','each','csv','%s.%s','join','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','inspect','Failed','util','lodash','to-csv','bluebird','rimraf','../../mysqldb','../../config/logger','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV'];(function(_0x4ac145,_0x1640e3){var _0x265dc3=function(_0x1fd473){while(--_0x1fd473){_0x4ac145['push'](_0x4ac145['shift']());}};_0x265dc3(++_0x1640e3);}(_0x4c4e,0x152));var _0xe4c4=function(_0x178e3c,_0x772eb0){_0x178e3c=_0x178e3c-0x0;var _0x1c6f40=_0x4c4e[_0x178e3c];return _0x1c6f40;};'use strict';var util=require(_0xe4c4('0x0'));var path=require('path');var _=require(_0xe4c4('0x1'));var csv=require(_0xe4c4('0x2'));var fs=require('fs');var BPromise=require(_0xe4c4('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xe4c4('0x4'));var db=require(_0xe4c4('0x5'))['db'];var dbH=require(_0xe4c4('0x5'))['dbH'];var logger=require(_0xe4c4('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xe4c4('0x7')][0x2]);var QUERY=process[_0xe4c4('0x7')][0x3];var PATH=process[_0xe4c4('0x7')][0x4];function analyticExtractedReport(_0xad105,_0x22085a){var _0x329d29={'status':_0xad105};var _0x28a42e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x22085a){_0x329d29[_0xe4c4('0x8')]=_0x22085a;}return db['AnalyticExtractedReport']['update'](_0x329d29,_0x28a42e);}function main(){var _0x31f879=0x1388;var _0x6f2545;logger[_0xe4c4('0x9')](util[_0xe4c4('0xa')](_0xe4c4('0xb'),EXTRACTED_REPORT_ID,_0xe4c4('0xc')));return db['Setting'][_0xe4c4('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe4c4('0xe'),_0xe4c4('0xf')]})[_0xe4c4('0x10')](function(_0x50bfab){if(_0x50bfab){_0x6f2545=_0x50bfab;_0x31f879=_0x6f2545[_0xe4c4('0xf')]||0x1388;}})[_0xe4c4('0x10')](function(){return dbH['sequelize'][_0xe4c4('0x11')](util[_0xe4c4('0xa')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xe4c4('0x12')][_0xe4c4('0x13')]['SELECT']});})[_0xe4c4('0x10')](function(_0x465c9b){if(!_0x465c9b[0x0][_0xe4c4('0x14')]){return analyticExtractedReport(_0xe4c4('0x15'));}var _0x19e59b=[];var _0x882be2=0x0;var _0x1f637e=!![];if(_0x465c9b&&_0x465c9b[_0xe4c4('0x16')]){var _0x34ecbe=_0x465c9b[0x0][_0xe4c4('0x14')]%(_0x882be2+_0x31f879);if(_0x6f2545[_0xe4c4('0xe')]){for(;_0x1f637e;_0x882be2+=_0x31f879,_0x34ecbe=_0x465c9b[0x0][_0xe4c4('0x14')]%(_0x882be2+_0x31f879)){if(_0x34ecbe==0x0||_0x34ecbe==_0x465c9b[0x0][_0xe4c4('0x14')]){_0x1f637e=![];}_0x19e59b[_0xe4c4('0x17')](dbH[_0xe4c4('0x12')]['query'](util[_0xe4c4('0xa')](_0xe4c4('0x18'),QUERY,_0x31f879,_0x882be2),{'type':dbH[_0xe4c4('0x12')][_0xe4c4('0x13')]['SELECT']}));}}else{_0x19e59b[_0xe4c4('0x17')](dbH[_0xe4c4('0x12')][_0xe4c4('0x11')](QUERY,{'type':dbH[_0xe4c4('0x12')][_0xe4c4('0x13')][_0xe4c4('0x19')]}));}}var _0x1d4597=path[_0xe4c4('0x1a')](PATH);var _0x21bbb1=path[_0xe4c4('0x1b')](PATH,_0xe4c4('0x1c'));var _0x3a6d39=_0x6f2545[_0xe4c4('0xe')]&&_0x19e59b[_0xe4c4('0x16')]>0x1;var _0x15873e=[];if(!fs['existsSync'](path['join'](_0x1d4597,_0x21bbb1))&&_0x3a6d39){fs[_0xe4c4('0x1d')](path['join'](_0x1d4597,_0x21bbb1));}return BPromise[_0xe4c4('0x1e')](_0x19e59b,function(_0x5374fd){_0x15873e[_0xe4c4('0x17')](_0x5374fd);})['then'](function(){for(var _0x34d667=0x0;_0x34d667<_0x15873e['length'];_0x34d667+=0x1){var _0xba53ef;var _0x4a0199=_0x15873e[_0x34d667];if(_0x3a6d39){_0xba53ef=path['join'](_0x1d4597,_0x21bbb1,util['format']('%s%d.%s',_0x21bbb1,_0x34d667,_0xe4c4('0x1f')));}else{_0xba53ef=path['join'](_0x1d4597,util['format'](_0xe4c4('0x20'),_0x21bbb1,_0xe4c4('0x1f')));}fs['writeFileSync'](_0xba53ef,csv(_0x4a0199));}})['then'](function(){if(_0x3a6d39){zipdir(path[_0xe4c4('0x21')](_0x1d4597,_0x21bbb1),{'saveTo':path[_0xe4c4('0x21')](_0x1d4597,util['format'](_0xe4c4('0x20'),_0x21bbb1,_0xe4c4('0x22')))},function(_0x3f60fc,_0x48060e){});rimraf(path['join'](_0x1d4597,_0x21bbb1),function(){});}})[_0xe4c4('0x10')](function(){logger[_0xe4c4('0x9')](util[_0xe4c4('0xa')](_0xe4c4('0x23'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x3a6d39?util[_0xe4c4('0xa')](_0xe4c4('0x20'),_0x21bbb1,_0x3a6d39?'zip':_0xe4c4('0x1f')):null);});})[_0xe4c4('0x24')](function(_0x835e8c){logger['info'](util[_0xe4c4('0xa')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xe4c4('0xc')),util[_0xe4c4('0x25')](_0x835e8c,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xe4c4('0x26'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index f7fa928..dc12081 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 _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x378954,_0x20dcca){var _0xd0b52d=function(_0x1cdcff){while(--_0x1cdcff){_0x378954['push'](_0x378954['shift']());}};_0xd0b52d(++_0x20dcca);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main(); \ No newline at end of file +var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x55aacf,_0x59bc6d){var _0x3071fe=function(_0x2afca1){while(--_0x2afca1){_0x55aacf['push'](_0x55aacf['shift']());}};_0x3071fe(++_0x59bc6d);}(_0xb10b,0x12a));var _0xbb10=function(_0x40edbb,_0x4b8e85){_0x40edbb=_0x40edbb-0x0;var _0x1c34e1=_0xb10b[_0x40edbb];return _0x1c34e1;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 7ebb906..2046f71 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 _0x8137=['../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','QueryTypes','SELECT','Empty','length','num','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb'];(function(_0x426c8f,_0x5b6fdd){var _0x4d5fd7=function(_0x351fac){while(--_0x351fac){_0x426c8f['push'](_0x426c8f['shift']());}};_0x4d5fd7(++_0x5b6fdd);}(_0x8137,0x180));var _0x7813=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x8137[_0x36884e];return _0x1cc367;};'use strict';var util=require(_0x7813('0x0'));var path=require(_0x7813('0x1'));var _=require(_0x7813('0x2'));var fs=require('fs');var json2xls=require(_0x7813('0x3'));var BPromise=require(_0x7813('0x4'));var zipdir=require(_0x7813('0x5'));var rimraf=require(_0x7813('0x6'));var db=require(_0x7813('0x7'))['db'];var dbH=require(_0x7813('0x7'))['dbH'];var logger=require(_0x7813('0x8'))(_0x7813('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x7813('0xa')][0x2]);var QUERY=process[_0x7813('0xa')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x4a0af3,_0x51fb3c){var _0x25a499={'status':_0x4a0af3};var _0x5ae51e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x51fb3c){_0x25a499[_0x7813('0xb')]=_0x51fb3c;}return db[_0x7813('0xc')][_0x7813('0xd')](_0x25a499,_0x5ae51e);}function main(){var _0x3fd801=0x1388;var _0x402a98;logger[_0x7813('0xe')](util[_0x7813('0xf')](_0x7813('0x10'),EXTRACTED_REPORT_ID,_0x7813('0x11')));return db[_0x7813('0x12')][_0x7813('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x7813('0x14'),_0x7813('0x15')]})[_0x7813('0x16')](function(_0x137d0e){if(_0x137d0e){_0x402a98=_0x137d0e;_0x3fd801=_0x402a98[_0x7813('0x15')]||0x1388;}})[_0x7813('0x16')](function(){return dbH[_0x7813('0x17')]['query'](util[_0x7813('0xf')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x7813('0x17')][_0x7813('0x18')][_0x7813('0x19')]});})['then'](function(_0x5e1a74){if(!_0x5e1a74[0x0]['num']){return analyticExtractedReport(_0x7813('0x1a'));}var _0x1349cf=[];var _0xa2af61=0x0;var _0x1c4ef1=!![];if(_0x402a98[_0x7813('0x14')]){if(_0x5e1a74&&_0x5e1a74[_0x7813('0x1b')]){var _0x919313=_0x5e1a74[0x0][_0x7813('0x1c')]%(_0xa2af61+_0x3fd801);for(;_0x1c4ef1;_0xa2af61+=_0x3fd801,_0x919313=_0x5e1a74[0x0][_0x7813('0x1c')]%(_0xa2af61+_0x3fd801)){if(_0x919313==0x0||_0x919313==_0x5e1a74[0x0][_0x7813('0x1c')]){_0x1c4ef1=![];}_0x1349cf[_0x7813('0x1d')](dbH[_0x7813('0x17')]['query'](util[_0x7813('0xf')](_0x7813('0x1e'),QUERY,_0x3fd801,_0xa2af61),{'type':dbH['sequelize'][_0x7813('0x18')][_0x7813('0x19')]}));}}}else{_0x1349cf[_0x7813('0x1d')](dbH[_0x7813('0x17')][_0x7813('0x1f')](QUERY,{'type':dbH[_0x7813('0x17')]['QueryTypes']['SELECT']}));}var _0x5265bb=path[_0x7813('0x20')](PATH);var _0x559bfc=path[_0x7813('0x21')](PATH,'.xlsx');var _0x388b56=_0x402a98['split']&&_0x1349cf['length']>0x1;var _0x498627=[];if(!fs[_0x7813('0x22')](path[_0x7813('0x23')](_0x5265bb,_0x559bfc))&&_0x388b56){fs[_0x7813('0x24')](path['join'](_0x5265bb,_0x559bfc));}return BPromise[_0x7813('0x25')](_0x1349cf,function(_0x395c94){_0x498627['push'](_0x395c94);})[_0x7813('0x16')](function(){for(var _0x382c1d=0x0;_0x382c1d<_0x498627[_0x7813('0x1b')];_0x382c1d+=0x1){var _0xffd601;var _0x4d2741=_0x498627[_0x382c1d];if(_0x388b56){_0xffd601=path[_0x7813('0x23')](_0x5265bb,_0x559bfc,util[_0x7813('0xf')](_0x7813('0x26'),_0x559bfc,_0x382c1d,_0x7813('0x27')));}else{_0xffd601=path[_0x7813('0x23')](_0x5265bb,util['format'](_0x7813('0x28'),_0x559bfc,'xlsx'));}fs[_0x7813('0x29')](_0xffd601,json2xls(_0x4d2741),_0x7813('0x2a'));}})[_0x7813('0x16')](function(){if(_0x388b56){zipdir(path[_0x7813('0x23')](_0x5265bb,_0x559bfc),{'saveTo':path[_0x7813('0x23')](_0x5265bb,util[_0x7813('0xf')](_0x7813('0x28'),_0x559bfc,_0x7813('0x2b')))},function(_0x2e8050,_0x3b2b10){});rimraf(path[_0x7813('0x23')](_0x5265bb,_0x559bfc),function(){});}})[_0x7813('0x16')](function(){logger[_0x7813('0xe')](util[_0x7813('0xf')](_0x7813('0x2c'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x7813('0x2d'),_0x388b56?util[_0x7813('0xf')](_0x7813('0x28'),_0x559bfc,_0x388b56?_0x7813('0x2b'):_0x7813('0x27')):null);});})['catch'](function(_0x261322){logger[_0x7813('0xe')](util[_0x7813('0xf')](_0x7813('0x2e'),EXTRACTED_REPORT_ID,_0x7813('0x11')),util[_0x7813('0x2f')](_0x261322,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x7813('0x30'));});}main(); \ No newline at end of file +var _0xa1ae=['../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','length','num','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname','basename','.xlsx','join','mkdirSync','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb'];(function(_0x2ad2fc,_0x496288){var _0x26df24=function(_0x410572){while(--_0x410572){_0x2ad2fc['push'](_0x2ad2fc['shift']());}};_0x26df24(++_0x496288);}(_0xa1ae,0x134));var _0xea1a=function(_0x38f400,_0x5198d){_0x38f400=_0x38f400-0x0;var _0x3026fa=_0xa1ae[_0x38f400];return _0x3026fa;};'use strict';var util=require(_0xea1a('0x0'));var path=require('path');var _=require(_0xea1a('0x1'));var fs=require('fs');var json2xls=require(_0xea1a('0x2'));var BPromise=require(_0xea1a('0x3'));var zipdir=require(_0xea1a('0x4'));var rimraf=require(_0xea1a('0x5'));var db=require(_0xea1a('0x6'))['db'];var dbH=require(_0xea1a('0x6'))['dbH'];var logger=require(_0xea1a('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xea1a('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x5ebd74,_0x168ffd){var _0x5a82f0={'status':_0x5ebd74};var _0x36c07b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x168ffd){_0x5a82f0[_0xea1a('0x9')]=_0x168ffd;}return db[_0xea1a('0xa')][_0xea1a('0xb')](_0x5a82f0,_0x36c07b);}function main(){var _0x3db510=0x1388;var _0x1ab325;logger[_0xea1a('0xc')](util[_0xea1a('0xd')](_0xea1a('0xe'),EXTRACTED_REPORT_ID,_0xea1a('0xf')));return db[_0xea1a('0x10')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xea1a('0x11'),_0xea1a('0x12')]})[_0xea1a('0x13')](function(_0xff5f27){if(_0xff5f27){_0x1ab325=_0xff5f27;_0x3db510=_0x1ab325[_0xea1a('0x12')]||0x1388;}})[_0xea1a('0x13')](function(){return dbH[_0xea1a('0x14')][_0xea1a('0x15')](util[_0xea1a('0xd')](_0xea1a('0x16'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xea1a('0x17')]});})[_0xea1a('0x13')](function(_0x10dc3a){if(!_0x10dc3a[0x0]['num']){return analyticExtractedReport('Empty');}var _0x245497=[];var _0x43f520=0x0;var _0x50d96b=!![];if(_0x1ab325[_0xea1a('0x11')]){if(_0x10dc3a&&_0x10dc3a[_0xea1a('0x18')]){var _0x44d135=_0x10dc3a[0x0][_0xea1a('0x19')]%(_0x43f520+_0x3db510);for(;_0x50d96b;_0x43f520+=_0x3db510,_0x44d135=_0x10dc3a[0x0]['num']%(_0x43f520+_0x3db510)){if(_0x44d135==0x0||_0x44d135==_0x10dc3a[0x0]['num']){_0x50d96b=![];}_0x245497['push'](dbH[_0xea1a('0x14')][_0xea1a('0x15')](util[_0xea1a('0xd')](_0xea1a('0x1a'),QUERY,_0x3db510,_0x43f520),{'type':dbH[_0xea1a('0x14')][_0xea1a('0x1b')][_0xea1a('0x17')]}));}}}else{_0x245497[_0xea1a('0x1c')](dbH[_0xea1a('0x14')][_0xea1a('0x15')](QUERY,{'type':dbH['sequelize'][_0xea1a('0x1b')][_0xea1a('0x17')]}));}var _0x5d9ec6=path[_0xea1a('0x1d')](PATH);var _0x308641=path[_0xea1a('0x1e')](PATH,_0xea1a('0x1f'));var _0x21b1e2=_0x1ab325['split']&&_0x245497['length']>0x1;var _0x37c21b=[];if(!fs['existsSync'](path[_0xea1a('0x20')](_0x5d9ec6,_0x308641))&&_0x21b1e2){fs[_0xea1a('0x21')](path[_0xea1a('0x20')](_0x5d9ec6,_0x308641));}return BPromise['each'](_0x245497,function(_0x514e4d){_0x37c21b[_0xea1a('0x1c')](_0x514e4d);})[_0xea1a('0x13')](function(){for(var _0x579cd5=0x0;_0x579cd5<_0x37c21b[_0xea1a('0x18')];_0x579cd5+=0x1){var _0x2bd317;var _0x2c4279=_0x37c21b[_0x579cd5];if(_0x21b1e2){_0x2bd317=path[_0xea1a('0x20')](_0x5d9ec6,_0x308641,util['format'](_0xea1a('0x22'),_0x308641,_0x579cd5,_0xea1a('0x23')));}else{_0x2bd317=path['join'](_0x5d9ec6,util[_0xea1a('0xd')]('%s.%s',_0x308641,'xlsx'));}fs[_0xea1a('0x24')](_0x2bd317,json2xls(_0x2c4279),_0xea1a('0x25'));}})[_0xea1a('0x13')](function(){if(_0x21b1e2){zipdir(path['join'](_0x5d9ec6,_0x308641),{'saveTo':path[_0xea1a('0x20')](_0x5d9ec6,util[_0xea1a('0xd')](_0xea1a('0x26'),_0x308641,'zip'))},function(_0x1075a4,_0x28be0c){});rimraf(path[_0xea1a('0x20')](_0x5d9ec6,_0x308641),function(){});}})['then'](function(){logger[_0xea1a('0xc')](util[_0xea1a('0xd')](_0xea1a('0x27'),EXTRACTED_REPORT_ID,_0xea1a('0xf')));return analyticExtractedReport(_0xea1a('0x28'),_0x21b1e2?util[_0xea1a('0xd')](_0xea1a('0x26'),_0x308641,_0x21b1e2?_0xea1a('0x29'):_0xea1a('0x23')):null);});})[_0xea1a('0x2a')](function(_0x1c793f){logger[_0xea1a('0xc')](util['format'](_0xea1a('0x2b'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0x1c793f,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xea1a('0x2c'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 7d4c23f..478b28d 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 _0x17b6=['XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','filter','tag','CDR(tag)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','transaction','destroy','bulkCreate','sortBy','catch','lodash','util','Interval','findAll','then','intervals','models','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','groupBy','queue','playback','extensions','extension','find','push','type','format','context','priority','VoiceExtensionId','outbound','Set','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav'];(function(_0x384b96,_0x5163f1){var _0x1c1468=function(_0x43f6a7){while(--_0x43f6a7){_0x384b96['push'](_0x384b96['shift']());}};_0x1c1468(++_0x5163f1);}(_0x17b6,0xf7));var _0x617b=function(_0x8386ae,_0x1c9c20){_0x8386ae=_0x8386ae-0x0;var _0xc5c846=_0x17b6[_0x8386ae];return _0xc5c846;};'use strict';var _=require(_0x617b('0x0'));var util=require(_0x617b('0x1'));function rewrite(_0x5b75cf,_0x5f4d50){var _0x4a189e=this;return _0x5b75cf['models'][_0x617b('0x2')][_0x617b('0x3')]({'raw':!![]})[_0x617b('0x4')](function(_0x5897ef){_0x4a189e[_0x617b('0x5')]=_0x5897ef;return _0x5b75cf[_0x617b('0x6')]['VoiceExtension'][_0x617b('0x3')]({'where':{'IntervalId':_0x5f4d50[_0x617b('0x7')]},'raw':!![]});})['then'](function(_0x4ddd96){return _0x5b75cf[_0x617b('0x6')][_0x617b('0x8')]['findAll']({'where':{'exten':{'$in':_[_0x617b('0x9')](_[_0x617b('0xa')](_0x4ddd96,_0x617b('0xb')))}},'order':[{'raw':_0x617b('0xc')}],'raw':!![]});})[_0x617b('0x4')](function(_0x460de9){var _0x51855f=_['filter'](_0x460de9,{'priority':'1'});var _0x21827d=_['filter'](_0x460de9,{'isApp':0x1});var _0x2dd30e=_[_0x617b('0xd')](_0x21827d,'exten');var _0x3d7b54=[_0x617b('0xe'),_0x617b('0xf')];var _0x282ce9=[];var _0x25b756=[];for(var _0x35b8a7 in _0x2dd30e){if(_0x2dd30e['hasOwnProperty'](_0x35b8a7)){_0x4a189e['priority']=0x2;_0x4a189e[_0x617b('0x10')]=[];_0x4a189e[_0x617b('0x11')]=_[_0x617b('0x12')](_0x51855f,{'exten':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0xb')]});_0x4a189e[_0x617b('0x10')][_0x617b('0x13')]({'type':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x14')],'app':'Set','appdata':util[_0x617b('0x15')]('CDR(type)=%s',_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x14')]),'context':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x16')],'exten':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0xb')],'priority':_0x4a189e[_0x617b('0x17')]++,'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]});if(_0x2dd30e[_0x35b8a7][0x0]['type']===_0x617b('0x19')){if(_0x4a189e[_0x617b('0x11')]){_0x4a189e['extensions'][_0x617b('0x13')]({'type':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x14')],'app':_0x617b('0x1a'),'appdata':'CDR(destination)='+(_0x4a189e[_0x617b('0x11')][_0x617b('0x1b')]?_0x617b('0x1c')+_0x4a189e[_0x617b('0x11')][_0x617b('0x1b')]+'}':_0x617b('0x1d')),'context':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x16')],'exten':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0xb')],'priority':_0x4a189e[_0x617b('0x17')]++,'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0]['VoiceExtensionId']});}_0x4a189e[_0x617b('0x10')][_0x617b('0x13')]({'type':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x14')],'app':_0x617b('0x1a'),'appdata':_0x617b('0x1e')+_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')],'context':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x16')],'exten':_0x2dd30e[_0x35b8a7][0x0]['exten'],'priority':_0x4a189e[_0x617b('0x17')]++,'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]});var _0x39698c=_0x4a189e[_0x617b('0x17')]++;_0x4a189e[_0x617b('0x10')]['push']({'type':_0x2dd30e[_0x35b8a7][0x0]['type'],'app':'ExecIf','appdata':_0x617b('0x1f')+(_0x39698c+0x2)+_0x617b('0x20')+(_0x39698c+0x1)+')','context':_0x2dd30e[_0x35b8a7][0x0]['context'],'exten':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0xb')],'priority':_0x39698c,'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]});if(_0x4a189e[_0x617b('0x11')]){_0x4a189e[_0x617b('0x10')]['push']({'type':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x14')],'app':_0x617b('0x1a'),'appdata':_0x4a189e[_0x617b('0x11')][_0x617b('0x1b')]?_0x617b('0x21')+_0x4a189e[_0x617b('0x11')][_0x617b('0x1b')]+'}':_0x617b('0x22'),'context':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x16')],'exten':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0xb')],'priority':_0x4a189e[_0x617b('0x17')]++,'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]});}_0x4a189e[_0x617b('0x10')][_0x617b('0x13')]({'type':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x14')],'app':_0x617b('0x1a'),'appdata':_0x617b('0x23')+_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')],'context':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x16')],'exten':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0xb')],'priority':_0x4a189e[_0x617b('0x17')]++,'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]});if(_0x4a189e[_0x617b('0x11')]&&_0x4a189e[_0x617b('0x11')][_0x617b('0x24')](_0x617b('0x25'))&&_0x4a189e[_0x617b('0x11')][_0x617b('0x25')]!==_0x617b('0x26')){_0x4a189e[_0x617b('0x10')]['push']({'type':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x14')],'app':_0x617b('0x1a'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x16')],'exten':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0xb')],'priority':_0x4a189e[_0x617b('0x17')]++,'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]});_0x4a189e[_0x617b('0x10')][_0x617b('0x13')]({'type':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x14')],'app':_0x617b('0x1a'),'appdata':_0x617b('0x27')+_0x4a189e[_0x617b('0x11')][_0x617b('0x25')]||_0x617b('0x28'),'context':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x16')],'exten':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0xb')],'priority':_0x4a189e[_0x617b('0x17')]++,'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]});}}_0x4a189e[_0x617b('0x10')][_0x617b('0x13')]({'type':_0x2dd30e[_0x35b8a7][0x0]['type'],'app':'Set','appdata':_0x617b('0x29'),'context':_0x2dd30e[_0x35b8a7][0x0]['context'],'exten':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0xb')],'priority':_0x4a189e[_0x617b('0x17')]++,'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]});_0x4a189e[_0x617b('0x10')][_0x617b('0x13')]({'type':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x14')],'app':_0x617b('0x1a'),'appdata':_0x617b('0x2a'),'context':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x16')],'exten':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0xb')],'priority':_0x4a189e[_0x617b('0x17')]++,'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]});_0x4a189e[_0x617b('0x10')][_0x617b('0x13')]({'type':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x14')],'app':_0x617b('0x1a'),'appdata':_0x617b('0x2b'),'context':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x16')],'exten':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0xb')],'priority':_0x4a189e['priority']++,'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]});for(var _0x5de2dc=0x0,_0x23d1f5=0x0;_0x5de2dc<_0x2dd30e[_0x35b8a7][_0x617b('0x2c')];_0x5de2dc+=0x1,_0x23d1f5=0x0){var _0x500dc6=_0x2dd30e[_0x35b8a7][_0x5de2dc];if(_0x500dc6[_0x617b('0x14')]){_0x500dc6['type']=_0x500dc6[_0x617b('0x14')][_0x617b('0x2d')]();}var _0x390b7a=[];var _0x225285=[];delete _0x500dc6['id'];delete _0x500dc6[_0x617b('0x2e')];delete _0x500dc6[_0x617b('0x2f')];var _0x165edb=_0x500dc6[_0x617b('0x30')]!==_0x617b('0x31')?[_0x500dc6[_0x617b('0x30')]]:_0x500dc6['IntervalId']?_['map'](_[_0x617b('0x32')](_0x4a189e['intervals'],{'IntervalId':_0x500dc6[_0x617b('0x7')]}),_0x617b('0x30')):[];if(_0x500dc6[_0x617b('0x24')](_0x617b('0x33'))){if(_0x500dc6['tag']&&_0x500dc6[_0x617b('0x33')]!=='--'){_0x390b7a[_0x617b('0x13')]({'type':_0x500dc6['type'],'app':_0x617b('0x1a'),'appdata':_0x617b('0x34')+_0x500dc6[_0x617b('0x33')],'context':_0x500dc6[_0x617b('0x16')],'exten':_0x500dc6[_0x617b('0xb')],'priority':_0x165edb[_0x617b('0x2c')]+_0x4a189e[_0x617b('0x17')]+_0x23d1f5++,'VoiceExtensionId':_0x500dc6[_0x617b('0x18')]});}}if(_0x500dc6['type']===_0x617b('0x19')&&_0x500dc6[_0x617b('0x24')](_0x617b('0x35'))){if(_0x500dc6[_0x617b('0x35')]){_0x390b7a[_0x617b('0x13')]({'type':_0x500dc6[_0x617b('0x14')],'app':_0x617b('0x36'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x500dc6['callerID']+')','context':_0x500dc6[_0x617b('0x16')],'exten':_0x500dc6['exten'],'priority':_0x165edb[_0x617b('0x2c')]+_0x4a189e['priority']+_0x23d1f5++,'VoiceExtensionId':_0x500dc6[_0x617b('0x18')]});}else{_0x390b7a[_0x617b('0x13')]({'type':_0x500dc6[_0x617b('0x14')],'app':_0x617b('0x36'),'appdata':_0x617b('0x37'),'context':_0x500dc6['context'],'exten':_0x500dc6['exten'],'priority':_0x165edb[_0x617b('0x2c')]+_0x4a189e[_0x617b('0x17')]+_0x23d1f5++,'VoiceExtensionId':_0x500dc6[_0x617b('0x18')]});}}if(_0x500dc6[_0x617b('0x24')](_0x617b('0x38'))){if(_0x3d7b54[_0x617b('0x39')](_0x500dc6[_0x617b('0x3a')]['toLowerCase']())>=0x0&&_0x500dc6[_0x617b('0x3b')]!=='custom'){if(_0x500dc6[_0x617b('0x38')]){_0x390b7a[_0x617b('0x13')]({'type':_0x500dc6[_0x617b('0x14')],'app':'ExecIf','appdata':_0x617b('0x3c'),'context':_0x500dc6[_0x617b('0x16')],'exten':_0x500dc6[_0x617b('0xb')],'priority':_0x165edb['length']+_0x4a189e[_0x617b('0x17')]+_0x23d1f5++,'VoiceExtensionId':_0x500dc6[_0x617b('0x18')]});_0x390b7a['push']({'type':_0x500dc6[_0x617b('0x14')],'app':_0x617b('0x1a'),'appdata':_0x617b('0x3d'),'context':_0x500dc6[_0x617b('0x16')],'exten':_0x500dc6['exten'],'priority':_0x165edb['length']+_0x4a189e[_0x617b('0x17')]+_0x23d1f5++,'VoiceExtensionId':_0x500dc6['VoiceExtensionId']});}else{_0x390b7a['push']({'type':_0x500dc6[_0x617b('0x14')],'app':'ExecIf','appdata':_0x617b('0x3e'),'context':_0x500dc6[_0x617b('0x16')],'exten':_0x500dc6[_0x617b('0xb')],'priority':_0x165edb[_0x617b('0x2c')]+_0x4a189e['priority']+_0x23d1f5++,'VoiceExtensionId':_0x500dc6[_0x617b('0x18')]});_0x390b7a[_0x617b('0x13')]({'type':_0x500dc6[_0x617b('0x14')],'app':'Set','appdata':_0x617b('0x3f'),'context':_0x500dc6[_0x617b('0x16')],'exten':_0x500dc6[_0x617b('0xb')],'priority':_0x165edb[_0x617b('0x2c')]+_0x4a189e['priority']+_0x23d1f5++,'VoiceExtensionId':_0x500dc6['VoiceExtensionId']});}}}for(var _0x243911=0x0;_0x243911<_0x165edb[_0x617b('0x2c')];_0x243911+=0x1){var _0x4bce33=_0x4a189e[_0x617b('0x17')]+_0x165edb[_0x617b('0x2c')];var _0x28b00f=_0x243911===_0x165edb[_0x617b('0x2c')]-0x1?_0x4a189e[_0x617b('0x17')]+_0x390b7a[_0x617b('0x2c')]+_0x225285['length']+0x2:_0x4a189e[_0x617b('0x17')]+_0x243911+0x1;_0x390b7a[_0x617b('0x40')](_0x243911,0x0,{'type':_0x500dc6['type'],'app':'GotoIfTime','appdata':_0x165edb[_0x243911]+'?'+_0x500dc6['context']+',${EXTEN},'+_0x4bce33+':'+_0x500dc6[_0x617b('0x16')]+_0x617b('0x41')+_0x28b00f,'exten':_0x500dc6['exten'],'context':_0x500dc6[_0x617b('0x16')],'priority':_0x4a189e[_0x617b('0x17')]+_0x243911,'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]});}_0x500dc6['priority']=_0x390b7a[_0x617b('0x2c')]?_[_0x617b('0x42')](_0x390b7a)[_0x617b('0x17')]+0x1:_0x4a189e[_0x617b('0x17')];_0x4a189e[_0x617b('0x17')]=(_0x225285[_0x617b('0x2c')]?_['last'](_0x225285)[_0x617b('0x17')]:_0x500dc6['priority'])+0x1;_0x4a189e[_0x617b('0x10')]=_['concat'](_0x4a189e[_0x617b('0x10')],_0x390b7a,[_0x500dc6],_0x225285);}_0x4a189e[_0x617b('0x10')]['push']({'type':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x14')],'app':'Hangup','exten':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0xb')],'context':_0x2dd30e[_0x35b8a7][0x0]['context'],'priority':_0x4a189e[_0x617b('0x17')],'VoiceExtensionId':_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]});_0x282ce9[_0x617b('0x13')](_0x2dd30e[_0x35b8a7][0x0][_0x617b('0x18')]);_0x25b756=_['concat'](_0x25b756,_0x4a189e[_0x617b('0x10')]);}}return _0x5b75cf[_0x617b('0x43')](function(_0x30e5){return _0x5b75cf[_0x617b('0x6')][_0x617b('0x8')][_0x617b('0x44')]({'where':{'VoiceExtensionId':{'$in':_0x282ce9}},'transaction':_0x30e5})['then'](function(_0x3b51ad){return _0x5b75cf[_0x617b('0x6')][_0x617b('0x8')][_0x617b('0x45')](_[_0x617b('0x46')](_0x25b756,_0x617b('0x17')),{'transaction':_0x30e5});});});})[_0x617b('0x47')](function(_0x586e80){console['error'](_0x586e80);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xa503=['ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','interval','*,*,*,*','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','length','answer','indexOf','app','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','catch','error','rewrite','lodash','util','models','Interval','intervals','findAll','IntervalId','then','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','hasOwnProperty','extensions','extension','find','push','Set','format','context','priority','VoiceExtensionId','type','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}'];(function(_0x1ae31c,_0x8dcd2d){var _0x19519d=function(_0x22b8cd){while(--_0x22b8cd){_0x1ae31c['push'](_0x1ae31c['shift']());}};_0x19519d(++_0x8dcd2d);}(_0xa503,0x143));var _0x3a50=function(_0x5c8a61,_0x4c57c7){_0x5c8a61=_0x5c8a61-0x0;var _0x9a7ede=_0xa503[_0x5c8a61];return _0x9a7ede;};'use strict';var _=require(_0x3a50('0x0'));var util=require(_0x3a50('0x1'));function rewrite(_0x58bd8d,_0x3fb8eb){var _0x3d879d=this;return _0x58bd8d[_0x3a50('0x2')][_0x3a50('0x3')]['findAll']({'raw':!![]})['then'](function(_0x1e7b87){_0x3d879d[_0x3a50('0x4')]=_0x1e7b87;return _0x58bd8d['models']['VoiceExtension'][_0x3a50('0x5')]({'where':{'IntervalId':_0x3fb8eb[_0x3a50('0x6')]},'raw':!![]});})[_0x3a50('0x7')](function(_0x307280){return _0x58bd8d[_0x3a50('0x2')][_0x3a50('0x8')]['findAll']({'where':{'exten':{'$in':_[_0x3a50('0x9')](_[_0x3a50('0xa')](_0x307280,_0x3a50('0xb')))}},'order':[{'raw':_0x3a50('0xc')}],'raw':!![]});})[_0x3a50('0x7')](function(_0x1badd1){var _0x2b4827=_['filter'](_0x1badd1,{'priority':'1'});var _0x178738=_[_0x3a50('0xd')](_0x1badd1,{'isApp':0x1});var _0x1c5a82=_['groupBy'](_0x178738,_0x3a50('0xb'));var _0x4e9a5a=[_0x3a50('0xe'),_0x3a50('0xf')];var _0x3a0401=[];var _0x505d15=[];for(var _0x4b09c9 in _0x1c5a82){if(_0x1c5a82[_0x3a50('0x10')](_0x4b09c9)){_0x3d879d['priority']=0x2;_0x3d879d[_0x3a50('0x11')]=[];_0x3d879d[_0x3a50('0x12')]=_[_0x3a50('0x13')](_0x2b4827,{'exten':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0xb')]});_0x3d879d['extensions'][_0x3a50('0x14')]({'type':_0x1c5a82[_0x4b09c9][0x0]['type'],'app':_0x3a50('0x15'),'appdata':util[_0x3a50('0x16')]('CDR(type)=%s',_0x1c5a82[_0x4b09c9][0x0]['type']),'context':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x17')],'exten':_0x1c5a82[_0x4b09c9][0x0]['exten'],'priority':_0x3d879d[_0x3a50('0x18')]++,'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]});if(_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x1a')]===_0x3a50('0x1b')){if(_0x3d879d['extension']){_0x3d879d[_0x3a50('0x11')]['push']({'type':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x1a')],'app':_0x3a50('0x15'),'appdata':_0x3a50('0x1c')+(_0x3d879d[_0x3a50('0x12')][_0x3a50('0x1d')]?_0x3a50('0x1e')+_0x3d879d[_0x3a50('0x12')][_0x3a50('0x1d')]+'}':_0x3a50('0x1f')),'context':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x17')],'exten':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0xb')],'priority':_0x3d879d['priority']++,'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]});}_0x3d879d[_0x3a50('0x11')]['push']({'type':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x1a')],'app':_0x3a50('0x15'),'appdata':'CDR(routeid)='+_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')],'context':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x17')],'exten':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0xb')],'priority':_0x3d879d[_0x3a50('0x18')]++,'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]});var _0xc4adc7=_0x3d879d[_0x3a50('0x18')]++;_0x3d879d[_0x3a50('0x11')][_0x3a50('0x14')]({'type':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x1a')],'app':_0x3a50('0x20'),'appdata':_0x3a50('0x21')+(_0xc4adc7+0x2)+_0x3a50('0x22')+(_0xc4adc7+0x1)+')','context':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x17')],'exten':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0xb')],'priority':_0xc4adc7,'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]});if(_0x3d879d[_0x3a50('0x12')]){_0x3d879d[_0x3a50('0x11')][_0x3a50('0x14')]({'type':_0x1c5a82[_0x4b09c9][0x0]['type'],'app':'Set','appdata':_0x3d879d[_0x3a50('0x12')][_0x3a50('0x1d')]?_0x3a50('0x23')+_0x3d879d['extension']['cutdigits']+'}':_0x3a50('0x24'),'context':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x17')],'exten':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0xb')],'priority':_0x3d879d['priority']++,'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]});}_0x3d879d[_0x3a50('0x11')]['push']({'type':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x1a')],'app':_0x3a50('0x15'),'appdata':'outboundrouteid='+_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')],'context':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x17')],'exten':_0x1c5a82[_0x4b09c9][0x0]['exten'],'priority':_0x3d879d[_0x3a50('0x18')]++,'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]});if(_0x3d879d['extension']&&_0x3d879d['extension'][_0x3a50('0x10')](_0x3a50('0x25'))&&_0x3d879d[_0x3a50('0x12')][_0x3a50('0x25')]!=='none'){_0x3d879d['extensions'][_0x3a50('0x14')]({'type':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x1a')],'app':_0x3a50('0x15'),'appdata':_0x3a50('0x26'),'context':_0x1c5a82[_0x4b09c9][0x0]['context'],'exten':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0xb')],'priority':_0x3d879d[_0x3a50('0x18')]++,'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]});_0x3d879d[_0x3a50('0x11')][_0x3a50('0x14')]({'type':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x1a')],'app':'Set','appdata':_0x3a50('0x27')+_0x3d879d[_0x3a50('0x12')][_0x3a50('0x25')]||_0x3a50('0x28'),'context':_0x1c5a82[_0x4b09c9][0x0]['context'],'exten':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0xb')],'priority':_0x3d879d[_0x3a50('0x18')]++,'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]});}}_0x3d879d[_0x3a50('0x11')][_0x3a50('0x14')]({'type':_0x1c5a82[_0x4b09c9][0x0]['type'],'app':_0x3a50('0x15'),'appdata':_0x3a50('0x29'),'context':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x17')],'exten':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0xb')],'priority':_0x3d879d['priority']++,'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0]['VoiceExtensionId']});_0x3d879d['extensions'][_0x3a50('0x14')]({'type':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x1a')],'app':_0x3a50('0x15'),'appdata':_0x3a50('0x2a'),'context':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x17')],'exten':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0xb')],'priority':_0x3d879d['priority']++,'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]});_0x3d879d['extensions'][_0x3a50('0x14')]({'type':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x1a')],'app':'Set','appdata':_0x3a50('0x2b'),'context':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x17')],'exten':_0x1c5a82[_0x4b09c9][0x0]['exten'],'priority':_0x3d879d[_0x3a50('0x18')]++,'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]});for(var _0x2552b5=0x0,_0x2893db=0x0;_0x2552b5<_0x1c5a82[_0x4b09c9]['length'];_0x2552b5+=0x1,_0x2893db=0x0){var _0x7f6a0f=_0x1c5a82[_0x4b09c9][_0x2552b5];if(_0x7f6a0f[_0x3a50('0x1a')]){_0x7f6a0f[_0x3a50('0x1a')]=_0x7f6a0f[_0x3a50('0x1a')][_0x3a50('0x2c')]();}var _0x3323cd=[];var _0x2d2dbe=[];delete _0x7f6a0f['id'];delete _0x7f6a0f[_0x3a50('0x2d')];delete _0x7f6a0f['updatedAt'];var _0x4067cf=_0x7f6a0f[_0x3a50('0x2e')]!==_0x3a50('0x2f')?[_0x7f6a0f[_0x3a50('0x2e')]]:_0x7f6a0f[_0x3a50('0x6')]?_[_0x3a50('0xa')](_['filter'](_0x3d879d[_0x3a50('0x4')],{'IntervalId':_0x7f6a0f[_0x3a50('0x6')]}),'interval'):[];if(_0x7f6a0f[_0x3a50('0x10')](_0x3a50('0x30'))){if(_0x7f6a0f[_0x3a50('0x30')]&&_0x7f6a0f[_0x3a50('0x30')]!=='--'){_0x3323cd[_0x3a50('0x14')]({'type':_0x7f6a0f[_0x3a50('0x1a')],'app':'Set','appdata':_0x3a50('0x31')+_0x7f6a0f[_0x3a50('0x30')],'context':_0x7f6a0f[_0x3a50('0x17')],'exten':_0x7f6a0f['exten'],'priority':_0x4067cf['length']+_0x3d879d[_0x3a50('0x18')]+_0x2893db++,'VoiceExtensionId':_0x7f6a0f[_0x3a50('0x19')]});}}if(_0x7f6a0f['type']===_0x3a50('0x1b')&&_0x7f6a0f[_0x3a50('0x10')](_0x3a50('0x32'))){if(_0x7f6a0f[_0x3a50('0x32')]){_0x3323cd['push']({'type':_0x7f6a0f[_0x3a50('0x1a')],'app':_0x3a50('0x20'),'appdata':_0x3a50('0x33')+_0x7f6a0f[_0x3a50('0x32')]+')','context':_0x7f6a0f[_0x3a50('0x17')],'exten':_0x7f6a0f[_0x3a50('0xb')],'priority':_0x4067cf['length']+_0x3d879d[_0x3a50('0x18')]+_0x2893db++,'VoiceExtensionId':_0x7f6a0f[_0x3a50('0x19')]});}else{_0x3323cd['push']({'type':_0x7f6a0f[_0x3a50('0x1a')],'app':_0x3a50('0x20'),'appdata':_0x3a50('0x34'),'context':_0x7f6a0f['context'],'exten':_0x7f6a0f[_0x3a50('0xb')],'priority':_0x4067cf[_0x3a50('0x35')]+_0x3d879d['priority']+_0x2893db++,'VoiceExtensionId':_0x7f6a0f[_0x3a50('0x19')]});}}if(_0x7f6a0f['hasOwnProperty'](_0x3a50('0x36'))){if(_0x4e9a5a[_0x3a50('0x37')](_0x7f6a0f[_0x3a50('0x38')][_0x3a50('0x2c')]())>=0x0&&_0x7f6a0f['appType']!=='custom'){if(_0x7f6a0f[_0x3a50('0x36')]){_0x3323cd[_0x3a50('0x14')]({'type':_0x7f6a0f[_0x3a50('0x1a')],'app':_0x3a50('0x20'),'appdata':_0x3a50('0x39'),'context':_0x7f6a0f['context'],'exten':_0x7f6a0f[_0x3a50('0xb')],'priority':_0x4067cf[_0x3a50('0x35')]+_0x3d879d[_0x3a50('0x18')]+_0x2893db++,'VoiceExtensionId':_0x7f6a0f[_0x3a50('0x19')]});_0x3323cd[_0x3a50('0x14')]({'type':_0x7f6a0f[_0x3a50('0x1a')],'app':'Set','appdata':_0x3a50('0x3a'),'context':_0x7f6a0f[_0x3a50('0x17')],'exten':_0x7f6a0f['exten'],'priority':_0x4067cf[_0x3a50('0x35')]+_0x3d879d[_0x3a50('0x18')]+_0x2893db++,'VoiceExtensionId':_0x7f6a0f['VoiceExtensionId']});}else{_0x3323cd[_0x3a50('0x14')]({'type':_0x7f6a0f[_0x3a50('0x1a')],'app':_0x3a50('0x20'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x7f6a0f['context'],'exten':_0x7f6a0f[_0x3a50('0xb')],'priority':_0x4067cf[_0x3a50('0x35')]+_0x3d879d[_0x3a50('0x18')]+_0x2893db++,'VoiceExtensionId':_0x7f6a0f[_0x3a50('0x19')]});_0x3323cd[_0x3a50('0x14')]({'type':_0x7f6a0f[_0x3a50('0x1a')],'app':_0x3a50('0x15'),'appdata':_0x3a50('0x3b'),'context':_0x7f6a0f[_0x3a50('0x17')],'exten':_0x7f6a0f['exten'],'priority':_0x4067cf['length']+_0x3d879d[_0x3a50('0x18')]+_0x2893db++,'VoiceExtensionId':_0x7f6a0f[_0x3a50('0x19')]});}}}for(var _0x43a427=0x0;_0x43a427<_0x4067cf[_0x3a50('0x35')];_0x43a427+=0x1){var _0x5b67e3=_0x3d879d[_0x3a50('0x18')]+_0x4067cf[_0x3a50('0x35')];var _0x389107=_0x43a427===_0x4067cf['length']-0x1?_0x3d879d[_0x3a50('0x18')]+_0x3323cd[_0x3a50('0x35')]+_0x2d2dbe[_0x3a50('0x35')]+0x2:_0x3d879d[_0x3a50('0x18')]+_0x43a427+0x1;_0x3323cd[_0x3a50('0x3c')](_0x43a427,0x0,{'type':_0x7f6a0f['type'],'app':_0x3a50('0x3d'),'appdata':_0x4067cf[_0x43a427]+'?'+_0x7f6a0f['context']+_0x3a50('0x3e')+_0x5b67e3+':'+_0x7f6a0f['context']+',${EXTEN},'+_0x389107,'exten':_0x7f6a0f['exten'],'context':_0x7f6a0f[_0x3a50('0x17')],'priority':_0x3d879d[_0x3a50('0x18')]+_0x43a427,'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]});}_0x7f6a0f[_0x3a50('0x18')]=_0x3323cd[_0x3a50('0x35')]?_[_0x3a50('0x3f')](_0x3323cd)[_0x3a50('0x18')]+0x1:_0x3d879d['priority'];_0x3d879d[_0x3a50('0x18')]=(_0x2d2dbe[_0x3a50('0x35')]?_[_0x3a50('0x3f')](_0x2d2dbe)[_0x3a50('0x18')]:_0x7f6a0f[_0x3a50('0x18')])+0x1;_0x3d879d['extensions']=_[_0x3a50('0x40')](_0x3d879d[_0x3a50('0x11')],_0x3323cd,[_0x7f6a0f],_0x2d2dbe);}_0x3d879d[_0x3a50('0x11')][_0x3a50('0x14')]({'type':_0x1c5a82[_0x4b09c9][0x0]['type'],'app':_0x3a50('0x41'),'exten':_0x1c5a82[_0x4b09c9][0x0]['exten'],'context':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x17')],'priority':_0x3d879d[_0x3a50('0x18')],'VoiceExtensionId':_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]});_0x3a0401[_0x3a50('0x14')](_0x1c5a82[_0x4b09c9][0x0][_0x3a50('0x19')]);_0x505d15=_['concat'](_0x505d15,_0x3d879d[_0x3a50('0x11')]);}}return _0x58bd8d[_0x3a50('0x42')](function(_0x42cd93){return _0x58bd8d[_0x3a50('0x2')]['VoiceExtension'][_0x3a50('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x3a0401}},'transaction':_0x42cd93})['then'](function(_0x5f362c){return _0x58bd8d[_0x3a50('0x2')][_0x3a50('0x8')]['bulkCreate'](_['sortBy'](_0x505d15,'priority'),{'transaction':_0x42cd93});});});})[_0x3a50('0x44')](function(_0x536715){console[_0x3a50('0x45')](_0x536715);});}exports[_0x3a50('0x46')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 1339725..24ffbbc 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 _0x0713=['papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\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','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','fromQuery','phone','scheduledAt','updatedAt','field','NOW()','ContactId','toString','createdAt','from','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','cm_contacts','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','CmList','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x3071('0x0'));var fs=require('fs');var squel=require(_0x3071('0x1'));var Papa=require(_0x3071('0x2'));var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));config[_0x3071('0x7')]=_[_0x3071('0x8')](config[_0x3071('0x7')],{'host':_0x3071('0x9'),'port':0x18eb});var socket=require(_0x3071('0xa'))(new Redis(config[_0x3071('0x7')]));require(_0x3071('0xb'))[_0x3071('0xc')](socket);try{if(!process[_0x3071('0xd')][0x2]||process[_0x3071('0xd')][0x2]===_0x3071('0xe')||process['argv'][0x2]===_0x3071('0xf')){throw new Error(_0x3071('0x10'));}var FILEPATH=process[_0x3071('0xd')][0x2];if(!process[_0x3071('0xd')][0x3]||process[_0x3071('0xd')][0x3]==='undefined'||process[_0x3071('0xd')][0x3]===_0x3071('0xf')||!process[_0x3071('0xd')][0x4]||process[_0x3071('0xd')][0x4]===_0x3071('0xe')||process['argv'][0x4]==='null'){throw new Error(_0x3071('0x11'));}var FIELDS=_['zipObject'](process[_0x3071('0xd')][0x3][_0x3071('0x12')](','),process['argv'][0x4][_0x3071('0x12')](','));if(!process['argv'][0x5]||process[_0x3071('0xd')][0x5]===_0x3071('0xe')||process[_0x3071('0xd')][0x5]===_0x3071('0xf')){throw new Error(_0x3071('0x13'));}var LISTID=process[_0x3071('0xd')][0x5];var COMPANYID=process[_0x3071('0xd')][0x6]&&process[_0x3071('0xd')][0x6]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x6]!=='null'?process[_0x3071('0xd')][0x6]:null;var DUPLICATES=process[_0x3071('0xd')][0x7]&&process[_0x3071('0xd')][0x7]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x7]!==_0x3071('0xf')?process[_0x3071('0xd')][0x7]:null;if(!process[_0x3071('0xd')][0x8]||process['argv'][0x8]===_0x3071('0xe')||process[_0x3071('0xd')][0x8]===_0x3071('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x3071('0xd')][0x8];}catch(_0x5cd80d){logger[_0x3071('0x14')](_0x5cd80d);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(_0x43128c,_0x3762d8,_0x457b57,_0x33090c){var _0x34c50e={'message':_0x3762d8};_0x34c50e[_0x43128c]=!![];if(_0x457b57){_0x34c50e[_0x3071('0x15')]=_0x457b57;}if(_0x33090c){_0x34c50e[_0x3071('0x16')]=_0x33090c;}return _0x34c50e;}function isEmail(_0x542646){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'](_0x542646);}function checkRow(_0x2ce48a,_0xb05b1d,_0x412652){return new BPromise(function(_0x13df9f,_0x2793ef){if(_[_0x3071('0x17')](_0x2ce48a)){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x18'),null,_0x412652));}if(_0x2ce48a[_0x3071('0x19')]&&_0x2ce48a['errors'][_0x3071('0x1a')]){var _0x3f1e6e=_[_0x3071('0x1b')](_0x2ce48a['errors'],_0x3071('0x1c'))[_0x3071('0x1d')](';');return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3f1e6e,null,_0x412652));}var _0x950fde={};for(var _0x3fa3b8 in FIELDS){if(FIELDS[_0x3071('0x1e')](_0x3fa3b8)&&FIELDS[_0x3fa3b8]){_0x950fde[_0x3fa3b8]=_0x2ce48a[_0x3071('0x1f')][0x0][FIELDS[_0x3fa3b8]]||_0x2ce48a[_0x3071('0x1f')][0x0]['\ufeff'+FIELDS[_0x3fa3b8]];}}if(!_0x950fde[_0x3071('0x20')]){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x21'),null,_0x412652));}if(!_0x950fde['phone']){return _0x2793ef(handleCheckRowError('error',_0x3071('0x22'),null,_0x412652));}if(_0x950fde[_0x3071('0x23')]){var _0x6ddf96=moment(_0x950fde[_0x3071('0x23')],_0x3071('0x24'));if(!_0x6ddf96[_0x3071('0x25')]()){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x26'),null,_0x412652));}}if(_0x950fde['email']){if(!isEmail(_0x950fde['email'])){return _0x2793ef(handleCheckRowError('error',_0x3071('0x27'),null,_0x412652));}}_0x950fde[_0x3071('0x28')]=LISTID;_0x950fde['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){var _0x28747d={};for(var _0x25250e=0x0,_0x13ae2c=DUPLICATES['length'];_0x25250e<_0x13ae2c;_0x25250e+=0x1){_0x28747d[DUPLICATES[_0x25250e]]=_0x950fde[DUPLICATES[_0x25250e]];}var _0x218a82=_[_0x3071('0x29')](_0xb05b1d,_0x28747d);if(_0x218a82){return _0x2793ef(handleCheckRowError(_0x3071('0x2a'),_0x3071('0x2b'),_0x218a82,_0x412652));}}return db[_0x3071('0x2c')][_0x3071('0x2d')](_0x950fde,{'raw':!![],'hooks':![],'fields':_[_0x3071('0x2e')](_0x950fde)})[_0x3071('0x2f')](function(_0x596cc3){if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){_0xb05b1d['push'](_['pick'](_0x950fde,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x596cc3['id'];return _0x13df9f();})[_0x3071('0x30')](function(_0xa3a7ae){return _0x2793ef(handleCheckRowError('error',_0x3071('0x31')+(_0xa3a7ae[_0x3071('0x1c')]||JSON[_0x3071('0x32')](_0xa3a7ae)),null,_0x412652));});});}function checkHopper(){function _0x14ac42(){return function(_0xc60572){logger[_0x3071('0x14')]('cmContact',_0x3071('0x33'),util[_0x3071('0x34')](_0xc60572,{'showHidden':![],'depth':null}));};}var _0x4ce6d4=function(_0x44ad05,_0x5b1392){var _0x28f855=squel[_0x3071('0x35')]()['into']('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),'ContactId',_0x3071('0x28'),_0x5b1392,'createdAt',_0x3071('0x39')],squel['select']()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x44ad05['id'][_0x3071('0x3d')](),_0x5b1392)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),'updatedAt')[_0x3071('0x3f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x3071('0x40'),LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x5b1392+_0x3071('0x46'),_0x44ad05['id'][_0x3071('0x3d')]())))['toString']();return _0x28f855;};var _0x5c93c7=function(_0x1721d0,_0x3c2f5e){var _0x1fe5e0=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')](['phone',_0x3071('0x38'),'ContactId','ListId',_0x3c2f5e,_0x3071('0x3e'),'updatedAt'],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')[_0x3071('0x3a')]('id','ContactId')[_0x3071('0x3a')](LISTID['toString'](),_0x3071('0x28'))[_0x3071('0x3a')](_0x1721d0['id']['toString'](),_0x3c2f5e)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')](_0x3071('0x40'),LISTID['toString']())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x4b'))[_0x3071('0x3f')](_0x3071('0x4c'))[_0x3071('0x41')](_0x3c2f5e+_0x3071('0x46'),_0x1721d0['id'][_0x3071('0x3d')]()))[_0x3071('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x3c2f5e+'\x20=\x20?',_0x1721d0['id'][_0x3071('0x3d')]())))[_0x3071('0x3d')]();return _0x1fe5e0;};function _0x5bc69e(_0x4b8ec0,_0x1b89ea){var _0x15abc4=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),_0x3071('0x3c'),_0x3071('0x28'),_0x1b89ea,'createdAt',_0x3071('0x39')],squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))['field'](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x4b8ec0['id'][_0x3071('0x3d')](),_0x1b89ea)[_0x3071('0x3a')]('NOW()',_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')]('ListId\x20=\x20?',LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))[_0x3071('0x3d')]();return _0x15abc4;}function _0x2e39ff(_0x3b47e8,_0x5cb3b3){var _0x5d1316=squel[_0x3071('0x35')]()[_0x3071('0x47')](_0x3071('0x4d'))[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x3c'),_0x3071('0x28'),_0x5cb3b3,_0x3071('0x3e'),_0x3071('0x39')],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')]('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))[_0x3071('0x3a')](_0x3b47e8['id']['toString'](),_0x5cb3b3)[_0x3071('0x3a')](_0x3071('0x3b'),'createdAt')['field'](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')](_0x3071('0x4e'))['where']('deletedAt\x20IS\x20NULL')[_0x3071('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))['toString']();return _0x5d1316;}return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id',_0x3071('0x52')],'include':[{'model':db['CmList'],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x588406){var _0x1b35d3=[];if(_0x588406){var _0x29ee70;for(var _0x388cd1=0x0,_0x40c258;_0x388cd1<_0x588406[_0x3071('0x1a')];_0x388cd1+=0x1){_0x40c258=_0x588406[_0x388cd1][_0x3071('0x54')]({'plain':!![]});switch(_0x40c258[_0x3071('0x52')]){case'always':_0x1b35d3['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x40c258,_0x3071('0x57')))['then'](function(){})['catch'](_0x14ac42()));break;case _0x3071('0x58'):_0x1b35d3[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x40c258,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x1b35d3[_0x3071('0x59')](db['sequelize'][_0x3071('0x56')](_0x5bc69e(_0x40c258,'VoiceQueueId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x1b35d3;})[_0x3071('0x5a')]()[_0x3071('0x2f')](function(){return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x138a94){var _0x1da477=[];if(_0x138a94){var _0x4f06c0;for(var _0x2a2e7a=0x0,_0x22ec7b;_0x2a2e7a<_0x138a94[_0x3071('0x1a')];_0x2a2e7a+=0x1){_0x22ec7b=_0x138a94[_0x2a2e7a]['get']({'plain':!![]});_0x1da477['push'](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x22ec7b,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}return _0x1da477;})[_0x3071('0x5a')]();})[_0x3071('0x2f')](function(){return db[_0x3071('0x5c')][_0x3071('0x50')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x3cc937){var _0x98d0fb=[];if(_0x3cc937){for(var _0x1fea60=0x0,_0x435dcb;_0x1fea60<_0x3cc937[_0x3071('0x1a')];_0x1fea60+=0x1){_0x435dcb=_0x3cc937[_0x1fea60]['get']({'plain':!![]});switch(_0x435dcb[_0x3071('0x52')]){case'always':_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;case _0x3071('0x58'):_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x435dcb,'CampaignId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x98d0fb['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5bc69e(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x98d0fb;})['all']();})['then'](function(){return db[_0x3071('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x5e'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x136278){var _0x22783b=[];if(_0x136278){for(var _0x2f31b7=0x0,_0x568386;_0x2f31b7<_0x136278[_0x3071('0x1a')];_0x2f31b7+=0x1){_0x568386=_0x136278[_0x2f31b7][_0x3071('0x54')]({'plain':!![]});_0x22783b[_0x3071('0x59')](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x568386,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})['catch'](_0x14ac42()));}}return _0x22783b;})[_0x3071('0x5a')]();})[_0x3071('0x30')](function(_0x391887){logger[_0x3071('0x14')](_0x3071('0x5f'),'generalCheckHopper',_0x391887[_0x3071('0x1c')]);});}var processPromises=function(_0x479fe7){return BPromise[_0x3071('0x5a')](promises)[_0x3071('0x2f')](function(_0x39060f){})[_0x3071('0x30')](function(_0x1120ec){logger[_0x3071('0x14')](_0x3071('0x60'),JSON[_0x3071('0x32')](_0x1120ec));})['finally'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x479fe7){return _0x479fe7[_0x3071('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x3071('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3071('0x64')](FILEPATH);}catch(_0x5e0cbd){logger[_0x3071('0x14')](_0x3071('0x65'),JSON[_0x3071('0x32')](_0x5e0cbd));}finally{process[_0x3071('0x66')](0x0);}});};process['on'](_0x3071('0x67'),function(){logger[_0x3071('0x68')](_0x3071('0x69'));endCsv();});function main(){return BPromise[_0x3071('0x6a')]()[_0x3071('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x3071('0x2c')][_0x3071('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3071('0x2f')](function(_0x5b2830){var _0x561030=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x561030,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4eb9e2,_0x8c77b7){total+=0x1;var _0x44b4c9=total;promises['push'](checkRow(_0x4eb9e2,_0x5b2830,_0x44b4c9)[_0x3071('0x2f')](function(){success+=0x1;})[_0x3071('0x30')](function(_0x1f61df){if(_0x1f61df['error']){errors+=0x1;delete _0x1f61df['error'];}else if(_0x1f61df[_0x3071('0x2a')]){duplicates+=0x1;delete _0x1f61df[_0x3071('0x2a')];}rows[_0x3071('0x59')](_0x1f61df);}));if(total%0xc8===0x0){_0x8c77b7[_0x3071('0x6b')]();return processPromises(_0x8c77b7);}},'complete':function(){return processPromises()[_0x3071('0x2f')](function(){logger[_0x3071('0x68')](_0x3071('0x6c'));endCsv();});},'error':function(_0x5eb60d,_0x58b62c){logger[_0x3071('0x68')](_0x3071('0x6d'),JSON[_0x3071('0x32')](_0x5eb60d));endCsv();}});})[_0x3071('0x30')](function(_0x5a3b64){logger[_0x3071('0x14')](_0x3071('0x6e'),JSON[_0x3071('0x32')](_0x5a3b64));});}main(); \ No newline at end of file +var _0xe706=['toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','insert','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','VoiceQueueId','catch','onlyIfOpen','query','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','split','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','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','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()'];(function(_0x9b040a,_0x5e6cc3){var _0x1b1224=function(_0x3d63a9){while(--_0x3d63a9){_0x9b040a['push'](_0x9b040a['shift']());}};_0x1b1224(++_0x5e6cc3);}(_0xe706,0xa3));var _0x6e70=function(_0x182094,_0x269200){_0x182094=_0x182094-0x0;var _0x2e74ff=_0xe706[_0x182094];return _0x2e74ff;};'use strict';var BPromise=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var socket=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));require(_0x6e70('0xd'))[_0x6e70('0xe')](socket);try{if(!process[_0x6e70('0xf')][0x2]||process[_0x6e70('0xf')][0x2]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x2]===_0x6e70('0x11')){throw new Error(_0x6e70('0x12'));}var FILEPATH=process[_0x6e70('0xf')][0x2];if(!process[_0x6e70('0xf')][0x3]||process[_0x6e70('0xf')][0x3]===_0x6e70('0x10')||process['argv'][0x3]==='null'||!process[_0x6e70('0xf')][0x4]||process[_0x6e70('0xf')][0x4]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x4]===_0x6e70('0x11')){throw new Error(_0x6e70('0x13'));}var FIELDS=_[_0x6e70('0x14')](process[_0x6e70('0xf')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x6e70('0xf')][0x5]||process['argv'][0x5]==='undefined'||process[_0x6e70('0xf')][0x5]===_0x6e70('0x11')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x6e70('0xf')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x6e70('0xf')][0x6]!==_0x6e70('0x10')&&process['argv'][0x6]!=='null'?process[_0x6e70('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6e70('0xf')][0x7]!==_0x6e70('0x10')&&process['argv'][0x7]!=='null'?process[_0x6e70('0xf')][0x7]:null;if(!process[_0x6e70('0xf')][0x8]||process[_0x6e70('0xf')][0x8]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x8]===_0x6e70('0x11')){throw new Error(_0x6e70('0x15'));}var SOCKET_TIMESTAMP=process[_0x6e70('0xf')][0x8];}catch(_0x29326f){logger[_0x6e70('0x16')](_0x29326f);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(_0x4a0cfe,_0x228350,_0x344b65,_0x27b294){var _0x502b2d={'message':_0x228350};_0x502b2d[_0x4a0cfe]=!![];if(_0x344b65){_0x502b2d[_0x6e70('0x17')]=_0x344b65;}if(_0x27b294){_0x502b2d[_0x6e70('0x18')]=_0x27b294;}return _0x502b2d;}function isEmail(_0x3337a6){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'](_0x3337a6);}function checkRow(_0x10fc91,_0x538b9c,_0x50aec2){return new BPromise(function(_0x4e97c7,_0x41e352){if(_[_0x6e70('0x19')](_0x10fc91)){return _0x41e352(handleCheckRowError('error',_0x6e70('0x1a'),null,_0x50aec2));}if(_0x10fc91[_0x6e70('0x1b')]&&_0x10fc91['errors'][_0x6e70('0x1c')]){var _0x67fb43=_[_0x6e70('0x1d')](_0x10fc91['errors'],'message')[_0x6e70('0x1e')](';');return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x67fb43,null,_0x50aec2));}var _0x83c836={};for(var _0x114344 in FIELDS){if(FIELDS[_0x6e70('0x1f')](_0x114344)&&FIELDS[_0x114344]){_0x83c836[_0x114344]=_0x10fc91['data'][0x0][FIELDS[_0x114344]]||_0x10fc91[_0x6e70('0x20')][0x0]['\ufeff'+FIELDS[_0x114344]];}}if(!_0x83c836[_0x6e70('0x21')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x22'),null,_0x50aec2));}if(!_0x83c836[_0x6e70('0x23')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x24'),null,_0x50aec2));}if(_0x83c836[_0x6e70('0x25')]){var _0x3a0821=moment(_0x83c836[_0x6e70('0x25')],'YYYY-MM-DD');if(!_0x3a0821[_0x6e70('0x26')]()){return _0x41e352(handleCheckRowError('error',_0x6e70('0x27'),null,_0x50aec2));}}if(_0x83c836['email']){if(!isEmail(_0x83c836[_0x6e70('0x28')])){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x29'),null,_0x50aec2));}}_0x83c836['ListId']=LISTID;_0x83c836[_0x6e70('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){var _0x5780a1={};for(var _0x13d673=0x0,_0x154925=DUPLICATES['length'];_0x13d673<_0x154925;_0x13d673+=0x1){_0x5780a1[DUPLICATES[_0x13d673]]=_0x83c836[DUPLICATES[_0x13d673]];}var _0x10d8f6=_[_0x6e70('0x2b')](_0x538b9c,_0x5780a1);if(_0x10d8f6){return _0x41e352(handleCheckRowError(_0x6e70('0x2c'),_0x6e70('0x2d'),_0x10d8f6,_0x50aec2));}}return db[_0x6e70('0x2e')][_0x6e70('0x2f')](_0x83c836,{'raw':!![],'hooks':![],'fields':_[_0x6e70('0x30')](_0x83c836)})[_0x6e70('0x31')](function(_0xf146fd){if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){_0x538b9c['push'](_[_0x6e70('0x32')](_0x83c836,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xf146fd['id'];return _0x4e97c7();})['catch'](function(_0x23cd1a){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x33')+(_0x23cd1a[_0x6e70('0x34')]||JSON[_0x6e70('0x35')](_0x23cd1a)),null,_0x50aec2));});});}function checkHopper(){function _0x989b80(){return function(_0x2440be){logger[_0x6e70('0x16')](_0x6e70('0x36'),_0x6e70('0x37'),util[_0x6e70('0x38')](_0x2440be,{'showHidden':![],'depth':null}));};}var _0x23d5e2=function(_0x5594d3,_0x501b53){var _0x5446a2=squel['insert']()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),'ListId',_0x501b53,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x5594d3['id'][_0x6e70('0x43')](),_0x501b53)['field']('NOW()','createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x6e70('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x501b53+'\x20=\x20?',_0x5594d3['id'][_0x6e70('0x43')]())))[_0x6e70('0x43')]();return _0x5446a2;};var _0x2dafb5=function(_0x3478e2,_0x5bbc3a){var _0x291de6=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),'ContactId',_0x6e70('0x44'),_0x5bbc3a,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))['field'](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))['field'](LISTID['toString'](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x3478e2['id'][_0x6e70('0x43')](),_0x5bbc3a)['field']('NOW()',_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b'))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()['field'](_0x6e70('0x4d'))[_0x6e70('0x45')](_0x6e70('0x4e'))[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']()))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']())))[_0x6e70('0x43')]();return _0x291de6;};function _0xebe5f7(_0x54efdf,_0x3cfaa9){var _0xb3f06c=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))['fromQuery']([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),_0x6e70('0x44'),_0x3cfaa9,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3c'))[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x54efdf['id'][_0x6e70('0x43')](),_0x3cfaa9)['field'](_0x6e70('0x42'),_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')]('cm_contacts')[_0x6e70('0x48')](_0x6e70('0x47'))['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0xb3f06c;}function _0x41a861(_0x10d299,_0x739946){var _0x30cd88=squel['insert']()['into'](_0x6e70('0x50'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3d'),'ListId',_0x739946,'createdAt',_0x6e70('0x3f')],squel[_0x6e70('0x40')]()['field']('phone',_0x6e70('0x23'))['field']('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x10d299['id'][_0x6e70('0x43')](),_0x739946)[_0x6e70('0x41')](_0x6e70('0x42'),'createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0x30cd88;}return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x55'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x82a9a){var _0x515c0c=[];if(_0x82a9a){var _0xce964b;for(var _0x531097=0x0,_0x5b4046;_0x531097<_0x82a9a[_0x6e70('0x1c')];_0x531097+=0x1){_0x5b4046=_0x82a9a[_0x531097][_0x6e70('0x56')]({'plain':!![]});switch(_0x5b4046[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')]['query'](_0x2dafb5(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;default:_0x515c0c['push'](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x5b4046,_0x6e70('0x5b')))['then'](function(){})['catch'](_0x989b80()));}}}return _0x515c0c;})[_0x6e70('0x5f')]()[_0x6e70('0x31')](function(){return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x241a21){var _0x56d4d9=[];if(_0x241a21){var _0x58666a;for(var _0x1c7c5f=0x0,_0xf7a034;_0x1c7c5f<_0x241a21[_0x6e70('0x1c')];_0x1c7c5f+=0x1){_0xf7a034=_0x241a21[_0x1c7c5f][_0x6e70('0x56')]({'plain':!![]});_0x56d4d9[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x41a861(_0xf7a034,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}return _0x56d4d9;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':'Lists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x4b2d40){var _0x5b5471=[];if(_0x4b2d40){for(var _0x402f6f=0x0,_0x48e04b;_0x402f6f<_0x4b2d40['length'];_0x402f6f+=0x1){_0x48e04b=_0x4b2d40[_0x402f6f][_0x6e70('0x56')]({'plain':!![]});switch(_0x48e04b[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x5b5471['push'](db['sequelize']['query'](_0x2dafb5(_0x48e04b,_0x6e70('0x61')))['then'](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x48e04b,_0x6e70('0x61')))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));break;default:_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x48e04b,'CampaignId'))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}}return _0x5b5471;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')][_0x6e70('0x52')]({'attributes':['id'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x62'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x48f6fd){var _0x463eed=[];if(_0x48f6fd){for(var _0x39e6db=0x0,_0x53acc8;_0x39e6db<_0x48f6fd[_0x6e70('0x1c')];_0x39e6db+=0x1){_0x53acc8=_0x48f6fd[_0x39e6db][_0x6e70('0x56')]({'plain':!![]});_0x463eed['push'](db['sequelize'][_0x6e70('0x5e')](_0x41a861(_0x53acc8,'CampaignId'))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));}}return _0x463eed;})[_0x6e70('0x5f')]();})[_0x6e70('0x5c')](function(_0x106f32){logger[_0x6e70('0x16')](_0x6e70('0x63'),_0x6e70('0x64'),_0x106f32[_0x6e70('0x34')]);});}var processPromises=function(_0x5afbf5){return BPromise['all'](promises)[_0x6e70('0x31')](function(_0x4bf451){})[_0x6e70('0x5c')](function(_0xa2a4d5){logger[_0x6e70('0x16')](_0x6e70('0x65'),JSON['stringify'](_0xa2a4d5));})[_0x6e70('0x66')](function(){socket['emit'](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5afbf5){return _0x5afbf5[_0x6e70('0x68')]();}});};var endCsv=function(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x6e70('0x31')](function(){socket[_0x6e70('0x6a')](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1d6acf){logger['error'](_0x6e70('0x6b'),JSON['stringify'](_0x1d6acf));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x6e70('0x6c')](_0x6e70('0x6d'));endCsv();});function main(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6e70('0x6e')](',');return db['CmContact'][_0x6e70('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6e70('0x31')](function(_0x48c30c){var _0x3c2d33=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6e70('0x6f')](_0x3c2d33,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d0585,_0x4a87e2){total+=0x1;var _0x25f60c=total;promises[_0x6e70('0x59')](checkRow(_0x5d0585,_0x48c30c,_0x25f60c)[_0x6e70('0x31')](function(){success+=0x1;})[_0x6e70('0x5c')](function(_0x3e6661){if(_0x3e6661[_0x6e70('0x16')]){errors+=0x1;delete _0x3e6661[_0x6e70('0x16')];}else if(_0x3e6661['duplicate']){duplicates+=0x1;delete _0x3e6661[_0x6e70('0x2c')];}rows['push'](_0x3e6661);}));if(total%0xc8===0x0){_0x4a87e2[_0x6e70('0x70')]();return processPromises(_0x4a87e2);}},'complete':function(){return processPromises()[_0x6e70('0x31')](function(){logger[_0x6e70('0x6c')](_0x6e70('0x71'));endCsv();});},'error':function(_0x4764d5,_0x41b7de){logger[_0x6e70('0x6c')]('CSV\x20parse\x20error',JSON[_0x6e70('0x35')](_0x4764d5));endCsv();}});})['catch'](function(_0x27bdf2){logger[_0x6e70('0x16')](_0x6e70('0x72'),JSON[_0x6e70('0x35')](_0x27bdf2));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 1b98ea3..4e68191 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 _0x9957=['socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','updatedAt','priority','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.ListId','cm_hopper_black','phone','fields','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.updatedAt','scheduledat','ListId','createdAt','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','all','then','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','utcOffset','set','offset','main','stringify','start','binding','server/files/tmp','.csv','includes','header',',utcOffset','writeFileSync','parse','createReadStream','data','rows','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','SystemRow','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);','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','CompanyId',',\x20scheduledAt\x20=\x20NOW()','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','DROP\x20TABLE\x20','each','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults'];(function(_0x3154b8,_0x5ca9e4){var _0x2754e6=function(_0xfdd3f1){while(--_0xfdd3f1){_0x3154b8['push'](_0x3154b8['shift']());}};_0x2754e6(++_0x5ca9e4);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var fs=require('fs');var path=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var Papa=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var BPromise=require('bluebird');var moment=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var Redis=require(_0x7995('0x6'));var db=require(_0x7995('0x7'))['db'];var config=require('../../../config/environment');var shared=require(_0x7995('0x8'));var logger=require(_0x7995('0x9'))(_0x7995('0xa'));config[_0x7995('0xb')]=_[_0x7995('0xc')](config[_0x7995('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7995('0xd'))(new Redis(config[_0x7995('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x7995('0xe'));function isEmail(_0x3116fb){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))*$/[_0x7995('0xf')](_0x3116fb);}function selectNotIn(_0x35b5fe,_0x3c1d19,_0x1e400a,_0x341672,_0x524f7b){return squel[_0x7995('0x10')]()[_0x7995('0x11')]('phone')[_0x7995('0x12')](_0x341672)[_0x7995('0x13')](_0x3c1d19,null,_0x3c1d19+_0x7995('0x14')+_0x341672+'.'+_0x1e400a)[_0x7995('0x15')](_0x341672+'.'+_0x1e400a+_0x7995('0x16')+_0x35b5fe+'.'+_0x1e400a)[_0x7995('0x15')](_0x3c1d19+_0x7995('0x17')+_0x524f7b['join']()+')');}function insertCmHopper(_0x58f5ad,_0x2b4e94,_0x2233dd,_0x24b5bb,_0x321ae8){var _0x3f1d3e=[_0x7995('0x18'),_0x7995('0x19'),_0x7995('0x1a'),'cm_contacts.ListId',_0x2b4e94+'.'+_0x24b5bb,_0x7995('0x1b'),'cm_contacts.updatedAt',_0x7995('0x1c'),_0x7995('0x1d'),'\x22'+_0x321ae8+'\x22'];return squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x20'))[_0x7995('0x21')](['phone','scheduledat',_0x7995('0x22'),'ListId',_0x24b5bb,'createdAt',_0x7995('0x23'),_0x7995('0x24'),'UserId',_0x7995('0x25')],squel['select']()['fields'](_0x3f1d3e)[_0x7995('0x12')](_0x2b4e94)[_0x7995('0x13')](_0x7995('0x26'),null,_0x7995('0x27')+_0x2b4e94+_0x7995('0x28'))[_0x7995('0x13')](_0x2233dd,null,_0x2233dd+'.id\x20=\x20'+_0x2b4e94+'.'+_0x24b5bb)[_0x7995('0x15')](_0x2b4e94+_0x7995('0x29'),_0x58f5ad)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')](_0x7995('0x2b'),selectNotIn(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x7995('0x20'),[_0x7995('0x2c'),'\x22onlyIfOpen\x22']))[_0x7995('0x15')](_0x7995('0x2b'),selectNotIn(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x7995('0x20'),[_0x7995('0x2c')])))[_0x7995('0x2d')]();}function insertCmHopperBlack(_0x2a307e,_0x56691a,_0x47625f,_0x5911c3){var _0x229742=[_0x7995('0x18'),_0x7995('0x1a'),_0x7995('0x2e'),_0x56691a+'.'+_0x5911c3,_0x7995('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7995('0x1e')]()['into'](_0x7995('0x2f'))[_0x7995('0x21')]([_0x7995('0x30'),'ContactId','ListId',_0x5911c3,'createdAt',_0x7995('0x23')],squel[_0x7995('0x10')]()[_0x7995('0x31')](_0x229742)[_0x7995('0x12')](_0x56691a)[_0x7995('0x13')](_0x7995('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x56691a+'.CmListId')[_0x7995('0x13')](_0x47625f,null,_0x47625f+'.id\x20=\x20'+_0x56691a+'.'+_0x5911c3)[_0x7995('0x15')](_0x56691a+_0x7995('0x29'),_0x2a307e)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7995('0x10')]()[_0x7995('0x11')]('phone')['from']('cm_hopper_black')[_0x7995('0x15')](_0x7995('0x32'),_0x2a307e)['where'](_0x5911c3+_0x7995('0x33'),_0x56691a+'.'+_0x5911c3)))['toString']();}function insertTzCmHopper(_0x37917b,_0x1cb058,_0x177cb4,_0x5014d2,_0x52d76d,_0x36d057){var _0x5e67fe=['cm_contacts.phone',_0x7995('0x34')+_0x36d057+_0x7995('0x35'),'cm_contacts.id',_0x7995('0x2e'),_0x1cb058+'.'+_0x5014d2,_0x7995('0x1b'),_0x7995('0x36'),_0x7995('0x1c'),_0x7995('0x1d'),'\x22'+_0x52d76d+'\x22'];var _0x53002a=squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x20'))[_0x7995('0x21')](['phone',_0x7995('0x37'),_0x7995('0x22'),_0x7995('0x38'),_0x5014d2,_0x7995('0x39'),_0x7995('0x23'),_0x7995('0x24'),'UserId',_0x7995('0x25')],squel[_0x7995('0x10')]()[_0x7995('0x31')](_0x5e67fe)[_0x7995('0x12')](_0x1cb058)[_0x7995('0x13')](_0x7995('0x26'),null,_0x7995('0x27')+_0x1cb058+_0x7995('0x28'))[_0x7995('0x13')](_0x177cb4,null,_0x177cb4+_0x7995('0x14')+_0x1cb058+'.'+_0x5014d2)[_0x7995('0x13')](_0x36d057,null,_0x36d057+_0x7995('0x14')+_0x1cb058+'.'+_0x5014d2)[_0x7995('0x15')](_0x1cb058+'.CmListId\x20=\x20?',_0x37917b)['where'](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1cb058,_0x177cb4,_0x5014d2,'cm_hopper',[_0x7995('0x2c'),'\x22onlyIfOpen\x22']))['where'](_0x7995('0x2b'),selectNotIn(_0x1cb058,_0x177cb4,_0x5014d2,_0x7995('0x20'),[_0x7995('0x2c')])))['toString']();return _0x53002a;}function insertTzCmHopperBlack(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881){var _0x493066=[_0x7995('0x18'),_0x7995('0x1a'),_0x7995('0x2e'),_0x5e85b9+'.'+_0x5a8881,_0x7995('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x2f'))[_0x7995('0x21')](['phone','ContactId',_0x7995('0x38'),_0x5a8881,'createdAt',_0x7995('0x23')],squel['select']()[_0x7995('0x31')](_0x493066)['from'](_0x5e85b9)[_0x7995('0x13')](_0x7995('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x5e85b9+_0x7995('0x28'))[_0x7995('0x13')](_0x3993b5,null,_0x3993b5+_0x7995('0x14')+_0x5e85b9+'.'+_0x5a8881)[_0x7995('0x15')](_0x5e85b9+'.CmListId\x20=\x20?',_0x46ac4f)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7995('0x10')]()[_0x7995('0x11')](_0x7995('0x30'))[_0x7995('0x12')](_0x7995('0x2f'))['where'](_0x7995('0x32'),_0x46ac4f)[_0x7995('0x15')](_0x5a8881+'\x20=\x20?',_0x5e85b9+'.'+_0x5a8881)))[_0x7995('0x2d')]();}function insertCmContact(_0x5843ba,_0x1d87f9,_0x187735,_0x1afab4){var _0x30e220=_[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x1afab4),[_0x7995('0x38'),'CompanyId',_0x7995('0x39'),_0x7995('0x23')]);return squel[_0x7995('0x1e')]()['into'](_0x7995('0x26'))[_0x7995('0x21')](_0x30e220,squel[_0x7995('0x10')]()['fields'](_0x30e220)['from'](_0x1d87f9)['where']('('+_0x187735[_0x7995('0x13')](',')+_0x7995('0x3c'),squel['select']()[_0x7995('0x31')](_0x187735)[_0x7995('0x12')](_0x7995('0x26'))[_0x7995('0x15')](_0x7995('0x32'),_0x5843ba)['where'](_0x7995('0x3d')))['where'](_0x7995('0x3e'),squel[_0x7995('0x10')]()[_0x7995('0x11')]('MIN(id)','min_id')['from'](_0x1d87f9)['group'](_0x187735[_0x7995('0x13')](','))))[_0x7995('0x2d')]();}function handleStop(){logger[_0x7995('0x3f')](_0x7995('0x40'));stopped=!![];}function handleUncaughtException(_0x1d957e){logger[_0x7995('0x41')](_0x1d957e[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);}function handleError(_0x328671,_0x17ecd3){stats[_0x7995('0x44')][_0x7995('0x45')]({'name':_0x17ecd3[_0x7995('0x46')],'message':_0x17ecd3[_0x7995('0x42')],'row':_0x328671});}function handleQuery(_0x1ea1dc){logger[_0x7995('0x3f')](_0x1ea1dc);return db[_0x7995('0x47')][_0x7995('0x48')](_0x1ea1dc)[_0x7995('0x49')](function(_0x50b7c2){results[_0x7995('0x45')](_0x50b7c2);})[_0x7995('0x4a')](function(_0x3b8a54){logger[_0x7995('0x41')](_0x3b8a54['message']);});}function updateTzCampaigns(_0x53125a){return new Promise(function(_0x402fa0,_0x197b52){var _0x5b9467=squel[_0x7995('0x10')]()['fields']([_0x7995('0x4b'),_0x7995('0x4c')])[_0x7995('0x12')](_0x7995('0x4d'))['join']('campaigns_has_cm_lists',null,_0x7995('0x4e'))[_0x7995('0x15')](_0x7995('0x4f')+_0x53125a);db[_0x7995('0x47')][_0x7995('0x48')](_0x5b9467[_0x7995('0x2d')]())[_0x7995('0x49')](function(_0x1e2206){var _0x984c23=[];for(var _0x50caf5=0x0;_0x50caf5<_0x1e2206[_0x7995('0x50')];_0x50caf5++){_0x984c23[_0x7995('0x45')](getTimezoneData(_0x1e2206[_0x50caf5],tmp_campaigns));}BPromise[_0x7995('0x51')](_0x984c23)[_0x7995('0x52')](function(){_0x402fa0({'val':0x1});});})['catch'](function(_0x51bf6a){logger[_0x7995('0x41')](_0x51bf6a[_0x7995('0x42')]);_0x402fa0({'val':0x0});});});}function updateTzVoiceQueues(_0x47d5d7){return new Promise(function(_0x971a23,_0x375fc9){var _0x2e3421=squel[_0x7995('0x10')]()[_0x7995('0x31')](['voice_queues.id',_0x7995('0x53')])['from'](_0x7995('0x54'))[_0x7995('0x13')](_0x7995('0x55'),null,_0x7995('0x56'))[_0x7995('0x15')](_0x7995('0x57')+_0x47d5d7);db[_0x7995('0x47')][_0x7995('0x48')](_0x2e3421[_0x7995('0x2d')]())[_0x7995('0x49')](function(_0x2618c4){var _0x234d8d=[];for(var _0x56eb85=0x0;_0x56eb85<_0x2618c4[_0x7995('0x50')];_0x56eb85++){_0x234d8d[_0x7995('0x45')](getTimezoneData(_0x2618c4[_0x56eb85],tmp_voice_queues));}BPromise[_0x7995('0x51')](_0x234d8d)[_0x7995('0x52')](function(){_0x971a23({'val':0x1});});})[_0x7995('0x4a')](function(_0x54a2e0){logger['error'](_0x54a2e0[_0x7995('0x42')]);_0x971a23({'val':0x0});});});}function getTimezoneData(_0x87e38d,_0x221542){return new Promise(function(_0xae6166,_0x5aa2ec){var _0x22d317=shared['timezones'];var _0x5df621=_0x22d317[_0x87e38d[_0x7995('0x58')]];if(_[_0x7995('0x59')](_0x5df621)){_0xae6166({'ret':0x1});}else{var _0x3f0a71=_0x5df621[_0x7995('0x5a')];var _0x290eae=squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x221542)[_0x7995('0x5b')]('id',_0x87e38d['id'])[_0x7995('0x5b')](_0x7995('0x5c'),_0x3f0a71)['set'](_0x7995('0x58'),_0x87e38d[_0x7995('0x58')])[_0x7995('0x2d')]();return db['sequelize'][_0x7995('0x48')](_0x290eae)[_0x7995('0x49')](function(_0x705f0){_0xae6166({'ret':0x1});})[_0x7995('0x4a')](function(_0x3b0d30){logger[_0x7995('0x41')](_0x3b0d30[_0x7995('0x42')]);_0x5aa2ec({'ret':0x1});});}});}function handleTZQuery(_0x3adfd2){logger[_0x7995('0x3f')](_0x3adfd2);return db[_0x7995('0x47')][_0x7995('0x48')](_0x3adfd2)['spread'](function(_0x5e8b4c){})[_0x7995('0x4a')](function(_0xfe1105){logger[_0x7995('0x41')](_0xfe1105[_0x7995('0x42')]);});}function main(_0x4dbab8,_0x3b45e8,_0x2c9eb6,_0x54b955){logger['info'](_0x7995('0x5d'),_0x4dbab8,JSON[_0x7995('0x5e')](_0x3b45e8));process['send'](_0x7995('0x5f'));var _0x5b1cba=_0x3b45e8[_0x7995('0x60')];var _0xea9aba=_0x3b45e8['socket_timestamp'];var _0x5d9d33=path[_0x7995('0x13')](config['root'],_0x7995('0x61'),_0xea9aba+_0x7995('0x62'));hasTZ=_[_0x7995('0x3b')](_0x5b1cba)[_0x7995('0x63')](_0x7995('0x58'));var _0x18cff7=_[_0x7995('0x3b')](_0x5b1cba)[_0x7995('0x13')]();logger[_0x7995('0x3f')](_0x7995('0x64'),_0x18cff7);if(hasTZ)_0x18cff7+=_0x7995('0x65');fs[_0x7995('0x66')](_0x5d9d33,_0x18cff7+'\x0a');Papa[_0x7995('0x67')](fs[_0x7995('0x68')](_0x4dbab8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x36e3a7,_0x3773de){try{for(var _0x6ad274=0x0,_0x251490=[];_0x6ad274<_0x36e3a7[_0x7995('0x69')][_0x7995('0x50')];_0x6ad274++){stats[_0x7995('0x6a')]+=0x1;if(_0x36e3a7[_0x7995('0x44')][_0x6ad274]){handleError(_0x36e3a7[_0x7995('0x69')][_0x6ad274],_0x36e3a7[_0x7995('0x44')][_0x6ad274]);}else{var _0x260ef1=[];for(var _0x33479a in _0x5b1cba){if(_0x5b1cba[_0x7995('0x6b')](_0x33479a)){if(_0x36e3a7[_0x7995('0x69')][_0x6ad274][_0x5b1cba[_0x33479a]]){var _0x59efff=_[_0x7995('0x6c')](_0x36e3a7[_0x7995('0x69')][_0x6ad274][_0x5b1cba[_0x33479a]]['replace'](/"/g,'\x27'));switch(_0x33479a){case'scheduledat':var _0x15e8d1=moment(_0x59efff,_0x7995('0xe'),!![]);if(_0x15e8d1[_0x7995('0x6d')]()){_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');}else{_0x260ef1[_0x7995('0x45')](_0x7995('0x6e'));}break;case'priority':var _0x2f8a2d=parseInt(_0x59efff);_0x59efff=_[_0x7995('0x6f')](_0x2f8a2d)||_0x2f8a2d<0x0||_0x2f8a2d>0x4?_0x54b955?0x3:0x2:_0x2f8a2d;_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');break;case _0x7995('0x70'):var _0x7d9c6e=parseInt(_0x59efff);if(_[_0x7995('0x71')](_0x7d9c6e)&&_[_0x7995('0x63')](_0x2c9eb6,_0x7d9c6e)){_0x251490[_0x7995('0x45')]('\x22'+_0x7d9c6e+'\x22');}else{_0x260ef1['push'](_0x7995('0x72'));}break;case _0x7995('0x73'):if(isEmail(_0x59efff)){_0x251490['push']('\x22'+_0x59efff+'\x22');}else{_0x260ef1['push'](_0x7995('0x74'));}break;case _0x7995('0x75'):var _0x18e1a2=moment(_0x59efff,_0x7995('0x76'),!![]);if(_0x18e1a2[_0x7995('0x6d')]()){_0x251490['push']('\x22'+_0x59efff+'\x22');}else{_0x260ef1[_0x7995('0x45')](_0x7995('0x77'));}break;case'dialTimezone':var _0x209977=shared[_0x7995('0x78')];var _0x489bac=_0x209977[_0x59efff];if(!_[_0x7995('0x59')](_0x489bac)){var _0x4a5bc5=_0x489bac[_0x7995('0x5a')];_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');_0x251490[_0x7995('0x45')]('\x22'+_0x4a5bc5+'\x22');}break;default:_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');}}else{switch(_0x33479a){case _0x7995('0x79'):case'phone':_0x260ef1[_0x7995('0x45')](_0x33479a+_0x7995('0x7a'));break;default:_0x251490[_0x7995('0x45')]('\x22\x22');}}}}if(_0x260ef1['length']){handleError(_0x36e3a7[_0x7995('0x69')][_0x6ad274],{'code':_0x7995('0x7b'),'message':_0x260ef1[_0x7995('0x13')]()});}else{fs[_0x7995('0x7c')](_0x5d9d33,_0x251490['join']()+'\x0a');}_0x251490=[];}if(!(stats[_0x7995('0x6a')]%0xc8)){socket[_0x7995('0x7d')](_0x7995('0x7e')+_0xea9aba,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x7995('0x7f'));_0x3773de[_0x7995('0x80')]();}}catch(_0x4800a8){handleError(_0x36e3a7['data'][_0x6ad274],{'code':_0x7995('0x81'),'message':_0x4800a8[_0x7995('0x42')]});logger[_0x7995('0x41')](_0x7995('0x82'),_0x4800a8[_0x7995('0x42')]);}},'complete':function(){try{var _0x551b5e=[];var _0x56003d=[];var _0x393cb7='cm_contacts';if(_0x3b45e8['duplicates']&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]){_0x393cb7=_0x7995('0x84')+_0xea9aba;_0x551b5e['push'](_0x7995('0x85')+_0x393cb7+_0x7995('0x86'));}tmp_campaigns=_0x7995('0x87')+_0xea9aba;tmp_voice_queues=_0x7995('0x88')+_0xea9aba;_0x56003d[_0x7995('0x45')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x7995('0x89'));_0x56003d[_0x7995('0x45')](_0x7995('0x85')+tmp_voice_queues+_0x7995('0x89'));BPromise['each'](_0x56003d,handleTZQuery)[_0x7995('0x52')](function(_0x38064a){updateTzCampaigns(_0x3b45e8['ListId'])[_0x7995('0x52')](function(_0x20683e){updateTzVoiceQueues(_0x3b45e8['ListId'])[_0x7995('0x52')](function(_0x50efab){var _0x1b4b34=util['format'](_0x7995('0x8a'),_0x5d9d33,_0x393cb7,_0x18cff7,_0x3b45e8['ListId'],_0x3b45e8[_0x7995('0x8b')]||null,NOW,NOW);if(_[_0x7995('0x59')](_0x5b1cba['scheduledat'])){_0x1b4b34+=_0x7995('0x8c');}_0x551b5e['push'](_0x1b4b34);if(_0x3b45e8['duplicates']&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]){_0x551b5e[_0x7995('0x45')](insertCmContact(_0x3b45e8[_0x7995('0x38')],_0x393cb7,_0x3b45e8['duplicates'],_0x5b1cba));}if(hasTZ){_0x551b5e[_0x7995('0x45')](insertTzCmHopper(_0x3b45e8[_0x7995('0x38')],'voice_queues_has_cm_lists','voice_queues',_0x7995('0x8d'),_0x54b955,tmp_voice_queues));_0x551b5e['push'](insertTzCmHopperBlack(_0x3b45e8[_0x7995('0x38')],_0x7995('0x8e'),_0x7995('0x54'),'VoiceQueueId'));_0x551b5e['push'](insertTzCmHopper(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_lists',_0x7995('0x4d'),_0x7995('0x8f'),_0x54b955,tmp_campaigns));_0x551b5e[_0x7995('0x45')](insertTzCmHopperBlack(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_blacklists','campaigns','CampaignId'));}else{_0x551b5e[_0x7995('0x45')](insertCmHopper(_0x3b45e8[_0x7995('0x38')],_0x7995('0x55'),_0x7995('0x54'),_0x7995('0x8d'),_0x54b955));_0x551b5e[_0x7995('0x45')](insertCmHopperBlack(_0x3b45e8['ListId'],'voice_queues_has_cm_blacklists',_0x7995('0x54'),'VoiceQueueId'));_0x551b5e['push'](insertCmHopper(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_lists','campaigns',_0x7995('0x8f'),_0x54b955));_0x551b5e[_0x7995('0x45')](insertCmHopperBlack(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_blacklists',_0x7995('0x4d'),_0x7995('0x8f')));}_0x551b5e[_0x7995('0x45')](_0x7995('0x90')+tmp_campaigns+';');_0x551b5e[_0x7995('0x45')](_0x7995('0x90')+tmp_voice_queues+';');BPromise[_0x7995('0x91')](_0x551b5e,handleQuery)[_0x7995('0x52')](function(_0x19d746){stats['finish']=!![];stats[_0x7995('0x92')]=_0x3b45e8[_0x7995('0x83')]&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]?results[0x2][_0x7995('0x92')]:results[0x0]['affectedRows'];socket[_0x7995('0x7d')](_0x7995('0x7e')+_0xea9aba,stats);fs[_0x7995('0x93')](_0x4dbab8);fs['unlink'](_0x5d9d33);process['exit'](0x0);})['catch'](function(_0xb28dea){logger[_0x7995('0x41')](_0xb28dea[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);});})[_0x7995('0x4a')](function(_0x3ad47c){logger['error'](_0x3ad47c[_0x7995('0x42')]);process['exit'](0x1);});});});}catch(_0x40a151){logger[_0x7995('0x41')](_0x7995('0x94'),_0x40a151[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);}},'error':function(_0x24ac44,_0x4f929b,_0x24a0e6,_0x245821){throw new Error(_0x245821);}});}function validate(){if(process[_0x7995('0x95')]&&process[_0x7995('0x95')]['length']<0x4){throw new Error(_0x7995('0x96'));}var _0x57f875=path[_0x7995('0x13')](config[_0x7995('0x97')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0x7995('0x98')](_0x57f875)){throw new Error(_0x7995('0x99'));}var _0x41e200={};try{_0x41e200=JSON[_0x7995('0x67')](process[_0x7995('0x95')][0x3]);if(!_0x41e200[_0x7995('0x60')]){throw new Error(_0x7995('0x9a'));}if(!_0x41e200[_0x7995('0x60')][_0x7995('0x30')]){throw new Error(_0x7995('0x9b'));}if(!_0x41e200[_0x7995('0x60')][_0x7995('0x79')]){throw new Error('firstName\x20is\x20mandatory');}var _0x5380e6=0x0;if(_0x41e200[_0x7995('0x60')][_0x7995('0x70')]){_0x5380e6=0x1;}if(!_0x41e200[_0x7995('0x38')]){throw new Error(_0x7995('0x9c'));}}catch(_0x100bde){throw new Error('body\x20id\x20mandatory');}var _0xe8c08e=[];try{_0xe8c08e=_[_0x7995('0x9d')](JSON['parse'](process[_0x7995('0x95')][0x4]),'id');}catch(_0x53d693){logger[_0x7995('0x3f')](_0x7995('0x9e'));}main(_0x57f875,_0x41e200,_0xe8c08e,_0x5380e6);}validate();process['on'](_0x7995('0x9f'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x9957=['socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','updatedAt','priority','recallme','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.ListId','cm_hopper_black','phone','fields','ListId\x20=\x20?','\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.updatedAt','scheduledat','ListId','createdAt','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','length','all','then','voice_queues.dialTimezone','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','isNil','utcOffset','set','offset','main','stringify','start','binding','server/files/tmp','.csv','includes','header',',utcOffset','writeFileSync','parse','createReadStream','data','rows','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','timezones','firstName','\x20not\x20specified','SystemRow','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);','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','CompanyId',',\x20scheduledAt\x20=\x20NOW()','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','DROP\x20TABLE\x20','each','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults'];(function(_0x159acf,_0x1568ef){var _0x5140b3=function(_0x318395){while(--_0x318395){_0x159acf['push'](_0x159acf['shift']());}};_0x5140b3(++_0x1568ef);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var fs=require('fs');var path=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var Papa=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var BPromise=require('bluebird');var moment=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var Redis=require(_0x7995('0x6'));var db=require(_0x7995('0x7'))['db'];var config=require('../../../config/environment');var shared=require(_0x7995('0x8'));var logger=require(_0x7995('0x9'))(_0x7995('0xa'));config[_0x7995('0xb')]=_[_0x7995('0xc')](config[_0x7995('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7995('0xd'))(new Redis(config[_0x7995('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x7995('0xe'));function isEmail(_0x3116fb){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))*$/[_0x7995('0xf')](_0x3116fb);}function selectNotIn(_0x35b5fe,_0x3c1d19,_0x1e400a,_0x341672,_0x524f7b){return squel[_0x7995('0x10')]()[_0x7995('0x11')]('phone')[_0x7995('0x12')](_0x341672)[_0x7995('0x13')](_0x3c1d19,null,_0x3c1d19+_0x7995('0x14')+_0x341672+'.'+_0x1e400a)[_0x7995('0x15')](_0x341672+'.'+_0x1e400a+_0x7995('0x16')+_0x35b5fe+'.'+_0x1e400a)[_0x7995('0x15')](_0x3c1d19+_0x7995('0x17')+_0x524f7b['join']()+')');}function insertCmHopper(_0x58f5ad,_0x2b4e94,_0x2233dd,_0x24b5bb,_0x321ae8){var _0x3f1d3e=[_0x7995('0x18'),_0x7995('0x19'),_0x7995('0x1a'),'cm_contacts.ListId',_0x2b4e94+'.'+_0x24b5bb,_0x7995('0x1b'),'cm_contacts.updatedAt',_0x7995('0x1c'),_0x7995('0x1d'),'\x22'+_0x321ae8+'\x22'];return squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x20'))[_0x7995('0x21')](['phone','scheduledat',_0x7995('0x22'),'ListId',_0x24b5bb,'createdAt',_0x7995('0x23'),_0x7995('0x24'),'UserId',_0x7995('0x25')],squel['select']()['fields'](_0x3f1d3e)[_0x7995('0x12')](_0x2b4e94)[_0x7995('0x13')](_0x7995('0x26'),null,_0x7995('0x27')+_0x2b4e94+_0x7995('0x28'))[_0x7995('0x13')](_0x2233dd,null,_0x2233dd+'.id\x20=\x20'+_0x2b4e94+'.'+_0x24b5bb)[_0x7995('0x15')](_0x2b4e94+_0x7995('0x29'),_0x58f5ad)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')](_0x7995('0x2b'),selectNotIn(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x7995('0x20'),[_0x7995('0x2c'),'\x22onlyIfOpen\x22']))[_0x7995('0x15')](_0x7995('0x2b'),selectNotIn(_0x2b4e94,_0x2233dd,_0x24b5bb,_0x7995('0x20'),[_0x7995('0x2c')])))[_0x7995('0x2d')]();}function insertCmHopperBlack(_0x2a307e,_0x56691a,_0x47625f,_0x5911c3){var _0x229742=[_0x7995('0x18'),_0x7995('0x1a'),_0x7995('0x2e'),_0x56691a+'.'+_0x5911c3,_0x7995('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7995('0x1e')]()['into'](_0x7995('0x2f'))[_0x7995('0x21')]([_0x7995('0x30'),'ContactId','ListId',_0x5911c3,'createdAt',_0x7995('0x23')],squel[_0x7995('0x10')]()[_0x7995('0x31')](_0x229742)[_0x7995('0x12')](_0x56691a)[_0x7995('0x13')](_0x7995('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x56691a+'.CmListId')[_0x7995('0x13')](_0x47625f,null,_0x47625f+'.id\x20=\x20'+_0x56691a+'.'+_0x5911c3)[_0x7995('0x15')](_0x56691a+_0x7995('0x29'),_0x2a307e)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7995('0x10')]()[_0x7995('0x11')]('phone')['from']('cm_hopper_black')[_0x7995('0x15')](_0x7995('0x32'),_0x2a307e)['where'](_0x5911c3+_0x7995('0x33'),_0x56691a+'.'+_0x5911c3)))['toString']();}function insertTzCmHopper(_0x37917b,_0x1cb058,_0x177cb4,_0x5014d2,_0x52d76d,_0x36d057){var _0x5e67fe=['cm_contacts.phone',_0x7995('0x34')+_0x36d057+_0x7995('0x35'),'cm_contacts.id',_0x7995('0x2e'),_0x1cb058+'.'+_0x5014d2,_0x7995('0x1b'),_0x7995('0x36'),_0x7995('0x1c'),_0x7995('0x1d'),'\x22'+_0x52d76d+'\x22'];var _0x53002a=squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x20'))[_0x7995('0x21')](['phone',_0x7995('0x37'),_0x7995('0x22'),_0x7995('0x38'),_0x5014d2,_0x7995('0x39'),_0x7995('0x23'),_0x7995('0x24'),'UserId',_0x7995('0x25')],squel[_0x7995('0x10')]()[_0x7995('0x31')](_0x5e67fe)[_0x7995('0x12')](_0x1cb058)[_0x7995('0x13')](_0x7995('0x26'),null,_0x7995('0x27')+_0x1cb058+_0x7995('0x28'))[_0x7995('0x13')](_0x177cb4,null,_0x177cb4+_0x7995('0x14')+_0x1cb058+'.'+_0x5014d2)[_0x7995('0x13')](_0x36d057,null,_0x36d057+_0x7995('0x14')+_0x1cb058+'.'+_0x5014d2)[_0x7995('0x15')](_0x1cb058+'.CmListId\x20=\x20?',_0x37917b)['where'](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1cb058,_0x177cb4,_0x5014d2,'cm_hopper',[_0x7995('0x2c'),'\x22onlyIfOpen\x22']))['where'](_0x7995('0x2b'),selectNotIn(_0x1cb058,_0x177cb4,_0x5014d2,_0x7995('0x20'),[_0x7995('0x2c')])))['toString']();return _0x53002a;}function insertTzCmHopperBlack(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881){var _0x493066=[_0x7995('0x18'),_0x7995('0x1a'),_0x7995('0x2e'),_0x5e85b9+'.'+_0x5a8881,_0x7995('0x1b'),'cm_contacts.updatedAt'];return squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x7995('0x2f'))[_0x7995('0x21')](['phone','ContactId',_0x7995('0x38'),_0x5a8881,'createdAt',_0x7995('0x23')],squel['select']()[_0x7995('0x31')](_0x493066)['from'](_0x5e85b9)[_0x7995('0x13')](_0x7995('0x26'),null,'cm_contacts.ListId\x20=\x20'+_0x5e85b9+_0x7995('0x28'))[_0x7995('0x13')](_0x3993b5,null,_0x3993b5+_0x7995('0x14')+_0x5e85b9+'.'+_0x5a8881)[_0x7995('0x15')](_0x5e85b9+'.CmListId\x20=\x20?',_0x46ac4f)[_0x7995('0x15')](_0x7995('0x2a'),NOW)[_0x7995('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x7995('0x10')]()[_0x7995('0x11')](_0x7995('0x30'))[_0x7995('0x12')](_0x7995('0x2f'))['where'](_0x7995('0x32'),_0x46ac4f)[_0x7995('0x15')](_0x5a8881+'\x20=\x20?',_0x5e85b9+'.'+_0x5a8881)))[_0x7995('0x2d')]();}function insertCmContact(_0x5843ba,_0x1d87f9,_0x187735,_0x1afab4){var _0x30e220=_[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x1afab4),[_0x7995('0x38'),'CompanyId',_0x7995('0x39'),_0x7995('0x23')]);return squel[_0x7995('0x1e')]()['into'](_0x7995('0x26'))[_0x7995('0x21')](_0x30e220,squel[_0x7995('0x10')]()['fields'](_0x30e220)['from'](_0x1d87f9)['where']('('+_0x187735[_0x7995('0x13')](',')+_0x7995('0x3c'),squel['select']()[_0x7995('0x31')](_0x187735)[_0x7995('0x12')](_0x7995('0x26'))[_0x7995('0x15')](_0x7995('0x32'),_0x5843ba)['where'](_0x7995('0x3d')))['where'](_0x7995('0x3e'),squel[_0x7995('0x10')]()[_0x7995('0x11')]('MIN(id)','min_id')['from'](_0x1d87f9)['group'](_0x187735[_0x7995('0x13')](','))))[_0x7995('0x2d')]();}function handleStop(){logger[_0x7995('0x3f')](_0x7995('0x40'));stopped=!![];}function handleUncaughtException(_0x1d957e){logger[_0x7995('0x41')](_0x1d957e[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);}function handleError(_0x328671,_0x17ecd3){stats[_0x7995('0x44')][_0x7995('0x45')]({'name':_0x17ecd3[_0x7995('0x46')],'message':_0x17ecd3[_0x7995('0x42')],'row':_0x328671});}function handleQuery(_0x1ea1dc){logger[_0x7995('0x3f')](_0x1ea1dc);return db[_0x7995('0x47')][_0x7995('0x48')](_0x1ea1dc)[_0x7995('0x49')](function(_0x50b7c2){results[_0x7995('0x45')](_0x50b7c2);})[_0x7995('0x4a')](function(_0x3b8a54){logger[_0x7995('0x41')](_0x3b8a54['message']);});}function updateTzCampaigns(_0x53125a){return new Promise(function(_0x402fa0,_0x197b52){var _0x5b9467=squel[_0x7995('0x10')]()['fields']([_0x7995('0x4b'),_0x7995('0x4c')])[_0x7995('0x12')](_0x7995('0x4d'))['join']('campaigns_has_cm_lists',null,_0x7995('0x4e'))[_0x7995('0x15')](_0x7995('0x4f')+_0x53125a);db[_0x7995('0x47')][_0x7995('0x48')](_0x5b9467[_0x7995('0x2d')]())[_0x7995('0x49')](function(_0x1e2206){var _0x984c23=[];for(var _0x50caf5=0x0;_0x50caf5<_0x1e2206[_0x7995('0x50')];_0x50caf5++){_0x984c23[_0x7995('0x45')](getTimezoneData(_0x1e2206[_0x50caf5],tmp_campaigns));}BPromise[_0x7995('0x51')](_0x984c23)[_0x7995('0x52')](function(){_0x402fa0({'val':0x1});});})['catch'](function(_0x51bf6a){logger[_0x7995('0x41')](_0x51bf6a[_0x7995('0x42')]);_0x402fa0({'val':0x0});});});}function updateTzVoiceQueues(_0x47d5d7){return new Promise(function(_0x971a23,_0x375fc9){var _0x2e3421=squel[_0x7995('0x10')]()[_0x7995('0x31')](['voice_queues.id',_0x7995('0x53')])['from'](_0x7995('0x54'))[_0x7995('0x13')](_0x7995('0x55'),null,_0x7995('0x56'))[_0x7995('0x15')](_0x7995('0x57')+_0x47d5d7);db[_0x7995('0x47')][_0x7995('0x48')](_0x2e3421[_0x7995('0x2d')]())[_0x7995('0x49')](function(_0x2618c4){var _0x234d8d=[];for(var _0x56eb85=0x0;_0x56eb85<_0x2618c4[_0x7995('0x50')];_0x56eb85++){_0x234d8d[_0x7995('0x45')](getTimezoneData(_0x2618c4[_0x56eb85],tmp_voice_queues));}BPromise[_0x7995('0x51')](_0x234d8d)[_0x7995('0x52')](function(){_0x971a23({'val':0x1});});})[_0x7995('0x4a')](function(_0x54a2e0){logger['error'](_0x54a2e0[_0x7995('0x42')]);_0x971a23({'val':0x0});});});}function getTimezoneData(_0x87e38d,_0x221542){return new Promise(function(_0xae6166,_0x5aa2ec){var _0x22d317=shared['timezones'];var _0x5df621=_0x22d317[_0x87e38d[_0x7995('0x58')]];if(_[_0x7995('0x59')](_0x5df621)){_0xae6166({'ret':0x1});}else{var _0x3f0a71=_0x5df621[_0x7995('0x5a')];var _0x290eae=squel[_0x7995('0x1e')]()[_0x7995('0x1f')](_0x221542)[_0x7995('0x5b')]('id',_0x87e38d['id'])[_0x7995('0x5b')](_0x7995('0x5c'),_0x3f0a71)['set'](_0x7995('0x58'),_0x87e38d[_0x7995('0x58')])[_0x7995('0x2d')]();return db['sequelize'][_0x7995('0x48')](_0x290eae)[_0x7995('0x49')](function(_0x705f0){_0xae6166({'ret':0x1});})[_0x7995('0x4a')](function(_0x3b0d30){logger[_0x7995('0x41')](_0x3b0d30[_0x7995('0x42')]);_0x5aa2ec({'ret':0x1});});}});}function handleTZQuery(_0x3adfd2){logger[_0x7995('0x3f')](_0x3adfd2);return db[_0x7995('0x47')][_0x7995('0x48')](_0x3adfd2)['spread'](function(_0x5e8b4c){})[_0x7995('0x4a')](function(_0xfe1105){logger[_0x7995('0x41')](_0xfe1105[_0x7995('0x42')]);});}function main(_0x4dbab8,_0x3b45e8,_0x2c9eb6,_0x54b955){logger['info'](_0x7995('0x5d'),_0x4dbab8,JSON[_0x7995('0x5e')](_0x3b45e8));process['send'](_0x7995('0x5f'));var _0x5b1cba=_0x3b45e8[_0x7995('0x60')];var _0xea9aba=_0x3b45e8['socket_timestamp'];var _0x5d9d33=path[_0x7995('0x13')](config['root'],_0x7995('0x61'),_0xea9aba+_0x7995('0x62'));hasTZ=_[_0x7995('0x3b')](_0x5b1cba)[_0x7995('0x63')](_0x7995('0x58'));var _0x18cff7=_[_0x7995('0x3b')](_0x5b1cba)[_0x7995('0x13')]();logger[_0x7995('0x3f')](_0x7995('0x64'),_0x18cff7);if(hasTZ)_0x18cff7+=_0x7995('0x65');fs[_0x7995('0x66')](_0x5d9d33,_0x18cff7+'\x0a');Papa[_0x7995('0x67')](fs[_0x7995('0x68')](_0x4dbab8),{'header':!![],'skipEmptyLines':!![],'step':function(_0x36e3a7,_0x3773de){try{for(var _0x6ad274=0x0,_0x251490=[];_0x6ad274<_0x36e3a7[_0x7995('0x69')][_0x7995('0x50')];_0x6ad274++){stats[_0x7995('0x6a')]+=0x1;if(_0x36e3a7[_0x7995('0x44')][_0x6ad274]){handleError(_0x36e3a7[_0x7995('0x69')][_0x6ad274],_0x36e3a7[_0x7995('0x44')][_0x6ad274]);}else{var _0x260ef1=[];for(var _0x33479a in _0x5b1cba){if(_0x5b1cba[_0x7995('0x6b')](_0x33479a)){if(_0x36e3a7[_0x7995('0x69')][_0x6ad274][_0x5b1cba[_0x33479a]]){var _0x59efff=_[_0x7995('0x6c')](_0x36e3a7[_0x7995('0x69')][_0x6ad274][_0x5b1cba[_0x33479a]]['replace'](/"/g,'\x27'));switch(_0x33479a){case'scheduledat':var _0x15e8d1=moment(_0x59efff,_0x7995('0xe'),!![]);if(_0x15e8d1[_0x7995('0x6d')]()){_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');}else{_0x260ef1[_0x7995('0x45')](_0x7995('0x6e'));}break;case'priority':var _0x2f8a2d=parseInt(_0x59efff);_0x59efff=_[_0x7995('0x6f')](_0x2f8a2d)||_0x2f8a2d<0x0||_0x2f8a2d>0x4?_0x54b955?0x3:0x2:_0x2f8a2d;_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');break;case _0x7995('0x70'):var _0x7d9c6e=parseInt(_0x59efff);if(_[_0x7995('0x71')](_0x7d9c6e)&&_[_0x7995('0x63')](_0x2c9eb6,_0x7d9c6e)){_0x251490[_0x7995('0x45')]('\x22'+_0x7d9c6e+'\x22');}else{_0x260ef1['push'](_0x7995('0x72'));}break;case _0x7995('0x73'):if(isEmail(_0x59efff)){_0x251490['push']('\x22'+_0x59efff+'\x22');}else{_0x260ef1['push'](_0x7995('0x74'));}break;case _0x7995('0x75'):var _0x18e1a2=moment(_0x59efff,_0x7995('0x76'),!![]);if(_0x18e1a2[_0x7995('0x6d')]()){_0x251490['push']('\x22'+_0x59efff+'\x22');}else{_0x260ef1[_0x7995('0x45')](_0x7995('0x77'));}break;case'dialTimezone':var _0x209977=shared[_0x7995('0x78')];var _0x489bac=_0x209977[_0x59efff];if(!_[_0x7995('0x59')](_0x489bac)){var _0x4a5bc5=_0x489bac[_0x7995('0x5a')];_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');_0x251490[_0x7995('0x45')]('\x22'+_0x4a5bc5+'\x22');}break;default:_0x251490[_0x7995('0x45')]('\x22'+_0x59efff+'\x22');}}else{switch(_0x33479a){case _0x7995('0x79'):case'phone':_0x260ef1[_0x7995('0x45')](_0x33479a+_0x7995('0x7a'));break;default:_0x251490[_0x7995('0x45')]('\x22\x22');}}}}if(_0x260ef1['length']){handleError(_0x36e3a7[_0x7995('0x69')][_0x6ad274],{'code':_0x7995('0x7b'),'message':_0x260ef1[_0x7995('0x13')]()});}else{fs[_0x7995('0x7c')](_0x5d9d33,_0x251490['join']()+'\x0a');}_0x251490=[];}if(!(stats[_0x7995('0x6a')]%0xc8)){socket[_0x7995('0x7d')](_0x7995('0x7e')+_0xea9aba,stats);stats['errors']=[];}}if(stopped){logger['info'](_0x7995('0x7f'));_0x3773de[_0x7995('0x80')]();}}catch(_0x4800a8){handleError(_0x36e3a7['data'][_0x6ad274],{'code':_0x7995('0x81'),'message':_0x4800a8[_0x7995('0x42')]});logger[_0x7995('0x41')](_0x7995('0x82'),_0x4800a8[_0x7995('0x42')]);}},'complete':function(){try{var _0x551b5e=[];var _0x56003d=[];var _0x393cb7='cm_contacts';if(_0x3b45e8['duplicates']&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]){_0x393cb7=_0x7995('0x84')+_0xea9aba;_0x551b5e['push'](_0x7995('0x85')+_0x393cb7+_0x7995('0x86'));}tmp_campaigns=_0x7995('0x87')+_0xea9aba;tmp_voice_queues=_0x7995('0x88')+_0xea9aba;_0x56003d[_0x7995('0x45')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x7995('0x89'));_0x56003d[_0x7995('0x45')](_0x7995('0x85')+tmp_voice_queues+_0x7995('0x89'));BPromise['each'](_0x56003d,handleTZQuery)[_0x7995('0x52')](function(_0x38064a){updateTzCampaigns(_0x3b45e8['ListId'])[_0x7995('0x52')](function(_0x20683e){updateTzVoiceQueues(_0x3b45e8['ListId'])[_0x7995('0x52')](function(_0x50efab){var _0x1b4b34=util['format'](_0x7995('0x8a'),_0x5d9d33,_0x393cb7,_0x18cff7,_0x3b45e8['ListId'],_0x3b45e8[_0x7995('0x8b')]||null,NOW,NOW);if(_[_0x7995('0x59')](_0x5b1cba['scheduledat'])){_0x1b4b34+=_0x7995('0x8c');}_0x551b5e['push'](_0x1b4b34);if(_0x3b45e8['duplicates']&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]){_0x551b5e[_0x7995('0x45')](insertCmContact(_0x3b45e8[_0x7995('0x38')],_0x393cb7,_0x3b45e8['duplicates'],_0x5b1cba));}if(hasTZ){_0x551b5e[_0x7995('0x45')](insertTzCmHopper(_0x3b45e8[_0x7995('0x38')],'voice_queues_has_cm_lists','voice_queues',_0x7995('0x8d'),_0x54b955,tmp_voice_queues));_0x551b5e['push'](insertTzCmHopperBlack(_0x3b45e8[_0x7995('0x38')],_0x7995('0x8e'),_0x7995('0x54'),'VoiceQueueId'));_0x551b5e['push'](insertTzCmHopper(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_lists',_0x7995('0x4d'),_0x7995('0x8f'),_0x54b955,tmp_campaigns));_0x551b5e[_0x7995('0x45')](insertTzCmHopperBlack(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_blacklists','campaigns','CampaignId'));}else{_0x551b5e[_0x7995('0x45')](insertCmHopper(_0x3b45e8[_0x7995('0x38')],_0x7995('0x55'),_0x7995('0x54'),_0x7995('0x8d'),_0x54b955));_0x551b5e[_0x7995('0x45')](insertCmHopperBlack(_0x3b45e8['ListId'],'voice_queues_has_cm_blacklists',_0x7995('0x54'),'VoiceQueueId'));_0x551b5e['push'](insertCmHopper(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_lists','campaigns',_0x7995('0x8f'),_0x54b955));_0x551b5e[_0x7995('0x45')](insertCmHopperBlack(_0x3b45e8[_0x7995('0x38')],'campaigns_has_cm_blacklists',_0x7995('0x4d'),_0x7995('0x8f')));}_0x551b5e[_0x7995('0x45')](_0x7995('0x90')+tmp_campaigns+';');_0x551b5e[_0x7995('0x45')](_0x7995('0x90')+tmp_voice_queues+';');BPromise[_0x7995('0x91')](_0x551b5e,handleQuery)[_0x7995('0x52')](function(_0x19d746){stats['finish']=!![];stats[_0x7995('0x92')]=_0x3b45e8[_0x7995('0x83')]&&_0x3b45e8[_0x7995('0x83')][_0x7995('0x50')]?results[0x2][_0x7995('0x92')]:results[0x0]['affectedRows'];socket[_0x7995('0x7d')](_0x7995('0x7e')+_0xea9aba,stats);fs[_0x7995('0x93')](_0x4dbab8);fs['unlink'](_0x5d9d33);process['exit'](0x0);})['catch'](function(_0xb28dea){logger[_0x7995('0x41')](_0xb28dea[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);});})[_0x7995('0x4a')](function(_0x3ad47c){logger['error'](_0x3ad47c[_0x7995('0x42')]);process['exit'](0x1);});});});}catch(_0x40a151){logger[_0x7995('0x41')](_0x7995('0x94'),_0x40a151[_0x7995('0x42')]);process[_0x7995('0x43')](0x1);}},'error':function(_0x24ac44,_0x4f929b,_0x24a0e6,_0x245821){throw new Error(_0x245821);}});}function validate(){if(process[_0x7995('0x95')]&&process[_0x7995('0x95')]['length']<0x4){throw new Error(_0x7995('0x96'));}var _0x57f875=path[_0x7995('0x13')](config[_0x7995('0x97')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0x7995('0x98')](_0x57f875)){throw new Error(_0x7995('0x99'));}var _0x41e200={};try{_0x41e200=JSON[_0x7995('0x67')](process[_0x7995('0x95')][0x3]);if(!_0x41e200[_0x7995('0x60')]){throw new Error(_0x7995('0x9a'));}if(!_0x41e200[_0x7995('0x60')][_0x7995('0x30')]){throw new Error(_0x7995('0x9b'));}if(!_0x41e200[_0x7995('0x60')][_0x7995('0x79')]){throw new Error('firstName\x20is\x20mandatory');}var _0x5380e6=0x0;if(_0x41e200[_0x7995('0x60')][_0x7995('0x70')]){_0x5380e6=0x1;}if(!_0x41e200[_0x7995('0x38')]){throw new Error(_0x7995('0x9c'));}}catch(_0x100bde){throw new Error('body\x20id\x20mandatory');}var _0xe8c08e=[];try{_0xe8c08e=_[_0x7995('0x9d')](JSON['parse'](process[_0x7995('0x95')][0x4]),'id');}catch(_0x53d693){logger[_0x7995('0x3f')](_0x7995('0x9e'));}main(_0x57f875,_0x41e200,_0xe8c08e,_0x5380e6);}validate();process['on'](_0x7995('0x9f'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/import/cm/csvUpdates.js b/server/components/import/cm/csvUpdates.js index 1d559e2..58ec765 100644 --- a/server/components/import/cm/csvUpdates.js +++ b/server/components/import/cm/csvUpdates.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbb16=['cm_hopper','\x22always\x22','toString','cm_contacts.phone','cm_contacts.ListId','ListId','updatedAt','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','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','CompanyId',')\x20NOT\x20IN\x20?','min_id','group','info','Received\x20SIGINT','exit','errors','code','spread','main','stringify','send','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','header','writeFileSync','createReadStream','data','find','isNil','hasOwnProperty','isValid','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','trim','replace','rows','emit','abort','SystemError','step','CREATE\x20TABLE\x20','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','each','contact','contactId','contactTypeId','orderBy','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','binding','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/logger','import','redis','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','field','phone','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','length','AdditionalPhones','push','then','catch','error','message','split','all','filter','CmContactHasItem','findOne','update','updated','create','CmContact','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','fromQuery','scheduledat','ContactId','createdAt','priority','UserId','recallme','select','fields','from','cm_contacts','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)'];(function(_0x190c71,_0x7c7e7b){var _0x5bb8b6=function(_0x5a4b8b){while(--_0x5a4b8b){_0x190c71['push'](_0x190c71['shift']());}};_0x5bb8b6(++_0x7c7e7b);}(_0xbb16,0xf3));var _0x6bb1=function(_0x5dfd28,_0x45f9b7){_0x5dfd28=_0x5dfd28-0x0;var _0x2372e5=_0xbb16[_0x5dfd28];return _0x2372e5;};'use strict';var fs=require('fs');var path=require(_0x6bb1('0x0'));var _=require('lodash');var Papa=require(_0x6bb1('0x1'));var util=require(_0x6bb1('0x2'));var BPromise=require(_0x6bb1('0x3'));var moment=require(_0x6bb1('0x4'));var squel=require(_0x6bb1('0x5'));var Redis=require('ioredis');var db=require(_0x6bb1('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x6bb1('0x7'))(_0x6bb1('0x8'));config[_0x6bb1('0x9')]=_['defaults'](config[_0x6bb1('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x6bb1('0xa'))(new Redis(config[_0x6bb1('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x6bb1('0xb')](_0x6bb1('0xc'));var tempTableName='cm_contacts_temp_'+moment()[_0x6bb1('0xb')](_0x6bb1('0xd'));var contactItemTypes=[];var hasAdditionalPhones=![];function isEmail(_0x22dabd){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'](_0x22dabd);}function selectNotIn(_0x334a8f,_0x486555,_0x4f337d,_0xc6f6eb,_0x3c1bab){return squel['select']()[_0x6bb1('0xe')](_0x6bb1('0xf'))['from'](_0xc6f6eb)[_0x6bb1('0x10')](_0x486555,null,_0x486555+_0x6bb1('0x11')+_0xc6f6eb+'.'+_0x4f337d)[_0x6bb1('0x12')](_0xc6f6eb+'.'+_0x4f337d+_0x6bb1('0x13')+_0x334a8f+'.'+_0x4f337d)[_0x6bb1('0x12')](_0x486555+_0x6bb1('0x14')+_0x3c1bab[_0x6bb1('0x10')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x53f304,_0x5d651b){promisesAdditionalPhones=[];promisesContact=[];return db[_0x6bb1('0x15')][_0x6bb1('0x16')]('select\x20*\x20from\x20'+tempTableName)['spread'](function(_0x2ccd78){if(_0x2ccd78!==null){var _0x2280b9=[];for(var _0x1c5198=0x0;_0x1c5198<_0x2ccd78[_0x6bb1('0x17')];_0x1c5198++){var _0xb0623b=_0x2ccd78[_0x1c5198];if(!_['isNil'](_0xb0623b[_0x6bb1('0xf')])){if(!_['isNil'](_0xb0623b[_0x6bb1('0x18')]))_0x2280b9['push'](insertAdditionalPhones(_0xb0623b));promisesContact[_0x6bb1('0x19')]({'contact':_0xb0623b});}}}Promise['all'](_0x2280b9)[_0x6bb1('0x1a')](function(){_0x53f304({'val':0x1});});})[_0x6bb1('0x1b')](function(_0x2232c6){logger[_0x6bb1('0x1c')](_0x2232c6[_0x6bb1('0x1d')]);});});}function insertAdditionalPhones(_0x5ce6d2){return new Promise(function(_0x59bb26,_0x37fb28){var _0x5e6efb=_0x5ce6d2[_0x6bb1('0x18')];if(_['isNil'](_0x5e6efb))_0x37fb28({'val':0x0});else{var _0x4f4f96=_0x5e6efb[_0x6bb1('0x1e')](';');var _0x35ed36=[];orderBy=0x0;for(var _0x394909=0x0;_0x394909<_0x4f4f96[_0x6bb1('0x17')];_0x394909++){_0x35ed36['push'](splitAdditionalPhone(_0x5ce6d2['id'],_0x4f4f96[_0x394909]));}Promise[_0x6bb1('0x1f')](_0x35ed36)['then'](function(){_0x59bb26({'val':_0x4f4f96[_0x6bb1('0x17')]});});}});}function splitAdditionalPhone(_0x301958,_0x2b2645){return new Promise(function(_0x33fe17,_0x5aabfb){var _0x47e160=_0x2b2645[_0x6bb1('0x1e')](':');var _0x2fd47e=_0x47e160[0x0];var _0x14eaaf=_0x47e160[0x1];if(_0x14eaaf!==''){var _0x1e83d5=_0x14eaaf[_0x6bb1('0x1e')]('|');var _0x136814=[];for(var _0x1cdaaf=0x0;_0x1cdaaf<_0x1e83d5[_0x6bb1('0x17')];_0x1cdaaf++){if(_0x1e83d5[_0x1cdaaf]!==''){var _0xf903f2=_[_0x6bb1('0x20')](promisesAdditionalPhones,{'contactId':_0x301958,'phone':_0x1e83d5[_0x1cdaaf]});if(_0xf903f2[_0x6bb1('0x17')]==0x0){orderBy++;promisesAdditionalPhones[_0x6bb1('0x19')]({'contactId':_0x301958,'contactTypeId':_0x2fd47e,'phone':_0x1e83d5[_0x1cdaaf],'orderBy':orderBy});}}}_0x33fe17({'ok':0x1});}else _0x33fe17({'res':0x0});});}function createAdditionalPhone(_0x5798a0,_0x4ebe18,_0x2e7ef3,_0x58cf7b){return new Promise(function(_0x513d5b,_0x4eb3dc){return db[_0x6bb1('0x21')][_0x6bb1('0x22')]({'where':{'CmContactId':_0x5798a0,'item':_0x2e7ef3}})[_0x6bb1('0x1a')](function(_0x59f541){if(_0x59f541){return db[_0x6bb1('0x21')][_0x6bb1('0x23')]({'ItemTypeId':_0x4ebe18,'OrderBy':_0x58cf7b},{'where':{'CmContactId':_0x5798a0,'item':_0x2e7ef3}})[_0x6bb1('0x1a')](function(_0x54f0a1){_0x513d5b({'res':_0x6bb1('0x24')});});}else{return db[_0x6bb1('0x21')][_0x6bb1('0x25')]({'CmContactId':_0x5798a0,'item':_0x2e7ef3,'ItemTypeId':_0x4ebe18,'OrderBy':_0x58cf7b,'ItemClass':'PHONE'})[_0x6bb1('0x1a')](function(_0x3c553c){_0x513d5b({'res':'inserted'});});}});});}function updateContact(_0x4c089c){return new Promise(function(_0x2dc00a,_0x5cb598){var _0x5aaa7b=_0x4c089c['id'];delete _0x4c089c['id'];return db[_0x6bb1('0x26')][_0x6bb1('0x23')](_0x4c089c,{'where':{'id':_0x5aaa7b}})[_0x6bb1('0x1a')](function(_0x33a9bf){updatedRows+=0x1;return db[_0x6bb1('0x27')]['update']({'phone':_0x4c089c[_0x6bb1('0xf')]},{'where':{'ContactId':_0x5aaa7b}})[_0x6bb1('0x1a')](function(_0x1adae2){_0x2dc00a({'ret':'OK'});});});});}function insertCmHopper(_0x2d04c7,_0xe02aa8,_0x4ed1db,_0x4ee887,_0x3fb1e6){var _0x511474=['cm_contacts.phone',_0x6bb1('0x28'),_0x6bb1('0x29'),'cm_contacts.ListId',_0xe02aa8+'.'+_0x4ee887,_0x6bb1('0x2a'),_0x6bb1('0x2b'),_0x6bb1('0x2c'),'cm_contacts.UserId','\x22'+_0x3fb1e6+'\x22'];return squel[_0x6bb1('0x2d')]()[_0x6bb1('0x2e')]('cm_hopper')[_0x6bb1('0x2f')]([_0x6bb1('0xf'),_0x6bb1('0x30'),_0x6bb1('0x31'),'ListId',_0x4ee887,_0x6bb1('0x32'),'updatedAt',_0x6bb1('0x33'),_0x6bb1('0x34'),_0x6bb1('0x35')],squel[_0x6bb1('0x36')]()[_0x6bb1('0x37')](_0x511474)[_0x6bb1('0x38')](_0xe02aa8)[_0x6bb1('0x10')](_0x6bb1('0x39'),null,'cm_contacts.ListId\x20=\x20'+_0xe02aa8+_0x6bb1('0x3a'))[_0x6bb1('0x10')](_0x4ed1db,null,_0x4ed1db+'.id\x20=\x20'+_0xe02aa8+'.'+_0x4ee887)[_0x6bb1('0x12')](_0xe02aa8+'.CmListId\x20=\x20?',_0x2d04c7)['where'](_0x6bb1('0x3b'),NOW)[_0x6bb1('0x12')](_0x6bb1('0x3c'),selectNotIn(_0xe02aa8,_0x4ed1db,_0x4ee887,_0x6bb1('0x3d'),[_0x6bb1('0x3e'),'\x22onlyIfOpen\x22']))[_0x6bb1('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xe02aa8,_0x4ed1db,_0x4ee887,'cm_hopper',[_0x6bb1('0x3e')])))[_0x6bb1('0x3f')]();}function insertCmHopperBlack(_0x42fb3e,_0x3327ba,_0x1e18a2,_0x41c5b3){var _0x1f5e43=[_0x6bb1('0x40'),_0x6bb1('0x29'),_0x6bb1('0x41'),_0x3327ba+'.'+_0x41c5b3,_0x6bb1('0x2a'),_0x6bb1('0x2b')];return squel[_0x6bb1('0x2d')]()[_0x6bb1('0x2e')]('cm_hopper_black')['fromQuery']([_0x6bb1('0xf'),'ContactId',_0x6bb1('0x42'),_0x41c5b3,_0x6bb1('0x32'),_0x6bb1('0x43')],squel[_0x6bb1('0x36')]()[_0x6bb1('0x37')](_0x1f5e43)[_0x6bb1('0x38')](_0x3327ba)[_0x6bb1('0x10')](_0x6bb1('0x39'),null,'cm_contacts.ListId\x20=\x20'+_0x3327ba+'.CmListId')['join'](_0x1e18a2,null,_0x1e18a2+_0x6bb1('0x11')+_0x3327ba+'.'+_0x41c5b3)[_0x6bb1('0x12')](_0x3327ba+_0x6bb1('0x44'),_0x42fb3e)[_0x6bb1('0x12')](_0x6bb1('0x3b'),NOW)[_0x6bb1('0x12')](_0x6bb1('0x3c'),squel[_0x6bb1('0x36')]()[_0x6bb1('0xe')](_0x6bb1('0xf'))[_0x6bb1('0x38')]('cm_hopper_black')[_0x6bb1('0x12')](_0x6bb1('0x45'),_0x42fb3e)[_0x6bb1('0x12')](_0x41c5b3+_0x6bb1('0x46'),_0x3327ba+'.'+_0x41c5b3)))[_0x6bb1('0x3f')]();}function insertCmHopperAdditionalPhones(_0xbaf703){var _0x8f3615=['cm_hopper.id',_0x6bb1('0x47'),_0x6bb1('0x48'),_0x6bb1('0x49'),_0x6bb1('0x4a')];return squel[_0x6bb1('0x2d')]()[_0x6bb1('0x2e')](_0x6bb1('0x4b'))[_0x6bb1('0x2f')](['CmHopperId',_0x6bb1('0xf'),_0x6bb1('0x4c'),_0x6bb1('0x32'),_0x6bb1('0x43')],squel[_0x6bb1('0x36')]()[_0x6bb1('0x37')](_0x8f3615)[_0x6bb1('0x38')](_0x6bb1('0x3d'))[_0x6bb1('0x10')](_0x6bb1('0x39'),null,_0x6bb1('0x4d'))[_0x6bb1('0x10')](_0x6bb1('0x4e'),null,_0x6bb1('0x4f'))['where'](_0x6bb1('0x50'),_0xbaf703)[_0x6bb1('0x12')](_0x6bb1('0x3b'),NOW))['toString']();}function insertCmContact(_0x16e0dd,_0x1d6940,_0x1e26b0,_0x1d1ec0){var _0x490b19=_[_0x6bb1('0x51')](_['keys'](_0x1d1ec0),[_0x6bb1('0x42'),_0x6bb1('0x52'),_0x6bb1('0x32'),_0x6bb1('0x43')]);return squel['insert']()[_0x6bb1('0x2e')]('cm_contacts')[_0x6bb1('0x2f')](_0x490b19,squel[_0x6bb1('0x36')]()[_0x6bb1('0x37')](_0x490b19)[_0x6bb1('0x38')](_0x1d6940)[_0x6bb1('0x12')]('('+_0x1e26b0[_0x6bb1('0x10')](',')+_0x6bb1('0x53'),squel[_0x6bb1('0x36')]()['fields'](_0x1e26b0)[_0x6bb1('0x38')](_0x6bb1('0x39'))[_0x6bb1('0x12')](_0x6bb1('0x45'),_0x16e0dd))[_0x6bb1('0x12')]('id\x20IN\x20?',squel['select']()[_0x6bb1('0xe')]('MIN(id)',_0x6bb1('0x54'))[_0x6bb1('0x38')](_0x1d6940)[_0x6bb1('0x55')](_0x1e26b0[_0x6bb1('0x10')](','))))['toString']();}function handleStop(){logger[_0x6bb1('0x56')](_0x6bb1('0x57'));stopped=!![];}function handleUncaughtException(_0x49d173){logger[_0x6bb1('0x1c')](_0x49d173[_0x6bb1('0x1d')]);process[_0x6bb1('0x58')](0x1);}function handleError(_0x56bd4a,_0x180662){stats[_0x6bb1('0x59')][_0x6bb1('0x19')]({'name':_0x180662[_0x6bb1('0x5a')],'message':_0x180662[_0x6bb1('0x1d')],'row':_0x56bd4a});}function handleQuery(_0x2c18b9){logger[_0x6bb1('0x56')](_0x2c18b9);return db[_0x6bb1('0x15')]['query'](_0x2c18b9)[_0x6bb1('0x5b')](function(_0x5d6d11){results['push'](_0x5d6d11);})[_0x6bb1('0x1b')](function(_0x4327e0){logger[_0x6bb1('0x1c')](_0x4327e0[_0x6bb1('0x1d')]);});}function main(_0x3b1d42,_0x15a61b,_0x4dfdfb,_0x2f739e){logger[_0x6bb1('0x56')](_0x6bb1('0x5c'),_0x3b1d42,JSON[_0x6bb1('0x5d')](_0x15a61b));process[_0x6bb1('0x5e')]('start');var _0x26a6c7=_0x15a61b['binding'];var _0x107278=_['clone'](_0x26a6c7);var _0x178143=_0x15a61b[_0x6bb1('0x5f')];var _0x3d731f=path['join'](config[_0x6bb1('0x60')],_0x6bb1('0x61'),_0x178143+_0x6bb1('0x62'));logger[_0x6bb1('0x56')](_0x6bb1('0x63'),_0x15a61b);db[_0x6bb1('0x64')][_0x6bb1('0x65')]({'raw':!![],'attributes':['id','name']})[_0x6bb1('0x1a')](function(_0x142469){for(var _0xdebeb2=0x0;_0xdebeb2<_0x142469[_0x6bb1('0x17')];_0xdebeb2++){if(_0x142469[_0xdebeb2]['name']in _0x26a6c7){contactItemTypes['push'](_0x142469[_0xdebeb2]);delete _0x107278[_0x142469[_0xdebeb2][_0x6bb1('0x66')]];hasAdditionalPhones=!![];}else{}}if(hasAdditionalPhones)_0x107278[_0x6bb1('0x18')]='';var _0x38cbdc=_['keys'](_0x107278)[_0x6bb1('0x10')]();logger[_0x6bb1('0x56')](_0x6bb1('0x67'),_0x38cbdc);fs[_0x6bb1('0x68')](_0x3d731f,_0x38cbdc+'\x0a');Papa['parse'](fs[_0x6bb1('0x69')](_0x3b1d42),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2a387b,_0x3992d7){try{for(var _0x3f4487=0x0,_0x4bbdbd=[];_0x3f4487<_0x2a387b[_0x6bb1('0x6a')][_0x6bb1('0x17')];_0x3f4487++){stats['rows']+=0x1;if(_0x2a387b[_0x6bb1('0x59')][_0x3f4487]){handleError(_0x2a387b[_0x6bb1('0x6a')][_0x3f4487],_0x2a387b['errors'][_0x3f4487]);}else{var _0x2890f6=[];var _0x1bff96=[];for(var _0x5d8ad5 in _0x26a6c7){let _0x332307=contactItemTypes[_0x6bb1('0x6b')](_0x65f830=>_0x65f830['name']===_0x5d8ad5);if(_[_0x6bb1('0x6c')](_0x332307)){if(_0x26a6c7[_0x6bb1('0x6d')](_0x5d8ad5)){if(_0x2a387b[_0x6bb1('0x6a')][_0x3f4487][_0x26a6c7[_0x5d8ad5]]){var _0x392265=_['trim'](_0x2a387b[_0x6bb1('0x6a')][_0x3f4487][_0x26a6c7[_0x5d8ad5]]['replace'](/"/g,'\x27'));switch(_0x5d8ad5){case _0x6bb1('0x30'):var _0x37671c=moment(_0x392265,_0x6bb1('0xc'),!![]);if(_0x37671c[_0x6bb1('0x6e')]()){_0x4bbdbd[_0x6bb1('0x19')]('\x22'+_0x392265+'\x22');}else{_0x2890f6[_0x6bb1('0x19')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x2eb11e=parseInt(_0x392265);_0x392265=_['isNaN'](_0x2eb11e)||_0x2eb11e<0x0||_0x2eb11e>0x4?_0x2f739e?0x3:0x2:_0x2eb11e;_0x4bbdbd[_0x6bb1('0x19')]('\x22'+_0x392265+'\x22');break;case _0x6bb1('0x34'):var _0xf197b0=parseInt(_0x392265);if(_[_0x6bb1('0x6f')](_0xf197b0)&&_[_0x6bb1('0x70')](_0x4dfdfb,_0xf197b0)){_0x4bbdbd[_0x6bb1('0x19')]('\x22'+_0xf197b0+'\x22');}else{_0x2890f6[_0x6bb1('0x19')](_0x6bb1('0x71'));}break;case _0x6bb1('0x72'):if(isEmail(_0x392265)){_0x4bbdbd[_0x6bb1('0x19')]('\x22'+_0x392265+'\x22');}else{_0x2890f6[_0x6bb1('0x19')](_0x6bb1('0x73'));}break;case _0x6bb1('0x74'):var _0x5c3f7b=moment(_0x392265,_0x6bb1('0x75'),!![]);if(_0x5c3f7b[_0x6bb1('0x6e')]()){_0x4bbdbd[_0x6bb1('0x19')]('\x22'+_0x392265+'\x22');}else{_0x2890f6[_0x6bb1('0x19')](_0x6bb1('0x76'));}break;default:_0x4bbdbd[_0x6bb1('0x19')]('\x22'+_0x392265+'\x22');}}else{switch(_0x5d8ad5){case _0x6bb1('0x77'):case _0x6bb1('0xf'):_0x2890f6[_0x6bb1('0x19')](_0x5d8ad5+_0x6bb1('0x78'));break;default:_0x4bbdbd[_0x6bb1('0x19')]('\x22\x22');}}}}else{var _0x222861='';for(var _0x2e6f75=0x0;_0x2e6f75<_0x26a6c7[_0x5d8ad5][_0x6bb1('0x17')];_0x2e6f75++){var _0x392265=_[_0x6bb1('0x79')](_0x2a387b[_0x6bb1('0x6a')][_0x3f4487][_0x26a6c7[_0x5d8ad5][_0x2e6f75]][_0x6bb1('0x7a')](/"/g,'\x27'));if(_0x222861=='')_0x222861=_0x392265;else _0x222861+='|'+_0x392265;}_0x1bff96[_0x6bb1('0x19')](_0x332307['id']+':'+_0x222861);}}if(hasAdditionalPhones){_0x4bbdbd[_0x6bb1('0x19')]('\x22'+_0x1bff96[_0x6bb1('0x10')](';')+'\x22');}if(_0x2890f6['length']){handleError(_0x2a387b['data'][_0x3f4487],{'code':'SystemRow','message':_0x2890f6['join']()});}else{fs['appendFileSync'](_0x3d731f,_0x4bbdbd[_0x6bb1('0x10')]()+'\x0a');}_0x4bbdbd=[];}if(!(stats[_0x6bb1('0x7b')]%0xc8)){socket[_0x6bb1('0x7c')]('contact:import:'+_0x178143,stats);stats[_0x6bb1('0x59')]=[];}}if(stopped){logger[_0x6bb1('0x56')]('Abort\x20parser');_0x3992d7[_0x6bb1('0x7d')]();}}catch(_0xeb2c39){handleError(_0x2a387b[_0x6bb1('0x6a')][_0x3f4487],{'code':_0x6bb1('0x7e'),'message':_0xeb2c39['message']});logger['error'](_0x6bb1('0x7f'),_0xeb2c39[_0x6bb1('0x1d')]);}},'complete':function(){try{var _0x3c6755=[];var _0x4f9211=tempTableName;_0x3c6755[_0x6bb1('0x19')](_0x6bb1('0x80')+_0x4f9211+'\x20LIKE\x20cm_contacts;');logger['info'](_0x6bb1('0x81'),contactItemTypes[_0x6bb1('0x17')]);var _0x3acd55=util[_0x6bb1('0xb')](_0x6bb1('0x82'),_0x3d731f,_0x4f9211,_0x38cbdc,_0x15a61b['ListId'],_0x15a61b[_0x6bb1('0x52')]||null,NOW,NOW);if(_[_0x6bb1('0x6c')](_0x26a6c7[_0x6bb1('0x30')])){_0x3acd55+=',\x20scheduledAt\x20=\x20NOW()';}_0x3c6755[_0x6bb1('0x19')](_0x3acd55);BPromise[_0x6bb1('0x83')](_0x3c6755,handleQuery)[_0x6bb1('0x1a')](function(_0x5a854a){BPromise[_0x6bb1('0x1f')]([handleAdditionalPhones()])[_0x6bb1('0x1a')](function(){_0x3c6755=[];for(var _0x4cb10b=0x0;_0x4cb10b\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','push','then','catch','message','AdditionalPhones','split','all','filter','CmContactHasItem','findOne','updated','create','PHONE','inserted','update','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_contacts.createdAt','cm_hopper_black','cm_contacts','field','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','keys',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','error','exit','errors','code','main','stringify','start','binding'];(function(_0x2c6fd3,_0x4ad940){var _0x57d735=function(_0x33af5b){while(--_0x33af5b){_0x2c6fd3['push'](_0x2c6fd3['shift']());}};_0x57d735(++_0x4ad940);}(_0x84e9,0xda));var _0x984e=function(_0x50f7df,_0x4199b9){_0x50f7df=_0x50f7df-0x0;var _0x28c6de=_0x84e9[_0x50f7df];return _0x28c6de;};'use strict';var fs=require('fs');var path=require(_0x984e('0x0'));var _=require(_0x984e('0x1'));var Papa=require(_0x984e('0x2'));var util=require(_0x984e('0x3'));var BPromise=require(_0x984e('0x4'));var moment=require('moment');var squel=require(_0x984e('0x5'));var Redis=require('ioredis');var db=require(_0x984e('0x6'))['db'];var config=require(_0x984e('0x7'));var logger=require(_0x984e('0x8'))(_0x984e('0x9'));config['redis']=_[_0x984e('0xa')](config[_0x984e('0xb')],{'host':_0x984e('0xc'),'port':0x18eb});var socket=require(_0x984e('0xd'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x984e('0xe')](_0x984e('0xf'));var tempTableName=_0x984e('0x10')+moment()[_0x984e('0xe')](_0x984e('0x11'));var contactItemTypes=[];var hasAdditionalPhones=![];function isEmail(_0x3b02a6){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))*$/[_0x984e('0x12')](_0x3b02a6);}function selectNotIn(_0x2760bb,_0xa4202f,_0x4b50fe,_0x299b32,_0x19556d){return squel[_0x984e('0x13')]()['field'](_0x984e('0x14'))[_0x984e('0x15')](_0x299b32)[_0x984e('0x16')](_0xa4202f,null,_0xa4202f+_0x984e('0x17')+_0x299b32+'.'+_0x4b50fe)[_0x984e('0x18')](_0x299b32+'.'+_0x4b50fe+_0x984e('0x19')+_0x2760bb+'.'+_0x4b50fe)[_0x984e('0x18')](_0xa4202f+_0x984e('0x1a')+_0x19556d[_0x984e('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5df2a5,_0x310b8c){promisesAdditionalPhones=[];promisesContact=[];return db[_0x984e('0x1b')][_0x984e('0x1c')](_0x984e('0x1d')+tempTableName)[_0x984e('0x1e')](function(_0x1a02ba){if(_0x1a02ba!==null){var _0x27c5cd=[];for(var _0x40b96a=0x0;_0x40b96a<_0x1a02ba[_0x984e('0x1f')];_0x40b96a++){var _0x5947dd=_0x1a02ba[_0x40b96a];if(!_['isNil'](_0x5947dd[_0x984e('0x14')])){if(!_[_0x984e('0x20')](_0x5947dd['AdditionalPhones']))_0x27c5cd['push'](insertAdditionalPhones(_0x5947dd));promisesContact[_0x984e('0x21')]({'contact':_0x5947dd});}}}Promise['all'](_0x27c5cd)[_0x984e('0x22')](function(){_0x5df2a5({'val':0x1});});})[_0x984e('0x23')](function(_0x397b9f){logger['error'](_0x397b9f[_0x984e('0x24')]);});});}function insertAdditionalPhones(_0x3aa2ac){return new Promise(function(_0x9e43ee,_0x67fa9f){var _0x523e25=_0x3aa2ac[_0x984e('0x25')];if(_['isNil'](_0x523e25))_0x67fa9f({'val':0x0});else{var _0x9242bd=_0x523e25[_0x984e('0x26')](';');var _0x1a1a6b=[];orderBy=0x0;for(var _0x45d2c8=0x0;_0x45d2c8<_0x9242bd['length'];_0x45d2c8++){_0x1a1a6b[_0x984e('0x21')](splitAdditionalPhone(_0x3aa2ac['id'],_0x9242bd[_0x45d2c8]));}Promise[_0x984e('0x27')](_0x1a1a6b)[_0x984e('0x22')](function(){_0x9e43ee({'val':_0x9242bd['length']});});}});}function splitAdditionalPhone(_0x11498d,_0xc5f744){return new Promise(function(_0x14d693,_0x766be9){var _0x492932=_0xc5f744[_0x984e('0x26')](':');var _0x20f5fe=_0x492932[0x0];var _0x27eecb=_0x492932[0x1];if(_0x27eecb!==''){var _0x49529e=_0x27eecb[_0x984e('0x26')]('|');var _0x342676=[];for(var _0x2d9066=0x0;_0x2d9066<_0x49529e['length'];_0x2d9066++){if(_0x49529e[_0x2d9066]!==''){var _0x3a7631=_[_0x984e('0x28')](promisesAdditionalPhones,{'contactId':_0x11498d,'phone':_0x49529e[_0x2d9066]});if(_0x3a7631[_0x984e('0x1f')]==0x0){orderBy++;promisesAdditionalPhones[_0x984e('0x21')]({'contactId':_0x11498d,'contactTypeId':_0x20f5fe,'phone':_0x49529e[_0x2d9066],'orderBy':orderBy});}}}_0x14d693({'ok':0x1});}else _0x14d693({'res':0x0});});}function createAdditionalPhone(_0x4d3d86,_0x1d9b48,_0x194966,_0x52df9c){return new Promise(function(_0x3098f5,_0x4f9dfd){return db[_0x984e('0x29')][_0x984e('0x2a')]({'where':{'CmContactId':_0x4d3d86,'item':_0x194966}})[_0x984e('0x22')](function(_0x248308){if(_0x248308){return db['CmContactHasItem']['update']({'ItemTypeId':_0x1d9b48,'OrderBy':_0x52df9c},{'where':{'CmContactId':_0x4d3d86,'item':_0x194966}})[_0x984e('0x22')](function(_0x298580){_0x3098f5({'res':_0x984e('0x2b')});});}else{return db['CmContactHasItem'][_0x984e('0x2c')]({'CmContactId':_0x4d3d86,'item':_0x194966,'ItemTypeId':_0x1d9b48,'OrderBy':_0x52df9c,'ItemClass':_0x984e('0x2d')})[_0x984e('0x22')](function(_0x231bda){_0x3098f5({'res':_0x984e('0x2e')});});}});});}function updateContact(_0x4e7194){return new Promise(function(_0xaa2841,_0x382ff6){var _0x3319f0=_0x4e7194['id'];delete _0x4e7194['id'];return db['CmContact'][_0x984e('0x2f')](_0x4e7194,{'where':{'id':_0x3319f0}})[_0x984e('0x22')](function(_0x12f7cf){updatedRows+=0x1;return db[_0x984e('0x30')]['update']({'phone':_0x4e7194['phone']},{'where':{'ContactId':_0x3319f0}})[_0x984e('0x22')](function(_0x369404){_0xaa2841({'ret':'OK'});});});});}function insertCmHopper(_0x28039d,_0x24a852,_0xed1f51,_0x2eecdd,_0x41b6ac){var _0x2cdc0f=[_0x984e('0x31'),_0x984e('0x32'),'cm_contacts.id',_0x984e('0x33'),_0x24a852+'.'+_0x2eecdd,'cm_contacts.createdAt',_0x984e('0x34'),_0x984e('0x35'),_0x984e('0x36'),'\x22'+_0x41b6ac+'\x22'];return squel[_0x984e('0x37')]()[_0x984e('0x38')](_0x984e('0x39'))[_0x984e('0x3a')]([_0x984e('0x14'),'scheduledat',_0x984e('0x3b'),_0x984e('0x3c'),_0x2eecdd,_0x984e('0x3d'),_0x984e('0x3e'),_0x984e('0x3f'),_0x984e('0x40'),_0x984e('0x41')],squel[_0x984e('0x13')]()[_0x984e('0x42')](_0x2cdc0f)[_0x984e('0x15')](_0x24a852)[_0x984e('0x16')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x24a852+_0x984e('0x43'))[_0x984e('0x16')](_0xed1f51,null,_0xed1f51+_0x984e('0x17')+_0x24a852+'.'+_0x2eecdd)[_0x984e('0x18')](_0x24a852+_0x984e('0x44'),_0x28039d)['where'](_0x984e('0x45'),NOW)[_0x984e('0x18')](_0x984e('0x46'),selectNotIn(_0x24a852,_0xed1f51,_0x2eecdd,_0x984e('0x39'),['\x22always\x22',_0x984e('0x47')]))['where'](_0x984e('0x46'),selectNotIn(_0x24a852,_0xed1f51,_0x2eecdd,_0x984e('0x39'),['\x22always\x22'])))[_0x984e('0x48')]();}function insertCmHopperBlack(_0xa6be0d,_0x1aa677,_0x97c7a,_0xf0f3a){var _0x4442b0=[_0x984e('0x31'),_0x984e('0x49'),_0x984e('0x33'),_0x1aa677+'.'+_0xf0f3a,_0x984e('0x4a'),_0x984e('0x34')];return squel['insert']()[_0x984e('0x38')](_0x984e('0x4b'))[_0x984e('0x3a')](['phone',_0x984e('0x3b'),'ListId',_0xf0f3a,_0x984e('0x3d'),'updatedAt'],squel['select']()[_0x984e('0x42')](_0x4442b0)[_0x984e('0x15')](_0x1aa677)['join'](_0x984e('0x4c'),null,'cm_contacts.ListId\x20=\x20'+_0x1aa677+_0x984e('0x43'))[_0x984e('0x16')](_0x97c7a,null,_0x97c7a+_0x984e('0x17')+_0x1aa677+'.'+_0xf0f3a)[_0x984e('0x18')](_0x1aa677+_0x984e('0x44'),_0xa6be0d)[_0x984e('0x18')](_0x984e('0x45'),NOW)['where'](_0x984e('0x46'),squel['select']()[_0x984e('0x4d')](_0x984e('0x14'))['from']('cm_hopper_black')[_0x984e('0x18')](_0x984e('0x4e'),_0xa6be0d)['where'](_0xf0f3a+_0x984e('0x4f'),_0x1aa677+'.'+_0xf0f3a)))['toString']();}function insertCmHopperAdditionalPhones(_0x32c687){var _0x25bdf3=['cm_hopper.id',_0x984e('0x50'),_0x984e('0x51'),_0x984e('0x52'),_0x984e('0x53')];return squel['insert']()[_0x984e('0x38')]('cm_hopper_additional_phones')['fromQuery']([_0x984e('0x54'),_0x984e('0x14'),_0x984e('0x55'),_0x984e('0x3d'),'updatedAt'],squel[_0x984e('0x13')]()['fields'](_0x25bdf3)[_0x984e('0x15')]('cm_hopper')[_0x984e('0x16')](_0x984e('0x4c'),null,_0x984e('0x56'))[_0x984e('0x16')]('cm_contact_has_items',null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x984e('0x18')]('cm_hopper.ListId\x20=\x20?',_0x32c687)[_0x984e('0x18')](_0x984e('0x45'),NOW))[_0x984e('0x48')]();}function insertCmContact(_0x1768aa,_0x13d60f,_0x17f17a,_0xcd4384){var _0x27e6ea=_['concat'](_[_0x984e('0x57')](_0xcd4384),[_0x984e('0x3c'),'CompanyId',_0x984e('0x3d'),_0x984e('0x3e')]);return squel['insert']()[_0x984e('0x38')](_0x984e('0x4c'))[_0x984e('0x3a')](_0x27e6ea,squel['select']()[_0x984e('0x42')](_0x27e6ea)[_0x984e('0x15')](_0x13d60f)[_0x984e('0x18')]('('+_0x17f17a[_0x984e('0x16')](',')+_0x984e('0x58'),squel[_0x984e('0x13')]()[_0x984e('0x42')](_0x17f17a)[_0x984e('0x15')]('cm_contacts')[_0x984e('0x18')]('ListId\x20=\x20?',_0x1768aa))[_0x984e('0x18')](_0x984e('0x59'),squel[_0x984e('0x13')]()[_0x984e('0x4d')](_0x984e('0x5a'),_0x984e('0x5b'))[_0x984e('0x15')](_0x13d60f)['group'](_0x17f17a[_0x984e('0x16')](','))))[_0x984e('0x48')]();}function handleStop(){logger[_0x984e('0x5c')](_0x984e('0x5d'));stopped=!![];}function handleUncaughtException(_0x56fab0){logger[_0x984e('0x5e')](_0x56fab0['message']);process[_0x984e('0x5f')](0x1);}function handleError(_0x7ca920,_0x9e1687){stats[_0x984e('0x60')]['push']({'name':_0x9e1687[_0x984e('0x61')],'message':_0x9e1687[_0x984e('0x24')],'row':_0x7ca920});}function handleQuery(_0x5274fd){logger[_0x984e('0x5c')](_0x5274fd);return db[_0x984e('0x1b')][_0x984e('0x1c')](_0x5274fd)[_0x984e('0x1e')](function(_0x408ddd){results[_0x984e('0x21')](_0x408ddd);})[_0x984e('0x23')](function(_0x57e014){logger['error'](_0x57e014[_0x984e('0x24')]);});}function main(_0x12d6fb,_0x31f654,_0xa34916,_0x95e770){logger[_0x984e('0x5c')](_0x984e('0x62'),_0x12d6fb,JSON[_0x984e('0x63')](_0x31f654));process['send'](_0x984e('0x64'));var _0x3522dd=_0x31f654[_0x984e('0x65')];var _0x41a26c=_[_0x984e('0x66')](_0x3522dd);var _0x579cfd=_0x31f654['socket_timestamp'];var _0x309639=path['join'](config['root'],_0x984e('0x67'),_0x579cfd+'.csv');logger[_0x984e('0x5c')](_0x984e('0x68'),_0x31f654);db['ContactItemType'][_0x984e('0x69')]({'raw':!![],'attributes':['id','name']})[_0x984e('0x22')](function(_0x24a2ab){for(var _0x3e4d23=0x0;_0x3e4d23<_0x24a2ab[_0x984e('0x1f')];_0x3e4d23++){if(_0x24a2ab[_0x3e4d23][_0x984e('0x6a')]in _0x3522dd){contactItemTypes[_0x984e('0x21')](_0x24a2ab[_0x3e4d23]);delete _0x41a26c[_0x24a2ab[_0x3e4d23]['name']];hasAdditionalPhones=!![];}else{}}if(hasAdditionalPhones)_0x41a26c[_0x984e('0x25')]='';var _0x19b382=_['keys'](_0x41a26c)['join']();logger[_0x984e('0x5c')](_0x984e('0x6b'),_0x19b382);fs[_0x984e('0x6c')](_0x309639,_0x19b382+'\x0a');Papa[_0x984e('0x6d')](fs[_0x984e('0x6e')](_0x12d6fb),{'header':!![],'skipEmptyLines':!![],'step':function(_0x18d7ee,_0x299024){try{for(var _0xe9fb95=0x0,_0x49a07f=[];_0xe9fb95<_0x18d7ee[_0x984e('0x6f')]['length'];_0xe9fb95++){stats[_0x984e('0x70')]+=0x1;if(_0x18d7ee[_0x984e('0x60')][_0xe9fb95]){handleError(_0x18d7ee[_0x984e('0x6f')][_0xe9fb95],_0x18d7ee['errors'][_0xe9fb95]);}else{var _0x273dd6=[];var _0x4f7555=[];for(var _0x12ff77 in _0x3522dd){let _0x480386=contactItemTypes[_0x984e('0x71')](_0xfa3dd5=>_0xfa3dd5[_0x984e('0x6a')]===_0x12ff77);if(_[_0x984e('0x20')](_0x480386)){if(_0x3522dd[_0x984e('0x72')](_0x12ff77)){if(_0x18d7ee['data'][_0xe9fb95][_0x3522dd[_0x12ff77]]){var _0x188e08=_[_0x984e('0x73')](_0x18d7ee[_0x984e('0x6f')][_0xe9fb95][_0x3522dd[_0x12ff77]][_0x984e('0x74')](/"/g,'\x27'));switch(_0x12ff77){case _0x984e('0x75'):var _0xda3aba=moment(_0x188e08,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xda3aba[_0x984e('0x76')]()){_0x49a07f[_0x984e('0x21')]('\x22'+_0x188e08+'\x22');}else{_0x273dd6['push'](_0x984e('0x77'));}break;case _0x984e('0x3f'):var _0x3f700f=parseInt(_0x188e08);_0x188e08=_[_0x984e('0x78')](_0x3f700f)||_0x3f700f<0x0||_0x3f700f>0x4?_0x95e770?0x3:0x2:_0x3f700f;_0x49a07f['push']('\x22'+_0x188e08+'\x22');break;case _0x984e('0x40'):var _0x12cb57=parseInt(_0x188e08);if(_[_0x984e('0x79')](_0x12cb57)&&_['includes'](_0xa34916,_0x12cb57)){_0x49a07f[_0x984e('0x21')]('\x22'+_0x12cb57+'\x22');}else{_0x273dd6[_0x984e('0x21')](_0x984e('0x7a'));}break;case'email':if(isEmail(_0x188e08)){_0x49a07f[_0x984e('0x21')]('\x22'+_0x188e08+'\x22');}else{_0x273dd6[_0x984e('0x21')](_0x984e('0x7b'));}break;case _0x984e('0x7c'):var _0x3afdf9=moment(_0x188e08,_0x984e('0x7d'),!![]);if(_0x3afdf9[_0x984e('0x76')]()){_0x49a07f[_0x984e('0x21')]('\x22'+_0x188e08+'\x22');}else{_0x273dd6[_0x984e('0x21')](_0x984e('0x7e'));}break;default:_0x49a07f[_0x984e('0x21')]('\x22'+_0x188e08+'\x22');}}else{switch(_0x12ff77){case _0x984e('0x7f'):case _0x984e('0x14'):_0x273dd6[_0x984e('0x21')](_0x12ff77+'\x20not\x20specified');break;default:_0x49a07f['push']('\x22\x22');}}}}else{var _0x3a895f='';for(var _0x2b6e45=0x0;_0x2b6e45<_0x3522dd[_0x12ff77][_0x984e('0x1f')];_0x2b6e45++){var _0x188e08=_[_0x984e('0x73')](_0x18d7ee[_0x984e('0x6f')][_0xe9fb95][_0x3522dd[_0x12ff77][_0x2b6e45]][_0x984e('0x74')](/"/g,'\x27'));if(_0x3a895f=='')_0x3a895f=_0x188e08;else _0x3a895f+='|'+_0x188e08;}_0x4f7555[_0x984e('0x21')](_0x480386['id']+':'+_0x3a895f);}}if(hasAdditionalPhones){_0x49a07f['push']('\x22'+_0x4f7555[_0x984e('0x16')](';')+'\x22');}if(_0x273dd6[_0x984e('0x1f')]){handleError(_0x18d7ee[_0x984e('0x6f')][_0xe9fb95],{'code':_0x984e('0x80'),'message':_0x273dd6['join']()});}else{fs[_0x984e('0x81')](_0x309639,_0x49a07f[_0x984e('0x16')]()+'\x0a');}_0x49a07f=[];}if(!(stats[_0x984e('0x70')]%0xc8)){socket[_0x984e('0x82')](_0x984e('0x83')+_0x579cfd,stats);stats[_0x984e('0x60')]=[];}}if(stopped){logger[_0x984e('0x5c')](_0x984e('0x84'));_0x299024[_0x984e('0x85')]();}}catch(_0x5d3884){handleError(_0x18d7ee[_0x984e('0x6f')][_0xe9fb95],{'code':_0x984e('0x86'),'message':_0x5d3884['message']});logger[_0x984e('0x5e')](_0x984e('0x87'),_0x5d3884['message']);}},'complete':function(){try{var _0x49fb11=[];var _0x44e614=tempTableName;_0x49fb11[_0x984e('0x21')](_0x984e('0x88')+_0x44e614+_0x984e('0x89'));logger[_0x984e('0x5c')]('CIS\x20len',contactItemTypes[_0x984e('0x1f')]);var _0x31db1d=util[_0x984e('0xe')](_0x984e('0x8a'),_0x309639,_0x44e614,_0x19b382,_0x31f654['ListId'],_0x31f654[_0x984e('0x8b')]||null,NOW,NOW);if(_['isNil'](_0x3522dd[_0x984e('0x75')])){_0x31db1d+=_0x984e('0x8c');}_0x49fb11[_0x984e('0x21')](_0x31db1d);BPromise[_0x984e('0x8d')](_0x49fb11,handleQuery)[_0x984e('0x22')](function(_0x229bd2){BPromise[_0x984e('0x27')]([handleAdditionalPhones()])[_0x984e('0x22')](function(){_0x49fb11=[];for(var _0x36c4e2=0x0;_0x36c4e2=_0x308b96){return _0x36dc38[_0x28d4('0x10')](0x193)['json']({'message':util[_0x28d4('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x27a945)});}_0x4dcbbe();})[_0x28d4('0x11')](function(_0x19ee4d){_0x4dcbbe(_0x19ee4d);});});}function isUserLimit(){return isLimit(_0x28d4('0x12'),0x1,db[_0x28d4('0x13')],{'where':{'$or':[{'role':_0x28d4('0x14')},{'role':_0x28d4('0x15')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x8428=['final','parse','use','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','isUserLimit','util','composable-middleware','../../mysqldb','data1','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8'];(function(_0xdf2fd8,_0x385d23){var _0x5c41c3=function(_0x54dc2b){while(--_0x54dc2b){_0xdf2fd8['push'](_0xdf2fd8['shift']());}};_0x5c41c3(++_0x385d23);}(_0x8428,0x12c));var _0x8842=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8428[_0x20a584];return _0x4b41a8;};'use strict';var crypto=require('crypto');var util=require(_0x8842('0x0'));var compose=require(_0x8842('0x1'));var db=require(_0x8842('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x4d6818,_0x2a0b4c){if(_0x4d6818&&_0x2a0b4c){if(_0x2a0b4c[_0x8842('0x3')]&&_0x2a0b4c['license']){var _0xfc31c8=_0x2a0b4c[_0x8842('0x3')];var _0x6a97ec=_0x2a0b4c['license'];var _0x13bc51=_0xfc31c8[_0x8842('0x4')]('-')[0x4];var _0x252129=_0xfc31c8['split']('-')[0x0];var _0x5a77f3=crypto[_0x8842('0x5')](_0x8842('0x6'),util[_0x8842('0x7')](_0x8842('0x8'),_0x13bc51,_0xfc31c8,_0x252129));var _0x226ee7=_0x5a77f3[_0x8842('0x9')](_0x6a97ec,_0x8842('0xa'),_0x8842('0xb'));_0x226ee7+=_0x5a77f3[_0x8842('0xc')](_0x8842('0xb'));var _0x5ef2c8=JSON[_0x8842('0xd')](_0x226ee7);return _0x5ef2c8['hasOwnProperty'](_0x4d6818)?_0x5ef2c8[_0x4d6818]:null;}}return null;}function isLimit(_0x22ebcf,_0x4cfe4e,_0x22e233,_0x324719){var _0x3018b8=_0x4cfe4e;return compose()[_0x8842('0xe')](function(_0x2760dc,_0x142dbc,_0x42e17b){return db[_0x8842('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x8842('0x10')](function(_0x6015e){var _0x46d50c=getValueFromLicense(_0x22ebcf,_0x6015e);return _0x46d50c?_0x46d50c:_0x3018b8;})[_0x8842('0x10')](function(_0x43c50d){_0x3018b8=_0x43c50d;return _0x22e233[_0x8842('0x11')](_0x324719);})[_0x8842('0x10')](function(_0x3fa147){if(_0x3fa147>=_0x3018b8){return _0x142dbc[_0x8842('0x12')](0x193)[_0x8842('0x13')]({'message':util['format'](_0x8842('0x14'),_0x22ebcf)});}_0x42e17b();})[_0x8842('0x15')](function(_0x549444){_0x42e17b(_0x549444);});});}function isUserLimit(){return isLimit(_0x8842('0x16'),0x1,db[_0x8842('0x17')],{'where':{'$or':[{'role':_0x8842('0x18')},{'role':'user'}]}});}exports[_0x8842('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index 8906dda..24779f1 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 _0x8365=['$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','$endsWith','pop','DATE','utcOffset','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','length','split','forEach','shift','match','filter','indexOf','conditions','push','$eq','$between','value','$gt','$lte','add','days','format','CAST(','\x20AS\x20','castTo','operator','text','field','$ne'];(function(_0x386412,_0x28567c){var _0x3d55b3=function(_0x21411c){while(--_0x21411c){_0x386412['push'](_0x386412['shift']());}};_0x3d55b3(++_0x28567c);}(_0x8365,0xbc));var _0x5836=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8365[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5836('0x0'));var moment=require(_0x5836('0x1'));exports[_0x5836('0x2')]=function(_0x1f52d3){var _0x86a898={'conditions':[]};_0x86a898[_0x5836('0x3')]=_[_0x5836('0x4')](_0x1f52d3,_0x5836('0x5'))?'or':_0x5836('0x6');var _0x121f43=_0x1f52d3[_0x5836('0x7')]('[$and]','')[_0x5836('0x7')]('[$or]','')['split']('||');for(var _0x1d4960=0x0;_0x1d4960<_0x121f43[_0x5836('0x8')];_0x1d4960++){var _0x3410d3=_0x121f43[_0x1d4960][_0x5836('0x9')](':=');var _0x45e854=_0x3410d3[0x0];var _0x4e64d7=_0x3410d3['slice'](0x1);_0x4e64d7[_0x5836('0xa')](function(_0x16ff00){var _0x75b30f=_0x16ff00[_0x5836('0x9')]('[')[_0x5836('0xb')]();var _0x38480c=_0x16ff00[_0x5836('0xc')](/\[(.*?)\]/g);_0x38480c[_0x5836('0xa')](function(_0x9c61cc){var _0x313982=_0x9c61cc['split']('[')[_0x5836('0xd')](function(_0x3e6a0b){return _0x3e6a0b[_0x5836('0xe')](']')>-0x1;})['map'](function(_0x343005){return _0x343005['split'](']')[0x0];})[0x0];_0x86a898[_0x5836('0xf')][_0x5836('0x10')]({'field':_0x45e854,'operator':_0x75b30f,'value':_0x313982});});});}return _0x86a898;};exports['buildExpression']=function(_0x16b00d,_0x1719ab,_0x5bd812){var _0x45b60b={};if(_0x1719ab==='DATE'){if(_0x5bd812['operator']===_0x5836('0x11')){_0x5bd812['operator']=_0x5836('0x12');_0x5bd812['value']+=','+_0x5bd812[_0x5836('0x13')];}else if(_['includes']([_0x5836('0x14'),_0x5836('0x15')],_0x5bd812['operator'])){_0x5bd812[_0x5836('0x13')]=moment(_0x5bd812[_0x5836('0x13')])[_0x5836('0x16')](0x1,_0x5836('0x17'))[_0x5836('0x18')]('YYYY-MM-DD');}}if(_0x5bd812['castTo']){_0x1719ab=_0x5bd812['castTo'];_0x45b60b['text']=_0x5836('0x19')+_0x16b00d+'.'+_0x5bd812['field']+_0x5836('0x1a')+_0x5bd812[_0x5836('0x1b')]+')\x20'+parseOperator(_0x5bd812[_0x5836('0x1c')]);}else{_0x45b60b[_0x5836('0x1d')]=_0x16b00d+'.'+_0x5bd812[_0x5836('0x1e')]+'\x20'+parseOperator(_0x5bd812['operator']);}if(_['includes']([_0x5836('0x1f'),_0x5836('0x20')],_0x5bd812['operator']))_0x45b60b[_0x5836('0x1d')]='('+_0x45b60b['text']+_0x5836('0x21')+_0x16b00d+'.'+_0x5bd812[_0x5836('0x1e')]+_0x5836('0x22');_0x45b60b[_0x5836('0x13')]=parseValue(_0x1719ab,_0x5bd812[_0x5836('0x1c')],_0x5bd812['value']);return _0x45b60b;};function parseOperator(_0x224371){var _0x38d93d;switch(_0x224371){case _0x5836('0x23'):_0x38d93d=_0x5836('0x24');break;case _0x5836('0x20'):_0x38d93d=_0x5836('0x25');break;case _0x5836('0x11'):_0x38d93d=_0x5836('0x26');break;case'$ne':_0x38d93d=_0x5836('0x27');break;case _0x5836('0x28'):case'$startsWith':case'$endsWith':_0x38d93d=_0x5836('0x29');break;case'$lt':_0x38d93d=_0x5836('0x2a');break;case _0x5836('0x14'):_0x38d93d=_0x5836('0x2b');break;case _0x5836('0x15'):_0x38d93d=_0x5836('0x2c');break;case _0x5836('0x2d'):_0x38d93d=_0x5836('0x2e');break;case _0x5836('0x12'):_0x38d93d=_0x5836('0x2f');break;}return _0x38d93d;}function parseValue(_0x2605f0,_0x20b2f8,_0xb9e8ee){var _0x45651f={'start':undefined,'end':undefined};switch(_0x20b2f8){case _0x5836('0x23'):case'$notIn':_0x45651f[_0x5836('0x30')]=_0xb9e8ee[_0x5836('0x9')](',');break;case'$substring':_0x45651f[_0x5836('0x30')]='%'+_0xb9e8ee+'%';break;case _0x5836('0x31'):_0x45651f[_0x5836('0x30')]=_0xb9e8ee+'%';break;case _0x5836('0x32'):_0x45651f['start']='%'+_0xb9e8ee;break;case _0x5836('0x12'):var _0x336e95=_0xb9e8ee[_0x5836('0x9')](',');var _0xb9e8ee=_0x336e95[_0x5836('0xb')]();var _0x1a903a=_0x336e95[_0x5836('0x33')]();if(_0x2605f0===_0x5836('0x34')){_0xb9e8ee=moment(_0xb9e8ee)[_0x5836('0x35')](0x0,!![])[_0x5836('0x18')]();_0x1a903a=moment(_0x1a903a)[_0x5836('0x35')](0x0,!![])[_0x5836('0x16')](0x17,'hours')[_0x5836('0x16')](0x3b,'minutes')[_0x5836('0x16')](0x3b,_0x5836('0x36'))[_0x5836('0x18')]();}_0x45651f={'start':_0xb9e8ee,'end':_0x1a903a};break;default:_0x45651f[_0x5836('0x30')]=_0xb9e8ee;break;}return _0x45651f;} \ No newline at end of file +var _0xafa2=['value','includes','$gt','$lte','add','days','format','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','$lt','>\x20?','$gte','>=\x20?','start','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','replace','slice','forEach','split','shift','filter','indexOf','map','conditions','buildExpression','DATE','operator','$eq','$between'];(function(_0x1e9e49,_0x41f48f){var _0x26919d=function(_0x1fee9e){while(--_0x1fee9e){_0x1e9e49['push'](_0x1e9e49['shift']());}};_0x26919d(++_0x41f48f);}(_0xafa2,0x183));var _0x2afa=function(_0x19c9fe,_0x229579){_0x19c9fe=_0x19c9fe-0x0;var _0x203117=_0xafa2[_0x19c9fe];return _0x203117;};'use strict';var _=require(_0x2afa('0x0'));var moment=require(_0x2afa('0x1'));exports[_0x2afa('0x2')]=function(_0x7bac79){var _0x49a0b8={'conditions':[]};_0x49a0b8[_0x2afa('0x3')]=_[_0x2afa('0x4')](_0x7bac79,_0x2afa('0x5'))?'or':_0x2afa('0x6');var _0x332d77=_0x7bac79['replace']('[$and]','')[_0x2afa('0x7')](_0x2afa('0x5'),'')['split']('||');for(var _0x334b94=0x0;_0x334b94<_0x332d77['length'];_0x334b94++){var _0x364c9b=_0x332d77[_0x334b94]['split'](':=');var _0x4cef3a=_0x364c9b[0x0];var _0x225a00=_0x364c9b[_0x2afa('0x8')](0x1);_0x225a00[_0x2afa('0x9')](function(_0x13b4c2){var _0x31509a=_0x13b4c2[_0x2afa('0xa')]('[')[_0x2afa('0xb')]();var _0x51a261=_0x13b4c2['match'](/\[(.*?)\]/g);_0x51a261['forEach'](function(_0x234f69){var _0x2951bb=_0x234f69['split']('[')[_0x2afa('0xc')](function(_0x276fe0){return _0x276fe0[_0x2afa('0xd')](']')>-0x1;})[_0x2afa('0xe')](function(_0x573024){return _0x573024[_0x2afa('0xa')](']')[0x0];})[0x0];_0x49a0b8[_0x2afa('0xf')]['push']({'field':_0x4cef3a,'operator':_0x31509a,'value':_0x2951bb});});});}return _0x49a0b8;};exports[_0x2afa('0x10')]=function(_0x198e04,_0x3a3f71,_0xf3f910){var _0x57419f={};if(_0x3a3f71===_0x2afa('0x11')){if(_0xf3f910[_0x2afa('0x12')]===_0x2afa('0x13')){_0xf3f910[_0x2afa('0x12')]=_0x2afa('0x14');_0xf3f910[_0x2afa('0x15')]+=','+_0xf3f910['value'];}else if(_[_0x2afa('0x16')]([_0x2afa('0x17'),_0x2afa('0x18')],_0xf3f910[_0x2afa('0x12')])){_0xf3f910['value']=moment(_0xf3f910['value'])[_0x2afa('0x19')](0x1,_0x2afa('0x1a'))[_0x2afa('0x1b')]('YYYY-MM-DD');}}if(_0xf3f910[_0x2afa('0x1c')]){_0x3a3f71=_0xf3f910[_0x2afa('0x1c')];_0x57419f[_0x2afa('0x1d')]=_0x2afa('0x1e')+_0x198e04+'.'+_0xf3f910[_0x2afa('0x1f')]+_0x2afa('0x20')+_0xf3f910[_0x2afa('0x1c')]+')\x20'+parseOperator(_0xf3f910[_0x2afa('0x12')]);}else{_0x57419f[_0x2afa('0x1d')]=_0x198e04+'.'+_0xf3f910[_0x2afa('0x1f')]+'\x20'+parseOperator(_0xf3f910[_0x2afa('0x12')]);}if(_[_0x2afa('0x16')]([_0x2afa('0x21'),_0x2afa('0x22')],_0xf3f910['operator']))_0x57419f[_0x2afa('0x1d')]='('+_0x57419f['text']+'\x20OR\x20'+_0x198e04+'.'+_0xf3f910[_0x2afa('0x1f')]+_0x2afa('0x23');_0x57419f[_0x2afa('0x15')]=parseValue(_0x3a3f71,_0xf3f910[_0x2afa('0x12')],_0xf3f910[_0x2afa('0x15')]);return _0x57419f;};function parseOperator(_0x332651){var _0x653e31;switch(_0x332651){case _0x2afa('0x24'):_0x653e31='IN\x20?';break;case _0x2afa('0x22'):_0x653e31=_0x2afa('0x25');break;case _0x2afa('0x13'):_0x653e31='=\x20?';break;case _0x2afa('0x21'):_0x653e31=_0x2afa('0x26');break;case _0x2afa('0x27'):case _0x2afa('0x28'):case _0x2afa('0x29'):_0x653e31='LIKE\x20?';break;case _0x2afa('0x2a'):_0x653e31='<\x20?';break;case _0x2afa('0x17'):_0x653e31=_0x2afa('0x2b');break;case _0x2afa('0x18'):_0x653e31='<=\x20?';break;case _0x2afa('0x2c'):_0x653e31=_0x2afa('0x2d');break;case _0x2afa('0x14'):_0x653e31='BETWEEN\x20?\x20AND\x20?';break;}return _0x653e31;}function parseValue(_0x363e11,_0xc4d345,_0x23701e){var _0x324c40={'start':undefined,'end':undefined};switch(_0xc4d345){case _0x2afa('0x24'):case'$notIn':_0x324c40[_0x2afa('0x2e')]=_0x23701e[_0x2afa('0xa')](',');break;case _0x2afa('0x27'):_0x324c40[_0x2afa('0x2e')]='%'+_0x23701e+'%';break;case _0x2afa('0x28'):_0x324c40[_0x2afa('0x2e')]=_0x23701e+'%';break;case _0x2afa('0x29'):_0x324c40[_0x2afa('0x2e')]='%'+_0x23701e;break;case _0x2afa('0x14'):var _0x3e2354=_0x23701e[_0x2afa('0xa')](',');var _0x23701e=_0x3e2354[_0x2afa('0xb')]();var _0x4c8136=_0x3e2354['pop']();if(_0x363e11===_0x2afa('0x11')){_0x23701e=moment(_0x23701e)[_0x2afa('0x2f')](0x0,!![])['format']();_0x4c8136=moment(_0x4c8136)[_0x2afa('0x2f')](0x0,!![])['add'](0x17,_0x2afa('0x30'))[_0x2afa('0x19')](0x3b,_0x2afa('0x31'))[_0x2afa('0x19')](0x3b,_0x2afa('0x32'))[_0x2afa('0x1b')]();}_0x324c40={'start':_0x23701e,'end':_0x4c8136};break;default:_0x324c40[_0x2afa('0x2e')]=_0x23701e;break;}return _0x324c40;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 2789562..db43584 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 _0x44f4=['forOwn','type','DATE','$gte','format','YYYY-MM-DD','utc','$lte','subtract','isArray','parse','split','limit','offset','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isObject','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','getFullTextValue','push','lodash','fields','filters','isEmpty'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x44f4,0x140));var _0x444f=function(_0x190ccf,_0x3a98ac){_0x190ccf=_0x190ccf-0x0;var _0x1f6906=_0x44f4[_0x190ccf];return _0x1f6906;};'use strict';var _=require(_0x444f('0x0'));var sequelize=require('sequelize');var moment=require('moment');var LIMIT_VALUE=0xfa;exports[_0x444f('0x1')]=function(_0x1deb48){var _0x330ee2=null;if(_0x1deb48){_0x330ee2=_0x1deb48['split'](',');}return _0x330ee2;};exports[_0x444f('0x2')]=function(_0x4dd98d,_0xdb1585){var _0x350581={};if(!_[_0x444f('0x3')](_0x4dd98d)){_[_0x444f('0x4')](_0x4dd98d,function(_0x2588d9,_0x1bb0cf){try{if(_0xdb1585){var _0x25c7ca=_['find'](_0xdb1585,{'name':_0x1bb0cf})||{};if(_0x25c7ca[_0x444f('0x5')]===_0x444f('0x6')&&_['isPlainObject'](_0x2588d9)){var _0x5bba4f=JSON['parse'](_0x2588d9);var _0x7a02a0={'$gte':moment(moment(_0x5bba4f[_0x444f('0x7')])[_0x444f('0x8')](_0x444f('0x9')))[_0x444f('0xa')]()[_0x444f('0x8')](),'$lte':moment(moment(_0x5bba4f[_0x444f('0xb')])[_0x444f('0x8')](_0x444f('0x9')))[_0x444f('0xa')]()[_0x444f('0xc')](0x1,'s')['format']()};_0x350581[_0x1bb0cf]=_0x7a02a0;}else{_0x350581[_0x1bb0cf]=_[_0x444f('0xd')](_0x2588d9)?_0x2588d9:JSON['parse'](_0x2588d9);}}else{_0x350581[_0x1bb0cf]=_[_0x444f('0xd')](_0x2588d9)?_0x2588d9:JSON[_0x444f('0xe')](_0x2588d9);}}catch(_0x2d1d2e){_0x350581[_0x1bb0cf]=_0x2588d9[_0x444f('0xf')](',');}});}return _0x350581;};exports[_0x444f('0x10')]=function(_0x1d9f9c){_0x1d9f9c=parseInt(_0x1d9f9c,0xa);if(!_0x1d9f9c||_0x1d9f9c<0x0){_0x1d9f9c=LIMIT_VALUE;}return _0x1d9f9c;};exports[_0x444f('0x11')]=function(_0x485d92){_0x485d92=parseInt(_0x485d92,0xa);if(!_0x485d92||_0x485d92<0x0){_0x485d92=0x0;}return _0x485d92;};exports['sort']=function(_0x238d64){var _0x135c48,_0x30fcc6=null;if(_0x238d64){_0x135c48=_0x238d64[_0x444f('0xf')](',');_0x30fcc6=_[_0x444f('0x12')](_0x135c48,function(_0x10a4ad){if(_0x10a4ad[_0x444f('0x13')]('-')===0x0){return[_0x10a4ad===_0x444f('0x14')?sequelize[_0x444f('0x15')](sequelize[_0x444f('0x16')]('priority'),_0x444f('0x17')):_0x10a4ad[_0x444f('0x18')](0x1),_0x444f('0x19')];}else{return[_0x10a4ad===_0x444f('0x14')?sequelize['cast'](sequelize[_0x444f('0x16')]('priority'),_0x444f('0x17')):_0x10a4ad,_0x444f('0x1a')];}});}return _0x30fcc6;};exports[_0x444f('0x1b')]=function(_0x33d344,_0x26f4cd){if(_[_0x444f('0x3')](_0x33d344)){return _0x33d344;}if(_[_0x444f('0xd')](_0x33d344)){for(var _0x353d57=0x0;_0x353d57<_0x33d344['length'];_0x353d57+=0x1){_0x33d344[_0x353d57]=this[_0x444f('0x1b')](_0x33d344[_0x353d57],_0x26f4cd);}return _0x33d344;}if(!_[_0x444f('0x1c')](_0x33d344)){return _0x33d344;}if(_['isString'](_0x26f4cd)){_0x26f4cd=[_0x26f4cd];}if(!_[_0x444f('0xd')](_0x26f4cd)){return _0x33d344;}for(var _0x2d417c=0x0;_0x2d417c<_0x26f4cd['length'];_0x2d417c+=0x1){_['unset'](_0x33d344,_0x26f4cd[_0x2d417c]);}for(var _0x480e5d in _0x33d344){if(_0x33d344[_0x444f('0x1d')](_0x480e5d)){_0x33d344[_0x480e5d]=this[_0x444f('0x1b')](_0x33d344[_0x480e5d],_0x26f4cd);}}return _0x33d344;};exports[_0x444f('0x1e')]=function(_0x139473){return _0x139473[_0x444f('0x1f')](RegExp(_0x444f('0x20')))?!![]:![];};exports[_0x444f('0x21')]=function(_0x49fe9c){return _0x49fe9c[_0x444f('0x1f')](/^\S+@\S+$/)?!![]:![];};exports[_0x444f('0x22')]=function(_0x34912d){var _0x5e7797=[];_0x34912d[_0x444f('0xf')]('\x20')['forEach'](function(_0x1ccf31){_0x5e7797[_0x444f('0x23')]('+'+_0x1ccf31['toString']()+'*');});return _0x5e7797['join']('\x20');}; \ No newline at end of file +var _0x6156=['fields','split','filters','isEmpty','forOwn','find','type','DATE','parse','$gte','format','YYYY-MM-DD','utc','$lte','isArray','limit','offset','map','indexOf','cast','col','unsigned','substr','priority','ASC','omit','length','isObject','isString','unset','hasOwnProperty','match','^[0-9]*$','getFullTextValue','forEach','push','toString','lodash','sequelize','moment'];(function(_0x3cd128,_0x4c36f5){var _0x1c3e99=function(_0x2b009f){while(--_0x2b009f){_0x3cd128['push'](_0x3cd128['shift']());}};_0x1c3e99(++_0x4c36f5);}(_0x6156,0x1dd));var _0x6615=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x6156[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0x6615('0x0'));var sequelize=require(_0x6615('0x1'));var moment=require(_0x6615('0x2'));var LIMIT_VALUE=0xfa;exports[_0x6615('0x3')]=function(_0x5b0b70){var _0x5ec9fd=null;if(_0x5b0b70){_0x5ec9fd=_0x5b0b70[_0x6615('0x4')](',');}return _0x5ec9fd;};exports[_0x6615('0x5')]=function(_0x50c5d6,_0x2d21a6){var _0x22dbad={};if(!_[_0x6615('0x6')](_0x50c5d6)){_[_0x6615('0x7')](_0x50c5d6,function(_0x13415b,_0x2c9aba){try{if(_0x2d21a6){var _0x40133b=_[_0x6615('0x8')](_0x2d21a6,{'name':_0x2c9aba})||{};if(_0x40133b[_0x6615('0x9')]===_0x6615('0xa')&&_['isPlainObject'](_0x13415b)){var _0x194448=JSON[_0x6615('0xb')](_0x13415b);var _0x113e16={'$gte':moment(moment(_0x194448[_0x6615('0xc')])[_0x6615('0xd')](_0x6615('0xe')))[_0x6615('0xf')]()[_0x6615('0xd')](),'$lte':moment(moment(_0x194448[_0x6615('0x10')])[_0x6615('0xd')](_0x6615('0xe')))[_0x6615('0xf')]()['subtract'](0x1,'s')[_0x6615('0xd')]()};_0x22dbad[_0x2c9aba]=_0x113e16;}else{_0x22dbad[_0x2c9aba]=_[_0x6615('0x11')](_0x13415b)?_0x13415b:JSON[_0x6615('0xb')](_0x13415b);}}else{_0x22dbad[_0x2c9aba]=_[_0x6615('0x11')](_0x13415b)?_0x13415b:JSON[_0x6615('0xb')](_0x13415b);}}catch(_0xbfa0a3){_0x22dbad[_0x2c9aba]=_0x13415b[_0x6615('0x4')](',');}});}return _0x22dbad;};exports[_0x6615('0x12')]=function(_0x5abc00){_0x5abc00=parseInt(_0x5abc00,0xa);if(!_0x5abc00||_0x5abc00<0x0){_0x5abc00=LIMIT_VALUE;}return _0x5abc00;};exports[_0x6615('0x13')]=function(_0x4a82d8){_0x4a82d8=parseInt(_0x4a82d8,0xa);if(!_0x4a82d8||_0x4a82d8<0x0){_0x4a82d8=0x0;}return _0x4a82d8;};exports['sort']=function(_0x3c3d3c){var _0x596740,_0x1978af=null;if(_0x3c3d3c){_0x596740=_0x3c3d3c[_0x6615('0x4')](',');_0x1978af=_[_0x6615('0x14')](_0x596740,function(_0xda1fa9){if(_0xda1fa9[_0x6615('0x15')]('-')===0x0){return[_0xda1fa9==='priority'?sequelize[_0x6615('0x16')](sequelize[_0x6615('0x17')]('priority'),_0x6615('0x18')):_0xda1fa9[_0x6615('0x19')](0x1),'DESC'];}else{return[_0xda1fa9===_0x6615('0x1a')?sequelize[_0x6615('0x16')](sequelize[_0x6615('0x17')](_0x6615('0x1a')),_0x6615('0x18')):_0xda1fa9,_0x6615('0x1b')];}});}return _0x1978af;};exports[_0x6615('0x1c')]=function(_0x56c43c,_0x594ca4){if(_['isEmpty'](_0x56c43c)){return _0x56c43c;}if(_['isArray'](_0x56c43c)){for(var _0x5691d5=0x0;_0x5691d5<_0x56c43c[_0x6615('0x1d')];_0x5691d5+=0x1){_0x56c43c[_0x5691d5]=this[_0x6615('0x1c')](_0x56c43c[_0x5691d5],_0x594ca4);}return _0x56c43c;}if(!_[_0x6615('0x1e')](_0x56c43c)){return _0x56c43c;}if(_[_0x6615('0x1f')](_0x594ca4)){_0x594ca4=[_0x594ca4];}if(!_[_0x6615('0x11')](_0x594ca4)){return _0x56c43c;}for(var _0x586b3e=0x0;_0x586b3e<_0x594ca4[_0x6615('0x1d')];_0x586b3e+=0x1){_[_0x6615('0x20')](_0x56c43c,_0x594ca4[_0x586b3e]);}for(var _0x9c50b2 in _0x56c43c){if(_0x56c43c[_0x6615('0x21')](_0x9c50b2)){_0x56c43c[_0x9c50b2]=this[_0x6615('0x1c')](_0x56c43c[_0x9c50b2],_0x594ca4);}}return _0x56c43c;};exports['isNumeric']=function(_0x249bd1){return _0x249bd1[_0x6615('0x22')](RegExp(_0x6615('0x23')))?!![]:![];};exports['isEmail']=function(_0x147537){return _0x147537[_0x6615('0x22')](/^\S+@\S+$/)?!![]:![];};exports[_0x6615('0x24')]=function(_0x50e84f){var _0x188bde=[];_0x50e84f['split']('\x20')[_0x6615('0x25')](function(_0x1d58d2){_0x188bde[_0x6615('0x26')]('+'+_0x1d58d2[_0x6615('0x27')]()+'*');});return _0x188bde['join']('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 7736a41..f6b5762 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf5b=['urlencoded','50mb','json','initialize','method-override','cookie-parser','errorhandler','path','passport','moment','../mysqldb','default','get','env','production','set','root','public','test','appPath','join','toISOString','split','use','static','views','/server/views','engine','html','ejs','renderFile','view\x20engine'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbf5b,0x1e4));var _0xbbf5=function(_0xcf22a8,_0x35d51c){_0xcf22a8=_0xcf22a8-0x0;var _0x1137eb=_0xbf5b[_0xcf22a8];return _0x1137eb;};'use strict';var express=require('express');var favicon=require('serve-favicon');var bodyParser=require('body-parser');var methodOverride=require(_0xbbf5('0x0'));var cookieParser=require(_0xbbf5('0x1'));var errorHandler=require(_0xbbf5('0x2'));var path=require(_0xbbf5('0x3'));var passport=require(_0xbbf5('0x4'));var cors=require('cors');var moment=require(_0xbbf5('0x5'));var config=require('./environment');var db=require(_0xbbf5('0x6'))['db'];exports[_0xbbf5('0x7')]=function(_0x31c3d0){var _0xc0d405=_0x31c3d0[_0xbbf5('0x8')](_0xbbf5('0x9'));if(_0xc0d405===_0xbbf5('0xa')){_0x31c3d0[_0xbbf5('0xb')]('appPath',path['join'](config[_0xbbf5('0xc')],_0xbbf5('0xd')));}if(_0xc0d405==='development'||_0xc0d405===_0xbbf5('0xe')){_0x31c3d0[_0xbbf5('0xb')](_0xbbf5('0xf'),path[_0xbbf5('0x10')](config['root'],'client'));_0x31c3d0['use'](errorHandler());}_0x31c3d0['set']('json\x20replacer',function(_0x2cc1b3,_0x4037be){if(this[_0x2cc1b3]instanceof Date){_0x4037be=this[_0x2cc1b3][_0xbbf5('0x11')]()[_0xbbf5('0x12')]('.')[0x0]+'Z';}return _0x4037be;});_0x31c3d0[_0xbbf5('0x13')](express[_0xbbf5('0x14')](_0x31c3d0[_0xbbf5('0x8')]('appPath')));_0x31c3d0[_0xbbf5('0xb')](_0xbbf5('0x15'),config[_0xbbf5('0xc')]+_0xbbf5('0x16'));_0x31c3d0[_0xbbf5('0x17')](_0xbbf5('0x18'),require(_0xbbf5('0x19'))[_0xbbf5('0x1a')]);_0x31c3d0[_0xbbf5('0xb')](_0xbbf5('0x1b'),_0xbbf5('0x18'));_0x31c3d0[_0xbbf5('0x13')](bodyParser[_0xbbf5('0x1c')]({'limit':_0xbbf5('0x1d'),'extended':!![]}));_0x31c3d0[_0xbbf5('0x13')](bodyParser[_0xbbf5('0x1e')]({'limit':'50mb'}));_0x31c3d0[_0xbbf5('0x13')](cors());_0x31c3d0[_0xbbf5('0x13')](methodOverride());_0x31c3d0[_0xbbf5('0x13')](cookieParser());_0x31c3d0['use'](passport[_0xbbf5('0x1f')]());}; \ No newline at end of file +var _0xcc5b=['get','env','production','set','appPath','root','join','client','json\x20replacer','split','static','/server/views','engine','html','renderFile','urlencoded','50mb','use','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','passport','cors','moment','./environment','../mysqldb'];(function(_0x2550ce,_0x45209b){var _0x25748d=function(_0x806ad5){while(--_0x806ad5){_0x2550ce['push'](_0x2550ce['shift']());}};_0x25748d(++_0x45209b);}(_0xcc5b,0x9e));var _0xbcc5=function(_0x233b12,_0x5c7c20){_0x233b12=_0x233b12-0x0;var _0x1fe5d6=_0xcc5b[_0x233b12];return _0x1fe5d6;};'use strict';var express=require('express');var favicon=require(_0xbcc5('0x0'));var bodyParser=require(_0xbcc5('0x1'));var methodOverride=require(_0xbcc5('0x2'));var cookieParser=require(_0xbcc5('0x3'));var errorHandler=require(_0xbcc5('0x4'));var path=require('path');var passport=require(_0xbcc5('0x5'));var cors=require(_0xbcc5('0x6'));var moment=require(_0xbcc5('0x7'));var config=require(_0xbcc5('0x8'));var db=require(_0xbcc5('0x9'))['db'];exports['default']=function(_0xa70825){var _0x260075=_0xa70825[_0xbcc5('0xa')](_0xbcc5('0xb'));if(_0x260075===_0xbcc5('0xc')){_0xa70825[_0xbcc5('0xd')](_0xbcc5('0xe'),path['join'](config[_0xbcc5('0xf')],'public'));}if(_0x260075==='development'||_0x260075==='test'){_0xa70825[_0xbcc5('0xd')](_0xbcc5('0xe'),path[_0xbcc5('0x10')](config[_0xbcc5('0xf')],_0xbcc5('0x11')));_0xa70825['use'](errorHandler());}_0xa70825[_0xbcc5('0xd')](_0xbcc5('0x12'),function(_0x266810,_0x5b7df3){if(this[_0x266810]instanceof Date){_0x5b7df3=this[_0x266810]['toISOString']()[_0xbcc5('0x13')]('.')[0x0]+'Z';}return _0x5b7df3;});_0xa70825['use'](express[_0xbcc5('0x14')](_0xa70825[_0xbcc5('0xa')](_0xbcc5('0xe'))));_0xa70825[_0xbcc5('0xd')]('views',config[_0xbcc5('0xf')]+_0xbcc5('0x15'));_0xa70825[_0xbcc5('0x16')](_0xbcc5('0x17'),require('ejs')[_0xbcc5('0x18')]);_0xa70825['set']('view\x20engine','html');_0xa70825['use'](bodyParser[_0xbcc5('0x19')]({'limit':_0xbcc5('0x1a'),'extended':!![]}));_0xa70825['use'](bodyParser['json']({'limit':_0xbcc5('0x1a')}));_0xa70825['use'](cors());_0xa70825['use'](methodOverride());_0xa70825[_0xbcc5('0x1b')](cookieParser());_0xa70825[_0xbcc5('0x1b')](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index be262e8..89e37d4 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 _0xeec6=['md5','substring','lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','length','family','IPv4','internal','head','mac','address','127.0.0.1','map','model','join','createHash','update','digest','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress'];(function(_0x41b153,_0x46d9c6){var _0x4b139c=function(_0x4ebc49){while(--_0x4ebc49){_0x41b153['push'](_0x41b153['shift']());}};_0x4b139c(++_0x46d9c6);}(_0xeec6,0x1c2));var _0x6eec=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xeec6[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0x6eec('0x0'));var os=require('os');var crypto=require(_0x6eec('0x1'));var machine=require(_0x6eec('0x2'));var exec=require(_0x6eec('0x3'))['execSync'];function getInterfaces(){var _0x471d43=[];var _0x3e4f10=os[_0x6eec('0x4')]();var _0x2d7a15=_[_0x6eec('0x5')](_[_0x6eec('0x6')](_0x3e4f10));for(var _0x4fedce=0x0;_0x4fedce<_0x2d7a15[_0x6eec('0x7')];_0x4fedce++){var _0x3c6eda=_0x3e4f10[_0x2d7a15[_0x4fedce]]['filter'](function(_0x5a5e47){return _0x5a5e47[_0x6eec('0x8')]===_0x6eec('0x9')&&_0x5a5e47[_0x6eec('0xa')]===![];});_0x471d43=_0x471d43['concat'](_0x3c6eda);}return _0x471d43;}function getFirstInterface(){var _0x2be38f=_[_0x6eec('0xb')](getInterfaces());return{'macAddress':_0x2be38f&&_0x2be38f[_0x6eec('0xc')]?_0x2be38f['mac']:'00:00:00:00:00:00','ipAddress':_0x2be38f&&_0x2be38f['address']?_0x2be38f[_0x6eec('0xd')]:_0x6eec('0xe')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x4b8de1=_[_0x6eec('0x5')](os['cpus']()[_0x6eec('0xf')](function(_0x3387c2){return _0x3387c2[_0x6eec('0x10')];}))[_0x6eec('0x11')](':');return crypto[_0x6eec('0x12')]('md5')[_0x6eec('0x13')](_0x4b8de1)[_0x6eec('0x14')](_0x6eec('0x15'));}exports[_0x6eec('0x16')]=function(){switch(os[_0x6eec('0x17')]()){case _0x6eec('0x18'):return exec(_0x6eec('0x19'),{'encoding':_0x6eec('0x1a')})[_0x6eec('0x1b')]('\x0d\x0a','');default:var _0x2ac797=getFirstInterface();var _0x5e2a9b=getCPUhash();var _0x3c0c1b=_0x5e2a9b+'|'+os['hostname']()+'|'+_0x2ac797[_0x6eec('0x1c')]+'|'+_0x2ac797[_0x6eec('0x1d')];var _0x512619=crypto[_0x6eec('0x12')](_0x6eec('0x1e'))[_0x6eec('0x13')](_0x3c0c1b)['digest'](_0x6eec('0x15'));return _0x512619[_0x6eec('0x1f')](0x0,0x8)+'-'+_0x512619[_0x6eec('0x1f')](0x8,0xc)+'-'+_0x512619[_0x6eec('0x1f')](0xc,0x10)+'-'+_0x512619[_0x6eec('0x1f')](0x10,0x14)+'-'+_0x512619[_0x6eec('0x1f')](0x14);}}; \ No newline at end of file +var _0x8ef6=['address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','update','digest','hex','platform','win32','dmidecode\x20--string\x20system-uuid','replace','macAddress','md5','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','keys','filter','family','internal','concat','head','mac','00:00:00:00:00:00'];(function(_0x448d2a,_0xe92e13){var _0xbaaa72=function(_0x485434){while(--_0x485434){_0x448d2a['push'](_0x448d2a['shift']());}};_0xbaaa72(++_0xe92e13);}(_0x8ef6,0xf2));var _0x68ef=function(_0x51e0a2,_0x3ebf9b){_0x51e0a2=_0x51e0a2-0x0;var _0x2dbbef=_0x8ef6[_0x51e0a2];return _0x2dbbef;};'use strict';var _=require(_0x68ef('0x0'));var os=require('os');var crypto=require(_0x68ef('0x1'));var machine=require(_0x68ef('0x2'));var exec=require(_0x68ef('0x3'))[_0x68ef('0x4')];function getInterfaces(){var _0x44e0d3=[];var _0x3411a2=os['networkInterfaces']();var _0x27d0af=_[_0x68ef('0x5')](_[_0x68ef('0x6')](_0x3411a2));for(var _0x2ac782=0x0;_0x2ac782<_0x27d0af['length'];_0x2ac782++){var _0x4f77f3=_0x3411a2[_0x27d0af[_0x2ac782]][_0x68ef('0x7')](function(_0x4740e8){return _0x4740e8[_0x68ef('0x8')]==='IPv4'&&_0x4740e8[_0x68ef('0x9')]===![];});_0x44e0d3=_0x44e0d3[_0x68ef('0xa')](_0x4f77f3);}return _0x44e0d3;}function getFirstInterface(){var _0x1bee73=_[_0x68ef('0xb')](getInterfaces());return{'macAddress':_0x1bee73&&_0x1bee73[_0x68ef('0xc')]?_0x1bee73[_0x68ef('0xc')]:_0x68ef('0xd'),'ipAddress':_0x1bee73&&_0x1bee73[_0x68ef('0xe')]?_0x1bee73[_0x68ef('0xe')]:_0x68ef('0xf')};}exports[_0x68ef('0x10')]=getFirstInterface;function getCPUhash(){var _0xfa6763=_['orderBy'](os[_0x68ef('0x11')]()[_0x68ef('0x12')](function(_0x1e117a){return _0x1e117a[_0x68ef('0x13')];}))[_0x68ef('0x14')](':');return crypto[_0x68ef('0x15')]('md5')[_0x68ef('0x16')](_0xfa6763)[_0x68ef('0x17')](_0x68ef('0x18'));}exports['getUuid']=function(){switch(os[_0x68ef('0x19')]()){case _0x68ef('0x1a'):return exec(_0x68ef('0x1b'),{'encoding':'utf8'})[_0x68ef('0x1c')]('\x0d\x0a','');default:var _0x37c4cc=getFirstInterface();var _0x3d1e90=getCPUhash();var _0x3780a4=_0x3d1e90+'|'+os['hostname']()+'|'+_0x37c4cc[_0x68ef('0x1d')]+'|'+_0x37c4cc['ipAddress'];var _0x5cbb78=crypto[_0x68ef('0x15')](_0x68ef('0x1e'))['update'](_0x3780a4)['digest'](_0x68ef('0x18'));return _0x5cbb78[_0x68ef('0x1f')](0x0,0x8)+'-'+_0x5cbb78[_0x68ef('0x1f')](0x8,0xc)+'-'+_0x5cbb78['substring'](0xc,0x10)+'-'+_0x5cbb78[_0x68ef('0x1f')](0x10,0x14)+'-'+_0x5cbb78[_0x68ef('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index ce7319d..b1d7216 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 _0x2581=['getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','crypto','moment','request-promise','bluebird','version','../../mysqldb','../environment','./hardware','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','GET','catch','createCipher','aes-256-ctr','secrets','session','update','utf8','final','createDecipher','base64','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','then','|reason|','|uuid|','|machineUuid|','|name|','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','get','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','error','message','finally'];(function(_0x348d74,_0x224cd1){var _0x4dc6d6=function(_0x59e50c){while(--_0x59e50c){_0x348d74['push'](_0x348d74['shift']());}};_0x4dc6d6(++_0x224cd1);}(_0x2581,0xcb));var _0x1258=function(_0x3882d7,_0x566a50){_0x3882d7=_0x3882d7-0x0;var _0x566333=_0x2581[_0x3882d7];return _0x566333;};'use strict';var util=require(_0x1258('0x0'));var crypto=require(_0x1258('0x1'));var moment=require(_0x1258('0x2'));var rp=require(_0x1258('0x3'));var BPromise=require(_0x1258('0x4'));var pkginfo=require('pkginfo')(module,_0x1258('0x5'));var db=require(_0x1258('0x6'))['db'];var config=require(_0x1258('0x7'));var hardware=require(_0x1258('0x8'));var logger=require(_0x1258('0x9'))(_0x1258('0xa'));var jira=require(_0x1258('0xb'));var HOST=_0x1258('0xc');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x582ed7){return new BPromise(function(_0x3e1044,_0x21cd98){var _0x468494=util[_0x1258('0xd')](_0x1258('0xe'),HOST,_0x582ed7,module[_0x1258('0xf')][_0x1258('0x5')]);if(oldToken){_0x468494=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x582ed7,module[_0x1258('0xf')][_0x1258('0x5')],oldToken);}var _0x15eea2={'uri':_0x468494,'method':_0x1258('0x10'),'timeout':0xea60,'json':!![]};return rp(_0x15eea2)['then'](function(_0xe0aa84){_0x3e1044(_0xe0aa84);})[_0x1258('0x11')](function(_0x116119){_0x21cd98(_0x116119);});});}function encryptDate(_0x241bad){var _0x57ad9f=crypto[_0x1258('0x12')](_0x1258('0x13'),config[_0x1258('0x14')][_0x1258('0x15')]);var _0x2f9cd6=_0x57ad9f[_0x1258('0x16')](_0x241bad,_0x1258('0x17'),'base64');_0x2f9cd6+=_0x57ad9f[_0x1258('0x18')]('base64');return _0x2f9cd6;}function decryptDate(_0x477502){var _0x19775e=crypto[_0x1258('0x19')](_0x1258('0x13'),config[_0x1258('0x14')]['session']);var _0x1645a6=_0x19775e[_0x1258('0x16')](_0x477502,_0x1258('0x1a'),'utf8');_0x1645a6+=_0x19775e[_0x1258('0x18')](_0x1258('0x17'));return _0x1645a6;}function sendJiraAlert(_0x55c458,_0x2dd7fd,_0x2432b2){var _0x2d3327=_0x1258('0x1b');return db[_0x1258('0x1c')][_0x1258('0x1d')]({'where':{'role':_0x1258('0x1e')},'attributes':[_0x1258('0x1f'),_0x1258('0x20')],'raw':!![]})[_0x1258('0x21')](function(_0x181c8c){ADMIN=_0x181c8c;_0x2d3327+=_0x1258('0x22')+_0x2432b2+'|\x0a';_0x2d3327+=_0x1258('0x23')+_0x55c458+'|\x0a';_0x2d3327+=_0x1258('0x24')+_0x2dd7fd+'|\x0a';_0x2d3327+=_0x1258('0x25')+ADMIN['fullname']+'|\x0a';_0x2d3327+=_0x1258('0x26')+ADMIN['email']+'|\x0a';return _0x2d3327;})['then'](function(_0x4bdf96){var _0x2c661a=hardware[_0x1258('0x27')]()[_0x1258('0x28')];return jira[_0x1258('0x29')]({'key':_0x1258('0x2a'),'summary':_0x1258('0x2b'),'description':_0x4bdf96,'issuetype':'Alert','oldToken':_0x55c458,'newToken':_0x2dd7fd,'email':ADMIN[_0x1258('0x20')],'name':ADMIN[_0x1258('0x1f')],'reason':GRAY_PERIOD_REASON,'ip':_0x2c661a});});}function manageLicense(_0x1cbfd1,_0x195986){var _0x14a77b=_0x195986[_0x1258('0x2c')]({'plain':!![]});httpRequest(_0x1cbfd1)[_0x1258('0x21')](function(_0x126d50){if(oldToken){oldToken=undefined;}if(_0x126d50[_0x1258('0x2d')]){if(!_0x14a77b[_0x1258('0xa')]&&_0x14a77b[_0x1258('0xa')]!=_0x126d50[_0x1258('0xa')]||_0x14a77b[_0x1258('0xa')]&&_0x14a77b['data2']){logger['info'](_0x1258('0x2e'));}if(_0x14a77b['license']&&!_0x14a77b[_0x1258('0x2f')]&&_0x14a77b[_0x1258('0xa')]!=_0x126d50['license']){logger[_0x1258('0x30')](_0x1258('0x31'));}if(_0x14a77b[_0x1258('0xa')]&&!_0x14a77b['data2']&&_0x14a77b['license']==_0x126d50[_0x1258('0xa')]){return _0x195986;}return _0x195986[_0x1258('0x16')]({'data1':_0x1cbfd1,'data2':null,'license':_0x126d50['license']});}else{if(_0x126d50[_0x1258('0xa')]||_0x14a77b['license']){if(!_0x14a77b[_0x1258('0x2f')]){if(_0x14a77b[_0x1258('0x32')]==_0x1cbfd1){GRAY_PERIOD_REASON=_0x1258('0x33');logger[_0x1258('0x30')](_0x1258('0x34'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x14a77b['data1'];logger[_0x1258('0x30')](_0x1258('0x35'),_0x14a77b[_0x1258('0x32')],_0x1cbfd1);}sendJiraAlert(_0x14a77b[_0x1258('0x32')],_0x126d50[_0x1258('0x36')],GRAY_PERIOD_REASON);logger[_0x1258('0x30')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x1258('0xd')](_0x1258('0x37')));return _0x195986['update']({'data2':encryptDate(moment()['format']('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](decryptDate(_0x14a77b[_0x1258('0x2f')]),_0x1258('0x38'))>DAYS){logger[_0x1258('0x30')](_0x1258('0x39'),moment()[_0x1258('0xd')](_0x1258('0x37')));return _0x195986[_0x1258('0x16')]({'data1':_0x1cbfd1,'data2':null,'license':null});}}}else{if(_0x14a77b[_0x1258('0x32')]!=_0x1cbfd1){logger[_0x1258('0x30')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x14a77b['data1'],_0x1cbfd1);return _0x195986[_0x1258('0x16')]({'data1':_0x1cbfd1,'data2':null,'license':null});}}}return _0x195986;})['then'](function(_0x2d2183){_0x195986=_0x2d2183;})['catch'](function(_0x36c36e){logger[_0x1258('0x3a')](_0x36c36e[_0x1258('0x3b')]);})[_0x1258('0x3c')](function(){setTimeout(function(){manageLicense(hardware[_0x1258('0x3d')](),_0x195986);},TIME);});}function defaultLicense(){var _0x410acb=hardware[_0x1258('0x3d')]();if(_0x410acb){return db[_0x1258('0x3e')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x410acb}})[_0x1258('0x3f')](function(_0x15cfa9,_0x3c77e9){logger[_0x1258('0x30')](_0x1258('0x40'),_0x410acb);manageLicense(_0x410acb,_0x15cfa9);})[_0x1258('0x11')](function(_0x5e7e41){logger['error'](_0x5e7e41[_0x1258('0x3b')]);});}}exports[_0x1258('0x41')]=defaultLicense; \ No newline at end of file +var _0x86c0=['license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','uuid','format','YYYY-MM-DD\x20HH:mm','diff','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','bluebird','pkginfo','../../mysqldb','../environment','./hardware','../logger','../../api/jira/jira.controller','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','version','GET','then','catch','secrets','update','base64','final','createDecipher','aes-256-ctr','utf8','||FIELD||VALUE||\x0a','User','email','|reason|','|machineUuid|','|name|','fullname','|email|','ipAddress','Motion\x20License\x20Alert','get'];(function(_0x8a0136,_0x23b4b2){var _0x33789b=function(_0x5bccf0){while(--_0x5bccf0){_0x8a0136['push'](_0x8a0136['shift']());}};_0x33789b(++_0x23b4b2);}(_0x86c0,0x133));var _0x086c=function(_0x23403a,_0x268c35){_0x23403a=_0x23403a-0x0;var _0x685413=_0x86c0[_0x23403a];return _0x685413;};'use strict';var util=require(_0x086c('0x0'));var crypto=require('crypto');var moment=require(_0x086c('0x1'));var rp=require(_0x086c('0x2'));var BPromise=require(_0x086c('0x3'));var pkginfo=require(_0x086c('0x4'))(module,'version');var db=require(_0x086c('0x5'))['db'];var config=require(_0x086c('0x6'));var hardware=require(_0x086c('0x7'));var logger=require(_0x086c('0x8'))('license');var jira=require(_0x086c('0x9'));var HOST=_0x086c('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x2e27a8){return new BPromise(function(_0x387428,_0x117df9){var _0x25e437=util['format'](_0x086c('0xb'),HOST,_0x2e27a8,module[_0x086c('0xc')][_0x086c('0xd')]);if(oldToken){_0x25e437=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x2e27a8,module[_0x086c('0xc')][_0x086c('0xd')],oldToken);}var _0x1a7147={'uri':_0x25e437,'method':_0x086c('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x1a7147)[_0x086c('0xf')](function(_0x583d55){_0x387428(_0x583d55);})[_0x086c('0x10')](function(_0x43f1fd){_0x117df9(_0x43f1fd);});});}function encryptDate(_0x2e6783){var _0x3d7cde=crypto['createCipher']('aes-256-ctr',config[_0x086c('0x11')]['session']);var _0x1c1946=_0x3d7cde[_0x086c('0x12')](_0x2e6783,'utf8',_0x086c('0x13'));_0x1c1946+=_0x3d7cde[_0x086c('0x14')](_0x086c('0x13'));return _0x1c1946;}function decryptDate(_0x2db80a){var _0x587053=crypto[_0x086c('0x15')](_0x086c('0x16'),config[_0x086c('0x11')]['session']);var _0x34e74f=_0x587053[_0x086c('0x12')](_0x2db80a,_0x086c('0x13'),_0x086c('0x17'));_0x34e74f+=_0x587053[_0x086c('0x14')]('utf8');return _0x34e74f;}function sendJiraAlert(_0x5463d6,_0x3bac0c,_0x1511f2){var _0x1e80c2=_0x086c('0x18');return db[_0x086c('0x19')]['findOne']({'where':{'role':'admin'},'attributes':['fullname',_0x086c('0x1a')],'raw':!![]})[_0x086c('0xf')](function(_0x5b8565){ADMIN=_0x5b8565;_0x1e80c2+=_0x086c('0x1b')+_0x1511f2+'|\x0a';_0x1e80c2+='|uuid|'+_0x5463d6+'|\x0a';_0x1e80c2+=_0x086c('0x1c')+_0x3bac0c+'|\x0a';_0x1e80c2+=_0x086c('0x1d')+ADMIN[_0x086c('0x1e')]+'|\x0a';_0x1e80c2+=_0x086c('0x1f')+ADMIN['email']+'|\x0a';return _0x1e80c2;})[_0x086c('0xf')](function(_0x56a794){var _0x48490b=hardware['getFirstInterface']()[_0x086c('0x20')];return jira['openIssue']({'key':'MOTLICENSE','summary':_0x086c('0x21'),'description':_0x56a794,'issuetype':'Alert','oldToken':_0x5463d6,'newToken':_0x3bac0c,'email':ADMIN[_0x086c('0x1a')],'name':ADMIN[_0x086c('0x1e')],'reason':GRAY_PERIOD_REASON,'ip':_0x48490b});});}function manageLicense(_0x57507b,_0x591b0d){var _0x317d7b=_0x591b0d[_0x086c('0x22')]({'plain':!![]});httpRequest(_0x57507b)[_0x086c('0xf')](function(_0x3fe25f){if(oldToken){oldToken=undefined;}if(_0x3fe25f['active']){if(!_0x317d7b[_0x086c('0x23')]&&_0x317d7b[_0x086c('0x23')]!=_0x3fe25f['license']||_0x317d7b['license']&&_0x317d7b['data2']){logger[_0x086c('0x24')](_0x086c('0x25'));}if(_0x317d7b['license']&&!_0x317d7b[_0x086c('0x26')]&&_0x317d7b['license']!=_0x3fe25f[_0x086c('0x23')]){logger[_0x086c('0x24')](_0x086c('0x27'));}if(_0x317d7b['license']&&!_0x317d7b[_0x086c('0x26')]&&_0x317d7b[_0x086c('0x23')]==_0x3fe25f['license']){return _0x591b0d;}return _0x591b0d['update']({'data1':_0x57507b,'data2':null,'license':_0x3fe25f[_0x086c('0x23')]});}else{if(_0x3fe25f['license']||_0x317d7b[_0x086c('0x23')]){if(!_0x317d7b['data2']){if(_0x317d7b[_0x086c('0x28')]==_0x57507b){GRAY_PERIOD_REASON=_0x086c('0x29');logger['info'](_0x086c('0x2a'));}else{GRAY_PERIOD_REASON=_0x086c('0x2b');oldToken=_0x317d7b[_0x086c('0x28')];logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x317d7b['data1'],_0x57507b);}sendJiraAlert(_0x317d7b['data1'],_0x3fe25f[_0x086c('0x2c')],GRAY_PERIOD_REASON);logger[_0x086c('0x24')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x086c('0x2d')](_0x086c('0x2e')));return _0x591b0d[_0x086c('0x12')]({'data2':encryptDate(moment()[_0x086c('0x2d')](_0x086c('0x2e')))});}else{if(moment()[_0x086c('0x2f')](decryptDate(_0x317d7b['data2']),_0x086c('0x30'))>DAYS){logger[_0x086c('0x24')]('DEMO\x20START\x20AT\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x591b0d[_0x086c('0x12')]({'data1':_0x57507b,'data2':null,'license':null});}}}else{if(_0x317d7b['data1']!=_0x57507b){logger[_0x086c('0x24')](_0x086c('0x31'),_0x317d7b['data1'],_0x57507b);return _0x591b0d[_0x086c('0x12')]({'data1':_0x57507b,'data2':null,'license':null});}}}return _0x591b0d;})['then'](function(_0x51a409){_0x591b0d=_0x51a409;})['catch'](function(_0x2fd3a4){logger[_0x086c('0x32')](_0x2fd3a4[_0x086c('0x33')]);})[_0x086c('0x34')](function(){setTimeout(function(){manageLicense(hardware[_0x086c('0x35')](),_0x591b0d);},TIME);});}function defaultLicense(){var _0x1f42d6=hardware[_0x086c('0x35')]();if(_0x1f42d6){return db[_0x086c('0x36')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x1f42d6}})[_0x086c('0x37')](function(_0x3d6ba1,_0xa910c1){logger[_0x086c('0x24')](_0x086c('0x38'),_0x1f42d6);manageLicense(_0x1f42d6,_0x3d6ba1);})[_0x086c('0x10')](function(_0x3d3437){logger[_0x086c('0x32')](_0x3d3437[_0x086c('0x33')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 6d63534..cc3c444 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 _0x24ab=['2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','getLicense','defaults','then','checkLicense','crypto','util','lodash','moment','./hardware','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','aes-256-ctr','format','base64','utf8','final','parse','demo','uuid','machineUuid','getUuid','secrets','gray','add','days','grayReason','disabled'];(function(_0xe368ad,_0x24ea9c){var _0x8fabb0=function(_0x1845e0){while(--_0x1845e0){_0xe368ad['push'](_0xe368ad['shift']());}};_0x8fabb0(++_0x24ea9c);}(_0x24ab,0x1c4));var _0xb24a=function(_0x45ce51,_0x170ba8){_0x45ce51=_0x45ce51-0x0;var _0x2fdd48=_0x24ab[_0x45ce51];return _0x2fdd48;};'use strict';var crypto=require(_0xb24a('0x0'));var util=require(_0xb24a('0x1'));var _=require(_0xb24a('0x2'));var moment=require(_0xb24a('0x3'));var hardware=require(_0xb24a('0x4'));var config=require(_0xb24a('0x5'));var db=require(_0xb24a('0x6'))['db'];function checkLicense(_0x20aca1,_0x494109){if(_0x20aca1){try{var _0x1d309e=_0x494109||_0x20aca1[_0xb24a('0x7')];if(_[_0xb24a('0x8')](_0x1d309e)){throw new Error(_0xb24a('0x9'));}var _0x1b3e7c=_0x20aca1[_0xb24a('0xa')];var _0x430b9d=_0x20aca1[_0xb24a('0xb')];var _0x588d0e=_0x1b3e7c[_0xb24a('0xc')]('-')[0x4];var _0x1640ac=_0x1b3e7c[_0xb24a('0xc')]('-')[0x0];var _0x2d2825=crypto['createDecipher'](_0xb24a('0xd'),util[_0xb24a('0xe')]('%s:%s:%s',_0x588d0e,_0x1b3e7c,_0x1640ac));var _0x219c5c=_0x2d2825['update'](_0x1d309e,_0xb24a('0xf'),_0xb24a('0x10'));_0x219c5c+=_0x2d2825[_0xb24a('0x11')](_0xb24a('0x10'));var _0xd24047=JSON[_0xb24a('0x12')](_0x219c5c);_0xd24047[_0xb24a('0x13')]=![];_0xd24047[_0xb24a('0x14')]=_0x1b3e7c;_0xd24047[_0xb24a('0x15')]=hardware[_0xb24a('0x16')]();if(_0x430b9d){var _0x1de3fc=crypto['createDecipher'](_0xb24a('0xd'),config[_0xb24a('0x17')]['session']);var _0x511796=_0x1de3fc['update'](_0x430b9d,'base64',_0xb24a('0x10'));_0x511796+=_0x1de3fc[_0xb24a('0x11')](_0xb24a('0x10'));_0xd24047[_0xb24a('0x18')]=_0x511796;_0xd24047['deadline']=moment(_0x511796)[_0xb24a('0x19')](0x7,_0xb24a('0x1a'))['format']();_0xd24047[_0xb24a('0x1b')]=_0xd24047[_0xb24a('0x14')]!=_0xd24047[_0xb24a('0x15')]?'changed':_0xb24a('0x1c');}return _0xd24047;}catch(_0x33ea1f){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb24a('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xb24a('0x1e'),'uuid':_0x20aca1['data1'],'machineUuid':hardware[_0xb24a('0x16')](),'message':_0x33ea1f[_0xb24a('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xb24a('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xb24a('0x20'),'uuid':_0x20aca1[_0xb24a('0xa')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports[_0xb24a('0x21')]=function(_0x4f69ce){return db['License']['find'](_[_0xb24a('0x22')](_0x4f69ce,{'raw':!![],'where':{'id':0x1}}))[_0xb24a('0x23')](function(_0x36bc5f){return checkLicense(_0x36bc5f,null);});};exports[_0xb24a('0x24')]=checkLicense; \ No newline at end of file +var _0x1eb7=['getLicense','find','defaults','then','checkLicense','crypto','util','lodash','./hardware','../environment','../../mysqldb','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','format','%s:%s:%s','update','base64','final','utf8','parse','demo','getUuid','aes-256-ctr','secrets','session','add','days','grayReason','machineUuid','changed','disabled','2027-01-01T00:00:00.000Z','message'];(function(_0x4861ba,_0x3e20e4){var _0x250a6e=function(_0x55864f){while(--_0x55864f){_0x4861ba['push'](_0x4861ba['shift']());}};_0x250a6e(++_0x3e20e4);}(_0x1eb7,0x135));var _0x71eb=function(_0x5440fc,_0x74219b){_0x5440fc=_0x5440fc-0x0;var _0x2ca61f=_0x1eb7[_0x5440fc];return _0x2ca61f;};'use strict';var crypto=require(_0x71eb('0x0'));var util=require(_0x71eb('0x1'));var _=require(_0x71eb('0x2'));var moment=require('moment');var hardware=require(_0x71eb('0x3'));var config=require(_0x71eb('0x4'));var db=require(_0x71eb('0x5'))['db'];function checkLicense(_0x2efd7c,_0x594dbb){if(_0x2efd7c){try{var _0x35caa3=_0x594dbb||_0x2efd7c[_0x71eb('0x6')];if(_[_0x71eb('0x7')](_0x35caa3)){throw new Error(_0x71eb('0x8'));}var _0x41f419=_0x2efd7c[_0x71eb('0x9')];var _0x1d882e=_0x2efd7c[_0x71eb('0xa')];var _0x1cb98d=_0x41f419[_0x71eb('0xb')]('-')[0x4];var _0x1cf98f=_0x41f419[_0x71eb('0xb')]('-')[0x0];var _0x45fcfe=crypto[_0x71eb('0xc')]('aes-256-ctr',util[_0x71eb('0xd')](_0x71eb('0xe'),_0x1cb98d,_0x41f419,_0x1cf98f));var _0x19f9a6=_0x45fcfe[_0x71eb('0xf')](_0x35caa3,_0x71eb('0x10'),'utf8');_0x19f9a6+=_0x45fcfe[_0x71eb('0x11')](_0x71eb('0x12'));var _0x5338ca=JSON[_0x71eb('0x13')](_0x19f9a6);_0x5338ca[_0x71eb('0x14')]=![];_0x5338ca['uuid']=_0x41f419;_0x5338ca['machineUuid']=hardware[_0x71eb('0x15')]();if(_0x1d882e){var _0x302915=crypto[_0x71eb('0xc')](_0x71eb('0x16'),config[_0x71eb('0x17')][_0x71eb('0x18')]);var _0x3e6cd0=_0x302915['update'](_0x1d882e,'base64','utf8');_0x3e6cd0+=_0x302915[_0x71eb('0x11')](_0x71eb('0x12'));_0x5338ca['gray']=_0x3e6cd0;_0x5338ca['deadline']=moment(_0x3e6cd0)[_0x71eb('0x19')](0x7,_0x71eb('0x1a'))[_0x71eb('0xd')]();_0x5338ca[_0x71eb('0x1b')]=_0x5338ca['uuid']!=_0x5338ca[_0x71eb('0x1c')]?_0x71eb('0x1d'):_0x71eb('0x1e');}return _0x5338ca;}catch(_0x36a412){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x71eb('0x1f'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x2efd7c['data1'],'machineUuid':hardware[_0x71eb('0x15')](),'message':_0x36a412[_0x71eb('0x20')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x2efd7c['data1'],'machineUuid':hardware[_0x71eb('0x15')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};}exports[_0x71eb('0x21')]=function(_0x442553){return db['License'][_0x71eb('0x22')](_[_0x71eb('0x23')](_0x442553,{'raw':!![],'where':{'id':0x1}}))[_0x71eb('0x24')](function(_0x290ba6){return checkLicense(_0x290ba6,null);});};exports[_0x71eb('0x25')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index c8a14c6..4988b7f 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 _0x2116=['secret','http://localhost:9000','app-id'];(function(_0x4d2f00,_0x4e94d5){var _0x2d7b7f=function(_0x18fa08){while(--_0x18fa08){_0x4d2f00['push'](_0x4d2f00['shift']());}};_0x2d7b7f(++_0x4e94d5);}(_0x2116,0x67));var _0x6211=function(_0x5dc453,_0x2b085f){_0x5dc453=_0x5dc453-0x0;var _0x350b31=_0x2116[_0x5dc453];return _0x350b31;};'use strict';module['exports']={'DOMAIN':_0x6211('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x6211('0x1'),'GOOGLE_SECRET':_0x6211('0x2'),'DEBUG':''}; \ No newline at end of file +var _0xd950=['http://localhost:9000','app-id','secret','exports'];(function(_0x436c3c,_0x192e6c){var _0x29d9d7=function(_0x308cc7){while(--_0x308cc7){_0x436c3c['push'](_0x436c3c['shift']());}};_0x29d9d7(++_0x192e6c);}(_0xd950,0x17f));var _0x0d95=function(_0xbb6f95,_0x4017fc){_0xbb6f95=_0xbb6f95-0x0;var _0x34ce0b=_0xd950[_0xbb6f95];return _0x34ce0b;};'use strict';module[_0x0d95('0x0')]={'DOMAIN':_0x0d95('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x0d95('0x2'),'GOOGLE_SECRET':_0x0d95('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 7c71504..90bc01a 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb641=['util','path','INFO','join','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','exports','Logger','transports','%s-%s','error','File','info','Console','debugLevel','moment'];(function(_0xa59245,_0x1f1951){var _0x7ad812=function(_0x1bfe97){while(--_0x1bfe97){_0xa59245['push'](_0xa59245['shift']());}};_0x7ad812(++_0x1f1951);}(_0xb641,0xa7));var _0x1b64=function(_0x7ae0fc,_0x10a6a7){_0x7ae0fc=_0x7ae0fc-0x0;var _0x343bed=_0xb641[_0x7ae0fc];return _0x343bed;};'use strict';var moment=require(_0x1b64('0x0'));var winston=require('winston');var util=require(_0x1b64('0x1'));var path=require(_0x1b64('0x2'));var debugLevel=_0x1b64('0x3');function filename(_0x9a9ae5,_0x785411){return path[_0x1b64('0x4')]('/var',_0x1b64('0x5'),_0x1b64('0x6'),util[_0x1b64('0x7')](_0x1b64('0x8'),_0x9a9ae5,_0x785411));}function formatter(_0x41f594,_0x526f45){return util[_0x1b64('0x7')](_0x1b64('0x9'),moment()['format'](_0x1b64('0xa')),_0x526f45[_0x1b64('0xb')]['toUpperCase'](),_0x41f594,_0x526f45['message']);}module[_0x1b64('0xc')]=function(_0x2f66f1){return new winston[(_0x1b64('0xd'))]({'transports':[new winston[(_0x1b64('0xe'))]['File']({'name':util[_0x1b64('0x7')](_0x1b64('0xf'),_0x2f66f1,_0x1b64('0x10')),'filename':filename(_0x2f66f1,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x40c946){return formatter(_0x2f66f1,_0x40c946);}}),new winston[(_0x1b64('0xe'))][(_0x1b64('0x11'))]({'name':util['format'](_0x1b64('0xf'),_0x2f66f1,'info'),'filename':filename(_0x2f66f1,'info'),'level':_0x1b64('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x17d3ef){return formatter(_0x2f66f1,_0x17d3ef);}}),new winston[(_0x1b64('0xe'))][(_0x1b64('0x13'))]({'level':process['env'][_0x1b64('0x14')]||debugLevel,'json':![],'formatter':function(_0x12c750){return formatter(_0x2f66f1,_0x12c750);}})]});}; \ No newline at end of file +var _0x5af1=['INFO','join','/var','log','xcally','format','%s-%s.log','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','message','exports','Logger','transports','%s-%s','error','info','Console','env','debugLevel','winston','util'];(function(_0x58c982,_0x5e78ca){var _0x17a286=function(_0xd6009b){while(--_0xd6009b){_0x58c982['push'](_0x58c982['shift']());}};_0x17a286(++_0x5e78ca);}(_0x5af1,0x1b6));var _0x15af=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0x5af1[_0xfcbcb8];return _0x1b1f97;};'use strict';var moment=require('moment');var winston=require(_0x15af('0x0'));var util=require(_0x15af('0x1'));var path=require('path');var debugLevel=_0x15af('0x2');function filename(_0xf186f1,_0x2badfc){return path[_0x15af('0x3')](_0x15af('0x4'),_0x15af('0x5'),_0x15af('0x6'),util[_0x15af('0x7')](_0x15af('0x8'),_0xf186f1,_0x2badfc));}function formatter(_0x2fb528,_0x2141de){return util[_0x15af('0x7')](_0x15af('0x9'),moment()[_0x15af('0x7')](_0x15af('0xa')),_0x2141de['level'][_0x15af('0xb')](),_0x2fb528,_0x2141de[_0x15af('0xc')]);}module[_0x15af('0xd')]=function(_0x2aee8e){return new winston[(_0x15af('0xe'))]({'transports':[new winston[(_0x15af('0xf'))]['File']({'name':util['format'](_0x15af('0x10'),_0x2aee8e,_0x15af('0x11')),'filename':filename(_0x2aee8e,_0x15af('0x11')),'level':_0x15af('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4ab31e){return formatter(_0x2aee8e,_0x4ab31e);}}),new winston[(_0x15af('0xf'))]['File']({'name':util[_0x15af('0x7')](_0x15af('0x10'),_0x2aee8e,_0x15af('0x12')),'filename':filename(_0x2aee8e,_0x15af('0x12')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x392b10){return formatter(_0x2aee8e,_0x392b10);}}),new winston[(_0x15af('0xf'))][(_0x15af('0x13'))]({'level':process[_0x15af('0x14')][_0x15af('0x15')]||debugLevel,'json':![],'formatter':function(_0x20ccf4){return formatter(_0x2aee8e,_0x20ccf4);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index bc9ec30..5e27781 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 _0xa4b0=['express','join','../../services/express/index.js','email','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa4b0,0x15d));var _0x0a4b=function(_0x2ce347,_0x860561){_0x2ce347=_0x2ce347-0x0;var _0x2ddbdf=_0xa4b0[_0x2ce347];return _0x2ddbdf;};'use strict';var path=require(_0x0a4b('0x0'));var os=require('os');var config={'apps':[{'name':_0x0a4b('0x1'),'script':path[_0x0a4b('0x2')](__dirname,_0x0a4b('0x3'))},{'name':'ami','script':path[_0x0a4b('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0x0a4b('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x0a4b('0x4'),'script':path[_0x0a4b('0x2')](__dirname,'../../services/email/index.js')},{'name':_0x0a4b('0x5'),'script':path[_0x0a4b('0x2')](__dirname,_0x0a4b('0x6'))},{'name':_0x0a4b('0x7'),'script':path[_0x0a4b('0x2')](__dirname,_0x0a4b('0x8'))}]};module[_0x0a4b('0x9')]=config; \ No newline at end of file +var _0x1f27=['../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','ami'];(function(_0x1f84a2,_0x5daa96){var _0x334969=function(_0x3953f7){while(--_0x3953f7){_0x1f84a2['push'](_0x1f84a2['shift']());}};_0x334969(++_0x5daa96);}(_0x1f27,0x13d));var _0x71f2=function(_0x5139d0,_0x57279a){_0x5139d0=_0x5139d0-0x0;var _0x157fda=_0x1f27[_0x5139d0];return _0x157fda;};'use strict';var path=require(_0x71f2('0x0'));var os=require('os');var config={'apps':[{'name':_0x71f2('0x1'),'script':path[_0x71f2('0x2')](__dirname,_0x71f2('0x3'))},{'name':_0x71f2('0x4'),'script':path[_0x71f2('0x2')](__dirname,_0x71f2('0x5'))},{'name':_0x71f2('0x6'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0x71f2('0x7'),'script':path[_0x71f2('0x2')](__dirname,_0x71f2('0x8'))},{'name':_0x71f2('0x9'),'script':path['join'](__dirname,_0x71f2('0xa'))},{'name':_0x71f2('0xb'),'script':path[_0x71f2('0x2')](__dirname,_0x71f2('0xc'))}]};module[_0x71f2('0xd')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 865d32e..ec23313 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 _0x680a=['connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','./config'];(function(_0x48b2e3,_0x4a35ce){var _0x2334bf=function(_0x5abfe7){while(--_0x5abfe7){_0x48b2e3['push'](_0x48b2e3['shift']());}};_0x2334bf(++_0x4a35ce);}(_0x680a,0xde));var _0xa680=function(_0x29cfd1,_0x461f4c){_0x29cfd1=_0x29cfd1-0x0;var _0x6a1162=_0x680a[_0x29cfd1];return _0x6a1162;};'use strict';var pm2=require(_0xa680('0x0'));var BPromise=require('bluebird');var config=require(_0xa680('0x1'));function connect(){return new BPromise(function(_0x249932,_0x1dfdda){return pm2[_0xa680('0x2')](function(_0x55940d){if(_0x55940d){return _0x1dfdda(_0x55940d);}return _0x249932(_0xa680('0x3'));});});};exports[_0xa680('0x4')]=function(_0xd56252){return connect()[_0xa680('0x5')](function(){return new BPromise(function(_0x48212b,_0x427a32){return pm2['start'](_0xd56252,function(_0x142760,_0x5c709c){if(_0x142760){return _0x427a32(_0x142760);}pm2[_0xa680('0x6')]();return _0x48212b(_0x5c709c);});});});};exports['stop']=function(_0x544e52){return connect()[_0xa680('0x5')](function(){return new BPromise(function(_0x11fcfb,_0x4cb821){return pm2[_0xa680('0x7')](_0x544e52,function(_0x1d7da2,_0x111d59){if(_0x1d7da2){return _0x4cb821(_0x1d7da2);}pm2['disconnect']();return _0x11fcfb(_0x111d59);});});});};exports[_0xa680('0x8')]=function(_0x12990d){return connect()[_0xa680('0x5')](function(){return new BPromise(function(_0x1512ed,_0x205152){return pm2['restart'](_0x12990d,function(_0x1ed8c7,_0x2360f5){if(_0x1ed8c7){return _0x205152(_0x1ed8c7);}pm2[_0xa680('0x6')]();return _0x1512ed(_0x2360f5);});});});};exports[_0xa680('0x9')]=function(){return connect()[_0xa680('0x5')](function(){return new BPromise(function(_0x4f1448,_0x470000){return pm2['list'](function(_0x5a5b41,_0x264018){if(_0x5a5b41){return _0x470000(_0x5a5b41);}pm2['disconnect']();return _0x4f1448(_0x264018);});});});};exports[_0xa680('0xa')]=function(_0x262c7f){return connect()['then'](function(){return new BPromise(function(_0x3c004c,_0x1581b0){return pm2[_0xa680('0xa')](_0x262c7f,function(_0x244bf,_0x3b59a3){if(_0x244bf){return _0x1581b0(_0x244bf);}pm2[_0xa680('0x6')]();return _0x3c004c(_0x3b59a3);});});});};exports[_0xa680('0xb')]=function(_0x1e854f){return connect()[_0xa680('0x5')](function(){return new BPromise(function(_0x1bdb7b,_0x11d5dd){return pm2[_0xa680('0xb')](_0x1e854f,function(_0x38d843,_0x3e7c2a){if(_0x38d843){return _0x11d5dd(_0x38d843);}pm2['disconnect']();return _0x1bdb7b(_0x3e7c2a);});});});};exports[_0xa680('0xc')]=function(){return connect()[_0xa680('0x5')](function(){return new BPromise(function(_0x540c7a,_0x406c63){return pm2['dump'](function(_0x4ac643){if(_0x4ac643){return _0x406c63(_0x4ac643);}return _0x540c7a(_0xa680('0xd'));});});});}; \ No newline at end of file +var _0x433a=['dump','saved','pm2','bluebird','./config','connect','connected','then','start','disconnect','stop','restart','list','describe','delete'];(function(_0xdd251a,_0x519fe9){var _0x1ca5c1=function(_0x24b8e3){while(--_0x24b8e3){_0xdd251a['push'](_0xdd251a['shift']());}};_0x1ca5c1(++_0x519fe9);}(_0x433a,0x14c));var _0xa433=function(_0x309876,_0x1aca9a){_0x309876=_0x309876-0x0;var _0x18f6e7=_0x433a[_0x309876];return _0x18f6e7;};'use strict';var pm2=require(_0xa433('0x0'));var BPromise=require(_0xa433('0x1'));var config=require(_0xa433('0x2'));function connect(){return new BPromise(function(_0x57aaa9,_0x29307f){return pm2[_0xa433('0x3')](function(_0x22ac7b){if(_0x22ac7b){return _0x29307f(_0x22ac7b);}return _0x57aaa9(_0xa433('0x4'));});});};exports['start']=function(_0x22f282){return connect()[_0xa433('0x5')](function(){return new BPromise(function(_0x5cfa34,_0x333987){return pm2[_0xa433('0x6')](_0x22f282,function(_0x406fd6,_0x1832ef){if(_0x406fd6){return _0x333987(_0x406fd6);}pm2[_0xa433('0x7')]();return _0x5cfa34(_0x1832ef);});});});};exports['stop']=function(_0x320aa5){return connect()[_0xa433('0x5')](function(){return new BPromise(function(_0x4accfe,_0x16117d){return pm2[_0xa433('0x8')](_0x320aa5,function(_0x21e1b3,_0x364115){if(_0x21e1b3){return _0x16117d(_0x21e1b3);}pm2[_0xa433('0x7')]();return _0x4accfe(_0x364115);});});});};exports[_0xa433('0x9')]=function(_0x2a87cc){return connect()[_0xa433('0x5')](function(){return new BPromise(function(_0x1dee43,_0x2f6634){return pm2['restart'](_0x2a87cc,function(_0x31918b,_0x2faac1){if(_0x31918b){return _0x2f6634(_0x31918b);}pm2[_0xa433('0x7')]();return _0x1dee43(_0x2faac1);});});});};exports[_0xa433('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1daf25,_0x1bda6c){return pm2[_0xa433('0xa')](function(_0x202e57,_0x2c8f21){if(_0x202e57){return _0x1bda6c(_0x202e57);}pm2[_0xa433('0x7')]();return _0x1daf25(_0x2c8f21);});});});};exports[_0xa433('0xb')]=function(_0x224a3a){return connect()['then'](function(){return new BPromise(function(_0x3b1d87,_0x4f469a){return pm2[_0xa433('0xb')](_0x224a3a,function(_0x4aa931,_0x3b8323){if(_0x4aa931){return _0x4f469a(_0x4aa931);}pm2[_0xa433('0x7')]();return _0x3b1d87(_0x3b8323);});});});};exports[_0xa433('0xc')]=function(_0x1bc01f){return connect()[_0xa433('0x5')](function(){return new BPromise(function(_0x2ac493,_0x2cf11a){return pm2[_0xa433('0xc')](_0x1bc01f,function(_0x304549,_0x24cd21){if(_0x304549){return _0x2cf11a(_0x304549);}pm2[_0xa433('0x7')]();return _0x2ac493(_0x24cd21);});});});};exports[_0xa433('0xd')]=function(){return connect()['then'](function(){return new BPromise(function(_0x4c1e24,_0x3f23f9){return pm2[_0xa433('0xd')](function(_0x15c707){if(_0x15c707){return _0x3f23f9(_0x15c707);}return _0x4c1e24(_0xa433('0xe'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 3772a5f..2e19783 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 _0x8242=['update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','chatInteraction:update','catch','error','lodash','ioredis','../../config/environment','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','minutes','then'];(function(_0x5975b2,_0x396502){var _0x440c7b=function(_0x5ec2e5){while(--_0x5ec2e5){_0x5975b2['push'](_0x5975b2['shift']());}};_0x440c7b(++_0x396502);}(_0x8242,0x112));var _0x2824=function(_0x533745,_0x7810e8){_0x533745=_0x533745-0x0;var _0x5d5de7=_0x8242[_0x533745];return _0x5d5de7;};'use strict';var _=require(_0x2824('0x0'));var moment=require('moment');var Redis=require(_0x2824('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x2824('0x2'));config[_0x2824('0x3')]=_[_0x2824('0x4')](config[_0x2824('0x3')],{'host':_0x2824('0x5'),'port':0x18eb});var io=require(_0x2824('0x6'))(new Redis(config[_0x2824('0x3')]));function closeInteractions(){var _0x47b0f5=0x0;var _0x5d6c5c=[];return db['Setting'][_0x2824('0x7')]({'raw':!![],'attributes':['id',_0x2824('0x8')],'where':{'id':0x1}})['then'](function(_0x46eca5){_0x47b0f5=_0x46eca5[_0x2824('0x8')];if(_0x47b0f5){return db[_0x2824('0x9')][_0x2824('0xa')]({'raw':!![],'attributes':['id',_0x2824('0xb')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x46eca5[_0x2824('0x8')],_0x2824('0xc'))}}});}else{return[];}})[_0x2824('0xd')](function(_0x5493e9){_0x5d6c5c=_0x5493e9;if(_0x47b0f5){return db[_0x2824('0x9')][_0x2824('0xe')]({'closeReason':_0x2824('0xf'),'disposition':_0x2824('0x10'),'closed':!![],'closedAt':moment()[_0x2824('0x11')](_0x2824('0x12'))},{'where':{'id':_['map'](_0x5d6c5c||[],'id')}});}})[_0x2824('0xd')](function(_0x1594ce){for(var _0x54be95=0x0;_0x54be95<_0x5d6c5c[_0x2824('0x13')];_0x54be95++){io[_0x2824('0x14')](_0x2824('0x15'),{'id':_0x5d6c5c[_0x54be95]['id'],'closed':!![]});}})[_0x2824('0x16')](function(_0x3fcd8e){console[_0x2824('0x17')](_0x3fcd8e);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd0ec=['minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','chatInteraction:update','catch','error','start','moment','../../config/environment','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','subtract'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xd0ec,0xfc));var _0xcd0e=function(_0x48adb8,_0x1187a9){_0x48adb8=_0x48adb8-0x0;var _0x455389=_0xd0ec[_0x48adb8];return _0x455389;};'use strict';var _=require('lodash');var moment=require(_0xcd0e('0x0'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var config=require(_0xcd0e('0x1'));config[_0xcd0e('0x2')]=_[_0xcd0e('0x3')](config['redis'],{'host':_0xcd0e('0x4'),'port':0x18eb});var io=require(_0xcd0e('0x5'))(new Redis(config['redis']));function closeInteractions(){var _0x6ec3d4=0x0;var _0xee6742=[];return db[_0xcd0e('0x6')][_0xcd0e('0x7')]({'raw':!![],'attributes':['id',_0xcd0e('0x8')],'where':{'id':0x1}})[_0xcd0e('0x9')](function(_0x322d87){_0x6ec3d4=_0x322d87[_0xcd0e('0x8')];if(_0x6ec3d4){return db[_0xcd0e('0xa')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xcd0e('0xb')](_0x322d87['chatTimeout'],_0xcd0e('0xc'))}}});}else{return[];}})[_0xcd0e('0x9')](function(_0x5e1674){_0xee6742=_0x5e1674;if(_0x6ec3d4){return db[_0xcd0e('0xa')][_0xcd0e('0xd')]({'closeReason':_0xcd0e('0xe'),'disposition':_0xcd0e('0xf'),'closed':!![],'closedAt':moment()[_0xcd0e('0x10')](_0xcd0e('0x11'))},{'where':{'id':_['map'](_0xee6742||[],'id')}});}})[_0xcd0e('0x9')](function(_0x50e911){for(var _0xf05917=0x0;_0xf05917<_0xee6742[_0xcd0e('0x12')];_0xf05917++){io[_0xcd0e('0x13')](_0xcd0e('0x14'),{'id':_0xee6742[_0xf05917]['id'],'closed':!![]});}})[_0xcd0e('0x15')](function(_0x4a2675){console[_0xcd0e('0x16')](_0x4a2675);});}exports[_0xcd0e('0x17')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index a4c061c..7bd05d7 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 _0xf64c=['../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','zip','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','email\x20sent','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','catch','CustomReportId','MailServerOut','keys','jobs','map','toString','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','my\x20id','run\x20job','cron','isBetween','startAt','endAt','add','start','add\x20cron','update\x20cron','stop\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0xf64c,0x15e));var _0xcf64=function(_0x219c2c,_0x504e3d){_0x219c2c=_0x219c2c-0x0;var _0x1c2b71=_0xf64c[_0x219c2c];return _0x1c2b71;};'use strict';var fs=require('fs');var util=require(_0xcf64('0x0'));var path=require(_0xcf64('0x1'));var _=require(_0xcf64('0x2'));var moment=require(_0xcf64('0x3'));var CronJobManager=require(_0xcf64('0x4'));var jayson=require(_0xcf64('0x5'));var BPromise=require('bluebird');var logger=require(_0xcf64('0x6'))(_0xcf64('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xcf64('0x8'));var analyticDefaultReportController=require(_0xcf64('0x9'));var client=jayson[_0xcf64('0xa')][_0xcf64('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4fe145,_0x345c06){return function(){logger['info'](_0xcf64('0xc'),_0x4fe145[_0xcf64('0xd')]);var _0x95d21f=!![];var _0x2f1f64={'tls':{'rejectUnauthorized':![]}};if(_0x4fe145[_0xcf64('0xe')]['Smtp'][_0xcf64('0xf')]){_0x2f1f64[_0xcf64('0xf')]=_0x4fe145[_0xcf64('0xe')][_0xcf64('0x10')][_0xcf64('0xf')];}else{_0x2f1f64[_0xcf64('0x11')]=_0x4fe145[_0xcf64('0xe')][_0xcf64('0x10')][_0xcf64('0x11')];_0x2f1f64[_0xcf64('0x12')]=_0x4fe145[_0xcf64('0xe')][_0xcf64('0x10')][_0xcf64('0x12')];_0x2f1f64['secure']=_0x4fe145['MailAccount'][_0xcf64('0x10')][_0xcf64('0x13')];}if(_0x4fe145[_0xcf64('0xe')][_0xcf64('0x10')][_0xcf64('0x14')]){_0x2f1f64[_0xcf64('0x15')]={'user':_0x4fe145[_0xcf64('0xe')][_0xcf64('0x10')][_0xcf64('0x16')],'pass':_0x4fe145[_0xcf64('0xe')][_0xcf64('0x10')][_0xcf64('0x17')]};}var _0x3a0dd8={'account':_0x2f1f64,'message':{'from':util[_0xcf64('0x18')](_0xcf64('0x19'),_0x4fe145[_0xcf64('0xe')][_0xcf64('0x1a')],_0x4fe145[_0xcf64('0xe')]['email']||_0x4fe145[_0xcf64('0xe')][_0xcf64('0x10')][_0xcf64('0x16')]),'to':_0x4fe145[_0xcf64('0xd')],'cc':_0x4fe145['cc'],'bcc':_0x4fe145[_0xcf64('0x1b')],'subject':util[_0xcf64('0x18')](_0xcf64('0x1c'),_0x345c06[_0xcf64('0x1a')],_0x4fe145['subtractNumber'],_0x4fe145[_0xcf64('0x1d')])}};var _0x3964b1=path[_0xcf64('0x1e')](__dirname,_0xcf64('0x1f'));var _0x57cc29=_0x345c06[_0xcf64('0x20')];var _0x254ed3=util[_0xcf64('0x18')]('%s.%s',path['basename'](_0x345c06['savename'],path['extname'](_0x345c06[_0xcf64('0x20')])),_0xcf64('0x21'));var _0x3305e6=path[_0xcf64('0x1e')](_0x3964b1,_0x57cc29);var _0x4e3354=path['join'](_0x3964b1,_0x254ed3);if(fs[_0xcf64('0x22')](_0x3305e6)){_0x345c06[_0xcf64('0x23')]=_0xcf64('0x24');_0x3a0dd8[_0xcf64('0x25')]['attachments']=[{'filename':_0x57cc29,'path':_0x3305e6}];_0x3a0dd8['message'][_0xcf64('0x26')]=util[_0xcf64('0x18')](_0xcf64('0x27'),JSON[_0xcf64('0x28')](_0x345c06,null,0x2));}else if(fs[_0xcf64('0x22')](_0x4e3354)){_0x345c06[_0xcf64('0x23')]=_0xcf64('0x24');_0x3a0dd8[_0xcf64('0x25')][_0xcf64('0x29')]=[{'filename':_0x254ed3,'path':_0x4e3354}];}else{_0x3a0dd8[_0xcf64('0x25')][_0xcf64('0x26')]=_0xcf64('0x2a');if(!_0x4fe145[_0xcf64('0x2b')]){_0x95d21f=![];logger[_0xcf64('0x2c')](_0xcf64('0x2d'));}}if(_0x95d21f){return client['request'](_0xcf64('0x2e'),_0x3a0dd8)[_0xcf64('0x2f')](function(_0x19943f){if(_0x19943f[_0xcf64('0x30')]){return logger[_0xcf64('0x30')](_0xcf64('0x31'),JSON[_0xcf64('0x28')](_0x19943f));}return logger['info'](_0xcf64('0x32'));})['catch'](function(_0x3eb8f7){return logger[_0xcf64('0x30')](_0xcf64('0x31'),JSON['stringify'](_0x3eb8f7));});}};}function handleError(){return function(_0x2ca8be){return logger['error'](JSON[_0xcf64('0x28')](_0x2ca8be));};}function handleResult(_0xcb99dc){return function(_0x86beeb){logger['info']('data',JSON['stringify'](_0x86beeb));if(_0xcb99dc['MailAccount']&&_0xcb99dc['MailAccount'][_0xcf64('0x10')]&&!_['isNil'](_0xcb99dc['email'])){setTimeout(handleSendEmail(_0xcb99dc,_0x86beeb),0x3c*0x3e8);}};}function handleJob(_0x24b3e9){return function(){try{if(_[_0xcf64('0x33')](_0x24b3e9['subtractNumber'])){return logger[_0xcf64('0x2c')](_0xcf64('0x34'));}if(_['isNil'](_0x24b3e9[_0xcf64('0x1d')])){return logger[_0xcf64('0x2c')](_0xcf64('0x35'));}var _0x4422d9={'startDate':moment()[_0xcf64('0x36')](_0x24b3e9[_0xcf64('0x37')],_0x24b3e9[_0xcf64('0x1d')])[_0xcf64('0x18')](_0xcf64('0x38')),'endDate':moment()[_0xcf64('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0xcf64('0x39'),'output':_0x24b3e9[_0xcf64('0x3a')],'name':_0x24b3e9[_0xcf64('0x1a')]};if(!_[_0xcf64('0x33')](_0x24b3e9['DefaultReportId'])){logger['info'](_0xcf64('0x3b'),_0x24b3e9[_0xcf64('0x3c')]);return analyticDefaultReportController[_0xcf64('0x3d')]({'id':_0x24b3e9[_0xcf64('0x3c')]},_0x4422d9)[_0xcf64('0x2f')](handleResult(_0x24b3e9))[_0xcf64('0x3e')](handleError());}if(!_[_0xcf64('0x33')](_0x24b3e9[_0xcf64('0x3f')])){logger[_0xcf64('0x2c')]('exec\x20custom\x20report\x20id:%s',_0x24b3e9['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x24b3e9[_0xcf64('0x3f')]},_0x4422d9)[_0xcf64('0x2f')](handleResult(_0x24b3e9))[_0xcf64('0x3e')](handleError());}}catch(_0xe27d7a){logger[_0xcf64('0x30')](JSON[_0xcf64('0x28')](_0xe27d7a));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x5abef9){var _0x48fb71={};if(_0x5abef9){_0x48fb71['id']=_0x5abef9;}return db['Schedule']['findAll']({'where':_0x48fb71,'include':[{'model':db[_0xcf64('0xe')],'attributes':['id','name',_0xcf64('0xd')],'include':[{'model':db[_0xcf64('0x40')],'as':'Smtp'}]}]})[_0xcf64('0x2f')](function(_0x298528){var _0x2ec5b7=_[_0xcf64('0x41')](manager[_0xcf64('0x42')]);var _0x1a4e54=_[_0xcf64('0x43')](_0x298528,function(_0x5b5984){return _0x5b5984['id'][_0xcf64('0x44')]();});var _0x13b8ae=_['keyBy'](_0x298528,function(_0x4f5baf){return _0x4f5baf['id']['toString']();});var _0x3c6c10=_0x5abef9?_0x1a4e54:_[_0xcf64('0x45')](_0x1a4e54,_0x2ec5b7);var _0x34dfbd=_[_0xcf64('0x46')](_0x1a4e54,_0x2ec5b7);var _0x10f5e5=_[_0xcf64('0x45')](_0x2ec5b7,_0x1a4e54);var _0x5416c8;var _0x5a3399;for(_0x5416c8=0x0;_0x5416c8<_0x10f5e5[_0xcf64('0x47')]&&!_0x5abef9;_0x5416c8+=0x1){_0x5a3399=_0x10f5e5[_0x5416c8]['toString']();if(manager[_0xcf64('0x48')](_0x5a3399)){manager[_0xcf64('0x49')](_0x5a3399);manager[_0xcf64('0x4a')](_0x5a3399);logger[_0xcf64('0x2c')](_0xcf64('0x4b'),_0x5a3399);}}logger[_0xcf64('0x2c')](_0xcf64('0x4c'),JSON['stringify'](_0x3c6c10));for(_0x5416c8=0x0;_0x5416c8<_0x3c6c10['length'];_0x5416c8+=0x1){_0x5a3399=_0x3c6c10[_0x5416c8][_0xcf64('0x44')]();logger[_0xcf64('0x2c')]('index',_0x5a3399);if(_0x5abef9){logger[_0xcf64('0x2c')](_0xcf64('0x4d'),_0x5abef9);logger[_0xcf64('0x2c')](JSON['stringify'](_0x13b8ae[_0x5a3399]));BPromise['resolve']()[_0xcf64('0x2f')](handleJob(_0x13b8ae[_0x5a3399]));logger['info'](_0xcf64('0x4e'),_0x13b8ae[_0x5a3399][_0xcf64('0x1a')],_0x13b8ae[_0x5a3399][_0xcf64('0x4f')]);}else if(_0x13b8ae[_0x5a3399]['cron']&&_0x13b8ae[_0x5a3399]['active']&&moment()[_0xcf64('0x50')](_0x13b8ae[_0x5a3399][_0xcf64('0x51')],_0x13b8ae[_0x5a3399][_0xcf64('0x52')])){manager[_0xcf64('0x53')](_0x5a3399,_0x13b8ae[_0x5a3399][_0xcf64('0x4f')],handleJob(_0x13b8ae[_0x5a3399]));manager[_0xcf64('0x54')](_0x5a3399);logger['info'](_0xcf64('0x55'),_0x13b8ae[_0x5a3399][_0xcf64('0x1a')],_0x13b8ae[_0x5a3399]['cron']);}else if(manager[_0xcf64('0x48')](_0x5a3399)){manager[_0xcf64('0x49')](_0x5a3399);manager['deleteJob'](_0x5a3399);logger[_0xcf64('0x2c')]('stop\x20cron',_0x13b8ae[_0x5a3399][_0xcf64('0x1a')],_0x13b8ae[_0x5a3399][_0xcf64('0x4f')]);}}for(_0x5416c8=0x0,_0x5a3399;_0x5416c8<_0x34dfbd[_0xcf64('0x47')]&&!_0x5abef9;_0x5416c8+=0x1){_0x5a3399=_0x34dfbd[_0x5416c8][_0xcf64('0x44')]();if(manager[_0xcf64('0x48')](_0x5a3399)){if(_0x13b8ae[_0x5a3399][_0xcf64('0x4f')]&&_0x13b8ae[_0x5a3399]['active']&&moment()[_0xcf64('0x50')](_0x13b8ae[_0x5a3399][_0xcf64('0x51')],_0x13b8ae[_0x5a3399]['endAt'])){manager['update'](_0x5a3399,_0x13b8ae[_0x5a3399]['cron'],handleJob(_0x13b8ae[_0x5a3399]));logger[_0xcf64('0x2c')](_0xcf64('0x56'),_0x13b8ae[_0x5a3399]['name'],_0x13b8ae[_0x5a3399][_0xcf64('0x4f')]);}else{manager[_0xcf64('0x49')](_0x5a3399);manager['deleteJob'](_0x5a3399);logger[_0xcf64('0x2c')](_0xcf64('0x57'),_0x13b8ae[_0x5a3399][_0xcf64('0x1a')],_0x13b8ae[_0x5a3399][_0xcf64('0x4f')]);}}}})[_0xcf64('0x3e')](function(_0x4cc300){logger[_0xcf64('0x30')](JSON[_0xcf64('0x28')](_0x4cc300));});}exports[_0xcf64('0x58')]=function(_0x3b15f0){return getJobs(_0x3b15f0);};exports[_0xcf64('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x407a=['\x22%s\x22\x20<%s>','name','bcc','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','CustomReportId','then','findAll','MailServerOut','keys','jobs','map','toString','keyBy','intersection','difference','exists','delete\x20cron','length','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add\x20cron','stop\x20cron','update\x20cron','stop','deleteJob','start','util','moment','jayson/promise','bluebird','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','port','secure','auth','user','pass','format'];(function(_0x264d4d,_0x118fb5){var _0xc917e2=function(_0x21b9dc){while(--_0x21b9dc){_0x264d4d['push'](_0x264d4d['shift']());}};_0xc917e2(++_0x118fb5);}(_0x407a,0x128));var _0xa407=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x407a[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var util=require(_0xa407('0x0'));var path=require('path');var _=require('lodash');var moment=require(_0xa407('0x1'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xa407('0x2'));var BPromise=require(_0xa407('0x3'));var logger=require(_0xa407('0x4'))(_0xa407('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xa407('0x6'));var client=jayson['client'][_0xa407('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x9c3775,_0x4d00a7){return function(){logger[_0xa407('0x8')](_0xa407('0x9'),_0x9c3775[_0xa407('0xa')]);var _0x3eb00f=!![];var _0x385962={'tls':{'rejectUnauthorized':![]}};if(_0x9c3775[_0xa407('0xb')]['Smtp'][_0xa407('0xc')]){_0x385962[_0xa407('0xc')]=_0x9c3775[_0xa407('0xb')][_0xa407('0xd')][_0xa407('0xc')];}else{_0x385962['host']=_0x9c3775['MailAccount']['Smtp']['host'];_0x385962[_0xa407('0xe')]=_0x9c3775[_0xa407('0xb')]['Smtp'][_0xa407('0xe')];_0x385962[_0xa407('0xf')]=_0x9c3775[_0xa407('0xb')][_0xa407('0xd')][_0xa407('0xf')];}if(_0x9c3775[_0xa407('0xb')][_0xa407('0xd')]['authentication']){_0x385962[_0xa407('0x10')]={'user':_0x9c3775[_0xa407('0xb')][_0xa407('0xd')][_0xa407('0x11')],'pass':_0x9c3775[_0xa407('0xb')][_0xa407('0xd')][_0xa407('0x12')]};}var _0x3df388={'account':_0x385962,'message':{'from':util[_0xa407('0x13')](_0xa407('0x14'),_0x9c3775['MailAccount'][_0xa407('0x15')],_0x9c3775[_0xa407('0xb')][_0xa407('0xa')]||_0x9c3775[_0xa407('0xb')]['Smtp'][_0xa407('0x11')]),'to':_0x9c3775[_0xa407('0xa')],'cc':_0x9c3775['cc'],'bcc':_0x9c3775[_0xa407('0x16')],'subject':util[_0xa407('0x13')]('Report\x20%s\x20last\x20%s\x20%s',_0x4d00a7[_0xa407('0x15')],_0x9c3775[_0xa407('0x17')],_0x9c3775[_0xa407('0x18')])}};var _0x176d4c=path[_0xa407('0x19')](__dirname,'../../files/reports');var _0x36233a=_0x4d00a7[_0xa407('0x1a')];var _0x5b9feb=util[_0xa407('0x13')](_0xa407('0x1b'),path[_0xa407('0x1c')](_0x4d00a7[_0xa407('0x1a')],path[_0xa407('0x1d')](_0x4d00a7[_0xa407('0x1a')])),'zip');var _0x45c693=path[_0xa407('0x19')](_0x176d4c,_0x36233a);var _0x5d28f0=path[_0xa407('0x19')](_0x176d4c,_0x5b9feb);if(fs[_0xa407('0x1e')](_0x45c693)){_0x4d00a7[_0xa407('0x1f')]=_0xa407('0x20');_0x3df388[_0xa407('0x21')]['attachments']=[{'filename':_0x36233a,'path':_0x45c693}];_0x3df388[_0xa407('0x21')][_0xa407('0x22')]=util[_0xa407('0x13')](_0xa407('0x23'),JSON[_0xa407('0x24')](_0x4d00a7,null,0x2));}else if(fs[_0xa407('0x1e')](_0x5d28f0)){_0x4d00a7[_0xa407('0x1f')]=_0xa407('0x20');_0x3df388[_0xa407('0x21')]['attachments']=[{'filename':_0x5b9feb,'path':_0x5d28f0}];}else{_0x3df388[_0xa407('0x21')][_0xa407('0x22')]=_0xa407('0x25');if(!_0x9c3775[_0xa407('0x26')]){_0x3eb00f=![];logger[_0xa407('0x8')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x3eb00f){return client[_0xa407('0x27')]('SendMail',_0x3df388)['then'](function(_0x1f7de5){if(_0x1f7de5[_0xa407('0x28')]){return logger[_0xa407('0x28')](_0xa407('0x29'),JSON[_0xa407('0x24')](_0x1f7de5));}return logger['info']('email\x20sent');})[_0xa407('0x2a')](function(_0x1d49b2){return logger['error'](_0xa407('0x29'),JSON[_0xa407('0x24')](_0x1d49b2));});}};}function handleError(){return function(_0x25b887){return logger['error'](JSON[_0xa407('0x24')](_0x25b887));};}function handleResult(_0x2a8b5e){return function(_0x14830d){logger[_0xa407('0x8')](_0xa407('0x2b'),JSON[_0xa407('0x24')](_0x14830d));if(_0x2a8b5e[_0xa407('0xb')]&&_0x2a8b5e['MailAccount'][_0xa407('0xd')]&&!_[_0xa407('0x2c')](_0x2a8b5e['email'])){setTimeout(handleSendEmail(_0x2a8b5e,_0x14830d),0x3c*0x3e8);}};}function handleJob(_0x243826){return function(){try{if(_[_0xa407('0x2c')](_0x243826[_0xa407('0x17')])){return logger[_0xa407('0x8')](_0xa407('0x2d'));}if(_['isNil'](_0x243826['subtractUnit'])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x3516e1={'startDate':moment()[_0xa407('0x2e')](_0x243826[_0xa407('0x17')],_0x243826[_0xa407('0x18')])[_0xa407('0x13')](_0xa407('0x2f')),'endDate':moment()['format'](_0xa407('0x2f')),'type':'scheduled','output':_0x243826[_0xa407('0x30')],'name':_0x243826['name']};if(!_[_0xa407('0x2c')](_0x243826['DefaultReportId'])){logger[_0xa407('0x8')](_0xa407('0x31'),_0x243826['DefaultReportId']);return analyticDefaultReportController[_0xa407('0x32')]({'id':_0x243826[_0xa407('0x33')]},_0x3516e1)['then'](handleResult(_0x243826))['catch'](handleError());}if(!_['isNil'](_0x243826[_0xa407('0x34')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x243826[_0xa407('0x34')]);return analyticCustomReportController[_0xa407('0x32')]({'id':_0x243826[_0xa407('0x34')]},_0x3516e1)[_0xa407('0x35')](handleResult(_0x243826))['catch'](handleError());}}catch(_0x2f88f9){logger[_0xa407('0x28')](JSON[_0xa407('0x24')](_0x2f88f9));}return logger[_0xa407('0x8')]('no\x20report\x20id');};}function getJobs(_0x33c3ec){var _0x2ebebc={};if(_0x33c3ec){_0x2ebebc['id']=_0x33c3ec;}return db['Schedule'][_0xa407('0x36')]({'where':_0x2ebebc,'include':[{'model':db[_0xa407('0xb')],'attributes':['id','name',_0xa407('0xa')],'include':[{'model':db[_0xa407('0x37')],'as':_0xa407('0xd')}]}]})[_0xa407('0x35')](function(_0x886229){var _0x25d723=_[_0xa407('0x38')](manager[_0xa407('0x39')]);var _0x19d080=_[_0xa407('0x3a')](_0x886229,function(_0x4b788c){return _0x4b788c['id'][_0xa407('0x3b')]();});var _0x4990ac=_[_0xa407('0x3c')](_0x886229,function(_0x238c36){return _0x238c36['id'][_0xa407('0x3b')]();});var _0x3e45d6=_0x33c3ec?_0x19d080:_['difference'](_0x19d080,_0x25d723);var _0x100269=_[_0xa407('0x3d')](_0x19d080,_0x25d723);var _0x342800=_[_0xa407('0x3e')](_0x25d723,_0x19d080);var _0x34e05b;var _0x3efe32;for(_0x34e05b=0x0;_0x34e05b<_0x342800['length']&&!_0x33c3ec;_0x34e05b+=0x1){_0x3efe32=_0x342800[_0x34e05b][_0xa407('0x3b')]();if(manager[_0xa407('0x3f')](_0x3efe32)){manager['stop'](_0x3efe32);manager['deleteJob'](_0x3efe32);logger[_0xa407('0x8')](_0xa407('0x40'),_0x3efe32);}}logger[_0xa407('0x8')]('toRun',JSON[_0xa407('0x24')](_0x3e45d6));for(_0x34e05b=0x0;_0x34e05b<_0x3e45d6[_0xa407('0x41')];_0x34e05b+=0x1){_0x3efe32=_0x3e45d6[_0x34e05b][_0xa407('0x3b')]();logger[_0xa407('0x8')]('index',_0x3efe32);if(_0x33c3ec){logger['info'](_0xa407('0x42'),_0x33c3ec);logger[_0xa407('0x8')](JSON[_0xa407('0x24')](_0x4990ac[_0x3efe32]));BPromise[_0xa407('0x43')]()[_0xa407('0x35')](handleJob(_0x4990ac[_0x3efe32]));logger[_0xa407('0x8')](_0xa407('0x44'),_0x4990ac[_0x3efe32][_0xa407('0x15')],_0x4990ac[_0x3efe32][_0xa407('0x45')]);}else if(_0x4990ac[_0x3efe32][_0xa407('0x45')]&&_0x4990ac[_0x3efe32][_0xa407('0x46')]&&moment()[_0xa407('0x47')](_0x4990ac[_0x3efe32][_0xa407('0x48')],_0x4990ac[_0x3efe32]['endAt'])){manager['add'](_0x3efe32,_0x4990ac[_0x3efe32][_0xa407('0x45')],handleJob(_0x4990ac[_0x3efe32]));manager['start'](_0x3efe32);logger[_0xa407('0x8')](_0xa407('0x49'),_0x4990ac[_0x3efe32][_0xa407('0x15')],_0x4990ac[_0x3efe32][_0xa407('0x45')]);}else if(manager[_0xa407('0x3f')](_0x3efe32)){manager['stop'](_0x3efe32);manager['deleteJob'](_0x3efe32);logger[_0xa407('0x8')](_0xa407('0x4a'),_0x4990ac[_0x3efe32][_0xa407('0x15')],_0x4990ac[_0x3efe32]['cron']);}}for(_0x34e05b=0x0,_0x3efe32;_0x34e05b<_0x100269['length']&&!_0x33c3ec;_0x34e05b+=0x1){_0x3efe32=_0x100269[_0x34e05b][_0xa407('0x3b')]();if(manager['exists'](_0x3efe32)){if(_0x4990ac[_0x3efe32]['cron']&&_0x4990ac[_0x3efe32][_0xa407('0x46')]&&moment()[_0xa407('0x47')](_0x4990ac[_0x3efe32][_0xa407('0x48')],_0x4990ac[_0x3efe32]['endAt'])){manager['update'](_0x3efe32,_0x4990ac[_0x3efe32][_0xa407('0x45')],handleJob(_0x4990ac[_0x3efe32]));logger['info'](_0xa407('0x4b'),_0x4990ac[_0x3efe32]['name'],_0x4990ac[_0x3efe32]['cron']);}else{manager[_0xa407('0x4c')](_0x3efe32);manager[_0xa407('0x4d')](_0x3efe32);logger[_0xa407('0x8')](_0xa407('0x4a'),_0x4990ac[_0x3efe32]['name'],_0x4990ac[_0x3efe32]['cron']);}}}})[_0xa407('0x2a')](function(_0x1877dc){logger[_0xa407('0x28')](JSON[_0xa407('0x24')](_0x1877dc));});}exports['run']=function(_0x138d6c){return getJobs(_0x138d6c);};exports[_0xa407('0x4e')]=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 a0db834..0c31ffe 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 _0x8f81=['getTranscriptionJob','detectSentiment','substring','format','transcribeName','data1','data2','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','bucket','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','Negative','SentimentScore','Neutral','FAILED','tempSentiment','Sentiment\x20Analysis\x20not\x20configured','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','transcribe'];(function(_0x544cd7,_0x20f588){var _0x43c000=function(_0x3d71cf){while(--_0x3d71cf){_0x544cd7['push'](_0x544cd7['shift']());}};_0x43c000(++_0x20f588);}(_0x8f81,0x119));var _0x18f8=function(_0xfe21c3,_0x426816){_0xfe21c3=_0xfe21c3-0x0;var _0x5ce425=_0x8f81[_0xfe21c3];return _0x5ce425;};var _=require(_0x18f8('0x0'));var AWS=require(_0x18f8('0x1'));var rp=require(_0x18f8('0x2'));var util=require(_0x18f8('0x3'));var BPromise=require(_0x18f8('0x4'));var db=require(_0x18f8('0x5'))['db'];var logger=require('../../config/logger')(_0x18f8('0x6'));function getTranscriptionJob(_0x3ad879,_0x535f4f,_0x58d1a0,_0x3cf9f8){return new Promise(function(_0x2a6899,_0x23dfc1){var _0x279064=new AWS['TranscribeService']({'accessKeyId':_0x535f4f,'secretAccessKey':_0x3ad879,'region':_0x58d1a0});_0x279064[_0x18f8('0x7')]({'TranscriptionJobName':_0x3cf9f8},function(_0x236a1d,_0x133f75){if(_0x236a1d){return _0x23dfc1(_0x236a1d);}else{return _0x2a6899(_0x133f75);}});});}function sentiment(_0x146527,_0xa6bbcf,_0x4a9606,_0x567bec,_0x1764f3){return new Promise(function(_0x189fdf,_0x244b93){var _0x2ed00f=new AWS['Comprehend']({'accessKeyId':_0xa6bbcf,'secretAccessKey':_0x146527,'region':_0x4a9606});_0x2ed00f[_0x18f8('0x8')]({'Text':_0x567bec,'LanguageCode':_0x1764f3[_0x18f8('0x9')](0x0,0x2)},function(_0x32ebf8,_0x412a9d){if(_0x32ebf8){return _0x244b93(_0x32ebf8);}else{return _0x189fdf(_0x412a9d);}});});}function checkTranscribeJob(_0x1d71cf,_0x4032d5,_0x2d046c){var _0xf185bd;return new BPromise(function(_0x4d7480,_0xdbe401){logger['info'](util[_0x18f8('0xa')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x1d71cf['id'],_0x1d71cf[_0x18f8('0xb')]));return getTranscriptionJob(_0x2d046c[_0x18f8('0xc')],_0x2d046c[_0x18f8('0xd')],_0x4032d5[_0x18f8('0xe')],_0x1d71cf[_0x18f8('0xb')])['then'](function(_0x46566f){logger[_0x18f8('0xf')](util[_0x18f8('0xa')](_0x18f8('0x10'),_0x1d71cf['id'],_0x1d71cf[_0x18f8('0xb')],_0x46566f[_0x18f8('0x11')][_0x18f8('0x12')]));if(!_0x1d71cf[_0x18f8('0x13')]){switch(_0x46566f[_0x18f8('0x11')][_0x18f8('0x12')]){case _0x18f8('0x14'):var _0x13f92f={'transcribeStatus':_0x46566f[_0x18f8('0x11')][_0x18f8('0x12')],'fileUri':_0x46566f[_0x18f8('0x11')][_0x18f8('0x15')][_0x18f8('0x16')]};logger[_0x18f8('0xf')](util[_0x18f8('0xa')](_0x18f8('0x17'),_0x1d71cf['id']));return rp({'uri':_0x46566f[_0x18f8('0x11')][_0x18f8('0x15')][_0x18f8('0x16')],'json':!![]})[_0x18f8('0x18')](function(_0x457594){logger['info'](util[_0x18f8('0xa')](_0x18f8('0x19'),_0x1d71cf['id']));if(_0x457594&&_0x457594[_0x18f8('0x1a')]&&_0x457594[_0x18f8('0x1a')][_0x18f8('0x1b')]&&_0x457594['results'][_0x18f8('0x1b')][_0x18f8('0x1c')]){_0x13f92f[_0x18f8('0x13')]='';for(var _0x56cbcd=0x0;_0x56cbcd<_0x457594['results']['transcripts'][_0x18f8('0x1c')];_0x56cbcd++){_0x13f92f[_0x18f8('0x13')]+=_0x457594['results'][_0x18f8('0x1b')][_0x56cbcd][_0x18f8('0x1d')]+'';}}return _0x1d71cf[_0x18f8('0x1e')](_0x13f92f);})[_0x18f8('0x18')](function(){logger['info'](util[_0x18f8('0xa')](_0x18f8('0x1f'),_0x1d71cf['id']));if(!_0x1d71cf['tempSentiment']){throw new db[(_0x18f8('0x20'))][(_0x18f8('0x21'))](_0x18f8('0x22'));}if(!_0x4032d5[_0x18f8('0x23')]||!_0x4032d5['sentimentAccountId']||!_0x4032d5['sentimentRegion']||!_0x4032d5['language']||!_0x4032d5[_0x18f8('0x24')]){throw new db['Sequelize']['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x13f92f[_0x18f8('0x13')]){throw new Error(_0x18f8('0x25'));}if(_0x4032d5[_0x18f8('0x26')]===_0x2d046c['id']){return _0x2d046c;}else{return db[_0x18f8('0x27')][_0x18f8('0x28')]({'where':{'id':_settings[_0x18f8('0x26')]}});}})[_0x18f8('0x18')](function(_0x596e42){if(!_0x596e42){throw new db[(_0x18f8('0x20'))][(_0x18f8('0x21'))](_0x18f8('0x29'));}if(!_0x596e42[_0x18f8('0xc')]||!_0x596e42[_0x18f8('0xd')]){throw new db[(_0x18f8('0x20'))]['ValidationError'](_0x18f8('0x2a'));}_0xf185bd=_0x596e42;logger['info'](util['format'](_0x18f8('0x2b'),_0x1d71cf['id']));return sentiment(_0xf185bd[_0x18f8('0xc')],_0xf185bd[_0x18f8('0xd')],_0x4032d5[_0x18f8('0x2c')],_0x13f92f['fileText'],_0x4032d5[_0x18f8('0x2d')]);})[_0x18f8('0x18')](function(_0x1d39b1){logger[_0x18f8('0xf')](util[_0x18f8('0xa')](_0x18f8('0x2e'),_0x1d71cf['id']));return _0x1d71cf[_0x18f8('0x1e')]({'sentiment':_0x1d39b1[_0x18f8('0x2f')],'sPositive':_0x1d39b1['SentimentScore'][_0x18f8('0x30')],'sNegative':_0x1d39b1['SentimentScore'][_0x18f8('0x31')],'sMixed':_0x1d39b1['SentimentScore']['Mixed'],'sNeutral':_0x1d39b1[_0x18f8('0x32')][_0x18f8('0x33')]});})[_0x18f8('0x18')](function(){logger[_0x18f8('0xf')](util[_0x18f8('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1d71cf['id']));_0x4d7480();});case _0x18f8('0x34'):return _0x1d71cf[_0x18f8('0x1e')]({'transcribeStatus':'FAILED','failureReason':_0x46566f[_0x18f8('0x11')]['FailureReason']})[_0x18f8('0x18')](function(){logger[_0x18f8('0xf')](util[_0x18f8('0xa')](_0x18f8('0x1f'),_0x1d71cf['id']));_0x4d7480();});default:logger[_0x18f8('0xf')](util['format']('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x1d71cf['id']));break;}}else{return BPromise['resolve']()[_0x18f8('0x18')](function(){if(!_0x1d71cf[_0x18f8('0x35')]){throw new db[(_0x18f8('0x20'))][(_0x18f8('0x21'))](_0x18f8('0x22'));}if(!_0x4032d5[_0x18f8('0x23')]||!_0x4032d5[_0x18f8('0x26')]||!_0x4032d5[_0x18f8('0x2c')]||!_0x4032d5[_0x18f8('0x2d')]||!_0x4032d5[_0x18f8('0x24')]){throw new db[(_0x18f8('0x20'))][(_0x18f8('0x21'))](_0x18f8('0x36'));}if(!_0x1d71cf[_0x18f8('0x13')]){throw new Error(_0x18f8('0x25'));}if(_0x4032d5['sentimentAccountId']===_0x2d046c['id']){return _0x2d046c;}else{return db[_0x18f8('0x27')][_0x18f8('0x28')]({'where':{'id':_settings[_0x18f8('0x26')]}});}})['then'](function(_0x1f82f0){if(!_0x1f82f0){throw new db[(_0x18f8('0x20'))]['ValidationError'](_0x18f8('0x29'));}if(!_0x1f82f0[_0x18f8('0xc')]||!_0x1f82f0[_0x18f8('0xd')]){throw new db[(_0x18f8('0x20'))][(_0x18f8('0x21'))](_0x18f8('0x2a'));}_0xf185bd=_0x1f82f0;logger['info'](util['format'](_0x18f8('0x2b'),_0x1d71cf['id']));return sentiment(_0xf185bd[_0x18f8('0xc')],_0xf185bd[_0x18f8('0xd')],_0x4032d5[_0x18f8('0x2c')],_0x1d71cf[_0x18f8('0x13')],_0x4032d5[_0x18f8('0x2d')]);})[_0x18f8('0x18')](function(_0x2a0ae9){logger['info'](util[_0x18f8('0xa')](_0x18f8('0x2e'),_0x1d71cf['id']));return _0x1d71cf[_0x18f8('0x1e')]({'sentiment':_0x2a0ae9[_0x18f8('0x2f')],'sPositive':_0x2a0ae9[_0x18f8('0x32')][_0x18f8('0x30')],'sNegative':_0x2a0ae9[_0x18f8('0x32')][_0x18f8('0x31')],'sMixed':_0x2a0ae9[_0x18f8('0x32')]['Mixed'],'sNeutral':_0x2a0ae9['SentimentScore'][_0x18f8('0x33')],'transcribeStatus':'COMPLETED'});})[_0x18f8('0x18')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1d71cf['id']));_0x4d7480();});}})[_0x18f8('0x37')](function(_0x4d99e6){if(_0x4d99e6){if(!_0x4d99e6[_0x18f8('0x38')]||_0x4d99e6[_0x18f8('0x38')]!==_0x18f8('0x39')){logger[_0x18f8('0x3a')](util[_0x18f8('0xa')](_0x18f8('0x3b'),_0x1d71cf['id']),util[_0x18f8('0x3c')](_0x4d99e6,{'showHidden':![],'depth':null}));}}_0x4d7480();});});}function checkTranscribe(){var _0x122231;var _0x51a7ba;var _0x4fbd6f;return db[_0x18f8('0x3d')][_0x18f8('0x3e')]({'where':{'transcribeStatus':_0x18f8('0x3f')}})[_0x18f8('0x18')](function(_0xff1d88){if(!_0xff1d88||!_0xff1d88[_0x18f8('0x1c')]){throw new db[(_0x18f8('0x20'))][(_0x18f8('0x21'))](_0x18f8('0x40'));}_0x122231=_0xff1d88;return db['Setting'][_0x18f8('0x28')]({'where':{'id':0x1}});})['then'](function(_0x188eb6){if(!_0x188eb6){throw new db[(_0x18f8('0x20'))]['ValidationError'](_0x18f8('0x41'));}_0x51a7ba=_0x188eb6;if(!_0x51a7ba[_0x18f8('0x6')]||!_0x51a7ba[_0x18f8('0x42')]||!_0x51a7ba[_0x18f8('0xe')]||!_0x51a7ba[_0x18f8('0x2d')]||!_0x51a7ba[_0x18f8('0x24')]){throw new db[(_0x18f8('0x20'))][(_0x18f8('0x21'))](_0x18f8('0x43'));}return db['CloudProvider'][_0x18f8('0x28')]({'where':{'id':_0x51a7ba[_0x18f8('0x42')]}});})[_0x18f8('0x18')](function(_0x5a87ea){if(!_0x5a87ea){throw new db[(_0x18f8('0x20'))][(_0x18f8('0x21'))](_0x18f8('0x29'));}if(!_0x5a87ea[_0x18f8('0xc')]||!_0x5a87ea[_0x18f8('0xd')]){throw new db['Sequelize']['ValidationError'](_0x18f8('0x2a'));}_0x4fbd6f=_0x5a87ea;var _0xcc0523=[];_0x122231[_0x18f8('0x44')](function(_0x22647b){_0xcc0523[_0x18f8('0x45')](checkTranscribeJob(_0x22647b,_0x51a7ba,_0x4fbd6f));});return BPromise[_0x18f8('0x46')](_0xcc0523);})[_0x18f8('0x37')](function(_0x361b1b){if(_0x361b1b){if(!_0x361b1b[_0x18f8('0x38')]||_0x361b1b[_0x18f8('0x38')]!=='SequelizeValidationError'){logger['error'](util[_0x18f8('0x3c')](_0x361b1b,{'showHidden':![],'depth':null}));}}});}exports[_0x18f8('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x94ae=['SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','IN_PROGRESS','Setting','Transcribe\x20not\x20configured','transcribeAccountId','forEach','push','name','inspect','lodash','aws-sdk','request-promise','util','bluebird','transcribe','TranscribeService','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','info','TranscriptionJobStatus','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','fileText','update','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','then','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','FAILED','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Negative','COMPLETED','catch'];(function(_0x5e4375,_0x756e2b){var _0x4bd4cd=function(_0x51ed6d){while(--_0x51ed6d){_0x5e4375['push'](_0x5e4375['shift']());}};_0x4bd4cd(++_0x756e2b);}(_0x94ae,0xcc));var _0xe94a=function(_0x5b0c87,_0x358c21){_0x5b0c87=_0x5b0c87-0x0;var _0x147089=_0x94ae[_0x5b0c87];return _0x147089;};var _=require(_0xe94a('0x0'));var AWS=require(_0xe94a('0x1'));var rp=require(_0xe94a('0x2'));var util=require(_0xe94a('0x3'));var BPromise=require(_0xe94a('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')(_0xe94a('0x5'));function getTranscriptionJob(_0x3c0d95,_0x4944b0,_0x33c62d,_0x279fbc){return new Promise(function(_0x2f3a5e,_0x49cd75){var _0x31fc9f=new AWS[(_0xe94a('0x6'))]({'accessKeyId':_0x4944b0,'secretAccessKey':_0x3c0d95,'region':_0x33c62d});_0x31fc9f['getTranscriptionJob']({'TranscriptionJobName':_0x279fbc},function(_0x67faf3,_0x599f99){if(_0x67faf3){return _0x49cd75(_0x67faf3);}else{return _0x2f3a5e(_0x599f99);}});});}function sentiment(_0x1630c0,_0x5b1338,_0x45e3f2,_0x19f1ba,_0x58d4e2){return new Promise(function(_0x827438,_0x5ad65e){var _0x215f93=new AWS['Comprehend']({'accessKeyId':_0x5b1338,'secretAccessKey':_0x1630c0,'region':_0x45e3f2});_0x215f93[_0xe94a('0x7')]({'Text':_0x19f1ba,'LanguageCode':_0x58d4e2[_0xe94a('0x8')](0x0,0x2)},function(_0x86ba68,_0x6dc17f){if(_0x86ba68){return _0x5ad65e(_0x86ba68);}else{return _0x827438(_0x6dc17f);}});});}function checkTranscribeJob(_0x4f4f5c,_0x5170ea,_0x267b5e){var _0x2f6eb6;return new BPromise(function(_0x41f652,_0x3b6fb0){logger['info'](util[_0xe94a('0x9')](_0xe94a('0xa'),_0x4f4f5c['id'],_0x4f4f5c[_0xe94a('0xb')]));return getTranscriptionJob(_0x267b5e[_0xe94a('0xc')],_0x267b5e[_0xe94a('0xd')],_0x5170ea['transcribeRegion'],_0x4f4f5c[_0xe94a('0xb')])['then'](function(_0x11bc17){logger[_0xe94a('0xe')](util[_0xe94a('0x9')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x4f4f5c['id'],_0x4f4f5c['transcribeName'],_0x11bc17['TranscriptionJob'][_0xe94a('0xf')]));if(!_0x4f4f5c['fileText']){switch(_0x11bc17['TranscriptionJob'][_0xe94a('0xf')]){case'COMPLETED':var _0x51cadd={'transcribeStatus':_0x11bc17[_0xe94a('0x10')]['TranscriptionJobStatus'],'fileUri':_0x11bc17[_0xe94a('0x10')][_0xe94a('0x11')][_0xe94a('0x12')]};logger[_0xe94a('0xe')](util[_0xe94a('0x9')](_0xe94a('0x13'),_0x4f4f5c['id']));return rp({'uri':_0x11bc17['TranscriptionJob'][_0xe94a('0x11')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x32add5){logger[_0xe94a('0xe')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x4f4f5c['id']));if(_0x32add5&&_0x32add5[_0xe94a('0x14')]&&_0x32add5[_0xe94a('0x14')]['transcripts']&&_0x32add5['results'][_0xe94a('0x15')][_0xe94a('0x16')]){_0x51cadd[_0xe94a('0x17')]='';for(var _0x165ccd=0x0;_0x165ccd<_0x32add5[_0xe94a('0x14')][_0xe94a('0x15')]['length'];_0x165ccd++){_0x51cadd['fileText']+=_0x32add5['results']['transcripts'][_0x165ccd]['transcript']+'';}}return _0x4f4f5c[_0xe94a('0x18')](_0x51cadd);})['then'](function(){logger[_0xe94a('0xe')](util[_0xe94a('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4f4f5c['id']));if(!_0x4f4f5c['tempSentiment']){throw new db[(_0xe94a('0x19'))][(_0xe94a('0x1a'))](_0xe94a('0x1b'));}if(!_0x5170ea['sentiment']||!_0x5170ea[_0xe94a('0x1c')]||!_0x5170ea[_0xe94a('0x1d')]||!_0x5170ea['language']||!_0x5170ea[_0xe94a('0x1e')]){throw new db[(_0xe94a('0x19'))][(_0xe94a('0x1a'))](_0xe94a('0x1f'));}if(!_0x51cadd[_0xe94a('0x17')]){throw new Error(_0xe94a('0x20'));}if(_0x5170ea[_0xe94a('0x1c')]===_0x267b5e['id']){return _0x267b5e;}else{return db[_0xe94a('0x21')][_0xe94a('0x22')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0xe94a('0x23')](function(_0x384765){if(!_0x384765){throw new db[(_0xe94a('0x19'))][(_0xe94a('0x1a'))](_0xe94a('0x24'));}if(!_0x384765[_0xe94a('0xc')]||!_0x384765[_0xe94a('0xd')]){throw new db[(_0xe94a('0x19'))][(_0xe94a('0x1a'))](_0xe94a('0x25'));}_0x2f6eb6=_0x384765;logger[_0xe94a('0xe')](util[_0xe94a('0x9')](_0xe94a('0x26'),_0x4f4f5c['id']));return sentiment(_0x2f6eb6[_0xe94a('0xc')],_0x2f6eb6['data2'],_0x5170ea['sentimentRegion'],_0x51cadd[_0xe94a('0x17')],_0x5170ea[_0xe94a('0x27')]);})[_0xe94a('0x23')](function(_0x4963d5){logger[_0xe94a('0xe')](util['format'](_0xe94a('0x28'),_0x4f4f5c['id']));return _0x4f4f5c[_0xe94a('0x18')]({'sentiment':_0x4963d5[_0xe94a('0x29')],'sPositive':_0x4963d5[_0xe94a('0x2a')][_0xe94a('0x2b')],'sNegative':_0x4963d5['SentimentScore']['Negative'],'sMixed':_0x4963d5['SentimentScore'][_0xe94a('0x2c')],'sNeutral':_0x4963d5[_0xe94a('0x2a')]['Neutral']});})['then'](function(){logger[_0xe94a('0xe')](util[_0xe94a('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4f4f5c['id']));_0x41f652();});case _0xe94a('0x2d'):return _0x4f4f5c[_0xe94a('0x18')]({'transcribeStatus':_0xe94a('0x2d'),'failureReason':_0x11bc17['TranscriptionJob']['FailureReason']})[_0xe94a('0x23')](function(){logger['info'](util['format'](_0xe94a('0x2e'),_0x4f4f5c['id']));_0x41f652();});default:logger[_0xe94a('0xe')](util[_0xe94a('0x9')](_0xe94a('0x2f'),_0x4f4f5c['id']));break;}}else{return BPromise[_0xe94a('0x30')]()['then'](function(){if(!_0x4f4f5c['tempSentiment']){throw new db[(_0xe94a('0x19'))]['ValidationError'](_0xe94a('0x1b'));}if(!_0x5170ea['sentiment']||!_0x5170ea['sentimentAccountId']||!_0x5170ea[_0xe94a('0x1d')]||!_0x5170ea[_0xe94a('0x27')]||!_0x5170ea[_0xe94a('0x1e')]){throw new db[(_0xe94a('0x19'))]['ValidationError'](_0xe94a('0x1f'));}if(!_0x4f4f5c[_0xe94a('0x17')]){throw new Error('Transcript\x20not\x20available');}if(_0x5170ea[_0xe94a('0x1c')]===_0x267b5e['id']){return _0x267b5e;}else{return db[_0xe94a('0x21')][_0xe94a('0x22')]({'where':{'id':_settings[_0xe94a('0x1c')]}});}})['then'](function(_0x5315a4){if(!_0x5315a4){throw new db['Sequelize'][(_0xe94a('0x1a'))](_0xe94a('0x24'));}if(!_0x5315a4[_0xe94a('0xc')]||!_0x5315a4['data2']){throw new db[(_0xe94a('0x19'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x2f6eb6=_0x5315a4;logger[_0xe94a('0xe')](util['format'](_0xe94a('0x26'),_0x4f4f5c['id']));return sentiment(_0x2f6eb6[_0xe94a('0xc')],_0x2f6eb6[_0xe94a('0xd')],_0x5170ea[_0xe94a('0x1d')],_0x4f4f5c[_0xe94a('0x17')],_0x5170ea['language']);})[_0xe94a('0x23')](function(_0x27ab0d){logger[_0xe94a('0xe')](util[_0xe94a('0x9')](_0xe94a('0x28'),_0x4f4f5c['id']));return _0x4f4f5c['update']({'sentiment':_0x27ab0d[_0xe94a('0x29')],'sPositive':_0x27ab0d['SentimentScore'][_0xe94a('0x2b')],'sNegative':_0x27ab0d[_0xe94a('0x2a')][_0xe94a('0x31')],'sMixed':_0x27ab0d[_0xe94a('0x2a')][_0xe94a('0x2c')],'sNeutral':_0x27ab0d['SentimentScore']['Neutral'],'transcribeStatus':_0xe94a('0x32')});})[_0xe94a('0x23')](function(){logger[_0xe94a('0xe')](util[_0xe94a('0x9')](_0xe94a('0x2e'),_0x4f4f5c['id']));_0x41f652();});}})[_0xe94a('0x33')](function(_0x57b6dd){if(_0x57b6dd){if(!_0x57b6dd['name']||_0x57b6dd['name']!==_0xe94a('0x34')){logger[_0xe94a('0x35')](util[_0xe94a('0x9')](_0xe94a('0x36'),_0x4f4f5c['id']),util['inspect'](_0x57b6dd,{'showHidden':![],'depth':null}));}}_0x41f652();});});}function checkTranscribe(){var _0x4fe373;var _0x488631;var _0x42eab9;return db[_0xe94a('0x37')]['findAll']({'where':{'transcribeStatus':_0xe94a('0x38')}})['then'](function(_0x287509){if(!_0x287509||!_0x287509['length']){throw new db[(_0xe94a('0x19'))][(_0xe94a('0x1a'))]('No\x20transcribe\x20job\x20to\x20check');}_0x4fe373=_0x287509;return db[_0xe94a('0x39')]['findOne']({'where':{'id':0x1}});})[_0xe94a('0x23')](function(_0x8d7898){if(!_0x8d7898){throw new db['Sequelize'][(_0xe94a('0x1a'))]('Settings\x20not\x20available');}_0x488631=_0x8d7898;if(!_0x488631[_0xe94a('0x5')]||!_0x488631['transcribeAccountId']||!_0x488631['transcribeRegion']||!_0x488631[_0xe94a('0x27')]||!_0x488631['bucket']){throw new db[(_0xe94a('0x19'))][(_0xe94a('0x1a'))](_0xe94a('0x3a'));}return db['CloudProvider'][_0xe94a('0x22')]({'where':{'id':_0x488631[_0xe94a('0x3b')]}});})['then'](function(_0x1c6efb){if(!_0x1c6efb){throw new db[(_0xe94a('0x19'))][(_0xe94a('0x1a'))](_0xe94a('0x24'));}if(!_0x1c6efb[_0xe94a('0xc')]||!_0x1c6efb['data2']){throw new db[(_0xe94a('0x19'))][(_0xe94a('0x1a'))](_0xe94a('0x25'));}_0x42eab9=_0x1c6efb;var _0x1c69ec=[];_0x4fe373[_0xe94a('0x3c')](function(_0x3ddfe4){_0x1c69ec[_0xe94a('0x3d')](checkTranscribeJob(_0x3ddfe4,_0x488631,_0x42eab9));});return BPromise['all'](_0x1c69ec);})[_0xe94a('0x33')](function(_0x192ff0){if(_0x192ff0){if(!_0x192ff0[_0xe94a('0x3e')]||_0x192ff0[_0xe94a('0x3e')]!==_0xe94a('0x34')){logger[_0xe94a('0x35')](util[_0xe94a('0x3f')](_0x192ff0,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 22d0144..f3bca5c 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x24ef=['CmHopper','then','bulkCreate','finished\x20populating','hopper1','CmContact','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','log','contacts1'];(function(_0x2c573c,_0x9cabdf){var _0x9f1946=function(_0x1c415b){while(--_0x1c415b){_0x2c573c['push'](_0x2c573c['shift']());}};_0x9f1946(++_0x9cabdf);}(_0x24ef,0x7b));var _0xf24e=function(_0x52f246,_0x43439e){_0x52f246=_0x52f246-0x0;var _0x5c16b8=_0x24ef[_0x52f246];return _0x5c16b8;};'use strict';var util=require(_0xf24e('0x0'));var db=require(_0xf24e('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf24e('0x2')]({'id':i,'firstName':_0xf24e('0x3')+i,'lastName':_0xf24e('0x4')+i,'phone':0xf879fb460+i,'email':_0xf24e('0x5')+i+_0xf24e('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xf24e('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf24e('0x7')](),'updatedAt':Date[_0xf24e('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xf24e('0x2')]({'id':i,'firstName':_0xf24e('0x3')+i,'lastName':_0xf24e('0x4')+i,'phone':0xf879fb460+i,'email':_0xf24e('0x5')+i+_0xf24e('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xf24e('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xf24e('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf24e('0x7')](),'updatedAt':Date[_0xf24e('0x7')]()});}db['CmContact']['destroy']({'where':{}})['then'](function(){return db['CmContact']['bulkCreate'](contacts);})['then'](function(){console[_0xf24e('0x8')]('finished\x20populating',_0xf24e('0x9'));return db[_0xf24e('0xa')]['destroy']({'where':{}});})[_0xf24e('0xb')](function(){return db[_0xf24e('0xa')][_0xf24e('0xc')](hopper);})[_0xf24e('0xb')](function(){console[_0xf24e('0x8')](_0xf24e('0xd'),_0xf24e('0xe'));return db[_0xf24e('0xf')]['bulkCreate'](contacts2);})['then'](function(){console[_0xf24e('0x8')](_0xf24e('0xd'),_0xf24e('0x10'));return db[_0xf24e('0xa')]['bulkCreate'](hopper2);})[_0xf24e('0xb')](function(){console[_0xf24e('0x8')](_0xf24e('0xd'),_0xf24e('0x11'));})[_0xf24e('0x12')](function(_0x14cb66){console['log'](_0x14cb66);}); \ No newline at end of file +var _0x455d=['now','Biondo','CmContact','destroy','then','finished\x20populating','contacts1','CmHopper','bulkCreate','log','hopper1','hopper2','catch','util','../mysqldb','push','innocenzo.biondo','@xcally.com'];(function(_0x2a96b1,_0x4e220b){var _0x57f9f6=function(_0x59e5f9){while(--_0x59e5f9){_0x2a96b1['push'](_0x2a96b1['shift']());}};_0x57f9f6(++_0x4e220b);}(_0x455d,0x13f));var _0xd455=function(_0x94c774,_0x114cd8){_0x94c774=_0x94c774-0x0;var _0x31db11=_0x455d[_0x94c774];return _0x31db11;};'use strict';var util=require(_0xd455('0x0'));var db=require(_0xd455('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xd455('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xd455('0x3')+i+_0xd455('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xd455('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xd455('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd455('0x5')](),'updatedAt':Date[_0xd455('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xd455('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xd455('0x6')+i,'phone':0xf879fb460+i,'email':_0xd455('0x3')+i+_0xd455('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xd455('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xd455('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xd455('0x5')](),'updatedAt':Date[_0xd455('0x5')]()});}db[_0xd455('0x7')][_0xd455('0x8')]({'where':{}})[_0xd455('0x9')](function(){return db[_0xd455('0x7')]['bulkCreate'](contacts);})[_0xd455('0x9')](function(){console['log'](_0xd455('0xa'),_0xd455('0xb'));return db[_0xd455('0xc')][_0xd455('0x8')]({'where':{}});})['then'](function(){return db['CmHopper'][_0xd455('0xd')](hopper);})['then'](function(){console[_0xd455('0xe')](_0xd455('0xa'),_0xd455('0xf'));return db[_0xd455('0x7')][_0xd455('0xd')](contacts2);})['then'](function(){console[_0xd455('0xe')]('finished\x20populating','contacts2');return db[_0xd455('0xc')][_0xd455('0xd')](hopper2);})[_0xd455('0x9')](function(){console[_0xd455('0xe')](_0xd455('0xa'),_0xd455('0x10'));})[_0xd455('0x11')](function(_0x57b143){console[_0xd455('0xe')](_0x57b143);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index c344099..023f5bf 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6a0c=['add\x20user','util','../mysqldb','push','%s%s','agent','format','%s%s@xcally.com','password','friend','udp','wss','all','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then'];(function(_0x2134b2,_0x5a82aa){var _0x4e4bc8=function(_0x5816b6){while(--_0x5816b6){_0x2134b2['push'](_0x2134b2['shift']());}};_0x4e4bc8(++_0x5a82aa);}(_0x6a0c,0x105));var _0xc6a0=function(_0x27c87b,_0x5bca0b){_0x27c87b=_0x27c87b-0x0;var _0x1a7e13=_0x6a0c[_0x27c87b];return _0x1a7e13;};'use strict';var util=require(_0xc6a0('0x0'));var db=require(_0xc6a0('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc6a0('0x2')]({'name':util['format'](_0xc6a0('0x3'),_0xc6a0('0x4'),i),'fullname':util[_0xc6a0('0x5')](_0xc6a0('0x3'),_0xc6a0('0x4'),i),'email':util[_0xc6a0('0x5')](_0xc6a0('0x6'),'agent',i),'role':'agent','password':_0xc6a0('0x7'),'internal':0xfa0+i,'type':_0xc6a0('0x8'),'transport':[_0xc6a0('0x9'),'ws',_0xc6a0('0xa')],'disallow':[_0xc6a0('0xb')],'allow':['ulaw'],'defaultuser':util[_0xc6a0('0x5')](_0xc6a0('0x3'),_0xc6a0('0x4'),i),'encryption':_0xc6a0('0xc'),'avpf':_0xc6a0('0xc'),'force_avp':_0xc6a0('0xc'),'icesupport':_0xc6a0('0xc'),'dtlsenable':_0xc6a0('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xc6a0('0xd'),'dtlssetup':_0xc6a0('0xe'),'callerid':util[_0xc6a0('0x5')](_0xc6a0('0xf'),util[_0xc6a0('0x5')](_0xc6a0('0x3'),_0xc6a0('0x4'),i),0xfa0+i)});}db[_0xc6a0('0x10')][_0xc6a0('0x11')](users)[_0xc6a0('0x12')](function(){console['log'](_0xc6a0('0x13'));})['catch'](function(_0x54c9bb){console['log'](_0x54c9bb);}); \ No newline at end of file +var _0x7c96=['/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','catch','push','format','%s%s@xcally.com','agent','password','friend','udp','wss','ulaw','%s%s','yes','/etc/pki/tls/certs/motion.crt'];(function(_0x1895b7,_0x21fbc7){var _0x1aecdc=function(_0x44682a){while(--_0x44682a){_0x1895b7['push'](_0x1895b7['shift']());}};_0x1aecdc(++_0x21fbc7);}(_0x7c96,0xf8));var _0x67c9=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x7c96[_0x26b80e];return _0x84a8a8;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x67c9('0x0')]({'name':util[_0x67c9('0x1')]('%s%s','agent',i),'fullname':util[_0x67c9('0x1')]('%s%s','agent',i),'email':util[_0x67c9('0x1')](_0x67c9('0x2'),'agent',i),'role':_0x67c9('0x3'),'password':_0x67c9('0x4'),'internal':0xfa0+i,'type':_0x67c9('0x5'),'transport':[_0x67c9('0x6'),'ws',_0x67c9('0x7')],'disallow':['all'],'allow':[_0x67c9('0x8')],'defaultuser':util['format'](_0x67c9('0x9'),_0x67c9('0x3'),i),'encryption':_0x67c9('0xa'),'avpf':_0x67c9('0xa'),'force_avp':_0x67c9('0xa'),'icesupport':_0x67c9('0xa'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x67c9('0xb'),'dtlsprivatekey':_0x67c9('0xc'),'dtlssetup':_0x67c9('0xd'),'callerid':util[_0x67c9('0x1')](_0x67c9('0xe'),util[_0x67c9('0x1')](_0x67c9('0x9'),_0x67c9('0x3'),i),0xfa0+i)});}db[_0x67c9('0xf')][_0x67c9('0x10')](users)['then'](function(){console[_0x67c9('0x11')](_0x67c9('0x12'));})[_0x67c9('0x13')](function(_0x22abcf){console[_0x67c9('0x11')](_0x22abcf);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index e02684c..3039ddd 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff21=['findOne','then','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','ivr','%s:queue:%s','length','format','user:%s','handshake','query','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','voice:inbound','VoiceQueues','userProfileId','ChatQueues','FaxQueues','MailQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','voice','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','name','Agents','User','role','agent','telephone','type','UserProfileSection'];(function(_0x279d86,_0x247a92){var _0x2048ba=function(_0x5938f3){while(--_0x5938f3){_0x279d86['push'](_0x279d86['shift']());}};_0x2048ba(++_0x247a92);}(_0xff21,0x1da));var _0x1ff2=function(_0x20073b,_0x9c031e){_0x20073b=_0x20073b-0x0;var _0x428d14=_0xff21[_0x20073b];return _0x428d14;};'use strict';var _=require('lodash');var util=require(_0x1ff2('0x0'));var BPromise=require(_0x1ff2('0x1'));var db=require(_0x1ff2('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x1ff2('0x3')],'include':[{'as':_0x1ff2('0x4'),'model':db[_0x1ff2('0x5')],'attributes':['id',_0x1ff2('0x3'),_0x1ff2('0x6')],'raw':!![],'where':{'role':_0x1ff2('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1ff2('0x3')],'where':{'role':_0x1ff2('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x1ff2('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x1ff2('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1ff2('0x3'),_0x1ff2('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x29a7e3,_0x301bfb,_0x145479){return db[_0x1ff2('0xa')][_0x1ff2('0xb')]({'where':{'name':_0x29a7e3,'userProfileId':_0x301bfb},'raw':!![]})[_0x1ff2('0xc')](function(_0xff382b){if(_0xff382b){if(_0xff382b['autoAssociation']){switch(_0x29a7e3){case'VoiceQueues':case'ChatQueues':case'FaxQueues':case _0x1ff2('0xd'):case _0x1ff2('0xe'):case _0x1ff2('0xf'):case _0x1ff2('0x10'):return db[_0x145479][_0x1ff2('0x11')](queryQueues);case'Telephones':return db[_0x145479][_0x1ff2('0x11')](queryTelephones);case _0x1ff2('0x12'):return db[_0x145479]['findAll'](queryTrunks);case _0x1ff2('0x13'):return db[_0x145479]['findAll'](queryCampaigns);}}else{return db[_0x1ff2('0x14')]['findAll']({'attributes':[_0x1ff2('0x15')],'where':{'sectionId':_0xff382b['id']},'raw':!![]})[_0x1ff2('0xc')](function(_0xa7e0d0){if(_0xa7e0d0){var _0x4d8894={'where':{'id':_['map'](_0xa7e0d0,_0x1ff2('0x15'))},'raw':!![]};switch(_0x145479){case _0x1ff2('0x5'):_0x4d8894[_0x1ff2('0x16')][_0x1ff2('0x6')]=_0x1ff2('0x8');break;case'Campaign':_0x4d8894[_0x1ff2('0x16')][_0x1ff2('0x9')]=_0x1ff2('0x17');break;}return db[_0x145479]['findAll'](_0x4d8894);}else{return[];}});}}else{return[];}})['then'](function(_0x1e50ac){return _0x1e50ac;});}function joinOrLeaveQueues(_0x11749b,_0x4c79ae,_0x3adf67,_0x277917){_0x11749b[_0x4c79ae](util['format'](_0x1ff2('0x18'),_0x3adf67,_0x277917['name']));if(_0x277917[_0x1ff2('0x4')]){for(var _0x10584f=0x0;_0x10584f<_0x277917[_0x1ff2('0x4')][_0x1ff2('0x19')];_0x10584f+=0x1){_0x11749b[_0x4c79ae](util[_0x1ff2('0x1a')](_0x1ff2('0x1b'),_0x277917['Agents'][_0x10584f]['name']));}}}function joinOrLeave(_0x3b2879,_0x55dfb5,_0x4b5c91){var _0x1eaaf7;if(_0x3b2879[_0x1ff2('0x1c')]['query']['id']){db[_0x1ff2('0x5')]['find']({'attributes':['id',_0x1ff2('0x3'),_0x1ff2('0x6'),'userProfileId'],'where':{'id':_0x3b2879[_0x1ff2('0x1c')][_0x1ff2('0x1d')]['id']},'include':[{'model':db[_0x1ff2('0x1e')],'as':_0x1ff2('0x1f'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x1ff2('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x1ff2('0x21')],'as':_0x1ff2('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x1ff2('0x23')],'as':_0x1ff2('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x1ff2('0x25')],'as':_0x1ff2('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x1ff2('0x27')],'as':_0x1ff2('0x28'),'attributes':['id'],'raw':!![]}]})[_0x1ff2('0xc')](function(_0x28708a){if(_0x28708a){_0x1eaaf7=_0x28708a;_0x3b2879[_0x55dfb5](util[_0x1ff2('0x1a')](_0x1ff2('0x1b'),_0x28708a[_0x1ff2('0x3')]));var _0x24d598=[];switch(_0x28708a[_0x1ff2('0x6')]){case _0x1ff2('0x29'):_0x3b2879[_0x55dfb5]('voice:inbound');_0x3b2879[_0x55dfb5](_0x1ff2('0x2a'));if(queryQueues['hasOwnProperty'](_0x1ff2('0x2b'))){delete queryQueues[_0x1ff2('0x2b')];}_0x24d598[_0x1ff2('0x2c')](db[_0x1ff2('0x2d')]['findAll'](queryQueues));_0x24d598[_0x1ff2('0x2c')](db[_0x1ff2('0x2e')]['findAll'](queryQueues));_0x24d598[_0x1ff2('0x2c')](db[_0x1ff2('0x2f')]['findAll'](queryQueues));_0x24d598[_0x1ff2('0x2c')](db[_0x1ff2('0x30')][_0x1ff2('0x11')](queryQueues));_0x24d598[_0x1ff2('0x2c')](db['MailQueue'][_0x1ff2('0x11')](queryQueues));_0x24d598[_0x1ff2('0x2c')](db[_0x1ff2('0x31')]['findAll'](queryQueues));_0x24d598[_0x1ff2('0x2c')](db[_0x1ff2('0x32')][_0x1ff2('0x11')](queryQueues));_0x24d598[_0x1ff2('0x2c')](db['User'][_0x1ff2('0x11')](queryTelephones));_0x24d598[_0x1ff2('0x2c')](db[_0x1ff2('0x33')]['findAll'](queryTrunks));_0x24d598[_0x1ff2('0x2c')](db[_0x1ff2('0x34')][_0x1ff2('0x11')](queryCampaigns));_0x24d598[_0x1ff2('0x2c')](db[_0x1ff2('0x5')]['findAll'](queryAgents));break;case'user':_0x3b2879[_0x55dfb5](_0x1ff2('0x35'));_0x3b2879[_0x55dfb5]('voice:outbound');_0x24d598[_0x1ff2('0x2c')](getAssociatedResources(_0x1ff2('0x36'),_0x28708a[_0x1ff2('0x37')],_0x1ff2('0x2d')));_0x24d598[_0x1ff2('0x2c')](getAssociatedResources(_0x1ff2('0x38'),_0x28708a['userProfileId'],_0x1ff2('0x2e')));_0x24d598[_0x1ff2('0x2c')](getAssociatedResources(_0x1ff2('0x39'),_0x28708a[_0x1ff2('0x37')],_0x1ff2('0x2f')));_0x24d598['push'](getAssociatedResources('SmsQueues',_0x28708a[_0x1ff2('0x37')],_0x1ff2('0x30')));_0x24d598[_0x1ff2('0x2c')](getAssociatedResources(_0x1ff2('0xe'),_0x28708a[_0x1ff2('0x37')],_0x1ff2('0x3a')));_0x24d598[_0x1ff2('0x2c')](getAssociatedResources(_0x1ff2('0xf'),_0x28708a[_0x1ff2('0x37')],_0x1ff2('0x31')));_0x24d598[_0x1ff2('0x2c')](getAssociatedResources(_0x1ff2('0x10'),_0x28708a[_0x1ff2('0x37')],_0x1ff2('0x32')));_0x24d598['push'](getAssociatedResources('Telephones',_0x28708a['userProfileId'],_0x1ff2('0x5')));_0x24d598[_0x1ff2('0x2c')](getAssociatedResources(_0x1ff2('0x12'),_0x28708a['userProfileId'],_0x1ff2('0x33')));_0x24d598[_0x1ff2('0x2c')](getAssociatedResources('IvrCampaigns',_0x28708a[_0x1ff2('0x37')],_0x1ff2('0x34')));_0x24d598[_0x1ff2('0x2c')](db[_0x1ff2('0x5')][_0x1ff2('0x11')](queryAgents));break;case'agent':_0x3b2879[_0x55dfb5](_0x1ff2('0x35'));_0x3b2879[_0x55dfb5](_0x1ff2('0x2a'));_0x24d598[_0x1ff2('0x2c')](_0x28708a[_0x1ff2('0x3b')]({'attributes':['id',_0x1ff2('0x3')]}));_0x24d598[_0x1ff2('0x2c')](_0x28708a[_0x1ff2('0x3c')]({'attributes':['id',_0x1ff2('0x3')]}));_0x24d598[_0x1ff2('0x2c')](_0x28708a[_0x1ff2('0x3d')]({'attributes':['id',_0x1ff2('0x3')]}));_0x24d598[_0x1ff2('0x2c')](_0x28708a[_0x1ff2('0x3e')]({'attributes':['id',_0x1ff2('0x3')]}));_0x24d598[_0x1ff2('0x2c')](_0x28708a['getMailQueues']({'attributes':['id',_0x1ff2('0x3')]}));_0x24d598['push'](_0x28708a[_0x1ff2('0x3f')]({'attributes':['id',_0x1ff2('0x3')]}));_0x24d598[_0x1ff2('0x2c')](_0x28708a[_0x1ff2('0x40')]({'attributes':['id',_0x1ff2('0x3')]}));break;}return BPromise['all'](_0x24d598);}})[_0x1ff2('0xc')](function(_0x5d6dc2){if(_0x5d6dc2&&_0x5d6dc2['length']){for(var _0x1f0752=0x0;_0x1f0752<_0x5d6dc2[_0x1ff2('0x19')];_0x1f0752+=0x1){for(var _0x495c1a=0x0;_0x495c1a<_0x5d6dc2[_0x1f0752][_0x1ff2('0x19')];_0x495c1a+=0x1){switch(_0x1f0752){case 0x0:joinOrLeaveQueues(_0x3b2879,_0x55dfb5,_0x1ff2('0x41'),_0x5d6dc2[_0x1f0752][_0x495c1a]);break;case 0x1:joinOrLeaveQueues(_0x3b2879,_0x55dfb5,'chat',_0x5d6dc2[_0x1f0752][_0x495c1a]);break;case 0x2:joinOrLeaveQueues(_0x3b2879,_0x55dfb5,'fax',_0x5d6dc2[_0x1f0752][_0x495c1a]);break;case 0x3:joinOrLeaveQueues(_0x3b2879,_0x55dfb5,'sms',_0x5d6dc2[_0x1f0752][_0x495c1a]);break;case 0x4:joinOrLeaveQueues(_0x3b2879,_0x55dfb5,'mail',_0x5d6dc2[_0x1f0752][_0x495c1a]);break;case 0x5:joinOrLeaveQueues(_0x3b2879,_0x55dfb5,_0x1ff2('0x42'),_0x5d6dc2[_0x1f0752][_0x495c1a]);break;case 0x6:joinOrLeaveQueues(_0x3b2879,_0x55dfb5,_0x1ff2('0x43'),_0x5d6dc2[_0x1f0752][_0x495c1a]);break;case 0x7:_0x3b2879[_0x55dfb5](util['format'](_0x1ff2('0x44'),_0x5d6dc2[_0x1f0752][_0x495c1a]['name']));break;case 0x8:_0x3b2879[_0x55dfb5](util[_0x1ff2('0x1a')](_0x1ff2('0x45'),_0x5d6dc2[_0x1f0752][_0x495c1a]['name']));break;case 0x9:_0x3b2879[_0x55dfb5](util[_0x1ff2('0x1a')](_0x1ff2('0x46'),_0x5d6dc2[_0x1f0752][_0x495c1a][_0x1ff2('0x9')],_0x5d6dc2[_0x1f0752][_0x495c1a][_0x1ff2('0x3')]));break;case 0xa:_0x3b2879[_0x55dfb5](util[_0x1ff2('0x1a')](_0x1ff2('0x1b'),_0x5d6dc2[_0x1f0752][_0x495c1a]['name']));break;}}}}})[_0x1ff2('0xc')](function(){if(_0x55dfb5===_0x1ff2('0x47')){var _0x342657=_[_0x1ff2('0x48')](_0x1eaaf7['ChatInteractions'],'id');return _0x1eaaf7[_0x1ff2('0x49')](_0x342657)[_0x1ff2('0xc')](function(){for(var _0x561424=0x0;_0x561424<_0x342657[_0x1ff2('0x19')];_0x561424+=0x1){_0x4b5c91[_0x1ff2('0x4a')](_0x1ff2('0x4b'),{'ChatInteractionId':Number(_0x342657[_0x561424]),'UserId':Number(_0x1eaaf7['id'])});}});}})[_0x1ff2('0xc')](function(){if(_0x55dfb5===_0x1ff2('0x47')){var _0x2e0f93=_[_0x1ff2('0x48')](_0x1eaaf7[_0x1ff2('0x20')],'id');return _0x1eaaf7['removeMailInteractions'](_0x2e0f93)[_0x1ff2('0xc')](function(){for(var _0x1ace75=0x0;_0x1ace75<_0x2e0f93[_0x1ff2('0x19')];_0x1ace75+=0x1){_0x4b5c91[_0x1ff2('0x4a')](_0x1ff2('0x4c'),{'MailInteractionId':Number(_0x2e0f93[_0x1ace75]),'UserId':Number(_0x1eaaf7['id'])});}});}})[_0x1ff2('0xc')](function(){if(_0x55dfb5===_0x1ff2('0x47')){var _0x24a1bc=_[_0x1ff2('0x48')](_0x1eaaf7['FaxInteractions'],'id');return _0x1eaaf7[_0x1ff2('0x4d')](_0x24a1bc)[_0x1ff2('0xc')](function(){for(var _0x133977=0x0;_0x133977<_0x24a1bc[_0x1ff2('0x19')];_0x133977+=0x1){_0x4b5c91[_0x1ff2('0x4a')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x24a1bc[_0x133977]),'UserId':Number(_0x1eaaf7['id'])});}});}})['then'](function(){if(_0x55dfb5===_0x1ff2('0x47')){var _0x424ca5=_[_0x1ff2('0x48')](_0x1eaaf7[_0x1ff2('0x24')],'id');return _0x1eaaf7[_0x1ff2('0x4e')](_0x424ca5)[_0x1ff2('0xc')](function(){for(var _0x2bc4b8=0x0;_0x2bc4b8<_0x424ca5[_0x1ff2('0x19')];_0x2bc4b8+=0x1){_0x4b5c91[_0x1ff2('0x4a')](_0x1ff2('0x4f'),{'SmsInteractionId':Number(_0x424ca5[_0x2bc4b8]),'UserId':Number(_0x1eaaf7['id'])});}});}})[_0x1ff2('0xc')](function(){if(_0x55dfb5===_0x1ff2('0x47')){var _0xa06f16=_['map'](_0x1eaaf7['OpenchannelInteractions'],'id');return _0x1eaaf7['removeOpenchannelInteractions'](_0xa06f16)[_0x1ff2('0xc')](function(){for(var _0x120343=0x0;_0x120343<_0xa06f16['length'];_0x120343+=0x1){_0x4b5c91['emit'](_0x1ff2('0x50'),{'OpenchannelInteractionId':Number(_0xa06f16[_0x120343]),'UserId':Number(_0x1eaaf7['id'])});}});}})['then'](function(){if(_0x55dfb5===_0x1ff2('0x47')){var _0x29413b=_[_0x1ff2('0x48')](_0x1eaaf7[_0x1ff2('0x28')],'id');return _0x1eaaf7[_0x1ff2('0x51')](_0x29413b)[_0x1ff2('0xc')](function(){for(var _0x114872=0x0;_0x114872<_0x29413b[_0x1ff2('0x19')];_0x114872+=0x1){_0x4b5c91[_0x1ff2('0x4a')](_0x1ff2('0x52'),{'WhatsappInteractionId':Number(_0x29413b[_0x114872]),'UserId':Number(_0x1eaaf7['id'])});}});}})[_0x1ff2('0x53')](function(_0x4de3b4){_0x3b2879[_0x1ff2('0x54')](_0x4de3b4);});}}function onDisconnect(_0x16bb73,_0x4c64a6){joinOrLeave(_0x16bb73,_0x1ff2('0x47'),_0x4c64a6);}function onConnect(_0x46cf82){joinOrLeave(_0x46cf82,_0x1ff2('0x55'));}exports[_0x1ff2('0x56')]=function(_0x1f4006){_0x1f4006['on'](_0x1ff2('0x57'),function(_0x8e5859){_0x8e5859['setMaxListeners'](0x0);_0x8e5859[_0x1ff2('0x58')]=_0x8e5859[_0x1ff2('0x59')][_0x1ff2('0x57')][_0x1ff2('0x5a')]+':'+_0x8e5859[_0x1ff2('0x59')][_0x1ff2('0x57')][_0x1ff2('0x5b')];_0x8e5859[_0x1ff2('0x5c')]=new Date();_0x8e5859[_0x1ff2('0x54')]=function(_0x304ac7){console[_0x1ff2('0x54')](_0x1ff2('0x5d')+_0x8e5859['nsp']['name']+'['+_0x8e5859[_0x1ff2('0x58')]+']',_0x304ac7);};_0x8e5859['on'](_0x1ff2('0x5e'),function(){onDisconnect(_0x8e5859,_0x1f4006);_0x8e5859['log'](_0x1ff2('0x5f'));});onConnect(_0x8e5859);_0x8e5859['log'](_0x1ff2('0x60'));});}; \ No newline at end of file +var _0x05e6=['trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','MailInteractions','removeMailInteractions','emit','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','type','then','autoAssociation','VoiceQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','map','where','telephone','format','%s:queue:%s','length','user:%s','handshake','query','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','ChatQueue','push','SmsQueue','Trunk','Campaign','user','userProfileId','ChatQueues','FaxQueue','MailQueues','MailQueue','OpenchannelQueue','WhatsappQueue','agent','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','chat','fax','sms','mail','whatsapp','telephone:%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05e6,0x1af));var _0x605e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x05e6[_0x187ee1];return _0x388160;};'use strict';var _=require(_0x605e('0x0'));var util=require(_0x605e('0x1'));var BPromise=require(_0x605e('0x2'));var db=require(_0x605e('0x3'))['db'];var config=require(_0x605e('0x4'));var queryQueues={'attributes':['id',_0x605e('0x5')],'include':[{'as':_0x605e('0x6'),'model':db[_0x605e('0x7')],'attributes':['id','name',_0x605e('0x8')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x605e('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x605e('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x605e('0x5')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x605e('0x5'),_0x605e('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x2f123a,_0x5802e7,_0x388427){return db['UserProfileSection']['findOne']({'where':{'name':_0x2f123a,'userProfileId':_0x5802e7},'raw':!![]})[_0x605e('0xa')](function(_0x12db27){if(_0x12db27){if(_0x12db27[_0x605e('0xb')]){switch(_0x2f123a){case _0x605e('0xc'):case'ChatQueues':case _0x605e('0xd'):case _0x605e('0xe'):case'MailQueues':case _0x605e('0xf'):case _0x605e('0x10'):return db[_0x388427]['findAll'](queryQueues);case _0x605e('0x11'):return db[_0x388427][_0x605e('0x12')](queryTelephones);case _0x605e('0x13'):return db[_0x388427]['findAll'](queryTrunks);case _0x605e('0x14'):return db[_0x388427][_0x605e('0x12')](queryCampaigns);}}else{return db[_0x605e('0x15')][_0x605e('0x12')]({'attributes':['resourceId'],'where':{'sectionId':_0x12db27['id']},'raw':!![]})[_0x605e('0xa')](function(_0x566831){if(_0x566831){var _0x1df3c2={'where':{'id':_[_0x605e('0x16')](_0x566831,'resourceId')},'raw':!![]};switch(_0x388427){case _0x605e('0x7'):_0x1df3c2[_0x605e('0x17')][_0x605e('0x8')]=_0x605e('0x18');break;case'Campaign':_0x1df3c2[_0x605e('0x17')]['type']='ivr';break;}return db[_0x388427][_0x605e('0x12')](_0x1df3c2);}else{return[];}});}}else{return[];}})[_0x605e('0xa')](function(_0x47ad70){return _0x47ad70;});}function joinOrLeaveQueues(_0x985671,_0x196754,_0x4cfd0a,_0x20859e){_0x985671[_0x196754](util[_0x605e('0x19')](_0x605e('0x1a'),_0x4cfd0a,_0x20859e[_0x605e('0x5')]));if(_0x20859e[_0x605e('0x6')]){for(var _0x188506=0x0;_0x188506<_0x20859e[_0x605e('0x6')][_0x605e('0x1b')];_0x188506+=0x1){_0x985671[_0x196754](util[_0x605e('0x19')](_0x605e('0x1c'),_0x20859e[_0x605e('0x6')][_0x188506][_0x605e('0x5')]));}}}function joinOrLeave(_0xce873a,_0x3349df,_0x9a56d3){var _0x3124a5;if(_0xce873a[_0x605e('0x1d')]['query']['id']){db[_0x605e('0x7')]['find']({'attributes':['id',_0x605e('0x5'),_0x605e('0x8'),'userProfileId'],'where':{'id':_0xce873a[_0x605e('0x1d')][_0x605e('0x1e')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x605e('0x1f')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x605e('0x20')],'as':_0x605e('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x605e('0x22')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x605e('0x23')],'as':_0x605e('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x605e('0x25')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x605e('0xa')](function(_0x37fbfb){if(_0x37fbfb){_0x3124a5=_0x37fbfb;_0xce873a[_0x3349df](util['format'](_0x605e('0x1c'),_0x37fbfb['name']));var _0x3fa81b=[];switch(_0x37fbfb[_0x605e('0x8')]){case _0x605e('0x26'):_0xce873a[_0x3349df](_0x605e('0x27'));_0xce873a[_0x3349df](_0x605e('0x28'));if(queryQueues[_0x605e('0x29')](_0x605e('0x2a'))){delete queryQueues[_0x605e('0x2a')];}_0x3fa81b['push'](db[_0x605e('0x2b')][_0x605e('0x12')](queryQueues));_0x3fa81b['push'](db[_0x605e('0x2c')][_0x605e('0x12')](queryQueues));_0x3fa81b[_0x605e('0x2d')](db['FaxQueue'][_0x605e('0x12')](queryQueues));_0x3fa81b[_0x605e('0x2d')](db[_0x605e('0x2e')]['findAll'](queryQueues));_0x3fa81b[_0x605e('0x2d')](db['MailQueue'][_0x605e('0x12')](queryQueues));_0x3fa81b['push'](db['OpenchannelQueue'][_0x605e('0x12')](queryQueues));_0x3fa81b['push'](db['WhatsappQueue']['findAll'](queryQueues));_0x3fa81b[_0x605e('0x2d')](db['User'][_0x605e('0x12')](queryTelephones));_0x3fa81b[_0x605e('0x2d')](db[_0x605e('0x2f')][_0x605e('0x12')](queryTrunks));_0x3fa81b[_0x605e('0x2d')](db[_0x605e('0x30')][_0x605e('0x12')](queryCampaigns));_0x3fa81b['push'](db[_0x605e('0x7')][_0x605e('0x12')](queryAgents));break;case _0x605e('0x31'):_0xce873a[_0x3349df](_0x605e('0x27'));_0xce873a[_0x3349df](_0x605e('0x28'));_0x3fa81b[_0x605e('0x2d')](getAssociatedResources(_0x605e('0xc'),_0x37fbfb[_0x605e('0x32')],_0x605e('0x2b')));_0x3fa81b[_0x605e('0x2d')](getAssociatedResources(_0x605e('0x33'),_0x37fbfb['userProfileId'],_0x605e('0x2c')));_0x3fa81b['push'](getAssociatedResources(_0x605e('0xd'),_0x37fbfb[_0x605e('0x32')],_0x605e('0x34')));_0x3fa81b['push'](getAssociatedResources(_0x605e('0xe'),_0x37fbfb[_0x605e('0x32')],_0x605e('0x2e')));_0x3fa81b['push'](getAssociatedResources(_0x605e('0x35'),_0x37fbfb[_0x605e('0x32')],_0x605e('0x36')));_0x3fa81b[_0x605e('0x2d')](getAssociatedResources(_0x605e('0xf'),_0x37fbfb['userProfileId'],_0x605e('0x37')));_0x3fa81b[_0x605e('0x2d')](getAssociatedResources(_0x605e('0x10'),_0x37fbfb[_0x605e('0x32')],_0x605e('0x38')));_0x3fa81b['push'](getAssociatedResources(_0x605e('0x11'),_0x37fbfb['userProfileId'],_0x605e('0x7')));_0x3fa81b[_0x605e('0x2d')](getAssociatedResources('Trunks',_0x37fbfb['userProfileId'],_0x605e('0x2f')));_0x3fa81b[_0x605e('0x2d')](getAssociatedResources(_0x605e('0x14'),_0x37fbfb[_0x605e('0x32')],'Campaign'));_0x3fa81b[_0x605e('0x2d')](db[_0x605e('0x7')][_0x605e('0x12')](queryAgents));break;case _0x605e('0x39'):_0xce873a[_0x3349df](_0x605e('0x27'));_0xce873a[_0x3349df]('voice:outbound');_0x3fa81b[_0x605e('0x2d')](_0x37fbfb['getVoiceQueues']({'attributes':['id','name']}));_0x3fa81b[_0x605e('0x2d')](_0x37fbfb[_0x605e('0x3a')]({'attributes':['id',_0x605e('0x5')]}));_0x3fa81b[_0x605e('0x2d')](_0x37fbfb[_0x605e('0x3b')]({'attributes':['id',_0x605e('0x5')]}));_0x3fa81b['push'](_0x37fbfb['getSmsQueues']({'attributes':['id','name']}));_0x3fa81b[_0x605e('0x2d')](_0x37fbfb[_0x605e('0x3c')]({'attributes':['id','name']}));_0x3fa81b['push'](_0x37fbfb[_0x605e('0x3d')]({'attributes':['id','name']}));_0x3fa81b['push'](_0x37fbfb[_0x605e('0x3e')]({'attributes':['id','name']}));break;}return BPromise['all'](_0x3fa81b);}})[_0x605e('0xa')](function(_0x90c3d6){if(_0x90c3d6&&_0x90c3d6[_0x605e('0x1b')]){for(var _0xcd0135=0x0;_0xcd0135<_0x90c3d6[_0x605e('0x1b')];_0xcd0135+=0x1){for(var _0x18e9c1=0x0;_0x18e9c1<_0x90c3d6[_0xcd0135][_0x605e('0x1b')];_0x18e9c1+=0x1){switch(_0xcd0135){case 0x0:joinOrLeaveQueues(_0xce873a,_0x3349df,'voice',_0x90c3d6[_0xcd0135][_0x18e9c1]);break;case 0x1:joinOrLeaveQueues(_0xce873a,_0x3349df,_0x605e('0x3f'),_0x90c3d6[_0xcd0135][_0x18e9c1]);break;case 0x2:joinOrLeaveQueues(_0xce873a,_0x3349df,_0x605e('0x40'),_0x90c3d6[_0xcd0135][_0x18e9c1]);break;case 0x3:joinOrLeaveQueues(_0xce873a,_0x3349df,_0x605e('0x41'),_0x90c3d6[_0xcd0135][_0x18e9c1]);break;case 0x4:joinOrLeaveQueues(_0xce873a,_0x3349df,_0x605e('0x42'),_0x90c3d6[_0xcd0135][_0x18e9c1]);break;case 0x5:joinOrLeaveQueues(_0xce873a,_0x3349df,'openchannel',_0x90c3d6[_0xcd0135][_0x18e9c1]);break;case 0x6:joinOrLeaveQueues(_0xce873a,_0x3349df,_0x605e('0x43'),_0x90c3d6[_0xcd0135][_0x18e9c1]);break;case 0x7:_0xce873a[_0x3349df](util[_0x605e('0x19')](_0x605e('0x44'),_0x90c3d6[_0xcd0135][_0x18e9c1][_0x605e('0x5')]));break;case 0x8:_0xce873a[_0x3349df](util['format'](_0x605e('0x45'),_0x90c3d6[_0xcd0135][_0x18e9c1][_0x605e('0x5')]));break;case 0x9:_0xce873a[_0x3349df](util[_0x605e('0x19')](_0x605e('0x46'),_0x90c3d6[_0xcd0135][_0x18e9c1][_0x605e('0x9')],_0x90c3d6[_0xcd0135][_0x18e9c1][_0x605e('0x5')]));break;case 0xa:_0xce873a[_0x3349df](util[_0x605e('0x19')]('user:%s',_0x90c3d6[_0xcd0135][_0x18e9c1][_0x605e('0x5')]));break;}}}}})[_0x605e('0xa')](function(){if(_0x3349df===_0x605e('0x47')){var _0x1a6895=_[_0x605e('0x16')](_0x3124a5[_0x605e('0x48')],'id');return _0x3124a5[_0x605e('0x49')](_0x1a6895)[_0x605e('0xa')](function(){for(var _0x301152=0x0;_0x301152<_0x1a6895[_0x605e('0x1b')];_0x301152+=0x1){_0x9a56d3['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x1a6895[_0x301152]),'UserId':Number(_0x3124a5['id'])});}});}})[_0x605e('0xa')](function(){if(_0x3349df===_0x605e('0x47')){var _0xa53f2b=_[_0x605e('0x16')](_0x3124a5[_0x605e('0x4a')],'id');return _0x3124a5[_0x605e('0x4b')](_0xa53f2b)[_0x605e('0xa')](function(){for(var _0xfc8c22=0x0;_0xfc8c22<_0xa53f2b[_0x605e('0x1b')];_0xfc8c22+=0x1){_0x9a56d3['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xa53f2b[_0xfc8c22]),'UserId':Number(_0x3124a5['id'])});}});}})['then'](function(){if(_0x3349df===_0x605e('0x47')){var _0x155004=_[_0x605e('0x16')](_0x3124a5[_0x605e('0x21')],'id');return _0x3124a5['removeFaxInteractions'](_0x155004)['then'](function(){for(var _0x983cf0=0x0;_0x983cf0<_0x155004['length'];_0x983cf0+=0x1){_0x9a56d3[_0x605e('0x4c')](_0x605e('0x4d'),{'FaxInteractionId':Number(_0x155004[_0x983cf0]),'UserId':Number(_0x3124a5['id'])});}});}})[_0x605e('0xa')](function(){if(_0x3349df===_0x605e('0x47')){var _0x3d3a09=_[_0x605e('0x16')](_0x3124a5[_0x605e('0x4e')],'id');return _0x3124a5[_0x605e('0x4f')](_0x3d3a09)['then'](function(){for(var _0x5325ad=0x0;_0x5325ad<_0x3d3a09['length'];_0x5325ad+=0x1){_0x9a56d3['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x3d3a09[_0x5325ad]),'UserId':Number(_0x3124a5['id'])});}});}})[_0x605e('0xa')](function(){if(_0x3349df===_0x605e('0x47')){var _0x146f0d=_[_0x605e('0x16')](_0x3124a5['OpenchannelInteractions'],'id');return _0x3124a5['removeOpenchannelInteractions'](_0x146f0d)[_0x605e('0xa')](function(){for(var _0x251e0e=0x0;_0x251e0e<_0x146f0d[_0x605e('0x1b')];_0x251e0e+=0x1){_0x9a56d3[_0x605e('0x4c')](_0x605e('0x50'),{'OpenchannelInteractionId':Number(_0x146f0d[_0x251e0e]),'UserId':Number(_0x3124a5['id'])});}});}})[_0x605e('0xa')](function(){if(_0x3349df===_0x605e('0x47')){var _0x51e917=_['map'](_0x3124a5[_0x605e('0x51')],'id');return _0x3124a5[_0x605e('0x52')](_0x51e917)['then'](function(){for(var _0x54005c=0x0;_0x54005c<_0x51e917[_0x605e('0x1b')];_0x54005c+=0x1){_0x9a56d3[_0x605e('0x4c')](_0x605e('0x53'),{'WhatsappInteractionId':Number(_0x51e917[_0x54005c]),'UserId':Number(_0x3124a5['id'])});}});}})[_0x605e('0x54')](function(_0x153180){_0xce873a['log'](_0x153180);});}}function onDisconnect(_0x32d9a4,_0x13f537){joinOrLeave(_0x32d9a4,_0x605e('0x47'),_0x13f537);}function onConnect(_0x1d7759){joinOrLeave(_0x1d7759,_0x605e('0x55'));}exports[_0x605e('0x56')]=function(_0x7ae4be){_0x7ae4be['on'](_0x605e('0x57'),function(_0x4d07bc){_0x4d07bc[_0x605e('0x58')](0x0);_0x4d07bc[_0x605e('0x59')]=_0x4d07bc[_0x605e('0x5a')][_0x605e('0x57')][_0x605e('0x5b')]+':'+_0x4d07bc['request'][_0x605e('0x57')][_0x605e('0x5c')];_0x4d07bc[_0x605e('0x5d')]=new Date();_0x4d07bc[_0x605e('0x5e')]=function(_0x1f09ba){console['log'](_0x605e('0x5f')+_0x4d07bc[_0x605e('0x60')][_0x605e('0x5')]+'['+_0x4d07bc[_0x605e('0x59')]+']',_0x1f09ba);};_0x4d07bc['on'](_0x605e('0x61'),function(){onDisconnect(_0x4d07bc,_0x7ae4be);_0x4d07bc[_0x605e('0x5e')](_0x605e('0x62'));});onConnect(_0x4d07bc);_0x4d07bc[_0x605e('0x5e')](_0x605e('0x63'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 504f3b2..65f1547 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 _0x056e=['format','incomingmessage','outgoingmessage','opened','closed','UserId','SIP/%s','default','length','hasOwnProperty','model','hook','callback','condition','jayson/promise','../logger','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','Sms','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','newmessage','Fax','FaxInteraction','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','info','EventManager','error','code','Trigger,\x20%s','catch','get','channel','event','direction','User','name','then','interface'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x056e,0x1c6));var _0xe056=function(_0x544099,_0x372b30){_0x544099=_0x544099-0x0;var _0x20ab09=_0x056e[_0x544099];return _0x20ab09;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require(_0xe056('0x0'));var logger=require(_0xe056('0x1'))(_0xe056('0x2'));var client=jayson[_0xe056('0x3')][_0xe056('0x4')]({'port':0x232a});var triggers=[{'channel':_0xe056('0x5'),'model':_0xe056('0x6'),'event':_0xe056('0x7'),'condition':_0xe056('0x8'),'callback':afterCreate},{'channel':'Chat','model':_0xe056('0x6'),'event':_0xe056('0x9'),'condition':_0xe056('0xa'),'callback':afterUpdate},{'channel':_0xe056('0x5'),'model':'ChatMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xe056('0xb'),'model':_0xe056('0xc'),'event':_0xe056('0x7'),'condition':_0xe056('0x8'),'callback':afterCreate},{'channel':'Sms','model':_0xe056('0xc'),'event':'afterUpdate','condition':_0xe056('0xa'),'callback':afterUpdate},{'channel':_0xe056('0xb'),'model':_0xe056('0xd'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0xe056('0xe'),'model':'WhatsappInteraction','event':'afterCreate','condition':_0xe056('0x8'),'callback':afterCreate},{'channel':'Whatsapp','model':_0xe056('0xf'),'event':_0xe056('0x9'),'condition':_0xe056('0xa'),'callback':afterUpdate},{'channel':_0xe056('0xe'),'model':_0xe056('0x10'),'event':'afterCreate','condition':_0xe056('0x11'),'callback':afterCreateMessage},{'channel':_0xe056('0x12'),'model':_0xe056('0x13'),'event':_0xe056('0x7'),'condition':_0xe056('0x8'),'callback':afterCreate},{'channel':_0xe056('0x12'),'model':_0xe056('0x13'),'event':_0xe056('0x9'),'condition':_0xe056('0xa'),'callback':afterUpdate},{'channel':_0xe056('0x12'),'model':'FaxMessage','event':'afterCreate','condition':_0xe056('0x11'),'callback':afterCreateMessage},{'channel':_0xe056('0x14'),'model':_0xe056('0x15'),'event':_0xe056('0x7'),'condition':_0xe056('0x8'),'callback':afterCreate},{'channel':_0xe056('0x14'),'model':_0xe056('0x15'),'event':_0xe056('0x9'),'condition':_0xe056('0xa'),'callback':afterUpdate},{'channel':_0xe056('0x14'),'model':_0xe056('0x16'),'event':_0xe056('0x7'),'condition':_0xe056('0x11'),'callback':afterCreateMessage},{'channel':_0xe056('0x17'),'model':'OpenchannelInteraction','event':_0xe056('0x7'),'condition':_0xe056('0x8'),'callback':afterCreate},{'channel':_0xe056('0x17'),'model':_0xe056('0x18'),'event':_0xe056('0x9'),'condition':_0xe056('0xa'),'callback':afterUpdate},{'channel':_0xe056('0x17'),'model':_0xe056('0x19'),'event':_0xe056('0x7'),'condition':_0xe056('0x11'),'callback':afterCreateMessage}];function request(_0x360ce2){return client[_0xe056('0x1a')]('EventManager',_0x360ce2)['then'](function(_0x48a252){logger[_0xe056('0x1b')]('Trigger,\x20%s',_0xe056('0x1c'),_0x48a252);if(_0x48a252['error']){if(_0x48a252[_0xe056('0x1d')][_0xe056('0x1e')]===0x1f4){logger['error'](_0xe056('0x1f'),_0xe056('0x1c'),_0x48a252[_0xe056('0x1d')]);}}})[_0xe056('0x20')](function(_0x4a1b0e){logger[_0xe056('0x1d')](_0xe056('0x1f'),_0xe056('0x1c'),_0x4a1b0e);});}function afterCreateMessage(_0x1daae5,_0x3712d4){return function(_0x44545e,_0x24d698){_0x44545e=_0x44545e[_0xe056('0x21')]({'plain':!![]});_0x44545e[_0xe056('0x22')]=_0x1daae5;_0x44545e[_0xe056('0x23')]=_0x44545e[_0xe056('0x24')];if(_0x44545e['UserId']){return db[_0xe056('0x25')]['find']({'where':{'id':_0x44545e['UserId']},'attributes':['id',_0xe056('0x26')],'raw':!![]})[_0xe056('0x27')](function(_0x2cd91e){_0x44545e[_0xe056('0x28')]=util[_0xe056('0x29')]('SIP/%s',_0x2cd91e['name']);_0x44545e[_0xe056('0x22')]=_0x1daae5;return request({'event':_0xe056('0x2a'),'message':_0x44545e});})['catch'](function(_0x45e801){console[_0xe056('0x1d')](_0x45e801);});}else{return request({'event':_0xe056('0x2b'),'message':_0x44545e});}};}function afterCreate(_0xc8ed8b,_0x71affc){return function(_0x16db17,_0x40a41f){_0x16db17=_0x16db17[_0xe056('0x21')]({'plain':!![]});_0x16db17[_0xe056('0x22')]=_0xc8ed8b;_0x16db17[_0xe056('0x23')]=_0xe056('0x2c');return request({'event':_0x71affc,'message':_0x16db17});};}function afterUpdate(_0xa67d97,_0x1977fb){return function(_0x122fb1,_0x390ef2){if(_0x122fb1['changed'](_0xe056('0x2d'))&&_0x122fb1[_0xe056('0x2d')]){_0x122fb1=_0x122fb1[_0xe056('0x21')]({'plain':!![]});_0x122fb1[_0xe056('0x22')]=_0xa67d97;_0x122fb1[_0xe056('0x23')]='closed';if(_0x122fb1[_0xe056('0x2e')]){return db[_0xe056('0x25')]['find']({'where':{'id':_0x122fb1[_0xe056('0x2e')]},'attributes':['id',_0xe056('0x26')],'raw':!![]})[_0xe056('0x27')](function(_0x195be6){_0x122fb1[_0xe056('0x28')]=util[_0xe056('0x29')](_0xe056('0x2f'),_0x195be6[_0xe056('0x26')]);return request({'event':_0x1977fb,'message':_0x122fb1});})['catch'](function(_0x3b7c52){console['error'](_0x3b7c52);});}else{return request({'event':_0x1977fb,'message':_0x122fb1});}}};}exports[_0xe056('0x30')]=function(){for(var _0x3c9d92=0x0;_0x3c9d92=_0x3bb192['agents']){throw Error(_0x4c4c('0x15'));}_0x47efef(_0x4a85ca);})[_0x4c4c('0x16')](function(_0x3de54c){_0x12783a(_0x3de54c);});});}; \ No newline at end of file +var _0xd16e=['chat','sms','whatsapp','openchannel','getChannels','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','lodash','bluebird','../mysqldb','./license/util','voice','mail'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xd16e,0xf7));var _0xed16=function(_0x4e2b4a,_0xa9798b){_0x4e2b4a=_0x4e2b4a-0x0;var _0x2ca442=_0xd16e[_0x4e2b4a];return _0x2ca442;};'use strict';var _=require(_0xed16('0x0'));var BPromise=require(_0xed16('0x1'));var db=require(_0xed16('0x2'))['db'];var util=require(_0xed16('0x3'));var channels=[_0xed16('0x4'),_0xed16('0x5'),_0xed16('0x6'),'fax',_0xed16('0x7'),_0xed16('0x8'),_0xed16('0x9')];exports[_0xed16('0xa')]=function(){return channels;};exports['isValidChannel']=function(_0x5b8cca){_0x5b8cca=_0x5b8cca[_0xed16('0xb')]();return _[_0xed16('0xc')](channels,_0x5b8cca);};exports[_0xed16('0xd')]=function(_0x28a653,_0x4cb541,_0x38d326,_0x112de8){var _0x2c780e={'loginAttempts':_0x4cb541,'blocked':_0x38d326};if(!_['isUndefined'](_0x112de8)){_0x2c780e[_0xed16('0xe')]=_0x112de8;}return _0x28a653[_0xed16('0xf')](_0x2c780e);};exports[_0xed16('0x10')]=function(_0x2f1290){return new BPromise(function(_0x553a3e,_0x4ad4d6){var _0x3531c7=0x0;if(_0x2f1290[_0xed16('0x11')]!==_0xed16('0x12')){_0x553a3e(_0x2f1290);}db[_0xed16('0x13')][_0xed16('0x14')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x2f1290['id']}}})[_0xed16('0x15')](function(_0x9c81a0){_0x3531c7=_0x9c81a0;return util[_0xed16('0x10')]();})[_0xed16('0x15')](function(_0x55c0fc){if(_0x55c0fc&&_0x55c0fc[_0xed16('0x16')]&&_0x3531c7>=_0x55c0fc[_0xed16('0x16')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x553a3e(_0x2f1290);})['catch'](function(_0x2aad2c){_0x4ad4d6(_0x2aad2c);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index af64634..cb2ca28 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x897e=['json','exports','404','status','render'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x897e,0xb0));var _0xe897=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x897e[_0x1694f5];return _0x5b4321;};'use strict';module[_0xe897('0x0')][0x194]=function pageNotFound(_0x900537,_0x44dba5){var _0x260083=_0xe897('0x1');var _0x83584c=0x194;var _0x3eae13={'status':_0x83584c};_0x44dba5[_0xe897('0x2')](_0x3eae13[_0xe897('0x2')]);_0x44dba5[_0xe897('0x3')](_0x260083,{},function(_0x4ec40a,_0xfbc6f8){if(_0x4ec40a){return _0x44dba5[_0xe897('0x2')](_0x3eae13[_0xe897('0x2')])[_0xe897('0x4')](_0x3eae13);}_0x44dba5['send'](_0xfbc6f8);});}; \ No newline at end of file +var _0x3a75=['exports','status','render','json','send'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3a75,0x1ef));var _0x53a7=function(_0xa78679,_0x14c54f){_0xa78679=_0xa78679-0x0;var _0x28abc5=_0x3a75[_0xa78679];return _0x28abc5;};'use strict';module[_0x53a7('0x0')][0x194]=function pageNotFound(_0x5e8299,_0x417d1a){var _0x46d88a='404';var _0x43b0d1=0x194;var _0x502648={'status':_0x43b0d1};_0x417d1a[_0x53a7('0x1')](_0x502648[_0x53a7('0x1')]);_0x417d1a[_0x53a7('0x2')](_0x46d88a,{},function(_0xf12c3b,_0x421ebf){if(_0xf12c3b){return _0x417d1a[_0x53a7('0x1')](_0x502648[_0x53a7('0x1')])[_0x53a7('0x3')](_0x502648);}_0x417d1a[_0x53a7('0x4')](_0x421ebf);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index afbba0e..4869a91 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x61df=['FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccount','user_has_whatsapp_accounts','SquareProjects','cascade','ChanSpyId','moh_has_sounds','Members','VoiceQueueId','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','Trunk','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','VoiceCallReport','VoiceQueueReport','QueueCalls','AgentReports','uniqueid','ContactId','MailAccountId','Imap','Smtp','Dispositions','Applications','List','ListId','team_has_mail_queues','MailInteractionId','Account','Contact','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','Interaction','restrict','TagId','Answers','FaxAccountId','Interactions','Exntensions','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','user_has_sms_accounts','SmsQueue','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','CmCompany','CompanyId','Company','cm_contact_has_tags','OwnerId','CampaignId','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Action','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','CustomReportId','Mohs','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','MetricId','SalesforceConfiguration','Configurations','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Variable','VariableId','AccountId','Field','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskField','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerField','ServicenowAccount','Dynamics365Account','ToId','JscriptyAnswerReport','SmsQueueReport','ProjectId','JscriptyProject','user_has_square_projects','team_has_voice_queues','team_has_whatsapp_queues','Hoppers','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ChatTransferReport','ToChatQueueId','ToAccount','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','lodash','jstz','sequelize','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','sequelizeHistory','name','utf8_general_ci','database','username','password','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','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','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','../api/integration/integration.model','../api/network/network.model','ChatQueueReport','ChatInternalMessage','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','Notification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','hasOne','hasMany','Recordings','UserId','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','Notifications','UserProfile','userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','WhatsappInteraction','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','OpenchannelQueues','WhatsappQueues','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites'];(function(_0x22c84e,_0x279eb4){var _0x43f267=function(_0x56de9f){while(--_0x56de9f){_0x22c84e['push'](_0x22c84e['shift']());}};_0x43f267(++_0x279eb4);}(_0x61df,0xbd));var _0xf61d=function(_0x5d67d2,_0x19fef8){_0x5d67d2=_0x5d67d2-0x0;var _0x52a2c3=_0x61df[_0x5d67d2];return _0x52a2c3;};'use strict';var path=require('path');var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0xf61d('0x0'));var jstz=require(_0xf61d('0x1'));var timezone=jstz['determine']();config[_0xf61d('0x2')]=_[_0xf61d('0x3')](config['sequelize'],{'database':_0xf61d('0x4'),'username':_0xf61d('0x5'),'password':_0xf61d('0x6'),'options':{'host':_0xf61d('0x7'),'port':0xcea,'dialect':_0xf61d('0x8'),'dialectOptions':{'charset':_0xf61d('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xf61d('0xa'),'collate':'utf8_general_ci'}}});config[_0xf61d('0xb')]=_[_0xf61d('0x3')](config[_0xf61d('0xb')],{'database':_0xf61d('0x4'),'username':_0xf61d('0x5'),'password':_0xf61d('0x6'),'options':{'host':_0xf61d('0x7'),'port':0xcea,'dialect':_0xf61d('0x8'),'dialectOptions':{'charset':_0xf61d('0x9')},'logging':![],'timezone':timezone[_0xf61d('0xc')](),'define':{'charset':_0xf61d('0xa'),'collate':_0xf61d('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xf61d('0xe')],config['sequelize']['username'],config[_0xf61d('0x2')]['password'],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf61d('0xb')]['database'],config['sequelizeHistory'][_0xf61d('0xf')],config[_0xf61d('0xb')][_0xf61d('0x10')],config[_0xf61d('0xb')]['options'])};db[_0xf61d('0x11')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x13'));db['VoiceChanSpy']=db['sequelize'][_0xf61d('0x12')](_0xf61d('0x14'));db[_0xf61d('0x15')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x16'));db[_0xf61d('0x17')]=db['sequelize']['import'](_0xf61d('0x18'));db[_0xf61d('0x19')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x1a'));db[_0xf61d('0x1b')]=db[_0xf61d('0x2')]['import'](_0xf61d('0x1c'));db['VoiceRecording']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x1d'));db[_0xf61d('0x1e')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x1f'));db[_0xf61d('0x20')]=db['sequelize']['import']('../api/voiceMail/voiceMail.model');db[_0xf61d('0x21')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x22'));db['VoiceCallReport']=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/voiceDialReport/voiceDialReport.model');db[_0xf61d('0x23')]=db[_0xf61d('0x2')]['import'](_0xf61d('0x24'));db['VoiceQueueReport']=db['sequelize'][_0xf61d('0x12')](_0xf61d('0x25'));db['MemberReport']=db[_0xf61d('0x2')]['import'](_0xf61d('0x26'));db['Trunk']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x27'));db[_0xf61d('0x28')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0x29'));db[_0xf61d('0x2a')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x2b'));db[_0xf61d('0x2c')]=db[_0xf61d('0x2')]['import'](_0xf61d('0x2d'));db[_0xf61d('0x2e')]=db[_0xf61d('0x2')]['import'](_0xf61d('0x2f'));db[_0xf61d('0x30')]=db['sequelize']['import'](_0xf61d('0x31'));db[_0xf61d('0x32')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x33'));db['UserSmsQueue']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x34'));db[_0xf61d('0x35')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x36'));db[_0xf61d('0x37')]=db[_0xf61d('0x2')]['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0xf61d('0x38')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x39'));db[_0xf61d('0x3a')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x3b'));db[_0xf61d('0x3c')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x3d'));db[_0xf61d('0x3e')]=db[_0xf61d('0x2')]['import'](_0xf61d('0x3f'));db[_0xf61d('0x40')]=db['sequelize']['import'](_0xf61d('0x41'));db['MailInteraction']=db['sequelize']['import'](_0xf61d('0x42'));db[_0xf61d('0x43')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/mailMessage/mailMessage.model');db[_0xf61d('0x44')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x45'));db[_0xf61d('0x46')]=db[_0xf61d('0x2')]['import'](_0xf61d('0x47'));db[_0xf61d('0x48')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/dashboard/dashboard.model');db[_0xf61d('0x49')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x4a'));db['FaxAccount']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x4b'));db[_0xf61d('0x4c')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/faxApplication/faxApplication.model');db[_0xf61d('0x4d')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x4e'));db[_0xf61d('0x4f')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x50'));db[_0xf61d('0x51')]=db['sequelize']['import'](_0xf61d('0x52'));db['FaxQueueReport']=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x53'));db[_0xf61d('0x54')]=db[_0xf61d('0x2')]['import']('../api/smsApplication/smsApplication.model');db[_0xf61d('0x55')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x56'));db['SmsMessage']=db[_0xf61d('0x2')]['import'](_0xf61d('0x57'));db['SmsQueue']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x58'));db['OpenchannelAccount']=db[_0xf61d('0x2')]['import']('../api/openchannelAccount/openchannelAccount.model');db[_0xf61d('0x59')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0x5a'));db[_0xf61d('0x5b')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x5c'));db['OpenchannelMessage']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x5d'));db[_0xf61d('0x5e')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x5f'));db[_0xf61d('0x60')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x61'));db[_0xf61d('0x62')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x63'));db[_0xf61d('0x64')]=db[_0xf61d('0x2')]['import'](_0xf61d('0x65'));db[_0xf61d('0x66')]=db['sequelize'][_0xf61d('0x12')]('../api/chatInteraction/chatInteraction.model');db[_0xf61d('0x67')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/chatMessage/chatMessage.model');db[_0xf61d('0x68')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0x69'));db[_0xf61d('0x6a')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/chatQueue/chatQueue.model');db[_0xf61d('0x6b')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0x6c'));db[_0xf61d('0x6d')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db[_0xf61d('0x2')]['import'](_0xf61d('0x6e'));db[_0xf61d('0x6f')]=db['sequelize']['import']('../api/cmContact/cmContact.model');db[_0xf61d('0x70')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0x71'));db['CmHopperBlack']=db['sequelize'][_0xf61d('0x12')](_0xf61d('0x72'));db[_0xf61d('0x73')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0x74'));db[_0xf61d('0x75')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x76'));db[_0xf61d('0x77')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xf61d('0x78')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x79'));db['Action']=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/action/action.model');db[_0xf61d('0x7a')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x7b'));db[_0xf61d('0x7c')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x7d'));db[_0xf61d('0x7e')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x7f'));db[_0xf61d('0x80')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x81'));db[_0xf61d('0x82')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x83'));db[_0xf61d('0x84')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x85'));db['Cdr']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x86'));db[_0xf61d('0x87')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x88'));db[_0xf61d('0x89')]=db[_0xf61d('0x2')]['import'](_0xf61d('0x8a'));db[_0xf61d('0x8b')]=db[_0xf61d('0x2')]['import'](_0xf61d('0x8c'));db[_0xf61d('0x8d')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/tag/tag.model');db[_0xf61d('0x8e')]=db[_0xf61d('0x2')]['import'](_0xf61d('0x8f'));db[_0xf61d('0x90')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x91'));db['Variable']=db[_0xf61d('0x2')]['import'](_0xf61d('0x92'));db['Integration']=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/integration/integration.model');db[_0xf61d('0x93')]=db['sequelize'][_0xf61d('0x12')]('../api/integrationReport/integrationReport.model');db[_0xf61d('0x94')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x95'));db[_0xf61d('0x96')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x97'));db[_0xf61d('0x98')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x99'));db[_0xf61d('0x9a')]=db['sequelize']['import'](_0xf61d('0x9b'));db[_0xf61d('0x9c')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x9d'));db['AnalyticTreeReport']=db[_0xf61d('0x2')]['import'](_0xf61d('0x9e'));db[_0xf61d('0x9f')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xa0'));db['SalesforceConfiguration']=db[_0xf61d('0x2')]['import'](_0xf61d('0xa1'));db[_0xf61d('0xa2')]=db[_0xf61d('0x2')]['import']('../api/intSalesforceField/intSalesforceField.model');db[_0xf61d('0xa3')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0xa4'));db[_0xf61d('0xa5')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xa6'));db[_0xf61d('0xa7')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0xa8'));db[_0xf61d('0xa9')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/intDeskAccount/intDeskAccount.model');db[_0xf61d('0xaa')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0xf61d('0xab')]=db['sequelize']['import'](_0xf61d('0xac'));db[_0xf61d('0xad')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xae'));db[_0xf61d('0xaf')]=db[_0xf61d('0x2')]['import']('../api/intZohoField/intZohoField.model');db[_0xf61d('0xb0')]=db['sequelize']['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0xf61d('0xb1')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xb2'));db['ZendeskField']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xb3'));db['FreshdeskAccount']=db['sequelize'][_0xf61d('0x12')](_0xf61d('0xb4'));db[_0xf61d('0xb5')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db['sequelize']['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0xf61d('0xb6')]=db[_0xf61d('0x2')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0xf61d('0xb7')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0xb8'));db['VtigerField']=db['sequelize'][_0xf61d('0x12')]('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xb9'));db[_0xf61d('0xba')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xbb'));db[_0xf61d('0xbc')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xbd'));db['Dynamics365Account']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xbe'));db[_0xf61d('0xbf')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xc0'));db[_0xf61d('0xc1')]=db[_0xf61d('0x2')]['import'](_0xf61d('0xc2'));db[_0xf61d('0xc3')]=db['sequelize']['import'](_0xf61d('0xc4'));db[_0xf61d('0xc5')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xc6'));db[_0xf61d('0xc7')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xc8'));db[_0xf61d('0xc9')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xca'));db['Network']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xcb'));db[_0xf61d('0xcc')]=db['sequelize'][_0xf61d('0x12')]('../api/chatQueueReport/chatQueueReport.model');db[_0xf61d('0xcd')]=db['sequelize'][_0xf61d('0x12')]('../api/chatInternalMessage/chatInternalMessage.model');db['JscriptyAnswerReport']=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xf61d('0xce')]=db[_0xf61d('0x2')]['import'](_0xf61d('0xcf'));db[_0xf61d('0xd0')]=db['sequelize'][_0xf61d('0x12')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0xf61d('0x2')]['import'](_0xf61d('0xd1'));db[_0xf61d('0xd2')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/squareReport/squareReport.model');db[_0xf61d('0xd3')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xd4'));db['JscriptyProject']=db[_0xf61d('0x2')]['import'](_0xf61d('0xd5'));db[_0xf61d('0xd6')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/setting/setting.model');db[_0xf61d('0xd7')]=db['sequelize']['import'](_0xf61d('0xd8'));db[_0xf61d('0xd9')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xda'));db[_0xf61d('0xdb')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0xdc'));db['SquareMessage']=db[_0xf61d('0x2')]['import']('../api/squareMessage/squareMessage.model');db[_0xf61d('0xdd')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/team/team.model');db[_0xf61d('0xde')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xdf'));db[_0xf61d('0xe0')]=db[_0xf61d('0x2')]['import'](_0xf61d('0xe1'));db[_0xf61d('0xe2')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xe3'));db[_0xf61d('0xe4')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xe5'));db['Plugin']=db['sequelize']['import'](_0xf61d('0xe6'));db[_0xf61d('0xe7')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0xe8'));db['ChatTransferReport']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xe9'));db[_0xf61d('0xea')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xeb'));db['OpenchannelTransferReport']=db['sequelize'][_0xf61d('0x12')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xf61d('0xec')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xed'));db[_0xf61d('0xee')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0xef'));db['UserProfile']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xf0'));db['UserProfileSection']=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0xf61d('0xf1')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0xf2'));db[_0xf61d('0xf3')]=db[_0xf61d('0x2')][_0xf61d('0x12')]('../api/notification/notification.model');db[_0xf61d('0xf4')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xf5'));db['WhatsappApplication']=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xf6'));db['WhatsappInteraction']=db['sequelize'][_0xf61d('0x12')](_0xf61d('0xf7'));db[_0xf61d('0xf8')]=db['sequelize'][_0xf61d('0x12')](_0xf61d('0xf9'));db['WhatsappQueueReport']=db['sequelize'][_0xf61d('0x12')](_0xf61d('0xfa'));db[_0xf61d('0xfb')]=db[_0xf61d('0x2')]['import'](_0xf61d('0xfc'));db[_0xf61d('0xfd')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0xfe'));db[_0xf61d('0xff')]=db[_0xf61d('0x2')][_0xf61d('0x12')](_0xf61d('0x100'));db[_0xf61d('0x11')][_0xf61d('0x101')](db[_0xf61d('0x20')],{'as':_0xf61d('0x20'),'onDelete':'cascade','foreignKey':'UserId'});db[_0xf61d('0x11')][_0xf61d('0x102')](db['VoiceRecording'],{'as':_0xf61d('0x103'),'foreignKey':_0xf61d('0x104')});db[_0xf61d('0x11')][_0xf61d('0x102')](db[_0xf61d('0x2a')],{'as':_0xf61d('0x105'),'foreignKey':'UserId'});db[_0xf61d('0x11')]['hasMany'](db['VoiceExtension'],{'as':_0xf61d('0x106'),'onDelete':'cascade','hooks':!![]});db[_0xf61d('0x11')][_0xf61d('0x102')](db[_0xf61d('0x73')],{'as':_0xf61d('0x107'),'foreignKey':_0xf61d('0x104')});db[_0xf61d('0x11')][_0xf61d('0x102')](db[_0xf61d('0x75')],{'as':_0xf61d('0x108'),'foreignKey':_0xf61d('0x104')});db[_0xf61d('0x11')][_0xf61d('0x102')](db[_0xf61d('0x77')],{'as':_0xf61d('0x77'),'foreignKey':_0xf61d('0x104')});db[_0xf61d('0x11')]['hasMany'](db[_0xf61d('0x5b')],{'as':_0xf61d('0x109'),'foreignKey':_0xf61d('0x104')});db[_0xf61d('0x11')][_0xf61d('0x102')](db[_0xf61d('0x66')],{'as':'ChatInteractions','foreignKey':'UserId'});db['User']['hasMany'](db[_0xf61d('0x55')],{'as':_0xf61d('0x10a'),'foreignKey':_0xf61d('0x104')});db[_0xf61d('0x11')][_0xf61d('0x102')](db[_0xf61d('0x4d')],{'as':_0xf61d('0x10b'),'foreignKey':_0xf61d('0x104')});db['User'][_0xf61d('0x102')](db[_0xf61d('0x10c')],{'as':_0xf61d('0x10d'),'foreignKey':_0xf61d('0x104')});db[_0xf61d('0x11')]['hasMany'](db['WhatsappInteraction'],{'as':_0xf61d('0x10e'),'foreignKey':_0xf61d('0x104')});db[_0xf61d('0x11')]['hasMany'](db['Notification'],{'as':_0xf61d('0x10f'),'foreignKey':'SenderId'});db[_0xf61d('0x11')]['belongsTo'](db['UserProfile'],{'as':_0xf61d('0x110'),'foreignKey':_0xf61d('0x111')});db['User'][_0xf61d('0x112')](db[_0xf61d('0x6b')],{'as':'Groups','through':_0xf61d('0x113')});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0x6f')],{'as':_0xf61d('0x114'),'through':_0xf61d('0x115')});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0x116')],{'as':_0xf61d('0x117'),'through':_0xf61d('0x118')});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0xdd')],{'through':_0xf61d('0x119')});db['User'][_0xf61d('0x112')](db[_0xf61d('0x10c')],{'as':_0xf61d('0x10d'),'through':_0xf61d('0x11a')});db['User'][_0xf61d('0x112')](db[_0xf61d('0x66')],{'as':_0xf61d('0x11b'),'through':_0xf61d('0x11c')});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0x4d')],{'as':_0xf61d('0x10b'),'through':_0xf61d('0x11d')});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0x55')],{'as':_0xf61d('0x10a'),'through':_0xf61d('0x11e')});db['User'][_0xf61d('0x112')](db[_0xf61d('0x5b')],{'as':_0xf61d('0x109'),'through':_0xf61d('0x11f')});db['User']['belongsToMany'](db[_0xf61d('0x120')],{'as':_0xf61d('0x10e'),'through':_0xf61d('0x121')});db[_0xf61d('0x11')][_0xf61d('0x112')](db['VoiceQueue'],{'as':_0xf61d('0x122'),'through':_0xf61d('0x2c'),'required':![]});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0x3e')],{'as':_0xf61d('0x123'),'through':'UserMailQueue','required':![]});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0x6a')],{'as':_0xf61d('0x124'),'through':_0xf61d('0x2e'),'required':![],'hooks':!![]});db[_0xf61d('0x11')]['belongsToMany'](db[_0xf61d('0x51')],{'as':_0xf61d('0x125'),'through':_0xf61d('0x32'),'required':![]});db[_0xf61d('0x11')]['belongsToMany'](db['SmsQueue'],{'as':_0xf61d('0x126'),'through':_0xf61d('0x127'),'required':![]});db[_0xf61d('0x11')][_0xf61d('0x112')](db['OpenchannelQueue'],{'as':_0xf61d('0x128'),'through':_0xf61d('0x35'),'required':![]});db['User']['belongsToMany'](db[_0xf61d('0xfd')],{'as':_0xf61d('0x129'),'through':_0xf61d('0x37'),'required':![]});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0x116')],{'through':_0xf61d('0x118')});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0xee')],{'as':'VoicePrefixes','through':_0xf61d('0x12a'),'required':![]});db[_0xf61d('0x11')]['belongsToMany'](db[_0xf61d('0x60')],{'as':_0xf61d('0x12b'),'through':_0xf61d('0x12c')});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0x12d')],{'as':_0xf61d('0x12e'),'through':_0xf61d('0x12f')});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0x3c')],{'as':_0xf61d('0x130'),'through':_0xf61d('0x131')});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0x132')],{'as':'OpenchannelAccounts','through':_0xf61d('0x133')});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0x134')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0xf61d('0x11')][_0xf61d('0x112')](db[_0xf61d('0xf4')],{'as':'WhatsappAccounts','through':_0xf61d('0x135')});db[_0xf61d('0x11')]['belongsToMany'](db[_0xf61d('0xd9')],{'as':_0xf61d('0x136'),'through':'user_has_square_projects'});db['VoiceChanSpy'][_0xf61d('0x102')](db[_0xf61d('0x17')],{'as':'SpiedAgents','onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x138')});db[_0xf61d('0x15')][_0xf61d('0x102')](db[_0xf61d('0x17')],{'onDelete':_0xf61d('0x137')});db[_0xf61d('0x17')][_0xf61d('0x102')](db[_0xf61d('0x17')],{'as':'Applications','onDelete':_0xf61d('0x137')});db['VoiceMusicOnHold']['belongsToMany'](db[_0xf61d('0x8b')],{'as':'Sounds','through':_0xf61d('0x139')});db['VoiceQueue'][_0xf61d('0x102')](db['UserVoiceQueueRt'],{'as':_0xf61d('0x13a'),'foreignKey':_0xf61d('0x13b')});db[_0xf61d('0x1b')][_0xf61d('0x102')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xf61d('0x13b')});db['VoiceQueue'][_0xf61d('0x102')](db['CmHopperFinal'],{'as':_0xf61d('0x107'),'foreignKey':_0xf61d('0x13b')});db[_0xf61d('0x1b')][_0xf61d('0x102')](db['CmHopperHistory'],{'as':_0xf61d('0x13c'),'foreignKey':_0xf61d('0x13b')});db[_0xf61d('0x1b')]['hasMany'](db['ReportAgentPreview'],{'as':_0xf61d('0x77'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xf61d('0x102')](db[_0xf61d('0x13d')],{'as':_0xf61d('0x13e'),'foreignKey':_0xf61d('0x13b')});db['VoiceQueue'][_0xf61d('0x102')](db['JscriptySessionReport'],{'as':_0xf61d('0x13f'),'foreignKey':_0xf61d('0x13b')});db['VoiceQueue']['belongsTo'](db[_0xf61d('0x140')],{'as':_0xf61d('0x140'),'foreignKey':_0xf61d('0x141')});db['VoiceQueue'][_0xf61d('0x142')](db[_0xf61d('0x140')],{'as':_0xf61d('0x143'),'foreignKey':_0xf61d('0x144')});db[_0xf61d('0x1b')][_0xf61d('0x142')](db['Interval'],{'as':_0xf61d('0x82'),'foreignKey':_0xf61d('0x145')});db[_0xf61d('0x1b')][_0xf61d('0x142')](db[_0xf61d('0x84')],{'as':_0xf61d('0x146'),'foreignKey':_0xf61d('0x147')});db[_0xf61d('0x1b')]['belongsToMany'](db[_0xf61d('0x116')],{'as':_0xf61d('0x117'),'through':'voice_queues_has_cm_lists'});db[_0xf61d('0x1b')][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':_0xf61d('0x148'),'through':'UserVoiceQueue'});db['VoiceQueue']['belongsToMany'](db[_0xf61d('0xdd')],{'as':_0xf61d('0x149'),'through':'team_has_voice_queues'});db[_0xf61d('0x1b')][_0xf61d('0x112')](db[_0xf61d('0x116')],{'as':_0xf61d('0x14a'),'through':_0xf61d('0x14b')});db['VoiceRecording'][_0xf61d('0x142')](db['User'],{'as':_0xf61d('0x11'),'foreignKey':'UserId'});db[_0xf61d('0x1e')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'as':_0xf61d('0x11'),'foreignKey':_0xf61d('0x104')});db[_0xf61d('0x20')][_0xf61d('0x102')](db[_0xf61d('0x21')],{'as':_0xf61d('0x14c'),'onDelete':_0xf61d('0x137'),'foreignKey':'mailboxuser','sourceKey':_0xf61d('0x14d')});db[_0xf61d('0x21')][_0xf61d('0x142')](db[_0xf61d('0x20')],{'foreignKey':_0xf61d('0x14e'),'targetKey':'mailbox'});db[_0xf61d('0x14f')][_0xf61d('0x102')](db[_0xf61d('0x150')],{'as':_0xf61d('0x151'),'foreignKey':'uniqueid','constraints':![]});db[_0xf61d('0x14f')]['hasMany'](db['VoiceAgentReport'],{'as':_0xf61d('0x152'),'foreignKey':_0xf61d('0x153'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0xf61d('0x11')],{'as':_0xf61d('0x11'),'foreignKey':'UserId'});db[_0xf61d('0x14f')][_0xf61d('0x142')](db['CmContact'],{'as':'Contact','foreignKey':_0xf61d('0x154')});db['MailServerIn'][_0xf61d('0x142')](db[_0xf61d('0x3c')],{'as':_0xf61d('0x3c'),'foreignKey':_0xf61d('0x155')});db['MailServerOut'][_0xf61d('0x142')](db[_0xf61d('0x3c')],{'as':_0xf61d('0x3c'),'foreignKey':'MailAccountId'});db[_0xf61d('0x3c')][_0xf61d('0x101')](db[_0xf61d('0x38')],{'as':_0xf61d('0x156'),'onDelete':_0xf61d('0x137')});db[_0xf61d('0x3c')][_0xf61d('0x101')](db[_0xf61d('0x3a')],{'as':_0xf61d('0x157'),'onDelete':_0xf61d('0x137')});db['MailAccount'][_0xf61d('0x102')](db[_0xf61d('0x7e')],{'as':_0xf61d('0x158'),'foreignKey':_0xf61d('0x155')});db[_0xf61d('0x3c')][_0xf61d('0x102')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xf61d('0x155')});db[_0xf61d('0x3c')][_0xf61d('0x102')](db[_0xf61d('0x43')],{'as':_0xf61d('0x14c'),'foreignKey':_0xf61d('0x155')});db[_0xf61d('0x3c')]['hasMany'](db[_0xf61d('0x10c')],{'as':'Interactions'});db[_0xf61d('0x3c')][_0xf61d('0x102')](db[_0xf61d('0x44')],{'as':_0xf61d('0x159')});db['MailAccount'][_0xf61d('0x142')](db[_0xf61d('0x116')],{'as':_0xf61d('0x15a'),'foreignKey':_0xf61d('0x15b')});db[_0xf61d('0x3c')][_0xf61d('0x142')](db['Template'],{'as':_0xf61d('0x8e'),'foreignKey':'TemplateId'});db[_0xf61d('0x3c')]['belongsTo'](db['Pause'],{'as':_0xf61d('0x146'),'foreignKey':_0xf61d('0x147')});db[_0xf61d('0x3c')][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':_0xf61d('0x148'),'through':_0xf61d('0x131')});db[_0xf61d('0x3e')][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':_0xf61d('0x148'),'through':_0xf61d('0x30')});db[_0xf61d('0x3e')][_0xf61d('0x112')](db[_0xf61d('0xdd')],{'through':_0xf61d('0x15c'),'as':_0xf61d('0x149')});db[_0xf61d('0x10c')][_0xf61d('0x102')](db['MailMessage'],{'as':_0xf61d('0x14c'),'onDelete':'cascade','foreignKey':_0xf61d('0x15d')});db['MailInteraction'][_0xf61d('0x142')](db['MailAccount'],{'as':_0xf61d('0x15e'),'foreignKey':_0xf61d('0x155')});db[_0xf61d('0x10c')][_0xf61d('0x142')](db[_0xf61d('0x6f')],{'as':_0xf61d('0x15f'),'foreignKey':_0xf61d('0x154')});db[_0xf61d('0x10c')]['belongsTo'](db[_0xf61d('0x11')],{'as':_0xf61d('0x160'),'foreignKey':_0xf61d('0x104')});db['MailInteraction']['belongsToMany'](db['Tag'],{'through':'mail_interaction_has_tags','as':_0xf61d('0x161')});db['MailInteraction'][_0xf61d('0x112')](db['Tag'],{'through':_0xf61d('0x162'),'as':_0xf61d('0x163')});db['MailInteraction'][_0xf61d('0x112')](db['User'],{'as':_0xf61d('0x164'),'through':_0xf61d('0x11a'),'foreignKey':_0xf61d('0x15d')});db[_0xf61d('0x43')][_0xf61d('0x102')](db[_0xf61d('0xe4')],{'as':'Attachments','onDelete':_0xf61d('0x137')});db[_0xf61d('0x43')]['belongsTo'](db[_0xf61d('0x11')],{'as':_0xf61d('0x11')});db[_0xf61d('0x43')]['belongsTo'](db[_0xf61d('0x6f')],{'onDelete':_0xf61d('0x137'),'as':_0xf61d('0x15f')});db[_0xf61d('0x43')][_0xf61d('0x142')](db['MailInteraction'],{'as':_0xf61d('0x165'),'foreignKey':_0xf61d('0x15d')});db[_0xf61d('0x43')][_0xf61d('0x142')](db['MailAccount'],{'as':_0xf61d('0x15e'),'foreignKey':'MailAccountId'});db['MailApplication'][_0xf61d('0x142')](db['User'],{'onDelete':_0xf61d('0x166')});db[_0xf61d('0x44')][_0xf61d('0x142')](db['MailQueue'],{'onDelete':_0xf61d('0x166')});db[_0xf61d('0x44')][_0xf61d('0x142')](db[_0xf61d('0x3c')],{'onDelete':_0xf61d('0x166')});db['MailApplication']['belongsTo'](db[_0xf61d('0x82')],{'onDelete':_0xf61d('0x166'),'foreignKey':_0xf61d('0x145')});db['MailApplication'][_0xf61d('0x142')](db[_0xf61d('0x8d')],{'onDelete':_0xf61d('0x166'),'foreignKey':_0xf61d('0x167')});db['MailQueueReport'][_0xf61d('0x142')](db[_0xf61d('0x3c')],{});db[_0xf61d('0x46')]['belongsTo'](db[_0xf61d('0x116')],{'as':_0xf61d('0x15a'),'foreignKey':'ListId'});db[_0xf61d('0x46')][_0xf61d('0x142')](db[_0xf61d('0x6f')],{'as':_0xf61d('0x15f'),'foreignKey':_0xf61d('0x154')});db[_0xf61d('0x46')]['belongsTo'](db[_0xf61d('0x10c')],{});db['MailQueueReport'][_0xf61d('0x142')](db[_0xf61d('0x43')],{});db['MailQueueReport'][_0xf61d('0x142')](db['User'],{});db['MailQueueReport'][_0xf61d('0x142')](db[_0xf61d('0x3e')],{});db['Dashboard'][_0xf61d('0x102')](db[_0xf61d('0x49')],{'as':'Items','onDelete':'cascade'});db[_0xf61d('0x12d')][_0xf61d('0x102')](db[_0xf61d('0x7e')],{'as':_0xf61d('0x158'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0xf61d('0x102')](db[_0xf61d('0x7c')],{'as':_0xf61d('0x168'),'foreignKey':_0xf61d('0x169')});db[_0xf61d('0x12d')][_0xf61d('0x102')](db[_0xf61d('0x4d')],{'as':_0xf61d('0x16a')});db[_0xf61d('0x12d')][_0xf61d('0x102')](db['FaxApplication'],{'as':'Applications'});db['FaxAccount']['hasMany'](db['VoiceExtension'],{'as':_0xf61d('0x16b'),'onDelete':_0xf61d('0x137')});db[_0xf61d('0x12d')][_0xf61d('0x102')](db[_0xf61d('0x4f')],{'as':_0xf61d('0x14c')});db[_0xf61d('0x12d')][_0xf61d('0x142')](db[_0xf61d('0x140')],{'as':_0xf61d('0x140')});db['FaxAccount'][_0xf61d('0x142')](db[_0xf61d('0x116')],{'as':'List','foreignKey':_0xf61d('0x15b')});db['FaxAccount'][_0xf61d('0x142')](db[_0xf61d('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0xf61d('0x147')});db[_0xf61d('0x12d')][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':'Agents','through':_0xf61d('0x12f')});db[_0xf61d('0x4c')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'onDelete':'restrict'});db[_0xf61d('0x4c')]['belongsTo'](db[_0xf61d('0x51')],{'onDelete':_0xf61d('0x166')});db[_0xf61d('0x4c')]['belongsTo'](db['FaxAccount'],{'onDelete':_0xf61d('0x166')});db[_0xf61d('0x4c')][_0xf61d('0x142')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xf61d('0x167')});db[_0xf61d('0x4d')]['hasMany'](db[_0xf61d('0x4f')],{'as':_0xf61d('0x14c'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x16c')});db['FaxInteraction'][_0xf61d('0x142')](db[_0xf61d('0x12d')],{'as':'Account','foreignKey':_0xf61d('0x169')});db[_0xf61d('0x4d')][_0xf61d('0x142')](db[_0xf61d('0x6f')],{'as':_0xf61d('0x15f'),'foreignKey':_0xf61d('0x154')});db[_0xf61d('0x4d')]['belongsTo'](db[_0xf61d('0x11')],{'as':_0xf61d('0x160'),'foreignKey':'UserId'});db[_0xf61d('0x4d')][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':_0xf61d('0x16d'),'as':_0xf61d('0x161')});db[_0xf61d('0x4d')][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':'fax_interaction_has_tags','as':'ThroughTags'});db['FaxInteraction'][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':_0xf61d('0x164'),'through':_0xf61d('0x11d'),'foreignKey':_0xf61d('0x16c')});db[_0xf61d('0x4f')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'onDelete':_0xf61d('0x137'),'as':_0xf61d('0x11')});db['FaxMessage'][_0xf61d('0x142')](db['FaxInteraction'],{'as':_0xf61d('0x165'),'foreignKey':_0xf61d('0x16c')});db[_0xf61d('0x4f')][_0xf61d('0x142')](db['CmContact'],{'onDelete':_0xf61d('0x137'),'as':_0xf61d('0x15f')});db[_0xf61d('0x4f')]['belongsTo'](db[_0xf61d('0xe4')],{'as':_0xf61d('0xe4'),'foreignKey':_0xf61d('0x16e')});db[_0xf61d('0x4f')][_0xf61d('0x142')](db[_0xf61d('0x12d')],{'as':'Account','foreignKey':_0xf61d('0x169')});db[_0xf61d('0x51')]['belongsToMany'](db[_0xf61d('0x11')],{'as':'Agents','through':'UserFaxQueue'});db[_0xf61d('0x51')][_0xf61d('0x112')](db['Team'],{'through':_0xf61d('0x16f'),'as':_0xf61d('0x149')});db[_0xf61d('0x170')][_0xf61d('0x142')](db['FaxAccount'],{});db[_0xf61d('0x170')][_0xf61d('0x142')](db[_0xf61d('0x116')],{'as':_0xf61d('0x15a'),'foreignKey':_0xf61d('0x15b')});db['FaxQueueReport'][_0xf61d('0x142')](db[_0xf61d('0x6f')],{'as':'Contact','foreignKey':_0xf61d('0x154')});db['FaxQueueReport'][_0xf61d('0x142')](db['FaxInteraction'],{});db[_0xf61d('0x170')]['belongsTo'](db[_0xf61d('0x4f')],{});db['FaxQueueReport']['belongsTo'](db['User'],{});db['FaxQueueReport'][_0xf61d('0x142')](db['FaxQueue'],{});db['SmsAccount'][_0xf61d('0x102')](db[_0xf61d('0x7e')],{'as':_0xf61d('0x158'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0xf61d('0x102')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xf61d('0x171')});db[_0xf61d('0x134')]['hasMany'](db[_0xf61d('0x172')],{'as':_0xf61d('0x14c'),'foreignKey':_0xf61d('0x171')});db[_0xf61d('0x134')][_0xf61d('0x102')](db['SmsInteraction'],{'as':'Interactions'});db[_0xf61d('0x134')][_0xf61d('0x102')](db[_0xf61d('0x54')],{'as':_0xf61d('0x159')});db[_0xf61d('0x134')][_0xf61d('0x142')](db['CmList'],{'as':_0xf61d('0x15a'),'foreignKey':_0xf61d('0x15b')});db['SmsAccount'][_0xf61d('0x142')](db['Pause'],{'as':_0xf61d('0x146'),'foreignKey':_0xf61d('0x147')});db['SmsAccount']['belongsToMany'](db[_0xf61d('0x11')],{'as':'Agents','through':_0xf61d('0x173')});db[_0xf61d('0x54')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'onDelete':_0xf61d('0x166')});db['SmsApplication'][_0xf61d('0x142')](db[_0xf61d('0x174')],{'onDelete':'restrict'});db[_0xf61d('0x54')][_0xf61d('0x142')](db[_0xf61d('0x134')],{'onDelete':_0xf61d('0x166')});db[_0xf61d('0x54')][_0xf61d('0x142')](db[_0xf61d('0x82')],{'onDelete':_0xf61d('0x166'),'foreignKey':_0xf61d('0x145')});db['SmsApplication']['belongsTo'](db[_0xf61d('0x8d')],{'onDelete':_0xf61d('0x166'),'foreignKey':_0xf61d('0x167')});db[_0xf61d('0x55')]['hasMany'](db['SmsMessage'],{'as':_0xf61d('0x14c'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x175')});db[_0xf61d('0x55')]['belongsTo'](db[_0xf61d('0x134')],{'as':'Account','foreignKey':_0xf61d('0x171')});db['SmsInteraction'][_0xf61d('0x142')](db[_0xf61d('0x6f')],{'as':'Contact','foreignKey':_0xf61d('0x154')});db[_0xf61d('0x55')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'as':_0xf61d('0x160'),'foreignKey':_0xf61d('0x104')});db[_0xf61d('0x55')][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':_0xf61d('0x176'),'as':_0xf61d('0x161')});db[_0xf61d('0x55')][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':'sms_interaction_has_tags','as':_0xf61d('0x163')});db[_0xf61d('0x55')][_0xf61d('0x112')](db['User'],{'as':_0xf61d('0x164'),'through':_0xf61d('0x11e'),'foreignKey':_0xf61d('0x175')});db[_0xf61d('0x172')]['belongsTo'](db[_0xf61d('0x11')],{'as':_0xf61d('0x11')});db[_0xf61d('0x172')]['belongsTo'](db[_0xf61d('0x6f')],{'onDelete':'cascade','as':_0xf61d('0x15f')});db[_0xf61d('0x172')][_0xf61d('0x142')](db[_0xf61d('0x55')],{'onDelete':'cascade','as':_0xf61d('0x165'),'foreignKey':'SmsInteractionId'});db[_0xf61d('0x172')][_0xf61d('0x142')](db[_0xf61d('0x134')],{'as':_0xf61d('0x15e'),'foreignKey':_0xf61d('0x171')});db[_0xf61d('0x174')]['belongsToMany'](db['User'],{'as':_0xf61d('0x148'),'through':_0xf61d('0x127'),'foreignKey':_0xf61d('0x177')});db[_0xf61d('0x174')][_0xf61d('0x112')](db[_0xf61d('0xdd')],{'through':_0xf61d('0x178'),'as':'Teams'});db[_0xf61d('0x132')]['hasMany'](db[_0xf61d('0x7e')],{'as':_0xf61d('0x158'),'foreignKey':_0xf61d('0x179')});db[_0xf61d('0x132')][_0xf61d('0x102')](db[_0xf61d('0x7c')],{'as':'Answers','foreignKey':_0xf61d('0x179')});db[_0xf61d('0x132')][_0xf61d('0x102')](db['OpenchannelInteraction'],{'as':_0xf61d('0x16a'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xf61d('0x102')](db[_0xf61d('0x17a')],{'as':_0xf61d('0x14c'),'foreignKey':_0xf61d('0x179')});db['OpenchannelAccount'][_0xf61d('0x102')](db[_0xf61d('0x59')],{'as':_0xf61d('0x159'),'foreignKey':_0xf61d('0x179')});db[_0xf61d('0x132')][_0xf61d('0x142')](db[_0xf61d('0x116')],{'as':_0xf61d('0x15a'),'foreignKey':_0xf61d('0x15b')});db[_0xf61d('0x132')][_0xf61d('0x142')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xf61d('0x132')][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':_0xf61d('0x148'),'through':_0xf61d('0x133')});db[_0xf61d('0x59')][_0xf61d('0x142')](db['User'],{'onDelete':_0xf61d('0x166')});db[_0xf61d('0x59')][_0xf61d('0x142')](db[_0xf61d('0x5e')],{'onDelete':'restrict','foreignKey':_0xf61d('0x17b')});db['OpenchannelApplication'][_0xf61d('0x142')](db[_0xf61d('0x132')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0xf61d('0x59')][_0xf61d('0x142')](db['Interval'],{'onDelete':_0xf61d('0x166'),'foreignKey':'IntervalId'});db[_0xf61d('0x59')][_0xf61d('0x142')](db[_0xf61d('0x8d')],{'onDelete':_0xf61d('0x166'),'foreignKey':_0xf61d('0x167')});db[_0xf61d('0x5b')][_0xf61d('0x102')](db[_0xf61d('0x17a')],{'as':_0xf61d('0x14c'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x17c')});db[_0xf61d('0x5b')][_0xf61d('0x142')](db[_0xf61d('0x132')],{'as':_0xf61d('0x15e'),'foreignKey':_0xf61d('0x179')});db[_0xf61d('0x5b')][_0xf61d('0x142')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['OpenchannelInteraction'][_0xf61d('0x142')](db[_0xf61d('0x11')],{'as':_0xf61d('0x160'),'foreignKey':_0xf61d('0x104')});db[_0xf61d('0x5b')][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':_0xf61d('0x17d'),'as':_0xf61d('0x161')});db[_0xf61d('0x5b')]['belongsToMany'](db[_0xf61d('0x8d')],{'through':_0xf61d('0x17d'),'as':_0xf61d('0x163')});db[_0xf61d('0x5b')][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':_0xf61d('0x164'),'through':_0xf61d('0x11f'),'foreignKey':_0xf61d('0x17c')});db[_0xf61d('0x17a')]['belongsTo'](db[_0xf61d('0x11')],{'onDelete':_0xf61d('0x137'),'as':'User'});db[_0xf61d('0x17a')]['belongsTo'](db[_0xf61d('0x6f')],{'onDelete':_0xf61d('0x137'),'as':_0xf61d('0x15f')});db[_0xf61d('0x17a')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0xf61d('0x137'),'as':_0xf61d('0x165'),'foreignKey':'OpenchannelInteractionId'});db[_0xf61d('0x17a')]['belongsTo'](db['Attachment'],{'as':_0xf61d('0xe4'),'foreignKey':'AttachmentId'});db[_0xf61d('0x17a')][_0xf61d('0x142')](db['OpenchannelAccount'],{'as':_0xf61d('0x15e'),'foreignKey':'OpenchannelAccountId'});db[_0xf61d('0x5e')][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':_0xf61d('0x148'),'through':_0xf61d('0x35'),'foreignKey':_0xf61d('0x17b')});db[_0xf61d('0x5e')]['belongsToMany'](db[_0xf61d('0xdd')],{'through':_0xf61d('0x17e'),'as':'Teams'});db[_0xf61d('0x60')]['hasMany'](db[_0xf61d('0x7e')],{'as':_0xf61d('0x158'),'foreignKey':_0xf61d('0x17f')});db['ChatWebsite']['hasMany'](db[_0xf61d('0x7c')],{'as':_0xf61d('0x168'),'foreignKey':_0xf61d('0x17f')});db[_0xf61d('0x60')][_0xf61d('0x102')](db[_0xf61d('0x6d')],{'as':_0xf61d('0x180')});db[_0xf61d('0x60')][_0xf61d('0x102')](db[_0xf61d('0x66')],{'as':_0xf61d('0x16a')});db[_0xf61d('0x60')][_0xf61d('0x102')](db[_0xf61d('0x64')],{'as':_0xf61d('0x159')});db[_0xf61d('0x60')]['hasMany'](db[_0xf61d('0x67')],{'as':_0xf61d('0x14c')});db[_0xf61d('0x60')]['belongsTo'](db[_0xf61d('0x116')],{'as':_0xf61d('0x15a'),'foreignKey':_0xf61d('0x15b')});db[_0xf61d('0x60')][_0xf61d('0x142')](db[_0xf61d('0x82')],{'as':_0xf61d('0x82'),'foreignKey':_0xf61d('0x145')});db[_0xf61d('0x60')][_0xf61d('0x142')](db[_0xf61d('0x84')],{'as':_0xf61d('0x146'),'foreignKey':'mandatoryDispositionPauseId'});db['ChatWebsite'][_0xf61d('0x112')](db['User'],{'as':_0xf61d('0x148'),'through':_0xf61d('0x12c')});db[_0xf61d('0x62')][_0xf61d('0x142')](db[_0xf61d('0x132')],{});db[_0xf61d('0x62')][_0xf61d('0x142')](db[_0xf61d('0x116')],{'as':_0xf61d('0x15a'),'foreignKey':_0xf61d('0x15b')});db[_0xf61d('0x62')][_0xf61d('0x142')](db[_0xf61d('0x6f')],{'as':_0xf61d('0x15f'),'foreignKey':_0xf61d('0x154')});db[_0xf61d('0x62')][_0xf61d('0x142')](db[_0xf61d('0x5b')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xf61d('0x17a')],{});db[_0xf61d('0x62')]['belongsTo'](db['User'],{});db['OpenchannelQueueReport'][_0xf61d('0x142')](db[_0xf61d('0x5e')],{});db['ChatApplication'][_0xf61d('0x142')](db[_0xf61d('0x11')],{'as':_0xf61d('0x181'),'foreignKey':'UserId','onDelete':_0xf61d('0x166')});db[_0xf61d('0x64')][_0xf61d('0x142')](db[_0xf61d('0x6a')],{'as':_0xf61d('0x182'),'foreignKey':_0xf61d('0x183'),'onDelete':_0xf61d('0x166')});db['ChatApplication'][_0xf61d('0x142')](db[_0xf61d('0x60')],{'as':_0xf61d('0x184'),'foreignKey':_0xf61d('0x17f'),'onDelete':_0xf61d('0x166')});db[_0xf61d('0x64')][_0xf61d('0x142')](db[_0xf61d('0x8d')],{'onDelete':_0xf61d('0x166'),'foreignKey':'TagId'});db[_0xf61d('0x66')][_0xf61d('0x102')](db[_0xf61d('0x67')],{'as':_0xf61d('0x14c'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x185')});db[_0xf61d('0x66')][_0xf61d('0x142')](db[_0xf61d('0x60')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xf61d('0x66')][_0xf61d('0x142')](db['CmContact'],{'as':_0xf61d('0x15f'),'foreignKey':_0xf61d('0x154')});db[_0xf61d('0x66')]['belongsTo'](db['User'],{'as':_0xf61d('0x160'),'foreignKey':_0xf61d('0x104')});db['ChatInteraction'][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':_0xf61d('0x186'),'as':'Tags'});db[_0xf61d('0x66')][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':_0xf61d('0x186'),'as':_0xf61d('0x163')});db[_0xf61d('0x66')][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':_0xf61d('0x164'),'through':_0xf61d('0x11c'),'foreignKey':_0xf61d('0x185')});db[_0xf61d('0x67')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'onDelete':_0xf61d('0x137'),'as':_0xf61d('0x11')});db['ChatMessage'][_0xf61d('0x142')](db[_0xf61d('0x6f')],{'onDelete':_0xf61d('0x137'),'as':_0xf61d('0x15f'),'foreignKey':'ContactId'});db['ChatMessage'][_0xf61d('0x142')](db[_0xf61d('0x66')],{'onDelete':_0xf61d('0x137'),'as':'Interaction','foreignKey':_0xf61d('0x185')});db[_0xf61d('0x67')][_0xf61d('0x142')](db['Attachment'],{'as':_0xf61d('0xe4'),'foreignKey':_0xf61d('0x16e')});db[_0xf61d('0x67')][_0xf61d('0x142')](db['ChatWebsite'],{'as':'Account','foreignKey':_0xf61d('0x17f')});db[_0xf61d('0x68')][_0xf61d('0x142')](db[_0xf61d('0x6f')],{'onDelete':'cascade','as':_0xf61d('0x15f'),'foreignKey':_0xf61d('0x154')});db['ChatOfflineMessage']['belongsTo'](db[_0xf61d('0x60')],{'as':'Account','foreignKey':_0xf61d('0x17f')});db['ChatQueue'][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':_0xf61d('0x148'),'through':_0xf61d('0x2e'),'hooks':!![]});db[_0xf61d('0x6a')][_0xf61d('0x112')](db[_0xf61d('0xdd')],{'through':_0xf61d('0x187'),'as':_0xf61d('0x149')});db['ChatGroup']['hasMany'](db[_0xf61d('0xcd')],{'as':_0xf61d('0x14c'),'foreignKey':'ChatGroupId','onDelete':_0xf61d('0x137')});db[_0xf61d('0x6b')]['belongsToMany'](db[_0xf61d('0x11')],{'as':_0xf61d('0x13a'),'through':_0xf61d('0x113')});db['ChatProactiveAction'][_0xf61d('0x142')](db[_0xf61d('0x60')],{'as':_0xf61d('0x184'),'foreignKey':_0xf61d('0x17f')});db[_0xf61d('0x188')][_0xf61d('0x102')](db[_0xf61d('0x6f')],{'as':'Contacts','foreignKey':_0xf61d('0x189')});db[_0xf61d('0x6f')][_0xf61d('0x102')](db[_0xf61d('0x70')],{'as':'Hoppers','foreignKey':_0xf61d('0x154')});db[_0xf61d('0x6f')][_0xf61d('0x102')](db[_0xf61d('0x73')],{'as':'HopperFinals','foreignKey':_0xf61d('0x154')});db[_0xf61d('0x6f')][_0xf61d('0x102')](db[_0xf61d('0x75')],{'as':_0xf61d('0x13c'),'foreignKey':'ContactId'});db['CmContact'][_0xf61d('0x102')](db[_0xf61d('0x77')],{'as':_0xf61d('0x77'),'foreignKey':_0xf61d('0x154')});db[_0xf61d('0x6f')]['hasMany'](db[_0xf61d('0xd0')],{'as':_0xf61d('0x13f'),'foreignKey':'ContactId'});db['CmContact'][_0xf61d('0x102')](db[_0xf61d('0x5b')],{'as':_0xf61d('0x109'),'foreignKey':_0xf61d('0x154'),'onDelete':_0xf61d('0x166')});db[_0xf61d('0x6f')][_0xf61d('0x102')](db[_0xf61d('0x66')],{'as':_0xf61d('0x11b'),'foreignKey':_0xf61d('0x154'),'onDelete':_0xf61d('0x166')});db['CmContact']['hasMany'](db[_0xf61d('0x55')],{'as':_0xf61d('0x10a'),'foreignKey':'ContactId','onDelete':_0xf61d('0x166')});db[_0xf61d('0x6f')]['hasMany'](db[_0xf61d('0x4d')],{'as':'FaxInteractions','foreignKey':_0xf61d('0x154'),'onDelete':_0xf61d('0x166')});db[_0xf61d('0x6f')][_0xf61d('0x102')](db[_0xf61d('0x10c')],{'as':_0xf61d('0x10d'),'foreignKey':_0xf61d('0x154'),'onDelete':_0xf61d('0x166')});db[_0xf61d('0x6f')][_0xf61d('0x142')](db[_0xf61d('0x188')],{'as':_0xf61d('0x18a'),'foreignKey':_0xf61d('0x189')});db[_0xf61d('0x6f')][_0xf61d('0x142')](db[_0xf61d('0x116')],{'as':_0xf61d('0x15a'),'foreignKey':_0xf61d('0x15b'),'onDelete':_0xf61d('0x137')});db[_0xf61d('0x6f')]['belongsToMany'](db['User'],{'as':_0xf61d('0x164'),'through':_0xf61d('0x115')});db['CmContact']['belongsToMany'](db[_0xf61d('0x8d')],{'as':'Tags','through':'cm_contact_has_tags'});db[_0xf61d('0x6f')][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':_0xf61d('0x18b'),'as':_0xf61d('0x163')});db[_0xf61d('0x70')][_0xf61d('0x142')](db[_0xf61d('0x6f')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0xf61d('0x137')});db[_0xf61d('0x70')]['belongsTo'](db[_0xf61d('0x116')],{'as':_0xf61d('0x15a'),'foreignKey':_0xf61d('0x15b'),'onDelete':_0xf61d('0x137')});db[_0xf61d('0x70')][_0xf61d('0x142')](db['User'],{'as':_0xf61d('0x181'),'foreignKey':_0xf61d('0x104')});db['CmHopper'][_0xf61d('0x142')](db[_0xf61d('0x1b')],{'as':_0xf61d('0x182'),'foreignKey':'VoiceQueueId','onDelete':_0xf61d('0x137')});db['CmHopper'][_0xf61d('0x142')](db[_0xf61d('0xe0')],{'as':_0xf61d('0xe0'),'foreignKey':'CampaignId','onDelete':_0xf61d('0x137')});db[_0xf61d('0x70')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'as':_0xf61d('0x160'),'foreignKey':_0xf61d('0x18c')});db[_0xf61d('0x13d')]['belongsTo'](db[_0xf61d('0x6f')],{'as':_0xf61d('0x15f'),'foreignKey':_0xf61d('0x154'),'onDelete':_0xf61d('0x137')});db[_0xf61d('0x13d')]['belongsTo'](db['CmList'],{'as':_0xf61d('0x15a'),'foreignKey':_0xf61d('0x15b'),'onDelete':_0xf61d('0x137')});db[_0xf61d('0x13d')][_0xf61d('0x142')](db['VoiceQueue'],{'as':_0xf61d('0x182'),'foreignKey':_0xf61d('0x13b'),'onDelete':'cascade'});db[_0xf61d('0x13d')][_0xf61d('0x142')](db[_0xf61d('0xe0')],{'as':_0xf61d('0xe0'),'foreignKey':_0xf61d('0x18d'),'onDelete':_0xf61d('0x137')});db[_0xf61d('0x7a')][_0xf61d('0x102')](db[_0xf61d('0x80')],{'as':{'plural':_0xf61d('0x18e'),'singular':_0xf61d('0x18f')},'foreignKey':_0xf61d('0x190'),'onDelete':'cascade','hooks':!![]});db[_0xf61d('0x7a')][_0xf61d('0x102')](db[_0xf61d('0x80')],{'as':{'plural':'Any','singular':_0xf61d('0x191')},'foreignKey':_0xf61d('0x192'),'onDelete':'cascade','hooks':!![]});db[_0xf61d('0x7a')][_0xf61d('0x102')](db[_0xf61d('0x193')],{'as':'Actions','foreignKey':_0xf61d('0x194'),'onDelete':'cascade','hooks':!![]});db[_0xf61d('0x82')][_0xf61d('0x102')](db[_0xf61d('0x82')],{'as':_0xf61d('0x195'),'foreignKey':_0xf61d('0x145'),'onDelete':_0xf61d('0x137'),'hooks':!![],'required':![]});db['Interval'][_0xf61d('0x102')](db[_0xf61d('0x17')],{'as':_0xf61d('0x106'),'foreignKey':_0xf61d('0x145'),'onDelete':_0xf61d('0x166')});db['Interval'][_0xf61d('0x102')](db[_0xf61d('0x44')],{'as':_0xf61d('0x196'),'foreignKey':'IntervalId'});db[_0xf61d('0x82')][_0xf61d('0x102')](db['ChatApplication'],{'as':_0xf61d('0x197'),'foreignKey':'IntervalId'});db[_0xf61d('0x82')][_0xf61d('0x102')](db[_0xf61d('0x4c')],{'as':_0xf61d('0x198'),'foreignKey':_0xf61d('0x145')});db[_0xf61d('0x82')][_0xf61d('0x102')](db[_0xf61d('0x54')],{'as':_0xf61d('0x199'),'foreignKey':_0xf61d('0x145')});db['Schedule']['belongsTo'](db['MailAccount'],{});db['Schedule'][_0xf61d('0x142')](db[_0xf61d('0x96')],{'foreignKey':'DefaultReportId'});db[_0xf61d('0x89')][_0xf61d('0x142')](db['AnalyticCustomReport'],{'foreignKey':_0xf61d('0x19a')});db[_0xf61d('0x8b')]['belongsToMany'](db[_0xf61d('0x19')],{'as':_0xf61d('0x19b'),'through':'moh_has_sounds','onDelete':'restrict'});db['Tag']['belongsToMany'](db[_0xf61d('0x6f')],{'through':_0xf61d('0x18b')});db['Tag']['belongsToMany'](db[_0xf61d('0x66')],{'through':_0xf61d('0x186')});db['Tag'][_0xf61d('0x112')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db['Tag'][_0xf61d('0x112')](db[_0xf61d('0x55')],{'through':_0xf61d('0x176')});db[_0xf61d('0x8d')]['belongsToMany'](db['FaxInteraction'],{'through':_0xf61d('0x16d')});db[_0xf61d('0x8d')][_0xf61d('0x112')](db[_0xf61d('0x5b')],{'through':'openchannel_interaction_has_tags'});db['Tag']['belongsToMany'](db[_0xf61d('0x120')],{'through':'whatsapp_interaction_has_tags'});db[_0xf61d('0x90')][_0xf61d('0x102')](db[_0xf61d('0x80')],{'as':{'plural':_0xf61d('0x19c'),'singular':_0xf61d('0x19d')},'foreignKey':_0xf61d('0x19e'),'onDelete':'cascade','hooks':!![]});db[_0xf61d('0x90')][_0xf61d('0x102')](db[_0xf61d('0x80')],{'as':{'plural':_0xf61d('0x19f'),'singular':_0xf61d('0x1a0')},'foreignKey':_0xf61d('0x1a1'),'onDelete':_0xf61d('0x137'),'hooks':!![]});db['Trigger'][_0xf61d('0x102')](db[_0xf61d('0x193')],{'as':_0xf61d('0x1a2'),'foreignKey':_0xf61d('0x1a3'),'onDelete':_0xf61d('0x137'),'hooks':!![]});db[_0xf61d('0x94')][_0xf61d('0x102')](db[_0xf61d('0x9c')],{'as':_0xf61d('0x1a4'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0xf61d('0x96')][_0xf61d('0x102')](db['AnalyticFieldReport'],{'as':_0xf61d('0x1a4'),'onDelete':'cascade','foreignKey':'DefaultReportId'});db[_0xf61d('0x9a')][_0xf61d('0x102')](db[_0xf61d('0x9c')],{'as':_0xf61d('0x1a4'),'onDelete':'cascade','foreignKey':_0xf61d('0x1a5')});db[_0xf61d('0x9c')]['belongsTo'](db[_0xf61d('0x9a')],{'foreignKey':'MetricId'});db[_0xf61d('0x9f')]['hasMany'](db[_0xf61d('0x1a6')],{'as':_0xf61d('0x1a7'),'onDelete':_0xf61d('0x137'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0xf61d('0x102')](db[_0xf61d('0xa2')],{'as':_0xf61d('0x1a8'),'onDelete':_0xf61d('0x137'),'foreignKey':'SubjectId'});db[_0xf61d('0x1a6')][_0xf61d('0x102')](db[_0xf61d('0xa2')],{'as':_0xf61d('0x1a9'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1aa')});db['SalesforceConfiguration'][_0xf61d('0x102')](db[_0xf61d('0xa2')],{'as':_0xf61d('0x1a4'),'onDelete':'cascade','foreignKey':_0xf61d('0x1ab')});db['SalesforceConfiguration'][_0xf61d('0x142')](db[_0xf61d('0x9f')],{'as':_0xf61d('0x15e'),'foreignKey':'AccountId'});db[_0xf61d('0xa2')][_0xf61d('0x102')](db[_0xf61d('0xa2')],{'as':_0xf61d('0x1ac'),'foreignKey':_0xf61d('0x1ad')});db[_0xf61d('0xa2')][_0xf61d('0x102')](db['SalesforceField'],{'as':_0xf61d('0x1ae'),'foreignKey':_0xf61d('0x1aa')});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':'Field','foreignKey':'FieldId'});db[_0xf61d('0xa2')][_0xf61d('0x142')](db[_0xf61d('0x1af')],{'as':_0xf61d('0x1af'),'foreignKey':_0xf61d('0x1b0')});db[_0xf61d('0xa3')][_0xf61d('0x102')](db[_0xf61d('0xa5')],{'as':_0xf61d('0x1a7'),'onDelete':_0xf61d('0x137'),'foreignKey':'AccountId'});db[_0xf61d('0xa5')][_0xf61d('0x102')](db[_0xf61d('0xa7')],{'as':_0xf61d('0x1a8'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1ad')});db[_0xf61d('0xa5')][_0xf61d('0x102')](db[_0xf61d('0xa7')],{'as':_0xf61d('0x1a9'),'onDelete':_0xf61d('0x137'),'foreignKey':'DescriptionId'});db[_0xf61d('0xa5')][_0xf61d('0x102')](db[_0xf61d('0xa7')],{'as':'Fields','onDelete':_0xf61d('0x137'),'foreignKey':'FieldId'});db[_0xf61d('0xa5')]['belongsTo'](db['SugarcrmAccount'],{'as':_0xf61d('0x15e'),'foreignKey':_0xf61d('0x1b1')});db['SugarcrmField'][_0xf61d('0x102')](db[_0xf61d('0xa7')],{'as':_0xf61d('0x1ac'),'foreignKey':_0xf61d('0x1ad')});db[_0xf61d('0xa7')]['hasMany'](db[_0xf61d('0xa7')],{'as':_0xf61d('0x1ae'),'foreignKey':_0xf61d('0x1aa')});db[_0xf61d('0xa7')][_0xf61d('0x102')](db['SugarcrmField'],{'as':_0xf61d('0x1b2'),'foreignKey':'FieldId'});db['SugarcrmField'][_0xf61d('0x142')](db[_0xf61d('0x1af')],{'as':_0xf61d('0x1af'),'foreignKey':_0xf61d('0x1b0')});db[_0xf61d('0xa9')][_0xf61d('0x102')](db[_0xf61d('0xaa')],{'as':_0xf61d('0x1a7'),'onDelete':_0xf61d('0x137'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0xf61d('0x102')](db[_0xf61d('0xab')],{'as':'Subjects','onDelete':'cascade','foreignKey':_0xf61d('0x1ad')});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':_0xf61d('0x1a9'),'onDelete':_0xf61d('0x137'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xf61d('0x102')](db[_0xf61d('0xab')],{'as':_0xf61d('0x1a4'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1ab')});db['DeskConfiguration']['belongsTo'](db[_0xf61d('0xa9')],{'as':_0xf61d('0x15e'),'foreignKey':_0xf61d('0x1b1')});db[_0xf61d('0xaa')][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':_0xf61d('0x1b3')});db['DeskField'][_0xf61d('0x102')](db[_0xf61d('0xab')],{'as':_0xf61d('0x1ac'),'foreignKey':'SubjectId'});db['DeskField'][_0xf61d('0x102')](db['DeskField'],{'as':'Description','foreignKey':_0xf61d('0x1aa')});db[_0xf61d('0xab')][_0xf61d('0x102')](db['DeskField'],{'as':_0xf61d('0x1b2'),'foreignKey':_0xf61d('0x1ab')});db[_0xf61d('0xab')][_0xf61d('0x142')](db[_0xf61d('0x1af')],{'as':'Variable','foreignKey':_0xf61d('0x1b0')});db[_0xf61d('0xad')][_0xf61d('0x102')](db['ZohoConfiguration'],{'as':_0xf61d('0x1a7'),'onDelete':_0xf61d('0x137'),'foreignKey':'AccountId'});db['ZohoConfiguration'][_0xf61d('0x102')](db[_0xf61d('0xaf')],{'as':_0xf61d('0x1a8'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1ad')});db[_0xf61d('0x1b4')]['hasMany'](db[_0xf61d('0xaf')],{'as':'Descriptions','onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1aa')});db['ZohoConfiguration'][_0xf61d('0x102')](db['ZohoField'],{'as':_0xf61d('0x1a4'),'onDelete':_0xf61d('0x137'),'foreignKey':'FieldId'});db[_0xf61d('0x1b4')][_0xf61d('0x142')](db[_0xf61d('0xad')],{'as':_0xf61d('0x15e'),'foreignKey':_0xf61d('0x1b1')});db[_0xf61d('0xaf')]['hasMany'](db['ZohoField'],{'as':_0xf61d('0x1ac'),'foreignKey':'SubjectId'});db[_0xf61d('0xaf')][_0xf61d('0x102')](db[_0xf61d('0xaf')],{'as':_0xf61d('0x1ae'),'foreignKey':_0xf61d('0x1aa')});db[_0xf61d('0xaf')]['hasMany'](db[_0xf61d('0xaf')],{'as':_0xf61d('0x1b2'),'foreignKey':_0xf61d('0x1ab')});db['ZohoField'][_0xf61d('0x142')](db['Variable'],{'as':_0xf61d('0x1af'),'foreignKey':_0xf61d('0x1b0')});db[_0xf61d('0xb0')][_0xf61d('0x102')](db['ZendeskConfiguration'],{'as':_0xf61d('0x1a7'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1b1')});db[_0xf61d('0xb1')][_0xf61d('0x102')](db[_0xf61d('0x1b5')],{'as':_0xf61d('0x1a8'),'foreignKey':_0xf61d('0x1ad')});db['ZendeskConfiguration'][_0xf61d('0x102')](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0xf61d('0x1aa')});db[_0xf61d('0xb1')]['hasMany'](db['ZendeskField'],{'as':_0xf61d('0x1a4'),'foreignKey':_0xf61d('0x1ab')});db[_0xf61d('0xb1')]['belongsTo'](db['ZendeskAccount'],{'as':_0xf61d('0x15e'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':_0xf61d('0x1b6')});db[_0xf61d('0x1b5')][_0xf61d('0x102')](db['ZendeskField'],{'as':_0xf61d('0x1ac'),'foreignKey':_0xf61d('0x1ad')});db[_0xf61d('0x1b5')][_0xf61d('0x102')](db[_0xf61d('0x1b5')],{'as':_0xf61d('0x1ae'),'foreignKey':'DescriptionId'});db[_0xf61d('0x1b5')][_0xf61d('0x102')](db[_0xf61d('0x1b5')],{'as':_0xf61d('0x1b2'),'foreignKey':_0xf61d('0x1ab')});db[_0xf61d('0x1b5')]['belongsTo'](db['Variable'],{'as':_0xf61d('0x1af'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0xf61d('0x102')](db[_0xf61d('0xb5')],{'as':_0xf61d('0x1a7'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1b1')});db[_0xf61d('0xb5')][_0xf61d('0x102')](db['FreshdeskField'],{'as':_0xf61d('0x1a8'),'onDelete':_0xf61d('0x137'),'foreignKey':'SubjectId'});db[_0xf61d('0xb5')][_0xf61d('0x102')](db[_0xf61d('0x1b7')],{'as':_0xf61d('0x1a9'),'onDelete':_0xf61d('0x137'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration']['hasMany'](db[_0xf61d('0x1b7')],{'as':_0xf61d('0x1a4'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1ab')});db[_0xf61d('0xb5')]['belongsTo'](db[_0xf61d('0x1b8')],{'as':_0xf61d('0x15e'),'foreignKey':_0xf61d('0x1b1')});db['FreshdeskConfiguration'][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':_0xf61d('0x1b9')});db[_0xf61d('0x1b7')]['hasMany'](db[_0xf61d('0x1b7')],{'as':_0xf61d('0x1ac'),'foreignKey':_0xf61d('0x1ad')});db[_0xf61d('0x1b7')][_0xf61d('0x102')](db['FreshdeskField'],{'as':_0xf61d('0x1ae'),'foreignKey':_0xf61d('0x1aa')});db[_0xf61d('0x1b7')]['hasMany'](db[_0xf61d('0x1b7')],{'as':_0xf61d('0x1b2'),'foreignKey':_0xf61d('0x1ab')});db[_0xf61d('0x1b7')][_0xf61d('0x142')](db[_0xf61d('0x1af')],{'as':_0xf61d('0x1af'),'foreignKey':_0xf61d('0x1b0')});db['VtigerAccount'][_0xf61d('0x102')](db[_0xf61d('0xb7')],{'as':'Configurations','onDelete':_0xf61d('0x137'),'foreignKey':'AccountId'});db[_0xf61d('0xb7')][_0xf61d('0x102')](db[_0xf61d('0x1ba')],{'as':_0xf61d('0x1a8'),'foreignKey':_0xf61d('0x1ad')});db[_0xf61d('0xb7')][_0xf61d('0x102')](db[_0xf61d('0x1ba')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xf61d('0xb7')]['hasMany'](db[_0xf61d('0x1ba')],{'as':_0xf61d('0x1a4'),'foreignKey':_0xf61d('0x1ab')});db[_0xf61d('0xb7')]['belongsTo'](db[_0xf61d('0xb6')],{'as':_0xf61d('0x15e'),'foreignKey':_0xf61d('0x1b1')});db[_0xf61d('0x1ba')][_0xf61d('0x102')](db[_0xf61d('0x1ba')],{'as':_0xf61d('0x1ac'),'foreignKey':_0xf61d('0x1ad')});db['VtigerField'][_0xf61d('0x102')](db[_0xf61d('0x1ba')],{'as':_0xf61d('0x1ae'),'foreignKey':_0xf61d('0x1aa')});db[_0xf61d('0x1ba')][_0xf61d('0x102')](db[_0xf61d('0x1ba')],{'as':_0xf61d('0x1b2'),'foreignKey':_0xf61d('0x1ab')});db[_0xf61d('0x1ba')][_0xf61d('0x142')](db[_0xf61d('0x1af')],{'as':_0xf61d('0x1af'),'foreignKey':_0xf61d('0x1b0')});db[_0xf61d('0x1bb')]['hasMany'](db[_0xf61d('0xba')],{'as':_0xf61d('0x1a7'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1b1')});db[_0xf61d('0xba')][_0xf61d('0x102')](db[_0xf61d('0xbc')],{'as':_0xf61d('0x1a8'),'foreignKey':_0xf61d('0x1ad')});db[_0xf61d('0xba')][_0xf61d('0x102')](db['ServicenowField'],{'as':_0xf61d('0x1a9'),'foreignKey':_0xf61d('0x1aa')});db[_0xf61d('0xba')][_0xf61d('0x102')](db[_0xf61d('0xbc')],{'as':_0xf61d('0x1a4'),'foreignKey':_0xf61d('0x1ab')});db['ServicenowConfiguration'][_0xf61d('0x142')](db['ServicenowAccount'],{'as':'Account','foreignKey':'AccountId'});db['ServicenowField'][_0xf61d('0x102')](db[_0xf61d('0xbc')],{'as':_0xf61d('0x1ac'),'foreignKey':_0xf61d('0x1ad')});db['ServicenowField'][_0xf61d('0x102')](db[_0xf61d('0xbc')],{'as':_0xf61d('0x1ae'),'foreignKey':_0xf61d('0x1aa')});db[_0xf61d('0xbc')][_0xf61d('0x102')](db[_0xf61d('0xbc')],{'as':'Field','foreignKey':_0xf61d('0x1ab')});db[_0xf61d('0xbc')][_0xf61d('0x142')](db[_0xf61d('0x1af')],{'as':_0xf61d('0x1af'),'foreignKey':_0xf61d('0x1b0')});db[_0xf61d('0x1bc')][_0xf61d('0x102')](db[_0xf61d('0xbf')],{'as':_0xf61d('0x1a7'),'onDelete':'cascade','foreignKey':_0xf61d('0x1b1')});db[_0xf61d('0xbf')][_0xf61d('0x102')](db[_0xf61d('0xc1')],{'as':_0xf61d('0x1a8'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1ad')});db[_0xf61d('0xbf')][_0xf61d('0x102')](db[_0xf61d('0xc1')],{'as':_0xf61d('0x1a9'),'onDelete':_0xf61d('0x137'),'foreignKey':'DescriptionId'});db[_0xf61d('0xbf')][_0xf61d('0x102')](db['Dynamics365Field'],{'as':_0xf61d('0x1a4'),'onDelete':_0xf61d('0x137'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0xf61d('0x142')](db[_0xf61d('0x1bc')],{'as':_0xf61d('0x15e'),'foreignKey':_0xf61d('0x1b1')});db[_0xf61d('0xc1')][_0xf61d('0x102')](db[_0xf61d('0xc1')],{'as':_0xf61d('0x1ac'),'foreignKey':_0xf61d('0x1ad')});db[_0xf61d('0xc1')]['hasMany'](db[_0xf61d('0xc1')],{'as':_0xf61d('0x1ae'),'foreignKey':_0xf61d('0x1aa')});db[_0xf61d('0xc1')][_0xf61d('0x102')](db[_0xf61d('0xc1')],{'as':_0xf61d('0x1b2'),'foreignKey':'FieldId'});db[_0xf61d('0xc1')][_0xf61d('0x142')](db[_0xf61d('0x1af')],{'as':_0xf61d('0x1af'),'foreignKey':_0xf61d('0x1b0')});db['FreshsalesAccount']['hasMany'](db[_0xf61d('0xc5')],{'as':'Configurations','onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1b1')});db[_0xf61d('0xc5')][_0xf61d('0x102')](db[_0xf61d('0xc7')],{'as':_0xf61d('0x1a8'),'foreignKey':'SubjectId'});db[_0xf61d('0xc5')][_0xf61d('0x102')](db[_0xf61d('0xc7')],{'as':_0xf61d('0x1a9'),'foreignKey':_0xf61d('0x1aa')});db[_0xf61d('0xc5')][_0xf61d('0x102')](db[_0xf61d('0xc7')],{'as':_0xf61d('0x1a4'),'foreignKey':_0xf61d('0x1ab')});db['FreshsalesConfiguration'][_0xf61d('0x142')](db[_0xf61d('0xc3')],{'as':_0xf61d('0x15e'),'foreignKey':_0xf61d('0x1b1')});db[_0xf61d('0xc7')][_0xf61d('0x102')](db[_0xf61d('0xc7')],{'as':_0xf61d('0x1ac'),'foreignKey':_0xf61d('0x1ad')});db[_0xf61d('0xc7')]['hasMany'](db['FreshsalesField'],{'as':_0xf61d('0x1ae'),'foreignKey':'DescriptionId'});db[_0xf61d('0xc7')][_0xf61d('0x102')](db['FreshsalesField'],{'as':'Field','foreignKey':_0xf61d('0x1ab')});db[_0xf61d('0xc7')][_0xf61d('0x142')](db[_0xf61d('0x1af')],{'as':_0xf61d('0x1af'),'foreignKey':_0xf61d('0x1b0')});db[_0xf61d('0xcc')][_0xf61d('0x142')](db['ChatWebsite'],{});db[_0xf61d('0xcc')][_0xf61d('0x142')](db[_0xf61d('0x116')],{'as':_0xf61d('0x15a'),'foreignKey':_0xf61d('0x15b')});db[_0xf61d('0xcc')][_0xf61d('0x142')](db[_0xf61d('0x6f')],{'as':_0xf61d('0x15f'),'foreignKey':'ContactId'});db[_0xf61d('0xcc')]['belongsTo'](db[_0xf61d('0x66')],{});db[_0xf61d('0xcc')][_0xf61d('0x142')](db[_0xf61d('0x67')],{});db[_0xf61d('0xcc')][_0xf61d('0x142')](db['User'],{});db[_0xf61d('0xcc')][_0xf61d('0x142')](db[_0xf61d('0x6a')],{});db[_0xf61d('0xcd')]['belongsTo'](db['User'],{'onDelete':_0xf61d('0x137'),'foreignKey':'FromId'});db[_0xf61d('0xcd')]['belongsTo'](db['User'],{'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1bd')});db[_0xf61d('0xd0')][_0xf61d('0x102')](db[_0xf61d('0xce')],{'foreignKey':'SessionId','onDelete':_0xf61d('0x137')});db['JscriptySessionReport'][_0xf61d('0x102')](db[_0xf61d('0x1be')],{'foreignKey':'SessionId','onDelete':_0xf61d('0x137')});db[_0xf61d('0x1bf')][_0xf61d('0x142')](db[_0xf61d('0x134')],{});db['SmsQueueReport'][_0xf61d('0x142')](db[_0xf61d('0x116')],{'as':_0xf61d('0x15a'),'foreignKey':'ListId'});db['SmsQueueReport'][_0xf61d('0x142')](db[_0xf61d('0x6f')],{'as':'Contact','foreignKey':_0xf61d('0x154')});db[_0xf61d('0x1bf')][_0xf61d('0x142')](db[_0xf61d('0x55')],{});db[_0xf61d('0x1bf')][_0xf61d('0x142')](db[_0xf61d('0x172')],{});db['SmsQueueReport']['belongsTo'](db['User'],{});db[_0xf61d('0x1bf')][_0xf61d('0x142')](db['SmsQueue'],{});db['JscriptyProject']['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0xf61d('0x1c0')});db['JscriptyProject'][_0xf61d('0x102')](db[_0xf61d('0xce')],{'foreignKey':_0xf61d('0x1c0')});db[_0xf61d('0x1c1')]['hasMany'](db[_0xf61d('0x1be')],{'foreignKey':_0xf61d('0x1c0')});db[_0xf61d('0xd9')][_0xf61d('0x112')](db['User'],{'as':_0xf61d('0x164'),'through':_0xf61d('0x1c2')});db['Team'][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':_0xf61d('0x148'),'through':_0xf61d('0x119')});db[_0xf61d('0xdd')]['belongsToMany'](db[_0xf61d('0x1b')],{'through':_0xf61d('0x1c3'),'as':_0xf61d('0x122')});db['Team']['belongsToMany'](db['MailQueue'],{'through':'team_has_mail_queues','as':_0xf61d('0x123')});db[_0xf61d('0xdd')][_0xf61d('0x112')](db[_0xf61d('0x6a')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0xf61d('0xdd')][_0xf61d('0x112')](db[_0xf61d('0x51')],{'through':_0xf61d('0x16f'),'as':_0xf61d('0x125')});db['Team']['belongsToMany'](db[_0xf61d('0x174')],{'through':_0xf61d('0x178'),'as':'SmsQueues'});db[_0xf61d('0xdd')][_0xf61d('0x112')](db[_0xf61d('0x5e')],{'through':_0xf61d('0x17e'),'as':_0xf61d('0x128')});db[_0xf61d('0xdd')][_0xf61d('0x112')](db[_0xf61d('0xfd')],{'through':_0xf61d('0x1c4'),'as':_0xf61d('0x129')});db['Campaign'][_0xf61d('0x102')](db[_0xf61d('0x70')],{'as':_0xf61d('0x1c5'),'foreignKey':'CampaignId'});db[_0xf61d('0xe0')][_0xf61d('0x102')](db[_0xf61d('0x73')],{'as':_0xf61d('0x107'),'foreignKey':_0xf61d('0x18d')});db[_0xf61d('0xe0')][_0xf61d('0x102')](db[_0xf61d('0x75')],{'as':_0xf61d('0x13c'),'foreignKey':'CampaignId'});db[_0xf61d('0xe0')]['hasMany'](db[_0xf61d('0x13d')],{'as':'HopperBlacks','foreignKey':_0xf61d('0x18d')});db[_0xf61d('0xe0')][_0xf61d('0x142')](db[_0xf61d('0x140')],{'as':'Trunk','foreignKey':_0xf61d('0x141')});db[_0xf61d('0xe0')][_0xf61d('0x142')](db[_0xf61d('0x140')],{'as':_0xf61d('0x143'),'foreignKey':_0xf61d('0x144')});db['Campaign'][_0xf61d('0x142')](db[_0xf61d('0x82')],{'as':_0xf61d('0x82'),'foreignKey':_0xf61d('0x145')});db[_0xf61d('0xe0')][_0xf61d('0x142')](db[_0xf61d('0xd9')],{'as':'SquareProject','foreignKey':_0xf61d('0x1c6')});db[_0xf61d('0xe0')]['belongsToMany'](db['CmList'],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xf61d('0xe0')][_0xf61d('0x112')](db['CmList'],{'as':'BlackLists','through':_0xf61d('0x1c7')});db['MailTransferReport'][_0xf61d('0x142')](db[_0xf61d('0x43')],{});db[_0xf61d('0xe7')]['belongsTo'](db['MailInteraction'],{});db[_0xf61d('0xe7')][_0xf61d('0x142')](db['MailAccount'],{'foreignKey':_0xf61d('0x1c8'),'as':_0xf61d('0x1c9')});db[_0xf61d('0xe7')]['belongsTo'](db[_0xf61d('0x11')],{'foreignKey':_0xf61d('0x1ca'),'as':_0xf61d('0x1cb')});db[_0xf61d('0xe7')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'foreignKey':_0xf61d('0x1cc'),'as':_0xf61d('0x1cd')});db[_0xf61d('0xe7')]['belongsTo'](db[_0xf61d('0x3e')],{'foreignKey':_0xf61d('0x1ce'),'as':_0xf61d('0x1cf')});db[_0xf61d('0xe7')][_0xf61d('0x142')](db[_0xf61d('0x3c')],{'foreignKey':_0xf61d('0x1d0'),'as':'ToAccount'});db[_0xf61d('0x1d1')][_0xf61d('0x142')](db['ChatMessage'],{});db[_0xf61d('0x1d1')][_0xf61d('0x142')](db[_0xf61d('0x66')],{});db[_0xf61d('0x1d1')][_0xf61d('0x142')](db[_0xf61d('0x60')],{'foreignKey':'FromChatWebsiteId','as':_0xf61d('0x1c9')});db[_0xf61d('0x1d1')][_0xf61d('0x142')](db['User'],{'foreignKey':'FromUserId','as':_0xf61d('0x1cb')});db[_0xf61d('0x1d1')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'foreignKey':_0xf61d('0x1cc'),'as':'ToAgent'});db[_0xf61d('0x1d1')]['belongsTo'](db['ChatQueue'],{'foreignKey':_0xf61d('0x1d2'),'as':_0xf61d('0x1cf')});db['ChatTransferReport'][_0xf61d('0x142')](db[_0xf61d('0x60')],{'foreignKey':'ToChatWebsiteId','as':_0xf61d('0x1d3')});db[_0xf61d('0xea')][_0xf61d('0x142')](db['FaxMessage'],{});db[_0xf61d('0xea')][_0xf61d('0x142')](db[_0xf61d('0x4d')],{});db[_0xf61d('0xea')][_0xf61d('0x142')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':_0xf61d('0x1c9')});db[_0xf61d('0xea')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'foreignKey':_0xf61d('0x1ca'),'as':_0xf61d('0x1cb')});db[_0xf61d('0xea')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'foreignKey':'ToUserId','as':_0xf61d('0x1cd')});db[_0xf61d('0xea')][_0xf61d('0x142')](db[_0xf61d('0x51')],{'foreignKey':'ToFaxQueueId','as':_0xf61d('0x1cf')});db['FaxTransferReport']['belongsTo'](db[_0xf61d('0x12d')],{'foreignKey':'ToFaxAccountId','as':_0xf61d('0x1d3')});db[_0xf61d('0x1d4')][_0xf61d('0x142')](db[_0xf61d('0x17a')],{});db[_0xf61d('0x1d4')][_0xf61d('0x142')](db[_0xf61d('0x5b')],{});db[_0xf61d('0x1d4')][_0xf61d('0x142')](db[_0xf61d('0x132')],{'foreignKey':_0xf61d('0x1d5'),'as':_0xf61d('0x1c9')});db['OpenchannelTransferReport'][_0xf61d('0x142')](db[_0xf61d('0x11')],{'foreignKey':_0xf61d('0x1ca'),'as':_0xf61d('0x1cb')});db[_0xf61d('0x1d4')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'foreignKey':_0xf61d('0x1cc'),'as':_0xf61d('0x1cd')});db[_0xf61d('0x1d4')][_0xf61d('0x142')](db['OpenchannelQueue'],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0xf61d('0x1d4')][_0xf61d('0x142')](db[_0xf61d('0x132')],{'foreignKey':_0xf61d('0x1d6'),'as':_0xf61d('0x1d3')});db[_0xf61d('0xec')][_0xf61d('0x142')](db[_0xf61d('0x172')],{});db[_0xf61d('0xec')][_0xf61d('0x142')](db[_0xf61d('0x55')],{});db[_0xf61d('0xec')][_0xf61d('0x142')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0xf61d('0x1c9')});db[_0xf61d('0xec')]['belongsTo'](db[_0xf61d('0x11')],{'foreignKey':_0xf61d('0x1ca'),'as':_0xf61d('0x1cb')});db[_0xf61d('0xec')][_0xf61d('0x142')](db['User'],{'foreignKey':'ToUserId','as':_0xf61d('0x1cd')});db[_0xf61d('0xec')][_0xf61d('0x142')](db[_0xf61d('0x174')],{'foreignKey':_0xf61d('0x1d7'),'as':_0xf61d('0x1cf')});db[_0xf61d('0xec')]['belongsTo'](db[_0xf61d('0x134')],{'foreignKey':_0xf61d('0x1d8'),'as':'ToAccount'});db[_0xf61d('0x116')][_0xf61d('0x102')](db[_0xf61d('0x7e')],{'as':_0xf61d('0x158'),'foreignKey':_0xf61d('0x15b')});db['CmList'][_0xf61d('0x102')](db[_0xf61d('0x78')],{'as':_0xf61d('0x1d9'),'foreignKey':_0xf61d('0x15b')});db[_0xf61d('0x116')]['hasMany'](db['CmContact'],{'as':_0xf61d('0x114'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x15b')});db[_0xf61d('0x116')][_0xf61d('0x102')](db[_0xf61d('0x73')],{'as':_0xf61d('0x107'),'foreignKey':_0xf61d('0x15b')});db[_0xf61d('0x116')][_0xf61d('0x102')](db[_0xf61d('0x75')],{'as':_0xf61d('0x108'),'foreignKey':_0xf61d('0x15b')});db[_0xf61d('0x116')][_0xf61d('0x102')](db[_0xf61d('0x77')],{'as':_0xf61d('0x77'),'foreignKey':_0xf61d('0x15b')});db[_0xf61d('0x116')][_0xf61d('0x112')](db[_0xf61d('0x1b')],{'as':_0xf61d('0x1da'),'through':_0xf61d('0x1db')});db[_0xf61d('0x116')][_0xf61d('0x112')](db['User'],{'as':_0xf61d('0x148'),'through':_0xf61d('0x118')});db[_0xf61d('0xee')]['hasMany'](db[_0xf61d('0x17')],{'as':_0xf61d('0x106'),'onDelete':'cascade'});db[_0xf61d('0xee')][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':'Agents','through':_0xf61d('0x12a')});db[_0xf61d('0x110')]['hasMany'](db[_0xf61d('0x11')],{'as':_0xf61d('0x164'),'foreignKey':_0xf61d('0x111')});db[_0xf61d('0x110')][_0xf61d('0x102')](db['UserProfileSection'],{'as':_0xf61d('0x1dc'),'foreignKey':_0xf61d('0x111'),'onDelete':_0xf61d('0x137')});db[_0xf61d('0x1dd')][_0xf61d('0x102')](db['UserProfileResource'],{'as':_0xf61d('0x1de'),'foreignKey':_0xf61d('0x1df'),'onDelete':_0xf61d('0x137')});db['WhatsappAccount']['hasMany'](db[_0xf61d('0x7e')],{'as':_0xf61d('0x158'),'foreignKey':_0xf61d('0x1e0')});db[_0xf61d('0xf4')][_0xf61d('0x102')](db[_0xf61d('0x7c')],{'as':_0xf61d('0x168'),'foreignKey':_0xf61d('0x1e0')});db[_0xf61d('0xf4')][_0xf61d('0x102')](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0xf61d('0x1e0')});db[_0xf61d('0xf4')][_0xf61d('0x102')](db[_0xf61d('0x120')],{'as':_0xf61d('0x16a')});db[_0xf61d('0xf4')][_0xf61d('0x102')](db[_0xf61d('0x1e1')],{'as':_0xf61d('0x159')});db[_0xf61d('0xf4')][_0xf61d('0x142')](db[_0xf61d('0x116')],{'as':_0xf61d('0x15a'),'foreignKey':'ListId'});db[_0xf61d('0xf4')][_0xf61d('0x142')](db[_0xf61d('0x84')],{'as':_0xf61d('0x146'),'foreignKey':_0xf61d('0x147')});db[_0xf61d('0xf4')][_0xf61d('0x112')](db['User'],{'as':_0xf61d('0x148'),'through':'user_has_whatsapp_accounts'});db[_0xf61d('0x1e1')]['belongsTo'](db[_0xf61d('0x11')],{'onDelete':_0xf61d('0x166')});db[_0xf61d('0x1e1')][_0xf61d('0x142')](db['WhatsappQueue'],{'onDelete':_0xf61d('0x166')});db['WhatsappApplication'][_0xf61d('0x142')](db[_0xf61d('0xf4')],{'onDelete':'restrict'});db[_0xf61d('0x1e1')]['belongsTo'](db[_0xf61d('0x82')],{'onDelete':_0xf61d('0x166'),'foreignKey':'IntervalId'});db[_0xf61d('0x1e1')]['belongsTo'](db[_0xf61d('0x8d')],{'onDelete':_0xf61d('0x166'),'foreignKey':_0xf61d('0x167')});db['WhatsappInteraction'][_0xf61d('0x102')](db[_0xf61d('0xf8')],{'as':_0xf61d('0x14c'),'onDelete':_0xf61d('0x137'),'foreignKey':_0xf61d('0x1e2')});db['WhatsappInteraction'][_0xf61d('0x142')](db[_0xf61d('0xf4')],{'as':_0xf61d('0x15e'),'foreignKey':_0xf61d('0x1e0')});db[_0xf61d('0x120')]['belongsTo'](db[_0xf61d('0x6f')],{'as':_0xf61d('0x15f'),'foreignKey':_0xf61d('0x154')});db['WhatsappInteraction']['belongsTo'](db[_0xf61d('0x11')],{'as':_0xf61d('0x160'),'foreignKey':_0xf61d('0x104')});db['WhatsappInteraction'][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':_0xf61d('0x1e3'),'as':_0xf61d('0x161')});db[_0xf61d('0x120')][_0xf61d('0x112')](db[_0xf61d('0x8d')],{'through':_0xf61d('0x1e3'),'as':_0xf61d('0x163')});db['WhatsappInteraction'][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':_0xf61d('0x164'),'through':_0xf61d('0x121'),'foreignKey':_0xf61d('0x1e2')});db['WhatsappMessage']['belongsTo'](db['User'],{'as':'User'});db['WhatsappMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0xf61d('0xf8')]['belongsTo'](db[_0xf61d('0x120')],{'onDelete':_0xf61d('0x137'),'as':_0xf61d('0x165'),'foreignKey':_0xf61d('0x1e2')});db[_0xf61d('0xf8')][_0xf61d('0x142')](db[_0xf61d('0xf4')],{'as':_0xf61d('0x15e'),'foreignKey':_0xf61d('0x1e0')});db['WhatsappQueueReport'][_0xf61d('0x142')](db['WhatsappAccount'],{});db[_0xf61d('0x1e4')][_0xf61d('0x142')](db[_0xf61d('0x116')],{'as':_0xf61d('0x15a'),'foreignKey':_0xf61d('0x15b')});db[_0xf61d('0x1e4')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xf61d('0x154')});db[_0xf61d('0x1e4')]['belongsTo'](db[_0xf61d('0x120')],{});db[_0xf61d('0x1e4')][_0xf61d('0x142')](db[_0xf61d('0xfd')],{});db[_0xf61d('0x1e4')][_0xf61d('0x142')](db[_0xf61d('0xf8')],{});db[_0xf61d('0x1e4')][_0xf61d('0x142')](db[_0xf61d('0x11')],{});db[_0xf61d('0xfb')][_0xf61d('0x142')](db[_0xf61d('0xf8')],{});db[_0xf61d('0xfb')][_0xf61d('0x142')](db['WhatsappInteraction'],{});db[_0xf61d('0xfb')][_0xf61d('0x142')](db['WhatsappAccount'],{'foreignKey':_0xf61d('0x1e5'),'as':_0xf61d('0x1c9')});db['WhatsappTransferReport']['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0xf61d('0x1e6'),'as':_0xf61d('0x1d3')});db[_0xf61d('0xfb')][_0xf61d('0x142')](db[_0xf61d('0xfd')],{'foreignKey':_0xf61d('0x1e7'),'as':_0xf61d('0x1cf')});db[_0xf61d('0xfb')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xf61d('0xfb')][_0xf61d('0x142')](db[_0xf61d('0x11')],{'foreignKey':_0xf61d('0x1cc'),'as':_0xf61d('0x1cd')});db[_0xf61d('0xfd')][_0xf61d('0x112')](db[_0xf61d('0x11')],{'as':_0xf61d('0x148'),'through':_0xf61d('0x37'),'foreignKey':_0xf61d('0x1e8')});db[_0xf61d('0xfd')][_0xf61d('0x112')](db['Team'],{'through':_0xf61d('0x1c4'),'as':_0xf61d('0x149')});module[_0xf61d('0x1e9')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xab29=['../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/migration/migration.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','Notification','../api/notification/notification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','hasOne','VoiceMail','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','FaxInteraction','FaxInteractions','MailInteractions','WhatsappInteractions','Notifications','SenderId','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','Contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_whatsapp_interactions','VoiceQueues','MailQueues','ChatQueues','UserChatQueue','FaxQueues','UserFaxQueue','SmsQueue','OpenchannelQueue','OpenchannelQueues','WhatsappQueue','WhatsappQueues','VoicePrefix','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','VoiceExtension','SpiedAgents','Applications','Sounds','moh_has_sounds','Members','CmHopper','Hoppers','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','Imap','Smtp','Disposition','Dispositions','CannedAnswer','List','ListId','Template','TemplateId','user_has_mail_accounts','team_has_mail_queues','Teams','MailInteractionId','Account','ContactId','mail_interaction_has_tags','Tags','Attachment','Attachments','Interaction','restrict','TagId','MailQueueReport','Dashboard','Items','FaxAccountId','Answers','Interactions','Exntensions','FaxMessage','FaxInteractionId','Owner','fax_interaction_has_tags','ThroughTags','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsMessage','SmsInteractionId','sms_interaction_has_tags','Users','user_has_sms_interactions','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelInteractionId','user_has_openchannel_interactions','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatMessage','OpenchannelQueueReport','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessage','ChatInternalMessage','ChatGroupId','CompanyId','Company','cm_user_has_contacts','cm_contact_has_tags','Queue','Campaign','CampaignId','OwnerId','Automation','All','OneAll','AutomationAllId','OneAny','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','Trigger','Condition','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticMetric','MetricId','SalesforceAccount','Configurations','Subjects','Descriptions','FieldId','AccountId','Description','DescriptionId','Field','VariableId','SugarcrmConfiguration','SubjectId','Subject','DeskConfiguration','DeskField','ZohoConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','FreshsalesField','ChatQueueReport','ToId','SessionId','SmsQueueReport','ProjectId','team_has_chat_queues','team_has_whatsapp_queues','TrunkId','FromMailAccountId','FromAccount','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','ChatTransferReport','FromChatWebsiteId','FromUserId','FromAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','UserProfileSections','WhatsappAccountId','WhatsappMessage','WhatsappApplication','user_has_whatsapp_accounts','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','exports','path','../config/environment','sequelize','lodash','determine','defaultsDeep','motion2','xcall','xC@LL1234','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','127.0.0.1','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','../api/mailApplication/mailApplication.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','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','../api/chatMessage/chatMessage.model','ChatQueue','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','CmCustomField','Action','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmField','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xab29,0x145));var _0x9ab2=function(_0x2efe7a,_0x486b89){_0x2efe7a=_0x2efe7a-0x0;var _0x45795a=_0xab29[_0x2efe7a];return _0x45795a;};'use strict';var path=require(_0x9ab2('0x0'));var config=require(_0x9ab2('0x1'));var Sequelize=require(_0x9ab2('0x2'));var _=require(_0x9ab2('0x3'));var jstz=require('jstz');var timezone=jstz[_0x9ab2('0x4')]();config['sequelize']=_[_0x9ab2('0x5')](config[_0x9ab2('0x2')],{'database':_0x9ab2('0x6'),'username':_0x9ab2('0x7'),'password':_0x9ab2('0x8'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x9ab2('0x9'),'dialectOptions':{'charset':_0x9ab2('0xa')},'logging':![],'timezone':timezone[_0x9ab2('0xb')](),'define':{'charset':_0x9ab2('0xc'),'collate':_0x9ab2('0xd')}}});config['sequelizeHistory']=_[_0x9ab2('0x5')](config[_0x9ab2('0xe')],{'database':_0x9ab2('0x6'),'username':_0x9ab2('0x7'),'password':_0x9ab2('0x8'),'options':{'host':_0x9ab2('0xf'),'port':0xcea,'dialect':_0x9ab2('0x9'),'dialectOptions':{'charset':_0x9ab2('0xa')},'logging':![],'timezone':timezone[_0x9ab2('0xb')](),'define':{'charset':'utf8','collate':_0x9ab2('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9ab2('0x2')]['database'],config['sequelize'][_0x9ab2('0x10')],config[_0x9ab2('0x2')][_0x9ab2('0x11')],config['sequelize'][_0x9ab2('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x9ab2('0xe')]['database'],config[_0x9ab2('0xe')][_0x9ab2('0x10')],config[_0x9ab2('0xe')][_0x9ab2('0x11')],config[_0x9ab2('0xe')][_0x9ab2('0x12')])};db[_0x9ab2('0x13')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x14'));db[_0x9ab2('0x15')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x17'));db[_0x9ab2('0x18')]=db['sequelize']['import'](_0x9ab2('0x19'));db['VoiceExtension']=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/voiceExtension/voiceExtension.model');db[_0x9ab2('0x1a')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x1b'));db[_0x9ab2('0x1c')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x1d'));db[_0x9ab2('0x1e')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x1f'));db[_0x9ab2('0x20')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x21'));db['VoiceMail']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x22'));db['VoiceMailMessage']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x23'));db[_0x9ab2('0x24')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x25'));db[_0x9ab2('0x26')]=db[_0x9ab2('0x2')]['import']('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x27'));db[_0x9ab2('0x28')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x29'));db[_0x9ab2('0x2a')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/memberReport/memberReport.model');db[_0x9ab2('0x2b')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x2c'));db['VoiceTransferReport']=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x2d'));db[_0x9ab2('0x2e')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x2f'));db[_0x9ab2('0x30')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x31'));db['UserChatQueue']=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x32'));db[_0x9ab2('0x33')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x34'));db[_0x9ab2('0x35')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x36'));db[_0x9ab2('0x37')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x38'));db[_0x9ab2('0x39')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x3a'));db[_0x9ab2('0x3b')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x3c'));db[_0x9ab2('0x3d')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x3e'));db[_0x9ab2('0x3f')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x40'));db[_0x9ab2('0x41')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x42'));db[_0x9ab2('0x43')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x44'));db[_0x9ab2('0x45')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x46'));db[_0x9ab2('0x47')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/mailMessage/mailMessage.model');db[_0x9ab2('0x48')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x49'));db['MailQueueReport']=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x4a'));db['Dashboard']=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x4b'));db[_0x9ab2('0x4c')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x4d'));db['FaxAccount']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x4e'));db[_0x9ab2('0x4f')]=db[_0x9ab2('0x2')]['import']('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x50'));db['FaxMessage']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x51'));db[_0x9ab2('0x52')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x53'));db['FaxQueueReport']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x54'));db[_0x9ab2('0x55')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/smsAccount/smsAccount.model');db[_0x9ab2('0x56')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x57'));db[_0x9ab2('0x58')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x59'));db['SmsMessage']=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/smsMessage/smsMessage.model');db['SmsQueue']=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x5a'));db[_0x9ab2('0x5b')]=db['sequelize']['import']('../api/openchannelAccount/openchannelAccount.model');db[_0x9ab2('0x5c')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x5d'));db[_0x9ab2('0x5e')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x5f'));db[_0x9ab2('0x60')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x61'));db['OpenchannelQueue']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x62'));db[_0x9ab2('0x63')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x64'));db['OpenchannelQueueReport']=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x65'));db[_0x9ab2('0x66')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x67'));db[_0x9ab2('0x68')]=db['sequelize']['import'](_0x9ab2('0x69'));db['ChatMessage']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x6a'));db['ChatOfflineMessage']=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x9ab2('0x6b')]=db['sequelize']['import']('../api/chatQueue/chatQueue.model');db['ChatGroup']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x6c'));db[_0x9ab2('0x6d')]=db['sequelize']['import'](_0x9ab2('0x6e'));db[_0x9ab2('0x6f')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x70'));db[_0x9ab2('0x71')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x72'));db[_0x9ab2('0x73')]=db['sequelize'][_0x9ab2('0x16')]('../api/cmHopperBlack/cmHopperBlack.model');db[_0x9ab2('0x74')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x75'));db['CmHopperHistory']=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0x9ab2('0x76')]=db['sequelize'][_0x9ab2('0x16')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x9ab2('0x77')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/cmCustomField/cmCustomField.model');db[_0x9ab2('0x78')]=db['sequelize'][_0x9ab2('0x16')]('../api/action/action.model');db['Automation']=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/automation/automation.model');db['CannedAnswer']=db['sequelize']['import']('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x79'));db['Condition']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x7a'));db[_0x9ab2('0x7b')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x7c'));db[_0x9ab2('0x7d')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x7e'));db[_0x9ab2('0x7f')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x80'));db['VoiceQueuesLog']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x81'));db[_0x9ab2('0x82')]=db['sequelize']['import'](_0x9ab2('0x83'));db[_0x9ab2('0x84')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x85'));db[_0x9ab2('0x86')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x87'));db['Template']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x88'));db['Trigger']=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x89'));db[_0x9ab2('0x8a')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x8b'));db[_0x9ab2('0x8c')]=db['sequelize'][_0x9ab2('0x16')]('../api/integration/integration.model');db[_0x9ab2('0x8d')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x8e'));db[_0x9ab2('0x8f')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x90'));db[_0x9ab2('0x91')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x92'));db[_0x9ab2('0x93')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0x94'));db['AnalyticMetric']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x95'));db[_0x9ab2('0x96')]=db['sequelize'][_0x9ab2('0x16')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x9ab2('0x97')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x98'));db['SalesforceAccount']=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x99'));db[_0x9ab2('0x9a')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x9b'));db[_0x9ab2('0x9c')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x9d'));db[_0x9ab2('0x9e')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0x9f'));db['SugarcrmConfiguration']=db['sequelize']['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x9ab2('0xa0')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/intSugarcrmField/intSugarcrmField.model');db[_0x9ab2('0xa1')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xa2'));db['DeskConfiguration']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xa3'));db['DeskField']=db[_0x9ab2('0x2')]['import'](_0x9ab2('0xa4'));db[_0x9ab2('0xa5')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xa6'));db['ZohoConfiguration']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xa7'));db[_0x9ab2('0xa8')]=db['sequelize'][_0x9ab2('0x16')]('../api/intZohoField/intZohoField.model');db[_0x9ab2('0xa9')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0xaa'));db[_0x9ab2('0xab')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0xac'));db[_0x9ab2('0xad')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0xae'));db[_0x9ab2('0xaf')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0xb0'));db[_0x9ab2('0xb1')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xb2'));db[_0x9ab2('0xb3')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0xb4'));db[_0x9ab2('0xb5')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xb6'));db[_0x9ab2('0xb7')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x9ab2('0xb8')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0xb9'));db[_0x9ab2('0xba')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xbb'));db[_0x9ab2('0xbc')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0xbd'));db[_0x9ab2('0xbe')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xbf'));db[_0x9ab2('0xc0')]=db['sequelize'][_0x9ab2('0x16')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x9ab2('0xc1')]=db[_0x9ab2('0x2')]['import']('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x9ab2('0xc2')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0xc3'));db[_0x9ab2('0xc4')]=db['sequelize']['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x9ab2('0xc5')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xc6'));db['FreshsalesField']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xc7'));db[_0x9ab2('0x8c')]=db['sequelize'][_0x9ab2('0x16')]('../api/integration/integration.model');db[_0x9ab2('0xc8')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/network/network.model');db['ChatQueueReport']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xc9'));db['ChatInternalMessage']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xca'));db[_0x9ab2('0xcb')]=db['sequelize'][_0x9ab2('0x16')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x9ab2('0xcc')]=db['sequelize']['import'](_0x9ab2('0xcd'));db[_0x9ab2('0xce')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xcf'));db['SmsQueueReport']=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0xd0'));db[_0x9ab2('0xd1')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xd2'));db[_0x9ab2('0xd3')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xd4'));db[_0x9ab2('0xd5')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xd6'));db[_0x9ab2('0xd7')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xd8'));db[_0x9ab2('0xd9')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xda'));db[_0x9ab2('0xdb')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0xdc'));db[_0x9ab2('0xdd')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xde'));db[_0x9ab2('0xdf')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xe0'));db[_0x9ab2('0xe1')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xe2'));db[_0x9ab2('0xe3')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xe4'));db['Campaign']=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/campaign/campaign.model');db['Migration']=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0xe5'));db['Attachment']=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/attachment/attachment.model');db[_0x9ab2('0xe6')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xe7'));db[_0x9ab2('0xe8')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xe9'));db['ChatTransferReport']=db['sequelize']['import'](_0x9ab2('0xea'));db[_0x9ab2('0xeb')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xec'));db[_0x9ab2('0xed')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xee'));db[_0x9ab2('0xef')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/smsTransferReport/smsTransferReport.model');db[_0x9ab2('0xf0')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xf1'));db['VoicePrefix']=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0xf2'));db[_0x9ab2('0xf3')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0xf4'));db[_0x9ab2('0xf5')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/userProfileSection/userProfileSection.model');db[_0x9ab2('0xf6')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0xf7'));db[_0x9ab2('0xf8')]=db[_0x9ab2('0x2')]['import'](_0x9ab2('0xf9'));db[_0x9ab2('0xfa')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xfb'));db['WhatsappApplication']=db[_0x9ab2('0x2')]['import'](_0x9ab2('0xfc'));db[_0x9ab2('0xfd')]=db['sequelize'][_0x9ab2('0x16')](_0x9ab2('0xfe'));db['WhatsappMessage']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0xff'));db[_0x9ab2('0x100')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x9ab2('0x101')]=db[_0x9ab2('0x2')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db['WhatsappQueue']=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x102'));db[_0x9ab2('0x103')]=db[_0x9ab2('0x2')][_0x9ab2('0x16')](_0x9ab2('0x104'));db['User'][_0x9ab2('0x105')](db['VoiceMail'],{'as':_0x9ab2('0x106'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x108')});db['User'][_0x9ab2('0x109')](db[_0x9ab2('0x1e')],{'as':'Recordings','foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x13')][_0x9ab2('0x109')](db[_0x9ab2('0x2e')],{'as':_0x9ab2('0x10a'),'foreignKey':'UserId'});db['User'][_0x9ab2('0x109')](db['VoiceExtension'],{'as':_0x9ab2('0x10b'),'onDelete':_0x9ab2('0x107'),'hooks':!![]});db[_0x9ab2('0x13')]['hasMany'](db[_0x9ab2('0x74')],{'as':_0x9ab2('0x10c'),'foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x13')]['hasMany'](db[_0x9ab2('0x10d')],{'as':_0x9ab2('0x10e'),'foreignKey':_0x9ab2('0x108')});db['User'][_0x9ab2('0x109')](db[_0x9ab2('0x76')],{'as':_0x9ab2('0x76'),'foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x13')]['hasMany'](db[_0x9ab2('0x5e')],{'as':_0x9ab2('0x10f'),'foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x13')][_0x9ab2('0x109')](db[_0x9ab2('0x68')],{'as':'ChatInteractions','foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x13')][_0x9ab2('0x109')](db[_0x9ab2('0x58')],{'as':'SmsInteractions','foreignKey':_0x9ab2('0x108')});db['User'][_0x9ab2('0x109')](db[_0x9ab2('0x110')],{'as':_0x9ab2('0x111'),'foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x13')]['hasMany'](db[_0x9ab2('0x45')],{'as':_0x9ab2('0x112'),'foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x13')]['hasMany'](db[_0x9ab2('0xfd')],{'as':_0x9ab2('0x113'),'foreignKey':_0x9ab2('0x108')});db['User'][_0x9ab2('0x109')](db[_0x9ab2('0xf8')],{'as':_0x9ab2('0x114'),'foreignKey':_0x9ab2('0x115')});db[_0x9ab2('0x13')]['belongsTo'](db[_0x9ab2('0xf3')],{'as':_0x9ab2('0xf3'),'foreignKey':_0x9ab2('0x116')});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0x118')],{'as':_0x9ab2('0x119'),'through':_0x9ab2('0x11a')});db['User'][_0x9ab2('0x117')](db[_0x9ab2('0x71')],{'as':_0x9ab2('0x11b'),'through':'cm_user_has_contacts'});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x11c'),'through':_0x9ab2('0x11d')});db['User'][_0x9ab2('0x117')](db[_0x9ab2('0xe1')],{'through':_0x9ab2('0x11e')});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0x45')],{'as':_0x9ab2('0x112'),'through':_0x9ab2('0x11f')});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0x68')],{'as':_0x9ab2('0x120'),'through':_0x9ab2('0x121')});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0x110')],{'as':'FaxInteractions','through':_0x9ab2('0x122')});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0x58')],{'as':_0x9ab2('0x123'),'through':'user_has_sms_interactions'});db[_0x9ab2('0x13')]['belongsToMany'](db[_0x9ab2('0x5e')],{'as':_0x9ab2('0x10f'),'through':'user_has_openchannel_interactions'});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0xfd')],{'as':_0x9ab2('0x113'),'through':_0x9ab2('0x124')});db[_0x9ab2('0x13')]['belongsToMany'](db['VoiceQueue'],{'as':_0x9ab2('0x125'),'through':'UserVoiceQueue','required':![]});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db['MailQueue'],{'as':_0x9ab2('0x126'),'through':_0x9ab2('0x33'),'required':![]});db['User'][_0x9ab2('0x117')](db[_0x9ab2('0x6b')],{'as':_0x9ab2('0x127'),'through':_0x9ab2('0x128'),'required':![],'hooks':!![]});db['User'][_0x9ab2('0x117')](db[_0x9ab2('0x52')],{'as':_0x9ab2('0x129'),'through':_0x9ab2('0x12a'),'required':![]});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0x12b')],{'as':'SmsQueues','through':_0x9ab2('0x35'),'required':![]});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0x12c')],{'as':_0x9ab2('0x12d'),'through':'UserOpenchannelQueue','required':![]});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0x12e')],{'as':_0x9ab2('0x12f'),'through':_0x9ab2('0x39'),'required':![]});db[_0x9ab2('0x13')]['belongsToMany'](db[_0x9ab2('0xf0')],{'through':_0x9ab2('0x11d')});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0x130')],{'as':_0x9ab2('0x131'),'through':_0x9ab2('0x132'),'required':![]});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db['ChatWebsite'],{'as':_0x9ab2('0x133'),'through':_0x9ab2('0x134')});db['User'][_0x9ab2('0x117')](db[_0x9ab2('0x135')],{'as':_0x9ab2('0x136'),'through':_0x9ab2('0x137')});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0x3f')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db['User'][_0x9ab2('0x117')](db[_0x9ab2('0x5b')],{'as':_0x9ab2('0x138'),'through':_0x9ab2('0x139')});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db['SmsAccount'],{'as':_0x9ab2('0x13a'),'through':_0x9ab2('0x13b')});db[_0x9ab2('0x13')]['belongsToMany'](db[_0x9ab2('0xfa')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0x9ab2('0x13')][_0x9ab2('0x117')](db[_0x9ab2('0xdb')],{'as':_0x9ab2('0x13c'),'through':_0x9ab2('0x13d')});db[_0x9ab2('0x15')][_0x9ab2('0x109')](db[_0x9ab2('0x13e')],{'as':_0x9ab2('0x13f'),'onDelete':_0x9ab2('0x107'),'foreignKey':'ChanSpyId'});db[_0x9ab2('0x18')][_0x9ab2('0x109')](db[_0x9ab2('0x13e')],{'onDelete':_0x9ab2('0x107')});db[_0x9ab2('0x13e')][_0x9ab2('0x109')](db['VoiceExtension'],{'as':_0x9ab2('0x140'),'onDelete':'cascade'});db[_0x9ab2('0x1a')][_0x9ab2('0x117')](db[_0x9ab2('0x84')],{'as':_0x9ab2('0x141'),'through':_0x9ab2('0x142')});db['VoiceQueue']['hasMany'](db[_0x9ab2('0x2e')],{'as':_0x9ab2('0x143'),'foreignKey':'VoiceQueueId'});db[_0x9ab2('0x1c')][_0x9ab2('0x109')](db[_0x9ab2('0x144')],{'as':_0x9ab2('0x145'),'foreignKey':'VoiceQueueId'});db[_0x9ab2('0x1c')]['hasMany'](db[_0x9ab2('0x74')],{'as':'HopperFinals','foreignKey':_0x9ab2('0x146')});db[_0x9ab2('0x1c')][_0x9ab2('0x109')](db[_0x9ab2('0x10d')],{'as':_0x9ab2('0x147'),'foreignKey':_0x9ab2('0x146')});db[_0x9ab2('0x1c')][_0x9ab2('0x109')](db[_0x9ab2('0x76')],{'as':_0x9ab2('0x76'),'foreignKey':'VoiceQueueId'});db[_0x9ab2('0x1c')]['hasMany'](db[_0x9ab2('0x73')],{'as':_0x9ab2('0x148'),'foreignKey':_0x9ab2('0x146')});db[_0x9ab2('0x1c')][_0x9ab2('0x109')](db['JscriptySessionReport'],{'as':_0x9ab2('0x149'),'foreignKey':_0x9ab2('0x146')});db[_0x9ab2('0x1c')][_0x9ab2('0x14a')](db[_0x9ab2('0x2b')],{'as':_0x9ab2('0x2b'),'foreignKey':'TrunkId'});db[_0x9ab2('0x1c')][_0x9ab2('0x14a')](db[_0x9ab2('0x2b')],{'as':_0x9ab2('0x14b'),'foreignKey':_0x9ab2('0x14c')});db['VoiceQueue']['belongsTo'](db[_0x9ab2('0x7b')],{'as':'Interval','foreignKey':_0x9ab2('0x14d')});db['VoiceQueue'][_0x9ab2('0x14a')](db[_0x9ab2('0x7d')],{'as':_0x9ab2('0x14e'),'foreignKey':_0x9ab2('0x14f')});db['VoiceQueue']['belongsToMany'](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x11c'),'through':_0x9ab2('0x150')});db[_0x9ab2('0x1c')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x151'),'through':_0x9ab2('0x30')});db[_0x9ab2('0x1c')][_0x9ab2('0x117')](db[_0x9ab2('0xe1')],{'as':'Teams','through':_0x9ab2('0x152')});db[_0x9ab2('0x1c')]['belongsToMany'](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x153'),'through':_0x9ab2('0x154')});db[_0x9ab2('0x1e')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x13'),'foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x20')][_0x9ab2('0x14a')](db['User'],{'as':_0x9ab2('0x13'),'foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x106')][_0x9ab2('0x109')](db[_0x9ab2('0x155')],{'as':_0x9ab2('0x156'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x157'),'sourceKey':_0x9ab2('0x158')});db['VoiceMailMessage'][_0x9ab2('0x14a')](db[_0x9ab2('0x106')],{'foreignKey':_0x9ab2('0x157'),'targetKey':_0x9ab2('0x158')});db['VoiceCallReport']['hasMany'](db[_0x9ab2('0x28')],{'as':_0x9ab2('0x159'),'foreignKey':_0x9ab2('0x15a'),'constraints':![]});db[_0x9ab2('0x24')][_0x9ab2('0x109')](db[_0x9ab2('0x15b')],{'as':_0x9ab2('0x15c'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x13'),'foreignKey':_0x9ab2('0x108')});db['VoiceCallReport'][_0x9ab2('0x14a')](db[_0x9ab2('0x71')],{'as':_0x9ab2('0x15d'),'foreignKey':'ContactId'});db['MailServerIn'][_0x9ab2('0x14a')](db[_0x9ab2('0x3f')],{'as':'MailAccount','foreignKey':_0x9ab2('0x15e')});db['MailServerOut'][_0x9ab2('0x14a')](db[_0x9ab2('0x3f')],{'as':_0x9ab2('0x3f'),'foreignKey':_0x9ab2('0x15e')});db['MailAccount'][_0x9ab2('0x105')](db[_0x9ab2('0x3b')],{'as':_0x9ab2('0x15f'),'onDelete':_0x9ab2('0x107')});db[_0x9ab2('0x3f')][_0x9ab2('0x105')](db['MailServerOut'],{'as':_0x9ab2('0x160'),'onDelete':_0x9ab2('0x107')});db[_0x9ab2('0x3f')]['hasMany'](db[_0x9ab2('0x161')],{'as':_0x9ab2('0x162'),'foreignKey':_0x9ab2('0x15e')});db[_0x9ab2('0x3f')][_0x9ab2('0x109')](db[_0x9ab2('0x163')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x9ab2('0x3f')]['hasMany'](db[_0x9ab2('0x47')],{'as':_0x9ab2('0x156'),'foreignKey':_0x9ab2('0x15e')});db[_0x9ab2('0x3f')][_0x9ab2('0x109')](db[_0x9ab2('0x45')],{'as':'Interactions'});db[_0x9ab2('0x3f')][_0x9ab2('0x109')](db[_0x9ab2('0x48')],{'as':_0x9ab2('0x140')});db[_0x9ab2('0x3f')][_0x9ab2('0x14a')](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x164'),'foreignKey':_0x9ab2('0x165')});db[_0x9ab2('0x3f')][_0x9ab2('0x14a')](db[_0x9ab2('0x166')],{'as':_0x9ab2('0x166'),'foreignKey':_0x9ab2('0x167')});db[_0x9ab2('0x3f')]['belongsTo'](db[_0x9ab2('0x7d')],{'as':_0x9ab2('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x9ab2('0x3f')]['belongsToMany'](db['User'],{'as':_0x9ab2('0x151'),'through':_0x9ab2('0x168')});db[_0x9ab2('0x41')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x151'),'through':'UserMailQueue'});db['MailQueue'][_0x9ab2('0x117')](db[_0x9ab2('0xe1')],{'through':_0x9ab2('0x169'),'as':_0x9ab2('0x16a')});db[_0x9ab2('0x45')][_0x9ab2('0x109')](db[_0x9ab2('0x47')],{'as':_0x9ab2('0x156'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x16b')});db[_0x9ab2('0x45')]['belongsTo'](db['MailAccount'],{'as':_0x9ab2('0x16c'),'foreignKey':_0x9ab2('0x15e')});db['MailInteraction'][_0x9ab2('0x14a')](db[_0x9ab2('0x71')],{'as':_0x9ab2('0x15d'),'foreignKey':_0x9ab2('0x16d')});db['MailInteraction'][_0x9ab2('0x14a')](db['User'],{'as':'Owner','foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x45')][_0x9ab2('0x117')](db['Tag'],{'through':_0x9ab2('0x16e'),'as':_0x9ab2('0x16f')});db['MailInteraction']['belongsToMany'](db['Tag'],{'through':_0x9ab2('0x16e'),'as':'ThroughTags'});db[_0x9ab2('0x45')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':'Users','through':_0x9ab2('0x11f'),'foreignKey':'MailInteractionId'});db[_0x9ab2('0x47')][_0x9ab2('0x109')](db[_0x9ab2('0x170')],{'as':_0x9ab2('0x171'),'onDelete':'cascade'});db[_0x9ab2('0x47')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'as':'User'});db[_0x9ab2('0x47')]['belongsTo'](db[_0x9ab2('0x71')],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x15d')});db[_0x9ab2('0x47')][_0x9ab2('0x14a')](db[_0x9ab2('0x45')],{'as':_0x9ab2('0x172'),'foreignKey':_0x9ab2('0x16b')});db['MailMessage'][_0x9ab2('0x14a')](db[_0x9ab2('0x3f')],{'as':_0x9ab2('0x16c'),'foreignKey':_0x9ab2('0x15e')});db[_0x9ab2('0x48')][_0x9ab2('0x14a')](db['User'],{'onDelete':'restrict'});db[_0x9ab2('0x48')]['belongsTo'](db['MailQueue'],{'onDelete':_0x9ab2('0x173')});db['MailApplication'][_0x9ab2('0x14a')](db[_0x9ab2('0x3f')],{'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x48')]['belongsTo'](db[_0x9ab2('0x7b')],{'onDelete':'restrict','foreignKey':_0x9ab2('0x14d')});db[_0x9ab2('0x48')][_0x9ab2('0x14a')](db['Tag'],{'onDelete':_0x9ab2('0x173'),'foreignKey':_0x9ab2('0x174')});db['MailQueueReport']['belongsTo'](db[_0x9ab2('0x3f')],{});db[_0x9ab2('0x175')]['belongsTo'](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x164'),'foreignKey':_0x9ab2('0x165')});db['MailQueueReport'][_0x9ab2('0x14a')](db['CmContact'],{'as':_0x9ab2('0x15d'),'foreignKey':_0x9ab2('0x16d')});db[_0x9ab2('0x175')][_0x9ab2('0x14a')](db[_0x9ab2('0x45')],{});db[_0x9ab2('0x175')]['belongsTo'](db[_0x9ab2('0x47')],{});db[_0x9ab2('0x175')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{});db[_0x9ab2('0x175')]['belongsTo'](db[_0x9ab2('0x41')],{});db[_0x9ab2('0x176')][_0x9ab2('0x109')](db[_0x9ab2('0x4c')],{'as':_0x9ab2('0x177'),'onDelete':'cascade'});db[_0x9ab2('0x135')][_0x9ab2('0x109')](db['Disposition'],{'as':_0x9ab2('0x162'),'foreignKey':_0x9ab2('0x178')});db[_0x9ab2('0x135')][_0x9ab2('0x109')](db[_0x9ab2('0x163')],{'as':_0x9ab2('0x179'),'foreignKey':'FaxAccountId'});db['FaxAccount'][_0x9ab2('0x109')](db[_0x9ab2('0x110')],{'as':_0x9ab2('0x17a')});db['FaxAccount'][_0x9ab2('0x109')](db['FaxApplication'],{'as':'Applications'});db[_0x9ab2('0x135')][_0x9ab2('0x109')](db['VoiceExtension'],{'as':_0x9ab2('0x17b'),'onDelete':'cascade'});db[_0x9ab2('0x135')]['hasMany'](db[_0x9ab2('0x17c')],{'as':_0x9ab2('0x156')});db[_0x9ab2('0x135')]['belongsTo'](db[_0x9ab2('0x2b')],{'as':_0x9ab2('0x2b')});db[_0x9ab2('0x135')][_0x9ab2('0x14a')](db['CmList'],{'as':'List','foreignKey':_0x9ab2('0x165')});db[_0x9ab2('0x135')]['belongsTo'](db[_0x9ab2('0x7d')],{'as':_0x9ab2('0x14e'),'foreignKey':_0x9ab2('0x14f')});db[_0x9ab2('0x135')][_0x9ab2('0x117')](db['User'],{'as':'Agents','through':'user_has_fax_accounts'});db['FaxApplication']['belongsTo'](db[_0x9ab2('0x13')],{'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x4f')]['belongsTo'](db[_0x9ab2('0x52')],{'onDelete':'restrict'});db['FaxApplication'][_0x9ab2('0x14a')](db['FaxAccount'],{'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x4f')][_0x9ab2('0x14a')](db[_0x9ab2('0x86')],{'onDelete':'restrict','foreignKey':_0x9ab2('0x174')});db['FaxInteraction'][_0x9ab2('0x109')](db['FaxMessage'],{'as':_0x9ab2('0x156'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x17d')});db[_0x9ab2('0x110')]['belongsTo'](db[_0x9ab2('0x135')],{'as':_0x9ab2('0x16c'),'foreignKey':_0x9ab2('0x178')});db[_0x9ab2('0x110')]['belongsTo'](db['CmContact'],{'as':_0x9ab2('0x15d'),'foreignKey':_0x9ab2('0x16d')});db[_0x9ab2('0x110')][_0x9ab2('0x14a')](db['User'],{'as':_0x9ab2('0x17e'),'foreignKey':'UserId'});db[_0x9ab2('0x110')][_0x9ab2('0x117')](db[_0x9ab2('0x86')],{'through':_0x9ab2('0x17f'),'as':_0x9ab2('0x16f')});db[_0x9ab2('0x110')][_0x9ab2('0x117')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x9ab2('0x180')});db[_0x9ab2('0x110')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':'Users','through':'user_has_fax_interactions','foreignKey':_0x9ab2('0x17d')});db['FaxMessage'][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x13')});db[_0x9ab2('0x17c')]['belongsTo'](db['FaxInteraction'],{'as':_0x9ab2('0x172'),'foreignKey':_0x9ab2('0x17d')});db[_0x9ab2('0x17c')][_0x9ab2('0x14a')](db[_0x9ab2('0x71')],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x15d')});db[_0x9ab2('0x17c')][_0x9ab2('0x14a')](db[_0x9ab2('0x170')],{'as':_0x9ab2('0x170'),'foreignKey':_0x9ab2('0x181')});db[_0x9ab2('0x17c')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':_0x9ab2('0x178')});db['FaxQueue'][_0x9ab2('0x117')](db['User'],{'as':_0x9ab2('0x151'),'through':'UserFaxQueue'});db[_0x9ab2('0x52')][_0x9ab2('0x117')](db[_0x9ab2('0xe1')],{'through':_0x9ab2('0x182'),'as':_0x9ab2('0x16a')});db[_0x9ab2('0x183')][_0x9ab2('0x14a')](db[_0x9ab2('0x135')],{});db[_0x9ab2('0x183')][_0x9ab2('0x14a')](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x164'),'foreignKey':_0x9ab2('0x165')});db[_0x9ab2('0x183')]['belongsTo'](db[_0x9ab2('0x71')],{'as':_0x9ab2('0x15d'),'foreignKey':'ContactId'});db[_0x9ab2('0x183')][_0x9ab2('0x14a')](db[_0x9ab2('0x110')],{});db['FaxQueueReport']['belongsTo'](db[_0x9ab2('0x17c')],{});db[_0x9ab2('0x183')][_0x9ab2('0x14a')](db['User'],{});db[_0x9ab2('0x183')]['belongsTo'](db[_0x9ab2('0x52')],{});db[_0x9ab2('0x55')]['hasMany'](db[_0x9ab2('0x161')],{'as':_0x9ab2('0x162'),'foreignKey':_0x9ab2('0x184')});db[_0x9ab2('0x55')][_0x9ab2('0x109')](db[_0x9ab2('0x163')],{'as':_0x9ab2('0x179'),'foreignKey':_0x9ab2('0x184')});db['SmsAccount'][_0x9ab2('0x109')](db[_0x9ab2('0x185')],{'as':_0x9ab2('0x156'),'foreignKey':_0x9ab2('0x184')});db[_0x9ab2('0x55')][_0x9ab2('0x109')](db[_0x9ab2('0x58')],{'as':_0x9ab2('0x17a')});db[_0x9ab2('0x55')]['hasMany'](db[_0x9ab2('0x56')],{'as':_0x9ab2('0x140')});db['SmsAccount'][_0x9ab2('0x14a')](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x164'),'foreignKey':_0x9ab2('0x165')});db[_0x9ab2('0x55')][_0x9ab2('0x14a')](db['Pause'],{'as':_0x9ab2('0x14e'),'foreignKey':_0x9ab2('0x14f')});db[_0x9ab2('0x55')][_0x9ab2('0x117')](db['User'],{'as':'Agents','through':_0x9ab2('0x13b')});db[_0x9ab2('0x56')]['belongsTo'](db[_0x9ab2('0x13')],{'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x56')][_0x9ab2('0x14a')](db[_0x9ab2('0x12b')],{'onDelete':_0x9ab2('0x173')});db['SmsApplication'][_0x9ab2('0x14a')](db[_0x9ab2('0x55')],{'onDelete':_0x9ab2('0x173')});db['SmsApplication'][_0x9ab2('0x14a')](db[_0x9ab2('0x7b')],{'onDelete':_0x9ab2('0x173'),'foreignKey':_0x9ab2('0x14d')});db[_0x9ab2('0x56')][_0x9ab2('0x14a')](db[_0x9ab2('0x86')],{'onDelete':_0x9ab2('0x173'),'foreignKey':_0x9ab2('0x174')});db[_0x9ab2('0x58')]['hasMany'](db[_0x9ab2('0x185')],{'as':_0x9ab2('0x156'),'onDelete':'cascade','foreignKey':_0x9ab2('0x186')});db['SmsInteraction']['belongsTo'](db['SmsAccount'],{'as':'Account','foreignKey':_0x9ab2('0x184')});db[_0x9ab2('0x58')][_0x9ab2('0x14a')](db['CmContact'],{'as':_0x9ab2('0x15d'),'foreignKey':_0x9ab2('0x16d')});db[_0x9ab2('0x58')]['belongsTo'](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x17e'),'foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x58')][_0x9ab2('0x117')](db['Tag'],{'through':_0x9ab2('0x187'),'as':_0x9ab2('0x16f')});db['SmsInteraction']['belongsToMany'](db[_0x9ab2('0x86')],{'through':_0x9ab2('0x187'),'as':_0x9ab2('0x180')});db[_0x9ab2('0x58')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x188'),'through':_0x9ab2('0x189'),'foreignKey':_0x9ab2('0x186')});db[_0x9ab2('0x185')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x13')});db[_0x9ab2('0x185')][_0x9ab2('0x14a')](db[_0x9ab2('0x71')],{'onDelete':'cascade','as':_0x9ab2('0x15d')});db[_0x9ab2('0x185')][_0x9ab2('0x14a')](db[_0x9ab2('0x58')],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x172'),'foreignKey':_0x9ab2('0x186')});db[_0x9ab2('0x185')][_0x9ab2('0x14a')](db[_0x9ab2('0x55')],{'as':_0x9ab2('0x16c'),'foreignKey':_0x9ab2('0x184')});db[_0x9ab2('0x12b')]['belongsToMany'](db[_0x9ab2('0x13')],{'as':'Agents','through':_0x9ab2('0x35'),'foreignKey':_0x9ab2('0x18a')});db[_0x9ab2('0x12b')]['belongsToMany'](db['Team'],{'through':_0x9ab2('0x18b'),'as':'Teams'});db[_0x9ab2('0x5b')][_0x9ab2('0x109')](db[_0x9ab2('0x161')],{'as':_0x9ab2('0x162'),'foreignKey':_0x9ab2('0x18c')});db[_0x9ab2('0x5b')][_0x9ab2('0x109')](db[_0x9ab2('0x163')],{'as':_0x9ab2('0x179'),'foreignKey':'OpenchannelAccountId'});db[_0x9ab2('0x5b')][_0x9ab2('0x109')](db['OpenchannelInteraction'],{'as':_0x9ab2('0x17a'),'foreignKey':'OpenchannelAccountId'});db[_0x9ab2('0x5b')][_0x9ab2('0x109')](db[_0x9ab2('0x60')],{'as':_0x9ab2('0x156'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount']['hasMany'](db[_0x9ab2('0x5c')],{'as':'Applications','foreignKey':_0x9ab2('0x18c')});db['OpenchannelAccount'][_0x9ab2('0x14a')](db[_0x9ab2('0xf0')],{'as':'List','foreignKey':_0x9ab2('0x165')});db[_0x9ab2('0x5b')]['belongsTo'](db[_0x9ab2('0x7d')],{'as':_0x9ab2('0x14e'),'foreignKey':_0x9ab2('0x14f')});db[_0x9ab2('0x5b')][_0x9ab2('0x117')](db['User'],{'as':'Agents','through':_0x9ab2('0x139')});db[_0x9ab2('0x5c')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'onDelete':'restrict'});db['OpenchannelApplication']['belongsTo'](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0x9ab2('0x5c')][_0x9ab2('0x14a')](db[_0x9ab2('0x5b')],{'onDelete':_0x9ab2('0x173'),'foreignKey':_0x9ab2('0x18c')});db[_0x9ab2('0x5c')]['belongsTo'](db[_0x9ab2('0x7b')],{'onDelete':_0x9ab2('0x173'),'foreignKey':_0x9ab2('0x14d')});db['OpenchannelApplication']['belongsTo'](db[_0x9ab2('0x86')],{'onDelete':_0x9ab2('0x173'),'foreignKey':_0x9ab2('0x174')});db[_0x9ab2('0x5e')][_0x9ab2('0x109')](db[_0x9ab2('0x60')],{'as':_0x9ab2('0x156'),'onDelete':'cascade','foreignKey':_0x9ab2('0x18d')});db['OpenchannelInteraction'][_0x9ab2('0x14a')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0x9ab2('0x18c')});db[_0x9ab2('0x5e')][_0x9ab2('0x14a')](db['CmContact'],{'as':'Contact','foreignKey':_0x9ab2('0x16d')});db[_0x9ab2('0x5e')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x17e'),'foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x5e')][_0x9ab2('0x117')](db[_0x9ab2('0x86')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0x9ab2('0x5e')][_0x9ab2('0x117')](db[_0x9ab2('0x86')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db[_0x9ab2('0x5e')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x188'),'through':_0x9ab2('0x18e'),'foreignKey':'OpenchannelInteractionId'});db[_0x9ab2('0x60')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x13')});db[_0x9ab2('0x60')][_0x9ab2('0x14a')](db[_0x9ab2('0x71')],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x15d')});db['OpenchannelMessage']['belongsTo'](db[_0x9ab2('0x5e')],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x172'),'foreignKey':'OpenchannelInteractionId'});db[_0x9ab2('0x60')][_0x9ab2('0x14a')](db['Attachment'],{'as':_0x9ab2('0x170'),'foreignKey':'AttachmentId'});db[_0x9ab2('0x60')][_0x9ab2('0x14a')](db[_0x9ab2('0x5b')],{'as':_0x9ab2('0x16c'),'foreignKey':'OpenchannelAccountId'});db[_0x9ab2('0x12c')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':'Agents','through':_0x9ab2('0x37'),'foreignKey':_0x9ab2('0x18f')});db[_0x9ab2('0x12c')][_0x9ab2('0x117')](db['Team'],{'through':_0x9ab2('0x190'),'as':_0x9ab2('0x16a')});db['ChatWebsite'][_0x9ab2('0x109')](db['Disposition'],{'as':_0x9ab2('0x162'),'foreignKey':_0x9ab2('0x191')});db[_0x9ab2('0x63')]['hasMany'](db[_0x9ab2('0x163')],{'as':_0x9ab2('0x179'),'foreignKey':'ChatWebsiteId'});db[_0x9ab2('0x63')][_0x9ab2('0x109')](db['ChatProactiveAction'],{'as':_0x9ab2('0x192')});db['ChatWebsite'][_0x9ab2('0x109')](db[_0x9ab2('0x68')],{'as':_0x9ab2('0x17a')});db[_0x9ab2('0x63')]['hasMany'](db[_0x9ab2('0x66')],{'as':_0x9ab2('0x140')});db['ChatWebsite'][_0x9ab2('0x109')](db[_0x9ab2('0x193')],{'as':_0x9ab2('0x156')});db[_0x9ab2('0x63')]['belongsTo'](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x164'),'foreignKey':_0x9ab2('0x165')});db['ChatWebsite'][_0x9ab2('0x14a')](db['Interval'],{'as':_0x9ab2('0x7b'),'foreignKey':'IntervalId'});db[_0x9ab2('0x63')][_0x9ab2('0x14a')](db['Pause'],{'as':_0x9ab2('0x14e'),'foreignKey':_0x9ab2('0x14f')});db[_0x9ab2('0x63')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x151'),'through':_0x9ab2('0x134')});db[_0x9ab2('0x194')][_0x9ab2('0x14a')](db['OpenchannelAccount'],{});db['OpenchannelQueueReport'][_0x9ab2('0x14a')](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x164'),'foreignKey':_0x9ab2('0x165')});db['OpenchannelQueueReport'][_0x9ab2('0x14a')](db[_0x9ab2('0x71')],{'as':_0x9ab2('0x15d'),'foreignKey':_0x9ab2('0x16d')});db[_0x9ab2('0x194')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x9ab2('0x194')]['belongsTo'](db[_0x9ab2('0x60')],{});db[_0x9ab2('0x194')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{});db['OpenchannelQueueReport'][_0x9ab2('0x14a')](db[_0x9ab2('0x12c')],{});db[_0x9ab2('0x66')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x195'),'foreignKey':_0x9ab2('0x108'),'onDelete':'restrict'});db[_0x9ab2('0x66')][_0x9ab2('0x14a')](db['ChatQueue'],{'as':'Queue','foreignKey':_0x9ab2('0x196'),'onDelete':_0x9ab2('0x173')});db['ChatApplication'][_0x9ab2('0x14a')](db[_0x9ab2('0x63')],{'as':_0x9ab2('0x197'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db['ChatApplication'][_0x9ab2('0x14a')](db[_0x9ab2('0x86')],{'onDelete':_0x9ab2('0x173'),'foreignKey':_0x9ab2('0x174')});db['ChatInteraction']['hasMany'](db[_0x9ab2('0x193')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x9ab2('0x198')});db[_0x9ab2('0x68')][_0x9ab2('0x14a')](db[_0x9ab2('0x63')],{'as':_0x9ab2('0x16c'),'foreignKey':_0x9ab2('0x191')});db['ChatInteraction']['belongsTo'](db[_0x9ab2('0x71')],{'as':_0x9ab2('0x15d'),'foreignKey':_0x9ab2('0x16d')});db[_0x9ab2('0x68')]['belongsTo'](db[_0x9ab2('0x13')],{'as':'Owner','foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x68')][_0x9ab2('0x117')](db['Tag'],{'through':_0x9ab2('0x199'),'as':_0x9ab2('0x16f')});db['ChatInteraction'][_0x9ab2('0x117')](db[_0x9ab2('0x86')],{'through':_0x9ab2('0x199'),'as':_0x9ab2('0x180')});db[_0x9ab2('0x68')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':'Users','through':_0x9ab2('0x121'),'foreignKey':_0x9ab2('0x198')});db['ChatMessage'][_0x9ab2('0x14a')](db['User'],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x13')});db[_0x9ab2('0x193')][_0x9ab2('0x14a')](db[_0x9ab2('0x71')],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x15d'),'foreignKey':'ContactId'});db['ChatMessage'][_0x9ab2('0x14a')](db['ChatInteraction'],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x172'),'foreignKey':_0x9ab2('0x198')});db[_0x9ab2('0x193')][_0x9ab2('0x14a')](db[_0x9ab2('0x170')],{'as':'Attachment','foreignKey':_0x9ab2('0x181')});db[_0x9ab2('0x193')]['belongsTo'](db['ChatWebsite'],{'as':_0x9ab2('0x16c'),'foreignKey':'ChatWebsiteId'});db[_0x9ab2('0x19a')][_0x9ab2('0x14a')](db['CmContact'],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x15d'),'foreignKey':_0x9ab2('0x16d')});db[_0x9ab2('0x19a')][_0x9ab2('0x14a')](db[_0x9ab2('0x63')],{'as':_0x9ab2('0x16c'),'foreignKey':_0x9ab2('0x191')});db[_0x9ab2('0x6b')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db[_0x9ab2('0x6b')]['belongsToMany'](db[_0x9ab2('0xe1')],{'through':'team_has_chat_queues','as':_0x9ab2('0x16a')});db[_0x9ab2('0x118')][_0x9ab2('0x109')](db[_0x9ab2('0x19b')],{'as':_0x9ab2('0x156'),'foreignKey':_0x9ab2('0x19c'),'onDelete':_0x9ab2('0x107')});db['ChatGroup'][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x143'),'through':_0x9ab2('0x11a')});db[_0x9ab2('0x6d')][_0x9ab2('0x14a')](db[_0x9ab2('0x63')],{'as':_0x9ab2('0x197'),'foreignKey':'ChatWebsiteId'});db['CmCompany'][_0x9ab2('0x109')](db[_0x9ab2('0x71')],{'as':'Contacts','foreignKey':_0x9ab2('0x19d')});db[_0x9ab2('0x71')][_0x9ab2('0x109')](db[_0x9ab2('0x144')],{'as':_0x9ab2('0x145'),'foreignKey':'ContactId'});db[_0x9ab2('0x71')][_0x9ab2('0x109')](db['CmHopperFinal'],{'as':_0x9ab2('0x10c'),'foreignKey':_0x9ab2('0x16d')});db['CmContact'][_0x9ab2('0x109')](db['CmHopperHistory'],{'as':_0x9ab2('0x147'),'foreignKey':'ContactId'});db[_0x9ab2('0x71')][_0x9ab2('0x109')](db['ReportAgentPreview'],{'as':_0x9ab2('0x76'),'foreignKey':_0x9ab2('0x16d')});db[_0x9ab2('0x71')][_0x9ab2('0x109')](db[_0x9ab2('0xce')],{'as':_0x9ab2('0x149'),'foreignKey':_0x9ab2('0x16d')});db[_0x9ab2('0x71')][_0x9ab2('0x109')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':_0x9ab2('0x16d'),'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x71')][_0x9ab2('0x109')](db[_0x9ab2('0x68')],{'as':_0x9ab2('0x120'),'foreignKey':'ContactId','onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x71')][_0x9ab2('0x109')](db[_0x9ab2('0x58')],{'as':_0x9ab2('0x123'),'foreignKey':_0x9ab2('0x16d'),'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x71')][_0x9ab2('0x109')](db[_0x9ab2('0x110')],{'as':_0x9ab2('0x111'),'foreignKey':_0x9ab2('0x16d'),'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x71')][_0x9ab2('0x109')](db[_0x9ab2('0x45')],{'as':_0x9ab2('0x112'),'foreignKey':_0x9ab2('0x16d'),'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x71')][_0x9ab2('0x14a')](db['CmCompany'],{'as':_0x9ab2('0x19e'),'foreignKey':_0x9ab2('0x19d')});db['CmContact'][_0x9ab2('0x14a')](db[_0x9ab2('0xf0')],{'as':'List','foreignKey':_0x9ab2('0x165'),'onDelete':_0x9ab2('0x107')});db[_0x9ab2('0x71')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x188'),'through':_0x9ab2('0x19f')});db[_0x9ab2('0x71')][_0x9ab2('0x117')](db['Tag'],{'as':_0x9ab2('0x16f'),'through':_0x9ab2('0x1a0')});db[_0x9ab2('0x71')][_0x9ab2('0x117')](db[_0x9ab2('0x86')],{'through':_0x9ab2('0x1a0'),'as':_0x9ab2('0x180')});db[_0x9ab2('0x144')][_0x9ab2('0x14a')](db[_0x9ab2('0x71')],{'as':_0x9ab2('0x15d'),'foreignKey':_0x9ab2('0x16d'),'onDelete':_0x9ab2('0x107')});db['CmHopper'][_0x9ab2('0x14a')](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x164'),'foreignKey':_0x9ab2('0x165'),'onDelete':'cascade'});db[_0x9ab2('0x144')][_0x9ab2('0x14a')](db['User'],{'as':'Agent','foreignKey':_0x9ab2('0x108')});db[_0x9ab2('0x144')][_0x9ab2('0x14a')](db[_0x9ab2('0x1c')],{'as':_0x9ab2('0x1a1'),'foreignKey':_0x9ab2('0x146'),'onDelete':'cascade'});db['CmHopper'][_0x9ab2('0x14a')](db[_0x9ab2('0x1a2')],{'as':_0x9ab2('0x1a2'),'foreignKey':_0x9ab2('0x1a3'),'onDelete':_0x9ab2('0x107')});db['CmHopper']['belongsTo'](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x17e'),'foreignKey':_0x9ab2('0x1a4')});db[_0x9ab2('0x73')][_0x9ab2('0x14a')](db['CmContact'],{'as':_0x9ab2('0x15d'),'foreignKey':'ContactId','onDelete':_0x9ab2('0x107')});db[_0x9ab2('0x73')][_0x9ab2('0x14a')](db['CmList'],{'as':_0x9ab2('0x164'),'foreignKey':_0x9ab2('0x165'),'onDelete':_0x9ab2('0x107')});db[_0x9ab2('0x73')][_0x9ab2('0x14a')](db[_0x9ab2('0x1c')],{'as':_0x9ab2('0x1a1'),'foreignKey':'VoiceQueueId','onDelete':_0x9ab2('0x107')});db['CmHopperBlack']['belongsTo'](db[_0x9ab2('0x1a2')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x9ab2('0x107')});db[_0x9ab2('0x1a5')][_0x9ab2('0x109')](db['Condition'],{'as':{'plural':_0x9ab2('0x1a6'),'singular':_0x9ab2('0x1a7')},'foreignKey':_0x9ab2('0x1a8'),'onDelete':_0x9ab2('0x107'),'hooks':!![]});db[_0x9ab2('0x1a5')][_0x9ab2('0x109')](db['Condition'],{'as':{'plural':'Any','singular':_0x9ab2('0x1a9')},'foreignKey':'AutomationAnyId','onDelete':_0x9ab2('0x107'),'hooks':!![]});db[_0x9ab2('0x1a5')][_0x9ab2('0x109')](db[_0x9ab2('0x78')],{'as':_0x9ab2('0x1aa'),'foreignKey':_0x9ab2('0x1ab'),'onDelete':_0x9ab2('0x107'),'hooks':!![]});db[_0x9ab2('0x7b')][_0x9ab2('0x109')](db[_0x9ab2('0x7b')],{'as':_0x9ab2('0x1ac'),'foreignKey':_0x9ab2('0x14d'),'onDelete':_0x9ab2('0x107'),'hooks':!![],'required':![]});db[_0x9ab2('0x7b')][_0x9ab2('0x109')](db[_0x9ab2('0x13e')],{'as':'Extensions','foreignKey':_0x9ab2('0x14d'),'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x7b')]['hasMany'](db['MailApplication'],{'as':_0x9ab2('0x1ad'),'foreignKey':_0x9ab2('0x14d')});db[_0x9ab2('0x7b')][_0x9ab2('0x109')](db[_0x9ab2('0x66')],{'as':_0x9ab2('0x1ae'),'foreignKey':_0x9ab2('0x14d')});db['Interval'][_0x9ab2('0x109')](db[_0x9ab2('0x4f')],{'as':_0x9ab2('0x1af'),'foreignKey':_0x9ab2('0x14d')});db['Interval'][_0x9ab2('0x109')](db[_0x9ab2('0x56')],{'as':_0x9ab2('0x1b0'),'foreignKey':_0x9ab2('0x14d')});db[_0x9ab2('0x82')][_0x9ab2('0x14a')](db[_0x9ab2('0x3f')],{});db['Schedule'][_0x9ab2('0x14a')](db[_0x9ab2('0x91')],{'foreignKey':_0x9ab2('0x1b1')});db[_0x9ab2('0x82')][_0x9ab2('0x14a')](db[_0x9ab2('0x8f')],{'foreignKey':'CustomReportId'});db[_0x9ab2('0x84')][_0x9ab2('0x117')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0x9ab2('0x142'),'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x86')]['belongsToMany'](db['CmContact'],{'through':_0x9ab2('0x1a0')});db[_0x9ab2('0x86')][_0x9ab2('0x117')](db[_0x9ab2('0x68')],{'through':_0x9ab2('0x199')});db['Tag'][_0x9ab2('0x117')](db['MailInteraction'],{'through':_0x9ab2('0x16e')});db['Tag'][_0x9ab2('0x117')](db[_0x9ab2('0x58')],{'through':_0x9ab2('0x187')});db[_0x9ab2('0x86')][_0x9ab2('0x117')](db[_0x9ab2('0x110')],{'through':_0x9ab2('0x17f')});db[_0x9ab2('0x86')][_0x9ab2('0x117')](db[_0x9ab2('0x5e')],{'through':'openchannel_interaction_has_tags'});db[_0x9ab2('0x86')]['belongsToMany'](db['WhatsappInteraction'],{'through':'whatsapp_interaction_has_tags'});db[_0x9ab2('0x1b2')][_0x9ab2('0x109')](db[_0x9ab2('0x1b3')],{'as':{'plural':_0x9ab2('0x1b4'),'singular':'AllCondition'},'foreignKey':_0x9ab2('0x1b5'),'onDelete':_0x9ab2('0x107'),'hooks':!![]});db[_0x9ab2('0x1b2')][_0x9ab2('0x109')](db['Condition'],{'as':{'plural':_0x9ab2('0x1b6'),'singular':_0x9ab2('0x1b7')},'foreignKey':_0x9ab2('0x1b8'),'onDelete':_0x9ab2('0x107'),'hooks':!![]});db[_0x9ab2('0x1b2')][_0x9ab2('0x109')](db['Action'],{'as':_0x9ab2('0x1aa'),'foreignKey':_0x9ab2('0x1b9'),'onDelete':_0x9ab2('0x107'),'hooks':!![]});db[_0x9ab2('0x8f')]['hasMany'](db[_0x9ab2('0x96')],{'as':'Fields','onDelete':_0x9ab2('0x107'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x9ab2('0x91')]['hasMany'](db['AnalyticFieldReport'],{'as':_0x9ab2('0x1ba'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1b1')});db[_0x9ab2('0x1bb')][_0x9ab2('0x109')](db[_0x9ab2('0x96')],{'as':_0x9ab2('0x1ba'),'onDelete':'cascade','foreignKey':_0x9ab2('0x1bc')});db[_0x9ab2('0x96')][_0x9ab2('0x14a')](db[_0x9ab2('0x1bb')],{'foreignKey':_0x9ab2('0x1bc')});db[_0x9ab2('0x1bd')][_0x9ab2('0x109')](db[_0x9ab2('0x9a')],{'as':_0x9ab2('0x1be'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x9ab2('0x9a')][_0x9ab2('0x109')](db[_0x9ab2('0x9c')],{'as':_0x9ab2('0x1bf'),'onDelete':_0x9ab2('0x107'),'foreignKey':'SubjectId'});db[_0x9ab2('0x9a')][_0x9ab2('0x109')](db[_0x9ab2('0x9c')],{'as':_0x9ab2('0x1c0'),'onDelete':_0x9ab2('0x107'),'foreignKey':'DescriptionId'});db[_0x9ab2('0x9a')][_0x9ab2('0x109')](db[_0x9ab2('0x9c')],{'as':_0x9ab2('0x1ba'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c1')});db['SalesforceConfiguration']['belongsTo'](db[_0x9ab2('0x1bd')],{'as':_0x9ab2('0x16c'),'foreignKey':_0x9ab2('0x1c2')});db[_0x9ab2('0x9c')][_0x9ab2('0x109')](db[_0x9ab2('0x9c')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x9ab2('0x9c')]['hasMany'](db[_0x9ab2('0x9c')],{'as':_0x9ab2('0x1c3'),'foreignKey':_0x9ab2('0x1c4')});db[_0x9ab2('0x9c')][_0x9ab2('0x109')](db['SalesforceField'],{'as':_0x9ab2('0x1c5'),'foreignKey':_0x9ab2('0x1c1')});db[_0x9ab2('0x9c')][_0x9ab2('0x14a')](db[_0x9ab2('0x8a')],{'as':_0x9ab2('0x8a'),'foreignKey':_0x9ab2('0x1c6')});db[_0x9ab2('0x9e')][_0x9ab2('0x109')](db[_0x9ab2('0x1c7')],{'as':'Configurations','onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c2')});db['SugarcrmConfiguration'][_0x9ab2('0x109')](db[_0x9ab2('0xa0')],{'as':_0x9ab2('0x1bf'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c8')});db[_0x9ab2('0x1c7')]['hasMany'](db[_0x9ab2('0xa0')],{'as':_0x9ab2('0x1c0'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c4')});db[_0x9ab2('0x1c7')][_0x9ab2('0x109')](db[_0x9ab2('0xa0')],{'as':_0x9ab2('0x1ba'),'onDelete':_0x9ab2('0x107'),'foreignKey':'FieldId'});db[_0x9ab2('0x1c7')][_0x9ab2('0x14a')](db[_0x9ab2('0x9e')],{'as':_0x9ab2('0x16c'),'foreignKey':_0x9ab2('0x1c2')});db['SugarcrmField'][_0x9ab2('0x109')](db['SugarcrmField'],{'as':_0x9ab2('0x1c9'),'foreignKey':'SubjectId'});db[_0x9ab2('0xa0')][_0x9ab2('0x109')](db['SugarcrmField'],{'as':_0x9ab2('0x1c3'),'foreignKey':_0x9ab2('0x1c4')});db[_0x9ab2('0xa0')][_0x9ab2('0x109')](db['SugarcrmField'],{'as':_0x9ab2('0x1c5'),'foreignKey':_0x9ab2('0x1c1')});db[_0x9ab2('0xa0')][_0x9ab2('0x14a')](db[_0x9ab2('0x8a')],{'as':_0x9ab2('0x8a'),'foreignKey':_0x9ab2('0x1c6')});db[_0x9ab2('0xa1')][_0x9ab2('0x109')](db[_0x9ab2('0x1ca')],{'as':_0x9ab2('0x1be'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c2')});db['DeskConfiguration'][_0x9ab2('0x109')](db['DeskField'],{'as':_0x9ab2('0x1bf'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c8')});db[_0x9ab2('0x1ca')][_0x9ab2('0x109')](db['DeskField'],{'as':_0x9ab2('0x1c0'),'onDelete':_0x9ab2('0x107'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0x9ab2('0x109')](db[_0x9ab2('0x1cb')],{'as':_0x9ab2('0x1ba'),'onDelete':'cascade','foreignKey':_0x9ab2('0x1c1')});db[_0x9ab2('0x1ca')]['belongsTo'](db[_0x9ab2('0xa1')],{'as':_0x9ab2('0x16c'),'foreignKey':_0x9ab2('0x1c2')});db[_0x9ab2('0x1ca')][_0x9ab2('0x117')](db[_0x9ab2('0x86')],{'through':'int_desk_configuration_has_tags'});db[_0x9ab2('0x1cb')][_0x9ab2('0x109')](db['DeskField'],{'as':_0x9ab2('0x1c9'),'foreignKey':'SubjectId'});db[_0x9ab2('0x1cb')][_0x9ab2('0x109')](db[_0x9ab2('0x1cb')],{'as':_0x9ab2('0x1c3'),'foreignKey':_0x9ab2('0x1c4')});db[_0x9ab2('0x1cb')][_0x9ab2('0x109')](db[_0x9ab2('0x1cb')],{'as':_0x9ab2('0x1c5'),'foreignKey':_0x9ab2('0x1c1')});db[_0x9ab2('0x1cb')][_0x9ab2('0x14a')](db[_0x9ab2('0x8a')],{'as':_0x9ab2('0x8a'),'foreignKey':_0x9ab2('0x1c6')});db['ZohoAccount']['hasMany'](db[_0x9ab2('0x1cc')],{'as':'Configurations','onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c2')});db[_0x9ab2('0x1cc')][_0x9ab2('0x109')](db[_0x9ab2('0xa8')],{'as':'Subjects','onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c8')});db[_0x9ab2('0x1cc')][_0x9ab2('0x109')](db[_0x9ab2('0xa8')],{'as':_0x9ab2('0x1c0'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c4')});db[_0x9ab2('0x1cc')][_0x9ab2('0x109')](db[_0x9ab2('0xa8')],{'as':'Fields','onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c1')});db[_0x9ab2('0x1cc')][_0x9ab2('0x14a')](db['ZohoAccount'],{'as':_0x9ab2('0x16c'),'foreignKey':'AccountId'});db[_0x9ab2('0xa8')]['hasMany'](db[_0x9ab2('0xa8')],{'as':_0x9ab2('0x1c9'),'foreignKey':'SubjectId'});db[_0x9ab2('0xa8')][_0x9ab2('0x109')](db[_0x9ab2('0xa8')],{'as':_0x9ab2('0x1c3'),'foreignKey':'DescriptionId'});db['ZohoField']['hasMany'](db[_0x9ab2('0xa8')],{'as':_0x9ab2('0x1c5'),'foreignKey':'FieldId'});db[_0x9ab2('0xa8')]['belongsTo'](db[_0x9ab2('0x8a')],{'as':'Variable','foreignKey':_0x9ab2('0x1c6')});db[_0x9ab2('0xa9')][_0x9ab2('0x109')](db[_0x9ab2('0xab')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x9ab2('0x1c2')});db['ZendeskConfiguration'][_0x9ab2('0x109')](db[_0x9ab2('0xad')],{'as':'Subjects','foreignKey':_0x9ab2('0x1c8')});db[_0x9ab2('0xab')][_0x9ab2('0x109')](db[_0x9ab2('0xad')],{'as':'Descriptions','foreignKey':_0x9ab2('0x1c4')});db['ZendeskConfiguration'][_0x9ab2('0x109')](db[_0x9ab2('0xad')],{'as':_0x9ab2('0x1ba'),'foreignKey':_0x9ab2('0x1c1')});db[_0x9ab2('0xab')][_0x9ab2('0x14a')](db[_0x9ab2('0xa9')],{'as':'Account','foreignKey':_0x9ab2('0x1c2')});db[_0x9ab2('0xab')][_0x9ab2('0x117')](db[_0x9ab2('0x86')],{'through':_0x9ab2('0x1cd')});db[_0x9ab2('0xad')]['hasMany'](db['ZendeskField'],{'as':_0x9ab2('0x1c9'),'foreignKey':_0x9ab2('0x1c8')});db[_0x9ab2('0xad')][_0x9ab2('0x109')](db[_0x9ab2('0xad')],{'as':_0x9ab2('0x1c3'),'foreignKey':'DescriptionId'});db[_0x9ab2('0xad')][_0x9ab2('0x109')](db['ZendeskField'],{'as':_0x9ab2('0x1c5'),'foreignKey':'FieldId'});db['ZendeskField'][_0x9ab2('0x14a')](db[_0x9ab2('0x8a')],{'as':_0x9ab2('0x8a'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x9ab2('0x109')](db[_0x9ab2('0xb1')],{'as':_0x9ab2('0x1be'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c2')});db['FreshdeskConfiguration'][_0x9ab2('0x109')](db[_0x9ab2('0xb3')],{'as':_0x9ab2('0x1bf'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x9ab2('0xb1')]['hasMany'](db[_0x9ab2('0xb3')],{'as':_0x9ab2('0x1c0'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c4')});db['FreshdeskConfiguration']['hasMany'](db[_0x9ab2('0xb3')],{'as':'Fields','onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c1')});db['FreshdeskConfiguration'][_0x9ab2('0x14a')](db[_0x9ab2('0xaf')],{'as':_0x9ab2('0x16c'),'foreignKey':'AccountId'});db['FreshdeskConfiguration']['belongsToMany'](db[_0x9ab2('0x86')],{'through':_0x9ab2('0x1ce')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0x9ab2('0x1c9'),'foreignKey':'SubjectId'});db[_0x9ab2('0xb3')][_0x9ab2('0x109')](db[_0x9ab2('0xb3')],{'as':'Description','foreignKey':_0x9ab2('0x1c4')});db['FreshdeskField'][_0x9ab2('0x109')](db[_0x9ab2('0xb3')],{'as':_0x9ab2('0x1c5'),'foreignKey':_0x9ab2('0x1c1')});db[_0x9ab2('0xb3')][_0x9ab2('0x14a')](db['Variable'],{'as':_0x9ab2('0x8a'),'foreignKey':_0x9ab2('0x1c6')});db[_0x9ab2('0xb5')][_0x9ab2('0x109')](db[_0x9ab2('0xb7')],{'as':_0x9ab2('0x1be'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c2')});db[_0x9ab2('0xb7')][_0x9ab2('0x109')](db['VtigerField'],{'as':_0x9ab2('0x1bf'),'foreignKey':'SubjectId'});db['VtigerConfiguration']['hasMany'](db['VtigerField'],{'as':_0x9ab2('0x1c0'),'foreignKey':_0x9ab2('0x1c4')});db[_0x9ab2('0xb7')][_0x9ab2('0x109')](db['VtigerField'],{'as':_0x9ab2('0x1ba'),'foreignKey':_0x9ab2('0x1c1')});db[_0x9ab2('0xb7')][_0x9ab2('0x14a')](db[_0x9ab2('0xb5')],{'as':_0x9ab2('0x16c'),'foreignKey':_0x9ab2('0x1c2')});db[_0x9ab2('0xb8')]['hasMany'](db[_0x9ab2('0xb8')],{'as':_0x9ab2('0x1c9'),'foreignKey':_0x9ab2('0x1c8')});db[_0x9ab2('0xb8')][_0x9ab2('0x109')](db['VtigerField'],{'as':_0x9ab2('0x1c3'),'foreignKey':_0x9ab2('0x1c4')});db[_0x9ab2('0xb8')][_0x9ab2('0x109')](db[_0x9ab2('0xb8')],{'as':_0x9ab2('0x1c5'),'foreignKey':_0x9ab2('0x1c1')});db[_0x9ab2('0xb8')]['belongsTo'](db[_0x9ab2('0x8a')],{'as':_0x9ab2('0x8a'),'foreignKey':_0x9ab2('0x1c6')});db[_0x9ab2('0xba')][_0x9ab2('0x109')](db[_0x9ab2('0xbc')],{'as':_0x9ab2('0x1be'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c2')});db[_0x9ab2('0xbc')][_0x9ab2('0x109')](db[_0x9ab2('0xbe')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x9ab2('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x9ab2('0x1c0'),'foreignKey':_0x9ab2('0x1c4')});db[_0x9ab2('0xbc')]['hasMany'](db['ServicenowField'],{'as':'Fields','foreignKey':_0x9ab2('0x1c1')});db[_0x9ab2('0xbc')][_0x9ab2('0x14a')](db[_0x9ab2('0xba')],{'as':'Account','foreignKey':_0x9ab2('0x1c2')});db['ServicenowField'][_0x9ab2('0x109')](db[_0x9ab2('0xbe')],{'as':'Subject','foreignKey':_0x9ab2('0x1c8')});db['ServicenowField'][_0x9ab2('0x109')](db[_0x9ab2('0xbe')],{'as':_0x9ab2('0x1c3'),'foreignKey':_0x9ab2('0x1c4')});db[_0x9ab2('0xbe')]['hasMany'](db[_0x9ab2('0xbe')],{'as':_0x9ab2('0x1c5'),'foreignKey':_0x9ab2('0x1c1')});db[_0x9ab2('0xbe')][_0x9ab2('0x14a')](db['Variable'],{'as':_0x9ab2('0x8a'),'foreignKey':_0x9ab2('0x1c6')});db[_0x9ab2('0xc0')][_0x9ab2('0x109')](db['Dynamics365Configuration'],{'as':'Configurations','onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c2')});db[_0x9ab2('0xc1')][_0x9ab2('0x109')](db[_0x9ab2('0xc2')],{'as':_0x9ab2('0x1bf'),'onDelete':_0x9ab2('0x107'),'foreignKey':'SubjectId'});db[_0x9ab2('0xc1')]['hasMany'](db[_0x9ab2('0xc2')],{'as':'Descriptions','onDelete':_0x9ab2('0x107'),'foreignKey':'DescriptionId'});db[_0x9ab2('0xc1')]['hasMany'](db['Dynamics365Field'],{'as':_0x9ab2('0x1ba'),'onDelete':_0x9ab2('0x107'),'foreignKey':'FieldId'});db[_0x9ab2('0xc1')]['belongsTo'](db[_0x9ab2('0xc0')],{'as':'Account','foreignKey':_0x9ab2('0x1c2')});db[_0x9ab2('0xc2')][_0x9ab2('0x109')](db['Dynamics365Field'],{'as':_0x9ab2('0x1c9'),'foreignKey':_0x9ab2('0x1c8')});db[_0x9ab2('0xc2')][_0x9ab2('0x109')](db['Dynamics365Field'],{'as':_0x9ab2('0x1c3'),'foreignKey':_0x9ab2('0x1c4')});db[_0x9ab2('0xc2')]['hasMany'](db[_0x9ab2('0xc2')],{'as':'Field','foreignKey':_0x9ab2('0x1c1')});db['Dynamics365Field']['belongsTo'](db[_0x9ab2('0x8a')],{'as':_0x9ab2('0x8a'),'foreignKey':_0x9ab2('0x1c6')});db[_0x9ab2('0xc4')][_0x9ab2('0x109')](db['FreshsalesConfiguration'],{'as':_0x9ab2('0x1be'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1c2')});db[_0x9ab2('0xc5')][_0x9ab2('0x109')](db[_0x9ab2('0x1cf')],{'as':_0x9ab2('0x1bf'),'foreignKey':_0x9ab2('0x1c8')});db['FreshsalesConfiguration'][_0x9ab2('0x109')](db['FreshsalesField'],{'as':_0x9ab2('0x1c0'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration']['hasMany'](db[_0x9ab2('0x1cf')],{'as':_0x9ab2('0x1ba'),'foreignKey':_0x9ab2('0x1c1')});db['FreshsalesConfiguration'][_0x9ab2('0x14a')](db[_0x9ab2('0xc4')],{'as':_0x9ab2('0x16c'),'foreignKey':'AccountId'});db['FreshsalesField']['hasMany'](db[_0x9ab2('0x1cf')],{'as':_0x9ab2('0x1c9'),'foreignKey':_0x9ab2('0x1c8')});db[_0x9ab2('0x1cf')][_0x9ab2('0x109')](db[_0x9ab2('0x1cf')],{'as':_0x9ab2('0x1c3'),'foreignKey':_0x9ab2('0x1c4')});db[_0x9ab2('0x1cf')]['hasMany'](db[_0x9ab2('0x1cf')],{'as':_0x9ab2('0x1c5'),'foreignKey':_0x9ab2('0x1c1')});db[_0x9ab2('0x1cf')][_0x9ab2('0x14a')](db[_0x9ab2('0x8a')],{'as':_0x9ab2('0x8a'),'foreignKey':_0x9ab2('0x1c6')});db[_0x9ab2('0x1d0')][_0x9ab2('0x14a')](db[_0x9ab2('0x63')],{});db[_0x9ab2('0x1d0')][_0x9ab2('0x14a')](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x164'),'foreignKey':_0x9ab2('0x165')});db[_0x9ab2('0x1d0')][_0x9ab2('0x14a')](db[_0x9ab2('0x71')],{'as':_0x9ab2('0x15d'),'foreignKey':'ContactId'});db[_0x9ab2('0x1d0')]['belongsTo'](db[_0x9ab2('0x68')],{});db[_0x9ab2('0x1d0')]['belongsTo'](db[_0x9ab2('0x193')],{});db['ChatQueueReport'][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{});db[_0x9ab2('0x1d0')][_0x9ab2('0x14a')](db[_0x9ab2('0x6b')],{});db[_0x9ab2('0x19b')]['belongsTo'](db[_0x9ab2('0x13')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x9ab2('0x19b')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'onDelete':'cascade','foreignKey':_0x9ab2('0x1d1')});db[_0x9ab2('0xce')]['hasMany'](db[_0x9ab2('0xcc')],{'foreignKey':_0x9ab2('0x1d2'),'onDelete':_0x9ab2('0x107')});db[_0x9ab2('0xce')][_0x9ab2('0x109')](db['JscriptyAnswerReport'],{'foreignKey':_0x9ab2('0x1d2'),'onDelete':_0x9ab2('0x107')});db[_0x9ab2('0x1d3')][_0x9ab2('0x14a')](db[_0x9ab2('0x55')],{});db['SmsQueueReport'][_0x9ab2('0x14a')](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x164'),'foreignKey':_0x9ab2('0x165')});db[_0x9ab2('0x1d3')][_0x9ab2('0x14a')](db[_0x9ab2('0x71')],{'as':_0x9ab2('0x15d'),'foreignKey':_0x9ab2('0x16d')});db[_0x9ab2('0x1d3')][_0x9ab2('0x14a')](db[_0x9ab2('0x58')],{});db[_0x9ab2('0x1d3')][_0x9ab2('0x14a')](db[_0x9ab2('0x185')],{});db[_0x9ab2('0x1d3')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{});db[_0x9ab2('0x1d3')][_0x9ab2('0x14a')](db[_0x9ab2('0x12b')],{});db[_0x9ab2('0xd5')][_0x9ab2('0x109')](db[_0x9ab2('0xce')],{'foreignKey':_0x9ab2('0x1d4')});db[_0x9ab2('0xd5')][_0x9ab2('0x109')](db[_0x9ab2('0xcc')],{'foreignKey':'ProjectId'});db[_0x9ab2('0xd5')]['hasMany'](db[_0x9ab2('0xcb')],{'foreignKey':'ProjectId'});db[_0x9ab2('0xdb')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x188'),'through':'user_has_square_projects'});db[_0x9ab2('0xe1')]['belongsToMany'](db[_0x9ab2('0x13')],{'as':'Agents','through':_0x9ab2('0x11e')});db['Team'][_0x9ab2('0x117')](db['VoiceQueue'],{'through':_0x9ab2('0x152'),'as':'VoiceQueues'});db[_0x9ab2('0xe1')]['belongsToMany'](db['MailQueue'],{'through':_0x9ab2('0x169'),'as':_0x9ab2('0x126')});db[_0x9ab2('0xe1')][_0x9ab2('0x117')](db['ChatQueue'],{'through':_0x9ab2('0x1d5'),'as':_0x9ab2('0x127')});db[_0x9ab2('0xe1')][_0x9ab2('0x117')](db[_0x9ab2('0x52')],{'through':_0x9ab2('0x182'),'as':_0x9ab2('0x129')});db[_0x9ab2('0xe1')][_0x9ab2('0x117')](db[_0x9ab2('0x12b')],{'through':'team_has_sms_queues','as':'SmsQueues'});db['Team']['belongsToMany'](db[_0x9ab2('0x12c')],{'through':_0x9ab2('0x190'),'as':_0x9ab2('0x12d')});db[_0x9ab2('0xe1')]['belongsToMany'](db[_0x9ab2('0x12e')],{'through':_0x9ab2('0x1d6'),'as':_0x9ab2('0x12f')});db[_0x9ab2('0x1a2')][_0x9ab2('0x109')](db[_0x9ab2('0x144')],{'as':'Hoppers','foreignKey':_0x9ab2('0x1a3')});db[_0x9ab2('0x1a2')][_0x9ab2('0x109')](db[_0x9ab2('0x74')],{'as':_0x9ab2('0x10c'),'foreignKey':_0x9ab2('0x1a3')});db['Campaign'][_0x9ab2('0x109')](db['CmHopperHistory'],{'as':_0x9ab2('0x147'),'foreignKey':_0x9ab2('0x1a3')});db[_0x9ab2('0x1a2')][_0x9ab2('0x109')](db[_0x9ab2('0x73')],{'as':'HopperBlacks','foreignKey':_0x9ab2('0x1a3')});db['Campaign'][_0x9ab2('0x14a')](db[_0x9ab2('0x2b')],{'as':_0x9ab2('0x2b'),'foreignKey':_0x9ab2('0x1d7')});db[_0x9ab2('0x1a2')][_0x9ab2('0x14a')](db['Trunk'],{'as':_0x9ab2('0x14b'),'foreignKey':_0x9ab2('0x14c')});db[_0x9ab2('0x1a2')][_0x9ab2('0x14a')](db[_0x9ab2('0x7b')],{'as':_0x9ab2('0x7b'),'foreignKey':'IntervalId'});db[_0x9ab2('0x1a2')][_0x9ab2('0x14a')](db[_0x9ab2('0xdb')],{'as':_0x9ab2('0xdb'),'foreignKey':'SquareProjectId'});db['Campaign']['belongsToMany'](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x11c'),'through':'campaigns_has_cm_lists'});db[_0x9ab2('0x1a2')][_0x9ab2('0x117')](db['CmList'],{'as':_0x9ab2('0x153'),'through':'campaigns_has_cm_blacklists'});db[_0x9ab2('0xe8')][_0x9ab2('0x14a')](db[_0x9ab2('0x47')],{});db['MailTransferReport'][_0x9ab2('0x14a')](db[_0x9ab2('0x45')],{});db['MailTransferReport'][_0x9ab2('0x14a')](db[_0x9ab2('0x3f')],{'foreignKey':_0x9ab2('0x1d8'),'as':_0x9ab2('0x1d9')});db[_0x9ab2('0xe8')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x9ab2('0xe8')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'foreignKey':_0x9ab2('0x1da'),'as':_0x9ab2('0x1db')});db[_0x9ab2('0xe8')][_0x9ab2('0x14a')](db[_0x9ab2('0x41')],{'foreignKey':_0x9ab2('0x1dc'),'as':_0x9ab2('0x1dd')});db[_0x9ab2('0xe8')][_0x9ab2('0x14a')](db[_0x9ab2('0x3f')],{'foreignKey':'ToMailAccountId','as':_0x9ab2('0x1de')});db[_0x9ab2('0x1df')][_0x9ab2('0x14a')](db[_0x9ab2('0x193')],{});db[_0x9ab2('0x1df')][_0x9ab2('0x14a')](db[_0x9ab2('0x68')],{});db[_0x9ab2('0x1df')][_0x9ab2('0x14a')](db[_0x9ab2('0x63')],{'foreignKey':_0x9ab2('0x1e0'),'as':'FromAccount'});db[_0x9ab2('0x1df')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'foreignKey':_0x9ab2('0x1e1'),'as':_0x9ab2('0x1e2')});db[_0x9ab2('0x1df')][_0x9ab2('0x14a')](db['User'],{'foreignKey':'ToUserId','as':_0x9ab2('0x1db')});db[_0x9ab2('0x1df')][_0x9ab2('0x14a')](db[_0x9ab2('0x6b')],{'foreignKey':_0x9ab2('0x1e3'),'as':_0x9ab2('0x1dd')});db[_0x9ab2('0x1df')]['belongsTo'](db[_0x9ab2('0x63')],{'foreignKey':_0x9ab2('0x1e4'),'as':_0x9ab2('0x1de')});db['FaxTransferReport'][_0x9ab2('0x14a')](db['FaxMessage'],{});db[_0x9ab2('0xeb')]['belongsTo'](db[_0x9ab2('0x110')],{});db['FaxTransferReport'][_0x9ab2('0x14a')](db[_0x9ab2('0x135')],{'foreignKey':_0x9ab2('0x1e5'),'as':'FromAccount'});db[_0x9ab2('0xeb')]['belongsTo'](db['User'],{'foreignKey':_0x9ab2('0x1e1'),'as':'FromAgent'});db['FaxTransferReport'][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'foreignKey':_0x9ab2('0x1da'),'as':_0x9ab2('0x1db')});db[_0x9ab2('0xeb')][_0x9ab2('0x14a')](db['FaxQueue'],{'foreignKey':_0x9ab2('0x1e6'),'as':_0x9ab2('0x1dd')});db[_0x9ab2('0xeb')][_0x9ab2('0x14a')](db['FaxAccount'],{'foreignKey':_0x9ab2('0x1e7'),'as':_0x9ab2('0x1de')});db[_0x9ab2('0xed')][_0x9ab2('0x14a')](db[_0x9ab2('0x60')],{});db[_0x9ab2('0xed')][_0x9ab2('0x14a')](db[_0x9ab2('0x5e')],{});db[_0x9ab2('0xed')]['belongsTo'](db[_0x9ab2('0x5b')],{'foreignKey':_0x9ab2('0x1e8'),'as':_0x9ab2('0x1d9')});db[_0x9ab2('0xed')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'foreignKey':_0x9ab2('0x1e1'),'as':_0x9ab2('0x1e2')});db['OpenchannelTransferReport']['belongsTo'](db[_0x9ab2('0x13')],{'foreignKey':_0x9ab2('0x1da'),'as':_0x9ab2('0x1db')});db[_0x9ab2('0xed')]['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0x9ab2('0x1e9'),'as':_0x9ab2('0x1dd')});db[_0x9ab2('0xed')][_0x9ab2('0x14a')](db['OpenchannelAccount'],{'foreignKey':_0x9ab2('0x1ea'),'as':'ToAccount'});db['SmsTransferReport']['belongsTo'](db[_0x9ab2('0x185')],{});db[_0x9ab2('0xef')][_0x9ab2('0x14a')](db[_0x9ab2('0x58')],{});db[_0x9ab2('0xef')][_0x9ab2('0x14a')](db[_0x9ab2('0x55')],{'foreignKey':_0x9ab2('0x1eb'),'as':_0x9ab2('0x1d9')});db['SmsTransferReport'][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'foreignKey':_0x9ab2('0x1e1'),'as':_0x9ab2('0x1e2')});db[_0x9ab2('0xef')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x9ab2('0xef')][_0x9ab2('0x14a')](db[_0x9ab2('0x12b')],{'foreignKey':_0x9ab2('0x1ec'),'as':'ToQueue'});db[_0x9ab2('0xef')][_0x9ab2('0x14a')](db[_0x9ab2('0x55')],{'foreignKey':_0x9ab2('0x1ed'),'as':_0x9ab2('0x1de')});db[_0x9ab2('0xf0')]['hasMany'](db[_0x9ab2('0x161')],{'as':_0x9ab2('0x162'),'foreignKey':'ListId'});db[_0x9ab2('0xf0')][_0x9ab2('0x109')](db[_0x9ab2('0x77')],{'as':_0x9ab2('0x1ee'),'foreignKey':_0x9ab2('0x165')});db[_0x9ab2('0xf0')][_0x9ab2('0x109')](db[_0x9ab2('0x71')],{'as':_0x9ab2('0x11b'),'onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x165')});db['CmList'][_0x9ab2('0x109')](db[_0x9ab2('0x74')],{'as':_0x9ab2('0x10c'),'foreignKey':_0x9ab2('0x165')});db['CmList']['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':'ListId'});db['CmList']['hasMany'](db[_0x9ab2('0x76')],{'as':_0x9ab2('0x76'),'foreignKey':'ListId'});db[_0x9ab2('0xf0')][_0x9ab2('0x117')](db['VoiceQueue'],{'as':'Queues','through':_0x9ab2('0x150')});db['CmList'][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x151'),'through':_0x9ab2('0x11d')});db[_0x9ab2('0x130')][_0x9ab2('0x109')](db['VoiceExtension'],{'as':_0x9ab2('0x10b'),'onDelete':_0x9ab2('0x107')});db[_0x9ab2('0x130')]['belongsToMany'](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x151'),'through':'user_has_voice_prefixes'});db[_0x9ab2('0xf3')][_0x9ab2('0x109')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x188'),'foreignKey':'userProfileId'});db[_0x9ab2('0xf3')][_0x9ab2('0x109')](db[_0x9ab2('0xf5')],{'as':_0x9ab2('0x1ef'),'foreignKey':_0x9ab2('0x116'),'onDelete':_0x9ab2('0x107')});db['UserProfileSection'][_0x9ab2('0x109')](db[_0x9ab2('0xf6')],{'as':'Resources','foreignKey':'sectionId','onDelete':_0x9ab2('0x107')});db[_0x9ab2('0xfa')][_0x9ab2('0x109')](db[_0x9ab2('0x161')],{'as':_0x9ab2('0x162'),'foreignKey':_0x9ab2('0x1f0')});db[_0x9ab2('0xfa')]['hasMany'](db[_0x9ab2('0x163')],{'as':_0x9ab2('0x179'),'foreignKey':_0x9ab2('0x1f0')});db['WhatsappAccount']['hasMany'](db[_0x9ab2('0x1f1')],{'as':_0x9ab2('0x156'),'foreignKey':'WhatsappAccountId'});db[_0x9ab2('0xfa')][_0x9ab2('0x109')](db['WhatsappInteraction'],{'as':'Interactions'});db[_0x9ab2('0xfa')][_0x9ab2('0x109')](db[_0x9ab2('0x1f2')],{'as':_0x9ab2('0x140')});db['WhatsappAccount'][_0x9ab2('0x14a')](db['CmList'],{'as':_0x9ab2('0x164'),'foreignKey':_0x9ab2('0x165')});db['WhatsappAccount'][_0x9ab2('0x14a')](db[_0x9ab2('0x7d')],{'as':_0x9ab2('0x14e'),'foreignKey':_0x9ab2('0x14f')});db[_0x9ab2('0xfa')]['belongsToMany'](db['User'],{'as':_0x9ab2('0x151'),'through':_0x9ab2('0x1f3')});db[_0x9ab2('0x1f2')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x1f2')]['belongsTo'](db[_0x9ab2('0x12e')],{'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x1f2')][_0x9ab2('0x14a')](db[_0x9ab2('0xfa')],{'onDelete':_0x9ab2('0x173')});db[_0x9ab2('0x1f2')][_0x9ab2('0x14a')](db['Interval'],{'onDelete':_0x9ab2('0x173'),'foreignKey':'IntervalId'});db['WhatsappApplication']['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':_0x9ab2('0x174')});db[_0x9ab2('0xfd')][_0x9ab2('0x109')](db[_0x9ab2('0x1f1')],{'as':'Messages','onDelete':_0x9ab2('0x107'),'foreignKey':_0x9ab2('0x1f4')});db[_0x9ab2('0xfd')][_0x9ab2('0x14a')](db[_0x9ab2('0xfa')],{'as':_0x9ab2('0x16c'),'foreignKey':_0x9ab2('0x1f0')});db[_0x9ab2('0xfd')]['belongsTo'](db[_0x9ab2('0x71')],{'as':_0x9ab2('0x15d'),'foreignKey':_0x9ab2('0x16d')});db[_0x9ab2('0xfd')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x17e'),'foreignKey':_0x9ab2('0x108')});db['WhatsappInteraction']['belongsToMany'](db['Tag'],{'through':_0x9ab2('0x1f5'),'as':_0x9ab2('0x16f')});db['WhatsappInteraction']['belongsToMany'](db[_0x9ab2('0x86')],{'through':_0x9ab2('0x1f5'),'as':_0x9ab2('0x180')});db[_0x9ab2('0xfd')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':'Users','through':_0x9ab2('0x124'),'foreignKey':_0x9ab2('0x1f4')});db[_0x9ab2('0x1f1')]['belongsTo'](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x13')});db['WhatsappMessage'][_0x9ab2('0x14a')](db[_0x9ab2('0x71')],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x15d')});db[_0x9ab2('0x1f1')][_0x9ab2('0x14a')](db[_0x9ab2('0xfd')],{'onDelete':_0x9ab2('0x107'),'as':_0x9ab2('0x172'),'foreignKey':_0x9ab2('0x1f4')});db[_0x9ab2('0x1f1')][_0x9ab2('0x14a')](db[_0x9ab2('0xfa')],{'as':'Account','foreignKey':_0x9ab2('0x1f0')});db[_0x9ab2('0x100')][_0x9ab2('0x14a')](db[_0x9ab2('0xfa')],{});db[_0x9ab2('0x100')][_0x9ab2('0x14a')](db[_0x9ab2('0xf0')],{'as':_0x9ab2('0x164'),'foreignKey':_0x9ab2('0x165')});db[_0x9ab2('0x100')][_0x9ab2('0x14a')](db['CmContact'],{'as':'Contact','foreignKey':_0x9ab2('0x16d')});db[_0x9ab2('0x100')][_0x9ab2('0x14a')](db[_0x9ab2('0xfd')],{});db[_0x9ab2('0x100')]['belongsTo'](db[_0x9ab2('0x12e')],{});db['WhatsappQueueReport'][_0x9ab2('0x14a')](db[_0x9ab2('0x1f1')],{});db[_0x9ab2('0x100')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{});db[_0x9ab2('0x101')][_0x9ab2('0x14a')](db[_0x9ab2('0x1f1')],{});db['WhatsappTransferReport'][_0x9ab2('0x14a')](db[_0x9ab2('0xfd')],{});db[_0x9ab2('0x101')][_0x9ab2('0x14a')](db[_0x9ab2('0xfa')],{'foreignKey':_0x9ab2('0x1f6'),'as':_0x9ab2('0x1d9')});db[_0x9ab2('0x101')]['belongsTo'](db[_0x9ab2('0xfa')],{'foreignKey':_0x9ab2('0x1f7'),'as':_0x9ab2('0x1de')});db[_0x9ab2('0x101')][_0x9ab2('0x14a')](db[_0x9ab2('0x12e')],{'foreignKey':_0x9ab2('0x1f8'),'as':_0x9ab2('0x1dd')});db[_0x9ab2('0x101')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'foreignKey':_0x9ab2('0x1e1'),'as':_0x9ab2('0x1e2')});db[_0x9ab2('0x101')][_0x9ab2('0x14a')](db[_0x9ab2('0x13')],{'foreignKey':_0x9ab2('0x1da'),'as':_0x9ab2('0x1db')});db[_0x9ab2('0x12e')][_0x9ab2('0x117')](db[_0x9ab2('0x13')],{'as':_0x9ab2('0x151'),'through':_0x9ab2('0x39'),'foreignKey':_0x9ab2('0x1f9')});db['WhatsappQueue'][_0x9ab2('0x117')](db[_0x9ab2('0xe1')],{'through':'team_has_whatsapp_queues','as':'Teams'});module[_0x9ab2('0x1fa')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index a8297f5..ab6a8ff 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d05=['./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','./api/squareMessage','./api/team','/api/license','./api/license','/api/migrations','./api/migration','/api/attachments','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/notifications','./api/notification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/rpc','/api/version','/api/pm2','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','1.0.16','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','util','./errors','./config/environment','api','./config/logger','auth','default','use','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','device','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailMessage','/api/mail/applications','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/configurations','/api/networks','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/square/odbc'];(function(_0x2eeac4,_0x4e019c){var _0x35d264=function(_0x5712d5){while(--_0x5712d5){_0x2eeac4['push'](_0x2eeac4['shift']());}};_0x35d264(++_0x4e019c);}(_0x9d05,0x16d));var _0x59d0=function(_0x2a10b9,_0x571545){_0x2a10b9=_0x2a10b9-0x0;var _0xe3feed=_0x9d05[_0x2a10b9];return _0xe3feed;};'use strict';var path=require(_0x59d0('0x0'));var express=require('express');var ewinston=require('express-winston');var util=require(_0x59d0('0x1'));var errors=require(_0x59d0('0x2'));var config=require(_0x59d0('0x3'));var logger=require('./config/logger')(_0x59d0('0x4'));var authLogger=require(_0x59d0('0x5'))(_0x59d0('0x6'));exports[_0x59d0('0x7')]=function(_0x401ba5){_0x401ba5[_0x59d0('0x8')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x241305,_0x2b500f){return util[_0x59d0('0x9')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0x241305[_0x59d0('0xa')],_0x241305[_0x59d0('0xb')][_0x59d0('0xc')]?_0x241305[_0x59d0('0xb')][_0x59d0('0xc')]:_0x241305[_0x59d0('0xd')][_0x59d0('0xe')]||_0x241305['ip'],_0x241305[_0x59d0('0xf')],_0x2b500f[_0x59d0('0x10')],_0x2b500f[_0x59d0('0x11')],_0x241305[_0x59d0('0x12')]?_0x241305['user']['id']:null,_0x241305[_0x59d0('0x12')]?_0x241305['user'][_0x59d0('0x13')]:null,_0x241305[_0x59d0('0x12')]?_0x241305[_0x59d0('0x12')]['role']:null);}}));_0x401ba5[_0x59d0('0x8')](ewinston[_0x59d0('0x14')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x486556,_0x3ecef6){var _0x4cb6bf=_0x59d0('0x15');if(_0x486556[_0x59d0('0x16')]&&_0x486556[_0x59d0('0x16')]['device']&&_0x486556[_0x59d0('0x16')][_0x59d0('0x17')]){_0x4cb6bf=_0x59d0('0x18');}return util['format'](_0x4cb6bf,_0x486556[_0x59d0('0xa')],_0x486556[_0x59d0('0xb')][_0x59d0('0xc')]?_0x486556[_0x59d0('0xb')][_0x59d0('0xc')]:_0x486556[_0x59d0('0xd')][_0x59d0('0xe')]||_0x486556['ip'],_0x486556[_0x59d0('0xf')],_0x3ecef6[_0x59d0('0x10')],_0x3ecef6['responseTime'],_0x486556[_0x59d0('0x12')]?_0x486556[_0x59d0('0x12')]['id']:null,_0x486556['user']?_0x486556[_0x59d0('0x12')][_0x59d0('0x13')]:null,_0x486556['user']?_0x486556[_0x59d0('0x12')]['role']:null,_0x486556[_0x59d0('0x16')]&&_0x486556[_0x59d0('0x16')][_0x59d0('0x19')]?_0x486556['body'][_0x59d0('0x19')]:_0x59d0('0x1a'),_0x486556[_0x59d0('0x16')]&&_0x486556['body']['agent_id']?_0x486556[_0x59d0('0x16')][_0x59d0('0x17')]:'',_0x486556[_0x59d0('0x16')]&&_0x486556[_0x59d0('0x16')][_0x59d0('0x1b')]?_0x486556[_0x59d0('0x16')][_0x59d0('0x1b')]:'');},'ignoreRoute':function(_0x40635c){var _0x50f0f0=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x50f0f0[_0x59d0('0x1c')](_0x40635c[_0x59d0('0xf')]);}}));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x1d'),require(_0x59d0('0x1e')));_0x401ba5['use'](_0x59d0('0x1f'),require(_0x59d0('0x20')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x21'),require(_0x59d0('0x22')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x23'),require(_0x59d0('0x24')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x25'),require(_0x59d0('0x26')));_0x401ba5[_0x59d0('0x8')]('/api/voice/queues',require(_0x59d0('0x27')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x28'),require(_0x59d0('0x29')));_0x401ba5['use'](_0x59d0('0x2a'),require(_0x59d0('0x2b')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x2c'),require(_0x59d0('0x2d')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x2e'),require('./api/voiceMailMessage'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x2f'),require(_0x59d0('0x30')));_0x401ba5[_0x59d0('0x8')]('/api/voice/dials/reports',require(_0x59d0('0x31')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x32'),require(_0x59d0('0x33')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x34'),require(_0x59d0('0x35')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x36'),require(_0x59d0('0x37')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x38'),require('./api/trunk'));_0x401ba5[_0x59d0('0x8')]('/api/voice/transfers/reports',require(_0x59d0('0x39')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x3a'),require(_0x59d0('0x3b')));_0x401ba5['use'](_0x59d0('0x3c'),require(_0x59d0('0x3d')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x3e'),require('./api/mailQueue'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x3f'),require(_0x59d0('0x40')));_0x401ba5['use'](_0x59d0('0x41'),require('./api/mailInteraction'));_0x401ba5[_0x59d0('0x8')]('/api/mail/messages',require(_0x59d0('0x42')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x43'),require('./api/mailApplication'));_0x401ba5[_0x59d0('0x8')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x44'),require(_0x59d0('0x45')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x46'),require(_0x59d0('0x47')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x48'),require(_0x59d0('0x49')));_0x401ba5['use'](_0x59d0('0x4a'),require(_0x59d0('0x4b')));_0x401ba5[_0x59d0('0x8')]('/api/fax/interactions',require(_0x59d0('0x4c')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x4d'),require(_0x59d0('0x4e')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x4f'),require(_0x59d0('0x50')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x51'),require('./api/faxQueueReport'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x52'),require('./api/smsAccount'));_0x401ba5['use']('/api/sms/applications',require(_0x59d0('0x53')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x54'),require(_0x59d0('0x55')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x56'),require(_0x59d0('0x57')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x58'),require('./api/smsQueue'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x59'),require(_0x59d0('0x5a')));_0x401ba5[_0x59d0('0x8')]('/api/openchannel/applications',require('./api/openchannelApplication'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x5b'),require(_0x59d0('0x5c')));_0x401ba5[_0x59d0('0x8')]('/api/openchannel/messages',require(_0x59d0('0x5d')));_0x401ba5[_0x59d0('0x8')]('/api/openchannel/queues',require(_0x59d0('0x5e')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x5f'),require(_0x59d0('0x60')));_0x401ba5['use'](_0x59d0('0x61'),require(_0x59d0('0x62')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x63'),require(_0x59d0('0x64')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x65'),require(_0x59d0('0x66')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x67'),require('./api/chatMessage'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x68'),require(_0x59d0('0x69')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x6a'),require(_0x59d0('0x6b')));_0x401ba5['use'](_0x59d0('0x6c'),require(_0x59d0('0x6d')));_0x401ba5[_0x59d0('0x8')]('/api/chat/proactive_actions',require(_0x59d0('0x6e')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x6f'),require(_0x59d0('0x70')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x71'),require(_0x59d0('0x72')));_0x401ba5[_0x59d0('0x8')]('/api/cm/hopper',require(_0x59d0('0x73')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x74'),require(_0x59d0('0x75')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x76'),require(_0x59d0('0x77')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x78'),require(_0x59d0('0x79')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x7a'),require(_0x59d0('0x7b')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x7c'),require(_0x59d0('0x7d')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x7e'),require(_0x59d0('0x7f')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x80'),require(_0x59d0('0x81')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x82'),require(_0x59d0('0x83')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x84'),require(_0x59d0('0x85')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x86'),require(_0x59d0('0x87')));_0x401ba5[_0x59d0('0x8')]('/api/pauses',require('./api/pause'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x88'),require(_0x59d0('0x89')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x8a'),require(_0x59d0('0x8b')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x8c'),require(_0x59d0('0x8d')));_0x401ba5[_0x59d0('0x8')]('/api/sounds',require(_0x59d0('0x8e')));_0x401ba5[_0x59d0('0x8')]('/api/tags',require('./api/tag'));_0x401ba5['use'](_0x59d0('0x8f'),require(_0x59d0('0x90')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x91'),require(_0x59d0('0x92')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x93'),require('./api/variable'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x94'),require(_0x59d0('0x95')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x96'),require(_0x59d0('0x97')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x98'),require(_0x59d0('0x99')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x9a'),require('./api/analyticDefaultReport'));_0x401ba5['use'](_0x59d0('0x9b'),require(_0x59d0('0x9c')));_0x401ba5[_0x59d0('0x8')]('/api/analytics/metrics',require(_0x59d0('0x9d')));_0x401ba5['use']('/api/analytics/field_reports',require(_0x59d0('0x9e')));_0x401ba5['use']('/api/analytics/tree_reports',require(_0x59d0('0x9f')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xa0'),require(_0x59d0('0xa1')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xa2'),require(_0x59d0('0xa3')));_0x401ba5[_0x59d0('0x8')]('/api/integrations/salesforce/fields',require(_0x59d0('0xa4')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xa5'),require('./api/intSugarcrmAccount'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xa6'),require(_0x59d0('0xa7')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xa8'),require(_0x59d0('0xa9')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xaa'),require(_0x59d0('0xab')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xac'),require(_0x59d0('0xad')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xae'),require(_0x59d0('0xaf')));_0x401ba5['use']('/api/integrations/zoho/accounts',require(_0x59d0('0xb0')));_0x401ba5['use'](_0x59d0('0xb1'),require(_0x59d0('0xb2')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xb3'),require(_0x59d0('0xb4')));_0x401ba5[_0x59d0('0x8')]('/api/integrations/zendesk/accounts',require('./api/intZendeskAccount'));_0x401ba5[_0x59d0('0x8')]('/api/integrations/zendesk/configurations',require(_0x59d0('0xb5')));_0x401ba5['use'](_0x59d0('0xb6'),require(_0x59d0('0xb7')));_0x401ba5['use'](_0x59d0('0xb8'),require(_0x59d0('0xb9')));_0x401ba5[_0x59d0('0x8')]('/api/integrations/freshdesk/configurations',require(_0x59d0('0xba')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xbb'),require('./api/intFreshdeskField'));_0x401ba5['use'](_0x59d0('0xbc'),require(_0x59d0('0xbd')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xbe'),require(_0x59d0('0xbf')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xc0'),require(_0x59d0('0xc1')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xc2'),require(_0x59d0('0xc3')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xc4'),require(_0x59d0('0xc5')));_0x401ba5[_0x59d0('0x8')]('/api/integrations/servicenow/fields',require(_0x59d0('0xc6')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xc7'),require(_0x59d0('0xc8')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xc9'),require(_0x59d0('0xca')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xcb'),require(_0x59d0('0xcc')));_0x401ba5['use']('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xcd'),require('./api/intFreshsalesConfiguration'));_0x401ba5[_0x59d0('0x8')]('/api/integrations/freshsales/fields',require('./api/intFreshsalesField'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xce'),require('./api/network'));_0x401ba5['use'](_0x59d0('0xcf'),require('./api/chatQueueReport'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xd0'),require(_0x59d0('0xd1')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xd2'),require(_0x59d0('0xd3')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xd4'),require(_0x59d0('0xd5')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xd6'),require(_0x59d0('0xd7')));_0x401ba5['use'](_0x59d0('0xd8'),require(_0x59d0('0xd9')));_0x401ba5[_0x59d0('0x8')]('/api/square/reports',require(_0x59d0('0xda')));_0x401ba5['use'](_0x59d0('0xdb'),require(_0x59d0('0xdc')));_0x401ba5['use']('/api/jscripty/projects',require(_0x59d0('0xdd')));_0x401ba5['use']('/api/settings',require('./api/setting'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xde'),require(_0x59d0('0xdf')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xe0'),require(_0x59d0('0xe1')));_0x401ba5['use']('/api/square/recordings',require(_0x59d0('0xe2')));_0x401ba5[_0x59d0('0x8')]('/api/square/messages',require(_0x59d0('0xe3')));_0x401ba5['use']('/api/teams',require(_0x59d0('0xe4')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xe5'),require(_0x59d0('0xe6')));_0x401ba5[_0x59d0('0x8')]('/api/campaigns',require('./api/campaign'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xe7'),require(_0x59d0('0xe8')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xe9'),require('./api/attachment'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xea'),require(_0x59d0('0xeb')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xec'),require(_0x59d0('0xed')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xee'),require(_0x59d0('0xef')));_0x401ba5['use'](_0x59d0('0xf0'),require(_0x59d0('0xf1')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xf2'),require(_0x59d0('0xf3')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xf4'),require(_0x59d0('0xf5')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xf6'),require(_0x59d0('0xf7')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xf8'),require(_0x59d0('0xf9')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xfa'),require(_0x59d0('0xfb')));_0x401ba5['use'](_0x59d0('0xfc'),require('./api/userProfileSection'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xfd'),require(_0x59d0('0xfe')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0xff'),require(_0x59d0('0x100')));_0x401ba5['use']('/api/whatsapp/accounts',require(_0x59d0('0x101')));_0x401ba5['use'](_0x59d0('0x102'),require(_0x59d0('0x103')));_0x401ba5['use'](_0x59d0('0x104'),require('./api/whatsappInteraction'));_0x401ba5['use'](_0x59d0('0x105'),require('./api/whatsappMessage'));_0x401ba5['use'](_0x59d0('0x106'),require(_0x59d0('0x107')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x108'),require('./api/whatsappTransferReport'));_0x401ba5[_0x59d0('0x8')]('/api/whatsapp/queues',require(_0x59d0('0x109')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x10a'),require(_0x59d0('0x10b')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x10c'),require(_0x59d0('0x10d')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x10e'),require(_0x59d0('0x10f')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x110'),require('./api/jira'));_0x401ba5[_0x59d0('0x8')]('/api/rpc',require(_0x59d0('0x111')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x112'),require('./api/version'));_0x401ba5[_0x59d0('0x8')]('/api/system',require('./api/system'));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x113'),require('./api/pm2'));_0x401ba5[_0x59d0('0x8')]('/api/webbar',require(_0x59d0('0x114')));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x115'),express[_0x59d0('0x116')](path[_0x59d0('0x117')](config[_0x59d0('0x118')],_0x59d0('0x115'))));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x119'),express[_0x59d0('0x116')](path[_0x59d0('0x117')](config[_0x59d0('0x118')],_0x59d0('0x119'))));_0x401ba5[_0x59d0('0x8')]('/demo',express[_0x59d0('0x116')](path[_0x59d0('0x117')](config[_0x59d0('0x118')],_0x59d0('0x11a'))));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x11b'),express['static'](path['join'](config[_0x59d0('0x118')],_0x59d0('0x11c'),_0x59d0('0x11d'))));_0x401ba5[_0x59d0('0x8')](_0x59d0('0x11e'),express[_0x59d0('0x116')](path[_0x59d0('0x117')](config[_0x59d0('0x118')],'/server/files/plugins')));_0x401ba5[_0x59d0('0x11f')](_0x59d0('0x120'))['get'](errors[0x194]);_0x401ba5['route']('/*')[_0x59d0('0x121')](function(_0x490431,_0x1aa6ed){_0x1aa6ed[_0x59d0('0x122')](path[_0x59d0('0x123')](_0x401ba5[_0x59d0('0x121')](_0x59d0('0x124'))+_0x59d0('0x125')));});}; \ No newline at end of file +var _0xa522=['/api/tags','./api/tag','./api/template','/api/triggers','./api/variable','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/fields','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','./api/campaign','./api/migration','/api/attachments','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','./api/whatsappTransferReport','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/webbar','/apidoc','join','root','static','/www','/demo','/snippet','snippet','1.0.16','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','express','./errors','./config/environment','./config/logger','api','auth','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','connection','remoteAddress','url','statusCode','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','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)','x-forwarded-for','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/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/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/substatuses','/api/mail/interactions','./api/mailMessage','./api/mailApplication','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/schedules','./api/schedule','./api/sound'];(function(_0x59342a,_0x16827b){var _0x17abc9=function(_0x2f7bfc){while(--_0x2f7bfc){_0x59342a['push'](_0x59342a['shift']());}};_0x17abc9(++_0x16827b);}(_0xa522,0x1b2));var _0x2a52=function(_0x5eaa0b,_0x433b2f){_0x5eaa0b=_0x5eaa0b-0x0;var _0x28b295=_0xa522[_0x5eaa0b];return _0x28b295;};'use strict';var path=require('path');var express=require(_0x2a52('0x0'));var ewinston=require('express-winston');var util=require('util');var errors=require(_0x2a52('0x1'));var config=require(_0x2a52('0x2'));var logger=require(_0x2a52('0x3'))(_0x2a52('0x4'));var authLogger=require(_0x2a52('0x3'))(_0x2a52('0x5'));exports[_0x2a52('0x6')]=function(_0x22795f){_0x22795f[_0x2a52('0x7')](ewinston[_0x2a52('0x8')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x5c98df,_0x471bed){return util[_0x2a52('0x9')](_0x2a52('0xa'),_0x5c98df[_0x2a52('0xb')],_0x5c98df[_0x2a52('0xc')]['x-forwarded-for']?_0x5c98df[_0x2a52('0xc')]['x-forwarded-for']:_0x5c98df[_0x2a52('0xd')][_0x2a52('0xe')]||_0x5c98df['ip'],_0x5c98df[_0x2a52('0xf')],_0x471bed[_0x2a52('0x10')],_0x471bed['responseTime'],_0x5c98df['user']?_0x5c98df[_0x2a52('0x11')]['id']:null,_0x5c98df['user']?_0x5c98df[_0x2a52('0x11')][_0x2a52('0x12')]:null,_0x5c98df['user']?_0x5c98df[_0x2a52('0x11')][_0x2a52('0x13')]:null);}}));_0x22795f[_0x2a52('0x7')](ewinston[_0x2a52('0x8')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x52945d,_0x5a6464){var _0x325b56=_0x2a52('0x14');if(_0x52945d[_0x2a52('0x15')]&&_0x52945d['body'][_0x2a52('0x16')]&&_0x52945d[_0x2a52('0x15')][_0x2a52('0x17')]){_0x325b56=_0x2a52('0x18');}return util[_0x2a52('0x9')](_0x325b56,_0x52945d['method'],_0x52945d[_0x2a52('0xc')]['x-forwarded-for']?_0x52945d['headers'][_0x2a52('0x19')]:_0x52945d[_0x2a52('0xd')][_0x2a52('0xe')]||_0x52945d['ip'],_0x52945d[_0x2a52('0xf')],_0x5a6464['statusCode'],_0x5a6464['responseTime'],_0x52945d['user']?_0x52945d[_0x2a52('0x11')]['id']:null,_0x52945d[_0x2a52('0x11')]?_0x52945d['user'][_0x2a52('0x12')]:null,_0x52945d[_0x2a52('0x11')]?_0x52945d[_0x2a52('0x11')][_0x2a52('0x13')]:null,_0x52945d[_0x2a52('0x15')]&&_0x52945d['body'][_0x2a52('0x16')]?_0x52945d[_0x2a52('0x15')][_0x2a52('0x16')]:'other',_0x52945d[_0x2a52('0x15')]&&_0x52945d[_0x2a52('0x15')][_0x2a52('0x17')]?_0x52945d['body']['agent_id']:'',_0x52945d['body']&&_0x52945d[_0x2a52('0x15')]['agent_name']?_0x52945d['body'][_0x2a52('0x1a')]:'');},'ignoreRoute':function(_0x43a3d8){var _0x24aed6=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x24aed6[_0x2a52('0x1b')](_0x43a3d8[_0x2a52('0xf')]);}}));_0x22795f[_0x2a52('0x7')](_0x2a52('0x1c'),require(_0x2a52('0x1d')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x1e'),require('./api/voiceChanSpy'));_0x22795f[_0x2a52('0x7')]('/api/voice/contexts',require(_0x2a52('0x1f')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x20'),require(_0x2a52('0x21')));_0x22795f[_0x2a52('0x7')]('/api/voice/mohs',require(_0x2a52('0x22')));_0x22795f['use'](_0x2a52('0x23'),require(_0x2a52('0x24')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x25'),require(_0x2a52('0x26')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x27'),require(_0x2a52('0x28')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x29'),require(_0x2a52('0x2a')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x2b'),require('./api/voiceMailMessage'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x2c'),require('./api/voiceCallReport'));_0x22795f[_0x2a52('0x7')]('/api/voice/dials/reports',require(_0x2a52('0x2d')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x2e'),require(_0x2a52('0x2f')));_0x22795f['use'](_0x2a52('0x30'),require(_0x2a52('0x31')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x32'),require(_0x2a52('0x33')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x34'),require(_0x2a52('0x35')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x36'),require(_0x2a52('0x37')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x38'),require(_0x2a52('0x39')));_0x22795f['use'](_0x2a52('0x3a'),require(_0x2a52('0x3b')));_0x22795f['use']('/api/mail/queues',require('./api/mailQueue'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x3c'),require('./api/mailSubstatus'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x3d'),require('./api/mailInteraction'));_0x22795f['use']('/api/mail/messages',require(_0x2a52('0x3e')));_0x22795f[_0x2a52('0x7')]('/api/mail/applications',require(_0x2a52('0x3f')));_0x22795f['use']('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x40'),require(_0x2a52('0x41')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x42'),require('./api/dashboardItem'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x43'),require(_0x2a52('0x44')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x45'),require(_0x2a52('0x46')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x47'),require(_0x2a52('0x48')));_0x22795f[_0x2a52('0x7')]('/api/fax/messages',require('./api/faxMessage'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x49'),require(_0x2a52('0x4a')));_0x22795f['use'](_0x2a52('0x4b'),require('./api/faxQueueReport'));_0x22795f['use'](_0x2a52('0x4c'),require(_0x2a52('0x4d')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x4e'),require(_0x2a52('0x4f')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x50'),require('./api/smsInteraction'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x51'),require('./api/smsMessage'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x52'),require('./api/smsQueue'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x53'),require(_0x2a52('0x54')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x55'),require(_0x2a52('0x56')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x57'),require(_0x2a52('0x58')));_0x22795f[_0x2a52('0x7')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x22795f['use']('/api/openchannel/queues',require(_0x2a52('0x59')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x5a'),require(_0x2a52('0x5b')));_0x22795f['use'](_0x2a52('0x5c'),require('./api/openchannelQueueReport'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x5d'),require(_0x2a52('0x5e')));_0x22795f['use']('/api/chat/interactions',require(_0x2a52('0x5f')));_0x22795f[_0x2a52('0x7')]('/api/chat/messages',require('./api/chatMessage'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x60'),require(_0x2a52('0x61')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x62'),require(_0x2a52('0x63')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x64'),require(_0x2a52('0x65')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x66'),require(_0x2a52('0x67')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x68'),require(_0x2a52('0x69')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x6a'),require(_0x2a52('0x6b')));_0x22795f[_0x2a52('0x7')]('/api/cm/hopper',require(_0x2a52('0x6c')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x6d'),require(_0x2a52('0x6e')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x6f'),require(_0x2a52('0x70')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x71'),require('./api/cmHopperHistory'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x72'),require(_0x2a52('0x73')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x74'),require(_0x2a52('0x75')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x76'),require(_0x2a52('0x77')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x78'),require(_0x2a52('0x79')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x7a'),require(_0x2a52('0x7b')));_0x22795f[_0x2a52('0x7')]('/api/conditions',require('./api/condition'));_0x22795f['use'](_0x2a52('0x7c'),require('./api/interval'));_0x22795f['use'](_0x2a52('0x7d'),require(_0x2a52('0x7e')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x7f'),require(_0x2a52('0x80')));_0x22795f[_0x2a52('0x7')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x81'),require(_0x2a52('0x82')));_0x22795f['use']('/api/sounds',require(_0x2a52('0x83')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x84'),require(_0x2a52('0x85')));_0x22795f[_0x2a52('0x7')]('/api/templates',require(_0x2a52('0x86')));_0x22795f['use'](_0x2a52('0x87'),require('./api/trigger'));_0x22795f[_0x2a52('0x7')]('/api/variables',require(_0x2a52('0x88')));_0x22795f[_0x2a52('0x7')]('/api/integrations',require(_0x2a52('0x89')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x8a'),require('./api/integrationReport'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x8b'),require(_0x2a52('0x8c')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x8d'),require(_0x2a52('0x8e')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x8f'),require(_0x2a52('0x90')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x91'),require(_0x2a52('0x92')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x93'),require(_0x2a52('0x94')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x95'),require(_0x2a52('0x96')));_0x22795f[_0x2a52('0x7')]('/api/integrations/salesforce/accounts',require(_0x2a52('0x97')));_0x22795f[_0x2a52('0x7')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x98'),require('./api/intSalesforceField'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x99'),require(_0x2a52('0x9a')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x9b'),require(_0x2a52('0x9c')));_0x22795f[_0x2a52('0x7')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x9d'),require(_0x2a52('0x9e')));_0x22795f['use'](_0x2a52('0x9f'),require(_0x2a52('0xa0')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xa1'),require(_0x2a52('0xa2')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xa3'),require(_0x2a52('0xa4')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xa5'),require('./api/intZohoConfiguration'));_0x22795f[_0x2a52('0x7')]('/api/integrations/zoho/fields',require(_0x2a52('0xa6')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xa7'),require(_0x2a52('0xa8')));_0x22795f[_0x2a52('0x7')]('/api/integrations/zendesk/configurations',require(_0x2a52('0xa9')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xaa'),require(_0x2a52('0xab')));_0x22795f['use'](_0x2a52('0xac'),require(_0x2a52('0xad')));_0x22795f['use'](_0x2a52('0xae'),require(_0x2a52('0xaf')));_0x22795f[_0x2a52('0x7')]('/api/integrations/freshdesk/fields',require('./api/intFreshdeskField'));_0x22795f[_0x2a52('0x7')](_0x2a52('0xb0'),require(_0x2a52('0xb1')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xb2'),require(_0x2a52('0xb3')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xb4'),require(_0x2a52('0xb5')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xb6'),require(_0x2a52('0xb7')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xb8'),require(_0x2a52('0xb9')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xba'),require(_0x2a52('0xbb')));_0x22795f['use'](_0x2a52('0xbc'),require('./api/intDynamics365Account'));_0x22795f['use']('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x22795f[_0x2a52('0x7')](_0x2a52('0xbd'),require('./api/intDynamics365Field'));_0x22795f[_0x2a52('0x7')]('/api/integrations/freshsales/accounts',require('./api/intFreshsalesAccount'));_0x22795f[_0x2a52('0x7')](_0x2a52('0xbe'),require(_0x2a52('0xbf')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xc0'),require(_0x2a52('0xc1')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xc2'),require(_0x2a52('0xc3')));_0x22795f['use'](_0x2a52('0xc4'),require(_0x2a52('0xc5')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xc6'),require(_0x2a52('0xc7')));_0x22795f['use']('/api/jscripty/answers/reports',require(_0x2a52('0xc8')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xc9'),require(_0x2a52('0xca')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xcb'),require(_0x2a52('0xcc')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xcd'),require(_0x2a52('0xce')));_0x22795f[_0x2a52('0x7')]('/api/square/reports',require(_0x2a52('0xcf')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xd0'),require(_0x2a52('0xd1')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xd2'),require(_0x2a52('0xd3')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xd4'),require(_0x2a52('0xd5')));_0x22795f['use'](_0x2a52('0xd6'),require(_0x2a52('0xd7')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xd8'),require('./api/squareProject'));_0x22795f['use'](_0x2a52('0xd9'),require('./api/squareRecording'));_0x22795f[_0x2a52('0x7')](_0x2a52('0xda'),require('./api/squareMessage'));_0x22795f[_0x2a52('0x7')](_0x2a52('0xdb'),require(_0x2a52('0xdc')));_0x22795f['use'](_0x2a52('0xdd'),require(_0x2a52('0xde')));_0x22795f['use']('/api/campaigns',require(_0x2a52('0xdf')));_0x22795f[_0x2a52('0x7')]('/api/migrations',require(_0x2a52('0xe0')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xe1'),require('./api/attachment'));_0x22795f[_0x2a52('0x7')](_0x2a52('0xe2'),require(_0x2a52('0xe3')));_0x22795f[_0x2a52('0x7')]('/api/mail/reports/transfer',require(_0x2a52('0xe4')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xe5'),require(_0x2a52('0xe6')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xe7'),require('./api/faxTransferReport'));_0x22795f[_0x2a52('0x7')](_0x2a52('0xe8'),require(_0x2a52('0xe9')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xea'),require('./api/smsTransferReport'));_0x22795f[_0x2a52('0x7')](_0x2a52('0xeb'),require(_0x2a52('0xec')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xed'),require(_0x2a52('0xee')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xef'),require(_0x2a52('0xf0')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xf1'),require(_0x2a52('0xf2')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xf3'),require('./api/userProfileResource'));_0x22795f['use']('/api/notifications',require('./api/notification'));_0x22795f[_0x2a52('0x7')](_0x2a52('0xf4'),require(_0x2a52('0xf5')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xf6'),require(_0x2a52('0xf7')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xf8'),require(_0x2a52('0xf9')));_0x22795f['use'](_0x2a52('0xfa'),require('./api/whatsappMessage'));_0x22795f[_0x2a52('0x7')](_0x2a52('0xfb'),require('./api/whatsappQueueReport'));_0x22795f[_0x2a52('0x7')]('/api/whatsapp/reports/transfer',require(_0x2a52('0xfc')));_0x22795f[_0x2a52('0x7')](_0x2a52('0xfd'),require('./api/whatsappQueue'));_0x22795f[_0x2a52('0x7')](_0x2a52('0xfe'),require(_0x2a52('0xff')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x100'),require(_0x2a52('0x101')));_0x22795f['use'](_0x2a52('0x102'),require(_0x2a52('0x103')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x104'),require(_0x2a52('0x105')));_0x22795f['use'](_0x2a52('0x106'),require('./api/rpc'));_0x22795f[_0x2a52('0x7')](_0x2a52('0x107'),require(_0x2a52('0x108')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x109'),require(_0x2a52('0x10a')));_0x22795f[_0x2a52('0x7')](_0x2a52('0x10b'),require('./api/pm2'));_0x22795f[_0x2a52('0x7')]('/api/webbar',require(_0x2a52('0x10c')));_0x22795f['use'](_0x2a52('0x10d'),express['static'](path[_0x2a52('0x10e')](config[_0x2a52('0x10f')],_0x2a52('0x10d'))));_0x22795f[_0x2a52('0x7')]('/www',express[_0x2a52('0x110')](path[_0x2a52('0x10e')](config['root'],_0x2a52('0x111'))));_0x22795f[_0x2a52('0x7')](_0x2a52('0x112'),express[_0x2a52('0x110')](path[_0x2a52('0x10e')](config[_0x2a52('0x10f')],_0x2a52('0x112'))));_0x22795f[_0x2a52('0x7')](_0x2a52('0x113'),express['static'](path['join'](config[_0x2a52('0x10f')],_0x2a52('0x114'),_0x2a52('0x115'))));_0x22795f[_0x2a52('0x7')]('/plugins',express[_0x2a52('0x110')](path['join'](config[_0x2a52('0x10f')],'/server/files/plugins')));_0x22795f[_0x2a52('0x116')](_0x2a52('0x117'))['get'](errors[0x194]);_0x22795f[_0x2a52('0x116')]('/*')[_0x2a52('0x118')](function(_0x4c9c62,_0x376afc){_0x376afc[_0x2a52('0x119')](path[_0x2a52('0x11a')](_0x22795f['get']('appPath')+'/index.html'));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 45da600..066c9ef 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa38b=['../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/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/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc'];(function(_0x405a1f,_0x446aa3){var _0x4fd010=function(_0xc2ed83){while(--_0xc2ed83){_0x405a1f['push'](_0x405a1f['shift']());}};_0x4fd010(++_0x446aa3);}(_0xa38b,0x87));var _0xba38=function(_0xead539,_0x55e078){_0xead539=_0xead539-0x0;var _0x26c05e=_0xa38b[_0xead539];return _0x26c05e;};'use strict';var jayson=require(_0xba38('0x0'));var BPromise=require('bluebird');var _=require(_0xba38('0x1'));var config=require(_0xba38('0x2'));exports[_0xba38('0x3')]=function(){return new BPromise(function(_0x230085,_0x59db8e){var _0xf38113={};_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x5')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x6')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x7')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x8')));_0xf38113=_['merge'](_0xf38113,require('../api/voiceCallReport/voiceCallReport.rpc'));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x9')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0xa')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0xb')));_0xf38113=_['merge'](_0xf38113,require('../api/memberReport/memberReport.rpc'));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0xc')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0xd')));_0xf38113=_['merge'](_0xf38113,require(_0xba38('0xe')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0xf')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require('../api/mailAccount/mailAccount.rpc'));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x10')));_0xf38113=_['merge'](_0xf38113,require(_0xba38('0x11')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x12')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x13')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x14')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x15')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x16')));_0xf38113=_['merge'](_0xf38113,require(_0xba38('0x17')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x18')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x19')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require('../api/faxQueueReport/faxQueueReport.rpc'));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x1a')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x1b')));_0xf38113=_['merge'](_0xf38113,require(_0xba38('0x1c')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x1d')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x1e')));_0xf38113=_['merge'](_0xf38113,require(_0xba38('0x1f')));_0xf38113=_['merge'](_0xf38113,require(_0xba38('0x20')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x21')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x22')));_0xf38113=_['merge'](_0xf38113,require('../api/chatInteraction/chatInteraction.rpc'));_0xf38113=_['merge'](_0xf38113,require(_0xba38('0x23')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x24')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x25')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x26')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x27')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x28')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x29')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x2a')));_0xf38113=_['merge'](_0xf38113,require(_0xba38('0x2b')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x2c')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require('../api/template/template.rpc'));_0xf38113=_['merge'](_0xf38113,require(_0xba38('0x2d')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require('../api/variable/variable.rpc'));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x2e')));_0xf38113=_['merge'](_0xf38113,require(_0xba38('0x2f')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x30')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x31')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x32')));_0xf38113=_['merge'](_0xf38113,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x33')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x34')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x35')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x36')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require('../api/chatQueueReport/chatQueueReport.rpc'));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x37')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x38')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x39')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x3a')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require('../api/squareProject/squareProject.rpc'));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x3b')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x3c')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x3d')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require('../api/attachment/attachment.rpc'));_0xf38113=_[_0xba38('0x4')](_0xf38113,require('../api/plugin/plugin.rpc'));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x3e')));_0xf38113=_['merge'](_0xf38113,require(_0xba38('0x3f')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x40')));_0xf38113=_[_0xba38('0x4')](_0xf38113,require(_0xba38('0x41')));_0xf38113=_['merge'](_0xf38113,require(_0xba38('0x42')));var _0x9cde7c=jayson[_0xba38('0x43')](_0xf38113)['http']();var _0x124d5a=config[_0xba38('0x44')]['port']||config[_0xba38('0x45')]+0x1;var _0x1d5b95=config[_0xba38('0x44')]['ip']||_0xba38('0x46');_0x9cde7c['on'](_0xba38('0x47'),function(_0x38d1ca){return _0x59db8e(_0x38d1ca);});_0x9cde7c[_0xba38('0x3')](_0x124d5a,_0x1d5b95,function(){console[_0xba38('0x48')](_0xba38('0x49'),_0x1d5b95,_0x124d5a);require(_0xba38('0x4a'))[_0xba38('0x4b')]();return _0x230085(_0xba38('0x4c')+_0x1d5b95+':'+_0x124d5a);});});}; \ No newline at end of file +var _0xa208=['../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.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/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.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/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash'];(function(_0x3e53c1,_0x364531){var _0x21d60a=function(_0x3b4b72){while(--_0x3b4b72){_0x3e53c1['push'](_0x3e53c1['shift']());}};_0x21d60a(++_0x364531);}(_0xa208,0x1ee));var _0x8a20=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa208[_0x3054be];return _0x3df150;};'use strict';var jayson=require(_0x8a20('0x0'));var BPromise=require(_0x8a20('0x1'));var _=require(_0x8a20('0x2'));var config=require(_0x8a20('0x3'));exports[_0x8a20('0x4')]=function(){return new BPromise(function(_0x2b264c,_0x161261){var _0x4aa6c1={};_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x6')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x7')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x8')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require('../api/voiceRecording/voiceRecording.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x9')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0xa')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0xb')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require('../api/memberReport/memberReport.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0xc')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0xd')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0xe')));_0x4aa6c1=_['merge'](_0x4aa6c1,require('../api/mailServerIn/mailServerIn.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0xf')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x10')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x11')));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x12')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x13')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x14')));_0x4aa6c1=_['merge'](_0x4aa6c1,require('../api/faxAccount/faxAccount.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x15')));_0x4aa6c1=_['merge'](_0x4aa6c1,require('../api/faxInteraction/faxInteraction.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require('../api/faxMessage/faxMessage.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x16')));_0x4aa6c1=_['merge'](_0x4aa6c1,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x17')));_0x4aa6c1=_['merge'](_0x4aa6c1,require('../api/smsInteraction/smsInteraction.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x18')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x19')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x1a')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x1b')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x1c')));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x1d')));_0x4aa6c1=_['merge'](_0x4aa6c1,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require('../api/chatInteraction/chatInteraction.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x1e')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x1f')));_0x4aa6c1=_['merge'](_0x4aa6c1,require('../api/cmContact/cmContact.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x20')));_0x4aa6c1=_['merge'](_0x4aa6c1,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x21')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x22')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x23')));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x24')));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x25')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require('../api/sound/sound.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require('../api/template/template.rpc'));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x26')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x27')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x28')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x29')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x2a')));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x2b')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x2c')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x2d')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x2e')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x2f')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x30')));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x31')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x32')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x33')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x34')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x35')));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x36')));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x37')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x38')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x39')));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x3a')));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x3b')));_0x4aa6c1=_['merge'](_0x4aa6c1,require(_0x8a20('0x3c')));_0x4aa6c1=_[_0x8a20('0x5')](_0x4aa6c1,require(_0x8a20('0x3d')));var _0x23582e=jayson['server'](_0x4aa6c1)[_0x8a20('0x3e')]();var _0x149f7b=config[_0x8a20('0x3f')][_0x8a20('0x40')]||config[_0x8a20('0x40')]+0x1;var _0x284185=config['rpc']['ip']||_0x8a20('0x41');_0x23582e['on']('error',function(_0x321454){return _0x161261(_0x321454);});_0x23582e[_0x8a20('0x4')](_0x149f7b,_0x284185,function(){console[_0x8a20('0x42')](_0x8a20('0x43'),_0x284185,_0x149f7b);require(_0x8a20('0x44'))[_0x8a20('0x45')]();return _0x2b264c(_0x8a20('0x46')+_0x284185+':'+_0x149f7b);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index c1bb051..9b16653 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 _0x70e0=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./error','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','substr','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','command','sync','answer','getData','sendRequest'];(function(_0x473d0a,_0x28af2f){var _0xe7cfa4=function(_0x5f528e){while(--_0x5f528e){_0x473d0a['push'](_0x473d0a['shift']());}};_0xe7cfa4(++_0x28af2f);}(_0x70e0,0x17b));var _0x070e=function(_0x26ee6d,_0x5c11f8){_0x26ee6d=_0x26ee6d-0x0;var _0x3a185a=_0x70e0[_0x26ee6d];return _0x3a185a;};'use strict';var util=require(_0x070e('0x0'));var _=require(_0x070e('0x1'));var EventEmitter=require(_0x070e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x070e('0x3'));function AGIChannel(_0xee173){var _0x277d32=this,_0x2593e5=new AGIReply(),_0x5c90fc=![],_0x7bce9b={};EventEmitter['call'](_0x277d32);_0xee173[_0x070e('0x4')]('utf8');_0xee173['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2593e5['setEncoding'](_0x070e('0x5'));_0x2593e5['on'](_0x070e('0x6'),function(_0x604664){for(var _0x2611e6 in _0x604664){_0x277d32[_0x2611e6]=_0x604664[_0x2611e6];}_0x277d32[_0x070e('0x7')](_0x070e('0x8'));});_0x2593e5['on'](_0x070e('0x9'),function(_0x4e99e6){if(_0x4e99e6['toLowerCase']()==_0x070e('0xa')){_0x277d32[_0x070e('0x7')](_0x070e('0xa'));return;}if(_0x4e99e6[_0x070e('0xb')](0x0,0xb)==_0x070e('0xc')){_0x5c90fc=!![];}if(_0x5c90fc){_0x7bce9b['rx']+=_0x4e99e6+'\x0a';if(_0x4e99e6[_0x070e('0xd')](_0x070e('0xe'))!=-0x1){_0x5c90fc=![];}}else{_0x7bce9b['rx']=_0x4e99e6;}if(_0x5c90fc){return;}if(typeof _0x7bce9b['cb']==_0x070e('0xf')){var _0x39d2b9=_0x7bce9b['rx']['substring'](0x0,0x3),_0x5bf079=null,_0x2930b8=null;_0x39d2b9=parseInt(_0x39d2b9);if(isNaN(_0x39d2b9)){_0x7bce9b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x39d2b9!=0xc8){_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':-0x1,'extra':'KO'});return;}_0x5bf079=_0x7bce9b['rx'][_0x070e('0xb')](0x4)['replace']('result=','');if(_0x5bf079['indexOf']('\x20')!=-0x1){_0x5bf079=_0x5bf079[_0x070e('0x10')](0x0,_0x5bf079[_0x070e('0x11')]('\x20'));}if(_['startsWith'](_0x5bf079,'-1')){_0x5bf079=parseInt(_0x5bf079);}_0x2930b8=_0x7bce9b['rx']['split']('\x20');if(_0x2930b8[_0x070e('0x12')]==0x3){_0x2930b8=_0x2930b8[0x2][_0x070e('0xb')](0x1,_0x2930b8[0x2][_0x070e('0x12')]-0x1);}else if(_0x2930b8[_0x070e('0x12')]>0x3){var _0x5bc71e=/\((.+)\)/;var _0x49861b=_0x7bce9b['rx'][_0x070e('0x13')](_0x5bc71e);if(_0x49861b){_0x2930b8=_0x49861b[0x1];}else{_0x2930b8=null;}}else{_0x2930b8=null;}_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':_0x5bf079,'extra':_0x2930b8});}});_0xee173['on'](_0x070e('0x14'),function(_0x38f6e6){_0x277d32[_0x070e('0x7')](_0x070e('0x14'),new AGIError('E_AGI_SOCKET_ERROR',_0x38f6e6[_0x070e('0x15')]));});_0xee173['on'](_0x070e('0x16'),function(){_0x277d32[_0x070e('0x7')](_0x070e('0x16'),new AGIError(_0x070e('0x17')));});_0xee173['on']('timeout',function(){_0x277d32['emit']('timeout',new AGIError(_0x070e('0x18')));_0xee173[_0x070e('0x19')]();});_0xee173[_0x070e('0x1a')](_0x2593e5);this['command']=function(_0x5b184,_0x5dc5d2){var _0x5b184=_0x5b184||'',_0x5dc5d2=typeof _0x5dc5d2==_0x070e('0xf')?_0x5dc5d2:new Function();_0x7bce9b={'tx':_0x5b184,'rx':'','cb':_0x5dc5d2};_0xee173[_0x070e('0x1b')](_0x5b184+'\x0a');},this[_0x070e('0x16')]=function(){_0xee173[_0x070e('0x19')]();};}util[_0x070e('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0x070e('0x1d')]['sendRequest']=function(_0x2f8055){return this[_0x070e('0x1e')][_0x070e('0x1f')](this,_0x2f8055);};AGIChannel['prototype'][_0x070e('0x20')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x070e('0x1d')][_0x070e('0x21')]=function(_0x41deb1,_0x1743cc,_0x4763c6){_0x41deb1=_0x41deb1===undefined?'beep':_0x41deb1;_0x1743cc=_0x1743cc===undefined?'5':_0x1743cc;_0x4763c6=_0x4763c6===undefined?'1':_0x4763c6;return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x24'),_0x41deb1,_0x1743cc*0x3e8,_0x4763c6));};AGIChannel[_0x070e('0x1d')][_0x070e('0x25')]=function(_0x28d7f2){_0x28d7f2=_0x28d7f2||_0x070e('0x26');return this[_0x070e('0x22')](util['format'](_0x070e('0x27'),_0x28d7f2));};AGIChannel[_0x070e('0x1d')][_0x070e('0x28')]=function(_0x56fc12,_0x5c5f0d){if(_[_0x070e('0x29')](_0x5c5f0d)){return this[_0x070e('0x22')](util[_0x070e('0x23')]('EXEC\x20%s\x20%s',_0x56fc12,_0x5c5f0d[_0x070e('0x2a')](',')));}return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2b'),_0x56fc12,_0x5c5f0d));};AGIChannel['prototype']['setContext']=function(_0x523b75){return this['sendRequest'](util[_0x070e('0x23')]('SET\x20CONTEXT\x20%s',_0x523b75));};AGIChannel[_0x070e('0x1d')][_0x070e('0x2c')]=function(_0x4f8130){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x2d'),_0x4f8130));};AGIChannel['prototype']['setPriority']=function(_0x41ade4){return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2e'),_0x41ade4));};AGIChannel[_0x070e('0x1d')]['hangup']=function(){return this['sendRequest'](_0x070e('0x2f'));};AGIChannel[_0x070e('0x1d')][_0x070e('0x30')]=function(_0xf57ed,_0xf11439){var _0x4deaf8=_[_0x070e('0x31')](_0xf11439)||_[_0x070e('0x32')](_0xf11439)?_0xf11439['toString']():_0xf11439;return this[_0x070e('0x22')](util[_0x070e('0x23')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xf57ed,_0x4deaf8?_0x4deaf8['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x070e('0x1d')][_0x070e('0x33')]=function(_0x39dfaa,_0x334733){return this[_0x070e('0x22')](util['format'](_0x070e('0x34'),_0x39dfaa,_0x334733));};AGIChannel[_0x070e('0x1d')][_0x070e('0x35')]=function(_0x487276,_0x268c5d){return this[_0x070e('0x22')](util[_0x070e('0x23')]('SAY\x20DIGITS\x20%s\x20%s',_0x487276,_0x268c5d));};AGIChannel[_0x070e('0x1d')][_0x070e('0x36')]=function(_0x4800a9,_0x173602){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x37'),_0x4800a9,_0x173602));};AGIChannel[_0x070e('0x1d')][_0x070e('0x38')]=function(_0xd03404,_0x47b929,_0xd18220){_0x47b929=_0x47b929||this['extension'];_0xd18220=_0xd18220||0x1;this['setContext'](_0xd03404);this[_0x070e('0x2c')](_0x47b929);this[_0x070e('0x39')](_0xd18220);return this[_0x070e('0x25')](util['format'](_0x070e('0x3a'),_0xd03404,_0x47b929,_0xd18220));};AGIChannel[_0x070e('0x1d')][_0x070e('0x3b')]=function(_0x7dc240){return this['sendRequest'](util[_0x070e('0x23')]('GET\x20VARIABLE\x20\x22%s\x22',_0x7dc240));};AGIChannel['prototype']['recordFile']=function(_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x34f23e,_0x562aa4){_0x926533=_0x926533||_0x070e('0x3c');_0x26b3e2=_0x26b3e2||'';_0x29dccd=_0x29dccd===undefined?-0x1:_0x29dccd==='-1'?-0x1:_0x29dccd*0x3e8;_0x34f23e=_0x34f23e===undefined?'':'s='+_0x34f23e;_0x562aa4=_0x562aa4?'BEEP':'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3d'),_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x562aa4,_0x34f23e));};AGIChannel['prototype']['streamFile']=function(_0x261a27,_0x5ee4b8){_0x5ee4b8=_0x5ee4b8||'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3e'),_0x261a27,_0x5ee4b8));};AGIChannel['prototype'][_0x070e('0x3f')]=function(_0x20a1ee){return this['exec']('AGI',_0x20a1ee);};AGIChannel[_0x070e('0x1d')][_0x070e('0x40')]=function(_0x2d43ce){return this[_0x070e('0x28')](_0x070e('0x41'),_0x2d43ce);};AGIChannel['prototype'][_0x070e('0x14')]=function(_0x3f6c64,_0x427fa7){this[_0x070e('0x25')](util[_0x070e('0x23')](_0x070e('0x42'),_0x3f6c64['id'],_0x3f6c64[_0x070e('0x43')],_0x427fa7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x070e('0x44')]=AGIChannel; \ No newline at end of file +var _0xa9e0=['utf8','setTimeout','setEncoding','ready','line','toLowerCase','hangup','emit','520\x20End\x20of\x20proper','function','substring','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','write','inherits','prototype','sendRequest','command','sync','ANSWER','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','label','exports','util','lodash','events','./error','call'];(function(_0x1bbae0,_0x22831a){var _0x21487f=function(_0x2bc261){while(--_0x2bc261){_0x1bbae0['push'](_0x1bbae0['shift']());}};_0x21487f(++_0x22831a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x0a9e('0x3'));function AGIChannel(_0x4ce2f1){var _0x333808=this,_0x432180=new AGIReply(),_0x2ab90b=![],_0x991246={};EventEmitter[_0x0a9e('0x4')](_0x333808);_0x4ce2f1['setEncoding'](_0x0a9e('0x5'));_0x4ce2f1[_0x0a9e('0x6')](0x8*0x3c*0x3c*0x3e8);_0x432180[_0x0a9e('0x7')]('utf8');_0x432180['on']('headers',function(_0xe42b77){for(var _0x56465b in _0xe42b77){_0x333808[_0x56465b]=_0xe42b77[_0x56465b];}_0x333808['emit'](_0x0a9e('0x8'));});_0x432180['on'](_0x0a9e('0x9'),function(_0x307b3e){if(_0x307b3e[_0x0a9e('0xa')]()==_0x0a9e('0xb')){_0x333808[_0x0a9e('0xc')]('hangup');return;}if(_0x307b3e['substring'](0x0,0xb)=='520-Invalid'){_0x2ab90b=!![];}if(_0x2ab90b){_0x991246['rx']+=_0x307b3e+'\x0a';if(_0x307b3e['search'](_0x0a9e('0xd'))!=-0x1){_0x2ab90b=![];}}else{_0x991246['rx']=_0x307b3e;}if(_0x2ab90b){return;}if(typeof _0x991246['cb']==_0x0a9e('0xe')){var _0xd5b662=_0x991246['rx'][_0x0a9e('0xf')](0x0,0x3),_0x26d672=null,_0x32d742=null;_0xd5b662=parseInt(_0xd5b662);if(isNaN(_0xd5b662)){_0x991246['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0xd5b662!=0xc8){_0x991246['cb'](null,{'code':_0xd5b662,'result':-0x1,'extra':'KO'});return;}_0x26d672=_0x991246['rx'][_0x0a9e('0xf')](0x4)[_0x0a9e('0x10')](_0x0a9e('0x11'),'');if(_0x26d672[_0x0a9e('0x12')]('\x20')!=-0x1){_0x26d672=_0x26d672[_0x0a9e('0x13')](0x0,_0x26d672[_0x0a9e('0x12')]('\x20'));}if(_['startsWith'](_0x26d672,'-1')){_0x26d672=parseInt(_0x26d672);}_0x32d742=_0x991246['rx'][_0x0a9e('0x14')]('\x20');if(_0x32d742['length']==0x3){_0x32d742=_0x32d742[0x2][_0x0a9e('0xf')](0x1,_0x32d742[0x2]['length']-0x1);}else if(_0x32d742[_0x0a9e('0x15')]>0x3){var _0x12066b=/\((.+)\)/;var _0x48f32d=_0x991246['rx'][_0x0a9e('0x16')](_0x12066b);if(_0x48f32d){_0x32d742=_0x48f32d[0x1];}else{_0x32d742=null;}}else{_0x32d742=null;}_0x991246['cb'](null,{'code':_0xd5b662,'result':_0x26d672,'extra':_0x32d742});}});_0x4ce2f1['on']('error',function(_0x459eb1){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x17'),new AGIError(_0x0a9e('0x18'),_0x459eb1[_0x0a9e('0x19')]));});_0x4ce2f1['on'](_0x0a9e('0x1a'),function(){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x1a'),new AGIError(_0x0a9e('0x1b')));});_0x4ce2f1['on'](_0x0a9e('0x1c'),function(){_0x333808[_0x0a9e('0xc')](_0x0a9e('0x1c'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x4ce2f1[_0x0a9e('0x1d')]();});_0x4ce2f1[_0x0a9e('0x1e')](_0x432180);this['command']=function(_0x20f109,_0x5a09ef){var _0x20f109=_0x20f109||'',_0x5a09ef=typeof _0x5a09ef==_0x0a9e('0xe')?_0x5a09ef:new Function();_0x991246={'tx':_0x20f109,'rx':'','cb':_0x5a09ef};_0x4ce2f1[_0x0a9e('0x1f')](_0x20f109+'\x0a');},this[_0x0a9e('0x1a')]=function(){_0x4ce2f1['destroy']();};}util[_0x0a9e('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x22')]=function(_0x4d00e6){return this[_0x0a9e('0x23')][_0x0a9e('0x24')](this,_0x4d00e6);};AGIChannel[_0x0a9e('0x21')]['answer']=function(){return this['sendRequest'](_0x0a9e('0x25'));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x26')]=function(_0x33161b,_0x526cf3,_0x384319){_0x33161b=_0x33161b===undefined?'beep':_0x33161b;_0x526cf3=_0x526cf3===undefined?'5':_0x526cf3;_0x384319=_0x384319===undefined?'1':_0x384319;return this[_0x0a9e('0x22')](util['format'](_0x0a9e('0x27'),_0x33161b,_0x526cf3*0x3e8,_0x384319));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x28')]=function(_0x14433c){_0x14433c=_0x14433c||_0x0a9e('0x29');return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x2b'),_0x14433c));};AGIChannel['prototype'][_0x0a9e('0x2c')]=function(_0x468813,_0x2b1f27){if(_[_0x0a9e('0x2d')](_0x2b1f27)){return this['sendRequest'](util[_0x0a9e('0x2a')](_0x0a9e('0x2e'),_0x468813,_0x2b1f27[_0x0a9e('0x2f')](',')));}return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x2e'),_0x468813,_0x2b1f27));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x30')]=function(_0x1dbde2){return this['sendRequest'](util[_0x0a9e('0x2a')]('SET\x20CONTEXT\x20%s',_0x1dbde2));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x31')]=function(_0x1122db){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SET\x20EXTENSION\x20%s',_0x1122db));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x32')]=function(_0x40cb85){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x33'),_0x40cb85));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0xb')]=function(){return this['sendRequest'](_0x0a9e('0x34'));};AGIChannel['prototype'][_0x0a9e('0x35')]=function(_0x14b13f,_0x2b7e7f){var _0x3f3d41=_['isBoolean'](_0x2b7e7f)||_[_0x0a9e('0x36')](_0x2b7e7f)?_0x2b7e7f[_0x0a9e('0x37')]():_0x2b7e7f;return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x14b13f,_0x3f3d41?_0x3f3d41['toString']()[_0x0a9e('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){return this[_0x0a9e('0x22')](util['format'](_0x0a9e('0x39'),_0x3d9717,_0x381c37));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x3a')]=function(_0x533942,_0x1dbf74){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x533942,_0x1dbf74));};AGIChannel['prototype'][_0x0a9e('0x3b')]=function(_0x40d766,_0x5adda1){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x3c'),_0x40d766,_0x5adda1));};AGIChannel[_0x0a9e('0x21')]['continueAt']=function(_0x5a594b,_0x15e37d,_0x45b3d0){_0x15e37d=_0x15e37d||this['extension'];_0x45b3d0=_0x45b3d0||0x1;this[_0x0a9e('0x30')](_0x5a594b);this[_0x0a9e('0x31')](_0x15e37d);this[_0x0a9e('0x32')](_0x45b3d0);return this['noop'](util[_0x0a9e('0x2a')](_0x0a9e('0x3d'),_0x5a594b,_0x15e37d,_0x45b3d0));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x3e')]=function(_0x13cb1f){return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x3f'),_0x13cb1f));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x40')]=function(_0x2c3711,_0x148007,_0x1a7bce,_0x11ca30,_0x37f6cc,_0x4d04c8){_0x148007=_0x148007||'wav';_0x1a7bce=_0x1a7bce||'';_0x11ca30=_0x11ca30===undefined?-0x1:_0x11ca30==='-1'?-0x1:_0x11ca30*0x3e8;_0x37f6cc=_0x37f6cc===undefined?'':'s='+_0x37f6cc;_0x4d04c8=_0x4d04c8?_0x0a9e('0x41'):'';return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x42'),_0x2c3711,_0x148007,_0x1a7bce,_0x11ca30,_0x4d04c8,_0x37f6cc));};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x43')]=function(_0x10b040,_0x445e25){_0x445e25=_0x445e25||'';return this[_0x0a9e('0x22')](util[_0x0a9e('0x2a')](_0x0a9e('0x44'),_0x10b040,_0x445e25));};AGIChannel[_0x0a9e('0x21')]['agi']=function(_0x117c99){return this[_0x0a9e('0x2c')](_0x0a9e('0x45'),_0x117c99);};AGIChannel[_0x0a9e('0x21')][_0x0a9e('0x46')]=function(_0xbe9d19){return this[_0x0a9e('0x2c')](_0x0a9e('0x47'),_0xbe9d19);};AGIChannel['prototype'][_0x0a9e('0x17')]=function(_0x48fd45,_0x473dc8){this[_0x0a9e('0x28')](util[_0x0a9e('0x2a')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x48fd45['id'],_0x48fd45[_0x0a9e('0x48')],_0x473dc8));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x0a9e('0x49')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 212c5a8..77c431b 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 _0x864a=['Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.'];(function(_0xf451e8,_0xde9904){var _0x4e5e39=function(_0xcba214){while(--_0xcba214){_0xf451e8['push'](_0xf451e8['shift']());}};_0x4e5e39(++_0xde9904);}(_0x864a,0x8a));var _0xa864=function(_0x31c8c9,_0x57bfc1){_0x31c8c9=_0x31c8c9-0x0;var _0x371836=_0x864a[_0x31c8c9];return _0x371836;};'use strict';var util=require(_0xa864('0x0'));var error={'E_AGI_UNDEFINED':_0xa864('0x1'),'E_AGI_ARGUMENT_PORT':_0xa864('0x2'),'E_AGI_SERVER_ERROR':_0xa864('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xa864('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xa864('0x5'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa864('0x6'),'E_AGI_IVR_ENTRY':_0xa864('0x7')};function AGIError(_0x37e03d){var _0x37e03d=_0x37e03d||null,_0x58ad17=_0x58ad17||[],_0x393d69=0x1,_0x26c6d9='';if(!error[_0x37e03d]){_0x37e03d='E_AGI_UNDEFINED';}_0x58ad17[_0xa864('0x8')](error[_0x37e03d]);while(arguments[_0x393d69]){_0x58ad17[_0xa864('0x8')](arguments[_0x393d69]);_0x393d69++;}_0x26c6d9=util[_0xa864('0x9')][_0xa864('0xa')](util,_0x58ad17);this['message']=_0x26c6d9;this['name']=_0x37e03d;}module[_0xa864('0xb')]=AGIError; \ No newline at end of file +var _0x3e5c=['name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[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.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x265fbc,_0x551241){_0x265fbc=_0x265fbc-0x0;var _0x1352d0=_0x3e5c[_0x265fbc];return _0x1352d0;};'use strict';var util=require(_0xc3e5('0x0'));var error={'E_AGI_UNDEFINED':_0xc3e5('0x1'),'E_AGI_ARGUMENT_PORT':_0xc3e5('0x2'),'E_AGI_SERVER_ERROR':_0xc3e5('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xc3e5('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xc3e5('0x5'),'E_AGI_SOCKET_ERROR':_0xc3e5('0x6'),'E_AGI_SOCKET_CLOSE':_0xc3e5('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xc3e5('0x8'),'E_AGI_COMMAND_EMPTY':_0xc3e5('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xc3e5('0xa')};function AGIError(_0xdf5a06){var _0xdf5a06=_0xdf5a06||null,_0xcbbec0=_0xcbbec0||[],_0x2d580e=0x1,_0x4864a2='';if(!error[_0xdf5a06]){_0xdf5a06=_0xc3e5('0xb');}_0xcbbec0[_0xc3e5('0xc')](error[_0xdf5a06]);while(arguments[_0x2d580e]){_0xcbbec0[_0xc3e5('0xc')](arguments[_0x2d580e]);_0x2d580e++;}_0x4864a2=util[_0xc3e5('0xd')][_0xc3e5('0xe')](util,_0xcbbec0);this[_0xc3e5('0xf')]=_0x4864a2;this[_0xc3e5('0x10')]=_0xdf5a06;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index c9317a1..4ce9033 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 _0x6324=['push','numberOfEdges','size','relations','getVertex','info','stop\x20traverse','no\x20edge/s\x20available','length','condition','split','agicommand','vswitch','target','default','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getsecretdigits','edges','prototype','vertices'];(function(_0x41f40f,_0x259c1b){var _0x2e4c02=function(_0x8629bd){while(--_0x8629bd){_0x41f40f['push'](_0x41f40f['shift']());}};_0x2e4c02(++_0x259c1b);}(_0x6324,0x142));var _0x4632=function(_0x58b44a,_0x1a7aa6){_0x58b44a=_0x58b44a-0x0;var _0xd6779d=_0x6324[_0x58b44a];return _0xd6779d;};'use strict';var _=require(_0x4632('0x0'));var logger=require(_0x4632('0x1'))(_0x4632('0x2'));var verticesWithRetry=[_0x4632('0x3'),'getdigits',_0x4632('0x4')];var Graph=function(){this['vertices']={};this[_0x4632('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0x4632('0x6')]['addVertex']=function(_0x140bc7){this[_0x4632('0x7')][_0x140bc7['id']]=_0x140bc7;this[_0x4632('0x5')][_0x140bc7['id']]=[];};Graph[_0x4632('0x6')]['addEdge']=function(_0x17e860,_0x44dd6d,_0x390a46){this['edges'][_0x17e860][_0x4632('0x8')]({'target':_0x44dd6d,'condition':_0x390a46});this[_0x4632('0x9')]+=0x1;};Graph['prototype']['size']=function(){return _[_0x4632('0xa')](this[_0x4632('0x7')]);};Graph[_0x4632('0x6')][_0x4632('0xb')]=function(){return this[_0x4632('0x9')];};Graph[_0x4632('0x6')][_0x4632('0xc')]=function(_0x17f9d1){return this['vertices'][_0x17f9d1];};Graph[_0x4632('0x6')]['traverseBFS']=function(_0x4719f7,_0x299073){if(!this[_0x4632('0x7')][_0x4719f7]){return logger[_0x4632('0xd')]('no\x20vertex\x20found');}var _0x3ba361=_0x299073(this[_0x4632('0x7')][_0x4719f7]);if(!_0x3ba361){return logger[_0x4632('0xd')](_0x4632('0xe'));}if(this[_0x4632('0x5')][_0x4719f7]['length']===0x0){return logger['info'](_0x4632('0xf'));}for(var _0x38bedd=0x0,_0x2bcfa3=[],_0x125eb9=![];_0x38bedd\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','toJson','mxGraphModel','root','agicommand','retry','maxRetry','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','getSquareProject','catch','createSquareReport','then','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','log','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','finally','vertex','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','defaults','nextTick','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format'];(function(_0x1ca761,_0x341ed6){var _0x25104e=function(_0x46e734){while(--_0x46e734){_0x1ca761['push'](_0x1ca761['shift']());}};_0x25104e(++_0x341ed6);}(_0xe48e,0x109));var _0xee48=function(_0x32eb1b,_0xb3ae14){_0x32eb1b=_0x32eb1b-0x0;var _0x123103=_0xe48e[_0x32eb1b];return _0x123103;};'use strict';var parser=require(_0xee48('0x0'));var _=require('lodash');var syncho=require(_0xee48('0x1'));var util=require(_0xee48('0x2'));var moment=require(_0xee48('0x3'));var config=require(_0xee48('0x4'));var logger=require(_0xee48('0x5'))(_0xee48('0x6'));var utilLicense=require(_0xee48('0x7'));var rpc=require(_0xee48('0x8'));var mailRpc=require(_0xee48('0x9'));var Graph=require(_0xee48('0xa'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xee48('0x6')]=_[_0xee48('0xb')](config[_0xee48('0x6')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x4d3478){process[_0xee48('0xc')](function(){syncho(function(){try{setChannelVariables(_0x4d3478);agiHandler(_0x4d3478);}catch(_0x46f9f3){logger['error'](_0x46f9f3[_0xee48('0xd')]);}});});}function listeningHandler(){console['log'](_0xee48('0xe'),config[_0xee48('0x6')]['port']);logger[_0xee48('0xf')](util[_0xee48('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xee48('0x6')]['ip'],config[_0xee48('0x6')][_0xee48('0x11')]));}function errorHandler(_0x2e2318){if(_0x2e2318&&_0x2e2318['name']&&_0x2e2318[_0xee48('0x12')]){logger['error'](util['format'](_0xee48('0x13'),_0x2e2318[_0xee48('0x14')],_0x2e2318[_0xee48('0x12')]));}else{logger[_0xee48('0x15')](util[_0xee48('0x10')](_0xee48('0x16'),_0x2e2318['stack']));}}function closeHandler(){logger[_0xee48('0xf')](util['format'](_0xee48('0x17'),this[_0xee48('0x18')],this[_0xee48('0x19')],this[_0xee48('0x1a')],this['dnid'],this[_0xee48('0x1b')]));try{createSquareReport(this);}catch(_0x2f51ad){logger['error'](_0x2f51ad[_0xee48('0xd')]);}}function timeoutHandler(){logger[_0xee48('0xf')](util[_0xee48('0x10')](_0xee48('0x1c'),this[_0xee48('0x18')],this[_0xee48('0x19')],this['callerid'],this[_0xee48('0x1d')],this[_0xee48('0x1b')]));}function hangupHandler(){logger['info'](util['format'](_0xee48('0x1e'),this['arg_1'],this[_0xee48('0x19')],this[_0xee48('0x1a')],this['dnid'],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x3e97c3){return parser[_0xee48('0x1f')](_0x3e97c3,{'object':!![]})[_0xee48('0x20')][_0xee48('0x21')];}function addVertex(_0xc3676f,_0x251372,_0x52f38a){_0x251372[_0xee48('0x22')]=_0x52f38a;if(_0x251372['hasOwnProperty'](_0xee48('0x23'))){_0x251372[_0xee48('0x24')]=parseInt(_0x251372['retry'],0xa);}_0xc3676f['addVertex'](_['omit'](_0x251372,_0xee48('0x25')));}function initGraph(_0x7fbf61,_0x242d07){var _0x5bbc10=new Graph();for(var _0x2c827f in _0x7fbf61){if(_0x7fbf61[_0xee48('0x26')](_0x2c827f)){if(_[_0xee48('0x27')](_0x7fbf61[_0x2c827f])){for(var _0x129838=0x0;_0x129838<_0x7fbf61[_0x2c827f][_0xee48('0x28')];_0x129838+=0x1){addVertex(_0x5bbc10,_0x7fbf61[_0x2c827f][_0x129838],_0x2c827f);}}else{addVertex(_0x5bbc10,_0x7fbf61[_0x2c827f],_0x2c827f);}}}for(var _0x136ce0=0x0;_0x136ce0<_0x242d07[_0xee48('0x28')];_0x136ce0+=0x1){if(_0x242d07[_0x136ce0][_0xee48('0x29')]&&_0x242d07[_0x136ce0][_0xee48('0x2a')]){_0x5bbc10[_0xee48('0x2b')](_0x242d07[_0x136ce0][_0xee48('0x29')],_0x242d07[_0x136ce0][_0xee48('0x2a')],_0x242d07[_0x136ce0]['value']);}}return _0x5bbc10;}function getSquareProject(_0x7d9067,_0x1f8a06){rpc[_0xee48('0x2c')](_0x7d9067)['then'](function(_0x20fd93){_0x1f8a06(null,_0x20fd93);})[_0xee48('0x2d')](function(_0x4ec1ec){_0x1f8a06(null,_0x4ec1ec);});}function createSquareReport(_0x1f9acb,_0x3dd829){rpc[_0xee48('0x2e')](_0x1f9acb)[_0xee48('0x2f')](function(_0x256878){if(_0x3dd829){_0x3dd829(null,_0x256878);}})[_0xee48('0x2d')](function(_0x29b12c){if(_0x3dd829){_0x3dd829(null,_0x29b12c);}});}function setChannelVariables(_0x4ef69e){for(var _0x4d4030 in _0x4ef69e){if(_0x4ef69e['hasOwnProperty'](_0x4d4030)){if(_0x4d4030[_0xee48('0x30')](_0xee48('0x31'))===0x0){_0x4ef69e[_0x4d4030[_0xee48('0x32')](0x4)]=_0x4ef69e[_0x4d4030];delete _0x4ef69e[_0x4d4030];}}}}function getLogFromObject(_0x2e9aca){return util[_0xee48('0x33')](_0x2e9aca,{'showHidden':![],'depth':null});}function agiHandler(_0x34fbde){var _0x229e92,_0x24c753,_0x249fdf,_0xa6055e,_0x15fa20;logger[_0xee48('0x34')](_0xee48('0x35'),JSON[_0xee48('0x36')](_0x34fbde,null,0x2));logger[_0xee48('0xf')](util['format'](_0xee48('0x37'),_0x34fbde['arg_1'],_0x34fbde[_0xee48('0x19')],_0x34fbde['callerid'],_0x34fbde[_0xee48('0x1d')],_0x34fbde[_0xee48('0x1b')]));_0x34fbde['on'](_0xee48('0x15'),errorHandler);_0x34fbde['on'](_0xee48('0x38'),closeHandler);_0x34fbde['on'](_0xee48('0x39'),timeoutHandler);_0x34fbde['evtHangup']=![];_0x34fbde['on'](_0xee48('0x3a'),hangupHandler);var _0x15c18d=getSquareProject[_0xee48('0x3b')](null,_0x34fbde['arg_1']);if(_0x15c18d){if(_0x15c18d[_0xee48('0x3c')]){_0x229e92=getRoot(_0x15c18d['production']);console[_0xee48('0x3d')]('SQUAREROOT',_0x229e92);if(_0x229e92&&_0x229e92[_0xee48('0x3e')]){logger[_0xee48('0x34')]('root',JSON['stringify'](_0x229e92,null,0x2));_0x34fbde[_0xee48('0x3f')]=moment()[_0xee48('0x10')](_0xee48('0x40'));_0x24c753=initGraph(_[_0xee48('0x41')](_0x229e92,'mxCell'),_0x229e92['mxCell']);_0x249fdf=new Vertices(_0x34fbde,rpc,mailRpc);logger[_0xee48('0xf')](util[_0xee48('0x10')](_0xee48('0x42'),_0x34fbde[_0xee48('0x18')],_0x34fbde[_0xee48('0x19')],_0x34fbde[_0xee48('0x1a')],_0x34fbde[_0xee48('0x1d')],_0x34fbde[_0xee48('0x1b')]));_0x24c753[_0xee48('0x43')](_0x229e92['start']['id'],function(_0x1022f6){try{_0x1022f6=_0x249fdf[_0xee48('0x44')](_0x1022f6);logger['debug']('vertex',JSON['stringify'](_0x1022f6,null,0x2));if(_0x1022f6[_0xee48('0x22')]===_0xee48('0x45')){logger[_0xee48('0xf')](_0xee48('0x46'));_0x34fbde[_0xee48('0x47')]=_0x1022f6[_0xee48('0x47')]||_0x34fbde[_0xee48('0x47')];_0x34fbde[_0xee48('0x48')]=_0x1022f6[_0xee48('0x48')];_0x34fbde['priority']=_0x1022f6['priority']?_0x1022f6[_0xee48('0x49')]-0x1:0x1;return null;}else if(_0x1022f6&&_0x249fdf[_0x1022f6['agicommand']]){_0x15fa20=_0x249fdf[_0x1022f6[_0xee48('0x22')]](_0x1022f6);logger['info'](_0xee48('0x4a'),JSON[_0xee48('0x36')](_0x15fa20,null,0x2));if(_0x15fa20&&_0x15fa20[_0xee48('0x4b')]===AGI_CODE_SUCCESS&&_0x15fa20[_0xee48('0x4c')]!==AGI_RESULT_ERROR&&!_0x34fbde[_0xee48('0x4d')]){logger[_0xee48('0x34')](_0xee48('0x4a'),getLogFromObject(_0x15fa20));return _[_0xee48('0x4e')](_0x15fa20[_0xee48('0x4c')])?null:_0x15fa20[_0xee48('0x4c')]['toString']();}else{logger['error']('response',getLogFromObject(_0x15fa20));return null;}}else{logger[_0xee48('0x15')]('agicommand\x20not\x20found');return null;}}catch(_0x20a90a){logger[_0xee48('0x15')](_0x20a90a[_0xee48('0xd')]);return null;}});if(_0x229e92[_0xee48('0x4f')]){logger[_0xee48('0xf')](util[_0xee48('0x10')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x34fbde['arg_1'],_0x34fbde[_0xee48('0x19')],_0x34fbde[_0xee48('0x1a')],_0x34fbde[_0xee48('0x1d')],_0x34fbde['uniqueid']));_0x24c753[_0xee48('0x43')](_0x229e92['finally']['id'],function(_0x18b696){try{_0x18b696=_0x249fdf['clear'](_0x18b696);logger['debug'](_0xee48('0x50'),JSON[_0xee48('0x36')](_0x18b696,null,0x2));if(_0x18b696&&_0x249fdf[_0x18b696[_0xee48('0x22')]]){_0x15fa20=_0x249fdf[_0x18b696[_0xee48('0x22')]](_0x18b696);if(_0x15fa20){logger[_0xee48('0x34')](_0xee48('0x4a'),getLogFromObject(_0x15fa20));return _[_0xee48('0x4e')](_0x15fa20[_0xee48('0x4c')])?null:_0x15fa20[_0xee48('0x4c')]['toString']();}else{logger[_0xee48('0x15')]('response',getLogFromObject(_0x15fa20));return null;}}else{logger[_0xee48('0x15')](_0xee48('0x51'));return null;}}catch(_0xb7e16f){logger[_0xee48('0x15')](_0xb7e16f['stack']);return null;}});}logger['info'](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x34fbde['arg_1'],_0x34fbde[_0xee48('0x19')],_0x34fbde['callerid'],_0x34fbde[_0xee48('0x1d')],_0x34fbde[_0xee48('0x1b')]));logger[_0xee48('0xf')](util[_0xee48('0x10')](_0xee48('0x52'),_0x34fbde['context'],_0x34fbde['extension'],parseInt(_0x34fbde[_0xee48('0x49')],0xa)+0x1));_0x34fbde[_0xee48('0x53')](_0x34fbde[_0xee48('0x47')],_0x34fbde[_0xee48('0x48')],parseInt(_0x34fbde[_0xee48('0x49')],0xa)+0x1);_0x34fbde[_0xee48('0x38')]();}}else{logger[_0xee48('0x15')](util[_0xee48('0x10')](_0xee48('0x54'),_0x34fbde['arg_1']));_0x34fbde[_0xee48('0x53')](_0x34fbde[_0xee48('0x47')],_0x34fbde[_0xee48('0x48')],parseInt(_0x34fbde[_0xee48('0x49')],0xa)+0x1);_0x34fbde['close']();}}else{logger[_0xee48('0x15')](util[_0xee48('0x10')]('Project\x20%s\x20not\x20found',_0x34fbde[_0xee48('0x18')]));_0x34fbde[_0xee48('0x53')](_0x34fbde[_0xee48('0x47')],_0x34fbde[_0xee48('0x48')],parseInt(_0x34fbde[_0xee48('0x49')],0xa)+0x1);_0x34fbde[_0xee48('0x38')]();}}function main(){var _0xf192a1;return utilLicense[_0xee48('0x55')]()[_0xee48('0x2f')](function(_0x59aaf7){if(_0x59aaf7){if(_0x59aaf7[_0xee48('0x56')]){if(_0x59aaf7[_0xee48('0x57')]&&_0x59aaf7['callysquare']>0x0){logger['info'](util[_0xee48('0x10')](_0xee48('0x58'),_0x59aaf7[_0xee48('0x57')]));_0xf192a1=_0x59aaf7[_0xee48('0x57')];}else{logger[_0xee48('0xf')](_0xee48('0x59'));}}else{logger['info'](_0xee48('0x5a'));_0xf192a1=-0x1;}}})[_0xee48('0x2d')](function(_0x2c26ee){logger[_0xee48('0x15')](_0xee48('0x5b'),_0x2c26ee['stack']);})[_0xee48('0x4f')](function(){var _0x324414=require(_0xee48('0x5c'))(config['agi']['port'],config[_0xee48('0x6')]['ip'],_0xf192a1);_0x324414['on'](_0xee48('0x15'),errorHandler);_0x324414['on']('listening',listeningHandler);_0x324414['on'](_0xee48('0x5d'),connectionHandler);_0x324414['on'](_0xee48('0x38'),closeHandler);});}main(); \ No newline at end of file +var _0xac60=['createSquareReport','then','agi_','inspect','debug','close','timeout','hangup','sync','production','log','SQUAREROOT','start','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','Project\x20%s\x20not\x20published','continueAt','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','listening','connection','syncho','util','moment','../../config/environment','../../config/license/util','./rpc','./mailRpc','./graph','agi','defaults','nextTick','error','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','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','arg_1','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','evtHangup','mxGraphModel','root','agicommand','maxRetry','retry','omit','mxCell','hasOwnProperty','length','source','target','addEdge','value','getSquareProject','catch'];(function(_0x43f4e8,_0x51efe2){var _0x1ea26c=function(_0x32d934){while(--_0x32d934){_0x43f4e8['push'](_0x43f4e8['shift']());}};_0x1ea26c(++_0x51efe2);}(_0xac60,0x137));var _0x0ac6=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xac60[_0x56482c];return _0x5aae7a;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require(_0x0ac6('0x0'));var util=require(_0x0ac6('0x1'));var moment=require(_0x0ac6('0x2'));var config=require(_0x0ac6('0x3'));var logger=require('../../config/logger')('agi');var utilLicense=require(_0x0ac6('0x4'));var rpc=require(_0x0ac6('0x5'));var mailRpc=require(_0x0ac6('0x6'));var Graph=require(_0x0ac6('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x0ac6('0x8')]=_[_0x0ac6('0x9')](config[_0x0ac6('0x8')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x386ec0){process[_0x0ac6('0xa')](function(){syncho(function(){try{setChannelVariables(_0x386ec0);agiHandler(_0x386ec0);}catch(_0x395709){logger[_0x0ac6('0xb')](_0x395709[_0x0ac6('0xc')]);}});});}function listeningHandler(){console['log'](_0x0ac6('0xd'),config['agi'][_0x0ac6('0xe')]);logger[_0x0ac6('0xf')](util[_0x0ac6('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config['agi']['ip'],config[_0x0ac6('0x8')]['port']));}function errorHandler(_0x582836){if(_0x582836&&_0x582836[_0x0ac6('0x11')]&&_0x582836[_0x0ac6('0x12')]){logger[_0x0ac6('0xb')](util[_0x0ac6('0x10')](_0x0ac6('0x13'),_0x582836[_0x0ac6('0x11')],_0x582836[_0x0ac6('0x12')]));}else{logger[_0x0ac6('0xb')](util[_0x0ac6('0x10')](_0x0ac6('0x14'),_0x582836[_0x0ac6('0xc')]));}}function closeHandler(){logger[_0x0ac6('0xf')](util[_0x0ac6('0x10')](_0x0ac6('0x15'),this[_0x0ac6('0x16')],this['calleridname'],this[_0x0ac6('0x17')],this['dnid'],this[_0x0ac6('0x18')]));try{createSquareReport(this);}catch(_0x300226){logger[_0x0ac6('0xb')](_0x300226[_0x0ac6('0xc')]);}}function timeoutHandler(){logger[_0x0ac6('0xf')](util[_0x0ac6('0x10')](_0x0ac6('0x19'),this[_0x0ac6('0x16')],this['calleridname'],this['callerid'],this[_0x0ac6('0x1a')],this[_0x0ac6('0x18')]));}function hangupHandler(){logger[_0x0ac6('0xf')](util[_0x0ac6('0x10')](_0x0ac6('0x1b'),this[_0x0ac6('0x16')],this[_0x0ac6('0x1c')],this[_0x0ac6('0x17')],this[_0x0ac6('0x1a')],this[_0x0ac6('0x18')]));this[_0x0ac6('0x1d')]=!![];}function getRoot(_0x4d8ad0){return parser['toJson'](_0x4d8ad0,{'object':!![]})[_0x0ac6('0x1e')][_0x0ac6('0x1f')];}function addVertex(_0x59b01c,_0x42af29,_0x3736f2){_0x42af29[_0x0ac6('0x20')]=_0x3736f2;if(_0x42af29['hasOwnProperty']('retry')){_0x42af29[_0x0ac6('0x21')]=parseInt(_0x42af29[_0x0ac6('0x22')],0xa);}_0x59b01c['addVertex'](_[_0x0ac6('0x23')](_0x42af29,_0x0ac6('0x24')));}function initGraph(_0x491a8b,_0x29b258){var _0x3c7ba0=new Graph();for(var _0x5f2b1e in _0x491a8b){if(_0x491a8b[_0x0ac6('0x25')](_0x5f2b1e)){if(_['isArray'](_0x491a8b[_0x5f2b1e])){for(var _0x469328=0x0;_0x469328<_0x491a8b[_0x5f2b1e][_0x0ac6('0x26')];_0x469328+=0x1){addVertex(_0x3c7ba0,_0x491a8b[_0x5f2b1e][_0x469328],_0x5f2b1e);}}else{addVertex(_0x3c7ba0,_0x491a8b[_0x5f2b1e],_0x5f2b1e);}}}for(var _0x3ab484=0x0;_0x3ab484<_0x29b258[_0x0ac6('0x26')];_0x3ab484+=0x1){if(_0x29b258[_0x3ab484][_0x0ac6('0x27')]&&_0x29b258[_0x3ab484][_0x0ac6('0x28')]){_0x3c7ba0[_0x0ac6('0x29')](_0x29b258[_0x3ab484][_0x0ac6('0x27')],_0x29b258[_0x3ab484]['target'],_0x29b258[_0x3ab484][_0x0ac6('0x2a')]);}}return _0x3c7ba0;}function getSquareProject(_0x248c0e,_0x2b2356){rpc[_0x0ac6('0x2b')](_0x248c0e)['then'](function(_0x47ee17){_0x2b2356(null,_0x47ee17);})[_0x0ac6('0x2c')](function(_0x51e44f){_0x2b2356(null,_0x51e44f);});}function createSquareReport(_0x216580,_0x11c790){rpc[_0x0ac6('0x2d')](_0x216580)[_0x0ac6('0x2e')](function(_0x1caff3){if(_0x11c790){_0x11c790(null,_0x1caff3);}})[_0x0ac6('0x2c')](function(_0x138e03){if(_0x11c790){_0x11c790(null,_0x138e03);}});}function setChannelVariables(_0x5beb34){for(var _0x384647 in _0x5beb34){if(_0x5beb34[_0x0ac6('0x25')](_0x384647)){if(_0x384647['indexOf'](_0x0ac6('0x2f'))===0x0){_0x5beb34[_0x384647['substring'](0x4)]=_0x5beb34[_0x384647];delete _0x5beb34[_0x384647];}}}}function getLogFromObject(_0x4ea960){return util[_0x0ac6('0x30')](_0x4ea960,{'showHidden':![],'depth':null});}function agiHandler(_0x47da11){var _0xaede48,_0x3e1b0d,_0x368b49,_0x1b49fd,_0x1184ff;logger[_0x0ac6('0x31')]('variables',JSON['stringify'](_0x47da11,null,0x2));logger[_0x0ac6('0xf')](util[_0x0ac6('0x10')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x47da11[_0x0ac6('0x16')],_0x47da11[_0x0ac6('0x1c')],_0x47da11[_0x0ac6('0x17')],_0x47da11[_0x0ac6('0x1a')],_0x47da11[_0x0ac6('0x18')]));_0x47da11['on'](_0x0ac6('0xb'),errorHandler);_0x47da11['on'](_0x0ac6('0x32'),closeHandler);_0x47da11['on'](_0x0ac6('0x33'),timeoutHandler);_0x47da11['evtHangup']=![];_0x47da11['on'](_0x0ac6('0x34'),hangupHandler);var _0x763141=getSquareProject[_0x0ac6('0x35')](null,_0x47da11['arg_1']);if(_0x763141){if(_0x763141['production']){_0xaede48=getRoot(_0x763141[_0x0ac6('0x36')]);console[_0x0ac6('0x37')](_0x0ac6('0x38'),_0xaede48);if(_0xaede48&&_0xaede48[_0x0ac6('0x39')]){logger[_0x0ac6('0x31')](_0x0ac6('0x1f'),JSON[_0x0ac6('0x3a')](_0xaede48,null,0x2));_0x47da11[_0x0ac6('0x3b')]=moment()[_0x0ac6('0x10')](_0x0ac6('0x3c'));_0x3e1b0d=initGraph(_[_0x0ac6('0x23')](_0xaede48,'mxCell'),_0xaede48[_0x0ac6('0x24')]);_0x368b49=new Vertices(_0x47da11,rpc,mailRpc);logger[_0x0ac6('0xf')](util[_0x0ac6('0x10')](_0x0ac6('0x3d'),_0x47da11['arg_1'],_0x47da11[_0x0ac6('0x1c')],_0x47da11['callerid'],_0x47da11[_0x0ac6('0x1a')],_0x47da11['uniqueid']));_0x3e1b0d[_0x0ac6('0x3e')](_0xaede48[_0x0ac6('0x39')]['id'],function(_0x2a158c){try{_0x2a158c=_0x368b49[_0x0ac6('0x3f')](_0x2a158c);logger[_0x0ac6('0x31')](_0x0ac6('0x40'),JSON[_0x0ac6('0x3a')](_0x2a158c,null,0x2));if(_0x2a158c[_0x0ac6('0x20')]===_0x0ac6('0x41')){logger['info'](_0x0ac6('0x42'));_0x47da11[_0x0ac6('0x43')]=_0x2a158c[_0x0ac6('0x43')]||_0x47da11['context'];_0x47da11[_0x0ac6('0x44')]=_0x2a158c[_0x0ac6('0x44')];_0x47da11[_0x0ac6('0x45')]=_0x2a158c[_0x0ac6('0x45')]?_0x2a158c[_0x0ac6('0x45')]-0x1:0x1;return null;}else if(_0x2a158c&&_0x368b49[_0x2a158c[_0x0ac6('0x20')]]){_0x1184ff=_0x368b49[_0x2a158c[_0x0ac6('0x20')]](_0x2a158c);logger[_0x0ac6('0xf')](_0x0ac6('0x46'),JSON[_0x0ac6('0x3a')](_0x1184ff,null,0x2));if(_0x1184ff&&_0x1184ff['code']===AGI_CODE_SUCCESS&&_0x1184ff[_0x0ac6('0x47')]!==AGI_RESULT_ERROR&&!_0x47da11['evtHangup']){logger['debug'](_0x0ac6('0x46'),getLogFromObject(_0x1184ff));return _['isUndefined'](_0x1184ff[_0x0ac6('0x47')])?null:_0x1184ff['result'][_0x0ac6('0x48')]();}else{logger[_0x0ac6('0xb')]('response',getLogFromObject(_0x1184ff));return null;}}else{logger[_0x0ac6('0xb')](_0x0ac6('0x49'));return null;}}catch(_0x51f0d6){logger[_0x0ac6('0xb')](_0x51f0d6[_0x0ac6('0xc')]);return null;}});if(_0xaede48[_0x0ac6('0x4a')]){logger[_0x0ac6('0xf')](util[_0x0ac6('0x10')](_0x0ac6('0x4b'),_0x47da11[_0x0ac6('0x16')],_0x47da11[_0x0ac6('0x1c')],_0x47da11['callerid'],_0x47da11[_0x0ac6('0x1a')],_0x47da11[_0x0ac6('0x18')]));_0x3e1b0d[_0x0ac6('0x3e')](_0xaede48['finally']['id'],function(_0x62b40b){try{_0x62b40b=_0x368b49[_0x0ac6('0x3f')](_0x62b40b);logger[_0x0ac6('0x31')](_0x0ac6('0x40'),JSON['stringify'](_0x62b40b,null,0x2));if(_0x62b40b&&_0x368b49[_0x62b40b[_0x0ac6('0x20')]]){_0x1184ff=_0x368b49[_0x62b40b[_0x0ac6('0x20')]](_0x62b40b);if(_0x1184ff){logger[_0x0ac6('0x31')]('response',getLogFromObject(_0x1184ff));return _[_0x0ac6('0x4c')](_0x1184ff[_0x0ac6('0x47')])?null:_0x1184ff[_0x0ac6('0x47')]['toString']();}else{logger['error'](_0x0ac6('0x46'),getLogFromObject(_0x1184ff));return null;}}else{logger[_0x0ac6('0xb')](_0x0ac6('0x49'));return null;}}catch(_0x259487){logger['error'](_0x259487[_0x0ac6('0xc')]);return null;}});}logger[_0x0ac6('0xf')](util[_0x0ac6('0x10')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x47da11[_0x0ac6('0x16')],_0x47da11[_0x0ac6('0x1c')],_0x47da11['callerid'],_0x47da11[_0x0ac6('0x1a')],_0x47da11[_0x0ac6('0x18')]));logger[_0x0ac6('0xf')](util[_0x0ac6('0x10')](_0x0ac6('0x4d'),_0x47da11['context'],_0x47da11[_0x0ac6('0x44')],parseInt(_0x47da11[_0x0ac6('0x45')],0xa)+0x1));_0x47da11['continueAt'](_0x47da11[_0x0ac6('0x43')],_0x47da11['extension'],parseInt(_0x47da11['priority'],0xa)+0x1);_0x47da11[_0x0ac6('0x32')]();}}else{logger[_0x0ac6('0xb')](util[_0x0ac6('0x10')](_0x0ac6('0x4e'),_0x47da11[_0x0ac6('0x16')]));_0x47da11[_0x0ac6('0x4f')](_0x47da11[_0x0ac6('0x43')],_0x47da11[_0x0ac6('0x44')],parseInt(_0x47da11[_0x0ac6('0x45')],0xa)+0x1);_0x47da11[_0x0ac6('0x32')]();}}else{logger[_0x0ac6('0xb')](util[_0x0ac6('0x10')]('Project\x20%s\x20not\x20found',_0x47da11[_0x0ac6('0x16')]));_0x47da11[_0x0ac6('0x4f')](_0x47da11[_0x0ac6('0x43')],_0x47da11[_0x0ac6('0x44')],parseInt(_0x47da11[_0x0ac6('0x45')],0xa)+0x1);_0x47da11[_0x0ac6('0x32')]();}}function main(){var _0x149610;return utilLicense[_0x0ac6('0x50')]()[_0x0ac6('0x2e')](function(_0x15f9cb){if(_0x15f9cb){if(_0x15f9cb[_0x0ac6('0x51')]){if(_0x15f9cb[_0x0ac6('0x52')]&&_0x15f9cb[_0x0ac6('0x52')]>0x0){logger[_0x0ac6('0xf')](util['format'](_0x0ac6('0x53'),_0x15f9cb['callysquare']));_0x149610=_0x15f9cb[_0x0ac6('0x52')];}else{logger['info'](_0x0ac6('0x54'));}}else{logger[_0x0ac6('0xf')](_0x0ac6('0x55'));_0x149610=-0x1;}}})['catch'](function(_0x1bfc6e){logger[_0x0ac6('0xb')]('[LICENSE]',_0x1bfc6e[_0x0ac6('0xc')]);})[_0x0ac6('0x4a')](function(){var _0xb466de=require(_0x0ac6('0x56'))(config['agi'][_0x0ac6('0xe')],config[_0x0ac6('0x8')]['ip'],_0x149610);_0xb466de['on'](_0x0ac6('0xb'),errorHandler);_0xb466de['on'](_0x0ac6('0x57'),listeningHandler);_0xb466de['on'](_0x0ac6('0x58'),connectionHandler);_0xb466de['on'](_0x0ac6('0x32'),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 08b493d..fe72548 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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x5a1de8,_0x3d3c42){var _0x3aa456=function(_0x29dc1d){while(--_0x29dc1d){_0x5a1de8['push'](_0x5a1de8['shift']());}};_0x3aa456(++_0x3d3c42);}(_0x814b,0x1a2));var _0xb814=function(_0xf1f37e,_0x159a20){_0xf1f37e=_0xf1f37e-0x0;var _0x2e3a6d=_0x814b[_0xf1f37e];return _0x2e3a6d;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x1cd166,_0x460138){var _0x3e3498=function(_0x35b1e1){while(--_0x35b1e1){_0x1cd166['push'](_0x1cd166['shift']());}};_0x3e3498(++_0x460138);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index c884c8d..96071b8 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 _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0x205d4f,_0x1551d7){var _0x2a740b=function(_0x3c9995){while(--_0x3c9995){_0x205d4f['push'](_0x205d4f['shift']());}};_0x2a740b(++_0x1551d7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x352660,_0x1c5e78){_0x352660=_0x352660-0x0;var _0x1b6698=_0x5f2f[_0x352660];return _0x1b6698;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file +var _0x7a54=['substring','length','split','indexOf','slice','trim','emit','util','stream','Transform','call','_localBuffer','inherits','prototype','_transform','toString','_inBody'];(function(_0x1f0819,_0x5bfb70){var _0x5a769f=function(_0x47222f){while(--_0x47222f){_0x1f0819['push'](_0x1f0819['shift']());}};_0x5a769f(++_0x5bfb70);}(_0x7a54,0x106));var _0x47a5=function(_0x34a2e6,_0x2a55e3){_0x34a2e6=_0x34a2e6-0x0;var _0x3f584b=_0x7a54[_0x34a2e6];return _0x3f584b;};'use strict';var util=require(_0x47a5('0x0'));var Transform=require(_0x47a5('0x1'))[_0x47a5('0x2')];function AGIReply(_0x58157c){Transform[_0x47a5('0x3')](this,_0x58157c);this[_0x47a5('0x4')]='';this['_inBody']=![];}util[_0x47a5('0x5')](AGIReply,Transform);AGIReply[_0x47a5('0x6')][_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){var _0x3d5629='\x0a',_0x59199c=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x343372=-0x1,_0x30e405=-0x1,_0x506eda='',_0x194fb0=0x0,_0x5077f3='',_0x5d90b3='';this[_0x47a5('0x4')]+=_0x3717e1[_0x47a5('0x8')]();_0x5077f3=this['_localBuffer'];if(!this[_0x47a5('0x9')]){_0x194fb0=0x0;while(_0x59199c[_0x194fb0]){while((_0x30e405=_0x5077f3['indexOf'](_0x59199c[_0x194fb0]))!=-0x1){_0x506eda=_0x59199c[_0x194fb0];_0x5d90b3=_0x5077f3['substring'](0x0,_0x30e405);_0x5077f3=_0x5077f3[_0x47a5('0xa')](_0x30e405+_0x506eda[_0x47a5('0xb')]);var _0x2f399b=_0x5d90b3[_0x47a5('0xc')](_0x3d5629),_0x250fad=0x0,_0xd612dd={},_0xd308b8='',_0x1eae59='',_0x5beb89=-0x1;while(_0x2f399b[_0x250fad]){_0x5beb89=_0x2f399b[_0x250fad][_0x47a5('0xd')](':');if(_0x5beb89!=-0x1){_0xd308b8=_0x2f399b[_0x250fad][_0x47a5('0xe')](0x0,_0x5beb89)[_0x47a5('0xf')]();_0x1eae59=_0x2f399b[_0x250fad][_0x47a5('0xe')](_0x5beb89+0x1)[_0x47a5('0xf')]();if(_0xd308b8[_0x47a5('0xb')]>0x0){_0xd612dd[_0xd308b8]=_0x1eae59;}}else{}_0x250fad++;}this[_0x47a5('0x10')]('headers',_0xd612dd);this[_0x47a5('0x9')]=!![];}_0x194fb0++;}this[_0x47a5('0x4')]=_0x5077f3;}else{while((_0x343372=_0x5077f3[_0x47a5('0xd')](_0x3d5629))!=-0x1){_0x5d90b3=_0x5077f3[_0x47a5('0xa')](0x0,_0x343372);this[_0x47a5('0x10')]('line',_0x5d90b3);_0x5077f3=_0x5077f3['substring'](_0x343372+_0x3d5629[_0x47a5('0xb')]);}this['_localBuffer']=_0x5077f3;}_0x545a97();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 4d957d7..6c68faf 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 _0x1ed7=['agentLogout','LogoutUser','util','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getTrunkById','ShowSound','getIntervalById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','getPauseById','ShowPause','agentPause','PauseUser','agentUnpause','UnpauseUser'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0x1ed7,0x6e));var _0x71ed=function(_0x123797,_0x5b187b){_0x123797=_0x123797-0x0;var _0x3a8f49=_0x1ed7[_0x123797];return _0x3a8f49;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require('lodash');var util=require(_0x71ed('0x0'));var jayson=require(_0x71ed('0x1'));var client=jayson[_0x71ed('0x2')][_0x71ed('0x3')]({'port':0x2329});function request(_0x74dd84,_0x59c737){return new BPromise(function(_0x1a2bc6,_0xb88a02){return client[_0x71ed('0x4')](_0x74dd84,_0x59c737)[_0x71ed('0x5')](function(_0x51bc16){if(_0x51bc16['error']){return _0xb88a02(_0x51bc16[_0x71ed('0x6')][_0x71ed('0x7')]);}else{return _0x1a2bc6(_0x51bc16[_0x71ed('0x8')]);}})[_0x71ed('0x9')](function(_0x3cf7ff){return _0xb88a02(_0x3cf7ff);});});}exports[_0x71ed('0xa')]=function(_0x585943){return request(_0x71ed('0xb'),{'options':{'raw':![],'where':{'name':_0x585943},'attributes':['production']}});};exports[_0x71ed('0xc')]=function(_0xc4e59d){return request(_0x71ed('0xd'),{'options':{'raw':![],'where':{'id':_0xc4e59d},'include':[{'model':_0x71ed('0xe'),'as':_0x71ed('0xf')}],'attributes':['id',_0x71ed('0x10'),_0x71ed('0x11')]}});};exports[_0x71ed('0x12')]=function(_0x43d6dc){return request('ShowSquareProject',{'options':{'where':{'id':_0x43d6dc},'attributes':[_0x71ed('0x10')]}});};exports[_0x71ed('0x13')]=function(_0x327bb5){return request(_0x71ed('0x14'),{'options':{'where':{'id':_0x327bb5},'attributes':['name']}});};exports[_0x71ed('0x15')]=function(_0x16bc2c){return request('ShowVariable',{'options':{'where':{'id':_0x16bc2c},'attributes':['name']}});};exports[_0x71ed('0x16')]=function(_0xe01160){return request(_0x71ed('0x17'),{'options':{'where':{'id':_0xe01160},'attributes':[_0x71ed('0x18')]}});};exports['getUserById']=function(_0x2473a3){return request(_0x71ed('0x19'),{'options':{'where':{'id':_0x2473a3},'attributes':['name']}});};exports[_0x71ed('0x1a')]=function(_0x1c0585){return request('ShowTrunk',{'options':{'where':{'id':_0x1c0585},'attributes':['name']}});};exports['getSoundById']=function(_0x1ce561){return request(_0x71ed('0x1b'),{'options':{'where':{'id':_0x1ce561},'attributes':['save_name']}});};exports[_0x71ed('0x1c')]=function(_0x255776){return request(_0x71ed('0x1d'),{'options':{'raw':![],'where':{'id':_0x255776},'include':[{'model':_0x71ed('0x1e'),'as':'Intervals'}]}});};exports[_0x71ed('0x1f')]=function(_0x500c40){return request(_0x71ed('0x20'),{'options':{'where':{'id':_0x500c40},'attributes':['id',_0x71ed('0x10')]}});};exports['createSmsMessage']=function(_0x5aa33e){return request(_0x71ed('0x21'),{'body':_0x5aa33e});};exports[_0x71ed('0x22')]=function(_0x134e37){return request('CreateSquareDetailsReport',{'body':_0x134e37});};exports[_0x71ed('0x23')]=function(_0x49423b){return request(_0x71ed('0x24'),{'body':_[_0x71ed('0x25')](_0x49423b,{'project_name':_0x49423b[_0x71ed('0x26')],'prev_project_name':_0x49423b[_0x71ed('0x27')]||'','is_subproject':_0x49423b[_0x71ed('0x27')]?!![]:![],'leaveAt':moment()[_0x71ed('0x28')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0xb01ddd){return request(_0x71ed('0x29'),{'body':_0xb01ddd});};exports[_0x71ed('0x2a')]=function(_0x39ef72){return request('CreateSquareMessage',{'body':_0x39ef72});};exports[_0x71ed('0x2b')]=function(_0x57b5b3){return request(_0x71ed('0x2c'),{'options':{'raw':![],'where':{'phone':_0x57b5b3['phone'],'ListId':_0x57b5b3[_0x71ed('0x2d')]}}})[_0x71ed('0x5')](function(_0x55476c){if(_0x55476c){return _0x55476c;}return request('CreateCmContact',{'body':_0x57b5b3});});};exports[_0x71ed('0x2e')]=function(_0xff59b8){return request(_0x71ed('0x2f'),{'options':{'where':{'id':_0xff59b8},'attributes':[_0x71ed('0x10')]}});};exports['agentLogin']=function(_0x503e00,_0x36ccba){return request('LoginUser',{'body':{'interface':_0x36ccba},'options':{'where':_0x503e00}});};exports[_0x71ed('0x30')]=function(_0x5de4e1,_0x36b7c3,_0xec9ca7){return request(_0x71ed('0x31'),{'body':{'type':_0x36b7c3,'uniqueid':_0xec9ca7},'options':{'where':_0x5de4e1}});};exports[_0x71ed('0x32')]=function(_0x520906){return request(_0x71ed('0x33'),{'body':{},'options':{'where':_0x520906}});};exports[_0x71ed('0x34')]=function(_0x522e49){return request(_0x71ed('0x35'),{'body':{},'options':{'where':_0x522e49}});}; \ No newline at end of file +var _0x9619=['UnpauseUser','LogoutUser','bluebird','moment','lodash','jayson/promise','client','http','error','message','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','getSoundById','ShowSound','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','then','CreateCmContact','getPauseById','ShowPause','agentLogin','agentPause','agentUnpause'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x9619,0x6e));var _0x9961=function(_0x48bc96,_0x222830){_0x48bc96=_0x48bc96-0x0;var _0x2ed963=_0x9619[_0x48bc96];return _0x2ed963;};'use strict';var BPromise=require(_0x9961('0x0'));var moment=require(_0x9961('0x1'));var _=require(_0x9961('0x2'));var util=require('util');var jayson=require(_0x9961('0x3'));var client=jayson[_0x9961('0x4')][_0x9961('0x5')]({'port':0x2329});function request(_0x4e9758,_0x3d1bee){return new BPromise(function(_0x52b3b8,_0x555247){return client['request'](_0x4e9758,_0x3d1bee)['then'](function(_0x32996f){if(_0x32996f['error']){return _0x555247(_0x32996f[_0x9961('0x6')][_0x9961('0x7')]);}else{return _0x52b3b8(_0x32996f['result']);}})[_0x9961('0x8')](function(_0x5b9935){return _0x555247(_0x5b9935);});});}exports[_0x9961('0x9')]=function(_0x21126b){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x21126b},'attributes':[_0x9961('0xa')]}});};exports[_0x9961('0xb')]=function(_0x2a3cff){return request(_0x9961('0xc'),{'options':{'raw':![],'where':{'id':_0x2a3cff},'include':[{'model':_0x9961('0xd'),'as':'Smtp'}],'attributes':['id',_0x9961('0xe'),_0x9961('0xf')]}});};exports[_0x9961('0x10')]=function(_0x165d77){return request(_0x9961('0x11'),{'options':{'where':{'id':_0x165d77},'attributes':[_0x9961('0xe')]}});};exports[_0x9961('0x12')]=function(_0x113f3f){return request(_0x9961('0x13'),{'options':{'where':{'id':_0x113f3f},'attributes':[_0x9961('0xe')]}});};exports[_0x9961('0x14')]=function(_0x1b5ccb){return request(_0x9961('0x15'),{'options':{'where':{'id':_0x1b5ccb},'attributes':[_0x9961('0xe')]}});};exports[_0x9961('0x16')]=function(_0xc7dd40){return request(_0x9961('0x17'),{'options':{'where':{'id':_0xc7dd40},'attributes':['dsn']}});};exports[_0x9961('0x18')]=function(_0x54f419){return request(_0x9961('0x19'),{'options':{'where':{'id':_0x54f419},'attributes':[_0x9961('0xe')]}});};exports['getTrunkById']=function(_0x2c7828){return request('ShowTrunk',{'options':{'where':{'id':_0x2c7828},'attributes':[_0x9961('0xe')]}});};exports[_0x9961('0x1a')]=function(_0x382b49){return request(_0x9961('0x1b'),{'options':{'where':{'id':_0x382b49},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x48f19e){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x48f19e},'include':[{'model':'Interval','as':_0x9961('0x1c')}]}});};exports[_0x9961('0x1d')]=function(_0x405b83){return request(_0x9961('0x1e'),{'options':{'where':{'id':_0x405b83},'attributes':['id',_0x9961('0xe')]}});};exports[_0x9961('0x1f')]=function(_0x4394c9){return request('CreateSmsMessage',{'body':_0x4394c9});};exports[_0x9961('0x20')]=function(_0x3a6ded){return request(_0x9961('0x21'),{'body':_0x3a6ded});};exports[_0x9961('0x22')]=function(_0x9a03f8){return request(_0x9961('0x23'),{'body':_[_0x9961('0x24')](_0x9a03f8,{'project_name':_0x9a03f8['arg_1'],'prev_project_name':_0x9a03f8[_0x9961('0x25')]||'','is_subproject':_0x9a03f8[_0x9961('0x25')]?!![]:![],'leaveAt':moment()[_0x9961('0x26')](_0x9961('0x27'))})});};exports[_0x9961('0x28')]=function(_0x25bde3){return request('CreateSquareRecording',{'body':_0x25bde3});};exports[_0x9961('0x29')]=function(_0x436556){return request(_0x9961('0x2a'),{'body':_0x436556});};exports[_0x9961('0x2b')]=function(_0x1a45a9){return request(_0x9961('0x2c'),{'options':{'raw':![],'where':{'phone':_0x1a45a9['phone'],'ListId':_0x1a45a9['ListId']}}})[_0x9961('0x2d')](function(_0xb43fad){if(_0xb43fad){return _0xb43fad;}return request(_0x9961('0x2e'),{'body':_0x1a45a9});});};exports[_0x9961('0x2f')]=function(_0x4a0d1f){return request(_0x9961('0x30'),{'options':{'where':{'id':_0x4a0d1f},'attributes':[_0x9961('0xe')]}});};exports[_0x9961('0x31')]=function(_0xf2749a,_0x40f6f9){return request('LoginUser',{'body':{'interface':_0x40f6f9},'options':{'where':_0xf2749a}});};exports[_0x9961('0x32')]=function(_0x41b996,_0x57f7e8,_0x45724e){return request('PauseUser',{'body':{'type':_0x57f7e8,'uniqueid':_0x45724e},'options':{'where':_0x41b996}});};exports[_0x9961('0x33')]=function(_0xa15e7e){return request(_0x9961('0x34'),{'body':{},'options':{'where':_0xa15e7e}});};exports['agentLogout']=function(_0x1c86a3){return request(_0x9961('0x35'),{'body':{},'options':{'where':_0x1c86a3}});}; \ 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 4965baa..1e78590 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 _0xb458=['exports','./polly','./lex'];(function(_0x62f8c,_0x3dae65){var _0x1d7b7f=function(_0x31ce70){while(--_0x31ce70){_0x62f8c['push'](_0x62f8c['shift']());}};_0x1d7b7f(++_0x3dae65);}(_0xb458,0x103));var _0x8b45=function(_0x1dc45f,_0x318b0e){_0x1dc45f=_0x1dc45f-0x0;var _0x127202=_0xb458[_0x1dc45f];return _0x127202;};var polly=require(_0x8b45('0x0'));var lex=require(_0x8b45('0x1'));module[_0x8b45('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xdace=['exports','./polly'];(function(_0x503560,_0x41bd8d){var _0x525a15=function(_0x531766){while(--_0x531766){_0x503560['push'](_0x503560['shift']());}};_0x525a15(++_0x41bd8d);}(_0xdace,0xc5));var _0xedac=function(_0x1098db,_0x39ba6b){_0x1098db=_0x1098db-0x0;var _0x14f090=_0xdace[_0x1098db];return _0x14f090;};var polly=require(_0xedac('0x0'));var lex=require('./lex');module[_0xedac('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 75b6072..74262cb 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. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x1c3091,_0x56c173,_0x13e5b4,_0x56e41c,_0xf647b9,_0x1bf23e){return lex(_0x1c3091,_0x56c173,_0x13e5b4,_0x56e41c,_0xf647b9,_0x1bf23e);}; \ No newline at end of file +var _0xb205=['./lib/api','exports'];(function(_0x57dca9,_0x48a789){var _0x115374=function(_0x548b43){while(--_0x548b43){_0x57dca9['push'](_0x57dca9['shift']());}};_0x115374(++_0x48a789);}(_0xb205,0xf0));var _0x5b20=function(_0x4cb457,_0x45262a){_0x4cb457=_0x4cb457-0x0;var _0x5d99cf=_0xb205[_0x4cb457];return _0x5d99cf;};'use strict';var lex=require(_0x5b20('0x0'));module[_0x5b20('0x1')]=function(_0x3edef1,_0x402850,_0x65c236,_0x5f4ec5,_0x5ccd5f,_0x37fe91){return lex(_0x3edef1,_0x402850,_0x65c236,_0x5f4ec5,_0x5ccd5f,_0x37fe91);}; \ 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 2d33131..cb2f29b 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 _0x86ae=['$LATEST','bluebird','aws-sdk','postText','slots','slot_','exports'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x86ae,0x1e4));var _0xe86a=function(_0x5865fc,_0x339792){_0x5865fc=_0x5865fc-0x0;var _0x2aa668=_0x86ae[_0x5865fc];return _0x2aa668;};'use strict';var BPromise=require(_0xe86a('0x0'));var AWS=require(_0xe86a('0x1'));function lexResult(_0x385797,_0x3e2f4a){return new BPromise(function(_0x37bf39,_0x1bb925){_0x385797[_0xe86a('0x2')](_0x3e2f4a,function(_0x30764a,_0x2e23d6){if(_0x30764a){_0x1bb925(_0x30764a);}if(_0x2e23d6[_0xe86a('0x3')]){for(const _0x5e2d81 in _0x2e23d6[_0xe86a('0x3')]){if(_0x2e23d6[_0xe86a('0x3')]['hasOwnProperty'](_0x5e2d81)){var _0x6dc3df=_0x2e23d6[_0xe86a('0x3')][_0x5e2d81];_0x2e23d6[_0xe86a('0x4')+_0x5e2d81]=_0x6dc3df;}}}_0x37bf39(_0x2e23d6);});});}module[_0xe86a('0x5')]=function(_0x49d3b8,_0x545566,_0x3dbd13,_0x24df9c,_0x3c2dec,_0x44d26c){var _0x5a2853=new AWS['LexRuntime']({'accessKeyId':_0x545566,'secretAccessKey':_0x3dbd13,'region':_0x24df9c});var _0x10f5b1={'botAlias':_0xe86a('0x6'),'botName':_0x44d26c,'inputText':_0x3c2dec,'userId':_0x49d3b8};return lexResult(_0x5a2853,_0x10f5b1);}; \ No newline at end of file +var _0x44bc=['postText','slots','hasOwnProperty','slot_','exports','LexRuntime','aws-sdk'];(function(_0x188299,_0x2ce547){var _0x42d49c=function(_0x2135cd){while(--_0x2135cd){_0x188299['push'](_0x188299['shift']());}};_0x42d49c(++_0x2ce547);}(_0x44bc,0x164));var _0xc44b=function(_0x2c2fe3,_0x978244){_0x2c2fe3=_0x2c2fe3-0x0;var _0x24a6c8=_0x44bc[_0x2c2fe3];return _0x24a6c8;};'use strict';var BPromise=require('bluebird');var AWS=require(_0xc44b('0x0'));function lexResult(_0x4955f4,_0x34aea5){return new BPromise(function(_0x502780,_0x289f54){_0x4955f4[_0xc44b('0x1')](_0x34aea5,function(_0x3d26bd,_0x36b847){if(_0x3d26bd){_0x289f54(_0x3d26bd);}if(_0x36b847[_0xc44b('0x2')]){for(const _0x2af43a in _0x36b847['slots']){if(_0x36b847['slots'][_0xc44b('0x3')](_0x2af43a)){var _0x67c097=_0x36b847['slots'][_0x2af43a];_0x36b847[_0xc44b('0x4')+_0x2af43a]=_0x67c097;}}}_0x502780(_0x36b847);});});}module[_0xc44b('0x5')]=function(_0x293352,_0x6a5bbc,_0x5eaa20,_0x4c582a,_0x4277e5,_0x5e8f98){var _0xe4e807=new AWS[(_0xc44b('0x6'))]({'accessKeyId':_0x6a5bbc,'secretAccessKey':_0x5eaa20,'region':_0x4c582a});var _0x6db793={'botAlias':'$LATEST','botName':_0x5e8f98,'inputText':_0x4277e5,'userId':_0x293352};return lexResult(_0xe4e807,_0x6db793);}; \ 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 3db9be3..3973b4a 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 _0xa47c=['exports','./lib/api'];(function(_0x2b0cf2,_0xf9c77a){var _0x13f492=function(_0x381ab2){while(--_0x381ab2){_0x2b0cf2['push'](_0x2b0cf2['shift']());}};_0x13f492(++_0xf9c77a);}(_0xa47c,0x15b));var _0xca47=function(_0x3b4dea,_0x16cf14){_0x3b4dea=_0x3b4dea-0x0;var _0xf07700=_0xa47c[_0x3b4dea];return _0xf07700;};'use strict';var polly=require(_0xca47('0x0'));module[_0xca47('0x1')]=function(_0x509591,_0x4cb584,_0xda73d8,_0x1e3dce,_0x1939ee,_0xf5bf35,_0x3fffec){return polly(_0x509591,_0x4cb584,_0xda73d8,_0x1e3dce,_0x1939ee,_0xf5bf35,_0x3fffec);}; \ No newline at end of file +var _0x5ca4=['./lib/api','exports'];(function(_0x25470a,_0x3b281a){var _0x48db98=function(_0x4e15e7){while(--_0x4e15e7){_0x25470a['push'](_0x25470a['shift']());}};_0x48db98(++_0x3b281a);}(_0x5ca4,0x150));var _0x45ca=function(_0x16fc91,_0x5d6c60){_0x16fc91=_0x16fc91-0x0;var _0x12afb9=_0x5ca4[_0x16fc91];return _0x12afb9;};'use strict';var polly=require(_0x45ca('0x0'));module[_0x45ca('0x1')]=function(_0x12a7b7,_0x5425dc,_0x2d538b,_0x5c8630,_0x40ac09,_0x13fe13,_0x505b5e){return polly(_0x12a7b7,_0x5425dc,_0x2d538b,_0x5c8630,_0x40ac09,_0x13fe13,_0x505b5e);}; \ 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 5c0ebf0..94e04d8 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 _0x83fb=['text','bluebird','randomstring','synthesizeSpeech','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x98a17b,_0x2b6239){var _0x402882=function(_0x4eab1b){while(--_0x4eab1b){_0x98a17b['push'](_0x98a17b['shift']());}};_0x402882(++_0x2b6239);}(_0x83fb,0x99));var _0xb83f=function(_0x490ca0,_0x2894f2){_0x490ca0=_0x490ca0-0x0;var _0x53845c=_0x83fb[_0x490ca0];return _0x53845c;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xb83f('0x0'));var rs=require(_0xb83f('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x29cb24,_0x1d7fe6,_0x248a7b){return new BPromise(function(_0x4783be,_0x5e1e60){_0x29cb24[_0xb83f('0x2')](_0x1d7fe6,function(_0x419e10,_0x4c4bdb){if(_0x419e10){_0x5e1e60(_0x419e10);}else if(_0x4c4bdb){if(_0x4c4bdb['AudioStream']instanceof Buffer){fs[_0xb83f('0x3')](_0x248a7b,_0x4c4bdb['AudioStream'],function(_0x85c385){if(_0x85c385){_0x5e1e60(_0x85c385);}else{_0x4783be();}});}else{_0x5e1e60(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x5e1e60(new Error(_0xb83f('0x4')));}});});}module[_0xb83f('0x5')]=function(_0x1185b3,_0x5b2342,_0x474f21,_0x2ddd13,_0x5d4122,_0x179005,_0x5d3e57){var _0x562b9f=new AWS[(_0xb83f('0x6'))]({'accessKeyId':_0x1185b3,'secretAccessKey':_0x5b2342,'region':_0x474f21});var _0x2f88fb={'Text':_0x5d4122,'TextType':_0x179005||_0xb83f('0x7'),'OutputFormat':'mp3','VoiceId':_0x2ddd13};return pollyResult(_0x562b9f,_0x2f88fb,_0x5d3e57);}; \ No newline at end of file +var _0xc299=['mp3','bluebird','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc299,0xac));var _0x9c29=function(_0x1b5a5a,_0x1c3b75){_0x1b5a5a=_0x1b5a5a-0x0;var _0x42b32d=_0xc299[_0x1b5a5a];return _0x42b32d;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x9c29('0x0'));var rs=require('randomstring');var AWS=require(_0x9c29('0x1'));function pollyResult(_0x5e401f,_0x49d90b,_0x4a7f4e){return new BPromise(function(_0x318a64,_0x15de46){_0x5e401f[_0x9c29('0x2')](_0x49d90b,function(_0x2e1e1c,_0x128306){if(_0x2e1e1c){_0x15de46(_0x2e1e1c);}else if(_0x128306){if(_0x128306[_0x9c29('0x3')]instanceof Buffer){fs[_0x9c29('0x4')](_0x4a7f4e,_0x128306[_0x9c29('0x3')],function(_0x3a9a24){if(_0x3a9a24){_0x15de46(_0x3a9a24);}else{_0x318a64();}});}else{_0x15de46(new Error(_0x9c29('0x5')));}}else{_0x15de46(new Error(_0x9c29('0x6')));}});});}module[_0x9c29('0x7')]=function(_0x4c4c28,_0x45ad63,_0x496cb4,_0x457c9a,_0x456949,_0x39c1bd,_0x1ecd40){var _0x5186d4=new AWS['Polly']({'accessKeyId':_0x4c4c28,'secretAccessKey':_0x45ad63,'region':_0x496cb4});var _0x108dd6={'Text':_0x456949,'TextType':_0x39c1bd||'text','OutputFormat':_0x9c29('0x8'),'VoiceId':_0x457c9a};return pollyResult(_0x5186d4,_0x108dd6,_0x1ecd40);}; \ 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 f303188..7a41afe 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 _0xcbc1=['exports'];(function(_0xf7afd3,_0x43926d){var _0x22cb4c=function(_0x2f7ea0){while(--_0x2f7ea0){_0xf7afd3['push'](_0xf7afd3['shift']());}};_0x22cb4c(++_0x43926d);}(_0xcbc1,0x7d));var _0x1cbc=function(_0x11ec6c,_0x1a8169){_0x11ec6c=_0x11ec6c-0x0;var _0xb59506=_0xcbc1[_0x11ec6c];return _0xb59506;};'use strict';var asr=require('./lib/api');module[_0x1cbc('0x0')]=function(_0x1bf8ff,_0xe2d2d9,_0x585f70,_0x4ef5e7){return asr(_0x1bf8ff,_0xe2d2d9,_0x585f70);}; \ No newline at end of file +var _0x5cbf=['./lib/api','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5cbf,0xd8));var _0xf5cb=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x5cbf[_0x1b828b];return _0x98da1a;};'use strict';var asr=require(_0xf5cb('0x0'));module[_0xf5cb('0x1')]=function(_0x306d21,_0xfefeab,_0x4fefc9,_0x488a8e){return asr(_0x306d21,_0xfefeab,_0x4fefc9);}; \ 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 64f8a0d..fedd7cd 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 _0x885b=['filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','8000','url','string','length'];(function(_0x5362f5,_0x96744a){var _0x1c3dda=function(_0x32b477){while(--_0x32b477){_0x5362f5['push'](_0x5362f5['shift']());}};_0x1c3dda(++_0x96744a);}(_0x885b,0xf4));var _0xb885=function(_0x7a8677,_0x15a2ab){_0x7a8677=_0x7a8677-0x0;var _0x647cd7=_0x885b[_0x7a8677];return _0x647cd7;};'use strict';var url=require(_0xb885('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0xfefe09,_0x1f54c9,_0x36f7a7){return new BPromise(function(_0x2715d7,_0x3011ab){var _0x473c21;if(typeof _0xfefe09!==_0xb885('0x1')||_0xfefe09[_0xb885('0x2')]===0x0){return _0x3011ab(_0xb885('0x3'));}if(typeof _0x1f54c9!==_0xb885('0x1')||_0x1f54c9[_0xb885('0x2')]===0x0){return _0x3011ab(_0xb885('0x4'));}if(typeof _0x36f7a7!==_0xb885('0x5')&&(typeof _0x36f7a7!=='string'||_0x36f7a7['length']===0x0)){return _0x3011ab(_0xb885('0x6'));}try{_0x473c21=fs[_0xb885('0x7')](_0xfefe09)[_0xb885('0x8')](_0xb885('0x9'));}catch(_0x4a137d){return _0x3011ab(_0x4a137d);}return _0x2715d7({'method':_0xb885('0xa'),'uri':host+_0xb885('0xb')+_0x1f54c9,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0xb885('0xc'),'languageCode':_0x36f7a7},'audio':{'content':_0x473c21}},'json':!![]});});}; \ No newline at end of file +var _0x4c3e=['toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x11b8ae,_0x485fa8){var _0x35a448=function(_0x188a5b){while(--_0x188a5b){_0x11b8ae['push'](_0x11b8ae['shift']());}};_0x35a448(++_0x485fa8);}(_0x4c3e,0x15f));var _0xe4c3=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x4c3e[_0x9df060];return _0x338dfe;};'use strict';var url=require(_0xe4c3('0x0'));var BPromise=require(_0xe4c3('0x1'));var fs=require('fs');var host=_0xe4c3('0x2');module['exports']=function(_0x4ff2b7,_0x242c21,_0x2c33e2){return new BPromise(function(_0x150d77,_0xdd55dd){var _0x3ed73d;if(typeof _0x4ff2b7!=='string'||_0x4ff2b7['length']===0x0){return _0xdd55dd('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x242c21!==_0xe4c3('0x3')||_0x242c21[_0xe4c3('0x4')]===0x0){return _0xdd55dd(_0xe4c3('0x5'));}if(typeof _0x2c33e2!==_0xe4c3('0x6')&&(typeof _0x2c33e2!==_0xe4c3('0x3')||_0x2c33e2[_0xe4c3('0x4')]===0x0)){return _0xdd55dd(_0xe4c3('0x7'));}try{_0x3ed73d=fs[_0xe4c3('0x8')](_0x4ff2b7)[_0xe4c3('0x9')](_0xe4c3('0xa'));}catch(_0x1b2e10){return _0xdd55dd(_0x1b2e10);}return _0x150d77({'method':_0xe4c3('0xb'),'uri':host+_0xe4c3('0xc')+_0x242c21,'body':{'config':{'encoding':_0xe4c3('0xd'),'sampleRateHertz':_0xe4c3('0xe'),'languageCode':_0x2c33e2},'audio':{'content':_0x3ed73d}},'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 b2c5c04..d2c322b 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 _0xc88f=['exports','./asr'];(function(_0x417f13,_0x2f0eb0){var _0x1760ff=function(_0x26be47){while(--_0x26be47){_0x417f13['push'](_0x417f13['shift']());}};_0x1760ff(++_0x2f0eb0);}(_0xc88f,0xf3));var _0xfc88=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc88f[_0x321bb2];return _0x9c12ed;};var asr=require(_0xfc88('0x0'));module[_0xfc88('0x1')]={'asr':asr}; \ No newline at end of file +var _0x3a20=['exports'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0x3a20,0xd0));var _0x03a2=function(_0x2e85cf,_0x1ea447){_0x2e85cf=_0x2e85cf-0x0;var _0x4ea360=_0x3a20[_0x2e85cf];return _0x4ea360;};var asr=require('./asr');module[_0x03a2('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 5b16fb1..04c19e9 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 _0x927c=['endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','.mp3','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','http','https','parse','bluebird','randomstring','sox','querystring','google-tts-api','apiai-promise','md5','./google','./aws','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','unlink','pipe','end','host','transcode','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','then','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','text:synthesize','POST','from','audioContent','writeFile','chmodSync','info','googleCloudTTS\x20path','goggleTTS\x20path','googleASR','asr','uri','map','alternatives','transcript','results','confidence','join','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','textRequest','stringify','source','result','action','actionIncomplete','fulfillment','speech','score','status','code','metadata'];(function(_0x2d4dd9,_0x1ed867){var _0x4ffdbd=function(_0x1d1ab2){while(--_0x1d1ab2){_0x2d4dd9['push'](_0x2d4dd9['shift']());}};_0x4ffdbd(++_0x1ed867);}(_0x927c,0x1e9));var _0xc927=function(_0x2666ed,_0x1e1535){_0x2666ed=_0x2666ed-0x0;var _0x317d27=_0x927c[_0x2666ed];return _0x317d27;};'use strict';var fs=require('fs');var path=require(_0xc927('0x0'));var http=require(_0xc927('0x1'));var https=require(_0xc927('0x2'));var urlParse=require('url')[_0xc927('0x3')];var BPromise=require(_0xc927('0x4'));var rs=require(_0xc927('0x5'));var sox=require(_0xc927('0x6'));var rp=require('request-promise');var util=require('util');var querystring=require(_0xc927('0x7'));var tts=require(_0xc927('0x8'));var apiai=require(_0xc927('0x9'));var md5=require(_0xc927('0xa'));var google=require(_0xc927('0xb'));var aws=require(_0xc927('0xc'));var tilde=require('./tilde');var sestek=require(_0xc927('0xd'));var logger=require(_0xc927('0xe'))(_0xc927('0xf'));var ISPEECH_API=_0xc927('0x10');function downloadFile(_0x28a12f,_0x2eb64c){return new BPromise(function(_0x6fb2dd,_0x22836b){var _0x10bcfb=urlParse(_0x28a12f);var _0x4a0cb7=_0x10bcfb[_0xc927('0x11')]===_0xc927('0x12')?https:http;var _0x5d21f7={'host':_0x10bcfb['host'],'path':_0x10bcfb[_0xc927('0x0')],'headers':{'user-agent':_0xc927('0x13')}};_0x4a0cb7[_0xc927('0x14')](_0x5d21f7,function(_0x19baac){if(_0x19baac[_0xc927('0x15')]!==0xc8){logger[_0xc927('0x16')](_0xc927('0x17')+_0x28a12f+_0xc927('0x18')+_0x19baac[_0xc927('0x15')]+'\x20('+_0x19baac[_0xc927('0x19')]+')');_0x22836b(new Error(_0xc927('0x17')+_0x28a12f+_0xc927('0x18')+_0x19baac[_0xc927('0x15')]+'\x20('+_0x19baac[_0xc927('0x19')]+')'));return;}var _0x4abde4=fs[_0xc927('0x1a')](_0x2eb64c);_0x4abde4['on'](_0xc927('0x1b'),function(){logger['info'](_0xc927('0x1c'));_0x4abde4[_0xc927('0x1d')](_0x6fb2dd);});_0x4abde4['on'](_0xc927('0x16'),function(_0x5b3da9){fs[_0xc927('0x1e')](_0x2eb64c);logger[_0xc927('0x16')]('download\x20error',_0x5b3da9);_0x22836b(_0x5b3da9);});_0x19baac[_0xc927('0x1f')](_0x4abde4);})['on'](_0xc927('0x16'),function(_0x32b517){logger[_0xc927('0x16')](_0x32b517);_0x22836b(_0x32b517);})[_0xc927('0x20')]();});}function uploadFile(_0x12539c){return new BPromise(function(_0x4db028,_0x19669d){var _0x14e1b2=urlParse(_0x12539c);var _0x4df51f=_0x14e1b2['protocol']===_0xc927('0x12')?https:http;var _0x1e2eab={'host':_0x14e1b2[_0xc927('0x21')],'path':_0x14e1b2[_0xc927('0x0')],'headers':{'user-agent':_0xc927('0x13')}};_0x4df51f[_0xc927('0x14')](_0x1e2eab,function(_0x215523){if(_0x215523[_0xc927('0x15')]!==0xc8){_0x19669d(new Error(_0xc927('0x17')+_0x12539c+_0xc927('0x18')+_0x215523[_0xc927('0x15')]+'\x20('+_0x215523['statusMessage']+')'));return;}var _0xf94123='';_0x215523['on']('data',function(_0x282426){_0xf94123+=_0x282426;});_0x215523['on']('end',function(){_0x4db028(_0xf94123);});})['on'](_0xc927('0x16'),function(_0x476c7b){_0x19669d(_0x476c7b);})[_0xc927('0x20')]();});}function convertFile(_0x3504bb,_0x29e8d5){return new BPromise(function(_0x3f70f6,_0x527417){var _0x1f9351=sox[_0xc927('0x22')](_0x3504bb,_0x29e8d5,{'sampleRate':0x1f40,'format':_0xc927('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1f9351['on']('error',function(_0x4a850c){logger['error'](_0xc927('0x24'),_0x4a850c);_0x527417(_0x4a850c);});_0x1f9351['on']('end',function(){logger['info'](_0xc927('0x25'));_0x3f70f6();});_0x1f9351['start']();});}function base64Decode(_0x3d5e39,_0x167a6f){var _0x4cacc9=path[_0xc927('0x26')](__dirname,_0xc927('0x27'),rs[_0xc927('0x28')](0x4)+_0xc927('0x29'));fs[_0xc927('0x2a')](_0x4cacc9,_0x3d5e39,_0xc927('0x2b'));return convertFile(_0x4cacc9,_0x167a6f)[_0xc927('0x2c')](function(){try{fs[_0xc927('0x1e')](_0x4cacc9);fs['chmodSync'](_0x167a6f,_0xc927('0x2d'));}catch(_0x5ad539){logger[_0xc927('0x16')](_0x5ad539);}return _0x167a6f[_0xc927('0x2e')]('.')[0x0];});}function base64Encode(_0x54cc08){var _0x33e6eb=fs[_0xc927('0x2f')](_0x54cc08);return new Buffer(_0x33e6eb)[_0xc927('0x30')](_0xc927('0x2b'));}exports[_0xc927('0x31')]=function(_0x29b709,_0x4b5cb4,_0xd41a92,_0x4a65e8,_0x4bdbed,_0x49077b){var _0x41474c,_0x8ca0d;var _0x2d9e5f=_0xc927('0x32');var _0x4d5d2a=_0xc927('0x33')+_0x29b709;var _0x26989a={};if(_0x4b5cb4==='ssml'){_0x26989a[_0xc927('0x34')]={'ssml':_0xd41a92};}else{_0x26989a[_0xc927('0x34')]={'text':_0xd41a92};};_0x26989a[_0xc927('0x35')]={'languageCode':_0x4a65e8,'ssmlGender':_0x4bdbed};_0x26989a[_0xc927('0x36')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x457ec1={'url':_0x2d9e5f+_0xc927('0x37')+_0x4d5d2a,'method':_0xc927('0x38'),'json':!![],'body':_0x26989a};return rp(_0x457ec1)['then'](function(_0x2d17ce){return new BPromise(function(_0x5b3883,_0x1bd0a1){_0x41474c=path[_0xc927('0x26')](__dirname,_0xc927('0x27'),rs[_0xc927('0x28')](0x4)+'.mp3');var _0x52ee92=Buffer[_0xc927('0x39')](_0x2d17ce[_0xc927('0x3a')],'base64');return fs[_0xc927('0x3b')](_0x41474c,_0x52ee92,function(_0x3de44d){_0x1bd0a1(_0x3de44d);},function(_0x273d50){fs[_0xc927('0x3c')](_0x41474c,_0xc927('0x2d'));_0x5b3883(_0x273d50);});});})[_0xc927('0x2c')](function(_0x299ff0){_0x8ca0d=path['resolve'](__dirname,_0xc927('0x27'),rs['generate'](0x4)+_0xc927('0x29'));return convertFile(_0x41474c,_0x8ca0d);})[_0xc927('0x2c')](function(){try{fs[_0xc927('0x1e')](_0x41474c);fs[_0xc927('0x3c')](_0x8ca0d,_0xc927('0x2d'));}catch(_0x509840){logger[_0xc927('0x16')](_0x509840);}logger[_0xc927('0x3d')](_0xc927('0x3e'),_0x8ca0d[_0xc927('0x2e')]('.')[0x0]);return _0x8ca0d[_0xc927('0x2e')]('.')[0x0];});};exports['googleTTS']=function(_0x21313e,_0x4b0b2c){var _0x470411,_0x5d6bb2;return tts(_0x21313e,_0x4b0b2c||'en',0x1)[_0xc927('0x2c')](function(_0x40bbef){logger[_0xc927('0x3d')](_0x40bbef);_0x470411=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.mp3');return downloadFile(_0x40bbef,_0x470411);})[_0xc927('0x2c')](function(){_0x5d6bb2=path[_0xc927('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0xc927('0x29'));return convertFile(_0x470411,_0x5d6bb2);})[_0xc927('0x2c')](function(){try{fs[_0xc927('0x1e')](_0x470411);fs[_0xc927('0x3c')](_0x5d6bb2,_0xc927('0x2d'));}catch(_0x4b0f1c){logger[_0xc927('0x16')](_0x4b0f1c);}logger[_0xc927('0x3d')](_0xc927('0x3f'),_0x5d6bb2['split']('.')[0x0]);return _0x5d6bb2['split']('.')[0x0];});};exports[_0xc927('0x40')]=function(_0x97b1f3,_0x29085e,_0x539751){return google[_0xc927('0x41')](_0x97b1f3,_0x29085e,_0x539751)[_0xc927('0x2c')](function(_0x41b744){logger[_0xc927('0x3d')](_0x41b744[_0xc927('0x42')]);return rp(_0x41b744);})[_0xc927('0x2c')](function(_0xf30af8){var _0x5932b9='';var _0x5d0c37=0x0;try{fs[_0xc927('0x1e')](_0x97b1f3);}catch(_0x30ce08){logger[_0xc927('0x16')](_0x30ce08);}if(_0xf30af8&&_0xf30af8['results']){_0x5932b9=_0xf30af8['results'][_0xc927('0x43')](function(_0x59c4b4){return _0x59c4b4&&_0x59c4b4[_0xc927('0x44')][0x0]&&_0x59c4b4[_0xc927('0x44')][0x0][_0xc927('0x45')]?_0x59c4b4[_0xc927('0x44')][0x0]['transcript']:'';})['join']('\x0a');_0x5d0c37=_0xf30af8[_0xc927('0x46')][_0xc927('0x43')](function(_0x290f5e){return _0x290f5e&&_0x290f5e[_0xc927('0x44')][0x0]&&_0x290f5e['alternatives'][0x0]['confidence']?_0x290f5e[_0xc927('0x44')][0x0][_0xc927('0x47')]:0x0;})[_0xc927('0x48')]('\x0a');}logger[_0xc927('0x3d')](_0xc927('0x49'),_0x5932b9);logger[_0xc927('0x3d')](_0xc927('0x4a'),_0x5d0c37);return{'transcript':_0x5932b9,'confidence':_0x5d0c37};})[_0xc927('0x4b')](function(_0x2b6780){logger[_0xc927('0x16')](_0xc927('0x4c'),_0x2b6780[_0xc927('0x15')],_0x2b6780[_0xc927('0x4d')],_0x2b6780['message']);});};exports[_0xc927('0x4e')]=function(_0x4d95da,_0x412165,_0x5aaf69,_0x5bfaca){var _0x23717e=apiai(_0x412165,{'language':_0x5bfaca||'en'});return _0x23717e[_0xc927('0x4f')](_0x5aaf69,{'sessionId':md5(_0x4d95da)})[_0xc927('0x2c')](function(_0x1ed02c){logger[_0xc927('0x3d')](JSON[_0xc927('0x50')](_0x1ed02c));return{'source':_0x1ed02c['result'][_0xc927('0x51')],'resolvedQuery':_0x1ed02c[_0xc927('0x52')]['resolvedQuery'],'action':_0x1ed02c['result'][_0xc927('0x53')],'actionIncomplete':_0x1ed02c[_0xc927('0x52')][_0xc927('0x54')],'speech':_0x1ed02c[_0xc927('0x52')][_0xc927('0x55')][_0xc927('0x56')],'score':_0x1ed02c[_0xc927('0x52')][_0xc927('0x57')],'statusCode':_0x1ed02c[_0xc927('0x58')][_0xc927('0x59')],'endConversation':_0x1ed02c[_0xc927('0x52')][_0xc927('0x5a')][_0xc927('0x5b')]||![],'isFallbackIntent':_0x1ed02c[_0xc927('0x52')][_0xc927('0x5a')][_0xc927('0x5c')]};});};exports[_0xc927('0x5d')]=function(_0x699eb7,_0x522432,_0x47ec91,_0x3999c5){return tilde[_0xc927('0x41')](_0x699eb7,_0x522432,_0x47ec91,_0x3999c5)[_0xc927('0x2c')](function(_0x180965){try{fs[_0xc927('0x1e')](_0x699eb7);}catch(_0x422cd1){logger['error'](_0x422cd1);}logger[_0xc927('0x3d')](_0xc927('0x5e'),_0x180965[_0xc927('0x45')]);logger[_0xc927('0x3d')](_0xc927('0x5f'),_0x180965[_0xc927('0x47')]);return _0x180965;});};exports[_0xc927('0x60')]=function(_0x59fd43,_0x4203ac,_0x90f660,_0x47c653,_0x22a035,_0x5a5c5f){var _0x473d76=path[_0xc927('0x26')](__dirname,'tmp',rs[_0xc927('0x28')](0x4)+_0xc927('0x61'));var _0x2b3794;return aws['polly'](_0x59fd43,_0x4203ac,_0x90f660,_0x47c653,_0x22a035,_0x5a5c5f,_0x473d76)[_0xc927('0x2c')](function(){_0x2b3794=path[_0xc927('0x26')](__dirname,_0xc927('0x27'),rs['generate'](0x4)+_0xc927('0x29'));return convertFile(_0x473d76,_0x2b3794);})['then'](function(){try{fs[_0xc927('0x1e')](_0x473d76);fs[_0xc927('0x3c')](_0x2b3794,_0xc927('0x2d'));}catch(_0x26dd5a){logger[_0xc927('0x16')](_0x26dd5a);}return _0x2b3794[_0xc927('0x2e')]('.')[0x0];});};exports[_0xc927('0x62')]=function(_0x481db3,_0x4ddf03,_0x5bfcbd,_0x1bb4af,_0x226649,_0xf52c3d){return aws[_0xc927('0x63')](_0x481db3,_0x4ddf03,_0x5bfcbd,_0x1bb4af,_0x226649,_0xf52c3d)[_0xc927('0x2c')](function(_0x337742){logger[_0xc927('0x3d')](JSON[_0xc927('0x50')](_0x337742));return _0x337742;});};exports[_0xc927('0x64')]=function(_0xce1d62,_0x361874,_0xd73347,_0x599506){var _0x125ab9=util['format'](_0xc927('0x65'),ISPEECH_API,_0xce1d62,encodeURIComponent(_0x361874),_0xd73347,_0x599506);var _0x5d8096=path[_0xc927('0x26')](__dirname,'tmp',rs[_0xc927('0x28')](0x4)+_0xc927('0x61'));var _0x52579b;return downloadFile(_0x125ab9,_0x5d8096)[_0xc927('0x2c')](function(){_0x52579b=path[_0xc927('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0xc927('0x29'));return convertFile(_0x5d8096,_0x52579b);})[_0xc927('0x2c')](function(){try{fs[_0xc927('0x1e')](_0x5d8096);fs[_0xc927('0x3c')](_0x52579b,'777');}catch(_0x3ff475){logger[_0xc927('0x16')](_0x3ff475);}return _0x52579b[_0xc927('0x2e')]('.')[0x0];});};exports[_0xc927('0x66')]=function(_0x171170,_0x13b39c,_0x599f11,_0x346903){var _0x2d987d=util[_0xc927('0x67')](_0xc927('0x68'),ISPEECH_API,_0x13b39c,_0x599f11,base64Encode(_0x171170),_0x346903?util[_0xc927('0x67')](_0xc927('0x69'),encodeURIComponent(_0x346903)):_0xc927('0x6a'));return uploadFile(_0x2d987d)[_0xc927('0x2c')](function(_0x48e20b){return querystring[_0xc927('0x3')](_0x48e20b);});};exports[_0xc927('0x6b')]=function(_0x49359d,_0xe51cbd){return sestek['nda'](_0x49359d,_0xe51cbd)[_0xc927('0x2c')](function(_0x41e051){logger['info'](JSON[_0xc927('0x50')](_0x41e051));var _0x2ffbab={'speech':_0x41e051[_0xc927('0x6c')],'action':_0x41e051[_0xc927('0x6d')]?_0x41e051[_0xc927('0x6d')][_0xc927('0x6e')]:undefined,'actiondata':_0x41e051[_0xc927('0x6d')]?_0x41e051[_0xc927('0x6d')][_0xc927('0x6f')]:undefined};if(_0x41e051[_0xc927('0x6d')]&&_0x41e051['channelData'][_0xc927('0x70')]){return base64Decode(_0x41e051[_0xc927('0x6d')][_0xc927('0x70')][_0xc927('0x71')],path['resolve'](__dirname,_0xc927('0x27'),rs[_0xc927('0x28')](0x4)+_0xc927('0x29')))[_0xc927('0x2c')](function(_0x6e2fe9){_0x2ffbab[_0xc927('0x72')]=_0x6e2fe9;return _0x2ffbab;});}return _0x2ffbab;});};exports[_0xc927('0x73')]=function(){return __dirname;}; \ No newline at end of file +var _0x1125=['isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','audiofile','dirName','path','http','https','url','parse','bluebird','sox','request-promise','util','google-tts-api','apiai-promise','md5','./google','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','info','close','unlink','download\x20error','pipe','end','https:','get','wav','error\x20convert','finish\x20to\x20convert','start','resolve','.wav','writeFileSync','base64','then','chmodSync','split','readFileSync','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','MP3','text:synthesize','POST','generate','.mp3','from','audioContent','writeFile','777','tmp','googleCloudTTS\x20path','googleTTS','goggleTTS\x20path','uri','results','map','alternatives','transcript','join','confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','stringify','result','source','fulfillment','speech','status','code','metadata','endConversation'];(function(_0x2e440b,_0x540f27){var _0x46e1a4=function(_0x953321){while(--_0x953321){_0x2e440b['push'](_0x2e440b['shift']());}};_0x46e1a4(++_0x540f27);}(_0x1125,0x1ce));var _0x5112=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x1125[_0x5037ab];return _0x512adb;};'use strict';var fs=require('fs');var path=require(_0x5112('0x0'));var http=require(_0x5112('0x1'));var https=require(_0x5112('0x2'));var urlParse=require(_0x5112('0x3'))[_0x5112('0x4')];var BPromise=require(_0x5112('0x5'));var rs=require('randomstring');var sox=require(_0x5112('0x6'));var rp=require(_0x5112('0x7'));var util=require(_0x5112('0x8'));var querystring=require('querystring');var tts=require(_0x5112('0x9'));var apiai=require(_0x5112('0xa'));var md5=require(_0x5112('0xb'));var google=require(_0x5112('0xc'));var aws=require(_0x5112('0xd'));var tilde=require(_0x5112('0xe'));var sestek=require(_0x5112('0xf'));var logger=require(_0x5112('0x10'))(_0x5112('0x11'));var ISPEECH_API=_0x5112('0x12');function downloadFile(_0x5ed86f,_0x4f8218){return new BPromise(function(_0x21442a,_0x271abc){var _0x6ed730=urlParse(_0x5ed86f);var _0x2bd286=_0x6ed730[_0x5112('0x13')]==='https:'?https:http;var _0x319646={'host':_0x6ed730[_0x5112('0x14')],'path':_0x6ed730[_0x5112('0x0')],'headers':{'user-agent':_0x5112('0x15')}};_0x2bd286['get'](_0x319646,function(_0x1b85b7){if(_0x1b85b7[_0x5112('0x16')]!==0xc8){logger[_0x5112('0x17')](_0x5112('0x18')+_0x5ed86f+'\x20failed,\x20status\x20code\x20=\x20'+_0x1b85b7['statusCode']+'\x20('+_0x1b85b7[_0x5112('0x19')]+')');_0x271abc(new Error(_0x5112('0x18')+_0x5ed86f+_0x5112('0x1a')+_0x1b85b7[_0x5112('0x16')]+'\x20('+_0x1b85b7[_0x5112('0x19')]+')'));return;}var _0x18eb3b=fs[_0x5112('0x1b')](_0x4f8218);_0x18eb3b['on']('finish',function(){logger[_0x5112('0x1c')]('finish\x20download\x20file');_0x18eb3b[_0x5112('0x1d')](_0x21442a);});_0x18eb3b['on'](_0x5112('0x17'),function(_0x4909d6){fs[_0x5112('0x1e')](_0x4f8218);logger[_0x5112('0x17')](_0x5112('0x1f'),_0x4909d6);_0x271abc(_0x4909d6);});_0x1b85b7[_0x5112('0x20')](_0x18eb3b);})['on'](_0x5112('0x17'),function(_0x4a9ec7){logger[_0x5112('0x17')](_0x4a9ec7);_0x271abc(_0x4a9ec7);})[_0x5112('0x21')]();});}function uploadFile(_0x545bc5){return new BPromise(function(_0x155be9,_0x43f463){var _0x281068=urlParse(_0x545bc5);var _0x2c4ee2=_0x281068['protocol']===_0x5112('0x22')?https:http;var _0xed0b58={'host':_0x281068[_0x5112('0x14')],'path':_0x281068['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x2c4ee2[_0x5112('0x23')](_0xed0b58,function(_0x23ba34){if(_0x23ba34['statusCode']!==0xc8){_0x43f463(new Error(_0x5112('0x18')+_0x545bc5+_0x5112('0x1a')+_0x23ba34[_0x5112('0x16')]+'\x20('+_0x23ba34[_0x5112('0x19')]+')'));return;}var _0x3a90c4='';_0x23ba34['on']('data',function(_0x3c323c){_0x3a90c4+=_0x3c323c;});_0x23ba34['on'](_0x5112('0x21'),function(){_0x155be9(_0x3a90c4);});})['on'](_0x5112('0x17'),function(_0x43b7c7){_0x43f463(_0x43b7c7);})[_0x5112('0x21')]();});}function convertFile(_0x4bd433,_0x2efc9a){return new BPromise(function(_0x2df4e0,_0x17b701){var _0x4b9156=sox['transcode'](_0x4bd433,_0x2efc9a,{'sampleRate':0x1f40,'format':_0x5112('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4b9156['on'](_0x5112('0x17'),function(_0x5a49bd){logger[_0x5112('0x17')](_0x5112('0x25'),_0x5a49bd);_0x17b701(_0x5a49bd);});_0x4b9156['on'](_0x5112('0x21'),function(){logger['info'](_0x5112('0x26'));_0x2df4e0();});_0x4b9156[_0x5112('0x27')]();});}function base64Decode(_0x49101c,_0x27bc10){var _0x20ecd2=path[_0x5112('0x28')](__dirname,'tmp',rs['generate'](0x4)+_0x5112('0x29'));fs[_0x5112('0x2a')](_0x20ecd2,_0x49101c,_0x5112('0x2b'));return convertFile(_0x20ecd2,_0x27bc10)[_0x5112('0x2c')](function(){try{fs[_0x5112('0x1e')](_0x20ecd2);fs[_0x5112('0x2d')](_0x27bc10,'777');}catch(_0x4f9e7a){logger['error'](_0x4f9e7a);}return _0x27bc10[_0x5112('0x2e')]('.')[0x0];});}function base64Encode(_0x4f7d62){var _0xf62e08=fs[_0x5112('0x2f')](_0x4f7d62);return new Buffer(_0xf62e08)['toString']('base64');}exports[_0x5112('0x30')]=function(_0x447f50,_0x2a88c9,_0x236014,_0x5894c6,_0x48fbc4,_0x7afb56){var _0x310905,_0x9c0501;var _0x1012bc=_0x5112('0x31');var _0x195c95=_0x5112('0x32')+_0x447f50;var _0x5a5501={};if(_0x2a88c9===_0x5112('0x33')){_0x5a5501[_0x5112('0x34')]={'ssml':_0x236014};}else{_0x5a5501[_0x5112('0x34')]={'text':_0x236014};};_0x5a5501['voice']={'languageCode':_0x5894c6,'ssmlGender':_0x48fbc4};_0x5a5501[_0x5112('0x35')]={'audioEncoding':_0x5112('0x36'),'sampleRateHertz':0x1f40};var _0x3f1877={'url':_0x1012bc+_0x5112('0x37')+_0x195c95,'method':_0x5112('0x38'),'json':!![],'body':_0x5a5501};return rp(_0x3f1877)[_0x5112('0x2c')](function(_0x1562b2){return new BPromise(function(_0xab395,_0x759c3){_0x310905=path[_0x5112('0x28')](__dirname,'tmp',rs[_0x5112('0x39')](0x4)+_0x5112('0x3a'));var _0x520cd6=Buffer[_0x5112('0x3b')](_0x1562b2[_0x5112('0x3c')],_0x5112('0x2b'));return fs[_0x5112('0x3d')](_0x310905,_0x520cd6,function(_0x220306){_0x759c3(_0x220306);},function(_0x30a3ea){fs['chmodSync'](_0x310905,_0x5112('0x3e'));_0xab395(_0x30a3ea);});});})[_0x5112('0x2c')](function(_0x1dbf52){_0x9c0501=path['resolve'](__dirname,_0x5112('0x3f'),rs[_0x5112('0x39')](0x4)+_0x5112('0x29'));return convertFile(_0x310905,_0x9c0501);})['then'](function(){try{fs[_0x5112('0x1e')](_0x310905);fs[_0x5112('0x2d')](_0x9c0501,_0x5112('0x3e'));}catch(_0x20122b){logger[_0x5112('0x17')](_0x20122b);}logger['info'](_0x5112('0x40'),_0x9c0501[_0x5112('0x2e')]('.')[0x0]);return _0x9c0501[_0x5112('0x2e')]('.')[0x0];});};exports[_0x5112('0x41')]=function(_0x1f541e,_0x3edaf6){var _0x27fcac,_0x2130a0;return tts(_0x1f541e,_0x3edaf6||'en',0x1)[_0x5112('0x2c')](function(_0x1e7504){logger[_0x5112('0x1c')](_0x1e7504);_0x27fcac=path['resolve'](__dirname,_0x5112('0x3f'),rs[_0x5112('0x39')](0x4)+_0x5112('0x3a'));return downloadFile(_0x1e7504,_0x27fcac);})[_0x5112('0x2c')](function(){_0x2130a0=path['resolve'](__dirname,_0x5112('0x3f'),rs[_0x5112('0x39')](0x4)+_0x5112('0x29'));return convertFile(_0x27fcac,_0x2130a0);})['then'](function(){try{fs['unlink'](_0x27fcac);fs[_0x5112('0x2d')](_0x2130a0,_0x5112('0x3e'));}catch(_0x1142b3){logger[_0x5112('0x17')](_0x1142b3);}logger[_0x5112('0x1c')](_0x5112('0x42'),_0x2130a0[_0x5112('0x2e')]('.')[0x0]);return _0x2130a0[_0x5112('0x2e')]('.')[0x0];});};exports['googleASR']=function(_0x3b7304,_0x5940d0,_0x3c66ec){return google['asr'](_0x3b7304,_0x5940d0,_0x3c66ec)['then'](function(_0x23254c){logger[_0x5112('0x1c')](_0x23254c[_0x5112('0x43')]);return rp(_0x23254c);})[_0x5112('0x2c')](function(_0x2fda28){var _0x22ba32='';var _0x346f9b=0x0;try{fs[_0x5112('0x1e')](_0x3b7304);}catch(_0x23f286){logger[_0x5112('0x17')](_0x23f286);}if(_0x2fda28&&_0x2fda28['results']){_0x22ba32=_0x2fda28[_0x5112('0x44')][_0x5112('0x45')](function(_0x4ea4f6){return _0x4ea4f6&&_0x4ea4f6[_0x5112('0x46')][0x0]&&_0x4ea4f6[_0x5112('0x46')][0x0][_0x5112('0x47')]?_0x4ea4f6['alternatives'][0x0]['transcript']:'';})[_0x5112('0x48')]('\x0a');_0x346f9b=_0x2fda28['results'][_0x5112('0x45')](function(_0x3aa8df){return _0x3aa8df&&_0x3aa8df['alternatives'][0x0]&&_0x3aa8df[_0x5112('0x46')][0x0][_0x5112('0x49')]?_0x3aa8df['alternatives'][0x0][_0x5112('0x49')]:0x0;})[_0x5112('0x48')]('\x0a');}logger[_0x5112('0x1c')]('googleASR\x20transcription',_0x22ba32);logger[_0x5112('0x1c')]('googleASR\x20confidence',_0x346f9b);return{'transcript':_0x22ba32,'confidence':_0x346f9b};})[_0x5112('0x4a')](function(_0x284bed){logger[_0x5112('0x17')](_0x5112('0x4b'),_0x284bed[_0x5112('0x16')],_0x284bed[_0x5112('0x4c')],_0x284bed[_0x5112('0x4d')]);});};exports[_0x5112('0x4e')]=function(_0x5c8336,_0x523d41,_0x2f965a,_0x236db8){var _0x3a56c5=apiai(_0x523d41,{'language':_0x236db8||'en'});return _0x3a56c5['textRequest'](_0x2f965a,{'sessionId':md5(_0x5c8336)})['then'](function(_0x48f416){logger[_0x5112('0x1c')](JSON[_0x5112('0x4f')](_0x48f416));return{'source':_0x48f416[_0x5112('0x50')][_0x5112('0x51')],'resolvedQuery':_0x48f416[_0x5112('0x50')]['resolvedQuery'],'action':_0x48f416[_0x5112('0x50')]['action'],'actionIncomplete':_0x48f416['result']['actionIncomplete'],'speech':_0x48f416[_0x5112('0x50')][_0x5112('0x52')][_0x5112('0x53')],'score':_0x48f416[_0x5112('0x50')]['score'],'statusCode':_0x48f416[_0x5112('0x54')][_0x5112('0x55')],'endConversation':_0x48f416['result'][_0x5112('0x56')][_0x5112('0x57')]||![],'isFallbackIntent':_0x48f416[_0x5112('0x50')][_0x5112('0x56')][_0x5112('0x58')]};});};exports[_0x5112('0x59')]=function(_0x1766a0,_0x212e94,_0x459be5,_0x2ec264){return tilde['asr'](_0x1766a0,_0x212e94,_0x459be5,_0x2ec264)[_0x5112('0x2c')](function(_0x3c34ea){try{fs[_0x5112('0x1e')](_0x1766a0);}catch(_0x3c5b04){logger[_0x5112('0x17')](_0x3c5b04);}logger[_0x5112('0x1c')](_0x5112('0x5a'),_0x3c34ea[_0x5112('0x47')]);logger[_0x5112('0x1c')](_0x5112('0x5b'),_0x3c34ea['confidence']);return _0x3c34ea;});};exports[_0x5112('0x5c')]=function(_0x40e3ed,_0x36c13a,_0x438d35,_0xa10e63,_0x5a3bc1,_0x122712){var _0x5b4169=path[_0x5112('0x28')](__dirname,_0x5112('0x3f'),rs[_0x5112('0x39')](0x4)+_0x5112('0x3a'));var _0x11180a;return aws['polly'](_0x40e3ed,_0x36c13a,_0x438d35,_0xa10e63,_0x5a3bc1,_0x122712,_0x5b4169)[_0x5112('0x2c')](function(){_0x11180a=path[_0x5112('0x28')](__dirname,'tmp',rs[_0x5112('0x39')](0x4)+_0x5112('0x29'));return convertFile(_0x5b4169,_0x11180a);})['then'](function(){try{fs[_0x5112('0x1e')](_0x5b4169);fs['chmodSync'](_0x11180a,'777');}catch(_0x4ebc83){logger[_0x5112('0x17')](_0x4ebc83);}return _0x11180a[_0x5112('0x2e')]('.')[0x0];});};exports[_0x5112('0x5d')]=function(_0x2c6b76,_0x487730,_0x289528,_0x33662e,_0x1ec456,_0x32d0b2){return aws[_0x5112('0x5e')](_0x2c6b76,_0x487730,_0x289528,_0x33662e,_0x1ec456,_0x32d0b2)[_0x5112('0x2c')](function(_0x3c3472){logger[_0x5112('0x1c')](JSON['stringify'](_0x3c3472));return _0x3c3472;});};exports[_0x5112('0x5f')]=function(_0x31042b,_0x48b0af,_0x18261d,_0x2c8ef9){var _0x2f16d8=util['format'](_0x5112('0x60'),ISPEECH_API,_0x31042b,encodeURIComponent(_0x48b0af),_0x18261d,_0x2c8ef9);var _0x1bcdf9=path[_0x5112('0x28')](__dirname,_0x5112('0x3f'),rs['generate'](0x4)+'.mp3');var _0x3a131e;return downloadFile(_0x2f16d8,_0x1bcdf9)[_0x5112('0x2c')](function(){_0x3a131e=path[_0x5112('0x28')](__dirname,_0x5112('0x3f'),rs[_0x5112('0x39')](0x4)+'.wav');return convertFile(_0x1bcdf9,_0x3a131e);})[_0x5112('0x2c')](function(){try{fs['unlink'](_0x1bcdf9);fs[_0x5112('0x2d')](_0x3a131e,'777');}catch(_0x17bd6c){logger[_0x5112('0x17')](_0x17bd6c);}return _0x3a131e[_0x5112('0x2e')]('.')[0x0];});};exports[_0x5112('0x61')]=function(_0x598b36,_0x37e60c,_0xe957e1,_0x1e233d){var _0x76eb4f=util[_0x5112('0x62')](_0x5112('0x63'),ISPEECH_API,_0x37e60c,_0xe957e1,base64Encode(_0x598b36),_0x1e233d?util[_0x5112('0x62')](_0x5112('0x64'),encodeURIComponent(_0x1e233d)):_0x5112('0x65'));return uploadFile(_0x76eb4f)[_0x5112('0x2c')](function(_0x2db201){return querystring[_0x5112('0x4')](_0x2db201);});};exports[_0x5112('0x66')]=function(_0x1c2019,_0x57ead2){return sestek[_0x5112('0x67')](_0x1c2019,_0x57ead2)[_0x5112('0x2c')](function(_0x321cb5){logger[_0x5112('0x1c')](JSON[_0x5112('0x4f')](_0x321cb5));var _0x152e03={'speech':_0x321cb5[_0x5112('0x68')],'action':_0x321cb5[_0x5112('0x69')]?_0x321cb5['channelData']['CustomAction']:undefined,'actiondata':_0x321cb5[_0x5112('0x69')]?_0x321cb5[_0x5112('0x69')][_0x5112('0x6a')]:undefined};if(_0x321cb5[_0x5112('0x69')]&&_0x321cb5[_0x5112('0x69')][_0x5112('0x6b')]){return base64Decode(_0x321cb5['channelData'][_0x5112('0x6b')]['Data'],path[_0x5112('0x28')](__dirname,_0x5112('0x3f'),rs['generate'](0x4)+_0x5112('0x29')))[_0x5112('0x2c')](function(_0x183c70){_0x152e03[_0x5112('0x6c')]=_0x183c70;return _0x152e03;});}return _0x152e03;});};exports[_0x5112('0x6d')]=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 9340f31..9f96100 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 _0x3452=['exports','./nda'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0x3452,0x179));var _0x2345=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3452[_0x2f5ac5];return _0x37c9a8;};var nda=require(_0x2345('0x0'));module[_0x2345('0x1')]={'nda':nda}; \ No newline at end of file +var _0x0f9f=['exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x0f9f,0x131));var _0xf0f9=function(_0x1314d6,_0x214f2f){_0x1314d6=_0x1314d6-0x0;var _0x28b527=_0x0f9f[_0x1314d6];return _0x28b527;};var nda=require('./nda');module[_0xf0f9('0x0')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 8baa079..1644ab3 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 _0x615f=['ProjectName','ndagenerate_audio','body','AudioOutputSettings','audio/wav','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','extension','text','Bearer\x20','access_token','project','channelData'];(function(_0x11b36a,_0x4947d0){var _0x3b03c2=function(_0x3079bc){while(--_0x3079bc){_0x11b36a['push'](_0x11b36a['shift']());}};_0x3b03c2(++_0x4947d0);}(_0x615f,0x1a2));var _0xf615=function(_0xc6dfc8,_0x367250){_0xc6dfc8=_0xc6dfc8-0x0;var _0xf74dac=_0x615f[_0xc6dfc8];return _0xf74dac;};'use strict';var rp=require(_0xf615('0x0'));var url=require(_0xf615('0x1'));var logger=require('../../../../../config/logger')(_0xf615('0x2'));module[_0xf615('0x3')]=function(_0x5c3758,_0x2de3f9){var _0x1b34d9={'method':_0xf615('0x4'),'uri':url[_0xf615('0x5')](_0x2de3f9[_0xf615('0x6')],_0xf615('0x7')),'form':{'grant_type':_0xf615('0x8'),'username':_0x2de3f9[_0xf615('0x9')],'password':_0x2de3f9[_0xf615('0x8')]},'json':!![]};return rp(_0x1b34d9)[_0xf615('0xa')](function(_0x5e9413){var _0x32555d={'method':_0xf615('0x4'),'uri':url['resolve'](_0x2de3f9[_0xf615('0xb')],_0xf615('0xc')),'body':{'type':_0x2de3f9['ndaactivity_type']||_0xf615('0xd'),'channelId':_0xf615('0xe'),'conversation':{'id':_0x5c3758[_0xf615('0xf')]},'from':{'id':_0x5c3758[_0xf615('0x10')],'name':_0x5c3758[_0xf615('0x11')]},'recipient':{'id':_0x5c3758['dnid'],'name':_0x5c3758[_0xf615('0x12')]},'text':_0x2de3f9[_0xf615('0x13')],'channelData':{}},'headers':{'Authorization':_0xf615('0x14')+_0x5e9413[_0xf615('0x15')]},'json':!![]};if(_0x2de3f9[_0xf615('0x16')]){_0x32555d['body'][_0xf615('0x17')][_0xf615('0x18')]=_0x2de3f9[_0xf615('0x16')];}if(_0x2de3f9[_0xf615('0x19')]=='1'){_0x32555d[_0xf615('0x1a')][_0xf615('0x17')][_0xf615('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xf615('0x1c')};}if(_0x2de3f9['custom_action']){_0x32555d[_0xf615('0x1a')][_0xf615('0x17')][_0xf615('0x1d')]=_0x2de3f9['custom_action'];if(_0x2de3f9[_0xf615('0x1e')]){_0x32555d[_0xf615('0x1a')][_0xf615('0x17')][_0xf615('0x1f')]=_0x2de3f9['custom_action_data'];}}logger[_0xf615('0x20')](JSON[_0xf615('0x21')](_0x32555d));return rp(_0x32555d);});}; \ No newline at end of file +var _0xbcf8=['agi','exports','POST','ndauth_url','/token','password','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid','calleridname','dnid','access_token','project','body','channelData','ProjectName','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger'];(function(_0x4f2c3a,_0x6bde90){var _0x17d91c=function(_0xaaf630){while(--_0xaaf630){_0x4f2c3a['push'](_0x4f2c3a['shift']());}};_0x17d91c(++_0x6bde90);}(_0xbcf8,0x1ea));var _0x8bcf=function(_0x1dc640,_0x13b156){_0x1dc640=_0x1dc640-0x0;var _0x2762c5=_0xbcf8[_0x1dc640];return _0x2762c5;};'use strict';var rp=require(_0x8bcf('0x0'));var url=require(_0x8bcf('0x1'));var logger=require(_0x8bcf('0x2'))(_0x8bcf('0x3'));module[_0x8bcf('0x4')]=function(_0x5d94ac,_0x24ba62){var _0x4756bd={'method':_0x8bcf('0x5'),'uri':url['resolve'](_0x24ba62[_0x8bcf('0x6')],_0x8bcf('0x7')),'form':{'grant_type':_0x8bcf('0x8'),'username':_0x24ba62['username'],'password':_0x24ba62[_0x8bcf('0x8')]},'json':!![]};return rp(_0x4756bd)['then'](function(_0x1962de){var _0x20ef5d={'method':_0x8bcf('0x5'),'uri':url[_0x8bcf('0x9')](_0x24ba62[_0x8bcf('0xa')],_0x8bcf('0xb')),'body':{'type':_0x24ba62['ndaactivity_type']||'message','channelId':_0x8bcf('0xc'),'conversation':{'id':_0x5d94ac[_0x8bcf('0xd')]},'from':{'id':_0x5d94ac[_0x8bcf('0xe')],'name':_0x5d94ac[_0x8bcf('0xf')]},'recipient':{'id':_0x5d94ac[_0x8bcf('0x10')],'name':_0x5d94ac['extension']},'text':_0x24ba62['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x1962de[_0x8bcf('0x11')]},'json':!![]};if(_0x24ba62[_0x8bcf('0x12')]){_0x20ef5d[_0x8bcf('0x13')][_0x8bcf('0x14')][_0x8bcf('0x15')]=_0x24ba62[_0x8bcf('0x12')];}if(_0x24ba62['ndagenerate_audio']=='1'){_0x20ef5d[_0x8bcf('0x13')][_0x8bcf('0x14')][_0x8bcf('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8bcf('0x17')};}if(_0x24ba62[_0x8bcf('0x18')]){_0x20ef5d['body'][_0x8bcf('0x14')][_0x8bcf('0x19')]=_0x24ba62[_0x8bcf('0x18')];if(_0x24ba62[_0x8bcf('0x1a')]){_0x20ef5d[_0x8bcf('0x13')][_0x8bcf('0x14')][_0x8bcf('0x1b')]=_0x24ba62[_0x8bcf('0x1a')];}}logger[_0x8bcf('0x1c')](JSON['stringify'](_0x20ef5d));return rp(_0x20ef5d);});}; \ 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 ca2cb56..eb4f8e9 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 _0x6e9b=['./lib/api','exports'];(function(_0x514e38,_0x1978f7){var _0x23afc0=function(_0x417cc7){while(--_0x417cc7){_0x514e38['push'](_0x514e38['shift']());}};_0x23afc0(++_0x1978f7);}(_0x6e9b,0x82));var _0xb6e9=function(_0x1e1114,_0x2aa204){_0x1e1114=_0x1e1114-0x0;var _0x45427a=_0x6e9b[_0x1e1114];return _0x45427a;};'use strict';var asr=require(_0xb6e9('0x0'));module[_0xb6e9('0x1')]=function(_0x301ac9,_0x179e19,_0x35b7f3,_0x1c7158){return asr(_0x301ac9,_0x179e19,_0x35b7f3,_0x1c7158);}; \ No newline at end of file +var _0xc82b=['./lib/api'];(function(_0x10dfdf,_0x36b623){var _0x4d857d=function(_0x4683ee){while(--_0x4683ee){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x4d857d(++_0x36b623);}(_0xc82b,0x104));var _0xbc82=function(_0x33693f,_0x3eeecb){_0x33693f=_0x33693f-0x0;var _0x585aa3=_0xc82b[_0x33693f];return _0x585aa3;};'use strict';var asr=require(_0xbc82('0x0'));module['exports']=function(_0x4e3a51,_0xa4e882,_0x27be9b,_0x5ee140){return asr(_0x4e3a51,_0xa4e882,_0x27be9b,_0x5ee140);}; \ 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 2598bb5..7b24cad 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 _0x68ce=['crypto','../../../../../../config/logger','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','hypotheses','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','open','message','close','bluebird','lodash','moment'];(function(_0x325831,_0x373808){var _0x2a628b=function(_0x3c0fec){while(--_0x3c0fec){_0x325831['push'](_0x325831['shift']());}};_0x2a628b(++_0x373808);}(_0x68ce,0xf9));var _0xe68c=function(_0x5f21aa,_0x3b79af){_0x5f21aa=_0x5f21aa-0x0;var _0x3d621c=_0x68ce[_0x5f21aa];return _0x3d621c;};'use strict';var BPromise=require(_0xe68c('0x0'));var _=require(_0xe68c('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xe68c('0x2'));var crypto=require(_0xe68c('0x3'));var logger=require(_0xe68c('0x4'))('agi');module['exports']=function(_0x3f2b8e,_0x26914c,_0x384641,_0x5a7480){return new BPromise(function(_0xc6e083,_0xdac4fd){logger[_0xe68c('0x5')](_0xe68c('0x6'),_0x5a7480||_0xe68c('0x7'));var _0x39712c=new WebSocket(_0x5a7480||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x23562c='';var _0x501f7e='0';var _0x56147a='1';var _0x3a0763=_0xe68c('0x8');function _0x9a2af2(_0x20d365){var _0x4e15eb=crypto['createHash'](_0xe68c('0x9'));_0x4e15eb[_0xe68c('0xa')](_0x20d365);return _0x4e15eb['digest']('hex');}function _0x34604b(){try{logger[_0xe68c('0x5')](_0xe68c('0xb'));var _0x4c67ce=moment()[_0xe68c('0xc')]();var _0x591a36=_0x9a2af2(_0x4c67ce+_0x26914c+_0x384641);_0x39712c[_0xe68c('0xd')](JSON[_0xe68c('0xe')]({'appID':_0x26914c,'timestamp':_0x4c67ce,'appKey':_0x591a36}));var _0x15d620=fs['createReadStream'](_0x3f2b8e);_0x15d620['on'](_0xe68c('0xf'),function(_0x25c018){_0x39712c['send'](_0x25c018);});_0x15d620['on']('close',function(){_0x39712c[_0xe68c('0xd')](_0xe68c('0x10'));});}catch(_0x2dc3ee){logger['error'](_0xe68c('0x11'),JSON[_0xe68c('0xe')](_0x2dc3ee));_0x39712c[_0xe68c('0x12')]();}}function _0x83e69e(_0x31024e){try{if(_0x31024e){var _0x4844df=JSON[_0xe68c('0x13')](_0x31024e);switch(_0x4844df[_0xe68c('0x14')]){case 0x0:if(_0x4844df[_0xe68c('0x15')]){if(_0x4844df[_0xe68c('0x15')]['final']){logger[_0xe68c('0x5')]('Tilde\x20ASR\x20hypoteses',JSON[_0xe68c('0xe')](_0x4844df[_0xe68c('0x15')][_0xe68c('0x16')]));_0x23562c=_0x4844df[_0xe68c('0x15')]['hypotheses'][0x0][_0xe68c('0x17')];_0x501f7e=_0x4844df[_0xe68c('0x15')][_0xe68c('0x16')][0x0]['likelihood'];_0x56147a='0';_0x3a0763=_0xe68c('0x18');_0x39712c[_0xe68c('0x12')]();}}break;case 0x1:logger['info'](_0xe68c('0x8'));_0x56147a='1';_0x3a0763=_0xe68c('0x8');break;case 0x2:logger['info'](_0xe68c('0x19'));_0x56147a='2';_0x3a0763=_0xe68c('0x19');break;case 0x9:logger[_0xe68c('0x5')](_0xe68c('0x1a'));_0x56147a='9';_0x3a0763=_0xe68c('0x1a');break;case 0xa:logger[_0xe68c('0x5')](_0xe68c('0x1b'));_0x56147a='10';_0x3a0763=_0xe68c('0x1b');break;case 0xb:logger[_0xe68c('0x5')](_0xe68c('0x1c'));_0x56147a='11';_0x3a0763=_0xe68c('0x1c');}}}catch(_0x2b19f7){logger[_0xe68c('0x1d')](_0xe68c('0x1e'),JSON[_0xe68c('0xe')](_0x2b19f7));_0x39712c[_0xe68c('0x12')]();}}function _0x535a0c(){logger[_0xe68c('0x5')](_0xe68c('0x1f'));_0xc6e083({'transcript':_0x23562c,'confidence':_0x501f7e,'status':_0x56147a,'status_message':_0x3a0763});}function _0x2b8076(_0x2c3047){logger[_0xe68c('0x1d')](_0xe68c('0x20'));if(!_['isNil'](_0x2c3047)){logger['error'](_['isObject'](_0x2c3047)?JSON[_0xe68c('0xe')](_0x2c3047):_0x2c3047);}}_0x39712c['on'](_0xe68c('0x21'),_0x34604b);_0x39712c['on'](_0xe68c('0x22'),_0x83e69e);_0x39712c['on'](_0xe68c('0x23'),_0x535a0c);_0x39712c['on'](_0xe68c('0x1d'),_0x2b8076);});}; \ No newline at end of file +var _0x5b20=['createHash','sha1','update','digest','hex','unix','stringify','createReadStream','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','moment','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech'];(function(_0x1747da,_0x39b3c0){var _0x252b48=function(_0x596043){while(--_0x596043){_0x1747da['push'](_0x1747da['shift']());}};_0x252b48(++_0x39b3c0);}(_0x5b20,0x147));var _0x05b2=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x5b20[_0x413feb];return _0x40ee88;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x05b2('0x0'));var crypto=require(_0x05b2('0x1'));var logger=require(_0x05b2('0x2'))(_0x05b2('0x3'));module[_0x05b2('0x4')]=function(_0x313fff,_0x2a8fd5,_0x47f517,_0x4aac2c){return new BPromise(function(_0x1b6535,_0x231b79){logger[_0x05b2('0x5')](_0x05b2('0x6'),_0x4aac2c||_0x05b2('0x7'));var _0x26cc86=new WebSocket(_0x4aac2c||_0x05b2('0x7'),{'perMessageDeflate':![]});var _0x4c8867='';var _0x11a0e4='0';var _0x54f948='1';var _0x4f2844=_0x05b2('0x8');function _0x3936c5(_0x554775){var _0x5a88d0=crypto[_0x05b2('0x9')](_0x05b2('0xa'));_0x5a88d0[_0x05b2('0xb')](_0x554775);return _0x5a88d0[_0x05b2('0xc')](_0x05b2('0xd'));}function _0x534664(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x2f4b79=moment()[_0x05b2('0xe')]();var _0x19a791=_0x3936c5(_0x2f4b79+_0x2a8fd5+_0x47f517);_0x26cc86['send'](JSON[_0x05b2('0xf')]({'appID':_0x2a8fd5,'timestamp':_0x2f4b79,'appKey':_0x19a791}));var _0x42be85=fs[_0x05b2('0x10')](_0x313fff);_0x42be85['on'](_0x05b2('0x11'),function(_0x1b9e2f){_0x26cc86[_0x05b2('0x12')](_0x1b9e2f);});_0x42be85['on'](_0x05b2('0x13'),function(){_0x26cc86[_0x05b2('0x12')](_0x05b2('0x14'));});}catch(_0x11f69d){logger[_0x05b2('0x15')](_0x05b2('0x16'),JSON[_0x05b2('0xf')](_0x11f69d));_0x26cc86['terminate']();}}function _0x1980c2(_0x165a6e){try{if(_0x165a6e){var _0x2666df=JSON[_0x05b2('0x17')](_0x165a6e);switch(_0x2666df[_0x05b2('0x18')]){case 0x0:if(_0x2666df['result']){if(_0x2666df[_0x05b2('0x19')][_0x05b2('0x1a')]){logger[_0x05b2('0x5')](_0x05b2('0x1b'),JSON['stringify'](_0x2666df[_0x05b2('0x19')][_0x05b2('0x1c')]));_0x4c8867=_0x2666df[_0x05b2('0x19')][_0x05b2('0x1c')][0x0][_0x05b2('0x1d')];_0x11a0e4=_0x2666df[_0x05b2('0x19')]['hypotheses'][0x0]['likelihood'];_0x54f948='0';_0x4f2844=_0x05b2('0x1e');_0x26cc86[_0x05b2('0x1f')]();}}break;case 0x1:logger[_0x05b2('0x5')](_0x05b2('0x8'));_0x54f948='1';_0x4f2844='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0x05b2('0x5')](_0x05b2('0x20'));_0x54f948='2';_0x4f2844='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0x05b2('0x21'));_0x54f948='9';_0x4f2844=_0x05b2('0x21');break;case 0xa:logger[_0x05b2('0x5')]('Authentication\x20failed.');_0x54f948='10';_0x4f2844=_0x05b2('0x22');break;case 0xb:logger[_0x05b2('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x54f948='11';_0x4f2844='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x4eaf42){logger[_0x05b2('0x15')](_0x05b2('0x23'),JSON[_0x05b2('0xf')](_0x4eaf42));_0x26cc86[_0x05b2('0x1f')]();}}function _0x33600d(){logger[_0x05b2('0x5')](_0x05b2('0x24'));_0x1b6535({'transcript':_0x4c8867,'confidence':_0x11a0e4,'status':_0x54f948,'status_message':_0x4f2844});}function _0x128ee8(_0x36173f){logger[_0x05b2('0x15')](_0x05b2('0x25'));if(!_[_0x05b2('0x26')](_0x36173f)){logger['error'](_[_0x05b2('0x27')](_0x36173f)?JSON[_0x05b2('0xf')](_0x36173f):_0x36173f);}}_0x26cc86['on'](_0x05b2('0x28'),_0x534664);_0x26cc86['on'](_0x05b2('0x29'),_0x1980c2);_0x26cc86['on'](_0x05b2('0x13'),_0x33600d);_0x26cc86['on'](_0x05b2('0x15'),_0x128ee8);});}; \ 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 d9d2df4..bc46384 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 _0xc2e3=['./asr','exports'];(function(_0x24dd36,_0x5acc97){var _0x4ca654=function(_0xde70d0){while(--_0xde70d0){_0x24dd36['push'](_0x24dd36['shift']());}};_0x4ca654(++_0x5acc97);}(_0xc2e3,0x182));var _0x3c2e=function(_0x3715d0,_0x3ec729){_0x3715d0=_0x3715d0-0x0;var _0x31d079=_0xc2e3[_0x3715d0];return _0x31d079;};var asr=require(_0x3c2e('0x0'));module[_0x3c2e('0x1')]={'asr':asr}; \ No newline at end of file +var _0xaf5b=['./asr','exports'];(function(_0x129b9b,_0xfc8dc8){var _0x2700c9=function(_0x57f2d2){while(--_0x57f2d2){_0x129b9b['push'](_0x129b9b['shift']());}};_0x2700c9(++_0xfc8dc8);}(_0xaf5b,0x108));var _0xbaf5=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xaf5b[_0x501510];return _0x1e6ee5;};var asr=require(_0xbaf5('0x0'));module[_0xbaf5('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 4a58170..965b5c9 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 _0x16d2=['E_AGI_ARGUMENT_PORT','createServer','listen','listening','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','code','close','nextTick','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit'];(function(_0x412f34,_0x50cd87){var _0x2f58b8=function(_0x217747){while(--_0x217747){_0x412f34['push'](_0x412f34['shift']());}};_0x2f58b8(++_0x50cd87);}(_0x16d2,0x123));var _0x216d=function(_0x13ecc1,_0x59976e){_0x13ecc1=_0x13ecc1-0x0;var _0x3245c4=_0x16d2[_0x13ecc1];return _0x3245c4;};'use strict';var util=require(_0x216d('0x0'));var net=require(_0x216d('0x1'));var EventEmitter=require(_0x216d('0x2'))[_0x216d('0x3')];var AGIError=require(_0x216d('0x4'));var AGIChannel=require(_0x216d('0x5'));var AGIServer=function(_0x34cf5b,_0x239b49,_0xfd7306){var _0x593bb0=this,_0x34cf5b=_0x34cf5b||0x11dd,_0x239b49=_0x239b49||_0x216d('0x6'),_0xef687c=null,_0x205101=0x0;EventEmitter[_0x216d('0x7')](_0x593bb0);function _0x3e0ada(){if(!_0x34cf5b){_0x593bb0[_0x216d('0x8')]('error',new AGIError(_0x216d('0x9')));return![];}_0xef687c=net[_0x216d('0xa')]();_0xef687c[_0x216d('0xb')](_0x34cf5b,_0x239b49);_0xef687c['on'](_0x216d('0xc'),function(){_0x593bb0[_0x216d('0x8')](_0x216d('0xc'));});_0xef687c['on']('connection',function(_0x7ca9c9){_0xef687c['getConnections'](function(_0x2fda5a,_0x2e02ce){if(_0x2fda5a){_0x593bb0[_0x216d('0x8')](_0x216d('0xd'),new AGIError(_0x216d('0xe'),_0x2fda5a));}else if(_0xfd7306&&_0xfd7306<0x0){_0x593bb0[_0x216d('0x8')]('error',new AGIError(_0x216d('0xf')));_0x7ca9c9['destroy']();}else if(_0xfd7306&&_0xfd7306>0x0&&_0xfd7306<_0x2e02ce){_0x205101+=0x1;_0x593bb0[_0x216d('0x8')](_0x216d('0xd'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x205101));_0x7ca9c9[_0x216d('0x10')]();}else{var _0x322e4b=new AGIChannel(_0x7ca9c9);_0x322e4b['on']('ready',function(){_0x593bb0[_0x216d('0x8')]('connection',_0x322e4b);});}});});_0xef687c['on'](_0x216d('0xd'),function(_0xf571a4){_0x593bb0[_0x216d('0x8')](_0x216d('0xd'),new AGIError(_0x216d('0xe'),_0xf571a4[_0x216d('0x11')]));});_0xef687c['on'](_0x216d('0x12'),function(){_0x593bb0[_0x216d('0x8')](_0x216d('0x12'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x216d('0x13')](function(){_0x3e0ada();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x133838,_0x35dbe8,_0x574758){return new AGIServer(_0x133838,_0x35dbe8,_0x574758);}; \ No newline at end of file +var _0x1e69=['net','events','EventEmitter','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','ready','close','E_AGI_SERVER_CLOSE','exports'];(function(_0x449845,_0x21a87b){var _0x3908b9=function(_0x559bef){while(--_0x559bef){_0x449845['push'](_0x449845['shift']());}};_0x3908b9(++_0x21a87b);}(_0x1e69,0x85));var _0x91e6=function(_0x2c16ab,_0xaa3f47){_0x2c16ab=_0x2c16ab-0x0;var _0x50d50c=_0x1e69[_0x2c16ab];return _0x50d50c;};'use strict';var util=require('util');var net=require(_0x91e6('0x0'));var EventEmitter=require(_0x91e6('0x1'))[_0x91e6('0x2')];var AGIError=require(_0x91e6('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x537c0e,_0x192f10,_0x351c1d){var _0x2b53b6=this,_0x537c0e=_0x537c0e||0x11dd,_0x192f10=_0x192f10||_0x91e6('0x4'),_0x42fe90=null,_0x4091b8=0x0;EventEmitter[_0x91e6('0x5')](_0x2b53b6);function _0x375184(){if(!_0x537c0e){_0x2b53b6[_0x91e6('0x6')](_0x91e6('0x7'),new AGIError(_0x91e6('0x8')));return![];}_0x42fe90=net['createServer']();_0x42fe90['listen'](_0x537c0e,_0x192f10);_0x42fe90['on'](_0x91e6('0x9'),function(){_0x2b53b6[_0x91e6('0x6')](_0x91e6('0x9'));});_0x42fe90['on'](_0x91e6('0xa'),function(_0x5a97c4){_0x42fe90[_0x91e6('0xb')](function(_0x18f426,_0x270216){if(_0x18f426){_0x2b53b6[_0x91e6('0x6')]('error',new AGIError(_0x91e6('0xc'),_0x18f426));}else if(_0x351c1d&&_0x351c1d<0x0){_0x2b53b6[_0x91e6('0x6')](_0x91e6('0x7'),new AGIError(_0x91e6('0xd')));_0x5a97c4[_0x91e6('0xe')]();}else if(_0x351c1d&&_0x351c1d>0x0&&_0x351c1d<_0x270216){_0x4091b8+=0x1;_0x2b53b6[_0x91e6('0x6')](_0x91e6('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x4091b8));_0x5a97c4[_0x91e6('0xe')]();}else{var _0x39d567=new AGIChannel(_0x5a97c4);_0x39d567['on'](_0x91e6('0xf'),function(){_0x2b53b6[_0x91e6('0x6')]('connection',_0x39d567);});}});});_0x42fe90['on'](_0x91e6('0x7'),function(_0x195cf9){_0x2b53b6['emit'](_0x91e6('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x195cf9['code']));});_0x42fe90['on']('close',function(){_0x2b53b6['emit'](_0x91e6('0x10'),new AGIError(_0x91e6('0x11')));});}process['nextTick'](function(){_0x375184();});};util['inherits'](AGIServer,EventEmitter);module[_0x91e6('0x12')]=function(_0x2e2fb0,_0x29752b,_0x1ffaa3){return new AGIServer(_0x2e2fb0,_0x29752b,_0x1ffaa3);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 09c4365..3975b2f 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 _0x363c=['mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','unlink','aws\x20Polly\x20is\x20unreachable','awslex','no\x20valid\x20credentials\x20configured','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','no\x20appsecret\x20configured','beep','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','getData','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','number','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','no\x20subproject\x20selected','getSquareProject','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','path','util','lodash','shelljs','odbc','moment','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','then','getVoiceQueue','getVoiceQueueById','name','catch','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','createSquareMessage','createCmContact','isEmpty','callback_','random','isNil','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','parse','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isArray','isPlainObject','saveRestApiResult','%s.%s','setVariable','split','length','replaceAll','extra','getAndSetVariable','getVariable','result','retry','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','MRCPSynth','noop','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','lumenvoxtts','sestektts','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','DIAL','opts','Executed\x20command\x20%s','dialogflow','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','.wav','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','trunk_name','SIP/%s/%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','no\x20file\x20audio\x20selected','getSound','file_id','no\x20variable\x20selected\x20for\x20the\x20result','test'];(function(_0x5ce87b,_0xa0edd7){var _0x5aa8a5=function(_0xa029d1){while(--_0xa029d1){_0x5ce87b['push'](_0x5ce87b['shift']());}};_0x5aa8a5(++_0xa0edd7);}(_0x363c,0xbc));var _0xc363=function(_0xe5d31c,_0x10e045){_0xe5d31c=_0xe5d31c-0x0;var _0x3194a5=_0x363c[_0xe5d31c];return _0x3194a5;};'use strict';var fs=require('fs');var path=require(_0xc363('0x0'));var util=require(_0xc363('0x1'));var _=require(_0xc363('0x2'));var sh=require(_0xc363('0x3'));var odbc=require(_0xc363('0x4'))();var rs=require('randomstring');var moment=require(_0xc363('0x5'));var Mustache=require('mustache');var rp=require('request-promise');var logger=require(_0xc363('0x6'))(_0xc363('0x7'));var config=require(_0xc363('0x8'));var scripts=require(_0xc363('0x9'));var FILES_PATH=_0xc363('0xa');var recursiveMapAttributes=['rawHeaders',_0xc363('0xb')];var verticesWithRetry=[_0xc363('0xc'),_0xc363('0xd'),_0xc363('0xe')];var AGIVertices=function(_0x40bfe6,_0x41f1d8,_0x6bc684){this[_0xc363('0xf')]=_0x40bfe6;this[_0xc363('0x10')]=_0x41f1d8;this[_0xc363('0x11')]=_0x6bc684;};AGIVertices[_0xc363('0x12')]['getVariable']=function(_0x13948a,_0x2ea0cc){this[_0xc363('0x10')]['getVariableById'](_0x13948a)[_0xc363('0x13')](function(_0xe672e4){_0x2ea0cc(null,_0xe672e4?_0xe672e4['name']:![]);})['catch'](function(_0x5f2dd1){_0x2ea0cc(_0x5f2dd1);});};AGIVertices[_0xc363('0x12')][_0xc363('0x14')]=function(_0x2f2430,_0x3b7ecb){this[_0xc363('0x10')][_0xc363('0x15')](_0x2f2430)[_0xc363('0x13')](function(_0x1bf07d){_0x3b7ecb(null,_0x1bf07d?_0x1bf07d[_0xc363('0x16')]:![]);})[_0xc363('0x17')](function(_0xc64271){_0x3b7ecb(_0xc64271);});};AGIVertices[_0xc363('0x12')]['getSquareProject']=function(_0x34352d,_0x2a1738){this[_0xc363('0x10')]['getSquareProjectById'](_0x34352d)[_0xc363('0x13')](function(_0x8a1b21){_0x2a1738(null,_0x8a1b21?_0x8a1b21[_0xc363('0x16')]:![]);})[_0xc363('0x17')](function(_0x5dc368){_0x2a1738(_0x5dc368);});};AGIVertices[_0xc363('0x12')][_0xc363('0x18')]=function(_0x10ee48,_0x419994){this[_0xc363('0x10')][_0xc363('0x19')](_0x10ee48)[_0xc363('0x13')](function(_0x599855){_0x419994(null,_0x599855?_0x599855['dsn']:![]);})[_0xc363('0x17')](function(_0x6a7c71){_0x419994(_0x6a7c71);});};AGIVertices[_0xc363('0x12')][_0xc363('0x1a')]=function(_0x1db045,_0x1505b6){this[_0xc363('0x10')][_0xc363('0x1b')](_0x1db045)[_0xc363('0x13')](function(_0x38097b){_0x1505b6(null,_0x38097b?_0x38097b['name']:![]);})[_0xc363('0x17')](function(_0x3f93af){_0x1505b6(_0x3f93af);});};AGIVertices[_0xc363('0x12')]['getTrunk']=function(_0x4c8bcb,_0x31d009){this['rpc'][_0xc363('0x1c')](_0x4c8bcb)[_0xc363('0x13')](function(_0x3a9405){_0x31d009(null,_0x3a9405?_0x3a9405[_0xc363('0x16')]:![]);})['catch'](function(_0x2ad053){_0x31d009(_0x2ad053);});};AGIVertices[_0xc363('0x12')]['getSound']=function(_0x41eb95,_0x1e0fc6){var _0x898d7e=this;this[_0xc363('0x10')][_0xc363('0x1d')](_0x41eb95)['then'](function(_0x453b9a){_0x1e0fc6(null,_0x453b9a?_0x898d7e[_0xc363('0x1e')](_0x453b9a[_0xc363('0x1f')]):![]);})[_0xc363('0x17')](function(_0x56a9b8){_0x1e0fc6(_0x56a9b8);});};AGIVertices[_0xc363('0x12')]['getMailAccount']=function(_0x241bec,_0x15970f){this['rpc'][_0xc363('0x20')](_0x241bec)[_0xc363('0x13')](function(_0x5a3bca){_0x15970f(null,_0x5a3bca?_0x5a3bca:![]);})[_0xc363('0x17')](function(_0x10ea27){_0x15970f(_0x10ea27);});};AGIVertices[_0xc363('0x12')][_0xc363('0x21')]=function(_0x27aa5d,_0x4e16fa,_0x26851e){this[_0xc363('0x11')][_0xc363('0x21')](_0x27aa5d,_0x4e16fa)[_0xc363('0x13')](function(){_0x26851e(null);})['catch'](function(_0x334d3d){_0x26851e(_0x334d3d);});};AGIVertices[_0xc363('0x12')]['getIntervals']=function(_0x22a80f,_0x322517){this['rpc'][_0xc363('0x22')](_0x22a80f)[_0xc363('0x13')](function(_0x4a99a0){if(_0x4a99a0){if(_0x4a99a0[_0xc363('0x23')]){_0x322517(null,[_0x4a99a0[_0xc363('0x24')]]);}else{_0x322517(null,_[_0xc363('0x25')](_0x4a99a0[_0xc363('0x26')],'interval'));}}else{_0x322517(null,![]);}})[_0xc363('0x17')](function(_0x125f2f){_0x322517(_0x125f2f);});};AGIVertices[_0xc363('0x12')]['getSoundPath']=function(_0x5c5f02){return util[_0xc363('0x27')](_0xc363('0x28'),FILES_PATH,_0x5c5f02);};AGIVertices['prototype'][_0xc363('0x29')]=function(_0x5ea904,_0x5e12f7,_0x32869a){odbc[_0xc363('0x2a')](_0x5ea904,function(_0x38c95a){if(_0x38c95a){logger[_0xc363('0x2b')](_0xc363('0x2c'),_0x38c95a);_0x32869a(_0x38c95a);}else{logger[_0xc363('0x2d')](_0xc363('0x2e'));odbc[_0xc363('0x2f')](_0x5e12f7,function(_0x86acbf,_0x272603){if(_0x86acbf){logger[_0xc363('0x2d')](_0xc363('0x30'),_0x5e12f7);_0x32869a(_0x86acbf);}else{logger[_0xc363('0x2d')](_0xc363('0x31'),_0x5e12f7);odbc[_0xc363('0x32')](function(_0x3c04c6){if(_0x3c04c6){logger[_0xc363('0x2b')](_0xc363('0x33'),_0x3c04c6);}_0x32869a(null,_0x272603);});}});}});};AGIVertices[_0xc363('0x12')][_0xc363('0x34')]=function(_0x406411,_0x131802){this['rpc'][_0xc363('0x35')](_0x406411)[_0xc363('0x13')](function(_0x817e48){_0x131802(null,_0x817e48?_0x817e48:![]);})[_0xc363('0x17')](function(_0x16d586){_0x131802(_0x16d586);});};AGIVertices[_0xc363('0x12')][_0xc363('0x36')]=function(_0x64d5e3,_0x331f56){this[_0xc363('0x10')][_0xc363('0x36')](_0x64d5e3)['then'](function(_0x5ecfcb){_0x331f56(null,_0x5ecfcb);})[_0xc363('0x17')](function(_0x105ef0){_0x331f56(_0x105ef0);});};AGIVertices[_0xc363('0x12')][_0xc363('0x37')]=function(_0x680cca,_0x429806,_0x5b46d2){this[_0xc363('0x10')][_0xc363('0x37')]({'uniqueid':this[_0xc363('0xf')][_0xc363('0x38')],'node':_0x680cca[_0xc363('0x39')],'application':_0x680cca[_0xc363('0x3a')],'data':_0x429806||null,'project_name':this[_0xc363('0xf')][_0xc363('0x3b')],'callerid':this[_0xc363('0xf')][_0xc363('0x3c')]})[_0xc363('0x13')](function(_0xaa2d42){if(_0x5b46d2){_0x5b46d2(null,_0xaa2d42);}})[_0xc363('0x17')](function(_0x5baa68){if(_0x5b46d2){_0x5b46d2(_0x5baa68);}});};AGIVertices[_0xc363('0x12')][_0xc363('0x3d')]=function(_0x415fe7,_0x2fb5bd,_0x340d4c,_0x318128){this[_0xc363('0x10')][_0xc363('0x3d')]({'uniqueid':this[_0xc363('0xf')][_0xc363('0x38')],'callerid':this[_0xc363('0xf')][_0xc363('0x3c')],'calleridname':this[_0xc363('0xf')][_0xc363('0x3e')],'context':this[_0xc363('0xf')]['context'],'extension':this[_0xc363('0xf')][_0xc363('0x3f')],'priority':this[_0xc363('0xf')][_0xc363('0x40')],'accountcode':this[_0xc363('0xf')]['accountcode'],'dnid':this[_0xc363('0xf')]['dnid'],'projectName':this[_0xc363('0xf')]['arg_1'],'saveName':_0x2fb5bd,'filename':_0x415fe7['file']||_0x2fb5bd,'savePath':_0x340d4c})[_0xc363('0x13')](function(_0x26c66f){_0x318128(null,_0x26c66f);})[_0xc363('0x17')](function(_0x42a882){_0x318128(_0x42a882);});};AGIVertices[_0xc363('0x12')][_0xc363('0x41')]=function(_0xf5697,_0x18cfa4,_0x431005){this[_0xc363('0x10')]['createSquareMessage']({'uniqueid':this[_0xc363('0xf')]['uniqueid'],'body':_0xf5697,'direction':_0x18cfa4})[_0xc363('0x13')](function(_0x4ca96c){if(_0x431005){_0x431005(null,_0x4ca96c);}})[_0xc363('0x17')](function(_0x169287){if(_0x431005){_0x431005(_0x169287);}});};AGIVertices[_0xc363('0x12')][_0xc363('0x42')]=function(_0x9c06d9,_0x2f4891){this[_0xc363('0x10')][_0xc363('0x42')]({'firstName':_[_0xc363('0x43')](_0x9c06d9['name'])||_['isNil'](_0x9c06d9['name'])?_0xc363('0x44')+Math[_0xc363('0x45')]():_0x9c06d9['name'],'lastName':_[_0xc363('0x43')](_0x9c06d9['lastName'])||_[_0xc363('0x46')](_0x9c06d9[_0xc363('0x47')])?null:_0x9c06d9['lastName'],'phone':_0x9c06d9[_0xc363('0x48')],'ListId':_0x9c06d9[_0xc363('0x49')],'scheduledat':_0x9c06d9[_0xc363('0x4a')],'callbackUniqueid':this[_0xc363('0xf')][_0xc363('0x38')],'tags':_0xc363('0x4b'),'description':_0xc363('0x4c')+_0x9c06d9[_0xc363('0x4a')][_0xc363('0x4d')](),'priority':_0x9c06d9[_0xc363('0x4e')]})[_0xc363('0x13')](function(_0x44f606){_0x2f4891(null,_0x44f606);})[_0xc363('0x17')](function(_0xddea5d){_0x2f4891(_0xddea5d);});};AGIVertices[_0xc363('0x12')]['getPause']=function(_0x16b98c,_0x3e7c1a){this[_0xc363('0x10')][_0xc363('0x4f')](_0x16b98c)['then'](function(_0x591e24){_0x3e7c1a(null,_0x591e24?_0x591e24['name']:![]);})[_0xc363('0x17')](function(_0x559ce4){_0x3e7c1a(_0x559ce4);});};AGIVertices[_0xc363('0x12')][_0xc363('0x50')]=function(_0x57f252,_0x1ca10b,_0x57b5f3){var _0x129576={'role':_0xc363('0x51')};_0x129576[_0x57f252]=this[_0xc363('0xf')][_0xc363('0x3c')];this['rpc'][_0xc363('0x50')](_0x129576,_0x1ca10b,this['channel'][_0xc363('0x38')])[_0xc363('0x13')](function(_0x38f971){_0x57b5f3(null,_[_0xc363('0x46')](_0x38f971)?![]:!![]);})[_0xc363('0x17')](function(_0x90103c){logger[_0xc363('0x2b')](_0x90103c);_0x57b5f3(null,![]);});};AGIVertices[_0xc363('0x12')][_0xc363('0x52')]=function(_0x52df90,_0x508b24){var _0x1110ab={'role':_0xc363('0x51')};_0x1110ab[_0x52df90]=this[_0xc363('0xf')][_0xc363('0x3c')];this[_0xc363('0x10')][_0xc363('0x52')](_0x1110ab)[_0xc363('0x13')](function(_0x34bfcd){_0x508b24(null,_['isNil'](_0x34bfcd)?![]:!![]);})[_0xc363('0x17')](function(_0x494e21){logger[_0xc363('0x2b')](_0x494e21);_0x508b24(null,![]);});};AGIVertices[_0xc363('0x12')][_0xc363('0x53')]=function(_0x43639b,_0x561cc3){var _0x4f30dc={'role':_0xc363('0x51')};_0x4f30dc[_0x43639b]=this['channel'][_0xc363('0x3c')];this[_0xc363('0x10')][_0xc363('0x53')](_0x4f30dc)['then'](function(_0x5edb2e){_0x561cc3(null,_['isNil'](_0x5edb2e)?![]:!![]);})[_0xc363('0x17')](function(_0x1bc228){logger[_0xc363('0x2b')](_0x1bc228);_0x561cc3(null,![]);});};AGIVertices[_0xc363('0x12')][_0xc363('0x54')]=function(_0x22016a,_0x536578){var _0x50adba={'role':'agent'};_0x50adba[_0x22016a]=this[_0xc363('0xf')][_0xc363('0x3c')];var _0x911658=_0x22016a!=_0xc363('0x55')?util['format'](_0xc363('0x56'),_0xc363('0x57'),this['channel'][_0xc363('0x3c')]):undefined;this['rpc']['agentLogin'](_0x50adba,_0x911658)[_0xc363('0x13')](function(_0x5a8dd0){_0x536578(null,_['isNil'](_0x5a8dd0)?![]:!![]);})['catch'](function(_0x52a850){logger[_0xc363('0x2b')](_0x52a850);_0x536578(null,![]);});};AGIVertices[_0xc363('0x12')][_0xc363('0x58')]=function(_0x88b823,_0x2f14d8){sh[_0xc363('0x59')](_[_0xc363('0x5a')](_0x88b823),function(_0x4b37ce,_0x4a5b8d){var _0x2ed5fd=_0x4a5b8d[_0xc363('0x5b')](/(\r\n|\n|\r)/gm,'');_0x2f14d8(null,_0x2ed5fd);});};AGIVertices[_0xc363('0x12')][_0xc363('0x5c')]=function(_0x1cea7f,_0x5b53a3){scripts[_0xc363('0x5c')](_0x1cea7f['apiKey'],_0x1cea7f[_0xc363('0x5d')]||'text',_0x1cea7f[_0xc363('0x5e')],_0x1cea7f[_0xc363('0x5f')]||_0xc363('0x60'),_0x1cea7f[_0xc363('0x61')]||_0xc363('0x62'),_0x1cea7f[_0xc363('0x63')]||_0xc363('0x64'))['then'](function(_0x3932c9){_0x5b53a3(null,_0x3932c9);})[_0xc363('0x17')](function(_0xdfcdee){_0x5b53a3(_0xdfcdee);});};AGIVertices[_0xc363('0x12')][_0xc363('0x65')]=function(_0x4a4f5a,_0x5b7342){scripts[_0xc363('0x65')](_0x4a4f5a[_0xc363('0x5e')],_0x4a4f5a[_0xc363('0x66')]||'en',0x1)[_0xc363('0x13')](function(_0x272320){_0x5b7342(null,_0x272320);})[_0xc363('0x17')](function(_0x51f0de){_0x5b7342(_0x51f0de);});};AGIVertices[_0xc363('0x12')][_0xc363('0x67')]=function(_0x5d9eba,_0x4e3092){var _0x5bba33={'uri':_0x5d9eba[_0xc363('0x68')],'method':_0x5d9eba[_0xc363('0x69')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5d9eba[_0xc363('0x6a')])==='number'&&parseInt(_0x5d9eba[_0xc363('0x6a')])>=0x1?parseInt(_0x5d9eba[_0xc363('0x6a')])*0x3e8:0x5*0x3e8};if(_[_0xc363('0x6b')]([_0xc363('0x6c'),_0xc363('0x6d')],_0x5bba33['method']['toUpperCase']())){try{_0x5bba33[_0xc363('0x6e')]=_0x5d9eba['rawBody']?JSON['parse'](_0x5d9eba[_0xc363('0xb')]):{};}catch(_0x350ad2){logger[_0xc363('0x2b')](_0xc363('0x6f'),_0x350ad2);}}try{_0x5bba33[_0xc363('0x70')]=_0x5d9eba[_0xc363('0x71')]?JSON[_0xc363('0x72')](_0x5d9eba['rawHeaders']):{};}catch(_0x2c8cbf){logger[_0xc363('0x2b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2c8cbf);}if(_0x5d9eba[_0xc363('0x73')]){try{var _0x2123e9=require(_0x5d9eba[_0xc363('0x73')])[_0xc363('0x74')](this,_0x5bba33);_0x5bba33['uri']=Mustache[_0xc363('0x75')](_0x5d9eba[_0xc363('0x68')],_0x2123e9,{},['$$','$$']);if(_0x5bba33[_0xc363('0x70')]){_0x5bba33[_0xc363('0x70')]=JSON[_0xc363('0x72')](Mustache[_0xc363('0x75')](JSON[_0xc363('0x76')](_0x5bba33['headers']),_0x2123e9,{},['$$','$$']));}if(_0x5bba33[_0xc363('0x6e')]){_0x5bba33['body']=JSON[_0xc363('0x72')](Mustache[_0xc363('0x75')](JSON[_0xc363('0x76')](_0x5bba33[_0xc363('0x6e')]),_0x2123e9,{},['$$','$$']));}}catch(_0x160f94){logger[_0xc363('0x2b')](_0xc363('0x77'),_0x160f94);}}rp(_0x5bba33)['then'](function(_0x314d6b){var _0x3da455={'statusCode':_0x314d6b['statusCode']||0xc8,'statusMessage':_0x314d6b[_0xc363('0x78')]||'OK','headers':_0x314d6b[_0xc363('0x70')]||{},'body':_0x314d6b[_0xc363('0x6e')]||{}};_0x4e3092(null,_0x3da455);})[_0xc363('0x17')](function(_0x4eb76a){var _0x313849={'statusCode':_0x4eb76a[_0xc363('0x79')]||0x1f4,'statusMessage':_0x4eb76a[_0xc363('0x7a')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x4eb76a[_0xc363('0x7b')][_0xc363('0x70')]||{},'body':_0x4eb76a[_0xc363('0x7b')]['body']||{}};_0x4e3092(null,_0x313849);});};AGIVertices[_0xc363('0x12')][_0xc363('0x7c')]=function(_0x698fd7,_0x2e6dea){scripts[_0xc363('0x7c')](this[_0xc363('0xf')][_0xc363('0x38')],_0x698fd7[_0xc363('0x7d')],_0x698fd7['text'],_0x698fd7[_0xc363('0x7e')]||'en')[_0xc363('0x13')](function(_0x17e9a0){_0x2e6dea(null,_0x17e9a0);})[_0xc363('0x17')](function(_0x5e3396){_0x2e6dea(_0x5e3396);});};AGIVertices[_0xc363('0x12')]['sestekNDA']=function(_0x21547c,_0x3a0fb4){scripts[_0xc363('0x7f')](this[_0xc363('0xf')],_0x21547c)[_0xc363('0x13')](function(_0x4108ed){_0x3a0fb4(null,_0x4108ed);})[_0xc363('0x17')](function(_0x121ec7){_0x3a0fb4(_0x121ec7);});};AGIVertices[_0xc363('0x12')][_0xc363('0x80')]=function(_0x3be519,_0x52a02d){scripts[_0xc363('0x80')](_0x3be519['key'],_0x3be519['text'],_0x3be519['ispeech_tts_language']||_0xc363('0x60'),_0x3be519[_0xc363('0x81')])[_0xc363('0x13')](function(_0x1c9038){_0x52a02d(null,_0x1c9038);})[_0xc363('0x17')](function(_0xd46c69){_0x52a02d(_0xd46c69);});};AGIVertices[_0xc363('0x12')][_0xc363('0x82')]=function(_0x373d9c,_0x4d323c,_0x38297d){scripts[_0xc363('0x82')](_0x4d323c,_0x373d9c[_0xc363('0x7d')],_0x373d9c['ispeech_asr_language']||'en-US',this[_0xc363('0x83')](_0x373d9c['model'])?_0x373d9c[_0xc363('0x84')]:undefined)[_0xc363('0x13')](function(_0x544d8e){_0x38297d(null,_0x544d8e);})[_0xc363('0x17')](function(_0x35d23e){_0x38297d(_0x35d23e);});};AGIVertices[_0xc363('0x12')][_0xc363('0x85')]=function(_0x23f047,_0x2a7fff){scripts[_0xc363('0x85')](_0x23f047[_0xc363('0x86')],_0x23f047[_0xc363('0x87')],_0x23f047[_0xc363('0x88')],_0x23f047[_0xc363('0x89')]||_0xc363('0x8a'),_0x23f047[_0xc363('0x5e')],_0x23f047[_0xc363('0x8b')]||_0xc363('0x5e'))[_0xc363('0x13')](function(_0x413f0a){_0x2a7fff(null,_0x413f0a);})[_0xc363('0x17')](function(_0x11c6b7){_0x2a7fff(_0x11c6b7);});};AGIVertices[_0xc363('0x12')][_0xc363('0x8c')]=function(_0x18b36f,_0x14ba52){scripts[_0xc363('0x8c')](this[_0xc363('0xf')][_0xc363('0x38')],_0x18b36f[_0xc363('0x86')],_0x18b36f[_0xc363('0x87')],_0x18b36f['aws_lex_region'],_0x18b36f[_0xc363('0x5e')],_0x18b36f['aws_bot_name'])[_0xc363('0x13')](function(_0x32e876){_0x14ba52(null,_0x32e876);})[_0xc363('0x17')](function(_0x1938f4){_0x14ba52(_0x1938f4);});};AGIVertices['prototype'][_0xc363('0x8d')]=function(_0x2b8edd,_0x17f72c,_0x2a7cda){scripts['googleASR'](_0x17f72c,_0x2b8edd[_0xc363('0x7d')],_0x2b8edd[_0xc363('0x8e')]||'en-US')['then'](function(_0x299189){_0x2a7cda(null,_0x299189);})[_0xc363('0x17')](function(_0x5aaca7){_0x2a7cda(_0x5aaca7);});};AGIVertices['prototype'][_0xc363('0x8f')]=function(_0x2b8275,_0x4eadb3,_0x2dbc9d){scripts[_0xc363('0x8f')](_0x4eadb3,_0x2b8275[_0xc363('0x90')],_0x2b8275[_0xc363('0x91')],_0x2b8275[_0xc363('0x92')])[_0xc363('0x13')](function(_0x47eef0){_0x2dbc9d(null,_0x47eef0);})[_0xc363('0x17')](function(_0x7328b5){_0x2dbc9d(_0x7328b5);});};AGIVertices['prototype'][_0xc363('0x93')]=function(_0x5b35a9){var _0x46fc69=_['includes'](verticesWithRetry,_0x5b35a9[_0xc363('0x3a')])?_0x5b35a9:_[_0xc363('0x94')](_0x5b35a9);for(var _0x29b8e1 in _0x46fc69){if(_0x46fc69['hasOwnProperty'](_0x29b8e1)){if(_0x46fc69[_0x29b8e1]&&_[_0xc363('0x95')](_0x46fc69[_0x29b8e1])){if(_[_0xc363('0x6b')](recursiveMapAttributes,_0x29b8e1)){_0x46fc69[_0x29b8e1]=this[_0xc363('0x96')](_0x46fc69[_0x29b8e1]);}else{_0x46fc69[_0x29b8e1]=this[_0xc363('0x97')](_0x46fc69[_0x29b8e1]);}}}}return _0x46fc69;};AGIVertices[_0xc363('0x12')][_0xc363('0x98')]=function(_0x4da8d5){for(var _0x570105 in _0x4da8d5){if(_0x4da8d5[_0xc363('0x99')](_0x570105)){if(_['isPlainObject'](_0x4da8d5[_0x570105])){this[_0xc363('0x98')](_0x4da8d5[_0x570105]);}else if(_[_0xc363('0x9a')](_0x4da8d5[_0x570105])){for(var _0x212e78=0x0;_0x212e78<_0x4da8d5[_0x570105]['length'];_0x212e78++){this[_0xc363('0x98')](_0x4da8d5[_0x570105][_0x212e78]);}}else if(_[_0xc363('0x95')](_0x4da8d5[_0x570105])){_0x4da8d5[_0x570105]=this[_0xc363('0x97')](_0x4da8d5[_0x570105]);}}}};AGIVertices[_0xc363('0x12')]['saveRestApiResult']=function(_0x1d0792,_0x194c59){for(var _0x2bca60 in _0x1d0792){if(_0x1d0792['hasOwnProperty'](_0x2bca60)){if(_[_0xc363('0x9b')](_0x1d0792[_0x2bca60])){if(!_[_0xc363('0x43')](_0x1d0792[_0x2bca60])){this[_0xc363('0x9c')](_0x1d0792[_0x2bca60],util[_0xc363('0x27')](_0xc363('0x9d'),_0x194c59,_0x2bca60));}}else if(_['isArray'](_0x1d0792[_0x2bca60])){for(var _0x3fd0d8=0x0;_0x3fd0d8<_0x1d0792[_0x2bca60]['length'];_0x3fd0d8++){this[_0xc363('0x9c')](_0x1d0792[_0x2bca60][_0x3fd0d8],util[_0xc363('0x27')](_0xc363('0x9d'),_0x194c59,_0x2bca60+'['+_0x3fd0d8+']'));}}else{if(!_[_0xc363('0x46')](_0x1d0792[_0x2bca60])){this[_0xc363('0xf')][_0xc363('0x9e')](util['format'](_0xc363('0x9d'),_0x194c59,_0x2bca60),_0x1d0792[_0x2bca60]);}}}}};AGIVertices[_0xc363('0x12')][_0xc363('0x96')]=function(_0x5ec9ad){try{var _0x5197fd=JSON['parse'](_0x5ec9ad);this[_0xc363('0x98')](_0x5197fd);return JSON['stringify'](_0x5197fd);}catch(_0x59f518){return this[_0xc363('0x97')](_0x5ec9ad);}};AGIVertices[_0xc363('0x12')]['replaceAllVariables']=function(_0x371e4e){var _0x58f15f=_0x371e4e[_0xc363('0x9f')]('{');for(var _0x5793b4=0x1;_0x5793b4<_0x58f15f[_0xc363('0xa0')];_0x5793b4+=0x1){var _0x9245c6=_0x58f15f[_0x5793b4][_0xc363('0x9f')]('}');if(_0x9245c6['length']>0x1){_0x371e4e=_0x371e4e[_0xc363('0xa1')]('{'+_0x9245c6[0x0]+'}',this[_0xc363('0xf')]['getVariable'](_0x9245c6[0x0])[_0xc363('0xa2')]||_0x9245c6[0x0]);}}if(_0x58f15f[_0xc363('0xa0')]===0x1){return _0x371e4e['toString']();}return this[_0xc363('0x97')](_0x371e4e);};AGIVertices[_0xc363('0x12')][_0xc363('0xa3')]=function(_0x548b39,_0xd380f6){var _0x258c62=this[_0xc363('0xf')][_0xc363('0xa4')](_0x548b39);if(_0x258c62[_0xc363('0xa5')]===-0x1){return _0x258c62;}logger['info'](util[_0xc363('0x27')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0xd380f6,_0x258c62[_0xc363('0xa2')]));return this[_0xc363('0xf')]['setVariable'](_0xd380f6,_0x258c62[_0xc363('0xa2')]);};AGIVertices[_0xc363('0x12')][_0xc363('0x83')]=function(_0x2bcf72){return _0x2bcf72&&_0x2bcf72!=='0'&&_0x2bcf72!=='-1'&&_0x2bcf72!=='';};AGIVertices['prototype']['maxRetry']=function(_0xc644ec){this['createSquareDetailsReport'][_0xc363('0x74')](this,_0xc644ec,'-');_0xc644ec[_0xc363('0xa6')]=_0xc644ec[_0xc363('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xc363('0x12')]['mrcpsynth']=function(_0x361e92){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0xa8'),_0x361e92[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x361e92['text'])){return this[_0xc363('0xf')]['noop'](_0xc363('0xa9'));}var _0x5556ba='\x22'+_0x361e92[_0xc363('0x5e')]+'\x22';if(this[_0xc363('0x83')](_0x361e92[_0xc363('0x7b')])){_0x5556ba+=','+_0x361e92[_0xc363('0x7b')];}var _0x42a2e6=this['channel'][_0xc363('0x59')](_0xc363('0xaa'),_0x5556ba);if(_0x42a2e6['result']===-0x1){return _0x42a2e6;}return this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0xac'),_0x5556ba));};AGIVertices[_0xc363('0x12')][_0xc363('0xad')]=function(_0x1447be){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0xae'),_0x1447be[_0xc363('0x39')]));if(!this['isConfigured'](_0x1447be[_0xc363('0xaf')])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0xb0'));}var _0x218031=_0x1447be[_0xc363('0xaf')];if(this[_0xc363('0x83')](_0x1447be['options'])){_0x218031+=','+_0x1447be[_0xc363('0x7b')];}var _0x4d9ba2=this[_0xc363('0xf')][_0xc363('0x59')](_0xc363('0xb1'),_0x218031);if(_0x4d9ba2[_0xc363('0xa5')]===-0x1){return _0x4d9ba2;}var _0x51b7a4=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xc363('0xb2'));if(_0x51b7a4[_0xc363('0xa5')]===-0x1){return _0x51b7a4;}var _0x3abe3f=this[_0xc363('0xa3')](_0xc363('0xb3'),_0xc363('0xb4'));if(_0x3abe3f[_0xc363('0xa5')]===-0x1){return _0x3abe3f;}var _0x19cffe=this['getAndSetVariable'](_0xc363('0xb5'),_0xc363('0xb6'));if(_0x19cffe[_0xc363('0xa5')]===-0x1){return _0x19cffe;}return this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x218031));};AGIVertices['prototype'][_0xc363('0x7')]=function(_0x5ac255){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0xb7'),_0x5ac255[_0xc363('0x39')]));return this['channel']['agi']([_0x5ac255[_0xc363('0xb8')],_0x5ac255[_0xc363('0xb9')]]);};AGIVertices[_0xc363('0x12')][_0xc363('0xba')]=function(_0x243ee7){logger[_0xc363('0x2d')](util[_0xc363('0x27')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x243ee7[_0xc363('0x39')]));if(this[_0xc363('0x83')](_0x243ee7[_0xc363('0x6a')])){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0xbb'),_0x243ee7[_0xc363('0x6a')]));var _0x552de5=this[_0xc363('0xf')][_0xc363('0xbc')](_0x243ee7[_0xc363('0x6a')]);if(_0x552de5[_0xc363('0xa5')]===-0x1){return _0x552de5;}}return this[_0xc363('0xf')][_0xc363('0xba')]();};AGIVertices[_0xc363('0x12')][_0xc363('0x4b')]=function(_0xbc6e86){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0xbd'),_0xbc6e86[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0xbc6e86[_0xc363('0x49')])){return this[_0xc363('0xf')]['error'](_0xbc6e86,_0xc363('0xbe'));}_0xbc6e86[_0xc363('0x4a')]=moment();if(this[_0xc363('0x83')](_0xbc6e86[_0xc363('0xbf')])){_0xbc6e86[_0xc363('0x4a')]=moment()[_0xc363('0xc0')](_0xbc6e86['delay'],'minutes');}if(!this[_0xc363('0x83')](_0xbc6e86['callback_priority'])){_0xbc6e86['callback_priority']=0x2;}this['createCmContact'][_0xc363('0x74')](this,_0xbc6e86);return this[_0xc363('0xf')]['noop'](util[_0xc363('0x27')](_0xc363('0xc1'),_0xbc6e86[_0xc363('0x48')],_0xbc6e86[_0xc363('0x49')],_0xbc6e86[_0xc363('0x4a')]));};AGIVertices[_0xc363('0x12')][_0xc363('0xc2')]=function(_0x2fb36d){logger['info'](util[_0xc363('0x27')](_0xc363('0xc3'),_0x2fb36d[_0xc363('0x39')]));var _0x55ff01=this['channel'][_0xc363('0x59')](_0x2fb36d['application'],_0x2fb36d[_0xc363('0x7b')]);if(_0x55ff01[_0xc363('0xa5')]===-0x1){return _0x55ff01;}return this[_0xc363('0xf')][_0xc363('0xab')](util['format'](_0xc363('0xc4'),_0x2fb36d['application'],_0x2fb36d[_0xc363('0x7b')]));};AGIVertices[_0xc363('0x12')][_0xc363('0xc5')]=function(_0x27cdd6){logger[_0xc363('0x2d')](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x27cdd6[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x27cdd6[_0xc363('0x5e')])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0xa9'));}var _0x7e12fd='\x22'+_0x27cdd6[_0xc363('0x5e')]+'\x22';if(this[_0xc363('0x83')](_0x27cdd6['options'])){_0x7e12fd+=','+_0x27cdd6[_0xc363('0x7b')];}var _0x2f16a2=this['channel']['exec'](_0xc363('0xaa'),_0x7e12fd);if(_0x2f16a2[_0xc363('0xa5')]===-0x1){return _0x2f16a2;}return this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0xac'),_0x7e12fd));};AGIVertices[_0xc363('0x12')][_0xc363('0xc6')]=function(_0x374477){logger['info'](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x374477['label']));if(!this[_0xc363('0x83')](_0x374477['text'])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0xa9'));}var _0x1d171c='\x22'+_0x374477[_0xc363('0x5e')]+'\x22';if(this[_0xc363('0x83')](_0x374477[_0xc363('0x7b')])){_0x1d171c+=','+_0x374477['options'];}var _0x5c11ce=this[_0xc363('0xf')]['exec'](_0xc363('0xaa'),_0x1d171c);if(_0x5c11ce[_0xc363('0xa5')]===-0x1){return _0x5c11ce;}return this[_0xc363('0xf')]['noop'](util[_0xc363('0x27')](_0xc363('0xac'),_0x1d171c));};AGIVertices['prototype'][_0xc363('0xc7')]=function(_0x5a0aef){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0xc8'),_0x5a0aef[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x5a0aef[_0xc363('0xaf')])){return this[_0xc363('0xf')]['noop'](_0xc363('0xb0'));}var _0x500f12=_0x5a0aef[_0xc363('0xaf')];if(this[_0xc363('0x83')](_0x5a0aef['options'])){_0x500f12+=','+_0x5a0aef[_0xc363('0x7b')];}var _0x4af805=this['channel'][_0xc363('0x59')](_0xc363('0xb1'),_0x500f12);if(_0x4af805[_0xc363('0xa5')]===-0x1){return _0x4af805;}var _0x1a51fd=this[_0xc363('0xa3')](_0xc363('0xc9'),'LUMENVOX_ASR_CONFIDENCE');if(_0x1a51fd[_0xc363('0xa5')]===-0x1){return _0x1a51fd;}var _0x43848f=this[_0xc363('0xa3')](_0xc363('0xb3'),_0xc363('0xca'));if(_0x43848f['result']===-0x1){return _0x43848f;}var _0x39df56=this[_0xc363('0xa3')]('RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE');if(_0x39df56[_0xc363('0xa5')]===-0x1){return _0x39df56;}return this[_0xc363('0xf')]['noop'](util[_0xc363('0x27')](_0xc363('0xcb'),_0x500f12));};AGIVertices['prototype'][_0xc363('0xcc')]=function(_0x17a954){logger[_0xc363('0x2d')](util[_0xc363('0x27')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x17a954[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x17a954[_0xc363('0xaf')])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0xb0'));}var _0x3345e3=_0x17a954[_0xc363('0xaf')];if(this[_0xc363('0x83')](_0x17a954[_0xc363('0x7b')])){_0x3345e3+=','+_0x17a954[_0xc363('0x7b')];}var _0x5cba84=this[_0xc363('0xf')][_0xc363('0x59')](_0xc363('0xb1'),_0x3345e3);if(_0x5cba84[_0xc363('0xa5')]===-0x1){return _0x5cba84;}var _0x277f53=this[_0xc363('0xa3')](_0xc363('0xc9'),_0xc363('0xcd'));if(_0x277f53['result']===-0x1){return _0x277f53;}var _0x1a1e86=this[_0xc363('0xa3')](_0xc363('0xb3'),_0xc363('0xce'));if(_0x1a1e86[_0xc363('0xa5')]===-0x1){return _0x1a1e86;}var _0x3bddbf=this[_0xc363('0xa3')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x3bddbf[_0xc363('0xa5')]===-0x1){return _0x3bddbf;}return this['channel']['noop'](util[_0xc363('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3345e3));};AGIVertices[_0xc363('0x12')][_0xc363('0xcf')]=function(_0x82147){logger['info'](util[_0xc363('0x27')](_0xc363('0xd0'),_0x82147['label']));if(!this[_0xc363('0x83')](_0x82147['odbc_id'])){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x82147,_0xc363('0xd1'));}var _0x5cd959=this[_0xc363('0x18')][_0xc363('0x74')](this,_0x82147[_0xc363('0xd2')]);if(!_0x5cd959){return this[_0xc363('0xf')]['error'](_0x82147,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x82147[_0xc363('0x2f')])){return this[_0xc363('0xf')]['error'](_0x82147,_0xc363('0xd3'));}var _0x448ba9=_0x82147[_0xc363('0x2f')][_0xc363('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this[_0xc363('0xf')][_0xc363('0xab')](util['format'](_0xc363('0xd4'),_0x448ba9));var _0x13cd93=this[_0xc363('0x29')][_0xc363('0x74')](this,_0x5cd959,_0x448ba9);this[_0xc363('0x37')][_0xc363('0x74')](this,_0x82147,_0x448ba9);if(!this[_0xc363('0x83')](_0x82147[_0xc363('0xd5')])){return this[_0xc363('0xf')][_0xc363('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4e021b=this[_0xc363('0xa4')][_0xc363('0x74')](this,_0x82147[_0xc363('0xd5')]);if(!_0x4e021b){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x82147,_0xc363('0xd6'));}var _0x1e355a=this;_0x13cd93[_0xc363('0xd7')](function(_0x1ca822,_0x33ec7e){Object['keys'](_0x1ca822)[_0xc363('0xd7')](function(_0x3d6458){_0x1e355a[_0xc363('0xf')][_0xc363('0x9e')](util['format']('%s[%s][%s]',_0x4e021b,_0x33ec7e,_0x3d6458),_0x1ca822[_0x3d6458]);});});this[_0xc363('0xf')][_0xc363('0x9e')](util[_0xc363('0x27')](_0xc363('0xd8'),_0x4e021b),_0x13cd93[_0xc363('0xa0')]);return this['channel'][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0xd9'),_0x4e021b));};AGIVertices[_0xc363('0x12')][_0xc363('0xda')]=function(_0x3d49a3){logger[_0xc363('0xdb')](util[_0xc363('0x27')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x3d49a3['label']));if(!this[_0xc363('0x83')](_0x3d49a3[_0xc363('0xdc')])){return this['channel'][_0xc363('0x2b')](_0x3d49a3,'no\x20user\x20selected');}var _0x2f8e8c=this[_0xc363('0x1a')][_0xc363('0x74')](this,_0x3d49a3[_0xc363('0xdc')]);if(!_0x2f8e8c){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x3d49a3,'no\x20user\x20found');}var _0x11c486=this[_0xc363('0xf')][_0xc363('0x59')](_0xc363('0xdd'),[util['format']('SIP/%s',_0x2f8e8c),_0x3d49a3[_0xc363('0x6a')],_0x3d49a3[_0xc363('0xde')],_0x3d49a3[_0xc363('0x68')]]);if(_0x11c486[_0xc363('0xa5')]===-0x1){return _0x11c486;}return this[_0xc363('0xf')]['noop'](util['format'](_0xc363('0xdf'),_0xc363('0xdd')));};AGIVertices[_0xc363('0x12')][_0xc363('0xe0')]=function(_0x519080){logger[_0xc363('0x2d')](util[_0xc363('0x27')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x519080[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x519080['key'])){return this[_0xc363('0xf')]['noop']('no\x20key\x20configured');}if(!this[_0xc363('0x83')](_0x519080[_0xc363('0x5e')])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0xa9'));}this['channel'][_0xc363('0xe1')]=!![];this[_0xc363('0x37')](_0x519080);this[_0xc363('0x41')](_0x519080[_0xc363('0x5e')],'in');this[_0xc363('0xf')][_0xc363('0xab')](util['format'](_0xc363('0xe2'),_0x519080[_0xc363('0x5e')]));var _0x5c89b4=this[_0xc363('0x7c')][_0xc363('0x74')](this,_0x519080);if(_0x5c89b4){for(var _0x3cb7cc in _0x5c89b4){if(_0x5c89b4[_0xc363('0x99')](_0x3cb7cc)){this['channel'][_0xc363('0x9e')](util[_0xc363('0x27')](_0xc363('0xe3'),_0x3cb7cc[_0xc363('0xe4')]()),_0x5c89b4[_0x3cb7cc]);}}this[_0xc363('0x41')](_0x5c89b4[_0xc363('0xe5')],_0xc363('0xe6'));return this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0xe7'),_0x5c89b4['speech']));}return this[_0xc363('0xf')][_0xc363('0x2b')](_0x519080,_0xc363('0xe8'));};AGIVertices['prototype'][_0xc363('0xe9')]=function(_0xab1d5f){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0xea'),_0xab1d5f['label']));if(!this[_0xc363('0x83')](_0xab1d5f[_0xc363('0xeb')])){return this[_0xc363('0xf')]['noop']('no\x20ndauth\x20url\x20configured');}if(!this['isConfigured'](_0xab1d5f['username'])){return this[_0xc363('0xf')]['noop'](_0xc363('0xec'));}if(!this[_0xc363('0x83')](_0xab1d5f[_0xc363('0xed')])){return this[_0xc363('0xf')]['noop'](_0xc363('0xee'));}if(!this[_0xc363('0x83')](_0xab1d5f[_0xc363('0xef')])){return this[_0xc363('0xf')]['noop'](_0xc363('0xa9'));}this[_0xc363('0xf')]['bot']=!![];this[_0xc363('0x37')](_0xab1d5f);this['createSquareMessage'](_0xab1d5f['text'],'in');this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0xf0'),_0xab1d5f[_0xc363('0x5e')]));var _0x458386=this[_0xc363('0x7f')][_0xc363('0x74')](this,_0xab1d5f);if(_0x458386){for(var _0x142ddf in _0x458386){if(_0x458386['hasOwnProperty'](_0x142ddf)){this['channel']['setVariable'](util[_0xc363('0x27')](_0xc363('0xf1'),_0x142ddf[_0xc363('0xe4')]()),_0x458386[_0x142ddf]);}}this['createSquareMessage'](_0x458386[_0xc363('0xe5')],_0xc363('0xe6'));if(_0x458386[_0xc363('0xf2')]){this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0xf3'),_0x458386[_0xc363('0xf2')]));var _0x152bad=this[_0xc363('0xf')]['streamFile'](_0x458386[_0xc363('0xf2')]);try{fs['unlink'](_0x458386[_0xc363('0xf2')]+_0xc363('0xf4'));}catch(_0x101392){logger['error'](_0x101392);}return _0x152bad;}else{return this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')]('SestekNDA\x20Result\x20%s',_0x458386[_0xc363('0xe5')]));}}return this[_0xc363('0xf')][_0xc363('0x2b')](_0xab1d5f,_0xc363('0xf5'));};AGIVertices['prototype'][_0xc363('0xf6')]=function(_0x5560c9){logger['info'](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x5560c9[_0xc363('0x39')]));return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0xf6'));};AGIVertices[_0xc363('0x12')][_0xc363('0xf7')]=function(_0x36184f){logger[_0xc363('0x2d')](util['format'](_0xc363('0xf8'),_0x36184f[_0xc363('0x39')]));var _0x4c7fc1='';if(_0x36184f[_0xc363('0xf9')]){if(!this['isConfigured'](_0x36184f[_0xc363('0xf9')])){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x36184f,_0xc363('0xfa'));}else{var _0x36cdbe=parseInt(_0x36184f[_0xc363('0xf9')],0xa);if(isNaN(_0x36cdbe)){_0x4c7fc1=_0x36184f[_0xc363('0xf9')];}else{_0x4c7fc1=this[_0xc363('0xfb')]['sync'](this,_0x36184f['trunk_id']);if(!_0x4c7fc1){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x36184f,'no\x20trunk\x20found');}}}}else if(_0x36184f[_0xc363('0xfc')]){_0x4c7fc1=_0x36184f[_0xc363('0xfc')];}else{return this[_0xc363('0xf')][_0xc363('0x2b')](_0x36184f,_0xc363('0xfa'));}var _0x2e6bd2=this[_0xc363('0xf')][_0xc363('0x59')]('DIAL',[util[_0xc363('0x27')](_0xc363('0xfd'),_0x4c7fc1,_0x36184f['phone']),_0x36184f[_0xc363('0x6a')],_0x36184f['opts'],_0x36184f[_0xc363('0x68')]]);if(_0x2e6bd2['result']===-0x1){return _0x2e6bd2;}return this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')]('Executed\x20command\x20%s',_0xc363('0xdd')));};AGIVertices[_0xc363('0x12')]['finally']=function(_0x12d103){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0xfe'),_0x12d103[_0xc363('0x39')]));return this[_0xc363('0xf')]['noop'](_0xc363('0xff'));};AGIVertices[_0xc363('0x12')][_0xc363('0xd')]=function(_0x3d669e){logger['info'](util[_0xc363('0x27')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3d669e[_0xc363('0x39')]));if(_0x3d669e[_0xc363('0xa6')]===0x0){return this['maxRetry'](_0x3d669e);}_0x3d669e[_0xc363('0xa6')]-=0x1;if(!this[_0xc363('0x83')](_0x3d669e['file_id'])){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x3d669e,_0xc363('0x100'));}var _0x55a066=this[_0xc363('0x101')][_0xc363('0x74')](this,_0x3d669e[_0xc363('0x102')]);if(!_0x55a066){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x3d669e,'no\x20file\x20audio\x20found');}if(!this[_0xc363('0x83')](_0x3d669e[_0xc363('0xd5')])){return this[_0xc363('0xf')]['error'](_0xc363('0x103'));}var _0x5bdab7=this[_0xc363('0xf')]['getData'](_0x55a066,_0x3d669e['response'],_0x3d669e['maxdigit']);var _0x57d345=_0x5bdab7[_0xc363('0xa5')]?_0x5bdab7['result'][_0xc363('0x4d')]():'';logger['info'](_0xc363('0x104'),JSON['stringify'](_0x5bdab7));if(_0x5bdab7[_0xc363('0xa5')]===-0x1){this['createSquareDetailsReport'][_0xc363('0x74')](this,_0x3d669e,_0x57d345);return _0x5bdab7;}else if(_0x5bdab7[_0xc363('0xa2')]==='timeout'){_0x5bdab7['result']=_0x57d345[_0xc363('0xa0')]>=parseInt(_0x3d669e[_0xc363('0x105')])?'x':'i';}else{_0x5bdab7[_0xc363('0xa5')]=_0x57d345['length']>=parseInt(_0x3d669e['mindigit'])&&_0x57d345[_0xc363('0xa0')]<=parseInt(_0x3d669e[_0xc363('0x106')])?'x':'i';}var _0x473ef6=this[_0xc363('0xa4')][_0xc363('0x74')](this,_0x3d669e['variable_id']);if(!_0x473ef6){return this['channel']['error'](_0x3d669e,_0xc363('0xd6'));}this[_0xc363('0xf')][_0xc363('0x9e')](_0x473ef6,_0x57d345);if(this[_0xc363('0x83')](_0x3d669e[_0xc363('0x107')])){var _0x38da6c=parseInt(_0x3d669e['hiddendigitsnum'],0xa);var _0x1a1489=rs[_0xc363('0x108')]({'charset':'*','length':_0x38da6c});var _0x327f9a=_0x57d345[_0xc363('0xa0')];if(_0x327f9a>0x0){if(_0x327f9a>_0x38da6c){this[_0xc363('0x37')]['sync'](this,_0x3d669e,_0x3d669e[_0xc363('0x109')]===_0xc363('0x10a')?_0x1a1489+_0x57d345[_0xc363('0x10b')](_0x38da6c):_0x57d345['substr'](0x0,_0x327f9a-_0x38da6c)+_0x1a1489);}else{this[_0xc363('0x37')][_0xc363('0x74')](this,_0x3d669e,rs['generate']({'charset':'*','length':_0x327f9a}));}}else{this['createSquareDetailsReport'][_0xc363('0x74')](this,_0x3d669e,'');}}else{this[_0xc363('0x37')][_0xc363('0x74')](this,_0x3d669e,_0x57d345);}return _0x5bdab7;};AGIVertices['prototype'][_0xc363('0xe')]=function(_0x52960d){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x10c'),_0x52960d[_0xc363('0x39')]));return this['getdigits'](_0x52960d);};AGIVertices[_0xc363('0x12')][_0xc363('0x10d')]=function(_0x3e2396){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x10e'),_0x3e2396['label']));this[_0xc363('0x37')]['sync'](this,_0x3e2396,_0x3e2396[_0xc363('0x10f')]);return this[_0xc363('0xf')]['noop'](util[_0xc363('0x27')]('GOAL\x20%s',_0x3e2396['goalname']));};AGIVertices['prototype']['awspolly']=function(_0x4a2f21){logger['info'](util[_0xc363('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x4a2f21[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x4a2f21[_0xc363('0x86')])||!this['isConfigured'](_0x4a2f21['aws_secret_access_key'])){return this[_0xc363('0xf')][_0xc363('0xab')]('no\x20valid\x20credentials\x20configured');}if(!this[_0xc363('0x83')](_0x4a2f21[_0xc363('0x5e')])){return this[_0xc363('0xf')][_0xc363('0xab')]('no\x20text\x20configured');}this[_0xc363('0xf')][_0xc363('0xab')](util['format'](_0xc363('0x110'),_0x4a2f21[_0xc363('0x5e')]));var _0x1b6512=this[_0xc363('0x85')][_0xc363('0x74')](this,_0x4a2f21);if(_0x1b6512){this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x111'),_0x1b6512));var _0xf5e617=this[_0xc363('0xf')][_0xc363('0x112')](_0x1b6512);try{fs[_0xc363('0x113')](_0x1b6512+'.wav');}catch(_0x1df4c9){logger[_0xc363('0x2b')](_0x1df4c9);}return _0xf5e617;}return this['channel']['error'](_0x4a2f21,_0xc363('0x114'));};AGIVertices[_0xc363('0x12')][_0xc363('0x115')]=function(_0x465d92){logger['info'](util[_0xc363('0x27')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x465d92[_0xc363('0x39')]));if(!this['isConfigured'](_0x465d92[_0xc363('0x86')])||!this['isConfigured'](_0x465d92[_0xc363('0x87')])){return this['channel']['noop'](_0xc363('0x116'));}if(!this[_0xc363('0x83')](_0x465d92[_0xc363('0x117')])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0x118'));}if(!this[_0xc363('0x83')](_0x465d92[_0xc363('0x5e')])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0xa9'));}this[_0xc363('0xf')][_0xc363('0xe1')]=!![];this[_0xc363('0x37')](_0x465d92);this[_0xc363('0x41')](_0x465d92[_0xc363('0x5e')],'in');this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x119'),_0x465d92[_0xc363('0x5e')]));var _0x7bb83e=this[_0xc363('0x8c')][_0xc363('0x74')](this,_0x465d92);if(_0x7bb83e){for(var _0x176622 in _0x7bb83e){if(_0x7bb83e[_0xc363('0x99')](_0x176622)&&_['isString'](_0x7bb83e[_0x176622])){this['channel'][_0xc363('0x9e')](util['format']('AWS_LEX_%s',_0x176622[_0xc363('0xe4')]()),_0x7bb83e[_0x176622]);}}if(_[_0xc363('0x46')](_0x7bb83e[_0xc363('0x7a')])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0x11a'));}else{this[_0xc363('0x41')](_0x7bb83e[_0xc363('0x7a')],'out');return this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x11b'),_0x7bb83e[_0xc363('0x7a')]));}}return this['channel'][_0xc363('0x2b')](_0x465d92,_0xc363('0x11c'));};AGIVertices[_0xc363('0x12')][_0xc363('0x11d')]=function(_0xbae489){logger[_0xc363('0x2d')](util['format'](_0xc363('0x11e'),_0xbae489['label'],_0xbae489['timeout']));if(!this['isConfigured'](_0xbae489[_0xc363('0x7d')])){return this[_0xc363('0xf')]['noop'](_0xc363('0x11f'));}var _0xc3dc8b=_0xc363('0x120');var _0x5529ba=util['format'](_0xc363('0x121'),FILES_PATH,rs[_0xc363('0x108')](0x4));var _0x4db9e5=util[_0xc363('0x27')](_0xc363('0x9d'),_0x5529ba,_0xc3dc8b);var _0x291013=!![];if(_0xbae489['beep']===_0xc363('0x122')){_0x291013=![];}var _0x307640=this[_0xc363('0xf')]['recordFile'](_0x5529ba,_0xc3dc8b,_0xbae489[_0xc363('0x123')],_0xbae489[_0xc363('0x6a')],undefined,_0x291013);if(_0x307640[_0xc363('0xa5')]!==-0x1){this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x124'),_0x4db9e5));var _0xa23584=this['googleASR'][_0xc363('0x74')](this,_0xbae489,_0x4db9e5);if(_0xa23584){for(var _0x366daa in _0xa23584){if(_0xa23584['hasOwnProperty'](_0x366daa)){this[_0xc363('0xf')][_0xc363('0x9e')](util[_0xc363('0x27')](_0xc363('0x125'),_0x366daa[_0xc363('0xe4')]()),_0xa23584[_0x366daa]);}}return this[_0xc363('0xf')]['noop'](util['format'](_0xc363('0x126'),JSON[_0xc363('0x76')](_0xa23584)));}}return _0x307640;};AGIVertices[_0xc363('0x12')][_0xc363('0x127')]=function(_0x1060df){logger[_0xc363('0x2d')](util[_0xc363('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x1060df[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x1060df[_0xc363('0x90')])){return this['channel'][_0xc363('0xab')]('no\x20appid\x20configured');}if(!this[_0xc363('0x83')](_0x1060df[_0xc363('0x91')])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0x128'));}var _0x448b71='wav';var _0x52958d=util[_0xc363('0x27')](_0xc363('0x121'),FILES_PATH,rs[_0xc363('0x108')](0x4));var _0x1d822a=util[_0xc363('0x27')](_0xc363('0x9d'),_0x52958d,_0x448b71);var _0x5ad816=!![];if(_0x1060df[_0xc363('0x129')]===_0xc363('0x122')){_0x5ad816=![];}var _0x118dd1=this[_0xc363('0xf')][_0xc363('0x12a')](_0x52958d,_0x448b71,_0x1060df['intKey'],_0x1060df['timeout'],undefined,_0x5ad816);if(_0x118dd1[_0xc363('0xa5')]!==-0x1){this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x12b'),_0x1d822a));var _0x57a789=this[_0xc363('0x8f')][_0xc363('0x74')](this,_0x1060df,_0x1d822a);if(_0x57a789){for(var _0x4a676d in _0x57a789){if(_0x57a789[_0xc363('0x99')](_0x4a676d)){this[_0xc363('0xf')][_0xc363('0x9e')](util[_0xc363('0x27')](_0xc363('0x12c'),_0x4a676d['toUpperCase']()),_0x57a789[_0x4a676d]);}}return this[_0xc363('0xf')][_0xc363('0xab')](util['format']('TildeASR\x20Result\x20%s',JSON['stringify'](_0x57a789)));}}return _0x118dd1;};AGIVertices[_0xc363('0x12')][_0xc363('0x12d')]=function(_0x5d1faf){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x12e'),_0x5d1faf[_0xc363('0x39')]));return this['channel'][_0xc363('0x12f')](_0x5d1faf[_0xc363('0x130')],_0x5d1faf[_0xc363('0x3f')],_0x5d1faf[_0xc363('0x40')]);};AGIVertices[_0xc363('0x12')][_0xc363('0x131')]=function(_0x18d09f){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x132'),_0x18d09f[_0xc363('0x39')]));if(!this['isConfigured'](_0x18d09f['condition'])){return this['channel'][_0xc363('0x2b')](_0x18d09f,'no\x20condition\x20configured');}try{var _0x4cca24=eval(_0x18d09f[_0xc363('0x133')])?_0xc363('0x134'):'false';this['channel']['noop'](util[_0xc363('0x27')](_0xc363('0x135'),_0x18d09f[_0xc363('0x133')],_0x4cca24));return{'code':0xc8,'result':_0x4cca24};}catch(_0x45a284){return{'code':0xc8,'result':_0xc363('0x136')};}};AGIVertices['prototype']['gotoiftime']=function(_0x30e63d){logger['info'](util[_0xc363('0x27')](_0xc363('0x137'),_0x30e63d['label']));if(!this['isConfigured'](_0x30e63d[_0xc363('0x138')])){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x30e63d,'no\x20interval\x20configured');}var _0x4a26e3=this['getIntervals']['sync'](this,_0x30e63d['interval_id']);if(!_0x4a26e3){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x30e63d,'no\x20intervals\x20found');}for(var _0x28092d=0x0;_0x28092d<_0x4a26e3[_0xc363('0xa0')];_0x28092d+=0x1){var _0x314708=this[_0xc363('0xf')][_0xc363('0xa4')](util['format'](_0xc363('0x139'),_0x4a26e3[_0x28092d]));if(_0x314708[_0xc363('0xa5')]===-0x1){return _0x314708;}logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x13a'),_0x4a26e3[_0x28092d],_0x314708[_0xc363('0xa2')]));if(_0x314708[_0xc363('0xa2')]==='true'){logger['info'](util[_0xc363('0x27')](_0xc363('0x13a'),_0x4a26e3[_0x28092d],_0xc363('0x134')));this['channel']['noop'](util[_0xc363('0x27')](_0xc363('0x13a'),_0x4a26e3[_0x28092d],_0xc363('0x134')));return{'code':0xc8,'result':_0xc363('0x134')};}else{logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x13a'),_0x4a26e3[_0x28092d],_0xc363('0x136')));this[_0xc363('0xf')]['noop'](util[_0xc363('0x27')](_0xc363('0x13a'),_0x4a26e3[_0x28092d],_0xc363('0x136')));}}return{'code':0xc8,'result':_0xc363('0x136')};};AGIVertices[_0xc363('0x12')][_0xc363('0x13b')]=function(_0x49ddb9){logger[_0xc363('0x2d')](util['format'](_0xc363('0x13c'),_0x49ddb9['label']));return this[_0xc363('0xf')]['hangup']();};AGIVertices[_0xc363('0x12')]['ispeechasr']=function(_0x5e5d50){logger[_0xc363('0x2d')](util['format'](_0xc363('0x13d'),_0x5e5d50[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x5e5d50[_0xc363('0x7d')])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0x11f'));}var _0x551854='wav';var _0x16e347=util[_0xc363('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0xc363('0x108')](0x4));var _0x1e72bc=util[_0xc363('0x27')](_0xc363('0x9d'),_0x16e347,_0x551854);var _0x29b4ec=!![];if(_0x5e5d50[_0xc363('0x129')]===_0xc363('0x122')){_0x29b4ec=![];}var _0x1c3bac=this[_0xc363('0xf')][_0xc363('0x12a')](_0x16e347,_0x551854,_0x5e5d50[_0xc363('0x123')],_0x5e5d50['timeout'],undefined,_0x29b4ec);if(_0x1c3bac[_0xc363('0xa5')]!==-0x1){this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x13e'),_0x1e72bc));var _0x405149=this[_0xc363('0x82')][_0xc363('0x74')](this,_0x5e5d50,_0x1e72bc);if(_0x405149){for(var _0x3d08f6 in _0x405149){if(_0x405149[_0xc363('0x99')](_0x3d08f6)){this[_0xc363('0xf')][_0xc363('0x9e')](util['format'](_0xc363('0x13f'),_0x3d08f6['toUpperCase']()),_0x405149[_0x3d08f6]);}}return this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x140'),JSON['stringify'](_0x405149)));}}return _0x1c3bac;};AGIVertices[_0xc363('0x12')][_0xc363('0x141')]=function(_0x5f05ef){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x142'),_0x5f05ef[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x5f05ef[_0xc363('0x7d')])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0x11f'));}if(!this[_0xc363('0x83')](_0x5f05ef[_0xc363('0x5e')])){return this['channel']['noop'](_0xc363('0xa9'));}this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x143'),_0x5f05ef[_0xc363('0x5e')]));var _0x19a69f=this[_0xc363('0x80')][_0xc363('0x74')](this,_0x5f05ef);if(_0x19a69f){this[_0xc363('0xf')]['noop'](util[_0xc363('0x27')]('ispeech\x20%s\x20file\x20created',_0x19a69f));var _0x2eefc9=this[_0xc363('0xf')]['streamFile'](_0x19a69f,_0x5f05ef[_0xc363('0x123')]);try{fs[_0xc363('0x113')](_0x19a69f+_0xc363('0xf4'));}catch(_0x33b099){logger[_0xc363('0x2b')](_0x33b099);}return _0x2eefc9;}return this[_0xc363('0xf')][_0xc363('0x2b')](_0x5f05ef,_0xc363('0x144'));};AGIVertices[_0xc363('0x12')][_0xc363('0x145')]=function(_0x33aae1){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x146'),_0x33aae1[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x33aae1['findBy'])){return this['channel'][_0xc363('0x2b')](_0x33aae1,_0xc363('0x147'));}logger[_0xc363('0x2d')](util['format'](_0xc363('0x148'),this['channel'][_0xc363('0x3c')],_0x33aae1['findBy']));var _0x233422=this[_0xc363('0x54')]['sync'](this,_0x33aae1['findBy']);if(_0x233422){logger[_0xc363('0x2d')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xc363('0x3c')],_0x33aae1[_0xc363('0x149')]));this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x14a'),this[_0xc363('0xf')]['callerid'],_0x33aae1[_0xc363('0x149')]));return{'code':0xc8,'result':_0xc363('0x14b')};}else{logger[_0xc363('0x2d')](util[_0xc363('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc363('0xf')][_0xc363('0x3c')],_0x33aae1['findBy']));this['channel'][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x14c'),this[_0xc363('0xf')][_0xc363('0x3c')],_0x33aae1['findBy']));return{'code':0xc8,'result':_0xc363('0x14d')};}};AGIVertices[_0xc363('0x12')]['logout']=function(_0x1e8a32){logger[_0xc363('0x2d')](util['format'](_0xc363('0x14e'),_0x1e8a32['label']));if(!this[_0xc363('0x83')](_0x1e8a32[_0xc363('0x149')])){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x1e8a32,_0xc363('0x147'));}logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x148'),this[_0xc363('0xf')][_0xc363('0x3c')],_0x1e8a32[_0xc363('0x149')]));var _0x198b36=this[_0xc363('0x53')][_0xc363('0x74')](this,_0x1e8a32[_0xc363('0x149')]);if(_0x198b36){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x14a'),this[_0xc363('0xf')][_0xc363('0x3c')],_0x1e8a32[_0xc363('0x149')]));this['channel'][_0xc363('0xab')](util[_0xc363('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc363('0xf')][_0xc363('0x3c')],_0x1e8a32['findBy']));return{'code':0xc8,'result':_0xc363('0x14b')};}else{logger[_0xc363('0x2d')](util[_0xc363('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x1e8a32[_0xc363('0x149')]));this[_0xc363('0xf')]['noop'](util['format'](_0xc363('0x14c'),this['channel'][_0xc363('0x3c')],_0x1e8a32[_0xc363('0x149')]));return{'code':0xc8,'result':_0xc363('0x14d')};}};AGIVertices[_0xc363('0x12')][_0xc363('0x14f')]=function(_0x4d4f95){logger[_0xc363('0x2d')](util['format'](_0xc363('0x150'),_0x4d4f95[_0xc363('0x39')]));if(!this['isConfigured'](_0x4d4f95[_0xc363('0x151')])){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x4d4f95,'no\x20operation\x20configured');}this[_0xc363('0xf')]['noop'](util['format']('math\x20%s',_0x4d4f95[_0xc363('0x151')]));var _0x31b280=eval(_0x4d4f95[_0xc363('0x151')]);if(!this[_0xc363('0x83')](_0x4d4f95[_0xc363('0xd5')])){return this[_0xc363('0xf')]['noop'](_0xc363('0x103'));}var _0x1266ae=this[_0xc363('0xa4')]['sync'](this,_0x4d4f95[_0xc363('0xd5')]);if(!_0x1266ae){return this['channel'][_0xc363('0x2b')](_0x4d4f95,_0xc363('0xd6'));}if(_[_0xc363('0x9a')](_0x31b280)){var _0x3c305f=this;_0x31b280[_0xc363('0xd7')](function(_0x3ed61a,_0x393279){_0x3c305f['channel'][_0xc363('0x9e')](util[_0xc363('0x27')](_0xc363('0x152'),_0x1266ae,_0x393279),_0x3ed61a);});return this[_0xc363('0xf')]['noop'](util[_0xc363('0x27')]('variable\x20%s[key]\x20set',_0x1266ae));}else{return this[_0xc363('0xf')][_0xc363('0x9e')](_0x1266ae,_0x31b280);}};AGIVertices[_0xc363('0x12')]['menu']=function(_0x17d9c8){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x153'),_0x17d9c8['label']));if(_0x17d9c8[_0xc363('0xa6')]===0x0){return this[_0xc363('0xa7')](_0x17d9c8);}_0x17d9c8[_0xc363('0xa6')]-=0x1;if(!this['isConfigured'](_0x17d9c8[_0xc363('0x102')])){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x17d9c8,_0xc363('0x100'));}var _0x1eaca4=this[_0xc363('0x101')][_0xc363('0x74')](this,_0x17d9c8[_0xc363('0x102')]);if(!_0x1eaca4){return this[_0xc363('0xf')]['error'](_0x17d9c8,_0xc363('0x154'));}var _0x33a289=this[_0xc363('0xf')][_0xc363('0x155')](_0x1eaca4,_0x17d9c8['response'],_0x17d9c8['digit']);var _0x17f3f2=_0x33a289['result'];if(_0x33a289[_0xc363('0xa5')]===-0x1){this[_0xc363('0x37')][_0xc363('0x74')](this,_0x17d9c8,'-1');return _0x33a289;}else if(_0x33a289['extra']===_0xc363('0x6a')){_0x33a289[_0xc363('0xa5')]=_0x33a289[_0xc363('0xa5')]['length']>0x0?_0x33a289[_0xc363('0xa5')]:'t';}else if(_['isEmpty'](_0x33a289[_0xc363('0xa5')])){_0x33a289[_0xc363('0xa5')]='#';_0x17f3f2='#';}if(!this[_0xc363('0x83')](_0x17d9c8[_0xc363('0xd5')])){this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0x103'));}else{var _0x110760=this[_0xc363('0xa4')][_0xc363('0x74')](this,_0x17d9c8[_0xc363('0xd5')]);if(!_0x110760){return this[_0xc363('0xf')]['error'](_0x17d9c8,_0xc363('0xd6'));}this[_0xc363('0xf')][_0xc363('0x9e')](_0x110760,_0x17f3f2);}this['createSquareDetailsReport'][_0xc363('0x74')](this,_0x17d9c8,_0x17f3f2);return _0x33a289;};AGIVertices[_0xc363('0x12')][_0xc363('0xab')]=function(_0x138e95){logger['info'](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x138e95[_0xc363('0x39')]));return this['channel'][_0xc363('0xab')](_0x138e95[_0xc363('0x156')]||_0x138e95[_0xc363('0x39')]);};AGIVertices[_0xc363('0x12')]['pause']=function(_0x2542d1){logger['info'](util[_0xc363('0x27')](_0xc363('0x157'),_0x2542d1[_0xc363('0x39')]));if(!this['isConfigured'](_0x2542d1[_0xc363('0x149')])){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x2542d1,'no\x20find\x20by\x20configured');}logger['info'](util[_0xc363('0x27')](_0xc363('0x148'),this['channel']['callerid'],_0x2542d1[_0xc363('0x149')]));var _0x42912d=this['getPause'][_0xc363('0x74')](this,_0x2542d1[_0xc363('0x158')]);var _0x152b03=this[_0xc363('0x50')]['sync'](this,_0x2542d1[_0xc363('0x149')],_0x42912d);if(_0x152b03){logger[_0xc363('0x2d')](util[_0xc363('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xc363('0x3c')],_0x2542d1[_0xc363('0x149')]));this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x14a'),this['channel'][_0xc363('0x3c')],_0x2542d1[_0xc363('0x149')]));return{'code':0xc8,'result':_0xc363('0x14b')};}else{logger['info'](util[_0xc363('0x27')](_0xc363('0x14c'),this[_0xc363('0xf')][_0xc363('0x3c')],_0x2542d1[_0xc363('0x149')]));this[_0xc363('0xf')][_0xc363('0xab')](util['format'](_0xc363('0x14a'),this[_0xc363('0xf')][_0xc363('0x3c')],_0x2542d1[_0xc363('0x149')]));return{'code':0xc8,'result':_0xc363('0x14d')};}};AGIVertices[_0xc363('0x12')][_0xc363('0x159')]=function(_0x2c1812){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x15a'),_0x2c1812[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x2c1812[_0xc363('0x102')])){return this['channel'][_0xc363('0x2b')](_0x2c1812,_0xc363('0x100'));}var _0x5d389a=this['getSound'][_0xc363('0x74')](this,_0x2c1812[_0xc363('0x102')]);if(!_0x5d389a){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x2c1812,_0xc363('0x154'));}var _0xc884d5=this[_0xc363('0xf')][_0xc363('0x59')](_0xc363('0x15b'),[_0x5d389a,_0x2c1812[_0xc363('0xde')]]);if(_0xc884d5['result']===-0x1){return _0xc884d5;}return this['channel'][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0xc4'),_0xc363('0x15b'),_0x5d389a));};AGIVertices['prototype'][_0xc363('0x15c')]=function(_0x32c937){logger[_0xc363('0x2d')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x32c937[_0xc363('0x39')]));if(!this['isConfigured'](_0x32c937[_0xc363('0x15d')])){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x32c937,'no\x20queue\x20selected');}var _0x44126d='';var _0x4bd83c=parseInt(_0x32c937['queue_id'],0xa);if(isNaN(_0x4bd83c)){_0x44126d=_0x32c937[_0xc363('0x15d')];}else{_0x44126d=this[_0xc363('0x14')][_0xc363('0x74')](this,_0x32c937[_0xc363('0x15d')]);if(!_0x44126d){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x32c937,_0xc363('0x15e'));}}var _0x2a6c0c='';if(this[_0xc363('0x83')](_0x32c937[_0xc363('0x102')])){var _0xa18a75=this[_0xc363('0x101')][_0xc363('0x74')](this,_0x32c937[_0xc363('0x102')]);if(_0xa18a75){_0x2a6c0c=_0xa18a75;}}this[_0xc363('0x37')][_0xc363('0x74')](this,_0x32c937,_0x44126d);if(_0x32c937[_0xc363('0xde')][_0xc363('0x15f')]('x')<0x0){_0x32c937['opts']+='x';}if(_0x32c937['opts'][_0xc363('0x15f')]('X')<0x0){_0x32c937[_0xc363('0xde')]+='X';}this[_0xc363('0xf')][_0xc363('0x9e')](_0xc363('0x160'),_0x44126d?_0x44126d[_0xc363('0x161')]():'');var _0xb97e99=this[_0xc363('0xf')][_0xc363('0x59')](_0xc363('0x162'),[_0x44126d,_0x32c937[_0xc363('0xde')],_0x32c937['url'],_0x2a6c0c,_0x32c937[_0xc363('0x6a')],_0x32c937[_0xc363('0x7')],_0x32c937[_0xc363('0x163')],_0x32c937[_0xc363('0x164')],'',_0x32c937[_0xc363('0x165')]]);if(_0xb97e99[_0xc363('0xa5')]===-0x1){return _0xb97e99;}return this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0xc4'),_0xc363('0x162'),_0x44126d));};AGIVertices['prototype'][_0xc363('0x166')]=function(_0x430efa){logger['info'](util[_0xc363('0x27')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x430efa[_0xc363('0x39')]));var _0x324a7f=_0x430efa[_0xc363('0x167')]||_0xc363('0x120');var _0x2487b0=util[_0xc363('0x27')](_0xc363('0x168'),this[_0xc363('0xf')][_0xc363('0x38')],rs['generate'](0x5));var _0x1be869=util[_0xc363('0x27')](_0xc363('0x169'),FILES_PATH,_0x2487b0,_0x324a7f);var _0x2bcf3c=util[_0xc363('0x27')](_0xc363('0x121'),FILES_PATH,_0x2487b0);this[_0xc363('0x3d')][_0xc363('0x74')](this,_0x430efa,_0x2487b0,_0x1be869);this[_0xc363('0xf')][_0xc363('0x9e')](_0xc363('0x16a'),_0x2487b0);logger[_0xc363('0x2d')](_0xc363('0x16b'),_0x2bcf3c,_0x324a7f,_0x430efa[_0xc363('0x16c')],_0x430efa[_0xc363('0x6a')]);return this[_0xc363('0xf')]['recordFile'](_0x2bcf3c,_0x324a7f,_0x430efa[_0xc363('0x16c')],_0x430efa['timeout'],undefined,!![]);};AGIVertices[_0xc363('0x12')][_0xc363('0x16d')]=function(_0x554e37){logger['info'](util[_0xc363('0x27')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x554e37['label']));if(!this['isConfigured'](_0x554e37['url'])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0x16e'));}var _0x32a3e3=this['restAPI'][_0xc363('0x74')](this,_0x554e37);logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x16f'),util[_0xc363('0x170')](_0x32a3e3,{'showHidden':![],'depth':null})));if(!this[_0xc363('0x83')](_0x554e37[_0xc363('0xd5')])){return this['channel'][_0xc363('0xab')](_0xc363('0x171'));}var _0xeed30b=this[_0xc363('0xa4')][_0xc363('0x74')](this,_0x554e37[_0xc363('0xd5')]);if(!_0xeed30b){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x554e37,_0xc363('0xd6'));}this[_0xc363('0xf')]['setVariable'](util[_0xc363('0x27')](_0xc363('0x172'),_0xeed30b),_0x32a3e3[_0xc363('0x79')]?_0x32a3e3[_0xc363('0x79')]:_0xc363('0x173'));this[_0xc363('0xf')][_0xc363('0x9e')](util[_0xc363('0x27')](_0xc363('0x174'),_0xeed30b),_0x32a3e3['statusMessage']?_0x32a3e3['statusMessage']:'OK');if(_0x32a3e3[_0xc363('0x6e')]){try{this[_0xc363('0x9c')](_0x32a3e3[_0xc363('0x6e')],_0xeed30b);}catch(_0x228d09){logger[_0xc363('0x2b')](util[_0xc363('0x27')](_0xc363('0x175'),_0xeed30b));}}return this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0xd9'),_0xeed30b));};AGIVertices[_0xc363('0x12')]['saydigits']=function(_0x55159f){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x176'),_0x55159f[_0xc363('0x39')]));return this['channel'][_0xc363('0x177')](_0x55159f[_0xc363('0x178')]['replace'](/\s+/g,''),_0x55159f[_0xc363('0x16c')]);};AGIVertices[_0xc363('0x12')][_0xc363('0x179')]=function(_0xa01171){logger[_0xc363('0x2d')](util[_0xc363('0x27')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0xa01171[_0xc363('0x39')]));return this[_0xc363('0xf')][_0xc363('0x17a')](_0xa01171[_0xc363('0x17b')][_0xc363('0x5b')](/\s+/g,''),_0xa01171[_0xc363('0x16c')]);};AGIVertices[_0xc363('0x12')][_0xc363('0x17c')]=function(_0x475d5f){logger[_0xc363('0x2d')](util['format'](_0xc363('0x17d'),_0x475d5f['label']));return this[_0xc363('0xf')][_0xc363('0x17e')](_0x475d5f['text'],_0x475d5f[_0xc363('0x16c')]);};AGIVertices['prototype'][_0xc363('0x17f')]=function(_0x1ca343){logger[_0xc363('0x2d')](util['format'](_0xc363('0x180'),_0x1ca343[_0xc363('0x39')]));if(!this['isConfigured'](_0x1ca343[_0xc363('0x181')])){return this['channel'][_0xc363('0xab')](_0xc363('0x182'));}var _0xbe67d2=this['getMailAccount']['sync'](this,_0x1ca343[_0xc363('0x181')]);if(!_0xbe67d2||!_0xbe67d2[_0xc363('0x183')]){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x1ca343,_0xc363('0x184'));}var _0x28b97b={'from':util[_0xc363('0x27')](_0xc363('0x185'),_0xbe67d2['name'],_0xbe67d2['email']||_0xbe67d2[_0xc363('0x183')][_0xc363('0x186')]),'to':_0x1ca343['to']||'','cc':_0x1ca343['cc']||'','bcc':_0x1ca343[_0xc363('0x187')]||'','subject':_0x1ca343[_0xc363('0x188')],'html':_0x1ca343[_0xc363('0x5e')],'text':_0x1ca343[_0xc363('0x5e')]};var _0x2c7203={'tls':{'rejectUnauthorized':![]}};if(_0xbe67d2[_0xc363('0x183')][_0xc363('0x189')]){_0x2c7203[_0xc363('0x189')]=_0xbe67d2[_0xc363('0x183')][_0xc363('0x189')];}else{_0x2c7203[_0xc363('0x18a')]=_0xbe67d2[_0xc363('0x183')][_0xc363('0x18a')];_0x2c7203[_0xc363('0x18b')]=_0xbe67d2[_0xc363('0x183')]['port'];_0x2c7203[_0xc363('0x18c')]=_0xbe67d2[_0xc363('0x183')][_0xc363('0x18c')];}if(_0xbe67d2[_0xc363('0x183')][_0xc363('0x18d')]){_0x2c7203[_0xc363('0x18e')]={'user':_0xbe67d2['Smtp'][_0xc363('0x186')],'pass':_0xbe67d2['Smtp']['pass']};}if(this['isConfigured'](_0x1ca343[_0xc363('0x18f')])){}logger['debug'](_0xc363('0x190'),JSON[_0xc363('0x76')](_0x28b97b));this[_0xc363('0x37')][_0xc363('0x74')](this,_0x1ca343,_0x1ca343[_0xc363('0x181')]);this['channel'][_0xc363('0xab')](util[_0xc363('0x27')]('Trying\x20SendMail\x20with\x20account\x20%s',_0xbe67d2['name']));this[_0xc363('0x21')][_0xc363('0x74')](this,_0x2c7203,_0x28b97b);return this['channel'][_0xc363('0xab')](_0xc363('0x191'));};AGIVertices[_0xc363('0x12')][_0xc363('0x192')]=function(_0x10c9e5){logger['info'](util[_0xc363('0x27')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x10c9e5[_0xc363('0x39')]));return this['channel']['noop'](_0xc363('0x193'));};AGIVertices[_0xc363('0x12')][_0xc363('0x194')]=function(_0x88635f){logger['info'](util[_0xc363('0x27')](_0xc363('0x195'),_0x88635f[_0xc363('0x39')]));if(!this['isConfigured'](_0x88635f[_0xc363('0x196')])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0x197'));}var _0xef5ed=this['getSmsAccount']['sync'](this,_0x88635f[_0xc363('0x196')]);if(!_0xef5ed){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x88635f,_0xc363('0x198'));}var _0x4a5783={'body':_0x88635f[_0xc363('0x199')],'phone':_0x88635f['to']||'','SmsAccountId':_0xef5ed['id']};logger[_0xc363('0xdb')]('sendSMS\x20message',JSON[_0xc363('0x76')](_0x4a5783));this[_0xc363('0x37')][_0xc363('0x74')](this,_0x88635f,_0x88635f[_0xc363('0x196')]);this[_0xc363('0xf')][_0xc363('0xab')](util['format'](_0xc363('0x19a'),_0xef5ed[_0xc363('0x16')]));this[_0xc363('0x36')]['sync'](this,_0x4a5783);return this['channel'][_0xc363('0xab')](_0xc363('0x19b'));};AGIVertices[_0xc363('0x12')]['set']=function(_0x4ebf0a){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x19c'),_0x4ebf0a[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x4ebf0a['variable_id'])){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x4ebf0a,'no\x20variable\x20selected');}var _0x35ae95=this[_0xc363('0xa4')][_0xc363('0x74')](this,_0x4ebf0a['variable_id']);if(!_0x35ae95){return this[_0xc363('0xf')]['error'](_0x4ebf0a,_0xc363('0xd6'));}return this[_0xc363('0xf')][_0xc363('0x9e')](_0x35ae95,_0x4ebf0a[_0xc363('0x19d')]);};AGIVertices[_0xc363('0x12')][_0xc363('0x19e')]=function(_0x445163){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x19f'),_0x445163[_0xc363('0x39')]));this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0x1a0'));if(_0x445163[_0xc363('0xba')]===_0xc363('0x1a1')){this[_0xc363('0xf')]['noop'](_0xc363('0x1a2'));return this[_0xc363('0xf')][_0xc363('0xba')]();}return this[_0xc363('0xf')]['noop'](_0xc363('0x1a3'));};AGIVertices[_0xc363('0x12')][_0xc363('0x1a4')]=function(_0x161f6d){logger[_0xc363('0x2d')](util[_0xc363('0x27')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x161f6d[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x161f6d['project_id'])){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x161f6d,_0xc363('0x1a5'));}var _0x16e68c=this[_0xc363('0x1a6')][_0xc363('0x74')](this,_0x161f6d[_0xc363('0x1a7')]);if(!this['isConfigured'](_0x16e68c)){return this[_0xc363('0xf')]['error'](_0x161f6d,util[_0xc363('0x27')](_0xc363('0x1a8'),_0x161f6d['project_id']));}if(_0x16e68c===this['channel']['arg_1']){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x161f6d,_0xc363('0x1a9'));}this['createSquareDetailsReport'][_0xc363('0x74')](this,_0x161f6d,_0x16e68c);var _0x65198c=this[_0xc363('0xf')][_0xc363('0x59')](_0xc363('0x1aa'),util[_0xc363('0x27')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xc363('0x7')][_0xc363('0x18a')]||'127.0.0.1',_0x16e68c,this[_0xc363('0xf')]['arg_1']));if(_0x65198c[_0xc363('0xa5')]===-0x1){return _0x65198c;}return this['channel']['noop'](util[_0xc363('0x27')](_0xc363('0xc4'),_0xc363('0x1aa'),_0x16e68c));};AGIVertices[_0xc363('0x12')][_0xc363('0x1ab')]=function(_0x3513b0){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x1ac'),_0x3513b0[_0xc363('0x39')]));var _0x573a5a=this[_0xc363('0x58')]['sync'](this,_0x3513b0[_0xc363('0xb8')]);this[_0xc363('0x37')][_0xc363('0x74')](this,_0x3513b0,_0x3513b0[_0xc363('0xb8')]);if(this[_0xc363('0x83')](_0x3513b0['variable_id'])){var _0x2d3a4f=this[_0xc363('0xa4')]['sync'](this,_0x3513b0[_0xc363('0xd5')]);if(_0x2d3a4f){this[_0xc363('0xf')][_0xc363('0x9e')](_0x2d3a4f,_0x573a5a);return this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x1ad'),_0x3513b0[_0xc363('0xb8')],_0x2d3a4f));}}return this['channel'][_0xc363('0xab')](util[_0xc363('0x27')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x3513b0['command']));};AGIVertices[_0xc363('0x12')]['google_cloud_tts']=function(_0x40c7c8){logger[_0xc363('0x2d')](util[_0xc363('0x27')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x40c7c8[_0xc363('0x39')]));_0x40c7c8['text']=_0x40c7c8[_0xc363('0x5e')][_0xc363('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc363('0x83')](_0x40c7c8[_0xc363('0x1ae')])){return this[_0xc363('0xf')]['noop'](_0xc363('0x1af'));}if(!this['isConfigured'](_0x40c7c8['text'])){return this[_0xc363('0xf')][_0xc363('0xab')](_0xc363('0xa9'));}this[_0xc363('0xf')][_0xc363('0xab')](util['format'](_0xc363('0x1b0'),_0x40c7c8[_0xc363('0x5e')]));var _0x4c5d21=this[_0xc363('0x5c')][_0xc363('0x74')](this,_0x40c7c8);if(_0x4c5d21){this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x1b1'),_0x4c5d21));var _0x174d36=this[_0xc363('0xf')]['streamFile'](_0x4c5d21);try{fs[_0xc363('0x113')](_0x4c5d21+'.wav');}catch(_0x555db6){logger[_0xc363('0x2b')](_0x555db6);}return _0x174d36;}return this[_0xc363('0xf')][_0xc363('0x2b')](_0x40c7c8,_0xc363('0x1b2'));};AGIVertices[_0xc363('0x12')][_0xc363('0x1b3')]=function(_0x22fc6f){logger['info'](util[_0xc363('0x27')](_0xc363('0x1b4'),_0x22fc6f[_0xc363('0x39')]));_0x22fc6f[_0xc363('0x5e')]=_0x22fc6f[_0xc363('0x5e')][_0xc363('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc363('0x83')](_0x22fc6f[_0xc363('0x5e')])){return this[_0xc363('0xf')][_0xc363('0xab')]('no\x20text\x20configured');}this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x1b5'),_0x22fc6f[_0xc363('0x5e')]));var _0x1ec8aa=this[_0xc363('0x65')]['sync'](this,_0x22fc6f);if(_0x1ec8aa){this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0x1b6'),_0x1ec8aa));var _0x22f973=this['channel'][_0xc363('0x112')](_0x1ec8aa);try{fs[_0xc363('0x113')](_0x1ec8aa+_0xc363('0xf4'));}catch(_0x1d505e){logger[_0xc363('0x2b')](_0x1d505e);}return _0x22f973;}return this['channel'][_0xc363('0x2b')](_0x22fc6f,_0xc363('0x1b7'));};AGIVertices[_0xc363('0x12')]['unpause']=function(_0x1a387d){logger['info'](util[_0xc363('0x27')](_0xc363('0x1b8'),_0x1a387d[_0xc363('0x39')]));if(!this[_0xc363('0x83')](_0x1a387d['findBy'])){return this[_0xc363('0xf')][_0xc363('0x2b')](_0x1a387d,_0xc363('0x147'));}logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x148'),this[_0xc363('0xf')][_0xc363('0x3c')],_0x1a387d[_0xc363('0x149')]));var _0x16b6ac=this[_0xc363('0x52')][_0xc363('0x74')](this,_0x1a387d[_0xc363('0x149')]);if(_0x16b6ac){logger['info'](util[_0xc363('0x27')](_0xc363('0x14a'),this[_0xc363('0xf')][_0xc363('0x3c')],_0x1a387d[_0xc363('0x149')]));this['channel']['noop'](util[_0xc363('0x27')](_0xc363('0x14a'),this[_0xc363('0xf')][_0xc363('0x3c')],_0x1a387d['findBy']));return{'code':0xc8,'result':_0xc363('0x14b')};}else{logger['info'](util[_0xc363('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xc363('0x3c')],_0x1a387d[_0xc363('0x149')]));this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x1a387d[_0xc363('0x149')]));return{'code':0xc8,'result':_0xc363('0x14d')};}};AGIVertices['prototype']['voicemail']=function(_0x425449){logger['info'](util['format'](_0xc363('0x1b9'),_0x425449[_0xc363('0x39')]));var _0xd9ccdc=this['channel']['exec'](_0xc363('0x1ba'),[_0x425449[_0xc363('0x1bb')],_0x425449[_0xc363('0x7b')]]);if(_0xd9ccdc[_0xc363('0xa5')]===-0x1){return _0xd9ccdc;}return this[_0xc363('0xf')][_0xc363('0xab')](util[_0xc363('0x27')](_0xc363('0xc4'),_0xc363('0x1ba'),_0x425449[_0xc363('0x1bb')]));};AGIVertices[_0xc363('0x12')][_0xc363('0x1bc')]=function(_0x464dec){logger[_0xc363('0x2d')](util[_0xc363('0x27')](_0xc363('0x1bd'),_0x464dec['label']));if(!this['isConfigured'](_0x464dec[_0xc363('0xd5')])){return this[_0xc363('0xf')]['error'](_0x464dec,_0xc363('0x1be'));}var _0x5d30d9=this[_0xc363('0xa4')]['sync'](this,_0x464dec[_0xc363('0xd5')]);if(!_0x5d30d9){return this[_0xc363('0xf')]['error'](_0x464dec,_0xc363('0xd6'));}var _0x46158d=this['channel'][_0xc363('0xa4')](_0x5d30d9);return{'code':0xc8,'result':_0x46158d[_0xc363('0xa2')]?_0x46158d[_0xc363('0xa2')]:'-'};};String[_0xc363('0x12')][_0xc363('0xa1')]=function(_0x513d30,_0x2529b5){return this['split'](_0x513d30)[_0xc363('0x1bf')](_0x2529b5);};module[_0xc363('0x1c0')]=AGIVertices; \ No newline at end of file +var _0xb1ef=['Enter\x20in\x20AGI\x20(%s)\x20block','command','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','no\x20list\x20selected','delay','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','sestekNDA','audiofile','streamFile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','opts','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','response','mindigit','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','awsPolly','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','beep','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','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','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','NOBEEP','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','FIND\x20AGENT\x20%s\x20BY\x20%s','math','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','record','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','email','user','bcc','service','host','port','secure','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','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','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','split','join','exports','util','shelljs','odbc','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','menu','getdigits','getsecretdigits','channel','rpc','prototype','getVariable','name','catch','getVoiceQueue','getVoiceQueueById','then','getSquareProject','getSquareProjectById','getSquareOdbc','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','sendMailMessage','mailRpc','getIntervals','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','info','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','createSquareRecording','uniqueid','callerid','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','MALE','MP3','googleTTS','restAPI','method','timeout','number','includes','POST','toUpperCase','body','parse','rawBody','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','headers','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','aws_secret_access_key','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','%s.%s','saveRestApiResult','setVariable','replaceAll','extra','toString','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','noop','no\x20text\x20configured','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s'];(function(_0x44fdef,_0x3b4291){var _0x33ad1b=function(_0x2d16a5){while(--_0x2d16a5){_0x44fdef['push'](_0x44fdef['shift']());}};_0x33ad1b(++_0x3b4291);}(_0xb1ef,0x107));var _0xfb1e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ef[_0x20a584];return _0x4b41a8;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xfb1e('0x0'));var _=require('lodash');var sh=require(_0xfb1e('0x1'));var odbc=require(_0xfb1e('0x2'))();var rs=require('randomstring');var moment=require('moment');var Mustache=require(_0xfb1e('0x3'));var rp=require(_0xfb1e('0x4'));var logger=require(_0xfb1e('0x5'))(_0xfb1e('0x6'));var config=require(_0xfb1e('0x7'));var scripts=require(_0xfb1e('0x8'));var FILES_PATH=_0xfb1e('0x9');var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0xfb1e('0xa'),_0xfb1e('0xb'),_0xfb1e('0xc')];var AGIVertices=function(_0x2dc186,_0x20c871,_0x1e271){this[_0xfb1e('0xd')]=_0x2dc186;this[_0xfb1e('0xe')]=_0x20c871;this['mailRpc']=_0x1e271;};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x10')]=function(_0x1dcede,_0x34ce02){this[_0xfb1e('0xe')]['getVariableById'](_0x1dcede)['then'](function(_0x1e890e){_0x34ce02(null,_0x1e890e?_0x1e890e[_0xfb1e('0x11')]:![]);})[_0xfb1e('0x12')](function(_0x36680e){_0x34ce02(_0x36680e);});};AGIVertices['prototype'][_0xfb1e('0x13')]=function(_0x27a0d1,_0x2a2d22){this[_0xfb1e('0xe')][_0xfb1e('0x14')](_0x27a0d1)[_0xfb1e('0x15')](function(_0x2c061f){_0x2a2d22(null,_0x2c061f?_0x2c061f[_0xfb1e('0x11')]:![]);})[_0xfb1e('0x12')](function(_0x4e3d80){_0x2a2d22(_0x4e3d80);});};AGIVertices['prototype'][_0xfb1e('0x16')]=function(_0x1cc3c2,_0x5554c6){this[_0xfb1e('0xe')][_0xfb1e('0x17')](_0x1cc3c2)['then'](function(_0xd7df62){_0x5554c6(null,_0xd7df62?_0xd7df62[_0xfb1e('0x11')]:![]);})['catch'](function(_0x18b65c){_0x5554c6(_0x18b65c);});};AGIVertices['prototype'][_0xfb1e('0x18')]=function(_0xda2a12,_0x584cbf){this[_0xfb1e('0xe')]['getSquareOdbcById'](_0xda2a12)[_0xfb1e('0x15')](function(_0x2d1029){_0x584cbf(null,_0x2d1029?_0x2d1029['dsn']:![]);})[_0xfb1e('0x12')](function(_0x68a761){_0x584cbf(_0x68a761);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x19')]=function(_0x4304ac,_0x5bf6fd){this['rpc'][_0xfb1e('0x1a')](_0x4304ac)[_0xfb1e('0x15')](function(_0x511e71){_0x5bf6fd(null,_0x511e71?_0x511e71[_0xfb1e('0x11')]:![]);})[_0xfb1e('0x12')](function(_0x169da0){_0x5bf6fd(_0x169da0);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x1b')]=function(_0x533d88,_0xfa35f8){this['rpc']['getTrunkById'](_0x533d88)[_0xfb1e('0x15')](function(_0x42266b){_0xfa35f8(null,_0x42266b?_0x42266b[_0xfb1e('0x11')]:![]);})[_0xfb1e('0x12')](function(_0xe23d12){_0xfa35f8(_0xe23d12);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x1c')]=function(_0xd41279,_0xa79258){var _0x1bfc76=this;this['rpc'][_0xfb1e('0x1d')](_0xd41279)['then'](function(_0x12fc28){_0xa79258(null,_0x12fc28?_0x1bfc76[_0xfb1e('0x1e')](_0x12fc28[_0xfb1e('0x1f')]):![]);})[_0xfb1e('0x12')](function(_0x389650){_0xa79258(_0x389650);});};AGIVertices['prototype']['getMailAccount']=function(_0x50769c,_0x16787b){this['rpc']['getMailAccountById'](_0x50769c)[_0xfb1e('0x15')](function(_0x32892d){_0x16787b(null,_0x32892d?_0x32892d:![]);})[_0xfb1e('0x12')](function(_0x350316){_0x16787b(_0x350316);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x20')]=function(_0x535f99,_0x498b60,_0x286eb5){this[_0xfb1e('0x21')][_0xfb1e('0x20')](_0x535f99,_0x498b60)[_0xfb1e('0x15')](function(){_0x286eb5(null);})['catch'](function(_0x3f93e3){_0x286eb5(_0x3f93e3);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x22')]=function(_0x3c19ad,_0xe20319){this[_0xfb1e('0xe')]['getIntervalById'](_0x3c19ad)[_0xfb1e('0x15')](function(_0x2102eb){if(_0x2102eb){if(_0x2102eb[_0xfb1e('0x23')]){_0xe20319(null,[_0x2102eb[_0xfb1e('0x24')]]);}else{_0xe20319(null,_[_0xfb1e('0x25')](_0x2102eb['Intervals'],_0xfb1e('0x24')));}}else{_0xe20319(null,![]);}})[_0xfb1e('0x12')](function(_0x405029){_0xe20319(_0x405029);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x1e')]=function(_0x4210a0){return util[_0xfb1e('0x26')](_0xfb1e('0x27'),FILES_PATH,_0x4210a0);};AGIVertices['prototype'][_0xfb1e('0x28')]=function(_0xca3bc4,_0x15ebc1,_0x3626b6){odbc[_0xfb1e('0x29')](_0xca3bc4,function(_0x19cfb7){if(_0x19cfb7){logger[_0xfb1e('0x2a')](_0xfb1e('0x2b'),_0x19cfb7);_0x3626b6(_0x19cfb7);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0xfb1e('0x2c')](_0x15ebc1,function(_0x3d543c,_0x3f4b8b){if(_0x3d543c){logger[_0xfb1e('0x2d')](_0xfb1e('0x2e'),_0x15ebc1);_0x3626b6(_0x3d543c);}else{logger['info'](_0xfb1e('0x2f'),_0x15ebc1);odbc[_0xfb1e('0x30')](function(_0x547731){if(_0x547731){logger[_0xfb1e('0x2a')](_0xfb1e('0x31'),_0x547731);}_0x3626b6(null,_0x3f4b8b);});}});}});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x32')]=function(_0x220068,_0x52966b){this[_0xfb1e('0xe')][_0xfb1e('0x33')](_0x220068)['then'](function(_0x2341cf){_0x52966b(null,_0x2341cf?_0x2341cf:![]);})[_0xfb1e('0x12')](function(_0x4d4253){_0x52966b(_0x4d4253);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x34')]=function(_0x3091f6,_0x4f9dcb){this[_0xfb1e('0xe')][_0xfb1e('0x34')](_0x3091f6)[_0xfb1e('0x15')](function(_0x179d33){_0x4f9dcb(null,_0x179d33);})['catch'](function(_0xa5ef6d){_0x4f9dcb(_0xa5ef6d);});};AGIVertices['prototype'][_0xfb1e('0x35')]=function(_0x5764c3,_0x57ce1c,_0x4eb234){this['rpc'][_0xfb1e('0x35')]({'uniqueid':this[_0xfb1e('0xd')]['uniqueid'],'node':_0x5764c3['label'],'application':_0x5764c3[_0xfb1e('0x36')],'data':_0x57ce1c||null,'project_name':this[_0xfb1e('0xd')][_0xfb1e('0x37')],'callerid':this[_0xfb1e('0xd')]['callerid']})['then'](function(_0x5de782){if(_0x4eb234){_0x4eb234(null,_0x5de782);}})['catch'](function(_0x49ef20){if(_0x4eb234){_0x4eb234(_0x49ef20);}});};AGIVertices[_0xfb1e('0xf')]['createSquareRecording']=function(_0x1ddbdd,_0x57d4a8,_0x6846cd,_0x1aaad4){this[_0xfb1e('0xe')][_0xfb1e('0x38')]({'uniqueid':this[_0xfb1e('0xd')][_0xfb1e('0x39')],'callerid':this[_0xfb1e('0xd')][_0xfb1e('0x3a')],'calleridname':this[_0xfb1e('0xd')]['calleridname'],'context':this[_0xfb1e('0xd')][_0xfb1e('0x3b')],'extension':this[_0xfb1e('0xd')][_0xfb1e('0x3c')],'priority':this[_0xfb1e('0xd')]['priority'],'accountcode':this['channel'][_0xfb1e('0x3d')],'dnid':this[_0xfb1e('0xd')][_0xfb1e('0x3e')],'projectName':this[_0xfb1e('0xd')][_0xfb1e('0x37')],'saveName':_0x57d4a8,'filename':_0x1ddbdd[_0xfb1e('0x3f')]||_0x57d4a8,'savePath':_0x6846cd})[_0xfb1e('0x15')](function(_0x2f846b){_0x1aaad4(null,_0x2f846b);})['catch'](function(_0x37d4c2){_0x1aaad4(_0x37d4c2);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x40')]=function(_0x5a747a,_0x41640b,_0x368fd4){this[_0xfb1e('0xe')][_0xfb1e('0x40')]({'uniqueid':this['channel'][_0xfb1e('0x39')],'body':_0x5a747a,'direction':_0x41640b})['then'](function(_0x14336a){if(_0x368fd4){_0x368fd4(null,_0x14336a);}})[_0xfb1e('0x12')](function(_0x4610f1){if(_0x368fd4){_0x368fd4(_0x4610f1);}});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x41')]=function(_0x3d54f1,_0x22bcff){this[_0xfb1e('0xe')][_0xfb1e('0x41')]({'firstName':_[_0xfb1e('0x42')](_0x3d54f1['name'])||_[_0xfb1e('0x43')](_0x3d54f1[_0xfb1e('0x11')])?'callback_'+Math[_0xfb1e('0x44')]():_0x3d54f1[_0xfb1e('0x11')],'lastName':_[_0xfb1e('0x42')](_0x3d54f1[_0xfb1e('0x45')])||_[_0xfb1e('0x43')](_0x3d54f1[_0xfb1e('0x45')])?null:_0x3d54f1[_0xfb1e('0x45')],'phone':_0x3d54f1[_0xfb1e('0x46')],'ListId':_0x3d54f1['list_id'],'scheduledat':_0x3d54f1[_0xfb1e('0x47')],'callbackUniqueid':this[_0xfb1e('0xd')]['uniqueid'],'tags':'callback','description':_0xfb1e('0x48')+_0x3d54f1[_0xfb1e('0x47')]['toString'](),'priority':_0x3d54f1['callback_priority']})[_0xfb1e('0x15')](function(_0xbafbad){_0x22bcff(null,_0xbafbad);})['catch'](function(_0x86c03b){_0x22bcff(_0x86c03b);});};AGIVertices['prototype'][_0xfb1e('0x49')]=function(_0x18fcf5,_0x53bad3){this[_0xfb1e('0xe')][_0xfb1e('0x4a')](_0x18fcf5)[_0xfb1e('0x15')](function(_0x14b905){_0x53bad3(null,_0x14b905?_0x14b905[_0xfb1e('0x11')]:![]);})[_0xfb1e('0x12')](function(_0x18f564){_0x53bad3(_0x18f564);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x4b')]=function(_0x13a031,_0x24e498,_0x1c6ce5){var _0xbe8d94={'role':_0xfb1e('0x4c')};_0xbe8d94[_0x13a031]=this['channel'][_0xfb1e('0x3a')];this[_0xfb1e('0xe')][_0xfb1e('0x4b')](_0xbe8d94,_0x24e498,this[_0xfb1e('0xd')][_0xfb1e('0x39')])[_0xfb1e('0x15')](function(_0x29a1e6){_0x1c6ce5(null,_[_0xfb1e('0x43')](_0x29a1e6)?![]:!![]);})['catch'](function(_0x57d9fd){logger['error'](_0x57d9fd);_0x1c6ce5(null,![]);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x4d')]=function(_0x3185d3,_0x245202){var _0x1e5403={'role':_0xfb1e('0x4c')};_0x1e5403[_0x3185d3]=this[_0xfb1e('0xd')][_0xfb1e('0x3a')];this[_0xfb1e('0xe')][_0xfb1e('0x4d')](_0x1e5403)[_0xfb1e('0x15')](function(_0x1263ba){_0x245202(null,_[_0xfb1e('0x43')](_0x1263ba)?![]:!![]);})[_0xfb1e('0x12')](function(_0x2674f7){logger[_0xfb1e('0x2a')](_0x2674f7);_0x245202(null,![]);});};AGIVertices[_0xfb1e('0xf')]['agentLogout']=function(_0x4c0afc,_0x49465a){var _0x858f17={'role':_0xfb1e('0x4c')};_0x858f17[_0x4c0afc]=this['channel']['callerid'];this[_0xfb1e('0xe')][_0xfb1e('0x4e')](_0x858f17)[_0xfb1e('0x15')](function(_0x418c34){_0x49465a(null,_[_0xfb1e('0x43')](_0x418c34)?![]:!![]);})['catch'](function(_0xf9b209){logger['error'](_0xf9b209);_0x49465a(null,![]);});};AGIVertices[_0xfb1e('0xf')]['agentLogin']=function(_0x3f1fa4,_0x4e8f79){var _0x3c21e8={'role':_0xfb1e('0x4c')};_0x3c21e8[_0x3f1fa4]=this[_0xfb1e('0xd')][_0xfb1e('0x3a')];var _0x54940a=_0x3f1fa4!='internal'?util[_0xfb1e('0x26')]('%s/%s@from-sip/n',_0xfb1e('0x4f'),this['channel'][_0xfb1e('0x3a')]):undefined;this[_0xfb1e('0xe')][_0xfb1e('0x50')](_0x3c21e8,_0x54940a)[_0xfb1e('0x15')](function(_0x44637b){_0x4e8f79(null,_['isNil'](_0x44637b)?![]:!![]);})[_0xfb1e('0x12')](function(_0x134d64){logger['error'](_0x134d64);_0x4e8f79(null,![]);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x51')]=function(_0x148c1,_0x52774a){sh[_0xfb1e('0x52')](_[_0xfb1e('0x53')](_0x148c1),function(_0x2d807d,_0x50f1a8){var _0x2bae82=_0x50f1a8[_0xfb1e('0x54')](/(\r\n|\n|\r)/gm,'');_0x52774a(null,_0x2bae82);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x55')]=function(_0x5832e1,_0x4bd9f7){scripts[_0xfb1e('0x55')](_0x5832e1[_0xfb1e('0x56')],_0x5832e1['google_cloud_tts_text_type']||_0xfb1e('0x57'),_0x5832e1[_0xfb1e('0x57')],_0x5832e1[_0xfb1e('0x58')]||_0xfb1e('0x59'),_0x5832e1['ssmlGender']||_0xfb1e('0x5a'),_0x5832e1['audioEncoding']||_0xfb1e('0x5b'))[_0xfb1e('0x15')](function(_0x5f2780){_0x4bd9f7(null,_0x5f2780);})['catch'](function(_0x41c3ff){_0x4bd9f7(_0x41c3ff);});};AGIVertices['prototype'][_0xfb1e('0x5c')]=function(_0x22e5d5,_0x21d0cd){scripts[_0xfb1e('0x5c')](_0x22e5d5[_0xfb1e('0x57')],_0x22e5d5['google_tts_language']||'en',0x1)[_0xfb1e('0x15')](function(_0x280787){_0x21d0cd(null,_0x280787);})[_0xfb1e('0x12')](function(_0x1f523f){_0x21d0cd(_0x1f523f);});};AGIVertices['prototype'][_0xfb1e('0x5d')]=function(_0x33228f,_0x27b9fb){var _0x3c6425={'uri':_0x33228f['url'],'method':_0x33228f[_0xfb1e('0x5e')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x33228f[_0xfb1e('0x5f')])===_0xfb1e('0x60')&&parseInt(_0x33228f[_0xfb1e('0x5f')])>=0x1?parseInt(_0x33228f[_0xfb1e('0x5f')])*0x3e8:0x5*0x3e8};if(_[_0xfb1e('0x61')]([_0xfb1e('0x62'),'PUT'],_0x3c6425[_0xfb1e('0x5e')][_0xfb1e('0x63')]())){try{_0x3c6425[_0xfb1e('0x64')]=_0x33228f['rawBody']?JSON[_0xfb1e('0x65')](_0x33228f[_0xfb1e('0x66')]):{};}catch(_0x4f34f9){logger[_0xfb1e('0x2a')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4f34f9);}}try{_0x3c6425['headers']=_0x33228f[_0xfb1e('0x67')]?JSON['parse'](_0x33228f['rawHeaders']):{};}catch(_0x39bb3f){logger[_0xfb1e('0x2a')](_0xfb1e('0x68'),_0x39bb3f);}if(_0x33228f['computedVariables']){try{var _0x467569=require(_0x33228f[_0xfb1e('0x69')])[_0xfb1e('0x6a')](this,_0x3c6425);_0x3c6425[_0xfb1e('0x6b')]=Mustache[_0xfb1e('0x6c')](_0x33228f[_0xfb1e('0x6d')],_0x467569,{},['$$','$$']);if(_0x3c6425['headers']){_0x3c6425[_0xfb1e('0x6e')]=JSON[_0xfb1e('0x65')](Mustache['render'](JSON[_0xfb1e('0x6f')](_0x3c6425['headers']),_0x467569,{},['$$','$$']));}if(_0x3c6425['body']){_0x3c6425[_0xfb1e('0x64')]=JSON['parse'](Mustache['render'](JSON[_0xfb1e('0x6f')](_0x3c6425[_0xfb1e('0x64')]),_0x467569,{},['$$','$$']));}}catch(_0x49f71c){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x49f71c);}}rp(_0x3c6425)[_0xfb1e('0x15')](function(_0x4cfe25){var _0x381c95={'statusCode':_0x4cfe25[_0xfb1e('0x70')]||0xc8,'statusMessage':_0x4cfe25[_0xfb1e('0x71')]||'OK','headers':_0x4cfe25[_0xfb1e('0x6e')]||{},'body':_0x4cfe25[_0xfb1e('0x64')]||{}};_0x27b9fb(null,_0x381c95);})[_0xfb1e('0x12')](function(_0x544186){var _0x519cf1={'statusCode':_0x544186[_0xfb1e('0x70')]||0x1f4,'statusMessage':_0x544186[_0xfb1e('0x72')]||_0xfb1e('0x73'),'headers':_0x544186[_0xfb1e('0x74')][_0xfb1e('0x6e')]||{},'body':_0x544186[_0xfb1e('0x74')][_0xfb1e('0x64')]||{}};_0x27b9fb(null,_0x519cf1);});};AGIVertices[_0xfb1e('0xf')]['googleDialogflow']=function(_0xd1ad33,_0x28475c){scripts[_0xfb1e('0x75')](this[_0xfb1e('0xd')][_0xfb1e('0x39')],_0xd1ad33[_0xfb1e('0x76')],_0xd1ad33['text'],_0xd1ad33[_0xfb1e('0x77')]||'en')['then'](function(_0x5cffc2){_0x28475c(null,_0x5cffc2);})['catch'](function(_0x290399){_0x28475c(_0x290399);});};AGIVertices[_0xfb1e('0xf')]['sestekNDA']=function(_0x294ee9,_0x9095bc){scripts['sestekNDA'](this[_0xfb1e('0xd')],_0x294ee9)['then'](function(_0x1eaf4a){_0x9095bc(null,_0x1eaf4a);})[_0xfb1e('0x12')](function(_0x44429e){_0x9095bc(_0x44429e);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x78')]=function(_0x268f60,_0x4b80d7){scripts[_0xfb1e('0x78')](_0x268f60[_0xfb1e('0x76')],_0x268f60[_0xfb1e('0x57')],_0x268f60[_0xfb1e('0x79')]||_0xfb1e('0x59'),_0x268f60[_0xfb1e('0x7a')])[_0xfb1e('0x15')](function(_0x3670dc){_0x4b80d7(null,_0x3670dc);})[_0xfb1e('0x12')](function(_0x3fc333){_0x4b80d7(_0x3fc333);});};AGIVertices['prototype'][_0xfb1e('0x7b')]=function(_0x213f14,_0x457ad4,_0x5a226d){scripts[_0xfb1e('0x7b')](_0x457ad4,_0x213f14[_0xfb1e('0x76')],_0x213f14['ispeech_asr_language']||_0xfb1e('0x59'),this[_0xfb1e('0x7c')](_0x213f14[_0xfb1e('0x7d')])?_0x213f14[_0xfb1e('0x7d')]:undefined)['then'](function(_0x5875fe){_0x5a226d(null,_0x5875fe);})[_0xfb1e('0x12')](function(_0x188daf){_0x5a226d(_0x188daf);});};AGIVertices[_0xfb1e('0xf')]['awsPolly']=function(_0x247c76,_0x31aa26){scripts['awsPolly'](_0x247c76['aws_access_key_id'],_0x247c76[_0xfb1e('0x7e')],_0x247c76['aws_polly_region'],_0x247c76['aws_polly_voice']||_0xfb1e('0x7f'),_0x247c76[_0xfb1e('0x57')],_0x247c76[_0xfb1e('0x80')]||_0xfb1e('0x57'))[_0xfb1e('0x15')](function(_0x10b4e5){_0x31aa26(null,_0x10b4e5);})[_0xfb1e('0x12')](function(_0x59641c){_0x31aa26(_0x59641c);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x81')]=function(_0xf6f3e4,_0x149e6f){scripts[_0xfb1e('0x81')](this[_0xfb1e('0xd')]['uniqueid'],_0xf6f3e4[_0xfb1e('0x82')],_0xf6f3e4[_0xfb1e('0x7e')],_0xf6f3e4[_0xfb1e('0x83')],_0xf6f3e4[_0xfb1e('0x57')],_0xf6f3e4[_0xfb1e('0x84')])[_0xfb1e('0x15')](function(_0x5efdf2){_0x149e6f(null,_0x5efdf2);})[_0xfb1e('0x12')](function(_0x136cb7){_0x149e6f(_0x136cb7);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x85')]=function(_0x280391,_0x2eba90,_0x1ad00e){scripts[_0xfb1e('0x85')](_0x2eba90,_0x280391[_0xfb1e('0x76')],_0x280391['google_asr_language']||_0xfb1e('0x59'))[_0xfb1e('0x15')](function(_0x132b62){_0x1ad00e(null,_0x132b62);})[_0xfb1e('0x12')](function(_0x524063){_0x1ad00e(_0x524063);});};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x86')]=function(_0x1bf448,_0x442608,_0x1192e4){scripts[_0xfb1e('0x86')](_0x442608,_0x1bf448[_0xfb1e('0x87')],_0x1bf448[_0xfb1e('0x88')],_0x1bf448[_0xfb1e('0x6b')])[_0xfb1e('0x15')](function(_0x4463db){_0x1192e4(null,_0x4463db);})[_0xfb1e('0x12')](function(_0x236e79){_0x1192e4(_0x236e79);});};AGIVertices[_0xfb1e('0xf')]['clear']=function(_0x58b906){var _0x30aa55=_[_0xfb1e('0x61')](verticesWithRetry,_0x58b906[_0xfb1e('0x36')])?_0x58b906:_[_0xfb1e('0x89')](_0x58b906);for(var _0x34b0d1 in _0x30aa55){if(_0x30aa55[_0xfb1e('0x8a')](_0x34b0d1)){if(_0x30aa55[_0x34b0d1]&&_[_0xfb1e('0x8b')](_0x30aa55[_0x34b0d1])){if(_[_0xfb1e('0x61')](recursiveMapAttributes,_0x34b0d1)){_0x30aa55[_0x34b0d1]=this[_0xfb1e('0x8c')](_0x30aa55[_0x34b0d1]);}else{_0x30aa55[_0x34b0d1]=this[_0xfb1e('0x8d')](_0x30aa55[_0x34b0d1]);}}}}return _0x30aa55;};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x8e')]=function(_0x3f68f2){for(var _0x1e5ec4 in _0x3f68f2){if(_0x3f68f2[_0xfb1e('0x8a')](_0x1e5ec4)){if(_['isPlainObject'](_0x3f68f2[_0x1e5ec4])){this[_0xfb1e('0x8e')](_0x3f68f2[_0x1e5ec4]);}else if(_[_0xfb1e('0x8f')](_0x3f68f2[_0x1e5ec4])){for(var _0x4b63c2=0x0;_0x4b63c2<_0x3f68f2[_0x1e5ec4][_0xfb1e('0x90')];_0x4b63c2++){this['recursiveNodeIndex'](_0x3f68f2[_0x1e5ec4][_0x4b63c2]);}}else if(_[_0xfb1e('0x8b')](_0x3f68f2[_0x1e5ec4])){_0x3f68f2[_0x1e5ec4]=this[_0xfb1e('0x8d')](_0x3f68f2[_0x1e5ec4]);}}}};AGIVertices[_0xfb1e('0xf')]['saveRestApiResult']=function(_0x9a4da1,_0x3f30fd){for(var _0x2b3405 in _0x9a4da1){if(_0x9a4da1[_0xfb1e('0x8a')](_0x2b3405)){if(_['isPlainObject'](_0x9a4da1[_0x2b3405])){if(!_[_0xfb1e('0x42')](_0x9a4da1[_0x2b3405])){this['saveRestApiResult'](_0x9a4da1[_0x2b3405],util[_0xfb1e('0x26')](_0xfb1e('0x91'),_0x3f30fd,_0x2b3405));}}else if(_[_0xfb1e('0x8f')](_0x9a4da1[_0x2b3405])){for(var _0x4cb155=0x0;_0x4cb155<_0x9a4da1[_0x2b3405][_0xfb1e('0x90')];_0x4cb155++){this[_0xfb1e('0x92')](_0x9a4da1[_0x2b3405][_0x4cb155],util[_0xfb1e('0x26')](_0xfb1e('0x91'),_0x3f30fd,_0x2b3405+'['+_0x4cb155+']'));}}else{if(!_[_0xfb1e('0x43')](_0x9a4da1[_0x2b3405])){this[_0xfb1e('0xd')][_0xfb1e('0x93')](util[_0xfb1e('0x26')](_0xfb1e('0x91'),_0x3f30fd,_0x2b3405),_0x9a4da1[_0x2b3405]);}}}}};AGIVertices[_0xfb1e('0xf')]['replaceObjectAllVariables']=function(_0x10eaca){try{var _0x33e4dd=JSON[_0xfb1e('0x65')](_0x10eaca);this[_0xfb1e('0x8e')](_0x33e4dd);return JSON[_0xfb1e('0x6f')](_0x33e4dd);}catch(_0x5278a7){return this[_0xfb1e('0x8d')](_0x10eaca);}};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x8d')]=function(_0x524308){var _0x52101f=_0x524308['split']('{');for(var _0x5d2320=0x1;_0x5d2320<_0x52101f['length'];_0x5d2320+=0x1){var _0x5e4543=_0x52101f[_0x5d2320]['split']('}');if(_0x5e4543[_0xfb1e('0x90')]>0x1){_0x524308=_0x524308[_0xfb1e('0x94')]('{'+_0x5e4543[0x0]+'}',this[_0xfb1e('0xd')][_0xfb1e('0x10')](_0x5e4543[0x0])[_0xfb1e('0x95')]||_0x5e4543[0x0]);}}if(_0x52101f[_0xfb1e('0x90')]===0x1){return _0x524308[_0xfb1e('0x96')]();}return this[_0xfb1e('0x8d')](_0x524308);};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x97')]=function(_0x1811b9,_0x5332fe){var _0x4486a8=this[_0xfb1e('0xd')][_0xfb1e('0x10')](_0x1811b9);if(_0x4486a8[_0xfb1e('0x98')]===-0x1){return _0x4486a8;}logger['info'](util['format'](_0xfb1e('0x99'),_0x5332fe,_0x4486a8[_0xfb1e('0x95')]));return this[_0xfb1e('0xd')][_0xfb1e('0x93')](_0x5332fe,_0x4486a8['extra']);};AGIVertices['prototype']['isConfigured']=function(_0x19bbf4){return _0x19bbf4&&_0x19bbf4!=='0'&&_0x19bbf4!=='-1'&&_0x19bbf4!=='';};AGIVertices['prototype'][_0xfb1e('0x9a')]=function(_0x1b00ed){this[_0xfb1e('0x35')][_0xfb1e('0x6a')](this,_0x1b00ed,'-');_0x1b00ed[_0xfb1e('0x9b')]=_0x1b00ed[_0xfb1e('0x9a')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x9c')]=function(_0xd343c7){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0xd343c7['label']));if(!this[_0xfb1e('0x7c')](_0xd343c7['text'])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x9e'));}var _0x23b068='\x22'+_0xd343c7['text']+'\x22';if(this['isConfigured'](_0xd343c7[_0xfb1e('0x74')])){_0x23b068+=','+_0xd343c7['options'];}var _0x158cd6=this[_0xfb1e('0xd')][_0xfb1e('0x52')]('MRCPSynth',_0x23b068);if(_0x158cd6[_0xfb1e('0x98')]===-0x1){return _0x158cd6;}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x23b068));};AGIVertices[_0xfb1e('0xf')]['mrcprecog']=function(_0xf2f97d){logger['info'](util['format'](_0xfb1e('0x9f'),_0xf2f97d[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0xf2f97d['grammar'])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')]('no\x20grammar\x20configured');}var _0x30e27d=_0xf2f97d[_0xfb1e('0xa1')];if(this[_0xfb1e('0x7c')](_0xf2f97d[_0xfb1e('0x74')])){_0x30e27d+=','+_0xf2f97d[_0xfb1e('0x74')];}var _0x4fc102=this['channel']['exec'](_0xfb1e('0xa2'),_0x30e27d);if(_0x4fc102[_0xfb1e('0x98')]===-0x1){return _0x4fc102;}var _0x296b0b=this[_0xfb1e('0x97')](_0xfb1e('0xa3'),_0xfb1e('0xa4'));if(_0x296b0b[_0xfb1e('0x98')]===-0x1){return _0x296b0b;}var _0xc240f9=this['getAndSetVariable'](_0xfb1e('0xa5'),'MRCP_RECOG_TRANSCRIPT');if(_0xc240f9['result']===-0x1){return _0xc240f9;}var _0x21e589=this['getAndSetVariable']('RECOG_INSTANCE()',_0xfb1e('0xa6'));if(_0x21e589[_0xfb1e('0x98')]===-0x1){return _0x21e589;}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util['format'](_0xfb1e('0xa7'),_0x30e27d));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x6')]=function(_0x557014){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0xa8'),_0x557014[_0xfb1e('0xa0')]));return this['channel'][_0xfb1e('0x6')]([_0x557014[_0xfb1e('0xa9')],_0x557014['args']]);};AGIVertices[_0xfb1e('0xf')]['answer']=function(_0x3d743c){logger[_0xfb1e('0x2d')](util['format'](_0xfb1e('0xaa'),_0x3d743c['label']));if(this[_0xfb1e('0x7c')](_0x3d743c[_0xfb1e('0x5f')])){logger['info'](util[_0xfb1e('0x26')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x3d743c[_0xfb1e('0x5f')]));var _0x25526a=this[_0xfb1e('0xd')][_0xfb1e('0xab')](_0x3d743c[_0xfb1e('0x5f')]);if(_0x25526a[_0xfb1e('0x98')]===-0x1){return _0x25526a;}}return this[_0xfb1e('0xd')][_0xfb1e('0xac')]();};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0xad')]=function(_0x4abf93){logger['info'](util[_0xfb1e('0x26')](_0xfb1e('0xae'),_0x4abf93[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0x4abf93[_0xfb1e('0xaf')])){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x4abf93,_0xfb1e('0xb0'));}_0x4abf93['scheduledAt']=moment();if(this['isConfigured'](_0x4abf93[_0xfb1e('0xb1')])){_0x4abf93[_0xfb1e('0x47')]=moment()['add'](_0x4abf93[_0xfb1e('0xb1')],'minutes');}if(!this[_0xfb1e('0x7c')](_0x4abf93[_0xfb1e('0xb2')])){_0x4abf93[_0xfb1e('0xb2')]=0x2;}this[_0xfb1e('0x41')]['sync'](this,_0x4abf93);return this['channel'][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0xb3'),_0x4abf93[_0xfb1e('0x46')],_0x4abf93[_0xfb1e('0xaf')],_0x4abf93[_0xfb1e('0x47')]));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0xb4')]=function(_0x3ef04a){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0xb5'),_0x3ef04a[_0xfb1e('0xa0')]));var _0x4f6b05=this['channel'][_0xfb1e('0x52')](_0x3ef04a[_0xfb1e('0xb6')],_0x3ef04a[_0xfb1e('0x74')]);if(_0x4f6b05[_0xfb1e('0x98')]===-0x1){return _0x4f6b05;}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0xb7'),_0x3ef04a[_0xfb1e('0xb6')],_0x3ef04a['options']));};AGIVertices[_0xfb1e('0xf')]['lumenvoxtts']=function(_0x344258){logger[_0xfb1e('0x2d')](util['format'](_0xfb1e('0xb8'),_0x344258[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0x344258[_0xfb1e('0x57')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x9e'));}var _0xa0b995='\x22'+_0x344258[_0xfb1e('0x57')]+'\x22';if(this[_0xfb1e('0x7c')](_0x344258[_0xfb1e('0x74')])){_0xa0b995+=','+_0x344258[_0xfb1e('0x74')];}var _0x1e2c9b=this[_0xfb1e('0xd')][_0xfb1e('0x52')]('MRCPSynth',_0xa0b995);if(_0x1e2c9b[_0xfb1e('0x98')]===-0x1){return _0x1e2c9b;}return this[_0xfb1e('0xd')]['noop'](util[_0xfb1e('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0xa0b995));};AGIVertices[_0xfb1e('0xf')]['sestektts']=function(_0x150a41){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0xb9'),_0x150a41[_0xfb1e('0xa0')]));if(!this['isConfigured'](_0x150a41[_0xfb1e('0x57')])){return this['channel']['noop'](_0xfb1e('0x9e'));}var _0x4c9ab7='\x22'+_0x150a41[_0xfb1e('0x57')]+'\x22';if(this['isConfigured'](_0x150a41['options'])){_0x4c9ab7+=','+_0x150a41[_0xfb1e('0x74')];}var _0x335bc3=this[_0xfb1e('0xd')][_0xfb1e('0x52')](_0xfb1e('0xba'),_0x4c9ab7);if(_0x335bc3[_0xfb1e('0x98')]===-0x1){return _0x335bc3;}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0xbb'),_0x4c9ab7));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0xbc')]=function(_0x2e1311){logger[_0xfb1e('0x2d')](util['format'](_0xfb1e('0xbd'),_0x2e1311[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0x2e1311[_0xfb1e('0xa1')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0xbe'));}var _0x31b1a1=_0x2e1311['grammar'];if(this[_0xfb1e('0x7c')](_0x2e1311[_0xfb1e('0x74')])){_0x31b1a1+=','+_0x2e1311['options'];}var _0xd535fc=this[_0xfb1e('0xd')][_0xfb1e('0x52')](_0xfb1e('0xa2'),_0x31b1a1);if(_0xd535fc['result']===-0x1){return _0xd535fc;}var _0x52c4dd=this[_0xfb1e('0x97')](_0xfb1e('0xa3'),_0xfb1e('0xbf'));if(_0x52c4dd['result']===-0x1){return _0x52c4dd;}var _0x164933=this[_0xfb1e('0x97')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x164933[_0xfb1e('0x98')]===-0x1){return _0x164933;}var _0x205809=this['getAndSetVariable'](_0xfb1e('0xc0'),'LUMENVOX_ASR_INSTANCE');if(_0x205809['result']===-0x1){return _0x205809;}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0xa7'),_0x31b1a1));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0xc1')]=function(_0x2d89c7){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x2d89c7[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0x2d89c7[_0xfb1e('0xa1')])){return this['channel'][_0xfb1e('0x9d')](_0xfb1e('0xbe'));}var _0x5298ed=_0x2d89c7['grammar'];if(this[_0xfb1e('0x7c')](_0x2d89c7[_0xfb1e('0x74')])){_0x5298ed+=','+_0x2d89c7[_0xfb1e('0x74')];}var _0x19689b=this[_0xfb1e('0xd')][_0xfb1e('0x52')](_0xfb1e('0xa2'),_0x5298ed);if(_0x19689b[_0xfb1e('0x98')]===-0x1){return _0x19689b;}var _0xda87e=this[_0xfb1e('0x97')](_0xfb1e('0xa3'),_0xfb1e('0xc2'));if(_0xda87e[_0xfb1e('0x98')]===-0x1){return _0xda87e;}var _0x187489=this[_0xfb1e('0x97')](_0xfb1e('0xa5'),_0xfb1e('0xc3'));if(_0x187489[_0xfb1e('0x98')]===-0x1){return _0x187489;}var _0x201ca4=this['getAndSetVariable'](_0xfb1e('0xc0'),'SESTEK_ASR_INSTANCE');if(_0x201ca4[_0xfb1e('0x98')]===-0x1){return _0x201ca4;}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0xa7'),_0x5298ed));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0xc4')]=function(_0x242bed){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0xc5'),_0x242bed[_0xfb1e('0xa0')]));if(!this['isConfigured'](_0x242bed[_0xfb1e('0xc6')])){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x242bed,'no\x20database\x20selected');}var _0x1e4d66=this[_0xfb1e('0x18')][_0xfb1e('0x6a')](this,_0x242bed[_0xfb1e('0xc6')]);if(!_0x1e4d66){return this['channel'][_0xfb1e('0x2a')](_0x242bed,_0xfb1e('0xc7'));}if(!this[_0xfb1e('0x7c')](_0x242bed[_0xfb1e('0x2c')])){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x242bed,'no\x20query\x20configured');}var _0x45d9c5=_0x242bed['query'][_0xfb1e('0x54')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0xc8'),_0x45d9c5));var _0x52df21=this[_0xfb1e('0x28')][_0xfb1e('0x6a')](this,_0x1e4d66,_0x45d9c5);this[_0xfb1e('0x35')][_0xfb1e('0x6a')](this,_0x242bed,_0x45d9c5);if(!this['isConfigured'](_0x242bed[_0xfb1e('0xc9')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0xca'));}var _0x73ebdd=this[_0xfb1e('0x10')][_0xfb1e('0x6a')](this,_0x242bed[_0xfb1e('0xc9')]);if(!_0x73ebdd){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x242bed,_0xfb1e('0xcb'));}var _0x2c864d=this;_0x52df21[_0xfb1e('0xcc')](function(_0x59e371,_0x4e2bfa){Object[_0xfb1e('0xcd')](_0x59e371)['forEach'](function(_0x369e86){_0x2c864d[_0xfb1e('0xd')][_0xfb1e('0x93')](util[_0xfb1e('0x26')](_0xfb1e('0xce'),_0x73ebdd,_0x4e2bfa,_0x369e86),_0x59e371[_0x369e86]);});});this[_0xfb1e('0xd')][_0xfb1e('0x93')](util[_0xfb1e('0x26')](_0xfb1e('0xcf'),_0x73ebdd),_0x52df21[_0xfb1e('0x90')]);return this[_0xfb1e('0xd')]['noop'](util[_0xfb1e('0x26')](_0xfb1e('0xd0'),_0x73ebdd));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0xd1')]=function(_0x4c353d){logger[_0xfb1e('0xd2')](util[_0xfb1e('0x26')](_0xfb1e('0xd3'),_0x4c353d[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0x4c353d[_0xfb1e('0xd4')])){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x4c353d,_0xfb1e('0xd5'));}var _0x587a11=this[_0xfb1e('0x19')][_0xfb1e('0x6a')](this,_0x4c353d['sip_id']);if(!_0x587a11){return this['channel'][_0xfb1e('0x2a')](_0x4c353d,_0xfb1e('0xd6'));}var _0x13bedc=this[_0xfb1e('0xd')][_0xfb1e('0x52')](_0xfb1e('0xd7'),[util['format'](_0xfb1e('0xd8'),_0x587a11),_0x4c353d[_0xfb1e('0x5f')],_0x4c353d['opts'],_0x4c353d[_0xfb1e('0x6d')]]);if(_0x13bedc['result']===-0x1){return _0x13bedc;}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0xd9')]=function(_0x2e54f3){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0xda'),_0x2e54f3['label']));if(!this['isConfigured'](_0x2e54f3[_0xfb1e('0x76')])){return this['channel']['noop'](_0xfb1e('0xdb'));}if(!this['isConfigured'](_0x2e54f3['text'])){return this['channel'][_0xfb1e('0x9d')](_0xfb1e('0x9e'));}this[_0xfb1e('0xd')][_0xfb1e('0xdc')]=!![];this[_0xfb1e('0x35')](_0x2e54f3);this[_0xfb1e('0x40')](_0x2e54f3['text'],'in');this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('Trying\x20Dialogflow:\x20%s',_0x2e54f3[_0xfb1e('0x57')]));var _0x5df8cf=this[_0xfb1e('0x75')][_0xfb1e('0x6a')](this,_0x2e54f3);if(_0x5df8cf){for(var _0x2e7946 in _0x5df8cf){if(_0x5df8cf[_0xfb1e('0x8a')](_0x2e7946)){this[_0xfb1e('0xd')]['setVariable'](util[_0xfb1e('0x26')](_0xfb1e('0xdd'),_0x2e7946[_0xfb1e('0x63')]()),_0x5df8cf[_0x2e7946]);}}this['createSquareMessage'](_0x5df8cf[_0xfb1e('0xde')],_0xfb1e('0xdf'));return this[_0xfb1e('0xd')]['noop'](util[_0xfb1e('0x26')](_0xfb1e('0xe0'),_0x5df8cf[_0xfb1e('0xde')]));}return this['channel']['error'](_0x2e54f3,_0xfb1e('0xe1'));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0xe2')]=function(_0x28c40e){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0xe3'),_0x28c40e[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0x28c40e[_0xfb1e('0xe4')])){return this[_0xfb1e('0xd')]['noop']('no\x20ndauth\x20url\x20configured');}if(!this[_0xfb1e('0x7c')](_0x28c40e[_0xfb1e('0xe5')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0xe6'));}if(!this[_0xfb1e('0x7c')](_0x28c40e[_0xfb1e('0xe7')])){return this['channel'][_0xfb1e('0x9d')](_0xfb1e('0xe8'));}if(!this[_0xfb1e('0x7c')](_0x28c40e[_0xfb1e('0xe9')])){return this[_0xfb1e('0xd')]['noop'](_0xfb1e('0x9e'));}this[_0xfb1e('0xd')][_0xfb1e('0xdc')]=!![];this[_0xfb1e('0x35')](_0x28c40e);this[_0xfb1e('0x40')](_0x28c40e[_0xfb1e('0x57')],'in');this['channel'][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('Trying\x20SestekNDA:\x20%s',_0x28c40e[_0xfb1e('0x57')]));var _0x3c129a=this[_0xfb1e('0xea')][_0xfb1e('0x6a')](this,_0x28c40e);if(_0x3c129a){for(var _0x2a1faf in _0x3c129a){if(_0x3c129a[_0xfb1e('0x8a')](_0x2a1faf)){this['channel'][_0xfb1e('0x93')](util[_0xfb1e('0x26')]('SESTEK_NDA_%s',_0x2a1faf[_0xfb1e('0x63')]()),_0x3c129a[_0x2a1faf]);}}this[_0xfb1e('0x40')](_0x3c129a['speech'],'out');if(_0x3c129a[_0xfb1e('0xeb')]){this['channel'][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x3c129a[_0xfb1e('0xeb')]));var _0x2d34ac=this[_0xfb1e('0xd')][_0xfb1e('0xec')](_0x3c129a[_0xfb1e('0xeb')]);try{fs[_0xfb1e('0xed')](_0x3c129a[_0xfb1e('0xeb')]+_0xfb1e('0xee'));}catch(_0x366d71){logger[_0xfb1e('0x2a')](_0x366d71);}return _0x2d34ac;}else{return this['channel'][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('SestekNDA\x20Result\x20%s',_0x3c129a[_0xfb1e('0xde')]));}}return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x28c40e,_0xfb1e('0xef'));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0xf0')]=function(_0x8c4fe5){logger['info'](util[_0xfb1e('0x26')](_0xfb1e('0xf1'),_0x8c4fe5['label']));return this[_0xfb1e('0xd')]['noop'](_0xfb1e('0xf0'));};AGIVertices['prototype'][_0xfb1e('0xf2')]=function(_0x1b3b84){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0xf3'),_0x1b3b84[_0xfb1e('0xa0')]));var _0x53322f='';if(_0x1b3b84['trunk_id']){if(!this[_0xfb1e('0x7c')](_0x1b3b84[_0xfb1e('0xf4')])){return this[_0xfb1e('0xd')]['error'](_0x1b3b84,_0xfb1e('0xf5'));}else{var _0x59a678=parseInt(_0x1b3b84[_0xfb1e('0xf4')],0xa);if(isNaN(_0x59a678)){_0x53322f=_0x1b3b84[_0xfb1e('0xf4')];}else{_0x53322f=this[_0xfb1e('0x1b')][_0xfb1e('0x6a')](this,_0x1b3b84[_0xfb1e('0xf4')]);if(!_0x53322f){return this['channel']['error'](_0x1b3b84,'no\x20trunk\x20found');}}}}else if(_0x1b3b84['trunk_name']){_0x53322f=_0x1b3b84[_0xfb1e('0xf6')];}else{return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x1b3b84,'no\x20trunk\x20selected');}var _0x218508=this[_0xfb1e('0xd')]['exec'](_0xfb1e('0xd7'),[util[_0xfb1e('0x26')](_0xfb1e('0xf7'),_0x53322f,_0x1b3b84[_0xfb1e('0x46')]),_0x1b3b84[_0xfb1e('0x5f')],_0x1b3b84[_0xfb1e('0xf8')],_0x1b3b84[_0xfb1e('0x6d')]]);if(_0x218508['result']===-0x1){return _0x218508;}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0xf9'),_0xfb1e('0xd7')));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0xfa')]=function(_0x4993a9){logger['info'](util[_0xfb1e('0x26')](_0xfb1e('0xfb'),_0x4993a9[_0xfb1e('0xa0')]));return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0xfa'));};AGIVertices['prototype'][_0xfb1e('0xb')]=function(_0x5c42f4){logger['info'](util[_0xfb1e('0x26')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x5c42f4[_0xfb1e('0xa0')]));if(_0x5c42f4[_0xfb1e('0x9b')]===0x0){return this['maxRetry'](_0x5c42f4);}_0x5c42f4['retry']-=0x1;if(!this[_0xfb1e('0x7c')](_0x5c42f4[_0xfb1e('0xfc')])){return this[_0xfb1e('0xd')]['error'](_0x5c42f4,'no\x20file\x20audio\x20selected');}var _0x28a5c7=this[_0xfb1e('0x1c')]['sync'](this,_0x5c42f4[_0xfb1e('0xfc')]);if(!_0x28a5c7){return this['channel'][_0xfb1e('0x2a')](_0x5c42f4,'no\x20file\x20audio\x20found');}if(!this[_0xfb1e('0x7c')](_0x5c42f4['variable_id'])){return this[_0xfb1e('0xd')]['error'](_0xfb1e('0xca'));}var _0x3873f1=this['channel']['getData'](_0x28a5c7,_0x5c42f4[_0xfb1e('0xfd')],_0x5c42f4['maxdigit']);var _0x1b3f9f=_0x3873f1[_0xfb1e('0x98')]?_0x3873f1[_0xfb1e('0x98')][_0xfb1e('0x96')]():'';logger[_0xfb1e('0x2d')]('test',JSON['stringify'](_0x3873f1));if(_0x3873f1[_0xfb1e('0x98')]===-0x1){this[_0xfb1e('0x35')][_0xfb1e('0x6a')](this,_0x5c42f4,_0x1b3f9f);return _0x3873f1;}else if(_0x3873f1[_0xfb1e('0x95')]===_0xfb1e('0x5f')){_0x3873f1['result']=_0x1b3f9f[_0xfb1e('0x90')]>=parseInt(_0x5c42f4[_0xfb1e('0xfe')])?'x':'i';}else{_0x3873f1[_0xfb1e('0x98')]=_0x1b3f9f['length']>=parseInt(_0x5c42f4[_0xfb1e('0xfe')])&&_0x1b3f9f['length']<=parseInt(_0x5c42f4[_0xfb1e('0xff')])?'x':'i';}var _0x4e37a5=this[_0xfb1e('0x10')][_0xfb1e('0x6a')](this,_0x5c42f4['variable_id']);if(!_0x4e37a5){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x5c42f4,_0xfb1e('0xcb'));}this[_0xfb1e('0xd')][_0xfb1e('0x93')](_0x4e37a5,_0x1b3f9f);if(this[_0xfb1e('0x7c')](_0x5c42f4[_0xfb1e('0x100')])){var _0x3d7f1c=parseInt(_0x5c42f4['hiddendigitsnum'],0xa);var _0x5cc7d5=rs[_0xfb1e('0x101')]({'charset':'*','length':_0x3d7f1c});var _0x5b6b80=_0x1b3f9f[_0xfb1e('0x90')];if(_0x5b6b80>0x0){if(_0x5b6b80>_0x3d7f1c){this[_0xfb1e('0x35')][_0xfb1e('0x6a')](this,_0x5c42f4,_0x5c42f4[_0xfb1e('0x102')]===_0xfb1e('0x103')?_0x5cc7d5+_0x1b3f9f[_0xfb1e('0x104')](_0x3d7f1c):_0x1b3f9f[_0xfb1e('0x104')](0x0,_0x5b6b80-_0x3d7f1c)+_0x5cc7d5);}else{this[_0xfb1e('0x35')][_0xfb1e('0x6a')](this,_0x5c42f4,rs[_0xfb1e('0x101')]({'charset':'*','length':_0x5b6b80}));}}else{this[_0xfb1e('0x35')]['sync'](this,_0x5c42f4,'');}}else{this[_0xfb1e('0x35')][_0xfb1e('0x6a')](this,_0x5c42f4,_0x1b3f9f);}return _0x3873f1;};AGIVertices[_0xfb1e('0xf')]['getsecretdigits']=function(_0x51456a){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x105'),_0x51456a[_0xfb1e('0xa0')]));return this[_0xfb1e('0xb')](_0x51456a);};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x106')]=function(_0x1aabd7){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x107'),_0x1aabd7['label']));this['createSquareDetailsReport'][_0xfb1e('0x6a')](this,_0x1aabd7,_0x1aabd7[_0xfb1e('0x108')]);return this[_0xfb1e('0xd')]['noop'](util[_0xfb1e('0x26')](_0xfb1e('0x109'),_0x1aabd7['goalname']));};AGIVertices['prototype']['awspolly']=function(_0x400d0b){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x400d0b['label']));if(!this[_0xfb1e('0x7c')](_0x400d0b[_0xfb1e('0x82')])||!this[_0xfb1e('0x7c')](_0x400d0b[_0xfb1e('0x7e')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x10a'));}if(!this[_0xfb1e('0x7c')](_0x400d0b['text'])){return this[_0xfb1e('0xd')]['noop']('no\x20text\x20configured');}this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x10b'),_0x400d0b[_0xfb1e('0x57')]));var _0x21ccf8=this[_0xfb1e('0x10c')][_0xfb1e('0x6a')](this,_0x400d0b);if(_0x21ccf8){this[_0xfb1e('0xd')]['noop'](util[_0xfb1e('0x26')](_0xfb1e('0x10d'),_0x21ccf8));var _0x3f1c08=this[_0xfb1e('0xd')][_0xfb1e('0xec')](_0x21ccf8);try{fs[_0xfb1e('0xed')](_0x21ccf8+_0xfb1e('0xee'));}catch(_0x1a5984){logger[_0xfb1e('0x2a')](_0x1a5984);}return _0x3f1c08;}return this[_0xfb1e('0xd')]['error'](_0x400d0b,_0xfb1e('0x10e'));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x10f')]=function(_0x28aaf4){logger[_0xfb1e('0x2d')](util['format'](_0xfb1e('0x110'),_0x28aaf4[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0x28aaf4[_0xfb1e('0x82')])||!this[_0xfb1e('0x7c')](_0x28aaf4['aws_secret_access_key'])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x10a'));}if(!this['isConfigured'](_0x28aaf4['aws_bot_name'])){return this['channel'][_0xfb1e('0x9d')](_0xfb1e('0x111'));}if(!this['isConfigured'](_0x28aaf4[_0xfb1e('0x57')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x9e'));}this['channel'][_0xfb1e('0xdc')]=!![];this[_0xfb1e('0x35')](_0x28aaf4);this[_0xfb1e('0x40')](_0x28aaf4[_0xfb1e('0x57')],'in');this[_0xfb1e('0xd')]['noop'](util[_0xfb1e('0x26')](_0xfb1e('0x112'),_0x28aaf4[_0xfb1e('0x57')]));var _0x5c03a1=this['awsLex'][_0xfb1e('0x6a')](this,_0x28aaf4);if(_0x5c03a1){for(var _0x25eba9 in _0x5c03a1){if(_0x5c03a1['hasOwnProperty'](_0x25eba9)&&_[_0xfb1e('0x8b')](_0x5c03a1[_0x25eba9])){this[_0xfb1e('0xd')]['setVariable'](util['format'](_0xfb1e('0x113'),_0x25eba9['toUpperCase']()),_0x5c03a1[_0x25eba9]);}}if(_[_0xfb1e('0x43')](_0x5c03a1[_0xfb1e('0x72')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x114'));}else{this[_0xfb1e('0x40')](_0x5c03a1[_0xfb1e('0x72')],'out');return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('Amazon\x20Lex\x20Result\x20%s',_0x5c03a1[_0xfb1e('0x72')]));}}return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x28aaf4,_0xfb1e('0x115'));};AGIVertices[_0xfb1e('0xf')]['googleasr']=function(_0x3c902b){logger['info'](util[_0xfb1e('0x26')](_0xfb1e('0x116'),_0x3c902b[_0xfb1e('0xa0')],_0x3c902b[_0xfb1e('0x5f')]));if(!this['isConfigured'](_0x3c902b[_0xfb1e('0x76')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0xdb'));}var _0x38f9cf=_0xfb1e('0x117');var _0x4b173d=util['format'](_0xfb1e('0x118'),FILES_PATH,rs[_0xfb1e('0x101')](0x4));var _0x1cb430=util[_0xfb1e('0x26')](_0xfb1e('0x91'),_0x4b173d,_0x38f9cf);var _0x3e3aa5=!![];if(_0x3c902b['beep']==='NOBEEP'){_0x3e3aa5=![];}var _0x4caeab=this['channel'][_0xfb1e('0x119')](_0x4b173d,_0x38f9cf,_0x3c902b[_0xfb1e('0x11a')],_0x3c902b[_0xfb1e('0x5f')],undefined,_0x3e3aa5);if(_0x4caeab[_0xfb1e('0x98')]!==-0x1){this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x11b'),_0x1cb430));var _0x361abc=this[_0xfb1e('0x85')][_0xfb1e('0x6a')](this,_0x3c902b,_0x1cb430);if(_0x361abc){for(var _0x5cc6d0 in _0x361abc){if(_0x361abc[_0xfb1e('0x8a')](_0x5cc6d0)){this['channel'][_0xfb1e('0x93')](util['format'](_0xfb1e('0x11c'),_0x5cc6d0[_0xfb1e('0x63')]()),_0x361abc[_0x5cc6d0]);}}return this[_0xfb1e('0xd')]['noop'](util[_0xfb1e('0x26')](_0xfb1e('0x11d'),JSON[_0xfb1e('0x6f')](_0x361abc)));}}return _0x4caeab;};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x11e')]=function(_0x4fae73){logger[_0xfb1e('0x2d')](util['format'](_0xfb1e('0x11f'),_0x4fae73[_0xfb1e('0xa0')]));if(!this['isConfigured'](_0x4fae73[_0xfb1e('0x87')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x120'));}if(!this[_0xfb1e('0x7c')](_0x4fae73['appsecret'])){return this['channel'][_0xfb1e('0x9d')](_0xfb1e('0x121'));}var _0x336c3b=_0xfb1e('0x117');var _0x713a5e=util[_0xfb1e('0x26')](_0xfb1e('0x118'),FILES_PATH,rs[_0xfb1e('0x101')](0x4));var _0x53b0e1=util[_0xfb1e('0x26')](_0xfb1e('0x91'),_0x713a5e,_0x336c3b);var _0x4fa796=!![];if(_0x4fae73[_0xfb1e('0x122')]==='NOBEEP'){_0x4fa796=![];}var _0x34a1c4=this[_0xfb1e('0xd')]['recordFile'](_0x713a5e,_0x336c3b,_0x4fae73[_0xfb1e('0x11a')],_0x4fae73[_0xfb1e('0x5f')],undefined,_0x4fa796);if(_0x34a1c4['result']!==-0x1){this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x123'),_0x53b0e1));var _0x3e6c37=this['tildeASR']['sync'](this,_0x4fae73,_0x53b0e1);if(_0x3e6c37){for(var _0x247695 in _0x3e6c37){if(_0x3e6c37[_0xfb1e('0x8a')](_0x247695)){this['channel'][_0xfb1e('0x93')](util['format'](_0xfb1e('0x124'),_0x247695[_0xfb1e('0x63')]()),_0x3e6c37[_0x247695]);}}return this[_0xfb1e('0xd')]['noop'](util['format'](_0xfb1e('0x125'),JSON[_0xfb1e('0x6f')](_0x3e6c37)));}}return _0x34a1c4;};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x126')]=function(_0x2bca32){logger['info'](util[_0xfb1e('0x26')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x2bca32['label']));return this[_0xfb1e('0xd')][_0xfb1e('0x127')](_0x2bca32[_0xfb1e('0x3b')],_0x2bca32[_0xfb1e('0x3c')],_0x2bca32['priority']);};AGIVertices[_0xfb1e('0xf')]['gotoif']=function(_0x5e9c10){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x5e9c10['label']));if(!this[_0xfb1e('0x7c')](_0x5e9c10[_0xfb1e('0x128')])){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x5e9c10,_0xfb1e('0x129'));}try{var _0x21ac84=eval(_0x5e9c10['condition'])?_0xfb1e('0x12a'):'false';this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x12b'),_0x5e9c10[_0xfb1e('0x128')],_0x21ac84));return{'code':0xc8,'result':_0x21ac84};}catch(_0x4d1682){return{'code':0xc8,'result':_0xfb1e('0x12c')};}};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x12d')]=function(_0x3c0ef0){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x12e'),_0x3c0ef0[_0xfb1e('0xa0')]));if(!this['isConfigured'](_0x3c0ef0[_0xfb1e('0x12f')])){return this[_0xfb1e('0xd')]['error'](_0x3c0ef0,_0xfb1e('0x130'));}var _0x40132f=this[_0xfb1e('0x22')]['sync'](this,_0x3c0ef0[_0xfb1e('0x12f')]);if(!_0x40132f){return this['channel'][_0xfb1e('0x2a')](_0x3c0ef0,_0xfb1e('0x131'));}for(var _0x678745=0x0;_0x678745<_0x40132f[_0xfb1e('0x90')];_0x678745+=0x1){var _0x2c3c0f=this[_0xfb1e('0xd')][_0xfb1e('0x10')](util[_0xfb1e('0x26')](_0xfb1e('0x132'),_0x40132f[_0x678745]));if(_0x2c3c0f[_0xfb1e('0x98')]===-0x1){return _0x2c3c0f;}logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x133'),_0x40132f[_0x678745],_0x2c3c0f['extra']));if(_0x2c3c0f[_0xfb1e('0x95')]==='true'){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x133'),_0x40132f[_0x678745],_0xfb1e('0x12a')));this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x133'),_0x40132f[_0x678745],'true'));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0xfb1e('0x26')](_0xfb1e('0x133'),_0x40132f[_0x678745],_0xfb1e('0x12c')));this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util['format'](_0xfb1e('0x133'),_0x40132f[_0x678745],_0xfb1e('0x12c')));}}return{'code':0xc8,'result':_0xfb1e('0x12c')};};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x134')]=function(_0x4b29ae){logger[_0xfb1e('0x2d')](util['format'](_0xfb1e('0x135'),_0x4b29ae['label']));return this[_0xfb1e('0xd')][_0xfb1e('0x134')]();};AGIVertices[_0xfb1e('0xf')]['ispeechasr']=function(_0x47c3f6){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x136'),_0x47c3f6['label']));if(!this[_0xfb1e('0x7c')](_0x47c3f6[_0xfb1e('0x76')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0xdb'));}var _0x5ba341=_0xfb1e('0x117');var _0x39ed28=util[_0xfb1e('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0xfb1e('0x101')](0x4));var _0x423539=util['format'](_0xfb1e('0x91'),_0x39ed28,_0x5ba341);var _0x520dc6=!![];if(_0x47c3f6[_0xfb1e('0x122')]===_0xfb1e('0x137')){_0x520dc6=![];}var _0x57feba=this['channel'][_0xfb1e('0x119')](_0x39ed28,_0x5ba341,_0x47c3f6[_0xfb1e('0x11a')],_0x47c3f6['timeout'],undefined,_0x520dc6);if(_0x57feba[_0xfb1e('0x98')]!==-0x1){this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x138'),_0x423539));var _0x1e19fd=this[_0xfb1e('0x7b')]['sync'](this,_0x47c3f6,_0x423539);if(_0x1e19fd){for(var _0x37d402 in _0x1e19fd){if(_0x1e19fd[_0xfb1e('0x8a')](_0x37d402)){this['channel'][_0xfb1e('0x93')](util[_0xfb1e('0x26')](_0xfb1e('0x139'),_0x37d402['toUpperCase']()),_0x1e19fd[_0x37d402]);}}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x13a'),JSON[_0xfb1e('0x6f')](_0x1e19fd)));}}return _0x57feba;};AGIVertices['prototype']['ispeechtts']=function(_0x6181f5){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x6181f5['label']));if(!this[_0xfb1e('0x7c')](_0x6181f5[_0xfb1e('0x76')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x6181f5['text'])){return this[_0xfb1e('0xd')]['noop'](_0xfb1e('0x9e'));}this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('Trying\x20ispeech\x20TTS\x20%s',_0x6181f5['text']));var _0x448156=this[_0xfb1e('0x78')]['sync'](this,_0x6181f5);if(_0x448156){this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x138'),_0x448156));var _0x3d5138=this[_0xfb1e('0xd')][_0xfb1e('0xec')](_0x448156,_0x6181f5[_0xfb1e('0x11a')]);try{fs['unlink'](_0x448156+_0xfb1e('0xee'));}catch(_0x5e764b){logger['error'](_0x5e764b);}return _0x3d5138;}return this[_0xfb1e('0xd')]['error'](_0x6181f5,_0xfb1e('0x13b'));};AGIVertices[_0xfb1e('0xf')]['login']=function(_0x4fafb1){logger['info'](util['format'](_0xfb1e('0x13c'),_0x4fafb1[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0x4fafb1[_0xfb1e('0x13d')])){return this['channel'][_0xfb1e('0x2a')](_0x4fafb1,_0xfb1e('0x13e'));}logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xfb1e('0xd')][_0xfb1e('0x3a')],_0x4fafb1[_0xfb1e('0x13d')]));var _0x5b6c97=this[_0xfb1e('0x50')][_0xfb1e('0x6a')](this,_0x4fafb1[_0xfb1e('0x13d')]);if(_0x5b6c97){logger['info'](util[_0xfb1e('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xfb1e('0xd')][_0xfb1e('0x3a')],_0x4fafb1[_0xfb1e('0x13d')]));this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x13f'),this[_0xfb1e('0xd')][_0xfb1e('0x3a')],_0x4fafb1['findBy']));return{'code':0xc8,'result':_0xfb1e('0x140')};}else{logger['info'](util[_0xfb1e('0x26')](_0xfb1e('0x141'),this[_0xfb1e('0xd')][_0xfb1e('0x3a')],_0x4fafb1['findBy']));this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x141'),this['channel'][_0xfb1e('0x3a')],_0x4fafb1[_0xfb1e('0x13d')]));return{'code':0xc8,'result':_0xfb1e('0x142')};}};AGIVertices[_0xfb1e('0xf')]['logout']=function(_0x31e17a){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x31e17a['label']));if(!this[_0xfb1e('0x7c')](_0x31e17a['findBy'])){return this[_0xfb1e('0xd')]['error'](_0x31e17a,_0xfb1e('0x13e'));}logger['info'](util['format'](_0xfb1e('0x143'),this[_0xfb1e('0xd')]['callerid'],_0x31e17a['findBy']));var _0x2554cf=this[_0xfb1e('0x4e')]['sync'](this,_0x31e17a[_0xfb1e('0x13d')]);if(_0x2554cf){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x13f'),this[_0xfb1e('0xd')][_0xfb1e('0x3a')],_0x31e17a[_0xfb1e('0x13d')]));this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x13f'),this['channel']['callerid'],_0x31e17a[_0xfb1e('0x13d')]));return{'code':0xc8,'result':_0xfb1e('0x140')};}else{logger[_0xfb1e('0x2d')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfb1e('0xd')][_0xfb1e('0x3a')],_0x31e17a[_0xfb1e('0x13d')]));this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util['format'](_0xfb1e('0x141'),this[_0xfb1e('0xd')][_0xfb1e('0x3a')],_0x31e17a['findBy']));return{'code':0xc8,'result':_0xfb1e('0x142')};}};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x144')]=function(_0x1686cc){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x1686cc['label']));if(!this['isConfigured'](_0x1686cc['operation'])){return this['channel'][_0xfb1e('0x2a')](_0x1686cc,_0xfb1e('0x145'));}this[_0xfb1e('0xd')]['noop'](util[_0xfb1e('0x26')](_0xfb1e('0x146'),_0x1686cc[_0xfb1e('0x147')]));var _0x15c23a=eval(_0x1686cc['operation']);if(!this[_0xfb1e('0x7c')](_0x1686cc['variable_id'])){return this[_0xfb1e('0xd')]['noop'](_0xfb1e('0xca'));}var _0x30d4c0=this[_0xfb1e('0x10')][_0xfb1e('0x6a')](this,_0x1686cc[_0xfb1e('0xc9')]);if(!_0x30d4c0){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x1686cc,'no\x20variable\x20found');}if(_['isArray'](_0x15c23a)){var _0x510490=this;_0x15c23a[_0xfb1e('0xcc')](function(_0x4cea41,_0x1b2275){_0x510490[_0xfb1e('0xd')][_0xfb1e('0x93')](util[_0xfb1e('0x26')](_0xfb1e('0x148'),_0x30d4c0,_0x1b2275),_0x4cea41);});return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x149'),_0x30d4c0));}else{return this[_0xfb1e('0xd')][_0xfb1e('0x93')](_0x30d4c0,_0x15c23a);}};AGIVertices[_0xfb1e('0xf')]['menu']=function(_0xd9af65){logger[_0xfb1e('0x2d')](util['format'](_0xfb1e('0x14a'),_0xd9af65[_0xfb1e('0xa0')]));if(_0xd9af65[_0xfb1e('0x9b')]===0x0){return this['maxRetry'](_0xd9af65);}_0xd9af65[_0xfb1e('0x9b')]-=0x1;if(!this['isConfigured'](_0xd9af65['file_id'])){return this['channel'][_0xfb1e('0x2a')](_0xd9af65,_0xfb1e('0x14b'));}var _0x1ad92f=this[_0xfb1e('0x1c')][_0xfb1e('0x6a')](this,_0xd9af65[_0xfb1e('0xfc')]);if(!_0x1ad92f){return this['channel'][_0xfb1e('0x2a')](_0xd9af65,_0xfb1e('0x14c'));}var _0x1cbf20=this[_0xfb1e('0xd')][_0xfb1e('0x14d')](_0x1ad92f,_0xd9af65[_0xfb1e('0xfd')],_0xd9af65[_0xfb1e('0x14e')]);var _0x115d6c=_0x1cbf20[_0xfb1e('0x98')];if(_0x1cbf20[_0xfb1e('0x98')]===-0x1){this[_0xfb1e('0x35')][_0xfb1e('0x6a')](this,_0xd9af65,'-1');return _0x1cbf20;}else if(_0x1cbf20[_0xfb1e('0x95')]===_0xfb1e('0x5f')){_0x1cbf20[_0xfb1e('0x98')]=_0x1cbf20[_0xfb1e('0x98')][_0xfb1e('0x90')]>0x0?_0x1cbf20[_0xfb1e('0x98')]:'t';}else if(_[_0xfb1e('0x42')](_0x1cbf20[_0xfb1e('0x98')])){_0x1cbf20[_0xfb1e('0x98')]='#';_0x115d6c='#';}if(!this['isConfigured'](_0xd9af65[_0xfb1e('0xc9')])){this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0xca'));}else{var _0x302393=this[_0xfb1e('0x10')][_0xfb1e('0x6a')](this,_0xd9af65[_0xfb1e('0xc9')]);if(!_0x302393){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0xd9af65,_0xfb1e('0xcb'));}this[_0xfb1e('0xd')][_0xfb1e('0x93')](_0x302393,_0x115d6c);}this[_0xfb1e('0x35')][_0xfb1e('0x6a')](this,_0xd9af65,_0x115d6c);return _0x1cbf20;};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x9d')]=function(_0x2422ef){logger[_0xfb1e('0x2d')](util['format'](_0xfb1e('0x14f'),_0x2422ef[_0xfb1e('0xa0')]));return this['channel'][_0xfb1e('0x9d')](_0x2422ef[_0xfb1e('0x150')]||_0x2422ef['label']);};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x151')]=function(_0x473c87){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x152'),_0x473c87[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0x473c87['findBy'])){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x473c87,'no\x20find\x20by\x20configured');}logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x143'),this[_0xfb1e('0xd')][_0xfb1e('0x3a')],_0x473c87[_0xfb1e('0x13d')]));var _0x3f182f=this[_0xfb1e('0x49')][_0xfb1e('0x6a')](this,_0x473c87['pause_id']);var _0x1bd589=this[_0xfb1e('0x4b')][_0xfb1e('0x6a')](this,_0x473c87['findBy'],_0x3f182f);if(_0x1bd589){logger['info'](util[_0xfb1e('0x26')](_0xfb1e('0x13f'),this[_0xfb1e('0xd')]['callerid'],_0x473c87['findBy']));this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xfb1e('0xd')]['callerid'],_0x473c87['findBy']));return{'code':0xc8,'result':_0xfb1e('0x140')};}else{logger[_0xfb1e('0x2d')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfb1e('0xd')]['callerid'],_0x473c87[_0xfb1e('0x13d')]));this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xfb1e('0xd')][_0xfb1e('0x3a')],_0x473c87[_0xfb1e('0x13d')]));return{'code':0xc8,'result':_0xfb1e('0x142')};}};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x153')]=function(_0x245381){logger[_0xfb1e('0x2d')](util['format'](_0xfb1e('0x154'),_0x245381[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0x245381[_0xfb1e('0xfc')])){return this['channel']['error'](_0x245381,_0xfb1e('0x14b'));}var _0x514a32=this[_0xfb1e('0x1c')][_0xfb1e('0x6a')](this,_0x245381[_0xfb1e('0xfc')]);if(!_0x514a32){return this[_0xfb1e('0xd')]['error'](_0x245381,_0xfb1e('0x14c'));}var _0x1fbf21=this[_0xfb1e('0xd')][_0xfb1e('0x52')](_0xfb1e('0x155'),[_0x514a32,_0x245381['opts']]);if(_0x1fbf21[_0xfb1e('0x98')]===-0x1){return _0x1fbf21;}return this['channel'][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0xb7'),_0xfb1e('0x155'),_0x514a32));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x156')]=function(_0x1a4123){logger[_0xfb1e('0x2d')](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x1a4123[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0x1a4123[_0xfb1e('0x157')])){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x1a4123,_0xfb1e('0x158'));}var _0x3855ce='';var _0x295eab=parseInt(_0x1a4123['queue_id'],0xa);if(isNaN(_0x295eab)){_0x3855ce=_0x1a4123[_0xfb1e('0x157')];}else{_0x3855ce=this['getVoiceQueue'][_0xfb1e('0x6a')](this,_0x1a4123[_0xfb1e('0x157')]);if(!_0x3855ce){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x1a4123,_0xfb1e('0x159'));}}var _0xa0041='';if(this[_0xfb1e('0x7c')](_0x1a4123[_0xfb1e('0xfc')])){var _0x4b9908=this[_0xfb1e('0x1c')]['sync'](this,_0x1a4123[_0xfb1e('0xfc')]);if(_0x4b9908){_0xa0041=_0x4b9908;}}this[_0xfb1e('0x35')][_0xfb1e('0x6a')](this,_0x1a4123,_0x3855ce);if(_0x1a4123[_0xfb1e('0xf8')][_0xfb1e('0x15a')]('x')<0x0){_0x1a4123[_0xfb1e('0xf8')]+='x';}if(_0x1a4123['opts'][_0xfb1e('0x15a')]('X')<0x0){_0x1a4123[_0xfb1e('0xf8')]+='X';}this['channel'][_0xfb1e('0x93')](_0xfb1e('0x15b'),_0x3855ce?_0x3855ce[_0xfb1e('0x15c')]():'');var _0x14d583=this[_0xfb1e('0xd')][_0xfb1e('0x52')](_0xfb1e('0x15d'),[_0x3855ce,_0x1a4123['opts'],_0x1a4123['url'],_0xa0041,_0x1a4123[_0xfb1e('0x5f')],_0x1a4123[_0xfb1e('0x6')],_0x1a4123[_0xfb1e('0x15e')],_0x1a4123[_0xfb1e('0x15f')],'',_0x1a4123['position']]);if(_0x14d583[_0xfb1e('0x98')]===-0x1){return _0x14d583;}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('Executed\x20command\x20%s\x20%s',_0xfb1e('0x15d'),_0x3855ce));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x160')]=function(_0xdafc8c){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0xdafc8c['label']));var _0x1fc873=_0xdafc8c[_0xfb1e('0x161')]||'wav';var _0x1c5480=util[_0xfb1e('0x26')](_0xfb1e('0x162'),this[_0xfb1e('0xd')][_0xfb1e('0x39')],rs[_0xfb1e('0x101')](0x5));var _0x3077b7=util['format'](_0xfb1e('0x163'),FILES_PATH,_0x1c5480,_0x1fc873);var _0x180dc0=util['format'](_0xfb1e('0x118'),FILES_PATH,_0x1c5480);this[_0xfb1e('0x38')][_0xfb1e('0x6a')](this,_0xdafc8c,_0x1c5480,_0x3077b7);this[_0xfb1e('0xd')]['setVariable'](_0xfb1e('0x164'),_0x1c5480);logger[_0xfb1e('0x2d')](_0xfb1e('0x165'),_0x180dc0,_0x1fc873,_0xdafc8c['escape_digits'],_0xdafc8c[_0xfb1e('0x5f')]);return this['channel'][_0xfb1e('0x119')](_0x180dc0,_0x1fc873,_0xdafc8c[_0xfb1e('0x166')],_0xdafc8c['timeout'],undefined,!![]);};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x167')]=function(_0xe229f4){logger[_0xfb1e('0x2d')](util['format'](_0xfb1e('0x168'),_0xe229f4[_0xfb1e('0xa0')]));if(!this[_0xfb1e('0x7c')](_0xe229f4['url'])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x169'));}var _0x3b4055=this[_0xfb1e('0x5d')][_0xfb1e('0x6a')](this,_0xe229f4);logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x16a'),util[_0xfb1e('0x16b')](_0x3b4055,{'showHidden':![],'depth':null})));if(!this[_0xfb1e('0x7c')](_0xe229f4[_0xfb1e('0xc9')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x16c'));}var _0x532bfc=this[_0xfb1e('0x10')][_0xfb1e('0x6a')](this,_0xe229f4[_0xfb1e('0xc9')]);if(!_0x532bfc){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0xe229f4,'no\x20variable\x20found');}this['channel'][_0xfb1e('0x93')](util[_0xfb1e('0x26')]('%s_STATUS_CODE',_0x532bfc),_0x3b4055[_0xfb1e('0x70')]?_0x3b4055[_0xfb1e('0x70')]:_0xfb1e('0x16d'));this[_0xfb1e('0xd')][_0xfb1e('0x93')](util[_0xfb1e('0x26')](_0xfb1e('0x16e'),_0x532bfc),_0x3b4055['statusMessage']?_0x3b4055[_0xfb1e('0x71')]:'OK');if(_0x3b4055[_0xfb1e('0x64')]){try{this['saveRestApiResult'](_0x3b4055[_0xfb1e('0x64')],_0x532bfc);}catch(_0x460c46){logger[_0xfb1e('0x2a')](util[_0xfb1e('0x26')](_0xfb1e('0x16f'),_0x532bfc));}}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('variable\x20%s\x20set',_0x532bfc));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x170')]=function(_0x114645){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x114645[_0xfb1e('0xa0')]));return this['channel']['sayDigits'](_0x114645['digits'][_0xfb1e('0x54')](/\s+/g,''),_0x114645['escape_digits']);};AGIVertices[_0xfb1e('0xf')]['saynumber']=function(_0x578d42){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x171'),_0x578d42[_0xfb1e('0xa0')]));return this[_0xfb1e('0xd')][_0xfb1e('0x172')](_0x578d42['number']['replace'](/\s+/g,''),_0x578d42[_0xfb1e('0x166')]);};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x173')]=function(_0x15a1d3){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x174'),_0x15a1d3[_0xfb1e('0xa0')]));return this['channel'][_0xfb1e('0x175')](_0x15a1d3[_0xfb1e('0x57')],_0x15a1d3[_0xfb1e('0x166')]);};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x176')]=function(_0x2414f8){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x2414f8['label']));if(!this[_0xfb1e('0x7c')](_0x2414f8[_0xfb1e('0x177')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x178'));}var _0xf2c146=this['getMailAccount'][_0xfb1e('0x6a')](this,_0x2414f8[_0xfb1e('0x177')]);if(!_0xf2c146||!_0xf2c146[_0xfb1e('0x179')]){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x2414f8,_0xfb1e('0x17a'));}var _0x2bf761={'from':util[_0xfb1e('0x26')]('\x22%s\x22\x20<%s>',_0xf2c146[_0xfb1e('0x11')],_0xf2c146[_0xfb1e('0x17b')]||_0xf2c146[_0xfb1e('0x179')][_0xfb1e('0x17c')]),'to':_0x2414f8['to']||'','cc':_0x2414f8['cc']||'','bcc':_0x2414f8[_0xfb1e('0x17d')]||'','subject':_0x2414f8['subject'],'html':_0x2414f8[_0xfb1e('0x57')],'text':_0x2414f8[_0xfb1e('0x57')]};var _0x53ed5f={'tls':{'rejectUnauthorized':![]}};if(_0xf2c146[_0xfb1e('0x179')][_0xfb1e('0x17e')]){_0x53ed5f[_0xfb1e('0x17e')]=_0xf2c146['Smtp']['service'];}else{_0x53ed5f[_0xfb1e('0x17f')]=_0xf2c146[_0xfb1e('0x179')][_0xfb1e('0x17f')];_0x53ed5f[_0xfb1e('0x180')]=_0xf2c146[_0xfb1e('0x179')]['port'];_0x53ed5f[_0xfb1e('0x181')]=_0xf2c146[_0xfb1e('0x179')][_0xfb1e('0x181')];}if(_0xf2c146[_0xfb1e('0x179')]['authentication']){_0x53ed5f['auth']={'user':_0xf2c146[_0xfb1e('0x179')]['user'],'pass':_0xf2c146['Smtp']['pass']};}if(this[_0xfb1e('0x7c')](_0x2414f8[_0xfb1e('0x182')])){}logger[_0xfb1e('0xd2')](_0xfb1e('0x183'),JSON[_0xfb1e('0x6f')](_0x2bf761));this[_0xfb1e('0x35')][_0xfb1e('0x6a')](this,_0x2414f8,_0x2414f8[_0xfb1e('0x177')]);this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('Trying\x20SendMail\x20with\x20account\x20%s',_0xf2c146[_0xfb1e('0x11')]));this['sendMailMessage']['sync'](this,_0x53ed5f,_0x2bf761);return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x184'));};AGIVertices[_0xfb1e('0xf')]['sendFax']=function(_0x5a8fe){logger[_0xfb1e('0x2d')](util['format'](_0xfb1e('0x185'),_0x5a8fe[_0xfb1e('0xa0')]));return this[_0xfb1e('0xd')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x186')]=function(_0x5a9f20){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x5a9f20['label']));if(!this[_0xfb1e('0x7c')](_0x5a9f20[_0xfb1e('0x187')])){return this['channel'][_0xfb1e('0x9d')](_0xfb1e('0x188'));}var _0x56a1f4=this[_0xfb1e('0x32')][_0xfb1e('0x6a')](this,_0x5a9f20['sms_account_id']);if(!_0x56a1f4){return this['channel'][_0xfb1e('0x2a')](_0x5a9f20,_0xfb1e('0x189'));}var _0x7796d8={'body':_0x5a9f20['sms_text'],'phone':_0x5a9f20['to']||'','SmsAccountId':_0x56a1f4['id']};logger[_0xfb1e('0xd2')](_0xfb1e('0x18a'),JSON[_0xfb1e('0x6f')](_0x7796d8));this[_0xfb1e('0x35')][_0xfb1e('0x6a')](this,_0x5a9f20,_0x5a9f20[_0xfb1e('0x187')]);this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x18b'),_0x56a1f4['name']));this[_0xfb1e('0x34')][_0xfb1e('0x6a')](this,_0x7796d8);return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x18c'));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x18d')]=function(_0x26dc02){logger[_0xfb1e('0x2d')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x26dc02['label']));if(!this[_0xfb1e('0x7c')](_0x26dc02['variable_id'])){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x26dc02,'no\x20variable\x20selected');}var _0x254664=this[_0xfb1e('0x10')][_0xfb1e('0x6a')](this,_0x26dc02[_0xfb1e('0xc9')]);if(!_0x254664){return this[_0xfb1e('0xd')]['error'](_0x26dc02,_0xfb1e('0xcb'));}return this['channel'][_0xfb1e('0x93')](_0x254664,_0x26dc02['variable_value']);};AGIVertices['prototype']['start']=function(_0x46c76c){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x18e'),_0x46c76c['label']));this['channel']['noop'](_0xfb1e('0x18f'));if(_0x46c76c[_0xfb1e('0xac')]===_0xfb1e('0x190')){this[_0xfb1e('0xd')]['noop']('Answer');return this[_0xfb1e('0xd')]['answer']();}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x191'));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x192')]=function(_0x2f992c){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x193'),_0x2f992c[_0xfb1e('0xa0')]));if(!this['isConfigured'](_0x2f992c[_0xfb1e('0x194')])){return this['channel'][_0xfb1e('0x2a')](_0x2f992c,_0xfb1e('0x195'));}var _0x41a872=this['getSquareProject'][_0xfb1e('0x6a')](this,_0x2f992c[_0xfb1e('0x194')]);if(!this[_0xfb1e('0x7c')](_0x41a872)){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x2f992c,util[_0xfb1e('0x26')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x2f992c[_0xfb1e('0x194')]));}if(_0x41a872===this[_0xfb1e('0xd')][_0xfb1e('0x37')]){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x2f992c,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xfb1e('0x35')][_0xfb1e('0x6a')](this,_0x2f992c,_0x41a872);var _0x3bafec=this[_0xfb1e('0xd')]['exec']('AGI',util[_0xfb1e('0x26')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xfb1e('0x6')]['host']||_0xfb1e('0x196'),_0x41a872,this['channel'][_0xfb1e('0x37')]));if(_0x3bafec[_0xfb1e('0x98')]===-0x1){return _0x3bafec;}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util['format'](_0xfb1e('0xb7'),_0xfb1e('0x197'),_0x41a872));};AGIVertices['prototype'][_0xfb1e('0x198')]=function(_0x378284){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x199'),_0x378284['label']));var _0x29a81a=this['shellCommand'][_0xfb1e('0x6a')](this,_0x378284['command']);this[_0xfb1e('0x35')]['sync'](this,_0x378284,_0x378284[_0xfb1e('0xa9')]);if(this[_0xfb1e('0x7c')](_0x378284[_0xfb1e('0xc9')])){var _0x2c5612=this[_0xfb1e('0x10')][_0xfb1e('0x6a')](this,_0x378284[_0xfb1e('0xc9')]);if(_0x2c5612){this[_0xfb1e('0xd')][_0xfb1e('0x93')](_0x2c5612,_0x29a81a);return this[_0xfb1e('0xd')]['noop'](util[_0xfb1e('0x26')](_0xfb1e('0x19a'),_0x378284[_0xfb1e('0xa9')],_0x2c5612));}}return this[_0xfb1e('0xd')]['noop'](util[_0xfb1e('0x26')](_0xfb1e('0x19b'),_0x378284[_0xfb1e('0xa9')]));};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x19c')]=function(_0x5b88ee){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x5b88ee[_0xfb1e('0xa0')]));_0x5b88ee[_0xfb1e('0x57')]=_0x5b88ee[_0xfb1e('0x57')][_0xfb1e('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xfb1e('0x7c')](_0x5b88ee[_0xfb1e('0x56')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x19d'));}if(!this[_0xfb1e('0x7c')](_0x5b88ee[_0xfb1e('0x57')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x9e'));}this['channel'][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x19e'),_0x5b88ee['text']));var _0x190d71=this[_0xfb1e('0x55')][_0xfb1e('0x6a')](this,_0x5b88ee);if(_0x190d71){this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x190d71));var _0x2d9397=this[_0xfb1e('0xd')][_0xfb1e('0xec')](_0x190d71);try{fs[_0xfb1e('0xed')](_0x190d71+'.wav');}catch(_0x25f59e){logger[_0xfb1e('0x2a')](_0x25f59e);}return _0x2d9397;}return this['channel'][_0xfb1e('0x2a')](_0x5b88ee,_0xfb1e('0x19f'));};AGIVertices[_0xfb1e('0xf')]['tts']=function(_0x5a3261){logger['info'](util[_0xfb1e('0x26')](_0xfb1e('0x1a0'),_0x5a3261['label']));_0x5a3261['text']=_0x5a3261['text'][_0xfb1e('0x54')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xfb1e('0x7c')](_0x5a3261[_0xfb1e('0x57')])){return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](_0xfb1e('0x9e'));}this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x1a1'),_0x5a3261[_0xfb1e('0x57')]));var _0x431dcd=this['googleTTS']['sync'](this,_0x5a3261);if(_0x431dcd){this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')]('Google\x20TTS\x20%s\x20file\x20created',_0x431dcd));var _0x483b95=this[_0xfb1e('0xd')][_0xfb1e('0xec')](_0x431dcd);try{fs[_0xfb1e('0xed')](_0x431dcd+_0xfb1e('0xee'));}catch(_0x3ab80c){logger['error'](_0x3ab80c);}return _0x483b95;}return this['channel'][_0xfb1e('0x2a')](_0x5a3261,_0xfb1e('0x1a2'));};AGIVertices['prototype'][_0xfb1e('0x1a3')]=function(_0x87f768){logger[_0xfb1e('0x2d')](util['format'](_0xfb1e('0x1a4'),_0x87f768[_0xfb1e('0xa0')]));if(!this['isConfigured'](_0x87f768[_0xfb1e('0x13d')])){return this['channel']['error'](_0x87f768,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0xfb1e('0x143'),this[_0xfb1e('0xd')][_0xfb1e('0x3a')],_0x87f768[_0xfb1e('0x13d')]));var _0x461d95=this[_0xfb1e('0x4d')]['sync'](this,_0x87f768[_0xfb1e('0x13d')]);if(_0x461d95){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x13f'),this['channel'][_0xfb1e('0x3a')],_0x87f768['findBy']));this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util['format'](_0xfb1e('0x13f'),this['channel']['callerid'],_0x87f768['findBy']));return{'code':0xc8,'result':_0xfb1e('0x140')};}else{logger['info'](util[_0xfb1e('0x26')](_0xfb1e('0x141'),this[_0xfb1e('0xd')]['callerid'],_0x87f768[_0xfb1e('0x13d')]));this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0x141'),this[_0xfb1e('0xd')][_0xfb1e('0x3a')],_0x87f768['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xfb1e('0xf')][_0xfb1e('0x1a5')]=function(_0x117b66){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x1a6'),_0x117b66[_0xfb1e('0xa0')]));var _0x57a55a=this[_0xfb1e('0xd')][_0xfb1e('0x52')](_0xfb1e('0x1a7'),[_0x117b66[_0xfb1e('0x1a8')],_0x117b66['options']]);if(_0x57a55a[_0xfb1e('0x98')]===-0x1){return _0x57a55a;}return this[_0xfb1e('0xd')][_0xfb1e('0x9d')](util[_0xfb1e('0x26')](_0xfb1e('0xb7'),_0xfb1e('0x1a7'),_0x117b66['mailbox']));};AGIVertices['prototype'][_0xfb1e('0x1a9')]=function(_0x78d68){logger[_0xfb1e('0x2d')](util[_0xfb1e('0x26')](_0xfb1e('0x1aa'),_0x78d68['label']));if(!this['isConfigured'](_0x78d68[_0xfb1e('0xc9')])){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x78d68,_0xfb1e('0x1ab'));}var _0x2ff07a=this[_0xfb1e('0x10')][_0xfb1e('0x6a')](this,_0x78d68[_0xfb1e('0xc9')]);if(!_0x2ff07a){return this[_0xfb1e('0xd')][_0xfb1e('0x2a')](_0x78d68,'no\x20variable\x20found');}var _0x81769f=this[_0xfb1e('0xd')][_0xfb1e('0x10')](_0x2ff07a);return{'code':0xc8,'result':_0x81769f[_0xfb1e('0x95')]?_0x81769f[_0xfb1e('0x95')]:'-'};};String[_0xfb1e('0xf')][_0xfb1e('0x94')]=function(_0x520335,_0x42a70e){return this[_0xfb1e('0x1ac')](_0x520335)[_0xfb1e('0x1ad')](_0x42a70e);};module[_0xfb1e('0x1ae')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index d8a781e..8028a99 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 _0xeec6=['savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20%s','interface','attended','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[ACW][syncHangup]\x20%s','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','stringify','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','hangup','syncAgentRingNoAnswer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid'];(function(_0x257f9e,_0x459c3a){var _0x59eea9=function(_0x3f8b62){while(--_0x3f8b62){_0x257f9e['push'](_0x257f9e['shift']());}};_0x59eea9(++_0x459c3a);}(_0xeec6,0x1c2));var _0x6eec=function(_0x14c8ee,_0x34d4fb){_0x14c8ee=_0x14c8ee-0x0;var _0x51acc2=_0xeec6[_0x14c8ee];return _0x51acc2;};'use strict';var util=require(_0x6eec('0x0'));var _=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var ami=require(_0x6eec('0x3'));var logger=require('../../../config/logger')(_0x6eec('0x4'));var RpcUser=require(_0x6eec('0x5'));var RpcVoiceAgentReport=require(_0x6eec('0x6'));function Acw(_0x2d7a15){this[_0x6eec('0x7')]=_0x2d7a15[_0x6eec('0x7')];this['agents']=_0x2d7a15[_0x6eec('0x8')];this[_0x6eec('0x9')]=_0x2d7a15['timers'];this[_0x6eec('0xa')]={};ami['on'](_0x6eec('0xb'),this[_0x6eec('0xc')][_0x6eec('0xd')](this));ami['on']('hanguprequest',this[_0x6eec('0xe')][_0x6eec('0xd')](this));ami['on'](_0x6eec('0xf'),this['syncHangup']['bind'](this));ami['on']('agentringnoanswer',this[_0x6eec('0x10')][_0x6eec('0xd')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x6eec('0xd')](this));ami['on']('blindtransfer',this[_0x6eec('0x11')][_0x6eec('0xd')](this));ami['on'](_0x6eec('0x12'),this[_0x6eec('0x13')][_0x6eec('0xd')](this));}function getDiff(_0x49fccb){var _0x25e2a5=moment()[_0x6eec('0x14')](0x0);var _0x462dbb=moment(_0x49fccb)[_0x6eec('0x14')](0x0);return _0x25e2a5[_0x6eec('0x15')](_0x462dbb,_0x6eec('0x16'));}Acw[_0x6eec('0x17')][_0x6eec('0x18')]=function(_0x34a7fc){try{var _0x2ac797=this;var _0x5e2a9b=this[_0x6eec('0xa')][_0x34a7fc]['interface'];var _0x38c9a4=this[_0x6eec('0xa')][_0x34a7fc]['queue'];var _0x3ee353=this[_0x6eec('0x7')][_0x38c9a4];var _0xb1eab7=![];var _0x56c78b=_0x6eec('0x19');if(_0x3ee353[_0x6eec('0x1a')]){if(_0x3ee353[_0x6eec('0x1b')][_0x6eec('0x1c')]){_0xb1eab7=!![];_0x56c78b=_0x3ee353[_0x6eec('0x1b')][_0x6eec('0x1c')];}}ami['Action']({'action':_0x6eec('0x1d'),'interface':_0x5e2a9b,'paused':!![],'reason':_0x56c78b})[_0x6eec('0x1e')](function(_0x132652){if(_0x2ac797[_0x6eec('0x8')][_0x5e2a9b]){return RpcUser[_0x6eec('0x1f')](_0x2ac797[_0x6eec('0x8')][_0x5e2a9b]['id'])['then'](function(_0x6e40b3){if(_0x6e40b3&&!_0x6e40b3[_0x6eec('0x20')]){logger[_0x6eec('0x21')](_0x6eec('0x22'),_0x34a7fc,_0x5e2a9b,_0x38c9a4);var _0x409b26=_0x2ac797[_0x6eec('0xa')][_0x34a7fc]['attended']&&_0x2ac797[_0x6eec('0xa')][_0x34a7fc][_0x6eec('0x23')]?_0x2ac797[_0x6eec('0xa')][_0x34a7fc][_0x6eec('0x23')]:_0x34a7fc;return RpcUser[_0x6eec('0x24')](_0x2ac797[_0x6eec('0x8')][_0x5e2a9b],_0x56c78b,_0x409b26)[_0x6eec('0x1e')](function(_0x20bed3){if(!_0xb1eab7){_0x2ac797[_0x6eec('0x9')][_0x5e2a9b]={};logger['info'](_0x6eec('0x25'),_0x34a7fc,_0x2ac797[_0x6eec('0x7')][_0x38c9a4][_0x6eec('0x26')],_0x5e2a9b,_0x38c9a4);_0x2ac797[_0x6eec('0x9')][_0x5e2a9b]['timer']=setTimeout(_0x2ac797[_0x6eec('0x27')][_0x6eec('0xd')](_0x2ac797,_0x5e2a9b),_0x2ac797['voiceQueues'][_0x38c9a4]['acwTimeout']*0x3e8);_0x2ac797[_0x6eec('0x9')][_0x5e2a9b]['lastPauseAt']=moment()[_0x6eec('0x28')](_0x6eec('0x29'));_0x2ac797[_0x6eec('0x9')][_0x5e2a9b][_0x6eec('0x2a')]=_0x34a7fc;_0x2ac797[_0x6eec('0x9')][_0x5e2a9b][_0x6eec('0x2b')]=_0x38c9a4;_0x2ac797[_0x6eec('0x9')][_0x5e2a9b][_0x6eec('0x2c')]=function(){var _0x1abd19=getDiff(_0x2ac797[_0x6eec('0x9')][_0x5e2a9b]['lastPauseAt']);clearTimeout(_0x2ac797[_0x6eec('0x9')][_0x5e2a9b]['timer']);_0x2ac797[_0x6eec('0x9')][_0x5e2a9b][_0x6eec('0x2d')]=![];RpcVoiceAgentReport[_0x6eec('0x2e')]({'acwtime':_0x1abd19},_0x2ac797['timers'][_0x5e2a9b]['uniqueid'],_0x5e2a9b)['then'](function(_0x183ce3){logger[_0x6eec('0x21')](_0x6eec('0x2f'),_0x34a7fc,_0x1abd19,_0x183ce3);})[_0x6eec('0x30')](function(_0x20c794){logger[_0x6eec('0x31')](_0x6eec('0x32'),_0x34a7fc,_0x20c794);});delete _0x2ac797[_0x6eec('0x9')][_0x5e2a9b];};}});}else{logger[_0x6eec('0x21')](_0x6eec('0x33'),_0x34a7fc,_0x5e2a9b,_0x38c9a4);}});}})[_0x6eec('0x30')](function(_0x4382df){logger['error'](_0x6eec('0x25'),_0x34a7fc,_0x2ac797[_0x6eec('0x7')][_0x38c9a4][_0x6eec('0x26')],_0x5e2a9b,_0x38c9a4);})['finally'](function(){delete _0x2ac797[_0x6eec('0xa')][_0x34a7fc];});}catch(_0x193732){logger[_0x6eec('0x31')](_0x6eec('0x34'),_0x193732[_0x6eec('0x35')]);}};Acw[_0x6eec('0x17')]['stopAcw']=function(_0x45cfb6){try{var _0x1f10ff=this;if(_0x1f10ff[_0x6eec('0x9')][_0x45cfb6]){_0x1f10ff['timers'][_0x45cfb6]['timer']=![];var _0x28e5fa=_0x1f10ff[_0x6eec('0x9')][_0x45cfb6][_0x6eec('0x2a')];var _0x3f79d1=_0x1f10ff[_0x6eec('0x9')][_0x45cfb6]['queue'];var _0x223dfa=_0x1f10ff[_0x6eec('0x7')][_0x3f79d1][_0x6eec('0x26')];logger[_0x6eec('0x21')](_0x6eec('0x36'),_0x45cfb6);RpcUser[_0x6eec('0x37')](this[_0x6eec('0x8')][_0x45cfb6]);RpcVoiceAgentReport[_0x6eec('0x2e')]({'acwtime':_0x223dfa,'agentacw':!![]},_0x28e5fa,_0x45cfb6)['then'](function(_0x2f7a75){logger[_0x6eec('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x28e5fa,_0x223dfa,_0x2f7a75);})['catch'](function(_0x160fc0){logger[_0x6eec('0x31')](_0x6eec('0x32'),_0x28e5fa,_0x160fc0);});}else{logger[_0x6eec('0x31')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x45cfb6);if(_0x1f10ff['timers']){logger[_0x6eec('0x21')]('[ACW][TIMERS]',JSON['stringify'](_0x1f10ff[_0x6eec('0x9')]));}}}catch(_0xe523b9){logger[_0x6eec('0x31')](_0x6eec('0x38'),_0xe523b9[_0x6eec('0x35')]);}};Acw['prototype'][_0x6eec('0xc')]=function(_0x3a4d25){try{if(this['voiceQueues'][_0x3a4d25[_0x6eec('0x2b')]]&&(this[_0x6eec('0x7')][_0x3a4d25['queue']][_0x6eec('0x4')]||this[_0x6eec('0x7')][_0x3a4d25['queue']][_0x6eec('0x1a')])){if(this[_0x6eec('0x8')][_0x3a4d25[_0x6eec('0x39')]]){this[_0x6eec('0xa')][_0x3a4d25['uniqueid']]={'queue':_0x3a4d25[_0x6eec('0x2b')],'interface':_0x3a4d25[_0x6eec('0x39')],'destlinkedid':_0x3a4d25[_0x6eec('0x23')]};}}}catch(_0x165498){logger[_0x6eec('0x31')]('[ACW][syncAgentConnect]\x20%s',_0x165498['message']);}};Acw[_0x6eec('0x17')][_0x6eec('0x13')]=function(_0x3703b5){try{if(this[_0x6eec('0x7')][_0x3703b5[_0x6eec('0x2b')]]&&(this['voiceQueues'][_0x3703b5[_0x6eec('0x2b')]]['acw']||this[_0x6eec('0x7')][_0x3703b5[_0x6eec('0x2b')]][_0x6eec('0x1a')])){if(this['agents'][_0x3703b5[_0x6eec('0x39')]]){this[_0x6eec('0xa')][_0x3703b5[_0x6eec('0x2a')]]={'queue':_0x3703b5[_0x6eec('0x2b')],'interface':_0x3703b5[_0x6eec('0x39')]};}}}catch(_0x4be225){logger[_0x6eec('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0x4be225['message']);}};Acw[_0x6eec('0x17')]['syncHangupRequest']=function(_0x245a1b){try{if(this[_0x6eec('0xa')][_0x245a1b[_0x6eec('0x2a')]]&&_['isUndefined'](this['channels'][_0x245a1b[_0x6eec('0x2a')]][_0x6eec('0x3a')])){logger[_0x6eec('0x21')](_0x6eec('0x3b'),_0x245a1b[_0x6eec('0x2a')]);this[_0x6eec('0x18')](_0x245a1b[_0x6eec('0x2a')]);}else if(this[_0x6eec('0xa')][_0x245a1b[_0x6eec('0x3c')]]&&_[_0x6eec('0x3d')](this['channels'][_0x245a1b['linkedid']][_0x6eec('0x3a')])){logger[_0x6eec('0x21')](_0x6eec('0x3e'),_0x245a1b['linkedid']);this[_0x6eec('0x18')](_0x245a1b[_0x6eec('0x3c')]);}}catch(_0x16c0da){logger[_0x6eec('0x31')](_0x6eec('0x3f'),_0x16c0da[_0x6eec('0x35')]);}};Acw[_0x6eec('0x17')][_0x6eec('0x40')]=function(_0x5a6e05){try{if(this[_0x6eec('0xa')][_0x5a6e05[_0x6eec('0x2a')]]&&this[_0x6eec('0xa')][_0x5a6e05[_0x6eec('0x2a')]]['attended']){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5a6e05[_0x6eec('0x2a')]);this[_0x6eec('0x18')](_0x5a6e05[_0x6eec('0x2a')]);}else if(this[_0x6eec('0xa')][_0x5a6e05['linkedid']]&&this['channels'][_0x5a6e05[_0x6eec('0x3c')]][_0x6eec('0x3a')]){logger[_0x6eec('0x21')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x5a6e05[_0x6eec('0x3c')]);this[_0x6eec('0x18')](_0x5a6e05[_0x6eec('0x3c')]);}}catch(_0xf957c1){logger[_0x6eec('0x31')](_0x6eec('0x41'),_0xf957c1[_0x6eec('0x35')]);}};Acw[_0x6eec('0x17')][_0x6eec('0x42')]=function(_0x4e921a){try{if(!_[_0x6eec('0x43')](this['channels'][_0x4e921a[_0x6eec('0x44')]])){this[_0x6eec('0x18')](_0x4e921a[_0x6eec('0x44')]);if(this[_0x6eec('0xa')][_0x4e921a[_0x6eec('0x45')]]){this[_0x6eec('0xa')][_0x4e921a[_0x6eec('0x45')]]['attended']=!![];this[_0x6eec('0xa')][_0x4e921a['transfertargetuniqueid']]=this[_0x6eec('0xa')][_0x4e921a['secondtransfereruniqueid']];delete this[_0x6eec('0xa')][_0x4e921a[_0x6eec('0x45')]];}}else if(!_[_0x6eec('0x43')](this[_0x6eec('0xa')][_0x4e921a[_0x6eec('0x46')]])){this[_0x6eec('0x18')](_0x4e921a[_0x6eec('0x46')]);if(this[_0x6eec('0xa')][_0x4e921a[_0x6eec('0x47')]]){this[_0x6eec('0xa')][_0x4e921a['origtransfereruniqueid']]['attended']=!![];this[_0x6eec('0xa')][_0x4e921a[_0x6eec('0x44')]]=this[_0x6eec('0xa')][_0x4e921a[_0x6eec('0x47')]];delete this[_0x6eec('0xa')][_0x4e921a['origtransfereruniqueid']];}}}catch(_0x1d8fb1){logger[_0x6eec('0x31')]('[ACW][syncAttendedTransfer]\x20%s',_0x1d8fb1['message']);}};Acw['prototype'][_0x6eec('0x11')]=function(_0x3dfd47){try{if(this['channels'][_0x3dfd47[_0x6eec('0x48')]]){logger[_0x6eec('0x21')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x6eec('0x49')](_0x3dfd47[_0x6eec('0x48')]));this[_0x6eec('0x18')](_0x3dfd47[_0x6eec('0x48')]);}else if(this['channels'][_0x3dfd47['transfererlinkedid']]){logger[_0x6eec('0x21')](_0x6eec('0x4a'),JSON[_0x6eec('0x49')](_0x3dfd47[_0x6eec('0x4b')]));this[_0x6eec('0x18')](_0x3dfd47[_0x6eec('0x4b')]);}}catch(_0x169607){logger[_0x6eec('0x31')](_0x6eec('0x4c'),_0x169607[_0x6eec('0x35')]);}};Acw[_0x6eec('0x17')][_0x6eec('0x10')]=function(_0x2799ca){try{if(this[_0x6eec('0x7')][_0x2799ca[_0x6eec('0x2b')]]&&this[_0x6eec('0x7')][_0x2799ca[_0x6eec('0x2b')]]['autopause']===_0x6eec('0x4d')){if(this[_0x6eec('0x8')][_0x2799ca['interface']]){logger[_0x6eec('0x21')](_0x6eec('0x4e'),_0x2799ca['uniqueid'],_0x2799ca[_0x6eec('0x39')],_0x2799ca[_0x6eec('0x2b')]);return RpcUser[_0x6eec('0x24')](this[_0x6eec('0x8')][_0x2799ca['interface']],_0x6eec('0x4f'),_0x2799ca[_0x6eec('0x2a')]);}}}catch(_0x3a9a5b){logger[_0x6eec('0x31')](_0x6eec('0x50'),_0x3a9a5b[_0x6eec('0x35')]);}};module['exports']=Acw; \ No newline at end of file +var _0x0e85=['[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','uniqueid','queue','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','[ACW][START]\x20%s','prototype','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','message','acw','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','linkedid','isUndefined','attended','[%s][HANGUP:LINKEDID]','startAcw','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','transfereeuniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../ami','../../../config/logger','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','milliseconds','diff','seconds','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','QueuePause','then','voicePause','info','destlinkedid','savePause'];(function(_0x5b48f6,_0x5bb8bc){var _0x1e735e=function(_0x48be4a){while(--_0x48be4a){_0x5b48f6['push'](_0x5b48f6['shift']());}};_0x1e735e(++_0x5bb8bc);}(_0x0e85,0x7c));var _0x50e8=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0x0e85[_0x46d0c9];return _0x174506;};'use strict';var util=require(_0x50e8('0x0'));var _=require(_0x50e8('0x1'));var moment=require('moment');var ami=require(_0x50e8('0x2'));var logger=require(_0x50e8('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x236cf3){this['voiceQueues']=_0x236cf3[_0x50e8('0x4')];this[_0x50e8('0x5')]=_0x236cf3[_0x50e8('0x5')];this[_0x50e8('0x6')]=_0x236cf3['timers'];this[_0x50e8('0x7')]={};ami['on'](_0x50e8('0x8'),this[_0x50e8('0x9')][_0x50e8('0xa')](this));ami['on'](_0x50e8('0xb'),this[_0x50e8('0xc')]['bind'](this));ami['on'](_0x50e8('0xd'),this[_0x50e8('0xe')][_0x50e8('0xa')](this));ami['on'](_0x50e8('0xf'),this[_0x50e8('0x10')][_0x50e8('0xa')](this));ami['on'](_0x50e8('0x11'),this[_0x50e8('0x12')]['bind'](this));ami['on']('blindtransfer',this[_0x50e8('0x13')][_0x50e8('0xa')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x50e8('0xa')](this));}function getDiff(_0x2abda1){var _0x1a4c85=moment()[_0x50e8('0x14')](0x0);var _0x54efd3=moment(_0x2abda1)[_0x50e8('0x14')](0x0);return _0x1a4c85[_0x50e8('0x15')](_0x54efd3,_0x50e8('0x16'));}Acw['prototype']['startAcw']=function(_0x30a872){try{var _0xf02b48=this;var _0x40c184=this[_0x50e8('0x7')][_0x30a872][_0x50e8('0x17')];var _0x1f0338=this['channels'][_0x30a872]['queue'];var _0x441f25=this[_0x50e8('0x4')][_0x1f0338];var _0x40d060=![];var _0x45ce11=_0x50e8('0x18');if(_0x441f25[_0x50e8('0x19')]){if(_0x441f25[_0x50e8('0x1a')]['name']){_0x40d060=!![];_0x45ce11=_0x441f25[_0x50e8('0x1a')]['name'];}}ami[_0x50e8('0x1b')]({'action':_0x50e8('0x1c'),'interface':_0x40c184,'paused':!![],'reason':_0x45ce11})[_0x50e8('0x1d')](function(_0x20f835){if(_0xf02b48[_0x50e8('0x5')][_0x40c184]){return RpcUser['getAgent'](_0xf02b48[_0x50e8('0x5')][_0x40c184]['id'])[_0x50e8('0x1d')](function(_0x58110d){if(_0x58110d&&!_0x58110d[_0x50e8('0x1e')]){logger[_0x50e8('0x1f')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x30a872,_0x40c184,_0x1f0338);var _0x1ce7fc=_0xf02b48[_0x50e8('0x7')][_0x30a872]['attended']&&_0xf02b48['channels'][_0x30a872]['destlinkedid']?_0xf02b48[_0x50e8('0x7')][_0x30a872][_0x50e8('0x20')]:_0x30a872;return RpcUser[_0x50e8('0x21')](_0xf02b48[_0x50e8('0x5')][_0x40c184],_0x45ce11,_0x1ce7fc)[_0x50e8('0x1d')](function(_0x13b6e9){if(!_0x40d060){_0xf02b48['timers'][_0x40c184]={};logger[_0x50e8('0x1f')](_0x50e8('0x22'),_0x30a872,_0xf02b48['voiceQueues'][_0x1f0338][_0x50e8('0x23')],_0x40c184,_0x1f0338);_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x24')]=setTimeout(_0xf02b48[_0x50e8('0x25')]['bind'](_0xf02b48,_0x40c184),_0xf02b48[_0x50e8('0x4')][_0x1f0338]['acwTimeout']*0x3e8);_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x26')]=moment()[_0x50e8('0x27')]('YYYY-MM-DD\x20HH:mm:ss');_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x28')]=_0x30a872;_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x29')]=_0x1f0338;_0xf02b48[_0x50e8('0x6')][_0x40c184][_0x50e8('0x2a')]=function(){var _0x2c6fb3=getDiff(_0xf02b48['timers'][_0x40c184][_0x50e8('0x26')]);clearTimeout(_0xf02b48[_0x50e8('0x6')][_0x40c184]['timer']);_0xf02b48['timers'][_0x40c184][_0x50e8('0x24')]=![];RpcVoiceAgentReport[_0x50e8('0x2b')]({'acwtime':_0x2c6fb3},_0xf02b48[_0x50e8('0x6')][_0x40c184]['uniqueid'],_0x40c184)['then'](function(_0x3e58a9){logger[_0x50e8('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x30a872,_0x2c6fb3,_0x3e58a9);})[_0x50e8('0x2c')](function(_0x17c6a5){logger[_0x50e8('0x2d')](_0x50e8('0x2e'),_0x30a872,_0x17c6a5);});delete _0xf02b48['timers'][_0x40c184];};}});}else{logger[_0x50e8('0x1f')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x30a872,_0x40c184,_0x1f0338);}});}})[_0x50e8('0x2c')](function(_0x33fc5b){logger[_0x50e8('0x2d')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x30a872,_0xf02b48[_0x50e8('0x4')][_0x1f0338][_0x50e8('0x23')],_0x40c184,_0x1f0338);})['finally'](function(){delete _0xf02b48[_0x50e8('0x7')][_0x30a872];});}catch(_0x1c2fdb){logger[_0x50e8('0x2d')](_0x50e8('0x2f'),_0x1c2fdb['message']);}};Acw[_0x50e8('0x30')][_0x50e8('0x25')]=function(_0x24d3ea){try{var _0x4e2a37=this;if(_0x4e2a37['timers'][_0x24d3ea]){_0x4e2a37[_0x50e8('0x6')][_0x24d3ea][_0x50e8('0x24')]=![];var _0x3f01ee=_0x4e2a37['timers'][_0x24d3ea]['uniqueid'];var _0x5dff99=_0x4e2a37[_0x50e8('0x6')][_0x24d3ea][_0x50e8('0x29')];var _0x2cbee3=_0x4e2a37[_0x50e8('0x4')][_0x5dff99][_0x50e8('0x23')];logger[_0x50e8('0x1f')](_0x50e8('0x31'),_0x24d3ea);RpcUser[_0x50e8('0x32')](this[_0x50e8('0x5')][_0x24d3ea]);RpcVoiceAgentReport[_0x50e8('0x2b')]({'acwtime':_0x2cbee3,'agentacw':!![]},_0x3f01ee,_0x24d3ea)['then'](function(_0x3371a4){logger[_0x50e8('0x1f')](_0x50e8('0x33'),_0x3f01ee,_0x2cbee3,_0x3371a4);})[_0x50e8('0x2c')](function(_0x5dbbe1){logger[_0x50e8('0x2d')](_0x50e8('0x2e'),_0x3f01ee,_0x5dbbe1);});}else{logger[_0x50e8('0x2d')](_0x50e8('0x34'),_0x24d3ea);if(_0x4e2a37[_0x50e8('0x6')]){logger['info']('[ACW][TIMERS]',JSON[_0x50e8('0x35')](_0x4e2a37[_0x50e8('0x6')]));}}}catch(_0x53705e){logger[_0x50e8('0x2d')](_0x50e8('0x36'),_0x53705e[_0x50e8('0x37')]);}};Acw[_0x50e8('0x30')][_0x50e8('0x9')]=function(_0x313e7b){try{if(this[_0x50e8('0x4')][_0x313e7b[_0x50e8('0x29')]]&&(this['voiceQueues'][_0x313e7b[_0x50e8('0x29')]][_0x50e8('0x38')]||this[_0x50e8('0x4')][_0x313e7b[_0x50e8('0x29')]]['mandatoryDisposition'])){if(this[_0x50e8('0x5')][_0x313e7b[_0x50e8('0x17')]]){this[_0x50e8('0x7')][_0x313e7b[_0x50e8('0x28')]]={'queue':_0x313e7b['queue'],'interface':_0x313e7b[_0x50e8('0x17')],'destlinkedid':_0x313e7b['destlinkedid']};}}}catch(_0x4a2619){logger['error'](_0x50e8('0x39'),_0x4a2619[_0x50e8('0x37')]);}};Acw['prototype'][_0x50e8('0x3a')]=function(_0x2007c4){try{if(this[_0x50e8('0x4')][_0x2007c4[_0x50e8('0x29')]]&&(this[_0x50e8('0x4')][_0x2007c4[_0x50e8('0x29')]]['acw']||this[_0x50e8('0x4')][_0x2007c4['queue']][_0x50e8('0x19')])){if(this[_0x50e8('0x5')][_0x2007c4['interface']]){this[_0x50e8('0x7')][_0x2007c4['uniqueid']]={'queue':_0x2007c4[_0x50e8('0x29')],'interface':_0x2007c4[_0x50e8('0x17')]};}}}catch(_0x2e55ed){logger[_0x50e8('0x2d')](_0x50e8('0x3b'),_0x2e55ed[_0x50e8('0x37')]);}};Acw[_0x50e8('0x30')][_0x50e8('0xc')]=function(_0x141bd4){try{if(this[_0x50e8('0x7')][_0x141bd4[_0x50e8('0x28')]]&&_['isUndefined'](this[_0x50e8('0x7')][_0x141bd4[_0x50e8('0x28')]]['attended'])){logger[_0x50e8('0x1f')]('[%s][HANGUP:UNIQUEID]',_0x141bd4[_0x50e8('0x28')]);this['startAcw'](_0x141bd4[_0x50e8('0x28')]);}else if(this[_0x50e8('0x7')][_0x141bd4[_0x50e8('0x3c')]]&&_[_0x50e8('0x3d')](this[_0x50e8('0x7')][_0x141bd4[_0x50e8('0x3c')]][_0x50e8('0x3e')])){logger['info'](_0x50e8('0x3f'),_0x141bd4[_0x50e8('0x3c')]);this[_0x50e8('0x40')](_0x141bd4[_0x50e8('0x3c')]);}}catch(_0x3303f5){logger[_0x50e8('0x2d')]('[ACW][syncHangupRequest]\x20%s',_0x3303f5[_0x50e8('0x37')]);}};Acw[_0x50e8('0x30')][_0x50e8('0xe')]=function(_0x27c80a){try{if(this['channels'][_0x27c80a[_0x50e8('0x28')]]&&this[_0x50e8('0x7')][_0x27c80a[_0x50e8('0x28')]][_0x50e8('0x3e')]){logger[_0x50e8('0x1f')](_0x50e8('0x41'),_0x27c80a[_0x50e8('0x28')]);this['startAcw'](_0x27c80a['uniqueid']);}else if(this['channels'][_0x27c80a[_0x50e8('0x3c')]]&&this[_0x50e8('0x7')][_0x27c80a[_0x50e8('0x3c')]][_0x50e8('0x3e')]){logger[_0x50e8('0x1f')](_0x50e8('0x42'),_0x27c80a['linkedid']);this[_0x50e8('0x40')](_0x27c80a[_0x50e8('0x3c')]);}}catch(_0x460c8e){logger[_0x50e8('0x2d')]('[ACW][syncHangup]\x20%s',_0x460c8e[_0x50e8('0x37')]);}};Acw[_0x50e8('0x30')][_0x50e8('0x12')]=function(_0x1cc5ba){try{if(!_[_0x50e8('0x43')](this[_0x50e8('0x7')][_0x1cc5ba['transfereeuniqueid']])){this[_0x50e8('0x40')](_0x1cc5ba['transfereeuniqueid']);if(this['channels'][_0x1cc5ba['secondtransfereruniqueid']]){this[_0x50e8('0x7')][_0x1cc5ba['secondtransfereruniqueid']][_0x50e8('0x3e')]=!![];this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x44')]]=this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x45')]];delete this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x45')]];}}else if(!_['isNil'](this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x44')]])){this[_0x50e8('0x40')](_0x1cc5ba['transfertargetuniqueid']);if(this['channels'][_0x1cc5ba['origtransfereruniqueid']]){this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x46')]][_0x50e8('0x3e')]=!![];this[_0x50e8('0x7')][_0x1cc5ba[_0x50e8('0x47')]]=this[_0x50e8('0x7')][_0x1cc5ba['origtransfereruniqueid']];delete this[_0x50e8('0x7')][_0x1cc5ba['origtransfereruniqueid']];}}}catch(_0x255b48){logger[_0x50e8('0x2d')]('[ACW][syncAttendedTransfer]\x20%s',_0x255b48['message']);}};Acw['prototype'][_0x50e8('0x13')]=function(_0x3588f0){try{if(this['channels'][_0x3588f0[_0x50e8('0x48')]]){logger[_0x50e8('0x1f')](_0x50e8('0x49'),JSON[_0x50e8('0x35')](_0x3588f0[_0x50e8('0x48')]));this['startAcw'](_0x3588f0[_0x50e8('0x48')]);}else if(this[_0x50e8('0x7')][_0x3588f0[_0x50e8('0x4a')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x50e8('0x35')](_0x3588f0[_0x50e8('0x4a')]));this[_0x50e8('0x40')](_0x3588f0[_0x50e8('0x4a')]);}}catch(_0x2b59f5){logger[_0x50e8('0x2d')]('[ACW][syncBlindTransfer]\x20%s',_0x2b59f5['message']);}};Acw[_0x50e8('0x30')]['syncAgentRingNoAnswer']=function(_0x1fc530){try{if(this[_0x50e8('0x4')][_0x1fc530['queue']]&&this[_0x50e8('0x4')][_0x1fc530['queue']]['autopause']==='all'){if(this[_0x50e8('0x5')][_0x1fc530[_0x50e8('0x17')]]){logger[_0x50e8('0x1f')](_0x50e8('0x4b'),_0x1fc530['uniqueid'],_0x1fc530['interface'],_0x1fc530[_0x50e8('0x29')]);return RpcUser[_0x50e8('0x21')](this[_0x50e8('0x5')][_0x1fc530[_0x50e8('0x17')]],_0x50e8('0x4c'),_0x1fc530[_0x50e8('0x28')]);}}}catch(_0x42e1dd){logger[_0x50e8('0x2d')](_0x50e8('0x4d'),_0x42e1dd[_0x50e8('0x37')]);}};module[_0x50e8('0x4e')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index f5cdbff..db4295f 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 _0x5727=['then','actionDeviceStateList','actionCoreShowChannels','catch','exports','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','username','keepConnected','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','format','actionSipShowRegistry','Action','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','resolve'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x5727,0xb4));var _0x7572=function(_0x165ffc,_0x3f9d50){_0x165ffc=_0x165ffc-0x0;var _0xe2cb59=_0x5727[_0x165ffc];return _0xe2cb59;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x7572('0x0'));var moment=require('moment');var util=require(_0x7572('0x1'));var _=require('lodash');var logger=require(_0x7572('0x2'))(_0x7572('0x3'));var config=require(_0x7572('0x4'));var ami=new Manager(config[_0x7572('0x5')]['port'],config[_0x7572('0x5')]['ip'],config[_0x7572('0x5')][_0x7572('0x6')],config['asterisk']['password'],!![]);ami[_0x7572('0x7')]();ami['Action']=BPromise[_0x7572('0x8')](ami[_0x7572('0x9')]);function error(_0x5ab682){logger[_0x7572('0xa')](util['format'](_0x7572('0xb'),config['asterisk'][_0x7572('0x6')],config[_0x7572('0x5')]['ip'],config[_0x7572('0x5')][_0x7572('0xc')],util[_0x7572('0xd')](_0x5ab682,![],null)));}function close(){logger[_0x7572('0xa')](util[_0x7572('0xe')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x7572('0x5')][_0x7572('0x6')],config[_0x7572('0x5')]['ip'],config[_0x7572('0x5')][_0x7572('0xc')]));}ami[_0x7572('0xf')]=function(){return function(){return ami[_0x7572('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7572('0x10')]({'action':'devicestatelist'});};};ami[_0x7572('0x11')]=function(){return function(){return ami[_0x7572('0x10')]({'action':_0x7572('0x12')});};};ami[_0x7572('0x13')]=function(){return function(){return ami[_0x7572('0x10')]({'action':_0x7572('0x14')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x7572('0x10')]({'action':_0x7572('0x15')});};};function connect(_0x4679a6){logger[_0x7572('0x16')](util[_0x7572('0xe')](_0x7572('0x17'),config[_0x7572('0x5')]['username'],config[_0x7572('0x5')]['ip'],config[_0x7572('0x5')]['port']));ami[_0x7572('0x18')](_0x7572('0xa'),error);ami['once'](_0x7572('0x19'),close);}ami['on'](_0x7572('0x1a'),connect);ami['on'](_0x7572('0x1b'),function(_0x7bdcdd){logger[_0x7572('0x16')](util[_0x7572('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x7572('0x5')][_0x7572('0x6')],config[_0x7572('0x5')]['ip'],config[_0x7572('0x5')]['port'],util[_0x7572('0xd')](_0x7bdcdd,![],null)));});ami['on'](_0x7572('0x1c'),function(_0x169427){logger[_0x7572('0x16')](util[_0x7572('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x7572('0x5')][_0x7572('0x6')],config['asterisk']['ip'],config[_0x7572('0x5')][_0x7572('0xc')]));return BPromise[_0x7572('0x1d')]()['then'](ami[_0x7572('0xf')]())[_0x7572('0x1e')](ami[_0x7572('0x1f')]())[_0x7572('0x1e')](ami[_0x7572('0x11')]())['then'](ami[_0x7572('0x13')]())[_0x7572('0x1e')](ami[_0x7572('0x20')]())[_0x7572('0x21')](function(_0x564bc5){console['log'](_0x564bc5);});});ami[_0x7572('0x18')](_0x7572('0xa'),error);ami['once'](_0x7572('0x19'),close);module[_0x7572('0x22')]=ami; \ No newline at end of file +var _0xc933=['connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','catch','exports','moment','lodash','ami','../../config/environment','asterisk','port','username','keepConnected','Action','action','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','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close'];(function(_0xb7c425,_0x4a212){var _0x39d900=function(_0x13d997){while(--_0x13d997){_0xb7c425['push'](_0xb7c425['shift']());}};_0x39d900(++_0x4a212);}(_0xc933,0xb6));var _0x3c93=function(_0x19e793,_0x4ba1cf){_0x19e793=_0x19e793-0x0;var _0x1ae2c0=_0xc933[_0x19e793];return _0x1ae2c0;};'use strict';var Manager=require('asterisk-manager');var BPromise=require('bluebird');var moment=require(_0x3c93('0x0'));var util=require('util');var _=require(_0x3c93('0x1'));var logger=require('../../config/logger')(_0x3c93('0x2'));var config=require(_0x3c93('0x3'));var ami=new Manager(config[_0x3c93('0x4')][_0x3c93('0x5')],config[_0x3c93('0x4')]['ip'],config[_0x3c93('0x4')][_0x3c93('0x6')],config[_0x3c93('0x4')]['password'],!![]);ami[_0x3c93('0x7')]();ami[_0x3c93('0x8')]=BPromise['promisify'](ami[_0x3c93('0x9')]);function error(_0x99ccf0){logger[_0x3c93('0xa')](util[_0x3c93('0xb')](_0x3c93('0xc'),config[_0x3c93('0x4')]['username'],config[_0x3c93('0x4')]['ip'],config['asterisk'][_0x3c93('0x5')],util[_0x3c93('0xd')](_0x99ccf0,![],null)));}function close(){logger['error'](util[_0x3c93('0xb')](_0x3c93('0xe'),config[_0x3c93('0x4')][_0x3c93('0x6')],config[_0x3c93('0x4')]['ip'],config[_0x3c93('0x4')]['port']));}ami[_0x3c93('0xf')]=function(){return function(){return ami[_0x3c93('0x8')]({'action':_0x3c93('0x10')});};};ami[_0x3c93('0x11')]=function(){return function(){return ami[_0x3c93('0x8')]({'action':'devicestatelist'});};};ami[_0x3c93('0x12')]=function(){return function(){return ami[_0x3c93('0x8')]({'action':_0x3c93('0x13')});};};ami[_0x3c93('0x14')]=function(){return function(){return ami['Action']({'action':_0x3c93('0x15')});};};ami[_0x3c93('0x16')]=function(){return function(){return ami[_0x3c93('0x8')]({'action':_0x3c93('0x17')});};};function connect(_0x3a2ea3){logger[_0x3c93('0x18')](util[_0x3c93('0xb')](_0x3c93('0x19'),config[_0x3c93('0x4')][_0x3c93('0x6')],config['asterisk']['ip'],config[_0x3c93('0x4')]['port']));ami[_0x3c93('0x1a')]('error',error);ami[_0x3c93('0x1a')](_0x3c93('0x1b'),close);}ami['on'](_0x3c93('0x1c'),connect);ami['on'](_0x3c93('0x1d'),function(_0x2d1309){logger[_0x3c93('0x18')](util[_0x3c93('0xb')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x3c93('0x4')][_0x3c93('0x6')],config[_0x3c93('0x4')]['ip'],config[_0x3c93('0x4')][_0x3c93('0x5')],util['inspect'](_0x2d1309,![],null)));});ami['on'](_0x3c93('0x1e'),function(_0x2a6839){logger[_0x3c93('0x18')](util['format'](_0x3c93('0x1f'),config[_0x3c93('0x4')][_0x3c93('0x6')],config[_0x3c93('0x4')]['ip'],config['asterisk'][_0x3c93('0x5')]));return BPromise['resolve']()[_0x3c93('0x20')](ami[_0x3c93('0xf')]())['then'](ami['actionDeviceStateList']())[_0x3c93('0x20')](ami[_0x3c93('0x12')]())[_0x3c93('0x20')](ami[_0x3c93('0x14')]())['then'](ami[_0x3c93('0x16')]())[_0x3c93('0x21')](function(_0x17169d){console['log'](_0x17169d);});});ami['once'](_0x3c93('0xa'),error);ami['once'](_0x3c93('0x1b'),close);module[_0x3c93('0x22')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index e664d06..91b52b9 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 _0xe070=['debug','rpc','memberReport','error','message','result','catch','jayson/promise','bluebird','../../config/logger','ami','client','http','Request','request','then'];(function(_0x11ad00,_0x152de8){var _0x18c36f=function(_0x1953dd){while(--_0x1953dd){_0x11ad00['push'](_0x11ad00['shift']());}};_0x18c36f(++_0x152de8);}(_0xe070,0x167));var _0x0e07=function(_0x2f5100,_0x565cbe){_0x2f5100=_0x2f5100-0x0;var _0x40c4bc=_0xe070[_0x2f5100];return _0x40c4bc;};'use strict';var jayson=require(_0x0e07('0x0'));var BPromise=require(_0x0e07('0x1'));var logger=require(_0x0e07('0x2'))(_0x0e07('0x3'));var client=jayson[_0x0e07('0x4')][_0x0e07('0x5')]({'port':0x2329});client[_0x0e07('0x6')]=function(_0x5b96bb,_0x4a9411){return new BPromise(function(_0x32c778,_0x528e56){return client[_0x0e07('0x7')](_0x5b96bb,_0x4a9411)[_0x0e07('0x8')](function(_0x2426ea){logger[_0x0e07('0x9')](_0x0e07('0xa'),_0x0e07('0xb'),_0x5b96bb,_0x4a9411,_0x2426ea);if(_0x2426ea[_0x0e07('0xc')]){logger[_0x0e07('0xc')]('rpc',_0x0e07('0xb'),_0x5b96bb,_0x2426ea['error'][_0x0e07('0xd')],_0x4a9411);return _0x528e56(_0x2426ea[_0x0e07('0xc')][_0x0e07('0xd')]);}else{return _0x32c778(_0x2426ea[_0x0e07('0xe')]);}})[_0x0e07('0xf')](function(_0x125825){logger['error'](_0x0e07('0xa'),'memberReport',_0x5b96bb,_0x125825,_0x4a9411);return _0x528e56(_0x125825);});});};module['exports']=client; \ No newline at end of file +var _0x072f=['memberReport','error','message','catch','exports','bluebird','../../config/logger','ami','client','http','Request','request','then','debug','rpc'];(function(_0x474d97,_0x5909ce){var _0x1edf25=function(_0x2831df){while(--_0x2831df){_0x474d97['push'](_0x474d97['shift']());}};_0x1edf25(++_0x5909ce);}(_0x072f,0x15e));var _0xf072=function(_0x41392b,_0x39349e){_0x41392b=_0x41392b-0x0;var _0x5b00c6=_0x072f[_0x41392b];return _0x5b00c6;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xf072('0x0'));var logger=require(_0xf072('0x1'))(_0xf072('0x2'));var client=jayson[_0xf072('0x3')][_0xf072('0x4')]({'port':0x2329});client[_0xf072('0x5')]=function(_0x47e792,_0x53c520){return new BPromise(function(_0x41b02b,_0x2e9c63){return client[_0xf072('0x6')](_0x47e792,_0x53c520)[_0xf072('0x7')](function(_0xfba3a1){logger[_0xf072('0x8')](_0xf072('0x9'),_0xf072('0xa'),_0x47e792,_0x53c520,_0xfba3a1);if(_0xfba3a1[_0xf072('0xb')]){logger[_0xf072('0xb')]('rpc',_0xf072('0xa'),_0x47e792,_0xfba3a1[_0xf072('0xb')][_0xf072('0xc')],_0x53c520);return _0x2e9c63(_0xfba3a1['error'][_0xf072('0xc')]);}else{return _0x41b02b(_0xfba3a1['result']);}})[_0xf072('0xd')](function(_0x2ce7e8){logger['error'](_0xf072('0x9'),'memberReport',_0x47e792,_0x2ce7e8,_0x53c520);return _0x2e9c63(_0x2ce7e8);});});};module[_0xf072('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 197c9bf..4cdadca 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 _0x97e7=['uniqueid','Contact','phone','firstName','lastName','number','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue'];(function(_0x297c3c,_0x526b29){var _0x498d44=function(_0x2ab8c7){while(--_0x2ab8c7){_0x297c3c['push'](_0x297c3c['shift']());}};_0x498d44(++_0x526b29);}(_0x97e7,0x1a1));var _0x797e=function(_0x40ae3b,_0x59c5d6){_0x40ae3b=_0x40ae3b-0x0;var _0x38b18f=_0x97e7[_0x40ae3b];return _0x38b18f;};'use strict';var util=require(_0x797e('0x0'));var _=require(_0x797e('0x1'));var moment=require(_0x797e('0x2'));function checkNameSurname(_0x5a637e,_0x2faa2d,_0x2996c0){var _0x13b749='';if(!_[_0x797e('0x3')](_0x2faa2d)&&_0x797e('0x4')===typeof _0x2faa2d){_0x13b749+=_0x2faa2d;}if(!_[_0x797e('0x3')](_0x2996c0)&&_0x797e('0x4')===typeof _0x2996c0){_0x13b749+='\x20'+_0x2996c0;}if(_0x13b749!==''){return _0x13b749;}return _0x5a637e;}function Action(_0x30beea,_0x445e60,_0x204c83){this[_0x797e('0x5')]=_0x30beea;this[_0x797e('0x6')]=_0x204c83||undefined;this['name']=checkNameSurname(_0x445e60[_0x797e('0x7')][_0x797e('0x8')],_0x445e60[_0x797e('0x7')][_0x797e('0x9')],_0x445e60['Contact'][_0x797e('0xa')]);this[_0x797e('0xb')]=_0x445e60[_0x797e('0x7')][_0x797e('0x8')];this[_0x797e('0xc')]=_0x30beea[_0x797e('0xd')];this[_0x797e('0xe')]=_0x445e60['active']||![];this[_0x797e('0xf')]=_0x30beea[_0x797e('0xf')];this[_0x797e('0x10')]=_0x30beea['dialQueueTimeout']||0x3;this[_0x797e('0x11')]=_0x445e60['scheduledat'];this[_0x797e('0x12')]=_0x445e60['countbusyretry'];this[_0x797e('0x13')]=_0x445e60[_0x797e('0x13')];this['countnoanswerretry']=_0x445e60[_0x797e('0x14')];this['countnosuchnumberretry']=_0x445e60[_0x797e('0x15')];this[_0x797e('0x16')]=_0x445e60[_0x797e('0x16')];this[_0x797e('0x17')]=_0x445e60[_0x797e('0x17')];this[_0x797e('0x18')]=_0x445e60[_0x797e('0x18')];this[_0x797e('0x19')]=_0x445e60[_0x797e('0x19')];this['ContactId']=_0x445e60[_0x797e('0x1a')];this[_0x797e('0x1b')]=_0x445e60[_0x797e('0x1b')];this['UserId']=_0x445e60[_0x797e('0x1c')];this[_0x797e('0x1d')]=_0x445e60['VoiceQueueId'];this[_0x797e('0x1e')]=_0x445e60[_0x797e('0x1e')];this[_0x797e('0x1f')]=_0x445e60['id'];this[_0x797e('0x20')]=_0x445e60[_0x797e('0x7')]['firstName']||'';this[_0x797e('0x21')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x445e60['callback'];this['callbackuniqueid']=_0x445e60[_0x797e('0x22')];this[_0x797e('0x23')]=_0x445e60[_0x797e('0x23')];this[_0x797e('0x24')]=_0x445e60[_0x797e('0x24')];this[_0x797e('0x25')]='';this[_0x797e('0x26')]='';}Action[_0x797e('0x27')][_0x797e('0x28')]=function(){return util[_0x797e('0x29')](_0x797e('0x2a'),this['name'],this[_0x797e('0x5')][_0x797e('0x2b')]>0x0?this['number'][_0x797e('0x2c')](this[_0x797e('0x5')][_0x797e('0x2b')]):this[_0x797e('0xb')]);};Action[_0x797e('0x27')][_0x797e('0x2d')]=function(){return this[_0x797e('0xc')];};module[_0x797e('0x2e')]=Action; \ No newline at end of file +var _0x8a9d=['countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','firstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','util','lodash','isNil','string','voiceQueue','uniqueid','phone','Contact','lastName','number','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x28cfef,_0x16c2ce){var _0x3705e0=function(_0x2457a4){while(--_0x2457a4){_0x28cfef['push'](_0x28cfef['shift']());}};_0x3705e0(++_0x16c2ce);}(_0x8a9d,0x1ed));var _0xd8a9=function(_0x37e21b,_0x50b31e){_0x37e21b=_0x37e21b-0x0;var _0x411f61=_0x8a9d[_0x37e21b];return _0x411f61;};'use strict';var util=require(_0xd8a9('0x0'));var _=require(_0xd8a9('0x1'));var moment=require('moment');function checkNameSurname(_0x1240ae,_0x91259,_0x502276){var _0x32b520='';if(!_['isNil'](_0x91259)&&'string'===typeof _0x91259){_0x32b520+=_0x91259;}if(!_[_0xd8a9('0x2')](_0x502276)&&_0xd8a9('0x3')===typeof _0x502276){_0x32b520+='\x20'+_0x502276;}if(_0x32b520!==''){return _0x32b520;}return _0x1240ae;}function Action(_0x238bf1,_0x5f56e6,_0x2645b2){this[_0xd8a9('0x4')]=_0x238bf1;this[_0xd8a9('0x5')]=_0x2645b2||undefined;this['name']=checkNameSurname(_0x5f56e6['Contact'][_0xd8a9('0x6')],_0x5f56e6[_0xd8a9('0x7')]['firstName'],_0x5f56e6[_0xd8a9('0x7')][_0xd8a9('0x8')]);this[_0xd8a9('0x9')]=_0x5f56e6[_0xd8a9('0x7')][_0xd8a9('0x6')];this[_0xd8a9('0xa')]=_0x238bf1[_0xd8a9('0xb')];this[_0xd8a9('0xc')]=_0x5f56e6[_0xd8a9('0xc')]||![];this[_0xd8a9('0xd')]=_0x238bf1[_0xd8a9('0xd')];this[_0xd8a9('0xe')]=_0x238bf1[_0xd8a9('0xe')]||0x3;this[_0xd8a9('0xf')]=_0x5f56e6[_0xd8a9('0xf')];this[_0xd8a9('0x10')]=_0x5f56e6['countbusyretry'];this[_0xd8a9('0x11')]=_0x5f56e6['countcongestionretry'];this[_0xd8a9('0x12')]=_0x5f56e6[_0xd8a9('0x12')];this[_0xd8a9('0x13')]=_0x5f56e6['countnosuchnumberretry'];this['countdropretry']=_0x5f56e6[_0xd8a9('0x14')];this['countabandonedretry']=_0x5f56e6[_0xd8a9('0x15')];this[_0xd8a9('0x16')]=_0x5f56e6[_0xd8a9('0x16')];this[_0xd8a9('0x17')]=_0x5f56e6['countagentrejectretry'];this[_0xd8a9('0x18')]=_0x5f56e6[_0xd8a9('0x18')];this[_0xd8a9('0x19')]=_0x5f56e6['ListId'];this[_0xd8a9('0x1a')]=_0x5f56e6[_0xd8a9('0x1a')];this[_0xd8a9('0x1b')]=_0x5f56e6[_0xd8a9('0x1b')];this[_0xd8a9('0x1c')]=_0x5f56e6[_0xd8a9('0x1c')];this[_0xd8a9('0x1d')]=_0x5f56e6['id'];this[_0xd8a9('0x1e')]=_0x5f56e6[_0xd8a9('0x7')][_0xd8a9('0x1f')]||'';this['starttime']=moment()[_0xd8a9('0x20')](_0xd8a9('0x21'));this[_0xd8a9('0x22')]=_0x5f56e6[_0xd8a9('0x22')];this[_0xd8a9('0x23')]=_0x5f56e6['callbackuniqueid'];this[_0xd8a9('0x24')]=_0x5f56e6[_0xd8a9('0x24')];this[_0xd8a9('0x25')]=_0x5f56e6[_0xd8a9('0x25')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action['prototype']['getCaller']=function(){return util[_0xd8a9('0x20')](_0xd8a9('0x26'),this[_0xd8a9('0xb')],this[_0xd8a9('0x4')][_0xd8a9('0x27')]>0x0?this[_0xd8a9('0x9')][_0xd8a9('0x28')](this[_0xd8a9('0x4')][_0xd8a9('0x27')]):this['number']);};Action['prototype'][_0xd8a9('0x29')]=function(){return this[_0xd8a9('0xa')];};module[_0xd8a9('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/additionalPhone.js b/server/services/ami/dialer/additionalPhone.js index f45e4ad..b75cdc1 100644 --- a/server/services/ami/dialer/additionalPhone.js +++ b/server/services/ami/dialer/additionalPhone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3a2a=['ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','starttime','responsetime','endtime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x114984,_0x5c9593){var _0x44822b=function(_0x10af37){while(--_0x10af37){_0x114984['push'](_0x114984['shift']());}};_0x44822b(++_0x5c9593);}(_0x3a2a,0xc0));var _0xa3a2=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x3a2a[_0x19e35c];return _0x3e1fe8;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xa3a2('0x0'));function getSeconds(_0x5cb268,_0x500a28){var _0x331571=moment(_0x5cb268)[_0xa3a2('0x1')](0x0);var _0x3c6b45=moment(_0x500a28)[_0xa3a2('0x1')](0x0);return _0x331571[_0xa3a2('0x2')](_0x3c6b45,_0xa3a2('0x3'));}function AdditionalPhone(_0xa9a592){this['uniqueid']=_0xa9a592[_0xa3a2('0x4')];this[_0xa3a2('0x5')]=_0xa9a592[_0xa3a2('0x5')]||undefined;this[_0xa3a2('0x6')]=_0xa9a592[_0xa3a2('0x6')];this[_0xa3a2('0x7')]=_0xa9a592['type']===_0xa3a2('0x8')?_0xa3a2('0x9'):_0xa9a592['type'];this[_0xa3a2('0xa')]=_0xa9a592[_0xa3a2('0xa')];this[_0xa3a2('0xb')]=_0xa9a592[_0xa3a2('0xb')];this[_0xa3a2('0xc')]=_0xa9a592[_0xa3a2('0xc')];this[_0xa3a2('0xd')]=_0xa9a592[_0xa3a2('0xa')]+_0xa9a592[_0xa3a2('0xb')]+_0xa9a592['countnoanswerretry']+_0xa9a592[_0xa3a2('0xe')]+_0xa9a592[_0xa3a2('0xf')]+_0xa9a592[_0xa3a2('0x10')]+_0xa9a592[_0xa3a2('0x11')]+_0xa9a592[_0xa3a2('0x12')];this[_0xa3a2('0xe')]=_0xa9a592[_0xa3a2('0xe')];this[_0xa3a2('0xf')]=_0xa9a592[_0xa3a2('0xf')];this[_0xa3a2('0x10')]=_0xa9a592[_0xa3a2('0x10')];this[_0xa3a2('0x11')]=_0xa9a592[_0xa3a2('0x11')];this[_0xa3a2('0x12')]=_0xa9a592['countagentrejectretry'];this[_0xa3a2('0x9')]=_0xa9a592['queue'];this[_0xa3a2('0x13')]=_0xa9a592[_0xa3a2('0x14')];this['calleridnum']=_0xa9a592['number'];this['starttime']=_0xa9a592[_0xa3a2('0x15')];this[_0xa3a2('0x16')]=_0xa9a592['responsetime'];this[_0xa3a2('0x17')]=_0xa9a592[_0xa3a2('0x16')];this[_0xa3a2('0x18')]=getSeconds(_0xa9a592[_0xa3a2('0x16')],_0xa9a592[_0xa3a2('0x15')]);this['holdtime']=0x0;this[_0xa3a2('0x19')]=0x0;this[_0xa3a2('0x1a')]=_0xa9a592[_0xa3a2('0x1a')];this[_0xa3a2('0x1b')]=_0xa9a592[_0xa3a2('0x1b')];this[_0xa3a2('0x1c')]=_0xa9a592[_0xa3a2('0x1c')];this[_0xa3a2('0x1d')]=_0xa9a592[_0xa3a2('0x1d')];this['ContactId']=_0xa9a592[_0xa3a2('0x1e')];this['ListId']=_0xa9a592[_0xa3a2('0x1f')];this[_0xa3a2('0x20')]=_0xa9a592[_0xa3a2('0x20')];this[_0xa3a2('0x21')]=_0xa9a592[_0xa3a2('0x21')];this['CampaignId']=_0xa9a592['CampaignId'];this[_0xa3a2('0x22')]=_0xa9a592[_0xa3a2('0x22')]||'';this[_0xa3a2('0x23')]=_0xa9a592[_0xa3a2('0x23')]||'';}module[_0xa3a2('0x24')]=History; \ No newline at end of file +var _0x4ec5=['milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment'];(function(_0x2867ed,_0x433803){var _0x2acbc8=function(_0x229c11){while(--_0x229c11){_0x2867ed['push'](_0x2867ed['shift']());}};_0x2acbc8(++_0x433803);}(_0x4ec5,0x9e));var _0x54ec=function(_0x2b5803,_0x270d80){_0x2b5803=_0x2b5803-0x0;var _0xc6778=_0x4ec5[_0x2b5803];return _0xc6778;};'use strict';var util=require(_0x54ec('0x0'));var _=require('lodash');var moment=require(_0x54ec('0x1'));function getSeconds(_0x109004,_0x5d99b0){var _0x2cf813=moment(_0x109004)[_0x54ec('0x2')](0x0);var _0x140e6d=moment(_0x5d99b0)[_0x54ec('0x2')](0x0);return _0x2cf813['diff'](_0x140e6d,_0x54ec('0x3'));}function AdditionalPhone(_0x260ef4){this[_0x54ec('0x4')]=_0x260ef4[_0x54ec('0x4')];this['scheduledat']=_0x260ef4[_0x54ec('0x5')]||undefined;this[_0x54ec('0x6')]=_0x260ef4[_0x54ec('0x6')];this[_0x54ec('0x7')]=_0x260ef4['type']===_0x54ec('0x8')?_0x54ec('0x9'):_0x260ef4['type'];this[_0x54ec('0xa')]=_0x260ef4[_0x54ec('0xa')];this['countcongestionretry']=_0x260ef4[_0x54ec('0xb')];this[_0x54ec('0xc')]=_0x260ef4[_0x54ec('0xc')];this[_0x54ec('0xd')]=_0x260ef4[_0x54ec('0xa')]+_0x260ef4[_0x54ec('0xb')]+_0x260ef4[_0x54ec('0xc')]+_0x260ef4[_0x54ec('0xe')]+_0x260ef4[_0x54ec('0xf')]+_0x260ef4[_0x54ec('0x10')]+_0x260ef4[_0x54ec('0x11')]+_0x260ef4['countagentrejectretry'];this[_0x54ec('0xe')]=_0x260ef4[_0x54ec('0xe')];this[_0x54ec('0xf')]=_0x260ef4[_0x54ec('0xf')];this[_0x54ec('0x10')]=_0x260ef4[_0x54ec('0x10')];this[_0x54ec('0x11')]=_0x260ef4[_0x54ec('0x11')];this[_0x54ec('0x12')]=_0x260ef4[_0x54ec('0x12')];this[_0x54ec('0x9')]=_0x260ef4['queue'];this[_0x54ec('0x13')]=_0x260ef4[_0x54ec('0x14')];this[_0x54ec('0x15')]=_0x260ef4[_0x54ec('0x16')];this[_0x54ec('0x17')]=_0x260ef4[_0x54ec('0x17')];this[_0x54ec('0x18')]=_0x260ef4[_0x54ec('0x18')];this[_0x54ec('0x19')]=_0x260ef4[_0x54ec('0x18')];this[_0x54ec('0x1a')]=getSeconds(_0x260ef4[_0x54ec('0x18')],_0x260ef4[_0x54ec('0x17')]);this[_0x54ec('0x1b')]=0x0;this[_0x54ec('0x1c')]=0x0;this[_0x54ec('0x1d')]=_0x260ef4[_0x54ec('0x1d')];this[_0x54ec('0x1e')]=_0x260ef4[_0x54ec('0x1e')];this[_0x54ec('0x1f')]=_0x260ef4[_0x54ec('0x1f')];this[_0x54ec('0x20')]=_0x260ef4[_0x54ec('0x20')];this['ContactId']=_0x260ef4[_0x54ec('0x21')];this[_0x54ec('0x22')]=_0x260ef4[_0x54ec('0x22')];this[_0x54ec('0x23')]=_0x260ef4[_0x54ec('0x23')];this[_0x54ec('0x24')]=_0x260ef4[_0x54ec('0x24')];this[_0x54ec('0x25')]=_0x260ef4[_0x54ec('0x25')];this[_0x54ec('0x26')]=_0x260ef4[_0x54ec('0x26')]||'';this[_0x54ec('0x27')]=_0x260ef4['originatecalleridname']||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 9ad80b8..58bb3a6 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 _0x880d=['campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','scheduledat','type'];(function(_0x42c836,_0x319215){var _0x272dc7=function(_0x4816e8){while(--_0x4816e8){_0x42c836['push'](_0x42c836['shift']());}};_0x272dc7(++_0x319215);}(_0x880d,0x122));var _0xd880=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x880d[_0x4a3898];return _0x25ceb0;};'use strict';var util=require(_0xd880('0x0'));var _=require(_0xd880('0x1'));var moment=require(_0xd880('0x2'));function getSeconds(_0x276e35,_0x5efdcc){var _0x416d8b=moment(_0x276e35)[_0xd880('0x3')](0x0);var _0x26e8b2=moment(_0x5efdcc)[_0xd880('0x3')](0x0);return _0x416d8b[_0xd880('0x4')](_0x26e8b2,_0xd880('0x5'));}function AgentComplete(_0xfb8b21,_0xafc1e3){this[_0xd880('0x6')]=0x4;this[_0xd880('0x7')]='Answer';this['scheduledat']=_0xfb8b21[_0xd880('0x8')];this[_0xd880('0x9')]=_0xfb8b21['type'];this[_0xd880('0xa')]=_0xfb8b21[_0xd880('0x9')]===_0xd880('0xb')?_0xd880('0xc'):_0xfb8b21[_0xd880('0x9')];this[_0xd880('0xd')]=_0xfb8b21[_0xd880('0xd')];this['countcongestionretry']=_0xfb8b21[_0xd880('0xe')];this[_0xd880('0xf')]=_0xfb8b21[_0xd880('0xf')];this[_0xd880('0x10')]=_0xfb8b21[_0xd880('0xd')]+_0xfb8b21[_0xd880('0xe')]+_0xfb8b21[_0xd880('0xf')]+_0xfb8b21[_0xd880('0x11')]+_0xfb8b21['countdropretry']+_0xfb8b21[_0xd880('0x12')]+_0xfb8b21[_0xd880('0x13')]+_0xfb8b21[_0xd880('0x14')];this['countnosuchnumberretry']=_0xfb8b21['countnosuchnumberretry'];this[_0xd880('0x15')]=_0xfb8b21[_0xd880('0x15')];this[_0xd880('0x12')]=_0xfb8b21[_0xd880('0x12')];this['countmachineretry']=_0xfb8b21[_0xd880('0x13')];this[_0xd880('0x14')]=_0xfb8b21[_0xd880('0x14')];this[_0xd880('0x16')]=_0xafc1e3['uniqueid'];this[_0xd880('0x17')]=_0xfb8b21[_0xd880('0x18')];this[_0xd880('0x19')]=_0xfb8b21[_0xd880('0x1a')];this[_0xd880('0x1b')]=_0xfb8b21[_0xd880('0x1b')];this[_0xd880('0x1c')]=_0xfb8b21[_0xd880('0x1c')];this['answertime']=_0xfb8b21[_0xd880('0x1d')];this[_0xd880('0x1e')]=moment()[_0xd880('0x1f')](_0xd880('0x20'));this[_0xd880('0x21')]=getSeconds(_0xfb8b21[_0xd880('0x1c')],_0xfb8b21['starttime']);this[_0xd880('0x22')]=getSeconds(_0xfb8b21[_0xd880('0x1d')],_0xfb8b21[_0xd880('0x1c')]);this[_0xd880('0x23')]=getSeconds(this['endtime'],_0xfb8b21[_0xd880('0x1d')]);this['queue']=_0xafc1e3['queue'];this[_0xd880('0x24')]=_0xafc1e3[_0xd880('0x24')];this[_0xd880('0x25')]=_0xafc1e3[_0xd880('0x25')];this[_0xd880('0x26')]=_0xfb8b21['callback'];this[_0xd880('0x27')]=_0xfb8b21[_0xd880('0x27')];this[_0xd880('0x28')]=_0xfb8b21['callbackat'];this[_0xd880('0x29')]=_0xfb8b21[_0xd880('0x29')];this[_0xd880('0x2a')]=_0xfb8b21[_0xd880('0x2a')];this['ListId']=_0xfb8b21[_0xd880('0x2b')];this[_0xd880('0x2c')]=_0xfb8b21['UserId'];this['VoiceQueueId']=_0xfb8b21[_0xd880('0x2d')];this[_0xd880('0x2e')]=_0xfb8b21[_0xd880('0x2e')];this[_0xd880('0x2f')]=_0xfb8b21['originatecalleridnum']||'';this[_0xd880('0x30')]=_0xfb8b21[_0xd880('0x30')]||'';}module[_0xd880('0x31')]=AgentComplete; \ No newline at end of file +var _0x3046=['VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','answertime','endtime','format','ringtime','responsetime','holdtime','talktime','queue','membername','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId'];(function(_0x102fc6,_0x19d7ee){var _0x290711=function(_0x1777bf){while(--_0x1777bf){_0x102fc6['push'](_0x102fc6['shift']());}};_0x290711(++_0x19d7ee);}(_0x3046,0xf0));var _0x6304=function(_0x4bd386,_0x43330e){_0x4bd386=_0x4bd386-0x0;var _0x1ed1c2=_0x3046[_0x4bd386];return _0x1ed1c2;};'use strict';var util=require(_0x6304('0x0'));var _=require(_0x6304('0x1'));var moment=require(_0x6304('0x2'));function getSeconds(_0x43c347,_0x5cc783){var _0x5ebad5=moment(_0x43c347)[_0x6304('0x3')](0x0);var _0xf62114=moment(_0x5cc783)[_0x6304('0x3')](0x0);return _0x5ebad5[_0x6304('0x4')](_0xf62114,_0x6304('0x5'));}function AgentComplete(_0x4b7c33,_0x4eac89){this[_0x6304('0x6')]=0x4;this[_0x6304('0x7')]=_0x6304('0x8');this[_0x6304('0x9')]=_0x4b7c33[_0x6304('0x9')];this[_0x6304('0xa')]=_0x4b7c33[_0x6304('0xa')];this[_0x6304('0xb')]=_0x4b7c33['type']===_0x6304('0xc')?'queue':_0x4b7c33['type'];this['countbusyretry']=_0x4b7c33[_0x6304('0xd')];this[_0x6304('0xe')]=_0x4b7c33['countcongestionretry'];this['countnoanswerretry']=_0x4b7c33[_0x6304('0xf')];this[_0x6304('0x10')]=_0x4b7c33['countbusyretry']+_0x4b7c33[_0x6304('0xe')]+_0x4b7c33[_0x6304('0xf')]+_0x4b7c33[_0x6304('0x11')]+_0x4b7c33[_0x6304('0x12')]+_0x4b7c33[_0x6304('0x13')]+_0x4b7c33['countmachineretry']+_0x4b7c33[_0x6304('0x14')];this['countnosuchnumberretry']=_0x4b7c33[_0x6304('0x11')];this[_0x6304('0x12')]=_0x4b7c33[_0x6304('0x12')];this[_0x6304('0x13')]=_0x4b7c33[_0x6304('0x13')];this[_0x6304('0x15')]=_0x4b7c33[_0x6304('0x15')];this[_0x6304('0x14')]=_0x4b7c33[_0x6304('0x14')];this[_0x6304('0x16')]=_0x4eac89[_0x6304('0x16')];this['calleridname']=_0x4b7c33[_0x6304('0x17')];this[_0x6304('0x18')]=_0x4b7c33[_0x6304('0x19')];this[_0x6304('0x1a')]=_0x4b7c33['starttime'];this['responsetime']=_0x4b7c33['responsetime'];this[_0x6304('0x1b')]=_0x4b7c33[_0x6304('0x1b')];this[_0x6304('0x1c')]=moment()[_0x6304('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6304('0x1e')]=getSeconds(_0x4b7c33[_0x6304('0x1f')],_0x4b7c33[_0x6304('0x1a')]);this[_0x6304('0x20')]=getSeconds(_0x4b7c33['answertime'],_0x4b7c33[_0x6304('0x1f')]);this[_0x6304('0x21')]=getSeconds(this[_0x6304('0x1c')],_0x4b7c33['answertime']);this[_0x6304('0x22')]=_0x4eac89[_0x6304('0x22')];this[_0x6304('0x23')]=_0x4eac89[_0x6304('0x23')];this['reason']=_0x4eac89['reason'];this['callback']=_0x4b7c33[_0x6304('0x24')];this[_0x6304('0x25')]=_0x4b7c33[_0x6304('0x25')];this[_0x6304('0x26')]=_0x4b7c33['callbackat'];this['recallme']=_0x4b7c33['recallme'];this[_0x6304('0x27')]=_0x4b7c33[_0x6304('0x27')];this['ListId']=_0x4b7c33[_0x6304('0x28')];this[_0x6304('0x29')]=_0x4b7c33[_0x6304('0x29')];this[_0x6304('0x2a')]=_0x4b7c33[_0x6304('0x2a')];this['CampaignId']=_0x4b7c33[_0x6304('0x2b')];this[_0x6304('0x2c')]=_0x4b7c33[_0x6304('0x2c')]||'';this[_0x6304('0x2d')]=_0x4b7c33[_0x6304('0x2d')]||'';}module[_0x6304('0x2e')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index a9d34f3..46d628f 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 _0xa172=['countagentrejectretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry'];(function(_0xcff9d7,_0x51f4cb){var _0x3c775b=function(_0x11301b){while(--_0x11301b){_0xcff9d7['push'](_0xcff9d7['shift']());}};_0x3c775b(++_0x51f4cb);}(_0xa172,0x1c2));var _0x2a17=function(_0x31a598,_0x170b31){_0x31a598=_0x31a598-0x0;var _0x52cda5=_0xa172[_0x31a598];return _0x52cda5;};'use strict';var util=require(_0x2a17('0x0'));var _=require(_0x2a17('0x1'));var moment=require(_0x2a17('0x2'));function getSeconds(_0x28538,_0x2767e1){var _0x9a5263=moment(_0x28538)[_0x2a17('0x3')](0x0);var _0xa4749f=moment(_0x2767e1)['milliseconds'](0x0);return _0x9a5263[_0x2a17('0x4')](_0xa4749f,_0x2a17('0x5'));}function Final(_0x481abe){this[_0x2a17('0x6')]=_0x481abe['uniqueid'];this[_0x2a17('0x7')]=_0x481abe['scheduledat'];this[_0x2a17('0x8')]=_0x481abe[_0x2a17('0x8')];this[_0x2a17('0x9')]=_0x481abe[_0x2a17('0x8')]===_0x2a17('0xa')?_0x2a17('0xb'):_0x481abe['type'];this['countbusyretry']=_0x481abe['countbusyretry'];this[_0x2a17('0xc')]=_0x481abe['countcongestionretry'];this[_0x2a17('0xd')]=_0x481abe[_0x2a17('0xd')];this[_0x2a17('0xe')]=_0x481abe['countbusyretry']+_0x481abe['countcongestionretry']+_0x481abe[_0x2a17('0xd')]+_0x481abe[_0x2a17('0xf')]+_0x481abe[_0x2a17('0x10')]+_0x481abe[_0x2a17('0x11')]+_0x481abe['countmachineretry']+_0x481abe[_0x2a17('0x12')];this['countnosuchnumberretry']=_0x481abe[_0x2a17('0xf')];this[_0x2a17('0x10')]=_0x481abe[_0x2a17('0x10')];this['countabandonedretry']=_0x481abe[_0x2a17('0x11')];this[_0x2a17('0x13')]=_0x481abe['countmachineretry'];this[_0x2a17('0x12')]=_0x481abe[_0x2a17('0x12')];this[_0x2a17('0xb')]=_0x481abe['queue'];this['calleridname']=_0x481abe[_0x2a17('0x14')];this[_0x2a17('0x15')]=_0x481abe[_0x2a17('0x15')];this[_0x2a17('0x16')]=_0x481abe[_0x2a17('0x16')];this[_0x2a17('0x17')]=_0x481abe[_0x2a17('0x17')];this[_0x2a17('0x18')]=_0x481abe[_0x2a17('0x17')];this['ringtime']=_0x481abe[_0x2a17('0x19')]||0x0;this[_0x2a17('0x1a')]=_0x481abe[_0x2a17('0x1a')]||0x0;this[_0x2a17('0x1b')]=_0x481abe['talktime']||0x0;this['callback']=_0x481abe['callback'];this[_0x2a17('0x1c')]=_0x481abe['callbackuniqueid'];this[_0x2a17('0x1d')]=_0x481abe[_0x2a17('0x1d')];this[_0x2a17('0x1e')]=_0x481abe['recallme'];this[_0x2a17('0x1f')]=_0x481abe['ContactId'];this[_0x2a17('0x20')]=_0x481abe[_0x2a17('0x20')];this[_0x2a17('0x21')]=_0x481abe[_0x2a17('0x21')];this[_0x2a17('0x22')]=_0x481abe[_0x2a17('0x22')];this[_0x2a17('0x23')]=_0x481abe[_0x2a17('0x23')];this[_0x2a17('0x24')]=_0x481abe[_0x2a17('0x24')]||'';this['originatecalleridname']=_0x481abe[_0x2a17('0x25')]||'';}module[_0x2a17('0x26')]=Final; \ No newline at end of file +var _0x544b=['util','lodash','moment','diff','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x27275c,_0xcf0aba){var _0x58e795=function(_0x2df8b4){while(--_0x2df8b4){_0x27275c['push'](_0x27275c['shift']());}};_0x58e795(++_0xcf0aba);}(_0x544b,0x118));var _0xb544=function(_0x2ba150,_0x839b3e){_0x2ba150=_0x2ba150-0x0;var _0x17227a=_0x544b[_0x2ba150];return _0x17227a;};'use strict';var util=require(_0xb544('0x0'));var _=require(_0xb544('0x1'));var moment=require(_0xb544('0x2'));function getSeconds(_0x5ec377,_0x2683a4){var _0xea6df2=moment(_0x5ec377)['milliseconds'](0x0);var _0x1c9493=moment(_0x2683a4)['milliseconds'](0x0);return _0xea6df2[_0xb544('0x3')](_0x1c9493,'seconds');}function Final(_0x3e7aef){this[_0xb544('0x4')]=_0x3e7aef[_0xb544('0x4')];this[_0xb544('0x5')]=_0x3e7aef[_0xb544('0x5')];this[_0xb544('0x6')]=_0x3e7aef[_0xb544('0x6')];this[_0xb544('0x7')]=_0x3e7aef[_0xb544('0x6')]==='outbound'?_0xb544('0x8'):_0x3e7aef[_0xb544('0x6')];this[_0xb544('0x9')]=_0x3e7aef[_0xb544('0x9')];this[_0xb544('0xa')]=_0x3e7aef[_0xb544('0xa')];this[_0xb544('0xb')]=_0x3e7aef[_0xb544('0xb')];this[_0xb544('0xc')]=_0x3e7aef[_0xb544('0x9')]+_0x3e7aef[_0xb544('0xa')]+_0x3e7aef['countnoanswerretry']+_0x3e7aef[_0xb544('0xd')]+_0x3e7aef['countdropretry']+_0x3e7aef[_0xb544('0xe')]+_0x3e7aef[_0xb544('0xf')]+_0x3e7aef[_0xb544('0x10')];this['countnosuchnumberretry']=_0x3e7aef[_0xb544('0xd')];this[_0xb544('0x11')]=_0x3e7aef[_0xb544('0x11')];this[_0xb544('0xe')]=_0x3e7aef[_0xb544('0xe')];this[_0xb544('0xf')]=_0x3e7aef[_0xb544('0xf')];this['countagentrejectretry']=_0x3e7aef[_0xb544('0x10')];this[_0xb544('0x8')]=_0x3e7aef['queue'];this['calleridname']=_0x3e7aef[_0xb544('0x12')];this[_0xb544('0x13')]=_0x3e7aef[_0xb544('0x13')];this[_0xb544('0x14')]=_0x3e7aef['starttime'];this['responsetime']=_0x3e7aef[_0xb544('0x15')];this['endtime']=_0x3e7aef[_0xb544('0x15')];this['ringtime']=_0x3e7aef[_0xb544('0x16')]||0x0;this[_0xb544('0x17')]=_0x3e7aef[_0xb544('0x17')]||0x0;this[_0xb544('0x18')]=_0x3e7aef[_0xb544('0x18')]||0x0;this[_0xb544('0x19')]=_0x3e7aef[_0xb544('0x19')];this[_0xb544('0x1a')]=_0x3e7aef[_0xb544('0x1a')];this['callbackat']=_0x3e7aef[_0xb544('0x1b')];this['recallme']=_0x3e7aef[_0xb544('0x1c')];this[_0xb544('0x1d')]=_0x3e7aef[_0xb544('0x1d')];this[_0xb544('0x1e')]=_0x3e7aef[_0xb544('0x1e')];this['UserId']=_0x3e7aef['UserId'];this['VoiceQueueId']=_0x3e7aef['VoiceQueueId'];this[_0xb544('0x1f')]=_0x3e7aef[_0xb544('0x1f')];this['originatecalleridnum']=_0x3e7aef[_0xb544('0x20')]||'';this['originatecalleridname']=_0x3e7aef[_0xb544('0x21')]||'';}module[_0xb544('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 0259a6e..9a72af2 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 _0xf275=['type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds','statedesc','scheduledat'];(function(_0x4dbdeb,_0xc140f5){var _0x27621a=function(_0x3bee83){while(--_0x3bee83){_0x4dbdeb['push'](_0x4dbdeb['shift']());}};_0x27621a(++_0xc140f5);}(_0xf275,0x134));var _0x5f27=function(_0x375476,_0x381674){_0x375476=_0x375476-0x0;var _0x5f1f4f=_0xf275[_0x375476];return _0x5f1f4f;};'use strict';var util=require(_0x5f27('0x0'));var _=require(_0x5f27('0x1'));var moment=require(_0x5f27('0x2'));function getSeconds(_0x47ed6f,_0x1bd2bb){var _0x27fd27=moment(_0x47ed6f)[_0x5f27('0x3')](0x0);var _0x8c87f3=moment(_0x1bd2bb)['milliseconds'](0x0);return _0x27fd27['diff'](_0x8c87f3,_0x5f27('0x4'));}function Hangup(_0x3c4384,_0x57a84f){this['state']=0x4;this[_0x5f27('0x5')]='Answer';this[_0x5f27('0x6')]=_0x3c4384[_0x5f27('0x6')];this[_0x5f27('0x7')]=_0x3c4384[_0x5f27('0x7')];this[_0x5f27('0x8')]=_0x3c4384[_0x5f27('0x7')]===_0x5f27('0x9')?_0x5f27('0xa'):_0x3c4384['type'];this[_0x5f27('0xb')]=_0x3c4384[_0x5f27('0xb')];this['countcongestionretry']=_0x3c4384['countcongestionretry'];this['countnoanswerretry']=_0x3c4384[_0x5f27('0xc')];this['countglobal']=_0x3c4384[_0x5f27('0xb')]+_0x3c4384[_0x5f27('0xd')]+_0x3c4384[_0x5f27('0xc')]+_0x3c4384[_0x5f27('0xe')]+_0x3c4384[_0x5f27('0xf')]+_0x3c4384['countabandonedretry']+_0x3c4384[_0x5f27('0x10')]+_0x3c4384[_0x5f27('0x11')];this[_0x5f27('0xe')]=_0x3c4384[_0x5f27('0xe')];this[_0x5f27('0xf')]=_0x3c4384['countdropretry'];this[_0x5f27('0x12')]=_0x3c4384[_0x5f27('0x12')];this[_0x5f27('0x10')]=_0x3c4384[_0x5f27('0x10')];this[_0x5f27('0x11')]=_0x3c4384[_0x5f27('0x11')];this[_0x5f27('0x13')]=_0x57a84f['uniqueid'];this[_0x5f27('0x14')]=_0x3c4384[_0x5f27('0x15')];this[_0x5f27('0x16')]=_0x3c4384[_0x5f27('0x17')];this[_0x5f27('0x18')]=_0x3c4384['starttime'];this[_0x5f27('0x19')]=_0x3c4384[_0x5f27('0x19')];this[_0x5f27('0x1a')]=moment()[_0x5f27('0x1b')](_0x5f27('0x1c'));this[_0x5f27('0x1d')]=getSeconds(_0x3c4384['responsetime'],_0x3c4384[_0x5f27('0x18')]);this[_0x5f27('0x1e')]=0x0;this[_0x5f27('0x1f')]=getSeconds(this['endtime'],_0x3c4384['responsetime']);this['queue']=_0x3c4384[_0x5f27('0xa')];this[_0x5f27('0x20')]=_0x5f27('0x21');this[_0x5f27('0x22')]=_0x57a84f['cause-txt'];this[_0x5f27('0x23')]=_0x3c4384[_0x5f27('0x23')];this[_0x5f27('0x24')]=_0x3c4384['callbackuniqueid'];this[_0x5f27('0x25')]=_0x3c4384['callbackat'];this[_0x5f27('0x26')]=_0x3c4384['recallme'];this[_0x5f27('0x27')]=_0x3c4384[_0x5f27('0x27')];this[_0x5f27('0x28')]=_0x3c4384['ListId'];this[_0x5f27('0x29')]=_0x3c4384[_0x5f27('0x29')];this[_0x5f27('0x2a')]=_0x3c4384[_0x5f27('0x2a')];this[_0x5f27('0x2b')]=_0x3c4384[_0x5f27('0x2b')];}module[_0x5f27('0x2c')]=Hangup; \ No newline at end of file +var _0x2407=['responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countdropretry','countabandonedretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime'];(function(_0x1720fa,_0xa61b09){var _0x3ed31a=function(_0x4a5f51){while(--_0x4a5f51){_0x1720fa['push'](_0x1720fa['shift']());}};_0x3ed31a(++_0xa61b09);}(_0x2407,0xcc));var _0x7240=function(_0x101094,_0x5d3900){_0x101094=_0x101094-0x0;var _0x3d6d75=_0x2407[_0x101094];return _0x3d6d75;};'use strict';var util=require(_0x7240('0x0'));var _=require('lodash');var moment=require(_0x7240('0x1'));function getSeconds(_0x43088b,_0x2fe852){var _0x3c06cd=moment(_0x43088b)[_0x7240('0x2')](0x0);var _0x4a7b48=moment(_0x2fe852)[_0x7240('0x2')](0x0);return _0x3c06cd[_0x7240('0x3')](_0x4a7b48,'seconds');}function Hangup(_0x420ec2,_0x20f957){this[_0x7240('0x4')]=0x4;this[_0x7240('0x5')]=_0x7240('0x6');this['scheduledat']=_0x420ec2[_0x7240('0x7')];this['type']=_0x420ec2[_0x7240('0x8')];this[_0x7240('0x9')]=_0x420ec2['type']===_0x7240('0xa')?_0x7240('0xb'):_0x420ec2[_0x7240('0x8')];this['countbusyretry']=_0x420ec2[_0x7240('0xc')];this[_0x7240('0xd')]=_0x420ec2['countcongestionretry'];this[_0x7240('0xe')]=_0x420ec2[_0x7240('0xe')];this[_0x7240('0xf')]=_0x420ec2[_0x7240('0xc')]+_0x420ec2[_0x7240('0xd')]+_0x420ec2['countnoanswerretry']+_0x420ec2[_0x7240('0x10')]+_0x420ec2['countdropretry']+_0x420ec2['countabandonedretry']+_0x420ec2[_0x7240('0x11')]+_0x420ec2['countagentrejectretry'];this[_0x7240('0x10')]=_0x420ec2[_0x7240('0x10')];this[_0x7240('0x12')]=_0x420ec2[_0x7240('0x12')];this[_0x7240('0x13')]=_0x420ec2['countabandonedretry'];this[_0x7240('0x11')]=_0x420ec2[_0x7240('0x11')];this[_0x7240('0x14')]=_0x420ec2[_0x7240('0x14')];this[_0x7240('0x15')]=_0x20f957[_0x7240('0x15')];this['calleridname']=_0x420ec2[_0x7240('0x16')];this[_0x7240('0x17')]=_0x420ec2[_0x7240('0x18')];this[_0x7240('0x19')]=_0x420ec2[_0x7240('0x19')];this[_0x7240('0x1a')]=_0x420ec2[_0x7240('0x1a')];this[_0x7240('0x1b')]=moment()[_0x7240('0x1c')](_0x7240('0x1d'));this[_0x7240('0x1e')]=getSeconds(_0x420ec2[_0x7240('0x1a')],_0x420ec2[_0x7240('0x19')]);this[_0x7240('0x1f')]=0x0;this[_0x7240('0x20')]=getSeconds(this[_0x7240('0x1b')],_0x420ec2['responsetime']);this[_0x7240('0xb')]=_0x420ec2[_0x7240('0xb')];this[_0x7240('0x21')]=_0x7240('0x22');this['reason']=_0x20f957[_0x7240('0x23')];this['callback']=_0x420ec2[_0x7240('0x24')];this[_0x7240('0x25')]=_0x420ec2[_0x7240('0x25')];this[_0x7240('0x26')]=_0x420ec2['callbackat'];this['recallme']=_0x420ec2[_0x7240('0x27')];this['ContactId']=_0x420ec2[_0x7240('0x28')];this['ListId']=_0x420ec2[_0x7240('0x29')];this[_0x7240('0x2a')]=_0x420ec2[_0x7240('0x2a')];this['VoiceQueueId']=_0x420ec2[_0x7240('0x2b')];this[_0x7240('0x2c')]=_0x420ec2['CampaignId'];}module[_0x7240('0x2d')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 6ae7a5b..1ecab66 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 _0x54b5=['uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds'];(function(_0x48c7bf,_0x4aed84){var _0x87c839=function(_0x2bfb68){while(--_0x2bfb68){_0x48c7bf['push'](_0x48c7bf['shift']());}};_0x87c839(++_0x4aed84);}(_0x54b5,0x13b));var _0x554b=function(_0x506df8,_0x3498da){_0x506df8=_0x506df8-0x0;var _0x54aa08=_0x54b5[_0x506df8];return _0x54aa08;};'use strict';var util=require('util');var _=require(_0x554b('0x0'));var moment=require(_0x554b('0x1'));function getSeconds(_0x3afee9,_0xd605b9){var _0x466ab2=moment(_0x3afee9)['milliseconds'](0x0);var _0x1d6ec=moment(_0xd605b9)[_0x554b('0x2')](0x0);return _0x466ab2[_0x554b('0x3')](_0x1d6ec,_0x554b('0x4'));}function History(_0x163914){this[_0x554b('0x5')]=_0x163914['uniqueid'];this[_0x554b('0x6')]=_0x163914['scheduledat']||undefined;this[_0x554b('0x7')]=_0x163914['type'];this[_0x554b('0x8')]=_0x163914['type']===_0x554b('0x9')?'queue':_0x163914[_0x554b('0x7')];this[_0x554b('0xa')]=_0x163914[_0x554b('0xa')];this[_0x554b('0xb')]=_0x163914[_0x554b('0xb')];this['countnoanswerretry']=_0x163914[_0x554b('0xc')];this[_0x554b('0xd')]=_0x163914[_0x554b('0xa')]+_0x163914[_0x554b('0xb')]+_0x163914[_0x554b('0xc')]+_0x163914[_0x554b('0xe')]+_0x163914[_0x554b('0xf')]+_0x163914[_0x554b('0x10')]+_0x163914[_0x554b('0x11')]+_0x163914[_0x554b('0x12')];this['countnosuchnumberretry']=_0x163914['countnosuchnumberretry'];this[_0x554b('0xf')]=_0x163914['countdropretry'];this['countabandonedretry']=_0x163914['countabandonedretry'];this[_0x554b('0x11')]=_0x163914[_0x554b('0x11')];this[_0x554b('0x12')]=_0x163914[_0x554b('0x12')];this[_0x554b('0x13')]=_0x163914[_0x554b('0x13')];this[_0x554b('0x14')]=_0x163914[_0x554b('0x15')];this[_0x554b('0x16')]=_0x163914[_0x554b('0x17')];this[_0x554b('0x18')]=_0x163914[_0x554b('0x18')];this[_0x554b('0x19')]=_0x163914[_0x554b('0x19')];this[_0x554b('0x1a')]=_0x163914[_0x554b('0x19')];this[_0x554b('0x1b')]=getSeconds(_0x163914[_0x554b('0x19')],_0x163914[_0x554b('0x18')]);this[_0x554b('0x1c')]=0x0;this[_0x554b('0x1d')]=0x0;this['callback']=_0x163914['callback'];this[_0x554b('0x1e')]=_0x163914['callbackuniqueid'];this[_0x554b('0x1f')]=_0x163914['callbackat'];this[_0x554b('0x20')]=_0x163914[_0x554b('0x20')];this[_0x554b('0x21')]=_0x163914[_0x554b('0x21')];this[_0x554b('0x22')]=_0x163914[_0x554b('0x22')];this['UserId']=_0x163914[_0x554b('0x23')];this[_0x554b('0x24')]=_0x163914['VoiceQueueId'];this['CampaignId']=_0x163914[_0x554b('0x25')];this['originatecalleridnum']=_0x163914['originatecalleridnum']||'';this[_0x554b('0x26')]=_0x163914[_0x554b('0x26')]||'';}module[_0x554b('0x27')]=History; \ No newline at end of file +var _0x45aa=['scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','calleridname','name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','diff','seconds','uniqueid'];(function(_0x11a45,_0x1e40c3){var _0x48d1e6=function(_0x1bd617){while(--_0x1bd617){_0x11a45['push'](_0x11a45['shift']());}};_0x48d1e6(++_0x1e40c3);}(_0x45aa,0x176));var _0xa45a=function(_0x51e2b0,_0x3ca232){_0x51e2b0=_0x51e2b0-0x0;var _0x30561d=_0x45aa[_0x51e2b0];return _0x30561d;};'use strict';var util=require('util');var _=require(_0xa45a('0x0'));var moment=require(_0xa45a('0x1'));function getSeconds(_0x17c896,_0xd4a3c3){var _0x11fee5=moment(_0x17c896)[_0xa45a('0x2')](0x0);var _0x15063d=moment(_0xd4a3c3)[_0xa45a('0x2')](0x0);return _0x11fee5[_0xa45a('0x3')](_0x15063d,_0xa45a('0x4'));}function History(_0x22c7ad){this[_0xa45a('0x5')]=_0x22c7ad[_0xa45a('0x5')];this[_0xa45a('0x6')]=_0x22c7ad[_0xa45a('0x6')]||undefined;this[_0xa45a('0x7')]=_0x22c7ad[_0xa45a('0x7')];this['campaigntype']=_0x22c7ad[_0xa45a('0x7')]===_0xa45a('0x8')?_0xa45a('0x9'):_0x22c7ad[_0xa45a('0x7')];this[_0xa45a('0xa')]=_0x22c7ad[_0xa45a('0xa')];this[_0xa45a('0xb')]=_0x22c7ad[_0xa45a('0xb')];this[_0xa45a('0xc')]=_0x22c7ad[_0xa45a('0xc')];this[_0xa45a('0xd')]=_0x22c7ad[_0xa45a('0xa')]+_0x22c7ad['countcongestionretry']+_0x22c7ad['countnoanswerretry']+_0x22c7ad[_0xa45a('0xe')]+_0x22c7ad['countdropretry']+_0x22c7ad[_0xa45a('0xf')]+_0x22c7ad['countmachineretry']+_0x22c7ad[_0xa45a('0x10')];this[_0xa45a('0xe')]=_0x22c7ad['countnosuchnumberretry'];this[_0xa45a('0x11')]=_0x22c7ad[_0xa45a('0x11')];this[_0xa45a('0xf')]=_0x22c7ad[_0xa45a('0xf')];this['countmachineretry']=_0x22c7ad['countmachineretry'];this[_0xa45a('0x10')]=_0x22c7ad['countagentrejectretry'];this[_0xa45a('0x9')]=_0x22c7ad[_0xa45a('0x9')];this[_0xa45a('0x12')]=_0x22c7ad[_0xa45a('0x13')];this[_0xa45a('0x14')]=_0x22c7ad['number'];this[_0xa45a('0x15')]=_0x22c7ad['starttime'];this[_0xa45a('0x16')]=_0x22c7ad['responsetime'];this[_0xa45a('0x17')]=_0x22c7ad[_0xa45a('0x16')];this[_0xa45a('0x18')]=getSeconds(_0x22c7ad[_0xa45a('0x16')],_0x22c7ad[_0xa45a('0x15')]);this[_0xa45a('0x19')]=0x0;this[_0xa45a('0x1a')]=0x0;this[_0xa45a('0x1b')]=_0x22c7ad['callback'];this[_0xa45a('0x1c')]=_0x22c7ad[_0xa45a('0x1c')];this[_0xa45a('0x1d')]=_0x22c7ad[_0xa45a('0x1d')];this[_0xa45a('0x1e')]=_0x22c7ad[_0xa45a('0x1e')];this[_0xa45a('0x1f')]=_0x22c7ad[_0xa45a('0x1f')];this[_0xa45a('0x20')]=_0x22c7ad[_0xa45a('0x20')];this[_0xa45a('0x21')]=_0x22c7ad[_0xa45a('0x21')];this[_0xa45a('0x22')]=_0x22c7ad['VoiceQueueId'];this[_0xa45a('0x23')]=_0x22c7ad['CampaignId'];this['originatecalleridnum']=_0x22c7ad[_0xa45a('0x24')]||'';this[_0xa45a('0x25')]=_0x22c7ad[_0xa45a('0x25')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 10d6c5c..1f8a71c 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 _0x4d13=['hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','stringify','milliseconds','diff','seconds','emit','outbound','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startProgressive','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:save','isEmpty','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','---------------------------','predictiveIntervalTotalCalls','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\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','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','starttime','prototype','clearZombieChannels','uniqueId','[uniqueid]','actions','enqueue','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','campaigns','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','voiceQueues','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','MACHINE','Machine','countglobal','amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','reason19\x20machine....','dialMachineMaxRetry','dialMachineRetryFrequency','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','outboundUnknownCallsDay','cause-txt','Unknow','syncAgentComplete','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete]','syncAgentConnect','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','TIMEOUT','agiafterat','endtime','calleridname','calleridnum','CALLEREXIT','dialAbandonedMaxRetry','Abandoned','[syncAgentComplete][createHistory][11]','channel','actionid','strategy','locked','stateinterface','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','roundrobin','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','paused','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','loopCampaigns','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','isArray','command','interval','content','true','iftime\x20%s,%s','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','loggedIn','dialTimezone','[syncCampaigns]','\x5cw{0,','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','tags','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','from-sip','[originateError]:\x20%s','[originate][error]','Error','syncOriginateResponse','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','Queue:\x20','scheduledat','Agent','voicePause','log','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','[actionOriginate]\x20','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','util','lodash','moment','md5','ioredis','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','tail','finally','sequence','preview','agents','trunks','maxNumberOriginate','startPredictive','ivrOriginated','queueBooked','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','custom:queuesummary'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4d13,0x1f1));var _0x34d1=function(_0x11077e,_0x2a9f61){_0x11077e=_0x11077e-0x0;var _0x13fa75=_0x4d13[_0x11077e];return _0x13fa75;};'use strict';var util=require(_0x34d1('0x0'));var _=require(_0x34d1('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x34d1('0x2'));var rr=require('rr');var md5=require(_0x34d1('0x3'));var Redis=require(_0x34d1('0x4'));var ut=require(_0x34d1('0x5'));var config=require(_0x34d1('0x6'));var logger=require('../../../config/logger')(_0x34d1('0x7'));var loggerBooked=require(_0x34d1('0x8'))(_0x34d1('0x9'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require('../../../config/logger')('predictiveCalls');var loggerSyncQueueSummary=require(_0x34d1('0x8'))(_0x34d1('0xa'));var ami=require(_0x34d1('0xb'));config[_0x34d1('0xc')]=_[_0x34d1('0xd')](config[_0x34d1('0xc')],{'host':_0x34d1('0xe'),'port':0x18eb});var io=require(_0x34d1('0xf'))(new Redis(config[_0x34d1('0xc')]));var cmHopper=require(_0x34d1('0x10'));var cmHopperFinal=require(_0x34d1('0x11'));var cmHopperHistory=require(_0x34d1('0x12'));var cmHopperBlack=require(_0x34d1('0x13'));var voiceQueueRt=require(_0x34d1('0x14'));var Action=require(_0x34d1('0x15'));var History=require('./history');var Final=require(_0x34d1('0x16'));var AgentComplete=require(_0x34d1('0x17'));var QueueCallerAbandon=require(_0x34d1('0x18'));var Hangup=require(_0x34d1('0x19'));var ipAgi=process[_0x34d1('0x1a')][_0x34d1('0x1b')]||_0x34d1('0x1c');var strategy={'rrmemory':_0x34d1('0x1d'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x62715b){this[_0x34d1('0x1e')]=this[_0x34d1('0x1e')]?this['tail'][_0x34d1('0x1f')](_0x62715b):_0x62715b();};function Dialer(_0x24ac34,_0x4bcfa6){this[_0x34d1('0x20')]=new Sequence();this[_0x34d1('0x21')]=_0x4bcfa6;this['voiceQueues']=_0x24ac34['voiceQueues'];this['campaigns']=_0x24ac34['campaigns'];this[_0x34d1('0x22')]=_0x24ac34['agents'];this[_0x34d1('0x23')]=_0x24ac34[_0x34d1('0x23')];this[_0x34d1('0x24')]=config[_0x34d1('0x24')]||0x2;this['channels']={};this['actions']={};this['contactsId']={};this['uniqueId']={};this['optionPredictive']={};this[_0x34d1('0x25')]={};this['startProgressive']={};this[_0x34d1('0x26')]={};this[_0x34d1('0x27')]={};this['queueBookedRR']={};ami['on'](_0x34d1('0x28'),this['syncAgentConnect'][_0x34d1('0x29')](this));ami['on'](_0x34d1('0x2a'),this[_0x34d1('0x2b')]['bind'](this));ami['on'](_0x34d1('0x2c'),this['syncOriginateResponse'][_0x34d1('0x29')](this));ami['on'](_0x34d1('0x2d'),this['syncAgentComplete'][_0x34d1('0x29')](this));ami['on'](_0x34d1('0x2e'),this[_0x34d1('0xa')][_0x34d1('0x29')](this));ami['on'](_0x34d1('0x2f'),this[_0x34d1('0x30')]['bind'](this));ami['on'](_0x34d1('0x31'),this[_0x34d1('0x32')][_0x34d1('0x29')](this));ami['on'](_0x34d1('0x33'),this[_0x34d1('0x34')]['bind'](this));ami['on']('queuemember',this[_0x34d1('0x35')][_0x34d1('0x29')](this));ami['on'](_0x34d1('0x36'),this['syncQueueStatusComplete'][_0x34d1('0x29')](this));this['loopCampaigns']();this[_0x34d1('0x37')]();}function isNotNull(_0x431425){return _0x431425!==null&&!_[_0x34d1('0x38')](_0x431425);}function checkIsLoggedIn(_0x4fa53d,_0x38da02){return function(){if(_0x38da02<=0x0){_0x4fa53d[_0x34d1('0x39')]=_0x34d1('0x3a');throw _0x4fa53d['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x144b3a){return _0x144b3a;}function checkIsActive(_0x34d0b4,_0x1bfee4){return function(){if(!isActive(_0x1bfee4)){_0x34d0b4[_0x34d1('0x39')]=_0x34d1('0x3b');throw _0x34d0b4[_0x34d1('0x3c')]+_0x34d1('0x3d');}};}function checkInterval(_0x292403){return function(){if(!isNotNull(_0x292403[_0x34d1('0x3e')])){_0x292403['message']=_0x34d1('0x3f');throw _0x292403['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x292403[_0x34d1('0x3e')]['Intervals'])){_0x292403['message']=_0x34d1('0x3f');throw _0x292403[_0x34d1('0x3c')]+_0x34d1('0x40');}if(!isNotNull(_['isEmpty'](_0x292403[_0x34d1('0x3e')][_0x34d1('0x41')]))){_0x292403[_0x34d1('0x39')]=_0x34d1('0x3f');throw _0x292403[_0x34d1('0x3c')]+_0x34d1('0x40');}};}function msgResponse(_0x50caf8,_0x3f1367,_0x300d1f){return{'action':_0x50caf8,'response':_0x3f1367,'message':_0x300d1f,'stack':_0x300d1f};}function myreject(_0x58c4a3){return function(_0x334c42){return _0x58c4a3(msgResponse(_0x34d1('0x42'),'Error',JSON[_0x34d1('0x43')](_0x334c42)));};}function getSeconds(_0x4c1b99,_0x2915d9){var _0x3fde09=moment(_0x4c1b99)[_0x34d1('0x44')](0x0);var _0xb1e53b=moment(_0x2915d9)['milliseconds'](0x0);return _0x3fde09[_0x34d1('0x45')](_0xb1e53b,_0x34d1('0x46'));}function emit(_0x1f5bd9,_0x22d7f6,_0x58c852){io['to'](_0x1f5bd9)[_0x34d1('0x47')](_0x22d7f6,_0x58c852);}function emitVoiceQueueSummary(_0x40713e){if(_0x40713e['type']===_0x34d1('0x48')){var _0x2922af={'id':_0x40713e['id'],'name':_0x40713e['name'],'strategy':_0x40713e['strategy'],'answered':_0x40713e[_0x34d1('0x49')],'available':_0x40713e[_0x34d1('0x4a')],'loggedIn':_0x40713e['loggedIn'],'pTalking':_0x40713e[_0x34d1('0x4b')],'sumBillable':_0x40713e[_0x34d1('0x4c')],'sumDuration':_0x40713e[_0x34d1('0x4d')],'sumHoldTime':_0x40713e[_0x34d1('0x4e')]||0x0,'talking':_0x40713e[_0x34d1('0x4f')],'total':_0x40713e[_0x34d1('0x50')],'type':_0x40713e[_0x34d1('0x51')],'unmanaged':_0x40713e[_0x34d1('0x52')],'abandoned':_0x40713e[_0x34d1('0x53')],'waiting':_0x40713e[_0x34d1('0x54')],'loggedInDb':_0x40713e[_0x34d1('0x55')],'dialActive':_0x40713e[_0x34d1('0x56')],'dialMethod':_0x40713e[_0x34d1('0x57')],'dialOriginateCallerIdName':_0x40713e[_0x34d1('0x58')],'dialOriginateCallerIdNumber':_0x40713e[_0x34d1('0x59')],'dialOriginateTimeout':_0x40713e[_0x34d1('0x5a')],'dialPrefix':_0x40713e[_0x34d1('0x5b')],'outboundAnswerAgiCallsDay':_0x40713e[_0x34d1('0x5c')],'outboundAnswerCallsDay':_0x40713e[_0x34d1('0x5d')],'outboundBlacklistCallsDay':_0x40713e[_0x34d1('0x5e')],'outboundBusyCallsDay':_0x40713e[_0x34d1('0x5f')],'outboundCongestionCallsDay':_0x40713e[_0x34d1('0x60')],'outboundDropCallsDayACS':_0x40713e[_0x34d1('0x61')],'outboundDropCallsDayCallersExit':_0x40713e[_0x34d1('0x62')],'outboundDropCallsDayTimeout':_0x40713e[_0x34d1('0x63')],'outboundNoAnswerCallsDay':_0x40713e[_0x34d1('0x64')],'outboundNoSuchCallsDay':_0x40713e[_0x34d1('0x65')],'outboundOriginateFailureCallsDay':_0x40713e[_0x34d1('0x66')],'outboundReCallsDay':_0x40713e[_0x34d1('0x67')],'outboundRejectCallsDay':_0x40713e[_0x34d1('0x68')],'outboundUnknownCallsDay':_0x40713e['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x40713e[_0x34d1('0x69')],'predictiveIntervalAvgHoldtime':_0x40713e['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x40713e[_0x34d1('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0x40713e['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x40713e['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x40713e['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x40713e['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x40713e[_0x34d1('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x40713e[_0x34d1('0x6c')],'predictiveIntervalPauses':_0x40713e['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x40713e[_0x34d1('0x6d')],'predictiveIntervalTotalCalls':_0x40713e['predictiveIntervalTotalCalls'],'message':_0x40713e[_0x34d1('0x39')],'originated':_0x40713e[_0x34d1('0x6e')],'erlangCalls':_0x40713e[_0x34d1('0x6f')],'erlangCallToSecond':_0x40713e[_0x34d1('0x70')],'erlangAbandonmentRate':_0x40713e[_0x34d1('0x71')],'erlangBusyFactor':_0x40713e['erlangBusyFactor'],'startPredictive':_0x40713e[_0x34d1('0x25')],'startProgressive':_0x40713e[_0x34d1('0x72')]};if(_0x40713e[_0x34d1('0x73')]){_0x2922af[_0x34d1('0x73')]={'id':_0x40713e['Trunk']['id'],'name':_0x40713e[_0x34d1('0x73')]['name'],'active':_0x40713e[_0x34d1('0x73')][_0x34d1('0x74')],'callerid':_0x40713e[_0x34d1('0x73')][_0x34d1('0x75')]};}if(_0x40713e[_0x34d1('0x3e')]){_0x2922af[_0x34d1('0x3e')]={'id':_0x40713e[_0x34d1('0x3e')]['id'],'name':_0x40713e[_0x34d1('0x3e')][_0x34d1('0x3c')]};}var _0x5a6e6c=md5(JSON[_0x34d1('0x43')](_0x2922af));if(_0x40713e[_0x34d1('0x3')]!==_0x5a6e6c){_0x40713e[_0x34d1('0x3')]=_0x5a6e6c;emit(util[_0x34d1('0x76')](_0x34d1('0x77'),_0x2922af[_0x34d1('0x3c')]),_0x34d1('0x78'),_0x2922af);}}}function emitCampaignSummary(_0x3fd7f8){if(_0x3fd7f8[_0x34d1('0x51')]===_0x34d1('0x79')){emit(util['format']('campaign:ivr:%s',_0x3fd7f8[_0x34d1('0x3c')]),_0x34d1('0x7a'),_0x3fd7f8);}}function checkGetDataPredictive(_0x100e32){if(isNotNull(_0x100e32)){if(!_[_0x34d1('0x7b')](_0x100e32)){loggerPredictive[_0x34d1('0x7c')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x7d'),_0x100e32['predictiveIntervalTotalCalls']);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x7e'),_0x100e32['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x34d1('0x7f'),_0x100e32[_0x34d1('0x80')]);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x81'),_0x100e32[_0x34d1('0x82')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x100e32[_0x34d1('0x83')]);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x100e32[_0x34d1('0x6a')]);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x84'));if(_0x100e32[_0x34d1('0x85')]>0x0){if(!_[_0x34d1('0x38')](_0x100e32[_0x34d1('0x6a')])&&_0x100e32['predictiveIntervalAvgTalktime']>0x0){return!![];}else{loggerPredictive[_0x34d1('0x7c')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x34d1('0x38')](_0x100e32[_0x34d1('0x83')])&&_0x100e32['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x86'));}}else{loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x87'));}}else{loggerPredictive['info'](_0x34d1('0x88'));}}else{loggerPredictive[_0x34d1('0x7c')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0xeb1e28){return function(_0x19dc58){loggerPredictive['info'](_0x34d1('0x89'));loggerPredictive[_0x34d1('0x7c')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x19dc58['erlangCalls']);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x8a'),_0x19dc58[_0x34d1('0x70')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x19dc58[_0x34d1('0x71')]);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x8b'),_0x19dc58[_0x34d1('0x8c')]);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x8d'),_0x19dc58[_0x34d1('0x71')]);loggerPredictive['info'](_0x34d1('0x84'));_[_0x34d1('0x8e')](_0xeb1e28,_0x19dc58);};}function getDiff(_0x3d0896){var _0x5f000a=moment()['milliseconds'](0x0);var _0x4a41a9=moment(_0x3d0896)['milliseconds'](0x0);return _0x5f000a['diff'](_0x4a41a9,_0x34d1('0x46'));}function ifInterval(_0x53df17,_0x15b1c1){if(_['isUndefined'](_0x15b1c1)){return![];}if(getDiff(_0x15b1c1)<_0x53df17*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x619ece){if(isNotNull(_0x619ece)){if(!_['isUndefined'](_0x619ece[_0x34d1('0x72')])){_0x619ece[_0x34d1('0x72')]=undefined;loggerPredictive['info'](_0x619ece[_0x34d1('0x3c')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x34d1('0x38')](_0x619ece[_0x34d1('0x25')])){_0x619ece[_0x34d1('0x25')]=undefined;loggerPredictive[_0x34d1('0x7c')](_0x619ece['name'],_0x34d1('0x8f'));}if(!_[_0x34d1('0x38')](_0x619ece[_0x34d1('0x90')])){clearInterval(_0x619ece[_0x34d1('0x90')]);_0x619ece[_0x34d1('0x90')]=undefined;loggerPredictive[_0x34d1('0x7c')](_0x619ece[_0x34d1('0x3c')],_0x34d1('0x91'));}}}function erlangb(_0xc83293,_0x2cc730){if(_0x2cc730===0x0){return 0x0;}var _0x55a23f=0x1;for(var _0x40fdce=0x1;_0x40fdce<=_0x2cc730;_0x40fdce+=0x1){_0x55a23f=0x1+_0x55a23f*_0x40fdce/_0xc83293;}return 0x1/_0x55a23f;}function isVoiceQueueOutbound(_0x1cd30c){return _0x1cd30c==='outbound';}function isNotPreview(_0x1b8d0f){return _0x1b8d0f!==_0x34d1('0x21');}function isCampaignIvr(_0x32c075){return _0x32c075===_0x34d1('0x79');}function getCallerId(_0x42f8fe,_0x1d286f,_0x3911bb){if(!_[_0x34d1('0x38')](_0x3911bb)&&'string'===typeof _0x3911bb&&!_[_0x34d1('0x7b')](_0x3911bb)){if(!_[_0x34d1('0x38')](_0x1d286f)&&_0x34d1('0x92')===typeof _0x1d286f&&!_[_0x34d1('0x7b')](_0x1d286f)){return util['format'](_0x34d1('0x93'),_0x1d286f,_0x3911bb);}return util['format']('\x22%s\x22\x20<%s>',_0x3911bb,_0x3911bb);}if(!_['isUndefined'](_0x42f8fe)&&_0x34d1('0x92')===typeof _0x42f8fe&&!_[_0x34d1('0x7b')](_0x42f8fe)){return _0x42f8fe;}return _0x34d1('0x94');}function loggerCatchQueueSummary(_0x3790c2,_0x17ca5e){return function(_0x49360d){freeVariablesPredictive(_0x17ca5e);emitVoiceQueueSummary(_0x17ca5e);emitCampaignSummary(_0x17ca5e);loggerSyncQueueSummary['error'](_0x3790c2,util[_0x34d1('0x95')](_0x49360d,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x409b4b,_0x260b55){return function(_0xe90591){loggerPredictive[_0x34d1('0x96')](_0x260b55[_0x34d1('0x3c')],_0x409b4b);loggerPredictive['error'](_0xe90591[_0x34d1('0x97')]);freeVariablesPredictive(_0x260b55);};}function loggerCatch(_0x41b5cf){return function(_0x47bfbc){logger[_0x34d1('0x96')](_0x41b5cf,util[_0x34d1('0x95')](_0x47bfbc,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x32e01b){return _0x32e01b&&!_['isUndefined'](_0x32e01b)&&_0x32e01b[_0x34d1('0x98')]>0x0;}function decremetOriginate(_0x50ddb0){if(!_['isUndefined'](_0x50ddb0)&&_0x50ddb0!==null){if(_0x50ddb0[_0x34d1('0x99')](_0x34d1('0x6e'))){if(_0x50ddb0[_0x34d1('0x6e')]>0x0){_0x50ddb0[_0x34d1('0x6e')]-=0x1;}else{logger[_0x34d1('0x96')](_0x34d1('0x9a'));}}}else{logger[_0x34d1('0x96')](_0x34d1('0x9b'));}}function checkContactLowerLimitOriginate(_0x250cd5,_0x1d713d,_0x3bdca8){if(_0x1d713d>_0x3bdca8){for(var _0x9f756=0x0;_0x9f756<_0x1d713d-_0x3bdca8;_0x9f756+=0x1){decremetOriginate(_0x250cd5);}}}function loggerGetContactDialer(_0x48aab1,_0x18fa19,_0x21d5d9){return function(_0x1cd1f5){checkContactLowerLimitOriginate(_0x18fa19,_0x21d5d9,0x0);logger['error'](_0x48aab1,util[_0x34d1('0x95')](_0x1cd1f5,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x334b19){return function(_0x4e25cc){if(isNotNull(_0x4e25cc)&&isNotNull(_0x4e25cc[0x0])){if(_0x4e25cc[0x0][_0x34d1('0x9c')]>0x0){_0x334b19[_0x34d1('0x39')]=_0x34d1('0x9d');logger['info']('[getContactDialer2][ReScheduled]'+_0x334b19[_0x34d1('0x3c')],_0x4e25cc[0x0][_0x34d1('0x9c')],_0x34d1('0x9e'));}else{_0x334b19[_0x34d1('0x39')]=_0x34d1('0x9f');logger[_0x34d1('0x7c')](_0x34d1('0xa0')+_0x334b19[_0x34d1('0x3c')]);}}};}function notSendMessagesQueue(_0x12c3c7){if(_0x12c3c7[_0x34d1('0xa1')]){freeVariablesPredictive(_0x12c3c7);if(_0x12c3c7['originated']===0x0&&_0x12c3c7[_0x34d1('0x4f')]===0x0&&_0x12c3c7[_0x34d1('0x54')]===0x0&&(_0x12c3c7[_0x34d1('0x4b')]||0x0)===0x0){_0x12c3c7[_0x34d1('0xa1')]=![];_0x12c3c7[_0x34d1('0x4a')]=0x0;_0x12c3c7[_0x34d1('0x39')]=_0x34d1('0x3b');loggerSyncQueueSummary[_0x34d1('0x96')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x12c3c7[_0x34d1('0x3c')],_0x34d1('0xa2'));}else{_0x12c3c7[_0x34d1('0x39')]=_0x34d1('0xa3');loggerSyncQueueSummary['error'](_0x34d1('0xa4'),_0x12c3c7[_0x34d1('0x3c')],_0x34d1('0xa5'));}emitVoiceQueueSummary(_0x12c3c7);}}function notSendMessagesCampaign(_0x13c426){if(_0x13c426[_0x34d1('0xa1')]){if(_0x13c426['originated']===0x0){_0x13c426[_0x34d1('0xa1')]=![];_0x13c426[_0x34d1('0x39')]=_0x34d1('0x3b');loggerSyncQueueSummary[_0x34d1('0x96')](_0x34d1('0xa6'),_0x13c426[_0x34d1('0x3c')],_0x34d1('0xa2'));}else{_0x13c426[_0x34d1('0x39')]=_0x34d1('0xa3');loggerSyncQueueSummary[_0x34d1('0x96')](_0x34d1('0xa6'),_0x13c426[_0x34d1('0x3c')],_0x34d1('0xa5'));}emitCampaignSummary(_0x13c426);}}function createObjHistory(_0x5df37f,_0x3a41de,_0x39919b,_0x520294,_0x3e8173){_0x5df37f['message']=_0x39919b;var _0x54793=new Action(_0x5df37f,_0x3a41de);var _0x1b39a3=new History(_0x54793);_0x1b39a3[_0x34d1('0xa7')]=_0x520294;_0x1b39a3[_0x34d1('0xa8')]=_0x3e8173;_0x1b39a3['endtime']=_0x54793[_0x34d1('0xa9')];return _0x1b39a3;}Dialer[_0x34d1('0xaa')][_0x34d1('0x37')]=function(){var _0x54d54b=this;setInterval(function(){_0x54d54b[_0x34d1('0xab')](_0x54d54b[_0x34d1('0xac')],_0x34d1('0xad'));_0x54d54b[_0x34d1('0xab')](_0x54d54b[_0x34d1('0xae')],'[actions]');},0x32c8);};Dialer[_0x34d1('0xaa')][_0x34d1('0xab')]=function(_0x57efe5,_0x1f1b71){var _0xf6f61b=this;for(var _0xb8239e in _0x57efe5){if(_0x57efe5['hasOwnProperty'](_0xb8239e)){this[_0x34d1('0x20')][_0x34d1('0xaf')](function(){if(!_[_0x34d1('0xb0')](_0x57efe5[_0xb8239e])){return ami[_0x34d1('0xb1')]({'action':_0x34d1('0xb2'),'channel':_0x57efe5[_0xb8239e]['channel']})[_0x34d1('0xb3')](function(_0x962ca0){if(_0x962ca0[_0x34d1('0x39')]===_0x34d1('0xb4')){setTimeout(function(){if(_0x57efe5[_0xb8239e]&&_0x57efe5[_0xb8239e]['type']!==_0x34d1('0x79')){_0xf6f61b[_0x34d1('0xb5')](_0xf6f61b['voiceQueues'][_0x57efe5[_0xb8239e][_0x34d1('0xb6')]]);logger[_0x34d1('0x96')](_0x34d1('0xb7'),_0x1f1b71,_0xb8239e,_0x57efe5[_0xb8239e][_0x34d1('0xb6')]);delete _0x57efe5[_0xb8239e];}if(_0x57efe5[_0xb8239e]&&_0x57efe5[_0xb8239e][_0x34d1('0x51')]===_0x34d1('0x79')){_0xf6f61b[_0x34d1('0xb5')](_0xf6f61b[_0x34d1('0xb8')][_0x57efe5[_0xb8239e][_0x34d1('0xb6')]]);logger['error'](_0x34d1('0xb9'),_0x1f1b71,_0xb8239e,_0x57efe5[_0xb8239e][_0x34d1('0xb6')]);delete _0x57efe5[_0xb8239e];}},0x2328);}});}});}}};Dialer['prototype'][_0x34d1('0xba')]=function(_0x264923){return BPromise[_0x34d1('0xbb')]()[_0x34d1('0xbc')](cmHopper[_0x34d1('0xba')](_0x264923))['catch'](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0x34d1('0xbd')]=function(_0x523324){return BPromise[_0x34d1('0xbb')]()[_0x34d1('0xbc')](cmHopperBlack[_0x34d1('0xbd')](_0x523324))['catch'](loggerCatch(_0x34d1('0xbe')));};Dialer[_0x34d1('0xaa')]['checkIsBlackListIvr']=function(_0x4b316f){return BPromise[_0x34d1('0xbb')]()[_0x34d1('0xbc')](cmHopperBlack[_0x34d1('0xbf')](_0x4b316f))[_0x34d1('0xb3')](loggerCatch(_0x34d1('0xc0')));};Dialer[_0x34d1('0xaa')][_0x34d1('0xc1')]=function(_0x1c456e){return BPromise['resolve']()[_0x34d1('0xbc')](cmHopperHistory[_0x34d1('0xc2')](_0x1c456e))['catch'](loggerCatch(_0x34d1('0xc3')));};Dialer[_0x34d1('0xaa')][_0x34d1('0xc4')]=function(_0x249130){return BPromise[_0x34d1('0xbb')]()['then'](cmHopper[_0x34d1('0xc4')](_0x249130))[_0x34d1('0xb3')](loggerCatch(_0x34d1('0xc5')));};Dialer[_0x34d1('0xaa')]['unlockContact']=function(_0x28c122,_0x528e10,_0x1b6608){return BPromise[_0x34d1('0xbb')]()[_0x34d1('0xbc')](cmHopper['unlockContact'](_0x28c122,_0x528e10,_0x1b6608))[_0x34d1('0xb3')](loggerCatch(_0x34d1('0xc6')));};Dialer[_0x34d1('0xaa')]['getContactDialer']=function(_0x530663,_0xf91ba8,_0x3cb839,_0x34bd55){return BPromise[_0x34d1('0xbb')]()[_0x34d1('0xbc')](cmHopper[_0x34d1('0xc7')](_0x530663,_0xf91ba8,_0x3cb839,_0x34bd55))[_0x34d1('0xb3')](loggerCatch(_0x34d1('0xc8')));};Dialer[_0x34d1('0xaa')][_0x34d1('0xc9')]=function(_0xe30a4,_0x471faf,_0x283526){return BPromise['resolve']()[_0x34d1('0xbc')](cmHopper[_0x34d1('0xc9')](_0xe30a4,_0x471faf,_0x283526))['catch'](loggerCatch(_0x34d1('0xc8')));};Dialer[_0x34d1('0xaa')][_0x34d1('0xca')]=function(_0xdbe11c){return BPromise[_0x34d1('0xbb')]()[_0x34d1('0xbc')](voiceQueueRt['getVoiceQueueRtPauses'](_0xdbe11c))[_0x34d1('0xb3')](loggerCatch(_0x34d1('0xcb')));};Dialer[_0x34d1('0xaa')]['moveContactManagedDialer']=function(_0x5a8804){return BPromise[_0x34d1('0xbb')]()[_0x34d1('0xbc')](cmHopper[_0x34d1('0xcc')](_0x5a8804))[_0x34d1('0xb3')](loggerCatch(_0x34d1('0xcd')));};Dialer[_0x34d1('0xaa')]['createHistory']=function(_0x3090f2){return BPromise['resolve']()[_0x34d1('0xbc')](cmHopperHistory[_0x34d1('0xce')](_0x3090f2))['catch'](loggerCatch(_0x34d1('0xcf')));};Dialer['prototype'][_0x34d1('0xb5')]=function(_0x2a0975){if(!_['isUndefined'](_0x2a0975)&&_0x2a0975!==null){if(_0x2a0975[_0x34d1('0x99')](_0x34d1('0x6e'))){if(_0x2a0975[_0x34d1('0x6e')]>0x0){_0x2a0975[_0x34d1('0x6e')]-=0x1;}else{logger[_0x34d1('0x96')](_0x34d1('0xd0'));}}}else{logger[_0x34d1('0x96')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0x34d1('0xd1')]=function(_0x15bd54,_0x9d116e){var _0x4d81cb=this;return function(_0x4b6b1e){_0x4d81cb[_0x34d1('0xb5')](_0x9d116e);logger[_0x34d1('0x96')](_0x15bd54,util[_0x34d1('0x95')](_0x4b6b1e,{'showHidden':![],'depth':null}));};};Dialer[_0x34d1('0xaa')][_0x34d1('0xd2')]=function(_0x580e76,_0x3b0934,_0x9f508c){var _0x476102={'state':0x19,'statedesc':_0x34d1('0xd3')};this[_0x34d1('0xb5')](_0x3b0934);this[_0x34d1('0xd4')](_[_0x34d1('0x8e')](_0x476102,_[_0x34d1('0xd5')](_0x9f508c,[_0x34d1('0xd6'),_0x34d1('0xd7'),_0x34d1('0xd8'),_0x34d1('0xd9'),_0x34d1('0xda')])),_0x34d1('0xdb'),_0x34d1('0xdc'));logger[_0x34d1('0x96')](_0x580e76);};Dialer[_0x34d1('0xaa')][_0x34d1('0xdd')]=function(_0x4b8f95){return _0x4b8f95===_0x34d1('0xde');};Dialer[_0x34d1('0xaa')][_0x34d1('0xdf')]=function(_0x1b2040){return!_[_0x34d1('0x38')](_0x1b2040)&&_0x1b2040&&!_['isUndefined'](_0x1b2040[_0x34d1('0x3c')])&&!_['isUndefined'](_0x1b2040[_0x34d1('0x74')])&&_0x1b2040['active']&&(this[_0x34d1('0x23')][util[_0x34d1('0x76')](_0x34d1('0xe0'),_0x1b2040[_0x34d1('0x3c')])][_0x34d1('0xb2')]===_0x34d1('0xe1')||this[_0x34d1('0x23')][util[_0x34d1('0x76')](_0x34d1('0xe0'),_0x1b2040[_0x34d1('0x3c')])][_0x34d1('0xb2')]===_0x34d1('0xe2'));};Dialer[_0x34d1('0xaa')][_0x34d1('0xd4')]=function(_0x2b5b28,_0x5c8a8a,_0x24af44){this[_0x34d1('0xce')](_0x2b5b28)[_0x34d1('0xb3')](loggerCatch(_0x5c8a8a));this['moveContactManagedDialer'](_0x2b5b28)[_0x34d1('0xb3')](loggerCatch(_0x24af44));};Dialer[_0x34d1('0xaa')][_0x34d1('0x34')]=function(_0x4d1fdb){var _0x173b9f=this[_0x34d1('0xac')][_0x4d1fdb[_0x34d1('0xe3')]];var _0x341f6a;if(!_[_0x34d1('0xb0')](_0x4d1fdb)&&!_[_0x34d1('0xb0')](_0x4d1fdb[_0x34d1('0xe4')])&&!_[_0x34d1('0xb0')](_0x4d1fdb[_0x34d1('0xe4')][_0x34d1('0xe5')])&&_0x4d1fdb[_0x34d1('0xe6')]===_0x34d1('0xe7')&&_0x173b9f){if(_0x173b9f['type']!==_0x34d1('0x79')&&this[_0x34d1('0xe8')][_0x173b9f[_0x34d1('0xb6')]][_0x34d1('0xe9')]&&_0x4d1fdb[_0x34d1('0xea')]===_0x34d1('0xeb')){delete this['uniqueId'][_0x4d1fdb[_0x34d1('0xe3')]];this['updateOriginated'](this['voiceQueues'][_0x173b9f['queue']]);this[_0x34d1('0xe8')][_0x173b9f[_0x34d1('0xb6')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x173b9f[_0x34d1('0xb6')]][_0x34d1('0x5c')]+=0x1;_0x341f6a=new Hangup(_0x173b9f,_0x4d1fdb);_0x341f6a[_0x34d1('0xa7')]=0x12;_0x341f6a['statedesc']=_0x34d1('0xec');_0x341f6a[_0x34d1('0xed')]=_0x34d1('0xee');this[_0x34d1('0xd4')](_0x341f6a,_0x34d1('0xef'),'[syncHangupInAMD]');}if(_0x173b9f[_0x34d1('0x51')]!==_0x34d1('0x79')&&this[_0x34d1('0xe8')][_0x173b9f['queue']]['dialAMDActive']&&_0x4d1fdb[_0x34d1('0xea')]===_0x34d1('0xf0')){var _0x1ab1a2=this;return new BPromise(function(_0x2e637e,_0x4f2d81){delete _0x1ab1a2[_0x34d1('0xac')][_0x4d1fdb[_0x34d1('0xe3')]];_0x1ab1a2['updateOriginated'](_0x1ab1a2[_0x34d1('0xe8')][_0x173b9f[_0x34d1('0xb6')]]);_0x1ab1a2[_0x34d1('0xe8')][_0x173b9f['queue']][_0x34d1('0x5d')]+=0x1;_0x1ab1a2[_0x34d1('0xe8')][_0x173b9f[_0x34d1('0xb6')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x7ef38f=_0x1ab1a2[_0x34d1('0xe8')][_0x173b9f[_0x34d1('0xb6')]];var _0x24656d=new Hangup(_0x173b9f,_0x4d1fdb);_0x24656d[_0x34d1('0xa7')]=0x13;_0x24656d[_0x34d1('0xa8')]=_0x34d1('0xf1');_0x24656d[_0x34d1('0xed')]=_0x34d1('0xee');_0x24656d['countmachineretry']+=0x1;_0x24656d[_0x34d1('0xf2')]+=0x1;_0x24656d[_0x34d1('0xf3')]=!![];_0x1ab1a2[_0x34d1('0xce')](_0x24656d)[_0x34d1('0xb3')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x24656d[_0x34d1('0xf4')]+_0x24656d[_0x34d1('0xf5')]+_0x24656d[_0x34d1('0xf6')]+_0x24656d[_0x34d1('0xf7')]+_0x24656d[_0x34d1('0xf8')]+_0x24656d[_0x34d1('0xf9')]+_0x24656d[_0x34d1('0xfa')]+_0x24656d[_0x34d1('0xfb')]>=_0x7ef38f[_0x34d1('0xfc')]){_0x1ab1a2[_0x34d1('0xfd')](_0x24656d,_0x2e637e,_0x4f2d81,'reason19\x20machine....');}else{if(_0x24656d[_0x34d1('0xfa')]>=_0x7ef38f['dialMachineMaxRetry']){_0x1ab1a2[_0x34d1('0xfe')](_0x24656d,_0x2e637e,_0x4f2d81,_0x34d1('0xff'));}else{_0x1ab1a2[_0x34d1('0xc4')]({'active':![],'countmachineretry':_0x24656d['countmachineretry'],'scheduledat':moment()[_0x34d1('0x100')](_0x7ef38f['dialMachineRetryFrequency'],_0x34d1('0x101'))[_0x34d1('0x76')](_0x34d1('0x102')),'ContactId':_0x24656d[_0x34d1('0xd6')],'ListId':_0x24656d[_0x34d1('0xd7')],'VoiceQueueId':_0x24656d[_0x34d1('0xd9')]||undefined,'CampaignId':_0x24656d[_0x34d1('0xda')]||undefined})['catch'](loggerCatch(_0x34d1('0x103')));_0x2e637e({'reschedule':0x1});}}});}if(_0x173b9f['type']===_0x34d1('0x79')&&this[_0x34d1('0xb8')][_0x173b9f['queue']][_0x34d1('0xe9')]&&_0x4d1fdb[_0x34d1('0xea')]===_0x34d1('0xeb')){delete this[_0x34d1('0xac')][_0x4d1fdb[_0x34d1('0xe3')]];this[_0x34d1('0xb5')](this[_0x34d1('0xb8')][_0x173b9f['queue']]);_0x341f6a=new Hangup(_0x173b9f,_0x4d1fdb);_0x341f6a[_0x34d1('0xa7')]=0x12;_0x341f6a['statedesc']=_0x34d1('0xec');_0x341f6a[_0x34d1('0xed')]=_0x34d1('0xee');this[_0x34d1('0xd4')](_0x341f6a,_0x34d1('0x104'),'[syncHangupInAMDIvr]');}if(_0x173b9f['type']===_0x34d1('0x79')&&this['campaigns'][_0x173b9f['queue']][_0x34d1('0xe9')]&&_0x4d1fdb[_0x34d1('0xea')]===_0x34d1('0xf0')){var _0x1ab1a2=this;return new BPromise(function(_0x578887,_0x25df0c){delete _0x1ab1a2[_0x34d1('0xac')][_0x4d1fdb['uniqueid']];_0x1ab1a2[_0x34d1('0xb5')](_0x1ab1a2[_0x34d1('0xb8')][_0x173b9f[_0x34d1('0xb6')]]);_0x1ab1a2[_0x34d1('0xb8')][_0x173b9f[_0x34d1('0xb6')]][_0x34d1('0x5d')]+=0x1;_0x1ab1a2[_0x34d1('0xb8')][_0x173b9f['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x29ad21=_0x1ab1a2[_0x34d1('0xb8')][_0x173b9f[_0x34d1('0xb6')]];var _0x2c0352=new Hangup(_0x173b9f,_0x4d1fdb);_0x2c0352[_0x34d1('0xa7')]=0x13;_0x2c0352[_0x34d1('0xa8')]=_0x34d1('0xf1');_0x2c0352['membername']='AMD';_0x2c0352[_0x34d1('0xfa')]+=0x1;_0x2c0352['countglobal']+=0x1;_0x2c0352[_0x34d1('0xf3')]=!![];_0x1ab1a2[_0x34d1('0xce')](_0x2c0352)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x105')));if(_0x2c0352[_0x34d1('0xf4')]+_0x2c0352[_0x34d1('0xf5')]+_0x2c0352['countnoanswerretry']+_0x2c0352[_0x34d1('0xf7')]+_0x2c0352[_0x34d1('0xf8')]+_0x2c0352['countabandonedretry']+_0x2c0352[_0x34d1('0xfa')]+_0x2c0352[_0x34d1('0xfb')]>=_0x29ad21[_0x34d1('0xfc')]){_0x1ab1a2['stateGlobal'](_0x2c0352,_0x578887,_0x25df0c,_0x34d1('0x106'));}else{if(_0x2c0352[_0x34d1('0xfa')]>=_0x29ad21[_0x34d1('0x107')]){_0x1ab1a2['createStateFinal'](_0x2c0352,_0x578887,_0x25df0c,_0x34d1('0xff'));}else{_0x1ab1a2['rescheduleContact']({'active':![],'countmachineretry':_0x2c0352[_0x34d1('0xfa')],'scheduledat':moment()[_0x34d1('0x100')](_0x29ad21[_0x34d1('0x108')],_0x34d1('0x101'))[_0x34d1('0x76')](_0x34d1('0x102')),'ContactId':_0x2c0352[_0x34d1('0xd6')],'ListId':_0x2c0352[_0x34d1('0xd7')],'VoiceQueueId':_0x2c0352['VoiceQueueId']||undefined,'CampaignId':_0x2c0352[_0x34d1('0xda')]||undefined})['catch'](loggerCatch(_0x34d1('0x103')));_0x578887({'reschedule':0x1});}}});}}};Dialer[_0x34d1('0xaa')][_0x34d1('0x30')]=function(_0x2ff03f){var _0x203aac=this[_0x34d1('0xac')][_0x2ff03f['uniqueid']];var _0x2e4346=this;var _0x2bfc16;if(_0x203aac&&_0x203aac[_0x34d1('0x51')]==='ivr'){delete this[_0x34d1('0xac')][_0x2ff03f[_0x34d1('0xe3')]];this[_0x34d1('0xb5')](this[_0x34d1('0xb8')][_0x203aac['queue']]);this[_0x34d1('0xb8')][_0x203aac[_0x34d1('0xb6')]]['ivrAnswerCallsDay']+=0x1;_0x2bfc16=new Hangup(_0x203aac,_0x2ff03f);this[_0x34d1('0xce')](_0x2bfc16)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x109')));this[_0x34d1('0xcc')](_0x2bfc16)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x10a')));}if(_0x203aac&&_0x203aac[_0x34d1('0x51')]!==_0x34d1('0x79')&&isNotNull(this[_0x34d1('0xe8')][_0x203aac[_0x34d1('0xb6')]]['dialQueueProject'])){delete this[_0x34d1('0xac')][_0x2ff03f['uniqueid']];this['updateOriginated'](this[_0x34d1('0xe8')][_0x203aac[_0x34d1('0xb6')]]);this['voiceQueues'][_0x203aac[_0x34d1('0xb6')]][_0x34d1('0x5d')]+=0x1;this[_0x34d1('0xe8')][_0x203aac[_0x34d1('0xb6')]][_0x34d1('0x5c')]+=0x1;_0x2bfc16=new Hangup(_0x203aac,_0x2ff03f);_0x2bfc16[_0x34d1('0xa7')]=0x10;_0x2bfc16[_0x34d1('0xa8')]=_0x34d1('0x10b');_0x2bfc16[_0x34d1('0xed')]=_0x34d1('0x10c');this['createHistory'](_0x2bfc16)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x109')));this[_0x34d1('0xcc')](_0x2bfc16)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x10a')));}if(_0x203aac&&_0x203aac['type']!==_0x34d1('0x79')&&!isNotNull(this[_0x34d1('0xe8')][_0x203aac[_0x34d1('0xb6')]][_0x34d1('0x10d')])){delete this['uniqueId'][_0x2ff03f[_0x34d1('0xe3')]];this[_0x34d1('0xb5')](this[_0x34d1('0xe8')][_0x203aac[_0x34d1('0xb6')]]);this[_0x34d1('0xe8')][_0x203aac[_0x34d1('0xb6')]][_0x34d1('0x10e')]+=0x1;_0x2bfc16=new Hangup(_0x203aac,_0x2ff03f);_0x2bfc16['state']=0xc;_0x2bfc16[_0x34d1('0xa8')]=_0x2ff03f[_0x34d1('0x10f')];_0x2bfc16[_0x34d1('0xed')]=_0x34d1('0x110');this[_0x34d1('0xce')](_0x2bfc16)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x109')));this[_0x34d1('0xcc')](_0x2bfc16)[_0x34d1('0xb3')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0x34d1('0x111')]=function(_0x5806d9){var _0x3c9162=this[_0x34d1('0xac')][_0x5806d9[_0x34d1('0xe3')]];var _0x576367=this;if(this[_0x34d1('0xe8')][_0x5806d9[_0x34d1('0xb6')]]){if(_0x3c9162&&_0x3c9162[_0x34d1('0x51')]!=='ivr'){delete this[_0x34d1('0xac')][_0x5806d9[_0x34d1('0xe3')]];this['voiceQueues'][_0x5806d9[_0x34d1('0xb6')]]['outboundAnswerCallsDay']+=0x1;var _0x4c041e=new AgentComplete(_0x3c9162,_0x5806d9);if(_0x5806d9[_0x34d1('0x112')]===_0x34d1('0x113')){_0x4c041e['agiafterat']=this['voiceQueues'][_0x5806d9['queue']][_0x34d1('0x114')]&&this[_0x34d1('0xe8')][_0x5806d9[_0x34d1('0xb6')]][_0x34d1('0x115')]?moment()['format'](_0x34d1('0x102')):undefined;}this[_0x34d1('0xce')](_0x4c041e)[_0x34d1('0xb3')](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x4c041e)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x116')));}}};Dialer['prototype'][_0x34d1('0x117')]=function(_0x1c67d9){if(this['voiceQueues'][_0x1c67d9[_0x34d1('0xb6')]]){if(this['uniqueId'][_0x1c67d9[_0x34d1('0xe3')]]&&this[_0x34d1('0xac')][_0x1c67d9[_0x34d1('0xe3')]][_0x34d1('0x51')]!==_0x34d1('0x79')){this[_0x34d1('0xb5')](this[_0x34d1('0xe8')][_0x1c67d9[_0x34d1('0xb6')]]);this[_0x34d1('0xac')][_0x1c67d9[_0x34d1('0xe3')]]['answertime']=moment()[_0x34d1('0x76')](_0x34d1('0x102'));}}};Dialer[_0x34d1('0xaa')][_0x34d1('0x118')]=function(_0x428867){this['createHistory'](_0x428867)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x34d1('0xcc')](_0x428867)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x119')));};Dialer[_0x34d1('0xaa')][_0x34d1('0x2b')]=function(_0x4d5d66){var _0x459e6b=this[_0x34d1('0xac')][_0x4d5d66[_0x34d1('0xe3')]];var _0x1458e2=this;if(this[_0x34d1('0xe8')][_0x4d5d66[_0x34d1('0xb6')]]){if(_0x459e6b&&_0x459e6b[_0x34d1('0x51')]!==_0x34d1('0x79')){delete this[_0x34d1('0xac')][_0x4d5d66[_0x34d1('0xe3')]];this['updateOriginated'](this[_0x34d1('0xe8')][_0x4d5d66[_0x34d1('0xb6')]]);_0x459e6b[_0x34d1('0x11a')]=moment()[_0x34d1('0x76')](_0x34d1('0x102'));var _0x2c845f=new QueueCallerAbandon(_0x459e6b,_0x4d5d66);if(getSeconds(_0x459e6b['droptime'],_0x459e6b[_0x34d1('0x11b')])>=_0x459e6b['dialQueueTimeout']){this[_0x34d1('0xe8')][_0x4d5d66['queue']][_0x34d1('0x80')]+=0x1;this[_0x34d1('0xe8')][_0x4d5d66['queue']][_0x34d1('0x63')]+=0x1;this['voiceQueues'][_0x4d5d66[_0x34d1('0xb6')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x2c845f[_0x34d1('0xa7')]=0xa;_0x2c845f[_0x34d1('0xa8')]=_0x34d1('0x11c');_0x2c845f[_0x34d1('0x11d')]=_0x34d1('0x11e');_0x2c845f[_0x34d1('0x11f')]=this[_0x34d1('0xe8')][_0x4d5d66[_0x34d1('0xb6')]]['dialQueueProject2']?moment()[_0x34d1('0x76')](_0x34d1('0x102')):undefined;_0x2c845f[_0x34d1('0xf8')]+=0x1;_0x2c845f[_0x34d1('0xf2')]+=0x1;if(_0x2c845f[_0x34d1('0xf8')]>=this[_0x34d1('0xe8')][_0x4d5d66[_0x34d1('0xb6')]]['dialDropMaxRetry']){this['queueCallerAbandonCreateState'](_0x2c845f);}else{this[_0x34d1('0xc4')]({'active':![],'countdropretry':_0x2c845f[_0x34d1('0xf8')],'scheduledat':moment()[_0x34d1('0x100')](this['voiceQueues'][_0x4d5d66[_0x34d1('0xb6')]]['dialDropRetryFrequency'],_0x34d1('0x101'))[_0x34d1('0x76')](_0x34d1('0x102')),'ContactId':_0x459e6b['ContactId'],'ListId':_0x459e6b[_0x34d1('0xd7')],'VoiceQueueId':_0x459e6b[_0x34d1('0xd9')]||undefined,'CampaignId':_0x459e6b['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));var _0x29b58e=new History(_0x2c845f);_0x29b58e['state']=0xa;_0x29b58e[_0x34d1('0xa8')]=_0x34d1('0x11c');_0x29b58e[_0x34d1('0xa9')]=moment()[_0x34d1('0x76')](_0x34d1('0x102'));_0x29b58e[_0x34d1('0x120')]=_0x29b58e['starttime'];_0x29b58e[_0x34d1('0x121')]=_0x2c845f[_0x34d1('0x121')];_0x29b58e['calleridnum']=_0x2c845f[_0x34d1('0x122')];this[_0x34d1('0xce')](_0x29b58e)[_0x34d1('0xb3')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x34d1('0xe8')][_0x4d5d66[_0x34d1('0xb6')]][_0x34d1('0x82')]+=0x1;this[_0x34d1('0xe8')][_0x4d5d66['queue']][_0x34d1('0x62')]+=0x1;_0x2c845f[_0x34d1('0xa7')]=0xb;_0x2c845f[_0x34d1('0xa8')]='Abandoned';_0x2c845f[_0x34d1('0x11d')]=_0x34d1('0x123');_0x2c845f[_0x34d1('0xf9')]+=0x1;_0x2c845f[_0x34d1('0xf2')]+=0x1;if(_0x2c845f[_0x34d1('0xf9')]>=this['voiceQueues'][_0x4d5d66[_0x34d1('0xb6')]][_0x34d1('0x124')]){this[_0x34d1('0x118')](_0x2c845f);}else{this[_0x34d1('0xc4')]({'active':![],'countabandonedretry':_0x2c845f[_0x34d1('0xf9')],'scheduledat':moment()[_0x34d1('0x100')](this[_0x34d1('0xe8')][_0x4d5d66[_0x34d1('0xb6')]]['dialAbandonedRetryFrequency'],'minutes')[_0x34d1('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x459e6b[_0x34d1('0xd6')],'ListId':_0x459e6b[_0x34d1('0xd7')],'VoiceQueueId':_0x459e6b[_0x34d1('0xd9')]||undefined,'CampaignId':_0x459e6b[_0x34d1('0xda')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));var _0x29b58e=new History(_0x2c845f);_0x29b58e['state']=0xb;_0x29b58e['statedesc']=_0x34d1('0x125');_0x29b58e['starttime']=moment()[_0x34d1('0x76')](_0x34d1('0x102'));_0x29b58e[_0x34d1('0x120')]=_0x29b58e[_0x34d1('0xa9')];_0x29b58e[_0x34d1('0x121')]=_0x2c845f['calleridname'];_0x29b58e[_0x34d1('0x122')]=_0x2c845f['calleridnum'];this['createHistory'](_0x29b58e)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x126')));}}}}};Dialer[_0x34d1('0xaa')]['syncNewExten']=function(_0x201b57){if(this['actions'][_0x201b57['uniqueid']]){this[_0x34d1('0xae')][_0x201b57[_0x34d1('0xe3')]][_0x34d1('0x127')]=_0x201b57[_0x34d1('0x127')];}if(this[_0x34d1('0xac')][_0x201b57[_0x34d1('0xe3')]]){this[_0x34d1('0xac')][_0x201b57[_0x34d1('0xe3')]]['channel']=_0x201b57[_0x34d1('0x127')];}};Dialer[_0x34d1('0xaa')][_0x34d1('0x35')]=function(_0x27d351){if(strategy[this[_0x34d1('0xe8')][this[_0x34d1('0xae')][_0x27d351[_0x34d1('0x128')]][_0x34d1('0xb6')]][_0x34d1('0x129')]]==='roundrobin'){if(this[_0x34d1('0xae')][_0x27d351['actionid']]&&_[_0x34d1('0xb0')](this[_0x34d1('0xae')][_0x27d351[_0x34d1('0x128')]][_0x34d1('0x12a')])&&_0x27d351[_0x34d1('0xb2')]==='1'&&_0x27d351['paused']==='0'){if(this['agents'][_0x27d351['stateinterface']]){if(!this[_0x34d1('0x22')][_0x27d351[_0x34d1('0x12b')]][_0x34d1('0x12a')]){this[_0x34d1('0x22')][_0x27d351['stateinterface']]['locked']=!![];this[_0x34d1('0xae')][_0x27d351[_0x34d1('0x128')]][_0x34d1('0x12a')]=!![];this[_0x34d1('0xae')][_0x27d351['actionid']][_0x34d1('0x12b')]=_0x27d351[_0x34d1('0x12b')];}}}}else if((strategy[this[_0x34d1('0xe8')][this[_0x34d1('0xae')][_0x27d351[_0x34d1('0x128')]][_0x34d1('0xb6')]]['strategy']]||_0x34d1('0x1d'))===_0x34d1('0x1d')){if(this['actions'][_0x27d351['actionid']]){if(this[_0x34d1('0x22')][_0x27d351[_0x34d1('0x12b')]]){this[_0x34d1('0xae')][_0x27d351[_0x34d1('0x128')]][_0x34d1('0x12b')]=_0x27d351['stateinterface'];if(_[_0x34d1('0xb0')](this[_0x34d1('0x27')][this[_0x34d1('0xae')][_0x27d351[_0x34d1('0x128')]][_0x34d1('0xb6')]])){this[_0x34d1('0x27')][this[_0x34d1('0xae')][_0x27d351[_0x34d1('0x128')]][_0x34d1('0xb6')]]=[];}this[_0x34d1('0x27')][this[_0x34d1('0xae')][_0x27d351[_0x34d1('0x128')]]['queue']][_0x34d1('0x12c')](_[_0x34d1('0x8e')](_[_0x34d1('0xd5')](this['actions'][_0x27d351['actionid']],['idHopper',_0x34d1('0x12b')]),{'status':_0x27d351[_0x34d1('0xb2')],'paused':_0x27d351['paused']}));}}}};function unlockQueueStatus(_0x5a9fc5,_0x5add89){setTimeout(function(){if(_[_0x34d1('0x38')](_0x5a9fc5[_0x34d1('0x12d')])){loggerBooked[_0x34d1('0x96')](_0x34d1('0x12e'),_0x5add89);}_0x5a9fc5[_0x34d1('0x12d')]=!![];loggerBooked[_0x34d1('0x7c')](_0x34d1('0x12f'),_0x5add89,JSON[_0x34d1('0x43')](_['pick'](_0x5a9fc5,[_0x34d1('0x3c'),_0x34d1('0x12d')])));},0x1f3);}Dialer[_0x34d1('0xaa')][_0x34d1('0x130')]=function(_0x4de465){var _0x321a95=this;var _0x3559a1=_0x321a95[_0x34d1('0xe8')][_0x321a95[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]]['queue']];if(strategy[this[_0x34d1('0xe8')][this[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]]['queue']][_0x34d1('0x129')]]===_0x34d1('0x131')){if(this['actions'][_0x4de465['actionid']]&&this[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]]['stateinterface']){this[_0x34d1('0x21')][_0x34d1('0x132')](this[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]][_0x34d1('0x133')],this[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]][_0x34d1('0x12b')])[_0x34d1('0xb3')](function(_0x53d8e8){logger['error'](_0x34d1('0x134'),util[_0x34d1('0x95')](_0x53d8e8,{'showHidden':![],'depth':null}));})[_0x34d1('0x1f')](function(){_0x321a95[_0x34d1('0xb5')](_0x321a95['voiceQueues'][_0x321a95[_0x34d1('0xae')][_0x4de465['actionid']][_0x34d1('0xb6')]]);_0x321a95[_0x34d1('0x22')][_0x321a95['actions'][_0x4de465['actionid']][_0x34d1('0x12b')]][_0x34d1('0x12a')]=![];delete _0x321a95[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]];unlockQueueStatus(_0x3559a1);});}else{this[_0x34d1('0xb5')](this['voiceQueues'][this[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]][_0x34d1('0xb6')]]);this[_0x34d1('0xc4')]({'active':![],'ContactId':this[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]][_0x34d1('0xd6')],'ListId':this[_0x34d1('0xae')][_0x4de465['actionid']][_0x34d1('0xd7')],'VoiceQueueId':this['actions'][_0x4de465[_0x34d1('0x128')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x34d1('0x135')));delete this[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]];unlockQueueStatus(_0x3559a1);}}else if((strategy[this[_0x34d1('0xe8')][this[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]][_0x34d1('0xb6')]][_0x34d1('0x129')]]||_0x34d1('0x1d'))===_0x34d1('0x1d')){var _0x280257;if(this[_0x34d1('0xae')][_0x4de465['actionid']]&&!_[_0x34d1('0x7b')](this[_0x34d1('0x27')][this[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]][_0x34d1('0xb6')]])){if(this[_0x34d1('0x136')][_0x321a95[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]]['queue']]){this[_0x34d1('0x136')][_0x321a95[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]][_0x34d1('0xb6')]]=this[_0x34d1('0x136')][this['actions'][_0x4de465['actionid']][_0x34d1('0xb6')]]?this[_0x34d1('0x136')][this[_0x34d1('0xae')][_0x4de465['actionid']]['queue']]:this[_0x34d1('0x27')][this[_0x34d1('0xae')][_0x4de465['actionid']][_0x34d1('0xb6')]]?this[_0x34d1('0x27')][this[_0x34d1('0xae')][_0x4de465['actionid']][_0x34d1('0xb6')]]['_rr']||0x0:0x0;}this[_0x34d1('0x27')][this['actions'][_0x4de465['actionid']][_0x34d1('0xb6')]][_0x34d1('0x137')]=this[_0x34d1('0x136')][this[_0x34d1('0xae')][_0x4de465[_0x34d1('0x128')]][_0x34d1('0xb6')]];for(var _0x583e03=0x0;_0x583e03=0x0?!![]:![];})[_0x34d1('0xb3')](myreject(_0x23d666)));}}else{_0x217d55[_0x34d1('0x12c')](ami[_0x34d1('0xb1')]({'action':_0x34d1('0x150'),'command':util[_0x34d1('0x76')](_0x34d1('0x154'),_0x206e35,!_[_0x34d1('0x38')](config['timezones'][_0x396d5e])?_0x396d5e:'')})['then'](function(_0x46d1e2){return _0x46d1e2[_0x34d1('0x152')][_0x34d1('0x155')]('true')>=0x0?!![]:![];})[_0x34d1('0xb3')](myreject(_0x23d666)));}BPromise[_0x34d1('0x156')](_0x217d55)[_0x34d1('0xbc')](function(_0x4fd5bf){var _0x3b90a5=_[_0x34d1('0x157')](_0x4fd5bf);if(_0x3b90a5){return _0x24012e(_0x3b90a5);}else{_0xb270da[_0x34d1('0x39')]=_0x58a137?_0x34d1('0x158'):_0x34d1('0x159');return _0x23d666(msgResponse('[ifTime][promiseAll]',_0x34d1('0x14b'),_0x34d1('0x15a')+_0x58a137+'\x20'+_0x253ace+_0x34d1('0x15b')+util[_0x34d1('0x95')](_0x206e35,{'showHidden':![],'depth':null})+_0x34d1('0x15c')+_0x396d5e));}})[_0x34d1('0xb3')](function(_0x5503be){return _0x23d666(msgResponse(_0x34d1('0x149'),_0x34d1('0x14b'),JSON[_0x34d1('0x43')](_0x5503be)));});});};Dialer[_0x34d1('0xaa')][_0x34d1('0x15d')]=function(_0x544dbe){var _0x503236=this;return function(){switch(_0x544dbe[_0x34d1('0x57')]){case _0x34d1('0x15e'):freeVariablesPredictive(_0x544dbe);_0x503236['handlePower'](_0x544dbe,0x1);break;case'power':freeVariablesPredictive(_0x544dbe);_0x503236[_0x34d1('0x15f')](_0x544dbe,_0x544dbe[_0x34d1('0x160')]);break;case _0x34d1('0x161'):_0x503236[_0x34d1('0x161')](_0x544dbe);break;case'booked':freeVariablesPredictive(_0x544dbe);_0x503236[_0x34d1('0x15f')](_0x544dbe,0x1);break;default:freeVariablesPredictive(_0x544dbe);logger['error'](_0x34d1('0x162'),_0x544dbe['name'],_0x34d1('0x163'));}};};Dialer[_0x34d1('0xaa')][_0x34d1('0x164')]=function(_0x28973f){var _0x2ff4a0=this;return function(){_0x2ff4a0[_0x34d1('0x165')](_0x28973f);};};Dialer[_0x34d1('0xaa')][_0x34d1('0xa')]=function(_0x4a844b){var _0x32551b=this;if(isNotPreview(_0x4a844b[_0x34d1('0x57')])){if(isVoiceQueueOutbound(_0x4a844b['type'])&&isActive(_0x4a844b['dialActive'])){_0x4a844b['sendMessageOneNotActive']=!![];BPromise[_0x34d1('0xbb')]()['then'](checkIsLoggedIn(_0x4a844b,_0x4a844b[_0x34d1('0x166')]))[_0x34d1('0xbc')](checkIsActive(_0x4a844b,_0x4a844b[_0x34d1('0x56')]))[_0x34d1('0xbc')](checkInterval(_0x4a844b))[_0x34d1('0xbc')](_0x32551b[_0x34d1('0x144')](_0x4a844b))[_0x34d1('0xbc')](_0x32551b[_0x34d1('0x148')](_0x4a844b['dialGlobalInterval'],_0x4a844b[_0x34d1('0x167')],_0x4a844b['name'],_0x4a844b))[_0x34d1('0xbc')](_0x32551b['checkIfTimeIntervals'](_0x4a844b[_0x34d1('0x3e')],_0x4a844b[_0x34d1('0x167')],_0x4a844b[_0x34d1('0x3c')],_0x4a844b))[_0x34d1('0xbc')](_0x32551b['checkDialMethod'](_0x4a844b))[_0x34d1('0xb3')](loggerCatchQueueSummary('[syncQueueSummary]',_0x4a844b));}else{notSendMessagesQueue(_0x4a844b);}}else{freeVariablesPredictive(_0x4a844b);}};Dialer['prototype'][_0x34d1('0x143')]=function(){var _0x158228=this;var _0x390968;for(var _0x1bc2f3 in this[_0x34d1('0xb8')]){if(this[_0x34d1('0xb8')][_0x34d1('0x99')](_0x1bc2f3)){_0x390968=this[_0x34d1('0xb8')][_0x1bc2f3];if(isCampaignIvr(_0x390968[_0x34d1('0x51')])&&isActive(_0x390968[_0x34d1('0x74')])){_0x390968[_0x34d1('0xa1')]=!![];BPromise['resolve']()[_0x34d1('0xbc')](checkIsActive(_0x390968,_0x390968['active']))[_0x34d1('0xbc')](checkInterval(_0x390968))[_0x34d1('0xbc')](_0x158228[_0x34d1('0x144')](_0x390968))[_0x34d1('0xbc')](_0x158228[_0x34d1('0x148')](_0x390968['dialGlobalInterval'],_0x390968[_0x34d1('0x167')],_0x390968[_0x34d1('0x3c')],_0x390968))[_0x34d1('0xbc')](_0x158228[_0x34d1('0x14a')](_0x390968[_0x34d1('0x3e')],_0x390968[_0x34d1('0x167')],_0x390968[_0x34d1('0x3c')],_0x390968))[_0x34d1('0xbc')](_0x158228[_0x34d1('0x164')](_0x390968))['catch'](loggerCatchQueueSummary(_0x34d1('0x168'),_0x390968));}else{notSendMessagesCampaign(_0x390968);}}}};function getCallerIdRandom(_0x34dd39,_0xe11924){var _0x5e8432,_0x2fa645,_0x4db675;if(_0xe11924<=0x0){_0xe11924=0x1;}_0x5e8432=new RegExp(_0x34d1('0x169')+_0xe11924+'}$');_0x2fa645=Math['pow'](0xa,_0xe11924-0x1);_0x4db675=Math['pow'](0xa,_0xe11924)-0x1;return util[_0x34d1('0x76')]('%s',_['replace'](_0x34dd39,_0x5e8432,_[_0x34d1('0x16a')](_0x2fa645,_0x4db675)));}function extractCalleridName(_0x24571a){var _0x160da9=_0x24571a[_0x34d1('0x16b')](/"(.*?)"/);return _0x160da9?_0x160da9[0x1]:_0x24571a;}function extractCalleridNumber(_0xe2d017){var _0x54e86a=_0xe2d017[_0x34d1('0x16b')](/<(.*?)>/);return _0x54e86a?_0x54e86a[0x1]:_0xe2d017;}Dialer[_0x34d1('0xaa')][_0x34d1('0x16c')]=function(_0x44dda9,_0x37503c){var _0x112769=this;var _0x33fc52=uuid['v4']();this['actions'][_0x33fc52]=new Action(_0x44dda9,_0x37503c,_0x33fc52);return new BPromise(function(_0xa46be9,_0x2401e7){if(_[_0x34d1('0x38')](_0x44dda9)&&_0x34d1('0x16d')!==typeof _0x44dda9){return _0x2401e7(msgResponse('originate','Failure',_0x34d1('0x16e')));}if(_['isUndefined'](_0x37503c[_0x34d1('0x16f')][_0x34d1('0x170')])||_0x37503c[_0x34d1('0x16f')][_0x34d1('0x170')]===null){return _0x2401e7(msgResponse(_0x34d1('0x171'),_0x34d1('0x14b'),_0x34d1('0x172')));}var _0x3e1212={'XMD-CALLERID':_0x112769[_0x34d1('0xae')][_0x33fc52][_0x34d1('0x173')](),'XMD-AGI':_0x44dda9['dialQueueProject']?util[_0x34d1('0x76')]('\x22agi://%s/square,%s\x22',ipAgi,_0x44dda9[_0x34d1('0x10d')]):'NONE','XMD-AGIAFTER':_0x44dda9[_0x34d1('0x114')]?util[_0x34d1('0x76')](_0x34d1('0x174'),ipAgi,_0x44dda9[_0x34d1('0x114')]):_0x34d1('0x175'),'XMD-QUEUE':_0x44dda9[_0x34d1('0x51')]===_0x34d1('0x48')?util[_0x34d1('0x76')](_0x34d1('0x176'),_0x44dda9[_0x34d1('0x3c')],_0x44dda9[_0x34d1('0x177')]||'',_0x44dda9[_0x34d1('0x115')]?'c':'',_0x44dda9[_0x34d1('0x178')]||0x3):_0x34d1('0x175'),'XMD-CONTACTID':_0x37503c['ContactId'],'XMD-CDRTYPE':_0x34d1('0x7'),'CALLERID(all)':_0x112769[_0x34d1('0xae')][_0x33fc52][_0x34d1('0x173')](),'XMD-AMD':_0x44dda9[_0x34d1('0xe9')]?_0x34d1('0x179'):_0x34d1('0x175'),'XMD-DESTINATION':_0x34d1('0xe7')};if(_0x44dda9[_0x34d1('0xe9')]){_0x3e1212[_0x34d1('0x17a')]=_0x44dda9[_0x34d1('0x17b')]||0x9c4;_0x3e1212[_0x34d1('0x17c')]=_0x44dda9['dialAMDGreeting']||0x5dc;_0x3e1212['XMD-AMDAFTERGREETINGSILENCE']=_0x44dda9[_0x34d1('0x17d')]||0x320;_0x3e1212[_0x34d1('0x17e')]=_0x44dda9[_0x34d1('0x17f')]||0x1388;_0x3e1212[_0x34d1('0x180')]=_0x44dda9[_0x34d1('0x181')]||0x64;_0x3e1212[_0x34d1('0x182')]=_0x44dda9[_0x34d1('0x183')]||0x32;_0x3e1212[_0x34d1('0x184')]=_0x44dda9[_0x34d1('0x185')]||0x3;_0x3e1212[_0x34d1('0x186')]=_0x44dda9[_0x34d1('0x187')]||0x100;_0x3e1212['XMD-AMDMAXIMUMWORDLENGTH']=_0x44dda9[_0x34d1('0x188')]||0x1388;}if(_0x44dda9['type']===_0x34d1('0x48')){_0x3e1212[_0x34d1('0x189')]=_0x37503c[_0x34d1('0xd9')];}else{_0x3e1212['XMD-CAMPAIGNID']=_0x37503c[_0x34d1('0xda')];}for(var _0x284fec in _0x37503c[_0x34d1('0x16f')]){if(_0x37503c[_0x34d1('0x16f')][_0x34d1('0x99')](_0x284fec)){if(isNotNull(_0x37503c['Contact'][_0x284fec])&&_0x284fec!=='id'&&_0x284fec!==_0x34d1('0x18a')&&_0x284fec!==_0x34d1('0x18b')&&_0x284fec!==_0x34d1('0x18c')){_0x3e1212[util['format'](_0x34d1('0x18d'),_0x34d1('0x18e'),_['toUpper'](_0x284fec))]=_0x37503c[_0x34d1('0x16f')][_0x284fec];}}}var _0xbc71a2=_0x112769[_0x34d1('0xdf')](_0x44dda9[_0x34d1('0x73')])?getCallerId(_0x44dda9['Trunk'][_0x34d1('0x75')],_0x44dda9['dialOriginateCallerIdName'],_0x44dda9[_0x34d1('0x18f')]>0x0?getCallerIdRandom(_0x44dda9['dialOriginateCallerIdNumber'],_0x44dda9[_0x34d1('0x18f')]):_0x44dda9['dialOriginateCallerIdNumber']):getCallerId(_[_0x34d1('0xb0')](_0x44dda9['TrunkBackup'])?_0x44dda9['Trunk'][_0x34d1('0x75')]:_0x44dda9[_0x34d1('0x145')][_0x34d1('0x75')],_0x44dda9[_0x34d1('0x58')],_0x44dda9[_0x34d1('0x18f')]>0x0?getCallerIdRandom(_0x44dda9[_0x34d1('0x59')],_0x44dda9[_0x34d1('0x18f')]):_0x44dda9[_0x34d1('0x59')]);if(_0xbc71a2){_0x3e1212[_0x34d1('0x190')]=_0x112769[_0x34d1('0xae')][_0x33fc52][_0x34d1('0x191')]=extractCalleridName(_0xbc71a2);_0x3e1212[_0x34d1('0x192')]=_0x112769[_0x34d1('0xae')][_0x33fc52][_0x34d1('0x193')]=extractCalleridNumber(_0xbc71a2);}return ami['Action']({'actionid':_0x33fc52,'action':_0x34d1('0x171'),'channel':_0x112769['isTrunkReachable'](_0x44dda9['Trunk'])?util[_0x34d1('0x76')](_0x34d1('0x194'),_0x44dda9[_0x34d1('0x73')][_0x34d1('0x3c')],isNotNull(_0x44dda9[_0x34d1('0x5b')])?_0x44dda9[_0x34d1('0x5b')][_0x34d1('0x195')]()||'':'',_0x44dda9[_0x34d1('0x196')]>0x0?_0x37503c[_0x34d1('0x16f')][_0x34d1('0x170')]['substring'](_0x44dda9[_0x34d1('0x196')]):_0x37503c[_0x34d1('0x16f')]['phone']):util[_0x34d1('0x76')](_0x34d1('0x194'),_[_0x34d1('0xb0')](_0x44dda9[_0x34d1('0x145')])?_0x44dda9[_0x34d1('0x73')][_0x34d1('0x3c')]:_0x44dda9[_0x34d1('0x145')][_0x34d1('0x3c')],isNotNull(_0x44dda9[_0x34d1('0x5b')])?_0x44dda9[_0x34d1('0x5b')][_0x34d1('0x195')]()||'':'',_0x44dda9[_0x34d1('0x196')]>0x0?_0x37503c[_0x34d1('0x16f')][_0x34d1('0x170')]['substring'](_0x44dda9[_0x34d1('0x196')]):_0x37503c['Contact'][_0x34d1('0x170')]),'callerid':_0xbc71a2,'Exten':_0x34d1('0xe7'),'Context':_0x34d1('0x197'),'Priority':'1','variable':_0x3e1212,'timeout':(_0x44dda9['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x33fc52})[_0x34d1('0xbc')](function(_0x281364){return _0xa46be9(_0x281364);})['catch'](function(_0xd794){_0x44dda9['outboundOriginateFailureCallsDay']+=0x1;var _0x4cb565=new History(_0x112769[_0x34d1('0xae')][_0x33fc52]);logger[_0x34d1('0x96')](util['format'](_0x34d1('0x198'),JSON[_0x34d1('0x43')](_0xd794)));_0x4cb565[_0x34d1('0xa7')]=0xe;_0x4cb565[_0x34d1('0xa8')]='OriginateError';_0x4cb565[_0x34d1('0xa9')]=moment()['format'](_0x34d1('0x102'));_0x4cb565[_0x34d1('0x120')]=_0x4cb565[_0x34d1('0xa9')];_0x112769['createHistory'](_0x4cb565)['catch'](loggerCatch(_0x34d1('0x199')));_0x112769[_0x34d1('0xcc')](_0x4cb565)['catch'](loggerCatch(_0x34d1('0x199')))[_0x34d1('0x1f')](function(){delete _0x112769['actions'][_0x33fc52];return _0x2401e7(msgResponse('originate',_0x34d1('0x19a'),'originate\x20action\x20Error'));});});});};Dialer[_0x34d1('0xaa')][_0x34d1('0x19b')]=function(_0x862b23){var _0x3348ae=this[_0x34d1('0xae')][_0x862b23['actionid']];var _0x388b8e=this;if(_0x3348ae){delete this[_0x34d1('0xae')][_0x862b23[_0x34d1('0x128')]];_0x3348ae[_0x34d1('0x11b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0xf24d28=_0x3348ae[_0x34d1('0x51')]===_0x34d1('0x79')?this['campaigns'][_0x3348ae[_0x34d1('0xb6')]]:this[_0x34d1('0xe8')][_0x3348ae['getQueue']()];if(!this[_0x34d1('0xdd')](_0x862b23['response'])){this[_0x34d1('0xb5')](_0xf24d28);return this['callProgressDetecting'](_0x3348ae,_0xf24d28,_0x862b23)[_0x34d1('0xbc')](function(_0x284ed6){})[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x19c')));}else{this[_0x34d1('0xac')][_0x862b23[_0x34d1('0xe3')]]=_0x3348ae;}}};Dialer[_0x34d1('0xaa')][_0x34d1('0x19d')]=function(_0x54092e,_0x577271,_0x600201){var _0xe8efb8=new History(_0x577271);if(_0xe8efb8['countbusyretry']+_0xe8efb8[_0x34d1('0xf5')]+_0xe8efb8['countnoanswerretry']+_0xe8efb8[_0x34d1('0xf7')]+_0xe8efb8[_0x34d1('0xf8')]+_0xe8efb8[_0x34d1('0xf9')]+_0xe8efb8[_0x34d1('0xfa')]+_0xe8efb8[_0x34d1('0xfb')]>=_0x600201[_0x34d1('0xfc')]-0x1){return!![];}switch(_0x54092e){case 0x3:if(_0xe8efb8[_0x34d1('0xf6')]>=_0x600201[_0x34d1('0x19e')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0xe8efb8[_0x34d1('0xf6')]+=0x1,'scheduledat':moment()['add'](_0x600201[_0x34d1('0x19f')],_0x34d1('0x101'))[_0x34d1('0x76')](_0x34d1('0x102')),'ContactId':_0xe8efb8[_0x34d1('0xd6')],'ListId':_0xe8efb8['ListId'],'VoiceQueueId':_0xe8efb8[_0x34d1('0xd9')]||undefined,'CampaignId':_0xe8efb8['CampaignId']||undefined})['catch'](loggerCatch(_0x34d1('0x1a0')));}break;case 0x5:if(_0xe8efb8[_0x34d1('0xf4')]>=_0x600201[_0x34d1('0x1a1')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0xe8efb8['countbusyretry']+=0x1,'scheduledat':moment()[_0x34d1('0x100')](_0x600201['dialBusyRetryFrequency'],_0x34d1('0x101'))[_0x34d1('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xe8efb8['ContactId'],'ListId':_0xe8efb8[_0x34d1('0xd7')],'VoiceQueueId':_0xe8efb8[_0x34d1('0xd9')]||undefined,'CampaignId':_0xe8efb8['CampaignId']||undefined})[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x1a2')));}break;case 0x8:if(_0xe8efb8[_0x34d1('0xf5')]>=_0x600201['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0x34d1('0xc4')]({'active':![],'countcongestionretry':_0xe8efb8[_0x34d1('0xf5')]+=0x1,'scheduledat':moment()[_0x34d1('0x100')](_0x600201[_0x34d1('0x1a3')],_0x34d1('0x101'))['format'](_0x34d1('0x102')),'ContactId':_0xe8efb8[_0x34d1('0xd6')],'ListId':_0xe8efb8['ListId'],'VoiceQueueId':_0xe8efb8[_0x34d1('0xd9')]||undefined,'CampaignId':_0xe8efb8[_0x34d1('0xda')]||undefined})['catch'](loggerCatch(_0x34d1('0x1a4')));}break;case 0x0:if(_0xe8efb8['countnosuchnumberretry']>=_0x600201[_0x34d1('0x1a5')]-0x1){return!![];}else{this[_0x34d1('0xc4')]({'active':![],'countnosuchnumberretry':_0xe8efb8['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x34d1('0x100')](_0x600201['dialNoSuchNumberRetryFrequency'],_0x34d1('0x101'))['format'](_0x34d1('0x102')),'ContactId':_0xe8efb8[_0x34d1('0xd6')],'ListId':_0xe8efb8['ListId'],'VoiceQueueId':_0xe8efb8[_0x34d1('0xd9')]||undefined,'CampaignId':_0xe8efb8[_0x34d1('0xda')]||undefined})[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x1a6')));}break;case 0xa:if(_0xe8efb8[_0x34d1('0xf8')]>=_0x600201[_0x34d1('0x1a7')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countdropretry':_0xe8efb8['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x600201[_0x34d1('0x1a8')],_0x34d1('0x101'))[_0x34d1('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xe8efb8['ContactId'],'ListId':_0xe8efb8[_0x34d1('0xd7')],'VoiceQueueId':_0xe8efb8[_0x34d1('0xd9')]||undefined,'CampaignId':_0xe8efb8['CampaignId']||undefined})[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x1a9')));}break;case 0xb:if(_0xe8efb8[_0x34d1('0xf9')]>=_0x600201[_0x34d1('0x124')]-0x1){return!![];}else{this[_0x34d1('0xc4')]({'active':![],'countabandonedretry':_0xe8efb8[_0x34d1('0xf9')]+=0x1,'scheduledat':moment()[_0x34d1('0x100')](_0x600201[_0x34d1('0x1aa')],_0x34d1('0x101'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xe8efb8[_0x34d1('0xd6')],'ListId':_0xe8efb8[_0x34d1('0xd7')],'VoiceQueueId':_0xe8efb8['VoiceQueueId']||undefined,'CampaignId':_0xe8efb8[_0x34d1('0xda')]||undefined})['catch'](loggerCatch(_0x34d1('0x1ab')));}break;case 0x13:if(_0xe8efb8[_0x34d1('0xfa')]>=_0x600201[_0x34d1('0x107')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countmachineretry':_0xe8efb8['countmachineretry']+=0x1,'scheduledat':moment()[_0x34d1('0x100')](_0x600201['dialMachineRetryFrequency'],_0x34d1('0x101'))[_0x34d1('0x76')](_0x34d1('0x102')),'ContactId':_0xe8efb8[_0x34d1('0xd6')],'ListId':_0xe8efb8[_0x34d1('0xd7')],'VoiceQueueId':_0xe8efb8[_0x34d1('0xd9')]||undefined,'CampaignId':_0xe8efb8[_0x34d1('0xda')]||undefined})[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x103')));}break;case 0x14:if(_0xe8efb8['countagentrejectretry']>=_0x600201['dialAgentRejectMaxRetry']-0x1){return!![];}else{this[_0x34d1('0xc4')]({'active':![],'countagentrejectretry':_0xe8efb8[_0x34d1('0xfb')]+=0x1,'scheduledat':moment()[_0x34d1('0x100')](_0x600201[_0x34d1('0x1ac')],'minutes')[_0x34d1('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xe8efb8[_0x34d1('0xd6')],'ListId':_0xe8efb8[_0x34d1('0xd7')],'VoiceQueueId':_0xe8efb8[_0x34d1('0xd9')]||undefined,'CampaignId':_0xe8efb8[_0x34d1('0xda')]||undefined})['catch'](loggerCatch(_0x34d1('0x1ad')));}break;default:return!![];}};Dialer[_0x34d1('0xaa')][_0x34d1('0x1ae')]=function(_0x3fdd2d,_0x9be0ee,_0x2f241d){var _0x39749b=this;var _0x56b72e=new History(_0x3fdd2d);return new BPromise(function(_0x48c043,_0x2f167e){if(_['isUndefined'](_0x9be0ee)&&_0x34d1('0x16d')!==typeof _0x9be0ee){return _0x2f167e(msgResponse(_0x34d1('0x1af'),'Failure','entity\x20is\x20undefine'));}if(_[_0x34d1('0x38')](_0x2f241d)&&_0x34d1('0x16d')!==typeof _0x2f241d){return _0x2f167e(msgResponse('[callProgressDetecting]',_0x34d1('0x14b'),_0x34d1('0x1b0')));}switch(_0x2f241d['reason']){case'0':_0x9be0ee[_0x34d1('0x65')]+=0x1;_0x56b72e['state']=0x0;_0x56b72e[_0x34d1('0xa8')]=_0x34d1('0x1b1');_0x56b72e[_0x34d1('0xf7')]+=0x1;_0x56b72e[_0x34d1('0xf2')]+=0x1;ami[_0x34d1('0x47')](_0x34d1('0x1b2'),ut[_0x34d1('0x1b3')](_0x3fdd2d,_0x34d1('0x1b4')));_0x39749b[_0x34d1('0xce')](_0x56b72e)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x105')));if(_0x39749b['checkRetriveMax'](0x0,_0x3fdd2d,_0x9be0ee)){if(_0x56b72e[_0x34d1('0xf7')]>=_0x9be0ee[_0x34d1('0x1a5')]){_0x39749b[_0x34d1('0xfe')](_0x56b72e,_0x48c043,_0x2f167e,'reason\x200\x20no\x20such\x20number....');}else{_0x39749b[_0x34d1('0xfd')](_0x56b72e,_0x48c043,_0x2f167e,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x9be0ee[_0x34d1('0x64')]+=0x1;_0x56b72e[_0x34d1('0xa7')]=0x3;_0x56b72e[_0x34d1('0xa8')]='NoAnswer';_0x56b72e[_0x34d1('0xf6')]+=0x1;_0x56b72e[_0x34d1('0xf2')]+=0x1;ami[_0x34d1('0x47')](_0x34d1('0x1b5'),ut['buildObj'](_0x3fdd2d,_0x34d1('0x1b6')));_0x39749b[_0x34d1('0xce')](_0x56b72e)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x1b7')));if(_0x39749b[_0x34d1('0x19d')](0x3,_0x3fdd2d,_0x9be0ee)){if(_0x56b72e[_0x34d1('0xf6')]>=_0x9be0ee['dialNoAnswerMaxRetry']){_0x39749b[_0x34d1('0xfe')](_0x56b72e,_0x48c043,_0x2f167e,'reason\x203\x20ringing\x20no\x20answer');}else{_0x39749b[_0x34d1('0xfd')](_0x56b72e,_0x48c043,_0x2f167e,_0x34d1('0x1b8'));}}break;case'5':_0x9be0ee[_0x34d1('0x5f')]+=0x1;_0x56b72e[_0x34d1('0xa7')]=0x5;_0x56b72e[_0x34d1('0xa8')]=_0x34d1('0x1b9');_0x56b72e[_0x34d1('0xf4')]+=0x1;_0x56b72e[_0x34d1('0xf2')]+=0x1;ami['emit'](_0x34d1('0x1ba'),ut[_0x34d1('0x1b3')](_0x3fdd2d,_0x34d1('0x1bb')));_0x39749b[_0x34d1('0xce')](_0x56b72e)['catch'](loggerCatch(_0x34d1('0x1bc')));if(_0x39749b['checkRetriveMax'](0x5,_0x3fdd2d,_0x9be0ee)){if(_0x56b72e[_0x34d1('0xf4')]>=_0x9be0ee[_0x34d1('0x1a1')]){_0x39749b[_0x34d1('0xfe')](_0x56b72e,_0x48c043,_0x2f167e,_0x34d1('0x1bd'));}else{_0x39749b[_0x34d1('0xfd')](_0x56b72e,_0x48c043,_0x2f167e,_0x34d1('0x1bd'));}}break;case'8':_0x9be0ee[_0x34d1('0x60')]+=0x1;_0x56b72e[_0x34d1('0xa7')]=0x8;_0x56b72e['statedesc']='Congestion';_0x56b72e[_0x34d1('0xf5')]+=0x1;_0x56b72e['countglobal']+=0x1;ami[_0x34d1('0x47')](_0x34d1('0x1be'),ut[_0x34d1('0x1b3')](_0x3fdd2d,_0x34d1('0x1bf')));_0x39749b[_0x34d1('0xce')](_0x56b72e)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x39749b[_0x34d1('0x19d')](0x8,_0x3fdd2d,_0x9be0ee)){if(_0x56b72e['countcongestionretry']>=_0x9be0ee[_0x34d1('0x1c0')]){_0x39749b[_0x34d1('0xfe')](_0x56b72e,_0x48c043,_0x2f167e,_0x34d1('0x1c1'));}else{_0x39749b[_0x34d1('0xfd')](_0x56b72e,_0x48c043,_0x2f167e,'reason\x208\x20congestion');}}break;case'11':_0x9be0ee[_0x34d1('0x1c2')]+=0x1;_0x56b72e[_0x34d1('0xa7')]=0xb;_0x56b72e['statedesc']=_0x34d1('0x125');_0x56b72e['countabandonedretry']+=0x1;_0x56b72e[_0x34d1('0xf2')]+=0x1;_0x39749b[_0x34d1('0xce')](_0x56b72e)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x126')));if(_0x39749b[_0x34d1('0x19d')](0xb,_0x3fdd2d,_0x9be0ee)){if(_0x56b72e['countabandonedretry']>=_0x9be0ee[_0x34d1('0x124')]){_0x39749b[_0x34d1('0xfe')](_0x56b72e,_0x48c043,_0x2f167e,_0x34d1('0x1c3'));}else{_0x39749b['stateGlobal'](_0x56b72e,_0x48c043,_0x2f167e,'reason\x2011\x20abandoned');}}break;case'20':_0x9be0ee[_0x34d1('0x68')]+=0x1;_0x56b72e[_0x34d1('0xa7')]=0x14;_0x56b72e[_0x34d1('0xa8')]=_0x34d1('0x1c4');_0x56b72e[_0x34d1('0xfb')]+=0x1;_0x56b72e[_0x34d1('0xf2')]+=0x1;ami['emit'](_0x34d1('0x1c5'),ut[_0x34d1('0x1b3')](_0x3fdd2d,'agentreject'));_0x39749b[_0x34d1('0xce')](_0x56b72e)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x39749b['checkRetriveMax'](0x14,_0x3fdd2d,_0x9be0ee)){if(_0x56b72e['countagentrejectretry']>=_0x9be0ee[_0x34d1('0x1c6')]){_0x39749b['createStateFinal'](_0x56b72e,_0x48c043,_0x2f167e,'reason\x2020\x20agentreject');}else{_0x39749b[_0x34d1('0xfd')](_0x56b72e,_0x48c043,_0x2f167e,_0x34d1('0x1c7'));}}break;default:_0x9be0ee['outboundUnknownCallsDay']+=0x1;_0x56b72e[_0x34d1('0xa7')]=0xc;_0x56b72e['statedesc']=_0x2f241d['reason'];_0x39749b[_0x34d1('0xce')](_0x56b72e)[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x1c8')));if(_0x39749b['checkRetriveMax'](_0x2f241d[_0x34d1('0x112')],_0x3fdd2d,_0x9be0ee)){if(_0x56b72e[_0x34d1('0xf4')]+_0x56b72e[_0x34d1('0xf5')]+_0x56b72e[_0x34d1('0xf6')]+_0x56b72e[_0x34d1('0xf7')]+_0x56b72e[_0x34d1('0xf8')]+_0x56b72e[_0x34d1('0xf9')]+_0x56b72e[_0x34d1('0xfa')]+_0x56b72e[_0x34d1('0xfb')]>=_0x9be0ee[_0x34d1('0xfc')]){_0x39749b['stateGlobal'](_0x56b72e,_0x48c043,_0x2f167e,_0x2f241d[_0x34d1('0x112')]);}else{_0x39749b[_0x34d1('0xfe')](_0x56b72e,_0x48c043,_0x2f167e,_0x2f241d[_0x34d1('0x112')]);}}}});};Dialer['prototype'][_0x34d1('0xfd')]=function(_0x50aa53,_0x3d6909,_0x1942a6,_0x56d8cc){var _0x379198=new Final(_0x50aa53);_0x379198[_0x34d1('0xa7')]=0xf;_0x379198[_0x34d1('0xa8')]=_0x34d1('0x1c9');this[_0x34d1('0xfe')](_0x379198,_0x3d6909,_0x1942a6,_0x56d8cc);};Dialer[_0x34d1('0xaa')][_0x34d1('0xfe')]=function(_0x1f211e,_0x26ffc5,_0x2f09db,_0x4711a6){this[_0x34d1('0xcc')](_0x1f211e)[_0x34d1('0xbc')](function(_0x34417f){return _0x26ffc5(msgResponse('[callProgressDetecting]','Success',_0x4711a6));})['catch'](function(_0x287b71){return _0x2f09db(msgResponse(_0x34d1('0x1ca'),_0x34d1('0x14b'),_0x34d1('0x1cb')));});};Dialer[_0x34d1('0xaa')][_0x34d1('0x161')]=function(_0x8cd1d4){var _0x39ce4c=this;var _0xeac34c=_0x8cd1d4[_0x34d1('0x1cc')]/0x64;var _0x593ca1=_0x8cd1d4[_0x34d1('0x63')]/(_0x8cd1d4['outboundDropCallsDayTimeout']+_0x8cd1d4['outboundAnswerCallsDay']);var _0x53cab3=Math[_0x34d1('0x1cd')](_0x8cd1d4[_0x34d1('0x6d')]*(_0x8cd1d4[_0x34d1('0x1ce')]/0x64));var _0xb4274d=Math[_0x34d1('0x1cd')](_0x8cd1d4[_0x34d1('0x6d')]*(_0x8cd1d4['predictiveIntervalMinThreshold']/0x64));var _0xd39ef9=_0x8cd1d4[_0x34d1('0x4a')]+_0x8cd1d4[_0x34d1('0x4f')];var _0x2612e3=Math[_0x34d1('0x1cf')](_0x8cd1d4[_0x34d1('0x6f')]*_0x8cd1d4[_0x34d1('0x71')]*_0x8cd1d4[_0x34d1('0x6b')]*_0x8cd1d4[_0x34d1('0x6c')]);if(_[_0x34d1('0x38')](_0x8cd1d4['startProgressive'])){if(!_[_0x34d1('0x38')](_0x8cd1d4[_0x34d1('0x25')])){_0x8cd1d4[_0x34d1('0x25')]=undefined;loggerPredictive[_0x34d1('0x96')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x34d1('0x38')](_0x8cd1d4[_0x34d1('0x90')])){loggerPredictive[_0x34d1('0x96')](_0x34d1('0x1d0'),_0x34d1('0x1d1'));clearInterval(_0x8cd1d4['handlePredictive']);_0x8cd1d4['handlePredictive']=undefined;}_0x8cd1d4[_0x34d1('0x72')]=moment()[_0x34d1('0x76')](_0x34d1('0x102'));loggerPredictive[_0x34d1('0x7c')](_0x8cd1d4[_0x34d1('0x3c')],'collection\x20data\x20in\x20progressive\x20at',_0x8cd1d4[_0x34d1('0x72')]);this[_0x34d1('0x15f')](_0x8cd1d4,0x1);}else if(ifInterval(_0x8cd1d4[_0x34d1('0x1d2')],_0x8cd1d4[_0x34d1('0x72')])){this[_0x34d1('0x15f')](_0x8cd1d4,0x1);loggerPredictiveCalls[_0x34d1('0x7c')](_0x34d1('0x1d3'),_0x8cd1d4[_0x34d1('0x72')],_0x8cd1d4[_0x34d1('0x3c')]);_0x8cd1d4['erlangCalls']=0x0;_0x8cd1d4[_0x34d1('0x1d4')]=0x0;}else if(_0xeac34c<_0x593ca1&&_0x8cd1d4[_0x34d1('0x1d5')]==='dropRate'){freeVariablesPredictive(_0x8cd1d4);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x1d6'),_0x34d1('0x1d7'),_0x593ca1,'startProgressive',_0x8cd1d4[_0x34d1('0x3c')]);}else if(_0x2612e3<_0x8cd1d4[_0x34d1('0x1d4')]&&_0x8cd1d4[_0x34d1('0x1d5')]===_0x34d1('0x1d8')){freeVariablesPredictive(_0x8cd1d4);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x1d9'),'Max\x20Drop\x20',_0x2612e3,_0x34d1('0x1da'),_0x8cd1d4[_0x34d1('0x1d4')],_0x34d1('0x72'),_0x8cd1d4[_0x34d1('0x3c')]);}else if(!ifInterval(_0x8cd1d4[_0x34d1('0x1d2')],_0x8cd1d4[_0x34d1('0x72')])&&_[_0x34d1('0x38')](_0x8cd1d4[_0x34d1('0x25')])&&!_[_0x34d1('0x38')](_0x8cd1d4[_0x34d1('0x72')])){_0x8cd1d4[_0x34d1('0x25')]=moment()[_0x34d1('0x76')](_0x34d1('0x102'));loggerPredictive[_0x34d1('0x7c')](_0x8cd1d4[_0x34d1('0x3c')],_0x34d1('0x1db'),_0x8cd1d4[_0x34d1('0x25')]);this[_0x34d1('0xc1')](_0x8cd1d4[_0x34d1('0x1d2')])[_0x34d1('0xbc')](this[_0x34d1('0x1dc')](_0x8cd1d4))[_0x34d1('0xbc')](mergeDataErlangB(_0x8cd1d4))[_0x34d1('0xbc')](this[_0x34d1('0x1dd')](_0x8cd1d4))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x8cd1d4));}else if(!ifInterval(_0x8cd1d4[_0x34d1('0x1d2')],_0x8cd1d4[_0x34d1('0x25')])){_0x8cd1d4[_0x34d1('0x1d4')]=0x0;_0x8cd1d4[_0x34d1('0x25')]=moment()[_0x34d1('0x76')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x34d1('0x7c')](_0x8cd1d4[_0x34d1('0x3c')],_0x34d1('0x1de'),_0x8cd1d4[_0x34d1('0x25')]);clearInterval(_0x8cd1d4[_0x34d1('0x90')]);_0x8cd1d4['handlePredictive']=undefined;this[_0x34d1('0xc1')](_0x8cd1d4[_0x34d1('0x1d2')])['then'](this[_0x34d1('0x1dc')](_0x8cd1d4))[_0x34d1('0xbc')](mergeDataErlangB(_0x8cd1d4))[_0x34d1('0xbc')](this[_0x34d1('0x1dd')](_0x8cd1d4))[_0x34d1('0xb3')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x8cd1d4));}else if(_0x8cd1d4[_0x34d1('0x6d')]&&_0xd39ef9<_0x8cd1d4[_0x34d1('0x6d')]-_0xb4274d){freeVariablesPredictive(_0x8cd1d4);loggerPredictive['info'](_0x8cd1d4[_0x34d1('0x3c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xd39ef9,_0x34d1('0x1df'),_0x8cd1d4['predictiveIntervalAvailable'],'-',_0xb4274d,'=',_0x8cd1d4[_0x34d1('0x6d')]-_0xb4274d,')');}else if(_0x8cd1d4[_0x34d1('0x6d')]&&_0xd39ef9>_0x8cd1d4['predictiveIntervalAvailable']+_0x53cab3){freeVariablesPredictive(_0x8cd1d4);loggerPredictive[_0x34d1('0x7c')](_0x8cd1d4[_0x34d1('0x3c')],_0x34d1('0x1e0'),_0xd39ef9,_0x34d1('0x1e1'),_0x8cd1d4['predictiveIntervalAvailable'],'+',_0x53cab3,'=',_0x8cd1d4[_0x34d1('0x6d')]+_0x53cab3,')');}};Dialer['prototype'][_0x34d1('0x1dc')]=function(_0x2944a5){var _0x541b77=this;return function(_0x505a65){return new BPromise(function(_0x3c9e12,_0x410ccf){_[_0x34d1('0x8e')](_0x2944a5,_0x505a65[0x0]);if(checkGetDataPredictive(_0x505a65[0x0])){var _0x951686=_0x2944a5[_0x34d1('0x6d')]=_0x2944a5[_0x34d1('0x4f')]+_0x2944a5[_0x34d1('0x4a')];var _0x1bd380=_0x2944a5[_0x34d1('0x1d2')]*0x3c;var _0x36fe89=_0x505a65[0x0][_0x34d1('0x6a')]+_0x505a65[0x0][_0x34d1('0x83')];var _0x597f84=(_0x505a65[0x0][_0x34d1('0x69')]+_0x505a65[0x0][_0x34d1('0x80')]+_0x505a65[0x0][_0x34d1('0x82')])/_0x505a65[0x0]['predictiveIntervalTotalCalls'];_0x2944a5['predictiveIntervalHitRate']=_0x597f84>0x0?_0x597f84:0x1;switch(_0x2944a5[_0x34d1('0x1d5')]){case'dropRate':var _0x4a70ea=_0x2944a5[_0x34d1('0x1cc')]/0x64;return _0x541b77['abandonmentRate'](_0x951686,_0x1bd380,_0x36fe89,_0x597f84,_0x4a70ea)[_0x34d1('0xbc')](function(_0x280726){return _0x3c9e12(_0x280726);});case _0x34d1('0x1e2'):var _0x5b617a=_0x2944a5[_0x34d1('0x1cc')]/0x64;return _0x541b77[_0x34d1('0x1e3')](_0x951686,_0x1bd380,_0x36fe89,_0x597f84,_0x5b617a)[_0x34d1('0xbc')](function(_0xaa8a3d){return _0x3c9e12(_0xaa8a3d);});default:return _0x410ccf(msgResponse(_0x34d1('0x1e4'),_0x34d1('0x14b'),'Unknown\x20Predictive'));}}else{return _0x410ccf(msgResponse(_0x34d1('0x1e4'),_0x34d1('0x14b'),_0x34d1('0x1e5')));}});};};Dialer[_0x34d1('0xaa')][_0x34d1('0x1e6')]=function(_0x18281e){var _0x515f54=this;return function(_0x506aeb){return new BPromise(function(_0x1f2457,_0x4610f7){_[_0x34d1('0x8e')](_0x18281e,_0x506aeb[0x0]);if(checkGetDataPredictive(_0x506aeb[0x0])){loggerPredictive['info'](JSON[_0x34d1('0x43')](_0x506aeb[0x0]));if(_0x18281e[_0x34d1('0x1d5')]==='dropRate'){return _0x515f54[_0x34d1('0xca')](_0x18281e['id'])[_0x34d1('0xbc')](function(_0x543e39){var _0x2498fe=_0x18281e[_0x34d1('0x166')]-_0x543e39[0x0][_0x34d1('0x1e7')];var _0x3e2fe4=_0x18281e[_0x34d1('0x1d2')]*0x3c;var _0x59a6b9=_0x506aeb[0x0]['predictiveIntervalAvgTalktime']+_0x506aeb[0x0][_0x34d1('0x83')];var _0x5645d1=(_0x506aeb[0x0][_0x34d1('0x69')]+_0x506aeb[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x506aeb[0x0][_0x34d1('0x82')])/_0x506aeb[0x0]['predictiveIntervalTotalCalls'];var _0x24e55c=_0x18281e[_0x34d1('0x1cc')]/0x64;_0x18281e[_0x34d1('0x1e8')]=_0x543e39[0x0][_0x34d1('0x1e7')]||0x0;_0x18281e['predictiveIntervalHitRate']=_0x5645d1>0x0?_0x5645d1:0x1;return _0x515f54[_0x34d1('0x1e9')](_0x2498fe,_0x3e2fe4,_0x59a6b9,_0x5645d1,_0x24e55c);})[_0x34d1('0xbc')](function(_0x378b0b){return _0x1f2457(_0x378b0b);})[_0x34d1('0xb3')](function(_0x1a42a7){return _0x4610f7(msgResponse(_0x34d1('0x1ea'),'Failure',JSON[_0x34d1('0x43')](_0x1a42a7)));});}if(_0x18281e[_0x34d1('0x1d5')]===_0x34d1('0x1e2')){return _0x515f54[_0x34d1('0xca')](_0x18281e['id'])[_0x34d1('0xbc')](function(_0x541391){var _0x386319=_0x18281e[_0x34d1('0x166')]-_0x541391[0x0][_0x34d1('0x1e7')];var _0x2f8817=_0x18281e[_0x34d1('0x1d2')]*0x3c;var _0x5a2347=_0x506aeb[0x0]['predictiveIntervalAvgTalktime']+_0x506aeb[0x0][_0x34d1('0x83')];var _0x184bbc=(_0x506aeb[0x0][_0x34d1('0x69')]+_0x506aeb[0x0][_0x34d1('0x80')]+_0x506aeb[0x0][_0x34d1('0x82')])/_0x506aeb[0x0]['predictiveIntervalTotalCalls'];var _0x43c65e=_0x18281e['dialPredictiveOptimizationPercentage']/0x64;_0x18281e[_0x34d1('0x1e8')]=_0x541391[0x0][_0x34d1('0x1e7')]||0x0;_0x18281e[_0x34d1('0x6b')]=_0x184bbc>0x0?_0x184bbc:0x1;return _0x515f54[_0x34d1('0x1e3')](_0x386319,_0x2f8817,_0x5a2347,_0x184bbc,_0x43c65e);})[_0x34d1('0xbc')](function(_0x5d88bf){return _0x1f2457(_0x5d88bf);})[_0x34d1('0xb3')](function(_0x1113d7){return _0x4610f7(msgResponse('[CatchErlangB]','Failure',JSON[_0x34d1('0x43')](_0x1113d7)));});}}else{return _0x4610f7(msgResponse(_0x34d1('0x1e4'),'Failure',_0x34d1('0x1e5')));}});};};Dialer[_0x34d1('0xaa')]['startMethodPredictive']=function(_0x564119){var _0xf7a18=this;return function(){var _0x8d4a5=0x0;var _0x1d27a5=Math[_0x34d1('0x1cf')](_0x564119[_0x34d1('0x70')]*0x3e8);if(_0x1d27a5>0x0){_0x1d27a5=_0x1d27a5<0x64?0x64:_0x1d27a5;loggerPredictive[_0x34d1('0x7c')](_0x564119[_0x34d1('0x3c')],_0x34d1('0x1eb'),_0x1d27a5,_0x34d1('0x44'));_0x564119[_0x34d1('0x90')]=setInterval(function(){_0xf7a18[_0x34d1('0x90')](_0x564119);loggerPredictiveCalls[_0x34d1('0x7c')](_0x34d1('0x1ec'),_0x8d4a5+=0x1);},_0x1d27a5);}else{loggerPredictive[_0x34d1('0x7c')](_0x564119[_0x34d1('0x3c')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x34d1('0xaa')][_0x34d1('0x1ed')]=function(_0x15178f,_0x16ca19){var _0x10cb89=this;return function(_0x1d8e7b){if(_[_0x34d1('0x7b')](_0x1d8e7b)){if(_[_0x34d1('0xb0')](_0x16ca19['UserId'])||!_0x16ca19[_0x34d1('0x1ee')]){if(_0x15178f[_0x34d1('0x57')]==='booked'){_0x15178f['queueStatusComplete']=_['isUndefined'](_0x15178f['queueStatusComplete'])?!![]:_0x15178f[_0x34d1('0x12d')];var _0x96137e=uuid['v4']();_0x10cb89['actions'][_0x96137e]=new Action(_0x15178f,_0x16ca19,_0x96137e);loggerBooked[_0x34d1('0x7c')]('[booked][checkContactBlack]',_0x96137e,'queueStatusComplete:\x20',JSON[_0x34d1('0x43')](_0x15178f['queueStatusComplete']),_0x34d1('0x1ef'),_0x15178f[_0x34d1('0x3c')]);if(_0x15178f[_0x34d1('0x12d')]){_0x15178f['queueStatusComplete']=![];_0x10cb89['queueBooked'][_0x10cb89[_0x34d1('0xae')][_0x96137e][_0x34d1('0xb6')]]=[];ami['Action']({'actionid':_0x96137e,'action':'queuestatus','queue':_0x15178f[_0x34d1('0x3c')]})['catch'](function(_0x111046){_0x10cb89['updateOriginated'](_0x15178f);_0x10cb89[_0x34d1('0xc4')]({'active':![],'ContactId':_0x10cb89[_0x34d1('0xae')][_0x96137e][_0x34d1('0xd6')],'ListId':_0x10cb89[_0x34d1('0xae')][_0x96137e]['ListId'],'VoiceQueueId':_0x10cb89['actions'][_0x96137e][_0x34d1('0xd9')]||undefined,'CampaignId':_0x10cb89[_0x34d1('0xae')][_0x96137e][_0x34d1('0xda')]||undefined})[_0x34d1('0xb3')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x10cb89[_0x34d1('0xae')][_0x96137e];});}else{loggerBooked[_0x34d1('0x7c')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x15178f[_0x34d1('0x12d')]),_0x34d1('0x1ef'),_0x15178f[_0x34d1('0x3c')]);_0x10cb89['updateOriginated'](_0x15178f);_0x10cb89['rescheduleContact']({'active':![],'ContactId':_0x10cb89[_0x34d1('0xae')][_0x96137e][_0x34d1('0xd6')],'ListId':_0x10cb89[_0x34d1('0xae')][_0x96137e]['ListId'],'VoiceQueueId':_0x10cb89['actions'][_0x96137e][_0x34d1('0xd9')]||undefined,'CampaignId':_0x10cb89[_0x34d1('0xae')][_0x96137e]['CampaignId']||undefined})[_0x34d1('0xb3')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x10cb89[_0x34d1('0xae')][_0x96137e];}}else{return _0x10cb89[_0x34d1('0x16c')](_0x15178f,_0x16ca19);}}else{if(getDiff(_0x16ca19[_0x34d1('0x1f0')])<_0x15178f['dialRecallMeTimeout']*0x3c){if(_0x16ca19['Agent']&&!_0x16ca19[_0x34d1('0x1f1')][_0x34d1('0x1f2')]){_0x10cb89['preview']['run'](_0x16ca19['id'])['finally'](function(){_0x10cb89[_0x34d1('0xb5')](_0x15178f);});}else{_0x10cb89['unlockContact']({'active':![]},_0x16ca19['id'],0x1)['finally'](function(){console[_0x34d1('0x1f3')](_0x34d1('0x1f4'));_0x10cb89['updateOriginated'](_0x15178f);});}}else{_0x15178f[_0x34d1('0x67')]+=0x1;_0x10cb89[_0x34d1('0xb5')](_0x15178f);if(_0x15178f[_0x34d1('0x1f5')]){_0x10cb89['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x16ca19[_0x34d1('0xd6')],'ListId':_0x16ca19[_0x34d1('0xd7')],'VoiceQueueId':_0x16ca19['VoiceQueueId']||undefined,'CampaignId':_0x16ca19['CampaignId']||undefined})[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x1f6')));_0x10cb89[_0x34d1('0xce')](createObjHistory(_0x15178f,_0x16ca19,'RECALLINQUEUE',0x17,_0x34d1('0x1f7')))[_0x34d1('0xb3')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x10cb89[_0x34d1('0xd4')](createObjHistory(_0x15178f,_0x16ca19,_0x34d1('0x1f8'),0x16,_0x34d1('0x1f9')),_0x34d1('0x1fa'),_0x34d1('0x1fb'));}}}}else{_0x15178f['outboundBlacklistCallsDay']+=0x1;_0x10cb89[_0x34d1('0xd4')](createObjHistory(_0x15178f,_0x16ca19,_0x34d1('0x1fc'),0xd,'Blacklist'),_0x34d1('0x1fd'),_0x34d1('0x1fe'));throw _0x34d1('0x1ff');}};};Dialer[_0x34d1('0xaa')][_0x34d1('0x165')]=function(_0x16154b){var _0x42bed7=this;var _0x4c1e95=[];var _0x6c123f=_0x16154b[_0x34d1('0x200')]-_0x16154b['originated']-_0x16154b[_0x34d1('0x201')];emitCampaignSummary(_0x16154b);if(_0x6c123f>0x0){if(_0x6c123f>this[_0x34d1('0x24')]){_0x6c123f=this[_0x34d1('0x24')];}_0x16154b[_0x34d1('0x201')]+=_0x6c123f;this[_0x34d1('0xc9')](_0x16154b['id'],_0x6c123f,_0x16154b[_0x34d1('0x202')])['then'](function(_0x411946){_0x16154b['temp']-=_0x6c123f;_0x16154b[_0x34d1('0x201')]=_0x16154b['temp']>0x0?_0x16154b['temp']:0x0;if(!checkContactEmpty(_0x411946)){_0x16154b['message']='AVAILABLE_CONTACTS_FINISHED';logger['info']('[getContactCampaign2][Empty]'+_0x16154b['name']);}else{_0x16154b[_0x34d1('0x6e')]+=_0x411946[_0x34d1('0x98')];_0x16154b[_0x34d1('0x39')]=_0x34d1('0x203');for(var _0x27cac9=0x0;_0x27cac9<_0x411946[_0x34d1('0x98')];_0x27cac9+=0x1){_0x16154b[_0x34d1('0x204')]+=0x1;if(_[_0x34d1('0xb0')](_0x411946[_0x27cac9])||_[_0x34d1('0xb0')](_0x411946[_0x27cac9][_0x34d1('0x16f')])||_[_0x34d1('0xb0')](_0x411946[_0x27cac9][_0x34d1('0x16f')][_0x34d1('0x170')])){_0x42bed7[_0x34d1('0xd2')]('[actionOriginate]\x20',_0x16154b,_0x411946[_0x27cac9]);}else{_0x42bed7[_0x34d1('0xbf')](_['pick'](_0x411946[_0x27cac9],[_0x34d1('0xda'),_0x34d1('0x205')]))[_0x34d1('0xbc')](_0x42bed7[_0x34d1('0x1ed')](_0x16154b,_0x411946[_0x27cac9]))[_0x34d1('0xb3')](_0x42bed7[_0x34d1('0xd1')](_0x34d1('0x206'),_0x16154b));}}}})[_0x34d1('0xb3')](loggerGetContactDialer(_0x34d1('0x207'),_0x16154b,_0x6c123f));}};Dialer[_0x34d1('0xaa')][_0x34d1('0x15f')]=function(_0x20893d,_0x16838f){var _0x2c6926=this;var _0x335f27=[];var _0x5013c6=_0x16838f>=0x1?_0x16838f:0x1;var _0x4267cd=[];if(_0x20893d['dialMethod']===_0x34d1('0x9')){_0x5013c6=0x1;}var _0x5aeea9=Math[_0x34d1('0x1cf')](_0x20893d[_0x34d1('0x4a')]*_0x5013c6)-_0x20893d[_0x34d1('0x6e')]-_0x20893d[_0x34d1('0x201')];emitVoiceQueueSummary(_0x20893d);if(_0x20893d[_0x34d1('0x208')]>0x0){var _0x1e0590=_0x20893d[_0x34d1('0x208')]-_0x20893d['originated']-_0x20893d['talking']-_0x20893d[_0x34d1('0x201')]-_0x20893d[_0x34d1('0x4b')];if(_0x5aeea9>_0x1e0590){_0x5aeea9=_0x1e0590;}}if(_0x5aeea9>0x0){if(_0x20893d[_0x34d1('0x57')]===_0x34d1('0x9')){_0x5aeea9=0x1;}if(_0x5aeea9>this['maxNumberOriginate']){_0x5aeea9=this[_0x34d1('0x24')];}_0x20893d[_0x34d1('0x201')]+=_0x5aeea9;for(var _0x7202f4 in this[_0x34d1('0x22')]){if(this[_0x34d1('0x22')][_0x34d1('0x99')](_0x7202f4)){if(this[_0x34d1('0x22')][_0x7202f4][_0x34d1('0xa7')]===_0x34d1('0x209')&&this['agents'][_0x7202f4]['status']==='reachable'){_0x335f27[_0x34d1('0x12c')](this['agents'][_0x7202f4]['id']);}}}this[_0x34d1('0xc7')](_0x20893d['id'],_0x335f27,_0x5aeea9,_0x20893d[_0x34d1('0x202')])[_0x34d1('0xbc')](function(_0xbb1f11){_0x20893d[_0x34d1('0x201')]-=_0x5aeea9;_0x20893d[_0x34d1('0x201')]=_0x20893d[_0x34d1('0x201')]>0x0?_0x20893d[_0x34d1('0x201')]:0x0;if(!checkContactEmpty(_0xbb1f11)){_0x2c6926['countReScheduled'](_0x20893d)[_0x34d1('0xbc')](sendMessageReschedule(_0x20893d))[_0x34d1('0xb3')](loggerCatch(_0x34d1('0x20a')));}else{_0x20893d[_0x34d1('0x6e')]+=_0xbb1f11['length'];_0x20893d[_0x34d1('0x39')]=_0x20893d[_0x34d1('0x57')]==='booked'?_0x34d1('0x179'):'RUNNING';for(var _0x35cffe=0x0;_0x35cffe<_0xbb1f11[_0x34d1('0x98')];_0x35cffe+=0x1){if(_[_0x34d1('0xb0')](_0xbb1f11[_0x35cffe])||_['isNil'](_0xbb1f11[_0x35cffe][_0x34d1('0x16f')])||_['isNil'](_0xbb1f11[_0x35cffe]['Contact'][_0x34d1('0x170')])){_0x2c6926[_0x34d1('0xd2')](_0x34d1('0x20b'),_0x20893d,_0xbb1f11[_0x35cffe]);}else{_0x2c6926['checkIsBlackList'](_['pick'](_0xbb1f11[_0x35cffe],[_0x34d1('0xd9'),_0x34d1('0x205')]))[_0x34d1('0xbc')](_0x2c6926['checkContactBlack'](_0x20893d,_0xbb1f11[_0x35cffe]))[_0x34d1('0xb3')](_0x2c6926['loggerHandler'](_0x34d1('0x20b'),_0x20893d));}}}})[_0x34d1('0xb3')](loggerGetContactDialer('[getContactDialer2]',_0x20893d,_0x5aeea9));}};Dialer[_0x34d1('0xaa')][_0x34d1('0x90')]=function(_0x5bcf70){var _0x160bac=this;if(_0x5bcf70[_0x34d1('0x208')]>0x0){var _0xaf9b05=_0x5bcf70['dialLimitQueue']-_0x5bcf70['originated']-_0x5bcf70[_0x34d1('0x4f')];if(_0xaf9b05>0x0){this[_0x34d1('0x20c')](_0x5bcf70);}else{loggerPredictiveCalls[_0x34d1('0x7c')](_0x34d1('0x20d'));}}else{this['tryOriginatePredictive'](_0x5bcf70);}};Dialer[_0x34d1('0xaa')][_0x34d1('0x20c')]=function(_0x4d3df0){var _0x7c0d50=this;var _0x35c9f2=[];_0x4d3df0[_0x34d1('0x6e')]+=0x1;for(var _0x47f1c4 in this[_0x34d1('0x22')]){if(this[_0x34d1('0x22')][_0x34d1('0x99')](_0x47f1c4)){if(this['agents'][_0x47f1c4][_0x34d1('0xa7')]==='not_inuse'&&this[_0x34d1('0x22')][_0x47f1c4][_0x34d1('0xb2')]===_0x34d1('0xe1')){_0x35c9f2[_0x34d1('0x12c')](this[_0x34d1('0x22')][_0x47f1c4]['id']);}}}this[_0x34d1('0xc7')](_0x4d3df0['id'],_0x35c9f2,0x1,_0x4d3df0[_0x34d1('0x202')])[_0x34d1('0xbc')](function(_0x41a453){if(!checkContactEmpty(_0x41a453)){checkContactLowerLimitOriginate(_0x4d3df0,0x1,0x0);_0x7c0d50[_0x34d1('0xba')](_0x4d3df0)[_0x34d1('0xbc')](sendMessageReschedule(_0x4d3df0))['catch'](loggerCatch(_0x34d1('0x20a')));}else{_0x4d3df0['message']=_0x34d1('0x203');if(_['isNil'](_0x41a453[0x0])||_[_0x34d1('0xb0')](_0x41a453[0x0][_0x34d1('0x16f')])||_[_0x34d1('0xb0')](_0x41a453[0x0][_0x34d1('0x16f')]['phone'])){_0x7c0d50['emptyContact'](_0x34d1('0x20b'),_0x4d3df0,_0x41a453[0x0]);}else{_0x7c0d50[_0x34d1('0xbd')](_[_0x34d1('0xd5')](_0x41a453[0x0],[_0x34d1('0xd9'),_0x34d1('0x205')]))[_0x34d1('0xbc')](_0x7c0d50['checkContactBlack'](_0x4d3df0,_0x41a453[0x0]))[_0x34d1('0xb3')](_0x7c0d50[_0x34d1('0xd1')](_0x34d1('0x20e'),_0x4d3df0));}}})[_0x34d1('0xb3')](loggerGetContactDialer(_0x34d1('0x20f'),_0x4d3df0,0x1));emitVoiceQueueSummary(_0x4d3df0);};Dialer[_0x34d1('0xaa')][_0x34d1('0x1e9')]=function(_0x558e30,_0x2e034e,_0x51aae1,_0x47b8c6,_0x3c3508,_0x32488b){loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x210'));loggerPredictive['info'](_0x34d1('0x211'),_0x558e30);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x212'),_0x2e034e);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x213'),_0x51aae1);loggerPredictive[_0x34d1('0x7c')]('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',_0x47b8c6);loggerPredictive['info'](_0x34d1('0x214'),_0x3c3508);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x84'));return new BPromise(function(_0x5a7f2b,_0x272172){if(_0x558e30<=0x0||isNaN(_0x558e30)){return _0x272172(msgResponse(_0x34d1('0x215'),_0x34d1('0x19a'),'m\x20=\x20'+_0x558e30));}if(_0x51aae1<=0x0||isNaN(_0x51aae1)){return _0x272172(msgResponse(_0x34d1('0x215'),'Error',_0x34d1('0x216')+_0x51aae1));}if(_0x47b8c6<=0x0||isNaN(_0x47b8c6)){return _0x272172(msgResponse(_0x34d1('0x215'),_0x34d1('0x19a'),_0x34d1('0x217')+_0x47b8c6));}if(_0x2e034e<=0x0||isNaN(_0x2e034e)){return _0x272172(msgResponse('[abandonmentRate]',_0x34d1('0x19a'),_0x34d1('0x218')+_0x2e034e));}if(_0x3c3508<=0x0||isNaN(_0x3c3508)){return _0x272172(msgResponse(_0x34d1('0x215'),_0x34d1('0x19a'),_0x34d1('0x219')+_0x3c3508));}_0x32488b=_0x32488b||0x0;var _0x3f8046=0x1/_0x51aae1;var _0x4e9716=0x0;var _0x440673=0x0;var _0x54c2a6=0x0;var _0x13ad66=0x0;for(var _0x438427=0x0;_0x54c2a6<_0x3c3508;_0x438427+=0x1){_0x440673=_0x438427/_0x2e034e;_0x4e9716=(_0x47b8c6*_0x440673+_0x32488b)/_0x3f8046;_0x54c2a6=erlangb(_0x4e9716,_0x558e30);_0x13ad66=_0x4e9716/_0x558e30*(0x1-erlangb(_0x4e9716,_0x558e30));}return _0x5a7f2b({'erlangCalls':_0x438427,'erlangCallToSecond':_0x2e034e/_0x438427,'erlangAbandonmentRate':_0x54c2a6,'erlangBusyFactor':_0x13ad66});});};Dialer['prototype'][_0x34d1('0x1e3')]=function(_0x3c149b,_0x4a686a,_0x2b5e00,_0x558852,_0x1da0f2,_0x58ecc2){loggerPredictive['info'](_0x34d1('0x21a'));loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x211'),_0x3c149b);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x212'),_0x4a686a);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x213'),_0x2b5e00);loggerPredictive['info'](_0x34d1('0x21b'),_0x558852);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x21c'),_0x1da0f2);loggerPredictive[_0x34d1('0x7c')](_0x34d1('0x84'));return new BPromise(function(_0x2cc3f6,_0x140608){if(_0x3c149b<=0x0||isNaN(_0x3c149b)){return _0x140608(msgResponse(_0x34d1('0x21d'),_0x34d1('0x19a'),_0x34d1('0x21e')+_0x3c149b));}if(_0x2b5e00<=0x0||isNaN(_0x2b5e00)){return _0x140608(msgResponse(_0x34d1('0x21d'),_0x34d1('0x19a'),_0x34d1('0x216')+_0x2b5e00));}if(_0x558852<=0x0||isNaN(_0x558852)){return _0x140608(msgResponse('[busyFactor]','Error','p\x20=\x20'+_0x558852));}if(_0x4a686a<=0x0||isNaN(_0x4a686a)){return _0x140608(msgResponse(_0x34d1('0x21d'),_0x34d1('0x19a'),'interval\x20=\x20'+_0x4a686a));}if(_0x1da0f2<=0x0||isNaN(_0x1da0f2)){return _0x140608(msgResponse(_0x34d1('0x21d'),'Error',_0x34d1('0x21f')+_0x1da0f2));}_0x58ecc2=_0x58ecc2||0x0;var _0x5f47ae=0x1/_0x2b5e00;var _0x21d414=0x0;var _0x3dfd7a=0x0;var _0x315a90=0x0;var _0x29c94e=0x0;for(var _0x8e1ba3=0x0;_0x29c94e<_0x1da0f2;_0x8e1ba3+=0x1){_0x3dfd7a=_0x8e1ba3/_0x4a686a;_0x21d414=(_0x558852*_0x3dfd7a+_0x58ecc2)/_0x5f47ae;_0x315a90=erlangb(_0x21d414,_0x3c149b);_0x29c94e=_0x21d414/_0x3c149b*(0x1-erlangb(_0x21d414,_0x3c149b));}return _0x2cc3f6({'erlangCalls':_0x8e1ba3,'erlangCallToSecond':_0x4a686a/_0x8e1ba3,'erlangAbandonmentRate':_0x315a90,'erlangBusyFactor':_0x29c94e});});};module['exports']=Dialer; \ No newline at end of file +var _0x0643=['predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','voice:queue:%s','voice_queue:save','ivr','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','milliseconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','loopClearZombieChannels','[uniqueid]','clearZombieChannels','actions','[actions]','hasOwnProperty','isNil','Action','status','catch','No\x20such\x20channel','updateOriginated','queue','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','reachable','saveInDb','variable','exten','HANGUP','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','value','Machine','countmachineretry','amd','countbusyretry','countnoanswerretry','countdropretry','countabandonedretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','uniqueid','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','outboundAnswerCallsDay','[syncAgentComplete][createHistory][0]','countcongestionretry','countnosuchnumberretry','countagentrejectretry','dialMachineMaxRetry','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','[syncHangupIvr]','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','droptime','responsetime','dialQueueTimeout','dropreason','countglobal','dialDropMaxRetry','dialDropRetryFrequency','ListId','[rescheduleContact][Drop]','Drop','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','queueCallerAbandonCreateState','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','locked','paused','stateinterface','actionid','push','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','[booked][RR][finaly]','pick','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','launchHandleIvr','handleIvr','dialActive','dialTimezone','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','getCaller','ACTIVE','xcally-motion-dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','trim','dialCutDigit','substring','from-sip','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','custom:agentnosuchnumber','buildObj','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','predictiveIntervalAvailable','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalHitRate','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','outboundQueuePauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Agent','voicePause','run','log','Contact\x20updated','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','[getContactDialer2]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','lodash','bluebird','moment','../preview/util/util','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','syncOriginateResponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','isUndefined','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','diff','seconds','emit','type','outbound','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','abandoned','waiting','loggedInDb','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout'];(function(_0x2ff6e8,_0x5940f4){var _0x34c642=function(_0xb148a2){while(--_0xb148a2){_0x2ff6e8['push'](_0x2ff6e8['shift']());}};_0x34c642(++_0x5940f4);}(_0x0643,0x1af));var _0x3064=function(_0x4462d1,_0x2d89b1){_0x4462d1=_0x4462d1-0x0;var _0x3a100e=_0x0643[_0x4462d1];return _0x3a100e;};'use strict';var util=require('util');var _=require(_0x3064('0x0'));var BPromise=require(_0x3064('0x1'));var uuid=require('uuid');var moment=require(_0x3064('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0x3064('0x3'));var config=require('../../../config/environment/');var logger=require(_0x3064('0x4'))(_0x3064('0x5'));var loggerBooked=require('../../../config/logger')(_0x3064('0x6'));var loggerPredictive=require(_0x3064('0x4'))('predictive');var loggerPredictiveCalls=require(_0x3064('0x4'))(_0x3064('0x7'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x3064('0x8'));var ami=require(_0x3064('0x9'));config[_0x3064('0xa')]=_[_0x3064('0xb')](config[_0x3064('0xa')],{'host':_0x3064('0xc'),'port':0x18eb});var io=require(_0x3064('0xd'))(new Redis(config[_0x3064('0xa')]));var cmHopper=require(_0x3064('0xe'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x3064('0xf'));var cmHopperBlack=require(_0x3064('0x10'));var voiceQueueRt=require(_0x3064('0x11'));var Action=require('./action');var History=require(_0x3064('0x12'));var Final=require(_0x3064('0x13'));var AgentComplete=require(_0x3064('0x14'));var QueueCallerAbandon=require(_0x3064('0x15'));var Hangup=require(_0x3064('0x16'));var ipAgi=process[_0x3064('0x17')][_0x3064('0x18')]||'127.0.0.1';var strategy={'rrmemory':_0x3064('0x19'),'roundrobin':_0x3064('0x1a')};var Sequence=function(){};Sequence[_0x3064('0x1b')][_0x3064('0x1c')]=function(_0x35b49f){this[_0x3064('0x1d')]=this['tail']?this['tail']['finally'](_0x35b49f):_0x35b49f();};function Dialer(_0x3fc897,_0x834953){this[_0x3064('0x1e')]=new Sequence();this[_0x3064('0x1f')]=_0x834953;this[_0x3064('0x20')]=_0x3fc897[_0x3064('0x20')];this[_0x3064('0x21')]=_0x3fc897[_0x3064('0x21')];this['agents']=_0x3fc897[_0x3064('0x22')];this[_0x3064('0x23')]=_0x3fc897[_0x3064('0x23')];this[_0x3064('0x24')]=config[_0x3064('0x24')]||0x2;this[_0x3064('0x25')]={};this['actions']={};this['contactsId']={};this[_0x3064('0x26')]={};this[_0x3064('0x27')]={};this[_0x3064('0x28')]={};this[_0x3064('0x29')]={};this[_0x3064('0x2a')]={};this[_0x3064('0x2b')]={};this['queueBookedRR']={};ami['on'](_0x3064('0x2c'),this[_0x3064('0x2d')][_0x3064('0x2e')](this));ami['on']('queuecallerabandon',this[_0x3064('0x2f')][_0x3064('0x2e')](this));ami['on']('originateresponse',this[_0x3064('0x30')][_0x3064('0x2e')](this));ami['on']('agentcomplete',this[_0x3064('0x31')][_0x3064('0x2e')](this));ami['on'](_0x3064('0x32'),this[_0x3064('0x8')][_0x3064('0x2e')](this));ami['on'](_0x3064('0x33'),this[_0x3064('0x34')][_0x3064('0x2e')](this));ami['on']('newexten',this[_0x3064('0x35')][_0x3064('0x2e')](this));ami['on'](_0x3064('0x36'),this[_0x3064('0x37')][_0x3064('0x2e')](this));ami['on']('queuemember',this[_0x3064('0x38')][_0x3064('0x2e')](this));ami['on'](_0x3064('0x39'),this[_0x3064('0x3a')]['bind'](this));this['loopCampaigns']();this['loopClearZombieChannels']();}function isNotNull(_0x46a4d5){return _0x46a4d5!==null&&!_[_0x3064('0x3b')](_0x46a4d5);}function checkIsLoggedIn(_0x12cf1f,_0x5974be){return function(){if(_0x5974be<=0x0){_0x12cf1f['message']=_0x3064('0x3c');throw _0x12cf1f[_0x3064('0x3d')]+_0x3064('0x3e');}};}function isActive(_0x566279){return _0x566279;}function checkIsActive(_0x47f962,_0x2ab6ad){return function(){if(!isActive(_0x2ab6ad)){_0x47f962[_0x3064('0x3f')]=_0x3064('0x40');throw _0x47f962[_0x3064('0x3d')]+_0x3064('0x41');}};}function checkInterval(_0x407f31){return function(){if(!isNotNull(_0x407f31[_0x3064('0x42')])){_0x407f31[_0x3064('0x3f')]=_0x3064('0x43');throw _0x407f31[_0x3064('0x3d')]+_0x3064('0x44');}if(!isNotNull(_0x407f31['Interval'][_0x3064('0x45')])){_0x407f31[_0x3064('0x3f')]=_0x3064('0x43');throw _0x407f31[_0x3064('0x3d')]+_0x3064('0x44');}if(!isNotNull(_['isEmpty'](_0x407f31[_0x3064('0x42')][_0x3064('0x45')]))){_0x407f31[_0x3064('0x3f')]='INTERVAL_IS_NULL';throw _0x407f31[_0x3064('0x3d')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x49ec1a,_0x3e107c,_0x1d366d){return{'action':_0x49ec1a,'response':_0x3e107c,'message':_0x1d366d,'stack':_0x1d366d};}function myreject(_0x339839){return function(_0x2b225a){return _0x339839(msgResponse(_0x3064('0x46'),_0x3064('0x47'),JSON[_0x3064('0x48')](_0x2b225a)));};}function getSeconds(_0x2e8633,_0x438c57){var _0x57d8e6=moment(_0x2e8633)['milliseconds'](0x0);var _0x109dc0=moment(_0x438c57)['milliseconds'](0x0);return _0x57d8e6[_0x3064('0x49')](_0x109dc0,_0x3064('0x4a'));}function emit(_0x5c5d6d,_0x514c92,_0x9c76e7){io['to'](_0x5c5d6d)[_0x3064('0x4b')](_0x514c92,_0x9c76e7);}function emitVoiceQueueSummary(_0x50ee34){if(_0x50ee34[_0x3064('0x4c')]===_0x3064('0x4d')){var _0x5f42b1={'id':_0x50ee34['id'],'name':_0x50ee34[_0x3064('0x3d')],'strategy':_0x50ee34[_0x3064('0x4e')],'answered':_0x50ee34['answered'],'available':_0x50ee34[_0x3064('0x4f')],'loggedIn':_0x50ee34[_0x3064('0x50')],'pTalking':_0x50ee34['pTalking'],'sumBillable':_0x50ee34[_0x3064('0x51')],'sumDuration':_0x50ee34[_0x3064('0x52')],'sumHoldTime':_0x50ee34[_0x3064('0x53')]||0x0,'talking':_0x50ee34[_0x3064('0x54')],'total':_0x50ee34[_0x3064('0x55')],'type':_0x50ee34[_0x3064('0x4c')],'unmanaged':_0x50ee34['unmanaged'],'abandoned':_0x50ee34[_0x3064('0x56')],'waiting':_0x50ee34[_0x3064('0x57')],'loggedInDb':_0x50ee34[_0x3064('0x58')],'dialActive':_0x50ee34['dialActive'],'dialMethod':_0x50ee34['dialMethod'],'dialOriginateCallerIdName':_0x50ee34['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x50ee34[_0x3064('0x59')],'dialOriginateTimeout':_0x50ee34[_0x3064('0x5a')],'dialPrefix':_0x50ee34[_0x3064('0x5b')],'outboundAnswerAgiCallsDay':_0x50ee34[_0x3064('0x5c')],'outboundAnswerCallsDay':_0x50ee34['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x50ee34[_0x3064('0x5d')],'outboundBusyCallsDay':_0x50ee34['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x50ee34[_0x3064('0x5e')],'outboundDropCallsDayACS':_0x50ee34[_0x3064('0x5f')],'outboundDropCallsDayCallersExit':_0x50ee34[_0x3064('0x60')],'outboundDropCallsDayTimeout':_0x50ee34[_0x3064('0x61')],'outboundNoAnswerCallsDay':_0x50ee34[_0x3064('0x62')],'outboundNoSuchCallsDay':_0x50ee34['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x50ee34[_0x3064('0x63')],'outboundReCallsDay':_0x50ee34['outboundReCallsDay'],'outboundRejectCallsDay':_0x50ee34[_0x3064('0x64')],'outboundUnknownCallsDay':_0x50ee34[_0x3064('0x65')],'predictiveIntervalAnsweredCalls':_0x50ee34[_0x3064('0x66')],'predictiveIntervalAvgHoldtime':_0x50ee34[_0x3064('0x67')],'predictiveIntervalAvgTalktime':_0x50ee34[_0x3064('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x50ee34[_0x3064('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x50ee34[_0x3064('0x6a')],'predictiveIntervalErlangCalls':_0x50ee34[_0x3064('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x50ee34[_0x3064('0x6c')],'predictiveIntervalHitRate':_0x50ee34['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x50ee34['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x50ee34[_0x3064('0x6d')],'predictiveIntervalAvailable':_0x50ee34['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x50ee34['predictiveIntervalTotalCalls'],'message':_0x50ee34[_0x3064('0x3f')],'originated':_0x50ee34['originated'],'erlangCalls':_0x50ee34['erlangCalls'],'erlangCallToSecond':_0x50ee34[_0x3064('0x6e')],'erlangAbandonmentRate':_0x50ee34[_0x3064('0x6f')],'erlangBusyFactor':_0x50ee34[_0x3064('0x70')],'startPredictive':_0x50ee34[_0x3064('0x28')],'startProgressive':_0x50ee34[_0x3064('0x29')]};if(_0x50ee34[_0x3064('0x71')]){_0x5f42b1['Trunk']={'id':_0x50ee34[_0x3064('0x71')]['id'],'name':_0x50ee34[_0x3064('0x71')][_0x3064('0x3d')],'active':_0x50ee34[_0x3064('0x71')][_0x3064('0x72')],'callerid':_0x50ee34[_0x3064('0x71')][_0x3064('0x73')]};}if(_0x50ee34['Interval']){_0x5f42b1[_0x3064('0x42')]={'id':_0x50ee34[_0x3064('0x42')]['id'],'name':_0x50ee34['Interval'][_0x3064('0x3d')]};}var _0xa5534a=md5(JSON['stringify'](_0x5f42b1));if(_0x50ee34[_0x3064('0x74')]!==_0xa5534a){_0x50ee34['md5']=_0xa5534a;emit(util[_0x3064('0x75')](_0x3064('0x76'),_0x5f42b1[_0x3064('0x3d')]),_0x3064('0x77'),_0x5f42b1);}}}function emitCampaignSummary(_0x344940){if(_0x344940[_0x3064('0x4c')]===_0x3064('0x78')){emit(util[_0x3064('0x75')]('campaign:ivr:%s',_0x344940[_0x3064('0x3d')]),'campaign:save',_0x344940);}}function checkGetDataPredictive(_0x45ae1e){if(isNotNull(_0x45ae1e)){if(!_[_0x3064('0x79')](_0x45ae1e)){loggerPredictive[_0x3064('0x7a')](_0x3064('0x7b'));loggerPredictive['info'](_0x3064('0x7c'),_0x45ae1e[_0x3064('0x7d')]);loggerPredictive[_0x3064('0x7a')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x45ae1e[_0x3064('0x66')]);loggerPredictive[_0x3064('0x7a')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x45ae1e[_0x3064('0x6a')]);loggerPredictive['info'](_0x3064('0x7e'),_0x45ae1e[_0x3064('0x69')]);loggerPredictive[_0x3064('0x7a')](_0x3064('0x7f'),_0x45ae1e[_0x3064('0x67')]);loggerPredictive[_0x3064('0x7a')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x45ae1e[_0x3064('0x68')]);loggerPredictive[_0x3064('0x7a')]('---------------------------');if(_0x45ae1e['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x45ae1e[_0x3064('0x68')])&&_0x45ae1e[_0x3064('0x68')]>0x0){return!![];}else{loggerPredictive['info'](_0x3064('0x80'));}if(!_[_0x3064('0x3b')](_0x45ae1e[_0x3064('0x67')])&&_0x45ae1e[_0x3064('0x67')]>0x0){return!![];}else{loggerPredictive['info'](_0x3064('0x81'));}}else{loggerPredictive[_0x3064('0x7a')](_0x3064('0x82'));}}else{loggerPredictive[_0x3064('0x7a')](_0x3064('0x83'));}}else{loggerPredictive['info'](_0x3064('0x83'));}return![];}function mergeDataErlangB(_0x137573){return function(_0x2f96e2){loggerPredictive[_0x3064('0x7a')](_0x3064('0x84'));loggerPredictive[_0x3064('0x7a')](_0x3064('0x85'),_0x2f96e2[_0x3064('0x86')]);loggerPredictive[_0x3064('0x7a')](_0x3064('0x87'),_0x2f96e2[_0x3064('0x6e')]);loggerPredictive['info'](_0x3064('0x88'),_0x2f96e2[_0x3064('0x6f')]);loggerPredictive[_0x3064('0x7a')](_0x3064('0x89'),_0x2f96e2[_0x3064('0x70')]);loggerPredictive[_0x3064('0x7a')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2f96e2[_0x3064('0x6f')]);loggerPredictive['info'](_0x3064('0x8a'));_[_0x3064('0x8b')](_0x137573,_0x2f96e2);};}function getDiff(_0x102488){var _0x33e3ce=moment()['milliseconds'](0x0);var _0x173979=moment(_0x102488)[_0x3064('0x8c')](0x0);return _0x33e3ce[_0x3064('0x49')](_0x173979,_0x3064('0x4a'));}function ifInterval(_0x235f4a,_0x527a7f){if(_[_0x3064('0x3b')](_0x527a7f)){return![];}if(getDiff(_0x527a7f)<_0x235f4a*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x45f2f6){if(isNotNull(_0x45f2f6)){if(!_['isUndefined'](_0x45f2f6['startProgressive'])){_0x45f2f6['startProgressive']=undefined;loggerPredictive[_0x3064('0x7a')](_0x45f2f6['name'],_0x3064('0x8d'));}if(!_['isUndefined'](_0x45f2f6[_0x3064('0x28')])){_0x45f2f6[_0x3064('0x28')]=undefined;loggerPredictive[_0x3064('0x7a')](_0x45f2f6[_0x3064('0x3d')],_0x3064('0x8e'));}if(!_[_0x3064('0x3b')](_0x45f2f6[_0x3064('0x8f')])){clearInterval(_0x45f2f6['handlePredictive']);_0x45f2f6[_0x3064('0x8f')]=undefined;loggerPredictive[_0x3064('0x7a')](_0x45f2f6[_0x3064('0x3d')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x54ba44,_0x44a747){if(_0x44a747===0x0){return 0x0;}var _0x16121d=0x1;for(var _0x58eadc=0x1;_0x58eadc<=_0x44a747;_0x58eadc+=0x1){_0x16121d=0x1+_0x16121d*_0x58eadc/_0x54ba44;}return 0x1/_0x16121d;}function isVoiceQueueOutbound(_0x59afc4){return _0x59afc4==='outbound';}function isNotPreview(_0x16af50){return _0x16af50!==_0x3064('0x1f');}function isCampaignIvr(_0x113d9d){return _0x113d9d===_0x3064('0x78');}function getCallerId(_0x441169,_0x29d795,_0x1942a3){if(!_[_0x3064('0x3b')](_0x1942a3)&&'string'===typeof _0x1942a3&&!_[_0x3064('0x79')](_0x1942a3)){if(!_[_0x3064('0x3b')](_0x29d795)&&_0x3064('0x90')===typeof _0x29d795&&!_[_0x3064('0x79')](_0x29d795)){return util[_0x3064('0x75')]('\x22%s\x22\x20<%s>',_0x29d795,_0x1942a3);}return util[_0x3064('0x75')](_0x3064('0x91'),_0x1942a3,_0x1942a3);}if(!_['isUndefined'](_0x441169)&&'string'===typeof _0x441169&&!_['isEmpty'](_0x441169)){return _0x441169;}return _0x3064('0x92');}function loggerCatchQueueSummary(_0x2d69b6,_0x4c3bf1){return function(_0x13abca){freeVariablesPredictive(_0x4c3bf1);emitVoiceQueueSummary(_0x4c3bf1);emitCampaignSummary(_0x4c3bf1);loggerSyncQueueSummary[_0x3064('0x93')](_0x2d69b6,util[_0x3064('0x94')](_0x13abca,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x6529db,_0x1f4bf0){return function(_0x458c03){loggerPredictive[_0x3064('0x93')](_0x1f4bf0[_0x3064('0x3d')],_0x6529db);loggerPredictive['error'](_0x458c03[_0x3064('0x95')]);freeVariablesPredictive(_0x1f4bf0);};}function loggerCatch(_0x4bd2af){return function(_0x2b9deb){logger[_0x3064('0x93')](_0x4bd2af,util['inspect'](_0x2b9deb,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x14d1dc){return _0x14d1dc&&!_['isUndefined'](_0x14d1dc)&&_0x14d1dc[_0x3064('0x96')]>0x0;}function decremetOriginate(_0x557bb8){if(!_['isUndefined'](_0x557bb8)&&_0x557bb8!==null){if(_0x557bb8['hasOwnProperty']('originated')){if(_0x557bb8[_0x3064('0x97')]>0x0){_0x557bb8[_0x3064('0x97')]-=0x1;}else{logger[_0x3064('0x93')](_0x3064('0x98'));}}}else{logger[_0x3064('0x93')](_0x3064('0x99'));}}function checkContactLowerLimitOriginate(_0xaccfdf,_0x481715,_0x389889){if(_0x481715>_0x389889){for(var _0x1d32af=0x0;_0x1d32af<_0x481715-_0x389889;_0x1d32af+=0x1){decremetOriginate(_0xaccfdf);}}}function loggerGetContactDialer(_0x4d812d,_0x176fea,_0x24eade){return function(_0x189029){checkContactLowerLimitOriginate(_0x176fea,_0x24eade,0x0);logger[_0x3064('0x93')](_0x4d812d,util[_0x3064('0x94')](_0x189029,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2c59da){return function(_0x4a6b9f){if(isNotNull(_0x4a6b9f)&&isNotNull(_0x4a6b9f[0x0])){if(_0x4a6b9f[0x0][_0x3064('0x9a')]>0x0){_0x2c59da[_0x3064('0x3f')]=_0x3064('0x9b');logger['info'](_0x3064('0x9c')+_0x2c59da['name'],_0x4a6b9f[0x0]['contactsRescheduled'],_0x3064('0x9d'));}else{_0x2c59da[_0x3064('0x3f')]=_0x3064('0x9e');logger['info'](_0x3064('0x9f')+_0x2c59da[_0x3064('0x3d')]);}}};}function notSendMessagesQueue(_0x500b31){if(_0x500b31[_0x3064('0xa0')]){freeVariablesPredictive(_0x500b31);if(_0x500b31[_0x3064('0x97')]===0x0&&_0x500b31[_0x3064('0x54')]===0x0&&_0x500b31[_0x3064('0x57')]===0x0&&(_0x500b31[_0x3064('0xa1')]||0x0)===0x0){_0x500b31[_0x3064('0xa0')]=![];_0x500b31['available']=0x0;_0x500b31[_0x3064('0x3f')]=_0x3064('0x40');loggerSyncQueueSummary['error'](_0x3064('0xa2'),_0x500b31['name'],_0x3064('0xa3'));}else{_0x500b31[_0x3064('0x3f')]=_0x3064('0xa4');loggerSyncQueueSummary[_0x3064('0x93')](_0x3064('0xa2'),_0x500b31[_0x3064('0x3d')],_0x3064('0xa5'));}emitVoiceQueueSummary(_0x500b31);}}function notSendMessagesCampaign(_0x5bdf77){if(_0x5bdf77[_0x3064('0xa0')]){if(_0x5bdf77[_0x3064('0x97')]===0x0){_0x5bdf77[_0x3064('0xa0')]=![];_0x5bdf77[_0x3064('0x3f')]=_0x3064('0x40');loggerSyncQueueSummary[_0x3064('0x93')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5bdf77[_0x3064('0x3d')],_0x3064('0xa3'));}else{_0x5bdf77[_0x3064('0x3f')]=_0x3064('0xa4');loggerSyncQueueSummary['error'](_0x3064('0xa6'),_0x5bdf77[_0x3064('0x3d')],_0x3064('0xa5'));}emitCampaignSummary(_0x5bdf77);}}function createObjHistory(_0x3eb3c5,_0x3b5ce0,_0x2f8674,_0x1800ed,_0xd1d636){_0x3eb3c5[_0x3064('0x3f')]=_0x2f8674;var _0x72bce4=new Action(_0x3eb3c5,_0x3b5ce0);var _0x290919=new History(_0x72bce4);_0x290919[_0x3064('0xa7')]=_0x1800ed;_0x290919[_0x3064('0xa8')]=_0xd1d636;_0x290919[_0x3064('0xa9')]=_0x72bce4['starttime'];return _0x290919;}Dialer[_0x3064('0x1b')][_0x3064('0xaa')]=function(){var _0x4e12c9=this;setInterval(function(){_0x4e12c9['clearZombieChannels'](_0x4e12c9[_0x3064('0x26')],_0x3064('0xab'));_0x4e12c9[_0x3064('0xac')](_0x4e12c9[_0x3064('0xad')],_0x3064('0xae'));},0x32c8);};Dialer[_0x3064('0x1b')][_0x3064('0xac')]=function(_0x3a8eb5,_0xf43cbe){var _0x3ad291=this;for(var _0x402605 in _0x3a8eb5){if(_0x3a8eb5[_0x3064('0xaf')](_0x402605)){this['sequence'][_0x3064('0x1c')](function(){if(!_[_0x3064('0xb0')](_0x3a8eb5[_0x402605])){return ami[_0x3064('0xb1')]({'action':_0x3064('0xb2'),'channel':_0x3a8eb5[_0x402605]['channel']})[_0x3064('0xb3')](function(_0x23b66a){if(_0x23b66a['message']===_0x3064('0xb4')){setTimeout(function(){if(_0x3a8eb5[_0x402605]&&_0x3a8eb5[_0x402605]['type']!==_0x3064('0x78')){_0x3ad291[_0x3064('0xb5')](_0x3ad291['voiceQueues'][_0x3a8eb5[_0x402605][_0x3064('0xb6')]]);logger[_0x3064('0x93')]('[Dialer][checkChannel]',_0xf43cbe,_0x402605,_0x3a8eb5[_0x402605]['queue']);delete _0x3a8eb5[_0x402605];}if(_0x3a8eb5[_0x402605]&&_0x3a8eb5[_0x402605][_0x3064('0x4c')]==='ivr'){_0x3ad291[_0x3064('0xb5')](_0x3ad291[_0x3064('0x21')][_0x3a8eb5[_0x402605]['queue']]);logger[_0x3064('0x93')]('[Dialer][checkChannel][ivr]',_0xf43cbe,_0x402605,_0x3a8eb5[_0x402605]['queue']);delete _0x3a8eb5[_0x402605];}},0x2328);}});}});}}};Dialer[_0x3064('0x1b')][_0x3064('0xb7')]=function(_0x1663e7){return BPromise[_0x3064('0xb8')]()['then'](cmHopper[_0x3064('0xb7')](_0x1663e7))[_0x3064('0xb3')](loggerCatch(_0x3064('0xb9')));};Dialer[_0x3064('0x1b')][_0x3064('0xba')]=function(_0x190a7d){return BPromise[_0x3064('0xb8')]()[_0x3064('0xbb')](cmHopperBlack['checkIsBlackList'](_0x190a7d))[_0x3064('0xb3')](loggerCatch(_0x3064('0xbc')));};Dialer[_0x3064('0x1b')][_0x3064('0xbd')]=function(_0x251c74){return BPromise[_0x3064('0xb8')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x251c74))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x3064('0x1b')][_0x3064('0xbe')]=function(_0x47eba0){return BPromise[_0x3064('0xb8')]()[_0x3064('0xbb')](cmHopperHistory[_0x3064('0xbf')](_0x47eba0))[_0x3064('0xb3')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x3064('0x1b')]['rescheduleContact']=function(_0xd72ace){return BPromise[_0x3064('0xb8')]()['then'](cmHopper[_0x3064('0xc0')](_0xd72ace))[_0x3064('0xb3')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x3064('0xc1')]=function(_0x111bc2,_0x4930ca,_0x56c73f){return BPromise['resolve']()[_0x3064('0xbb')](cmHopper[_0x3064('0xc1')](_0x111bc2,_0x4930ca,_0x56c73f))[_0x3064('0xb3')](loggerCatch(_0x3064('0xc2')));};Dialer[_0x3064('0x1b')][_0x3064('0xc3')]=function(_0x33f855,_0x1b906a,_0x2621f5,_0x2ad054){return BPromise['resolve']()[_0x3064('0xbb')](cmHopper[_0x3064('0xc3')](_0x33f855,_0x1b906a,_0x2621f5,_0x2ad054))[_0x3064('0xb3')](loggerCatch(_0x3064('0xc4')));};Dialer['prototype'][_0x3064('0xc5')]=function(_0x591824,_0x4346a0,_0x3d04fe){return BPromise['resolve']()[_0x3064('0xbb')](cmHopper[_0x3064('0xc5')](_0x591824,_0x4346a0,_0x3d04fe))[_0x3064('0xb3')](loggerCatch(_0x3064('0xc4')));};Dialer[_0x3064('0x1b')][_0x3064('0xc6')]=function(_0x5d04eb){return BPromise[_0x3064('0xb8')]()[_0x3064('0xbb')](voiceQueueRt['getVoiceQueueRtPauses'](_0x5d04eb))[_0x3064('0xb3')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x3064('0x1b')][_0x3064('0xc7')]=function(_0x4b560a){return BPromise[_0x3064('0xb8')]()[_0x3064('0xbb')](cmHopper[_0x3064('0xc7')](_0x4b560a))[_0x3064('0xb3')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x3064('0x1b')][_0x3064('0xc8')]=function(_0x2e427c){return BPromise[_0x3064('0xb8')]()[_0x3064('0xbb')](cmHopperHistory[_0x3064('0xc8')](_0x2e427c))[_0x3064('0xb3')](loggerCatch('[createHistory]\x20'));};Dialer['prototype']['updateOriginated']=function(_0x1b6418){if(!_[_0x3064('0x3b')](_0x1b6418)&&_0x1b6418!==null){if(_0x1b6418[_0x3064('0xaf')](_0x3064('0x97'))){if(_0x1b6418['originated']>0x0){_0x1b6418[_0x3064('0x97')]-=0x1;}else{logger[_0x3064('0x93')](_0x3064('0xc9'));}}}else{logger[_0x3064('0x93')](_0x3064('0xca'));}};Dialer[_0x3064('0x1b')][_0x3064('0xcb')]=function(_0x2d0b9e,_0x2b93ab){var _0x21ee40=this;return function(_0x5ba02c){_0x21ee40['updateOriginated'](_0x2b93ab);logger['error'](_0x2d0b9e,util[_0x3064('0x94')](_0x5ba02c,{'showHidden':![],'depth':null}));};};Dialer[_0x3064('0x1b')][_0x3064('0xcc')]=function(_0x30df44,_0x4c3a81,_0x5c2717){var _0x46dd42={'state':0x19,'statedesc':_0x3064('0xcd')};this[_0x3064('0xb5')](_0x4c3a81);this['saveInDb'](_[_0x3064('0x8b')](_0x46dd42,_['pick'](_0x5c2717,[_0x3064('0xce'),'ListId',_0x3064('0xcf'),_0x3064('0xd0'),_0x3064('0xd1')])),_0x3064('0xd2'),_0x3064('0xd3'));logger['error'](_0x30df44);};Dialer[_0x3064('0x1b')][_0x3064('0xd4')]=function(_0x34e399){return _0x34e399===_0x3064('0xd5');};Dialer[_0x3064('0x1b')][_0x3064('0xd6')]=function(_0x40716e){return!_[_0x3064('0x3b')](_0x40716e)&&_0x40716e&&!_['isUndefined'](_0x40716e['name'])&&!_[_0x3064('0x3b')](_0x40716e['active'])&&_0x40716e[_0x3064('0x72')]&&(this[_0x3064('0x23')][util['format']('SIP/%s',_0x40716e[_0x3064('0x3d')])]['status']===_0x3064('0xd7')||this[_0x3064('0x23')][util[_0x3064('0x75')]('SIP/%s',_0x40716e[_0x3064('0x3d')])]['status']==='unmonitored');};Dialer[_0x3064('0x1b')][_0x3064('0xd8')]=function(_0x298ed1,_0x1133ba,_0x14e4c4){this['createHistory'](_0x298ed1)[_0x3064('0xb3')](loggerCatch(_0x1133ba));this['moveContactManagedDialer'](_0x298ed1)[_0x3064('0xb3')](loggerCatch(_0x14e4c4));};Dialer[_0x3064('0x1b')][_0x3064('0x37')]=function(_0x5531c5){var _0xd293de=this[_0x3064('0x26')][_0x5531c5['uniqueid']];var _0x484399;if(!_[_0x3064('0xb0')](_0x5531c5)&&!_[_0x3064('0xb0')](_0x5531c5['variable'])&&!_['isNil'](_0x5531c5[_0x3064('0xd9')]['amdstatus'])&&_0x5531c5[_0x3064('0xda')]==='xcally-motion-dialer'&&_0xd293de){if(_0xd293de[_0x3064('0x4c')]!==_0x3064('0x78')&&this[_0x3064('0x20')][_0xd293de['queue']]['dialAMDActive']&&_0x5531c5['value']===_0x3064('0xdb')){delete this[_0x3064('0x26')][_0x5531c5['uniqueid']];this[_0x3064('0xb5')](this[_0x3064('0x20')][_0xd293de[_0x3064('0xb6')]]);this[_0x3064('0x20')][_0xd293de[_0x3064('0xb6')]]['outboundAnswerCallsDay']+=0x1;this[_0x3064('0x20')][_0xd293de['queue']][_0x3064('0x5c')]+=0x1;_0x484399=new Hangup(_0xd293de,_0x5531c5);_0x484399[_0x3064('0xa7')]=0x12;_0x484399[_0x3064('0xa8')]=_0x3064('0xdc');_0x484399[_0x3064('0xdd')]=_0x3064('0xde');this[_0x3064('0xd8')](_0x484399,_0x3064('0xdf'),_0x3064('0xe0'));}if(_0xd293de[_0x3064('0x4c')]!==_0x3064('0x78')&&this[_0x3064('0x20')][_0xd293de[_0x3064('0xb6')]][_0x3064('0xe1')]&&_0x5531c5[_0x3064('0xe2')]==='MACHINE'){var _0x286a18=this;return new BPromise(function(_0x34ad9a,_0x451853){delete _0x286a18[_0x3064('0x26')][_0x5531c5['uniqueid']];_0x286a18[_0x3064('0xb5')](_0x286a18[_0x3064('0x20')][_0xd293de[_0x3064('0xb6')]]);_0x286a18['voiceQueues'][_0xd293de[_0x3064('0xb6')]]['outboundAnswerCallsDay']+=0x1;_0x286a18['voiceQueues'][_0xd293de[_0x3064('0xb6')]][_0x3064('0x5c')]+=0x1;var _0x139a0d=_0x286a18['voiceQueues'][_0xd293de[_0x3064('0xb6')]];var _0x1f9f8c=new Hangup(_0xd293de,_0x5531c5);_0x1f9f8c[_0x3064('0xa7')]=0x13;_0x1f9f8c[_0x3064('0xa8')]=_0x3064('0xe3');_0x1f9f8c['membername']=_0x3064('0xde');_0x1f9f8c[_0x3064('0xe4')]+=0x1;_0x1f9f8c['countglobal']+=0x1;_0x1f9f8c[_0x3064('0xe5')]=!![];_0x286a18['createHistory'](_0x1f9f8c)[_0x3064('0xb3')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x1f9f8c[_0x3064('0xe6')]+_0x1f9f8c['countcongestionretry']+_0x1f9f8c[_0x3064('0xe7')]+_0x1f9f8c['countnosuchnumberretry']+_0x1f9f8c[_0x3064('0xe8')]+_0x1f9f8c[_0x3064('0xe9')]+_0x1f9f8c['countmachineretry']+_0x1f9f8c['countagentrejectretry']>=_0x139a0d[_0x3064('0xea')]){_0x286a18[_0x3064('0xeb')](_0x1f9f8c,_0x34ad9a,_0x451853,_0x3064('0xec'));}else{if(_0x1f9f8c[_0x3064('0xe4')]>=_0x139a0d['dialMachineMaxRetry']){_0x286a18[_0x3064('0xed')](_0x1f9f8c,_0x34ad9a,_0x451853,_0x3064('0xee'));}else{_0x286a18[_0x3064('0xc0')]({'active':![],'countmachineretry':_0x1f9f8c[_0x3064('0xe4')],'scheduledat':moment()[_0x3064('0xef')](_0x139a0d['dialMachineRetryFrequency'],_0x3064('0xf0'))[_0x3064('0x75')](_0x3064('0xf1')),'ContactId':_0x1f9f8c['ContactId'],'ListId':_0x1f9f8c['ListId'],'VoiceQueueId':_0x1f9f8c['VoiceQueueId']||undefined,'CampaignId':_0x1f9f8c['CampaignId']||undefined})[_0x3064('0xb3')](loggerCatch(_0x3064('0xf2')));_0x34ad9a({'reschedule':0x1});}}});}if(_0xd293de[_0x3064('0x4c')]==='ivr'&&this['campaigns'][_0xd293de[_0x3064('0xb6')]][_0x3064('0xe1')]&&_0x5531c5[_0x3064('0xe2')]===_0x3064('0xdb')){delete this[_0x3064('0x26')][_0x5531c5[_0x3064('0xf3')]];this[_0x3064('0xb5')](this['campaigns'][_0xd293de[_0x3064('0xb6')]]);_0x484399=new Hangup(_0xd293de,_0x5531c5);_0x484399[_0x3064('0xa7')]=0x12;_0x484399['statedesc']=_0x3064('0xdc');_0x484399[_0x3064('0xdd')]=_0x3064('0xde');this[_0x3064('0xd8')](_0x484399,_0x3064('0xf4'),_0x3064('0xf5'));}if(_0xd293de['type']===_0x3064('0x78')&&this[_0x3064('0x21')][_0xd293de[_0x3064('0xb6')]][_0x3064('0xe1')]&&_0x5531c5[_0x3064('0xe2')]===_0x3064('0xf6')){var _0x286a18=this;return new BPromise(function(_0x40af51,_0x5e65f9){delete _0x286a18[_0x3064('0x26')][_0x5531c5['uniqueid']];_0x286a18[_0x3064('0xb5')](_0x286a18['campaigns'][_0xd293de['queue']]);_0x286a18[_0x3064('0x21')][_0xd293de[_0x3064('0xb6')]][_0x3064('0xf7')]+=0x1;_0x286a18[_0x3064('0x21')][_0xd293de[_0x3064('0xb6')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x1394f8=_0x286a18[_0x3064('0x21')][_0xd293de[_0x3064('0xb6')]];var _0x26450e=new Hangup(_0xd293de,_0x5531c5);_0x26450e[_0x3064('0xa7')]=0x13;_0x26450e[_0x3064('0xa8')]=_0x3064('0xe3');_0x26450e['membername']=_0x3064('0xde');_0x26450e['countmachineretry']+=0x1;_0x26450e['countglobal']+=0x1;_0x26450e[_0x3064('0xe5')]=!![];_0x286a18['createHistory'](_0x26450e)[_0x3064('0xb3')](loggerCatch(_0x3064('0xf8')));if(_0x26450e[_0x3064('0xe6')]+_0x26450e[_0x3064('0xf9')]+_0x26450e[_0x3064('0xe7')]+_0x26450e[_0x3064('0xfa')]+_0x26450e['countdropretry']+_0x26450e[_0x3064('0xe9')]+_0x26450e[_0x3064('0xe4')]+_0x26450e[_0x3064('0xfb')]>=_0x1394f8['dialGlobalMaxRetry']){_0x286a18[_0x3064('0xeb')](_0x26450e,_0x40af51,_0x5e65f9,_0x3064('0xec'));}else{if(_0x26450e[_0x3064('0xe4')]>=_0x1394f8[_0x3064('0xfc')]){_0x286a18['createStateFinal'](_0x26450e,_0x40af51,_0x5e65f9,_0x3064('0xee'));}else{_0x286a18[_0x3064('0xc0')]({'active':![],'countmachineretry':_0x26450e['countmachineretry'],'scheduledat':moment()[_0x3064('0xef')](_0x1394f8[_0x3064('0xfd')],_0x3064('0xf0'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x26450e[_0x3064('0xce')],'ListId':_0x26450e['ListId'],'VoiceQueueId':_0x26450e[_0x3064('0xd0')]||undefined,'CampaignId':_0x26450e[_0x3064('0xd1')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x40af51({'reschedule':0x1});}}});}}};Dialer[_0x3064('0x1b')][_0x3064('0x34')]=function(_0x106b83){var _0x5a3fa1=this[_0x3064('0x26')][_0x106b83[_0x3064('0xf3')]];var _0x1e8579=this;var _0x43b0c7;if(_0x5a3fa1&&_0x5a3fa1[_0x3064('0x4c')]===_0x3064('0x78')){delete this[_0x3064('0x26')][_0x106b83[_0x3064('0xf3')]];this[_0x3064('0xb5')](this[_0x3064('0x21')][_0x5a3fa1[_0x3064('0xb6')]]);this[_0x3064('0x21')][_0x5a3fa1['queue']][_0x3064('0xfe')]+=0x1;_0x43b0c7=new Hangup(_0x5a3fa1,_0x106b83);this[_0x3064('0xc8')](_0x43b0c7)[_0x3064('0xb3')](loggerCatch(_0x3064('0xff')));this[_0x3064('0xc7')](_0x43b0c7)[_0x3064('0xb3')](loggerCatch('[syncHangupIvr]'));}if(_0x5a3fa1&&_0x5a3fa1['type']!==_0x3064('0x78')&&isNotNull(this[_0x3064('0x20')][_0x5a3fa1[_0x3064('0xb6')]][_0x3064('0x100')])){delete this['uniqueId'][_0x106b83[_0x3064('0xf3')]];this[_0x3064('0xb5')](this[_0x3064('0x20')][_0x5a3fa1[_0x3064('0xb6')]]);this[_0x3064('0x20')][_0x5a3fa1['queue']][_0x3064('0xf7')]+=0x1;this['voiceQueues'][_0x5a3fa1[_0x3064('0xb6')]][_0x3064('0x5c')]+=0x1;_0x43b0c7=new Hangup(_0x5a3fa1,_0x106b83);_0x43b0c7['state']=0x10;_0x43b0c7[_0x3064('0xa8')]=_0x3064('0x101');_0x43b0c7[_0x3064('0xdd')]='AGI';this['createHistory'](_0x43b0c7)[_0x3064('0xb3')](loggerCatch(_0x3064('0xff')));this[_0x3064('0xc7')](_0x43b0c7)[_0x3064('0xb3')](loggerCatch(_0x3064('0x102')));}if(_0x5a3fa1&&_0x5a3fa1[_0x3064('0x4c')]!==_0x3064('0x78')&&!isNotNull(this[_0x3064('0x20')][_0x5a3fa1[_0x3064('0xb6')]]['dialQueueProject'])){delete this[_0x3064('0x26')][_0x106b83[_0x3064('0xf3')]];this[_0x3064('0xb5')](this[_0x3064('0x20')][_0x5a3fa1['queue']]);this['voiceQueues'][_0x5a3fa1[_0x3064('0xb6')]][_0x3064('0x65')]+=0x1;_0x43b0c7=new Hangup(_0x5a3fa1,_0x106b83);_0x43b0c7[_0x3064('0xa7')]=0xc;_0x43b0c7['statedesc']=_0x106b83[_0x3064('0x103')];_0x43b0c7[_0x3064('0xdd')]=_0x3064('0x104');this[_0x3064('0xc8')](_0x43b0c7)[_0x3064('0xb3')](loggerCatch(_0x3064('0xff')));this[_0x3064('0xc7')](_0x43b0c7)[_0x3064('0xb3')](loggerCatch(_0x3064('0x102')));}};Dialer[_0x3064('0x1b')][_0x3064('0x31')]=function(_0x25f357){var _0x44f1a6=this['uniqueId'][_0x25f357['uniqueid']];var _0x4d8a7d=this;if(this[_0x3064('0x20')][_0x25f357[_0x3064('0xb6')]]){if(_0x44f1a6&&_0x44f1a6[_0x3064('0x4c')]!==_0x3064('0x78')){delete this[_0x3064('0x26')][_0x25f357['uniqueid']];this[_0x3064('0x20')][_0x25f357[_0x3064('0xb6')]][_0x3064('0xf7')]+=0x1;var _0x220fc1=new AgentComplete(_0x44f1a6,_0x25f357);if(_0x25f357['reason']===_0x3064('0x105')){_0x220fc1[_0x3064('0x106')]=this[_0x3064('0x20')][_0x25f357[_0x3064('0xb6')]][_0x3064('0x107')]&&this[_0x3064('0x20')][_0x25f357['queue']][_0x3064('0x108')]?moment()[_0x3064('0x75')](_0x3064('0xf1')):undefined;}this['createHistory'](_0x220fc1)['catch'](loggerCatch(_0x3064('0x109')));this[_0x3064('0xc7')](_0x220fc1)[_0x3064('0xb3')](loggerCatch(_0x3064('0x10a')));}}};Dialer[_0x3064('0x1b')][_0x3064('0x2d')]=function(_0x15c7db){if(this['voiceQueues'][_0x15c7db[_0x3064('0xb6')]]){if(this[_0x3064('0x26')][_0x15c7db[_0x3064('0xf3')]]&&this['uniqueId'][_0x15c7db[_0x3064('0xf3')]][_0x3064('0x4c')]!==_0x3064('0x78')){this[_0x3064('0xb5')](this[_0x3064('0x20')][_0x15c7db['queue']]);this[_0x3064('0x26')][_0x15c7db['uniqueid']][_0x3064('0x10b')]=moment()[_0x3064('0x75')](_0x3064('0xf1'));}}};Dialer[_0x3064('0x1b')]['queueCallerAbandonCreateState']=function(_0x372972){this[_0x3064('0xc8')](_0x372972)[_0x3064('0xb3')](loggerCatch(_0x3064('0x109')));this['moveContactManagedDialer'](_0x372972)[_0x3064('0xb3')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x3064('0x1b')][_0x3064('0x2f')]=function(_0x296983){var _0x31d0ed=this['uniqueId'][_0x296983[_0x3064('0xf3')]];var _0x40f6a6=this;if(this['voiceQueues'][_0x296983['queue']]){if(_0x31d0ed&&_0x31d0ed[_0x3064('0x4c')]!==_0x3064('0x78')){delete this[_0x3064('0x26')][_0x296983[_0x3064('0xf3')]];this[_0x3064('0xb5')](this[_0x3064('0x20')][_0x296983[_0x3064('0xb6')]]);_0x31d0ed[_0x3064('0x10c')]=moment()[_0x3064('0x75')](_0x3064('0xf1'));var _0x1df75a=new QueueCallerAbandon(_0x31d0ed,_0x296983);if(getSeconds(_0x31d0ed[_0x3064('0x10c')],_0x31d0ed[_0x3064('0x10d')])>=_0x31d0ed[_0x3064('0x10e')]){this[_0x3064('0x20')][_0x296983['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x3064('0x20')][_0x296983[_0x3064('0xb6')]][_0x3064('0x61')]+=0x1;this['voiceQueues'][_0x296983[_0x3064('0xb6')]][_0x3064('0x6c')]+=0x1;_0x1df75a[_0x3064('0xa7')]=0xa;_0x1df75a[_0x3064('0xa8')]='Drop';_0x1df75a[_0x3064('0x10f')]='TIMEOUT';_0x1df75a[_0x3064('0x106')]=this[_0x3064('0x20')][_0x296983[_0x3064('0xb6')]]['dialQueueProject2']?moment()[_0x3064('0x75')](_0x3064('0xf1')):undefined;_0x1df75a['countdropretry']+=0x1;_0x1df75a[_0x3064('0x110')]+=0x1;if(_0x1df75a['countdropretry']>=this[_0x3064('0x20')][_0x296983[_0x3064('0xb6')]][_0x3064('0x111')]){this['queueCallerAbandonCreateState'](_0x1df75a);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x1df75a['countdropretry'],'scheduledat':moment()[_0x3064('0xef')](this[_0x3064('0x20')][_0x296983[_0x3064('0xb6')]][_0x3064('0x112')],'minutes')[_0x3064('0x75')](_0x3064('0xf1')),'ContactId':_0x31d0ed['ContactId'],'ListId':_0x31d0ed[_0x3064('0x113')],'VoiceQueueId':_0x31d0ed[_0x3064('0xd0')]||undefined,'CampaignId':_0x31d0ed[_0x3064('0xd1')]||undefined})[_0x3064('0xb3')](loggerCatch(_0x3064('0x114')));var _0x4d973f=new History(_0x1df75a);_0x4d973f['state']=0xa;_0x4d973f['statedesc']=_0x3064('0x115');_0x4d973f[_0x3064('0x116')]=moment()[_0x3064('0x75')](_0x3064('0xf1'));_0x4d973f[_0x3064('0xa9')]=_0x4d973f[_0x3064('0x116')];_0x4d973f[_0x3064('0x117')]=_0x1df75a[_0x3064('0x117')];_0x4d973f['calleridnum']=_0x1df75a[_0x3064('0x118')];this[_0x3064('0xc8')](_0x4d973f)['catch'](loggerCatch(_0x3064('0x119')));}}else{this[_0x3064('0x20')][_0x296983[_0x3064('0xb6')]][_0x3064('0x69')]+=0x1;this[_0x3064('0x20')][_0x296983[_0x3064('0xb6')]][_0x3064('0x60')]+=0x1;_0x1df75a[_0x3064('0xa7')]=0xb;_0x1df75a[_0x3064('0xa8')]=_0x3064('0x11a');_0x1df75a[_0x3064('0x10f')]=_0x3064('0x11b');_0x1df75a[_0x3064('0xe9')]+=0x1;_0x1df75a[_0x3064('0x110')]+=0x1;if(_0x1df75a[_0x3064('0xe9')]>=this[_0x3064('0x20')][_0x296983[_0x3064('0xb6')]][_0x3064('0x11c')]){this[_0x3064('0x11d')](_0x1df75a);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x1df75a['countabandonedretry'],'scheduledat':moment()[_0x3064('0xef')](this[_0x3064('0x20')][_0x296983[_0x3064('0xb6')]][_0x3064('0x11e')],_0x3064('0xf0'))[_0x3064('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x31d0ed['ContactId'],'ListId':_0x31d0ed['ListId'],'VoiceQueueId':_0x31d0ed[_0x3064('0xd0')]||undefined,'CampaignId':_0x31d0ed[_0x3064('0xd1')]||undefined})['catch'](loggerCatch(_0x3064('0x11f')));var _0x4d973f=new History(_0x1df75a);_0x4d973f['state']=0xb;_0x4d973f[_0x3064('0xa8')]='Abandoned';_0x4d973f[_0x3064('0x116')]=moment()['format'](_0x3064('0xf1'));_0x4d973f[_0x3064('0xa9')]=_0x4d973f[_0x3064('0x116')];_0x4d973f['calleridname']=_0x1df75a['calleridname'];_0x4d973f[_0x3064('0x118')]=_0x1df75a[_0x3064('0x118')];this['createHistory'](_0x4d973f)[_0x3064('0xb3')](loggerCatch(_0x3064('0x120')));}}}}};Dialer[_0x3064('0x1b')][_0x3064('0x35')]=function(_0x232afc){if(this[_0x3064('0xad')][_0x232afc['uniqueid']]){this[_0x3064('0xad')][_0x232afc[_0x3064('0xf3')]][_0x3064('0x121')]=_0x232afc[_0x3064('0x121')];}if(this[_0x3064('0x26')][_0x232afc[_0x3064('0xf3')]]){this[_0x3064('0x26')][_0x232afc['uniqueid']][_0x3064('0x121')]=_0x232afc['channel'];}};Dialer[_0x3064('0x1b')][_0x3064('0x38')]=function(_0x44e275){if(strategy[this[_0x3064('0x20')][this[_0x3064('0xad')][_0x44e275['actionid']][_0x3064('0xb6')]]['strategy']]==='roundrobin'){if(this[_0x3064('0xad')][_0x44e275['actionid']]&&_[_0x3064('0xb0')](this[_0x3064('0xad')][_0x44e275['actionid']][_0x3064('0x122')])&&_0x44e275[_0x3064('0xb2')]==='1'&&_0x44e275[_0x3064('0x123')]==='0'){if(this[_0x3064('0x22')][_0x44e275[_0x3064('0x124')]]){if(!this[_0x3064('0x22')][_0x44e275[_0x3064('0x124')]][_0x3064('0x122')]){this[_0x3064('0x22')][_0x44e275[_0x3064('0x124')]][_0x3064('0x122')]=!![];this['actions'][_0x44e275['actionid']][_0x3064('0x122')]=!![];this['actions'][_0x44e275[_0x3064('0x125')]][_0x3064('0x124')]=_0x44e275[_0x3064('0x124')];}}}}else if((strategy[this['voiceQueues'][this[_0x3064('0xad')][_0x44e275[_0x3064('0x125')]][_0x3064('0xb6')]][_0x3064('0x4e')]]||_0x3064('0x19'))===_0x3064('0x19')){if(this[_0x3064('0xad')][_0x44e275['actionid']]){if(this[_0x3064('0x22')][_0x44e275[_0x3064('0x124')]]){this[_0x3064('0xad')][_0x44e275[_0x3064('0x125')]][_0x3064('0x124')]=_0x44e275[_0x3064('0x124')];if(_[_0x3064('0xb0')](this['queueBooked'][this[_0x3064('0xad')][_0x44e275[_0x3064('0x125')]]['queue']])){this[_0x3064('0x2b')][this['actions'][_0x44e275['actionid']][_0x3064('0xb6')]]=[];}this['queueBooked'][this[_0x3064('0xad')][_0x44e275[_0x3064('0x125')]][_0x3064('0xb6')]][_0x3064('0x126')](_[_0x3064('0x8b')](_['pick'](this[_0x3064('0xad')][_0x44e275[_0x3064('0x125')]],['idHopper',_0x3064('0x124')]),{'status':_0x44e275[_0x3064('0xb2')],'paused':_0x44e275['paused']}));}}}};function unlockQueueStatus(_0x3f6a41,_0x37105e){setTimeout(function(){if(_[_0x3064('0x3b')](_0x3f6a41[_0x3064('0x127')])){loggerBooked['error'](_0x3064('0x128'),_0x37105e);}_0x3f6a41[_0x3064('0x127')]=!![];loggerBooked[_0x3064('0x7a')](_0x3064('0x129'),_0x37105e,JSON[_0x3064('0x48')](_['pick'](_0x3f6a41,[_0x3064('0x3d'),_0x3064('0x127')])));},0x1f3);}Dialer[_0x3064('0x1b')][_0x3064('0x3a')]=function(_0x169fff){var _0x27a64f=this;var _0x368bd6=_0x27a64f[_0x3064('0x20')][_0x27a64f[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]][_0x3064('0xb6')]];if(strategy[this[_0x3064('0x20')][this['actions'][_0x169fff[_0x3064('0x125')]][_0x3064('0xb6')]][_0x3064('0x4e')]]==='roundrobin'){if(this[_0x3064('0xad')][_0x169fff['actionid']]&&this[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]][_0x3064('0x124')]){this[_0x3064('0x1f')]['run'](this[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]]['idHopper'],this['actions'][_0x169fff[_0x3064('0x125')]]['stateinterface'])[_0x3064('0xb3')](function(_0x1e3ed2){logger[_0x3064('0x93')](_0x3064('0x12a'),util['inspect'](_0x1e3ed2,{'showHidden':![],'depth':null}));})[_0x3064('0x12b')](function(){_0x27a64f[_0x3064('0xb5')](_0x27a64f[_0x3064('0x20')][_0x27a64f[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]][_0x3064('0xb6')]]);_0x27a64f['agents'][_0x27a64f[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]][_0x3064('0x124')]]['locked']=![];delete _0x27a64f[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]];unlockQueueStatus(_0x368bd6);});}else{this[_0x3064('0xb5')](this[_0x3064('0x20')][this['actions'][_0x169fff[_0x3064('0x125')]][_0x3064('0xb6')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x3064('0xad')][_0x169fff['actionid']][_0x3064('0xce')],'ListId':this[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]]['ListId'],'VoiceQueueId':this[_0x3064('0xad')][_0x169fff['actionid']][_0x3064('0xd0')]||undefined,'CampaignId':this['actions'][_0x169fff[_0x3064('0x125')]][_0x3064('0xd1')]||undefined})[_0x3064('0xb3')](loggerCatch(_0x3064('0x12c')));delete this[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]];unlockQueueStatus(_0x368bd6);}}else if((strategy[this[_0x3064('0x20')][this[_0x3064('0xad')][_0x169fff['actionid']]['queue']][_0x3064('0x4e')]]||_0x3064('0x19'))===_0x3064('0x19')){var _0x4d317d;if(this[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]]&&!_[_0x3064('0x79')](this['queueBooked'][this[_0x3064('0xad')][_0x169fff['actionid']]['queue']])){if(this[_0x3064('0x12d')][_0x27a64f[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]][_0x3064('0xb6')]]){this[_0x3064('0x12d')][_0x27a64f[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]]['queue']]=this['queueBookedRR'][this[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]]['queue']]?this[_0x3064('0x12d')][this[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]][_0x3064('0xb6')]]:this[_0x3064('0x2b')][this[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]][_0x3064('0xb6')]]?this['queueBooked'][this['actions'][_0x169fff[_0x3064('0x125')]][_0x3064('0xb6')]]['_rr']||0x0:0x0;}this['queueBooked'][this['actions'][_0x169fff[_0x3064('0x125')]][_0x3064('0xb6')]][_0x3064('0x12e')]=this[_0x3064('0x12d')][this[_0x3064('0xad')][_0x169fff[_0x3064('0x125')]][_0x3064('0xb6')]];for(var _0x804d13=0x0;_0x804d13=0x0?!![]:![];})[_0x3064('0xb3')](myreject(_0xab5aa4)));}}else{_0x2bd91f['push'](ami[_0x3064('0xb1')]({'action':'command','command':util[_0x3064('0x75')](_0x3064('0x146'),_0x43070b,!_[_0x3064('0x3b')](config[_0x3064('0x141')][_0x545300])?_0x545300:'')})[_0x3064('0xbb')](function(_0x58a77f){return _0x58a77f['content'][_0x3064('0x147')](_0x3064('0x148'))>=0x0?!![]:![];})[_0x3064('0xb3')](myreject(_0xab5aa4)));}BPromise[_0x3064('0x149')](_0x2bd91f)[_0x3064('0xbb')](function(_0x30970f){var _0x20a96e=_[_0x3064('0x14a')](_0x30970f);if(_0x20a96e){return _0x30075e(_0x20a96e);}else{_0x47bc12['message']=_0x14116f?_0x3064('0x14b'):_0x3064('0x14c');return _0xab5aa4(msgResponse(_0x3064('0x14d'),_0x3064('0x13e'),_0x3064('0x14e')+_0x14116f+'\x20'+_0x17e2a7+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x43070b,{'showHidden':![],'depth':null})+_0x3064('0x14f')+_0x545300));}})[_0x3064('0xb3')](function(_0xe096df){return _0xab5aa4(msgResponse(_0x3064('0x13c'),_0x3064('0x13e'),JSON[_0x3064('0x48')](_0xe096df)));});});};Dialer['prototype'][_0x3064('0x150')]=function(_0x42efbe){var _0x13cfcb=this;return function(){switch(_0x42efbe[_0x3064('0x151')]){case _0x3064('0x152'):freeVariablesPredictive(_0x42efbe);_0x13cfcb['handlePower'](_0x42efbe,0x1);break;case'power':freeVariablesPredictive(_0x42efbe);_0x13cfcb[_0x3064('0x153')](_0x42efbe,_0x42efbe[_0x3064('0x154')]);break;case'predictive':_0x13cfcb[_0x3064('0x155')](_0x42efbe);break;case'booked':freeVariablesPredictive(_0x42efbe);_0x13cfcb['handlePower'](_0x42efbe,0x1);break;default:freeVariablesPredictive(_0x42efbe);logger[_0x3064('0x93')](_0x3064('0x156'),_0x42efbe[_0x3064('0x3d')],'method\x20not\x20recognized');}};};Dialer['prototype'][_0x3064('0x157')]=function(_0x363e9c){var _0x380bda=this;return function(){_0x380bda[_0x3064('0x158')](_0x363e9c);};};Dialer[_0x3064('0x1b')][_0x3064('0x8')]=function(_0x16adb1){var _0x3a3528=this;if(isNotPreview(_0x16adb1[_0x3064('0x151')])){if(isVoiceQueueOutbound(_0x16adb1['type'])&&isActive(_0x16adb1[_0x3064('0x159')])){_0x16adb1[_0x3064('0xa0')]=!![];BPromise[_0x3064('0xb8')]()[_0x3064('0xbb')](checkIsLoggedIn(_0x16adb1,_0x16adb1[_0x3064('0x50')]))[_0x3064('0xbb')](checkIsActive(_0x16adb1,_0x16adb1[_0x3064('0x159')]))[_0x3064('0xbb')](checkInterval(_0x16adb1))[_0x3064('0xbb')](_0x3a3528[_0x3064('0x139')](_0x16adb1))[_0x3064('0xbb')](_0x3a3528[_0x3064('0x13b')](_0x16adb1['dialGlobalInterval'],_0x16adb1[_0x3064('0x15a')],_0x16adb1['name'],_0x16adb1))[_0x3064('0xbb')](_0x3a3528['checkIfTimeIntervals'](_0x16adb1[_0x3064('0x42')],_0x16adb1[_0x3064('0x15a')],_0x16adb1[_0x3064('0x3d')],_0x16adb1))[_0x3064('0xbb')](_0x3a3528['checkDialMethod'](_0x16adb1))[_0x3064('0xb3')](loggerCatchQueueSummary(_0x3064('0x15b'),_0x16adb1));}else{notSendMessagesQueue(_0x16adb1);}}else{freeVariablesPredictive(_0x16adb1);}};Dialer['prototype']['syncCampaigns']=function(){var _0x658ae9=this;var _0x1ec259;for(var _0x516f70 in this[_0x3064('0x21')]){if(this[_0x3064('0x21')]['hasOwnProperty'](_0x516f70)){_0x1ec259=this['campaigns'][_0x516f70];if(isCampaignIvr(_0x1ec259[_0x3064('0x4c')])&&isActive(_0x1ec259['active'])){_0x1ec259[_0x3064('0xa0')]=!![];BPromise['resolve']()[_0x3064('0xbb')](checkIsActive(_0x1ec259,_0x1ec259[_0x3064('0x72')]))['then'](checkInterval(_0x1ec259))[_0x3064('0xbb')](_0x658ae9['checkIsTrunkReachable'](_0x1ec259))[_0x3064('0xbb')](_0x658ae9[_0x3064('0x13b')](_0x1ec259[_0x3064('0x15c')],_0x1ec259['dialTimezone'],_0x1ec259[_0x3064('0x3d')],_0x1ec259))[_0x3064('0xbb')](_0x658ae9['checkIfTimeIntervals'](_0x1ec259[_0x3064('0x42')],_0x1ec259[_0x3064('0x15a')],_0x1ec259[_0x3064('0x3d')],_0x1ec259))[_0x3064('0xbb')](_0x658ae9[_0x3064('0x157')](_0x1ec259))[_0x3064('0xb3')](loggerCatchQueueSummary(_0x3064('0x15d'),_0x1ec259));}else{notSendMessagesCampaign(_0x1ec259);}}}};function getCallerIdRandom(_0x71381c,_0x3036e4){var _0x4b9480,_0x1c15b2,_0x46f8e3;if(_0x3036e4<=0x0){_0x3036e4=0x1;}_0x4b9480=new RegExp(_0x3064('0x15e')+_0x3036e4+'}$');_0x1c15b2=Math[_0x3064('0x15f')](0xa,_0x3036e4-0x1);_0x46f8e3=Math[_0x3064('0x15f')](0xa,_0x3036e4)-0x1;return util[_0x3064('0x75')]('%s',_['replace'](_0x71381c,_0x4b9480,_[_0x3064('0x160')](_0x1c15b2,_0x46f8e3)));}function extractCalleridName(_0x524926){var _0x202fb7=_0x524926[_0x3064('0x161')](/"(.*?)"/);return _0x202fb7?_0x202fb7[0x1]:_0x524926;}function extractCalleridNumber(_0xcea902){var _0x20c737=_0xcea902[_0x3064('0x161')](/<(.*?)>/);return _0x20c737?_0x20c737[0x1]:_0xcea902;}Dialer[_0x3064('0x1b')][_0x3064('0x162')]=function(_0x37fe70,_0xbcee5e){var _0x11a17=this;var _0x47d46e=uuid['v4']();this[_0x3064('0xad')][_0x47d46e]=new Action(_0x37fe70,_0xbcee5e,_0x47d46e);return new BPromise(function(_0xad4f98,_0x379833){if(_[_0x3064('0x3b')](_0x37fe70)&&_0x3064('0x163')!==typeof _0x37fe70){return _0x379833(msgResponse(_0x3064('0x164'),_0x3064('0x13e'),_0x3064('0x165')));}if(_[_0x3064('0x3b')](_0xbcee5e[_0x3064('0x166')][_0x3064('0x167')])||_0xbcee5e[_0x3064('0x166')][_0x3064('0x167')]===null){return _0x379833(msgResponse(_0x3064('0x164'),_0x3064('0x13e'),_0x3064('0x168')));}var _0x7e08ee={'XMD-CALLERID':_0x11a17[_0x3064('0xad')][_0x47d46e]['getCaller'](),'XMD-AGI':_0x37fe70[_0x3064('0x100')]?util[_0x3064('0x75')](_0x3064('0x169'),ipAgi,_0x37fe70[_0x3064('0x100')]):'NONE','XMD-AGIAFTER':_0x37fe70[_0x3064('0x107')]?util['format'](_0x3064('0x169'),ipAgi,_0x37fe70[_0x3064('0x107')]):_0x3064('0x16a'),'XMD-QUEUE':_0x37fe70[_0x3064('0x4c')]===_0x3064('0x4d')?util[_0x3064('0x75')]('\x22%s,%s%s,,,%s\x22',_0x37fe70[_0x3064('0x3d')],_0x37fe70[_0x3064('0x16b')]||'',_0x37fe70['dialAgiAfterHangupAgent']?'c':'',_0x37fe70[_0x3064('0x10e')]||0x3):_0x3064('0x16a'),'XMD-CONTACTID':_0xbcee5e[_0x3064('0xce')],'XMD-CDRTYPE':_0x3064('0x5'),'CALLERID(all)':_0x11a17[_0x3064('0xad')][_0x47d46e][_0x3064('0x16c')](),'XMD-AMD':_0x37fe70[_0x3064('0xe1')]?_0x3064('0x16d'):_0x3064('0x16a'),'XMD-DESTINATION':_0x3064('0x16e')};if(_0x37fe70[_0x3064('0xe1')]){_0x7e08ee[_0x3064('0x16f')]=_0x37fe70[_0x3064('0x170')]||0x9c4;_0x7e08ee[_0x3064('0x171')]=_0x37fe70['dialAMDGreeting']||0x5dc;_0x7e08ee['XMD-AMDAFTERGREETINGSILENCE']=_0x37fe70[_0x3064('0x172')]||0x320;_0x7e08ee['XMD-AMDTOTALANALYSISTIME']=_0x37fe70[_0x3064('0x173')]||0x1388;_0x7e08ee[_0x3064('0x174')]=_0x37fe70['dialAMDMinWordLength']||0x64;_0x7e08ee[_0x3064('0x175')]=_0x37fe70[_0x3064('0x176')]||0x32;_0x7e08ee['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x37fe70[_0x3064('0x177')]||0x3;_0x7e08ee[_0x3064('0x178')]=_0x37fe70[_0x3064('0x179')]||0x100;_0x7e08ee[_0x3064('0x17a')]=_0x37fe70[_0x3064('0x17b')]||0x1388;}if(_0x37fe70['type']===_0x3064('0x4d')){_0x7e08ee[_0x3064('0x17c')]=_0xbcee5e['VoiceQueueId'];}else{_0x7e08ee[_0x3064('0x17d')]=_0xbcee5e['CampaignId'];}for(var _0x57ce9d in _0xbcee5e['Contact']){if(_0xbcee5e['Contact'][_0x3064('0xaf')](_0x57ce9d)){if(isNotNull(_0xbcee5e[_0x3064('0x166')][_0x57ce9d])&&_0x57ce9d!=='id'&&_0x57ce9d!=='tags'&&_0x57ce9d!==_0x3064('0x17e')&&_0x57ce9d!=='updatedAt'){_0x7e08ee[util[_0x3064('0x75')]('%s%s',_0x3064('0x17f'),_['toUpper'](_0x57ce9d))]=_0xbcee5e[_0x3064('0x166')][_0x57ce9d];}}}var _0x1d282e=_0x11a17[_0x3064('0xd6')](_0x37fe70[_0x3064('0x71')])?getCallerId(_0x37fe70[_0x3064('0x71')][_0x3064('0x73')],_0x37fe70[_0x3064('0x180')],_0x37fe70[_0x3064('0x181')]>0x0?getCallerIdRandom(_0x37fe70[_0x3064('0x59')],_0x37fe70[_0x3064('0x181')]):_0x37fe70['dialOriginateCallerIdNumber']):getCallerId(_[_0x3064('0xb0')](_0x37fe70[_0x3064('0x182')])?_0x37fe70[_0x3064('0x71')][_0x3064('0x73')]:_0x37fe70[_0x3064('0x182')]['callerid'],_0x37fe70[_0x3064('0x180')],_0x37fe70[_0x3064('0x181')]>0x0?getCallerIdRandom(_0x37fe70[_0x3064('0x59')],_0x37fe70['dialRandomLastDigitCallerIdNumber']):_0x37fe70[_0x3064('0x59')]);if(_0x1d282e){_0x7e08ee[_0x3064('0x183')]=_0x11a17['actions'][_0x47d46e][_0x3064('0x184')]=extractCalleridName(_0x1d282e);_0x7e08ee[_0x3064('0x185')]=_0x11a17[_0x3064('0xad')][_0x47d46e][_0x3064('0x186')]=extractCalleridNumber(_0x1d282e);}return ami[_0x3064('0xb1')]({'actionid':_0x47d46e,'action':'originate','channel':_0x11a17['isTrunkReachable'](_0x37fe70['Trunk'])?util[_0x3064('0x75')]('SIP/%s/%s%s',_0x37fe70['Trunk'][_0x3064('0x3d')],isNotNull(_0x37fe70['dialPrefix'])?_0x37fe70[_0x3064('0x5b')][_0x3064('0x187')]()||'':'',_0x37fe70[_0x3064('0x188')]>0x0?_0xbcee5e['Contact'][_0x3064('0x167')][_0x3064('0x189')](_0x37fe70[_0x3064('0x188')]):_0xbcee5e['Contact'][_0x3064('0x167')]):util[_0x3064('0x75')]('SIP/%s/%s%s',_[_0x3064('0xb0')](_0x37fe70['TrunkBackup'])?_0x37fe70[_0x3064('0x71')][_0x3064('0x3d')]:_0x37fe70[_0x3064('0x182')][_0x3064('0x3d')],isNotNull(_0x37fe70[_0x3064('0x5b')])?_0x37fe70[_0x3064('0x5b')][_0x3064('0x187')]()||'':'',_0x37fe70[_0x3064('0x188')]>0x0?_0xbcee5e[_0x3064('0x166')][_0x3064('0x167')][_0x3064('0x189')](_0x37fe70[_0x3064('0x188')]):_0xbcee5e[_0x3064('0x166')][_0x3064('0x167')]),'callerid':_0x1d282e,'Exten':_0x3064('0x16e'),'Context':_0x3064('0x18a'),'Priority':'1','variable':_0x7e08ee,'timeout':(_0x37fe70[_0x3064('0x5a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x47d46e})[_0x3064('0xbb')](function(_0x1c0a5a){return _0xad4f98(_0x1c0a5a);})[_0x3064('0xb3')](function(_0x54d9b8){_0x37fe70[_0x3064('0x63')]+=0x1;var _0x5f0ce2=new History(_0x11a17[_0x3064('0xad')][_0x47d46e]);logger[_0x3064('0x93')](util[_0x3064('0x75')]('[originateError]:\x20%s',JSON['stringify'](_0x54d9b8)));_0x5f0ce2['state']=0xe;_0x5f0ce2[_0x3064('0xa8')]=_0x3064('0x18b');_0x5f0ce2[_0x3064('0x116')]=moment()[_0x3064('0x75')](_0x3064('0xf1'));_0x5f0ce2[_0x3064('0xa9')]=_0x5f0ce2[_0x3064('0x116')];_0x11a17[_0x3064('0xc8')](_0x5f0ce2)['catch'](loggerCatch(_0x3064('0x18c')));_0x11a17[_0x3064('0xc7')](_0x5f0ce2)['catch'](loggerCatch(_0x3064('0x18c')))[_0x3064('0x12b')](function(){delete _0x11a17[_0x3064('0xad')][_0x47d46e];return _0x379833(msgResponse(_0x3064('0x164'),_0x3064('0x47'),_0x3064('0x18d')));});});});};Dialer[_0x3064('0x1b')]['syncOriginateResponse']=function(_0x378a2f){var _0x24facb=this[_0x3064('0xad')][_0x378a2f[_0x3064('0x125')]];var _0x19f41f=this;if(_0x24facb){delete this['actions'][_0x378a2f['actionid']];_0x24facb[_0x3064('0x10d')]=moment()[_0x3064('0x75')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5e178b=_0x24facb['type']===_0x3064('0x78')?this[_0x3064('0x21')][_0x24facb[_0x3064('0xb6')]]:this['voiceQueues'][_0x24facb[_0x3064('0x18e')]()];if(!this[_0x3064('0xd4')](_0x378a2f[_0x3064('0x18f')])){this[_0x3064('0xb5')](_0x5e178b);return this[_0x3064('0x190')](_0x24facb,_0x5e178b,_0x378a2f)[_0x3064('0xbb')](function(_0xf7ec61){})[_0x3064('0xb3')](loggerCatch(_0x3064('0x191')));}else{this[_0x3064('0x26')][_0x378a2f[_0x3064('0xf3')]]=_0x24facb;}}};Dialer['prototype'][_0x3064('0x192')]=function(_0x32e369,_0x402f69,_0x58ed96){var _0x41e060=new History(_0x402f69);if(_0x41e060['countbusyretry']+_0x41e060[_0x3064('0xf9')]+_0x41e060[_0x3064('0xe7')]+_0x41e060['countnosuchnumberretry']+_0x41e060[_0x3064('0xe8')]+_0x41e060[_0x3064('0xe9')]+_0x41e060['countmachineretry']+_0x41e060[_0x3064('0xfb')]>=_0x58ed96[_0x3064('0xea')]-0x1){return!![];}switch(_0x32e369){case 0x3:if(_0x41e060['countnoanswerretry']>=_0x58ed96[_0x3064('0x193')]-0x1){return!![];}else{this[_0x3064('0xc0')]({'active':![],'countnoanswerretry':_0x41e060[_0x3064('0xe7')]+=0x1,'scheduledat':moment()[_0x3064('0xef')](_0x58ed96[_0x3064('0x194')],_0x3064('0xf0'))[_0x3064('0x75')](_0x3064('0xf1')),'ContactId':_0x41e060[_0x3064('0xce')],'ListId':_0x41e060[_0x3064('0x113')],'VoiceQueueId':_0x41e060[_0x3064('0xd0')]||undefined,'CampaignId':_0x41e060['CampaignId']||undefined})['catch'](loggerCatch(_0x3064('0x195')));}break;case 0x5:if(_0x41e060[_0x3064('0xe6')]>=_0x58ed96[_0x3064('0x196')]-0x1){return!![];}else{this[_0x3064('0xc0')]({'active':![],'countbusyretry':_0x41e060[_0x3064('0xe6')]+=0x1,'scheduledat':moment()[_0x3064('0xef')](_0x58ed96[_0x3064('0x197')],_0x3064('0xf0'))[_0x3064('0x75')](_0x3064('0xf1')),'ContactId':_0x41e060[_0x3064('0xce')],'ListId':_0x41e060['ListId'],'VoiceQueueId':_0x41e060[_0x3064('0xd0')]||undefined,'CampaignId':_0x41e060[_0x3064('0xd1')]||undefined})[_0x3064('0xb3')](loggerCatch(_0x3064('0x198')));}break;case 0x8:if(_0x41e060['countcongestionretry']>=_0x58ed96['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0x3064('0xc0')]({'active':![],'countcongestionretry':_0x41e060[_0x3064('0xf9')]+=0x1,'scheduledat':moment()[_0x3064('0xef')](_0x58ed96[_0x3064('0x199')],_0x3064('0xf0'))[_0x3064('0x75')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x41e060['ContactId'],'ListId':_0x41e060[_0x3064('0x113')],'VoiceQueueId':_0x41e060['VoiceQueueId']||undefined,'CampaignId':_0x41e060[_0x3064('0xd1')]||undefined})[_0x3064('0xb3')](loggerCatch(_0x3064('0x19a')));}break;case 0x0:if(_0x41e060[_0x3064('0xfa')]>=_0x58ed96[_0x3064('0x19b')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x41e060['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0x3064('0xef')](_0x58ed96['dialNoSuchNumberRetryFrequency'],_0x3064('0xf0'))[_0x3064('0x75')](_0x3064('0xf1')),'ContactId':_0x41e060[_0x3064('0xce')],'ListId':_0x41e060[_0x3064('0x113')],'VoiceQueueId':_0x41e060['VoiceQueueId']||undefined,'CampaignId':_0x41e060[_0x3064('0xd1')]||undefined})['catch'](loggerCatch(_0x3064('0x19c')));}break;case 0xa:if(_0x41e060[_0x3064('0xe8')]>=_0x58ed96[_0x3064('0x111')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countdropretry':_0x41e060['countdropretry']+=0x1,'scheduledat':moment()[_0x3064('0xef')](_0x58ed96[_0x3064('0x112')],_0x3064('0xf0'))['format'](_0x3064('0xf1')),'ContactId':_0x41e060['ContactId'],'ListId':_0x41e060[_0x3064('0x113')],'VoiceQueueId':_0x41e060[_0x3064('0xd0')]||undefined,'CampaignId':_0x41e060[_0x3064('0xd1')]||undefined})[_0x3064('0xb3')](loggerCatch('[rescheduleContact][Drop]'));}break;case 0xb:if(_0x41e060[_0x3064('0xe9')]>=_0x58ed96['dialAbandonedMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x41e060[_0x3064('0xe9')]+=0x1,'scheduledat':moment()[_0x3064('0xef')](_0x58ed96['dialAbandonedRetryFrequency'],_0x3064('0xf0'))['format'](_0x3064('0xf1')),'ContactId':_0x41e060[_0x3064('0xce')],'ListId':_0x41e060['ListId'],'VoiceQueueId':_0x41e060[_0x3064('0xd0')]||undefined,'CampaignId':_0x41e060[_0x3064('0xd1')]||undefined})[_0x3064('0xb3')](loggerCatch(_0x3064('0x11f')));}break;case 0x13:if(_0x41e060[_0x3064('0xe4')]>=_0x58ed96[_0x3064('0xfc')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countmachineretry':_0x41e060[_0x3064('0xe4')]+=0x1,'scheduledat':moment()[_0x3064('0xef')](_0x58ed96[_0x3064('0xfd')],_0x3064('0xf0'))[_0x3064('0x75')](_0x3064('0xf1')),'ContactId':_0x41e060[_0x3064('0xce')],'ListId':_0x41e060['ListId'],'VoiceQueueId':_0x41e060[_0x3064('0xd0')]||undefined,'CampaignId':_0x41e060['CampaignId']||undefined})[_0x3064('0xb3')](loggerCatch(_0x3064('0xf2')));}break;case 0x14:if(_0x41e060['countagentrejectretry']>=_0x58ed96[_0x3064('0x19d')]-0x1){return!![];}else{this[_0x3064('0xc0')]({'active':![],'countagentrejectretry':_0x41e060[_0x3064('0xfb')]+=0x1,'scheduledat':moment()[_0x3064('0xef')](_0x58ed96['dialAgentRejectRetryFrequency'],'minutes')[_0x3064('0x75')](_0x3064('0xf1')),'ContactId':_0x41e060['ContactId'],'ListId':_0x41e060[_0x3064('0x113')],'VoiceQueueId':_0x41e060['VoiceQueueId']||undefined,'CampaignId':_0x41e060['CampaignId']||undefined})[_0x3064('0xb3')](loggerCatch(_0x3064('0x19e')));}break;default:return!![];}};Dialer[_0x3064('0x1b')][_0x3064('0x190')]=function(_0x365ced,_0xf24571,_0x50162a){var _0x3d9b8e=this;var _0x469e39=new History(_0x365ced);return new BPromise(function(_0x5cdda0,_0x2d60a8){if(_['isUndefined'](_0xf24571)&&_0x3064('0x163')!==typeof _0xf24571){return _0x2d60a8(msgResponse(_0x3064('0x19f'),_0x3064('0x13e'),_0x3064('0x1a0')));}if(_[_0x3064('0x3b')](_0x50162a)&&_0x3064('0x163')!==typeof _0x50162a){return _0x2d60a8(msgResponse(_0x3064('0x19f'),_0x3064('0x13e'),_0x3064('0x1a1')));}switch(_0x50162a[_0x3064('0x1a2')]){case'0':_0xf24571[_0x3064('0x1a3')]+=0x1;_0x469e39[_0x3064('0xa7')]=0x0;_0x469e39[_0x3064('0xa8')]='NoSuchNumber';_0x469e39[_0x3064('0xfa')]+=0x1;_0x469e39[_0x3064('0x110')]+=0x1;ami[_0x3064('0x4b')](_0x3064('0x1a4'),ut[_0x3064('0x1a5')](_0x365ced,'nosuchnumber'));_0x3d9b8e[_0x3064('0xc8')](_0x469e39)[_0x3064('0xb3')](loggerCatch(_0x3064('0xf8')));if(_0x3d9b8e[_0x3064('0x192')](0x0,_0x365ced,_0xf24571)){if(_0x469e39[_0x3064('0xfa')]>=_0xf24571[_0x3064('0x19b')]){_0x3d9b8e['createStateFinal'](_0x469e39,_0x5cdda0,_0x2d60a8,_0x3064('0x1a6'));}else{_0x3d9b8e['stateGlobal'](_0x469e39,_0x5cdda0,_0x2d60a8,_0x3064('0x1a6'));}}break;case'3':_0xf24571['outboundNoAnswerCallsDay']+=0x1;_0x469e39[_0x3064('0xa7')]=0x3;_0x469e39[_0x3064('0xa8')]=_0x3064('0x1a7');_0x469e39[_0x3064('0xe7')]+=0x1;_0x469e39[_0x3064('0x110')]+=0x1;ami[_0x3064('0x4b')](_0x3064('0x1a8'),ut[_0x3064('0x1a5')](_0x365ced,_0x3064('0x1a9')));_0x3d9b8e['createHistory'](_0x469e39)[_0x3064('0xb3')](loggerCatch(_0x3064('0x1aa')));if(_0x3d9b8e[_0x3064('0x192')](0x3,_0x365ced,_0xf24571)){if(_0x469e39[_0x3064('0xe7')]>=_0xf24571['dialNoAnswerMaxRetry']){_0x3d9b8e['createStateFinal'](_0x469e39,_0x5cdda0,_0x2d60a8,_0x3064('0x1ab'));}else{_0x3d9b8e[_0x3064('0xeb')](_0x469e39,_0x5cdda0,_0x2d60a8,_0x3064('0x1ab'));}}break;case'5':_0xf24571[_0x3064('0x1ac')]+=0x1;_0x469e39['state']=0x5;_0x469e39[_0x3064('0xa8')]=_0x3064('0x1ad');_0x469e39[_0x3064('0xe6')]+=0x1;_0x469e39[_0x3064('0x110')]+=0x1;ami[_0x3064('0x4b')](_0x3064('0x1ae'),ut[_0x3064('0x1a5')](_0x365ced,_0x3064('0x1af')));_0x3d9b8e['createHistory'](_0x469e39)['catch'](loggerCatch(_0x3064('0x1b0')));if(_0x3d9b8e[_0x3064('0x192')](0x5,_0x365ced,_0xf24571)){if(_0x469e39[_0x3064('0xe6')]>=_0xf24571[_0x3064('0x196')]){_0x3d9b8e[_0x3064('0xed')](_0x469e39,_0x5cdda0,_0x2d60a8,_0x3064('0x1b1'));}else{_0x3d9b8e[_0x3064('0xeb')](_0x469e39,_0x5cdda0,_0x2d60a8,_0x3064('0x1b1'));}}break;case'8':_0xf24571['outboundCongestionCallsDay']+=0x1;_0x469e39[_0x3064('0xa7')]=0x8;_0x469e39[_0x3064('0xa8')]=_0x3064('0x1b2');_0x469e39[_0x3064('0xf9')]+=0x1;_0x469e39[_0x3064('0x110')]+=0x1;ami[_0x3064('0x4b')](_0x3064('0x1b3'),ut[_0x3064('0x1a5')](_0x365ced,_0x3064('0x1b4')));_0x3d9b8e[_0x3064('0xc8')](_0x469e39)['catch'](loggerCatch(_0x3064('0x1b5')));if(_0x3d9b8e[_0x3064('0x192')](0x8,_0x365ced,_0xf24571)){if(_0x469e39[_0x3064('0xf9')]>=_0xf24571[_0x3064('0x1b6')]){_0x3d9b8e[_0x3064('0xed')](_0x469e39,_0x5cdda0,_0x2d60a8,_0x3064('0x1b7'));}else{_0x3d9b8e['stateGlobal'](_0x469e39,_0x5cdda0,_0x2d60a8,_0x3064('0x1b7'));}}break;case'11':_0xf24571[_0x3064('0x1b8')]+=0x1;_0x469e39[_0x3064('0xa7')]=0xb;_0x469e39[_0x3064('0xa8')]='Abandoned';_0x469e39[_0x3064('0xe9')]+=0x1;_0x469e39[_0x3064('0x110')]+=0x1;_0x3d9b8e[_0x3064('0xc8')](_0x469e39)[_0x3064('0xb3')](loggerCatch(_0x3064('0x120')));if(_0x3d9b8e[_0x3064('0x192')](0xb,_0x365ced,_0xf24571)){if(_0x469e39['countabandonedretry']>=_0xf24571['dialAbandonedMaxRetry']){_0x3d9b8e[_0x3064('0xed')](_0x469e39,_0x5cdda0,_0x2d60a8,_0x3064('0x1b9'));}else{_0x3d9b8e['stateGlobal'](_0x469e39,_0x5cdda0,_0x2d60a8,_0x3064('0x1b9'));}}break;case'20':_0xf24571[_0x3064('0x64')]+=0x1;_0x469e39[_0x3064('0xa7')]=0x14;_0x469e39[_0x3064('0xa8')]=_0x3064('0x1ba');_0x469e39[_0x3064('0xfb')]+=0x1;_0x469e39[_0x3064('0x110')]+=0x1;ami[_0x3064('0x4b')](_0x3064('0x1bb'),ut[_0x3064('0x1a5')](_0x365ced,_0x3064('0x1bc')));_0x3d9b8e[_0x3064('0xc8')](_0x469e39)[_0x3064('0xb3')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x3d9b8e[_0x3064('0x192')](0x14,_0x365ced,_0xf24571)){if(_0x469e39[_0x3064('0xfb')]>=_0xf24571['dialAgentRejectMaxRetry']){_0x3d9b8e[_0x3064('0xed')](_0x469e39,_0x5cdda0,_0x2d60a8,_0x3064('0x1bd'));}else{_0x3d9b8e[_0x3064('0xeb')](_0x469e39,_0x5cdda0,_0x2d60a8,'reason\x2020\x20agentreject');}}break;default:_0xf24571[_0x3064('0x65')]+=0x1;_0x469e39[_0x3064('0xa7')]=0xc;_0x469e39[_0x3064('0xa8')]=_0x50162a[_0x3064('0x1a2')];_0x3d9b8e[_0x3064('0xc8')](_0x469e39)[_0x3064('0xb3')](loggerCatch(_0x3064('0x1be')));if(_0x3d9b8e[_0x3064('0x192')](_0x50162a[_0x3064('0x1a2')],_0x365ced,_0xf24571)){if(_0x469e39['countbusyretry']+_0x469e39[_0x3064('0xf9')]+_0x469e39[_0x3064('0xe7')]+_0x469e39[_0x3064('0xfa')]+_0x469e39[_0x3064('0xe8')]+_0x469e39[_0x3064('0xe9')]+_0x469e39[_0x3064('0xe4')]+_0x469e39[_0x3064('0xfb')]>=_0xf24571['dialGlobalMaxRetry']){_0x3d9b8e[_0x3064('0xeb')](_0x469e39,_0x5cdda0,_0x2d60a8,_0x50162a['reason']);}else{_0x3d9b8e[_0x3064('0xed')](_0x469e39,_0x5cdda0,_0x2d60a8,_0x50162a['reason']);}}}});};Dialer['prototype'][_0x3064('0xeb')]=function(_0x36c866,_0x3f0ea7,_0x74885b,_0x7892ae){var _0x5bd34a=new Final(_0x36c866);_0x5bd34a[_0x3064('0xa7')]=0xf;_0x5bd34a[_0x3064('0xa8')]=_0x3064('0x1bf');this[_0x3064('0xed')](_0x5bd34a,_0x3f0ea7,_0x74885b,_0x7892ae);};Dialer['prototype']['createStateFinal']=function(_0x287caa,_0x4aa42b,_0xb48f80,_0x22a26f){this[_0x3064('0xc7')](_0x287caa)[_0x3064('0xbb')](function(_0x3dca91){return _0x4aa42b(msgResponse(_0x3064('0x19f'),_0x3064('0xd5'),_0x22a26f));})[_0x3064('0xb3')](function(_0x306a8b){return _0xb48f80(msgResponse(_0x3064('0x1c0'),_0x3064('0x13e'),_0x3064('0x1c1')));});};Dialer['prototype'][_0x3064('0x155')]=function(_0x4c83a2){var _0x1b3f14=this;var _0x28a685=_0x4c83a2['dialPredictiveOptimizationPercentage']/0x64;var _0x42deb4=_0x4c83a2['outboundDropCallsDayTimeout']/(_0x4c83a2[_0x3064('0x61')]+_0x4c83a2['outboundAnswerCallsDay']);var _0x53b6d1=Math[_0x3064('0x1c2')](_0x4c83a2['predictiveIntervalAvailable']*(_0x4c83a2[_0x3064('0x1c3')]/0x64));var _0x57fdb6=Math['round'](_0x4c83a2['predictiveIntervalAvailable']*(_0x4c83a2[_0x3064('0x1c4')]/0x64));var _0x3b4eb5=_0x4c83a2[_0x3064('0x4f')]+_0x4c83a2[_0x3064('0x54')];var _0x2c0fb2=Math[_0x3064('0x1c5')](_0x4c83a2['erlangCalls']*_0x4c83a2[_0x3064('0x6f')]*_0x4c83a2['predictiveIntervalHitRate']*_0x4c83a2['predictiveIntervalMultiplicativeFactor']);if(_[_0x3064('0x3b')](_0x4c83a2['startProgressive'])){if(!_[_0x3064('0x3b')](_0x4c83a2[_0x3064('0x28')])){_0x4c83a2['startPredictive']=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x3064('0x3b')](_0x4c83a2['handlePredictive'])){loggerPredictive[_0x3064('0x93')](_0x3064('0x1c6'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4c83a2['handlePredictive']);_0x4c83a2['handlePredictive']=undefined;}_0x4c83a2[_0x3064('0x29')]=moment()[_0x3064('0x75')](_0x3064('0xf1'));loggerPredictive['info'](_0x4c83a2[_0x3064('0x3d')],'collection\x20data\x20in\x20progressive\x20at',_0x4c83a2[_0x3064('0x29')]);this[_0x3064('0x153')](_0x4c83a2,0x1);}else if(ifInterval(_0x4c83a2[_0x3064('0x1c7')],_0x4c83a2[_0x3064('0x29')])){this['handlePower'](_0x4c83a2,0x1);loggerPredictiveCalls[_0x3064('0x7a')](_0x3064('0x1c8'),_0x4c83a2['startProgressive'],_0x4c83a2[_0x3064('0x3d')]);_0x4c83a2[_0x3064('0x86')]=0x0;_0x4c83a2['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x28a685<_0x42deb4&&_0x4c83a2[_0x3064('0x1c9')]===_0x3064('0x1ca')){freeVariablesPredictive(_0x4c83a2);loggerPredictive[_0x3064('0x7a')](_0x3064('0x1cb'),_0x3064('0x1cc'),_0x42deb4,_0x3064('0x29'),_0x4c83a2[_0x3064('0x3d')]);}else if(_0x2c0fb2<_0x4c83a2[_0x3064('0x6c')]&&_0x4c83a2['dialPredictiveOptimization']===_0x3064('0x1ca')){freeVariablesPredictive(_0x4c83a2);loggerPredictive[_0x3064('0x7a')](_0x3064('0x1cd'),_0x3064('0x1ce'),_0x2c0fb2,'Drop\x20in\x20this\x20interval',_0x4c83a2[_0x3064('0x6c')],'startProgressive',_0x4c83a2[_0x3064('0x3d')]);}else if(!ifInterval(_0x4c83a2[_0x3064('0x1c7')],_0x4c83a2[_0x3064('0x29')])&&_[_0x3064('0x3b')](_0x4c83a2[_0x3064('0x28')])&&!_['isUndefined'](_0x4c83a2[_0x3064('0x29')])){_0x4c83a2[_0x3064('0x28')]=moment()[_0x3064('0x75')](_0x3064('0xf1'));loggerPredictive['info'](_0x4c83a2[_0x3064('0x3d')],'started\x20in\x20predictive\x20at',_0x4c83a2[_0x3064('0x28')]);this['averageHandleTime'](_0x4c83a2['dialPredictiveInterval'])[_0x3064('0xbb')](this[_0x3064('0x1cf')](_0x4c83a2))[_0x3064('0xbb')](mergeDataErlangB(_0x4c83a2))[_0x3064('0xbb')](this[_0x3064('0x1d0')](_0x4c83a2))[_0x3064('0xb3')](loggerCatchPredictive(_0x3064('0x1d1'),_0x4c83a2));}else if(!ifInterval(_0x4c83a2[_0x3064('0x1c7')],_0x4c83a2[_0x3064('0x28')])){_0x4c83a2[_0x3064('0x6c')]=0x0;_0x4c83a2[_0x3064('0x28')]=moment()[_0x3064('0x75')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x4c83a2[_0x3064('0x3d')],_0x3064('0x1d2'),_0x4c83a2[_0x3064('0x28')]);clearInterval(_0x4c83a2[_0x3064('0x8f')]);_0x4c83a2[_0x3064('0x8f')]=undefined;this[_0x3064('0xbe')](_0x4c83a2[_0x3064('0x1c7')])[_0x3064('0xbb')](this[_0x3064('0x1cf')](_0x4c83a2))[_0x3064('0xbb')](mergeDataErlangB(_0x4c83a2))[_0x3064('0xbb')](this['startMethodPredictive'](_0x4c83a2))[_0x3064('0xb3')](loggerCatchPredictive(_0x3064('0x1d3'),_0x4c83a2));}else if(_0x4c83a2[_0x3064('0x1d4')]&&_0x3b4eb5<_0x4c83a2[_0x3064('0x1d4')]-_0x57fdb6){freeVariablesPredictive(_0x4c83a2);loggerPredictive[_0x3064('0x7a')](_0x4c83a2['name'],_0x3064('0x1d5'),_0x3b4eb5,_0x3064('0x1d6'),_0x4c83a2['predictiveIntervalAvailable'],'-',_0x57fdb6,'=',_0x4c83a2[_0x3064('0x1d4')]-_0x57fdb6,')');}else if(_0x4c83a2[_0x3064('0x1d4')]&&_0x3b4eb5>_0x4c83a2[_0x3064('0x1d4')]+_0x53b6d1){freeVariablesPredictive(_0x4c83a2);loggerPredictive[_0x3064('0x7a')](_0x4c83a2[_0x3064('0x3d')],_0x3064('0x1d5'),_0x3b4eb5,')\x20are\x20more\x20than\x20threshold\x20(',_0x4c83a2[_0x3064('0x1d4')],'+',_0x53b6d1,'=',_0x4c83a2[_0x3064('0x1d4')]+_0x53b6d1,')');}};Dialer[_0x3064('0x1b')][_0x3064('0x1cf')]=function(_0x7690da){var _0x2b7209=this;return function(_0x4b32f7){return new BPromise(function(_0x39f4fc,_0x3a6d0d){_[_0x3064('0x8b')](_0x7690da,_0x4b32f7[0x0]);if(checkGetDataPredictive(_0x4b32f7[0x0])){var _0x463fb4=_0x7690da[_0x3064('0x1d4')]=_0x7690da['talking']+_0x7690da[_0x3064('0x4f')];var _0x550122=_0x7690da[_0x3064('0x1c7')]*0x3c;var _0x443210=_0x4b32f7[0x0][_0x3064('0x68')]+_0x4b32f7[0x0][_0x3064('0x67')];var _0x586e5a=(_0x4b32f7[0x0][_0x3064('0x66')]+_0x4b32f7[0x0][_0x3064('0x6a')]+_0x4b32f7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4b32f7[0x0][_0x3064('0x7d')];_0x7690da[_0x3064('0x1d7')]=_0x586e5a>0x0?_0x586e5a:0x1;switch(_0x7690da[_0x3064('0x1c9')]){case _0x3064('0x1ca'):var _0x49f2a5=_0x7690da[_0x3064('0x1d8')]/0x64;return _0x2b7209[_0x3064('0x1d9')](_0x463fb4,_0x550122,_0x443210,_0x586e5a,_0x49f2a5)[_0x3064('0xbb')](function(_0x184bfd){return _0x39f4fc(_0x184bfd);});case _0x3064('0x1da'):var _0x524419=_0x7690da[_0x3064('0x1d8')]/0x64;return _0x2b7209[_0x3064('0x1db')](_0x463fb4,_0x550122,_0x443210,_0x586e5a,_0x524419)[_0x3064('0xbb')](function(_0x347ce3){return _0x39f4fc(_0x347ce3);});default:return _0x3a6d0d(msgResponse(_0x3064('0x1dc'),_0x3064('0x13e'),_0x3064('0x1dd')));}}else{return _0x3a6d0d(msgResponse(_0x3064('0x1dc'),'Failure','check\x20failure'));}});};};Dialer[_0x3064('0x1b')]['getDataPredictiveOld']=function(_0x337f95){var _0x5b7046=this;return function(_0x18b3ba){return new BPromise(function(_0x4b0609,_0x3c7d75){_[_0x3064('0x8b')](_0x337f95,_0x18b3ba[0x0]);if(checkGetDataPredictive(_0x18b3ba[0x0])){loggerPredictive['info'](JSON[_0x3064('0x48')](_0x18b3ba[0x0]));if(_0x337f95[_0x3064('0x1c9')]===_0x3064('0x1ca')){return _0x5b7046['getVoiceQueueRtPauses'](_0x337f95['id'])['then'](function(_0x2ce65f){var _0x7e4c4b=_0x337f95[_0x3064('0x50')]-_0x2ce65f[0x0][_0x3064('0x1de')];var _0x4eecc6=_0x337f95[_0x3064('0x1c7')]*0x3c;var _0x3df28f=_0x18b3ba[0x0]['predictiveIntervalAvgTalktime']+_0x18b3ba[0x0][_0x3064('0x67')];var _0x147bef=(_0x18b3ba[0x0]['predictiveIntervalAnsweredCalls']+_0x18b3ba[0x0][_0x3064('0x6a')]+_0x18b3ba[0x0][_0x3064('0x69')])/_0x18b3ba[0x0][_0x3064('0x7d')];var _0x1942eb=_0x337f95[_0x3064('0x1d8')]/0x64;_0x337f95[_0x3064('0x6d')]=_0x2ce65f[0x0][_0x3064('0x1de')]||0x0;_0x337f95[_0x3064('0x1d7')]=_0x147bef>0x0?_0x147bef:0x1;return _0x5b7046[_0x3064('0x1d9')](_0x7e4c4b,_0x4eecc6,_0x3df28f,_0x147bef,_0x1942eb);})[_0x3064('0xbb')](function(_0x5aa928){return _0x4b0609(_0x5aa928);})['catch'](function(_0x4ce894){return _0x3c7d75(msgResponse(_0x3064('0x1df'),_0x3064('0x13e'),JSON[_0x3064('0x48')](_0x4ce894)));});}if(_0x337f95[_0x3064('0x1c9')]===_0x3064('0x1da')){return _0x5b7046['getVoiceQueueRtPauses'](_0x337f95['id'])[_0x3064('0xbb')](function(_0x252381){var _0x307fac=_0x337f95['loggedIn']-_0x252381[0x0][_0x3064('0x1de')];var _0x2e9ed3=_0x337f95[_0x3064('0x1c7')]*0x3c;var _0x2db26f=_0x18b3ba[0x0]['predictiveIntervalAvgTalktime']+_0x18b3ba[0x0][_0x3064('0x67')];var _0x4599ed=(_0x18b3ba[0x0][_0x3064('0x66')]+_0x18b3ba[0x0][_0x3064('0x6a')]+_0x18b3ba[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x18b3ba[0x0][_0x3064('0x7d')];var _0x41dc82=_0x337f95[_0x3064('0x1d8')]/0x64;_0x337f95[_0x3064('0x6d')]=_0x252381[0x0][_0x3064('0x1de')]||0x0;_0x337f95[_0x3064('0x1d7')]=_0x4599ed>0x0?_0x4599ed:0x1;return _0x5b7046[_0x3064('0x1db')](_0x307fac,_0x2e9ed3,_0x2db26f,_0x4599ed,_0x41dc82);})[_0x3064('0xbb')](function(_0x4c02a9){return _0x4b0609(_0x4c02a9);})[_0x3064('0xb3')](function(_0x1e67f1){return _0x3c7d75(msgResponse(_0x3064('0x1df'),_0x3064('0x13e'),JSON[_0x3064('0x48')](_0x1e67f1)));});}}else{return _0x3c7d75(msgResponse('[getDataPredictive]','Failure',_0x3064('0x1e0')));}});};};Dialer['prototype'][_0x3064('0x1d0')]=function(_0x417e96){var _0x3e3c6f=this;return function(){var _0x449918=0x0;var _0x1e62cd=Math[_0x3064('0x1c5')](_0x417e96[_0x3064('0x6e')]*0x3e8);if(_0x1e62cd>0x0){_0x1e62cd=_0x1e62cd<0x64?0x64:_0x1e62cd;loggerPredictive['info'](_0x417e96[_0x3064('0x3d')],_0x3064('0x1e1'),_0x1e62cd,_0x3064('0x8c'));_0x417e96[_0x3064('0x8f')]=setInterval(function(){_0x3e3c6f['handlePredictive'](_0x417e96);loggerPredictiveCalls['info'](_0x3064('0x1e2'),_0x449918+=0x1);},_0x1e62cd);}else{loggerPredictive[_0x3064('0x7a')](_0x417e96[_0x3064('0x3d')],_0x3064('0x1e3'));}};};Dialer[_0x3064('0x1b')][_0x3064('0x1e4')]=function(_0x1ba647,_0x388adb){var _0x1836e2=this;return function(_0x25335f){if(_['isEmpty'](_0x25335f)){if(_[_0x3064('0xb0')](_0x388adb['UserId'])||!_0x388adb[_0x3064('0x1e5')]){if(_0x1ba647[_0x3064('0x151')]===_0x3064('0x6')){_0x1ba647[_0x3064('0x127')]=_[_0x3064('0x3b')](_0x1ba647[_0x3064('0x127')])?!![]:_0x1ba647[_0x3064('0x127')];var _0x39cd85=uuid['v4']();_0x1836e2['actions'][_0x39cd85]=new Action(_0x1ba647,_0x388adb,_0x39cd85);loggerBooked[_0x3064('0x7a')](_0x3064('0x1e6'),_0x39cd85,_0x3064('0x1e7'),JSON[_0x3064('0x48')](_0x1ba647[_0x3064('0x127')]),_0x3064('0x1e8'),_0x1ba647[_0x3064('0x3d')]);if(_0x1ba647[_0x3064('0x127')]){_0x1ba647[_0x3064('0x127')]=![];_0x1836e2[_0x3064('0x2b')][_0x1836e2[_0x3064('0xad')][_0x39cd85][_0x3064('0xb6')]]=[];ami['Action']({'actionid':_0x39cd85,'action':'queuestatus','queue':_0x1ba647['name']})[_0x3064('0xb3')](function(_0x109722){_0x1836e2[_0x3064('0xb5')](_0x1ba647);_0x1836e2[_0x3064('0xc0')]({'active':![],'ContactId':_0x1836e2[_0x3064('0xad')][_0x39cd85][_0x3064('0xce')],'ListId':_0x1836e2[_0x3064('0xad')][_0x39cd85][_0x3064('0x113')],'VoiceQueueId':_0x1836e2[_0x3064('0xad')][_0x39cd85][_0x3064('0xd0')]||undefined,'CampaignId':_0x1836e2['actions'][_0x39cd85][_0x3064('0xd1')]||undefined})['catch'](loggerCatch(_0x3064('0x1e9')));delete _0x1836e2[_0x3064('0xad')][_0x39cd85];});}else{loggerBooked[_0x3064('0x7a')](_0x3064('0x1ea'),JSON[_0x3064('0x48')](_0x1ba647[_0x3064('0x127')]),'Queue:\x20',_0x1ba647[_0x3064('0x3d')]);_0x1836e2[_0x3064('0xb5')](_0x1ba647);_0x1836e2[_0x3064('0xc0')]({'active':![],'ContactId':_0x1836e2[_0x3064('0xad')][_0x39cd85][_0x3064('0xce')],'ListId':_0x1836e2['actions'][_0x39cd85][_0x3064('0x113')],'VoiceQueueId':_0x1836e2[_0x3064('0xad')][_0x39cd85][_0x3064('0xd0')]||undefined,'CampaignId':_0x1836e2[_0x3064('0xad')][_0x39cd85][_0x3064('0xd1')]||undefined})[_0x3064('0xb3')](loggerCatch(_0x3064('0x1e9')));delete _0x1836e2[_0x3064('0xad')][_0x39cd85];}}else{return _0x1836e2[_0x3064('0x162')](_0x1ba647,_0x388adb);}}else{if(getDiff(_0x388adb['scheduledat'])<_0x1ba647['dialRecallMeTimeout']*0x3c){if(_0x388adb[_0x3064('0x1eb')]&&!_0x388adb[_0x3064('0x1eb')][_0x3064('0x1ec')]){_0x1836e2['preview'][_0x3064('0x1ed')](_0x388adb['id'])['finally'](function(){_0x1836e2[_0x3064('0xb5')](_0x1ba647);});}else{_0x1836e2[_0x3064('0xc1')]({'active':![]},_0x388adb['id'],0x1)[_0x3064('0x12b')](function(){console[_0x3064('0x1ee')](_0x3064('0x1ef'));_0x1836e2[_0x3064('0xb5')](_0x1ba647);});}}else{_0x1ba647[_0x3064('0x1f0')]+=0x1;_0x1836e2[_0x3064('0xb5')](_0x1ba647);if(_0x1ba647[_0x3064('0x1f1')]){_0x1836e2[_0x3064('0xc0')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x388adb['ContactId'],'ListId':_0x388adb[_0x3064('0x113')],'VoiceQueueId':_0x388adb['VoiceQueueId']||undefined,'CampaignId':_0x388adb[_0x3064('0xd1')]||undefined})[_0x3064('0xb3')](loggerCatch(_0x3064('0x1f2')));_0x1836e2[_0x3064('0xc8')](createObjHistory(_0x1ba647,_0x388adb,_0x3064('0x1f3'),0x17,'RecallInQueue'))[_0x3064('0xb3')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x1836e2[_0x3064('0xd8')](createObjHistory(_0x1ba647,_0x388adb,_0x3064('0x1f4'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0x3064('0x1f5'));}}}}else{_0x1ba647['outboundBlacklistCallsDay']+=0x1;_0x1836e2[_0x3064('0xd8')](createObjHistory(_0x1ba647,_0x388adb,_0x3064('0x1f6'),0xd,_0x3064('0x1f7')),_0x3064('0x1f8'),_0x3064('0x1f9'));throw _0x3064('0x1fa');}};};Dialer[_0x3064('0x1b')]['handleIvr']=function(_0x46cbb0){var _0x1ecdaa=this;var _0xcd5d4d=[];var _0x34269d=_0x46cbb0[_0x3064('0x1fb')]-_0x46cbb0['originated']-_0x46cbb0['temp'];emitCampaignSummary(_0x46cbb0);if(_0x34269d>0x0){if(_0x34269d>this[_0x3064('0x24')]){_0x34269d=this[_0x3064('0x24')];}_0x46cbb0[_0x3064('0x1fc')]+=_0x34269d;this[_0x3064('0xc5')](_0x46cbb0['id'],_0x34269d,_0x46cbb0[_0x3064('0x1fd')])[_0x3064('0xbb')](function(_0x14b5ff){_0x46cbb0['temp']-=_0x34269d;_0x46cbb0[_0x3064('0x1fc')]=_0x46cbb0['temp']>0x0?_0x46cbb0['temp']:0x0;if(!checkContactEmpty(_0x14b5ff)){_0x46cbb0['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0x3064('0x7a')](_0x3064('0x1fe')+_0x46cbb0[_0x3064('0x3d')]);}else{_0x46cbb0['originated']+=_0x14b5ff['length'];_0x46cbb0['message']=_0x3064('0x1ff');for(var _0x19691c=0x0;_0x19691c<_0x14b5ff[_0x3064('0x96')];_0x19691c+=0x1){_0x46cbb0[_0x3064('0x200')]+=0x1;if(_[_0x3064('0xb0')](_0x14b5ff[_0x19691c])||_['isNil'](_0x14b5ff[_0x19691c][_0x3064('0x166')])||_['isNil'](_0x14b5ff[_0x19691c]['Contact'][_0x3064('0x167')])){_0x1ecdaa[_0x3064('0xcc')](_0x3064('0x201'),_0x46cbb0,_0x14b5ff[_0x19691c]);}else{_0x1ecdaa[_0x3064('0xbd')](_[_0x3064('0x135')](_0x14b5ff[_0x19691c],[_0x3064('0xd1'),_0x3064('0x202')]))['then'](_0x1ecdaa[_0x3064('0x1e4')](_0x46cbb0,_0x14b5ff[_0x19691c]))[_0x3064('0xb3')](_0x1ecdaa['loggerHandler'](_0x3064('0x203'),_0x46cbb0));}}}})[_0x3064('0xb3')](loggerGetContactDialer('[getContactCampaign2]',_0x46cbb0,_0x34269d));}};Dialer[_0x3064('0x1b')][_0x3064('0x153')]=function(_0x3028f9,_0x15becd){var _0x50b59c=this;var _0x496d9f=[];var _0x5df20e=_0x15becd>=0x1?_0x15becd:0x1;var _0x1ab32a=[];if(_0x3028f9['dialMethod']===_0x3064('0x6')){_0x5df20e=0x1;}var _0x10b5ac=Math[_0x3064('0x1c5')](_0x3028f9[_0x3064('0x4f')]*_0x5df20e)-_0x3028f9[_0x3064('0x97')]-_0x3028f9[_0x3064('0x1fc')];emitVoiceQueueSummary(_0x3028f9);if(_0x3028f9[_0x3064('0x204')]>0x0){var _0x4d4ef3=_0x3028f9[_0x3064('0x204')]-_0x3028f9[_0x3064('0x97')]-_0x3028f9[_0x3064('0x54')]-_0x3028f9[_0x3064('0x1fc')]-_0x3028f9[_0x3064('0xa1')];if(_0x10b5ac>_0x4d4ef3){_0x10b5ac=_0x4d4ef3;}}if(_0x10b5ac>0x0){if(_0x3028f9['dialMethod']==='booked'){_0x10b5ac=0x1;}if(_0x10b5ac>this['maxNumberOriginate']){_0x10b5ac=this[_0x3064('0x24')];}_0x3028f9['temp']+=_0x10b5ac;for(var _0x3b1cb3 in this[_0x3064('0x22')]){if(this[_0x3064('0x22')][_0x3064('0xaf')](_0x3b1cb3)){if(this[_0x3064('0x22')][_0x3b1cb3][_0x3064('0xa7')]==='not_inuse'&&this[_0x3064('0x22')][_0x3b1cb3]['status']===_0x3064('0xd7')){_0x496d9f[_0x3064('0x126')](this[_0x3064('0x22')][_0x3b1cb3]['id']);}}}this[_0x3064('0xc3')](_0x3028f9['id'],_0x496d9f,_0x10b5ac,_0x3028f9[_0x3064('0x1fd')])[_0x3064('0xbb')](function(_0x416f72){_0x3028f9[_0x3064('0x1fc')]-=_0x10b5ac;_0x3028f9[_0x3064('0x1fc')]=_0x3028f9[_0x3064('0x1fc')]>0x0?_0x3028f9[_0x3064('0x1fc')]:0x0;if(!checkContactEmpty(_0x416f72)){_0x50b59c[_0x3064('0xb7')](_0x3028f9)[_0x3064('0xbb')](sendMessageReschedule(_0x3028f9))[_0x3064('0xb3')](loggerCatch('[countReScheduled]\x20'));}else{_0x3028f9[_0x3064('0x97')]+=_0x416f72[_0x3064('0x96')];_0x3028f9[_0x3064('0x3f')]=_0x3028f9[_0x3064('0x151')]===_0x3064('0x6')?_0x3064('0x16d'):_0x3064('0x1ff');for(var _0x3cb9bd=0x0;_0x3cb9bd<_0x416f72['length'];_0x3cb9bd+=0x1){if(_[_0x3064('0xb0')](_0x416f72[_0x3cb9bd])||_['isNil'](_0x416f72[_0x3cb9bd][_0x3064('0x166')])||_['isNil'](_0x416f72[_0x3cb9bd][_0x3064('0x166')][_0x3064('0x167')])){_0x50b59c[_0x3064('0xcc')](_0x3064('0x201'),_0x3028f9,_0x416f72[_0x3cb9bd]);}else{_0x50b59c[_0x3064('0xba')](_['pick'](_0x416f72[_0x3cb9bd],[_0x3064('0xd0'),_0x3064('0x202')]))[_0x3064('0xbb')](_0x50b59c[_0x3064('0x1e4')](_0x3028f9,_0x416f72[_0x3cb9bd]))['catch'](_0x50b59c['loggerHandler'](_0x3064('0x201'),_0x3028f9));}}}})[_0x3064('0xb3')](loggerGetContactDialer(_0x3064('0x205'),_0x3028f9,_0x10b5ac));}};Dialer[_0x3064('0x1b')][_0x3064('0x8f')]=function(_0x32c5d4){var _0x2aa132=this;if(_0x32c5d4[_0x3064('0x204')]>0x0){var _0x56930a=_0x32c5d4[_0x3064('0x204')]-_0x32c5d4[_0x3064('0x97')]-_0x32c5d4[_0x3064('0x54')];if(_0x56930a>0x0){this['tryOriginatePredictive'](_0x32c5d4);}else{loggerPredictiveCalls[_0x3064('0x7a')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x32c5d4);}};Dialer[_0x3064('0x1b')][_0x3064('0x206')]=function(_0x5e6d7d){var _0x4d5545=this;var _0xbe5dd=[];_0x5e6d7d[_0x3064('0x97')]+=0x1;for(var _0x349f9b in this[_0x3064('0x22')]){if(this[_0x3064('0x22')][_0x3064('0xaf')](_0x349f9b)){if(this[_0x3064('0x22')][_0x349f9b][_0x3064('0xa7')]===_0x3064('0x207')&&this[_0x3064('0x22')][_0x349f9b]['status']===_0x3064('0xd7')){_0xbe5dd[_0x3064('0x126')](this[_0x3064('0x22')][_0x349f9b]['id']);}}}this[_0x3064('0xc3')](_0x5e6d7d['id'],_0xbe5dd,0x1,_0x5e6d7d[_0x3064('0x1fd')])['then'](function(_0x16e15a){if(!checkContactEmpty(_0x16e15a)){checkContactLowerLimitOriginate(_0x5e6d7d,0x1,0x0);_0x4d5545['countReScheduled'](_0x5e6d7d)[_0x3064('0xbb')](sendMessageReschedule(_0x5e6d7d))[_0x3064('0xb3')](loggerCatch(_0x3064('0xb9')));}else{_0x5e6d7d[_0x3064('0x3f')]=_0x3064('0x1ff');if(_[_0x3064('0xb0')](_0x16e15a[0x0])||_[_0x3064('0xb0')](_0x16e15a[0x0]['Contact'])||_['isNil'](_0x16e15a[0x0][_0x3064('0x166')][_0x3064('0x167')])){_0x4d5545[_0x3064('0xcc')](_0x3064('0x201'),_0x5e6d7d,_0x16e15a[0x0]);}else{_0x4d5545[_0x3064('0xba')](_[_0x3064('0x135')](_0x16e15a[0x0],[_0x3064('0xd0'),_0x3064('0x202')]))[_0x3064('0xbb')](_0x4d5545['checkContactBlack'](_0x5e6d7d,_0x16e15a[0x0]))[_0x3064('0xb3')](_0x4d5545['loggerHandler'](_0x3064('0x208'),_0x5e6d7d));}}})[_0x3064('0xb3')](loggerGetContactDialer(_0x3064('0x209'),_0x5e6d7d,0x1));emitVoiceQueueSummary(_0x5e6d7d);};Dialer['prototype'][_0x3064('0x1d9')]=function(_0x5cd95b,_0x52ec86,_0x500420,_0x16b6ca,_0x5e0f6f,_0x346bdb){loggerPredictive[_0x3064('0x7a')](_0x3064('0x20a'));loggerPredictive[_0x3064('0x7a')](_0x3064('0x20b'),_0x5cd95b);loggerPredictive[_0x3064('0x7a')](_0x3064('0x20c'),_0x52ec86);loggerPredictive[_0x3064('0x7a')](_0x3064('0x20d'),_0x500420);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x16b6ca);loggerPredictive[_0x3064('0x7a')](_0x3064('0x20e'),_0x5e0f6f);loggerPredictive[_0x3064('0x7a')](_0x3064('0x8a'));return new BPromise(function(_0x9cf31,_0xa61f4b){if(_0x5cd95b<=0x0||isNaN(_0x5cd95b)){return _0xa61f4b(msgResponse('[abandonmentRate]',_0x3064('0x47'),_0x3064('0x20f')+_0x5cd95b));}if(_0x500420<=0x0||isNaN(_0x500420)){return _0xa61f4b(msgResponse(_0x3064('0x210'),_0x3064('0x47'),_0x3064('0x211')+_0x500420));}if(_0x16b6ca<=0x0||isNaN(_0x16b6ca)){return _0xa61f4b(msgResponse('[abandonmentRate]','Error',_0x3064('0x212')+_0x16b6ca));}if(_0x52ec86<=0x0||isNaN(_0x52ec86)){return _0xa61f4b(msgResponse('[abandonmentRate]',_0x3064('0x47'),_0x3064('0x213')+_0x52ec86));}if(_0x5e0f6f<=0x0||isNaN(_0x5e0f6f)){return _0xa61f4b(msgResponse(_0x3064('0x210'),_0x3064('0x47'),'Amax\x20=\x20'+_0x5e0f6f));}_0x346bdb=_0x346bdb||0x0;var _0x3655dc=0x1/_0x500420;var _0x3ecbe8=0x0;var _0xd9d196=0x0;var _0x1c0441=0x0;var _0x5e026f=0x0;for(var _0x3e0916=0x0;_0x1c0441<_0x5e0f6f;_0x3e0916+=0x1){_0xd9d196=_0x3e0916/_0x52ec86;_0x3ecbe8=(_0x16b6ca*_0xd9d196+_0x346bdb)/_0x3655dc;_0x1c0441=erlangb(_0x3ecbe8,_0x5cd95b);_0x5e026f=_0x3ecbe8/_0x5cd95b*(0x1-erlangb(_0x3ecbe8,_0x5cd95b));}return _0x9cf31({'erlangCalls':_0x3e0916,'erlangCallToSecond':_0x52ec86/_0x3e0916,'erlangAbandonmentRate':_0x1c0441,'erlangBusyFactor':_0x5e026f});});};Dialer[_0x3064('0x1b')][_0x3064('0x1db')]=function(_0x47e93c,_0x2afb70,_0x226c0c,_0x43c77f,_0x3dc8fb,_0x1854b4){loggerPredictive['info'](_0x3064('0x214'));loggerPredictive[_0x3064('0x7a')]('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',_0x47e93c);loggerPredictive['info'](_0x3064('0x20c'),_0x2afb70);loggerPredictive[_0x3064('0x7a')](_0x3064('0x20d'),_0x226c0c);loggerPredictive[_0x3064('0x7a')](_0x3064('0x215'),_0x43c77f);loggerPredictive[_0x3064('0x7a')](_0x3064('0x216'),_0x3dc8fb);loggerPredictive[_0x3064('0x7a')](_0x3064('0x8a'));return new BPromise(function(_0x256e3e,_0x18ea05){if(_0x47e93c<=0x0||isNaN(_0x47e93c)){return _0x18ea05(msgResponse(_0x3064('0x217'),'Error','m\x20=\x20'+_0x47e93c));}if(_0x226c0c<=0x0||isNaN(_0x226c0c)){return _0x18ea05(msgResponse(_0x3064('0x217'),'Error',_0x3064('0x211')+_0x226c0c));}if(_0x43c77f<=0x0||isNaN(_0x43c77f)){return _0x18ea05(msgResponse(_0x3064('0x217'),_0x3064('0x47'),_0x3064('0x212')+_0x43c77f));}if(_0x2afb70<=0x0||isNaN(_0x2afb70)){return _0x18ea05(msgResponse('[busyFactor]',_0x3064('0x47'),_0x3064('0x213')+_0x2afb70));}if(_0x3dc8fb<=0x0||isNaN(_0x3dc8fb)){return _0x18ea05(msgResponse('[busyFactor]',_0x3064('0x47'),_0x3064('0x218')+_0x3dc8fb));}_0x1854b4=_0x1854b4||0x0;var _0x347e40=0x1/_0x226c0c;var _0x187e7b=0x0;var _0x58117f=0x0;var _0x8646bb=0x0;var _0x113aac=0x0;for(var _0x4e0f10=0x0;_0x113aac<_0x3dc8fb;_0x4e0f10+=0x1){_0x58117f=_0x4e0f10/_0x2afb70;_0x187e7b=(_0x43c77f*_0x58117f+_0x1854b4)/_0x347e40;_0x8646bb=erlangb(_0x187e7b,_0x47e93c);_0x113aac=_0x187e7b/_0x47e93c*(0x1-erlangb(_0x187e7b,_0x47e93c));}return _0x256e3e({'erlangCalls':_0x4e0f10,'erlangCallToSecond':_0x2afb70/_0x4e0f10,'erlangAbandonmentRate':_0x8646bb,'erlangBusyFactor':_0x113aac});});};module[_0x3064('0x219')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 5735881..d49d681 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 _0x598b=['starttime','responsetime','endtime','ringtime','holdtime','droptime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number'];(function(_0x45af22,_0x15e0c7){var _0x2dc472=function(_0xa6a4a2){while(--_0xa6a4a2){_0x45af22['push'](_0x45af22['shift']());}};_0x2dc472(++_0x15e0c7);}(_0x598b,0x11e));var _0xb598=function(_0x18afaf,_0x2e65c3){_0x18afaf=_0x18afaf-0x0;var _0x28e323=_0x598b[_0x18afaf];return _0x28e323;};'use strict';var util=require(_0xb598('0x0'));var _=require('lodash');var moment=require(_0xb598('0x1'));function getSeconds(_0x17e30a,_0x1e3e60){var _0xea59b2=moment(_0x17e30a)['milliseconds'](0x0);var _0x53c11f=moment(_0x1e3e60)['milliseconds'](0x0);return _0xea59b2[_0xb598('0x2')](_0x53c11f,_0xb598('0x3'));}function QueueCallerAbandon(_0x72c4bf,_0x3b6e2c){this[_0xb598('0x4')]=_0x72c4bf[_0xb598('0x4')];this['type']=_0x72c4bf[_0xb598('0x5')];this[_0xb598('0x6')]=_0x72c4bf['type']===_0xb598('0x7')?_0xb598('0x8'):_0x72c4bf[_0xb598('0x5')];this[_0xb598('0x9')]=_0x72c4bf['countbusyretry'];this[_0xb598('0xa')]=_0x72c4bf[_0xb598('0xa')];this[_0xb598('0xb')]=_0x72c4bf[_0xb598('0xb')];this[_0xb598('0xc')]=_0x72c4bf['countbusyretry']+_0x72c4bf['countcongestionretry']+_0x72c4bf[_0xb598('0xb')]+_0x72c4bf[_0xb598('0xd')]+_0x72c4bf[_0xb598('0xe')]+_0x72c4bf[_0xb598('0xf')]+_0x72c4bf[_0xb598('0x10')]+_0x72c4bf[_0xb598('0x11')];this['countnosuchnumberretry']=_0x72c4bf[_0xb598('0xd')];this[_0xb598('0xe')]=_0x72c4bf[_0xb598('0xe')];this[_0xb598('0xf')]=_0x72c4bf[_0xb598('0xf')];this[_0xb598('0x10')]=_0x72c4bf[_0xb598('0x10')];this[_0xb598('0x11')]=_0x72c4bf['countagentrejectretry'];this[_0xb598('0x12')]=_0x3b6e2c[_0xb598('0x12')];this['calleridname']=_0x72c4bf[_0xb598('0x13')];this[_0xb598('0x14')]=_0x72c4bf[_0xb598('0x15')];this[_0xb598('0x16')]=_0x72c4bf[_0xb598('0x16')];this[_0xb598('0x17')]=_0x72c4bf[_0xb598('0x17')];this['droptime']=_0x72c4bf['droptime'];this[_0xb598('0x18')]=this['droptime'];this[_0xb598('0x19')]=getSeconds(_0x72c4bf['responsetime'],_0x72c4bf['starttime']);this[_0xb598('0x1a')]=getSeconds(this[_0xb598('0x1b')],_0x72c4bf[_0xb598('0x17')]);this[_0xb598('0x1c')]=0x0;this[_0xb598('0x8')]=_0x3b6e2c[_0xb598('0x8')];this[_0xb598('0x1d')]=_0x3b6e2c[_0xb598('0x1e')];this[_0xb598('0x1f')]=_0x3b6e2c['reason'];this[_0xb598('0x20')]=_0x72c4bf[_0xb598('0x20')];this['callbackuniqueid']=_0x72c4bf[_0xb598('0x21')];this[_0xb598('0x22')]=_0x72c4bf[_0xb598('0x22')];this[_0xb598('0x23')]=_0x72c4bf[_0xb598('0x23')];this['ContactId']=_0x72c4bf[_0xb598('0x24')];this[_0xb598('0x25')]=_0x72c4bf[_0xb598('0x25')];this[_0xb598('0x26')]=_0x72c4bf['UserId'];this[_0xb598('0x27')]=_0x72c4bf['VoiceQueueId'];this[_0xb598('0x28')]=_0x72c4bf[_0xb598('0x28')];this[_0xb598('0x29')]=_0x72c4bf[_0xb598('0x29')]||'';this[_0xb598('0x2a')]=_0x72c4bf['originatecalleridname']||'';}module[_0xb598('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0x072f=['responsetime','droptime','endtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','starttime'];(function(_0x1840a1,_0x3bb9cb){var _0x1f3b4f=function(_0x4a8ccf){while(--_0x4a8ccf){_0x1840a1['push'](_0x1840a1['shift']());}};_0x1f3b4f(++_0x3bb9cb);}(_0x072f,0xd5));var _0xf072=function(_0xec7a83,_0x3cd7d5){_0xec7a83=_0xec7a83-0x0;var _0x11a60d=_0x072f[_0xec7a83];return _0x11a60d;};'use strict';var util=require(_0xf072('0x0'));var _=require(_0xf072('0x1'));var moment=require(_0xf072('0x2'));function getSeconds(_0x30223d,_0x169a21){var _0x1cc35e=moment(_0x30223d)[_0xf072('0x3')](0x0);var _0x2701e2=moment(_0x169a21)[_0xf072('0x3')](0x0);return _0x1cc35e[_0xf072('0x4')](_0x2701e2,_0xf072('0x5'));}function QueueCallerAbandon(_0x2eb080,_0x36bbf4){this[_0xf072('0x6')]=_0x2eb080[_0xf072('0x6')];this['type']=_0x2eb080[_0xf072('0x7')];this['campaigntype']=_0x2eb080[_0xf072('0x7')]===_0xf072('0x8')?'queue':_0x2eb080['type'];this[_0xf072('0x9')]=_0x2eb080[_0xf072('0x9')];this[_0xf072('0xa')]=_0x2eb080[_0xf072('0xa')];this['countnoanswerretry']=_0x2eb080[_0xf072('0xb')];this[_0xf072('0xc')]=_0x2eb080[_0xf072('0x9')]+_0x2eb080['countcongestionretry']+_0x2eb080[_0xf072('0xb')]+_0x2eb080[_0xf072('0xd')]+_0x2eb080[_0xf072('0xe')]+_0x2eb080[_0xf072('0xf')]+_0x2eb080[_0xf072('0x10')]+_0x2eb080['countagentrejectretry'];this[_0xf072('0xd')]=_0x2eb080[_0xf072('0xd')];this[_0xf072('0xe')]=_0x2eb080[_0xf072('0xe')];this['countabandonedretry']=_0x2eb080[_0xf072('0xf')];this[_0xf072('0x10')]=_0x2eb080['countmachineretry'];this['countagentrejectretry']=_0x2eb080[_0xf072('0x11')];this['uniqueid']=_0x36bbf4[_0xf072('0x12')];this['calleridname']=_0x2eb080['name'];this[_0xf072('0x13')]=_0x2eb080['number'];this[_0xf072('0x14')]=_0x2eb080[_0xf072('0x14')];this['responsetime']=_0x2eb080[_0xf072('0x15')];this[_0xf072('0x16')]=_0x2eb080[_0xf072('0x16')];this[_0xf072('0x17')]=this[_0xf072('0x16')];this['ringtime']=getSeconds(_0x2eb080[_0xf072('0x15')],_0x2eb080['starttime']);this['holdtime']=getSeconds(this[_0xf072('0x16')],_0x2eb080[_0xf072('0x15')]);this[_0xf072('0x18')]=0x0;this[_0xf072('0x19')]=_0x36bbf4['queue'];this[_0xf072('0x1a')]=_0x36bbf4['connectedlinename'];this[_0xf072('0x1b')]=_0x36bbf4[_0xf072('0x1b')];this[_0xf072('0x1c')]=_0x2eb080[_0xf072('0x1c')];this['callbackuniqueid']=_0x2eb080[_0xf072('0x1d')];this['callbackat']=_0x2eb080[_0xf072('0x1e')];this[_0xf072('0x1f')]=_0x2eb080['recallme'];this['ContactId']=_0x2eb080[_0xf072('0x20')];this[_0xf072('0x21')]=_0x2eb080[_0xf072('0x21')];this['UserId']=_0x2eb080[_0xf072('0x22')];this[_0xf072('0x23')]=_0x2eb080[_0xf072('0x23')];this['CampaignId']=_0x2eb080[_0xf072('0x24')];this['originatecalleridnum']=_0x2eb080['originatecalleridnum']||'';this[_0xf072('0x25')]=_0x2eb080[_0xf072('0x25')]||'';}module[_0xf072('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 a5c1d81..e719107 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 _0x6c01=['channel','format','tech','Trunk','name','localstationid','headerinfo','path','AttachmentId','exports','util','lodash','moment','uniqueid'];(function(_0x15008d,_0x1a29b0){var _0x200973=function(_0x4f79a0){while(--_0x4f79a0){_0x15008d['push'](_0x15008d['shift']());}};_0x200973(++_0x1a29b0);}(_0x6c01,0x1f4));var _0x16c0=function(_0x33bcc4,_0x427ed6){_0x33bcc4=_0x33bcc4-0x0;var _0x43c3de=_0x6c01[_0x33bcc4];return _0x43c3de;};'use strict';var util=require(_0x16c0('0x0'));var _=require(_0x16c0('0x1'));var moment=require(_0x16c0('0x2'));function Action(_0x28137b,_0x348fe9,_0x754c97){this[_0x16c0('0x3')]=_0x28137b||undefined;this[_0x16c0('0x4')]=util[_0x16c0('0x5')]('%s/%s/%s',_0x348fe9[_0x16c0('0x6')],_0x348fe9[_0x16c0('0x7')][_0x16c0('0x8')],_0x754c97['fax']);this[_0x16c0('0x9')]=_0x348fe9[_0x16c0('0x9')];this[_0x16c0('0xa')]=_0x348fe9[_0x16c0('0xa')];this[_0x16c0('0xb')]=_0x754c97['path'];this['AttachmentId']=_0x754c97[_0x16c0('0xc')];}module[_0x16c0('0xd')]=Action; \ No newline at end of file +var _0xb7cf=['moment','uniqueid','Trunk','name','localstationid','headerinfo','path','AttachmentId','exports','util'];(function(_0x59deb8,_0x187197){var _0x570ea7=function(_0x4212f0){while(--_0x4212f0){_0x59deb8['push'](_0x59deb8['shift']());}};_0x570ea7(++_0x187197);}(_0xb7cf,0x1c1));var _0xfb7c=function(_0x448c09,_0x40cacc){_0x448c09=_0x448c09-0x0;var _0x3825cd=_0xb7cf[_0x448c09];return _0x3825cd;};'use strict';var util=require(_0xfb7c('0x0'));var _=require('lodash');var moment=require(_0xfb7c('0x1'));function Action(_0x3e97c6,_0x100de1,_0x5e5342){this[_0xfb7c('0x2')]=_0x3e97c6||undefined;this['channel']=util['format']('%s/%s/%s',_0x100de1['tech'],_0x100de1[_0xfb7c('0x3')][_0xfb7c('0x4')],_0x5e5342['fax']);this[_0xfb7c('0x5')]=_0x100de1[_0xfb7c('0x5')];this[_0xfb7c('0x6')]=_0x100de1['headerinfo'];this[_0xfb7c('0x7')]=_0x5e5342[_0xfb7c('0x7')];this[_0xfb7c('0x8')]=_0x5e5342[_0xfb7c('0x8')];}module[_0xfb7c('0x9')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 61b83ad..18b16cf 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 _0x97ab=['Action','variablesAction','addVariables','ext','isNil','active','format','SIP/%s','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','varset','bind','syncNewState','newexten','syncNewExten','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','syncNewchannel','context','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf','then','notify','.pdf','\x20notify\x20','error','\x20receiveFax\x20','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','catch','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','Trunk\x20Reachable','XMF-PATH','Convert\x20pdf\x20to\x20tif'];(function(_0x183a9b,_0x516021){var _0x4500c4=function(_0x3f291c){while(--_0x3f291c){_0x183a9b['push'](_0x183a9b['shift']());}};_0x4500c4(++_0x516021);}(_0x97ab,0x8f));var _0xb97a=function(_0x2034d3,_0x3fc9ea){_0x2034d3=_0x2034d3-0x0;var _0x208d5f=_0x97ab[_0x2034d3];return _0x208d5f;};'use strict';var util=require(_0xb97a('0x0'));var _=require(_0xb97a('0x1'));var BPromise=require(_0xb97a('0x2'));var uuid=require(_0xb97a('0x3'));var moment=require(_0xb97a('0x4'));var path=require(_0xb97a('0x5'));var tiff2pdf=require(_0xb97a('0x6'));var gs=require(_0xb97a('0x7'));var logger=require(_0xb97a('0x8'))(_0xb97a('0x9'));var ami=require(_0xb97a('0xa'));var rpcDb=require(_0xb97a('0xb'));var Channel=require(_0xb97a('0xc'));var ut=require(_0xb97a('0xd'));var Action=require(_0xb97a('0xe'));var faxAccount=require(_0xb97a('0xf'));var attachment=require(_0xb97a('0x10'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x51156c){this[_0xb97a('0x11')]={};this[_0xb97a('0x12')]=_0x51156c[_0xb97a('0x12')];this['trunks']=_0x51156c[_0xb97a('0x13')];this[_0xb97a('0x14')]={};ami['on'](_0xb97a('0x15'),this['syncNewchannel']['bind'](this));ami['on'](_0xb97a('0x16'),this['syncVarSet'][_0xb97a('0x17')](this));ami['on']('newstate',this[_0xb97a('0x18')]['bind'](this));ami['on'](_0xb97a('0x19'),this[_0xb97a('0x1a')][_0xb97a('0x17')](this));ami['on']('faxstatus',this['syncFaxStatus']['bind'](this));ami['on'](_0xb97a('0x1b'),this[_0xb97a('0x1c')][_0xb97a('0x17')](this));ami['on'](_0xb97a('0x1d'),this[_0xb97a('0x1e')][_0xb97a('0x17')](this));ami['on']('originateresponse',this[_0xb97a('0x1f')][_0xb97a('0x17')](this));}Fax[_0xb97a('0x20')][_0xb97a('0x21')]=function(_0x1c4a23){if(_0x1c4a23[_0xb97a('0x22')]==='from-voip-provider'){for(var _0x5db5c0 in this[_0xb97a('0x12')]){if(this[_0xb97a('0x12')][_0xb97a('0x23')](_0x5db5c0)){if(_0x1c4a23[_0xb97a('0x24')]===this[_0xb97a('0x12')][_0x5db5c0][_0xb97a('0x25')]){this[_0xb97a('0x11')][_0x1c4a23[_0xb97a('0x26')]]={};this[_0xb97a('0x11')][_0x1c4a23['uniqueid']]['channel']=_0x1c4a23[_0xb97a('0x27')];this['channels'][_0x1c4a23[_0xb97a('0x26')]]['id']=this[_0xb97a('0x12')][_0x5db5c0]['id'];this[_0xb97a('0x11')][_0x1c4a23['uniqueid']][_0xb97a('0x28')]=this[_0xb97a('0x12')][_0x5db5c0][_0xb97a('0x28')];logger[_0xb97a('0x29')](_0x1c4a23[_0xb97a('0x26')],'\x20syncNewchannel\x20');}}}}if(this['actions'][_0x1c4a23[_0xb97a('0x26')]]){this[_0xb97a('0x11')][_0x1c4a23[_0xb97a('0x26')]]={};this[_0xb97a('0x11')][_0x1c4a23['uniqueid']][_0xb97a('0x27')]=_0x1c4a23[_0xb97a('0x27')];logger[_0xb97a('0x29')](_0x1c4a23[_0xb97a('0x26')],_0xb97a('0x2a'));}};Fax[_0xb97a('0x20')][_0xb97a('0x2b')]=function(_0x2b917d){if(this[_0xb97a('0x11')][_0x2b917d[_0xb97a('0x26')]]){for(var _0x4b5271 in _0x2b917d[_0xb97a('0x2c')]){if(_0x2b917d[_0xb97a('0x2c')]['hasOwnProperty'](_0x4b5271)){this['channels'][_0x2b917d[_0xb97a('0x26')]][_0x4b5271]=_0x2b917d[_0xb97a('0x2d')];}}}};Fax[_0xb97a('0x20')][_0xb97a('0x18')]=function(_0x40bfef){if(this[_0xb97a('0x11')][_0x40bfef[_0xb97a('0x26')]]){this['channels'][_0x40bfef[_0xb97a('0x26')]]['channelstate']=_0x40bfef['channelstate'];this[_0xb97a('0x11')][_0x40bfef[_0xb97a('0x26')]][_0xb97a('0x2e')]=_0x40bfef[_0xb97a('0x2e')];}};Fax[_0xb97a('0x20')][_0xb97a('0x1a')]=function(_0x48736b){if(this[_0xb97a('0x11')][_0x48736b[_0xb97a('0x26')]]){for(var _0x307c5b in _0x48736b[_0xb97a('0x2c')]){if(_0x48736b['variable'][_0xb97a('0x23')](_0x307c5b)){this['channels'][_0x48736b[_0xb97a('0x26')]][_0x307c5b]=_0x48736b[_0xb97a('0x2d')];}}}};Fax[_0xb97a('0x20')][_0xb97a('0x2f')]=function(_0x319f8b){if(this[_0xb97a('0x11')][_0x319f8b[_0xb97a('0x26')]]){this[_0xb97a('0x11')][_0x319f8b[_0xb97a('0x26')]][_0xb97a('0x30')]=_0x319f8b[_0xb97a('0x30')];this[_0xb97a('0x11')][_0x319f8b['uniqueid']][_0xb97a('0x31')]=_0x319f8b['status'];this[_0xb97a('0x11')][_0x319f8b[_0xb97a('0x26')]][_0xb97a('0x25')]=_0x319f8b[_0xb97a('0x25')];this['channels'][_0x319f8b[_0xb97a('0x26')]][_0xb97a('0x32')]=_0x319f8b['filename'];logger['info'](_0x319f8b[_0xb97a('0x26')],_0xb97a('0x33'));}};Fax[_0xb97a('0x20')][_0xb97a('0x1c')]=function(_0x832272){var _0xc741e7=this;if(this[_0xb97a('0x11')][_0x832272[_0xb97a('0x26')]]){var _0x381d3c=this[_0xb97a('0x11')][_0x832272['uniqueid']]['id'];this[_0xb97a('0x11')][_0x832272[_0xb97a('0x26')]][_0xb97a('0x34')]=_0x832272[_0xb97a('0x34')];this['channels'][_0x832272[_0xb97a('0x26')]][_0xb97a('0x35')]=_0x832272[_0xb97a('0x35')];this[_0xb97a('0x11')][_0x832272[_0xb97a('0x26')]][_0xb97a('0x25')]=_0x832272[_0xb97a('0x25')];this['channels'][_0x832272[_0xb97a('0x26')]][_0xb97a('0x36')]=_0x832272[_0xb97a('0x36')];this[_0xb97a('0x11')][_0x832272[_0xb97a('0x26')]][_0xb97a('0x37')]=_0x832272['transferrate'];this[_0xb97a('0x11')][_0x832272[_0xb97a('0x26')]][_0xb97a('0x32')]=_0x832272['filename'];this[_0xb97a('0x11')][_0x832272['uniqueid']][_0xb97a('0x38')]=_0x832272['calleridnum'];if(this[_0xb97a('0x11')][_0x832272['uniqueid']][_0xb97a('0x35')]>0x0){tiff2pdf(_0x832272['filename'],_0xb97a('0x39'),function(_0x2051d8){logger['info'](_0x832272[_0xb97a('0x26')],_0xb97a('0x3a'),_0x2051d8[_0xb97a('0x3b')]);attachment[_0xb97a('0x3c')]({'name':path[_0xb97a('0x3d')](_0x832272[_0xb97a('0x32')])[_0xb97a('0x28')],'basename':path['parse'](_0x832272[_0xb97a('0x32')])['name']+'.pdf','type':_0xb97a('0x3e')})[_0xb97a('0x3f')](function(_0x3565fb){faxAccount[_0xb97a('0x40')](_0x381d3c,{'from':_0x832272['calleridnum'],'mapKey':'fax','body':path[_0xb97a('0x3d')](_0x832272[_0xb97a('0x32')])['name']+_0xb97a('0x41'),'AttachmentId':_0x3565fb['id']})['catch'](function(_0x2923c6){logger['error'](_0x832272[_0xb97a('0x26')],_0xb97a('0x42'),JSON['stringify'](_0x2923c6));});})['catch'](function(_0x80f004){logger[_0xb97a('0x43')](_0x832272[_0xb97a('0x26')],_0xb97a('0x44'),JSON['stringify'](_0x80f004));});});}logger['info'](_0x832272[_0xb97a('0x26')],_0xb97a('0x44'));}};Fax['prototype'][_0xb97a('0x1f')]=function(_0x1ffac2){if(this[_0xb97a('0x14')][_0x1ffac2[_0xb97a('0x26')]]){_[_0xb97a('0x45')](this['channels'][_0x1ffac2[_0xb97a('0x26')]],_[_0xb97a('0x46')](_0x1ffac2,[_0xb97a('0x47'),_0xb97a('0x48')]));}};function updateStatus(_0x2ce19c){if(_0x2ce19c[_0xb97a('0x49')]){faxMessage[_0xb97a('0x4a')](_0x2ce19c[_0xb97a('0x49')],{'failMessage':_0xb97a('0x4b')})[_0xb97a('0x3f')](function(_0x3b2c7f){ut[_0xb97a('0x4c')](_0xb97a('0x4d'),_0x3b2c7f);})[_0xb97a('0x4e')](function(_0x5c50b3){ut['logger'](_0xb97a('0x4f'),_0x5c50b3);});}else{ut[_0xb97a('0x4c')](_0xb97a('0x50'));}}Fax[_0xb97a('0x20')][_0xb97a('0x51')]=function(_0x31e634,_0x5c4ce5,_0x128545){var _0x134704=this;var _0x989b74={};if(_0x5c4ce5){_0x989b74={'read':_0x5c4ce5};}else{_0x989b74={'failMessage':_0x128545};}if(this['actions'][_0x31e634][_0xb97a('0x49')]){faxMessage[_0xb97a('0x4a')](this[_0xb97a('0x14')][_0x31e634]['AttachmentId'],_0x989b74)[_0xb97a('0x3f')](function(_0x3f42f4){ut[_0xb97a('0x4c')](_0xb97a('0x52'),_0x3f42f4);})[_0xb97a('0x4e')](function(_0x182923){ut[_0xb97a('0x4c')](_0xb97a('0x53'),_0x182923);})[_0xb97a('0x54')](function(){delete _0x134704['channels'][_0x31e634];delete _0x134704[_0xb97a('0x14')][_0x31e634];});}else{ut[_0xb97a('0x4c')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x31e634];delete this[_0xb97a('0x14')][_0x31e634];}};Fax[_0xb97a('0x20')][_0xb97a('0x1e')]=function(_0xdf0d74){var _0x270d74=this;if(this[_0xb97a('0x11')][_0xdf0d74[_0xb97a('0x26')]]){if(this[_0xb97a('0x14')][_0xdf0d74['uniqueid']]){this[_0xb97a('0x11')][_0xdf0d74[_0xb97a('0x26')]]['id']=this[_0xb97a('0x14')][_0xdf0d74[_0xb97a('0x26')]]['id'];this[_0xb97a('0x11')][_0xdf0d74[_0xb97a('0x26')]][_0xb97a('0x28')]=this['actions'][_0xdf0d74[_0xb97a('0x26')]][_0xb97a('0x28')];}logger[_0xb97a('0x29')](_0xdf0d74[_0xb97a('0x26')],this['actions'][_0xdf0d74[_0xb97a('0x26')]]?_0xb97a('0x55'):_0xb97a('0x56'),JSON[_0xb97a('0x57')](this['channels'][_0xdf0d74[_0xb97a('0x26')]]));if(this[_0xb97a('0x14')][_0xdf0d74[_0xb97a('0x26')]]){if(this[_0xb97a('0x11')][_0xdf0d74[_0xb97a('0x26')]]['faxpages']>0x0&&this[_0xb97a('0x11')][_0xdf0d74[_0xb97a('0x26')]]['faxstatus']===_0xb97a('0x58')){this[_0xb97a('0x51')](_0xdf0d74[_0xb97a('0x26')],!![]);}else{this[_0xb97a('0x51')](_0xdf0d74[_0xb97a('0x26')],![],this['channels'][_0xdf0d74[_0xb97a('0x26')]][_0xb97a('0x59')]?'SENDING\x20FAILED:\x20'+this['channels'][_0xdf0d74[_0xb97a('0x26')]][_0xb97a('0x59')]:_0xb97a('0x5a'));}}}};Fax['prototype'][_0xb97a('0x5b')]=function(_0x3d47ed){var _0x3c59e3=this;return new BPromise(function(_0x1738c3,_0x1dda74){_0x3c59e3[_0xb97a('0x5c')](_0x3d47ed,_0x3c59e3[_0xb97a('0x12')][_0x3d47ed[_0xb97a('0x5d')]])['then'](function(_0xc4efa3){ut[_0xb97a('0x4c')](_0xb97a('0x5e'),_0xc4efa3);_0x1738c3(ut[_0xb97a('0x3b')](_0xb97a('0x5f')));})['catch'](function(_0x2b09fd){ut[_0xb97a('0x4c')](_0xb97a('0x60'),_0x2b09fd);updateStatus(_0x3d47ed);_0x1dda74(ut[_0xb97a('0x3b')]('Fax\x20failed'));});});};Fax[_0xb97a('0x20')][_0xb97a('0x61')]=function(_0x14a875){var _0x5daacd=this;return new BPromise(function(_0x1610e3,_0x51e2b0){var _0x4f5991=_0x5daacd[_0xb97a('0x62')](_0x5daacd['faxAccounts'][_0x14a875[_0xb97a('0x5d')]][_0xb97a('0x63')],_0x14a875);if(_0x4f5991['isValid']){_0x1610e3(ut['message'](_0xb97a('0x64')));}else{_0x51e2b0(ut[_0xb97a('0x3b')](_0x4f5991[_0xb97a('0x3b')]));}});};function originate(_0x3e1bbb,_0x67db39,_0x5892a7){return new BPromise(function(_0x28d1c6,_0x3f94bc){if(_0x5892a7){var _0x8b1f76=util['format']('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x3e1bbb[_0xb97a('0x5')])['name'],_0x3e1bbb[_0xb97a('0x5')]);gs['execute'](_0x8b1f76)[_0xb97a('0x3f')](function(){_0x3e1bbb['path']=util['format']('%s/%s.tif',path[_0xb97a('0x3d')](_0x3e1bbb[_0xb97a('0x5')])['dir'],path[_0xb97a('0x3d')](_0x3e1bbb[_0xb97a('0x5')])[_0xb97a('0x28')]);_0x67db39[_0xb97a('0x65')]=_0x3e1bbb[_0xb97a('0x5')];ut[_0xb97a('0x4c')](_0xb97a('0x66'),'');ami[_0xb97a('0x67')](ut[_0xb97a('0x68')](_0x3e1bbb,_0x67db39))['then'](function(_0x5b4c89){_0x28d1c6(_0x5b4c89);})[_0xb97a('0x4e')](function(_0x30dacf){_0x3f94bc(_0x30dacf);});})['catch'](function(_0x407dad){_0x3f94bc(_0x407dad);});}else{ami[_0xb97a('0x67')](ut[_0xb97a('0x68')](_0x3e1bbb,_0x67db39))['then'](function(_0x9e1962){_0x28d1c6(_0x9e1962);})[_0xb97a('0x4e')](function(_0x29e95e){_0x3f94bc(_0x29e95e);});}});}Fax[_0xb97a('0x20')][_0xb97a('0x5c')]=function(_0x24a1ee,_0x2e5057){var _0x3edd42=this;return new BPromise(function(_0x5bc4c2,_0x216867){var _0x33cd5c=uuid['v4']();var _0x134d3d=ut[_0xb97a('0x69')](_0x24a1ee,_0x2e5057);_0x3edd42[_0xb97a('0x14')][_0x33cd5c]=new Action(_0x33cd5c,_0x2e5057,_0x24a1ee);var _0x33b4eb=_0x3edd42[_0xb97a('0x14')][_0x33cd5c];if(path[_0xb97a('0x3d')](_0x24a1ee[_0xb97a('0x5')])[_0xb97a('0x6a')]===_0xb97a('0x41')){originate(_0x33b4eb,_0x134d3d,!![])[_0xb97a('0x3f')](function(_0x44204f){_0x5bc4c2(_0x44204f);})[_0xb97a('0x4e')](function(_0x19e039){_0x216867(_0x19e039);});}else{originate(_0x33b4eb,_0x134d3d,![])[_0xb97a('0x3f')](function(_0x4d4170){_0x5bc4c2(_0x4d4170);})['catch'](function(_0x5e9e4c){_0x216867(_0x5e9e4c);});}});};Fax['prototype']['isTrunkReachable']=function(_0x2e94cf){return!_[_0xb97a('0x6b')](_0x2e94cf)&&!_[_0xb97a('0x6b')](_0x2e94cf['name'])&&!_[_0xb97a('0x6b')](_0x2e94cf[_0xb97a('0x6c')])&&_0x2e94cf[_0xb97a('0x6c')]&&!_[_0xb97a('0x6b')](this[_0xb97a('0x13')][util[_0xb97a('0x6d')](_0xb97a('0x6e'),_0x2e94cf[_0xb97a('0x28')])])&&!_[_0xb97a('0x6b')](this[_0xb97a('0x13')][util['format'](_0xb97a('0x6e'),_0x2e94cf[_0xb97a('0x28')])][_0xb97a('0x31')])&&(this[_0xb97a('0x13')][util[_0xb97a('0x6d')]('SIP/%s',_0x2e94cf[_0xb97a('0x28')])][_0xb97a('0x31')]===_0xb97a('0x6f')||this['trunks'][util['format']('SIP/%s',_0x2e94cf[_0xb97a('0x28')])][_0xb97a('0x31')]===_0xb97a('0x70'));};Fax[_0xb97a('0x20')][_0xb97a('0x62')]=function(_0x3a6351,_0x24a611){if(!this[_0xb97a('0x71')](_0x3a6351)){ut[_0xb97a('0x4c')](_0xb97a('0x72'),_['isNil'](_0x3a6351)?'':_0x3a6351['name']+_0xb97a('0x73'));return{'isValid':![],'message':_0xb97a('0x74')};}if(_[_0xb97a('0x6b')](_0x24a611['fax'])){ut[_0xb97a('0x4c')](_0xb97a('0x75'),JSON[_0xb97a('0x57')](_0x24a611));return{'isValid':![],'message':_0xb97a('0x76')};}if(_[_0xb97a('0x6b')](_0x24a611[_0xb97a('0x5')])){ut[_0xb97a('0x4c')](_0xb97a('0x77'),JSON[_0xb97a('0x57')](_0x24a611));return{'isValid':![],'message':_0xb97a('0x78')};}return{'isValid':!![],'message':_0xb97a('0x79')};};module[_0xb97a('0x7a')]=Fax; \ No newline at end of file +var _0xbada=['variable','value','channelstate','channelstatedesc','hasOwnProperty','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','name','.pdf','application/pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','reason','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SENDING\x20FAILED:\x20','faxstatusstring','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','syncVarSet','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','localstationid','channel','uniqueid','info','\x20syncNewchannel\x20','prototype'];(function(_0x494f7f,_0x34a09b){var _0x18ebe4=function(_0x178e2e){while(--_0x178e2e){_0x494f7f['push'](_0x494f7f['shift']());}};_0x18ebe4(++_0x34a09b);}(_0xbada,0xc7));var _0xabad=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xbada[_0x5cb1af];return _0x8d7940;};'use strict';var util=require(_0xabad('0x0'));var _=require(_0xabad('0x1'));var BPromise=require('bluebird');var uuid=require(_0xabad('0x2'));var moment=require(_0xabad('0x3'));var path=require('path');var tiff2pdf=require(_0xabad('0x4'));var gs=require(_0xabad('0x5'));var logger=require(_0xabad('0x6'))(_0xabad('0x7'));var ami=require(_0xabad('0x8'));var rpcDb=require(_0xabad('0x9'));var Channel=require(_0xabad('0xa'));var ut=require(_0xabad('0xb'));var Action=require('./action');var faxAccount=require(_0xabad('0xc'));var attachment=require(_0xabad('0xd'));var faxMessage=require(_0xabad('0xe'));function Fax(_0x4f4e20){this[_0xabad('0xf')]={};this[_0xabad('0x10')]=_0x4f4e20[_0xabad('0x10')];this['trunks']=_0x4f4e20[_0xabad('0x11')];this[_0xabad('0x12')]={};ami['on'](_0xabad('0x13'),this[_0xabad('0x14')][_0xabad('0x15')](this));ami['on']('varset',this[_0xabad('0x16')]['bind'](this));ami['on'](_0xabad('0x17'),this[_0xabad('0x18')][_0xabad('0x15')](this));ami['on']('newexten',this[_0xabad('0x19')]['bind'](this));ami['on'](_0xabad('0x1a'),this[_0xabad('0x1b')][_0xabad('0x15')](this));ami['on'](_0xabad('0x1c'),this[_0xabad('0x1d')][_0xabad('0x15')](this));ami['on'](_0xabad('0x1e'),this['syncHangup'][_0xabad('0x15')](this));ami['on'](_0xabad('0x1f'),this[_0xabad('0x20')][_0xabad('0x15')](this));}Fax['prototype'][_0xabad('0x14')]=function(_0x5c62f1){if(_0x5c62f1['context']==='from-voip-provider'){for(var _0x13f675 in this[_0xabad('0x10')]){if(this[_0xabad('0x10')]['hasOwnProperty'](_0x13f675)){if(_0x5c62f1['exten']===this['faxAccounts'][_0x13f675][_0xabad('0x21')]){this[_0xabad('0xf')][_0x5c62f1['uniqueid']]={};this['channels'][_0x5c62f1['uniqueid']][_0xabad('0x22')]=_0x5c62f1[_0xabad('0x22')];this[_0xabad('0xf')][_0x5c62f1[_0xabad('0x23')]]['id']=this[_0xabad('0x10')][_0x13f675]['id'];this[_0xabad('0xf')][_0x5c62f1[_0xabad('0x23')]]['name']=this[_0xabad('0x10')][_0x13f675]['name'];logger[_0xabad('0x24')](_0x5c62f1[_0xabad('0x23')],_0xabad('0x25'));}}}}if(this[_0xabad('0x12')][_0x5c62f1[_0xabad('0x23')]]){this['channels'][_0x5c62f1[_0xabad('0x23')]]={};this[_0xabad('0xf')][_0x5c62f1[_0xabad('0x23')]][_0xabad('0x22')]=_0x5c62f1['channel'];logger[_0xabad('0x24')](_0x5c62f1[_0xabad('0x23')],_0xabad('0x25'));}};Fax[_0xabad('0x26')][_0xabad('0x16')]=function(_0x336983){if(this[_0xabad('0xf')][_0x336983[_0xabad('0x23')]]){for(var _0x53927e in _0x336983[_0xabad('0x27')]){if(_0x336983['variable']['hasOwnProperty'](_0x53927e)){this[_0xabad('0xf')][_0x336983[_0xabad('0x23')]][_0x53927e]=_0x336983[_0xabad('0x28')];}}}};Fax[_0xabad('0x26')][_0xabad('0x18')]=function(_0x490022){if(this['channels'][_0x490022[_0xabad('0x23')]]){this[_0xabad('0xf')][_0x490022['uniqueid']][_0xabad('0x29')]=_0x490022[_0xabad('0x29')];this['channels'][_0x490022[_0xabad('0x23')]][_0xabad('0x2a')]=_0x490022[_0xabad('0x2a')];}};Fax['prototype'][_0xabad('0x19')]=function(_0x27fdbe){if(this[_0xabad('0xf')][_0x27fdbe['uniqueid']]){for(var _0x2a9f4e in _0x27fdbe['variable']){if(_0x27fdbe[_0xabad('0x27')][_0xabad('0x2b')](_0x2a9f4e)){this[_0xabad('0xf')][_0x27fdbe[_0xabad('0x23')]][_0x2a9f4e]=_0x27fdbe[_0xabad('0x28')];}}}};Fax[_0xabad('0x26')][_0xabad('0x1b')]=function(_0x7631f4){if(this[_0xabad('0xf')][_0x7631f4['uniqueid']]){this[_0xabad('0xf')][_0x7631f4[_0xabad('0x23')]][_0xabad('0x2c')]=_0x7631f4[_0xabad('0x2c')];this[_0xabad('0xf')][_0x7631f4[_0xabad('0x23')]][_0xabad('0x2d')]=_0x7631f4[_0xabad('0x2d')];this['channels'][_0x7631f4[_0xabad('0x23')]][_0xabad('0x21')]=_0x7631f4[_0xabad('0x21')];this[_0xabad('0xf')][_0x7631f4['uniqueid']][_0xabad('0x2e')]=_0x7631f4['filename'];logger[_0xabad('0x24')](_0x7631f4[_0xabad('0x23')],_0xabad('0x2f'));}};Fax[_0xabad('0x26')][_0xabad('0x1d')]=function(_0x36b556){var _0x3e7f45=this;if(this['channels'][_0x36b556['uniqueid']]){var _0x2450cf=this[_0xabad('0xf')][_0x36b556[_0xabad('0x23')]]['id'];this[_0xabad('0xf')][_0x36b556[_0xabad('0x23')]][_0xabad('0x30')]=_0x36b556['remotestationid'];this['channels'][_0x36b556[_0xabad('0x23')]][_0xabad('0x31')]=_0x36b556[_0xabad('0x31')];this['channels'][_0x36b556['uniqueid']][_0xabad('0x21')]=_0x36b556['localstationid'];this['channels'][_0x36b556['uniqueid']]['resolution']=_0x36b556[_0xabad('0x32')];this['channels'][_0x36b556[_0xabad('0x23')]][_0xabad('0x33')]=_0x36b556['transferrate'];this['channels'][_0x36b556[_0xabad('0x23')]][_0xabad('0x2e')]=_0x36b556[_0xabad('0x2e')];this[_0xabad('0xf')][_0x36b556[_0xabad('0x23')]][_0xabad('0x34')]=_0x36b556[_0xabad('0x34')];if(this[_0xabad('0xf')][_0x36b556[_0xabad('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x36b556[_0xabad('0x2e')],_0xabad('0x35'),function(_0x5b5cb1){logger[_0xabad('0x24')](_0x36b556[_0xabad('0x23')],_0xabad('0x36'),_0x5b5cb1[_0xabad('0x37')]);attachment[_0xabad('0x38')]({'name':path[_0xabad('0x39')](_0x36b556[_0xabad('0x2e')])['name'],'basename':path[_0xabad('0x39')](_0x36b556[_0xabad('0x2e')])[_0xabad('0x3a')]+_0xabad('0x3b'),'type':_0xabad('0x3c')})[_0xabad('0x3d')](function(_0x4df3ce){faxAccount[_0xabad('0x3e')](_0x2450cf,{'from':_0x36b556[_0xabad('0x34')],'mapKey':_0xabad('0x7'),'body':path['parse'](_0x36b556[_0xabad('0x2e')])['name']+_0xabad('0x3b'),'AttachmentId':_0x4df3ce['id']})[_0xabad('0x3f')](function(_0x285f17){logger[_0xabad('0x40')](_0x36b556[_0xabad('0x23')],_0xabad('0x41'),JSON[_0xabad('0x42')](_0x285f17));});})[_0xabad('0x3f')](function(_0xf9e180){logger[_0xabad('0x40')](_0x36b556['uniqueid'],_0xabad('0x43'),JSON[_0xabad('0x42')](_0xf9e180));});});}logger[_0xabad('0x24')](_0x36b556[_0xabad('0x23')],'\x20receiveFax\x20');}};Fax['prototype'][_0xabad('0x20')]=function(_0x349b00){if(this['actions'][_0x349b00[_0xabad('0x23')]]){_['merge'](this['channels'][_0x349b00[_0xabad('0x23')]],_[_0xabad('0x44')](_0x349b00,[_0xabad('0x45'),_0xabad('0x46')]));}};function updateStatus(_0xf348e7){if(_0xf348e7[_0xabad('0x47')]){faxMessage['update'](_0xf348e7['AttachmentId'],{'failMessage':_0xabad('0x48')})[_0xabad('0x3d')](function(_0x1e5630){ut[_0xabad('0x49')](_0xabad('0x4a'),_0x1e5630);})['catch'](function(_0x885bb8){ut[_0xabad('0x49')]('[Fax][Message][Error][NoUpdate1]',_0x885bb8);});}else{ut[_0xabad('0x49')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0xabad('0x4b')]=function(_0x409c57,_0x50fb93,_0x1b403b){var _0x8f23a1=this;var _0x2a9fe7={};if(_0x50fb93){_0x2a9fe7={'read':_0x50fb93};}else{_0x2a9fe7={'failMessage':_0x1b403b};}if(this[_0xabad('0x12')][_0x409c57]['AttachmentId']){faxMessage[_0xabad('0x4c')](this[_0xabad('0x12')][_0x409c57][_0xabad('0x47')],_0x2a9fe7)[_0xabad('0x3d')](function(_0x4d7204){ut[_0xabad('0x49')](_0xabad('0x4d'),_0x4d7204);})['catch'](function(_0x402c8c){ut['logger'](_0xabad('0x4e'),_0x402c8c);})['finally'](function(){delete _0x8f23a1[_0xabad('0xf')][_0x409c57];delete _0x8f23a1[_0xabad('0x12')][_0x409c57];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0xabad('0xf')][_0x409c57];delete this['actions'][_0x409c57];}};Fax[_0xabad('0x26')][_0xabad('0x4f')]=function(_0x24c54b){var _0x24a806=this;if(this[_0xabad('0xf')][_0x24c54b[_0xabad('0x23')]]){if(this[_0xabad('0x12')][_0x24c54b[_0xabad('0x23')]]){this[_0xabad('0xf')][_0x24c54b[_0xabad('0x23')]]['id']=this['actions'][_0x24c54b[_0xabad('0x23')]]['id'];this[_0xabad('0xf')][_0x24c54b[_0xabad('0x23')]][_0xabad('0x3a')]=this['actions'][_0x24c54b[_0xabad('0x23')]][_0xabad('0x3a')];}logger[_0xabad('0x24')](_0x24c54b['uniqueid'],this[_0xabad('0x12')][_0x24c54b[_0xabad('0x23')]]?_0xabad('0x50'):_0xabad('0x51'),JSON[_0xabad('0x42')](this[_0xabad('0xf')][_0x24c54b[_0xabad('0x23')]]));if(this[_0xabad('0x12')][_0x24c54b[_0xabad('0x23')]]){if(this['channels'][_0x24c54b[_0xabad('0x23')]][_0xabad('0x52')]>0x0&&this[_0xabad('0xf')][_0x24c54b[_0xabad('0x23')]][_0xabad('0x1a')]==='SUCCESS'){this['updateStatus'](_0x24c54b[_0xabad('0x23')],!![]);}else{this['updateStatus'](_0x24c54b[_0xabad('0x23')],![],this[_0xabad('0xf')][_0x24c54b[_0xabad('0x23')]]['faxstatusstring']?_0xabad('0x53')+this[_0xabad('0xf')][_0x24c54b[_0xabad('0x23')]][_0xabad('0x54')]:_0xabad('0x55'));}}}};Fax[_0xabad('0x26')][_0xabad('0x56')]=function(_0x2dbf8a){var _0x230683=this;return new BPromise(function(_0x21066c,_0x2aa89a){_0x230683[_0xabad('0x57')](_0x2dbf8a,_0x230683[_0xabad('0x10')][_0x2dbf8a[_0xabad('0x58')]])[_0xabad('0x3d')](function(_0x171408){ut[_0xabad('0x49')](_0xabad('0x59'),_0x171408);_0x21066c(ut[_0xabad('0x37')](_0xabad('0x5a')));})[_0xabad('0x3f')](function(_0x4ba411){ut[_0xabad('0x49')](_0xabad('0x5b'),_0x4ba411);updateStatus(_0x2dbf8a);_0x2aa89a(ut['message'](_0xabad('0x5c')));});});};Fax[_0xabad('0x26')][_0xabad('0x5d')]=function(_0x933c97){var _0x93e5cd=this;return new BPromise(function(_0x247ead,_0x5d18e9){var _0x55a8b0=_0x93e5cd['checkTrunk'](_0x93e5cd[_0xabad('0x10')][_0x933c97[_0xabad('0x58')]][_0xabad('0x5e')],_0x933c97);if(_0x55a8b0['isValid']){_0x247ead(ut[_0xabad('0x37')]('Trunk\x20Reachable'));}else{_0x5d18e9(ut['message'](_0x55a8b0['message']));}});};function originate(_0x342c2c,_0xd2fc83,_0x574e14){return new BPromise(function(_0x4b8dab,_0x48c805){if(_0x574e14){var _0x251a4f=util[_0xabad('0x5f')](_0xabad('0x60'),path['parse'](_0x342c2c[_0xabad('0x61')])[_0xabad('0x3a')],_0x342c2c[_0xabad('0x61')]);gs[_0xabad('0x62')](_0x251a4f)[_0xabad('0x3d')](function(){_0x342c2c[_0xabad('0x61')]=util[_0xabad('0x5f')]('%s/%s.tif',path[_0xabad('0x39')](_0x342c2c[_0xabad('0x61')])[_0xabad('0x63')],path[_0xabad('0x39')](_0x342c2c[_0xabad('0x61')])['name']);_0xd2fc83[_0xabad('0x64')]=_0x342c2c[_0xabad('0x61')];ut[_0xabad('0x49')](_0xabad('0x65'),'');ami[_0xabad('0x66')](ut['variablesAction'](_0x342c2c,_0xd2fc83))[_0xabad('0x3d')](function(_0x2eafcb){_0x4b8dab(_0x2eafcb);})[_0xabad('0x3f')](function(_0x248561){_0x48c805(_0x248561);});})[_0xabad('0x3f')](function(_0x1367ef){_0x48c805(_0x1367ef);});}else{ami[_0xabad('0x66')](ut[_0xabad('0x67')](_0x342c2c,_0xd2fc83))[_0xabad('0x3d')](function(_0x212b3f){_0x4b8dab(_0x212b3f);})['catch'](function(_0x2fd70a){_0x48c805(_0x2fd70a);});}});}Fax['prototype'][_0xabad('0x57')]=function(_0x379e67,_0x53d482){var _0x12fa05=this;return new BPromise(function(_0x42a228,_0x521d73){var _0x4de128=uuid['v4']();var _0x2bf8ad=ut['addVariables'](_0x379e67,_0x53d482);_0x12fa05['actions'][_0x4de128]=new Action(_0x4de128,_0x53d482,_0x379e67);var _0x2c3834=_0x12fa05['actions'][_0x4de128];if(path[_0xabad('0x39')](_0x379e67[_0xabad('0x61')])[_0xabad('0x68')]==='.pdf'){originate(_0x2c3834,_0x2bf8ad,!![])[_0xabad('0x3d')](function(_0x39fc6e){_0x42a228(_0x39fc6e);})[_0xabad('0x3f')](function(_0x2f5421){_0x521d73(_0x2f5421);});}else{originate(_0x2c3834,_0x2bf8ad,![])['then'](function(_0x398bec){_0x42a228(_0x398bec);})['catch'](function(_0x3228cf){_0x521d73(_0x3228cf);});}});};Fax[_0xabad('0x26')][_0xabad('0x69')]=function(_0xe54392){return!_[_0xabad('0x6a')](_0xe54392)&&!_[_0xabad('0x6a')](_0xe54392[_0xabad('0x3a')])&&!_[_0xabad('0x6a')](_0xe54392['active'])&&_0xe54392[_0xabad('0x6b')]&&!_[_0xabad('0x6a')](this[_0xabad('0x11')][util[_0xabad('0x5f')](_0xabad('0x6c'),_0xe54392[_0xabad('0x3a')])])&&!_[_0xabad('0x6a')](this['trunks'][util['format'](_0xabad('0x6c'),_0xe54392[_0xabad('0x3a')])][_0xabad('0x2d')])&&(this[_0xabad('0x11')][util[_0xabad('0x5f')](_0xabad('0x6c'),_0xe54392['name'])][_0xabad('0x2d')]===_0xabad('0x6d')||this['trunks'][util[_0xabad('0x5f')](_0xabad('0x6c'),_0xe54392[_0xabad('0x3a')])][_0xabad('0x2d')]===_0xabad('0x6e'));};Fax[_0xabad('0x26')][_0xabad('0x6f')]=function(_0x275a55,_0x57d64b){if(!this[_0xabad('0x69')](_0x275a55)){ut[_0xabad('0x49')](_0xabad('0x70'),_[_0xabad('0x6a')](_0x275a55)?'':_0x275a55['name']+_0xabad('0x71'));return{'isValid':![],'message':_0xabad('0x72')};}if(_[_0xabad('0x6a')](_0x57d64b['fax'])){ut[_0xabad('0x49')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xabad('0x42')](_0x57d64b));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x57d64b['path'])){ut[_0xabad('0x49')](_0xabad('0x73'),JSON[_0xabad('0x42')](_0x57d64b));return{'isValid':![],'message':_0xabad('0x74')};}return{'isValid':!![],'message':_0xabad('0x75')};};module[_0xabad('0x76')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index ef5308c..6114ff1 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 _0x968b=['then','catch','bluebird','../../../config/logger','preview','../rpc/faxAccount','error','inspect','notify','resolve'];(function(_0x420413,_0x4f1aac){var _0x2aebe5=function(_0x44ffb4){while(--_0x44ffb4){_0x420413['push'](_0x420413['shift']());}};_0x2aebe5(++_0x4f1aac);}(_0x968b,0x1ce));var _0xb968=function(_0x343493,_0x2b85bc){_0x343493=_0x343493-0x0;var _0x11776a=_0x968b[_0x343493];return _0x11776a;};'use strict';var util=require('util');var BPromise=require(_0xb968('0x0'));var logger=require(_0xb968('0x1'))(_0xb968('0x2'));var _=require('lodash');var faxAccount=require(_0xb968('0x3'));function loggerCatch(_0x2dcb23){return function(_0x5cab8a){logger[_0xb968('0x4')](_0x2dcb23,util[_0xb968('0x5')](_0x5cab8a,{'showHidden':![],'depth':null}));};}exports[_0xb968('0x6')]=function(_0x1fc824,_0xf131b){return BPromise[_0xb968('0x7')]()[_0xb968('0x8')](faxAccount['notify'](_0x1fc824,_0xf131b))[_0xb968('0x9')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xbeae=['../../../config/logger','preview','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20','util'];(function(_0x129a61,_0x5848a1){var _0x39b8db=function(_0x319ec1){while(--_0x319ec1){_0x129a61['push'](_0x129a61['shift']());}};_0x39b8db(++_0x5848a1);}(_0xbeae,0xf1));var _0xebea=function(_0x42f4e0,_0x1a481f){_0x42f4e0=_0x42f4e0-0x0;var _0x5eb3e0=_0xbeae[_0x42f4e0];return _0x5eb3e0;};'use strict';var util=require(_0xebea('0x0'));var BPromise=require('bluebird');var logger=require(_0xebea('0x1'))(_0xebea('0x2'));var _=require('lodash');var faxAccount=require(_0xebea('0x3'));function loggerCatch(_0x3f5dad){return function(_0x4a19cd){logger[_0xebea('0x4')](_0x3f5dad,util[_0xebea('0x5')](_0x4a19cd,{'showHidden':![],'depth':null}));};}exports[_0xebea('0x6')]=function(_0x5487f1,_0x24e6f8){return BPromise[_0xebea('0x7')]()[_0xebea('0x8')](faxAccount[_0xebea('0x6')](_0x5487f1,_0x24e6f8))[_0xebea('0x9')](loggerCatch(_0xebea('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 8dad369..07658d7 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 _0x0685=['\x20Error\x20:','inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','Exec\x20gs','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0685,0xac));var _0x5068=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0685[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x5068('0x0'));var logger=require(_0x5068('0x1'))(_0x5068('0x2'));var BPromise=require(_0x5068('0x3'));var exec=require(_0x5068('0x4'))[_0x5068('0x5')];exports['execute']=function(_0x5139b4){return new BPromise(function(_0x4f24fb,_0x465f48){exec(_0x5139b4,function(_0x567204,_0x4e3909,_0xcf1577){logger['info'](_0x5068('0x6'),_0x4e3909);if(_0x567204){logger[_0x5068('0x7')](_0x5068('0x6'),_0x5068('0x8'),util[_0x5068('0x9')](_0x567204,{'showHidden':![],'depth':null}),_0x4e3909,_0xcf1577);_0x465f48(_0x567204);}_0x4f24fb(_0x4e3909);});});}; \ No newline at end of file +var _0xf453=['execute','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','bluebird','child_process','exec'];(function(_0xf858e,_0x51b0f1){var _0x5344d8=function(_0x5219d6){while(--_0x5219d6){_0xf858e['push'](_0xf858e['shift']());}};_0x5344d8(++_0x51b0f1);}(_0xf453,0x1cf));var _0x3f45=function(_0x34ebc6,_0x4963b8){_0x34ebc6=_0x34ebc6-0x0;var _0x2f6d7e=_0xf453[_0x34ebc6];return _0x2f6d7e;};'use strict';var util=require(_0x3f45('0x0'));var logger=require(_0x3f45('0x1'))('fax');var BPromise=require(_0x3f45('0x2'));var exec=require(_0x3f45('0x3'))[_0x3f45('0x4')];exports[_0x3f45('0x5')]=function(_0x5af169){return new BPromise(function(_0x54dc7b,_0x26cba8){exec(_0x5af169,function(_0x2a2813,_0x228ae3,_0x3a73df){logger[_0x3f45('0x6')](_0x3f45('0x7'),_0x228ae3);if(_0x2a2813){logger[_0x3f45('0x6')](_0x3f45('0x7'),_0x3f45('0x8'),util['inspect'](_0x2a2813,{'showHidden':![],'depth':null}),_0x228ae3,_0x3a73df);_0x26cba8(_0x2a2813);}_0x54dc7b(_0x228ae3);});});}; \ 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 2021289..7be6df8 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 _0x222f=['uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','logger','inspect','ecm','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','localstationid','path','variablesAction'];(function(_0x3b88a9,_0x196270){var _0xac0324=function(_0x5eb7ca){while(--_0x5eb7ca){_0x3b88a9['push'](_0x3b88a9['shift']());}};_0xac0324(++_0x196270);}(_0x222f,0x1a4));var _0xf222=function(_0x37dbe8,_0x10e968){_0x37dbe8=_0x37dbe8-0x0;var _0x2416b6=_0x222f[_0x37dbe8];return _0x2416b6;};'use strict';var util=require(_0xf222('0x0'));var _=require(_0xf222('0x1'));var moment=require(_0xf222('0x2'));var logger=require(_0xf222('0x3'))('fax');exports['message']=function(_0x195de1){return{'message':_0x195de1};};exports[_0xf222('0x4')]=function(_0x307791,_0x7b187d){logger['info'](_0x307791,util[_0xf222('0x5')](_0x7b187d,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x112e6d,_0x26f129){var _0x518ebb={'XMF-ECM':_0x26f129[_0xf222('0x6')],'XMF-HEADERINFO':_0x26f129[_0xf222('0x7')],'XMF-MINRATE':_0x26f129['minrate'],'XMF-MAXRATE':_0x26f129[_0xf222('0x8')],'XMF-MODEM':util[_0xf222('0x9')](_0xf222('0xa'),_0x26f129[_0xf222('0xb')]),'XMF-GATEWAY':_0x26f129[_0xf222('0xc')],'XMF-FAXDETECT':_0x26f129[_0xf222('0xd')],'XMF-T38TIMEOUT':_0x26f129['t38timeout'],'XMF-LOCALSTATIONID':_0x26f129[_0xf222('0xe')],'XMF-PATH':_0x112e6d[_0xf222('0xf')]};return _0x518ebb;};exports[_0xf222('0x10')]=function(_0x182bc3,_0x48f740){return{'actionid':_0x182bc3[_0xf222('0x11')],'action':_0xf222('0x12'),'channel':_0x182bc3[_0xf222('0x13')],'Exten':_0xf222('0x14'),'Context':_0xf222('0x15'),'Priority':'1','callerid':util[_0xf222('0x9')](_0xf222('0x16'),_0x182bc3[_0xf222('0x7')]?_0x182bc3['headerinfo']:'',_0x182bc3['localstationid']),'variable':_0x48f740,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x182bc3[_0xf222('0x11')]};}; \ No newline at end of file +var _0x1be1=['modem','gateway','t38timeout','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','moment','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format'];(function(_0x2aaa40,_0x4aeb19){var _0x4af740=function(_0x5b9730){while(--_0x5b9730){_0x2aaa40['push'](_0x2aaa40['shift']());}};_0x4af740(++_0x4aeb19);}(_0x1be1,0x192));var _0x11be=function(_0x54a129,_0x5bec9c){_0x54a129=_0x54a129-0x0;var _0x2f5d97=_0x1be1[_0x54a129];return _0x2f5d97;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x11be('0x0'));var logger=require(_0x11be('0x1'))('fax');exports[_0x11be('0x2')]=function(_0xd002ca){return{'message':_0xd002ca};};exports[_0x11be('0x3')]=function(_0x318d41,_0x504d3a){logger[_0x11be('0x4')](_0x318d41,util[_0x11be('0x5')](_0x504d3a,{'showHidden':![],'depth':null}));};exports[_0x11be('0x6')]=function(_0x479719,_0xfe8c62){var _0x497730={'XMF-ECM':_0xfe8c62[_0x11be('0x7')],'XMF-HEADERINFO':_0xfe8c62[_0x11be('0x8')],'XMF-MINRATE':_0xfe8c62[_0x11be('0x9')],'XMF-MAXRATE':_0xfe8c62[_0x11be('0xa')],'XMF-MODEM':util[_0x11be('0xb')]('\x22%s\x22',_0xfe8c62[_0x11be('0xc')]),'XMF-GATEWAY':_0xfe8c62[_0x11be('0xd')],'XMF-FAXDETECT':_0xfe8c62['faxdetect'],'XMF-T38TIMEOUT':_0xfe8c62[_0x11be('0xe')],'XMF-LOCALSTATIONID':_0xfe8c62[_0x11be('0xf')],'XMF-PATH':_0x479719[_0x11be('0x10')]};return _0x497730;};exports[_0x11be('0x11')]=function(_0x4e013c,_0x447e88){return{'actionid':_0x4e013c[_0x11be('0x12')],'action':_0x11be('0x13'),'channel':_0x4e013c['channel'],'Exten':_0x11be('0x14'),'Context':_0x11be('0x15'),'Priority':'1','callerid':util['format'](_0x11be('0x16'),_0x4e013c['headerinfo']?_0x4e013c['headerinfo']:'',_0x4e013c['localstationid']),'variable':_0x447e88,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x4e013c['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index a9ac44a..6bf6026 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 _0xfcfe=['initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','listen','sync','log','bluebird','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/voiceCallReport','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','resolve','initAgents','then','getTelephones','initTrunks','initVoiceQueues','initTriggers','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts'];(function(_0x52ca1f,_0x1542fb){var _0x38ae93=function(_0x15e8c6){while(--_0x15e8c6){_0x52ca1f['push'](_0x52ca1f['shift']());}};_0x38ae93(++_0x1542fb);}(_0xfcfe,0xff));var _0xefcf=function(_0x24f569,_0x58fab7){_0x24f569=_0x24f569-0x0;var _0x3f51d3=_0xfcfe[_0x24f569];return _0x3f51d3;};'use strict';var BPromise=require(_0xefcf('0x0'));var util=require('util');var moment=require(_0xefcf('0x1'));var server=require('./server');var Realtime=require(_0xefcf('0x2'));var Report=require(_0xefcf('0x3'));var Acw=require(_0xefcf('0x4'));var Trigger=require(_0xefcf('0x5'));var Dialer=require(_0xefcf('0x6'));var Preview=require(_0xefcf('0x7'));var Fax=require(_0xefcf('0x8'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xefcf('0x9'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require(_0xefcf('0xa'));var cmHopperHistory=require(_0xefcf('0xb'));var campaign=require(_0xefcf('0xc'));var voiceExtension=require(_0xefcf('0xd'));var faxAccount=require(_0xefcf('0xe'));var zendesk=require(_0xefcf('0xf'));var salesforce=require(_0xefcf('0x10'));var sugarcrm=require(_0xefcf('0x11'));var freshdesk=require(_0xefcf('0x12'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xefcf('0x13'));var freshsales=require(_0xefcf('0x14'));var servicenow=require(_0xefcf('0x15'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xefcf('0x16')](_0xefcf('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xefcf('0x16')](_0xefcf('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xefcf('0x18')]()['then'](user['getAgents']())['then'](realtime[_0xefcf('0x19')]())[_0xefcf('0x1a')](user[_0xefcf('0x1b')]())[_0xefcf('0x1a')](realtime['initTelephones']())[_0xefcf('0x1a')](trunk['getTrunks']())[_0xefcf('0x1a')](realtime[_0xefcf('0x1c')]())[_0xefcf('0x1a')](voiceQueue['getVoiceQueues']())[_0xefcf('0x1a')](realtime[_0xefcf('0x1d')]())[_0xefcf('0x1a')](trigger['getTriggers']())[_0xefcf('0x1a')](realtime[_0xefcf('0x1e')]())[_0xefcf('0x1a')](template['getTemplates']())[_0xefcf('0x1a')](realtime['initTemplates']())[_0xefcf('0x1a')](zendesk[_0xefcf('0x1f')]())['then'](realtime[_0xefcf('0x20')]())[_0xefcf('0x1a')](salesforce[_0xefcf('0x21')]())['then'](realtime[_0xefcf('0x22')]())[_0xefcf('0x1a')](sugarcrm['getSugarcrmAccounts']())[_0xefcf('0x1a')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0xefcf('0x23')]())[_0xefcf('0x1a')](realtime[_0xefcf('0x24')]())[_0xefcf('0x1a')](desk[_0xefcf('0x25')]())[_0xefcf('0x1a')](realtime[_0xefcf('0x26')]())[_0xefcf('0x1a')](zoho['getZohoAccounts']())[_0xefcf('0x1a')](realtime[_0xefcf('0x27')]())[_0xefcf('0x1a')](vtiger['getVtigerAccounts']())[_0xefcf('0x1a')](realtime[_0xefcf('0x28')]())[_0xefcf('0x1a')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0xefcf('0x29')]())[_0xefcf('0x1a')](servicenow[_0xefcf('0x2a')]())[_0xefcf('0x1a')](realtime[_0xefcf('0x2b')]())[_0xefcf('0x1a')](dynamics365['getDynamics365Accounts']())[_0xefcf('0x1a')](realtime[_0xefcf('0x2c')]())['then'](campaign['getCampaigns']())[_0xefcf('0x1a')](realtime[_0xefcf('0x2d')]())[_0xefcf('0x1a')](voiceExtension[_0xefcf('0x2e')]())[_0xefcf('0x1a')](realtime[_0xefcf('0x2f')]())[_0xefcf('0x1a')](faxAccount['getFaxAccounts']())[_0xefcf('0x1a')](realtime['initFaxAccounts']())[_0xefcf('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0xefcf('0x18')]()['then'](voiceQueueReport[_0xefcf('0x30')]())[_0xefcf('0x1a')](realtime[_0xefcf('0x31')]())['then'](cmHopperHistory[_0xefcf('0x32')]())[_0xefcf('0x1a')](realtime[_0xefcf('0x33')]())[_0xefcf('0x1a')](cmHopperHistory[_0xefcf('0x34')]())['then'](realtime[_0xefcf('0x35')]())[_0xefcf('0x1a')](voiceCallReport[_0xefcf('0x36')]())[_0xefcf('0x1a')](realtime['initVoiceCallReports']())[_0xefcf('0x1a')](function(_0x3d1e84){})[_0xefcf('0x37')](function(_0x12f750){console['log'](_0x12f750);});}function main(){return server[_0xefcf('0x38')](realtime,preview,fax)[_0xefcf('0x1a')](function(_0x3044e1){return initRealtime();})[_0xefcf('0x1a')](function(){return initParams();})[_0xefcf('0x1a')](function(){report[_0xefcf('0x39')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x47cac7){console[_0xefcf('0x3a')](_0x47cac7);});}main(); \ No newline at end of file +var _0x0c69=['getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','bluebird','util','./server','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','get','hour','then','getAgents','getTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','initTriggers','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initCampaigns'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0x0c69,0x8a));var _0x90c6=function(_0x475d55,_0x59fdb9){_0x475d55=_0x475d55-0x0;var _0x543d41=_0x0c69[_0x475d55];return _0x543d41;};'use strict';var BPromise=require(_0x90c6('0x0'));var util=require(_0x90c6('0x1'));var moment=require('moment');var server=require(_0x90c6('0x2'));var Realtime=require(_0x90c6('0x3'));var Report=require(_0x90c6('0x4'));var Acw=require(_0x90c6('0x5'));var Trigger=require(_0x90c6('0x6'));var Dialer=require(_0x90c6('0x7'));var Preview=require(_0x90c6('0x8'));var Fax=require(_0x90c6('0x9'));var user=require(_0x90c6('0xa'));var voiceQueue=require(_0x90c6('0xb'));var voiceQueueReport=require(_0x90c6('0xc'));var voiceCallReport=require(_0x90c6('0xd'));var trunk=require(_0x90c6('0xe'));var trigger=require(_0x90c6('0xf'));var template=require(_0x90c6('0x10'));var cmHopperHistory=require(_0x90c6('0x11'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x90c6('0x12'));var zendesk=require(_0x90c6('0x13'));var salesforce=require(_0x90c6('0x14'));var sugarcrm=require(_0x90c6('0x15'));var freshdesk=require(_0x90c6('0x16'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x90c6('0x17'));var vtiger=require(_0x90c6('0x18'));var freshsales=require(_0x90c6('0x19'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x90c6('0x1a'));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 isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x90c6('0x1b')](_0x90c6('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x90c6('0x1b')](_0x90c6('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x90c6('0x1d')](user[_0x90c6('0x1e')]())['then'](realtime['initAgents']())[_0x90c6('0x1d')](user[_0x90c6('0x1f')]())[_0x90c6('0x1d')](realtime['initTelephones']())['then'](trunk[_0x90c6('0x20')]())['then'](realtime[_0x90c6('0x21')]())['then'](voiceQueue[_0x90c6('0x22')]())['then'](realtime['initVoiceQueues']())['then'](trigger[_0x90c6('0x23')]())[_0x90c6('0x1d')](realtime[_0x90c6('0x24')]())[_0x90c6('0x1d')](template['getTemplates']())[_0x90c6('0x1d')](realtime['initTemplates']())['then'](zendesk['getZendeskAccounts']())[_0x90c6('0x1d')](realtime[_0x90c6('0x25')]())[_0x90c6('0x1d')](salesforce['getSalesforceAccounts']())[_0x90c6('0x1d')](realtime[_0x90c6('0x26')]())[_0x90c6('0x1d')](sugarcrm[_0x90c6('0x27')]())[_0x90c6('0x1d')](realtime[_0x90c6('0x28')]())['then'](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x90c6('0x29')]())[_0x90c6('0x1d')](desk[_0x90c6('0x2a')]())[_0x90c6('0x1d')](realtime['initDeskAccounts']())[_0x90c6('0x1d')](zoho[_0x90c6('0x2b')]())[_0x90c6('0x1d')](realtime['initZohoAccounts']())['then'](vtiger[_0x90c6('0x2c')]())[_0x90c6('0x1d')](realtime[_0x90c6('0x2d')]())[_0x90c6('0x1d')](freshsales[_0x90c6('0x2e')]())[_0x90c6('0x1d')](realtime[_0x90c6('0x2f')]())[_0x90c6('0x1d')](servicenow[_0x90c6('0x30')]())[_0x90c6('0x1d')](realtime['initServicenowAccounts']())['then'](dynamics365[_0x90c6('0x31')]())['then'](realtime['initDynamics365Accounts']())[_0x90c6('0x1d')](campaign['getCampaigns']())[_0x90c6('0x1d')](realtime[_0x90c6('0x32')]())['then'](voiceExtension[_0x90c6('0x33')]())['then'](realtime[_0x90c6('0x34')]())[_0x90c6('0x1d')](faxAccount[_0x90c6('0x35')]())[_0x90c6('0x1d')](realtime[_0x90c6('0x36')]())[_0x90c6('0x1d')](function(){return realtime;});}function initParams(){return BPromise[_0x90c6('0x37')]()[_0x90c6('0x1d')](voiceQueueReport[_0x90c6('0x38')]())[_0x90c6('0x1d')](realtime['initVoiceQueueReports']())['then'](cmHopperHistory[_0x90c6('0x39')]())[_0x90c6('0x1d')](realtime[_0x90c6('0x3a')]())[_0x90c6('0x1d')](cmHopperHistory['getCampaignHopperHistory']())[_0x90c6('0x1d')](realtime[_0x90c6('0x3b')]())[_0x90c6('0x1d')](voiceCallReport[_0x90c6('0x3c')]())[_0x90c6('0x1d')](realtime[_0x90c6('0x3d')]())['then'](function(_0x1c02c0){})[_0x90c6('0x3e')](function(_0x447e57){console['log'](_0x447e57);});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x3a18b2){return initRealtime();})['then'](function(){return initParams();})[_0x90c6('0x1d')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x90c6('0x3e')](function(_0x5702f0){console['log'](_0x5702f0);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 2302a7b..08d0e8f 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 _0x6e34=['emit','user:save','exports','lodash','util','moment','md5','../../../config/environment','redis','localhost','name','email','accountcode','fullname','state','unknown','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','voiceStatusTime','toNumber','format','stateTime','onhold'];(function(_0x15210d,_0x457b17){var _0x2c9969=function(_0x288d4d){while(--_0x288d4d){_0x15210d['push'](_0x15210d['shift']());}};_0x2c9969(++_0x457b17);}(_0x6e34,0x159));var _0x46e3=function(_0xccc985,_0xdbbb3){_0xccc985=_0xccc985-0x0;var _0x4996cf=_0x6e34[_0xccc985];return _0x4996cf;};'use strict';var _=require(_0x46e3('0x0'));var util=require(_0x46e3('0x1'));var moment=require(_0x46e3('0x2'));var md5=require(_0x46e3('0x3'));var Redis=require('ioredis');var config=require(_0x46e3('0x4'));config[_0x46e3('0x5')]=_['defaults'](config['redis'],{'host':_0x46e3('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x46e3('0x5')]));function Agent(_0x1e16a7){this['id']=_0x1e16a7['id']||0x0;this['name']=_0x1e16a7[_0x46e3('0x7')]||'';this[_0x46e3('0x8')]=_0x1e16a7[_0x46e3('0x8')]||'';this[_0x46e3('0x9')]=_0x1e16a7['accountcode']||'';this[_0x46e3('0xa')]=_0x1e16a7[_0x46e3('0xa')]||'';this[_0x46e3('0xb')]=_0x46e3('0xc');this['stateTime']=0x0;this[_0x46e3('0xd')]=_0x46e3('0xc');this[_0x46e3('0xe')]='';this[_0x46e3('0xf')]='';this[_0x46e3('0x10')]='';this[_0x46e3('0x11')]='';this[_0x46e3('0x12')]=_0x1e16a7[_0x46e3('0x12')]||![];this[_0x46e3('0x13')]=_0x46e3('0xc');this['voiceStatusTime']=0x0;this[_0x46e3('0x14')]='';this[_0x46e3('0x15')]='';this['onhold']=![];this[_0x46e3('0x16')]=![];this[_0x46e3('0x3')]='';}Agent[_0x46e3('0x17')][_0x46e3('0x18')]=function(_0x2a2023){var _0x64dcec;if(_0x2a2023&&_0x2a2023[_0x46e3('0xb')]){_0x64dcec=_0x2a2023[_0x46e3('0xb')][_0x46e3('0x19')]();switch(_0x64dcec){case _0x46e3('0x1a'):_0x64dcec=_0x46e3('0x1b');break;case _0x46e3('0x1c'):_0x64dcec=_0x46e3('0x1d');break;}}if(_0x64dcec&&this[_0x46e3('0x13')]!==_0x64dcec||_0x2a2023['statePause']){this[_0x46e3('0x1e')]=_[_0x46e3('0x1f')](moment()[_0x46e3('0x20')]('x'));}if(_0x64dcec){this[_0x46e3('0x13')]=_0x64dcec;}var _0x5ea08b={'id':this['id'],'name':this[_0x46e3('0x7')],'email':this[_0x46e3('0x8')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x46e3('0xb')],'stateTime':this[_0x46e3('0x21')],'status':this[_0x46e3('0xd')],'address':this[_0x46e3('0xe')],'online':this[_0x46e3('0x12')],'voiceStatus':this[_0x46e3('0x13')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0x46e3('0x14')],'voiceStatusQueue':this[_0x46e3('0x15')],'interface':this[_0x46e3('0x11')],'onhold':this[_0x46e3('0x22')]};var _0x16c4b7=md5(JSON['stringify'](_0x5ea08b));if(this[_0x46e3('0x3')]!==_0x16c4b7){this[_0x46e3('0x3')]=_0x16c4b7;io['to'](util[_0x46e3('0x20')]('user:%s',_0x5ea08b[_0x46e3('0x7')]))[_0x46e3('0x23')](_0x46e3('0x24'),_0x5ea08b);}};module[_0x46e3('0x25')]=Agent; \ No newline at end of file +var _0x3de3=['format','status','voiceStatusQueue','stringify','user:%s','emit','user:save','lodash','moment','md5','ioredis','redis','defaults','localhost','name','email','accountcode','fullname','state','unknown','stateTime','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','onhold','toLowerCase','idle','inuse','talking','statePause','toNumber'];(function(_0x64aff8,_0x106082){var _0x5488a3=function(_0x36969c){while(--_0x36969c){_0x64aff8['push'](_0x64aff8['shift']());}};_0x5488a3(++_0x106082);}(_0x3de3,0xdf));var _0x33de=function(_0xfd72c2,_0x5b71e0){_0xfd72c2=_0xfd72c2-0x0;var _0x1392af=_0x3de3[_0xfd72c2];return _0x1392af;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var moment=require(_0x33de('0x1'));var md5=require(_0x33de('0x2'));var Redis=require(_0x33de('0x3'));var config=require('../../../config/environment');config[_0x33de('0x4')]=_[_0x33de('0x5')](config[_0x33de('0x4')],{'host':_0x33de('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x33de('0x4')]));function Agent(_0xf5022c){this['id']=_0xf5022c['id']||0x0;this[_0x33de('0x7')]=_0xf5022c[_0x33de('0x7')]||'';this['email']=_0xf5022c[_0x33de('0x8')]||'';this[_0x33de('0x9')]=_0xf5022c[_0x33de('0x9')]||'';this[_0x33de('0xa')]=_0xf5022c[_0x33de('0xa')]||'';this[_0x33de('0xb')]=_0x33de('0xc');this[_0x33de('0xd')]=0x0;this['status']=_0x33de('0xc');this[_0x33de('0xe')]='';this[_0x33de('0xf')]='';this[_0x33de('0x10')]='';this[_0x33de('0x11')]='';this[_0x33de('0x12')]=_0xf5022c[_0x33de('0x12')]||![];this[_0x33de('0x13')]=_0x33de('0xc');this[_0x33de('0x14')]=0x0;this[_0x33de('0x15')]='';this['voiceStatusQueue']='';this[_0x33de('0x16')]=![];this['local']=![];this[_0x33de('0x2')]='';}Agent['prototype']['updateStatusRealtime']=function(_0x5a5d77){var _0x2a11d5;if(_0x5a5d77&&_0x5a5d77[_0x33de('0xb')]){_0x2a11d5=_0x5a5d77[_0x33de('0xb')][_0x33de('0x17')]();switch(_0x2a11d5){case'not_inuse':_0x2a11d5=_0x33de('0x18');break;case _0x33de('0x19'):_0x2a11d5=_0x33de('0x1a');break;}}if(_0x2a11d5&&this['voiceStatus']!==_0x2a11d5||_0x5a5d77[_0x33de('0x1b')]){this[_0x33de('0x14')]=_[_0x33de('0x1c')](moment()[_0x33de('0x1d')]('x'));}if(_0x2a11d5){this[_0x33de('0x13')]=_0x2a11d5;}var _0x5cbabe={'id':this['id'],'name':this[_0x33de('0x7')],'email':this[_0x33de('0x8')],'accountcode':this[_0x33de('0x9')],'fullname':this[_0x33de('0xa')],'state':this[_0x33de('0xb')],'stateTime':this[_0x33de('0xd')],'status':this[_0x33de('0x1e')],'address':this[_0x33de('0xe')],'online':this[_0x33de('0x12')],'voiceStatus':this[_0x33de('0x13')],'voiceStatusTime':this[_0x33de('0x14')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x33de('0x1f')],'interface':this[_0x33de('0x11')],'onhold':this[_0x33de('0x16')]};var _0x58ce50=md5(JSON[_0x33de('0x20')](_0x5cbabe));if(this['md5']!==_0x58ce50){this[_0x33de('0x2')]=_0x58ce50;io['to'](util[_0x33de('0x1d')](_0x33de('0x21'),_0x5cbabe[_0x33de('0x7')]))[_0x33de('0x22')](_0x33de('0x23'),_0x5cbabe);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index aa7c7ee..b085e8b 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 _0x46a2=['dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','exports','name','type','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber'];(function(_0x34abf7,_0x33b033){var _0x23f106=function(_0x1dfad9){while(--_0x1dfad9){_0x34abf7['push'](_0x34abf7['shift']());}};_0x23f106(++_0x33b033);}(_0x46a2,0xfa));var _0x246a=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0x46a2[_0x21af3a];return _0x268a49;};'use strict';function Campaign(_0x5a6c2d){this['id']=_0x5a6c2d['id']||0x0;this[_0x246a('0x0')]=_0x5a6c2d['name']||'';this['type']=_0x5a6c2d[_0x246a('0x1')]||'campaign';this['originated']=0x0;this[_0x246a('0x2')]=0x0;this[_0x246a('0x3')]=0x0;this[_0x246a('0x4')]=0x0;this[_0x246a('0x5')]='';this[_0x246a('0x6')]=!![];this['active']=_0x5a6c2d['active'];this[_0x246a('0x7')]=_0x5a6c2d['limitCalls'];this['dialTimezone']=_0x5a6c2d[_0x246a('0x8')]||null;this['dialGlobalInterval']=_0x5a6c2d['dialGlobalInterval']?_0x5a6c2d[_0x246a('0x9')]:null;this[_0x246a('0xa')]=_0x5a6c2d[_0x246a('0xa')];this[_0x246a('0xb')]=_0x5a6c2d[_0x246a('0xb')];this[_0x246a('0xc')]=_0x5a6c2d[_0x246a('0xc')]||0x1e;this[_0x246a('0xd')]=_0x5a6c2d['dialCongestionMaxRetry'];this[_0x246a('0xe')]=_0x5a6c2d[_0x246a('0xe')];this[_0x246a('0xf')]=_0x5a6c2d[_0x246a('0xf')];this[_0x246a('0x10')]=_0x5a6c2d[_0x246a('0x10')];this['dialNoAnswerMaxRetry']=_0x5a6c2d['dialNoAnswerMaxRetry'];this[_0x246a('0x11')]=_0x5a6c2d['dialNoAnswerRetryFrequency'];this[_0x246a('0x12')]=_0x5a6c2d[_0x246a('0x12')];this[_0x246a('0x13')]=_0x5a6c2d[_0x246a('0x13')]||0x3;this[_0x246a('0x14')]=_0x5a6c2d[_0x246a('0x14')]||0x96;this[_0x246a('0x15')]=_0x5a6c2d[_0x246a('0x15')]||0x3;this['dialDropRetryFrequency']=_0x5a6c2d[_0x246a('0x16')]||0x96;this['dialAbandonedMaxRetry']=_0x5a6c2d['dialAbandonedMaxRetry']||0x3;this[_0x246a('0x17')]=_0x5a6c2d[_0x246a('0x17')]||0x96;this['dialMachineMaxRetry']=_0x5a6c2d[_0x246a('0x18')]||0x3;this[_0x246a('0x19')]=_0x5a6c2d[_0x246a('0x19')]||0x96;this[_0x246a('0x1a')]=_0x5a6c2d[_0x246a('0x1a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x5a6c2d[_0x246a('0x1b')]||0x96;this[_0x246a('0x1c')]=_0x5a6c2d[_0x246a('0x1c')]||_0x246a('0x1d');this[_0x246a('0x1e')]=_0x5a6c2d[_0x246a('0x1e')]||undefined;this[_0x246a('0x1f')]=_0x5a6c2d['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x246a('0x20')]=_0x5a6c2d[_0x246a('0x20')]||undefined;this[_0x246a('0x21')]=_0x5a6c2d['TrunkBackup']?_0x5a6c2d['TrunkBackup']:undefined;this['Trunk']=_0x5a6c2d['Trunk']?_0x5a6c2d[_0x246a('0x22')]:undefined;this[_0x246a('0x23')]=_0x5a6c2d[_0x246a('0x23')]?_0x5a6c2d[_0x246a('0x23')]:undefined;this[_0x246a('0x24')]=_0x5a6c2d['SquareProject']?_0x5a6c2d['SquareProject']:undefined;this[_0x246a('0x25')]=_0x5a6c2d[_0x246a('0x24')]?_0x5a6c2d[_0x246a('0x24')][_0x246a('0x0')]:undefined;this[_0x246a('0x26')]=_0x5a6c2d[_0x246a('0x26')]||![];this['dialAMDInitialSilence']=_0x5a6c2d[_0x246a('0x27')];this[_0x246a('0x28')]=_0x5a6c2d[_0x246a('0x28')];this[_0x246a('0x29')]=_0x5a6c2d[_0x246a('0x29')];this[_0x246a('0x2a')]=_0x5a6c2d[_0x246a('0x2a')];this[_0x246a('0x2b')]=_0x5a6c2d[_0x246a('0x2b')];this['dialAMDBetweenWordsSilence']=_0x5a6c2d['dialAMDBetweenWordsSilence'];this[_0x246a('0x2c')]=_0x5a6c2d['dialAMDMaximumNumberOfWords'];this[_0x246a('0x2d')]=_0x5a6c2d['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x5a6c2d['dialAMDMaximumWordLength'];}module[_0x246a('0x2e')]=Campaign; \ No newline at end of file +var _0xd9d3=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','exports','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency'];(function(_0x17462c,_0xbc4726){var _0x1e0691=function(_0xf3d645){while(--_0xf3d645){_0x17462c['push'](_0x17462c['shift']());}};_0x1e0691(++_0xbc4726);}(_0xd9d3,0x11a));var _0x3d9d=function(_0x545d82,_0x36a477){_0x545d82=_0x545d82-0x0;var _0x57bc51=_0xd9d3[_0x545d82];return _0x57bc51;};'use strict';function Campaign(_0x3968fc){this['id']=_0x3968fc['id']||0x0;this[_0x3d9d('0x0')]=_0x3968fc[_0x3d9d('0x0')]||'';this[_0x3d9d('0x1')]=_0x3968fc['type']||_0x3d9d('0x2');this['originated']=0x0;this[_0x3d9d('0x3')]=0x0;this[_0x3d9d('0x4')]=0x0;this[_0x3d9d('0x5')]=0x0;this[_0x3d9d('0x6')]='';this[_0x3d9d('0x7')]=!![];this[_0x3d9d('0x8')]=_0x3968fc['active'];this[_0x3d9d('0x9')]=_0x3968fc[_0x3d9d('0x9')];this[_0x3d9d('0xa')]=_0x3968fc[_0x3d9d('0xa')]||null;this[_0x3d9d('0xb')]=_0x3968fc[_0x3d9d('0xb')]?_0x3968fc[_0x3d9d('0xb')]:null;this[_0x3d9d('0xc')]=_0x3968fc['dialOriginateCallerIdName'];this[_0x3d9d('0xd')]=_0x3968fc[_0x3d9d('0xd')];this['dialOriginateTimeout']=_0x3968fc['dialOriginateTimeout']||0x1e;this['dialCongestionMaxRetry']=_0x3968fc[_0x3d9d('0xe')];this['dialCongestionRetryFrequency']=_0x3968fc[_0x3d9d('0xf')];this['dialBusyMaxRetry']=_0x3968fc[_0x3d9d('0x10')];this[_0x3d9d('0x11')]=_0x3968fc[_0x3d9d('0x11')];this[_0x3d9d('0x12')]=_0x3968fc[_0x3d9d('0x12')];this[_0x3d9d('0x13')]=_0x3968fc[_0x3d9d('0x13')];this[_0x3d9d('0x14')]=_0x3968fc['dialGlobalMaxRetry'];this[_0x3d9d('0x15')]=_0x3968fc['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x3968fc[_0x3d9d('0x16')]||0x96;this['dialDropMaxRetry']=_0x3968fc[_0x3d9d('0x17')]||0x3;this[_0x3d9d('0x18')]=_0x3968fc[_0x3d9d('0x18')]||0x96;this[_0x3d9d('0x19')]=_0x3968fc[_0x3d9d('0x19')]||0x3;this[_0x3d9d('0x1a')]=_0x3968fc['dialAbandonedRetryFrequency']||0x96;this[_0x3d9d('0x1b')]=_0x3968fc[_0x3d9d('0x1b')]||0x3;this[_0x3d9d('0x1c')]=_0x3968fc[_0x3d9d('0x1c')]||0x96;this[_0x3d9d('0x1d')]=_0x3968fc[_0x3d9d('0x1d')]||0x3;this[_0x3d9d('0x1e')]=_0x3968fc['dialAgentRejectRetryFrequency']||0x96;this[_0x3d9d('0x1f')]=_0x3968fc['dialOrderByScheduledAt']||_0x3d9d('0x20');this[_0x3d9d('0x21')]=_0x3968fc[_0x3d9d('0x21')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x3968fc[_0x3d9d('0x22')]||undefined;this[_0x3d9d('0x23')]=_0x3968fc[_0x3d9d('0x23')]||undefined;this['TrunkBackup']=_0x3968fc[_0x3d9d('0x24')]?_0x3968fc[_0x3d9d('0x24')]:undefined;this[_0x3d9d('0x25')]=_0x3968fc[_0x3d9d('0x25')]?_0x3968fc[_0x3d9d('0x25')]:undefined;this[_0x3d9d('0x26')]=_0x3968fc['Interval']?_0x3968fc[_0x3d9d('0x26')]:undefined;this[_0x3d9d('0x27')]=_0x3968fc[_0x3d9d('0x27')]?_0x3968fc[_0x3d9d('0x27')]:undefined;this[_0x3d9d('0x28')]=_0x3968fc['SquareProject']?_0x3968fc[_0x3d9d('0x27')][_0x3d9d('0x0')]:undefined;this[_0x3d9d('0x29')]=_0x3968fc[_0x3d9d('0x29')]||![];this[_0x3d9d('0x2a')]=_0x3968fc[_0x3d9d('0x2a')];this['dialAMDGreeting']=_0x3968fc['dialAMDGreeting'];this[_0x3d9d('0x2b')]=_0x3968fc[_0x3d9d('0x2b')];this[_0x3d9d('0x2c')]=_0x3968fc[_0x3d9d('0x2c')];this[_0x3d9d('0x2d')]=_0x3968fc['dialAMDMinWordLength'];this[_0x3d9d('0x2e')]=_0x3968fc[_0x3d9d('0x2e')];this[_0x3d9d('0x2f')]=_0x3968fc['dialAMDMaximumNumberOfWords'];this[_0x3d9d('0x30')]=_0x3968fc[_0x3d9d('0x30')];this['dialAMDMaximumWordLength']=_0x3968fc['dialAMDMaximumWordLength'];}module[_0x3d9d('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index a0c27be..1e363e6 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 _0xdc5d=['monitorFilename','queue','transferconnectedlinenum','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','accountcode','context','exten','answered','endtime','abandoned','lastapplication','billableseconds','holdtime','type','tag','disposition','monitor'];(function(_0x4be6aa,_0x13e0f0){var _0x24decb=function(_0x4d0052){while(--_0x4d0052){_0x4be6aa['push'](_0x4be6aa['shift']());}};_0x24decb(++_0x13e0f0);}(_0xdc5d,0x14d));var _0xddc5=function(_0x4e8286,_0x4eaeb4){_0x4e8286=_0x4e8286-0x0;var _0x44a440=_0xdc5d[_0x4e8286];return _0x44a440;};'use strict';function Channel(){this[_0xddc5('0x0')]=null;this[_0xddc5('0x1')]='';this[_0xddc5('0x2')]='';this[_0xddc5('0x3')]=0x0;this[_0xddc5('0x4')]='';this[_0xddc5('0x5')]=undefined;this['connectedlinename']=undefined;this[_0xddc5('0x6')]=0x0;this[_0xddc5('0x7')]='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0xddc5('0x8')]=0x0;this[_0xddc5('0x9')]=![];this['answertime']=null;this[_0xddc5('0xa')]=null;this['unmanaged']=![];this[_0xddc5('0xb')]=![];this[_0xddc5('0xc')]='';this['lastdata']='';this['duration']=0x0;this[_0xddc5('0xd')]=0x0;this[_0xddc5('0xe')]=0x0;this[_0xddc5('0xf')]=null;this[_0xddc5('0x10')]=null;this[_0xddc5('0x11')]=null;this[_0xddc5('0x12')]=![];this[_0xddc5('0x13')]=null;this[_0xddc5('0x14')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0xddc5('0x15')]=undefined;this['mohtime']=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x6ac3=['answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','calleridnum','connectedlinenum','connectedlinename','uniqueid','exten','answered'];(function(_0x3b77b1,_0x5016c6){var _0x18989b=function(_0x451c69){while(--_0x451c69){_0x3b77b1['push'](_0x3b77b1['shift']());}};_0x18989b(++_0x5016c6);}(_0x6ac3,0x14a));var _0x36ac=function(_0x282880,_0x1c62aa){_0x282880=_0x282880-0x0;var _0x4c2699=_0x6ac3[_0x282880];return _0x4c2699;};'use strict';function Channel(){this[_0x36ac('0x0')]=null;this[_0x36ac('0x1')]='';this['destinationchannel']='';this[_0x36ac('0x2')]=0x0;this['calleridname']='';this[_0x36ac('0x3')]=undefined;this[_0x36ac('0x4')]=undefined;this['accountcode']=0x0;this['context']='';this[_0x36ac('0x5')]=0x0;this['linkedid']=0x0;this[_0x36ac('0x6')]=0x0;this[_0x36ac('0x7')]=![];this[_0x36ac('0x8')]=null;this[_0x36ac('0x9')]=null;this[_0x36ac('0xa')]=![];this[_0x36ac('0xb')]=![];this[_0x36ac('0xc')]='';this[_0x36ac('0xd')]='';this['duration']=0x0;this[_0x36ac('0xe')]=0x0;this[_0x36ac('0xf')]=0x0;this[_0x36ac('0x10')]=null;this[_0x36ac('0x11')]=null;this[_0x36ac('0x12')]=null;this[_0x36ac('0x13')]=![];this[_0x36ac('0x14')]=null;this['queue']=null;this[_0x36ac('0x15')]=[];this[_0x36ac('0x16')]=undefined;this[_0x36ac('0x17')]=undefined;this[_0x36ac('0x18')]=0x0;}module[_0x36ac('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 100faed..81bc584 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 _0xb4c7=['password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4cd36e,_0x5ea3e1){_0x4cd36e=_0x4cd36e-0x0;var _0x509d18=_0xb4c7[_0x4cd36e];return _0x509d18;};'use strict';function DeskAccount(_0x54a040){this['id']=_0x54a040['id']||0x0;this[_0x7b4c('0x0')]=_0x54a040[_0x7b4c('0x0')]||'';this[_0x7b4c('0x1')]=_0x54a040[_0x7b4c('0x1')]||'';this['remoteUri']=_0x54a040[_0x7b4c('0x2')]||'';this[_0x7b4c('0x3')]=_0x54a040[_0x7b4c('0x3')]||'';this[_0x7b4c('0x4')]=_0x54a040[_0x7b4c('0x4')]||'';this['consumerKey']=_0x54a040[_0x7b4c('0x5')]||'';this[_0x7b4c('0x6')]=_0x54a040[_0x7b4c('0x6')]||'';this['token']=_0x54a040[_0x7b4c('0x7')]||'';this[_0x7b4c('0x8')]=_0x54a040['tokenSecret']||'';this[_0x7b4c('0x9')]=_0x54a040[_0x7b4c('0x9')]||'';this[_0x7b4c('0xa')]=_0x54a040[_0x7b4c('0xa')]||'';this[_0x7b4c('0xb')]=_0x54a040[_0x7b4c('0xb')]||{};}module[_0x7b4c('0xc')]=DeskAccount; \ No newline at end of file +var _0x8784=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret'];(function(_0x3cbb14,_0x3c95a7){var _0x2bfb35=function(_0x384c4d){while(--_0x384c4d){_0x3cbb14['push'](_0x3cbb14['shift']());}};_0x2bfb35(++_0x3c95a7);}(_0x8784,0x172));var _0x4878=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0x8784[_0x5f46e7];return _0x567e95;};'use strict';function DeskAccount(_0xb0b16d){this['id']=_0xb0b16d['id']||0x0;this[_0x4878('0x0')]=_0xb0b16d['name']||'';this[_0x4878('0x1')]=_0xb0b16d[_0x4878('0x1')]||'';this[_0x4878('0x2')]=_0xb0b16d[_0x4878('0x2')]||'';this[_0x4878('0x3')]=_0xb0b16d['authType']||'';this['password']=_0xb0b16d[_0x4878('0x4')]||'';this[_0x4878('0x5')]=_0xb0b16d[_0x4878('0x5')]||'';this[_0x4878('0x6')]=_0xb0b16d[_0x4878('0x6')]||'';this[_0x4878('0x7')]=_0xb0b16d[_0x4878('0x7')]||'';this[_0x4878('0x8')]=_0xb0b16d[_0x4878('0x8')]||'';this['type']=_0xb0b16d[_0x4878('0x9')]||'';this[_0x4878('0xa')]=_0xb0b16d[_0x4878('0xa')]||'';this[_0x4878('0xb')]=_0xb0b16d[_0x4878('0xb')]||{};}module[_0x4878('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 63eb750..bdf99ae 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 _0x9e2b=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9e2b,0x190));var _0xb9e2=function(_0x4e4cee,_0x1078c7){_0x4e4cee=_0x4e4cee-0x0;var _0x7fbcc0=_0x9e2b[_0x4e4cee];return _0x7fbcc0;};'use strict';function Dynamics365Account(_0x5a0dd6){this['id']=_0x5a0dd6['id']||0x0;this[_0xb9e2('0x0')]=_0x5a0dd6[_0xb9e2('0x0')]||'';this[_0xb9e2('0x1')]=_0x5a0dd6[_0xb9e2('0x1')]||'';this[_0xb9e2('0x2')]=_0x5a0dd6[_0xb9e2('0x2')]||'';this[_0xb9e2('0x3')]=_0x5a0dd6[_0xb9e2('0x3')]||'';this[_0xb9e2('0x4')]=_0x5a0dd6['tenantId']||'';this[_0xb9e2('0x5')]=_0x5a0dd6[_0xb9e2('0x5')]||'';this[_0xb9e2('0x6')]=_0x5a0dd6[_0xb9e2('0x6')]||{};this['serverUrl']=_0x5a0dd6[_0xb9e2('0x7')]||'';this[_0xb9e2('0x8')]=_0x5a0dd6['Configurations']||{};}module[_0xb9e2('0x9')]=Dynamics365Account; \ No newline at end of file +var _0xf00e=['tenantId','clientId','clientSecret','serverUrl','Configurations','exports','username','password','remoteUri'];(function(_0x4f60d1,_0x1f8ab9){var _0x4303d2=function(_0x4e0d83){while(--_0x4e0d83){_0x4f60d1['push'](_0x4f60d1['shift']());}};_0x4303d2(++_0x1f8ab9);}(_0xf00e,0x141));var _0xef00=function(_0x5edac1,_0x20f7c2){_0x5edac1=_0x5edac1-0x0;var _0x576d56=_0xf00e[_0x5edac1];return _0x576d56;};'use strict';function Dynamics365Account(_0x58e8f9){this['id']=_0x58e8f9['id']||0x0;this['name']=_0x58e8f9['name']||'';this[_0xef00('0x0')]=_0x58e8f9[_0xef00('0x0')]||'';this['password']=_0x58e8f9[_0xef00('0x1')]||'';this[_0xef00('0x2')]=_0x58e8f9[_0xef00('0x2')]||'';this[_0xef00('0x3')]=_0x58e8f9[_0xef00('0x3')]||'';this['clientId']=_0x58e8f9[_0xef00('0x4')]||'';this[_0xef00('0x5')]=_0x58e8f9[_0xef00('0x5')]||{};this[_0xef00('0x6')]=_0x58e8f9[_0xef00('0x6')]||'';this[_0xef00('0x7')]=_0x58e8f9[_0xef00('0x7')]||{};}module[_0xef00('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index e08d99e..a3ef7cf 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 _0x58fd=['minrate','maxrate','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','exports','name','description','ecm','headerinfo','localstationid'];(function(_0x2fbf4c,_0x5aded6){var _0x20bff3=function(_0x52975e){while(--_0x52975e){_0x2fbf4c['push'](_0x2fbf4c['shift']());}};_0x20bff3(++_0x5aded6);}(_0x58fd,0x1cc));var _0xd58f=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x58fd[_0xa1e3e3];return _0xc980e9;};'use strict';function FaxAccount(_0x3937d8){this['id']=_0x3937d8['id']||0x0;this['name']=_0x3937d8[_0xd58f('0x0')]||'';this['description']=_0x3937d8[_0xd58f('0x1')];this[_0xd58f('0x2')]=_0x3937d8[_0xd58f('0x2')];this[_0xd58f('0x3')]=_0x3937d8[_0xd58f('0x3')];this[_0xd58f('0x4')]=_0x3937d8[_0xd58f('0x4')];this['minrate']=_0x3937d8[_0xd58f('0x5')]||0x960;this[_0xd58f('0x6')]=_0x3937d8[_0xd58f('0x6')]||0x3840;this['modem']=_0x3937d8['modem']||'v17,v27,v29';this[_0xd58f('0x7')]=_0x3937d8[_0xd58f('0x7')]||'no';this[_0xd58f('0x8')]=_0x3937d8[_0xd58f('0x8')]||'no';this[_0xd58f('0x9')]=_0x3937d8['t38timeout']||0x1388;this[_0xd58f('0xa')]=_0x3937d8['tech']||_0xd58f('0xb');this['Trunk']=_0x3937d8[_0xd58f('0xc')]?_0x3937d8[_0xd58f('0xc')]:undefined;this['ListId']=_0x3937d8[_0xd58f('0xd')];this['key']=_0x3937d8['key'];}module[_0xd58f('0xe')]=FaxAccount; \ No newline at end of file +var _0xb366=['description','ecm','headerinfo','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb366,0xa4));var _0x6b36=function(_0x25ce33,_0x595d76){_0x25ce33=_0x25ce33-0x0;var _0x45c699=_0xb366[_0x25ce33];return _0x45c699;};'use strict';function FaxAccount(_0x1a49f5){this['id']=_0x1a49f5['id']||0x0;this['name']=_0x1a49f5[_0x6b36('0x0')]||'';this[_0x6b36('0x1')]=_0x1a49f5['description'];this[_0x6b36('0x2')]=_0x1a49f5[_0x6b36('0x2')];this[_0x6b36('0x3')]=_0x1a49f5['headerinfo'];this['localstationid']=_0x1a49f5['localstationid'];this[_0x6b36('0x4')]=_0x1a49f5[_0x6b36('0x4')]||0x960;this['maxrate']=_0x1a49f5[_0x6b36('0x5')]||0x3840;this['modem']=_0x1a49f5['modem']||_0x6b36('0x6');this[_0x6b36('0x7')]=_0x1a49f5[_0x6b36('0x7')]||'no';this[_0x6b36('0x8')]=_0x1a49f5['faxdetect']||'no';this[_0x6b36('0x9')]=_0x1a49f5[_0x6b36('0x9')]||0x1388;this['tech']=_0x1a49f5[_0x6b36('0xa')]||'SIP';this[_0x6b36('0xb')]=_0x1a49f5[_0x6b36('0xb')]?_0x1a49f5[_0x6b36('0xb')]:undefined;this[_0x6b36('0xc')]=_0x1a49f5[_0x6b36('0xc')];this[_0x6b36('0xd')]=_0x1a49f5['key'];}module[_0x6b36('0xe')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index d5c8382..8cf3f82 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 _0x2958=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x17a597,_0x1256b1){var _0xa71658=function(_0x8c1c74){while(--_0x8c1c74){_0x17a597['push'](_0x17a597['shift']());}};_0xa71658(++_0x1256b1);}(_0x2958,0x1aa));var _0x8295=function(_0x503022,_0x3de810){_0x503022=_0x503022-0x0;var _0x8e4e1c=_0x2958[_0x503022];return _0x8e4e1c;};'use strict';function FreshdeskAccount(_0xcadfcb){this['id']=_0xcadfcb['id']||0x0;this[_0x8295('0x0')]=_0xcadfcb[_0x8295('0x0')]||'';this[_0x8295('0x1')]=_0xcadfcb['username']||'';this[_0x8295('0x2')]=_0xcadfcb[_0x8295('0x3')]||'';this[_0x8295('0x4')]=_0xcadfcb[_0x8295('0x4')]||'';this['serverUrl']=_0xcadfcb[_0x8295('0x5')]||'';this[_0x8295('0x6')]=_0xcadfcb[_0x8295('0x6')]||{};}module[_0x8295('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x2c84=['exports','name','username','token','Configurations'];(function(_0xdb3758,_0x1bab9d){var _0xa0d0cc=function(_0x35d798){while(--_0x35d798){_0xdb3758['push'](_0xdb3758['shift']());}};_0xa0d0cc(++_0x1bab9d);}(_0x2c84,0x187));var _0x42c8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2c84[_0x1facfa];return _0x9ec701;};'use strict';function FreshdeskAccount(_0x469398){this['id']=_0x469398['id']||0x0;this[_0x42c8('0x0')]=_0x469398[_0x42c8('0x0')]||'';this[_0x42c8('0x1')]=_0x469398[_0x42c8('0x1')]||'';this['apiKey']=_0x469398[_0x42c8('0x2')]||'';this['remoteUri']=_0x469398['remoteUri']||'';this['serverUrl']=_0x469398['serverUrl']||'';this[_0x42c8('0x3')]=_0x469398[_0x42c8('0x3')]||{};}module[_0x42c8('0x4')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 9b5cc85..3540075 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 _0xb5dc=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x18b641,_0x5e81db){var _0x26966e=function(_0x2cfb64){while(--_0x2cfb64){_0x18b641['push'](_0x18b641['shift']());}};_0x26966e(++_0x5e81db);}(_0xb5dc,0xf7));var _0xcb5d=function(_0x2ec593,_0x167967){_0x2ec593=_0x2ec593-0x0;var _0x1a9f9e=_0xb5dc[_0x2ec593];return _0x1a9f9e;};'use strict';function FreshsalesAccount(_0x7798e){this['id']=_0x7798e['id']||0x0;this[_0xcb5d('0x0')]=_0x7798e[_0xcb5d('0x0')]||'';this[_0xcb5d('0x1')]=_0x7798e['username']||'';this[_0xcb5d('0x2')]=_0x7798e[_0xcb5d('0x3')]||'';this[_0xcb5d('0x4')]=_0x7798e[_0xcb5d('0x4')]||'';this[_0xcb5d('0x5')]=_0x7798e[_0xcb5d('0x5')]||'';this[_0xcb5d('0x6')]=_0x7798e[_0xcb5d('0x6')]||{};}module[_0xcb5d('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0x2772=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x42b05f,_0x180e1e){var _0x320112=function(_0x2e7f9f){while(--_0x2e7f9f){_0x42b05f['push'](_0x42b05f['shift']());}};_0x320112(++_0x180e1e);}(_0x2772,0x1d8));var _0x2277=function(_0xe55f76,_0x5df9bb){_0xe55f76=_0xe55f76-0x0;var _0x2b2bd2=_0x2772[_0xe55f76];return _0x2b2bd2;};'use strict';function FreshsalesAccount(_0x12c267){this['id']=_0x12c267['id']||0x0;this[_0x2277('0x0')]=_0x12c267[_0x2277('0x0')]||'';this['username']=_0x12c267[_0x2277('0x1')]||'';this[_0x2277('0x2')]=_0x12c267[_0x2277('0x3')]||'';this[_0x2277('0x4')]=_0x12c267[_0x2277('0x4')]||'';this[_0x2277('0x5')]=_0x12c267['serverUrl']||'';this['Configurations']=_0x12c267[_0x2277('0x6')]||{};}module[_0x2277('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 c721438..010ff0e 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 _0xf7dc=['assigned','lastAssignedTo','variables','exports','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime'];(function(_0x459335,_0x2e95dd){var _0x50f00b=function(_0x5ccdaf){while(--_0x5ccdaf){_0x459335['push'](_0x459335['shift']());}};_0x50f00b(++_0x2e95dd);}(_0xf7dc,0x194));var _0xcf7d=function(_0x5870f1,_0x2e9a4a){_0x5870f1=_0x5870f1-0x0;var _0x540595=_0xf7dc[_0x5870f1];return _0x540595;};'use strict';function QueueReport(){this['type']=_0xcf7d('0x0');this['uniqueid']='';this[_0xcf7d('0x1')]='';this[_0xcf7d('0x2')]='';this[_0xcf7d('0x3')]='';this[_0xcf7d('0x4')]=null;this[_0xcf7d('0x5')]=null;this[_0xcf7d('0x6')]=0x1;this[_0xcf7d('0x7')]=0x1;this[_0xcf7d('0x8')]=![];this[_0xcf7d('0x9')]=null;this[_0xcf7d('0xa')]=![];this[_0xcf7d('0xb')]=null;this[_0xcf7d('0xc')]=![];this[_0xcf7d('0xd')]=null;this['originalposition']=0x1;this[_0xcf7d('0xe')]='';this[_0xcf7d('0xf')]='';this[_0xcf7d('0x10')]='';this[_0xcf7d('0x11')]='';this[_0xcf7d('0x12')]='';this[_0xcf7d('0x13')]='';this['priority']='';this[_0xcf7d('0x14')]=0x0;this[_0xcf7d('0x15')]=![];this[_0xcf7d('0x16')]='';this['mohtime']=0x0;this[_0xcf7d('0x17')]={};}module[_0xcf7d('0x18')]=QueueReport; \ No newline at end of file +var _0xe104=['queuecallerjoinAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','mohtime','type','uniqueid','calleridnum','calleridname','queue'];(function(_0x11ee99,_0xa743ed){var _0x469072=function(_0xdaef8){while(--_0xdaef8){_0x11ee99['push'](_0x11ee99['shift']());}};_0x469072(++_0xa743ed);}(_0xe104,0x126));var _0x4e10=function(_0x1c2ddc,_0xc8fdfa){_0x1c2ddc=_0x1c2ddc-0x0;var _0x3ea6d=_0xe104[_0x1c2ddc];return _0x3ea6d;};'use strict';function QueueReport(){this[_0x4e10('0x0')]='inbound';this[_0x4e10('0x1')]='';this[_0x4e10('0x2')]='';this[_0x4e10('0x3')]='';this[_0x4e10('0x4')]='';this[_0x4e10('0x5')]=null;this['queuecallerleaveAt']=null;this[_0x4e10('0x6')]=0x1;this[_0x4e10('0x7')]=0x1;this[_0x4e10('0x8')]=![];this[_0x4e10('0x9')]=null;this[_0x4e10('0xa')]=![];this['queuecallercompleteAt']=null;this[_0x4e10('0xb')]=![];this[_0x4e10('0xc')]=null;this[_0x4e10('0xd')]=0x1;this['channel']='';this[_0x4e10('0xe')]='';this[_0x4e10('0xf')]='';this[_0x4e10('0x10')]='';this[_0x4e10('0x11')]='';this[_0x4e10('0x12')]='';this['priority']='';this[_0x4e10('0x13')]=0x0;this[_0x4e10('0x14')]=![];this[_0x4e10('0x15')]='';this[_0x4e10('0x16')]=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 1eebaed..afda756 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 _0xbaab=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0xbaab,0x112));var _0xbbaa=function(_0x556073,_0x200b5f){_0x556073=_0x556073-0x0;var _0x3b04b9=_0xbaab[_0x556073];return _0x3b04b9;};'use strict';function SalesforceAccount(_0x45f264){this['id']=_0x45f264['id']||0x0;this['name']=_0x45f264[_0xbbaa('0x0')]||'';this[_0xbbaa('0x1')]=_0x45f264[_0xbbaa('0x1')]||'';this[_0xbbaa('0x2')]=_0x45f264[_0xbbaa('0x2')]||'';this[_0xbbaa('0x3')]=_0x45f264[_0xbbaa('0x3')]||'';this[_0xbbaa('0x4')]=_0x45f264[_0xbbaa('0x4')]||'';this['clientSecret']=_0x45f264[_0xbbaa('0x5')]||'';this[_0xbbaa('0x6')]=_0x45f264[_0xbbaa('0x6')]||'';this[_0xbbaa('0x7')]=_0x45f264[_0xbbaa('0x7')]||_0xbbaa('0x8');this[_0xbbaa('0x9')]=_0x45f264[_0xbbaa('0x9')]||'';this[_0xbbaa('0xa')]=_0x45f264['Configurations']||{};}module[_0xbbaa('0xb')]=SalesforceAccount; \ No newline at end of file +var _0xaf64=['exports','name','remoteUri','password','clientId','clientSecret','type','integrationTab','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaf64,0xf1));var _0x4af6=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0xaf64[_0x562faf];return _0x22c1f6;};'use strict';function SalesforceAccount(_0x321327){this['id']=_0x321327['id']||0x0;this[_0x4af6('0x0')]=_0x321327[_0x4af6('0x0')]||'';this['username']=_0x321327['username']||'';this[_0x4af6('0x1')]=_0x321327[_0x4af6('0x1')]||'';this['password']=_0x321327[_0x4af6('0x2')]||'';this[_0x4af6('0x3')]=_0x321327[_0x4af6('0x3')]||'';this[_0x4af6('0x4')]=_0x321327[_0x4af6('0x4')]||'';this['securityToken']=_0x321327['securityToken']||'';this[_0x4af6('0x5')]=_0x321327['type']||_0x4af6('0x6');this[_0x4af6('0x7')]=_0x321327['serverUrl']||'';this[_0x4af6('0x8')]=_0x321327[_0x4af6('0x8')]||{};}module[_0x4af6('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index bdc4f05..3494169 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 _0xf8db=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x56b0f0,_0x529649){var _0x1f8f53=function(_0x4e4287){while(--_0x4e4287){_0x56b0f0['push'](_0x56b0f0['shift']());}};_0x1f8f53(++_0x529649);}(_0xf8db,0x16b));var _0xbf8d=function(_0x549a81,_0x28f9c7){_0x549a81=_0x549a81-0x0;var _0x514df1=_0xf8db[_0x549a81];return _0x514df1;};'use strict';function ServicenowAccount(_0x5ccc3f){this['id']=_0x5ccc3f['id']||0x0;this['name']=_0x5ccc3f[_0xbf8d('0x0')]||'';this[_0xbf8d('0x1')]=_0x5ccc3f[_0xbf8d('0x1')]||'';this[_0xbf8d('0x2')]=_0x5ccc3f[_0xbf8d('0x2')]||'';this[_0xbf8d('0x3')]=_0x5ccc3f['remoteUri']||'';this[_0xbf8d('0x4')]=_0x5ccc3f[_0xbf8d('0x4')]||'';this[_0xbf8d('0x5')]=_0x5ccc3f[_0xbf8d('0x5')]||{};}module[_0xbf8d('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x3969=['name','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x3ea913,_0x255df2){var _0x2b4f28=function(_0x48bb25){while(--_0x48bb25){_0x3ea913['push'](_0x3ea913['shift']());}};_0x2b4f28(++_0x255df2);}(_0x3969,0xa8));var _0x9396=function(_0x286301,_0x3f218a){_0x286301=_0x286301-0x0;var _0x134e8d=_0x3969[_0x286301];return _0x134e8d;};'use strict';function ServicenowAccount(_0x519d8e){this['id']=_0x519d8e['id']||0x0;this[_0x9396('0x0')]=_0x519d8e['name']||'';this['username']=_0x519d8e['username']||'';this[_0x9396('0x1')]=_0x519d8e['password']||'';this[_0x9396('0x2')]=_0x519d8e[_0x9396('0x2')]||'';this[_0x9396('0x3')]=_0x519d8e[_0x9396('0x3')]||'';this[_0x9396('0x4')]=_0x519d8e[_0x9396('0x4')]||{};}module[_0x9396('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 835c8d3..f3c86dc 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 _0x2fac=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x25244b,_0x660735){var _0x1416a8=function(_0x1e33b3){while(--_0x1e33b3){_0x25244b['push'](_0x25244b['shift']());}};_0x1416a8(++_0x660735);}(_0x2fac,0x13a));var _0xc2fa=function(_0x1df0a0,_0x58d8a1){_0x1df0a0=_0x1df0a0-0x0;var _0x5df23b=_0x2fac[_0x1df0a0];return _0x5df23b;};'use strict';function SugarcrmAccount(_0x3d722c){this['id']=_0x3d722c['id']||0x0;this[_0xc2fa('0x0')]=_0x3d722c[_0xc2fa('0x0')]||'';this[_0xc2fa('0x1')]=_0x3d722c[_0xc2fa('0x1')]||'';this[_0xc2fa('0x2')]=_0x3d722c[_0xc2fa('0x2')]||'';this[_0xc2fa('0x3')]=_0x3d722c[_0xc2fa('0x3')]||'';this[_0xc2fa('0x4')]=_0x3d722c[_0xc2fa('0x4')]||'';this[_0xc2fa('0x5')]=_0x3d722c[_0xc2fa('0x5')]||{};}module[_0xc2fa('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x088f=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x088f,0x16a));var _0xf088=function(_0x5e94ee,_0x513155){_0x5e94ee=_0x5e94ee-0x0;var _0x9fd44e=_0x088f[_0x5e94ee];return _0x9fd44e;};'use strict';function SugarcrmAccount(_0x391b4b){this['id']=_0x391b4b['id']||0x0;this[_0xf088('0x0')]=_0x391b4b['name']||'';this[_0xf088('0x1')]=_0x391b4b['username']||'';this[_0xf088('0x2')]=_0x391b4b['password']||'';this[_0xf088('0x3')]=_0x391b4b['remoteUri']||'';this[_0xf088('0x4')]=_0x391b4b['serverUrl']||'';this[_0xf088('0x5')]=_0x391b4b[_0xf088('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index e396056..7d28d04 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 _0x7d42=['accountcode','stateTime','unknown'];(function(_0x22608c,_0x5575da){var _0x50bfa2=function(_0x514222){while(--_0x514222){_0x22608c['push'](_0x22608c['shift']());}};_0x50bfa2(++_0x5575da);}(_0x7d42,0x11a));var _0x27d4=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x7d42[_0x2c91e9];return _0x13f0ff;};'use strict';function Telephone(_0x286833){this['id']=_0x286833['id']||0x0;this['name']=_0x286833['name']||'';this[_0x27d4('0x0')]=_0x286833[_0x27d4('0x0')]||'';this['state']='unknown';this[_0x27d4('0x1')]=0x0;this['status']=_0x27d4('0x2');this['address']='';}module['exports']=Telephone; \ No newline at end of file +var _0x7c43=['accountcode','state','unknown','stateTime','status','name'];(function(_0x1f898f,_0x562a53){var _0x5d2735=function(_0x1d1219){while(--_0x1d1219){_0x1f898f['push'](_0x1f898f['shift']());}};_0x5d2735(++_0x562a53);}(_0x7c43,0x149));var _0x37c4=function(_0x1e9322,_0x416ce8){_0x1e9322=_0x1e9322-0x0;var _0x35d1ad=_0x7c43[_0x1e9322];return _0x35d1ad;};'use strict';function Telephone(_0x455136){this['id']=_0x455136['id']||0x0;this[_0x37c4('0x0')]=_0x455136[_0x37c4('0x0')]||'';this[_0x37c4('0x1')]=_0x455136['accountcode']||'';this[_0x37c4('0x2')]=_0x37c4('0x3');this[_0x37c4('0x4')]=0x0;this[_0x37c4('0x5')]='unknown';this['address']='';}module['exports']=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index fe1bd79..2081e99 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 _0xf5cb=['html','name'];(function(_0x499001,_0x3f27ae){var _0x320c65=function(_0x121fea){while(--_0x121fea){_0x499001['push'](_0x499001['shift']());}};_0x320c65(++_0x3f27ae);}(_0xf5cb,0x117));var _0xbf5c=function(_0xf6ac63,_0x59f032){_0xf6ac63=_0xf6ac63-0x0;var _0x57f362=_0xf5cb[_0xf6ac63];return _0x57f362;};'use strict';function template(_0x103238){this['id']=_0x103238['id']||0x0;this[_0xbf5c('0x0')]=_0x103238[_0xbf5c('0x0')]||'';this[_0xbf5c('0x1')]=_0x103238['html']||'';}module['exports']=template; \ No newline at end of file +var _0x61b8=['html','name'];(function(_0x43dfbc,_0x1014be){var _0x130070=function(_0x8b5b06){while(--_0x8b5b06){_0x43dfbc['push'](_0x43dfbc['shift']());}};_0x130070(++_0x1014be);}(_0x61b8,0x169));var _0x861b=function(_0x24ff9a,_0x27309f){_0x24ff9a=_0x24ff9a-0x0;var _0x2c4319=_0x61b8[_0x24ff9a];return _0x2c4319;};'use strict';function template(_0xfae3b6){this['id']=_0xfae3b6['id']||0x0;this[_0x861b('0x0')]=_0xfae3b6[_0x861b('0x0')]||'';this['html']=_0xfae3b6[_0x861b('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 d923e76..0e11b3a 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 _0xa41a=['AnyConditions','Actions','name','channel','voice','status','AllConditions'];(function(_0x38eb91,_0x2583dc){var _0x33dd41=function(_0x10df5a){while(--_0x10df5a){_0x38eb91['push'](_0x38eb91['shift']());}};_0x33dd41(++_0x2583dc);}(_0xa41a,0x6b));var _0xaa41=function(_0x429874,_0x5e4e28){_0x429874=_0x429874-0x0;var _0x4973bc=_0xa41a[_0x429874];return _0x4973bc;};'use strict';function Trigger(_0x33e667){this['id']=_0x33e667['id']||0x0;this[_0xaa41('0x0')]=_0x33e667['name']||'';this[_0xaa41('0x1')]=_0x33e667[_0xaa41('0x1')]||_0xaa41('0x2');this[_0xaa41('0x3')]=_0x33e667[_0xaa41('0x3')]||![];this[_0xaa41('0x4')]=_0x33e667[_0xaa41('0x4')]||[];this[_0xaa41('0x5')]=_0x33e667['AnyConditions']||[];this[_0xaa41('0x6')]=_0x33e667[_0xaa41('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xedd9=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x2d266c,_0x3e834f){var _0x30e2ed=function(_0x13c179){while(--_0x13c179){_0x2d266c['push'](_0x2d266c['shift']());}};_0x30e2ed(++_0x3e834f);}(_0xedd9,0xfc));var _0x9edd=function(_0x2876c8,_0x28b537){_0x2876c8=_0x2876c8-0x0;var _0x4a0965=_0xedd9[_0x2876c8];return _0x4a0965;};'use strict';function Trigger(_0x265eb8){this['id']=_0x265eb8['id']||0x0;this[_0x9edd('0x0')]=_0x265eb8[_0x9edd('0x0')]||'';this[_0x9edd('0x1')]=_0x265eb8[_0x9edd('0x1')]||_0x9edd('0x2');this[_0x9edd('0x3')]=_0x265eb8[_0x9edd('0x3')]||![];this[_0x9edd('0x4')]=_0x265eb8['AllConditions']||[];this[_0x9edd('0x5')]=_0x265eb8[_0x9edd('0x5')]||[];this[_0x9edd('0x6')]=_0x265eb8[_0x9edd('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 3b77a37..6172391 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 _0x1c9f=['registrationtime','exports','active','name','unknown','stateTime','status','registry','indexOf','host','port','refresh','stateRegistry'];(function(_0x25b223,_0x4db4ce){var _0x3703e7=function(_0x1b0d4e){while(--_0x1b0d4e){_0x25b223['push'](_0x25b223['shift']());}};_0x3703e7(++_0x4db4ce);}(_0x1c9f,0xec));var _0xf1c9=function(_0x5a960b,_0x219146){_0x5a960b=_0x5a960b-0x0;var _0x31b19b=_0x1c9f[_0x5a960b];return _0x31b19b;};'use strict';function Trunk(_0x23cdfa){this['id']=_0x23cdfa['id']||0x0;this['active']=_0x23cdfa[_0xf1c9('0x0')]||![];this[_0xf1c9('0x1')]=_0x23cdfa[_0xf1c9('0x1')]||'';this['state']=_0xf1c9('0x2');this[_0xf1c9('0x3')]=0x0;this[_0xf1c9('0x4')]=_0xf1c9('0x2');this['registry']=_0x23cdfa['registry']&&_0x23cdfa[_0xf1c9('0x5')][_0xf1c9('0x6')](':')?_0x23cdfa[_0xf1c9('0x5')]['split'](':')[0x0]:'';this[_0xf1c9('0x7')]='';this[_0xf1c9('0x8')]='';this['domain']='';this['domainport']='';this[_0xf1c9('0x9')]='';this[_0xf1c9('0xa')]='unknown';this[_0xf1c9('0xb')]='';this['address']='';}module[_0xf1c9('0xc')]=Trunk; \ No newline at end of file +var _0xcdad=['registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry','active','state','unknown','stateTime'];(function(_0xd370fa,_0x4fc307){var _0x4ecd90=function(_0x4acec8){while(--_0x4acec8){_0xd370fa['push'](_0xd370fa['shift']());}};_0x4ecd90(++_0x4fc307);}(_0xcdad,0x168));var _0xdcda=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xcdad[_0x26f702];return _0x11417d;};'use strict';function Trunk(_0x51fb14){this['id']=_0x51fb14['id']||0x0;this[_0xdcda('0x0')]=_0x51fb14[_0xdcda('0x0')]||![];this['name']=_0x51fb14['name']||'';this[_0xdcda('0x1')]=_0xdcda('0x2');this[_0xdcda('0x3')]=0x0;this['status']=_0xdcda('0x2');this[_0xdcda('0x4')]=_0x51fb14[_0xdcda('0x4')]&&_0x51fb14[_0xdcda('0x4')][_0xdcda('0x5')](':')?_0x51fb14['registry'][_0xdcda('0x6')](':')[0x0]:'';this[_0xdcda('0x7')]='';this[_0xdcda('0x8')]='';this[_0xdcda('0x9')]='';this[_0xdcda('0xa')]='';this[_0xdcda('0xb')]='';this[_0xdcda('0xc')]=_0xdcda('0x2');this['registrationtime']='';this['address']='';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 38f44ed..b561f8a 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 _0x187f=['mandatoryDisposition','exten','recordingFormat','none'];(function(_0x2d9d41,_0x3ccbc2){var _0x128325=function(_0x3a41bb){while(--_0x3a41bb){_0x2d9d41['push'](_0x2d9d41['shift']());}};_0x128325(++_0x3ccbc2);}(_0x187f,0x1dd));var _0xf187=function(_0x526636,_0x4bb922){_0x526636=_0x526636-0x0;var _0x40ee1b=_0x187f[_0x526636];return _0x40ee1b;};'use strict';function voiceExtension(_0x57f8f9){this['id']=_0x57f8f9['id']||0x0;this[_0xf187('0x0')]=_0x57f8f9[_0xf187('0x0')]||'';this[_0xf187('0x1')]=_0x57f8f9[_0xf187('0x1')]||_0xf187('0x2');this['mandatoryDisposition']=_0x57f8f9[_0xf187('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x62c9=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x40ea6f,_0x26a879){var _0x10b4d4=function(_0x1c0881){while(--_0x1c0881){_0x40ea6f['push'](_0x40ea6f['shift']());}};_0x10b4d4(++_0x26a879);}(_0x62c9,0xce));var _0x962c=function(_0x3b7378,_0x58b125){_0x3b7378=_0x3b7378-0x0;var _0x65847b=_0x62c9[_0x3b7378];return _0x65847b;};'use strict';function voiceExtension(_0x228c67){this['id']=_0x228c67['id']||0x0;this['exten']=_0x228c67[_0x962c('0x0')]||'';this[_0x962c('0x1')]=_0x228c67[_0x962c('0x1')]||_0x962c('0x2');this[_0x962c('0x3')]=_0x228c67[_0x962c('0x3')]||![];}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 ec00008..6a6bd45 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 _0x0153=['dialCutDigit','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber'];(function(_0x229f20,_0x4bb2a6){var _0x2d99da=function(_0x275dfd){while(--_0x275dfd){_0x229f20['push'](_0x229f20['shift']());}};_0x2d99da(++_0x4bb2a6);}(_0x0153,0xa8));var _0x3015=function(_0x2871c2,_0x52d049){_0x2871c2=_0x2871c2-0x0;var _0x1930e9=_0x0153[_0x2871c2];return _0x1930e9;};'use strict';var statusDesc=[_0x3015('0x0'),_0x3015('0x1'),_0x3015('0x2'),_0x3015('0x3'),_0x3015('0x4'),_0x3015('0x5'),'ringing',_0x3015('0x6'),_0x3015('0x7')];var monitorFormat={'wav':_0x3015('0x8'),'wav49':_0x3015('0x9'),'gsm':_0x3015('0xa')};var strategy={'rrmemory':_0x3015('0xb'),'roundrobin':_0x3015('0xc')};function VoiceQueue(_0x5a5177){this['id']=_0x5a5177['id']||0x0;this[_0x3015('0xd')]=_0x5a5177[_0x3015('0xd')]||'';this[_0x3015('0xe')]=_0x5a5177[_0x3015('0xe')]||'';this[_0x3015('0xf')]=_0x5a5177[_0x3015('0xf')]||_0x3015('0x10');this[_0x3015('0x11')]=0x0;this[_0x3015('0x12')]=0x0;this[_0x3015('0x13')]=0x0;this[_0x3015('0x14')]=0x0;this[_0x3015('0x15')]=0x0;this[_0x3015('0x16')]=0x0;this[_0x3015('0x17')]=0x0;this[_0x3015('0x18')]=0x0;this[_0x3015('0x19')]=0x0;this[_0x3015('0x1a')]=0x0;this[_0x3015('0x1b')]=0x0;this[_0x3015('0x1c')]=_0x5a5177[_0x3015('0x1c')]||![];this['acwTimeout']=_0x5a5177[_0x3015('0x1d')]||0xa;this[_0x3015('0x1e')]=_0x5a5177[_0x3015('0x1e')]||'no';this[_0x3015('0x1f')]=!![];this['message']='';this[_0x3015('0x20')]=0x0;this['temp']=0x0;this[_0x3015('0x21')]=_0x5a5177[_0x3015('0x21')]||null;this[_0x3015('0x22')]=_0x5a5177[_0x3015('0x22')]?_0x5a5177[_0x3015('0x22')]:null;this['dialActive']=_0x5a5177[_0x3015('0x23')];this['dialMethod']=_0x5a5177['dialMethod']||_0x3015('0x24');this['dialLimitChannel']=_0x5a5177[_0x3015('0x25')]||0x0;this[_0x3015('0x26')]=_0x5a5177[_0x3015('0x26')]||0x0;this[_0x3015('0x27')]=_0x5a5177[_0x3015('0x27')]||0x1;this[_0x3015('0x28')]=_0x5a5177[_0x3015('0x28')]||_0x3015('0x29');this[_0x3015('0x2a')]=_0x5a5177[_0x3015('0x2a')]||0.03;this[_0x3015('0x2b')]=_0x5a5177['dialPredictiveInterval']||0x258;this[_0x3015('0x2c')]=_0x5a5177['dialOriginateCallerIdName']||_0x3015('0x2d');this[_0x3015('0x2e')]=_0x5a5177[_0x3015('0x2e')]||_0x3015('0x2d');this[_0x3015('0x2f')]=_0x5a5177[_0x3015('0x2f')]||0x1e;this['dialQueueOptions']=_0x5a5177['dialQueueOptions']||_0x3015('0x30');this[_0x3015('0x31')]=_0x5a5177['dialQueueTimeout']||0x3;this[_0x3015('0x32')]=_0x5a5177['dialQueueProject']||undefined;this['dialCongestionMaxRetry']=_0x5a5177['dialCongestionMaxRetry']||0x3;this[_0x3015('0x33')]=_0x5a5177[_0x3015('0x33')]||0x96;this[_0x3015('0x34')]=_0x5a5177[_0x3015('0x34')]||0x3;this[_0x3015('0x35')]=_0x5a5177[_0x3015('0x35')]||0x96;this[_0x3015('0x36')]=_0x5a5177[_0x3015('0x36')]||0x3;this[_0x3015('0x37')]=_0x5a5177[_0x3015('0x37')]||0x96;this[_0x3015('0x38')]=_0x5a5177['dialNoSuchNumberMaxRetry']||0x3;this[_0x3015('0x39')]=_0x5a5177[_0x3015('0x39')]||0x96;this[_0x3015('0x3a')]=_0x5a5177[_0x3015('0x3a')]||0x3;this[_0x3015('0x3b')]=_0x5a5177['dialDropRetryFrequency']||0x96;this[_0x3015('0x3c')]=_0x5a5177[_0x3015('0x3c')]||0x3;this[_0x3015('0x3d')]=_0x5a5177[_0x3015('0x3d')]||0x96;this[_0x3015('0x3e')]=_0x5a5177[_0x3015('0x3e')]||0x3;this[_0x3015('0x3f')]=_0x5a5177['dialMachineRetryFrequency']||0x96;this[_0x3015('0x40')]=_0x5a5177['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x5a5177[_0x3015('0x41')]||0x96;this[_0x3015('0x42')]=_0x5a5177[_0x3015('0x42')]||0x4;this['Trunk']=_0x5a5177['Trunk']?_0x5a5177[_0x3015('0x43')]:undefined;this[_0x3015('0x44')]=_0x5a5177[_0x3015('0x44')]?_0x5a5177[_0x3015('0x44')]:undefined;this[_0x3015('0x45')]=_0x5a5177[_0x3015('0x45')]||undefined;this[_0x3015('0x46')]=_0x5a5177[_0x3015('0x46')]?_0x5a5177[_0x3015('0x46')]:undefined;this[_0x3015('0x47')]=_0x5a5177[_0x3015('0x47')]||_0x3015('0x48');this[_0x3015('0x49')]=_0x5a5177[_0x3015('0x49')]||undefined;this[_0x3015('0x4a')]=_0x5a5177[_0x3015('0x4a')]||undefined;this['strategy']=strategy[_0x5a5177['strategy']]||_0x3015('0xb');this['queueStatusComplete']=!![];this['dialAMDActive']=_0x5a5177[_0x3015('0x4b')]||![];this[_0x3015('0x4c')]=_0x5a5177[_0x3015('0x4c')];this[_0x3015('0x4d')]=_0x5a5177[_0x3015('0x4d')];this[_0x3015('0x4e')]=_0x5a5177[_0x3015('0x4e')];this[_0x3015('0x4f')]=_0x5a5177[_0x3015('0x4f')];this[_0x3015('0x50')]=_0x5a5177['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x5a5177[_0x3015('0x51')];this[_0x3015('0x52')]=_0x5a5177['dialAMDMaximumNumberOfWords'];this[_0x3015('0x53')]=_0x5a5177['dialAMDSilenceThreshold'];this[_0x3015('0x54')]=_0x5a5177[_0x3015('0x54')];this[_0x3015('0x55')]=0x0;this[_0x3015('0x56')]=0x0;this[_0x3015('0x57')]=_0x5a5177[_0x3015('0x57')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x3015('0x58')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x3015('0x59')]=0x0;this[_0x3015('0x5a')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x3015('0x5b')]=0x0;this[_0x3015('0x5c')]=0x0;this[_0x3015('0x5d')]=0x0;this[_0x3015('0x5e')]=0x0;this[_0x3015('0x5f')]=0x0;this[_0x3015('0x60')]=0x0;this[_0x3015('0x61')]=0x0;this[_0x3015('0x62')]=undefined;this['startPredictive']=undefined;this[_0x3015('0x63')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0x3015('0x64')]=0x0;this[_0x3015('0x65')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0x3015('0x66')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x3015('0x67')]=0x0;this[_0x3015('0x68')]=0x0;this[_0x3015('0x69')]=0x0;this[_0x3015('0x6a')]=_0x5a5177[_0x3015('0x6b')]||0x14;this['predictiveIntervalMinThreshold']=_0x5a5177[_0x3015('0x6b')]||0xa;this[_0x3015('0x6c')]=0x0;this[_0x3015('0x6d')]=0x0;this[_0x3015('0x6e')]=0x1;this[_0x3015('0x6f')]=0x0;this['erlangCallToSecond']=0x0;this[_0x3015('0x70')]=0x0;this[_0x3015('0x71')]=0x0;this[_0x3015('0x72')]=_0x5a5177[_0x3015('0x72')]||0x1e;this[_0x3015('0x73')]=_0x5a5177[_0x3015('0x73')]||![];this['dialQueueProject2']=_0x5a5177[_0x3015('0x74')]||undefined;this[_0x3015('0x75')]=_0x5a5177['dialAgiAfterHangupClient']||![];this[_0x3015('0x76')]=_0x5a5177['dialAgiAfterHangupAgent']||![];this[_0x3015('0xe')]=monitorFormat[_0x5a5177[_0x3015('0xe')]]?monitorFormat[_0x5a5177[_0x3015('0xe')]]:undefined;this[_0x3015('0x77')]=_0x5a5177[_0x3015('0x77')]||![];this[_0x3015('0x78')]=_0x5a5177[_0x3015('0x78')]?_0x5a5177[_0x3015('0x78')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file +var _0x4623=['available','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','busy','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','unmanaged','abandoned','loggedIn'];(function(_0x1a1fa9,_0x14b5ce){var _0x24e817=function(_0x59598b){while(--_0x59598b){_0x1a1fa9['push'](_0x1a1fa9['shift']());}};_0x24e817(++_0x14b5ce);}(_0x4623,0x152));var _0x3462=function(_0x377c0d,_0x2fe0bd){_0x377c0d=_0x377c0d-0x0;var _0x49bb02=_0x4623[_0x377c0d];return _0x49bb02;};'use strict';var statusDesc=[_0x3462('0x0'),'not_inuse','inuse',_0x3462('0x1'),_0x3462('0x2'),_0x3462('0x3'),'ringing',_0x3462('0x4'),_0x3462('0x5')];var monitorFormat={'wav':_0x3462('0x6'),'wav49':_0x3462('0x7'),'gsm':_0x3462('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x3462('0x9')};function VoiceQueue(_0xe7e8b5){this['id']=_0xe7e8b5['id']||0x0;this[_0x3462('0xa')]=_0xe7e8b5[_0x3462('0xa')]||'';this['monitor_format']=_0xe7e8b5[_0x3462('0xb')]||'';this[_0x3462('0xc')]=_0xe7e8b5['type']||_0x3462('0xd');this[_0x3462('0xe')]=0x0;this[_0x3462('0xf')]=0x0;this[_0x3462('0x10')]=0x0;this[_0x3462('0x11')]=0x0;this[_0x3462('0x12')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0x3462('0x13')]=0x0;this[_0x3462('0x14')]=0x0;this[_0x3462('0x15')]=0x0;this[_0x3462('0x16')]=0x0;this['acw']=_0xe7e8b5['acw']||![];this[_0x3462('0x17')]=_0xe7e8b5[_0x3462('0x17')]||0xa;this[_0x3462('0x18')]=_0xe7e8b5[_0x3462('0x18')]||'no';this[_0x3462('0x19')]=!![];this['message']='';this[_0x3462('0x1a')]=0x0;this[_0x3462('0x1b')]=0x0;this['dialTimezone']=_0xe7e8b5[_0x3462('0x1c')]||null;this[_0x3462('0x1d')]=_0xe7e8b5[_0x3462('0x1d')]?_0xe7e8b5[_0x3462('0x1d')]:null;this[_0x3462('0x1e')]=_0xe7e8b5[_0x3462('0x1e')];this[_0x3462('0x1f')]=_0xe7e8b5[_0x3462('0x1f')]||_0x3462('0x20');this[_0x3462('0x21')]=_0xe7e8b5[_0x3462('0x21')]||0x0;this['dialLimitQueue']=_0xe7e8b5[_0x3462('0x22')]||0x0;this[_0x3462('0x23')]=_0xe7e8b5[_0x3462('0x23')]||0x1;this[_0x3462('0x24')]=_0xe7e8b5['dialPredictiveOptimization']||_0x3462('0x25');this[_0x3462('0x26')]=_0xe7e8b5['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0xe7e8b5[_0x3462('0x27')]||0x258;this['dialOriginateCallerIdName']=_0xe7e8b5['dialOriginateCallerIdName']||_0x3462('0x28');this[_0x3462('0x29')]=_0xe7e8b5[_0x3462('0x29')]||_0x3462('0x28');this[_0x3462('0x2a')]=_0xe7e8b5[_0x3462('0x2a')]||0x1e;this[_0x3462('0x2b')]=_0xe7e8b5[_0x3462('0x2b')]||'tTxX';this[_0x3462('0x2c')]=_0xe7e8b5[_0x3462('0x2c')]||0x3;this[_0x3462('0x2d')]=_0xe7e8b5[_0x3462('0x2d')]||undefined;this[_0x3462('0x2e')]=_0xe7e8b5[_0x3462('0x2e')]||0x3;this[_0x3462('0x2f')]=_0xe7e8b5[_0x3462('0x2f')]||0x96;this[_0x3462('0x30')]=_0xe7e8b5[_0x3462('0x30')]||0x3;this[_0x3462('0x31')]=_0xe7e8b5[_0x3462('0x31')]||0x96;this[_0x3462('0x32')]=_0xe7e8b5[_0x3462('0x32')]||0x3;this[_0x3462('0x33')]=_0xe7e8b5['dialNoAnswerRetryFrequency']||0x96;this[_0x3462('0x34')]=_0xe7e8b5['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0xe7e8b5[_0x3462('0x35')]||0x96;this['dialDropMaxRetry']=_0xe7e8b5[_0x3462('0x36')]||0x3;this[_0x3462('0x37')]=_0xe7e8b5['dialDropRetryFrequency']||0x96;this[_0x3462('0x38')]=_0xe7e8b5[_0x3462('0x38')]||0x3;this['dialAbandonedRetryFrequency']=_0xe7e8b5[_0x3462('0x39')]||0x96;this[_0x3462('0x3a')]=_0xe7e8b5[_0x3462('0x3a')]||0x3;this[_0x3462('0x3b')]=_0xe7e8b5[_0x3462('0x3b')]||0x96;this[_0x3462('0x3c')]=_0xe7e8b5[_0x3462('0x3c')]||0x3;this['dialAgentRejectRetryFrequency']=_0xe7e8b5['dialAgentRejectRetryFrequency']||0x96;this[_0x3462('0x3d')]=_0xe7e8b5[_0x3462('0x3d')]||0x4;this['Trunk']=_0xe7e8b5[_0x3462('0x3e')]?_0xe7e8b5[_0x3462('0x3e')]:undefined;this[_0x3462('0x3f')]=_0xe7e8b5[_0x3462('0x3f')]?_0xe7e8b5[_0x3462('0x3f')]:undefined;this[_0x3462('0x40')]=_0xe7e8b5[_0x3462('0x40')]||undefined;this[_0x3462('0x41')]=_0xe7e8b5[_0x3462('0x41')]?_0xe7e8b5[_0x3462('0x41')]:undefined;this[_0x3462('0x42')]=_0xe7e8b5['dialOrderByScheduledAt']||'DESC';this[_0x3462('0x43')]=_0xe7e8b5['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0xe7e8b5[_0x3462('0x44')]||undefined;this['strategy']=strategy[_0xe7e8b5['strategy']]||_0x3462('0x45');this[_0x3462('0x46')]=!![];this[_0x3462('0x47')]=_0xe7e8b5['dialAMDActive']||![];this[_0x3462('0x48')]=_0xe7e8b5[_0x3462('0x48')];this['dialAMDGreeting']=_0xe7e8b5[_0x3462('0x49')];this[_0x3462('0x4a')]=_0xe7e8b5[_0x3462('0x4a')];this[_0x3462('0x4b')]=_0xe7e8b5[_0x3462('0x4b')];this[_0x3462('0x4c')]=_0xe7e8b5[_0x3462('0x4c')];this['dialAMDBetweenWordsSilence']=_0xe7e8b5[_0x3462('0x4d')];this[_0x3462('0x4e')]=_0xe7e8b5[_0x3462('0x4e')];this['dialAMDSilenceThreshold']=_0xe7e8b5[_0x3462('0x4f')];this[_0x3462('0x50')]=_0xe7e8b5[_0x3462('0x50')];this[_0x3462('0x51')]=0x0;this['pTalking']=0x0;this['timeout']=_0xe7e8b5[_0x3462('0x52')];this[_0x3462('0x53')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0x3462('0x54')]=0x0;this[_0x3462('0x55')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x3462('0x56')]=0x0;this[_0x3462('0x57')]=0x0;this[_0x3462('0x58')]=0x0;this[_0x3462('0x59')]=0x0;this[_0x3462('0x5a')]=0x0;this[_0x3462('0x5b')]=0x0;this[_0x3462('0x5c')]=0x0;this[_0x3462('0x5d')]=undefined;this[_0x3462('0x5e')]=undefined;this[_0x3462('0x5f')]=undefined;this[_0x3462('0x60')]=1.05;this[_0x3462('0x61')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x3462('0x62')]=0x0;this[_0x3462('0x63')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x3462('0x64')]=0x0;this[_0x3462('0x65')]=0x0;this[_0x3462('0x66')]=0x0;this[_0x3462('0x67')]=_0xe7e8b5[_0x3462('0x68')]||0x14;this[_0x3462('0x69')]=_0xe7e8b5[_0x3462('0x68')]||0xa;this[_0x3462('0x6a')]=0x0;this[_0x3462('0x6b')]=0x0;this[_0x3462('0x6c')]=0x1;this[_0x3462('0x6d')]=0x0;this['erlangCallToSecond']=0x0;this[_0x3462('0x6e')]=0x0;this[_0x3462('0x6f')]=0x0;this[_0x3462('0x70')]=_0xe7e8b5[_0x3462('0x70')]||0x1e;this[_0x3462('0x71')]=_0xe7e8b5[_0x3462('0x71')]||![];this[_0x3462('0x72')]=_0xe7e8b5['dialQueueProject2']||undefined;this[_0x3462('0x73')]=_0xe7e8b5[_0x3462('0x73')]||![];this[_0x3462('0x74')]=_0xe7e8b5[_0x3462('0x74')]||![];this[_0x3462('0xb')]=monitorFormat[_0xe7e8b5[_0x3462('0xb')]]?monitorFormat[_0xe7e8b5[_0x3462('0xb')]]:undefined;this[_0x3462('0x75')]=_0xe7e8b5[_0x3462('0x75')]||![];this[_0x3462('0x76')]=_0xe7e8b5['mandatoryDispositionPause']?_0xe7e8b5[_0x3462('0x76')]:undefined;}module[_0x3462('0x77')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index a0dc968..1b6240b 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 _0x9a69=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x525612,_0x3e0004){var _0x578ac6=function(_0x10ab4e){while(--_0x10ab4e){_0x525612['push'](_0x525612['shift']());}};_0x578ac6(++_0x3e0004);}(_0x9a69,0x1d0));var _0x99a6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9a69[_0x19950b];return _0x3c6b41;};'use strict';function VtigerAccount(_0x163a70){this['id']=_0x163a70['id']||0x0;this[_0x99a6('0x0')]=_0x163a70[_0x99a6('0x0')]||'';this[_0x99a6('0x1')]=_0x163a70[_0x99a6('0x1')]||'';this[_0x99a6('0x2')]=_0x163a70[_0x99a6('0x2')]||'';this[_0x99a6('0x3')]=_0x163a70['remoteUri']||'';this[_0x99a6('0x4')]=_0x163a70[_0x99a6('0x4')]||'';this[_0x99a6('0x5')]=_0x163a70['Configurations']||{};}module[_0x99a6('0x6')]=VtigerAccount; \ No newline at end of file +var _0x701b=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x5ec97f,_0x1f679d){var _0x479509=function(_0x2943ec){while(--_0x2943ec){_0x5ec97f['push'](_0x5ec97f['shift']());}};_0x479509(++_0x1f679d);}(_0x701b,0xb8));var _0xb701=function(_0x2a83dd,_0x424028){_0x2a83dd=_0x2a83dd-0x0;var _0x133800=_0x701b[_0x2a83dd];return _0x133800;};'use strict';function VtigerAccount(_0x26451e){this['id']=_0x26451e['id']||0x0;this[_0xb701('0x0')]=_0x26451e[_0xb701('0x0')]||'';this['username']=_0x26451e[_0xb701('0x1')]||'';this[_0xb701('0x2')]=_0x26451e[_0xb701('0x2')]||'';this[_0xb701('0x3')]=_0x26451e['remoteUri']||'';this['serverUrl']=_0x26451e[_0xb701('0x4')]||'';this['Configurations']=_0x26451e[_0xb701('0x5')]||{};}module[_0xb701('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 c84c65d..9fa4f97 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 _0x2032=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x2ae6ac,_0x594690){var _0x29b70b=function(_0x2925c2){while(--_0x2925c2){_0x2ae6ac['push'](_0x2ae6ac['shift']());}};_0x29b70b(++_0x594690);}(_0x2032,0xd9));var _0x2203=function(_0x25ad56,_0x491e3d){_0x25ad56=_0x25ad56-0x0;var _0x431c41=_0x2032[_0x25ad56];return _0x431c41;};'use strict';function ZendeskAccount(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['username']||'';this[_0x2203('0x2')]=_0x4d6c97[_0x2203('0x2')]||'';this['token']=_0x4d6c97[_0x2203('0x3')]||'';this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||'';this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||'';this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||_0x2203('0x7');this[_0x2203('0x8')]=_0x4d6c97[_0x2203('0x8')]||'';this[_0x2203('0x9')]=_0x4d6c97['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x2ef3=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x4cec28,_0x382e45){var _0x5a0f27=function(_0x4bc870){while(--_0x4bc870){_0x4cec28['push'](_0x4cec28['shift']());}};_0x5a0f27(++_0x382e45);}(_0x2ef3,0xba));var _0x32ef=function(_0x329172,_0xf7b24e){_0x329172=_0x329172-0x0;var _0x330915=_0x2ef3[_0x329172];return _0x330915;};'use strict';function ZendeskAccount(_0x4d5ac8){this['id']=_0x4d5ac8['id']||0x0;this[_0x32ef('0x0')]=_0x4d5ac8[_0x32ef('0x0')]||'';this[_0x32ef('0x1')]=_0x4d5ac8[_0x32ef('0x1')]||'';this[_0x32ef('0x2')]=_0x4d5ac8['password']||'';this[_0x32ef('0x3')]=_0x4d5ac8[_0x32ef('0x3')]||'';this['remoteUri']=_0x4d5ac8[_0x32ef('0x4')]||'';this[_0x32ef('0x5')]=_0x4d5ac8['authType']||'';this['type']=_0x4d5ac8[_0x32ef('0x6')]||_0x32ef('0x7');this[_0x32ef('0x8')]=_0x4d5ac8[_0x32ef('0x8')]||'';this[_0x32ef('0x9')]=_0x4d5ac8[_0x32ef('0x9')]||{};}module[_0x32ef('0xa')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index fa28d09..9981e15 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 _0x0f97=['exports','name','description','host','zone','clientId','serverUrl','code','Configurations'];(function(_0xf1226a,_0x29a250){var _0x1b8fe7=function(_0x7178a5){while(--_0x7178a5){_0xf1226a['push'](_0xf1226a['shift']());}};_0x1b8fe7(++_0x29a250);}(_0x0f97,0x196));var _0x70f9=function(_0x2da402,_0x14a691){_0x2da402=_0x2da402-0x0;var _0x31a57d=_0x0f97[_0x2da402];return _0x31a57d;};'use strict';function ZohoAccount(_0x5534ef){this['id']=_0x5534ef['id']||0x0;this[_0x70f9('0x0')]=_0x5534ef[_0x70f9('0x0')]||'';this[_0x70f9('0x1')]=_0x5534ef[_0x70f9('0x1')]||'';this[_0x70f9('0x2')]=_0x5534ef[_0x70f9('0x2')]||'';this[_0x70f9('0x3')]=_0x5534ef[_0x70f9('0x3')]||'';this[_0x70f9('0x4')]=_0x5534ef[_0x70f9('0x4')]||'';this['clientSecret']=_0x5534ef['clientSecret']||'';this[_0x70f9('0x5')]=_0x5534ef[_0x70f9('0x5')]||'';this[_0x70f9('0x6')]=_0x5534ef[_0x70f9('0x6')]||'';this['refreshToken']=_0x5534ef['refreshToken']||'';this[_0x70f9('0x7')]=_0x5534ef[_0x70f9('0x7')]||{};}module[_0x70f9('0x8')]=ZohoAccount; \ No newline at end of file +var _0x8952=['refreshToken','Configurations','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x3284cd,_0x2e10a2){var _0xe92280=function(_0x398d2e){while(--_0x398d2e){_0x3284cd['push'](_0x3284cd['shift']());}};_0xe92280(++_0x2e10a2);}(_0x8952,0x17e));var _0x2895=function(_0x384f25,_0x5aafe8){_0x384f25=_0x384f25-0x0;var _0x25de37=_0x8952[_0x384f25];return _0x25de37;};'use strict';function ZohoAccount(_0x1fba79){this['id']=_0x1fba79['id']||0x0;this[_0x2895('0x0')]=_0x1fba79[_0x2895('0x0')]||'';this[_0x2895('0x1')]=_0x1fba79[_0x2895('0x1')]||'';this[_0x2895('0x2')]=_0x1fba79['host']||'';this[_0x2895('0x3')]=_0x1fba79[_0x2895('0x3')]||'';this[_0x2895('0x4')]=_0x1fba79['clientId']||'';this[_0x2895('0x5')]=_0x1fba79[_0x2895('0x5')]||'';this[_0x2895('0x6')]=_0x1fba79['serverUrl']||'';this['code']=_0x1fba79[_0x2895('0x7')]||'';this[_0x2895('0x8')]=_0x1fba79[_0x2895('0x8')]||'';this[_0x2895('0x9')]=_0x1fba79[_0x2895('0x9')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 4dedfe5..1eefba6 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 _0x02b6=['dialAnswer','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','Contact','lastName','active','phone','scheduledat','countcongestionretry','countnoanswerretry','countbusyretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','type','queue'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x02b6,0x14f));var _0x602b=function(_0x2f5768,_0x5453bc){_0x2f5768=_0x2f5768-0x0;var _0x996b12=_0x02b6[_0x2f5768];return _0x996b12;};'use strict';var util=require(_0x602b('0x0'));var _=require(_0x602b('0x1'));var moment=require(_0x602b('0x2'));function checkNameSurname(_0x18387f,_0x3a6c95,_0x207211){var _0x12755d='';if(!_[_0x602b('0x3')](_0x3a6c95)&&_0x602b('0x4')===typeof _0x3a6c95){_0x12755d+=_0x3a6c95;}if(!_[_0x602b('0x3')](_0x207211)&&_0x602b('0x4')===typeof _0x207211){_0x12755d+='\x20'+_0x207211;}if(_0x12755d!==''){return _0x12755d;}return _0x18387f;}function Action(_0x392836,_0x5478ca,_0x3a0b0a,_0x2b36d8,_0x4f872f){this[_0x602b('0x5')]=_0x3a0b0a||undefined;this[_0x602b('0x6')]=_0x392836['id'];this['queue']=_0x5478ca['name'];this[_0x602b('0x7')]=_0x5478ca['type'];this['campaigntype']=_0x602b('0x8');this[_0x602b('0x9')]=![];this[_0x602b('0xa')]=_['isNil'](_0x392836[_0x602b('0xb')])?undefined:_0x392836[_0x602b('0xb')][_0x602b('0xc')];this[_0x602b('0xd')]=this[_0x602b('0xa')]?util[_0x602b('0xe')](_0x602b('0xf'),this[_0x602b('0xa')]):_0x2b36d8||undefined;this[_0x602b('0x10')]=checkNameSurname(_0x392836[_0x602b('0x11')]['phone'],_0x392836[_0x602b('0x11')]['firstName'],_0x392836[_0x602b('0x11')][_0x602b('0x12')]);this[_0x602b('0x13')]=_0x392836[_0x602b('0x13')]||![];this['calleridnum']=_0x392836['Contact'][_0x602b('0x14')];this[_0x602b('0x15')]=_0x392836[_0x602b('0x15')];this['countbusyretry']=_0x392836['countbusyretry']||0x0;this[_0x602b('0x16')]=_0x392836[_0x602b('0x16')]||0x0;this[_0x602b('0x17')]=_0x392836[_0x602b('0x17')]||0x0;this['countglobal']=(_0x392836[_0x602b('0x18')]||0x0)+(_0x392836['countcongestionretry']||0x0)+(_0x392836[_0x602b('0x17')]||0x0)+(_0x392836['countnosuchnumberretry']||0x0)+(_0x392836[_0x602b('0x19')]||0x0)+(_0x392836[_0x602b('0x1a')]||0x0)+(_0x392836[_0x602b('0x1b')]||0x0)+(_0x392836[_0x602b('0x1c')]||0x0);this['countnosuchnumberretry']=_0x392836[_0x602b('0x1d')]||0x0;this['countdropretry']=_0x392836[_0x602b('0x19')]||0x0;this[_0x602b('0x1a')]=_0x392836[_0x602b('0x1a')]||0x0;this[_0x602b('0x1b')]=_0x392836[_0x602b('0x1b')]||0x0;this[_0x602b('0x1c')]=_0x392836['countagentrejectretry']||0x0;this['callback']=_0x392836[_0x602b('0x1e')];this[_0x602b('0x1f')]=_0x392836[_0x602b('0x1f')];this[_0x602b('0x20')]=_0x392836[_0x602b('0x20')];this['recallme']=_0x392836[_0x602b('0x21')];this[_0x602b('0x22')]=_0x392836[_0x602b('0x22')];this['ListId']=_0x392836[_0x602b('0x23')];this[_0x602b('0x24')]=_[_0x602b('0x3')](_0x392836[_0x602b('0xb')])?_0x392836[_0x602b('0x24')]:_0x392836['Agent']['id'];this[_0x602b('0x25')]=_0x392836['VoiceQueueId'];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x602b('0x26')][_0x602b('0x27')]=function(){return util[_0x602b('0xe')](_0x602b('0x28'),this[_0x602b('0x10')],this[_0x602b('0x29')]);};module[_0x602b('0x2a')]=Action; \ No newline at end of file +var _0x9499=['UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','Agent','channelAgent','membername','format','SIP/%s','calleridname','active','scheduledat','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0xf65fc4,_0x499909){var _0x3a444c=function(_0x13fdb2){while(--_0x13fdb2){_0xf65fc4['push'](_0xf65fc4['shift']());}};_0x3a444c(++_0x499909);}(_0x9499,0x147));var _0x9949=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x9499[_0x3e5086];return _0xfeb102;};'use strict';var util=require(_0x9949('0x0'));var _=require(_0x9949('0x1'));var moment=require(_0x9949('0x2'));function checkNameSurname(_0x1b1c21,_0x41be13,_0xb7f764){var _0x131c9d='';if(!_[_0x9949('0x3')](_0x41be13)&&_0x9949('0x4')===typeof _0x41be13){_0x131c9d+=_0x41be13;}if(!_[_0x9949('0x3')](_0xb7f764)&&'string'===typeof _0xb7f764){_0x131c9d+='\x20'+_0xb7f764;}if(_0x131c9d!==''){return _0x131c9d;}return _0x1b1c21;}function Action(_0x20ca70,_0x5ca228,_0xecb80f,_0x4eb653,_0x209771){this[_0x9949('0x5')]=_0xecb80f||undefined;this[_0x9949('0x6')]=_0x20ca70['id'];this[_0x9949('0x7')]=_0x5ca228['name'];this[_0x9949('0x8')]=_0x5ca228['type'];this[_0x9949('0x9')]=_0x9949('0x7');this[_0x9949('0xa')]=![];this['membername']=_['isNil'](_0x20ca70['Agent'])?undefined:_0x20ca70[_0x9949('0xb')]['name'];this[_0x9949('0xc')]=this[_0x9949('0xd')]?util[_0x9949('0xe')](_0x9949('0xf'),this[_0x9949('0xd')]):_0x4eb653||undefined;this[_0x9949('0x10')]=checkNameSurname(_0x20ca70['Contact']['phone'],_0x20ca70['Contact']['firstName'],_0x20ca70['Contact']['lastName']);this[_0x9949('0x11')]=_0x20ca70[_0x9949('0x11')]||![];this['calleridnum']=_0x20ca70['Contact']['phone'];this[_0x9949('0x12')]=_0x20ca70['scheduledat'];this[_0x9949('0x13')]=_0x20ca70[_0x9949('0x13')]||0x0;this[_0x9949('0x14')]=_0x20ca70[_0x9949('0x14')]||0x0;this['countnoanswerretry']=_0x20ca70['countnoanswerretry']||0x0;this[_0x9949('0x15')]=(_0x20ca70['countbusyretry']||0x0)+(_0x20ca70['countcongestionretry']||0x0)+(_0x20ca70['countnoanswerretry']||0x0)+(_0x20ca70[_0x9949('0x16')]||0x0)+(_0x20ca70[_0x9949('0x17')]||0x0)+(_0x20ca70['countabandonedretry']||0x0)+(_0x20ca70[_0x9949('0x18')]||0x0)+(_0x20ca70[_0x9949('0x19')]||0x0);this[_0x9949('0x16')]=_0x20ca70[_0x9949('0x16')]||0x0;this['countdropretry']=_0x20ca70['countdropretry']||0x0;this['countabandonedretry']=_0x20ca70[_0x9949('0x1a')]||0x0;this[_0x9949('0x18')]=_0x20ca70[_0x9949('0x18')]||0x0;this[_0x9949('0x19')]=_0x20ca70['countagentrejectretry']||0x0;this[_0x9949('0x1b')]=_0x20ca70[_0x9949('0x1b')];this[_0x9949('0x1c')]=_0x20ca70[_0x9949('0x1c')];this[_0x9949('0x1d')]=_0x20ca70[_0x9949('0x1d')];this[_0x9949('0x1e')]=_0x20ca70['recallme'];this[_0x9949('0x1f')]=_0x20ca70['ContactId'];this[_0x9949('0x20')]=_0x20ca70[_0x9949('0x20')];this[_0x9949('0x21')]=_[_0x9949('0x3')](_0x20ca70[_0x9949('0xb')])?_0x20ca70[_0x9949('0x21')]:_0x20ca70[_0x9949('0xb')]['id'];this[_0x9949('0x22')]=_0x20ca70['VoiceQueueId'];this[_0x9949('0x23')]='';this[_0x9949('0x24')]='';}Action[_0x9949('0x25')]['getCaller']=function(){return util[_0x9949('0xe')](_0x9949('0x26'),this[_0x9949('0x10')],this[_0x9949('0x27')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 4ef1490..53eb089 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 _0x604b=['logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','answertime','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','uniqueid','linkedid','countbusyretry','Busy','custom:agentbusy','busy','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','NOANSWER','NoAnswer','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','dialNoAnswerMaxRetry','CONGESTION','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','countcongestionretry','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','logAgent','NoSuchNumber','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','reason','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','\x20IdHopper:\x20','idContact','called','Calling','[Preview][execCall][failure]','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlockContact','pick','getContactPreview','recallme','validateContact','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','dialPrefix','trim','dialCutDigit','phone','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','variablesAction','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','agents','isFailure','response','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','syncVarSet','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','defaults','redis','socket.io-emitter','prototype','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangBusyFactor','startPredictive','startProgressive','Trunk','name','active','Interval','stringify','format','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','clearZombieChannels','hasOwnProperty','setMessage','recallMe','isNil','info','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','contactId','UserId','VoiceQueueId','ListId','Action','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','voicePause','run'];(function(_0x4ad4ab,_0xf3365e){var _0x9c0c73=function(_0x2b2634){while(--_0x2b2634){_0x4ad4ab['push'](_0x4ad4ab['shift']());}};_0x9c0c73(++_0xf3365e);}(_0x604b,0xbb));var _0xb604=function(_0x399db2,_0x5bc04b){_0x399db2=_0x399db2-0x0;var _0x1a38c6=_0x604b[_0x399db2];return _0x1a38c6;};'use strict';var util=require(_0xb604('0x0'));var _=require(_0xb604('0x1'));var BPromise=require(_0xb604('0x2'));var uuid=require(_0xb604('0x3'));var moment=require(_0xb604('0x4'));var md5=require(_0xb604('0x5'));var Redis=require(_0xb604('0x6'));var config=require(_0xb604('0x7'));var logger=require(_0xb604('0x8'))(_0xb604('0x9'));var loggerAction=require(_0xb604('0x8'))(_0xb604('0xa'));var ami=require(_0xb604('0xb'));var rpcDb=require(_0xb604('0xc'));var Action=require(_0xb604('0xd'));var ut=require(_0xb604('0xe'));config['redis']=_[_0xb604('0xf')](config[_0xb604('0x10')],{'host':'localhost','port':0x18eb});var io=require(_0xb604('0x11'))(new Redis(config[_0xb604('0x10')]));var Sequence=function(){};Sequence[_0xb604('0x12')]['enqueue']=function(_0x13013c){this[_0xb604('0x13')]=this[_0xb604('0x13')]?this[_0xb604('0x13')]['finally'](_0x13013c):_0x13013c();};function Preview(_0x5ab82e){this[_0xb604('0x14')]=new Sequence();this[_0xb604('0x15')]=_0x5ab82e[_0xb604('0x16')];this[_0xb604('0x17')]=_0x5ab82e[_0xb604('0x17')];this[_0xb604('0x18')]={};this['agents']=_0x5ab82e['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0xb604('0x19'),this[_0xb604('0x1a')][_0xb604('0x1b')](this));ami['on']('hangup',this[_0xb604('0x1c')][_0xb604('0x1b')](this));ami['on'](_0xb604('0x1d'),this[_0xb604('0x1e')]['bind'](this));ami['on'](_0xb604('0x1f'),this[_0xb604('0x20')][_0xb604('0x1b')](this));ami['on'](_0xb604('0x21'),this[_0xb604('0x22')][_0xb604('0x1b')](this));ami['on'](_0xb604('0x23'),this['syncVarSet'][_0xb604('0x1b')](this));ami['on'](_0xb604('0x24'),this[_0xb604('0x25')][_0xb604('0x1b')](this));ami['on'](_0xb604('0x26'),this[_0xb604('0x27')][_0xb604('0x1b')](this));this[_0xb604('0x28')](this[_0xb604('0x15')]);}function emit(_0x35ce5d,_0x13ea45,_0x398ffc){io['to'](_0x35ce5d)[_0xb604('0x29')](_0x13ea45,_0x398ffc);}function emitCampaignPreview(_0x11a8f7){if(_0x11a8f7[_0xb604('0x2a')]===_0xb604('0x2b')){var _0x2d8086={'id':_0x11a8f7['id'],'name':_0x11a8f7['name'],'strategy':_0x11a8f7['strategy'],'answered':_0x11a8f7['answered'],'available':_0x11a8f7[_0xb604('0x2c')],'loggedIn':_0x11a8f7[_0xb604('0x2d')],'pTalking':_0x11a8f7[_0xb604('0x2e')],'sumBillable':_0x11a8f7[_0xb604('0x2f')],'sumDuration':_0x11a8f7[_0xb604('0x30')],'sumHoldTime':_0x11a8f7[_0xb604('0x31')]||0x0,'talking':_0x11a8f7[_0xb604('0x32')],'total':_0x11a8f7[_0xb604('0x33')],'type':_0x11a8f7[_0xb604('0x2a')],'unmanaged':_0x11a8f7[_0xb604('0x34')],'abandoned':_0x11a8f7['abandoned'],'waiting':_0x11a8f7['waiting'],'loggedInDb':_0x11a8f7[_0xb604('0x35')],'dialActive':_0x11a8f7[_0xb604('0x36')],'dialMethod':_0x11a8f7[_0xb604('0x37')],'dialOriginateCallerIdName':_0x11a8f7[_0xb604('0x38')],'dialOriginateCallerIdNumber':_0x11a8f7[_0xb604('0x39')],'dialOriginateTimeout':_0x11a8f7['dialOriginateTimeout'],'dialPrefix':_0x11a8f7['dialPrefix'],'outboundAnswerAgiCallsDay':_0x11a8f7[_0xb604('0x3a')],'outboundAnswerCallsDay':_0x11a8f7[_0xb604('0x3b')],'outboundBlacklistCallsDay':_0x11a8f7[_0xb604('0x3c')],'outboundBusyCallsDay':_0x11a8f7[_0xb604('0x3d')],'outboundCongestionCallsDay':_0x11a8f7[_0xb604('0x3e')],'outboundDropCallsDayACS':_0x11a8f7[_0xb604('0x3f')],'outboundDropCallsDayCallersExit':_0x11a8f7[_0xb604('0x40')],'outboundDropCallsDayTimeout':_0x11a8f7[_0xb604('0x41')],'outboundNoAnswerCallsDay':_0x11a8f7[_0xb604('0x42')],'outboundNoSuchCallsDay':_0x11a8f7[_0xb604('0x43')],'outboundOriginateFailureCallsDay':_0x11a8f7[_0xb604('0x44')],'outboundReCallsDay':_0x11a8f7[_0xb604('0x45')],'outboundRejectCallsDay':_0x11a8f7[_0xb604('0x46')],'outboundUnknownCallsDay':_0x11a8f7[_0xb604('0x47')],'outboundAbandonedCallsDay':_0x11a8f7[_0xb604('0x48')],'predictiveIntervalAnsweredCalls':_0x11a8f7[_0xb604('0x49')],'predictiveIntervalAvgHoldtime':_0x11a8f7[_0xb604('0x4a')],'predictiveIntervalAvgTalktime':_0x11a8f7['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x11a8f7['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x11a8f7['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x11a8f7['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x11a8f7[_0xb604('0x4b')],'predictiveIntervalHitRate':_0x11a8f7[_0xb604('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x11a8f7['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x11a8f7[_0xb604('0x4d')],'predictiveIntervalAvailable':_0x11a8f7[_0xb604('0x4e')],'predictiveIntervalTotalCalls':_0x11a8f7[_0xb604('0x4f')],'message':_0x11a8f7[_0xb604('0x50')],'originated':_0x11a8f7[_0xb604('0x51')],'erlangCalls':_0x11a8f7[_0xb604('0x52')],'erlangCallToSecond':_0x11a8f7['erlangCallToSecond'],'erlangAbandonmentRate':_0x11a8f7['erlangAbandonmentRate'],'erlangBusyFactor':_0x11a8f7[_0xb604('0x53')],'startPredictive':_0x11a8f7[_0xb604('0x54')],'startProgressive':_0x11a8f7[_0xb604('0x55')]};if(_0x11a8f7[_0xb604('0x56')]){_0x2d8086['Trunk']={'id':_0x11a8f7[_0xb604('0x56')]['id'],'name':_0x11a8f7[_0xb604('0x56')][_0xb604('0x57')],'active':_0x11a8f7[_0xb604('0x56')][_0xb604('0x58')],'callerid':_0x11a8f7['Trunk']['callerid']};}if(_0x11a8f7[_0xb604('0x59')]){_0x2d8086[_0xb604('0x59')]={'id':_0x11a8f7[_0xb604('0x59')]['id'],'name':_0x11a8f7[_0xb604('0x59')][_0xb604('0x57')]};}var _0x75c872=md5(JSON[_0xb604('0x5a')](_0x2d8086));if(_0x11a8f7[_0xb604('0x5')]!==_0x75c872){_0x11a8f7[_0xb604('0x5')]=_0x75c872;emit(util[_0xb604('0x5b')]('voice:queue:%s',_0x2d8086[_0xb604('0x57')]),_0xb604('0x5c'),_0x2d8086);}}}function emitVoiceQueueChannelRemove(_0x1969ae){logger['info'](_0xb604('0x5d'),JSON[_0xb604('0x5a')](_0x1969ae));emit(util[_0xb604('0x5b')]('voice:queue:%s',_0x1969ae[_0xb604('0x57')]),_0xb604('0x5e'),_0x1969ae);}function notSendMessagesQueue(_0x265311){if(_0x265311['sendMessageOneNotActive']){if(_0x265311[_0xb604('0x51')]===0x0&&_0x265311[_0xb604('0x2e')]===0x0){_0x265311[_0xb604('0x5f')]=![];_0x265311['available']=0x0;_0x265311[_0xb604('0x60')]=0x0;_0x265311['message']=_0xb604('0x61');ut[_0xb604('0x62')](_0xb604('0x63'),_0x265311['name']+_0xb604('0x64'));}else{_0x265311['message']=_0xb604('0x65');ut[_0xb604('0x62')](_0xb604('0x63'),_0x265311['name']+_0xb604('0x66'));}emitCampaignPreview(_0x265311);}}Preview[_0xb604('0x12')][_0xb604('0x28')]=function(){var _0x131d8f=this;setInterval(function(){_0x131d8f[_0xb604('0x67')]();},0x7cf);};Preview['prototype']['syncCampaigns']=function(){var _0x332c94=this[_0xb604('0x15')];this['clockClearZombieChannels']+=0x1;for(var _0x170e0e in _0x332c94){if(_0x332c94['hasOwnProperty'](_0x170e0e)&&(_0x332c94[_0x170e0e][_0xb604('0x37')]===_0xb604('0x9')||_0x332c94[_0x170e0e][_0xb604('0x37')]==='booked')&&_0x332c94[_0x170e0e][_0xb604('0x2a')]===_0xb604('0x2b')){if(this[_0xb604('0x68')]>0x7){this[_0xb604('0x68')]=0x0;this[_0xb604('0x69')]();}}if(_0x332c94[_0xb604('0x6a')](_0x170e0e)&&_0x332c94[_0x170e0e]['dialMethod']===_0xb604('0x9')&&_0x332c94[_0x170e0e][_0xb604('0x2a')]===_0xb604('0x2b')){if(_0x332c94[_0x170e0e]['dialActive']){this[_0xb604('0x6b')](_0x332c94[_0x170e0e]);this[_0xb604('0x6c')](_0x332c94[_0x170e0e]);}else{notSendMessagesQueue(_0x332c94[_0x170e0e]);}}}};Preview[_0xb604('0x12')]['clearZombieChannel']=function(_0x4c2895){var _0x3cd66b=this;this[_0xb604('0x14')]['enqueue'](function(){if(!_[_0xb604('0x6d')](_0x3cd66b[_0xb604('0x18')][_0x4c2895])){loggerAction[_0xb604('0x6e')](_0xb604('0x6f'),_0x4c2895,_0xb604('0x70'),_0x3cd66b[_0xb604('0x18')][_0x4c2895]['queue'],_0xb604('0x71'),JSON[_0xb604('0x5a')](_0x3cd66b[_0xb604('0x15')][_0x3cd66b[_0xb604('0x18')][_0x4c2895][_0xb604('0x72')]][_0xb604('0x51')]),_0xb604('0x73'),JSON[_0xb604('0x5a')](_0x3cd66b['campaignsPreview'][_0x3cd66b['actions'][_0x4c2895][_0xb604('0x72')]][_0xb604('0x2e')]),JSON[_0xb604('0x5a')](_0x3cd66b[_0xb604('0x18')][_0x4c2895]['dialAnswer']),JSON[_0xb604('0x5a')](_['pick'](_0x3cd66b[_0xb604('0x18')][_0x4c2895],[_0xb604('0x74'),_0xb604('0x75'),_0xb604('0x76'),_0xb604('0x77')])));return ami[_0xb604('0x78')]({'action':_0xb604('0x79'),'channel':_0x3cd66b['actions'][_0x4c2895]['channel']})[_0xb604('0x7a')](function(_0x3ce8c2){if(_0x3ce8c2['message']===_0xb604('0x7b')){setTimeout(function(){if(_0x3cd66b['actions'][_0x4c2895]){ut[_0xb604('0x7c')](_0x3cd66b[_0xb604('0x15')][_0x3cd66b[_0xb604('0x18')][_0x4c2895][_0xb604('0x72')]],_0xb604('0x7d'));if(_0x3cd66b[_0xb604('0x18')][_0x4c2895][_0xb604('0x7e')]===!![]){ut['decrementTalkink'](_0x3cd66b['campaignsPreview'][_0x3cd66b[_0xb604('0x18')][_0x4c2895]['queue']],_0xb604('0x7d'));ut[_0xb604('0x7f')](_0xb604('0x80')+_0x4c2895,_0x3cd66b[_0xb604('0x18')][_0x4c2895]['queue']);}ut[_0xb604('0x7f')](_0xb604('0x81')+_0x4c2895,_0x3cd66b['actions'][_0x4c2895][_0xb604('0x72')]);delete _0x3cd66b[_0xb604('0x18')][_0x4c2895];}},0x2328);}});}});};Preview[_0xb604('0x12')][_0xb604('0x69')]=function(){var _0x30cb1d=this;loggerAction[_0xb604('0x6e')]('[action]',_[_0xb604('0x82')](this[_0xb604('0x18')]));for(var _0x275239 in this[_0xb604('0x18')]){if(_0x30cb1d[_0xb604('0x18')]['hasOwnProperty'](_0x275239)){_0x30cb1d['clearZombieChannel'](_0x275239);}}};Preview[_0xb604('0x12')]['recallMe']=function(_0xb894f1){var _0x2a0a6c=this;rpcDb[_0xb604('0x83')](_0xb894f1['id'],ut[_0xb604('0x84')](this['agents']))[_0xb604('0x85')](function(_0x493e29){if(!_[_0xb604('0x6d')](_0x493e29)){for(var _0x5e33ca=0x0;_0x5e33ca<_0x493e29[_0xb604('0x86')];_0x5e33ca+=0x1){if(ut['getDiff'](_0x493e29[_0x5e33ca][_0xb604('0x87')])<_0xb894f1[_0xb604('0x88')]*0x3c){if(_0x493e29[_0x5e33ca]['Agent']&&!_0x493e29[_0x5e33ca]['Agent'][_0xb604('0x89')]){_0x2a0a6c[_0xb604('0x8a')](_0x493e29[_0x5e33ca]['id'])['then'](ut['logger2']('[RecallMe]'))['catch'](ut[_0xb604('0x8b')](_0xb604('0x8c')));}else{rpcDb[_0xb604('0x8d')](_0x493e29[_0x5e33ca]['id']);}}else{var _0x39ad44=new Action(_0x493e29[_0x5e33ca],_0xb894f1);_0x39ad44['starttime']=moment()['format'](_0xb604('0x8e'));_0xb894f1[_0xb604('0x45')]+=0x1;ut[_0xb604('0x8f')](_0x39ad44,0x17,_0xb604('0x90'));if(_0xb894f1[_0xb604('0x91')]){rpcDb[_0xb604('0x92')](ut['createBody'](_0x493e29[_0x5e33ca]));rpcDb['createCustomerHistory'](_0x39ad44,_0xb604('0x93'));}else{ut[_0xb604('0x8f')](_0x39ad44,0x16,_0xb604('0x94'));rpcDb[_0xb604('0x95')](_0x39ad44,_0xb604('0x96'));rpcDb[_0xb604('0x97')](_0x39ad44,_0xb604('0x96'));}}}}})[_0xb604('0x7a')](ut[_0xb604('0x8b')](_0xb604('0x98')));};Preview[_0xb604('0x12')][_0xb604('0x6b')]=function(_0x5b897f){_0x5b897f[_0xb604('0x5f')]=!![];if(ut[_0xb604('0x99')](_0x5b897f[_0xb604('0x2d')])){_0x5b897f[_0xb604('0x50')]='AGENTS_NOT_LOGGED';}else if(!ut[_0xb604('0x9a')](_0x5b897f[_0xb604('0x36')])){_0x5b897f[_0xb604('0x50')]='NOT_ACTIVE';}else if(!this[_0xb604('0x9b')](_0x5b897f[_0xb604('0x56')])){if(!this[_0xb604('0x9b')](_0x5b897f[_0xb604('0x9c')])){_0x5b897f[_0xb604('0x50')]='TRUNK_IS_NOT_REACHABLE';}else{_0x5b897f[_0xb604('0x50')]=_0xb604('0x9d');}}else{_0x5b897f[_0xb604('0x50')]=_0xb604('0x9d');}emitCampaignPreview(_0x5b897f);};Preview[_0xb604('0x12')][_0xb604('0x9e')]=function(_0x19dbcd,_0x1f5ec4,_0x1689e8){var _0xf34dfc=this;var _0x579250=this[_0xb604('0x18')][_0x1f5ec4];var _0x401f51=this[_0xb604('0x15')][_0x579250[_0xb604('0x72')]];var _0x2d8eee;if(_0x401f51){switch(_0x1689e8){case'1':_0x401f51['outboundNoSuchCallsDay']+=0x1;_0x579250['countnosuchnumberretry']+=0x1;_0x579250[_0xb604('0x9f')]=ut[_0xb604('0xa0')](_0x579250);ut[_0xb604('0x8f')](_0x579250,0x0,'NoSuchNumber');ami[_0xb604('0x29')]('custom:agentnosuchnumber',ut[_0xb604('0xa1')](_0x579250,_0xb604('0xa2')));rpcDb[_0xb604('0x95')](_0x579250,_0xb604('0xa3'));if(ut['totalGlobal'](_0x579250)>=_0x401f51[_0xb604('0xa4')]){_0x2d8eee=ut[_0xb604('0xa5')](_0x579250,0xf,_0xb604('0xa6'));rpcDb[_0xb604('0x97')](_0x2d8eee,_0xb604('0xa7'));}else{if(_0x579250[_0xb604('0xa8')]>=_0x401f51[_0xb604('0xa9')]){rpcDb[_0xb604('0x97')](_0x579250,_0xb604('0xa7'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x579250,_0xb604('0xa8'),_0x401f51[_0xb604('0xaa')]),_0x579250[_0xb604('0xab')],_0x579250[_0xb604('0xac')]);}}delete this['actions'][_0x19dbcd['linkedid']];break;case _0xb604('0xad'):var _0x3ab649=moment()['format'](_0xb604('0x8e'));_0x579250[_0xb604('0xae')]=_0x3ab649;_0x579250[_0xb604('0xaf')]=_0x3ab649;_0x579250[_0xb604('0x7e')]=!![];_0x401f51[_0xb604('0x2e')]+=0x1;logger[_0xb604('0x6e')]('[syncHangup][talking][increment]',_0x579250['uniqueid'],_0xb604('0xb0'),_0x401f51['name'],'pTalking:\x20',_0x401f51['pTalking']);ami[_0xb604('0x29')](_0xb604('0xb1'),ut[_0xb604('0xa1')](_0x579250,_0xb604('0xb2')));if(_0x401f51[_0xb604('0xb3')]){ami[_0xb604('0x29')](_0xb604('0xb4'),ut[_0xb604('0xb5')](_0x579250));}break;case'16':ami['emit'](_0xb604('0xb6'),ut[_0xb604('0xa1')](_0x579250,'complete'));emitVoiceQueueChannelRemove(ut[_0xb604('0xa1')](_0x579250,_0xb604('0xb7')));_0x401f51[_0xb604('0x3b')]+=0x1;_0x401f51[_0xb604('0x33')]+=0x1;_0x401f51['answered']+=0x1;ut['decrementTalkink'](_0x401f51,_0xb604('0xb8'));_0x579250[_0xb604('0x9f')]=ut[_0xb604('0xa0')](_0x579250);ut['logCustomer'](_0x579250,0x4,_0xb604('0xb9'));rpcDb[_0xb604('0x95')](_0x579250,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xb604('0x97')](_0x579250,_0xb604('0xba'));rpcDb[_0xb604('0xbb')](_0x579250);_0x401f51[_0xb604('0x30')]+=_0x579250[_0xb604('0xbc')];_0x401f51['sumBillable']+=_0x579250[_0xb604('0xbc')];logger[_0xb604('0x6e')](_0xb604('0xbd'),_0x579250[_0xb604('0xbe')],'\x20Queue',_0x401f51[_0xb604('0x57')],_0xb604('0x73'),_0x401f51[_0xb604('0x2e')]);delete this['actions'][_0x19dbcd[_0xb604('0xbf')]];break;case'BUSY':_0x401f51[_0xb604('0x3d')]+=0x1;_0x579250[_0xb604('0xc0')]+=0x1;_0x579250[_0xb604('0x9f')]=ut[_0xb604('0xa0')](_0x579250);ut[_0xb604('0x8f')](_0x579250,0x5,_0xb604('0xc1'));ami[_0xb604('0x29')](_0xb604('0xc2'),ut[_0xb604('0xa1')](_0x579250,_0xb604('0xc3')));rpcDb['createCustomerHistory'](_0x579250,'[callProgressDetectingCustomer][logBusy]');if(ut[_0xb604('0xa0')](_0x579250)>=_0x401f51['dialGlobalMaxRetry']){_0x2d8eee=ut['cloneAction'](_0x579250,0xf,_0xb604('0xa6'));rpcDb['createCustomerFinal'](_0x2d8eee,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x579250[_0xb604('0xc0')]>=_0x401f51[_0xb604('0xc4')]){rpcDb[_0xb604('0x97')](_0x579250,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xb604('0xc5')](ut[_0xb604('0xc6')](_0x579250,_0xb604('0xc0'),_0x401f51[_0xb604('0xc7')]),_0x579250[_0xb604('0xab')],_0x579250[_0xb604('0xac')]);}}break;case _0xb604('0xc8'):_0x401f51['outboundNoAnswerCallsDay']+=0x1;_0x579250['countnoanswerretry']+=0x1;_0x579250[_0xb604('0x9f')]=ut[_0xb604('0xa0')](_0x579250);ut[_0xb604('0x8f')](_0x579250,0x3,_0xb604('0xc9'));ami['emit'](_0xb604('0xca'),ut['buildObj'](_0x579250,_0xb604('0xcb')));rpcDb[_0xb604('0x95')](_0x579250,_0xb604('0xcc'));if(ut[_0xb604('0xa0')](_0x579250)>=_0x401f51[_0xb604('0xa4')]){_0x2d8eee=ut[_0xb604('0xa5')](_0x579250,0xf,_0xb604('0xa6'));rpcDb[_0xb604('0x97')](_0x2d8eee,_0xb604('0xcd'));}else{if(_0x579250[_0xb604('0xce')]>=_0x401f51[_0xb604('0xcf')]){rpcDb['createCustomerFinal'](_0x579250,_0xb604('0xcc'));}else{rpcDb[_0xb604('0xc5')](ut[_0xb604('0xc6')](_0x579250,_0xb604('0xce'),_0x401f51['dialNoAnswerRetryFrequency']),_0x579250[_0xb604('0xab')],_0x579250[_0xb604('0xac')]);}}break;case _0xb604('0xd0'):_0x401f51[_0xb604('0x3e')]+=0x1;_0x579250['countcongestionretry']+=0x1;_0x579250[_0xb604('0x9f')]=ut[_0xb604('0xa0')](_0x579250);ut[_0xb604('0x8f')](_0x579250,0x8,_0xb604('0xd1'));ami[_0xb604('0x29')](_0xb604('0xd2'),ut['buildObj'](_0x579250,_0xb604('0xd3')));rpcDb[_0xb604('0x95')](_0x579250,_0xb604('0xd4'));if(ut['totalGlobal'](_0x579250)>=_0x401f51[_0xb604('0xa4')]){_0x2d8eee=ut[_0xb604('0xa5')](_0x579250,0xf,_0xb604('0xa6'));rpcDb[_0xb604('0x97')](_0x2d8eee,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x579250[_0xb604('0xd5')]>=_0x401f51[_0xb604('0xd6')]){rpcDb[_0xb604('0x97')](_0x579250,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xb604('0xc5')](ut['scheduledAt'](_0x579250,'countcongestionretry',_0x401f51[_0xb604('0xc7')]),_0x579250[_0xb604('0xab')],_0x579250[_0xb604('0xac')]);}}break;case _0xb604('0xd7'):_0x401f51[_0xb604('0x46')]+=0x1;_0x579250[_0xb604('0xd8')]+=0x1;_0x579250[_0xb604('0x9f')]=ut['totalGlobal'](_0x579250);ut[_0xb604('0x8f')](_0x579250,0x14,_0xb604('0xd9'));ami[_0xb604('0x29')](_0xb604('0xda'),ut[_0xb604('0xa1')](_0x579250,'agentreject'));rpcDb[_0xb604('0x95')](_0x579250,'[syncHangupRequest][logAgentReject]');if(ut[_0xb604('0xa0')](_0x579250)>=_0x401f51[_0xb604('0xa4')]){_0x2d8eee=ut['cloneAction'](_0x579250,0x14,_0xb604('0xd9'));rpcDb['createCustomerFinal'](_0x2d8eee,_0xb604('0xdb'));}else{if(_0x579250[_0xb604('0xd8')]>=_0x401f51[_0xb604('0xdc')]){rpcDb[_0xb604('0x97')](_0x579250,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xb604('0xc5')](ut[_0xb604('0xc6')](_0x579250,_0xb604('0xd8'),_0x401f51[_0xb604('0xdd')]),_0x579250[_0xb604('0xab')],_0x579250['activeContact']);}}break;case'ABANDONED':_0x401f51['outboundAbandonedCallsDay']+=0x1;_0x579250['countabandonedretry']+=0x1;_0x579250[_0xb604('0x9f')]=ut['totalGlobal'](_0x579250);ut[_0xb604('0x8f')](_0x579250,0xb,_0xb604('0xde'));rpcDb['createCustomerHistory'](_0x579250,_0xb604('0xdf'));if(ut[_0xb604('0xa0')](_0x579250)>=_0x401f51[_0xb604('0xa4')]){_0x2d8eee=ut[_0xb604('0xa5')](_0x579250,0xf,_0xb604('0xa6'));rpcDb[_0xb604('0x97')](_0x2d8eee,_0xb604('0xdf'));}else{if(_0x579250[_0xb604('0xe0')]>=_0x401f51[_0xb604('0xe1')]){rpcDb[_0xb604('0x97')](_0x579250,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x579250,'countabandonedretry',_0x401f51[_0xb604('0xe2')]),_0x579250[_0xb604('0xab')],_0x579250['activeContact']);}}break;default:if(_0x579250[_0xb604('0x7e')]){ut['decrementTalkink'](_0x401f51,'[default]');ut[_0xb604('0x7f')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x401f51['name'],_0x19dbcd);}_0x401f51[_0xb604('0x47')]+=0x1;_0x579250[_0xb604('0x9f')]=ut[_0xb604('0xa0')](_0x579250);ut[_0xb604('0x8f')](_0x579250,0xc,_0x19dbcd[_0xb604('0xe3')]||_0x19dbcd[_0xb604('0xe4')]);rpcDb['createCustomerHistory'](_0x579250,_0xb604('0xe5'));if(ut[_0xb604('0xa0')](_0x579250)>=_0x401f51[_0xb604('0xa4')]){_0x2d8eee=ut[_0xb604('0xa5')](_0x579250,0xf,_0xb604('0xa6'));rpcDb['createCustomerFinal'](_0x2d8eee,_0xb604('0xe6'));}else{rpcDb['createCustomerFinal'](_0x579250,_0xb604('0xe6'));}delete this[_0xb604('0x18')][_0x19dbcd['linkedid']];}if(!(_0x579250[_0xb604('0x7e')]&&_0x1689e8==='16')){ut[_0xb604('0x7c')](_0x401f51,_0xb604('0xe7'));logger[_0xb604('0x6e')](_0xb604('0xe8'),_0x579250[_0xb604('0xbe')],_0xb604('0xb0'),_0x401f51[_0xb604('0x57')],_0xb604('0x71'),_0x401f51[_0xb604('0x51')]);}if(_0x1689e8!==_0xb604('0xad')){delete this[_0xb604('0x18')][_0x19dbcd['linkedid']];delete this[_0xb604('0x18')][_0x19dbcd[_0xb604('0xe9')]];}}};Preview['prototype'][_0xb604('0xea')]=function(_0x40693b,_0xe25fc2,_0x4adab9){if(_[_0xb604('0xeb')](_0xe25fc2)&&_0xb604('0xec')!==typeof _0xe25fc2){return;}if(_[_0xb604('0xeb')](_0x4adab9)&&_0xb604('0xec')!==typeof _0x4adab9){return;}switch(_0x4adab9['reason']){case'0':ut[_0xb604('0xed')](_0x40693b,0x0,_0xb604('0xee'));rpcDb['createAgentHistory'](_0x40693b,_0xb604('0xef'));break;case'3':ut[_0xb604('0xed')](_0x40693b,0x3,_0xb604('0xc9'));rpcDb[_0xb604('0xf0')](_0x40693b,_0xb604('0xf1'));break;case'5':ut['logAgent'](_0x40693b,0x5,_0xb604('0xc1'));rpcDb['createAgentHistory'](_0x40693b,_0xb604('0xf2'));break;case'8':ut[_0xb604('0xed')](_0x40693b,0x8,'Congestion');rpcDb[_0xb604('0xf0')](_0x40693b,_0xb604('0xf3'));break;case'22':ut[_0xb604('0xed')](_0x40693b,0x16,'AnswerAGI');rpcDb[_0xb604('0xf0')](_0x40693b,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xb604('0xed')](_0x40693b,0xc,_0x4adab9[_0xb604('0xf4')]);rpcDb[_0xb604('0xf0')](_0x40693b,_0xb604('0xf3'));}ut['updateOriginated'](_0xe25fc2,_0xb604('0xf5'));logger[_0xb604('0x6e')](_0xb604('0xf6'),_0x40693b['uniqueid'],'\x20Queue',_0xe25fc2[_0xb604('0x57')],_0xb604('0x71'),_0xe25fc2[_0xb604('0x51')]);delete this[_0xb604('0x18')][_0x40693b['uniqueid']];};Preview[_0xb604('0x12')][_0xb604('0xf7')]=function(_0x56ac3c,_0x251050,_0x3f6810,_0x1e0359,_0xa88039){var _0x4e6193=this;return new BPromise(function(_0x505061,_0x3c8a76){if(_[_0xb604('0x6d')](_0x251050)||_[_0xb604('0x6d')](_0x251050[_0xb604('0xf8')])||_['isNil'](_0x251050[_0xb604('0xf8')]['phone'])||_[_0xb604('0x6d')](_0x251050[_0xb604('0x76')])){_0x3c8a76(ut['message'](_0xb604('0xf9'),_0x1e0359,_0xa88039));return;}var _0x4f7945=uuid['v4']();var _0x4f174b=_0x4e6193[_0xb604('0x15')][_0x251050[_0xb604('0x70')][_0xb604('0x57')]];var _0x17f7b3=_0x3f6810?_0x4e6193['agents'][_0x3f6810]['id']:undefined;_0x4e6193[_0xb604('0x18')][_0x4f7945]=new Action(_0x251050,_0x4f174b,_0x4f7945,_0x3f6810,_0x17f7b3);var _0x27741a=_0x4e6193['actions'][_0x4f7945];_0x27741a[_0xb604('0xab')]=_0x1e0359;_0x27741a[_0xb604('0xac')]=_0xa88039;_0x27741a[_0xb604('0xfa')]=_0x3f6810;if(_['isEmpty'](_0x56ac3c)){_0x4e6193[_0xb604('0xfb')](_0x27741a,_0x4f174b,_0x251050,_0x3f6810)[_0xb604('0x85')](function(_0x1181be){logger[_0xb604('0x6e')](_0xb604('0xfc'),'Queue:\x20'+_0x27741a[_0xb604('0x72')]+_0xb604('0xfd')+_0x27741a[_0xb604('0xfe')],JSON[_0xb604('0x5a')](_0x1181be));ami[_0xb604('0x29')]('custom:agentcalled',ut[_0xb604('0xa1')](_0x27741a,_0xb604('0xff')));_0x505061(ut[_0xb604('0x50')](_0xb604('0x100')));})[_0xb604('0x7a')](function(_0x1a2e51){ut[_0xb604('0x62')](_0xb604('0x101'),_0x1a2e51);_0x3c8a76(ut['message']('Call\x20failed',_0x1e0359,_0xa88039));});}else{_0x4f174b['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x27741a);rpcDb['createHistory'](_0x27741a,_0xb604('0x102'));delete _0x4e6193[_0xb604('0x18')][_0x4f7945];_0x3c8a76(ut[_0xb604('0x50')](_0xb604('0x103'),_0x1e0359,_0xa88039));}});};Preview[_0xb604('0x12')][_0xb604('0x9b')]=function(_0x2fd99d){return!_[_0xb604('0x6d')](_0x2fd99d)&&!_[_0xb604('0x6d')](_0x2fd99d[_0xb604('0x57')])&&!_['isNil'](_0x2fd99d[_0xb604('0x58')])&&_0x2fd99d[_0xb604('0x58')]&&!_[_0xb604('0x6d')](this[_0xb604('0x17')][util[_0xb604('0x5b')](_0xb604('0x104'),_0x2fd99d['name'])])&&!_[_0xb604('0x6d')](this[_0xb604('0x17')][util['format'](_0xb604('0x104'),_0x2fd99d[_0xb604('0x57')])][_0xb604('0x79')])&&(this['trunks'][util['format']('SIP/%s',_0x2fd99d[_0xb604('0x57')])][_0xb604('0x79')]==='reachable'||this[_0xb604('0x17')][util[_0xb604('0x5b')](_0xb604('0x104'),_0x2fd99d[_0xb604('0x57')])][_0xb604('0x79')]===_0xb604('0x105'));};Preview['prototype'][_0xb604('0x8a')]=function(_0x4c7e0d,_0x3d1431){var _0x518c32=this;return new BPromise(function(_0x382b09,_0x1eb4e1){_0x518c32[_0xb604('0x106')](_0x4c7e0d,_0x3d1431)['then'](function(_0x36537f){_0x382b09(_['pick'](_0x36537f,['message']));})[_0xb604('0x7a')](function(_0x2ee572){if(_0x2ee572['unlock']){rpcDb[_0xb604('0x107')](_0x4c7e0d);}if(_0x2ee572[_0xb604('0x58')]){rpcDb[_0xb604('0x8d')](_0x4c7e0d);}_0x1eb4e1(_[_0xb604('0x108')](_0x2ee572,['message']));});});};Preview[_0xb604('0x12')][_0xb604('0x106')]=function(_0x5d1042,_0x24fe8a){var _0x9af7d2=this;return new BPromise(function(_0x176112,_0x10609d){var _0x3267c5,_0x203ce2;rpcDb[_0xb604('0x109')](_0x5d1042)[_0xb604('0x85')](function(_0x1823bd){if(!_[_0xb604('0x6d')](_0x1823bd[0x0])){_0x203ce2=_0x1823bd[0x0][_0xb604('0x10a')]?![]:!![];_0x3267c5=_0x1823bd[0x0][_0xb604('0x10a')]?!![]:![];_0x3267c5=_0x24fe8a?!![]:_0x3267c5;}var _0x3e2637=_0x9af7d2[_0xb604('0x10b')](_0x1823bd);if(_0x3e2637['isValid']){rpcDb[_0xb604('0x10c')](_[_0xb604('0x108')](_0x1823bd[0x0],['VoiceQueueId','Contact.phone']))[_0xb604('0x85')](function(_0x4edc1b){_0x9af7d2['checkInBlack'](_0x4edc1b,_0x1823bd[0x0],_0x24fe8a,_0x203ce2,_0x3267c5)['then'](function(_0x5602bd){_0x176112(_0x5602bd);})[_0xb604('0x7a')](function(_0x12498a){_0x10609d(_0x12498a);});})[_0xb604('0x7a')](function(_0x32cd84){ut[_0xb604('0x62')]('[Preview][checkIsBlackList]',_0x32cd84);_0x10609d(ut[_0xb604('0x50')](_0xb604('0x10d'),_0x203ce2,_0x3267c5));});}else{_0x10609d(ut[_0xb604('0x50')](_0x3e2637[_0xb604('0x50')],_0x203ce2,_0x3267c5));}})[_0xb604('0x7a')](function(_0x40d578){ut[_0xb604('0x62')](_0xb604('0x10e'),_0x40d578);_0x10609d(ut[_0xb604('0x50')]('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0xb604('0x10b')]=function(_0x37fdda){if(_[_0xb604('0x6d')](_0x37fdda)||_[_0xb604('0x10f')](_0x37fdda)||!_['isNil'](_0x37fdda[0x0][_0xb604('0x110')])&&_[_0xb604('0x6d')](_0x37fdda[0x0]['Agent']['name'])){ut[_0xb604('0x62')](_0xb604('0x111'),_0x37fdda);return{'isValid':![],'message':_0xb604('0x112')};}var _0x565185=this[_0xb604('0x15')][_0x37fdda[0x0][_0xb604('0x70')][_0xb604('0x57')]];_0x565185[_0xb604('0x50')]=_0xb604('0x9d');if(_[_0xb604('0x6d')](_0x565185)){ut[_0xb604('0x62')](_0xb604('0x113'),_0x565185);return{'isValid':![],'message':_0xb604('0x114')};}if(!this[_0xb604('0x9b')](_0x565185['Trunk'])){ut['logger'](_0xb604('0x115'),_0xb604('0x116')+_0x565185['name']+_0xb604('0x117'));if(!this[_0xb604('0x9b')](_0x565185[_0xb604('0x9c')])){ut[_0xb604('0x62')](_0xb604('0x115'),_0x565185[_0xb604('0x57')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xb604('0x118')};}}if(!ut[_0xb604('0x9a')](_0x565185['dialActive'])){ut[_0xb604('0x62')]('[Preview][validateContact][Campaign\x20Active]',_0x565185[_0xb604('0x57')]+_0xb604('0x119'));return{'isValid':![],'message':_0xb604('0x116')+_0x565185[_0xb604('0x57')]+_0xb604('0x119')};}return{'isValid':!![],'message':_0xb604('0x11a')};};Preview[_0xb604('0x12')]['execCall']=function(_0x4fe369,_0x419b1d,_0x3a9a8a,_0x2d9ca1){var _0x5ecfd5=this;return new BPromise(function(_0x9fc156,_0x2866a1){var _0x1d3bb4=_0x4fe369['uniqueid'];var _0x45e917=_0x5ecfd5[_0xb604('0x9b')](_0x419b1d[_0xb604('0x56')])?util[_0xb604('0x5b')]('SIP/%s/%s%s',_0x419b1d['Trunk'][_0xb604('0x57')],_[_0xb604('0x6d')](_0x419b1d[_0xb604('0x11b')])?'':_0x419b1d['dialPrefix'][_0xb604('0x11c')]()||'',_0x419b1d[_0xb604('0x11d')]>0x0?_0x3a9a8a[_0xb604('0xf8')]['phone']['substring'](_0x419b1d[_0xb604('0x11d')]):_0x3a9a8a['Contact'][_0xb604('0x11e')]):util[_0xb604('0x5b')]('SIP/%s/%s%s',_['isNil'](_0x419b1d[_0xb604('0x9c')])?_0x419b1d[_0xb604('0x56')][_0xb604('0x57')]:_0x419b1d['TrunkBackup']['name'],_[_0xb604('0x6d')](_0x419b1d['dialPrefix'])?'':_0x419b1d[_0xb604('0x11b')][_0xb604('0x11c')]()||'',_0x419b1d[_0xb604('0x11d')]>0x0?_0x3a9a8a['Contact'][_0xb604('0x11e')]['substring'](_0x419b1d[_0xb604('0x11d')]):_0x3a9a8a[_0xb604('0xf8')][_0xb604('0x11e')]);var _0x4e105f=_0x5ecfd5['isTrunkReachable'](_0x419b1d[_0xb604('0x56')])?ut[_0xb604('0x11f')](_0x419b1d[_0xb604('0x56')][_0xb604('0x120')],_0x419b1d['dialOriginateCallerIdName'],_0x419b1d[_0xb604('0x121')]>0x0?ut[_0xb604('0x122')](_0x419b1d[_0xb604('0x39')],_0x419b1d[_0xb604('0x121')]):_0x419b1d[_0xb604('0x39')]):ut['getCallerId'](_[_0xb604('0x6d')](_0x419b1d[_0xb604('0x9c')])?_0x419b1d[_0xb604('0x56')]['callerid']:_0x419b1d['TrunkBackup'][_0xb604('0x120')],_0x419b1d[_0xb604('0x38')],_0x419b1d['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xb604('0x122')](_0x419b1d[_0xb604('0x39')],_0x419b1d[_0xb604('0x121')]):_0x419b1d['dialOriginateCallerIdNumber']);if(_0x4e105f){_0x4fe369[_0xb604('0x123')]=ut[_0xb604('0x124')](_0x4e105f);_0x4fe369['originatecalleridnum']=ut[_0xb604('0x125')](_0x4e105f);}var _0x35a1f8=ut[_0xb604('0x126')](_0x419b1d,_0x3a9a8a,_0x45e917,_0x4e105f,_0x1d3bb4,_0x4fe369);_[_0xb604('0x127')](_0x4fe369,ut[_0xb604('0x128')](_0x35a1f8));_0x4fe369[_0xb604('0x129')]=moment()[_0xb604('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');ami['Action'](ut[_0xb604('0x12a')](_0x4fe369,_0x419b1d,_0x35a1f8,_0x4fe369['activeContact'],_0x2d9ca1))[_0xb604('0x85')](function(_0x4e862a){_0x419b1d['originated']+=0x1;logger['info']('[originated][increment]',_0x1d3bb4,_0xb604('0xb0'),_0x419b1d[_0xb604('0x57')],_0xb604('0x71'),_0x419b1d[_0xb604('0x51')]);_0x9fc156(_0x4e862a);})[_0xb604('0x7a')](function(_0x1e607a){ut['logAgent'](_0x4fe369,0xe,_0xb604('0x12b'));rpcDb[_0xb604('0xf0')](_0x4fe369,_0xb604('0x12c'));_0x2866a1(_0x1e607a);});});};Preview[_0xb604('0x12')][_0xb604('0x22')]=function(_0x4930a4){if(this[_0xb604('0x18')][_0x4930a4[_0xb604('0xbf')]]){this['actions'][_0x4930a4[_0xb604('0xbf')]][_0xb604('0x12d')]=_0x4930a4['channel'];}};Preview[_0xb604('0x12')][_0xb604('0x1a')]=function(_0x462460){var _0x3b4636=this;var _0x2ffb5a=this[_0xb604('0x18')][_0x462460[_0xb604('0x12e')]];if(_0x2ffb5a){if(_0x2ffb5a['lookAgent']&&this[_0xb604('0x12f')][_0x2ffb5a[_0xb604('0xfa')]]){ut['logLookAgent'](_0x2ffb5a,this[_0xb604('0x12f')][_0x2ffb5a[_0xb604('0xfa')]][_0xb604('0x57')],this['agents'][_0x2ffb5a[_0xb604('0xfa')]]['id']);}var _0x5a77fb=_['clone'](_0x2ffb5a);_0x5a77fb[_0xb604('0xae')]=moment()[_0xb604('0x5b')](_0xb604('0x8e'));var _0xee6d5a=_0x3b4636[_0xb604('0x15')][_0x2ffb5a[_0xb604('0x72')]];if(ut[_0xb604('0x130')](_0x462460[_0xb604('0x131')])){if(_0x2ffb5a['unlockAgent']){rpcDb[_0xb604('0x107')](_0x2ffb5a[_0xb604('0xfe')]);}if(_0x2ffb5a[_0xb604('0xac')]){rpcDb[_0xb604('0x8d')](_0x2ffb5a[_0xb604('0xfe')]);}ami['emit'](_0xb604('0x132'),ut['buildObj'](_0x2ffb5a,_0xb604('0x133')));this[_0xb604('0xea')](_0x5a77fb,_0xee6d5a,_0x462460);}else{_0x2ffb5a[_0xb604('0x129')]=moment()[_0xb604('0x5b')](_0xb604('0x8e'));ut['logAgent'](_0x5a77fb,0x4,_0xb604('0xb9'));rpcDb['createAgentHistory'](_0x5a77fb,_0xb604('0x134'));}}};Preview['prototype']['syncHangup']=function(_0x5f4203){var _0x48fb1b=this;var _0x427f01=this[_0xb604('0x18')][_0x5f4203[_0xb604('0xbf')]];var _0x402c51;if(_0x427f01){_0x402c51=this[_0xb604('0x15')][_0x427f01[_0xb604('0x72')]];logger['info'](_0xb604('0x135'),_0x5f4203['linkedid'],_0xb604('0xb0'),_0x402c51[_0xb604('0x57')],_0xb604('0x73'),_0x402c51[_0xb604('0x2e')]);}if(this[_0xb604('0x18')][_0x5f4203[_0xb604('0xbf')]]&&_0x5f4203[_0xb604('0xbf')]!==_0x5f4203[_0xb604('0xbe')]){if(_0x5f4203[_0xb604('0x136')]==='16'&&this[_0xb604('0x18')][_0x5f4203[_0xb604('0xbf')]][_0xb604('0x7e')]){this[_0xb604('0x9e')](_0x5f4203,_0x5f4203[_0xb604('0xbf')],_0x5f4203[_0xb604('0x136')]);}else if(this[_0xb604('0x18')][_0x5f4203[_0xb604('0xbf')]][_0xb604('0x7e')]){logger[_0xb604('0x6e')]('[syncHangup][talking][cause]',_0x5f4203[_0xb604('0xbf')],_0x5f4203[_0xb604('0x136')],_0xb604('0xb0'),_0x402c51[_0xb604('0x57')],_0xb604('0x73'),_0x402c51[_0xb604('0x2e')]);this[_0xb604('0x9e')](_0x5f4203,_0x5f4203[_0xb604('0xbf')],_0x5f4203['cause']);}}else if(_0x427f01&&_[_0xb604('0x6d')](_0x427f01['statedesc'])&&_0x402c51[_0xb604('0x137')]&&_0x5f4203[_0xb604('0xbf')]===_0x5f4203[_0xb604('0xbe')]&&_[_0xb604('0x6d')](_0x5f4203[_0xb604('0xf4')])&&_0x5f4203[_0xb604('0x136')]==='16'&&_0x5f4203[_0xb604('0x138')]==='6'&&_[_0xb604('0xeb')](_0x427f01[_0xb604('0x139')])){if(_0x427f01[_0xb604('0xab')]){rpcDb[_0xb604('0x107')](_0x427f01[_0xb604('0xfe')]);}if(_0x427f01['activeContact']){rpcDb[_0xb604('0x8d')](_0x427f01[_0xb604('0xfe')]);}_0x5f4203[_0xb604('0xf4')]='22';this[_0xb604('0xea')](_0x427f01,_0x402c51,_0x5f4203);}else if(_0x427f01&&_0x427f01[_0xb604('0x139')]){if(_0x5f4203[_0xb604('0x136')]==='16'&&this['actions'][_0x5f4203[_0xb604('0xbf')]][_0xb604('0x7e')]){logger['info'](_0xb604('0x13a'),_0x5f4203[_0xb604('0xbf')],_0x5f4203[_0xb604('0x136')],_0xb604('0xb0'),_0x402c51[_0xb604('0x57')],_0xb604('0x73'),_0x402c51[_0xb604('0x2e')]);this[_0xb604('0x9e')](_0x5f4203,_0x5f4203[_0xb604('0xbf')],_0x5f4203['cause']);}else if(this[_0xb604('0x18')][_0x5f4203[_0xb604('0xbf')]][_0xb604('0x7e')]){logger['info']('[syncHangup][talking][cause]',_0x5f4203[_0xb604('0xbf')],_0x5f4203['cause'],'\x20Queue',_0x402c51[_0xb604('0x57')],_0xb604('0x73'),_0x402c51[_0xb604('0x2e')]);this[_0xb604('0x9e')](_0x5f4203,_0x5f4203[_0xb604('0xbf')],_0x5f4203[_0xb604('0x136')]);}}};Preview[_0xb604('0x12')][_0xb604('0x20')]=function(_0x29de5c){if(this['actions'][_0x29de5c[_0xb604('0xe9')]]&&_0x29de5c[_0xb604('0xe9')]!==_0x29de5c[_0xb604('0x13b')]){this['callProgressDetectingCustomer'](_0x29de5c,_0x29de5c['destlinkedid'],_0x29de5c['dialstatus']);}};Preview[_0xb604('0x12')][_0xb604('0x1e')]=function(_0x3761d0){if(this['actions'][_0x3761d0[_0xb604('0xbf')]]&&_0x3761d0[_0xb604('0xbf')]!==_0x3761d0[_0xb604('0xbe')]&&!this['actions'][_0x3761d0[_0xb604('0xbf')]][_0xb604('0x7e')]){if(_0x3761d0['cause']==='1'){this[_0xb604('0x9e')](_0x3761d0,_0x3761d0['linkedid'],_0x3761d0['cause']);}}};Preview['prototype']['addVariable']=function(_0x3eb880,_0x101fcc,_0xc2df34){if(this[_0xb604('0x18')][_0x3eb880]){if(_[_0xb604('0x6d')](this[_0xb604('0x18')][_0x3eb880][_0xb604('0x13c')])){this[_0xb604('0x18')][_0x3eb880][_0xb604('0x13c')]={};}this[_0xb604('0x18')][_0x3eb880]['variables'][_0x101fcc]=_0xc2df34;}};Preview[_0xb604('0x12')][_0xb604('0x13d')]=function(_0x11663f){try{if(!_['isNil'](_0x11663f)){if(ut['filterKey'](_[_0xb604('0x13e')](_0x11663f[_0xb604('0x13f')])[0x0])){this['addVariable'](_0x11663f[_0xb604('0xbe')],_[_0xb604('0x13e')](_0x11663f[_0xb604('0x13f')])[0x0],_0x11663f[_0xb604('0x140')]);}}}catch(_0x331f16){logger['error'](_0xb604('0x141'),util[_0xb604('0x142')](_0x331f16,{'showHidden':![],'depth':null}));}};Preview[_0xb604('0x12')][_0xb604('0x25')]=function(_0x410a59){if(_0x410a59){if(this[_0xb604('0x18')][_0x410a59[_0xb604('0x143')]]){this[_0xb604('0x18')][_0x410a59[_0xb604('0x143')]][_0xb604('0x139')]=!![];}}};Preview['prototype'][_0xb604('0x27')]=function(_0x38e683){if(_0x38e683){if(this['actions'][_0x38e683[_0xb604('0x144')]]){this[_0xb604('0x18')][_0x38e683[_0xb604('0x144')]][_0xb604('0x139')]=!![];}}};module[_0xb604('0x145')]=Preview; \ No newline at end of file +var _0xb571=['loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','hasOwnProperty','clearZombieChannel','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','rescheduleContactInQueue','createBody','createCustomerHistory','logCustomer','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','linkedid','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','[Dialer][decrementTalkink][no\x20Hangup][Preview]','outboundUnknownCallsDay','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','logAgent','NoAnswer','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','substring','dialCutDigit','isTrunkReachable','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','keys','variable','value','inspect','transfertargetlinkedid','transfererlinkedid','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','dialend','newexten','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','outbound','name','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','syncCampaigns','booked','setMessage','recallMe','enqueue','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb571,0xce));var _0x1b57=function(_0x1d9d36,_0x3030fc){_0x1d9d36=_0x1d9d36-0x0;var _0x28dbe6=_0xb571[_0x1d9d36];return _0x28dbe6;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x1b57('0x0'));var uuid=require('uuid');var moment=require('moment');var md5=require(_0x1b57('0x1'));var Redis=require(_0x1b57('0x2'));var config=require(_0x1b57('0x3'));var logger=require(_0x1b57('0x4'))(_0x1b57('0x5'));var loggerAction=require('../../../config/logger')(_0x1b57('0x6'));var ami=require(_0x1b57('0x7'));var rpcDb=require(_0x1b57('0x8'));var Action=require(_0x1b57('0x9'));var ut=require(_0x1b57('0xa'));config[_0x1b57('0xb')]=_[_0x1b57('0xc')](config['redis'],{'host':_0x1b57('0xd'),'port':0x18eb});var io=require(_0x1b57('0xe'))(new Redis(config[_0x1b57('0xb')]));var Sequence=function(){};Sequence[_0x1b57('0xf')]['enqueue']=function(_0x2fc9a7){this[_0x1b57('0x10')]=this['tail']?this[_0x1b57('0x10')][_0x1b57('0x11')](_0x2fc9a7):_0x2fc9a7();};function Preview(_0x2a325c){this[_0x1b57('0x12')]=new Sequence();this[_0x1b57('0x13')]=_0x2a325c[_0x1b57('0x14')];this[_0x1b57('0x15')]=_0x2a325c[_0x1b57('0x15')];this[_0x1b57('0x16')]={};this[_0x1b57('0x17')]=_0x2a325c[_0x1b57('0x17')];this[_0x1b57('0x18')]=0x0;ami['on'](_0x1b57('0x19'),this[_0x1b57('0x1a')][_0x1b57('0x1b')](this));ami['on'](_0x1b57('0x1c'),this['syncHangup'][_0x1b57('0x1b')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x1b57('0x1b')](this));ami['on'](_0x1b57('0x1d'),this['syncDialEnd']['bind'](this));ami['on'](_0x1b57('0x1e'),this[_0x1b57('0x1f')][_0x1b57('0x1b')](this));ami['on'](_0x1b57('0x20'),this['syncVarSet'][_0x1b57('0x1b')](this));ami['on'](_0x1b57('0x21'),this[_0x1b57('0x22')]['bind'](this));ami['on'](_0x1b57('0x23'),this[_0x1b57('0x24')][_0x1b57('0x1b')](this));this[_0x1b57('0x25')](this['campaignsPreview']);}function emit(_0x322236,_0x3e78e8,_0x2c10f6){io['to'](_0x322236)[_0x1b57('0x26')](_0x3e78e8,_0x2c10f6);}function emitCampaignPreview(_0x354445){if(_0x354445['type']===_0x1b57('0x27')){var _0x1224cc={'id':_0x354445['id'],'name':_0x354445[_0x1b57('0x28')],'strategy':_0x354445['strategy'],'answered':_0x354445[_0x1b57('0x29')],'available':_0x354445[_0x1b57('0x2a')],'loggedIn':_0x354445['loggedIn'],'pTalking':_0x354445[_0x1b57('0x2b')],'sumBillable':_0x354445[_0x1b57('0x2c')],'sumDuration':_0x354445[_0x1b57('0x2d')],'sumHoldTime':_0x354445[_0x1b57('0x2e')]||0x0,'talking':_0x354445[_0x1b57('0x2f')],'total':_0x354445[_0x1b57('0x30')],'type':_0x354445[_0x1b57('0x31')],'unmanaged':_0x354445['unmanaged'],'abandoned':_0x354445[_0x1b57('0x32')],'waiting':_0x354445[_0x1b57('0x33')],'loggedInDb':_0x354445[_0x1b57('0x34')],'dialActive':_0x354445[_0x1b57('0x35')],'dialMethod':_0x354445[_0x1b57('0x36')],'dialOriginateCallerIdName':_0x354445[_0x1b57('0x37')],'dialOriginateCallerIdNumber':_0x354445[_0x1b57('0x38')],'dialOriginateTimeout':_0x354445['dialOriginateTimeout'],'dialPrefix':_0x354445[_0x1b57('0x39')],'outboundAnswerAgiCallsDay':_0x354445['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x354445[_0x1b57('0x3a')],'outboundBlacklistCallsDay':_0x354445[_0x1b57('0x3b')],'outboundBusyCallsDay':_0x354445[_0x1b57('0x3c')],'outboundCongestionCallsDay':_0x354445[_0x1b57('0x3d')],'outboundDropCallsDayACS':_0x354445[_0x1b57('0x3e')],'outboundDropCallsDayCallersExit':_0x354445['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x354445[_0x1b57('0x3f')],'outboundNoAnswerCallsDay':_0x354445['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x354445[_0x1b57('0x40')],'outboundOriginateFailureCallsDay':_0x354445[_0x1b57('0x41')],'outboundReCallsDay':_0x354445[_0x1b57('0x42')],'outboundRejectCallsDay':_0x354445[_0x1b57('0x43')],'outboundUnknownCallsDay':_0x354445['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x354445[_0x1b57('0x44')],'predictiveIntervalAnsweredCalls':_0x354445['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x354445[_0x1b57('0x45')],'predictiveIntervalAvgTalktime':_0x354445[_0x1b57('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x354445[_0x1b57('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x354445[_0x1b57('0x48')],'predictiveIntervalErlangCalls':_0x354445[_0x1b57('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x354445[_0x1b57('0x4a')],'predictiveIntervalHitRate':_0x354445[_0x1b57('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x354445[_0x1b57('0x4c')],'predictiveIntervalPauses':_0x354445[_0x1b57('0x4d')],'predictiveIntervalAvailable':_0x354445[_0x1b57('0x4e')],'predictiveIntervalTotalCalls':_0x354445[_0x1b57('0x4f')],'message':_0x354445[_0x1b57('0x50')],'originated':_0x354445[_0x1b57('0x51')],'erlangCalls':_0x354445[_0x1b57('0x52')],'erlangCallToSecond':_0x354445['erlangCallToSecond'],'erlangAbandonmentRate':_0x354445[_0x1b57('0x53')],'erlangBusyFactor':_0x354445[_0x1b57('0x54')],'startPredictive':_0x354445[_0x1b57('0x55')],'startProgressive':_0x354445[_0x1b57('0x56')]};if(_0x354445[_0x1b57('0x57')]){_0x1224cc[_0x1b57('0x57')]={'id':_0x354445[_0x1b57('0x57')]['id'],'name':_0x354445[_0x1b57('0x57')][_0x1b57('0x28')],'active':_0x354445[_0x1b57('0x57')][_0x1b57('0x58')],'callerid':_0x354445[_0x1b57('0x57')][_0x1b57('0x59')]};}if(_0x354445[_0x1b57('0x5a')]){_0x1224cc[_0x1b57('0x5a')]={'id':_0x354445[_0x1b57('0x5a')]['id'],'name':_0x354445['Interval'][_0x1b57('0x28')]};}var _0x54d014=md5(JSON[_0x1b57('0x5b')](_0x1224cc));if(_0x354445[_0x1b57('0x1')]!==_0x54d014){_0x354445[_0x1b57('0x1')]=_0x54d014;emit(util[_0x1b57('0x5c')]('voice:queue:%s',_0x1224cc[_0x1b57('0x28')]),_0x1b57('0x5d'),_0x1224cc);}}}function emitVoiceQueueChannelRemove(_0x2de630){logger[_0x1b57('0x5e')](_0x1b57('0x5f'),JSON[_0x1b57('0x5b')](_0x2de630));emit(util[_0x1b57('0x5c')](_0x1b57('0x60'),_0x2de630[_0x1b57('0x28')]),'voice_queue_channel:remove',_0x2de630);}function notSendMessagesQueue(_0x224216){if(_0x224216[_0x1b57('0x61')]){if(_0x224216[_0x1b57('0x51')]===0x0&&_0x224216[_0x1b57('0x2b')]===0x0){_0x224216[_0x1b57('0x61')]=![];_0x224216[_0x1b57('0x2a')]=0x0;_0x224216[_0x1b57('0x62')]=0x0;_0x224216[_0x1b57('0x50')]=_0x1b57('0x63');ut[_0x1b57('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x224216[_0x1b57('0x28')]+_0x1b57('0x65'));}else{_0x224216[_0x1b57('0x50')]=_0x1b57('0x66');ut['logger'](_0x1b57('0x67'),_0x224216['name']+_0x1b57('0x68'));}emitCampaignPreview(_0x224216);}}Preview[_0x1b57('0xf')][_0x1b57('0x25')]=function(){var _0x5670b6=this;setInterval(function(){_0x5670b6[_0x1b57('0x69')]();},0x7cf);};Preview[_0x1b57('0xf')]['syncCampaigns']=function(){var _0x2625b4=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x50022b in _0x2625b4){if(_0x2625b4['hasOwnProperty'](_0x50022b)&&(_0x2625b4[_0x50022b][_0x1b57('0x36')]==='preview'||_0x2625b4[_0x50022b][_0x1b57('0x36')]===_0x1b57('0x6a'))&&_0x2625b4[_0x50022b][_0x1b57('0x31')]===_0x1b57('0x27')){if(this[_0x1b57('0x18')]>0x7){this[_0x1b57('0x18')]=0x0;this['clearZombieChannels']();}}if(_0x2625b4['hasOwnProperty'](_0x50022b)&&_0x2625b4[_0x50022b][_0x1b57('0x36')]===_0x1b57('0x5')&&_0x2625b4[_0x50022b][_0x1b57('0x31')]===_0x1b57('0x27')){if(_0x2625b4[_0x50022b][_0x1b57('0x35')]){this[_0x1b57('0x6b')](_0x2625b4[_0x50022b]);this[_0x1b57('0x6c')](_0x2625b4[_0x50022b]);}else{notSendMessagesQueue(_0x2625b4[_0x50022b]);}}}};Preview[_0x1b57('0xf')]['clearZombieChannel']=function(_0x2b701e){var _0x25fd4f=this;this[_0x1b57('0x12')][_0x1b57('0x6d')](function(){if(!_[_0x1b57('0x6e')](_0x25fd4f[_0x1b57('0x16')][_0x2b701e])){loggerAction['info'](_0x1b57('0x6f'),_0x2b701e,_0x1b57('0x70'),_0x25fd4f[_0x1b57('0x16')][_0x2b701e][_0x1b57('0x71')],_0x1b57('0x72'),JSON[_0x1b57('0x5b')](_0x25fd4f[_0x1b57('0x13')][_0x25fd4f[_0x1b57('0x16')][_0x2b701e][_0x1b57('0x71')]][_0x1b57('0x51')]),_0x1b57('0x73'),JSON[_0x1b57('0x5b')](_0x25fd4f[_0x1b57('0x13')][_0x25fd4f[_0x1b57('0x16')][_0x2b701e][_0x1b57('0x71')]]['pTalking']),JSON[_0x1b57('0x5b')](_0x25fd4f[_0x1b57('0x16')][_0x2b701e][_0x1b57('0x74')]),JSON[_0x1b57('0x5b')](_[_0x1b57('0x75')](_0x25fd4f[_0x1b57('0x16')][_0x2b701e],[_0x1b57('0x76'),_0x1b57('0x77'),_0x1b57('0x78'),_0x1b57('0x79')])));return ami[_0x1b57('0x7a')]({'action':_0x1b57('0x7b'),'channel':_0x25fd4f[_0x1b57('0x16')][_0x2b701e][_0x1b57('0x7c')]})[_0x1b57('0x7d')](function(_0x225af8){if(_0x225af8[_0x1b57('0x50')]===_0x1b57('0x7e')){setTimeout(function(){if(_0x25fd4f[_0x1b57('0x16')][_0x2b701e]){ut[_0x1b57('0x7f')](_0x25fd4f[_0x1b57('0x13')][_0x25fd4f['actions'][_0x2b701e]['queue']],'[clearZombieChannel]');if(_0x25fd4f['actions'][_0x2b701e][_0x1b57('0x74')]===!![]){ut[_0x1b57('0x80')](_0x25fd4f[_0x1b57('0x13')][_0x25fd4f[_0x1b57('0x16')][_0x2b701e][_0x1b57('0x71')]],_0x1b57('0x81'));ut[_0x1b57('0x82')](_0x1b57('0x83')+_0x2b701e,_0x25fd4f[_0x1b57('0x16')][_0x2b701e]['queue']);}ut['loggerError'](_0x1b57('0x84')+_0x2b701e,_0x25fd4f[_0x1b57('0x16')][_0x2b701e][_0x1b57('0x71')]);delete _0x25fd4f[_0x1b57('0x16')][_0x2b701e];}},0x2328);}});}});};Preview[_0x1b57('0xf')][_0x1b57('0x85')]=function(){var _0x1ac482=this;loggerAction[_0x1b57('0x5e')](_0x1b57('0x86'),_['size'](this[_0x1b57('0x16')]));for(var _0xf7f257 in this[_0x1b57('0x16')]){if(_0x1ac482[_0x1b57('0x16')][_0x1b57('0x87')](_0xf7f257)){_0x1ac482[_0x1b57('0x88')](_0xf7f257);}}};Preview[_0x1b57('0xf')]['recallMe']=function(_0x5cc1ee){var _0x110d51=this;rpcDb['getContactRecallMe'](_0x5cc1ee['id'],ut['agentReadyId'](this[_0x1b57('0x17')]))[_0x1b57('0x89')](function(_0x4732cf){if(!_[_0x1b57('0x6e')](_0x4732cf)){for(var _0x4cf5dd=0x0;_0x4cf5dd<_0x4732cf[_0x1b57('0x8a')];_0x4cf5dd+=0x1){if(ut['getDiff'](_0x4732cf[_0x4cf5dd][_0x1b57('0x8b')])<_0x5cc1ee[_0x1b57('0x8c')]*0x3c){if(_0x4732cf[_0x4cf5dd][_0x1b57('0x8d')]&&!_0x4732cf[_0x4cf5dd]['Agent'][_0x1b57('0x8e')]){_0x110d51[_0x1b57('0x8f')](_0x4732cf[_0x4cf5dd]['id'])[_0x1b57('0x89')](ut[_0x1b57('0x90')](_0x1b57('0x91')))['catch'](ut[_0x1b57('0x90')](_0x1b57('0x91')));}else{rpcDb[_0x1b57('0x92')](_0x4732cf[_0x4cf5dd]['id']);}}else{var _0x305cf7=new Action(_0x4732cf[_0x4cf5dd],_0x5cc1ee);_0x305cf7[_0x1b57('0x93')]=moment()[_0x1b57('0x5c')](_0x1b57('0x94'));_0x5cc1ee['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x305cf7,0x17,'RecallInQueue');if(_0x5cc1ee['dialRecallInQueue']){rpcDb[_0x1b57('0x95')](ut[_0x1b57('0x96')](_0x4732cf[_0x4cf5dd]));rpcDb[_0x1b57('0x97')](_0x305cf7,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x1b57('0x98')](_0x305cf7,0x16,'RecallFailedTimeout');rpcDb[_0x1b57('0x97')](_0x305cf7,_0x1b57('0x99'));rpcDb[_0x1b57('0x9a')](_0x305cf7,_0x1b57('0x99'));}}}}})['catch'](ut[_0x1b57('0x90')](_0x1b57('0x9b')));};Preview[_0x1b57('0xf')][_0x1b57('0x6b')]=function(_0x5b528d){_0x5b528d[_0x1b57('0x61')]=!![];if(ut[_0x1b57('0x9c')](_0x5b528d[_0x1b57('0x9d')])){_0x5b528d[_0x1b57('0x50')]=_0x1b57('0x9e');}else if(!ut[_0x1b57('0x9f')](_0x5b528d[_0x1b57('0x35')])){_0x5b528d['message']=_0x1b57('0x63');}else if(!this['isTrunkReachable'](_0x5b528d['Trunk'])){if(!this['isTrunkReachable'](_0x5b528d[_0x1b57('0xa0')])){_0x5b528d[_0x1b57('0x50')]=_0x1b57('0xa1');}else{_0x5b528d['message']=_0x1b57('0xa2');}}else{_0x5b528d[_0x1b57('0x50')]=_0x1b57('0xa2');}emitCampaignPreview(_0x5b528d);};Preview['prototype'][_0x1b57('0xa3')]=function(_0x4d2540,_0x3d5ddf,_0xabef95){var _0x25a72d=this;var _0x59fa77=this[_0x1b57('0x16')][_0x3d5ddf];var _0xe2ad4e=this[_0x1b57('0x13')][_0x59fa77[_0x1b57('0x71')]];var _0x3e27e7;if(_0xe2ad4e){switch(_0xabef95){case'1':_0xe2ad4e[_0x1b57('0x40')]+=0x1;_0x59fa77[_0x1b57('0xa4')]+=0x1;_0x59fa77[_0x1b57('0xa5')]=ut[_0x1b57('0xa6')](_0x59fa77);ut[_0x1b57('0x98')](_0x59fa77,0x0,_0x1b57('0xa7'));ami[_0x1b57('0x26')](_0x1b57('0xa8'),ut[_0x1b57('0xa9')](_0x59fa77,_0x1b57('0xaa')));rpcDb[_0x1b57('0x97')](_0x59fa77,_0x1b57('0xab'));if(ut[_0x1b57('0xa6')](_0x59fa77)>=_0xe2ad4e['dialGlobalMaxRetry']){_0x3e27e7=ut[_0x1b57('0xac')](_0x59fa77,0xf,_0x1b57('0xad'));rpcDb[_0x1b57('0x9a')](_0x3e27e7,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x59fa77[_0x1b57('0xa4')]>=_0xe2ad4e[_0x1b57('0xae')]){rpcDb['createCustomerFinal'](_0x59fa77,_0x1b57('0xaf'));}else{rpcDb[_0x1b57('0xb0')](ut[_0x1b57('0xb1')](_0x59fa77,_0x1b57('0xa4'),_0xe2ad4e['dialNoSuchNumberRetryFrequency']),_0x59fa77[_0x1b57('0xb2')],_0x59fa77[_0x1b57('0xb3')]);}}delete this[_0x1b57('0x16')][_0x4d2540['linkedid']];break;case _0x1b57('0xb4'):var _0x2f161d=moment()[_0x1b57('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x59fa77[_0x1b57('0xb5')]=_0x2f161d;_0x59fa77[_0x1b57('0xb6')]=_0x2f161d;_0x59fa77[_0x1b57('0x74')]=!![];_0xe2ad4e['pTalking']+=0x1;logger['info'](_0x1b57('0xb7'),_0x59fa77[_0x1b57('0xb8')],_0x1b57('0xb9'),_0xe2ad4e['name'],_0x1b57('0x73'),_0xe2ad4e[_0x1b57('0x2b')]);ami[_0x1b57('0x26')](_0x1b57('0xba'),ut[_0x1b57('0xa9')](_0x59fa77,'connect'));if(_0xe2ad4e[_0x1b57('0xbb')]){ami[_0x1b57('0x26')](_0x1b57('0xbc'),ut[_0x1b57('0xbd')](_0x59fa77));}break;case'16':ami[_0x1b57('0x26')](_0x1b57('0xbe'),ut[_0x1b57('0xa9')](_0x59fa77,_0x1b57('0xbf')));emitVoiceQueueChannelRemove(ut[_0x1b57('0xa9')](_0x59fa77,_0x1b57('0xbf')));_0xe2ad4e['outboundAnswerCallsDay']+=0x1;_0xe2ad4e[_0x1b57('0x30')]+=0x1;_0xe2ad4e['answered']+=0x1;ut[_0x1b57('0x80')](_0xe2ad4e,_0x1b57('0xc0'));_0x59fa77[_0x1b57('0xa5')]=ut[_0x1b57('0xa6')](_0x59fa77);ut['logCustomer'](_0x59fa77,0x4,'Answer');rpcDb[_0x1b57('0x97')](_0x59fa77,_0x1b57('0xc1'));rpcDb['createCustomerFinal'](_0x59fa77,_0x1b57('0xc2'));rpcDb['crateCustomerReportQueue'](_0x59fa77);_0xe2ad4e['sumDuration']+=_0x59fa77[_0x1b57('0xc3')];_0xe2ad4e[_0x1b57('0x2c')]+=_0x59fa77[_0x1b57('0xc3')];logger[_0x1b57('0x5e')]('[syncHangup][talking][decrement]',_0x59fa77[_0x1b57('0xb8')],_0x1b57('0xb9'),_0xe2ad4e[_0x1b57('0x28')],_0x1b57('0x73'),_0xe2ad4e[_0x1b57('0x2b')]);delete this[_0x1b57('0x16')][_0x4d2540[_0x1b57('0xc4')]];break;case'BUSY':_0xe2ad4e[_0x1b57('0x3c')]+=0x1;_0x59fa77[_0x1b57('0xc5')]+=0x1;_0x59fa77[_0x1b57('0xa5')]=ut[_0x1b57('0xa6')](_0x59fa77);ut[_0x1b57('0x98')](_0x59fa77,0x5,_0x1b57('0xc6'));ami['emit'](_0x1b57('0xc7'),ut[_0x1b57('0xa9')](_0x59fa77,_0x1b57('0xc8')));rpcDb[_0x1b57('0x97')](_0x59fa77,_0x1b57('0xc9'));if(ut['totalGlobal'](_0x59fa77)>=_0xe2ad4e[_0x1b57('0xca')]){_0x3e27e7=ut[_0x1b57('0xac')](_0x59fa77,0xf,_0x1b57('0xad'));rpcDb[_0x1b57('0x9a')](_0x3e27e7,_0x1b57('0xcb'));}else{if(_0x59fa77[_0x1b57('0xc5')]>=_0xe2ad4e[_0x1b57('0xcc')]){rpcDb['createCustomerFinal'](_0x59fa77,_0x1b57('0xc9'));}else{rpcDb[_0x1b57('0xb0')](ut['scheduledAt'](_0x59fa77,'countbusyretry',_0xe2ad4e[_0x1b57('0xcd')]),_0x59fa77['unlockAgent'],_0x59fa77[_0x1b57('0xb3')]);}}break;case _0x1b57('0xce'):_0xe2ad4e['outboundNoAnswerCallsDay']+=0x1;_0x59fa77[_0x1b57('0xcf')]+=0x1;_0x59fa77[_0x1b57('0xa5')]=ut[_0x1b57('0xa6')](_0x59fa77);ut['logCustomer'](_0x59fa77,0x3,'NoAnswer');ami['emit'](_0x1b57('0xd0'),ut['buildObj'](_0x59fa77,'noanswer'));rpcDb[_0x1b57('0x97')](_0x59fa77,_0x1b57('0xd1'));if(ut['totalGlobal'](_0x59fa77)>=_0xe2ad4e['dialGlobalMaxRetry']){_0x3e27e7=ut[_0x1b57('0xac')](_0x59fa77,0xf,_0x1b57('0xad'));rpcDb['createCustomerFinal'](_0x3e27e7,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x59fa77[_0x1b57('0xcf')]>=_0xe2ad4e[_0x1b57('0xd2')]){rpcDb[_0x1b57('0x9a')](_0x59fa77,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb['rescheduleContact'](ut[_0x1b57('0xb1')](_0x59fa77,_0x1b57('0xcf'),_0xe2ad4e[_0x1b57('0xd3')]),_0x59fa77['unlockAgent'],_0x59fa77[_0x1b57('0xb3')]);}}break;case _0x1b57('0xd4'):_0xe2ad4e['outboundCongestionCallsDay']+=0x1;_0x59fa77[_0x1b57('0xd5')]+=0x1;_0x59fa77['countglobal']=ut[_0x1b57('0xa6')](_0x59fa77);ut[_0x1b57('0x98')](_0x59fa77,0x8,_0x1b57('0xd6'));ami[_0x1b57('0x26')](_0x1b57('0xd7'),ut[_0x1b57('0xa9')](_0x59fa77,'congestion'));rpcDb[_0x1b57('0x97')](_0x59fa77,_0x1b57('0xd8'));if(ut[_0x1b57('0xa6')](_0x59fa77)>=_0xe2ad4e[_0x1b57('0xca')]){_0x3e27e7=ut[_0x1b57('0xac')](_0x59fa77,0xf,_0x1b57('0xad'));rpcDb['createCustomerFinal'](_0x3e27e7,_0x1b57('0xd9'));}else{if(_0x59fa77[_0x1b57('0xd5')]>=_0xe2ad4e[_0x1b57('0xda')]){rpcDb[_0x1b57('0x9a')](_0x59fa77,_0x1b57('0xd8'));}else{rpcDb[_0x1b57('0xb0')](ut['scheduledAt'](_0x59fa77,_0x1b57('0xd5'),_0xe2ad4e[_0x1b57('0xcd')]),_0x59fa77[_0x1b57('0xb2')],_0x59fa77[_0x1b57('0xb3')]);}}break;case'CANCEL':_0xe2ad4e[_0x1b57('0x43')]+=0x1;_0x59fa77[_0x1b57('0xdb')]+=0x1;_0x59fa77[_0x1b57('0xa5')]=ut['totalGlobal'](_0x59fa77);ut[_0x1b57('0x98')](_0x59fa77,0x14,'AgentReject');ami[_0x1b57('0x26')](_0x1b57('0xdc'),ut[_0x1b57('0xa9')](_0x59fa77,_0x1b57('0xdd')));rpcDb['createCustomerHistory'](_0x59fa77,_0x1b57('0xde'));if(ut['totalGlobal'](_0x59fa77)>=_0xe2ad4e[_0x1b57('0xca')]){_0x3e27e7=ut[_0x1b57('0xac')](_0x59fa77,0x14,_0x1b57('0xdf'));rpcDb['createCustomerFinal'](_0x3e27e7,_0x1b57('0xe0'));}else{if(_0x59fa77[_0x1b57('0xdb')]>=_0xe2ad4e['dialAgentRejectMaxRetry']){rpcDb[_0x1b57('0x9a')](_0x59fa77,_0x1b57('0xe0'));}else{rpcDb['rescheduleContact'](ut[_0x1b57('0xb1')](_0x59fa77,_0x1b57('0xdb'),_0xe2ad4e[_0x1b57('0xe1')]),_0x59fa77[_0x1b57('0xb2')],_0x59fa77[_0x1b57('0xb3')]);}}break;case _0x1b57('0xe2'):_0xe2ad4e[_0x1b57('0x44')]+=0x1;_0x59fa77[_0x1b57('0xe3')]+=0x1;_0x59fa77[_0x1b57('0xa5')]=ut[_0x1b57('0xa6')](_0x59fa77);ut[_0x1b57('0x98')](_0x59fa77,0xb,_0x1b57('0xe4'));rpcDb[_0x1b57('0x97')](_0x59fa77,_0x1b57('0xe5'));if(ut[_0x1b57('0xa6')](_0x59fa77)>=_0xe2ad4e[_0x1b57('0xca')]){_0x3e27e7=ut[_0x1b57('0xac')](_0x59fa77,0xf,_0x1b57('0xad'));rpcDb[_0x1b57('0x9a')](_0x3e27e7,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x59fa77[_0x1b57('0xe6')]>=_0xe2ad4e[_0x1b57('0xe7')]){rpcDb[_0x1b57('0x9a')](_0x59fa77,_0x1b57('0xe5'));}else{rpcDb['rescheduleContact'](ut[_0x1b57('0xb1')](_0x59fa77,_0x1b57('0xe3'),_0xe2ad4e['dialAbandonedRetryFrequency']),_0x59fa77['unlockAgent'],_0x59fa77['activeContact']);}}break;default:if(_0x59fa77['dialAnswer']){ut[_0x1b57('0x80')](_0xe2ad4e,'[default]');ut[_0x1b57('0x82')](_0x1b57('0xe8')+_0xe2ad4e[_0x1b57('0x28')],_0x4d2540);}_0xe2ad4e[_0x1b57('0xe9')]+=0x1;_0x59fa77[_0x1b57('0xa5')]=ut[_0x1b57('0xa6')](_0x59fa77);ut[_0x1b57('0x98')](_0x59fa77,0xc,_0x4d2540[_0x1b57('0xea')]||_0x4d2540[_0x1b57('0xeb')]);rpcDb[_0x1b57('0x97')](_0x59fa77,_0x1b57('0xec'));if(ut['totalGlobal'](_0x59fa77)>=_0xe2ad4e[_0x1b57('0xca')]){_0x3e27e7=ut[_0x1b57('0xac')](_0x59fa77,0xf,_0x1b57('0xad'));rpcDb[_0x1b57('0x9a')](_0x3e27e7,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x1b57('0x9a')](_0x59fa77,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x1b57('0x16')][_0x4d2540['linkedid']];}if(!(_0x59fa77[_0x1b57('0x74')]&&_0xabef95==='16')){ut[_0x1b57('0x7f')](_0xe2ad4e,_0x1b57('0xed'));logger[_0x1b57('0x5e')](_0x1b57('0xee'),_0x59fa77['uniqueid'],'\x20Queue',_0xe2ad4e[_0x1b57('0x28')],_0x1b57('0x72'),_0xe2ad4e[_0x1b57('0x51')]);}if(_0xabef95!=='ANSWER'){delete this[_0x1b57('0x16')][_0x4d2540[_0x1b57('0xc4')]];delete this[_0x1b57('0x16')][_0x4d2540[_0x1b57('0xef')]];}}};Preview[_0x1b57('0xf')][_0x1b57('0xf0')]=function(_0x5acadc,_0x59d9bc,_0x5ad200){if(_[_0x1b57('0xf1')](_0x59d9bc)&&_0x1b57('0xf2')!==typeof _0x59d9bc){return;}if(_[_0x1b57('0xf1')](_0x5ad200)&&_0x1b57('0xf2')!==typeof _0x5ad200){return;}switch(_0x5ad200[_0x1b57('0xf3')]){case'0':ut['logAgent'](_0x5acadc,0x0,_0x1b57('0xa7'));rpcDb[_0x1b57('0xf4')](_0x5acadc,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x1b57('0xf5')](_0x5acadc,0x3,_0x1b57('0xf6'));rpcDb['createAgentHistory'](_0x5acadc,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x5acadc,0x5,_0x1b57('0xc6'));rpcDb[_0x1b57('0xf4')](_0x5acadc,_0x1b57('0xf7'));break;case'8':ut[_0x1b57('0xf5')](_0x5acadc,0x8,_0x1b57('0xd6'));rpcDb[_0x1b57('0xf4')](_0x5acadc,_0x1b57('0xf8'));break;case'22':ut['logAgent'](_0x5acadc,0x16,_0x1b57('0xf9'));rpcDb[_0x1b57('0xf4')](_0x5acadc,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x1b57('0xf5')](_0x5acadc,0xc,_0x5ad200[_0x1b57('0xf3')]);rpcDb['createAgentHistory'](_0x5acadc,_0x1b57('0xf8'));}ut[_0x1b57('0x7f')](_0x59d9bc,_0x1b57('0xfa'));logger[_0x1b57('0x5e')]('[originated][decrement][callProgressDetectingAgent]',_0x5acadc[_0x1b57('0xb8')],_0x1b57('0xb9'),_0x59d9bc[_0x1b57('0x28')],'originated:\x20',_0x59d9bc[_0x1b57('0x51')]);delete this['actions'][_0x5acadc[_0x1b57('0xb8')]];};Preview['prototype'][_0x1b57('0xfb')]=function(_0x3e2e05,_0xf27c12,_0x470ddd,_0x2345be,_0x3c83ac){var _0xfd5632=this;return new BPromise(function(_0xad162a,_0x4a9352){if(_[_0x1b57('0x6e')](_0xf27c12)||_[_0x1b57('0x6e')](_0xf27c12[_0x1b57('0xfc')])||_['isNil'](_0xf27c12['Contact'][_0x1b57('0xfd')])||_[_0x1b57('0x6e')](_0xf27c12[_0x1b57('0x78')])){_0x4a9352(ut[_0x1b57('0x50')](_0x1b57('0xfe'),_0x2345be,_0x3c83ac));return;}var _0x10624c=uuid['v4']();var _0x2e9e87=_0xfd5632[_0x1b57('0x13')][_0xf27c12[_0x1b57('0x70')][_0x1b57('0x28')]];var _0xf3a52e=_0x470ddd?_0xfd5632[_0x1b57('0x17')][_0x470ddd]['id']:undefined;_0xfd5632['actions'][_0x10624c]=new Action(_0xf27c12,_0x2e9e87,_0x10624c,_0x470ddd,_0xf3a52e);var _0xa27e1c=_0xfd5632[_0x1b57('0x16')][_0x10624c];_0xa27e1c[_0x1b57('0xb2')]=_0x2345be;_0xa27e1c[_0x1b57('0xb3')]=_0x3c83ac;_0xa27e1c[_0x1b57('0xff')]=_0x470ddd;if(_['isEmpty'](_0x3e2e05)){_0xfd5632[_0x1b57('0x100')](_0xa27e1c,_0x2e9e87,_0xf27c12,_0x470ddd)[_0x1b57('0x89')](function(_0x53f74a){logger[_0x1b57('0x5e')](_0x1b57('0x101'),_0x1b57('0x102')+_0xa27e1c['queue']+_0x1b57('0x103')+_0xa27e1c[_0x1b57('0x104')],JSON[_0x1b57('0x5b')](_0x53f74a));ami['emit'](_0x1b57('0x105'),ut[_0x1b57('0xa9')](_0xa27e1c,_0x1b57('0x106')));_0xad162a(ut['message'](_0x1b57('0x107')));})['catch'](function(_0x3cb312){ut[_0x1b57('0x64')](_0x1b57('0x108'),_0x3cb312);_0x4a9352(ut[_0x1b57('0x50')](_0x1b57('0x109'),_0x2345be,_0x3c83ac));});}else{_0x2e9e87['outboundBlacklistCallsDay']+=0x1;ut[_0x1b57('0x10a')](_0xa27e1c);rpcDb['createHistory'](_0xa27e1c,_0x1b57('0x10b'));delete _0xfd5632[_0x1b57('0x16')][_0x10624c];_0x4a9352(ut['message'](_0x1b57('0x10c'),_0x2345be,_0x3c83ac));}});};Preview[_0x1b57('0xf')]['isTrunkReachable']=function(_0x1c9f5c){return!_[_0x1b57('0x6e')](_0x1c9f5c)&&!_[_0x1b57('0x6e')](_0x1c9f5c['name'])&&!_[_0x1b57('0x6e')](_0x1c9f5c[_0x1b57('0x58')])&&_0x1c9f5c[_0x1b57('0x58')]&&!_[_0x1b57('0x6e')](this[_0x1b57('0x15')][util[_0x1b57('0x5c')](_0x1b57('0x10d'),_0x1c9f5c[_0x1b57('0x28')])])&&!_[_0x1b57('0x6e')](this['trunks'][util[_0x1b57('0x5c')](_0x1b57('0x10d'),_0x1c9f5c[_0x1b57('0x28')])]['status'])&&(this[_0x1b57('0x15')][util[_0x1b57('0x5c')](_0x1b57('0x10d'),_0x1c9f5c[_0x1b57('0x28')])]['status']===_0x1b57('0x10e')||this[_0x1b57('0x15')][util[_0x1b57('0x5c')](_0x1b57('0x10d'),_0x1c9f5c[_0x1b57('0x28')])][_0x1b57('0x7b')]===_0x1b57('0x10f'));};Preview[_0x1b57('0xf')]['run']=function(_0x5f3759,_0x45785f){var _0x17b28a=this;return new BPromise(function(_0x375cc7,_0x36d0f9){_0x17b28a[_0x1b57('0x110')](_0x5f3759,_0x45785f)['then'](function(_0x2d3088){_0x375cc7(_['pick'](_0x2d3088,[_0x1b57('0x50')]));})[_0x1b57('0x7d')](function(_0x1aa194){if(_0x1aa194[_0x1b57('0x111')]){rpcDb[_0x1b57('0x112')](_0x5f3759);}if(_0x1aa194[_0x1b57('0x58')]){rpcDb['disableContact'](_0x5f3759);}_0x36d0f9(_['pick'](_0x1aa194,['message']));});});};Preview['prototype'][_0x1b57('0x110')]=function(_0x4ceed0,_0x36e594){var _0x164d36=this;return new BPromise(function(_0x23b196,_0x28e3da){var _0x5a4120,_0x3ef5c9;rpcDb[_0x1b57('0x113')](_0x4ceed0)[_0x1b57('0x89')](function(_0x3ecbc1){if(!_[_0x1b57('0x6e')](_0x3ecbc1[0x0])){_0x3ef5c9=_0x3ecbc1[0x0]['recallme']?![]:!![];_0x5a4120=_0x3ecbc1[0x0]['recallme']?!![]:![];_0x5a4120=_0x36e594?!![]:_0x5a4120;}var _0x43faa1=_0x164d36['validateContact'](_0x3ecbc1);if(_0x43faa1[_0x1b57('0x114')]){rpcDb[_0x1b57('0x115')](_[_0x1b57('0x75')](_0x3ecbc1[0x0],[_0x1b57('0x78'),'Contact.phone']))[_0x1b57('0x89')](function(_0x191b80){_0x164d36[_0x1b57('0xfb')](_0x191b80,_0x3ecbc1[0x0],_0x36e594,_0x3ef5c9,_0x5a4120)[_0x1b57('0x89')](function(_0x460333){_0x23b196(_0x460333);})[_0x1b57('0x7d')](function(_0x299069){_0x28e3da(_0x299069);});})[_0x1b57('0x7d')](function(_0x50093f){ut[_0x1b57('0x64')](_0x1b57('0x116'),_0x50093f);_0x28e3da(ut[_0x1b57('0x50')](_0x1b57('0x117'),_0x3ef5c9,_0x5a4120));});}else{_0x28e3da(ut['message'](_0x43faa1[_0x1b57('0x50')],_0x3ef5c9,_0x5a4120));}})['catch'](function(_0x4f2b70){ut[_0x1b57('0x64')](_0x1b57('0x118'),_0x4f2b70);_0x28e3da(ut[_0x1b57('0x50')](_0x1b57('0x117'),![],!![]));});});};Preview[_0x1b57('0xf')][_0x1b57('0x119')]=function(_0x1a29c5){if(_[_0x1b57('0x6e')](_0x1a29c5)||_['isEmpty'](_0x1a29c5)||!_[_0x1b57('0x6e')](_0x1a29c5[0x0][_0x1b57('0x8d')])&&_['isNil'](_0x1a29c5[0x0][_0x1b57('0x8d')]['name'])){ut[_0x1b57('0x64')](_0x1b57('0x11a'),_0x1a29c5);return{'isValid':![],'message':_0x1b57('0x11b')};}var _0x9f9423=this[_0x1b57('0x13')][_0x1a29c5[0x0][_0x1b57('0x70')][_0x1b57('0x28')]];_0x9f9423[_0x1b57('0x50')]=_0x1b57('0xa2');if(_[_0x1b57('0x6e')](_0x9f9423)){ut[_0x1b57('0x64')](_0x1b57('0x11c'),_0x9f9423);return{'isValid':![],'message':_0x1b57('0x11d')};}if(!this['isTrunkReachable'](_0x9f9423[_0x1b57('0x57')])){ut[_0x1b57('0x64')](_0x1b57('0x11e'),_0x1b57('0x11f')+_0x9f9423[_0x1b57('0x28')]+'\x20Trunk\x20is\x20not\x20active');if(!this['isTrunkReachable'](_0x9f9423[_0x1b57('0xa0')])){ut['logger'](_0x1b57('0x11e'),_0x9f9423[_0x1b57('0x28')]+_0x1b57('0x120'));return{'isValid':![],'message':_0x1b57('0x121')};}}if(!ut[_0x1b57('0x9f')](_0x9f9423['dialActive'])){ut['logger']('[Preview][validateContact][Campaign\x20Active]',_0x9f9423['name']+'\x20Not\x20Active');return{'isValid':![],'message':_0x1b57('0x11f')+_0x9f9423[_0x1b57('0x28')]+_0x1b57('0x122')};}return{'isValid':!![],'message':_0x1b57('0x123')};};Preview[_0x1b57('0xf')][_0x1b57('0x100')]=function(_0x33f636,_0x566fc5,_0x2fc6dd,_0x507909){var _0x2b23c5=this;return new BPromise(function(_0x3a2ee6,_0xd7d78b){var _0x50ebdf=_0x33f636[_0x1b57('0xb8')];var _0x1b35ac=_0x2b23c5['isTrunkReachable'](_0x566fc5[_0x1b57('0x57')])?util[_0x1b57('0x5c')](_0x1b57('0x124'),_0x566fc5[_0x1b57('0x57')][_0x1b57('0x28')],_[_0x1b57('0x6e')](_0x566fc5[_0x1b57('0x39')])?'':_0x566fc5[_0x1b57('0x39')][_0x1b57('0x125')]()||'',_0x566fc5['dialCutDigit']>0x0?_0x2fc6dd['Contact']['phone'][_0x1b57('0x126')](_0x566fc5['dialCutDigit']):_0x2fc6dd[_0x1b57('0xfc')]['phone']):util[_0x1b57('0x5c')](_0x1b57('0x124'),_['isNil'](_0x566fc5[_0x1b57('0xa0')])?_0x566fc5[_0x1b57('0x57')][_0x1b57('0x28')]:_0x566fc5['TrunkBackup'][_0x1b57('0x28')],_[_0x1b57('0x6e')](_0x566fc5[_0x1b57('0x39')])?'':_0x566fc5[_0x1b57('0x39')][_0x1b57('0x125')]()||'',_0x566fc5[_0x1b57('0x127')]>0x0?_0x2fc6dd['Contact'][_0x1b57('0xfd')][_0x1b57('0x126')](_0x566fc5['dialCutDigit']):_0x2fc6dd[_0x1b57('0xfc')][_0x1b57('0xfd')]);var _0x11e4ab=_0x2b23c5[_0x1b57('0x128')](_0x566fc5[_0x1b57('0x57')])?ut[_0x1b57('0x129')](_0x566fc5[_0x1b57('0x57')][_0x1b57('0x59')],_0x566fc5[_0x1b57('0x37')],_0x566fc5['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x1b57('0x12a')](_0x566fc5[_0x1b57('0x38')],_0x566fc5[_0x1b57('0x12b')]):_0x566fc5[_0x1b57('0x38')]):ut[_0x1b57('0x129')](_[_0x1b57('0x6e')](_0x566fc5[_0x1b57('0xa0')])?_0x566fc5[_0x1b57('0x57')][_0x1b57('0x59')]:_0x566fc5['TrunkBackup'][_0x1b57('0x59')],_0x566fc5['dialOriginateCallerIdName'],_0x566fc5[_0x1b57('0x12b')]>0x0?ut[_0x1b57('0x12a')](_0x566fc5['dialOriginateCallerIdNumber'],_0x566fc5['dialRandomLastDigitCallerIdNumber']):_0x566fc5['dialOriginateCallerIdNumber']);if(_0x11e4ab){_0x33f636['originatecalleridname']=ut[_0x1b57('0x12c')](_0x11e4ab);_0x33f636[_0x1b57('0x12d')]=ut[_0x1b57('0x12e')](_0x11e4ab);}var _0x512ca9=ut[_0x1b57('0x12f')](_0x566fc5,_0x2fc6dd,_0x1b35ac,_0x11e4ab,_0x50ebdf,_0x33f636);_[_0x1b57('0x130')](_0x33f636,ut[_0x1b57('0x131')](_0x512ca9));_0x33f636[_0x1b57('0x93')]=moment()[_0x1b57('0x5c')](_0x1b57('0x94'));ami['Action'](ut['variablesAction'](_0x33f636,_0x566fc5,_0x512ca9,_0x33f636['activeContact'],_0x507909))[_0x1b57('0x89')](function(_0x47481c){_0x566fc5[_0x1b57('0x51')]+=0x1;logger[_0x1b57('0x5e')](_0x1b57('0x132'),_0x50ebdf,'\x20Queue',_0x566fc5[_0x1b57('0x28')],'originated:\x20',_0x566fc5[_0x1b57('0x51')]);_0x3a2ee6(_0x47481c);})[_0x1b57('0x7d')](function(_0x4dfe5e){ut[_0x1b57('0xf5')](_0x33f636,0xe,_0x1b57('0x133'));rpcDb[_0x1b57('0xf4')](_0x33f636,_0x1b57('0x134'));_0xd7d78b(_0x4dfe5e);});});};Preview['prototype'][_0x1b57('0x1f')]=function(_0x17c2a7){if(this['actions'][_0x17c2a7['linkedid']]){this['actions'][_0x17c2a7['linkedid']][_0x1b57('0x7c')]=_0x17c2a7[_0x1b57('0x7c')];}};Preview[_0x1b57('0xf')][_0x1b57('0x1a')]=function(_0x1a8b7b){var _0x790954=this;var _0x155dc9=this[_0x1b57('0x16')][_0x1a8b7b['actionid']];if(_0x155dc9){if(_0x155dc9[_0x1b57('0xff')]&&this[_0x1b57('0x17')][_0x155dc9[_0x1b57('0xff')]]){ut[_0x1b57('0x135')](_0x155dc9,this[_0x1b57('0x17')][_0x155dc9['lookAgent']][_0x1b57('0x28')],this['agents'][_0x155dc9['lookAgent']]['id']);}var _0xb9aba5=_[_0x1b57('0x136')](_0x155dc9);_0xb9aba5['responsetime']=moment()[_0x1b57('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');var _0x4b3584=_0x790954[_0x1b57('0x13')][_0x155dc9[_0x1b57('0x71')]];if(ut[_0x1b57('0x137')](_0x1a8b7b['response'])){if(_0x155dc9[_0x1b57('0xb2')]){rpcDb[_0x1b57('0x112')](_0x155dc9[_0x1b57('0x104')]);}if(_0x155dc9[_0x1b57('0xb3')]){rpcDb[_0x1b57('0x92')](_0x155dc9[_0x1b57('0x104')]);}ami[_0x1b57('0x26')](_0x1b57('0x138'),ut[_0x1b57('0xa9')](_0x155dc9,_0x1b57('0x139')));this[_0x1b57('0xf0')](_0xb9aba5,_0x4b3584,_0x1a8b7b);}else{_0x155dc9[_0x1b57('0x93')]=moment()[_0x1b57('0x5c')](_0x1b57('0x94'));ut[_0x1b57('0xf5')](_0xb9aba5,0x4,_0x1b57('0x13a'));rpcDb[_0x1b57('0xf4')](_0xb9aba5,_0x1b57('0x13b'));}}};Preview['prototype'][_0x1b57('0x13c')]=function(_0xee1c42){var _0x236a70=this;var _0x65888f=this['actions'][_0xee1c42[_0x1b57('0xc4')]];var _0xe77999;if(_0x65888f){_0xe77999=this[_0x1b57('0x13')][_0x65888f['queue']];logger[_0x1b57('0x5e')](_0x1b57('0x13d'),_0xee1c42[_0x1b57('0xc4')],_0x1b57('0xb9'),_0xe77999[_0x1b57('0x28')],_0x1b57('0x73'),_0xe77999[_0x1b57('0x2b')]);}if(this['actions'][_0xee1c42[_0x1b57('0xc4')]]&&_0xee1c42[_0x1b57('0xc4')]!==_0xee1c42['uniqueid']){if(_0xee1c42[_0x1b57('0x13e')]==='16'&&this[_0x1b57('0x16')][_0xee1c42[_0x1b57('0xc4')]][_0x1b57('0x74')]){this[_0x1b57('0xa3')](_0xee1c42,_0xee1c42[_0x1b57('0xc4')],_0xee1c42[_0x1b57('0x13e')]);}else if(this[_0x1b57('0x16')][_0xee1c42[_0x1b57('0xc4')]][_0x1b57('0x74')]){logger[_0x1b57('0x5e')](_0x1b57('0x13f'),_0xee1c42[_0x1b57('0xc4')],_0xee1c42['cause'],_0x1b57('0xb9'),_0xe77999['name'],_0x1b57('0x73'),_0xe77999[_0x1b57('0x2b')]);this[_0x1b57('0xa3')](_0xee1c42,_0xee1c42[_0x1b57('0xc4')],_0xee1c42[_0x1b57('0x13e')]);}}else if(_0x65888f&&_['isNil'](_0x65888f[_0x1b57('0x140')])&&_0xe77999['dialQueueProject']&&_0xee1c42['linkedid']===_0xee1c42['uniqueid']&&_[_0x1b57('0x6e')](_0xee1c42['reason'])&&_0xee1c42['cause']==='16'&&_0xee1c42[_0x1b57('0x141')]==='6'&&_['isUndefined'](_0x65888f['transfer'])){if(_0x65888f[_0x1b57('0xb2')]){rpcDb['unlockContact'](_0x65888f[_0x1b57('0x104')]);}if(_0x65888f[_0x1b57('0xb3')]){rpcDb[_0x1b57('0x92')](_0x65888f['idContact']);}_0xee1c42[_0x1b57('0xf3')]='22';this[_0x1b57('0xf0')](_0x65888f,_0xe77999,_0xee1c42);}else if(_0x65888f&&_0x65888f[_0x1b57('0x142')]){if(_0xee1c42[_0x1b57('0x13e')]==='16'&&this[_0x1b57('0x16')][_0xee1c42[_0x1b57('0xc4')]][_0x1b57('0x74')]){logger[_0x1b57('0x5e')](_0x1b57('0x143'),_0xee1c42[_0x1b57('0xc4')],_0xee1c42['cause'],_0x1b57('0xb9'),_0xe77999[_0x1b57('0x28')],_0x1b57('0x73'),_0xe77999['pTalking']);this[_0x1b57('0xa3')](_0xee1c42,_0xee1c42[_0x1b57('0xc4')],_0xee1c42[_0x1b57('0x13e')]);}else if(this[_0x1b57('0x16')][_0xee1c42[_0x1b57('0xc4')]][_0x1b57('0x74')]){logger['info']('[syncHangup][talking][cause]',_0xee1c42[_0x1b57('0xc4')],_0xee1c42[_0x1b57('0x13e')],_0x1b57('0xb9'),_0xe77999['name'],'pTalking:\x20',_0xe77999[_0x1b57('0x2b')]);this[_0x1b57('0xa3')](_0xee1c42,_0xee1c42[_0x1b57('0xc4')],_0xee1c42[_0x1b57('0x13e')]);}}};Preview[_0x1b57('0xf')][_0x1b57('0x144')]=function(_0x1a806d){if(this[_0x1b57('0x16')][_0x1a806d[_0x1b57('0xef')]]&&_0x1a806d[_0x1b57('0xef')]!==_0x1a806d[_0x1b57('0x145')]){this[_0x1b57('0xa3')](_0x1a806d,_0x1a806d[_0x1b57('0xef')],_0x1a806d[_0x1b57('0xeb')]);}};Preview[_0x1b57('0xf')][_0x1b57('0x146')]=function(_0x25b469){if(this[_0x1b57('0x16')][_0x25b469[_0x1b57('0xc4')]]&&_0x25b469['linkedid']!==_0x25b469[_0x1b57('0xb8')]&&!this[_0x1b57('0x16')][_0x25b469[_0x1b57('0xc4')]][_0x1b57('0x74')]){if(_0x25b469[_0x1b57('0x13e')]==='1'){this[_0x1b57('0xa3')](_0x25b469,_0x25b469['linkedid'],_0x25b469[_0x1b57('0x13e')]);}}};Preview[_0x1b57('0xf')][_0x1b57('0x147')]=function(_0x5d9f33,_0x1f7424,_0x281417){if(this['actions'][_0x5d9f33]){if(_[_0x1b57('0x6e')](this[_0x1b57('0x16')][_0x5d9f33][_0x1b57('0x148')])){this[_0x1b57('0x16')][_0x5d9f33][_0x1b57('0x148')]={};}this[_0x1b57('0x16')][_0x5d9f33][_0x1b57('0x148')][_0x1f7424]=_0x281417;}};Preview[_0x1b57('0xf')]['syncVarSet']=function(_0x2a59b9){try{if(!_[_0x1b57('0x6e')](_0x2a59b9)){if(ut[_0x1b57('0x149')](_[_0x1b57('0x14a')](_0x2a59b9[_0x1b57('0x14b')])[0x0])){this[_0x1b57('0x147')](_0x2a59b9[_0x1b57('0xb8')],_[_0x1b57('0x14a')](_0x2a59b9['variable'])[0x0],_0x2a59b9[_0x1b57('0x14c')]);}}}catch(_0x4c75f1){logger['error']('[syncVarSet][Preview]',util[_0x1b57('0x14d')](_0x4c75f1,{'showHidden':![],'depth':null}));}};Preview[_0x1b57('0xf')][_0x1b57('0x22')]=function(_0x1cad7a){if(_0x1cad7a){if(this[_0x1b57('0x16')][_0x1cad7a['transfertargetlinkedid']]){this[_0x1b57('0x16')][_0x1cad7a[_0x1b57('0x14e')]][_0x1b57('0x142')]=!![];}}};Preview[_0x1b57('0xf')]['syncBlindTransfer']=function(_0x4237ff){if(_0x4237ff){if(this[_0x1b57('0x16')][_0x4237ff[_0x1b57('0x14f')]]){this[_0x1b57('0x16')][_0x4237ff['transfererlinkedid']][_0x1b57('0x142')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index cc80046..e0ca026 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 _0xee14=['uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','[createHistory]\x20','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','disableContact','unlockContact','[activeContact]\x20','type'];(function(_0x28ddf9,_0x5ddce7){var _0x5d9d16=function(_0x2553d4){while(--_0x2553d4){_0x28ddf9['push'](_0x28ddf9['shift']());}};_0x5d9d16(++_0x5ddce7);}(_0xee14,0x13a));var _0x4ee1=function(_0x35566f,_0x2131f5){_0x35566f=_0x35566f-0x0;var _0x2cd13a=_0xee14[_0x35566f];return _0x2cd13a;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x4ee1('0x0'))(_0x4ee1('0x1'));var _=require(_0x4ee1('0x2'));var cmHopper=require(_0x4ee1('0x3'));var cmHopperFinal=require(_0x4ee1('0x4'));var cmHopperHistory=require(_0x4ee1('0x5'));var cmHopperBlack=require(_0x4ee1('0x6'));var voiceQueueRt=require(_0x4ee1('0x7'));var agentReportPreview=require(_0x4ee1('0x8'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0xba6d36){return function(_0x573700){logger[_0x4ee1('0x9')](_0xba6d36,util[_0x4ee1('0xa')](_0x573700,{'showHidden':![],'depth':null}));};}function create(_0x187656){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopperHistory[_0x4ee1('0xd')](_0x187656))['catch'](loggerCatch(_0x4ee1('0xe')));}function createAgent(_0x38be25){return BPromise['resolve']()[_0x4ee1('0xc')](agentReportPreview[_0x4ee1('0xd')](_0x38be25))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0xe')));}function moveContact(_0x5cbcb0){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper[_0x4ee1('0x10')](_0x5cbcb0,!![]))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x11')));}exports[_0x4ee1('0x12')]=function(_0x5616d6){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopperBlack[_0x4ee1('0x12')](_0x5616d6))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x13')));};exports[_0x4ee1('0x14')]=function(_0x2ffb2d){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper['getContactPreview'](_0x2ffb2d))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x15')));};exports[_0x4ee1('0xd')]=function(_0x1b1e0e,_0x123c5e){create(_0x1b1e0e)[_0x4ee1('0xf')](loggerCatch(_0x123c5e));moveContact(_0x1b1e0e)[_0x4ee1('0xf')](loggerCatch(_0x123c5e));};exports[_0x4ee1('0x16')]=function(_0x360056,_0x3a0967){createAgent(_0x360056)[_0x4ee1('0xf')](loggerCatch(_0x3a0967));};exports['createCustomerHistory']=function(_0x236215,_0x3db827){create(_0x236215)[_0x4ee1('0xf')](loggerCatch(_0x3db827));};exports[_0x4ee1('0x17')]=function(_0x43f9a2,_0x383ab0){moveContact(_0x43f9a2)['catch'](loggerCatch(_0x383ab0));};exports[_0x4ee1('0x18')]=function(_0x333e96,_0x46611a,_0x3f0d59){if(_0x46611a){_0x333e96[_0x4ee1('0x19')]=null;}if(_0x3f0d59){_0x333e96[_0x4ee1('0x1a')]=![];}return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper[_0x4ee1('0x18')](_0x333e96))[_0x4ee1('0xf')](loggerCatch('[rescheduleContact]\x20'));};exports['countReScheduled']=function(_0x14110c){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper[_0x4ee1('0x1b')](_0x14110c))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x1c')));};exports['unlockContact']=function(_0x5cc0b5){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper['unlockContact']({'UserId':null},_0x5cc0b5,0x1))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x1d')));};exports[_0x4ee1('0x1e')]=function(_0x215949){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper[_0x4ee1('0x1f')]({'active':![]},_0x215949,0x1))['catch'](loggerCatch(_0x4ee1('0x20')));};exports['crateCustomerReportQueue']=function(_0x4746c2){var _0x4ec408={};_0x4ec408[_0x4ee1('0x21')]=_0x4746c2[_0x4ee1('0x21')];_0x4ec408[_0x4ee1('0x22')]=_0x4746c2[_0x4ee1('0x22')];_0x4ec408[_0x4ee1('0x23')]=_0x4746c2['calleridnum'];_0x4ec408[_0x4ee1('0x24')]=_0x4746c2['calleridname'];_0x4ec408[_0x4ee1('0x25')]=_0x4746c2[_0x4ee1('0x25')];_0x4ec408[_0x4ee1('0x26')]=_0x4746c2[_0x4ee1('0x27')];_0x4ec408[_0x4ee1('0x28')]=_0x4746c2['answertime'];_0x4ec408[_0x4ee1('0x29')]=0x1;_0x4ec408[_0x4ee1('0x2a')]=_0x4746c2[_0x4ee1('0x2b')];_0x4ec408[_0x4ee1('0x2c')]=_0x4746c2[_0x4ee1('0x2d')];_0x4ec408[_0x4ee1('0x2e')]='from-sip';_0x4ec408['exten']=_0x4ee1('0x2f');_0x4ec408[_0x4ee1('0x30')]=0x0;_0x4ec408[_0x4ee1('0x31')]=0x1;_0x4ec408['lastAssignedTo']=_0x4746c2[_0x4ee1('0x2d')];_0x4ec408[_0x4ee1('0x32')]=_0x4ee1('0x33');return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](voiceQueueReport[_0x4ee1('0x34')](_0x4ec408))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x35')));};exports[_0x4ee1('0x36')]=function(_0x3cc595,_0x4445d0){return BPromise[_0x4ee1('0xb')]()[_0x4ee1('0xc')](cmHopper['getContactRecallMe'](_0x3cc595,_0x4445d0))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x37')));};exports[_0x4ee1('0x38')]=function(_0x50539f){return BPromise['resolve']()[_0x4ee1('0xc')](cmHopper[_0x4ee1('0x18')](_0x50539f,!![],!![]))[_0x4ee1('0xf')](loggerCatch(_0x4ee1('0x39')));}; \ No newline at end of file +var _0x8d0e=['../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','type','uniqueid','calleridnum','queue','queuecallerjoinAt','answertime','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','queuecallerexitreason','create','[voiceQueueReport]\x20','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper'];(function(_0x1f5f0d,_0x1d5da6){var _0x407342=function(_0x46f487){while(--_0x46f487){_0x1f5f0d['push'](_0x1f5f0d['shift']());}};_0x407342(++_0x1d5da6);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x2470c4,_0x1c267b){_0x2470c4=_0x2470c4-0x0;var _0x2f814d=_0x8d0e[_0x2470c4];return _0x2f814d;};'use strict';var util=require(_0xe8d0('0x0'));var BPromise=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var _=require(_0xe8d0('0x4'));var cmHopper=require(_0xe8d0('0x5'));var cmHopperFinal=require(_0xe8d0('0x6'));var cmHopperHistory=require(_0xe8d0('0x7'));var cmHopperBlack=require(_0xe8d0('0x8'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xe8d0('0x9'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x560dab){return function(_0x2e2985){logger[_0xe8d0('0xa')](_0x560dab,util[_0xe8d0('0xb')](_0x2e2985,{'showHidden':![],'depth':null}));};}function create(_0xcc03d0){return BPromise[_0xe8d0('0xc')]()[_0xe8d0('0xd')](cmHopperHistory[_0xe8d0('0xe')](_0xcc03d0))[_0xe8d0('0xf')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x10e56c){return BPromise[_0xe8d0('0xc')]()[_0xe8d0('0xd')](agentReportPreview['createHistory'](_0x10e56c))['catch'](loggerCatch(_0xe8d0('0x10')));}function moveContact(_0x25e6b8){return BPromise[_0xe8d0('0xc')]()[_0xe8d0('0xd')](cmHopper[_0xe8d0('0x11')](_0x25e6b8,!![]))[_0xe8d0('0xf')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xe8d0('0x12')]=function(_0x15b9e5){return BPromise['resolve']()[_0xe8d0('0xd')](cmHopperBlack['checkIsBlackList'](_0x15b9e5))['catch'](loggerCatch(_0xe8d0('0x13')));};exports[_0xe8d0('0x14')]=function(_0x1aa725){return BPromise[_0xe8d0('0xc')]()[_0xe8d0('0xd')](cmHopper[_0xe8d0('0x14')](_0x1aa725))['catch'](loggerCatch(_0xe8d0('0x15')));};exports['createHistory']=function(_0x6d932b,_0x3c526c){create(_0x6d932b)[_0xe8d0('0xf')](loggerCatch(_0x3c526c));moveContact(_0x6d932b)['catch'](loggerCatch(_0x3c526c));};exports['createAgentHistory']=function(_0x47c67a,_0x1bdd94){createAgent(_0x47c67a)[_0xe8d0('0xf')](loggerCatch(_0x1bdd94));};exports[_0xe8d0('0x16')]=function(_0x44bbe4,_0x83177b){create(_0x44bbe4)['catch'](loggerCatch(_0x83177b));};exports[_0xe8d0('0x17')]=function(_0x12ebf4,_0x524b00){moveContact(_0x12ebf4)['catch'](loggerCatch(_0x524b00));};exports['rescheduleContact']=function(_0x384a60,_0x35d131,_0x25363b){if(_0x35d131){_0x384a60[_0xe8d0('0x18')]=null;}if(_0x25363b){_0x384a60[_0xe8d0('0x19')]=![];}return BPromise[_0xe8d0('0xc')]()[_0xe8d0('0xd')](cmHopper[_0xe8d0('0x1a')](_0x384a60))[_0xe8d0('0xf')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xe8d0('0x1b')]=function(_0x9f747){return BPromise['resolve']()[_0xe8d0('0xd')](cmHopper[_0xe8d0('0x1b')](_0x9f747))[_0xe8d0('0xf')](loggerCatch(_0xe8d0('0x1c')));};exports[_0xe8d0('0x1d')]=function(_0x149dfd){return BPromise[_0xe8d0('0xc')]()[_0xe8d0('0xd')](cmHopper[_0xe8d0('0x1d')]({'UserId':null},_0x149dfd,0x1))[_0xe8d0('0xf')](loggerCatch(_0xe8d0('0x1e')));};exports['disableContact']=function(_0x24982c){return BPromise[_0xe8d0('0xc')]()[_0xe8d0('0xd')](cmHopper['unlockContact']({'active':![]},_0x24982c,0x1))[_0xe8d0('0xf')](loggerCatch(_0xe8d0('0x1f')));};exports['crateCustomerReportQueue']=function(_0x1519e2){var _0x3ffcb7={};_0x3ffcb7[_0xe8d0('0x20')]=_0x1519e2[_0xe8d0('0x20')];_0x3ffcb7[_0xe8d0('0x21')]=_0x1519e2['uniqueid'];_0x3ffcb7[_0xe8d0('0x22')]=_0x1519e2['calleridnum'];_0x3ffcb7['calleridname']=_0x1519e2['calleridname'];_0x3ffcb7[_0xe8d0('0x23')]=_0x1519e2[_0xe8d0('0x23')];_0x3ffcb7[_0xe8d0('0x24')]=_0x1519e2['answertime'];_0x3ffcb7['queuecallerleaveAt']=_0x1519e2[_0xe8d0('0x25')];_0x3ffcb7['queuecallercomplete']=0x1;_0x3ffcb7[_0xe8d0('0x26')]=_0x1519e2[_0xe8d0('0x27')];_0x3ffcb7[_0xe8d0('0x28')]=_0x1519e2[_0xe8d0('0x29')];_0x3ffcb7[_0xe8d0('0x2a')]='from-sip';_0x3ffcb7[_0xe8d0('0x2b')]=_0xe8d0('0x2c');_0x3ffcb7[_0xe8d0('0x2d')]=0x0;_0x3ffcb7[_0xe8d0('0x2e')]=0x1;_0x3ffcb7['lastAssignedTo']=_0x1519e2[_0xe8d0('0x29')];_0x3ffcb7[_0xe8d0('0x2f')]='COMPLETED';return BPromise[_0xe8d0('0xc')]()['then'](voiceQueueReport[_0xe8d0('0x30')](_0x3ffcb7))['catch'](loggerCatch(_0xe8d0('0x31')));};exports['getContactRecallMe']=function(_0x3a0f03,_0xb2cdbf){return BPromise[_0xe8d0('0xc')]()[_0xe8d0('0xd')](cmHopper['getContactRecallMe'](_0x3a0f03,_0xb2cdbf))[_0xe8d0('0xf')](loggerCatch(_0xe8d0('0x32')));};exports[_0xe8d0('0x33')]=function(_0x516243){return BPromise[_0xe8d0('0xc')]()[_0xe8d0('0xd')](cmHopper[_0xe8d0('0x1a')](_0x516243,!![],!![]))[_0xe8d0('0xf')](loggerCatch(_0xe8d0('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 38da978..a95f564 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 _0x6d4b=['active','scheduledat','add','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','name','queue','interface','channelAgent','buildAcw','agentReadyId','not_inuse','status','push','createBody','CampaignId','filterKey','idContact','type','countglobal','callback','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','extractCalleridNumber','match','util','lodash','moment','preview','env','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','logger2','message','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','Queue','calleridnum','ContactId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','XMD-','toUpper','toLowerVariables','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','starttime','talktime','isFailure','Failure','variablesAction','calleridname','BOOKED','uniqueid','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6d4b,0xbf));var _0xb6d4=function(_0x14eaf9,_0x5c0101){_0x14eaf9=_0x14eaf9-0x0;var _0x3b26e5=_0x6d4b[_0x14eaf9];return _0x3b26e5;};'use strict';var util=require(_0xb6d4('0x0'));var _=require(_0xb6d4('0x1'));var moment=require(_0xb6d4('0x2'));var logger=require('../../../../config/logger')(_0xb6d4('0x3'));var ipAgi=process[_0xb6d4('0x4')]['XCALLY_IP_AGI']||'127.0.0.1';function getSeconds(_0xe3f0b3,_0x13bcce){var _0x2710b2=moment(_0xe3f0b3)[_0xb6d4('0x5')](0x0);var _0x1e9c41=moment(_0x13bcce)[_0xb6d4('0x5')](0x0);return _0x2710b2[_0xb6d4('0x6')](_0x1e9c41,_0xb6d4('0x7'));}exports['loggerCatch']=function(_0x36d85f){return function(_0xe82b85){logger[_0xb6d4('0x8')](_0x36d85f,util[_0xb6d4('0x9')](_0xe82b85,{'showHidden':![],'depth':null}));};};exports[_0xb6d4('0xa')]=function(_0x1d54fb,_0x3f7d10){logger[_0xb6d4('0xb')](_0x1d54fb,util[_0xb6d4('0x9')](_0x3f7d10,{'showHidden':![],'depth':null}));};exports[_0xb6d4('0xc')]=function(_0x56bdae,_0x4c8bb2){logger['error'](_0x56bdae,util['inspect'](_0x4c8bb2,{'showHidden':![],'depth':null}));};exports[_0xb6d4('0xd')]=function(_0x5c6f06){return function(_0x900d20){logger[_0xb6d4('0xb')](_0x5c6f06,util[_0xb6d4('0x9')](_0x900d20,{'showHidden':![],'depth':null}));};};exports[_0xb6d4('0xe')]=function(_0x573c97,_0xe8d726,_0x2c3af8){return{'message':_0x573c97,'unlock':_0xe8d726,'active':_0x2c3af8};};exports['getCallerId']=function(_0xbad248,_0x4aae9b,_0x4585ee){if(!_[_0xb6d4('0xf')](_0x4585ee)&&_0xb6d4('0x10')===typeof _0x4585ee&&!_[_0xb6d4('0x11')](_0x4585ee)){if(!_[_0xb6d4('0xf')](_0x4aae9b)&&_0xb6d4('0x10')===typeof _0x4aae9b&&!_[_0xb6d4('0x11')](_0x4aae9b)){return util['format'](_0xb6d4('0x12'),_0x4aae9b,_0x4585ee);}return util[_0xb6d4('0x13')](_0xb6d4('0x12'),_0x4585ee,_0x4585ee);}if(!_[_0xb6d4('0xf')](_0xbad248)&&_0xb6d4('0x10')===typeof _0xbad248&&!_[_0xb6d4('0x11')](_0xbad248)){return _0xbad248;}return _0xb6d4('0x14');};exports[_0xb6d4('0x15')]=function(_0x1024c9){if(_['isNil'](_0x1024c9)){return![];}return _0x1024c9;};exports['addVariables']=function(_0x37595f,_0x1e1e0b,_0x122563,_0x3d3cd6,_0x4e034e,_0x5a719e){var _0x145157={'XMD-QUEUE':_0x1e1e0b[_0xb6d4('0x16')]?_0x1e1e0b[_0xb6d4('0x16')]['name']:'','XMD-CALLERID':_0x3d3cd6,'XMD-CALLERID-PREVIEW':_0x5a719e?util[_0xb6d4('0x13')]('\x22%s\x22\x20<%s>',_0x5a719e['calleridname'],_0x5a719e[_0xb6d4('0x17')]):_0x3d3cd6,'XMD-DIALID':_0x4e034e,'XMD-CONTACTID':_0x1e1e0b[_0xb6d4('0x18')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x3d3cd6,'XMD-VOICEQUEUEID':_0x1e1e0b['VoiceQueueId'],'XMD-DIALCHANNEL':_0x122563,'XMD-DIALTIMEOUT':_0x37595f[_0xb6d4('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0xb6d4('0x13')](_0xb6d4('0x1a'),_0x37595f[_0xb6d4('0x1b')]?'g':'',_[_0xb6d4('0x11')](_0x37595f[_0xb6d4('0x1c')])?'':_0xb6d4('0x1d')),'XMD-DIALURL':_0x37595f[_0xb6d4('0x1e')]||'','XMD-AGI':_0x37595f[_0xb6d4('0x1f')]?util[_0xb6d4('0x13')](_0xb6d4('0x20'),ipAgi,_0x37595f[_0xb6d4('0x1f')]):'NONE','XMD-AGIAFTER':_0x37595f[_0xb6d4('0x1b')]?util[_0xb6d4('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x37595f[_0xb6d4('0x1b')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x5a719e?_0x5a719e[_0xb6d4('0x21')]:'','XMD-ORIGINATECALLERIDNAME':_0x5a719e?_0x5a719e[_0xb6d4('0x22')]:'','XMD-DESTINATION':_0xb6d4('0x23')};if(!_[_0xb6d4('0x11')](_0x37595f[_0xb6d4('0x1c')])){_0x145157[util[_0xb6d4('0x13')]('%s',_0xb6d4('0x24'))]=_0x37595f[_0xb6d4('0x1c')];_0x145157[util['format']('%s',_0xb6d4('0x25'))]=_0x4e034e;}if(_0x1e1e0b&&_0x1e1e0b[_0xb6d4('0x26')]){for(var _0x112d10 in _0x1e1e0b['Contact']){if(_0x1e1e0b[_0xb6d4('0x26')][_0xb6d4('0x27')](_0x112d10)){if(!_['isNil'](_0x1e1e0b[_0xb6d4('0x26')][_0x112d10])&&_0x112d10!=='id'&&_0x112d10!==_0xb6d4('0x28')&&_0x112d10!==_0xb6d4('0x29')&&_0x112d10!=='updatedAt'){_0x145157[util['format']('%s%s',_0xb6d4('0x2a'),_[_0xb6d4('0x2b')](_0x112d10))]=_0x1e1e0b[_0xb6d4('0x26')][_0x112d10];}}}}return _0x145157;};exports[_0xb6d4('0x2c')]=function(_0x1a5a65){var _0x7e9693={};for(var _0x52638f in _0x1a5a65){if(_0x1a5a65['hasOwnProperty'](_0x52638f)){_0x7e9693[util[_0xb6d4('0x13')]('%s',_['toLower'](_0x52638f))]=_0x1a5a65[_0x52638f];}}return{'variables':_0x7e9693};};exports['updateOriginated']=function(_0x4a4572,_0x5b7771){if(!_[_0xb6d4('0x2d')](_0x4a4572)){if(_0x4a4572[_0xb6d4('0x27')]('originated')){if(_0x4a4572[_0xb6d4('0x2e')]>0x0){_0x4a4572['originated']-=0x1;}else{logger[_0xb6d4('0x8')](_0xb6d4('0x2f'),_0x5b7771);}}}else{logger[_0xb6d4('0x8')](_0xb6d4('0x30'),_0x5b7771);}};exports[_0xb6d4('0x31')]=function(_0x3f452){var _0x2b024a=moment()['format'](_0xb6d4('0x32'));_0x3f452[_0xb6d4('0x33')]=0xd;_0x3f452[_0xb6d4('0x34')]='Blacklist';_0x3f452['starttime']=_0x2b024a;_0x3f452[_0xb6d4('0x35')]=_0x2b024a;_0x3f452[_0xb6d4('0x36')]=_0x2b024a;};exports[_0xb6d4('0x37')]=function(_0x3a8d0e,_0x7c5b7e,_0x522a44){var _0x4167bf=moment()['format'](_0xb6d4('0x32'));_0x3a8d0e[_0xb6d4('0x33')]=_0x7c5b7e;_0x3a8d0e[_0xb6d4('0x34')]=_0x522a44;_0x3a8d0e['responsetime']=_0x4167bf;_0x3a8d0e[_0xb6d4('0x38')]=getSeconds(_0x3a8d0e['responsetime'],_0x3a8d0e['starttime']);};exports[_0xb6d4('0x39')]=function(_0x3ee184,_0xa71efc,_0x106fc0){_0x3ee184[_0xb6d4('0x3a')]=_0xa71efc;_0x3ee184[_0xb6d4('0x3b')]=_0x106fc0;};exports['logCustomer']=function(_0x9c3a24,_0x4b2b00,_0x30f152){var _0x4d0783=moment()[_0xb6d4('0x13')](_0xb6d4('0x32'));_0x9c3a24[_0xb6d4('0x33')]=_0x4b2b00;_0x9c3a24[_0xb6d4('0x34')]=_0x30f152;_0x9c3a24[_0xb6d4('0x35')]=_0x9c3a24['responsetime']?_0x9c3a24[_0xb6d4('0x35')]:_0x4d0783;_0x9c3a24['endtime']=_0x9c3a24[_0xb6d4('0x36')]?_0x9c3a24[_0xb6d4('0x36')]:_0x4d0783;_0x9c3a24[_0xb6d4('0x38')]=getSeconds(_0x9c3a24[_0xb6d4('0x35')]||0x0,_0x9c3a24[_0xb6d4('0x3c')]||0x0);_0x9c3a24[_0xb6d4('0x3d')]=_0x9c3a24['answertime']?getSeconds(_0x9c3a24[_0xb6d4('0x36')],_0x9c3a24['answertime']):0x0;};exports[_0xb6d4('0x3e')]=function(_0xe3158f){return _0xe3158f===_0xb6d4('0x3f');};exports[_0xb6d4('0x40')]=function(_0x27f802,_0x434ea2,_0x5c9c4b,_0x559a18,_0x32eb4d){var _0x52b9e6=_0x559a18?'RECALL':_0x27f802[_0xb6d4('0x41')];_0x52b9e6=_0x32eb4d?_0xb6d4('0x42'):_0x52b9e6;return{'actionid':_0x27f802[_0xb6d4('0x43')],'action':'originate','channel':_0x27f802['channelAgent'],'callerid':util[_0xb6d4('0x13')](_0xb6d4('0x12'),_0x52b9e6,_0x27f802[_0xb6d4('0x17')]),'Exten':_0xb6d4('0x23'),'Context':_0xb6d4('0x44'),'Priority':'1','variable':_0x5c9c4b,'timeout':(_0x434ea2['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x27f802[_0xb6d4('0x43')]};};exports[_0xb6d4('0x45')]=function(_0x220ac1){return _0x220ac1[_0xb6d4('0x46')]+_0x220ac1[_0xb6d4('0x47')]+_0x220ac1[_0xb6d4('0x48')]+_0x220ac1['countagentrejectretry']+_0x220ac1['countnosuchnumberretry'];};exports[_0xb6d4('0x49')]=function(_0x47efcf){var _0x51358a=_[_0xb6d4('0x4a')](_0x47efcf);_0x51358a[_0xb6d4('0x33')]=0xf;_0x51358a[_0xb6d4('0x34')]=_0xb6d4('0x4b');return _0x51358a;};exports[_0xb6d4('0x4c')]=function(_0x3544ed,_0x28a5d5,_0x56adb8){var _0x862453={};_0x862453[_0x28a5d5]=_0x3544ed[_0x28a5d5];_0x862453[_0xb6d4('0x4d')]=![];_0x862453[_0xb6d4('0x4e')]=moment()[_0xb6d4('0x4f')](_0x56adb8,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x862453['ContactId']=_0x3544ed[_0xb6d4('0x18')];_0x862453['ListId']=_0x3544ed[_0xb6d4('0x50')];_0x862453[_0xb6d4('0x51')]=_0x3544ed[_0xb6d4('0x51')]||undefined;return _0x862453;};exports[_0xb6d4('0x52')]=function(_0x3e3271,_0x80973){if(!_['isNil'](_0x3e3271)){if(_0x3e3271['pTalking']>0x0){_0x3e3271[_0xb6d4('0x53')]-=0x1;}else{logger[_0xb6d4('0x8')](_0x80973,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xb6d4('0x8')](_0x80973,_0xb6d4('0x54'));}};exports[_0xb6d4('0x55')]=function(_0x2129d0){if(_0x2129d0<=0x0){return!![];}return![];};exports[_0xb6d4('0x56')]=function(_0x4c5b93,_0x5d6373){_0x4c5b93['lastevent']=_0x5d6373;_0x4c5b93[_0xb6d4('0x57')]=_0x4c5b93[_0xb6d4('0x58')];_0x4c5b93[_0xb6d4('0x59')]=_0x4c5b93[_0xb6d4('0x5a')];return _0x4c5b93;};exports[_0xb6d4('0x5b')]=function(_0x47fac8){var _0x264b3e={};_0x264b3e['queue']=_0x47fac8[_0xb6d4('0x58')];_0x264b3e[_0xb6d4('0x59')]=_0x47fac8[_0xb6d4('0x5a')];_0x264b3e['uniqueid']=_0x47fac8[_0xb6d4('0x43')];return _0x264b3e;};exports[_0xb6d4('0x5c')]=function(_0x554f44){var _0x57374a=[];for(var _0x560080 in _0x554f44){if(_0x554f44['hasOwnProperty'](_0x560080)){if(!_[_0xb6d4('0x2d')](_0x554f44[_0x560080])&&_0x554f44[_0x560080]['state']===_0xb6d4('0x5d')&&_0x554f44[_0x560080][_0xb6d4('0x5e')]==='reachable'){_0x57374a[_0xb6d4('0x5f')](_0x554f44[_0x560080]['id']);}}}return _0x57374a;};exports['getDiff']=function(_0x210c28){var _0x8a247e=moment()[_0xb6d4('0x5')](0x0);var _0x3be560=moment(_0x210c28)[_0xb6d4('0x5')](0x0);return _0x8a247e['diff'](_0x3be560,_0xb6d4('0x7'));};exports[_0xb6d4('0x60')]=function(_0x2124c2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x2124c2['ContactId'],'ListId':_0x2124c2[_0xb6d4('0x50')],'VoiceQueueId':_0x2124c2['VoiceQueueId']||undefined,'CampaignId':_0x2124c2[_0xb6d4('0x61')]||undefined};};exports[_0xb6d4('0x62')]=function(_0x58aaef){if(_0x58aaef===_0xb6d4('0x43')||_0x58aaef===_0xb6d4('0x63')||_0x58aaef===_0xb6d4('0x58')||_0x58aaef===_0xb6d4('0x64')||_0x58aaef==='campaigntype'||_0x58aaef==='dialAnswer'||_0x58aaef===_0xb6d4('0x3a')||_0x58aaef===_0xb6d4('0x5a')||_0x58aaef==='calleridname'||_0x58aaef==='active'||_0x58aaef===_0xb6d4('0x17')||_0x58aaef===_0xb6d4('0x4e')||_0x58aaef===_0xb6d4('0x46')||_0x58aaef==='countcongestionretry'||_0x58aaef==='countnoanswerretry'||_0x58aaef===_0xb6d4('0x65')||_0x58aaef===_0xb6d4('0x66')||_0x58aaef==='callbackuniqueid'||_0x58aaef===_0xb6d4('0x67')||_0x58aaef===_0xb6d4('0x68')||_0x58aaef===_0xb6d4('0x18')||_0x58aaef===_0xb6d4('0x50')||_0x58aaef===_0xb6d4('0x3b')||_0x58aaef===_0xb6d4('0x51')||_0x58aaef===_0xb6d4('0x69')||_0x58aaef===_0xb6d4('0x6a')||_0x58aaef===_0xb6d4('0x6b')||_0x58aaef===_0xb6d4('0x6c')||_0x58aaef===_0xb6d4('0x6d')||_0x58aaef===_0xb6d4('0x6e')||_0x58aaef===_0xb6d4('0x6f')||_0x58aaef===_0xb6d4('0x70')||_0x58aaef===_0xb6d4('0x71')||_0x58aaef===_0xb6d4('0x72')||_0x58aaef===_0xb6d4('0x73')||_0x58aaef===_0xb6d4('0x74')||_0x58aaef===_0xb6d4('0x75')||_0x58aaef==='xmd-agiafter'||_0x58aaef===_0xb6d4('0x76')||_0x58aaef===_0xb6d4('0x77')||_0x58aaef===_0xb6d4('0x78')||_0x58aaef===_0xb6d4('0x79')||_0x58aaef===_0xb6d4('0x7a')||_0x58aaef===_0xb6d4('0x7b')||_0x58aaef===_0xb6d4('0x7c')||_0x58aaef===_0xb6d4('0x7d')||_0x58aaef===_0xb6d4('0x7e')||_0x58aaef==='rtpaudioqos'||_0x58aaef===_0xb6d4('0x78')||_0x58aaef===_0xb6d4('0x79')||_0x58aaef===_0xb6d4('0x7a')||_0x58aaef===_0xb6d4('0x7b')||_0x58aaef==='rtpaudioqoslossbridged'||_0x58aaef===_0xb6d4('0x7d')||_0x58aaef==='rtpaudioqosrttbridged'||_0x58aaef===_0xb6d4('0x7f')||_0x58aaef==='bridgepvtcallid'||_0x58aaef==='state'||_0x58aaef===_0xb6d4('0x34')){return![];}return!![];};exports[_0xb6d4('0x80')]=function(_0x265233,_0x33fdd1){var _0x51b8fa,_0x378ecc,_0xea0379;if(_0x33fdd1<=0x0){_0x33fdd1=0x1;}_0x51b8fa=new RegExp(_0xb6d4('0x81')+_0x33fdd1+'}$');_0x378ecc=Math[_0xb6d4('0x82')](0xa,_0x33fdd1-0x1);_0xea0379=Math[_0xb6d4('0x82')](0xa,_0x33fdd1)-0x1;return util[_0xb6d4('0x13')]('%s',_['replace'](_0x265233,_0x51b8fa,_['random'](_0x378ecc,_0xea0379)));};exports[_0xb6d4('0x83')]=function(_0x39eb24){var _0x48e28d=_0x39eb24['match'](/"(.*?)"/);return _0x48e28d?_0x48e28d[0x1]:_0x39eb24;};exports[_0xb6d4('0x84')]=function(_0x92b9eb){var _0x2c8ad2=_0x92b9eb[_0xb6d4('0x85')](/<(.*?)>/);return _0x2c8ad2?_0x2c8ad2[0x1]:_0x92b9eb;}; \ No newline at end of file +var _0xa282=['[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','state','statedesc','Blacklist','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','logLookAgent','membername','logCustomer','talktime','answertime','isFailure','variablesAction','RECALL','uniqueid','originate','from-sip','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','scheduledat','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','channelAgent','buildAcw','queue','not_inuse','reachable','push','getDiff','createBody','filterKey','idContact','type','campaigntype','dialAnswer','active','countcongestionretry','callback','callbackat','recallme','UserId','sipcallid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','bridgepvtcallid','pow','random','extractCalleridName','match','extractCalleridNumber','util','../../../../config/logger','env','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','logger','info','inspect','loggerError','message','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','addVariables','name','calleridname','calleridnum','ContactId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','isNil','tags','createdAt','updatedAt','XMD-','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa282,0x1f3));var _0x2a28=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xa282[_0x422905];return _0x33dc6c;};'use strict';var util=require(_0x2a28('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x2a28('0x1'))('preview');var ipAgi=process[_0x2a28('0x2')]['XCALLY_IP_AGI']||_0x2a28('0x3');function getSeconds(_0x1aec55,_0x2e12ef){var _0x194226=moment(_0x1aec55)[_0x2a28('0x4')](0x0);var _0x133fe9=moment(_0x2e12ef)[_0x2a28('0x4')](0x0);return _0x194226[_0x2a28('0x5')](_0x133fe9,_0x2a28('0x6'));}exports[_0x2a28('0x7')]=function(_0x24c7f5){return function(_0x91d789){logger[_0x2a28('0x8')](_0x24c7f5,util['inspect'](_0x91d789,{'showHidden':![],'depth':null}));};};exports[_0x2a28('0x9')]=function(_0x4e74b6,_0x21bdd0){logger[_0x2a28('0xa')](_0x4e74b6,util[_0x2a28('0xb')](_0x21bdd0,{'showHidden':![],'depth':null}));};exports[_0x2a28('0xc')]=function(_0x36d82e,_0x32cb0f){logger[_0x2a28('0x8')](_0x36d82e,util['inspect'](_0x32cb0f,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x14f4a4){return function(_0x5403b3){logger[_0x2a28('0xa')](_0x14f4a4,util[_0x2a28('0xb')](_0x5403b3,{'showHidden':![],'depth':null}));};};exports[_0x2a28('0xd')]=function(_0x4524ee,_0x3dd0de,_0x5acaca){return{'message':_0x4524ee,'unlock':_0x3dd0de,'active':_0x5acaca};};exports['getCallerId']=function(_0xcecc18,_0x1da434,_0x494d05){if(!_[_0x2a28('0xe')](_0x494d05)&&_0x2a28('0xf')===typeof _0x494d05&&!_['isEmpty'](_0x494d05)){if(!_['isUndefined'](_0x1da434)&&_0x2a28('0xf')===typeof _0x1da434&&!_[_0x2a28('0x10')](_0x1da434)){return util['format'](_0x2a28('0x11'),_0x1da434,_0x494d05);}return util[_0x2a28('0x12')]('\x22%s\x22\x20<%s>',_0x494d05,_0x494d05);}if(!_[_0x2a28('0xe')](_0xcecc18)&&_0x2a28('0xf')===typeof _0xcecc18&&!_['isEmpty'](_0xcecc18)){return _0xcecc18;}return _0x2a28('0x13');};exports['isActive']=function(_0x2990db){if(_['isNil'](_0x2990db)){return![];}return _0x2990db;};exports[_0x2a28('0x14')]=function(_0x3eeeca,_0x2179e3,_0x205903,_0x437b8c,_0x533fa5,_0x5404e3){var _0x18d88d={'XMD-QUEUE':_0x2179e3['Queue']?_0x2179e3['Queue'][_0x2a28('0x15')]:'','XMD-CALLERID':_0x437b8c,'XMD-CALLERID-PREVIEW':_0x5404e3?util['format'](_0x2a28('0x11'),_0x5404e3[_0x2a28('0x16')],_0x5404e3[_0x2a28('0x17')]):_0x437b8c,'XMD-DIALID':_0x533fa5,'XMD-CONTACTID':_0x2179e3[_0x2a28('0x18')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x437b8c,'XMD-VOICEQUEUEID':_0x2179e3['VoiceQueueId'],'XMD-DIALCHANNEL':_0x205903,'XMD-DIALTIMEOUT':_0x3eeeca[_0x2a28('0x19')]||0x1e,'XMD-DIALOPTIONS':util[_0x2a28('0x12')](_0x2a28('0x1a'),_0x3eeeca['dialQueueProject2']?'g':'',_[_0x2a28('0x10')](_0x3eeeca[_0x2a28('0x1b')])?'':_0x2a28('0x1c')),'XMD-DIALURL':_0x3eeeca[_0x2a28('0x1d')]||'','XMD-AGI':_0x3eeeca[_0x2a28('0x1e')]?util[_0x2a28('0x12')](_0x2a28('0x1f'),ipAgi,_0x3eeeca[_0x2a28('0x1e')]):_0x2a28('0x20'),'XMD-AGIAFTER':_0x3eeeca[_0x2a28('0x21')]?util[_0x2a28('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3eeeca[_0x2a28('0x21')]):_0x2a28('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x5404e3?_0x5404e3['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x5404e3?_0x5404e3[_0x2a28('0x22')]:'','XMD-DESTINATION':_0x2a28('0x23')};if(!_[_0x2a28('0x10')](_0x3eeeca[_0x2a28('0x1b')])){_0x18d88d[util[_0x2a28('0x12')]('%s',_0x2a28('0x24'))]=_0x3eeeca['monitor_format'];_0x18d88d[util[_0x2a28('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x533fa5;}if(_0x2179e3&&_0x2179e3[_0x2a28('0x25')]){for(var _0x284e92 in _0x2179e3[_0x2a28('0x25')]){if(_0x2179e3[_0x2a28('0x25')]['hasOwnProperty'](_0x284e92)){if(!_[_0x2a28('0x26')](_0x2179e3[_0x2a28('0x25')][_0x284e92])&&_0x284e92!=='id'&&_0x284e92!==_0x2a28('0x27')&&_0x284e92!==_0x2a28('0x28')&&_0x284e92!==_0x2a28('0x29')){_0x18d88d[util[_0x2a28('0x12')]('%s%s',_0x2a28('0x2a'),_['toUpper'](_0x284e92))]=_0x2179e3[_0x2a28('0x25')][_0x284e92];}}}}return _0x18d88d;};exports[_0x2a28('0x2b')]=function(_0x542347){var _0x47d17a={};for(var _0x2aa9ba in _0x542347){if(_0x542347[_0x2a28('0x2c')](_0x2aa9ba)){_0x47d17a[util[_0x2a28('0x12')]('%s',_[_0x2a28('0x2d')](_0x2aa9ba))]=_0x542347[_0x2aa9ba];}}return{'variables':_0x47d17a};};exports[_0x2a28('0x2e')]=function(_0x192112,_0x1f5115){if(!_[_0x2a28('0x26')](_0x192112)){if(_0x192112[_0x2a28('0x2c')](_0x2a28('0x2f'))){if(_0x192112[_0x2a28('0x2f')]>0x0){_0x192112[_0x2a28('0x2f')]-=0x1;}else{logger[_0x2a28('0x8')](_0x2a28('0x30'),_0x1f5115);}}}else{logger['error'](_0x2a28('0x31'),_0x1f5115);}};exports[_0x2a28('0x32')]=function(_0x11be0a){var _0x552bae=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x11be0a[_0x2a28('0x33')]=0xd;_0x11be0a[_0x2a28('0x34')]=_0x2a28('0x35');_0x11be0a['starttime']=_0x552bae;_0x11be0a[_0x2a28('0x36')]=_0x552bae;_0x11be0a[_0x2a28('0x37')]=_0x552bae;};exports[_0x2a28('0x38')]=function(_0x513ca0,_0x29342d,_0x1f5755){var _0x1ab7e3=moment()[_0x2a28('0x12')](_0x2a28('0x39'));_0x513ca0[_0x2a28('0x33')]=_0x29342d;_0x513ca0[_0x2a28('0x34')]=_0x1f5755;_0x513ca0[_0x2a28('0x36')]=_0x1ab7e3;_0x513ca0[_0x2a28('0x3a')]=getSeconds(_0x513ca0['responsetime'],_0x513ca0[_0x2a28('0x3b')]);};exports[_0x2a28('0x3c')]=function(_0x4f6c61,_0x2be1cb,_0x3cbdea){_0x4f6c61[_0x2a28('0x3d')]=_0x2be1cb;_0x4f6c61['UserId']=_0x3cbdea;};exports[_0x2a28('0x3e')]=function(_0x142c90,_0x549da3,_0x483d46){var _0x2e2678=moment()[_0x2a28('0x12')](_0x2a28('0x39'));_0x142c90[_0x2a28('0x33')]=_0x549da3;_0x142c90[_0x2a28('0x34')]=_0x483d46;_0x142c90[_0x2a28('0x36')]=_0x142c90[_0x2a28('0x36')]?_0x142c90[_0x2a28('0x36')]:_0x2e2678;_0x142c90[_0x2a28('0x37')]=_0x142c90[_0x2a28('0x37')]?_0x142c90[_0x2a28('0x37')]:_0x2e2678;_0x142c90[_0x2a28('0x3a')]=getSeconds(_0x142c90['responsetime']||0x0,_0x142c90[_0x2a28('0x3b')]||0x0);_0x142c90[_0x2a28('0x3f')]=_0x142c90[_0x2a28('0x40')]?getSeconds(_0x142c90['endtime'],_0x142c90[_0x2a28('0x40')]):0x0;};exports[_0x2a28('0x41')]=function(_0x356935){return _0x356935==='Failure';};exports[_0x2a28('0x42')]=function(_0x3b1b66,_0x3bc359,_0x521894,_0x41ad24,_0x49faec){var _0x40f137=_0x41ad24?_0x2a28('0x43'):_0x3b1b66[_0x2a28('0x16')];_0x40f137=_0x49faec?'BOOKED':_0x40f137;return{'actionid':_0x3b1b66[_0x2a28('0x44')],'action':_0x2a28('0x45'),'channel':_0x3b1b66['channelAgent'],'callerid':util[_0x2a28('0x12')](_0x2a28('0x11'),_0x40f137,_0x3b1b66[_0x2a28('0x17')]),'Exten':_0x2a28('0x23'),'Context':_0x2a28('0x46'),'Priority':'1','variable':_0x521894,'timeout':(_0x3bc359['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x3b1b66[_0x2a28('0x44')]};};exports[_0x2a28('0x47')]=function(_0x4f6741){return _0x4f6741[_0x2a28('0x48')]+_0x4f6741['countcongestionretry']+_0x4f6741[_0x2a28('0x49')]+_0x4f6741[_0x2a28('0x4a')]+_0x4f6741[_0x2a28('0x4b')];};exports[_0x2a28('0x4c')]=function(_0x2210bf){var _0x4b65de=_[_0x2a28('0x4d')](_0x2210bf);_0x4b65de['state']=0xf;_0x4b65de[_0x2a28('0x34')]=_0x2a28('0x4e');return _0x4b65de;};exports[_0x2a28('0x4f')]=function(_0x146c6d,_0x828475,_0x38be60){var _0x4e9571={};_0x4e9571[_0x828475]=_0x146c6d[_0x828475];_0x4e9571['active']=![];_0x4e9571[_0x2a28('0x50')]=moment()[_0x2a28('0x51')](_0x38be60,_0x2a28('0x52'))[_0x2a28('0x12')](_0x2a28('0x39'));_0x4e9571[_0x2a28('0x18')]=_0x146c6d[_0x2a28('0x18')];_0x4e9571[_0x2a28('0x53')]=_0x146c6d['ListId'];_0x4e9571['VoiceQueueId']=_0x146c6d[_0x2a28('0x54')]||undefined;return _0x4e9571;};exports[_0x2a28('0x55')]=function(_0x53c74d,_0x5d5935){if(!_[_0x2a28('0x26')](_0x53c74d)){if(_0x53c74d[_0x2a28('0x56')]>0x0){_0x53c74d[_0x2a28('0x56')]-=0x1;}else{logger[_0x2a28('0x8')](_0x5d5935,_0x2a28('0x57'));}}else{logger['error'](_0x5d5935,_0x2a28('0x58'));}};exports[_0x2a28('0x59')]=function(_0x5b9f82){if(_0x5b9f82<=0x0){return!![];}return![];};exports['buildObj']=function(_0x242cc7,_0x58bb11){_0x242cc7[_0x2a28('0x5a')]=_0x58bb11;_0x242cc7[_0x2a28('0x15')]=_0x242cc7['queue'];_0x242cc7[_0x2a28('0x5b')]=_0x242cc7[_0x2a28('0x5c')];return _0x242cc7;};exports[_0x2a28('0x5d')]=function(_0x477fc1){var _0x522878={};_0x522878[_0x2a28('0x5e')]=_0x477fc1[_0x2a28('0x5e')];_0x522878[_0x2a28('0x5b')]=_0x477fc1['channelAgent'];_0x522878[_0x2a28('0x44')]=_0x477fc1[_0x2a28('0x44')];return _0x522878;};exports['agentReadyId']=function(_0x20057){var _0x48eb47=[];for(var _0x28000a in _0x20057){if(_0x20057[_0x2a28('0x2c')](_0x28000a)){if(!_[_0x2a28('0x26')](_0x20057[_0x28000a])&&_0x20057[_0x28000a][_0x2a28('0x33')]===_0x2a28('0x5f')&&_0x20057[_0x28000a]['status']===_0x2a28('0x60')){_0x48eb47[_0x2a28('0x61')](_0x20057[_0x28000a]['id']);}}}return _0x48eb47;};exports[_0x2a28('0x62')]=function(_0x2b4adf){var _0x5a31fe=moment()[_0x2a28('0x4')](0x0);var _0x31dd2a=moment(_0x2b4adf)['milliseconds'](0x0);return _0x5a31fe[_0x2a28('0x5')](_0x31dd2a,_0x2a28('0x6'));};exports[_0x2a28('0x63')]=function(_0x491f7e){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x491f7e[_0x2a28('0x18')],'ListId':_0x491f7e['ListId'],'VoiceQueueId':_0x491f7e[_0x2a28('0x54')]||undefined,'CampaignId':_0x491f7e['CampaignId']||undefined};};exports[_0x2a28('0x64')]=function(_0x2cfefe){if(_0x2cfefe===_0x2a28('0x44')||_0x2cfefe===_0x2a28('0x65')||_0x2cfefe===_0x2a28('0x5e')||_0x2cfefe===_0x2a28('0x66')||_0x2cfefe===_0x2a28('0x67')||_0x2cfefe===_0x2a28('0x68')||_0x2cfefe===_0x2a28('0x3d')||_0x2cfefe===_0x2a28('0x5c')||_0x2cfefe==='calleridname'||_0x2cfefe===_0x2a28('0x69')||_0x2cfefe===_0x2a28('0x17')||_0x2cfefe===_0x2a28('0x50')||_0x2cfefe===_0x2a28('0x48')||_0x2cfefe===_0x2a28('0x6a')||_0x2cfefe===_0x2a28('0x49')||_0x2cfefe==='countglobal'||_0x2cfefe===_0x2a28('0x6b')||_0x2cfefe==='callbackuniqueid'||_0x2cfefe===_0x2a28('0x6c')||_0x2cfefe===_0x2a28('0x6d')||_0x2cfefe===_0x2a28('0x18')||_0x2cfefe===_0x2a28('0x53')||_0x2cfefe===_0x2a28('0x6e')||_0x2cfefe===_0x2a28('0x54')||_0x2cfefe===_0x2a28('0x6f')||_0x2cfefe==='xmd-voicequeueid'||_0x2cfefe==='xmd-queue'||_0x2cfefe===_0x2a28('0x70')||_0x2cfefe===_0x2a28('0x71')||_0x2cfefe===_0x2a28('0x72')||_0x2cfefe===_0x2a28('0x73')||_0x2cfefe===_0x2a28('0x74')||_0x2cfefe===_0x2a28('0x75')||_0x2cfefe==='xmd-dialchannel'||_0x2cfefe===_0x2a28('0x76')||_0x2cfefe===_0x2a28('0x77')||_0x2cfefe===_0x2a28('0x78')||_0x2cfefe===_0x2a28('0x79')||_0x2cfefe===_0x2a28('0x7a')||_0x2cfefe===_0x2a28('0x7b')||_0x2cfefe===_0x2a28('0x7c')||_0x2cfefe===_0x2a28('0x7d')||_0x2cfefe==='rtpaudioqosjitterbridged'||_0x2cfefe===_0x2a28('0x7e')||_0x2cfefe==='rtpaudioqoslossbridged'||_0x2cfefe===_0x2a28('0x7f')||_0x2cfefe===_0x2a28('0x80')||_0x2cfefe===_0x2a28('0x7b')||_0x2cfefe==='rtpaudioqosbridged'||_0x2cfefe===_0x2a28('0x7d')||_0x2cfefe===_0x2a28('0x81')||_0x2cfefe===_0x2a28('0x7e')||_0x2cfefe===_0x2a28('0x82')||_0x2cfefe===_0x2a28('0x7f')||_0x2cfefe===_0x2a28('0x80')||_0x2cfefe==='bridgepeer'||_0x2cfefe===_0x2a28('0x83')||_0x2cfefe===_0x2a28('0x33')||_0x2cfefe===_0x2a28('0x34')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2e8f63,_0xee3432){var _0x4b802d,_0x1c17bc,_0x37abbf;if(_0xee3432<=0x0){_0xee3432=0x1;}_0x4b802d=new RegExp('\x5cw{0,'+_0xee3432+'}$');_0x1c17bc=Math[_0x2a28('0x84')](0xa,_0xee3432-0x1);_0x37abbf=Math['pow'](0xa,_0xee3432)-0x1;return util[_0x2a28('0x12')]('%s',_['replace'](_0x2e8f63,_0x4b802d,_[_0x2a28('0x85')](_0x1c17bc,_0x37abbf)));};exports[_0x2a28('0x86')]=function(_0x3c7229){var _0x574ad2=_0x3c7229[_0x2a28('0x87')](/"(.*?)"/);return _0x574ad2?_0x574ad2[0x1]:_0x3c7229;};exports[_0x2a28('0x88')]=function(_0x4fe440){var _0xc5797c=_0x4fe440[_0x2a28('0x87')](/<(.*?)>/);return _0xc5797c?_0xc5797c[0x1]:_0x4fe440;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index b754f46..f9dd196 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 _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x325fbc,_0x294da1){var _0x2686bd=function(_0x2e0940){while(--_0x2e0940){_0x325fbc['push'](_0x325fbc['shift']());}};_0x2686bd(++_0x294da1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x183362,_0x5ce949){_0x183362=_0x183362-0x0;var _0xb56429=_0x5f2f[_0x183362];return _0xb56429;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0xb10b=['voicequeuechannelhangup','queueadd','string','number','queueremove','queuepause','boolean','reload','voicechannel'];(function(_0x338290,_0x2bd142){var _0x38c02e=function(_0x323bcc){while(--_0x323bcc){_0x338290['push'](_0x338290['shift']());}};_0x38c02e(++_0x2bd142);}(_0xb10b,0x12a));var _0xbb10=function(_0x326aa7,_0x12dceb){_0x326aa7=_0x326aa7-0x0;var _0x3955b2=_0xb10b[_0x326aa7];return _0x3955b2;};'use strict';exports[_0xbb10('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]},'membername':{'type':_0xbb10('0x1'),'required':!![]},'penalty':{'type':_0xbb10('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbb10('0x3')]={'queue':{'type':_0xbb10('0x1'),'required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x4')]={'interface':{'type':_0xbb10('0x1'),'required':!![]},'paused':{'type':_0xbb10('0x5')},'reason':{'type':'string','required':![]}};exports[_0xbb10('0x6')]={'module':{'type':_0xbb10('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x7')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]},'filename':{'type':_0xbb10('0x1')},'format':{'type':_0xbb10('0x1')},'mixmonitorid':{'type':_0xbb10('0x1')}};exports[_0xbb10('0x8')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xbb10('0x1'),'required':!![]},'context':{'type':_0xbb10('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 6e8b8c7..f3f2300 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 _0x9462=['vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','hasOwnProperty','format','SIP/%s','name','isNil','interface','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isUndefined','initTelephones','initTrunks','initTemplates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','deskAccounts','initVtigerAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallerexitAt','total','queuecallercomplete','queuecallercompleteAt','diff','initVoiceCallReports','duration','disposition','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','../model/agent','../model/trunk','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','templates','outbound','voiceExtensions','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts'];(function(_0x2a54f3,_0x5049ea){var _0x49acb5=function(_0x5d35a7){while(--_0x5d35a7){_0x2a54f3['push'](_0x2a54f3['shift']());}};_0x49acb5(++_0x5049ea);}(_0x9462,0x111));var _0x2946=function(_0x5a72a9,_0x2ac9f9){_0x5a72a9=_0x5a72a9-0x0;var _0x10e390=_0x9462[_0x5a72a9];return _0x10e390;};'use strict';var BPromise=require('bluebird');var util=require(_0x2946('0x0'));var _=require(_0x2946('0x1'));var moment=require('moment');var Agent=require(_0x2946('0x2'));var Telephone=require('../model/telephone');var Trunk=require(_0x2946('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0x2946('0x4'));var Campaign=require(_0x2946('0x5'));var VoiceExtension=require(_0x2946('0x6'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x2946('0x7'));var FreshdeskAccount=require(_0x2946('0x8'));var SugarcrmAccount=require(_0x2946('0x9'));var ZohoAccount=require(_0x2946('0xa'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x2946('0xb'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x2946('0xc'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0x2946('0xd'));var Realtime=function(){this[_0x2946('0xe')]={};this[_0x2946('0xf')]={};this[_0x2946('0x10')]={};this[_0x2946('0x11')]={};this[_0x2946('0x12')]={};this['campaigns']={};this[_0x2946('0x13')]={};this[_0x2946('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x2946('0x15')]={};this['channels']={};this['queueChannels']={};this[_0x2946('0x16')]={};this[_0x2946('0x17')]={};this['zendeskAccounts']={};this[_0x2946('0x18')]={};this[_0x2946('0x19')]={};this[_0x2946('0x1a')]={};this['zohoAccounts']={};this['deskAccounts']={};this[_0x2946('0x1b')]={};this['servicenowAccounts']={};this[_0x2946('0x1c')]={};this[_0x2946('0x1d')]={};this[_0x2946('0x1e')]={};};function freeIsNotKey(_0x3bf39a,_0x14fa28,_0x463637){var _0x214d40=_['mapKeys'](_0x3bf39a,function(_0x25eb24,_0x5b04ca){return _0x25eb24[_0x463637];});for(var _0x12fef6 in _0x14fa28){if(_0x14fa28[_0x2946('0x1f')](_0x12fef6)){if(!_0x214d40[_0x12fef6]){delete _0x14fa28[_0x12fef6];}}}}function freeIsNotKeySip(_0x370f29,_0x43e5eb){var _0x53f23f=_['mapKeys'](_0x370f29,function(_0x355e3e,_0x586a5b){return util[_0x2946('0x20')](_0x2946('0x21'),_0x355e3e[_0x2946('0x22')]);});for(var _0x102350 in _0x43e5eb){if(_0x43e5eb[_0x2946('0x1f')](_0x102350)){if(!_0x53f23f[_0x102350]){delete _0x43e5eb[_0x102350];}}}}function freeIsNotKeyAgent(_0x7b8c11,_0x4b0ed4){var _0x1cbf30=_['mapKeys'](_0x7b8c11,function(_0x7ed4c0,_0x54b46d){var _0x28086d=_[_0x2946('0x23')](_0x7ed4c0[_0x2946('0x24')])?util[_0x2946('0x20')](_0x2946('0x21'),_0x7ed4c0[_0x2946('0x22')]):_0x7ed4c0[_0x2946('0x24')];return _0x28086d;});for(var _0x231bf8 in _0x4b0ed4){if(_0x4b0ed4[_0x2946('0x1f')](_0x231bf8)){if(!_0x1cbf30[_0x231bf8]){delete _0x4b0ed4[_0x231bf8];}}}}function clearVoiceCallReports(_0xad12eb){_0xad12eb['total']=0x0;_0xad12eb[_0x2946('0x25')]=0x0;_0xad12eb[_0x2946('0x26')]=0x0;_0xad12eb[_0x2946('0x27')]=0x0;_0xad12eb['sumBillable']=0x0;}function clearCampaigns(_0x1ae189){if(!_[_0x2946('0x28')](_0x1ae189)){for(var _0x18cd9d in _0x1ae189){if(_0x1ae189[_0x2946('0x1f')](_0x18cd9d)){_0x1ae189[_0x18cd9d][_0x2946('0x29')]=0x0;_0x1ae189[_0x18cd9d][_0x2946('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x3788cc){if(!_[_0x2946('0x28')](_0x3788cc)){for(var _0x53f77d in _0x3788cc){if(_0x3788cc['hasOwnProperty'](_0x53f77d)){_0x3788cc[_0x53f77d]['total']=0x0;_0x3788cc[_0x53f77d][_0x2946('0x25')]=0x0;_0x3788cc[_0x53f77d][_0x2946('0x2b')]=0x0;_0x3788cc[_0x53f77d][_0x2946('0x2c')]=0x0;_0x3788cc[_0x53f77d][_0x2946('0x26')]=0x0;_0x3788cc[_0x53f77d][_0x2946('0x27')]=0x0;_0x3788cc[_0x53f77d][_0x2946('0x2d')]=0x0;_0x3788cc[_0x53f77d][_0x2946('0x2e')]=0x0;_0x3788cc[_0x53f77d]['outboundNoAnswerCallsDay']=0x0;_0x3788cc[_0x53f77d][_0x2946('0x2f')]=0x0;_0x3788cc[_0x53f77d]['outboundCongestionCallsDay']=0x0;_0x3788cc[_0x53f77d][_0x2946('0x30')]=0x0;_0x3788cc[_0x53f77d]['outboundUnknownCallsDay']=0x0;_0x3788cc[_0x53f77d][_0x2946('0x31')]=0x0;_0x3788cc[_0x53f77d]['outboundDropCallsDayCallersExit']=0x0;_0x3788cc[_0x53f77d][_0x2946('0x32')]=0x0;_0x3788cc[_0x53f77d][_0x2946('0x33')]=0x0;_0x3788cc[_0x53f77d][_0x2946('0x34')]=0x0;_0x3788cc[_0x53f77d]['outboundReCallsDay']=0x0;_0x3788cc[_0x53f77d]['outboundAnswerAgiCallsDay']=0x0;_0x3788cc[_0x53f77d]['outboundAnswerCallsDay']=0x0;_0x3788cc[_0x53f77d][_0x2946('0x35')]=!![];}}}}Realtime['prototype'][_0x2946('0x36')]=function(_0x3bac69,_0x82f02a){for(var _0x2821f1 in _0x82f02a){if(_0x3bac69[_0x2946('0x1f')](_0x2821f1)){_0x3bac69[_0x2821f1]=_0x82f02a[_0x2821f1];}}};Realtime[_0x2946('0x37')][_0x2946('0x38')]=function(){var _0x51cf12=this;return function(_0x436c41){if(_0x436c41){freeIsNotKeyAgent(_0x436c41,_0x51cf12[_0x2946('0xe')]);for(var _0x3faea5=0x0,_0x3b3f59={},_0x5b223e={};_0x3faea5<_0x436c41[_0x2946('0x39')];_0x3faea5+=0x1){_0x3b3f59=_0x436c41[_0x3faea5];var _0x1b4e52=_[_0x2946('0x23')](_0x3b3f59[_0x2946('0x24')])?util['format'](_0x2946('0x21'),_0x3b3f59[_0x2946('0x22')]):_0x3b3f59[_0x2946('0x24')];if(_[_0x2946('0x3a')](_0x51cf12[_0x2946('0xe')][_0x1b4e52])){_0x51cf12[_0x2946('0xe')][_0x1b4e52]=new Agent(_0x3b3f59);}else{_0x51cf12[_0x2946('0x36')](_0x51cf12['agents'][_0x1b4e52],_0x3b3f59);}}}return _0x51cf12[_0x2946('0xe')];};};Realtime[_0x2946('0x37')][_0x2946('0x3b')]=function(){var _0xa7a12=this;return function(_0x1d179c){if(_0x1d179c){freeIsNotKeySip(_0x1d179c,_0xa7a12['telephones']);for(var _0x104afd=0x0,_0x576435={},_0x4a9b4c={};_0x104afd<_0x1d179c['length'];_0x104afd+=0x1){_0x576435=_0x1d179c[_0x104afd];if(_[_0x2946('0x3a')](_0xa7a12[_0x2946('0xf')][util['format'](_0x2946('0x21'),_0x576435[_0x2946('0x22')])])){_0xa7a12[_0x2946('0xf')][util[_0x2946('0x20')](_0x2946('0x21'),_0x576435['name'])]=new Telephone(_0x576435);}else{_0xa7a12[_0x2946('0x36')](_0xa7a12[_0x2946('0xf')][util[_0x2946('0x20')]('SIP/%s',_0x576435['name'])],_0x576435);}}}return _0xa7a12[_0x2946('0xf')];};};Realtime[_0x2946('0x37')][_0x2946('0x3c')]=function(){var _0x111d32=this;return function(_0x141ae3){if(_0x141ae3){freeIsNotKeySip(_0x141ae3,_0x111d32[_0x2946('0x10')]);for(var _0x474c7a=0x0,_0x436635={},_0x58c646={};_0x474c7a<_0x141ae3[_0x2946('0x39')];_0x474c7a+=0x1){_0x436635=_0x141ae3[_0x474c7a];if(_[_0x2946('0x3a')](_0x111d32[_0x2946('0x10')][util[_0x2946('0x20')]('SIP/%s',_0x436635['name'])])){_0x111d32[_0x2946('0x10')][util[_0x2946('0x20')](_0x2946('0x21'),_0x436635[_0x2946('0x22')])]=new Trunk(_0x436635);}else{_0x111d32[_0x2946('0x36')](_0x111d32[_0x2946('0x10')][util[_0x2946('0x20')](_0x2946('0x21'),_0x436635[_0x2946('0x22')])],_0x436635);}}}return _0x111d32['trunks'];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x1144ea=this;return function(_0x27cf5a){if(_0x27cf5a){freeIsNotKey(_0x27cf5a,_0x1144ea['voiceQueues'],_0x2946('0x22'));for(var _0x158d58=0x0,_0x48b7ab={},_0x1a8656={};_0x158d58<_0x27cf5a[_0x2946('0x39')];_0x158d58+=0x1){_0x48b7ab=_0x27cf5a[_0x158d58];if(_[_0x2946('0x3a')](_0x1144ea[_0x2946('0x11')][_0x48b7ab[_0x2946('0x22')]])){_0x1144ea['voiceQueues'][_0x48b7ab[_0x2946('0x22')]]=new VoiceQueue(_0x48b7ab);}else{_0x1144ea[_0x2946('0x36')](_0x1144ea[_0x2946('0x11')][_0x48b7ab[_0x2946('0x22')]],_0x48b7ab);}}}return _0x1144ea['voiceQueues'];};};Realtime[_0x2946('0x37')]['initTriggers']=function(){var _0x165c0c=this;return function(_0x270702){if(_0x270702){freeIsNotKey(_0x270702,_0x165c0c[_0x2946('0x12')],'id');for(var _0x8aa48a=0x0,_0x53223c={},_0x170499={};_0x8aa48a<_0x270702[_0x2946('0x39')];_0x8aa48a+=0x1){_0x53223c=_0x270702[_0x8aa48a];if(_[_0x2946('0x3a')](_0x165c0c[_0x2946('0x12')][_0x53223c['id']])){_0x165c0c['triggers'][_0x53223c['id']]=new Trigger(_0x53223c);}else{_0x165c0c[_0x2946('0x36')](_0x165c0c['triggers'][_0x53223c['id']],_0x53223c);}}}return _0x165c0c['triggers'];};};Realtime[_0x2946('0x37')][_0x2946('0x3d')]=function(){var _0x289752=this;return function(_0x41dfd8){if(_0x41dfd8){freeIsNotKey(_0x41dfd8,_0x289752[_0x2946('0x13')],'id');for(var _0x23a62b=0x0,_0x318b6c={},_0x5097af={};_0x23a62b<_0x41dfd8[_0x2946('0x39')];_0x23a62b+=0x1){_0x318b6c=_0x41dfd8[_0x23a62b];if(_[_0x2946('0x3a')](_0x289752[_0x2946('0x13')][_0x318b6c['id']])){_0x289752[_0x2946('0x13')][_0x318b6c['id']]=new Template(_0x318b6c);}else{_0x289752[_0x2946('0x36')](_0x289752['templates'][_0x318b6c['id']],_0x318b6c);}}}return _0x289752[_0x2946('0x13')];};};Realtime[_0x2946('0x37')][_0x2946('0x3e')]=function(){var _0x34aa86=this;return function(_0x3eb820){if(_0x3eb820){freeIsNotKey(_0x3eb820,_0x34aa86[_0x2946('0x3f')],'id');for(var _0x2e5dac=0x0,_0x1f02ba={},_0x94c795={};_0x2e5dac<_0x3eb820[_0x2946('0x39')];_0x2e5dac+=0x1){_0x1f02ba=_0x3eb820[_0x2e5dac];if(_[_0x2946('0x3a')](_0x34aa86['zendeskAccounts'][_0x1f02ba['id']])){_0x34aa86[_0x2946('0x3f')][_0x1f02ba['id']]=new ZendeskAccount(_0x1f02ba);}else{_0x34aa86[_0x2946('0x36')](_0x34aa86['zendeskAccounts'][_0x1f02ba['id']],_0x1f02ba);}}}return _0x34aa86[_0x2946('0x3f')];};};Realtime[_0x2946('0x37')]['initSalesforceAccounts']=function(){var _0x2af35f=this;return function(_0x5007ed){if(_0x5007ed){freeIsNotKey(_0x5007ed,_0x2af35f[_0x2946('0x18')],'id');for(var _0x21d605=0x0,_0x1407c2={},_0xbbb9a2={};_0x21d605<_0x5007ed[_0x2946('0x39')];_0x21d605+=0x1){_0x1407c2=_0x5007ed[_0x21d605];if(_['isUndefined'](_0x2af35f[_0x2946('0x18')][_0x1407c2['id']])){_0x2af35f[_0x2946('0x18')][_0x1407c2['id']]=new SalesforceAccount(_0x1407c2);}else{_0x2af35f['mergeFromDatabase'](_0x2af35f[_0x2946('0x18')][_0x1407c2['id']],_0x1407c2);}}}return _0x2af35f['salesforceAccounts'];};};Realtime['prototype'][_0x2946('0x40')]=function(){var _0x72066f=this;return function(_0x9543b2){if(_0x9543b2){freeIsNotKey(_0x9543b2,_0x72066f[_0x2946('0x1a')],'id');for(var _0x2b1b51=0x0,_0x48379c={},_0x2e6ed1={};_0x2b1b51<_0x9543b2[_0x2946('0x39')];_0x2b1b51+=0x1){_0x48379c=_0x9543b2[_0x2b1b51];if(_[_0x2946('0x3a')](_0x72066f['freshdeskAccounts'][_0x48379c['id']])){_0x72066f['freshdeskAccounts'][_0x48379c['id']]=new FreshdeskAccount(_0x48379c);}else{_0x72066f[_0x2946('0x36')](_0x72066f[_0x2946('0x1a')][_0x48379c['id']],_0x48379c);}}}return _0x72066f[_0x2946('0x1a')];};};Realtime[_0x2946('0x37')][_0x2946('0x41')]=function(){var _0x5f45e0=this;return function(_0x514c5f){if(_0x514c5f){freeIsNotKey(_0x514c5f,_0x5f45e0[_0x2946('0x42')],'id');for(var _0x5992a9=0x0,_0x1419cc={},_0x584195={};_0x5992a9<_0x514c5f[_0x2946('0x39')];_0x5992a9+=0x1){_0x1419cc=_0x514c5f[_0x5992a9];if(_[_0x2946('0x3a')](_0x5f45e0[_0x2946('0x42')][_0x1419cc['id']])){_0x5f45e0['zohoAccounts'][_0x1419cc['id']]=new ZohoAccount(_0x1419cc);}else{_0x5f45e0[_0x2946('0x36')](_0x5f45e0[_0x2946('0x42')][_0x1419cc['id']],_0x1419cc);}}}return _0x5f45e0[_0x2946('0x42')];};};Realtime[_0x2946('0x37')]['initDeskAccounts']=function(){var _0x12feec=this;return function(_0x25eed){if(_0x25eed){freeIsNotKey(_0x25eed,_0x12feec[_0x2946('0x43')],'id');for(var _0x1d06fe=0x0,_0x1f1ba1={},_0x4b7c34={};_0x1d06fe<_0x25eed[_0x2946('0x39')];_0x1d06fe+=0x1){_0x1f1ba1=_0x25eed[_0x1d06fe];if(_[_0x2946('0x3a')](_0x12feec['deskAccounts'][_0x1f1ba1['id']])){_0x12feec[_0x2946('0x43')][_0x1f1ba1['id']]=new DeskAccount(_0x1f1ba1);}else{_0x12feec[_0x2946('0x36')](_0x12feec[_0x2946('0x43')][_0x1f1ba1['id']],_0x1f1ba1);}}}return _0x12feec[_0x2946('0x43')];};};Realtime['prototype']['initSugarcrmAccounts']=function(){var _0x5bc1fc=this;return function(_0x4a54a1){if(_0x4a54a1){freeIsNotKey(_0x4a54a1,_0x5bc1fc['sugarcrmAccounts'],'id');for(var _0x3a54d4=0x0,_0x58953f={},_0x5ac5d1={};_0x3a54d4<_0x4a54a1['length'];_0x3a54d4+=0x1){_0x58953f=_0x4a54a1[_0x3a54d4];if(_[_0x2946('0x3a')](_0x5bc1fc[_0x2946('0x19')][_0x58953f['id']])){_0x5bc1fc[_0x2946('0x19')][_0x58953f['id']]=new SugarcrmAccount(_0x58953f);}else{_0x5bc1fc['mergeFromDatabase'](_0x5bc1fc[_0x2946('0x19')][_0x58953f['id']],_0x58953f);}}}return _0x5bc1fc['sugarcrmAccounts'];};};Realtime[_0x2946('0x37')][_0x2946('0x44')]=function(){var _0x569f4e=this;return function(_0x3f2a80){if(_0x3f2a80){freeIsNotKey(_0x3f2a80,_0x569f4e[_0x2946('0x1b')],'id');for(var _0x140141=0x0,_0x4f74c6={},_0x405fcb={};_0x140141<_0x3f2a80[_0x2946('0x39')];_0x140141+=0x1){_0x4f74c6=_0x3f2a80[_0x140141];if(_[_0x2946('0x3a')](_0x569f4e['vtigerAccounts'][_0x4f74c6['id']])){_0x569f4e['vtigerAccounts'][_0x4f74c6['id']]=new VtigerAccount(_0x4f74c6);}else{_0x569f4e[_0x2946('0x36')](_0x569f4e[_0x2946('0x1b')][_0x4f74c6['id']],_0x4f74c6);}}}return _0x569f4e[_0x2946('0x1b')];};};Realtime[_0x2946('0x37')]['initServicenowAccounts']=function(){var _0x269bd2=this;return function(_0x504279){if(_0x504279){freeIsNotKey(_0x504279,_0x269bd2[_0x2946('0x45')],'id');for(var _0x590c95=0x0,_0x5b0bb1={},_0x5952aa={};_0x590c95<_0x504279[_0x2946('0x39')];_0x590c95+=0x1){_0x5b0bb1=_0x504279[_0x590c95];if(_[_0x2946('0x3a')](_0x269bd2['servicenowAccounts'][_0x5b0bb1['id']])){_0x269bd2[_0x2946('0x45')][_0x5b0bb1['id']]=new ServicenowAccount(_0x5b0bb1);}else{_0x269bd2['mergeFromDatabase'](_0x269bd2['servicenowAccounts'][_0x5b0bb1['id']],_0x5b0bb1);}}}return _0x269bd2[_0x2946('0x45')];};};Realtime['prototype'][_0x2946('0x46')]=function(){var _0x5ca650=this;return function(_0x3adb29){if(_0x3adb29){freeIsNotKey(_0x3adb29,_0x5ca650[_0x2946('0x1c')],'id');for(var _0x6f8b91=0x0,_0x4499fa={},_0x5ace90={};_0x6f8b91<_0x3adb29['length'];_0x6f8b91+=0x1){_0x4499fa=_0x3adb29[_0x6f8b91];if(_[_0x2946('0x3a')](_0x5ca650[_0x2946('0x1c')][_0x4499fa['id']])){_0x5ca650[_0x2946('0x1c')][_0x4499fa['id']]=new Dynamics365Account(_0x4499fa);}else{_0x5ca650[_0x2946('0x36')](_0x5ca650[_0x2946('0x1c')][_0x4499fa['id']],_0x4499fa);}}}return _0x5ca650[_0x2946('0x1c')];};};Realtime[_0x2946('0x37')][_0x2946('0x47')]=function(){var _0x2de5b7=this;return function(_0x439c25){if(_0x439c25){freeIsNotKey(_0x439c25,_0x2de5b7[_0x2946('0x1d')],'id');for(var _0xb95574=0x0,_0x282754={},_0x2ff6ac={};_0xb95574<_0x439c25[_0x2946('0x39')];_0xb95574+=0x1){_0x282754=_0x439c25[_0xb95574];if(_[_0x2946('0x3a')](_0x2de5b7['freshsalesAccounts'][_0x282754['id']])){_0x2de5b7['freshsalesAccounts'][_0x282754['id']]=new FreshsalesAccount(_0x282754);}else{_0x2de5b7['mergeFromDatabase'](_0x2de5b7[_0x2946('0x1d')][_0x282754['id']],_0x282754);}}}return _0x2de5b7[_0x2946('0x1d')];};};Realtime['prototype'][_0x2946('0x48')]=function(){var _0x266bd5=this;return function(_0x38597e){for(var _0x3fde58=0x0;_0x3fde58<_0x38597e[_0x2946('0x39')];_0x3fde58+=0x1){_[_0x2946('0x49')](_0x266bd5[_0x2946('0x11')][_0x38597e[_0x3fde58][_0x2946('0x22')]],_0x38597e[_0x3fde58]);}return _0x266bd5[_0x2946('0x11')];};};Realtime[_0x2946('0x37')][_0x2946('0x4a')]=function(){var _0x7aca3a=this;return function(_0x386b4e){clearVoiceQueues(_0x7aca3a[_0x2946('0x11')]);if(_0x386b4e){_0x386b4e=_[_0x2946('0x4b')](_0x386b4e,_0x2946('0x4c'));for(var _0x377ca7 in _0x386b4e){if(_0x386b4e[_0x2946('0x1f')](_0x377ca7)){var _0x17452c={};for(var _0x4cb658=0x0;_0x4cb658<_0x386b4e[_0x377ca7][_0x2946('0x39')];_0x4cb658+=0x1){var _0x5c1927=_0x386b4e[_0x377ca7][_0x4cb658][_0x2946('0x4d')];if(_0x7aca3a[_0x2946('0x11')][_0x5c1927]){if(_0x386b4e[_0x377ca7][_0x4cb658][_0x2946('0x4e')]){_0x7aca3a[_0x2946('0x11')][_0x5c1927]['unmanaged']+=0x1;}if(_0x386b4e[_0x377ca7][_0x4cb658][_0x2946('0x4f')]){_0x7aca3a[_0x2946('0x11')][_0x5c1927][_0x2946('0x2c')]+=0x1;}_0x7aca3a[_0x2946('0x11')][_0x5c1927][_0x2946('0x26')]+=moment(_0x386b4e[_0x377ca7][_0x4cb658][_0x2946('0x50')])['diff'](moment(_0x386b4e[_0x377ca7][_0x4cb658][_0x2946('0x51')]),_0x2946('0x52'))||0x0;if(_0x4cb658===_0x386b4e[_0x377ca7][_0x2946('0x39')]-0x1){_0x7aca3a['voiceQueues'][_0x5c1927]['sumDuration']+=moment(_0x386b4e[_0x377ca7][_0x4cb658]['queuecallercompleteAt']||_0x386b4e[_0x377ca7][_0x4cb658]['queuecallerabandonAt']||_0x386b4e[_0x377ca7][_0x4cb658][_0x2946('0x53')])['diff'](moment(_0x386b4e[_0x377ca7][_0x4cb658][_0x2946('0x51')]),_0x2946('0x52'))||0x0;_0x7aca3a[_0x2946('0x11')][_0x5c1927][_0x2946('0x54')]+=0x1;if(_0x386b4e[_0x377ca7][_0x4cb658][_0x2946('0x55')]){_0x7aca3a[_0x2946('0x11')][_0x5c1927]['answered']+=0x1;_0x7aca3a[_0x2946('0x11')][_0x5c1927][_0x2946('0x2d')]+=moment(_0x386b4e[_0x377ca7][_0x4cb658][_0x2946('0x56')])[_0x2946('0x57')](moment(_0x386b4e[_0x377ca7][_0x4cb658][_0x2946('0x50')]),_0x2946('0x52'))||0x0;}}else{_0x7aca3a[_0x2946('0x11')][_0x5c1927]['sumDuration']+=_0x7aca3a[_0x2946('0x11')][_0x5c1927][_0x2946('0x26')]||0x0;}}}}}}return _0x7aca3a['voiceQueues'];};};Realtime[_0x2946('0x37')][_0x2946('0x58')]=function(){var _0x157ee6=this;return function(_0x1263e6){clearVoiceCallReports(_0x157ee6[_0x2946('0x14')]);if(_0x1263e6){for(var _0xf28ee1=0x0;_0xf28ee1<_0x1263e6[_0x2946('0x39')];_0xf28ee1+=0x1){_0x157ee6[_0x2946('0x14')]['total']+=0x1;_0x157ee6[_0x2946('0x14')]['sumDuration']+=_0x1263e6[_0xf28ee1][_0x2946('0x59')];if(_0x1263e6[_0xf28ee1][_0x2946('0x5a')]==='ANSWERED'){_0x157ee6['outbound'][_0x2946('0x25')]+=0x1;_0x157ee6[_0x2946('0x14')][_0x2946('0x26')]+=_0x1263e6[_0xf28ee1][_0x2946('0x59')]-_0x1263e6[_0xf28ee1][_0x2946('0x5b')]||0x0;_0x157ee6[_0x2946('0x14')][_0x2946('0x2d')]+=_0x1263e6[_0xf28ee1][_0x2946('0x5b')];}}}return _0x157ee6[_0x2946('0x14')];};};Realtime[_0x2946('0x37')][_0x2946('0x5c')]=function(){var _0x1f075b=this;return function(_0x3834ee){if(_0x3834ee){freeIsNotKey(_0x3834ee,_0x1f075b[_0x2946('0x5d')],_0x2946('0x22'));for(var _0x216f53=0x0,_0x93e0e5={};_0x216f53<_0x3834ee[_0x2946('0x39')];_0x216f53+=0x1){_0x93e0e5=_0x3834ee[_0x216f53];if(_['isUndefined'](_0x1f075b[_0x2946('0x5d')][_0x93e0e5['name']])){_0x1f075b['campaigns'][_0x93e0e5[_0x2946('0x22')]]=new Campaign(_0x93e0e5);}else{_0x1f075b[_0x2946('0x36')](_0x1f075b[_0x2946('0x5d')][_0x93e0e5['name']],_0x93e0e5);_0x1f075b['campaigns'][_0x93e0e5[_0x2946('0x22')]][_0x2946('0x5e')]=_0x93e0e5[_0x2946('0x5f')]?_0x93e0e5['SquareProject']['name']:undefined;}}}return _0x1f075b['campaigns'];};};Realtime[_0x2946('0x37')][_0x2946('0x60')]=function(){var _0x519e6c=this;return function(_0x361cf2){if(_0x361cf2){freeIsNotKey(_0x361cf2,_0x519e6c[_0x2946('0x15')],'id');for(var _0x5209d9=0x0,_0x2ad6fd={};_0x5209d9<_0x361cf2[_0x2946('0x39')];_0x5209d9+=0x1){_0x2ad6fd=_0x361cf2[_0x5209d9];if(_[_0x2946('0x3a')](_0x519e6c[_0x2946('0x15')][_0x2ad6fd['id']])){_0x519e6c[_0x2946('0x15')][_0x2ad6fd['id']]=new VoiceExtension(_0x2ad6fd);}else{_0x519e6c[_0x2946('0x36')](_0x519e6c[_0x2946('0x15')][_0x2ad6fd['id']],_0x2ad6fd);}}}return _0x519e6c[_0x2946('0x15')];};};Realtime[_0x2946('0x37')][_0x2946('0x61')]=function(){var _0x47c9a0=this;return function(_0x109655){clearCampaigns(_0x47c9a0[_0x2946('0x5d')]);for(var _0x3725db=0x0;_0x3725db<_0x109655['length'];_0x3725db+=0x1){_[_0x2946('0x49')](_0x47c9a0[_0x2946('0x5d')][_0x109655[_0x3725db]['name']],_0x109655[_0x3725db]);}return _0x47c9a0[_0x2946('0x5d')];};};Realtime[_0x2946('0x37')][_0x2946('0x62')]=function(){var _0x3f33a7=this;return function(_0x5ac4d6){if(_0x5ac4d6){freeIsNotKey(_0x5ac4d6,_0x3f33a7['faxAccounts'],'id');for(var _0x293cdf=0x0,_0x24c70e={},_0x56aa93={};_0x293cdf<_0x5ac4d6[_0x2946('0x39')];_0x293cdf+=0x1){_0x24c70e=_0x5ac4d6[_0x293cdf];if(_[_0x2946('0x3a')](_0x3f33a7['faxAccounts'][_0x24c70e['id']])){_0x3f33a7[_0x2946('0x1e')][_0x24c70e['id']]=new FaxAccount(_0x24c70e);}else{_0x3f33a7[_0x2946('0x36')](_0x3f33a7[_0x2946('0x1e')][_0x24c70e['id']],_0x24c70e);}}}return _0x3f33a7[_0x2946('0x1e')];};};module[_0x2946('0x63')]=Realtime; \ No newline at end of file +var _0x6f33=['queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','duration','disposition','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','util','lodash','../model/telephone','../model/trunk','../model/template','../model/voiceExtension','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','SIP/%s','name','hasOwnProperty','isNil','format','total','answered','sumHoldTime','sumBillable','isEmpty','unmanaged','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','interface','initTelephones','initTrunks','isUndefined','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','zendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit'];(function(_0x171ff9,_0x164fc2){var _0x4b0298=function(_0x5a821d){while(--_0x5a821d){_0x171ff9['push'](_0x171ff9['shift']());}};_0x4b0298(++_0x164fc2);}(_0x6f33,0x7a));var _0x36f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f33[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x36f3('0x0'));var util=require(_0x36f3('0x1'));var _=require(_0x36f3('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0x36f3('0x3'));var Trunk=require(_0x36f3('0x4'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require('../model/trigger');var Template=require(_0x36f3('0x5'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0x36f3('0x6'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x36f3('0x7'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x36f3('0x8'));var DeskAccount=require(_0x36f3('0x9'));var VtigerAccount=require(_0x36f3('0xa'));var ServicenowAccount=require(_0x36f3('0xb'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x36f3('0xc'));var FaxAccount=require(_0x36f3('0xd'));var Realtime=function(){this[_0x36f3('0xe')]={};this[_0x36f3('0xf')]={};this[_0x36f3('0x10')]={};this[_0x36f3('0x11')]={};this[_0x36f3('0x12')]={};this[_0x36f3('0x13')]={};this[_0x36f3('0x14')]={};this[_0x36f3('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x36f3('0x16')]={};this[_0x36f3('0x17')]={};this['outboundChannels']={};this[_0x36f3('0x18')]={};this['zendeskAccounts']={};this[_0x36f3('0x19')]={};this[_0x36f3('0x1a')]={};this[_0x36f3('0x1b')]={};this[_0x36f3('0x1c')]={};this[_0x36f3('0x1d')]={};this['vtigerAccounts']={};this[_0x36f3('0x1e')]={};this[_0x36f3('0x1f')]={};this[_0x36f3('0x20')]={};this[_0x36f3('0x21')]={};};function freeIsNotKey(_0x116c49,_0x4d7a92,_0x45b909){var _0x411b0b=_[_0x36f3('0x22')](_0x116c49,function(_0x376216,_0x25805f){return _0x376216[_0x45b909];});for(var _0x2cc9ea in _0x4d7a92){if(_0x4d7a92['hasOwnProperty'](_0x2cc9ea)){if(!_0x411b0b[_0x2cc9ea]){delete _0x4d7a92[_0x2cc9ea];}}}}function freeIsNotKeySip(_0x232fd3,_0x227a29){var _0x7db50e=_[_0x36f3('0x22')](_0x232fd3,function(_0x3cf8a2,_0x5b7281){return util['format'](_0x36f3('0x23'),_0x3cf8a2[_0x36f3('0x24')]);});for(var _0x402dc8 in _0x227a29){if(_0x227a29[_0x36f3('0x25')](_0x402dc8)){if(!_0x7db50e[_0x402dc8]){delete _0x227a29[_0x402dc8];}}}}function freeIsNotKeyAgent(_0x400432,_0xbf3556){var _0x27675d=_['mapKeys'](_0x400432,function(_0x54f131,_0x57d1c2){var _0x496d70=_[_0x36f3('0x26')](_0x54f131['interface'])?util[_0x36f3('0x27')](_0x36f3('0x23'),_0x54f131['name']):_0x54f131['interface'];return _0x496d70;});for(var _0x4325b8 in _0xbf3556){if(_0xbf3556['hasOwnProperty'](_0x4325b8)){if(!_0x27675d[_0x4325b8]){delete _0xbf3556[_0x4325b8];}}}}function clearVoiceCallReports(_0x256f53){_0x256f53[_0x36f3('0x28')]=0x0;_0x256f53[_0x36f3('0x29')]=0x0;_0x256f53[_0x36f3('0x2a')]=0x0;_0x256f53['sumDuration']=0x0;_0x256f53[_0x36f3('0x2b')]=0x0;}function clearCampaigns(_0x5acd45){if(!_[_0x36f3('0x2c')](_0x5acd45)){for(var _0xf04be4 in _0x5acd45){if(_0x5acd45[_0x36f3('0x25')](_0xf04be4)){_0x5acd45[_0xf04be4]['ivrTotalCallsDays']=0x0;_0x5acd45[_0xf04be4]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x405e24){if(!_[_0x36f3('0x2c')](_0x405e24)){for(var _0x1dd545 in _0x405e24){if(_0x405e24[_0x36f3('0x25')](_0x1dd545)){_0x405e24[_0x1dd545][_0x36f3('0x28')]=0x0;_0x405e24[_0x1dd545]['answered']=0x0;_0x405e24[_0x1dd545][_0x36f3('0x2d')]=0x0;_0x405e24[_0x1dd545]['abandoned']=0x0;_0x405e24[_0x1dd545]['sumHoldTime']=0x0;_0x405e24[_0x1dd545][_0x36f3('0x2e')]=0x0;_0x405e24[_0x1dd545][_0x36f3('0x2b')]=0x0;_0x405e24[_0x1dd545][_0x36f3('0x2f')]=0x0;_0x405e24[_0x1dd545][_0x36f3('0x30')]=0x0;_0x405e24[_0x1dd545][_0x36f3('0x31')]=0x0;_0x405e24[_0x1dd545]['outboundCongestionCallsDay']=0x0;_0x405e24[_0x1dd545][_0x36f3('0x32')]=0x0;_0x405e24[_0x1dd545][_0x36f3('0x33')]=0x0;_0x405e24[_0x1dd545][_0x36f3('0x34')]=0x0;_0x405e24[_0x1dd545][_0x36f3('0x35')]=0x0;_0x405e24[_0x1dd545][_0x36f3('0x36')]=0x0;_0x405e24[_0x1dd545][_0x36f3('0x37')]=0x0;_0x405e24[_0x1dd545]['outboundRejectCallsDay']=0x0;_0x405e24[_0x1dd545][_0x36f3('0x38')]=0x0;_0x405e24[_0x1dd545]['outboundAnswerAgiCallsDay']=0x0;_0x405e24[_0x1dd545][_0x36f3('0x39')]=0x0;_0x405e24[_0x1dd545][_0x36f3('0x3a')]=!![];}}}}Realtime[_0x36f3('0x3b')][_0x36f3('0x3c')]=function(_0x4d9acf,_0xf9d484){for(var _0x1ca2a9 in _0xf9d484){if(_0x4d9acf['hasOwnProperty'](_0x1ca2a9)){_0x4d9acf[_0x1ca2a9]=_0xf9d484[_0x1ca2a9];}}};Realtime[_0x36f3('0x3b')][_0x36f3('0x3d')]=function(){var _0x3570f4=this;return function(_0x19e4d8){if(_0x19e4d8){freeIsNotKeyAgent(_0x19e4d8,_0x3570f4[_0x36f3('0xe')]);for(var _0x2e7070=0x0,_0x36f189={},_0x34be00={};_0x2e7070<_0x19e4d8[_0x36f3('0x3e')];_0x2e7070+=0x1){_0x36f189=_0x19e4d8[_0x2e7070];var _0x225e86=_[_0x36f3('0x26')](_0x36f189[_0x36f3('0x3f')])?util[_0x36f3('0x27')](_0x36f3('0x23'),_0x36f189[_0x36f3('0x24')]):_0x36f189[_0x36f3('0x3f')];if(_['isUndefined'](_0x3570f4[_0x36f3('0xe')][_0x225e86])){_0x3570f4['agents'][_0x225e86]=new Agent(_0x36f189);}else{_0x3570f4[_0x36f3('0x3c')](_0x3570f4[_0x36f3('0xe')][_0x225e86],_0x36f189);}}}return _0x3570f4[_0x36f3('0xe')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x40')]=function(){var _0x4211a1=this;return function(_0x1bc0cc){if(_0x1bc0cc){freeIsNotKeySip(_0x1bc0cc,_0x4211a1['telephones']);for(var _0x49b770=0x0,_0x4f6a99={},_0x1365ab={};_0x49b770<_0x1bc0cc[_0x36f3('0x3e')];_0x49b770+=0x1){_0x4f6a99=_0x1bc0cc[_0x49b770];if(_['isUndefined'](_0x4211a1[_0x36f3('0xf')][util[_0x36f3('0x27')](_0x36f3('0x23'),_0x4f6a99['name'])])){_0x4211a1[_0x36f3('0xf')][util['format'](_0x36f3('0x23'),_0x4f6a99['name'])]=new Telephone(_0x4f6a99);}else{_0x4211a1[_0x36f3('0x3c')](_0x4211a1[_0x36f3('0xf')][util[_0x36f3('0x27')]('SIP/%s',_0x4f6a99[_0x36f3('0x24')])],_0x4f6a99);}}}return _0x4211a1[_0x36f3('0xf')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x41')]=function(){var _0xcf49be=this;return function(_0x565c52){if(_0x565c52){freeIsNotKeySip(_0x565c52,_0xcf49be['trunks']);for(var _0x4e790e=0x0,_0x1e8301={},_0x4deca7={};_0x4e790e<_0x565c52[_0x36f3('0x3e')];_0x4e790e+=0x1){_0x1e8301=_0x565c52[_0x4e790e];if(_[_0x36f3('0x42')](_0xcf49be['trunks'][util[_0x36f3('0x27')](_0x36f3('0x23'),_0x1e8301[_0x36f3('0x24')])])){_0xcf49be[_0x36f3('0x10')][util[_0x36f3('0x27')](_0x36f3('0x23'),_0x1e8301[_0x36f3('0x24')])]=new Trunk(_0x1e8301);}else{_0xcf49be['mergeFromDatabase'](_0xcf49be['trunks'][util['format'](_0x36f3('0x23'),_0x1e8301['name'])],_0x1e8301);}}}return _0xcf49be[_0x36f3('0x10')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x43')]=function(){var _0x502c64=this;return function(_0x27cb1c){if(_0x27cb1c){freeIsNotKey(_0x27cb1c,_0x502c64[_0x36f3('0x11')],_0x36f3('0x24'));for(var _0x3ffe2d=0x0,_0x3dcdf2={},_0x2613aa={};_0x3ffe2d<_0x27cb1c[_0x36f3('0x3e')];_0x3ffe2d+=0x1){_0x3dcdf2=_0x27cb1c[_0x3ffe2d];if(_[_0x36f3('0x42')](_0x502c64[_0x36f3('0x11')][_0x3dcdf2[_0x36f3('0x24')]])){_0x502c64[_0x36f3('0x11')][_0x3dcdf2[_0x36f3('0x24')]]=new VoiceQueue(_0x3dcdf2);}else{_0x502c64[_0x36f3('0x3c')](_0x502c64['voiceQueues'][_0x3dcdf2[_0x36f3('0x24')]],_0x3dcdf2);}}}return _0x502c64[_0x36f3('0x11')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x44')]=function(){var _0x1e493e=this;return function(_0x20302d){if(_0x20302d){freeIsNotKey(_0x20302d,_0x1e493e[_0x36f3('0x12')],'id');for(var _0x345312=0x0,_0x92e06f={},_0x529ede={};_0x345312<_0x20302d[_0x36f3('0x3e')];_0x345312+=0x1){_0x92e06f=_0x20302d[_0x345312];if(_[_0x36f3('0x42')](_0x1e493e[_0x36f3('0x12')][_0x92e06f['id']])){_0x1e493e[_0x36f3('0x12')][_0x92e06f['id']]=new Trigger(_0x92e06f);}else{_0x1e493e[_0x36f3('0x3c')](_0x1e493e[_0x36f3('0x12')][_0x92e06f['id']],_0x92e06f);}}}return _0x1e493e[_0x36f3('0x12')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x45')]=function(){var _0x477cf6=this;return function(_0x1455d9){if(_0x1455d9){freeIsNotKey(_0x1455d9,_0x477cf6[_0x36f3('0x14')],'id');for(var _0x15f102=0x0,_0x2a76c7={},_0x24e2c8={};_0x15f102<_0x1455d9[_0x36f3('0x3e')];_0x15f102+=0x1){_0x2a76c7=_0x1455d9[_0x15f102];if(_[_0x36f3('0x42')](_0x477cf6[_0x36f3('0x14')][_0x2a76c7['id']])){_0x477cf6[_0x36f3('0x14')][_0x2a76c7['id']]=new Template(_0x2a76c7);}else{_0x477cf6['mergeFromDatabase'](_0x477cf6[_0x36f3('0x14')][_0x2a76c7['id']],_0x2a76c7);}}}return _0x477cf6[_0x36f3('0x14')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x46')]=function(){var _0x27810f=this;return function(_0x5e16b0){if(_0x5e16b0){freeIsNotKey(_0x5e16b0,_0x27810f[_0x36f3('0x47')],'id');for(var _0x57aa8a=0x0,_0x1e6458={},_0x29d7ac={};_0x57aa8a<_0x5e16b0['length'];_0x57aa8a+=0x1){_0x1e6458=_0x5e16b0[_0x57aa8a];if(_[_0x36f3('0x42')](_0x27810f[_0x36f3('0x47')][_0x1e6458['id']])){_0x27810f[_0x36f3('0x47')][_0x1e6458['id']]=new ZendeskAccount(_0x1e6458);}else{_0x27810f[_0x36f3('0x3c')](_0x27810f['zendeskAccounts'][_0x1e6458['id']],_0x1e6458);}}}return _0x27810f[_0x36f3('0x47')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x48')]=function(){var _0x3885e1=this;return function(_0x1f7d17){if(_0x1f7d17){freeIsNotKey(_0x1f7d17,_0x3885e1[_0x36f3('0x19')],'id');for(var _0x2c5ab4=0x0,_0x425bc3={},_0x2c9fc4={};_0x2c5ab4<_0x1f7d17['length'];_0x2c5ab4+=0x1){_0x425bc3=_0x1f7d17[_0x2c5ab4];if(_[_0x36f3('0x42')](_0x3885e1[_0x36f3('0x19')][_0x425bc3['id']])){_0x3885e1[_0x36f3('0x19')][_0x425bc3['id']]=new SalesforceAccount(_0x425bc3);}else{_0x3885e1[_0x36f3('0x3c')](_0x3885e1[_0x36f3('0x19')][_0x425bc3['id']],_0x425bc3);}}}return _0x3885e1[_0x36f3('0x19')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x49')]=function(){var _0x2473b9=this;return function(_0x334fdf){if(_0x334fdf){freeIsNotKey(_0x334fdf,_0x2473b9['freshdeskAccounts'],'id');for(var _0x19df80=0x0,_0x568312={},_0x231fe7={};_0x19df80<_0x334fdf[_0x36f3('0x3e')];_0x19df80+=0x1){_0x568312=_0x334fdf[_0x19df80];if(_[_0x36f3('0x42')](_0x2473b9['freshdeskAccounts'][_0x568312['id']])){_0x2473b9[_0x36f3('0x1b')][_0x568312['id']]=new FreshdeskAccount(_0x568312);}else{_0x2473b9[_0x36f3('0x3c')](_0x2473b9[_0x36f3('0x1b')][_0x568312['id']],_0x568312);}}}return _0x2473b9[_0x36f3('0x1b')];};};Realtime[_0x36f3('0x3b')]['initZohoAccounts']=function(){var _0x1d152c=this;return function(_0x4cf2be){if(_0x4cf2be){freeIsNotKey(_0x4cf2be,_0x1d152c[_0x36f3('0x1c')],'id');for(var _0x3b14d6=0x0,_0x543f50={},_0x9451c0={};_0x3b14d6<_0x4cf2be[_0x36f3('0x3e')];_0x3b14d6+=0x1){_0x543f50=_0x4cf2be[_0x3b14d6];if(_[_0x36f3('0x42')](_0x1d152c[_0x36f3('0x1c')][_0x543f50['id']])){_0x1d152c[_0x36f3('0x1c')][_0x543f50['id']]=new ZohoAccount(_0x543f50);}else{_0x1d152c[_0x36f3('0x3c')](_0x1d152c['zohoAccounts'][_0x543f50['id']],_0x543f50);}}}return _0x1d152c[_0x36f3('0x1c')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x4a')]=function(){var _0x42a825=this;return function(_0x45d542){if(_0x45d542){freeIsNotKey(_0x45d542,_0x42a825['deskAccounts'],'id');for(var _0x211e71=0x0,_0x1e6362={},_0x4f5606={};_0x211e71<_0x45d542[_0x36f3('0x3e')];_0x211e71+=0x1){_0x1e6362=_0x45d542[_0x211e71];if(_[_0x36f3('0x42')](_0x42a825['deskAccounts'][_0x1e6362['id']])){_0x42a825[_0x36f3('0x1d')][_0x1e6362['id']]=new DeskAccount(_0x1e6362);}else{_0x42a825['mergeFromDatabase'](_0x42a825[_0x36f3('0x1d')][_0x1e6362['id']],_0x1e6362);}}}return _0x42a825['deskAccounts'];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x4b')]=function(){var _0x35303e=this;return function(_0x433a19){if(_0x433a19){freeIsNotKey(_0x433a19,_0x35303e['sugarcrmAccounts'],'id');for(var _0x196130=0x0,_0x3d8dc8={},_0x141f77={};_0x196130<_0x433a19[_0x36f3('0x3e')];_0x196130+=0x1){_0x3d8dc8=_0x433a19[_0x196130];if(_[_0x36f3('0x42')](_0x35303e[_0x36f3('0x1a')][_0x3d8dc8['id']])){_0x35303e['sugarcrmAccounts'][_0x3d8dc8['id']]=new SugarcrmAccount(_0x3d8dc8);}else{_0x35303e[_0x36f3('0x3c')](_0x35303e[_0x36f3('0x1a')][_0x3d8dc8['id']],_0x3d8dc8);}}}return _0x35303e[_0x36f3('0x1a')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x4c')]=function(){var _0x47e82a=this;return function(_0x6d2744){if(_0x6d2744){freeIsNotKey(_0x6d2744,_0x47e82a[_0x36f3('0x4d')],'id');for(var _0x1cd751=0x0,_0x2db38b={},_0x941d43={};_0x1cd751<_0x6d2744['length'];_0x1cd751+=0x1){_0x2db38b=_0x6d2744[_0x1cd751];if(_[_0x36f3('0x42')](_0x47e82a['vtigerAccounts'][_0x2db38b['id']])){_0x47e82a['vtigerAccounts'][_0x2db38b['id']]=new VtigerAccount(_0x2db38b);}else{_0x47e82a[_0x36f3('0x3c')](_0x47e82a[_0x36f3('0x4d')][_0x2db38b['id']],_0x2db38b);}}}return _0x47e82a['vtigerAccounts'];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x4e')]=function(){var _0x155126=this;return function(_0x54a9b0){if(_0x54a9b0){freeIsNotKey(_0x54a9b0,_0x155126[_0x36f3('0x1e')],'id');for(var _0x2ec6c2=0x0,_0x241835={},_0x5907e8={};_0x2ec6c2<_0x54a9b0['length'];_0x2ec6c2+=0x1){_0x241835=_0x54a9b0[_0x2ec6c2];if(_[_0x36f3('0x42')](_0x155126[_0x36f3('0x1e')][_0x241835['id']])){_0x155126[_0x36f3('0x1e')][_0x241835['id']]=new ServicenowAccount(_0x241835);}else{_0x155126[_0x36f3('0x3c')](_0x155126[_0x36f3('0x1e')][_0x241835['id']],_0x241835);}}}return _0x155126[_0x36f3('0x1e')];};};Realtime[_0x36f3('0x3b')]['initDynamics365Accounts']=function(){var _0x174ae6=this;return function(_0x4560e3){if(_0x4560e3){freeIsNotKey(_0x4560e3,_0x174ae6['dynamics365Accounts'],'id');for(var _0xc07910=0x0,_0x3db555={},_0x3c3168={};_0xc07910<_0x4560e3[_0x36f3('0x3e')];_0xc07910+=0x1){_0x3db555=_0x4560e3[_0xc07910];if(_[_0x36f3('0x42')](_0x174ae6[_0x36f3('0x1f')][_0x3db555['id']])){_0x174ae6[_0x36f3('0x1f')][_0x3db555['id']]=new Dynamics365Account(_0x3db555);}else{_0x174ae6['mergeFromDatabase'](_0x174ae6[_0x36f3('0x1f')][_0x3db555['id']],_0x3db555);}}}return _0x174ae6[_0x36f3('0x1f')];};};Realtime['prototype'][_0x36f3('0x4f')]=function(){var _0xd2c43b=this;return function(_0x12d24c){if(_0x12d24c){freeIsNotKey(_0x12d24c,_0xd2c43b[_0x36f3('0x20')],'id');for(var _0x449044=0x0,_0x31b2e0={},_0x471b1d={};_0x449044<_0x12d24c[_0x36f3('0x3e')];_0x449044+=0x1){_0x31b2e0=_0x12d24c[_0x449044];if(_['isUndefined'](_0xd2c43b['freshsalesAccounts'][_0x31b2e0['id']])){_0xd2c43b['freshsalesAccounts'][_0x31b2e0['id']]=new FreshsalesAccount(_0x31b2e0);}else{_0xd2c43b['mergeFromDatabase'](_0xd2c43b[_0x36f3('0x20')][_0x31b2e0['id']],_0x31b2e0);}}}return _0xd2c43b[_0x36f3('0x20')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x50')]=function(){var _0x3ac3bf=this;return function(_0x3660d8){for(var _0x2b569c=0x0;_0x2b569c<_0x3660d8[_0x36f3('0x3e')];_0x2b569c+=0x1){_[_0x36f3('0x51')](_0x3ac3bf['voiceQueues'][_0x3660d8[_0x2b569c][_0x36f3('0x24')]],_0x3660d8[_0x2b569c]);}return _0x3ac3bf[_0x36f3('0x11')];};};Realtime['prototype'][_0x36f3('0x52')]=function(){var _0x6991ac=this;return function(_0x1a7d59){clearVoiceQueues(_0x6991ac[_0x36f3('0x11')]);if(_0x1a7d59){_0x1a7d59=_['groupBy'](_0x1a7d59,_0x36f3('0x53'));for(var _0x3734ce in _0x1a7d59){if(_0x1a7d59['hasOwnProperty'](_0x3734ce)){var _0x4c386d={};for(var _0x3a5c24=0x0;_0x3a5c24<_0x1a7d59[_0x3734ce][_0x36f3('0x3e')];_0x3a5c24+=0x1){var _0x3a27f9=_0x1a7d59[_0x3734ce][_0x3a5c24][_0x36f3('0x54')];if(_0x6991ac[_0x36f3('0x11')][_0x3a27f9]){if(_0x1a7d59[_0x3734ce][_0x3a5c24][_0x36f3('0x55')]){_0x6991ac[_0x36f3('0x11')][_0x3a27f9][_0x36f3('0x2d')]+=0x1;}if(_0x1a7d59[_0x3734ce][_0x3a5c24][_0x36f3('0x56')]){_0x6991ac[_0x36f3('0x11')][_0x3a27f9][_0x36f3('0x57')]+=0x1;}_0x6991ac['voiceQueues'][_0x3a27f9]['sumHoldTime']+=moment(_0x1a7d59[_0x3734ce][_0x3a5c24][_0x36f3('0x58')])[_0x36f3('0x59')](moment(_0x1a7d59[_0x3734ce][_0x3a5c24][_0x36f3('0x5a')]),_0x36f3('0x5b'))||0x0;if(_0x3a5c24===_0x1a7d59[_0x3734ce][_0x36f3('0x3e')]-0x1){_0x6991ac[_0x36f3('0x11')][_0x3a27f9][_0x36f3('0x2e')]+=moment(_0x1a7d59[_0x3734ce][_0x3a5c24][_0x36f3('0x5c')]||_0x1a7d59[_0x3734ce][_0x3a5c24][_0x36f3('0x5d')]||_0x1a7d59[_0x3734ce][_0x3a5c24]['queuecallerexitAt'])['diff'](moment(_0x1a7d59[_0x3734ce][_0x3a5c24][_0x36f3('0x5a')]),_0x36f3('0x5b'))||0x0;_0x6991ac['voiceQueues'][_0x3a27f9][_0x36f3('0x28')]+=0x1;if(_0x1a7d59[_0x3734ce][_0x3a5c24][_0x36f3('0x5e')]){_0x6991ac['voiceQueues'][_0x3a27f9][_0x36f3('0x29')]+=0x1;_0x6991ac[_0x36f3('0x11')][_0x3a27f9][_0x36f3('0x2b')]+=moment(_0x1a7d59[_0x3734ce][_0x3a5c24][_0x36f3('0x5c')])[_0x36f3('0x59')](moment(_0x1a7d59[_0x3734ce][_0x3a5c24][_0x36f3('0x58')]),_0x36f3('0x5b'))||0x0;}}else{_0x6991ac[_0x36f3('0x11')][_0x3a27f9][_0x36f3('0x2e')]+=_0x6991ac['voiceQueues'][_0x3a27f9][_0x36f3('0x2a')]||0x0;}}}}}}return _0x6991ac['voiceQueues'];};};Realtime[_0x36f3('0x3b')]['initVoiceCallReports']=function(){var _0xf667d=this;return function(_0x4191c1){clearVoiceCallReports(_0xf667d[_0x36f3('0x15')]);if(_0x4191c1){for(var _0x5390a8=0x0;_0x5390a8<_0x4191c1['length'];_0x5390a8+=0x1){_0xf667d[_0x36f3('0x15')][_0x36f3('0x28')]+=0x1;_0xf667d[_0x36f3('0x15')][_0x36f3('0x2e')]+=_0x4191c1[_0x5390a8][_0x36f3('0x5f')];if(_0x4191c1[_0x5390a8][_0x36f3('0x60')]==='ANSWERED'){_0xf667d[_0x36f3('0x15')][_0x36f3('0x29')]+=0x1;_0xf667d['outbound'][_0x36f3('0x2a')]+=_0x4191c1[_0x5390a8][_0x36f3('0x5f')]-_0x4191c1[_0x5390a8][_0x36f3('0x61')]||0x0;_0xf667d[_0x36f3('0x15')]['sumBillable']+=_0x4191c1[_0x5390a8]['billableseconds'];}}}return _0xf667d[_0x36f3('0x15')];};};Realtime['prototype'][_0x36f3('0x62')]=function(){var _0x851f5a=this;return function(_0x4cdee5){if(_0x4cdee5){freeIsNotKey(_0x4cdee5,_0x851f5a[_0x36f3('0x13')],_0x36f3('0x24'));for(var _0x1802aa=0x0,_0x1624ce={};_0x1802aa<_0x4cdee5[_0x36f3('0x3e')];_0x1802aa+=0x1){_0x1624ce=_0x4cdee5[_0x1802aa];if(_[_0x36f3('0x42')](_0x851f5a[_0x36f3('0x13')][_0x1624ce[_0x36f3('0x24')]])){_0x851f5a[_0x36f3('0x13')][_0x1624ce[_0x36f3('0x24')]]=new Campaign(_0x1624ce);}else{_0x851f5a[_0x36f3('0x3c')](_0x851f5a[_0x36f3('0x13')][_0x1624ce[_0x36f3('0x24')]],_0x1624ce);_0x851f5a[_0x36f3('0x13')][_0x1624ce[_0x36f3('0x24')]]['dialQueueProject']=_0x1624ce[_0x36f3('0x63')]?_0x1624ce[_0x36f3('0x63')][_0x36f3('0x24')]:undefined;}}}return _0x851f5a[_0x36f3('0x13')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x64')]=function(){var _0x523a07=this;return function(_0x5570f8){if(_0x5570f8){freeIsNotKey(_0x5570f8,_0x523a07['voiceExtensions'],'id');for(var _0x3c603f=0x0,_0x451216={};_0x3c603f<_0x5570f8[_0x36f3('0x3e')];_0x3c603f+=0x1){_0x451216=_0x5570f8[_0x3c603f];if(_[_0x36f3('0x42')](_0x523a07['voiceExtensions'][_0x451216['id']])){_0x523a07['voiceExtensions'][_0x451216['id']]=new VoiceExtension(_0x451216);}else{_0x523a07[_0x36f3('0x3c')](_0x523a07[_0x36f3('0x65')][_0x451216['id']],_0x451216);}}}return _0x523a07[_0x36f3('0x65')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x66')]=function(){var _0x5ee95c=this;return function(_0x5d7fa0){clearCampaigns(_0x5ee95c['campaigns']);for(var _0x7b1db7=0x0;_0x7b1db7<_0x5d7fa0[_0x36f3('0x3e')];_0x7b1db7+=0x1){_[_0x36f3('0x51')](_0x5ee95c[_0x36f3('0x13')][_0x5d7fa0[_0x7b1db7][_0x36f3('0x24')]],_0x5d7fa0[_0x7b1db7]);}return _0x5ee95c[_0x36f3('0x13')];};};Realtime[_0x36f3('0x3b')][_0x36f3('0x67')]=function(){var _0x634fad=this;return function(_0x16111b){if(_0x16111b){freeIsNotKey(_0x16111b,_0x634fad[_0x36f3('0x21')],'id');for(var _0xdecce7=0x0,_0x55d724={},_0x5c255e={};_0xdecce7<_0x16111b['length'];_0xdecce7+=0x1){_0x55d724=_0x16111b[_0xdecce7];if(_[_0x36f3('0x42')](_0x634fad[_0x36f3('0x21')][_0x55d724['id']])){_0x634fad[_0x36f3('0x21')][_0x55d724['id']]=new FaxAccount(_0x55d724);}else{_0x634fad[_0x36f3('0x3c')](_0x634fad['faxAccounts'][_0x55d724['id']],_0x55d724);}}}return _0x634fad[_0x36f3('0x21')];};};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 0c0293a..04843f8 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 _0x380a=['lastdata','context','from-voip-provider','callerid','from-sip','calleridpreview','calleridnum','destinationchannel','channel','originatecalleridnum','ANSWERED','calleridname','monitor','length','monitorFilename','monitors','filename','createdAt','xcally-motion-preview','connectedlinenum','membername','isArray','forEach','startsWith','Local','substring','indexOf','lastIndexOf','exports','bluebird','lodash','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','bind','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','interface','format','SIP/%s','lastAssignedTo','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue'];(function(_0x119fd8,_0x3c123b){var _0x51afea=function(_0x4a3be9){while(--_0x4a3be9){_0x119fd8['push'](_0x119fd8['shift']());}};_0x51afea(++_0x3c123b);}(_0x380a,0xc5));var _0xa380=function(_0x1b3251,_0x58f958){_0x1b3251=_0x1b3251-0x0;var _0x370769=_0x380a[_0x1b3251];return _0x370769;};'use strict';var BPromise=require(_0xa380('0x0'));var _=require(_0xa380('0x1'));var moment=require('moment');var util=require('util');var config=require(_0xa380('0x2'));var logger=require(_0xa380('0x3'))(_0xa380('0x4'));var ami=require(_0xa380('0x5'));var RpcVoiceAgentReport=require(_0xa380('0x6'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xa380('0x7'));var RpcMemberReport=require(_0xa380('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xa380('0x9'));var RpcVoiceTransferReport=require(_0xa380('0xa'));var VoiceQueueReport=require(_0xa380('0xb'));var VoiceCallReport=require(_0xa380('0xc'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xa380('0xd'));var UserReport=require(_0xa380('0xe'));function Report(_0x2dd5c3){this[_0xa380('0xf')]=_0x2dd5c3;this[_0xa380('0x10')]=_0x2dd5c3['agents'];this[_0xa380('0x11')]=_0x2dd5c3[_0xa380('0x11')];}Report[_0xa380('0x12')][_0xa380('0x13')]=function(_0xd2b528){var _0x198ce9=new VoiceQueueReport(this[_0xa380('0xf')]);var _0x30d8c0=new VoiceAgentReport(this[_0xa380('0xf')]);var _0x1a36c6=new VoiceDialReport(this[_0xa380('0xf')]);var _0x5976ff=new VoiceCallReport(this[_0xa380('0xf')]);var _0xf6138=new UserReport(this[_0xa380('0xf')]);if(config[_0xa380('0x14')]&&config[_0xa380('0x14')][_0xa380('0x15')]){ami['on'](_0xa380('0x16'),this[_0xa380('0x17')]['bind'](this));ami['on'](_0xa380('0x18'),this[_0xa380('0x19')]['bind'](this));ami['on'](_0xa380('0x1a'),this['voiceAgentReport'][_0xa380('0x1b')](this));ami['on'](_0xa380('0x1c'),this[_0xa380('0x1d')][_0xa380('0x1b')](this));ami['on'](_0xa380('0x1e'),this[_0xa380('0x1f')][_0xa380('0x1b')](this));ami['on'](_0xa380('0x20'),this[_0xa380('0x21')][_0xa380('0x1b')](this));}};Report[_0xa380('0x12')][_0xa380('0x22')]=function(_0x227e28){var _0x2d440d=undefined;_0x2d440d=_[_0xa380('0x23')](this[_0xa380('0x10')],function(_0x40c71b){return _0x40c71b[_0xa380('0x24')]==_0x227e28||_0x40c71b[_0xa380('0x25')]==_0x227e28;});if(_['isNil'](_0x2d440d)){var _0x40d1c9=_[_0xa380('0x23')](this[_0xa380('0x11')],function(_0x578295){return _0x578295['accountcode']==_0x227e28||_0x578295[_0xa380('0x25')]==_0x227e28;});if(_0x40d1c9){_0x2d440d=_[_0xa380('0x23')](this[_0xa380('0x10')],function(_0x261411){return _0x261411[_0xa380('0x26')]==util[_0xa380('0x27')](_0xa380('0x28'),_0x40d1c9[_0xa380('0x25')]);});}}return _0x2d440d;};Report[_0xa380('0x12')][_0xa380('0x17')]=function(_0x5e04a4){for(var _0x1b8b88=0x0;_0x1b8b88<_0x5e04a4['length'];_0x1b8b88+=0x1){var _0x5d1fda=this['findAgent'](_0x5e04a4[_0x1b8b88]['connectedlinenum']);if(_0x5d1fda){_0x5e04a4[_0x1b8b88][_0xa380('0x24')]=_0x5d1fda['accountcode'];_0x5e04a4[_0x1b8b88]['assigned']=!![];_0x5e04a4[_0x1b8b88][_0xa380('0x29')]=_0x5d1fda[_0xa380('0x25')];_0x5e04a4[_0x1b8b88][_0xa380('0x26')]=_[_0xa380('0x2a')](_0x5d1fda[_0xa380('0x26')])?util[_0xa380('0x27')](_0xa380('0x28'),_0x5d1fda[_0xa380('0x25')]):_0x5d1fda[_0xa380('0x26')];if(_0x5e04a4[_0x1b8b88][_0xa380('0x2b')]){_0x5e04a4[_0x1b8b88][_0xa380('0x2c')]=moment()[_0xa380('0x27')](_0xa380('0x2d'));}if(_0x5e04a4[_0x1b8b88]['queuecallerexit']){_0x5e04a4[_0x1b8b88][_0xa380('0x2e')]=moment()[_0xa380('0x27')](_0xa380('0x2d'));}RpcMemberReport[_0xa380('0x17')](_0x5e04a4[_0x1b8b88]);}RpcVoiceQueueReport[_0xa380('0x2f')](_0x5e04a4[_0x1b8b88]);}};function extractCalleridNumber(_0x2f17f9){var _0x18bba0=_0x2f17f9[_0xa380('0x30')](/<(.*?)>/);return _0x18bba0?_0x18bba0[0x1]:_0x2f17f9;}Report[_0xa380('0x12')][_0xa380('0x19')]=function(_0x3766f0){_0x3766f0[_0xa380('0x31')]=_0x3766f0[_0xa380('0x31')]||_0x3766f0[_0xa380('0x32')];if(_0x3766f0[_0xa380('0x33')]==_0xa380('0x34')){_0x3766f0[_0xa380('0x35')]=_0xa380('0x36');_0x3766f0[_0xa380('0x37')]=_0x3766f0[_0xa380('0x36')];if(_0x3766f0[_0xa380('0x38')]==_0xa380('0x39')){_0x3766f0[_0xa380('0x24')]='';_0x3766f0[_0xa380('0x31')]=extractCalleridNumber(_0x3766f0[_0xa380('0x3a')]);}else if(_0x3766f0[_0xa380('0x38')]==_0xa380('0x3b')){if(_0x3766f0[_0xa380('0x31')]=='xcally-motion-preview'){_0x3766f0['destination']=extractCalleridNumber(_0x3766f0[_0xa380('0x3c')]);_0x3766f0[_0xa380('0x3d')]=_0x3766f0['originatecalleridnum'];_0x3766f0[_0xa380('0x3e')]=[_0x3766f0[_0xa380('0x3f')],_0x3766f0['channel']=_0x3766f0[_0xa380('0x3e')]][0x0];_0x3766f0[_0xa380('0x3a')]=_0x3766f0[_0xa380('0x3c')];}else{_0x3766f0[_0xa380('0x31')]=_0x3766f0['calleridnum'];_0x3766f0['calleridnum']=_0x3766f0[_0xa380('0x40')];if(_0x3766f0['disposition']==_0xa380('0x41')){_0x3766f0[_0xa380('0x24')]=_0x3766f0['connectedlinenum'];}else{_0x3766f0[_0xa380('0x24')]='';}}}}else{_0x3766f0[_0xa380('0x3a')]=util['format']('\x22%s\x22\x20<%s>',_0x3766f0[_0xa380('0x42')],_0x3766f0[_0xa380('0x3d')]);}RpcVoiceCallReport[_0xa380('0x2f')](_0x3766f0);if(_0x3766f0[_0xa380('0x43')]){for(var _0x13e9ef=0x0;_0x13e9ef<_0x3766f0['monitors'][_0xa380('0x44')];_0x13e9ef+=0x1){_0x3766f0[_0xa380('0x45')]=_0x3766f0[_0xa380('0x46')][_0x13e9ef][_0xa380('0x47')];_0x3766f0[_0xa380('0x48')]=_0x3766f0[_0xa380('0x46')][_0x13e9ef][_0xa380('0x48')];if(_0x3766f0[_0xa380('0x32')]==_0xa380('0x49')){_0x3766f0[_0xa380('0x3d')]=_0x3766f0[_0xa380('0x4a')];_0x3766f0[_0xa380('0x42')]=_0x3766f0['connectedlinename'];_0x3766f0[_0xa380('0x4a')]=_0x3766f0[_0xa380('0x24')];_0x3766f0['connectedlinename']=_0x3766f0[_0xa380('0x4b')];_0x3766f0[_0xa380('0x32')]=_0x3766f0['originatecalleridnum'];}else if(_0x3766f0['exten']=='xcally-motion-dialer'){_0x3766f0[_0xa380('0x3d')]=_0x3766f0[_0xa380('0x31')];_0x3766f0[_0xa380('0x32')]=_0x3766f0[_0xa380('0x40')];}RpcVoiceRecording['create'](_0x3766f0);}}};Report[_0xa380('0x12')]['voiceAgentReport']=function(_0x2dbc64){if(_[_0xa380('0x4c')](_0x2dbc64)){_0x2dbc64[_0xa380('0x4d')](function(_0x48d1a8){RpcVoiceAgentReport[_0xa380('0x2f')](_0x48d1a8);});}else{RpcVoiceAgentReport[_0xa380('0x2f')](_0x2dbc64);}};Report[_0xa380('0x12')]['voiceDialReport']=function(_0x47c40c){RpcVoiceDialReport[_0xa380('0x2f')](_0x47c40c);var _0x353a37=undefined;var _0x289784=_0x47c40c[_0xa380('0x3f')];if(_[_0xa380('0x4e')](_0x289784,_0xa380('0x4f'))){var _0x194919=_0x289784[_0xa380('0x50')](_0x289784[_0xa380('0x51')]('/')+0x1,_0x289784[_0xa380('0x51')]('@'));_0x353a37=_[_0xa380('0x23')](this[_0xa380('0x10')],function(_0x4092a2){return _0x4092a2['mobile']==_0x194919||_0x4092a2['phone']==_0x194919||_0x4092a2[_0xa380('0x24')]==_0x194919;});}else{var _0x194919=_0x289784[_0xa380('0x50')](_0x289784[_0xa380('0x51')]('/')+0x1,_0x289784[_0xa380('0x52')]('-'));_0x353a37=this[_0xa380('0x22')](_0x194919);}if(_0x353a37){_0x47c40c['interface']=_['isNil'](_0x353a37['interface'])?util['format'](_0xa380('0x28'),_0x353a37['name']):_0x353a37[_0xa380('0x26')];_0x47c40c[_0xa380('0x4b')]=_0x353a37[_0xa380('0x25')];_0x47c40c['accountcode']=_0x353a37[_0xa380('0x24')];RpcMemberReport[_0xa380('0x1d')](_0x47c40c);}};Report[_0xa380('0x12')][_0xa380('0x1f')]=function(_0x542dfe){RpcVoiceTransferReport[_0xa380('0x1f')](_0x542dfe);};Report[_0xa380('0x12')][_0xa380('0x21')]=function(_0x4e9b4c){RpcVoiceTransferReport[_0xa380('0x21')](_0x4e9b4c);};module[_0xa380('0x53')]=Report; \ No newline at end of file +var _0xbd09=['destination','exten','type','dialer','queue','context','callerid','from-sip','calleridpreview','originatecalleridnum','channel','destinationchannel','calleridnum','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','substring','mobile','phone','indexOf','lastIndexOf','exports','bluebird','lodash','moment','../../../config/environment','../../../config/logger','ami','../ami','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','prototype','findAgent','find','accountcode','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','match'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xbd09,0x1cb));var _0x9bd0=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xbd09[_0x110c3d];return _0x226d67;};'use strict';var BPromise=require(_0x9bd0('0x0'));var _=require(_0x9bd0('0x1'));var moment=require(_0x9bd0('0x2'));var util=require('util');var config=require(_0x9bd0('0x3'));var logger=require(_0x9bd0('0x4'))(_0x9bd0('0x5'));var ami=require(_0x9bd0('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x9bd0('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x9bd0('0x8'));var RpcVoiceTransferReport=require(_0x9bd0('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x9bd0('0xa'));var VoiceAgentReport=require(_0x9bd0('0xb'));var VoiceDialReport=require(_0x9bd0('0xc'));var UserReport=require(_0x9bd0('0xd'));function Report(_0x2ac2fc){this[_0x9bd0('0xe')]=_0x2ac2fc;this[_0x9bd0('0xf')]=_0x2ac2fc['agents'];this[_0x9bd0('0x10')]=_0x2ac2fc[_0x9bd0('0x10')];}Report['prototype'][_0x9bd0('0x11')]=function(_0x9dd4e){var _0x403dd1=new VoiceQueueReport(this[_0x9bd0('0xe')]);var _0x1cae26=new VoiceAgentReport(this[_0x9bd0('0xe')]);var _0x4500bf=new VoiceDialReport(this[_0x9bd0('0xe')]);var _0x316197=new VoiceCallReport(this[_0x9bd0('0xe')]);var _0xb75cbf=new UserReport(this[_0x9bd0('0xe')]);if(config[_0x9bd0('0x12')]&&config['xdr'][_0x9bd0('0x13')]){ami['on'](_0x9bd0('0x14'),this[_0x9bd0('0x15')][_0x9bd0('0x16')](this));ami['on'](_0x9bd0('0x17'),this[_0x9bd0('0x18')][_0x9bd0('0x16')](this));ami['on'](_0x9bd0('0x19'),this[_0x9bd0('0x1a')][_0x9bd0('0x16')](this));ami['on'](_0x9bd0('0x1b'),this[_0x9bd0('0x1c')][_0x9bd0('0x16')](this));ami['on']('blindtransfer',this[_0x9bd0('0x1d')][_0x9bd0('0x16')](this));ami['on'](_0x9bd0('0x1e'),this[_0x9bd0('0x1f')][_0x9bd0('0x16')](this));}};Report[_0x9bd0('0x20')][_0x9bd0('0x21')]=function(_0x2512d3){var _0xdb271=undefined;_0xdb271=_[_0x9bd0('0x22')](this[_0x9bd0('0xf')],function(_0x546a60){return _0x546a60[_0x9bd0('0x23')]==_0x2512d3||_0x546a60['name']==_0x2512d3;});if(_['isNil'](_0xdb271)){var _0x41e933=_[_0x9bd0('0x22')](this[_0x9bd0('0x10')],function(_0x3eb507){return _0x3eb507[_0x9bd0('0x23')]==_0x2512d3||_0x3eb507[_0x9bd0('0x24')]==_0x2512d3;});if(_0x41e933){_0xdb271=_[_0x9bd0('0x22')](this['agents'],function(_0xd2f4f6){return _0xd2f4f6[_0x9bd0('0x25')]==util[_0x9bd0('0x26')](_0x9bd0('0x27'),_0x41e933['name']);});}}return _0xdb271;};Report[_0x9bd0('0x20')][_0x9bd0('0x15')]=function(_0x1d9d9f){for(var _0x513741=0x0;_0x513741<_0x1d9d9f[_0x9bd0('0x28')];_0x513741+=0x1){var _0x13c7ba=this[_0x9bd0('0x21')](_0x1d9d9f[_0x513741][_0x9bd0('0x29')]);if(_0x13c7ba){_0x1d9d9f[_0x513741][_0x9bd0('0x23')]=_0x13c7ba[_0x9bd0('0x23')];_0x1d9d9f[_0x513741][_0x9bd0('0x2a')]=!![];_0x1d9d9f[_0x513741][_0x9bd0('0x2b')]=_0x13c7ba[_0x9bd0('0x24')];_0x1d9d9f[_0x513741][_0x9bd0('0x25')]=_[_0x9bd0('0x2c')](_0x13c7ba['interface'])?util[_0x9bd0('0x26')](_0x9bd0('0x27'),_0x13c7ba[_0x9bd0('0x24')]):_0x13c7ba[_0x9bd0('0x25')];if(_0x1d9d9f[_0x513741][_0x9bd0('0x2d')]){_0x1d9d9f[_0x513741][_0x9bd0('0x2e')]=moment()[_0x9bd0('0x26')](_0x9bd0('0x2f'));}if(_0x1d9d9f[_0x513741]['queuecallerexit']){_0x1d9d9f[_0x513741][_0x9bd0('0x30')]=moment()[_0x9bd0('0x26')](_0x9bd0('0x2f'));}RpcMemberReport[_0x9bd0('0x15')](_0x1d9d9f[_0x513741]);}RpcVoiceQueueReport[_0x9bd0('0x31')](_0x1d9d9f[_0x513741]);}};function extractCalleridNumber(_0x57f8e0){var _0x380eb9=_0x57f8e0[_0x9bd0('0x32')](/<(.*?)>/);return _0x380eb9?_0x380eb9[0x1]:_0x57f8e0;}Report[_0x9bd0('0x20')]['voiceCallReport']=function(_0x22f32f){_0x22f32f[_0x9bd0('0x33')]=_0x22f32f[_0x9bd0('0x33')]||_0x22f32f[_0x9bd0('0x34')];if(_0x22f32f[_0x9bd0('0x35')]==_0x9bd0('0x36')){_0x22f32f['lastapplication']='queue';_0x22f32f['lastdata']=_0x22f32f[_0x9bd0('0x37')];if(_0x22f32f[_0x9bd0('0x38')]=='from-voip-provider'){_0x22f32f[_0x9bd0('0x23')]='';_0x22f32f[_0x9bd0('0x33')]=extractCalleridNumber(_0x22f32f[_0x9bd0('0x39')]);}else if(_0x22f32f[_0x9bd0('0x38')]==_0x9bd0('0x3a')){if(_0x22f32f['destination']=='xcally-motion-preview'){_0x22f32f[_0x9bd0('0x33')]=extractCalleridNumber(_0x22f32f[_0x9bd0('0x3b')]);_0x22f32f['calleridnum']=_0x22f32f[_0x9bd0('0x3c')];_0x22f32f['destinationchannel']=[_0x22f32f[_0x9bd0('0x3d')],_0x22f32f[_0x9bd0('0x3d')]=_0x22f32f[_0x9bd0('0x3e')]][0x0];_0x22f32f[_0x9bd0('0x39')]=_0x22f32f['calleridpreview'];}else{_0x22f32f[_0x9bd0('0x33')]=_0x22f32f[_0x9bd0('0x3f')];_0x22f32f[_0x9bd0('0x3f')]=_0x22f32f[_0x9bd0('0x3c')];if(_0x22f32f['disposition']==_0x9bd0('0x40')){_0x22f32f['accountcode']=_0x22f32f[_0x9bd0('0x29')];}else{_0x22f32f[_0x9bd0('0x23')]='';}}}}else{_0x22f32f['callerid']=util[_0x9bd0('0x26')](_0x9bd0('0x41'),_0x22f32f[_0x9bd0('0x42')],_0x22f32f[_0x9bd0('0x3f')]);}RpcVoiceCallReport['create'](_0x22f32f);if(_0x22f32f[_0x9bd0('0x43')]){for(var _0x4db62d=0x0;_0x4db62d<_0x22f32f[_0x9bd0('0x44')]['length'];_0x4db62d+=0x1){_0x22f32f[_0x9bd0('0x45')]=_0x22f32f[_0x9bd0('0x44')][_0x4db62d][_0x9bd0('0x46')];_0x22f32f[_0x9bd0('0x47')]=_0x22f32f[_0x9bd0('0x44')][_0x4db62d][_0x9bd0('0x47')];if(_0x22f32f['exten']==_0x9bd0('0x48')){_0x22f32f[_0x9bd0('0x3f')]=_0x22f32f['connectedlinenum'];_0x22f32f[_0x9bd0('0x42')]=_0x22f32f[_0x9bd0('0x49')];_0x22f32f[_0x9bd0('0x29')]=_0x22f32f[_0x9bd0('0x23')];_0x22f32f['connectedlinename']=_0x22f32f[_0x9bd0('0x4a')];_0x22f32f[_0x9bd0('0x34')]=_0x22f32f['originatecalleridnum'];}else if(_0x22f32f[_0x9bd0('0x34')]==_0x9bd0('0x4b')){_0x22f32f[_0x9bd0('0x3f')]=_0x22f32f[_0x9bd0('0x33')];_0x22f32f[_0x9bd0('0x34')]=_0x22f32f['originatecalleridnum'];}RpcVoiceRecording[_0x9bd0('0x31')](_0x22f32f);}}};Report[_0x9bd0('0x20')][_0x9bd0('0x1a')]=function(_0xb6328f){if(_[_0x9bd0('0x4c')](_0xb6328f)){_0xb6328f[_0x9bd0('0x4d')](function(_0x5ebcee){RpcVoiceAgentReport[_0x9bd0('0x31')](_0x5ebcee);});}else{RpcVoiceAgentReport[_0x9bd0('0x31')](_0xb6328f);}};Report[_0x9bd0('0x20')][_0x9bd0('0x1c')]=function(_0x282842){RpcVoiceDialReport[_0x9bd0('0x31')](_0x282842);var _0x32f79e=undefined;var _0x5e413e=_0x282842[_0x9bd0('0x3d')];if(_[_0x9bd0('0x4e')](_0x5e413e,'Local')){var _0x5d4d9c=_0x5e413e[_0x9bd0('0x4f')](_0x5e413e['indexOf']('/')+0x1,_0x5e413e['indexOf']('@'));_0x32f79e=_[_0x9bd0('0x22')](this[_0x9bd0('0xf')],function(_0x24094e){return _0x24094e[_0x9bd0('0x50')]==_0x5d4d9c||_0x24094e[_0x9bd0('0x51')]==_0x5d4d9c||_0x24094e[_0x9bd0('0x23')]==_0x5d4d9c;});}else{var _0x5d4d9c=_0x5e413e[_0x9bd0('0x4f')](_0x5e413e[_0x9bd0('0x52')]('/')+0x1,_0x5e413e[_0x9bd0('0x53')]('-'));_0x32f79e=this[_0x9bd0('0x21')](_0x5d4d9c);}if(_0x32f79e){_0x282842[_0x9bd0('0x25')]=_[_0x9bd0('0x2c')](_0x32f79e[_0x9bd0('0x25')])?util['format'](_0x9bd0('0x27'),_0x32f79e[_0x9bd0('0x24')]):_0x32f79e[_0x9bd0('0x25')];_0x282842[_0x9bd0('0x4a')]=_0x32f79e[_0x9bd0('0x24')];_0x282842[_0x9bd0('0x23')]=_0x32f79e['accountcode'];RpcMemberReport[_0x9bd0('0x1c')](_0x282842);}};Report['prototype'][_0x9bd0('0x1d')]=function(_0x5977e7){RpcVoiceTransferReport['blindTransfer'](_0x5977e7);};Report[_0x9bd0('0x20')][_0x9bd0('0x1f')]=function(_0x2d47f5){RpcVoiceTransferReport[_0x9bd0('0x1f')](_0x2d47f5);};module[_0x9bd0('0x54')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index c0ba878..1f3d2c6 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2669=['bind','registry','syncDeviceState','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','inspect','prototype','[loopSyncRealTimeShow]','isNotNull','isUndefined','emit','find','stateRegistry','state','event','actionid','username','trunk:save','error','[syncRegistry][UserReport]','device','toLowerCase','stateTime','toNumber','format','updateStatusRealtime','telephone:%s','name','startsWith','substring','indexOf','accountcode','local','[syncDeviceState][UserReport]','peer','registered','status','address','telephone:save','[syncPeerStatus][UserReport]','exports','util','ioredis','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry'];(function(_0x3ed2e9,_0x556e07){var _0x4798ed=function(_0x266121){while(--_0x266121){_0x3ed2e9['push'](_0x3ed2e9['shift']());}};_0x4798ed(++_0x556e07);}(_0x2669,0x6d));var _0x9266=function(_0x47dff0,_0x19c0f1){_0x47dff0=_0x47dff0-0x0;var _0x4cbdcd=_0x2669[_0x47dff0];return _0x4cbdcd;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x9266('0x0'));var Redis=require(_0x9266('0x1'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x9266('0x2'));var ami=require(_0x9266('0x3'));config[_0x9266('0x4')]=_[_0x9266('0x5')](config[_0x9266('0x4')],{'host':_0x9266('0x6'),'port':0x18eb});var io=require(_0x9266('0x7'))(new Redis(config[_0x9266('0x4')]));function UserReport(_0x1b2522){this[_0x9266('0x8')]=_0x1b2522[_0x9266('0x8')];this[_0x9266('0x9')]=_0x1b2522['agents'];this[_0x9266('0xa')]=_0x1b2522[_0x9266('0xa')];ami['on'](_0x9266('0xb'),this[_0x9266('0xc')][_0x9266('0xd')](this));ami['on'](_0x9266('0xe'),this['syncRegistry'][_0x9266('0xd')](this));ami['on']('devicestatechange',this[_0x9266('0xf')][_0x9266('0xd')](this));ami['on'](_0x9266('0x10'),this[_0x9266('0x11')]['bind'](this));this[_0x9266('0x12')]();return BPromise[_0x9266('0x13')]()[_0x9266('0x14')](ami[_0x9266('0x15')]())[_0x9266('0x14')](ami[_0x9266('0x16')]())['then'](ami[_0x9266('0x17')]())[_0x9266('0x18')](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x596e59){return function(_0x28a2fa){logger['error'](_0x596e59,util[_0x9266('0x19')](_0x28a2fa,{'showHidden':![],'depth':null}));};}UserReport[_0x9266('0x1a')][_0x9266('0x12')]=function(){setInterval(function(){BPromise['resolve']()[_0x9266('0x14')](ami['actionSipShowRegistry']())['then'](ami['actionDeviceStateList']())[_0x9266('0x14')](ami[_0x9266('0x17')]())[_0x9266('0x18')](loggerCatch(_0x9266('0x1b')));},0x32c8);};UserReport['prototype'][_0x9266('0x1c')]=function(_0x35ee1a){return _0x35ee1a!==null&&!_[_0x9266('0x1d')](_0x35ee1a);};UserReport[_0x9266('0x1a')][_0x9266('0x1e')]=function(_0x335a8e,_0x1726cf,_0x393fe4){io['to'](_0x335a8e)[_0x9266('0x1e')](_0x1726cf,_0x393fe4);};UserReport[_0x9266('0x1a')][_0x9266('0xc')]=function(_0x3e6eb7){try{if(this[_0x9266('0x1c')](_0x3e6eb7)){var _0x497276=_[_0x9266('0x1f')](this[_0x9266('0x8')],{'registry':_0x3e6eb7['username']});if(_0x497276){_0x3e6eb7[_0x9266('0x20')]=_0x3e6eb7[_0x9266('0x21')];_['merge'](_0x497276,_['omit'](_0x3e6eb7,[_0x9266('0x22'),_0x9266('0x23'),_0x9266('0x24'),_0x9266('0x21')]));this[_0x9266('0x1e')](util['format']('trunk:%s',_0x497276['name']),_0x9266('0x25'),_0x497276);}}}catch(_0x42552f){logger[_0x9266('0x26')](_0x9266('0x27'),util[_0x9266('0x19')](_0x42552f,{'showHidden':![],'depth':null}));}};UserReport[_0x9266('0x1a')][_0x9266('0xf')]=function(_0x2664ee){try{if(this[_0x9266('0x1c')](_0x2664ee)){if(this['agents'][_0x2664ee[_0x9266('0x28')]]){if(!this[_0x9266('0x9')][_0x2664ee[_0x9266('0x28')]]['local']||_0x2664ee[_0x9266('0x21')][_0x9266('0x29')]()=='inuse'){this['agents'][_0x2664ee[_0x9266('0x28')]]['local']=![];if(this['agents'][_0x2664ee[_0x9266('0x28')]][_0x9266('0x21')]!==_0x2664ee[_0x9266('0x21')]['toLowerCase']()){this[_0x9266('0x9')][_0x2664ee[_0x9266('0x28')]][_0x9266('0x2a')]=_[_0x9266('0x2b')](moment()[_0x9266('0x2c')]('x'));}this[_0x9266('0x9')][_0x2664ee[_0x9266('0x28')]]['state']=_0x2664ee[_0x9266('0x21')][_0x9266('0x29')]();this[_0x9266('0x9')][_0x2664ee[_0x9266('0x28')]][_0x9266('0x2d')](_0x2664ee);}}else if(this[_0x9266('0xa')][_0x2664ee['device']]){if(this[_0x9266('0xa')][_0x2664ee[_0x9266('0x28')]]['state']!==_0x2664ee[_0x9266('0x21')][_0x9266('0x29')]()){this[_0x9266('0xa')][_0x2664ee[_0x9266('0x28')]]['stateTime']=_[_0x9266('0x2b')](moment()['format']('x'));}this[_0x9266('0xa')][_0x2664ee[_0x9266('0x28')]][_0x9266('0x21')]=_0x2664ee[_0x9266('0x21')][_0x9266('0x29')]();this[_0x9266('0x1e')](util[_0x9266('0x2c')](_0x9266('0x2e'),this['telephones'][_0x2664ee['device']][_0x9266('0x2f')]),'telephone:save',this[_0x9266('0xa')][_0x2664ee[_0x9266('0x28')]]);}else if(this[_0x9266('0x8')][_0x2664ee[_0x9266('0x28')]]){if(this[_0x9266('0x8')][_0x2664ee[_0x9266('0x28')]][_0x9266('0x21')]!==_0x2664ee['state'][_0x9266('0x29')]()){this['trunks'][_0x2664ee[_0x9266('0x28')]][_0x9266('0x2a')]=_[_0x9266('0x2b')](moment()[_0x9266('0x2c')]('x'));}this[_0x9266('0x8')][_0x2664ee[_0x9266('0x28')]]['state']=_0x2664ee[_0x9266('0x21')][_0x9266('0x29')]();this['emit'](util[_0x9266('0x2c')]('trunk:%s',this[_0x9266('0x8')][_0x2664ee[_0x9266('0x28')]][_0x9266('0x2f')]),'trunk:save',this[_0x9266('0x8')][_0x2664ee[_0x9266('0x28')]]);}else if(_['startsWith'](_0x2664ee[_0x9266('0x28')],'Queue')){}else if(_[_0x9266('0x30')](_0x2664ee['device'],'Local')){var _0x135172=_0x2664ee[_0x9266('0x28')];var _0x2a7f17=_0x135172[_0x9266('0x31')](_0x135172[_0x9266('0x32')]('/')+0x1,_0x135172['indexOf']('@'));var _0x32a38e=_[_0x9266('0x1f')](this[_0x9266('0x9')],function(_0x54f6d1){return _0x54f6d1['mobile']==_0x2a7f17||_0x54f6d1['phone']==_0x2a7f17||_0x54f6d1[_0x9266('0x33')]==_0x2a7f17;});if(_0x32a38e){if(_0x32a38e[_0x9266('0x21')]!==_0x2664ee['state'][_0x9266('0x29')]()){_0x32a38e[_0x9266('0x2a')]=_[_0x9266('0x2b')](moment()['format']('x'));}_0x32a38e['state']=_0x2664ee[_0x9266('0x21')][_0x9266('0x29')]();_0x32a38e[_0x9266('0x34')]=!![];_0x32a38e[_0x9266('0x2d')](_0x2664ee);}}else{}}}catch(_0x1f0226){logger[_0x9266('0x26')](_0x9266('0x35'),util[_0x9266('0x19')](_0x1f0226,{'showHidden':![],'depth':null}));}};UserReport[_0x9266('0x1a')][_0x9266('0x11')]=function(_0x2be97c){try{if(this[_0x9266('0x1c')](_0x2be97c)&&this[_0x9266('0x1c')](_0x2be97c[_0x9266('0x10')])){if(this[_0x9266('0x9')][_0x2be97c[_0x9266('0x36')]]){if(!this['agents'][_0x2be97c[_0x9266('0x36')]][_0x9266('0x34')]||_0x2be97c[_0x9266('0x10')]['toLowerCase']()==_0x9266('0x37')){this[_0x9266('0x9')][_0x2be97c[_0x9266('0x36')]][_0x9266('0x34')]=![];this[_0x9266('0x9')][_0x2be97c[_0x9266('0x36')]][_0x9266('0x38')]=_0x2be97c[_0x9266('0x10')][_0x9266('0x29')]();this[_0x9266('0x9')][_0x2be97c[_0x9266('0x36')]][_0x9266('0x39')]=_0x2be97c['address'];this[_0x9266('0x9')][_0x2be97c[_0x9266('0x36')]][_0x9266('0x2d')](_0x2be97c);}}else if(this[_0x9266('0xa')][_0x2be97c['peer']]){this[_0x9266('0xa')][_0x2be97c[_0x9266('0x36')]][_0x9266('0x38')]=_0x2be97c[_0x9266('0x10')][_0x9266('0x29')]();this[_0x9266('0xa')][_0x2be97c[_0x9266('0x36')]][_0x9266('0x39')]=_0x2be97c[_0x9266('0x39')];this[_0x9266('0x1e')](util[_0x9266('0x2c')](_0x9266('0x2e'),this[_0x9266('0xa')][_0x2be97c['peer']][_0x9266('0x2f')]),_0x9266('0x3a'),this[_0x9266('0xa')][_0x2be97c[_0x9266('0x36')]]);}else if(this[_0x9266('0x8')][_0x2be97c[_0x9266('0x36')]]){this['trunks'][_0x2be97c['peer']][_0x9266('0x38')]=_0x2be97c[_0x9266('0x10')][_0x9266('0x29')]();this[_0x9266('0x8')][_0x2be97c['peer']]['address']=_0x2be97c[_0x9266('0x39')];this['emit'](util['format']('trunk:%s',this[_0x9266('0x8')][_0x2be97c[_0x9266('0x36')]]['name']),'trunk:save',this['trunks'][_0x2be97c['peer']]);}else{}}}catch(_0x1080d7){logger[_0x9266('0x26')](_0x9266('0x3b'),util[_0x9266('0x19')](_0x1080d7,{'showHidden':![],'depth':null}));}};module[_0x9266('0x3c')]=UserReport; \ No newline at end of file +var _0x52bf=['../ami','redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','error','prototype','loopSyncRealTimeShow','actionSipPeerStatus','isNotNull','isUndefined','emit','find','username','stateRegistry','merge','omit','event','actionid','format','name','[syncRegistry][UserReport]','inspect','device','local','state','toLowerCase','toNumber','updateStatusRealtime','stateTime','telephone:save','trunk:%s','trunk:save','startsWith','Queue','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','peer','registered','status','address','telephone:%s','exports','lodash','moment','bluebird','util','ioredis','../../../config/environment','ami'];(function(_0x5082d2,_0x444603){var _0x51d976=function(_0xb4c2ec){while(--_0xb4c2ec){_0x5082d2['push'](_0x5082d2['shift']());}};_0x51d976(++_0x444603);}(_0x52bf,0x197));var _0xf52b=function(_0x187bb0,_0x316fd2){_0x187bb0=_0x187bb0-0x0;var _0xc7116d=_0x52bf[_0x187bb0];return _0xc7116d;};'use strict';var _=require(_0xf52b('0x0'));var moment=require(_0xf52b('0x1'));var BPromise=require(_0xf52b('0x2'));var util=require(_0xf52b('0x3'));var Redis=require(_0xf52b('0x4'));var config=require(_0xf52b('0x5'));var logger=require('../../../config/logger')(_0xf52b('0x6'));var ami=require(_0xf52b('0x7'));config[_0xf52b('0x8')]=_[_0xf52b('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf52b('0xa'))(new Redis(config[_0xf52b('0x8')]));function UserReport(_0x345e10){this[_0xf52b('0xb')]=_0x345e10[_0xf52b('0xb')];this['agents']=_0x345e10[_0xf52b('0xc')];this['telephones']=_0x345e10[_0xf52b('0xd')];ami['on'](_0xf52b('0xe'),this[_0xf52b('0xf')][_0xf52b('0x10')](this));ami['on'](_0xf52b('0x11'),this[_0xf52b('0xf')][_0xf52b('0x10')](this));ami['on'](_0xf52b('0x12'),this[_0xf52b('0x13')][_0xf52b('0x10')](this));ami['on'](_0xf52b('0x14'),this[_0xf52b('0x15')][_0xf52b('0x10')](this));this['loopSyncRealTimeShow']();return BPromise[_0xf52b('0x16')]()[_0xf52b('0x17')](ami[_0xf52b('0x18')]())['then'](ami[_0xf52b('0x19')]())[_0xf52b('0x17')](ami['actionSipPeerStatus']())[_0xf52b('0x1a')](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x2944cf){return function(_0x1511b8){logger[_0xf52b('0x1b')](_0x2944cf,util['inspect'](_0x1511b8,{'showHidden':![],'depth':null}));};}UserReport[_0xf52b('0x1c')][_0xf52b('0x1d')]=function(){setInterval(function(){BPromise[_0xf52b('0x16')]()[_0xf52b('0x17')](ami[_0xf52b('0x18')]())[_0xf52b('0x17')](ami[_0xf52b('0x19')]())['then'](ami[_0xf52b('0x1e')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0xf52b('0x1c')][_0xf52b('0x1f')]=function(_0x56d713){return _0x56d713!==null&&!_[_0xf52b('0x20')](_0x56d713);};UserReport[_0xf52b('0x1c')][_0xf52b('0x21')]=function(_0x11a076,_0x3b6a35,_0x4c2208){io['to'](_0x11a076)['emit'](_0x3b6a35,_0x4c2208);};UserReport[_0xf52b('0x1c')][_0xf52b('0xf')]=function(_0x2bf563){try{if(this[_0xf52b('0x1f')](_0x2bf563)){var _0x50531a=_[_0xf52b('0x22')](this[_0xf52b('0xb')],{'registry':_0x2bf563[_0xf52b('0x23')]});if(_0x50531a){_0x2bf563[_0xf52b('0x24')]=_0x2bf563['state'];_[_0xf52b('0x25')](_0x50531a,_[_0xf52b('0x26')](_0x2bf563,[_0xf52b('0x27'),_0xf52b('0x28'),_0xf52b('0x23'),'state']));this['emit'](util[_0xf52b('0x29')]('trunk:%s',_0x50531a[_0xf52b('0x2a')]),'trunk:save',_0x50531a);}}}catch(_0x9fbac3){logger[_0xf52b('0x1b')](_0xf52b('0x2b'),util[_0xf52b('0x2c')](_0x9fbac3,{'showHidden':![],'depth':null}));}};UserReport[_0xf52b('0x1c')][_0xf52b('0x13')]=function(_0x314517){try{if(this[_0xf52b('0x1f')](_0x314517)){if(this[_0xf52b('0xc')][_0x314517[_0xf52b('0x2d')]]){if(!this[_0xf52b('0xc')][_0x314517[_0xf52b('0x2d')]][_0xf52b('0x2e')]||_0x314517[_0xf52b('0x2f')][_0xf52b('0x30')]()=='inuse'){this[_0xf52b('0xc')][_0x314517[_0xf52b('0x2d')]][_0xf52b('0x2e')]=![];if(this[_0xf52b('0xc')][_0x314517[_0xf52b('0x2d')]]['state']!==_0x314517[_0xf52b('0x2f')]['toLowerCase']()){this[_0xf52b('0xc')][_0x314517[_0xf52b('0x2d')]]['stateTime']=_[_0xf52b('0x31')](moment()[_0xf52b('0x29')]('x'));}this[_0xf52b('0xc')][_0x314517[_0xf52b('0x2d')]]['state']=_0x314517[_0xf52b('0x2f')][_0xf52b('0x30')]();this[_0xf52b('0xc')][_0x314517['device']][_0xf52b('0x32')](_0x314517);}}else if(this[_0xf52b('0xd')][_0x314517['device']]){if(this[_0xf52b('0xd')][_0x314517[_0xf52b('0x2d')]][_0xf52b('0x2f')]!==_0x314517['state'][_0xf52b('0x30')]()){this[_0xf52b('0xd')][_0x314517[_0xf52b('0x2d')]][_0xf52b('0x33')]=_['toNumber'](moment()['format']('x'));}this[_0xf52b('0xd')][_0x314517['device']][_0xf52b('0x2f')]=_0x314517[_0xf52b('0x2f')]['toLowerCase']();this[_0xf52b('0x21')](util[_0xf52b('0x29')]('telephone:%s',this[_0xf52b('0xd')][_0x314517['device']][_0xf52b('0x2a')]),_0xf52b('0x34'),this[_0xf52b('0xd')][_0x314517[_0xf52b('0x2d')]]);}else if(this['trunks'][_0x314517[_0xf52b('0x2d')]]){if(this[_0xf52b('0xb')][_0x314517[_0xf52b('0x2d')]][_0xf52b('0x2f')]!==_0x314517[_0xf52b('0x2f')][_0xf52b('0x30')]()){this[_0xf52b('0xb')][_0x314517[_0xf52b('0x2d')]][_0xf52b('0x33')]=_[_0xf52b('0x31')](moment()['format']('x'));}this['trunks'][_0x314517['device']][_0xf52b('0x2f')]=_0x314517['state'][_0xf52b('0x30')]();this['emit'](util[_0xf52b('0x29')](_0xf52b('0x35'),this[_0xf52b('0xb')][_0x314517[_0xf52b('0x2d')]]['name']),_0xf52b('0x36'),this[_0xf52b('0xb')][_0x314517[_0xf52b('0x2d')]]);}else if(_[_0xf52b('0x37')](_0x314517['device'],_0xf52b('0x38'))){}else if(_[_0xf52b('0x37')](_0x314517[_0xf52b('0x2d')],'Local')){var _0x37e557=_0x314517[_0xf52b('0x2d')];var _0x6dcdb=_0x37e557[_0xf52b('0x39')](_0x37e557[_0xf52b('0x3a')]('/')+0x1,_0x37e557['indexOf']('@'));var _0xbe0b08=_[_0xf52b('0x22')](this[_0xf52b('0xc')],function(_0x2410de){return _0x2410de[_0xf52b('0x3b')]==_0x6dcdb||_0x2410de[_0xf52b('0x3c')]==_0x6dcdb||_0x2410de[_0xf52b('0x3d')]==_0x6dcdb;});if(_0xbe0b08){if(_0xbe0b08[_0xf52b('0x2f')]!==_0x314517[_0xf52b('0x2f')][_0xf52b('0x30')]()){_0xbe0b08['stateTime']=_['toNumber'](moment()[_0xf52b('0x29')]('x'));}_0xbe0b08['state']=_0x314517[_0xf52b('0x2f')][_0xf52b('0x30')]();_0xbe0b08[_0xf52b('0x2e')]=!![];_0xbe0b08['updateStatusRealtime'](_0x314517);}}else{}}}catch(_0x42b461){logger[_0xf52b('0x1b')](_0xf52b('0x3e'),util['inspect'](_0x42b461,{'showHidden':![],'depth':null}));}};UserReport[_0xf52b('0x1c')][_0xf52b('0x15')]=function(_0x285691){try{if(this['isNotNull'](_0x285691)&&this[_0xf52b('0x1f')](_0x285691[_0xf52b('0x14')])){if(this['agents'][_0x285691[_0xf52b('0x3f')]]){if(!this[_0xf52b('0xc')][_0x285691['peer']][_0xf52b('0x2e')]||_0x285691[_0xf52b('0x14')][_0xf52b('0x30')]()==_0xf52b('0x40')){this['agents'][_0x285691[_0xf52b('0x3f')]][_0xf52b('0x2e')]=![];this[_0xf52b('0xc')][_0x285691[_0xf52b('0x3f')]][_0xf52b('0x41')]=_0x285691[_0xf52b('0x14')][_0xf52b('0x30')]();this[_0xf52b('0xc')][_0x285691['peer']][_0xf52b('0x42')]=_0x285691[_0xf52b('0x42')];this[_0xf52b('0xc')][_0x285691[_0xf52b('0x3f')]][_0xf52b('0x32')](_0x285691);}}else if(this[_0xf52b('0xd')][_0x285691[_0xf52b('0x3f')]]){this['telephones'][_0x285691[_0xf52b('0x3f')]][_0xf52b('0x41')]=_0x285691[_0xf52b('0x14')][_0xf52b('0x30')]();this[_0xf52b('0xd')][_0x285691[_0xf52b('0x3f')]]['address']=_0x285691['address'];this[_0xf52b('0x21')](util[_0xf52b('0x29')](_0xf52b('0x43'),this[_0xf52b('0xd')][_0x285691[_0xf52b('0x3f')]]['name']),_0xf52b('0x34'),this[_0xf52b('0xd')][_0x285691[_0xf52b('0x3f')]]);}else if(this[_0xf52b('0xb')][_0x285691[_0xf52b('0x3f')]]){this['trunks'][_0x285691['peer']][_0xf52b('0x41')]=_0x285691['peerstatus'][_0xf52b('0x30')]();this[_0xf52b('0xb')][_0x285691[_0xf52b('0x3f')]][_0xf52b('0x42')]=_0x285691[_0xf52b('0x42')];this[_0xf52b('0x21')](util[_0xf52b('0x29')](_0xf52b('0x35'),this[_0xf52b('0xb')][_0x285691[_0xf52b('0x3f')]][_0xf52b('0x2a')]),'trunk:save',this['trunks'][_0x285691['peer']]);}else{}}}catch(_0x34da23){logger[_0xf52b('0x1b')]('[syncPeerStatus][UserReport]',util[_0xf52b('0x2c')](_0x34da23,{'showHidden':![],'depth':null}));}};module[_0xf52b('0x44')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 802cd42..d064160 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70ef=['[syncBlindTransfer][VoiceAgentReport]','syncMusicOnHoldStart','channel','lastIndexOf','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','voiceQueues','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','channels','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','variables','queue','type','inbound','merge','event','privilege','custom:agentcalled','user:%s','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','agents','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswerAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','membername','custom:agentansweredelsewhere','syncAgentRingNoAnswer','rejected','custom:agentringnoanswer','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','talktime','reason','transfer','agent','acw','acwtime','acwTimeout','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','agentcompleteAt','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','complete','diff','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','seconds'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x70ef,0x88));var _0xf70e=function(_0x3aed08,_0x480834){_0x3aed08=_0x3aed08-0x0;var _0x1061d3=_0x70ef[_0x3aed08];return _0x1061d3;};'use strict';var _=require(_0xf70e('0x0'));var moment=require(_0xf70e('0x1'));var util=require(_0xf70e('0x2'));var Redis=require('ioredis');var config=require(_0xf70e('0x3'));var logger=require(_0xf70e('0x4'))(_0xf70e('0x5'));var ami=require(_0xf70e('0x6'));config[_0xf70e('0x7')]=_[_0xf70e('0x8')](config[_0xf70e('0x7')],{'host':_0xf70e('0x9'),'port':0x18eb});var io=require(_0xf70e('0xa'))(new Redis(config['redis']));function VoiceAgentReport(_0x5cc608){this['channels']={};this[_0xf70e('0xb')]=_0x5cc608['voiceQueues'];this['agents']=_0x5cc608['agents'];this['variables']={};ami['on']('agentcalled',this[_0xf70e('0xc')][_0xf70e('0xd')](this));ami['on'](_0xf70e('0xe'),this[_0xf70e('0xf')]['bind'](this));ami['on'](_0xf70e('0x10'),this['syncAgentRingNoAnswer']['bind'](this));ami['on']('queuecallerabandon',this[_0xf70e('0x11')]['bind'](this));ami['on'](_0xf70e('0x12'),this[_0xf70e('0x13')][_0xf70e('0xd')](this));ami['on'](_0xf70e('0x14'),this[_0xf70e('0x15')][_0xf70e('0xd')](this));ami['on'](_0xf70e('0x16'),this[_0xf70e('0x17')][_0xf70e('0xd')](this));ami['on'](_0xf70e('0x18'),this['syncMusicOnHoldStart'][_0xf70e('0xd')](this));ami['on'](_0xf70e('0x19'),this[_0xf70e('0x1a')]['bind'](this));ami['on'](_0xf70e('0x1b'),this[_0xf70e('0x1c')][_0xf70e('0xd')](this));ami['on'](_0xf70e('0x1d'),this[_0xf70e('0x1e')]['bind'](this));}VoiceAgentReport[_0xf70e('0x1f')][_0xf70e('0x20')]=function(_0xb618b9,_0x3fe10b,_0x3a0708){io['to'](_0xb618b9)[_0xf70e('0x20')](_0x3fe10b,_0x3a0708);};VoiceAgentReport[_0xf70e('0x1f')][_0xf70e('0x21')]=function(_0x281507){return _0x281507!==null&&!_['isUndefined'](_0x281507);};VoiceAgentReport[_0xf70e('0x1f')][_0xf70e('0xc')]=function(_0x1dd7e9){try{if(this[_0xf70e('0x21')](_0x1dd7e9)){if(_[_0xf70e('0x22')](this[_0xf70e('0x23')][_0x1dd7e9[_0xf70e('0x24')]])){this[_0xf70e('0x23')][_0x1dd7e9[_0xf70e('0x24')]]={};}if(_['isUndefined'](this['channels'][_0x1dd7e9['uniqueid']][_0x1dd7e9[_0xf70e('0x25')]])){this[_0xf70e('0x23')][_0x1dd7e9[_0xf70e('0x24')]][_0x1dd7e9['destuniqueid']]={'agentcalledAt':moment()[_0xf70e('0x26')](_0xf70e('0x27')),'lastevent':_0xf70e('0x28'),'variables':this[_0xf70e('0x29')][_0x1dd7e9[_0xf70e('0x24')]],'type':this[_0xf70e('0xb')][_0x1dd7e9[_0xf70e('0x2a')]]?this[_0xf70e('0xb')][_0x1dd7e9[_0xf70e('0x2a')]][_0xf70e('0x2b')]||_0xf70e('0x2c'):_0xf70e('0x2c')};}_[_0xf70e('0x2d')](this[_0xf70e('0x23')][_0x1dd7e9[_0xf70e('0x24')]][_0x1dd7e9['destuniqueid']],_['omit'](_0x1dd7e9,[_0xf70e('0x2e'),_0xf70e('0x2f')]));ami['emit'](_0xf70e('0x30'),this[_0xf70e('0x23')][_0x1dd7e9[_0xf70e('0x24')]][_0x1dd7e9[_0xf70e('0x25')]]);this[_0xf70e('0x20')](util[_0xf70e('0x26')](_0xf70e('0x31'),_0x1dd7e9['membername']),_0xf70e('0x32'),this[_0xf70e('0x23')][_0x1dd7e9[_0xf70e('0x24')]][_0x1dd7e9[_0xf70e('0x25')]]);}}catch(_0x4a9601){logger[_0xf70e('0x33')](_0xf70e('0x34'),util[_0xf70e('0x35')](_0x4a9601,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xf70e('0xf')]=function(_0x59e027){try{if(this[_0xf70e('0x21')](_0x59e027)){if(this[_0xf70e('0x23')][_0x59e027[_0xf70e('0x24')]]){for(var _0x2369d9 in this[_0xf70e('0x23')][_0x59e027[_0xf70e('0x24')]]){if(this[_0xf70e('0x23')][_0x59e027[_0xf70e('0x24')]][_0xf70e('0x36')](_0x2369d9)){if(_0x59e027['destuniqueid']===_0x2369d9){this['channels'][_0x59e027[_0xf70e('0x24')]][_0x2369d9][_0xf70e('0x37')]=moment()[_0xf70e('0x26')](_0xf70e('0x27'));this[_0xf70e('0x23')][_0x59e027[_0xf70e('0x24')]][_0x2369d9][_0xf70e('0x38')]=_0xf70e('0x39');this['channels'][_0x59e027[_0xf70e('0x24')]][_0x2369d9][_0xf70e('0x3a')]=_0x59e027[_0xf70e('0x3a')];this[_0xf70e('0x23')][_0x59e027[_0xf70e('0x24')]][_0x2369d9][_0xf70e('0x3b')]=_0x59e027['connectedlinenum'];this[_0xf70e('0x23')][_0x59e027[_0xf70e('0x24')]][_0x2369d9]['connectedlinename']=_0x59e027[_0xf70e('0x3c')];this[_0xf70e('0x23')][_0x59e027[_0xf70e('0x24')]][_0x2369d9][_0xf70e('0x3d')]=_0x59e027[_0xf70e('0x3d')];this[_0xf70e('0x23')][_0x59e027['uniqueid']][_0x2369d9][_0xf70e('0x3e')]=_0x59e027[_0xf70e('0x3e')];_[_0xf70e('0x2d')](this[_0xf70e('0x3f')][_0x59e027[_0xf70e('0x40')]],_[_0xf70e('0x41')](_0x59e027,['queue',_0xf70e('0x42')]));this[_0xf70e('0x20')](util['format'](_0xf70e('0x31'),_0x59e027['membername']),_0xf70e('0x43'),this['channels'][_0x59e027[_0xf70e('0x24')]][_0x59e027[_0xf70e('0x25')]]);ami['emit'](_0xf70e('0x44'),this[_0xf70e('0x23')][_0x59e027[_0xf70e('0x24')]][_0x2369d9]);}else if(!this['channels'][_0x59e027[_0xf70e('0x24')]][_0x2369d9][_0xf70e('0x10')]&&!this[_0xf70e('0x23')][_0x59e027['uniqueid']][_0x2369d9][_0xf70e('0x12')]){this[_0xf70e('0x23')][_0x59e027[_0xf70e('0x24')]][_0x2369d9]['agentringnoanswer']=!![];this[_0xf70e('0x23')][_0x59e027['uniqueid']][_0x2369d9][_0xf70e('0x45')]=moment()[_0xf70e('0x26')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x59e027[_0xf70e('0x24')]][_0x2369d9]['reason']=_0xf70e('0x46');this[_0xf70e('0x23')][_0x59e027[_0xf70e('0x24')]][_0x2369d9]['lastevent']=_0xf70e('0x46');this['channels'][_0x59e027['uniqueid']][_0x2369d9][_0xf70e('0x47')]=_0x59e027[_0xf70e('0x25')];this[_0xf70e('0x23')][_0x59e027[_0xf70e('0x24')]][_0x2369d9][_0xf70e('0x48')]=_0x59e027[_0xf70e('0x49')];ami[_0xf70e('0x20')](_0xf70e('0x4a'),this['channels'][_0x59e027[_0xf70e('0x24')]][_0x2369d9]);}}}}}}catch(_0xd6bc31){logger[_0xf70e('0x33')]('[syncAgentConnect][VoiceAgentReport]',util['inspect'](_0xd6bc31,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf70e('0x1f')][_0xf70e('0x4b')]=function(_0xf01040){try{if(this[_0xf70e('0x21')](_0xf01040)){if(this[_0xf70e('0x23')][_0xf01040[_0xf70e('0x24')]]&&this[_0xf70e('0x23')][_0xf01040['uniqueid']][_0xf01040[_0xf70e('0x25')]]){this[_0xf70e('0x23')][_0xf01040[_0xf70e('0x24')]][_0xf01040[_0xf70e('0x25')]]['agentringnoanswer']=!![];this['channels'][_0xf01040[_0xf70e('0x24')]][_0xf01040[_0xf70e('0x25')]][_0xf70e('0x45')]=moment()[_0xf70e('0x26')](_0xf70e('0x27'));this[_0xf70e('0x23')][_0xf01040['uniqueid']][_0xf01040['destuniqueid']]['reason']=_0xf70e('0x4c');this[_0xf70e('0x23')][_0xf01040[_0xf70e('0x24')]][_0xf01040[_0xf70e('0x25')]][_0xf70e('0x38')]=_0xf70e('0x4c');ami['emit'](_0xf70e('0x4d'),this['channels'][_0xf01040[_0xf70e('0x24')]][_0xf01040[_0xf70e('0x25')]]);}}}catch(_0xca339){logger[_0xf70e('0x33')]('[syncAgentRingNoAnswer][VoiceAgentReport]',util['inspect'](_0xca339,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xf70e('0x11')]=function(_0x4863c2){try{if(this['isNotNull'](_0x4863c2)){if(this[_0xf70e('0x23')][_0x4863c2['uniqueid']]){for(var _0xba8414 in this['channels'][_0x4863c2[_0xf70e('0x24')]]){if(this[_0xf70e('0x23')][_0x4863c2[_0xf70e('0x24')]][_0xf70e('0x36')](_0xba8414)&&!this['channels'][_0x4863c2[_0xf70e('0x24')]][_0xba8414]['agentringnoanswer']&&!this[_0xf70e('0x23')][_0x4863c2[_0xf70e('0x24')]][_0xba8414][_0xf70e('0x12')]){this[_0xf70e('0x23')][_0x4863c2[_0xf70e('0x24')]][_0xba8414][_0xf70e('0x10')]=!![];this[_0xf70e('0x23')][_0x4863c2[_0xf70e('0x24')]][_0xba8414][_0xf70e('0x45')]=moment()['format'](_0xf70e('0x27'));this[_0xf70e('0x23')][_0x4863c2[_0xf70e('0x24')]][_0xba8414]['reason']=_0xf70e('0x4e');this[_0xf70e('0x23')][_0x4863c2[_0xf70e('0x24')]][_0xba8414][_0xf70e('0x38')]='abandoned';ami[_0xf70e('0x20')](_0xf70e('0x4f'),this[_0xf70e('0x23')][_0x4863c2[_0xf70e('0x24')]][_0xba8414]);}}}}}catch(_0xac57c2){logger['error'](_0xf70e('0x50'),util['inspect'](_0xac57c2,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xf70e('0x13')]=function(_0x331bc1){try{if(this[_0xf70e('0x21')](_0x331bc1)){if(this[_0xf70e('0x23')][_0x331bc1[_0xf70e('0x24')]]){for(var _0x4b6f25 in this[_0xf70e('0x23')][_0x331bc1['uniqueid']]){if(this[_0xf70e('0x23')][_0x331bc1[_0xf70e('0x24')]][_0xf70e('0x36')](_0x4b6f25)){if(this[_0xf70e('0x23')][_0x331bc1[_0xf70e('0x24')]][_0x4b6f25]['agentconnectAt']&&!this[_0xf70e('0x23')][_0x331bc1[_0xf70e('0x24')]][_0x4b6f25]['agentcomplete']){this[_0xf70e('0x23')][_0x331bc1[_0xf70e('0x24')]][_0x4b6f25][_0xf70e('0x12')]=!![];this[_0xf70e('0x23')][_0x331bc1[_0xf70e('0x24')]][_0x4b6f25]['agentcompleteAt']=moment()[_0xf70e('0x26')](_0xf70e('0x27'));this['channels'][_0x331bc1[_0xf70e('0x24')]][_0x4b6f25][_0xf70e('0x38')]='complete';this[_0xf70e('0x23')][_0x331bc1[_0xf70e('0x24')]][_0x4b6f25][_0xf70e('0x51')]=_0x331bc1[_0xf70e('0x51')];this['channels'][_0x331bc1[_0xf70e('0x24')]][_0x4b6f25]['reason']=_0x331bc1[_0xf70e('0x52')]==_0xf70e('0x53')?_0xf70e('0x54'):_0x331bc1['reason'];if(this[_0xf70e('0xb')][_0x331bc1['queue']]&&this['voiceQueues'][_0x331bc1[_0xf70e('0x2a')]][_0xf70e('0x55')]){this[_0xf70e('0x23')][_0x331bc1['uniqueid']][_0x4b6f25]['agentacw']=!![];this['channels'][_0x331bc1[_0xf70e('0x24')]][_0x4b6f25][_0xf70e('0x56')]=this['voiceQueues'][_0x331bc1[_0xf70e('0x2a')]][_0xf70e('0x57')];}this[_0xf70e('0x3f')][_0x331bc1['interface']]=_['omit'](this[_0xf70e('0x3f')][_0x331bc1[_0xf70e('0x40')]],['queue',_0xf70e('0x42')]);this[_0xf70e('0x20')](util[_0xf70e('0x26')]('user:%s',_0x331bc1[_0xf70e('0x49')]),_0xf70e('0x58'),this[_0xf70e('0x23')][_0x331bc1[_0xf70e('0x24')]][_0x4b6f25]);ami[_0xf70e('0x20')](_0xf70e('0x59'),this['channels'][_0x331bc1[_0xf70e('0x24')]][_0x4b6f25]);}}}}}}catch(_0x3d4385){logger[_0xf70e('0x33')](_0xf70e('0x5a'),util[_0xf70e('0x35')](_0x3d4385,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf70e('0x1f')]['syncVarSet']=function(_0x437b7d){try{if(this[_0xf70e('0x21')](_0x437b7d)){this[_0xf70e('0x5b')](_0x437b7d[_0xf70e('0x24')],_[_0xf70e('0x5c')](_0x437b7d[_0xf70e('0x5d')])[0x0],_0x437b7d[_0xf70e('0x5e')]);if(this[_0xf70e('0x23')][_0x437b7d[_0xf70e('0x24')]]){for(var _0x2abef5 in this[_0xf70e('0x23')][_0x437b7d[_0xf70e('0x24')]]){if(this[_0xf70e('0x23')][_0x437b7d[_0xf70e('0x24')]][_0xf70e('0x36')](_0x2abef5)){if(_[_0xf70e('0x22')](this[_0xf70e('0x23')][_0x437b7d[_0xf70e('0x24')]][_0x2abef5][_0xf70e('0x29')])){this[_0xf70e('0x23')][_0x437b7d[_0xf70e('0x24')]][_0x2abef5][_0xf70e('0x29')]={};}this[_0xf70e('0x23')][_0x437b7d[_0xf70e('0x24')]][_0x2abef5]['variables']=this['variables'][_0x437b7d[_0xf70e('0x24')]];}}}}}catch(_0x32fc38){logger[_0xf70e('0x33')](_0xf70e('0x5f'),util[_0xf70e('0x35')](_0x32fc38,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf70e('0x1f')][_0xf70e('0x5b')]=function(_0x8bfe6e,_0x58e500,_0x1e939e){var _0x2ecfaa=['rtpaudioqos','rtpaudioqosbridged',_0xf70e('0x60'),_0xf70e('0x61'),_0xf70e('0x62'),'rtpaudioqoslossbridged',_0xf70e('0x63'),_0xf70e('0x64'),_0xf70e('0x65'),_0xf70e('0x66'),_0xf70e('0x67'),'bridgepvtcallid',_0xf70e('0x68'),'memberdynamic',_0xf70e('0x69'),_0xf70e('0x6a'),'membername',_0xf70e('0x6b'),_0xf70e('0x6c')];if(!_['isNil'](_0x58e500)&&!_[_0xf70e('0x6d')](_0x2ecfaa,_0x58e500)){if(_[_0xf70e('0x22')](this[_0xf70e('0x29')][_0x8bfe6e])){this[_0xf70e('0x29')][_0x8bfe6e]={};}this[_0xf70e('0x29')][_0x8bfe6e][_0x58e500]=_0x1e939e;}};VoiceAgentReport[_0xf70e('0x1f')][_0xf70e('0x17')]=function(_0x4f9879){try{if(this[_0xf70e('0x21')](_0x4f9879)){if(this[_0xf70e('0x23')][_0x4f9879['uniqueid']]){for(var _0x5c0486 in this[_0xf70e('0x23')][_0x4f9879[_0xf70e('0x24')]]){if(this[_0xf70e('0x23')][_0x4f9879[_0xf70e('0x24')]][_0xf70e('0x36')](_0x5c0486)){if(this[_0xf70e('0x23')][_0x4f9879[_0xf70e('0x24')]][_0x5c0486][_0xf70e('0x52')]==_0xf70e('0x53')&&this[_0xf70e('0x23')][_0x4f9879[_0xf70e('0x24')]][_0x5c0486][_0xf70e('0x12')]){this[_0xf70e('0x23')][_0x4f9879['uniqueid']][_0x5c0486][_0xf70e('0x6e')]=moment()[_0xf70e('0x26')](_0xf70e('0x27'));}}}ami[_0xf70e('0x20')](_0xf70e('0x6f'),_[_0xf70e('0x70')](this[_0xf70e('0x23')][_0x4f9879[_0xf70e('0x24')]]));delete this[_0xf70e('0x23')][_0x4f9879[_0xf70e('0x24')]];}if(this['variables'][_0x4f9879['uniqueid']]){delete this[_0xf70e('0x29')][_0x4f9879['uniqueid']];}}}catch(_0x27685a){logger['error'](_0xf70e('0x71'),util[_0xf70e('0x35')](_0x27685a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf70e('0x1f')]['syncAttendedTransfer']=function(_0x395106){try{if(this[_0xf70e('0x21')](_0x395106)){if(this['channels'][_0x395106[_0xf70e('0x72')]]){for(var _0x23cbc7 in this[_0xf70e('0x23')][_0x395106[_0xf70e('0x72')]]){if(this[_0xf70e('0x23')][_0x395106[_0xf70e('0x72')]][_0xf70e('0x36')](_0x23cbc7)){if(_0x395106[_0xf70e('0x73')]===_0x23cbc7){var _0x1061c9=moment();this[_0xf70e('0x23')][_0x395106[_0xf70e('0x72')]][_0x23cbc7][_0xf70e('0x12')]=!![];this[_0xf70e('0x23')][_0x395106[_0xf70e('0x72')]][_0x23cbc7][_0xf70e('0x6e')]=moment()[_0xf70e('0x26')](_0xf70e('0x27'));this[_0xf70e('0x23')][_0x395106[_0xf70e('0x72')]][_0x23cbc7][_0xf70e('0x52')]=_0xf70e('0x53');this[_0xf70e('0x23')][_0x395106[_0xf70e('0x72')]][_0x23cbc7][_0xf70e('0x38')]=_0xf70e('0x74');this[_0xf70e('0x23')][_0x395106[_0xf70e('0x72')]][_0x23cbc7]['talktime']=_0x1061c9[_0xf70e('0x75')](this[_0xf70e('0x23')][_0x395106[_0xf70e('0x72')]][_0x23cbc7][_0xf70e('0x37')],'seconds');}}}}if(this[_0xf70e('0x23')][_0x395106[_0xf70e('0x76')]]){var _0x167816=this['channels'][_0x395106[_0xf70e('0x76')]];this[_0xf70e('0x23')][_0x395106['secondtransfereruniqueid']]=this[_0xf70e('0x23')][_0x395106['transfereeuniqueid']];this['channels'][_0x395106['transfereeuniqueid']]=_0x167816;}}}catch(_0x4b3012){logger['error'](_0xf70e('0x77'),util['inspect'](_0x4b3012,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncBlindTransfer']=function(_0xabf78d){try{if(this[_0xf70e('0x21')](_0xabf78d)){if(this[_0xf70e('0x23')][_0xabf78d[_0xf70e('0x72')]]){for(var _0x4cfcc7 in this[_0xf70e('0x23')][_0xabf78d[_0xf70e('0x72')]]){if(this[_0xf70e('0x23')][_0xabf78d[_0xf70e('0x72')]][_0xf70e('0x36')](_0x4cfcc7)){if(_0xabf78d[_0xf70e('0x78')]===_0x4cfcc7){var _0x5886b9=moment();this['channels'][_0xabf78d['transfereeuniqueid']][_0x4cfcc7]['agentcomplete']=!![];this['channels'][_0xabf78d[_0xf70e('0x72')]][_0x4cfcc7][_0xf70e('0x6e')]=_0x5886b9;this[_0xf70e('0x23')][_0xabf78d[_0xf70e('0x72')]][_0x4cfcc7][_0xf70e('0x52')]=_0xf70e('0x53');this[_0xf70e('0x23')][_0xabf78d[_0xf70e('0x72')]][_0x4cfcc7][_0xf70e('0x38')]=_0xf70e('0x74');this['channels'][_0xabf78d[_0xf70e('0x72')]][_0x4cfcc7]['talktime']=_0x5886b9['diff'](this[_0xf70e('0x23')][_0xabf78d['transfereeuniqueid']][_0x4cfcc7][_0xf70e('0x37')],_0xf70e('0x79'));}}}}}}catch(_0x1ba7cc){logger[_0xf70e('0x33')](_0xf70e('0x7a'),util[_0xf70e('0x35')](_0x1ba7cc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf70e('0x1f')][_0xf70e('0x7b')]=function(_0x4c8ab1){var _0x2abfb0='';try{if(this[_0xf70e('0x21')](_0x4c8ab1)){if(_0x4c8ab1['channel']){_0x2abfb0=_0x4c8ab1['channel']['substring'](0x0,_0x4c8ab1[_0xf70e('0x7c')][_0xf70e('0x7d')]('-'));if(this[_0xf70e('0x3f')][_0x2abfb0]){this[_0xf70e('0x3f')][_0x2abfb0]['onhold']=!![];}}}}catch(_0x47a619){logger['error'](_0xf70e('0x7e'),util['inspect'](_0x47a619,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xf70e('0x1f')][_0xf70e('0x1a')]=function(_0x428444){var _0x285401='';try{if(this[_0xf70e('0x21')](_0x428444)){if(_0x428444[_0xf70e('0x7c')]){_0x285401=_0x428444[_0xf70e('0x7c')]['substring'](0x0,_0x428444[_0xf70e('0x7c')][_0xf70e('0x7d')]('-'));if(this[_0xf70e('0x3f')][_0x285401]){this[_0xf70e('0x3f')][_0x285401]['onhold']=![];}}}}catch(_0x213aac){logger['error'](_0xf70e('0x7f'),util[_0xf70e('0x35')](_0x213aac,{'showHidden':![],'depth':null}));}};module[_0xf70e('0x80')]=VoiceAgentReport; \ No newline at end of file +var _0x3308=['prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','omit','event','format','membername','user:called','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','pick','destconnectedlinenum','user:%s','custom:agentconnect','agentringnoanswer','reason','answered_elsewhere','lastevent','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','error','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','agentringnoanswerAt','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','talktime','transfer','acw','agentacw','acwtime','acwTimeout','user:agentcomplete','[syncAgentComplete][VoiceAgentReport]','syncVarSet','variable','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','syncAttendedTransfer','transfereeuniqueid','complete','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','blindtransfer'];(function(_0x28428d,_0x30a745){var _0x2b81d7=function(_0x22a70b){while(--_0x22a70b){_0x28428d['push'](_0x28428d['shift']());}};_0x2b81d7(++_0x30a745);}(_0x3308,0xd4));var _0x8330=function(_0x17f10c,_0x40f453){_0x17f10c=_0x17f10c-0x0;var _0xe6dfbf=_0x3308[_0x17f10c];return _0xe6dfbf;};'use strict';var _=require(_0x8330('0x0'));var moment=require(_0x8330('0x1'));var util=require(_0x8330('0x2'));var Redis=require(_0x8330('0x3'));var config=require(_0x8330('0x4'));var logger=require(_0x8330('0x5'))('ami');var ami=require(_0x8330('0x6'));config[_0x8330('0x7')]=_[_0x8330('0x8')](config[_0x8330('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x8330('0x9'))(new Redis(config[_0x8330('0x7')]));function VoiceAgentReport(_0x4608ce){this[_0x8330('0xa')]={};this[_0x8330('0xb')]=_0x4608ce['voiceQueues'];this[_0x8330('0xc')]=_0x4608ce[_0x8330('0xc')];this[_0x8330('0xd')]={};ami['on'](_0x8330('0xe'),this[_0x8330('0xf')][_0x8330('0x10')](this));ami['on']('agentconnect',this[_0x8330('0x11')]['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0x8330('0x12'),this[_0x8330('0x13')][_0x8330('0x10')](this));ami['on'](_0x8330('0x14'),this[_0x8330('0x15')][_0x8330('0x10')](this));ami['on'](_0x8330('0x16'),this['syncVarSet'][_0x8330('0x10')](this));ami['on'](_0x8330('0x17'),this[_0x8330('0x18')]['bind'](this));ami['on'](_0x8330('0x19'),this[_0x8330('0x1a')][_0x8330('0x10')](this));ami['on']('musiconholdstop',this[_0x8330('0x1b')][_0x8330('0x10')](this));ami['on'](_0x8330('0x1c'),this['syncAttendedTransfer'][_0x8330('0x10')](this));ami['on'](_0x8330('0x1d'),this['syncBlindTransfer']['bind'](this));}VoiceAgentReport[_0x8330('0x1e')][_0x8330('0x1f')]=function(_0x12c015,_0x231368,_0x3efd6f){io['to'](_0x12c015)[_0x8330('0x1f')](_0x231368,_0x3efd6f);};VoiceAgentReport[_0x8330('0x1e')][_0x8330('0x20')]=function(_0x37444d){return _0x37444d!==null&&!_[_0x8330('0x21')](_0x37444d);};VoiceAgentReport[_0x8330('0x1e')][_0x8330('0xf')]=function(_0x5d7a08){try{if(this[_0x8330('0x20')](_0x5d7a08)){if(_['isUndefined'](this['channels'][_0x5d7a08[_0x8330('0x22')]])){this[_0x8330('0xa')][_0x5d7a08[_0x8330('0x22')]]={};}if(_[_0x8330('0x21')](this[_0x8330('0xa')][_0x5d7a08[_0x8330('0x22')]][_0x5d7a08[_0x8330('0x23')]])){this[_0x8330('0xa')][_0x5d7a08[_0x8330('0x22')]][_0x5d7a08['destuniqueid']]={'agentcalledAt':moment()['format'](_0x8330('0x24')),'lastevent':'called','variables':this[_0x8330('0xd')][_0x5d7a08['uniqueid']],'type':this[_0x8330('0xb')][_0x5d7a08[_0x8330('0x25')]]?this[_0x8330('0xb')][_0x5d7a08['queue']][_0x8330('0x26')]||_0x8330('0x27'):_0x8330('0x27')};}_['merge'](this[_0x8330('0xa')][_0x5d7a08['uniqueid']][_0x5d7a08[_0x8330('0x23')]],_[_0x8330('0x28')](_0x5d7a08,[_0x8330('0x29'),'privilege']));ami[_0x8330('0x1f')]('custom:agentcalled',this['channels'][_0x5d7a08[_0x8330('0x22')]][_0x5d7a08['destuniqueid']]);this['emit'](util[_0x8330('0x2a')]('user:%s',_0x5d7a08[_0x8330('0x2b')]),_0x8330('0x2c'),this[_0x8330('0xa')][_0x5d7a08[_0x8330('0x22')]][_0x5d7a08[_0x8330('0x23')]]);}}catch(_0x34515b){logger['error'](_0x8330('0x2d'),util[_0x8330('0x2e')](_0x34515b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentConnect']=function(_0x21cd89){try{if(this[_0x8330('0x20')](_0x21cd89)){if(this[_0x8330('0xa')][_0x21cd89['uniqueid']]){for(var _0x4eee12 in this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]]){if(this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x8330('0x2f')](_0x4eee12)){if(_0x21cd89[_0x8330('0x23')]===_0x4eee12){this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x4eee12][_0x8330('0x30')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x4eee12]['lastevent']=_0x8330('0x31');this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x4eee12][_0x8330('0x32')]=_0x21cd89['holdtime'];this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x4eee12][_0x8330('0x33')]=_0x21cd89[_0x8330('0x33')];this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x4eee12][_0x8330('0x34')]=_0x21cd89[_0x8330('0x34')];this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x4eee12][_0x8330('0x35')]=_0x21cd89[_0x8330('0x35')];this[_0x8330('0xa')][_0x21cd89['uniqueid']][_0x4eee12][_0x8330('0x36')]=_0x21cd89[_0x8330('0x36')];_[_0x8330('0x37')](this[_0x8330('0xc')][_0x21cd89[_0x8330('0x38')]],_[_0x8330('0x39')](_0x21cd89,[_0x8330('0x25'),_0x8330('0x3a')]));this[_0x8330('0x1f')](util['format'](_0x8330('0x3b'),_0x21cd89[_0x8330('0x2b')]),'user:agentconnect',this['channels'][_0x21cd89[_0x8330('0x22')]][_0x21cd89['destuniqueid']]);ami[_0x8330('0x1f')](_0x8330('0x3c'),this[_0x8330('0xa')][_0x21cd89['uniqueid']][_0x4eee12]);}else if(!this['channels'][_0x21cd89[_0x8330('0x22')]][_0x4eee12][_0x8330('0x3d')]&&!this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x4eee12]['agentcomplete']){this[_0x8330('0xa')][_0x21cd89['uniqueid']][_0x4eee12][_0x8330('0x3d')]=!![];this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x4eee12]['agentringnoanswerAt']=moment()[_0x8330('0x2a')](_0x8330('0x24'));this['channels'][_0x21cd89[_0x8330('0x22')]][_0x4eee12][_0x8330('0x3e')]=_0x8330('0x3f');this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x4eee12][_0x8330('0x40')]=_0x8330('0x3f');this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x4eee12][_0x8330('0x41')]=_0x21cd89[_0x8330('0x23')];this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x4eee12][_0x8330('0x42')]=_0x21cd89[_0x8330('0x2b')];ami[_0x8330('0x1f')](_0x8330('0x43'),this[_0x8330('0xa')][_0x21cd89[_0x8330('0x22')]][_0x4eee12]);}}}}}}catch(_0x1b0280){logger[_0x8330('0x44')](_0x8330('0x45'),util['inspect'](_0x1b0280,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8330('0x1e')]['syncAgentRingNoAnswer']=function(_0xb19baf){try{if(this[_0x8330('0x20')](_0xb19baf)){if(this[_0x8330('0xa')][_0xb19baf[_0x8330('0x22')]]&&this[_0x8330('0xa')][_0xb19baf[_0x8330('0x22')]][_0xb19baf['destuniqueid']]){this[_0x8330('0xa')][_0xb19baf['uniqueid']][_0xb19baf[_0x8330('0x23')]]['agentringnoanswer']=!![];this[_0x8330('0xa')][_0xb19baf[_0x8330('0x22')]][_0xb19baf[_0x8330('0x23')]]['agentringnoanswerAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0xb19baf[_0x8330('0x22')]][_0xb19baf[_0x8330('0x23')]][_0x8330('0x3e')]=_0x8330('0x46');this[_0x8330('0xa')][_0xb19baf[_0x8330('0x22')]][_0xb19baf['destuniqueid']][_0x8330('0x40')]='rejected';ami[_0x8330('0x1f')](_0x8330('0x47'),this[_0x8330('0xa')][_0xb19baf[_0x8330('0x22')]][_0xb19baf[_0x8330('0x23')]]);}}}catch(_0x31b6c1){logger['error']('[syncAgentRingNoAnswer][VoiceAgentReport]',util[_0x8330('0x2e')](_0x31b6c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8330('0x1e')]['syncQueueCallerAbandon']=function(_0x5e8b0e){try{if(this[_0x8330('0x20')](_0x5e8b0e)){if(this[_0x8330('0xa')][_0x5e8b0e[_0x8330('0x22')]]){for(var _0xf87420 in this['channels'][_0x5e8b0e[_0x8330('0x22')]]){if(this[_0x8330('0xa')][_0x5e8b0e['uniqueid']][_0x8330('0x2f')](_0xf87420)&&!this[_0x8330('0xa')][_0x5e8b0e['uniqueid']][_0xf87420]['agentringnoanswer']&&!this[_0x8330('0xa')][_0x5e8b0e[_0x8330('0x22')]][_0xf87420][_0x8330('0x14')]){this[_0x8330('0xa')][_0x5e8b0e[_0x8330('0x22')]][_0xf87420][_0x8330('0x3d')]=!![];this['channels'][_0x5e8b0e[_0x8330('0x22')]][_0xf87420][_0x8330('0x48')]=moment()[_0x8330('0x2a')](_0x8330('0x24'));this[_0x8330('0xa')][_0x5e8b0e['uniqueid']][_0xf87420][_0x8330('0x3e')]=_0x8330('0x49');this[_0x8330('0xa')][_0x5e8b0e['uniqueid']][_0xf87420][_0x8330('0x40')]='abandoned';ami[_0x8330('0x1f')]('custom:agentqueuecallerabandon',this['channels'][_0x5e8b0e[_0x8330('0x22')]][_0xf87420]);}}}}}catch(_0x51df04){logger[_0x8330('0x44')](_0x8330('0x4a'),util['inspect'](_0x51df04,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8330('0x1e')][_0x8330('0x15')]=function(_0x46e6b4){try{if(this[_0x8330('0x20')](_0x46e6b4)){if(this[_0x8330('0xa')][_0x46e6b4[_0x8330('0x22')]]){for(var _0x1ccaab in this[_0x8330('0xa')][_0x46e6b4[_0x8330('0x22')]]){if(this[_0x8330('0xa')][_0x46e6b4[_0x8330('0x22')]][_0x8330('0x2f')](_0x1ccaab)){if(this['channels'][_0x46e6b4[_0x8330('0x22')]][_0x1ccaab][_0x8330('0x30')]&&!this[_0x8330('0xa')][_0x46e6b4[_0x8330('0x22')]][_0x1ccaab][_0x8330('0x14')]){this[_0x8330('0xa')][_0x46e6b4[_0x8330('0x22')]][_0x1ccaab][_0x8330('0x14')]=!![];this['channels'][_0x46e6b4['uniqueid']][_0x1ccaab][_0x8330('0x4b')]=moment()['format'](_0x8330('0x24'));this[_0x8330('0xa')][_0x46e6b4['uniqueid']][_0x1ccaab]['lastevent']='complete';this[_0x8330('0xa')][_0x46e6b4['uniqueid']][_0x1ccaab][_0x8330('0x4c')]=_0x46e6b4[_0x8330('0x4c')];this[_0x8330('0xa')][_0x46e6b4[_0x8330('0x22')]][_0x1ccaab][_0x8330('0x3e')]=_0x46e6b4[_0x8330('0x3e')]==_0x8330('0x4d')?'agent':_0x46e6b4[_0x8330('0x3e')];if(this[_0x8330('0xb')][_0x46e6b4[_0x8330('0x25')]]&&this[_0x8330('0xb')][_0x46e6b4[_0x8330('0x25')]][_0x8330('0x4e')]){this[_0x8330('0xa')][_0x46e6b4[_0x8330('0x22')]][_0x1ccaab][_0x8330('0x4f')]=!![];this[_0x8330('0xa')][_0x46e6b4[_0x8330('0x22')]][_0x1ccaab][_0x8330('0x50')]=this[_0x8330('0xb')][_0x46e6b4[_0x8330('0x25')]][_0x8330('0x51')];}this[_0x8330('0xc')][_0x46e6b4[_0x8330('0x38')]]=_[_0x8330('0x28')](this[_0x8330('0xc')][_0x46e6b4[_0x8330('0x38')]],[_0x8330('0x25'),_0x8330('0x3a')]);this[_0x8330('0x1f')](util[_0x8330('0x2a')](_0x8330('0x3b'),_0x46e6b4[_0x8330('0x2b')]),_0x8330('0x52'),this[_0x8330('0xa')][_0x46e6b4[_0x8330('0x22')]][_0x1ccaab]);ami[_0x8330('0x1f')]('custom:agentcomplete',this['channels'][_0x46e6b4[_0x8330('0x22')]][_0x1ccaab]);}}}}}}catch(_0x52c794){logger[_0x8330('0x44')](_0x8330('0x53'),util[_0x8330('0x2e')](_0x52c794,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8330('0x54')]=function(_0x5b586d){try{if(this[_0x8330('0x20')](_0x5b586d)){this['addVariable'](_0x5b586d[_0x8330('0x22')],_['keys'](_0x5b586d[_0x8330('0x55')])[0x0],_0x5b586d['value']);if(this[_0x8330('0xa')][_0x5b586d[_0x8330('0x22')]]){for(var _0x86c80c in this[_0x8330('0xa')][_0x5b586d['uniqueid']]){if(this['channels'][_0x5b586d[_0x8330('0x22')]]['hasOwnProperty'](_0x86c80c)){if(_[_0x8330('0x21')](this[_0x8330('0xa')][_0x5b586d['uniqueid']][_0x86c80c]['variables'])){this[_0x8330('0xa')][_0x5b586d[_0x8330('0x22')]][_0x86c80c][_0x8330('0xd')]={};}this[_0x8330('0xa')][_0x5b586d[_0x8330('0x22')]][_0x86c80c]['variables']=this[_0x8330('0xd')][_0x5b586d[_0x8330('0x22')]];}}}}}catch(_0x3156f4){logger[_0x8330('0x44')](_0x8330('0x56'),util['inspect'](_0x3156f4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8330('0x1e')]['addVariable']=function(_0x4a22ec,_0x2c6c16,_0x385759){var _0x58e6bd=[_0x8330('0x57'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x8330('0x58'),_0x8330('0x59'),_0x8330('0x5a'),_0x8330('0x5b'),_0x8330('0x5c'),_0x8330('0x5d'),_0x8330('0x5e'),_0x8330('0x5f'),_0x8330('0x60'),_0x8330('0x61'),_0x8330('0x62'),_0x8330('0x63'),_0x8330('0x64'),'membername','memberpenalty',_0x8330('0x65')];if(!_[_0x8330('0x66')](_0x2c6c16)&&!_[_0x8330('0x67')](_0x58e6bd,_0x2c6c16)){if(_[_0x8330('0x21')](this[_0x8330('0xd')][_0x4a22ec])){this[_0x8330('0xd')][_0x4a22ec]={};}this['variables'][_0x4a22ec][_0x2c6c16]=_0x385759;}};VoiceAgentReport[_0x8330('0x1e')]['syncHangup']=function(_0x176e90){try{if(this[_0x8330('0x20')](_0x176e90)){if(this['channels'][_0x176e90['uniqueid']]){for(var _0x2c6712 in this[_0x8330('0xa')][_0x176e90['uniqueid']]){if(this[_0x8330('0xa')][_0x176e90[_0x8330('0x22')]][_0x8330('0x2f')](_0x2c6712)){if(this[_0x8330('0xa')][_0x176e90['uniqueid']][_0x2c6712][_0x8330('0x3e')]==_0x8330('0x4d')&&this[_0x8330('0xa')][_0x176e90[_0x8330('0x22')]][_0x2c6712][_0x8330('0x14')]){this[_0x8330('0xa')][_0x176e90[_0x8330('0x22')]][_0x2c6712][_0x8330('0x4b')]=moment()[_0x8330('0x2a')](_0x8330('0x24'));}}}ami[_0x8330('0x1f')](_0x8330('0x68'),_[_0x8330('0x69')](this['channels'][_0x176e90['uniqueid']]));delete this[_0x8330('0xa')][_0x176e90[_0x8330('0x22')]];}if(this[_0x8330('0xd')][_0x176e90[_0x8330('0x22')]]){delete this[_0x8330('0xd')][_0x176e90[_0x8330('0x22')]];}}}catch(_0x332b0c){logger[_0x8330('0x44')](_0x8330('0x6a'),util['inspect'](_0x332b0c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8330('0x1e')][_0x8330('0x6b')]=function(_0x31abd8){try{if(this[_0x8330('0x20')](_0x31abd8)){if(this[_0x8330('0xa')][_0x31abd8[_0x8330('0x6c')]]){for(var _0x4308f7 in this[_0x8330('0xa')][_0x31abd8[_0x8330('0x6c')]]){if(this[_0x8330('0xa')][_0x31abd8[_0x8330('0x6c')]]['hasOwnProperty'](_0x4308f7)){if(_0x31abd8['origtransfereruniqueid']===_0x4308f7){var _0x291064=moment();this[_0x8330('0xa')][_0x31abd8[_0x8330('0x6c')]][_0x4308f7][_0x8330('0x14')]=!![];this['channels'][_0x31abd8['transfereeuniqueid']][_0x4308f7]['agentcompleteAt']=moment()['format'](_0x8330('0x24'));this[_0x8330('0xa')][_0x31abd8[_0x8330('0x6c')]][_0x4308f7]['reason']=_0x8330('0x4d');this[_0x8330('0xa')][_0x31abd8['transfereeuniqueid']][_0x4308f7][_0x8330('0x40')]=_0x8330('0x6d');this['channels'][_0x31abd8[_0x8330('0x6c')]][_0x4308f7][_0x8330('0x4c')]=_0x291064[_0x8330('0x6e')](this[_0x8330('0xa')][_0x31abd8[_0x8330('0x6c')]][_0x4308f7][_0x8330('0x30')],_0x8330('0x6f'));}}}}if(this[_0x8330('0xa')][_0x31abd8[_0x8330('0x70')]]){var _0x41b712=this[_0x8330('0xa')][_0x31abd8['secondtransfereruniqueid']];this['channels'][_0x31abd8[_0x8330('0x70')]]=this[_0x8330('0xa')][_0x31abd8['transfereeuniqueid']];this[_0x8330('0xa')][_0x31abd8[_0x8330('0x6c')]]=_0x41b712;}}}catch(_0x52c042){logger['error'](_0x8330('0x71'),util['inspect'](_0x52c042,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8330('0x1e')][_0x8330('0x72')]=function(_0x4b7840){try{if(this[_0x8330('0x20')](_0x4b7840)){if(this[_0x8330('0xa')][_0x4b7840[_0x8330('0x6c')]]){for(var _0x4538c2 in this[_0x8330('0xa')][_0x4b7840['transfereeuniqueid']]){if(this['channels'][_0x4b7840[_0x8330('0x6c')]]['hasOwnProperty'](_0x4538c2)){if(_0x4b7840[_0x8330('0x73')]===_0x4538c2){var _0x3544ed=moment();this[_0x8330('0xa')][_0x4b7840[_0x8330('0x6c')]][_0x4538c2][_0x8330('0x14')]=!![];this[_0x8330('0xa')][_0x4b7840[_0x8330('0x6c')]][_0x4538c2][_0x8330('0x4b')]=_0x3544ed;this[_0x8330('0xa')][_0x4b7840['transfereeuniqueid']][_0x4538c2][_0x8330('0x3e')]=_0x8330('0x4d');this[_0x8330('0xa')][_0x4b7840[_0x8330('0x6c')]][_0x4538c2]['lastevent']=_0x8330('0x6d');this[_0x8330('0xa')][_0x4b7840[_0x8330('0x6c')]][_0x4538c2][_0x8330('0x4c')]=_0x3544ed[_0x8330('0x6e')](this[_0x8330('0xa')][_0x4b7840[_0x8330('0x6c')]][_0x4538c2][_0x8330('0x30')],'seconds');}}}}}}catch(_0x482ecf){logger[_0x8330('0x44')](_0x8330('0x74'),util['inspect'](_0x482ecf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8330('0x1e')][_0x8330('0x1a')]=function(_0x4a6f18){var _0x182011='';try{if(this['isNotNull'](_0x4a6f18)){if(_0x4a6f18[_0x8330('0x75')]){_0x182011=_0x4a6f18['channel'][_0x8330('0x76')](0x0,_0x4a6f18[_0x8330('0x75')][_0x8330('0x77')]('-'));if(this[_0x8330('0xc')][_0x182011]){this[_0x8330('0xc')][_0x182011]['onhold']=!![];}}}}catch(_0x504c13){logger[_0x8330('0x44')]('[syncMusicOnHoldStart][VoiceAgentReport]',util[_0x8330('0x2e')](_0x504c13,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8330('0x1e')][_0x8330('0x1b')]=function(_0x40c389){var _0x10ddda='';try{if(this[_0x8330('0x20')](_0x40c389)){if(_0x40c389['channel']){_0x10ddda=_0x40c389[_0x8330('0x75')]['substring'](0x0,_0x40c389[_0x8330('0x75')][_0x8330('0x77')]('-'));if(this['agents'][_0x10ddda]){this[_0x8330('0xc')][_0x10ddda][_0x8330('0x78')]=![];}}}}catch(_0x1e87fc){logger[_0x8330('0x44')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x8330('0x2e')](_0x1e87fc,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 42f800f..41ee8be 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d4a=['cdr(','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','membername','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','.wav49','.WAV','monitorFilename','monitors','isNil','push','rec','variable','xmd-phone','value','xmd-callerid','xmd-cdrtype','type','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','sipcalllinkedid','endtime','billableseconds','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','extension','BlindTransfer','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','moment','util','path','ioredis','../../../config/logger','ami','../model/channel','not_inuse','inuse','busy','unavailable','ringing','ringinuse','set','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','syncMusicOnHoldStop','then','actionCoreShowChannels','catch','isNotNull','prototype','emit','uniqueid','linkedid','isUndefined','merge','pick','keys','error','inspect','OutgoingSpoolFailed','starttime','format','disposition','toNumber','channelstate','context','from-sip','channel','split','destconnectedlinenum','exten','user:%s','name','user:agentconnect','accountcode','application','toLowerCase','applicationdata','appdata','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x2d4a,0xd8));var _0xa2d4=function(_0x5e059a,_0x4b2345){_0x5e059a=_0x5e059a-0x0;var _0x10a9e4=_0x2d4a[_0x5e059a];return _0x10a9e4;};'use strict';var BPromise=require(_0xa2d4('0x0'));var _=require('lodash');var moment=require(_0xa2d4('0x1'));var util=require(_0xa2d4('0x2'));var path=require(_0xa2d4('0x3'));var Redis=require(_0xa2d4('0x4'));var config=require('../../../config/environment');var logger=require(_0xa2d4('0x5'))(_0xa2d4('0x6'));var ami=require('../ami');var Channel=require(_0xa2d4('0x7'));var statusDesc=['unknown',_0xa2d4('0x8'),_0xa2d4('0x9'),_0xa2d4('0xa'),'invalid',_0xa2d4('0xb'),_0xa2d4('0xc'),_0xa2d4('0xd'),'onhold'];var applications=[_0xa2d4('0xe'),_0xa2d4('0xf'),_0xa2d4('0x10'),_0xa2d4('0x11'),'playback',_0xa2d4('0x12')];var dispositions=[_0xa2d4('0x13'),'FAILED',_0xa2d4('0x14'),_0xa2d4('0x13'),_0xa2d4('0x13'),_0xa2d4('0x13'),'ANSWERED','BUSY','FAILED',_0xa2d4('0x14'),'FAILED'];var actions={};config[_0xa2d4('0x15')]=_[_0xa2d4('0x16')](config[_0xa2d4('0x15')],{'host':_0xa2d4('0x17'),'port':0x18eb});var io=require(_0xa2d4('0x18'))(new Redis(config['redis']));function VoiceCallReport(_0x32a896){this['channels']=_0x32a896[_0xa2d4('0x19')];this[_0xa2d4('0x1a')]=_0x32a896['agents'];ami['on'](_0xa2d4('0x1b'),this[_0xa2d4('0x1c')]['bind'](this));ami['on'](_0xa2d4('0x1d'),this['syncNewExten'][_0xa2d4('0x1e')](this));ami['on'](_0xa2d4('0x1f'),this[_0xa2d4('0x20')][_0xa2d4('0x1e')](this));ami['on'](_0xa2d4('0x21'),this[_0xa2d4('0x22')]['bind'](this));ami['on'](_0xa2d4('0x23'),this[_0xa2d4('0x24')]['bind'](this));ami['on'](_0xa2d4('0x25'),this[_0xa2d4('0x26')]['bind'](this));ami['on'](_0xa2d4('0x27'),this[_0xa2d4('0x28')][_0xa2d4('0x1e')](this));ami['on'](_0xa2d4('0x29'),this[_0xa2d4('0x2a')][_0xa2d4('0x1e')](this));ami['on'](_0xa2d4('0x2b'),this[_0xa2d4('0x2c')][_0xa2d4('0x1e')](this));ami['on']('musiconholdstart',this[_0xa2d4('0x2d')][_0xa2d4('0x1e')](this));ami['on']('musiconholdstop',this[_0xa2d4('0x2e')]['bind'](this));return BPromise['resolve']()[_0xa2d4('0x2f')](ami[_0xa2d4('0x30')]())[_0xa2d4('0x31')](function(_0x5d0af1){console['log'](_0x5d0af1);});}VoiceCallReport['prototype'][_0xa2d4('0x32')]=function(_0x5e6368){return _0x5e6368!==null&&!_['isUndefined'](_0x5e6368);};VoiceCallReport[_0xa2d4('0x33')][_0xa2d4('0x34')]=function(_0x15970a,_0x5aa57e,_0x1d8b77){io['to'](_0x15970a)['emit'](_0x5aa57e,_0x1d8b77);};VoiceCallReport['prototype'][_0xa2d4('0x28')]=function(_0x3fa817){try{if(this['isNotNull'](_0x3fa817)){if(_0x3fa817[_0xa2d4('0x35')]===_0x3fa817[_0xa2d4('0x36')]){if(!_[_0xa2d4('0x37')](this[_0xa2d4('0x19')][_0x3fa817['uniqueid']])){_[_0xa2d4('0x38')](this['channels'][_0x3fa817[_0xa2d4('0x35')]],_[_0xa2d4('0x39')](_0x3fa817,_[_0xa2d4('0x3a')](this[_0xa2d4('0x19')][_0x3fa817[_0xa2d4('0x35')]])));}}}}catch(_0x3b3f79){logger[_0xa2d4('0x3b')]('[syncNewCallerId][VoiceCallReport]',util[_0xa2d4('0x3c')](_0x3b3f79,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2d4('0x33')]['syncNewChannel']=function(_0x128dad){try{if(this[_0xa2d4('0x32')](_0x128dad)){if(_0x128dad[_0xa2d4('0x35')]===_0x128dad['linkedid']&&_0x128dad['channel']!=_0xa2d4('0x3d')){if(_['isUndefined'](this['channels'][_0x128dad[_0xa2d4('0x35')]])){this[_0xa2d4('0x19')][_0x128dad['uniqueid']]=new Channel();this[_0xa2d4('0x19')][_0x128dad[_0xa2d4('0x35')]][_0xa2d4('0x3e')]=moment()[_0xa2d4('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x128dad[_0xa2d4('0x35')]][_0xa2d4('0x40')]=dispositions[_[_0xa2d4('0x41')](_0x128dad[_0xa2d4('0x42')])];_[_0xa2d4('0x38')](this['channels'][_0x128dad[_0xa2d4('0x35')]],_['pick'](_0x128dad,_[_0xa2d4('0x3a')](this[_0xa2d4('0x19')][_0x128dad[_0xa2d4('0x35')]])));if(_0x128dad[_0xa2d4('0x43')]===_0xa2d4('0x44')){if(this[_0xa2d4('0x1a')][_0x128dad[_0xa2d4('0x45')][_0xa2d4('0x46')]('-')[0x0]]){this[_0xa2d4('0x1a')][_0x128dad[_0xa2d4('0x45')][_0xa2d4('0x46')]('-')[0x0]][_0xa2d4('0x47')]=_0x128dad[_0xa2d4('0x48')];this[_0xa2d4('0x34')](util['format'](_0xa2d4('0x49'),this[_0xa2d4('0x1a')][_0x128dad[_0xa2d4('0x45')]['split']('-')[0x0]][_0xa2d4('0x4a')]),_0xa2d4('0x4b'),{'destaccountcode':this['agents'][_0x128dad['channel'][_0xa2d4('0x46')]('-')[0x0]][_0xa2d4('0x4c')],'destconnectedlinenum':_0x128dad[_0xa2d4('0x48')]});}}}}}}catch(_0x1b930a){logger[_0xa2d4('0x3b')]('[syncNewChannel][VoiceCallReport]',util[_0xa2d4('0x3c')](_0x1b930a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2d4('0x33')][_0xa2d4('0x1c')]=function(_0x41514a){try{if(this[_0xa2d4('0x32')](_0x41514a)){if(_0x41514a['uniqueid']===_0x41514a['linkedid']&&_0x41514a[_0xa2d4('0x48')]!='h'&&_0x41514a[_0xa2d4('0x45')]!=_0xa2d4('0x3d')){_0x41514a[_0xa2d4('0x4d')]=_0x41514a['application'][_0xa2d4('0x4e')]();_0x41514a[_0xa2d4('0x4f')]=(_0x41514a[_0xa2d4('0x50')]||_0x41514a[_0xa2d4('0x4f')])['toLowerCase']();if(_[_0xa2d4('0x37')](this[_0xa2d4('0x19')][_0x41514a[_0xa2d4('0x35')]])){this['channels'][_0x41514a['uniqueid']]=new Channel();this[_0xa2d4('0x19')][_0x41514a[_0xa2d4('0x35')]]['starttime']=_0x41514a[_0xa2d4('0x51')]?moment()[_0xa2d4('0x52')](moment[_0xa2d4('0x51')](_0x41514a['duration'])[_0xa2d4('0x53')](),_0xa2d4('0x53'))[_0xa2d4('0x3f')](_0xa2d4('0x54')):moment()[_0xa2d4('0x3f')](_0xa2d4('0x54'));this[_0xa2d4('0x19')][_0x41514a[_0xa2d4('0x35')]]['disposition']=_0xa2d4('0x13');}_[_0xa2d4('0x38')](this[_0xa2d4('0x19')][_0x41514a[_0xa2d4('0x35')]],_[_0xa2d4('0x39')](_0x41514a,_[_0xa2d4('0x3a')](this[_0xa2d4('0x19')][_0x41514a[_0xa2d4('0x35')]])));if(_[_0xa2d4('0x55')](applications,_0x41514a[_0xa2d4('0x4d')])){this['channels'][_0x41514a[_0xa2d4('0x35')]][_0xa2d4('0x56')]=_0x41514a[_0xa2d4('0x4d')];this[_0xa2d4('0x19')][_0x41514a['uniqueid']][_0xa2d4('0x57')]=_0x41514a[_0xa2d4('0x4f')];if(_0x41514a[_0xa2d4('0x4d')]==='set'&&_['startsWith'](_0x41514a['applicationdata'],_0xa2d4('0x58'))){var _0x16e8a9=_0x41514a[_0xa2d4('0x4f')][_0xa2d4('0x46')]('=');var _0x1b3aef=_0x16e8a9[0x0]['match'](/cdr\((.*)\)/);if(_0x1b3aef){this[_0xa2d4('0x19')][_0x41514a['uniqueid']][_0x1b3aef[0x1]]=_0x16e8a9[0x1];}}else if(_0x41514a['application']===_0xa2d4('0xf')){this['channels'][_0x41514a[_0xa2d4('0x35')]][_0xa2d4('0xf')]=_0x41514a[_0xa2d4('0x4f')][_0xa2d4('0x46')](',')[0x0];}}}}}catch(_0x28066b){logger['error'](_0xa2d4('0x59'),util[_0xa2d4('0x3c')](_0x28066b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2d4('0x33')]['syncNewState']=function(_0x1ef8ef){try{if(this[_0xa2d4('0x32')](_0x1ef8ef)){if(_0x1ef8ef[_0xa2d4('0x35')]!==_0x1ef8ef[_0xa2d4('0x36')]){if(this[_0xa2d4('0x19')][_0x1ef8ef[_0xa2d4('0x36')]]){if(_0x1ef8ef[_0xa2d4('0x42')]==='6'){if(!this[_0xa2d4('0x19')][_0x1ef8ef['linkedid']][_0xa2d4('0x5a')]){var _0x1ce79d=moment();this[_0xa2d4('0x19')][_0x1ef8ef['linkedid']][_0xa2d4('0x5a')]=!![];this['channels'][_0x1ef8ef[_0xa2d4('0x36')]][_0xa2d4('0x5b')]=_0x1ce79d[_0xa2d4('0x3f')](_0xa2d4('0x54'));if(this[_0xa2d4('0x19')][_0x1ef8ef[_0xa2d4('0x36')]][_0xa2d4('0x3e')]){this[_0xa2d4('0x19')][_0x1ef8ef[_0xa2d4('0x36')]][_0xa2d4('0x5c')]=_0x1ce79d[_0xa2d4('0x5d')](this[_0xa2d4('0x19')][_0x1ef8ef[_0xa2d4('0x36')]]['starttime'],_0xa2d4('0x53'));}}this['channels'][_0x1ef8ef[_0xa2d4('0x36')]][_0xa2d4('0x36')]=_0x1ef8ef[_0xa2d4('0x35')];if(_0x1ef8ef[_0xa2d4('0x5e')]!==_0xa2d4('0x5f')){this[_0xa2d4('0x19')][_0x1ef8ef[_0xa2d4('0x36')]][_0xa2d4('0x60')]=_0x1ef8ef[_0xa2d4('0x5e')];}this[_0xa2d4('0x19')][_0x1ef8ef[_0xa2d4('0x36')]][_0xa2d4('0x61')]=_0x1ef8ef[_0xa2d4('0x62')];this[_0xa2d4('0x19')][_0x1ef8ef[_0xa2d4('0x36')]][_0xa2d4('0x63')]=_0x1ef8ef['channel'];this[_0xa2d4('0x19')][_0x1ef8ef[_0xa2d4('0x36')]]['disposition']=dispositions[_[_0xa2d4('0x41')](_0x1ef8ef[_0xa2d4('0x42')])];if(this[_0xa2d4('0x1a')][_0x1ef8ef['channel']['split']('-')[0x0]]){this[_0xa2d4('0x19')][_0x1ef8ef[_0xa2d4('0x36')]]['UserId']=this[_0xa2d4('0x1a')][_0x1ef8ef[_0xa2d4('0x45')][_0xa2d4('0x46')]('-')[0x0]]['id'];this[_0xa2d4('0x19')][_0x1ef8ef[_0xa2d4('0x36')]][_0xa2d4('0x64')]=this[_0xa2d4('0x1a')][_0x1ef8ef[_0xa2d4('0x45')][_0xa2d4('0x46')]('-')[0x0]][_0xa2d4('0x4a')];}}}}else{if(this[_0xa2d4('0x19')][_0x1ef8ef['uniqueid']]){if(_0x1ef8ef[_0xa2d4('0x42')]==='6'){if(this[_0xa2d4('0x1a')][_0x1ef8ef[_0xa2d4('0x45')][_0xa2d4('0x46')]('-')[0x0]]){this[_0xa2d4('0x19')][_0x1ef8ef[_0xa2d4('0x35')]][_0xa2d4('0x65')]=this[_0xa2d4('0x1a')][_0x1ef8ef['channel'][_0xa2d4('0x46')]('-')[0x0]]['id'];this['channels'][_0x1ef8ef['uniqueid']][_0xa2d4('0x64')]=this[_0xa2d4('0x1a')][_0x1ef8ef[_0xa2d4('0x45')][_0xa2d4('0x46')]('-')[0x0]][_0xa2d4('0x4a')];}}}}}}catch(_0x58893c){logger['error'](_0xa2d4('0x66'),util[_0xa2d4('0x3c')](_0x58893c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2d4('0x33')][_0xa2d4('0x67')]=function(_0x185156,_0x2810b3){if(this[_0xa2d4('0x19')][_0x185156]){this[_0xa2d4('0x19')][_0x185156][_0xa2d4('0x68')]=!![];if(_['endsWith'](_0x2810b3,_0xa2d4('0x69'))){_0x2810b3=_0x2810b3['replace'](_0xa2d4('0x69'),_0xa2d4('0x6a'));}this[_0xa2d4('0x19')][_0x185156][_0xa2d4('0x6b')]=_0x2810b3;var _0x6daf7f=_['find'](this[_0xa2d4('0x19')][_0x185156][_0xa2d4('0x6c')],{'filename':_0x2810b3});if(_[_0xa2d4('0x6d')](_0x6daf7f)){this[_0xa2d4('0x19')][_0x185156]['monitors'][_0xa2d4('0x6e')]({'filename':_0x2810b3,'createdAt':moment()[_0xa2d4('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xa2d4('0x6f')});}}};VoiceCallReport[_0xa2d4('0x33')][_0xa2d4('0x24')]=function(_0x59e69e){try{if(this['isNotNull'](_0x59e69e)){if(this[_0xa2d4('0x19')][_0x59e69e['uniqueid']]&&_0x59e69e['channel']!=_0xa2d4('0x3d')){if(this[_0xa2d4('0x32')](_0x59e69e[_0xa2d4('0x70')])){if(this[_0xa2d4('0x32')](_0x59e69e['variable']['mixmonitor_filename'])){this[_0xa2d4('0x67')](_0x59e69e['uniqueid'],_0x59e69e['value']);}else if(this[_0xa2d4('0x32')](_0x59e69e[_0xa2d4('0x70')][_0xa2d4('0x71')])){this[_0xa2d4('0x19')][_0x59e69e[_0xa2d4('0x35')]][_0xa2d4('0x5e')]=_0x59e69e[_0xa2d4('0x72')];}else if(this[_0xa2d4('0x32')](_0x59e69e['variable'][_0xa2d4('0x73')])){this['channels'][_0x59e69e[_0xa2d4('0x35')]]['callerid']=_0x59e69e[_0xa2d4('0x72')];}else if(this[_0xa2d4('0x32')](_0x59e69e[_0xa2d4('0x70')][_0xa2d4('0x74')])){this[_0xa2d4('0x19')][_0x59e69e[_0xa2d4('0x35')]][_0xa2d4('0x75')]=_0x59e69e[_0xa2d4('0x72')];}else if(this[_0xa2d4('0x32')](_0x59e69e[_0xa2d4('0x70')][_0xa2d4('0x76')])){this[_0xa2d4('0x19')][_0x59e69e[_0xa2d4('0x35')]][_0xa2d4('0xf')]=_0x59e69e[_0xa2d4('0x72')]['split'](',')[0x0];}else if(this[_0xa2d4('0x32')](_0x59e69e['variable'][_0xa2d4('0x77')])){this[_0xa2d4('0x19')][_0x59e69e[_0xa2d4('0x35')]][_0xa2d4('0x78')]=_0x59e69e['value'];}else if(this[_0xa2d4('0x32')](_0x59e69e[_0xa2d4('0x70')]['xmd-destination'])){this[_0xa2d4('0x19')][_0x59e69e[_0xa2d4('0x35')]][_0xa2d4('0x79')]=_0x59e69e['value'];}else if(this[_0xa2d4('0x32')](_0x59e69e[_0xa2d4('0x70')][_0xa2d4('0x7a')])){this[_0xa2d4('0x19')][_0x59e69e[_0xa2d4('0x35')]][_0xa2d4('0x7b')]=_0x59e69e['value'];}else if(this[_0xa2d4('0x32')](_0x59e69e[_0xa2d4('0x70')][_0xa2d4('0x7c')])){this['channels'][_0x59e69e['uniqueid']]['queue']=_0x59e69e['value'];}else if(this['isNotNull'](_0x59e69e[_0xa2d4('0x70')][_0xa2d4('0x7d')])){this[_0xa2d4('0x19')][_0x59e69e['uniqueid']][_0xa2d4('0x7e')]=_0x59e69e[_0xa2d4('0x72')];}}}else if(this[_0xa2d4('0x32')](_0x59e69e['variable']['mixmonitor_filename'])){if(_0x59e69e[_0xa2d4('0x72')]){var _0x413751=path[_0xa2d4('0x7f')](_0x59e69e[_0xa2d4('0x72')])[_0xa2d4('0x4a')];this['syncMixMonitorFilename'](_0x413751,_0x59e69e[_0xa2d4('0x72')]);}}else if(this['channels'][_0x59e69e[_0xa2d4('0x36')]]){if(this['isNotNull'](_0x59e69e[_0xa2d4('0x70')])){if(this[_0xa2d4('0x32')](_0x59e69e['variable'][_0xa2d4('0x7d')])){this[_0xa2d4('0x19')][_0x59e69e['linkedid']][_0xa2d4('0x80')]=_0x59e69e[_0xa2d4('0x72')];}}}}}catch(_0x22b3d2){logger[_0xa2d4('0x3b')]('[syncVarSet][VoiceCallReport]',util[_0xa2d4('0x3c')](_0x22b3d2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2d4('0x33')][_0xa2d4('0x26')]=function(_0x1af8f8){try{if(this['isNotNull'](_0x1af8f8)){if(this[_0xa2d4('0x19')][_0x1af8f8['uniqueid']]){var _0x2557d4=moment();this[_0xa2d4('0x19')][_0x1af8f8[_0xa2d4('0x35')]][_0xa2d4('0x81')]=_0x2557d4[_0xa2d4('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa2d4('0x19')][_0x1af8f8[_0xa2d4('0x35')]][_0xa2d4('0x51')]=_0x2557d4[_0xa2d4('0x5d')](this[_0xa2d4('0x19')][_0x1af8f8[_0xa2d4('0x35')]]['starttime'],_0xa2d4('0x53'));if(this[_0xa2d4('0x19')][_0x1af8f8[_0xa2d4('0x35')]][_0xa2d4('0x5a')]){this[_0xa2d4('0x19')][_0x1af8f8['uniqueid']][_0xa2d4('0x82')]=_0x2557d4[_0xa2d4('0x5d')](this[_0xa2d4('0x19')][_0x1af8f8[_0xa2d4('0x35')]][_0xa2d4('0x5b')],_0xa2d4('0x53'));this['channels'][_0x1af8f8['uniqueid']][_0xa2d4('0x5c')]=this[_0xa2d4('0x19')][_0x1af8f8[_0xa2d4('0x35')]][_0xa2d4('0x51')]-this[_0xa2d4('0x19')][_0x1af8f8[_0xa2d4('0x35')]]['billableseconds'];}if(_0x1af8f8[_0xa2d4('0x43')]===_0xa2d4('0x44')){if(this['agents'][_0x1af8f8[_0xa2d4('0x45')][_0xa2d4('0x46')]('-')[0x0]]){this[_0xa2d4('0x1a')][_0x1af8f8[_0xa2d4('0x45')][_0xa2d4('0x46')]('-')[0x0]]=_[_0xa2d4('0x83')](this[_0xa2d4('0x1a')][_0x1af8f8[_0xa2d4('0x45')][_0xa2d4('0x46')]('-')[0x0]],[_0xa2d4('0x47')]);this[_0xa2d4('0x34')](util[_0xa2d4('0x3f')](_0xa2d4('0x49'),this[_0xa2d4('0x1a')][_0x1af8f8[_0xa2d4('0x45')][_0xa2d4('0x46')]('-')[0x0]][_0xa2d4('0x4a')]),_0xa2d4('0x84'),{'destaccountcode':this['agents'][_0x1af8f8[_0xa2d4('0x45')]['split']('-')[0x0]][_0xa2d4('0x4c')]});}}ami[_0xa2d4('0x34')](_0xa2d4('0x85'),this[_0xa2d4('0x19')][_0x1af8f8['uniqueid']]);delete this['channels'][_0x1af8f8[_0xa2d4('0x35')]];}}}catch(_0x21b244){logger[_0xa2d4('0x3b')](_0xa2d4('0x86'),util['inspect'](_0x21b244,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncAttendedTransfer']=function(_0x1af11f){try{if(this[_0xa2d4('0x32')](_0x1af11f)){if(this[_0xa2d4('0x19')][_0x1af11f[_0xa2d4('0x87')]]){this[_0xa2d4('0x19')][_0x1af11f[_0xa2d4('0x87')]][_0xa2d4('0x88')]=_0x1af11f[_0xa2d4('0x89')];this[_0xa2d4('0x19')][_0x1af11f[_0xa2d4('0x87')]][_0xa2d4('0x8a')]=_0x1af11f[_0xa2d4('0x8b')];if(this['channels'][_0x1af11f['secondtransfereruniqueid']]){var _0x51ecf5=this['channels'][_0x1af11f[_0xa2d4('0x8c')]];this[_0xa2d4('0x19')][_0x1af11f[_0xa2d4('0x8c')]]=this[_0xa2d4('0x19')][_0x1af11f[_0xa2d4('0x87')]];this['channels'][_0x1af11f[_0xa2d4('0x87')]]=_0x51ecf5;}}else if(this[_0xa2d4('0x19')][_0x1af11f['transfertargetuniqueid']]){this[_0xa2d4('0x19')][_0x1af11f[_0xa2d4('0x8d')]][_0xa2d4('0x88')]=_0x1af11f[_0xa2d4('0x89')];this[_0xa2d4('0x19')][_0x1af11f[_0xa2d4('0x8d')]][_0xa2d4('0x8a')]=_0x1af11f['transfertargetcalleridnum'];if(this[_0xa2d4('0x19')][_0x1af11f[_0xa2d4('0x8e')]]){var _0x51ecf5=this[_0xa2d4('0x19')][_0x1af11f[_0xa2d4('0x8e')]];this[_0xa2d4('0x19')][_0x1af11f[_0xa2d4('0x8e')]]=this['channels'][_0x1af11f[_0xa2d4('0x8d')]];this['channels'][_0x1af11f[_0xa2d4('0x8d')]]=_0x51ecf5;}}}}catch(_0x13fb04){logger[_0xa2d4('0x3b')](_0xa2d4('0x8f'),util[_0xa2d4('0x3c')](_0x13fb04,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa2d4('0x2c')]=function(_0x4f5029){try{if(this[_0xa2d4('0x32')](_0x4f5029)){if(this[_0xa2d4('0x19')][_0x4f5029[_0xa2d4('0x87')]]){this[_0xa2d4('0x19')][_0x4f5029[_0xa2d4('0x87')]][_0xa2d4('0x88')]=_0x4f5029[_0xa2d4('0x90')];this[_0xa2d4('0x19')][_0x4f5029[_0xa2d4('0x87')]][_0xa2d4('0x8a')]=_0x4f5029[_0xa2d4('0x91')];this[_0xa2d4('0x26')]({'event':_0xa2d4('0x92'),'uniqueid':_0x4f5029[_0xa2d4('0x87')],'context':_0x4f5029[_0xa2d4('0x43')],'channel':_0x4f5029['transfererchannel']});}}}catch(_0x143048){logger[_0xa2d4('0x3b')]('[syncBlindTransfer][VoiceCallReport]',util['inspect'](_0x143048,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2d4('0x33')][_0xa2d4('0x2d')]=function(_0x3795dd){try{if(this[_0xa2d4('0x32')](_0x3795dd)){if(this[_0xa2d4('0x19')][_0x3795dd[_0xa2d4('0x35')]]){if(!_[_0xa2d4('0x6d')](this['channels'][_0x3795dd['uniqueid']][_0xa2d4('0x5b')])){this[_0xa2d4('0x19')][_0x3795dd['uniqueid']][_0xa2d4('0x93')]=moment()[_0xa2d4('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x5c0419){logger[_0xa2d4('0x3b')](_0xa2d4('0x94'),util['inspect'](_0x5c0419,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa2d4('0x33')][_0xa2d4('0x2e')]=function(_0x577dab){try{if(this[_0xa2d4('0x32')](_0x577dab)){if(this[_0xa2d4('0x19')][_0x577dab['uniqueid']]){if(!_[_0xa2d4('0x6d')](this[_0xa2d4('0x19')][_0x577dab[_0xa2d4('0x35')]][_0xa2d4('0x93')])){this[_0xa2d4('0x19')][_0x577dab[_0xa2d4('0x35')]][_0xa2d4('0x95')]+=moment()['milliseconds'](0x0)[_0xa2d4('0x5d')](this['channels'][_0x577dab[_0xa2d4('0x35')]]['mohstarttime'],_0xa2d4('0x53'));delete this[_0xa2d4('0x19')][_0x577dab[_0xa2d4('0x35')]]['mohstarttime'];}}}}catch(_0x2120e){logger['error'](_0xa2d4('0x96'),util[_0xa2d4('0x3c')](_0x2120e,{'showHidden':![],'depth':null}));}};module[_0xa2d4('0x97')]=VoiceCallReport; \ No newline at end of file +var _0x9762=['syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','merge','pick','keys','[syncNewCallerId][VoiceCallReport]','inspect','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','channelstate','context','from-sip','split','destconnectedlinenum','exten','user:%s','accountcode','error','[syncNewChannel][VoiceCallReport]','application','toLowerCase','applicationdata','duration','subtract','seconds','disposition','includes','lastapplication','lastdata','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinename','calleridname','toNumber','membername','name','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','monitorFilename','find','monitors','isNil','push','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','billableseconds','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','extension','BlindTransfer','transfererchannel','[syncMusicOnHoldStart][VoiceCallReport]','mohstarttime','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','../model/channel','unknown','not_inuse','busy','invalid','ringinuse','onhold','set','queue','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','socket.io-emitter','redis','channels','agents','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset'];(function(_0x54c813,_0x569fe6){var _0x40c540=function(_0x3f1779){while(--_0x3f1779){_0x54c813['push'](_0x54c813['shift']());}};_0x40c540(++_0x569fe6);}(_0x9762,0x19c));var _0x2976=function(_0x4c6470,_0x2c3538){_0x4c6470=_0x4c6470-0x0;var _0x15876a=_0x9762[_0x4c6470];return _0x15876a;};'use strict';var BPromise=require('bluebird');var _=require(_0x2976('0x0'));var moment=require(_0x2976('0x1'));var util=require(_0x2976('0x2'));var path=require(_0x2976('0x3'));var Redis=require(_0x2976('0x4'));var config=require(_0x2976('0x5'));var logger=require(_0x2976('0x6'))('ami');var ami=require('../ami');var Channel=require(_0x2976('0x7'));var statusDesc=[_0x2976('0x8'),_0x2976('0x9'),'inuse',_0x2976('0xa'),_0x2976('0xb'),'unavailable','ringing',_0x2976('0xc'),_0x2976('0xd')];var applications=[_0x2976('0xe'),_0x2976('0xf'),_0x2976('0x10'),_0x2976('0x11'),'playback',_0x2976('0x12')];var dispositions=[_0x2976('0x13'),_0x2976('0x14'),'FAILED',_0x2976('0x13'),'NO\x20ANSWER','NO\x20ANSWER',_0x2976('0x15'),_0x2976('0x16'),_0x2976('0x14'),_0x2976('0x14'),'FAILED'];var actions={};config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x2976('0x17'))(new Redis(config[_0x2976('0x18')]));function VoiceCallReport(_0x3a952f){this[_0x2976('0x19')]=_0x3a952f[_0x2976('0x19')];this[_0x2976('0x1a')]=_0x3a952f[_0x2976('0x1a')];ami['on'](_0x2976('0x1b'),this[_0x2976('0x1c')][_0x2976('0x1d')](this));ami['on']('newexten',this[_0x2976('0x1c')][_0x2976('0x1d')](this));ami['on'](_0x2976('0x1e'),this[_0x2976('0x1f')][_0x2976('0x1d')](this));ami['on'](_0x2976('0x20'),this[_0x2976('0x21')][_0x2976('0x1d')](this));ami['on'](_0x2976('0x22'),this[_0x2976('0x23')][_0x2976('0x1d')](this));ami['on'](_0x2976('0x24'),this[_0x2976('0x25')][_0x2976('0x1d')](this));ami['on'](_0x2976('0x26'),this[_0x2976('0x27')][_0x2976('0x1d')](this));ami['on'](_0x2976('0x28'),this[_0x2976('0x29')]['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x2976('0x1d')](this));ami['on'](_0x2976('0x2a'),this[_0x2976('0x2b')]['bind'](this));ami['on'](_0x2976('0x2c'),this[_0x2976('0x2d')]['bind'](this));return BPromise[_0x2976('0x2e')]()[_0x2976('0x2f')](ami[_0x2976('0x30')]())[_0x2976('0x31')](function(_0x119ea7){console['log'](_0x119ea7);});}VoiceCallReport[_0x2976('0x32')][_0x2976('0x33')]=function(_0x32d0f9){return _0x32d0f9!==null&&!_[_0x2976('0x34')](_0x32d0f9);};VoiceCallReport['prototype']['emit']=function(_0x5244ac,_0xbc2a5c,_0x186e3c){io['to'](_0x5244ac)[_0x2976('0x35')](_0xbc2a5c,_0x186e3c);};VoiceCallReport[_0x2976('0x32')][_0x2976('0x27')]=function(_0x3b1565){try{if(this['isNotNull'](_0x3b1565)){if(_0x3b1565[_0x2976('0x36')]===_0x3b1565[_0x2976('0x37')]){if(!_[_0x2976('0x34')](this[_0x2976('0x19')][_0x3b1565[_0x2976('0x36')]])){_[_0x2976('0x38')](this[_0x2976('0x19')][_0x3b1565[_0x2976('0x36')]],_[_0x2976('0x39')](_0x3b1565,_[_0x2976('0x3a')](this[_0x2976('0x19')][_0x3b1565[_0x2976('0x36')]])));}}}}catch(_0x284c5d){logger['error'](_0x2976('0x3b'),util[_0x2976('0x3c')](_0x284c5d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x2976('0x1f')]=function(_0x569bce){try{if(this[_0x2976('0x33')](_0x569bce)){if(_0x569bce[_0x2976('0x36')]===_0x569bce[_0x2976('0x37')]&&_0x569bce[_0x2976('0x3d')]!=_0x2976('0x3e')){if(_[_0x2976('0x34')](this[_0x2976('0x19')][_0x569bce[_0x2976('0x36')]])){this['channels'][_0x569bce[_0x2976('0x36')]]=new Channel();this[_0x2976('0x19')][_0x569bce[_0x2976('0x36')]][_0x2976('0x3f')]=moment()[_0x2976('0x40')](_0x2976('0x41'));this[_0x2976('0x19')][_0x569bce[_0x2976('0x36')]]['disposition']=dispositions[_['toNumber'](_0x569bce[_0x2976('0x42')])];_[_0x2976('0x38')](this[_0x2976('0x19')][_0x569bce[_0x2976('0x36')]],_[_0x2976('0x39')](_0x569bce,_['keys'](this[_0x2976('0x19')][_0x569bce[_0x2976('0x36')]])));if(_0x569bce[_0x2976('0x43')]===_0x2976('0x44')){if(this[_0x2976('0x1a')][_0x569bce[_0x2976('0x3d')][_0x2976('0x45')]('-')[0x0]]){this['agents'][_0x569bce['channel'][_0x2976('0x45')]('-')[0x0]][_0x2976('0x46')]=_0x569bce[_0x2976('0x47')];this['emit'](util['format'](_0x2976('0x48'),this['agents'][_0x569bce[_0x2976('0x3d')][_0x2976('0x45')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this['agents'][_0x569bce[_0x2976('0x3d')][_0x2976('0x45')]('-')[0x0]][_0x2976('0x49')],'destconnectedlinenum':_0x569bce[_0x2976('0x47')]});}}}}}}catch(_0x553851){logger[_0x2976('0x4a')](_0x2976('0x4b'),util[_0x2976('0x3c')](_0x553851,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2976('0x32')][_0x2976('0x1c')]=function(_0x46d6d6){try{if(this[_0x2976('0x33')](_0x46d6d6)){if(_0x46d6d6[_0x2976('0x36')]===_0x46d6d6[_0x2976('0x37')]&&_0x46d6d6[_0x2976('0x47')]!='h'&&_0x46d6d6[_0x2976('0x3d')]!=_0x2976('0x3e')){_0x46d6d6['application']=_0x46d6d6[_0x2976('0x4c')][_0x2976('0x4d')]();_0x46d6d6[_0x2976('0x4e')]=(_0x46d6d6['appdata']||_0x46d6d6[_0x2976('0x4e')])[_0x2976('0x4d')]();if(_['isUndefined'](this[_0x2976('0x19')][_0x46d6d6[_0x2976('0x36')]])){this[_0x2976('0x19')][_0x46d6d6['uniqueid']]=new Channel();this[_0x2976('0x19')][_0x46d6d6[_0x2976('0x36')]]['starttime']=_0x46d6d6[_0x2976('0x4f')]?moment()[_0x2976('0x50')](moment[_0x2976('0x4f')](_0x46d6d6[_0x2976('0x4f')])[_0x2976('0x51')](),_0x2976('0x51'))['format']('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x2976('0x40')](_0x2976('0x41'));this[_0x2976('0x19')][_0x46d6d6[_0x2976('0x36')]][_0x2976('0x52')]=_0x2976('0x13');}_[_0x2976('0x38')](this[_0x2976('0x19')][_0x46d6d6[_0x2976('0x36')]],_[_0x2976('0x39')](_0x46d6d6,_[_0x2976('0x3a')](this['channels'][_0x46d6d6[_0x2976('0x36')]])));if(_[_0x2976('0x53')](applications,_0x46d6d6['application'])){this[_0x2976('0x19')][_0x46d6d6['uniqueid']][_0x2976('0x54')]=_0x46d6d6['application'];this['channels'][_0x46d6d6['uniqueid']][_0x2976('0x55')]=_0x46d6d6[_0x2976('0x4e')];if(_0x46d6d6[_0x2976('0x4c')]===_0x2976('0xe')&&_['startsWith'](_0x46d6d6[_0x2976('0x4e')],'cdr(')){var _0x3a302c=_0x46d6d6[_0x2976('0x4e')][_0x2976('0x45')]('=');var _0x3e95a0=_0x3a302c[0x0]['match'](/cdr\((.*)\)/);if(_0x3e95a0){this[_0x2976('0x19')][_0x46d6d6['uniqueid']][_0x3e95a0[0x1]]=_0x3a302c[0x1];}}else if(_0x46d6d6['application']===_0x2976('0xf')){this['channels'][_0x46d6d6[_0x2976('0x36')]][_0x2976('0xf')]=_0x46d6d6['applicationdata'][_0x2976('0x45')](',')[0x0];}}}}}catch(_0x44c408){logger[_0x2976('0x4a')](_0x2976('0x56'),util[_0x2976('0x3c')](_0x44c408,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x2976('0x21')]=function(_0x4c81eb){try{if(this[_0x2976('0x33')](_0x4c81eb)){if(_0x4c81eb[_0x2976('0x36')]!==_0x4c81eb['linkedid']){if(this[_0x2976('0x19')][_0x4c81eb[_0x2976('0x37')]]){if(_0x4c81eb[_0x2976('0x42')]==='6'){if(!this['channels'][_0x4c81eb['linkedid']][_0x2976('0x57')]){var _0x3c3a8d=moment();this[_0x2976('0x19')][_0x4c81eb[_0x2976('0x37')]][_0x2976('0x57')]=!![];this[_0x2976('0x19')][_0x4c81eb[_0x2976('0x37')]][_0x2976('0x58')]=_0x3c3a8d[_0x2976('0x40')](_0x2976('0x41'));if(this[_0x2976('0x19')][_0x4c81eb['linkedid']][_0x2976('0x3f')]){this[_0x2976('0x19')][_0x4c81eb[_0x2976('0x37')]][_0x2976('0x59')]=_0x3c3a8d[_0x2976('0x5a')](this[_0x2976('0x19')][_0x4c81eb[_0x2976('0x37')]][_0x2976('0x3f')],'seconds');}}this['channels'][_0x4c81eb[_0x2976('0x37')]][_0x2976('0x37')]=_0x4c81eb[_0x2976('0x36')];if(_0x4c81eb[_0x2976('0x5b')]!==_0x2976('0x5c')){this[_0x2976('0x19')][_0x4c81eb[_0x2976('0x37')]]['connectedlinenum']=_0x4c81eb[_0x2976('0x5b')];}this[_0x2976('0x19')][_0x4c81eb[_0x2976('0x37')]][_0x2976('0x5d')]=_0x4c81eb[_0x2976('0x5e')];this[_0x2976('0x19')][_0x4c81eb[_0x2976('0x37')]]['destinationchannel']=_0x4c81eb[_0x2976('0x3d')];this[_0x2976('0x19')][_0x4c81eb['linkedid']]['disposition']=dispositions[_[_0x2976('0x5f')](_0x4c81eb['channelstate'])];if(this[_0x2976('0x1a')][_0x4c81eb[_0x2976('0x3d')][_0x2976('0x45')]('-')[0x0]]){this[_0x2976('0x19')][_0x4c81eb['linkedid']]['UserId']=this['agents'][_0x4c81eb[_0x2976('0x3d')][_0x2976('0x45')]('-')[0x0]]['id'];this[_0x2976('0x19')][_0x4c81eb[_0x2976('0x37')]][_0x2976('0x60')]=this[_0x2976('0x1a')][_0x4c81eb[_0x2976('0x3d')]['split']('-')[0x0]][_0x2976('0x61')];}}}}else{if(this['channels'][_0x4c81eb[_0x2976('0x36')]]){if(_0x4c81eb['channelstate']==='6'){if(this[_0x2976('0x1a')][_0x4c81eb[_0x2976('0x3d')][_0x2976('0x45')]('-')[0x0]]){this[_0x2976('0x19')][_0x4c81eb['uniqueid']]['UserId']=this[_0x2976('0x1a')][_0x4c81eb[_0x2976('0x3d')]['split']('-')[0x0]]['id'];this[_0x2976('0x19')][_0x4c81eb[_0x2976('0x36')]][_0x2976('0x60')]=this[_0x2976('0x1a')][_0x4c81eb[_0x2976('0x3d')]['split']('-')[0x0]][_0x2976('0x61')];}}}}}}catch(_0x55b799){logger['error']('[syncNewState][VoiceCallReport]',util[_0x2976('0x3c')](_0x55b799,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2976('0x32')][_0x2976('0x62')]=function(_0x55008a,_0x5a9546){if(this[_0x2976('0x19')][_0x55008a]){this[_0x2976('0x19')][_0x55008a][_0x2976('0x63')]=!![];if(_[_0x2976('0x64')](_0x5a9546,_0x2976('0x65'))){_0x5a9546=_0x5a9546[_0x2976('0x66')](_0x2976('0x65'),'.WAV');}this['channels'][_0x55008a][_0x2976('0x67')]=_0x5a9546;var _0x27fe9a=_[_0x2976('0x68')](this[_0x2976('0x19')][_0x55008a][_0x2976('0x69')],{'filename':_0x5a9546});if(_[_0x2976('0x6a')](_0x27fe9a)){this[_0x2976('0x19')][_0x55008a][_0x2976('0x69')][_0x2976('0x6b')]({'filename':_0x5a9546,'createdAt':moment()[_0x2976('0x40')](_0x2976('0x41')),'mixmonitorid':'','status':_0x2976('0x6c')});}}};VoiceCallReport[_0x2976('0x32')][_0x2976('0x23')]=function(_0x38fc99){try{if(this[_0x2976('0x33')](_0x38fc99)){if(this['channels'][_0x38fc99['uniqueid']]&&_0x38fc99[_0x2976('0x3d')]!=_0x2976('0x3e')){if(this[_0x2976('0x33')](_0x38fc99[_0x2976('0x6d')])){if(this[_0x2976('0x33')](_0x38fc99[_0x2976('0x6d')][_0x2976('0x6e')])){this[_0x2976('0x62')](_0x38fc99[_0x2976('0x36')],_0x38fc99[_0x2976('0x6f')]);}else if(this[_0x2976('0x33')](_0x38fc99['variable'][_0x2976('0x70')])){this[_0x2976('0x19')][_0x38fc99[_0x2976('0x36')]][_0x2976('0x5b')]=_0x38fc99[_0x2976('0x6f')];}else if(this['isNotNull'](_0x38fc99[_0x2976('0x6d')][_0x2976('0x71')])){this[_0x2976('0x19')][_0x38fc99[_0x2976('0x36')]][_0x2976('0x72')]=_0x38fc99[_0x2976('0x6f')];}else if(this[_0x2976('0x33')](_0x38fc99[_0x2976('0x6d')]['xmd-cdrtype'])){this['channels'][_0x38fc99[_0x2976('0x36')]]['type']=_0x38fc99[_0x2976('0x6f')];}else if(this[_0x2976('0x33')](_0x38fc99['variable']['xmd-queue'])){this[_0x2976('0x19')][_0x38fc99[_0x2976('0x36')]]['queue']=_0x38fc99['value'][_0x2976('0x45')](',')[0x0];}else if(this[_0x2976('0x33')](_0x38fc99[_0x2976('0x6d')]['xmd-originatecalleridnum'])){this[_0x2976('0x19')][_0x38fc99[_0x2976('0x36')]][_0x2976('0x73')]=_0x38fc99[_0x2976('0x6f')];}else if(this[_0x2976('0x33')](_0x38fc99[_0x2976('0x6d')]['xmd-destination'])){this['channels'][_0x38fc99[_0x2976('0x36')]][_0x2976('0x74')]=_0x38fc99[_0x2976('0x6f')];}else if(this[_0x2976('0x33')](_0x38fc99[_0x2976('0x6d')][_0x2976('0x75')])){this[_0x2976('0x19')][_0x38fc99[_0x2976('0x36')]][_0x2976('0x76')]=_0x38fc99['value'];}else if(this[_0x2976('0x33')](_0x38fc99[_0x2976('0x6d')][_0x2976('0x77')])){this[_0x2976('0x19')][_0x38fc99[_0x2976('0x36')]]['queue']=_0x38fc99[_0x2976('0x6f')];}else if(this['isNotNull'](_0x38fc99[_0x2976('0x6d')][_0x2976('0x78')])){this[_0x2976('0x19')][_0x38fc99[_0x2976('0x36')]][_0x2976('0x79')]=_0x38fc99[_0x2976('0x6f')];}}}else if(this['isNotNull'](_0x38fc99[_0x2976('0x6d')][_0x2976('0x6e')])){if(_0x38fc99[_0x2976('0x6f')]){var _0x24107d=path[_0x2976('0x7a')](_0x38fc99['value'])[_0x2976('0x61')];this['syncMixMonitorFilename'](_0x24107d,_0x38fc99[_0x2976('0x6f')]);}}else if(this['channels'][_0x38fc99['linkedid']]){if(this[_0x2976('0x33')](_0x38fc99[_0x2976('0x6d')])){if(this[_0x2976('0x33')](_0x38fc99[_0x2976('0x6d')][_0x2976('0x78')])){this[_0x2976('0x19')][_0x38fc99['linkedid']][_0x2976('0x7b')]=_0x38fc99[_0x2976('0x6f')];}}}}}catch(_0x3f96da){logger[_0x2976('0x4a')](_0x2976('0x7c'),util['inspect'](_0x3f96da,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2976('0x32')][_0x2976('0x25')]=function(_0x41200f){try{if(this[_0x2976('0x33')](_0x41200f)){if(this[_0x2976('0x19')][_0x41200f['uniqueid']]){var _0x4fea37=moment();this[_0x2976('0x19')][_0x41200f['uniqueid']][_0x2976('0x7d')]=_0x4fea37['format'](_0x2976('0x41'));this['channels'][_0x41200f['uniqueid']][_0x2976('0x4f')]=_0x4fea37[_0x2976('0x5a')](this['channels'][_0x41200f[_0x2976('0x36')]]['starttime'],'seconds');if(this[_0x2976('0x19')][_0x41200f[_0x2976('0x36')]][_0x2976('0x57')]){this[_0x2976('0x19')][_0x41200f[_0x2976('0x36')]][_0x2976('0x7e')]=_0x4fea37[_0x2976('0x5a')](this[_0x2976('0x19')][_0x41200f[_0x2976('0x36')]][_0x2976('0x58')],'seconds');this['channels'][_0x41200f[_0x2976('0x36')]][_0x2976('0x59')]=this[_0x2976('0x19')][_0x41200f[_0x2976('0x36')]][_0x2976('0x4f')]-this[_0x2976('0x19')][_0x41200f[_0x2976('0x36')]][_0x2976('0x7e')];}if(_0x41200f[_0x2976('0x43')]===_0x2976('0x44')){if(this[_0x2976('0x1a')][_0x41200f[_0x2976('0x3d')][_0x2976('0x45')]('-')[0x0]]){this[_0x2976('0x1a')][_0x41200f[_0x2976('0x3d')][_0x2976('0x45')]('-')[0x0]]=_[_0x2976('0x7f')](this[_0x2976('0x1a')][_0x41200f['channel'][_0x2976('0x45')]('-')[0x0]],[_0x2976('0x46')]);this[_0x2976('0x35')](util[_0x2976('0x40')](_0x2976('0x48'),this[_0x2976('0x1a')][_0x41200f[_0x2976('0x3d')][_0x2976('0x45')]('-')[0x0]][_0x2976('0x61')]),_0x2976('0x80'),{'destaccountcode':this['agents'][_0x41200f[_0x2976('0x3d')][_0x2976('0x45')]('-')[0x0]]['accountcode']});}}ami[_0x2976('0x35')](_0x2976('0x81'),this[_0x2976('0x19')][_0x41200f[_0x2976('0x36')]]);delete this[_0x2976('0x19')][_0x41200f['uniqueid']];}}}catch(_0x1c54bc){logger['error'](_0x2976('0x82'),util[_0x2976('0x3c')](_0x1c54bc,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x2976('0x29')]=function(_0x586f6a){try{if(this['isNotNull'](_0x586f6a)){if(this[_0x2976('0x19')][_0x586f6a[_0x2976('0x83')]]){this[_0x2976('0x19')][_0x586f6a[_0x2976('0x83')]][_0x2976('0x84')]=_0x586f6a[_0x2976('0x85')];this[_0x2976('0x19')][_0x586f6a[_0x2976('0x83')]][_0x2976('0x86')]=_0x586f6a[_0x2976('0x87')];if(this['channels'][_0x586f6a[_0x2976('0x88')]]){var _0x5c7ebc=this[_0x2976('0x19')][_0x586f6a[_0x2976('0x88')]];this[_0x2976('0x19')][_0x586f6a['secondtransfereruniqueid']]=this[_0x2976('0x19')][_0x586f6a[_0x2976('0x83')]];this['channels'][_0x586f6a[_0x2976('0x83')]]=_0x5c7ebc;}}else if(this['channels'][_0x586f6a[_0x2976('0x89')]]){this['channels'][_0x586f6a['transfertargetuniqueid']][_0x2976('0x84')]=_0x586f6a[_0x2976('0x85')];this[_0x2976('0x19')][_0x586f6a[_0x2976('0x89')]][_0x2976('0x86')]=_0x586f6a['transfertargetcalleridnum'];if(this[_0x2976('0x19')][_0x586f6a[_0x2976('0x8a')]]){var _0x5c7ebc=this[_0x2976('0x19')][_0x586f6a[_0x2976('0x8a')]];this[_0x2976('0x19')][_0x586f6a[_0x2976('0x8a')]]=this['channels'][_0x586f6a[_0x2976('0x89')]];this['channels'][_0x586f6a[_0x2976('0x89')]]=_0x5c7ebc;}}}}catch(_0x35782a){logger[_0x2976('0x4a')]('[syncAttendedTransfer][VoiceCallReport]',util[_0x2976('0x3c')](_0x35782a,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x2976('0x8b')]=function(_0x5a0a7d){try{if(this['isNotNull'](_0x5a0a7d)){if(this['channels'][_0x5a0a7d[_0x2976('0x83')]]){this[_0x2976('0x19')][_0x5a0a7d[_0x2976('0x83')]][_0x2976('0x84')]=_0x5a0a7d['transfereecalleridnum'];this['channels'][_0x5a0a7d[_0x2976('0x83')]][_0x2976('0x86')]=_0x5a0a7d[_0x2976('0x8c')];this[_0x2976('0x25')]({'event':_0x2976('0x8d'),'uniqueid':_0x5a0a7d[_0x2976('0x83')],'context':_0x5a0a7d[_0x2976('0x43')],'channel':_0x5a0a7d[_0x2976('0x8e')]});}}}catch(_0x1787eb){logger['error']('[syncBlindTransfer][VoiceCallReport]',util['inspect'](_0x1787eb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2976('0x32')][_0x2976('0x2b')]=function(_0x20511b){try{if(this[_0x2976('0x33')](_0x20511b)){if(this[_0x2976('0x19')][_0x20511b['uniqueid']]){if(!_[_0x2976('0x6a')](this['channels'][_0x20511b[_0x2976('0x36')]][_0x2976('0x58')])){this[_0x2976('0x19')][_0x20511b[_0x2976('0x36')]]['mohstarttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x344f2e){logger[_0x2976('0x4a')](_0x2976('0x8f'),util[_0x2976('0x3c')](_0x344f2e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2976('0x32')][_0x2976('0x2d')]=function(_0x5eaf35){try{if(this['isNotNull'](_0x5eaf35)){if(this[_0x2976('0x19')][_0x5eaf35[_0x2976('0x36')]]){if(!_[_0x2976('0x6a')](this[_0x2976('0x19')][_0x5eaf35[_0x2976('0x36')]][_0x2976('0x90')])){this[_0x2976('0x19')][_0x5eaf35['uniqueid']][_0x2976('0x91')]+=moment()[_0x2976('0x92')](0x0)[_0x2976('0x5a')](this[_0x2976('0x19')][_0x5eaf35[_0x2976('0x36')]][_0x2976('0x90')],'seconds');delete this[_0x2976('0x19')][_0x5eaf35['uniqueid']]['mohstarttime'];}}}}catch(_0x5de1ef){logger['error'](_0x2976('0x93'),util[_0x2976('0x3c')](_0x5de1ef,{'showHidden':![],'depth':null}));}};module[_0x2976('0x94')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index ee09ffb..5e2ff2e 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x819d=['rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','membername','memberpenalty','memberrealtime','isNil','format','duration','endtime','diff','seconds','lastevent','complete','answertime','holdtime','starttime','billableseconds','sumHoldTime','sumBillable','sumDuration','voice_outbound:save','info','stringify','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','dialend','syncDialEnd','bind','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','connect','[syncDialEnd][VoiceDialReport]','addVariable','value','variable','outboundrouteid','[syncVarSet][VoiceDialReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged'];(function(_0x1c9fc4,_0x240343){var _0x2efcba=function(_0x57faea){while(--_0x57faea){_0x1c9fc4['push'](_0x1c9fc4['shift']());}};_0x2efcba(++_0x240343);}(_0x819d,0xc2));var _0xd819=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x819d[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xd819('0x0'));var moment=require('moment');var util=require(_0xd819('0x1'));var Redis=require(_0xd819('0x2'));var config=require(_0xd819('0x3'));var logger=require(_0xd819('0x4'))(_0xd819('0x5'));var ami=require(_0xd819('0x6'));config[_0xd819('0x7')]=_[_0xd819('0x8')](config[_0xd819('0x7')],{'host':_0xd819('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd819('0x7')]));function VoiceDialReport(_0x346463){this[_0xd819('0xa')]=_0x346463[_0xd819('0xb')];this[_0xd819('0xc')]=_0x346463['outbound'];this[_0xd819('0xd')]={};ami['on'](_0xd819('0xe'),this[_0xd819('0xf')]['bind'](this));ami['on'](_0xd819('0x10'),this[_0xd819('0x11')][_0xd819('0x12')](this));ami['on'](_0xd819('0x13'),this[_0xd819('0x14')]['bind'](this));ami['on'](_0xd819('0x15'),this[_0xd819('0x16')][_0xd819('0x12')](this));}VoiceDialReport[_0xd819('0x17')][_0xd819('0x18')]=function(_0x518b02){return _0x518b02!==null&&!_[_0xd819('0x19')](_0x518b02);};VoiceDialReport[_0xd819('0x17')][_0xd819('0x1a')]=function(_0x49d2a3,_0x5f11d8,_0x2d774a){io['to'](_0x49d2a3)['emit'](_0x5f11d8,_0x2d774a);};VoiceDialReport['prototype'][_0xd819('0xf')]=function(_0x135202){try{if(this[_0xd819('0x18')](_0x135202)){if(this[_0xd819('0xa')][_0x135202[_0xd819('0x1b')]]){_[_0xd819('0x1c')](this[_0xd819('0xa')][_0x135202[_0xd819('0x1b')]],{'starttime':moment()['format'](_0xd819('0x1d')),'lastevent':'called','interface':_0x135202[_0xd819('0x1e')][_0xd819('0x1f')](0x0,_0x135202['channel'][_0xd819('0x20')]('-')),'membername':_0x135202['channel'][_0xd819('0x1f')](_0x135202['channel'][_0xd819('0x20')]('/')+0x1,_0x135202['channel']['lastIndexOf']('-'))},_['omit'](_0x135202,['event',_0xd819('0x21')]));this['emit'](_0xd819('0x22'),_0xd819('0x23'),this[_0xd819('0xa')][_0x135202['uniqueid']]);ami['emit'](_0xd819('0x24'),this[_0xd819('0xa')][_0x135202[_0xd819('0x1b')]]);}}}catch(_0x271fa3){logger[_0xd819('0x25')](_0xd819('0x26'),util[_0xd819('0x27')](_0x271fa3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd819('0x17')][_0xd819('0x11')]=function(_0x214972){try{if(this[_0xd819('0x18')](_0x214972)){if(this['channels'][_0x214972[_0xd819('0x1b')]]){this[_0xd819('0xa')][_0x214972['uniqueid']][_0xd819('0x28')]=_0x214972[_0xd819('0x28')];if(_0x214972[_0xd819('0x28')]===_0xd819('0x29')){this[_0xd819('0xa')][_0x214972[_0xd819('0x1b')]][_0xd819('0x2a')]=_0x214972[_0xd819('0x2a')];this[_0xd819('0xa')][_0x214972[_0xd819('0x1b')]][_0xd819('0x2b')]=_0x214972[_0xd819('0x2b')];this[_0xd819('0xa')][_0x214972[_0xd819('0x1b')]]['answertime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xd819('0xa')][_0x214972[_0xd819('0x1b')]]['lastevent']=_0xd819('0x2c');ami[_0xd819('0x1a')]('custom:dialconnect',this[_0xd819('0xa')][_0x214972[_0xd819('0x1b')]]);}this[_0xd819('0x1a')]('voice:outbound',_0xd819('0x23'),this['channels'][_0x214972[_0xd819('0x1b')]]);}}}catch(_0x5f44b1){logger[_0xd819('0x25')](_0xd819('0x2d'),util['inspect'](_0x5f44b1,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd819('0x17')][_0xd819('0x14')]=function(_0xdf1e4f){try{if(this[_0xd819('0x18')](_0xdf1e4f)){this[_0xd819('0x2e')](_0xdf1e4f[_0xd819('0x1b')],_['keys'](_0xdf1e4f['variable'])[0x0],_0xdf1e4f[_0xd819('0x2f')]);if(this[_0xd819('0x18')](_0xdf1e4f['variable'])&&this['isNotNull'](_0xdf1e4f[_0xd819('0x30')][_0xd819('0x31')])){if(_['isUndefined'](this[_0xd819('0xa')][_0xdf1e4f[_0xd819('0x1b')]])){this['channels'][_0xdf1e4f['uniqueid']]={'routeId':_0xdf1e4f[_0xd819('0x2f')],'variables':this[_0xd819('0xd')][_0xdf1e4f[_0xd819('0x1b')]]};this[_0xd819('0x1a')](_0xd819('0x22'),_0xd819('0x23'),this[_0xd819('0xa')][_0xdf1e4f[_0xd819('0x1b')]]);}}}}catch(_0xa478){logger['error'](_0xd819('0x32'),util[_0xd819('0x27')](_0xa478,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xd819('0x17')][_0xd819('0x2e')]=function(_0x3285fc,_0x2b6494,_0x5520c3){var _0x33c41f=[_0xd819('0x33'),_0xd819('0x34'),_0xd819('0x35'),_0xd819('0x36'),_0xd819('0x37'),_0xd819('0x38'),'rtpaudioqosrtt',_0xd819('0x39'),'sipcallid','sipuri',_0xd819('0x3a'),_0xd819('0x3b'),_0xd819('0x3c'),'memberdynamic','memberinterface',_0xd819('0x3d'),_0xd819('0x3e'),_0xd819('0x3f'),_0xd819('0x40')];if(!_[_0xd819('0x41')](_0x2b6494)&&!_['includes'](_0x33c41f,_0x2b6494)){if(_['isUndefined'](this['variables'][_0x3285fc])){this[_0xd819('0xd')][_0x3285fc]={};}this[_0xd819('0xd')][_0x3285fc][_0x2b6494]=_0x5520c3;}};VoiceDialReport[_0xd819('0x17')]['syncHangup']=function(_0x195b6a){try{if(this[_0xd819('0x18')](_0x195b6a)){if(this[_0xd819('0xa')][_0x195b6a['uniqueid']]){this[_0xd819('0xa')][_0x195b6a[_0xd819('0x1b')]]['endtime']=moment()[_0xd819('0x42')](_0xd819('0x1d'));this['channels'][_0x195b6a[_0xd819('0x1b')]][_0xd819('0x43')]=moment(this['channels'][_0x195b6a[_0xd819('0x1b')]][_0xd819('0x44')])[_0xd819('0x45')](this[_0xd819('0xa')][_0x195b6a[_0xd819('0x1b')]]['starttime'],_0xd819('0x46'));this[_0xd819('0xa')][_0x195b6a[_0xd819('0x1b')]][_0xd819('0x47')]=_0xd819('0x48');this[_0xd819('0xc')]['total']+=0x1;if(this[_0xd819('0xa')][_0x195b6a['uniqueid']][_0xd819('0x49')]){this[_0xd819('0xc')]['answered']+=0x1;this[_0xd819('0xa')][_0x195b6a[_0xd819('0x1b')]][_0xd819('0x4a')]=moment(this[_0xd819('0xa')][_0x195b6a[_0xd819('0x1b')]][_0xd819('0x49')])['diff'](this[_0xd819('0xa')][_0x195b6a['uniqueid']][_0xd819('0x4b')],_0xd819('0x46'));this[_0xd819('0xa')][_0x195b6a[_0xd819('0x1b')]][_0xd819('0x4c')]=moment(this[_0xd819('0xa')][_0x195b6a['uniqueid']][_0xd819('0x44')])[_0xd819('0x45')](this[_0xd819('0xa')][_0x195b6a['uniqueid']][_0xd819('0x49')],_0xd819('0x46'));this['outbound'][_0xd819('0x4d')]+=this[_0xd819('0xa')][_0x195b6a['uniqueid']][_0xd819('0x4a')]||0x0;this[_0xd819('0xc')][_0xd819('0x4e')]+=this[_0xd819('0xa')][_0x195b6a[_0xd819('0x1b')]]['billableseconds'];}this[_0xd819('0xc')][_0xd819('0x4f')]+=this[_0xd819('0xa')][_0x195b6a[_0xd819('0x1b')]]['duration'];ami['emit']('custom:voiceDialReport',this[_0xd819('0xa')][_0x195b6a[_0xd819('0x1b')]]);ami[_0xd819('0x1a')]('custom:dialend',this[_0xd819('0xa')][_0x195b6a['uniqueid']]);this['emit'](_0xd819('0x22'),_0xd819('0x50'),this[_0xd819('0xc')]);logger[_0xd819('0x51')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0xd819('0x52')](this[_0xd819('0xa')][_0x195b6a['uniqueid']]));this['emit'](_0xd819('0x22'),'voice_outbound_channel:remove',this['channels'][_0x195b6a[_0xd819('0x1b')]]);delete this['channels'][_0x195b6a[_0xd819('0x1b')]];}if(this[_0xd819('0xd')][_0x195b6a[_0xd819('0x1b')]]){delete this[_0xd819('0xd')][_0x195b6a[_0xd819('0x1b')]];}}}catch(_0x2987ef){logger[_0xd819('0x25')]('[syncHangup][VoiceDialReport]',util[_0xd819('0x27')](_0x2987ef,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0x3b31=['channels','outbound','variables','dialend','syncDialEnd','bind','syncVarSet','hangup','isNotNull','isUndefined','prototype','emit','syncDialBegin','uniqueid','merge','format','called','channel','substring','lastIndexOf','event','privilege','voice:outbound','voice_outbound_channel:save','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','answertime','lastevent','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','keys','variable','outboundrouteid','value','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberrealtime','isNil','includes','syncHangup','duration','endtime','diff','seconds','complete','total','starttime','billableseconds','sumHoldTime','holdtime','sumBillable','sumDuration','custom:voiceDialReport','custom:dialend','info','stringify','voice_outbound_channel:remove','moment','util','ioredis','../../../config/logger','../ami','redis','defaults','localhost'];(function(_0x3def27,_0x4aa752){var _0x5c3b91=function(_0x244678){while(--_0x244678){_0x3def27['push'](_0x3def27['shift']());}};_0x5c3b91(++_0x4aa752);}(_0x3b31,0x9c));var _0x13b3=function(_0x1a991b,_0x27a540){_0x1a991b=_0x1a991b-0x0;var _0x3e35b0=_0x3b31[_0x1a991b];return _0x3e35b0;};'use strict';var _=require('lodash');var moment=require(_0x13b3('0x0'));var util=require(_0x13b3('0x1'));var Redis=require(_0x13b3('0x2'));var config=require('../../../config/environment');var logger=require(_0x13b3('0x3'))('ami');var ami=require(_0x13b3('0x4'));config[_0x13b3('0x5')]=_[_0x13b3('0x6')](config[_0x13b3('0x5')],{'host':_0x13b3('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x641da7){this[_0x13b3('0x8')]=_0x641da7['outboundChannels'];this[_0x13b3('0x9')]=_0x641da7[_0x13b3('0x9')];this[_0x13b3('0xa')]={};ami['on']('dialbegin',this['syncDialBegin']['bind'](this));ami['on'](_0x13b3('0xb'),this[_0x13b3('0xc')][_0x13b3('0xd')](this));ami['on']('varset',this[_0x13b3('0xe')]['bind'](this));ami['on'](_0x13b3('0xf'),this['syncHangup'][_0x13b3('0xd')](this));}VoiceDialReport['prototype'][_0x13b3('0x10')]=function(_0xddf2bb){return _0xddf2bb!==null&&!_[_0x13b3('0x11')](_0xddf2bb);};VoiceDialReport[_0x13b3('0x12')][_0x13b3('0x13')]=function(_0x5f8e3,_0x156efe,_0x2075c5){io['to'](_0x5f8e3)['emit'](_0x156efe,_0x2075c5);};VoiceDialReport[_0x13b3('0x12')][_0x13b3('0x14')]=function(_0x2f0968){try{if(this[_0x13b3('0x10')](_0x2f0968)){if(this[_0x13b3('0x8')][_0x2f0968[_0x13b3('0x15')]]){_[_0x13b3('0x16')](this[_0x13b3('0x8')][_0x2f0968[_0x13b3('0x15')]],{'starttime':moment()[_0x13b3('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x13b3('0x18'),'interface':_0x2f0968[_0x13b3('0x19')][_0x13b3('0x1a')](0x0,_0x2f0968['channel'][_0x13b3('0x1b')]('-')),'membername':_0x2f0968[_0x13b3('0x19')][_0x13b3('0x1a')](_0x2f0968[_0x13b3('0x19')][_0x13b3('0x1b')]('/')+0x1,_0x2f0968['channel'][_0x13b3('0x1b')]('-'))},_['omit'](_0x2f0968,[_0x13b3('0x1c'),_0x13b3('0x1d')]));this['emit'](_0x13b3('0x1e'),_0x13b3('0x1f'),this[_0x13b3('0x8')][_0x2f0968[_0x13b3('0x15')]]);ami[_0x13b3('0x13')]('custom:dialbegin',this[_0x13b3('0x8')][_0x2f0968[_0x13b3('0x15')]]);}}}catch(_0x50312a){logger[_0x13b3('0x20')](_0x13b3('0x21'),util[_0x13b3('0x22')](_0x50312a,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x13b3('0x12')]['syncDialEnd']=function(_0x591a77){try{if(this[_0x13b3('0x10')](_0x591a77)){if(this['channels'][_0x591a77['uniqueid']]){this[_0x13b3('0x8')][_0x591a77[_0x13b3('0x15')]][_0x13b3('0x23')]=_0x591a77[_0x13b3('0x23')];if(_0x591a77[_0x13b3('0x23')]===_0x13b3('0x24')){this['channels'][_0x591a77[_0x13b3('0x15')]][_0x13b3('0x25')]=_0x591a77[_0x13b3('0x25')];this['channels'][_0x591a77['uniqueid']]['connectedlinename']=_0x591a77['connectedlinename'];this[_0x13b3('0x8')][_0x591a77[_0x13b3('0x15')]][_0x13b3('0x26')]=moment()[_0x13b3('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x13b3('0x8')][_0x591a77['uniqueid']][_0x13b3('0x27')]=_0x13b3('0x28');ami[_0x13b3('0x13')](_0x13b3('0x29'),this['channels'][_0x591a77[_0x13b3('0x15')]]);}this[_0x13b3('0x13')](_0x13b3('0x1e'),_0x13b3('0x1f'),this[_0x13b3('0x8')][_0x591a77[_0x13b3('0x15')]]);}}}catch(_0x3e9ab5){logger[_0x13b3('0x20')](_0x13b3('0x2a'),util[_0x13b3('0x22')](_0x3e9ab5,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x13b3('0x12')][_0x13b3('0xe')]=function(_0x217610){try{if(this[_0x13b3('0x10')](_0x217610)){this['addVariable'](_0x217610['uniqueid'],_[_0x13b3('0x2b')](_0x217610[_0x13b3('0x2c')])[0x0],_0x217610['value']);if(this[_0x13b3('0x10')](_0x217610['variable'])&&this['isNotNull'](_0x217610[_0x13b3('0x2c')][_0x13b3('0x2d')])){if(_[_0x13b3('0x11')](this[_0x13b3('0x8')][_0x217610['uniqueid']])){this['channels'][_0x217610[_0x13b3('0x15')]]={'routeId':_0x217610[_0x13b3('0x2e')],'variables':this['variables'][_0x217610['uniqueid']]};this[_0x13b3('0x13')](_0x13b3('0x1e'),_0x13b3('0x1f'),this[_0x13b3('0x8')][_0x217610[_0x13b3('0x15')]]);}}}}catch(_0x52b23e){logger[_0x13b3('0x20')]('[syncVarSet][VoiceDialReport]',util[_0x13b3('0x22')](_0x52b23e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x13b3('0x12')][_0x13b3('0x2f')]=function(_0x56a9c0,_0x15a1b6,_0x231cf1){var _0x652bd0=[_0x13b3('0x30'),_0x13b3('0x31'),_0x13b3('0x32'),_0x13b3('0x33'),_0x13b3('0x34'),_0x13b3('0x35'),_0x13b3('0x36'),'rtpaudioqosrttbridged',_0x13b3('0x37'),_0x13b3('0x38'),_0x13b3('0x39'),'bridgepvtcallid',_0x13b3('0x3a'),_0x13b3('0x3b'),_0x13b3('0x3c'),'memberlastcall','membername','memberpenalty',_0x13b3('0x3d')];if(!_[_0x13b3('0x3e')](_0x15a1b6)&&!_[_0x13b3('0x3f')](_0x652bd0,_0x15a1b6)){if(_[_0x13b3('0x11')](this[_0x13b3('0xa')][_0x56a9c0])){this['variables'][_0x56a9c0]={};}this[_0x13b3('0xa')][_0x56a9c0][_0x15a1b6]=_0x231cf1;}};VoiceDialReport['prototype'][_0x13b3('0x40')]=function(_0x411b9d){try{if(this['isNotNull'](_0x411b9d)){if(this[_0x13b3('0x8')][_0x411b9d['uniqueid']]){this['channels'][_0x411b9d[_0x13b3('0x15')]]['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x411b9d[_0x13b3('0x15')]][_0x13b3('0x41')]=moment(this[_0x13b3('0x8')][_0x411b9d[_0x13b3('0x15')]][_0x13b3('0x42')])[_0x13b3('0x43')](this[_0x13b3('0x8')][_0x411b9d[_0x13b3('0x15')]]['starttime'],_0x13b3('0x44'));this['channels'][_0x411b9d[_0x13b3('0x15')]]['lastevent']=_0x13b3('0x45');this[_0x13b3('0x9')][_0x13b3('0x46')]+=0x1;if(this[_0x13b3('0x8')][_0x411b9d[_0x13b3('0x15')]][_0x13b3('0x26')]){this['outbound']['answered']+=0x1;this[_0x13b3('0x8')][_0x411b9d['uniqueid']]['holdtime']=moment(this[_0x13b3('0x8')][_0x411b9d[_0x13b3('0x15')]][_0x13b3('0x26')])[_0x13b3('0x43')](this[_0x13b3('0x8')][_0x411b9d[_0x13b3('0x15')]][_0x13b3('0x47')],_0x13b3('0x44'));this[_0x13b3('0x8')][_0x411b9d[_0x13b3('0x15')]][_0x13b3('0x48')]=moment(this[_0x13b3('0x8')][_0x411b9d[_0x13b3('0x15')]][_0x13b3('0x42')])[_0x13b3('0x43')](this[_0x13b3('0x8')][_0x411b9d[_0x13b3('0x15')]][_0x13b3('0x26')],_0x13b3('0x44'));this['outbound'][_0x13b3('0x49')]+=this['channels'][_0x411b9d[_0x13b3('0x15')]][_0x13b3('0x4a')]||0x0;this[_0x13b3('0x9')][_0x13b3('0x4b')]+=this['channels'][_0x411b9d[_0x13b3('0x15')]][_0x13b3('0x48')];}this[_0x13b3('0x9')][_0x13b3('0x4c')]+=this[_0x13b3('0x8')][_0x411b9d[_0x13b3('0x15')]][_0x13b3('0x41')];ami['emit'](_0x13b3('0x4d'),this[_0x13b3('0x8')][_0x411b9d[_0x13b3('0x15')]]);ami[_0x13b3('0x13')](_0x13b3('0x4e'),this['channels'][_0x411b9d['uniqueid']]);this[_0x13b3('0x13')](_0x13b3('0x1e'),'voice_outbound:save',this[_0x13b3('0x9')]);logger[_0x13b3('0x4f')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x13b3('0x50')](this['channels'][_0x411b9d['uniqueid']]));this[_0x13b3('0x13')]('voice:outbound',_0x13b3('0x51'),this['channels'][_0x411b9d[_0x13b3('0x15')]]);delete this['channels'][_0x411b9d[_0x13b3('0x15')]];}if(this[_0x13b3('0xa')][_0x411b9d[_0x13b3('0x15')]]){delete this['variables'][_0x411b9d[_0x13b3('0x15')]];}}}catch(_0x58c663){logger[_0x13b3('0x20')]('[syncHangup][VoiceDialReport]',util[_0x13b3('0x22')](_0x58c663,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 96f8340..9cbdd1d 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x439e=['COMPLETED','startsWith','toLowerCase','linkedid','queuecallerexit','queuecallerexitAt','add','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','variable','CONTINUE','TIMEOUT','lastevent','timeout','custom:timeout','YYYY-MM-DD\x20HH:mm:ss','queuecallerleaveAt','value','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','length','diff','seconds','sumDuration','milliseconds','total','custom:queuecallerunmanaged','abandoned','custom:queuecallerabandon','[syncHangup][VoiceQueueReport]','syncAttendedTransfer','transfereeuniqueid','secondtransfererexten','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','ATTENDEDTRANSFER','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncAgentConnect','syncVarSet','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','hasOwnProperty','isEmpty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','prototype','clearZombieChannels','channels','switch','Action','channel','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','campaigns','emitVoiceQueueChannelRemove','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','unmanaged','Trunk','active','callerid','Interval','md5','voice_queue:save','isNotNull','isUndefined','loopQueueShow','queues','catch','then','[queuesummary]','queue','countBy','callers','toNumber','loggedin','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','uniqueid','queuecallerjoinAt','position','count','merge','pick','push','[syncQueueCallerJoin][VoiceQueueReport]','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','syncQueueCallerLeave','last','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','queuecallercomplete','[syncAgentConnect][VoiceQueueReport]','syncAgentComplete','assigned','membername','transfer','reason'];(function(_0xf82c1b,_0x12306e){var _0x4bba98=function(_0x3f1531){while(--_0x3f1531){_0xf82c1b['push'](_0xf82c1b['shift']());}};_0x4bba98(++_0x12306e);}(_0x439e,0x115));var _0xe439=function(_0x5e669c,_0x1e4ce8){_0x5e669c=_0x5e669c-0x0;var _0x1e65a8=_0x439e[_0x5e669c];return _0x1e65a8;};'use strict';var _=require(_0xe439('0x0'));var moment=require(_0xe439('0x1'));var BPromise=require(_0xe439('0x2'));var util=require(_0xe439('0x3'));var md5=require('md5');var Redis=require(_0xe439('0x4'));var config=require(_0xe439('0x5'));var logger=require(_0xe439('0x6'))(_0xe439('0x7'));var ami=require('../ami');var QueueReport=require('../model/queueReport');config[_0xe439('0x8')]=_[_0xe439('0x9')](config['redis'],{'host':_0xe439('0xa'),'port':0x18eb});var io=require(_0xe439('0xb'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0xe439('0xc')]=function(_0x461794){this[_0xe439('0xd')]=this[_0xe439('0xd')]?this[_0xe439('0xd')][_0xe439('0xe')](_0x461794):_0x461794();};function VoiceQueueReport(_0x4da9fa){this[_0xe439('0xf')]=new Sequence();this[_0xe439('0x10')]={};this[_0xe439('0x11')]=_0x4da9fa[_0xe439('0x11')];this['channels']=_0x4da9fa[_0xe439('0x12')];this[_0xe439('0x13')]=_0x4da9fa['voiceQueues'];this[_0xe439('0x14')]=!![];this['campaigns']=_0x4da9fa['campaigns'];this[_0xe439('0x15')]={};ami['on'](_0xe439('0x16'),this[_0xe439('0x17')]['bind'](this));ami['on'](_0xe439('0x18'),this[_0xe439('0x19')][_0xe439('0x1a')](this));ami['on'](_0xe439('0x1b'),this[_0xe439('0x1c')]['bind'](this));ami['on'](_0xe439('0x1d'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xe439('0x1e'),this['syncQueueCallerLeave'][_0xe439('0x1a')](this));ami['on']('agentcomplete',this['syncAgentComplete']['bind'](this));ami['on']('agentconnect',this[_0xe439('0x1f')][_0xe439('0x1a')](this));ami['on']('varset',this[_0xe439('0x20')][_0xe439('0x1a')](this));ami['on']('hangup',this[_0xe439('0x21')][_0xe439('0x1a')](this));ami['on'](_0xe439('0x22'),this[_0xe439('0x23')][_0xe439('0x1a')](this));ami['on'](_0xe439('0x24'),this['syncMusicOnHoldStart'][_0xe439('0x1a')](this));ami['on']('musiconholdstop',this[_0xe439('0x25')][_0xe439('0x1a')](this));ami['on'](_0xe439('0x26'),this['syncAttendedTransfer'][_0xe439('0x1a')](this));ami['on'](_0xe439('0x27'),this[_0xe439('0x28')][_0xe439('0x1a')](this));this[_0xe439('0x29')]();this['loopQueueShow']();}function isNotNull(_0x23e38b){return _0x23e38b!==null&&!_['isUndefined'](_0x23e38b);}function clearChannels(_0x2608d9){if(!_['isEmpty'](_0x2608d9)){for(var _0x195d05 in _0x2608d9){if(_0x2608d9[_0xe439('0x2a')](_0x195d05)){delete _0x2608d9[_0x195d05];}}}}function clearCampaigns(_0x10bc6e){if(!_[_0xe439('0x2b')](_0x10bc6e)){for(var _0x3e650e in _0x10bc6e){if(_0x10bc6e[_0xe439('0x2a')](_0x3e650e)){_0x10bc6e[_0x3e650e][_0xe439('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x3a6029){if(!_[_0xe439('0x2b')](_0x3a6029)){for(var _0x2a94ca in _0x3a6029){if(_0x3a6029[_0xe439('0x2a')](_0x2a94ca)){_0x3a6029[_0x2a94ca]['originated']=0x0;_0x3a6029[_0x2a94ca][_0xe439('0x2d')]=0x0;_0x3a6029[_0x2a94ca][_0xe439('0x2e')]=0x0;_0x3a6029[_0x2a94ca][_0xe439('0x2f')]=0x0;_0x3a6029[_0x2a94ca][_0xe439('0x30')]=!![];}}}}function clearAgentBooked(_0x773ebe){if(!_['isEmpty'](_0x773ebe)){for(var _0x968250 in _0x773ebe){if(_0x773ebe[_0xe439('0x2a')](_0x968250)){_0x773ebe[_0x968250][_0xe439('0x31')]=!![];}}}}VoiceQueueReport[_0xe439('0x32')][_0xe439('0x33')]=function(){var _0xc4bdb1=this;for(var _0x533ebc in this[_0xe439('0x34')]){if(this[_0xe439('0x34')][_0xe439('0x2a')](_0x533ebc)&&!this[_0xe439('0x34')][_0x533ebc][_0xe439('0x35')]){this['sequence'][_0xe439('0xc')](function(){if(!_['isNil'](_0xc4bdb1[_0xe439('0x34')][_0x533ebc])){return ami[_0xe439('0x36')]({'action':'status','channel':_0xc4bdb1[_0xe439('0x34')][_0x533ebc][_0xe439('0x37')]})['catch'](function(_0x22fadc){if(_0x22fadc[_0xe439('0x38')]===_0xe439('0x39')){setTimeout(function(){if(_0xc4bdb1['channels'][_0x533ebc]){delete _0xc4bdb1[_0xe439('0x34')][_0x533ebc];logger[_0xe439('0x3a')](_0xe439('0x3b'),_0x533ebc);}if(_0xc4bdb1['queueReports'][_0x533ebc]){delete _0xc4bdb1[_0xe439('0x10')][_0x533ebc];logger[_0xe439('0x3a')](_0xe439('0x3c'),_0x533ebc);}if(_0xc4bdb1['variables'][_0x533ebc]){delete _0xc4bdb1[_0xe439('0x15')][_0x533ebc];logger[_0xe439('0x3a')](_0xe439('0x3d'),_0x533ebc);}},0x1f40);}});}});}}};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x23')]=function(){logger['error'](_0xe439('0x3e'));clearChannels(this['channels']);this[_0xe439('0x3f')](this[_0xe439('0x10')]);clearAgentBooked(this[_0xe439('0x11')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xe439('0x40')]);};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x3f')]=function(_0xff5b7){var _0xa39c01=this;if(!_[_0xe439('0x2b')](_0xff5b7)){for(var _0x644f0b in _0xff5b7){if(_0xff5b7[_0xe439('0x2a')](_0x644f0b)){_0xa39c01[_0xe439('0x41')](_0xff5b7[_0x644f0b]);delete _0xff5b7[_0x644f0b];}}}};function loggerCatch(_0x4cbbe9){return function(_0x54b1c7){logger[_0xe439('0x3a')](_0x4cbbe9,util[_0xe439('0x42')](_0x54b1c7,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xe439('0x32')][_0xe439('0x43')]=function(_0xfa48c2,_0xa90611,_0x2b1e07){io['to'](_0xfa48c2)[_0xe439('0x43')](_0xa90611,_0x2b1e07);};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x44')]=function(_0x4cd83d){this[_0xe439('0x43')](util[_0xe439('0x45')](_0xe439('0x46'),_0x4cd83d[_0xe439('0x47')]),'voice_queue_channel:save',_0x4cd83d);};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x41')]=function(_0x4c42a7){logger[_0xe439('0x48')](_0xe439('0x49'),JSON[_0xe439('0x4a')](_0x4c42a7));this[_0xe439('0x43')](util[_0xe439('0x45')](_0xe439('0x46'),_0x4c42a7['name']),'voice_queue_channel:remove',_0x4c42a7);};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x4b')]=function(_0x569f71){if(_0x569f71[_0xe439('0x4c')]===_0xe439('0x4d')){var _0x4d0bcc={'id':_0x569f71['id'],'name':_0x569f71['name'],'strategy':_0x569f71[_0xe439('0x4e')],'answered':_0x569f71[_0xe439('0x4f')],'available':_0x569f71[_0xe439('0x50')],'loggedIn':_0x569f71[_0xe439('0x51')],'pTalking':_0x569f71[_0xe439('0x2e')],'sumBillable':_0x569f71[_0xe439('0x52')],'sumDuration':_0x569f71['sumDuration'],'sumHoldTime':_0x569f71[_0xe439('0x53')]||0x0,'talking':_0x569f71[_0xe439('0x2d')],'total':_0x569f71['total'],'type':_0x569f71[_0xe439('0x4c')],'unmanaged':_0x569f71[_0xe439('0x54')],'abandoned':_0x569f71['abandoned'],'waiting':_0x569f71[_0xe439('0x2f')]};if(_0x569f71[_0xe439('0x55')]){_0x4d0bcc['Trunk']={'id':_0x569f71[_0xe439('0x55')]['id'],'name':_0x569f71[_0xe439('0x55')][_0xe439('0x47')],'active':_0x569f71[_0xe439('0x55')][_0xe439('0x56')],'callerid':_0x569f71[_0xe439('0x55')][_0xe439('0x57')]};}if(_0x569f71[_0xe439('0x58')]){_0x4d0bcc[_0xe439('0x58')]={'id':_0x569f71[_0xe439('0x58')]['id'],'name':_0x569f71[_0xe439('0x58')][_0xe439('0x47')]};}var _0x309839=md5(JSON[_0xe439('0x4a')](_0x4d0bcc));if(_0x569f71['md5']!==_0x309839){_0x569f71[_0xe439('0x59')]=_0x309839;this['emit'](util[_0xe439('0x45')](_0xe439('0x46'),_0x4d0bcc['name']),_0xe439('0x5a'),_0x4d0bcc);}}};VoiceQueueReport['prototype'][_0xe439('0x5b')]=function(_0x466d1c){return _0x466d1c!==null&&!_[_0xe439('0x5c')](_0x466d1c);};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x5d')]=function(){var _0x4260af=this;setInterval(function(){_0x4260af[_0xe439('0x33')]();ami['Action']({'action':_0xe439('0x5e')})[_0xe439('0x5f')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport[_0xe439('0x32')]['loopQueueSummary']=function(){var _0x3e1718=this;setInterval(function(){if(_0x3e1718[_0xe439('0x14')]){return ami[_0xe439('0x36')]({'action':_0xe439('0x16')})[_0xe439('0x60')](function(_0x5b510f){_0x3e1718[_0xe439('0x14')]=![];})[_0xe439('0x5f')](loggerCatch(_0xe439('0x61')));}},0x3e8);};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x17')]=function(_0x314020){try{if(this[_0xe439('0x5b')](_0x314020)&&this[_0xe439('0x5b')](_0x314020[_0xe439('0x62')])){if(this[_0xe439('0x13')][_0x314020[_0xe439('0x62')]]){var _0x14223f=_[_0xe439('0x63')](this[_0xe439('0x34')],_0xe439('0x62'))[_0x314020['queue']]||0x0;var _0xbd7ba9=_0x14223f-_0x314020[_0xe439('0x64')];if(this[_0xe439('0x13')][_0x314020[_0xe439('0x62')]][_0xe439('0x2f')]!==_[_0xe439('0x65')](_0x314020[_0xe439('0x64')])||this[_0xe439('0x13')][_0x314020['queue']][_0xe439('0x51')]!==_[_0xe439('0x65')](_0x314020[_0xe439('0x66')])||this[_0xe439('0x13')][_0x314020[_0xe439('0x62')]][_0xe439('0x50')]!==_[_0xe439('0x65')](_0x314020[_0xe439('0x50')])||this['voiceQueues'][_0x314020['queue']][_0xe439('0x2d')]!==_0xbd7ba9){this[_0xe439('0x13')][_0x314020[_0xe439('0x62')]][_0xe439('0x2f')]=_[_0xe439('0x65')](_0x314020[_0xe439('0x64')]);this[_0xe439('0x13')][_0x314020[_0xe439('0x62')]][_0xe439('0x51')]=_[_0xe439('0x65')](_0x314020['loggedin']);this['voiceQueues'][_0x314020[_0xe439('0x62')]][_0xe439('0x50')]=_[_0xe439('0x65')](_0x314020[_0xe439('0x50')]);this[_0xe439('0x13')][_0x314020[_0xe439('0x62')]][_0xe439('0x2d')]=_0xbd7ba9>0x0?_0xbd7ba9:0x0;this[_0xe439('0x13')][_0x314020[_0xe439('0x62')]][_0xe439('0x2d')]=this['voiceQueues'][_0x314020[_0xe439('0x62')]][_0xe439('0x2d')]>_['toNumber'](_0x314020['loggedin'])?_['toNumber'](_0x314020[_0xe439('0x66')]):this['voiceQueues'][_0x314020[_0xe439('0x62')]][_0xe439('0x2d')];this[_0xe439('0x4b')](this[_0xe439('0x13')][_0x314020[_0xe439('0x62')]]);}ami[_0xe439('0x43')](_0xe439('0x67'),this[_0xe439('0x13')][_0x314020[_0xe439('0x62')]]);}}}catch(_0x3bea75){logger['error'](_0xe439('0x68'),util[_0xe439('0x42')](_0x3bea75,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe439('0x19')]=function(_0x3be037){this[_0xe439('0x14')]=!![];};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x69')]=function(_0x339904){};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x1c')]=function(_0x1889c1){try{if(this[_0xe439('0x5b')](_0x1889c1)){if(_[_0xe439('0x5c')](this[_0xe439('0x10')][_0x1889c1['uniqueid']])){this[_0xe439('0x10')][_0x1889c1[_0xe439('0x6a')]]=[];this[_0xe439('0x34')][_0x1889c1[_0xe439('0x6a')]]={};}var _0x57558c=new QueueReport();_0x57558c['name']=_0x1889c1[_0xe439('0x62')];_0x57558c[_0xe439('0x4c')]=this[_0xe439('0x13')][_0x57558c[_0xe439('0x47')]]&&this[_0xe439('0x13')][_0x57558c['name']][_0xe439('0x4c')]?this['voiceQueues'][_0x57558c[_0xe439('0x47')]][_0xe439('0x4c')]||'inbound':_0xe439('0x4d');_0x57558c[_0xe439('0x62')]=_0x1889c1[_0xe439('0x62')];_0x57558c[_0xe439('0x6b')]=moment()[_0xe439('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x57558c['position']=_0x1889c1[_0xe439('0x6c')];_0x57558c[_0xe439('0x6d')]=_0x1889c1[_0xe439('0x6d')];_[_0xe439('0x6e')](_0x57558c,_[_0xe439('0x6f')](_0x1889c1,_['keys'](_0x57558c)));this['queueReports'][_0x1889c1[_0xe439('0x6a')]][_0xe439('0x70')](_0x57558c);this[_0xe439('0x34')][_0x1889c1[_0xe439('0x6a')]]=_0x57558c;this[_0xe439('0x44')](_0x57558c);}}catch(_0x11465f){logger['error'](_0xe439('0x71'),util[_0xe439('0x42')](_0x11465f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe439('0x32')]['syncQueueCallerAbandon']=function(_0x3e756b){try{if(this[_0xe439('0x5b')](_0x3e756b)){if(this[_0xe439('0x10')][_0x3e756b[_0xe439('0x6a')]]){var _0x1f4566=_['last'](this[_0xe439('0x10')][_0x3e756b['uniqueid']]);_0x1f4566['queuecallercomplete']=![];_0x1f4566[_0xe439('0x72')]=null;_0x1f4566[_0xe439('0x73')]=_0x3e756b[_0xe439('0x73')];_0x1f4566[_0xe439('0x74')]=_0x3e756b[_0xe439('0x74')];_0x1f4566['queuecallerabandon']=!![];_0x1f4566[_0xe439('0x75')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1f4566[_0xe439('0x76')]=_0xe439('0x77');_0x1f4566[_0xe439('0x78')]=null;this[_0xe439('0x34')][_0x3e756b['uniqueid']]=_0x1f4566;this[_0xe439('0x41')](_0x1f4566);}}}catch(_0x12a982){logger[_0xe439('0x3a')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0xe439('0x42')](_0x12a982,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x79')]=function(_0x3a9000){try{if(this[_0xe439('0x5b')](_0x3a9000)){if(this[_0xe439('0x10')][_0x3a9000[_0xe439('0x6a')]]){var _0x1e487c=_[_0xe439('0x7a')](this[_0xe439('0x10')][_0x3a9000[_0xe439('0x6a')]]);_0x1e487c['queuecallerleaveAt']=moment()[_0xe439('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e487c['connectedlinenum']=_0x3a9000[_0xe439('0x7b')];_0x1e487c['connectedlinename']=_0x3a9000[_0xe439('0x7c')];this[_0xe439('0x34')][_0x3a9000[_0xe439('0x6a')]]=_0x1e487c;this[_0xe439('0x44')](_0x1e487c);}}}catch(_0x5b35be){logger[_0xe439('0x3a')](_0xe439('0x7d'),util[_0xe439('0x42')](_0x5b35be,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x1f')]=function(_0x47cce5){try{if(this['isNotNull'](_0x47cce5)){if(this[_0xe439('0x10')][_0x47cce5[_0xe439('0x6a')]]){var _0x38a401=_[_0xe439('0x7a')](this[_0xe439('0x10')][_0x47cce5[_0xe439('0x6a')]]);_0x38a401[_0xe439('0x7e')]=!![];_0x38a401[_0xe439('0x76')]='COMPLETEDBYAGENT';}}}catch(_0x5c144c){logger[_0xe439('0x3a')](_0xe439('0x7f'),util[_0xe439('0x42')](_0x5c144c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x80')]=function(_0x1202d1){try{if(this[_0xe439('0x5b')](_0x1202d1)){if(this[_0xe439('0x10')][_0x1202d1[_0xe439('0x6a')]]){var _0x526427=_[_0xe439('0x7a')](this[_0xe439('0x10')][_0x1202d1[_0xe439('0x6a')]]);_0x526427[_0xe439('0x1d')]=![];_0x526427['queuecallerabandonAt']=null;_0x526427[_0xe439('0x81')]=!![];_0x526427['lastAssignedTo']=_0x1202d1[_0xe439('0x82')];_0x526427[_0xe439('0x73')]=_0x1202d1[_0xe439('0x73')];_0x526427[_0xe439('0x7e')]=!![];_0x526427['queuecallerexit']=![];_0x526427['queuecallerexitAt']=null;if(!_0x526427[_0xe439('0x83')]){if(_0x1202d1[_0xe439('0x84')]=='transfer'){_0x526427['queuecallerexitreason']=_0xe439('0x85');}else{if(_[_0xe439('0x86')](_0x1202d1[_0xe439('0x37')][_0xe439('0x87')](),'local/')){if(this[_0xe439('0x10')][_0x1202d1[_0xe439('0x88')]]){var _0x40a82e=_['last'](this[_0xe439('0x10')][_0x1202d1[_0xe439('0x88')]]);_0x40a82e[_0xe439('0x7e')]=![];_0x40a82e[_0xe439('0x89')]=!![];_0x40a82e[_0xe439('0x8a')]=moment(_0x526427[_0xe439('0x6b')])[_0xe439('0x8b')](_0x1202d1['holdtime'],'seconds')[_0xe439('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x40a82e[_0xe439('0x76')]=_0xe439('0x8c');_0x40a82e[_0xe439('0x83')]=!![];_0x40a82e[_0xe439('0x8d')]='FORWARD';_0x40a82e[_0xe439('0x8e')]=_0x1202d1[_0xe439('0x8f')];_0x40a82e[_0xe439('0x90')]=_0x1202d1[_0xe439('0x6a')];var _0x391a98=this[_0xe439('0x10')][_0x1202d1[_0xe439('0x88')]];this[_0xe439('0x10')][_0x1202d1['linkedid']]=this[_0xe439('0x10')][_0x1202d1[_0xe439('0x6a')]];this[_0xe439('0x10')][_0x1202d1['uniqueid']]=_0x391a98;}}else{_0x526427['queuecallerexitreason']=_0xe439('0x91')+_0x1202d1[_0xe439('0x84')][_0xe439('0x92')]();}}}this[_0xe439('0x34')][_0x1202d1[_0xe439('0x6a')]]=_0x526427;this[_0xe439('0x41')](_0x526427);}}}catch(_0x423e59){logger[_0xe439('0x3a')](_0xe439('0x93'),util['inspect'](_0x423e59,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0xab03f3){try{if(this['isNotNull'](_0xab03f3)){this['addVariable'](_0xab03f3[_0xe439('0x6a')],_['keys'](_0xab03f3[_0xe439('0x94')])[0x0],_0xab03f3['value']);if(this[_0xe439('0x10')][_0xab03f3[_0xe439('0x6a')]]){var _0x296cf9=_[_0xe439('0x7a')](this[_0xe439('0x10')][_0xab03f3[_0xe439('0x6a')]]);if(_0x296cf9){if(this[_0xe439('0x5b')](_0xab03f3[_0xe439('0x94')])&&this[_0xe439('0x5b')](_0xab03f3['variable']['queuestatus'])){switch(_0xab03f3['value']){case _0xe439('0x95'):_0x296cf9[_0xe439('0x89')]=![];_0x296cf9[_0xe439('0x8a')]=null;break;case _0xe439('0x96'):_0x296cf9[_0xe439('0x97')]=_0xe439('0x98');ami[_0xe439('0x43')](_0xe439('0x99'),_0x296cf9);break;default:_0x296cf9[_0xe439('0x89')]=!![];_0x296cf9['queuecallerexitAt']=moment()[_0xe439('0x45')](_0xe439('0x9a'));_0x296cf9[_0xe439('0x9b')]=moment()[_0xe439('0x45')](_0xe439('0x9a'));}_0x296cf9[_0xe439('0x1d')]=![];_0x296cf9[_0xe439('0x75')]=null;_0x296cf9[_0xe439('0x76')]=_0xab03f3[_0xe439('0x9c')];this[_0xe439('0x34')][_0xab03f3['uniqueid']]=_0x296cf9;this['emitVoiceQueueChannelRemove'](_0x296cf9);}else if(this[_0xe439('0x5b')](_0xab03f3[_0xe439('0x94')])&&this[_0xe439('0x5b')](_0xab03f3['variable'][_0xe439('0x9d')])){if(!_0x296cf9[_0xe439('0x1d')]){_0x296cf9[_0xe439('0x89')]=!![];_0x296cf9[_0xe439('0x8a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x296cf9['queuecallerexitreason']=_0xe439('0x9e');_0x296cf9[_0xe439('0x9b')]=moment()[_0xe439('0x45')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xe439('0x34')][_0xab03f3[_0xe439('0x6a')]]=_0x296cf9;}}_0x296cf9[_0xe439('0x15')]=this[_0xe439('0x15')][_0xab03f3[_0xe439('0x6a')]];}}}}catch(_0x5f0caf){logger[_0xe439('0x3a')](_0xe439('0x9f'),util[_0xe439('0x42')](_0x5f0caf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe439('0x32')]['addVariable']=function(_0x260008,_0x41392b,_0xe50dac){var _0x327293=[_0xe439('0xa0'),_0xe439('0xa1'),'rtpaudioqosjitter',_0xe439('0xa2'),_0xe439('0xa3'),_0xe439('0xa4'),_0xe439('0xa5'),_0xe439('0xa6'),_0xe439('0xa7'),_0xe439('0xa8'),_0xe439('0xa9'),_0xe439('0xaa'),_0xe439('0xab'),'memberdynamic','memberinterface',_0xe439('0xac'),'membername','memberpenalty','memberrealtime'];if(!_['isNil'](_0x41392b)&&!_['includes'](_0x327293,_0x41392b)){if(_['isUndefined'](this['variables'][_0x260008])){this['variables'][_0x260008]={};}this[_0xe439('0x15')][_0x260008][_0x41392b]=_0xe50dac;}};VoiceQueueReport[_0xe439('0x32')][_0xe439('0x21')]=function(_0x3a6608){try{if(this['isNotNull'](_0x3a6608)){if(this['queueReports'][_0x3a6608[_0xe439('0x6a')]]){for(var _0x3490d3=0x0,_0x3bfb8c={};_0x3490d30x0?_0x1dd78c:0x0;this[_0x82c1('0x12')][_0x1b7239[_0x82c1('0x65')]][_0x82c1('0x55')]=this[_0x82c1('0x12')][_0x1b7239[_0x82c1('0x65')]]['talking']>_[_0x82c1('0x67')](_0x1b7239[_0x82c1('0x68')])?_[_0x82c1('0x67')](_0x1b7239[_0x82c1('0x68')]):this[_0x82c1('0x12')][_0x1b7239[_0x82c1('0x65')]][_0x82c1('0x55')];this[_0x82c1('0x4c')](this[_0x82c1('0x12')][_0x1b7239['queue']]);}ami[_0x82c1('0x45')](_0x82c1('0x69'),this[_0x82c1('0x12')][_0x1b7239['queue']]);}}}catch(_0x14f816){logger[_0x82c1('0x3f')](_0x82c1('0x6a'),util['inspect'](_0x14f816,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82c1('0xc')]['syncQueueSummaryComplete']=function(_0x4cf97f){this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x82c1('0x6b')]=function(_0x531261){};VoiceQueueReport['prototype'][_0x82c1('0x1b')]=function(_0x5401f1){try{if(this[_0x82c1('0x5f')](_0x5401f1)){if(_[_0x82c1('0x30')](this['queueReports'][_0x5401f1[_0x82c1('0x6c')]])){this[_0x82c1('0x10')][_0x5401f1['uniqueid']]=[];this['channels'][_0x5401f1[_0x82c1('0x6c')]]={};}var _0x53e0a0=new QueueReport();_0x53e0a0[_0x82c1('0x47')]=_0x5401f1[_0x82c1('0x65')];_0x53e0a0[_0x82c1('0x4d')]=this[_0x82c1('0x12')][_0x53e0a0['name']]&&this[_0x82c1('0x12')][_0x53e0a0[_0x82c1('0x47')]][_0x82c1('0x4d')]?this[_0x82c1('0x12')][_0x53e0a0[_0x82c1('0x47')]][_0x82c1('0x4d')]||'inbound':_0x82c1('0x6d');_0x53e0a0[_0x82c1('0x65')]=_0x5401f1[_0x82c1('0x65')];_0x53e0a0['queuecallerjoinAt']=moment()[_0x82c1('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x53e0a0['position']=_0x5401f1[_0x82c1('0x6e')];_0x53e0a0[_0x82c1('0x6f')]=_0x5401f1['count'];_['merge'](_0x53e0a0,_[_0x82c1('0x70')](_0x5401f1,_['keys'](_0x53e0a0)));this[_0x82c1('0x10')][_0x5401f1[_0x82c1('0x6c')]]['push'](_0x53e0a0);this[_0x82c1('0x37')][_0x5401f1['uniqueid']]=_0x53e0a0;this[_0x82c1('0x71')](_0x53e0a0);}}catch(_0x22a8c5){logger[_0x82c1('0x3f')]('[syncQueueCallerJoin][VoiceQueueReport]',util[_0x82c1('0x44')](_0x22a8c5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82c1('0xc')]['syncQueueCallerAbandon']=function(_0x1b5551){try{if(this['isNotNull'](_0x1b5551)){if(this[_0x82c1('0x10')][_0x1b5551['uniqueid']]){var _0x3f1310=_[_0x82c1('0x72')](this[_0x82c1('0x10')][_0x1b5551[_0x82c1('0x6c')]]);_0x3f1310[_0x82c1('0x73')]=![];_0x3f1310[_0x82c1('0x74')]=null;_0x3f1310[_0x82c1('0x75')]=_0x1b5551['holdtime'];_0x3f1310[_0x82c1('0x76')]=_0x1b5551[_0x82c1('0x76')];_0x3f1310['queuecallerabandon']=!![];_0x3f1310[_0x82c1('0x77')]=moment()[_0x82c1('0x4a')](_0x82c1('0x78'));_0x3f1310[_0x82c1('0x79')]=_0x82c1('0x7a');_0x3f1310['lastAssignedTo']=null;this[_0x82c1('0x37')][_0x1b5551[_0x82c1('0x6c')]]=_0x3f1310;this['emitVoiceQueueChannelRemove'](_0x3f1310);}}}catch(_0x4948be){logger[_0x82c1('0x3f')](_0x82c1('0x7b'),util['inspect'](_0x4948be,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x82c1('0x1e')]=function(_0x4be437){try{if(this[_0x82c1('0x5f')](_0x4be437)){if(this[_0x82c1('0x10')][_0x4be437['uniqueid']]){var _0xe98fb4=_['last'](this['queueReports'][_0x4be437['uniqueid']]);_0xe98fb4[_0x82c1('0x7c')]=moment()[_0x82c1('0x4a')](_0x82c1('0x78'));_0xe98fb4[_0x82c1('0x7d')]=_0x4be437[_0x82c1('0x7d')];_0xe98fb4[_0x82c1('0x7e')]=_0x4be437[_0x82c1('0x7e')];this[_0x82c1('0x37')][_0x4be437[_0x82c1('0x6c')]]=_0xe98fb4;this[_0x82c1('0x71')](_0xe98fb4);}}}catch(_0xf87116){logger[_0x82c1('0x3f')](_0x82c1('0x7f'),util[_0x82c1('0x44')](_0xf87116,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82c1('0xc')][_0x82c1('0x22')]=function(_0x10006d){try{if(this[_0x82c1('0x5f')](_0x10006d)){if(this['queueReports'][_0x10006d[_0x82c1('0x6c')]]){var _0x44c0b4=_[_0x82c1('0x72')](this[_0x82c1('0x10')][_0x10006d[_0x82c1('0x6c')]]);_0x44c0b4[_0x82c1('0x73')]=!![];_0x44c0b4['queuecallerexitreason']=_0x82c1('0x80');}}}catch(_0x425871){logger[_0x82c1('0x3f')](_0x82c1('0x81'),util['inspect'](_0x425871,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x82c1('0x20')]=function(_0x2f227f){try{if(this[_0x82c1('0x5f')](_0x2f227f)){if(this[_0x82c1('0x10')][_0x2f227f['uniqueid']]){var _0x2db69d=_['last'](this[_0x82c1('0x10')][_0x2f227f[_0x82c1('0x6c')]]);_0x2db69d['queuecallerabandon']=![];_0x2db69d['queuecallerabandonAt']=null;_0x2db69d[_0x82c1('0x82')]=!![];_0x2db69d['lastAssignedTo']=_0x2f227f[_0x82c1('0x83')];_0x2db69d[_0x82c1('0x75')]=_0x2f227f[_0x82c1('0x75')];_0x2db69d[_0x82c1('0x73')]=!![];_0x2db69d[_0x82c1('0x84')]=![];_0x2db69d[_0x82c1('0x85')]=null;if(!_0x2db69d[_0x82c1('0x86')]){if(_0x2f227f[_0x82c1('0x87')]=='transfer'){_0x2db69d['queuecallerexitreason']=_0x82c1('0x88');}else{if(_['startsWith'](_0x2f227f['channel']['toLowerCase'](),_0x82c1('0x89'))){if(this[_0x82c1('0x10')][_0x2f227f[_0x82c1('0x8a')]]){var _0x2357bf=_[_0x82c1('0x72')](this[_0x82c1('0x10')][_0x2f227f[_0x82c1('0x8a')]]);_0x2357bf[_0x82c1('0x73')]=![];_0x2357bf['queuecallerexit']=!![];_0x2357bf[_0x82c1('0x85')]=moment(_0x2db69d[_0x82c1('0x8b')])[_0x82c1('0x8c')](_0x2f227f['holdtime'],'seconds')[_0x82c1('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x2357bf[_0x82c1('0x79')]='FORWARDTRANSFER';_0x2357bf[_0x82c1('0x86')]=!![];_0x2357bf[_0x82c1('0x8d')]=_0x82c1('0x8e');_0x2357bf[_0x82c1('0x8f')]=_0x2f227f[_0x82c1('0x90')];_0x2357bf[_0x82c1('0x91')]=_0x2f227f[_0x82c1('0x6c')];var _0x48248c=this[_0x82c1('0x10')][_0x2f227f[_0x82c1('0x8a')]];this[_0x82c1('0x10')][_0x2f227f[_0x82c1('0x8a')]]=this['queueReports'][_0x2f227f['uniqueid']];this[_0x82c1('0x10')][_0x2f227f[_0x82c1('0x6c')]]=_0x48248c;}}else{_0x2db69d[_0x82c1('0x79')]=_0x82c1('0x92')+_0x2f227f[_0x82c1('0x87')][_0x82c1('0x93')]();}}}this[_0x82c1('0x37')][_0x2f227f[_0x82c1('0x6c')]]=_0x2db69d;this[_0x82c1('0x94')](_0x2db69d);}}}catch(_0x1322ab){logger['error']('[syncAgentComplete][VoiceQueueReport]',util['inspect'](_0x1322ab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82c1('0xc')][_0x82c1('0x24')]=function(_0x15e12f){try{if(this[_0x82c1('0x5f')](_0x15e12f)){this['addVariable'](_0x15e12f[_0x82c1('0x6c')],_[_0x82c1('0x95')](_0x15e12f['variable'])[0x0],_0x15e12f[_0x82c1('0x96')]);if(this[_0x82c1('0x10')][_0x15e12f[_0x82c1('0x6c')]]){var _0x503455=_[_0x82c1('0x72')](this[_0x82c1('0x10')][_0x15e12f[_0x82c1('0x6c')]]);if(_0x503455){if(this[_0x82c1('0x5f')](_0x15e12f['variable'])&&this[_0x82c1('0x5f')](_0x15e12f[_0x82c1('0x97')][_0x82c1('0x98')])){switch(_0x15e12f[_0x82c1('0x96')]){case _0x82c1('0x99'):_0x503455['queuecallerexit']=![];_0x503455['queuecallerexitAt']=null;break;case _0x82c1('0x9a'):_0x503455['lastevent']=_0x82c1('0x9b');ami[_0x82c1('0x45')](_0x82c1('0x9c'),_0x503455);break;default:_0x503455[_0x82c1('0x84')]=!![];_0x503455['queuecallerexitAt']=moment()[_0x82c1('0x4a')](_0x82c1('0x78'));_0x503455['queuecallerleaveAt']=moment()[_0x82c1('0x4a')](_0x82c1('0x78'));}_0x503455[_0x82c1('0x1c')]=![];_0x503455['queuecallerabandonAt']=null;_0x503455[_0x82c1('0x79')]=_0x15e12f[_0x82c1('0x96')];this[_0x82c1('0x37')][_0x15e12f['uniqueid']]=_0x503455;this[_0x82c1('0x94')](_0x503455);}else if(this[_0x82c1('0x5f')](_0x15e12f[_0x82c1('0x97')])&&this[_0x82c1('0x5f')](_0x15e12f[_0x82c1('0x97')][_0x82c1('0x9d')])){if(!_0x503455[_0x82c1('0x1c')]){_0x503455[_0x82c1('0x84')]=!![];_0x503455[_0x82c1('0x85')]=moment()[_0x82c1('0x4a')](_0x82c1('0x78'));_0x503455['queuecallerexitreason']=_0x82c1('0x9e');_0x503455['queuecallerleaveAt']=moment()[_0x82c1('0x4a')](_0x82c1('0x78'));this[_0x82c1('0x37')][_0x15e12f['uniqueid']]=_0x503455;}}_0x503455[_0x82c1('0x15')]=this['variables'][_0x15e12f['uniqueid']];}}}}catch(_0x28ba13){logger[_0x82c1('0x3f')]('[syncVarSet][VoiceQueueReport]',util[_0x82c1('0x44')](_0x28ba13,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82c1('0xc')][_0x82c1('0x9f')]=function(_0x56daee,_0x3e15d5,_0x107589){var _0x30280b=[_0x82c1('0xa0'),'rtpaudioqosbridged',_0x82c1('0xa1'),_0x82c1('0xa2'),_0x82c1('0xa3'),'rtpaudioqoslossbridged',_0x82c1('0xa4'),_0x82c1('0xa5'),'sipcallid','sipuri',_0x82c1('0xa6'),_0x82c1('0xa7'),_0x82c1('0xa8'),_0x82c1('0xa9'),_0x82c1('0xaa'),_0x82c1('0xab'),'membername','memberpenalty','memberrealtime'];if(!_[_0x82c1('0x39')](_0x3e15d5)&&!_[_0x82c1('0xac')](_0x30280b,_0x3e15d5)){if(_[_0x82c1('0x30')](this['variables'][_0x56daee])){this[_0x82c1('0x15')][_0x56daee]={};}this['variables'][_0x56daee][_0x3e15d5]=_0x107589;}};VoiceQueueReport[_0x82c1('0xc')]['syncHangup']=function(_0x2ea0cd){try{if(this[_0x82c1('0x5f')](_0x2ea0cd)){if(this[_0x82c1('0x10')][_0x2ea0cd['uniqueid']]){for(var _0xfb492=0x0,_0x3bf1af={};_0xfb492=0x0?moment(_0x3f44ad['endtime'])[_0x907d('0xe')](_0x3f44ad['starttime'],_0x907d('0xf')):null,'data1':'outbound','data2':_0x3f44ad['accountcode'],'data3':_0x3f44ad[_0x907d('0x12')],'data4':_0x3f44ad[_0x907d('0x1b')]||null,'role':_0x907d('0x13'),'internal':_0x3f44ad['accountcode']?_[_0x907d('0x14')](_0x3f44ad[_0x907d('0x15')]):undefined,'uniqueid':_0x3f44ad[_0x907d('0x16')]},'log':_0x907d('0x6')});}; \ No newline at end of file +var _0x42aa=['CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','queuecallerleaveAt','diff','seconds','inbound','queue','accountcode','toNumber','uniqueid','voiceDialReport','starttime','endtime','outbound','moment','util','../client','voiceQueueReport','queuecallerexitAt','Request'];(function(_0x569708,_0x338eff){var _0x256704=function(_0x58e29e){while(--_0x58e29e){_0x569708['push'](_0x569708['shift']());}};_0x256704(++_0x338eff);}(_0x42aa,0x14c));var _0xa42a=function(_0x5d6ef1,_0x1466da){_0x5d6ef1=_0x5d6ef1-0x0;var _0x289d86=_0x42aa[_0x5d6ef1];return _0x289d86;};'use strict';var moment=require(_0xa42a('0x0'));var _=require('lodash');var util=require(_0xa42a('0x1'));var client=require(_0xa42a('0x2'));exports[_0xa42a('0x3')]=function(_0x16667e){var _0x273aad=_0x16667e['queuecallercompleteAt']||_0x16667e[_0xa42a('0x4')];return client[_0xa42a('0x5')](_0xa42a('0x6'),{'body':{'channel':_0xa42a('0x7'),'membername':_0x16667e[_0xa42a('0x8')],'interface':_[_0xa42a('0x9')](_0x16667e[_0xa42a('0xa')])?util[_0xa42a('0xb')](_0xa42a('0xc'),_0x16667e[_0xa42a('0x8')]):_0x16667e[_0xa42a('0xa')],'type':_0xa42a('0xd'),'enterAt':_0x16667e[_0xa42a('0xe')],'exitAt':_0x273aad,'duration':moment(_0x273aad)[_0xa42a('0xf')](_0x16667e[_0xa42a('0xe')],_0xa42a('0x10')),'data1':_0xa42a('0x11'),'data2':_0x16667e['calleridnum'],'data3':_0x16667e['exten'],'data4':null,'data5':_0x16667e[_0xa42a('0x12')],'role':'agent','internal':_0x16667e[_0xa42a('0x13')]?_[_0xa42a('0x14')](_0x16667e[_0xa42a('0x13')]):undefined,'uniqueid':_0x16667e[_0xa42a('0x15')]},'log':_0xa42a('0x6')});};exports[_0xa42a('0x16')]=function(_0x5827ff){return client[_0xa42a('0x5')](_0xa42a('0x6'),{'body':{'channel':'voice','membername':_0x5827ff['membername'],'interface':_0x5827ff[_0xa42a('0xa')],'type':_0xa42a('0xd'),'enterAt':_0x5827ff[_0xa42a('0x17')],'exitAt':_0x5827ff[_0xa42a('0x18')],'duration':moment(_0x5827ff[_0xa42a('0x18')])[_0xa42a('0xf')](_0x5827ff[_0xa42a('0x17')],_0xa42a('0x10'))>=0x0?moment(_0x5827ff['endtime'])[_0xa42a('0xf')](_0x5827ff['starttime'],_0xa42a('0x10')):null,'data1':_0xa42a('0x19'),'data2':_0x5827ff['accountcode'],'data3':_0x5827ff['exten'],'data4':_0x5827ff['dialstring']||null,'role':'agent','internal':_0x5827ff[_0xa42a('0x13')]?_[_0xa42a('0x14')](_0x5827ff['accountcode']):undefined,'uniqueid':_0x5827ff[_0xa42a('0x15')]},'log':_0xa42a('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index d1f4d1f..fd9f702 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 _0x131e=['Request','GetTemplate','name','html'];(function(_0x32436f,_0x24a1de){var _0x592695=function(_0x4a5a56){while(--_0x4a5a56){_0x32436f['push'](_0x32436f['shift']());}};_0x592695(++_0x24a1de);}(_0x131e,0x1ec));var _0xe131=function(_0x25f9f6,_0x2916e2){_0x25f9f6=_0x25f9f6-0x0;var _0x17910a=_0x131e[_0x25f9f6];return _0x17910a;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x58ba04){return function(_0x10fd23){return client[_0xe131('0x0')](_0xe131('0x1'),{'options':{'raw':!![],'attributes':['id',_0xe131('0x2'),_0xe131('0x3')]},'log':_0xe131('0x1')});};}; \ No newline at end of file +var _0x97c1=['name','html','GetTemplate','../client','getTemplates'];(function(_0x2d460c,_0x4f08c0){var _0xf6fc4c=function(_0x4fb81c){while(--_0x4fb81c){_0x2d460c['push'](_0x2d460c['shift']());}};_0xf6fc4c(++_0x4f08c0);}(_0x97c1,0xdf));var _0x197c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x97c1[_0x57b54c];return _0x59cc19;};'use strict';var client=require(_0x197c('0x0'));exports[_0x197c('0x1')]=function(_0x55b95a){return function(_0x5e2e81){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x197c('0x2'),_0x197c('0x3')]},'log':_0x197c('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 1bba41f..8ae904a 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 _0xd291=['data2','data5','data7','../client','getTriggers','GetTrigger','name','status','Condition','AllConditions','field','operator','value','AnyConditions','Actions','action','data1'];(function(_0x2a1b33,_0x409f50){var _0x4c50e7=function(_0x13e16d){while(--_0x13e16d){_0x2a1b33['push'](_0x2a1b33['shift']());}};_0x4c50e7(++_0x409f50);}(_0xd291,0x1ce));var _0x1d29=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd291[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x1d29('0x0'));exports[_0x1d29('0x1')]=function(_0x5eb5b6){return function(_0x4e791f){return client['Request'](_0x1d29('0x2'),{'options':{'raw':![],'attributes':['id',_0x1d29('0x3'),'channel',_0x1d29('0x4')],'include':[{'model':_0x1d29('0x5'),'as':_0x1d29('0x6'),'attributes':['id',_0x1d29('0x7'),_0x1d29('0x8'),_0x1d29('0x9')]},{'model':_0x1d29('0x5'),'as':_0x1d29('0xa'),'attributes':['id',_0x1d29('0x7'),'operator',_0x1d29('0x9')]},{'model':'Action','as':_0x1d29('0xb'),'attributes':['id',_0x1d29('0xc'),_0x1d29('0xd'),_0x1d29('0xe'),'data3','data4',_0x1d29('0xf'),'data6',_0x1d29('0x10')]}]},'log':_0x1d29('0x2')});};}; \ No newline at end of file +var _0x6cb2=['data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Actions','action','data1','data2'];(function(_0x5a1636,_0x9b9bfd){var _0x3af506=function(_0x3cbd8c){while(--_0x3cbd8c){_0x5a1636['push'](_0x5a1636['shift']());}};_0x3af506(++_0x9b9bfd);}(_0x6cb2,0x6d));var _0x26cb=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x6cb2[_0x16b9ed];return _0x66b1f8;};'use strict';var client=require(_0x26cb('0x0'));exports[_0x26cb('0x1')]=function(_0x13c7d8){return function(_0x2ed567){return client[_0x26cb('0x2')](_0x26cb('0x3'),{'options':{'raw':![],'attributes':['id',_0x26cb('0x4'),_0x26cb('0x5'),_0x26cb('0x6')],'include':[{'model':_0x26cb('0x7'),'as':_0x26cb('0x8'),'attributes':['id',_0x26cb('0x9'),_0x26cb('0xa'),_0x26cb('0xb')]},{'model':_0x26cb('0x7'),'as':_0x26cb('0xc'),'attributes':['id','field',_0x26cb('0xa'),_0x26cb('0xb')]},{'model':'Action','as':_0x26cb('0xd'),'attributes':['id',_0x26cb('0xe'),_0x26cb('0xf'),_0x26cb('0x10'),'data3',_0x26cb('0x11'),_0x26cb('0x12'),_0x26cb('0x13'),_0x26cb('0x14')]}]},'log':_0x26cb('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 05248d8..eb6aebd 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 _0x6e2a=['registry','../client','getTrunks','Request','GetTrunk'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x6e2a,0x17d));var _0xa6e2=function(_0x24fdac,_0x3189e3){_0x24fdac=_0x24fdac-0x0;var _0x275ade=_0x6e2a[_0x24fdac];return _0x275ade;};'use strict';var client=require(_0xa6e2('0x0'));exports[_0xa6e2('0x1')]=function(_0x5c5958){return function(_0x4f3ef1){return client[_0xa6e2('0x2')](_0xa6e2('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xa6e2('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x7d6e=['Request','GetTrunk','name','registry','../client'];(function(_0x207d5f,_0x2ad954){var _0x1e72d7=function(_0x4d5fce){while(--_0x4d5fce){_0x207d5f['push'](_0x207d5f['shift']());}};_0x1e72d7(++_0x2ad954);}(_0x7d6e,0x7c));var _0xe7d6=function(_0x4557dc,_0x3687b2){_0x4557dc=_0x4557dc-0x0;var _0x1377aa=_0x7d6e[_0x4557dc];return _0x1377aa;};'use strict';var client=require(_0xe7d6('0x0'));exports['getTrunks']=function(_0x53dc39){return function(_0xf7f1bd){return client[_0xe7d6('0x1')](_0xe7d6('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xe7d6('0x3'),_0xe7d6('0x4')]},'log':_0xe7d6('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 7be5696..c5f906d 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 _0x8d35=['phone','mobile','interface','telephone','internal','getTelephones','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','../client','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x20118a,_0x3dbdf3){var _0x538b5f=function(_0x31c5b4){while(--_0x31c5b4){_0x20118a['push'](_0x20118a['shift']());}};_0x538b5f(++_0x3dbdf3);}(_0x8d35,0x1b4));var _0x58d3=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x8d35[_0x9dfc10];return _0x4f938a;};'use strict';var client=require(_0x58d3('0x0'));exports[_0x58d3('0x1')]=function(){return function(){return client[_0x58d3('0x2')](_0x58d3('0x3'),{'options':{'raw':![],'where':{'role':_0x58d3('0x4')},'attributes':['id',_0x58d3('0x5'),_0x58d3('0x6'),_0x58d3('0x7'),_0x58d3('0x8'),_0x58d3('0x9'),_0x58d3('0xa'),_0x58d3('0xb'),_0x58d3('0xc'),_0x58d3('0xd'),_0x58d3('0xe'),_0x58d3('0xf'),_0x58d3('0x10')]},'log':'getAgents'});};};exports['getTelephones']=function(){return function(){return client[_0x58d3('0x2')](_0x58d3('0x3'),{'options':{'raw':!![],'where':{'role':_0x58d3('0x11')},'attributes':['id',_0x58d3('0x5'),_0x58d3('0x7'),_0x58d3('0x12')]},'log':_0x58d3('0x13')});};};exports[_0x58d3('0x14')]=function(_0x53820c,_0x105e86,_0x5ce578){return client[_0x58d3('0x2')](_0x58d3('0x15'),{'body':{'type':_0x105e86,'uniqueid':_0x5ce578},'options':{'where':{'id':_0x53820c['id']}},'log':_0x58d3('0x14')});};exports[_0x58d3('0x16')]=function(_0x2523c5){return client[_0x58d3('0x2')](_0x58d3('0x17'),{'body':{},'options':{'where':{'id':_0x2523c5['id']}},'log':_0x58d3('0x14')});};exports['getAgent']=function(_0x1f9e51){return client[_0x58d3('0x2')]('ShowUser',{'options':{'raw':![],'where':{'role':'agent','id':_0x1f9e51},'attributes':['id',_0x58d3('0x5'),_0x58d3('0x6'),'accountcode',_0x58d3('0x8'),_0x58d3('0x9'),_0x58d3('0xa'),_0x58d3('0xb'),_0x58d3('0xc'),_0x58d3('0xd'),_0x58d3('0x10')]},'log':_0x58d3('0x18')});}; \ No newline at end of file +var _0xb6fa=['getTelephones','telephone','internal','savePause','PauseUser','UnpauseUser','getAgent','ShowUser','online','lastPauseAt','interface','../client','getAgents','Request','agent','email','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','mobile'];(function(_0x596726,_0x26e82e){var _0x14b865=function(_0x297eb8){while(--_0x297eb8){_0x596726['push'](_0x596726['shift']());}};_0x14b865(++_0x26e82e);}(_0xb6fa,0x17b));var _0xab6f=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xb6fa[_0x273c39];return _0x46d6b5;};'use strict';var client=require(_0xab6f('0x0'));exports[_0xab6f('0x1')]=function(){return function(){return client[_0xab6f('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':_0xab6f('0x3')},'attributes':['id','name',_0xab6f('0x4'),_0xab6f('0x5'),_0xab6f('0x6'),'online',_0xab6f('0x7'),_0xab6f('0x8'),'lastPauseAt',_0xab6f('0x9'),_0xab6f('0xa'),_0xab6f('0xb'),'interface']},'log':_0xab6f('0x1')});};};exports[_0xab6f('0xc')]=function(){return function(){return client[_0xab6f('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':_0xab6f('0xd')},'attributes':['id','name',_0xab6f('0x5'),_0xab6f('0xe')]},'log':_0xab6f('0xc')});};};exports[_0xab6f('0xf')]=function(_0x318366,_0x103c77,_0x4835ed){return client[_0xab6f('0x2')](_0xab6f('0x10'),{'body':{'type':_0x103c77,'uniqueid':_0x4835ed},'options':{'where':{'id':_0x318366['id']}},'log':_0xab6f('0xf')});};exports['saveUnpause']=function(_0x46c145){return client['Request'](_0xab6f('0x11'),{'body':{},'options':{'where':{'id':_0x46c145['id']}},'log':_0xab6f('0xf')});};exports[_0xab6f('0x12')]=function(_0x517fe6){return client[_0xab6f('0x2')](_0xab6f('0x13'),{'options':{'raw':![],'where':{'role':_0xab6f('0x3'),'id':_0x517fe6},'attributes':['id','name','email',_0xab6f('0x5'),_0xab6f('0x6'),_0xab6f('0x14'),'lastLoginAt',_0xab6f('0x8'),_0xab6f('0x15'),_0xab6f('0x9'),_0xab6f('0x16')]},'log':_0xab6f('0x12')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 337a6c4..ca34648 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 _0x7314=['UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x25912e,_0x3966c6){var _0xd0d02=function(_0x56564b){while(--_0x56564b){_0x25912e['push'](_0x25912e['shift']());}};_0xd0d02(++_0x3966c6);}(_0x7314,0x100));var _0x4731=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7314[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x4731('0x0'));exports[_0x4731('0x1')]=function(_0x487834){return client[_0x4731('0x2')](_0x4731('0x3'),{'body':_0x487834,'log':_0x4731('0x3')});};exports['update']=function(_0x263468,_0x46b6c3,_0x2de317){return client['Request'](_0x4731('0x4'),{'body':_0x263468,'options':{'where':{'uniqueid':_0x46b6c3,'interface':_0x2de317,'agentcomplete':!![]}},'log':_0x4731('0x4')});}; \ No newline at end of file +var _0x2141=['CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x3cedc7,_0x4b681a){var _0x53ef2a=function(_0x99006e){while(--_0x99006e){_0x3cedc7['push'](_0x3cedc7['shift']());}};_0x53ef2a(++_0x4b681a);}(_0x2141,0x1ba));var _0x1214=function(_0x49acd6,_0x3403db){_0x49acd6=_0x49acd6-0x0;var _0x404db1=_0x2141[_0x49acd6];return _0x404db1;};'use strict';var client=require(_0x1214('0x0'));exports[_0x1214('0x1')]=function(_0x236d35){return client[_0x1214('0x2')](_0x1214('0x3'),{'body':_0x236d35,'log':_0x1214('0x3')});};exports['update']=function(_0x535db1,_0x1f8170,_0x2ffb3b){return client[_0x1214('0x2')](_0x1214('0x4'),{'body':_0x535db1,'options':{'where':{'uniqueid':_0x1f8170,'interface':_0x2ffb3b,'agentcomplete':!![]}},'log':_0x1214('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 23044b9..e202346 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 _0x68a4=['disposition','billableseconds','GetVoiceCallReports','util','lodash','../client','Request','CreateVoiceCallReport','calleridnum','context','callerid','DOCUMENTATION','outbound','startOf','day','format','endOf','type'];(function(_0x11a83e,_0x3e8ddf){var _0x3ed634=function(_0x16f866){while(--_0x16f866){_0x11a83e['push'](_0x11a83e['shift']());}};_0x3ed634(++_0x3e8ddf);}(_0x68a4,0x1c5));var _0x468a=function(_0x1ef08e,_0x918ebf){_0x1ef08e=_0x1ef08e-0x0;var _0x43e915=_0x68a4[_0x1ef08e];return _0x43e915;};'use strict';var moment=require('moment');var util=require(_0x468a('0x0'));var _=require(_0x468a('0x1'));var client=require(_0x468a('0x2'));exports['create']=function(_0x544686){return client[_0x468a('0x3')](_0x468a('0x4'),{'body':_['merge'](_0x544686,{'source':_0x544686[_0x468a('0x5')],'destinationcontext':_0x544686[_0x468a('0x6')],'callerid':_0x544686[_0x468a('0x7')],'amaflags':_0x468a('0x8')}),'log':_0x468a('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x468a('0x3')]('GetVoiceCallReport',{'options':{'where':{'type':[_0x468a('0x9')],'createdAt':{'$between':[moment()[_0x468a('0xa')](_0x468a('0xb'))[_0x468a('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x468a('0xd')]('day')[_0x468a('0xc')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x468a('0xe'),_0x468a('0xf'),'duration',_0x468a('0x10')]},'log':_0x468a('0x11')});};}; \ No newline at end of file +var _0x4b55=['callerid','GetVoiceCallReport','outbound','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','moment','util','create','Request','CreateVoiceCallReport','merge','calleridnum'];(function(_0x3a0798,_0x15c8df){var _0x27e1ed=function(_0x44d7b0){while(--_0x44d7b0){_0x3a0798['push'](_0x3a0798['shift']());}};_0x27e1ed(++_0x15c8df);}(_0x4b55,0xf5));var _0x54b5=function(_0x16b4bc,_0x24d6a7){_0x16b4bc=_0x16b4bc-0x0;var _0x2f1e04=_0x4b55[_0x16b4bc];return _0x2f1e04;};'use strict';var moment=require(_0x54b5('0x0'));var util=require(_0x54b5('0x1'));var _=require('lodash');var client=require('../client');exports[_0x54b5('0x2')]=function(_0x433855){return client[_0x54b5('0x3')](_0x54b5('0x4'),{'body':_[_0x54b5('0x5')](_0x433855,{'source':_0x433855[_0x54b5('0x6')],'destinationcontext':_0x433855['context'],'callerid':_0x433855[_0x54b5('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0x54b5('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x54b5('0x3')](_0x54b5('0x8'),{'options':{'where':{'type':[_0x54b5('0x9')],'createdAt':{'$between':[moment()[_0x54b5('0xa')](_0x54b5('0xb'))[_0x54b5('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x54b5('0xd')](_0x54b5('0xb'))[_0x54b5('0xc')](_0x54b5('0xe'))]}},'attributes':[_0x54b5('0xf'),_0x54b5('0x10'),_0x54b5('0x11'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 72b63b7..d7a1eac 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 _0x4310=['create','Request','CreateVoiceDialReport'];(function(_0x95b6b9,_0x566e6f){var _0x1b1e4b=function(_0x13062e){while(--_0x13062e){_0x95b6b9['push'](_0x95b6b9['shift']());}};_0x1b1e4b(++_0x566e6f);}(_0x4310,0xd2));var _0x0431=function(_0x1df9f6,_0x1de537){_0x1df9f6=_0x1df9f6-0x0;var _0x46e411=_0x4310[_0x1df9f6];return _0x46e411;};'use strict';var client=require('../client');exports[_0x0431('0x0')]=function(_0x2bd587){return client[_0x0431('0x1')](_0x0431('0x2'),{'body':_0x2bd587,'log':_0x0431('0x2')});}; \ No newline at end of file +var _0xf6a6=['CreateVoiceDialReport','../client','create'];(function(_0x2ac0dd,_0x162292){var _0x2a0216=function(_0x38822d){while(--_0x38822d){_0x2ac0dd['push'](_0x2ac0dd['shift']());}};_0x2a0216(++_0x162292);}(_0xf6a6,0xf7));var _0x6f6a=function(_0x2d2769,_0x15ab02){_0x2d2769=_0x2d2769-0x0;var _0xcdb1ba=_0xf6a6[_0x2d2769];return _0xcdb1ba;};'use strict';var client=require(_0x6f6a('0x0'));exports[_0x6f6a('0x1')]=function(_0x1bd646){return client['Request']('CreateVoiceDialReport',{'body':_0x1bd646,'log':_0x6f6a('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 8519c23..0657ddd 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 _0x2d93=['GetVoiceExtension','exten','recordingFormat','../client','getVoiceExtensions','Request'];(function(_0x4294a0,_0x1ff392){var _0x576bdf=function(_0x37f946){while(--_0x37f946){_0x4294a0['push'](_0x4294a0['shift']());}};_0x576bdf(++_0x1ff392);}(_0x2d93,0xf3));var _0x32d9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2d93[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0x32d9('0x0'));exports[_0x32d9('0x1')]=function(){return function(){return client[_0x32d9('0x2')](_0x32d9('0x3'),{'options':{'raw':!![],'attributes':['id',_0x32d9('0x4'),_0x32d9('0x5')],'where':{'VoiceExtensionId':null}},'log':_0x32d9('0x1')});};}; \ No newline at end of file +var _0xc8ce=['Request','GetVoiceExtension','recordingFormat','getVoiceExtensions','../client'];(function(_0x5b5cde,_0x1f7c5f){var _0x364ad2=function(_0x4a1172){while(--_0x4a1172){_0x5b5cde['push'](_0x5b5cde['shift']());}};_0x364ad2(++_0x1f7c5f);}(_0xc8ce,0x176));var _0xec8c=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0xc8ce[_0x5b6cf1];return _0x46278c;};'use strict';var client=require(_0xec8c('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xec8c('0x1')](_0xec8c('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0xec8c('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xec8c('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 3b3bbb1..8ff3630 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 _0x7911=['dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropRetryFrequency'];(function(_0x515edf,_0xf09d19){var _0x43ed17=function(_0x341d1f){while(--_0x341d1f){_0x515edf['push'](_0x515edf['shift']());}};_0x43ed17(++_0xf09d19);}(_0x7911,0x77));var _0x1791=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x7911[_0x13b02f];return _0x12e9a6;};'use strict';var client=require(_0x1791('0x0'));exports[_0x1791('0x1')]=function(){return function(){return client[_0x1791('0x2')](_0x1791('0x3'),{'options':{'raw':![],'attributes':['id',_0x1791('0x4'),_0x1791('0x5'),_0x1791('0x6'),_0x1791('0x7'),_0x1791('0x8'),_0x1791('0x9'),_0x1791('0xa'),'dialMethod','dialLimitChannel',_0x1791('0xb'),_0x1791('0xc'),_0x1791('0xd'),_0x1791('0xe'),_0x1791('0xf'),_0x1791('0x10'),_0x1791('0x11'),_0x1791('0x12'),'dialQueueOptions',_0x1791('0x13'),_0x1791('0x14'),'dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry',_0x1791('0x15'),_0x1791('0x16'),_0x1791('0x17'),_0x1791('0x18'),'dialTimezone',_0x1791('0x19'),_0x1791('0x1a'),_0x1791('0x1b'),_0x1791('0x1c'),'dialAMDInitialSilence',_0x1791('0x1d'),'dialAMDAfterGreetingSilence',_0x1791('0x1e'),_0x1791('0x1f'),_0x1791('0x20'),_0x1791('0x21'),_0x1791('0x22'),_0x1791('0x23'),'timeout',_0x1791('0x24'),_0x1791('0x25'),'dialOrderByScheduledAt',_0x1791('0x26'),'dialAgiAfterHangupClient','dialQueueProject2',_0x1791('0x8'),_0x1791('0x27'),'dialRandomLastDigitCallerIdNumber',_0x1791('0x28'),_0x1791('0x29'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0x1791('0x2a'),'dialAbandonedMaxRetry',_0x1791('0x2b'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x1791('0x2c'),'dialAgentRejectRetryFrequency',_0x1791('0x2d'),'dialPredictiveIntervalMaxThreshold',_0x1791('0x2e')],'include':[{'model':_0x1791('0x2f'),'as':'Trunk','attributes':['id','name','callerid',_0x1791('0x30')]},{'model':_0x1791('0x31'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':_0x1791('0x2f'),'as':_0x1791('0x32'),'attributes':['id',_0x1791('0x4'),'callerid',_0x1791('0x30')]},{'model':_0x1791('0x33'),'as':'Interval','attributes':['id',_0x1791('0x4')],'include':[{'model':'Interval','as':_0x1791('0x34'),'attributes':['id',_0x1791('0x4'),_0x1791('0x35')]}]}]},'log':_0x1791('0x1')});};}; \ No newline at end of file +var _0x0850=['dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','Trunk','active','Pause','mandatoryDispositionPause','callerid','Interval','interval','../client','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','type','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialDropMaxRetry'];(function(_0x219bca,_0xe5a6e5){var _0x5e3451=function(_0x29a891){while(--_0x29a891){_0x219bca['push'](_0x219bca['shift']());}};_0x5e3451(++_0xe5a6e5);}(_0x0850,0x164));var _0x0085=function(_0x3b1a4e,_0x16bf03){_0x3b1a4e=_0x3b1a4e-0x0;var _0x57ee88=_0x0850[_0x3b1a4e];return _0x57ee88;};'use strict';var client=require(_0x0085('0x0'));exports[_0x0085('0x1')]=function(){return function(){return client['Request'](_0x0085('0x2'),{'options':{'raw':![],'attributes':['id',_0x0085('0x3'),_0x0085('0x4'),_0x0085('0x5'),_0x0085('0x6'),'monitor_format',_0x0085('0x7'),'dialActive','dialMethod',_0x0085('0x8'),_0x0085('0x9'),_0x0085('0xa'),_0x0085('0xb'),'dialPredictiveOptimizationPercentage',_0x0085('0xc'),_0x0085('0xd'),_0x0085('0xe'),_0x0085('0xf'),'dialQueueOptions',_0x0085('0x10'),'dialQueueProject',_0x0085('0x11'),_0x0085('0x12'),_0x0085('0x13'),'dialBusyRetryFrequency',_0x0085('0x14'),'dialNoAnswerRetryFrequency',_0x0085('0x15'),_0x0085('0x16'),_0x0085('0x17'),_0x0085('0x18'),_0x0085('0x19'),'dialAMDActive',_0x0085('0x1a'),_0x0085('0x1b'),_0x0085('0x1c'),_0x0085('0x1d'),_0x0085('0x1e'),'dialAMDBetweenWordsSilence',_0x0085('0x1f'),_0x0085('0x20'),'dialAMDMaximumWordLength',_0x0085('0x21'),_0x0085('0x22'),'dialRecallInQueue',_0x0085('0x23'),_0x0085('0x24'),_0x0085('0x25'),_0x0085('0x26'),_0x0085('0x27'),'strategy',_0x0085('0x28'),'dialCutDigit',_0x0085('0x29'),'dialNoSuchNumberRetryFrequency',_0x0085('0x2a'),_0x0085('0x2b'),'dialAbandonedMaxRetry',_0x0085('0x2c'),_0x0085('0x2d'),_0x0085('0x2e'),_0x0085('0x2f'),_0x0085('0x30'),_0x0085('0x31'),'dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold'],'include':[{'model':'Trunk','as':_0x0085('0x32'),'attributes':['id','name','callerid',_0x0085('0x33')]},{'model':_0x0085('0x34'),'as':_0x0085('0x35'),'attributes':['id','name']},{'model':_0x0085('0x32'),'as':'TrunkBackup','attributes':['id',_0x0085('0x3'),_0x0085('0x36'),_0x0085('0x33')]},{'model':'Interval','as':_0x0085('0x37'),'attributes':['id',_0x0085('0x3')],'include':[{'model':_0x0085('0x37'),'as':'Intervals','attributes':['id',_0x0085('0x3'),_0x0085('0x38')]}]}]},'log':_0x0085('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 80ae19b..aabf418 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 _0xb7c5=['queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandon'];(function(_0xc96596,_0x3143fc){var _0x49f656=function(_0x5b7b57){while(--_0x5b7b57){_0xc96596['push'](_0xc96596['shift']());}};_0x49f656(++_0x3143fc);}(_0xb7c5,0x146));var _0x5b7c=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xb7c5[_0x5ddb1c];return _0x354adc;};'use strict';var moment=require(_0x5b7c('0x0'));var _=require(_0x5b7c('0x1'));var client=require('../client');exports['create']=function(_0x509a71){return client[_0x5b7c('0x2')](_0x5b7c('0x3'),{'body':_0x509a71,'log':'CreateVoiceQueueReport'});};exports[_0x5b7c('0x4')]=function(){return function(){return client[_0x5b7c('0x2')](_0x5b7c('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')[_0x5b7c('0x6')](_0x5b7c('0x7')),moment()[_0x5b7c('0x8')]('day')[_0x5b7c('0x6')](_0x5b7c('0x7'))]}},'attributes':[_0x5b7c('0x9'),'queue',_0x5b7c('0xa'),_0x5b7c('0xb'),'queuecallercomplete',_0x5b7c('0xc'),_0x5b7c('0xd'),_0x5b7c('0xe'),_0x5b7c('0xf'),_0x5b7c('0x10')]},'log':_0x5b7c('0x11')});};}; \ No newline at end of file +var _0x4f1b=['lodash','CreateVoiceQueueReport','getVoiceQueueReports','Request','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','day','uniqueid','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerabandon','queuecallerabandonAt','moment'];(function(_0x51df2a,_0x58d8c8){var _0x59794f=function(_0xa140d6){while(--_0xa140d6){_0x51df2a['push'](_0x51df2a['shift']());}};_0x59794f(++_0x58d8c8);}(_0x4f1b,0x1e5));var _0xb4f1=function(_0x4c5d66,_0x3c3525){_0x4c5d66=_0x4c5d66-0x0;var _0x351aa2=_0x4f1b[_0x4c5d66];return _0x351aa2;};'use strict';var moment=require(_0xb4f1('0x0'));var _=require(_0xb4f1('0x1'));var client=require('../client');exports['create']=function(_0xa74e6c){return client['Request']('CreateVoiceQueueReport',{'body':_0xa74e6c,'log':_0xb4f1('0x2')});};exports[_0xb4f1('0x3')]=function(){return function(){return client[_0xb4f1('0x4')](_0xb4f1('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xb4f1('0x6')]('day')[_0xb4f1('0x7')](_0xb4f1('0x8')),moment()[_0xb4f1('0x9')](_0xb4f1('0xa'))[_0xb4f1('0x7')](_0xb4f1('0x8'))]}},'attributes':[_0xb4f1('0xb'),'queue','queuecallerjoinAt',_0xb4f1('0xc'),_0xb4f1('0xd'),_0xb4f1('0xe'),_0xb4f1('0xf'),'queuecallerexitAt',_0xb4f1('0x10'),_0xb4f1('0x11')]},'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 35ca153..9f76ddf 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 _0x3c19=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x5d6781,_0x3fe4b6){var _0x385bad=function(_0x26a9c1){while(--_0x26a9c1){_0x5d6781['push'](_0x5d6781['shift']());}};_0x385bad(++_0x3fe4b6);}(_0x3c19,0x18c));var _0x93c1=function(_0xce7d57,_0x620f8f){_0xce7d57=_0xce7d57-0x0;var _0x32032f=_0x3c19[_0xce7d57];return _0x32032f;};'use strict';var client=require(_0x93c1('0x0'));exports[_0x93c1('0x1')]=function(_0x30b70b){return function(){return client[_0x93c1('0x2')](_0x93c1('0x3'),{'options':{'where':{'VoiceQueueId':_0x30b70b,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xd4ac=['../client','Request'];(function(_0x5c3f8a,_0x5410d1){var _0x180dfb=function(_0x2033bc){while(--_0x2033bc){_0x5c3f8a['push'](_0x5c3f8a['shift']());}};_0x180dfb(++_0x5410d1);}(_0xd4ac,0x1ae));var _0xcd4a=function(_0x427fc7,_0x184128){_0x427fc7=_0x427fc7-0x0;var _0x528513=_0xd4ac[_0x427fc7];return _0x528513;};'use strict';var client=require(_0xcd4a('0x0'));exports['getVoiceQueueRtPauses']=function(_0xcf4495){return function(){return client[_0xcd4a('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0xcf4495,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index c383670..9a598a7 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 _0x0982=['Request','CreateVoiceRecording','monitorFilename','lodash','../client','create'];(function(_0x3687bd,_0x1bfcfc){var _0x2ae9d9=function(_0x12d7b4){while(--_0x12d7b4){_0x3687bd['push'](_0x3687bd['shift']());}};_0x2ae9d9(++_0x1bfcfc);}(_0x0982,0x105));var _0x2098=function(_0x26d66c,_0x3ee425){_0x26d66c=_0x26d66c-0x0;var _0xcdc33b=_0x0982[_0x26d66c];return _0xcdc33b;};'use strict';var _=require(_0x2098('0x0'));var client=require(_0x2098('0x1'));exports[_0x2098('0x2')]=function(_0x1523cf){return client[_0x2098('0x3')](_0x2098('0x4'),{'body':_['merge'](_0x1523cf,{'value':_0x1523cf[_0x2098('0x5')]}),'log':_0x2098('0x4')});}; \ No newline at end of file +var _0xce49=['lodash','create','Request','CreateVoiceRecording'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xce49,0x188));var _0x9ce4=function(_0x429248,_0x11b96c){_0x429248=_0x429248-0x0;var _0xd71b64=_0xce49[_0x429248];return _0xd71b64;};'use strict';var _=require(_0x9ce4('0x0'));var client=require('../client');exports[_0x9ce4('0x1')]=function(_0x185e0b){return client[_0x9ce4('0x2')]('CreateVoiceRecording',{'body':_['merge'](_0x185e0b,{'value':_0x185e0b['monitorFilename']}),'log':_0x9ce4('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 51e0659..99eaf82 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 _0x9d91=['transfererlinkedid','transfereechannel','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','context','extension','attendedTransfer','origtransfererchannel','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','isexternal','origtransfererexten','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten'];(function(_0x3c9b57,_0xf14409){var _0x5c4468=function(_0xbcd389){while(--_0xbcd389){_0x3c9b57['push'](_0x3c9b57['shift']());}};_0x5c4468(++_0xf14409);}(_0x9d91,0x132));var _0x19d9=function(_0x58006c,_0x186fca){_0x58006c=_0x58006c-0x0;var _0x393176=_0x9d91[_0x58006c];return _0x393176;};'use strict';var client=require('../client');exports['blindTransfer']=function(_0x197bcc){return client[_0x19d9('0x0')](_0x19d9('0x1'),{'body':{'result':_0x197bcc[_0x19d9('0x2')],'transfererchannel':_0x197bcc['transfererchannel'],'transferercalleridnum':_0x197bcc[_0x19d9('0x3')],'transferercalleridname':_0x197bcc[_0x19d9('0x4')],'transfererconnectedlinenum':_0x197bcc['transfererconnectedlinenum'],'transfererconnectedlinename':_0x197bcc[_0x19d9('0x5')],'transfereraccountcode':_0x197bcc[_0x19d9('0x6')],'transferercontext':_0x197bcc[_0x19d9('0x7')],'transfererexten':_0x197bcc[_0x19d9('0x8')],'transfererlinkedid':_0x197bcc[_0x19d9('0x9')],'transfereechannel':_0x197bcc[_0x19d9('0xa')],'transfereecalleridnum':_0x197bcc['transfereecalleridnum'],'transfereecalleridname':_0x197bcc['transfereecalleridname'],'transfereeconnectedlinenum':_0x197bcc[_0x19d9('0xb')],'transfereeconnectedlinename':_0x197bcc[_0x19d9('0xc')],'transfereeaccountcode':_0x197bcc[_0x19d9('0xd')],'transfereecontext':_0x197bcc[_0x19d9('0xe')],'transfereeexten':_0x197bcc[_0x19d9('0xf')],'transfereelinkedid':_0x197bcc['transfereelinkedid'],'isexternal':_0x197bcc['isexternal'],'context':_0x197bcc[_0x19d9('0x10')],'extension':_0x197bcc[_0x19d9('0x11')],'type':'blind'},'log':_0x19d9('0x1')});};exports[_0x19d9('0x12')]=function(_0x28d64b){return client[_0x19d9('0x0')](_0x19d9('0x1'),{'body':{'result':_0x28d64b['result'],'transfererchannel':_0x28d64b[_0x19d9('0x13')],'transferercalleridnum':_0x28d64b['origtransferercalleridnum'],'transferercalleridname':_0x28d64b['origtransferercalleridname'],'transfererconnectedlinenum':_0x28d64b['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x28d64b['secondtransfererconnectedlinename'],'transfereraccountcode':_0x28d64b[_0x19d9('0x14')],'transferercontext':_0x28d64b[_0x19d9('0x15')],'transfererexten':_0x28d64b[_0x19d9('0x16')],'transfererlinkedid':_0x28d64b[_0x19d9('0x17')],'transfereechannel':_0x28d64b[_0x19d9('0x18')],'transfereecalleridnum':_0x28d64b[_0x19d9('0x19')],'transfereecalleridname':_0x28d64b[_0x19d9('0x1a')],'transfereeconnectedlinenum':_0x28d64b[_0x19d9('0x1b')],'transfereeconnectedlinename':_0x28d64b[_0x19d9('0x1c')],'transfereeaccountcode':_0x28d64b[_0x19d9('0x1d')],'transfereecontext':_0x28d64b[_0x19d9('0x1e')],'transfereeexten':_0x28d64b[_0x19d9('0x1f')],'transfereelinkedid':_0x28d64b[_0x19d9('0x20')],'isexternal':_0x28d64b[_0x19d9('0x21')],'context':_0x28d64b['origtransferercontext'],'extension':_0x28d64b[_0x19d9('0x22')],'type':'attended'},'log':_0x19d9('0x1')});}; \ No newline at end of file +var _0x82cd=['Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','isexternal','context','extension'];(function(_0x4cb933,_0x248fd6){var _0x29f8b4=function(_0x567a42){while(--_0x567a42){_0x4cb933['push'](_0x4cb933['shift']());}};_0x29f8b4(++_0x248fd6);}(_0x82cd,0xa6));var _0xd82c=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x82cd[_0x3511d3];return _0x5d6321;};'use strict';var client=require(_0xd82c('0x0'));exports[_0xd82c('0x1')]=function(_0x312541){return client['Request'](_0xd82c('0x2'),{'body':{'result':_0x312541[_0xd82c('0x3')],'transfererchannel':_0x312541[_0xd82c('0x4')],'transferercalleridnum':_0x312541['transferercalleridnum'],'transferercalleridname':_0x312541[_0xd82c('0x5')],'transfererconnectedlinenum':_0x312541[_0xd82c('0x6')],'transfererconnectedlinename':_0x312541[_0xd82c('0x7')],'transfereraccountcode':_0x312541[_0xd82c('0x8')],'transferercontext':_0x312541['transferercontext'],'transfererexten':_0x312541['transfererexten'],'transfererlinkedid':_0x312541[_0xd82c('0x9')],'transfereechannel':_0x312541[_0xd82c('0xa')],'transfereecalleridnum':_0x312541[_0xd82c('0xb')],'transfereecalleridname':_0x312541[_0xd82c('0xc')],'transfereeconnectedlinenum':_0x312541[_0xd82c('0xd')],'transfereeconnectedlinename':_0x312541['transfereeconnectedlinename'],'transfereeaccountcode':_0x312541[_0xd82c('0xe')],'transfereecontext':_0x312541[_0xd82c('0xf')],'transfereeexten':_0x312541['transfereeexten'],'transfereelinkedid':_0x312541['transfereelinkedid'],'isexternal':_0x312541[_0xd82c('0x10')],'context':_0x312541[_0xd82c('0x11')],'extension':_0x312541[_0xd82c('0x12')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x495814){return client[_0xd82c('0x13')](_0xd82c('0x2'),{'body':{'result':_0x495814[_0xd82c('0x3')],'transfererchannel':_0x495814[_0xd82c('0x14')],'transferercalleridnum':_0x495814[_0xd82c('0x15')],'transferercalleridname':_0x495814[_0xd82c('0x16')],'transfererconnectedlinenum':_0x495814[_0xd82c('0x17')],'transfererconnectedlinename':_0x495814[_0xd82c('0x18')],'transfereraccountcode':_0x495814[_0xd82c('0x19')],'transferercontext':_0x495814[_0xd82c('0x1a')],'transfererexten':_0x495814[_0xd82c('0x1b')],'transfererlinkedid':_0x495814[_0xd82c('0x1c')],'transfereechannel':_0x495814['transfertargetchannel'],'transfereecalleridnum':_0x495814[_0xd82c('0x1d')],'transfereecalleridname':_0x495814[_0xd82c('0x1e')],'transfereeconnectedlinenum':_0x495814[_0xd82c('0x1f')],'transfereeconnectedlinename':_0x495814[_0xd82c('0x20')],'transfereeaccountcode':_0x495814['transfertargetaccountcode'],'transfereecontext':_0x495814['transfertargetcontext'],'transfereeexten':_0x495814['transfertargetexten'],'transfereelinkedid':_0x495814[_0xd82c('0x21')],'isexternal':_0x495814[_0xd82c('0x10')],'context':_0x495814[_0xd82c('0x22')],'extension':_0x495814[_0xd82c('0x23')],'type':_0xd82c('0x24')},'log':_0xd82c('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 9b33a26..5ccfb04 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 _0x63f2=['erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','voicechannel','find','uniqueid','channel','%s.%s','filename','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','toLowerCase','Channel\x20doesn\x27t\x20exist','map','channels','resolve','StopMixMonitor','destinationchannel','stop','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','telephones','trunks','outboundChannels','campaigns','emit','custom:','faxAccounts','send','checkAfterSend','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','validate','bluebird','moment','../properties','../ami','listen','format','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','error','asterisk','username','ami\x20disconnected','join','pick','module','action','Reload','Action','then','message','isConnected','command','Command','content','catch','voiceQueues','hasOwnProperty','strategy','answered','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x63f2,0x149));var _0x263f=function(_0x178a5d,_0x516101){_0x178a5d=_0x178a5d-0x0;var _0x2a6729=_0x63f2[_0x178a5d];return _0x2a6729;};'use strict';var _=require('lodash');var util=require(_0x263f('0x0'));var jayson=require('jayson/promise');var schema=require(_0x263f('0x1'));var BPromise=require(_0x263f('0x2'));var moment=require(_0x263f('0x3'));var config=require('../../../config/environment');var properties=require(_0x263f('0x4'));var ami=require(_0x263f('0x5'));exports[_0x263f('0x6')]=function(_0x93ad23,_0x25e9be,_0x1e6c41){return new BPromise(function(_0x571251,_0x3e73c9){var _0x15e840={'QueuePause':function(_0x3c4132){return new Promise(function(_0x5c000d,_0x32a3bc){var _0x16d31a=util[_0x263f('0x7')]('%s/%s',_0x263f('0x8'),_0x3c4132[_0x263f('0x9')]);if(_0x93ad23[_0x263f('0xa')]&&_0x93ad23[_0x263f('0xa')][_0x16d31a]&&_0x93ad23[_0x263f('0xa')][_0x16d31a][_0x263f('0xb')]){_0x93ad23['timers'][_0x16d31a][_0x263f('0xc')]();}if(_0x93ad23[_0x263f('0xd')][_0x16d31a]){_0x93ad23[_0x263f('0xd')][_0x16d31a][_0x263f('0xe')]({'statePause':_0x3c4132[_0x263f('0xf')]?!![]:![]});}_0x5c000d({'code':0xc8,'message':_0x263f('0x10')});});},'Reload':function(_0x339f21){var _0x549ec6=this;return new Promise(function(_0x4b0221,_0x4b931e){if(ami['isConnected']()==![]){return _0x4b931e(_0x549ec6[_0x263f('0x11')](0x1f4,[config[_0x263f('0x12')]['ip'],config[_0x263f('0x12')][_0x263f('0x13')],_0x263f('0x14')][_0x263f('0x15')]('\x20')));}_0x339f21=_[_0x263f('0x16')](_0x339f21,_['keys'](properties[_0x263f('0x17')]));_0x339f21[_0x263f('0x18')]=_0x263f('0x19');return ami[_0x263f('0x1a')](_0x339f21)[_0x263f('0x1b')](function(_0x352800){_0x4b0221({'code':0xc8,'message':_0x352800[_0x263f('0x1c')]});})['catch'](function(_0x356307){_0x4b931e(_0x549ec6['error'](0x1f5,_0x356307[_0x263f('0x1c')]));});});},'Command':function(_0x43a8f6){var _0x93739d=this;return new Promise(function(_0x466b1c,_0x3ac899){if(ami[_0x263f('0x1d')]()==![]){return _0x3ac899(_0x93739d['error'](0x1f4,[config[_0x263f('0x12')]['ip'],config[_0x263f('0x12')][_0x263f('0x13')],_0x263f('0x14')][_0x263f('0x15')]('\x20')));}_0x43a8f6=_[_0x263f('0x16')](_0x43a8f6,_0x263f('0x1e'));_0x43a8f6[_0x263f('0x18')]=_0x263f('0x1f');return ami[_0x263f('0x1a')](_0x43a8f6)[_0x263f('0x1b')](function(_0x2f1da3){_0x466b1c({'code':0xc8,'message':_0x2f1da3[_0x263f('0x20')]});})[_0x263f('0x21')](function(_0x24bd93){_0x3ac899(_0x93739d[_0x263f('0x11')](0x1f5,_0x24bd93[_0x263f('0x1c')]));});});},'VoiceQueues':function(_0x446f76){return new Promise(function(_0x359a74,_0x2778b3){var _0x35e1b4=[];for(var _0x49b274 in _0x93ad23[_0x263f('0x22')]){if(_0x93ad23[_0x263f('0x22')][_0x263f('0x23')](_0x49b274)){var _0x687364=_0x93ad23['voiceQueues'][_0x49b274];var _0x5af35e={'id':_0x687364['id'],'name':_0x687364[_0x263f('0x9')],'strategy':_0x687364[_0x263f('0x24')],'answered':_0x687364[_0x263f('0x25')],'available':_0x687364['available'],'loggedIn':_0x687364[_0x263f('0x26')],'pTalking':_0x687364[_0x263f('0x27')],'sumBillable':_0x687364[_0x263f('0x28')],'sumDuration':_0x687364['sumDuration'],'sumHoldTime':_0x687364[_0x263f('0x29')]||0x0,'talking':_0x687364[_0x263f('0x2a')],'total':_0x687364[_0x263f('0x2b')],'type':_0x687364[_0x263f('0x2c')],'unmanaged':_0x687364[_0x263f('0x2d')],'abandoned':_0x687364[_0x263f('0x2e')],'waiting':_0x687364['waiting'],'loggedInDb':_0x687364['loggedInDb']};if(_0x687364[_0x263f('0x2c')]===_0x263f('0x2f')){_0x5af35e[_0x263f('0x30')]=_0x687364[_0x263f('0x30')];_0x5af35e[_0x263f('0x31')]=_0x687364['dialMethod'];_0x5af35e[_0x263f('0x32')]=_0x687364['dialOriginateCallerIdName'];_0x5af35e['dialOriginateCallerIdNumber']=_0x687364[_0x263f('0x33')];_0x5af35e['dialOriginateTimeout']=_0x687364[_0x263f('0x34')];_0x5af35e['dialPrefix']=_0x687364['dialPrefix'];_0x5af35e['outboundAnswerAgiCallsDay']=_0x687364['outboundAnswerAgiCallsDay'];_0x5af35e[_0x263f('0x35')]=_0x687364['outboundAnswerCallsDay'];_0x5af35e['outboundBlacklistCallsDay']=_0x687364[_0x263f('0x36')];_0x5af35e[_0x263f('0x37')]=_0x687364['outboundBusyCallsDay'];_0x5af35e[_0x263f('0x38')]=_0x687364[_0x263f('0x38')];_0x5af35e['outboundDropCallsDayACS']=_0x687364['outboundDropCallsDayACS'];_0x5af35e[_0x263f('0x39')]=_0x687364[_0x263f('0x39')];_0x5af35e['outboundDropCallsDayTimeout']=_0x687364['outboundDropCallsDayTimeout'];_0x5af35e[_0x263f('0x3a')]=_0x687364['outboundNoAnswerCallsDay'];_0x5af35e[_0x263f('0x3b')]=_0x687364[_0x263f('0x3b')];_0x5af35e[_0x263f('0x3c')]=_0x687364[_0x263f('0x3c')];_0x5af35e['outboundReCallsDay']=_0x687364[_0x263f('0x3d')];_0x5af35e['outboundRejectCallsDay']=_0x687364['outboundRejectCallsDay'];_0x5af35e['outboundUnknownCallsDay']=_0x687364[_0x263f('0x3e')];_0x5af35e[_0x263f('0x3f')]=_0x687364['predictiveIntervalAnsweredCalls'];_0x5af35e[_0x263f('0x40')]=_0x687364['predictiveIntervalAvgHoldtime'];_0x5af35e[_0x263f('0x41')]=_0x687364['predictiveIntervalAvgTalktime'];_0x5af35e[_0x263f('0x42')]=_0x687364[_0x263f('0x42')];_0x5af35e[_0x263f('0x43')]=_0x687364['predictiveIntervalDroppedCallsTimeout'];_0x5af35e[_0x263f('0x44')]=_0x687364['predictiveIntervalErlangCalls'];_0x5af35e[_0x263f('0x45')]=_0x687364[_0x263f('0x45')];_0x5af35e[_0x263f('0x46')]=_0x687364[_0x263f('0x46')];_0x5af35e[_0x263f('0x47')]=_0x687364[_0x263f('0x47')];_0x5af35e[_0x263f('0x48')]=_0x687364['predictiveIntervalPauses'];_0x5af35e[_0x263f('0x49')]=_0x687364[_0x263f('0x49')];_0x5af35e[_0x263f('0x4a')]=_0x687364[_0x263f('0x4a')];_0x5af35e[_0x263f('0x1c')]=_0x687364[_0x263f('0x1c')];_0x5af35e['originated']=_0x687364[_0x263f('0x4b')];_0x5af35e[_0x263f('0x4c')]=_0x687364[_0x263f('0x4c')];_0x5af35e[_0x263f('0x4d')]=_0x687364[_0x263f('0x4d')];_0x5af35e['erlangAbandonmentRate']=_0x687364[_0x263f('0x4e')];_0x5af35e[_0x263f('0x4f')]=_0x687364[_0x263f('0x4f')];_0x5af35e[_0x263f('0x50')]=_0x687364[_0x263f('0x50')];_0x5af35e[_0x263f('0x51')]=_0x687364[_0x263f('0x51')];}if(_0x687364[_0x263f('0x52')]){_0x5af35e['Trunk']={'id':_0x687364[_0x263f('0x52')]['id'],'name':_0x687364[_0x263f('0x52')]['name'],'active':_0x687364[_0x263f('0x52')][_0x263f('0x53')],'callerid':_0x687364[_0x263f('0x52')][_0x263f('0x54')]};}if(_0x687364[_0x263f('0x55')]){_0x5af35e[_0x263f('0x55')]={'id':_0x687364['Interval']['id'],'name':_0x687364['Interval'][_0x263f('0x9')]};}_0x35e1b4[_0x263f('0x56')](_0x5af35e);}}_0x359a74({'count':_0x35e1b4[_0x263f('0x57')],'rows':_0x35e1b4});});},'VoiceChannels':function(_0x24db3c){return new Promise(function(_0xfb01d0,_0x5d936d){var _0x7e1139=_[_0x263f('0x58')](_0x93ad23['channels']);_0xfb01d0({'count':_0x7e1139[_0x263f('0x57')],'rows':_0x7e1139});});},'VoiceChannelMixMonitor':function(_0x266475){var _0x2c2772=this;return new Promise(function(_0x46f2ae,_0x15e7b1){if(ami[_0x263f('0x1d')]()==![]){return _0x15e7b1(_0x2c2772[_0x263f('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x263f('0x12')][_0x263f('0x13')],'ami\x20disconnected'][_0x263f('0x15')]('\x20')));}var _0x5b3117=schema(properties[_0x263f('0x59')])['validate'](_0x266475);if(_0x5b3117['length']>0x0){return _0x15e7b1(_0x2c2772['error'](0x1f4,_['map'](_0x5b3117,_0x263f('0x1c'))['join'](',\x20')));}var _0x283612=_[_0x263f('0x5a')](_0x93ad23['channels'],{'uniqueid':_0x266475[_0x263f('0x5b')]});if(_0x283612&&_0x283612[_0x263f('0x5c')]){var _0x4bf0f5=util['format'](_0x263f('0x5d'),_0x266475[_0x263f('0x5e')]||_0x266475[_0x263f('0x5b')],_0x266475[_0x263f('0x7')]||'wav');return ami[_0x263f('0x1a')]({'action':_0x263f('0x5f'),'channel':_0x283612[_0x263f('0x5c')],'file':_0x4bf0f5,'options':_0x263f('0x60')})[_0x263f('0x1b')](function(_0x39d2d5){var _0x1c56df=_[_0x263f('0x5a')](_0x283612[_0x263f('0x61')],{'filename':_0x263f('0x62')+_0x4bf0f5['toLowerCase']()});if(_[_0x263f('0x63')](_0x1c56df)){_0x283612[_0x263f('0x61')][_0x263f('0x56')]({'filename':_0x263f('0x62')+_0x4bf0f5['toLowerCase'](),'createdAt':moment()['format'](_0x263f('0x64')),'mixmonitorid':_0x39d2d5[_0x263f('0x65')],'status':_0x263f('0x66')});}else{_0x1c56df[_0x263f('0x65')]=_0x39d2d5[_0x263f('0x65')];_0x1c56df[_0x263f('0x67')]='rec';}_0x46f2ae({'code':0xc8,'message':[_0x266475[_0x263f('0x5b')],_0x263f('0x68'),_0x39d2d5[_0x263f('0x65')]][_0x263f('0x15')]('\x20'),'mixmonitorid':_0x39d2d5[_0x263f('0x65')]});})[_0x263f('0x21')](function(_0x3ea697){_0x15e7b1(_0x2c2772[_0x263f('0x11')](0x1f5,[_0x266475['uniqueid'],_0x3ea697[_0x263f('0x1c')][_0x263f('0x69')]()][_0x263f('0x15')]('\x20')));});}else{return _0x15e7b1(_0x2c2772['error'](0x1f5,_0x263f('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0xb9a70f){var _0x438d7f=this;return new Promise(function(_0x18a9e8,_0x1f7799){if(ami['isConnected']()==![]){return _0x1f7799(_0x438d7f[_0x263f('0x11')](0x1f4,[config[_0x263f('0x12')]['ip'],config[_0x263f('0x12')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0xef7612=schema(properties[_0x263f('0x59')])[_0x263f('0x1')](_0xb9a70f);if(_0xef7612['length']>0x0){return _0x1f7799(_0x438d7f['error'](0x1f4,_[_0x263f('0x6b')](_0xef7612,_0x263f('0x1c'))[_0x263f('0x15')](',\x20')));}var _0x4f325d=_[_0x263f('0x5a')](_0x93ad23[_0x263f('0x6c')],{'uniqueid':_0xb9a70f[_0x263f('0x5b')]});if(_0x4f325d){return BPromise[_0x263f('0x6d')]()[_0x263f('0x1b')](function(){if(_0x4f325d[_0x263f('0x5c')]){return ami['Action']({'action':_0x263f('0x6e'),'channel':_0x4f325d[_0x263f('0x5c')],'mixmonitorid':_0xb9a70f[_0x263f('0x65')]})[_0x263f('0x21')](function(_0x567eb1){});}})[_0x263f('0x1b')](function(){if(_0x4f325d['destinationchannel']){return ami[_0x263f('0x1a')]({'action':_0x263f('0x6e'),'channel':_0x4f325d[_0x263f('0x6f')],'mixmonitorid':_0xb9a70f[_0x263f('0x65')]})[_0x263f('0x21')](function(_0x388aff){});}})[_0x263f('0x1b')](function(_0x214496){var _0xa04a34=_['find'](_0x4f325d[_0x263f('0x61')],{'mixmonitorid':_0xb9a70f[_0x263f('0x65')]});if(_0xa04a34){_0xa04a34[_0x263f('0x67')]=_0x263f('0x70');}})['then'](function(){var _0x5c9ca0=util[_0x263f('0x7')]('%s.%s',_0xb9a70f['filename']||_0xb9a70f['uniqueid'],_0xb9a70f['format']||_0x263f('0x71'));var _0x183dd7=_[_0x263f('0x5a')](_0x4f325d[_0x263f('0x61')],{'filename':_0x263f('0x62')+_0x5c9ca0[_0x263f('0x69')]()});if(_0x183dd7){_0x183dd7[_0x263f('0x67')]=_0x263f('0x70');}})['then'](function(){_0x18a9e8({'code':0xc8,'message':[_0xb9a70f['uniqueid'],_0x263f('0x72')][_0x263f('0x15')]('\x20')});})['catch'](function(_0x23eec6){_0x1f7799(_0x438d7f[_0x263f('0x11')](0x1f5,[_0xb9a70f[_0x263f('0x5b')],_0x23eec6[_0x263f('0x1c')]['toLowerCase']()][_0x263f('0x15')]('\x20')));});}else{return _0x1f7799(_0x438d7f[_0x263f('0x11')](0x1f5,_0x263f('0x6a')));}});},'VoiceQueuesChannels':function(_0x6aff57){return new Promise(function(_0x6fc57,_0x1c902e){var _0x441f47=_['values'](_0x93ad23[_0x263f('0x73')]);_0x6fc57({'count':_0x441f47[_0x263f('0x57')],'rows':_0x441f47});});},'VoiceQueuesChannel':function(_0x7d73c2){var _0x1528c9=this;return new Promise(function(_0x5a5f4f,_0x41d808){var _0x29a4b5=schema(properties[_0x263f('0x74')])[_0x263f('0x1')](_0x7d73c2);if(_0x29a4b5['length']>0x0){return _0x41d808(_0x1528c9['error'](0x1f4,_['map'](_0x29a4b5,_0x263f('0x1c'))[_0x263f('0x15')](',\x20')));}var _0x50d6f2=_[_0x263f('0x5a')](_0x93ad23[_0x263f('0x73')],{'uniqueid':_0x7d73c2[_0x263f('0x5b')]});if(_0x50d6f2){_0x5a5f4f(_0x50d6f2);}else{return _0x41d808(_0x1528c9['error'](0x1f5,_0x263f('0x6a')));}});},'VoiceQueuesChannelHangup':function(_0x509a14){var _0x322a57=this;return new Promise(function(_0x2ddd4f,_0xd63e84){if(ami[_0x263f('0x1d')]()==![]){return _0xd63e84(_0x322a57[_0x263f('0x11')](0x1f4,[config[_0x263f('0x12')]['ip'],config['asterisk'][_0x263f('0x13')],_0x263f('0x14')]['join']('\x20')));}var _0x2cffda=schema(properties[_0x263f('0x75')])[_0x263f('0x1')](_0x509a14);if(_0x2cffda[_0x263f('0x57')]>0x0){return _0xd63e84(_0x322a57[_0x263f('0x11')](0x1f4,_['map'](_0x2cffda,_0x263f('0x1c'))[_0x263f('0x15')](',\x20')));}var _0x4cc1ff=_[_0x263f('0x5a')](_0x93ad23['queueChannels'],{'uniqueid':_0x509a14['uniqueid']});if(_0x4cc1ff&&_0x4cc1ff['channel']){return ami[_0x263f('0x1a')]({'action':'Hangup','channel':_0x4cc1ff[_0x263f('0x5c')]})[_0x263f('0x1b')](function(_0x424c84){_0x2ddd4f({'code':0xc8,'message':[_0x509a14[_0x263f('0x5b')],_0x424c84[_0x263f('0x1c')][_0x263f('0x69')]()][_0x263f('0x15')]('\x20')});})[_0x263f('0x21')](function(_0x10a4e8){_0xd63e84(_0x322a57[_0x263f('0x11')](0x1f5,[_0x509a14[_0x263f('0x5b')],_0x10a4e8['message'][_0x263f('0x69')]()][_0x263f('0x15')]('\x20')));});}else{return _0xd63e84(_0x322a57[_0x263f('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x585046){var _0x12d7c8=this;return new Promise(function(_0x51f3ad,_0xd8e29){if(ami['isConnected']()==![]){return _0xd8e29(_0x12d7c8[_0x263f('0x11')](0x1f4,[config[_0x263f('0x12')]['ip'],config[_0x263f('0x12')][_0x263f('0x13')],_0x263f('0x14')][_0x263f('0x15')]('\x20')));}var _0x2afed4=schema(properties[_0x263f('0x76')])[_0x263f('0x1')](_0x585046);if(_0x2afed4[_0x263f('0x57')]>0x0){return _0xd8e29(_0x12d7c8[_0x263f('0x11')](0x1f4,_['map'](_0x2afed4,'message')['join'](',\x20')));}var _0x104d24=_[_0x263f('0x5a')](_0x93ad23['queueChannels'],{'uniqueid':_0x585046[_0x263f('0x5b')]});if(_0x104d24&&_0x104d24[_0x263f('0x5c')]){return ami[_0x263f('0x1a')]({'action':_0x263f('0x77'),'channel':_0x104d24[_0x263f('0x5c')],'exten':_0x585046[_0x263f('0x78')],'context':_0x585046['context']||_0x104d24['context'],'priority':0x1})[_0x263f('0x1b')](function(_0x583d60){_0x51f3ad({'code':0xc8,'message':[_0x585046['uniqueid'],_0x583d60[_0x263f('0x1c')][_0x263f('0x69')]()][_0x263f('0x15')]('\x20')});})[_0x263f('0x21')](function(_0x5c86ea){_0xd8e29(_0x12d7c8[_0x263f('0x11')](0x1f5,[_0x585046['uniqueid'],_0x5c86ea[_0x263f('0x1c')][_0x263f('0x69')]()][_0x263f('0x15')]('\x20')));});}else{return _0xd8e29(_0x12d7c8['error'](0x1f5,_0x263f('0x6a')));}});},'Agents':function(_0xa4f345){return new Promise(function(_0x5c0fe6,_0x60ef6c){var _0x8fd090=_[_0x263f('0x58')](_0x93ad23['agents']);_0x5c0fe6({'count':_0x8fd090[_0x263f('0x57')],'rows':_0x8fd090});});},'Telephones':function(_0x421885){return new Promise(function(_0x12f498,_0x4888d9){var _0x92f934=_['values'](_0x93ad23[_0x263f('0x79')]);_0x12f498({'count':_0x92f934[_0x263f('0x57')],'rows':_0x92f934});});},'Trunks':function(_0x1f7974){return new Promise(function(_0x32785d,_0xe550e5){var _0x2b24b6=_[_0x263f('0x58')](_0x93ad23[_0x263f('0x7a')]);_0x32785d({'count':_0x2b24b6['length'],'rows':_0x2b24b6});});},'OutboundChannels':function(_0xca66f6){return new Promise(function(_0x5512ab,_0x3b6e1d){var _0x126495=_[_0x263f('0x58')](_0x93ad23[_0x263f('0x7b')]);_0x5512ab({'count':_0x126495[_0x263f('0x57')],'rows':_0x126495});});},'Outbound':function(_0x2e34c2){return new Promise(function(_0x55d33a,_0x414501){_0x55d33a(_0x93ad23[_0x263f('0x2f')]);});},'Campaigns':function(_0xed2dba){return new Promise(function(_0x15477f,_0xddfd3){var _0x11ce76=_[_0x263f('0x58')](_0x93ad23[_0x263f('0x7c')]);_0x15477f({'count':_0x11ce76[_0x263f('0x57')],'rows':_0x11ce76});});},'VoiceQueuesPreview':function(_0xb6992b){var _0x264856=this;return new Promise(function(_0x25e3b2,_0x48c3c3){_0x25e9be['run'](_0xb6992b['id'])[_0x263f('0x1b')](function(_0x295505){_0x25e3b2({'code':0xc8,'message':_0x295505[_0x263f('0x1c')]});})[_0x263f('0x21')](function(_0x3a900f){_0x48c3c3(_0x264856[_0x263f('0x11')](0x1f4,_0x3a900f[_0x263f('0x1c')]));});});},'EventManager':function(_0x4f8c70){var _0x2023fc=this;return new Promise(function(_0x4cc75e,_0xe912d0){if(!_0x4f8c70['event']){return _0xe912d0(_0x2023fc['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x263f('0x7d')](_0x263f('0x7e')+_0x4f8c70['event'],_0x4f8c70[_0x263f('0x1c')]);_0x4cc75e({'code':0xc8,'message':_0x4f8c70});});},'FaxAccounts':function(_0x1ab22a){return new Promise(function(_0x143f74,_0x2be75a){var _0x468345=_[_0x263f('0x58')](_0x93ad23[_0x263f('0x7f')]);_0x143f74({'count':_0x468345['length'],'rows':_0x468345});});},'SendFax':function(_0x3b98d7){var _0x5df016=this;return new Promise(function(_0x3a9259,_0x50c17d){_0x1e6c41[_0x263f('0x80')](_0x3b98d7)['then'](function(_0x317054){_0x3a9259({'code':0xc8,'message':_0x317054['message']});})[_0x263f('0x21')](function(_0xfca142){_0x50c17d(_0x5df016[_0x263f('0x11')](0x1f4,_0xfca142[_0x263f('0x1c')]));});});},'CheckAfterSend':function(_0x1b7bc8){var _0x1e879b=this;return new Promise(function(_0x445991,_0x626699){_0x1e6c41[_0x263f('0x81')](_0x1b7bc8)[_0x263f('0x1b')](function(_0x3a8999){_0x445991({'code':0xc8,'message':_0x3a8999[_0x263f('0x1c')]});})[_0x263f('0x21')](function(_0xd8847){_0x626699(_0x1e879b['error'](0x1f4,_0xd8847[_0x263f('0x1c')]));});});}};var _0x3cf78a=jayson[_0x263f('0x82')](_0x15e840)[_0x263f('0x83')]();_0x3cf78a['on'](_0x263f('0x11'),function(_0x468d8a){return _0x3e73c9(_0x468d8a);});_0x3cf78a[_0x263f('0x6')](0x232a,'127.0.0.1',function(){console[_0x263f('0x84')](_0x263f('0x85'),0x232a);return _0x571251(_0x263f('0x86')+0x232a);});});}; \ No newline at end of file +var _0x22e3=['SIP','name','timers','agents','updateStatusRealtime','QueuePause','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','error','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','abandoned','loggedInDb','outbound','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','length','values','channels','isConnected','voicechannel','validate','find','uniqueid','channel','%s.%s','filename','MixMonitor','toLowerCase','isNil','monitors','push','/var/spool/asterisk/monitor/','mixmonitorid','rec','status','map','resolve','StopMixMonitor','destinationchannel','stop','wav','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','exten','context','Channel\x20doesn\x27t\x20exist','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','bluebird','moment','../../../config/environment','../properties','../ami','format'];(function(_0x593b33,_0x1ea034){var _0x2f17a2=function(_0x2dbb16){while(--_0x2dbb16){_0x593b33['push'](_0x593b33['shift']());}};_0x2f17a2(++_0x1ea034);}(_0x22e3,0x7e));var _0x322e=function(_0x53b1cb,_0x35f79e){_0x53b1cb=_0x53b1cb-0x0;var _0x42b7e5=_0x22e3[_0x53b1cb];return _0x42b7e5;};'use strict';var _=require('lodash');var util=require(_0x322e('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0x322e('0x1'));var moment=require(_0x322e('0x2'));var config=require(_0x322e('0x3'));var properties=require(_0x322e('0x4'));var ami=require(_0x322e('0x5'));exports['listen']=function(_0x4e068d,_0x353f7a,_0x509b1d){return new BPromise(function(_0x15e048,_0x52ed30){var _0x321893={'QueuePause':function(_0x30f1cd){return new Promise(function(_0xbadee5,_0x1a5ddc){var _0x583028=util[_0x322e('0x6')]('%s/%s',_0x322e('0x7'),_0x30f1cd[_0x322e('0x8')]);if(_0x4e068d['timers']&&_0x4e068d[_0x322e('0x9')][_0x583028]&&_0x4e068d[_0x322e('0x9')][_0x583028]['timer']){_0x4e068d[_0x322e('0x9')][_0x583028]['updateAcw']();}if(_0x4e068d[_0x322e('0xa')][_0x583028]){_0x4e068d[_0x322e('0xa')][_0x583028][_0x322e('0xb')]({'statePause':_0x30f1cd['pause']?!![]:![]});}_0xbadee5({'code':0xc8,'message':_0x322e('0xc')});});},'Reload':function(_0xea8df8){var _0x175979=this;return new Promise(function(_0x374840,_0x166eba){if(ami['isConnected']()==![]){return _0x166eba(_0x175979['error'](0x1f4,[config[_0x322e('0xd')]['ip'],config[_0x322e('0xd')][_0x322e('0xe')],_0x322e('0xf')][_0x322e('0x10')]('\x20')));}_0xea8df8=_[_0x322e('0x11')](_0xea8df8,_[_0x322e('0x12')](properties[_0x322e('0x13')]));_0xea8df8[_0x322e('0x14')]=_0x322e('0x15');return ami[_0x322e('0x16')](_0xea8df8)[_0x322e('0x17')](function(_0x2e6424){_0x374840({'code':0xc8,'message':_0x2e6424[_0x322e('0x18')]});})[_0x322e('0x19')](function(_0x2ff12d){_0x166eba(_0x175979[_0x322e('0x1a')](0x1f5,_0x2ff12d['message']));});});},'Command':function(_0x5d62ee){var _0x564b98=this;return new Promise(function(_0x522111,_0x4f4b4d){if(ami['isConnected']()==![]){return _0x4f4b4d(_0x564b98[_0x322e('0x1a')](0x1f4,[config['asterisk']['ip'],config[_0x322e('0xd')][_0x322e('0xe')],_0x322e('0xf')][_0x322e('0x10')]('\x20')));}_0x5d62ee=_[_0x322e('0x11')](_0x5d62ee,_0x322e('0x1b'));_0x5d62ee[_0x322e('0x14')]=_0x322e('0x1c');return ami[_0x322e('0x16')](_0x5d62ee)[_0x322e('0x17')](function(_0x5fc8a){_0x522111({'code':0xc8,'message':_0x5fc8a[_0x322e('0x1d')]});})[_0x322e('0x19')](function(_0x161448){_0x4f4b4d(_0x564b98['error'](0x1f5,_0x161448[_0x322e('0x18')]));});});},'VoiceQueues':function(_0x5ed6ed){return new Promise(function(_0x152f4b,_0x10a1ba){var _0x56e8fb=[];for(var _0x1f27f7 in _0x4e068d[_0x322e('0x1e')]){if(_0x4e068d[_0x322e('0x1e')][_0x322e('0x1f')](_0x1f27f7)){var _0x4ffc11=_0x4e068d[_0x322e('0x1e')][_0x1f27f7];var _0x3bd917={'id':_0x4ffc11['id'],'name':_0x4ffc11[_0x322e('0x8')],'strategy':_0x4ffc11[_0x322e('0x20')],'answered':_0x4ffc11[_0x322e('0x21')],'available':_0x4ffc11[_0x322e('0x22')],'loggedIn':_0x4ffc11[_0x322e('0x23')],'pTalking':_0x4ffc11[_0x322e('0x24')],'sumBillable':_0x4ffc11[_0x322e('0x25')],'sumDuration':_0x4ffc11[_0x322e('0x26')],'sumHoldTime':_0x4ffc11[_0x322e('0x27')]||0x0,'talking':_0x4ffc11['talking'],'total':_0x4ffc11[_0x322e('0x28')],'type':_0x4ffc11[_0x322e('0x29')],'unmanaged':_0x4ffc11['unmanaged'],'abandoned':_0x4ffc11[_0x322e('0x2a')],'waiting':_0x4ffc11['waiting'],'loggedInDb':_0x4ffc11[_0x322e('0x2b')]};if(_0x4ffc11['type']===_0x322e('0x2c')){_0x3bd917['dialActive']=_0x4ffc11['dialActive'];_0x3bd917[_0x322e('0x2d')]=_0x4ffc11[_0x322e('0x2d')];_0x3bd917[_0x322e('0x2e')]=_0x4ffc11[_0x322e('0x2e')];_0x3bd917[_0x322e('0x2f')]=_0x4ffc11['dialOriginateCallerIdNumber'];_0x3bd917[_0x322e('0x30')]=_0x4ffc11['dialOriginateTimeout'];_0x3bd917[_0x322e('0x31')]=_0x4ffc11['dialPrefix'];_0x3bd917[_0x322e('0x32')]=_0x4ffc11[_0x322e('0x32')];_0x3bd917['outboundAnswerCallsDay']=_0x4ffc11['outboundAnswerCallsDay'];_0x3bd917['outboundBlacklistCallsDay']=_0x4ffc11[_0x322e('0x33')];_0x3bd917['outboundBusyCallsDay']=_0x4ffc11[_0x322e('0x34')];_0x3bd917[_0x322e('0x35')]=_0x4ffc11[_0x322e('0x35')];_0x3bd917[_0x322e('0x36')]=_0x4ffc11[_0x322e('0x36')];_0x3bd917[_0x322e('0x37')]=_0x4ffc11['outboundDropCallsDayCallersExit'];_0x3bd917[_0x322e('0x38')]=_0x4ffc11['outboundDropCallsDayTimeout'];_0x3bd917[_0x322e('0x39')]=_0x4ffc11[_0x322e('0x39')];_0x3bd917[_0x322e('0x3a')]=_0x4ffc11[_0x322e('0x3a')];_0x3bd917[_0x322e('0x3b')]=_0x4ffc11['outboundOriginateFailureCallsDay'];_0x3bd917['outboundReCallsDay']=_0x4ffc11[_0x322e('0x3c')];_0x3bd917[_0x322e('0x3d')]=_0x4ffc11[_0x322e('0x3d')];_0x3bd917['outboundUnknownCallsDay']=_0x4ffc11['outboundUnknownCallsDay'];_0x3bd917[_0x322e('0x3e')]=_0x4ffc11['predictiveIntervalAnsweredCalls'];_0x3bd917[_0x322e('0x3f')]=_0x4ffc11['predictiveIntervalAvgHoldtime'];_0x3bd917[_0x322e('0x40')]=_0x4ffc11[_0x322e('0x40')];_0x3bd917['predictiveIntervalDroppedCallsCallersExit']=_0x4ffc11['predictiveIntervalDroppedCallsCallersExit'];_0x3bd917['predictiveIntervalDroppedCallsTimeout']=_0x4ffc11[_0x322e('0x41')];_0x3bd917[_0x322e('0x42')]=_0x4ffc11[_0x322e('0x42')];_0x3bd917[_0x322e('0x43')]=_0x4ffc11[_0x322e('0x43')];_0x3bd917[_0x322e('0x44')]=_0x4ffc11[_0x322e('0x44')];_0x3bd917[_0x322e('0x45')]=_0x4ffc11[_0x322e('0x45')];_0x3bd917['predictiveIntervalPauses']=_0x4ffc11[_0x322e('0x46')];_0x3bd917[_0x322e('0x47')]=_0x4ffc11[_0x322e('0x47')];_0x3bd917[_0x322e('0x48')]=_0x4ffc11[_0x322e('0x48')];_0x3bd917[_0x322e('0x18')]=_0x4ffc11['message'];_0x3bd917['originated']=_0x4ffc11[_0x322e('0x49')];_0x3bd917[_0x322e('0x4a')]=_0x4ffc11[_0x322e('0x4a')];_0x3bd917[_0x322e('0x4b')]=_0x4ffc11[_0x322e('0x4b')];_0x3bd917[_0x322e('0x4c')]=_0x4ffc11[_0x322e('0x4c')];_0x3bd917[_0x322e('0x4d')]=_0x4ffc11[_0x322e('0x4d')];_0x3bd917[_0x322e('0x4e')]=_0x4ffc11[_0x322e('0x4e')];_0x3bd917['startProgressive']=_0x4ffc11['startProgressive'];}if(_0x4ffc11[_0x322e('0x4f')]){_0x3bd917[_0x322e('0x4f')]={'id':_0x4ffc11[_0x322e('0x4f')]['id'],'name':_0x4ffc11[_0x322e('0x4f')][_0x322e('0x8')],'active':_0x4ffc11[_0x322e('0x4f')][_0x322e('0x50')],'callerid':_0x4ffc11[_0x322e('0x4f')][_0x322e('0x51')]};}if(_0x4ffc11[_0x322e('0x52')]){_0x3bd917[_0x322e('0x52')]={'id':_0x4ffc11[_0x322e('0x52')]['id'],'name':_0x4ffc11[_0x322e('0x52')][_0x322e('0x8')]};}_0x56e8fb['push'](_0x3bd917);}}_0x152f4b({'count':_0x56e8fb[_0x322e('0x53')],'rows':_0x56e8fb});});},'VoiceChannels':function(_0x34f43b){return new Promise(function(_0x5006df,_0x147482){var _0x1982d2=_[_0x322e('0x54')](_0x4e068d[_0x322e('0x55')]);_0x5006df({'count':_0x1982d2[_0x322e('0x53')],'rows':_0x1982d2});});},'VoiceChannelMixMonitor':function(_0x259cf9){var _0x3866b2=this;return new Promise(function(_0x2cc67d,_0x3b2656){if(ami[_0x322e('0x56')]()==![]){return _0x3b2656(_0x3866b2[_0x322e('0x1a')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x322e('0x10')]('\x20')));}var _0xc636fd=schema(properties[_0x322e('0x57')])[_0x322e('0x58')](_0x259cf9);if(_0xc636fd[_0x322e('0x53')]>0x0){return _0x3b2656(_0x3866b2['error'](0x1f4,_['map'](_0xc636fd,_0x322e('0x18'))[_0x322e('0x10')](',\x20')));}var _0x6112e0=_[_0x322e('0x59')](_0x4e068d['channels'],{'uniqueid':_0x259cf9[_0x322e('0x5a')]});if(_0x6112e0&&_0x6112e0[_0x322e('0x5b')]){var _0x219b70=util[_0x322e('0x6')](_0x322e('0x5c'),_0x259cf9[_0x322e('0x5d')]||_0x259cf9[_0x322e('0x5a')],_0x259cf9['format']||'wav');return ami[_0x322e('0x16')]({'action':_0x322e('0x5e'),'channel':_0x6112e0[_0x322e('0x5b')],'file':_0x219b70,'options':'ai(mixmonitorid)'})[_0x322e('0x17')](function(_0x5a6a00){var _0x4ad285=_[_0x322e('0x59')](_0x6112e0['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x219b70[_0x322e('0x5f')]()});if(_[_0x322e('0x60')](_0x4ad285)){_0x6112e0[_0x322e('0x61')][_0x322e('0x62')]({'filename':_0x322e('0x63')+_0x219b70[_0x322e('0x5f')](),'createdAt':moment()[_0x322e('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5a6a00[_0x322e('0x64')],'status':_0x322e('0x65')});}else{_0x4ad285[_0x322e('0x64')]=_0x5a6a00[_0x322e('0x64')];_0x4ad285[_0x322e('0x66')]=_0x322e('0x65');}_0x2cc67d({'code':0xc8,'message':[_0x259cf9[_0x322e('0x5a')],'MixMonitor\x20Success',_0x5a6a00[_0x322e('0x64')]][_0x322e('0x10')]('\x20'),'mixmonitorid':_0x5a6a00[_0x322e('0x64')]});})[_0x322e('0x19')](function(_0x19c68e){_0x3b2656(_0x3866b2[_0x322e('0x1a')](0x1f5,[_0x259cf9['uniqueid'],_0x19c68e[_0x322e('0x18')][_0x322e('0x5f')]()][_0x322e('0x10')]('\x20')));});}else{return _0x3b2656(_0x3866b2[_0x322e('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x3ef335){var _0x50f53a=this;return new Promise(function(_0xc3679e,_0x4f2a12){if(ami['isConnected']()==![]){return _0x4f2a12(_0x50f53a[_0x322e('0x1a')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x322e('0xe')],'ami\x20disconnected'][_0x322e('0x10')]('\x20')));}var _0x4e8653=schema(properties[_0x322e('0x57')])['validate'](_0x3ef335);if(_0x4e8653[_0x322e('0x53')]>0x0){return _0x4f2a12(_0x50f53a[_0x322e('0x1a')](0x1f4,_[_0x322e('0x67')](_0x4e8653,_0x322e('0x18'))['join'](',\x20')));}var _0x488014=_['find'](_0x4e068d[_0x322e('0x55')],{'uniqueid':_0x3ef335[_0x322e('0x5a')]});if(_0x488014){return BPromise[_0x322e('0x68')]()[_0x322e('0x17')](function(){if(_0x488014[_0x322e('0x5b')]){return ami[_0x322e('0x16')]({'action':_0x322e('0x69'),'channel':_0x488014[_0x322e('0x5b')],'mixmonitorid':_0x3ef335[_0x322e('0x64')]})[_0x322e('0x19')](function(_0x44a6da){});}})[_0x322e('0x17')](function(){if(_0x488014[_0x322e('0x6a')]){return ami[_0x322e('0x16')]({'action':_0x322e('0x69'),'channel':_0x488014[_0x322e('0x6a')],'mixmonitorid':_0x3ef335[_0x322e('0x64')]})[_0x322e('0x19')](function(_0x4420dd){});}})[_0x322e('0x17')](function(_0x42e615){var _0x2f9891=_[_0x322e('0x59')](_0x488014[_0x322e('0x61')],{'mixmonitorid':_0x3ef335['mixmonitorid']});if(_0x2f9891){_0x2f9891[_0x322e('0x66')]=_0x322e('0x6b');}})[_0x322e('0x17')](function(){var _0xdcf41e=util[_0x322e('0x6')](_0x322e('0x5c'),_0x3ef335[_0x322e('0x5d')]||_0x3ef335[_0x322e('0x5a')],_0x3ef335[_0x322e('0x6')]||_0x322e('0x6c'));var _0x51a481=_['find'](_0x488014[_0x322e('0x61')],{'filename':_0x322e('0x63')+_0xdcf41e[_0x322e('0x5f')]()});if(_0x51a481){_0x51a481[_0x322e('0x66')]=_0x322e('0x6b');}})[_0x322e('0x17')](function(){_0xc3679e({'code':0xc8,'message':[_0x3ef335[_0x322e('0x5a')],_0x322e('0x6d')][_0x322e('0x10')]('\x20')});})[_0x322e('0x19')](function(_0xb8e63b){_0x4f2a12(_0x50f53a[_0x322e('0x1a')](0x1f5,[_0x3ef335[_0x322e('0x5a')],_0xb8e63b[_0x322e('0x18')][_0x322e('0x5f')]()]['join']('\x20')));});}else{return _0x4f2a12(_0x50f53a[_0x322e('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x41b2a5){return new Promise(function(_0x6fd18e,_0x1d67e){var _0x568592=_[_0x322e('0x54')](_0x4e068d[_0x322e('0x6e')]);_0x6fd18e({'count':_0x568592[_0x322e('0x53')],'rows':_0x568592});});},'VoiceQueuesChannel':function(_0x4efdd0){var _0x48a454=this;return new Promise(function(_0x433be3,_0x33c01c){var _0x5f2c82=schema(properties['voicequeuechannel'])['validate'](_0x4efdd0);if(_0x5f2c82['length']>0x0){return _0x33c01c(_0x48a454['error'](0x1f4,_[_0x322e('0x67')](_0x5f2c82,_0x322e('0x18'))[_0x322e('0x10')](',\x20')));}var _0x330a10=_['find'](_0x4e068d[_0x322e('0x6e')],{'uniqueid':_0x4efdd0[_0x322e('0x5a')]});if(_0x330a10){_0x433be3(_0x330a10);}else{return _0x33c01c(_0x48a454[_0x322e('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x3017cf){var _0x32d86a=this;return new Promise(function(_0x4c6f73,_0x3c6661){if(ami[_0x322e('0x56')]()==![]){return _0x3c6661(_0x32d86a['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x322e('0xf')]['join']('\x20')));}var _0x585070=schema(properties[_0x322e('0x6f')])[_0x322e('0x58')](_0x3017cf);if(_0x585070['length']>0x0){return _0x3c6661(_0x32d86a[_0x322e('0x1a')](0x1f4,_['map'](_0x585070,_0x322e('0x18'))[_0x322e('0x10')](',\x20')));}var _0x2901d7=_['find'](_0x4e068d[_0x322e('0x6e')],{'uniqueid':_0x3017cf[_0x322e('0x5a')]});if(_0x2901d7&&_0x2901d7['channel']){return ami[_0x322e('0x16')]({'action':'Hangup','channel':_0x2901d7[_0x322e('0x5b')]})[_0x322e('0x17')](function(_0x4df082){_0x4c6f73({'code':0xc8,'message':[_0x3017cf[_0x322e('0x5a')],_0x4df082[_0x322e('0x18')][_0x322e('0x5f')]()][_0x322e('0x10')]('\x20')});})[_0x322e('0x19')](function(_0x23ee1e){_0x3c6661(_0x32d86a[_0x322e('0x1a')](0x1f5,[_0x3017cf[_0x322e('0x5a')],_0x23ee1e['message'][_0x322e('0x5f')]()][_0x322e('0x10')]('\x20')));});}else{return _0x3c6661(_0x32d86a['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x18d577){var _0x1e1af9=this;return new Promise(function(_0xce0e13,_0xaaa026){if(ami[_0x322e('0x56')]()==![]){return _0xaaa026(_0x1e1af9['error'](0x1f4,[config[_0x322e('0xd')]['ip'],config[_0x322e('0xd')][_0x322e('0xe')],'ami\x20disconnected']['join']('\x20')));}var _0x51ddf7=schema(properties['voicequeuechannelredirect'])[_0x322e('0x58')](_0x18d577);if(_0x51ddf7[_0x322e('0x53')]>0x0){return _0xaaa026(_0x1e1af9[_0x322e('0x1a')](0x1f4,_[_0x322e('0x67')](_0x51ddf7,_0x322e('0x18'))['join'](',\x20')));}var _0x3cd5a9=_[_0x322e('0x59')](_0x4e068d[_0x322e('0x6e')],{'uniqueid':_0x18d577[_0x322e('0x5a')]});if(_0x3cd5a9&&_0x3cd5a9['channel']){return ami[_0x322e('0x16')]({'action':'Redirect','channel':_0x3cd5a9[_0x322e('0x5b')],'exten':_0x18d577[_0x322e('0x70')],'context':_0x18d577[_0x322e('0x71')]||_0x3cd5a9['context'],'priority':0x1})[_0x322e('0x17')](function(_0xd1fe15){_0xce0e13({'code':0xc8,'message':[_0x18d577['uniqueid'],_0xd1fe15[_0x322e('0x18')]['toLowerCase']()][_0x322e('0x10')]('\x20')});})[_0x322e('0x19')](function(_0x10c01b){_0xaaa026(_0x1e1af9['error'](0x1f5,[_0x18d577[_0x322e('0x5a')],_0x10c01b[_0x322e('0x18')][_0x322e('0x5f')]()][_0x322e('0x10')]('\x20')));});}else{return _0xaaa026(_0x1e1af9[_0x322e('0x1a')](0x1f5,_0x322e('0x72')));}});},'Agents':function(_0x47d003){return new Promise(function(_0x170b25,_0x38347e){var _0x3a7d9f=_[_0x322e('0x54')](_0x4e068d[_0x322e('0xa')]);_0x170b25({'count':_0x3a7d9f[_0x322e('0x53')],'rows':_0x3a7d9f});});},'Telephones':function(_0x2e76a3){return new Promise(function(_0x1f80ac,_0x33c3c4){var _0x370363=_[_0x322e('0x54')](_0x4e068d[_0x322e('0x73')]);_0x1f80ac({'count':_0x370363['length'],'rows':_0x370363});});},'Trunks':function(_0x27c71f){return new Promise(function(_0x120191,_0x1b21d5){var _0x311c32=_['values'](_0x4e068d[_0x322e('0x74')]);_0x120191({'count':_0x311c32[_0x322e('0x53')],'rows':_0x311c32});});},'OutboundChannels':function(_0x4cb7ba){return new Promise(function(_0x410f25,_0x20207d){var _0x237ae0=_[_0x322e('0x54')](_0x4e068d[_0x322e('0x75')]);_0x410f25({'count':_0x237ae0[_0x322e('0x53')],'rows':_0x237ae0});});},'Outbound':function(_0x2dc39d){return new Promise(function(_0x2e5a2,_0x5602e1){_0x2e5a2(_0x4e068d['outbound']);});},'Campaigns':function(_0x37fa7a){return new Promise(function(_0x1b01c8,_0x4f3c26){var _0x318922=_[_0x322e('0x54')](_0x4e068d[_0x322e('0x76')]);_0x1b01c8({'count':_0x318922[_0x322e('0x53')],'rows':_0x318922});});},'VoiceQueuesPreview':function(_0x17f25a){var _0x475095=this;return new Promise(function(_0x84b9,_0x5e90b5){_0x353f7a['run'](_0x17f25a['id'])['then'](function(_0x8ba002){_0x84b9({'code':0xc8,'message':_0x8ba002['message']});})[_0x322e('0x19')](function(_0x3df7d7){_0x5e90b5(_0x475095[_0x322e('0x1a')](0x1f4,_0x3df7d7[_0x322e('0x18')]));});});},'EventManager':function(_0x46ce27){var _0x5a869d=this;return new Promise(function(_0x4c2246,_0x13e93d){if(!_0x46ce27[_0x322e('0x77')]){return _0x13e93d(_0x5a869d[_0x322e('0x1a')](0x1f4,_0x322e('0x78')));}ami[_0x322e('0x79')](_0x322e('0x7a')+_0x46ce27['event'],_0x46ce27[_0x322e('0x18')]);_0x4c2246({'code':0xc8,'message':_0x46ce27});});},'FaxAccounts':function(_0x586f67){return new Promise(function(_0x2f152c,_0x4d67bc){var _0x11360f=_[_0x322e('0x54')](_0x4e068d[_0x322e('0x7b')]);_0x2f152c({'count':_0x11360f[_0x322e('0x53')],'rows':_0x11360f});});},'SendFax':function(_0x14920c){var _0x2f9c86=this;return new Promise(function(_0x3c6aeb,_0x58632b){_0x509b1d[_0x322e('0x7c')](_0x14920c)[_0x322e('0x17')](function(_0x7d83c2){_0x3c6aeb({'code':0xc8,'message':_0x7d83c2[_0x322e('0x18')]});})[_0x322e('0x19')](function(_0x187457){_0x58632b(_0x2f9c86[_0x322e('0x1a')](0x1f4,_0x187457['message']));});});},'CheckAfterSend':function(_0x4a71d6){var _0x211a88=this;return new Promise(function(_0x530927,_0x1a902a){_0x509b1d[_0x322e('0x7d')](_0x4a71d6)['then'](function(_0x2bbd63){_0x530927({'code':0xc8,'message':_0x2bbd63[_0x322e('0x18')]});})[_0x322e('0x19')](function(_0xe1a6c7){_0x1a902a(_0x211a88[_0x322e('0x1a')](0x1f4,_0xe1a6c7[_0x322e('0x18')]));});});}};var _0x2d55b4=jayson[_0x322e('0x7e')](_0x321893)[_0x322e('0x7f')]();_0x2d55b4['on'](_0x322e('0x1a'),function(_0xd136fc){return _0x52ed30(_0xd136fc);});_0x2d55b4[_0x322e('0x80')](0x232a,_0x322e('0x81'),function(){console[_0x322e('0x82')](_0x322e('0x83'),0x232a);return _0x15e048(_0x322e('0x84')+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 9c37390..e709d80 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 _0x29a1=['phone','resolve','then','showContact','omit','info','xmd-contactid2','user:%s','format','trigger:%s','action','toLowerCase','merge','[%s][%s]\x20Contact\x20not\x20found','createContact','name','catch','error','[%s][%s]\x20Error\x20creating\x20contact','[%s][%s]\x20Autocreate\x20disabled','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','[%s][%s]','stringify','emit','exec','autoCreate','data2','data1','calleridnum','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum'];(function(_0x318ad8,_0x1b3cc5){var _0xc6e985=function(_0x5b2fb6){while(--_0x5b2fb6){_0x318ad8['push'](_0x318ad8['shift']());}};_0xc6e985(++_0x1b3cc5);}(_0x29a1,0x98));var _0x129a=function(_0x1d3be9,_0x1b8fad){_0x1d3be9=_0x1d3be9-0x0;var _0x5a2acb=_0x29a1[_0x1d3be9];return _0x5a2acb;};'use strict';var BPromise=require('bluebird');var util=require(_0x129a('0x0'));var _=require(_0x129a('0x1'));var Redis=require(_0x129a('0x2'));var config=require(_0x129a('0x3'));var logger=require(_0x129a('0x4'))(_0x129a('0x5'));var cmContactRpc=require(_0x129a('0x6'));config[_0x129a('0x7')]=_['defaults'](config[_0x129a('0x7')],{'host':_0x129a('0x8'),'port':0x18eb});var io=require(_0x129a('0x9'))(new Redis(config['redis']));function emit(_0x1d39b4,_0x15cb50,_0x3cb4c5,_0xa516aa){logger['info'](_0x129a('0xa'),_0x1d39b4,'',_0x15cb50,_0x3cb4c5,JSON[_0x129a('0xb')](_0xa516aa));io['to'](_0x15cb50)[_0x129a('0xc')](_0x3cb4c5,_0xa516aa);}exports[_0x129a('0xd')]=function(_0x124fd5,_0x547e01,_0x3a0093){_0x3a0093[_0x129a('0xe')]=0x0;if(_0x547e01[_0x129a('0xf')]&&parseInt(_0x547e01[_0x129a('0xf')],0xa)){var _0x32607c={'ListId':parseInt(_0x547e01[_0x129a('0x10')],0xa),'phone':_0x3a0093[_0x129a('0x11')]};if(_['isNil'](_0x3a0093['routeId'])){_0x32607c[_0x129a('0x12')]=_0x3a0093[_0x129a('0x13')]&&_0x3a0093[_0x129a('0x13')]!==_0x129a('0x14')?_0x3a0093[_0x129a('0x13')]:_0x3a0093[_0x129a('0x11')]||_0x3a0093[_0x129a('0x15')];}else{_0x32607c[_0x129a('0x12')]=_0x3a0093[_0x129a('0x16')]&&_0x3a0093[_0x129a('0x16')]!==_0x129a('0x14')?_0x3a0093['destcalleridname']:_0x3a0093[_0x129a('0x17')]||_0x3a0093[_0x129a('0x15')];_0x32607c[_0x129a('0x18')]=_0x3a0093['destcalleridname']&&_0x3a0093[_0x129a('0x16')]!==''?_0x3a0093[_0x129a('0x16')]:_0x3a0093[_0x129a('0x17')]||_0x3a0093['uniqueid'];}BPromise[_0x129a('0x19')]()[_0x129a('0x1a')](cmContactRpc[_0x129a('0x1b')]({'where':_[_0x129a('0x1c')](_0x32607c,['firstName'])}))['then'](function(_0x3afa3e){if(_0x3afa3e){logger[_0x129a('0x1d')]('[%s][%s]\x20Contact\x20found:%s',_0x3a0093['uniqueid'],'',_0x3afa3e['id']);if(_0x124fd5){_0x3a0093[_0x129a('0x1e')]=_0x3afa3e['id'];emit(_0x3a0093[_0x129a('0x15')],util['format'](_0x129a('0x1f'),_0x124fd5['name']),util[_0x129a('0x20')](_0x129a('0x21'),_0x547e01[_0x129a('0x22')][_0x129a('0x23')]()),_[_0x129a('0x24')](_0x3a0093,{'ListId':parseInt(_0x547e01[_0x129a('0x10')],0xa)}));}return;}else{logger[_0x129a('0x1d')](_0x129a('0x25'),_0x3a0093[_0x129a('0x15')],'');return BPromise[_0x129a('0x19')]()['then'](cmContactRpc[_0x129a('0x26')](_0x32607c));}})[_0x129a('0x1a')](function(_0x346339){if(_0x346339){logger[_0x129a('0x1d')]('[%s][%s]\x20Contact\x20created:%s',_0x3a0093[_0x129a('0x15')],'',_0x346339['id']);if(_0x124fd5){_0x3a0093[_0x129a('0x1e')]=_0x346339['id'];emit(_0x3a0093[_0x129a('0x15')],util[_0x129a('0x20')](_0x129a('0x1f'),_0x124fd5[_0x129a('0x27')]),util['format'](_0x129a('0x21'),_0x547e01[_0x129a('0x22')][_0x129a('0x23')]()),_[_0x129a('0x24')](_0x3a0093,{'ListId':parseInt(_0x547e01[_0x129a('0x10')],0xa)}));}}})[_0x129a('0x28')](function(_0x457836){logger[_0x129a('0x29')](_0x129a('0x2a'),_0x3a0093[_0x129a('0x15')],'',JSON[_0x129a('0xb')](_0x457836));});}else{if(_0x124fd5){logger[_0x129a('0x1d')](_0x129a('0x2b'),_0x3a0093[_0x129a('0x15')],'');emit(_0x3a0093[_0x129a('0x15')],util[_0x129a('0x20')](_0x129a('0x1f'),_0x124fd5['name']),util['format']('trigger:%s',_0x547e01[_0x129a('0x22')][_0x129a('0x23')]()),_[_0x129a('0x24')]({'ListId':parseInt(_0x547e01[_0x129a('0x10')],0xa)},_0x3a0093));}}}; \ No newline at end of file +var _0x15a4=['then','[%s][%s]\x20Contact\x20found:%s','format','user:%s','trigger:%s','action','toLowerCase','[%s][%s]\x20Contact\x20not\x20found','createContact','[%s][%s]\x20Contact\x20created:%s','xmd-contactid2','name','merge','catch','[%s][%s]\x20Error\x20creating\x20contact','[%s][%s]\x20Autocreate\x20disabled','bluebird','util','lodash','ioredis','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[%s][%s]','stringify','emit','exec','autoCreate','data2','data1','isNil','routeId','','calleridname','uniqueid','firstName','destcalleridname','phone','showContact','omit'];(function(_0x38d672,_0xc41411){var _0x33b0ca=function(_0x1022ee){while(--_0x1022ee){_0x38d672['push'](_0x38d672['shift']());}};_0x33b0ca(++_0xc41411);}(_0x15a4,0x178));var _0x415a=function(_0x83f8c4,_0x450c4b){_0x83f8c4=_0x83f8c4-0x0;var _0x1cf945=_0x15a4[_0x83f8c4];return _0x1cf945;};'use strict';var BPromise=require(_0x415a('0x0'));var util=require(_0x415a('0x1'));var _=require(_0x415a('0x2'));var Redis=require(_0x415a('0x3'));var config=require(_0x415a('0x4'));var logger=require('../../../../config/logger')(_0x415a('0x5'));var cmContactRpc=require(_0x415a('0x6'));config[_0x415a('0x7')]=_[_0x415a('0x8')](config[_0x415a('0x7')],{'host':_0x415a('0x9'),'port':0x18eb});var io=require(_0x415a('0xa'))(new Redis(config[_0x415a('0x7')]));function emit(_0x308193,_0x2d3ddf,_0x8e0fa1,_0x951d80){logger[_0x415a('0xb')](_0x415a('0xc'),_0x308193,'',_0x2d3ddf,_0x8e0fa1,JSON[_0x415a('0xd')](_0x951d80));io['to'](_0x2d3ddf)[_0x415a('0xe')](_0x8e0fa1,_0x951d80);}exports[_0x415a('0xf')]=function(_0x334920,_0x55ff39,_0x1bb3d3){_0x1bb3d3[_0x415a('0x10')]=0x0;if(_0x55ff39[_0x415a('0x11')]&&parseInt(_0x55ff39['data2'],0xa)){var _0x37574c={'ListId':parseInt(_0x55ff39[_0x415a('0x12')],0xa),'phone':_0x1bb3d3['calleridnum']};if(_[_0x415a('0x13')](_0x1bb3d3[_0x415a('0x14')])){_0x37574c['firstName']=_0x1bb3d3['calleridname']&&_0x1bb3d3['calleridname']!==_0x415a('0x15')?_0x1bb3d3[_0x415a('0x16')]:_0x1bb3d3['calleridnum']||_0x1bb3d3[_0x415a('0x17')];}else{_0x37574c[_0x415a('0x18')]=_0x1bb3d3[_0x415a('0x19')]&&_0x1bb3d3['destcalleridname']!==_0x415a('0x15')?_0x1bb3d3['destcalleridname']:_0x1bb3d3['destcalleridnum']||_0x1bb3d3[_0x415a('0x17')];_0x37574c[_0x415a('0x1a')]=_0x1bb3d3[_0x415a('0x19')]&&_0x1bb3d3[_0x415a('0x19')]!==_0x415a('0x15')?_0x1bb3d3['destcalleridname']:_0x1bb3d3['destcalleridnum']||_0x1bb3d3[_0x415a('0x17')];}BPromise['resolve']()['then'](cmContactRpc[_0x415a('0x1b')]({'where':_[_0x415a('0x1c')](_0x37574c,[_0x415a('0x18')])}))[_0x415a('0x1d')](function(_0x9da726){if(_0x9da726){logger[_0x415a('0xb')](_0x415a('0x1e'),_0x1bb3d3['uniqueid'],'',_0x9da726['id']);if(_0x334920){_0x1bb3d3['xmd-contactid2']=_0x9da726['id'];emit(_0x1bb3d3['uniqueid'],util[_0x415a('0x1f')](_0x415a('0x20'),_0x334920['name']),util['format'](_0x415a('0x21'),_0x55ff39[_0x415a('0x22')][_0x415a('0x23')]()),_['merge'](_0x1bb3d3,{'ListId':parseInt(_0x55ff39[_0x415a('0x12')],0xa)}));}return;}else{logger[_0x415a('0xb')](_0x415a('0x24'),_0x1bb3d3[_0x415a('0x17')],'');return BPromise['resolve']()['then'](cmContactRpc[_0x415a('0x25')](_0x37574c));}})[_0x415a('0x1d')](function(_0x1802a9){if(_0x1802a9){logger[_0x415a('0xb')](_0x415a('0x26'),_0x1bb3d3['uniqueid'],'',_0x1802a9['id']);if(_0x334920){_0x1bb3d3[_0x415a('0x27')]=_0x1802a9['id'];emit(_0x1bb3d3[_0x415a('0x17')],util[_0x415a('0x1f')](_0x415a('0x20'),_0x334920[_0x415a('0x28')]),util['format'](_0x415a('0x21'),_0x55ff39[_0x415a('0x22')][_0x415a('0x23')]()),_[_0x415a('0x29')](_0x1bb3d3,{'ListId':parseInt(_0x55ff39['data1'],0xa)}));}}})[_0x415a('0x2a')](function(_0x5c1c21){logger['error'](_0x415a('0x2b'),_0x1bb3d3[_0x415a('0x17')],'',JSON['stringify'](_0x5c1c21));});}else{if(_0x334920){logger['info'](_0x415a('0x2c'),_0x1bb3d3[_0x415a('0x17')],'');emit(_0x1bb3d3[_0x415a('0x17')],util[_0x415a('0x1f')](_0x415a('0x20'),_0x334920[_0x415a('0x28')]),util[_0x415a('0x1f')](_0x415a('0x21'),_0x55ff39[_0x415a('0x22')]['toLowerCase']()),_[_0x415a('0x29')]({'ListId':parseInt(_0x55ff39[_0x415a('0x12')],0xa)},_0x1bb3d3));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 76c379f..e5db29c 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 _0x8fda=['winapp','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:incomingmessage','custom:outgoingmessage','prototype','emit','info','clone','checkTriggers','interface','triggers','hasOwnProperty','status','merge','variables','Actions','action','toLowerCase','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','uri','isNil','data3','data4','location','windowWidth','800','data5','data6','600','winApplication','winArguments','format','trigger:%s:%s','jscripty','name','trigger:%s','contactmanager','queue','routeId','urlforward','exec','script','buildUri','parse','search','length','every','AllConditions','checkConditions','AnyConditions','some','channel','field','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','event','agent','membername','lastevent','exports','util','lodash','url','mustache','ioredis','./urlforward','./cmContact','../rpc/cmContact','../../../config/environment','../../../config/logger','../ami','defaults','redis','localhost','socket.io-emitter','popup'];(function(_0x274b54,_0x3734b3){var _0x3b68fd=function(_0x5351a4){while(--_0x5351a4){_0x274b54['push'](_0x274b54['shift']());}};_0x3b68fd(++_0x3734b3);}(_0x8fda,0xd6));var _0xa8fd=function(_0x3d9e24,_0x11e58f){_0x3d9e24=_0x3d9e24-0x0;var _0x3c87c0=_0x8fda[_0x3d9e24];return _0x3c87c0;};'use strict';var util=require(_0xa8fd('0x0'));var _=require(_0xa8fd('0x1'));var url=require(_0xa8fd('0x2'));var Mustache=require(_0xa8fd('0x3'));var Redis=require(_0xa8fd('0x4'));var urlforward=require(_0xa8fd('0x5'));var integration=require('./integration');var cmContact=require(_0xa8fd('0x6'));var script=require('./script');var cmContactRpc=require(_0xa8fd('0x7'));var config=require(_0xa8fd('0x8'));var logger=require(_0xa8fd('0x9'))('trigger');var ami=require(_0xa8fd('0xa'));config['redis']=_[_0xa8fd('0xb')](config[_0xa8fd('0xc')],{'host':_0xa8fd('0xd'),'port':0x18eb});var io=require(_0xa8fd('0xe'))(new Redis(config[_0xa8fd('0xc')]));var operators={'equals':function(_0x48fc50,_0x241d7a){return _0x48fc50==_0x241d7a;},'not_equals':function(_0x248edc,_0x13d7ca){return _0x248edc!=_0x13d7ca;}};var barAndWebActions=[_0xa8fd('0xf'),_0xa8fd('0x2'),_0xa8fd('0x10')];function Trigger(_0x4ecc60){this['triggers']=_0x4ecc60['triggers'];this[_0xa8fd('0x11')]=_0x4ecc60['agents'];this['voiceQueues']=_0x4ecc60[_0xa8fd('0x12')];this[_0xa8fd('0x13')]=_0x4ecc60[_0xa8fd('0x13')];this[_0xa8fd('0x14')]=_0x4ecc60[_0xa8fd('0x14')];this[_0xa8fd('0x15')]=_0x4ecc60['zendeskAccounts'];this[_0xa8fd('0x16')]=_0x4ecc60[_0xa8fd('0x16')];this['salesforceAccounts']=_0x4ecc60[_0xa8fd('0x17')];this[_0xa8fd('0x18')]=_0x4ecc60[_0xa8fd('0x18')];this[_0xa8fd('0x19')]=_0x4ecc60['zohoAccounts'];this[_0xa8fd('0x1a')]=_0x4ecc60[_0xa8fd('0x1a')];this[_0xa8fd('0x1b')]=_0x4ecc60[_0xa8fd('0x1b')];this[_0xa8fd('0x1c')]=_0x4ecc60[_0xa8fd('0x1c')];this[_0xa8fd('0x1d')]=_0x4ecc60[_0xa8fd('0x1d')];this['freshsalesAccounts']=_0x4ecc60[_0xa8fd('0x1e')];this[_0xa8fd('0x1f')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xa8fd('0x17')],'freshdesk':this[_0xa8fd('0x16')],'sugarcrm':this[_0xa8fd('0x18')],'zoho':this['zohoAccounts'],'desk':this[_0xa8fd('0x1a')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xa8fd('0x1d')],'freshsales':this[_0xa8fd('0x1e')],'servicenow':this['servicenowAccounts']};ami['on'](_0xa8fd('0x20'),this[_0xa8fd('0x21')][_0xa8fd('0x22')](this));ami['on'](_0xa8fd('0x23'),this[_0xa8fd('0x21')]['bind'](this));ami['on'](_0xa8fd('0x24'),this[_0xa8fd('0x21')][_0xa8fd('0x22')](this));ami['on'](_0xa8fd('0x25'),this[_0xa8fd('0x21')][_0xa8fd('0x22')](this));ami['on'](_0xa8fd('0x26'),this[_0xa8fd('0x21')][_0xa8fd('0x22')](this));ami['on'](_0xa8fd('0x27'),this[_0xa8fd('0x21')][_0xa8fd('0x22')](this));ami['on'](_0xa8fd('0x28'),this[_0xa8fd('0x21')][_0xa8fd('0x22')](this));ami['on']('custom:agentcongestion',this['syncCustomEvent'][_0xa8fd('0x22')](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0xa8fd('0x22')](this));ami['on'](_0xa8fd('0x29'),this[_0xa8fd('0x21')][_0xa8fd('0x22')](this));ami['on'](_0xa8fd('0x2a'),this[_0xa8fd('0x21')]['bind'](this));ami['on'](_0xa8fd('0x2b'),this[_0xa8fd('0x2c')][_0xa8fd('0x22')](this));ami['on']('custom:dialconnect',this[_0xa8fd('0x2c')][_0xa8fd('0x22')](this));ami['on'](_0xa8fd('0x2d'),this['syncAgentDial']['bind'](this));ami['on']('custom:newinteraction',this[_0xa8fd('0x21')]['bind'](this));ami['on']('custom:closedinteraction',this[_0xa8fd('0x21')]['bind'](this));ami['on'](_0xa8fd('0x2e'),this[_0xa8fd('0x21')][_0xa8fd('0x22')](this));ami['on'](_0xa8fd('0x2f'),this[_0xa8fd('0x21')][_0xa8fd('0x22')](this));ami['on']('custom:acceptmessage',this[_0xa8fd('0x21')]['bind'](this));ami['on']('custom:rejectmessage',this['syncCustomEvent'][_0xa8fd('0x22')](this));}Trigger[_0xa8fd('0x30')][_0xa8fd('0x31')]=function(_0x431552,_0x3f83d4,_0x189f0c){logger[_0xa8fd('0x32')](_0x431552,_0x3f83d4,JSON['stringify'](_0x189f0c));io['to'](_0x431552)['emit'](_0x3f83d4,_0x189f0c);};Trigger[_0xa8fd('0x30')][_0xa8fd('0x21')]=function(_0x5b0241){var _0x228efa=_[_0xa8fd('0x33')](_0x5b0241);this[_0xa8fd('0x34')](_0x228efa);};Trigger[_0xa8fd('0x30')][_0xa8fd('0x2c')]=function(_0x20bdb3){if(this['agents'][_0x20bdb3[_0xa8fd('0x35')]]){this[_0xa8fd('0x21')](_0x20bdb3);}};Trigger[_0xa8fd('0x30')][_0xa8fd('0x34')]=function(_0x44b605){var _0x539420;for(var _0x582182 in this['triggers']){if(this[_0xa8fd('0x36')][_0xa8fd('0x37')](_0x582182)){if(this['triggers'][_0x582182][_0xa8fd('0x38')]){_0x539420=this['checkTrigger'](this[_0xa8fd('0x36')][_0x582182],_0x44b605);if(_0x539420){_[_0xa8fd('0x39')](_0x44b605,_0x44b605[_0xa8fd('0x3a')]);for(var _0x5c5732=0x0,_0x4f40f9,_0x2be7da,_0x4133b2;_0x5c57320x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});}; \ No newline at end of file +var _0xa9e0=['Getting\x20agent\x20with\x20email','format','total_entries','find','_embedded','entries','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','%s/customers/search','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','work','length','map','forEach','type','string','customField','nameField','toLowerCase','content','toString','idField','variable','variableName','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','phone','Motion','CTI','Tags','Descriptions','user','Fields','%s/customers/%d/cases','POST','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','integrationTab','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','outbound','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','catch','monitor_format','lastevent','lodash','request-promise','md5','./util','../../../../config/logger','desk','redis','defaults','socket.io-emitter','emit','validateEmail','info'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var md5=require(_0x0a9e('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x0a9e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x0a9e('0x4'))(_0x0a9e('0x5'));config[_0x0a9e('0x6')]=_[_0x0a9e('0x7')](config[_0x0a9e('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x0a9e('0x8'))(new Redis(config[_0x0a9e('0x6')]));function emit(_0x2cc193,_0x5f41ea,_0x503809){io['to'](_0x2cc193)[_0x0a9e('0x9')](_0x5f41ea,_0x503809);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x39753a,_0xf81284){if(intUtil[_0x0a9e('0xa')](_0xf81284)===!![]){logger[_0x0a9e('0xb')](_0x0a9e('0xc'),_0xf81284);return request({'uri':util[_0x0a9e('0xd')]('%s/users',_0x39753a['remoteUri'])})['then'](function(_0x4cfe67){if(_0x4cfe67[_0x0a9e('0xe')]){return _[_0x0a9e('0xf')](_0x4cfe67[_0x0a9e('0x10')][_0x0a9e('0x11')],{'email':_0xf81284});}})[_0x0a9e('0x12')](function(_0x69aeb7){if(_0x69aeb7){logger['info'](_0x0a9e('0x13'));return _0x69aeb7;}else{logger[_0x0a9e('0xb')](_0x0a9e('0x14'));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x15'),_0x39753a[_0x0a9e('0x16')])});}});}else{logger['info'](_0x0a9e('0x17'));return request({'uri':util['format'](_0x0a9e('0x15'),_0x39753a['remoteUri'])});}}function request(_0x16033c){logger[_0x0a9e('0x18')]('[HTTP]',JSON[_0x0a9e('0x19')](_0x16033c));return rp(_['defaults'](_0x16033c,{'method':_0x0a9e('0x1a'),'headers':headers,'json':!![]}));}function getAuth(_0x478723){var _0x106033;if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x1c')){_0x106033=util[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x1f')]);}else if(_0x478723[_0x0a9e('0x1b')]===_0x0a9e('0x20')){_0x106033=util[_0x0a9e('0xd')]('%s/token:%s',_0x478723[_0x0a9e('0x1e')],_0x478723[_0x0a9e('0x20')]);}return util['format'](_0x0a9e('0x21'),new Buffer(_0x106033)['toString']('base64'));}function getEndUser(_0x3a02e1,_0x432e56,_0x38e7c4){logger[_0x0a9e('0xb')]('Searching\x20enduser\x20with\x20phone',_0x38e7c4);return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x22'),_0x3a02e1[_0x0a9e('0x16')]),'qs':{'phone':_0x38e7c4}})[_0x0a9e('0x12')](function(_0x370d86){if(_0x370d86[_0x0a9e('0xe')]){logger[_0x0a9e('0xb')]('Enduser\x20found!');return _0x370d86['_embedded'][_0x0a9e('0x11')][0x0];}else{logger[_0x0a9e('0xb')](_0x0a9e('0x23'));return request({'uri':util[_0x0a9e('0xd')]('%s/customers',_0x3a02e1[_0x0a9e('0x16')]),'method':'POST','body':{'first_name':_0x432e56,'title':_0x432e56,'phone_numbers':[{'type':_0x0a9e('0x24'),'value':_0x38e7c4}]}});}});}function getTags(_0x5bfb33,_0x1dc186){var _0x34dc65=[];if(_0x5bfb33&&_0x5bfb33[_0x0a9e('0x25')]>0x0){_0x34dc65=_[_0x0a9e('0x26')](_0x5bfb33,_0x1dc186);}return _0x34dc65;}function getCustomFields(_0x140511,_0x1538a4){var _0x11c3b6=[];var _0x14de77={'custom_fields':{}};if(_0x140511['length']>0x0){_[_0x0a9e('0x27')](_0x140511,function(_0x468813){if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813['nameField']&&!_0x468813[_0x0a9e('0x2a')]){_0x14de77[_0x468813[_0x0a9e('0x2b')][_0x0a9e('0x2c')]()]=_0x468813[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x29')&&_0x468813[_0x0a9e('0x2f')]&&_0x468813[_0x0a9e('0x2a')]){_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x468813['content'][_0x0a9e('0x2e')]();}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x30')&&_0x468813[_0x0a9e('0x31')]&&_0x468813[_0x0a9e('0x2f')]&&_0x468813['customField']){_0x1538a4[_0x468813[_0x0a9e('0x31')]]&&(_0x14de77[_0x0a9e('0x32')][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x31')]][_0x0a9e('0x2e')]());}else if(_0x468813[_0x0a9e('0x28')]===_0x0a9e('0x33')&&_0x468813[_0x0a9e('0x34')]&&_0x468813['Variable'][_0x0a9e('0x35')]&&_0x468813['idField']&&_0x468813[_0x0a9e('0x2a')]){_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]&&(_0x14de77['custom_fields'][_0x468813[_0x0a9e('0x2f')]]=_0x1538a4[_0x468813[_0x0a9e('0x34')][_0x0a9e('0x35')][_0x0a9e('0x2c')]()]['toString']());}});}if(_0x14de77['priority']){_0x14de77[_0x0a9e('0x36')]=Number(_0x14de77['priority']);}return _0x14de77;}function getTicket(_0x24936a,_0x3d9717,_0x381c37,_0x1ef87a,_0x4f41ae){logger[_0x0a9e('0xb')](_0x0a9e('0x37'));var _0x3cae=_['merge']({'subject':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x39')],_0x4f41ae,'\x20'),'type':_0x0a9e('0x3a'),'status':'new','labels':['xCALLY',_0x0a9e('0x3b'),_0x0a9e('0x3c')]['concat'](getTags(_0x1ef87a[_0x0a9e('0x3d')],_0x0a9e('0x35'))),'description':intUtil[_0x0a9e('0x38')](_0x1ef87a[_0x0a9e('0x3e')],_0x4f41ae,'\x0a'),'_links':{'assigned_user':{'href':util['format']('/api/v2/users/%d',_0x3d9717['id']),'class':_0x0a9e('0x3f')}},'message':{'direction':'in','body':intUtil[_0x0a9e('0x38')](_0x1ef87a['Descriptions'],_0x4f41ae,'\x0a')}},getCustomFields(_0x1ef87a[_0x0a9e('0x40')],_0x4f41ae));return request({'uri':util[_0x0a9e('0xd')](_0x0a9e('0x41'),_0x24936a['remoteUri'],_0x381c37['id']),'method':_0x0a9e('0x42'),'body':_0x3cae});}exports[_0x0a9e('0x43')]=function(_0x274e8e,_0x43dd5b,_0x13cb1f,_0xeaa5e5,_0x2881b3,_0x45a9b8){var _0x23b089,_0x3da2cd;_0x45a9b8[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x45a9b8[_0x0a9e('0x16')]);_0x45a9b8[_0x0a9e('0x45')]=intUtil[_0x0a9e('0x44')](_0x45a9b8['serverUrl']);if(_0x2881b3&&_0x2881b3['monitor_format']){logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x47'));_0x43dd5b[_0x0a9e('0x48')]=util[_0x0a9e('0xd')](_0x0a9e('0x49'),_0x45a9b8[_0x0a9e('0x45')],_0x43dd5b[_0x0a9e('0x4a')],md5(_0x43dd5b[_0x0a9e('0x4a')]));}else{_0x43dd5b[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x45a9b8);return getUser(_0x45a9b8,_0xeaa5e5[_0x0a9e('0x4c')])['then'](function(_0x117c99){_0x23b089=_0x117c99;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x23b089['id']);return getEndUser(_0x45a9b8,_0x43dd5b[_0x0a9e('0x4e')],_0x43dd5b[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x21eb86){_0x3da2cd=_0x21eb86;logger[_0x0a9e('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3da2cd['id']);return getTicket(_0x45a9b8,_0x23b089,_0x3da2cd,_0x13cb1f,_0x43dd5b);})[_0x0a9e('0x12')](function(_0x48fd45){if(_0x48fd45){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')]('The\x20Ticket\x20ID\x20is:',_0x48fd45['id']);switch(_0x45a9b8[_0x0a9e('0x28')]){case _0x0a9e('0x51'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5['name']),_0x0a9e('0x54'),{'recordId':_0x48fd45['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x56'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0xeaa5e5[_0x0a9e('0x35')]),_0x0a9e('0x57'),{'uri':util['format'](_0x0a9e('0x58'),_0x48fd45['id'])});break;default:logger[_0x0a9e('0x59')]('[QUEUE]','Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1adfee){console[_0x0a9e('0x59')](_0x1adfee);logger[_0x0a9e('0x59')](_0x0a9e('0x46'),JSON[_0x0a9e('0x19')](_0x1adfee));});};exports[_0x0a9e('0x5a')]=function(_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){var _0x14d602,_0x5bb3ed;_0x39d77d[_0x0a9e('0x16')]=intUtil[_0x0a9e('0x44')](_0x39d77d['remoteUri']);_0x39d77d['serverUrl']=intUtil[_0x0a9e('0x44')](_0x39d77d['serverUrl']);if(_0x204173&&_0x204173[_0x0a9e('0x5b')]&&_0x204173['recordingFormat']!==_0x0a9e('0x5c')){logger[_0x0a9e('0xb')](_0x0a9e('0x5d'),'Recording\x20is\x20enabled!');_0x375c18[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x39d77d['serverUrl'],_0x375c18[_0x0a9e('0x4a')],md5(_0x375c18[_0x0a9e('0x4a')]));}headers['Authorization']=getAuth(_0x39d77d);return getUser(_0x39d77d,_0x4b1b9f[_0x0a9e('0x4c')])['then'](function(_0x211ef9){_0x14d602=_0x211ef9;logger['info'](_0x0a9e('0x4d'),_0x14d602['id']);return getEndUser(_0x39d77d,_0x375c18['destcalleridname'],_0x375c18['destcalleridnum']);})['then'](function(_0x2da03c){_0x5bb3ed=_0x2da03c;logger['info'](_0x0a9e('0x5e'),_0x5bb3ed['id']);return getTicket(_0x39d77d,_0x14d602,_0x5bb3ed,_0x5d38ae,_0x375c18);})[_0x0a9e('0x12')](function(_0x3cfd00){if(_0x3cfd00){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x3cfd00['id']);switch(_0x39d77d[_0x0a9e('0x28')]){case'integrationTab':logger[_0x0a9e('0xb')](_0x0a9e('0x46'),_0x0a9e('0x52'));emit(util[_0x0a9e('0xd')](_0x0a9e('0x53'),_0x4b1b9f[_0x0a9e('0x35')]),'trigger:desk:display',{'recordId':_0x3cfd00['id']});break;case _0x0a9e('0x55'):logger[_0x0a9e('0xb')]('[QUEUE]',_0x0a9e('0x56'));emit(util['format'](_0x0a9e('0x53'),_0x4b1b9f['name']),'trigger:browser:url',{'uri':util['format'](_0x0a9e('0x60'),_0x39d77d['remoteUri'],_0x3cfd00['id'])});break;default:logger[_0x0a9e('0x59')](_0x0a9e('0x5d'),_0x0a9e('0x61'));}}})[_0x0a9e('0x62')](function(_0x1cca9f){logger[_0x0a9e('0x59')]('[OUTBOUND]',JSON[_0x0a9e('0x19')](_0x1cca9f));});};exports['unmanaged']=function(_0xca4ade,_0x1f07cb,_0x51aaf7,_0x5adf8f,_0x453360,_0x156f1c){var _0x119677,_0x32e134;_0x156f1c['remoteUri']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x16')]);_0x156f1c['serverUrl']=intUtil[_0x0a9e('0x44')](_0x156f1c[_0x0a9e('0x45')]);if(_0x453360&&_0x453360[_0x0a9e('0x63')]){logger[_0x0a9e('0xb')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',_0x0a9e('0x47'));_0x1f07cb[_0x0a9e('0x48')]=util[_0x0a9e('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x156f1c[_0x0a9e('0x45')],_0x1f07cb['uniqueid'],md5(_0x1f07cb['uniqueid']));}else{_0x1f07cb[_0x0a9e('0x48')]='';}headers[_0x0a9e('0x4b')]=getAuth(_0x156f1c);return getUser(_0x156f1c)[_0x0a9e('0x12')](function(_0x19c995){_0x119677=_0x19c995;logger[_0x0a9e('0xb')](_0x0a9e('0x4d'),_0x119677['id']);return getEndUser(_0x156f1c,_0x1f07cb[_0x0a9e('0x4e')],_0x1f07cb[_0x0a9e('0x4f')]);})[_0x0a9e('0x12')](function(_0x1cc4f3){_0x32e134=_0x1cc4f3;logger[_0x0a9e('0xb')](_0x0a9e('0x5e'),_0x32e134['id']);return getTicket(_0x156f1c,_0x119677,_0x32e134,_0x51aaf7,_0x1f07cb);})[_0x0a9e('0x12')](function(_0x2b8192){if(_0x2b8192){logger[_0x0a9e('0xb')](_0x0a9e('0x50'));logger[_0x0a9e('0xb')](_0x0a9e('0x5f'),_0x2b8192['id']);}})['catch'](function(_0x1b0b98){logger[_0x0a9e('0x59')]('['+_0x1f07cb[_0x0a9e('0x64')]['toUpperCase']()+']',JSON[_0x0a9e('0x19')](_0x1b0b98));});}; \ 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 f8e4af3..b5fec3d 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 _0x23b7=['userEmail','username','internalemailaddress','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','catch','GET','contacts?$select=telephone1','outbound','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','idField','indexOf','incident','incidents','assign','getString','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','Subjects','queue','callDirection','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','serverUrl','stripTrailingSlash','unmanaged','%s/api/data/v9.0/','remoteUri','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','request-promise','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','password','clientSecret','then','error','toUpperCase','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','email','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!'];(function(_0xbaf426,_0x2d5092){var _0x4a4c13=function(_0x1beb37){while(--_0x1beb37){_0xbaf426['push'](_0xbaf426['shift']());}};_0x4a4c13(++_0x2d5092);}(_0x23b7,0x10c));var _0x723b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x23b7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x723b('0x0'));var BPromise=require('bluebird');var rp=require(_0x723b('0x1'));var util=require(_0x723b('0x2'));var intUtil=require(_0x723b('0x3'));var md5=require(_0x723b('0x4'));var Redis=require(_0x723b('0x5'));var logger=require(_0x723b('0x6'))('dynamics365');var config=require(_0x723b('0x7'));config[_0x723b('0x8')]=_[_0x723b('0x9')](config[_0x723b('0x8')],{'host':_0x723b('0xa'),'port':0x18eb});var io=require(_0x723b('0xb'))(new Redis(config[_0x723b('0x8')]));function getAuthToken(_0x1a06d7,_0x2dcb73,_0x3ead91){var _0xd9d385={'method':_0x723b('0xc'),'uri':_0x2dcb73,'form':{'client_id':_0x1a06d7[_0x723b('0xd')],'resource':_0x1a06d7['remoteUri'],'username':_0x1a06d7['username'],'password':_0x1a06d7[_0x723b('0xe')],'grant_type':_0x723b('0xe'),'client_secret':_0x1a06d7[_0x723b('0xf')]},'json':!![]};return rp(_0xd9d385)[_0x723b('0x10')](function(_0x101758){return _0x101758['access_token'];})['catch'](function(_0x17970e){logger[_0x723b('0x11')]('['+[_0x3ead91[_0x723b('0x12')]()]+']\x20Wrong\x20credentials!');return _0x17970e[_0x723b('0x13')];});}function getUser(_0x3203f5,_0x3759ad,_0x196da2,_0x4e2d6d,_0x37745c,_0x3861d8){return new BPromise(function(_0x4e5f9e,_0x1c1e93){return getAuthToken(_0x3759ad,_0x4e2d6d,_0x3861d8)[_0x723b('0x10')](function(_0x3a8a5c){var _0x34fa41={'method':'GET','uri':_0x37745c+_0x723b('0x14'),'headers':{'Authorization':_0x723b('0x15')+_0x3a8a5c,'OData-Version':_0x723b('0x16')},'json':!![]};return rp(_0x34fa41);})['then'](function(_0x1923d6){var _0x15959b=_0x1923d6[_0x723b('0x17')];var _0x2dd3ca=![];var _0x4daca4=null;if(!_['isNil'](_0x196da2)){if(intUtil['validateEmail'](_0x196da2[_0x723b('0x18')])){_0x3203f5['userEmail']=_0x196da2[_0x723b('0x18')];for(_0x4daca4=0x0;_0x4daca4<_0x15959b[_0x723b('0x19')];_0x4daca4++){if(_0x15959b[_0x4daca4]['internalemailaddress']===_0x196da2[_0x723b('0x18')]&&!_0x15959b[_0x4daca4][_0x723b('0x1a')]){_0x2dd3ca=!![];logger[_0x723b('0x1b')]('['+[_0x3861d8[_0x723b('0x12')]()]+_0x723b('0x1c')+_0x15959b[_0x4daca4][_0x723b('0x1d')]+'!');_0x3203f5[_0x723b('0x1e')]=_0x15959b[_0x4daca4][_0x723b('0x1d')];}}}}if(!_0x2dd3ca){logger[_0x723b('0x1b')]('['+[_0x3861d8[_0x723b('0x12')]()]+_0x723b('0x1f'));_0x3203f5[_0x723b('0x20')]=_0x3759ad[_0x723b('0x21')];for(_0x4daca4=0x0;_0x4daca4<_0x15959b[_0x723b('0x19')];_0x4daca4++){if(_0x15959b[_0x4daca4][_0x723b('0x22')]===_0x3759ad[_0x723b('0x21')]){_0x3203f5[_0x723b('0x1e')]=_0x15959b[_0x4daca4][_0x723b('0x1d')];}}}_0x4e5f9e(_0x3203f5);})['catch'](function(_0x5bd65a){_0x1c1e93(_0x5bd65a[_0x723b('0x13')]);});});}function createEndUser(_0x4a9576,_0x14cc95,_0x105cd1,_0x46da9d,_0x485c9a,_0xee4d2c){return new BPromise(function(_0x2e5cdc,_0x7f3591){return getAuthToken(_0x14cc95,_0x105cd1,_0xee4d2c)[_0x723b('0x10')](function(_0x591aab){var _0x4872a5=_0xee4d2c[_0x723b('0x23')]()==='outbound'?_0x485c9a[_0x723b('0x24')]:_0x485c9a[_0x723b('0x25')];var _0x5a688f={'method':_0x723b('0xc'),'uri':_0x46da9d+_0x723b('0x26'),'body':{'telephone1':_0x4872a5,'fullname':_0x4872a5,'firstname':_0x4872a5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x723b('0x27')+_0x4a9576[_0x723b('0x1e')]+')'},'headers':{'Authorization':_0x723b('0x15')+_0x591aab,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5a688f);})[_0x723b('0x10')](function(_0x2911c3){var _0x51d80=_0x2911c3[_0x723b('0x28')][_0x723b('0x29')];var _0xb7f8dc=_0x51d80[_0x723b('0x2a')](_0x51d80[_0x723b('0x2b')]('(')+0x1,_0x51d80[_0x723b('0x2b')](')'));_0x4a9576[_0x723b('0x2c')]=_0xb7f8dc;_0x2e5cdc(_0x4a9576);})[_0x723b('0x2d')](function(_0x3cd0a7){_0x7f3591(_0x3cd0a7[_0x723b('0x13')]);});});}function getEndUser(_0x2ca52d,_0x2995db,_0x2bfa36,_0x2a2a9d,_0x474538,_0x4feedc){return new BPromise(function(_0x47926f,_0x554a17){return getAuthToken(_0x2995db,_0x2bfa36,_0x4feedc)['then'](function(_0x5090a7){var _0x36116e={'method':_0x723b('0x2e'),'uri':_0x2a2a9d+_0x723b('0x2f'),'headers':{'Authorization':_0x723b('0x15')+_0x5090a7,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x36116e);})['then'](function(_0xf2218b){var _0x1b2732=null;if(_0xf2218b){var _0x59e84=_0xf2218b[_0x723b('0x17')];var _0x441a91=![];for(_0x1b2732=0x0;_0x1b2732<_0x59e84['length'];_0x1b2732++){var _0x5ad131=_0x4feedc[_0x723b('0x23')]()===_0x723b('0x30')?_0x474538[_0x723b('0x24')]:_0x474538[_0x723b('0x25')];if(_0x59e84[_0x1b2732]['telephone1']===_0x5ad131){_0x441a91=!![];_0x2ca52d[_0x723b('0x2c')]=_0x59e84[_0x1b2732][_0x723b('0x31')];}}if(_0x441a91){_0x47926f(_0x2ca52d);}else{return createEndUser(_0x2ca52d,_0x2995db,_0x2bfa36,_0x2a2a9d,_0x474538,_0x4feedc)['then'](function(_0x16df4d){logger[_0x723b('0x1b')]('['+[_0x4feedc[_0x723b('0x12')]()]+_0x723b('0x32'),_0x16df4d['enduserId']);_0x47926f(_0x16df4d);});}}else{return createEndUser(_0x2ca52d,_0x2995db,_0x2bfa36,_0x2a2a9d,_0x474538,_0x4feedc)[_0x723b('0x10')](function(_0x1049b6){logger['info']('['+[_0x4feedc[_0x723b('0x12')]()]+_0x723b('0x33'),_0x1049b6[_0x723b('0x2c')]);_0x47926f(_0x1049b6);});}});});}function getCustomFields(_0x3d454e,_0x1ae2fc,_0x2d226b){var _0x542e63={};if(_0x3d454e['length']>0x0){_[_0x723b('0x34')](_0x3d454e,function(_0x3ae445){if(_0x3ae445[_0x723b('0x35')]===_0x723b('0x36')&&_0x3ae445[_0x723b('0x37')]&&!_0x3ae445['customField']){var _0x5ab6c7=_0x3ae445[_0x723b('0x38')][_0x723b('0x23')]();var _0x40304a=_0x5ab6c7[_0x723b('0x2a')](0x0,_0x5ab6c7['indexOf']('_'));var _0x337d1d=_0x5ab6c7[_0x723b('0x2a')](_0x5ab6c7[_0x723b('0x39')]('_')+0x1);if(_0x40304a===_0x2d226b){_0x542e63[_0x337d1d]=_0x3ae445['content'];}}});}return _0x542e63;}function getTicket(_0x472774,_0x3f102c,_0xc41ae3,_0x2f1fe7,_0x39f139,_0x4b20e7,_0xdf31d5){return new BPromise(function(_0x40d81a,_0xb302a5){var _0x2f0911;return getAuthToken(_0x3f102c,_0xc41ae3,_0xdf31d5)[_0x723b('0x10')](function(_0x544ca7){if(_0x4b20e7['ticketType']===_0x723b('0x3a')){_0x2f0911={'method':'POST','uri':_0x2f1fe7+_0x723b('0x3b'),'body':Object[_0x723b('0x3c')]({},{'title':intUtil[_0x723b('0x3d')](_0x4b20e7['Subjects'],_0x39f139,'\x20'),'description':intUtil[_0x723b('0x3d')](_0x4b20e7[_0x723b('0x3e')],_0x39f139,'\x0a'),'customerid_contact@odata.bind':_0x723b('0x3f')+_0x472774[_0x723b('0x2c')]+')','ownerid@odata.bind':'/systemusers('+_0x472774[_0x723b('0x1e')]+')','caseorigincode':'1'},getCustomFields(_0x4b20e7[_0x723b('0x40')],_0x39f139,_0x4b20e7[_0x723b('0x41')])),'headers':{'Authorization':_0x723b('0x15')+_0x544ca7,'OData-Version':_0x723b('0x16')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4b20e7[_0x723b('0x41')]===_0x723b('0x42')){_0x2f0911={'method':_0x723b('0xc'),'uri':_0x2f1fe7+_0x723b('0x43'),'body':Object[_0x723b('0x3c')]({},{'subject':intUtil[_0x723b('0x3d')](_0x4b20e7[_0x723b('0x44')],_0x39f139,'\x20'),'phonenumber':String(_0x39f139[_0x723b('0x25')]),'description':intUtil[_0x723b('0x3d')](_0x4b20e7[_0x723b('0x3e')],_0x39f139,'\x0a'),'regardingobjectid_contact@odata.bind':_0x723b('0x3f')+_0x472774['enduserId']+')','ownerid@odata.bind':_0x723b('0x27')+_0x472774[_0x723b('0x1e')]+')','directioncode':_0x472774['callDirection']===_0x723b('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x723b('0x27')+_0x472774[_0x723b('0x1e')]+')','participationtypemask':_0x472774[_0x723b('0x46')]===_0x723b('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x723b('0x3f')+_0x472774[_0x723b('0x2c')]+')','participationtypemask':_0x472774[_0x723b('0x46')]==='queue'?0x1:0x2}]},getCustomFields(_0x4b20e7['Fields'],_0x39f139,_0x4b20e7[_0x723b('0x41')])),'headers':{'Authorization':_0x723b('0x15')+_0x544ca7,'OData-Version':_0x723b('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x2f0911);})[_0x723b('0x10')](function(_0x4ec8e4){var _0x43ca67=_0x4ec8e4[_0x723b('0x28')][_0x723b('0x29')];var _0x50a763=_0x43ca67[_0x723b('0x2a')](_0x43ca67[_0x723b('0x2b')]('(')+0x1,_0x43ca67[_0x723b('0x2b')](')'));_0x472774[_0x723b('0x47')]=_0x50a763;_0x40d81a(_0x472774);})[_0x723b('0x2d')](function(_0x1a1fa0){_0xb302a5(_0x1a1fa0[_0x723b('0x13')]);});});}function emit(_0x144745,_0x55e315,_0x2376be,_0x8ef2b1){var _0x5190bd={'uri':util[_0x723b('0x48')](_0x723b('0x49'),_0x144745,_0x2376be,_0x8ef2b1)};io['to'](util[_0x723b('0x48')]('user:%s',_0x55e315))[_0x723b('0x4a')](_0x723b('0x4b'),_0x5190bd);}exports['cs']=function(_0x50e374,_0x701866,_0x5e6399,_0x10e54d,_0x4acfac,_0x37d2d4,_0x5a2c57,_0x377756){var _0x3b7257={};_0x37d2d4['remoteUri']=intUtil['stripTrailingSlash'](_0x37d2d4['remoteUri']);_0x37d2d4[_0x723b('0x4c')]=intUtil[_0x723b('0x4d')](_0x37d2d4[_0x723b('0x4c')]);_0x3b7257[_0x723b('0x46')]=_0x377756===_0x723b('0x45')||_0x377756===_0x723b('0x4e')?_0x723b('0x45'):_0x723b('0x30');var _0x57f430=util[_0x723b('0x48')](_0x723b('0x4f'),_0x37d2d4[_0x723b('0x50')]);var _0x191c81=util[_0x723b('0x48')](_0x723b('0x51'),_0x37d2d4[_0x723b('0x52')]);var _0x3fa402=util['format'](_0x723b('0x53'),_0x37d2d4['serverUrl'],_0x701866[_0x723b('0x54')],md5(_0x701866[_0x723b('0x54')]));if(_0x4acfac&&_0x4acfac[_0x723b('0x55')]){logger['info'](_0x723b('0x56'),'Recording\x20is\x20enabled!');_0x701866['recordingURL']=_0x3fa402;}else if(_0x5a2c57&&_0x5a2c57[_0x723b('0x57')]&&_0x5a2c57[_0x723b('0x57')]!==_0x723b('0x58')){logger['info'](_0x723b('0x59'),_0x723b('0x5a'));_0x701866['recordingURL']=_0x3fa402;}else{_0x701866[_0x723b('0x5b')]='';}return getUser(_0x3b7257,_0x37d2d4,_0x10e54d,_0x191c81,_0x57f430,_0x377756)[_0x723b('0x10')](function(_0x52ab55){logger['info']('['+_0x377756[_0x723b('0x12')]()+_0x723b('0x5c'),_0x52ab55['userId']);logger[_0x723b('0x1b')]('['+_0x377756['toUpperCase']()+_0x723b('0x5d'),_0x52ab55[_0x723b('0x20')]);return getEndUser(_0x52ab55,_0x37d2d4,_0x191c81,_0x57f430,_0x701866,_0x377756);})[_0x723b('0x10')](function(_0x2e8fc8){logger[_0x723b('0x1b')]('['+_0x377756[_0x723b('0x12')]()+_0x723b('0x5e'),_0x2e8fc8[_0x723b('0x2c')]);logger[_0x723b('0x1b')]('['+_0x377756['toUpperCase']()+_0x723b('0x5f'),_0x701866[_0x723b('0x25')]);return getTicket(_0x2e8fc8,_0x37d2d4,_0x191c81,_0x57f430,_0x701866,_0x5e6399,_0x377756);})['then'](function(_0x5e8f32){logger[_0x723b('0x1b')](util[_0x723b('0x48')]('['+_0x377756[_0x723b('0x12')]()+_0x723b('0x60'),_0x5e6399[_0x723b('0x41')],_0x5e8f32[_0x723b('0x47')]));logger['info'](util[_0x723b('0x48')]('['+_0x377756[_0x723b('0x12')]()+']\x20Call\x20direction:\x20%s',_0x377756));if(_0x377756!==_0x723b('0x4e')){logger['info']('['+_0x377756[_0x723b('0x12')]()+']',_0x723b('0x61'));emit(_0x37d2d4[_0x723b('0x50')],_0x10e54d['name'],_0x5e6399['ticketType'],_0x5e8f32[_0x723b('0x47')]);}})[_0x723b('0x2d')](function(_0x3a83f7){logger[_0x723b('0x11')]('['+_0x377756[_0x723b('0x12')]()+_0x723b('0x62'),util[_0x723b('0x63')](_0x3a83f7,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8089=['userEmail','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','4.0','headers','odata-entityid','substring','lastIndexOf','contacts?$select=telephone1','telephone1','enduserId','contactid',']\x20Enduser\x20created!','forEach','type','string','nameField','customField','indexOf','content','ticketType','incidents','assign','getString','Subjects','Fields','phonecall','phonecalls','Descriptions','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\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...',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','./util','md5','dynamics365','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','value','validateEmail','email'];(function(_0x755b39,_0x3c528a){var _0x51b078=function(_0x19a18a){while(--_0x19a18a){_0x755b39['push'](_0x755b39['shift']());}};_0x51b078(++_0x3c528a);}(_0x8089,0x1d2));var _0x9808=function(_0x4daae7,_0x29ea00){_0x4daae7=_0x4daae7-0x0;var _0xd6992e=_0x8089[_0x4daae7];return _0xd6992e;};'use strict';var _=require('lodash');var BPromise=require(_0x9808('0x0'));var rp=require(_0x9808('0x1'));var util=require(_0x9808('0x2'));var intUtil=require(_0x9808('0x3'));var md5=require(_0x9808('0x4'));var Redis=require('ioredis');var logger=require('../../../../config/logger')(_0x9808('0x5'));var config=require(_0x9808('0x6'));config['redis']=_[_0x9808('0x7')](config[_0x9808('0x8')],{'host':_0x9808('0x9'),'port':0x18eb});var io=require(_0x9808('0xa'))(new Redis(config[_0x9808('0x8')]));function getAuthToken(_0x5757a1,_0x5e4015,_0x5a761c){var _0x52b96e={'method':_0x9808('0xb'),'uri':_0x5e4015,'form':{'client_id':_0x5757a1[_0x9808('0xc')],'resource':_0x5757a1[_0x9808('0xd')],'username':_0x5757a1[_0x9808('0xe')],'password':_0x5757a1['password'],'grant_type':_0x9808('0xf'),'client_secret':_0x5757a1[_0x9808('0x10')]},'json':!![]};return rp(_0x52b96e)[_0x9808('0x11')](function(_0x364ffd){return _0x364ffd[_0x9808('0x12')];})[_0x9808('0x13')](function(_0x279b0b){logger[_0x9808('0x14')]('['+[_0x5a761c[_0x9808('0x15')]()]+_0x9808('0x16'));return _0x279b0b[_0x9808('0x17')];});}function getUser(_0x3f5f77,_0x509818,_0x3154f7,_0x3f72ca,_0xbe12ce,_0x59f6e8){return new BPromise(function(_0x596b86,_0x41b95d){return getAuthToken(_0x509818,_0x3f72ca,_0x59f6e8)['then'](function(_0x20e686){var _0x1f9762={'method':_0x9808('0x18'),'uri':_0xbe12ce+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x9808('0x19')+_0x20e686,'OData-Version':'4.0'},'json':!![]};return rp(_0x1f9762);})[_0x9808('0x11')](function(_0x45a1e4){var _0xc6b0b8=_0x45a1e4[_0x9808('0x1a')];var _0x4417f8=![];var _0x2533fc=null;if(!_['isNil'](_0x3154f7)){if(intUtil[_0x9808('0x1b')](_0x3154f7[_0x9808('0x1c')])){_0x3f5f77[_0x9808('0x1d')]=_0x3154f7['email'];for(_0x2533fc=0x0;_0x2533fc<_0xc6b0b8[_0x9808('0x1e')];_0x2533fc++){if(_0xc6b0b8[_0x2533fc][_0x9808('0x1f')]===_0x3154f7[_0x9808('0x1c')]&&!_0xc6b0b8[_0x2533fc]['isdisabled']){_0x4417f8=!![];logger[_0x9808('0x20')]('['+[_0x59f6e8['toUpperCase']()]+_0x9808('0x21')+_0xc6b0b8[_0x2533fc][_0x9808('0x22')]+'!');_0x3f5f77[_0x9808('0x23')]=_0xc6b0b8[_0x2533fc][_0x9808('0x22')];}}}}if(!_0x4417f8){logger['info']('['+[_0x59f6e8[_0x9808('0x15')]()]+_0x9808('0x24'));_0x3f5f77[_0x9808('0x1d')]=_0x509818[_0x9808('0xe')];for(_0x2533fc=0x0;_0x2533fc<_0xc6b0b8['length'];_0x2533fc++){if(_0xc6b0b8[_0x2533fc][_0x9808('0x1f')]===_0x509818[_0x9808('0xe')]){_0x3f5f77[_0x9808('0x23')]=_0xc6b0b8[_0x2533fc][_0x9808('0x22')];}}}_0x596b86(_0x3f5f77);})[_0x9808('0x13')](function(_0x3046f3){_0x41b95d(_0x3046f3['message']);});});}function createEndUser(_0x22fb69,_0xb9cfa6,_0x4d097e,_0x7afb31,_0x4e2a08,_0x44ca15){return new BPromise(function(_0x398342,_0x271478){return getAuthToken(_0xb9cfa6,_0x4d097e,_0x44ca15)[_0x9808('0x11')](function(_0x32b27d){var _0x1a549f=_0x44ca15[_0x9808('0x25')]()===_0x9808('0x26')?_0x4e2a08[_0x9808('0x27')]:_0x4e2a08[_0x9808('0x28')];var _0x4275e4={'method':_0x9808('0xb'),'uri':_0x7afb31+_0x9808('0x29'),'body':{'telephone1':_0x1a549f,'fullname':_0x1a549f,'firstname':_0x1a549f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x9808('0x2a')+_0x22fb69['userId']+')'},'headers':{'Authorization':_0x9808('0x19')+_0x32b27d,'OData-Version':_0x9808('0x2b')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4275e4);})[_0x9808('0x11')](function(_0x5c2143){var _0x214f0e=_0x5c2143[_0x9808('0x2c')][_0x9808('0x2d')];var _0x3a99e2=_0x214f0e[_0x9808('0x2e')](_0x214f0e[_0x9808('0x2f')]('(')+0x1,_0x214f0e[_0x9808('0x2f')](')'));_0x22fb69['enduserId']=_0x3a99e2;_0x398342(_0x22fb69);})[_0x9808('0x13')](function(_0x5a033e){_0x271478(_0x5a033e['message']);});});}function getEndUser(_0x3d2dae,_0x150f9e,_0x483b4a,_0x2f6ee7,_0x3a9fe7,_0x87fed7){return new BPromise(function(_0x48bb31,_0x1e88f9){return getAuthToken(_0x150f9e,_0x483b4a,_0x87fed7)[_0x9808('0x11')](function(_0x1c8049){var _0x45f26c={'method':_0x9808('0x18'),'uri':_0x2f6ee7+_0x9808('0x30'),'headers':{'Authorization':'Bearer\x20'+_0x1c8049,'If-None-Match':null,'OData-Version':_0x9808('0x2b')},'json':!![]};return rp(_0x45f26c);})[_0x9808('0x11')](function(_0x24d7fa){var _0x195f90=null;if(_0x24d7fa){var _0x5ae8fe=_0x24d7fa[_0x9808('0x1a')];var _0x500660=![];for(_0x195f90=0x0;_0x195f90<_0x5ae8fe[_0x9808('0x1e')];_0x195f90++){var _0xa6d5f9=_0x87fed7[_0x9808('0x25')]()===_0x9808('0x26')?_0x3a9fe7[_0x9808('0x27')]:_0x3a9fe7['calleridnum'];if(_0x5ae8fe[_0x195f90][_0x9808('0x31')]===_0xa6d5f9){_0x500660=!![];_0x3d2dae[_0x9808('0x32')]=_0x5ae8fe[_0x195f90][_0x9808('0x33')];}}if(_0x500660){_0x48bb31(_0x3d2dae);}else{return createEndUser(_0x3d2dae,_0x150f9e,_0x483b4a,_0x2f6ee7,_0x3a9fe7,_0x87fed7)[_0x9808('0x11')](function(_0x246765){logger[_0x9808('0x20')]('['+[_0x87fed7[_0x9808('0x15')]()]+_0x9808('0x34'),_0x246765[_0x9808('0x32')]);_0x48bb31(_0x246765);});}}else{return createEndUser(_0x3d2dae,_0x150f9e,_0x483b4a,_0x2f6ee7,_0x3a9fe7,_0x87fed7)['then'](function(_0x46c6dc){logger[_0x9808('0x20')]('['+[_0x87fed7[_0x9808('0x15')]()]+']\x20Enduser\x20Created!',_0x46c6dc['enduserId']);_0x48bb31(_0x46c6dc);});}});});}function getCustomFields(_0x86a65f,_0x4593c0,_0x2170f5){var _0x35d22d={};if(_0x86a65f[_0x9808('0x1e')]>0x0){_[_0x9808('0x35')](_0x86a65f,function(_0x3db265){if(_0x3db265[_0x9808('0x36')]===_0x9808('0x37')&&_0x3db265[_0x9808('0x38')]&&!_0x3db265[_0x9808('0x39')]){var _0x25808b=_0x3db265['idField'][_0x9808('0x25')]();var _0x14a535=_0x25808b[_0x9808('0x2e')](0x0,_0x25808b[_0x9808('0x3a')]('_'));var _0x32cf95=_0x25808b['substring'](_0x25808b[_0x9808('0x3a')]('_')+0x1);if(_0x14a535===_0x2170f5){_0x35d22d[_0x32cf95]=_0x3db265[_0x9808('0x3b')];}}});}return _0x35d22d;}function getTicket(_0x1855ba,_0x2ad368,_0x5662d0,_0x438282,_0x3c1cbb,_0xa8b74a,_0xd8e570){return new BPromise(function(_0x4728f1,_0x2cb45e){var _0x4036a0;return getAuthToken(_0x2ad368,_0x5662d0,_0xd8e570)[_0x9808('0x11')](function(_0x1d06ba){if(_0xa8b74a[_0x9808('0x3c')]==='incident'){_0x4036a0={'method':_0x9808('0xb'),'uri':_0x438282+_0x9808('0x3d'),'body':Object[_0x9808('0x3e')]({},{'title':intUtil[_0x9808('0x3f')](_0xa8b74a[_0x9808('0x40')],_0x3c1cbb,'\x20'),'description':intUtil[_0x9808('0x3f')](_0xa8b74a['Descriptions'],_0x3c1cbb,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0x1855ba[_0x9808('0x32')]+')','ownerid@odata.bind':_0x9808('0x2a')+_0x1855ba[_0x9808('0x23')]+')','caseorigincode':'1'},getCustomFields(_0xa8b74a[_0x9808('0x41')],_0x3c1cbb,_0xa8b74a[_0x9808('0x3c')])),'headers':{'Authorization':_0x9808('0x19')+_0x1d06ba,'OData-Version':_0x9808('0x2b')},'json':!![],'resolveWithFullResponse':!![]};}if(_0xa8b74a[_0x9808('0x3c')]===_0x9808('0x42')){_0x4036a0={'method':_0x9808('0xb'),'uri':_0x438282+_0x9808('0x43'),'body':Object[_0x9808('0x3e')]({},{'subject':intUtil[_0x9808('0x3f')](_0xa8b74a[_0x9808('0x40')],_0x3c1cbb,'\x20'),'phonenumber':String(_0x3c1cbb['calleridnum']),'description':intUtil[_0x9808('0x3f')](_0xa8b74a[_0x9808('0x44')],_0x3c1cbb,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x1855ba[_0x9808('0x32')]+')','ownerid@odata.bind':_0x9808('0x2a')+_0x1855ba[_0x9808('0x23')]+')','directioncode':_0x1855ba[_0x9808('0x45')]===_0x9808('0x46')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x9808('0x2a')+_0x1855ba[_0x9808('0x23')]+')','participationtypemask':_0x1855ba[_0x9808('0x45')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x1855ba[_0x9808('0x32')]+')','participationtypemask':_0x1855ba[_0x9808('0x45')]===_0x9808('0x46')?0x1:0x2}]},getCustomFields(_0xa8b74a['Fields'],_0x3c1cbb,_0xa8b74a['ticketType'])),'headers':{'Authorization':_0x9808('0x19')+_0x1d06ba,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4036a0);})[_0x9808('0x11')](function(_0x4ffc18){var _0x18b21d=_0x4ffc18['headers'][_0x9808('0x2d')];var _0x3b3086=_0x18b21d[_0x9808('0x2e')](_0x18b21d[_0x9808('0x2f')]('(')+0x1,_0x18b21d[_0x9808('0x2f')](')'));_0x1855ba[_0x9808('0x47')]=_0x3b3086;_0x4728f1(_0x1855ba);})[_0x9808('0x13')](function(_0x2826ee){_0x2cb45e(_0x2826ee['message']);});});}function emit(_0x377bb6,_0x51f30a,_0x349d0c,_0x299e8d){var _0x3117b3={'uri':util[_0x9808('0x48')](_0x9808('0x49'),_0x377bb6,_0x349d0c,_0x299e8d)};io['to'](util[_0x9808('0x48')](_0x9808('0x4a'),_0x51f30a))[_0x9808('0x4b')](_0x9808('0x4c'),_0x3117b3);}exports['cs']=function(_0xad61d3,_0x445d5a,_0x2630ed,_0x4c05c4,_0x223fd5,_0x1b3867,_0x2bbb52,_0x4484b0){var _0x53bced={};_0x1b3867['remoteUri']=intUtil[_0x9808('0x4d')](_0x1b3867[_0x9808('0xd')]);_0x1b3867['serverUrl']=intUtil[_0x9808('0x4d')](_0x1b3867[_0x9808('0x4e')]);_0x53bced['callDirection']=_0x4484b0===_0x9808('0x46')||_0x4484b0===_0x9808('0x4f')?_0x9808('0x46'):_0x9808('0x26');var _0x204e53=util[_0x9808('0x48')](_0x9808('0x50'),_0x1b3867[_0x9808('0xd')]);var _0x2ccfaa=util[_0x9808('0x48')](_0x9808('0x51'),_0x1b3867['tenantId']);var _0x67c3c=util[_0x9808('0x48')](_0x9808('0x52'),_0x1b3867[_0x9808('0x4e')],_0x445d5a[_0x9808('0x53')],md5(_0x445d5a[_0x9808('0x53')]));if(_0x223fd5&&_0x223fd5[_0x9808('0x54')]){logger[_0x9808('0x20')](_0x9808('0x55'),_0x9808('0x56'));_0x445d5a[_0x9808('0x57')]=_0x67c3c;}else if(_0x2bbb52&&_0x2bbb52[_0x9808('0x58')]&&_0x2bbb52[_0x9808('0x58')]!==_0x9808('0x59')){logger[_0x9808('0x20')](_0x9808('0x5a'),_0x9808('0x56'));_0x445d5a[_0x9808('0x57')]=_0x67c3c;}else{_0x445d5a['recordingURL']='';}return getUser(_0x53bced,_0x1b3867,_0x4c05c4,_0x2ccfaa,_0x204e53,_0x4484b0)[_0x9808('0x11')](function(_0x520764){logger[_0x9808('0x20')]('['+_0x4484b0['toUpperCase']()+_0x9808('0x5b'),_0x520764[_0x9808('0x23')]);logger[_0x9808('0x20')]('['+_0x4484b0[_0x9808('0x15')]()+']\x20The\x20User\x20email\x20is:',_0x520764[_0x9808('0x1d')]);return getEndUser(_0x520764,_0x1b3867,_0x2ccfaa,_0x204e53,_0x445d5a,_0x4484b0);})[_0x9808('0x11')](function(_0x5523c3){logger['info']('['+_0x4484b0['toUpperCase']()+_0x9808('0x5c'),_0x5523c3[_0x9808('0x32')]);logger[_0x9808('0x20')]('['+_0x4484b0['toUpperCase']()+_0x9808('0x5d'),_0x445d5a['calleridnum']);return getTicket(_0x5523c3,_0x1b3867,_0x2ccfaa,_0x204e53,_0x445d5a,_0x2630ed,_0x4484b0);})[_0x9808('0x11')](function(_0x274b04){logger['info'](util[_0x9808('0x48')]('['+_0x4484b0[_0x9808('0x15')]()+_0x9808('0x5e'),_0x2630ed['ticketType'],_0x274b04['ticketId']));logger[_0x9808('0x20')](util[_0x9808('0x48')]('['+_0x4484b0[_0x9808('0x15')]()+_0x9808('0x5f'),_0x4484b0));if(_0x4484b0!==_0x9808('0x4f')){logger['info']('['+_0x4484b0[_0x9808('0x15')]()+']',_0x9808('0x60'));emit(_0x1b3867[_0x9808('0xd')],_0x4c05c4['name'],_0x2630ed[_0x9808('0x3c')],_0x274b04[_0x9808('0x47')]);}})[_0x9808('0x13')](function(_0x42d9bb){logger['error']('['+_0x4484b0[_0x9808('0x15')]()+_0x9808('0x61'),util[_0x9808('0x62')](_0x42d9bb,{'showHidden':!![],'depth':null}));});}; \ 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 d099c9a..f7dc9f8 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 _0xe4ad=['Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','defaults','GET','map','forEach','string','nameField','content','idField','customField','push','variableName','type','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','
','Tags','name','Fields','mapValues','keyBy','custom_fields','value','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length'];(function(_0xdb75cb,_0x5a2f8f){var _0x2899ca=function(_0x189385){while(--_0x189385){_0xdb75cb['push'](_0xdb75cb['shift']());}};_0x2899ca(++_0x5a2f8f);}(_0xe4ad,0x100));var _0xde4a=function(_0x4a8c66,_0xaa36a3){_0x4a8c66=_0x4a8c66-0x0;var _0x55eeea=_0xe4ad[_0x4a8c66];return _0x55eeea;};'use strict';var _=require(_0xde4a('0x0'));var rp=require(_0xde4a('0x1'));var md5=require(_0xde4a('0x2'));var util=require(_0xde4a('0x3'));var Redis=require(_0xde4a('0x4'));var intUtil=require(_0xde4a('0x5'));var config=require(_0xde4a('0x6'));var logger=require(_0xde4a('0x7'))(_0xde4a('0x8'));config[_0xde4a('0x9')]=_['defaults'](config[_0xde4a('0x9')],{'host':_0xde4a('0xa'),'port':0x18eb});var io=require(_0xde4a('0xb'))(new Redis(config[_0xde4a('0x9')]));var headers={'Content-Type':_0xde4a('0xc'),'Accept':'application/json'};function emit(_0x1a7aa1,_0x4ca292,_0x2da5f4){io['to'](_0x1a7aa1)[_0xde4a('0xd')](_0x4ca292,_0x2da5f4);}function getTicket(_0x189a1f,_0x57aaf1,_0x34de38,_0x5add70,_0x18accc){logger[_0xde4a('0xe')](_0xde4a('0xf'));var _0x1c2d69=_[_0xde4a('0x10')]({'responder_id':_0x57aaf1['id'],'requester_id':_0x34de38['id'],'name':util[_0xde4a('0x11')](_0xde4a('0x12'),_0x18accc[_0xde4a('0x13')]),'phone':_0x18accc[_0xde4a('0x14')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xde4a('0x15')](_0x5add70[_0xde4a('0x16')],_0x18accc,'\x20'),'description':intUtil[_0xde4a('0x15')](_0x5add70['Descriptions'],_0x18accc,_0xde4a('0x17')),'tags':getTags(_0x5add70[_0xde4a('0x18')],_0xde4a('0x19'))},getCustomFields(_0x5add70[_0xde4a('0x1a')],_0x18accc));_0x1c2d69['custom_fields']=_[_0xde4a('0x1b')](_[_0xde4a('0x1c')](_0x1c2d69[_0xde4a('0x1d')],'id'),_0xde4a('0x1e'));return request({'uri':util[_0xde4a('0x11')]('%s/api/v2/tickets',_0x189a1f[_0xde4a('0x1f')]),'method':_0xde4a('0x20'),'body':_0x1c2d69})[_0xde4a('0x21')](function(_0x671f44){logger[_0xde4a('0xe')](_0xde4a('0x22'));return _0x671f44;});}function getUser(_0x4b0d22,_0x8e495c){if(intUtil[_0xde4a('0x23')](_0x8e495c)){return request({'uri':util[_0xde4a('0x11')](_0xde4a('0x24'),_0x4b0d22['remoteUri']),'qs':{'email':_0x8e495c}})[_0xde4a('0x21')](function(_0x3a149f){if(_0x3a149f[_0xde4a('0x25')]){logger[_0xde4a('0xe')](_0xde4a('0x26'));return _['find'](_0x3a149f,function(_0x7ae473){return _0x7ae473[_0xde4a('0x27')][_0xde4a('0x28')]===_0x8e495c;});}else{logger[_0xde4a('0xe')](_0xde4a('0x29'));return request({'uri':util[_0xde4a('0x11')](_0xde4a('0x2a'),_0x4b0d22['remoteUri'])})[_0xde4a('0x21')](function(_0x2ba5cc){logger[_0xde4a('0xe')](_0xde4a('0x2b'));return _0x2ba5cc;});}});}else{logger[_0xde4a('0xe')](_0xde4a('0x2c'));return request({'uri':util[_0xde4a('0x11')](_0xde4a('0x2a'),_0x4b0d22[_0xde4a('0x1f')])})[_0xde4a('0x21')](function(_0x4b0d1f){logger[_0xde4a('0xe')](_0xde4a('0x2b'));return _0x4b0d1f;});}}function getEndUser(_0x2ff271,_0x515836,_0x1f9866){logger[_0xde4a('0xe')](_0xde4a('0x2d'),_0x1f9866);return request({'uri':util[_0xde4a('0x11')](_0xde4a('0x2e'),_0x2ff271[_0xde4a('0x1f')]),'qs':{'phone':_0x1f9866}})[_0xde4a('0x21')](function(_0x10bc66){if(_0x10bc66[_0xde4a('0x25')]){logger[_0xde4a('0xe')](_0xde4a('0x2f'));return _['find'](_0x10bc66,{'phone':_0x1f9866});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xde4a('0x11')](_0xde4a('0x2e'),_0x2ff271[_0xde4a('0x1f')]),'method':'POST','body':{'name':_0x515836,'phone':_0x1f9866}})['then'](function(_0x2ed106){logger[_0xde4a('0xe')](_0xde4a('0x30'));return _0x2ed106;});}});}function getAuth(_0x172ca4){return util[_0xde4a('0x11')](_0xde4a('0x31'),new Buffer(_0x172ca4[_0xde4a('0x32')]+':X')[_0xde4a('0x33')](_0xde4a('0x34')));}function request(_0x2f8a55){logger[_0xde4a('0x35')](_0xde4a('0x36'),JSON[_0xde4a('0x37')](_0x2f8a55));return rp(_[_0xde4a('0x38')](_0x2f8a55,{'method':_0xde4a('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x29a419,_0x18929f){var _0x51729a=[];if(_0x29a419&&_0x29a419[_0xde4a('0x25')]>0x0){_0x51729a=_[_0xde4a('0x3a')](_0x29a419,_0x18929f);}return _0x51729a;}function getCustomFields(_0x1f645d,_0x470e16){var _0x3b6afa=[];var _0x154458={'custom_fields':[]};if(_0x1f645d[_0xde4a('0x25')]>0x0){_[_0xde4a('0x3b')](_0x1f645d,function(_0x1aaef3){if(_0x1aaef3['type']===_0xde4a('0x3c')&&_0x1aaef3['nameField']&&!_0x1aaef3['customField']){_0x154458[_0x1aaef3[_0xde4a('0x3d')]['toLowerCase']()]=_0x1aaef3[_0xde4a('0x3e')]['toString']();}else if(_0x1aaef3['type']===_0xde4a('0x3c')&&_0x1aaef3[_0xde4a('0x3f')]&&_0x1aaef3[_0xde4a('0x40')]){_0x154458[_0xde4a('0x1d')][_0xde4a('0x41')]({'id':_0x1aaef3[_0xde4a('0x3f')],'value':_0x1aaef3[_0xde4a('0x3e')][_0xde4a('0x33')]()});}else if(_0x1aaef3['type']==='variable'&&_0x1aaef3[_0xde4a('0x42')]&&_0x1aaef3['idField']&&_0x1aaef3[_0xde4a('0x40')]){_0x470e16[_0x1aaef3[_0xde4a('0x42')]]&&_0x154458['custom_fields']['push']({'id':_0x1aaef3['idField'],'value':_0x470e16[_0x1aaef3['variableName']][_0xde4a('0x33')]()});}else if(_0x1aaef3[_0xde4a('0x43')]===_0xde4a('0x44')&&_0x1aaef3[_0xde4a('0x45')]&&_0x1aaef3[_0xde4a('0x45')]['name']&&_0x1aaef3[_0xde4a('0x3f')]&&_0x1aaef3[_0xde4a('0x40')]){_0x470e16[_0x1aaef3[_0xde4a('0x45')][_0xde4a('0x19')][_0xde4a('0x46')]()]&&_0x154458[_0xde4a('0x1d')][_0xde4a('0x41')]({'id':_0x1aaef3['idField'],'value':_0x470e16[_0x1aaef3[_0xde4a('0x45')][_0xde4a('0x19')][_0xde4a('0x46')]()][_0xde4a('0x33')]()});}});}return _0x154458;}exports[_0xde4a('0x47')]=function(_0x5ab586,_0x4744bf,_0x30d657,_0x52ee01,_0x1b461b,_0x38f7e8){var _0x34004c,_0x1e2ecb;_0x38f7e8['remoteUri']=intUtil[_0xde4a('0x48')](_0x38f7e8[_0xde4a('0x1f')]);_0x38f7e8[_0xde4a('0x49')]=intUtil[_0xde4a('0x48')](_0x38f7e8[_0xde4a('0x49')]);if(_0x1b461b&&_0x1b461b[_0xde4a('0x4a')]){logger[_0xde4a('0xe')](_0xde4a('0x4b'),_0xde4a('0x4c'));_0x4744bf['recordingURL']=util[_0xde4a('0x11')](_0xde4a('0x4d'),_0x38f7e8[_0xde4a('0x49')],_0x4744bf[_0xde4a('0x4e')],md5(_0x4744bf[_0xde4a('0x4e')]));}else{_0x4744bf[_0xde4a('0x4f')]='';}headers[_0xde4a('0x50')]=getAuth(_0x38f7e8);return getUser(_0x38f7e8,_0x52ee01['email'])['then'](function(_0x46a0db){_0x34004c=_0x46a0db;logger['info'](_0xde4a('0x51'),_0x34004c['id']);return getEndUser(_0x38f7e8,_0x4744bf['calleridname'],_0x4744bf['calleridnum']);})['then'](function(_0x50f9c9){_0x1e2ecb=_0x50f9c9;logger['info'](_0xde4a('0x52'),_0x1e2ecb['id']);return getTicket(_0x38f7e8,_0x34004c,_0x1e2ecb,_0x30d657,_0x4744bf);})[_0xde4a('0x21')](function(_0x373fde){if(_0x373fde&&_0x373fde['id']){logger[_0xde4a('0xe')](_0xde4a('0x22'));logger[_0xde4a('0xe')](_0xde4a('0x53'),_0x373fde['id']);logger[_0xde4a('0xe')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x52ee01[_0xde4a('0x19')]),_0xde4a('0x54'),{'uri':util[_0xde4a('0x11')](_0xde4a('0x55'),_0x38f7e8['remoteUri'],_0x373fde['id'])});}})[_0xde4a('0x56')](function(_0x4791f2){logger[_0xde4a('0x57')]('[QUEUE]',JSON[_0xde4a('0x37')](_0x4791f2));});};exports[_0xde4a('0x58')]=function(_0x2470f1,_0xa338bd,_0x521a71,_0x2425ef,_0xbd91ec,_0x1ae71f,_0x439082){var _0x4ea7d8,_0x37d4ae;_0x1ae71f[_0xde4a('0x1f')]=intUtil[_0xde4a('0x48')](_0x1ae71f[_0xde4a('0x1f')]);_0x1ae71f['serverUrl']=intUtil[_0xde4a('0x48')](_0x1ae71f[_0xde4a('0x49')]);if(_0x439082&&_0x439082[_0xde4a('0x59')]&&_0x439082['recordingFormat']!==_0xde4a('0x5a')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0xa338bd['recordingURL']=util[_0xde4a('0x11')](_0xde4a('0x4d'),_0x1ae71f[_0xde4a('0x49')],_0xa338bd[_0xde4a('0x4e')],md5(_0xa338bd['uniqueid']));}headers['Authorization']=getAuth(_0x1ae71f);return getUser(_0x1ae71f,_0x2425ef['email'])[_0xde4a('0x21')](function(_0x48a000){_0x4ea7d8=_0x48a000;logger['info'](_0xde4a('0x51'),_0x4ea7d8['id']);return getEndUser(_0x1ae71f,_0xa338bd[_0xde4a('0x5b')],_0xa338bd[_0xde4a('0x5c')]);})[_0xde4a('0x21')](function(_0x23f529){_0x37d4ae=_0x23f529;logger['info'](_0xde4a('0x52'),_0x37d4ae['id']);return getTicket(_0x1ae71f,_0x4ea7d8,_0x37d4ae,_0x521a71,_0xa338bd);})['then'](function(_0x2d3d4d){if(_0x2d3d4d&&_0x2d3d4d['id']){logger['info'](_0xde4a('0x22'));logger[_0xde4a('0xe')](_0xde4a('0x53'),_0x2d3d4d['id']);logger[_0xde4a('0xe')](_0xde4a('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xde4a('0x11')](_0xde4a('0x5e'),_0x2425ef[_0xde4a('0x19')]),_0xde4a('0x54'),{'uri':util[_0xde4a('0x11')](_0xde4a('0x55'),_0x1ae71f[_0xde4a('0x1f')],_0x2d3d4d['id'])});}})[_0xde4a('0x56')](function(_0x1d19ba){logger['error'](_0xde4a('0x5d'),JSON[_0xde4a('0x37')](_0x1d19ba));});};exports[_0xde4a('0x5f')]=function(_0x5cd65d,_0x4ff323,_0x2ac14c,_0x45d2d0,_0x2a291b,_0x42b8ed){var _0x5dfc12,_0x4fbaf7;_0x42b8ed[_0xde4a('0x1f')]=intUtil['stripTrailingSlash'](_0x42b8ed[_0xde4a('0x1f')]);_0x42b8ed['serverUrl']=intUtil[_0xde4a('0x48')](_0x42b8ed['serverUrl']);if(_0x2a291b&&_0x2a291b[_0xde4a('0x4a')]){logger[_0xde4a('0xe')]('['+_0x4ff323[_0xde4a('0x60')][_0xde4a('0x61')]()+']','Recording\x20is\x20enabled!');_0x4ff323[_0xde4a('0x4f')]=util[_0xde4a('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x42b8ed[_0xde4a('0x49')],_0x4ff323[_0xde4a('0x4e')],md5(_0x4ff323[_0xde4a('0x4e')]));}else{_0x4ff323[_0xde4a('0x4f')]='';}headers[_0xde4a('0x50')]=getAuth(_0x42b8ed);return getUser(_0x42b8ed,'')['then'](function(_0x38a279){_0x5dfc12=_0x38a279;logger[_0xde4a('0xe')](_0xde4a('0x51'),_0x5dfc12['id']);return getEndUser(_0x42b8ed,_0x4ff323[_0xde4a('0x13')],_0x4ff323[_0xde4a('0x14')]);})['then'](function(_0x1a605b){_0x4fbaf7=_0x1a605b;logger[_0xde4a('0xe')]('The\x20Enduser\x20ID\x20is:',_0x4fbaf7['id']);return getTicket(_0x42b8ed,_0x5dfc12,_0x4fbaf7,_0x2ac14c,_0x4ff323);})[_0xde4a('0x21')](function(_0x31f5a8){if(_0x31f5a8){logger[_0xde4a('0xe')](_0xde4a('0x22'));logger[_0xde4a('0xe')]('The\x20Ticket\x20ID\x20is:',_0x31f5a8['id']);}})[_0xde4a('0x56')](function(_0x31e864){logger['error']('['+_0x4ff323[_0xde4a('0x60')][_0xde4a('0x61')]()+']',JSON[_0xde4a('0x37')](_0x31e864));});}; \ No newline at end of file +var _0x231a=['merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','POST','Ticket\x20created!','remoteUri','then','Agent\x20found!','find','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','[HTTP]','stringify','defaults','length','map','forEach','type','string','nameField','customField','content','idField','variable','variableName','push','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','catch','error','lastevent','toUpperCase','The\x20Ticket\x20ID\x20is:','lodash','request-promise','md5','ioredis','../../../../config/logger','redis','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...'];(function(_0xc74ca4,_0x25d4f6){var _0x2dbfe4=function(_0x304df4){while(--_0x304df4){_0xc74ca4['push'](_0xc74ca4['shift']());}};_0x2dbfe4(++_0x25d4f6);}(_0x231a,0x15a));var _0xa231=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x231a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xa231('0x0'));var rp=require(_0xa231('0x1'));var md5=require(_0xa231('0x2'));var util=require('util');var Redis=require(_0xa231('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xa231('0x4'))('freshdesk');config[_0xa231('0x5')]=_['defaults'](config[_0xa231('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xa231('0x6'))(new Redis(config[_0xa231('0x5')]));var headers={'Content-Type':_0xa231('0x7'),'Accept':'application/json'};function emit(_0x277df8,_0x3eb74c,_0x1abf5e){io['to'](_0x277df8)['emit'](_0x3eb74c,_0x1abf5e);}function getTicket(_0x44a108,_0x35bd1a,_0xeb51d2,_0x5f4b63,_0x4f559f){logger[_0xa231('0x8')](_0xa231('0x9'));var _0x58a106=_[_0xa231('0xa')]({'responder_id':_0x35bd1a['id'],'requester_id':_0xeb51d2['id'],'name':util[_0xa231('0xb')](_0xa231('0xc'),_0x4f559f[_0xa231('0xd')]),'phone':_0x4f559f[_0xa231('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xa231('0xf')](_0x5f4b63[_0xa231('0x10')],_0x4f559f,'\x20'),'description':intUtil[_0xa231('0xf')](_0x5f4b63[_0xa231('0x11')],_0x4f559f,_0xa231('0x12')),'tags':getTags(_0x5f4b63[_0xa231('0x13')],_0xa231('0x14'))},getCustomFields(_0x5f4b63[_0xa231('0x15')],_0x4f559f));_0x58a106[_0xa231('0x16')]=_[_0xa231('0x17')](_[_0xa231('0x18')](_0x58a106[_0xa231('0x16')],'id'),_0xa231('0x19'));return request({'uri':util[_0xa231('0xb')](_0xa231('0x1a'),_0x44a108['remoteUri']),'method':_0xa231('0x1b'),'body':_0x58a106})['then'](function(_0xb679a9){logger[_0xa231('0x8')](_0xa231('0x1c'));return _0xb679a9;});}function getUser(_0x49e70d,_0x4c2bc6){if(intUtil['validateEmail'](_0x4c2bc6)){return request({'uri':util[_0xa231('0xb')]('%s/api/v2/agents',_0x49e70d[_0xa231('0x1d')]),'qs':{'email':_0x4c2bc6}})[_0xa231('0x1e')](function(_0x27b0d8){if(_0x27b0d8['length']){logger[_0xa231('0x8')](_0xa231('0x1f'));return _[_0xa231('0x20')](_0x27b0d8,function(_0x1036c5){return _0x1036c5['contact'][_0xa231('0x21')]===_0x4c2bc6;});}else{logger[_0xa231('0x8')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xa231('0x22'),_0x49e70d['remoteUri'])})[_0xa231('0x1e')](function(_0x1dbcdb){logger[_0xa231('0x8')]('Admin\x20account\x20selected.');return _0x1dbcdb;});}});}else{logger[_0xa231('0x8')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa231('0xb')](_0xa231('0x22'),_0x49e70d['remoteUri'])})[_0xa231('0x1e')](function(_0x24df96){logger[_0xa231('0x8')](_0xa231('0x23'));return _0x24df96;});}}function getEndUser(_0x3c938b,_0x3bab0c,_0x4d910f){logger[_0xa231('0x8')](_0xa231('0x24'),_0x4d910f);return request({'uri':util[_0xa231('0xb')](_0xa231('0x25'),_0x3c938b[_0xa231('0x1d')]),'qs':{'phone':_0x4d910f}})[_0xa231('0x1e')](function(_0x5ed7aa){if(_0x5ed7aa['length']){logger[_0xa231('0x8')](_0xa231('0x26'));return _[_0xa231('0x20')](_0x5ed7aa,{'phone':_0x4d910f});}else{logger[_0xa231('0x8')](_0xa231('0x27'));return request({'uri':util[_0xa231('0xb')](_0xa231('0x25'),_0x3c938b[_0xa231('0x1d')]),'method':_0xa231('0x1b'),'body':{'name':_0x3bab0c,'phone':_0x4d910f}})[_0xa231('0x1e')](function(_0x4d2f46){logger['info'](_0xa231('0x28'));return _0x4d2f46;});}});}function getAuth(_0x170c8c){return util['format'](_0xa231('0x29'),new Buffer(_0x170c8c[_0xa231('0x2a')]+':X')[_0xa231('0x2b')]('base64'));}function request(_0x1cfe8c){logger['debug'](_0xa231('0x2c'),JSON[_0xa231('0x2d')](_0x1cfe8c));return rp(_[_0xa231('0x2e')](_0x1cfe8c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xb96dd0,_0x107cc9){var _0x31894d=[];if(_0xb96dd0&&_0xb96dd0[_0xa231('0x2f')]>0x0){_0x31894d=_[_0xa231('0x30')](_0xb96dd0,_0x107cc9);}return _0x31894d;}function getCustomFields(_0x29a2ee,_0x5ca87b){var _0x5461a0=[];var _0x127895={'custom_fields':[]};if(_0x29a2ee[_0xa231('0x2f')]>0x0){_[_0xa231('0x31')](_0x29a2ee,function(_0x5a8779){if(_0x5a8779[_0xa231('0x32')]===_0xa231('0x33')&&_0x5a8779[_0xa231('0x34')]&&!_0x5a8779[_0xa231('0x35')]){_0x127895[_0x5a8779['nameField']['toLowerCase']()]=_0x5a8779[_0xa231('0x36')][_0xa231('0x2b')]();}else if(_0x5a8779[_0xa231('0x32')]===_0xa231('0x33')&&_0x5a8779[_0xa231('0x37')]&&_0x5a8779[_0xa231('0x35')]){_0x127895[_0xa231('0x16')]['push']({'id':_0x5a8779['idField'],'value':_0x5a8779['content']['toString']()});}else if(_0x5a8779[_0xa231('0x32')]===_0xa231('0x38')&&_0x5a8779[_0xa231('0x39')]&&_0x5a8779[_0xa231('0x37')]&&_0x5a8779[_0xa231('0x35')]){_0x5ca87b[_0x5a8779[_0xa231('0x39')]]&&_0x127895['custom_fields'][_0xa231('0x3a')]({'id':_0x5a8779[_0xa231('0x37')],'value':_0x5ca87b[_0x5a8779[_0xa231('0x39')]][_0xa231('0x2b')]()});}else if(_0x5a8779[_0xa231('0x32')]===_0xa231('0x3b')&&_0x5a8779[_0xa231('0x3c')]&&_0x5a8779[_0xa231('0x3c')][_0xa231('0x14')]&&_0x5a8779['idField']&&_0x5a8779[_0xa231('0x35')]){_0x5ca87b[_0x5a8779[_0xa231('0x3c')]['name'][_0xa231('0x3d')]()]&&_0x127895[_0xa231('0x16')][_0xa231('0x3a')]({'id':_0x5a8779[_0xa231('0x37')],'value':_0x5ca87b[_0x5a8779['Variable']['name'][_0xa231('0x3d')]()][_0xa231('0x2b')]()});}});}return _0x127895;}exports[_0xa231('0x3e')]=function(_0x22f74e,_0x174696,_0x582436,_0xaa9ab4,_0x3bbf18,_0x286ec2){var _0x54c890,_0x57bdb0;_0x286ec2['remoteUri']=intUtil[_0xa231('0x3f')](_0x286ec2['remoteUri']);_0x286ec2['serverUrl']=intUtil[_0xa231('0x3f')](_0x286ec2[_0xa231('0x40')]);if(_0x3bbf18&&_0x3bbf18[_0xa231('0x41')]){logger[_0xa231('0x8')](_0xa231('0x42'),_0xa231('0x43'));_0x174696[_0xa231('0x44')]=util[_0xa231('0xb')](_0xa231('0x45'),_0x286ec2['serverUrl'],_0x174696[_0xa231('0x46')],md5(_0x174696['uniqueid']));}else{_0x174696[_0xa231('0x44')]='';}headers[_0xa231('0x47')]=getAuth(_0x286ec2);return getUser(_0x286ec2,_0xaa9ab4['email'])[_0xa231('0x1e')](function(_0x125b21){_0x54c890=_0x125b21;logger[_0xa231('0x8')]('The\x20User\x20ID\x20is:',_0x54c890['id']);return getEndUser(_0x286ec2,_0x174696['calleridname'],_0x174696['calleridnum']);})[_0xa231('0x1e')](function(_0x3131e9){_0x57bdb0=_0x3131e9;logger[_0xa231('0x8')](_0xa231('0x48'),_0x57bdb0['id']);return getTicket(_0x286ec2,_0x54c890,_0x57bdb0,_0x582436,_0x174696);})['then'](function(_0x2ad9b7){if(_0x2ad9b7&&_0x2ad9b7['id']){logger[_0xa231('0x8')]('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x2ad9b7['id']);logger[_0xa231('0x8')](_0xa231('0x42'),_0xa231('0x49'));emit(util['format'](_0xa231('0x4a'),_0xaa9ab4[_0xa231('0x14')]),_0xa231('0x4b'),{'uri':util['format'](_0xa231('0x4c'),_0x286ec2['remoteUri'],_0x2ad9b7['id'])});}})['catch'](function(_0x4965ee){logger['error'](_0xa231('0x42'),JSON[_0xa231('0x2d')](_0x4965ee));});};exports[_0xa231('0x4d')]=function(_0x680cd8,_0x562dba,_0x54fbfc,_0x160038,_0x2be5a0,_0x12b129,_0x2abddc){var _0x4de525,_0x213c0a;_0x12b129[_0xa231('0x1d')]=intUtil['stripTrailingSlash'](_0x12b129[_0xa231('0x1d')]);_0x12b129['serverUrl']=intUtil[_0xa231('0x3f')](_0x12b129[_0xa231('0x40')]);if(_0x2abddc&&_0x2abddc['recordingFormat']&&_0x2abddc[_0xa231('0x4e')]!==_0xa231('0x4f')){logger['info'](_0xa231('0x50'),_0xa231('0x43'));_0x562dba[_0xa231('0x44')]=util[_0xa231('0xb')](_0xa231('0x45'),_0x12b129[_0xa231('0x40')],_0x562dba[_0xa231('0x46')],md5(_0x562dba['uniqueid']));}headers[_0xa231('0x47')]=getAuth(_0x12b129);return getUser(_0x12b129,_0x160038[_0xa231('0x21')])[_0xa231('0x1e')](function(_0x45b977){_0x4de525=_0x45b977;logger['info'](_0xa231('0x51'),_0x4de525['id']);return getEndUser(_0x12b129,_0x562dba[_0xa231('0x52')],_0x562dba[_0xa231('0x53')]);})[_0xa231('0x1e')](function(_0x41ed37){_0x213c0a=_0x41ed37;logger[_0xa231('0x8')](_0xa231('0x48'),_0x213c0a['id']);return getTicket(_0x12b129,_0x4de525,_0x213c0a,_0x54fbfc,_0x562dba);})[_0xa231('0x1e')](function(_0x437799){if(_0x437799&&_0x437799['id']){logger[_0xa231('0x8')](_0xa231('0x1c'));logger[_0xa231('0x8')]('The\x20Ticket\x20ID\x20is:',_0x437799['id']);logger['info']('[OUTBOUND]',_0xa231('0x49'));emit(util[_0xa231('0xb')]('user:%s',_0x160038[_0xa231('0x14')]),_0xa231('0x4b'),{'uri':util[_0xa231('0xb')]('%s/helpdesk/tickets/%d',_0x12b129[_0xa231('0x1d')],_0x437799['id'])});}})[_0xa231('0x54')](function(_0x28ac85){logger[_0xa231('0x55')]('[OUTBOUND]',JSON['stringify'](_0x28ac85));});};exports['unmanaged']=function(_0x59f9f6,_0x8756cc,_0x1a7e2d,_0x4929c6,_0x420737,_0x2b1824){var _0x42c298,_0x2ab741;_0x2b1824[_0xa231('0x1d')]=intUtil['stripTrailingSlash'](_0x2b1824[_0xa231('0x1d')]);_0x2b1824[_0xa231('0x40')]=intUtil['stripTrailingSlash'](_0x2b1824[_0xa231('0x40')]);if(_0x420737&&_0x420737['monitor_format']){logger[_0xa231('0x8')]('['+_0x8756cc[_0xa231('0x56')][_0xa231('0x57')]()+']',_0xa231('0x43'));_0x8756cc[_0xa231('0x44')]=util[_0xa231('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b1824[_0xa231('0x40')],_0x8756cc[_0xa231('0x46')],md5(_0x8756cc[_0xa231('0x46')]));}else{_0x8756cc['recordingURL']='';}headers['Authorization']=getAuth(_0x2b1824);return getUser(_0x2b1824,'')[_0xa231('0x1e')](function(_0x3c9d93){_0x42c298=_0x3c9d93;logger[_0xa231('0x8')](_0xa231('0x51'),_0x42c298['id']);return getEndUser(_0x2b1824,_0x8756cc[_0xa231('0xd')],_0x8756cc[_0xa231('0xe')]);})[_0xa231('0x1e')](function(_0x7b76f8){_0x2ab741=_0x7b76f8;logger[_0xa231('0x8')](_0xa231('0x48'),_0x2ab741['id']);return getTicket(_0x2b1824,_0x42c298,_0x2ab741,_0x1a7e2d,_0x8756cc);})[_0xa231('0x1e')](function(_0x2947ab){if(_0x2947ab){logger[_0xa231('0x8')]('Ticket\x20created!');logger[_0xa231('0x8')](_0xa231('0x58'),_0x2947ab['id']);}})[_0xa231('0x54')](function(_0xd75315){logger[_0xa231('0x55')]('['+_0x8756cc[_0xa231('0x56')]['toUpperCase']()+']',JSON[_0xa231('0x2d')](_0xd75315));});}; \ 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 dc4b221..c00558f 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 _0xe0c5=['Getting\x20admin\x20information','then','users','length','adminId','info','error','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','User\x20found:','userId','Admin\x20selected','adminEmail','Requested\x20Resource\x20not\x20Found','Getting\x20contacts\x20filter','filters','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts','find','work_number','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','/api/contacts','format','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','catch','Creating\x20new\x20task','POST','/api/tasks','Contact','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','remoteUri','serverUrl','username','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','../../../../config/environment','freshsales','redis','defaults','GET','/api/selector/owners','headers'];(function(_0x172632,_0xe78590){var _0x1c6e1e=function(_0x126e9b){while(--_0x126e9b){_0x172632['push'](_0x172632['shift']());}};_0x1c6e1e(++_0xe78590);}(_0xe0c5,0x98));var _0x5e0c=function(_0x26d9a8,_0x4b92c3){_0x26d9a8=_0x26d9a8-0x0;var _0x1533f6=_0xe0c5[_0x26d9a8];return _0x1533f6;};'use strict';var _=require(_0x5e0c('0x0'));var rp=require(_0x5e0c('0x1'));var md5=require(_0x5e0c('0x2'));var util=require(_0x5e0c('0x3'));var moment=require(_0x5e0c('0x4'));var Promise=require(_0x5e0c('0x5'));var Redis=require(_0x5e0c('0x6'));var intUtil=require('./util');var config=require(_0x5e0c('0x7'));var logger=require('../../../../config/logger')(_0x5e0c('0x8'));config[_0x5e0c('0x9')]=_[_0x5e0c('0xa')](config[_0x5e0c('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5e0c('0x9')]));function getAdminId(_0x90dfa3,_0x284adc,_0x22e80e,_0x43cffd){return new Promise(function(_0x3da310,_0x32e4ae){var _0x2a81de=![];var _0xf61c18={'method':_0x5e0c('0xb'),'uri':_0x43cffd+_0x5e0c('0xc'),'json':!![]};_0xf61c18[_0x5e0c('0xd')]=_0x22e80e;logger['info'](_0x5e0c('0xe'));return rp(_0xf61c18)[_0x5e0c('0xf')](function(_0x115351){if(_0x115351){var _0x15a1ff=_0x115351[_0x5e0c('0x10')];var _0x1eb1b7=null;for(_0x1eb1b7=0x0;_0x1eb1b7<_0x15a1ff[_0x5e0c('0x11')];_0x1eb1b7++){if(_0x15a1ff[_0x1eb1b7]['email']===_0x90dfa3['adminEmail']){_0x90dfa3[_0x5e0c('0x12')]=_0x15a1ff[_0x1eb1b7]['id'];_0x2a81de=!![];}}if(_0x2a81de){logger[_0x5e0c('0x13')]('Admin\x20found:',_0x90dfa3[_0x5e0c('0x12')]);_0x3da310(_0x90dfa3);}else{_0x32e4ae({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x32e4ae({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})['catch'](function(_0x374f68){logger[_0x5e0c('0x14')]('['+[_0x284adc[_0x5e0c('0x15')]()]+']',_0x374f68[_0x5e0c('0x16')]);_0x32e4ae(_0x374f68);});});}function getUser(_0x206d7b,_0x370fc3,_0x55caa9){return function(_0x23a59a){return new Promise(function(_0x1fe792,_0x3b6a04){var _0x40f1cd={'method':_0x5e0c('0xb'),'uri':_0x55caa9+_0x5e0c('0xc'),'json':!![]};_0x40f1cd['headers']=_0x370fc3;logger['info']('Getting\x20user\x20list');return rp(_0x40f1cd)[_0x5e0c('0xf')](function(_0x272581){if(_0x272581){var _0x270404=_0x272581[_0x5e0c('0x10')];var _0x1b49e8=![];var _0x56842a=null;if(_0x23a59a[_0x5e0c('0x17')]!==null){logger['info'](_0x5e0c('0x18'),_0x23a59a['agentEmail']);_0x23a59a[_0x5e0c('0x19')]=_0x23a59a[_0x5e0c('0x17')];for(_0x56842a=0x0;_0x56842a<_0x270404[_0x5e0c('0x11')];_0x56842a++){if(_0x270404[_0x56842a][_0x5e0c('0x1a')]===_0x23a59a[_0x5e0c('0x17')]){_0x1b49e8=!![];_0x23a59a['userId']=_0x270404[_0x56842a]['id'];logger[_0x5e0c('0x13')](_0x5e0c('0x1b'),_0x23a59a[_0x5e0c('0x1c')]);}}}if(!_0x1b49e8){logger[_0x5e0c('0x13')](_0x5e0c('0x1d'));_0x23a59a['userEmail']=_0x23a59a[_0x5e0c('0x1e')];_0x23a59a[_0x5e0c('0x1c')]=_0x23a59a[_0x5e0c('0x12')];_0x1b49e8=!![];}if(_0x1b49e8){_0x1fe792(_0x23a59a);}else{_0x3b6a04({'statusCode':0x194,'message':_0x5e0c('0x1f')});}}else{_0x3b6a04({'statusCode':0x194,'message':_0x5e0c('0x1f')});}})['catch'](function(_0x4bfd90){logger['error']('['+[_0x206d7b['toUpperCase']()]+']',_0x4bfd90['message']);_0x3b6a04(_0x4bfd90);});});};}function getEndUser(_0x14b316,_0x19cead,_0xabe577){return function(_0x483241){return new Promise(function(_0x163af0,_0x3a5cc9){var _0x2c5e27=0x0;var _0x3be293={'method':_0x5e0c('0xb'),'uri':_0xabe577+'/api/contacts/filters','json':!![]};_0x3be293[_0x5e0c('0xd')]=_0x19cead;logger['info'](_0x5e0c('0x20'));return rp(_0x3be293)['then'](function(_0x383349){_0x383349[_0x5e0c('0x21')]['forEach'](function(_0x488852){if(_0x488852['name']==='All\x20Contacts'){_0x2c5e27=_0x488852['id'];}});})['then'](function(){logger[_0x5e0c('0x13')](_0x5e0c('0x22'));var _0x2ff0c7={'method':_0x5e0c('0xb'),'uri':_0xabe577+_0x5e0c('0x23')+_0x2c5e27,'json':!![]};_0x2ff0c7['headers']=_0x19cead;return rp(_0x2ff0c7);})[_0x5e0c('0xf')](function(_0x52dda1){logger[_0x5e0c('0x13')](_0x5e0c('0x24'),_0x483241[_0x5e0c('0x25')]);if(_0x52dda1[_0x5e0c('0x26')][_0x5e0c('0x11')]>0x0){var _0x4ba796=_[_0x5e0c('0x27')](_0x52dda1[_0x5e0c('0x26')],function(_0x51f0be){if(_0x51f0be[_0x5e0c('0x28')]===_0x483241[_0x5e0c('0x25')]||_0x51f0be[_0x5e0c('0x29')]===_0x483241[_0x5e0c('0x25')]){return _0x51f0be;}});if(_0x4ba796){_0x483241[_0x5e0c('0x2a')]=_0x4ba796['id'];logger['info'](_0x5e0c('0x2b'),_0x483241[_0x5e0c('0x2a')]);_0x163af0(_0x483241);}else{return createEndUser(_0x483241,_0x14b316,_0x19cead,_0xabe577)[_0x5e0c('0xf')](function(_0x5cb2c1){logger[_0x5e0c('0x13')]('Contact\x20created:',_0x483241[_0x5e0c('0x2a')]);_0x163af0(_0x5cb2c1);});}}else{return createEndUser(_0x483241,_0x14b316,_0x19cead,_0xabe577)[_0x5e0c('0xf')](function(_0x47fcf3){logger[_0x5e0c('0x13')](_0x5e0c('0x2c'),_0x483241[_0x5e0c('0x2a')]);_0x163af0(_0x47fcf3);});}})['catch'](function(_0x40baa3){throw new Error(_0x40baa3[_0x5e0c('0x16')]);});});};}function createEndUser(_0x185be1,_0x19b3fc,_0x1a90a3,_0x159031){return new Promise(function(_0x186d83,_0x1ef314){var _0x50f49e=moment();var _0x4db416={'method':'POST','uri':_0x159031+_0x5e0c('0x2d'),'body':{'contact':{'last_name':_0x185be1[_0x5e0c('0x25')],'work_number':_0x185be1['contactNumber'],'mobile_number':_0x185be1[_0x5e0c('0x25')],'owner_id':_0x185be1['userId'],'created_at':_0x50f49e[_0x5e0c('0x2e')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x4db416['headers']=_0x1a90a3;logger[_0x5e0c('0x13')](_0x5e0c('0x2f'));return rp(_0x4db416)[_0x5e0c('0xf')](function(_0x233295){_0x185be1[_0x5e0c('0x2a')]=_0x233295[_0x5e0c('0x30')]['id'];_0x186d83(_0x185be1);})[_0x5e0c('0x31')](function(_0x508a7e){logger[_0x5e0c('0x14')]('['+[_0x19b3fc[_0x5e0c('0x15')]()]+']',_0x508a7e['message']);_0x1ef314(_0x508a7e[_0x5e0c('0x16')]);});});}function getTicket(_0x39c6ce,_0x4b872c,_0x36a729,_0x1dd7e5,_0x56beb0){return function(_0x2503f6){logger[_0x5e0c('0x13')](_0x5e0c('0x32'));return new Promise(function(_0x12c0a1,_0x132a5b){var _0x10d9bd=moment();var _0x75a261={'method':_0x5e0c('0x33'),'uri':_0x36a729+_0x5e0c('0x34'),'body':{'title':intUtil['getString'](_0x1dd7e5['Subjects'],_0x56beb0,'\x20'),'description':intUtil['getString'](_0x1dd7e5['Descriptions'],_0x56beb0,'\x0a'),'owner_id':_0x2503f6['userId'],'creater_id':_0x2503f6[_0x5e0c('0x12')],'targetable_id':_0x2503f6[_0x5e0c('0x2a')],'targetable_type':_0x5e0c('0x35'),'created_at':_0x10d9bd[_0x5e0c('0x2e')](_0x5e0c('0x36')),'due_date':_0x10d9bd[_0x5e0c('0x37')](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x75a261[_0x5e0c('0xd')]=_0x4b872c;return rp(_0x75a261)[_0x5e0c('0xf')](function(_0x47a2d5){_0x2503f6[_0x5e0c('0x38')]=_0x47a2d5[_0x5e0c('0x39')]['id'];logger[_0x5e0c('0x13')](_0x5e0c('0x3a'),_0x2503f6[_0x5e0c('0x38')]);_0x12c0a1(_0x2503f6);})[_0x5e0c('0x31')](function(_0x5ed86d){logger['error']('['+[_0x39c6ce['toUpperCase']()]+']',_0x5ed86d[_0x5e0c('0x16')]);_0x132a5b(_0x5ed86d['message']);});});};}function emit(_0x52477d,_0x5bd685,_0x3a19f7){var _0x446879={'uri':_0x52477d+_0x5e0c('0x3b')+_0x3a19f7};io['to'](util[_0x5e0c('0x2e')]('user:%s',_0x5bd685))[_0x5e0c('0x3c')](_0x5e0c('0x3d'),_0x446879);}exports['cs']=function(_0x3077ee,_0x19a912,_0x303369,_0x8f323c,_0x559296,_0x227158,_0x3ac1ab,_0x169ee8){var _0x1818fa={};var _0xde33f6={'Authorization':_0x5e0c('0x3e')+_0x227158['apiKey']};_0x227158[_0x5e0c('0x3f')]=intUtil['stripTrailingSlash'](_0x227158[_0x5e0c('0x3f')]);_0x227158[_0x5e0c('0x40')]=intUtil['stripTrailingSlash'](_0x227158['serverUrl']);var _0x3a93be=_0x227158[_0x5e0c('0x3f')];_0x1818fa[_0x5e0c('0x1e')]=_0x227158[_0x5e0c('0x41')];_0x1818fa[_0x5e0c('0x25')]=_0x169ee8['toLowerCase']()==='outbound'?_0x19a912[_0x5e0c('0x42')]:_0x19a912[_0x5e0c('0x43')];_0x1818fa[_0x5e0c('0x44')]=_0x169ee8===_0x5e0c('0x45')||_0x169ee8===_0x5e0c('0x46')?_0x5e0c('0x45'):_0x5e0c('0x47');if(_0x8f323c){_0x1818fa[_0x5e0c('0x17')]=_0x8f323c[_0x5e0c('0x1a')];}var _0x31e740=util[_0x5e0c('0x2e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x227158[_0x5e0c('0x40')],_0x19a912[_0x5e0c('0x48')],md5(_0x19a912[_0x5e0c('0x48')]));if(_0x559296&&_0x559296[_0x5e0c('0x49')]){logger[_0x5e0c('0x13')](_0x5e0c('0x4a'),_0x5e0c('0x4b'));_0x19a912[_0x5e0c('0x4c')]=_0x31e740;}else if(_0x3ac1ab&&_0x3ac1ab[_0x5e0c('0x4d')]&&_0x3ac1ab[_0x5e0c('0x4d')]!==_0x5e0c('0x4e')){logger[_0x5e0c('0x13')](_0x5e0c('0x4f'),_0x5e0c('0x4b'));_0x19a912[_0x5e0c('0x4c')]=_0x31e740;}else{_0x19a912[_0x5e0c('0x4c')]='';}return getAdminId(_0x1818fa,_0x169ee8,_0xde33f6,_0x3a93be)[_0x5e0c('0xf')](getUser(_0x169ee8,_0xde33f6,_0x3a93be))[_0x5e0c('0xf')](getEndUser(_0x169ee8,_0xde33f6,_0x3a93be))[_0x5e0c('0xf')](getTicket(_0x169ee8,_0xde33f6,_0x3a93be,_0x303369,_0x19a912))[_0x5e0c('0xf')](function(_0x2dab00){logger[_0x5e0c('0x13')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x2dab00[_0x5e0c('0x38')]));if(_0x169ee8!==_0x5e0c('0x46')){logger[_0x5e0c('0x13')]('['+[_0x169ee8['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x3a93be,_0x8f323c[_0x5e0c('0x50')],_0x2dab00[_0x5e0c('0x2a')]);}})[_0x5e0c('0x31')](function(_0x129fe0){logger[_0x5e0c('0x14')]('['+[_0x169ee8[_0x5e0c('0x15')]()]+_0x5e0c('0x51'),util[_0x5e0c('0x52')](_0x129fe0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x693c=['queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','request-promise','md5','moment','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list','Getting\x20user\x20with\x20email','agentEmail','userId','Admin\x20selected','userEmail','toUpperCase','Getting\x20contacts\x20filter','filters','forEach','name','Getting\x20contact\x20list','Searching\x20contact\x20with\x20phone','contactNumber','find','contacts','work_number','Contact\x20found:','endUserId','Contact\x20created:','POST','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','Contact','add','ticketId','task','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','calleridnum'];(function(_0x98655f,_0x23020d){var _0x4b94aa=function(_0x5ee00d){while(--_0x5ee00d){_0x98655f['push'](_0x98655f['shift']());}};_0x4b94aa(++_0x23020d);}(_0x693c,0xb1));var _0xc693=function(_0x243990,_0x2b24fa){_0x243990=_0x243990-0x0;var _0x3af017=_0x693c[_0x243990];return _0x3af017;};'use strict';var _=require('lodash');var rp=require(_0xc693('0x0'));var md5=require(_0xc693('0x1'));var util=require('util');var moment=require(_0xc693('0x2'));var Promise=require(_0xc693('0x3'));var Redis=require(_0xc693('0x4'));var intUtil=require(_0xc693('0x5'));var config=require(_0xc693('0x6'));var logger=require('../../../../config/logger')(_0xc693('0x7'));config[_0xc693('0x8')]=_[_0xc693('0x9')](config[_0xc693('0x8')],{'host':_0xc693('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x5c822f,_0x145c6a,_0x1b8d6a,_0x40baf6){return new Promise(function(_0x4d9483,_0x25c150){var _0x6bc04d=![];var _0x5eba4e={'method':_0xc693('0xb'),'uri':_0x40baf6+_0xc693('0xc'),'json':!![]};_0x5eba4e[_0xc693('0xd')]=_0x1b8d6a;logger[_0xc693('0xe')](_0xc693('0xf'));return rp(_0x5eba4e)[_0xc693('0x10')](function(_0x38553d){if(_0x38553d){var _0x16e444=_0x38553d[_0xc693('0x11')];var _0x597288=null;for(_0x597288=0x0;_0x597288<_0x16e444[_0xc693('0x12')];_0x597288++){if(_0x16e444[_0x597288][_0xc693('0x13')]===_0x5c822f[_0xc693('0x14')]){_0x5c822f['adminId']=_0x16e444[_0x597288]['id'];_0x6bc04d=!![];}}if(_0x6bc04d){logger[_0xc693('0xe')]('Admin\x20found:',_0x5c822f[_0xc693('0x15')]);_0x4d9483(_0x5c822f);}else{_0x25c150({'statusCode':0x194,'message':_0xc693('0x16')});}}else{_0x25c150({'statusCode':0x194,'message':_0xc693('0x16')});}})[_0xc693('0x17')](function(_0x557e58){logger[_0xc693('0x18')]('['+[_0x145c6a['toUpperCase']()]+']',_0x557e58[_0xc693('0x19')]);_0x25c150(_0x557e58);});});}function getUser(_0x10521f,_0x3e22dd,_0x244140){return function(_0x17f0c8){return new Promise(function(_0x41584c,_0x7d8c58){var _0x5db4b4={'method':_0xc693('0xb'),'uri':_0x244140+'/api/selector/owners','json':!![]};_0x5db4b4['headers']=_0x3e22dd;logger[_0xc693('0xe')](_0xc693('0x1a'));return rp(_0x5db4b4)['then'](function(_0x1045a0){if(_0x1045a0){var _0x113741=_0x1045a0[_0xc693('0x11')];var _0x5f0429=![];var _0x39c102=null;if(_0x17f0c8['agentEmail']!==null){logger[_0xc693('0xe')](_0xc693('0x1b'),_0x17f0c8['agentEmail']);_0x17f0c8['userEmail']=_0x17f0c8[_0xc693('0x1c')];for(_0x39c102=0x0;_0x39c102<_0x113741[_0xc693('0x12')];_0x39c102++){if(_0x113741[_0x39c102]['email']===_0x17f0c8[_0xc693('0x1c')]){_0x5f0429=!![];_0x17f0c8[_0xc693('0x1d')]=_0x113741[_0x39c102]['id'];logger[_0xc693('0xe')]('User\x20found:',_0x17f0c8[_0xc693('0x1d')]);}}}if(!_0x5f0429){logger['info'](_0xc693('0x1e'));_0x17f0c8[_0xc693('0x1f')]=_0x17f0c8[_0xc693('0x14')];_0x17f0c8['userId']=_0x17f0c8['adminId'];_0x5f0429=!![];}if(_0x5f0429){_0x41584c(_0x17f0c8);}else{_0x7d8c58({'statusCode':0x194,'message':_0xc693('0x16')});}}else{_0x7d8c58({'statusCode':0x194,'message':_0xc693('0x16')});}})[_0xc693('0x17')](function(_0x5ed470){logger[_0xc693('0x18')]('['+[_0x10521f[_0xc693('0x20')]()]+']',_0x5ed470[_0xc693('0x19')]);_0x7d8c58(_0x5ed470);});});};}function getEndUser(_0x589055,_0x23cf77,_0x2acb94){return function(_0xc6546e){return new Promise(function(_0x193804,_0x519369){var _0x379348=0x0;var _0x981c57={'method':_0xc693('0xb'),'uri':_0x2acb94+'/api/contacts/filters','json':!![]};_0x981c57[_0xc693('0xd')]=_0x23cf77;logger[_0xc693('0xe')](_0xc693('0x21'));return rp(_0x981c57)['then'](function(_0x153013){_0x153013[_0xc693('0x22')][_0xc693('0x23')](function(_0x5a25d3){if(_0x5a25d3[_0xc693('0x24')]==='All\x20Contacts'){_0x379348=_0x5a25d3['id'];}});})['then'](function(){logger['info'](_0xc693('0x25'));var _0x30b388={'method':'GET','uri':_0x2acb94+'/api/contacts/view/'+_0x379348,'json':!![]};_0x30b388[_0xc693('0xd')]=_0x23cf77;return rp(_0x30b388);})['then'](function(_0x5ddfde){logger[_0xc693('0xe')](_0xc693('0x26'),_0xc6546e[_0xc693('0x27')]);if(_0x5ddfde['contacts'][_0xc693('0x12')]>0x0){var _0x6fa81=_[_0xc693('0x28')](_0x5ddfde[_0xc693('0x29')],function(_0x472b86){if(_0x472b86[_0xc693('0x2a')]===_0xc6546e[_0xc693('0x27')]||_0x472b86['mobile_number']===_0xc6546e[_0xc693('0x27')]){return _0x472b86;}});if(_0x6fa81){_0xc6546e['endUserId']=_0x6fa81['id'];logger[_0xc693('0xe')](_0xc693('0x2b'),_0xc6546e[_0xc693('0x2c')]);_0x193804(_0xc6546e);}else{return createEndUser(_0xc6546e,_0x589055,_0x23cf77,_0x2acb94)[_0xc693('0x10')](function(_0x338e65){logger[_0xc693('0xe')](_0xc693('0x2d'),_0xc6546e[_0xc693('0x2c')]);_0x193804(_0x338e65);});}}else{return createEndUser(_0xc6546e,_0x589055,_0x23cf77,_0x2acb94)['then'](function(_0x1a391d){logger['info'](_0xc693('0x2d'),_0xc6546e['endUserId']);_0x193804(_0x1a391d);});}})[_0xc693('0x17')](function(_0x4fdae2){throw new Error(_0x4fdae2['message']);});});};}function createEndUser(_0x4b79bb,_0x4793d3,_0x43db84,_0x44d4b6){return new Promise(function(_0x526c18,_0x4a1ce6){var _0x299119=moment();var _0x3cb3fb={'method':_0xc693('0x2e'),'uri':_0x44d4b6+'/api/contacts','body':{'contact':{'last_name':_0x4b79bb['contactNumber'],'work_number':_0x4b79bb[_0xc693('0x27')],'mobile_number':_0x4b79bb[_0xc693('0x27')],'owner_id':_0x4b79bb[_0xc693('0x1d')],'created_at':_0x299119[_0xc693('0x2f')](_0xc693('0x30'))}},'json':!![]};_0x3cb3fb['headers']=_0x43db84;logger['info'](_0xc693('0x31'));return rp(_0x3cb3fb)['then'](function(_0x246ff3){_0x4b79bb[_0xc693('0x2c')]=_0x246ff3['contact']['id'];_0x526c18(_0x4b79bb);})[_0xc693('0x17')](function(_0x5e0d9d){logger[_0xc693('0x18')]('['+[_0x4793d3[_0xc693('0x20')]()]+']',_0x5e0d9d[_0xc693('0x19')]);_0x4a1ce6(_0x5e0d9d['message']);});});}function getTicket(_0x5d3fd8,_0x6b9923,_0x13d85c,_0x1d9776,_0x237b52){return function(_0x51fb3c){logger['info'](_0xc693('0x32'));return new Promise(function(_0x3d3c66,_0x194dab){var _0x1a458d=moment();var _0x3b1d8d={'method':_0xc693('0x2e'),'uri':_0x13d85c+_0xc693('0x33'),'body':{'title':intUtil[_0xc693('0x34')](_0x1d9776['Subjects'],_0x237b52,'\x20'),'description':intUtil['getString'](_0x1d9776[_0xc693('0x35')],_0x237b52,'\x0a'),'owner_id':_0x51fb3c['userId'],'creater_id':_0x51fb3c[_0xc693('0x15')],'targetable_id':_0x51fb3c['endUserId'],'targetable_type':_0xc693('0x36'),'created_at':_0x1a458d['format'](_0xc693('0x30')),'due_date':_0x1a458d[_0xc693('0x37')](0x1e,'m')[_0xc693('0x2f')](_0xc693('0x30'))},'json':!![]};_0x3b1d8d[_0xc693('0xd')]=_0x6b9923;return rp(_0x3b1d8d)[_0xc693('0x10')](function(_0x1f9e84){_0x51fb3c[_0xc693('0x38')]=_0x1f9e84[_0xc693('0x39')]['id'];logger['info']('Task\x20created:',_0x51fb3c[_0xc693('0x38')]);_0x3d3c66(_0x51fb3c);})[_0xc693('0x17')](function(_0x5907c1){logger[_0xc693('0x18')]('['+[_0x5d3fd8[_0xc693('0x20')]()]+']',_0x5907c1[_0xc693('0x19')]);_0x194dab(_0x5907c1['message']);});});};}function emit(_0xc52cd2,_0x22f7bf,_0x67ac63){var _0x523018={'uri':_0xc52cd2+_0xc693('0x3a')+_0x67ac63};io['to'](util['format'](_0xc693('0x3b'),_0x22f7bf))[_0xc693('0x3c')]('trigger:browser:url',_0x523018);}exports['cs']=function(_0x126a95,_0x28f953,_0x2d38d5,_0x2bd756,_0x5b785e,_0x4d2ffa,_0x103c2b,_0x414bee){var _0x34bbcf={};var _0xafe33b={'Authorization':_0xc693('0x3d')+_0x4d2ffa[_0xc693('0x3e')]};_0x4d2ffa[_0xc693('0x3f')]=intUtil[_0xc693('0x40')](_0x4d2ffa['remoteUri']);_0x4d2ffa[_0xc693('0x41')]=intUtil['stripTrailingSlash'](_0x4d2ffa[_0xc693('0x41')]);var _0x4b899f=_0x4d2ffa[_0xc693('0x3f')];_0x34bbcf[_0xc693('0x14')]=_0x4d2ffa[_0xc693('0x42')];_0x34bbcf[_0xc693('0x27')]=_0x414bee[_0xc693('0x43')]()==='outbound'?_0x28f953['destcalleridnum']:_0x28f953[_0xc693('0x44')];_0x34bbcf['callDirection']=_0x414bee===_0xc693('0x45')||_0x414bee===_0xc693('0x46')?_0xc693('0x45'):_0xc693('0x47');if(_0x2bd756){_0x34bbcf['agentEmail']=_0x2bd756['email'];}var _0x57ae06=util[_0xc693('0x2f')](_0xc693('0x48'),_0x4d2ffa['serverUrl'],_0x28f953[_0xc693('0x49')],md5(_0x28f953['uniqueid']));if(_0x5b785e&&_0x5b785e[_0xc693('0x4a')]){logger[_0xc693('0xe')](_0xc693('0x4b'),'Recording\x20is\x20enabled!');_0x28f953[_0xc693('0x4c')]=_0x57ae06;}else if(_0x103c2b&&_0x103c2b[_0xc693('0x4d')]&&_0x103c2b[_0xc693('0x4d')]!=='none'){logger[_0xc693('0xe')]('[OUTBOUND]',_0xc693('0x4e'));_0x28f953['recordingURL']=_0x57ae06;}else{_0x28f953[_0xc693('0x4c')]='';}return getAdminId(_0x34bbcf,_0x414bee,_0xafe33b,_0x4b899f)[_0xc693('0x10')](getUser(_0x414bee,_0xafe33b,_0x4b899f))[_0xc693('0x10')](getEndUser(_0x414bee,_0xafe33b,_0x4b899f))[_0xc693('0x10')](getTicket(_0x414bee,_0xafe33b,_0x4b899f,_0x2d38d5,_0x28f953))[_0xc693('0x10')](function(_0x2587c1){logger[_0xc693('0xe')](util[_0xc693('0x2f')](_0xc693('0x4f'),_0x2587c1[_0xc693('0x38')]));if(_0x414bee!=='unmanaged'){logger['info']('['+[_0x414bee[_0xc693('0x20')]()]+']',_0xc693('0x50'));emit(_0x4b899f,_0x2bd756['name'],_0x2587c1['endUserId']);}})[_0xc693('0x17')](function(_0x414aab){logger[_0xc693('0x18')]('['+[_0x414bee[_0xc693('0x20')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xc693('0x51')](_0x414aab,{'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 429fefb..8800056 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 _0x34b7=['desk','vtiger','exec','includes','data1','toLowerCase','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','freshsales','servicenow','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','data2','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x34b7,0x196));var _0x734b=function(_0x5332b1,_0x192941){_0x5332b1=_0x5332b1-0x0;var _0x129b49=_0x34b7[_0x5332b1];return _0x129b49;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require(_0x734b('0x0'));var salesforce=require(_0x734b('0x1'));var sugarcrm=require(_0x734b('0x2'));var freshdesk=require(_0x734b('0x3'));var zoho=require(_0x734b('0x4'));var desk=require(_0x734b('0x5'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require(_0x734b('0x6'));var freshsales=require(_0x734b('0x7'));var integrations=[_0x734b('0x8'),_0x734b('0x9'),_0x734b('0xa'),_0x734b('0xb'),'zoho',_0x734b('0xc'),_0x734b('0xd'),'dynamics365','freshsales','servicenow'];exports[_0x734b('0xe')]=function(_0x598dee,_0x43c5e0,_0x333738,_0x2860a2,_0x222dc7,_0x3a442b){if(_0x333738){if(_[_0x734b('0xf')](integrations,_0x598dee[_0x734b('0x10')][_0x734b('0x11')]())){try{var _0x257657=null;var _0x1e0fca='';var _0x189a82=_0x333738[_0x598dee[_0x734b('0x10')][_0x734b('0x11')]()];if(_0x189a82){var _0x1c893d=_0x189a82[_0x598dee['data2']];if(_0x1c893d){var _0x18fc18=_[_0x734b('0x12')](_0x1c893d[_0x734b('0x13')],{'id':parseInt(_0x598dee[_0x734b('0x14')],0xa)});if(_0x18fc18){if(_0x2860a2){if(_0x222dc7&&_0x43c5e0[_0x734b('0x15')]){_0x1e0fca=_0x734b('0x15');}else if(_0x43c5e0[_0x734b('0x16')]){_0x1e0fca=_0x734b('0x17');}else{console[_0x734b('0x18')](_0x734b('0x19'),_0x43c5e0);}}else{_0x1e0fca=_0x734b('0x1a');}switch(_0x598dee['data1'][_0x734b('0x11')]()){case _0x734b('0x8'):zendesk[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case _0x734b('0x9'):salesforce[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case _0x734b('0xa'):sugarcrm[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case'freshdesk':freshdesk[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case'zoho':zoho[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case _0x734b('0xc'):desk[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case _0x734b('0xd'):vtiger[_0x1e0fca](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b);break;case _0x734b('0x1b'):freshsales['cs'](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b,_0x1e0fca);break;case _0x734b('0x1c'):servicenow['cs'](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b,_0x1e0fca);break;case _0x734b('0x1d'):dynamics365['cs'](_0x598dee,_0x43c5e0,_0x18fc18,_0x2860a2,_0x222dc7,_0x1c893d,_0x3a442b,_0x1e0fca);break;default:console[_0x734b('0x18')](_0x734b('0x1e'));}}else{_0x257657=require(_0x734b('0x1f'))(_0x598dee[_0x734b('0x10')][_0x734b('0x11')]());_0x257657[_0x734b('0x20')](_0x734b('0x21'),util[_0x734b('0x22')](_0x734b('0x23'),_0x598dee['data1'][_0x734b('0x11')](),_0x598dee[_0x734b('0x14')]));}}else{_0x257657=require('../../../../config/logger')(_0x598dee[_0x734b('0x10')][_0x734b('0x11')]());_0x257657[_0x734b('0x20')](_0x734b('0x21'),util[_0x734b('0x22')](_0x734b('0x24'),_0x598dee[_0x734b('0x10')][_0x734b('0x11')](),_0x598dee[_0x734b('0x25')]));}}else{}}catch(_0x3abbe6){console[_0x734b('0x20')](_0x3abbe6);}}}}; \ No newline at end of file +var _0xb7e7=['data1','toLowerCase','data2','Configurations','data3','queue','routeId','EVENT\x20UNKNOWN','unmanaged','zendesk','zoho','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','lodash','./zendesk','./sugarcrm','./zoho','./vtiger','./servicenow','./dynamics365','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3ea913,_0x255df2){_0x3ea913=_0x3ea913-0x0;var _0x2b4f28=_0xb7e7[_0x3ea913];return _0x2b4f28;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var zendesk=require(_0x7b7e('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x7b7e('0x2'));var freshdesk=require('./freshdesk');var zoho=require(_0x7b7e('0x3'));var desk=require('./desk');var vtiger=require(_0x7b7e('0x4'));var servicenow=require(_0x7b7e('0x5'));var dynamics365=require(_0x7b7e('0x6'));var freshsales=require('./freshsales');var integrations=['zendesk',_0x7b7e('0x7'),_0x7b7e('0x8'),_0x7b7e('0x9'),'zoho',_0x7b7e('0xa'),_0x7b7e('0xb'),_0x7b7e('0xc'),_0x7b7e('0xd'),_0x7b7e('0xe')];exports[_0x7b7e('0xf')]=function(_0x242e70,_0x52de3b,_0x299519,_0x1eef0a,_0x10a666,_0x29b622){if(_0x299519){if(_[_0x7b7e('0x10')](integrations,_0x242e70[_0x7b7e('0x11')][_0x7b7e('0x12')]())){try{var _0x55620b=null;var _0xaadda='';var _0x54d8ce=_0x299519[_0x242e70[_0x7b7e('0x11')][_0x7b7e('0x12')]()];if(_0x54d8ce){var _0x50d7d2=_0x54d8ce[_0x242e70[_0x7b7e('0x13')]];if(_0x50d7d2){var _0x5976ac=_['find'](_0x50d7d2[_0x7b7e('0x14')],{'id':parseInt(_0x242e70[_0x7b7e('0x15')],0xa)});if(_0x5976ac){if(_0x1eef0a){if(_0x10a666&&_0x52de3b[_0x7b7e('0x16')]){_0xaadda=_0x7b7e('0x16');}else if(_0x52de3b[_0x7b7e('0x17')]){_0xaadda='outbound';}else{console['log'](_0x7b7e('0x18'),_0x52de3b);}}else{_0xaadda=_0x7b7e('0x19');}switch(_0x242e70[_0x7b7e('0x11')][_0x7b7e('0x12')]()){case _0x7b7e('0x1a'):zendesk[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0x7'):salesforce[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0x8'):sugarcrm[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0x9'):freshdesk[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0x1b'):zoho[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0xa'):desk[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0xb'):vtiger[_0xaadda](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622);break;case _0x7b7e('0xd'):freshsales['cs'](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622,_0xaadda);break;case _0x7b7e('0xe'):servicenow['cs'](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622,_0xaadda);break;case _0x7b7e('0xc'):dynamics365['cs'](_0x242e70,_0x52de3b,_0x5976ac,_0x1eef0a,_0x10a666,_0x50d7d2,_0x29b622,_0xaadda);break;default:console[_0x7b7e('0x1c')](_0x7b7e('0x1d'));}}else{_0x55620b=require(_0x7b7e('0x1e'))(_0x242e70['data1'][_0x7b7e('0x12')]());_0x55620b[_0x7b7e('0x1f')](_0x7b7e('0x20'),util['format'](_0x7b7e('0x21'),_0x242e70[_0x7b7e('0x11')][_0x7b7e('0x12')](),_0x242e70[_0x7b7e('0x15')]));}}else{_0x55620b=require(_0x7b7e('0x1e'))(_0x242e70[_0x7b7e('0x11')][_0x7b7e('0x12')]());_0x55620b[_0x7b7e('0x1f')]('[EXEC]',util['format']('%s\x20account\x20#%s\x20not\x20found',_0x242e70[_0x7b7e('0x11')][_0x7b7e('0x12')](),_0x242e70[_0x7b7e('0x13')]));}}else{}}catch(_0x483c6f){console['error'](_0x483c6f);}}}}; \ 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 5ad662b..4685eca 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 _0x9b94=['toString','variable','variableName','Variable','name','toLowerCase','password','concat','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','util','ioredis','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','ticketType','Task','assign','getString','Descriptions','WhoId','Case','Subjects','ContactId','create','isNil','validateEmail','find','execute','then','length','Email','info','resolve','identity','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','sobject','Contact','Lead','contact','Phone','Name','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Company','No\x20Company','upperFirst','forEach','type','idField','content'];(function(_0x4d4c0e,_0x3dd03b){var _0x35d10b=function(_0x4faeeb){while(--_0x4faeeb){_0x4d4c0e['push'](_0x4d4c0e['shift']());}};_0x35d10b(++_0x3dd03b);}(_0x9b94,0xaa));var _0x49b9=function(_0x1086f6,_0x2dcdaa){_0x1086f6=_0x1086f6-0x0;var _0x281347=_0x9b94[_0x1086f6];return _0x281347;};'use strict';var _=require('lodash');var rp=require(_0x49b9('0x0'));var moment=require(_0x49b9('0x1'));var BPromise=require(_0x49b9('0x2'));var md5=require(_0x49b9('0x3'));var jsforce=require('jsforce');var util=require(_0x49b9('0x4'));var Redis=require(_0x49b9('0x5'));var intUtil=require('./util');var config=require(_0x49b9('0x6'));var logger=require(_0x49b9('0x7'))(_0x49b9('0x8'));config[_0x49b9('0x9')]=_[_0x49b9('0xa')](config['redis'],{'host':_0x49b9('0xb'),'port':0x18eb});var io=require(_0x49b9('0xc'))(new Redis(config['redis']));function emit(_0x3c0918,_0x24f725,_0x53d21d){io['to'](_0x3c0918)[_0x49b9('0xd')](_0x24f725,_0x53d21d);}function getTicket(_0x3708f9,_0x4a81c9,_0x48ab17,_0x13c676,_0xd26f64,_0x34c92f,_0x442bdc,_0x3ea2c8){var _0x355be1={};if(_0x13c676[_0x49b9('0xe')]===_0x49b9('0xf')){_0x355be1=Object[_0x49b9('0x10')]({},{'OwnerId':_0x4a81c9['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x49b9('0x11')](_0x13c676['Subjects'],_0xd26f64,'\x20'),'Description':intUtil[_0x49b9('0x11')](_0x13c676[_0x49b9('0x12')],_0xd26f64,'\x0a')},getCustomFields(_0x34c92f,_0xd26f64));if(_0x48ab17){_0x355be1[_0x49b9('0x13')]=_0x48ab17['id'];}}else if(_0x13c676[_0x49b9('0xe')]===_0x49b9('0x14')){_0x355be1=Object[_0x49b9('0x10')]({},{'OwnerId':_0x4a81c9['id'],'Subject':intUtil[_0x49b9('0x11')](_0x13c676[_0x49b9('0x15')],_0xd26f64,'\x20'),'Description':intUtil[_0x49b9('0x11')](_0x13c676[_0x49b9('0x12')],_0xd26f64,'\x0a')},getCustomFields(_0x34c92f,_0xd26f64));if(_0x48ab17){_0x355be1[_0x49b9('0x16')]=_0x48ab17['id'];}}return _0x442bdc['sobject'](_0x13c676[_0x49b9('0xe')])[_0x49b9('0x17')](_0x355be1);}function getUser(_0x36497d,_0x19124d,_0x20d634){if(!_[_0x49b9('0x18')](_0x19124d)&&intUtil[_0x49b9('0x19')](_0x19124d)){var _0x1770bf={'Email':_0x19124d};var _0x518f50={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x20d634['sobject']('User')[_0x49b9('0x1a')](_0x1770bf,_0x518f50)[_0x49b9('0x1b')]()[_0x49b9('0x1c')](function(_0x37b9c5){if(_0x37b9c5[_0x49b9('0x1d')]){var _0x168d12=_[_0x49b9('0x1a')](_0x37b9c5,function(_0x38cc40){return _0x38cc40[_0x49b9('0x1e')]===_0x19124d;});if(_0x168d12){logger[_0x49b9('0x1f')]('Agent\x20%s\x20found.',_0x19124d);return BPromise[_0x49b9('0x20')]({'id':_0x168d12['Id'],'name':_0x168d12['Name']});}}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x19124d);return _0x20d634[_0x49b9('0x21')]()[_0x49b9('0x1c')](function(_0x5d6951){return BPromise[_0x49b9('0x20')]({'id':_0x5d6951['user_id'],'name':_0x5d6951[_0x49b9('0x22')]});});}});}else{logger['info'](_0x49b9('0x23'),_0x19124d);return _0x20d634[_0x49b9('0x21')]()[_0x49b9('0x1c')](function(_0x19e727){return BPromise[_0x49b9('0x20')]({'id':_0x19e727['user_id'],'name':_0x19e727[_0x49b9('0x22')]});});}}function getEndUser(_0x382408,_0x2b3134,_0x435b5c,_0x3eaefe,_0x1ae9d4){var _0x581778={'Phone':_0x3eaefe};var _0x5a97bb={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x49b9('0x20')]()[_0x49b9('0x1c')](function(){if(_0x2b3134['ticketType']==='Task'){logger[_0x49b9('0x1f')](_0x49b9('0x24'),_0x3eaefe,_0x2b3134['moduleSearch']);switch(_0x2b3134['moduleSearch']){case'contact_lead':return _0x1ae9d4[_0x49b9('0x25')](_0x49b9('0x26'))[_0x49b9('0x1a')](_0x581778,_0x5a97bb)['execute']()[_0x49b9('0x1c')](function(_0x5654b2){if(_0x5654b2&&_0x5654b2[_0x49b9('0x1d')]){return _0x5654b2;}else{return _0x1ae9d4['sobject'](_0x49b9('0x27'))[_0x49b9('0x1a')](_0x581778,_0x5a97bb);}});case _0x49b9('0x28'):return _0x1ae9d4[_0x49b9('0x25')](_0x49b9('0x26'))[_0x49b9('0x1a')](_0x581778,_0x5a97bb)['execute']();case'lead':return _0x1ae9d4[_0x49b9('0x25')](_0x49b9('0x27'))[_0x49b9('0x1a')](_0x581778,_0x5a97bb);default:return null;}}else if(_0x2b3134[_0x49b9('0xe')]===_0x49b9('0x14')){logger[_0x49b9('0x1f')](_0x49b9('0x24'),_0x3eaefe,_0x49b9('0x28'));return _0x1ae9d4[_0x49b9('0x25')](_0x49b9('0x26'))[_0x49b9('0x1a')](_0x581778,_0x5a97bb)['execute']();}})['then'](function(_0x2d2887){if(_0x2d2887&&_0x2d2887[_0x49b9('0x1d')]){var _0x37b484=_[_0x49b9('0x1a')](_0x2d2887,function(_0x3cfd45){return _0x3cfd45[_0x49b9('0x29')]===_0x3eaefe;});if(_0x37b484){return BPromise[_0x49b9('0x20')]({'id':_0x37b484['Id'],'name':_0x37b484[_0x49b9('0x2a')],'phone':_0x37b484[_0x49b9('0x29')]});}}})[_0x49b9('0x1c')](function(_0x2adc5b){if(_0x2adc5b){logger['info'](_0x49b9('0x2b'),_0x3eaefe);return BPromise[_0x49b9('0x20')](_0x2adc5b);}else{logger['info'](_0x49b9('0x2c'),_0x3eaefe);var _0x3b5c2b={'LastName':_0x435b5c!==_0x49b9('0x2d')?_0x435b5c:util[_0x49b9('0x2e')](_0x49b9('0x2f'),_0x3eaefe),'Phone':_0x3eaefe};if(_0x2b3134[_0x49b9('0x30')]){if(_0x2b3134[_0x49b9('0x30')]==='contact'){logger[_0x49b9('0x1f')](_0x49b9('0x31'),_0x3eaefe,_0x2b3134[_0x49b9('0x30')]);}else if(_0x2b3134['moduleCreate']===_0x49b9('0x32')&&_0x2b3134[_0x49b9('0xe')]==='Task'){logger['info'](_0x49b9('0x31'),_0x3eaefe,_0x2b3134[_0x49b9('0x30')]);_0x3b5c2b[_0x49b9('0x33')]=_0x49b9('0x34');}else{return null;}}return _0x1ae9d4[_0x49b9('0x25')](_[_0x49b9('0x35')](_0x2b3134[_0x49b9('0x30')]))['create'](_0x3b5c2b);}});}function getCustomFields(_0x577133,_0x376281){var _0x1bddc1={};if(_0x577133['length']>0x0){_[_0x49b9('0x36')](_0x577133,function(_0x5d86a2){if(_0x5d86a2[_0x49b9('0x37')]==='string'&&_0x5d86a2[_0x49b9('0x38')]){_0x1bddc1[_0x5d86a2[_0x49b9('0x38')]]=_0x5d86a2[_0x49b9('0x39')][_0x49b9('0x3a')]();}else if(_0x5d86a2['type']===_0x49b9('0x3b')&&_0x5d86a2[_0x49b9('0x3c')]&&_0x5d86a2[_0x49b9('0x38')]){_0x376281[_0x5d86a2[_0x49b9('0x3c')]]&&(_0x1bddc1[_0x5d86a2[_0x49b9('0x38')]]=_0x376281[_0x5d86a2[_0x49b9('0x3c')]][_0x49b9('0x3a')]());}else if(_0x5d86a2[_0x49b9('0x37')]==='customVariable'&&_0x5d86a2[_0x49b9('0x3d')]&&_0x5d86a2[_0x49b9('0x3d')][_0x49b9('0x3e')]&&_0x5d86a2[_0x49b9('0x38')]){_0x376281[_0x5d86a2['Variable'][_0x49b9('0x3e')][_0x49b9('0x3f')]()]&&(_0x1bddc1[_0x5d86a2[_0x49b9('0x38')]]=_0x376281[_0x5d86a2['Variable'][_0x49b9('0x3e')]['toLowerCase']()][_0x49b9('0x3a')]());}});}return _0x1bddc1;}function getConnection(_0x1e1e10){var _0x62f05c=_0x1e1e10[_0x49b9('0x40')][_0x49b9('0x41')](_0x1e1e10[_0x49b9('0x42')]);var _0x21fb37=new jsforce[(_0x49b9('0x43'))]({'oauth2':{'loginUrl':_0x1e1e10['remoteUri']||_0x49b9('0x44'),'clientId':_0x1e1e10[_0x49b9('0x45')],'clientSecret':_0x1e1e10[_0x49b9('0x46')]}});return _0x21fb37[_0x49b9('0x47')](_0x1e1e10[_0x49b9('0x48')],_0x62f05c)['then'](function(){logger[_0x49b9('0x1f')]('Connection\x20established.');return _0x21fb37;});}exports[_0x49b9('0x49')]=function(_0x93d370,_0x52c152,_0x304907,_0x2384f5,_0x169a60,_0x3910a5){var _0x3c9fc9,_0x3981f2,_0x1e0394,_0x22d209;_0x3910a5[_0x49b9('0x4a')]=intUtil[_0x49b9('0x4b')](_0x3910a5['serverUrl']);_0x3910a5[_0x49b9('0x4c')]=intUtil['stripTrailingSlash'](_0x3910a5['remoteUri']);if(_0x169a60&&_0x169a60[_0x49b9('0x4d')]){logger['info'](_0x49b9('0x4e'),'Recording\x20is\x20enabled!');_0x52c152['recordingURL']=util[_0x49b9('0x2e')](_0x49b9('0x4f'),_0x3910a5[_0x49b9('0x4a')],_0x52c152[_0x49b9('0x50')],md5(_0x52c152[_0x49b9('0x50')]));}else{_0x52c152['recordingURL']='';}return getConnection(_0x3910a5)[_0x49b9('0x1c')](function(_0xd2fe8a){_0x22d209=_0xd2fe8a;return getUser(_0x3910a5,_0x2384f5['email'],_0x22d209);})[_0x49b9('0x1c')](function(_0x3f937a){_0x3c9fc9=_0x3f937a;return getEndUser(_0x3910a5,_0x304907,_0x52c152[_0x49b9('0x51')],_0x52c152[_0x49b9('0x52')],_0x22d209);})['then'](function(_0x13c5b1){_0x3981f2=_0x13c5b1;return getTicket(_0x3910a5,_0x3c9fc9,_0x3981f2,_0x304907,_0x52c152,_0x304907[_0x49b9('0x53')],_0x22d209,_0x49b9('0x49'));})[_0x49b9('0x1c')](function(_0x583cb1){_0x1e0394=_0x583cb1;logger[_0x49b9('0x1f')](_0x49b9('0x54'),_0x1e0394['id']);logger[_0x49b9('0x1f')](_0x49b9('0x55'),_0x1e0394['id'],_0x2384f5[_0x49b9('0x3e')],_0x3910a5[_0x49b9('0x37')]);switch(_0x3910a5[_0x49b9('0x37')]){case'integrationTab':emit(util[_0x49b9('0x2e')](_0x49b9('0x56'),_0x2384f5[_0x49b9('0x3e')]),_0x49b9('0x57'),{'recordId':_0x1e0394['id']});break;case _0x49b9('0x58'):emit(util[_0x49b9('0x2e')]('user:%s',_0x2384f5[_0x49b9('0x3e')]),_0x49b9('0x59'),{'uri':util[_0x49b9('0x2e')](_0x49b9('0x5a'),_0x22d209[_0x49b9('0x5b')],_0x1e0394['id'])});break;default:logger[_0x49b9('0x5c')](_0x49b9('0x5d'));}})[_0x49b9('0x5e')](function(_0x371bf4){logger[_0x49b9('0x5c')](_0x49b9('0x4e'),JSON[_0x49b9('0x5f')](_0x371bf4));});};exports[_0x49b9('0x60')]=function(_0x110ece,_0x2820f7,_0x548735,_0x7ceade,_0x5a1cd0,_0x5ee125,_0x23a03b){var _0x1c9bd4,_0x421dd2,_0x3915d1,_0x334528;_0x5ee125['serverUrl']=intUtil[_0x49b9('0x4b')](_0x5ee125[_0x49b9('0x4a')]);_0x5ee125[_0x49b9('0x4c')]=intUtil[_0x49b9('0x4b')](_0x5ee125[_0x49b9('0x4c')]);if(_0x23a03b&&_0x23a03b['recordingFormat']&&_0x23a03b[_0x49b9('0x61')]!==_0x49b9('0x62')){logger[_0x49b9('0x1f')](_0x49b9('0x63'),_0x49b9('0x64'));_0x2820f7[_0x49b9('0x65')]=util[_0x49b9('0x2e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5ee125[_0x49b9('0x4a')],_0x2820f7[_0x49b9('0x50')],md5(_0x2820f7[_0x49b9('0x50')]));}return getConnection(_0x5ee125)[_0x49b9('0x1c')](function(_0xf178e0){_0x334528=_0xf178e0;return getUser(_0x5ee125,_0x7ceade[_0x49b9('0x66')],_0x334528);})[_0x49b9('0x1c')](function(_0x15edea){_0x1c9bd4=_0x15edea;return getEndUser(_0x5ee125,_0x548735,_0x2820f7[_0x49b9('0x67')],_0x2820f7[_0x49b9('0x68')],_0x334528);})[_0x49b9('0x1c')](function(_0x502ec9){_0x421dd2=_0x502ec9;return getTicket(_0x5ee125,_0x1c9bd4,_0x421dd2,_0x548735,_0x2820f7,_0x548735[_0x49b9('0x53')],_0x334528,_0x49b9('0x60'));})[_0x49b9('0x1c')](function(_0x29a09b){_0x3915d1=_0x29a09b;logger['info'](_0x49b9('0x69'),_0x3915d1['id']);logger['info'](_0x49b9('0x6a'),_0x3915d1['id'],_0x7ceade[_0x49b9('0x3e')],_0x5ee125[_0x49b9('0x37')]);switch(_0x5ee125[_0x49b9('0x37')]){case _0x49b9('0x6b'):emit(util[_0x49b9('0x2e')](_0x49b9('0x56'),_0x7ceade[_0x49b9('0x3e')]),_0x49b9('0x57'),{'recordId':_0x3915d1['id']});break;case _0x49b9('0x58'):emit(util[_0x49b9('0x2e')](_0x49b9('0x56'),_0x7ceade[_0x49b9('0x3e')]),'trigger:browser:url',{'uri':util[_0x49b9('0x2e')](_0x49b9('0x5a'),_0x334528['instanceUrl'],_0x3915d1['id'])});break;default:logger[_0x49b9('0x5c')](_0x49b9('0x63'),_0x49b9('0x6c'));}})[_0x49b9('0x5e')](function(_0x438483){logger[_0x49b9('0x5c')]('[OUTBOUND]',JSON[_0x49b9('0x5f')](_0x438483));});};exports[_0x49b9('0x6d')]=function(_0x24360c,_0xc185fc,_0x195f61,_0x796070,_0x7be51e,_0x5e7540){var _0x285ece,_0x118349,_0x8e44d4,_0x9a20d8;_0x5e7540['serverUrl']=intUtil['stripTrailingSlash'](_0x5e7540['serverUrl']);_0x5e7540[_0x49b9('0x4c')]=intUtil[_0x49b9('0x4b')](_0x5e7540[_0x49b9('0x4c')]);if(_0x7be51e&&_0x7be51e[_0x49b9('0x4d')]){logger[_0x49b9('0x1f')]('['+_0xc185fc[_0x49b9('0x6e')][_0x49b9('0x6f')]()+']','Recording\x20is\x20enabled!');_0xc185fc[_0x49b9('0x65')]=util['format'](_0x49b9('0x4f'),_0x5e7540[_0x49b9('0x4a')],_0xc185fc[_0x49b9('0x50')],md5(_0xc185fc[_0x49b9('0x50')]));}else{_0xc185fc[_0x49b9('0x65')]='';}return getConnection(_0x5e7540)[_0x49b9('0x1c')](function(_0x1308d4){_0x9a20d8=_0x1308d4;if(!_[_0x49b9('0x18')](_0x796070)){return getUser(_0x5e7540,_0x796070['name'],_0x9a20d8);}else{return getUser(_0x5e7540,null,_0x9a20d8);}})[_0x49b9('0x1c')](function(_0x23edb5){_0x285ece=_0x23edb5;return getEndUser(_0x5e7540,_0x195f61,_0xc185fc[_0x49b9('0x51')],_0xc185fc['calleridnum'],_0x9a20d8);})[_0x49b9('0x1c')](function(_0x43201e){_0x118349=_0x43201e;return getTicket(_0x5e7540,_0x285ece,_0x118349,_0x195f61,_0xc185fc,_0x195f61[_0x49b9('0x53')],_0x9a20d8);})[_0x49b9('0x1c')](function(_0x47ade7){_0x8e44d4=_0x47ade7;logger['info']('['+_0xc185fc['lastevent'][_0x49b9('0x6f')]()+_0x49b9('0x70'),_0x8e44d4['id']);logger[_0x49b9('0x1f')]('['+_0xc185fc['lastevent'][_0x49b9('0x6f')]()+_0x49b9('0x71'),_0x5e7540[_0x49b9('0x37')]);})[_0x49b9('0x5e')](function(_0x5f229c){logger[_0x49b9('0x5c')]('['+_0xc185fc[_0x49b9('0x6e')]['toUpperCase']()+']',JSON['stringify'](_0x5f229c));});}; \ No newline at end of file +var _0xc821=['request-promise','md5','jsforce','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','ticketType','assign','utc','getString','Subjects','WhoId','Case','ContactId','isNil','validateEmail','sobject','User','find','length','info','Agent\x20%s\x20found.','resolve','Name','identity','then','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Task','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','execute','contact','Lead','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','moduleCreate','lead','Company','No\x20Company','create','forEach','type','string','idField','content','variableName','toString','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','calleridnum','Fields','user:%s','trigger:salesforce:display','trigger:browser:url','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','newTab','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','calleridname',']\x20Integration\x20account\x20type\x20%s.','stringify','lodash'];(function(_0x1812ae,_0x5c230d){var _0x253ffa=function(_0x338804){while(--_0x338804){_0x1812ae['push'](_0x1812ae['shift']());}};_0x253ffa(++_0x5c230d);}(_0xc821,0xd9));var _0x1c82=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc821[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1c82('0x0'));var rp=require(_0x1c82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x1c82('0x2'));var jsforce=require(_0x1c82('0x3'));var util=require('util');var Redis=require(_0x1c82('0x4'));var intUtil=require(_0x1c82('0x5'));var config=require('../../../../config/environment');var logger=require(_0x1c82('0x6'))(_0x1c82('0x7'));config[_0x1c82('0x8')]=_[_0x1c82('0x9')](config[_0x1c82('0x8')],{'host':_0x1c82('0xa'),'port':0x18eb});var io=require(_0x1c82('0xb'))(new Redis(config[_0x1c82('0x8')]));function emit(_0x48430a,_0x1b980b,_0x1b0eb0){io['to'](_0x48430a)['emit'](_0x1b980b,_0x1b0eb0);}function getTicket(_0x49276d,_0x35546b,_0x5ed44e,_0x45aabb,_0x362e06,_0x2d3646,_0x575696,_0x527aec){var _0x2bf8b9={};if(_0x45aabb[_0x1c82('0xc')]==='Task'){_0x2bf8b9=Object[_0x1c82('0xd')]({},{'OwnerId':_0x35546b['id'],'ActivityDate':moment[_0x1c82('0xe')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x1c82('0xf')](_0x45aabb[_0x1c82('0x10')],_0x362e06,'\x20'),'Description':intUtil[_0x1c82('0xf')](_0x45aabb['Descriptions'],_0x362e06,'\x0a')},getCustomFields(_0x2d3646,_0x362e06));if(_0x5ed44e){_0x2bf8b9[_0x1c82('0x11')]=_0x5ed44e['id'];}}else if(_0x45aabb[_0x1c82('0xc')]===_0x1c82('0x12')){_0x2bf8b9=Object['assign']({},{'OwnerId':_0x35546b['id'],'Subject':intUtil['getString'](_0x45aabb[_0x1c82('0x10')],_0x362e06,'\x20'),'Description':intUtil['getString'](_0x45aabb['Descriptions'],_0x362e06,'\x0a')},getCustomFields(_0x2d3646,_0x362e06));if(_0x5ed44e){_0x2bf8b9[_0x1c82('0x13')]=_0x5ed44e['id'];}}return _0x575696['sobject'](_0x45aabb[_0x1c82('0xc')])['create'](_0x2bf8b9);}function getUser(_0x3a9633,_0x902c96,_0x52f943){if(!_[_0x1c82('0x14')](_0x902c96)&&intUtil[_0x1c82('0x15')](_0x902c96)){var _0x24088a={'Email':_0x902c96};var _0x5747e8={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x52f943[_0x1c82('0x16')](_0x1c82('0x17'))[_0x1c82('0x18')](_0x24088a,_0x5747e8)['execute']()['then'](function(_0x2184d5){if(_0x2184d5[_0x1c82('0x19')]){var _0x3e43f1=_['find'](_0x2184d5,function(_0x2da290){return _0x2da290['Email']===_0x902c96;});if(_0x3e43f1){logger[_0x1c82('0x1a')](_0x1c82('0x1b'),_0x902c96);return BPromise[_0x1c82('0x1c')]({'id':_0x3e43f1['Id'],'name':_0x3e43f1[_0x1c82('0x1d')]});}}else{logger[_0x1c82('0x1a')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x902c96);return _0x52f943[_0x1c82('0x1e')]()[_0x1c82('0x1f')](function(_0x1bbcca){return BPromise['resolve']({'id':_0x1bbcca[_0x1c82('0x20')],'name':_0x1bbcca[_0x1c82('0x21')]});});}});}else{logger[_0x1c82('0x1a')](_0x1c82('0x22'),_0x902c96);return _0x52f943['identity']()[_0x1c82('0x1f')](function(_0x317fe0){return BPromise[_0x1c82('0x1c')]({'id':_0x317fe0[_0x1c82('0x20')],'name':_0x317fe0[_0x1c82('0x21')]});});}}function getEndUser(_0x301b82,_0x389799,_0x14d45a,_0x12e459,_0x15488f){var _0x266181={'Phone':_0x12e459};var _0x177a34={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x1c82('0x1c')]()['then'](function(){if(_0x389799[_0x1c82('0xc')]===_0x1c82('0x23')){logger[_0x1c82('0x1a')](_0x1c82('0x24'),_0x12e459,_0x389799[_0x1c82('0x25')]);switch(_0x389799[_0x1c82('0x25')]){case'contact_lead':return _0x15488f[_0x1c82('0x16')](_0x1c82('0x26'))[_0x1c82('0x18')](_0x266181,_0x177a34)[_0x1c82('0x27')]()[_0x1c82('0x1f')](function(_0x45a2bc){if(_0x45a2bc&&_0x45a2bc['length']){return _0x45a2bc;}else{return _0x15488f[_0x1c82('0x16')]('Lead')['find'](_0x266181,_0x177a34);}});case _0x1c82('0x28'):return _0x15488f[_0x1c82('0x16')](_0x1c82('0x26'))[_0x1c82('0x18')](_0x266181,_0x177a34)[_0x1c82('0x27')]();case'lead':return _0x15488f[_0x1c82('0x16')](_0x1c82('0x29'))[_0x1c82('0x18')](_0x266181,_0x177a34);default:return null;}}else if(_0x389799[_0x1c82('0xc')]===_0x1c82('0x12')){logger[_0x1c82('0x1a')](_0x1c82('0x24'),_0x12e459,_0x1c82('0x28'));return _0x15488f['sobject'](_0x1c82('0x26'))[_0x1c82('0x18')](_0x266181,_0x177a34)['execute']();}})[_0x1c82('0x1f')](function(_0x4327a8){if(_0x4327a8&&_0x4327a8[_0x1c82('0x19')]){var _0x3d41d1=_[_0x1c82('0x18')](_0x4327a8,function(_0x1ddfc0){return _0x1ddfc0[_0x1c82('0x2a')]===_0x12e459;});if(_0x3d41d1){return BPromise[_0x1c82('0x1c')]({'id':_0x3d41d1['Id'],'name':_0x3d41d1[_0x1c82('0x1d')],'phone':_0x3d41d1[_0x1c82('0x2a')]});}}})[_0x1c82('0x1f')](function(_0x476ef8){if(_0x476ef8){logger[_0x1c82('0x1a')](_0x1c82('0x2b'),_0x12e459);return BPromise[_0x1c82('0x1c')](_0x476ef8);}else{logger[_0x1c82('0x1a')](_0x1c82('0x2c'),_0x12e459);var _0xd508a4={'LastName':_0x14d45a!==_0x1c82('0x2d')?_0x14d45a:util[_0x1c82('0x2e')](_0x1c82('0x2f'),_0x12e459),'Phone':_0x12e459};if(_0x389799['moduleCreate']){if(_0x389799['moduleCreate']==='contact'){logger[_0x1c82('0x1a')](_0x1c82('0x30'),_0x12e459,_0x389799[_0x1c82('0x31')]);}else if(_0x389799['moduleCreate']===_0x1c82('0x32')&&_0x389799[_0x1c82('0xc')]===_0x1c82('0x23')){logger[_0x1c82('0x1a')](_0x1c82('0x30'),_0x12e459,_0x389799[_0x1c82('0x31')]);_0xd508a4[_0x1c82('0x33')]=_0x1c82('0x34');}else{return null;}}return _0x15488f[_0x1c82('0x16')](_['upperFirst'](_0x389799[_0x1c82('0x31')]))[_0x1c82('0x35')](_0xd508a4);}});}function getCustomFields(_0x59f394,_0x590e32){var _0x3652ac={};if(_0x59f394[_0x1c82('0x19')]>0x0){_[_0x1c82('0x36')](_0x59f394,function(_0x49a651){if(_0x49a651[_0x1c82('0x37')]===_0x1c82('0x38')&&_0x49a651[_0x1c82('0x39')]){_0x3652ac[_0x49a651['idField']]=_0x49a651[_0x1c82('0x3a')]['toString']();}else if(_0x49a651[_0x1c82('0x37')]==='variable'&&_0x49a651[_0x1c82('0x3b')]&&_0x49a651[_0x1c82('0x39')]){_0x590e32[_0x49a651[_0x1c82('0x3b')]]&&(_0x3652ac[_0x49a651[_0x1c82('0x39')]]=_0x590e32[_0x49a651[_0x1c82('0x3b')]][_0x1c82('0x3c')]());}else if(_0x49a651[_0x1c82('0x37')]===_0x1c82('0x3d')&&_0x49a651[_0x1c82('0x3e')]&&_0x49a651['Variable'][_0x1c82('0x3f')]&&_0x49a651[_0x1c82('0x39')]){_0x590e32[_0x49a651[_0x1c82('0x3e')][_0x1c82('0x3f')][_0x1c82('0x40')]()]&&(_0x3652ac[_0x49a651[_0x1c82('0x39')]]=_0x590e32[_0x49a651[_0x1c82('0x3e')][_0x1c82('0x3f')]['toLowerCase']()][_0x1c82('0x3c')]());}});}return _0x3652ac;}function getConnection(_0x4cf15f){var _0x3f6dd7=_0x4cf15f[_0x1c82('0x41')][_0x1c82('0x42')](_0x4cf15f[_0x1c82('0x43')]);var _0x2b4316=new jsforce[(_0x1c82('0x44'))]({'oauth2':{'loginUrl':_0x4cf15f[_0x1c82('0x45')]||_0x1c82('0x46'),'clientId':_0x4cf15f[_0x1c82('0x47')],'clientSecret':_0x4cf15f[_0x1c82('0x48')]}});return _0x2b4316[_0x1c82('0x49')](_0x4cf15f[_0x1c82('0x4a')],_0x3f6dd7)[_0x1c82('0x1f')](function(){logger[_0x1c82('0x1a')](_0x1c82('0x4b'));return _0x2b4316;});}exports['queue']=function(_0x174f16,_0x18c467,_0x4df0e7,_0x4268ca,_0x579b3f,_0x2eb994){var _0x18f550,_0x23fe67,_0x3e733f,_0x449b16;_0x2eb994['serverUrl']=intUtil['stripTrailingSlash'](_0x2eb994['serverUrl']);_0x2eb994['remoteUri']=intUtil[_0x1c82('0x4c')](_0x2eb994[_0x1c82('0x45')]);if(_0x579b3f&&_0x579b3f[_0x1c82('0x4d')]){logger[_0x1c82('0x1a')](_0x1c82('0x4e'),_0x1c82('0x4f'));_0x18c467[_0x1c82('0x50')]=util[_0x1c82('0x2e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2eb994[_0x1c82('0x51')],_0x18c467[_0x1c82('0x52')],md5(_0x18c467[_0x1c82('0x52')]));}else{_0x18c467[_0x1c82('0x50')]='';}return getConnection(_0x2eb994)[_0x1c82('0x1f')](function(_0x48fac4){_0x449b16=_0x48fac4;return getUser(_0x2eb994,_0x4268ca[_0x1c82('0x53')],_0x449b16);})[_0x1c82('0x1f')](function(_0x5beb6c){_0x18f550=_0x5beb6c;return getEndUser(_0x2eb994,_0x4df0e7,_0x18c467['calleridname'],_0x18c467[_0x1c82('0x54')],_0x449b16);})[_0x1c82('0x1f')](function(_0x1bd8f3){_0x23fe67=_0x1bd8f3;return getTicket(_0x2eb994,_0x18f550,_0x23fe67,_0x4df0e7,_0x18c467,_0x4df0e7[_0x1c82('0x55')],_0x449b16,'queue');})[_0x1c82('0x1f')](function(_0x5701ad){_0x3e733f=_0x5701ad;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x3e733f['id']);logger[_0x1c82('0x1a')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3e733f['id'],_0x4268ca[_0x1c82('0x3f')],_0x2eb994[_0x1c82('0x37')]);switch(_0x2eb994[_0x1c82('0x37')]){case'integrationTab':emit(util[_0x1c82('0x2e')](_0x1c82('0x56'),_0x4268ca[_0x1c82('0x3f')]),_0x1c82('0x57'),{'recordId':_0x3e733f['id']});break;case'newTab':emit(util[_0x1c82('0x2e')](_0x1c82('0x56'),_0x4268ca[_0x1c82('0x3f')]),_0x1c82('0x58'),{'uri':util[_0x1c82('0x2e')]('%s/%s/e',_0x449b16['instanceUrl'],_0x3e733f['id'])});break;default:logger['error'](_0x1c82('0x59'));}})[_0x1c82('0x5a')](function(_0x7c6f76){logger[_0x1c82('0x5b')](_0x1c82('0x4e'),JSON['stringify'](_0x7c6f76));});};exports[_0x1c82('0x5c')]=function(_0x3f44ce,_0x89c5ee,_0x4cddd9,_0x3f561b,_0x390519,_0x8f56ea,_0xace3a3){var _0x42f728,_0x387f27,_0x147e31,_0x13744e;_0x8f56ea['serverUrl']=intUtil[_0x1c82('0x4c')](_0x8f56ea[_0x1c82('0x51')]);_0x8f56ea['remoteUri']=intUtil['stripTrailingSlash'](_0x8f56ea[_0x1c82('0x45')]);if(_0xace3a3&&_0xace3a3[_0x1c82('0x5d')]&&_0xace3a3[_0x1c82('0x5d')]!==_0x1c82('0x5e')){logger[_0x1c82('0x1a')](_0x1c82('0x5f'),'Recording\x20is\x20enabled!');_0x89c5ee[_0x1c82('0x50')]=util['format'](_0x1c82('0x60'),_0x8f56ea[_0x1c82('0x51')],_0x89c5ee[_0x1c82('0x52')],md5(_0x89c5ee[_0x1c82('0x52')]));}return getConnection(_0x8f56ea)[_0x1c82('0x1f')](function(_0x217082){_0x13744e=_0x217082;return getUser(_0x8f56ea,_0x3f561b[_0x1c82('0x53')],_0x13744e);})[_0x1c82('0x1f')](function(_0x57e652){_0x42f728=_0x57e652;return getEndUser(_0x8f56ea,_0x4cddd9,_0x89c5ee[_0x1c82('0x61')],_0x89c5ee['destcalleridnum'],_0x13744e);})[_0x1c82('0x1f')](function(_0x4d2465){_0x387f27=_0x4d2465;return getTicket(_0x8f56ea,_0x42f728,_0x387f27,_0x4cddd9,_0x89c5ee,_0x4cddd9[_0x1c82('0x55')],_0x13744e,_0x1c82('0x5c'));})[_0x1c82('0x1f')](function(_0x2f1cb0){_0x147e31=_0x2f1cb0;logger[_0x1c82('0x1a')](_0x1c82('0x62'),_0x147e31['id']);logger[_0x1c82('0x1a')](_0x1c82('0x63'),_0x147e31['id'],_0x3f561b['name'],_0x8f56ea[_0x1c82('0x37')]);switch(_0x8f56ea[_0x1c82('0x37')]){case _0x1c82('0x64'):emit(util['format']('user:%s',_0x3f561b[_0x1c82('0x3f')]),'trigger:salesforce:display',{'recordId':_0x147e31['id']});break;case _0x1c82('0x65'):emit(util['format']('user:%s',_0x3f561b[_0x1c82('0x3f')]),_0x1c82('0x58'),{'uri':util['format']('%s/%s/e',_0x13744e[_0x1c82('0x66')],_0x147e31['id'])});break;default:logger[_0x1c82('0x5b')]('[OUTBOUND]',_0x1c82('0x67'));}})['catch'](function(_0x21e302){logger[_0x1c82('0x5b')](_0x1c82('0x5f'),JSON['stringify'](_0x21e302));});};exports['unmanaged']=function(_0x47ea78,_0x5bb1ca,_0x40c616,_0x3205d6,_0x3db68c,_0x3ec649){var _0x151b14,_0x3f6bf6,_0x20f741,_0x3df068;_0x3ec649[_0x1c82('0x51')]=intUtil[_0x1c82('0x4c')](_0x3ec649[_0x1c82('0x51')]);_0x3ec649[_0x1c82('0x45')]=intUtil[_0x1c82('0x4c')](_0x3ec649['remoteUri']);if(_0x3db68c&&_0x3db68c[_0x1c82('0x4d')]){logger['info']('['+_0x5bb1ca[_0x1c82('0x68')][_0x1c82('0x69')]()+']','Recording\x20is\x20enabled!');_0x5bb1ca[_0x1c82('0x50')]=util['format'](_0x1c82('0x60'),_0x3ec649[_0x1c82('0x51')],_0x5bb1ca[_0x1c82('0x52')],md5(_0x5bb1ca[_0x1c82('0x52')]));}else{_0x5bb1ca[_0x1c82('0x50')]='';}return getConnection(_0x3ec649)[_0x1c82('0x1f')](function(_0x6dd830){_0x3df068=_0x6dd830;if(!_[_0x1c82('0x14')](_0x3205d6)){return getUser(_0x3ec649,_0x3205d6[_0x1c82('0x3f')],_0x3df068);}else{return getUser(_0x3ec649,null,_0x3df068);}})[_0x1c82('0x1f')](function(_0x1132aa){_0x151b14=_0x1132aa;return getEndUser(_0x3ec649,_0x40c616,_0x5bb1ca[_0x1c82('0x6a')],_0x5bb1ca[_0x1c82('0x54')],_0x3df068);})[_0x1c82('0x1f')](function(_0x366bce){_0x3f6bf6=_0x366bce;return getTicket(_0x3ec649,_0x151b14,_0x3f6bf6,_0x40c616,_0x5bb1ca,_0x40c616[_0x1c82('0x55')],_0x3df068);})[_0x1c82('0x1f')](function(_0x41fd18){_0x20f741=_0x41fd18;logger[_0x1c82('0x1a')]('['+_0x5bb1ca[_0x1c82('0x68')][_0x1c82('0x69')]()+']\x20Ticket\x20%s\x20created.',_0x20f741['id']);logger[_0x1c82('0x1a')]('['+_0x5bb1ca[_0x1c82('0x68')][_0x1c82('0x69')]()+_0x1c82('0x6b'),_0x3ec649[_0x1c82('0x37')]);})[_0x1c82('0x5a')](function(_0x54bbfe){logger[_0x1c82('0x5b')]('['+_0x5bb1ca['lastevent'][_0x1c82('0x69')]()+']',JSON[_0x1c82('0x6c')](_0x54bbfe));});}; \ 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 6aaf9c0..9718bec 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 _0xc4aa=['all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','sysparm_limit=1','remoteUri','stripTrailingSlash','isNil','email','destcalleridnum','calleridnum','queue','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','servicenow','redis','defaults','localhost','socket.io-emitter','GET','then','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','length','active','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','forEach','type','string','nameField','customField','idField','toLowerCase','content','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','POST','ticketNumber','push'];(function(_0x875aa3,_0x586747){var _0x4b30a3=function(_0x376b18){while(--_0x376b18){_0x875aa3['push'](_0x875aa3['shift']());}};_0x4b30a3(++_0x586747);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xc4aa[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xac4a('0x0'));var Promise=require(_0xac4a('0x1'));var rp=require(_0xac4a('0x2'));var util=require(_0xac4a('0x3'));var md5=require(_0xac4a('0x4'));var Redis=require(_0xac4a('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xac4a('0x6'));config[_0xac4a('0x7')]=_[_0xac4a('0x8')](config[_0xac4a('0x7')],{'host':_0xac4a('0x9'),'port':0x18eb});var io=require(_0xac4a('0xa'))(new Redis(config[_0xac4a('0x7')]));function getAdminUser(_0x10525b,_0x5c6179,_0x5b8339,_0x1aba6d,_0x2a4d53,_0x26ec84){return new Promise(function(_0x4f4146,_0x1d182e){var _0x3a82de={'method':_0xac4a('0xb'),'uri':_0x1aba6d+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x2a4d53+'&'+_0x26ec84,'auth':_0x5c6179,'json':!![]};return rp(_0x3a82de)[_0xac4a('0xc')](function(_0x488e3c){if(_0x488e3c[_0xac4a('0xd')]['length']>0x0){_0x5b8339[_0xac4a('0xe')]=_0x488e3c[_0xac4a('0xd')][0x0][_0xac4a('0xf')];}logger['info']('['+[_0x10525b[_0xac4a('0x10')]()]+_0xac4a('0x11'),_0x5b8339);_0x4f4146(_0x5b8339);})[_0xac4a('0x12')](function(_0x6e00d4){logger[_0xac4a('0x13')]('['+[_0x10525b[_0xac4a('0x10')]()]+']',_0x6e00d4[_0xac4a('0x14')]);_0x1d182e(_0x6e00d4[_0xac4a('0x14')]);});});}function getUser(_0x190418,_0x42c7fc,_0x11e101,_0x26dbb8,_0x4a2119){return function(_0x402fff){logger[_0xac4a('0x15')]('['+[_0x190418[_0xac4a('0x10')]()]+_0xac4a('0x16'),_0x402fff);return new Promise(function(_0x3e88e3,_0x387a54){if(intUtil[_0xac4a('0x17')](_0x402fff[_0xac4a('0x18')])){var _0x546c5d={'method':'GET','uri':_0x11e101+_0xac4a('0x19')+_0x402fff[_0xac4a('0x18')]+'&'+_0x26dbb8+'&'+_0x4a2119,'auth':_0x42c7fc,'json':!![]};logger[_0xac4a('0x15')]('['+[_0x190418['toUpperCase']()]+_0xac4a('0x1a'),_0x546c5d);return rp(_0x546c5d)[_0xac4a('0xc')](function(_0x3752e4){logger[_0xac4a('0x15')]('['+[_0x190418[_0xac4a('0x10')]()]+_0xac4a('0x1b'),_0x3752e4);if(_0x3752e4[_0xac4a('0xd')][_0xac4a('0x1c')]>0x0&&String(_0x3752e4['result'][0x0][_0xac4a('0x1d')])===_0xac4a('0x1e')){_0x402fff['userId']=_0x3752e4[_0xac4a('0xd')][0x0][_0xac4a('0xf')];}else{_0x402fff[_0xac4a('0x1f')]=_0x402fff[_0xac4a('0xe')];_0x402fff['userEmail']=_0x402fff[_0xac4a('0x20')];}logger[_0xac4a('0x15')]('['+[_0x190418[_0xac4a('0x10')]()]+_0xac4a('0x21'),_0x402fff);_0x3e88e3(_0x402fff);})[_0xac4a('0x12')](function(_0x2b0dc2){logger[_0xac4a('0x13')]('['+[_0x190418[_0xac4a('0x10')]()]+']',_0x2b0dc2[_0xac4a('0x14')]);_0x387a54(_0x2b0dc2[_0xac4a('0x14')]);});}else{logger[_0xac4a('0x15')]('['+[_0x190418[_0xac4a('0x10')]()]+_0xac4a('0x22'));_0x402fff[_0xac4a('0x1f')]=_0x402fff[_0xac4a('0xe')];_0x402fff[_0xac4a('0x18')]=_0x402fff['adminEmail'];_0x3e88e3(_0x402fff);}});};}function createEndUser(_0x23b061,_0x267a22,_0x42a33c,_0x2772fe,_0x116700){logger['info']('['+[_0x23b061['toUpperCase']()]+_0xac4a('0x23'),_0x42a33c);return new Promise(function(_0x7a948b,_0x1f12d5){var _0x546b65={'method':'POST','uri':_0x2772fe+_0xac4a('0x24')+_0x116700,'body':{'user_name':_0x42a33c[_0xac4a('0x25')],'roles':_0xac4a('0x26'),'first_name':_0x42a33c[_0xac4a('0x25')],'active':_0xac4a('0x1e'),'date_format':'System','phone':_0x42a33c[_0xac4a('0x25')]},'auth':_0x267a22,'json':!![]};return rp(_0x546b65)['then'](function(_0x30364b){logger['info']('['+[_0x23b061[_0xac4a('0x10')]()]+_0xac4a('0x27'),_0x30364b[_0xac4a('0xd')]);_0x42a33c[_0xac4a('0x28')]=_0x30364b[_0xac4a('0xd')][_0xac4a('0xf')];_0x7a948b(_0x42a33c);})[_0xac4a('0x12')](function(_0x1f13f3){logger[_0xac4a('0x13')]('['+[_0x23b061[_0xac4a('0x10')]()]+']',_0x1f13f3[_0xac4a('0x14')]);_0x1f12d5(_0x1f13f3[_0xac4a('0x14')]);});});}function getEndUser(_0x1a9be2,_0x1a9d4e,_0x5634e2,_0x30442d,_0x1c41fb){return function(_0x5a4e2b){logger[_0xac4a('0x15')]('['+[_0x1a9be2[_0xac4a('0x10')]()]+'],\x20getEndUser\x20input\x20crm',_0x5a4e2b);return new Promise(function(_0x58804b,_0x11f0be){var _0x1ba096={'method':_0xac4a('0xb'),'uri':_0x5634e2+_0xac4a('0x29')+_0x5a4e2b['endUserNumber']+'&'+_0x30442d+'&'+_0x1c41fb,'auth':_0x1a9d4e,'json':!![]};return rp(_0x1ba096)[_0xac4a('0xc')](function(_0x2e56c6){if(_0x2e56c6['result'][_0xac4a('0x1c')]>0x0){_0x5a4e2b[_0xac4a('0x28')]=_0x2e56c6[_0xac4a('0xd')][0x0]['sys_id'];logger[_0xac4a('0x15')]('['+[_0x1a9be2[_0xac4a('0x10')]()]+_0xac4a('0x2a'),_0x5a4e2b);_0x58804b(_0x5a4e2b);}else{return createEndUser(_0x1a9be2,_0x1a9d4e,_0x5a4e2b,_0x5634e2,_0x30442d)['then'](function(_0x35bc94){logger[_0xac4a('0x15')]('['+[_0x1a9be2['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x35bc94);_0x58804b(_0x35bc94);});}})[_0xac4a('0x12')](function(_0x5e0926){logger['error']('['+[_0x1a9be2['toUpperCase']()]+']',_0x5e0926['message']);_0x11f0be(_0x5e0926[_0xac4a('0x14')]);});});};}function getCustomFields(_0x2bf8e8,_0x37834b){var _0x472484={};if(_0x2bf8e8[_0xac4a('0x1c')]>0x0){_[_0xac4a('0x2b')](_0x2bf8e8,function(_0x4220e2){if(_0x4220e2[_0xac4a('0x2c')]===_0xac4a('0x2d')&&_0x4220e2[_0xac4a('0x2e')]&&!_0x4220e2[_0xac4a('0x2f')]){_0x472484[_0x4220e2[_0xac4a('0x30')]['toLowerCase']()]=_0x4220e2['content']['toString']();}else if(_0x4220e2[_0xac4a('0x2c')]===_0xac4a('0x2d')&&_0x4220e2[_0xac4a('0x30')]&&_0x4220e2[_0xac4a('0x2f')]){_0x472484[_0x4220e2[_0xac4a('0x30')][_0xac4a('0x31')]()]=_0x4220e2[_0xac4a('0x32')][_0xac4a('0x33')]();}else if(_0x4220e2[_0xac4a('0x2c')]===_0xac4a('0x34')&&_0x4220e2['variableName']&&_0x4220e2[_0xac4a('0x30')]&&_0x4220e2[_0xac4a('0x2f')]){_0x472484[_0x4220e2[_0xac4a('0x30')][_0xac4a('0x31')]()]=_0x37834b[_0x4220e2[_0xac4a('0x35')]]['toString']();}else if(_0x4220e2[_0xac4a('0x2c')]===_0xac4a('0x36')&&_0x4220e2['Variable']&&_0x4220e2[_0xac4a('0x37')]['name']&&_0x4220e2[_0xac4a('0x30')]&&_0x4220e2[_0xac4a('0x2f')]){_0x472484[_0x4220e2[_0xac4a('0x30')][_0xac4a('0x31')]()]=_0x37834b[_0x4220e2[_0xac4a('0x37')][_0xac4a('0x38')][_0xac4a('0x31')]()][_0xac4a('0x33')]();}});}return _0x472484;}function getTicket(_0x98e0c4,_0xcb002b,_0x4fa9eb,_0x3b68b3,_0x569812,_0x1646ea){return function(_0x41d11d){logger[_0xac4a('0x15')]('['+[_0x98e0c4['toUpperCase']()]+_0xac4a('0x39'),_0x41d11d);return new Promise(function(_0x19276e,_0x5f54ff){var _0x42969b=_0x98e0c4['toLowerCase']()===_0xac4a('0x3a')?_0x41d11d[_0xac4a('0x1f')]:_0x41d11d[_0xac4a('0x28')];var _0x5e3581={'method':'POST','uri':_0x4fa9eb+_0xac4a('0x3b')+'?'+_0x1646ea,'body':Object['assign']({},{'active':_0xac4a('0x1e'),'caller_id':_0x42969b,'assigned_to':_0x41d11d['userId'],'short_description':intUtil[_0xac4a('0x3c')](_0x3b68b3['Subjects'],_0x569812,'\x20'),'description':intUtil[_0xac4a('0x3c')](_0x3b68b3[_0xac4a('0x3d')],_0x569812,'\x0a')},getCustomFields(_0x3b68b3[_0xac4a('0x3e')],_0x569812)),'auth':_0xcb002b,'json':!![]};return rp(_0x5e3581)[_0xac4a('0xc')](function(_0x54782f){logger[_0xac4a('0x15')]('['+[_0x98e0c4[_0xac4a('0x10')]()]+_0xac4a('0x3f'),_0x54782f[_0xac4a('0xd')]);_0x41d11d[_0xac4a('0x40')]=_0x54782f[_0xac4a('0xd')][_0xac4a('0xf')];_0x41d11d['ticketNumber']=_0x54782f[_0xac4a('0xd')][_0xac4a('0x41')];logger['info']('['+[_0x98e0c4[_0xac4a('0x10')]()]+_0xac4a('0x42'),_0x41d11d);_0x19276e(_0x41d11d);})[_0xac4a('0x12')](function(_0x3ac36e){logger['error']('['+[_0x98e0c4[_0xac4a('0x10')]()]+']',_0x3ac36e[_0xac4a('0x14')]);_0x5f54ff(_0x3ac36e[_0xac4a('0x14')]);});});};}function createRemoteTag(_0x129d58,_0x890910,_0x49fbc3,_0x179373){return new Promise(function(_0x564b10,_0x307441){var _0x2c04af={'method':'POST','uri':_0x49fbc3+'label'+'?'+_0x179373,'body':{'short_description':_0x129d58,'global':!![],'active':!![],'name':_0x129d58},'auth':_0x890910,'json':!![]};return rp(_0x2c04af)[_0xac4a('0xc')](function(_0x70fdc3){var _0x4d448f=_0x70fdc3[_0xac4a('0xd')][_0xac4a('0xf')];_0x564b10(_0x4d448f);});});}function getRemoteTag(_0x26b582,_0x103d05,_0x48900f,_0x3057d6,_0x108f7c){return new Promise(function(_0xb43fdb,_0xb5897b){var _0xdc80e3={'method':_0xac4a('0xb'),'uri':_0x48900f+_0xac4a('0x43')+'?sysparm_query=name%3D'+_0x26b582+'&'+_0x3057d6,'auth':_0x103d05,'json':!![]};return rp(_0xdc80e3)[_0xac4a('0xc')](function(_0xef51d0){if(_0xef51d0[_0xac4a('0xd')][_0xac4a('0x1c')]>0x0){var _0x1b7231=_0xef51d0[_0xac4a('0xd')][0x0][_0xac4a('0xf')];_0xb43fdb(_0x1b7231);}else{return createRemoteTag(_0x26b582,_0x103d05,_0x48900f,_0x3057d6)[_0xac4a('0xc')](function(_0x159e43){_0xb43fdb(_0x159e43);});}});});}function assignTagToIncident(_0x786d9,_0x3b175a,_0x38dd4f,_0x400ac4,_0x2fe7df){return new Promise(function(_0x5222f3,_0x11c753){var _0x492aae={'method':_0xac4a('0x44'),'uri':_0x38dd4f+'label_entry'+'?'+_0x2fe7df,'body':{'label':_0x786d9,'table':_0xac4a('0x3b'),'id_type':'Incident','table_key':_0x400ac4[_0xac4a('0x40')],'title':'Incident\x20-\x20'+_0x400ac4[_0xac4a('0x45')],'id_display':_0x400ac4['ticketNumber']},'auth':_0x3b175a,'json':!![]};return rp(_0x492aae)['then'](function(_0x52c957){_0x5222f3();})[_0xac4a('0x12')](function(){_0x5222f3();});});}function manageTags(_0x3bcae2,_0x3c2f84,_0x2f9940,_0xb7b884,_0x592a4b,_0x1e1ffa,_0x50dece){return new Promise(function(_0x34215e,_0x5d03e5){var _0x347880=[];_0x3c2f84[_0xac4a('0x2b')](function(_0x3da7e7){_0x347880[_0xac4a('0x46')](getRemoteTag(_0x3da7e7,_0x2f9940,_0xb7b884,_0x1e1ffa,_0x50dece));});return Promise[_0xac4a('0x47')](_0x347880)[_0xac4a('0xc')](function(_0x3abd57){if(_0x3abd57[_0xac4a('0x1c')]){logger[_0xac4a('0x15')]('['+[_0x3bcae2[_0xac4a('0x10')]()]+_0xac4a('0x48'),_0x3abd57);var _0x2498ad=[];_0x3abd57[_0xac4a('0x2b')](function(_0x2cc410){_0x2498ad[_0xac4a('0x46')](assignTagToIncident(_0x2cc410,_0x2f9940,_0xb7b884,_0x592a4b,_0x1e1ffa));});return Promise[_0xac4a('0x47')](_0x2498ad)[_0xac4a('0xc')](function(){_0x34215e();})['catch'](function(){_0x34215e();});}else{_0x34215e();}});});}function getTags(_0xa90d71,_0x1672c0,_0x4fb812,_0x3c3576,_0x34bd1c,_0x2d24c7){return function(_0x2b8562){return new Promise(function(_0x357cac,_0x4d1440){var _0x47c6d8=[];var _0x45f3c3=_0x3c3576[_0xac4a('0x49')];if(_0x45f3c3&&_0x45f3c3[_0xac4a('0x1c')]>0x0){_0x47c6d8=_[_0xac4a('0x4a')](_0x45f3c3,_0xac4a('0x38'));}if(_0x47c6d8[_0xac4a('0x1c')]>0x0){return manageTags(_0xa90d71,_0x47c6d8,_0x1672c0,_0x4fb812,_0x2b8562,_0x34bd1c,_0x2d24c7)[_0xac4a('0xc')](function(){_0x357cac(_0x2b8562);});}else{_0x357cac(_0x2b8562);}});};}function emit(_0x2988d7,_0x44c60b,_0x295f21){var _0x278c09='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xac4a('0x4b')+_0xac4a('0x4c');var _0x2954fc={'uri':_0x2988d7+_0xac4a('0x4d')+_0x295f21+_0x278c09};io['to'](util[_0xac4a('0x4e')](_0xac4a('0x4f'),_0x44c60b))[_0xac4a('0x50')](_0xac4a('0x51'),_0x2954fc);}exports['cs']=function(_0x453d62,_0x2a5acc,_0xb09b89,_0xb12cc5,_0x5f0173,_0x13c854,_0xc74ce8,_0x26bd31){var _0x231932={};var _0x513976={'user':_0x13c854[_0xac4a('0x52')],'pass':_0x13c854['password']};var _0xab4305=_0xac4a('0x53');var _0x499abc='sysparm_display_value=true';_0x13c854[_0xac4a('0x54')]=intUtil[_0xac4a('0x55')](_0x13c854[_0xac4a('0x54')]);_0x13c854['serverUrl']=intUtil[_0xac4a('0x55')](_0x13c854['serverUrl']);var _0x114b11=util['format']('%s/api/now/table/',_0x13c854[_0xac4a('0x54')]);_0x231932['userEmail']=!_[_0xac4a('0x56')](_0xb12cc5)?_0xb12cc5['email']:null;_0x231932[_0xac4a('0x20')]=_0x13c854[_0xac4a('0x57')];_0x231932['endUserNumber']=_0x26bd31[_0xac4a('0x31')]()==='outbound'?_0x2a5acc[_0xac4a('0x58')]:_0x2a5acc[_0xac4a('0x59')];_0x231932['callDirection']=_0x26bd31===_0xac4a('0x5a')||_0x26bd31==='unmanaged'?'queue':_0xac4a('0x3a');var _0x4e3129=util[_0xac4a('0x4e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x13c854['serverUrl'],_0x2a5acc[_0xac4a('0x5b')],md5(_0x2a5acc[_0xac4a('0x5b')]));if(_0x5f0173&&_0x5f0173[_0xac4a('0x5c')]){logger['info']('[QUEUE]',_0xac4a('0x5d'));_0x2a5acc[_0xac4a('0x5e')]=_0x4e3129;}else if(_0xc74ce8&&_0xc74ce8['recordingFormat']&&_0xc74ce8['recordingFormat']!==_0xac4a('0x5f')){logger[_0xac4a('0x15')](_0xac4a('0x60'),_0xac4a('0x5d'));_0x2a5acc[_0xac4a('0x5e')]=_0x4e3129;}else{_0x2a5acc[_0xac4a('0x5e')]='';}return getAdminUser(_0x26bd31,_0x513976,_0x231932,_0x114b11,_0x499abc,_0xab4305)[_0xac4a('0xc')](getUser(_0x26bd31,_0x513976,_0x114b11,_0x499abc,_0xab4305))[_0xac4a('0xc')](getEndUser(_0x26bd31,_0x513976,_0x114b11,_0x499abc,_0xab4305))[_0xac4a('0xc')](getTicket(_0x26bd31,_0x513976,_0x114b11,_0xb09b89,_0x2a5acc,_0x499abc))['then'](function(_0x1201e8){logger[_0xac4a('0x15')](util[_0xac4a('0x4e')]('The\x20ticket\x20ID\x20is:\x20%s',_0x1201e8[_0xac4a('0x40')]));logger[_0xac4a('0x15')](util[_0xac4a('0x4e')](_0xac4a('0x61'),_0x26bd31));if(_0x26bd31!==_0xac4a('0x62')){logger['info']('['+[_0x26bd31[_0xac4a('0x10')]()]+']',_0xac4a('0x63'));emit(_0x13c854[_0xac4a('0x54')],_0xb12cc5[_0xac4a('0x38')],_0x1201e8[_0xac4a('0x40')]);}})[_0xac4a('0x12')](function(_0xd7bdd6){logger['error']('['+[_0x26bd31[_0xac4a('0x10')]()]+_0xac4a('0x64'),util[_0xac4a('0x65')](_0xd7bdd6,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x326f=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','inspect','lodash','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','then','result','adminId','sys_id','info','],\x20getAdminUser\x20crm','catch','error','message','toUpperCase','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','length','userId','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','true','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','type','nameField','customField','idField','toLowerCase','toString','string','content','variable','variableName','Variable',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','Incident\x20-\x20','forEach','push','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','password','sysparm_limit=1','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','email','destcalleridnum','callDirection','queue','unmanaged'];(function(_0x1dbf70,_0xaf94e){var _0x3c4b0c=function(_0x23e848){while(--_0x23e848){_0x1dbf70['push'](_0x1dbf70['shift']());}};_0x3c4b0c(++_0xaf94e);}(_0x326f,0xd1));var _0xf326=function(_0x5a3e44,_0x4fa2ba){_0x5a3e44=_0x5a3e44-0x0;var _0x385f31=_0x326f[_0x5a3e44];return _0x385f31;};'use strict';var _=require(_0xf326('0x0'));var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0xf326('0x1'));var md5=require(_0xf326('0x2'));var Redis=require(_0xf326('0x3'));var intUtil=require(_0xf326('0x4'));var config=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));config[_0xf326('0x8')]=_[_0xf326('0x9')](config[_0xf326('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xf326('0xa'))(new Redis(config[_0xf326('0x8')]));function getAdminUser(_0x165f95,_0x1e7b8a,_0x515bfa,_0x4c206c,_0x592975,_0x3bacf2){return new Promise(function(_0x1fc80e,_0x163416){var _0x2686e1={'method':_0xf326('0xb'),'uri':_0x4c206c+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x592975+'&'+_0x3bacf2,'auth':_0x1e7b8a,'json':!![]};return rp(_0x2686e1)[_0xf326('0xc')](function(_0x53cbcd){if(_0x53cbcd[_0xf326('0xd')]['length']>0x0){_0x515bfa[_0xf326('0xe')]=_0x53cbcd['result'][0x0][_0xf326('0xf')];}logger[_0xf326('0x10')]('['+[_0x165f95['toUpperCase']()]+_0xf326('0x11'),_0x515bfa);_0x1fc80e(_0x515bfa);})[_0xf326('0x12')](function(_0x3504eb){logger[_0xf326('0x13')]('['+[_0x165f95['toUpperCase']()]+']',_0x3504eb[_0xf326('0x14')]);_0x163416(_0x3504eb['message']);});});}function getUser(_0x54bd1a,_0xdf21d9,_0x11f6d2,_0x1f2e5a,_0xa63d1a){return function(_0x292f4b){logger[_0xf326('0x10')]('['+[_0x54bd1a[_0xf326('0x15')]()]+_0xf326('0x16'),_0x292f4b);return new Promise(function(_0x5a682a,_0x3ad7da){if(intUtil[_0xf326('0x17')](_0x292f4b[_0xf326('0x18')])){var _0x31ffb9={'method':_0xf326('0xb'),'uri':_0x11f6d2+_0xf326('0x19')+_0x292f4b['userEmail']+'&'+_0x1f2e5a+'&'+_0xa63d1a,'auth':_0xdf21d9,'json':!![]};logger['info']('['+[_0x54bd1a['toUpperCase']()]+_0xf326('0x1a'),_0x31ffb9);return rp(_0x31ffb9)[_0xf326('0xc')](function(_0x484cbe){logger['info']('['+[_0x54bd1a[_0xf326('0x15')]()]+'],\x20getUser\x20entity',_0x484cbe);if(_0x484cbe['result'][_0xf326('0x1b')]>0x0&&String(_0x484cbe[_0xf326('0xd')][0x0]['active'])==='true'){_0x292f4b[_0xf326('0x1c')]=_0x484cbe[_0xf326('0xd')][0x0]['sys_id'];}else{_0x292f4b[_0xf326('0x1c')]=_0x292f4b[_0xf326('0xe')];_0x292f4b[_0xf326('0x18')]=_0x292f4b[_0xf326('0x1d')];}logger[_0xf326('0x10')]('['+[_0x54bd1a[_0xf326('0x15')]()]+'],\x20getUser\x20crm',_0x292f4b);_0x5a682a(_0x292f4b);})['catch'](function(_0x4f31f6){logger[_0xf326('0x13')]('['+[_0x54bd1a[_0xf326('0x15')]()]+']',_0x4f31f6[_0xf326('0x14')]);_0x3ad7da(_0x4f31f6[_0xf326('0x14')]);});}else{logger[_0xf326('0x10')]('['+[_0x54bd1a[_0xf326('0x15')]()]+']\x20using\x20admin\x20profile');_0x292f4b[_0xf326('0x1c')]=_0x292f4b[_0xf326('0xe')];_0x292f4b[_0xf326('0x18')]=_0x292f4b['adminEmail'];_0x5a682a(_0x292f4b);}});};}function createEndUser(_0x1617d2,_0x55ad0f,_0x4a9abf,_0x6a8e89,_0x1ae23a){logger[_0xf326('0x10')]('['+[_0x1617d2['toUpperCase']()]+_0xf326('0x1e'),_0x4a9abf);return new Promise(function(_0x292500,_0x55790d){var _0x225776={'method':_0xf326('0x1f'),'uri':_0x6a8e89+_0xf326('0x20')+_0x1ae23a,'body':{'user_name':_0x4a9abf[_0xf326('0x21')],'roles':_0xf326('0x22'),'first_name':_0x4a9abf[_0xf326('0x21')],'active':_0xf326('0x23'),'date_format':_0xf326('0x24'),'phone':_0x4a9abf[_0xf326('0x21')]},'auth':_0x55ad0f,'json':!![]};return rp(_0x225776)[_0xf326('0xc')](function(_0x4b52f2){logger[_0xf326('0x10')]('['+[_0x1617d2[_0xf326('0x15')]()]+_0xf326('0x25'),_0x4b52f2['result']);_0x4a9abf[_0xf326('0x26')]=_0x4b52f2[_0xf326('0xd')][_0xf326('0xf')];_0x292500(_0x4a9abf);})['catch'](function(_0x5b101d){logger[_0xf326('0x13')]('['+[_0x1617d2[_0xf326('0x15')]()]+']',_0x5b101d[_0xf326('0x14')]);_0x55790d(_0x5b101d[_0xf326('0x14')]);});});}function getEndUser(_0x30694f,_0x2e8a64,_0x62585a,_0x2d5f20,_0x580374){return function(_0x461e93){logger[_0xf326('0x10')]('['+[_0x30694f['toUpperCase']()]+_0xf326('0x27'),_0x461e93);return new Promise(function(_0x4e5d7c,_0xce1cbb){var _0x481b64={'method':'GET','uri':_0x62585a+_0xf326('0x28')+_0x461e93['endUserNumber']+'&'+_0x2d5f20+'&'+_0x580374,'auth':_0x2e8a64,'json':!![]};return rp(_0x481b64)[_0xf326('0xc')](function(_0x57aa27){if(_0x57aa27[_0xf326('0xd')][_0xf326('0x1b')]>0x0){_0x461e93[_0xf326('0x26')]=_0x57aa27['result'][0x0][_0xf326('0xf')];logger[_0xf326('0x10')]('['+[_0x30694f['toUpperCase']()]+_0xf326('0x29'),_0x461e93);_0x4e5d7c(_0x461e93);}else{return createEndUser(_0x30694f,_0x2e8a64,_0x461e93,_0x62585a,_0x2d5f20)[_0xf326('0xc')](function(_0x40fa7a){logger[_0xf326('0x10')]('['+[_0x30694f['toUpperCase']()]+_0xf326('0x2a'),_0x40fa7a);_0x4e5d7c(_0x40fa7a);});}})[_0xf326('0x12')](function(_0x1e69b1){logger[_0xf326('0x13')]('['+[_0x30694f[_0xf326('0x15')]()]+']',_0x1e69b1['message']);_0xce1cbb(_0x1e69b1[_0xf326('0x14')]);});});};}function getCustomFields(_0x1b7bf6,_0x5cfb97){var _0x4dd361={};if(_0x1b7bf6[_0xf326('0x1b')]>0x0){_['forEach'](_0x1b7bf6,function(_0x55dfa8){if(_0x55dfa8[_0xf326('0x2b')]==='string'&&_0x55dfa8[_0xf326('0x2c')]&&!_0x55dfa8[_0xf326('0x2d')]){_0x4dd361[_0x55dfa8[_0xf326('0x2e')][_0xf326('0x2f')]()]=_0x55dfa8['content'][_0xf326('0x30')]();}else if(_0x55dfa8[_0xf326('0x2b')]===_0xf326('0x31')&&_0x55dfa8[_0xf326('0x2e')]&&_0x55dfa8[_0xf326('0x2d')]){_0x4dd361[_0x55dfa8[_0xf326('0x2e')][_0xf326('0x2f')]()]=_0x55dfa8[_0xf326('0x32')][_0xf326('0x30')]();}else if(_0x55dfa8[_0xf326('0x2b')]===_0xf326('0x33')&&_0x55dfa8[_0xf326('0x34')]&&_0x55dfa8['idField']&&_0x55dfa8[_0xf326('0x2d')]){_0x4dd361[_0x55dfa8[_0xf326('0x2e')][_0xf326('0x2f')]()]=_0x5cfb97[_0x55dfa8[_0xf326('0x34')]][_0xf326('0x30')]();}else if(_0x55dfa8[_0xf326('0x2b')]==='customVariable'&&_0x55dfa8[_0xf326('0x35')]&&_0x55dfa8[_0xf326('0x35')]['name']&&_0x55dfa8[_0xf326('0x2e')]&&_0x55dfa8[_0xf326('0x2d')]){_0x4dd361[_0x55dfa8[_0xf326('0x2e')][_0xf326('0x2f')]()]=_0x5cfb97[_0x55dfa8[_0xf326('0x35')]['name']['toLowerCase']()][_0xf326('0x30')]();}});}return _0x4dd361;}function getTicket(_0x44e101,_0x5ed62e,_0x4bd865,_0x8e318d,_0x269e89,_0x21c98e){return function(_0x5b3705){logger[_0xf326('0x10')]('['+[_0x44e101[_0xf326('0x15')]()]+_0xf326('0x36'),_0x5b3705);return new Promise(function(_0xc43507,_0xc99be){var _0x2d9bba=_0x44e101[_0xf326('0x2f')]()===_0xf326('0x37')?_0x5b3705[_0xf326('0x1c')]:_0x5b3705[_0xf326('0x26')];var _0x1c76c8={'method':_0xf326('0x1f'),'uri':_0x4bd865+_0xf326('0x38')+'?'+_0x21c98e,'body':Object[_0xf326('0x39')]({},{'active':_0xf326('0x23'),'caller_id':_0x2d9bba,'assigned_to':_0x5b3705['userId'],'short_description':intUtil[_0xf326('0x3a')](_0x8e318d[_0xf326('0x3b')],_0x269e89,'\x20'),'description':intUtil[_0xf326('0x3a')](_0x8e318d[_0xf326('0x3c')],_0x269e89,'\x0a')},getCustomFields(_0x8e318d['Fields'],_0x269e89)),'auth':_0x5ed62e,'json':!![]};return rp(_0x1c76c8)[_0xf326('0xc')](function(_0x2f5511){logger[_0xf326('0x10')]('['+[_0x44e101[_0xf326('0x15')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x2f5511[_0xf326('0xd')]);_0x5b3705[_0xf326('0x3d')]=_0x2f5511[_0xf326('0xd')][_0xf326('0xf')];_0x5b3705[_0xf326('0x3e')]=_0x2f5511['result']['number'];logger[_0xf326('0x10')]('['+[_0x44e101[_0xf326('0x15')]()]+_0xf326('0x3f'),_0x5b3705);_0xc43507(_0x5b3705);})['catch'](function(_0x102fba){logger[_0xf326('0x13')]('['+[_0x44e101[_0xf326('0x15')]()]+']',_0x102fba['message']);_0xc99be(_0x102fba['message']);});});};}function createRemoteTag(_0x36ef89,_0x5b4832,_0x1cf58f,_0x554277){return new Promise(function(_0x458e5f,_0x7ee57){var _0x28c959={'method':_0xf326('0x1f'),'uri':_0x1cf58f+_0xf326('0x40')+'?'+_0x554277,'body':{'short_description':_0x36ef89,'global':!![],'active':!![],'name':_0x36ef89},'auth':_0x5b4832,'json':!![]};return rp(_0x28c959)[_0xf326('0xc')](function(_0x7f7ece){var _0x495a16=_0x7f7ece[_0xf326('0xd')][_0xf326('0xf')];_0x458e5f(_0x495a16);});});}function getRemoteTag(_0x424d24,_0x4b0d8e,_0x208ba4,_0x3a832f,_0x3b8635){return new Promise(function(_0x16c578,_0x1159e){var _0x58fcf0={'method':_0xf326('0xb'),'uri':_0x208ba4+_0xf326('0x40')+_0xf326('0x41')+_0x424d24+'&'+_0x3a832f,'auth':_0x4b0d8e,'json':!![]};return rp(_0x58fcf0)[_0xf326('0xc')](function(_0x50690e){if(_0x50690e[_0xf326('0xd')][_0xf326('0x1b')]>0x0){var _0x227850=_0x50690e[_0xf326('0xd')][0x0]['sys_id'];_0x16c578(_0x227850);}else{return createRemoteTag(_0x424d24,_0x4b0d8e,_0x208ba4,_0x3a832f)['then'](function(_0x18b46e){_0x16c578(_0x18b46e);});}});});}function assignTagToIncident(_0x44d2ed,_0x55ca96,_0x3cf6fa,_0x29de71,_0x316609){return new Promise(function(_0x1258d1,_0x5765b0){var _0xb1c18c={'method':'POST','uri':_0x3cf6fa+'label_entry'+'?'+_0x316609,'body':{'label':_0x44d2ed,'table':_0xf326('0x38'),'id_type':'Incident','table_key':_0x29de71[_0xf326('0x3d')],'title':_0xf326('0x42')+_0x29de71[_0xf326('0x3e')],'id_display':_0x29de71['ticketNumber']},'auth':_0x55ca96,'json':!![]};return rp(_0xb1c18c)['then'](function(_0x1fd9c9){_0x1258d1();})[_0xf326('0x12')](function(){_0x1258d1();});});}function manageTags(_0x33b259,_0x5d0177,_0x2759d7,_0x487020,_0xe4a00d,_0x40929c,_0x131184){return new Promise(function(_0x217897,_0xbd3a01){var _0x18dbfc=[];_0x5d0177[_0xf326('0x43')](function(_0x3aeb20){_0x18dbfc[_0xf326('0x44')](getRemoteTag(_0x3aeb20,_0x2759d7,_0x487020,_0x40929c,_0x131184));});return Promise[_0xf326('0x45')](_0x18dbfc)[_0xf326('0xc')](function(_0x1e56fb){if(_0x1e56fb[_0xf326('0x1b')]){logger['info']('['+[_0x33b259[_0xf326('0x15')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x1e56fb);var _0x6ac6=[];_0x1e56fb[_0xf326('0x43')](function(_0x5e858d){_0x6ac6[_0xf326('0x44')](assignTagToIncident(_0x5e858d,_0x2759d7,_0x487020,_0xe4a00d,_0x40929c));});return Promise['all'](_0x6ac6)[_0xf326('0xc')](function(){_0x217897();})[_0xf326('0x12')](function(){_0x217897();});}else{_0x217897();}});});}function getTags(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x51ff5e,_0x4ec099,_0x1209ca){return function(_0x32fe3a){return new Promise(function(_0x15a538,_0x21b3cc){var _0x1fc586=[];var _0x579d2c=_0x51ff5e[_0xf326('0x46')];if(_0x579d2c&&_0x579d2c[_0xf326('0x1b')]>0x0){_0x1fc586=_['map'](_0x579d2c,'name');}if(_0x1fc586['length']>0x0){return manageTags(_0x28f3cb,_0x1fc586,_0x2d45c9,_0x31b6dd,_0x32fe3a,_0x4ec099,_0x1209ca)[_0xf326('0xc')](function(){_0x15a538(_0x32fe3a);});}else{_0x15a538(_0x32fe3a);}});};}function emit(_0x7edf5,_0x4150fa,_0x235525){var _0x240ce5=_0xf326('0x47')+_0xf326('0x48')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xf326('0x49');var _0x588d26={'uri':_0x7edf5+_0xf326('0x4a')+_0x235525+_0x240ce5};io['to'](util[_0xf326('0x4b')]('user:%s',_0x4150fa))[_0xf326('0x4c')]('trigger:browser:url',_0x588d26);}exports['cs']=function(_0x499b59,_0x2dd9e4,_0x540fa0,_0x78ba34,_0x3411a4,_0x461059,_0x2ea5a2,_0x17cd36){var _0x541491={};var _0x4a053c={'user':_0x461059['username'],'pass':_0x461059[_0xf326('0x4d')]};var _0x307441=_0xf326('0x4e');var _0x180616=_0xf326('0x4f');_0x461059['remoteUri']=intUtil[_0xf326('0x50')](_0x461059[_0xf326('0x51')]);_0x461059[_0xf326('0x52')]=intUtil['stripTrailingSlash'](_0x461059['serverUrl']);var _0x830c9f=util[_0xf326('0x4b')]('%s/api/now/table/',_0x461059['remoteUri']);_0x541491[_0xf326('0x18')]=!_['isNil'](_0x78ba34)?_0x78ba34[_0xf326('0x53')]:null;_0x541491['adminEmail']=_0x461059['email'];_0x541491['endUserNumber']=_0x17cd36[_0xf326('0x2f')]()===_0xf326('0x37')?_0x2dd9e4[_0xf326('0x54')]:_0x2dd9e4['calleridnum'];_0x541491[_0xf326('0x55')]=_0x17cd36===_0xf326('0x56')||_0x17cd36===_0xf326('0x57')?_0xf326('0x56'):_0xf326('0x37');var _0x39e73d=util[_0xf326('0x4b')](_0xf326('0x58'),_0x461059[_0xf326('0x52')],_0x2dd9e4['uniqueid'],md5(_0x2dd9e4[_0xf326('0x59')]));if(_0x3411a4&&_0x3411a4['monitor_format']){logger[_0xf326('0x10')](_0xf326('0x5a'),_0xf326('0x5b'));_0x2dd9e4['recordingURL']=_0x39e73d;}else if(_0x2ea5a2&&_0x2ea5a2[_0xf326('0x5c')]&&_0x2ea5a2[_0xf326('0x5c')]!==_0xf326('0x5d')){logger['info'](_0xf326('0x5e'),_0xf326('0x5b'));_0x2dd9e4[_0xf326('0x5f')]=_0x39e73d;}else{_0x2dd9e4[_0xf326('0x5f')]='';}return getAdminUser(_0x17cd36,_0x4a053c,_0x541491,_0x830c9f,_0x180616,_0x307441)['then'](getUser(_0x17cd36,_0x4a053c,_0x830c9f,_0x180616,_0x307441))[_0xf326('0xc')](getEndUser(_0x17cd36,_0x4a053c,_0x830c9f,_0x180616,_0x307441))['then'](getTicket(_0x17cd36,_0x4a053c,_0x830c9f,_0x540fa0,_0x2dd9e4,_0x180616))['then'](function(_0x32d9c5){logger[_0xf326('0x10')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x32d9c5['ticketId']));logger[_0xf326('0x10')](util['format'](_0xf326('0x60'),_0x17cd36));if(_0x17cd36!==_0xf326('0x57')){logger[_0xf326('0x10')]('['+[_0x17cd36[_0xf326('0x15')]()]+']',_0xf326('0x61'));emit(_0x461059[_0xf326('0x51')],_0x78ba34['name'],_0x32d9c5[_0xf326('0x3d')]);}})[_0xf326('0x12')](function(_0x5f1724){logger['error']('['+[_0x17cd36[_0xf326('0x15')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util[_0xf326('0x62')](_0x5f1724,{'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 99f1d65..0a65762 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 _0x0424=['set_entry','JSON','stringify','format','Basic\x20%s','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','find','name_value_list','user_name','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','value','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','map','customField','nameField','type','custom_fields','push','content','toString','variable','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','The\x20Ticket\x20ID\x20is:','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','Ticket\x20created!','users','trigger:browser:url','unmanaged','lastevent','Inbound','bluebird','md5','util','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','getString','Descriptions','date_start','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','forEach','variableName','idField'];(function(_0x69cb22,_0x45eaba){var _0x1ebc2e=function(_0x3fb9df){while(--_0x3fb9df){_0x69cb22['push'](_0x69cb22['shift']());}};_0x1ebc2e(++_0x45eaba);}(_0x0424,0x159));var _0x4042=function(_0x3e8930,_0x154364){_0x3e8930=_0x3e8930-0x0;var _0x15b38f=_0x0424[_0x3e8930];return _0x15b38f;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x4042('0x0'));var md5=require(_0x4042('0x1'));var util=require(_0x4042('0x2'));var Redis=require(_0x4042('0x3'));var intUtil=require('./util');var config=require(_0x4042('0x4'));var logger=require('../../../../config/logger')('sugarcrm');config[_0x4042('0x5')]=_[_0x4042('0x6')](config[_0x4042('0x5')],{'host':_0x4042('0x7'),'port':0x18eb});var io=require(_0x4042('0x8'))(new Redis(config[_0x4042('0x5')]));var def={'method':_0x4042('0x9'),'json':!![]};function emit(_0x5d11bf,_0x509772,_0x280cd6){io['to'](_0x5d11bf)[_0x4042('0xa')](_0x509772,_0x280cd6);}function getTicket(_0x103e4a,_0x4b92d2,_0x341152,_0x11c0f7,_0x2376a4,_0x2cbc75,_0x1c2984,_0x424961){logger[_0x4042('0xb')](_0x4042('0xc'));var _0x4af3ba=new Date();var _0x2c06ae=[{'name':_0x4042('0xd'),'value':intUtil['getString'](_0x11c0f7[_0x4042('0xe')],_0x2376a4,'\x20')},{'name':_0x4042('0xf'),'value':_0x4b92d2['id']},{'name':_0x4042('0x10'),'value':_0x4b92d2['id']},{'name':_0x4042('0x11'),'value':intUtil[_0x4042('0x12')](_0x11c0f7[_0x4042('0x13')],_0x2376a4,'\x0a')},{'name':_0x4042('0x14'),'value':_0x4af3ba['toISOString']()[_0x4042('0x15')](0x0,0x13)[_0x4042('0x16')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x4042('0x17'),'value':'15'},{'name':_0x4042('0x18'),'value':_0x341152['id']},{'name':_0x4042('0x19'),'value':_0x4042('0x1a')},{'name':_0x4042('0x1b'),'value':_0x341152[_0x4042('0xd')]},{'name':_0x4042('0x1c'),'value':_0x424961}];if(_0x2cbc75[_0x4042('0x1d')]){_[_0x4042('0x1e')](_0x2cbc75,function(_0x4b02d4){if(_0x2376a4[_0x4b02d4[_0x4042('0x1f')]]){_0x2c06ae['push']({'name':_0x4b02d4[_0x4042('0x20')],'value':_0x2376a4[_0x4b02d4['variableName']]});}});}return request({'form':{'method':_0x4042('0x21'),'input_type':_0x4042('0x22'),'response_type':_0x4042('0x22'),'rest_data':JSON[_0x4042('0x23')]({'session':_0x1c2984['id'],'module_name':'Calls','name_value_list':_0x2c06ae})}});}function getAuth(_0xb72021){return util[_0x4042('0x24')](_0x4042('0x25'),new Buffer(_0xb72021[_0x4042('0x26')]+':X')['toString'](_0x4042('0x27')));}function getServerInfo(_0xf0e0c6){return request({'form':{'method':_0x4042('0x28'),'input_type':_0x4042('0x22'),'response_type':_0x4042('0x22'),'rest_data':JSON['stringify']({'session':_0xf0e0c6['id']})}});}function getUser(_0x1f9d4a,_0x6d12a5,_0x519f2c){if(!_[_0x4042('0x29')](_0x6d12a5)){logger['info'](_0x4042('0x2a'),_0x6d12a5);return request({'form':{'method':_0x4042('0x2b'),'input_type':_0x4042('0x22'),'response_type':'JSON','rest_data':JSON[_0x4042('0x23')]({'session':_0x519f2c['id'],'module_name':_0x4042('0x2c'),'query':util[_0x4042('0x24')](_0x4042('0x2d'),_0x6d12a5),'order_by':'','offset':'0','select_fields':['id',_0x4042('0xd'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1d8d48){if(_0x1d8d48[_0x4042('0x2e')][_0x4042('0x1d')]){var _0x3e5c02=_[_0x4042('0x2f')](_0x1d8d48[_0x4042('0x2e')],function(_0x5eb84b){return _0x5eb84b[_0x4042('0x30')][_0x4042('0x31')]['value']===_0x6d12a5;});if(_0x3e5c02){logger[_0x4042('0xb')](_0x4042('0x32'));return BPromise[_0x4042('0x33')]({'id':_0x3e5c02['name_value_list']['id']['value'],'name':_0x3e5c02[_0x4042('0x30')][_0x4042('0xd')]['value']});}}logger[_0x4042('0xb')](_0x4042('0x34'));return BPromise[_0x4042('0x33')]({'id':_0x519f2c[_0x4042('0x30')][_0x4042('0x35')][_0x4042('0x36')],'name':_0x519f2c[_0x4042('0x30')][_0x4042('0x31')][_0x4042('0x36')]});});}else{logger['info'](_0x4042('0x37'));return BPromise[_0x4042('0x33')]({'id':_0x519f2c['name_value_list'][_0x4042('0x35')][_0x4042('0x36')],'name':_0x519f2c['name_value_list'][_0x4042('0x31')][_0x4042('0x36')]});}}function getEndUser(_0x1fa700,_0xaa7c99,_0x74626b,_0x1043a2){logger[_0x4042('0xb')](_0x4042('0x38'),_0x74626b);return request({'form':{'method':_0x4042('0x2b'),'input_type':_0x4042('0x22'),'response_type':_0x4042('0x22'),'rest_data':JSON[_0x4042('0x23')]({'session':_0x1043a2['id'],'module_name':_0x4042('0x1a'),'query':util[_0x4042('0x24')](_0x4042('0x39'),_0x74626b),'order_by':'','offset':'0','select_fields':['id',_0x4042('0xd'),_0x4042('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4042('0x3b')](function(_0x3555c0){if(_0x3555c0[_0x4042('0x2e')][_0x4042('0x1d')]){var _0x58667a=_[_0x4042('0x2f')](_0x3555c0[_0x4042('0x2e')],function(_0x16db8e){return _0x16db8e[_0x4042('0x30')]['phone_home'][_0x4042('0x36')]===_0x74626b;});if(_0x58667a){logger[_0x4042('0xb')](_0x4042('0x3c'));return BPromise[_0x4042('0x33')]({'id':_0x58667a[_0x4042('0x30')]['id'][_0x4042('0x36')],'name':_0x58667a[_0x4042('0x30')][_0x4042('0xd')][_0x4042('0x36')],'phone':_0x58667a[_0x4042('0x30')]['phone_home'][_0x4042('0x36')]});}}else{logger[_0x4042('0xb')](_0x4042('0x3d'));return request({'form':{'method':_0x4042('0x21'),'input_type':_0x4042('0x22'),'response_type':_0x4042('0x22'),'rest_data':JSON[_0x4042('0x23')]({'session':_0x1043a2['id'],'module_name':_0x4042('0x1a'),'name_value_list':[{'name':'first_name','value':_0xaa7c99!==''?_0xaa7c99:util[_0x4042('0x24')](_0x4042('0x3e'),_0x74626b)},{'name':_0x4042('0x3a'),'value':_0x74626b}]})}})[_0x4042('0x3b')](function(_0x3d215e){logger[_0x4042('0xb')](_0x4042('0x3f'));return BPromise[_0x4042('0x33')]({'id':_0x3d215e['id'],'name':_0x3d215e[_0x4042('0x2e')][_0x4042('0x40')][_0x4042('0x36')],'phone':_0x3d215e[_0x4042('0x2e')]['phone_home']['value']});});}});}function request(_0x929884){logger[_0x4042('0x41')]('[HTTP]',JSON[_0x4042('0x23')](_0x929884));return rp(_['merge'](def,_0x929884));}function getTags(_0x25c516,_0x411354){var _0x32ba6f=[];if(_0x25c516&&_0x25c516['length']>0x0){_0x32ba6f=_[_0x4042('0x42')](_0x25c516,_0x411354);}return _0x32ba6f;}function getCustomFields(_0x9b5583,_0x52947f){var _0x40ea84=[];var _0x3eb4ab={'custom_fields':[]};if(_0x9b5583[_0x4042('0x1d')]>0x0){_[_0x4042('0x1e')](_0x9b5583,function(_0x1a8712){if(_0x1a8712['type']==='string'&&_0x1a8712['nameField']&&!_0x1a8712[_0x4042('0x43')]){_0x3eb4ab[_0x1a8712[_0x4042('0x44')]['toLowerCase']()]=_0x1a8712['content']['toString']();}else if(_0x1a8712[_0x4042('0x45')]==='string'&&_0x1a8712['idField']&&_0x1a8712[_0x4042('0x43')]){_0x3eb4ab[_0x4042('0x46')][_0x4042('0x47')]({'id':_0x1a8712[_0x4042('0x20')],'value':_0x1a8712[_0x4042('0x48')][_0x4042('0x49')]()});}else if(_0x1a8712[_0x4042('0x45')]===_0x4042('0x4a')&&_0x1a8712[_0x4042('0x1f')]&&_0x1a8712['idField']&&_0x1a8712['customField']){_0x52947f[_0x1a8712['variableName']]&&_0x3eb4ab['custom_fields'][_0x4042('0x47')]({'id':_0x1a8712[_0x4042('0x20')],'value':_0x52947f[_0x1a8712[_0x4042('0x1f')]][_0x4042('0x49')]()});}else if(_0x1a8712[_0x4042('0x45')]===_0x4042('0x4b')&&_0x1a8712[_0x4042('0x4c')]&&_0x1a8712[_0x4042('0x4c')]['name']&&_0x1a8712[_0x4042('0x20')]&&_0x1a8712[_0x4042('0x43')]){_0x52947f[_0x1a8712[_0x4042('0x4c')][_0x4042('0xd')][_0x4042('0x4d')]()]&&_0x3eb4ab[_0x4042('0x46')][_0x4042('0x47')]({'id':_0x1a8712['idField'],'value':_0x52947f[_0x1a8712['Variable']['name'][_0x4042('0x4d')]()][_0x4042('0x49')]()});}});}return _0x3eb4ab;}function getConnection(_0x5a9ffc){return request({'method':_0x4042('0x9'),'form':{'method':_0x4042('0x4e'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x4042('0x23')]({'user_auth':{'user_name':_0x5a9ffc[_0x4042('0x4f')],'password':_0x5a9ffc[_0x4042('0x50')],'encryption':_0x4042('0x51')},'application':_0x4042('0x52')})}})[_0x4042('0x3b')](function(_0x111925){var _0xa3c62c=_0x111925;if(_0xa3c62c['id']){def[_0x4042('0x53')]=_0xa3c62c['id'];return BPromise[_0x4042('0x33')](_0xa3c62c);}else{throw new Error(util[_0x4042('0x24')](_0x4042('0x54'),_0x5a9ffc['id']));}});}function setRelationship(_0x3876ce,_0x58f3b7,_0x51d1ba,_0x1a5d2a){return request({'form':{'method':_0x4042('0x55'),'input_type':_0x4042('0x22'),'response_type':'JSON','rest_data':JSON[_0x4042('0x23')]({'session':_0x3876ce['id'],'module_name':'Calls','module_id':_0x51d1ba['id'],'link_field_name':_0x1a5d2a,'related_ids':[_0x58f3b7['id']]})}});}exports[_0x4042('0x56')]=function(_0x51a149,_0x15c491,_0x1cba67,_0x22b633,_0x3a084f,_0x2fcc1d){var _0xb8af84,_0x53a3c,_0x2ea152,_0x3c7622;_0x2fcc1d['remoteUri']=intUtil[_0x4042('0x57')](_0x2fcc1d[_0x4042('0x58')]);_0x2fcc1d[_0x4042('0x59')]=intUtil[_0x4042('0x57')](_0x2fcc1d[_0x4042('0x59')]);def[_0x4042('0x5a')]=util['format'](_0x4042('0x5b'),_0x2fcc1d[_0x4042('0x58')]);if(_0x3a084f&&_0x3a084f[_0x4042('0x5c')]){logger['info'](_0x4042('0x5d'),_0x4042('0x5e'));_0x15c491[_0x4042('0x5f')]=util[_0x4042('0x24')](_0x4042('0x60'),_0x2fcc1d[_0x4042('0x59')],_0x15c491[_0x4042('0x61')],md5(_0x15c491[_0x4042('0x61')]));}else{_0x15c491[_0x4042('0x5f')]='';}return getConnection(_0x2fcc1d)[_0x4042('0x3b')](function(_0x4d8d9f){_0x3c7622=_0x4d8d9f;return getUser(_0x2fcc1d,_0x22b633[_0x4042('0xd')],_0x3c7622);})['then'](function(_0x5bc6b1){_0xb8af84=_0x5bc6b1;logger[_0x4042('0xb')](_0x4042('0x62'),_0xb8af84['id']);return getEndUser(_0x2fcc1d,_0x15c491[_0x4042('0x63')],_0x15c491[_0x4042('0x64')],_0x3c7622);})['then'](function(_0x9d508f){_0x53a3c=_0x9d508f;logger['info']('The\x20Enduser\x20ID\x20is:',_0x53a3c['id']);return getTicket(_0x2fcc1d,_0xb8af84,_0x53a3c,_0x1cba67,_0x15c491,_0x1cba67[_0x4042('0x65')],_0x3c7622,'Inbound');})[_0x4042('0x3b')](function(_0x21d8b1){_0x2ea152=_0x21d8b1;logger[_0x4042('0xb')]('Ticket\x20created!');logger[_0x4042('0xb')](_0x4042('0x66'),_0x2ea152['id']);return setRelationship(_0x3c7622,_0xb8af84,_0x2ea152,'users');})[_0x4042('0x3b')](function(){return setRelationship(_0x3c7622,_0x53a3c,_0x2ea152,_0x4042('0x67'));})[_0x4042('0x3b')](function(){return getServerInfo(_0x3c7622);})['then'](function(_0x5486b0){var _0x4ddd67=parseInt(_0x5486b0[_0x4042('0x68')][_0x4042('0x69')](0x0));var _0x542ebd=util[_0x4042('0x24')](_0x4042('0x6a'),_0x2fcc1d[_0x4042('0x58')],_0x2ea152['id']);if(_0x4ddd67>0x6){_0x542ebd=util[_0x4042('0x24')](_0x4042('0x6b'),_0x2fcc1d[_0x4042('0x58')],_0x2ea152['id']);}logger[_0x4042('0xb')]('[QUEUE]',_0x4042('0x6c'));emit(util[_0x4042('0x24')](_0x4042('0x6d'),_0x22b633['name']),'trigger:browser:url',{'uri':_0x542ebd});})[_0x4042('0x6e')](function(_0x556576){logger[_0x4042('0x6f')](_0x4042('0x5d'),JSON[_0x4042('0x23')](_0x556576));});};exports[_0x4042('0x70')]=function(_0x17a38c,_0x4b4994,_0x5b728b,_0x28a62c,_0xb80cf3,_0x3bb5dd,_0x4b2c5f){var _0x1f01f5,_0x5ab013,_0x2a75c8,_0x51a453;_0x3bb5dd[_0x4042('0x58')]=intUtil['stripTrailingSlash'](_0x3bb5dd[_0x4042('0x58')]);_0x3bb5dd[_0x4042('0x59')]=intUtil[_0x4042('0x57')](_0x3bb5dd[_0x4042('0x59')]);def[_0x4042('0x5a')]=util['format'](_0x4042('0x5b'),_0x3bb5dd[_0x4042('0x58')]);if(_0x4b2c5f&&_0x4b2c5f[_0x4042('0x71')]&&_0x4b2c5f[_0x4042('0x71')]!==_0x4042('0x72')){logger[_0x4042('0xb')](_0x4042('0x73'),_0x4042('0x5e'));_0x4b4994[_0x4042('0x5f')]=util[_0x4042('0x24')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3bb5dd[_0x4042('0x59')],_0x4b4994[_0x4042('0x61')],md5(_0x4b4994[_0x4042('0x61')]));}return getConnection(_0x3bb5dd)['then'](function(_0x2c340a){_0x51a453=_0x2c340a;return getUser(_0x3bb5dd,_0x28a62c[_0x4042('0xd')],_0x51a453);})[_0x4042('0x3b')](function(_0x2cc96a){_0x1f01f5=_0x2cc96a;logger['info'](_0x4042('0x62'),_0x1f01f5['id']);return getEndUser(_0x3bb5dd,_0x4b4994[_0x4042('0x74')],_0x4b4994[_0x4042('0x75')],_0x51a453);})['then'](function(_0x45d044){_0x5ab013=_0x45d044;logger[_0x4042('0xb')](_0x4042('0x76'),_0x5ab013['id']);return getTicket(_0x3bb5dd,_0x1f01f5,_0x5ab013,_0x5b728b,_0x4b4994,_0x5b728b[_0x4042('0x65')],_0x51a453,_0x4042('0x77'));})[_0x4042('0x3b')](function(_0x427165){_0x2a75c8=_0x427165;logger[_0x4042('0xb')](_0x4042('0x78'));logger[_0x4042('0xb')](_0x4042('0x66'),_0x2a75c8['id']);return setRelationship(_0x51a453,_0x1f01f5,_0x2a75c8,_0x4042('0x79'));})['then'](function(){return setRelationship(_0x51a453,_0x5ab013,_0x2a75c8,_0x4042('0x67'));})[_0x4042('0x3b')](function(){return getServerInfo(_0x51a453);})['then'](function(_0x565305){var _0x4c8e19=parseInt(_0x565305[_0x4042('0x68')][_0x4042('0x69')](0x0));var _0x56b0c4=util[_0x4042('0x24')](_0x4042('0x6a'),_0x3bb5dd['remoteUri'],_0x2a75c8['id']);if(_0x4c8e19>0x6){_0x56b0c4=util[_0x4042('0x24')](_0x4042('0x6b'),_0x3bb5dd[_0x4042('0x58')],_0x2a75c8['id']);}logger['info'](_0x4042('0x73'),_0x4042('0x6c'));emit(util[_0x4042('0x24')](_0x4042('0x6d'),_0x28a62c[_0x4042('0xd')]),_0x4042('0x7a'),{'uri':_0x56b0c4});})[_0x4042('0x6e')](function(_0x4b3836){logger[_0x4042('0x6f')](_0x4042('0x73'),JSON[_0x4042('0x23')](_0x4b3836));});};exports[_0x4042('0x7b')]=function(_0x2396b6,_0x51b7cb,_0x2eb9cd,_0xa0e536,_0x1f7906,_0x3a3e03){var _0x5c898c,_0x437f8b,_0x366137,_0x25a659;_0x3a3e03['remoteUri']=intUtil[_0x4042('0x57')](_0x3a3e03[_0x4042('0x58')]);_0x3a3e03[_0x4042('0x59')]=intUtil[_0x4042('0x57')](_0x3a3e03[_0x4042('0x59')]);def[_0x4042('0x5a')]=util[_0x4042('0x24')](_0x4042('0x5b'),_0x3a3e03[_0x4042('0x58')]);if(_0x1f7906&&_0x1f7906[_0x4042('0x5c')]){logger[_0x4042('0xb')]('['+_0x51b7cb[_0x4042('0x7c')]['toUpperCase']()+']',_0x4042('0x5e'));_0x51b7cb[_0x4042('0x5f')]=util[_0x4042('0x24')](_0x4042('0x60'),_0x3a3e03['serverUrl'],_0x51b7cb[_0x4042('0x61')],md5(_0x51b7cb[_0x4042('0x61')]));}else{_0x51b7cb[_0x4042('0x5f')]='';}return getConnection(_0x3a3e03)[_0x4042('0x3b')](function(_0x2cdf35){_0x25a659=_0x2cdf35;if(!_[_0x4042('0x29')](_0xa0e536)){return getUser(_0x3a3e03,_0xa0e536[_0x4042('0xd')],_0x25a659);}else{return getUser(_0x3a3e03,null,_0x25a659);}})[_0x4042('0x3b')](function(_0x49bca4){_0x5c898c=_0x49bca4;logger['info'](_0x4042('0x62'),_0x5c898c['id']);return getEndUser(_0x3a3e03,_0x51b7cb[_0x4042('0x63')],_0x51b7cb[_0x4042('0x64')],_0x25a659);})['then'](function(_0x534a83){_0x437f8b=_0x534a83;logger[_0x4042('0xb')]('The\x20Enduser\x20ID\x20is:',_0x437f8b['id']);return getTicket(_0x3a3e03,_0x5c898c,_0x437f8b,_0x2eb9cd,_0x51b7cb,_0x2eb9cd['Fields'],_0x25a659,_0x4042('0x7d'));})[_0x4042('0x3b')](function(_0x242335){_0x366137=_0x242335;logger[_0x4042('0xb')]('Ticket\x20created!');logger[_0x4042('0xb')]('The\x20Ticket\x20ID\x20is:',_0x366137['id']);return setRelationship(_0x25a659,_0x5c898c,_0x366137,'users');})[_0x4042('0x3b')](function(){return setRelationship(_0x25a659,_0x437f8b,_0x366137,_0x4042('0x67'));})[_0x4042('0x3b')](function(){return getServerInfo(_0x25a659);})['catch'](function(_0x5896d3){logger['error']('['+_0x51b7cb['lastevent']['toUpperCase']()+']',JSON[_0x4042('0x23')](_0x5896d3));});}; \ No newline at end of file +var _0x4819=['idField','variableName','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','get_server_info','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','length','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','type','string','nameField','customField','toLowerCase','content','custom_fields','push','variable','customVariable','Variable','login','username','password','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','contacts','charAt','unmanaged','lastevent','toUpperCase','isNil','Fields','users','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','POST','info','Creating\x20new\x20ticket...','name','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','replace','duration_hours','parent_id','Contacts','parent_name','direction'];(function(_0x3dafea,_0x6aa734){var _0x5d241c=function(_0x494c68){while(--_0x494c68){_0x3dafea['push'](_0x3dafea['shift']());}};_0x5d241c(++_0x6aa734);}(_0x4819,0xcd));var _0x9481=function(_0x3a42fa,_0x55e471){_0x3a42fa=_0x3a42fa-0x0;var _0x30dcba=_0x4819[_0x3a42fa];return _0x30dcba;};'use strict';var _=require('lodash');var rp=require(_0x9481('0x0'));var BPromise=require(_0x9481('0x1'));var md5=require(_0x9481('0x2'));var util=require(_0x9481('0x3'));var Redis=require(_0x9481('0x4'));var intUtil=require(_0x9481('0x5'));var config=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));config[_0x9481('0x9')]=_['defaults'](config[_0x9481('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9481('0x9')]));var def={'method':_0x9481('0xa'),'json':!![]};function emit(_0x27c033,_0x3278ff,_0x15d895){io['to'](_0x27c033)['emit'](_0x3278ff,_0x15d895);}function getTicket(_0x1818cf,_0x521d18,_0x2fabf1,_0x564d5b,_0x411d24,_0x2d5d0f,_0x2d4d44,_0x3ffe85){logger[_0x9481('0xb')](_0x9481('0xc'));var _0xa38c93=new Date();var _0xe410c3=[{'name':_0x9481('0xd'),'value':intUtil['getString'](_0x564d5b['Subjects'],_0x411d24,'\x20')},{'name':_0x9481('0xe'),'value':_0x521d18['id']},{'name':_0x9481('0xf'),'value':_0x521d18['id']},{'name':_0x9481('0x10'),'value':intUtil[_0x9481('0x11')](_0x564d5b[_0x9481('0x12')],_0x411d24,'\x0a')},{'name':_0x9481('0x13'),'value':_0xa38c93[_0x9481('0x14')]()['slice'](0x0,0x13)[_0x9481('0x15')]('T','\x20')},{'name':_0x9481('0x16'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x9481('0x17'),'value':_0x2fabf1['id']},{'name':'parent_type','value':_0x9481('0x18')},{'name':_0x9481('0x19'),'value':_0x2fabf1[_0x9481('0xd')]},{'name':_0x9481('0x1a'),'value':_0x3ffe85}];if(_0x2d5d0f['length']){_['forEach'](_0x2d5d0f,function(_0x20473d){if(_0x411d24[_0x20473d['variableName']]){_0xe410c3['push']({'name':_0x20473d[_0x9481('0x1b')],'value':_0x411d24[_0x20473d[_0x9481('0x1c')]]});}});}return request({'form':{'method':_0x9481('0x1d'),'input_type':_0x9481('0x1e'),'response_type':_0x9481('0x1e'),'rest_data':JSON[_0x9481('0x1f')]({'session':_0x2d4d44['id'],'module_name':'Calls','name_value_list':_0xe410c3})}});}function getAuth(_0x2cf1aa){return util[_0x9481('0x20')](_0x9481('0x21'),new Buffer(_0x2cf1aa[_0x9481('0x22')]+':X')[_0x9481('0x23')]('base64'));}function getServerInfo(_0x215dd7){return request({'form':{'method':_0x9481('0x24'),'input_type':'JSON','response_type':_0x9481('0x1e'),'rest_data':JSON[_0x9481('0x1f')]({'session':_0x215dd7['id']})}});}function getUser(_0x352b3a,_0x1809d2,_0x2dc02e){if(!_['isNil'](_0x1809d2)){logger[_0x9481('0xb')](_0x9481('0x25'),_0x1809d2);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0x9481('0x1e'),'rest_data':JSON[_0x9481('0x1f')]({'session':_0x2dc02e['id'],'module_name':'Employees','query':util[_0x9481('0x20')](_0x9481('0x26'),_0x1809d2),'order_by':'','offset':'0','select_fields':['id',_0x9481('0xd'),_0x9481('0x27')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x14f03e){if(_0x14f03e[_0x9481('0x28')][_0x9481('0x29')]){var _0x587706=_[_0x9481('0x2a')](_0x14f03e['entry_list'],function(_0x2e1eff){return _0x2e1eff[_0x9481('0x2b')][_0x9481('0x27')][_0x9481('0x2c')]===_0x1809d2;});if(_0x587706){logger[_0x9481('0xb')]('Agent\x20found!');return BPromise[_0x9481('0x2d')]({'id':_0x587706[_0x9481('0x2b')]['id'][_0x9481('0x2c')],'name':_0x587706['name_value_list']['name'][_0x9481('0x2c')]});}}logger[_0x9481('0xb')](_0x9481('0x2e'));return BPromise[_0x9481('0x2d')]({'id':_0x2dc02e['name_value_list']['user_id']['value'],'name':_0x2dc02e[_0x9481('0x2b')]['user_name'][_0x9481('0x2c')]});});}else{logger['info'](_0x9481('0x2f'));return BPromise[_0x9481('0x2d')]({'id':_0x2dc02e[_0x9481('0x2b')][_0x9481('0x30')][_0x9481('0x2c')],'name':_0x2dc02e['name_value_list'][_0x9481('0x27')][_0x9481('0x2c')]});}}function getEndUser(_0x2323c7,_0x529a0b,_0x30063f,_0x2079b1){logger[_0x9481('0xb')](_0x9481('0x31'),_0x30063f);return request({'form':{'method':_0x9481('0x32'),'input_type':_0x9481('0x1e'),'response_type':'JSON','rest_data':JSON[_0x9481('0x1f')]({'session':_0x2079b1['id'],'module_name':'Contacts','query':util[_0x9481('0x20')](_0x9481('0x33'),_0x30063f),'order_by':'','offset':'0','select_fields':['id',_0x9481('0xd'),_0x9481('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9481('0x35')](function(_0x2face9){if(_0x2face9['entry_list'][_0x9481('0x29')]){var _0x15e27f=_['find'](_0x2face9['entry_list'],function(_0x31ea6a){return _0x31ea6a['name_value_list'][_0x9481('0x34')][_0x9481('0x2c')]===_0x30063f;});if(_0x15e27f){logger[_0x9481('0xb')](_0x9481('0x36'));return BPromise['resolve']({'id':_0x15e27f[_0x9481('0x2b')]['id']['value'],'name':_0x15e27f[_0x9481('0x2b')]['name'][_0x9481('0x2c')],'phone':_0x15e27f['name_value_list'][_0x9481('0x34')][_0x9481('0x2c')]});}}else{logger[_0x9481('0xb')](_0x9481('0x37'));return request({'form':{'method':_0x9481('0x1d'),'input_type':_0x9481('0x1e'),'response_type':_0x9481('0x1e'),'rest_data':JSON['stringify']({'session':_0x2079b1['id'],'module_name':_0x9481('0x18'),'name_value_list':[{'name':_0x9481('0x38'),'value':_0x529a0b!==_0x9481('0x39')?_0x529a0b:util[_0x9481('0x20')](_0x9481('0x3a'),_0x30063f)},{'name':_0x9481('0x34'),'value':_0x30063f}]})}})[_0x9481('0x35')](function(_0x4e081d){logger[_0x9481('0xb')](_0x9481('0x3b'));return BPromise['resolve']({'id':_0x4e081d['id'],'name':_0x4e081d[_0x9481('0x28')][_0x9481('0x38')][_0x9481('0x2c')],'phone':_0x4e081d[_0x9481('0x28')][_0x9481('0x34')]['value']});});}});}function request(_0x304791){logger['debug'](_0x9481('0x3c'),JSON[_0x9481('0x1f')](_0x304791));return rp(_['merge'](def,_0x304791));}function getTags(_0x5ac68d,_0x398d8d){var _0x1d0df0=[];if(_0x5ac68d&&_0x5ac68d[_0x9481('0x29')]>0x0){_0x1d0df0=_['map'](_0x5ac68d,_0x398d8d);}return _0x1d0df0;}function getCustomFields(_0x4402f6,_0x184923){var _0x5502ad=[];var _0x59fc26={'custom_fields':[]};if(_0x4402f6[_0x9481('0x29')]>0x0){_['forEach'](_0x4402f6,function(_0x1203e8){if(_0x1203e8[_0x9481('0x3d')]===_0x9481('0x3e')&&_0x1203e8[_0x9481('0x3f')]&&!_0x1203e8[_0x9481('0x40')]){_0x59fc26[_0x1203e8['nameField'][_0x9481('0x41')]()]=_0x1203e8[_0x9481('0x42')]['toString']();}else if(_0x1203e8[_0x9481('0x3d')]===_0x9481('0x3e')&&_0x1203e8[_0x9481('0x1b')]&&_0x1203e8[_0x9481('0x40')]){_0x59fc26[_0x9481('0x43')][_0x9481('0x44')]({'id':_0x1203e8[_0x9481('0x1b')],'value':_0x1203e8[_0x9481('0x42')][_0x9481('0x23')]()});}else if(_0x1203e8['type']===_0x9481('0x45')&&_0x1203e8['variableName']&&_0x1203e8['idField']&&_0x1203e8[_0x9481('0x40')]){_0x184923[_0x1203e8['variableName']]&&_0x59fc26[_0x9481('0x43')][_0x9481('0x44')]({'id':_0x1203e8['idField'],'value':_0x184923[_0x1203e8[_0x9481('0x1c')]][_0x9481('0x23')]()});}else if(_0x1203e8[_0x9481('0x3d')]===_0x9481('0x46')&&_0x1203e8[_0x9481('0x47')]&&_0x1203e8[_0x9481('0x47')]['name']&&_0x1203e8['idField']&&_0x1203e8[_0x9481('0x40')]){_0x184923[_0x1203e8[_0x9481('0x47')][_0x9481('0xd')][_0x9481('0x41')]()]&&_0x59fc26[_0x9481('0x43')][_0x9481('0x44')]({'id':_0x1203e8[_0x9481('0x1b')],'value':_0x184923[_0x1203e8[_0x9481('0x47')]['name'][_0x9481('0x41')]()][_0x9481('0x23')]()});}});}return _0x59fc26;}function getConnection(_0x54a755){return request({'method':_0x9481('0xa'),'form':{'method':_0x9481('0x48'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x9481('0x1f')]({'user_auth':{'user_name':_0x54a755[_0x9481('0x49')],'password':_0x54a755[_0x9481('0x4a')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})['then'](function(_0x4b6a65){var _0x538507=_0x4b6a65;if(_0x538507['id']){def['sessionID']=_0x538507['id'];return BPromise['resolve'](_0x538507);}else{throw new Error(util[_0x9481('0x20')](_0x9481('0x4b'),_0x54a755['id']));}});}function setRelationship(_0x588f7a,_0xd8351c,_0x5f210c,_0x29e82b){return request({'form':{'method':_0x9481('0x4c'),'input_type':_0x9481('0x1e'),'response_type':_0x9481('0x1e'),'rest_data':JSON[_0x9481('0x1f')]({'session':_0x588f7a['id'],'module_name':_0x9481('0x4d'),'module_id':_0x5f210c['id'],'link_field_name':_0x29e82b,'related_ids':[_0xd8351c['id']]})}});}exports[_0x9481('0x4e')]=function(_0x4c27e4,_0x26b41f,_0x1b51b7,_0x4dc5cc,_0x16416a,_0x1240dc){var _0x21f706,_0x44c819,_0x2739c4,_0x56a4c6;_0x1240dc[_0x9481('0x4f')]=intUtil[_0x9481('0x50')](_0x1240dc[_0x9481('0x4f')]);_0x1240dc[_0x9481('0x51')]=intUtil[_0x9481('0x50')](_0x1240dc[_0x9481('0x51')]);def[_0x9481('0x52')]=util[_0x9481('0x20')](_0x9481('0x53'),_0x1240dc['remoteUri']);if(_0x16416a&&_0x16416a['monitor_format']){logger['info'](_0x9481('0x54'),_0x9481('0x55'));_0x26b41f['recordingURL']=util[_0x9481('0x20')](_0x9481('0x56'),_0x1240dc[_0x9481('0x51')],_0x26b41f[_0x9481('0x57')],md5(_0x26b41f[_0x9481('0x57')]));}else{_0x26b41f[_0x9481('0x58')]='';}return getConnection(_0x1240dc)['then'](function(_0x580aa7){_0x56a4c6=_0x580aa7;return getUser(_0x1240dc,_0x4dc5cc[_0x9481('0xd')],_0x56a4c6);})[_0x9481('0x35')](function(_0xb58b67){_0x21f706=_0xb58b67;logger[_0x9481('0xb')](_0x9481('0x59'),_0x21f706['id']);return getEndUser(_0x1240dc,_0x26b41f[_0x9481('0x5a')],_0x26b41f['calleridnum'],_0x56a4c6);})['then'](function(_0x17edbc){_0x44c819=_0x17edbc;logger['info'](_0x9481('0x5b'),_0x44c819['id']);return getTicket(_0x1240dc,_0x21f706,_0x44c819,_0x1b51b7,_0x26b41f,_0x1b51b7['Fields'],_0x56a4c6,_0x9481('0x5c'));})[_0x9481('0x35')](function(_0x3836fe){_0x2739c4=_0x3836fe;logger['info'](_0x9481('0x5d'));logger[_0x9481('0xb')]('The\x20Ticket\x20ID\x20is:',_0x2739c4['id']);return setRelationship(_0x56a4c6,_0x21f706,_0x2739c4,'users');})['then'](function(){return setRelationship(_0x56a4c6,_0x44c819,_0x2739c4,'contacts');})[_0x9481('0x35')](function(){return getServerInfo(_0x56a4c6);})['then'](function(_0x36ee5f){var _0x3a3ca5=parseInt(_0x36ee5f[_0x9481('0x5e')]['charAt'](0x0));var _0x421746=util['format'](_0x9481('0x5f'),_0x1240dc[_0x9481('0x4f')],_0x2739c4['id']);if(_0x3a3ca5>0x6){_0x421746=util[_0x9481('0x20')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1240dc[_0x9481('0x4f')],_0x2739c4['id']);}logger[_0x9481('0xb')]('[QUEUE]',_0x9481('0x60'));emit(util[_0x9481('0x20')](_0x9481('0x61'),_0x4dc5cc[_0x9481('0xd')]),_0x9481('0x62'),{'uri':_0x421746});})[_0x9481('0x63')](function(_0x821899){logger[_0x9481('0x64')](_0x9481('0x54'),JSON[_0x9481('0x1f')](_0x821899));});};exports[_0x9481('0x65')]=function(_0xc9a414,_0x3daaff,_0x3e32cb,_0x418597,_0x35328b,_0x2b2ad1,_0x49184f){var _0x1e05f8,_0x504875,_0x47bf37,_0x1a7892;_0x2b2ad1['remoteUri']=intUtil['stripTrailingSlash'](_0x2b2ad1['remoteUri']);_0x2b2ad1[_0x9481('0x51')]=intUtil[_0x9481('0x50')](_0x2b2ad1[_0x9481('0x51')]);def[_0x9481('0x52')]=util['format'](_0x9481('0x53'),_0x2b2ad1[_0x9481('0x4f')]);if(_0x49184f&&_0x49184f[_0x9481('0x66')]&&_0x49184f[_0x9481('0x66')]!=='none'){logger['info'](_0x9481('0x67'),_0x9481('0x55'));_0x3daaff[_0x9481('0x58')]=util[_0x9481('0x20')](_0x9481('0x56'),_0x2b2ad1['serverUrl'],_0x3daaff[_0x9481('0x57')],md5(_0x3daaff[_0x9481('0x57')]));}return getConnection(_0x2b2ad1)[_0x9481('0x35')](function(_0xbf5986){_0x1a7892=_0xbf5986;return getUser(_0x2b2ad1,_0x418597[_0x9481('0xd')],_0x1a7892);})[_0x9481('0x35')](function(_0x178d7b){_0x1e05f8=_0x178d7b;logger[_0x9481('0xb')](_0x9481('0x59'),_0x1e05f8['id']);return getEndUser(_0x2b2ad1,_0x3daaff[_0x9481('0x68')],_0x3daaff[_0x9481('0x69')],_0x1a7892);})[_0x9481('0x35')](function(_0x2c18d3){_0x504875=_0x2c18d3;logger[_0x9481('0xb')](_0x9481('0x5b'),_0x504875['id']);return getTicket(_0x2b2ad1,_0x1e05f8,_0x504875,_0x3e32cb,_0x3daaff,_0x3e32cb['Fields'],_0x1a7892,_0x9481('0x6a'));})[_0x9481('0x35')](function(_0x3f51c5){_0x47bf37=_0x3f51c5;logger[_0x9481('0xb')](_0x9481('0x5d'));logger[_0x9481('0xb')](_0x9481('0x6b'),_0x47bf37['id']);return setRelationship(_0x1a7892,_0x1e05f8,_0x47bf37,'users');})[_0x9481('0x35')](function(){return setRelationship(_0x1a7892,_0x504875,_0x47bf37,_0x9481('0x6c'));})['then'](function(){return getServerInfo(_0x1a7892);})['then'](function(_0x84ff4f){var _0x4e7bad=parseInt(_0x84ff4f['version'][_0x9481('0x6d')](0x0));var _0x5310dd=util[_0x9481('0x20')](_0x9481('0x5f'),_0x2b2ad1[_0x9481('0x4f')],_0x47bf37['id']);if(_0x4e7bad>0x6){_0x5310dd=util[_0x9481('0x20')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x2b2ad1[_0x9481('0x4f')],_0x47bf37['id']);}logger['info'](_0x9481('0x67'),_0x9481('0x60'));emit(util[_0x9481('0x20')]('user:%s',_0x418597['name']),'trigger:browser:url',{'uri':_0x5310dd});})[_0x9481('0x63')](function(_0x59921c){logger['error'](_0x9481('0x67'),JSON[_0x9481('0x1f')](_0x59921c));});};exports[_0x9481('0x6e')]=function(_0x579780,_0x905ee6,_0x3e2184,_0x545457,_0x226932,_0x3c8241){var _0x1ea93a,_0x1e7ef4,_0x5f4be2,_0x2e585d;_0x3c8241['remoteUri']=intUtil[_0x9481('0x50')](_0x3c8241[_0x9481('0x4f')]);_0x3c8241['serverUrl']=intUtil[_0x9481('0x50')](_0x3c8241[_0x9481('0x51')]);def[_0x9481('0x52')]=util['format']('%s/service/v4_1/rest.php',_0x3c8241[_0x9481('0x4f')]);if(_0x226932&&_0x226932['monitor_format']){logger[_0x9481('0xb')]('['+_0x905ee6[_0x9481('0x6f')][_0x9481('0x70')]()+']','Recording\x20is\x20enabled!');_0x905ee6[_0x9481('0x58')]=util[_0x9481('0x20')](_0x9481('0x56'),_0x3c8241['serverUrl'],_0x905ee6[_0x9481('0x57')],md5(_0x905ee6[_0x9481('0x57')]));}else{_0x905ee6[_0x9481('0x58')]='';}return getConnection(_0x3c8241)[_0x9481('0x35')](function(_0x347da1){_0x2e585d=_0x347da1;if(!_[_0x9481('0x71')](_0x545457)){return getUser(_0x3c8241,_0x545457[_0x9481('0xd')],_0x2e585d);}else{return getUser(_0x3c8241,null,_0x2e585d);}})[_0x9481('0x35')](function(_0x22e787){_0x1ea93a=_0x22e787;logger[_0x9481('0xb')]('The\x20User\x20ID\x20is:',_0x1ea93a['id']);return getEndUser(_0x3c8241,_0x905ee6[_0x9481('0x5a')],_0x905ee6['calleridnum'],_0x2e585d);})['then'](function(_0x5446ec){_0x1e7ef4=_0x5446ec;logger[_0x9481('0xb')](_0x9481('0x5b'),_0x1e7ef4['id']);return getTicket(_0x3c8241,_0x1ea93a,_0x1e7ef4,_0x3e2184,_0x905ee6,_0x3e2184[_0x9481('0x72')],_0x2e585d,_0x9481('0x5c'));})[_0x9481('0x35')](function(_0x582c32){_0x5f4be2=_0x582c32;logger[_0x9481('0xb')](_0x9481('0x5d'));logger[_0x9481('0xb')](_0x9481('0x6b'),_0x5f4be2['id']);return setRelationship(_0x2e585d,_0x1ea93a,_0x5f4be2,_0x9481('0x73'));})[_0x9481('0x35')](function(){return setRelationship(_0x2e585d,_0x1e7ef4,_0x5f4be2,_0x9481('0x6c'));})[_0x9481('0x35')](function(){return getServerInfo(_0x2e585d);})[_0x9481('0x63')](function(_0x426d56){logger['error']('['+_0x905ee6[_0x9481('0x6f')][_0x9481('0x70')]()+']',JSON[_0x9481('0x1f')](_0x426d56));});}; \ 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 9ac19e4..fb436b1 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 _0x143b=['util','getString','length','sortBy','type','string','push','content','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','lodash'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0x143b,0x195));var _0xb143=function(_0x4265f1,_0x8b8a67){_0x4265f1=_0x4265f1-0x0;var _0x456892=_0x143b[_0x4265f1];return _0x456892;};'use strict';var _=require(_0xb143('0x0'));var util=require(_0xb143('0x1'));exports[_0xb143('0x2')]=function(_0x37ae0f,_0x232a3d,_0x1ad969){var _0x5bcefd=[];if(_0x37ae0f[_0xb143('0x3')]>0x0){var _0x21f0a2=_[_0xb143('0x4')](_0x37ae0f,['id']);for(var _0x29fb34=0x0;_0x29fb34<_0x21f0a2['length'];_0x29fb34++){var _0x141154=_0x21f0a2[_0x29fb34];if(_0x141154[_0xb143('0x5')]===_0xb143('0x6')){_0x5bcefd[_0xb143('0x7')](_0x141154[_0xb143('0x8')]);}else if(_0x141154[_0xb143('0x5')]==='variable'&&_0x141154[_0xb143('0x9')]){_0x232a3d[_0x141154[_0xb143('0x9')]]&&_0x5bcefd[_0xb143('0x7')](_0x232a3d[_0x141154['variableName']][_0xb143('0xa')]());}else if(_0x141154[_0xb143('0x5')]===_0xb143('0xb')&&_0x141154[_0xb143('0xc')]&&_0x141154[_0xb143('0xc')][_0xb143('0xd')]){_0x232a3d[_0x141154['Variable'][_0xb143('0xd')][_0xb143('0xe')]()]&&_0x5bcefd['push'](_0x232a3d[_0x141154[_0xb143('0xc')]['name'][_0xb143('0xe')]()]['toString']());}else if(_0x141154[_0xb143('0x5')]===_0xb143('0xf')){if(_0x141154[_0xb143('0x10')]===_0xb143('0x6')&&_0x141154[_0xb143('0x11')]){_0x5bcefd['push'](util[_0xb143('0x12')](_0xb143('0x13'),_0x141154['key'],_0x141154[_0xb143('0x14')]));}else if(_0x141154['keyType']===_0xb143('0x15')&&_0x141154[_0xb143('0x9')]&&_0x141154[_0xb143('0x11')]){_0x232a3d[_0x141154[_0xb143('0x9')]]&&_0x5bcefd[_0xb143('0x7')](util['format'](_0xb143('0x13'),_0x141154[_0xb143('0x11')],_0x232a3d[_0x141154['variableName']]));}else if(_0x141154[_0xb143('0x10')]===_0xb143('0xb')&&_0x141154['Variable']&&_0x141154[_0xb143('0xc')]['name']&&_0x141154[_0xb143('0x11')]){_0x232a3d[_0x141154['Variable']['name'][_0xb143('0xe')]()]&&_0x5bcefd[_0xb143('0x7')](util[_0xb143('0x12')](_0xb143('0x13'),_0x141154[_0xb143('0x11')],_0x232a3d[_0x141154[_0xb143('0xc')][_0xb143('0xd')][_0xb143('0xe')]()]));}}}}return _0x5bcefd[_0xb143('0x16')](_0x1ad969);};exports[_0xb143('0x17')]=function(_0x21a090){var _0x3f448a=_0x21a090[_0xb143('0x18')](-0x1);if(_0x3f448a==='/'){_0x21a090=_0x21a090['substring'](0x0,_0x21a090[_0xb143('0x19')](_0x3f448a));}return _0x21a090;};exports[_0xb143('0x1a')]=function(_0x295e87){if(!_[_0xb143('0x1b')](_0x295e87)&&_0x295e87!==''){var _0x31a85d=/^(([^<>()\[\]\\.,;:\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 _0x31a85d[_0xb143('0x1c')](String(_0x295e87)[_0xb143('0xe')]());}else{return![];}}; \ No newline at end of file +var _0xb264=['join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','util','length','sortBy','type','string','push','content','variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','keyType','key','format','%s:\x20%s','keyContent','variable'];(function(_0x11883f,_0x22f0b7){var _0x397e72=function(_0x447032){while(--_0x447032){_0x11883f['push'](_0x11883f['shift']());}};_0x397e72(++_0x22f0b7);}(_0xb264,0x14b));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4b26('0x0'));exports['getString']=function(_0x1380d8,_0x2a9e15,_0x3f042b){var _0x52c3ab=[];if(_0x1380d8[_0x4b26('0x1')]>0x0){var _0x3dbdce=_[_0x4b26('0x2')](_0x1380d8,['id']);for(var _0x4eece5=0x0;_0x4eece5<_0x3dbdce[_0x4b26('0x1')];_0x4eece5++){var _0x24a4bd=_0x3dbdce[_0x4eece5];if(_0x24a4bd[_0x4b26('0x3')]===_0x4b26('0x4')){_0x52c3ab[_0x4b26('0x5')](_0x24a4bd[_0x4b26('0x6')]);}else if(_0x24a4bd['type']==='variable'&&_0x24a4bd['variableName']){_0x2a9e15[_0x24a4bd[_0x4b26('0x7')]]&&_0x52c3ab[_0x4b26('0x5')](_0x2a9e15[_0x24a4bd['variableName']]['toString']());}else if(_0x24a4bd[_0x4b26('0x3')]===_0x4b26('0x8')&&_0x24a4bd['Variable']&&_0x24a4bd[_0x4b26('0x9')]['name']){_0x2a9e15[_0x24a4bd['Variable'][_0x4b26('0xa')][_0x4b26('0xb')]()]&&_0x52c3ab[_0x4b26('0x5')](_0x2a9e15[_0x24a4bd[_0x4b26('0x9')]['name'][_0x4b26('0xb')]()][_0x4b26('0xc')]());}else if(_0x24a4bd[_0x4b26('0x3')]===_0x4b26('0xd')){if(_0x24a4bd[_0x4b26('0xe')]===_0x4b26('0x4')&&_0x24a4bd[_0x4b26('0xf')]){_0x52c3ab['push'](util[_0x4b26('0x10')](_0x4b26('0x11'),_0x24a4bd[_0x4b26('0xf')],_0x24a4bd[_0x4b26('0x12')]));}else if(_0x24a4bd[_0x4b26('0xe')]===_0x4b26('0x13')&&_0x24a4bd[_0x4b26('0x7')]&&_0x24a4bd[_0x4b26('0xf')]){_0x2a9e15[_0x24a4bd[_0x4b26('0x7')]]&&_0x52c3ab[_0x4b26('0x5')](util['format'](_0x4b26('0x11'),_0x24a4bd[_0x4b26('0xf')],_0x2a9e15[_0x24a4bd[_0x4b26('0x7')]]));}else if(_0x24a4bd['keyType']==='customVariable'&&_0x24a4bd[_0x4b26('0x9')]&&_0x24a4bd[_0x4b26('0x9')][_0x4b26('0xa')]&&_0x24a4bd[_0x4b26('0xf')]){_0x2a9e15[_0x24a4bd[_0x4b26('0x9')][_0x4b26('0xa')][_0x4b26('0xb')]()]&&_0x52c3ab['push'](util['format'](_0x4b26('0x11'),_0x24a4bd[_0x4b26('0xf')],_0x2a9e15[_0x24a4bd[_0x4b26('0x9')][_0x4b26('0xa')][_0x4b26('0xb')]()]));}}}}return _0x52c3ab[_0x4b26('0x14')](_0x3f042b);};exports[_0x4b26('0x15')]=function(_0x57ae63){var _0x4b7021=_0x57ae63[_0x4b26('0x16')](-0x1);if(_0x4b7021==='/'){_0x57ae63=_0x57ae63[_0x4b26('0x17')](0x0,_0x57ae63[_0x4b26('0x18')](_0x4b7021));}return _0x57ae63;};exports[_0x4b26('0x19')]=function(_0x3e0516){if(!_[_0x4b26('0x1a')](_0x3e0516)&&_0x3e0516!==''){var _0xa06bfd=/^(([^<>()\[\]\\.,;:\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 _0xa06bfd['test'](String(_0x3e0516)[_0x4b26('0xb')]());}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 f6c9ac4..3272191 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 _0x02c7=['username','sessionName','HelpDesk','stringify','success','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','query','then','result','Agent\x20found!','resolve','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','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!','POST','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','GET','login','token','[HTTP]','queue','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','split','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','emit','length','forEach','type','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','format','%s/webservice.php','remoteUri','create'];(function(_0x13afbd,_0x4dbd3f){var _0x465566=function(_0x4c9506){while(--_0x4c9506){_0x13afbd['push'](_0x13afbd['shift']());}};_0x465566(++_0x4dbd3f);}(_0x02c7,0xb4));var _0x702c=function(_0x990a25,_0x523c58){_0x990a25=_0x990a25-0x0;var _0x2b14a7=_0x02c7[_0x990a25];return _0x2b14a7;};'use strict';var _=require(_0x702c('0x0'));var rp=require(_0x702c('0x1'));var BPromise=require(_0x702c('0x2'));var md5=require(_0x702c('0x3'));var util=require(_0x702c('0x4'));var Redis=require(_0x702c('0x5'));var intUtil=require(_0x702c('0x6'));var config=require(_0x702c('0x7'));var logger=require(_0x702c('0x8'))(_0x702c('0x9'));config[_0x702c('0xa')]=_[_0x702c('0xb')](config[_0x702c('0xa')],{'host':_0x702c('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x702c('0xa')]));function emit(_0xba7e0,_0x508a46,_0x393a1d){io['to'](_0xba7e0)[_0x702c('0xd')](_0x508a46,_0x393a1d);}function getCustomFields(_0x2e947b,_0x2b97f6){var _0x4099bf={};if(_0x2e947b[_0x702c('0xe')]>0x0){_[_0x702c('0xf')](_0x2e947b,function(_0x18c512){if(_0x18c512[_0x702c('0x10')]==='string'&&_0x18c512[_0x702c('0x11')]){_0x4099bf[_0x18c512[_0x702c('0x11')]]=_0x18c512['content'][_0x702c('0x12')]();}else if(_0x18c512['type']===_0x702c('0x13')&&_0x18c512['variableName']&&_0x18c512[_0x702c('0x11')]&&_0x2b97f6[_0x18c512[_0x702c('0x14')]]){_0x4099bf[_0x18c512[_0x702c('0x11')]]=_0x2b97f6[_0x18c512['variableName']]['toString']();}else if(_0x18c512['type']===_0x702c('0x15')&&_0x18c512[_0x702c('0x16')]&&_0x18c512['Variable'][_0x702c('0x17')]&&_0x18c512[_0x702c('0x11')]&&_0x2b97f6[_0x18c512[_0x702c('0x16')]['name'][_0x702c('0x18')]()]){_0x4099bf[_0x18c512['idField']]=_0x2b97f6[_0x18c512['Variable']['name'][_0x702c('0x18')]()][_0x702c('0x12')]();}});}return _0x4099bf;}function createTicket(_0x204943,_0x375b7a,_0x3881fb,_0x9964c2,_0x535b6d,_0x29ea48,_0x2e1080){logger[_0x702c('0x19')](_0x702c('0x1a'));var _0x5a4462=_[_0x702c('0x1b')]({'parent_id':'','assigned_user_id':_0x375b7a['id'],'ticketpriorities':_0x702c('0x1c'),'ticketstatus':_0x702c('0x1d'),'ticket_title':intUtil[_0x702c('0x1e')](_0x9964c2[_0x702c('0x1f')],_0x535b6d,'\x20'),'description':intUtil[_0x702c('0x1e')](_0x9964c2['Descriptions'],_0x535b6d,'\x0a'),'contact_id':_0x3881fb['id']},getCustomFields(_0x29ea48,_0x535b6d));var _0x2d4867={'method':'POST','uri':util[_0x702c('0x20')](_0x702c('0x21'),_0x204943[_0x702c('0x22')]),'form':{'operation':_0x702c('0x23'),'username':_0x204943[_0x702c('0x24')],'sessionName':_0x2e1080[_0x702c('0x25')],'elementType':_0x702c('0x26'),'element':JSON[_0x702c('0x27')](_0x5a4462)},'json':!![]};return request(_0x2d4867)['then'](function(_0x152a6e){if(_0x152a6e[_0x702c('0x28')]){return BPromise['resolve']({'id':_0x152a6e['result']['id']});}else{throw new Error(util[_0x702c('0x20')](_0x702c('0x29'),JSON[_0x702c('0x27')](_0x152a6e[_0x702c('0x2a')])));}})[_0x702c('0x2b')](function(_0x197457){var _0x3dac65=_0x197457[_0x702c('0x2c')]||0x1f4;logger[_0x702c('0x2a')](_0x702c('0x2d'),_0x702c('0x2e'),_0x3dac65,JSON[_0x702c('0x27')](_0x197457));});}function getUser(_0x572aed,_0x579fb2,_0xffa31c){if(intUtil[_0x702c('0x2f')](_0x579fb2)){logger['info'](_0x702c('0x30'),_0x579fb2);return request({'method':'GET','uri':util[_0x702c('0x20')](_0x702c('0x21'),_0x572aed[_0x702c('0x22')]),'qs':{'operation':_0x702c('0x31'),'username':_0x572aed[_0x702c('0x24')],'sessionName':_0xffa31c[_0x702c('0x25')],'query':util[_0x702c('0x20')]('SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;',_0x579fb2)},'json':!![]})[_0x702c('0x32')](function(_0x1374df){if(_0x1374df[_0x702c('0x28')]&&_0x1374df[_0x702c('0x33')][_0x702c('0xe')]){logger['info'](_0x702c('0x34'));return BPromise[_0x702c('0x35')]({'id':_0x1374df[_0x702c('0x33')][0x0]['id'],'email':_0x1374df[_0x702c('0x33')][0x0][_0x702c('0x36')],'name':_0x1374df[_0x702c('0x33')][0x0][_0x702c('0x37')]+'\x20'+_0x1374df[_0x702c('0x33')][_0x702c('0x38')]});}else{logger[_0x702c('0x19')](_0x702c('0x39'));return BPromise[_0x702c('0x35')]({'id':_0xffa31c[_0x702c('0x3a')],'email':_0x572aed[_0x702c('0x24')],'name':_0x702c('0x3b')});}})[_0x702c('0x2b')](function(_0x253f64){var _0x45067b=_0x253f64[_0x702c('0x2c')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0x702c('0x3c'),_0x45067b,JSON['stringify'](_0x253f64));});}else{logger[_0x702c('0x19')](_0x702c('0x39'));return BPromise[_0x702c('0x35')]({'id':_0xffa31c[_0x702c('0x3a')],'email':_0x572aed[_0x702c('0x24')],'name':_0x702c('0x3b')})['catch'](function(_0x51e7f4){var _0x51c24f=_0x51e7f4[_0x702c('0x2c')]||0x1f4;logger[_0x702c('0x2a')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x51c24f,JSON['stringify'](_0x51e7f4));});}}function getEndUser(_0x3d857e,_0x45a92a,_0xad44da,_0x5e6dcc){logger[_0x702c('0x19')](_0x702c('0x3d'),_0xad44da);return request({'method':'GET','uri':util[_0x702c('0x20')]('%s/webservice.php',_0x3d857e['remoteUri']),'qs':{'operation':_0x702c('0x31'),'username':_0x3d857e[_0x702c('0x24')],'sessionName':_0x5e6dcc['sessionName'],'query':util[_0x702c('0x20')](_0x702c('0x3e'),_0xad44da,_0xad44da,_0xad44da,_0xad44da,_0xad44da)},'json':!![]})[_0x702c('0x32')](function(_0x549948){if(_0x549948[_0x702c('0x28')]&&_0x549948[_0x702c('0x33')][_0x702c('0xe')]){logger['info'](_0x702c('0x3f'));return BPromise[_0x702c('0x35')]({'id':_0x549948['result'][0x0]['id'],'name':_0x549948['result'][0x0][_0x702c('0x40')]+'\x20'+_0x549948['result'][0x0][_0x702c('0x41')],'phone':_0xad44da});}else{logger[_0x702c('0x19')](_0x702c('0x42'));return request({'method':_0x702c('0x43'),'uri':util['format'](_0x702c('0x21'),_0x3d857e[_0x702c('0x22')]),'form':{'operation':_0x702c('0x23'),'sessionName':_0x5e6dcc[_0x702c('0x25')],'elementType':_0x702c('0x44'),'element':JSON['stringify']({'lastname':_0x45a92a,'phone':_0xad44da,'assigned_user_id':'\x20'})},'json':!![]})[_0x702c('0x32')](function(_0x32433a){logger[_0x702c('0x19')](_0x702c('0x45'));return BPromise['resolve']({'id':_0x32433a['result']['id'],'name':_0x32433a[_0x702c('0x33')][_0x702c('0x41')],'phone':_0x32433a['result'][_0x702c('0x46')]});})[_0x702c('0x2b')](function(_0x5f46c4){var _0x1f20d4=_0x5f46c4[_0x702c('0x2c')]||0x1f4;logger[_0x702c('0x2a')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x702c('0x47'),_0x1f20d4,JSON[_0x702c('0x27')](_0x5f46c4));});}});}function getConnection(_0x3064bc){var _0x1e14cb=_0x3064bc['username'];var _0x1dc498=_0x3064bc[_0x702c('0x48')];return request({'method':_0x702c('0x49'),'uri':util[_0x702c('0x20')]('%s/webservice.php',_0x3064bc['remoteUri']),'qs':{'operation':'getchallenge','username':_0x1e14cb},'json':!![]})[_0x702c('0x32')](function(_0x31b315){if(_0x31b315[_0x702c('0x28')]){return request({'method':_0x702c('0x43'),'uri':util[_0x702c('0x20')](_0x702c('0x21'),_0x3064bc['remoteUri']),'form':{'operation':_0x702c('0x4a'),'username':_0x1e14cb,'accessKey':md5(_0x31b315[_0x702c('0x33')][_0x702c('0x4b')]+_0x1dc498)},'json':!![]});}})['then'](function(_0x2741dc){if(_0x2741dc[_0x702c('0x28')]){return BPromise['resolve'](_0x2741dc['result']);}else{throw new Error(util[_0x702c('0x20')]('Account\x20%d\x20is\x20not\x20valid',_0x3064bc['id']));}})[_0x702c('0x2b')](function(_0x437e98){var _0x1b0742=_0x437e98[_0x702c('0x2c')]||0x1f4;logger[_0x702c('0x2a')]('[vTiger],\x20%s,\x20%s,\x20%s','getConnection',_0x1b0742,JSON[_0x702c('0x27')](_0x437e98));});}function request(_0x3d4cd0){logger['info'](_0x702c('0x4c'),JSON[_0x702c('0x27')](_0x3d4cd0));return rp(_0x3d4cd0);}exports[_0x702c('0x4d')]=function(_0x2a6800,_0x2b984b,_0x14936b,_0x12d105,_0x3a5eff,_0x1de786){var _0x10dbcb,_0x429d9f,_0x378a0a,_0x13f1ff;_0x1de786['remoteUri']=intUtil[_0x702c('0x4e')](_0x1de786[_0x702c('0x22')]);if(_0x3a5eff&&_0x3a5eff[_0x702c('0x4f')]){logger[_0x702c('0x19')]('[QUEUE]',_0x702c('0x50'));_0x2b984b['recordingURL']=util[_0x702c('0x20')](_0x702c('0x51'),_0x1de786[_0x702c('0x52')],_0x2b984b[_0x702c('0x53')],md5(_0x2b984b[_0x702c('0x53')]));}else{_0x2b984b[_0x702c('0x54')]='';}return getConnection(_0x1de786)[_0x702c('0x32')](function(_0x42d514){_0x13f1ff=_0x42d514;return getUser(_0x1de786,_0x12d105[_0x702c('0x55')],_0x13f1ff);})['then'](function(_0x2b4b85){_0x10dbcb=_0x2b4b85;logger[_0x702c('0x19')](_0x702c('0x56'),_0x10dbcb['id']);return getEndUser(_0x1de786,_0x2b984b[_0x702c('0x57')],_0x2b984b[_0x702c('0x58')],_0x13f1ff);})[_0x702c('0x32')](function(_0x2dc638){_0x429d9f=_0x2dc638;logger[_0x702c('0x19')](_0x702c('0x59'),_0x429d9f['id']);return createTicket(_0x1de786,_0x10dbcb,_0x429d9f,_0x14936b,_0x2b984b,_0x14936b['Fields'],_0x13f1ff);})['then'](function(_0x207065){_0x378a0a=_0x207065;logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x378a0a['id']);var _0x52a4e0=util[_0x702c('0x20')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x1de786[_0x702c('0x22')],_[_0x702c('0x5a')](_0x378a0a['id'],'x')[0x1]);logger[_0x702c('0x19')](_0x702c('0x5b'),_0x702c('0x5c'));emit(util[_0x702c('0x20')]('user:%s',_0x12d105[_0x702c('0x17')]),_0x702c('0x5d'),{'uri':_0x52a4e0});})[_0x702c('0x2b')](function(_0x1a5fac){logger[_0x702c('0x2a')](_0x702c('0x5b'),JSON[_0x702c('0x27')](_0x1a5fac));});};exports[_0x702c('0x5e')]=function(_0x5c49bb,_0x232d70,_0x4b1037,_0x292fab,_0x59375e,_0x5751ea,_0x1561ef){var _0x4ac394,_0x542038,_0x25b5da,_0x20bd23;_0x5751ea[_0x702c('0x22')]=intUtil['stripTrailingSlash'](_0x5751ea['remoteUri']);_0x5751ea[_0x702c('0x52')]=intUtil[_0x702c('0x4e')](_0x5751ea[_0x702c('0x52')]);if(_0x1561ef&&_0x1561ef[_0x702c('0x5f')]&&_0x1561ef[_0x702c('0x5f')]!==_0x702c('0x60')){logger[_0x702c('0x19')](_0x702c('0x61'),_0x702c('0x50'));_0x232d70[_0x702c('0x54')]=util[_0x702c('0x20')](_0x702c('0x51'),_0x5751ea[_0x702c('0x52')],_0x232d70[_0x702c('0x53')],md5(_0x232d70[_0x702c('0x53')]));}return getConnection(_0x5751ea)[_0x702c('0x32')](function(_0xa90626){_0x20bd23=_0xa90626;return getUser(_0x5751ea,_0x292fab['email'],_0x20bd23);})[_0x702c('0x32')](function(_0x168154){_0x4ac394=_0x168154;logger[_0x702c('0x19')](_0x702c('0x56'),_0x4ac394['id']);return getEndUser(_0x5751ea,_0x232d70[_0x702c('0x62')],_0x232d70[_0x702c('0x63')],_0x20bd23);})[_0x702c('0x32')](function(_0x3c83aa){_0x542038=_0x3c83aa;logger[_0x702c('0x19')](_0x702c('0x59'),_0x542038['id']);return createTicket(_0x5751ea,_0x4ac394,_0x542038,_0x4b1037,_0x232d70,_0x4b1037[_0x702c('0x64')],_0x20bd23);})[_0x702c('0x32')](function(_0x39b411){_0x25b5da=_0x39b411;logger[_0x702c('0x19')](_0x702c('0x65'));logger['info'](_0x702c('0x66'),_0x25b5da['id']);var _0x19f67d=util[_0x702c('0x20')](_0x702c('0x67'),_0x5751ea[_0x702c('0x22')],_[_0x702c('0x5a')](_0x25b5da['id'],'x')[0x1]);logger[_0x702c('0x19')](_0x702c('0x61'),_0x702c('0x5c'));emit(util[_0x702c('0x20')](_0x702c('0x68'),_0x292fab[_0x702c('0x17')]),_0x702c('0x5d'),{'uri':_0x19f67d});})[_0x702c('0x2b')](function(_0x3817c2){logger[_0x702c('0x2a')](_0x702c('0x61'),JSON['stringify'](_0x3817c2));});};exports[_0x702c('0x69')]=function(_0x160193,_0x28eff9,_0x58d74b,_0x1239cf,_0x251579,_0x7e7e60){var _0x17d757,_0x4b4b75,_0xebbcef,_0x5abeb6;_0x7e7e60[_0x702c('0x22')]=intUtil['stripTrailingSlash'](_0x7e7e60[_0x702c('0x22')]);_0x7e7e60[_0x702c('0x52')]=intUtil[_0x702c('0x4e')](_0x7e7e60['serverUrl']);if(_0x251579&&_0x251579[_0x702c('0x4f')]){logger[_0x702c('0x19')]('['+_0x28eff9[_0x702c('0x6a')]['toUpperCase']()+']',_0x702c('0x50'));_0x28eff9['recordingURL']=util[_0x702c('0x20')](_0x702c('0x51'),_0x7e7e60[_0x702c('0x52')],_0x28eff9['uniqueid'],md5(_0x28eff9[_0x702c('0x53')]));}else{_0x28eff9['recordingURL']='';}return getConnection(_0x7e7e60)[_0x702c('0x32')](function(_0x1ead3a){_0x5abeb6=_0x1ead3a;return getUser(_0x7e7e60,'',_0x5abeb6);})[_0x702c('0x32')](function(_0x4d7a11){_0x17d757=_0x4d7a11;logger[_0x702c('0x19')](_0x702c('0x56'),_0x17d757['id']);return getEndUser(_0x7e7e60,_0x28eff9['calleridname'],_0x28eff9[_0x702c('0x58')],_0x5abeb6);})[_0x702c('0x32')](function(_0x5df325){_0x4b4b75=_0x5df325;logger[_0x702c('0x19')](_0x702c('0x59'),_0x4b4b75['id']);return createTicket(_0x7e7e60,_0x17d757,_0x4b4b75,_0x58d74b,_0x28eff9,_0x58d74b[_0x702c('0x64')],_0x5abeb6);})[_0x702c('0x32')](function(_0x5084fe){_0xebbcef=_0x5084fe;logger[_0x702c('0x19')](_0x702c('0x65'));logger[_0x702c('0x19')](_0x702c('0x66'),_0xebbcef['id']);})[_0x702c('0x2b')](function(_0x2efb7a){logger['error']('['+_0x28eff9['lastevent'][_0x702c('0x6b')]()+']',JSON[_0x702c('0x27')](_0x2efb7a));});}; \ No newline at end of file +var _0x090f=['util','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','length','forEach','string','idField','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','POST','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','Agent\x20found!','email1','first_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','GET','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;','then','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','Account\x20%d\x20is\x20not\x20valid','[HTTP]','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','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','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Fields','Ticket\x20created!','split','monitor_format','lastevent','toUpperCase','calleridnum','lodash','request-promise','bluebird','md5'];(function(_0x4c13ba,_0x24aa66){var _0x2deeb8=function(_0x57a0e3){while(--_0x57a0e3){_0x4c13ba['push'](_0x4c13ba['shift']());}};_0x2deeb8(++_0x24aa66);}(_0x090f,0x1e1));var _0xf090=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x090f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf090('0x0'));var rp=require(_0xf090('0x1'));var BPromise=require(_0xf090('0x2'));var md5=require(_0xf090('0x3'));var util=require(_0xf090('0x4'));var Redis=require(_0xf090('0x5'));var intUtil=require('./util');var config=require(_0xf090('0x6'));var logger=require(_0xf090('0x7'))('vTiger');config[_0xf090('0x8')]=_[_0xf090('0x9')](config[_0xf090('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xf090('0xa'))(new Redis(config[_0xf090('0x8')]));function emit(_0x24d794,_0x15e65a,_0x4af574){io['to'](_0x24d794)['emit'](_0x15e65a,_0x4af574);}function getCustomFields(_0x617856,_0x34e078){var _0x29fed8={};if(_0x617856[_0xf090('0xb')]>0x0){_[_0xf090('0xc')](_0x617856,function(_0x33b779){if(_0x33b779['type']===_0xf090('0xd')&&_0x33b779[_0xf090('0xe')]){_0x29fed8[_0x33b779['idField']]=_0x33b779['content'][_0xf090('0xf')]();}else if(_0x33b779[_0xf090('0x10')]===_0xf090('0x11')&&_0x33b779[_0xf090('0x12')]&&_0x33b779[_0xf090('0xe')]&&_0x34e078[_0x33b779[_0xf090('0x12')]]){_0x29fed8[_0x33b779[_0xf090('0xe')]]=_0x34e078[_0x33b779[_0xf090('0x12')]]['toString']();}else if(_0x33b779[_0xf090('0x10')]==='customVariable'&&_0x33b779[_0xf090('0x13')]&&_0x33b779[_0xf090('0x13')]['name']&&_0x33b779['idField']&&_0x34e078[_0x33b779['Variable'][_0xf090('0x14')][_0xf090('0x15')]()]){_0x29fed8[_0x33b779[_0xf090('0xe')]]=_0x34e078[_0x33b779[_0xf090('0x13')]['name']['toLowerCase']()][_0xf090('0xf')]();}});}return _0x29fed8;}function createTicket(_0x2b39d2,_0x563349,_0x4409aa,_0x55d516,_0x3473ef,_0x2819c4,_0x198bd2){logger[_0xf090('0x16')](_0xf090('0x17'));var _0x412f97=_[_0xf090('0x18')]({'parent_id':'','assigned_user_id':_0x563349['id'],'ticketpriorities':_0xf090('0x19'),'ticketstatus':_0xf090('0x1a'),'ticket_title':intUtil['getString'](_0x55d516[_0xf090('0x1b')],_0x3473ef,'\x20'),'description':intUtil[_0xf090('0x1c')](_0x55d516['Descriptions'],_0x3473ef,'\x0a'),'contact_id':_0x4409aa['id']},getCustomFields(_0x2819c4,_0x3473ef));var _0x54262a={'method':_0xf090('0x1d'),'uri':util['format'](_0xf090('0x1e'),_0x2b39d2[_0xf090('0x1f')]),'form':{'operation':_0xf090('0x20'),'username':_0x2b39d2[_0xf090('0x21')],'sessionName':_0x198bd2[_0xf090('0x22')],'elementType':_0xf090('0x23'),'element':JSON[_0xf090('0x24')](_0x412f97)},'json':!![]};return request(_0x54262a)['then'](function(_0x15dfb5){if(_0x15dfb5['success']){return BPromise[_0xf090('0x25')]({'id':_0x15dfb5[_0xf090('0x26')]['id']});}else{throw new Error(util[_0xf090('0x27')](_0xf090('0x28'),JSON[_0xf090('0x24')](_0x15dfb5[_0xf090('0x29')])));}})[_0xf090('0x2a')](function(_0x34ddeb){var _0x40cd18=_0x34ddeb[_0xf090('0x2b')]||0x1f4;logger[_0xf090('0x29')](_0xf090('0x2c'),_0xf090('0x2d'),_0x40cd18,JSON['stringify'](_0x34ddeb));});}function getUser(_0x1a5b13,_0x26c044,_0x365f75){if(intUtil[_0xf090('0x2e')](_0x26c044)){logger[_0xf090('0x16')]('Getting\x20agent\x20with\x20email',_0x26c044);return request({'method':'GET','uri':util[_0xf090('0x27')](_0xf090('0x1e'),_0x1a5b13[_0xf090('0x1f')]),'qs':{'operation':_0xf090('0x2f'),'username':_0x1a5b13[_0xf090('0x21')],'sessionName':_0x365f75[_0xf090('0x22')],'query':util[_0xf090('0x27')](_0xf090('0x30'),_0x26c044)},'json':!![]})['then'](function(_0x4540e5){if(_0x4540e5[_0xf090('0x31')]&&_0x4540e5[_0xf090('0x26')]['length']){logger[_0xf090('0x16')](_0xf090('0x32'));return BPromise['resolve']({'id':_0x4540e5[_0xf090('0x26')][0x0]['id'],'email':_0x4540e5[_0xf090('0x26')][0x0][_0xf090('0x33')],'name':_0x4540e5[_0xf090('0x26')][0x0][_0xf090('0x34')]+'\x20'+_0x4540e5[_0xf090('0x26')]['last_name']});}else{logger[_0xf090('0x16')](_0xf090('0x35'));return BPromise[_0xf090('0x25')]({'id':_0x365f75[_0xf090('0x36')],'email':_0x1a5b13[_0xf090('0x21')],'name':_0xf090('0x37')});}})[_0xf090('0x2a')](function(_0x435fb0){var _0x1d160f=_0x435fb0[_0xf090('0x2b')]||0x1f4;logger['error'](_0xf090('0x2c'),_0xf090('0x38'),_0x1d160f,JSON[_0xf090('0x24')](_0x435fb0));});}else{logger[_0xf090('0x16')](_0xf090('0x35'));return BPromise[_0xf090('0x25')]({'id':_0x365f75['userId'],'email':_0x1a5b13['username'],'name':_0xf090('0x37')})[_0xf090('0x2a')](function(_0x477599){var _0x385ca1=_0x477599[_0xf090('0x2b')]||0x1f4;logger[_0xf090('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x385ca1,JSON[_0xf090('0x24')](_0x477599));});}}function getEndUser(_0x4b9582,_0x5535e5,_0x4fc0c3,_0x10a146){logger[_0xf090('0x16')]('Searching\x20end\x20user\x20with\x20phone',_0x4fc0c3);return request({'method':_0xf090('0x39'),'uri':util[_0xf090('0x27')](_0xf090('0x1e'),_0x4b9582[_0xf090('0x1f')]),'qs':{'operation':'query','username':_0x4b9582[_0xf090('0x21')],'sessionName':_0x10a146['sessionName'],'query':util['format'](_0xf090('0x3a'),_0x4fc0c3,_0x4fc0c3,_0x4fc0c3,_0x4fc0c3,_0x4fc0c3)},'json':!![]})[_0xf090('0x3b')](function(_0xe6d0d6){if(_0xe6d0d6['success']&&_0xe6d0d6[_0xf090('0x26')]['length']){logger[_0xf090('0x16')](_0xf090('0x3c'));return BPromise['resolve']({'id':_0xe6d0d6[_0xf090('0x26')][0x0]['id'],'name':_0xe6d0d6[_0xf090('0x26')][0x0][_0xf090('0x3d')]+'\x20'+_0xe6d0d6[_0xf090('0x26')][0x0][_0xf090('0x3e')],'phone':_0x4fc0c3});}else{logger[_0xf090('0x16')](_0xf090('0x3f'));return request({'method':'POST','uri':util[_0xf090('0x27')](_0xf090('0x1e'),_0x4b9582[_0xf090('0x1f')]),'form':{'operation':_0xf090('0x20'),'sessionName':_0x10a146['sessionName'],'elementType':_0xf090('0x40'),'element':JSON['stringify']({'lastname':_0x5535e5,'phone':_0x4fc0c3,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x2ede84){logger[_0xf090('0x16')]('Enduser\x20created.');return BPromise[_0xf090('0x25')]({'id':_0x2ede84[_0xf090('0x26')]['id'],'name':_0x2ede84[_0xf090('0x26')][_0xf090('0x3e')],'phone':_0x2ede84[_0xf090('0x26')][_0xf090('0x41')]});})[_0xf090('0x2a')](function(_0x4a11d3){var _0x4acb97=_0x4a11d3[_0xf090('0x2b')]||0x1f4;logger[_0xf090('0x29')](_0xf090('0x2c'),'getEndUser',_0x4acb97,JSON[_0xf090('0x24')](_0x4a11d3));});}});}function getConnection(_0x2e4789){var _0xfab9cf=_0x2e4789['username'];var _0x292bf7=_0x2e4789['accessKey'];return request({'method':'GET','uri':util['format']('%s/webservice.php',_0x2e4789[_0xf090('0x1f')]),'qs':{'operation':'getchallenge','username':_0xfab9cf},'json':!![]})['then'](function(_0x265763){if(_0x265763[_0xf090('0x31')]){return request({'method':_0xf090('0x1d'),'uri':util['format'](_0xf090('0x1e'),_0x2e4789['remoteUri']),'form':{'operation':'login','username':_0xfab9cf,'accessKey':md5(_0x265763[_0xf090('0x26')]['token']+_0x292bf7)},'json':!![]});}})[_0xf090('0x3b')](function(_0x48ef72){if(_0x48ef72[_0xf090('0x31')]){return BPromise[_0xf090('0x25')](_0x48ef72[_0xf090('0x26')]);}else{throw new Error(util[_0xf090('0x27')](_0xf090('0x42'),_0x2e4789['id']));}})[_0xf090('0x2a')](function(_0x4a977c){var _0xc312b2=_0x4a977c[_0xf090('0x2b')]||0x1f4;logger['error'](_0xf090('0x2c'),'getConnection',_0xc312b2,JSON[_0xf090('0x24')](_0x4a977c));});}function request(_0x344d34){logger[_0xf090('0x16')](_0xf090('0x43'),JSON['stringify'](_0x344d34));return rp(_0x344d34);}exports['queue']=function(_0xb73687,_0x54f655,_0xd45256,_0x5a60ec,_0x24e222,_0x4593d5){var _0x8b9afa,_0x57dc19,_0x14ed7b,_0x1bb8dc;_0x4593d5[_0xf090('0x1f')]=intUtil[_0xf090('0x44')](_0x4593d5['remoteUri']);if(_0x24e222&&_0x24e222['monitor_format']){logger[_0xf090('0x16')](_0xf090('0x45'),'Recording\x20is\x20enabled!');_0x54f655[_0xf090('0x46')]=util[_0xf090('0x27')](_0xf090('0x47'),_0x4593d5[_0xf090('0x48')],_0x54f655[_0xf090('0x49')],md5(_0x54f655['uniqueid']));}else{_0x54f655[_0xf090('0x46')]='';}return getConnection(_0x4593d5)['then'](function(_0x5aee0d){_0x1bb8dc=_0x5aee0d;return getUser(_0x4593d5,_0x5a60ec['email'],_0x1bb8dc);})[_0xf090('0x3b')](function(_0x54b398){_0x8b9afa=_0x54b398;logger['info']('The\x20User\x20ID\x20is:',_0x8b9afa['id']);return getEndUser(_0x4593d5,_0x54f655[_0xf090('0x4a')],_0x54f655['calleridnum'],_0x1bb8dc);})['then'](function(_0xd85e1d){_0x57dc19=_0xd85e1d;logger[_0xf090('0x16')](_0xf090('0x4b'),_0x57dc19['id']);return createTicket(_0x4593d5,_0x8b9afa,_0x57dc19,_0xd45256,_0x54f655,_0xd45256['Fields'],_0x1bb8dc);})[_0xf090('0x3b')](function(_0x3dade1){_0x14ed7b=_0x3dade1;logger['info']('Ticket\x20created!');logger[_0xf090('0x16')](_0xf090('0x4c'),_0x14ed7b['id']);var _0xd2c30d=util[_0xf090('0x27')](_0xf090('0x4d'),_0x4593d5[_0xf090('0x1f')],_['split'](_0x14ed7b['id'],'x')[0x1]);logger['info'](_0xf090('0x45'),_0xf090('0x4e'));emit(util[_0xf090('0x27')](_0xf090('0x4f'),_0x5a60ec[_0xf090('0x14')]),_0xf090('0x50'),{'uri':_0xd2c30d});})[_0xf090('0x2a')](function(_0x50cb1a){logger[_0xf090('0x29')]('[QUEUE]',JSON['stringify'](_0x50cb1a));});};exports[_0xf090('0x51')]=function(_0x23ab77,_0x2c6b7e,_0x4ea74a,_0x5229d9,_0x8016c0,_0x4ac440,_0x290f4b){var _0xd0c5b6,_0xc8496f,_0x12dd58,_0x126f0f;_0x4ac440[_0xf090('0x1f')]=intUtil['stripTrailingSlash'](_0x4ac440[_0xf090('0x1f')]);_0x4ac440['serverUrl']=intUtil[_0xf090('0x44')](_0x4ac440[_0xf090('0x48')]);if(_0x290f4b&&_0x290f4b[_0xf090('0x52')]&&_0x290f4b[_0xf090('0x52')]!==_0xf090('0x53')){logger[_0xf090('0x16')](_0xf090('0x54'),_0xf090('0x55'));_0x2c6b7e[_0xf090('0x46')]=util['format'](_0xf090('0x47'),_0x4ac440[_0xf090('0x48')],_0x2c6b7e[_0xf090('0x49')],md5(_0x2c6b7e['uniqueid']));}return getConnection(_0x4ac440)[_0xf090('0x3b')](function(_0x4a2600){_0x126f0f=_0x4a2600;return getUser(_0x4ac440,_0x5229d9[_0xf090('0x56')],_0x126f0f);})[_0xf090('0x3b')](function(_0x1f088a){_0xd0c5b6=_0x1f088a;logger[_0xf090('0x16')](_0xf090('0x57'),_0xd0c5b6['id']);return getEndUser(_0x4ac440,_0x2c6b7e[_0xf090('0x58')],_0x2c6b7e[_0xf090('0x59')],_0x126f0f);})['then'](function(_0x4414f0){_0xc8496f=_0x4414f0;logger[_0xf090('0x16')](_0xf090('0x4b'),_0xc8496f['id']);return createTicket(_0x4ac440,_0xd0c5b6,_0xc8496f,_0x4ea74a,_0x2c6b7e,_0x4ea74a[_0xf090('0x5a')],_0x126f0f);})[_0xf090('0x3b')](function(_0x14824c){_0x12dd58=_0x14824c;logger['info'](_0xf090('0x5b'));logger[_0xf090('0x16')](_0xf090('0x4c'),_0x12dd58['id']);var _0x62bd1=util[_0xf090('0x27')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4ac440['remoteUri'],_[_0xf090('0x5c')](_0x12dd58['id'],'x')[0x1]);logger[_0xf090('0x16')]('[OUTBOUND]',_0xf090('0x4e'));emit(util[_0xf090('0x27')](_0xf090('0x4f'),_0x5229d9[_0xf090('0x14')]),_0xf090('0x50'),{'uri':_0x62bd1});})[_0xf090('0x2a')](function(_0x341b89){logger['error'](_0xf090('0x54'),JSON[_0xf090('0x24')](_0x341b89));});};exports['unmanaged']=function(_0x3e61f7,_0x103a8e,_0x527cfb,_0x5826c8,_0x575a64,_0x5561ee){var _0x36370e,_0x3c0936,_0x2efba4,_0x444c12;_0x5561ee['remoteUri']=intUtil[_0xf090('0x44')](_0x5561ee['remoteUri']);_0x5561ee[_0xf090('0x48')]=intUtil[_0xf090('0x44')](_0x5561ee[_0xf090('0x48')]);if(_0x575a64&&_0x575a64[_0xf090('0x5d')]){logger['info']('['+_0x103a8e[_0xf090('0x5e')][_0xf090('0x5f')]()+']',_0xf090('0x55'));_0x103a8e[_0xf090('0x46')]=util[_0xf090('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5561ee[_0xf090('0x48')],_0x103a8e['uniqueid'],md5(_0x103a8e['uniqueid']));}else{_0x103a8e[_0xf090('0x46')]='';}return getConnection(_0x5561ee)[_0xf090('0x3b')](function(_0x50d11a){_0x444c12=_0x50d11a;return getUser(_0x5561ee,'',_0x444c12);})[_0xf090('0x3b')](function(_0x19ecac){_0x36370e=_0x19ecac;logger['info'](_0xf090('0x57'),_0x36370e['id']);return getEndUser(_0x5561ee,_0x103a8e[_0xf090('0x4a')],_0x103a8e[_0xf090('0x60')],_0x444c12);})[_0xf090('0x3b')](function(_0xd679e5){_0x3c0936=_0xd679e5;logger['info'](_0xf090('0x4b'),_0x3c0936['id']);return createTicket(_0x5561ee,_0x36370e,_0x3c0936,_0x527cfb,_0x103a8e,_0x527cfb[_0xf090('0x5a')],_0x444c12);})[_0xf090('0x3b')](function(_0x3c55f8){_0x2efba4=_0x3c55f8;logger[_0xf090('0x16')]('Ticket\x20created!');logger[_0xf090('0x16')](_0xf090('0x4c'),_0x2efba4['id']);})[_0xf090('0x2a')](function(_0x452646){logger[_0xf090('0x29')]('['+_0x103a8e['lastevent']['toUpperCase']()+']',JSON[_0xf090('0x24')](_0x452646));});}; \ 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 0006d33..9fbdd9c 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 _0x9e0d=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','trigger:browser:url','Zendesk\x20account\x20type\x20not\x20recognized','error','inspect','outbound','recordingFormat','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','catch','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','POST','merge','Tags','name','getString','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','remoteUri','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/search.json','results','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','user','password','%s:%s','username','token','%s/token:%s','toString','base64','debug','[HTTP]','stringify','GET','map','forEach','type','string','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format'];(function(_0x999058,_0x4deb86){var _0x1dcbbd=function(_0x2488ee){while(--_0x2488ee){_0x999058['push'](_0x999058['shift']());}};_0x1dcbbd(++_0x4deb86);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x314350,_0x4433a0){_0x314350=_0x314350-0x0;var _0x2d9c1d=_0x9e0d[_0x314350];return _0x2d9c1d;};'use strict';var _=require(_0xd9e0('0x0'));var rp=require(_0xd9e0('0x1'));var md5=require(_0xd9e0('0x2'));var util=require(_0xd9e0('0x3'));var Redis=require('ioredis');var intUtil=require(_0xd9e0('0x4'));var config=require(_0xd9e0('0x5'));var logger=require(_0xd9e0('0x6'))(_0xd9e0('0x7'));config[_0xd9e0('0x8')]=_[_0xd9e0('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd9e0('0xa'))(new Redis(config[_0xd9e0('0x8')]));function emit(_0x36d1c7,_0x3f8bb2,_0x256df0){io['to'](_0x36d1c7)[_0xd9e0('0xb')](_0x3f8bb2,_0x256df0);}var headers={'Content-Type':'application/json','Accept':_0xd9e0('0xc')};function getTicket(_0x36e6e7,_0x57763b,_0x5bd6ad,_0x1fc11b,_0x912d1e){logger[_0xd9e0('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xd9e0('0xe')](_0xd9e0('0xf'),_0x36e6e7['remoteUri']),'method':_0xd9e0('0x10'),'body':{'ticket':_[_0xd9e0('0x11')]({'requester_id':_0x5bd6ad['id'],'submitter_id':_0x57763b?_0x57763b['id']:undefined,'assignee_id':_0x57763b?_0x57763b['id']:undefined,'tags':getTags(_0x1fc11b[_0xd9e0('0x12')],_0xd9e0('0x13')),'subject':intUtil[_0xd9e0('0x14')](_0x1fc11b['Subjects'],_0x912d1e,'\x20'),'description':intUtil[_0xd9e0('0x14')](_0x1fc11b['Descriptions'],_0x912d1e,'\x0a'),'comment':{'public':![],'body':intUtil[_0xd9e0('0x14')](_0x1fc11b['Descriptions'],_0x912d1e,'\x0a')}},getCustomFields(_0x1fc11b[_0xd9e0('0x15')],_0x912d1e))}})[_0xd9e0('0x16')](function(_0x60be45){logger[_0xd9e0('0xd')](_0xd9e0('0x17'));return _0x60be45['ticket'];});}function getUser(_0x58d44c,_0x5aff0b){if(intUtil[_0xd9e0('0x18')](_0x5aff0b)){logger[_0xd9e0('0xd')](_0xd9e0('0x19'),_0x5aff0b);return request({'uri':util[_0xd9e0('0xe')]('%s/search.json',_0x58d44c[_0xd9e0('0x1a')]),'qs':{'query':util['format']('type:user\x20role:agent\x20email:%s',_0x5aff0b)}})[_0xd9e0('0x16')](function(_0x30a342){if(_0x30a342['count']){logger['info'](_0xd9e0('0x1b'));return _[_0xd9e0('0x1c')](_0x30a342['results'],{'email':_0x5aff0b,'role':_0xd9e0('0x1d')});}else{logger[_0xd9e0('0xd')](_0xd9e0('0x1e'));return request({'uri':util[_0xd9e0('0xe')](_0xd9e0('0x1f'),_0x58d44c[_0xd9e0('0x1a')])})[_0xd9e0('0x16')](function(_0x5711a1){logger[_0xd9e0('0xd')](_0xd9e0('0x20'));return _0x5711a1['user'];});}});}else{logger[_0xd9e0('0xd')](_0xd9e0('0x1e'));return request({'uri':util['format'](_0xd9e0('0x1f'),_0x58d44c['remoteUri'])})[_0xd9e0('0x16')](function(_0x33a1ea){logger['info'](_0xd9e0('0x20'));return _0x33a1ea['user'];});}}function getEndUser(_0x554aeb,_0x50f57d,_0x4737ae){logger[_0xd9e0('0xd')](_0xd9e0('0x21'),_0x4737ae);return request({'uri':util[_0xd9e0('0xe')](_0xd9e0('0x22'),_0x554aeb[_0xd9e0('0x1a')]),'qs':{'query':util[_0xd9e0('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x4737ae)}})[_0xd9e0('0x16')](function(_0x4bd349){var _0x3bfd06;if(_0x4bd349[_0xd9e0('0x23')][_0xd9e0('0x24')]){_0x4bd349['results']=_['filter'](_0x4bd349['results'],{'suspended':![],'role':_0xd9e0('0x25')});if(_0x4bd349[_0xd9e0('0x23')]['length']){_0x3bfd06=_[_0xd9e0('0x26')](_0x4bd349[_0xd9e0('0x23')]);}}if(_0x3bfd06){logger[_0xd9e0('0xd')](_0xd9e0('0x27'));return _0x3bfd06;}else{logger[_0xd9e0('0xd')](_0xd9e0('0x28'));return request({'uri':util[_0xd9e0('0xe')]('%s/users.json',_0x554aeb[_0xd9e0('0x1a')]),'method':_0xd9e0('0x10'),'body':{'user':{'role':_0xd9e0('0x25'),'name':util[_0xd9e0('0xe')](_0xd9e0('0x29'),_0x50f57d||_0x4737ae),'phone':_0x4737ae}}})[_0xd9e0('0x16')](function(_0x209a8f){logger[_0xd9e0('0xd')](_0xd9e0('0x2a'));return _0x209a8f[_0xd9e0('0x2b')];});}});}function getAuth(_0x27a36a){var _0x453509;if(_0x27a36a['authType']===_0xd9e0('0x2c')){_0x453509=util[_0xd9e0('0xe')](_0xd9e0('0x2d'),_0x27a36a[_0xd9e0('0x2e')],_0x27a36a[_0xd9e0('0x2c')]);}else if(_0x27a36a['authType']===_0xd9e0('0x2f')){_0x453509=util[_0xd9e0('0xe')](_0xd9e0('0x30'),_0x27a36a[_0xd9e0('0x2e')],_0x27a36a['token']);}return util[_0xd9e0('0xe')]('Basic\x20%s',new Buffer(_0x453509)[_0xd9e0('0x31')](_0xd9e0('0x32')));}function request(_0x12f995){logger[_0xd9e0('0x33')](_0xd9e0('0x34'),JSON[_0xd9e0('0x35')](_0x12f995));return rp(_[_0xd9e0('0x9')](_0x12f995,{'method':_0xd9e0('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x4574fb,_0x5065f7){var _0x318679=[];if(_0x4574fb&&_0x4574fb[_0xd9e0('0x24')]>0x0){_0x318679=_[_0xd9e0('0x37')](_0x4574fb,_0x5065f7);}return _0x318679;}function getCustomFields(_0x430240,_0x4aafc7){var _0x38ad8c=[];var _0x8317a8={'custom_fields':[]};if(_0x430240[_0xd9e0('0x24')]>0x0){_[_0xd9e0('0x38')](_0x430240,function(_0x12529b){if(_0x12529b[_0xd9e0('0x39')]===_0xd9e0('0x3a')&&_0x12529b[_0xd9e0('0x3b')]&&!_0x12529b[_0xd9e0('0x3c')]){_0x8317a8[_0x12529b[_0xd9e0('0x3b')][_0xd9e0('0x3d')]()]=_0x12529b[_0xd9e0('0x3e')][_0xd9e0('0x31')]();}else if(_0x12529b[_0xd9e0('0x39')]===_0xd9e0('0x3a')&&_0x12529b[_0xd9e0('0x3f')]&&_0x12529b['customField']){_0x8317a8[_0xd9e0('0x40')][_0xd9e0('0x41')]({'id':_0x12529b['idField'],'value':_0x12529b[_0xd9e0('0x3e')]['toString']()});}else if(_0x12529b[_0xd9e0('0x39')]===_0xd9e0('0x42')&&_0x12529b[_0xd9e0('0x43')]&&_0x12529b[_0xd9e0('0x3f')]&&_0x12529b[_0xd9e0('0x3c')]){_0x4aafc7[_0x12529b[_0xd9e0('0x43')]]&&_0x8317a8['custom_fields']['push']({'id':_0x12529b[_0xd9e0('0x3f')],'value':_0x4aafc7[_0x12529b[_0xd9e0('0x43')]][_0xd9e0('0x31')]()});}else if(_0x12529b[_0xd9e0('0x39')]===_0xd9e0('0x44')&&_0x12529b['Variable']&&_0x12529b[_0xd9e0('0x45')][_0xd9e0('0x13')]&&_0x12529b[_0xd9e0('0x3f')]&&_0x12529b[_0xd9e0('0x3c')]){_0x4aafc7[_0x12529b['Variable'][_0xd9e0('0x13')][_0xd9e0('0x3d')]()]&&_0x8317a8[_0xd9e0('0x40')]['push']({'id':_0x12529b['idField'],'value':_0x4aafc7[_0x12529b[_0xd9e0('0x45')][_0xd9e0('0x13')]['toLowerCase']()]['toString']()});}});}return _0x8317a8;}exports[_0xd9e0('0x46')]=function(_0x25496d,_0x3339a2,_0x29933d,_0x1ce011,_0x2f65cc,_0x24703c){var _0x7d7182,_0x58ed42;_0x24703c[_0xd9e0('0x1a')]=intUtil[_0xd9e0('0x47')](_0x24703c['remoteUri']);_0x24703c[_0xd9e0('0x48')]=intUtil[_0xd9e0('0x47')](_0x24703c[_0xd9e0('0x48')]);if(_0x2f65cc&&_0x2f65cc[_0xd9e0('0x49')]){logger[_0xd9e0('0xd')](_0xd9e0('0x4a'),_0xd9e0('0x4b'));_0x3339a2[_0xd9e0('0x4c')]=util[_0xd9e0('0xe')](_0xd9e0('0x4d'),_0x24703c[_0xd9e0('0x48')],_0x3339a2[_0xd9e0('0x4e')],md5(_0x3339a2['uniqueid']));}else{_0x3339a2[_0xd9e0('0x4c')]='';}headers[_0xd9e0('0x4f')]=getAuth(_0x24703c);return getUser(_0x24703c,_0x1ce011['email'])[_0xd9e0('0x16')](function(_0x5ad53d){_0x7d7182=_0x5ad53d;logger[_0xd9e0('0xd')](_0xd9e0('0x50'),_0x7d7182['id']);return getEndUser(_0x24703c,_0x3339a2[_0xd9e0('0x51')],_0x3339a2[_0xd9e0('0x52')]);})[_0xd9e0('0x16')](function(_0xb50fa9){_0x58ed42=_0xb50fa9;logger[_0xd9e0('0xd')]('The\x20Enduser\x20ID\x20is:',_0x58ed42['id']);return getTicket(_0x24703c,_0x7d7182,_0x58ed42,_0x29933d,_0x3339a2);})[_0xd9e0('0x16')](function(_0xc2b731){if(_0xc2b731){logger[_0xd9e0('0xd')](_0xd9e0('0x53'),_0xc2b731['id']);switch(_0x24703c[_0xd9e0('0x39')]){case'integrationTab':logger['info'](_0xd9e0('0x4a'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xd9e0('0xe')](_0xd9e0('0x54'),_0x24703c['remoteUri'],_0x7d7182['id'],_0xc2b731['id']),'method':'POST'});case _0xd9e0('0x55'):logger[_0xd9e0('0xd')](_0xd9e0('0x4a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xd9e0('0xe')]('user:%s',_0x1ce011[_0xd9e0('0x13')]),_0xd9e0('0x56'),{'uri':util[_0xd9e0('0xe')]('%s/agent/tickets/%s',_0x24703c[_0xd9e0('0x1a')],_0xc2b731['id'])});break;default:logger['error'](_0xd9e0('0x4a'),_0xd9e0('0x57'));}}})['catch'](function(_0x38af96){logger[_0xd9e0('0x58')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xd9e0('0x59')](_0x38af96,{'showHidden':!![],'depth':null}));});};exports[_0xd9e0('0x5a')]=function(_0x5adc9e,_0x2cc168,_0x33336f,_0x5b52d9,_0x1e3fee,_0x19a76c,_0x5a9a4f){var _0x335be9,_0x124464;_0x19a76c[_0xd9e0('0x1a')]=intUtil[_0xd9e0('0x47')](_0x19a76c[_0xd9e0('0x1a')]);_0x19a76c[_0xd9e0('0x48')]=intUtil[_0xd9e0('0x47')](_0x19a76c[_0xd9e0('0x48')]);if(_0x5a9a4f&&_0x5a9a4f[_0xd9e0('0x5b')]&&_0x5a9a4f[_0xd9e0('0x5b')]!=='none'){logger['info']('[OUTBOUND]',_0xd9e0('0x4b'));_0x2cc168['recordingURL']=util[_0xd9e0('0xe')](_0xd9e0('0x4d'),_0x19a76c[_0xd9e0('0x48')],_0x2cc168[_0xd9e0('0x4e')],md5(_0x2cc168['uniqueid']));}headers[_0xd9e0('0x4f')]=getAuth(_0x19a76c);return getUser(_0x19a76c,_0x5b52d9[_0xd9e0('0x5c')])[_0xd9e0('0x16')](function(_0x369401){_0x335be9=_0x369401;logger[_0xd9e0('0xd')]('The\x20User\x20ID\x20is:',_0x335be9['id']);return getEndUser(_0x19a76c,_0x2cc168[_0xd9e0('0x5d')],_0x2cc168[_0xd9e0('0x5e')]);})['then'](function(_0x404acd){_0x124464=_0x404acd;logger[_0xd9e0('0xd')](_0xd9e0('0x5f'),_0x124464['id']);return getTicket(_0x19a76c,_0x335be9,_0x124464,_0x33336f,_0x2cc168);})[_0xd9e0('0x16')](function(_0x450be3){if(_0x450be3){logger[_0xd9e0('0xd')](_0xd9e0('0x53'),_0x450be3['id']);switch(_0x19a76c['type']){case _0xd9e0('0x60'):logger[_0xd9e0('0xd')](_0xd9e0('0x61'),_0xd9e0('0x62'));return request({'uri':util[_0xd9e0('0xe')](_0xd9e0('0x54'),_0x19a76c[_0xd9e0('0x1a')],_0x335be9['id'],_0x450be3['id']),'method':_0xd9e0('0x10')});case _0xd9e0('0x55'):logger[_0xd9e0('0xd')]('[OUTBOUND]',_0xd9e0('0x63'));emit(util['format'](_0xd9e0('0x64'),_0x5b52d9[_0xd9e0('0x13')]),'trigger:browser:url',{'uri':util['format'](_0xd9e0('0x65'),_0x19a76c[_0xd9e0('0x1a')],_0x450be3['id'])});break;default:logger[_0xd9e0('0x58')](_0xd9e0('0x61'),_0xd9e0('0x57'));}}})['catch'](function(_0x1cc3b9){logger[_0xd9e0('0x58')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xd9e0('0x59')](_0x1cc3b9,{'showHidden':!![],'depth':null}));});};exports[_0xd9e0('0x66')]=function(_0x224bf3,_0x3447e4,_0x52c7d7,_0x32f22d,_0x2c1e95,_0x373a97){var _0x1e96ef,_0x55e5df;_0x373a97['remoteUri']=intUtil['stripTrailingSlash'](_0x373a97[_0xd9e0('0x1a')]);_0x373a97[_0xd9e0('0x48')]=intUtil[_0xd9e0('0x47')](_0x373a97['serverUrl']);if(_0x2c1e95&&_0x2c1e95[_0xd9e0('0x49')]){logger[_0xd9e0('0xd')]('['+_0x3447e4[_0xd9e0('0x67')][_0xd9e0('0x68')]()+']',_0xd9e0('0x4b'));_0x3447e4[_0xd9e0('0x4c')]=util['format'](_0xd9e0('0x4d'),_0x373a97['serverUrl'],_0x3447e4[_0xd9e0('0x4e')],md5(_0x3447e4['uniqueid']));}else{_0x3447e4[_0xd9e0('0x4c')]='';}headers[_0xd9e0('0x4f')]=getAuth(_0x373a97);return getUser(_0x373a97)[_0xd9e0('0x16')](function(_0x69776e){_0x1e96ef=_0x69776e;logger[_0xd9e0('0xd')](_0xd9e0('0x50'),_0x1e96ef['id']);return getEndUser(_0x373a97,_0x3447e4[_0xd9e0('0x51')],_0x3447e4[_0xd9e0('0x52')]);})[_0xd9e0('0x16')](function(_0x40b481){_0x55e5df=_0x40b481;logger[_0xd9e0('0xd')]('The\x20Enduser\x20ID\x20is:',_0x55e5df['id']);return getTicket(_0x373a97,_0x1e96ef,_0x55e5df,_0x52c7d7,_0x3447e4);})[_0xd9e0('0x16')](function(_0x1f790f){if(_0x1f790f){logger[_0xd9e0('0xd')](_0xd9e0('0x53'),_0x1f790f['id']);}})[_0xd9e0('0x69')](function(_0x1bb50a){logger[_0xd9e0('0x58')]('['+_0x3447e4[_0xd9e0('0x67')]['toUpperCase']()+']'+_0xd9e0('0x6a'),util[_0xd9e0('0x59')](_0x1bb50a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x4522=['calleridname','catch','lastevent','\x20Error\x20running\x20Zendesk\x20integration','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','Descriptions','then','Ticket\x20created!','validateEmail','info','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','password','username','authType','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','map','string','nameField','toLowerCase','content','type','idField','customField','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','Zendesk\x20account\x20type\x20not\x20recognized','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','%s/agent/tickets/%s','toUpperCase'];(function(_0x46674c,_0x487cda){var _0x58b5ce=function(_0x47eb71){while(--_0x47eb71){_0x46674c['push'](_0x46674c['shift']());}};_0x58b5ce(++_0x487cda);}(_0x4522,0x1a0));var _0x2452=function(_0x625d33,_0x49620c){_0x625d33=_0x625d33-0x0;var _0x564efe=_0x4522[_0x625d33];return _0x564efe;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x2452('0x0'));var util=require(_0x2452('0x1'));var Redis=require(_0x2452('0x2'));var intUtil=require('./util');var config=require(_0x2452('0x3'));var logger=require(_0x2452('0x4'))(_0x2452('0x5'));config[_0x2452('0x6')]=_[_0x2452('0x7')](config[_0x2452('0x6')],{'host':_0x2452('0x8'),'port':0x18eb});var io=require(_0x2452('0x9'))(new Redis(config[_0x2452('0x6')]));function emit(_0x149807,_0x3bc193,_0x33b935){io['to'](_0x149807)[_0x2452('0xa')](_0x3bc193,_0x33b935);}var headers={'Content-Type':_0x2452('0xb'),'Accept':_0x2452('0xb')};function getTicket(_0x2995b5,_0x5a38e0,_0x5dc630,_0x695088,_0x5bf6cf){logger['info'](_0x2452('0xc'));return request({'uri':util[_0x2452('0xd')](_0x2452('0xe'),_0x2995b5[_0x2452('0xf')]),'method':_0x2452('0x10'),'body':{'ticket':_[_0x2452('0x11')]({'requester_id':_0x5dc630['id'],'submitter_id':_0x5a38e0?_0x5a38e0['id']:undefined,'assignee_id':_0x5a38e0?_0x5a38e0['id']:undefined,'tags':getTags(_0x695088[_0x2452('0x12')],_0x2452('0x13')),'subject':intUtil['getString'](_0x695088['Subjects'],_0x5bf6cf,'\x20'),'description':intUtil['getString'](_0x695088[_0x2452('0x14')],_0x5bf6cf,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x695088[_0x2452('0x14')],_0x5bf6cf,'\x0a')}},getCustomFields(_0x695088['Fields'],_0x5bf6cf))}})[_0x2452('0x15')](function(_0x42efdf){logger['info'](_0x2452('0x16'));return _0x42efdf['ticket'];});}function getUser(_0x3dd8cc,_0x734b88){if(intUtil[_0x2452('0x17')](_0x734b88)){logger[_0x2452('0x18')]('Getting\x20agent\x20with\x20email',_0x734b88);return request({'uri':util[_0x2452('0xd')](_0x2452('0x19'),_0x3dd8cc['remoteUri']),'qs':{'query':util['format'](_0x2452('0x1a'),_0x734b88)}})[_0x2452('0x15')](function(_0x377c12){if(_0x377c12['count']){logger[_0x2452('0x18')](_0x2452('0x1b'));return _[_0x2452('0x1c')](_0x377c12[_0x2452('0x1d')],{'email':_0x734b88,'role':_0x2452('0x1e')});}else{logger[_0x2452('0x18')](_0x2452('0x1f'));return request({'uri':util[_0x2452('0xd')]('%s/users/me.json',_0x3dd8cc['remoteUri'])})[_0x2452('0x15')](function(_0x32dfe7){logger['info'](_0x2452('0x20'));return _0x32dfe7[_0x2452('0x21')];});}});}else{logger[_0x2452('0x18')](_0x2452('0x1f'));return request({'uri':util[_0x2452('0xd')](_0x2452('0x22'),_0x3dd8cc[_0x2452('0xf')])})['then'](function(_0x119bf6){logger[_0x2452('0x18')](_0x2452('0x20'));return _0x119bf6[_0x2452('0x21')];});}}function getEndUser(_0x3a4326,_0x516fcf,_0x48783a){logger[_0x2452('0x18')](_0x2452('0x23'),_0x48783a);return request({'uri':util[_0x2452('0xd')](_0x2452('0x19'),_0x3a4326[_0x2452('0xf')]),'qs':{'query':util['format'](_0x2452('0x24'),_0x48783a)}})[_0x2452('0x15')](function(_0x5e9184){var _0x4a25aa;if(_0x5e9184[_0x2452('0x1d')][_0x2452('0x25')]){_0x5e9184[_0x2452('0x1d')]=_[_0x2452('0x26')](_0x5e9184[_0x2452('0x1d')],{'suspended':![],'role':_0x2452('0x27')});if(_0x5e9184['results']['length']){_0x4a25aa=_[_0x2452('0x28')](_0x5e9184[_0x2452('0x1d')]);}}if(_0x4a25aa){logger[_0x2452('0x18')]('Enduser\x20found!');return _0x4a25aa;}else{logger[_0x2452('0x18')](_0x2452('0x29'));return request({'uri':util['format'](_0x2452('0x2a'),_0x3a4326[_0x2452('0xf')]),'method':_0x2452('0x10'),'body':{'user':{'role':_0x2452('0x27'),'name':util[_0x2452('0xd')](_0x2452('0x2b'),_0x516fcf||_0x48783a),'phone':_0x48783a}}})[_0x2452('0x15')](function(_0x115e09){logger[_0x2452('0x18')](_0x2452('0x2c'));return _0x115e09[_0x2452('0x21')];});}});}function getAuth(_0x16c54a){var _0x26e841;if(_0x16c54a['authType']===_0x2452('0x2d')){_0x26e841=util[_0x2452('0xd')]('%s:%s',_0x16c54a[_0x2452('0x2e')],_0x16c54a['password']);}else if(_0x16c54a[_0x2452('0x2f')]===_0x2452('0x30')){_0x26e841=util['format'](_0x2452('0x31'),_0x16c54a[_0x2452('0x2e')],_0x16c54a[_0x2452('0x30')]);}return util['format'](_0x2452('0x32'),new Buffer(_0x26e841)[_0x2452('0x33')]('base64'));}function request(_0xa09d27){logger[_0x2452('0x34')](_0x2452('0x35'),JSON[_0x2452('0x36')](_0xa09d27));return rp(_[_0x2452('0x7')](_0xa09d27,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x58b6c2,_0x510b79){var _0x1df280=[];if(_0x58b6c2&&_0x58b6c2[_0x2452('0x25')]>0x0){_0x1df280=_[_0x2452('0x37')](_0x58b6c2,_0x510b79);}return _0x1df280;}function getCustomFields(_0x24db0e,_0x408b92){var _0x4c4c45=[];var _0x22120a={'custom_fields':[]};if(_0x24db0e['length']>0x0){_['forEach'](_0x24db0e,function(_0x28bc06){if(_0x28bc06['type']===_0x2452('0x38')&&_0x28bc06[_0x2452('0x39')]&&!_0x28bc06['customField']){_0x22120a[_0x28bc06[_0x2452('0x39')][_0x2452('0x3a')]()]=_0x28bc06[_0x2452('0x3b')][_0x2452('0x33')]();}else if(_0x28bc06[_0x2452('0x3c')]===_0x2452('0x38')&&_0x28bc06[_0x2452('0x3d')]&&_0x28bc06[_0x2452('0x3e')]){_0x22120a['custom_fields'][_0x2452('0x3f')]({'id':_0x28bc06['idField'],'value':_0x28bc06[_0x2452('0x3b')][_0x2452('0x33')]()});}else if(_0x28bc06['type']===_0x2452('0x40')&&_0x28bc06[_0x2452('0x41')]&&_0x28bc06[_0x2452('0x3d')]&&_0x28bc06[_0x2452('0x3e')]){_0x408b92[_0x28bc06[_0x2452('0x41')]]&&_0x22120a['custom_fields'][_0x2452('0x3f')]({'id':_0x28bc06[_0x2452('0x3d')],'value':_0x408b92[_0x28bc06['variableName']][_0x2452('0x33')]()});}else if(_0x28bc06[_0x2452('0x3c')]===_0x2452('0x42')&&_0x28bc06[_0x2452('0x43')]&&_0x28bc06['Variable'][_0x2452('0x13')]&&_0x28bc06[_0x2452('0x3d')]&&_0x28bc06[_0x2452('0x3e')]){_0x408b92[_0x28bc06[_0x2452('0x43')][_0x2452('0x13')][_0x2452('0x3a')]()]&&_0x22120a['custom_fields'][_0x2452('0x3f')]({'id':_0x28bc06['idField'],'value':_0x408b92[_0x28bc06[_0x2452('0x43')][_0x2452('0x13')]['toLowerCase']()]['toString']()});}});}return _0x22120a;}exports['queue']=function(_0x5014b8,_0xd62892,_0x4ec49f,_0x15f0e7,_0x5e400a,_0x1ef02b){var _0x16d938,_0x55de3d;_0x1ef02b['remoteUri']=intUtil[_0x2452('0x44')](_0x1ef02b['remoteUri']);_0x1ef02b[_0x2452('0x45')]=intUtil[_0x2452('0x44')](_0x1ef02b[_0x2452('0x45')]);if(_0x5e400a&&_0x5e400a[_0x2452('0x46')]){logger['info']('[QUEUE]',_0x2452('0x47'));_0xd62892[_0x2452('0x48')]=util[_0x2452('0xd')](_0x2452('0x49'),_0x1ef02b[_0x2452('0x45')],_0xd62892['uniqueid'],md5(_0xd62892[_0x2452('0x4a')]));}else{_0xd62892['recordingURL']='';}headers[_0x2452('0x4b')]=getAuth(_0x1ef02b);return getUser(_0x1ef02b,_0x15f0e7['email'])[_0x2452('0x15')](function(_0x21369e){_0x16d938=_0x21369e;logger['info'](_0x2452('0x4c'),_0x16d938['id']);return getEndUser(_0x1ef02b,_0xd62892['calleridname'],_0xd62892[_0x2452('0x4d')]);})['then'](function(_0x4fc8d4){_0x55de3d=_0x4fc8d4;logger['info'](_0x2452('0x4e'),_0x55de3d['id']);return getTicket(_0x1ef02b,_0x16d938,_0x55de3d,_0x4ec49f,_0xd62892);})[_0x2452('0x15')](function(_0x36ebcb){if(_0x36ebcb){logger['info'](_0x2452('0x4f'),_0x36ebcb['id']);switch(_0x1ef02b[_0x2452('0x3c')]){case _0x2452('0x50'):logger[_0x2452('0x18')](_0x2452('0x51'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x2452('0xd')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1ef02b[_0x2452('0xf')],_0x16d938['id'],_0x36ebcb['id']),'method':_0x2452('0x10')});case _0x2452('0x52'):logger[_0x2452('0x18')](_0x2452('0x51'),_0x2452('0x53'));emit(util[_0x2452('0xd')](_0x2452('0x54'),_0x15f0e7[_0x2452('0x13')]),'trigger:browser:url',{'uri':util[_0x2452('0xd')]('%s/agent/tickets/%s',_0x1ef02b[_0x2452('0xf')],_0x36ebcb['id'])});break;default:logger['error'](_0x2452('0x51'),_0x2452('0x55'));}}})['catch'](function(_0xc14c3d){logger[_0x2452('0x56')](_0x2452('0x57'),util[_0x2452('0x58')](_0xc14c3d,{'showHidden':!![],'depth':null}));});};exports[_0x2452('0x59')]=function(_0x96a22e,_0x3b32a6,_0x2a3ec1,_0x38fffc,_0x207df7,_0x44ae1f,_0x4c203f){var _0x6ed5fa,_0x4aef77;_0x44ae1f[_0x2452('0xf')]=intUtil['stripTrailingSlash'](_0x44ae1f[_0x2452('0xf')]);_0x44ae1f[_0x2452('0x45')]=intUtil[_0x2452('0x44')](_0x44ae1f[_0x2452('0x45')]);if(_0x4c203f&&_0x4c203f[_0x2452('0x5a')]&&_0x4c203f[_0x2452('0x5a')]!==_0x2452('0x5b')){logger[_0x2452('0x18')](_0x2452('0x5c'),_0x2452('0x47'));_0x3b32a6[_0x2452('0x48')]=util['format'](_0x2452('0x49'),_0x44ae1f[_0x2452('0x45')],_0x3b32a6[_0x2452('0x4a')],md5(_0x3b32a6[_0x2452('0x4a')]));}headers[_0x2452('0x4b')]=getAuth(_0x44ae1f);return getUser(_0x44ae1f,_0x38fffc[_0x2452('0x5d')])['then'](function(_0x356485){_0x6ed5fa=_0x356485;logger[_0x2452('0x18')]('The\x20User\x20ID\x20is:',_0x6ed5fa['id']);return getEndUser(_0x44ae1f,_0x3b32a6[_0x2452('0x5e')],_0x3b32a6[_0x2452('0x5f')]);})[_0x2452('0x15')](function(_0x234468){_0x4aef77=_0x234468;logger[_0x2452('0x18')](_0x2452('0x4e'),_0x4aef77['id']);return getTicket(_0x44ae1f,_0x6ed5fa,_0x4aef77,_0x2a3ec1,_0x3b32a6);})[_0x2452('0x15')](function(_0x3907c4){if(_0x3907c4){logger[_0x2452('0x18')](_0x2452('0x4f'),_0x3907c4['id']);switch(_0x44ae1f[_0x2452('0x3c')]){case'integrationTab':logger['info'](_0x2452('0x5c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x2452('0xd')](_0x2452('0x60'),_0x44ae1f[_0x2452('0xf')],_0x6ed5fa['id'],_0x3907c4['id']),'method':_0x2452('0x10')});case _0x2452('0x52'):logger[_0x2452('0x18')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2452('0xd')]('user:%s',_0x38fffc[_0x2452('0x13')]),'trigger:browser:url',{'uri':util[_0x2452('0xd')](_0x2452('0x61'),_0x44ae1f[_0x2452('0xf')],_0x3907c4['id'])});break;default:logger[_0x2452('0x56')]('[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x9ef864){logger[_0x2452('0x56')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x9ef864,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x53d0e7,_0x4b563d,_0x1eee91,_0x4e8ab4,_0x513815,_0x31e47b){var _0x1be7ae,_0x3ce2e0;_0x31e47b[_0x2452('0xf')]=intUtil[_0x2452('0x44')](_0x31e47b[_0x2452('0xf')]);_0x31e47b['serverUrl']=intUtil[_0x2452('0x44')](_0x31e47b[_0x2452('0x45')]);if(_0x513815&&_0x513815[_0x2452('0x46')]){logger['info']('['+_0x4b563d['lastevent'][_0x2452('0x62')]()+']',_0x2452('0x47'));_0x4b563d[_0x2452('0x48')]=util[_0x2452('0xd')](_0x2452('0x49'),_0x31e47b[_0x2452('0x45')],_0x4b563d[_0x2452('0x4a')],md5(_0x4b563d[_0x2452('0x4a')]));}else{_0x4b563d['recordingURL']='';}headers[_0x2452('0x4b')]=getAuth(_0x31e47b);return getUser(_0x31e47b)[_0x2452('0x15')](function(_0x104ca6){_0x1be7ae=_0x104ca6;logger[_0x2452('0x18')]('The\x20User\x20ID\x20is:',_0x1be7ae['id']);return getEndUser(_0x31e47b,_0x4b563d[_0x2452('0x63')],_0x4b563d[_0x2452('0x4d')]);})['then'](function(_0x20f796){_0x3ce2e0=_0x20f796;logger[_0x2452('0x18')](_0x2452('0x4e'),_0x3ce2e0['id']);return getTicket(_0x31e47b,_0x1be7ae,_0x3ce2e0,_0x1eee91,_0x4b563d);})[_0x2452('0x15')](function(_0x19cf40){if(_0x19cf40){logger[_0x2452('0x18')](_0x2452('0x4f'),_0x19cf40['id']);}})[_0x2452('0x64')](function(_0x521640){logger['error']('['+_0x4b563d[_0x2452('0x65')][_0x2452('0x62')]()+']'+_0x2452('0x66'),util[_0x2452('0x58')](_0x521640,{'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 1830c9a..fac1d3e 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 _0x87ad=['refreshToken','clientId','clientSecret','refresh_token','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','isNil','Agent\x20found!','user','Administrator','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','role','first_name','last_name','code','SUCCESS','details','startCase','Error:\x20','log','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','https://www.zohoapis.','Leads','contact','moduleCreate','nothing','lead','Creating\x20new\x20call...','profile','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Called','complete','connect','Call_Result','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','recordingURL','destcalleridname','destcalleridnum','Outbound','/crm/EntityInfo.do?module=Calls&id=','monitor_format','toUpperCase','/downloads?type=uniqueid&token=','lodash','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','debug','stringify','length','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token'];(function(_0x15118f,_0x30d034){var _0x3fcce4=function(_0x593ee6){while(--_0x593ee6){_0x15118f['push'](_0x15118f['shift']());}};_0x3fcce4(++_0x30d034);}(_0x87ad,0x76));var _0xd87a=function(_0x469a07,_0x1fd3cc){_0x469a07=_0x469a07-0x0;var _0x3c95be=_0x87ad[_0x469a07];return _0x3c95be;};'use strict';var _=require(_0xd87a('0x0'));var rp=require(_0xd87a('0x1'));var md5=require(_0xd87a('0x2'));var util=require(_0xd87a('0x3'));var intUtil=require(_0xd87a('0x4'));var moment=require('moment');var Redis=require(_0xd87a('0x5'));var BPromise=require(_0xd87a('0x6'));var config=require(_0xd87a('0x7'));var logger=require(_0xd87a('0x8'))('zoho');config[_0xd87a('0x9')]=_['defaults'](config[_0xd87a('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xd87a('0xa'))(new Redis(config[_0xd87a('0x9')]));function emit(_0x50610d,_0x27a46f,_0x437d2a){io['to'](_0x50610d)['emit'](_0x27a46f,_0x437d2a);}function request(_0x2e2f01){logger[_0xd87a('0xb')]('[HTTP]',JSON[_0xd87a('0xc')](_0x2e2f01));return rp(_0x2e2f01);}function getCustomFields(_0x22755a,_0x585c5c){var _0x50427c={};if(_0x22755a[_0xd87a('0xd')]>0x0){_['forEach'](_0x22755a,function(_0x3b452b){if(_0x3b452b[_0xd87a('0xe')]==='string'&&_0x3b452b[_0xd87a('0xf')]){_0x50427c[_0x3b452b[_0xd87a('0xf')]]=_0x3b452b[_0xd87a('0x10')][_0xd87a('0x11')]();}else if(_0x3b452b[_0xd87a('0xe')]===_0xd87a('0x12')&&_0x3b452b['variableName']&&_0x3b452b[_0xd87a('0xf')]&&_0x585c5c[_0x3b452b[_0xd87a('0x13')]]){_0x50427c[_0x3b452b[_0xd87a('0xf')]]=_0x585c5c[_0x3b452b[_0xd87a('0x13')]]['toString']();}else if(_0x3b452b[_0xd87a('0xe')]===_0xd87a('0x14')&&_0x3b452b[_0xd87a('0x15')]&&_0x3b452b[_0xd87a('0x15')]['name']&&_0x3b452b[_0xd87a('0xf')]&&_0x585c5c[_0x3b452b['Variable'][_0xd87a('0x16')][_0xd87a('0x17')]()]){_0x50427c[_0x3b452b['idField']]=_0x585c5c[_0x3b452b[_0xd87a('0x15')][_0xd87a('0x16')][_0xd87a('0x17')]()][_0xd87a('0x11')]();}});}return _0x50427c;}function getName(_0x2057ce){if(_0x2057ce['indexOf']('\x20')>0x0){var _0x4bdebd=_0x2057ce[_0xd87a('0x18')](/ (.+)/);if(_0x4bdebd[0x1]){return _0x4bdebd;}}return[_0x2057ce,_0x2057ce];}var accountsTokens={};function getAccessToken(_0x2ec59f){return new Promise(function(_0x151c1c,_0x9f87b1){if(!_['isNil'](accountsTokens[_0x2ec59f['id']])&&!_['isNil'](accountsTokens[_0x2ec59f['id']][_0xd87a('0x19')])){if(moment()[_0xd87a('0x1a')](accountsTokens[_0x2ec59f['id']][_0xd87a('0x1b')])){_0x151c1c(accountsTokens[_0x2ec59f['id']]['access_token']);}}var _0x2a591c;switch(_0x2ec59f[_0xd87a('0x1c')]){case'US':_0x2a591c='https://accounts.zoho.com';break;case'AU':_0x2a591c=_0xd87a('0x1d');break;case'EU':_0x2a591c=_0xd87a('0x1e');break;case'IN':_0x2a591c=_0xd87a('0x1f');break;case'CN':_0x2a591c='https://accounts.zoho.com.cn';break;default:_0x2a591c='https://accounts.zoho.eu';break;}var _0x53c2fd={'method':_0xd87a('0x20'),'uri':_0x2a591c+_0xd87a('0x21'),'qs':{'refresh_token':_0x2ec59f[_0xd87a('0x22')],'client_id':_0x2ec59f[_0xd87a('0x23')],'client_secret':_0x2ec59f[_0xd87a('0x24')],'grant_type':_0xd87a('0x25')},'json':!![]};return rp(_0x53c2fd)['then'](function(_0x9241f9){accountsTokens[_0x2ec59f['id']]={'access_token':_0x9241f9[_0xd87a('0x19')],'expires_in':moment()[_0xd87a('0x26')](_0x9241f9['expires_in'],_0xd87a('0x27'))};_0x151c1c(_0x9241f9['access_token']);})[_0xd87a('0x28')](function(_0x12957e){logger[_0xd87a('0x29')](_0xd87a('0x2a'),_0x12957e[_0xd87a('0x2b')]);_0x9f87b1(_0x12957e);});});}function getUser(_0x1003c6,_0x3cf5fd,_0x353c50,_0x192d66){logger[_0xd87a('0x2c')]('Search\x20user');return request({'method':_0xd87a('0x2d'),'uri':util[_0xd87a('0x2e')](_0xd87a('0x2f'),_0x3cf5fd),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xd87a('0x30')+_0x1003c6},'json':!![]})[_0xd87a('0x31')](function(_0xa9e608){if(_0xa9e608[_0xd87a('0x32')]){var _0x2e6a17=-0x1;if(_[_0xd87a('0x33')](_0xa9e608[_0xd87a('0x32')])){if(!_[_0xd87a('0x34')](_0x192d66)){_0x2e6a17=_['findIndex'](_0xa9e608[_0xd87a('0x32')],function(_0x5d9781){return _0x5d9781['email']===_0x192d66;});}if(_0x2e6a17>=0x0){logger['info'](_0xd87a('0x35'));}else{logger[_0xd87a('0x2c')]('Using\x20the\x20admin\x20account!');_0x2e6a17=_['findIndex'](_0xa9e608[_0xd87a('0x32')],function(_0x500890){return _0x500890['profile']['name']==='Administrator';});}return _0xa9e608[_0xd87a('0x32')][_0x2e6a17];}else{if(_0xa9e608[_0xd87a('0x36')]['profile']['name']===_0xd87a('0x37')){logger[_0xd87a('0x2c')](_0xd87a('0x38'));user=_0xa9e608[_0xd87a('0x36')];return user;}else{logger[_0xd87a('0x29')](_0xd87a('0x39'),JSON[_0xd87a('0xc')](_0xa9e608));throw new Error(_0xd87a('0x3a')+JSON[_0xd87a('0xc')](_0xa9e608));}}}else{logger[_0xd87a('0x29')]('The\x20failing\x20result\x20is',JSON[_0xd87a('0xc')](_0xa9e608));throw new Error(_0xd87a('0x3a')+JSON[_0xd87a('0xc')](_0xa9e608));}})[_0xd87a('0x28')](function(_0x242857){console[_0xd87a('0x29')](_0x242857);});}function getZohoUser(_0x57cb2c,_0x84610){return new BPromise(function(_0x45d12e,_0x1bac9d){request(_0x57cb2c)[_0xd87a('0x31')](function(_0x3ec576){var _0x3a05e7=null;if(_0x3ec576){_0x3a05e7=_0x3ec576[_0xd87a('0x3b')][0x0];_0x3a05e7[_0xd87a('0x3c')]=_0x84610;}_0x45d12e(_0x3a05e7);})[_0xd87a('0x28')](function(_0x22c6d8){_0x1bac9d(_0x22c6d8);});});}function createEndUser(_0x596ac7,_0x425368,_0x3515ac,_0x537a47,_0x23bf2b,_0x53efb8){var _0x3515ac=getName(_0x3515ac);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x425368+'/crm/v2/'+_['startCase'](_0x53efb8['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x3515ac[0x1],'First_Name':_0x3515ac[0x0],'Phone':_0x537a47,'Owner':{'name':!_['isNil'](_0x23bf2b[_0xd87a('0x3d')][_0xd87a('0x16')])?_0x23bf2b[_0xd87a('0x3d')][_0xd87a('0x16')]:!_[_0xd87a('0x34')](_0x23bf2b['first_name'])?_0x23bf2b[_0xd87a('0x3e')]+'\x20'+_0x23bf2b[_0xd87a('0x3f')]:_0x23bf2b[_0xd87a('0x3f')],'id':_0x23bf2b['id']}}]},'headers':{'Authorization':_0xd87a('0x30')+_0x596ac7},'json':!![]})[_0xd87a('0x31')](function(_0x1cf02a){if(_0x1cf02a&&_0x1cf02a[_0xd87a('0x3b')][0x0][_0xd87a('0x40')]===_0xd87a('0x41')){var _0x9b9027=_0x1cf02a[_0xd87a('0x3b')][0x0][_0xd87a('0x42')];_0x9b9027['enduserType']=_[_0xd87a('0x43')](_0x53efb8['moduleCreate'])+'s';return _0x9b9027;}logger[_0xd87a('0x29')](_0xd87a('0x39'),JSON[_0xd87a('0xc')](data));throw new Error(_0xd87a('0x44')+JSON['stringify'](data));})[_0xd87a('0x28')](function(_0x302a29){console[_0xd87a('0x45')]('CREATE\x20ERROR',_0x302a29);});}function getEndUser(_0x11d228,_0x2f4c25,_0x1eb45e,_0x32f7fd,_0x441ed7,_0x236a95,_0x8d98){var _0x299f35={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x11d228},'json':!![]};switch(_0x8d98[_0xd87a('0x46')]){case _0xd87a('0x47'):_0x299f35[_0xd87a('0x48')]='https://www.zohoapis.'+_0x2f4c25+_0xd87a('0x49')+_0x441ed7+'))';return getZohoUser(_0x299f35,_0xd87a('0x4a'))[_0xd87a('0x31')](function(_0x2e4d30){if(_0x2e4d30)return _0x2e4d30;_0x299f35[_0xd87a('0x48')]=_0xd87a('0x4b')+_0x2f4c25+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x441ed7+'))';return getZohoUser(_0x299f35,_0xd87a('0x4c'))['then'](function(_0x19d2ba){if(_0x19d2ba)return _0x19d2ba;if(_0x8d98['moduleCreate']!='nothing'){return createEndUser(_0x11d228,_0x2f4c25,_0x32f7fd,_0x441ed7,_0x236a95,_0x8d98);}else{return{};}});});break;case _0xd87a('0x4d'):_0x299f35['uri']='https://www.zohoapis.'+_0x2f4c25+_0xd87a('0x49')+_0x441ed7+'))';return getZohoUser(_0x299f35,_0xd87a('0x4a'))[_0xd87a('0x31')](function(_0x240498){if(_0x240498)return _0x240498;if(_0x8d98[_0xd87a('0x4e')]!=_0xd87a('0x4f')){return createEndUser(_0x11d228,_0x2f4c25,_0x32f7fd,_0x441ed7,_0x236a95,_0x8d98);}else{return{};}});break;case _0xd87a('0x50'):_0x299f35[_0xd87a('0x48')]=_0xd87a('0x4b')+_0x2f4c25+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x441ed7+'))';return getZohoUser(_0x299f35,_0xd87a('0x4c'))[_0xd87a('0x31')](function(_0x5eb0b5){if(_0x5eb0b5)return _0x5eb0b5;if(_0x8d98['moduleCreate']!=_0xd87a('0x4f')){return createEndUser(_0x11d228,_0x2f4c25,_0x32f7fd,_0x441ed7,_0x236a95,_0x8d98);}else{return{};}});break;}}function getCall(_0x182ccd,_0x44f42,_0x50ac08,_0x380553,_0x519500,_0xbb3937,_0x143734,_0xb53e59){logger[_0xd87a('0x2c')](_0xd87a('0x51'));var _0x18015f={};_0x18015f['Owner']={'name':!_[_0xd87a('0x34')](_0x380553['role'][_0xd87a('0x16')])&&!_['isNil'](_0x380553[_0xd87a('0x52')][_0xd87a('0x16')])&&_0x380553[_0xd87a('0x52')][_0xd87a('0x16')]===_0xd87a('0x53')?_0x380553[_0xd87a('0x3d')][_0xd87a('0x16')]:!_['isNil'](_0x380553[_0xd87a('0x3e')])?_0x380553[_0xd87a('0x3e')]+'\x20'+_0x380553[_0xd87a('0x3f')]:_0x380553['last_name'],'id':_0x380553['id']};_0x18015f[_0xd87a('0x54')]=intUtil[_0xd87a('0x55')](_0xbb3937[_0xd87a('0x56')],_0x143734,'\x20');_0x18015f[_0xd87a('0x57')]=intUtil[_0xd87a('0x55')](_0xbb3937[_0xd87a('0x58')],_0x143734,'\x0a');if(_0x519500[_0xd87a('0x3c')]==='Contacts'){_0x18015f[_0xd87a('0x59')]={'name':!_[_0xd87a('0x34')](_0x519500[_0xd87a('0x5a')])?_0x519500['Full_Name']:!_['isNil'](_0x519500[_0xd87a('0x5b')])?_0x519500[_0xd87a('0x5b')]+'\x20'+_0x519500[_0xd87a('0x5c')]:_0x519500[_0xd87a('0x5c')],'id':_0x519500['id']};}if(_0x519500[_0xd87a('0x3c')]===_0xd87a('0x4c')){_0x18015f[_0xd87a('0x5d')]={'name':!_[_0xd87a('0x34')](_0x519500['Full_Name'])?_0x519500[_0xd87a('0x5a')]:!_[_0xd87a('0x34')](_0x519500[_0xd87a('0x5b')])?_0x519500[_0xd87a('0x5b')]+'\x20'+_0x519500[_0xd87a('0x5c')]:_0x519500['Last_Name'],'id':_0x519500['id']};_0x18015f[_0xd87a('0x5e')]=_[_0xd87a('0x43')](_0x519500[_0xd87a('0x3c')]);}if(_0x143734[_0xd87a('0x5f')]){_0x18015f['Call_Duration']=moment[_0xd87a('0x60')](parseInt(_0x143734[_0xd87a('0x5f')])*0x3e8)[_0xd87a('0x2e')](_0xd87a('0x61'));}else if(_0x143734[_0xd87a('0x62')]&&_0x143734[_0xd87a('0x63')]){_0x18015f[_0xd87a('0x64')]=moment[_0xd87a('0x60')](moment(_0x143734[_0xd87a('0x63')],_0xd87a('0x65'))[_0xd87a('0x66')](moment(_0x143734['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0xd87a('0x2e')](_0xd87a('0x61'));}switch(_0x143734[_0xd87a('0x67')]){case _0xd87a('0x68'):_0x18015f['Call_Result']=_0xd87a('0x69');break;case _0xd87a('0x6a'):case _0xd87a('0x6b'):_0x18015f[_0xd87a('0x6c')]=_0xd87a('0x6d');break;case _0xd87a('0x6e'):_0x18015f[_0xd87a('0x6c')]=_0xd87a('0x6f');break;case'abandoned':_0x18015f[_0xd87a('0x6c')]=_0xd87a('0x70');break;case _0xd87a('0x71'):_0x18015f[_0xd87a('0x6c')]=_0xd87a('0x72');default:}_0x18015f[_0xd87a('0x73')]=(_0xb53e59===_0xd87a('0x74')?moment(_0x143734[_0xd87a('0x75')])[_0xd87a('0x2e')](_0xd87a('0x65')):moment(_0x143734[_0xd87a('0x76')])[_0xd87a('0x2e')](_0xd87a('0x65')))||moment()[_0xd87a('0x2e')]('YYYY-MM-DDTHH:mm:ss');_0x18015f[_0xd87a('0x77')]=_0xb53e59||_0xd87a('0x78');_0x18015f=_['merge'](_0x18015f,getCustomFields(_0xbb3937['Fields'],_0x143734));return request({'method':_0xd87a('0x20'),'uri':_0xd87a('0x4b')+_0x44f42+_0xd87a('0x79'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x182ccd},'body':{'data':[_0x18015f]},'json':!![]})[_0xd87a('0x31')](function(_0x1263cd){if(_0x1263cd&&_0x1263cd[_0xd87a('0x3b')][0x0][_0xd87a('0x40')]===_0xd87a('0x41')){logger[_0xd87a('0x2c')](_0xd87a('0x7a'));return{'id':_0x1263cd[_0xd87a('0x3b')][0x0][_0xd87a('0x42')]['id']};}})[_0xd87a('0x28')](function(_0x423850){logger['info'](_0xd87a('0x7b'),_0x423850[_0xd87a('0x2b')]);console[_0xd87a('0x45')](_0xd87a('0x7b'),_0x423850);});}exports['queue']=function(_0x86953b,_0x1bd608,_0x1544ea,_0x346210,_0x236592,_0x484aad){var _0x3a2135,_0x3d1f69,_0x3b0058;_0x484aad[_0xd87a('0x7c')]=intUtil[_0xd87a('0x7d')](_0x484aad[_0xd87a('0x7c')]);_0x484aad[_0xd87a('0x7e')]=intUtil[_0xd87a('0x7d')](_0x484aad['serverUrl']);if(_0x236592&&_0x236592['monitor_format']){logger['info'](_0xd87a('0x7f'),_0xd87a('0x80'));_0x1bd608['recordingURL']=_0x484aad[_0xd87a('0x7e')]+_0xd87a('0x81')+_0x1bd608[_0xd87a('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x1bd608[_0xd87a('0x82')]);}else{_0x1bd608['recordingURL']='';}var _0x32401c=_0x484aad[_0xd87a('0x7c')]===_0xd87a('0x83')?'eu':_0xd87a('0x84');return getAccessToken(_0x484aad)['then'](function(_0x3a95b4){_0x3b0058=_0x3a95b4;return getUser(_0x3b0058,_0x32401c,_0x484aad,_0x346210[_0xd87a('0x85')]);})['then'](function(_0xfbfee7){_0x3a2135=_0xfbfee7;logger[_0xd87a('0x2c')](_0xd87a('0x86'),_0x3a2135['id']);return getEndUser(_0x3b0058,_0x32401c,_0x484aad,_0x1bd608[_0xd87a('0x87')],_0x1bd608[_0xd87a('0x88')],_0x3a2135,_0x1544ea);})[_0xd87a('0x31')](function(_0x44d4da){_0x3d1f69=_0x44d4da;return getCall(_0x3b0058,_0x32401c,_0x484aad,_0x3a2135,_0x3d1f69,_0x1544ea,_0x1bd608,_0xd87a('0x78'));})[_0xd87a('0x31')](function(_0x2806f5){if(_0x2806f5){logger[_0xd87a('0x2c')](_0xd87a('0x89'),_0x2806f5['id']);logger['info'](_0xd87a('0x7f'),_0xd87a('0x8a'));emit(util[_0xd87a('0x2e')]('user:%s',_0x346210[_0xd87a('0x16')]),_0xd87a('0x8b'),{'uri':_0xd87a('0x8c')+_0x484aad[_0xd87a('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x2806f5['id']});}})['catch'](function(_0x53b949){logger[_0xd87a('0x29')](_0xd87a('0x7f'),JSON['stringify'](_0x53b949));});};exports[_0xd87a('0x74')]=function(_0x1f8aec,_0x2da8cb,_0x1ed098,_0x2b3a3c,_0x42bb91,_0x2b3633,_0x3f80c7){var _0xe90cd3,_0x17a694,_0x5619d6;_0x2b3633[_0xd87a('0x7c')]=intUtil['stripTrailingSlash'](_0x2b3633[_0xd87a('0x7c')]);_0x2b3633[_0xd87a('0x7e')]=intUtil[_0xd87a('0x7d')](_0x2b3633[_0xd87a('0x7e')]);if(_0x3f80c7&&_0x3f80c7[_0xd87a('0x8d')]&&_0x3f80c7[_0xd87a('0x8d')]!==_0xd87a('0x8e')){logger[_0xd87a('0x2c')](_0xd87a('0x8f'),_0xd87a('0x80'));_0x2da8cb[_0xd87a('0x90')]=_0x2b3633[_0xd87a('0x7e')]+_0xd87a('0x81')+_0x2da8cb[_0xd87a('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x2da8cb[_0xd87a('0x82')]);}var _0x17c9e5=_0x2b3633[_0xd87a('0x7c')]===_0xd87a('0x83')?'eu':'com';return getAccessToken(_0x2b3633)[_0xd87a('0x31')](function(_0x5a4081){_0x5619d6=_0x5a4081;return getUser(_0x5619d6,_0x17c9e5,_0x2b3633,_0x2b3a3c['email']);})[_0xd87a('0x31')](function(_0x59564b){_0xe90cd3=_0x59564b;logger[_0xd87a('0x2c')](_0xd87a('0x86'),_0xe90cd3['id']);return getEndUser(_0x5619d6,_0x17c9e5,_0x2b3633,_0x2da8cb[_0xd87a('0x91')],_0x2da8cb[_0xd87a('0x92')],_0xe90cd3,_0x1ed098);})['then'](function(_0x20808a){_0x17a694=_0x20808a;return getCall(_0x5619d6,_0x17c9e5,_0x2b3633,_0xe90cd3,_0x17a694,_0x1ed098,_0x2da8cb,_0xd87a('0x93'));})[_0xd87a('0x31')](function(_0x5bfa00){if(_0x5bfa00){logger[_0xd87a('0x2c')](_0xd87a('0x89'),_0x5bfa00['id']);logger[_0xd87a('0x2c')]('[OUTBOUND]',_0xd87a('0x8a'));emit(util[_0xd87a('0x2e')]('user:%s',_0x2b3a3c[_0xd87a('0x16')]),_0xd87a('0x8b'),{'uri':_0xd87a('0x8c')+_0x2b3633[_0xd87a('0x7c')]+_0xd87a('0x94')+_0x5bfa00['id']});}})[_0xd87a('0x28')](function(_0x2114a0){logger[_0xd87a('0x29')](_0xd87a('0x8f'),JSON[_0xd87a('0xc')](_0x2114a0));});};exports['unmanaged']=function(_0x5db961,_0x22fc65,_0x3c571b,_0x52ce1a,_0x3fa192,_0x3bf7ad){var _0x5c307c,_0x238ddb,_0x59845a;_0x3bf7ad[_0xd87a('0x7c')]=intUtil[_0xd87a('0x7d')](_0x3bf7ad[_0xd87a('0x7c')]);_0x3bf7ad[_0xd87a('0x7e')]=intUtil[_0xd87a('0x7d')](_0x3bf7ad[_0xd87a('0x7e')]);if(_0x3fa192&&_0x3fa192[_0xd87a('0x95')]){logger['info']('['+_0x22fc65['lastevent'][_0xd87a('0x96')]()+']',_0xd87a('0x80'));_0x22fc65[_0xd87a('0x90')]=_0x3bf7ad['serverUrl']+_0xd87a('0x81')+_0x22fc65[_0xd87a('0x82')]+_0xd87a('0x97')+md5(_0x22fc65['uniqueid']);}else{_0x22fc65[_0xd87a('0x90')]='';}var _0x3c4ec2=_0x3bf7ad['host']==='zoho.eu'?'eu':_0xd87a('0x84');return getAccessToken(_0x3bf7ad)[_0xd87a('0x31')](function(_0x9c8ae1){_0x59845a=_0x9c8ae1;return getUser(_0x59845a,_0x3c4ec2,_0x3bf7ad);})[_0xd87a('0x31')](function(_0x39a1c7){_0x5c307c=_0x39a1c7;logger['info'](_0xd87a('0x86'),_0x5c307c['id']);return getEndUser(_0x59845a,_0x3c4ec2,_0x3bf7ad,_0x22fc65[_0xd87a('0x87')],_0x22fc65['calleridnum'],_0x5c307c,_0x3c571b);})['then'](function(_0x60f60a){_0x238ddb=_0x60f60a;return getCall(_0x59845a,_0x3c4ec2,_0x3bf7ad,_0x5c307c,_0x238ddb,_0x3c571b,_0x22fc65,_0xd87a('0x78'));})['then'](function(_0x38d0af){if(_0x38d0af){logger[_0xd87a('0x2c')](_0xd87a('0x89'),_0x38d0af['id']);}})[_0xd87a('0x28')](function(_0x142eb3){logger[_0xd87a('0x29')]('['+_0x22fc65[_0xd87a('0x67')][_0xd87a('0x96')]()+']',JSON[_0xd87a('0xc')](_0x142eb3));});}; \ No newline at end of file +var _0xe890=['catch','error','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','enduserType','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','nothing','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Descriptions','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','lastevent','called','Call_Result','complete','connect','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','err','queue','host','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','user:%s','unmanaged','toUpperCase','calleridnum','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','idField','content','toString','variableName','type','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','add','seconds'];(function(_0x56d5a7,_0x1706fc){var _0x175622=function(_0x5557d7){while(--_0x5557d7){_0x56d5a7['push'](_0x56d5a7['shift']());}};_0x175622(++_0x1706fc);}(_0xe890,0x1a6));var _0x0e89=function(_0x1874a1,_0x171c43){_0x1874a1=_0x1874a1-0x0;var _0x283ac3=_0xe890[_0x1874a1];return _0x283ac3;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x0e89('0x0'));var util=require(_0x0e89('0x1'));var intUtil=require(_0x0e89('0x2'));var moment=require(_0x0e89('0x3'));var Redis=require(_0x0e89('0x4'));var BPromise=require(_0x0e89('0x5'));var config=require(_0x0e89('0x6'));var logger=require(_0x0e89('0x7'))(_0x0e89('0x8'));config[_0x0e89('0x9')]=_['defaults'](config['redis'],{'host':_0x0e89('0xa'),'port':0x18eb});var io=require(_0x0e89('0xb'))(new Redis(config['redis']));function emit(_0x17cf6a,_0x23655f,_0x5dbc5f){io['to'](_0x17cf6a)[_0x0e89('0xc')](_0x23655f,_0x5dbc5f);}function request(_0x3f9333){logger[_0x0e89('0xd')](_0x0e89('0xe'),JSON[_0x0e89('0xf')](_0x3f9333));return rp(_0x3f9333);}function getCustomFields(_0x2bf018,_0x2d7e39){var _0x45ef1b={};if(_0x2bf018[_0x0e89('0x10')]>0x0){_['forEach'](_0x2bf018,function(_0x4d5f23){if(_0x4d5f23['type']==='string'&&_0x4d5f23[_0x0e89('0x11')]){_0x45ef1b[_0x4d5f23[_0x0e89('0x11')]]=_0x4d5f23[_0x0e89('0x12')][_0x0e89('0x13')]();}else if(_0x4d5f23['type']==='variable'&&_0x4d5f23['variableName']&&_0x4d5f23[_0x0e89('0x11')]&&_0x2d7e39[_0x4d5f23[_0x0e89('0x14')]]){_0x45ef1b[_0x4d5f23[_0x0e89('0x11')]]=_0x2d7e39[_0x4d5f23[_0x0e89('0x14')]][_0x0e89('0x13')]();}else if(_0x4d5f23[_0x0e89('0x15')]===_0x0e89('0x16')&&_0x4d5f23[_0x0e89('0x17')]&&_0x4d5f23[_0x0e89('0x17')][_0x0e89('0x18')]&&_0x4d5f23[_0x0e89('0x11')]&&_0x2d7e39[_0x4d5f23[_0x0e89('0x17')][_0x0e89('0x18')][_0x0e89('0x19')]()]){_0x45ef1b[_0x4d5f23[_0x0e89('0x11')]]=_0x2d7e39[_0x4d5f23[_0x0e89('0x17')][_0x0e89('0x18')][_0x0e89('0x19')]()][_0x0e89('0x13')]();}});}return _0x45ef1b;}function getName(_0x267652){if(_0x267652[_0x0e89('0x1a')]('\x20')>0x0){var _0x56c12a=_0x267652[_0x0e89('0x1b')](/ (.+)/);if(_0x56c12a[0x1]){return _0x56c12a;}}return[_0x267652,_0x267652];}var accountsTokens={};function getAccessToken(_0x24cf0b){return new Promise(function(_0x2d4c52,_0x2e83b6){if(!_[_0x0e89('0x1c')](accountsTokens[_0x24cf0b['id']])&&!_[_0x0e89('0x1c')](accountsTokens[_0x24cf0b['id']][_0x0e89('0x1d')])){if(moment()[_0x0e89('0x1e')](accountsTokens[_0x24cf0b['id']][_0x0e89('0x1f')])){_0x2d4c52(accountsTokens[_0x24cf0b['id']][_0x0e89('0x1d')]);}}var _0x2c641d;switch(_0x24cf0b[_0x0e89('0x20')]){case'US':_0x2c641d=_0x0e89('0x21');break;case'AU':_0x2c641d=_0x0e89('0x22');break;case'EU':_0x2c641d='https://accounts.zoho.eu';break;case'IN':_0x2c641d='https://accounts.zoho.in';break;case'CN':_0x2c641d='https://accounts.zoho.com.cn';break;default:_0x2c641d=_0x0e89('0x23');break;}var _0x8d02e2={'method':_0x0e89('0x24'),'uri':_0x2c641d+_0x0e89('0x25'),'qs':{'refresh_token':_0x24cf0b['refreshToken'],'client_id':_0x24cf0b[_0x0e89('0x26')],'client_secret':_0x24cf0b[_0x0e89('0x27')],'grant_type':_0x0e89('0x28')},'json':!![]};return rp(_0x8d02e2)['then'](function(_0x82194f){accountsTokens[_0x24cf0b['id']]={'access_token':_0x82194f['access_token'],'expires_in':moment()[_0x0e89('0x29')](_0x82194f[_0x0e89('0x1f')],_0x0e89('0x2a'))};_0x2d4c52(_0x82194f[_0x0e89('0x1d')]);})[_0x0e89('0x2b')](function(_0x358cce){logger[_0x0e89('0x2c')]('Failing\x20creating\x20the\x20access_token',_0x358cce[_0x0e89('0x2d')]);_0x2e83b6(_0x358cce);});});}function getUser(_0x14b857,_0xf1ebac,_0x18cfb5,_0x174ed9){logger[_0x0e89('0x2e')]('Search\x20user');return request({'method':_0x0e89('0x2f'),'uri':util[_0x0e89('0x30')](_0x0e89('0x31'),_0xf1ebac),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x0e89('0x32')+_0x14b857},'json':!![]})[_0x0e89('0x33')](function(_0x453ae3){if(_0x453ae3[_0x0e89('0x34')]){var _0x494c27=-0x1;if(_[_0x0e89('0x35')](_0x453ae3[_0x0e89('0x34')])){if(!_[_0x0e89('0x1c')](_0x174ed9)){_0x494c27=_[_0x0e89('0x36')](_0x453ae3['users'],function(_0x167f1b){return _0x167f1b[_0x0e89('0x37')]===_0x174ed9;});}if(_0x494c27>=0x0){logger[_0x0e89('0x2e')](_0x0e89('0x38'));}else{logger[_0x0e89('0x2e')](_0x0e89('0x39'));_0x494c27=_[_0x0e89('0x36')](_0x453ae3['users'],function(_0xe43afb){return _0xe43afb[_0x0e89('0x3a')][_0x0e89('0x18')]===_0x0e89('0x3b');});}return _0x453ae3[_0x0e89('0x34')][_0x494c27];}else{if(_0x453ae3['user'][_0x0e89('0x3a')][_0x0e89('0x18')]===_0x0e89('0x3b')){logger[_0x0e89('0x2e')](_0x0e89('0x39'));user=_0x453ae3['user'];return user;}else{logger[_0x0e89('0x2c')](_0x0e89('0x3c'),JSON[_0x0e89('0xf')](_0x453ae3));throw new Error(_0x0e89('0x3d')+JSON[_0x0e89('0xf')](_0x453ae3));}}}else{logger[_0x0e89('0x2c')](_0x0e89('0x3c'),JSON[_0x0e89('0xf')](_0x453ae3));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x453ae3));}})['catch'](function(_0x190277){console[_0x0e89('0x2c')](_0x190277);});}function getZohoUser(_0x96bcd5,_0x4a2de1){return new BPromise(function(_0x4292f7,_0x1a1ba6){request(_0x96bcd5)[_0x0e89('0x33')](function(_0x212091){var _0x2ea842=null;if(_0x212091){_0x2ea842=_0x212091['data'][0x0];_0x2ea842['enduserType']=_0x4a2de1;}_0x4292f7(_0x2ea842);})[_0x0e89('0x2b')](function(_0x280291){_0x1a1ba6(_0x280291);});});}function createEndUser(_0x169025,_0x463bd8,_0x31fced,_0x36ee5a,_0x19f538,_0x38692f){var _0x31fced=getName(_0x31fced);return request({'method':_0x0e89('0x24'),'uri':_0x0e89('0x3e')+_0x463bd8+_0x0e89('0x3f')+_[_0x0e89('0x40')](_0x38692f[_0x0e89('0x41')])+'s','body':{'data':[{'Last_Name':_0x31fced[0x1],'First_Name':_0x31fced[0x0],'Phone':_0x36ee5a,'Owner':{'name':!_[_0x0e89('0x1c')](_0x19f538[_0x0e89('0x42')][_0x0e89('0x18')])?_0x19f538[_0x0e89('0x42')][_0x0e89('0x18')]:!_[_0x0e89('0x1c')](_0x19f538[_0x0e89('0x43')])?_0x19f538[_0x0e89('0x43')]+'\x20'+_0x19f538[_0x0e89('0x44')]:_0x19f538[_0x0e89('0x44')],'id':_0x19f538['id']}}]},'headers':{'Authorization':_0x0e89('0x32')+_0x169025},'json':!![]})['then'](function(_0x205898){if(_0x205898&&_0x205898[_0x0e89('0x45')][0x0][_0x0e89('0x46')]===_0x0e89('0x47')){var _0xa8c8dd=_0x205898[_0x0e89('0x45')][0x0][_0x0e89('0x48')];_0xa8c8dd[_0x0e89('0x49')]=_[_0x0e89('0x40')](_0x38692f[_0x0e89('0x41')])+'s';return _0xa8c8dd;}logger[_0x0e89('0x2c')](_0x0e89('0x3c'),JSON[_0x0e89('0xf')](data));throw new Error(_0x0e89('0x4a')+JSON[_0x0e89('0xf')](data));})[_0x0e89('0x2b')](function(_0x250a49){console[_0x0e89('0x4b')](_0x0e89('0x4c'),_0x250a49);});}function getEndUser(_0x320ded,_0x381363,_0x864dfb,_0xf6d25b,_0xb6622,_0x53920d,_0x4e95e){var _0x14c0f1={'method':_0x0e89('0x2f'),'uri':'','headers':{'Authorization':_0x0e89('0x32')+_0x320ded},'json':!![]};switch(_0x4e95e[_0x0e89('0x4d')]){case _0x0e89('0x4e'):_0x14c0f1['uri']=_0x0e89('0x3e')+_0x381363+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xb6622+'))';return getZohoUser(_0x14c0f1,'Contacts')['then'](function(_0xd4bc54){if(_0xd4bc54)return _0xd4bc54;_0x14c0f1[_0x0e89('0x4f')]=_0x0e89('0x3e')+_0x381363+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xb6622+'))';return getZohoUser(_0x14c0f1,'Leads')[_0x0e89('0x33')](function(_0x49d03f){if(_0x49d03f)return _0x49d03f;if(_0x4e95e[_0x0e89('0x41')]!='nothing'){return createEndUser(_0x320ded,_0x381363,_0xf6d25b,_0xb6622,_0x53920d,_0x4e95e);}else{return{};}});});break;case _0x0e89('0x50'):_0x14c0f1['uri']='https://www.zohoapis.'+_0x381363+_0x0e89('0x51')+_0xb6622+'))';return getZohoUser(_0x14c0f1,_0x0e89('0x52'))['then'](function(_0xa68962){if(_0xa68962)return _0xa68962;if(_0x4e95e[_0x0e89('0x41')]!=_0x0e89('0x53')){return createEndUser(_0x320ded,_0x381363,_0xf6d25b,_0xb6622,_0x53920d,_0x4e95e);}else{return{};}});break;case _0x0e89('0x54'):_0x14c0f1[_0x0e89('0x4f')]=_0x0e89('0x3e')+_0x381363+_0x0e89('0x55')+_0xb6622+'))';return getZohoUser(_0x14c0f1,_0x0e89('0x56'))[_0x0e89('0x33')](function(_0x35f275){if(_0x35f275)return _0x35f275;if(_0x4e95e[_0x0e89('0x41')]!=_0x0e89('0x53')){return createEndUser(_0x320ded,_0x381363,_0xf6d25b,_0xb6622,_0x53920d,_0x4e95e);}else{return{};}});break;}}function getCall(_0x5ba04e,_0x3b3b72,_0x43fa9c,_0x6828db,_0x2c4752,_0x507ce3,_0x4feba5,_0x54457a){logger[_0x0e89('0x2e')](_0x0e89('0x57'));var _0x25a9d9={};_0x25a9d9[_0x0e89('0x58')]={'name':!_['isNil'](_0x6828db[_0x0e89('0x42')]['name'])&&!_[_0x0e89('0x1c')](_0x6828db[_0x0e89('0x3a')][_0x0e89('0x18')])&&_0x6828db[_0x0e89('0x3a')]['name']===_0x0e89('0x59')?_0x6828db[_0x0e89('0x42')]['name']:!_[_0x0e89('0x1c')](_0x6828db[_0x0e89('0x43')])?_0x6828db['first_name']+'\x20'+_0x6828db['last_name']:_0x6828db['last_name'],'id':_0x6828db['id']};_0x25a9d9[_0x0e89('0x5a')]=intUtil[_0x0e89('0x5b')](_0x507ce3['Subjects'],_0x4feba5,'\x20');_0x25a9d9['Description']=intUtil[_0x0e89('0x5b')](_0x507ce3[_0x0e89('0x5c')],_0x4feba5,'\x0a');if(_0x2c4752[_0x0e89('0x49')]===_0x0e89('0x52')){_0x25a9d9['Who_Id']={'name':!_[_0x0e89('0x1c')](_0x2c4752[_0x0e89('0x5d')])?_0x2c4752[_0x0e89('0x5d')]:!_[_0x0e89('0x1c')](_0x2c4752['First_Name'])?_0x2c4752[_0x0e89('0x5e')]+'\x20'+_0x2c4752[_0x0e89('0x5f')]:_0x2c4752[_0x0e89('0x5f')],'id':_0x2c4752['id']};}if(_0x2c4752['enduserType']===_0x0e89('0x56')){_0x25a9d9[_0x0e89('0x60')]={'name':!_[_0x0e89('0x1c')](_0x2c4752[_0x0e89('0x5d')])?_0x2c4752['Full_Name']:!_[_0x0e89('0x1c')](_0x2c4752[_0x0e89('0x5e')])?_0x2c4752[_0x0e89('0x5e')]+'\x20'+_0x2c4752[_0x0e89('0x5f')]:_0x2c4752[_0x0e89('0x5f')],'id':_0x2c4752['id']};_0x25a9d9[_0x0e89('0x61')]=_[_0x0e89('0x40')](_0x2c4752['enduserType']);}if(_0x4feba5[_0x0e89('0x62')]){_0x25a9d9[_0x0e89('0x63')]=moment[_0x0e89('0x64')](parseInt(_0x4feba5[_0x0e89('0x62')])*0x3e8)[_0x0e89('0x30')](_0x0e89('0x65'));}else if(_0x4feba5[_0x0e89('0x66')]&&_0x4feba5[_0x0e89('0x67')]){_0x25a9d9[_0x0e89('0x63')]=moment[_0x0e89('0x64')](moment(_0x4feba5[_0x0e89('0x67')],_0x0e89('0x68'))[_0x0e89('0x69')](moment(_0x4feba5['starttime'],'YYYY-MM-DDTHH:mm:ss')))['format'](_0x0e89('0x65'));}switch(_0x4feba5[_0x0e89('0x6a')]){case _0x0e89('0x6b'):_0x25a9d9[_0x0e89('0x6c')]='Called';break;case _0x0e89('0x6d'):case _0x0e89('0x6e'):_0x25a9d9[_0x0e89('0x6c')]='Answered';break;case _0x0e89('0x6f'):_0x25a9d9[_0x0e89('0x6c')]=_0x0e89('0x70');break;case _0x0e89('0x71'):_0x25a9d9['Call_Result']=_0x0e89('0x72');break;case _0x0e89('0x73'):_0x25a9d9[_0x0e89('0x6c')]=_0x0e89('0x74');default:}_0x25a9d9[_0x0e89('0x75')]=(_0x54457a===_0x0e89('0x76')?moment(_0x4feba5[_0x0e89('0x77')])[_0x0e89('0x30')](_0x0e89('0x68')):moment(_0x4feba5[_0x0e89('0x78')])['format'](_0x0e89('0x68')))||moment()[_0x0e89('0x30')](_0x0e89('0x68'));_0x25a9d9[_0x0e89('0x79')]=_0x54457a||_0x0e89('0x7a');_0x25a9d9=_['merge'](_0x25a9d9,getCustomFields(_0x507ce3[_0x0e89('0x7b')],_0x4feba5));return request({'method':_0x0e89('0x24'),'uri':'https://www.zohoapis.'+_0x3b3b72+_0x0e89('0x7c'),'headers':{'Authorization':_0x0e89('0x32')+_0x5ba04e},'body':{'data':[_0x25a9d9]},'json':!![]})['then'](function(_0x4c1ca7){if(_0x4c1ca7&&_0x4c1ca7['data'][0x0]['code']===_0x0e89('0x47')){logger[_0x0e89('0x2e')]('Call\x20created!');return{'id':_0x4c1ca7[_0x0e89('0x45')][0x0][_0x0e89('0x48')]['id']};}})[_0x0e89('0x2b')](function(_0x58adfa){logger[_0x0e89('0x2e')](_0x0e89('0x7d'),_0x58adfa['stack']);console[_0x0e89('0x4b')](_0x0e89('0x7d'),_0x58adfa);});}exports[_0x0e89('0x7e')]=function(_0x36a68f,_0x1f111b,_0x22a78f,_0x3d18fa,_0x4dc7d3,_0x5237ce){var _0x557b8c,_0x5a30eb,_0x534eb2;_0x5237ce[_0x0e89('0x7f')]=intUtil[_0x0e89('0x80')](_0x5237ce[_0x0e89('0x7f')]);_0x5237ce['serverUrl']=intUtil[_0x0e89('0x80')](_0x5237ce['serverUrl']);if(_0x4dc7d3&&_0x4dc7d3[_0x0e89('0x81')]){logger[_0x0e89('0x2e')](_0x0e89('0x82'),_0x0e89('0x83'));_0x1f111b[_0x0e89('0x84')]=_0x5237ce[_0x0e89('0x85')]+_0x0e89('0x86')+_0x1f111b[_0x0e89('0x87')]+_0x0e89('0x88')+md5(_0x1f111b[_0x0e89('0x87')]);}else{_0x1f111b[_0x0e89('0x84')]='';}var _0x3b9bd9=_0x5237ce['host']===_0x0e89('0x89')?'eu':_0x0e89('0x8a');return getAccessToken(_0x5237ce)[_0x0e89('0x33')](function(_0x197d6a){_0x534eb2=_0x197d6a;return getUser(_0x534eb2,_0x3b9bd9,_0x5237ce,_0x3d18fa[_0x0e89('0x37')]);})[_0x0e89('0x33')](function(_0x1b4ad6){_0x557b8c=_0x1b4ad6;logger[_0x0e89('0x2e')](_0x0e89('0x8b'),_0x557b8c['id']);return getEndUser(_0x534eb2,_0x3b9bd9,_0x5237ce,_0x1f111b[_0x0e89('0x8c')],_0x1f111b['calleridnum'],_0x557b8c,_0x22a78f);})['then'](function(_0x4189e6){_0x5a30eb=_0x4189e6;return getCall(_0x534eb2,_0x3b9bd9,_0x5237ce,_0x557b8c,_0x5a30eb,_0x22a78f,_0x1f111b,'Inbound');})[_0x0e89('0x33')](function(_0x3b7375){if(_0x3b7375){logger[_0x0e89('0x2e')](_0x0e89('0x8d'),_0x3b7375['id']);logger['info'](_0x0e89('0x82'),_0x0e89('0x8e'));emit(util[_0x0e89('0x30')]('user:%s',_0x3d18fa[_0x0e89('0x18')]),_0x0e89('0x8f'),{'uri':_0x0e89('0x90')+_0x5237ce[_0x0e89('0x7f')]+_0x0e89('0x91')+_0x3b7375['id']});}})[_0x0e89('0x2b')](function(_0x3cfaf4){logger[_0x0e89('0x2c')](_0x0e89('0x82'),JSON['stringify'](_0x3cfaf4));});};exports[_0x0e89('0x76')]=function(_0x21decd,_0x1cd0f,_0xdd9f93,_0x410202,_0x527ca9,_0x30a81c,_0x4b4642){var _0x4da8a2,_0x5ee605,_0x3aca86;_0x30a81c['host']=intUtil['stripTrailingSlash'](_0x30a81c[_0x0e89('0x7f')]);_0x30a81c[_0x0e89('0x85')]=intUtil[_0x0e89('0x80')](_0x30a81c[_0x0e89('0x85')]);if(_0x4b4642&&_0x4b4642[_0x0e89('0x92')]&&_0x4b4642['recordingFormat']!==_0x0e89('0x93')){logger[_0x0e89('0x2e')](_0x0e89('0x94'),_0x0e89('0x83'));_0x1cd0f[_0x0e89('0x84')]=_0x30a81c[_0x0e89('0x85')]+_0x0e89('0x86')+_0x1cd0f[_0x0e89('0x87')]+_0x0e89('0x88')+md5(_0x1cd0f['uniqueid']);}var _0x446a77=_0x30a81c[_0x0e89('0x7f')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x30a81c)['then'](function(_0x435b3b){_0x3aca86=_0x435b3b;return getUser(_0x3aca86,_0x446a77,_0x30a81c,_0x410202[_0x0e89('0x37')]);})[_0x0e89('0x33')](function(_0x3e89d9){_0x4da8a2=_0x3e89d9;logger[_0x0e89('0x2e')](_0x0e89('0x8b'),_0x4da8a2['id']);return getEndUser(_0x3aca86,_0x446a77,_0x30a81c,_0x1cd0f[_0x0e89('0x95')],_0x1cd0f[_0x0e89('0x96')],_0x4da8a2,_0xdd9f93);})[_0x0e89('0x33')](function(_0x30aa22){_0x5ee605=_0x30aa22;return getCall(_0x3aca86,_0x446a77,_0x30a81c,_0x4da8a2,_0x5ee605,_0xdd9f93,_0x1cd0f,'Outbound');})[_0x0e89('0x33')](function(_0xa4cbe8){if(_0xa4cbe8){logger[_0x0e89('0x2e')](_0x0e89('0x8d'),_0xa4cbe8['id']);logger[_0x0e89('0x2e')](_0x0e89('0x94'),_0x0e89('0x8e'));emit(util[_0x0e89('0x30')](_0x0e89('0x97'),_0x410202['name']),_0x0e89('0x8f'),{'uri':'https://crm.'+_0x30a81c[_0x0e89('0x7f')]+_0x0e89('0x91')+_0xa4cbe8['id']});}})[_0x0e89('0x2b')](function(_0xcb094f){logger[_0x0e89('0x2c')]('[OUTBOUND]',JSON['stringify'](_0xcb094f));});};exports[_0x0e89('0x98')]=function(_0x3be845,_0x44c83e,_0x24cc02,_0x4c131b,_0xbfd12,_0xe8cea7){var _0x577a15,_0x5d7905,_0x31874c;_0xe8cea7['host']=intUtil[_0x0e89('0x80')](_0xe8cea7['host']);_0xe8cea7['serverUrl']=intUtil[_0x0e89('0x80')](_0xe8cea7[_0x0e89('0x85')]);if(_0xbfd12&&_0xbfd12[_0x0e89('0x81')]){logger['info']('['+_0x44c83e[_0x0e89('0x6a')][_0x0e89('0x99')]()+']',_0x0e89('0x83'));_0x44c83e['recordingURL']=_0xe8cea7[_0x0e89('0x85')]+'/api/voice/recordings/'+_0x44c83e[_0x0e89('0x87')]+_0x0e89('0x88')+md5(_0x44c83e[_0x0e89('0x87')]);}else{_0x44c83e[_0x0e89('0x84')]='';}var _0x19269e=_0xe8cea7['host']==='zoho.eu'?'eu':_0x0e89('0x8a');return getAccessToken(_0xe8cea7)[_0x0e89('0x33')](function(_0x4f3bdc){_0x31874c=_0x4f3bdc;return getUser(_0x31874c,_0x19269e,_0xe8cea7);})['then'](function(_0x1a12fa){_0x577a15=_0x1a12fa;logger['info'](_0x0e89('0x8b'),_0x577a15['id']);return getEndUser(_0x31874c,_0x19269e,_0xe8cea7,_0x44c83e[_0x0e89('0x8c')],_0x44c83e[_0x0e89('0x9a')],_0x577a15,_0x24cc02);})[_0x0e89('0x33')](function(_0x36aefb){_0x5d7905=_0x36aefb;return getCall(_0x31874c,_0x19269e,_0xe8cea7,_0x577a15,_0x5d7905,_0x24cc02,_0x44c83e,'Inbound');})[_0x0e89('0x33')](function(_0x10a64d){if(_0x10a64d){logger[_0x0e89('0x2e')]('The\x20Call\x20ID\x20is:',_0x10a64d['id']);}})['catch'](function(_0xe74ef3){logger['error']('['+_0x44c83e[_0x0e89('0x6a')]['toUpperCase']()+']',JSON[_0x0e89('0xf')](_0xe74ef3));});}; \ 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 06ba4fa..acffe25 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 _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x378c5a,_0xfd1fd2){var _0x1d7eea=function(_0x12df7d){while(--_0x12df7d){_0x378c5a['push'](_0x378c5a['shift']());}};_0x1d7eea(++_0xfd1fd2);}(_0x7a54,0x106));var _0x47a5=function(_0x3fe660,_0x3d4cb4){_0x3fe660=_0x3fe660-0x0;var _0x49c8c6=_0x7a54[_0x3fe660];return _0x49c8c6;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x3c4da8,_0x1879e7){var _0x59a353=function(_0x5a75b8){while(--_0x5a75b8){_0x3c4da8['push'](_0x3c4da8['shift']());}};_0x59a353(++_0x1879e7);}(_0x7a54,0x106));var _0x47a5=function(_0x5a770e,_0xebefc7){_0x5a770e=_0x5a770e-0x0;var _0x6b3c2d=_0x7a54[_0x5a770e];return _0x6b3c2d;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ 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 0f9e23e..fbcae8b 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 _0x7a54=['data6','parse','stack','data1','GET','DELETE','POST','PUT','render','data7','body','error','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then',',\x20request\x20body:\x20','object','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','request-promise','util','lodash','../../../../config/logger','trigger','toUpperCase','data2','data5'];(function(_0x4d3257,_0x510c6c){var _0x237a06=function(_0x20fe30){while(--_0x20fe30){_0x4d3257['push'](_0x4d3257['shift']());}};_0x237a06(++_0x510c6c);}(_0x7a54,0x106));var _0x47a5=function(_0x340367,_0x5ca169){_0x340367=_0x340367-0x0;var _0x1aca73=_0x7a54[_0x340367];return _0x1aca73;};'use strict';var rp=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var _=require(_0x47a5('0x2'));var Mustache=require('mustache');var logger=require(_0x47a5('0x3'))(_0x47a5('0x4'));exports['exec']=function(_0x5f7f12,_0x11bf85){var _0x2a1a7e,_0x3717e1;var _0xfdf934={'method':_0x5f7f12['data1'][_0x47a5('0x5')](),'uri':Mustache['render'](_0x5f7f12[_0x47a5('0x6')],_0x11bf85),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5f7f12[_0x47a5('0x7')])==='number'&&parseInt(_0x5f7f12[_0x47a5('0x7')])>=0x1&&parseInt(_0x5f7f12['data5'])<=0xa?parseInt(_0x5f7f12['data5'])*0x3e8:0x5*0x3e8};try{_0xfdf934['headers']=_0x5f7f12[_0x47a5('0x8')]?JSON[_0x47a5('0x9')](Mustache['render'](_0x5f7f12[_0x47a5('0x8')],_0x11bf85)):{};}catch(_0x49e844){logger['error'](_0x49e844[_0x47a5('0xa')]);}switch(_0x5f7f12[_0x47a5('0xb')][_0x47a5('0x5')]()){case _0x47a5('0xc'):case _0x47a5('0xd'):_0x2a1a7e=null;_0xfdf934['qs']=_0x11bf85;break;case _0x47a5('0xe'):case _0x47a5('0xf'):if(_0x5f7f12['data7']){try{_0x2a1a7e=JSON[_0x47a5('0x9')](Mustache[_0x47a5('0x10')](_0x5f7f12[_0x47a5('0x11')],_0x11bf85));_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}catch(_0x139f25){logger[_0x47a5('0x13')](_0x139f25[_0x47a5('0xa')]);logger[_0x47a5('0x13')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2a1a7e=_0x11bf85;_0xfdf934[_0x47a5('0x12')]=_0x2a1a7e;}break;}logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x16'),_0x5f7f12[_0x47a5('0xb')],_0x5f7f12['data2'],JSON['stringify'](_0xfdf934)));rp(_0xfdf934)[_0x47a5('0x17')](function(_0x4b966e){_0x2a1a7e=!_['isNil'](_0x2a1a7e)?_0x47a5('0x18')+_0x2a1a7e:'';_0x3717e1=typeof _0x4b966e[_0x47a5('0x12')]===_0x47a5('0x19')?JSON[_0x47a5('0x1a')](_0x4b966e[_0x47a5('0x12')]):_0x4b966e[_0x47a5('0x12')];logger[_0x47a5('0x14')](util[_0x47a5('0x15')](_0x47a5('0x1b'),_0x5f7f12['data1'],_0x5f7f12[_0x47a5('0x6')],_0x4b966e[_0x47a5('0x1c')],_0x3717e1));})['catch'](function(_0x2b0360){logger[_0x47a5('0x13')](util[_0x47a5('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x5f7f12[_0x47a5('0xb')],_0x5f7f12[_0x47a5('0x6')],_0x2b0360[_0x47a5('0x1c')],_0x2b0360[_0x47a5('0x1d')],_0x2b0360['message']));});}; \ No newline at end of file +var _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x3bc964,_0x2f5d6b){var _0x5537af=function(_0x55c204){while(--_0x55c204){_0x3bc964['push'](_0x3bc964['shift']());}};_0x5537af(++_0x2f5d6b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x316a88,_0x451333){_0x316a88=_0x316a88-0x0;var _0x2d35b1=_0x5f2f[_0x316a88];return _0x2d35b1;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 6a4890f..a9262f3 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 _0x6921=['Request','request','then','debug','rpc','error','message','result','catch','exports','bluebird','routing','http'];(function(_0x28eb0b,_0x37d8ee){var _0x15235f=function(_0xa718b6){while(--_0xa718b6){_0x28eb0b['push'](_0x28eb0b['shift']());}};_0x15235f(++_0x37d8ee);}(_0x6921,0x1d1));var _0x1692=function(_0x2d8b1e,_0x3b36ff){_0x2d8b1e=_0x2d8b1e-0x0;var _0x3dce81=_0x6921[_0x2d8b1e];return _0x3dce81;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x1692('0x0'));var logger=require('../../config/logger')(_0x1692('0x1'));var client=jayson['client'][_0x1692('0x2')]({'port':0x2329});client[_0x1692('0x3')]=function(_0x4ac00c,_0x3995b3){return new BPromise(function(_0x577497,_0x4581c4){return client[_0x1692('0x4')](_0x4ac00c,_0x3995b3)[_0x1692('0x5')](function(_0x14fbfe){logger[_0x1692('0x6')](_0x1692('0x7'),_0x1692('0x1'),_0x4ac00c,_0x3995b3,_0x14fbfe);if(_0x14fbfe[_0x1692('0x8')]){logger[_0x1692('0x8')](_0x1692('0x7'),_0x1692('0x1'),_0x4ac00c,_0x14fbfe['error'][_0x1692('0x9')],_0x3995b3);return _0x4581c4(_0x14fbfe['error'][_0x1692('0x9')]);}else{return _0x577497(_0x14fbfe[_0x1692('0xa')]);}})[_0x1692('0xb')](function(_0x28964a){logger[_0x1692('0x8')](_0x1692('0x7'),'routing',_0x4ac00c,_0x28964a,_0x3995b3);return _0x4581c4(_0x28964a);});});};module[_0x1692('0xc')]=client; \ No newline at end of file +var _0xd246=['request','debug','rpc','error','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request'];(function(_0x35c805,_0x382db3){var _0x5100b9=function(_0x3cdd28){while(--_0x3cdd28){_0x35c805['push'](_0x35c805['shift']());}};_0x5100b9(++_0x382db3);}(_0xd246,0xf5));var _0x6d24=function(_0x51057a,_0x2c8c27){_0x51057a=_0x51057a-0x0;var _0x3cbdaa=_0xd246[_0x51057a];return _0x3cbdaa;};'use strict';var jayson=require(_0x6d24('0x0'));var BPromise=require(_0x6d24('0x1'));var logger=require(_0x6d24('0x2'))(_0x6d24('0x3'));var client=jayson[_0x6d24('0x4')][_0x6d24('0x5')]({'port':0x2329});client[_0x6d24('0x6')]=function(_0x51c18f,_0x4e76e1){return new BPromise(function(_0xfa68f3,_0x58e7fc){return client[_0x6d24('0x7')](_0x51c18f,_0x4e76e1)['then'](function(_0xa72e6e){logger[_0x6d24('0x8')](_0x6d24('0x9'),_0x6d24('0x3'),_0x51c18f,_0x4e76e1,_0xa72e6e);if(_0xa72e6e[_0x6d24('0xa')]){logger[_0x6d24('0xa')](_0x6d24('0x9'),'routing',_0x51c18f,_0xa72e6e['error'][_0x6d24('0xb')],_0x4e76e1);return _0x58e7fc(_0xa72e6e['error'][_0x6d24('0xb')]);}else{return _0xfa68f3(_0xa72e6e['result']);}})[_0x6d24('0xc')](function(_0x5b5ea6){logger[_0x6d24('0xa')](_0x6d24('0x9'),'routing',_0x51c18f,_0x5b5ea6,_0x4e76e1);return _0x58e7fc(_0x5b5ea6);});});};module[_0x6d24('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 0ebd4ae..45e77b1 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 _0xfd0f=['Setting','findOne','loginMailFrequency','catch','log','bluebird','./server','./lib/email','./rpc/mailAccount','../../mysqldb','then','initMailAccounts','refresh','mailAccounts','listen'];(function(_0x5d0462,_0x1775a5){var _0x5b954f=function(_0x5abaaf){while(--_0x5abaaf){_0x5d0462['push'](_0x5d0462['shift']());}};_0x5b954f(++_0x1775a5);}(_0xfd0f,0x1b8));var _0xffd0=function(_0x5ea459,_0x46c394){_0x5ea459=_0x5ea459-0x0;var _0x25d2d3=_0xfd0f[_0x5ea459];return _0x25d2d3;};'use strict';var BPromise=require(_0xffd0('0x0'));var server=require(_0xffd0('0x1'));var Realtime=require('./realtime');var EmailChannel=require(_0xffd0('0x2'));var mailAccount=require(_0xffd0('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xffd0('0x4'))['db'];function initRealtime(){return BPromise['resolve']()[_0xffd0('0x5')](mailAccount['getMailAccounts']())[_0xffd0('0x5')](realtime[_0xffd0('0x6')]())[_0xffd0('0x5')](function(){email[_0xffd0('0x7')](realtime[_0xffd0('0x8')]);return realtime;});}function main(){return server[_0xffd0('0x9')](realtime,email)[_0xffd0('0x5')](function(_0x3fcf31){return initRealtime();})[_0xffd0('0x5')](function(_0x4e2d54){return db[_0xffd0('0xa')][_0xffd0('0xb')]({'attributes':['id',_0xffd0('0xc')],'raw':!![]});})[_0xffd0('0x5')](function(_0x56f03a){return setInterval(initRealtime,_0x56f03a['loginMailFrequency']*0x3e8);})[_0xffd0('0xd')](function(_0x3f0441){console[_0xffd0('0xe')](_0x3f0441);});}main(); \ No newline at end of file +var _0xa261=['./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','initMailAccounts','then','refresh','mailAccounts','listen','Setting','findOne','loginMailFrequency','catch','bluebird'];(function(_0x23f6ac,_0x32e2f7){var _0x4d3bd2=function(_0x3a67b0){while(--_0x3a67b0){_0x23f6ac['push'](_0x23f6ac['shift']());}};_0x4d3bd2(++_0x32e2f7);}(_0xa261,0x1a3));var _0x1a26=function(_0x563e3f,_0x5d2a74){_0x563e3f=_0x563e3f-0x0;var _0x548c64=_0xa261[_0x563e3f];return _0x548c64;};'use strict';var BPromise=require(_0x1a26('0x0'));var server=require('./server');var Realtime=require(_0x1a26('0x1'));var EmailChannel=require(_0x1a26('0x2'));var mailAccount=require(_0x1a26('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x1a26('0x4'))['db'];function initRealtime(){return BPromise[_0x1a26('0x5')]()['then'](mailAccount['getMailAccounts']())['then'](realtime[_0x1a26('0x6')]())[_0x1a26('0x7')](function(){email[_0x1a26('0x8')](realtime[_0x1a26('0x9')]);return realtime;});}function main(){return server[_0x1a26('0xa')](realtime,email)['then'](function(_0x2dfa27){return initRealtime();})['then'](function(_0x197c24){return db[_0x1a26('0xb')][_0x1a26('0xc')]({'attributes':['id','loginMailFrequency'],'raw':!![]});})[_0x1a26('0x7')](function(_0x9bd619){return setInterval(initRealtime,_0x9bd619[_0x1a26('0xd')]*0x3e8);})[_0x1a26('0xe')](function(_0x306670){console['log'](_0x306670);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 669654e..a5a81b0 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 _0xa9c3=['messageStatus','total','stringify','emit','mailAccount:update','prototype','refresh','hasOwnProperty','email','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','isNil','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','Smtp','lastSync','then','verified','verify','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','redis','socket.io-emitter','./imap','./smtp','info','mailAccounts','imapAccounts','smtp','name','key','active','Imap','status'];(function(_0x55aa0e,_0x20f3f5){var _0x146eb6=function(_0x630381){while(--_0x630381){_0x55aa0e['push'](_0x55aa0e['shift']());}};_0x146eb6(++_0x20f3f5);}(_0xa9c3,0x16e));var _0x3a9c=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xa9c3[_0xc8a931];return _0x28bd27;};'use strict';var _=require(_0x3a9c('0x0'));var moment=require('moment');var BPromise=require(_0x3a9c('0x1'));var md5=require(_0x3a9c('0x2'));var Redis=require(_0x3a9c('0x3'));var config=require(_0x3a9c('0x4'));var logger=require(_0x3a9c('0x5'))('email');config[_0x3a9c('0x6')]=_['defaults'](config[_0x3a9c('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x3a9c('0x7'))(new Redis(config['redis']));var EmailImap=require(_0x3a9c('0x8'));var EmailSmtp=require(_0x3a9c('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x3f8b60){logger[_0x3a9c('0xa')]('start\x20email\x20channel');this[_0x3a9c('0xb')]=_0x3f8b60[_0x3a9c('0xb')];this[_0x3a9c('0xc')]={};this[_0x3a9c('0xd')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x24af64){var _0x48ff75=this[_0x3a9c('0xb')][_0x24af64];var _0x27d824={'id':_0x48ff75['id'],'name':_0x48ff75[_0x3a9c('0xe')],'key':_0x48ff75[_0x3a9c('0xf')],'active':_0x48ff75[_0x3a9c('0x10')],'Imap':{'status':_0x48ff75[_0x3a9c('0x11')][_0x3a9c('0x12')],'messageStatus':_0x48ff75[_0x3a9c('0x11')][_0x3a9c('0x13')],'total':_0x48ff75[_0x3a9c('0x11')][_0x3a9c('0x14')]}};if(_['isNil'](md5Accounts[_0x24af64])){md5Accounts[_0x24af64]={};}var _0x2e2d1f=md5(JSON[_0x3a9c('0x15')](_0x27d824));if(md5Accounts[_0x24af64][_0x3a9c('0x2')]!==_0x2e2d1f){md5Accounts[_0x24af64]['md5']=_0x2e2d1f;io[_0x3a9c('0x16')](_0x3a9c('0x17'),_0x27d824);}};EmailChannel[_0x3a9c('0x18')][_0x3a9c('0x19')]=function(_0xe2f0e1){for(var _0x451eea in _0xe2f0e1){if(_0xe2f0e1[_0x3a9c('0x1a')](_0x451eea)){if(_0xe2f0e1[_0x451eea]['Imap']&&_0xe2f0e1[_0x451eea][_0x3a9c('0x10')]){var _0x138c6f=_0xe2f0e1[_0x451eea]['Imap'];if(!this['imapAccounts'][_0x3a9c('0x1a')](_0x138c6f['id'])){this[_0x3a9c('0xc')][_0x138c6f['id']]=new EmailImap(_0x138c6f,_0xe2f0e1[_0x451eea][_0x3a9c('0x1b')]);this['imapAccounts'][_0x138c6f['id']]['on'](_0x3a9c('0x1c'),this[_0x3a9c('0x1d')][_0x3a9c('0x1e')](this,_0x451eea));this[_0x3a9c('0xc')][_0x138c6f['id']]['on']('email',this[_0x3a9c('0x1f')][_0x3a9c('0x1e')](this,_0x451eea));this['imapAccounts'][_0x138c6f['id']]['on'](_0x3a9c('0x20'),this[_0x3a9c('0x21')][_0x3a9c('0x1e')](this,_0x451eea));this['imapAccounts'][_0x138c6f['id']]['on']('error',this[_0x3a9c('0x22')][_0x3a9c('0x1e')](this,_0x451eea));}}else{if(_[_0x3a9c('0x23')](this[_0x3a9c('0xb')][_0x451eea][_0x3a9c('0x11')])){this[_0x3a9c('0xb')][_0x451eea]['Imap']={};}this[_0x3a9c('0xb')][_0x451eea]['Imap'][_0x3a9c('0x12')]=_0x3a9c('0x24');this[_0x3a9c('0xb')][_0x451eea][_0x3a9c('0x11')][_0x3a9c('0x13')]='';this[_0x3a9c('0x16')](_0x451eea);}}}};EmailChannel[_0x3a9c('0x18')]['handleImapBox']=function(_0x3f6969,_0x48e42a){if(this['mailAccounts'][_0x3f6969]){this[_0x3a9c('0xb')][_0x3f6969][_0x3a9c('0x11')][_0x3a9c('0x12')]=_0x3a9c('0x25');this['mailAccounts'][_0x3f6969][_0x3a9c('0x11')][_0x3a9c('0x13')]=_0x48e42a[_0x3a9c('0xe')];if(_0x48e42a[_0x3a9c('0x26')]){this['mailAccounts'][_0x3f6969]['Imap']['total']=_0x48e42a['messages'][_0x3a9c('0x14')];}return this[_0x3a9c('0x16')](_0x3f6969);}};EmailChannel[_0x3a9c('0x18')][_0x3a9c('0x1f')]=function(_0x499714,_0x137ee6){logger[_0x3a9c('0xa')](_0x3a9c('0x27'),_0x137ee6['firstName'],_0x137ee6[_0x3a9c('0x28')],_0x137ee6[_0x3a9c('0x29')],_0x499714);if(this[_0x3a9c('0xb')][_0x499714]){return mailAccount[_0x3a9c('0x2a')](_0x499714,_0x137ee6)['then'](function(_0x3e163f){if(_0x3e163f){logger[_0x3a9c('0xa')](_0x3a9c('0x2b'));}})[_0x3a9c('0x2c')](function(_0x1f0be8){logger[_0x3a9c('0x2d')](_0x3a9c('0x2e'),JSON[_0x3a9c('0x15')](_0x1f0be8));});}};EmailChannel[_0x3a9c('0x18')][_0x3a9c('0x21')]=function(_0x43c9b4){if(this[_0x3a9c('0xb')][_0x43c9b4]&&this[_0x3a9c('0xb')][_0x43c9b4][_0x3a9c('0x11')]){if(this[_0x3a9c('0xc')][this[_0x3a9c('0xb')][_0x43c9b4][_0x3a9c('0x11')]['id']]){delete this[_0x3a9c('0xc')][this[_0x3a9c('0xb')][_0x43c9b4][_0x3a9c('0x11')]['id']];}this[_0x3a9c('0xb')][_0x43c9b4][_0x3a9c('0x11')]['lastSync']=moment();this[_0x3a9c('0x16')](_0x43c9b4);}};EmailChannel[_0x3a9c('0x18')][_0x3a9c('0x22')]=function(_0x267d6a,_0x51472f){if(this[_0x3a9c('0xb')][_0x267d6a]){this[_0x3a9c('0xb')][_0x267d6a][_0x3a9c('0x11')][_0x3a9c('0x12')]=_0x3a9c('0x2d');this[_0x3a9c('0xb')][_0x267d6a][_0x3a9c('0x11')]['messageStatus']=_0x51472f;return this[_0x3a9c('0x16')](_0x267d6a);}};EmailChannel['prototype'][_0x3a9c('0x2f')]=function(_0x1d6261,_0x4f4fec){return this['smtp'][_0x3a9c('0x30')](_0x1d6261,_0x4f4fec);};EmailChannel[_0x3a9c('0x18')]['verifySmtp']=function(_0x471c3b){var _0x5275af=this;if(this[_0x3a9c('0xb')][_0x471c3b['id']]){if(_[_0x3a9c('0x23')](this[_0x3a9c('0xb')][_0x471c3b['id']][_0x3a9c('0x31')])){this[_0x3a9c('0xb')][_0x471c3b['id']]['Smtp']={};}this['mailAccounts'][_0x471c3b['id']][_0x3a9c('0x31')][_0x3a9c('0x32')]=moment();return new BPromise(function(_0x5863fa,_0x322eaf){return _0x5275af[_0x3a9c('0xd')]['verify'](_0x471c3b)[_0x3a9c('0x33')](function(_0x259967){_0x5275af[_0x3a9c('0xb')][_0x471c3b['id']][_0x3a9c('0x31')]['status']=_0x3a9c('0x34');_0x5275af[_0x3a9c('0xb')][_0x471c3b['id']][_0x3a9c('0x31')]['messageStatus']='';_0x5275af[_0x3a9c('0x16')](_0x471c3b['id']);_0x5863fa(_0x259967);})[_0x3a9c('0x2c')](function(_0x38390e){_0x5275af['mailAccounts'][_0x471c3b['id']][_0x3a9c('0x31')][_0x3a9c('0x12')]='error';_0x5275af['mailAccounts'][_0x471c3b['id']][_0x3a9c('0x31')][_0x3a9c('0x13')]=_0x38390e;_0x5275af[_0x3a9c('0x16')](_0x471c3b['id']);_0x322eaf(_0x38390e);});});}return this[_0x3a9c('0xd')][_0x3a9c('0x35')](_0x471c3b);};module[_0x3a9c('0x36')]=EmailChannel; \ No newline at end of file +var _0x06d7=['imapAccounts','smtp','prototype','emit','key','status','Imap','messageStatus','total','isNil','stringify','refresh','active','hasOwnProperty','box','handleImapBox','handleImapEmail','bind','end','handleImapEnd','handleImapError','disabled','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','catch','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','redis','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts'];(function(_0xa5741d,_0x33d1ec){var _0x1fe4ea=function(_0x210b82){while(--_0x210b82){_0xa5741d['push'](_0xa5741d['shift']());}};_0x1fe4ea(++_0x33d1ec);}(_0x06d7,0x1c7));var _0x706d=function(_0x23dc24,_0x960c9c){_0x23dc24=_0x23dc24-0x0;var _0x41f4a9=_0x06d7[_0x23dc24];return _0x41f4a9;};'use strict';var _=require(_0x706d('0x0'));var moment=require(_0x706d('0x1'));var BPromise=require('bluebird');var md5=require(_0x706d('0x2'));var Redis=require(_0x706d('0x3'));var config=require(_0x706d('0x4'));var logger=require(_0x706d('0x5'))('email');config['redis']=_['defaults'](config[_0x706d('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x706d('0x7'))(new Redis(config[_0x706d('0x6')]));var EmailImap=require(_0x706d('0x8'));var EmailSmtp=require(_0x706d('0x9'));var mailAccount=require(_0x706d('0xa'));var md5Accounts={};function EmailChannel(_0x54384d){logger[_0x706d('0xb')]('start\x20email\x20channel');this[_0x706d('0xc')]=_0x54384d['mailAccounts'];this[_0x706d('0xd')]={};this[_0x706d('0xe')]=new EmailSmtp();}EmailChannel[_0x706d('0xf')][_0x706d('0x10')]=function(_0x1c993c){var _0x43715e=this[_0x706d('0xc')][_0x1c993c];var _0x5f3e66={'id':_0x43715e['id'],'name':_0x43715e['name'],'key':_0x43715e[_0x706d('0x11')],'active':_0x43715e['active'],'Imap':{'status':_0x43715e['Imap'][_0x706d('0x12')],'messageStatus':_0x43715e[_0x706d('0x13')][_0x706d('0x14')],'total':_0x43715e[_0x706d('0x13')][_0x706d('0x15')]}};if(_[_0x706d('0x16')](md5Accounts[_0x1c993c])){md5Accounts[_0x1c993c]={};}var _0x223a37=md5(JSON[_0x706d('0x17')](_0x5f3e66));if(md5Accounts[_0x1c993c]['md5']!==_0x223a37){md5Accounts[_0x1c993c][_0x706d('0x2')]=_0x223a37;io['emit']('mailAccount:update',_0x5f3e66);}};EmailChannel[_0x706d('0xf')][_0x706d('0x18')]=function(_0x12175f){for(var _0x1aa353 in _0x12175f){if(_0x12175f['hasOwnProperty'](_0x1aa353)){if(_0x12175f[_0x1aa353]['Imap']&&_0x12175f[_0x1aa353][_0x706d('0x19')]){var _0x589891=_0x12175f[_0x1aa353][_0x706d('0x13')];if(!this[_0x706d('0xd')][_0x706d('0x1a')](_0x589891['id'])){this['imapAccounts'][_0x589891['id']]=new EmailImap(_0x589891,_0x12175f[_0x1aa353]['email']);this[_0x706d('0xd')][_0x589891['id']]['on'](_0x706d('0x1b'),this[_0x706d('0x1c')]['bind'](this,_0x1aa353));this[_0x706d('0xd')][_0x589891['id']]['on']('email',this[_0x706d('0x1d')][_0x706d('0x1e')](this,_0x1aa353));this[_0x706d('0xd')][_0x589891['id']]['on'](_0x706d('0x1f'),this[_0x706d('0x20')][_0x706d('0x1e')](this,_0x1aa353));this[_0x706d('0xd')][_0x589891['id']]['on']('error',this[_0x706d('0x21')][_0x706d('0x1e')](this,_0x1aa353));}}else{if(_['isNil'](this[_0x706d('0xc')][_0x1aa353][_0x706d('0x13')])){this[_0x706d('0xc')][_0x1aa353][_0x706d('0x13')]={};}this[_0x706d('0xc')][_0x1aa353][_0x706d('0x13')][_0x706d('0x12')]=_0x706d('0x22');this[_0x706d('0xc')][_0x1aa353][_0x706d('0x13')][_0x706d('0x14')]='';this[_0x706d('0x10')](_0x1aa353);}}}};EmailChannel[_0x706d('0xf')][_0x706d('0x1c')]=function(_0x14cd4b,_0x4416ef){if(this['mailAccounts'][_0x14cd4b]){this[_0x706d('0xc')][_0x14cd4b]['Imap'][_0x706d('0x12')]='connected';this[_0x706d('0xc')][_0x14cd4b][_0x706d('0x13')][_0x706d('0x14')]=_0x4416ef['name'];if(_0x4416ef['messages']){this[_0x706d('0xc')][_0x14cd4b][_0x706d('0x13')][_0x706d('0x15')]=_0x4416ef[_0x706d('0x23')][_0x706d('0x15')];}return this['emit'](_0x14cd4b);}};EmailChannel[_0x706d('0xf')][_0x706d('0x1d')]=function(_0x4b98a4,_0x2b086f){logger['info'](_0x706d('0x24'),_0x2b086f[_0x706d('0x25')],_0x2b086f[_0x706d('0x26')],_0x2b086f['from'],_0x4b98a4);if(this[_0x706d('0xc')][_0x4b98a4]){return mailAccount[_0x706d('0x27')](_0x4b98a4,_0x2b086f)[_0x706d('0x28')](function(_0x431bef){if(_0x431bef){logger[_0x706d('0xb')](_0x706d('0x29'));}})['catch'](function(_0x5c9cc1){logger[_0x706d('0x2a')](_0x706d('0x2b'),JSON[_0x706d('0x17')](_0x5c9cc1));});}};EmailChannel[_0x706d('0xf')]['handleImapEnd']=function(_0x1447ee){if(this[_0x706d('0xc')][_0x1447ee]&&this[_0x706d('0xc')][_0x1447ee][_0x706d('0x13')]){if(this[_0x706d('0xd')][this[_0x706d('0xc')][_0x1447ee]['Imap']['id']]){delete this[_0x706d('0xd')][this[_0x706d('0xc')][_0x1447ee]['Imap']['id']];}this[_0x706d('0xc')][_0x1447ee][_0x706d('0x13')][_0x706d('0x2c')]=moment();this['emit'](_0x1447ee);}};EmailChannel['prototype'][_0x706d('0x21')]=function(_0x3c7499,_0x37b2db){if(this['mailAccounts'][_0x3c7499]){this[_0x706d('0xc')][_0x3c7499]['Imap'][_0x706d('0x12')]=_0x706d('0x2a');this[_0x706d('0xc')][_0x3c7499][_0x706d('0x13')]['messageStatus']=_0x37b2db;return this[_0x706d('0x10')](_0x3c7499);}};EmailChannel[_0x706d('0xf')][_0x706d('0x2d')]=function(_0xfbf02b,_0x5215b1){return this[_0x706d('0xe')][_0x706d('0x2e')](_0xfbf02b,_0x5215b1);};EmailChannel[_0x706d('0xf')][_0x706d('0x2f')]=function(_0xb8eb91){var _0x473c99=this;if(this[_0x706d('0xc')][_0xb8eb91['id']]){if(_[_0x706d('0x16')](this[_0x706d('0xc')][_0xb8eb91['id']]['Smtp'])){this[_0x706d('0xc')][_0xb8eb91['id']][_0x706d('0x30')]={};}this[_0x706d('0xc')][_0xb8eb91['id']][_0x706d('0x30')][_0x706d('0x2c')]=moment();return new BPromise(function(_0x28e3c1,_0x8a1c88){return _0x473c99[_0x706d('0xe')][_0x706d('0x31')](_0xb8eb91)[_0x706d('0x28')](function(_0x2bc8d2){_0x473c99[_0x706d('0xc')][_0xb8eb91['id']][_0x706d('0x30')][_0x706d('0x12')]='verified';_0x473c99[_0x706d('0xc')][_0xb8eb91['id']]['Smtp'][_0x706d('0x14')]='';_0x473c99['emit'](_0xb8eb91['id']);_0x28e3c1(_0x2bc8d2);})[_0x706d('0x32')](function(_0x58623f){_0x473c99[_0x706d('0xc')][_0xb8eb91['id']][_0x706d('0x30')][_0x706d('0x12')]='error';_0x473c99[_0x706d('0xc')][_0xb8eb91['id']][_0x706d('0x30')][_0x706d('0x14')]=_0x58623f;_0x473c99[_0x706d('0x10')](_0xb8eb91['id']);_0x8a1c88(_0x58623f);});});}return this[_0x706d('0xe')]['verify'](_0xb8eb91);};module[_0x706d('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 792c3f1..e26797c 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 _0x3aeb=['simpleParser','iconv','Iconv','events','./utils','../../../config/logger','email','INBOX','account','getAccount','once','handleReady','bind','imap','connect','connTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','anonymous@xcally.com','prototype','openBox','mailbox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','handleFetchError','handleFetchEnd','body','handleMessageBody','attributes','handleMessageAttributes','end','handleMessageEnd','handleSimpleParser','closeBox','handleEnd','textCode','hasOwnProperty','upperFirst','path','util','lodash','mailparser'];(function(_0x29e284,_0x167ac4){var _0x1829b1=function(_0x43128e){while(--_0x43128e){_0x29e284['push'](_0x29e284['shift']());}};_0x1829b1(++_0x167ac4);}(_0x3aeb,0xf0));var _0xb3ae=function(_0x4cb914,_0x2a5525){_0x4cb914=_0x4cb914-0x0;var _0x57438d=_0x3aeb[_0x4cb914];return _0x57438d;};'use strict';var fs=require('fs');var path=require(_0xb3ae('0x0'));var util=require(_0xb3ae('0x1'));var Imap=require('imap');var _=require(_0xb3ae('0x2'));var rs=require('randomstring');var simpleParser=require(_0xb3ae('0x3'))[_0xb3ae('0x4')];var Iconv=require(_0xb3ae('0x5'))[_0xb3ae('0x6')];var EventEmitter=require(_0xb3ae('0x7'))['EventEmitter'];var utils=require(_0xb3ae('0x8'));var logger=require(_0xb3ae('0x9'))(_0xb3ae('0xa'));function EmailImap(_0x38c30d,_0x52e4c0){this['mailbox']=_0xb3ae('0xb');this[_0xb3ae('0xc')]=this[_0xb3ae('0xd')](_0x38c30d,_0x52e4c0);this['imap']=new Imap(this[_0xb3ae('0xc')]);this['imap'][_0xb3ae('0xe')]('ready',this[_0xb3ae('0xf')][_0xb3ae('0x10')](this));this[_0xb3ae('0x11')]['once']('end',this['handleEnd'][_0xb3ae('0x10')](this));this[_0xb3ae('0x11')]['on']('error',this['handleError'][_0xb3ae('0x10')](this));this[_0xb3ae('0x11')][_0xb3ae('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0xb3ae('0xd')]=function(_0x4b1300,_0x412885){var _0x277777={'connTimeout':_0x4b1300[_0xb3ae('0x13')]?_0x4b1300[_0xb3ae('0x13')]*0x3e8:0x2710,'authTimeout':_0x4b1300['authTimeout']?_0x4b1300['authTimeout']*0x3e8:0x1388};if(_[_0xb3ae('0x14')](_0x4b1300[_0xb3ae('0x15')])){if(_0x4b1300[_0xb3ae('0x16')]){_0x277777[_0xb3ae('0x17')]=_0x4b1300[_0xb3ae('0x17')];_0x277777['password']=_0x4b1300[_0xb3ae('0x18')];}_0x277777[_0xb3ae('0x19')]=_0x4b1300[_0xb3ae('0x19')];_0x277777['port']=_0x4b1300[_0xb3ae('0x1a')]||0x3e1;if(_0x4b1300[_0xb3ae('0x1b')]){_0x277777[_0xb3ae('0x1b')]=!![];}else{_0x277777[_0xb3ae('0x1b')]=![];_0x277777[_0xb3ae('0x1c')]=_0xb3ae('0x1d');}}else{_0x277777['user']=_0x4b1300['user'];_0x277777[_0xb3ae('0x18')]=_0x4b1300[_0xb3ae('0x18')];_0x277777[_0xb3ae('0x19')]=utils['getHost'](_0x4b1300[_0xb3ae('0x15')]);_0x277777[_0xb3ae('0x1a')]=0x3e1;_0x277777['tls']=!![];}_0x277777[_0xb3ae('0xa')]=_0x412885||_0x4b1300[_0xb3ae('0x17')]||_0xb3ae('0x1e');return _0x277777;};EmailImap[_0xb3ae('0x1f')][_0xb3ae('0xf')]=function(){this[_0xb3ae('0x11')][_0xb3ae('0x20')](this[_0xb3ae('0x21')],![],this[_0xb3ae('0x22')][_0xb3ae('0x10')](this));};EmailImap[_0xb3ae('0x1f')]['handleOpenBox']=function(_0x3942e7,_0x177a6b){if(_0x3942e7){this[_0xb3ae('0x23')](_0x3942e7,!![]);}else{this[_0xb3ae('0x24')](_0xb3ae('0x25'),_0x177a6b);this[_0xb3ae('0x26')]();}};EmailImap[_0xb3ae('0x1f')][_0xb3ae('0x27')]=function(_0x5e3f45){if(_0x5e3f45){this[_0xb3ae('0x23')](_0x5e3f45,!![]);}else{this['imap']['end']();}};EmailImap[_0xb3ae('0x1f')][_0xb3ae('0x26')]=function(){this[_0xb3ae('0x11')]['search']([_0xb3ae('0x28')],this[_0xb3ae('0x29')][_0xb3ae('0x10')](this));};EmailImap['prototype'][_0xb3ae('0x29')]=function(_0x7bb1ce,_0x148930){if(_0x7bb1ce){this[_0xb3ae('0x23')](_0x7bb1ce,!![]);}else{if(_0x148930[_0xb3ae('0x2a')]){try{var _0x48256c=this[_0xb3ae('0x11')][_0xb3ae('0x2b')](_0x148930,{'bodies':'','markSeen':!![]});_0x48256c['on'](_0xb3ae('0x2c'),this[_0xb3ae('0x2d')][_0xb3ae('0x10')](this));_0x48256c['once'](_0xb3ae('0x2e'),this[_0xb3ae('0x2f')]['bind'](this));_0x48256c[_0xb3ae('0xe')]('end',this[_0xb3ae('0x30')]['bind'](this));}catch(_0x48939a){logger[_0xb3ae('0x2e')](_0x48939a);}}else{this[_0xb3ae('0x11')]['closeBox'](!![],this[_0xb3ae('0x27')][_0xb3ae('0x10')](this));}}};EmailImap[_0xb3ae('0x1f')][_0xb3ae('0x2d')]=function(_0x3dc0d2,_0x414bf0){_0x3dc0d2['on'](_0xb3ae('0x31'),this[_0xb3ae('0x32')][_0xb3ae('0x10')](this));_0x3dc0d2[_0xb3ae('0xe')](_0xb3ae('0x33'),this[_0xb3ae('0x34')][_0xb3ae('0x10')](this));_0x3dc0d2[_0xb3ae('0xe')](_0xb3ae('0x35'),this[_0xb3ae('0x36')]['bind'](this));};EmailImap[_0xb3ae('0x1f')]['handleMessageBody']=function(_0x54bb14,_0x54a2ca){simpleParser(_0x54bb14,{'Iconv':Iconv},this[_0xb3ae('0x37')][_0xb3ae('0x10')](this));};EmailImap['prototype'][_0xb3ae('0x34')]=function(_0x3ec017){};EmailImap[_0xb3ae('0x1f')][_0xb3ae('0x36')]=function(){};EmailImap[_0xb3ae('0x1f')]['handleSimpleParser']=function(_0x27ff76,_0x37ebd5){if(_0x27ff76){logger[_0xb3ae('0x2e')](_0x27ff76);}else{var _0x38399f=this;utils['parser'](this[_0xb3ae('0xc')],_0x37ebd5,function(_0x223225){_0x38399f['emit'](_0xb3ae('0xa'),_0x223225);});}};EmailImap[_0xb3ae('0x1f')][_0xb3ae('0x30')]=function(){this['imap'][_0xb3ae('0x38')](!![],this[_0xb3ae('0x27')][_0xb3ae('0x10')](this));};EmailImap[_0xb3ae('0x1f')][_0xb3ae('0x2f')]=function(_0x265c7b){this[_0xb3ae('0x23')](_0x265c7b);this['imap'][_0xb3ae('0x38')](!![],this[_0xb3ae('0x27')][_0xb3ae('0x10')](this));};EmailImap[_0xb3ae('0x1f')][_0xb3ae('0x39')]=function(){this['emit'](_0xb3ae('0x35'));};EmailImap[_0xb3ae('0x1f')]['handleError']=function(_0x42dda6,_0x494593){logger[_0xb3ae('0x2e')]('handleError',this[_0xb3ae('0xc')][_0xb3ae('0xa')],JSON['stringify'](_0x42dda6));var _0x36a212='';if(_0x42dda6){if(_0x42dda6[_0xb3ae('0x3a')]){_0x36a212=_0x42dda6[_0xb3ae('0x3a')];}else{for(var _0x2f030c in _0x42dda6){if(_0x42dda6[_0xb3ae('0x3b')](_0x2f030c)){_0x36a212+=_[_0xb3ae('0x3c')](_0x2f030c)+':\x20'+_0x42dda6[_0x2f030c]+'\x0a';}}}}if(_0x494593){this['imap'][_0xb3ae('0x35')]();}else{this[_0xb3ae('0x24')]('error',_0x36a212);this[_0xb3ae('0x24')](_0xb3ae('0x35'));}};module['exports']=EmailImap; \ No newline at end of file +var _0xd904=['emit','handleFetchEnd','handleFetchError','handleEnd','stringify','textCode','hasOwnProperty','exports','util','imap','randomstring','simpleParser','iconv','Iconv','events','EventEmitter','email','mailbox','INBOX','account','getAccount','ready','handleReady','bind','once','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','required','anonymous@xcally.com','openBox','handleOpenBox','box','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','end','closeBox','body','handleMessageBody','attributes','handleSimpleParser','handleMessageAttributes','handleMessageEnd','parser'];(function(_0x7d9c0d,_0x165295){var _0x26a3c7=function(_0x493af9){while(--_0x493af9){_0x7d9c0d['push'](_0x7d9c0d['shift']());}};_0x26a3c7(++_0x165295);}(_0xd904,0x84));var _0x4d90=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xd904[_0x57b54c];return _0x59cc19;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x4d90('0x0'));var Imap=require(_0x4d90('0x1'));var _=require('lodash');var rs=require(_0x4d90('0x2'));var simpleParser=require('mailparser')[_0x4d90('0x3')];var Iconv=require(_0x4d90('0x4'))[_0x4d90('0x5')];var EventEmitter=require(_0x4d90('0x6'))[_0x4d90('0x7')];var utils=require('./utils');var logger=require('../../../config/logger')(_0x4d90('0x8'));function EmailImap(_0x3eb01b,_0x5b9988){this[_0x4d90('0x9')]=_0x4d90('0xa');this[_0x4d90('0xb')]=this[_0x4d90('0xc')](_0x3eb01b,_0x5b9988);this[_0x4d90('0x1')]=new Imap(this[_0x4d90('0xb')]);this[_0x4d90('0x1')]['once'](_0x4d90('0xd'),this[_0x4d90('0xe')][_0x4d90('0xf')](this));this[_0x4d90('0x1')][_0x4d90('0x10')]('end',this['handleEnd'][_0x4d90('0xf')](this));this[_0x4d90('0x1')]['on'](_0x4d90('0x11'),this[_0x4d90('0x12')]['bind'](this));this[_0x4d90('0x1')][_0x4d90('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x4d90('0x14')][_0x4d90('0xc')]=function(_0x36ecc9,_0x2f18c7){var _0x10d4aa={'connTimeout':_0x36ecc9[_0x4d90('0x15')]?_0x36ecc9[_0x4d90('0x15')]*0x3e8:0x2710,'authTimeout':_0x36ecc9[_0x4d90('0x16')]?_0x36ecc9[_0x4d90('0x16')]*0x3e8:0x1388};if(_[_0x4d90('0x17')](_0x36ecc9[_0x4d90('0x18')])){if(_0x36ecc9['authentication']){_0x10d4aa[_0x4d90('0x19')]=_0x36ecc9[_0x4d90('0x19')];_0x10d4aa[_0x4d90('0x1a')]=_0x36ecc9[_0x4d90('0x1a')];}_0x10d4aa[_0x4d90('0x1b')]=_0x36ecc9[_0x4d90('0x1b')];_0x10d4aa[_0x4d90('0x1c')]=_0x36ecc9[_0x4d90('0x1c')]||0x3e1;if(_0x36ecc9[_0x4d90('0x1d')]){_0x10d4aa[_0x4d90('0x1d')]=!![];}else{_0x10d4aa['tls']=![];_0x10d4aa[_0x4d90('0x1e')]=_0x4d90('0x1f');}}else{_0x10d4aa[_0x4d90('0x19')]=_0x36ecc9[_0x4d90('0x19')];_0x10d4aa[_0x4d90('0x1a')]=_0x36ecc9[_0x4d90('0x1a')];_0x10d4aa[_0x4d90('0x1b')]=utils['getHost'](_0x36ecc9['service']);_0x10d4aa[_0x4d90('0x1c')]=0x3e1;_0x10d4aa[_0x4d90('0x1d')]=!![];}_0x10d4aa[_0x4d90('0x8')]=_0x2f18c7||_0x36ecc9[_0x4d90('0x19')]||_0x4d90('0x20');return _0x10d4aa;};EmailImap[_0x4d90('0x14')][_0x4d90('0xe')]=function(){this['imap'][_0x4d90('0x21')](this[_0x4d90('0x9')],![],this[_0x4d90('0x22')][_0x4d90('0xf')](this));};EmailImap[_0x4d90('0x14')][_0x4d90('0x22')]=function(_0x1d9a3b,_0x13227e){if(_0x1d9a3b){this[_0x4d90('0x12')](_0x1d9a3b,!![]);}else{this['emit'](_0x4d90('0x23'),_0x13227e);this['readUnseen']();}};EmailImap[_0x4d90('0x14')][_0x4d90('0x24')]=function(_0x300e2e){if(_0x300e2e){this[_0x4d90('0x12')](_0x300e2e,!![]);}else{this[_0x4d90('0x1')]['end']();}};EmailImap[_0x4d90('0x14')][_0x4d90('0x25')]=function(){this[_0x4d90('0x1')][_0x4d90('0x26')]([_0x4d90('0x27')],this[_0x4d90('0x28')][_0x4d90('0xf')](this));};EmailImap[_0x4d90('0x14')][_0x4d90('0x28')]=function(_0x57068f,_0x590652){if(_0x57068f){this[_0x4d90('0x12')](_0x57068f,!![]);}else{if(_0x590652[_0x4d90('0x29')]){try{var _0x4f122e=this[_0x4d90('0x1')][_0x4d90('0x2a')](_0x590652,{'bodies':'','markSeen':!![]});_0x4f122e['on'](_0x4d90('0x2b'),this[_0x4d90('0x2c')][_0x4d90('0xf')](this));_0x4f122e['once']('error',this['handleFetchError']['bind'](this));_0x4f122e['once'](_0x4d90('0x2d'),this['handleFetchEnd'][_0x4d90('0xf')](this));}catch(_0x43b8af){logger['error'](_0x43b8af);}}else{this[_0x4d90('0x1')][_0x4d90('0x2e')](!![],this[_0x4d90('0x24')][_0x4d90('0xf')](this));}}};EmailImap['prototype'][_0x4d90('0x2c')]=function(_0x1c4a3e,_0x5cdaa7){_0x1c4a3e['on'](_0x4d90('0x2f'),this[_0x4d90('0x30')][_0x4d90('0xf')](this));_0x1c4a3e[_0x4d90('0x10')](_0x4d90('0x31'),this['handleMessageAttributes']['bind'](this));_0x1c4a3e[_0x4d90('0x10')]('end',this['handleMessageEnd'][_0x4d90('0xf')](this));};EmailImap['prototype'][_0x4d90('0x30')]=function(_0x51c9bd,_0x3fb42b){simpleParser(_0x51c9bd,{'Iconv':Iconv},this[_0x4d90('0x32')][_0x4d90('0xf')](this));};EmailImap[_0x4d90('0x14')][_0x4d90('0x33')]=function(_0x423fb6){};EmailImap[_0x4d90('0x14')][_0x4d90('0x34')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x2de1e7,_0x1caaa9){if(_0x2de1e7){logger['error'](_0x2de1e7);}else{var _0x27d462=this;utils[_0x4d90('0x35')](this['account'],_0x1caaa9,function(_0x5d35eb){_0x27d462[_0x4d90('0x36')](_0x4d90('0x8'),_0x5d35eb);});}};EmailImap['prototype'][_0x4d90('0x37')]=function(){this[_0x4d90('0x1')]['closeBox'](!![],this[_0x4d90('0x24')][_0x4d90('0xf')](this));};EmailImap[_0x4d90('0x14')][_0x4d90('0x38')]=function(_0x5b894f){this['handleError'](_0x5b894f);this[_0x4d90('0x1')][_0x4d90('0x2e')](!![],this[_0x4d90('0x24')][_0x4d90('0xf')](this));};EmailImap[_0x4d90('0x14')][_0x4d90('0x39')]=function(){this[_0x4d90('0x36')](_0x4d90('0x2d'));};EmailImap[_0x4d90('0x14')]['handleError']=function(_0x438b67,_0x401f8c){logger[_0x4d90('0x11')](_0x4d90('0x12'),this[_0x4d90('0xb')][_0x4d90('0x8')],JSON[_0x4d90('0x3a')](_0x438b67));var _0x12326c='';if(_0x438b67){if(_0x438b67[_0x4d90('0x3b')]){_0x12326c=_0x438b67['textCode'];}else{for(var _0xf04adc in _0x438b67){if(_0x438b67[_0x4d90('0x3c')](_0xf04adc)){_0x12326c+=_['upperFirst'](_0xf04adc)+':\x20'+_0x438b67[_0xf04adc]+'\x0a';}}}}if(_0x401f8c){this[_0x4d90('0x1')][_0x4d90('0x2d')]();}else{this[_0x4d90('0x36')](_0x4d90('0x11'),_0x12326c);this['emit'](_0x4d90('0x2d'));}};module[_0x4d90('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 6730c3d..e2b4455 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 _0xc87a=['prototype','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired','nodemailer','bluebird','nodemailer-plugin-inline-base64'];(function(_0x5ca9a3,_0x3382aa){var _0x23d3c7=function(_0x4a7174){while(--_0x4a7174){_0x5ca9a3['push'](_0x5ca9a3['shift']());}};_0x23d3c7(++_0x3382aa);}(_0xc87a,0x152));var _0xac87=function(_0x3e3e32,_0x324654){_0x3e3e32=_0x3e3e32-0x0;var _0x1b9249=_0xc87a[_0x3e3e32];return _0x1b9249;};'use strict';var nodemailer=require(_0xac87('0x0'));var BPromise=require(_0xac87('0x1'));var inlineBase64=require(_0xac87('0x2'));function EmailSmtp(){}EmailSmtp[_0xac87('0x3')]['send']=function(_0x238ca8,_0x251e29){return new BPromise(function(_0x151620,_0x149d13){var _0x5eae07=nodemailer[_0xac87('0x4')](_0x238ca8);_0x5eae07[_0xac87('0x5')](_0xac87('0x6'),inlineBase64());_0x5eae07[_0xac87('0x7')](_0x251e29,function(_0x1daf54,_0x15bd08){if(_0x1daf54){_0x149d13(_0x1daf54[_0xac87('0x8')]());}else{_0x151620(_0x15bd08);}});});};EmailSmtp[_0xac87('0x3')][_0xac87('0x9')]=function(_0x4a654b){return new BPromise(function(_0x2fa704,_0x28e2f3){var _0x4ec941=nodemailer[_0xac87('0x4')](_0x4a654b);_0x4ec941['verify'](function(_0x3b55a7,_0x29a26a){if(_0x3b55a7){_0x28e2f3(_0x3b55a7[_0xac87('0x8')]());}else{if(_0x29a26a){_0x2fa704(_0x29a26a);}else{_0x28e2f3(_0xac87('0xa'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x125a=['verify','nodemailer','nodemailer-plugin-inline-base64','prototype','send','createTransport','compile'];(function(_0x5814b2,_0x1f1cfb){var _0x2f7afe=function(_0x36a124){while(--_0x36a124){_0x5814b2['push'](_0x5814b2['shift']());}};_0x2f7afe(++_0x1f1cfb);}(_0x125a,0x120));var _0xa125=function(_0x328534,_0x33b41e){_0x328534=_0x328534-0x0;var _0x2796c0=_0x125a[_0x328534];return _0x2796c0;};'use strict';var nodemailer=require(_0xa125('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0xa125('0x1'));function EmailSmtp(){}EmailSmtp[_0xa125('0x2')][_0xa125('0x3')]=function(_0x329ce9,_0x216347){return new BPromise(function(_0x1d60d4,_0x2115c4){var _0x437610=nodemailer[_0xa125('0x4')](_0x329ce9);_0x437610['use'](_0xa125('0x5'),inlineBase64());_0x437610['sendMail'](_0x216347,function(_0x5f0a2c,_0x461f67){if(_0x5f0a2c){_0x2115c4(_0x5f0a2c['toString']());}else{_0x1d60d4(_0x461f67);}});});};EmailSmtp[_0xa125('0x2')]['verify']=function(_0x37edc4){return new BPromise(function(_0x29ae70,_0x4a9dc8){var _0x13a4ca=nodemailer[_0xa125('0x4')](_0x37edc4);_0x13a4ca[_0xa125('0x6')](function(_0x59c2dd,_0x243628){if(_0x59c2dd){_0x4a9dc8(_0x59c2dd['toString']());}else{if(_0x243628){_0x29ae70(_0x243628);}else{_0x4a9dc8('Not\x20verifired');}}});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 2c6320f..ddb8fa8 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 _0x1374=['imap-mail.outlook.com','outlook365','outlook.office365.com','127.0.0.1','lodash','randomstring','path','util','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','head','name','split','length','slice','Anonymous','pop','isEmpty','test','html','replace','textAsHtml','body','Empty\x20message

','Attachments','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x1374,0x7e));var _0x4137=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1374[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x4137('0x0'));var moment=require('moment');var random=require(_0x4137('0x1'));var fs=require('fs');var path=require(_0x4137('0x2'));var util=require(_0x4137('0x3'));var tnef=require('node-tnef');var logger=require(_0x4137('0x4'))(_0x4137('0x5'));var config=require(_0x4137('0x6'));function getAddress(_0x42a562){var _0x49c5f5=_['head'](_0x42a562[_0x4137('0x7')]);return _0x49c5f5&&_0x49c5f5[_0x4137('0x8')]?_0x49c5f5[_0x4137('0x8')]:_0x4137('0x9')+random[_0x4137('0xa')](0x6)+_0x4137('0xb');}function getFirstName(_0x1f510c){var _0x28ba92=_[_0x4137('0xc')](_0x1f510c['value']);if(_0x28ba92&&_0x28ba92[_0x4137('0xd')]){var _0x28fbd6=_0x28ba92['name'][_0x4137('0xe')](/\s+/);return _0x28fbd6[_0x4137('0xf')]?_0x28fbd6[_0x4137('0x10')](0x0,-0x1)['join']('\x20'):_0x28ba92['name'];}return _0x4137('0x11');}function getLastName(_0x13b71b){var _0x54448e=_[_0x4137('0xc')](_0x13b71b[_0x4137('0x7')]);if(_0x54448e&&_0x54448e[_0x4137('0xd')]){var _0x4024fe=_0x54448e['name'][_0x4137('0xe')](/\s+/);return _0x4024fe[_0x4137('0xf')]>0x1?_0x4024fe[_0x4137('0x12')]():'';}return'';}function getMails(_0x2e1d3a,_0x1916ca){var _0x551d81='';for(var _0xde55d=0x0;_0xde55d<_0x1916ca[_0x4137('0x7')][_0x4137('0xf')];_0xde55d+=0x1){if(_0x1916ca['value'][_0xde55d][_0x4137('0x8')]!==_0x2e1d3a){if(!_[_0x4137('0x13')](_0x551d81)){_0x551d81+=',';}_0x551d81+=_0x1916ca['value'][_0xde55d]['name']||_0x1916ca[_0x4137('0x7')][_0xde55d][_0x4137('0x8')]||'';_0x551d81+='\x20<';_0x551d81+=_0x1916ca['value'][_0xde55d][_0x4137('0x8')]?_0x1916ca[_0x4137('0x7')][_0xde55d][_0x4137('0x8')]:'anonymous'+random[_0x4137('0xa')](0x6)+'@xcally.com';_0x551d81+='>';}}return _0x551d81;}function parseEmail(_0xef1a77,_0x180986,_0x158dae){if(_0x180986['html']){var _0x10df73=/)<[^<]*)*<\/script>/gi;while(_0x10df73[_0x4137('0x14')](_0x180986[_0x4137('0x15')])){_0x180986[_0x4137('0x15')]=_0x180986[_0x4137('0x15')][_0x4137('0x16')](_0x10df73,'');}_0x158dae['body']=_0x180986[_0x4137('0x15')];}else{_0x158dae['body']=_0x180986[_0x4137('0x17')];}if(_0x158dae[_0x4137('0x18')]){_0x158dae[_0x4137('0x18')]=_0x158dae[_0x4137('0x18')][_0x4137('0x16')](/Empty\x20message

','Attachments','Title','Data','getHost','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','../../../config/logger','email','value','address','generate','head','name','split','length','slice','join','Anonymous','pop','isEmpty','anonymous','@xcally.com','html','replace','textAsHtml','body','0x1?_0xe49d9d[_0x393b('0x11')]():'';}return'';}function getMails(_0x292dbe,_0x118193){var _0x50bf18='';for(var _0x4eaae8=0x0;_0x4eaae8<_0x118193['value'][_0x393b('0xd')];_0x4eaae8+=0x1){if(_0x118193[_0x393b('0x7')][_0x4eaae8]['address']!==_0x292dbe){if(!_[_0x393b('0x12')](_0x50bf18)){_0x50bf18+=',';}_0x50bf18+=_0x118193['value'][_0x4eaae8][_0x393b('0xb')]||_0x118193['value'][_0x4eaae8][_0x393b('0x8')]||'';_0x50bf18+='\x20<';_0x50bf18+=_0x118193[_0x393b('0x7')][_0x4eaae8]['address']?_0x118193[_0x393b('0x7')][_0x4eaae8]['address']:_0x393b('0x13')+random[_0x393b('0x9')](0x6)+_0x393b('0x14');_0x50bf18+='>';}}return _0x50bf18;}function parseEmail(_0x486363,_0x4ca42e,_0x14bf2b){if(_0x4ca42e['html']){var _0x4a65f7=/)<[^<]*)*<\/script>/gi;while(_0x4a65f7['test'](_0x4ca42e[_0x393b('0x15')])){_0x4ca42e[_0x393b('0x15')]=_0x4ca42e[_0x393b('0x15')][_0x393b('0x16')](_0x4a65f7,'');}_0x14bf2b['body']=_0x4ca42e[_0x393b('0x15')];}else{_0x14bf2b['body']=_0x4ca42e[_0x393b('0x17')];}if(_0x14bf2b['body']){_0x14bf2b[_0x393b('0x18')]=_0x14bf2b[_0x393b('0x18')][_0x393b('0x16')](/0x0){if(this[_0x140020+_0x52ca('0x29')]>0x0&&this[_0x140020+_0x52ca('0x28')]>=this[_0x140020+_0x52ca('0x29')]){return _0x52ca('0x2a');}else{return'working';}}else{return _0x52ca('0x2b');}};Agent[_0x52ca('0x2c')][_0x52ca('0x26')]=function(){var _0x18f919=[_0x52ca('0x2d'),_0x52ca('0x2e'),_0x52ca('0x2f'),_0x52ca('0x30'),'sms','whatsapp'];for(var _0x303464=0x0;_0x303464<_0x18f919['length'];_0x303464+=0x1){var _0x27cc1f=this[_0x52ca('0x27')](_0x18f919[_0x303464]);if(this[_0x18f919[_0x303464]+'Status']!==_0x27cc1f){this[_0x18f919[_0x303464]+_0x52ca('0x31')]=_[_0x52ca('0x32')](moment()[_0x52ca('0x33')]('x'));}this[_0x18f919[_0x303464]+_0x52ca('0x34')]=_0x27cc1f;}var _0x52016d={'id':this['id'],'name':this[_0x52ca('0x35')],'online':this[_0x52ca('0x6')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0x52ca('0x9')],'smsPause':this['smsPause'],'faxPause':this[_0x52ca('0xa')],'openchannelPause':this[_0x52ca('0xc')],'chatStatus':this[_0x52ca('0xd')],'chatStatusTime':this[_0x52ca('0xf')],'chatCapacity':this[_0x52ca('0x10')],'chatCurrentCapacity':this[_0x52ca('0x36')],'mailStatus':this[_0x52ca('0x11')],'mailStatusTime':this[_0x52ca('0x12')],'mailCapacity':this[_0x52ca('0x13')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x52ca('0x15')],'faxStatusTime':this[_0x52ca('0x16')],'faxCapacity':this[_0x52ca('0x37')],'faxCurrentCapacity':this[_0x52ca('0x17')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x52ca('0x19')],'smsCapacity':this[_0x52ca('0x1a')],'smsCurrentCapacity':this[_0x52ca('0x1b')],'whatsappStatus':this[_0x52ca('0x1c')],'whatsappStatusTime':this[_0x52ca('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x52ca('0x1f')],'openchannelStatus':this[_0x52ca('0x20')],'openchannelStatusTime':this[_0x52ca('0x21')],'openchannelCapacity':this[_0x52ca('0x22')],'openchannelCurrentCapacity':this[_0x52ca('0x23')],'busy':this['busy'],'busyQueue':this[_0x52ca('0x25')]};var _0x3368fc=md5(JSON[_0x52ca('0x38')](_0x52016d));if(this[_0x52ca('0x1')]!==_0x3368fc){this[_0x52ca('0x1')]=_0x3368fc;io[_0x52ca('0x39')](_0x52ca('0x3a'),_0x52016d);}};module['exports']=Agent; \ No newline at end of file +var _0x0664=['CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','whatsapp','length','getChannelStatus','Status','StatusTime','toNumber','format','chatStatusTime','mailCurrentCapacity','faxStatusTime','openchannelStatus','stringify','emit','user:save','exports','moment','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','prototype'];(function(_0xcbafdd,_0x59104a){var _0xc9151=function(_0x5f05ff){while(--_0x5f05ff){_0xcbafdd['push'](_0xcbafdd['shift']());}};_0xc9151(++_0x59104a);}(_0x0664,0x93));var _0x4066=function(_0x4dc0d9,_0x373006){_0x4dc0d9=_0x4dc0d9-0x0;var _0x29bdc2=_0x0664[_0x4dc0d9];return _0x29bdc2;};'use strict';var _=require('lodash');var moment=require(_0x4066('0x0'));var md5=require('md5');var Redis=require(_0x4066('0x1'));var config=require(_0x4066('0x2'));config['redis']=_[_0x4066('0x3')](config[_0x4066('0x4')],{'host':_0x4066('0x5'),'port':0x18eb});var io=require(_0x4066('0x6'))(new Redis(config[_0x4066('0x4')]));function Agent(_0x325e0e){this['id']=_0x325e0e['id']||0x0;this[_0x4066('0x7')]=_0x325e0e[_0x4066('0x7')]||'';this[_0x4066('0x8')]=_0x325e0e[_0x4066('0x8')]||!![];this['voicePause']=_0x325e0e[_0x4066('0x9')]||![];this['chatPause']=_0x325e0e[_0x4066('0xa')]||![];this[_0x4066('0xb')]=_0x325e0e['mailPause']||![];this['faxPause']=_0x325e0e[_0x4066('0xc')]||![];this[_0x4066('0xd')]=_0x325e0e[_0x4066('0xd')]||![];this[_0x4066('0xe')]=_0x325e0e['openchannelPause']||![];this['chatStatus']='unknown';this['chatStatusTime']=0x0;this[_0x4066('0xf')]=_0x325e0e[_0x4066('0xf')]||0x0;this[_0x4066('0x10')]=0x0;this[_0x4066('0x11')]=_0x4066('0x12');this[_0x4066('0x13')]=0x0;this[_0x4066('0x14')]=_0x325e0e[_0x4066('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x4066('0x15')]=_0x4066('0x12');this['faxStatusTime']=0x0;this[_0x4066('0x16')]=_0x325e0e['faxCapacity']||0x0;this[_0x4066('0x17')]=0x0;this['smsStatus']='unknown';this[_0x4066('0x18')]=0x0;this[_0x4066('0x19')]=_0x325e0e[_0x4066('0x19')]||0x0;this[_0x4066('0x1a')]=0x0;this[_0x4066('0x1b')]=_0x4066('0x12');this[_0x4066('0x1c')]=0x0;this[_0x4066('0x1d')]=_0x325e0e[_0x4066('0x1d')]||0x0;this[_0x4066('0x1e')]=0x0;this['openchannelStatus']='unknown';this[_0x4066('0x1f')]=0x0;this[_0x4066('0x20')]=_0x325e0e['openchannelCapacity']||0x0;this[_0x4066('0x21')]=0x0;this[_0x4066('0x22')]=![];this[_0x4066('0x23')]=undefined;this[_0x4066('0x24')]='';this[_0x4066('0x25')]();}Agent[_0x4066('0x26')]['getChannelStatus']=function(_0x550dcf){if(this[_0x550dcf+'CurrentCapacity']>0x0){if(this[_0x550dcf+'Capacity']>0x0&&this[_0x550dcf+_0x4066('0x27')]>=this[_0x550dcf+_0x4066('0x28')]){return _0x4066('0x29');}else{return _0x4066('0x2a');}}else{return _0x4066('0x2b');}};Agent['prototype'][_0x4066('0x25')]=function(){var _0x1433a9=[_0x4066('0x2c'),_0x4066('0x2d'),_0x4066('0x2e'),'fax','sms',_0x4066('0x2f')];for(var _0x36f67d=0x0;_0x36f67d<_0x1433a9[_0x4066('0x30')];_0x36f67d+=0x1){var _0xac8304=this[_0x4066('0x31')](_0x1433a9[_0x36f67d]);if(this[_0x1433a9[_0x36f67d]+_0x4066('0x32')]!==_0xac8304){this[_0x1433a9[_0x36f67d]+_0x4066('0x33')]=_[_0x4066('0x34')](moment()[_0x4066('0x35')]('x'));}this[_0x1433a9[_0x36f67d]+_0x4066('0x32')]=_0xac8304;}var _0x383aa5={'id':this['id'],'name':this[_0x4066('0x7')],'online':this[_0x4066('0x8')],'voicePause':this[_0x4066('0x9')],'chatPause':this[_0x4066('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x4066('0xd')],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x4066('0x36')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x4066('0x10')],'mailStatus':this[_0x4066('0x11')],'mailStatusTime':this[_0x4066('0x13')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x4066('0x37')],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0x4066('0x38')],'faxCapacity':this[_0x4066('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x4066('0x18')],'smsCapacity':this[_0x4066('0x19')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x4066('0x1b')],'whatsappStatusTime':this[_0x4066('0x1c')],'whatsappCapacity':this[_0x4066('0x1d')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x4066('0x39')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x4066('0x20')],'openchannelCurrentCapacity':this[_0x4066('0x21')],'busy':this[_0x4066('0x22')],'busyQueue':this[_0x4066('0x23')]};var _0x245b91=md5(JSON[_0x4066('0x3a')](_0x383aa5));if(this[_0x4066('0x24')]!==_0x245b91){this[_0x4066('0x24')]=_0x245b91;io[_0x4066('0x3b')](_0x4066('0x3c'),_0x383aa5);}};module[_0x4066('0x3d')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index d97ba08..6defed9 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 _0x6e66=['_rr','map','prototype','updateRealtime','loggedIn','paused','length','online','Agents','chatPause','available','stringify','format','emit','exports','lodash','md5','ioredis','redis','localhost','name','timeout','strategy','mapAgentsId','waiting','updateRouting'];(function(_0x161d6d,_0x5114c0){var _0x3976e2=function(_0x56eb20){while(--_0x56eb20){_0x161d6d['push'](_0x161d6d['shift']());}};_0x3976e2(++_0x5114c0);}(_0x6e66,0x12d));var _0x66e6=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x6e66[_0x543084];return _0x306a57;};'use strict';var _=require(_0x66e6('0x0'));var md5=require(_0x66e6('0x1'));var util=require('util');var Redis=require(_0x66e6('0x2'));var config=require('../../../config/environment');config[_0x66e6('0x3')]=_['defaults'](config['redis'],{'host':_0x66e6('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x66e6('0x3')]));function ChatQueue(_0x3e4302){this['id']=_0x3e4302['id']||0x0;this[_0x66e6('0x5')]=_0x3e4302[_0x66e6('0x5')]||'';this[_0x66e6('0x6')]=_0x3e4302[_0x66e6('0x6')]||0xa;this[_0x66e6('0x7')]=_0x3e4302['strategy']||'beepall';this['Agents']=_0x3e4302['Agents'];this[_0x66e6('0x8')]={};this[_0x66e6('0x9')]=0x0;this[_0x66e6('0x1')]='';this[_0x66e6('0xa')]();this['updateRealtime']();}ChatQueue['prototype'][_0x66e6('0xa')]=function(){var _0x50984f=this['mapAgentsId'][_0x66e6('0xb')];this['mapAgentsId']=_[_0x66e6('0xc')](this['Agents'],'id');this[_0x66e6('0x8')][_0x66e6('0xb')]=_0x50984f;};ChatQueue[_0x66e6('0xd')][_0x66e6('0xe')]=function(){this[_0x66e6('0xf')]=0x0;this[_0x66e6('0x10')]=0x0;for(var _0x74a42a=0x0;_0x74a42a=0x0?this[_0x66e6('0x15')]:0x0;var _0x5ac48f={'id':this['id'],'available':this[_0x66e6('0x15')],'loggedIn':this[_0x66e6('0xf')],'name':this[_0x66e6('0x5')],'paused':this[_0x66e6('0x10')],'waiting':this['waiting']};var _0xd8292e=md5(JSON[_0x66e6('0x16')](_0x5ac48f));if(this[_0x66e6('0x1')]!==_0xd8292e){this[_0x66e6('0x1')]=_0xd8292e;io['to'](util[_0x66e6('0x17')]('chat:queue:%s',_0x5ac48f['name']))[_0x66e6('0x18')]('chat_queue:save',_0x5ac48f);}};module[_0x66e6('0x19')]=ChatQueue; \ No newline at end of file +var _0x5724=['stringify','md5','emit','exports','lodash','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','loggedIn','length','chatPause','available','paused'];(function(_0x4cc92c,_0x4209be){var _0x56fe6a=function(_0x271c35){while(--_0x271c35){_0x4cc92c['push'](_0x4cc92c['shift']());}};_0x56fe6a(++_0x4209be);}(_0x5724,0x199));var _0x4572=function(_0x2d73e6,_0x4b5d9d){_0x2d73e6=_0x2d73e6-0x0;var _0x8b084d=_0x5724[_0x2d73e6];return _0x8b084d;};'use strict';var _=require(_0x4572('0x0'));var md5=require('md5');var util=require(_0x4572('0x1'));var Redis=require('ioredis');var config=require(_0x4572('0x2'));config[_0x4572('0x3')]=_[_0x4572('0x4')](config[_0x4572('0x3')],{'host':_0x4572('0x5'),'port':0x18eb});var io=require(_0x4572('0x6'))(new Redis(config[_0x4572('0x3')]));function ChatQueue(_0x20bd17){this['id']=_0x20bd17['id']||0x0;this[_0x4572('0x7')]=_0x20bd17['name']||'';this[_0x4572('0x8')]=_0x20bd17['timeout']||0xa;this[_0x4572('0x9')]=_0x20bd17[_0x4572('0x9')]||_0x4572('0xa');this[_0x4572('0xb')]=_0x20bd17[_0x4572('0xb')];this[_0x4572('0xc')]={};this[_0x4572('0xd')]=0x0;this['md5']='';this['updateRouting']();this[_0x4572('0xe')]();}ChatQueue[_0x4572('0xf')][_0x4572('0x10')]=function(){var _0x1fb861=this[_0x4572('0xc')]['_rr'];this[_0x4572('0xc')]=_['map'](this[_0x4572('0xb')],'id');this['mapAgentsId'][_0x4572('0x11')]=_0x1fb861;};ChatQueue['prototype']['updateRealtime']=function(){this[_0x4572('0x12')]=0x0;this['paused']=0x0;for(var _0x1f5894=0x0;_0x1f5894=0x0?this[_0x4572('0x15')]:0x0;var _0x288ff8={'id':this['id'],'available':this['available'],'loggedIn':this[_0x4572('0x12')],'name':this[_0x4572('0x7')],'paused':this[_0x4572('0x16')],'waiting':this['waiting']};var _0x491268=md5(JSON[_0x4572('0x17')](_0x288ff8));if(this['md5']!==_0x491268){this[_0x4572('0x18')]=_0x491268;io['to'](util['format']('chat:queue:%s',_0x288ff8['name']))[_0x4572('0x19')]('chat_queue:save',_0x288ff8);}};module[_0x4572('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 22f230b..10ff3b8 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 _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x3d84d0,_0x40457f){var _0x2a5e85=function(_0x2006fa){while(--_0x2006fa){_0x3d84d0['push'](_0x3d84d0['shift']());}};_0x2a5e85(++_0x40457f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file +var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x260f23,_0x2d90ee){var _0x222dc1=function(_0x3674af){while(--_0x3674af){_0x260f23['push'](_0x260f23['shift']());}};_0x222dc1(++_0x2d90ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 8768d08..01b040c 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 _0xb066=['exports','name','Intervals'];(function(_0x4e57c7,_0x8732c2){var _0x519cfe=function(_0x5ef3f0){while(--_0x5ef3f0){_0x4e57c7['push'](_0x4e57c7['shift']());}};_0x519cfe(++_0x8732c2);}(_0xb066,0x7c));var _0x6b06=function(_0xc3a40f,_0x2d7ddd){_0xc3a40f=_0xc3a40f-0x0;var _0x3db54b=_0xb066[_0xc3a40f];return _0x3db54b;};'use strict';function Interval(_0x3c5db2){this['id']=_0x3c5db2['id']||0x0;this[_0x6b06('0x0')]=_0x3c5db2[_0x6b06('0x0')]||'';this[_0x6b06('0x1')]=_0x3c5db2[_0x6b06('0x1')]||{};}module[_0x6b06('0x2')]=Interval; \ No newline at end of file +var _0xd3c4=['Intervals','exports','name'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xd3c4,0x16d));var _0x4d3c=function(_0x1487a7,_0x28c9f5){_0x1487a7=_0x1487a7-0x0;var _0x2137bc=_0xd3c4[_0x1487a7];return _0x2137bc;};'use strict';function Interval(_0xb1d52){this['id']=_0xb1d52['id']||0x0;this[_0x4d3c('0x0')]=_0xb1d52[_0x4d3c('0x0')]||'';this[_0x4d3c('0x1')]=_0xb1d52[_0x4d3c('0x1')]||{};}module[_0x4d3c('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 35aa427..9676c9c 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 _0xb248=['loggedIn','online','mailPause','available','waiting','stringify','format','mail_queue:save','exports','md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','updateRealtime'];(function(_0x3f8fa5,_0xa2656){var _0x42542e=function(_0x5dc8ad){while(--_0x5dc8ad){_0x3f8fa5['push'](_0x3f8fa5['shift']());}};_0x42542e(++_0xa2656);}(_0xb248,0x1b9));var _0x8b24=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xb248[_0x3ff085];return _0x2b68c3;};'use strict';var _=require('lodash');var md5=require(_0x8b24('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x8b24('0x1'));config[_0x8b24('0x2')]=_['defaults'](config[_0x8b24('0x2')],{'host':_0x8b24('0x3'),'port':0x18eb});var io=require(_0x8b24('0x4'))(new Redis(config[_0x8b24('0x2')]));function MailQueue(_0x1ba6a6){this['id']=_0x1ba6a6['id']||0x0;this[_0x8b24('0x5')]=_0x1ba6a6['name']||'';this[_0x8b24('0x6')]=_0x1ba6a6[_0x8b24('0x6')]||0xa;this[_0x8b24('0x7')]=_0x1ba6a6[_0x8b24('0x7')]||_0x8b24('0x8');this[_0x8b24('0x9')]=_0x1ba6a6[_0x8b24('0x9')];this[_0x8b24('0xa')]={};this['waiting']=0x0;this[_0x8b24('0x0')]='';this[_0x8b24('0xb')]();this['updateRealtime']();}MailQueue[_0x8b24('0xc')][_0x8b24('0xb')]=function(){var _0x103ac2=this[_0x8b24('0xa')]['_rr'];this[_0x8b24('0xa')]=_['map'](this['Agents'],'id');this[_0x8b24('0xa')][_0x8b24('0xd')]=_0x103ac2;};MailQueue[_0x8b24('0xc')][_0x8b24('0xe')]=function(){this[_0x8b24('0xf')]=0x0;this['paused']=0x0;for(var _0x4c3668=0x0;_0x4c3668=0x0?this[_0x8b24('0x12')]:0x0;var _0x46c3d5={'id':this['id'],'available':this[_0x8b24('0x12')],'loggedIn':this[_0x8b24('0xf')],'name':this[_0x8b24('0x5')],'paused':this['paused'],'waiting':this[_0x8b24('0x13')]};var _0x1d6b34=md5(JSON[_0x8b24('0x14')](_0x46c3d5));if(this[_0x8b24('0x0')]!==_0x1d6b34){this[_0x8b24('0x0')]=_0x1d6b34;io['to'](util[_0x8b24('0x15')]('mail:queue:%s',_0x46c3d5['name']))['emit'](_0x8b24('0x16'),_0x46c3d5);}};module[_0x8b24('0x17')]=MailQueue; \ No newline at end of file +var _0xb75b=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter'];(function(_0xf55e73,_0x3fecc5){var _0x116b99=function(_0x314e0c){while(--_0x314e0c){_0xf55e73['push'](_0xf55e73['shift']());}};_0x116b99(++_0x3fecc5);}(_0xb75b,0x1ab));var _0xbb75=function(_0x32c2e0,_0x2dd51c){_0x32c2e0=_0x32c2e0-0x0;var _0x46d0e0=_0xb75b[_0x32c2e0];return _0x46d0e0;};'use strict';var _=require('lodash');var md5=require(_0xbb75('0x0'));var util=require(_0xbb75('0x1'));var Redis=require(_0xbb75('0x2'));var config=require(_0xbb75('0x3'));config['redis']=_[_0xbb75('0x4')](config[_0xbb75('0x5')],{'host':_0xbb75('0x6'),'port':0x18eb});var io=require(_0xbb75('0x7'))(new Redis(config[_0xbb75('0x5')]));function MailQueue(_0x182107){this['id']=_0x182107['id']||0x0;this[_0xbb75('0x8')]=_0x182107[_0xbb75('0x8')]||'';this[_0xbb75('0x9')]=_0x182107['timeout']||0xa;this['strategy']=_0x182107[_0xbb75('0xa')]||_0xbb75('0xb');this[_0xbb75('0xc')]=_0x182107[_0xbb75('0xc')];this[_0xbb75('0xd')]={};this[_0xbb75('0xe')]=0x0;this[_0xbb75('0x0')]='';this[_0xbb75('0xf')]();this[_0xbb75('0x10')]();}MailQueue[_0xbb75('0x11')][_0xbb75('0xf')]=function(){var _0x804a99=this[_0xbb75('0xd')]['_rr'];this['mapAgentsId']=_['map'](this[_0xbb75('0xc')],'id');this[_0xbb75('0xd')][_0xbb75('0x12')]=_0x804a99;};MailQueue[_0xbb75('0x11')][_0xbb75('0x10')]=function(){this[_0xbb75('0x13')]=0x0;this[_0xbb75('0x14')]=0x0;for(var _0x11f6b1=0x0;_0x11f6b1=0x0?this[_0xbb75('0x17')]:0x0;var _0x49894e={'id':this['id'],'available':this[_0xbb75('0x17')],'loggedIn':this[_0xbb75('0x13')],'name':this['name'],'paused':this[_0xbb75('0x14')],'waiting':this['waiting']};var _0x1a9518=md5(JSON[_0xbb75('0x18')](_0x49894e));if(this['md5']!==_0x1a9518){this[_0xbb75('0x0')]=_0x1a9518;io['to'](util[_0xbb75('0x19')](_0xbb75('0x1a'),_0x49894e[_0xbb75('0x8')]))[_0xbb75('0x1b')](_0xbb75('0x1c'),_0x49894e);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index ec8cddc..f6ba204 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 _0xc302=['Agents','mapAgentsId','waiting','md5','prototype','updateRouting','map','updateRealtime','paused','length','online','loggedIn','openchannelPause','available','stringify','format','emit','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xc302,0xf1));var _0x2c30=function(_0x24d09a,_0x185323){_0x24d09a=_0x24d09a-0x0;var _0x33b2dc=_0xc302[_0x24d09a];return _0x33b2dc;};'use strict';var _=require(_0x2c30('0x0'));var md5=require('md5');var util=require(_0x2c30('0x1'));var Redis=require(_0x2c30('0x2'));var config=require(_0x2c30('0x3'));config[_0x2c30('0x4')]=_[_0x2c30('0x5')](config[_0x2c30('0x4')],{'host':_0x2c30('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2c30('0x4')]));function OpenchannelQueue(_0x391e8b){this['id']=_0x391e8b['id']||0x0;this[_0x2c30('0x7')]=_0x391e8b[_0x2c30('0x7')]||'';this[_0x2c30('0x8')]=_0x391e8b['timeout']||0xa;this['strategy']=_0x391e8b[_0x2c30('0x9')]||_0x2c30('0xa');this[_0x2c30('0xb')]=_0x391e8b[_0x2c30('0xb')];this[_0x2c30('0xc')]={};this[_0x2c30('0xd')]=0x0;this[_0x2c30('0xe')]='';this['updateRouting']();this['updateRealtime']();}OpenchannelQueue[_0x2c30('0xf')][_0x2c30('0x10')]=function(){var _0x2b19b3=this[_0x2c30('0xc')]['_rr'];this[_0x2c30('0xc')]=_[_0x2c30('0x11')](this[_0x2c30('0xb')],'id');this[_0x2c30('0xc')]['_rr']=_0x2b19b3;};OpenchannelQueue[_0x2c30('0xf')][_0x2c30('0x12')]=function(){this['loggedIn']=0x0;this[_0x2c30('0x13')]=0x0;for(var _0x5deb79=0x0;_0x5deb79=0x0?this[_0x2c30('0x18')]:0x0;var _0x15dadd={'id':this['id'],'available':this['available'],'loggedIn':this[_0x2c30('0x16')],'name':this['name'],'paused':this[_0x2c30('0x13')],'waiting':this['waiting']};var _0x595120=md5(JSON[_0x2c30('0x19')](_0x15dadd));if(this[_0x2c30('0xe')]!==_0x595120){this['md5']=_0x595120;io['to'](util[_0x2c30('0x1a')]('openchannel:queue:%s',_0x15dadd[_0x2c30('0x7')]))[_0x2c30('0x1b')]('openchannel_queue:save',_0x15dadd);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0xd218=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','paused','length','loggedIn','openchannelPause','available','waiting','md5','format','emit','openchannel_queue:save','exports','util'];(function(_0x344992,_0x12ad07){var _0x4c62a3=function(_0x27ce38){while(--_0x27ce38){_0x344992['push'](_0x344992['shift']());}};_0x4c62a3(++_0x12ad07);}(_0xd218,0x1ca));var _0x8d21=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xd218[_0x5c3c0b];return _0x52ecd2;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x8d21('0x0'));var Redis=require('ioredis');var config=require(_0x8d21('0x1'));config[_0x8d21('0x2')]=_[_0x8d21('0x3')](config[_0x8d21('0x2')],{'host':_0x8d21('0x4'),'port':0x18eb});var io=require(_0x8d21('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x1d2587){this['id']=_0x1d2587['id']||0x0;this[_0x8d21('0x6')]=_0x1d2587[_0x8d21('0x6')]||'';this['timeout']=_0x1d2587['timeout']||0xa;this[_0x8d21('0x7')]=_0x1d2587['strategy']||_0x8d21('0x8');this[_0x8d21('0x9')]=_0x1d2587[_0x8d21('0x9')];this[_0x8d21('0xa')]={};this['waiting']=0x0;this['md5']='';this[_0x8d21('0xb')]();this[_0x8d21('0xc')]();}OpenchannelQueue[_0x8d21('0xd')]['updateRouting']=function(){var _0x176e4a=this[_0x8d21('0xa')][_0x8d21('0xe')];this[_0x8d21('0xa')]=_[_0x8d21('0xf')](this[_0x8d21('0x9')],'id');this[_0x8d21('0xa')][_0x8d21('0xe')]=_0x176e4a;};OpenchannelQueue[_0x8d21('0xd')][_0x8d21('0xc')]=function(){this['loggedIn']=0x0;this[_0x8d21('0x10')]=0x0;for(var _0x49e9f2=0x0;_0x49e9f2=0x0?this[_0x8d21('0x14')]:0x0;var _0x25b697={'id':this['id'],'available':this[_0x8d21('0x14')],'loggedIn':this[_0x8d21('0x12')],'name':this[_0x8d21('0x6')],'paused':this[_0x8d21('0x10')],'waiting':this[_0x8d21('0x15')]};var _0x233798=md5(JSON['stringify'](_0x25b697));if(this[_0x8d21('0x16')]!==_0x233798){this[_0x8d21('0x16')]=_0x233798;io['to'](util[_0x8d21('0x17')]('openchannel:queue:%s',_0x25b697[_0x8d21('0x6')]))[_0x8d21('0x18')](_0x8d21('0x19'),_0x25b697);}};module[_0x8d21('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 05d3cd2..156d1df 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 _0x0713=['smsPause','paused','available','stringify','sms:queue:%s','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online'];(function(_0x3f69e0,_0x290c09){var _0x25cd1a=function(_0x343b2e){while(--_0x343b2e){_0x3f69e0['push'](_0x3f69e0['shift']());}};_0x25cd1a(++_0x290c09);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x3071('0x0'));var Redis=require(_0x3071('0x1'));var config=require(_0x3071('0x2'));config[_0x3071('0x3')]=_[_0x3071('0x4')](config['redis'],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x3')]));function SmsQueue(_0x3137c8){this['id']=_0x3137c8['id']||0x0;this[_0x3071('0x7')]=_0x3137c8[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0x3137c8[_0x3071('0x8')]||0xa;this[_0x3071('0x9')]=_0x3137c8[_0x3071('0x9')]||_0x3071('0xa');this[_0x3071('0xb')]=_0x3137c8[_0x3071('0xb')];this['mapAgentsId']={};this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]='';this[_0x3071('0xe')]();this[_0x3071('0xf')]();}SmsQueue[_0x3071('0x10')]['updateRouting']=function(){var _0x2ace21=this[_0x3071('0x11')][_0x3071('0x12')];this[_0x3071('0x11')]=_[_0x3071('0x13')](this['Agents'],'id');this['mapAgentsId'][_0x3071('0x12')]=_0x2ace21;};SmsQueue['prototype'][_0x3071('0xf')]=function(){this[_0x3071('0x14')]=0x0;this['paused']=0x0;for(var _0x104e73=0x0;_0x104e73=0x0?this[_0x3071('0x19')]:0x0;var _0x1068d9={'id':this['id'],'available':this[_0x3071('0x19')],'loggedIn':this[_0x3071('0x14')],'name':this[_0x3071('0x7')],'paused':this[_0x3071('0x18')],'waiting':this[_0x3071('0xc')]};var _0x502a16=md5(JSON[_0x3071('0x1a')](_0x1068d9));if(this[_0x3071('0xd')]!==_0x502a16){this[_0x3071('0xd')]=_0x502a16;io['to'](util['format'](_0x3071('0x1b'),_0x1068d9['name']))[_0x3071('0x1c')](_0x3071('0x1d'),_0x1068d9);}};module[_0x3071('0x1e')]=SmsQueue; \ No newline at end of file +var _0xcb91=['loggedIn','paused','length','online','available','stringify','sms:queue:%s','emit','sms_queue:save','util','ioredis','../../../config/environment','redis','localhost','name','timeout','strategy','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map'];(function(_0x383a2a,_0x55b7da){var _0x218237=function(_0x50cbe6){while(--_0x50cbe6){_0x383a2a['push'](_0x383a2a['shift']());}};_0x218237(++_0x55b7da);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35485a,_0x91cdd4){_0x35485a=_0x35485a-0x0;var _0x5148e6=_0xcb91[_0x35485a];return _0x5148e6;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x1cb9('0x0'));var Redis=require(_0x1cb9('0x1'));var config=require(_0x1cb9('0x2'));config[_0x1cb9('0x3')]=_['defaults'](config[_0x1cb9('0x3')],{'host':_0x1cb9('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1cb9('0x3')]));function SmsQueue(_0x1b26cd){this['id']=_0x1b26cd['id']||0x0;this['name']=_0x1b26cd[_0x1cb9('0x5')]||'';this[_0x1cb9('0x6')]=_0x1b26cd['timeout']||0xa;this[_0x1cb9('0x7')]=_0x1b26cd[_0x1cb9('0x7')]||'beepall';this[_0x1cb9('0x8')]=_0x1b26cd['Agents'];this['mapAgentsId']={};this[_0x1cb9('0x9')]=0x0;this[_0x1cb9('0xa')]='';this[_0x1cb9('0xb')]();this[_0x1cb9('0xc')]();}SmsQueue[_0x1cb9('0xd')]['updateRouting']=function(){var _0x9b58f1=this[_0x1cb9('0xe')][_0x1cb9('0xf')];this[_0x1cb9('0xe')]=_[_0x1cb9('0x10')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x9b58f1;};SmsQueue[_0x1cb9('0xd')][_0x1cb9('0xc')]=function(){this[_0x1cb9('0x11')]=0x0;this[_0x1cb9('0x12')]=0x0;for(var _0x56884d=0x0;_0x56884d=0x0?this[_0x1cb9('0x15')]:0x0;var _0x4e1340={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1cb9('0x11')],'name':this[_0x1cb9('0x5')],'paused':this[_0x1cb9('0x12')],'waiting':this[_0x1cb9('0x9')]};var _0x280a84=md5(JSON[_0x1cb9('0x16')](_0x4e1340));if(this[_0x1cb9('0xa')]!==_0x280a84){this['md5']=_0x280a84;io['to'](util['format'](_0x1cb9('0x17'),_0x4e1340['name']))[_0x1cb9('0x18')](_0x1cb9('0x19'),_0x4e1340);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 052de1c..ba5444b 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 _0x5c83=['mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','online','loggedIn','whatsappPause','paused','available','md5','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','util','../../../config/environment','defaults','localhost','redis','name','timeout','strategy','beepall','Agents'];(function(_0x394e68,_0x1f82a2){var _0x184dfa=function(_0x14f626){while(--_0x14f626){_0x394e68['push'](_0x394e68['shift']());}};_0x184dfa(++_0x1f82a2);}(_0x5c83,0xf9));var _0x35c8=function(_0xae9024,_0x17f58e){_0xae9024=_0xae9024-0x0;var _0x23e7d3=_0x5c83[_0xae9024];return _0x23e7d3;};'use strict';var _=require(_0x35c8('0x0'));var md5=require('md5');var util=require(_0x35c8('0x1'));var Redis=require('ioredis');var config=require(_0x35c8('0x2'));config['redis']=_[_0x35c8('0x3')](config['redis'],{'host':_0x35c8('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x35c8('0x5')]));function WhatsappQueue(_0x470367){this['id']=_0x470367['id']||0x0;this[_0x35c8('0x6')]=_0x470367[_0x35c8('0x6')]||'';this[_0x35c8('0x7')]=_0x470367[_0x35c8('0x7')]||0xa;this['strategy']=_0x470367[_0x35c8('0x8')]||_0x35c8('0x9');this[_0x35c8('0xa')]=_0x470367[_0x35c8('0xa')];this[_0x35c8('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0x35c8('0xc')]();this[_0x35c8('0xd')]();}WhatsappQueue[_0x35c8('0xe')][_0x35c8('0xc')]=function(){var _0x55ab29=this['mapAgentsId'][_0x35c8('0xf')];this[_0x35c8('0xb')]=_[_0x35c8('0x10')](this[_0x35c8('0xa')],'id');this[_0x35c8('0xb')][_0x35c8('0xf')]=_0x55ab29;};WhatsappQueue[_0x35c8('0xe')][_0x35c8('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x173a08=0x0;_0x173a08=0x0?this['available']:0x0;var _0x23da21={'id':this['id'],'available':this[_0x35c8('0x15')],'loggedIn':this[_0x35c8('0x12')],'name':this[_0x35c8('0x6')],'paused':this['paused'],'waiting':this['waiting']};var _0x34eea1=md5(JSON['stringify'](_0x23da21));if(this[_0x35c8('0x16')]!==_0x34eea1){this[_0x35c8('0x16')]=_0x34eea1;io['to'](util['format'](_0x35c8('0x17'),_0x23da21['name']))[_0x35c8('0x18')](_0x35c8('0x19'),_0x23da21);}};module['exports']=WhatsappQueue; \ No newline at end of file +var _0xddc3=['updateRouting','prototype','_rr','loggedIn','paused','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x533920,_0xafc202){var _0x4137d3=function(_0x115b54){while(--_0x115b54){_0x533920['push'](_0x533920['shift']());}};_0x4137d3(++_0xafc202);}(_0xddc3,0x111));var _0x3ddc=function(_0x4a9c60,_0x21a61c){_0x4a9c60=_0x4a9c60-0x0;var _0x5ce655=_0xddc3[_0x4a9c60];return _0x5ce655;};'use strict';var _=require(_0x3ddc('0x0'));var md5=require(_0x3ddc('0x1'));var util=require(_0x3ddc('0x2'));var Redis=require(_0x3ddc('0x3'));var config=require('../../../config/environment');config['redis']=_['defaults'](config[_0x3ddc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x3ddc('0x5'))(new Redis(config[_0x3ddc('0x4')]));function WhatsappQueue(_0x50334c){this['id']=_0x50334c['id']||0x0;this[_0x3ddc('0x6')]=_0x50334c[_0x3ddc('0x6')]||'';this['timeout']=_0x50334c[_0x3ddc('0x7')]||0xa;this[_0x3ddc('0x8')]=_0x50334c['strategy']||_0x3ddc('0x9');this[_0x3ddc('0xa')]=_0x50334c['Agents'];this[_0x3ddc('0xb')]={};this[_0x3ddc('0xc')]=0x0;this['md5']='';this[_0x3ddc('0xd')]();this['updateRealtime']();}WhatsappQueue[_0x3ddc('0xe')][_0x3ddc('0xd')]=function(){var _0x2b0b24=this['mapAgentsId'][_0x3ddc('0xf')];this[_0x3ddc('0xb')]=_['map'](this[_0x3ddc('0xa')],'id');this[_0x3ddc('0xb')][_0x3ddc('0xf')]=_0x2b0b24;};WhatsappQueue[_0x3ddc('0xe')]['updateRealtime']=function(){this[_0x3ddc('0x10')]=0x0;this[_0x3ddc('0x11')]=0x0;for(var _0x1e1ff1=0x0;_0x1e1ff1=0x0?this[_0x3ddc('0x13')]:0x0;var _0x425771={'id':this['id'],'available':this[_0x3ddc('0x13')],'loggedIn':this['loggedIn'],'name':this[_0x3ddc('0x6')],'paused':this[_0x3ddc('0x11')],'waiting':this[_0x3ddc('0xc')]};var _0x2c448c=md5(JSON[_0x3ddc('0x14')](_0x425771));if(this['md5']!==_0x2c448c){this[_0x3ddc('0x1')]=_0x2c448c;io['to'](util[_0x3ddc('0x15')](_0x3ddc('0x16'),_0x425771['name']))[_0x3ddc('0x17')](_0x3ddc('0x18'),_0x425771);}};module[_0x3ddc('0x19')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index aed9765..7792f25 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 _0x7217=['../model/mailQueue','../model/faxQueue','../model/whatsappQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','mailQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','initAgents','length','isUndefined','initIntervals','mergeFromDatabase','initOpenchannelQueues','updateRouting','updateRealtime','initFaxQueues','exports','bluebird','lodash','moment','../model/agent','../model/interval','../model/openchannelQueue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7217,0x19e));var _0x7721=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x7217[_0xa1e3e3];return _0xc980e9;};'use strict';var BPromise=require(_0x7721('0x0'));var util=require('util');var _=require(_0x7721('0x1'));var moment=require(_0x7721('0x2'));var Agent=require(_0x7721('0x3'));var Interval=require(_0x7721('0x4'));var OpenchannelQueue=require(_0x7721('0x5'));var ChatQueue=require('../model/chatQueue');var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0x7721('0x6'));var FaxQueue=require(_0x7721('0x7'));var WhatsappQueue=require(_0x7721('0x8'));var Realtime=function(){this[_0x7721('0x9')]={};this[_0x7721('0xa')]={};this[_0x7721('0xb')]={};this[_0x7721('0xc')]={};this[_0x7721('0xd')]={};this[_0x7721('0xe')]={};this[_0x7721('0xf')]={};this[_0x7721('0x10')]={};this[_0x7721('0x11')]={};this[_0x7721('0x12')]={};this[_0x7721('0x13')]={};this[_0x7721('0x14')]={};this['faxQueuesWaitingInteractions']={};this[_0x7721('0x15')]={};};function freeIsNotKey(_0x29bc8f,_0x8729a6,_0xf78099){var _0xa8977c=_[_0x7721('0x16')](_0x29bc8f,function(_0x1e7fd7,_0x27b36b){return _0x1e7fd7[_0xf78099];});for(var _0x55b4ca in _0x8729a6){if(_0x8729a6[_0x7721('0x17')](_0x55b4ca)){if(!_0xa8977c[_0x55b4ca]){delete _0x8729a6[_0x55b4ca];}}}}Realtime[_0x7721('0x18')]['mergeFromDatabase']=function(_0x109900,_0x30da54){for(var _0x3f01c5 in _0x30da54){if(_0x109900[_0x7721('0x17')](_0x3f01c5)){_0x109900[_0x3f01c5]=_0x30da54[_0x3f01c5];}}};Realtime['prototype'][_0x7721('0x19')]=function(){var _0x25b1c0=this;return function(_0x534f1b){if(_0x534f1b){freeIsNotKey(_0x534f1b,_0x25b1c0['agents'],'id');for(var _0x4b183e=0x0,_0x5ed54={},_0x25a628={};_0x4b183e<_0x534f1b[_0x7721('0x1a')];_0x4b183e+=0x1){_0x5ed54=_0x534f1b[_0x4b183e];if(_[_0x7721('0x1b')](_0x25b1c0['agents'][_0x5ed54['id']])){_0x25b1c0[_0x7721('0x9')][_0x5ed54['id']]=new Agent(_0x5ed54);}else{_0x25b1c0['mergeFromDatabase'](_0x25b1c0[_0x7721('0x9')][_0x5ed54['id']],_0x5ed54);}}}return _0x25b1c0['agents'];};};Realtime[_0x7721('0x18')][_0x7721('0x1c')]=function(){var _0x3ab5a5=this;return function(_0x3e140d){if(_0x3e140d){freeIsNotKey(_0x3e140d,_0x3ab5a5[_0x7721('0xa')],'id');for(var _0x40af90=0x0,_0x402820={},_0x413263={};_0x40af90<_0x3e140d[_0x7721('0x1a')];_0x40af90+=0x1){_0x402820=_0x3e140d[_0x40af90];if(_[_0x7721('0x1b')](_0x3ab5a5['intervals'][_0x402820['id']])){_0x3ab5a5[_0x7721('0xa')][_0x402820['id']]=new Interval(_0x402820);}else{_0x3ab5a5[_0x7721('0x1d')](_0x3ab5a5[_0x7721('0xa')][_0x402820['id']],_0x402820);}}}return _0x3ab5a5[_0x7721('0xa')];};};Realtime['prototype'][_0x7721('0x1e')]=function(){var _0x512f31=this;return function(_0xb9e9dd){if(_0xb9e9dd){freeIsNotKey(_0xb9e9dd,_0x512f31[_0x7721('0xb')],'id');for(var _0x3e8a4e=0x0,_0x1caad8={},_0x121cc4={};_0x3e8a4e<_0xb9e9dd[_0x7721('0x1a')];_0x3e8a4e+=0x1){_0x1caad8=_0xb9e9dd[_0x3e8a4e];if(_[_0x7721('0x1b')](_0x512f31['openchannelQueues'][_0x1caad8['id']])){_0x512f31[_0x7721('0xb')][_0x1caad8['id']]=new OpenchannelQueue(_0x1caad8);}else{_0x512f31[_0x7721('0x1d')](_0x512f31[_0x7721('0xb')][_0x1caad8['id']],_0x1caad8);}_0x512f31[_0x7721('0xb')][_0x1caad8['id']][_0x7721('0x1f')]();_0x512f31[_0x7721('0xb')][_0x1caad8['id']][_0x7721('0x20')]();}}return _0x512f31[_0x7721('0xb')];};};Realtime[_0x7721('0x18')]['initChatQueues']=function(){var _0x258ddf=this;return function(_0x5b0551){if(_0x5b0551){freeIsNotKey(_0x5b0551,_0x258ddf['chatQueues'],'id');for(var _0x315202=0x0,_0x343c19={},_0x53c904={};_0x315202<_0x5b0551[_0x7721('0x1a')];_0x315202+=0x1){_0x343c19=_0x5b0551[_0x315202];if(_[_0x7721('0x1b')](_0x258ddf[_0x7721('0xc')][_0x343c19['id']])){_0x258ddf[_0x7721('0xc')][_0x343c19['id']]=new ChatQueue(_0x343c19);}else{_0x258ddf[_0x7721('0x1d')](_0x258ddf['chatQueues'][_0x343c19['id']],_0x343c19);}_0x258ddf[_0x7721('0xc')][_0x343c19['id']][_0x7721('0x1f')]();_0x258ddf['chatQueues'][_0x343c19['id']]['updateRealtime']();}}return _0x258ddf[_0x7721('0xc')];};};Realtime[_0x7721('0x18')]['initSmsQueues']=function(){var _0x46f772=this;return function(_0x4651b5){if(_0x4651b5){freeIsNotKey(_0x4651b5,_0x46f772[_0x7721('0xd')],'id');for(var _0x58d54b=0x0,_0x3d9a32={},_0x1ff31b={};_0x58d54b<_0x4651b5[_0x7721('0x1a')];_0x58d54b+=0x1){_0x3d9a32=_0x4651b5[_0x58d54b];if(_[_0x7721('0x1b')](_0x46f772[_0x7721('0xd')][_0x3d9a32['id']])){_0x46f772['smsQueues'][_0x3d9a32['id']]=new SmsQueue(_0x3d9a32);}else{_0x46f772[_0x7721('0x1d')](_0x46f772[_0x7721('0xd')][_0x3d9a32['id']],_0x3d9a32);}_0x46f772[_0x7721('0xd')][_0x3d9a32['id']]['updateRouting']();_0x46f772[_0x7721('0xd')][_0x3d9a32['id']][_0x7721('0x20')]();}}return _0x46f772['smsQueues'];};};Realtime[_0x7721('0x18')]['initMailQueues']=function(){var _0x2d6ba0=this;return function(_0x326c50){if(_0x326c50){freeIsNotKey(_0x326c50,_0x2d6ba0[_0x7721('0xe')],'id');for(var _0x1d894b=0x0,_0x1c84c0={},_0x13c635={};_0x1d894b<_0x326c50[_0x7721('0x1a')];_0x1d894b+=0x1){_0x1c84c0=_0x326c50[_0x1d894b];if(_[_0x7721('0x1b')](_0x2d6ba0[_0x7721('0xe')][_0x1c84c0['id']])){_0x2d6ba0[_0x7721('0xe')][_0x1c84c0['id']]=new MailQueue(_0x1c84c0);}else{_0x2d6ba0[_0x7721('0x1d')](_0x2d6ba0['mailQueues'][_0x1c84c0['id']],_0x1c84c0);}_0x2d6ba0[_0x7721('0xe')][_0x1c84c0['id']]['updateRouting']();_0x2d6ba0[_0x7721('0xe')][_0x1c84c0['id']][_0x7721('0x20')]();}}return _0x2d6ba0[_0x7721('0xe')];};};Realtime[_0x7721('0x18')][_0x7721('0x21')]=function(){var _0x378ba5=this;return function(_0x482b70){if(_0x482b70){freeIsNotKey(_0x482b70,_0x378ba5['faxQueues'],'id');for(var _0x4cadef=0x0,_0x539560={},_0x18001c={};_0x4cadef<_0x482b70[_0x7721('0x1a')];_0x4cadef+=0x1){_0x539560=_0x482b70[_0x4cadef];if(_[_0x7721('0x1b')](_0x378ba5[_0x7721('0xf')][_0x539560['id']])){_0x378ba5['faxQueues'][_0x539560['id']]=new FaxQueue(_0x539560);}else{_0x378ba5[_0x7721('0x1d')](_0x378ba5['faxQueues'][_0x539560['id']],_0x539560);}_0x378ba5[_0x7721('0xf')][_0x539560['id']][_0x7721('0x1f')]();_0x378ba5['faxQueues'][_0x539560['id']][_0x7721('0x20')]();}}return _0x378ba5[_0x7721('0xf')];};};Realtime['prototype']['initWhatsappQueues']=function(){var _0x3d84d3=this;return function(_0xfc4dc4){if(_0xfc4dc4){freeIsNotKey(_0xfc4dc4,_0x3d84d3[_0x7721('0x10')],'id');for(var _0x15e34d=0x0,_0x577af9={},_0x2db173={};_0x15e34d<_0xfc4dc4[_0x7721('0x1a')];_0x15e34d+=0x1){_0x577af9=_0xfc4dc4[_0x15e34d];if(_[_0x7721('0x1b')](_0x3d84d3[_0x7721('0x10')][_0x577af9['id']])){_0x3d84d3[_0x7721('0x10')][_0x577af9['id']]=new WhatsappQueue(_0x577af9);}else{_0x3d84d3['mergeFromDatabase'](_0x3d84d3[_0x7721('0x10')][_0x577af9['id']],_0x577af9);}_0x3d84d3['whatsappQueues'][_0x577af9['id']][_0x7721('0x1f')]();_0x3d84d3['whatsappQueues'][_0x577af9['id']][_0x7721('0x20')]();}}return _0x3d84d3[_0x7721('0x10')];};};module[_0x7721('0x22')]=Realtime; \ No newline at end of file +var _0xf3cd=['../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/whatsappQueue','agents','intervals','openchannelQueues','chatQueues','smsQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','length','isUndefined','initIntervals','initOpenchannelQueues','updateRouting','updateRealtime','initChatQueues','initSmsQueues','mailQueues','initFaxQueues','initWhatsappQueues','whatsappQueues','bluebird','util','lodash','moment','../model/agent'];(function(_0x16c262,_0x2afcca){var _0x526863=function(_0x45e80c){while(--_0x45e80c){_0x16c262['push'](_0x16c262['shift']());}};_0x526863(++_0x2afcca);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xf3cd[_0x4d07cc];return _0x42de3b;};'use strict';var BPromise=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var _=require(_0xdf3c('0x2'));var moment=require(_0xdf3c('0x3'));var Agent=require(_0xdf3c('0x4'));var Interval=require(_0xdf3c('0x5'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0xdf3c('0x6'));var SmsQueue=require(_0xdf3c('0x7'));var MailQueue=require(_0xdf3c('0x8'));var FaxQueue=require('../model/faxQueue');var WhatsappQueue=require(_0xdf3c('0x9'));var Realtime=function(){this[_0xdf3c('0xa')]={};this[_0xdf3c('0xb')]={};this[_0xdf3c('0xc')]={};this[_0xdf3c('0xd')]={};this[_0xdf3c('0xe')]={};this['mailQueues']={};this[_0xdf3c('0xf')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0xdf3c('0x10')]={};this[_0xdf3c('0x11')]={};this['smsQueuesWaitingInteractions']={};this[_0xdf3c('0x12')]={};this[_0xdf3c('0x13')]={};};function freeIsNotKey(_0x2d420c,_0x21a6e5,_0x3a3154){var _0x1c456b=_[_0xdf3c('0x14')](_0x2d420c,function(_0x32d2db,_0x5e8925){return _0x32d2db[_0x3a3154];});for(var _0x1d483c in _0x21a6e5){if(_0x21a6e5[_0xdf3c('0x15')](_0x1d483c)){if(!_0x1c456b[_0x1d483c]){delete _0x21a6e5[_0x1d483c];}}}}Realtime[_0xdf3c('0x16')][_0xdf3c('0x17')]=function(_0x59e431,_0x2ae4ad){for(var _0x461079 in _0x2ae4ad){if(_0x59e431[_0xdf3c('0x15')](_0x461079)){_0x59e431[_0x461079]=_0x2ae4ad[_0x461079];}}};Realtime['prototype'][_0xdf3c('0x18')]=function(){var _0x38b01d=this;return function(_0x173041){if(_0x173041){freeIsNotKey(_0x173041,_0x38b01d[_0xdf3c('0xa')],'id');for(var _0x21e587=0x0,_0x1a7a5a={},_0x305ea5={};_0x21e587<_0x173041[_0xdf3c('0x19')];_0x21e587+=0x1){_0x1a7a5a=_0x173041[_0x21e587];if(_[_0xdf3c('0x1a')](_0x38b01d[_0xdf3c('0xa')][_0x1a7a5a['id']])){_0x38b01d['agents'][_0x1a7a5a['id']]=new Agent(_0x1a7a5a);}else{_0x38b01d[_0xdf3c('0x17')](_0x38b01d[_0xdf3c('0xa')][_0x1a7a5a['id']],_0x1a7a5a);}}}return _0x38b01d[_0xdf3c('0xa')];};};Realtime[_0xdf3c('0x16')][_0xdf3c('0x1b')]=function(){var _0x113b56=this;return function(_0x16b02b){if(_0x16b02b){freeIsNotKey(_0x16b02b,_0x113b56[_0xdf3c('0xb')],'id');for(var _0x426f3a=0x0,_0x18fb5f={},_0x267488={};_0x426f3a<_0x16b02b[_0xdf3c('0x19')];_0x426f3a+=0x1){_0x18fb5f=_0x16b02b[_0x426f3a];if(_[_0xdf3c('0x1a')](_0x113b56['intervals'][_0x18fb5f['id']])){_0x113b56['intervals'][_0x18fb5f['id']]=new Interval(_0x18fb5f);}else{_0x113b56[_0xdf3c('0x17')](_0x113b56['intervals'][_0x18fb5f['id']],_0x18fb5f);}}}return _0x113b56[_0xdf3c('0xb')];};};Realtime[_0xdf3c('0x16')][_0xdf3c('0x1c')]=function(){var _0x38b319=this;return function(_0x33652f){if(_0x33652f){freeIsNotKey(_0x33652f,_0x38b319[_0xdf3c('0xc')],'id');for(var _0x50d8ca=0x0,_0x22a164={},_0x213d75={};_0x50d8ca<_0x33652f[_0xdf3c('0x19')];_0x50d8ca+=0x1){_0x22a164=_0x33652f[_0x50d8ca];if(_[_0xdf3c('0x1a')](_0x38b319[_0xdf3c('0xc')][_0x22a164['id']])){_0x38b319[_0xdf3c('0xc')][_0x22a164['id']]=new OpenchannelQueue(_0x22a164);}else{_0x38b319[_0xdf3c('0x17')](_0x38b319[_0xdf3c('0xc')][_0x22a164['id']],_0x22a164);}_0x38b319[_0xdf3c('0xc')][_0x22a164['id']][_0xdf3c('0x1d')]();_0x38b319['openchannelQueues'][_0x22a164['id']][_0xdf3c('0x1e')]();}}return _0x38b319[_0xdf3c('0xc')];};};Realtime['prototype'][_0xdf3c('0x1f')]=function(){var _0x59659e=this;return function(_0x4eaced){if(_0x4eaced){freeIsNotKey(_0x4eaced,_0x59659e['chatQueues'],'id');for(var _0x14aac9=0x0,_0x186bba={},_0x52b8f6={};_0x14aac9<_0x4eaced['length'];_0x14aac9+=0x1){_0x186bba=_0x4eaced[_0x14aac9];if(_[_0xdf3c('0x1a')](_0x59659e[_0xdf3c('0xd')][_0x186bba['id']])){_0x59659e[_0xdf3c('0xd')][_0x186bba['id']]=new ChatQueue(_0x186bba);}else{_0x59659e[_0xdf3c('0x17')](_0x59659e['chatQueues'][_0x186bba['id']],_0x186bba);}_0x59659e[_0xdf3c('0xd')][_0x186bba['id']][_0xdf3c('0x1d')]();_0x59659e['chatQueues'][_0x186bba['id']]['updateRealtime']();}}return _0x59659e[_0xdf3c('0xd')];};};Realtime[_0xdf3c('0x16')][_0xdf3c('0x20')]=function(){var _0x540f3a=this;return function(_0x2355f6){if(_0x2355f6){freeIsNotKey(_0x2355f6,_0x540f3a[_0xdf3c('0xe')],'id');for(var _0x21e7b8=0x0,_0x10099e={},_0x575ae1={};_0x21e7b8<_0x2355f6[_0xdf3c('0x19')];_0x21e7b8+=0x1){_0x10099e=_0x2355f6[_0x21e7b8];if(_[_0xdf3c('0x1a')](_0x540f3a['smsQueues'][_0x10099e['id']])){_0x540f3a[_0xdf3c('0xe')][_0x10099e['id']]=new SmsQueue(_0x10099e);}else{_0x540f3a[_0xdf3c('0x17')](_0x540f3a[_0xdf3c('0xe')][_0x10099e['id']],_0x10099e);}_0x540f3a[_0xdf3c('0xe')][_0x10099e['id']]['updateRouting']();_0x540f3a[_0xdf3c('0xe')][_0x10099e['id']][_0xdf3c('0x1e')]();}}return _0x540f3a[_0xdf3c('0xe')];};};Realtime[_0xdf3c('0x16')]['initMailQueues']=function(){var _0x474564=this;return function(_0x3e7a4b){if(_0x3e7a4b){freeIsNotKey(_0x3e7a4b,_0x474564['mailQueues'],'id');for(var _0x4f68f9=0x0,_0x12cc19={},_0x588d02={};_0x4f68f9<_0x3e7a4b[_0xdf3c('0x19')];_0x4f68f9+=0x1){_0x12cc19=_0x3e7a4b[_0x4f68f9];if(_['isUndefined'](_0x474564['mailQueues'][_0x12cc19['id']])){_0x474564['mailQueues'][_0x12cc19['id']]=new MailQueue(_0x12cc19);}else{_0x474564[_0xdf3c('0x17')](_0x474564[_0xdf3c('0x21')][_0x12cc19['id']],_0x12cc19);}_0x474564[_0xdf3c('0x21')][_0x12cc19['id']][_0xdf3c('0x1d')]();_0x474564['mailQueues'][_0x12cc19['id']]['updateRealtime']();}}return _0x474564[_0xdf3c('0x21')];};};Realtime['prototype'][_0xdf3c('0x22')]=function(){var _0x17b502=this;return function(_0x3628ae){if(_0x3628ae){freeIsNotKey(_0x3628ae,_0x17b502[_0xdf3c('0xf')],'id');for(var _0x1004e9=0x0,_0x1e0cf2={},_0x1c7335={};_0x1004e9<_0x3628ae[_0xdf3c('0x19')];_0x1004e9+=0x1){_0x1e0cf2=_0x3628ae[_0x1004e9];if(_[_0xdf3c('0x1a')](_0x17b502['faxQueues'][_0x1e0cf2['id']])){_0x17b502[_0xdf3c('0xf')][_0x1e0cf2['id']]=new FaxQueue(_0x1e0cf2);}else{_0x17b502['mergeFromDatabase'](_0x17b502['faxQueues'][_0x1e0cf2['id']],_0x1e0cf2);}_0x17b502[_0xdf3c('0xf')][_0x1e0cf2['id']]['updateRouting']();_0x17b502[_0xdf3c('0xf')][_0x1e0cf2['id']]['updateRealtime']();}}return _0x17b502[_0xdf3c('0xf')];};};Realtime[_0xdf3c('0x16')][_0xdf3c('0x23')]=function(){var _0x1349a4=this;return function(_0x3098cb){if(_0x3098cb){freeIsNotKey(_0x3098cb,_0x1349a4[_0xdf3c('0x24')],'id');for(var _0x736ef5=0x0,_0x3d47fb={},_0x3cf131={};_0x736ef5<_0x3098cb[_0xdf3c('0x19')];_0x736ef5+=0x1){_0x3d47fb=_0x3098cb[_0x736ef5];if(_[_0xdf3c('0x1a')](_0x1349a4[_0xdf3c('0x24')][_0x3d47fb['id']])){_0x1349a4['whatsappQueues'][_0x3d47fb['id']]=new WhatsappQueue(_0x3d47fb);}else{_0x1349a4['mergeFromDatabase'](_0x1349a4[_0xdf3c('0x24')][_0x3d47fb['id']],_0x3d47fb);}_0x1349a4['whatsappQueues'][_0x3d47fb['id']][_0xdf3c('0x1d')]();_0x1349a4[_0xdf3c('0x24')][_0x3d47fb['id']][_0xdf3c('0x1e')]();}}return _0x1349a4[_0xdf3c('0x24')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index aeb9316..a3d5c47 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 _0x8435=['../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x8435,0x108));var _0x5843=function(_0x3106d2,_0x36dd3c){_0x3106d2=_0x3106d2-0x0;var _0x4295e3=_0x8435[_0x3106d2];return _0x4295e3;};'use strict';var client=require(_0x5843('0x0'));exports[_0x5843('0x1')]=function(_0x49597d,_0x7e3366){return client[_0x5843('0x2')](_0x5843('0x3'),{'body':_0x7e3366,'options':{'where':{'id':_0x49597d}},'log':_0x5843('0x4')});};exports[_0x5843('0x5')]=function(_0x1bc1d2,_0x3d25b6){return client[_0x5843('0x2')]('AddTagsToChatInteraction',{'body':_0x3d25b6,'options':{'where':{'id':_0x1bc1d2}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xb7f7=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0xb7f7,0x1f0));var _0x7b7f=function(_0x71a626,_0x2b8329){_0x71a626=_0x71a626-0x0;var _0xc38481=_0xb7f7[_0x71a626];return _0xc38481;};'use strict';var client=require(_0x7b7f('0x0'));exports['update']=function(_0x307bfd,_0x23e113){return client[_0x7b7f('0x1')](_0x7b7f('0x2'),{'body':_0x23e113,'options':{'where':{'id':_0x307bfd}},'log':_0x7b7f('0x3')});};exports[_0x7b7f('0x4')]=function(_0x49cdfa,_0x37197b){return client[_0x7b7f('0x1')](_0x7b7f('0x5'),{'body':_0x37197b,'options':{'where':{'id':_0x49cdfa}},'log':_0x7b7f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 388380e..ab94112 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 _0x8ea8=['create','Request','createChatMessage'];(function(_0x313dab,_0x53179c){var _0x18ee37=function(_0x5f43a0){while(--_0x5f43a0){_0x313dab['push'](_0x313dab['shift']());}};_0x18ee37(++_0x53179c);}(_0x8ea8,0x72));var _0x88ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea8[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x88ea('0x0')]=function(_0x3aa48e){return client[_0x88ea('0x1')]('CreateChatMessage',{'body':_0x3aa48e,'log':_0x88ea('0x2')});}; \ No newline at end of file +var _0x3458=['CreateChatMessage','createChatMessage','../client','create','Request'];(function(_0xe540c0,_0x2d98e5){var _0x130549=function(_0x4cfd79){while(--_0x4cfd79){_0xe540c0['push'](_0xe540c0['shift']());}};_0x130549(++_0x2d98e5);}(_0x3458,0x6b));var _0x8345=function(_0x1a061f,_0x3e474d){_0x1a061f=_0x1a061f-0x0;var _0x4e5d47=_0x3458[_0x1a061f];return _0x4e5d47;};'use strict';var client=require(_0x8345('0x0'));exports[_0x8345('0x1')]=function(_0x236b88){return client[_0x8345('0x2')](_0x8345('0x3'),{'body':_0x236b88,'log':_0x8345('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index b9290e9..2096671 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 _0x31e8=['chatPause','getChatQueues','Request','timeout','strategy','User','name','online'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x31e8,0x79));var _0x831e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x31e8[_0x46e363];return _0x3fb059;};'use strict';var client=require('../client');exports[_0x831e('0x0')]=function(){return function(){return client[_0x831e('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0x831e('0x2'),_0x831e('0x3')],'include':[{'model':_0x831e('0x4'),'as':'Agents','attributes':['id',_0x831e('0x5'),_0x831e('0x6'),_0x831e('0x7')]}]},'log':_0x831e('0x0')});};}; \ No newline at end of file +var _0xb7ae=['User','Agents','online','getChatQueues','../client','GetChatQueue','name','timeout'];(function(_0x98b4b4,_0x32a016){var _0x5edf59=function(_0x5d733d){while(--_0x5d733d){_0x98b4b4['push'](_0x98b4b4['shift']());}};_0x5edf59(++_0x32a016);}(_0xb7ae,0x8c));var _0xeb7a=function(_0x14d1a4,_0x25ce21){_0x14d1a4=_0x14d1a4-0x0;var _0x52bb2b=_0xb7ae[_0x14d1a4];return _0x52bb2b;};'use strict';var client=require(_0xeb7a('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0xeb7a('0x1'),{'options':{'raw':![],'attributes':['id',_0xeb7a('0x2'),_0xeb7a('0x3'),'strategy'],'include':[{'model':_0xeb7a('0x4'),'as':_0xeb7a('0x5'),'attributes':['id',_0xeb7a('0x2'),_0xeb7a('0x6'),'chatPause']}]},'log':_0xeb7a('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 7bd98c3..29e846e 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 _0x956a=['DESC','UpdateChatQueueReport','create','Request','CreateChatQueueReport','update'];(function(_0x5f44d0,_0x4efd02){var _0x339f11=function(_0x48b6a9){while(--_0x48b6a9){_0x5f44d0['push'](_0x5f44d0['shift']());}};_0x339f11(++_0x4efd02);}(_0x956a,0xb6));var _0xa956=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x956a[_0x502c7d];return _0x30b7ed;};'use strict';var client=require('../client');exports[_0xa956('0x0')]=function(_0x238805){return client[_0xa956('0x1')](_0xa956('0x2'),{'body':_0x238805,'log':_0xa956('0x2')});};exports[_0xa956('0x3')]=function(_0x331696,_0x38c808){return client['Request']('UpdateChatQueueReport',{'body':_0x38c808,'options':{'where':{'uniqueid':_0x331696},'order':[['id',_0xa956('0x4')]],'limit':0x1},'log':_0xa956('0x5')});}; \ No newline at end of file +var _0x5d70=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x3a081b,_0x516437){var _0xb166c4=function(_0x22bc5d){while(--_0x22bc5d){_0x3a081b['push'](_0x3a081b['shift']());}};_0xb166c4(++_0x516437);}(_0x5d70,0x8d));var _0x05d7=function(_0x5523e0,_0x1d9cac){_0x5523e0=_0x5523e0-0x0;var _0x791479=_0x5d70[_0x5523e0];return _0x791479;};'use strict';var client=require(_0x05d7('0x0'));exports[_0x05d7('0x1')]=function(_0x54771b){return client[_0x05d7('0x2')](_0x05d7('0x3'),{'body':_0x54771b,'log':_0x05d7('0x3')});};exports[_0x05d7('0x4')]=function(_0x43c0a7,_0x2a2455){return client['Request'](_0x05d7('0x5'),{'body':_0x2a2455,'options':{'where':{'uniqueid':_0x43c0a7},'order':[['id',_0x05d7('0x6')]],'limit':0x1},'log':_0x05d7('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index da350f3..a5fcfb9 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 _0xd575=['update','Request','UpdateFaxInteraction','addTags','addTagsToFaxInteraction','../client'];(function(_0x30f80e,_0x1c0998){var _0x4c9c62=function(_0xaf5c8d){while(--_0xaf5c8d){_0x30f80e['push'](_0x30f80e['shift']());}};_0x4c9c62(++_0x1c0998);}(_0xd575,0x6b));var _0x5d57=function(_0x5a36d3,_0xf6f5d1){_0x5a36d3=_0x5a36d3-0x0;var _0x5bf7c3=_0xd575[_0x5a36d3];return _0x5bf7c3;};'use strict';var client=require(_0x5d57('0x0'));exports[_0x5d57('0x1')]=function(_0xf675a,_0x277683){return client[_0x5d57('0x2')](_0x5d57('0x3'),{'body':_0x277683,'options':{'where':{'id':_0xf675a}},'log':'updateFaxInteraction'});};exports[_0x5d57('0x4')]=function(_0x977e28,_0x57942f){return client[_0x5d57('0x2')]('AddTagsToFaxInteraction',{'body':_0x57942f,'options':{'where':{'id':_0x977e28}},'log':_0x5d57('0x5')});}; \ No newline at end of file +var _0xe525=['addTags','Request','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction'];(function(_0x3c57fd,_0x4ca5f3){var _0x65bd73=function(_0x1920d7){while(--_0x1920d7){_0x3c57fd['push'](_0x3c57fd['shift']());}};_0x65bd73(++_0x4ca5f3);}(_0xe525,0xea));var _0x5e52=function(_0x1f0901,_0x56e35d){_0x1f0901=_0x1f0901-0x0;var _0x35b5ae=_0xe525[_0x1f0901];return _0x35b5ae;};'use strict';var client=require(_0x5e52('0x0'));exports[_0x5e52('0x1')]=function(_0x275d91,_0x45b1a4){return client['Request'](_0x5e52('0x2'),{'body':_0x45b1a4,'options':{'where':{'id':_0x275d91}},'log':_0x5e52('0x3')});};exports[_0x5e52('0x4')]=function(_0x2464e5,_0x4016ba){return client[_0x5e52('0x5')]('AddTagsToFaxInteraction',{'body':_0x4016ba,'options':{'where':{'id':_0x2464e5}},'log':_0x5e52('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 74db912..6fc9d28 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 _0x8e36=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x800e38,_0x5c5357){var _0x1927c9=function(_0x127396){while(--_0x127396){_0x800e38['push'](_0x800e38['shift']());}};_0x1927c9(++_0x5c5357);}(_0x8e36,0x128));var _0x68e3=function(_0x2e004a,_0x1f62fe){_0x2e004a=_0x2e004a-0x0;var _0x2962b8=_0x8e36[_0x2e004a];return _0x2962b8;};'use strict';var client=require(_0x68e3('0x0'));exports[_0x68e3('0x1')]=function(_0x365589){return client[_0x68e3('0x2')](_0x68e3('0x3'),{'body':_0x365589,'log':_0x68e3('0x4')});}; \ No newline at end of file +var _0xdec6=['CreateFaxMessage','createFaxMessage','create','Request'];(function(_0x346382,_0x560e5b){var _0xfa108f=function(_0x133752){while(--_0x133752){_0x346382['push'](_0x346382['shift']());}};_0xfa108f(++_0x560e5b);}(_0xdec6,0x9e));var _0x6dec=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xdec6[_0x2f3848];return _0x102668;};'use strict';var client=require('../client');exports[_0x6dec('0x0')]=function(_0x3edbfb){return client[_0x6dec('0x1')](_0x6dec('0x2'),{'body':_0x3edbfb,'log':_0x6dec('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index e55ff31..249e4c8 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 _0xe0e7=['getFaxQueues','../client','GetFaxQueue','timeout','strategy','User','Agents','name','faxPause'];(function(_0x166664,_0x52af97){var _0x5816b2=function(_0x3d6096){while(--_0x3d6096){_0x166664['push'](_0x166664['shift']());}};_0x5816b2(++_0x52af97);}(_0xe0e7,0x169));var _0x7e0e=function(_0x5cfb75,_0x224a85){_0x5cfb75=_0x5cfb75-0x0;var _0x2613d6=_0xe0e7[_0x5cfb75];return _0x2613d6;};'use strict';var client=require(_0x7e0e('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request'](_0x7e0e('0x1'),{'options':{'raw':![],'attributes':['id','name',_0x7e0e('0x2'),_0x7e0e('0x3')],'include':[{'model':_0x7e0e('0x4'),'as':_0x7e0e('0x5'),'attributes':['id',_0x7e0e('0x6'),'online',_0x7e0e('0x7')]}]},'log':_0x7e0e('0x8')});};}; \ No newline at end of file +var _0xc7d9=['name','timeout','strategy','Agents','online','../client','getFaxQueues','GetFaxQueue'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xc7d9,0x13d));var _0x9c7d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc7d9[_0x3b380d];return _0x54502b;};'use strict';var client=require(_0x9c7d('0x0'));exports[_0x9c7d('0x1')]=function(){return function(){return client['Request'](_0x9c7d('0x2'),{'options':{'raw':![],'attributes':['id',_0x9c7d('0x3'),_0x9c7d('0x4'),_0x9c7d('0x5')],'include':[{'model':'User','as':_0x9c7d('0x6'),'attributes':['id',_0x9c7d('0x3'),_0x9c7d('0x7'),'faxPause']}]},'log':_0x9c7d('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 7ea295a..1384b52 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 _0xf40b=['DESC','create','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf40b,0xfb));var _0xbf40=function(_0x480f4a,_0x2ea3f8){_0x480f4a=_0x480f4a-0x0;var _0xdccb7d=_0xf40b[_0x480f4a];return _0xdccb7d;};'use strict';var client=require('../client');exports[_0xbf40('0x0')]=function(_0x2b89c9){return client['Request'](_0xbf40('0x1'),{'body':_0x2b89c9,'log':_0xbf40('0x1')});};exports[_0xbf40('0x2')]=function(_0x138659,_0x43587b){return client['Request'](_0xbf40('0x3'),{'body':_0x43587b,'options':{'where':{'uniqueid':_0x138659},'order':[['id',_0xbf40('0x4')]],'limit':0x1},'log':_0xbf40('0x3')});}; \ No newline at end of file +var _0x9d3e=['update','UpdateFaxQueueReport','DESC','../client','create','Request','CreateFaxQueueReport'];(function(_0x305fc8,_0x16e31e){var _0x427cea=function(_0x524995){while(--_0x524995){_0x305fc8['push'](_0x305fc8['shift']());}};_0x427cea(++_0x16e31e);}(_0x9d3e,0x1c3));var _0xe9d3=function(_0xa22f50,_0x3686a3){_0xa22f50=_0xa22f50-0x0;var _0x235acc=_0x9d3e[_0xa22f50];return _0x235acc;};'use strict';var client=require(_0xe9d3('0x0'));exports[_0xe9d3('0x1')]=function(_0x265dd1){return client[_0xe9d3('0x2')](_0xe9d3('0x3'),{'body':_0x265dd1,'log':_0xe9d3('0x3')});};exports[_0xe9d3('0x4')]=function(_0x21f554,_0x4c067e){return client[_0xe9d3('0x2')](_0xe9d3('0x5'),{'body':_0x4c067e,'options':{'where':{'uniqueid':_0x21f554},'order':[['id',_0xe9d3('0x6')]],'limit':0x1},'log':_0xe9d3('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index f739ff3..53008e8 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 _0x49f8=['../client','GetInterval','name','Intervals','interval'];(function(_0x59d0c4,_0x90492e){var _0x377098=function(_0x19f14b){while(--_0x19f14b){_0x59d0c4['push'](_0x59d0c4['shift']());}};_0x377098(++_0x90492e);}(_0x49f8,0xff));var _0x849f=function(_0x1e40da,_0x5861ee){_0x1e40da=_0x1e40da-0x0;var _0x1e1b14=_0x49f8[_0x1e40da];return _0x1e1b14;};'use strict';var client=require(_0x849f('0x0'));exports['getIntervals']=function(){return function(){return client['Request'](_0x849f('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x849f('0x2')],'include':[{'model':'Interval','as':_0x849f('0x3'),'attributes':['id','name',_0x849f('0x4')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x6ae2=['GetInterval','name','Interval','Intervals','interval','../client','getIntervals','Request'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x397951,_0xf243f4){_0x397951=_0x397951-0x0;var _0x91db9c=_0x6ae2[_0x397951];return _0x91db9c;};'use strict';var client=require(_0x26ae('0x0'));exports[_0x26ae('0x1')]=function(){return function(){return client[_0x26ae('0x2')](_0x26ae('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x26ae('0x4')],'include':[{'model':_0x26ae('0x5'),'as':_0x26ae('0x6'),'attributes':['id',_0x26ae('0x4'),_0x26ae('0x7')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index ae6deb9..90d1a35 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 _0x47a9=['Request','AddTagsToMailInteraction','addTagsToChatInteraction','update','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x11dc39,_0x491115){var _0x457277=function(_0x1d77cd){while(--_0x1d77cd){_0x11dc39['push'](_0x11dc39['shift']());}};_0x457277(++_0x491115);}(_0x47a9,0x18b));var _0x947a=function(_0x57a3d4,_0x4bb7e2){_0x57a3d4=_0x57a3d4-0x0;var _0x51dc01=_0x47a9[_0x57a3d4];return _0x51dc01;};'use strict';var client=require('../client');exports[_0x947a('0x0')]=function(_0x7153f2,_0x1ed7a5){return client['Request'](_0x947a('0x1'),{'body':_0x1ed7a5,'options':{'where':{'id':_0x7153f2}},'log':_0x947a('0x2')});};exports[_0x947a('0x3')]=function(_0x5a363a,_0x14f3b8){return client[_0x947a('0x4')](_0x947a('0x5'),{'body':_0x14f3b8,'options':{'where':{'id':_0x5a363a}},'log':_0x947a('0x6')});}; \ No newline at end of file +var _0xd643=['update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction'];(function(_0x580b15,_0x28afa4){var _0x1adb1b=function(_0x47a01f){while(--_0x47a01f){_0x580b15['push'](_0x580b15['shift']());}};_0x1adb1b(++_0x28afa4);}(_0xd643,0x113));var _0x3d64=function(_0xfab565,_0x83a93){_0xfab565=_0xfab565-0x0;var _0x7d0d6e=_0xd643[_0xfab565];return _0x7d0d6e;};'use strict';var client=require('../client');exports[_0x3d64('0x0')]=function(_0x4ecc31,_0x42b1b5){return client[_0x3d64('0x1')](_0x3d64('0x2'),{'body':_0x42b1b5,'options':{'where':{'id':_0x4ecc31}},'log':_0x3d64('0x3')});};exports['addTags']=function(_0x3d4808,_0x3b5703){return client[_0x3d64('0x1')](_0x3d64('0x4'),{'body':_0x3b5703,'options':{'where':{'id':_0x3d4808}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 680576c..999eb95 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 _0x2fd7=['../client','create','CreateMailMessage','createMailMessage'];(function(_0xba3b10,_0x5f2f00){var _0x567ace=function(_0x5dbe65){while(--_0x5dbe65){_0xba3b10['push'](_0xba3b10['shift']());}};_0x567ace(++_0x5f2f00);}(_0x2fd7,0x1e0));var _0x72fd=function(_0x2c80b6,_0x38e842){_0x2c80b6=_0x2c80b6-0x0;var _0x35720d=_0x2fd7[_0x2c80b6];return _0x35720d;};'use strict';var client=require(_0x72fd('0x0'));exports[_0x72fd('0x1')]=function(_0x59d600){return client['Request'](_0x72fd('0x2'),{'body':_0x59d600,'log':_0x72fd('0x3')});}; \ No newline at end of file +var _0xdd8f=['Request','CreateMailMessage','createMailMessage'];(function(_0x40cb7a,_0x505484){var _0x246f9c=function(_0x3bd730){while(--_0x3bd730){_0x40cb7a['push'](_0x40cb7a['shift']());}};_0x246f9c(++_0x505484);}(_0xdd8f,0x126));var _0xfdd8=function(_0x33006f,_0x5b260b){_0x33006f=_0x33006f-0x0;var _0x3c8c9c=_0xdd8f[_0x33006f];return _0x3c8c9c;};'use strict';var client=require('../client');exports['create']=function(_0x5820b8){return client[_0xfdd8('0x0')](_0xfdd8('0x1'),{'body':_0x5820b8,'log':_0xfdd8('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index f86052a..f26b97d 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 _0xf496=['online','mailPause','../client','getMailQueues','GetMailQueue','name','timeout','strategy','Agents'];(function(_0x3cbb5e,_0x3df81a){var _0x291269=function(_0x1f7b82){while(--_0x1f7b82){_0x3cbb5e['push'](_0x3cbb5e['shift']());}};_0x291269(++_0x3df81a);}(_0xf496,0x173));var _0x6f49=function(_0x3cae68,_0x4f6013){_0x3cae68=_0x3cae68-0x0;var _0x5302a0=_0xf496[_0x3cae68];return _0x5302a0;};'use strict';var client=require(_0x6f49('0x0'));exports[_0x6f49('0x1')]=function(){return function(){return client['Request'](_0x6f49('0x2'),{'options':{'raw':![],'attributes':['id',_0x6f49('0x3'),_0x6f49('0x4'),_0x6f49('0x5')],'include':[{'model':'User','as':_0x6f49('0x6'),'attributes':['id',_0x6f49('0x3'),_0x6f49('0x7'),_0x6f49('0x8')]}]},'log':_0x6f49('0x1')});};}; \ No newline at end of file +var _0xe0f9=['timeout','strategy','User','name','online','mailPause','../client','getMailQueues','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0f9,0x19b));var _0x9e0f=function(_0x121abc,_0x54f20f){_0x121abc=_0x121abc-0x0;var _0x635f39=_0xe0f9[_0x121abc];return _0x635f39;};'use strict';var client=require(_0x9e0f('0x0'));exports[_0x9e0f('0x1')]=function(){return function(){return client[_0x9e0f('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0x9e0f('0x3'),_0x9e0f('0x4')],'include':[{'model':_0x9e0f('0x5'),'as':'Agents','attributes':['id',_0x9e0f('0x6'),_0x9e0f('0x7'),_0x9e0f('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index e0dfb8e..340cbb3 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 _0xdfb0=['DESC','UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','update'];(function(_0x3e9be1,_0x2fac9c){var _0x41518b=function(_0x5f19ed){while(--_0x5f19ed){_0x3e9be1['push'](_0x3e9be1['shift']());}};_0x41518b(++_0x2fac9c);}(_0xdfb0,0x167));var _0x0dfb=function(_0x1da3cb,_0x15f773){_0x1da3cb=_0x1da3cb-0x0;var _0x31a4dc=_0xdfb0[_0x1da3cb];return _0x31a4dc;};'use strict';var client=require(_0x0dfb('0x0'));exports[_0x0dfb('0x1')]=function(_0x5f019c){return client[_0x0dfb('0x2')]('CreateMailQueueReport',{'body':_0x5f019c,'log':_0x0dfb('0x3')});};exports[_0x0dfb('0x4')]=function(_0x28a61a,_0x30ce28){return client[_0x0dfb('0x2')]('UpdateMailQueueReport',{'body':_0x30ce28,'options':{'where':{'uniqueid':_0x28a61a},'order':[['id',_0x0dfb('0x5')]],'limit':0x1},'log':_0x0dfb('0x6')});}; \ No newline at end of file +var _0x60db=['Request','CreateMailQueueReport','UpdateMailQueueReport','DESC','../client','create'];(function(_0x9ea249,_0x4478c9){var _0x2eab06=function(_0x9f9f79){while(--_0x9f9f79){_0x9ea249['push'](_0x9ea249['shift']());}};_0x2eab06(++_0x4478c9);}(_0x60db,0x178));var _0xb60d=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x60db[_0x15bc81];return _0x59440e;};'use strict';var client=require(_0xb60d('0x0'));exports[_0xb60d('0x1')]=function(_0x2d7a6a){return client[_0xb60d('0x2')]('CreateMailQueueReport',{'body':_0x2d7a6a,'log':_0xb60d('0x3')});};exports['update']=function(_0x17d50f,_0x211d1a){return client[_0xb60d('0x2')](_0xb60d('0x4'),{'body':_0x211d1a,'options':{'where':{'uniqueid':_0x17d50f},'order':[['id',_0xb60d('0x5')]],'limit':0x1},'log':_0xb60d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 9929e9c..202d98c 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 _0x066b=['updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','Request'];(function(_0x2d5411,_0x1a439f){var _0x4f13d7=function(_0x2523c4){while(--_0x2523c4){_0x2d5411['push'](_0x2d5411['shift']());}};_0x4f13d7(++_0x1a439f);}(_0x066b,0x19b));var _0xb066=function(_0x1f4062,_0x45e820){_0x1f4062=_0x1f4062-0x0;var _0x2a58a9=_0x066b[_0x1f4062];return _0x2a58a9;};'use strict';var client=require('../client');exports['update']=function(_0x2a72d2,_0x59c444){return client[_0xb066('0x0')]('UpdateOpenchannelInteraction',{'body':_0x59c444,'options':{'where':{'id':_0x2a72d2}},'log':_0xb066('0x1')});};exports['addTags']=function(_0x424b76,_0x2549cc){return client[_0xb066('0x0')](_0xb066('0x2'),{'body':_0x2549cc,'options':{'where':{'id':_0x424b76}},'log':_0xb066('0x3')});}; \ No newline at end of file +var _0x9f29=['update','Request','UpdateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x16806c,_0x36f777){var _0x129022=function(_0x52e7e5){while(--_0x52e7e5){_0x16806c['push'](_0x16806c['shift']());}};_0x129022(++_0x36f777);}(_0x9f29,0x102));var _0x99f2=function(_0x5918a0,_0x77502c){_0x5918a0=_0x5918a0-0x0;var _0x39360f=_0x9f29[_0x5918a0];return _0x39360f;};'use strict';var client=require('../client');exports[_0x99f2('0x0')]=function(_0x1eb87f,_0x10accf){return client[_0x99f2('0x1')](_0x99f2('0x2'),{'body':_0x10accf,'options':{'where':{'id':_0x1eb87f}},'log':'updateOpenchannelInteraction'});};exports[_0x99f2('0x3')]=function(_0x555a7c,_0x1991e0){return client[_0x99f2('0x1')](_0x99f2('0x4'),{'body':_0x1991e0,'options':{'where':{'id':_0x555a7c}},'log':_0x99f2('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 2825848..8e33aec 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 _0x5b02=['create','Request','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5b02,0xe9));var _0x25b0=function(_0x2e7421,_0x99b154){_0x2e7421=_0x2e7421-0x0;var _0x3006ed=_0x5b02[_0x2e7421];return _0x3006ed;};'use strict';var client=require(_0x25b0('0x0'));exports[_0x25b0('0x1')]=function(_0x428458){return client[_0x25b0('0x2')]('CreateOpenchannelMessage',{'body':_0x428458,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xb43b=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1b0305,_0x14676a){_0x1b0305=_0x1b0305-0x0;var _0x2e182c=_0xb43b[_0x1b0305];return _0x2e182c;};'use strict';var client=require(_0xbb43('0x0'));exports[_0xbb43('0x1')]=function(_0x5c45dd){return client[_0xbb43('0x2')](_0xbb43('0x3'),{'body':_0x5c45dd,'log':_0xbb43('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index d36ed61..b934598 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 _0xd1b7=['GetOpenchannelQueue','name','timeout','strategy','User','Agents','online','openchannelPause','getOpenchannelQueues'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xd1b7,0x128));var _0x7d1b=function(_0x408c63,_0x3b2f80){_0x408c63=_0x408c63-0x0;var _0x2bf11d=_0xd1b7[_0x408c63];return _0x2bf11d;};'use strict';var client=require('../client');exports[_0x7d1b('0x0')]=function(){return function(){return client['Request'](_0x7d1b('0x1'),{'options':{'raw':![],'attributes':['id',_0x7d1b('0x2'),_0x7d1b('0x3'),_0x7d1b('0x4')],'include':[{'model':_0x7d1b('0x5'),'as':_0x7d1b('0x6'),'attributes':['id','name',_0x7d1b('0x7'),_0x7d1b('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xe188=['../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents','openchannelPause'];(function(_0x180b51,_0x2f6eb7){var _0x201007=function(_0xa71597){while(--_0xa71597){_0x180b51['push'](_0x180b51['shift']());}};_0x201007(++_0x2f6eb7);}(_0xe188,0x1ea));var _0x8e18=function(_0x3b3f4f,_0x403216){_0x3b3f4f=_0x3b3f4f-0x0;var _0x174dbe=_0xe188[_0x3b3f4f];return _0x174dbe;};'use strict';var client=require(_0x8e18('0x0'));exports[_0x8e18('0x1')]=function(){return function(){return client[_0x8e18('0x2')](_0x8e18('0x3'),{'options':{'raw':![],'attributes':['id',_0x8e18('0x4'),_0x8e18('0x5'),_0x8e18('0x6')],'include':[{'model':_0x8e18('0x7'),'as':_0x8e18('0x8'),'attributes':['id',_0x8e18('0x4'),'online',_0x8e18('0x9')]}]},'log':_0x8e18('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 746731c..15540aa 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 _0xf504=['update','Request','UpdateOpenchannelQueueReport','DESC','../client','create','CreateOpenchannelQueueReport'];(function(_0x4b8d5c,_0x2c38aa){var _0x14b6a0=function(_0x335259){while(--_0x335259){_0x4b8d5c['push'](_0x4b8d5c['shift']());}};_0x14b6a0(++_0x2c38aa);}(_0xf504,0x138));var _0x4f50=function(_0x14d997,_0x54173c){_0x14d997=_0x14d997-0x0;var _0x2591b9=_0xf504[_0x14d997];return _0x2591b9;};'use strict';var client=require(_0x4f50('0x0'));exports[_0x4f50('0x1')]=function(_0x3edf52){return client['Request'](_0x4f50('0x2'),{'body':_0x3edf52,'log':_0x4f50('0x2')});};exports[_0x4f50('0x3')]=function(_0x20d8ab,_0x33a734){return client[_0x4f50('0x4')](_0x4f50('0x5'),{'body':_0x33a734,'options':{'where':{'uniqueid':_0x20d8ab},'order':[['id',_0x4f50('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x5bfc=['DESC','../client','create','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x5bfc,0x78));var _0xc5bf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5bfc[_0x126558];return _0x1f6d14;};'use strict';var client=require(_0xc5bf('0x0'));exports[_0xc5bf('0x1')]=function(_0x946080){return client[_0xc5bf('0x2')](_0xc5bf('0x3'),{'body':_0x946080,'log':_0xc5bf('0x3')});};exports[_0xc5bf('0x4')]=function(_0x4c09d2,_0x2a3001){return client[_0xc5bf('0x2')](_0xc5bf('0x5'),{'body':_0x2a3001,'options':{'where':{'uniqueid':_0x4c09d2},'order':[['id',_0xc5bf('0x6')]],'limit':0x1},'log':_0xc5bf('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 11147f9..f041d2f 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 _0xf134=['UpdateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update','Request'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0xf134,0x17d));var _0x4f13=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xf134[_0x279d37];return _0x530173;};'use strict';var client=require(_0x4f13('0x0'));exports[_0x4f13('0x1')]=function(_0x22767f,_0x4bc7d2){return client[_0x4f13('0x2')](_0x4f13('0x3'),{'body':_0x4bc7d2,'options':{'where':{'id':_0x22767f}},'log':'updateSmsInteraction'});};exports[_0x4f13('0x4')]=function(_0x52f3ec,_0x31dd88){return client[_0x4f13('0x2')]('AddTagsToSmsInteraction',{'body':_0x31dd88,'options':{'where':{'id':_0x52f3ec}},'log':_0x4f13('0x5')});}; \ No newline at end of file +var _0x5203=['addTagsToSmsInteraction','update','Request'];(function(_0x360cd5,_0x504145){var _0x578323=function(_0x3c9977){while(--_0x3c9977){_0x360cd5['push'](_0x360cd5['shift']());}};_0x578323(++_0x504145);}(_0x5203,0x12a));var _0x3520=function(_0xcd79b8,_0x121c9b){_0xcd79b8=_0xcd79b8-0x0;var _0x10d33d=_0x5203[_0xcd79b8];return _0x10d33d;};'use strict';var client=require('../client');exports[_0x3520('0x0')]=function(_0x3ddf3a,_0x47b230){return client[_0x3520('0x1')]('UpdateSmsInteraction',{'body':_0x47b230,'options':{'where':{'id':_0x3ddf3a}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x3bd9c9,_0x6e6dab){return client[_0x3520('0x1')]('AddTagsToSmsInteraction',{'body':_0x6e6dab,'options':{'where':{'id':_0x3bd9c9}},'log':_0x3520('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 8777616..b5f1f37 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 _0x3821=['Request','../client'];(function(_0x47077a,_0x1d9509){var _0x2c4d14=function(_0x2c4f7c){while(--_0x2c4f7c){_0x47077a['push'](_0x47077a['shift']());}};_0x2c4d14(++_0x1d9509);}(_0x3821,0xf7));var _0x1382=function(_0x5c4384,_0x2cb11d){_0x5c4384=_0x5c4384-0x0;var _0x1a5b12=_0x3821[_0x5c4384];return _0x1a5b12;};'use strict';var client=require(_0x1382('0x0'));exports['create']=function(_0x4df328){return client[_0x1382('0x1')]('CreateSmsMessage',{'body':_0x4df328,'log':'createSmsMessage'});}; \ No newline at end of file +var _0xb00d=['createSmsMessage','../client','CreateSmsMessage'];(function(_0x14d2a3,_0x4e3478){var _0x48bbdb=function(_0x3d84e1){while(--_0x3d84e1){_0x14d2a3['push'](_0x14d2a3['shift']());}};_0x48bbdb(++_0x4e3478);}(_0xb00d,0x97));var _0xdb00=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0xb00d[_0x259d17];return _0x407535;};'use strict';var client=require(_0xdb00('0x0'));exports['create']=function(_0x5262ca){return client['Request'](_0xdb00('0x1'),{'body':_0x5262ca,'log':_0xdb00('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 0517600..246a8d6 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 _0x9219=['Agents','smsPause','getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','User'];(function(_0x1074ab,_0x579695){var _0x50006f=function(_0xf3b8be){while(--_0xf3b8be){_0x1074ab['push'](_0x1074ab['shift']());}};_0x50006f(++_0x579695);}(_0x9219,0x1cd));var _0x9921=function(_0x15458f,_0x32b4df){_0x15458f=_0x15458f-0x0;var _0x3770f9=_0x9219[_0x15458f];return _0x3770f9;};'use strict';var client=require('../client');exports[_0x9921('0x0')]=function(){return function(){return client[_0x9921('0x1')](_0x9921('0x2'),{'options':{'raw':![],'attributes':['id',_0x9921('0x3'),_0x9921('0x4'),_0x9921('0x5')],'include':[{'model':_0x9921('0x6'),'as':_0x9921('0x7'),'attributes':['id',_0x9921('0x3'),'online',_0x9921('0x8')]}]},'log':_0x9921('0x0')});};}; \ No newline at end of file +var _0x1d12=['getSmsQueues','Request','GetSmsQueue','User','name','online','smsPause','../client'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1d12,0x13f));var _0x21d1=function(_0x2aaeda,_0x4f03c0){_0x2aaeda=_0x2aaeda-0x0;var _0x30cc12=_0x1d12[_0x2aaeda];return _0x30cc12;};'use strict';var client=require(_0x21d1('0x0'));exports[_0x21d1('0x1')]=function(){return function(){return client[_0x21d1('0x2')](_0x21d1('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0x21d1('0x4'),'as':'Agents','attributes':['id',_0x21d1('0x5'),_0x21d1('0x6'),_0x21d1('0x7')]}]},'log':_0x21d1('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 06764d2..1467841 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 _0x041c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x172d60,_0x38c5b3){var _0x2a4026=function(_0x327dca){while(--_0x327dca){_0x172d60['push'](_0x172d60['shift']());}};_0x2a4026(++_0x38c5b3);}(_0x041c,0xa1));var _0xc041=function(_0x1a02b4,_0x1c0924){_0x1a02b4=_0x1a02b4-0x0;var _0x224e80=_0x041c[_0x1a02b4];return _0x224e80;};'use strict';var client=require(_0xc041('0x0'));exports[_0xc041('0x1')]=function(_0x15170e){return client[_0xc041('0x2')](_0xc041('0x3'),{'body':_0x15170e,'log':_0xc041('0x3')});};exports[_0xc041('0x4')]=function(_0x553bc2,_0x3006b4){return client[_0xc041('0x2')](_0xc041('0x5'),{'body':_0x3006b4,'options':{'where':{'uniqueid':_0x553bc2},'order':[['id',_0xc041('0x6')]],'limit':0x1},'log':_0xc041('0x5')});}; \ No newline at end of file +var _0x8742=['create','CreateSmsQueueReport','Request','UpdateSmsQueueReport','DESC','../client'];(function(_0xe766bb,_0x1915fe){var _0x36c5a5=function(_0x3060d2){while(--_0x3060d2){_0xe766bb['push'](_0xe766bb['shift']());}};_0x36c5a5(++_0x1915fe);}(_0x8742,0xe9));var _0x2874=function(_0x2c5ae7,_0x15a13a){_0x2c5ae7=_0x2c5ae7-0x0;var _0x179a6e=_0x8742[_0x2c5ae7];return _0x179a6e;};'use strict';var client=require(_0x2874('0x0'));exports[_0x2874('0x1')]=function(_0xe22056){return client['Request'](_0x2874('0x2'),{'body':_0xe22056,'log':'CreateSmsQueueReport'});};exports['update']=function(_0x2c7e81,_0x1af021){return client[_0x2874('0x3')](_0x2874('0x4'),{'body':_0x1af021,'options':{'where':{'uniqueid':_0x2c7e81},'order':[['id',_0x2874('0x5')]],'limit':0x1},'log':_0x2874('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 817396d..1f7f708 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 _0x917b=['chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','GetUser','agent','online','lastPauseAt','chatPause','mailPause','faxPause','smsPause','openchannelPause'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x917b,0x1ae));var _0xb917=function(_0xef2004,_0x3236f9){_0xef2004=_0xef2004-0x0;var _0x1d9db1=_0x917b[_0xef2004];return _0x1d9db1;};'use strict';var client=require(_0xb917('0x0'));exports[_0xb917('0x1')]=function(){return function(){return client[_0xb917('0x2')](_0xb917('0x3'),{'options':{'raw':!![],'where':{'role':_0xb917('0x4')},'attributes':['id','name',_0xb917('0x5'),'pauseType',_0xb917('0x6'),'voicePause',_0xb917('0x7'),_0xb917('0x8'),_0xb917('0x9'),_0xb917('0xa'),'whatsappPause',_0xb917('0xb'),_0xb917('0xc'),_0xb917('0xd'),_0xb917('0xe'),_0xb917('0xf'),'whatsappCapacity',_0xb917('0x10')]},'log':_0xb917('0x1')});};}; \ No newline at end of file +var _0x73b9=['chatCapacity','mailCapacity','whatsappCapacity','../client','Request','GetUser','agent','name','online','pauseType','lastPauseAt','voicePause','chatPause','mailPause','faxPause','smsPause','whatsappPause','openchannelPause'];(function(_0x3594af,_0x4173f0){var _0x13d584=function(_0x309c9a){while(--_0x309c9a){_0x3594af['push'](_0x3594af['shift']());}};_0x13d584(++_0x4173f0);}(_0x73b9,0xc9));var _0x973b=function(_0x1978a0,_0x458c1c){_0x1978a0=_0x1978a0-0x0;var _0x5a42dc=_0x73b9[_0x1978a0];return _0x5a42dc;};'use strict';var client=require(_0x973b('0x0'));exports['getAgents']=function(){return function(){return client[_0x973b('0x1')](_0x973b('0x2'),{'options':{'raw':!![],'where':{'role':_0x973b('0x3')},'attributes':['id',_0x973b('0x4'),_0x973b('0x5'),_0x973b('0x6'),_0x973b('0x7'),_0x973b('0x8'),_0x973b('0x9'),_0x973b('0xa'),_0x973b('0xb'),_0x973b('0xc'),_0x973b('0xd'),_0x973b('0xe'),_0x973b('0xf'),_0x973b('0x10'),'faxCapacity','smsCapacity',_0x973b('0x11'),'openchannelCapacity']},'log':'getAgents'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index ccc155e..62987f6 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 _0x0487=['update','Request','UpdateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x1019b4,_0x46e3a2){var _0x4f2c1b=function(_0x2798ef){while(--_0x2798ef){_0x1019b4['push'](_0x1019b4['shift']());}};_0x4f2c1b(++_0x46e3a2);}(_0x0487,0x14f));var _0x7048=function(_0xad57ee,_0x2823a6){_0xad57ee=_0xad57ee-0x0;var _0x3eaea9=_0x0487[_0xad57ee];return _0x3eaea9;};'use strict';var client=require(_0x7048('0x0'));exports[_0x7048('0x1')]=function(_0x438ba4,_0xea288b){return client[_0x7048('0x2')](_0x7048('0x3'),{'body':_0xea288b,'options':{'where':{'id':_0x438ba4}},'log':'updateWhatsappInteraction'});};exports[_0x7048('0x4')]=function(_0x4e8f94,_0xf80df7){return client[_0x7048('0x2')](_0x7048('0x5'),{'body':_0xf80df7,'options':{'where':{'id':_0x4e8f94}},'log':_0x7048('0x6')});}; \ No newline at end of file +var _0xc678=['Request','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x357f0d,_0x42fd92){var _0x1340ee=function(_0x109106){while(--_0x109106){_0x357f0d['push'](_0x357f0d['shift']());}};_0x1340ee(++_0x42fd92);}(_0xc678,0x1b4));var _0x8c67=function(_0x549ddf,_0x465872){_0x549ddf=_0x549ddf-0x0;var _0xa84494=_0xc678[_0x549ddf];return _0xa84494;};'use strict';var client=require('../client');exports['update']=function(_0x3002e5,_0x137fa2){return client[_0x8c67('0x0')]('UpdateWhatsappInteraction',{'body':_0x137fa2,'options':{'where':{'id':_0x3002e5}},'log':_0x8c67('0x1')});};exports[_0x8c67('0x2')]=function(_0xcfea76,_0x757d84){return client['Request'](_0x8c67('0x3'),{'body':_0x757d84,'options':{'where':{'id':_0xcfea76}},'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 e612cf7..f0cb30a 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 _0x5632=['Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0x425af5,_0x1987ee){var _0x3e1311=function(_0x444053){while(--_0x444053){_0x425af5['push'](_0x425af5['shift']());}};_0x3e1311(++_0x1987ee);}(_0x5632,0xf7));var _0x2563=function(_0x26e256,_0x445f70){_0x26e256=_0x26e256-0x0;var _0x13097e=_0x5632[_0x26e256];return _0x13097e;};'use strict';var client=require(_0x2563('0x0'));exports['create']=function(_0x5bfe45){return client[_0x2563('0x1')](_0x2563('0x2'),{'body':_0x5bfe45,'log':_0x2563('0x3')});}; \ No newline at end of file +var _0xf9a4=['../client','create','CreateWhatsappMessage'];(function(_0x1eb36b,_0xf9011c){var _0x2f2730=function(_0x5abd00){while(--_0x5abd00){_0x1eb36b['push'](_0x1eb36b['shift']());}};_0x2f2730(++_0xf9011c);}(_0xf9a4,0x1c8));var _0x4f9a=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xf9a4[_0x5f0089];return _0x193892;};'use strict';var client=require(_0x4f9a('0x0'));exports[_0x4f9a('0x1')]=function(_0x1267f2){return client['Request'](_0x4f9a('0x2'),{'body':_0x1267f2,'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 749436d..ed7f63d 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 _0xa478=['online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','Agents'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xa478,0x136));var _0x8a47=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xa478[_0x186376];return _0x2dbdd9;};'use strict';var client=require(_0x8a47('0x0'));exports[_0x8a47('0x1')]=function(){return function(){return client[_0x8a47('0x2')](_0x8a47('0x3'),{'options':{'raw':![],'attributes':['id',_0x8a47('0x4'),_0x8a47('0x5'),_0x8a47('0x6')],'include':[{'model':_0x8a47('0x7'),'as':_0x8a47('0x8'),'attributes':['id',_0x8a47('0x4'),_0x8a47('0x9'),_0x8a47('0xa')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x657b=['getWhatsappQueues','Request','GetWhatsappQueue','name','strategy','User','online','whatsappPause','../client'];(function(_0x591ec3,_0x45f897){var _0xa87e9f=function(_0x4b40ab){while(--_0x4b40ab){_0x591ec3['push'](_0x591ec3['shift']());}};_0xa87e9f(++_0x45f897);}(_0x657b,0x131));var _0xb657=function(_0x8fca1d,_0x30415b){_0x8fca1d=_0x8fca1d-0x0;var _0x37e0fd=_0x657b[_0x8fca1d];return _0x37e0fd;};'use strict';var client=require(_0xb657('0x0'));exports[_0xb657('0x1')]=function(){return function(){return client[_0xb657('0x2')](_0xb657('0x3'),{'options':{'raw':![],'attributes':['id',_0xb657('0x4'),'timeout',_0xb657('0x5')],'include':[{'model':_0xb657('0x6'),'as':'Agents','attributes':['id',_0xb657('0x4'),_0xb657('0x7'),_0xb657('0x8')]}]},'log':_0xb657('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 0cdc017..d3b1b1c 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 _0xe560=['UpdateWhatsappQueueReport','DESC','../client','Request'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe560,0x66));var _0x0e56=function(_0x54c855,_0x5140a8){_0x54c855=_0x54c855-0x0;var _0x16e16f=_0xe560[_0x54c855];return _0x16e16f;};'use strict';var client=require(_0x0e56('0x0'));exports['create']=function(_0x2fd3f9){return client[_0x0e56('0x1')]('CreateWhatsappQueueReport',{'body':_0x2fd3f9,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x9d6520,_0x5f5924){return client[_0x0e56('0x1')](_0x0e56('0x2'),{'body':_0x5f5924,'options':{'where':{'uniqueid':_0x9d6520},'order':[['id',_0x0e56('0x3')]],'limit':0x1},'log':_0x0e56('0x2')});}; \ No newline at end of file +var _0xd3be=['update','UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x4e510d,_0x4c7a1d){var _0x2417cc=function(_0x24e262){while(--_0x24e262){_0x4e510d['push'](_0x4e510d['shift']());}};_0x2417cc(++_0x4c7a1d);}(_0xd3be,0x1bc));var _0xed3b=function(_0xc4ac56,_0x5a90c2){_0xc4ac56=_0xc4ac56-0x0;var _0x5da350=_0xd3be[_0xc4ac56];return _0x5da350;};'use strict';var client=require(_0xed3b('0x0'));exports[_0xed3b('0x1')]=function(_0x3d7a73){return client[_0xed3b('0x2')](_0xed3b('0x3'),{'body':_0x3d7a73,'log':_0xed3b('0x3')});};exports[_0xed3b('0x4')]=function(_0x55e637,_0x1c91f6){return client[_0xed3b('0x2')](_0xed3b('0x5'),{'body':_0x1c91f6,'options':{'where':{'uniqueid':_0x55e637},'order':[['id',_0xed3b('0x6')]],'limit':0x1},'log':_0xed3b('0x5')});}; \ 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 3f4ad18..6e19459 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 _0xf10c=['message','join','stop','find','agents','createQueue','atimeout','channel','format','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0xf10c,0x1d2));var _0xcf10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf10c[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xcf10('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0xcf10('0x1'))(_0xcf10('0x2'));var strategy=require(_0xcf10('0x3'));var queue=schema({'name':{'type':_0xcf10('0x4'),'required':!![],'message':_0xcf10('0x5')},'timeout':{'type':_0xcf10('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x12056d,_0x2cec6e,_0x2816c6){return logger[_0xcf10('0x7')](util['format'](_0xcf10('0x8'),_0x12056d,_0x2cec6e['name'],_0x2816c6));}function handleFindAgent(_0x3ee8cd){return function(_0x55a09d){return _0x55a09d[_0xcf10('0x9')][_0xcf10('0xa')]()===_0x3ee8cd[_0xcf10('0xa')]();};}exports[_0xcf10('0xb')]=function(_0xdefb52,_0x39b116,_0x2f4be2,_0x2e0e80){return function(_0x4add06){try{var _0x5e942f={'name':_0x39b116[0x0],'timeout':_0x39b116[0x1]};var _0xe0001a=queue['validate'](_0x5e942f,{'typecast':!![]});if(_0xe0001a['length']){logger[_0xcf10('0xc')](_0xcf10('0xd'),_0xdefb52,_[_0xcf10('0xe')](_0xe0001a,_0xcf10('0xf'))[_0xcf10('0x10')](',\x20'));_0x4add06[_0xcf10('0x11')]();}else{var _0x26d7ce=_[_0xcf10('0x12')](_0x2f4be2[_0xcf10('0x13')],handleFindAgent(_0x5e942f[_0xcf10('0x9')]));if(_0x26d7ce){var _0x109270=(_0x5e942f['timeout']||0xa)*0x3e8;var _0x560a2c,_0x5e747a;var _0x19f2e8=seqqueue[_0xcf10('0x14')](_0x109270);_0x19f2e8['id']=_0xdefb52;_0x19f2e8[_0xcf10('0x15')]=_0x109270;_0x19f2e8[_0xcf10('0x16')]=_0x2e0e80[_0xcf10('0x16')];writeLog(_0xdefb52,_0x26d7ce,util[_0xcf10('0x17')](_0xcf10('0x18'),_0x109270));_0x2f4be2['rules'][_0xdefb52]['on'](_0xcf10('0x19'),function(){logger['info'](_0xcf10('0x1a'),_0xdefb52);clearTimeout(_0x5e747a);_0x5e747a=undefined;_0x19f2e8[_0xcf10('0x1b')]();if(_0x2f4be2['rules'][_0xdefb52]){delete _0x2f4be2[_0xcf10('0x1c')][_0xdefb52];}_0x4add06['stop']();});_0x2f4be2[_0xcf10('0x1c')][_0xdefb52]['on'](_0xcf10('0x1d'),function(){if(_0x2f4be2[_0xcf10('0x1c')][_0xdefb52]){delete _0x2f4be2[_0xcf10('0x1c')][_0xdefb52];}});_0x5e747a=setTimeout(function(){logger[_0xcf10('0x7')](_0xcf10('0x1e'),_0xdefb52);clearTimeout(_0x5e747a);_0x19f2e8[_0xcf10('0x1b')]();_0x4add06[_0xcf10('0x1f')]();},_0x109270);strategy[_0xcf10('0x20')](_0x19f2e8,_0x26d7ce,_0x2f4be2,_0x2e0e80);}else{logger[_0xcf10('0xc')](_0xcf10('0x21'),_0xdefb52,_0x5e942f[_0xcf10('0x9')]);_0x4add06['stop']();}}}catch(_0x317b52){console[_0xcf10('0x22')](_0x317b52);logger[_0xcf10('0xc')](_0xcf10('0x23'),_0xdefb52,_0x317b52[_0xcf10('0x24')]);_0x4add06['stop']();}};}; \ No newline at end of file +var _0x7d78=['./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','format','name','toLowerCase','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','agents','timeout','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','routing'];(function(_0x386757,_0x4e1697){var _0x5c8ef5=function(_0x5bb3ca){while(--_0x5bb3ca){_0x386757['push'](_0x386757['shift']());}};_0x5c8ef5(++_0x4e1697);}(_0x7d78,0x187));var _0x87d7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7d78[_0xa464c9];return _0x3d73c4;};'use strict';var schema=require('validate');var _=require(_0x87d7('0x0'));var util=require(_0x87d7('0x1'));var seqqueue=require(_0x87d7('0x2'));var logger=require(_0x87d7('0x3'))(_0x87d7('0x4'));var strategy=require(_0x87d7('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x87d7('0x6')},'timeout':{'type':_0x87d7('0x7'),'message':_0x87d7('0x8')}});function writeLog(_0x52c127,_0xa2f962,_0x10d80c){return logger[_0x87d7('0x9')](util[_0x87d7('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x52c127,_0xa2f962[_0x87d7('0xb')],_0x10d80c));}function handleFindAgent(_0x131588){return function(_0x58b33f){return _0x58b33f['name'][_0x87d7('0xc')]()===_0x131588[_0x87d7('0xc')]();};}exports['consequence']=function(_0x5b6fe0,_0xa678dd,_0x1fc834,_0x1b8221){return function(_0x53a5e6){try{var _0x445169={'name':_0xa678dd[0x0],'timeout':_0xa678dd[0x1]};var _0x23ed0a=queue['validate'](_0x445169,{'typecast':!![]});if(_0x23ed0a[_0x87d7('0xd')]){logger[_0x87d7('0xe')](_0x87d7('0xf'),_0x5b6fe0,_[_0x87d7('0x10')](_0x23ed0a,_0x87d7('0x11'))[_0x87d7('0x12')](',\x20'));_0x53a5e6[_0x87d7('0x13')]();}else{var _0x3a8473=_[_0x87d7('0x14')](_0x1fc834[_0x87d7('0x15')],handleFindAgent(_0x445169[_0x87d7('0xb')]));if(_0x3a8473){var _0xf3a1a0=(_0x445169[_0x87d7('0x16')]||0xa)*0x3e8;var _0x49d9e3,_0x3588fb;var _0x4eb970=seqqueue['createQueue'](_0xf3a1a0);_0x4eb970['id']=_0x5b6fe0;_0x4eb970[_0x87d7('0x17')]=_0xf3a1a0;_0x4eb970[_0x87d7('0x18')]=_0x1b8221[_0x87d7('0x18')];writeLog(_0x5b6fe0,_0x3a8473,util['format'](_0x87d7('0x19'),_0xf3a1a0));_0x1fc834[_0x87d7('0x1a')][_0x5b6fe0]['on'](_0x87d7('0x1b'),function(){logger['info'](_0x87d7('0x1c'),_0x5b6fe0);clearTimeout(_0x3588fb);_0x3588fb=undefined;_0x4eb970[_0x87d7('0x1d')]();if(_0x1fc834[_0x87d7('0x1a')][_0x5b6fe0]){delete _0x1fc834[_0x87d7('0x1a')][_0x5b6fe0];}_0x53a5e6['stop']();});_0x1fc834[_0x87d7('0x1a')][_0x5b6fe0]['on'](_0x87d7('0x1e'),function(){if(_0x1fc834[_0x87d7('0x1a')][_0x5b6fe0]){delete _0x1fc834[_0x87d7('0x1a')][_0x5b6fe0];}});_0x3588fb=setTimeout(function(){logger[_0x87d7('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x5b6fe0);clearTimeout(_0x3588fb);_0x4eb970[_0x87d7('0x1d')]();_0x53a5e6[_0x87d7('0x1f')]();},_0xf3a1a0);strategy[_0x87d7('0x20')](_0x4eb970,_0x3a8473,_0x1fc834,_0x1b8221);}else{logger[_0x87d7('0xe')](_0x87d7('0x21'),_0x5b6fe0,_0x445169[_0x87d7('0xb')]);_0x53a5e6[_0x87d7('0x13')]();}}}catch(_0x52f43c){console['log'](_0x52f43c);logger[_0x87d7('0xe')](_0x87d7('0x22'),_0x5b6fe0,_0x52f43c[_0x87d7('0x23')]);_0x53a5e6['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index d2c6d2b..334c550 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 _0x5fc3=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','chat','ChatWebsiteId','AccountId','upperFirst','InteractionId','created','Message','create','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','body','channel','postText','error','amazonlex','dialogState','lodash','moment','./utils','../../../../config/logger'];(function(_0x24e5a0,_0x4f73bb){var _0x36d513=function(_0x34ae0f){while(--_0x34ae0f){_0x24e5a0['push'](_0x24e5a0['shift']());}};_0x36d513(++_0x4f73bb);}(_0x5fc3,0xa8));var _0x35fc=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x5fc3[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x35fc('0x0'));var moment=require(_0x35fc('0x1'));var AWS=require('aws-sdk');var utils=require(_0x35fc('0x2'));var logger=require(_0x35fc('0x3'))(_0x35fc('0x4'));var rpc={'chatMessage':require(_0x35fc('0x5')),'openchannelMessage':require(_0x35fc('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x35fc('0x7')),'faxMessage':require(_0x35fc('0x8')),'whatsappMessage':require(_0x35fc('0x9'))};exports['consequence']=function(_0x5754be,_0x19a0d1){return function(_0x508b32){try{if(!_[_0x35fc('0xa')](this[_0x35fc('0xb')][_0x35fc('0xc')])){logger[_0x35fc('0xd')](_0x35fc('0xe'),_0x5754be,_0x35fc('0xf'));return _0x508b32[_0x35fc('0x10')]();}var _0x565f95={'ContactId':this[_0x35fc('0x11')]['id'],'sentAt':moment()[_0x35fc('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x35fc('0x13')};var _0x33f491=this['channel'];if(_0x33f491===_0x35fc('0x14')){_0x565f95[_0x35fc('0x15')]=this['account']['id'];}else{_0x565f95[_['upperFirst'](_0x33f491)+_0x35fc('0x16')]=this['account']['id'];}_0x565f95[_[_0x35fc('0x17')](_0x33f491)+_0x35fc('0x18')]=this[_0x35fc('0xb')]['id'];if(this[_0x35fc('0xb')][_0x35fc('0x19')]){var _0x5cfe94=_0x19a0d1[0x4];if(!_['isEmpty'](_0x5cfe94)){_0x565f95['body']=utils['getMustacheRender'](_0x5cfe94,this);return rpc[_0x33f491+_0x35fc('0x1a')][_0x35fc('0x1b')](_0x565f95)[_0x35fc('0x1c')](function(_0x154958){logger[_0x35fc('0xd')](_0x35fc('0xe'),_0x5754be,_0x565f95['body']);})[_0x35fc('0x1d')](function(_0x45c8b7){logger['error'](_0x35fc('0xe'),_0x5754be,JSON[_0x35fc('0x1e')](_0x45c8b7));})[_0x35fc('0x1f')](function(){logger['info'](_0x35fc('0x20'),_0x5754be);_0x508b32[_0x35fc('0x21')]();});}else{logger[_0x35fc('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5754be);_0x508b32[_0x35fc('0x21')]();}}else{var _0x350a27=this;var _0x3229d1=new AWS[(_0x35fc('0x22'))]({'accessKeyId':_0x19a0d1[0x0],'secretAccessKey':_0x19a0d1[0x1],'region':_0x19a0d1[0x2]});var _0x20ffde={'botAlias':_0x35fc('0x23'),'botName':_0x19a0d1[0x3],'inputText':this[_0x35fc('0x24')][_0x35fc('0x25')],'userId':this[_0x35fc('0x26')]+':'+this[_0x35fc('0xb')]['id']['toString']()};_0x3229d1[_0x35fc('0x27')](_0x20ffde,function(_0xd5399f,_0x257719){if(_0xd5399f){logger[_0x35fc('0x28')](_0x35fc('0xe'),_0x5754be,_0xd5399f['message']);_0x508b32[_0x35fc('0x10')]();}else if(_0x257719&&_0x257719[_0x35fc('0x24')]){_0x350a27['body'][_0x35fc('0x29')]=_0x257719;_0x565f95[_0x35fc('0x25')]=_0x257719[_0x35fc('0x24')];return rpc[_0x33f491+'Message'][_0x35fc('0x1b')](_0x565f95)['then'](function(_0x1bf180){logger[_0x35fc('0xd')]('[%s][AMAZONLEX]\x20%s',_0x5754be,_0x565f95['body']);if(_0x257719[_0x35fc('0x2a')]=='Failed'){_0x508b32[_0x35fc('0x10')]();}else{_0x508b32[_0x35fc('0x21')]();}})['catch'](function(_0x26b7cb){logger[_0x35fc('0x28')](_0x35fc('0xe'),_0x5754be,JSON[_0x35fc('0x1e')](_0x26b7cb));_0x508b32[_0x35fc('0x10')]();});}else{_0x508b32[_0x35fc('0x10')]();}});}}catch(_0x11ccdb){logger[_0x35fc('0x28')]('[%s][AMAZONLEX]\x20%s',_0x5754be,JSON[_0x35fc('0x1e')](_0x11ccdb));_0x508b32[_0x35fc('0x21')]();}};}; \ No newline at end of file +var _0x31f0=['[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','message','postText','amazonlex','dialogState','Failed','catch','error','lodash','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','Message','create','then','[%s][AMAZONLEX]\x20%s','body','stringify','finally'];(function(_0x5abb00,_0x342d70){var _0xf9b854=function(_0x43ac30){while(--_0x43ac30){_0x5abb00['push'](_0x5abb00['shift']());}};_0xf9b854(++_0x342d70);}(_0x31f0,0xb7));var _0x031f=function(_0x1ff17e,_0x24ed71){_0x1ff17e=_0x1ff17e-0x0;var _0x4b4893=_0x31f0[_0x1ff17e];return _0x4b4893;};'use strict';var _=require(_0x031f('0x0'));var moment=require('moment');var AWS=require(_0x031f('0x1'));var utils=require('./utils');var logger=require(_0x031f('0x2'))(_0x031f('0x3'));var rpc={'chatMessage':require(_0x031f('0x4')),'openchannelMessage':require(_0x031f('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x031f('0x6')),'faxMessage':require(_0x031f('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x56328c,_0x3dc98e){return function(_0x487e65){try{if(!_[_0x031f('0x8')](this[_0x031f('0x9')][_0x031f('0xa')])){logger[_0x031f('0xb')]('[%s][AMAZONLEX]\x20%s',_0x56328c,_0x031f('0xc'));return _0x487e65[_0x031f('0xd')]();}var _0x327f11={'ContactId':this[_0x031f('0xe')]['id'],'sentAt':moment()[_0x031f('0xf')](_0x031f('0x10')),'direction':_0x031f('0x11')};var _0x3fd541=this['channel'];if(_0x3fd541===_0x031f('0x12')){_0x327f11[_0x031f('0x13')]=this[_0x031f('0x14')]['id'];}else{_0x327f11[_[_0x031f('0x15')](_0x3fd541)+_0x031f('0x16')]=this[_0x031f('0x14')]['id'];}_0x327f11[_[_0x031f('0x15')](_0x3fd541)+'InteractionId']=this[_0x031f('0x9')]['id'];if(this[_0x031f('0x9')][_0x031f('0x17')]){var _0x2e3dfe=_0x3dc98e[0x4];if(!_[_0x031f('0x18')](_0x2e3dfe)){_0x327f11['body']=utils['getMustacheRender'](_0x2e3dfe,this);return rpc[_0x3fd541+_0x031f('0x19')][_0x031f('0x1a')](_0x327f11)[_0x031f('0x1b')](function(_0x286177){logger['info'](_0x031f('0x1c'),_0x56328c,_0x327f11[_0x031f('0x1d')]);})['catch'](function(_0xcdae16){logger['error'](_0x031f('0x1c'),_0x56328c,JSON[_0x031f('0x1e')](_0xcdae16));})[_0x031f('0x1f')](function(){logger[_0x031f('0xb')](_0x031f('0x20'),_0x56328c);_0x487e65[_0x031f('0x21')]();});}else{logger[_0x031f('0xb')](_0x031f('0x22'),_0x56328c);_0x487e65[_0x031f('0x21')]();}}else{var _0x345bde=this;var _0x29dd6e=new AWS['LexRuntime']({'accessKeyId':_0x3dc98e[0x0],'secretAccessKey':_0x3dc98e[0x1],'region':_0x3dc98e[0x2]});var _0xf72793={'botAlias':_0x031f('0x23'),'botName':_0x3dc98e[0x3],'inputText':this[_0x031f('0x24')]['body'],'userId':this['channel']+':'+this[_0x031f('0x9')]['id']['toString']()};_0x29dd6e[_0x031f('0x25')](_0xf72793,function(_0x57f6c4,_0x54d054){if(_0x57f6c4){logger['error'](_0x031f('0x1c'),_0x56328c,_0x57f6c4[_0x031f('0x24')]);_0x487e65[_0x031f('0xd')]();}else if(_0x54d054&&_0x54d054[_0x031f('0x24')]){_0x345bde['body'][_0x031f('0x26')]=_0x54d054;_0x327f11['body']=_0x54d054[_0x031f('0x24')];return rpc[_0x3fd541+_0x031f('0x19')][_0x031f('0x1a')](_0x327f11)['then'](function(_0x35af16){logger[_0x031f('0xb')]('[%s][AMAZONLEX]\x20%s',_0x56328c,_0x327f11[_0x031f('0x1d')]);if(_0x54d054[_0x031f('0x27')]==_0x031f('0x28')){_0x487e65['next']();}else{_0x487e65[_0x031f('0x21')]();}})[_0x031f('0x29')](function(_0xb6ed6c){logger[_0x031f('0x2a')](_0x031f('0x1c'),_0x56328c,JSON[_0x031f('0x1e')](_0xb6ed6c));_0x487e65['next']();});}else{_0x487e65[_0x031f('0xd')]();}});}}catch(_0xab24ad){logger[_0x031f('0x2a')](_0x031f('0x1c'),_0x56328c,JSON[_0x031f('0x1e')](_0xab24ad));_0x487e65[_0x031f('0x21')]();}};}; \ 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 df6b714..47ae4e1 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 _0x4f02=['','','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','body','catch','finally','stop','lodash','moment','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../mailRpc','consequence','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','getMustacheRender','contact','format','YYYY-MM-DD\x20HH:mm:ss','message','from','phone','read','subject','Re:\x20','chat','ChatWebsiteId','account','upperFirst','channel','AccountId','InteractionId','Message','mail','Smtp','service','host','port','secure','authentication','auth','user','pass','inReplyTo','messageId','html'];(function(_0x428c82,_0x4ed4de){var _0x491258=function(_0x48345a){while(--_0x48345a){_0x428c82['push'](_0x428c82['shift']());}};_0x491258(++_0x4ed4de);}(_0x4f02,0x135));var _0x24f0=function(_0x76d221,_0x5499d0){_0x76d221=_0x76d221-0x0;var _0x31972b=_0x4f02[_0x76d221];return _0x31972b;};'use strict';var _=require(_0x24f0('0x0'));var moment=require(_0x24f0('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x24f0('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x24f0('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x24f0('0x4')),'faxMessage':require(_0x24f0('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};var mailRpc=require(_0x24f0('0x6'));exports[_0x24f0('0x7')]=function(_0x56a02e,_0x2543f5){return function(_0x425844){try{if(_0x2543f5[0x0]==='1'&&(_['isNil'](this[_0x24f0('0x8')][_0x24f0('0x9')])||!this[_0x24f0('0x8')][_0x24f0('0x9')])){logger[_0x24f0('0xa')](_0x24f0('0xb'),_0x56a02e,_0x24f0('0xc'));return _0x425844[_0x24f0('0xd')]();}var _0x47722c=this['channel'];var _0x1cc903={'body':utils[_0x24f0('0xe')](_0x2543f5[0x1],this),'ContactId':this[_0x24f0('0xf')]['id'],'sentAt':moment()[_0x24f0('0x10')](_0x24f0('0x11')),'direction':'out'};if(this['message']){_0x1cc903['to']=this[_0x24f0('0x12')][_0x24f0('0x13')]||'';_0x1cc903['cc']=this['message']['cc']||'';_0x1cc903[_0x24f0('0x13')]=this[_0x24f0('0x12')]['to']||'';_0x1cc903['phone']=this[_0x24f0('0x12')][_0x24f0('0x14')]||'';_0x1cc903[_0x24f0('0x15')]=!![];if(this['message']['subject']){_0x1cc903[_0x24f0('0x16')]='';_0x1cc903['subject']+=_['startsWith'](this[_0x24f0('0x12')]['subject'],'Re:')?'':_0x24f0('0x17');_0x1cc903['subject']+=this[_0x24f0('0x12')][_0x24f0('0x16')];}}if(this['channel']===_0x24f0('0x18')){_0x1cc903[_0x24f0('0x19')]=this[_0x24f0('0x1a')]['id'];}else{_0x1cc903[_[_0x24f0('0x1b')](this[_0x24f0('0x1c')])+_0x24f0('0x1d')]=this[_0x24f0('0x1a')]['id'];}_0x1cc903[_['upperFirst'](this['channel'])+_0x24f0('0x1e')]=this[_0x24f0('0x8')]['id'];if(rpc[this[_0x24f0('0x1c')]+_0x24f0('0x1f')]){if(this[_0x24f0('0x1c')]===_0x24f0('0x20')){var _0x45cb89={'tls':{'rejectUnauthorized':![]}};if(this[_0x24f0('0x1a')][_0x24f0('0x21')]['service']){_0x45cb89[_0x24f0('0x22')]=this['account']['Smtp']['service'];}else{_0x45cb89[_0x24f0('0x23')]=this[_0x24f0('0x1a')][_0x24f0('0x21')][_0x24f0('0x23')];_0x45cb89[_0x24f0('0x24')]=this[_0x24f0('0x1a')][_0x24f0('0x21')][_0x24f0('0x24')];_0x45cb89['secure']=this[_0x24f0('0x1a')][_0x24f0('0x21')][_0x24f0('0x25')];}if(this[_0x24f0('0x1a')][_0x24f0('0x21')][_0x24f0('0x26')]){_0x45cb89[_0x24f0('0x27')]={'user':this[_0x24f0('0x1a')][_0x24f0('0x21')][_0x24f0('0x28')],'pass':this['account']['Smtp'][_0x24f0('0x29')]};}_0x1cc903[_0x24f0('0x2a')]=this[_0x24f0('0x12')][_0x24f0('0x2b')];_0x1cc903[_0x24f0('0x2c')]=_0x24f0('0x2d')+_['replace'](_0x1cc903['body'],_0x24f0('0x2e'),'','replace','body','','sendMailMessage','then','info','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','[%s][AUTOREPLY]\x20%s','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','error','stop','lodash'];(function(_0x49e1cd,_0x58403d){var _0x546c63=function(_0x2216b5){while(--_0x2216b5){_0x49e1cd['push'](_0x49e1cd['shift']());}};_0x546c63(++_0x58403d);}(_0xf44b,0x161));var _0xbf44=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xf44b[_0x4b7895];return _0x264180;};'use strict';var _=require(_0xbf44('0x0'));var moment=require(_0xbf44('0x1'));var utils=require(_0xbf44('0x2'));var logger=require(_0xbf44('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xbf44('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xbf44('0x5')),'faxMessage':require(_0xbf44('0x6')),'whatsappMessage':require(_0xbf44('0x7'))};var mailRpc=require(_0xbf44('0x8'));exports[_0xbf44('0x9')]=function(_0x3cc8ea,_0x1e854a){return function(_0x222c8b){try{if(_0x1e854a[0x0]==='1'&&(_[_0xbf44('0xa')](this[_0xbf44('0xb')][_0xbf44('0xc')])||!this[_0xbf44('0xb')][_0xbf44('0xc')])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x3cc8ea,_0xbf44('0xd'));return _0x222c8b[_0xbf44('0xe')]();}var _0x3fd69b=this['channel'];var _0x530d2b={'body':utils['getMustacheRender'](_0x1e854a[0x1],this),'ContactId':this[_0xbf44('0xf')]['id'],'sentAt':moment()[_0xbf44('0x10')](_0xbf44('0x11')),'direction':_0xbf44('0x12')};if(this[_0xbf44('0x13')]){_0x530d2b['to']=this['message'][_0xbf44('0x14')]||'';_0x530d2b['cc']=this['message']['cc']||'';_0x530d2b['from']=this[_0xbf44('0x13')]['to']||'';_0x530d2b[_0xbf44('0x15')]=this['message'][_0xbf44('0x15')]||'';_0x530d2b[_0xbf44('0x16')]=!![];if(this['message'][_0xbf44('0x17')]){_0x530d2b[_0xbf44('0x17')]='';_0x530d2b['subject']+=_[_0xbf44('0x18')](this[_0xbf44('0x13')][_0xbf44('0x17')],_0xbf44('0x19'))?'':_0xbf44('0x1a');_0x530d2b[_0xbf44('0x17')]+=this[_0xbf44('0x13')]['subject'];}}if(this[_0xbf44('0x1b')]==='chat'){_0x530d2b['ChatWebsiteId']=this['account']['id'];}else{_0x530d2b[_[_0xbf44('0x1c')](this[_0xbf44('0x1b')])+'AccountId']=this['account']['id'];}_0x530d2b[_[_0xbf44('0x1c')](this[_0xbf44('0x1b')])+_0xbf44('0x1d')]=this[_0xbf44('0xb')]['id'];if(rpc[this[_0xbf44('0x1b')]+_0xbf44('0x1e')]){if(this[_0xbf44('0x1b')]===_0xbf44('0x1f')){var _0x7c78aa={'tls':{'rejectUnauthorized':![]}};if(this[_0xbf44('0x20')]['Smtp'][_0xbf44('0x21')]){_0x7c78aa['service']=this[_0xbf44('0x20')][_0xbf44('0x22')][_0xbf44('0x21')];}else{_0x7c78aa[_0xbf44('0x23')]=this['account'][_0xbf44('0x22')]['host'];_0x7c78aa[_0xbf44('0x24')]=this['account']['Smtp']['port'];_0x7c78aa[_0xbf44('0x25')]=this[_0xbf44('0x20')]['Smtp'][_0xbf44('0x25')];}if(this['account'][_0xbf44('0x22')]['authentication']){_0x7c78aa[_0xbf44('0x26')]={'user':this[_0xbf44('0x20')]['Smtp'][_0xbf44('0x27')],'pass':this[_0xbf44('0x20')]['Smtp'][_0xbf44('0x28')]};}_0x530d2b['inReplyTo']=this[_0xbf44('0x13')]['messageId'];_0x530d2b['html']=_0xbf44('0x29')+_[_0xbf44('0x2a')](_0x530d2b[_0xbf44('0x2b')],_0xbf44('0x2c'),']+(>|$)/g,''),'priorityTrue':_0x5e4fd8[0x1],'priorityFalse':_0x5e4fd8[0x2]};var _0x688638=gotoif[_0xda3e('0xc')](_0x4fa528,{'typecast':!![]});if(_0x688638['length']){logger['error'](_0xda3e('0xd'),_0x4bed48,_[_0xda3e('0xe')](_0x688638,_0xda3e('0xf'))[_0xda3e('0x10')](',\x20'));_0x13ffd2[_0xda3e('0x11')]();}else{try{var _0x17c73d=eval('('+_0x4fa528[_0xda3e('0x12')]+')');var _0x33a4db=_0x17c73d?_0x4fa528['priorityTrue']:_0x4fa528[_0xda3e('0x13')];logger[_0xda3e('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x4bed48,_0x4fa528[_0xda3e('0x12')],_0x17c73d,_0x33a4db||'next');if(_0x33a4db){var _0xb09de3=_[_0xda3e('0x15')](_0x13ffd2[_0xda3e('0x16')](),{'p':_0x33a4db});if(_0xb09de3>=0x0){logger[_0xda3e('0x14')](_0xda3e('0x17'),_0x4bed48,_0x33a4db||_0xda3e('0x18'),_0xb09de3);_0x13ffd2[_0xda3e('0x18')](_0xb09de3);}else{logger['info'](_0xda3e('0x19'),_0x4bed48,_0x33a4db||_0xda3e('0x18'));_0x13ffd2['stop']();}}else{_0x13ffd2['next']();}}catch(_0x3bb01a){logger[_0xda3e('0x1a')](_0xda3e('0x1b'),_0x4bed48,_0x3bb01a[_0xda3e('0xf')]);_0x13ffd2['stop']();}}}catch(_0x41e6fc){logger[_0xda3e('0x1a')](_0xda3e('0xd'),_0x4bed48,JSON['stringify'](_0x41e6fc));_0x13ffd2['stop']();}};}; \ No newline at end of file +var _0x0529=['condition','next','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','routing','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','message','join','stop','priorityTrue','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s'];(function(_0x494022,_0xdc326c){var _0xfb72f0=function(_0x10cd99){while(--_0x10cd99){_0x494022['push'](_0x494022['shift']());}};_0xfb72f0(++_0xdc326c);}(_0x0529,0x1e9));var _0x9052=function(_0x49b2fc,_0x36ca03){_0x49b2fc=_0x49b2fc-0x0;var _0x1f0a44=_0x0529[_0x49b2fc];return _0x1f0a44;};'use strict';var schema=require(_0x9052('0x0'));var _=require(_0x9052('0x1'));var htmlToText=require(_0x9052('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x9052('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x9052('0x4'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x9052('0x4'),'message':_0x9052('0x5')}});exports[_0x9052('0x6')]=function(_0x46258a,_0x2f2a0f){return function(_0x3bd4dc){try{var _0x51c273={'condition':htmlToText[_0x9052('0x7')](utils[_0x9052('0x8')](_0x2f2a0f[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2f2a0f[0x1],'priorityFalse':_0x2f2a0f[0x2]};var _0x26ab6a=gotoif['validate'](_0x51c273,{'typecast':!![]});if(_0x26ab6a[_0x9052('0x9')]){logger['error']('[%s][GOTOIF]\x20%s',_0x46258a,_['map'](_0x26ab6a,_0x9052('0xa'))[_0x9052('0xb')](',\x20'));_0x3bd4dc[_0x9052('0xc')]();}else{try{var _0x10741d=eval('('+_0x51c273['condition']+')');var _0x445f7b=_0x10741d?_0x51c273[_0x9052('0xd')]:_0x51c273['priorityFalse'];logger['info'](_0x9052('0xe'),_0x46258a,_0x51c273[_0x9052('0xf')],_0x10741d,_0x445f7b||_0x9052('0x10'));if(_0x445f7b){var _0x5b9ee1=_['findIndex'](_0x3bd4dc[_0x9052('0x11')](),{'p':_0x445f7b});if(_0x5b9ee1>=0x0){logger[_0x9052('0x12')](_0x9052('0x13'),_0x46258a,_0x445f7b||_0x9052('0x10'),_0x5b9ee1);_0x3bd4dc['next'](_0x5b9ee1);}else{logger[_0x9052('0x12')](_0x9052('0x14'),_0x46258a,_0x445f7b||_0x9052('0x10'));_0x3bd4dc[_0x9052('0xc')]();}}else{_0x3bd4dc[_0x9052('0x10')]();}}catch(_0x2b25bf){logger[_0x9052('0x15')](_0x9052('0x16'),_0x46258a,_0x2b25bf[_0x9052('0xa')]);_0x3bd4dc[_0x9052('0xc')]();}}}catch(_0x48de39){logger[_0x9052('0x15')]('[%s][GOTOIF]\x20%s',_0x46258a,JSON[_0x9052('0x17')](_0x48de39));_0x3bd4dc['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index a20227b..a08c60c 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 _0x24ab=['priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s'];(function(_0x1f550f,_0x51f818){var _0x130408=function(_0x392474){while(--_0x392474){_0x1f550f['push'](_0x1f550f['shift']());}};_0x130408(++_0x51f818);}(_0x24ab,0x19e));var _0xb24a=function(_0x2c39c3,_0x3d9848){_0x2c39c3=_0x2c39c3-0x0;var _0x74f703=_0x24ab[_0x2c39c3];return _0x74f703;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0xb24a('0x0'),'required':!![],'message':_0xb24a('0x1')}});exports[_0xb24a('0x2')]=function(_0x406615,_0x1e387b){return function(_0x354f02){try{var _0x163200={'priority':_0x1e387b[0x0]};var _0x2bf450=gotop['validate'](_0x163200,{'typecast':!![]});if(_0x2bf450[_0xb24a('0x3')]){logger[_0xb24a('0x4')]('[%s][GOTOP]\x20%s',_0x406615,_[_0xb24a('0x5')](_0x2bf450,_0xb24a('0x6'))[_0xb24a('0x7')](',\x20'));_0x354f02[_0xb24a('0x8')]();}else{logger[_0xb24a('0x9')](_0xb24a('0xa'),_0x406615,_0x163200[_0xb24a('0xb')]);if(_0x163200[_0xb24a('0xb')]){var _0x9ee0ce=_[_0xb24a('0xc')](_0x354f02[_0xb24a('0xd')](),{'p':_0x163200['priority']});if(_0x9ee0ce>=0x0){logger[_0xb24a('0x9')](_0xb24a('0xe'),_0x406615,_0x163200[_0xb24a('0xb')]||_0xb24a('0xf'),_0x9ee0ce);_0x354f02['next'](_0x9ee0ce);}else{logger['info'](_0xb24a('0x10'),_0x406615,_0x163200[_0xb24a('0xb')]||_0xb24a('0xf'));_0x354f02[_0xb24a('0x8')]();}}else{_0x354f02[_0xb24a('0xf')]();}}}catch(_0x14325f){logger['error']('[%s][GOTOP]\x20%s',_0x406615,JSON['stringify'](_0x14325f));_0x354f02['stop']();}};}; \ No newline at end of file +var _0x7d80=['rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','next','stringify','lodash','../../../../config/logger','routing','consequence','validate','length','error','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex'];(function(_0x1333e8,_0x50ae0c){var _0x479b09=function(_0x26804a){while(--_0x26804a){_0x1333e8['push'](_0x1333e8['shift']());}};_0x479b09(++_0x50ae0c);}(_0x7d80,0x181));var _0x07d8=function(_0x164e1d,_0x3d517){_0x164e1d=_0x164e1d-0x0;var _0x2ca89e=_0x7d80[_0x164e1d];return _0x2ca89e;};'use strict';var schema=require('validate');var _=require(_0x07d8('0x0'));var logger=require(_0x07d8('0x1'))(_0x07d8('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x07d8('0x3')]=function(_0x3d487c,_0xffc42f){return function(_0x17f921){try{var _0x13511a={'priority':_0xffc42f[0x0]};var _0x51b175=gotop[_0x07d8('0x4')](_0x13511a,{'typecast':!![]});if(_0x51b175[_0x07d8('0x5')]){logger[_0x07d8('0x6')]('[%s][GOTOP]\x20%s',_0x3d487c,_[_0x07d8('0x7')](_0x51b175,_0x07d8('0x8'))[_0x07d8('0x9')](',\x20'));_0x17f921[_0x07d8('0xa')]();}else{logger[_0x07d8('0xb')](_0x07d8('0xc'),_0x3d487c,_0x13511a['priority']);if(_0x13511a[_0x07d8('0xd')]){var _0x8f33e1=_[_0x07d8('0xe')](_0x17f921[_0x07d8('0xf')](),{'p':_0x13511a['priority']});if(_0x8f33e1>=0x0){logger[_0x07d8('0xb')](_0x07d8('0x10'),_0x3d487c,_0x13511a[_0x07d8('0xd')]||'next',_0x8f33e1);_0x17f921['next'](_0x8f33e1);}else{logger[_0x07d8('0xb')](_0x07d8('0x11'),_0x3d487c,_0x13511a[_0x07d8('0xd')]||_0x07d8('0x12'));_0x17f921[_0x07d8('0xa')]();}}else{_0x17f921['next']();}}}catch(_0x3eeaf0){logger[_0x07d8('0x6')]('[%s][GOTOP]\x20%s',_0x3d487c,JSON[_0x07d8('0x13')](_0x3eeaf0));_0x17f921[_0x07d8('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index be18b4f..85f4eb1 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 _0xe916=['catch','error','stop','stringify','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','account','upperFirst','AccountId','interaction','channel','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next'];(function(_0x36a469,_0x59d84c){var _0x3347fc=function(_0x3860e7){while(--_0x3860e7){_0x36a469['push'](_0x36a469['shift']());}};_0x3347fc(++_0x59d84c);}(_0xe916,0x112));var _0x6e91=function(_0x4fbf32,_0x36cbd4){_0x4fbf32=_0x4fbf32-0x0;var _0x3d6a29=_0xe916[_0x4fbf32];return _0x3d6a29;};'use strict';var _=require(_0x6e91('0x0'));var utils=require(_0x6e91('0x1'));var logger=require('../../../../config/logger')(_0x6e91('0x2'));var rpc={'chatMessage':require(_0x6e91('0x3')),'openchannelMessage':require(_0x6e91('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x6e91('0x5')),'whatsappMessage':require(_0x6e91('0x6'))};exports[_0x6e91('0x7')]=function(_0x3c33da,_0x516d93){return function(_0x1512b0){try{var _0x10de6b={'body':utils[_0x6e91('0x8')](_0x516d93[0x0],this),'ContactId':this[_0x6e91('0x9')]['id']};if(this['channel']===_0x6e91('0xa')){_0x10de6b['ChatWebsiteId']=this[_0x6e91('0xb')]['id'];}else{_0x10de6b[_[_0x6e91('0xc')](this['channel'])+_0x6e91('0xd')]=this[_0x6e91('0xb')]['id'];}_0x10de6b[_[_0x6e91('0xc')](this['channel'])+'InteractionId']=this[_0x6e91('0xe')]['id'];if(rpc[this[_0x6e91('0xf')]+_0x6e91('0x10')]){return rpc[this[_0x6e91('0xf')]+_0x6e91('0x10')][_0x6e91('0x11')](_0x10de6b)[_0x6e91('0x12')](function(_0x2d12aa){logger[_0x6e91('0x13')](_0x6e91('0x14'),_0x3c33da,_0x10de6b[_0x6e91('0x15')]);_0x1512b0[_0x6e91('0x16')]();})[_0x6e91('0x17')](function(_0x424c1a){logger[_0x6e91('0x18')]('[%s][MESSAGE]\x20%s',_0x3c33da,JSON['stringify'](_0x424c1a));_0x1512b0[_0x6e91('0x19')]();});}}catch(_0x192b5b){logger[_0x6e91('0x18')](_0x6e91('0x14'),_0x3c33da,JSON[_0x6e91('0x1a')](_0x192b5b));_0x1512b0[_0x6e91('0x19')]();}};}; \ No newline at end of file +var _0x9964=['consequence','getMustacheRender','contact','chat','account','upperFirst','interaction','channel','Message','info','body','next','catch','[%s][MESSAGE]\x20%s','stringify','stop','lodash','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage'];(function(_0xe29cee,_0x1eed9e){var _0xd813d1=function(_0x617b13){while(--_0x617b13){_0xe29cee['push'](_0xe29cee['shift']());}};_0xd813d1(++_0x1eed9e);}(_0x9964,0x102));var _0x4996=function(_0x308374,_0x550e85){_0x308374=_0x308374-0x0;var _0x1f71e0=_0x9964[_0x308374];return _0x1f71e0;};'use strict';var _=require(_0x4996('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x4996('0x1')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x4996('0x2')),'smsMessage':require(_0x4996('0x3')),'faxMessage':require(_0x4996('0x4')),'whatsappMessage':require(_0x4996('0x5'))};exports[_0x4996('0x6')]=function(_0x9b6680,_0x8f59bd){return function(_0x1bb247){try{var _0x4bb588={'body':utils[_0x4996('0x7')](_0x8f59bd[0x0],this),'ContactId':this[_0x4996('0x8')]['id']};if(this['channel']===_0x4996('0x9')){_0x4bb588['ChatWebsiteId']=this[_0x4996('0xa')]['id'];}else{_0x4bb588[_[_0x4996('0xb')](this['channel'])+'AccountId']=this[_0x4996('0xa')]['id'];}_0x4bb588[_[_0x4996('0xb')](this['channel'])+'InteractionId']=this[_0x4996('0xc')]['id'];if(rpc[this[_0x4996('0xd')]+_0x4996('0xe')]){return rpc[this[_0x4996('0xd')]+_0x4996('0xe')]['create'](_0x4bb588)['then'](function(_0xe42b6){logger[_0x4996('0xf')]('[%s][MESSAGE]\x20%s',_0x9b6680,_0x4bb588[_0x4996('0x10')]);_0x1bb247[_0x4996('0x11')]();})[_0x4996('0x12')](function(_0x5a1703){logger['error'](_0x4996('0x13'),_0x9b6680,JSON[_0x4996('0x14')](_0x5a1703));_0x1bb247[_0x4996('0x15')]();});}}catch(_0x3f04e4){logger['error']('[%s][MESSAGE]\x20%s',_0x9b6680,JSON[_0x4996('0x14')](_0x3f04e4));_0x1bb247[_0x4996('0x15')]();}};}; \ 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 4081cee..9b86854 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 _0x3428=['info','[%s][NOOP]\x20%s','getMustacheRender','stringify','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0xa5fdf4,_0x553bc8){var _0x45a73d=function(_0x3d6276){while(--_0x3d6276){_0xa5fdf4['push'](_0xa5fdf4['shift']());}};_0x45a73d(++_0x553bc8);}(_0x3428,0x15b));var _0x8342=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3428[_0x422905];return _0x33dc6c;};'use strict';var utils=require(_0x8342('0x0'));var logger=require(_0x8342('0x1'))(_0x8342('0x2'));exports[_0x8342('0x3')]=function(_0x542a2d,_0x59cb52){return function(_0x407ba1){try{logger[_0x8342('0x4')](_0x8342('0x5'),_0x542a2d,utils[_0x8342('0x6')](_0x59cb52[0x0],this));_0x407ba1['next']();}catch(_0x385ebb){logger['error']('[%s][NOOP]\x20%s',_0x542a2d,JSON[_0x8342('0x7')](_0x385ebb));_0x407ba1[_0x8342('0x8')]();}};}; \ No newline at end of file +var _0xe181=['routing','info','[%s][NOOP]\x20%s','next','error','stringify','stop','./utils'];(function(_0x24b139,_0x40a5c6){var _0x193e97=function(_0x490c4f){while(--_0x490c4f){_0x24b139['push'](_0x24b139['shift']());}};_0x193e97(++_0x40a5c6);}(_0xe181,0x1b7));var _0x1e18=function(_0x5a3202,_0x4a9c0d){_0x5a3202=_0x5a3202-0x0;var _0xb4cf2=_0xe181[_0x5a3202];return _0xb4cf2;};'use strict';var utils=require(_0x1e18('0x0'));var logger=require('../../../../config/logger')(_0x1e18('0x1'));exports['consequence']=function(_0x128893,_0x234dae){return function(_0x31032c){try{logger[_0x1e18('0x2')](_0x1e18('0x3'),_0x128893,utils['getMustacheRender'](_0x234dae[0x0],this));_0x31032c[_0x1e18('0x4')]();}catch(_0x3288de){logger[_0x1e18('0x5')]('[%s][NOOP]\x20%s',_0x128893,JSON[_0x1e18('0x6')](_0x3288de));_0x31032c[_0x1e18('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index c29ec38..d7651da 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 _0x55ca=['../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','contact','list','upperFirst','QueueId','interaction','channel','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','catch','error','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','consequence','length','map','join','find','Queues','createQueue','atimeout','rules','end','close','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','from','joinAt','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove'];(function(_0x50054e,_0x520750){var _0x36b414=function(_0x5970c2){while(--_0x5970c2){_0x50054e['push'](_0x50054e['shift']());}};_0x36b414(++_0x520750);}(_0x55ca,0x126));var _0xa55c=function(_0x171b2f,_0x337677){_0x171b2f=_0x171b2f-0x0;var _0x4678d8=_0x55ca[_0x171b2f];return _0x4678d8;};'use strict';var schema=require(_0xa55c('0x0'));var _=require(_0xa55c('0x1'));var util=require('util');var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));var strategy=require(_0xa55c('0x5'));config[_0xa55c('0x6')]=_[_0xa55c('0x7')](config[_0xa55c('0x6')],{'host':_0xa55c('0x8'),'port':0x18eb});var io=require(_0xa55c('0x9'))(new Redis(config['redis']));var attributes=['id',_0xa55c('0xa'),_0xa55c('0xb'),'queue',_0xa55c('0xc'),_0xa55c('0xd')];function emit(_0x52a3bc,_0x5849ad,_0x473d0e){io['to'](_0x52a3bc)[_0xa55c('0xe')](_0x5849ad,_0x473d0e);}function emitChannelQueueInteraction(_0x381d07,_0x5d8e5a,_0x31646d,_0xe6d826,_0x508342,_0x70c2de,_0x3998f7,_0x15eec8){var _0x5d47ff=_['clone'](_0x31646d);_0x5d47ff[_0xa55c('0xa')]=_0x15eec8;_0x5d47ff['queue']=_0x5d8e5a;_0x5d47ff['account']=_0xe6d826;_0x5d47ff['id']=_0x508342;if(_0x70c2de){_0x3998f7[util['format'](_0xa55c('0xf'),_0x381d07)][_0x508342]=_[_0xa55c('0x10')](_0x5d47ff,attributes);}else{delete _0x3998f7[util[_0xa55c('0x11')](_0xa55c('0xf'),_0x381d07)][_0x508342];}emit(util[_0xa55c('0x11')](_0xa55c('0x12'),_0x381d07,_0x5d8e5a),util['format'](_0xa55c('0x13'),_0x381d07,_0x70c2de?_0xa55c('0x14'):_0xa55c('0x15')),_[_0xa55c('0x10')](_0x5d47ff,attributes));}var rpc={'openchannelQueueReport':require(_0xa55c('0x16')),'mailQueueReport':require(_0xa55c('0x17')),'chatQueueReport':require(_0xa55c('0x18')),'smsQueueReport':require(_0xa55c('0x19')),'faxQueueReport':require(_0xa55c('0x1a')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0xa55c('0x1b'),'required':!![],'message':_0xa55c('0x1c')},'timeout':{'type':_0xa55c('0x1d'),'message':_0xa55c('0x1e')}});function startRouting(_0x23a1ae,_0x5426e5,_0x4c0daf,_0x5f5158){if(_0x23a1ae&&_0x5426e5&&_0x4c0daf){_0x5426e5[_0xa55c('0x1f')]+=0x1;var _0x3776ac={'uniqueid':_0x23a1ae,'from':_0x4c0daf[_0xa55c('0x20')]?_0x4c0daf['body'][_0xa55c('0xc')]:'','joinAt':moment()[_0xa55c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4c0daf[_0xa55c('0x21')]?_0x4c0daf[_0xa55c('0x21')]['id']:null,'ListId':_0x4c0daf[_0xa55c('0x22')]?_0x4c0daf[_0xa55c('0x22')]['id']:null};_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf['channel'])+_0xa55c('0x24')]=_0x5426e5['id']||null;_0x3776ac[_['upperFirst'](_0x4c0daf['channel'])+'InteractionId']=_0x4c0daf[_0xa55c('0x25')]?_0x4c0daf['interaction']['id']:null;_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf[_0xa55c('0x26')])+_0xa55c('0x27')]=_0x4c0daf[_0xa55c('0x28')]?_0x4c0daf[_0xa55c('0x28')]['id']:null;_0x3776ac[_[_0xa55c('0x23')](_0x4c0daf[_0xa55c('0x26')])+(_0x4c0daf[_0xa55c('0x26')]!==_0xa55c('0x29')?_0xa55c('0x2a'):_0xa55c('0x2b'))]=_0x4c0daf['account']?_0x4c0daf[_0xa55c('0xb')]['id']:null;logger[_0xa55c('0x2c')](util[_0xa55c('0x11')](_0xa55c('0x2d'),_0x23a1ae,_0x5426e5['name']));emitChannelQueueInteraction(_0x4c0daf[_0xa55c('0x26')],_0x5426e5[_0xa55c('0x2e')],_0x3776ac,_0x4c0daf[_0xa55c('0xb')][_0xa55c('0x2e')],_0x4c0daf[_0xa55c('0x28')]['id'],!![],_0x5f5158,_0x5426e5['id']);if(rpc[_0x4c0daf[_0xa55c('0x26')]+'QueueReport']){return rpc[_0x4c0daf[_0xa55c('0x26')]+'QueueReport'][_0xa55c('0x2f')](_0x3776ac)[_0xa55c('0x30')](function(_0x1cc53e){logger[_0xa55c('0x31')]('create\x20queue\x20report');});}}}function stopRouting(_0x3d28fb,_0x2096ae,_0x331e58,_0x20da31){if(_0x3d28fb&&_0x2096ae){_0x2096ae[_0xa55c('0x1f')]-=0x1;var _0x1225c3={'leaveAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'acceptAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'reason':_0xa55c('0x33')};logger['info'](util['format'](_0xa55c('0x34'),_0x3d28fb,_0x2096ae[_0xa55c('0x2e')]));emitChannelQueueInteraction(_0x331e58['channel'],_0x2096ae[_0xa55c('0x2e')],_0x331e58[_0xa55c('0x20')],_0x331e58[_0xa55c('0xb')][_0xa55c('0x2e')],_0x331e58[_0xa55c('0x28')]['id'],![],_0x20da31,_0x2096ae['id']);if(rpc[_0x331e58[_0xa55c('0x26')]+_0xa55c('0x35')]){return rpc[_0x331e58[_0xa55c('0x26')]+_0xa55c('0x35')]['update'](_0x3d28fb,_0x1225c3)['catch'](function(_0x4b23d3){logger[_0xa55c('0x31')](_0xa55c('0x36'));});}}}function endRouting(_0x2bb4f0,_0x5802e4,_0x768408,_0x547930){if(_0x2bb4f0&&_0x5802e4){_0x5802e4[_0xa55c('0x1f')]-=0x1;var _0x4ad813={'leaveAt':moment()[_0xa55c('0x11')](_0xa55c('0x32')),'exitAt':moment()[_0xa55c('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xa55c('0x37')};logger[_0xa55c('0x2c')](util['format'](_0xa55c('0x38'),_0x2bb4f0,_0x5802e4[_0xa55c('0x2e')]));emitChannelQueueInteraction(_0x768408['channel'],_0x5802e4['name'],_0x768408[_0xa55c('0x20')],_0x768408['account'][_0xa55c('0x2e')],_0x768408[_0xa55c('0x28')]['id'],![],_0x547930);if(rpc[_0x768408['channel']+'QueueReport']){return rpc[_0x768408['channel']+'QueueReport'][_0xa55c('0x39')](_0x2bb4f0,_0x4ad813)[_0xa55c('0x30')](function(_0x429336){logger[_0xa55c('0x31')](_0xa55c('0x36'));});}}}function handleFindQueue(_0x56d17c){return function(_0x3d52d8){return _0x3d52d8[_0xa55c('0x2e')][_0xa55c('0x3a')]()===_0x56d17c[_0xa55c('0x3a')]();};}exports[_0xa55c('0x3b')]=function(_0x23cef5,_0x554620,_0x386e34,_0x5ee63d){return function(_0x57a972){try{var _0x404e7f={'name':_0x554620[0x0],'timeout':_0x554620[0x1]};var _0x1f63d8=queue['validate'](_0x404e7f,{'typecast':!![]});if(_0x1f63d8[_0xa55c('0x3c')]){logger['error']('[%s][QUEUE]\x20%s',_0x23cef5,_[_0xa55c('0x3d')](_0x1f63d8,_0xa55c('0x28'))[_0xa55c('0x3e')](',\x20'));_0x57a972['stop']();}else{var _0x1b2708=_[_0xa55c('0x3f')](_0x386e34[_0x5ee63d['channel']+_0xa55c('0x40')],handleFindQueue(_0x404e7f['name']));if(_0x1b2708){startRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);var _0x39886a=(_0x1b2708[_0xa55c('0x37')]||0xa)*0x3e8;var _0x5be43f=(_0x404e7f[_0xa55c('0x37')]||0x14)*0x3e8;var _0x1dae70,_0x5d834d;if(_0x39886a>_0x5be43f){_0x5be43f=_0x39886a;}var _0x40c352=seqqueue[_0xa55c('0x41')](_0x39886a);_0x40c352['id']=_0x23cef5;_0x40c352[_0xa55c('0x42')]=_0x39886a;_0x40c352['qtimeout']=_0x5be43f;_0x40c352[_0xa55c('0x26')]=_0x5ee63d['channel'];_0x386e34[_0xa55c('0x43')][_0x23cef5]['on'](_0xa55c('0x44'),function(){logger[_0xa55c('0x2c')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x23cef5);stopRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);clearTimeout(_0x1dae70);_0x1dae70=undefined;_0x40c352[_0xa55c('0x45')](!![]);if(_0x386e34[_0xa55c('0x43')][_0x23cef5]){delete _0x386e34['rules'][_0x23cef5];}_0x57a972[_0xa55c('0x46')]();});_0x386e34[_0xa55c('0x43')][_0x23cef5]['on']('complete',function(){if(_0x386e34[_0xa55c('0x43')][_0x23cef5]){delete _0x386e34[_0xa55c('0x43')][_0x23cef5];}});_0x1dae70=setTimeout(function(){logger['info'](_0xa55c('0x47'),_0x23cef5);endRouting(_0x23cef5,_0x1b2708,_0x5ee63d,_0x386e34);clearTimeout(_0x1dae70);_0x40c352[_0xa55c('0x45')](!![]);_0x57a972[_0xa55c('0x48')]();},_0x5be43f);switch(_0x1b2708[_0xa55c('0x49')]){case'rrmemory':strategy[_0xa55c('0x4a')](_0x40c352,_0x1b2708,_0x386e34,_0x5ee63d);break;default:strategy['beepall'](_0x40c352,_0x1b2708,_0x386e34,_0x5ee63d);}}else{logger[_0xa55c('0x31')](_0xa55c('0x4b'),_0x23cef5,_0x404e7f[_0xa55c('0x2e')]);_0x57a972['stop']();}}}catch(_0x39bd3d){console[_0xa55c('0x4c')](_0x39bd3d);logger['error'](_0xa55c('0x4d'),_0x23cef5,_0x39bd3d[_0xa55c('0x4e')]);_0x57a972[_0xa55c('0x46')]();}};}; \ No newline at end of file +var _0x9c44=['[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','atimeout','rules','end','close','complete','next','strategy','rrmemory','beepall','log','stack','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','queue_id','queue','from','joinAt','emit','clone','account','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','list','QueueId','upperFirst','channel','InteractionId','message','AccountId','info','name','QueueReport','create','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','catch','error','update\x20queue\x20report','timeout'];(function(_0x207811,_0x3420a6){var _0x170d56=function(_0x4340b7){while(--_0x4340b7){_0x207811['push'](_0x207811['shift']());}};_0x170d56(++_0x3420a6);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x49c4('0x0'));var seqqueue=require(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var config=require(_0x49c4('0x4'));var logger=require(_0x49c4('0x5'))('routing');var strategy=require('./strategy');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));var attributes=['id',_0x49c4('0x9'),'account',_0x49c4('0xa'),_0x49c4('0xb'),_0x49c4('0xc')];function emit(_0x4487ca,_0x4c7d3a,_0x5ab4a3){io['to'](_0x4487ca)[_0x49c4('0xd')](_0x4c7d3a,_0x5ab4a3);}function emitChannelQueueInteraction(_0x313e73,_0x58cad7,_0xb611a1,_0x459d09,_0x4adb3c,_0x536d42,_0x1d19bf,_0x6d1b08){var _0x5487cd=_[_0x49c4('0xe')](_0xb611a1);_0x5487cd[_0x49c4('0x9')]=_0x6d1b08;_0x5487cd['queue']=_0x58cad7;_0x5487cd[_0x49c4('0xf')]=_0x459d09;_0x5487cd['id']=_0x4adb3c;if(_0x536d42){_0x1d19bf[util[_0x49c4('0x10')](_0x49c4('0x11'),_0x313e73)][_0x4adb3c]=_[_0x49c4('0x12')](_0x5487cd,attributes);}else{delete _0x1d19bf[util[_0x49c4('0x10')](_0x49c4('0x11'),_0x313e73)][_0x4adb3c];}emit(util[_0x49c4('0x10')](_0x49c4('0x13'),_0x313e73,_0x58cad7),util['format'](_0x49c4('0x14'),_0x313e73,_0x536d42?_0x49c4('0x15'):_0x49c4('0x16')),_[_0x49c4('0x12')](_0x5487cd,attributes));}var rpc={'openchannelQueueReport':require(_0x49c4('0x17')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x49c4('0x18')),'smsQueueReport':require(_0x49c4('0x19')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require('../../rpc/whatsappQueueReport')};var queue=schema({'name':{'type':_0x49c4('0x1a'),'required':!![],'message':_0x49c4('0x1b')},'timeout':{'type':_0x49c4('0x1c'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x24856d,_0x50b151,_0x2cbd50,_0x1806c2){if(_0x24856d&&_0x50b151&&_0x2cbd50){_0x50b151[_0x49c4('0x1d')]+=0x1;var _0x291526={'uniqueid':_0x24856d,'from':_0x2cbd50[_0x49c4('0x1e')]?_0x2cbd50[_0x49c4('0x1e')][_0x49c4('0xb')]:'','joinAt':moment()[_0x49c4('0x10')](_0x49c4('0x1f')),'ContactId':_0x2cbd50['contact']?_0x2cbd50['contact']['id']:null,'ListId':_0x2cbd50['list']?_0x2cbd50[_0x49c4('0x20')]['id']:null};_0x291526[_['upperFirst'](_0x2cbd50['channel'])+_0x49c4('0x21')]=_0x50b151['id']||null;_0x291526[_[_0x49c4('0x22')](_0x2cbd50[_0x49c4('0x23')])+_0x49c4('0x24')]=_0x2cbd50['interaction']?_0x2cbd50['interaction']['id']:null;_0x291526[_[_0x49c4('0x22')](_0x2cbd50[_0x49c4('0x23')])+'MessageId']=_0x2cbd50[_0x49c4('0x25')]?_0x2cbd50[_0x49c4('0x25')]['id']:null;_0x291526[_[_0x49c4('0x22')](_0x2cbd50[_0x49c4('0x23')])+(_0x2cbd50['channel']!=='chat'?_0x49c4('0x26'):'WebsiteId')]=_0x2cbd50[_0x49c4('0xf')]?_0x2cbd50[_0x49c4('0xf')]['id']:null;logger[_0x49c4('0x27')](util[_0x49c4('0x10')]('[%s][START:QUEUE][NAME:%s]',_0x24856d,_0x50b151[_0x49c4('0x28')]));emitChannelQueueInteraction(_0x2cbd50[_0x49c4('0x23')],_0x50b151[_0x49c4('0x28')],_0x291526,_0x2cbd50[_0x49c4('0xf')][_0x49c4('0x28')],_0x2cbd50[_0x49c4('0x25')]['id'],!![],_0x1806c2,_0x50b151['id']);if(rpc[_0x2cbd50[_0x49c4('0x23')]+_0x49c4('0x29')]){return rpc[_0x2cbd50[_0x49c4('0x23')]+_0x49c4('0x29')][_0x49c4('0x2a')](_0x291526)['catch'](function(_0x4f4495){logger['error'](_0x49c4('0x2b'));});}}}function stopRouting(_0x7ee704,_0x1eb035,_0x27e467,_0x28eb47){if(_0x7ee704&&_0x1eb035){_0x1eb035['waiting']-=0x1;var _0x38ad77={'leaveAt':moment()[_0x49c4('0x10')](_0x49c4('0x1f')),'acceptAt':moment()[_0x49c4('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x49c4('0x27')](util[_0x49c4('0x10')](_0x49c4('0x2c'),_0x7ee704,_0x1eb035[_0x49c4('0x28')]));emitChannelQueueInteraction(_0x27e467[_0x49c4('0x23')],_0x1eb035['name'],_0x27e467[_0x49c4('0x1e')],_0x27e467[_0x49c4('0xf')][_0x49c4('0x28')],_0x27e467['message']['id'],![],_0x28eb47,_0x1eb035['id']);if(rpc[_0x27e467['channel']+_0x49c4('0x29')]){return rpc[_0x27e467[_0x49c4('0x23')]+_0x49c4('0x29')][_0x49c4('0x2d')](_0x7ee704,_0x38ad77)[_0x49c4('0x2e')](function(_0x2cf897){logger[_0x49c4('0x2f')](_0x49c4('0x30'));});}}}function endRouting(_0x3209cd,_0x4e0209,_0x2d34ca,_0x5b96df){if(_0x3209cd&&_0x4e0209){_0x4e0209[_0x49c4('0x1d')]-=0x1;var _0x349791={'leaveAt':moment()[_0x49c4('0x10')](_0x49c4('0x1f')),'exitAt':moment()['format'](_0x49c4('0x1f')),'reason':_0x49c4('0x31')};logger[_0x49c4('0x27')](util['format'](_0x49c4('0x32'),_0x3209cd,_0x4e0209[_0x49c4('0x28')]));emitChannelQueueInteraction(_0x2d34ca[_0x49c4('0x23')],_0x4e0209[_0x49c4('0x28')],_0x2d34ca[_0x49c4('0x1e')],_0x2d34ca[_0x49c4('0xf')][_0x49c4('0x28')],_0x2d34ca[_0x49c4('0x25')]['id'],![],_0x5b96df);if(rpc[_0x2d34ca[_0x49c4('0x23')]+_0x49c4('0x29')]){return rpc[_0x2d34ca[_0x49c4('0x23')]+'QueueReport'][_0x49c4('0x2d')](_0x3209cd,_0x349791)[_0x49c4('0x2e')](function(_0x32b172){logger[_0x49c4('0x2f')](_0x49c4('0x30'));});}}}function handleFindQueue(_0x29dd5d){return function(_0x1be62d){return _0x1be62d[_0x49c4('0x28')][_0x49c4('0x33')]()===_0x29dd5d[_0x49c4('0x33')]();};}exports[_0x49c4('0x34')]=function(_0xa3d59e,_0x326142,_0x4e38bc,_0x212366){return function(_0x49829e){try{var _0x104efb={'name':_0x326142[0x0],'timeout':_0x326142[0x1]};var _0x4915bc=queue[_0x49c4('0x35')](_0x104efb,{'typecast':!![]});if(_0x4915bc[_0x49c4('0x36')]){logger[_0x49c4('0x2f')](_0x49c4('0x37'),_0xa3d59e,_['map'](_0x4915bc,'message')[_0x49c4('0x38')](',\x20'));_0x49829e[_0x49c4('0x39')]();}else{var _0x38349b=_[_0x49c4('0x3a')](_0x4e38bc[_0x212366['channel']+_0x49c4('0x3b')],handleFindQueue(_0x104efb[_0x49c4('0x28')]));if(_0x38349b){startRouting(_0xa3d59e,_0x38349b,_0x212366,_0x4e38bc);var _0x2ccd47=(_0x38349b[_0x49c4('0x31')]||0xa)*0x3e8;var _0x81a674=(_0x104efb[_0x49c4('0x31')]||0x14)*0x3e8;var _0x1a9593,_0x3351c1;if(_0x2ccd47>_0x81a674){_0x81a674=_0x2ccd47;}var _0x3c4a1d=seqqueue['createQueue'](_0x2ccd47);_0x3c4a1d['id']=_0xa3d59e;_0x3c4a1d[_0x49c4('0x3c')]=_0x2ccd47;_0x3c4a1d['qtimeout']=_0x81a674;_0x3c4a1d[_0x49c4('0x23')]=_0x212366[_0x49c4('0x23')];_0x4e38bc[_0x49c4('0x3d')][_0xa3d59e]['on'](_0x49c4('0x3e'),function(){logger[_0x49c4('0x27')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0xa3d59e);stopRouting(_0xa3d59e,_0x38349b,_0x212366,_0x4e38bc);clearTimeout(_0x1a9593);_0x1a9593=undefined;_0x3c4a1d[_0x49c4('0x3f')](!![]);if(_0x4e38bc[_0x49c4('0x3d')][_0xa3d59e]){delete _0x4e38bc[_0x49c4('0x3d')][_0xa3d59e];}_0x49829e[_0x49c4('0x39')]();});_0x4e38bc[_0x49c4('0x3d')][_0xa3d59e]['on'](_0x49c4('0x40'),function(){if(_0x4e38bc[_0x49c4('0x3d')][_0xa3d59e]){delete _0x4e38bc['rules'][_0xa3d59e];}});_0x1a9593=setTimeout(function(){logger[_0x49c4('0x27')]('[%s][QUEUE]\x20APPLICATION\x20END',_0xa3d59e);endRouting(_0xa3d59e,_0x38349b,_0x212366,_0x4e38bc);clearTimeout(_0x1a9593);_0x3c4a1d[_0x49c4('0x3f')](!![]);_0x49829e[_0x49c4('0x41')]();},_0x81a674);switch(_0x38349b[_0x49c4('0x42')]){case _0x49c4('0x43'):strategy[_0x49c4('0x43')](_0x3c4a1d,_0x38349b,_0x4e38bc,_0x212366);break;default:strategy[_0x49c4('0x44')](_0x3c4a1d,_0x38349b,_0x4e38bc,_0x212366);}}else{logger[_0x49c4('0x2f')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0xa3d59e,_0x104efb[_0x49c4('0x28')]);_0x49829e[_0x49c4('0x39')]();}}}catch(_0x4a5c34){console[_0x49c4('0x45')](_0x4a5c34);logger[_0x49c4('0x2f')](_0x49c4('0x37'),_0xa3d59e,_0x4a5c34[_0x49c4('0x46')]);_0x49829e['stop']();}};}; \ 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 b9f1222..90b12cc 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 _0x87a7=['forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','writeLog','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','handleRun','bind','handleTimeout','drained','prototype','push','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','agents','busy','busyQueue','showNotification','RINGING'];(function(_0x6ce39b,_0x4e3ca9){var _0x3587db=function(_0x525392){while(--_0x525392){_0x6ce39b['push'](_0x6ce39b['shift']());}};_0x3587db(++_0x4e3ca9);}(_0x87a7,0x1ac));var _0x787a=function(_0x5e49a9,_0x459470){_0x5e49a9=_0x5e49a9-0x0;var _0x476d1a=_0x87a7[_0x5e49a9];return _0x476d1a;};'use strict';var _=require(_0x787a('0x0'));var uuid=require(_0x787a('0x1'));var util=require(_0x787a('0x2'));var logger=require(_0x787a('0x3'))(_0x787a('0x4'));var Agent=function(_0x3593c2,_0x314662,_0x7886c0,_0x1ce13a){this[_0x787a('0x5')]=uuid['v4']();this[_0x787a('0x6')]=_0x3593c2;this[_0x787a('0x7')]=_0x314662;this['realtime']=_0x7886c0;this[_0x787a('0x4')]=_0x1ce13a;this[_0x787a('0x6')]['push'](this[_0x787a('0x8')][_0x787a('0x9')](this),this[_0x787a('0xa')]['bind'](this));this[_0x787a('0x6')]['on']('timeout',this[_0x787a('0xa')][_0x787a('0x9')](this));this[_0x787a('0x6')]['on'](_0x787a('0xb'),this['handleDrained'][_0x787a('0x9')](this));};Agent[_0x787a('0xc')][_0x787a('0xd')]=function(){this['squeue'][_0x787a('0xd')](this[_0x787a('0x8')][_0x787a('0x9')](this),this['handleTimeout'][_0x787a('0x9')](this));};Agent[_0x787a('0xc')][_0x787a('0xe')]=function(){this[_0x787a('0xa')](!![]);};Agent['prototype'][_0x787a('0x8')]=function(_0x42d984){logger[_0x787a('0xf')](_0x787a('0x10'),this['squeue']['id'],this[_0x787a('0x7')]['id']);if(_[_0x787a('0x11')](this[_0x787a('0x12')]['agents'][this['agent']['id']])){logger[_0x787a('0xf')](_0x787a('0x13'),this[_0x787a('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x787a('0xd')][_0x787a('0x9')](this),0x3e8);}else{if(this[_0x787a('0x4')]['forcedOwnership']||util[_0x787a('0x14')](this[_0x787a('0x6')]['id'],this[_0x787a('0x12')]['agents'][this[_0x787a('0x7')]['id']],this[_0x787a('0x6')][_0x787a('0x15')],![])){this[_0x787a('0x12')][_0x787a('0x16')][this['agent']['id']][_0x787a('0x17')]=!![];this[_0x787a('0x12')]['agents'][this['agent']['id']][_0x787a('0x18')]=undefined;util[_0x787a('0x19')](this[_0x787a('0x5')],this[_0x787a('0x6')]['id'],this['realtime'][_0x787a('0x16')][this['agent']['id']],null,this[_0x787a('0x4')]);util['writeLog'](this[_0x787a('0x6')]['id'],this[_0x787a('0x12')][_0x787a('0x16')][this[_0x787a('0x7')]['id']],_0x787a('0x1a')+(this[_0x787a('0x4')][_0x787a('0x1b')]?_0x787a('0x1c'):''));}else{logger[_0x787a('0xf')](_0x787a('0x1d'),this[_0x787a('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x787a('0xd')][_0x787a('0x9')](this),0x3e8);}}};Agent[_0x787a('0xc')][_0x787a('0xa')]=function(_0x132c06){if(_[_0x787a('0x11')](this['realtime'][_0x787a('0x16')][this['agent']['id']])){return logger[_0x787a('0xf')](_0x787a('0x13'),this[_0x787a('0x6')]['id'],this['agent']['id']);}else{logger['info'](_0x787a('0x1e'),this[_0x787a('0x6')]['id'],this[_0x787a('0x7')]['id']);util['hideNotification'](this[_0x787a('0x5')],this[_0x787a('0x6')]['id'],this[_0x787a('0x12')]['agents'][this[_0x787a('0x7')]['id']],null,this[_0x787a('0x4')]);this['realtime'][_0x787a('0x16')][this[_0x787a('0x7')]['id']][_0x787a('0x17')]=![];this[_0x787a('0x12')][_0x787a('0x16')][this[_0x787a('0x7')]['id']][_0x787a('0x18')]=undefined;util[_0x787a('0x1f')](this[_0x787a('0x6')]['id'],this['realtime'][_0x787a('0x16')][this[_0x787a('0x7')]['id']],_0x132c06?_0x787a('0x20'):_0x787a('0x21'));}if(!_0x132c06){setTimeout(this[_0x787a('0xd')][_0x787a('0x9')](this),0x3e8);}};function agent(_0x334841,_0x4fe374,_0x263667,_0x1a1620){return new Agent(_0x334841,_0x4fe374,_0x263667,_0x1a1620);}module[_0x787a('0x22')]=agent; \ No newline at end of file +var _0x60e3=['hideNotification','STOP','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','handleRun','bind','handleTimeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s'];(function(_0xd13dc,_0x125636){var _0x36df0b=function(_0x2acc08){while(--_0x2acc08){_0xd13dc['push'](_0xd13dc['shift']());}};_0x36df0b(++_0x125636);}(_0x60e3,0xc3));var _0x360e=function(_0xdea2c9,_0x555d5f){_0xdea2c9=_0xdea2c9-0x0;var _0x143c2b=_0x60e3[_0xdea2c9];return _0x143c2b;};'use strict';var _=require(_0x360e('0x0'));var uuid=require(_0x360e('0x1'));var util=require(_0x360e('0x2'));var logger=require(_0x360e('0x3'))(_0x360e('0x4'));var Agent=function(_0x3fd2b,_0x293539,_0x3de124,_0x4b77eb){this[_0x360e('0x5')]=uuid['v4']();this[_0x360e('0x6')]=_0x3fd2b;this['agent']=_0x293539;this[_0x360e('0x7')]=_0x3de124;this['routing']=_0x4b77eb;this[_0x360e('0x6')]['push'](this[_0x360e('0x8')][_0x360e('0x9')](this),this['handleTimeout'][_0x360e('0x9')](this));this[_0x360e('0x6')]['on']('timeout',this[_0x360e('0xa')][_0x360e('0x9')](this));this[_0x360e('0x6')]['on'](_0x360e('0xb'),this[_0x360e('0xc')]['bind'](this));};Agent[_0x360e('0xd')]['push']=function(){this[_0x360e('0x6')]['push'](this[_0x360e('0x8')][_0x360e('0x9')](this),this['handleTimeout'][_0x360e('0x9')](this));};Agent[_0x360e('0xd')][_0x360e('0xc')]=function(){this[_0x360e('0xa')](!![]);};Agent[_0x360e('0xd')][_0x360e('0x8')]=function(_0x4dbc65){logger['info'](_0x360e('0xe'),this[_0x360e('0x6')]['id'],this['agent']['id']);if(_[_0x360e('0xf')](this[_0x360e('0x7')][_0x360e('0x10')][this[_0x360e('0x11')]['id']])){logger['info'](_0x360e('0x12'),this[_0x360e('0x6')]['id'],this[_0x360e('0x11')]['id']);setTimeout(this['push'][_0x360e('0x9')](this),0x3e8);}else{if(this[_0x360e('0x4')][_0x360e('0x13')]||util[_0x360e('0x14')](this[_0x360e('0x6')]['id'],this[_0x360e('0x7')]['agents'][this[_0x360e('0x11')]['id']],this[_0x360e('0x6')][_0x360e('0x15')],![])){this[_0x360e('0x7')][_0x360e('0x10')][this['agent']['id']][_0x360e('0x16')]=!![];this['realtime'][_0x360e('0x10')][this[_0x360e('0x11')]['id']][_0x360e('0x17')]=undefined;util[_0x360e('0x18')](this[_0x360e('0x5')],this[_0x360e('0x6')]['id'],this[_0x360e('0x7')]['agents'][this[_0x360e('0x11')]['id']],null,this[_0x360e('0x4')]);util[_0x360e('0x19')](this[_0x360e('0x6')]['id'],this['realtime'][_0x360e('0x10')][this[_0x360e('0x11')]['id']],'RINGING'+(this[_0x360e('0x4')]['forcedOwnership']?_0x360e('0x1a'):''));}else{logger['info'](_0x360e('0x1b'),this['squeue']['id'],this[_0x360e('0x11')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0x360e('0xd')][_0x360e('0xa')]=function(_0x3ff14c){if(_['isNil'](this['realtime']['agents'][this[_0x360e('0x11')]['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x360e('0x6')]['id'],this[_0x360e('0x11')]['id']);}else{logger['info'](_0x360e('0x1c'),this[_0x360e('0x6')]['id'],this[_0x360e('0x11')]['id']);util[_0x360e('0x1d')](this[_0x360e('0x5')],this[_0x360e('0x6')]['id'],this[_0x360e('0x7')][_0x360e('0x10')][this[_0x360e('0x11')]['id']],null,this[_0x360e('0x4')]);this[_0x360e('0x7')][_0x360e('0x10')][this['agent']['id']][_0x360e('0x16')]=![];this[_0x360e('0x7')][_0x360e('0x10')][this[_0x360e('0x11')]['id']]['busyQueue']=undefined;util[_0x360e('0x19')](this[_0x360e('0x6')]['id'],this['realtime']['agents'][this[_0x360e('0x11')]['id']],_0x3ff14c?_0x360e('0x1e'):'TIMEOUT');}if(!_0x3ff14c){setTimeout(this['push'][_0x360e('0x9')](this),0x3e8);}};function agent(_0x355e68,_0x52fe61,_0x334446,_0x166e5d){return new Agent(_0x355e68,_0x52fe61,_0x334446,_0x166e5d);}module[_0x360e('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 8a828f6..c37bd33 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 _0x8fe7=['writeLog','STOP','busy','busyQueue','exports','uuid','routing','notificationId','squeue','queue','realtime','handleRun','bind','handleTimeout','drained','prototype','push','handleDrained','isNil','Agents','length','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','channel','RINGING','[%s][QUEUE]\x20EMPTY'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x8fe7,0x171));var _0x78fe=function(_0x28c746,_0x2f16b0){_0x28c746=_0x28c746-0x0;var _0x35ef55=_0x8fe7[_0x28c746];return _0x35ef55;};'use strict';var _=require('lodash');var uuid=require(_0x78fe('0x0'));var util=require('./util');var logger=require('../../../../../config/logger')(_0x78fe('0x1'));var Beepall=function(_0x292859,_0x5c5734,_0x4c6b60,_0x20b4fc){this[_0x78fe('0x2')]=uuid['v4']();this[_0x78fe('0x3')]=_0x292859;this[_0x78fe('0x4')]=_0x5c5734;this[_0x78fe('0x5')]=_0x4c6b60;this['routing']=_0x20b4fc;this[_0x78fe('0x3')]['push'](this[_0x78fe('0x6')][_0x78fe('0x7')](this),this[_0x78fe('0x8')][_0x78fe('0x7')](this));this[_0x78fe('0x3')]['on']('timeout',this[_0x78fe('0x8')][_0x78fe('0x7')](this));this[_0x78fe('0x3')]['on'](_0x78fe('0x9'),this['handleDrained'][_0x78fe('0x7')](this));};Beepall[_0x78fe('0xa')][_0x78fe('0xb')]=function(){this['squeue'][_0x78fe('0xb')](this[_0x78fe('0x6')][_0x78fe('0x7')](this),this['handleTimeout'][_0x78fe('0x7')](this));};Beepall[_0x78fe('0xa')][_0x78fe('0xc')]=function(_0x5e8fda){this['handleTimeout'](!![]);};Beepall[_0x78fe('0xa')][_0x78fe('0x6')]=function(_0x3adda6){var _0x732484=!![];if(!_[_0x78fe('0xd')](this[_0x78fe('0x4')])&&!_[_0x78fe('0xd')](this[_0x78fe('0x4')][_0x78fe('0xe')])&&this['queue'][_0x78fe('0xe')][_0x78fe('0xf')]>0x0){for(var _0x2cd325=0x0,_0x3ca541;_0x2cd3250x0){for(var _0x1d115a=0x0,_0x4654b6;_0x1d115a0x0&&_0x3570d6[_0x1b68d3+'CurrentCapacity']>=_0x3570d6[_0x1b68d3+_0xf7da('0x26')]){writeLog(_0x5f48c9,_0x3570d6,_0x1b68d3[_0xf7da('0x27')]()+_0xf7da('0x28'));return![];}}return!![];};exports[_0xf7da('0x29')]=function(_0x13dc9f,_0x57583d,_0x3fd76a,_0x545b15,_0x258c74){return sendNotification(!![],_0x13dc9f,_0x57583d,_0x3fd76a,_0x545b15,_0x258c74);};exports[_0xf7da('0x2a')]=function(_0x1dfcc5,_0x23a27e,_0x509330,_0x1356ed,_0x3b82f5){return sendNotification(![],_0x1dfcc5,_0x23a27e,_0x509330,_0x1356ed,_0x3b82f5);};exports[_0xf7da('0x2b')]=writeLog; \ No newline at end of file +var _0xd9cc=['account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','error','[%s][QUEUE]\x20%s','message','user:%s','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','name','isAgentAvailable','busy','BUSY','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','writeLog','lodash','util','../utils','mustache','ioredis','../../../../../config/logger','routing','redis','localhost','format','emit','user:save','split','\x20interaction'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xd9cc,0x1e1));var _0xcd9c=function(_0x3f16f9,_0x48f307){_0x3f16f9=_0x3f16f9-0x0;var _0x1b49f8=_0xd9cc[_0x3f16f9];return _0x1b49f8;};'use strict';var _=require(_0xcd9c('0x0'));var util=require(_0xcd9c('0x1'));var utils=require(_0xcd9c('0x2'));var Mustache=require(_0xcd9c('0x3'));var Redis=require(_0xcd9c('0x4'));var config=require('../../../../../config/environment');var logger=require(_0xcd9c('0x5'))(_0xcd9c('0x6'));config[_0xcd9c('0x7')]=_['defaults'](config[_0xcd9c('0x7')],{'host':_0xcd9c('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcd9c('0x7')]));function emit(_0x2a9c7a,_0x15c37c,_0x245c95){io['to'](_0x2a9c7a)['emit'](_0x15c37c,_0x245c95);}function sendNotification(_0x2e62c5,_0x479223,_0x37079b,_0x21ecd4,_0x509563,_0x2447f2){io['to'](util[_0xcd9c('0x9')]('user:%s',_0x21ecd4['name']))[_0xcd9c('0xa')](_0xcd9c('0xb'),_0x21ecd4);var _0x1a8531=_0x2447f2||{};var _0x508f4b=_0x37079b[_0xcd9c('0xc')]('.');var _0x19aa56={'uniqueid':_0x479223,'channel':_0x508f4b[0x0],'id':_0x508f4b[0x1],'title':_0x508f4b[0x0]+_0xcd9c('0xd'),'interactionId':_0x508f4b[0x2],'queue':_0x509563?_0x509563['name']:null,'sound':_0x1a8531[_0xcd9c('0xe')][_0xcd9c('0xf')],'shake':_0x1a8531[_0xcd9c('0xe')][_0xcd9c('0x10')]};try{if(!_0x1a8531[_0xcd9c('0x11')]){_0x1a8531['body']={};}if(_0x509563){_0x1a8531['body'][_0xcd9c('0x12')]=_0x509563;}else if(_0x1a8531[_0xcd9c('0x11')][_0xcd9c('0x12')]){delete _0x1a8531[_0xcd9c('0x11')][_0xcd9c('0x12')];}_0x19aa56[_0xcd9c('0x13')]=utils[_0xcd9c('0x14')](_0x1a8531[_0xcd9c('0xe')][_0xcd9c('0x15')],_0x1a8531);}catch(_0xbd2814){_0x19aa56[_0xcd9c('0x13')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0xcd9c('0x16')](util['format'](_0xcd9c('0x17'),_0x479223,_0xbd2814[_0xcd9c('0x18')]));}io['to'](util[_0xcd9c('0x9')](_0xcd9c('0x19'),_0x21ecd4['name']))[_0xcd9c('0xa')](util[_0xcd9c('0x9')](_0xcd9c('0x1a'),_0x2e62c5?_0xcd9c('0x1b'):_0xcd9c('0x1c')),_0x19aa56);}function writeLog(_0x9f11f7,_0x726c8e,_0x35e585){return logger[_0xcd9c('0x1d')](util[_0xcd9c('0x9')](_0xcd9c('0x1e'),_0x9f11f7,_0x726c8e[_0xcd9c('0x1f')],_0x35e585));}exports[_0xcd9c('0x20')]=function(_0x1f4fb3,_0x2300eb,_0x34eb32,_0x544466){if(_0x2300eb[_0xcd9c('0x21')]){writeLog(_0x1f4fb3,_0x2300eb,_0xcd9c('0x22'));return![];}if(!_0x2300eb['online']){writeLog(_0x1f4fb3,_0x2300eb,_0xcd9c('0x23'));return![];}if(_0x2300eb[_0x34eb32+_0xcd9c('0x24')]){writeLog(_0x1f4fb3,_0x2300eb,_0xcd9c('0x25'));return![];}if(_0x544466&&_0x2300eb[_0xcd9c('0x26')](_0x34eb32+_0xcd9c('0x27'))&&_0x2300eb[_0xcd9c('0x26')](_0x34eb32+_0xcd9c('0x28'))){if(_0x2300eb[_0x34eb32+_0xcd9c('0x27')]>0x0&&_0x2300eb[_0x34eb32+'CurrentCapacity']>=_0x2300eb[_0x34eb32+_0xcd9c('0x27')]){writeLog(_0x1f4fb3,_0x2300eb,_0x34eb32[_0xcd9c('0x29')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0xcd9c('0x2a')]=function(_0x464a31,_0x1baca6,_0x5b95bf,_0x5a7262,_0x1463f5){return sendNotification(!![],_0x464a31,_0x1baca6,_0x5b95bf,_0x5a7262,_0x1463f5);};exports[_0xcd9c('0x2b')]=function(_0x21f89a,_0x2fd84d,_0x1de1d6,_0x201ba6,_0x50e65a){return sendNotification(![],_0x21f89a,_0x2fd84d,_0x1de1d6,_0x201ba6,_0x50e65a);};exports[_0xcd9c('0x2c')]=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 fa9220f..2f4dc1a 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 _0x103c=['[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','next','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','isObject','stringify'];(function(_0xc869f8,_0x33e92b){var _0x3b3ee8=function(_0x73bf19){while(--_0x73bf19){_0xc869f8['push'](_0xc869f8['shift']());}};_0x3b3ee8(++_0x33e92b);}(_0x103c,0xeb));var _0xc103=function(_0x56bba2,_0x23584b){_0x56bba2=_0x56bba2-0x0;var _0x567b2d=_0x103c[_0x56bba2];return _0x567b2d;};'use strict';var schema=require(_0xc103('0x0'));var sh=require(_0xc103('0x1'));var _=require(_0xc103('0x2'));var utils=require(_0xc103('0x3'));var logger=require(_0xc103('0x4'))(_0xc103('0x5'));var system=schema({'command':{'type':_0xc103('0x6'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xc103('0x7')]=function(_0x54fad5,_0x5b93d7){return function(_0x525634){try{var _0x14782a={'command':_0x5b93d7[0x0]};var _0xc50b4a=system[_0xc103('0x0')](_0x14782a,{'typecast':!![]});if(_0xc50b4a[_0xc103('0x8')]){logger[_0xc103('0x9')](_0xc103('0xa'),_0x54fad5,_[_0xc103('0xb')](_0xc50b4a,_0xc103('0xc'))[_0xc103('0xd')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x54fad5);_0x525634[_0xc103('0xe')]();}else{var _0x358903=this;var _0xbbfcfc=utils['getMustacheRender'](_0x5b93d7[0x0],this);logger[_0xc103('0xf')](_0xc103('0x10'),_0x54fad5,_0xbbfcfc);sh[_0xc103('0x11')](_[_0xc103('0x12')](_0xbbfcfc),function(_0x45b9e6,_0x19d53f){logger[_0xc103('0xf')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x54fad5,_0x45b9e6);if(_0x45b9e6==0x0){var _0x42c270=_0x19d53f['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0xc103('0x13')](_0x5b93d7[0x1])||_[_0xc103('0x14')](_0x5b93d7[0x1])){logger[_0xc103('0xf')](_0xc103('0x15'),_0x54fad5);_0x358903[_0xc103('0x16')][_0x5b93d7[0x1]]=_0x42c270;}else{logger[_0xc103('0xf')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x54fad5,_0x5b93d7[0x1],_0x42c270);_0x358903[_0xc103('0x16')][_0x5b93d7[0x1]]=_0x42c270;}}_0x525634[_0xc103('0xe')]();});}}catch(_0x28b11f){logger[_0xc103('0x9')](_0xc103('0xa'),_0x54fad5,_[_0xc103('0x17')](_0x28b11f)?JSON[_0xc103('0x18')](_0x28b11f):_0x28b11f);logger['info'](_0xc103('0x19'),_0x54fad5);_0x525634['next']();}};}; \ No newline at end of file +var _0xb6df=['[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','shelljs','lodash','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][SYSTEM]\x20%s','message','join','next','getMustacheRender','info','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil'];(function(_0x20c59f,_0x583d0a){var _0x2b6df8=function(_0x303e11){while(--_0x303e11){_0x20c59f['push'](_0x20c59f['shift']());}};_0x2b6df8(++_0x583d0a);}(_0xb6df,0x1c7));var _0xfb6d=function(_0x3098f5,_0x3229df){_0x3098f5=_0x3098f5-0x0;var _0x40c38f=_0xb6df[_0x3098f5];return _0x40c38f;};'use strict';var schema=require('validate');var sh=require(_0xfb6d('0x0'));var _=require(_0xfb6d('0x1'));var utils=require(_0xfb6d('0x2'));var logger=require(_0xfb6d('0x3'))('routing');var system=schema({'command':{'type':_0xfb6d('0x4'),'required':!![],'message':_0xfb6d('0x5')}});exports[_0xfb6d('0x6')]=function(_0x5c5fad,_0x437d9c){return function(_0x1f7732){try{var _0x4b021c={'command':_0x437d9c[0x0]};var _0x10cc74=system[_0xfb6d('0x7')](_0x4b021c,{'typecast':!![]});if(_0x10cc74[_0xfb6d('0x8')]){logger[_0xfb6d('0x9')](_0xfb6d('0xa'),_0x5c5fad,_['map'](_0x10cc74,_0xfb6d('0xb'))[_0xfb6d('0xc')](',\x20'));logger['info']('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5c5fad);_0x1f7732[_0xfb6d('0xd')]();}else{var _0x2ecabb=this;var _0xaa2b83=utils[_0xfb6d('0xe')](_0x437d9c[0x0],this);logger[_0xfb6d('0xf')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x5c5fad,_0xaa2b83);sh['exec'](_[_0xfb6d('0x10')](_0xaa2b83),function(_0x4803c8,_0x56f1dd){logger[_0xfb6d('0xf')](_0xfb6d('0x11'),_0x5c5fad,_0x4803c8);if(_0x4803c8==0x0){var _0x26c600=_0x56f1dd[_0xfb6d('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xfb6d('0x13')](_0x437d9c[0x1])||_['isEmpty'](_0x437d9c[0x1])){logger[_0xfb6d('0xf')](_0xfb6d('0x14'),_0x5c5fad);_0x2ecabb[_0xfb6d('0x15')][_0x437d9c[0x1]]=_0x26c600;}else{logger[_0xfb6d('0xf')](_0xfb6d('0x16'),_0x5c5fad,_0x437d9c[0x1],_0x26c600);_0x2ecabb[_0xfb6d('0x15')][_0x437d9c[0x1]]=_0x26c600;}}_0x1f7732[_0xfb6d('0xd')]();});}}catch(_0x6efbc0){logger[_0xfb6d('0x9')](_0xfb6d('0xa'),_0x5c5fad,_[_0xfb6d('0x17')](_0x6efbc0)?JSON[_0xfb6d('0x18')](_0x6efbc0):_0x6efbc0);logger[_0xfb6d('0xf')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x5c5fad);_0x1f7732[_0xfb6d('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 b159749..2f79bca 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 _0x4443=['info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][TAG]\x20%s','map','message','join'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4443,0x14c));var _0x3444=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x4443[_0x8c43de];return _0xa6591b;};'use strict';var schema=require(_0x3444('0x0'));var _=require(_0x3444('0x1'));var rpc={'chatInteraction':require(_0x3444('0x2')),'openchannelInteraction':require(_0x3444('0x3')),'smsInteraction':require(_0x3444('0x4')),'mailInteraction':require(_0x3444('0x5')),'faxInteraction':require(_0x3444('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x3444('0x7'));var tag=schema({'tag':{'type':_0x3444('0x8'),'required':!![],'message':_0x3444('0x9')}});exports['consequence']=function(_0x50f6c1,_0x34ab78,_0x39d0bd,_0x416082){return function(_0x4d34ac){try{var _0x322cc6={'tag':_0x34ab78[0x0]};var _0x5479b5=tag[_0x3444('0x0')](_0x322cc6,{'typecast':!![]});if(_0x5479b5[_0x3444('0xa')]){logger[_0x3444('0xb')](_0x3444('0xc'),_0x50f6c1,_[_0x3444('0xd')](_0x5479b5,_0x3444('0xe'))[_0x3444('0xf')](',\x20'));logger[_0x3444('0x10')](_0x3444('0x11'),_0x50f6c1);_0x4d34ac[_0x3444('0x12')]();}else{var _0x16e8ab={'ids':[_0x34ab78[0x0]]};if(rpc[_0x416082[_0x3444('0x13')]+_0x3444('0x14')]){rpc[_0x416082[_0x3444('0x13')]+_0x3444('0x14')][_0x3444('0x15')](_0x416082[_0x3444('0x16')]['id'],_0x16e8ab)[_0x3444('0x17')](function(_0x53d3dd){logger[_0x3444('0x10')](_0x3444('0x18'),_0x50f6c1,_0x34ab78[0x1],_0x416082[_0x3444('0x13')],_0x416082[_0x3444('0x16')]['id']);})[_0x3444('0x19')](function(_0x3c79cf){logger['error'](_0x3444('0xc'),_0x50f6c1,JSON[_0x3444('0x1a')](_0x3c79cf));logger[_0x3444('0x10')](_0x3444('0x11'),_0x50f6c1);})[_0x3444('0x1b')](function(){_0x4d34ac[_0x3444('0x12')]();});}}}catch(_0x4d0466){logger[_0x3444('0xb')](_0x3444('0xc'),_0x50f6c1,_[_0x3444('0x1c')](_0x4d0466)?JSON[_0x3444('0x1a')](_0x4d0466):_0x4d0466);logger[_0x3444('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x50f6c1);_0x4d34ac[_0x3444('0x12')]();}};}; \ No newline at end of file +var _0xa901=['../../rpc/mailInteraction','../../rpc/whatsappInteraction','number','length','error','map','message','next','channel','Interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','[%s][TAG]\x20%s','isObject','validate','lodash'];(function(_0x4b5312,_0x348295){var _0x403880=function(_0x14f41f){while(--_0x14f41f){_0x4b5312['push'](_0x4b5312['shift']());}};_0x403880(++_0x348295);}(_0xa901,0x1b6));var _0x1a90=function(_0x4c954a,_0x1392b2){_0x4c954a=_0x4c954a-0x0;var _0x5c89b2=_0xa901[_0x4c954a];return _0x5c89b2;};'use strict';var schema=require(_0x1a90('0x0'));var _=require(_0x1a90('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x1a90('0x2')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1a90('0x3'))};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0x1a90('0x4'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x50fee5,_0x22c645,_0x32e455,_0x57e3e5){return function(_0x5b83f1){try{var _0x2c66a6={'tag':_0x22c645[0x0]};var _0x4073c3=tag['validate'](_0x2c66a6,{'typecast':!![]});if(_0x4073c3[_0x1a90('0x5')]){logger[_0x1a90('0x6')]('[%s][TAG]\x20%s',_0x50fee5,_[_0x1a90('0x7')](_0x4073c3,_0x1a90('0x8'))['join'](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x50fee5);_0x5b83f1[_0x1a90('0x9')]();}else{var _0x4fddc2={'ids':[_0x22c645[0x0]]};if(rpc[_0x57e3e5[_0x1a90('0xa')]+_0x1a90('0xb')]){rpc[_0x57e3e5[_0x1a90('0xa')]+_0x1a90('0xb')]['addTags'](_0x57e3e5['interaction']['id'],_0x4fddc2)[_0x1a90('0xc')](function(_0x273430){logger[_0x1a90('0xd')](_0x1a90('0xe'),_0x50fee5,_0x22c645[0x1],_0x57e3e5['channel'],_0x57e3e5[_0x1a90('0xf')]['id']);})[_0x1a90('0x10')](function(_0x504446){logger[_0x1a90('0x6')]('[%s][TAG]\x20%s',_0x50fee5,JSON[_0x1a90('0x11')](_0x504446));logger[_0x1a90('0xd')](_0x1a90('0x12'),_0x50fee5);})[_0x1a90('0x13')](function(){_0x5b83f1[_0x1a90('0x9')]();});}}}catch(_0x5475ff){logger[_0x1a90('0x6')](_0x1a90('0x14'),_0x50fee5,_[_0x1a90('0x15')](_0x5475ff)?JSON['stringify'](_0x5475ff):_0x5475ff);logger['info'](_0x1a90('0x12'),_0x50fee5);_0x5b83f1[_0x1a90('0x9')]();}};}; \ 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 b811c85..401af52 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 _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x1a8089,_0x23e453){var _0x3f1586=function(_0x1d85db){while(--_0x1d85db){_0x1a8089['push'](_0x1a8089['shift']());}};_0x3f1586(++_0x23e453);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0x86fd=['lodash','exports','render','body','contact','account','interaction','mustache'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x86fd,0xa7));var _0xd86f=function(_0x214266,_0x1f6f52){_0x214266=_0x214266-0x0;var _0x568f75=_0x86fd[_0x214266];return _0x568f75;};'use strict';var Mustache=require(_0xd86f('0x0'));var _=require(_0xd86f('0x1'));module[_0xd86f('0x2')]={'getMustacheRender':function(_0x2c2fef,_0x50caa9){return Mustache[_0xd86f('0x3')](_0x2c2fef,_['merge'](_0x50caa9[_0xd86f('0x4')],{'contact':_0x50caa9[_0xd86f('0x5')],'message':_0x50caa9['message'],'account':_0x50caa9[_0xd86f('0x6')],'interaction':_0x50caa9[_0xd86f('0x7')],'list':_0x50caa9['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index cf216f1..950594c 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 _0xe5d9=['message','interaction','applications','isArray','length','existsSync','join','app','.js','appdata','split','push','dialogflow','TagId','%s:%s:%s','./interval','condition','./applications/','priority','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','emit','complete','stack','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','%s.%s.%s','IntervalId','isNil','Intervals','interval','listen','rules','channel'];(function(_0x354978,_0x2588df){var _0x181191=function(_0x32baf0){while(--_0x32baf0){_0x354978['push'](_0x354978['shift']());}};_0x181191(++_0x2588df);}(_0xe5d9,0x146));var _0x9e5d=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0xe5d9[_0x52e363];return _0x3fc2b5;};'use strict';var _=require('lodash');var util=require(_0x9e5d('0x0'));var path=require(_0x9e5d('0x1'));var fs=require('fs');var jayson=require(_0x9e5d('0x2'));var BPromise=require(_0x9e5d('0x3'));var uuid=require('uuid');var config=require(_0x9e5d('0x4'));var logger=require(_0x9e5d('0x5'))(_0x9e5d('0x6'));var rpc={'openchannelQueueReport':require(_0x9e5d('0x7')),'mailQueueReport':require(_0x9e5d('0x8')),'chatQueueReport':require(_0x9e5d('0x9')),'smsQueueReport':require(_0x9e5d('0xa')),'faxQueueReport':require(_0x9e5d('0xb')),'whatsappQueueReport':require(_0x9e5d('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x2bab47,_0x267c8d,_0xa15bfd){return util[_0x9e5d('0xd')](_0x9e5d('0xe'),_0x2bab47,_0x267c8d||0x0,_0xa15bfd||0x0);}function getIntervals(_0x3e733d,_0x167d1c){var _0x1ca8d0=[];if(!_['isNil'](_0x167d1c[_0x9e5d('0xf')])&&!_['isNil'](_0x3e733d[_0x167d1c[_0x9e5d('0xf')]])&&!_[_0x9e5d('0x10')](_0x3e733d[_0x167d1c[_0x9e5d('0xf')]]['Intervals'])){_0x1ca8d0=_['map'](_0x3e733d[_0x167d1c[_0x9e5d('0xf')]][_0x9e5d('0x11')],_0x9e5d('0x12'));}else if(!_['isNil'](_0x167d1c['interval'])){_0x1ca8d0=[_0x167d1c[_0x9e5d('0x12')]];}return _0x1ca8d0;}exports[_0x9e5d('0x13')]=function(_0x372d36){_0x372d36[_0x9e5d('0x14')]={};return new BPromise(function(_0xc90fd7,_0x5d3195){var _0x56a92c={'Start':function(_0x30ff51){var _0x491ded=this;return new Promise(function(_0x2ad016,_0x36b077){if(_0x30ff51){try{var _0x2e3f60=[];var _0xe1801c=getId(_0x30ff51[_0x9e5d('0x15')],_0x30ff51[_0x9e5d('0x16')]?_0x30ff51[_0x9e5d('0x16')]['id']:0x0,_0x30ff51[_0x9e5d('0x17')]?_0x30ff51['interaction']['id']:0x0);if(_0x30ff51[_0x9e5d('0x18')]&&_[_0x9e5d('0x19')](_0x30ff51[_0x9e5d('0x18')])&&_0x30ff51[_0x9e5d('0x18')][_0x9e5d('0x1a')]){for(var _0x4acde7=0x0;_0x4acde7<_0x30ff51[_0x9e5d('0x18')][_0x9e5d('0x1a')];_0x4acde7+=0x1){var _0x443b8b=_0x30ff51['applications'][_0x4acde7];if(fs[_0x9e5d('0x1b')](path[_0x9e5d('0x1c')](__dirname,'applications',_0x443b8b[_0x9e5d('0x1d')]+_0x9e5d('0x1e')))){var _0x4540d8=[];switch(_0x443b8b[_0x9e5d('0x1d')]['toLowerCase']()){case'autoreply':var _0x4ee8d0=_0x443b8b[_0x9e5d('0x1f')][_0x9e5d('0x20')](',');_0x4540d8[_0x9e5d('0x21')](_0x4ee8d0[0x0]);_0x4540d8[_0x9e5d('0x21')](_0x4ee8d0['slice'](0x1,_0x4ee8d0[_0x9e5d('0x1a')])[_0x9e5d('0x1c')](','));break;case _0x9e5d('0x22'):var _0x5e67be=_0x443b8b['appdata'][_0x9e5d('0x20')](',');_0x4540d8['push'](_0x5e67be[0x0]);_0x4540d8[_0x9e5d('0x21')](_0x5e67be[0x1]);_0x4540d8['push'](_0x5e67be['slice'](0x2,_0x5e67be[_0x9e5d('0x1a')])[_0x9e5d('0x1c')](','));break;case'amazonlex':var _0x166de2=_0x443b8b[_0x9e5d('0x1f')][_0x9e5d('0x20')](',');_0x4540d8[_0x9e5d('0x21')](_0x166de2[0x0]);_0x4540d8['push'](_0x166de2[0x1]);_0x4540d8[_0x9e5d('0x21')](_0x166de2[0x2]);_0x4540d8[_0x9e5d('0x21')](_0x166de2[0x3]);_0x4540d8['push'](_0x166de2['slice'](0x4,_0x166de2[_0x9e5d('0x1a')])[_0x9e5d('0x1c')](','));break;case _0x9e5d('0x16'):_0x4540d8[_0x9e5d('0x21')](_0x443b8b[_0x9e5d('0x1f')]);break;case'tag':_0x4540d8[_0x9e5d('0x21')](_0x443b8b[_0x9e5d('0x23')]);_0x4540d8[_0x9e5d('0x21')](_0x443b8b[_0x9e5d('0x1f')]);break;default:_0x4540d8=_[_0x9e5d('0x10')](_0x443b8b['appdata'])?[]:_0x443b8b[_0x9e5d('0x1f')][_0x9e5d('0x20')](',');}var _0x1a85c4={'id':util[_0x9e5d('0xd')](_0x9e5d('0x24'),_0xe1801c,_0x443b8b['id'],_0x443b8b[_0x9e5d('0x1d')]),'condition':require(_0x9e5d('0x25'))[_0x9e5d('0x26')](_0xe1801c,getIntervals(_0x372d36['intervals'],_0x443b8b),_0x372d36),'consequence':require(_0x9e5d('0x27')+_0x443b8b[_0x9e5d('0x1d')])['consequence'](_0xe1801c,_0x4540d8,_0x372d36,_0x30ff51),'p':_0x443b8b[_0x9e5d('0x28')]||0x0};logger['info'](_0x9e5d('0x29'),_0x1a85c4['id'],_0x9e5d('0x2a'),getIntervals(_0x372d36[_0x9e5d('0x2b')],_0x443b8b)[_0x9e5d('0x1c')](_0x9e5d('0x2c')));_0x2e3f60[_0x9e5d('0x21')](_0x1a85c4);}else{logger[_0x9e5d('0x2d')](_0x9e5d('0x2e'),path[_0x9e5d('0x1c')](__dirname,'applications',_0x443b8b[_0x9e5d('0x1d')]+_0x9e5d('0x1e')));}}_0x372d36[_0x9e5d('0x14')][_0xe1801c]=new RuleEngine(_0x2e3f60);_0x372d36['rules'][_0xe1801c][_0x9e5d('0x2f')](_0x30ff51,function(_0x4af5a0){logger[_0x9e5d('0x30')]('Applications\x20executed',JSON[_0x9e5d('0x31')](_0x4af5a0['matchPath']));if(_0x372d36[_0x9e5d('0x14')][_0xe1801c]){_0x372d36[_0x9e5d('0x14')][_0xe1801c][_0x9e5d('0x32')](_0x9e5d('0x33'));}});return _0x2ad016({'code':0xc8,'message':_0x30ff51});}else{logger['info']('No\x20applications\x20to\x20execute');return _0x2ad016({'code':0xc8,'message':_0x30ff51});}}catch(_0x3f7a6b){logger[_0x9e5d('0x2d')](_0x3f7a6b[_0x9e5d('0x34')]);return _0x36b077(_0x491ded[_0x9e5d('0x2d')](0x1f4,_0x3f7a6b));}}return _0x36b077('routing\x20is\x20empty');});},'AcceptMessage':function(_0x7358ca){var _0x472be1=this;return new Promise(function(_0x312d4c,_0x15b8d8){if(_0x7358ca[_0x9e5d('0x16')]&&_0x7358ca[_0x9e5d('0x16')]['id']){try{var _0x43b3e7=getId(_0x7358ca[_0x9e5d('0x15')],_0x7358ca[_0x9e5d('0x16')]?_0x7358ca[_0x9e5d('0x16')]['id']:0x0,_0x7358ca[_0x9e5d('0x17')]?_0x7358ca[_0x9e5d('0x17')]['id']:0x0);if(_0x372d36[_0x9e5d('0x14')][_0x43b3e7]){_0x372d36[_0x9e5d('0x14')][_0x43b3e7]['emit'](_0x9e5d('0x35'));if(rpc[_0x7358ca[_0x9e5d('0x15')]+_0x9e5d('0x36')]){rpc[_0x7358ca[_0x9e5d('0x15')]+_0x9e5d('0x36')][_0x9e5d('0x37')](_0x43b3e7,{'UserId':_0x7358ca[_0x9e5d('0x16')][_0x9e5d('0x38')]})['catch'](function(_0x5218f7){logger['error'](_0x9e5d('0x39'));});}}return _0x312d4c({'code':0xc8,'message':_0x7358ca});}catch(_0x4688ec){logger[_0x9e5d('0x2d')](_0x4688ec['stack']);return _0x15b8d8(_0x472be1[_0x9e5d('0x2d')](0x1f4,_0x4688ec));}}logger['error'](_0x9e5d('0x3a'));return _0x15b8d8(_0x472be1[_0x9e5d('0x2d')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x2eaf19){var _0x521b=this;return new Promise(function(_0x2ae930,_0x140294){if(_0x2eaf19['agent']&&_0x2eaf19[_0x9e5d('0x3b')]['id']){try{if(_0x372d36[_0x9e5d('0x3c')][_0x2eaf19[_0x9e5d('0x3b')]['id']]){_0x372d36[_0x9e5d('0x3c')][_0x2eaf19[_0x9e5d('0x3b')]['id']][_0x9e5d('0x3d')]=![];_0x372d36[_0x9e5d('0x3c')][_0x2eaf19[_0x9e5d('0x3b')]['id']][_0x9e5d('0x3e')]=undefined;}return _0x2ae930({'code':0xc8,'message':_0x2eaf19});}catch(_0x501532){logger['error'](_0x501532['stack']);return _0x140294(_0x521b[_0x9e5d('0x2d')](0x1f4,_0x501532));}}logger[_0x9e5d('0x2d')](_0x9e5d('0x3a'));return _0x140294(_0x521b['error'](0x1f4,_0x9e5d('0x3a')));});},'AbandonInteraction':function(_0x38bf65){var _0x333289=this;return new Promise(function(_0x3f9baa,_0x238b86){if(_0x38bf65[_0x9e5d('0x15')]&&_0x38bf65[_0x9e5d('0x17')]&&_0x38bf65[_0x9e5d('0x17')]['id']){try{var _0x28dc94=getId(_0x38bf65[_0x9e5d('0x15')],_0x38bf65['message']?_0x38bf65[_0x9e5d('0x16')]['id']:0x0,_0x38bf65[_0x9e5d('0x17')]?_0x38bf65[_0x9e5d('0x17')]['id']:0x0);if(_0x372d36[_0x9e5d('0x14')][_0x28dc94]){_0x372d36[_0x9e5d('0x14')][_0x28dc94][_0x9e5d('0x32')](_0x9e5d('0x35'));}return _0x3f9baa({'code':0xc8,'message':_0x38bf65});}catch(_0x13f5e1){logger[_0x9e5d('0x2d')](_0x13f5e1['stack']);return _0x238b86(_0x333289[_0x9e5d('0x2d')](0x1f4,_0x13f5e1));}}logger[_0x9e5d('0x2d')](_0x9e5d('0x3a'));return _0x238b86(_0x333289[_0x9e5d('0x2d')](0x1f4,_0x9e5d('0x3a')));});},'AgentCapacity':function(_0x1a605b){var _0x1ff077=this;return new Promise(function(_0x53adaa,_0x3bcb74){if(_0x372d36[_0x9e5d('0x3c')][_0x9e5d('0x3f')](_0x1a605b['id'])){for(var _0x758491 in _0x1a605b[_0x9e5d('0x40')]){if(_0x1a605b[_0x9e5d('0x40')][_0x9e5d('0x3f')](_0x758491)){if(_0x372d36['agents'][_0x1a605b['id']][_0x9e5d('0x3f')](_0x758491+_0x9e5d('0x41'))){_0x372d36[_0x9e5d('0x3c')][_0x1a605b['id']][_0x758491+'CurrentCapacity']=parseInt(_0x1a605b[_0x9e5d('0x40')][_0x758491],0xa);}}}_0x372d36[_0x9e5d('0x3c')][_0x1a605b['id']]['updateRealtime']();return _0x53adaa({'code':0xc8,'message':_0x372d36[_0x9e5d('0x3c')][_0x1a605b['id']]});}else{return _0x3bcb74(_0x1ff077['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x2b0cd7){return new Promise(function(_0x3bac0b,_0x220387){var _0x4c1bd3=_['values'](_0x372d36[_0x9e5d('0x3c')]);_0x3bac0b({'count':_0x4c1bd3[_0x9e5d('0x1a')],'rows':_0x4c1bd3});});},'ChatQueues':function(_0x24c3b7){return new Promise(function(_0x14e6f3,_0x49e3e8){var _0x4ce4f8=[];for(var _0x2f760f in _0x372d36[_0x9e5d('0x42')]){if(_0x372d36[_0x9e5d('0x42')]['hasOwnProperty'](_0x2f760f)){var _0x54cd8c=_0x372d36[_0x9e5d('0x42')][_0x2f760f];var _0x4b37d9={'id':_0x54cd8c['id'],'available':_0x54cd8c['available'],'loggedIn':_0x54cd8c[_0x9e5d('0x43')],'name':_0x54cd8c[_0x9e5d('0x44')],'paused':_0x54cd8c[_0x9e5d('0x45')],'waiting':_0x54cd8c[_0x9e5d('0x46')]};_0x4ce4f8[_0x9e5d('0x21')](_0x4b37d9);}}_0x14e6f3({'count':_0x4ce4f8['length'],'rows':_0x4ce4f8});});},'MailQueues':function(_0x12d581){return new Promise(function(_0x8061fa,_0x3fb008){var _0x272a22=[];for(var _0x552b37 in _0x372d36['mailQueues']){if(_0x372d36[_0x9e5d('0x47')][_0x9e5d('0x3f')](_0x552b37)){var _0x3924f5=_0x372d36[_0x9e5d('0x47')][_0x552b37];var _0x20e0a4={'id':_0x3924f5['id'],'available':_0x3924f5[_0x9e5d('0x48')],'loggedIn':_0x3924f5[_0x9e5d('0x43')],'name':_0x3924f5[_0x9e5d('0x44')],'paused':_0x3924f5[_0x9e5d('0x45')],'waiting':_0x3924f5[_0x9e5d('0x46')]};_0x272a22[_0x9e5d('0x21')](_0x20e0a4);}}_0x8061fa({'count':_0x272a22[_0x9e5d('0x1a')],'rows':_0x272a22});});},'OpenchannelQueues':function(_0x29ed98){return new Promise(function(_0x71ed41,_0x4b8e11){var _0x12b6e3=[];for(var _0x1c38ea in _0x372d36[_0x9e5d('0x49')]){if(_0x372d36[_0x9e5d('0x49')][_0x9e5d('0x3f')](_0x1c38ea)){var _0x51aa33=_0x372d36[_0x9e5d('0x49')][_0x1c38ea];var _0x56c4d1={'id':_0x51aa33['id'],'available':_0x51aa33['available'],'loggedIn':_0x51aa33[_0x9e5d('0x43')],'name':_0x51aa33[_0x9e5d('0x44')],'paused':_0x51aa33[_0x9e5d('0x45')],'waiting':_0x51aa33[_0x9e5d('0x46')]};_0x12b6e3['push'](_0x56c4d1);}}_0x71ed41({'count':_0x12b6e3[_0x9e5d('0x1a')],'rows':_0x12b6e3});});},'SmsQueues':function(_0x37527f){return new Promise(function(_0x1fe2df,_0x3a40ec){var _0x5042c0=[];for(var _0x4526ec in _0x372d36[_0x9e5d('0x4a')]){if(_0x372d36['smsQueues'][_0x9e5d('0x3f')](_0x4526ec)){var _0xcf7772=_0x372d36[_0x9e5d('0x4a')][_0x4526ec];var _0x303b20={'id':_0xcf7772['id'],'available':_0xcf7772[_0x9e5d('0x48')],'loggedIn':_0xcf7772['loggedIn'],'name':_0xcf7772['name'],'paused':_0xcf7772[_0x9e5d('0x45')],'waiting':_0xcf7772[_0x9e5d('0x46')]};_0x5042c0['push'](_0x303b20);}}_0x1fe2df({'count':_0x5042c0[_0x9e5d('0x1a')],'rows':_0x5042c0});});},'FaxQueues':function(_0x942938){return new Promise(function(_0x267d50,_0x249944){var _0x32ec59=[];for(var _0x235604 in _0x372d36[_0x9e5d('0x4b')]){if(_0x372d36[_0x9e5d('0x4b')][_0x9e5d('0x3f')](_0x235604)){var _0x268c40=_0x372d36['faxQueues'][_0x235604];var _0x353737={'id':_0x268c40['id'],'available':_0x268c40[_0x9e5d('0x48')],'loggedIn':_0x268c40[_0x9e5d('0x43')],'name':_0x268c40[_0x9e5d('0x44')],'paused':_0x268c40[_0x9e5d('0x45')],'waiting':_0x268c40[_0x9e5d('0x46')]};_0x32ec59[_0x9e5d('0x21')](_0x353737);}}_0x267d50({'count':_0x32ec59[_0x9e5d('0x1a')],'rows':_0x32ec59});});},'WhatsappQueues':function(_0x4a0e99){return new Promise(function(_0x1d395,_0x401167){var _0x5016cf=[];for(var _0x371a7f in _0x372d36['whatsappQueues']){if(_0x372d36[_0x9e5d('0x4c')][_0x9e5d('0x3f')](_0x371a7f)){var _0x2a3287=_0x372d36[_0x9e5d('0x4c')][_0x371a7f];var _0x1a511e={'id':_0x2a3287['id'],'available':_0x2a3287[_0x9e5d('0x48')],'loggedIn':_0x2a3287[_0x9e5d('0x43')],'name':_0x2a3287['name'],'paused':_0x2a3287[_0x9e5d('0x45')],'waiting':_0x2a3287[_0x9e5d('0x46')]};_0x5016cf[_0x9e5d('0x21')](_0x1a511e);}}_0x1d395({'count':_0x5016cf[_0x9e5d('0x1a')],'rows':_0x5016cf});});},'ChatQueuesWaitingInteractions':function(_0x27216c){return new Promise(function(_0x468e96,_0x3e1407){var _0x49eb9c=_[_0x9e5d('0x4d')](_0x372d36['chatQueuesWaitingInteractions']);_0x468e96({'count':_0x49eb9c['length'],'rows':_0x49eb9c});});},'MailQueuesWaitingInteractions':function(_0x27fe76){return new Promise(function(_0x1f7a68,_0x5da821){var _0x3a65b5=_[_0x9e5d('0x4d')](_0x372d36[_0x9e5d('0x4e')]);_0x1f7a68({'count':_0x3a65b5[_0x9e5d('0x1a')],'rows':_0x3a65b5});});},'OpenchannelQueuesWaitingInteractions':function(_0x3ec754){return new Promise(function(_0x2ae243,_0x361bb0){var _0x583437=_['values'](_0x372d36['openchannelQueuesWaitingInteractions']);_0x2ae243({'count':_0x583437[_0x9e5d('0x1a')],'rows':_0x583437});});},'SmsQueuesWaitingInteractions':function(_0x40874b){return new Promise(function(_0x4133b4,_0x13de66){var _0x49f106=_[_0x9e5d('0x4d')](_0x372d36[_0x9e5d('0x4f')]);_0x4133b4({'count':_0x49f106[_0x9e5d('0x1a')],'rows':_0x49f106});});},'FaxQueuesWaitingInteractions':function(_0x4a82f9){return new Promise(function(_0x1171ab,_0x2b0004){var _0x4c594a=_[_0x9e5d('0x4d')](_0x372d36[_0x9e5d('0x50')]);_0x1171ab({'count':_0x4c594a[_0x9e5d('0x1a')],'rows':_0x4c594a});});},'WhatsappQueuesWaitingInteractions':function(_0x1b7f32){return new Promise(function(_0x3c7c28,_0x5b8f4f){var _0x5155e8=_[_0x9e5d('0x4d')](_0x372d36[_0x9e5d('0x51')]);_0x3c7c28({'count':_0x5155e8[_0x9e5d('0x1a')],'rows':_0x5155e8});});}};var _0x1e05dc=jayson[_0x9e5d('0x52')](_0x56a92c)['http']();_0x1e05dc['on'](_0x9e5d('0x2d'),function(_0x22e2a5){logger[_0x9e5d('0x2d')](JSON[_0x9e5d('0x31')](_0x22e2a5));return _0x5d3195(_0x22e2a5);});_0x1e05dc['listen'](0x232c,_0x9e5d('0x53'),function(){console[_0x9e5d('0x54')](_0x9e5d('0x55'),0x232c);return _0xc90fd7(_0x9e5d('0x56')+0x232c);});});}; \ No newline at end of file +var _0xc148=['IntervalId','Intervals','interval','listen','rules','channel','message','interaction','isArray','applications','length','existsSync','join','.js','toLowerCase','autoreply','appdata','split','push','slice','amazonlex','tag','TagId','%s:%s:%s','app','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','complete','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','emit','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','name','waiting','mailQueues','openchannelQueues','loggedIn','smsQueues','paused','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','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','uuid','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil'];(function(_0x1705f4,_0x31a20a){var _0x413855=function(_0x11b8dc){while(--_0x11b8dc){_0x1705f4['push'](_0x1705f4['shift']());}};_0x413855(++_0x31a20a);}(_0xc148,0x18a));var _0x8c14=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc148[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x8c14('0x0'));var util=require(_0x8c14('0x1'));var path=require(_0x8c14('0x2'));var fs=require('fs');var jayson=require(_0x8c14('0x3'));var BPromise=require(_0x8c14('0x4'));var uuid=require(_0x8c14('0x5'));var config=require(_0x8c14('0x6'));var logger=require('../../../config/logger')(_0x8c14('0x7'));var rpc={'openchannelQueueReport':require(_0x8c14('0x8')),'mailQueueReport':require(_0x8c14('0x9')),'chatQueueReport':require(_0x8c14('0xa')),'smsQueueReport':require(_0x8c14('0xb')),'faxQueueReport':require(_0x8c14('0xc')),'whatsappQueueReport':require(_0x8c14('0xd'))};var RuleEngine=require(_0x8c14('0xe'));function getId(_0x4cb85c,_0x186a67,_0x2cadf5){return util[_0x8c14('0xf')](_0x8c14('0x10'),_0x4cb85c,_0x186a67||0x0,_0x2cadf5||0x0);}function getIntervals(_0x135644,_0x52ed54){var _0x534cf6=[];if(!_[_0x8c14('0x11')](_0x52ed54[_0x8c14('0x12')])&&!_[_0x8c14('0x11')](_0x135644[_0x52ed54[_0x8c14('0x12')]])&&!_[_0x8c14('0x11')](_0x135644[_0x52ed54[_0x8c14('0x12')]][_0x8c14('0x13')])){_0x534cf6=_['map'](_0x135644[_0x52ed54[_0x8c14('0x12')]][_0x8c14('0x13')],_0x8c14('0x14'));}else if(!_['isNil'](_0x52ed54[_0x8c14('0x14')])){_0x534cf6=[_0x52ed54[_0x8c14('0x14')]];}return _0x534cf6;}exports[_0x8c14('0x15')]=function(_0x21a225){_0x21a225[_0x8c14('0x16')]={};return new BPromise(function(_0x59517e,_0x24073f){var _0x56b654={'Start':function(_0x567e89){var _0x107e18=this;return new Promise(function(_0x2e5762,_0x1308af){if(_0x567e89){try{var _0x4b2f23=[];var _0x48a973=getId(_0x567e89[_0x8c14('0x17')],_0x567e89[_0x8c14('0x18')]?_0x567e89[_0x8c14('0x18')]['id']:0x0,_0x567e89[_0x8c14('0x19')]?_0x567e89[_0x8c14('0x19')]['id']:0x0);if(_0x567e89['applications']&&_[_0x8c14('0x1a')](_0x567e89[_0x8c14('0x1b')])&&_0x567e89[_0x8c14('0x1b')][_0x8c14('0x1c')]){for(var _0xf0404f=0x0;_0xf0404f<_0x567e89[_0x8c14('0x1b')][_0x8c14('0x1c')];_0xf0404f+=0x1){var _0x232146=_0x567e89[_0x8c14('0x1b')][_0xf0404f];if(fs[_0x8c14('0x1d')](path[_0x8c14('0x1e')](__dirname,_0x8c14('0x1b'),_0x232146['app']+_0x8c14('0x1f')))){var _0x19cd46=[];switch(_0x232146['app'][_0x8c14('0x20')]()){case _0x8c14('0x21'):var _0x26d56a=_0x232146[_0x8c14('0x22')][_0x8c14('0x23')](',');_0x19cd46[_0x8c14('0x24')](_0x26d56a[0x0]);_0x19cd46[_0x8c14('0x24')](_0x26d56a[_0x8c14('0x25')](0x1,_0x26d56a[_0x8c14('0x1c')])[_0x8c14('0x1e')](','));break;case'dialogflow':var _0x3b3003=_0x232146['appdata'][_0x8c14('0x23')](',');_0x19cd46['push'](_0x3b3003[0x0]);_0x19cd46[_0x8c14('0x24')](_0x3b3003[0x1]);_0x19cd46[_0x8c14('0x24')](_0x3b3003[_0x8c14('0x25')](0x2,_0x3b3003['length'])[_0x8c14('0x1e')](','));break;case _0x8c14('0x26'):var _0x2e5c01=_0x232146[_0x8c14('0x22')][_0x8c14('0x23')](',');_0x19cd46[_0x8c14('0x24')](_0x2e5c01[0x0]);_0x19cd46[_0x8c14('0x24')](_0x2e5c01[0x1]);_0x19cd46[_0x8c14('0x24')](_0x2e5c01[0x2]);_0x19cd46[_0x8c14('0x24')](_0x2e5c01[0x3]);_0x19cd46['push'](_0x2e5c01['slice'](0x4,_0x2e5c01['length'])[_0x8c14('0x1e')](','));break;case'message':_0x19cd46['push'](_0x232146['appdata']);break;case _0x8c14('0x27'):_0x19cd46['push'](_0x232146[_0x8c14('0x28')]);_0x19cd46[_0x8c14('0x24')](_0x232146[_0x8c14('0x22')]);break;default:_0x19cd46=_[_0x8c14('0x11')](_0x232146[_0x8c14('0x22')])?[]:_0x232146[_0x8c14('0x22')][_0x8c14('0x23')](',');}var _0x3e50e8={'id':util[_0x8c14('0xf')](_0x8c14('0x29'),_0x48a973,_0x232146['id'],_0x232146[_0x8c14('0x2a')]),'condition':require(_0x8c14('0x2b'))[_0x8c14('0x2c')](_0x48a973,getIntervals(_0x21a225[_0x8c14('0x2d')],_0x232146),_0x21a225),'consequence':require(_0x8c14('0x2e')+_0x232146[_0x8c14('0x2a')])[_0x8c14('0x2f')](_0x48a973,_0x19cd46,_0x21a225,_0x567e89),'p':_0x232146[_0x8c14('0x30')]||0x0};logger[_0x8c14('0x31')](_0x8c14('0x32'),_0x3e50e8['id'],_0x8c14('0x33'),getIntervals(_0x21a225[_0x8c14('0x2d')],_0x232146)[_0x8c14('0x1e')](_0x8c14('0x34')));_0x4b2f23[_0x8c14('0x24')](_0x3e50e8);}else{logger['error'](_0x8c14('0x35'),path[_0x8c14('0x1e')](__dirname,_0x8c14('0x1b'),_0x232146['app']+_0x8c14('0x1f')));}}_0x21a225[_0x8c14('0x16')][_0x48a973]=new RuleEngine(_0x4b2f23);_0x21a225[_0x8c14('0x16')][_0x48a973][_0x8c14('0x36')](_0x567e89,function(_0x56d44a){logger[_0x8c14('0x31')](_0x8c14('0x37'),JSON[_0x8c14('0x38')](_0x56d44a[_0x8c14('0x39')]));if(_0x21a225[_0x8c14('0x16')][_0x48a973]){_0x21a225[_0x8c14('0x16')][_0x48a973]['emit'](_0x8c14('0x3a'));}});return _0x2e5762({'code':0xc8,'message':_0x567e89});}else{logger[_0x8c14('0x31')](_0x8c14('0x3b'));return _0x2e5762({'code':0xc8,'message':_0x567e89});}}catch(_0xd24e68){logger[_0x8c14('0x3c')](_0xd24e68[_0x8c14('0x3d')]);return _0x1308af(_0x107e18[_0x8c14('0x3c')](0x1f4,_0xd24e68));}}return _0x1308af(_0x8c14('0x3e'));});},'AcceptMessage':function(_0x456291){var _0x5b4abf=this;return new Promise(function(_0x37bc0c,_0x542b81){if(_0x456291[_0x8c14('0x18')]&&_0x456291[_0x8c14('0x18')]['id']){try{var _0x224447=getId(_0x456291[_0x8c14('0x17')],_0x456291[_0x8c14('0x18')]?_0x456291['message']['id']:0x0,_0x456291[_0x8c14('0x19')]?_0x456291[_0x8c14('0x19')]['id']:0x0);if(_0x21a225[_0x8c14('0x16')][_0x224447]){_0x21a225[_0x8c14('0x16')][_0x224447][_0x8c14('0x3f')](_0x8c14('0x40'));if(rpc[_0x456291[_0x8c14('0x17')]+'QueueReport']){rpc[_0x456291[_0x8c14('0x17')]+_0x8c14('0x41')][_0x8c14('0x42')](_0x224447,{'UserId':_0x456291[_0x8c14('0x18')]['UserId']})[_0x8c14('0x43')](function(_0x438d78){logger['error'](_0x8c14('0x44'));});}}return _0x37bc0c({'code':0xc8,'message':_0x456291});}catch(_0x55107a){logger[_0x8c14('0x3c')](_0x55107a[_0x8c14('0x3d')]);return _0x542b81(_0x5b4abf[_0x8c14('0x3c')](0x1f4,_0x55107a));}}logger[_0x8c14('0x3c')]('message\x20is\x20empty');return _0x542b81(_0x5b4abf[_0x8c14('0x3c')](0x1f4,_0x8c14('0x45')));});},'RejectMessage':function(_0x58db22){var _0x533d12=this;return new Promise(function(_0x5d78d9,_0x2ba5c0){if(_0x58db22['agent']&&_0x58db22[_0x8c14('0x46')]['id']){try{if(_0x21a225[_0x8c14('0x47')][_0x58db22[_0x8c14('0x46')]['id']]){_0x21a225[_0x8c14('0x47')][_0x58db22[_0x8c14('0x46')]['id']][_0x8c14('0x48')]=![];_0x21a225['agents'][_0x58db22[_0x8c14('0x46')]['id']][_0x8c14('0x49')]=undefined;}return _0x5d78d9({'code':0xc8,'message':_0x58db22});}catch(_0xacd32e){logger[_0x8c14('0x3c')](_0xacd32e[_0x8c14('0x3d')]);return _0x2ba5c0(_0x533d12[_0x8c14('0x3c')](0x1f4,_0xacd32e));}}logger[_0x8c14('0x3c')](_0x8c14('0x45'));return _0x2ba5c0(_0x533d12['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x4689f4){var _0x19acd1=this;return new Promise(function(_0x34e60a,_0x3ab67b){if(_0x4689f4['channel']&&_0x4689f4[_0x8c14('0x19')]&&_0x4689f4[_0x8c14('0x19')]['id']){try{var _0x2081c4=getId(_0x4689f4[_0x8c14('0x17')],_0x4689f4[_0x8c14('0x18')]?_0x4689f4[_0x8c14('0x18')]['id']:0x0,_0x4689f4[_0x8c14('0x19')]?_0x4689f4[_0x8c14('0x19')]['id']:0x0);if(_0x21a225[_0x8c14('0x16')][_0x2081c4]){_0x21a225[_0x8c14('0x16')][_0x2081c4][_0x8c14('0x3f')](_0x8c14('0x40'));}return _0x34e60a({'code':0xc8,'message':_0x4689f4});}catch(_0x4f0e38){logger[_0x8c14('0x3c')](_0x4f0e38[_0x8c14('0x3d')]);return _0x3ab67b(_0x19acd1[_0x8c14('0x3c')](0x1f4,_0x4f0e38));}}logger['error']('message\x20is\x20empty');return _0x3ab67b(_0x19acd1[_0x8c14('0x3c')](0x1f4,_0x8c14('0x45')));});},'AgentCapacity':function(_0x26f16e){var _0x305615=this;return new Promise(function(_0xf3b6a1,_0x115ef1){if(_0x21a225['agents']['hasOwnProperty'](_0x26f16e['id'])){for(var _0x14eb5b in _0x26f16e['capacity']){if(_0x26f16e[_0x8c14('0x4a')][_0x8c14('0x4b')](_0x14eb5b)){if(_0x21a225['agents'][_0x26f16e['id']]['hasOwnProperty'](_0x14eb5b+_0x8c14('0x4c'))){_0x21a225[_0x8c14('0x47')][_0x26f16e['id']][_0x14eb5b+'CurrentCapacity']=parseInt(_0x26f16e['capacity'][_0x14eb5b],0xa);}}}_0x21a225['agents'][_0x26f16e['id']][_0x8c14('0x4d')]();return _0xf3b6a1({'code':0xc8,'message':_0x21a225[_0x8c14('0x47')][_0x26f16e['id']]});}else{return _0x115ef1(_0x305615[_0x8c14('0x3c')](0x1f4,_0x8c14('0x4e')));}});},'Agents':function(_0x3222f8){return new Promise(function(_0x433d87,_0x2ffe20){var _0xe05969=_[_0x8c14('0x4f')](_0x21a225[_0x8c14('0x47')]);_0x433d87({'count':_0xe05969[_0x8c14('0x1c')],'rows':_0xe05969});});},'ChatQueues':function(_0x431e2f){return new Promise(function(_0x3e7ee3,_0x3eef3d){var _0x358e5d=[];for(var _0x18a0e9 in _0x21a225[_0x8c14('0x50')]){if(_0x21a225[_0x8c14('0x50')][_0x8c14('0x4b')](_0x18a0e9)){var _0x488798=_0x21a225[_0x8c14('0x50')][_0x18a0e9];var _0x4c5292={'id':_0x488798['id'],'available':_0x488798[_0x8c14('0x51')],'loggedIn':_0x488798['loggedIn'],'name':_0x488798[_0x8c14('0x52')],'paused':_0x488798['paused'],'waiting':_0x488798[_0x8c14('0x53')]};_0x358e5d[_0x8c14('0x24')](_0x4c5292);}}_0x3e7ee3({'count':_0x358e5d[_0x8c14('0x1c')],'rows':_0x358e5d});});},'MailQueues':function(_0x521934){return new Promise(function(_0x37f68e,_0x49a752){var _0x1dd11e=[];for(var _0x1e3e3c in _0x21a225[_0x8c14('0x54')]){if(_0x21a225[_0x8c14('0x54')][_0x8c14('0x4b')](_0x1e3e3c)){var _0x2c6e4a=_0x21a225[_0x8c14('0x54')][_0x1e3e3c];var _0x4d32ae={'id':_0x2c6e4a['id'],'available':_0x2c6e4a[_0x8c14('0x51')],'loggedIn':_0x2c6e4a['loggedIn'],'name':_0x2c6e4a[_0x8c14('0x52')],'paused':_0x2c6e4a['paused'],'waiting':_0x2c6e4a[_0x8c14('0x53')]};_0x1dd11e[_0x8c14('0x24')](_0x4d32ae);}}_0x37f68e({'count':_0x1dd11e[_0x8c14('0x1c')],'rows':_0x1dd11e});});},'OpenchannelQueues':function(_0x4e7c14){return new Promise(function(_0x292e39,_0x318a8e){var _0x546cb8=[];for(var _0x1b06a0 in _0x21a225[_0x8c14('0x55')]){if(_0x21a225[_0x8c14('0x55')][_0x8c14('0x4b')](_0x1b06a0)){var _0x5806c5=_0x21a225['openchannelQueues'][_0x1b06a0];var _0x5dcdc3={'id':_0x5806c5['id'],'available':_0x5806c5['available'],'loggedIn':_0x5806c5[_0x8c14('0x56')],'name':_0x5806c5[_0x8c14('0x52')],'paused':_0x5806c5['paused'],'waiting':_0x5806c5['waiting']};_0x546cb8[_0x8c14('0x24')](_0x5dcdc3);}}_0x292e39({'count':_0x546cb8[_0x8c14('0x1c')],'rows':_0x546cb8});});},'SmsQueues':function(_0x2ff7ad){return new Promise(function(_0x103a40,_0x42071f){var _0x175d72=[];for(var _0x340f1d in _0x21a225[_0x8c14('0x57')]){if(_0x21a225[_0x8c14('0x57')]['hasOwnProperty'](_0x340f1d)){var _0x113bec=_0x21a225[_0x8c14('0x57')][_0x340f1d];var _0x28ddd1={'id':_0x113bec['id'],'available':_0x113bec[_0x8c14('0x51')],'loggedIn':_0x113bec[_0x8c14('0x56')],'name':_0x113bec[_0x8c14('0x52')],'paused':_0x113bec[_0x8c14('0x58')],'waiting':_0x113bec[_0x8c14('0x53')]};_0x175d72[_0x8c14('0x24')](_0x28ddd1);}}_0x103a40({'count':_0x175d72[_0x8c14('0x1c')],'rows':_0x175d72});});},'FaxQueues':function(_0x575146){return new Promise(function(_0x98967c,_0x1ff368){var _0xca4f64=[];for(var _0x4deafe in _0x21a225['faxQueues']){if(_0x21a225[_0x8c14('0x59')]['hasOwnProperty'](_0x4deafe)){var _0x5fc2f1=_0x21a225[_0x8c14('0x59')][_0x4deafe];var _0xacd669={'id':_0x5fc2f1['id'],'available':_0x5fc2f1[_0x8c14('0x51')],'loggedIn':_0x5fc2f1[_0x8c14('0x56')],'name':_0x5fc2f1[_0x8c14('0x52')],'paused':_0x5fc2f1[_0x8c14('0x58')],'waiting':_0x5fc2f1[_0x8c14('0x53')]};_0xca4f64[_0x8c14('0x24')](_0xacd669);}}_0x98967c({'count':_0xca4f64[_0x8c14('0x1c')],'rows':_0xca4f64});});},'WhatsappQueues':function(_0xdf9c8){return new Promise(function(_0x396753,_0x2c5990){var _0x5e388c=[];for(var _0x3844fd in _0x21a225[_0x8c14('0x5a')]){if(_0x21a225['whatsappQueues'][_0x8c14('0x4b')](_0x3844fd)){var _0x3b25a0=_0x21a225[_0x8c14('0x5a')][_0x3844fd];var _0x450c57={'id':_0x3b25a0['id'],'available':_0x3b25a0[_0x8c14('0x51')],'loggedIn':_0x3b25a0[_0x8c14('0x56')],'name':_0x3b25a0['name'],'paused':_0x3b25a0[_0x8c14('0x58')],'waiting':_0x3b25a0[_0x8c14('0x53')]};_0x5e388c[_0x8c14('0x24')](_0x450c57);}}_0x396753({'count':_0x5e388c[_0x8c14('0x1c')],'rows':_0x5e388c});});},'ChatQueuesWaitingInteractions':function(_0x476d5f){return new Promise(function(_0x3ddd4a,_0x4eaefa){var _0x13ad10=_[_0x8c14('0x4f')](_0x21a225[_0x8c14('0x5b')]);_0x3ddd4a({'count':_0x13ad10[_0x8c14('0x1c')],'rows':_0x13ad10});});},'MailQueuesWaitingInteractions':function(_0x52cff3){return new Promise(function(_0x33913d,_0xbdf74a){var _0x23f3c1=_[_0x8c14('0x4f')](_0x21a225[_0x8c14('0x5c')]);_0x33913d({'count':_0x23f3c1[_0x8c14('0x1c')],'rows':_0x23f3c1});});},'OpenchannelQueuesWaitingInteractions':function(_0xd21005){return new Promise(function(_0x2c176a,_0x335adb){var _0x19ba60=_[_0x8c14('0x4f')](_0x21a225[_0x8c14('0x5d')]);_0x2c176a({'count':_0x19ba60[_0x8c14('0x1c')],'rows':_0x19ba60});});},'SmsQueuesWaitingInteractions':function(_0x1cd537){return new Promise(function(_0x2e723e,_0x2e75f1){var _0x5834e1=_['values'](_0x21a225[_0x8c14('0x5e')]);_0x2e723e({'count':_0x5834e1[_0x8c14('0x1c')],'rows':_0x5834e1});});},'FaxQueuesWaitingInteractions':function(_0x1e182b){return new Promise(function(_0x168e82,_0xe340c0){var _0x160938=_[_0x8c14('0x4f')](_0x21a225[_0x8c14('0x5f')]);_0x168e82({'count':_0x160938[_0x8c14('0x1c')],'rows':_0x160938});});},'WhatsappQueuesWaitingInteractions':function(_0x2be983){return new Promise(function(_0x52958c,_0x5c24fc){var _0x371e58=_[_0x8c14('0x4f')](_0x21a225[_0x8c14('0x60')]);_0x52958c({'count':_0x371e58[_0x8c14('0x1c')],'rows':_0x371e58});});}};var _0x806784=jayson[_0x8c14('0x61')](_0x56b654)[_0x8c14('0x62')]();_0x806784['on']('error',function(_0x58acfe){logger['error'](JSON[_0x8c14('0x38')](_0x58acfe));return _0x24073f(_0x58acfe);});_0x806784[_0x8c14('0x15')](0x232c,_0x8c14('0x63'),function(){console[_0x8c14('0x64')](_0x8c14('0x65'),0x232c);return _0x59517e(_0x8c14('0x66')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index a1bc5ee..3fe2984 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 _0x7caf=['when','stack','stop','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join'];(function(_0x2da316,_0x5e9bbc){var _0x4bdada=function(_0xf31a3f){while(--_0xf31a3f){_0x2da316['push'](_0x2da316['shift']());}};_0x4bdada(++_0x5e9bbc);}(_0x7caf,0x158));var _0xf7ca=function(_0x4360d8,_0x4f9215){_0x4360d8=_0x4360d8-0x0;var _0x4bcc17=_0x7caf[_0x4360d8];return _0x4bcc17;};'use strict';var util=require(_0xf7ca('0x0'));var BPromise=require(_0xf7ca('0x1'));var jayson=require(_0xf7ca('0x2'));var _=require(_0xf7ca('0x3'));var logger=require(_0xf7ca('0x4'))(_0xf7ca('0x5'));var client=jayson[_0xf7ca('0x6')][_0xf7ca('0x7')]({'port':0x232a});function request(_0x3c5d5c,_0x400bee){return new BPromise(function(_0x42e2a3,_0x12c91b){return client[_0xf7ca('0x8')](_0x3c5d5c,_0x400bee)[_0xf7ca('0x9')](function(_0x4b1dbb){if(_0x4b1dbb[_0xf7ca('0xa')]){return _0x12c91b(_0x4b1dbb[_0xf7ca('0xa')][_0xf7ca('0xb')]);}else{return _0x42e2a3(_0x4b1dbb[_0xf7ca('0xc')]);}})[_0xf7ca('0xd')](function(_0x5440ea){return _0x12c91b(_0x5440ea);});});}exports[_0xf7ca('0xe')]=function(_0x393dd9,_0x5aa368,_0x53dae5){return function(_0x539268){if(_0x53dae5[_0xf7ca('0xf')]&&!_0x53dae5[_0xf7ca('0xf')][_0x393dd9]){logger[_0xf7ca('0x10')](_0xf7ca('0x11'),_0x393dd9);return _0x539268['stop']();}var _0x386d5e=[];for(var _0x322fe3=0x0;_0x322fe3<_0x5aa368[_0xf7ca('0x12')];_0x322fe3+=0x1){_0x386d5e[_0xf7ca('0x13')](request('Command',{'command':util['format'](_0xf7ca('0x14'),_0x5aa368[_0x322fe3])})['then'](function(_0x1e5dc5){return _0x1e5dc5&&_0x1e5dc5[_0xf7ca('0xb')]&&_0x1e5dc5[_0xf7ca('0xb')][_0xf7ca('0x15')](_0xf7ca('0x16'))>=0x0?!![]:![];})[_0xf7ca('0xd')](function(_0x20ab57){logger[_0xf7ca('0xa')](_0xf7ca('0x17'),_0x393dd9,_0x5aa368[_0x322fe3]);}));}BPromise[_0xf7ca('0x18')](_0x386d5e)[_0xf7ca('0x9')](function(_0x15ca54){var _0x423a27=_[_0xf7ca('0x19')](_0x15ca54);logger[_0xf7ca('0x10')](_0xf7ca('0x1a'),_0x393dd9,_0x5aa368[_0xf7ca('0x1b')]('\x20|\x20'),_0x423a27);_0x539268[_0xf7ca('0x1c')](_0x423a27);})['catch'](function(_0xcd224a){console['log'](_0xcd224a);logger['error']('[%s][INTERVAL]\x20%s\x20%s',_0x393dd9,_0x5aa368['join']('\x20|\x20'),_0xcd224a[_0xf7ca('0x1d')]);_0x539268[_0xf7ca('0x1e')]();});};}; \ No newline at end of file +var _0x7311=['join','\x20|\x20','when','log','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','request','then','error','message','result','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','catch','all','some','[%s][INTERVAL]\x20%s\x20%s'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7311,0xfd));var _0x1731=function(_0x196655,_0x3664e2){_0x196655=_0x196655-0x0;var _0x51e53f=_0x7311[_0x196655];return _0x51e53f;};'use strict';var util=require(_0x1731('0x0'));var BPromise=require(_0x1731('0x1'));var jayson=require(_0x1731('0x2'));var _=require(_0x1731('0x3'));var logger=require(_0x1731('0x4'))(_0x1731('0x5'));var client=jayson[_0x1731('0x6')]['http']({'port':0x232a});function request(_0x449d1b,_0x5c5bad){return new BPromise(function(_0x4eee1c,_0x50fb79){return client[_0x1731('0x7')](_0x449d1b,_0x5c5bad)[_0x1731('0x8')](function(_0x3d43de){if(_0x3d43de[_0x1731('0x9')]){return _0x50fb79(_0x3d43de[_0x1731('0x9')][_0x1731('0xa')]);}else{return _0x4eee1c(_0x3d43de[_0x1731('0xb')]);}})['catch'](function(_0x552598){return _0x50fb79(_0x552598);});});}exports[_0x1731('0xc')]=function(_0x4e50ed,_0x23aab5,_0x14ea11){return function(_0x22418b){if(_0x14ea11[_0x1731('0xd')]&&!_0x14ea11[_0x1731('0xd')][_0x4e50ed]){logger['info'](_0x1731('0xe'),_0x4e50ed);return _0x22418b[_0x1731('0xf')]();}var _0x4bc166=[];for(var _0x34eaeb=0x0;_0x34eaeb<_0x23aab5[_0x1731('0x10')];_0x34eaeb+=0x1){_0x4bc166[_0x1731('0x11')](request(_0x1731('0x12'),{'command':util[_0x1731('0x13')](_0x1731('0x14'),_0x23aab5[_0x34eaeb])})['then'](function(_0x50ed1e){return _0x50ed1e&&_0x50ed1e[_0x1731('0xa')]&&_0x50ed1e[_0x1731('0xa')][_0x1731('0x15')]('true')>=0x0?!![]:![];})[_0x1731('0x16')](function(_0xff90e3){logger[_0x1731('0x9')]('[%s][INTERVAL]\x20%s',_0x4e50ed,_0x23aab5[_0x34eaeb]);}));}BPromise[_0x1731('0x17')](_0x4bc166)[_0x1731('0x8')](function(_0x2c40ba){var _0x3aab4d=_[_0x1731('0x18')](_0x2c40ba);logger['info'](_0x1731('0x19'),_0x4e50ed,_0x23aab5[_0x1731('0x1a')](_0x1731('0x1b')),_0x3aab4d);_0x22418b[_0x1731('0x1c')](_0x3aab4d);})[_0x1731('0x16')](function(_0xd93287){console[_0x1731('0x1d')](_0xd93287);logger[_0x1731('0x9')](_0x1731('0x19'),_0x4e50ed,_0x23aab5[_0x1731('0x1a')](_0x1731('0x1b')),_0xd93287[_0x1731('0x1e')]);_0x22418b[_0x1731('0xf')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7ff989b..da50d3d 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 _0x3f48=['reason','holdtime','talktime','push','queuecallerabandon','includes','abandoned','agentconnect','ringtime','connect','forIn','answeredelsewheredestinationuniqueid','answeredelsewheremembername','membername','agentcomplete','agentcompleteAt','diffTime','agentconnectAt','blindtransfer','transfereruniqueid','transfer','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','origtransfereruniqueid','transfereeuniqueid','clone','calleridname','agententerreason','secondtransfererlinkedid','transfertargetuniqueid','cause','rejected','splice','complete','./utils','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','queue','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','now','called','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout'];(function(_0x4e5552,_0x19ec4e){var _0x60a338=function(_0x40c70e){while(--_0x40c70e){_0x4e5552['push'](_0x4e5552['shift']());}};_0x60a338(++_0x19ec4e);}(_0x3f48,0x17c));var _0x83f4=function(_0xad6138,_0x466c4b){_0xad6138=_0xad6138-0x0;var _0x9b96a2=_0x3f48[_0xad6138];return _0x9b96a2;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x83f4('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0xee5856,_0x22e41d){utils[_0x83f4('0x1')](util['format'](_0x83f4('0x2'),_0xee5856[_0x83f4('0x3')],_0xee5856['channel'],_0xee5856[_0x83f4('0x4')],_0xee5856['membername'],_0xee5856[_0x83f4('0x5')],_0xee5856[_0x83f4('0x6')],_0xee5856[_0x83f4('0x7')],_0xee5856[_0x83f4('0x8')]));if(_0xee5856[_0x83f4('0x4')]){utils[_0x83f4('0x9')](_0xee5856[_0x83f4('0x4')])[_0x83f4('0xa')](function(_0x47964e){if(_0x47964e){_0xee5856[_0x83f4('0xb')]=_0x47964e[_0x83f4('0xb')];_0xee5856[_0x83f4('0xc')]=_0xee5856['agentcomplete']?_0x47964e['acw']:![];_0xee5856['acwtime']=_0xee5856[_0x83f4('0xc')]?_0x47964e[_0x83f4('0xd')]:0x0;}utils[_0x83f4('0xe')]('CreateVoiceAgentReport',_0xee5856);});}else{utils[_0x83f4('0xe')](_0x83f4('0xf'),_0xee5856);}if(_0x22e41d){delete transfers[_0xee5856['uniqueid']];}else{delete agents[_0xee5856[_0x83f4('0x10')]];}}exports[_0x83f4('0x11')]=function(_0x2071cc){try{agents[_0x2071cc[_0x83f4('0x10')]]=_0x2071cc;agents[_0x2071cc[_0x83f4('0x10')]][_0x83f4('0x12')]=utils[_0x83f4('0x13')]();agents[_0x2071cc['destuniqueid']][_0x83f4('0x8')]=_0x83f4('0x14');agents[_0x2071cc[_0x83f4('0x10')]][_0x83f4('0x7')]=null;agents[_0x2071cc[_0x83f4('0x10')]][_0x83f4('0x15')]=null;}catch(_0x4f0f62){utils[_0x83f4('0x16')](_0x4f0f62[_0x83f4('0x17')]);}};exports[_0x83f4('0x18')]=function(_0x202511){try{if(!_[_0x83f4('0x19')](agents[_0x202511['destuniqueid']])){agents[_0x202511[_0x83f4('0x10')]]['agentringnoanswer']=!![];agents[_0x202511[_0x83f4('0x10')]][_0x83f4('0x1a')]=utils[_0x83f4('0x13')]();agents[_0x202511[_0x83f4('0x10')]][_0x83f4('0x8')]=_0x83f4('0x1b');agents[_0x202511['destuniqueid']][_0x83f4('0x1c')]=_0x83f4('0x1b');agents[_0x202511[_0x83f4('0x10')]][_0x83f4('0x1d')]=_0x202511['ringtime']?parseInt(_0x202511['ringtime'])/0x3e8:0x0;agents[_0x202511[_0x83f4('0x10')]][_0x83f4('0x1e')]=0x0;unanswered[_0x83f4('0x1f')](_0x202511[_0x83f4('0x10')]);}}catch(_0x487262){utils[_0x83f4('0x16')](_0x487262[_0x83f4('0x17')]);}};exports[_0x83f4('0x20')]=function(_0x10c3b8){try{_['forIn'](agents,function(_0x1ff942,_0x570ec3){if(_0x1ff942[_0x83f4('0x3')]==_0x10c3b8[_0x83f4('0x3')]&&!_[_0x83f4('0x21')](unanswered,_0x1ff942[_0x83f4('0x10')])){_0x1ff942[_0x83f4('0x18')]=!![];_0x1ff942[_0x83f4('0x1a')]=utils[_0x83f4('0x13')]();_0x1ff942[_0x83f4('0x8')]=_0x83f4('0x22');_0x1ff942[_0x83f4('0x1c')]=_0x83f4('0x22');_0x1ff942['holdtime']=_0x10c3b8[_0x83f4('0x1d')];_0x1ff942['talktime']=0x0;writeDB(_0x1ff942);}});}catch(_0x5d260d){utils[_0x83f4('0x16')](_0x5d260d['stack']);}};exports[_0x83f4('0x23')]=function(_0xbc819e){try{if(agents[_0xbc819e[_0x83f4('0x10')]]){agents[_0xbc819e['destuniqueid']]['agentconnectAt']=utils['now']();agents[_0xbc819e[_0x83f4('0x10')]][_0x83f4('0x7')]=_0xbc819e[_0x83f4('0x7')];agents[_0xbc819e[_0x83f4('0x10')]]['connectedlinename']=_0xbc819e[_0x83f4('0x15')];agents[_0xbc819e[_0x83f4('0x10')]][_0x83f4('0x1d')]=_0xbc819e[_0x83f4('0x24')];agents[_0xbc819e[_0x83f4('0x10')]][_0x83f4('0x8')]=_0x83f4('0x25');_[_0x83f4('0x26')](agents,function(_0x5ca9bc,_0x203d08){if(_0x5ca9bc['destuniqueid']!=_0xbc819e[_0x83f4('0x10')]&&_0x5ca9bc['uniqueid']==_0xbc819e[_0x83f4('0x3')]){_0x5ca9bc['talktime']=0x0;_0x5ca9bc[_0x83f4('0x1d')]=_0xbc819e[_0x83f4('0x24')];_0x5ca9bc['agentringnoanswer']=!![];_0x5ca9bc[_0x83f4('0x1a')]=utils['now']();_0x5ca9bc[_0x83f4('0x8')]='answered_elsewhere';_0x5ca9bc[_0x83f4('0x1c')]='answered_elsewhere';_0x5ca9bc[_0x83f4('0x27')]=_0xbc819e[_0x83f4('0x10')];_0x5ca9bc[_0x83f4('0x28')]=_0xbc819e[_0x83f4('0x29')];writeDB(_0x5ca9bc);}});}}catch(_0x383495){utils[_0x83f4('0x16')](_0x383495['stack']);}};exports[_0x83f4('0x2a')]=function(_0x2a88d5){try{if(!_[_0x83f4('0x19')](agents[_0x2a88d5[_0x83f4('0x10')]])){agents[_0x2a88d5[_0x83f4('0x10')]][_0x83f4('0x2a')]=!![];agents[_0x2a88d5[_0x83f4('0x10')]][_0x83f4('0x2b')]=utils[_0x83f4('0x13')]();agents[_0x2a88d5[_0x83f4('0x10')]][_0x83f4('0x1e')]=utils[_0x83f4('0x2c')](agents[_0x2a88d5[_0x83f4('0x10')]][_0x83f4('0x2b')],agents[_0x2a88d5[_0x83f4('0x10')]][_0x83f4('0x2d')]);agents[_0x2a88d5[_0x83f4('0x10')]][_0x83f4('0x1c')]=_0x2a88d5[_0x83f4('0x1c')];agents[_0x2a88d5[_0x83f4('0x10')]][_0x83f4('0x8')]='complete';writeDB(agents[_0x2a88d5[_0x83f4('0x10')]]);}}catch(_0x518bce){utils['error'](_0x518bce[_0x83f4('0x17')]);}};exports[_0x83f4('0x2e')]=function(_0x452cc6){try{if(!_[_0x83f4('0x19')](agents[_0x452cc6['transfereruniqueid']])){agents[_0x452cc6[_0x83f4('0x2f')]][_0x83f4('0x30')]=!![];agents[_0x452cc6[_0x83f4('0x2f')]][_0x83f4('0x31')]='blind';agents[_0x452cc6[_0x83f4('0x2f')]][_0x83f4('0x32')]=_0x452cc6[_0x83f4('0x33')];agents[_0x452cc6[_0x83f4('0x2f')]][_0x83f4('0x34')]=agents[_0x452cc6[_0x83f4('0x2f')]][_0x83f4('0x3')];}}catch(_0x416d59){utils['error'](_0x416d59[_0x83f4('0x17')]);}};exports[_0x83f4('0x35')]=function(_0x598f8f){try{if(_0x598f8f['origtransfereruniqueid']==_0x598f8f[_0x83f4('0x36')]){if(!_[_0x83f4('0x19')](agents[_0x598f8f[_0x83f4('0x37')]])){agents[_0x598f8f[_0x83f4('0x37')]][_0x83f4('0x30')]=!![];agents[_0x598f8f[_0x83f4('0x37')]][_0x83f4('0x31')]=_0x83f4('0x38');agents[_0x598f8f['secondtransfereruniqueid']][_0x83f4('0x32')]=_0x598f8f['origtransfererexten'];agents[_0x598f8f[_0x83f4('0x37')]][_0x83f4('0x34')]=_0x598f8f[_0x83f4('0x39')];}if(_0x598f8f[_0x83f4('0x3a')]&&agents[_0x598f8f[_0x83f4('0x3a')]]){agents[_0x598f8f['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x598f8f[_0x83f4('0x3a')]]=_[_0x83f4('0x3b')](agents[_0x598f8f[_0x83f4('0x3a')]]);transfers[_0x598f8f[_0x83f4('0x3a')]][_0x83f4('0x6')]=agents[_0x598f8f['secondtransfereruniqueid']][_0x83f4('0x6')];transfers[_0x598f8f[_0x83f4('0x3a')]][_0x83f4('0x3c')]=agents[_0x598f8f[_0x83f4('0x37')]][_0x83f4('0x3c')];transfers[_0x598f8f['transfereeuniqueid']][_0x83f4('0x12')]=utils[_0x83f4('0x13')]();transfers[_0x598f8f[_0x83f4('0x3a')]]['agentconnectAt']=utils[_0x83f4('0x13')]();transfers[_0x598f8f['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x598f8f['transfereeuniqueid']][_0x83f4('0x3d')]=0x2;}}else if(_0x598f8f[_0x83f4('0x37')]==_0x598f8f[_0x83f4('0x3e')]){if(!_[_0x83f4('0x19')](agents[_0x598f8f[_0x83f4('0x39')]])){agents[_0x598f8f[_0x83f4('0x39')]][_0x83f4('0x30')]=!![];agents[_0x598f8f[_0x83f4('0x39')]][_0x83f4('0x31')]=_0x83f4('0x38');agents[_0x598f8f[_0x83f4('0x39')]]['transferexten']=_0x598f8f['secondtransfererexten'];agents[_0x598f8f['origtransfereruniqueid']][_0x83f4('0x34')]=_0x598f8f[_0x83f4('0x37')];}if(_0x598f8f[_0x83f4('0x3f')]&&agents[_0x598f8f[_0x83f4('0x3f')]]){agents[_0x598f8f['transfertargetuniqueid']][_0x83f4('0x3d')]=0x1;transfers[_0x598f8f[_0x83f4('0x3f')]]=_['clone'](agents[_0x598f8f['transfertargetuniqueid']]);transfers[_0x598f8f[_0x83f4('0x3f')]][_0x83f4('0x6')]=agents[_0x598f8f['origtransfereruniqueid']][_0x83f4('0x6')];transfers[_0x598f8f[_0x83f4('0x3f')]][_0x83f4('0x3c')]=agents[_0x598f8f['origtransfereruniqueid']][_0x83f4('0x3c')];transfers[_0x598f8f[_0x83f4('0x3f')]][_0x83f4('0x12')]=utils[_0x83f4('0x13')]();transfers[_0x598f8f[_0x83f4('0x3f')]][_0x83f4('0x2d')]=utils[_0x83f4('0x13')]();transfers[_0x598f8f[_0x83f4('0x3f')]]['holdtime']=0x0;transfers[_0x598f8f['transfertargetuniqueid']][_0x83f4('0x3d')]=0x2;}}}catch(_0x113590){utils[_0x83f4('0x16')](_0x113590[_0x83f4('0x17')]);}};exports['hangup']=function(_0x42107e){try{if(agents[_0x42107e[_0x83f4('0x3')]]&&agents[_0x42107e['uniqueid']]['reason']==='timeout'){if(_0x42107e[_0x83f4('0x40')]==='21'){agents[_0x42107e[_0x83f4('0x3')]][_0x83f4('0x1c')]=_0x83f4('0x41');agents[_0x42107e[_0x83f4('0x3')]]['lastevent']=_0x83f4('0x41');}writeDB(agents[_0x42107e[_0x83f4('0x3')]]);var _0x23386b=unanswered['indexOf'](_0x42107e[_0x83f4('0x3')]);if(_0x23386b>-0x1)unanswered[_0x83f4('0x42')](_0x23386b,0x1);}if(transfers[_0x42107e[_0x83f4('0x3')]]){transfers[_0x42107e['uniqueid']]['agentcomplete']=!![];transfers[_0x42107e[_0x83f4('0x3')]][_0x83f4('0x2b')]=utils['now']();transfers[_0x42107e[_0x83f4('0x3')]][_0x83f4('0x1e')]=utils[_0x83f4('0x2c')](transfers[_0x42107e['uniqueid']][_0x83f4('0x2b')],transfers[_0x42107e[_0x83f4('0x3')]][_0x83f4('0x2d')]);transfers[_0x42107e['uniqueid']][_0x83f4('0x1c')]='agent';transfers[_0x42107e[_0x83f4('0x3')]][_0x83f4('0x8')]=_0x83f4('0x43');writeDB(transfers[_0x42107e[_0x83f4('0x3')]],!![]);}if(agents[_0x42107e[_0x83f4('0x3')]]&&agents[_0x42107e[_0x83f4('0x3')]][_0x83f4('0x2d')]){agents[_0x42107e[_0x83f4('0x3')]][_0x83f4('0x2a')]=!![];agents[_0x42107e[_0x83f4('0x3')]][_0x83f4('0x2b')]=utils[_0x83f4('0x13')]();agents[_0x42107e[_0x83f4('0x3')]]['talktime']=utils[_0x83f4('0x2c')](agents[_0x42107e['uniqueid']]['agentcompleteAt'],agents[_0x42107e[_0x83f4('0x3')]][_0x83f4('0x2d')]);agents[_0x42107e['uniqueid']][_0x83f4('0x1c')]=agents[_0x42107e[_0x83f4('0x3')]][_0x83f4('0x30')]?_0x83f4('0x30'):'agent';agents[_0x42107e[_0x83f4('0x3')]][_0x83f4('0x8')]=_0x83f4('0x43');writeDB(agents[_0x42107e[_0x83f4('0x3')]]);}}catch(_0xd12998){utils[_0x83f4('0x16')](_0xd12998[_0x83f4('0x17')]);}}; \ No newline at end of file +var _0xaf09=['request','CreateVoiceAgentReport','agentcalled','destuniqueid','agentcalledAt','now','called','connectedlinename','stack','agentringnoanswer','isNil','agentringnoanswerAt','timeout','ringtime','talktime','error','queuecallerabandon','forIn','includes','abandoned','reason','agentconnect','connect','holdtime','answered_elsewhere','answeredelsewheredestinationuniqueid','agentcomplete','agentcompleteAt','diffTime','agentconnectAt','complete','blindtransfer','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','calleridname','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','hangup','cause','rejected','indexOf','agent','lodash','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','agentacw','acw','acwtime'];(function(_0x1880db,_0x70017){var _0x37359f=function(_0x10abf7){while(--_0x10abf7){_0x1880db['push'](_0x1880db['shift']());}};_0x37359f(++_0x70017);}(_0xaf09,0x1ab));var _0x9af0=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xaf09[_0x134c2e];return _0x2825db;};'use strict';var _=require(_0x9af0('0x0'));var util=require(_0x9af0('0x1'));var utils=require(_0x9af0('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x56b188,_0x251205){utils[_0x9af0('0x3')](util[_0x9af0('0x4')](_0x9af0('0x5'),_0x56b188[_0x9af0('0x6')],_0x56b188['channel'],_0x56b188[_0x9af0('0x7')],_0x56b188[_0x9af0('0x8')],_0x56b188['interface'],_0x56b188[_0x9af0('0x9')],_0x56b188[_0x9af0('0xa')],_0x56b188[_0x9af0('0xb')]));if(_0x56b188[_0x9af0('0x7')]){utils[_0x9af0('0xc')](_0x56b188[_0x9af0('0x7')])[_0x9af0('0xd')](function(_0x47b651){if(_0x47b651){_0x56b188['type']=_0x47b651['type'];_0x56b188[_0x9af0('0xe')]=_0x56b188['agentcomplete']?_0x47b651[_0x9af0('0xf')]:![];_0x56b188[_0x9af0('0x10')]=_0x56b188['agentacw']?_0x47b651['acwTimeout']:0x0;}utils[_0x9af0('0x11')](_0x9af0('0x12'),_0x56b188);});}else{utils['request']('CreateVoiceAgentReport',_0x56b188);}if(_0x251205){delete transfers[_0x56b188[_0x9af0('0x6')]];}else{delete agents[_0x56b188['destuniqueid']];}}exports[_0x9af0('0x13')]=function(_0x5f0f5d){try{agents[_0x5f0f5d[_0x9af0('0x14')]]=_0x5f0f5d;agents[_0x5f0f5d[_0x9af0('0x14')]][_0x9af0('0x15')]=utils[_0x9af0('0x16')]();agents[_0x5f0f5d[_0x9af0('0x14')]][_0x9af0('0xb')]=_0x9af0('0x17');agents[_0x5f0f5d[_0x9af0('0x14')]][_0x9af0('0xa')]=null;agents[_0x5f0f5d[_0x9af0('0x14')]][_0x9af0('0x18')]=null;}catch(_0x2cb6f4){utils['error'](_0x2cb6f4[_0x9af0('0x19')]);}};exports[_0x9af0('0x1a')]=function(_0x8cb951){try{if(!_[_0x9af0('0x1b')](agents[_0x8cb951['destuniqueid']])){agents[_0x8cb951[_0x9af0('0x14')]][_0x9af0('0x1a')]=!![];agents[_0x8cb951[_0x9af0('0x14')]][_0x9af0('0x1c')]=utils[_0x9af0('0x16')]();agents[_0x8cb951['destuniqueid']][_0x9af0('0xb')]=_0x9af0('0x1d');agents[_0x8cb951['destuniqueid']]['reason']=_0x9af0('0x1d');agents[_0x8cb951[_0x9af0('0x14')]]['holdtime']=_0x8cb951[_0x9af0('0x1e')]?parseInt(_0x8cb951['ringtime'])/0x3e8:0x0;agents[_0x8cb951[_0x9af0('0x14')]][_0x9af0('0x1f')]=0x0;unanswered['push'](_0x8cb951[_0x9af0('0x14')]);}}catch(_0x1e6bbc){utils[_0x9af0('0x20')](_0x1e6bbc['stack']);}};exports[_0x9af0('0x21')]=function(_0x3aa74a){try{_[_0x9af0('0x22')](agents,function(_0x1f3b88,_0x3a9367){if(_0x1f3b88[_0x9af0('0x6')]==_0x3aa74a['uniqueid']&&!_[_0x9af0('0x23')](unanswered,_0x1f3b88['destuniqueid'])){_0x1f3b88[_0x9af0('0x1a')]=!![];_0x1f3b88['agentringnoanswerAt']=utils[_0x9af0('0x16')]();_0x1f3b88[_0x9af0('0xb')]=_0x9af0('0x24');_0x1f3b88[_0x9af0('0x25')]=_0x9af0('0x24');_0x1f3b88['holdtime']=_0x3aa74a['holdtime'];_0x1f3b88[_0x9af0('0x1f')]=0x0;writeDB(_0x1f3b88);}});}catch(_0x760dee){utils[_0x9af0('0x20')](_0x760dee[_0x9af0('0x19')]);}};exports[_0x9af0('0x26')]=function(_0x223699){try{if(agents[_0x223699[_0x9af0('0x14')]]){agents[_0x223699[_0x9af0('0x14')]]['agentconnectAt']=utils['now']();agents[_0x223699[_0x9af0('0x14')]][_0x9af0('0xa')]=_0x223699[_0x9af0('0xa')];agents[_0x223699[_0x9af0('0x14')]]['connectedlinename']=_0x223699['connectedlinename'];agents[_0x223699[_0x9af0('0x14')]]['holdtime']=_0x223699[_0x9af0('0x1e')];agents[_0x223699[_0x9af0('0x14')]][_0x9af0('0xb')]=_0x9af0('0x27');_[_0x9af0('0x22')](agents,function(_0x317514,_0x1861da){if(_0x317514[_0x9af0('0x14')]!=_0x223699[_0x9af0('0x14')]&&_0x317514[_0x9af0('0x6')]==_0x223699[_0x9af0('0x6')]){_0x317514[_0x9af0('0x1f')]=0x0;_0x317514[_0x9af0('0x28')]=_0x223699[_0x9af0('0x1e')];_0x317514['agentringnoanswer']=!![];_0x317514[_0x9af0('0x1c')]=utils[_0x9af0('0x16')]();_0x317514['lastevent']=_0x9af0('0x29');_0x317514['reason']=_0x9af0('0x29');_0x317514[_0x9af0('0x2a')]=_0x223699['destuniqueid'];_0x317514['answeredelsewheremembername']=_0x223699[_0x9af0('0x8')];writeDB(_0x317514);}});}}catch(_0x49e3af){utils['error'](_0x49e3af[_0x9af0('0x19')]);}};exports[_0x9af0('0x2b')]=function(_0x3fd3f5){try{if(!_['isNil'](agents[_0x3fd3f5[_0x9af0('0x14')]])){agents[_0x3fd3f5['destuniqueid']][_0x9af0('0x2b')]=!![];agents[_0x3fd3f5[_0x9af0('0x14')]][_0x9af0('0x2c')]=utils[_0x9af0('0x16')]();agents[_0x3fd3f5[_0x9af0('0x14')]][_0x9af0('0x1f')]=utils[_0x9af0('0x2d')](agents[_0x3fd3f5[_0x9af0('0x14')]][_0x9af0('0x2c')],agents[_0x3fd3f5['destuniqueid']][_0x9af0('0x2e')]);agents[_0x3fd3f5[_0x9af0('0x14')]][_0x9af0('0x25')]=_0x3fd3f5[_0x9af0('0x25')];agents[_0x3fd3f5[_0x9af0('0x14')]]['lastevent']=_0x9af0('0x2f');writeDB(agents[_0x3fd3f5[_0x9af0('0x14')]]);}}catch(_0x4d6d2f){utils[_0x9af0('0x20')](_0x4d6d2f[_0x9af0('0x19')]);}};exports[_0x9af0('0x30')]=function(_0x6c4a11){try{if(!_[_0x9af0('0x1b')](agents[_0x6c4a11[_0x9af0('0x31')]])){agents[_0x6c4a11['transfereruniqueid']]['transfer']=!![];agents[_0x6c4a11[_0x9af0('0x31')]][_0x9af0('0x32')]=_0x9af0('0x33');agents[_0x6c4a11[_0x9af0('0x31')]][_0x9af0('0x34')]=_0x6c4a11[_0x9af0('0x35')];agents[_0x6c4a11[_0x9af0('0x31')]][_0x9af0('0x36')]=agents[_0x6c4a11[_0x9af0('0x31')]][_0x9af0('0x6')];}}catch(_0x50c21b){utils[_0x9af0('0x20')](_0x50c21b[_0x9af0('0x19')]);}};exports[_0x9af0('0x37')]=function(_0x27571c){try{if(_0x27571c[_0x9af0('0x38')]==_0x27571c[_0x9af0('0x39')]){if(!_[_0x9af0('0x1b')](agents[_0x27571c[_0x9af0('0x3a')]])){agents[_0x27571c['secondtransfereruniqueid']][_0x9af0('0x3b')]=!![];agents[_0x27571c[_0x9af0('0x3a')]]['transfertype']=_0x9af0('0x3c');agents[_0x27571c[_0x9af0('0x3a')]]['transferexten']=_0x27571c[_0x9af0('0x3d')];agents[_0x27571c[_0x9af0('0x3a')]][_0x9af0('0x36')]=_0x27571c['origtransfereruniqueid'];}if(_0x27571c[_0x9af0('0x3e')]&&agents[_0x27571c[_0x9af0('0x3e')]]){agents[_0x27571c['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x27571c[_0x9af0('0x3e')]]=_['clone'](agents[_0x27571c[_0x9af0('0x3e')]]);transfers[_0x27571c[_0x9af0('0x3e')]][_0x9af0('0x9')]=agents[_0x27571c[_0x9af0('0x3a')]][_0x9af0('0x9')];transfers[_0x27571c[_0x9af0('0x3e')]][_0x9af0('0x3f')]=agents[_0x27571c[_0x9af0('0x3a')]][_0x9af0('0x3f')];transfers[_0x27571c[_0x9af0('0x3e')]]['agentcalledAt']=utils[_0x9af0('0x16')]();transfers[_0x27571c[_0x9af0('0x3e')]][_0x9af0('0x2e')]=utils[_0x9af0('0x16')]();transfers[_0x27571c['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x27571c[_0x9af0('0x3e')]][_0x9af0('0x40')]=0x2;}}else if(_0x27571c[_0x9af0('0x3a')]==_0x27571c[_0x9af0('0x41')]){if(!_[_0x9af0('0x1b')](agents[_0x27571c[_0x9af0('0x38')]])){agents[_0x27571c['origtransfereruniqueid']][_0x9af0('0x3b')]=!![];agents[_0x27571c['origtransfereruniqueid']][_0x9af0('0x32')]='ATTENDED';agents[_0x27571c[_0x9af0('0x38')]]['transferexten']=_0x27571c[_0x9af0('0x42')];agents[_0x27571c[_0x9af0('0x38')]][_0x9af0('0x36')]=_0x27571c[_0x9af0('0x3a')];}if(_0x27571c['transfertargetuniqueid']&&agents[_0x27571c[_0x9af0('0x43')]]){agents[_0x27571c[_0x9af0('0x43')]][_0x9af0('0x40')]=0x1;transfers[_0x27571c[_0x9af0('0x43')]]=_[_0x9af0('0x44')](agents[_0x27571c[_0x9af0('0x43')]]);transfers[_0x27571c[_0x9af0('0x43')]][_0x9af0('0x9')]=agents[_0x27571c[_0x9af0('0x38')]][_0x9af0('0x9')];transfers[_0x27571c[_0x9af0('0x43')]][_0x9af0('0x3f')]=agents[_0x27571c[_0x9af0('0x38')]][_0x9af0('0x3f')];transfers[_0x27571c[_0x9af0('0x43')]][_0x9af0('0x15')]=utils[_0x9af0('0x16')]();transfers[_0x27571c[_0x9af0('0x43')]][_0x9af0('0x2e')]=utils['now']();transfers[_0x27571c[_0x9af0('0x43')]][_0x9af0('0x28')]=0x0;transfers[_0x27571c['transfertargetuniqueid']][_0x9af0('0x40')]=0x2;}}}catch(_0x270b1b){utils[_0x9af0('0x20')](_0x270b1b[_0x9af0('0x19')]);}};exports[_0x9af0('0x45')]=function(_0x3f62e6){try{if(agents[_0x3f62e6[_0x9af0('0x6')]]&&agents[_0x3f62e6[_0x9af0('0x6')]]['reason']==='timeout'){if(_0x3f62e6[_0x9af0('0x46')]==='21'){agents[_0x3f62e6[_0x9af0('0x6')]]['reason']=_0x9af0('0x47');agents[_0x3f62e6[_0x9af0('0x6')]][_0x9af0('0xb')]=_0x9af0('0x47');}writeDB(agents[_0x3f62e6['uniqueid']]);var _0x4b315b=unanswered[_0x9af0('0x48')](_0x3f62e6[_0x9af0('0x6')]);if(_0x4b315b>-0x1)unanswered['splice'](_0x4b315b,0x1);}if(transfers[_0x3f62e6[_0x9af0('0x6')]]){transfers[_0x3f62e6['uniqueid']]['agentcomplete']=!![];transfers[_0x3f62e6[_0x9af0('0x6')]][_0x9af0('0x2c')]=utils['now']();transfers[_0x3f62e6[_0x9af0('0x6')]]['talktime']=utils[_0x9af0('0x2d')](transfers[_0x3f62e6[_0x9af0('0x6')]][_0x9af0('0x2c')],transfers[_0x3f62e6[_0x9af0('0x6')]][_0x9af0('0x2e')]);transfers[_0x3f62e6[_0x9af0('0x6')]][_0x9af0('0x25')]=_0x9af0('0x49');transfers[_0x3f62e6['uniqueid']]['lastevent']=_0x9af0('0x2f');writeDB(transfers[_0x3f62e6[_0x9af0('0x6')]],!![]);}if(agents[_0x3f62e6[_0x9af0('0x6')]]&&agents[_0x3f62e6[_0x9af0('0x6')]][_0x9af0('0x2e')]){agents[_0x3f62e6[_0x9af0('0x6')]][_0x9af0('0x2b')]=!![];agents[_0x3f62e6['uniqueid']][_0x9af0('0x2c')]=utils[_0x9af0('0x16')]();agents[_0x3f62e6['uniqueid']][_0x9af0('0x1f')]=utils['diffTime'](agents[_0x3f62e6['uniqueid']]['agentcompleteAt'],agents[_0x3f62e6[_0x9af0('0x6')]][_0x9af0('0x2e')]);agents[_0x3f62e6[_0x9af0('0x6')]][_0x9af0('0x25')]=agents[_0x3f62e6[_0x9af0('0x6')]][_0x9af0('0x3b')]?_0x9af0('0x3b'):_0x9af0('0x49');agents[_0x3f62e6['uniqueid']]['lastevent']=_0x9af0('0x2f');writeDB(agents[_0x3f62e6[_0x9af0('0x6')]]);}}catch(_0x367518){utils[_0x9af0('0x20')](_0x367518[_0x9af0('0x19')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 5d0c281..2288bbe 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 _0x6efb=['answertime','error','hangup','calleridname','endtime','duration','diffTime','starttime','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','musiconholdstop','musiconholdstartAt','mohtime','variable','source','value','xmd-queue','xmcs-queue','ContactId','outboundrouteid','routeid','sipcallid','newexten','toLowerCase','set','startsWith','appdata','cdr','lastIndexOf','includes','noop','execif','gotoif','application','lastapplication','lastdata','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','channel','type','accountcode','destination','callerid','disposition','then','UserId','CreateVoiceCallReport','request','uniqueid','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','now','stack','newstate','isNil','channelstate','systemanswertime','destinationchannel'];(function(_0x5681ff,_0x5aafcd){var _0x5bd210=function(_0x4a8595){while(--_0x4a8595){_0x5681ff['push'](_0x5681ff['shift']());}};_0x5bd210(++_0x5aafcd);}(_0x6efb,0xc1));var _0xb6ef=function(_0x192a74,_0x4bb7cd){_0x192a74=_0x192a74-0x0;var _0x54f523=_0x6efb[_0x192a74];return _0x54f523;};'use strict';var _=require('lodash');var util=require(_0xb6ef('0x0'));var utils=require(_0xb6ef('0x1'));var dispositions=['NO\x20ANSWER',_0xb6ef('0x2'),'FAILED',_0xb6ef('0x3'),_0xb6ef('0x3'),_0xb6ef('0x3'),_0xb6ef('0x4'),_0xb6ef('0x5'),'FAILED',_0xb6ef('0x2'),'FAILED'];var channels={};function writeDB(_0x7b667e){utils[_0xb6ef('0x6')](util[_0xb6ef('0x7')](_0xb6ef('0x8'),_0x7b667e['uniqueid'],_0x7b667e[_0xb6ef('0x9')],_0x7b667e[_0xb6ef('0xa')],_0x7b667e[_0xb6ef('0xb')],_0x7b667e['source'],_0x7b667e[_0xb6ef('0xc')],_0x7b667e[_0xb6ef('0xd')],_0x7b667e[_0xb6ef('0xe')]));if(_0x7b667e[_0xb6ef('0xb')]){utils['getUserByInternal'](_0x7b667e['accountcode'])[_0xb6ef('0xf')](function(_0x36830a){if(_0x36830a){_0x7b667e[_0xb6ef('0x10')]=_0x36830a['id'];}utils['request'](_0xb6ef('0x11'),_0x7b667e);});}else{utils[_0xb6ef('0x12')](_0xb6ef('0x11'),_0x7b667e);}if(channels[_0x7b667e['uniqueid']]){delete channels[_0x7b667e[_0xb6ef('0x13')]];}}exports[_0xb6ef('0x14')]=function(_0x5db0c8){try{if(_0x5db0c8['uniqueid']==_0x5db0c8[_0xb6ef('0x15')]&&_0x5db0c8['channel']!=_0xb6ef('0x16')){channels[_0x5db0c8[_0xb6ef('0x13')]]={'uniqueid':_0x5db0c8[_0xb6ef('0x13')],'accountcode':_0x5db0c8['accountcode'],'source':_0x5db0c8[_0xb6ef('0x17')],'destination':_0x5db0c8[_0xb6ef('0x18')],'destinationcontext':_0x5db0c8['context'],'channel':_0x5db0c8['channel'],'starttime':utils[_0xb6ef('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xb6ef('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x81c0){utils['error'](_0x81c0[_0xb6ef('0x1a')]);}};exports[_0xb6ef('0x1b')]=function(_0x17fdde){try{if(!_[_0xb6ef('0x1c')](channels[_0x17fdde[_0xb6ef('0x13')]])&&_0x17fdde[_0xb6ef('0x1d')]==0x6){if(_[_0xb6ef('0x1c')](channels[_0x17fdde[_0xb6ef('0x13')]][_0xb6ef('0x1e')])){channels[_0x17fdde['uniqueid']][_0xb6ef('0x1e')]=utils[_0xb6ef('0x19')]();}}else if(!_[_0xb6ef('0x1c')](channels[_0x17fdde[_0xb6ef('0x15')]])&&_0x17fdde[_0xb6ef('0x1d')]==0x6&&_0x17fdde['context']!='transfer'){channels[_0x17fdde[_0xb6ef('0x15')]][_0xb6ef('0xb')]=_0x17fdde['accountcode'];channels[_0x17fdde[_0xb6ef('0x15')]][_0xb6ef('0x1f')]=_0x17fdde['channel'];if(_['isNil'](channels[_0x17fdde[_0xb6ef('0x15')]][_0xb6ef('0x20')])){channels[_0x17fdde[_0xb6ef('0x15')]][_0xb6ef('0x20')]=utils[_0xb6ef('0x19')]();}channels[_0x17fdde[_0xb6ef('0x15')]][_0xb6ef('0xe')]=dispositions[_['toNumber'](_0x17fdde[_0xb6ef('0x1d')])]||_0xb6ef('0x4');}}catch(_0x119416){utils[_0xb6ef('0x21')](_0x119416[_0xb6ef('0x1a')]);}};exports[_0xb6ef('0x22')]=function(_0x3f14ed){try{if(!_['isNil'](channels[_0x3f14ed[_0xb6ef('0x13')]])){if(_[_0xb6ef('0x1c')](channels[_0x3f14ed[_0xb6ef('0x13')]]['callerid'])){channels[_0x3f14ed[_0xb6ef('0x13')]][_0xb6ef('0xd')]=_0x3f14ed[_0xb6ef('0x23')]+'\x20<'+_0x3f14ed['calleridnum']+'>';}channels[_0x3f14ed[_0xb6ef('0x13')]][_0xb6ef('0x24')]=utils[_0xb6ef('0x19')]();channels[_0x3f14ed[_0xb6ef('0x13')]][_0xb6ef('0x25')]=utils[_0xb6ef('0x26')](channels[_0x3f14ed[_0xb6ef('0x13')]][_0xb6ef('0x24')],channels[_0x3f14ed[_0xb6ef('0x13')]][_0xb6ef('0x27')]);channels[_0x3f14ed[_0xb6ef('0x13')]]['billableseconds']=channels[_0x3f14ed[_0xb6ef('0x13')]][_0xb6ef('0x20')]?utils[_0xb6ef('0x26')](channels[_0x3f14ed[_0xb6ef('0x13')]][_0xb6ef('0x24')],channels[_0x3f14ed[_0xb6ef('0x13')]][_0xb6ef('0x20')]):0x0;writeDB(channels[_0x3f14ed['uniqueid']]);}}catch(_0x1f39bf){utils[_0xb6ef('0x21')](_0x1f39bf['stack']);}};exports[_0xb6ef('0x28')]=function(_0x5083dd){try{if(!_[_0xb6ef('0x1c')](channels[_0x5083dd[_0xb6ef('0x29')]])){if(channels[_0x5083dd[_0xb6ef('0x29')]][_0xb6ef('0x9')]==_0x5083dd[_0xb6ef('0x2a')]){channels[_0x5083dd['localtwolinkedid']][_0xb6ef('0x1f')]=_0x5083dd[_0xb6ef('0x2b')];channels[_0x5083dd['localtwolinkedid']][_0xb6ef('0x2c')]=_0xb6ef('0x2d');}else if(channels[_0x5083dd[_0xb6ef('0x29')]]['channel']=_0x5083dd[_0xb6ef('0x2e')]){channels[_0x5083dd[_0xb6ef('0x29')]][_0xb6ef('0x1f')]=_0x5083dd[_0xb6ef('0x2f')];channels[_0x5083dd[_0xb6ef('0x29')]][_0xb6ef('0x2c')]=_0xb6ef('0x2d');}}}catch(_0x1ff626){utils[_0xb6ef('0x21')](_0x1ff626['stack']);}};exports[_0xb6ef('0x30')]=function(_0x218563){try{if(!_[_0xb6ef('0x1c')](channels[_0x218563[_0xb6ef('0x13')]])){channels[_0x218563[_0xb6ef('0x13')]]['musiconholdstartAt']=utils['now']();}}catch(_0x423be3){utils['error'](_0x423be3[_0xb6ef('0x1a')]);}};exports[_0xb6ef('0x31')]=function(_0x4fbc2a){try{if(!_[_0xb6ef('0x1c')](channels[_0x4fbc2a[_0xb6ef('0x13')]])){if(!_[_0xb6ef('0x1c')](channels[_0x4fbc2a[_0xb6ef('0x13')]][_0xb6ef('0x32')])){channels[_0x4fbc2a['uniqueid']][_0xb6ef('0x33')]+=utils[_0xb6ef('0x26')](utils['now'](),channels[_0x4fbc2a['uniqueid']][_0xb6ef('0x32')]);delete channels[_0x4fbc2a[_0xb6ef('0x13')]][_0xb6ef('0x32')];}}}catch(_0x4b21d3){utils['error'](_0x4b21d3['stack']);}};exports['varset']=function(_0x219207){try{if(!_[_0xb6ef('0x1c')](channels[_0x219207[_0xb6ef('0x13')]])){if(!_[_0xb6ef('0x1c')](_0x219207[_0xb6ef('0x34')]['xmd-originatecalleridnum'])){channels[_0x219207[_0xb6ef('0x13')]][_0xb6ef('0x35')]=_0x219207[_0xb6ef('0x36')];}if(!_[_0xb6ef('0x1c')](_0x219207[_0xb6ef('0x34')]['xmd-phone'])){channels[_0x219207['uniqueid']][_0xb6ef('0xc')]=_0x219207['value'];channels[_0x219207['uniqueid']]['callerid']='\x22'+_0x219207[_0xb6ef('0x36')]+'\x22\x20<'+_0x219207[_0xb6ef('0x36')]+'>';}if(!_[_0xb6ef('0x1c')](_0x219207['variable']['xmd-callerid-preview'])||!_[_0xb6ef('0x1c')](_0x219207['variable']['xmd-callerid'])){channels[_0x219207[_0xb6ef('0x13')]]['callerid']=_0x219207[_0xb6ef('0x36')];}if(!_['isNil'](_0x219207['variable'][_0xb6ef('0x37')])||!_[_0xb6ef('0x1c')](_0x219207[_0xb6ef('0x34')][_0xb6ef('0x38')])){channels[_0x219207[_0xb6ef('0x13')]]['lastapplication']='Queue';channels[_0x219207[_0xb6ef('0x13')]]['lastdata']=_0x219207[_0xb6ef('0x36')];channels[_0x219207[_0xb6ef('0x13')]]['queue']=!![];}if(!_[_0xb6ef('0x1c')](_0x219207[_0xb6ef('0x34')]['xmd-contactid'])){channels[_0x219207[_0xb6ef('0x13')]][_0xb6ef('0x39')]=_0x219207[_0xb6ef('0x36')];}if(!_[_0xb6ef('0x1c')](_0x219207[_0xb6ef('0x34')]['xmd-cdrtype'])){channels[_0x219207[_0xb6ef('0x13')]][_0xb6ef('0xa')]=_0x219207['value'];}if(!_[_0xb6ef('0x1c')](_0x219207[_0xb6ef('0x34')][_0xb6ef('0x3a')])){channels[_0x219207[_0xb6ef('0x13')]][_0xb6ef('0x3b')]=_0x219207[_0xb6ef('0x36')];}if(!_[_0xb6ef('0x1c')](_0x219207['variable'][_0xb6ef('0x3c')])){channels[_0x219207['uniqueid']][_0xb6ef('0x3c')]=_0x219207[_0xb6ef('0x36')];}}}catch(_0xbb2139){utils[_0xb6ef('0x21')](_0xbb2139[_0xb6ef('0x1a')]);}};exports[_0xb6ef('0x3d')]=function(_0x4a85f7){try{if(!_[_0xb6ef('0x1c')](channels[_0x4a85f7['uniqueid']])){if(_0x4a85f7['application'][_0xb6ef('0x3e')]()==_0xb6ef('0x3f')&&_[_0xb6ef('0x40')](_0x4a85f7[_0xb6ef('0x41')][_0xb6ef('0x3e')](),_0xb6ef('0x42'))){var _0x377cb8=_0x4a85f7[_0xb6ef('0x41')]['split']('=');var _0x458cea=_0x377cb8[0x0]['substring'](_0x377cb8[0x0][_0xb6ef('0x43')]('(')+0x1,_0x377cb8[0x0][_0xb6ef('0x43')](')'));var _0x5da3a4=_0x377cb8[0x1];channels[_0x4a85f7[_0xb6ef('0x13')]][_0x458cea]=_0x5da3a4;}if(!_[_0xb6ef('0x44')]([_0xb6ef('0x22'),_0xb6ef('0x45'),_0xb6ef('0x46'),_0xb6ef('0x3f'),_0xb6ef('0x47')],_0x4a85f7[_0xb6ef('0x48')]['toLowerCase']())){channels[_0x4a85f7[_0xb6ef('0x13')]][_0xb6ef('0x49')]=_0x4a85f7[_0xb6ef('0x48')];channels[_0x4a85f7[_0xb6ef('0x13')]][_0xb6ef('0x4a')]=_0x4a85f7[_0xb6ef('0x41')];}}}catch(_0x1fcacd){utils['error'](_0x1fcacd['stack']);}}; \ No newline at end of file +var _0xa90a=['appdata','substring','lastIndexOf','includes','noop','execif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','type','accountcode','source','destination','callerid','disposition','getUserByInternal','then','CreateVoiceCallReport','request','newchannel','linkedid','OutgoingSpoolFailed','error','newstate','isNil','channelstate','systemanswertime','now','context','destinationchannel','answertime','toNumber','stack','calleridname','calleridnum','endtime','duration','diffTime','billableseconds','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','transfertargetchannel','origtransfererchannel','userfield','_attended','musiconholdstart','musiconholdstartAt','musiconholdstop','varset','variable','xmd-originatecalleridnum','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','lastapplication','Queue','lastdata','queue','ContactId','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','cdr'];(function(_0x392b96,_0x36c5aa){var _0x1a15f6=function(_0x581e1e){while(--_0x581e1e){_0x392b96['push'](_0x392b96['shift']());}};_0x1a15f6(++_0x36c5aa);}(_0xa90a,0x1ec));var _0xaa90=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0xa90a[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0xaa90('0x0'));var util=require(_0xaa90('0x1'));var utils=require(_0xaa90('0x2'));var dispositions=[_0xaa90('0x3'),_0xaa90('0x4'),_0xaa90('0x4'),_0xaa90('0x3'),_0xaa90('0x3'),_0xaa90('0x3'),_0xaa90('0x5'),_0xaa90('0x6'),'FAILED',_0xaa90('0x4'),_0xaa90('0x4')];var channels={};function writeDB(_0x23f15e){utils[_0xaa90('0x7')](util[_0xaa90('0x8')](_0xaa90('0x9'),_0x23f15e[_0xaa90('0xa')],_0x23f15e[_0xaa90('0xb')],_0x23f15e[_0xaa90('0xc')],_0x23f15e[_0xaa90('0xd')],_0x23f15e[_0xaa90('0xe')],_0x23f15e[_0xaa90('0xf')],_0x23f15e[_0xaa90('0x10')],_0x23f15e[_0xaa90('0x11')]));if(_0x23f15e[_0xaa90('0xd')]){utils[_0xaa90('0x12')](_0x23f15e[_0xaa90('0xd')])[_0xaa90('0x13')](function(_0x1f22b6){if(_0x1f22b6){_0x23f15e['UserId']=_0x1f22b6['id'];}utils['request'](_0xaa90('0x14'),_0x23f15e);});}else{utils[_0xaa90('0x15')](_0xaa90('0x14'),_0x23f15e);}if(channels[_0x23f15e['uniqueid']]){delete channels[_0x23f15e[_0xaa90('0xa')]];}}exports[_0xaa90('0x16')]=function(_0x4ec56a){try{if(_0x4ec56a['uniqueid']==_0x4ec56a[_0xaa90('0x17')]&&_0x4ec56a[_0xaa90('0xb')]!=_0xaa90('0x18')){channels[_0x4ec56a[_0xaa90('0xa')]]={'uniqueid':_0x4ec56a[_0xaa90('0xa')],'accountcode':_0x4ec56a[_0xaa90('0xd')],'source':_0x4ec56a['calleridnum'],'destination':_0x4ec56a['exten'],'destinationcontext':_0x4ec56a['context'],'channel':_0x4ec56a['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xaa90('0x3'),'amaflags':'DOCUMENTATION'};}}catch(_0x367bfa){utils[_0xaa90('0x19')](_0x367bfa['stack']);}};exports[_0xaa90('0x1a')]=function(_0x87ca31){try{if(!_[_0xaa90('0x1b')](channels[_0x87ca31[_0xaa90('0xa')]])&&_0x87ca31[_0xaa90('0x1c')]==0x6){if(_[_0xaa90('0x1b')](channels[_0x87ca31[_0xaa90('0xa')]][_0xaa90('0x1d')])){channels[_0x87ca31['uniqueid']][_0xaa90('0x1d')]=utils[_0xaa90('0x1e')]();}}else if(!_[_0xaa90('0x1b')](channels[_0x87ca31['linkedid']])&&_0x87ca31[_0xaa90('0x1c')]==0x6&&_0x87ca31[_0xaa90('0x1f')]!='transfer'){channels[_0x87ca31['linkedid']]['accountcode']=_0x87ca31[_0xaa90('0xd')];channels[_0x87ca31['linkedid']][_0xaa90('0x20')]=_0x87ca31[_0xaa90('0xb')];if(_[_0xaa90('0x1b')](channels[_0x87ca31[_0xaa90('0x17')]][_0xaa90('0x21')])){channels[_0x87ca31[_0xaa90('0x17')]][_0xaa90('0x21')]=utils['now']();}channels[_0x87ca31[_0xaa90('0x17')]][_0xaa90('0x11')]=dispositions[_[_0xaa90('0x22')](_0x87ca31['channelstate'])]||'ANSWERED';}}catch(_0xd07ab5){utils[_0xaa90('0x19')](_0xd07ab5[_0xaa90('0x23')]);}};exports['hangup']=function(_0x5b90e8){try{if(!_['isNil'](channels[_0x5b90e8[_0xaa90('0xa')]])){if(_[_0xaa90('0x1b')](channels[_0x5b90e8[_0xaa90('0xa')]][_0xaa90('0x10')])){channels[_0x5b90e8[_0xaa90('0xa')]][_0xaa90('0x10')]=_0x5b90e8[_0xaa90('0x24')]+'\x20<'+_0x5b90e8[_0xaa90('0x25')]+'>';}channels[_0x5b90e8[_0xaa90('0xa')]][_0xaa90('0x26')]=utils['now']();channels[_0x5b90e8[_0xaa90('0xa')]][_0xaa90('0x27')]=utils[_0xaa90('0x28')](channels[_0x5b90e8[_0xaa90('0xa')]]['endtime'],channels[_0x5b90e8['uniqueid']]['starttime']);channels[_0x5b90e8['uniqueid']][_0xaa90('0x29')]=channels[_0x5b90e8['uniqueid']]['answertime']?utils[_0xaa90('0x28')](channels[_0x5b90e8['uniqueid']][_0xaa90('0x26')],channels[_0x5b90e8[_0xaa90('0xa')]]['answertime']):0x0;writeDB(channels[_0x5b90e8[_0xaa90('0xa')]]);}}catch(_0x2a4ba7){utils[_0xaa90('0x19')](_0x2a4ba7[_0xaa90('0x23')]);}};exports[_0xaa90('0x2a')]=function(_0x3c8c75){try{if(!_[_0xaa90('0x1b')](channels[_0x3c8c75[_0xaa90('0x2b')]])){if(channels[_0x3c8c75['localtwolinkedid']][_0xaa90('0xb')]==_0x3c8c75[_0xaa90('0x2c')]){channels[_0x3c8c75[_0xaa90('0x2b')]][_0xaa90('0x20')]=_0x3c8c75[_0xaa90('0x2d')];channels[_0x3c8c75[_0xaa90('0x2b')]]['userfield']='_attended';}else if(channels[_0x3c8c75[_0xaa90('0x2b')]]['channel']=_0x3c8c75[_0xaa90('0x2e')]){channels[_0x3c8c75['localtwolinkedid']][_0xaa90('0x20')]=_0x3c8c75[_0xaa90('0x2f')];channels[_0x3c8c75[_0xaa90('0x2b')]][_0xaa90('0x30')]=_0xaa90('0x31');}}}catch(_0x168907){utils[_0xaa90('0x19')](_0x168907['stack']);}};exports[_0xaa90('0x32')]=function(_0xaf8109){try{if(!_['isNil'](channels[_0xaf8109[_0xaa90('0xa')]])){channels[_0xaf8109['uniqueid']][_0xaa90('0x33')]=utils['now']();}}catch(_0x52f470){utils[_0xaa90('0x19')](_0x52f470[_0xaa90('0x23')]);}};exports[_0xaa90('0x34')]=function(_0x672298){try{if(!_[_0xaa90('0x1b')](channels[_0x672298[_0xaa90('0xa')]])){if(!_[_0xaa90('0x1b')](channels[_0x672298['uniqueid']][_0xaa90('0x33')])){channels[_0x672298[_0xaa90('0xa')]]['mohtime']+=utils[_0xaa90('0x28')](utils[_0xaa90('0x1e')](),channels[_0x672298[_0xaa90('0xa')]]['musiconholdstartAt']);delete channels[_0x672298[_0xaa90('0xa')]][_0xaa90('0x33')];}}}catch(_0x1b7946){utils[_0xaa90('0x19')](_0x1b7946[_0xaa90('0x23')]);}};exports[_0xaa90('0x35')]=function(_0x51c8d4){try{if(!_[_0xaa90('0x1b')](channels[_0x51c8d4[_0xaa90('0xa')]])){if(!_[_0xaa90('0x1b')](_0x51c8d4[_0xaa90('0x36')][_0xaa90('0x37')])){channels[_0x51c8d4[_0xaa90('0xa')]]['source']=_0x51c8d4[_0xaa90('0x38')];}if(!_[_0xaa90('0x1b')](_0x51c8d4['variable'][_0xaa90('0x39')])){channels[_0x51c8d4[_0xaa90('0xa')]][_0xaa90('0xf')]=_0x51c8d4[_0xaa90('0x38')];channels[_0x51c8d4[_0xaa90('0xa')]][_0xaa90('0x10')]='\x22'+_0x51c8d4[_0xaa90('0x38')]+_0xaa90('0x3a')+_0x51c8d4['value']+'>';}if(!_[_0xaa90('0x1b')](_0x51c8d4[_0xaa90('0x36')][_0xaa90('0x3b')])||!_['isNil'](_0x51c8d4[_0xaa90('0x36')][_0xaa90('0x3c')])){channels[_0x51c8d4[_0xaa90('0xa')]]['callerid']=_0x51c8d4[_0xaa90('0x38')];}if(!_[_0xaa90('0x1b')](_0x51c8d4['variable']['xmd-queue'])||!_[_0xaa90('0x1b')](_0x51c8d4[_0xaa90('0x36')]['xmcs-queue'])){channels[_0x51c8d4['uniqueid']][_0xaa90('0x3d')]=_0xaa90('0x3e');channels[_0x51c8d4[_0xaa90('0xa')]][_0xaa90('0x3f')]=_0x51c8d4[_0xaa90('0x38')];channels[_0x51c8d4[_0xaa90('0xa')]][_0xaa90('0x40')]=!![];}if(!_[_0xaa90('0x1b')](_0x51c8d4[_0xaa90('0x36')]['xmd-contactid'])){channels[_0x51c8d4[_0xaa90('0xa')]][_0xaa90('0x41')]=_0x51c8d4['value'];}if(!_['isNil'](_0x51c8d4['variable'][_0xaa90('0x42')])){channels[_0x51c8d4[_0xaa90('0xa')]][_0xaa90('0xc')]=_0x51c8d4[_0xaa90('0x38')];}if(!_['isNil'](_0x51c8d4[_0xaa90('0x36')][_0xaa90('0x43')])){channels[_0x51c8d4['uniqueid']][_0xaa90('0x44')]=_0x51c8d4[_0xaa90('0x38')];}if(!_[_0xaa90('0x1b')](_0x51c8d4['variable'][_0xaa90('0x45')])){channels[_0x51c8d4[_0xaa90('0xa')]][_0xaa90('0x45')]=_0x51c8d4[_0xaa90('0x38')];}}}catch(_0x332f1f){utils[_0xaa90('0x19')](_0x332f1f[_0xaa90('0x23')]);}};exports[_0xaa90('0x46')]=function(_0x5c1ec6){try{if(!_[_0xaa90('0x1b')](channels[_0x5c1ec6['uniqueid']])){if(_0x5c1ec6[_0xaa90('0x47')][_0xaa90('0x48')]()==_0xaa90('0x49')&&_['startsWith'](_0x5c1ec6['appdata'][_0xaa90('0x48')](),_0xaa90('0x4a'))){var _0xc32de8=_0x5c1ec6[_0xaa90('0x4b')]['split']('=');var _0x1294fd=_0xc32de8[0x0][_0xaa90('0x4c')](_0xc32de8[0x0][_0xaa90('0x4d')]('(')+0x1,_0xc32de8[0x0][_0xaa90('0x4d')](')'));var _0x38acb4=_0xc32de8[0x1];channels[_0x5c1ec6[_0xaa90('0xa')]][_0x1294fd]=_0x38acb4;}if(!_[_0xaa90('0x4e')](['hangup',_0xaa90('0x4f'),_0xaa90('0x50'),_0xaa90('0x49'),'gotoif'],_0x5c1ec6['application']['toLowerCase']())){channels[_0x5c1ec6[_0xaa90('0xa')]][_0xaa90('0x3d')]=_0x5c1ec6[_0xaa90('0x47')];channels[_0x5c1ec6['uniqueid']][_0xaa90('0x3f')]=_0x5c1ec6[_0xaa90('0x4b')];}}}catch(_0x287426){utils[_0xaa90('0x19')](_0x287426[_0xaa90('0x23')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index ce5f74e..65529ed 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 _0x277c=['connect','info','CONNECTED','shutdown','SHUTDOWN','fullybooted','close','CLOSE','managerevent','./utils'];(function(_0x1e58fe,_0x3665ed){var _0x1521ea=function(_0x221835){while(--_0x221835){_0x1e58fe['push'](_0x1e58fe['shift']());}};_0x1521ea(++_0x3665ed);}(_0x277c,0x153));var _0xc277=function(_0x39f07b,_0x4b4507){_0x39f07b=_0x39f07b-0x0;var _0x16a675=_0x277c[_0x39f07b];return _0x16a675;};'use strict';var utils=require(_0xc277('0x0'));var _=require('lodash');exports[_0xc277('0x1')]=function(){utils[_0xc277('0x2')](_0xc277('0x3'));};exports[_0xc277('0x4')]=function(){utils[_0xc277('0x2')](_0xc277('0x5'));};exports[_0xc277('0x6')]=function(){utils[_0xc277('0x2')]('FULLYBOOTED');};exports['error']=function(_0x1a6582){utils['error'](_0x1a6582);};exports[_0xc277('0x7')]=function(){utils['info'](_0xc277('0x8'));};exports[_0xc277('0x9')]=function(_0x55be1f){}; \ No newline at end of file +var _0xe0ae=['info','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','connect'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0xe0ae,0xa1));var _0xee0a=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0xe0ae[_0x40f9a0];return _0x3e3144;};'use strict';var utils=require('./utils');var _=require('lodash');exports[_0xee0a('0x0')]=function(){utils[_0xee0a('0x1')]('CONNECTED');};exports[_0xee0a('0x2')]=function(){utils['info'](_0xee0a('0x3'));};exports[_0xee0a('0x4')]=function(){utils['info'](_0xee0a('0x5'));};exports['error']=function(_0x5bef07){utils[_0xee0a('0x6')](_0x5bef07);};exports[_0xee0a('0x7')]=function(){utils[_0xee0a('0x1')](_0xee0a('0x8'));};exports['managerevent']=function(_0x2296b9){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 4e73dab..7870346 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 _0xb921=['value','error','dialbegin','starttime','lastevent','called','dialend','ANSWER','assign','now','connect','hangup','complete','duration','diffTime','endtime','answertime','billableseconds','lodash','util','./utils','info','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','application','toLowerCase','set','startsWith','cdr(routeid)','appdata','split','stack','varset','isNil','variable','outboundrouteid'];(function(_0x4b45bc,_0x2193ca){var _0x11d660=function(_0x2d3500){while(--_0x2d3500){_0x4b45bc['push'](_0x4b45bc['shift']());}};_0x11d660(++_0x2193ca);}(_0xb921,0x16a));var _0x1b92=function(_0x526302,_0x450200){_0x526302=_0x526302-0x0;var _0xd505be=_0xb921[_0x526302];return _0xd505be;};'use strict';var _=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var utils=require(_0x1b92('0x2'));var dials={};function writeDB(_0x4f6699){utils[_0x1b92('0x3')](util['format']('DIAL|%s|%s|%s|%s|%s|%s',_0x4f6699[_0x1b92('0x4')],_0x4f6699[_0x1b92('0x5')],_0x4f6699[_0x1b92('0x6')],_0x4f6699[_0x1b92('0x7')],_0x4f6699[_0x1b92('0x8')],_0x4f6699[_0x1b92('0x9')]));utils[_0x1b92('0xa')](_0x1b92('0xb'),_0x4f6699);delete dials[_0x4f6699[_0x1b92('0x4')]];}exports[_0x1b92('0xc')]=function(_0x1545f9){try{if(_0x1545f9[_0x1b92('0xd')][_0x1b92('0xe')]()==_0x1b92('0xf')&&_[_0x1b92('0x10')](_0x1545f9['appdata'][_0x1b92('0xe')](),_0x1b92('0x11'))){var _0x154b6d=_0x1545f9[_0x1b92('0x12')][_0x1b92('0x13')]('=');dials[_0x1545f9[_0x1b92('0x4')]]={'routeId':_0x154b6d[0x1]};}}catch(_0x3deaf4){utils['error'](_0x3deaf4[_0x1b92('0x14')]);}};exports[_0x1b92('0x15')]=function(_0x5a1ca5){try{if(!_[_0x1b92('0x16')](_0x5a1ca5[_0x1b92('0x17')][_0x1b92('0x18')])){dials[_0x5a1ca5[_0x1b92('0x4')]]={'routeId':_0x5a1ca5[_0x1b92('0x19')]};}}catch(_0x290be6){utils[_0x1b92('0x1a')](_0x290be6['stack']);}};exports[_0x1b92('0x1b')]=function(_0x5c5c89){try{if(!_[_0x1b92('0x16')](dials[_0x5c5c89['uniqueid']])){dials[_0x5c5c89[_0x1b92('0x4')]]=_['assign'](dials[_0x5c5c89[_0x1b92('0x4')]],_0x5c5c89);dials[_0x5c5c89[_0x1b92('0x4')]][_0x1b92('0x1c')]=utils['now']();dials[_0x5c5c89[_0x1b92('0x4')]][_0x1b92('0x1d')]=_0x1b92('0x1e');}}catch(_0xf62817){utils[_0x1b92('0x1a')](_0xf62817['stack']);}};exports[_0x1b92('0x1f')]=function(_0x22913c){try{if(!_[_0x1b92('0x16')](dials[_0x22913c['uniqueid']])){dials[_0x22913c[_0x1b92('0x4')]][_0x1b92('0x9')]=_0x22913c[_0x1b92('0x9')];if(_0x22913c['dialstatus']==_0x1b92('0x20')){dials[_0x22913c['uniqueid']]=_[_0x1b92('0x21')](dials[_0x22913c[_0x1b92('0x4')]],_0x22913c);dials[_0x22913c['uniqueid']]['answertime']=utils[_0x1b92('0x22')]();dials[_0x22913c[_0x1b92('0x4')]][_0x1b92('0x1d')]=_0x1b92('0x23');}}}catch(_0x41fc82){utils[_0x1b92('0x1a')](_0x41fc82['stack']);}};exports[_0x1b92('0x24')]=function(_0x1dcdd5){try{if(!_[_0x1b92('0x16')](dials[_0x1dcdd5[_0x1b92('0x4')]])){dials[_0x1dcdd5['uniqueid']]=_[_0x1b92('0x21')](dials[_0x1dcdd5['uniqueid']],{'endtime':utils[_0x1b92('0x22')](),'lastevent':_0x1b92('0x25')});dials[_0x1dcdd5[_0x1b92('0x4')]][_0x1b92('0x26')]=utils[_0x1b92('0x27')](dials[_0x1dcdd5[_0x1b92('0x4')]][_0x1b92('0x28')],dials[_0x1dcdd5[_0x1b92('0x4')]]['starttime']);dials[_0x1dcdd5['uniqueid']]['holdtime']=utils[_0x1b92('0x27')](dials[_0x1dcdd5['uniqueid']][_0x1b92('0x29')]||dials[_0x1dcdd5['uniqueid']][_0x1b92('0x28')],dials[_0x1dcdd5[_0x1b92('0x4')]][_0x1b92('0x1c')]);dials[_0x1dcdd5['uniqueid']][_0x1b92('0x2a')]=dials[_0x1dcdd5[_0x1b92('0x4')]]['answertime']?utils['diffTime'](dials[_0x1dcdd5[_0x1b92('0x4')]][_0x1b92('0x28')],dials[_0x1dcdd5[_0x1b92('0x4')]][_0x1b92('0x29')]):0x0;writeDB(dials[_0x1dcdd5[_0x1b92('0x4')]]);}}catch(_0x50eddf){utils[_0x1b92('0x1a')](_0x50eddf[_0x1b92('0x14')]);}}; \ No newline at end of file +var _0xcd31=['newexten','application','set','startsWith','appdata','toLowerCase','cdr(routeid)','error','stack','variable','outboundrouteid','dialbegin','isNil','assign','called','dialend','ANSWER','answertime','now','lastevent','duration','diffTime','starttime','holdtime','endtime','util','./utils','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring','calleridnum','dialstatus','request','CreateVoiceDialReport'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xcd31,0x15d));var _0x1cd3=function(_0x1a122a,_0x497470){_0x1a122a=_0x1a122a-0x0;var _0x5d8b35=_0xcd31[_0x1a122a];return _0x5d8b35;};'use strict';var _=require('lodash');var util=require(_0x1cd3('0x0'));var utils=require(_0x1cd3('0x1'));var dials={};function writeDB(_0x22d5b8){utils['info'](util[_0x1cd3('0x2')](_0x1cd3('0x3'),_0x22d5b8[_0x1cd3('0x4')],_0x22d5b8[_0x1cd3('0x5')],_0x22d5b8[_0x1cd3('0x6')],_0x22d5b8[_0x1cd3('0x7')],_0x22d5b8['connectedlinenum'],_0x22d5b8[_0x1cd3('0x8')]));utils[_0x1cd3('0x9')](_0x1cd3('0xa'),_0x22d5b8);delete dials[_0x22d5b8['uniqueid']];}exports[_0x1cd3('0xb')]=function(_0x11b139){try{if(_0x11b139[_0x1cd3('0xc')]['toLowerCase']()==_0x1cd3('0xd')&&_[_0x1cd3('0xe')](_0x11b139[_0x1cd3('0xf')][_0x1cd3('0x10')](),_0x1cd3('0x11'))){var _0x3eb8af=_0x11b139[_0x1cd3('0xf')]['split']('=');dials[_0x11b139[_0x1cd3('0x4')]]={'routeId':_0x3eb8af[0x1]};}}catch(_0x31861f){utils[_0x1cd3('0x12')](_0x31861f[_0x1cd3('0x13')]);}};exports['varset']=function(_0xfe288e){try{if(!_['isNil'](_0xfe288e[_0x1cd3('0x14')][_0x1cd3('0x15')])){dials[_0xfe288e[_0x1cd3('0x4')]]={'routeId':_0xfe288e['value']};}}catch(_0x5b885f){utils[_0x1cd3('0x12')](_0x5b885f[_0x1cd3('0x13')]);}};exports[_0x1cd3('0x16')]=function(_0x569c98){try{if(!_[_0x1cd3('0x17')](dials[_0x569c98[_0x1cd3('0x4')]])){dials[_0x569c98[_0x1cd3('0x4')]]=_[_0x1cd3('0x18')](dials[_0x569c98['uniqueid']],_0x569c98);dials[_0x569c98['uniqueid']]['starttime']=utils['now']();dials[_0x569c98['uniqueid']]['lastevent']=_0x1cd3('0x19');}}catch(_0x40a85e){utils[_0x1cd3('0x12')](_0x40a85e[_0x1cd3('0x13')]);}};exports[_0x1cd3('0x1a')]=function(_0x4426c4){try{if(!_[_0x1cd3('0x17')](dials[_0x4426c4[_0x1cd3('0x4')]])){dials[_0x4426c4[_0x1cd3('0x4')]][_0x1cd3('0x8')]=_0x4426c4['dialstatus'];if(_0x4426c4[_0x1cd3('0x8')]==_0x1cd3('0x1b')){dials[_0x4426c4['uniqueid']]=_[_0x1cd3('0x18')](dials[_0x4426c4[_0x1cd3('0x4')]],_0x4426c4);dials[_0x4426c4['uniqueid']][_0x1cd3('0x1c')]=utils[_0x1cd3('0x1d')]();dials[_0x4426c4[_0x1cd3('0x4')]][_0x1cd3('0x1e')]='connect';}}}catch(_0x4f6920){utils[_0x1cd3('0x12')](_0x4f6920[_0x1cd3('0x13')]);}};exports['hangup']=function(_0x578cab){try{if(!_[_0x1cd3('0x17')](dials[_0x578cab[_0x1cd3('0x4')]])){dials[_0x578cab['uniqueid']]=_['assign'](dials[_0x578cab[_0x1cd3('0x4')]],{'endtime':utils[_0x1cd3('0x1d')](),'lastevent':'complete'});dials[_0x578cab['uniqueid']][_0x1cd3('0x1f')]=utils[_0x1cd3('0x20')](dials[_0x578cab[_0x1cd3('0x4')]]['endtime'],dials[_0x578cab['uniqueid']][_0x1cd3('0x21')]);dials[_0x578cab['uniqueid']][_0x1cd3('0x22')]=utils[_0x1cd3('0x20')](dials[_0x578cab[_0x1cd3('0x4')]]['answertime']||dials[_0x578cab[_0x1cd3('0x4')]]['endtime'],dials[_0x578cab[_0x1cd3('0x4')]][_0x1cd3('0x21')]);dials[_0x578cab[_0x1cd3('0x4')]]['billableseconds']=dials[_0x578cab[_0x1cd3('0x4')]][_0x1cd3('0x1c')]?utils[_0x1cd3('0x20')](dials[_0x578cab[_0x1cd3('0x4')]][_0x1cd3('0x23')],dials[_0x578cab['uniqueid']][_0x1cd3('0x1c')]):0x0;writeDB(dials[_0x578cab[_0x1cd3('0x4')]]);}}catch(_0x1412cb){utils[_0x1cd3('0x12')](_0x1412cb[_0x1cd3('0x13')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 0f075c3..06abe42 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 _0x2e9b=['xdr','info','XDR\x20DISABLED','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port','username','keepConnected'];(function(_0x13d982,_0x2b5182){var _0x56490b=function(_0xe2edea){while(--_0xe2edea){_0x13d982['push'](_0x13d982['shift']());}};_0x56490b(++_0x2b5182);}(_0x2e9b,0x1c7));var _0xb2e9=function(_0x5b3206,_0xd7c183){_0x5b3206=_0x5b3206-0x0;var _0x2a2d34=_0x2e9b[_0x5b3206];return _0x2a2d34;};var AsteriskManager=require(_0xb2e9('0x0'));var config=require(_0xb2e9('0x1'));var utils=require(_0xb2e9('0x2'));var ami=new AsteriskManager(config[_0xb2e9('0x3')][_0xb2e9('0x4')],config[_0xb2e9('0x3')]['ip'],config['asterisk'][_0xb2e9('0x5')],config['asterisk']['password'],!![]);ami[_0xb2e9('0x6')]();if(config[_0xb2e9('0x7')]&&config[_0xb2e9('0x7')]['disabled']){utils[_0xb2e9('0x8')](_0xb2e9('0x9'));}else{var agents=require('./agents.controller');var calls=require(_0xb2e9('0xa'));var queues=require(_0xb2e9('0xb'));var recordings=require(_0xb2e9('0xc'));var members=require(_0xb2e9('0xd'));var dials=require(_0xb2e9('0xe'));var transfers=require(_0xb2e9('0xf'));var core=require(_0xb2e9('0x10'));ami['on'](_0xb2e9('0x11'),core[_0xb2e9('0x11')]);ami['on']('shutdown',core['shutdown']);ami['on'](_0xb2e9('0x12'),core[_0xb2e9('0x12')]);ami['on'](_0xb2e9('0x13'),core[_0xb2e9('0x13')]);ami['on'](_0xb2e9('0x14'),core[_0xb2e9('0x14')]);ami['on'](_0xb2e9('0x15'),core[_0xb2e9('0x15')]);ami['on'](_0xb2e9('0x16'),function(_0x1fbbcf){try{members[_0xb2e9('0x16')](_0x1fbbcf);}catch(_0x105170){utils[_0xb2e9('0x13')](_0x105170);}});ami['on'](_0xb2e9('0x17'),function(_0x297c8a){try{agents[_0xb2e9('0x17')](_0x297c8a);}catch(_0x3261b5){utils[_0xb2e9('0x13')](_0x3261b5);}});ami['on'](_0xb2e9('0x18'),function(_0x24b216){try{agents[_0xb2e9('0x18')](_0x24b216);}catch(_0x506cd4){utils[_0xb2e9('0x13')](_0x506cd4);}});ami['on'](_0xb2e9('0x19'),function(_0x189c39){try{agents[_0xb2e9('0x19')](_0x189c39);queues['agentconnect'](_0x189c39);}catch(_0x215650){utils[_0xb2e9('0x13')](_0x215650);}});ami['on']('agentcomplete',function(_0x476cdf){try{agents[_0xb2e9('0x1a')](_0x476cdf);queues[_0xb2e9('0x1a')](_0x476cdf);members[_0xb2e9('0x1a')](_0x476cdf);}catch(_0x32623c){utils['error'](_0x32623c);}});ami['on'](_0xb2e9('0x1b'),function(_0x32d084){try{agents['queuecallerabandon'](_0x32d084);queues[_0xb2e9('0x1b')](_0x32d084);}catch(_0x431dbf){utils['error'](_0x431dbf);}});ami['on'](_0xb2e9('0x1c'),function(_0x560514){try{queues[_0xb2e9('0x1c')](_0x560514);recordings[_0xb2e9('0x1c')](_0x560514);}catch(_0x9b8a85){utils[_0xb2e9('0x13')](_0x9b8a85);}});ami['on'](_0xb2e9('0x1d'),function(_0x54f013){try{queues['queuecallerleave'](_0x54f013);}catch(_0x22062c){utils['error'](_0x22062c);}});ami['on'](_0xb2e9('0x1e'),function(_0x5c4f37){try{queues['musiconholdstart'](_0x5c4f37);calls[_0xb2e9('0x1e')](_0x5c4f37);}catch(_0x33abba){utils[_0xb2e9('0x13')](_0x33abba);}});ami['on']('musiconholdstop',function(_0x41d405){try{queues[_0xb2e9('0x1f')](_0x41d405);calls['musiconholdstop'](_0x41d405);}catch(_0x122c24){utils[_0xb2e9('0x13')](_0x122c24);}});ami['on']('newstate',function(_0x1a8aa7){try{calls[_0xb2e9('0x20')](_0x1a8aa7);recordings[_0xb2e9('0x20')](_0x1a8aa7);}catch(_0xd458a7){utils[_0xb2e9('0x13')](_0xd458a7);}});ami['on'](_0xb2e9('0x21'),function(_0xde805a){try{calls[_0xb2e9('0x21')](_0xde805a);recordings['hangup'](_0xde805a);dials[_0xb2e9('0x21')](_0xde805a);agents['hangup'](_0xde805a);queues[_0xb2e9('0x21')](_0xde805a);}catch(_0x2bd927){utils[_0xb2e9('0x13')](_0x2bd927);}});ami['on'](_0xb2e9('0x22'),function(_0x385c50){try{members[_0xb2e9('0x22')](_0x385c50);}catch(_0x154ea7){utils['error'](_0x154ea7);}});ami['on']('blindtransfer',function(_0x1d08e7){try{queues[_0xb2e9('0x23')](_0x1d08e7);agents[_0xb2e9('0x23')](_0x1d08e7);transfers['blindtransfer'](_0x1d08e7);}catch(_0x3b57e9){utils[_0xb2e9('0x13')](_0x3b57e9);}});ami['on'](_0xb2e9('0x24'),function(_0x58e874){try{queues[_0xb2e9('0x24')](_0x58e874);transfers[_0xb2e9('0x24')](_0x58e874);agents[_0xb2e9('0x24')](_0x58e874);calls[_0xb2e9('0x24')](_0x58e874);}catch(_0x538deb){utils['error'](_0x538deb);}});ami['on'](_0xb2e9('0x25'),function(_0xd6d266){try{queues[_0xb2e9('0x25')](_0xd6d266);recordings['varset'](_0xd6d266);calls[_0xb2e9('0x25')](_0xd6d266);dials[_0xb2e9('0x25')](_0xd6d266);}catch(_0xd86c1c){utils[_0xb2e9('0x13')](_0xd86c1c);}});ami['on'](_0xb2e9('0x26'),function(_0x1bd55c){try{calls['newexten'](_0x1bd55c);recordings['newexten'](_0x1bd55c);dials[_0xb2e9('0x26')](_0x1bd55c);}catch(_0x509b4b){utils[_0xb2e9('0x13')](_0x509b4b);}});ami['on']('newchannel',function(_0x2f220b){try{calls[_0xb2e9('0x27')](_0x2f220b);recordings[_0xb2e9('0x27')](_0x2f220b);}catch(_0x66b1e5){utils['error'](_0x66b1e5);}});ami['on'](_0xb2e9('0x28'),function(_0x23af5b){try{dials[_0xb2e9('0x28')](_0x23af5b);}catch(_0x2098f1){utils[_0xb2e9('0x13')](_0x2098f1);}});ami['on'](_0xb2e9('0x29'),function(_0x4eb25c){try{dials[_0xb2e9('0x29')](_0x4eb25c);}catch(_0x18f5a7){utils[_0xb2e9('0x13')](_0x18f5a7);}});} \ No newline at end of file +var _0x33a2=['./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','./utils','asterisk','port','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller'];(function(_0x146484,_0x27a7f0){var _0x4c7aa3=function(_0x481b98){while(--_0x481b98){_0x146484['push'](_0x146484['shift']());}};_0x4c7aa3(++_0x27a7f0);}(_0x33a2,0x149));var _0x233a=function(_0x45fb6b,_0x414ef4){_0x45fb6b=_0x45fb6b-0x0;var _0x5c5272=_0x33a2[_0x45fb6b];return _0x5c5272;};var AsteriskManager=require(_0x233a('0x0'));var config=require('../../config/environment');var utils=require(_0x233a('0x1'));var ami=new AsteriskManager(config[_0x233a('0x2')][_0x233a('0x3')],config[_0x233a('0x2')]['ip'],config[_0x233a('0x2')][_0x233a('0x4')],config[_0x233a('0x2')][_0x233a('0x5')],!![]);ami[_0x233a('0x6')]();if(config[_0x233a('0x7')]&&config[_0x233a('0x7')]['disabled']){utils[_0x233a('0x8')](_0x233a('0x9'));}else{var agents=require(_0x233a('0xa'));var calls=require(_0x233a('0xb'));var queues=require(_0x233a('0xc'));var recordings=require(_0x233a('0xd'));var members=require(_0x233a('0xe'));var dials=require(_0x233a('0xf'));var transfers=require(_0x233a('0x10'));var core=require(_0x233a('0x11'));ami['on']('connect',core[_0x233a('0x12')]);ami['on'](_0x233a('0x13'),core[_0x233a('0x13')]);ami['on'](_0x233a('0x14'),core[_0x233a('0x14')]);ami['on'](_0x233a('0x15'),core['error']);ami['on'](_0x233a('0x16'),core[_0x233a('0x16')]);ami['on']('managerevent',core[_0x233a('0x17')]);ami['on']('devicestatechange',function(_0x2bf2e8){try{members[_0x233a('0x18')](_0x2bf2e8);}catch(_0x526359){utils[_0x233a('0x15')](_0x526359);}});ami['on'](_0x233a('0x19'),function(_0x396a8d){try{agents[_0x233a('0x19')](_0x396a8d);}catch(_0x557a4f){utils['error'](_0x557a4f);}});ami['on']('agentringnoanswer',function(_0x48474f){try{agents['agentringnoanswer'](_0x48474f);}catch(_0x1b7334){utils[_0x233a('0x15')](_0x1b7334);}});ami['on'](_0x233a('0x1a'),function(_0x363cfc){try{agents[_0x233a('0x1a')](_0x363cfc);queues[_0x233a('0x1a')](_0x363cfc);}catch(_0x4d2e34){utils[_0x233a('0x15')](_0x4d2e34);}});ami['on']('agentcomplete',function(_0x59e126){try{agents[_0x233a('0x1b')](_0x59e126);queues['agentcomplete'](_0x59e126);members[_0x233a('0x1b')](_0x59e126);}catch(_0x141f7e){utils['error'](_0x141f7e);}});ami['on']('queuecallerabandon',function(_0x13f640){try{agents[_0x233a('0x1c')](_0x13f640);queues['queuecallerabandon'](_0x13f640);}catch(_0x505966){utils[_0x233a('0x15')](_0x505966);}});ami['on']('queuecallerjoin',function(_0x2a1bcc){try{queues['queuecallerjoin'](_0x2a1bcc);recordings[_0x233a('0x1d')](_0x2a1bcc);}catch(_0x547f23){utils[_0x233a('0x15')](_0x547f23);}});ami['on']('queuecallerleave',function(_0x1739cf){try{queues[_0x233a('0x1e')](_0x1739cf);}catch(_0x2b7301){utils[_0x233a('0x15')](_0x2b7301);}});ami['on']('musiconholdstart',function(_0x5895aa){try{queues[_0x233a('0x1f')](_0x5895aa);calls[_0x233a('0x1f')](_0x5895aa);}catch(_0x320e42){utils[_0x233a('0x15')](_0x320e42);}});ami['on']('musiconholdstop',function(_0x37b9c6){try{queues['musiconholdstop'](_0x37b9c6);calls[_0x233a('0x20')](_0x37b9c6);}catch(_0x12d320){utils[_0x233a('0x15')](_0x12d320);}});ami['on'](_0x233a('0x21'),function(_0x122ba2){try{calls[_0x233a('0x21')](_0x122ba2);recordings[_0x233a('0x21')](_0x122ba2);}catch(_0x3e1a5d){utils[_0x233a('0x15')](_0x3e1a5d);}});ami['on']('hangup',function(_0x1deaaa){try{calls[_0x233a('0x22')](_0x1deaaa);recordings[_0x233a('0x22')](_0x1deaaa);dials[_0x233a('0x22')](_0x1deaaa);agents['hangup'](_0x1deaaa);queues[_0x233a('0x22')](_0x1deaaa);}catch(_0x337dff){utils[_0x233a('0x15')](_0x337dff);}});ami['on'](_0x233a('0x23'),function(_0x281cba){try{members[_0x233a('0x23')](_0x281cba);}catch(_0x5f1837){utils[_0x233a('0x15')](_0x5f1837);}});ami['on'](_0x233a('0x24'),function(_0xe4f210){try{queues[_0x233a('0x24')](_0xe4f210);agents[_0x233a('0x24')](_0xe4f210);transfers['blindtransfer'](_0xe4f210);}catch(_0x591be0){utils[_0x233a('0x15')](_0x591be0);}});ami['on'](_0x233a('0x25'),function(_0x364c40){try{queues[_0x233a('0x25')](_0x364c40);transfers[_0x233a('0x25')](_0x364c40);agents[_0x233a('0x25')](_0x364c40);calls[_0x233a('0x25')](_0x364c40);}catch(_0x9cf863){utils[_0x233a('0x15')](_0x9cf863);}});ami['on']('varset',function(_0x187545){try{queues[_0x233a('0x26')](_0x187545);recordings[_0x233a('0x26')](_0x187545);calls[_0x233a('0x26')](_0x187545);dials['varset'](_0x187545);}catch(_0x5e85d6){utils[_0x233a('0x15')](_0x5e85d6);}});ami['on'](_0x233a('0x27'),function(_0xd91918){try{calls[_0x233a('0x27')](_0xd91918);recordings[_0x233a('0x27')](_0xd91918);dials[_0x233a('0x27')](_0xd91918);}catch(_0x2dbf64){utils[_0x233a('0x15')](_0x2dbf64);}});ami['on'](_0x233a('0x28'),function(_0x3c7eeb){try{calls['newchannel'](_0x3c7eeb);recordings[_0x233a('0x28')](_0x3c7eeb);}catch(_0x364e7b){utils[_0x233a('0x15')](_0x364e7b);}});ami['on'](_0x233a('0x29'),function(_0x5c7587){try{dials['dialbegin'](_0x5c7587);}catch(_0x637812){utils[_0x233a('0x15')](_0x637812);}});ami['on'](_0x233a('0x2a'),function(_0x4eac1f){try{dials[_0x233a('0x2a')](_0x4eac1f);}catch(_0x1fc18b){utils['error'](_0x1fc18b);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 22e6627..f565355 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 _0xb84a=['channel','membername','then','name','internal','request','CreateMemberReport','getUserByName','catch','some','startsWith','devicestatechange','state','BUSY','device','TALKING','now','agent','isNil','exitAt','duration','diffTime','agentcomplete','assign','queue','split','type','data2','data3','destinationchannel','data1','source','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface'];(function(_0x32fd20,_0x4790c8){var _0x230fba=function(_0x5d0602){while(--_0x5d0602){_0x32fd20['push'](_0x32fd20['shift']());}};_0x230fba(++_0x4790c8);}(_0xb84a,0xf8));var _0xab84=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb84a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xab84('0x0'));var util=require(_0xab84('0x1'));var utils=require(_0xab84('0x2'));var members={};var exclude=[_0xab84('0x3'),_0xab84('0x4')];function writeDB(_0x5613ce){utils[_0xab84('0x5')](util[_0xab84('0x6')](_0xab84('0x7'),_0x5613ce[_0xab84('0x8')],_0x5613ce[_0xab84('0x9')],_0x5613ce[_0xab84('0xa')],_0x5613ce['data2'],_0x5613ce[_0xab84('0xb')],_0x5613ce['type']));if(_0x5613ce[_0xab84('0x9')]){utils['getUserByInterface'](_0x5613ce[_0xab84('0x9')])[_0xab84('0xc')](function(_0x23db41){if(_0x23db41){_0x5613ce[_0xab84('0xb')]=_0x23db41[_0xab84('0xd')];_0x5613ce[_0xab84('0xe')]=_0x23db41[_0xab84('0xe')];utils[_0xab84('0xf')](_0xab84('0x10'),_0x5613ce);}else{utils[_0xab84('0x11')](_0x5613ce[_0xab84('0x9')]['split']('/')[0x1])[_0xab84('0xc')](function(_0x33cf22){if(_0x33cf22){_0x5613ce['membername']=_0x33cf22[_0xab84('0xd')];_0x5613ce[_0xab84('0xe')]=_0x33cf22[_0xab84('0xe')];utils[_0xab84('0xf')](_0xab84('0x10'),_0x5613ce);}});}})[_0xab84('0x12')](function(_0x8ea57a){utils['error'](_0x8ea57a);});}delete members[_0x5613ce[_0xab84('0x9')]];}function startsWith(_0x4168cc,_0x2e9598){return _[_0xab84('0x13')](_0x4168cc,function(_0x45e4d3){return _[_0xab84('0x14')](_0x2e9598,_0x45e4d3);});}exports[_0xab84('0x15')]=function(_0x3cf26d){switch(_0x3cf26d[_0xab84('0x16')]){case'INUSE':case _0xab84('0x17'):if(!startsWith(exclude,_0x3cf26d[_0xab84('0x18')])){members[_0x3cf26d[_0xab84('0x18')]]={'channel':'voice','interface':_0x3cf26d[_0xab84('0x18')],'type':_0xab84('0x19'),'enterAt':utils[_0xab84('0x1a')](),'role':_0xab84('0x1b')};}break;case'NOT_INUSE':if(!_[_0xab84('0x1c')](members[_0x3cf26d[_0xab84('0x18')]])){members[_0x3cf26d[_0xab84('0x18')]][_0xab84('0x1d')]=utils[_0xab84('0x1a')]();members[_0x3cf26d['device']][_0xab84('0x1e')]=utils[_0xab84('0x1f')](members[_0x3cf26d[_0xab84('0x18')]][_0xab84('0x1d')],members[_0x3cf26d[_0xab84('0x18')]]['enterAt']);if(members[_0x3cf26d[_0xab84('0x18')]]['uniqueid']){writeDB(members[_0x3cf26d[_0xab84('0x18')]]);}}default:break;}};exports[_0xab84('0x20')]=function(_0x2a7e43){if(!_[_0xab84('0x1c')](members[_0x2a7e43[_0xab84('0x9')]])){members[_0x2a7e43[_0xab84('0x9')]]=_[_0xab84('0x21')](members[_0x2a7e43[_0xab84('0x9')]],{'data4':_0x2a7e43[_0xab84('0x22')],'uniqueid':_0x2a7e43[_0xab84('0x8')]});}};exports['cdr']=function(_0x2d227e){if(_0x2d227e['channel']){var _0xc6d5d5=_0x2d227e[_0xab84('0xa')][_0xab84('0x23')]('-')[0x0];if(!_['isNil'](members[_0xc6d5d5])){members[_0xc6d5d5]=_[_0xab84('0x21')](members[_0xc6d5d5],{'data1':members[_0xc6d5d5]['data1']||_0x2d227e[_0xab84('0x24')],'data2':members[_0xc6d5d5][_0xab84('0x25')]||_0x2d227e['source'],'data3':members[_0xc6d5d5][_0xab84('0x26')]||_0x2d227e['destination'],'uniqueid':members[_0xc6d5d5][_0xab84('0x8')]||_0x2d227e[_0xab84('0x8')]});if(members[_0xc6d5d5]['exitAt']){writeDB(members[_0xc6d5d5]);}}}if(_0x2d227e[_0xab84('0x27')]){var _0x4bf3c3=_0x2d227e[_0xab84('0x27')]['split']('-')[0x0];if(!_[_0xab84('0x1c')](members[_0x4bf3c3])){members[_0x4bf3c3]=_['assign'](members[_0x4bf3c3],{'data1':members[_0x4bf3c3][_0xab84('0x28')]||_0x2d227e[_0xab84('0x24')],'data2':members[_0x4bf3c3]['data2']||_0x2d227e[_0xab84('0x29')],'data3':members[_0x4bf3c3][_0xab84('0x26')]||_0x2d227e[_0xab84('0x2a')],'uniqueid':members[_0x4bf3c3][_0xab84('0x8')]||_0x2d227e[_0xab84('0x8')]});if(members[_0x4bf3c3][_0xab84('0x1d')]){writeDB(members[_0x4bf3c3]);}}}}; \ No newline at end of file +var _0x9e31=['data2','membername','type','getUserByInterface','then','internal','request','CreateMemberReport','split','name','error','some','devicestatechange','state','INUSE','BUSY','device','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','assign','queue','cdr','data1','source','data3','destination','destinationchannel','lodash','./utils','Local/_attended@transfer','Queue:','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x9e31,0x171));var _0x19e3=function(_0x110836,_0xc380c7){_0x110836=_0x110836-0x0;var _0x505b43=_0x9e31[_0x110836];return _0x505b43;};'use strict';var _=require(_0x19e3('0x0'));var util=require('util');var utils=require(_0x19e3('0x1'));var members={};var exclude=[_0x19e3('0x2'),_0x19e3('0x3')];function writeDB(_0xaded6){utils['info'](util[_0x19e3('0x4')](_0x19e3('0x5'),_0xaded6[_0x19e3('0x6')],_0xaded6[_0x19e3('0x7')],_0xaded6[_0x19e3('0x8')],_0xaded6[_0x19e3('0x9')],_0xaded6[_0x19e3('0xa')],_0xaded6[_0x19e3('0xb')]));if(_0xaded6[_0x19e3('0x7')]){utils[_0x19e3('0xc')](_0xaded6['interface'])[_0x19e3('0xd')](function(_0xab4fdf){if(_0xab4fdf){_0xaded6[_0x19e3('0xa')]=_0xab4fdf['name'];_0xaded6[_0x19e3('0xe')]=_0xab4fdf['internal'];utils[_0x19e3('0xf')](_0x19e3('0x10'),_0xaded6);}else{utils['getUserByName'](_0xaded6[_0x19e3('0x7')][_0x19e3('0x11')]('/')[0x1])[_0x19e3('0xd')](function(_0x48f418){if(_0x48f418){_0xaded6[_0x19e3('0xa')]=_0x48f418[_0x19e3('0x12')];_0xaded6[_0x19e3('0xe')]=_0x48f418[_0x19e3('0xe')];utils['request'](_0x19e3('0x10'),_0xaded6);}});}})['catch'](function(_0x1ad0f4){utils[_0x19e3('0x13')](_0x1ad0f4);});}delete members[_0xaded6[_0x19e3('0x7')]];}function startsWith(_0x649f5f,_0x29a7e8){return _[_0x19e3('0x14')](_0x649f5f,function(_0x5199a1){return _['startsWith'](_0x29a7e8,_0x5199a1);});}exports[_0x19e3('0x15')]=function(_0x7044fb){switch(_0x7044fb[_0x19e3('0x16')]){case _0x19e3('0x17'):case _0x19e3('0x18'):if(!startsWith(exclude,_0x7044fb[_0x19e3('0x19')])){members[_0x7044fb[_0x19e3('0x19')]]={'channel':_0x19e3('0x1a'),'interface':_0x7044fb[_0x19e3('0x19')],'type':_0x19e3('0x1b'),'enterAt':utils[_0x19e3('0x1c')](),'role':_0x19e3('0x1d')};}break;case _0x19e3('0x1e'):if(!_[_0x19e3('0x1f')](members[_0x7044fb[_0x19e3('0x19')]])){members[_0x7044fb[_0x19e3('0x19')]][_0x19e3('0x20')]=utils[_0x19e3('0x1c')]();members[_0x7044fb['device']]['duration']=utils[_0x19e3('0x21')](members[_0x7044fb['device']][_0x19e3('0x20')],members[_0x7044fb[_0x19e3('0x19')]]['enterAt']);if(members[_0x7044fb[_0x19e3('0x19')]][_0x19e3('0x6')]){writeDB(members[_0x7044fb[_0x19e3('0x19')]]);}}default:break;}};exports['agentcomplete']=function(_0x282e82){if(!_['isNil'](members[_0x282e82[_0x19e3('0x7')]])){members[_0x282e82['interface']]=_[_0x19e3('0x22')](members[_0x282e82['interface']],{'data4':_0x282e82[_0x19e3('0x23')],'uniqueid':_0x282e82[_0x19e3('0x6')]});}};exports[_0x19e3('0x24')]=function(_0x52fc7a){if(_0x52fc7a['channel']){var _0x3719cd=_0x52fc7a[_0x19e3('0x8')]['split']('-')[0x0];if(!_[_0x19e3('0x1f')](members[_0x3719cd])){members[_0x3719cd]=_[_0x19e3('0x22')](members[_0x3719cd],{'data1':members[_0x3719cd][_0x19e3('0x25')]||_0x52fc7a[_0x19e3('0xb')],'data2':members[_0x3719cd][_0x19e3('0x9')]||_0x52fc7a[_0x19e3('0x26')],'data3':members[_0x3719cd][_0x19e3('0x27')]||_0x52fc7a[_0x19e3('0x28')],'uniqueid':members[_0x3719cd][_0x19e3('0x6')]||_0x52fc7a['uniqueid']});if(members[_0x3719cd][_0x19e3('0x20')]){writeDB(members[_0x3719cd]);}}}if(_0x52fc7a[_0x19e3('0x29')]){var _0x4f9211=_0x52fc7a[_0x19e3('0x29')][_0x19e3('0x11')]('-')[0x0];if(!_[_0x19e3('0x1f')](members[_0x4f9211])){members[_0x4f9211]=_[_0x19e3('0x22')](members[_0x4f9211],{'data1':members[_0x4f9211][_0x19e3('0x25')]||_0x52fc7a[_0x19e3('0xb')],'data2':members[_0x4f9211][_0x19e3('0x9')]||_0x52fc7a[_0x19e3('0x26')],'data3':members[_0x4f9211][_0x19e3('0x27')]||_0x52fc7a[_0x19e3('0x28')],'uniqueid':members[_0x4f9211]['uniqueid']||_0x52fc7a[_0x19e3('0x6')]});if(members[_0x4f9211][_0x19e3('0x20')]){writeDB(members[_0x4f9211]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index fada8a4..97e737e 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 _0x28da=['queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','assign','position','now','isNil','queuecallerleaveAt','queuecallerabandon','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','queueposition','ABANDONED','queuecallerleave','holdtime','diffTime','count','connectedlinenum','connectedlinename','agentconnect','assigned','accountcode','destaccountcode','membername','agentcomplete','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','transfereeuniqueid','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','secondtransfereruniqueid','transfertype','secondtransfererexten','transfertargetlinkedid','mohtime','error','musiconholdstop','musiconholdstartAt','lodash','util','info','format','channel','queue','lastAssignedTo','calleridnum'];(function(_0x3eb5f9,_0xed9ca5){var _0x4cf194=function(_0x3a9abf){while(--_0x3a9abf){_0x3eb5f9['push'](_0x3eb5f9['shift']());}};_0x4cf194(++_0xed9ca5);}(_0x28da,0x94));var _0xa28d=function(_0x14353f,_0x35fb99){_0x14353f=_0x14353f-0x0;var _0x597084=_0x28da[_0x14353f];return _0x597084;};'use strict';var _=require(_0xa28d('0x0'));var util=require(_0xa28d('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x1a06cf){utils[_0xa28d('0x2')](util[_0xa28d('0x3')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x1a06cf['uniqueid'],_0x1a06cf[_0xa28d('0x4')],_0x1a06cf[_0xa28d('0x5')],_0x1a06cf[_0xa28d('0x6')],_0x1a06cf[_0xa28d('0x7')],_0x1a06cf['accountcode'],_0x1a06cf[_0xa28d('0x8')]));if(_0x1a06cf[_0xa28d('0x5')]){utils['getVoiceQueueByName'](_0x1a06cf[_0xa28d('0x5')])[_0xa28d('0x9')](function(_0x30cdee){if(_0x30cdee){_0x1a06cf[_0xa28d('0xa')]=_0x30cdee[_0xa28d('0xa')];}utils[_0xa28d('0xb')](_0xa28d('0xc'),_0x1a06cf);});}else{utils['request']('CreateVoiceQueueReport',_0x1a06cf);}if(_0x1a06cf['transfereduniqueid']){delete queues[_0x1a06cf[_0xa28d('0xd')]];}else{delete queues[_0x1a06cf[_0xa28d('0xe')]];}}exports[_0xa28d('0xf')]=function(_0x241207){queues[_0x241207[_0xa28d('0xe')]]=_[_0xa28d('0x10')](_0x241207,{'originalposition':_0x241207[_0xa28d('0x11')],'queuecallerjoinAt':utils[_0xa28d('0x12')](),'mohtime':0x0});};exports['hangup']=function(_0x54b2f5){if(!_[_0xa28d('0x13')](queues[_0x54b2f5[_0xa28d('0xe')]])){if(queues[_0x54b2f5['uniqueid']][_0xa28d('0x14')]){if(!queues[_0x54b2f5[_0xa28d('0xe')]][_0xa28d('0x15')]&&!queues[_0x54b2f5[_0xa28d('0xe')]]['queuecallerexit']){queues[_0x54b2f5['uniqueid']]['queuecallercomplete']=!![];queues[_0x54b2f5[_0xa28d('0xe')]][_0xa28d('0x16')]=utils['now']();queues[_0x54b2f5[_0xa28d('0xe')]]['queuecallerexitreason']=_0xa28d('0x17');}writeDB(queues[_0x54b2f5[_0xa28d('0xe')]]);}else{if(queues[_0x54b2f5[_0xa28d('0xe')]][_0xa28d('0xd')]){queues[queues[_0x54b2f5['uniqueid']][_0xa28d('0xd')]]=queues[_0x54b2f5[_0xa28d('0xe')]];queues[queues[_0x54b2f5[_0xa28d('0xe')]]['transfereduniqueid']][_0xa28d('0x18')]=0x2;delete queues[_0x54b2f5['uniqueid']];}}}};exports[_0xa28d('0x19')]=function(_0xb1a929){if(!_[_0xa28d('0x13')](_0xb1a929[_0xa28d('0x1a')][_0xa28d('0x1b')])&&_0xb1a929['value'][_0xa28d('0x1c')]()!==_0xa28d('0x1d')){if(!_[_0xa28d('0x13')](queues[_0xb1a929[_0xa28d('0xe')]])){queues[_0xb1a929[_0xa28d('0xe')]][_0xa28d('0x15')]=![];queues[_0xb1a929['uniqueid']][_0xa28d('0x1e')]=null;queues[_0xb1a929[_0xa28d('0xe')]][_0xa28d('0x1f')]=!![];queues[_0xb1a929[_0xa28d('0xe')]][_0xa28d('0x20')]=utils[_0xa28d('0x12')]();queues[_0xb1a929[_0xa28d('0xe')]]['queuecallerexitreason']=_0xb1a929[_0xa28d('0x21')]['toUpperCase']();writeDB(queues[_0xb1a929[_0xa28d('0xe')]]);}}else if(!_[_0xa28d('0x13')](_0xb1a929[_0xa28d('0x1a')][_0xa28d('0x22')])){if(!_['isNil'](queues[_0xb1a929[_0xa28d('0xe')]])&&!queues[_0xb1a929[_0xa28d('0xe')]]['queuecallerabandon']){queues[_0xb1a929[_0xa28d('0xe')]][_0xa28d('0x15')]=![];queues[_0xb1a929[_0xa28d('0xe')]][_0xa28d('0x1e')]=null;queues[_0xb1a929[_0xa28d('0xe')]][_0xa28d('0x1f')]=!![];queues[_0xb1a929['uniqueid']][_0xa28d('0x20')]=utils[_0xa28d('0x12')]();queues[_0xb1a929[_0xa28d('0xe')]][_0xa28d('0x8')]='EXITWITHKEY';}}};exports[_0xa28d('0x15')]=function(_0x34bea8){if(!_[_0xa28d('0x13')](queues[_0x34bea8[_0xa28d('0xe')]])){queues[_0x34bea8[_0xa28d('0xe')]][_0xa28d('0x1f')]=![];queues[_0x34bea8[_0xa28d('0xe')]][_0xa28d('0x20')]=null;queues[_0x34bea8[_0xa28d('0xe')]][_0xa28d('0x15')]=!![];queues[_0x34bea8[_0xa28d('0xe')]][_0xa28d('0x1e')]=utils[_0xa28d('0x12')]();queues[_0x34bea8[_0xa28d('0xe')]]['queuecallerexitreason']=_0xa28d('0x23');}};exports[_0xa28d('0x24')]=function(_0x3b759c){if(!_['isNil'](queues[_0x3b759c[_0xa28d('0xe')]])){queues[_0x3b759c[_0xa28d('0xe')]][_0xa28d('0x24')]=!![];queues[_0x3b759c[_0xa28d('0xe')]]['queuecallerleaveAt']=utils['now']();queues[_0x3b759c['uniqueid']][_0xa28d('0x25')]=utils[_0xa28d('0x26')](queues[_0x3b759c['uniqueid']][_0xa28d('0x14')],queues[_0x3b759c[_0xa28d('0xe')]]['queuecallerjoinAt']);queues[_0x3b759c['uniqueid']]['position']=_0x3b759c[_0xa28d('0x11')];queues[_0x3b759c[_0xa28d('0xe')]][_0xa28d('0x27')]=_0x3b759c['count'];queues[_0x3b759c[_0xa28d('0xe')]][_0xa28d('0x28')]=_0x3b759c[_0xa28d('0x28')];queues[_0x3b759c['uniqueid']][_0xa28d('0x29')]=_0x3b759c[_0xa28d('0x29')];}};exports[_0xa28d('0x2a')]=function(_0x3b72e2){if(!_[_0xa28d('0x13')](queues[_0x3b72e2['uniqueid']])){queues[_0x3b72e2[_0xa28d('0xe')]][_0xa28d('0x15')]=![];queues[_0x3b72e2[_0xa28d('0xe')]][_0xa28d('0x15')]=![];queues[_0x3b72e2[_0xa28d('0xe')]][_0xa28d('0x1e')]=null;queues[_0x3b72e2[_0xa28d('0xe')]][_0xa28d('0x1f')]=![];queues[_0x3b72e2[_0xa28d('0xe')]][_0xa28d('0x8')]=null;queues[_0x3b72e2[_0xa28d('0xe')]][_0xa28d('0x20')]=null;queues[_0x3b72e2[_0xa28d('0xe')]][_0xa28d('0x2b')]=!![];queues[_0x3b72e2['uniqueid']][_0xa28d('0x2c')]=_0x3b72e2[_0xa28d('0x2d')];queues[_0x3b72e2[_0xa28d('0xe')]][_0xa28d('0x6')]=_0x3b72e2[_0xa28d('0x2e')];}};exports[_0xa28d('0x2f')]=function(_0x4c3874){if(!_['isNil'](queues[_0x4c3874[_0xa28d('0xe')]])){if(queues[_0x4c3874['uniqueid']]['queuecallerleaveAt']){queues[_0x4c3874[_0xa28d('0xe')]]['queuecallerabandon']=![];queues[_0x4c3874[_0xa28d('0xe')]][_0xa28d('0x15')]=![];queues[_0x4c3874[_0xa28d('0xe')]][_0xa28d('0x1e')]=null;queues[_0x4c3874['uniqueid']][_0xa28d('0x1f')]=![];queues[_0x4c3874[_0xa28d('0xe')]]['queuecallerexitAt']=null;queues[_0x4c3874[_0xa28d('0xe')]]['assigned']=!![];queues[_0x4c3874[_0xa28d('0xe')]]['lastAssignedTo']=_0x4c3874['membername'];queues[_0x4c3874[_0xa28d('0xe')]][_0xa28d('0x30')]=!![];queues[_0x4c3874[_0xa28d('0xe')]][_0xa28d('0x16')]=utils['now']();if(_0x4c3874[_0xa28d('0x31')]==_0xa28d('0x32')){if(!queues[_0x4c3874['uniqueid']][_0xa28d('0x32')]){queues[_0x4c3874['uniqueid']][_0xa28d('0x8')]=_0xa28d('0x33');}}else{queues[_0x4c3874[_0xa28d('0xe')]][_0xa28d('0x8')]=_0xa28d('0x34')+_0x4c3874[_0xa28d('0x31')][_0xa28d('0x1c')]();}writeDB(queues[_0x4c3874[_0xa28d('0xe')]]);}}};exports['blindtransfer']=function(_0x3f2752){if(!_[_0xa28d('0x13')](queues[_0x3f2752[_0xa28d('0x35')]])){queues[_0x3f2752['transfereeuniqueid']][_0xa28d('0x32')]=!![];queues[_0x3f2752['transfereeuniqueid']]['transfertype']=_0xa28d('0x36');queues[_0x3f2752[_0xa28d('0x35')]][_0xa28d('0x37')]=_0x3f2752['extension'];queues[_0x3f2752[_0xa28d('0x35')]][_0xa28d('0x38')]=_0x3f2752['transfereeuniqueid'];queues[_0x3f2752['transfereeuniqueid']][_0xa28d('0x8')]=_0xa28d('0x39');}};exports[_0xa28d('0x3a')]=function(_0x12d1f2){try{if(_0x12d1f2[_0xa28d('0x3b')]==_0x12d1f2[_0xa28d('0x3c')]){if(!_[_0xa28d('0x13')](queues[_0x12d1f2[_0xa28d('0x3d')]])){queues[_0x12d1f2['secondtransfererlinkedid']][_0xa28d('0x32')]=!![];queues[_0x12d1f2[_0xa28d('0x3d')]]['transfertype']=_0xa28d('0x3e');queues[_0x12d1f2['secondtransfererlinkedid']]['transferexten']=_0x12d1f2[_0xa28d('0x3f')];queues[_0x12d1f2[_0xa28d('0x3d')]][_0xa28d('0x38')]=_0x12d1f2[_0xa28d('0x3b')];queues[_0x12d1f2[_0xa28d('0x3d')]][_0xa28d('0x8')]=_0xa28d('0x40');}if(!_[_0xa28d('0x13')](queues[_0x12d1f2['origtransfererlinkedid']])){if(_0x12d1f2[_0xa28d('0x41')]&&queues[_0x12d1f2[_0xa28d('0x41')]]){queues[_0x12d1f2[_0xa28d('0x41')]]['queuecallerenterreason']=0x1;queues[_0x12d1f2[_0xa28d('0x35')]]=_[_0xa28d('0x42')](queues[_0x12d1f2[_0xa28d('0x41')]]);queues[_0x12d1f2['transfereeuniqueid']][_0xa28d('0xd')]=_0x12d1f2[_0xa28d('0x43')];queues[_0x12d1f2[_0xa28d('0x35')]][_0xa28d('0x18')]=0x2;queues[_0x12d1f2[_0xa28d('0x35')]][_0xa28d('0x7')]=queues[_0x12d1f2[_0xa28d('0x3d')]]['calleridnum'];queues[_0x12d1f2[_0xa28d('0x35')]][_0xa28d('0x44')]=queues[_0x12d1f2[_0xa28d('0x3d')]][_0xa28d('0x44')];queues[_0x12d1f2[_0xa28d('0x35')]][_0xa28d('0x45')]=utils['now']();queues[_0x12d1f2['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0xa28d('0x12')]();queues[_0x12d1f2[_0xa28d('0x35')]]['holdtime']=0x0;queues[_0x12d1f2[_0xa28d('0x35')]]['mohtime']=0x0;}else{queues[_0x12d1f2[_0xa28d('0x3c')]][_0xa28d('0xd')]=_0x12d1f2['secondtransfererlinkedid'];}}}else if(_0x12d1f2[_0xa28d('0x46')]==_0x12d1f2[_0xa28d('0x3d')]){if(!_[_0xa28d('0x13')](queues[_0x12d1f2['origtransfererlinkedid']])){queues[_0x12d1f2[_0xa28d('0x3c')]][_0xa28d('0x32')]=!![];queues[_0x12d1f2[_0xa28d('0x3c')]][_0xa28d('0x47')]=_0xa28d('0x3e');queues[_0x12d1f2[_0xa28d('0x3c')]][_0xa28d('0x37')]=_0x12d1f2[_0xa28d('0x48')];queues[_0x12d1f2[_0xa28d('0x3c')]][_0xa28d('0x38')]=_0x12d1f2[_0xa28d('0x46')];queues[_0x12d1f2[_0xa28d('0x3c')]][_0xa28d('0x8')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x12d1f2['secondtransfererlinkedid']])){if(_0x12d1f2[_0xa28d('0x49')]&&queues[_0x12d1f2[_0xa28d('0x49')]]){queues[_0x12d1f2[_0xa28d('0x49')]]['queuecallerenterreason']=0x1;queues[_0x12d1f2[_0xa28d('0x43')]]=_[_0xa28d('0x42')](queues[_0x12d1f2[_0xa28d('0x49')]]);queues[_0x12d1f2[_0xa28d('0x43')]][_0xa28d('0xd')]=_0x12d1f2['transfertargetuniqueid'];queues[_0x12d1f2[_0xa28d('0x43')]][_0xa28d('0x18')]=0x2;queues[_0x12d1f2[_0xa28d('0x43')]]['calleridnum']=queues[_0x12d1f2[_0xa28d('0x3c')]][_0xa28d('0x7')];queues[_0x12d1f2[_0xa28d('0x43')]][_0xa28d('0x44')]=queues[_0x12d1f2[_0xa28d('0x3c')]]['calleridname'];queues[_0x12d1f2[_0xa28d('0x43')]][_0xa28d('0x45')]=utils[_0xa28d('0x12')]();queues[_0x12d1f2['transfertargetuniqueid']][_0xa28d('0x14')]=utils['now']();queues[_0x12d1f2[_0xa28d('0x43')]][_0xa28d('0x25')]=0x0;queues[_0x12d1f2[_0xa28d('0x43')]][_0xa28d('0x4a')]=0x0;}else{queues[_0x12d1f2[_0xa28d('0x3d')]][_0xa28d('0xd')]=_0x12d1f2[_0xa28d('0x3c')];}}}}catch(_0x104d58){utils[_0xa28d('0x4b')](_0x104d58['stack']);}};exports['musiconholdstart']=function(_0x271354){if(!_[_0xa28d('0x13')](queues[_0x271354[_0xa28d('0xe')]])){queues[_0x271354[_0xa28d('0xe')]]['musiconholdstartAt']=utils['now']();}};exports[_0xa28d('0x4c')]=function(_0x52f5b1){if(!_[_0xa28d('0x13')](queues[_0x52f5b1[_0xa28d('0xe')]])){if(!_['isNil'](queues[_0x52f5b1[_0xa28d('0xe')]]['musiconholdstartAt'])){queues[_0x52f5b1[_0xa28d('0xe')]]['mohtime']+=utils[_0xa28d('0x26')](utils[_0xa28d('0x12')](),queues[_0x52f5b1[_0xa28d('0xe')]]['musiconholdstartAt']);delete queues[_0x52f5b1[_0xa28d('0xe')]][_0xa28d('0x4d')];}}}; \ No newline at end of file +var _0x8ff0=['value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','queueposition','ABANDONED','queuecallerleave','count','connectedlinenum','assigned','destaccountcode','lastAssignedTo','membername','agentcomplete','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','transfertype','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','queuecallerjoinAt','holdtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','mohtime','error','stack','musiconholdstartAt','musiconholdstop','lodash','util','./utils','info','uniqueid','channel','queue','calleridnum','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','position','now','hangup','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','queuecallerexitreason','queuecallerenterreason','varset','isNil','variable'];(function(_0x5a98f0,_0x34c3a0){var _0x2990f3=function(_0x5dba7b){while(--_0x5dba7b){_0x5a98f0['push'](_0x5a98f0['shift']());}};_0x2990f3(++_0x34c3a0);}(_0x8ff0,0x1e4));var _0x08ff=function(_0x1cdcff,_0x4ddcdf){_0x1cdcff=_0x1cdcff-0x0;var _0x461573=_0x8ff0[_0x1cdcff];return _0x461573;};'use strict';var _=require(_0x08ff('0x0'));var util=require(_0x08ff('0x1'));var utils=require(_0x08ff('0x2'));var queues={};function writeDB(_0xb6f017){utils[_0x08ff('0x3')](util['format']('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0xb6f017[_0x08ff('0x4')],_0xb6f017[_0x08ff('0x5')],_0xb6f017[_0x08ff('0x6')],_0xb6f017['lastAssignedTo'],_0xb6f017[_0x08ff('0x7')],_0xb6f017['accountcode'],_0xb6f017['queuecallerexitreason']));if(_0xb6f017['queue']){utils[_0x08ff('0x8')](_0xb6f017[_0x08ff('0x6')])['then'](function(_0x1ecf21){if(_0x1ecf21){_0xb6f017['type']=_0x1ecf21[_0x08ff('0x9')];}utils[_0x08ff('0xa')]('CreateVoiceQueueReport',_0xb6f017);});}else{utils[_0x08ff('0xa')](_0x08ff('0xb'),_0xb6f017);}if(_0xb6f017[_0x08ff('0xc')]){delete queues[_0xb6f017[_0x08ff('0xc')]];}else{delete queues[_0xb6f017[_0x08ff('0x4')]];}}exports[_0x08ff('0xd')]=function(_0xe3747d){queues[_0xe3747d[_0x08ff('0x4')]]=_[_0x08ff('0xe')](_0xe3747d,{'originalposition':_0xe3747d[_0x08ff('0xf')],'queuecallerjoinAt':utils[_0x08ff('0x10')](),'mohtime':0x0});};exports[_0x08ff('0x11')]=function(_0x15eee8){if(!_['isNil'](queues[_0x15eee8[_0x08ff('0x4')]])){if(queues[_0x15eee8[_0x08ff('0x4')]][_0x08ff('0x12')]){if(!queues[_0x15eee8[_0x08ff('0x4')]][_0x08ff('0x13')]&&!queues[_0x15eee8[_0x08ff('0x4')]][_0x08ff('0x14')]){queues[_0x15eee8[_0x08ff('0x4')]]['queuecallercomplete']=!![];queues[_0x15eee8['uniqueid']][_0x08ff('0x15')]=utils[_0x08ff('0x10')]();queues[_0x15eee8['uniqueid']][_0x08ff('0x16')]='COMPLETEDBYAGENT';}writeDB(queues[_0x15eee8[_0x08ff('0x4')]]);}else{if(queues[_0x15eee8[_0x08ff('0x4')]][_0x08ff('0xc')]){queues[queues[_0x15eee8[_0x08ff('0x4')]][_0x08ff('0xc')]]=queues[_0x15eee8[_0x08ff('0x4')]];queues[queues[_0x15eee8[_0x08ff('0x4')]][_0x08ff('0xc')]][_0x08ff('0x17')]=0x2;delete queues[_0x15eee8[_0x08ff('0x4')]];}}}};exports[_0x08ff('0x18')]=function(_0x1abe32){if(!_[_0x08ff('0x19')](_0x1abe32[_0x08ff('0x1a')]['queuestatus'])&&_0x1abe32[_0x08ff('0x1b')]['toUpperCase']()!==_0x08ff('0x1c')){if(!_[_0x08ff('0x19')](queues[_0x1abe32[_0x08ff('0x4')]])){queues[_0x1abe32[_0x08ff('0x4')]]['queuecallerabandon']=![];queues[_0x1abe32[_0x08ff('0x4')]][_0x08ff('0x1d')]=null;queues[_0x1abe32['uniqueid']]['queuecallerexit']=!![];queues[_0x1abe32[_0x08ff('0x4')]][_0x08ff('0x1e')]=utils[_0x08ff('0x10')]();queues[_0x1abe32[_0x08ff('0x4')]]['queuecallerexitreason']=_0x1abe32[_0x08ff('0x1b')][_0x08ff('0x1f')]();writeDB(queues[_0x1abe32['uniqueid']]);}}else if(!_[_0x08ff('0x19')](_0x1abe32[_0x08ff('0x1a')][_0x08ff('0x20')])){if(!_['isNil'](queues[_0x1abe32[_0x08ff('0x4')]])&&!queues[_0x1abe32[_0x08ff('0x4')]][_0x08ff('0x13')]){queues[_0x1abe32['uniqueid']][_0x08ff('0x13')]=![];queues[_0x1abe32['uniqueid']][_0x08ff('0x1d')]=null;queues[_0x1abe32[_0x08ff('0x4')]][_0x08ff('0x14')]=!![];queues[_0x1abe32[_0x08ff('0x4')]][_0x08ff('0x1e')]=utils[_0x08ff('0x10')]();queues[_0x1abe32[_0x08ff('0x4')]]['queuecallerexitreason']='EXITWITHKEY';}}};exports[_0x08ff('0x13')]=function(_0x26b10a){if(!_[_0x08ff('0x19')](queues[_0x26b10a[_0x08ff('0x4')]])){queues[_0x26b10a['uniqueid']][_0x08ff('0x14')]=![];queues[_0x26b10a[_0x08ff('0x4')]][_0x08ff('0x1e')]=null;queues[_0x26b10a[_0x08ff('0x4')]][_0x08ff('0x13')]=!![];queues[_0x26b10a[_0x08ff('0x4')]][_0x08ff('0x1d')]=utils['now']();queues[_0x26b10a[_0x08ff('0x4')]][_0x08ff('0x16')]=_0x08ff('0x21');}};exports[_0x08ff('0x22')]=function(_0xdd3ffc){if(!_[_0x08ff('0x19')](queues[_0xdd3ffc[_0x08ff('0x4')]])){queues[_0xdd3ffc[_0x08ff('0x4')]][_0x08ff('0x22')]=!![];queues[_0xdd3ffc[_0x08ff('0x4')]][_0x08ff('0x12')]=utils['now']();queues[_0xdd3ffc[_0x08ff('0x4')]]['holdtime']=utils['diffTime'](queues[_0xdd3ffc[_0x08ff('0x4')]][_0x08ff('0x12')],queues[_0xdd3ffc[_0x08ff('0x4')]]['queuecallerjoinAt']);queues[_0xdd3ffc[_0x08ff('0x4')]][_0x08ff('0xf')]=_0xdd3ffc[_0x08ff('0xf')];queues[_0xdd3ffc[_0x08ff('0x4')]]['count']=_0xdd3ffc[_0x08ff('0x23')];queues[_0xdd3ffc['uniqueid']][_0x08ff('0x24')]=_0xdd3ffc[_0x08ff('0x24')];queues[_0xdd3ffc['uniqueid']]['connectedlinename']=_0xdd3ffc['connectedlinename'];}};exports['agentconnect']=function(_0x424c40){if(!_['isNil'](queues[_0x424c40[_0x08ff('0x4')]])){queues[_0x424c40[_0x08ff('0x4')]]['queuecallerabandon']=![];queues[_0x424c40[_0x08ff('0x4')]][_0x08ff('0x13')]=![];queues[_0x424c40[_0x08ff('0x4')]][_0x08ff('0x1d')]=null;queues[_0x424c40[_0x08ff('0x4')]]['queuecallerexit']=![];queues[_0x424c40[_0x08ff('0x4')]][_0x08ff('0x16')]=null;queues[_0x424c40['uniqueid']][_0x08ff('0x1e')]=null;queues[_0x424c40[_0x08ff('0x4')]][_0x08ff('0x25')]=!![];queues[_0x424c40[_0x08ff('0x4')]]['accountcode']=_0x424c40[_0x08ff('0x26')];queues[_0x424c40[_0x08ff('0x4')]][_0x08ff('0x27')]=_0x424c40[_0x08ff('0x28')];}};exports[_0x08ff('0x29')]=function(_0x132019){if(!_[_0x08ff('0x19')](queues[_0x132019[_0x08ff('0x4')]])){if(queues[_0x132019['uniqueid']][_0x08ff('0x12')]){queues[_0x132019['uniqueid']][_0x08ff('0x13')]=![];queues[_0x132019[_0x08ff('0x4')]][_0x08ff('0x13')]=![];queues[_0x132019[_0x08ff('0x4')]][_0x08ff('0x1d')]=null;queues[_0x132019[_0x08ff('0x4')]]['queuecallerexit']=![];queues[_0x132019['uniqueid']][_0x08ff('0x1e')]=null;queues[_0x132019[_0x08ff('0x4')]][_0x08ff('0x25')]=!![];queues[_0x132019['uniqueid']]['lastAssignedTo']=_0x132019['membername'];queues[_0x132019[_0x08ff('0x4')]][_0x08ff('0x2a')]=!![];queues[_0x132019[_0x08ff('0x4')]][_0x08ff('0x15')]=utils[_0x08ff('0x10')]();if(_0x132019[_0x08ff('0x2b')]==_0x08ff('0x2c')){if(!queues[_0x132019[_0x08ff('0x4')]][_0x08ff('0x2c')]){queues[_0x132019[_0x08ff('0x4')]][_0x08ff('0x16')]=_0x08ff('0x2d');}}else{queues[_0x132019['uniqueid']][_0x08ff('0x16')]=_0x08ff('0x2e')+_0x132019[_0x08ff('0x2b')]['toUpperCase']();}writeDB(queues[_0x132019[_0x08ff('0x4')]]);}}};exports[_0x08ff('0x2f')]=function(_0x439d5b){if(!_['isNil'](queues[_0x439d5b['transfereeuniqueid']])){queues[_0x439d5b['transfereeuniqueid']][_0x08ff('0x2c')]=!![];queues[_0x439d5b[_0x08ff('0x30')]]['transfertype']='BLIND';queues[_0x439d5b['transfereeuniqueid']][_0x08ff('0x31')]=_0x439d5b[_0x08ff('0x32')];queues[_0x439d5b['transfereeuniqueid']][_0x08ff('0x33')]=_0x439d5b['transfereeuniqueid'];queues[_0x439d5b[_0x08ff('0x30')]][_0x08ff('0x16')]=_0x08ff('0x34');}};exports[_0x08ff('0x35')]=function(_0x125b28){try{if(_0x125b28['origtransfereruniqueid']==_0x125b28[_0x08ff('0x36')]){if(!_[_0x08ff('0x19')](queues[_0x125b28[_0x08ff('0x37')]])){queues[_0x125b28['secondtransfererlinkedid']]['transfer']=!![];queues[_0x125b28['secondtransfererlinkedid']][_0x08ff('0x38')]=_0x08ff('0x39');queues[_0x125b28[_0x08ff('0x37')]]['transferexten']=_0x125b28['origtransfererexten'];queues[_0x125b28[_0x08ff('0x37')]]['transferuniqueid']=_0x125b28['origtransfereruniqueid'];queues[_0x125b28[_0x08ff('0x37')]][_0x08ff('0x16')]=_0x08ff('0x3a');}if(!_[_0x08ff('0x19')](queues[_0x125b28['origtransfererlinkedid']])){if(_0x125b28['transfereelinkedid']&&queues[_0x125b28[_0x08ff('0x3b')]]){queues[_0x125b28['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x125b28[_0x08ff('0x30')]]=_[_0x08ff('0x3c')](queues[_0x125b28[_0x08ff('0x3b')]]);queues[_0x125b28[_0x08ff('0x30')]][_0x08ff('0xc')]=_0x125b28['transfertargetuniqueid'];queues[_0x125b28['transfereeuniqueid']][_0x08ff('0x17')]=0x2;queues[_0x125b28[_0x08ff('0x30')]][_0x08ff('0x7')]=queues[_0x125b28[_0x08ff('0x37')]][_0x08ff('0x7')];queues[_0x125b28[_0x08ff('0x30')]][_0x08ff('0x3d')]=queues[_0x125b28['secondtransfererlinkedid']][_0x08ff('0x3d')];queues[_0x125b28[_0x08ff('0x30')]][_0x08ff('0x3e')]=utils[_0x08ff('0x10')]();queues[_0x125b28['transfereeuniqueid']][_0x08ff('0x12')]=utils['now']();queues[_0x125b28[_0x08ff('0x30')]][_0x08ff('0x3f')]=0x0;queues[_0x125b28[_0x08ff('0x30')]]['mohtime']=0x0;}else{queues[_0x125b28[_0x08ff('0x36')]][_0x08ff('0xc')]=_0x125b28['secondtransfererlinkedid'];}}}else if(_0x125b28[_0x08ff('0x40')]==_0x125b28[_0x08ff('0x37')]){if(!_[_0x08ff('0x19')](queues[_0x125b28['origtransfererlinkedid']])){queues[_0x125b28[_0x08ff('0x36')]][_0x08ff('0x2c')]=!![];queues[_0x125b28[_0x08ff('0x36')]][_0x08ff('0x38')]=_0x08ff('0x39');queues[_0x125b28[_0x08ff('0x36')]]['transferexten']=_0x125b28[_0x08ff('0x41')];queues[_0x125b28[_0x08ff('0x36')]]['transferuniqueid']=_0x125b28[_0x08ff('0x40')];queues[_0x125b28[_0x08ff('0x36')]][_0x08ff('0x16')]=_0x08ff('0x3a');}if(!_['isNil'](queues[_0x125b28[_0x08ff('0x37')]])){if(_0x125b28[_0x08ff('0x42')]&&queues[_0x125b28[_0x08ff('0x42')]]){queues[_0x125b28['transfertargetlinkedid']][_0x08ff('0x17')]=0x1;queues[_0x125b28[_0x08ff('0x43')]]=_[_0x08ff('0x3c')](queues[_0x125b28['transfertargetlinkedid']]);queues[_0x125b28[_0x08ff('0x43')]][_0x08ff('0xc')]=_0x125b28['transfertargetuniqueid'];queues[_0x125b28[_0x08ff('0x43')]][_0x08ff('0x17')]=0x2;queues[_0x125b28[_0x08ff('0x43')]][_0x08ff('0x7')]=queues[_0x125b28[_0x08ff('0x36')]][_0x08ff('0x7')];queues[_0x125b28[_0x08ff('0x43')]]['calleridname']=queues[_0x125b28[_0x08ff('0x36')]][_0x08ff('0x3d')];queues[_0x125b28[_0x08ff('0x43')]][_0x08ff('0x3e')]=utils[_0x08ff('0x10')]();queues[_0x125b28[_0x08ff('0x43')]][_0x08ff('0x12')]=utils['now']();queues[_0x125b28['transfertargetuniqueid']][_0x08ff('0x3f')]=0x0;queues[_0x125b28[_0x08ff('0x43')]][_0x08ff('0x44')]=0x0;}else{queues[_0x125b28[_0x08ff('0x37')]][_0x08ff('0xc')]=_0x125b28[_0x08ff('0x36')];}}}}catch(_0x137046){utils[_0x08ff('0x45')](_0x137046[_0x08ff('0x46')]);}};exports['musiconholdstart']=function(_0x136917){if(!_[_0x08ff('0x19')](queues[_0x136917[_0x08ff('0x4')]])){queues[_0x136917[_0x08ff('0x4')]][_0x08ff('0x47')]=utils[_0x08ff('0x10')]();}};exports[_0x08ff('0x48')]=function(_0x4b2b3b){if(!_['isNil'](queues[_0x4b2b3b['uniqueid']])){if(!_[_0x08ff('0x19')](queues[_0x4b2b3b[_0x08ff('0x4')]][_0x08ff('0x47')])){queues[_0x4b2b3b['uniqueid']][_0x08ff('0x44')]+=utils['diffTime'](utils['now'](),queues[_0x4b2b3b[_0x08ff('0x4')]]['musiconholdstartAt']);delete queues[_0x4b2b3b[_0x08ff('0x4')]]['musiconholdstartAt'];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index a3d1ec0..161e21d 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 _0x34e8=['membername','name','UserId','CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','stack','newstate','isNil','channelstate','transfer','variable','mixmonitor_filename','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','debug','getUserByInternal','accountcode','then'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x34e8,0x12c));var _0x834e=function(_0xd80ec2,_0x270f42){_0xd80ec2=_0xd80ec2-0x0;var _0x5b503f=_0x34e8[_0xd80ec2];return _0x5b503f;};'use strict';var _=require(_0x834e('0x0'));var utils=require(_0x834e('0x1'));var recordings={};function writeDB(_0x8b339){utils[_0x834e('0x2')](_0x8b339);if(_0x8b339['accountcode']){utils[_0x834e('0x3')](_0x8b339[_0x834e('0x4')])[_0x834e('0x5')](function(_0x31bf20){if(_0x31bf20){_0x8b339[_0x834e('0x6')]=_0x31bf20[_0x834e('0x7')];_0x8b339[_0x834e('0x8')]=_0x31bf20['id'];}utils['request'](_0x834e('0x9'),_0x8b339);});}else{utils['request'](_0x834e('0x9'),_0x8b339);}}exports[_0x834e('0xa')]=function(_0x3a3ef6){try{if(_0x3a3ef6[_0x834e('0xb')]==_0x3a3ef6[_0x834e('0xc')]){recordings[_0x3a3ef6[_0x834e('0xb')]]={'uniqueid':_0x3a3ef6[_0x834e('0xb')],'accountcode':_0x3a3ef6[_0x834e('0x4')],'exten':_0x3a3ef6[_0x834e('0xd')],'context':_0x3a3ef6[_0x834e('0xe')],'channel':_0x3a3ef6[_0x834e('0xf')],'monitors':[]};}}catch(_0x36e124){utils[_0x834e('0x10')](_0x36e124[_0x834e('0x11')]);}};exports[_0x834e('0x12')]=function(_0x1e00de){try{if(!_[_0x834e('0x13')](recordings[_0x1e00de['uniqueid']])&&_0x1e00de[_0x834e('0x14')]==0x6){}else if(!_[_0x834e('0x13')](recordings[_0x1e00de['linkedid']])&&_0x1e00de[_0x834e('0x14')]==0x6&&_0x1e00de[_0x834e('0xe')]!=_0x834e('0x15')){recordings[_0x1e00de[_0x834e('0xc')]]['accountcode']=_0x1e00de[_0x834e('0x4')];}}catch(_0x302cbd){utils['error'](_0x302cbd[_0x834e('0x11')]);}};exports['varset']=function(_0x38a8cd){try{if(!_[_0x834e('0x13')](_0x38a8cd['variable'])&&!_[_0x834e('0x13')](_0x38a8cd[_0x834e('0x16')][_0x834e('0x17')])){if(_['endsWith'](_0x38a8cd[_0x834e('0x18')],_0x834e('0x19'))){_0x38a8cd[_0x834e('0x18')]=_0x38a8cd[_0x834e('0x18')][_0x834e('0x1a')](_0x834e('0x19'),_0x834e('0x1b'));}if(recordings[_0x38a8cd['linkedid']]){var _0x2545b4=_[_0x834e('0x1c')](recordings[_0x38a8cd[_0x834e('0xc')]][_0x834e('0x1d')],{'value':_0x38a8cd['value']});if(_[_0x834e('0x13')](_0x2545b4)){recordings[_0x38a8cd[_0x834e('0xc')]]['monitors'][_0x834e('0x1e')]({'value':_0x38a8cd[_0x834e('0x18')]});}}}}catch(_0x8d406e){utils['error'](_0x8d406e['stack']);}};exports[_0x834e('0x1f')]=function(_0x34563b){try{if(!_['isNil'](recordings[_0x34563b[_0x834e('0xb')]])){recordings[_0x34563b[_0x834e('0xb')]]['calleridnum']=_0x34563b[_0x834e('0x20')];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x21')]=_0x34563b['calleridname'];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x22')]=_0x34563b['connectedlinenum'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]=_0x34563b['connectedlinename'];if(recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x24')]==_0x834e('0x25')&&recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x4')]){recordings[_0x34563b[_0x834e('0xb')]]['connectedlinenum']=recordings[_0x34563b['uniqueid']]['accountcode'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]='';}recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x1d')]['forEach'](_0xb5bc06=>{var _0x11f1ce=_[_0x834e('0x26')](recordings[_0x34563b[_0x834e('0xb')]]);_0x11f1ce[_0x834e('0x18')]=_0xb5bc06[_0x834e('0x18')];writeDB(_0x11f1ce);});delete recordings[_0x34563b[_0x834e('0xb')]];}}catch(_0xfaf716){utils[_0x834e('0x10')](_0xfaf716['stack']);}};exports[_0x834e('0x27')]=function(_0x5cad11){try{if(!_[_0x834e('0x13')](recordings[_0x5cad11[_0x834e('0xb')]])){if(_0x5cad11[_0x834e('0x28')][_0x834e('0x29')]()==_0x834e('0x2a')&&_[_0x834e('0x2b')](_0x5cad11[_0x834e('0x2c')][_0x834e('0x29')](),_0x834e('0x2d'))){var _0x12b2bc=_0x5cad11['appdata'][_0x834e('0x2e')]('=');var _0x2f408a=_0x12b2bc[0x0][_0x834e('0x2f')](_0x12b2bc[0x0][_0x834e('0x30')]('(')+0x1,_0x12b2bc[0x0]['lastIndexOf'](')'));var _0x3f88ad=_0x12b2bc[0x1];recordings[_0x5cad11[_0x834e('0xb')]][_0x2f408a]=_0x3f88ad;}}}catch(_0x4b12f5){utils['error'](_0x4b12f5['stack']);}};exports[_0x834e('0x31')]=function(_0x41bf4d){try{if(!_[_0x834e('0x13')](recordings[_0x41bf4d[_0x834e('0xb')]])){recordings[_0x41bf4d[_0x834e('0xb')]][_0x834e('0x32')]=_0x41bf4d['queue'];}}catch(_0x2c2d94){utils['error'](_0x2c2d94[_0x834e('0x11')]);}}; \ No newline at end of file +var _0x9c44=['getUserByInternal','then','name','request','CreateVoiceRecording','newchannel','uniqueid','linkedid','context','channel','error','stack','isNil','transfer','variable','endsWith','value','replace','.wav49','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode'];(function(_0x750673,_0x393346){var _0x13f21f=function(_0x3a9f90){while(--_0x3a9f90){_0x750673['push'](_0x750673['shift']());}};_0x13f21f(++_0x393346);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x1ffbbf){utils[_0x49c4('0x0')](_0x1ffbbf);if(_0x1ffbbf[_0x49c4('0x1')]){utils[_0x49c4('0x2')](_0x1ffbbf[_0x49c4('0x1')])[_0x49c4('0x3')](function(_0x4e0313){if(_0x4e0313){_0x1ffbbf['membername']=_0x4e0313[_0x49c4('0x4')];_0x1ffbbf['UserId']=_0x4e0313['id'];}utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);});}else{utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);}}exports[_0x49c4('0x7')]=function(_0x511d53){try{if(_0x511d53[_0x49c4('0x8')]==_0x511d53[_0x49c4('0x9')]){recordings[_0x511d53[_0x49c4('0x8')]]={'uniqueid':_0x511d53[_0x49c4('0x8')],'accountcode':_0x511d53['accountcode'],'exten':_0x511d53['exten'],'context':_0x511d53[_0x49c4('0xa')],'channel':_0x511d53[_0x49c4('0xb')],'monitors':[]};}}catch(_0x58cad7){utils[_0x49c4('0xc')](_0x58cad7[_0x49c4('0xd')]);}};exports['newstate']=function(_0x536d42){try{if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x8')]])&&_0x536d42['channelstate']==0x6){}else if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x9')]])&&_0x536d42['channelstate']==0x6&&_0x536d42[_0x49c4('0xa')]!=_0x49c4('0xf')){recordings[_0x536d42[_0x49c4('0x9')]][_0x49c4('0x1')]=_0x536d42[_0x49c4('0x1')];}}catch(_0x18211c){utils[_0x49c4('0xc')](_0x18211c[_0x49c4('0xd')]);}};exports['varset']=function(_0x3acd06){try{if(!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')])&&!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')]['mixmonitor_filename'])){if(_[_0x49c4('0x11')](_0x3acd06[_0x49c4('0x12')],'.wav49')){_0x3acd06['value']=_0x3acd06[_0x49c4('0x12')][_0x49c4('0x13')](_0x49c4('0x14'),'.WAV');}if(recordings[_0x3acd06[_0x49c4('0x9')]]){var _0x50b151=_[_0x49c4('0x15')](recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')],{'value':_0x3acd06[_0x49c4('0x12')]});if(_[_0x49c4('0xe')](_0x50b151)){recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')][_0x49c4('0x17')]({'value':_0x3acd06[_0x49c4('0x12')]});}}}}catch(_0x578447){utils['error'](_0x578447['stack']);}};exports[_0x49c4('0x18')]=function(_0x4f0b62){try{if(!_['isNil'](recordings[_0x4f0b62[_0x49c4('0x8')]])){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x19')]=_0x4f0b62[_0x49c4('0x19')];recordings[_0x4f0b62['uniqueid']]['calleridname']=_0x4f0b62[_0x49c4('0x1a')];recordings[_0x4f0b62[_0x49c4('0x8')]]['connectedlinenum']=_0x4f0b62[_0x49c4('0x1b')];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]=_0x4f0b62[_0x49c4('0x1c')];if(recordings[_0x4f0b62['uniqueid']]['type']==_0x49c4('0x1d')&&recordings[_0x4f0b62['uniqueid']][_0x49c4('0x1')]){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1b')]=recordings[_0x4f0b62[_0x49c4('0x8')]]['accountcode'];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]='';}recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x16')][_0x49c4('0x1e')](_0x29f835=>{var _0x26ba17=_[_0x49c4('0x1f')](recordings[_0x4f0b62[_0x49c4('0x8')]]);_0x26ba17[_0x49c4('0x12')]=_0x29f835[_0x49c4('0x12')];writeDB(_0x26ba17);});delete recordings[_0x4f0b62['uniqueid']];}}catch(_0x4f4495){utils['error'](_0x4f4495[_0x49c4('0xd')]);}};exports[_0x49c4('0x20')]=function(_0x1eb035){try{if(!_[_0x49c4('0xe')](recordings[_0x1eb035[_0x49c4('0x8')]])){if(_0x1eb035['application'][_0x49c4('0x21')]()==_0x49c4('0x22')&&_[_0x49c4('0x23')](_0x1eb035[_0x49c4('0x24')]['toLowerCase'](),'cdr')){var _0xce57ef=_0x1eb035[_0x49c4('0x24')][_0x49c4('0x25')]('=');var _0x13b3b4=_0xce57ef[0x0][_0x49c4('0x26')](_0xce57ef[0x0]['lastIndexOf']('(')+0x1,_0xce57ef[0x0][_0x49c4('0x27')](')'));var _0x84c621=_0xce57ef[0x1];recordings[_0x1eb035[_0x49c4('0x8')]][_0x13b3b4]=_0x84c621;}}}catch(_0x512d02){utils['error'](_0x512d02[_0x49c4('0xd')]);}};exports[_0x49c4('0x28')]=function(_0x3bec0a){try{if(!_[_0x49c4('0xe')](recordings[_0x3bec0a[_0x49c4('0x8')]])){recordings[_0x3bec0a[_0x49c4('0x8')]][_0x49c4('0x29')]=_0x3bec0a[_0x49c4('0x29')];}}catch(_0x3209cd){utils['error'](_0x3209cd[_0x49c4('0xd')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index af94c73..7062031 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 _0x520e=['origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','TRANSFER|%s','request','CreateVoiceTransferReport','type','blind','error','stack','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten'];(function(_0x2bf457,_0x14622f){var _0x337016=function(_0x3dc5d4){while(--_0x3dc5d4){_0x2bf457['push'](_0x2bf457['shift']());}};_0x337016(++_0x14622f);}(_0x520e,0x90));var _0xe520=function(_0x147497,_0x43e433){_0x147497=_0x147497-0x0;var _0x35f45=_0x520e[_0x147497];return _0x35f45;};'use strict';var _=require(_0xe520('0x0'));var util=require(_0xe520('0x1'));var utils=require(_0xe520('0x2'));function writeDB(_0x298ede){utils[_0xe520('0x3')](util[_0xe520('0x4')](_0xe520('0x5'),_0x298ede['type']));utils[_0xe520('0x6')](_0xe520('0x7'),_0x298ede);}exports['blindtransfer']=function(_0x1fba44){try{_0x1fba44[_0xe520('0x8')]=_0xe520('0x9');writeDB(_0x1fba44);}catch(_0x1da5df){utils[_0xe520('0xa')](_0x1da5df[_0xe520('0xb')]);}};exports['attendedtransfer']=function(_0x38d5d6){try{_0x38d5d6=_[_0xe520('0xc')](_0x38d5d6,{'transfererchannel':_0x38d5d6[_0xe520('0xd')],'transferercalleridnum':_0x38d5d6[_0xe520('0xe')],'transferercalleridname':_0x38d5d6[_0xe520('0xf')],'transfererconnectedlinenum':_0x38d5d6[_0xe520('0x10')],'transfererconnectedlinename':_0x38d5d6[_0xe520('0x11')],'transfereraccountcode':_0x38d5d6[_0xe520('0x12')],'transferercontext':_0x38d5d6[_0xe520('0x13')],'transfererexten':_0x38d5d6[_0xe520('0x14')],'transfererlinkedid':_0x38d5d6[_0xe520('0x15')],'context':_0x38d5d6[_0xe520('0x16')],'extension':_0x38d5d6[_0xe520('0x17')],'type':_0xe520('0x18')});if(_[_0xe520('0x19')](_0x38d5d6[_0xe520('0x1a')])){_0x38d5d6=_['assign'](_0x38d5d6,{'transfereechannel':_0x38d5d6['transfertargetchannel'],'transfereecalleridnum':_0x38d5d6[_0xe520('0x1b')],'transfereecalleridname':_0x38d5d6['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x38d5d6[_0xe520('0x1c')],'transfereeconnectedlinename':_0x38d5d6[_0xe520('0x1d')],'transfereeaccountcode':_0x38d5d6['transfertargetaccountcode'],'transfereecontext':_0x38d5d6[_0xe520('0x1e')],'transfereeexten':_0x38d5d6[_0xe520('0x1f')],'transfereelinkedid':_0x38d5d6[_0xe520('0x20')]});}writeDB(_0x38d5d6);}catch(_0x460334){utils[_0xe520('0xa')](_0x460334[_0xe520('0xb')]);}}; \ No newline at end of file +var _0xac9d=['transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','TRANSFER|%s','type','CreateVoiceTransferReport','blind','error','stack','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','attended','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum'];(function(_0x57142f,_0x574baf){var _0x206e14=function(_0x14dd38){while(--_0x14dd38){_0x57142f['push'](_0x57142f['shift']());}};_0x206e14(++_0x574baf);}(_0xac9d,0x14d));var _0xdac9=function(_0x486008,_0x2b2d05){_0x486008=_0x486008-0x0;var _0x2fefc7=_0xac9d[_0x486008];return _0x2fefc7;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var utils=require(_0xdac9('0x2'));function writeDB(_0x1e6d33){utils[_0xdac9('0x3')](util[_0xdac9('0x4')](_0xdac9('0x5'),_0x1e6d33[_0xdac9('0x6')]));utils['request'](_0xdac9('0x7'),_0x1e6d33);}exports['blindtransfer']=function(_0x3d56ae){try{_0x3d56ae[_0xdac9('0x6')]=_0xdac9('0x8');writeDB(_0x3d56ae);}catch(_0x776b6c){utils[_0xdac9('0x9')](_0x776b6c[_0xdac9('0xa')]);}};exports['attendedtransfer']=function(_0x2b1d6f){try{_0x2b1d6f=_['assign'](_0x2b1d6f,{'transfererchannel':_0x2b1d6f[_0xdac9('0xb')],'transferercalleridnum':_0x2b1d6f[_0xdac9('0xc')],'transferercalleridname':_0x2b1d6f[_0xdac9('0xd')],'transfererconnectedlinenum':_0x2b1d6f[_0xdac9('0xe')],'transfererconnectedlinename':_0x2b1d6f[_0xdac9('0xf')],'transfereraccountcode':_0x2b1d6f[_0xdac9('0x10')],'transferercontext':_0x2b1d6f[_0xdac9('0x11')],'transfererexten':_0x2b1d6f[_0xdac9('0x12')],'transfererlinkedid':_0x2b1d6f[_0xdac9('0x13')],'context':_0x2b1d6f['origtransferercontext'],'extension':_0x2b1d6f[_0xdac9('0x14')],'type':_0xdac9('0x15')});if(_['isNil'](_0x2b1d6f[_0xdac9('0x16')])){_0x2b1d6f=_[_0xdac9('0x17')](_0x2b1d6f,{'transfereechannel':_0x2b1d6f[_0xdac9('0x18')],'transfereecalleridnum':_0x2b1d6f['transfertargetcalleridnum'],'transfereecalleridname':_0x2b1d6f[_0xdac9('0x19')],'transfereeconnectedlinenum':_0x2b1d6f[_0xdac9('0x1a')],'transfereeconnectedlinename':_0x2b1d6f[_0xdac9('0x1b')],'transfereeaccountcode':_0x2b1d6f['transfertargetaccountcode'],'transfereecontext':_0x2b1d6f['transfertargetcontext'],'transfereeexten':_0x2b1d6f[_0xdac9('0x1c')],'transfereelinkedid':_0x2b1d6f[_0xdac9('0x1d')]});}writeDB(_0x2b1d6f);}catch(_0x50f9fe){utils[_0xdac9('0x9')](_0x50f9fe[_0xdac9('0xa')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 3eb0ebf..5ac495a 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 _0xfd25=['NOTFOUND','catch','getUserByInterface','getVoiceQueueByName','GetVoiceQueue','type','acw','GETVOICEQUEUEBYNAME|','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','bluebird','client','http','../../config/logger','xdr','info','debug','stringify','stack','request','then','error','internal','name','interface','GETUSER|','result','length','FOUND'];(function(_0x362ffa,_0x257069){var _0x536dd4=function(_0x4881ac){while(--_0x4881ac){_0x362ffa['push'](_0x362ffa['shift']());}};_0x536dd4(++_0x257069);}(_0xfd25,0x168));var _0x5fd2=function(_0x9c0ddd,_0x7abdf7){_0x9c0ddd=_0x9c0ddd-0x0;var _0x154806=_0xfd25[_0x9c0ddd];return _0x154806;};'use strict';var jayson=require(_0x5fd2('0x0'));var moment=require('moment');var BPromise=require(_0x5fd2('0x1'));var client=jayson[_0x5fd2('0x2')][_0x5fd2('0x3')]({'port':0x2329});var logger=require(_0x5fd2('0x4'))(_0x5fd2('0x5'));exports[_0x5fd2('0x6')]=function(_0x2d2b06){logger['info'](_0x2d2b06);};exports[_0x5fd2('0x7')]=function(_0x39ff02){logger[_0x5fd2('0x7')](JSON[_0x5fd2('0x8')](_0x39ff02));};exports['error']=function(_0x413bc1){logger['error'](_0x413bc1[_0x5fd2('0x9')]);};exports['request']=function(_0x54cfdb,_0x4923ab){return client[_0x5fd2('0xa')](_0x54cfdb,{'body':_0x4923ab})[_0x5fd2('0xb')](function(_0x2810cb){logger[_0x5fd2('0x7')](JSON[_0x5fd2('0x8')](_0x2810cb));})['catch'](function(_0x1e9906){logger[_0x5fd2('0xc')](_0x1e9906[_0x5fd2('0x9')]);});};function getUser(_0x41cbf3){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0x5fd2('0xd'),_0x5fd2('0xe'),_0x5fd2('0xf')],'where':_0x41cbf3,'limit':0x1}})[_0x5fd2('0xb')](function(_0x2ace8d){logger['info'](_0x5fd2('0x10')+JSON['stringify'](_0x41cbf3)+'|'+(_0x2ace8d[_0x5fd2('0x11')][_0x5fd2('0x12')]?_0x5fd2('0x13'):_0x5fd2('0x14')));return _0x2ace8d['result']['length']?_0x2ace8d[_0x5fd2('0x11')][0x0]:null;});}exports['getUserByInternal']=function(_0x39d5e7){return new BPromise(function(_0xc7d031,_0x39c4a0){if(_0x39d5e7){return getUser({'internal':_0x39d5e7})[_0x5fd2('0xb')](function(_0x3693ba){return _0xc7d031(_0x3693ba);})[_0x5fd2('0x15')](function(_0x599fde){logger['error'](_0x599fde['stack']);return _0xc7d031(null);});}else{return _0xc7d031(null);}});};exports[_0x5fd2('0x16')]=function(_0x6810d2){return new BPromise(function(_0x5d9dd3,_0x7b6e4c){if(_0x6810d2){return getUser({'interface':_0x6810d2})[_0x5fd2('0xb')](function(_0x3071fb){return _0x5d9dd3(_0x3071fb);})[_0x5fd2('0x15')](function(_0x59d1bf){logger[_0x5fd2('0xc')](_0x59d1bf[_0x5fd2('0x9')]);return _0x5d9dd3(null);});}else{return _0x5d9dd3(null);}});};exports['getUserByName']=function(_0x306ef6){return new BPromise(function(_0x213840,_0x6e3272){if(_0x306ef6){return getUser({'name':_0x306ef6})[_0x5fd2('0xb')](function(_0x53deeb){return _0x213840(_0x53deeb);})['catch'](function(_0x582a8a){logger[_0x5fd2('0xc')](_0x582a8a[_0x5fd2('0x9')]);return _0x213840(null);});}else{return _0x213840(null);}});};exports[_0x5fd2('0x17')]=function(_0x31d20d){return new BPromise(function(_0x1d11fe,_0x3f9747){if(_0x31d20d){return client[_0x5fd2('0xa')](_0x5fd2('0x18'),{'options':{'raw':!![],'attributes':['id','name',_0x5fd2('0x19'),_0x5fd2('0x1a'),'acwTimeout'],'where':{'name':_0x31d20d},'limit':0x1}})[_0x5fd2('0xb')](function(_0x9c88b6){logger[_0x5fd2('0x6')](_0x5fd2('0x1b')+_0x31d20d+'|'+(_0x9c88b6[_0x5fd2('0x11')][_0x5fd2('0x12')]?'FOUND':_0x5fd2('0x14')));return _0x1d11fe(_0x9c88b6[_0x5fd2('0x11')][_0x5fd2('0x12')]?_0x9c88b6[_0x5fd2('0x11')][0x0]:null);})['catch'](function(_0xca2e2e){logger[_0x5fd2('0xc')](_0xca2e2e[_0x5fd2('0x9')]);return _0x1d11fe(null);});}else{return _0x1d11fe(null);}});};exports[_0x5fd2('0x1c')]=function(_0x504633,_0x4bdf94){return moment(_0x504633)['add'](_0x4bdf94,_0x5fd2('0x1d'))[_0x5fd2('0x1e')](_0x5fd2('0x1f'));};exports[_0x5fd2('0x20')]=function(_0x2aadba,_0xb8a56f){return moment(_0x2aadba)['subtract'](_0xb8a56f,_0x5fd2('0x1d'))['format'](_0x5fd2('0x1f'));};exports['diffTime']=function(_0x132e65,_0x19a75b){return moment(_0x132e65)[_0x5fd2('0x21')](moment(_0x19a75b),_0x5fd2('0x1d'));};exports[_0x5fd2('0x22')]=function(_0x40a251,_0x3d219f){return parseInt(_0x40a251,0xa)+parseInt(_0x3d219f,0xa);};exports[_0x5fd2('0x23')]=function(){return moment()[_0x5fd2('0x1e')](_0x5fd2('0x1f'));};exports[_0x5fd2('0x24')]=function(_0x2edde2,_0x46f91e){if(_0x46f91e){return moment(_0x2edde2)['isAfter'](_0x46f91e);}else{return!![];}};exports[_0x5fd2('0x25')]=function(_0x20a12e,_0x4b8bfd){if(_0x4b8bfd){return moment(_0x20a12e)[_0x5fd2('0x25')](_0x4b8bfd);}else if(_0x20a12e){return!![];}else{return![];}}; \ No newline at end of file +var _0xb428=['now','isAfter','isBefore','jayson/promise','moment','client','xdr','info','stringify','error','stack','request','then','debug','catch','GetUser','name','interface','GETUSER|','result','length','FOUND','getUserByInternal','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','GETVOICEQUEUEBYNAME|','NOTFOUND','addTime','add','format','YYYY-MM-DD\x20HH:mm:ss','seconds','diff'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb428,0x16b));var _0x8b42=function(_0x26425a,_0x1b4d6f){_0x26425a=_0x26425a-0x0;var _0x12802a=_0xb428[_0x26425a];return _0x12802a;};'use strict';var jayson=require(_0x8b42('0x0'));var moment=require(_0x8b42('0x1'));var BPromise=require('bluebird');var client=jayson[_0x8b42('0x2')]['http']({'port':0x2329});var logger=require('../../config/logger')(_0x8b42('0x3'));exports[_0x8b42('0x4')]=function(_0x328408){logger[_0x8b42('0x4')](_0x328408);};exports['debug']=function(_0x2cf859){logger['debug'](JSON[_0x8b42('0x5')](_0x2cf859));};exports['error']=function(_0x450ed1){logger[_0x8b42('0x6')](_0x450ed1[_0x8b42('0x7')]);};exports[_0x8b42('0x8')]=function(_0x2a4df9,_0xa0efe7){return client[_0x8b42('0x8')](_0x2a4df9,{'body':_0xa0efe7})[_0x8b42('0x9')](function(_0x3fb827){logger[_0x8b42('0xa')](JSON[_0x8b42('0x5')](_0x3fb827));})[_0x8b42('0xb')](function(_0x1db0d8){logger[_0x8b42('0x6')](_0x1db0d8[_0x8b42('0x7')]);});};function getUser(_0x378d2a){return client[_0x8b42('0x8')](_0x8b42('0xc'),{'options':{'raw':!![],'attributes':['id','internal',_0x8b42('0xd'),_0x8b42('0xe')],'where':_0x378d2a,'limit':0x1}})['then'](function(_0x1afa97){logger[_0x8b42('0x4')](_0x8b42('0xf')+JSON[_0x8b42('0x5')](_0x378d2a)+'|'+(_0x1afa97[_0x8b42('0x10')][_0x8b42('0x11')]?_0x8b42('0x12'):'NOTFOUND'));return _0x1afa97['result'][_0x8b42('0x11')]?_0x1afa97[_0x8b42('0x10')][0x0]:null;});}exports[_0x8b42('0x13')]=function(_0x530b6c){return new BPromise(function(_0x802715,_0x885045){if(_0x530b6c){return getUser({'internal':_0x530b6c})[_0x8b42('0x9')](function(_0x537d79){return _0x802715(_0x537d79);})['catch'](function(_0x5bac8a){logger['error'](_0x5bac8a['stack']);return _0x802715(null);});}else{return _0x802715(null);}});};exports['getUserByInterface']=function(_0x5166ef){return new BPromise(function(_0x28ee3d,_0x2f4dfb){if(_0x5166ef){return getUser({'interface':_0x5166ef})[_0x8b42('0x9')](function(_0x4650f9){return _0x28ee3d(_0x4650f9);})[_0x8b42('0xb')](function(_0x46a825){logger[_0x8b42('0x6')](_0x46a825[_0x8b42('0x7')]);return _0x28ee3d(null);});}else{return _0x28ee3d(null);}});};exports[_0x8b42('0x14')]=function(_0x1ce043){return new BPromise(function(_0x48726e,_0x5cc38f){if(_0x1ce043){return getUser({'name':_0x1ce043})[_0x8b42('0x9')](function(_0x1a5010){return _0x48726e(_0x1a5010);})['catch'](function(_0x317abb){logger[_0x8b42('0x6')](_0x317abb[_0x8b42('0x7')]);return _0x48726e(null);});}else{return _0x48726e(null);}});};exports[_0x8b42('0x15')]=function(_0x56e2ad){return new BPromise(function(_0x4684b0,_0x1d04ee){if(_0x56e2ad){return client[_0x8b42('0x8')](_0x8b42('0x16'),{'options':{'raw':!![],'attributes':['id',_0x8b42('0xd'),_0x8b42('0x17'),_0x8b42('0x18'),'acwTimeout'],'where':{'name':_0x56e2ad},'limit':0x1}})[_0x8b42('0x9')](function(_0x5a627f){logger[_0x8b42('0x4')](_0x8b42('0x19')+_0x56e2ad+'|'+(_0x5a627f[_0x8b42('0x10')][_0x8b42('0x11')]?_0x8b42('0x12'):_0x8b42('0x1a')));return _0x4684b0(_0x5a627f['result']['length']?_0x5a627f[_0x8b42('0x10')][0x0]:null);})[_0x8b42('0xb')](function(_0x9bbdf7){logger[_0x8b42('0x6')](_0x9bbdf7[_0x8b42('0x7')]);return _0x4684b0(null);});}else{return _0x4684b0(null);}});};exports[_0x8b42('0x1b')]=function(_0x3a3ca9,_0x34c723){return moment(_0x3a3ca9)[_0x8b42('0x1c')](_0x34c723,'seconds')[_0x8b42('0x1d')](_0x8b42('0x1e'));};exports['subtractTime']=function(_0x5d9d12,_0x4a3172){return moment(_0x5d9d12)['subtract'](_0x4a3172,_0x8b42('0x1f'))[_0x8b42('0x1d')](_0x8b42('0x1e'));};exports['diffTime']=function(_0x6fafaf,_0x33768d){return moment(_0x6fafaf)[_0x8b42('0x20')](moment(_0x33768d),'seconds');};exports['sumTime']=function(_0x4fc247,_0x2d7171){return parseInt(_0x4fc247,0xa)+parseInt(_0x2d7171,0xa);};exports[_0x8b42('0x21')]=function(){return moment()['format'](_0x8b42('0x1e'));};exports[_0x8b42('0x22')]=function(_0x2c17be,_0x245d50){if(_0x245d50){return moment(_0x2c17be)[_0x8b42('0x22')](_0x245d50);}else{return!![];}};exports[_0x8b42('0x23')]=function(_0x258c22,_0x1ed2cf){if(_0x1ed2cf){return moment(_0x258c22)[_0x8b42('0x23')](_0x1ed2cf);}else if(_0x258c22){return!![];}else{return![];}}; \ No newline at end of file -- 1.7.1